From: Cris Di Sclafani Date: Fri, 7 Aug 2020 11:13:28 +0000 (+0200) Subject: Built motion from commit (unavailable).|2.5.0 X-Git-Url: http://repos.xcallymotion.com/base/%22https:/wiki.xcallymotion.com/display/XMV//%22?a=commitdiff_plain;h=b9c93192bd30049b5b102918e518784ae6c3af8a;p=motion2.git Built motion from commit (unavailable).|2.5.0 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 6bc7923..f3b2cec 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-07T10:51:20.915Z", "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-07T11:06:48.107Z", "url": "http://apidocjs.com", "version": "0.19.0" } }); diff --git a/apidoc/api_project.json b/apidoc/api_project.json index a68e631..0e5b5a9 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-07T10:51:20.915Z", "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-07T11:06:48.107Z", "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 0236698..6f0f873 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 _0x0009=['STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','TEXT','sequelize','exports','getDataValue','action'];(function(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0x0009,0x161));var _0x9000=function(_0x188360,_0x3d93f8){_0x188360=_0x188360-0x0;var _0x1fbe6d=_0x0009[_0x188360];return _0x1fbe6d;};'use strict';var Sequelize=require(_0x9000('0x0'));module[_0x9000('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x193f4d){return this[_0x9000('0x2')](_0x9000('0x3'));}},'action':{'type':Sequelize[_0x9000('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x9000('0x5'),_0x9000('0x6'),_0x9000('0x7'),_0x9000('0x8'),_0x9000('0x9'),_0x9000('0xa'),_0x9000('0xb'),_0x9000('0xc')]],'msg':_0x9000('0xd')}},'comment':_0x9000('0xd')},'data1':{'type':Sequelize[_0x9000('0x4')](0x1000),'comment':_0x9000('0xe')},'data2':{'type':Sequelize[_0x9000('0x4')](0x1000),'comment':_0x9000('0xf')},'data3':{'type':Sequelize[_0x9000('0x4')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize[_0x9000('0x4')](0x1000)},'data5':{'type':Sequelize[_0x9000('0x4')](0x1000)},'data6':{'type':Sequelize[_0x9000('0x4')]},'data7':{'type':Sequelize[_0x9000('0x10')]}}; \ No newline at end of file +var _0x3aa2=['action','STRING','contactManager','integration','jscripty','urlForward','browser','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x31172e,_0xa59e5){var _0x414ada=function(_0x37ede4){while(--_0x37ede4){_0x31172e['push'](_0x31172e['shift']());}};_0x414ada(++_0xa59e5);}(_0x3aa2,0x18c));var _0x23aa=function(_0x5d160,_0xa4838e){_0x5d160=_0x5d160-0x0;var _0x1d180d=_0x3aa2[_0x5d160];return _0x1d180d;};'use strict';var Sequelize=require(_0x23aa('0x0'));module[_0x23aa('0x1')]={'name':{'type':Sequelize[_0x23aa('0x2')],'get':function(_0x3b18cb){return this[_0x23aa('0x3')](_0x23aa('0x4'));}},'action':{'type':Sequelize[_0x23aa('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x23aa('0x6'),_0x23aa('0x7'),'motionbar',_0x23aa('0x8'),_0x23aa('0x9'),_0x23aa('0xa'),'bot','script']],'msg':_0x23aa('0xb')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x23aa('0x5')](0x1000),'comment':_0x23aa('0xc')},'data2':{'type':Sequelize[_0x23aa('0x5')](0x1000),'comment':_0x23aa('0xd')},'data3':{'type':Sequelize[_0x23aa('0x5')](0x1000),'comment':_0x23aa('0xe')},'data4':{'type':Sequelize[_0x23aa('0x5')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0x23aa('0x5')]},'data7':{'type':Sequelize[_0x23aa('0xf')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 17ac1b8..4e4d297 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 _0x3a98=['catch','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','save','update','destroy','then','sendStatus','error','name','send','body','Action'];(function(_0x2e77c3,_0x578abc){var _0x5c8666=function(_0x34ff41){while(--_0x34ff41){_0x2e77c3['push'](_0x2e77c3['shift']());}};_0x5c8666(++_0x578abc);}(_0x3a98,0x1e6));var _0x83a9=function(_0x29ae80,_0x3579f1){_0x29ae80=_0x29ae80-0x0;var _0x5d6d71=_0x3a98[_0x29ae80];return _0x5d6d71;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x83a9('0x0'));var zipdir=require(_0x83a9('0x1'));var jsonpatch=require(_0x83a9('0x2'));var rp=require(_0x83a9('0x3'));var moment=require(_0x83a9('0x4'));var BPromise=require(_0x83a9('0x5'));var Mustache=require(_0x83a9('0x6'));var util=require(_0x83a9('0x7'));var path=require(_0x83a9('0x8'));var sox=require(_0x83a9('0x9'));var csv=require(_0x83a9('0xa'));var ejs=require(_0x83a9('0xb'));var fs=require('fs');var _=require(_0x83a9('0xc'));var squel=require(_0x83a9('0xd'));var crypto=require(_0x83a9('0xe'));var jsforce=require(_0x83a9('0xf'));var deskjs=require(_0x83a9('0x10'));var toCsv=require(_0x83a9('0xa'));var querystring=require(_0x83a9('0x11'));var Papa=require(_0x83a9('0x12'));var Redis=require(_0x83a9('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x83a9('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x83a9('0x15'));var logger=require(_0x83a9('0x16'))(_0x83a9('0x17'));var utils=require('../../config/utils');var config=require(_0x83a9('0x18'));var db=require(_0x83a9('0x19'))['db'];function respondWithStatusCode(_0x4634d7,_0xd0b270){_0xd0b270=_0xd0b270||0xcc;return function(_0x1b70d0){if(_0x1b70d0){return _0x4634d7['sendStatus'](_0xd0b270);}return _0x4634d7[_0x83a9('0x1a')](_0xd0b270)[_0x83a9('0x1b')]();};}function respondWithResult(_0x25526d,_0x291a8b){_0x291a8b=_0x291a8b||0xc8;return function(_0x246180){if(_0x246180){return _0x25526d[_0x83a9('0x1a')](_0x291a8b)[_0x83a9('0x1c')](_0x246180);}};}function respondWithFilteredResult(_0x34eb83,_0x4910a6){return function(_0x11110f){if(_0x11110f){var _0x1da4fc=_0x11110f['count'],_0x7b985a=_0x4910a6[_0x83a9('0x1d')],_0x26db79=_0x4910a6[_0x83a9('0x1d')]+_0x4910a6[_0x83a9('0x1e')],_0x405686;if(_0x26db79>=_0x1da4fc){_0x26db79=_0x1da4fc;_0x405686=0xc8;}else{_0x405686=0xce;}_0x34eb83[_0x83a9('0x1a')](_0x405686);return _0x34eb83[_0x83a9('0x1f')]('Content-Range',_0x7b985a+'-'+_0x26db79+'/'+_0x1da4fc)[_0x83a9('0x1c')](_0x11110f);}return null;};}function patchUpdates(_0x219bba){return function(_0x33edce){try{jsonpatch['apply'](_0x33edce,_0x219bba,!![]);}catch(_0x22fdf0){return BPromise['reject'](_0x22fdf0);}return _0x33edce[_0x83a9('0x20')]();};}function saveUpdates(_0xd7b4e5,_0x1f3f22){return function(_0x3cc55b){if(_0x3cc55b){return _0x3cc55b[_0x83a9('0x21')](_0xd7b4e5)['then'](function(_0x50b463){return _0x50b463;});}return null;};}function removeEntity(_0x59b5c9,_0x2bc17f){return function(_0x3f051f){if(_0x3f051f){return _0x3f051f[_0x83a9('0x22')]()[_0x83a9('0x23')](function(){_0x59b5c9[_0x83a9('0x1a')](0xcc)[_0x83a9('0x1b')]();});}};}function handleEntityNotFound(_0x3fd736,_0x328ea2){return function(_0x49f497){if(!_0x49f497){_0x3fd736[_0x83a9('0x24')](0x194);}return _0x49f497;};}function handleError(_0x1b9629,_0x1d91f9){_0x1d91f9=_0x1d91f9||0x1f4;return function(_0x495621){logger[_0x83a9('0x25')](_0x495621['stack']);if(_0x495621[_0x83a9('0x26')]){delete _0x495621[_0x83a9('0x26')];}_0x1b9629['status'](_0x1d91f9)[_0x83a9('0x27')](_0x495621);};}exports['update']=function(_0xf4e16a,_0x444c5a){if(_0xf4e16a[_0x83a9('0x28')]['id']){delete _0xf4e16a[_0x83a9('0x28')]['id'];}return db[_0x83a9('0x29')]['find']({'where':{'id':_0xf4e16a['params']['id']}})[_0x83a9('0x23')](handleEntityNotFound(_0x444c5a,null))[_0x83a9('0x23')](saveUpdates(_0xf4e16a[_0x83a9('0x28')],null))[_0x83a9('0x23')](respondWithResult(_0x444c5a,null))[_0x83a9('0x2a')](handleError(_0x444c5a,null));};exports[_0x83a9('0x22')]=function(_0x5bef46,_0x5c4393){return db[_0x83a9('0x29')][_0x83a9('0x2b')]({'where':{'id':_0x5bef46['params']['id']}})[_0x83a9('0x23')](handleEntityNotFound(_0x5c4393,null))[_0x83a9('0x23')](removeEntity(_0x5c4393,null))[_0x83a9('0x2a')](handleError(_0x5c4393,null));}; \ No newline at end of file +var _0x62b1=['api','../../config/utils','../../mysqldb','sendStatus','end','count','offset','Content-Range','json','apply','reject','save','update','then','status','error','stack','name','send','body','Action','params','find','catch','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x62b1,0xc8));var _0x162b=function(_0x23fed1,_0x1aa8a3){_0x23fed1=_0x23fed1-0x0;var _0x3a110c=_0x62b1[_0x23fed1];return _0x3a110c;};'use strict';var pdf=require(_0x162b('0x0'));var emlformat=require(_0x162b('0x1'));var rimraf=require(_0x162b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x162b('0x3'));var rp=require('request-promise');var moment=require(_0x162b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x162b('0x5'));var util=require(_0x162b('0x6'));var path=require(_0x162b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x162b('0x8'));var fs=require('fs');var _=require(_0x162b('0x9'));var squel=require(_0x162b('0xa'));var crypto=require('crypto');var jsforce=require(_0x162b('0xb'));var deskjs=require(_0x162b('0xc'));var toCsv=require(_0x162b('0xd'));var querystring=require(_0x162b('0xe'));var Papa=require(_0x162b('0xf'));var Redis=require('ioredis');var authService=require(_0x162b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x162b('0x11'));var hardwareService=require(_0x162b('0x12'));var logger=require(_0x162b('0x13'))(_0x162b('0x14'));var utils=require(_0x162b('0x15'));var config=require('../../config/environment');var db=require(_0x162b('0x16'))['db'];function respondWithStatusCode(_0x1e5afe,_0x46b8a5){_0x46b8a5=_0x46b8a5||0xcc;return function(_0x34a582){if(_0x34a582){return _0x1e5afe[_0x162b('0x17')](_0x46b8a5);}return _0x1e5afe['status'](_0x46b8a5)[_0x162b('0x18')]();};}function respondWithResult(_0x4b5ab0,_0x4cd6e0){_0x4cd6e0=_0x4cd6e0||0xc8;return function(_0x8a8050){if(_0x8a8050){return _0x4b5ab0['status'](_0x4cd6e0)['json'](_0x8a8050);}};}function respondWithFilteredResult(_0x6d0d80,_0x13fd4e){return function(_0x371b15){if(_0x371b15){var _0x334719=_0x371b15[_0x162b('0x19')],_0x303af5=_0x13fd4e[_0x162b('0x1a')],_0x2e1714=_0x13fd4e[_0x162b('0x1a')]+_0x13fd4e['limit'],_0x341164;if(_0x2e1714>=_0x334719){_0x2e1714=_0x334719;_0x341164=0xc8;}else{_0x341164=0xce;}_0x6d0d80['status'](_0x341164);return _0x6d0d80['set'](_0x162b('0x1b'),_0x303af5+'-'+_0x2e1714+'/'+_0x334719)[_0x162b('0x1c')](_0x371b15);}return null;};}function patchUpdates(_0x18d65a){return function(_0xb1a625){try{jsonpatch[_0x162b('0x1d')](_0xb1a625,_0x18d65a,!![]);}catch(_0x141176){return BPromise[_0x162b('0x1e')](_0x141176);}return _0xb1a625[_0x162b('0x1f')]();};}function saveUpdates(_0xa65bc0,_0x4449f8){return function(_0x4c5ce9){if(_0x4c5ce9){return _0x4c5ce9[_0x162b('0x20')](_0xa65bc0)[_0x162b('0x21')](function(_0x342eca){return _0x342eca;});}return null;};}function removeEntity(_0x350b64,_0x4893a0){return function(_0x383b96){if(_0x383b96){return _0x383b96['destroy']()[_0x162b('0x21')](function(){_0x350b64[_0x162b('0x22')](0xcc)[_0x162b('0x18')]();});}};}function handleEntityNotFound(_0x5e6229,_0xfc1eaf){return function(_0x34d63f){if(!_0x34d63f){_0x5e6229[_0x162b('0x17')](0x194);}return _0x34d63f;};}function handleError(_0x4169f1,_0x7aa022){_0x7aa022=_0x7aa022||0x1f4;return function(_0x5a3d04){logger[_0x162b('0x23')](_0x5a3d04[_0x162b('0x24')]);if(_0x5a3d04[_0x162b('0x25')]){delete _0x5a3d04[_0x162b('0x25')];}_0x4169f1[_0x162b('0x22')](_0x7aa022)[_0x162b('0x26')](_0x5a3d04);};}exports[_0x162b('0x20')]=function(_0x30f2d8,_0x2104a5){if(_0x30f2d8[_0x162b('0x27')]['id']){delete _0x30f2d8['body']['id'];}return db[_0x162b('0x28')]['find']({'where':{'id':_0x30f2d8[_0x162b('0x29')]['id']}})['then'](handleEntityNotFound(_0x2104a5,null))['then'](saveUpdates(_0x30f2d8[_0x162b('0x27')],null))[_0x162b('0x21')](respondWithResult(_0x2104a5,null))['catch'](handleError(_0x2104a5,null));};exports['destroy']=function(_0x345258,_0x19ac91){return db[_0x162b('0x28')][_0x162b('0x2a')]({'where':{'id':_0x345258[_0x162b('0x29')]['id']}})[_0x162b('0x21')](handleEntityNotFound(_0x19ac91,null))['then'](removeEntity(_0x19ac91,null))[_0x162b('0x2b')](handleError(_0x19ac91,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 1f05dba..f1dc152 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 _0x4ce9=['define','Action','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x4ce9,0x7a));var _0x94ce=function(_0x5eae78,_0x43249a){_0x5eae78=_0x5eae78-0x0;var _0x512edb=_0x4ce9[_0x5eae78];return _0x512edb;};'use strict';var _=require(_0x94ce('0x0'));var util=require(_0x94ce('0x1'));var logger=require(_0x94ce('0x2'))('api');var moment=require(_0x94ce('0x3'));var BPromise=require(_0x94ce('0x4'));var rp=require(_0x94ce('0x5'));var fs=require('fs');var path=require(_0x94ce('0x6'));var rimraf=require(_0x94ce('0x7'));var config=require(_0x94ce('0x8'));var attributes=require(_0x94ce('0x9'));module['exports']=function(_0x547b14,_0x58cd11){return _0x547b14[_0x94ce('0xa')](_0x94ce('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf36d=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','lodash','util'];(function(_0x310e23,_0x4b932c){var _0x331e6e=function(_0x48134e){while(--_0x48134e){_0x310e23['push'](_0x310e23['shift']());}};_0x331e6e(++_0x4b932c);}(_0xf36d,0xfa));var _0xdf36=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xf36d[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0xdf36('0x0'));var util=require(_0xdf36('0x1'));var logger=require(_0xdf36('0x2'))(_0xdf36('0x3'));var moment=require('moment');var BPromise=require(_0xdf36('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf36('0x5'));var rimraf=require(_0xdf36('0x6'));var config=require(_0xdf36('0x7'));var attributes=require(_0xdf36('0x8'));module[_0xdf36('0x9')]=function(_0x209444,_0x3856d6){return _0x209444[_0xdf36('0xa')](_0xdf36('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index a4d4d41..366feb5 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 _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(_0x525212,_0x59e111){var _0x136566=function(_0x35942d){while(--_0x35942d){_0x525212['push'](_0x525212['shift']());}};_0x136566(++_0x59e111);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x510c60,_0x50247e){_0x510c60=_0x510c60-0x0;var _0x49c4aa=_0xcb91[_0x510c60];return _0x49c4aa;};'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 +var _0xbaf0=['client','http','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5fa520,_0xaf0e7d){var _0x1bf6c4=function(_0x2a7440){while(--_0x2a7440){_0x5fa520['push'](_0x5fa520['shift']());}};_0x1bf6c4(++_0xaf0e7d);}(_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')]('Action,\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/action/index.js b/server/api/action/index.js index 4bca2b7..46b6f5a 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 _0x4422=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','multer','util','path'];(function(_0x367c83,_0xb7f3f5){var _0x28ae2c=function(_0x32fda9){while(--_0x32fda9){_0x367c83['push'](_0x367c83['shift']());}};_0x28ae2c(++_0xb7f3f5);}(_0x4422,0x19d));var _0x2442=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4422[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x2442('0x0'));var util=require(_0x2442('0x1'));var path=require(_0x2442('0x2'));var timeout=require(_0x2442('0x3'));var express=require(_0x2442('0x4'));var router=express[_0x2442('0x5')]();var auth=require(_0x2442('0x6'));var interaction=require(_0x2442('0x7'));var config=require(_0x2442('0x8'));var controller=require(_0x2442('0x9'));router[_0x2442('0xa')](_0x2442('0xb'),auth[_0x2442('0xc')](),controller[_0x2442('0xd')]);router[_0x2442('0xe')](_0x2442('0xb'),auth['isAuthenticated'](),controller[_0x2442('0xf')]);module['exports']=router; \ No newline at end of file +var _0x0dfe=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','update','delete','isAuthenticated','destroy','exports','multer','util','path'];(function(_0x5e84de,_0x18357d){var _0x2f0885=function(_0x2e3dad){while(--_0x2e3dad){_0x5e84de['push'](_0x5e84de['shift']());}};_0x2f0885(++_0x18357d);}(_0x0dfe,0x16d));var _0xe0df=function(_0x59c32b,_0x371e01){_0x59c32b=_0x59c32b-0x0;var _0xb501c5=_0x0dfe[_0x59c32b];return _0xb501c5;};'use strict';var multer=require(_0xe0df('0x0'));var util=require(_0xe0df('0x1'));var path=require(_0xe0df('0x2'));var timeout=require(_0xe0df('0x3'));var express=require(_0xe0df('0x4'));var router=express[_0xe0df('0x5')]();var auth=require(_0xe0df('0x6'));var interaction=require(_0xe0df('0x7'));var config=require(_0xe0df('0x8'));var controller=require(_0xe0df('0x9'));router['put'](_0xe0df('0xa'),auth['isAuthenticated'](),controller[_0xe0df('0xb')]);router[_0xe0df('0xc')](_0xe0df('0xa'),auth[_0xe0df('0xd')](),controller[_0xe0df('0xe')]);module[_0xe0df('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index f2b0f49..26bab9b 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 _0xa0c2=['sequelize','exports','STRING','TEXT'];(function(_0x5cc00b,_0x3ba7a2){var _0x577d67=function(_0x83bc4){while(--_0x83bc4){_0x5cc00b['push'](_0x5cc00b['shift']());}};_0x577d67(++_0x3ba7a2);}(_0xa0c2,0xe4));var _0x2a0c=function(_0x4164ab,_0x46b3be){_0x4164ab=_0x4164ab-0x0;var _0x4f7810=_0xa0c2[_0x4164ab];return _0x4f7810;};'use strict';var Sequelize=require(_0x2a0c('0x0'));module[_0x2a0c('0x1')]={'name':{'type':Sequelize[_0x2a0c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2a0c('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x2a0c('0x2')]},'conditions':{'type':Sequelize[_0x2a0c('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xe95c=['sequelize','exports','STRING','TEXT'];(function(_0x1bae35,_0x149aa5){var _0x50c5de=function(_0x21a395){while(--_0x21a395){_0x1bae35['push'](_0x1bae35['shift']());}};_0x50c5de(++_0x149aa5);}(_0xe95c,0xec));var _0xce95=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xe95c[_0x1c8c28];return _0x1f59b4;};'use strict';var Sequelize=require(_0xce95('0x0'));module[_0xce95('0x1')]={'name':{'type':Sequelize[_0xce95('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xce95('0x2')]},'table':{'type':Sequelize[_0xce95('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xce95('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index f2d8ae2..36a0e0d 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 _0x0666=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','include','findAll','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','rules','operator','group','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','field','function','format','replace','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','ValidationErrorItem','%s.%s\x20=\x20%s.%s','debug','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','runReport','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','limit','Content-Range','save','update','then','CustomReports','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0x43b4e0,_0x7d9828){var _0x34dea2=function(_0x12b2cb){while(--_0x12b2cb){_0x43b4e0['push'](_0x43b4e0['shift']());}};_0x34dea2(++_0x7d9828);}(_0x0666,0x1ca));var _0x6066=function(_0x5c7fd9,_0x189d2b){_0x5c7fd9=_0x5c7fd9-0x0;var _0x5a79b3=_0x0666[_0x5c7fd9];return _0x5a79b3;};'use strict';var pdf=require(_0x6066('0x0'));var emlformat=require(_0x6066('0x1'));var rimraf=require(_0x6066('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6066('0x3'));var rp=require(_0x6066('0x4'));var moment=require(_0x6066('0x5'));var BPromise=require(_0x6066('0x6'));var Mustache=require(_0x6066('0x7'));var util=require(_0x6066('0x8'));var path=require(_0x6066('0x9'));var sox=require(_0x6066('0xa'));var csv=require(_0x6066('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x6066('0xc'));var crypto=require(_0x6066('0xd'));var jsforce=require(_0x6066('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6066('0xf'));var Papa=require('papaparse');var Redis=require(_0x6066('0x10'));var authService=require(_0x6066('0x11'));var qs=require(_0x6066('0x12'));var as=require(_0x6066('0x13'));var hardwareService=require(_0x6066('0x14'));var logger=require(_0x6066('0x15'))(_0x6066('0x16'));var utils=require(_0x6066('0x17'));var config=require(_0x6066('0x18'));var db=require(_0x6066('0x19'))['db'];function respondWithStatusCode(_0x23925d,_0x1dfc92){_0x1dfc92=_0x1dfc92||0xcc;return function(_0x3e55f3){if(_0x3e55f3){return _0x23925d['sendStatus'](_0x1dfc92);}return _0x23925d['status'](_0x1dfc92)[_0x6066('0x1a')]();};}function respondWithResult(_0x4ddfbd,_0x8c5507){_0x8c5507=_0x8c5507||0xc8;return function(_0x30b182){if(_0x30b182){return _0x4ddfbd[_0x6066('0x1b')](_0x8c5507)[_0x6066('0x1c')](_0x30b182);}};}function respondWithFilteredResult(_0x5ca918,_0x2bdce2){return function(_0xfa1740){if(_0xfa1740){var _0xcea280=_0xfa1740['count'],_0xbd94f2=_0x2bdce2['offset'],_0x210f98=_0x2bdce2[_0x6066('0x1d')]+_0x2bdce2[_0x6066('0x1e')],_0x143347;if(_0x210f98>=_0xcea280){_0x210f98=_0xcea280;_0x143347=0xc8;}else{_0x143347=0xce;}_0x5ca918['status'](_0x143347);return _0x5ca918['set'](_0x6066('0x1f'),_0xbd94f2+'-'+_0x210f98+'/'+_0xcea280)[_0x6066('0x1c')](_0xfa1740);}return null;};}function patchUpdates(_0x8d8ff3){return function(_0x5eba6c){try{jsonpatch['apply'](_0x5eba6c,_0x8d8ff3,!![]);}catch(_0x1908fd){return BPromise['reject'](_0x1908fd);}return _0x5eba6c[_0x6066('0x20')]();};}function saveUpdates(_0x3ef1ba,_0x1f7679){return function(_0x521453){if(_0x521453){return _0x521453[_0x6066('0x21')](_0x3ef1ba)[_0x6066('0x22')](function(_0x1a4ff6){return _0x1a4ff6;});}return null;};}function removeEntity(_0x592c2d,_0x4f7177){return function(_0x128e67){if(_0x128e67){return _0x128e67['destroy']()[_0x6066('0x22')](function(){var _0x298731=_0x128e67['get']({'plain':!![]});var _0x3a8f41=_0x6066('0x23');return db[_0x6066('0x24')][_0x6066('0x25')]({'where':{'type':_0x3a8f41,'resourceId':_0x298731['id']}})[_0x6066('0x22')](function(){return _0x128e67;});})['then'](function(){_0x592c2d[_0x6066('0x1b')](0xcc)[_0x6066('0x1a')]();});}};}function handleEntityNotFound(_0x401956,_0x241bf1){return function(_0x11bfd3){if(!_0x11bfd3){_0x401956[_0x6066('0x26')](0x194);}return _0x11bfd3;};}function handleError(_0x4dc285,_0x40b9b5){_0x40b9b5=_0x40b9b5||0x1f4;return function(_0x1db9b7){logger['error'](_0x1db9b7[_0x6066('0x27')]);if(_0x1db9b7[_0x6066('0x28')]){delete _0x1db9b7[_0x6066('0x28')];}_0x4dc285[_0x6066('0x1b')](_0x40b9b5)[_0x6066('0x29')](_0x1db9b7);};}exports[_0x6066('0x2a')]=function(_0xbabdac,_0x136b91){var _0x1b2265={},_0x596da8={},_0x4680a3={'count':0x0,'rows':[]};var _0x30bcc8=_[_0x6066('0x2b')](db['AnalyticCustomReport'][_0x6066('0x2c')],function(_0xf1c5ca){return{'name':_0xf1c5ca[_0x6066('0x2d')],'type':_0xf1c5ca[_0x6066('0x2e')][_0x6066('0x2f')]};});_0x596da8[_0x6066('0x30')]=_['map'](_0x30bcc8,_0x6066('0x28'));_0x596da8[_0x6066('0x31')]=_[_0x6066('0x32')](_0xbabdac[_0x6066('0x31')]);_0x596da8[_0x6066('0x33')]=_[_0x6066('0x34')](_0x596da8['model'],_0x596da8[_0x6066('0x31')]);_0x1b2265[_0x6066('0x35')]=_[_0x6066('0x34')](_0x596da8[_0x6066('0x30')],qs[_0x6066('0x36')](_0xbabdac[_0x6066('0x31')]['fields']));_0x1b2265[_0x6066('0x35')]=_0x1b2265['attributes'][_0x6066('0x37')]?_0x1b2265[_0x6066('0x35')]:_0x596da8[_0x6066('0x30')];if(!_0xbabdac[_0x6066('0x31')][_0x6066('0x38')](_0x6066('0x39'))){_0x1b2265['limit']=qs[_0x6066('0x1e')](_0xbabdac[_0x6066('0x31')]['limit']);_0x1b2265[_0x6066('0x1d')]=qs['offset'](_0xbabdac[_0x6066('0x31')][_0x6066('0x1d')]);}_0x1b2265[_0x6066('0x3a')]=qs[_0x6066('0x3b')](_0xbabdac[_0x6066('0x31')][_0x6066('0x3b')]);_0x1b2265[_0x6066('0x3c')]=qs[_0x6066('0x33')](_[_0x6066('0x3d')](_0xbabdac[_0x6066('0x31')],_0x596da8['filters']));if(_0xbabdac[_0x6066('0x31')][_0x6066('0x3e')]){_0x1b2265['where']=_[_0x6066('0x3f')](_0x1b2265[_0x6066('0x3c')],{'$or':_['map'](_0x30bcc8,function(_0x1325eb){if(_0x1325eb[_0x6066('0x2e')]!==_0x6066('0x40')){var _0x1c73a8={};_0x1c73a8[_0x1325eb['name']]={'$like':'%'+_0xbabdac[_0x6066('0x31')][_0x6066('0x3e')]+'%'};return _0x1c73a8;}})});}_0x1b2265=_['merge']({},_0x1b2265,_0xbabdac[_0x6066('0x41')]);var _0x5ab77f={'where':_0x1b2265[_0x6066('0x3c')]};return db[_0x6066('0x42')]['count'](_0x5ab77f)[_0x6066('0x22')](function(_0x5d310c){_0x4680a3['count']=_0x5d310c;if(_0xbabdac[_0x6066('0x31')][_0x6066('0x43')]){_0x1b2265[_0x6066('0x44')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x6066('0x45')](_0x1b2265);})[_0x6066('0x22')](function(_0x273e28){_0x4680a3['rows']=_0x273e28;return _0x4680a3;})[_0x6066('0x22')](respondWithFilteredResult(_0x136b91,_0x1b2265))[_0x6066('0x46')](handleError(_0x136b91,null));};exports[_0x6066('0x47')]=function(_0x7c4532,_0x156555){var _0x5bdaae={'raw':![],'where':{'id':_0x7c4532[_0x6066('0x48')]['id']}},_0xe44741={};_0xe44741[_0x6066('0x30')]=_[_0x6066('0x32')](db['AnalyticCustomReport'][_0x6066('0x2c')]);_0xe44741['query']=_[_0x6066('0x32')](_0x7c4532[_0x6066('0x31')]);_0xe44741['filters']=_['intersection'](_0xe44741[_0x6066('0x30')],_0xe44741['query']);_0x5bdaae[_0x6066('0x35')]=_[_0x6066('0x34')](_0xe44741[_0x6066('0x30')],qs[_0x6066('0x36')](_0x7c4532[_0x6066('0x31')][_0x6066('0x36')]));_0x5bdaae[_0x6066('0x35')]=_0x5bdaae[_0x6066('0x35')][_0x6066('0x37')]?_0x5bdaae[_0x6066('0x35')]:_0xe44741[_0x6066('0x30')];if(_0x7c4532[_0x6066('0x31')][_0x6066('0x43')]){_0x5bdaae[_0x6066('0x44')]=[{'all':!![]}];}_0x5bdaae=_[_0x6066('0x3f')]({},_0x5bdaae,_0x7c4532[_0x6066('0x41')]);return db[_0x6066('0x42')]['find'](_0x5bdaae)[_0x6066('0x22')](handleEntityNotFound(_0x156555,null))[_0x6066('0x22')](respondWithResult(_0x156555,null))[_0x6066('0x46')](handleError(_0x156555,null));};exports[_0x6066('0x49')]=function(_0x456759,_0x3a5322){return db['AnalyticCustomReport']['create'](_0x456759[_0x6066('0x4a')],{})[_0x6066('0x22')](function(_0x2b202d){var _0x307e79=_0x456759[_0x6066('0x4b')][_0x6066('0x4c')]({'plain':!![]});if(!_0x307e79)throw new Error(_0x6066('0x4d'));if(_0x307e79[_0x6066('0x4e')]===_0x6066('0x4b')){var _0x9989a7=_0x2b202d[_0x6066('0x4c')]({'plain':!![]});var _0x5738e2='Reports';return db['UserProfileSection']['find']({'where':{'name':_0x5738e2,'userProfileId':_0x307e79[_0x6066('0x4f')]},'raw':!![]})[_0x6066('0x22')](function(_0xa074fe){if(_0xa074fe&&_0xa074fe[_0x6066('0x50')]===0x0){return db['UserProfileResource'][_0x6066('0x49')]({'name':_0x9989a7[_0x6066('0x28')],'resourceId':_0x9989a7['id'],'type':_0x6066('0x23'),'sectionId':_0xa074fe['id']},{})[_0x6066('0x22')](function(){return _0x2b202d;});}else{return _0x2b202d;}})[_0x6066('0x46')](function(_0x588769){logger['error'](_0x6066('0x51'),_0x588769);throw _0x588769;});}return _0x2b202d;})['then'](respondWithResult(_0x3a5322,0xc9))[_0x6066('0x46')](handleError(_0x3a5322,null));};exports[_0x6066('0x21')]=function(_0x26dcc2,_0x4243f6){if(_0x26dcc2['body']['id']){delete _0x26dcc2[_0x6066('0x4a')]['id'];}return db['AnalyticCustomReport'][_0x6066('0x52')]({'where':{'id':_0x26dcc2[_0x6066('0x48')]['id']}})['then'](handleEntityNotFound(_0x4243f6,null))[_0x6066('0x22')](saveUpdates(_0x26dcc2[_0x6066('0x4a')],null))[_0x6066('0x22')](respondWithResult(_0x4243f6,null))[_0x6066('0x46')](handleError(_0x4243f6,null));};exports[_0x6066('0x25')]=function(_0x5777b5,_0xc0401e){return db[_0x6066('0x42')][_0x6066('0x52')]({'where':{'id':_0x5777b5[_0x6066('0x48')]['id']}})[_0x6066('0x22')](handleEntityNotFound(_0xc0401e,null))[_0x6066('0x22')](removeEntity(_0xc0401e,null))[_0x6066('0x46')](handleError(_0xc0401e,null));};exports[_0x6066('0x53')]=function(_0x5da0c0,_0x2c9d60){var _0x29a8ec=0xa;var _0xb6a8cb=[_0x6066('0x54'),_0x6066('0x55'),_0x6066('0x56'),_0x6066('0x57')];var _0x277338={'SUM':_0x6066('0x58'),'COUNT':_0x6066('0x59'),'COUNT DISTINCT':_0x6066('0x5a'),'MAX':_0x6066('0x5b'),'MIN':_0x6066('0x5c'),'AVG':_0x6066('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x6066('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x532410={'SEC_TO_TIME':_0x6066('0x5f'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x6066('0x60'),'UNIX_TIMESTAMP':_0x6066('0x61')};var _0x312efd=function(_0x2478a0){return!_[_0x6066('0x62')]([_0x6066('0x63'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x2478a0);};var _0x556436=function(_0x216f04){if(!_0x216f04||!_0x216f04[_0x6066('0x64')]['length']){return'';}for(var _0x4b76bb='(',_0xf05e33=0x0;_0xf05e33<_0x216f04['rules']['length'];_0xf05e33+=0x1){_0xf05e33>0x0&&(_0x4b76bb+='\x20'+_0x216f04[_0x6066('0x65')]+'\x20');_0x4b76bb+=_0x216f04['rules'][_0xf05e33][_0x6066('0x66')]?_0x556436(_0x216f04[_0x6066('0x64')][_0xf05e33][_0x6066('0x66')]):_0x216f04[_0x6066('0x64')][_0xf05e33]['field']+'\x20'+_0x216f04[_0x6066('0x64')][_0xf05e33][_0x6066('0x67')]+(_0x312efd(_0x216f04[_0x6066('0x64')][_0xf05e33][_0x6066('0x67')])?'\x20'+_0x216f04['rules'][_0xf05e33][_0x6066('0x68')]:'');}return _0x4b76bb+')';};var _0x3e77b4={'where':{'id':_0x5da0c0[_0x6066('0x48')]['id']}},_0x374b6b,_0x4be640,_0x1903d1,_0xad4c7b,_0x27f48d;_0x3e77b4=_[_0x6066('0x3f')]({},_0x3e77b4,_0x5da0c0[_0x6066('0x41')]);return db[_0x6066('0x42')]['find'](_0x3e77b4)['then'](function(_0x489c9a){if(_0x489c9a){_0x374b6b=_0x489c9a;return _0x489c9a[_0x6066('0x69')]();}return null;})[_0x6066('0x22')](function(_0x330ae4){if(_0x330ae4){if(!_0x330ae4[_0x6066('0x37')]){throw new db[(_0x6066('0x6a'))]['ValidationErrorItem'](_0x6066('0x6b'),0x193);}_0x4be640=_0x330ae4;return db[_0x6066('0x6c')][_0x6066('0x45')]({'raw':!![]});}return null;})['then'](function(_0x75cb3d){if(_0x75cb3d){_0x1903d1=_[_0x6066('0x6d')](_0x75cb3d,'id');var _0x2721d9;var _0x2724e8=squel[_0x6066('0x6e')]();_0x2724e8[_0x6066('0x6f')](_0x374b6b[_0x6066('0x70')]);for(var _0x4f6e82=0x0;_0x4f6e82<_0x4be640[_0x6066('0x37')];_0x4f6e82+=0x1){_0x2721d9=_0x4be640[_0x4f6e82][_0x6066('0x71')]?_0x1903d1[_0x4be640[_0x4f6e82]['MetricId']][_0x6066('0x72')]:_0x4be640[_0x4f6e82][_0x6066('0x73')];_0x2721d9=_0x4be640[_0x4f6e82]['function']?_['replace'](_0x277338[_0x4be640[_0x4f6e82][_0x6066('0x74')]],'%s',_0x2721d9):_0x2721d9;_0x2721d9=_0x4be640[_0x4f6e82][_0x6066('0x75')]?_[_0x6066('0x76')](_0x532410[_0x4be640[_0x4f6e82][_0x6066('0x75')]],'%s',_0x2721d9):_0x2721d9;if(_0x4be640[_0x4f6e82][_0x6066('0x77')]){_0x2724e8[_0x6066('0x66')](_0x2721d9);}_0x4be640[_0x4f6e82][_0x6066('0x78')]&&_0x2724e8[_0x6066('0x3a')](_0x2721d9,_0x4be640[_0x4f6e82][_0x6066('0x78')]===_0x6066('0x79')?![]:!![]);_0x2724e8[_0x6066('0x73')](_0x2721d9,_0x4be640[_0x4f6e82][_0x6066('0x7a')]||_0x2721d9);}if(_0x374b6b[_0x6066('0x7b')]){_0x374b6b[_0x6066('0x7b')]=JSON[_0x6066('0x7c')](_0x374b6b[_0x6066('0x7b')]);for(var _0x82f01=0x0;_0x82f01<_0x374b6b[_0x6066('0x7b')][_0x6066('0x37')];_0x82f01+=0x1){if(_0x374b6b[_0x6066('0x7b')][_0x82f01][_0x6066('0x2e')]&&_[_0x6066('0x62')](_0xb6a8cb,_0x374b6b[_0x6066('0x7b')][_0x82f01][_0x6066('0x2e')])&&_0x374b6b[_0x6066('0x7b')][_0x82f01][_0x6066('0x7d')]&&_0x374b6b[_0x6066('0x7b')][_0x82f01][_0x6066('0x7e')]&&_0x374b6b[_0x6066('0x7b')][_0x82f01][_0x6066('0x7f')]){_0x2724e8[_0x374b6b['joins'][_0x82f01][_0x6066('0x2e')]](_0x374b6b[_0x6066('0x7b')][_0x82f01][_0x6066('0x7e')],null,util[_0x6066('0x75')]('%s.%s\x20=\x20%s.%s',_0x374b6b['table'],_0x374b6b[_0x6066('0x7b')][_0x82f01][_0x6066('0x7d')],_0x374b6b['joins'][_0x82f01][_0x6066('0x7e')],_0x374b6b[_0x6066('0x7b')][_0x82f01][_0x6066('0x7f')]));}}}if(_0x374b6b[_0x6066('0x80')]){_0x374b6b[_0x6066('0x80')]=JSON[_0x6066('0x7c')](_0x374b6b[_0x6066('0x80')]);_0x2724e8['where'](_0x556436(_0x374b6b['conditions'][_0x6066('0x66')]));}_0x27f48d=_0x2724e8[_0x6066('0x81')]();_0x2724e8[_0x6066('0x1e')](_0x29a8ec);_0x2724e8[_0x6066('0x1d')](0x0);logger['debug'](_0x6066('0x82'),_0x2724e8[_0x6066('0x83')]());return db[_0x6066('0x84')][_0x6066('0x31')](_0x2724e8[_0x6066('0x83')](),{'type':db[_0x6066('0x84')][_0x6066('0x85')][_0x6066('0x86')]});}})[_0x6066('0x22')](respondWithResult(_0x2c9d60,null))[_0x6066('0x46')](handleError(_0x2c9d60,null));};function runReport(_0x4c4874,_0x5d0e0c,_0x33d53a){var _0x35b0a2=_0x5d0e0c[_0x6066('0x28')];var _0x5d2f49=0xa;var _0xf0c7ad=[_0x6066('0x54'),_0x6066('0x55'),_0x6066('0x56'),_0x6066('0x57')];var _0x38e34b={'SUM':_0x6066('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x6066('0x5a'),'MAX':_0x6066('0x5b'),'MIN':_0x6066('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x6066('0x87'),'GROUP_CONCAT ASC':_0x6066('0x5e'),'GROUP_CONCAT DESC':_0x6066('0x88')};var _0x1f9a32={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x6066('0x89'),'HOUR':_0x6066('0x8a'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x6066('0x61')};var _0x49ebba=function(_0x403ba1){return!_[_0x6066('0x62')](['IS\x20NULL',_0x6066('0x8b'),_0x6066('0x8c'),_0x6066('0x8d')],_0x403ba1);};var _0x588968=function(_0x1d3a1d){if(!_0x1d3a1d||!_0x1d3a1d[_0x6066('0x64')][_0x6066('0x37')]){return'';}for(var _0x3c1f0f='(',_0x6c7d08=0x0;_0x6c7d08<_0x1d3a1d[_0x6066('0x64')][_0x6066('0x37')];_0x6c7d08+=0x1){_0x6c7d08>0x0&&(_0x3c1f0f+='\x20'+_0x1d3a1d[_0x6066('0x65')]+'\x20');_0x3c1f0f+=_0x1d3a1d[_0x6066('0x64')][_0x6c7d08][_0x6066('0x66')]?_0x588968(_0x1d3a1d[_0x6066('0x64')][_0x6c7d08][_0x6066('0x66')]):_0x1d3a1d[_0x6066('0x64')][_0x6c7d08]['field']+'\x20'+_0x1d3a1d[_0x6066('0x64')][_0x6c7d08][_0x6066('0x67')]+(_0x49ebba(_0x1d3a1d['rules'][_0x6c7d08][_0x6066('0x67')])?'\x20'+_0x1d3a1d[_0x6066('0x64')][_0x6c7d08]['value']:'');}return _0x3c1f0f+')';};var _0x454bdb={'where':{'id':_0x4c4874['id']}},_0x7713ad,_0x1ace67,_0x5a61d8,_0x2e8cb0,_0x4b440a;_0x454bdb=_[_0x6066('0x3f')]({},_0x454bdb,_0x33d53a);return db['AnalyticCustomReport'][_0x6066('0x52')](_0x454bdb)[_0x6066('0x22')](function(_0x4c9003){if(_0x4c9003){_0x7713ad=_0x4c9003;return _0x4c9003[_0x6066('0x69')]();}return null;})['then'](function(_0x28d2da){if(_0x28d2da){if(!_0x28d2da['length']){throw new db['Sequelize'][(_0x6066('0x8e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1ace67=_0x28d2da;return db[_0x6066('0x6c')][_0x6066('0x45')]({'raw':!![]});}return null;})['then'](function(_0x5ce4e0){if(_0x5ce4e0){_0x5a61d8=_[_0x6066('0x6d')](_0x5ce4e0,'id');var _0xfdb2ea;var _0x2decbe=squel[_0x6066('0x6e')]();_0x2decbe[_0x6066('0x6f')](_0x7713ad[_0x6066('0x70')]);for(var _0x2d0024=0x0;_0x2d0024<_0x1ace67[_0x6066('0x37')];_0x2d0024+=0x1){_0xfdb2ea=_0x1ace67[_0x2d0024]['MetricId']?_0x5a61d8[_0x1ace67[_0x2d0024][_0x6066('0x71')]][_0x6066('0x72')]:_0x1ace67[_0x2d0024][_0x6066('0x73')];_0xfdb2ea=_0x1ace67[_0x2d0024][_0x6066('0x74')]?_[_0x6066('0x76')](_0x38e34b[_0x1ace67[_0x2d0024][_0x6066('0x74')]],'%s',_0xfdb2ea):_0xfdb2ea;_0xfdb2ea=_0x1ace67[_0x2d0024][_0x6066('0x75')]?_['replace'](_0x1f9a32[_0x1ace67[_0x2d0024][_0x6066('0x75')]],'%s',_0xfdb2ea):_0xfdb2ea;if(_0x1ace67[_0x2d0024][_0x6066('0x77')]){_0x2decbe['group'](_0xfdb2ea);}_0x1ace67[_0x2d0024][_0x6066('0x78')]&&_0x2decbe[_0x6066('0x3a')](_0xfdb2ea,_0x1ace67[_0x2d0024][_0x6066('0x78')]===_0x6066('0x79')?![]:!![]);_0x2decbe['field'](_0xfdb2ea,_0x1ace67[_0x2d0024][_0x6066('0x7a')]||_0xfdb2ea);}if(_0x7713ad['joins']){_0x7713ad[_0x6066('0x7b')]=JSON[_0x6066('0x7c')](_0x7713ad[_0x6066('0x7b')]);for(var _0x11b3ee=0x0;_0x11b3ee<_0x7713ad['joins'][_0x6066('0x37')];_0x11b3ee+=0x1){if(_0x7713ad[_0x6066('0x7b')][_0x11b3ee][_0x6066('0x2e')]&&_[_0x6066('0x62')](_0xf0c7ad,_0x7713ad[_0x6066('0x7b')][_0x11b3ee][_0x6066('0x2e')])&&_0x7713ad['joins'][_0x11b3ee][_0x6066('0x7d')]&&_0x7713ad[_0x6066('0x7b')][_0x11b3ee][_0x6066('0x7e')]&&_0x7713ad['joins'][_0x11b3ee]['foreignKey']){_0x2decbe[_0x7713ad[_0x6066('0x7b')][_0x11b3ee]['type']](_0x7713ad[_0x6066('0x7b')][_0x11b3ee]['foreignTable'],null,util['format'](_0x6066('0x8f'),_0x7713ad['table'],_0x7713ad[_0x6066('0x7b')][_0x11b3ee]['parentKey'],_0x7713ad[_0x6066('0x7b')][_0x11b3ee][_0x6066('0x7e')],_0x7713ad['joins'][_0x11b3ee][_0x6066('0x7f')]));}}}if(_0x7713ad[_0x6066('0x80')]){_0x7713ad[_0x6066('0x80')]=JSON['parse'](_0x7713ad[_0x6066('0x80')]);_0x2decbe[_0x6066('0x3c')](_0x588968(_0x7713ad[_0x6066('0x80')][_0x6066('0x66')]));}_0x4b440a=_0x2decbe[_0x6066('0x81')]();_0x2decbe[_0x6066('0x1e')](_0x5d2f49);_0x2decbe[_0x6066('0x1d')](0x0);logger[_0x6066('0x90')](_0x6066('0x82'),_0x2decbe['toString']());return db[_0x6066('0x84')]['query'](_0x2decbe[_0x6066('0x83')](),{'type':db['sequelize'][_0x6066('0x85')]['SELECT']});}})[_0x6066('0x22')](function(_0xc644ac){if(!_0xc644ac[_0x6066('0x37')]){throw new db['Sequelize'][(_0x6066('0x8e'))](_0x6066('0x91'),0xcc);}if(_0x5d0e0c[_0x6066('0x92')]===_0x6066('0x93')){return null;}var _0x4dbd48=_['merge'](_0x5d0e0c,{'name':_0x5d0e0c[_0x6066('0x94')]||_0x5d0e0c[_0x6066('0x28')]||_0x7713ad[_0x6066('0x28')],'basename':_0x35b0a2,'savename':util[_0x6066('0x75')](_0x6066('0x95'),_0x5d0e0c['name']||_0x7713ad[_0x6066('0x28')],require(_0x6066('0x96'))[_0x6066('0x97')](0x4),_0x5d0e0c[_0x6066('0x92')]||_0x6066('0x98')),'reportId':_0x7713ad['id'],'reportType':'custom'});return db[_0x6066('0x99')][_0x6066('0x49')](_0x4dbd48,{'raw':!![]});})[_0x6066('0x22')](function(_0x3383b0){if(_0x7713ad['table']===_0x6066('0x9a')){_0x4b440a['where'](_0x7713ad['table']+_0x6066('0x9b'),_0x5d0e0c['startDate'],_0x5d0e0c[_0x6066('0x9c')]);}else{_0x4b440a[_0x6066('0x3c')](_0x7713ad[_0x6066('0x70')]+_0x6066('0x9d'),_0x5d0e0c[_0x6066('0x9e')],_0x5d0e0c['endDate']);}if(_0x3383b0){logger[_0x6066('0x9f')](_0x6066('0xa0'),_0x4b440a[_0x6066('0x83')]());require(_0x6066('0xa1'))[_0x6066('0xa2')](path['join'](__dirname,_0x6066('0xa3'),_0x3383b0[_0x6066('0x92')]),[_0x3383b0['id'],_0x4b440a[_0x6066('0x83')](),path[_0x6066('0x54')](__dirname,_0x6066('0xa4'),_0x3383b0[_0x6066('0xa5')]),_0x35b0a2]);return _0x3383b0;}else{var _0x5aff51=squel[_0x6066('0x6e')]();_0x5aff51[_0x6066('0x6f')]('('+_0x4b440a['toString']()+')',_0x6066('0xa6'));_0x5aff51['field']('COUNT(*)','count');_0x4b440a[_0x6066('0x1e')](_0x5d0e0c[_0x6066('0x1e')]||_0x5d2f49);_0x4b440a[_0x6066('0x1d')](_0x5d0e0c[_0x6066('0x1d')]||0x0);return db['sequelize']['query'](_0x5aff51[_0x6066('0x83')](),{'type':db['sequelize'][_0x6066('0x85')][_0x6066('0x86')]})['then'](function(_0x36b746){if(!_0x36b746[_0x6066('0x37')]){_0x2e8cb0=0x0;}else{_0x2e8cb0=_0x36b746[0x0]['count']||0x0;}return db[_0x6066('0x84')][_0x6066('0x31')](_0x4b440a[_0x6066('0x83')](),{'type':db[_0x6066('0x84')][_0x6066('0x85')][_0x6066('0x86')]});})[_0x6066('0x22')](function(_0x2f9fe9){return{'rows':_0x2f9fe9||[],'count':_0x2e8cb0};});}});}exports[_0x6066('0xa7')]=function(_0x135b26,_0x4c8f6c){return runReport(_0x135b26[_0x6066('0x48')],_0x135b26[_0x6066('0x31')],_0x135b26[_0x6066('0x41')])[_0x6066('0x22')](respondWithResult(_0x4c8f6c,null))[_0x6066('0x46')](handleError(_0x4c8f6c,null));};exports[_0x6066('0xa8')]=runReport;exports[_0x6066('0x31')]=function(_0x16420a,_0x21ee14){var _0x375c59=0xa;var _0x1ea18b=['join',_0x6066('0x55'),_0x6066('0x56'),'cross_join'];var _0x622701={'SUM':_0x6066('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x6066('0x5a'),'MAX':_0x6066('0x5b'),'MIN':_0x6066('0x5c'),'AVG':_0x6066('0x5d'),'GROUP_CONCAT':_0x6066('0x87'),'GROUP_CONCAT ASC':_0x6066('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x47740e={'SEC_TO_TIME':_0x6066('0x5f'),'DATE':_0x6066('0x89'),'HOUR':_0x6066('0x8a'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5f140b=function(_0x5ba7c7){return!_[_0x6066('0x62')]([_0x6066('0x63'),_0x6066('0x8b'),_0x6066('0x8c'),_0x6066('0x8d')],_0x5ba7c7);};var _0x5c81e1=function(_0x3c0381){if(!_0x3c0381||!_0x3c0381[_0x6066('0x64')][_0x6066('0x37')]){return'';}for(var _0x512903='(',_0x270584=0x0;_0x270584<_0x3c0381[_0x6066('0x64')]['length'];_0x270584+=0x1){_0x270584>0x0&&(_0x512903+='\x20'+_0x3c0381[_0x6066('0x65')]+'\x20');_0x512903+=_0x3c0381['rules'][_0x270584][_0x6066('0x66')]?_0x5c81e1(_0x3c0381['rules'][_0x270584][_0x6066('0x66')]):_0x3c0381[_0x6066('0x64')][_0x270584][_0x6066('0x73')]+'\x20'+_0x3c0381[_0x6066('0x64')][_0x270584]['condition']+(_0x5f140b(_0x3c0381[_0x6066('0x64')][_0x270584][_0x6066('0x67')])?'\x20'+_0x3c0381[_0x6066('0x64')][_0x270584][_0x6066('0x68')]:'');}return _0x512903+')';};var _0x5f3e85={'where':{'id':_0x16420a['params']['id']}},_0xddf91d,_0x549546,_0x1f30de,_0x1707d5,_0x25c98f;_0x5f3e85=_[_0x6066('0x3f')]({},_0x5f3e85,_0x16420a[_0x6066('0x41')]);return db[_0x6066('0x42')][_0x6066('0x52')](_0x5f3e85)[_0x6066('0x22')](function(_0x319b83){if(_0x319b83){_0xddf91d=_0x319b83;return _0x319b83[_0x6066('0x69')]();}return null;})['then'](function(_0x43d623){if(_0x43d623){if(!_0x43d623[_0x6066('0x37')]){throw new db[(_0x6066('0x6a'))][(_0x6066('0x8e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x549546=_0x43d623;return db[_0x6066('0x6c')][_0x6066('0x45')]({'raw':!![]});}return null;})[_0x6066('0x22')](function(_0x1c2f68){if(_0x1c2f68){_0x1f30de=_[_0x6066('0x6d')](_0x1c2f68,'id');var _0x191cd4;var _0x470d66=squel[_0x6066('0x6e')]();_0x470d66['from'](_0xddf91d[_0x6066('0x70')]);for(var _0x4b152c=0x0;_0x4b152c<_0x549546[_0x6066('0x37')];_0x4b152c+=0x1){_0x191cd4=_0x549546[_0x4b152c][_0x6066('0x71')]?_0x1f30de[_0x549546[_0x4b152c][_0x6066('0x71')]][_0x6066('0x72')]:_0x549546[_0x4b152c][_0x6066('0x73')];_0x191cd4=_0x549546[_0x4b152c][_0x6066('0x74')]?_[_0x6066('0x76')](_0x622701[_0x549546[_0x4b152c][_0x6066('0x74')]],'%s',_0x191cd4):_0x191cd4;_0x191cd4=_0x549546[_0x4b152c][_0x6066('0x75')]?_[_0x6066('0x76')](_0x47740e[_0x549546[_0x4b152c][_0x6066('0x75')]],'%s',_0x191cd4):_0x191cd4;if(_0x549546[_0x4b152c][_0x6066('0x77')]){_0x470d66['group'](_0x191cd4);}_0x549546[_0x4b152c][_0x6066('0x78')]&&_0x470d66[_0x6066('0x3a')](_0x191cd4,_0x549546[_0x4b152c][_0x6066('0x78')]===_0x6066('0x79')?![]:!![]);_0x470d66[_0x6066('0x73')](_0x191cd4,_0x549546[_0x4b152c]['alias']||_0x191cd4);}if(_0xddf91d[_0x6066('0x7b')]){_0xddf91d[_0x6066('0x7b')]=JSON[_0x6066('0x7c')](_0xddf91d['joins']);for(var _0x42e2f5=0x0;_0x42e2f5<_0xddf91d['joins'][_0x6066('0x37')];_0x42e2f5+=0x1){if(_0xddf91d['joins'][_0x42e2f5][_0x6066('0x2e')]&&_[_0x6066('0x62')](_0x1ea18b,_0xddf91d[_0x6066('0x7b')][_0x42e2f5]['type'])&&_0xddf91d['joins'][_0x42e2f5][_0x6066('0x7d')]&&_0xddf91d[_0x6066('0x7b')][_0x42e2f5][_0x6066('0x7e')]&&_0xddf91d[_0x6066('0x7b')][_0x42e2f5][_0x6066('0x7f')]){_0x470d66[_0xddf91d[_0x6066('0x7b')][_0x42e2f5]['type']](_0xddf91d['joins'][_0x42e2f5][_0x6066('0x7e')],null,util[_0x6066('0x75')](_0x6066('0x8f'),_0xddf91d[_0x6066('0x70')],_0xddf91d[_0x6066('0x7b')][_0x42e2f5][_0x6066('0x7d')],_0xddf91d[_0x6066('0x7b')][_0x42e2f5][_0x6066('0x7e')],_0xddf91d[_0x6066('0x7b')][_0x42e2f5][_0x6066('0x7f')]));}}}if(_0xddf91d[_0x6066('0x80')]){_0xddf91d[_0x6066('0x80')]=JSON[_0x6066('0x7c')](_0xddf91d['conditions']);_0x470d66[_0x6066('0x3c')](_0x5c81e1(_0xddf91d[_0x6066('0x80')][_0x6066('0x66')]));}_0x25c98f=_0x470d66[_0x6066('0x81')]();_0x470d66[_0x6066('0x1e')](_0x375c59);_0x470d66[_0x6066('0x1d')](0x0);logger['debug'](_0x6066('0x82'),_0x470d66[_0x6066('0x83')]());return db[_0x6066('0x84')][_0x6066('0x31')](_0x470d66['toString'](),{'type':db['sequelize'][_0x6066('0x85')][_0x6066('0x86')]});}})[_0x6066('0x22')](function(){return{'sql':_0x25c98f[_0x6066('0x83')]()};})[_0x6066('0x22')](respondWithResult(_0x21ee14,null))[_0x6066('0x46')](handleError(_0x21ee14,null));}; \ No newline at end of file +var _0x1197=['map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','pick','filters','filter','where','merge','options','includeAll','include','catch','params','find','create','body','role','UserProfileSection','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','condition','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','table','metric','function','replace','format','groupBy','orderBy','field','alias','parse','joins','includes','parentKey','foreignTable','foreignKey','conditions','clone','toString','SELECT','SUM(%s)','COUNT(%s)','MIN(%s)','IS\x20NOT\x20NULL','Sequelize','MetricId','DESC','debug','sequelize','QueryTypes','No\x20available\x20data','output','web','fullPath','randomstring','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','child_process','../../components/export/','../../files/reports','savename','from','COUNT(*)','run','GROUP_CONCAT(%s)','HOUR(%s)','IS\x20NOT\x20EMPTY','getFields','Limited\x20Query:','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1197,0x1ad));var _0x7119=function(_0x445a44,_0x1c132f){_0x445a44=_0x445a44-0x0;var _0x1e708a=_0x1197[_0x445a44];return _0x1e708a;};'use strict';var pdf=require(_0x7119('0x0'));var emlformat=require(_0x7119('0x1'));var rimraf=require(_0x7119('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7119('0x3'));var moment=require(_0x7119('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7119('0x5'));var util=require(_0x7119('0x6'));var path=require(_0x7119('0x7'));var sox=require(_0x7119('0x8'));var csv=require(_0x7119('0x9'));var ejs=require(_0x7119('0xa'));var fs=require('fs');var _=require(_0x7119('0xb'));var squel=require(_0x7119('0xc'));var crypto=require('crypto');var jsforce=require(_0x7119('0xd'));var deskjs=require(_0x7119('0xe'));var toCsv=require(_0x7119('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7119('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7119('0x10'));var as=require(_0x7119('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7119('0x12'))(_0x7119('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x7119('0x14'))['db'];function respondWithStatusCode(_0x98c791,_0x52e90e){_0x52e90e=_0x52e90e||0xcc;return function(_0x1fb243){if(_0x1fb243){return _0x98c791[_0x7119('0x15')](_0x52e90e);}return _0x98c791[_0x7119('0x16')](_0x52e90e)[_0x7119('0x17')]();};}function respondWithResult(_0x3dd27b,_0x1d6e68){_0x1d6e68=_0x1d6e68||0xc8;return function(_0x51b32b){if(_0x51b32b){return _0x3dd27b[_0x7119('0x16')](_0x1d6e68)[_0x7119('0x18')](_0x51b32b);}};}function respondWithFilteredResult(_0x308c96,_0x2cd077){return function(_0x63278e){if(_0x63278e){var _0x136157=_0x63278e[_0x7119('0x19')],_0x38b8ad=_0x2cd077['offset'],_0x422767=_0x2cd077[_0x7119('0x1a')]+_0x2cd077[_0x7119('0x1b')],_0x2d937d;if(_0x422767>=_0x136157){_0x422767=_0x136157;_0x2d937d=0xc8;}else{_0x2d937d=0xce;}_0x308c96[_0x7119('0x16')](_0x2d937d);return _0x308c96[_0x7119('0x1c')]('Content-Range',_0x38b8ad+'-'+_0x422767+'/'+_0x136157)[_0x7119('0x18')](_0x63278e);}return null;};}function patchUpdates(_0x4bdf55){return function(_0x3b4911){try{jsonpatch[_0x7119('0x1d')](_0x3b4911,_0x4bdf55,!![]);}catch(_0xc8f97b){return BPromise[_0x7119('0x1e')](_0xc8f97b);}return _0x3b4911[_0x7119('0x1f')]();};}function saveUpdates(_0x25cfbb,_0x5ca9ae){return function(_0x4d9039){if(_0x4d9039){return _0x4d9039[_0x7119('0x20')](_0x25cfbb)[_0x7119('0x21')](function(_0x3b60de){return _0x3b60de;});}return null;};}function removeEntity(_0x3517e1,_0x399b00){return function(_0x4c52d6){if(_0x4c52d6){return _0x4c52d6[_0x7119('0x22')]()[_0x7119('0x21')](function(){var _0x440169=_0x4c52d6[_0x7119('0x23')]({'plain':!![]});var _0x23baba='CustomReports';return db[_0x7119('0x24')]['destroy']({'where':{'type':_0x23baba,'resourceId':_0x440169['id']}})['then'](function(){return _0x4c52d6;});})[_0x7119('0x21')](function(){_0x3517e1[_0x7119('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1be46d,_0x5936a5){return function(_0x314da4){if(!_0x314da4){_0x1be46d[_0x7119('0x15')](0x194);}return _0x314da4;};}function handleError(_0x4c4741,_0x5a7fc1){_0x5a7fc1=_0x5a7fc1||0x1f4;return function(_0x33480f){logger[_0x7119('0x25')](_0x33480f[_0x7119('0x26')]);if(_0x33480f[_0x7119('0x27')]){delete _0x33480f[_0x7119('0x27')];}_0x4c4741[_0x7119('0x16')](_0x5a7fc1)[_0x7119('0x28')](_0x33480f);};}exports[_0x7119('0x29')]=function(_0x18b805,_0x12b7af){var _0x50572d={},_0x424753={},_0x4ec96b={'count':0x0,'rows':[]};var _0x4a5680=_[_0x7119('0x2a')](db[_0x7119('0x2b')][_0x7119('0x2c')],function(_0x14bc67){return{'name':_0x14bc67[_0x7119('0x2d')],'type':_0x14bc67[_0x7119('0x2e')][_0x7119('0x2f')]};});_0x424753[_0x7119('0x30')]=_['map'](_0x4a5680,_0x7119('0x27'));_0x424753[_0x7119('0x31')]=_[_0x7119('0x32')](_0x18b805[_0x7119('0x31')]);_0x424753['filters']=_[_0x7119('0x33')](_0x424753[_0x7119('0x30')],_0x424753[_0x7119('0x31')]);_0x50572d[_0x7119('0x34')]=_['intersection'](_0x424753['model'],qs[_0x7119('0x35')](_0x18b805[_0x7119('0x31')][_0x7119('0x35')]));_0x50572d['attributes']=_0x50572d['attributes'][_0x7119('0x36')]?_0x50572d[_0x7119('0x34')]:_0x424753[_0x7119('0x30')];if(!_0x18b805[_0x7119('0x31')]['hasOwnProperty']('nolimit')){_0x50572d[_0x7119('0x1b')]=qs['limit'](_0x18b805[_0x7119('0x31')][_0x7119('0x1b')]);_0x50572d[_0x7119('0x1a')]=qs[_0x7119('0x1a')](_0x18b805[_0x7119('0x31')][_0x7119('0x1a')]);}_0x50572d[_0x7119('0x37')]=qs['sort'](_0x18b805[_0x7119('0x31')][_0x7119('0x38')]);_0x50572d['where']=qs['filters'](_[_0x7119('0x39')](_0x18b805[_0x7119('0x31')],_0x424753[_0x7119('0x3a')]));if(_0x18b805[_0x7119('0x31')][_0x7119('0x3b')]){_0x50572d[_0x7119('0x3c')]=_['merge'](_0x50572d[_0x7119('0x3c')],{'$or':_[_0x7119('0x2a')](_0x4a5680,function(_0x2522dc){if(_0x2522dc['type']!=='VIRTUAL'){var _0x10f55b={};_0x10f55b[_0x2522dc[_0x7119('0x27')]]={'$like':'%'+_0x18b805['query']['filter']+'%'};return _0x10f55b;}})});}_0x50572d=_[_0x7119('0x3d')]({},_0x50572d,_0x18b805[_0x7119('0x3e')]);var _0x2aa533={'where':_0x50572d[_0x7119('0x3c')]};return db['AnalyticCustomReport'][_0x7119('0x19')](_0x2aa533)[_0x7119('0x21')](function(_0x54e3eb){_0x4ec96b[_0x7119('0x19')]=_0x54e3eb;if(_0x18b805[_0x7119('0x31')][_0x7119('0x3f')]){_0x50572d[_0x7119('0x40')]=[{'all':!![]}];}return db[_0x7119('0x2b')]['findAll'](_0x50572d);})[_0x7119('0x21')](function(_0x519bda){_0x4ec96b['rows']=_0x519bda;return _0x4ec96b;})[_0x7119('0x21')](respondWithFilteredResult(_0x12b7af,_0x50572d))[_0x7119('0x41')](handleError(_0x12b7af,null));};exports['show']=function(_0x528201,_0x560876){var _0x53d6ff={'raw':![],'where':{'id':_0x528201[_0x7119('0x42')]['id']}},_0x3b2e73={};_0x3b2e73[_0x7119('0x30')]=_['keys'](db[_0x7119('0x2b')][_0x7119('0x2c')]);_0x3b2e73[_0x7119('0x31')]=_[_0x7119('0x32')](_0x528201[_0x7119('0x31')]);_0x3b2e73[_0x7119('0x3a')]=_['intersection'](_0x3b2e73[_0x7119('0x30')],_0x3b2e73[_0x7119('0x31')]);_0x53d6ff[_0x7119('0x34')]=_[_0x7119('0x33')](_0x3b2e73['model'],qs[_0x7119('0x35')](_0x528201['query']['fields']));_0x53d6ff[_0x7119('0x34')]=_0x53d6ff[_0x7119('0x34')][_0x7119('0x36')]?_0x53d6ff[_0x7119('0x34')]:_0x3b2e73[_0x7119('0x30')];if(_0x528201[_0x7119('0x31')][_0x7119('0x3f')]){_0x53d6ff[_0x7119('0x40')]=[{'all':!![]}];}_0x53d6ff=_['merge']({},_0x53d6ff,_0x528201[_0x7119('0x3e')]);return db[_0x7119('0x2b')][_0x7119('0x43')](_0x53d6ff)[_0x7119('0x21')](handleEntityNotFound(_0x560876,null))['then'](respondWithResult(_0x560876,null))['catch'](handleError(_0x560876,null));};exports['create']=function(_0x5ba96d,_0x5597b5){return db['AnalyticCustomReport'][_0x7119('0x44')](_0x5ba96d[_0x7119('0x45')],{})[_0x7119('0x21')](function(_0xd5622a){var _0x3a15be=_0x5ba96d['user'][_0x7119('0x23')]({'plain':!![]});if(!_0x3a15be)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a15be[_0x7119('0x46')]==='user'){var _0x22ab4e=_0xd5622a[_0x7119('0x23')]({'plain':!![]});var _0xabd468='Reports';return db[_0x7119('0x47')]['find']({'where':{'name':_0xabd468,'userProfileId':_0x3a15be[_0x7119('0x48')]},'raw':!![]})['then'](function(_0x487257){if(_0x487257&&_0x487257[_0x7119('0x49')]===0x0){return db[_0x7119('0x24')][_0x7119('0x44')]({'name':_0x22ab4e[_0x7119('0x27')],'resourceId':_0x22ab4e['id'],'type':_0x7119('0x4a'),'sectionId':_0x487257['id']},{})[_0x7119('0x21')](function(){return _0xd5622a;});}else{return _0xd5622a;}})[_0x7119('0x41')](function(_0xaa8b29){logger[_0x7119('0x25')](_0x7119('0x4b'),_0xaa8b29);throw _0xaa8b29;});}return _0xd5622a;})[_0x7119('0x21')](respondWithResult(_0x5597b5,0xc9))[_0x7119('0x41')](handleError(_0x5597b5,null));};exports['update']=function(_0x19afbf,_0x20b287){if(_0x19afbf[_0x7119('0x45')]['id']){delete _0x19afbf[_0x7119('0x45')]['id'];}return db[_0x7119('0x2b')][_0x7119('0x43')]({'where':{'id':_0x19afbf[_0x7119('0x42')]['id']}})[_0x7119('0x21')](handleEntityNotFound(_0x20b287,null))[_0x7119('0x21')](saveUpdates(_0x19afbf[_0x7119('0x45')],null))[_0x7119('0x21')](respondWithResult(_0x20b287,null))['catch'](handleError(_0x20b287,null));};exports[_0x7119('0x22')]=function(_0x180bef,_0x23fd1c){return db[_0x7119('0x2b')][_0x7119('0x43')]({'where':{'id':_0x180bef[_0x7119('0x42')]['id']}})[_0x7119('0x21')](handleEntityNotFound(_0x23fd1c,null))[_0x7119('0x21')](removeEntity(_0x23fd1c,null))[_0x7119('0x41')](handleError(_0x23fd1c,null));};exports['preview']=function(_0x4df958,_0x5bdbb8){var _0x499202=0xa;var _0x5867fd=[_0x7119('0x4c'),_0x7119('0x4d'),_0x7119('0x4e'),_0x7119('0x4f')];var _0x25fe9f={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x7119('0x50'),'MAX':_0x7119('0x51'),'MIN':'MIN(%s)','AVG':_0x7119('0x52'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x7119('0x53'),'GROUP_CONCAT DESC':_0x7119('0x54')};var _0x281819={'SEC_TO_TIME':_0x7119('0x55'),'DATE':_0x7119('0x56'),'HOUR':'HOUR(%s)','ROUND':_0x7119('0x57'),'UNIX_TIMESTAMP':_0x7119('0x58')};var _0x1cf25d=function(_0x4b92f7){return!_['includes']([_0x7119('0x59'),'IS\x20NOT\x20NULL',_0x7119('0x5a'),'IS\x20NOT\x20EMPTY'],_0x4b92f7);};var _0x101ad5=function(_0x19d8bf){if(!_0x19d8bf||!_0x19d8bf['rules']['length']){return'';}for(var _0x720a55='(',_0x1e7e77=0x0;_0x1e7e77<_0x19d8bf[_0x7119('0x5b')][_0x7119('0x36')];_0x1e7e77+=0x1){_0x1e7e77>0x0&&(_0x720a55+='\x20'+_0x19d8bf[_0x7119('0x5c')]+'\x20');_0x720a55+=_0x19d8bf[_0x7119('0x5b')][_0x1e7e77][_0x7119('0x5d')]?_0x101ad5(_0x19d8bf['rules'][_0x1e7e77][_0x7119('0x5d')]):_0x19d8bf['rules'][_0x1e7e77]['field']+'\x20'+_0x19d8bf[_0x7119('0x5b')][_0x1e7e77][_0x7119('0x5e')]+(_0x1cf25d(_0x19d8bf[_0x7119('0x5b')][_0x1e7e77][_0x7119('0x5e')])?'\x20'+_0x19d8bf['rules'][_0x1e7e77][_0x7119('0x5f')]:'');}return _0x720a55+')';};var _0x567c3d={'where':{'id':_0x4df958[_0x7119('0x42')]['id']}},_0x4f9442,_0x1335e6,_0xbc989c,_0x4767f4,_0x2f2e36;_0x567c3d=_['merge']({},_0x567c3d,_0x4df958[_0x7119('0x3e')]);return db[_0x7119('0x2b')][_0x7119('0x43')](_0x567c3d)['then'](function(_0x800ce7){if(_0x800ce7){_0x4f9442=_0x800ce7;return _0x800ce7['getFields']();}return null;})['then'](function(_0x199ab8){if(_0x199ab8){if(!_0x199ab8[_0x7119('0x36')]){throw new db['Sequelize'][(_0x7119('0x60'))](_0x7119('0x61'),0x193);}_0x1335e6=_0x199ab8;return db[_0x7119('0x62')][_0x7119('0x63')]({'raw':!![]});}return null;})['then'](function(_0x21248f){if(_0x21248f){_0xbc989c=_[_0x7119('0x64')](_0x21248f,'id');var _0x3493a8;var _0x222b44=squel[_0x7119('0x65')]();_0x222b44['from'](_0x4f9442[_0x7119('0x66')]);for(var _0x379047=0x0;_0x379047<_0x1335e6[_0x7119('0x36')];_0x379047+=0x1){_0x3493a8=_0x1335e6[_0x379047]['MetricId']?_0xbc989c[_0x1335e6[_0x379047]['MetricId']][_0x7119('0x67')]:_0x1335e6[_0x379047]['field'];_0x3493a8=_0x1335e6[_0x379047][_0x7119('0x68')]?_[_0x7119('0x69')](_0x25fe9f[_0x1335e6[_0x379047]['function']],'%s',_0x3493a8):_0x3493a8;_0x3493a8=_0x1335e6[_0x379047]['format']?_[_0x7119('0x69')](_0x281819[_0x1335e6[_0x379047][_0x7119('0x6a')]],'%s',_0x3493a8):_0x3493a8;if(_0x1335e6[_0x379047][_0x7119('0x6b')]){_0x222b44[_0x7119('0x5d')](_0x3493a8);}_0x1335e6[_0x379047][_0x7119('0x6c')]&&_0x222b44['order'](_0x3493a8,_0x1335e6[_0x379047][_0x7119('0x6c')]==='DESC'?![]:!![]);_0x222b44[_0x7119('0x6d')](_0x3493a8,_0x1335e6[_0x379047][_0x7119('0x6e')]||_0x3493a8);}if(_0x4f9442['joins']){_0x4f9442['joins']=JSON[_0x7119('0x6f')](_0x4f9442[_0x7119('0x70')]);for(var _0xe79029=0x0;_0xe79029<_0x4f9442[_0x7119('0x70')][_0x7119('0x36')];_0xe79029+=0x1){if(_0x4f9442['joins'][_0xe79029][_0x7119('0x2e')]&&_[_0x7119('0x71')](_0x5867fd,_0x4f9442[_0x7119('0x70')][_0xe79029][_0x7119('0x2e')])&&_0x4f9442[_0x7119('0x70')][_0xe79029][_0x7119('0x72')]&&_0x4f9442[_0x7119('0x70')][_0xe79029][_0x7119('0x73')]&&_0x4f9442[_0x7119('0x70')][_0xe79029][_0x7119('0x74')]){_0x222b44[_0x4f9442[_0x7119('0x70')][_0xe79029]['type']](_0x4f9442[_0x7119('0x70')][_0xe79029][_0x7119('0x73')],null,util[_0x7119('0x6a')]('%s.%s\x20=\x20%s.%s',_0x4f9442[_0x7119('0x66')],_0x4f9442[_0x7119('0x70')][_0xe79029][_0x7119('0x72')],_0x4f9442[_0x7119('0x70')][_0xe79029][_0x7119('0x73')],_0x4f9442['joins'][_0xe79029][_0x7119('0x74')]));}}}if(_0x4f9442['conditions']){_0x4f9442['conditions']=JSON[_0x7119('0x6f')](_0x4f9442[_0x7119('0x75')]);_0x222b44['where'](_0x101ad5(_0x4f9442[_0x7119('0x75')]['group']));}_0x2f2e36=_0x222b44[_0x7119('0x76')]();_0x222b44[_0x7119('0x1b')](_0x499202);_0x222b44['offset'](0x0);logger['debug']('Limited\x20Query:',_0x222b44[_0x7119('0x77')]());return db['sequelize'][_0x7119('0x31')](_0x222b44['toString'](),{'type':db['sequelize']['QueryTypes'][_0x7119('0x78')]});}})[_0x7119('0x21')](respondWithResult(_0x5bdbb8,null))[_0x7119('0x41')](handleError(_0x5bdbb8,null));};function runReport(_0x5a5358,_0x4fce71,_0xfd02d2){var _0x4c4c04=_0x4fce71['name'];var _0x1a29f4=0xa;var _0x3060c4=[_0x7119('0x4c'),_0x7119('0x4d'),_0x7119('0x4e'),_0x7119('0x4f')];var _0x5d75f4={'SUM':_0x7119('0x79'),'COUNT':_0x7119('0x7a'),'COUNT DISTINCT':_0x7119('0x50'),'MAX':_0x7119('0x51'),'MIN':_0x7119('0x7b'),'AVG':_0x7119('0x52'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7119('0x54')};var _0x213bb5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7119('0x58')};var _0x33ebeb=function(_0x36cfac){return!_[_0x7119('0x71')]([_0x7119('0x59'),_0x7119('0x7c'),_0x7119('0x5a'),'IS\x20NOT\x20EMPTY'],_0x36cfac);};var _0x5ead89=function(_0x557abd){if(!_0x557abd||!_0x557abd[_0x7119('0x5b')][_0x7119('0x36')]){return'';}for(var _0x4dc652='(',_0x4bfd5c=0x0;_0x4bfd5c<_0x557abd['rules'][_0x7119('0x36')];_0x4bfd5c+=0x1){_0x4bfd5c>0x0&&(_0x4dc652+='\x20'+_0x557abd['operator']+'\x20');_0x4dc652+=_0x557abd[_0x7119('0x5b')][_0x4bfd5c][_0x7119('0x5d')]?_0x5ead89(_0x557abd['rules'][_0x4bfd5c][_0x7119('0x5d')]):_0x557abd[_0x7119('0x5b')][_0x4bfd5c][_0x7119('0x6d')]+'\x20'+_0x557abd[_0x7119('0x5b')][_0x4bfd5c][_0x7119('0x5e')]+(_0x33ebeb(_0x557abd[_0x7119('0x5b')][_0x4bfd5c][_0x7119('0x5e')])?'\x20'+_0x557abd[_0x7119('0x5b')][_0x4bfd5c][_0x7119('0x5f')]:'');}return _0x4dc652+')';};var _0x345dd2={'where':{'id':_0x5a5358['id']}},_0xae7b8a,_0x5e6634,_0x225ebd,_0x2d5353,_0x1e3b81;_0x345dd2=_[_0x7119('0x3d')]({},_0x345dd2,_0xfd02d2);return db[_0x7119('0x2b')][_0x7119('0x43')](_0x345dd2)[_0x7119('0x21')](function(_0x41990f){if(_0x41990f){_0xae7b8a=_0x41990f;return _0x41990f['getFields']();}return null;})[_0x7119('0x21')](function(_0x1b3036){if(_0x1b3036){if(!_0x1b3036[_0x7119('0x36')]){throw new db[(_0x7119('0x7d'))][(_0x7119('0x60'))](_0x7119('0x61'),0x193);}_0x5e6634=_0x1b3036;return db[_0x7119('0x62')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x45e8b2){if(_0x45e8b2){_0x225ebd=_[_0x7119('0x64')](_0x45e8b2,'id');var _0x1c4fe6;var _0x37250e=squel[_0x7119('0x65')]();_0x37250e['from'](_0xae7b8a['table']);for(var _0x3ee333=0x0;_0x3ee333<_0x5e6634['length'];_0x3ee333+=0x1){_0x1c4fe6=_0x5e6634[_0x3ee333][_0x7119('0x7e')]?_0x225ebd[_0x5e6634[_0x3ee333]['MetricId']][_0x7119('0x67')]:_0x5e6634[_0x3ee333][_0x7119('0x6d')];_0x1c4fe6=_0x5e6634[_0x3ee333][_0x7119('0x68')]?_[_0x7119('0x69')](_0x5d75f4[_0x5e6634[_0x3ee333]['function']],'%s',_0x1c4fe6):_0x1c4fe6;_0x1c4fe6=_0x5e6634[_0x3ee333]['format']?_[_0x7119('0x69')](_0x213bb5[_0x5e6634[_0x3ee333]['format']],'%s',_0x1c4fe6):_0x1c4fe6;if(_0x5e6634[_0x3ee333][_0x7119('0x6b')]){_0x37250e['group'](_0x1c4fe6);}_0x5e6634[_0x3ee333][_0x7119('0x6c')]&&_0x37250e[_0x7119('0x37')](_0x1c4fe6,_0x5e6634[_0x3ee333][_0x7119('0x6c')]===_0x7119('0x7f')?![]:!![]);_0x37250e['field'](_0x1c4fe6,_0x5e6634[_0x3ee333]['alias']||_0x1c4fe6);}if(_0xae7b8a['joins']){_0xae7b8a['joins']=JSON[_0x7119('0x6f')](_0xae7b8a['joins']);for(var _0x5856bb=0x0;_0x5856bb<_0xae7b8a['joins'][_0x7119('0x36')];_0x5856bb+=0x1){if(_0xae7b8a[_0x7119('0x70')][_0x5856bb][_0x7119('0x2e')]&&_[_0x7119('0x71')](_0x3060c4,_0xae7b8a[_0x7119('0x70')][_0x5856bb][_0x7119('0x2e')])&&_0xae7b8a[_0x7119('0x70')][_0x5856bb]['parentKey']&&_0xae7b8a[_0x7119('0x70')][_0x5856bb]['foreignTable']&&_0xae7b8a[_0x7119('0x70')][_0x5856bb][_0x7119('0x74')]){_0x37250e[_0xae7b8a[_0x7119('0x70')][_0x5856bb][_0x7119('0x2e')]](_0xae7b8a[_0x7119('0x70')][_0x5856bb][_0x7119('0x73')],null,util[_0x7119('0x6a')]('%s.%s\x20=\x20%s.%s',_0xae7b8a[_0x7119('0x66')],_0xae7b8a[_0x7119('0x70')][_0x5856bb][_0x7119('0x72')],_0xae7b8a[_0x7119('0x70')][_0x5856bb][_0x7119('0x73')],_0xae7b8a[_0x7119('0x70')][_0x5856bb]['foreignKey']));}}}if(_0xae7b8a['conditions']){_0xae7b8a[_0x7119('0x75')]=JSON[_0x7119('0x6f')](_0xae7b8a[_0x7119('0x75')]);_0x37250e['where'](_0x5ead89(_0xae7b8a[_0x7119('0x75')][_0x7119('0x5d')]));}_0x1e3b81=_0x37250e['clone']();_0x37250e[_0x7119('0x1b')](_0x1a29f4);_0x37250e[_0x7119('0x1a')](0x0);logger[_0x7119('0x80')]('Limited\x20Query:',_0x37250e[_0x7119('0x77')]());return db[_0x7119('0x81')][_0x7119('0x31')](_0x37250e[_0x7119('0x77')](),{'type':db[_0x7119('0x81')][_0x7119('0x82')][_0x7119('0x78')]});}})[_0x7119('0x21')](function(_0x561f90){if(!_0x561f90['length']){throw new db['Sequelize'][(_0x7119('0x60'))](_0x7119('0x83'),0xcc);}if(_0x4fce71[_0x7119('0x84')]===_0x7119('0x85')){return null;}var _0x4b98b7=_[_0x7119('0x3d')](_0x4fce71,{'name':_0x4fce71[_0x7119('0x86')]||_0x4fce71[_0x7119('0x27')]||_0xae7b8a[_0x7119('0x27')],'basename':_0x4c4c04,'savename':util[_0x7119('0x6a')]('%s-%s.%s',_0x4fce71[_0x7119('0x27')]||_0xae7b8a[_0x7119('0x27')],require(_0x7119('0x87'))['generate'](0x4),_0x4fce71[_0x7119('0x84')]||_0x7119('0x88')),'reportId':_0xae7b8a['id'],'reportType':_0x7119('0x89')});return db[_0x7119('0x8a')]['create'](_0x4b98b7,{'raw':!![]});})[_0x7119('0x21')](function(_0x49fcb6){if(_0xae7b8a['table']===_0x7119('0x8b')){_0x1e3b81['where'](_0xae7b8a[_0x7119('0x66')]+_0x7119('0x8c'),_0x4fce71[_0x7119('0x8d')],_0x4fce71['endDate']);}else{_0x1e3b81[_0x7119('0x3c')](_0xae7b8a['table']+_0x7119('0x8e'),_0x4fce71[_0x7119('0x8d')],_0x4fce71[_0x7119('0x8f')]);}if(_0x49fcb6){logger[_0x7119('0x90')]('Run\x20Query:',_0x1e3b81[_0x7119('0x77')]());require(_0x7119('0x91'))['fork'](path[_0x7119('0x4c')](__dirname,_0x7119('0x92'),_0x49fcb6[_0x7119('0x84')]),[_0x49fcb6['id'],_0x1e3b81[_0x7119('0x77')](),path[_0x7119('0x4c')](__dirname,_0x7119('0x93'),_0x49fcb6[_0x7119('0x94')]),_0x4c4c04]);return _0x49fcb6;}else{var _0x2c92d2=squel[_0x7119('0x65')]();_0x2c92d2[_0x7119('0x95')]('('+_0x1e3b81['toString']()+')','countTable');_0x2c92d2['field'](_0x7119('0x96'),_0x7119('0x19'));_0x1e3b81[_0x7119('0x1b')](_0x4fce71[_0x7119('0x1b')]||_0x1a29f4);_0x1e3b81[_0x7119('0x1a')](_0x4fce71[_0x7119('0x1a')]||0x0);return db[_0x7119('0x81')]['query'](_0x2c92d2[_0x7119('0x77')](),{'type':db[_0x7119('0x81')][_0x7119('0x82')]['SELECT']})[_0x7119('0x21')](function(_0x472c50){if(!_0x472c50[_0x7119('0x36')]){_0x2d5353=0x0;}else{_0x2d5353=_0x472c50[0x0]['count']||0x0;}return db['sequelize'][_0x7119('0x31')](_0x1e3b81[_0x7119('0x77')](),{'type':db[_0x7119('0x81')][_0x7119('0x82')][_0x7119('0x78')]});})['then'](function(_0x3278bd){return{'rows':_0x3278bd||[],'count':_0x2d5353};});}});}exports[_0x7119('0x97')]=function(_0x49db16,_0x435f2){return runReport(_0x49db16[_0x7119('0x42')],_0x49db16[_0x7119('0x31')],_0x49db16[_0x7119('0x3e')])[_0x7119('0x21')](respondWithResult(_0x435f2,null))['catch'](handleError(_0x435f2,null));};exports['runReport']=runReport;exports[_0x7119('0x31')]=function(_0x28ff3a,_0xb8adef){var _0x24379f=0xa;var _0x2b234c=[_0x7119('0x4c'),_0x7119('0x4d'),_0x7119('0x4e'),_0x7119('0x4f')];var _0x48f793={'SUM':_0x7119('0x79'),'COUNT':_0x7119('0x7a'),'COUNT DISTINCT':_0x7119('0x50'),'MAX':'MAX(%s)','MIN':_0x7119('0x7b'),'AVG':_0x7119('0x52'),'GROUP_CONCAT':_0x7119('0x98'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x178121={'SEC_TO_TIME':_0x7119('0x55'),'DATE':_0x7119('0x56'),'HOUR':_0x7119('0x99'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7119('0x58')};var _0x17ab3a=function(_0x35e3f8){return!_['includes'](['IS\x20NULL',_0x7119('0x7c'),'IS\x20EMPTY',_0x7119('0x9a')],_0x35e3f8);};var _0x217add=function(_0xa5ea7){if(!_0xa5ea7||!_0xa5ea7[_0x7119('0x5b')]['length']){return'';}for(var _0x55863c='(',_0x48236b=0x0;_0x48236b<_0xa5ea7[_0x7119('0x5b')][_0x7119('0x36')];_0x48236b+=0x1){_0x48236b>0x0&&(_0x55863c+='\x20'+_0xa5ea7[_0x7119('0x5c')]+'\x20');_0x55863c+=_0xa5ea7[_0x7119('0x5b')][_0x48236b][_0x7119('0x5d')]?_0x217add(_0xa5ea7[_0x7119('0x5b')][_0x48236b][_0x7119('0x5d')]):_0xa5ea7[_0x7119('0x5b')][_0x48236b][_0x7119('0x6d')]+'\x20'+_0xa5ea7[_0x7119('0x5b')][_0x48236b][_0x7119('0x5e')]+(_0x17ab3a(_0xa5ea7[_0x7119('0x5b')][_0x48236b][_0x7119('0x5e')])?'\x20'+_0xa5ea7[_0x7119('0x5b')][_0x48236b][_0x7119('0x5f')]:'');}return _0x55863c+')';};var _0x393baf={'where':{'id':_0x28ff3a[_0x7119('0x42')]['id']}},_0x1d1b33,_0xae9abb,_0x54dda2,_0x279265,_0x23f936;_0x393baf=_['merge']({},_0x393baf,_0x28ff3a[_0x7119('0x3e')]);return db[_0x7119('0x2b')][_0x7119('0x43')](_0x393baf)[_0x7119('0x21')](function(_0x19adc4){if(_0x19adc4){_0x1d1b33=_0x19adc4;return _0x19adc4[_0x7119('0x9b')]();}return null;})['then'](function(_0x405799){if(_0x405799){if(!_0x405799['length']){throw new db[(_0x7119('0x7d'))][(_0x7119('0x60'))](_0x7119('0x61'),0x193);}_0xae9abb=_0x405799;return db['AnalyticMetric'][_0x7119('0x63')]({'raw':!![]});}return null;})['then'](function(_0xc0a057){if(_0xc0a057){_0x54dda2=_[_0x7119('0x64')](_0xc0a057,'id');var _0x506b15;var _0x35d515=squel['select']();_0x35d515['from'](_0x1d1b33['table']);for(var _0x1a6116=0x0;_0x1a6116<_0xae9abb[_0x7119('0x36')];_0x1a6116+=0x1){_0x506b15=_0xae9abb[_0x1a6116][_0x7119('0x7e')]?_0x54dda2[_0xae9abb[_0x1a6116][_0x7119('0x7e')]][_0x7119('0x67')]:_0xae9abb[_0x1a6116][_0x7119('0x6d')];_0x506b15=_0xae9abb[_0x1a6116][_0x7119('0x68')]?_[_0x7119('0x69')](_0x48f793[_0xae9abb[_0x1a6116][_0x7119('0x68')]],'%s',_0x506b15):_0x506b15;_0x506b15=_0xae9abb[_0x1a6116]['format']?_[_0x7119('0x69')](_0x178121[_0xae9abb[_0x1a6116]['format']],'%s',_0x506b15):_0x506b15;if(_0xae9abb[_0x1a6116][_0x7119('0x6b')]){_0x35d515[_0x7119('0x5d')](_0x506b15);}_0xae9abb[_0x1a6116][_0x7119('0x6c')]&&_0x35d515['order'](_0x506b15,_0xae9abb[_0x1a6116][_0x7119('0x6c')]===_0x7119('0x7f')?![]:!![]);_0x35d515[_0x7119('0x6d')](_0x506b15,_0xae9abb[_0x1a6116][_0x7119('0x6e')]||_0x506b15);}if(_0x1d1b33['joins']){_0x1d1b33[_0x7119('0x70')]=JSON[_0x7119('0x6f')](_0x1d1b33[_0x7119('0x70')]);for(var _0x363366=0x0;_0x363366<_0x1d1b33[_0x7119('0x70')][_0x7119('0x36')];_0x363366+=0x1){if(_0x1d1b33[_0x7119('0x70')][_0x363366][_0x7119('0x2e')]&&_['includes'](_0x2b234c,_0x1d1b33[_0x7119('0x70')][_0x363366][_0x7119('0x2e')])&&_0x1d1b33[_0x7119('0x70')][_0x363366][_0x7119('0x72')]&&_0x1d1b33[_0x7119('0x70')][_0x363366][_0x7119('0x73')]&&_0x1d1b33[_0x7119('0x70')][_0x363366][_0x7119('0x74')]){_0x35d515[_0x1d1b33['joins'][_0x363366][_0x7119('0x2e')]](_0x1d1b33['joins'][_0x363366][_0x7119('0x73')],null,util[_0x7119('0x6a')]('%s.%s\x20=\x20%s.%s',_0x1d1b33[_0x7119('0x66')],_0x1d1b33[_0x7119('0x70')][_0x363366][_0x7119('0x72')],_0x1d1b33[_0x7119('0x70')][_0x363366][_0x7119('0x73')],_0x1d1b33['joins'][_0x363366][_0x7119('0x74')]));}}}if(_0x1d1b33[_0x7119('0x75')]){_0x1d1b33[_0x7119('0x75')]=JSON[_0x7119('0x6f')](_0x1d1b33[_0x7119('0x75')]);_0x35d515[_0x7119('0x3c')](_0x217add(_0x1d1b33['conditions'][_0x7119('0x5d')]));}_0x23f936=_0x35d515[_0x7119('0x76')]();_0x35d515['limit'](_0x24379f);_0x35d515[_0x7119('0x1a')](0x0);logger[_0x7119('0x80')](_0x7119('0x9c'),_0x35d515[_0x7119('0x77')]());return db[_0x7119('0x81')][_0x7119('0x31')](_0x35d515[_0x7119('0x77')](),{'type':db[_0x7119('0x81')][_0x7119('0x82')][_0x7119('0x78')]});}})[_0x7119('0x21')](function(){return{'sql':_0x23f936['toString']()};})['then'](respondWithResult(_0xb8adef,null))[_0x7119('0x41')](handleError(_0xb8adef,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 5617820..ddd422a 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 _0xba5c=['lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports'];(function(_0x43499d,_0x5cf1c6){var _0x1f7f44=function(_0xe57a89){while(--_0xe57a89){_0x43499d['push'](_0x43499d['shift']());}};_0x1f7f44(++_0x5cf1c6);}(_0xba5c,0xfc));var _0xcba5=function(_0x5be5d0,_0x1c6363){_0x5be5d0=_0x5be5d0-0x0;var _0x25d3e3=_0xba5c[_0x5be5d0];return _0x25d3e3;};'use strict';var _=require(_0xcba5('0x0'));var util=require(_0xcba5('0x1'));var logger=require(_0xcba5('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcba5('0x3'));var fs=require('fs');var path=require(_0xcba5('0x4'));var rimraf=require(_0xcba5('0x5'));var config=require(_0xcba5('0x6'));var attributes=require(_0xcba5('0x7'));module[_0xcba5('0x8')]=function(_0x36ee07,_0x17d52f){return _0x36ee07[_0xcba5('0x9')](_0xcba5('0xa'),attributes,{'tableName':_0xcba5('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf217=['analytics_custom_reports','../../config/logger','api','moment','bluebird','path','../../config/environment','./analyticCustomReport.attributes','define'];(function(_0x357bdd,_0xae8757){var _0xbeb6b=function(_0x5372f2){while(--_0x5372f2){_0x357bdd['push'](_0x357bdd['shift']());}};_0xbeb6b(++_0xae8757);}(_0xf217,0x13c));var _0x7f21=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0xf217[_0x45fc6a];return _0x14bcfd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7f21('0x0'))(_0x7f21('0x1'));var moment=require(_0x7f21('0x2'));var BPromise=require(_0x7f21('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f21('0x4'));var rimraf=require('rimraf');var config=require(_0x7f21('0x5'));var attributes=require(_0x7f21('0x6'));module['exports']=function(_0x4efdbe,_0x3408c8){return _0x4efdbe[_0x7f21('0x7')]('AnalyticCustomReport',attributes,{'tableName':_0x7f21('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index c4684a0..5ada882 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 _0xf2f8=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4c4ff3,_0x3ed2f6){var _0x1542f1=function(_0x23c5aa){while(--_0x23c5aa){_0x4c4ff3['push'](_0x4c4ff3['shift']());}};_0x1542f1(++_0x3ed2f6);}(_0xf2f8,0x126));var _0x8f2f=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xf2f8[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x8f2f('0x0'));var util=require(_0x8f2f('0x1'));var moment=require(_0x8f2f('0x2'));var BPromise=require('bluebird');var rs=require(_0x8f2f('0x3'));var fs=require('fs');var Redis=require(_0x8f2f('0x4'));var db=require(_0x8f2f('0x5'))['db'];var utils=require(_0x8f2f('0x6'));var logger=require('../../config/logger')(_0x8f2f('0x7'));var config=require('../../config/environment');var jayson=require(_0x8f2f('0x8'));var client=jayson[_0x8f2f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x102710,_0x57a3a0,_0x3a9314){return new BPromise(function(_0x3c8923,_0x4a5d89){return client[_0x8f2f('0xa')](_0x102710,_0x3a9314)['then'](function(_0x1a8613){logger['info'](_0x8f2f('0xb'),_0x57a3a0,_0x8f2f('0xc'));logger[_0x8f2f('0xd')](_0x8f2f('0xe'),_0x57a3a0,_0x8f2f('0xc'),JSON[_0x8f2f('0xf')](_0x1a8613));if(_0x1a8613[_0x8f2f('0x10')]){if(_0x1a8613[_0x8f2f('0x10')][_0x8f2f('0x11')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x57a3a0,_0x1a8613[_0x8f2f('0x10')]['message']);return _0x4a5d89(_0x1a8613[_0x8f2f('0x10')][_0x8f2f('0x12')]);}logger[_0x8f2f('0x10')](_0x8f2f('0xb'),_0x57a3a0,_0x1a8613['error']['message']);return _0x3c8923(_0x1a8613['error'][_0x8f2f('0x12')]);}else{logger[_0x8f2f('0x13')](_0x8f2f('0xb'),_0x57a3a0,'request\x20sent');_0x3c8923(_0x1a8613[_0x8f2f('0x14')][_0x8f2f('0x12')]);}})[_0x8f2f('0x15')](function(_0x3fcdc6){logger[_0x8f2f('0x10')](_0x8f2f('0xb'),_0x57a3a0,_0x3fcdc6);_0x4a5d89(_0x3fcdc6);});});} \ No newline at end of file +var _0x0b7a=['client','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x47c71e,_0x132354){var _0xe7007e=function(_0x265b3d){while(--_0x265b3d){_0x47c71e['push'](_0x47c71e['shift']());}};_0xe7007e(++_0x132354);}(_0x0b7a,0x141));var _0xa0b7=function(_0x574122,_0x216637){_0x574122=_0x574122-0x0;var _0x294fa6=_0x0b7a[_0x574122];return _0x294fa6;};'use strict';var _=require('lodash');var util=require(_0xa0b7('0x0'));var moment=require(_0xa0b7('0x1'));var BPromise=require(_0xa0b7('0x2'));var rs=require(_0xa0b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa0b7('0x4'));var logger=require(_0xa0b7('0x5'))(_0xa0b7('0x6'));var config=require(_0xa0b7('0x7'));var jayson=require(_0xa0b7('0x8'));var client=jayson[_0xa0b7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x251dd9,_0xd492ea,_0x1aaad2){return new BPromise(function(_0x49ba5a,_0x230125){return client[_0xa0b7('0xa')](_0x251dd9,_0x1aaad2)['then'](function(_0x182e31){logger[_0xa0b7('0xb')](_0xa0b7('0xc'),_0xd492ea,_0xa0b7('0xd'));logger[_0xa0b7('0xe')](_0xa0b7('0xf'),_0xd492ea,_0xa0b7('0xd'),JSON[_0xa0b7('0x10')](_0x182e31));if(_0x182e31[_0xa0b7('0x11')]){if(_0x182e31[_0xa0b7('0x11')][_0xa0b7('0x12')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xd492ea,_0x182e31[_0xa0b7('0x11')][_0xa0b7('0x13')]);return _0x230125(_0x182e31[_0xa0b7('0x11')][_0xa0b7('0x13')]);}logger[_0xa0b7('0x11')](_0xa0b7('0xc'),_0xd492ea,_0x182e31['error'][_0xa0b7('0x13')]);return _0x49ba5a(_0x182e31[_0xa0b7('0x11')]['message']);}else{logger[_0xa0b7('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0xd492ea,'request\x20sent');_0x49ba5a(_0x182e31[_0xa0b7('0x14')][_0xa0b7('0x13')]);}})[_0xa0b7('0x15')](function(_0xb56a09){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xd492ea,_0xb56a09);_0x230125(_0xb56a09);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 4656365..43efdfd 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 _0x5bcb=['delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','index','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','/:id/query','query','post','put','update'];(function(_0x2bcb4d,_0x1b1d96){var _0x423940=function(_0x28e92e){while(--_0x28e92e){_0x2bcb4d['push'](_0x2bcb4d['shift']());}};_0x423940(++_0x1b1d96);}(_0x5bcb,0x12f));var _0xb5bc=function(_0x5adf2b,_0x1ea3e9){_0x5adf2b=_0x5adf2b-0x0;var _0x2a9399=_0x5bcb[_0x5adf2b];return _0x2a9399;};'use strict';var multer=require(_0xb5bc('0x0'));var util=require(_0xb5bc('0x1'));var path=require(_0xb5bc('0x2'));var timeout=require(_0xb5bc('0x3'));var express=require('express');var router=express[_0xb5bc('0x4')]();var auth=require(_0xb5bc('0x5'));var interaction=require(_0xb5bc('0x6'));var config=require(_0xb5bc('0x7'));var controller=require(_0xb5bc('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xb5bc('0x9')]);router[_0xb5bc('0xa')](_0xb5bc('0xb'),auth[_0xb5bc('0xc')](),controller[_0xb5bc('0xd')]);router[_0xb5bc('0xa')](_0xb5bc('0xe'),auth['isAuthenticated'](),controller[_0xb5bc('0xf')]);router[_0xb5bc('0xa')](_0xb5bc('0x10'),auth[_0xb5bc('0xc')](),controller['run']);router[_0xb5bc('0xa')](_0xb5bc('0x11'),auth['isAuthenticated'](),controller[_0xb5bc('0x12')]);router[_0xb5bc('0x13')]('/',auth[_0xb5bc('0xc')](),controller['create']);router[_0xb5bc('0x14')](_0xb5bc('0xb'),auth[_0xb5bc('0xc')](),controller[_0xb5bc('0x15')]);router[_0xb5bc('0x16')](_0xb5bc('0xb'),auth[_0xb5bc('0xc')](),controller[_0xb5bc('0x17')]);module[_0xb5bc('0x18')]=router; \ No newline at end of file +var _0x622b=['../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run','run','query','post','create','put','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service'];(function(_0x54954a,_0x13a245){var _0x17027e=function(_0x5530b4){while(--_0x5530b4){_0x54954a['push'](_0x54954a['shift']());}};_0x17027e(++_0x13a245);}(_0x622b,0x1de));var _0xb622=function(_0x5618c4,_0x4e8f57){_0x5618c4=_0x5618c4-0x0;var _0xdf390f=_0x622b[_0x5618c4];return _0xdf390f;};'use strict';var multer=require(_0xb622('0x0'));var util=require(_0xb622('0x1'));var path=require('path');var timeout=require(_0xb622('0x2'));var express=require(_0xb622('0x3'));var router=express['Router']();var auth=require(_0xb622('0x4'));var interaction=require(_0xb622('0x5'));var config=require(_0xb622('0x6'));var controller=require(_0xb622('0x7'));router['get']('/',auth[_0xb622('0x8')](),controller[_0xb622('0x9')]);router[_0xb622('0xa')](_0xb622('0xb'),auth['isAuthenticated'](),controller[_0xb622('0xc')]);router[_0xb622('0xa')](_0xb622('0xd'),auth[_0xb622('0x8')](),controller[_0xb622('0xe')]);router[_0xb622('0xa')](_0xb622('0xf'),auth['isAuthenticated'](),controller[_0xb622('0x10')]);router[_0xb622('0xa')]('/:id/query',auth['isAuthenticated'](),controller[_0xb622('0x11')]);router[_0xb622('0x12')]('/',auth[_0xb622('0x8')](),controller[_0xb622('0x13')]);router[_0xb622('0x14')](_0xb622('0xb'),auth[_0xb622('0x8')](),controller['update']);router['delete'](_0xb622('0xb'),auth[_0xb622('0x8')](),controller[_0xb622('0x15')]);module[_0xb622('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index d7029c3..3924778 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 _0xea0d=['exports','STRING','TEXT','sequelize'];(function(_0x35de1b,_0x22335d){var _0xe84c82=function(_0x3c749d){while(--_0x3c749d){_0x35de1b['push'](_0x35de1b['shift']());}};_0xe84c82(++_0x22335d);}(_0xea0d,0x153));var _0xdea0=function(_0x5a7618,_0x3f44c2){_0x5a7618=_0x5a7618-0x0;var _0x12dc65=_0xea0d[_0x5a7618];return _0x12dc65;};'use strict';var Sequelize=require(_0xdea0('0x0'));module[_0xdea0('0x1')]={'name':{'type':Sequelize[_0xdea0('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdea0('0x2')]},'parent':{'type':Sequelize[_0xdea0('0x2')]},'table':{'type':Sequelize[_0xdea0('0x2')]},'conditions':{'type':Sequelize[_0xdea0('0x3')]},'joins':{'type':Sequelize[_0xdea0('0x3')]}}; \ No newline at end of file +var _0x2c53=['exports','STRING','TEXT','sequelize'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x2c53,0x19b));var _0x32c5=function(_0x271474,_0x248441){_0x271474=_0x271474-0x0;var _0x72f117=_0x2c53[_0x271474];return _0x72f117;};'use strict';var Sequelize=require(_0x32c5('0x0'));module[_0x32c5('0x1')]={'name':{'type':Sequelize[_0x32c5('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x32c5('0x2')]},'parent':{'type':Sequelize[_0x32c5('0x2')]},'table':{'type':Sequelize[_0x32c5('0x2')]},'conditions':{'type':Sequelize[_0x32c5('0x3')]},'joins':{'type':Sequelize[_0x32c5('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index acd55a8..285c4cf 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 _0xc492=['fullPath','%s-%s.%s','output','csv','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','child_process','savename','countTable','COUNT(*)','SELECT','cross_join','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','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','limit','set','Content-Range','apply','save','destroy','then','get','error','stack','name','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','AnalyticDefaultReport','findAll','show','params','find','catch','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','autoAssociation','UserProfileResource','create','DefaultReports','update','body','preview','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','toString','sequelize','QueryTypes','join','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','debug','Limited\x20Query:','web'];(function(_0x2e7f1e,_0x32f286){var _0x3dffa5=function(_0x920dc5){while(--_0x920dc5){_0x2e7f1e['push'](_0x2e7f1e['shift']());}};_0x3dffa5(++_0x32f286);}(_0xc492,0x146));var _0x2c49=function(_0x353a1b,_0x174214){_0x353a1b=_0x353a1b-0x0;var _0x37e4cc=_0xc492[_0x353a1b];return _0x37e4cc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2c49('0x0'));var rimraf=require(_0x2c49('0x1'));var zipdir=require(_0x2c49('0x2'));var jsonpatch=require(_0x2c49('0x3'));var rp=require('request-promise');var moment=require(_0x2c49('0x4'));var BPromise=require(_0x2c49('0x5'));var Mustache=require(_0x2c49('0x6'));var util=require(_0x2c49('0x7'));var path=require('path');var sox=require(_0x2c49('0x8'));var csv=require(_0x2c49('0x9'));var ejs=require(_0x2c49('0xa'));var fs=require('fs');var _=require(_0x2c49('0xb'));var squel=require(_0x2c49('0xc'));var crypto=require(_0x2c49('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2c49('0xe'));var toCsv=require(_0x2c49('0x9'));var querystring=require(_0x2c49('0xf'));var Papa=require('papaparse');var Redis=require(_0x2c49('0x10'));var authService=require(_0x2c49('0x11'));var qs=require(_0x2c49('0x12'));var as=require(_0x2c49('0x13'));var hardwareService=require(_0x2c49('0x14'));var logger=require('../../config/logger')(_0x2c49('0x15'));var utils=require(_0x2c49('0x16'));var config=require(_0x2c49('0x17'));var db=require(_0x2c49('0x18'))['db'];function respondWithStatusCode(_0x540087,_0x419d74){_0x419d74=_0x419d74||0xcc;return function(_0x306ec7){if(_0x306ec7){return _0x540087[_0x2c49('0x19')](_0x419d74);}return _0x540087[_0x2c49('0x1a')](_0x419d74)[_0x2c49('0x1b')]();};}function respondWithResult(_0x2ddcf3,_0x5c04a2){_0x5c04a2=_0x5c04a2||0xc8;return function(_0x1f6984){if(_0x1f6984){return _0x2ddcf3[_0x2c49('0x1a')](_0x5c04a2)[_0x2c49('0x1c')](_0x1f6984);}};}function respondWithFilteredResult(_0x30f45d,_0x479901){return function(_0x3e7c73){if(_0x3e7c73){var _0x48a7d1=_0x3e7c73[_0x2c49('0x1d')],_0x314d35=_0x479901['offset'],_0x4029bc=_0x479901[_0x2c49('0x1e')]+_0x479901[_0x2c49('0x1f')],_0x2a16c0;if(_0x4029bc>=_0x48a7d1){_0x4029bc=_0x48a7d1;_0x2a16c0=0xc8;}else{_0x2a16c0=0xce;}_0x30f45d[_0x2c49('0x1a')](_0x2a16c0);return _0x30f45d[_0x2c49('0x20')](_0x2c49('0x21'),_0x314d35+'-'+_0x4029bc+'/'+_0x48a7d1)[_0x2c49('0x1c')](_0x3e7c73);}return null;};}function patchUpdates(_0x5b5a34){return function(_0x55af55){try{jsonpatch[_0x2c49('0x22')](_0x55af55,_0x5b5a34,!![]);}catch(_0x6f44af){return BPromise['reject'](_0x6f44af);}return _0x55af55[_0x2c49('0x23')]();};}function saveUpdates(_0x227527,_0x29067c){return function(_0x216d9b){if(_0x216d9b){return _0x216d9b['update'](_0x227527)['then'](function(_0x216e4e){return _0x216e4e;});}return null;};}function removeEntity(_0x430eaa,_0x5582d4){return function(_0x42847a){if(_0x42847a){return _0x42847a[_0x2c49('0x24')]()[_0x2c49('0x25')](function(){var _0x4dff03=_0x42847a[_0x2c49('0x26')]({'plain':!![]});var _0x267c14='DefaultReports';return db['UserProfileResource'][_0x2c49('0x24')]({'where':{'type':_0x267c14,'resourceId':_0x4dff03['id']}})['then'](function(){return _0x42847a;});})[_0x2c49('0x25')](function(){_0x430eaa[_0x2c49('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4355ea,_0x2dd862){return function(_0x3a1a27){if(!_0x3a1a27){_0x4355ea['sendStatus'](0x194);}return _0x3a1a27;};}function handleError(_0x2a355f,_0x27fa42){_0x27fa42=_0x27fa42||0x1f4;return function(_0x5da7ec){logger[_0x2c49('0x27')](_0x5da7ec[_0x2c49('0x28')]);if(_0x5da7ec[_0x2c49('0x29')]){delete _0x5da7ec[_0x2c49('0x29')];}_0x2a355f[_0x2c49('0x1a')](_0x27fa42)['send'](_0x5da7ec);};}exports[_0x2c49('0x2a')]=function(_0x4707df,_0x5a2476){var _0x1e5510={},_0x181136={},_0x43eab3={'count':0x0,'rows':[]};var _0x21c27f=_['map'](db['AnalyticDefaultReport'][_0x2c49('0x2b')],function(_0x49370b){return{'name':_0x49370b[_0x2c49('0x2c')],'type':_0x49370b[_0x2c49('0x2d')]['key']};});_0x181136[_0x2c49('0x2e')]=_[_0x2c49('0x2f')](_0x21c27f,_0x2c49('0x29'));_0x181136[_0x2c49('0x30')]=_[_0x2c49('0x31')](_0x4707df['query']);_0x181136[_0x2c49('0x32')]=_[_0x2c49('0x33')](_0x181136[_0x2c49('0x2e')],_0x181136[_0x2c49('0x30')]);_0x1e5510[_0x2c49('0x34')]=_[_0x2c49('0x33')](_0x181136['model'],qs[_0x2c49('0x35')](_0x4707df[_0x2c49('0x30')][_0x2c49('0x35')]));_0x1e5510[_0x2c49('0x34')]=_0x1e5510[_0x2c49('0x34')][_0x2c49('0x36')]?_0x1e5510[_0x2c49('0x34')]:_0x181136[_0x2c49('0x2e')];if(!_0x4707df['query'][_0x2c49('0x37')](_0x2c49('0x38'))){_0x1e5510[_0x2c49('0x1f')]=qs[_0x2c49('0x1f')](_0x4707df[_0x2c49('0x30')][_0x2c49('0x1f')]);_0x1e5510[_0x2c49('0x1e')]=qs[_0x2c49('0x1e')](_0x4707df[_0x2c49('0x30')][_0x2c49('0x1e')]);}_0x1e5510[_0x2c49('0x39')]=qs[_0x2c49('0x3a')](_0x4707df['query'][_0x2c49('0x3a')]);_0x1e5510[_0x2c49('0x3b')]=qs[_0x2c49('0x32')](_[_0x2c49('0x3c')](_0x4707df['query'],_0x181136['filters']));if(_0x4707df[_0x2c49('0x30')][_0x2c49('0x3d')]){_0x1e5510[_0x2c49('0x3b')]=_[_0x2c49('0x3e')](_0x1e5510[_0x2c49('0x3b')],{'$or':_[_0x2c49('0x2f')](_0x21c27f,function(_0x3eef7e){if(_0x3eef7e['type']!==_0x2c49('0x3f')){var _0x9e0b38={};_0x9e0b38[_0x3eef7e[_0x2c49('0x29')]]={'$like':'%'+_0x4707df[_0x2c49('0x30')]['filter']+'%'};return _0x9e0b38;}})});}_0x1e5510=_['merge']({},_0x1e5510,_0x4707df[_0x2c49('0x40')]);var _0x2f9522={'where':_0x1e5510[_0x2c49('0x3b')]};return db['AnalyticDefaultReport'][_0x2c49('0x1d')](_0x2f9522)['then'](function(_0x3a6e14){_0x43eab3[_0x2c49('0x1d')]=_0x3a6e14;if(_0x4707df[_0x2c49('0x30')]['includeAll']){_0x1e5510[_0x2c49('0x41')]=[{'all':!![]}];}return db[_0x2c49('0x42')][_0x2c49('0x43')](_0x1e5510);})[_0x2c49('0x25')](function(_0x524b2a){_0x43eab3['rows']=_0x524b2a;return _0x43eab3;})[_0x2c49('0x25')](respondWithFilteredResult(_0x5a2476,_0x1e5510))['catch'](handleError(_0x5a2476,null));};exports[_0x2c49('0x44')]=function(_0x3e0321,_0x36e607){var _0x14378a={'raw':!![],'where':{'id':_0x3e0321[_0x2c49('0x45')]['id']}},_0x3c81ac={};_0x3c81ac[_0x2c49('0x2e')]=_[_0x2c49('0x31')](db[_0x2c49('0x42')][_0x2c49('0x2b')]);_0x3c81ac['query']=_[_0x2c49('0x31')](_0x3e0321['query']);_0x3c81ac['filters']=_[_0x2c49('0x33')](_0x3c81ac[_0x2c49('0x2e')],_0x3c81ac[_0x2c49('0x30')]);_0x14378a[_0x2c49('0x34')]=_['intersection'](_0x3c81ac['model'],qs[_0x2c49('0x35')](_0x3e0321['query'][_0x2c49('0x35')]));_0x14378a[_0x2c49('0x34')]=_0x14378a['attributes'][_0x2c49('0x36')]?_0x14378a[_0x2c49('0x34')]:_0x3c81ac[_0x2c49('0x2e')];if(_0x3e0321[_0x2c49('0x30')]['includeAll']){_0x14378a['include']=[{'all':!![]}];}_0x14378a=_[_0x2c49('0x3e')]({},_0x14378a,_0x3e0321[_0x2c49('0x40')]);return db[_0x2c49('0x42')][_0x2c49('0x46')](_0x14378a)[_0x2c49('0x25')](handleEntityNotFound(_0x36e607,null))[_0x2c49('0x25')](respondWithResult(_0x36e607,null))[_0x2c49('0x47')](handleError(_0x36e607,null));};exports['create']=function(_0x33f589,_0x3d2531){return db['AnalyticDefaultReport']['create'](_0x33f589['body'],{})[_0x2c49('0x25')](function(_0x551f77){var _0x57f2d6=_0x33f589['user'][_0x2c49('0x26')]({'plain':!![]});if(!_0x57f2d6)throw new Error(_0x2c49('0x48'));if(_0x57f2d6[_0x2c49('0x49')]==='user'){var _0xc584f4=_0x551f77[_0x2c49('0x26')]({'plain':!![]});var _0x1d77ff=_0x2c49('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x1d77ff,'userProfileId':_0x57f2d6['userProfileId']},'raw':!![]})[_0x2c49('0x25')](function(_0x4397fb){if(_0x4397fb&&_0x4397fb[_0x2c49('0x4b')]===0x0){return db[_0x2c49('0x4c')][_0x2c49('0x4d')]({'name':_0xc584f4['name'],'resourceId':_0xc584f4['id'],'type':_0x2c49('0x4e'),'sectionId':_0x4397fb['id']},{})[_0x2c49('0x25')](function(){return _0x551f77;});}else{return _0x551f77;}})['catch'](function(_0x4c9c41){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c9c41);throw _0x4c9c41;});}return _0x551f77;})[_0x2c49('0x25')](respondWithResult(_0x3d2531,0xc9))[_0x2c49('0x47')](handleError(_0x3d2531,null));};exports[_0x2c49('0x4f')]=function(_0x3dd3e5,_0x4b2030){if(_0x3dd3e5['body']['id']){delete _0x3dd3e5['body']['id'];}return db[_0x2c49('0x42')]['find']({'where':{'id':_0x3dd3e5['params']['id']}})['then'](handleEntityNotFound(_0x4b2030,null))[_0x2c49('0x25')](saveUpdates(_0x3dd3e5[_0x2c49('0x50')],null))['then'](respondWithResult(_0x4b2030,null))['catch'](handleError(_0x4b2030,null));};exports[_0x2c49('0x24')]=function(_0x30caf2,_0x5b8a90){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x30caf2['params']['id']}})[_0x2c49('0x25')](handleEntityNotFound(_0x5b8a90,null))[_0x2c49('0x25')](removeEntity(_0x5b8a90,null))[_0x2c49('0x47')](handleError(_0x5b8a90,null));};exports[_0x2c49('0x51')]=function(_0x45e903,_0x121fdb){var _0x2e4ee9=0xa;var _0x96b328=['join',_0x2c49('0x52'),_0x2c49('0x53'),'cross_join'];var _0x492e30={'SUM':_0x2c49('0x54'),'COUNT':_0x2c49('0x55'),'COUNT DISTINCT':_0x2c49('0x56'),'MAX':_0x2c49('0x57'),'MIN':_0x2c49('0x58'),'AVG':_0x2c49('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x2c49('0x5a'),'GROUP_CONCAT DESC':_0x2c49('0x5b')};var _0x15750f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x2c49('0x5c'),'HOUR':_0x2c49('0x5d'),'ROUND':_0x2c49('0x5e'),'UNIX_TIMESTAMP':_0x2c49('0x5f')};var _0x9d1f52=function(_0xb25045){return!_[_0x2c49('0x60')]([_0x2c49('0x61'),_0x2c49('0x62'),_0x2c49('0x63'),_0x2c49('0x64')],_0xb25045);};var _0x5d2038=function(_0x2c42e2){if(!_0x2c42e2||!_0x2c42e2[_0x2c49('0x65')][_0x2c49('0x36')]){return'';}for(var _0x3343dc='(',_0x7c0e9d=0x0;_0x7c0e9d<_0x2c42e2[_0x2c49('0x65')][_0x2c49('0x36')];_0x7c0e9d+=0x1){_0x7c0e9d>0x0&&(_0x3343dc+='\x20'+_0x2c42e2[_0x2c49('0x66')]+'\x20');_0x3343dc+=_0x2c42e2['rules'][_0x7c0e9d][_0x2c49('0x67')]?_0x5d2038(_0x2c42e2[_0x2c49('0x65')][_0x7c0e9d][_0x2c49('0x67')]):_0x2c42e2[_0x2c49('0x65')][_0x7c0e9d][_0x2c49('0x68')]+'\x20'+_0x2c42e2[_0x2c49('0x65')][_0x7c0e9d]['condition']+(_0x9d1f52(_0x2c42e2[_0x2c49('0x65')][_0x7c0e9d][_0x2c49('0x69')])?'\x20'+_0x2c42e2[_0x2c49('0x65')][_0x7c0e9d][_0x2c49('0x6a')]:'');}return _0x3343dc+')';};var _0x5f26b5={'where':{'id':_0x45e903[_0x2c49('0x45')]['id']}},_0x4f8b49,_0x8c3c95,_0x4eaa03,_0x42a0d7,_0x359ca4;_0x5f26b5=_[_0x2c49('0x3e')]({},_0x5f26b5,_0x45e903[_0x2c49('0x40')]);return db[_0x2c49('0x42')][_0x2c49('0x46')](_0x5f26b5)[_0x2c49('0x25')](function(_0x3d422e){if(_0x3d422e){_0x4f8b49=_0x3d422e;return _0x3d422e[_0x2c49('0x6b')]();}return null;})[_0x2c49('0x25')](function(_0x18ee33){if(_0x18ee33){if(!_0x18ee33[_0x2c49('0x36')]){throw new db[(_0x2c49('0x6c'))][(_0x2c49('0x6d'))](_0x2c49('0x6e'),0x193);}_0x8c3c95=_0x18ee33;return db[_0x2c49('0x6f')][_0x2c49('0x43')]({'raw':!![]});}return null;})[_0x2c49('0x25')](function(_0x3de88a){if(_0x3de88a){_0x4eaa03=_[_0x2c49('0x70')](_0x3de88a,'id');var _0xe5e45c;var _0x14861d=squel[_0x2c49('0x71')]();_0x14861d[_0x2c49('0x72')](_0x4f8b49['table']);for(var _0xc861c0=0x0;_0xc861c0<_0x8c3c95['length'];_0xc861c0+=0x1){_0xe5e45c=_0x8c3c95[_0xc861c0][_0x2c49('0x73')]?_0x4eaa03[_0x8c3c95[_0xc861c0][_0x2c49('0x73')]][_0x2c49('0x74')]:_0x8c3c95[_0xc861c0][_0x2c49('0x68')];_0xe5e45c=_0x8c3c95[_0xc861c0][_0x2c49('0x75')]?_[_0x2c49('0x76')](_0x492e30[_0x8c3c95[_0xc861c0]['function']],'%s',_0xe5e45c):_0xe5e45c;_0xe5e45c=_0x8c3c95[_0xc861c0][_0x2c49('0x77')]?_['replace'](_0x15750f[_0x8c3c95[_0xc861c0][_0x2c49('0x77')]],'%s',_0xe5e45c):_0xe5e45c;if(_0x8c3c95[_0xc861c0][_0x2c49('0x78')]){_0x14861d[_0x2c49('0x67')](_0xe5e45c);}_0x8c3c95[_0xc861c0][_0x2c49('0x79')]&&_0x14861d['order'](_0xe5e45c,_0x8c3c95[_0xc861c0][_0x2c49('0x79')]===_0x2c49('0x7a')?![]:!![]);_0x14861d['field'](_0xe5e45c,_0x8c3c95[_0xc861c0][_0x2c49('0x7b')]||_0xe5e45c);}if(_0x4f8b49[_0x2c49('0x7c')]){_0x4f8b49['joins']=JSON[_0x2c49('0x7d')](_0x4f8b49[_0x2c49('0x7c')]);for(var _0x5b04fa=0x0;_0x5b04fa<_0x4f8b49['joins'][_0x2c49('0x36')];_0x5b04fa+=0x1){if(_0x4f8b49[_0x2c49('0x7c')][_0x5b04fa][_0x2c49('0x2d')]&&_[_0x2c49('0x60')](_0x96b328,_0x4f8b49[_0x2c49('0x7c')][_0x5b04fa]['type'])&&_0x4f8b49[_0x2c49('0x7c')][_0x5b04fa][_0x2c49('0x7e')]&&_0x4f8b49[_0x2c49('0x7c')][_0x5b04fa][_0x2c49('0x7f')]&&_0x4f8b49['joins'][_0x5b04fa][_0x2c49('0x80')]){_0x14861d[_0x4f8b49[_0x2c49('0x7c')][_0x5b04fa][_0x2c49('0x2d')]](_0x4f8b49[_0x2c49('0x7c')][_0x5b04fa][_0x2c49('0x7f')],null,util[_0x2c49('0x77')](_0x2c49('0x81'),_0x4f8b49[_0x2c49('0x82')],_0x4f8b49['joins'][_0x5b04fa][_0x2c49('0x7e')],_0x4f8b49[_0x2c49('0x7c')][_0x5b04fa][_0x2c49('0x7f')],_0x4f8b49[_0x2c49('0x7c')][_0x5b04fa][_0x2c49('0x80')]));}}}if(_0x4f8b49[_0x2c49('0x83')]){_0x4f8b49[_0x2c49('0x83')]=JSON[_0x2c49('0x7d')](_0x4f8b49[_0x2c49('0x83')]);_0x14861d['where'](_0x5d2038(_0x4f8b49[_0x2c49('0x83')][_0x2c49('0x67')]));}_0x359ca4=_0x14861d[_0x2c49('0x84')]();_0x14861d['limit'](_0x2e4ee9);_0x14861d['offset'](0x0);logger['debug']('Limited\x20Query:',_0x14861d[_0x2c49('0x85')]());return db['sequelize'][_0x2c49('0x30')](_0x14861d[_0x2c49('0x85')](),{'type':db[_0x2c49('0x86')][_0x2c49('0x87')]['SELECT']});}})['then'](respondWithResult(_0x121fdb,null))['catch'](handleError(_0x121fdb,null));};function runReport(_0x57a206,_0x488884,_0x5684bd){var _0x3f3ab7=_0x488884[_0x2c49('0x29')];var _0xf081fb=0xa;var _0x1ae1f=[_0x2c49('0x88'),_0x2c49('0x52'),_0x2c49('0x53'),'cross_join'];var _0x53c702={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x2c49('0x56'),'MAX':_0x2c49('0x57'),'MIN':_0x2c49('0x58'),'AVG':_0x2c49('0x59'),'GROUP_CONCAT':_0x2c49('0x89'),'GROUP_CONCAT ASC':_0x2c49('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xa2b9a={'SEC_TO_TIME':_0x2c49('0x8a'),'DATE':'DATE(%s)','HOUR':_0x2c49('0x5d'),'ROUND':_0x2c49('0x5e'),'UNIX_TIMESTAMP':_0x2c49('0x5f')};var _0x4179b6=function(_0xc17fc3){return!_[_0x2c49('0x60')]([_0x2c49('0x61'),_0x2c49('0x62'),_0x2c49('0x63'),'IS\x20NOT\x20EMPTY'],_0xc17fc3);};var _0x4e6d41=function(_0x4ece5f){if(!_0x4ece5f||!_0x4ece5f['rules']['length']){return'';}for(var _0xb80098='(',_0x52a1f7=0x0;_0x52a1f7<_0x4ece5f[_0x2c49('0x65')][_0x2c49('0x36')];_0x52a1f7+=0x1){_0x52a1f7>0x0&&(_0xb80098+='\x20'+_0x4ece5f[_0x2c49('0x66')]+'\x20');_0xb80098+=_0x4ece5f[_0x2c49('0x65')][_0x52a1f7][_0x2c49('0x67')]?_0x4e6d41(_0x4ece5f[_0x2c49('0x65')][_0x52a1f7][_0x2c49('0x67')]):_0x4ece5f[_0x2c49('0x65')][_0x52a1f7]['field']+'\x20'+_0x4ece5f[_0x2c49('0x65')][_0x52a1f7]['condition']+(_0x4179b6(_0x4ece5f[_0x2c49('0x65')][_0x52a1f7]['condition'])?'\x20'+_0x4ece5f[_0x2c49('0x65')][_0x52a1f7][_0x2c49('0x6a')]:'');}return _0xb80098+')';};var _0xc94d98={'where':{'id':_0x57a206['id']}},_0x3f926a,_0x501117,_0x1dc337,_0x243fd3,_0x5993d4;_0xc94d98=_['merge']({},_0xc94d98,_0x5684bd);return db['AnalyticDefaultReport']['find'](_0xc94d98)['then'](function(_0x42c024){if(_0x42c024){_0x3f926a=_0x42c024;return _0x42c024['getFields']();}return null;})['then'](function(_0x29be53){if(_0x29be53){if(!_0x29be53[_0x2c49('0x36')]){throw new db[(_0x2c49('0x6c'))][(_0x2c49('0x6d'))](_0x2c49('0x6e'),0x193);}_0x501117=_0x29be53;return db[_0x2c49('0x6f')][_0x2c49('0x43')]({'raw':!![]});}return null;})[_0x2c49('0x25')](function(_0x4b0907){if(_0x4b0907){_0x1dc337=_[_0x2c49('0x70')](_0x4b0907,'id');var _0x384c01;var _0x5c2980=squel[_0x2c49('0x71')]();_0x5c2980[_0x2c49('0x72')](_0x3f926a[_0x2c49('0x82')]);for(var _0x1ccff7=0x0;_0x1ccff7<_0x501117[_0x2c49('0x36')];_0x1ccff7+=0x1){_0x384c01=_0x501117[_0x1ccff7][_0x2c49('0x73')]?_0x1dc337[_0x501117[_0x1ccff7][_0x2c49('0x73')]]['metric']:_0x501117[_0x1ccff7][_0x2c49('0x68')];_0x384c01=_0x501117[_0x1ccff7][_0x2c49('0x75')]?_[_0x2c49('0x76')](_0x53c702[_0x501117[_0x1ccff7][_0x2c49('0x75')]],'%s',_0x384c01):_0x384c01;_0x384c01=_0x501117[_0x1ccff7][_0x2c49('0x77')]?_[_0x2c49('0x76')](_0xa2b9a[_0x501117[_0x1ccff7][_0x2c49('0x77')]],'%s',_0x384c01):_0x384c01;if(_0x501117[_0x1ccff7][_0x2c49('0x78')]){_0x5c2980[_0x2c49('0x67')](_0x384c01);}_0x501117[_0x1ccff7][_0x2c49('0x79')]&&_0x5c2980[_0x2c49('0x39')](_0x384c01,_0x501117[_0x1ccff7][_0x2c49('0x79')]===_0x2c49('0x7a')?![]:!![]);_0x5c2980[_0x2c49('0x68')](_0x384c01,_0x501117[_0x1ccff7]['alias']||_0x384c01);}if(_0x3f926a['joins']){_0x3f926a[_0x2c49('0x7c')]=JSON[_0x2c49('0x7d')](_0x3f926a['joins']);for(var _0x5626ae=0x0;_0x5626ae<_0x3f926a['joins']['length'];_0x5626ae+=0x1){if(_0x3f926a[_0x2c49('0x7c')][_0x5626ae][_0x2c49('0x2d')]&&_['includes'](_0x1ae1f,_0x3f926a[_0x2c49('0x7c')][_0x5626ae]['type'])&&_0x3f926a['joins'][_0x5626ae][_0x2c49('0x7e')]&&_0x3f926a[_0x2c49('0x7c')][_0x5626ae]['foreignTable']&&_0x3f926a[_0x2c49('0x7c')][_0x5626ae][_0x2c49('0x80')]){_0x5c2980[_0x3f926a[_0x2c49('0x7c')][_0x5626ae][_0x2c49('0x2d')]](_0x3f926a[_0x2c49('0x7c')][_0x5626ae][_0x2c49('0x7f')],null,util[_0x2c49('0x77')](_0x2c49('0x81'),_0x3f926a['table'],_0x3f926a[_0x2c49('0x7c')][_0x5626ae]['parentKey'],_0x3f926a['joins'][_0x5626ae][_0x2c49('0x7f')],_0x3f926a[_0x2c49('0x7c')][_0x5626ae][_0x2c49('0x80')]));}}}if(_0x3f926a['conditions']){_0x3f926a[_0x2c49('0x83')]=JSON['parse'](_0x3f926a['conditions']);_0x5c2980[_0x2c49('0x3b')](_0x4e6d41(_0x3f926a['conditions'][_0x2c49('0x67')]));}_0x5993d4=_0x5c2980[_0x2c49('0x84')]();_0x5c2980[_0x2c49('0x1f')](_0xf081fb);_0x5c2980[_0x2c49('0x1e')](0x0);logger[_0x2c49('0x8b')](_0x2c49('0x8c'),_0x5c2980[_0x2c49('0x85')]());return db[_0x2c49('0x86')][_0x2c49('0x30')](_0x5c2980[_0x2c49('0x85')](),{'type':db[_0x2c49('0x86')][_0x2c49('0x87')]['SELECT']});}})[_0x2c49('0x25')](function(_0x17b185){if(!_0x17b185[_0x2c49('0x36')]){throw new db[(_0x2c49('0x6c'))][(_0x2c49('0x6d'))]('No\x20available\x20data',0xcc);}if(_0x488884['output']===_0x2c49('0x8d')){return null;}var _0x479fee=_['merge'](_0x488884,{'name':_0x488884[_0x2c49('0x8e')]||_0x488884[_0x2c49('0x29')]||_0x3f926a[_0x2c49('0x29')],'basename':_0x3f3ab7,'savename':util[_0x2c49('0x77')](_0x2c49('0x8f'),_0x488884[_0x2c49('0x29')]||_0x3f926a[_0x2c49('0x29')],require('randomstring')['generate'](0x4),_0x488884[_0x2c49('0x90')]||_0x2c49('0x91')),'reportId':_0x3f926a['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x2c49('0x4d')](_0x479fee,{'raw':!![]});})[_0x2c49('0x25')](function(_0x5b500c){if(_0x3f926a[_0x2c49('0x82')]===_0x2c49('0x92')){_0x5993d4[_0x2c49('0x3b')](_0x3f926a[_0x2c49('0x82')]+_0x2c49('0x93'),_0x488884[_0x2c49('0x94')],_0x488884[_0x2c49('0x95')]);}else{_0x5993d4[_0x2c49('0x3b')](_0x3f926a[_0x2c49('0x82')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x488884[_0x2c49('0x94')],_0x488884[_0x2c49('0x95')]);}if(_0x5b500c){logger['info']('Run\x20Query:',_0x5993d4[_0x2c49('0x85')]());require(_0x2c49('0x96'))['fork'](path[_0x2c49('0x88')](__dirname,'../../components/export/',_0x5b500c['output']),[_0x5b500c['id'],_0x5993d4[_0x2c49('0x85')](),path[_0x2c49('0x88')](__dirname,'../../files/reports',_0x5b500c[_0x2c49('0x97')]),_0x3f3ab7]);return _0x5b500c;}else{var _0x53f750=squel['select']();_0x53f750[_0x2c49('0x72')]('('+_0x5993d4['toString']()+')',_0x2c49('0x98'));_0x53f750[_0x2c49('0x68')](_0x2c49('0x99'),_0x2c49('0x1d'));_0x5993d4['limit'](_0x488884[_0x2c49('0x1f')]||_0xf081fb);_0x5993d4[_0x2c49('0x1e')](_0x488884[_0x2c49('0x1e')]||0x0);return db[_0x2c49('0x86')]['query'](_0x53f750[_0x2c49('0x85')](),{'type':db[_0x2c49('0x86')][_0x2c49('0x87')][_0x2c49('0x9a')]})[_0x2c49('0x25')](function(_0x522c7e){if(!_0x522c7e[_0x2c49('0x36')]){_0x243fd3=0x0;}else{_0x243fd3=_0x522c7e[0x0][_0x2c49('0x1d')]||0x0;}return db[_0x2c49('0x86')][_0x2c49('0x30')](_0x5993d4['toString'](),{'type':db[_0x2c49('0x86')]['QueryTypes'][_0x2c49('0x9a')]});})[_0x2c49('0x25')](function(_0x10af75){return{'rows':_0x10af75||[],'count':_0x243fd3};});}});}exports['run']=function(_0x141787,_0xf43869){return runReport(_0x141787[_0x2c49('0x45')],_0x141787[_0x2c49('0x30')],_0x141787[_0x2c49('0x40')])['then'](respondWithResult(_0xf43869,null))[_0x2c49('0x47')](handleError(_0xf43869,null));};exports['runReport']=runReport;exports[_0x2c49('0x30')]=function(_0x176f93,_0x4b5c2f){var _0x1fa53e=0xa;var _0x334df6=['join','left_join',_0x2c49('0x53'),_0x2c49('0x9b')];var _0x3f515={'SUM':_0x2c49('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x2c49('0x56'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x2c49('0x59'),'GROUP_CONCAT':_0x2c49('0x89'),'GROUP_CONCAT ASC':_0x2c49('0x5a'),'GROUP_CONCAT DESC':_0x2c49('0x5b')};var _0x49ec78={'SEC_TO_TIME':_0x2c49('0x8a'),'DATE':_0x2c49('0x5c'),'HOUR':_0x2c49('0x5d'),'ROUND':_0x2c49('0x5e'),'UNIX_TIMESTAMP':_0x2c49('0x5f')};var _0xa7c7e6=function(_0x108ff4){return!_[_0x2c49('0x60')]([_0x2c49('0x61'),_0x2c49('0x62'),_0x2c49('0x63'),'IS\x20NOT\x20EMPTY'],_0x108ff4);};var _0xfef60=function(_0xaf9101){if(!_0xaf9101||!_0xaf9101['rules'][_0x2c49('0x36')]){return'';}for(var _0x35474f='(',_0x45b7a7=0x0;_0x45b7a7<_0xaf9101['rules'][_0x2c49('0x36')];_0x45b7a7+=0x1){_0x45b7a7>0x0&&(_0x35474f+='\x20'+_0xaf9101[_0x2c49('0x66')]+'\x20');_0x35474f+=_0xaf9101['rules'][_0x45b7a7]['group']?_0xfef60(_0xaf9101['rules'][_0x45b7a7][_0x2c49('0x67')]):_0xaf9101[_0x2c49('0x65')][_0x45b7a7][_0x2c49('0x68')]+'\x20'+_0xaf9101[_0x2c49('0x65')][_0x45b7a7][_0x2c49('0x69')]+(_0xa7c7e6(_0xaf9101['rules'][_0x45b7a7][_0x2c49('0x69')])?'\x20'+_0xaf9101['rules'][_0x45b7a7][_0x2c49('0x6a')]:'');}return _0x35474f+')';};var _0x2ac2c9={'where':{'id':_0x176f93[_0x2c49('0x45')]['id']}},_0x1da955,_0x1394bb,_0x24afab,_0x33aa2c,_0x40bcea;_0x2ac2c9=_[_0x2c49('0x3e')]({},_0x2ac2c9,_0x176f93[_0x2c49('0x40')]);return db['AnalyticDefaultReport'][_0x2c49('0x46')](_0x2ac2c9)[_0x2c49('0x25')](function(_0x192431){if(_0x192431){_0x1da955=_0x192431;return _0x192431['getFields']();}return null;})[_0x2c49('0x25')](function(_0x5c563b){if(_0x5c563b){if(!_0x5c563b[_0x2c49('0x36')]){throw new db['Sequelize'][(_0x2c49('0x6d'))](_0x2c49('0x6e'),0x193);}_0x1394bb=_0x5c563b;return db[_0x2c49('0x6f')][_0x2c49('0x43')]({'raw':!![]});}return null;})[_0x2c49('0x25')](function(_0xadc94e){if(_0xadc94e){_0x24afab=_[_0x2c49('0x70')](_0xadc94e,'id');var _0xeb1f5a;var _0x13b29f=squel[_0x2c49('0x71')]();_0x13b29f[_0x2c49('0x72')](_0x1da955['table']);for(var _0x2cdb0d=0x0;_0x2cdb0d<_0x1394bb['length'];_0x2cdb0d+=0x1){_0xeb1f5a=_0x1394bb[_0x2cdb0d][_0x2c49('0x73')]?_0x24afab[_0x1394bb[_0x2cdb0d]['MetricId']][_0x2c49('0x74')]:_0x1394bb[_0x2cdb0d][_0x2c49('0x68')];_0xeb1f5a=_0x1394bb[_0x2cdb0d][_0x2c49('0x75')]?_[_0x2c49('0x76')](_0x3f515[_0x1394bb[_0x2cdb0d][_0x2c49('0x75')]],'%s',_0xeb1f5a):_0xeb1f5a;_0xeb1f5a=_0x1394bb[_0x2cdb0d][_0x2c49('0x77')]?_['replace'](_0x49ec78[_0x1394bb[_0x2cdb0d][_0x2c49('0x77')]],'%s',_0xeb1f5a):_0xeb1f5a;if(_0x1394bb[_0x2cdb0d][_0x2c49('0x78')]){_0x13b29f[_0x2c49('0x67')](_0xeb1f5a);}_0x1394bb[_0x2cdb0d]['orderBy']&&_0x13b29f[_0x2c49('0x39')](_0xeb1f5a,_0x1394bb[_0x2cdb0d]['orderBy']===_0x2c49('0x7a')?![]:!![]);_0x13b29f['field'](_0xeb1f5a,_0x1394bb[_0x2cdb0d][_0x2c49('0x7b')]||_0xeb1f5a);}if(_0x1da955[_0x2c49('0x7c')]){_0x1da955['joins']=JSON['parse'](_0x1da955[_0x2c49('0x7c')]);for(var _0x476a38=0x0;_0x476a38<_0x1da955[_0x2c49('0x7c')][_0x2c49('0x36')];_0x476a38+=0x1){if(_0x1da955[_0x2c49('0x7c')][_0x476a38]['type']&&_[_0x2c49('0x60')](_0x334df6,_0x1da955[_0x2c49('0x7c')][_0x476a38][_0x2c49('0x2d')])&&_0x1da955[_0x2c49('0x7c')][_0x476a38][_0x2c49('0x7e')]&&_0x1da955[_0x2c49('0x7c')][_0x476a38]['foreignTable']&&_0x1da955[_0x2c49('0x7c')][_0x476a38][_0x2c49('0x80')]){_0x13b29f[_0x1da955[_0x2c49('0x7c')][_0x476a38][_0x2c49('0x2d')]](_0x1da955[_0x2c49('0x7c')][_0x476a38][_0x2c49('0x7f')],null,util['format'](_0x2c49('0x81'),_0x1da955['table'],_0x1da955[_0x2c49('0x7c')][_0x476a38]['parentKey'],_0x1da955['joins'][_0x476a38][_0x2c49('0x7f')],_0x1da955[_0x2c49('0x7c')][_0x476a38][_0x2c49('0x80')]));}}}if(_0x1da955['conditions']){_0x1da955[_0x2c49('0x83')]=JSON[_0x2c49('0x7d')](_0x1da955[_0x2c49('0x83')]);_0x13b29f['where'](_0xfef60(_0x1da955[_0x2c49('0x83')][_0x2c49('0x67')]));}_0x40bcea=_0x13b29f[_0x2c49('0x84')]();_0x13b29f[_0x2c49('0x1f')](_0x1fa53e);_0x13b29f[_0x2c49('0x1e')](0x0);logger[_0x2c49('0x8b')](_0x2c49('0x8c'),_0x13b29f['toString']());return db[_0x2c49('0x86')]['query'](_0x13b29f[_0x2c49('0x85')](),{'type':db[_0x2c49('0x86')]['QueryTypes']['SELECT']});}})['then'](function(){return{'sql':_0x40bcea[_0x2c49('0x85')]()};})[_0x2c49('0x25')](respondWithResult(_0x4b5c2f,null))[_0x2c49('0x47')](handleError(_0x4b5c2f,null));}; \ No newline at end of file +var _0x9a14=['../../mysqldb','sendStatus','end','status','count','offset','limit','Content-Range','json','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','key','query','keys','filters','attributes','intersection','model','fields','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','rows','catch','params','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','table','MetricId','metric','field','function','replace','format','groupBy','orderBy','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','value','from','DESC','alias','parse','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','savename','run','runReport','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x200042,_0x37102f){var _0x28eeec=function(_0x50e6b4){while(--_0x50e6b4){_0x200042['push'](_0x200042['shift']());}};_0x28eeec(++_0x37102f);}(_0x9a14,0x1d3));var _0x49a1=function(_0x4236ea,_0x2473ae){_0x4236ea=_0x4236ea-0x0;var _0x33f6f2=_0x9a14[_0x4236ea];return _0x33f6f2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x49a1('0x0'));var rimraf=require(_0x49a1('0x1'));var zipdir=require(_0x49a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x49a1('0x3'));var moment=require('moment');var BPromise=require(_0x49a1('0x4'));var Mustache=require(_0x49a1('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x49a1('0x6'));var ejs=require(_0x49a1('0x7'));var fs=require('fs');var _=require(_0x49a1('0x8'));var squel=require(_0x49a1('0x9'));var crypto=require(_0x49a1('0xa'));var jsforce=require(_0x49a1('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x49a1('0xc'));var Papa=require(_0x49a1('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49a1('0xe'));var as=require(_0x49a1('0xf'));var hardwareService=require(_0x49a1('0x10'));var logger=require(_0x49a1('0x11'))(_0x49a1('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x49a1('0x13'))['db'];function respondWithStatusCode(_0xee7370,_0x22fa26){_0x22fa26=_0x22fa26||0xcc;return function(_0x531b62){if(_0x531b62){return _0xee7370[_0x49a1('0x14')](_0x22fa26);}return _0xee7370['status'](_0x22fa26)[_0x49a1('0x15')]();};}function respondWithResult(_0x9375f9,_0x1069c9){_0x1069c9=_0x1069c9||0xc8;return function(_0x2b8081){if(_0x2b8081){return _0x9375f9[_0x49a1('0x16')](_0x1069c9)['json'](_0x2b8081);}};}function respondWithFilteredResult(_0x4334c7,_0xcd4eec){return function(_0xb4b2b0){if(_0xb4b2b0){var _0x311057=_0xb4b2b0[_0x49a1('0x17')],_0x41809d=_0xcd4eec[_0x49a1('0x18')],_0x1c6196=_0xcd4eec[_0x49a1('0x18')]+_0xcd4eec[_0x49a1('0x19')],_0x3eb40f;if(_0x1c6196>=_0x311057){_0x1c6196=_0x311057;_0x3eb40f=0xc8;}else{_0x3eb40f=0xce;}_0x4334c7['status'](_0x3eb40f);return _0x4334c7['set'](_0x49a1('0x1a'),_0x41809d+'-'+_0x1c6196+'/'+_0x311057)[_0x49a1('0x1b')](_0xb4b2b0);}return null;};}function patchUpdates(_0x5df7bf){return function(_0x3df77a){try{jsonpatch[_0x49a1('0x1c')](_0x3df77a,_0x5df7bf,!![]);}catch(_0x1e9237){return BPromise[_0x49a1('0x1d')](_0x1e9237);}return _0x3df77a['save']();};}function saveUpdates(_0x3ba2f7,_0x4fb18d){return function(_0x5474d5){if(_0x5474d5){return _0x5474d5[_0x49a1('0x1e')](_0x3ba2f7)[_0x49a1('0x1f')](function(_0x58b1f1){return _0x58b1f1;});}return null;};}function removeEntity(_0x55096e,_0x2de7b0){return function(_0x199393){if(_0x199393){return _0x199393[_0x49a1('0x20')]()['then'](function(){var _0x23852a=_0x199393[_0x49a1('0x21')]({'plain':!![]});var _0x379d54=_0x49a1('0x22');return db[_0x49a1('0x23')][_0x49a1('0x20')]({'where':{'type':_0x379d54,'resourceId':_0x23852a['id']}})['then'](function(){return _0x199393;});})['then'](function(){_0x55096e[_0x49a1('0x16')](0xcc)[_0x49a1('0x15')]();});}};}function handleEntityNotFound(_0x22f9f0,_0x57b485){return function(_0x53c1a1){if(!_0x53c1a1){_0x22f9f0['sendStatus'](0x194);}return _0x53c1a1;};}function handleError(_0x2cf60a,_0x3d156c){_0x3d156c=_0x3d156c||0x1f4;return function(_0x282f90){logger['error'](_0x282f90[_0x49a1('0x24')]);if(_0x282f90[_0x49a1('0x25')]){delete _0x282f90[_0x49a1('0x25')];}_0x2cf60a[_0x49a1('0x16')](_0x3d156c)[_0x49a1('0x26')](_0x282f90);};}exports['index']=function(_0x2a63e8,_0x18ed58){var _0x2d1601={},_0x2fcb8a={},_0x58f225={'count':0x0,'rows':[]};var _0x5d4fe3=_[_0x49a1('0x27')](db[_0x49a1('0x28')][_0x49a1('0x29')],function(_0x235c47){return{'name':_0x235c47[_0x49a1('0x2a')],'type':_0x235c47['type'][_0x49a1('0x2b')]};});_0x2fcb8a['model']=_[_0x49a1('0x27')](_0x5d4fe3,'name');_0x2fcb8a[_0x49a1('0x2c')]=_[_0x49a1('0x2d')](_0x2a63e8[_0x49a1('0x2c')]);_0x2fcb8a[_0x49a1('0x2e')]=_['intersection'](_0x2fcb8a['model'],_0x2fcb8a[_0x49a1('0x2c')]);_0x2d1601[_0x49a1('0x2f')]=_[_0x49a1('0x30')](_0x2fcb8a[_0x49a1('0x31')],qs[_0x49a1('0x32')](_0x2a63e8[_0x49a1('0x2c')][_0x49a1('0x32')]));_0x2d1601[_0x49a1('0x2f')]=_0x2d1601['attributes']['length']?_0x2d1601[_0x49a1('0x2f')]:_0x2fcb8a[_0x49a1('0x31')];if(!_0x2a63e8['query']['hasOwnProperty'](_0x49a1('0x33'))){_0x2d1601[_0x49a1('0x19')]=qs['limit'](_0x2a63e8[_0x49a1('0x2c')]['limit']);_0x2d1601[_0x49a1('0x18')]=qs['offset'](_0x2a63e8[_0x49a1('0x2c')][_0x49a1('0x18')]);}_0x2d1601[_0x49a1('0x34')]=qs['sort'](_0x2a63e8['query'][_0x49a1('0x35')]);_0x2d1601[_0x49a1('0x36')]=qs[_0x49a1('0x2e')](_[_0x49a1('0x37')](_0x2a63e8['query'],_0x2fcb8a[_0x49a1('0x2e')]));if(_0x2a63e8[_0x49a1('0x2c')]['filter']){_0x2d1601['where']=_[_0x49a1('0x38')](_0x2d1601[_0x49a1('0x36')],{'$or':_[_0x49a1('0x27')](_0x5d4fe3,function(_0x4386a3){if(_0x4386a3[_0x49a1('0x39')]!==_0x49a1('0x3a')){var _0x2c89a9={};_0x2c89a9[_0x4386a3[_0x49a1('0x25')]]={'$like':'%'+_0x2a63e8[_0x49a1('0x2c')][_0x49a1('0x3b')]+'%'};return _0x2c89a9;}})});}_0x2d1601=_['merge']({},_0x2d1601,_0x2a63e8[_0x49a1('0x3c')]);var _0x4bc366={'where':_0x2d1601[_0x49a1('0x36')]};return db[_0x49a1('0x28')]['count'](_0x4bc366)['then'](function(_0x1c16ef){_0x58f225['count']=_0x1c16ef;if(_0x2a63e8[_0x49a1('0x2c')][_0x49a1('0x3d')]){_0x2d1601['include']=[{'all':!![]}];}return db[_0x49a1('0x28')]['findAll'](_0x2d1601);})[_0x49a1('0x1f')](function(_0x531ee0){_0x58f225[_0x49a1('0x3e')]=_0x531ee0;return _0x58f225;})[_0x49a1('0x1f')](respondWithFilteredResult(_0x18ed58,_0x2d1601))[_0x49a1('0x3f')](handleError(_0x18ed58,null));};exports['show']=function(_0x28eaaa,_0x4b8eb1){var _0x4a1be9={'raw':!![],'where':{'id':_0x28eaaa[_0x49a1('0x40')]['id']}},_0x5bbd73={};_0x5bbd73[_0x49a1('0x31')]=_[_0x49a1('0x2d')](db[_0x49a1('0x28')][_0x49a1('0x29')]);_0x5bbd73['query']=_['keys'](_0x28eaaa[_0x49a1('0x2c')]);_0x5bbd73[_0x49a1('0x2e')]=_['intersection'](_0x5bbd73[_0x49a1('0x31')],_0x5bbd73['query']);_0x4a1be9[_0x49a1('0x2f')]=_[_0x49a1('0x30')](_0x5bbd73[_0x49a1('0x31')],qs[_0x49a1('0x32')](_0x28eaaa[_0x49a1('0x2c')]['fields']));_0x4a1be9[_0x49a1('0x2f')]=_0x4a1be9['attributes'][_0x49a1('0x41')]?_0x4a1be9['attributes']:_0x5bbd73[_0x49a1('0x31')];if(_0x28eaaa['query'][_0x49a1('0x3d')]){_0x4a1be9[_0x49a1('0x42')]=[{'all':!![]}];}_0x4a1be9=_['merge']({},_0x4a1be9,_0x28eaaa['options']);return db['AnalyticDefaultReport']['find'](_0x4a1be9)[_0x49a1('0x1f')](handleEntityNotFound(_0x4b8eb1,null))[_0x49a1('0x1f')](respondWithResult(_0x4b8eb1,null))[_0x49a1('0x3f')](handleError(_0x4b8eb1,null));};exports['create']=function(_0x2496f4,_0x497034){return db[_0x49a1('0x28')][_0x49a1('0x43')](_0x2496f4[_0x49a1('0x44')],{})[_0x49a1('0x1f')](function(_0x5c836d){var _0x2282ca=_0x2496f4[_0x49a1('0x45')][_0x49a1('0x21')]({'plain':!![]});if(!_0x2282ca)throw new Error(_0x49a1('0x46'));if(_0x2282ca[_0x49a1('0x47')]===_0x49a1('0x45')){var _0x296f80=_0x5c836d[_0x49a1('0x21')]({'plain':!![]});var _0x26ee53=_0x49a1('0x48');return db[_0x49a1('0x49')][_0x49a1('0x4a')]({'where':{'name':_0x26ee53,'userProfileId':_0x2282ca[_0x49a1('0x4b')]},'raw':!![]})[_0x49a1('0x1f')](function(_0x8c1fc0){if(_0x8c1fc0&&_0x8c1fc0[_0x49a1('0x4c')]===0x0){return db['UserProfileResource'][_0x49a1('0x43')]({'name':_0x296f80[_0x49a1('0x25')],'resourceId':_0x296f80['id'],'type':_0x49a1('0x22'),'sectionId':_0x8c1fc0['id']},{})[_0x49a1('0x1f')](function(){return _0x5c836d;});}else{return _0x5c836d;}})[_0x49a1('0x3f')](function(_0x27b154){logger['error'](_0x49a1('0x4d'),_0x27b154);throw _0x27b154;});}return _0x5c836d;})[_0x49a1('0x1f')](respondWithResult(_0x497034,0xc9))[_0x49a1('0x3f')](handleError(_0x497034,null));};exports[_0x49a1('0x1e')]=function(_0x571b8f,_0x569e5a){if(_0x571b8f[_0x49a1('0x44')]['id']){delete _0x571b8f[_0x49a1('0x44')]['id'];}return db['AnalyticDefaultReport'][_0x49a1('0x4a')]({'where':{'id':_0x571b8f[_0x49a1('0x40')]['id']}})['then'](handleEntityNotFound(_0x569e5a,null))['then'](saveUpdates(_0x571b8f[_0x49a1('0x44')],null))[_0x49a1('0x1f')](respondWithResult(_0x569e5a,null))[_0x49a1('0x3f')](handleError(_0x569e5a,null));};exports[_0x49a1('0x20')]=function(_0x53e7da,_0x2085c6){return db['AnalyticDefaultReport'][_0x49a1('0x4a')]({'where':{'id':_0x53e7da[_0x49a1('0x40')]['id']}})[_0x49a1('0x1f')](handleEntityNotFound(_0x2085c6,null))[_0x49a1('0x1f')](removeEntity(_0x2085c6,null))[_0x49a1('0x3f')](handleError(_0x2085c6,null));};exports[_0x49a1('0x4e')]=function(_0x34e14f,_0xceea60){var _0x4ec983=0xa;var _0x1ed40b=[_0x49a1('0x4f'),_0x49a1('0x50'),_0x49a1('0x51'),'cross_join'];var _0x5337dd={'SUM':_0x49a1('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x49a1('0x53'),'MAX':_0x49a1('0x54'),'MIN':_0x49a1('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x49a1('0x56'),'GROUP_CONCAT ASC':_0x49a1('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5bcb1d={'SEC_TO_TIME':_0x49a1('0x58'),'DATE':'DATE(%s)','HOUR':_0x49a1('0x59'),'ROUND':_0x49a1('0x5a'),'UNIX_TIMESTAMP':_0x49a1('0x5b')};var _0x1822bd=function(_0x21dc30){return!_[_0x49a1('0x5c')]([_0x49a1('0x5d'),_0x49a1('0x5e'),'IS\x20EMPTY',_0x49a1('0x5f')],_0x21dc30);};var _0x103c66=function(_0x188bb6){if(!_0x188bb6||!_0x188bb6['rules'][_0x49a1('0x41')]){return'';}for(var _0x52756c='(',_0x5b9b66=0x0;_0x5b9b66<_0x188bb6[_0x49a1('0x60')][_0x49a1('0x41')];_0x5b9b66+=0x1){_0x5b9b66>0x0&&(_0x52756c+='\x20'+_0x188bb6[_0x49a1('0x61')]+'\x20');_0x52756c+=_0x188bb6[_0x49a1('0x60')][_0x5b9b66][_0x49a1('0x62')]?_0x103c66(_0x188bb6[_0x49a1('0x60')][_0x5b9b66][_0x49a1('0x62')]):_0x188bb6[_0x49a1('0x60')][_0x5b9b66]['field']+'\x20'+_0x188bb6[_0x49a1('0x60')][_0x5b9b66]['condition']+(_0x1822bd(_0x188bb6['rules'][_0x5b9b66][_0x49a1('0x63')])?'\x20'+_0x188bb6['rules'][_0x5b9b66]['value']:'');}return _0x52756c+')';};var _0x1a1106={'where':{'id':_0x34e14f[_0x49a1('0x40')]['id']}},_0x1991f3,_0x1c3b03,_0x5824d4,_0x5179ee,_0x1b539c;_0x1a1106=_[_0x49a1('0x38')]({},_0x1a1106,_0x34e14f[_0x49a1('0x3c')]);return db['AnalyticDefaultReport']['find'](_0x1a1106)['then'](function(_0xa245d8){if(_0xa245d8){_0x1991f3=_0xa245d8;return _0xa245d8[_0x49a1('0x64')]();}return null;})[_0x49a1('0x1f')](function(_0x2284f7){if(_0x2284f7){if(!_0x2284f7[_0x49a1('0x41')]){throw new db[(_0x49a1('0x65'))][(_0x49a1('0x66'))](_0x49a1('0x67'),0x193);}_0x1c3b03=_0x2284f7;return db[_0x49a1('0x68')][_0x49a1('0x69')]({'raw':!![]});}return null;})['then'](function(_0x4e7252){if(_0x4e7252){_0x5824d4=_[_0x49a1('0x6a')](_0x4e7252,'id');var _0x4de7cc;var _0x343d6b=squel[_0x49a1('0x6b')]();_0x343d6b['from'](_0x1991f3[_0x49a1('0x6c')]);for(var _0x51a131=0x0;_0x51a131<_0x1c3b03[_0x49a1('0x41')];_0x51a131+=0x1){_0x4de7cc=_0x1c3b03[_0x51a131][_0x49a1('0x6d')]?_0x5824d4[_0x1c3b03[_0x51a131][_0x49a1('0x6d')]][_0x49a1('0x6e')]:_0x1c3b03[_0x51a131][_0x49a1('0x6f')];_0x4de7cc=_0x1c3b03[_0x51a131][_0x49a1('0x70')]?_[_0x49a1('0x71')](_0x5337dd[_0x1c3b03[_0x51a131]['function']],'%s',_0x4de7cc):_0x4de7cc;_0x4de7cc=_0x1c3b03[_0x51a131][_0x49a1('0x72')]?_[_0x49a1('0x71')](_0x5bcb1d[_0x1c3b03[_0x51a131][_0x49a1('0x72')]],'%s',_0x4de7cc):_0x4de7cc;if(_0x1c3b03[_0x51a131][_0x49a1('0x73')]){_0x343d6b['group'](_0x4de7cc);}_0x1c3b03[_0x51a131][_0x49a1('0x74')]&&_0x343d6b[_0x49a1('0x34')](_0x4de7cc,_0x1c3b03[_0x51a131][_0x49a1('0x74')]==='DESC'?![]:!![]);_0x343d6b[_0x49a1('0x6f')](_0x4de7cc,_0x1c3b03[_0x51a131]['alias']||_0x4de7cc);}if(_0x1991f3[_0x49a1('0x75')]){_0x1991f3[_0x49a1('0x75')]=JSON['parse'](_0x1991f3[_0x49a1('0x75')]);for(var _0x25d54a=0x0;_0x25d54a<_0x1991f3[_0x49a1('0x75')]['length'];_0x25d54a+=0x1){if(_0x1991f3[_0x49a1('0x75')][_0x25d54a][_0x49a1('0x39')]&&_[_0x49a1('0x5c')](_0x1ed40b,_0x1991f3[_0x49a1('0x75')][_0x25d54a][_0x49a1('0x39')])&&_0x1991f3[_0x49a1('0x75')][_0x25d54a][_0x49a1('0x76')]&&_0x1991f3[_0x49a1('0x75')][_0x25d54a]['foreignTable']&&_0x1991f3[_0x49a1('0x75')][_0x25d54a][_0x49a1('0x77')]){_0x343d6b[_0x1991f3[_0x49a1('0x75')][_0x25d54a][_0x49a1('0x39')]](_0x1991f3[_0x49a1('0x75')][_0x25d54a][_0x49a1('0x78')],null,util['format'](_0x49a1('0x79'),_0x1991f3[_0x49a1('0x6c')],_0x1991f3[_0x49a1('0x75')][_0x25d54a]['parentKey'],_0x1991f3['joins'][_0x25d54a][_0x49a1('0x78')],_0x1991f3[_0x49a1('0x75')][_0x25d54a][_0x49a1('0x77')]));}}}if(_0x1991f3[_0x49a1('0x7a')]){_0x1991f3[_0x49a1('0x7a')]=JSON['parse'](_0x1991f3['conditions']);_0x343d6b[_0x49a1('0x36')](_0x103c66(_0x1991f3['conditions'][_0x49a1('0x62')]));}_0x1b539c=_0x343d6b[_0x49a1('0x7b')]();_0x343d6b[_0x49a1('0x19')](_0x4ec983);_0x343d6b['offset'](0x0);logger[_0x49a1('0x7c')](_0x49a1('0x7d'),_0x343d6b[_0x49a1('0x7e')]());return db[_0x49a1('0x7f')][_0x49a1('0x2c')](_0x343d6b[_0x49a1('0x7e')](),{'type':db[_0x49a1('0x7f')][_0x49a1('0x80')][_0x49a1('0x81')]});}})[_0x49a1('0x1f')](respondWithResult(_0xceea60,null))[_0x49a1('0x3f')](handleError(_0xceea60,null));};function runReport(_0x483d77,_0x563e02,_0x377217){var _0x3ab9ae=_0x563e02[_0x49a1('0x25')];var _0x353327=0xa;var _0x1082e4=[_0x49a1('0x4f'),'left_join',_0x49a1('0x51'),_0x49a1('0x82')];var _0x5268b0={'SUM':'SUM(%s)','COUNT':_0x49a1('0x83'),'COUNT DISTINCT':_0x49a1('0x53'),'MAX':_0x49a1('0x54'),'MIN':_0x49a1('0x55'),'AVG':_0x49a1('0x84'),'GROUP_CONCAT':_0x49a1('0x56'),'GROUP_CONCAT ASC':_0x49a1('0x57'),'GROUP_CONCAT DESC':_0x49a1('0x85')};var _0x1b49a2={'SEC_TO_TIME':_0x49a1('0x58'),'DATE':'DATE(%s)','HOUR':_0x49a1('0x59'),'ROUND':_0x49a1('0x5a'),'UNIX_TIMESTAMP':_0x49a1('0x5b')};var _0x34f736=function(_0x45e744){return!_[_0x49a1('0x5c')](['IS\x20NULL',_0x49a1('0x5e'),_0x49a1('0x86'),_0x49a1('0x5f')],_0x45e744);};var _0x3efe31=function(_0x24d2d1){if(!_0x24d2d1||!_0x24d2d1['rules'][_0x49a1('0x41')]){return'';}for(var _0x2db33b='(',_0x45351b=0x0;_0x45351b<_0x24d2d1['rules'][_0x49a1('0x41')];_0x45351b+=0x1){_0x45351b>0x0&&(_0x2db33b+='\x20'+_0x24d2d1[_0x49a1('0x61')]+'\x20');_0x2db33b+=_0x24d2d1[_0x49a1('0x60')][_0x45351b]['group']?_0x3efe31(_0x24d2d1[_0x49a1('0x60')][_0x45351b][_0x49a1('0x62')]):_0x24d2d1[_0x49a1('0x60')][_0x45351b][_0x49a1('0x6f')]+'\x20'+_0x24d2d1[_0x49a1('0x60')][_0x45351b]['condition']+(_0x34f736(_0x24d2d1[_0x49a1('0x60')][_0x45351b]['condition'])?'\x20'+_0x24d2d1[_0x49a1('0x60')][_0x45351b][_0x49a1('0x87')]:'');}return _0x2db33b+')';};var _0xa56a3e={'where':{'id':_0x483d77['id']}},_0x1632ca,_0x426805,_0x5f2a61,_0xf16108,_0x44be1b;_0xa56a3e=_[_0x49a1('0x38')]({},_0xa56a3e,_0x377217);return db['AnalyticDefaultReport'][_0x49a1('0x4a')](_0xa56a3e)[_0x49a1('0x1f')](function(_0x933cb8){if(_0x933cb8){_0x1632ca=_0x933cb8;return _0x933cb8[_0x49a1('0x64')]();}return null;})[_0x49a1('0x1f')](function(_0x4f1b37){if(_0x4f1b37){if(!_0x4f1b37[_0x49a1('0x41')]){throw new db[(_0x49a1('0x65'))][(_0x49a1('0x66'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x426805=_0x4f1b37;return db[_0x49a1('0x68')][_0x49a1('0x69')]({'raw':!![]});}return null;})[_0x49a1('0x1f')](function(_0x59d4f1){if(_0x59d4f1){_0x5f2a61=_['keyBy'](_0x59d4f1,'id');var _0x36c9f9;var _0x4b8ce1=squel['select']();_0x4b8ce1[_0x49a1('0x88')](_0x1632ca[_0x49a1('0x6c')]);for(var _0x228689=0x0;_0x228689<_0x426805[_0x49a1('0x41')];_0x228689+=0x1){_0x36c9f9=_0x426805[_0x228689][_0x49a1('0x6d')]?_0x5f2a61[_0x426805[_0x228689][_0x49a1('0x6d')]]['metric']:_0x426805[_0x228689][_0x49a1('0x6f')];_0x36c9f9=_0x426805[_0x228689][_0x49a1('0x70')]?_[_0x49a1('0x71')](_0x5268b0[_0x426805[_0x228689][_0x49a1('0x70')]],'%s',_0x36c9f9):_0x36c9f9;_0x36c9f9=_0x426805[_0x228689]['format']?_[_0x49a1('0x71')](_0x1b49a2[_0x426805[_0x228689][_0x49a1('0x72')]],'%s',_0x36c9f9):_0x36c9f9;if(_0x426805[_0x228689][_0x49a1('0x73')]){_0x4b8ce1[_0x49a1('0x62')](_0x36c9f9);}_0x426805[_0x228689][_0x49a1('0x74')]&&_0x4b8ce1[_0x49a1('0x34')](_0x36c9f9,_0x426805[_0x228689][_0x49a1('0x74')]===_0x49a1('0x89')?![]:!![]);_0x4b8ce1[_0x49a1('0x6f')](_0x36c9f9,_0x426805[_0x228689][_0x49a1('0x8a')]||_0x36c9f9);}if(_0x1632ca[_0x49a1('0x75')]){_0x1632ca['joins']=JSON[_0x49a1('0x8b')](_0x1632ca[_0x49a1('0x75')]);for(var _0x4b6abd=0x0;_0x4b6abd<_0x1632ca['joins'][_0x49a1('0x41')];_0x4b6abd+=0x1){if(_0x1632ca['joins'][_0x4b6abd][_0x49a1('0x39')]&&_[_0x49a1('0x5c')](_0x1082e4,_0x1632ca[_0x49a1('0x75')][_0x4b6abd][_0x49a1('0x39')])&&_0x1632ca[_0x49a1('0x75')][_0x4b6abd]['parentKey']&&_0x1632ca[_0x49a1('0x75')][_0x4b6abd][_0x49a1('0x78')]&&_0x1632ca['joins'][_0x4b6abd][_0x49a1('0x77')]){_0x4b8ce1[_0x1632ca[_0x49a1('0x75')][_0x4b6abd][_0x49a1('0x39')]](_0x1632ca['joins'][_0x4b6abd][_0x49a1('0x78')],null,util['format'](_0x49a1('0x79'),_0x1632ca[_0x49a1('0x6c')],_0x1632ca[_0x49a1('0x75')][_0x4b6abd][_0x49a1('0x76')],_0x1632ca[_0x49a1('0x75')][_0x4b6abd][_0x49a1('0x78')],_0x1632ca[_0x49a1('0x75')][_0x4b6abd][_0x49a1('0x77')]));}}}if(_0x1632ca[_0x49a1('0x7a')]){_0x1632ca[_0x49a1('0x7a')]=JSON['parse'](_0x1632ca[_0x49a1('0x7a')]);_0x4b8ce1[_0x49a1('0x36')](_0x3efe31(_0x1632ca['conditions'][_0x49a1('0x62')]));}_0x44be1b=_0x4b8ce1[_0x49a1('0x7b')]();_0x4b8ce1[_0x49a1('0x19')](_0x353327);_0x4b8ce1[_0x49a1('0x18')](0x0);logger[_0x49a1('0x7c')](_0x49a1('0x7d'),_0x4b8ce1[_0x49a1('0x7e')]());return db['sequelize'][_0x49a1('0x2c')](_0x4b8ce1[_0x49a1('0x7e')](),{'type':db[_0x49a1('0x7f')][_0x49a1('0x80')][_0x49a1('0x81')]});}})['then'](function(_0x304835){if(!_0x304835[_0x49a1('0x41')]){throw new db[(_0x49a1('0x65'))][(_0x49a1('0x66'))](_0x49a1('0x8c'),0xcc);}if(_0x563e02[_0x49a1('0x8d')]===_0x49a1('0x8e')){return null;}var _0x19f57f=_[_0x49a1('0x38')](_0x563e02,{'name':_0x563e02[_0x49a1('0x8f')]||_0x563e02[_0x49a1('0x25')]||_0x1632ca['name'],'basename':_0x3ab9ae,'savename':util[_0x49a1('0x72')](_0x49a1('0x90'),_0x563e02[_0x49a1('0x25')]||_0x1632ca[_0x49a1('0x25')],require(_0x49a1('0x91'))[_0x49a1('0x92')](0x4),_0x563e02[_0x49a1('0x8d')]||'csv'),'reportId':_0x1632ca['id'],'reportType':_0x49a1('0x93')});return db[_0x49a1('0x94')][_0x49a1('0x43')](_0x19f57f,{'raw':!![]});})[_0x49a1('0x1f')](function(_0x542570){if(_0x1632ca[_0x49a1('0x6c')]===_0x49a1('0x95')){_0x44be1b[_0x49a1('0x36')](_0x1632ca[_0x49a1('0x6c')]+_0x49a1('0x96'),_0x563e02[_0x49a1('0x97')],_0x563e02[_0x49a1('0x98')]);}else{_0x44be1b['where'](_0x1632ca[_0x49a1('0x6c')]+_0x49a1('0x99'),_0x563e02[_0x49a1('0x97')],_0x563e02[_0x49a1('0x98')]);}if(_0x542570){logger[_0x49a1('0x9a')](_0x49a1('0x9b'),_0x44be1b[_0x49a1('0x7e')]());require(_0x49a1('0x9c'))[_0x49a1('0x9d')](path[_0x49a1('0x4f')](__dirname,_0x49a1('0x9e'),_0x542570[_0x49a1('0x8d')]),[_0x542570['id'],_0x44be1b[_0x49a1('0x7e')](),path[_0x49a1('0x4f')](__dirname,'../../files/reports',_0x542570[_0x49a1('0x9f')]),_0x3ab9ae]);return _0x542570;}else{var _0x140be5=squel['select']();_0x140be5[_0x49a1('0x88')]('('+_0x44be1b[_0x49a1('0x7e')]()+')','countTable');_0x140be5[_0x49a1('0x6f')]('COUNT(*)',_0x49a1('0x17'));_0x44be1b['limit'](_0x563e02['limit']||_0x353327);_0x44be1b[_0x49a1('0x18')](_0x563e02[_0x49a1('0x18')]||0x0);return db[_0x49a1('0x7f')][_0x49a1('0x2c')](_0x140be5[_0x49a1('0x7e')](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0x49a1('0x1f')](function(_0x29fa58){if(!_0x29fa58[_0x49a1('0x41')]){_0xf16108=0x0;}else{_0xf16108=_0x29fa58[0x0][_0x49a1('0x17')]||0x0;}return db[_0x49a1('0x7f')][_0x49a1('0x2c')](_0x44be1b['toString'](),{'type':db['sequelize'][_0x49a1('0x80')][_0x49a1('0x81')]});})[_0x49a1('0x1f')](function(_0x47bac8){return{'rows':_0x47bac8||[],'count':_0xf16108};});}});}exports[_0x49a1('0xa0')]=function(_0x4aa92b,_0x26b80e){return runReport(_0x4aa92b[_0x49a1('0x40')],_0x4aa92b['query'],_0x4aa92b['options'])[_0x49a1('0x1f')](respondWithResult(_0x26b80e,null))[_0x49a1('0x3f')](handleError(_0x26b80e,null));};exports[_0x49a1('0xa1')]=runReport;exports[_0x49a1('0x2c')]=function(_0x5a3fa0,_0x18fe33){var _0x551a39=0xa;var _0x4619c1=[_0x49a1('0x4f'),_0x49a1('0x50'),_0x49a1('0x51'),'cross_join'];var _0x196071={'SUM':_0x49a1('0x52'),'COUNT':_0x49a1('0x83'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x49a1('0x54'),'MIN':_0x49a1('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x49a1('0x57'),'GROUP_CONCAT DESC':_0x49a1('0x85')};var _0x319ed3={'SEC_TO_TIME':_0x49a1('0x58'),'DATE':'DATE(%s)','HOUR':_0x49a1('0x59'),'ROUND':_0x49a1('0x5a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1bff4e=function(_0x76fbb8){return!_[_0x49a1('0x5c')]([_0x49a1('0x5d'),_0x49a1('0x5e'),_0x49a1('0x86'),'IS\x20NOT\x20EMPTY'],_0x76fbb8);};var _0x105c52=function(_0x37548e){if(!_0x37548e||!_0x37548e[_0x49a1('0x60')][_0x49a1('0x41')]){return'';}for(var _0x258bc9='(',_0xdb634a=0x0;_0xdb634a<_0x37548e[_0x49a1('0x60')][_0x49a1('0x41')];_0xdb634a+=0x1){_0xdb634a>0x0&&(_0x258bc9+='\x20'+_0x37548e[_0x49a1('0x61')]+'\x20');_0x258bc9+=_0x37548e[_0x49a1('0x60')][_0xdb634a][_0x49a1('0x62')]?_0x105c52(_0x37548e['rules'][_0xdb634a][_0x49a1('0x62')]):_0x37548e['rules'][_0xdb634a][_0x49a1('0x6f')]+'\x20'+_0x37548e[_0x49a1('0x60')][_0xdb634a]['condition']+(_0x1bff4e(_0x37548e[_0x49a1('0x60')][_0xdb634a]['condition'])?'\x20'+_0x37548e[_0x49a1('0x60')][_0xdb634a][_0x49a1('0x87')]:'');}return _0x258bc9+')';};var _0x29658f={'where':{'id':_0x5a3fa0['params']['id']}},_0x5cd27b,_0x1061df,_0x336120,_0x3aa2ea,_0x3c00ad;_0x29658f=_[_0x49a1('0x38')]({},_0x29658f,_0x5a3fa0[_0x49a1('0x3c')]);return db['AnalyticDefaultReport'][_0x49a1('0x4a')](_0x29658f)[_0x49a1('0x1f')](function(_0x7de5df){if(_0x7de5df){_0x5cd27b=_0x7de5df;return _0x7de5df[_0x49a1('0x64')]();}return null;})[_0x49a1('0x1f')](function(_0x186c4c){if(_0x186c4c){if(!_0x186c4c[_0x49a1('0x41')]){throw new db['Sequelize'][(_0x49a1('0x66'))](_0x49a1('0x67'),0x193);}_0x1061df=_0x186c4c;return db[_0x49a1('0x68')]['findAll']({'raw':!![]});}return null;})[_0x49a1('0x1f')](function(_0x20651a){if(_0x20651a){_0x336120=_['keyBy'](_0x20651a,'id');var _0xbe711d;var _0x5b5399=squel[_0x49a1('0x6b')]();_0x5b5399[_0x49a1('0x88')](_0x5cd27b['table']);for(var _0x4dcec5=0x0;_0x4dcec5<_0x1061df[_0x49a1('0x41')];_0x4dcec5+=0x1){_0xbe711d=_0x1061df[_0x4dcec5]['MetricId']?_0x336120[_0x1061df[_0x4dcec5][_0x49a1('0x6d')]][_0x49a1('0x6e')]:_0x1061df[_0x4dcec5][_0x49a1('0x6f')];_0xbe711d=_0x1061df[_0x4dcec5][_0x49a1('0x70')]?_[_0x49a1('0x71')](_0x196071[_0x1061df[_0x4dcec5]['function']],'%s',_0xbe711d):_0xbe711d;_0xbe711d=_0x1061df[_0x4dcec5][_0x49a1('0x72')]?_[_0x49a1('0x71')](_0x319ed3[_0x1061df[_0x4dcec5][_0x49a1('0x72')]],'%s',_0xbe711d):_0xbe711d;if(_0x1061df[_0x4dcec5][_0x49a1('0x73')]){_0x5b5399['group'](_0xbe711d);}_0x1061df[_0x4dcec5][_0x49a1('0x74')]&&_0x5b5399[_0x49a1('0x34')](_0xbe711d,_0x1061df[_0x4dcec5][_0x49a1('0x74')]===_0x49a1('0x89')?![]:!![]);_0x5b5399[_0x49a1('0x6f')](_0xbe711d,_0x1061df[_0x4dcec5][_0x49a1('0x8a')]||_0xbe711d);}if(_0x5cd27b[_0x49a1('0x75')]){_0x5cd27b['joins']=JSON[_0x49a1('0x8b')](_0x5cd27b[_0x49a1('0x75')]);for(var _0x4e0967=0x0;_0x4e0967<_0x5cd27b['joins'][_0x49a1('0x41')];_0x4e0967+=0x1){if(_0x5cd27b['joins'][_0x4e0967][_0x49a1('0x39')]&&_[_0x49a1('0x5c')](_0x4619c1,_0x5cd27b[_0x49a1('0x75')][_0x4e0967][_0x49a1('0x39')])&&_0x5cd27b[_0x49a1('0x75')][_0x4e0967][_0x49a1('0x76')]&&_0x5cd27b['joins'][_0x4e0967]['foreignTable']&&_0x5cd27b[_0x49a1('0x75')][_0x4e0967]['foreignKey']){_0x5b5399[_0x5cd27b[_0x49a1('0x75')][_0x4e0967][_0x49a1('0x39')]](_0x5cd27b[_0x49a1('0x75')][_0x4e0967]['foreignTable'],null,util[_0x49a1('0x72')](_0x49a1('0x79'),_0x5cd27b[_0x49a1('0x6c')],_0x5cd27b[_0x49a1('0x75')][_0x4e0967][_0x49a1('0x76')],_0x5cd27b[_0x49a1('0x75')][_0x4e0967][_0x49a1('0x78')],_0x5cd27b[_0x49a1('0x75')][_0x4e0967][_0x49a1('0x77')]));}}}if(_0x5cd27b[_0x49a1('0x7a')]){_0x5cd27b[_0x49a1('0x7a')]=JSON[_0x49a1('0x8b')](_0x5cd27b['conditions']);_0x5b5399['where'](_0x105c52(_0x5cd27b[_0x49a1('0x7a')][_0x49a1('0x62')]));}_0x3c00ad=_0x5b5399[_0x49a1('0x7b')]();_0x5b5399[_0x49a1('0x19')](_0x551a39);_0x5b5399[_0x49a1('0x18')](0x0);logger[_0x49a1('0x7c')](_0x49a1('0x7d'),_0x5b5399[_0x49a1('0x7e')]());return db[_0x49a1('0x7f')][_0x49a1('0x2c')](_0x5b5399[_0x49a1('0x7e')](),{'type':db[_0x49a1('0x7f')][_0x49a1('0x80')][_0x49a1('0x81')]});}})[_0x49a1('0x1f')](function(){return{'sql':_0x3c00ad['toString']()};})[_0x49a1('0x1f')](respondWithResult(_0x18fe33,null))[_0x49a1('0x3f')](handleError(_0x18fe33,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 96d06e4..0c6e59c 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 _0xd1f5=['api','bluebird','request-promise','path','../../config/environment','define','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger'];(function(_0x15bf3d,_0x490ecd){var _0x26dc5d=function(_0x99f707){while(--_0x99f707){_0x15bf3d['push'](_0x15bf3d['shift']());}};_0x26dc5d(++_0x490ecd);}(_0xd1f5,0x1de));var _0x5d1f=function(_0x5a615d,_0x13360e){_0x5a615d=_0x5a615d-0x0;var _0x1a5d1d=_0xd1f5[_0x5a615d];return _0x1a5d1d;};'use strict';var _=require(_0x5d1f('0x0'));var util=require('util');var logger=require(_0x5d1f('0x1'))(_0x5d1f('0x2'));var moment=require('moment');var BPromise=require(_0x5d1f('0x3'));var rp=require(_0x5d1f('0x4'));var fs=require('fs');var path=require(_0x5d1f('0x5'));var rimraf=require('rimraf');var config=require(_0x5d1f('0x6'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x577c21,_0x3b6ac8){return _0x577c21[_0x5d1f('0x7')](_0x5d1f('0x8'),attributes,{'tableName':_0x5d1f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7345=['rimraf','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','moment','path'];(function(_0x576ed8,_0xbe3434){var _0x460104=function(_0x4d4896){while(--_0x4d4896){_0x576ed8['push'](_0x576ed8['shift']());}};_0x460104(++_0xbe3434);}(_0x7345,0x163));var _0x5734=function(_0x28a3cc,_0x2ca1a1){_0x28a3cc=_0x28a3cc-0x0;var _0x479c87=_0x7345[_0x28a3cc];return _0x479c87;};'use strict';var _=require(_0x5734('0x0'));var util=require(_0x5734('0x1'));var logger=require(_0x5734('0x2'))('api');var moment=require(_0x5734('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5734('0x4'));var rimraf=require(_0x5734('0x5'));var config=require('../../config/environment');var attributes=require(_0x5734('0x6'));module['exports']=function(_0x4253a4,_0x152395){return _0x4253a4[_0x5734('0x7')](_0x5734('0x8'),attributes,{'tableName':_0x5734('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index bf89a0d..592f497 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 _0x67da=['error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x117f4c,_0x36a9b1){var _0x2b24e9=function(_0x31761b){while(--_0x31761b){_0x117f4c['push'](_0x117f4c['shift']());}};_0x2b24e9(++_0x36a9b1);}(_0x67da,0x192));var _0xa67d=function(_0x1c58b8,_0x589ac5){_0x1c58b8=_0x1c58b8-0x0;var _0x398eeb=_0x67da[_0x1c58b8];return _0x398eeb;};'use strict';var _=require('lodash');var util=require(_0xa67d('0x0'));var moment=require(_0xa67d('0x1'));var BPromise=require(_0xa67d('0x2'));var rs=require(_0xa67d('0x3'));var fs=require('fs');var Redis=require(_0xa67d('0x4'));var db=require(_0xa67d('0x5'))['db'];var utils=require(_0xa67d('0x6'));var logger=require(_0xa67d('0x7'))(_0xa67d('0x8'));var config=require(_0xa67d('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa67d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d2734,_0x31d56a,_0x2346f4){return new BPromise(function(_0x10f89a,_0x2c37c2){return client[_0xa67d('0xb')](_0x4d2734,_0x2346f4)[_0xa67d('0xc')](function(_0x330a9f){logger[_0xa67d('0xd')](_0xa67d('0xe'),_0x31d56a,_0xa67d('0xf'));logger['debug'](_0xa67d('0x10'),_0x31d56a,_0xa67d('0xf'),JSON[_0xa67d('0x11')](_0x330a9f));if(_0x330a9f[_0xa67d('0x12')]){if(_0x330a9f['error'][_0xa67d('0x13')]===0x1f4){logger[_0xa67d('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x31d56a,_0x330a9f['error'][_0xa67d('0x14')]);return _0x2c37c2(_0x330a9f['error'][_0xa67d('0x14')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x31d56a,_0x330a9f[_0xa67d('0x12')][_0xa67d('0x14')]);return _0x10f89a(_0x330a9f['error'][_0xa67d('0x14')]);}else{logger[_0xa67d('0xd')](_0xa67d('0xe'),_0x31d56a,_0xa67d('0xf'));_0x10f89a(_0x330a9f['result']['message']);}})['catch'](function(_0x4fa50f){logger[_0xa67d('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x31d56a,_0x4fa50f);_0x2c37c2(_0x4fa50f);});});} \ No newline at end of file +var _0xc2da=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment'];(function(_0x3286ed,_0x55b62c){var _0x579040=function(_0x2173cf){while(--_0x2173cf){_0x3286ed['push'](_0x3286ed['shift']());}};_0x579040(++_0x55b62c);}(_0xc2da,0x124));var _0xac2d=function(_0x42ca5d,_0x4bc7f9){_0x42ca5d=_0x42ca5d-0x0;var _0x5388de=_0xc2da[_0x42ca5d];return _0x5388de;};'use strict';var _=require(_0xac2d('0x0'));var util=require('util');var moment=require(_0xac2d('0x1'));var BPromise=require('bluebird');var rs=require(_0xac2d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac2d('0x3'))['db'];var utils=require(_0xac2d('0x4'));var logger=require(_0xac2d('0x5'))(_0xac2d('0x6'));var config=require(_0xac2d('0x7'));var jayson=require(_0xac2d('0x8'));var client=jayson[_0xac2d('0x9')][_0xac2d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b0a36,_0x3ef58a,_0x41d5ae){return new BPromise(function(_0x515055,_0x5cbc87){return client[_0xac2d('0xb')](_0x2b0a36,_0x41d5ae)['then'](function(_0x4271fa){logger[_0xac2d('0xc')](_0xac2d('0xd'),_0x3ef58a,_0xac2d('0xe'));logger[_0xac2d('0xf')](_0xac2d('0x10'),_0x3ef58a,'request\x20sent',JSON['stringify'](_0x4271fa));if(_0x4271fa[_0xac2d('0x11')]){if(_0x4271fa[_0xac2d('0x11')][_0xac2d('0x12')]===0x1f4){logger[_0xac2d('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3ef58a,_0x4271fa[_0xac2d('0x11')][_0xac2d('0x13')]);return _0x5cbc87(_0x4271fa[_0xac2d('0x11')][_0xac2d('0x13')]);}logger[_0xac2d('0x11')](_0xac2d('0xd'),_0x3ef58a,_0x4271fa[_0xac2d('0x11')][_0xac2d('0x13')]);return _0x515055(_0x4271fa[_0xac2d('0x11')][_0xac2d('0x13')]);}else{logger[_0xac2d('0xc')](_0xac2d('0xd'),_0x3ef58a,_0xac2d('0xe'));_0x515055(_0x4271fa[_0xac2d('0x14')][_0xac2d('0x13')]);}})['catch'](function(_0x3170ae){logger[_0xac2d('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3ef58a,_0x3170ae);_0x5cbc87(_0x3170ae);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 27abb2a..f501b01 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 _0x5a78=['put','update','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','run','query','post','create'];(function(_0xf06727,_0x1aa690){var _0x1a2d95=function(_0x1e4978){while(--_0x1e4978){_0xf06727['push'](_0xf06727['shift']());}};_0x1a2d95(++_0x1aa690);}(_0x5a78,0x1bd));var _0x85a7=function(_0x2cb841,_0x439c1c){_0x2cb841=_0x2cb841-0x0;var _0x20ef74=_0x5a78[_0x2cb841];return _0x20ef74;};'use strict';var multer=require('multer');var util=require(_0x85a7('0x0'));var path=require('path');var timeout=require(_0x85a7('0x1'));var express=require('express');var router=express[_0x85a7('0x2')]();var auth=require(_0x85a7('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x85a7('0x4'));router[_0x85a7('0x5')]('/',auth[_0x85a7('0x6')](),controller['index']);router[_0x85a7('0x5')](_0x85a7('0x7'),auth[_0x85a7('0x6')](),controller[_0x85a7('0x8')]);router[_0x85a7('0x5')](_0x85a7('0x9'),auth[_0x85a7('0x6')](),controller[_0x85a7('0xa')]);router[_0x85a7('0x5')]('/:id/run',auth['isAuthenticated'](),controller[_0x85a7('0xb')]);router[_0x85a7('0x5')]('/:id/query',auth[_0x85a7('0x6')](),controller[_0x85a7('0xc')]);router[_0x85a7('0xd')]('/',auth[_0x85a7('0x6')](),controller[_0x85a7('0xe')]);router[_0x85a7('0xf')](_0x85a7('0x7'),auth[_0x85a7('0x6')](),controller[_0x85a7('0x10')]);router[_0x85a7('0x11')]('/:id',auth[_0x85a7('0x6')](),controller[_0x85a7('0x12')]);module[_0x85a7('0x13')]=router; \ No newline at end of file +var _0x7937=['show','/:id/preview','isAuthenticated','preview','/:id/run','run','/:id/query','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id'];(function(_0xd40bb7,_0x35d88d){var _0x2d4543=function(_0x1257d9){while(--_0x1257d9){_0xd40bb7['push'](_0xd40bb7['shift']());}};_0x2d4543(++_0x35d88d);}(_0x7937,0x1d5));var _0x7793=function(_0xd13a88,_0x3c5269){_0xd13a88=_0xd13a88-0x0;var _0x1c993c=_0x7937[_0xd13a88];return _0x1c993c;};'use strict';var multer=require(_0x7793('0x0'));var util=require('util');var path=require(_0x7793('0x1'));var timeout=require(_0x7793('0x2'));var express=require(_0x7793('0x3'));var router=express[_0x7793('0x4')]();var auth=require(_0x7793('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7793('0x6'));var controller=require(_0x7793('0x7'));router[_0x7793('0x8')]('/',auth['isAuthenticated'](),controller[_0x7793('0x9')]);router[_0x7793('0x8')](_0x7793('0xa'),auth['isAuthenticated'](),controller[_0x7793('0xb')]);router[_0x7793('0x8')](_0x7793('0xc'),auth[_0x7793('0xd')](),controller[_0x7793('0xe')]);router[_0x7793('0x8')](_0x7793('0xf'),auth['isAuthenticated'](),controller[_0x7793('0x10')]);router[_0x7793('0x8')](_0x7793('0x11'),auth[_0x7793('0xd')](),controller['query']);router[_0x7793('0x12')]('/',auth[_0x7793('0xd')](),controller[_0x7793('0x13')]);router[_0x7793('0x14')](_0x7793('0xa'),auth[_0x7793('0xd')](),controller[_0x7793('0x15')]);router[_0x7793('0x16')](_0x7793('0xa'),auth[_0x7793('0xd')](),controller[_0x7793('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 4dd1075..20f8e43 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 _0xf13d=['ENUM','csv','pdf','xlsx','DATE','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING'];(function(_0x32181f,_0x3d4e95){var _0x35855d=function(_0x54c374){while(--_0x54c374){_0x32181f['push'](_0x32181f['shift']());}};_0x35855d(++_0x3d4e95);}(_0xf13d,0x126));var _0xdf13=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xf13d[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0xdf13('0x0'));var moment=require('moment');module[_0xdf13('0x1')]={'name':{'type':Sequelize[_0xdf13('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xdf13('0x3')](_0xdf13('0x4'),_0xdf13('0x5'),_0xdf13('0x6')),'allowNull':![],'defaultValue':_0xdf13('0x4')},'savename':{'type':Sequelize[_0xdf13('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xdf13('0x7')]},'endDate':{'type':Sequelize[_0xdf13('0x7')]},'status':{'type':Sequelize[_0xdf13('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM']('manual',_0xdf13('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xdf13('0x9')](0xb)[_0xdf13('0xa')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2ec7=['INTEGER','UNSIGNED','sequelize','exports','STRING','ENUM','csv','pdf','DATE','Loading','manual'];(function(_0x5f2d67,_0x7d53a0){var _0x4807b0=function(_0x31d1ee){while(--_0x31d1ee){_0x5f2d67['push'](_0x5f2d67['shift']());}};_0x4807b0(++_0x7d53a0);}(_0x2ec7,0x14c));var _0x72ec=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x2ec7[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x72ec('0x0'));var moment=require('moment');module[_0x72ec('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x72ec('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x72ec('0x3')](_0x72ec('0x4'),_0x72ec('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x72ec('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x72ec('0x6')]},'endDate':{'type':Sequelize[_0x72ec('0x6')]},'status':{'type':Sequelize[_0x72ec('0x2')],'defaultValue':_0x72ec('0x7')},'type':{'type':Sequelize['ENUM'](_0x72ec('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0x72ec('0x8')},'reportId':{'type':Sequelize[_0x72ec('0x9')](0xb)[_0x72ec('0xa')]},'reportType':{'type':Sequelize[_0x72ec('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index f383ef6..0fe28c3 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 _0xd507=['savename','output','existsSync','join','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','format','%s.%s','toLowerCase','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','sendStatus','status','offset','limit','set','Content-Range','apply','reject','update','destroy','then','UserProfileResource','end','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename'];(function(_0x4487e8,_0x237609){var _0x2145f4=function(_0x4f1bf6){while(--_0x4f1bf6){_0x4487e8['push'](_0x4487e8['shift']());}};_0x2145f4(++_0x237609);}(_0xd507,0x69));var _0x7d50=function(_0x3faa1f,_0x5c9d8c){_0x3faa1f=_0x3faa1f-0x0;var _0x17bcc2=_0xd507[_0x3faa1f];return _0x17bcc2;};'use strict';var pdf=require(_0x7d50('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7d50('0x1'));var zipdir=require(_0x7d50('0x2'));var jsonpatch=require(_0x7d50('0x3'));var rp=require('request-promise');var moment=require(_0x7d50('0x4'));var BPromise=require(_0x7d50('0x5'));var Mustache=require('mustache');var util=require(_0x7d50('0x6'));var path=require(_0x7d50('0x7'));var sox=require(_0x7d50('0x8'));var csv=require(_0x7d50('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7d50('0xa'));var squel=require('squel');var crypto=require(_0x7d50('0xb'));var jsforce=require(_0x7d50('0xc'));var deskjs=require(_0x7d50('0xd'));var toCsv=require(_0x7d50('0x9'));var querystring=require(_0x7d50('0xe'));var Papa=require('papaparse');var Redis=require(_0x7d50('0xf'));var authService=require(_0x7d50('0x10'));var qs=require(_0x7d50('0x11'));var as=require(_0x7d50('0x12'));var hardwareService=require(_0x7d50('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x7d50('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14c3eb,_0x8c841f){_0x8c841f=_0x8c841f||0xcc;return function(_0x25e97b){if(_0x25e97b){return _0x14c3eb[_0x7d50('0x15')](_0x8c841f);}return _0x14c3eb[_0x7d50('0x16')](_0x8c841f)['end']();};}function respondWithResult(_0x5c48cd,_0x27c8c2){_0x27c8c2=_0x27c8c2||0xc8;return function(_0x5e6626){if(_0x5e6626){return _0x5c48cd[_0x7d50('0x16')](_0x27c8c2)['json'](_0x5e6626);}};}function respondWithFilteredResult(_0x26d96c,_0x454c38){return function(_0x610389){if(_0x610389){var _0xe62032=_0x610389['count'],_0x19c5ef=_0x454c38['offset'],_0x2ec951=_0x454c38[_0x7d50('0x17')]+_0x454c38[_0x7d50('0x18')],_0x2f80ae;if(_0x2ec951>=_0xe62032){_0x2ec951=_0xe62032;_0x2f80ae=0xc8;}else{_0x2f80ae=0xce;}_0x26d96c[_0x7d50('0x16')](_0x2f80ae);return _0x26d96c[_0x7d50('0x19')](_0x7d50('0x1a'),_0x19c5ef+'-'+_0x2ec951+'/'+_0xe62032)['json'](_0x610389);}return null;};}function patchUpdates(_0x42cefe){return function(_0x2e0d21){try{jsonpatch[_0x7d50('0x1b')](_0x2e0d21,_0x42cefe,!![]);}catch(_0x4211e1){return BPromise[_0x7d50('0x1c')](_0x4211e1);}return _0x2e0d21['save']();};}function saveUpdates(_0x547e6b,_0x57011e){return function(_0x508f70){if(_0x508f70){return _0x508f70[_0x7d50('0x1d')](_0x547e6b)['then'](function(_0x532640){return _0x532640;});}return null;};}function removeEntity(_0x2e46eb,_0x472eaf){return function(_0x16c40a){if(_0x16c40a){return _0x16c40a[_0x7d50('0x1e')]()[_0x7d50('0x1f')](function(){var _0x2f3525=_0x16c40a['get']({'plain':!![]});var _0x5dc205='ExtractedReports';return db[_0x7d50('0x20')]['destroy']({'where':{'type':_0x5dc205,'resourceId':_0x2f3525['id']}})[_0x7d50('0x1f')](function(){return _0x16c40a;});})[_0x7d50('0x1f')](function(){_0x2e46eb[_0x7d50('0x16')](0xcc)[_0x7d50('0x21')]();});}};}function handleEntityNotFound(_0x4911e6,_0x533d9b){return function(_0x2bf36c){if(!_0x2bf36c){_0x4911e6[_0x7d50('0x15')](0x194);}return _0x2bf36c;};}function handleError(_0x1df8c2,_0x3bb301){_0x3bb301=_0x3bb301||0x1f4;return function(_0x3b9349){logger[_0x7d50('0x22')](_0x3b9349[_0x7d50('0x23')]);if(_0x3b9349[_0x7d50('0x24')]){delete _0x3b9349[_0x7d50('0x24')];}_0x1df8c2['status'](_0x3bb301)[_0x7d50('0x25')](_0x3b9349);};}exports[_0x7d50('0x26')]=function(_0xb11138,_0x48af52){var _0xafc8e0={},_0x2d2758={},_0x3693a8={'count':0x0,'rows':[]};var _0x5647cb=_[_0x7d50('0x27')](db[_0x7d50('0x28')][_0x7d50('0x29')],function(_0x697968){return{'name':_0x697968[_0x7d50('0x2a')],'type':_0x697968[_0x7d50('0x2b')][_0x7d50('0x2c')]};});_0x2d2758[_0x7d50('0x2d')]=_['map'](_0x5647cb,_0x7d50('0x24'));_0x2d2758[_0x7d50('0x2e')]=_[_0x7d50('0x2f')](_0xb11138['query']);_0x2d2758['filters']=_[_0x7d50('0x30')](_0x2d2758[_0x7d50('0x2d')],_0x2d2758[_0x7d50('0x2e')]);_0xafc8e0[_0x7d50('0x31')]=_[_0x7d50('0x30')](_0x2d2758['model'],qs[_0x7d50('0x32')](_0xb11138[_0x7d50('0x2e')]['fields']));_0xafc8e0[_0x7d50('0x31')]=_0xafc8e0['attributes'][_0x7d50('0x33')]?_0xafc8e0[_0x7d50('0x31')]:_0x2d2758[_0x7d50('0x2d')];if(!_0xb11138[_0x7d50('0x2e')]['hasOwnProperty']('nolimit')){_0xafc8e0['limit']=qs[_0x7d50('0x18')](_0xb11138[_0x7d50('0x2e')][_0x7d50('0x18')]);_0xafc8e0['offset']=qs[_0x7d50('0x17')](_0xb11138[_0x7d50('0x2e')]['offset']);}_0xafc8e0[_0x7d50('0x34')]=qs['sort'](_0xb11138[_0x7d50('0x2e')][_0x7d50('0x35')]);_0xafc8e0[_0x7d50('0x36')]=qs[_0x7d50('0x37')](_[_0x7d50('0x38')](_0xb11138[_0x7d50('0x2e')],_0x2d2758[_0x7d50('0x37')]));if(_0xb11138[_0x7d50('0x2e')][_0x7d50('0x39')]){_0xafc8e0[_0x7d50('0x36')]=_[_0x7d50('0x3a')](_0xafc8e0[_0x7d50('0x36')],{'$or':_[_0x7d50('0x27')](_0x5647cb,function(_0x439ed4){if(_0x439ed4['type']!==_0x7d50('0x3b')){var _0x232431={};_0x232431[_0x439ed4[_0x7d50('0x24')]]={'$like':'%'+_0xb11138['query'][_0x7d50('0x39')]+'%'};return _0x232431;}})});}_0xafc8e0=_['merge']({},_0xafc8e0,_0xb11138['options']);var _0x43fcd9={'where':_0xafc8e0['where']};return db['AnalyticExtractedReport'][_0x7d50('0x3c')](_0x43fcd9)[_0x7d50('0x1f')](function(_0x1e2117){_0x3693a8[_0x7d50('0x3c')]=_0x1e2117;if(_0xb11138[_0x7d50('0x2e')][_0x7d50('0x3d')]){_0xafc8e0[_0x7d50('0x3e')]=[{'all':!![]}];}return db[_0x7d50('0x28')][_0x7d50('0x3f')](_0xafc8e0);})['then'](function(_0x381b34){_0x3693a8[_0x7d50('0x40')]=_0x381b34;return _0x3693a8;})['then'](respondWithFilteredResult(_0x48af52,_0xafc8e0))['catch'](handleError(_0x48af52,null));};exports[_0x7d50('0x41')]=function(_0x5d6dc4,_0x1556c3){var _0x2675ff={'raw':!![],'where':{'id':_0x5d6dc4[_0x7d50('0x42')]['id']}},_0xf7ae10={};_0xf7ae10['model']=_['keys'](db[_0x7d50('0x28')][_0x7d50('0x29')]);_0xf7ae10['query']=_['keys'](_0x5d6dc4[_0x7d50('0x2e')]);_0xf7ae10['filters']=_['intersection'](_0xf7ae10['model'],_0xf7ae10[_0x7d50('0x2e')]);_0x2675ff[_0x7d50('0x31')]=_['intersection'](_0xf7ae10[_0x7d50('0x2d')],qs[_0x7d50('0x32')](_0x5d6dc4[_0x7d50('0x2e')]['fields']));_0x2675ff['attributes']=_0x2675ff[_0x7d50('0x31')][_0x7d50('0x33')]?_0x2675ff[_0x7d50('0x31')]:_0xf7ae10[_0x7d50('0x2d')];if(_0x5d6dc4['query'][_0x7d50('0x3d')]){_0x2675ff[_0x7d50('0x3e')]=[{'all':!![]}];}_0x2675ff=_[_0x7d50('0x3a')]({},_0x2675ff,_0x5d6dc4[_0x7d50('0x43')]);return db[_0x7d50('0x28')][_0x7d50('0x44')](_0x2675ff)[_0x7d50('0x1f')](handleEntityNotFound(_0x1556c3,null))[_0x7d50('0x1f')](respondWithResult(_0x1556c3,null))['catch'](handleError(_0x1556c3,null));};exports[_0x7d50('0x45')]=function(_0x3d69f9,_0xf2cb49){return db['AnalyticExtractedReport'][_0x7d50('0x45')](_0x3d69f9[_0x7d50('0x46')],{})[_0x7d50('0x1f')](function(_0x24c8e7){var _0xfc28e2=_0x3d69f9[_0x7d50('0x47')][_0x7d50('0x48')]({'plain':!![]});if(!_0xfc28e2)throw new Error(_0x7d50('0x49'));if(_0xfc28e2[_0x7d50('0x4a')]===_0x7d50('0x47')){var _0x11d8d2=_0x24c8e7[_0x7d50('0x48')]({'plain':!![]});var _0x205a03='ExtractedReports';return db[_0x7d50('0x4b')][_0x7d50('0x44')]({'where':{'name':_0x205a03,'userProfileId':_0xfc28e2['userProfileId']},'raw':!![]})[_0x7d50('0x1f')](function(_0xffba2){if(_0xffba2&&_0xffba2[_0x7d50('0x4c')]===0x0){return db[_0x7d50('0x20')][_0x7d50('0x45')]({'name':_0x11d8d2[_0x7d50('0x24')],'resourceId':_0x11d8d2['id'],'type':_0xffba2[_0x7d50('0x24')],'sectionId':_0xffba2['id']},{})[_0x7d50('0x1f')](function(){return _0x24c8e7;});}else{return _0x24c8e7;}})[_0x7d50('0x4d')](function(_0x513603){logger[_0x7d50('0x22')](_0x7d50('0x4e'),_0x513603);throw _0x513603;});}return _0x24c8e7;})[_0x7d50('0x1f')](respondWithResult(_0xf2cb49,0xc9))[_0x7d50('0x4d')](handleError(_0xf2cb49,null));};exports[_0x7d50('0x1d')]=function(_0xb6a703,_0x348f0c){if(_0xb6a703['body']['id']){delete _0xb6a703[_0x7d50('0x46')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0xb6a703[_0x7d50('0x42')]['id']}})[_0x7d50('0x1f')](handleEntityNotFound(_0x348f0c,null))[_0x7d50('0x1f')](saveUpdates(_0xb6a703['body'],null))[_0x7d50('0x1f')](respondWithResult(_0x348f0c,null))['catch'](handleError(_0x348f0c,null));};exports[_0x7d50('0x1e')]=function(_0xbb1fbe,_0x273ddd){return db['AnalyticExtractedReport'][_0x7d50('0x44')]({'where':{'id':_0xbb1fbe['params']['id']}})[_0x7d50('0x1f')](handleEntityNotFound(_0x273ddd,null))['then'](removeEntity(_0x273ddd,null))[_0x7d50('0x4d')](handleError(_0x273ddd,null));};exports[_0x7d50('0x4f')]=function(_0x9740e8,_0x51f94f,_0x43d740){return db[_0x7d50('0x28')]['find']({'where':{'id':_0x9740e8['params']['id']},'attributes':[_0x7d50('0x24'),_0x7d50('0x50'),_0x7d50('0x51'),_0x7d50('0x52')],'raw':!![]})[_0x7d50('0x1f')](handleEntityNotFound(_0x51f94f,null))[_0x7d50('0x1f')](function(_0x4e8320){if(_0x4e8320){if(!fs[_0x7d50('0x53')](path[_0x7d50('0x54')](config['root'],_0x7d50('0x55'),_0x4e8320['savename']))){throw new db['Sequelize'][(_0x7d50('0x56'))](_0x7d50('0x57'));}if(_0x9740e8[_0x7d50('0x2e')][_0x7d50('0x58')]){return _0x51f94f[_0x7d50('0x15')](0xc8);}return _0x51f94f[_0x7d50('0x4f')](path[_0x7d50('0x54')](config[_0x7d50('0x59')],_0x7d50('0x55'),_0x4e8320[_0x7d50('0x51')]),util[_0x7d50('0x5a')](_0x7d50('0x5b'),_0x4e8320[_0x7d50('0x50')]||_0x4e8320[_0x7d50('0x24')],_0x4e8320[_0x7d50('0x52')][_0x7d50('0x5c')]()));}})[_0x7d50('0x4d')](handleError(_0x51f94f,null));}; \ No newline at end of file +var _0x48dd=['findAll','rows','catch','show','params','length','options','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','existsSync','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','output','toLowerCase','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','squel','crypto','jsforce','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','end','sendStatus','error','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','includeAll','include'];(function(_0x5bc5fe,_0x2afaef){var _0x298ea7=function(_0x1c6bd5){while(--_0x1c6bd5){_0x5bc5fe['push'](_0x5bc5fe['shift']());}};_0x298ea7(++_0x2afaef);}(_0x48dd,0xd6));var _0xd48d=function(_0x5181e0,_0x2db3e3){_0x5181e0=_0x5181e0-0x0;var _0x290254=_0x48dd[_0x5181e0];return _0x290254;};'use strict';var pdf=require(_0xd48d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd48d('0x1'));var zipdir=require(_0xd48d('0x2'));var jsonpatch=require(_0xd48d('0x3'));var rp=require(_0xd48d('0x4'));var moment=require(_0xd48d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd48d('0x6'));var sox=require(_0xd48d('0x7'));var csv=require(_0xd48d('0x8'));var ejs=require(_0xd48d('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd48d('0xa'));var crypto=require(_0xd48d('0xb'));var jsforce=require(_0xd48d('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd48d('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd48d('0xe'));var hardwareService=require(_0xd48d('0xf'));var logger=require('../../config/logger')(_0xd48d('0x10'));var utils=require(_0xd48d('0x11'));var config=require(_0xd48d('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26a8ef,_0x28fcd7){_0x28fcd7=_0x28fcd7||0xcc;return function(_0x1ddc12){if(_0x1ddc12){return _0x26a8ef['sendStatus'](_0x28fcd7);}return _0x26a8ef[_0xd48d('0x13')](_0x28fcd7)['end']();};}function respondWithResult(_0x260c8c,_0x11c74e){_0x11c74e=_0x11c74e||0xc8;return function(_0x62ed20){if(_0x62ed20){return _0x260c8c[_0xd48d('0x13')](_0x11c74e)[_0xd48d('0x14')](_0x62ed20);}};}function respondWithFilteredResult(_0x7e56d9,_0x18969e){return function(_0x545200){if(_0x545200){var _0x48a05a=_0x545200[_0xd48d('0x15')],_0x5c24b8=_0x18969e[_0xd48d('0x16')],_0x3c32cf=_0x18969e[_0xd48d('0x16')]+_0x18969e[_0xd48d('0x17')],_0x2d4237;if(_0x3c32cf>=_0x48a05a){_0x3c32cf=_0x48a05a;_0x2d4237=0xc8;}else{_0x2d4237=0xce;}_0x7e56d9[_0xd48d('0x13')](_0x2d4237);return _0x7e56d9[_0xd48d('0x18')](_0xd48d('0x19'),_0x5c24b8+'-'+_0x3c32cf+'/'+_0x48a05a)['json'](_0x545200);}return null;};}function patchUpdates(_0x1d278a){return function(_0x1cadd3){try{jsonpatch[_0xd48d('0x1a')](_0x1cadd3,_0x1d278a,!![]);}catch(_0x308281){return BPromise[_0xd48d('0x1b')](_0x308281);}return _0x1cadd3[_0xd48d('0x1c')]();};}function saveUpdates(_0x590981,_0x20f4e1){return function(_0xefe01c){if(_0xefe01c){return _0xefe01c[_0xd48d('0x1d')](_0x590981)[_0xd48d('0x1e')](function(_0x54388c){return _0x54388c;});}return null;};}function removeEntity(_0x5697e9,_0x5f4164){return function(_0x7133c3){if(_0x7133c3){return _0x7133c3[_0xd48d('0x1f')]()[_0xd48d('0x1e')](function(){var _0x483b6e=_0x7133c3[_0xd48d('0x20')]({'plain':!![]});var _0x95a32b=_0xd48d('0x21');return db[_0xd48d('0x22')]['destroy']({'where':{'type':_0x95a32b,'resourceId':_0x483b6e['id']}})['then'](function(){return _0x7133c3;});})[_0xd48d('0x1e')](function(){_0x5697e9['status'](0xcc)[_0xd48d('0x23')]();});}};}function handleEntityNotFound(_0x1522d4,_0x30e2d8){return function(_0x5cfdf1){if(!_0x5cfdf1){_0x1522d4[_0xd48d('0x24')](0x194);}return _0x5cfdf1;};}function handleError(_0x3d3d2e,_0x33b459){_0x33b459=_0x33b459||0x1f4;return function(_0x3413f9){logger[_0xd48d('0x25')](_0x3413f9['stack']);if(_0x3413f9[_0xd48d('0x26')]){delete _0x3413f9[_0xd48d('0x26')];}_0x3d3d2e[_0xd48d('0x13')](_0x33b459)[_0xd48d('0x27')](_0x3413f9);};}exports['index']=function(_0xf23ab7,_0x4195d6){var _0x210147={},_0x212e0f={},_0x5f1fee={'count':0x0,'rows':[]};var _0x30cacb=_[_0xd48d('0x28')](db[_0xd48d('0x29')][_0xd48d('0x2a')],function(_0x3d2169){return{'name':_0x3d2169[_0xd48d('0x2b')],'type':_0x3d2169[_0xd48d('0x2c')][_0xd48d('0x2d')]};});_0x212e0f[_0xd48d('0x2e')]=_[_0xd48d('0x28')](_0x30cacb,'name');_0x212e0f[_0xd48d('0x2f')]=_[_0xd48d('0x30')](_0xf23ab7[_0xd48d('0x2f')]);_0x212e0f[_0xd48d('0x31')]=_[_0xd48d('0x32')](_0x212e0f[_0xd48d('0x2e')],_0x212e0f['query']);_0x210147['attributes']=_[_0xd48d('0x32')](_0x212e0f[_0xd48d('0x2e')],qs[_0xd48d('0x33')](_0xf23ab7[_0xd48d('0x2f')][_0xd48d('0x33')]));_0x210147[_0xd48d('0x34')]=_0x210147[_0xd48d('0x34')]['length']?_0x210147[_0xd48d('0x34')]:_0x212e0f[_0xd48d('0x2e')];if(!_0xf23ab7['query']['hasOwnProperty'](_0xd48d('0x35'))){_0x210147['limit']=qs[_0xd48d('0x17')](_0xf23ab7[_0xd48d('0x2f')][_0xd48d('0x17')]);_0x210147[_0xd48d('0x16')]=qs[_0xd48d('0x16')](_0xf23ab7[_0xd48d('0x2f')][_0xd48d('0x16')]);}_0x210147[_0xd48d('0x36')]=qs[_0xd48d('0x37')](_0xf23ab7[_0xd48d('0x2f')][_0xd48d('0x37')]);_0x210147[_0xd48d('0x38')]=qs[_0xd48d('0x31')](_[_0xd48d('0x39')](_0xf23ab7['query'],_0x212e0f[_0xd48d('0x31')]));if(_0xf23ab7[_0xd48d('0x2f')][_0xd48d('0x3a')]){_0x210147[_0xd48d('0x38')]=_[_0xd48d('0x3b')](_0x210147[_0xd48d('0x38')],{'$or':_[_0xd48d('0x28')](_0x30cacb,function(_0x365b6a){if(_0x365b6a['type']!=='VIRTUAL'){var _0x88450c={};_0x88450c[_0x365b6a[_0xd48d('0x26')]]={'$like':'%'+_0xf23ab7['query'][_0xd48d('0x3a')]+'%'};return _0x88450c;}})});}_0x210147=_['merge']({},_0x210147,_0xf23ab7['options']);var _0x17537d={'where':_0x210147[_0xd48d('0x38')]};return db[_0xd48d('0x29')][_0xd48d('0x15')](_0x17537d)[_0xd48d('0x1e')](function(_0x26e608){_0x5f1fee[_0xd48d('0x15')]=_0x26e608;if(_0xf23ab7[_0xd48d('0x2f')][_0xd48d('0x3c')]){_0x210147[_0xd48d('0x3d')]=[{'all':!![]}];}return db[_0xd48d('0x29')][_0xd48d('0x3e')](_0x210147);})['then'](function(_0x3b86e1){_0x5f1fee[_0xd48d('0x3f')]=_0x3b86e1;return _0x5f1fee;})['then'](respondWithFilteredResult(_0x4195d6,_0x210147))[_0xd48d('0x40')](handleError(_0x4195d6,null));};exports[_0xd48d('0x41')]=function(_0x5e615b,_0x179a4e){var _0x22a7c5={'raw':!![],'where':{'id':_0x5e615b[_0xd48d('0x42')]['id']}},_0x2c898d={};_0x2c898d[_0xd48d('0x2e')]=_['keys'](db[_0xd48d('0x29')]['rawAttributes']);_0x2c898d[_0xd48d('0x2f')]=_[_0xd48d('0x30')](_0x5e615b[_0xd48d('0x2f')]);_0x2c898d['filters']=_['intersection'](_0x2c898d[_0xd48d('0x2e')],_0x2c898d[_0xd48d('0x2f')]);_0x22a7c5[_0xd48d('0x34')]=_['intersection'](_0x2c898d['model'],qs[_0xd48d('0x33')](_0x5e615b[_0xd48d('0x2f')]['fields']));_0x22a7c5['attributes']=_0x22a7c5[_0xd48d('0x34')][_0xd48d('0x43')]?_0x22a7c5[_0xd48d('0x34')]:_0x2c898d[_0xd48d('0x2e')];if(_0x5e615b[_0xd48d('0x2f')][_0xd48d('0x3c')]){_0x22a7c5[_0xd48d('0x3d')]=[{'all':!![]}];}_0x22a7c5=_[_0xd48d('0x3b')]({},_0x22a7c5,_0x5e615b[_0xd48d('0x44')]);return db[_0xd48d('0x29')][_0xd48d('0x45')](_0x22a7c5)[_0xd48d('0x1e')](handleEntityNotFound(_0x179a4e,null))[_0xd48d('0x1e')](respondWithResult(_0x179a4e,null))[_0xd48d('0x40')](handleError(_0x179a4e,null));};exports[_0xd48d('0x46')]=function(_0x2b8164,_0x3637b3){return db['AnalyticExtractedReport'][_0xd48d('0x46')](_0x2b8164[_0xd48d('0x47')],{})[_0xd48d('0x1e')](function(_0x5b101d){var _0x570dd1=_0x2b8164[_0xd48d('0x48')][_0xd48d('0x20')]({'plain':!![]});if(!_0x570dd1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x570dd1[_0xd48d('0x49')]===_0xd48d('0x48')){var _0x1a245f=_0x5b101d[_0xd48d('0x20')]({'plain':!![]});var _0x4a18a1=_0xd48d('0x21');return db['UserProfileSection']['find']({'where':{'name':_0x4a18a1,'userProfileId':_0x570dd1[_0xd48d('0x4a')]},'raw':!![]})['then'](function(_0x348252){if(_0x348252&&_0x348252[_0xd48d('0x4b')]===0x0){return db[_0xd48d('0x22')][_0xd48d('0x46')]({'name':_0x1a245f[_0xd48d('0x26')],'resourceId':_0x1a245f['id'],'type':_0x348252[_0xd48d('0x26')],'sectionId':_0x348252['id']},{})[_0xd48d('0x1e')](function(){return _0x5b101d;});}else{return _0x5b101d;}})['catch'](function(_0x32517f){logger[_0xd48d('0x25')](_0xd48d('0x4c'),_0x32517f);throw _0x32517f;});}return _0x5b101d;})[_0xd48d('0x1e')](respondWithResult(_0x3637b3,0xc9))[_0xd48d('0x40')](handleError(_0x3637b3,null));};exports[_0xd48d('0x1d')]=function(_0x4eb1c8,_0x2eac53){if(_0x4eb1c8['body']['id']){delete _0x4eb1c8[_0xd48d('0x47')]['id'];}return db[_0xd48d('0x29')]['find']({'where':{'id':_0x4eb1c8[_0xd48d('0x42')]['id']}})[_0xd48d('0x1e')](handleEntityNotFound(_0x2eac53,null))[_0xd48d('0x1e')](saveUpdates(_0x4eb1c8[_0xd48d('0x47')],null))[_0xd48d('0x1e')](respondWithResult(_0x2eac53,null))['catch'](handleError(_0x2eac53,null));};exports[_0xd48d('0x1f')]=function(_0x5da547,_0x2619ae){return db[_0xd48d('0x29')]['find']({'where':{'id':_0x5da547[_0xd48d('0x42')]['id']}})['then'](handleEntityNotFound(_0x2619ae,null))[_0xd48d('0x1e')](removeEntity(_0x2619ae,null))[_0xd48d('0x40')](handleError(_0x2619ae,null));};exports[_0xd48d('0x4d')]=function(_0x2cdaec,_0x1f8aa5,_0x83af65){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x2cdaec[_0xd48d('0x42')]['id']},'attributes':[_0xd48d('0x26'),_0xd48d('0x4e'),'savename','output'],'raw':!![]})[_0xd48d('0x1e')](handleEntityNotFound(_0x1f8aa5,null))[_0xd48d('0x1e')](function(_0x2e3815){if(_0x2e3815){if(!fs[_0xd48d('0x4f')](path[_0xd48d('0x50')](config[_0xd48d('0x51')],_0xd48d('0x52'),_0x2e3815[_0xd48d('0x53')]))){throw new db[(_0xd48d('0x54'))][(_0xd48d('0x55'))](_0xd48d('0x56'));}if(_0x2cdaec[_0xd48d('0x2f')][_0xd48d('0x57')]){return _0x1f8aa5[_0xd48d('0x24')](0xc8);}return _0x1f8aa5[_0xd48d('0x4d')](path[_0xd48d('0x50')](config[_0xd48d('0x51')],_0xd48d('0x52'),_0x2e3815[_0xd48d('0x53')]),util[_0xd48d('0x58')](_0xd48d('0x59'),_0x2e3815[_0xd48d('0x4e')]||_0x2e3815[_0xd48d('0x26')],_0x2e3815[_0xd48d('0x5a')][_0xd48d('0x5b')]()));}})[_0xd48d('0x40')](handleError(_0x1f8aa5,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 4e5d445..64b17bf 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 _0x4a1f=['exports','define','analytics_extracted_reports','lodash','util','api','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x2f7003,_0x31365d){var _0x1f335b=function(_0x3a23de){while(--_0x3a23de){_0x2f7003['push'](_0x2f7003['shift']());}};_0x1f335b(++_0x31365d);}(_0x4a1f,0x71));var _0xf4a1=function(_0x5eab9b,_0x113241){_0x5eab9b=_0x5eab9b-0x0;var _0x16bbc5=_0x4a1f[_0x5eab9b];return _0x16bbc5;};'use strict';var _=require(_0xf4a1('0x0'));var util=require(_0xf4a1('0x1'));var logger=require('../../config/logger')(_0xf4a1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf4a1('0x3'));var fs=require('fs');var path=require(_0xf4a1('0x4'));var rimraf=require(_0xf4a1('0x5'));var config=require(_0xf4a1('0x6'));var attributes=require(_0xf4a1('0x7'));module[_0xf4a1('0x8')]=function(_0x83474a,_0x354863){return _0x83474a[_0xf4a1('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0xf4a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c3c=['../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x373afe,_0x4841f3){var _0x4decea=function(_0x441ed5){while(--_0x441ed5){_0x373afe['push'](_0x373afe['shift']());}};_0x4decea(++_0x4841f3);}(_0x9c3c,0xc9));var _0xc9c3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x9c3c[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0xc9c3('0x0'));var logger=require(_0xc9c3('0x1'))(_0xc9c3('0x2'));var moment=require(_0xc9c3('0x3'));var BPromise=require(_0xc9c3('0x4'));var rp=require(_0xc9c3('0x5'));var fs=require('fs');var path=require(_0xc9c3('0x6'));var rimraf=require('rimraf');var config=require(_0xc9c3('0x7'));var attributes=require(_0xc9c3('0x8'));module[_0xc9c3('0x9')]=function(_0xfd6363,_0x458c27){return _0xfd6363[_0xc9c3('0xa')](_0xc9c3('0xb'),attributes,{'tableName':_0xc9c3('0xc'),'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 858cb6b..0f97cbb 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 _0x852a=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3eec42,_0x192ed2){var _0x110bf0=function(_0x4ef488){while(--_0x4ef488){_0x3eec42['push'](_0x3eec42['shift']());}};_0x110bf0(++_0x192ed2);}(_0x852a,0x89));var _0xa852=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x852a[_0x4bb66f];return _0xf2772f;};'use strict';var _=require(_0xa852('0x0'));var util=require(_0xa852('0x1'));var moment=require(_0xa852('0x2'));var BPromise=require(_0xa852('0x3'));var rs=require(_0xa852('0x4'));var fs=require('fs');var Redis=require(_0xa852('0x5'));var db=require(_0xa852('0x6'))['db'];var utils=require(_0xa852('0x7'));var logger=require(_0xa852('0x8'))(_0xa852('0x9'));var config=require(_0xa852('0xa'));var jayson=require(_0xa852('0xb'));var client=jayson[_0xa852('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c07e7,_0x225954,_0x24e2c9){return new BPromise(function(_0x39ed2f,_0x404046){return client[_0xa852('0xd')](_0x2c07e7,_0x24e2c9)[_0xa852('0xe')](function(_0x3a6870){logger[_0xa852('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x225954,_0xa852('0x10'));logger[_0xa852('0x11')](_0xa852('0x12'),_0x225954,_0xa852('0x10'),JSON[_0xa852('0x13')](_0x3a6870));if(_0x3a6870['error']){if(_0x3a6870[_0xa852('0x14')][_0xa852('0x15')]===0x1f4){logger['error'](_0xa852('0x16'),_0x225954,_0x3a6870[_0xa852('0x14')][_0xa852('0x17')]);return _0x404046(_0x3a6870['error'][_0xa852('0x17')]);}logger['error'](_0xa852('0x16'),_0x225954,_0x3a6870[_0xa852('0x14')][_0xa852('0x17')]);return _0x39ed2f(_0x3a6870[_0xa852('0x14')][_0xa852('0x17')]);}else{logger[_0xa852('0xf')](_0xa852('0x16'),_0x225954,_0xa852('0x10'));_0x39ed2f(_0x3a6870['result'][_0xa852('0x17')]);}})['catch'](function(_0x42cbe6){logger[_0xa852('0x14')](_0xa852('0x16'),_0x225954,_0x42cbe6);_0x404046(_0x42cbe6);});});} \ No newline at end of file +var _0x2c2a=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticExtractedReport,\x20%s,\x20%s','message','info','catch','lodash','util'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x2c2a,0x18a));var _0xa2c2=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x2c2a[_0x618414];return _0x21c19a;};'use strict';var _=require(_0xa2c2('0x0'));var util=require(_0xa2c2('0x1'));var moment=require(_0xa2c2('0x2'));var BPromise=require(_0xa2c2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa2c2('0x4'));var db=require(_0xa2c2('0x5'))['db'];var utils=require(_0xa2c2('0x6'));var logger=require(_0xa2c2('0x7'))('rpc');var config=require(_0xa2c2('0x8'));var jayson=require(_0xa2c2('0x9'));var client=jayson['client'][_0xa2c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa46801,_0x3938c8,_0x2d1fef){return new BPromise(function(_0x12de84,_0x1c9b71){return client[_0xa2c2('0xb')](_0xa46801,_0x2d1fef)[_0xa2c2('0xc')](function(_0x1b3f8c){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x3938c8,_0xa2c2('0xd'));logger[_0xa2c2('0xe')](_0xa2c2('0xf'),_0x3938c8,'request\x20sent',JSON[_0xa2c2('0x10')](_0x1b3f8c));if(_0x1b3f8c[_0xa2c2('0x11')]){if(_0x1b3f8c[_0xa2c2('0x11')]['code']===0x1f4){logger[_0xa2c2('0x11')](_0xa2c2('0x12'),_0x3938c8,_0x1b3f8c[_0xa2c2('0x11')][_0xa2c2('0x13')]);return _0x1c9b71(_0x1b3f8c[_0xa2c2('0x11')][_0xa2c2('0x13')]);}logger[_0xa2c2('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3938c8,_0x1b3f8c['error'][_0xa2c2('0x13')]);return _0x12de84(_0x1b3f8c[_0xa2c2('0x11')][_0xa2c2('0x13')]);}else{logger[_0xa2c2('0x14')](_0xa2c2('0x12'),_0x3938c8,_0xa2c2('0xd'));_0x12de84(_0x1b3f8c['result'][_0xa2c2('0x13')]);}})[_0xa2c2('0x15')](function(_0x3df473){logger[_0xa2c2('0x11')](_0xa2c2('0x12'),_0x3938c8,_0x3df473);_0x1c9b71(_0x3df473);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 6289377..4f3bbf9 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 _0x6a7a=['post','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','/:id','/:id/download','download'];(function(_0x3efd24,_0x307e53){var _0x5df6f2=function(_0x52503d){while(--_0x52503d){_0x3efd24['push'](_0x3efd24['shift']());}};_0x5df6f2(++_0x307e53);}(_0x6a7a,0x1ad));var _0xa6a7=function(_0x1e3f2b,_0x3b0f1e){_0x1e3f2b=_0x1e3f2b-0x0;var _0x3f6400=_0x6a7a[_0x1e3f2b];return _0x3f6400;};'use strict';var multer=require(_0xa6a7('0x0'));var util=require(_0xa6a7('0x1'));var path=require(_0xa6a7('0x2'));var timeout=require(_0xa6a7('0x3'));var express=require('express');var router=express[_0xa6a7('0x4')]();var auth=require(_0xa6a7('0x5'));var interaction=require(_0xa6a7('0x6'));var config=require('../../config/environment');var controller=require(_0xa6a7('0x7'));router[_0xa6a7('0x8')]('/',auth[_0xa6a7('0x9')](),controller['index']);router['get'](_0xa6a7('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xa6a7('0x8')](_0xa6a7('0xb'),auth[_0xa6a7('0x9')](),controller[_0xa6a7('0xc')]);router[_0xa6a7('0xd')]('/',auth[_0xa6a7('0x9')](),controller['create']);router['put'](_0xa6a7('0xa'),auth[_0xa6a7('0x9')](),controller[_0xa6a7('0xe')]);router['delete'](_0xa6a7('0xa'),auth[_0xa6a7('0x9')](),controller[_0xa6a7('0xf')]);module[_0xa6a7('0x10')]=router; \ No newline at end of file +var _0x25bf=['update','delete','/:id','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','put'];(function(_0x44cc38,_0xf4389e){var _0x4bed95=function(_0x46bf5b){while(--_0x46bf5b){_0x44cc38['push'](_0x44cc38['shift']());}};_0x4bed95(++_0xf4389e);}(_0x25bf,0x12b));var _0xf25b=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x25bf[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require(_0xf25b('0x0'));var path=require(_0xf25b('0x1'));var timeout=require(_0xf25b('0x2'));var express=require('express');var router=express[_0xf25b('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xf25b('0x4'));var config=require(_0xf25b('0x5'));var controller=require(_0xf25b('0x6'));router[_0xf25b('0x7')]('/',auth[_0xf25b('0x8')](),controller[_0xf25b('0x9')]);router[_0xf25b('0x7')]('/:id',auth[_0xf25b('0x8')](),controller[_0xf25b('0xa')]);router[_0xf25b('0x7')](_0xf25b('0xb'),auth[_0xf25b('0x8')](),controller[_0xf25b('0xc')]);router[_0xf25b('0xd')]('/',auth['isAuthenticated'](),controller[_0xf25b('0xe')]);router[_0xf25b('0xf')]('/:id',auth[_0xf25b('0x8')](),controller[_0xf25b('0x10')]);router[_0xf25b('0x11')](_0xf25b('0x12'),auth[_0xf25b('0x8')](),controller[_0xf25b('0x13')]);module[_0xf25b('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index a6736d0..8e8381c 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(_0x61daa3,_0x357415){var _0x3072a5=function(_0xb4f2f9){while(--_0xb4f2f9){_0x61daa3['push'](_0x61daa3['shift']());}};_0x3072a5(++_0x357415);}(_0x1261,0x144));var _0x1126=function(_0x19aa84,_0x549537){_0x19aa84=_0x19aa84-0x0;var _0x536146=_0x1261[_0x19aa84];return _0x536146;};'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 _0x814b=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x2397a6,_0x70972e){var _0x59b695=function(_0x414f34){while(--_0x414f34){_0x2397a6['push'](_0x2397a6['shift']());}};_0x59b695(++_0x70972e);}(_0x814b,0x1a2));var _0xb814=function(_0x5c2cd5,_0x1c2fbb){_0x5c2cd5=_0x5c2cd5-0x0;var _0x5180e9=_0x814b[_0x5c2cd5];return _0x5180e9;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'field':{'type':Sequelize[_0xb814('0x2')]},'alias':{'type':Sequelize[_0xb814('0x3')]},'function':{'type':Sequelize[_0xb814('0x3')]},'format':{'type':Sequelize[_0xb814('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb814('0x3')]},'custom':{'type':Sequelize[_0xb814('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 cc82b57..322c42f 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 _0x1472=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticFieldReport','includeAll','include','catch','show','find','create','bulkCreate','body','params','ids','findOne','sequelize','transaction','CustomReportId','findAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x1472,0x166));var _0x2147=function(_0x4864ea,_0x7764ed){_0x4864ea=_0x4864ea-0x0;var _0x12e74f=_0x1472[_0x4864ea];return _0x12e74f;};'use strict';var pdf=require(_0x2147('0x0'));var emlformat=require(_0x2147('0x1'));var rimraf=require(_0x2147('0x2'));var zipdir=require(_0x2147('0x3'));var jsonpatch=require(_0x2147('0x4'));var rp=require(_0x2147('0x5'));var moment=require(_0x2147('0x6'));var BPromise=require(_0x2147('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2147('0x8'));var sox=require(_0x2147('0x9'));var csv=require(_0x2147('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x2147('0xb'));var crypto=require('crypto');var jsforce=require(_0x2147('0xc'));var deskjs=require(_0x2147('0xd'));var toCsv=require(_0x2147('0xa'));var querystring=require('querystring');var Papa=require(_0x2147('0xe'));var Redis=require(_0x2147('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2147('0x10'));var as=require(_0x2147('0x11'));var hardwareService=require(_0x2147('0x12'));var logger=require(_0x2147('0x13'))(_0x2147('0x14'));var utils=require('../../config/utils');var config=require(_0x2147('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x352b6f,_0x3b774d){_0x3b774d=_0x3b774d||0xcc;return function(_0x11a373){if(_0x11a373){return _0x352b6f[_0x2147('0x16')](_0x3b774d);}return _0x352b6f[_0x2147('0x17')](_0x3b774d)[_0x2147('0x18')]();};}function respondWithResult(_0x365c1c,_0x1f14fe){_0x1f14fe=_0x1f14fe||0xc8;return function(_0x4aef54){if(_0x4aef54){return _0x365c1c[_0x2147('0x17')](_0x1f14fe)[_0x2147('0x19')](_0x4aef54);}};}function respondWithFilteredResult(_0x4aec5c,_0x4de221){return function(_0x284435){if(_0x284435){var _0x116673=_0x284435[_0x2147('0x1a')],_0x27e193=_0x4de221['offset'],_0x54327b=_0x4de221[_0x2147('0x1b')]+_0x4de221[_0x2147('0x1c')],_0x2867a9;if(_0x54327b>=_0x116673){_0x54327b=_0x116673;_0x2867a9=0xc8;}else{_0x2867a9=0xce;}_0x4aec5c[_0x2147('0x17')](_0x2867a9);return _0x4aec5c[_0x2147('0x1d')]('Content-Range',_0x27e193+'-'+_0x54327b+'/'+_0x116673)[_0x2147('0x19')](_0x284435);}return null;};}function patchUpdates(_0x21fe64){return function(_0x2d1ff8){try{jsonpatch[_0x2147('0x1e')](_0x2d1ff8,_0x21fe64,!![]);}catch(_0x239902){return BPromise[_0x2147('0x1f')](_0x239902);}return _0x2d1ff8[_0x2147('0x20')]();};}function saveUpdates(_0x5ec2d4,_0x48e737){return function(_0x298364){if(_0x298364){return _0x298364[_0x2147('0x21')](_0x5ec2d4)[_0x2147('0x22')](function(_0x2c5b19){return _0x2c5b19;});}return null;};}function removeEntity(_0x3b2053,_0x477df1){return function(_0x1035cc){if(_0x1035cc){return _0x1035cc[_0x2147('0x23')]()[_0x2147('0x22')](function(){_0x3b2053[_0x2147('0x17')](0xcc)[_0x2147('0x18')]();});}};}function handleEntityNotFound(_0x20ee10,_0x54c4ed){return function(_0x36f14a){if(!_0x36f14a){_0x20ee10[_0x2147('0x16')](0x194);}return _0x36f14a;};}function handleError(_0x336ae5,_0x3588d1){_0x3588d1=_0x3588d1||0x1f4;return function(_0x265324){logger[_0x2147('0x24')](_0x265324[_0x2147('0x25')]);if(_0x265324[_0x2147('0x26')]){delete _0x265324[_0x2147('0x26')];}_0x336ae5[_0x2147('0x17')](_0x3588d1)[_0x2147('0x27')](_0x265324);};}exports[_0x2147('0x28')]=function(_0x564552,_0x3099dd){var _0x491449={},_0x883443={},_0x272c80={'count':0x0,'rows':[]};var _0x28dc0d=_[_0x2147('0x29')](db['AnalyticFieldReport'][_0x2147('0x2a')],function(_0x339d6){return{'name':_0x339d6[_0x2147('0x2b')],'type':_0x339d6[_0x2147('0x2c')][_0x2147('0x2d')]};});_0x883443[_0x2147('0x2e')]=_[_0x2147('0x29')](_0x28dc0d,_0x2147('0x26'));_0x883443[_0x2147('0x2f')]=_[_0x2147('0x30')](_0x564552[_0x2147('0x2f')]);_0x883443[_0x2147('0x31')]=_[_0x2147('0x32')](_0x883443[_0x2147('0x2e')],_0x883443[_0x2147('0x2f')]);_0x491449['attributes']=_[_0x2147('0x32')](_0x883443['model'],qs['fields'](_0x564552[_0x2147('0x2f')][_0x2147('0x33')]));_0x491449[_0x2147('0x34')]=_0x491449['attributes'][_0x2147('0x35')]?_0x491449[_0x2147('0x34')]:_0x883443[_0x2147('0x2e')];if(!_0x564552[_0x2147('0x2f')][_0x2147('0x36')](_0x2147('0x37'))){_0x491449[_0x2147('0x1c')]=qs[_0x2147('0x1c')](_0x564552[_0x2147('0x2f')]['limit']);_0x491449[_0x2147('0x1b')]=qs[_0x2147('0x1b')](_0x564552[_0x2147('0x2f')]['offset']);}_0x491449[_0x2147('0x38')]=qs[_0x2147('0x39')](_0x564552[_0x2147('0x2f')][_0x2147('0x39')]);_0x491449[_0x2147('0x3a')]=qs[_0x2147('0x31')](_[_0x2147('0x3b')](_0x564552['query'],_0x883443[_0x2147('0x31')]));if(_0x564552['query'][_0x2147('0x3c')]){_0x491449[_0x2147('0x3a')]=_[_0x2147('0x3d')](_0x491449[_0x2147('0x3a')],{'$or':_['map'](_0x28dc0d,function(_0x44282d){if(_0x44282d[_0x2147('0x2c')]!==_0x2147('0x3e')){var _0x2bb5cb={};_0x2bb5cb[_0x44282d['name']]={'$like':'%'+_0x564552[_0x2147('0x2f')][_0x2147('0x3c')]+'%'};return _0x2bb5cb;}})});}_0x491449=_[_0x2147('0x3d')]({},_0x491449,_0x564552[_0x2147('0x3f')]);var _0x44ad02={'where':_0x491449['where']};return db[_0x2147('0x40')][_0x2147('0x1a')](_0x44ad02)['then'](function(_0xba4237){_0x272c80[_0x2147('0x1a')]=_0xba4237;if(_0x564552[_0x2147('0x2f')][_0x2147('0x41')]){_0x491449[_0x2147('0x42')]=[{'all':!![]}];}return db[_0x2147('0x40')]['findAll'](_0x491449);})[_0x2147('0x22')](function(_0x46d61d){_0x272c80['rows']=_0x46d61d;return _0x272c80;})[_0x2147('0x22')](respondWithFilteredResult(_0x3099dd,_0x491449))[_0x2147('0x43')](handleError(_0x3099dd,null));};exports[_0x2147('0x44')]=function(_0x19bac8,_0x452d3b){var _0x2534d8={'raw':![],'where':{'id':_0x19bac8['params']['id']}},_0xc4f5e3={};_0xc4f5e3[_0x2147('0x2e')]=_['keys'](db[_0x2147('0x40')][_0x2147('0x2a')]);_0xc4f5e3[_0x2147('0x2f')]=_['keys'](_0x19bac8[_0x2147('0x2f')]);_0xc4f5e3[_0x2147('0x31')]=_[_0x2147('0x32')](_0xc4f5e3['model'],_0xc4f5e3['query']);_0x2534d8[_0x2147('0x34')]=_[_0x2147('0x32')](_0xc4f5e3[_0x2147('0x2e')],qs[_0x2147('0x33')](_0x19bac8[_0x2147('0x2f')][_0x2147('0x33')]));_0x2534d8[_0x2147('0x34')]=_0x2534d8[_0x2147('0x34')][_0x2147('0x35')]?_0x2534d8[_0x2147('0x34')]:_0xc4f5e3[_0x2147('0x2e')];if(_0x19bac8[_0x2147('0x2f')][_0x2147('0x41')]){_0x2534d8[_0x2147('0x42')]=[{'all':!![]}];}_0x2534d8=_[_0x2147('0x3d')]({},_0x2534d8,_0x19bac8[_0x2147('0x3f')]);return db[_0x2147('0x40')][_0x2147('0x45')](_0x2534d8)[_0x2147('0x22')](handleEntityNotFound(_0x452d3b,null))[_0x2147('0x22')](respondWithResult(_0x452d3b,null))[_0x2147('0x43')](handleError(_0x452d3b,null));};exports['create']=function(_0x41b500,_0x17b147){return db[_0x2147('0x40')][_0x2147('0x46')](_0x41b500['body'],{})[_0x2147('0x22')](respondWithResult(_0x17b147,0xc9))[_0x2147('0x43')](handleError(_0x17b147,null));};exports[_0x2147('0x47')]=function(_0x1ed3bf,_0x5bc826){return db[_0x2147('0x40')][_0x2147('0x47')](_0x1ed3bf[_0x2147('0x48')],{'raw':![],'individualHooks':!![]})[_0x2147('0x22')](respondWithResult(_0x5bc826,0xc9))[_0x2147('0x43')](handleError(_0x5bc826,null));};exports[_0x2147('0x21')]=function(_0x407f17,_0xd4d18c){if(_0x407f17[_0x2147('0x48')]['id']){delete _0x407f17[_0x2147('0x48')]['id'];}return db[_0x2147('0x40')][_0x2147('0x45')]({'where':{'id':_0x407f17[_0x2147('0x49')]['id']}})[_0x2147('0x22')](handleEntityNotFound(_0xd4d18c,null))[_0x2147('0x22')](saveUpdates(_0x407f17['body'],null))['then'](respondWithResult(_0xd4d18c,null))['catch'](handleError(_0xd4d18c,null));};exports[_0x2147('0x23')]=function(_0x54f857,_0x3b4565){return db[_0x2147('0x40')][_0x2147('0x45')]({'where':{'id':_0x54f857['params']['id']}})['then'](handleEntityNotFound(_0x3b4565,null))[_0x2147('0x22')](removeEntity(_0x3b4565,null))[_0x2147('0x43')](handleError(_0x3b4565,null));};exports['bulkDestroy']=function(_0x4e2559,_0x532224){return db['AnalyticFieldReport'][_0x2147('0x23')]({'where':{'id':_0x4e2559[_0x2147('0x2f')][_0x2147('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x2147('0x22')](respondWithResult(_0x532224,0xcc))[_0x2147('0x43')](handleError(_0x532224,null));};exports['addFields']=function(_0x34d070,_0x59610d,_0x41229b){return db['AnalyticCustomReport'][_0x2147('0x4b')]({'where':{'id':_0x34d070[_0x2147('0x49')]['id']}})[_0x2147('0x22')](handleEntityNotFound(_0x59610d,null))[_0x2147('0x22')](function(_0x3f54c1){if(_0x3f54c1){return db[_0x2147('0x4c')][_0x2147('0x4d')](function(_0x3273ee){return db[_0x2147('0x40')][_0x2147('0x23')]({'where':{'CustomReportId':_0x34d070[_0x2147('0x49')]['id']},'transaction':_0x3273ee})['then'](function(_0x41d781){var _0xe0f4db=_['map'](_0x34d070[_0x2147('0x48')],function(_0x4487fb){delete _0x4487fb['id'];_0x4487fb[_0x2147('0x4e')]=_0x34d070[_0x2147('0x49')]['id'];return _0x4487fb;});return db[_0x2147('0x40')][_0x2147('0x47')](_0xe0f4db,{'transaction':_0x3273ee});});})[_0x2147('0x22')](function(){return db['AnalyticFieldReport'][_0x2147('0x4f')]({'where':{'CustomReportId':_0x34d070['params']['id']}});});}})['then'](respondWithResult(_0x59610d,null))['catch'](handleError(_0x59610d,null));}; \ No newline at end of file +var _0x6302=['intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','where','merge','VIRTUAL','filter','options','rows','catch','show','params','rawAttributes','keys','includeAll','include','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','apply','reject','save','update','then','destroy','error','stack','name','send','map','AnalyticFieldReport','type','model','query','filters'];(function(_0x8d867c,_0xb5256a){var _0x52e8d5=function(_0x2e03e7){while(--_0x2e03e7){_0x8d867c['push'](_0x8d867c['shift']());}};_0x52e8d5(++_0xb5256a);}(_0x6302,0x109));var _0x2630=function(_0x49f6d1,_0x160fda){_0x49f6d1=_0x49f6d1-0x0;var _0x531a23=_0x6302[_0x49f6d1];return _0x531a23;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2630('0x0'));var rimraf=require(_0x2630('0x1'));var zipdir=require(_0x2630('0x2'));var jsonpatch=require(_0x2630('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2630('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2630('0x5'));var sox=require(_0x2630('0x6'));var csv=require(_0x2630('0x7'));var ejs=require(_0x2630('0x8'));var fs=require('fs');var _=require(_0x2630('0x9'));var squel=require(_0x2630('0xa'));var crypto=require(_0x2630('0xb'));var jsforce=require(_0x2630('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2630('0xd'));var Papa=require(_0x2630('0xe'));var Redis=require('ioredis');var authService=require(_0x2630('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2630('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2630('0x11'))(_0x2630('0x12'));var utils=require(_0x2630('0x13'));var config=require(_0x2630('0x14'));var db=require(_0x2630('0x15'))['db'];function respondWithStatusCode(_0x1ed3a2,_0x50b8e5){_0x50b8e5=_0x50b8e5||0xcc;return function(_0x4424c1){if(_0x4424c1){return _0x1ed3a2[_0x2630('0x16')](_0x50b8e5);}return _0x1ed3a2[_0x2630('0x17')](_0x50b8e5)[_0x2630('0x18')]();};}function respondWithResult(_0x4866f2,_0x33f40d){_0x33f40d=_0x33f40d||0xc8;return function(_0x467d72){if(_0x467d72){return _0x4866f2[_0x2630('0x17')](_0x33f40d)['json'](_0x467d72);}};}function respondWithFilteredResult(_0x15ada2,_0x53b1d2){return function(_0x1e4731){if(_0x1e4731){var _0x37c8d7=_0x1e4731[_0x2630('0x19')],_0x3b1b78=_0x53b1d2[_0x2630('0x1a')],_0x249507=_0x53b1d2[_0x2630('0x1a')]+_0x53b1d2['limit'],_0x157d35;if(_0x249507>=_0x37c8d7){_0x249507=_0x37c8d7;_0x157d35=0xc8;}else{_0x157d35=0xce;}_0x15ada2[_0x2630('0x17')](_0x157d35);return _0x15ada2['set']('Content-Range',_0x3b1b78+'-'+_0x249507+'/'+_0x37c8d7)['json'](_0x1e4731);}return null;};}function patchUpdates(_0x17d98b){return function(_0xa4f917){try{jsonpatch[_0x2630('0x1b')](_0xa4f917,_0x17d98b,!![]);}catch(_0x7c443c){return BPromise[_0x2630('0x1c')](_0x7c443c);}return _0xa4f917[_0x2630('0x1d')]();};}function saveUpdates(_0x4364a0,_0x608d15){return function(_0x13b5d5){if(_0x13b5d5){return _0x13b5d5[_0x2630('0x1e')](_0x4364a0)[_0x2630('0x1f')](function(_0x285f17){return _0x285f17;});}return null;};}function removeEntity(_0x5de075,_0x47a037){return function(_0x2c4a50){if(_0x2c4a50){return _0x2c4a50[_0x2630('0x20')]()['then'](function(){_0x5de075[_0x2630('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x452a9c,_0x3d303a){return function(_0xafc7c6){if(!_0xafc7c6){_0x452a9c[_0x2630('0x16')](0x194);}return _0xafc7c6;};}function handleError(_0x57f7e6,_0x3a9e7f){_0x3a9e7f=_0x3a9e7f||0x1f4;return function(_0x3d53c6){logger[_0x2630('0x21')](_0x3d53c6[_0x2630('0x22')]);if(_0x3d53c6[_0x2630('0x23')]){delete _0x3d53c6[_0x2630('0x23')];}_0x57f7e6[_0x2630('0x17')](_0x3a9e7f)[_0x2630('0x24')](_0x3d53c6);};}exports['index']=function(_0x5497d9,_0x1e57d6){var _0x3c654c={},_0x41c2c3={},_0x4afd2f={'count':0x0,'rows':[]};var _0x10d4ce=_[_0x2630('0x25')](db[_0x2630('0x26')]['rawAttributes'],function(_0x3ad356){return{'name':_0x3ad356['fieldName'],'type':_0x3ad356[_0x2630('0x27')]['key']};});_0x41c2c3[_0x2630('0x28')]=_[_0x2630('0x25')](_0x10d4ce,'name');_0x41c2c3[_0x2630('0x29')]=_['keys'](_0x5497d9['query']);_0x41c2c3[_0x2630('0x2a')]=_[_0x2630('0x2b')](_0x41c2c3['model'],_0x41c2c3[_0x2630('0x29')]);_0x3c654c[_0x2630('0x2c')]=_[_0x2630('0x2b')](_0x41c2c3[_0x2630('0x28')],qs[_0x2630('0x2d')](_0x5497d9[_0x2630('0x29')][_0x2630('0x2d')]));_0x3c654c['attributes']=_0x3c654c[_0x2630('0x2c')][_0x2630('0x2e')]?_0x3c654c['attributes']:_0x41c2c3[_0x2630('0x28')];if(!_0x5497d9['query'][_0x2630('0x2f')]('nolimit')){_0x3c654c['limit']=qs[_0x2630('0x30')](_0x5497d9[_0x2630('0x29')][_0x2630('0x30')]);_0x3c654c['offset']=qs[_0x2630('0x1a')](_0x5497d9[_0x2630('0x29')]['offset']);}_0x3c654c[_0x2630('0x31')]=qs[_0x2630('0x32')](_0x5497d9['query'][_0x2630('0x32')]);_0x3c654c['where']=qs[_0x2630('0x2a')](_[_0x2630('0x33')](_0x5497d9['query'],_0x41c2c3[_0x2630('0x2a')]));if(_0x5497d9[_0x2630('0x29')]['filter']){_0x3c654c[_0x2630('0x34')]=_[_0x2630('0x35')](_0x3c654c[_0x2630('0x34')],{'$or':_[_0x2630('0x25')](_0x10d4ce,function(_0x1cb15d){if(_0x1cb15d[_0x2630('0x27')]!==_0x2630('0x36')){var _0x3b856b={};_0x3b856b[_0x1cb15d[_0x2630('0x23')]]={'$like':'%'+_0x5497d9['query'][_0x2630('0x37')]+'%'};return _0x3b856b;}})});}_0x3c654c=_['merge']({},_0x3c654c,_0x5497d9[_0x2630('0x38')]);var _0x3d7106={'where':_0x3c654c[_0x2630('0x34')]};return db[_0x2630('0x26')][_0x2630('0x19')](_0x3d7106)[_0x2630('0x1f')](function(_0x53d2bb){_0x4afd2f[_0x2630('0x19')]=_0x53d2bb;if(_0x5497d9[_0x2630('0x29')]['includeAll']){_0x3c654c['include']=[{'all':!![]}];}return db[_0x2630('0x26')]['findAll'](_0x3c654c);})[_0x2630('0x1f')](function(_0x15c0a0){_0x4afd2f[_0x2630('0x39')]=_0x15c0a0;return _0x4afd2f;})['then'](respondWithFilteredResult(_0x1e57d6,_0x3c654c))[_0x2630('0x3a')](handleError(_0x1e57d6,null));};exports[_0x2630('0x3b')]=function(_0x49197c,_0x512a6a){var _0x181fec={'raw':![],'where':{'id':_0x49197c[_0x2630('0x3c')]['id']}},_0x27db44={};_0x27db44[_0x2630('0x28')]=_['keys'](db[_0x2630('0x26')][_0x2630('0x3d')]);_0x27db44[_0x2630('0x29')]=_[_0x2630('0x3e')](_0x49197c[_0x2630('0x29')]);_0x27db44[_0x2630('0x2a')]=_[_0x2630('0x2b')](_0x27db44['model'],_0x27db44[_0x2630('0x29')]);_0x181fec[_0x2630('0x2c')]=_[_0x2630('0x2b')](_0x27db44[_0x2630('0x28')],qs[_0x2630('0x2d')](_0x49197c[_0x2630('0x29')][_0x2630('0x2d')]));_0x181fec[_0x2630('0x2c')]=_0x181fec['attributes']['length']?_0x181fec[_0x2630('0x2c')]:_0x27db44[_0x2630('0x28')];if(_0x49197c[_0x2630('0x29')][_0x2630('0x3f')]){_0x181fec[_0x2630('0x40')]=[{'all':!![]}];}_0x181fec=_['merge']({},_0x181fec,_0x49197c[_0x2630('0x38')]);return db['AnalyticFieldReport'][_0x2630('0x41')](_0x181fec)['then'](handleEntityNotFound(_0x512a6a,null))[_0x2630('0x1f')](respondWithResult(_0x512a6a,null))[_0x2630('0x3a')](handleError(_0x512a6a,null));};exports[_0x2630('0x42')]=function(_0x325440,_0x489994){return db[_0x2630('0x26')][_0x2630('0x42')](_0x325440[_0x2630('0x43')],{})['then'](respondWithResult(_0x489994,0xc9))[_0x2630('0x3a')](handleError(_0x489994,null));};exports[_0x2630('0x44')]=function(_0x21b87c,_0x252115){return db['AnalyticFieldReport'][_0x2630('0x44')](_0x21b87c[_0x2630('0x43')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x252115,0xc9))['catch'](handleError(_0x252115,null));};exports[_0x2630('0x1e')]=function(_0x35a0e5,_0x58efcb){if(_0x35a0e5[_0x2630('0x43')]['id']){delete _0x35a0e5[_0x2630('0x43')]['id'];}return db[_0x2630('0x26')]['find']({'where':{'id':_0x35a0e5[_0x2630('0x3c')]['id']}})[_0x2630('0x1f')](handleEntityNotFound(_0x58efcb,null))['then'](saveUpdates(_0x35a0e5['body'],null))['then'](respondWithResult(_0x58efcb,null))[_0x2630('0x3a')](handleError(_0x58efcb,null));};exports[_0x2630('0x20')]=function(_0x524ebd,_0x5b0bad){return db[_0x2630('0x26')]['find']({'where':{'id':_0x524ebd[_0x2630('0x3c')]['id']}})[_0x2630('0x1f')](handleEntityNotFound(_0x5b0bad,null))[_0x2630('0x1f')](removeEntity(_0x5b0bad,null))[_0x2630('0x3a')](handleError(_0x5b0bad,null));};exports[_0x2630('0x45')]=function(_0x24c41b,_0x11ced0){return db[_0x2630('0x26')][_0x2630('0x20')]({'where':{'id':_0x24c41b[_0x2630('0x29')][_0x2630('0x46')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x11ced0,0xcc))['catch'](handleError(_0x11ced0,null));};exports[_0x2630('0x47')]=function(_0x38822e,_0x53cdac,_0x2318f6){return db[_0x2630('0x48')][_0x2630('0x49')]({'where':{'id':_0x38822e[_0x2630('0x3c')]['id']}})[_0x2630('0x1f')](handleEntityNotFound(_0x53cdac,null))[_0x2630('0x1f')](function(_0x5c55c4){if(_0x5c55c4){return db[_0x2630('0x4a')]['transaction'](function(_0x5cb234){return db[_0x2630('0x26')]['destroy']({'where':{'CustomReportId':_0x38822e[_0x2630('0x3c')]['id']},'transaction':_0x5cb234})[_0x2630('0x1f')](function(_0x4b4509){var _0x268028=_[_0x2630('0x25')](_0x38822e[_0x2630('0x43')],function(_0x370431){delete _0x370431['id'];_0x370431[_0x2630('0x4b')]=_0x38822e[_0x2630('0x3c')]['id'];return _0x370431;});return db[_0x2630('0x26')][_0x2630('0x44')](_0x268028,{'transaction':_0x5cb234});});})[_0x2630('0x1f')](function(){return db[_0x2630('0x26')][_0x2630('0x4c')]({'where':{'CustomReportId':_0x38822e['params']['id']}});});}})[_0x2630('0x1f')](respondWithResult(_0x53cdac,null))[_0x2630('0x3a')](handleError(_0x53cdac,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 3f3bc24..18044d9 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 _0x5d3e=['rimraf','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','request-promise','path'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x5d3e,0x15d));var _0xe5d3=function(_0x568bde,_0x328f01){_0x568bde=_0x568bde-0x0;var _0x4cc2a0=_0x5d3e[_0x568bde];return _0x4cc2a0;};'use strict';var _=require(_0xe5d3('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe5d3('0x1'));var fs=require('fs');var path=require(_0xe5d3('0x2'));var rimraf=require(_0xe5d3('0x3'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0xe5d3('0x4')]=function(_0x496b92,_0x461b40){return _0x496b92[_0xe5d3('0x5')](_0xe5d3('0x6'),attributes,{'tableName':_0xe5d3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd71=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','AnalyticFieldReport','analytics_report_fields'];(function(_0xeb67d8,_0x14a337){var _0x4138f9=function(_0x3b0407){while(--_0x3b0407){_0xeb67d8['push'](_0xeb67d8['shift']());}};_0x4138f9(++_0x14a337);}(_0xdd71,0x1b8));var _0x1dd7=function(_0x5011cd,_0x36bec4){_0x5011cd=_0x5011cd-0x0;var _0x9b67e5=_0xdd71[_0x5011cd];return _0x9b67e5;};'use strict';var _=require('lodash');var util=require(_0x1dd7('0x0'));var logger=require(_0x1dd7('0x1'))(_0x1dd7('0x2'));var moment=require(_0x1dd7('0x3'));var BPromise=require('bluebird');var rp=require(_0x1dd7('0x4'));var fs=require('fs');var path=require(_0x1dd7('0x5'));var rimraf=require(_0x1dd7('0x6'));var config=require(_0x1dd7('0x7'));var attributes=require('./analyticFieldReport.attributes');module[_0x1dd7('0x8')]=function(_0x161d0c,_0x215ffb){return _0x161d0c['define'](_0x1dd7('0x9'),attributes,{'tableName':_0x1dd7('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 bea8db7..9d80f28 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 _0xc8b4=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','stringify','error','AnalyticFieldReport,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','moment'];(function(_0x128d15,_0xf6f86c){var _0x2be577=function(_0x270ec5){while(--_0x270ec5){_0x128d15['push'](_0x128d15['shift']());}};_0x2be577(++_0xf6f86c);}(_0xc8b4,0x1f1));var _0x4c8b=function(_0x54852a,_0x3fe89b){_0x54852a=_0x54852a-0x0;var _0x101863=_0xc8b4[_0x54852a];return _0x101863;};'use strict';var _=require(_0x4c8b('0x0'));var util=require(_0x4c8b('0x1'));var moment=require(_0x4c8b('0x2'));var BPromise=require(_0x4c8b('0x3'));var rs=require(_0x4c8b('0x4'));var fs=require('fs');var Redis=require(_0x4c8b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c8b('0x6'));var logger=require(_0x4c8b('0x7'))(_0x4c8b('0x8'));var config=require('../../config/environment');var jayson=require(_0x4c8b('0x9'));var client=jayson[_0x4c8b('0xa')][_0x4c8b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47109e,_0x412443,_0xcf2074){return new BPromise(function(_0x42436c,_0x1fc0d3){return client['request'](_0x47109e,_0xcf2074)[_0x4c8b('0xc')](function(_0x501c59){logger[_0x4c8b('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x412443,'request\x20sent');logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x412443,'request\x20sent',JSON[_0x4c8b('0xe')](_0x501c59));if(_0x501c59['error']){if(_0x501c59[_0x4c8b('0xf')]['code']===0x1f4){logger[_0x4c8b('0xf')](_0x4c8b('0x10'),_0x412443,_0x501c59[_0x4c8b('0xf')]['message']);return _0x1fc0d3(_0x501c59['error'][_0x4c8b('0x11')]);}logger[_0x4c8b('0xf')](_0x4c8b('0x10'),_0x412443,_0x501c59[_0x4c8b('0xf')]['message']);return _0x42436c(_0x501c59[_0x4c8b('0xf')][_0x4c8b('0x11')]);}else{logger[_0x4c8b('0xd')](_0x4c8b('0x10'),_0x412443,_0x4c8b('0x12'));_0x42436c(_0x501c59[_0x4c8b('0x13')]['message']);}})['catch'](function(_0x558cd1){logger[_0x4c8b('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x412443,_0x558cd1);_0x1fc0d3(_0x558cd1);});});} \ No newline at end of file +var _0xd510=['AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xd510,0x1bb));var _0x0d51=function(_0xa3fadc,_0xd1e16){_0xa3fadc=_0xa3fadc-0x0;var _0x23ecb8=_0xd510[_0xa3fadc];return _0x23ecb8;};'use strict';var _=require(_0x0d51('0x0'));var util=require(_0x0d51('0x1'));var moment=require(_0x0d51('0x2'));var BPromise=require(_0x0d51('0x3'));var rs=require(_0x0d51('0x4'));var fs=require('fs');var Redis=require(_0x0d51('0x5'));var db=require(_0x0d51('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d51('0x7'))(_0x0d51('0x8'));var config=require(_0x0d51('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0d51('0xa')][_0x0d51('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x51de71,_0x4f2414,_0x44e0ce){return new BPromise(function(_0xacc833,_0x58c4d9){return client[_0x0d51('0xc')](_0x51de71,_0x44e0ce)['then'](function(_0x92f694){logger[_0x0d51('0xd')](_0x0d51('0xe'),_0x4f2414,_0x0d51('0xf'));logger[_0x0d51('0x10')](_0x0d51('0x11'),_0x4f2414,_0x0d51('0xf'),JSON[_0x0d51('0x12')](_0x92f694));if(_0x92f694[_0x0d51('0x13')]){if(_0x92f694[_0x0d51('0x13')][_0x0d51('0x14')]===0x1f4){logger[_0x0d51('0x13')](_0x0d51('0xe'),_0x4f2414,_0x92f694[_0x0d51('0x13')][_0x0d51('0x15')]);return _0x58c4d9(_0x92f694[_0x0d51('0x13')][_0x0d51('0x15')]);}logger['error'](_0x0d51('0xe'),_0x4f2414,_0x92f694[_0x0d51('0x13')]['message']);return _0xacc833(_0x92f694[_0x0d51('0x13')][_0x0d51('0x15')]);}else{logger[_0x0d51('0xd')](_0x0d51('0xe'),_0x4f2414,_0x0d51('0xf'));_0xacc833(_0x92f694['result'][_0x0d51('0x15')]);}})[_0x0d51('0x16')](function(_0x4cda4c){logger['error'](_0x0d51('0xe'),_0x4f2414,_0x4cda4c);_0x58c4d9(_0x4cda4c);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index bd0f9a1..e7c17e7 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(_0x445b03,_0x964cd6){var _0x5015d8=function(_0x51c008){while(--_0x51c008){_0x445b03['push'](_0x445b03['shift']());}};_0x5015d8(++_0x964cd6);}(_0x814b,0x1a2));var _0xb814=function(_0x1de43c,_0xaa29de){_0x1de43c=_0x1de43c-0x0;var _0x296d3e=_0x814b[_0x1de43c];return _0x296d3e;};'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 _0xe14b=['addFields','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','/create_many','bulkCreate'];(function(_0x578a25,_0x368f7a){var _0x2a6ec0=function(_0x40bde6){while(--_0x40bde6){_0x578a25['push'](_0x578a25['shift']());}};_0x2a6ec0(++_0x368f7a);}(_0xe14b,0x93));var _0xbe14=function(_0x3085ac,_0x213af0){_0x3085ac=_0x3085ac-0x0;var _0x37f39b=_0xe14b[_0x3085ac];return _0x37f39b;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbe14('0x4'));var config=require('../../config/environment');var controller=require('./analyticFieldReport.controller');router[_0xbe14('0x5')]('/',auth[_0xbe14('0x6')](),controller[_0xbe14('0x7')]);router[_0xbe14('0x5')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xbe14('0xa')](_0xbe14('0xb'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xc')]);router['post']('/:id/create_many',auth[_0xbe14('0x6')](),controller[_0xbe14('0xd')]);router['put'](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xe')]);router[_0xbe14('0xf')](_0xbe14('0x10'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x11')]);router[_0xbe14('0xf')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x12')]);module[_0xbe14('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index b8c286b..de72911 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 _0x8ba2=['exports','STRING','TEXT','sequelize'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8ba2,0x13f));var _0x28ba=function(_0x488237,_0x33c515){_0x488237=_0x488237-0x0;var _0x16e5c8=_0x8ba2[_0x488237];return _0x16e5c8;};'use strict';var Sequelize=require(_0x28ba('0x0'));module[_0x28ba('0x1')]={'name':{'type':Sequelize[_0x28ba('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x28ba('0x2')]},'metric':{'type':Sequelize[_0x28ba('0x3')]},'description':{'type':Sequelize[_0x28ba('0x2')]}}; \ No newline at end of file +var _0x84a0=['name','TEXT','sequelize','exports','STRING'];(function(_0xc65a41,_0x380474){var _0x64b3d8=function(_0x38a959){while(--_0x38a959){_0xc65a41['push'](_0xc65a41['shift']());}};_0x64b3d8(++_0x380474);}(_0x84a0,0x66));var _0x084a=function(_0x1eebe4,_0x27f7b4){_0x1eebe4=_0x1eebe4-0x0;var _0x46f639=_0x84a0[_0x1eebe4];return _0x46f639;};'use strict';var Sequelize=require(_0x084a('0x0'));module[_0x084a('0x1')]={'name':{'type':Sequelize[_0x084a('0x2')],'allowNull':![],'unique':_0x084a('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x084a('0x4')]},'description':{'type':Sequelize[_0x084a('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 7c8f822..bf0aee9 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 _0xaea4=['status','end','json','offset','apply','reject','save','update','destroy','then','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','VIRTUAL','options','count','includeAll','findAll','catch','show','params','include','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xaea4,0x17e));var _0x4aea=function(_0x3b155e,_0x2e6292){_0x3b155e=_0x3b155e-0x0;var _0x4269a1=_0xaea4[_0x3b155e];return _0x4269a1;};'use strict';var pdf=require(_0x4aea('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4aea('0x1'));var zipdir=require(_0x4aea('0x2'));var jsonpatch=require(_0x4aea('0x3'));var rp=require(_0x4aea('0x4'));var moment=require(_0x4aea('0x5'));var BPromise=require(_0x4aea('0x6'));var Mustache=require('mustache');var util=require(_0x4aea('0x7'));var path=require(_0x4aea('0x8'));var sox=require(_0x4aea('0x9'));var csv=require(_0x4aea('0xa'));var ejs=require(_0x4aea('0xb'));var fs=require('fs');var _=require(_0x4aea('0xc'));var squel=require(_0x4aea('0xd'));var crypto=require(_0x4aea('0xe'));var jsforce=require(_0x4aea('0xf'));var deskjs=require(_0x4aea('0x10'));var toCsv=require('to-csv');var querystring=require(_0x4aea('0x11'));var Papa=require(_0x4aea('0x12'));var Redis=require(_0x4aea('0x13'));var authService=require(_0x4aea('0x14'));var qs=require(_0x4aea('0x15'));var as=require(_0x4aea('0x16'));var hardwareService=require(_0x4aea('0x17'));var logger=require(_0x4aea('0x18'))(_0x4aea('0x19'));var utils=require(_0x4aea('0x1a'));var config=require(_0x4aea('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e694d,_0x371fe6){_0x371fe6=_0x371fe6||0xcc;return function(_0x3fb238){if(_0x3fb238){return _0x2e694d['sendStatus'](_0x371fe6);}return _0x2e694d[_0x4aea('0x1c')](_0x371fe6)[_0x4aea('0x1d')]();};}function respondWithResult(_0x3e5637,_0x533013){_0x533013=_0x533013||0xc8;return function(_0x1d10a1){if(_0x1d10a1){return _0x3e5637['status'](_0x533013)[_0x4aea('0x1e')](_0x1d10a1);}};}function respondWithFilteredResult(_0x5f1810,_0x5c3d1e){return function(_0x399433){if(_0x399433){var _0x5300c3=_0x399433['count'],_0x3d592c=_0x5c3d1e[_0x4aea('0x1f')],_0x18a908=_0x5c3d1e[_0x4aea('0x1f')]+_0x5c3d1e['limit'],_0x3b3c8e;if(_0x18a908>=_0x5300c3){_0x18a908=_0x5300c3;_0x3b3c8e=0xc8;}else{_0x3b3c8e=0xce;}_0x5f1810[_0x4aea('0x1c')](_0x3b3c8e);return _0x5f1810['set']('Content-Range',_0x3d592c+'-'+_0x18a908+'/'+_0x5300c3)['json'](_0x399433);}return null;};}function patchUpdates(_0x93f75a){return function(_0x57b884){try{jsonpatch[_0x4aea('0x20')](_0x57b884,_0x93f75a,!![]);}catch(_0x2231f2){return BPromise[_0x4aea('0x21')](_0x2231f2);}return _0x57b884[_0x4aea('0x22')]();};}function saveUpdates(_0x3ee6d8,_0x1f356c){return function(_0x585c8f){if(_0x585c8f){return _0x585c8f[_0x4aea('0x23')](_0x3ee6d8)['then'](function(_0xb69621){return _0xb69621;});}return null;};}function removeEntity(_0x254563,_0x335d88){return function(_0x39d711){if(_0x39d711){return _0x39d711[_0x4aea('0x24')]()[_0x4aea('0x25')](function(){var _0x1bf0aa=_0x39d711[_0x4aea('0x26')]({'plain':!![]});var _0x109261=_0x4aea('0x27');return db[_0x4aea('0x28')][_0x4aea('0x24')]({'where':{'type':_0x109261,'resourceId':_0x1bf0aa['id']}})[_0x4aea('0x25')](function(){return _0x39d711;});})[_0x4aea('0x25')](function(){_0x254563['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x50c1b4,_0xc806d1){return function(_0x51ec63){if(!_0x51ec63){_0x50c1b4[_0x4aea('0x29')](0x194);}return _0x51ec63;};}function handleError(_0x52f64f,_0x18be3f){_0x18be3f=_0x18be3f||0x1f4;return function(_0x2e0908){logger[_0x4aea('0x2a')](_0x2e0908[_0x4aea('0x2b')]);if(_0x2e0908[_0x4aea('0x2c')]){delete _0x2e0908['name'];}_0x52f64f[_0x4aea('0x1c')](_0x18be3f)[_0x4aea('0x2d')](_0x2e0908);};}exports[_0x4aea('0x2e')]=function(_0x4103a9,_0x43cf4a){var _0x241c1f={},_0x5dbe2e={},_0x4f9842={'count':0x0,'rows':[]};var _0x1b8516=_[_0x4aea('0x2f')](db[_0x4aea('0x30')][_0x4aea('0x31')],function(_0x2236dc){return{'name':_0x2236dc['fieldName'],'type':_0x2236dc['type'][_0x4aea('0x32')]};});_0x5dbe2e['model']=_[_0x4aea('0x2f')](_0x1b8516,'name');_0x5dbe2e[_0x4aea('0x33')]=_[_0x4aea('0x34')](_0x4103a9[_0x4aea('0x33')]);_0x5dbe2e[_0x4aea('0x35')]=_['intersection'](_0x5dbe2e[_0x4aea('0x36')],_0x5dbe2e[_0x4aea('0x33')]);_0x241c1f[_0x4aea('0x37')]=_[_0x4aea('0x38')](_0x5dbe2e[_0x4aea('0x36')],qs[_0x4aea('0x39')](_0x4103a9[_0x4aea('0x33')][_0x4aea('0x39')]));_0x241c1f[_0x4aea('0x37')]=_0x241c1f['attributes'][_0x4aea('0x3a')]?_0x241c1f['attributes']:_0x5dbe2e[_0x4aea('0x36')];if(!_0x4103a9[_0x4aea('0x33')][_0x4aea('0x3b')]('nolimit')){_0x241c1f['limit']=qs[_0x4aea('0x3c')](_0x4103a9[_0x4aea('0x33')][_0x4aea('0x3c')]);_0x241c1f[_0x4aea('0x1f')]=qs[_0x4aea('0x1f')](_0x4103a9[_0x4aea('0x33')]['offset']);}_0x241c1f[_0x4aea('0x3d')]=qs[_0x4aea('0x3e')](_0x4103a9[_0x4aea('0x33')]['sort']);_0x241c1f[_0x4aea('0x3f')]=qs[_0x4aea('0x35')](_['pick'](_0x4103a9['query'],_0x5dbe2e['filters']));if(_0x4103a9[_0x4aea('0x33')]['filter']){_0x241c1f[_0x4aea('0x3f')]=_['merge'](_0x241c1f[_0x4aea('0x3f')],{'$or':_[_0x4aea('0x2f')](_0x1b8516,function(_0x50dbb4){if(_0x50dbb4['type']!==_0x4aea('0x40')){var _0x3d94a2={};_0x3d94a2[_0x50dbb4['name']]={'$like':'%'+_0x4103a9[_0x4aea('0x33')]['filter']+'%'};return _0x3d94a2;}})});}_0x241c1f=_['merge']({},_0x241c1f,_0x4103a9[_0x4aea('0x41')]);var _0x20c979={'where':_0x241c1f[_0x4aea('0x3f')]};return db[_0x4aea('0x30')]['count'](_0x20c979)[_0x4aea('0x25')](function(_0x3cde71){_0x4f9842[_0x4aea('0x42')]=_0x3cde71;if(_0x4103a9[_0x4aea('0x33')][_0x4aea('0x43')]){_0x241c1f['include']=[{'all':!![]}];}return db[_0x4aea('0x30')][_0x4aea('0x44')](_0x241c1f);})[_0x4aea('0x25')](function(_0x54f87a){_0x4f9842['rows']=_0x54f87a;return _0x4f9842;})[_0x4aea('0x25')](respondWithFilteredResult(_0x43cf4a,_0x241c1f))[_0x4aea('0x45')](handleError(_0x43cf4a,null));};exports[_0x4aea('0x46')]=function(_0x309e7c,_0x50e508){var _0x5af81e={'raw':!![],'where':{'id':_0x309e7c[_0x4aea('0x47')]['id']}},_0xc943bc={};_0xc943bc['model']=_[_0x4aea('0x34')](db[_0x4aea('0x30')][_0x4aea('0x31')]);_0xc943bc[_0x4aea('0x33')]=_[_0x4aea('0x34')](_0x309e7c[_0x4aea('0x33')]);_0xc943bc[_0x4aea('0x35')]=_[_0x4aea('0x38')](_0xc943bc[_0x4aea('0x36')],_0xc943bc[_0x4aea('0x33')]);_0x5af81e[_0x4aea('0x37')]=_[_0x4aea('0x38')](_0xc943bc['model'],qs[_0x4aea('0x39')](_0x309e7c[_0x4aea('0x33')]['fields']));_0x5af81e[_0x4aea('0x37')]=_0x5af81e[_0x4aea('0x37')][_0x4aea('0x3a')]?_0x5af81e[_0x4aea('0x37')]:_0xc943bc[_0x4aea('0x36')];if(_0x309e7c['query'][_0x4aea('0x43')]){_0x5af81e[_0x4aea('0x48')]=[{'all':!![]}];}_0x5af81e=_[_0x4aea('0x49')]({},_0x5af81e,_0x309e7c[_0x4aea('0x41')]);return db[_0x4aea('0x30')]['find'](_0x5af81e)['then'](handleEntityNotFound(_0x50e508,null))[_0x4aea('0x25')](respondWithResult(_0x50e508,null))[_0x4aea('0x45')](handleError(_0x50e508,null));};exports[_0x4aea('0x4a')]=function(_0x1bd2c5,_0x50b759){return db['AnalyticMetric'][_0x4aea('0x4a')](_0x1bd2c5[_0x4aea('0x4b')],{})[_0x4aea('0x25')](function(_0x1d05b1){var _0x4c59e8=_0x1bd2c5[_0x4aea('0x4c')]['get']({'plain':!![]});if(!_0x4c59e8)throw new Error(_0x4aea('0x4d'));if(_0x4c59e8[_0x4aea('0x4e')]===_0x4aea('0x4c')){var _0x59626c=_0x1d05b1[_0x4aea('0x26')]({'plain':!![]});var _0x2078a2='Metrics';return db['UserProfileSection'][_0x4aea('0x4f')]({'where':{'name':_0x2078a2,'userProfileId':_0x4c59e8['userProfileId']},'raw':!![]})['then'](function(_0x50ea9d){if(_0x50ea9d&&_0x50ea9d[_0x4aea('0x50')]===0x0){return db[_0x4aea('0x28')]['create']({'name':_0x59626c[_0x4aea('0x2c')],'resourceId':_0x59626c['id'],'type':_0x50ea9d[_0x4aea('0x2c')],'sectionId':_0x50ea9d['id']},{})['then'](function(){return _0x1d05b1;});}else{return _0x1d05b1;}})[_0x4aea('0x45')](function(_0x5fe435){logger[_0x4aea('0x2a')](_0x4aea('0x51'),_0x5fe435);throw _0x5fe435;});}return _0x1d05b1;})[_0x4aea('0x25')](respondWithResult(_0x50b759,0xc9))[_0x4aea('0x45')](handleError(_0x50b759,null));};exports[_0x4aea('0x23')]=function(_0x576806,_0x518b08){if(_0x576806['body']['id']){delete _0x576806['body']['id'];}return db[_0x4aea('0x30')][_0x4aea('0x4f')]({'where':{'id':_0x576806['params']['id']}})[_0x4aea('0x25')](handleEntityNotFound(_0x518b08,null))[_0x4aea('0x25')](saveUpdates(_0x576806[_0x4aea('0x4b')],null))['then'](respondWithResult(_0x518b08,null))[_0x4aea('0x45')](handleError(_0x518b08,null));};exports['destroy']=function(_0x2cffb6,_0x5dd48f){return db[_0x4aea('0x30')][_0x4aea('0x4f')]({'where':{'id':_0x2cffb6['params']['id']}})[_0x4aea('0x25')](handleEntityNotFound(_0x5dd48f,null))[_0x4aea('0x25')](removeEntity(_0x5dd48f,null))[_0x4aea('0x45')](handleError(_0x5dd48f,null));}; \ No newline at end of file +var _0x080d=['catch','show','params','options','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','json','apply','save','update','destroy','then','Metrics','UserProfileResource','error','stack','index','map','rawAttributes','fieldName','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','AnalyticMetric','includeAll','include','findAll','rows'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0x080d,0x15f));var _0xd080=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x080d[_0x616290];return _0x453879;};'use strict';var pdf=require(_0xd080('0x0'));var emlformat=require(_0xd080('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd080('0x2'));var jsonpatch=require(_0xd080('0x3'));var rp=require('request-promise');var moment=require(_0xd080('0x4'));var BPromise=require(_0xd080('0x5'));var Mustache=require(_0xd080('0x6'));var util=require('util');var path=require(_0xd080('0x7'));var sox=require('sox');var csv=require(_0xd080('0x8'));var ejs=require(_0xd080('0x9'));var fs=require('fs');var _=require(_0xd080('0xa'));var squel=require(_0xd080('0xb'));var crypto=require(_0xd080('0xc'));var jsforce=require(_0xd080('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd080('0xe'));var Papa=require(_0xd080('0xf'));var Redis=require(_0xd080('0x10'));var authService=require(_0xd080('0x11'));var qs=require(_0xd080('0x12'));var as=require(_0xd080('0x13'));var hardwareService=require(_0xd080('0x14'));var logger=require(_0xd080('0x15'))(_0xd080('0x16'));var utils=require(_0xd080('0x17'));var config=require(_0xd080('0x18'));var db=require(_0xd080('0x19'))['db'];function respondWithStatusCode(_0x287045,_0x6ea33d){_0x6ea33d=_0x6ea33d||0xcc;return function(_0x2529c6){if(_0x2529c6){return _0x287045[_0xd080('0x1a')](_0x6ea33d);}return _0x287045['status'](_0x6ea33d)['end']();};}function respondWithResult(_0x5324e7,_0x3ba4fa){_0x3ba4fa=_0x3ba4fa||0xc8;return function(_0x4d3a65){if(_0x4d3a65){return _0x5324e7[_0xd080('0x1b')](_0x3ba4fa)['json'](_0x4d3a65);}};}function respondWithFilteredResult(_0x357694,_0x4fa753){return function(_0x2cd5ec){if(_0x2cd5ec){var _0x4e6d6b=_0x2cd5ec[_0xd080('0x1c')],_0x4acd52=_0x4fa753[_0xd080('0x1d')],_0x3349a3=_0x4fa753[_0xd080('0x1d')]+_0x4fa753[_0xd080('0x1e')],_0x1d6805;if(_0x3349a3>=_0x4e6d6b){_0x3349a3=_0x4e6d6b;_0x1d6805=0xc8;}else{_0x1d6805=0xce;}_0x357694[_0xd080('0x1b')](_0x1d6805);return _0x357694[_0xd080('0x1f')]('Content-Range',_0x4acd52+'-'+_0x3349a3+'/'+_0x4e6d6b)[_0xd080('0x20')](_0x2cd5ec);}return null;};}function patchUpdates(_0x1d269f){return function(_0x25ebb3){try{jsonpatch[_0xd080('0x21')](_0x25ebb3,_0x1d269f,!![]);}catch(_0x7a665d){return BPromise['reject'](_0x7a665d);}return _0x25ebb3[_0xd080('0x22')]();};}function saveUpdates(_0x3c6a46,_0x147db9){return function(_0x38d8a7){if(_0x38d8a7){return _0x38d8a7[_0xd080('0x23')](_0x3c6a46)['then'](function(_0x16b5d4){return _0x16b5d4;});}return null;};}function removeEntity(_0x5b1bd0,_0x4672f8){return function(_0x52d95e){if(_0x52d95e){return _0x52d95e[_0xd080('0x24')]()[_0xd080('0x25')](function(){var _0x4d471d=_0x52d95e['get']({'plain':!![]});var _0x2ed4ea=_0xd080('0x26');return db[_0xd080('0x27')][_0xd080('0x24')]({'where':{'type':_0x2ed4ea,'resourceId':_0x4d471d['id']}})['then'](function(){return _0x52d95e;});})[_0xd080('0x25')](function(){_0x5b1bd0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x37f195,_0x522524){return function(_0x124500){if(!_0x124500){_0x37f195[_0xd080('0x1a')](0x194);}return _0x124500;};}function handleError(_0x7d9d82,_0x569cc2){_0x569cc2=_0x569cc2||0x1f4;return function(_0x3dfbdf){logger[_0xd080('0x28')](_0x3dfbdf[_0xd080('0x29')]);if(_0x3dfbdf['name']){delete _0x3dfbdf['name'];}_0x7d9d82['status'](_0x569cc2)['send'](_0x3dfbdf);};}exports[_0xd080('0x2a')]=function(_0x14cda2,_0x33de33){var _0x571169={},_0x4b00d7={},_0x731a3={'count':0x0,'rows':[]};var _0x2b4e92=_[_0xd080('0x2b')](db['AnalyticMetric'][_0xd080('0x2c')],function(_0x4d1ade){return{'name':_0x4d1ade[_0xd080('0x2d')],'type':_0x4d1ade['type']['key']};});_0x4b00d7[_0xd080('0x2e')]=_[_0xd080('0x2b')](_0x2b4e92,_0xd080('0x2f'));_0x4b00d7[_0xd080('0x30')]=_[_0xd080('0x31')](_0x14cda2[_0xd080('0x30')]);_0x4b00d7[_0xd080('0x32')]=_[_0xd080('0x33')](_0x4b00d7['model'],_0x4b00d7[_0xd080('0x30')]);_0x571169[_0xd080('0x34')]=_[_0xd080('0x33')](_0x4b00d7[_0xd080('0x2e')],qs[_0xd080('0x35')](_0x14cda2['query'][_0xd080('0x35')]));_0x571169[_0xd080('0x34')]=_0x571169['attributes'][_0xd080('0x36')]?_0x571169[_0xd080('0x34')]:_0x4b00d7[_0xd080('0x2e')];if(!_0x14cda2['query'][_0xd080('0x37')](_0xd080('0x38'))){_0x571169[_0xd080('0x1e')]=qs[_0xd080('0x1e')](_0x14cda2[_0xd080('0x30')][_0xd080('0x1e')]);_0x571169[_0xd080('0x1d')]=qs['offset'](_0x14cda2[_0xd080('0x30')][_0xd080('0x1d')]);}_0x571169[_0xd080('0x39')]=qs[_0xd080('0x3a')](_0x14cda2[_0xd080('0x30')][_0xd080('0x3a')]);_0x571169[_0xd080('0x3b')]=qs['filters'](_['pick'](_0x14cda2[_0xd080('0x30')],_0x4b00d7['filters']));if(_0x14cda2['query'][_0xd080('0x3c')]){_0x571169[_0xd080('0x3b')]=_[_0xd080('0x3d')](_0x571169[_0xd080('0x3b')],{'$or':_[_0xd080('0x2b')](_0x2b4e92,function(_0x3c1b91){if(_0x3c1b91[_0xd080('0x3e')]!==_0xd080('0x3f')){var _0x497723={};_0x497723[_0x3c1b91['name']]={'$like':'%'+_0x14cda2[_0xd080('0x30')][_0xd080('0x3c')]+'%'};return _0x497723;}})});}_0x571169=_[_0xd080('0x3d')]({},_0x571169,_0x14cda2['options']);var _0x539ecc={'where':_0x571169[_0xd080('0x3b')]};return db[_0xd080('0x40')][_0xd080('0x1c')](_0x539ecc)['then'](function(_0x24608b){_0x731a3[_0xd080('0x1c')]=_0x24608b;if(_0x14cda2[_0xd080('0x30')][_0xd080('0x41')]){_0x571169[_0xd080('0x42')]=[{'all':!![]}];}return db['AnalyticMetric'][_0xd080('0x43')](_0x571169);})[_0xd080('0x25')](function(_0x29bbc7){_0x731a3[_0xd080('0x44')]=_0x29bbc7;return _0x731a3;})['then'](respondWithFilteredResult(_0x33de33,_0x571169))[_0xd080('0x45')](handleError(_0x33de33,null));};exports[_0xd080('0x46')]=function(_0x3754de,_0x27e983){var _0x4ecad={'raw':!![],'where':{'id':_0x3754de[_0xd080('0x47')]['id']}},_0xcbf0bf={};_0xcbf0bf[_0xd080('0x2e')]=_[_0xd080('0x31')](db['AnalyticMetric']['rawAttributes']);_0xcbf0bf[_0xd080('0x30')]=_[_0xd080('0x31')](_0x3754de[_0xd080('0x30')]);_0xcbf0bf[_0xd080('0x32')]=_[_0xd080('0x33')](_0xcbf0bf[_0xd080('0x2e')],_0xcbf0bf['query']);_0x4ecad[_0xd080('0x34')]=_[_0xd080('0x33')](_0xcbf0bf[_0xd080('0x2e')],qs[_0xd080('0x35')](_0x3754de['query'][_0xd080('0x35')]));_0x4ecad[_0xd080('0x34')]=_0x4ecad[_0xd080('0x34')]['length']?_0x4ecad['attributes']:_0xcbf0bf['model'];if(_0x3754de[_0xd080('0x30')][_0xd080('0x41')]){_0x4ecad[_0xd080('0x42')]=[{'all':!![]}];}_0x4ecad=_[_0xd080('0x3d')]({},_0x4ecad,_0x3754de[_0xd080('0x48')]);return db[_0xd080('0x40')]['find'](_0x4ecad)['then'](handleEntityNotFound(_0x27e983,null))[_0xd080('0x25')](respondWithResult(_0x27e983,null))[_0xd080('0x45')](handleError(_0x27e983,null));};exports['create']=function(_0x2216ff,_0x236f96){return db[_0xd080('0x40')]['create'](_0x2216ff[_0xd080('0x49')],{})[_0xd080('0x25')](function(_0x2db920){var _0x225f3b=_0x2216ff[_0xd080('0x4a')][_0xd080('0x4b')]({'plain':!![]});if(!_0x225f3b)throw new Error(_0xd080('0x4c'));if(_0x225f3b[_0xd080('0x4d')]==='user'){var _0x137ae8=_0x2db920['get']({'plain':!![]});var _0x740afa=_0xd080('0x26');return db[_0xd080('0x4e')][_0xd080('0x4f')]({'where':{'name':_0x740afa,'userProfileId':_0x225f3b[_0xd080('0x50')]},'raw':!![]})[_0xd080('0x25')](function(_0x2c7daf){if(_0x2c7daf&&_0x2c7daf[_0xd080('0x51')]===0x0){return db['UserProfileResource'][_0xd080('0x52')]({'name':_0x137ae8[_0xd080('0x2f')],'resourceId':_0x137ae8['id'],'type':_0x2c7daf[_0xd080('0x2f')],'sectionId':_0x2c7daf['id']},{})['then'](function(){return _0x2db920;});}else{return _0x2db920;}})['catch'](function(_0x379c0b){logger['error'](_0xd080('0x53'),_0x379c0b);throw _0x379c0b;});}return _0x2db920;})['then'](respondWithResult(_0x236f96,0xc9))[_0xd080('0x45')](handleError(_0x236f96,null));};exports[_0xd080('0x23')]=function(_0x4bc84a,_0x49a697){if(_0x4bc84a[_0xd080('0x49')]['id']){delete _0x4bc84a[_0xd080('0x49')]['id'];}return db[_0xd080('0x40')]['find']({'where':{'id':_0x4bc84a[_0xd080('0x47')]['id']}})[_0xd080('0x25')](handleEntityNotFound(_0x49a697,null))[_0xd080('0x25')](saveUpdates(_0x4bc84a[_0xd080('0x49')],null))[_0xd080('0x25')](respondWithResult(_0x49a697,null))[_0xd080('0x45')](handleError(_0x49a697,null));};exports[_0xd080('0x24')]=function(_0x213fe8,_0x1e6d73){return db['AnalyticMetric'][_0xd080('0x4f')]({'where':{'id':_0x213fe8['params']['id']}})[_0xd080('0x25')](handleEntityNotFound(_0x1e6d73,null))[_0xd080('0x25')](removeEntity(_0x1e6d73,null))[_0xd080('0x45')](handleError(_0x1e6d73,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 51fb8c6..bc747f8 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 _0xc7cc=['define','AnalyticMetric','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xc7cc,0x91));var _0xcc7c=function(_0x1ccaf0,_0x5014ea){_0x1ccaf0=_0x1ccaf0-0x0;var _0x5c5a34=_0xc7cc[_0x1ccaf0];return _0x5c5a34;};'use strict';var _=require(_0xcc7c('0x0'));var util=require(_0xcc7c('0x1'));var logger=require(_0xcc7c('0x2'))('api');var moment=require(_0xcc7c('0x3'));var BPromise=require(_0xcc7c('0x4'));var rp=require(_0xcc7c('0x5'));var fs=require('fs');var path=require(_0xcc7c('0x6'));var rimraf=require(_0xcc7c('0x7'));var config=require(_0xcc7c('0x8'));var attributes=require(_0xcc7c('0x9'));module[_0xcc7c('0xa')]=function(_0xe166a9,_0x82dc04){return _0xe166a9[_0xcc7c('0xb')](_0xcc7c('0xc'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x21e4=['../../config/logger','api','bluebird','request-promise','path','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util'];(function(_0xcfeff4,_0x3f2e19){var _0xb2fadc=function(_0x4cd013){while(--_0x4cd013){_0xcfeff4['push'](_0xcfeff4['shift']());}};_0xb2fadc(++_0x3f2e19);}(_0x21e4,0xa7));var _0x421e=function(_0x11d318,_0x3e6acf){_0x11d318=_0x11d318-0x0;var _0x5e5368=_0x21e4[_0x11d318];return _0x5e5368;};'use strict';var _=require(_0x421e('0x0'));var util=require(_0x421e('0x1'));var logger=require(_0x421e('0x2'))(_0x421e('0x3'));var moment=require('moment');var BPromise=require(_0x421e('0x4'));var rp=require(_0x421e('0x5'));var fs=require('fs');var path=require(_0x421e('0x6'));var rimraf=require(_0x421e('0x7'));var config=require('../../config/environment');var attributes=require(_0x421e('0x8'));module[_0x421e('0x9')]=function(_0x4a8c07,_0x89bbac){return _0x4a8c07[_0x421e('0xa')](_0x421e('0xb'),attributes,{'tableName':_0x421e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index c57a51a..1c17c02 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 _0x6c9c=['../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x46800d,_0x588500){var _0x3824cd=function(_0x14b132){while(--_0x14b132){_0x46800d['push'](_0x46800d['shift']());}};_0x3824cd(++_0x588500);}(_0x6c9c,0x99));var _0xc6c9=function(_0x583b1b,_0x100592){_0x583b1b=_0x583b1b-0x0;var _0x3338b7=_0x6c9c[_0x583b1b];return _0x3338b7;};'use strict';var _=require(_0xc6c9('0x0'));var util=require(_0xc6c9('0x1'));var moment=require(_0xc6c9('0x2'));var BPromise=require(_0xc6c9('0x3'));var rs=require(_0xc6c9('0x4'));var fs=require('fs');var Redis=require(_0xc6c9('0x5'));var db=require(_0xc6c9('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc6c9('0x7'));var config=require(_0xc6c9('0x8'));var jayson=require(_0xc6c9('0x9'));var client=jayson[_0xc6c9('0xa')][_0xc6c9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28df34,_0x308529,_0x1ca782){return new BPromise(function(_0x24cb4b,_0xf1de9e){return client[_0xc6c9('0xc')](_0x28df34,_0x1ca782)[_0xc6c9('0xd')](function(_0x483c9a){logger[_0xc6c9('0xe')](_0xc6c9('0xf'),_0x308529,_0xc6c9('0x10'));logger[_0xc6c9('0x11')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x308529,_0xc6c9('0x10'),JSON[_0xc6c9('0x12')](_0x483c9a));if(_0x483c9a[_0xc6c9('0x13')]){if(_0x483c9a[_0xc6c9('0x13')][_0xc6c9('0x14')]===0x1f4){logger['error'](_0xc6c9('0xf'),_0x308529,_0x483c9a[_0xc6c9('0x13')][_0xc6c9('0x15')]);return _0xf1de9e(_0x483c9a[_0xc6c9('0x13')]['message']);}logger[_0xc6c9('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x308529,_0x483c9a[_0xc6c9('0x13')][_0xc6c9('0x15')]);return _0x24cb4b(_0x483c9a[_0xc6c9('0x13')][_0xc6c9('0x15')]);}else{logger['info'](_0xc6c9('0xf'),_0x308529,'request\x20sent');_0x24cb4b(_0x483c9a[_0xc6c9('0x16')][_0xc6c9('0x15')]);}})['catch'](function(_0x3f9a72){logger['error'](_0xc6c9('0xf'),_0x308529,_0x3f9a72);_0xf1de9e(_0x3f9a72);});});} \ No newline at end of file +var _0xe255=['code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xd3c3c2,_0x542098){var _0x208e51=function(_0x5b0aa8){while(--_0x5b0aa8){_0xd3c3c2['push'](_0xd3c3c2['shift']());}};_0x208e51(++_0x542098);}(_0xe255,0x9e));var _0x5e25=function(_0x16c9d5,_0x588769){_0x16c9d5=_0x16c9d5-0x0;var _0x2bdcb7=_0xe255[_0x16c9d5];return _0x2bdcb7;};'use strict';var _=require(_0x5e25('0x0'));var util=require(_0x5e25('0x1'));var moment=require('moment');var BPromise=require(_0x5e25('0x2'));var rs=require(_0x5e25('0x3'));var fs=require('fs');var Redis=require(_0x5e25('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e25('0x5'));var logger=require('../../config/logger')(_0x5e25('0x6'));var config=require(_0x5e25('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5e25('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42a225,_0x150f70,_0x27ca38){return new BPromise(function(_0x5779b1,_0x4974b8){return client[_0x5e25('0x9')](_0x42a225,_0x27ca38)[_0x5e25('0xa')](function(_0x393744){logger[_0x5e25('0xb')](_0x5e25('0xc'),_0x150f70,_0x5e25('0xd'));logger[_0x5e25('0xe')](_0x5e25('0xf'),_0x150f70,_0x5e25('0xd'),JSON[_0x5e25('0x10')](_0x393744));if(_0x393744[_0x5e25('0x11')]){if(_0x393744[_0x5e25('0x11')][_0x5e25('0x12')]===0x1f4){logger['error'](_0x5e25('0xc'),_0x150f70,_0x393744[_0x5e25('0x11')][_0x5e25('0x13')]);return _0x4974b8(_0x393744[_0x5e25('0x11')]['message']);}logger['error'](_0x5e25('0xc'),_0x150f70,_0x393744['error'][_0x5e25('0x13')]);return _0x5779b1(_0x393744[_0x5e25('0x11')][_0x5e25('0x13')]);}else{logger[_0x5e25('0xb')](_0x5e25('0xc'),_0x150f70,'request\x20sent');_0x5779b1(_0x393744[_0x5e25('0x14')]['message']);}})[_0x5e25('0x15')](function(_0x3668cb){logger[_0x5e25('0x11')](_0x5e25('0xc'),_0x150f70,_0x3668cb);_0x4974b8(_0x3668cb);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index e17183f..8205771 100644 --- a/server/api/analyticMetric/index.js +++ b/server/api/analyticMetric/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['destroy','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete'];(function(_0x7e7c0f,_0x13e311){var _0x2b0a5c=function(_0x416883){while(--_0x416883){_0x7e7c0f['push'](_0x7e7c0f['shift']());}};_0x2b0a5c(++_0x13e311);}(_0xadb5,0xad));var _0x5adb=function(_0x3021e1,_0x51de9e){_0x3021e1=_0x3021e1-0x0;var _0x22f887=_0xadb5[_0x3021e1];return _0x22f887;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5adb('0x4'));var config=require(_0x5adb('0x5'));var controller=require(_0x5adb('0x6'));router['get']('/',auth[_0x5adb('0x7')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0xa'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xb')]);router[_0x5adb('0xc')]('/',auth[_0x5adb('0x7')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xa'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xf')]);router[_0x5adb('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x5adb('0x11')]);module[_0x5adb('0x12')]=router; \ No newline at end of file +var _0x187d=['update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x2d8001,_0xc9abac){var _0x3fb344=function(_0x34eedd){while(--_0x34eedd){_0x2d8001['push'](_0x2d8001['shift']());}};_0x3fb344(++_0xc9abac);}(_0x187d,0x93));var _0xd187=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x187d[_0x4bb66f];return _0xf2772f;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var auth=require(_0xd187('0x5'));var interaction=require(_0xd187('0x6'));var config=require('../../config/environment');var controller=require(_0xd187('0x7'));router[_0xd187('0x8')]('/',auth['isAuthenticated'](),controller[_0xd187('0x9')]);router[_0xd187('0x8')](_0xd187('0xa'),auth[_0xd187('0xb')](),controller[_0xd187('0xc')]);router[_0xd187('0xd')]('/',auth[_0xd187('0xb')](),controller[_0xd187('0xe')]);router['put'](_0xd187('0xa'),auth[_0xd187('0xb')](),controller[_0xd187('0xf')]);router[_0xd187('0x10')](_0xd187('0xa'),auth[_0xd187('0xb')](),controller['destroy']);module[_0xd187('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 37ce61d..4d79a49 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 _0xfe8d=['TEXT','sequelize','exports'];(function(_0x21fe98,_0x429019){var _0x49e2eb=function(_0x2d9de8){while(--_0x2d9de8){_0x21fe98['push'](_0x21fe98['shift']());}};_0x49e2eb(++_0x429019);}(_0xfe8d,0x193));var _0xdfe8=function(_0x57ff9f,_0x3dee21){_0x57ff9f=_0x57ff9f-0x0;var _0x1f3df9=_0xfe8d[_0x57ff9f];return _0x1f3df9;};'use strict';var Sequelize=require(_0xdfe8('0x0'));module[_0xdfe8('0x1')]={'tree':{'type':Sequelize[_0xdfe8('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x7bc6=['sequelize'];(function(_0x1e15a8,_0x68e0ac){var _0x991518=function(_0x30ab86){while(--_0x30ab86){_0x1e15a8['push'](_0x1e15a8['shift']());}};_0x991518(++_0x68e0ac);}(_0x7bc6,0x187));var _0x67bc=function(_0x148250,_0x2b8bcb){_0x148250=_0x148250-0x0;var _0x5c8521=_0x7bc6[_0x148250];return _0x5c8521;};'use strict';var Sequelize=require(_0x67bc('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 bc1ced1..bc2d09a 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 _0x757a=['map','VIRTUAL','options','AnalyticTreeReport','count','findAll','rows','catch','params','keys','includeAll','include','create','body','find','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','end','status','json','offset','limit','Content-Range','apply','save','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter'];(function(_0x5def7f,_0x5db6d8){var _0x2dacb8=function(_0xad7347){while(--_0xad7347){_0x5def7f['push'](_0x5def7f['shift']());}};_0x2dacb8(++_0x5db6d8);}(_0x757a,0xde));var _0xa757=function(_0x215bc2,_0x2b5dea){_0x215bc2=_0x215bc2-0x0;var _0x58aa9f=_0x757a[_0x215bc2];return _0x58aa9f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa757('0x0'));var rimraf=require(_0xa757('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa757('0x2'));var BPromise=require(_0xa757('0x3'));var Mustache=require(_0xa757('0x4'));var util=require(_0xa757('0x5'));var path=require(_0xa757('0x6'));var sox=require(_0xa757('0x7'));var csv=require('to-csv');var ejs=require(_0xa757('0x8'));var fs=require('fs');var _=require(_0xa757('0x9'));var squel=require('squel');var crypto=require(_0xa757('0xa'));var jsforce=require(_0xa757('0xb'));var deskjs=require(_0xa757('0xc'));var toCsv=require(_0xa757('0xd'));var querystring=require(_0xa757('0xe'));var Papa=require('papaparse');var Redis=require(_0xa757('0xf'));var authService=require(_0xa757('0x10'));var qs=require(_0xa757('0x11'));var as=require(_0xa757('0x12'));var hardwareService=require(_0xa757('0x13'));var logger=require(_0xa757('0x14'))(_0xa757('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56acfb,_0x4db68e){_0x4db68e=_0x4db68e||0xcc;return function(_0x421040){if(_0x421040){return _0x56acfb['sendStatus'](_0x4db68e);}return _0x56acfb['status'](_0x4db68e)[_0xa757('0x16')]();};}function respondWithResult(_0x513b1f,_0x481508){_0x481508=_0x481508||0xc8;return function(_0x32112b){if(_0x32112b){return _0x513b1f[_0xa757('0x17')](_0x481508)[_0xa757('0x18')](_0x32112b);}};}function respondWithFilteredResult(_0x4a0c38,_0x86abd){return function(_0x31cfd2){if(_0x31cfd2){var _0xf12b68=_0x31cfd2['count'],_0x2f7947=_0x86abd[_0xa757('0x19')],_0x185011=_0x86abd[_0xa757('0x19')]+_0x86abd[_0xa757('0x1a')],_0x3df1f9;if(_0x185011>=_0xf12b68){_0x185011=_0xf12b68;_0x3df1f9=0xc8;}else{_0x3df1f9=0xce;}_0x4a0c38['status'](_0x3df1f9);return _0x4a0c38['set'](_0xa757('0x1b'),_0x2f7947+'-'+_0x185011+'/'+_0xf12b68)[_0xa757('0x18')](_0x31cfd2);}return null;};}function patchUpdates(_0x1bd14c){return function(_0x340599){try{jsonpatch[_0xa757('0x1c')](_0x340599,_0x1bd14c,!![]);}catch(_0xe2d567){return BPromise['reject'](_0xe2d567);}return _0x340599[_0xa757('0x1d')]();};}function saveUpdates(_0x4fec52,_0x32c2a1){return function(_0x167640){if(_0x167640){return _0x167640[_0xa757('0x1e')](_0x4fec52)[_0xa757('0x1f')](function(_0x4d598c){return _0x4d598c;});}return null;};}function removeEntity(_0x5638c7,_0x40ec48){return function(_0x2159cf){if(_0x2159cf){return _0x2159cf[_0xa757('0x20')]()[_0xa757('0x1f')](function(){_0x5638c7[_0xa757('0x17')](0xcc)[_0xa757('0x16')]();});}};}function handleEntityNotFound(_0x2ca10d,_0x21f1af){return function(_0x2bf276){if(!_0x2bf276){_0x2ca10d['sendStatus'](0x194);}return _0x2bf276;};}function handleError(_0x3707c1,_0x59e9d4){_0x59e9d4=_0x59e9d4||0x1f4;return function(_0x422e9e){logger['error'](_0x422e9e[_0xa757('0x21')]);if(_0x422e9e[_0xa757('0x22')]){delete _0x422e9e[_0xa757('0x22')];}_0x3707c1['status'](_0x59e9d4)[_0xa757('0x23')](_0x422e9e);};}exports[_0xa757('0x24')]=function(_0x471e84,_0x3bf7f3){var _0x5b4779={},_0x449a7d={},_0x54263b={'count':0x0,'rows':[]};var _0x5a5664=_['map'](db['AnalyticTreeReport'][_0xa757('0x25')],function(_0x596ae2){return{'name':_0x596ae2[_0xa757('0x26')],'type':_0x596ae2[_0xa757('0x27')]['key']};});_0x449a7d[_0xa757('0x28')]=_['map'](_0x5a5664,_0xa757('0x22'));_0x449a7d[_0xa757('0x29')]=_['keys'](_0x471e84[_0xa757('0x29')]);_0x449a7d['filters']=_[_0xa757('0x2a')](_0x449a7d[_0xa757('0x28')],_0x449a7d[_0xa757('0x29')]);_0x5b4779[_0xa757('0x2b')]=_[_0xa757('0x2a')](_0x449a7d[_0xa757('0x28')],qs[_0xa757('0x2c')](_0x471e84[_0xa757('0x29')][_0xa757('0x2c')]));_0x5b4779[_0xa757('0x2b')]=_0x5b4779[_0xa757('0x2b')][_0xa757('0x2d')]?_0x5b4779[_0xa757('0x2b')]:_0x449a7d[_0xa757('0x28')];if(!_0x471e84[_0xa757('0x29')][_0xa757('0x2e')](_0xa757('0x2f'))){_0x5b4779[_0xa757('0x1a')]=qs[_0xa757('0x1a')](_0x471e84[_0xa757('0x29')][_0xa757('0x1a')]);_0x5b4779[_0xa757('0x19')]=qs[_0xa757('0x19')](_0x471e84[_0xa757('0x29')]['offset']);}_0x5b4779[_0xa757('0x30')]=qs[_0xa757('0x31')](_0x471e84[_0xa757('0x29')][_0xa757('0x31')]);_0x5b4779[_0xa757('0x32')]=qs['filters'](_[_0xa757('0x33')](_0x471e84[_0xa757('0x29')],_0x449a7d[_0xa757('0x34')]));if(_0x471e84[_0xa757('0x29')][_0xa757('0x35')]){_0x5b4779[_0xa757('0x32')]=_['merge'](_0x5b4779[_0xa757('0x32')],{'$or':_[_0xa757('0x36')](_0x5a5664,function(_0x2cade7){if(_0x2cade7[_0xa757('0x27')]!==_0xa757('0x37')){var _0x111cfe={};_0x111cfe[_0x2cade7[_0xa757('0x22')]]={'$like':'%'+_0x471e84[_0xa757('0x29')][_0xa757('0x35')]+'%'};return _0x111cfe;}})});}_0x5b4779=_['merge']({},_0x5b4779,_0x471e84[_0xa757('0x38')]);var _0x34fba8={'where':_0x5b4779[_0xa757('0x32')]};return db[_0xa757('0x39')][_0xa757('0x3a')](_0x34fba8)[_0xa757('0x1f')](function(_0x501e26){_0x54263b[_0xa757('0x3a')]=_0x501e26;if(_0x471e84[_0xa757('0x29')]['includeAll']){_0x5b4779['include']=[{'all':!![]}];}return db[_0xa757('0x39')][_0xa757('0x3b')](_0x5b4779);})['then'](function(_0x51c3d1){_0x54263b[_0xa757('0x3c')]=_0x51c3d1;return _0x54263b;})[_0xa757('0x1f')](respondWithFilteredResult(_0x3bf7f3,_0x5b4779))[_0xa757('0x3d')](handleError(_0x3bf7f3,null));};exports['show']=function(_0x830dc4,_0x13a8f4){var _0x26802c={'raw':!![],'where':{'id':_0x830dc4[_0xa757('0x3e')]['id']}},_0x1ba399={};_0x1ba399['model']=_[_0xa757('0x3f')](db['AnalyticTreeReport']['rawAttributes']);_0x1ba399[_0xa757('0x29')]=_[_0xa757('0x3f')](_0x830dc4[_0xa757('0x29')]);_0x1ba399[_0xa757('0x34')]=_[_0xa757('0x2a')](_0x1ba399['model'],_0x1ba399['query']);_0x26802c[_0xa757('0x2b')]=_[_0xa757('0x2a')](_0x1ba399[_0xa757('0x28')],qs[_0xa757('0x2c')](_0x830dc4[_0xa757('0x29')][_0xa757('0x2c')]));_0x26802c['attributes']=_0x26802c[_0xa757('0x2b')][_0xa757('0x2d')]?_0x26802c['attributes']:_0x1ba399[_0xa757('0x28')];if(_0x830dc4['query'][_0xa757('0x40')]){_0x26802c[_0xa757('0x41')]=[{'all':!![]}];}_0x26802c=_['merge']({},_0x26802c,_0x830dc4[_0xa757('0x38')]);return db[_0xa757('0x39')]['find'](_0x26802c)[_0xa757('0x1f')](handleEntityNotFound(_0x13a8f4,null))[_0xa757('0x1f')](respondWithResult(_0x13a8f4,null))[_0xa757('0x3d')](handleError(_0x13a8f4,null));};exports[_0xa757('0x42')]=function(_0x543b5b,_0x199dc9){return db[_0xa757('0x39')][_0xa757('0x42')](_0x543b5b[_0xa757('0x43')],{})['then'](respondWithResult(_0x199dc9,0xc9))[_0xa757('0x3d')](handleError(_0x199dc9,null));};exports['update']=function(_0x50c131,_0x2acf88){if(_0x50c131[_0xa757('0x43')]['id']){delete _0x50c131[_0xa757('0x43')]['id'];}return db['AnalyticTreeReport'][_0xa757('0x44')]({'where':{'id':_0x50c131['params']['id']}})[_0xa757('0x1f')](handleEntityNotFound(_0x2acf88,null))[_0xa757('0x1f')](saveUpdates(_0x50c131[_0xa757('0x43')],null))[_0xa757('0x1f')](respondWithResult(_0x2acf88,null))[_0xa757('0x3d')](handleError(_0x2acf88,null));};exports[_0xa757('0x20')]=function(_0x57bf73,_0x505cd){return db['AnalyticTreeReport'][_0xa757('0x44')]({'where':{'id':_0x57bf73[_0xa757('0x3e')]['id']}})[_0xa757('0x1f')](handleEntityNotFound(_0x505cd,null))[_0xa757('0x1f')](removeEntity(_0x505cd,null))[_0xa757('0x3d')](handleError(_0x505cd,null));}; \ No newline at end of file +var _0xbdb7=['filters','intersection','attributes','length','hasOwnProperty','order','sort','where','filter','merge','includeAll','include','findAll','rows','show','params','fields','options','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','count','offset','limit','status','set','json','apply','reject','save','update','then','destroy','end','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x3e915d,_0x5ad545){var _0x5ac50c=function(_0x59b193){while(--_0x59b193){_0x3e915d['push'](_0x3e915d['shift']());}};_0x5ac50c(++_0x5ad545);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x1e08fa,_0x2177b8){_0x1e08fa=_0x1e08fa-0x0;var _0x48a80f=_0xbdb7[_0x1e08fa];return _0x48a80f;};'use strict';var pdf=require(_0x7bdb('0x0'));var emlformat=require(_0x7bdb('0x1'));var rimraf=require(_0x7bdb('0x2'));var zipdir=require(_0x7bdb('0x3'));var jsonpatch=require(_0x7bdb('0x4'));var rp=require(_0x7bdb('0x5'));var moment=require(_0x7bdb('0x6'));var BPromise=require(_0x7bdb('0x7'));var Mustache=require(_0x7bdb('0x8'));var util=require('util');var path=require(_0x7bdb('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7bdb('0xa'));var fs=require('fs');var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3053d0,_0x25e3cb){_0x25e3cb=_0x25e3cb||0xcc;return function(_0x496613){if(_0x496613){return _0x3053d0[_0x7bdb('0x16')](_0x25e3cb);}return _0x3053d0['status'](_0x25e3cb)['end']();};}function respondWithResult(_0x2abca6,_0x46dd4a){_0x46dd4a=_0x46dd4a||0xc8;return function(_0x4fd91a){if(_0x4fd91a){return _0x2abca6['status'](_0x46dd4a)['json'](_0x4fd91a);}};}function respondWithFilteredResult(_0x4476ff,_0x195b2e){return function(_0xe9919f){if(_0xe9919f){var _0x25d417=_0xe9919f[_0x7bdb('0x17')],_0x31c909=_0x195b2e['offset'],_0xbde12a=_0x195b2e[_0x7bdb('0x18')]+_0x195b2e[_0x7bdb('0x19')],_0x3e96ac;if(_0xbde12a>=_0x25d417){_0xbde12a=_0x25d417;_0x3e96ac=0xc8;}else{_0x3e96ac=0xce;}_0x4476ff[_0x7bdb('0x1a')](_0x3e96ac);return _0x4476ff[_0x7bdb('0x1b')]('Content-Range',_0x31c909+'-'+_0xbde12a+'/'+_0x25d417)[_0x7bdb('0x1c')](_0xe9919f);}return null;};}function patchUpdates(_0x23e9eb){return function(_0x5b8481){try{jsonpatch[_0x7bdb('0x1d')](_0x5b8481,_0x23e9eb,!![]);}catch(_0x31f78e){return BPromise[_0x7bdb('0x1e')](_0x31f78e);}return _0x5b8481[_0x7bdb('0x1f')]();};}function saveUpdates(_0x112793,_0x5bfc35){return function(_0x49f353){if(_0x49f353){return _0x49f353[_0x7bdb('0x20')](_0x112793)[_0x7bdb('0x21')](function(_0x5daea4){return _0x5daea4;});}return null;};}function removeEntity(_0x341fe4,_0x118ea1){return function(_0x346c72){if(_0x346c72){return _0x346c72[_0x7bdb('0x22')]()[_0x7bdb('0x21')](function(){_0x341fe4['status'](0xcc)[_0x7bdb('0x23')]();});}};}function handleEntityNotFound(_0xdad53d,_0x40c447){return function(_0x3a456f){if(!_0x3a456f){_0xdad53d['sendStatus'](0x194);}return _0x3a456f;};}function handleError(_0x4d6e44,_0x3c423f){_0x3c423f=_0x3c423f||0x1f4;return function(_0x5eface){logger['error'](_0x5eface['stack']);if(_0x5eface[_0x7bdb('0x24')]){delete _0x5eface['name'];}_0x4d6e44[_0x7bdb('0x1a')](_0x3c423f)[_0x7bdb('0x25')](_0x5eface);};}exports[_0x7bdb('0x26')]=function(_0x7c09cf,_0x2a494e){var _0x523869={},_0x10e818={},_0x32242d={'count':0x0,'rows':[]};var _0x399b62=_[_0x7bdb('0x27')](db[_0x7bdb('0x28')][_0x7bdb('0x29')],function(_0x1e9996){return{'name':_0x1e9996[_0x7bdb('0x2a')],'type':_0x1e9996[_0x7bdb('0x2b')][_0x7bdb('0x2c')]};});_0x10e818[_0x7bdb('0x2d')]=_[_0x7bdb('0x27')](_0x399b62,'name');_0x10e818[_0x7bdb('0x2e')]=_[_0x7bdb('0x2f')](_0x7c09cf[_0x7bdb('0x2e')]);_0x10e818[_0x7bdb('0x30')]=_[_0x7bdb('0x31')](_0x10e818['model'],_0x10e818[_0x7bdb('0x2e')]);_0x523869[_0x7bdb('0x32')]=_[_0x7bdb('0x31')](_0x10e818[_0x7bdb('0x2d')],qs['fields'](_0x7c09cf['query']['fields']));_0x523869[_0x7bdb('0x32')]=_0x523869['attributes'][_0x7bdb('0x33')]?_0x523869['attributes']:_0x10e818[_0x7bdb('0x2d')];if(!_0x7c09cf[_0x7bdb('0x2e')][_0x7bdb('0x34')]('nolimit')){_0x523869[_0x7bdb('0x19')]=qs['limit'](_0x7c09cf['query'][_0x7bdb('0x19')]);_0x523869['offset']=qs[_0x7bdb('0x18')](_0x7c09cf['query']['offset']);}_0x523869[_0x7bdb('0x35')]=qs[_0x7bdb('0x36')](_0x7c09cf[_0x7bdb('0x2e')][_0x7bdb('0x36')]);_0x523869[_0x7bdb('0x37')]=qs[_0x7bdb('0x30')](_['pick'](_0x7c09cf[_0x7bdb('0x2e')],_0x10e818[_0x7bdb('0x30')]));if(_0x7c09cf[_0x7bdb('0x2e')][_0x7bdb('0x38')]){_0x523869[_0x7bdb('0x37')]=_[_0x7bdb('0x39')](_0x523869[_0x7bdb('0x37')],{'$or':_[_0x7bdb('0x27')](_0x399b62,function(_0xde82a0){if(_0xde82a0['type']!=='VIRTUAL'){var _0x19c237={};_0x19c237[_0xde82a0[_0x7bdb('0x24')]]={'$like':'%'+_0x7c09cf[_0x7bdb('0x2e')][_0x7bdb('0x38')]+'%'};return _0x19c237;}})});}_0x523869=_[_0x7bdb('0x39')]({},_0x523869,_0x7c09cf['options']);var _0x55f020={'where':_0x523869[_0x7bdb('0x37')]};return db['AnalyticTreeReport'][_0x7bdb('0x17')](_0x55f020)['then'](function(_0x212b50){_0x32242d['count']=_0x212b50;if(_0x7c09cf['query'][_0x7bdb('0x3a')]){_0x523869[_0x7bdb('0x3b')]=[{'all':!![]}];}return db[_0x7bdb('0x28')][_0x7bdb('0x3c')](_0x523869);})[_0x7bdb('0x21')](function(_0x2b4829){_0x32242d[_0x7bdb('0x3d')]=_0x2b4829;return _0x32242d;})['then'](respondWithFilteredResult(_0x2a494e,_0x523869))['catch'](handleError(_0x2a494e,null));};exports[_0x7bdb('0x3e')]=function(_0x206888,_0x2dbb43){var _0x3509e4={'raw':!![],'where':{'id':_0x206888[_0x7bdb('0x3f')]['id']}},_0x39fbca={};_0x39fbca[_0x7bdb('0x2d')]=_['keys'](db['AnalyticTreeReport'][_0x7bdb('0x29')]);_0x39fbca[_0x7bdb('0x2e')]=_[_0x7bdb('0x2f')](_0x206888[_0x7bdb('0x2e')]);_0x39fbca['filters']=_[_0x7bdb('0x31')](_0x39fbca['model'],_0x39fbca[_0x7bdb('0x2e')]);_0x3509e4[_0x7bdb('0x32')]=_[_0x7bdb('0x31')](_0x39fbca[_0x7bdb('0x2d')],qs[_0x7bdb('0x40')](_0x206888[_0x7bdb('0x2e')][_0x7bdb('0x40')]));_0x3509e4[_0x7bdb('0x32')]=_0x3509e4[_0x7bdb('0x32')]['length']?_0x3509e4[_0x7bdb('0x32')]:_0x39fbca[_0x7bdb('0x2d')];if(_0x206888['query'][_0x7bdb('0x3a')]){_0x3509e4['include']=[{'all':!![]}];}_0x3509e4=_[_0x7bdb('0x39')]({},_0x3509e4,_0x206888[_0x7bdb('0x41')]);return db[_0x7bdb('0x28')][_0x7bdb('0x42')](_0x3509e4)[_0x7bdb('0x21')](handleEntityNotFound(_0x2dbb43,null))['then'](respondWithResult(_0x2dbb43,null))[_0x7bdb('0x43')](handleError(_0x2dbb43,null));};exports[_0x7bdb('0x44')]=function(_0x12d889,_0x3eda2e){return db[_0x7bdb('0x28')]['create'](_0x12d889[_0x7bdb('0x45')],{})[_0x7bdb('0x21')](respondWithResult(_0x3eda2e,0xc9))[_0x7bdb('0x43')](handleError(_0x3eda2e,null));};exports[_0x7bdb('0x20')]=function(_0x259007,_0x25c534){if(_0x259007[_0x7bdb('0x45')]['id']){delete _0x259007[_0x7bdb('0x45')]['id'];}return db[_0x7bdb('0x28')][_0x7bdb('0x42')]({'where':{'id':_0x259007['params']['id']}})[_0x7bdb('0x21')](handleEntityNotFound(_0x25c534,null))['then'](saveUpdates(_0x259007['body'],null))[_0x7bdb('0x21')](respondWithResult(_0x25c534,null))[_0x7bdb('0x43')](handleError(_0x25c534,null));};exports['destroy']=function(_0x37780a,_0x186809){return db['AnalyticTreeReport']['find']({'where':{'id':_0x37780a['params']['id']}})[_0x7bdb('0x21')](handleEntityNotFound(_0x186809,null))[_0x7bdb('0x21')](removeEntity(_0x186809,null))[_0x7bdb('0x43')](handleError(_0x186809,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 5e2a436..1d056ce 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 _0x2cc4=['bluebird','request-promise','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','util','../../config/logger','api'];(function(_0x123aff,_0x2e6aea){var _0x1be3ec=function(_0x188c08){while(--_0x188c08){_0x123aff['push'](_0x123aff['shift']());}};_0x1be3ec(++_0x2e6aea);}(_0x2cc4,0x1f0));var _0x42cc=function(_0x19159a,_0x1cb5c3){_0x19159a=_0x19159a-0x0;var _0xa677f4=_0x2cc4[_0x19159a];return _0xa677f4;};'use strict';var _=require(_0x42cc('0x0'));var util=require(_0x42cc('0x1'));var logger=require(_0x42cc('0x2'))(_0x42cc('0x3'));var moment=require('moment');var BPromise=require(_0x42cc('0x4'));var rp=require(_0x42cc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x42cc('0x6'));module[_0x42cc('0x7')]=function(_0x299177,_0x2b9798){return _0x299177[_0x42cc('0x8')]('AnalyticTreeReport',attributes,{'tableName':_0x42cc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x63a6=['rimraf','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','util','../../config/logger','moment','bluebird','path'];(function(_0x2d7369,_0xc3f411){var _0x3e0359=function(_0xa1b572){while(--_0xa1b572){_0x2d7369['push'](_0x2d7369['shift']());}};_0x3e0359(++_0xc3f411);}(_0x63a6,0x1c7));var _0x663a=function(_0x37a79c,_0x2b19f0){_0x37a79c=_0x37a79c-0x0;var _0x561d89=_0x63a6[_0x37a79c];return _0x561d89;};'use strict';var _=require('lodash');var util=require(_0x663a('0x0'));var logger=require(_0x663a('0x1'))('api');var moment=require(_0x663a('0x2'));var BPromise=require(_0x663a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x663a('0x4'));var rimraf=require(_0x663a('0x5'));var config=require(_0x663a('0x6'));var attributes=require(_0x663a('0x7'));module['exports']=function(_0x5aab49,_0x5907e8){return _0x5aab49[_0x663a('0x8')](_0x663a('0x9'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index cf25932..140fb7b 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 _0x8367=['client','http','request','then','info','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticTreeReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x8367,0xdc));var _0x7836=function(_0x5e7d0c,_0x56ba7b){_0x5e7d0c=_0x5e7d0c-0x0;var _0xc24371=_0x8367[_0x5e7d0c];return _0xc24371;};'use strict';var _=require(_0x7836('0x0'));var util=require(_0x7836('0x1'));var moment=require(_0x7836('0x2'));var BPromise=require(_0x7836('0x3'));var rs=require(_0x7836('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7836('0x5'));var logger=require(_0x7836('0x6'))(_0x7836('0x7'));var config=require(_0x7836('0x8'));var jayson=require(_0x7836('0x9'));var client=jayson[_0x7836('0xa')][_0x7836('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13c0bb,_0x234046,_0x5e6f23){return new BPromise(function(_0x2ac595,_0x3440f7){return client[_0x7836('0xc')](_0x13c0bb,_0x5e6f23)[_0x7836('0xd')](function(_0x597ae0){logger[_0x7836('0xe')]('AnalyticTreeReport,\x20%s,\x20%s',_0x234046,_0x7836('0xf'));logger[_0x7836('0x10')](_0x7836('0x11'),_0x234046,_0x7836('0xf'),JSON['stringify'](_0x597ae0));if(_0x597ae0[_0x7836('0x12')]){if(_0x597ae0[_0x7836('0x12')][_0x7836('0x13')]===0x1f4){logger[_0x7836('0x12')](_0x7836('0x14'),_0x234046,_0x597ae0[_0x7836('0x12')][_0x7836('0x15')]);return _0x3440f7(_0x597ae0[_0x7836('0x12')]['message']);}logger[_0x7836('0x12')](_0x7836('0x14'),_0x234046,_0x597ae0[_0x7836('0x12')]['message']);return _0x2ac595(_0x597ae0[_0x7836('0x12')][_0x7836('0x15')]);}else{logger[_0x7836('0xe')](_0x7836('0x14'),_0x234046,'request\x20sent');_0x2ac595(_0x597ae0[_0x7836('0x16')][_0x7836('0x15')]);}})['catch'](function(_0x14c4b0){logger[_0x7836('0x12')](_0x7836('0x14'),_0x234046,_0x14c4b0);_0x3440f7(_0x14c4b0);});});} \ No newline at end of file +var _0x7f5d=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7f5d,0xc4));var _0xd7f5=function(_0x32f8c1,_0x91f08e){_0x32f8c1=_0x32f8c1-0x0;var _0x2e060b=_0x7f5d[_0x32f8c1];return _0x2e060b;};'use strict';var _=require(_0xd7f5('0x0'));var util=require(_0xd7f5('0x1'));var moment=require(_0xd7f5('0x2'));var BPromise=require(_0xd7f5('0x3'));var rs=require(_0xd7f5('0x4'));var fs=require('fs');var Redis=require(_0xd7f5('0x5'));var db=require(_0xd7f5('0x6'))['db'];var utils=require(_0xd7f5('0x7'));var logger=require(_0xd7f5('0x8'))(_0xd7f5('0x9'));var config=require(_0xd7f5('0xa'));var jayson=require(_0xd7f5('0xb'));var client=jayson[_0xd7f5('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfd87eb,_0x4c3a95,_0x51411c){return new BPromise(function(_0x31555c,_0x3f5a60){return client[_0xd7f5('0xd')](_0xfd87eb,_0x51411c)[_0xd7f5('0xe')](function(_0x528f22){logger[_0xd7f5('0xf')](_0xd7f5('0x10'),_0x4c3a95,_0xd7f5('0x11'));logger[_0xd7f5('0x12')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x4c3a95,_0xd7f5('0x11'),JSON[_0xd7f5('0x13')](_0x528f22));if(_0x528f22[_0xd7f5('0x14')]){if(_0x528f22[_0xd7f5('0x14')][_0xd7f5('0x15')]===0x1f4){logger['error'](_0xd7f5('0x10'),_0x4c3a95,_0x528f22[_0xd7f5('0x14')][_0xd7f5('0x16')]);return _0x3f5a60(_0x528f22[_0xd7f5('0x14')][_0xd7f5('0x16')]);}logger[_0xd7f5('0x14')](_0xd7f5('0x10'),_0x4c3a95,_0x528f22['error'][_0xd7f5('0x16')]);return _0x31555c(_0x528f22[_0xd7f5('0x14')][_0xd7f5('0x16')]);}else{logger[_0xd7f5('0xf')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4c3a95,_0xd7f5('0x11'));_0x31555c(_0x528f22[_0xd7f5('0x17')][_0xd7f5('0x16')]);}})[_0xd7f5('0x18')](function(_0x1df270){logger['error'](_0xd7f5('0x10'),_0x4c3a95,_0x1df270);_0x3f5a60(_0x1df270);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index a48236e..5d9a39d 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 _0x20ae=['index','/:id','show','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated'];(function(_0x2fa457,_0x7021df){var _0x4f250a=function(_0xef901e){while(--_0xef901e){_0x2fa457['push'](_0x2fa457['shift']());}};_0x4f250a(++_0x7021df);}(_0x20ae,0xee));var _0xe20a=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x20ae[_0x51020b];return _0x371e47;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe20a('0x0'));var timeout=require(_0xe20a('0x1'));var express=require(_0xe20a('0x2'));var router=express[_0xe20a('0x3')]();var auth=require(_0xe20a('0x4'));var interaction=require(_0xe20a('0x5'));var config=require('../../config/environment');var controller=require(_0xe20a('0x6'));router[_0xe20a('0x7')]('/',auth[_0xe20a('0x8')](),controller[_0xe20a('0x9')]);router[_0xe20a('0x7')](_0xe20a('0xa'),auth[_0xe20a('0x8')](),controller[_0xe20a('0xb')]);router[_0xe20a('0xc')]('/',auth[_0xe20a('0x8')](),controller[_0xe20a('0xd')]);router[_0xe20a('0xe')]('/:id',auth[_0xe20a('0x8')](),controller[_0xe20a('0xf')]);router[_0xe20a('0x10')]('/:id',auth[_0xe20a('0x8')](),controller[_0xe20a('0x11')]);module[_0xe20a('0x12')]=router; \ No newline at end of file +var _0x6b62=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','util'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x6b62,0xba));var _0x26b6=function(_0x564d28,_0x46694b){_0x564d28=_0x564d28-0x0;var _0x233f56=_0x6b62[_0x564d28];return _0x233f56;};'use strict';var multer=require('multer');var util=require(_0x26b6('0x0'));var path=require(_0x26b6('0x1'));var timeout=require(_0x26b6('0x2'));var express=require('express');var router=express[_0x26b6('0x3')]();var auth=require(_0x26b6('0x4'));var interaction=require(_0x26b6('0x5'));var config=require(_0x26b6('0x6'));var controller=require(_0x26b6('0x7'));router[_0x26b6('0x8')]('/',auth[_0x26b6('0x9')](),controller['index']);router['get'](_0x26b6('0xa'),auth[_0x26b6('0x9')](),controller[_0x26b6('0xb')]);router[_0x26b6('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x26b6('0xd')](_0x26b6('0xa'),auth[_0x26b6('0x9')](),controller[_0x26b6('0xe')]);router[_0x26b6('0xf')](_0x26b6('0xa'),auth['isAuthenticated'](),controller[_0x26b6('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 07d68ea..ee4d752 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 _0xabbe=['sequelize','exports','STRING'];(function(_0x3c3a31,_0x50a71a){var _0x42a364=function(_0x25da93){while(--_0x25da93){_0x3c3a31['push'](_0x3c3a31['shift']());}};_0x42a364(++_0x50a71a);}(_0xabbe,0x8d));var _0xeabb=function(_0x9924d6,_0x34970f){_0x9924d6=_0x9924d6-0x0;var _0x312f0f=_0xabbe[_0x9924d6];return _0x312f0f;};'use strict';var Sequelize=require(_0xeabb('0x0'));module[_0xeabb('0x1')]={'name':{'type':Sequelize[_0xeabb('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x34ac=['exports','STRING','sequelize'];(function(_0x51308d,_0x42cf02){var _0x37cde8=function(_0x527de4){while(--_0x527de4){_0x51308d['push'](_0x51308d['shift']());}};_0x37cde8(++_0x42cf02);}(_0x34ac,0x113));var _0xc34a=function(_0x1bf36c,_0x1fa239){_0x1bf36c=_0x1bf36c-0x0;var _0x3b9b18=_0x34ac[_0x1bf36c];return _0x3b9b18;};'use strict';var Sequelize=require(_0xc34a('0x0'));module[_0xc34a('0x1')]={'name':{'type':Sequelize[_0xc34a('0x2')]},'basename':{'type':Sequelize[_0xc34a('0x2')]},'type':{'type':Sequelize[_0xc34a('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 34ae594..46c46e6 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 _0x390a=['key','query','keys','model','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','params','fields','catch','clone','find','get','createdAt','updatedAt','body','omit','update','create','basename','file','type','mimetype','download','findOne','join','root','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','error','stack','name','index','map','Attachment','rawAttributes','fieldName'];(function(_0x45e34c,_0x41eb38){var _0x2c8a7a=function(_0x35b174){while(--_0x35b174){_0x45e34c['push'](_0x45e34c['shift']());}};_0x2c8a7a(++_0x41eb38);}(_0x390a,0x80));var _0xa390=function(_0x3ca117,_0x10d22e){_0x3ca117=_0x3ca117-0x0;var _0x59cdd8=_0x390a[_0x3ca117];return _0x59cdd8;};'use strict';var pdf=require(_0xa390('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa390('0x1'));var zipdir=require(_0xa390('0x2'));var jsonpatch=require(_0xa390('0x3'));var rp=require(_0xa390('0x4'));var moment=require(_0xa390('0x5'));var BPromise=require(_0xa390('0x6'));var Mustache=require(_0xa390('0x7'));var util=require(_0xa390('0x8'));var path=require(_0xa390('0x9'));var sox=require(_0xa390('0xa'));var csv=require(_0xa390('0xb'));var ejs=require(_0xa390('0xc'));var fs=require('fs');var _=require(_0xa390('0xd'));var squel=require(_0xa390('0xe'));var crypto=require('crypto');var jsforce=require(_0xa390('0xf'));var deskjs=require(_0xa390('0x10'));var toCsv=require(_0xa390('0xb'));var querystring=require('querystring');var Papa=require(_0xa390('0x11'));var Redis=require('ioredis');var authService=require(_0xa390('0x12'));var qs=require(_0xa390('0x13'));var as=require(_0xa390('0x14'));var hardwareService=require(_0xa390('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xa390('0x16'));var config=require(_0xa390('0x17'));var db=require(_0xa390('0x18'))['db'];function respondWithStatusCode(_0x24be2d,_0x2bc948){_0x2bc948=_0x2bc948||0xcc;return function(_0x56a3da){if(_0x56a3da){return _0x24be2d[_0xa390('0x19')](_0x2bc948);}return _0x24be2d['status'](_0x2bc948)[_0xa390('0x1a')]();};}function respondWithResult(_0x969532,_0xa89849){_0xa89849=_0xa89849||0xc8;return function(_0x492cb9){if(_0x492cb9){return _0x969532[_0xa390('0x1b')](_0xa89849)[_0xa390('0x1c')](_0x492cb9);}};}function respondWithFilteredResult(_0x58fa98,_0x2fef03){return function(_0x5cb753){if(_0x5cb753){var _0x5676ef=_0x5cb753[_0xa390('0x1d')],_0x242d5a=_0x2fef03[_0xa390('0x1e')],_0x3d6e99=_0x2fef03[_0xa390('0x1e')]+_0x2fef03[_0xa390('0x1f')],_0x35c45d;if(_0x3d6e99>=_0x5676ef){_0x3d6e99=_0x5676ef;_0x35c45d=0xc8;}else{_0x35c45d=0xce;}_0x58fa98['status'](_0x35c45d);return _0x58fa98[_0xa390('0x20')](_0xa390('0x21'),_0x242d5a+'-'+_0x3d6e99+'/'+_0x5676ef)['json'](_0x5cb753);}return null;};}function patchUpdates(_0x252ea6){return function(_0x53d396){try{jsonpatch[_0xa390('0x22')](_0x53d396,_0x252ea6,!![]);}catch(_0x537703){return BPromise['reject'](_0x537703);}return _0x53d396[_0xa390('0x23')]();};}function saveUpdates(_0x1d27e6,_0x477412){return function(_0x1c685e){if(_0x1c685e){return _0x1c685e['update'](_0x1d27e6)[_0xa390('0x24')](function(_0x5b1c76){return _0x5b1c76;});}return null;};}function removeEntity(_0x5b86c2,_0x41de36){return function(_0x967e5b){if(_0x967e5b){return _0x967e5b[_0xa390('0x25')]()['then'](function(){_0x5b86c2[_0xa390('0x1b')](0xcc)[_0xa390('0x1a')]();});}};}function handleEntityNotFound(_0x2f9acc,_0x2ae86b){return function(_0x2f6f3b){if(!_0x2f6f3b){_0x2f9acc[_0xa390('0x19')](0x194);}return _0x2f6f3b;};}function handleError(_0xb930c9,_0x5a2142){_0x5a2142=_0x5a2142||0x1f4;return function(_0x30be7b){logger[_0xa390('0x26')](_0x30be7b[_0xa390('0x27')]);if(_0x30be7b['name']){delete _0x30be7b[_0xa390('0x28')];}_0xb930c9['status'](_0x5a2142)['send'](_0x30be7b);};}exports[_0xa390('0x29')]=function(_0xacd4b2,_0x2e20c2){var _0x8dd695={},_0x2da6bb={},_0x5f02cd={'count':0x0,'rows':[]};var _0x351d42=_[_0xa390('0x2a')](db[_0xa390('0x2b')][_0xa390('0x2c')],function(_0xabf669){return{'name':_0xabf669[_0xa390('0x2d')],'type':_0xabf669['type'][_0xa390('0x2e')]};});_0x2da6bb['model']=_['map'](_0x351d42,_0xa390('0x28'));_0x2da6bb[_0xa390('0x2f')]=_[_0xa390('0x30')](_0xacd4b2[_0xa390('0x2f')]);_0x2da6bb['filters']=_['intersection'](_0x2da6bb[_0xa390('0x31')],_0x2da6bb['query']);_0x8dd695[_0xa390('0x32')]=_[_0xa390('0x33')](_0x2da6bb[_0xa390('0x31')],qs['fields'](_0xacd4b2[_0xa390('0x2f')]['fields']));_0x8dd695[_0xa390('0x32')]=_0x8dd695[_0xa390('0x32')][_0xa390('0x34')]?_0x8dd695[_0xa390('0x32')]:_0x2da6bb['model'];if(!_0xacd4b2['query'][_0xa390('0x35')](_0xa390('0x36'))){_0x8dd695[_0xa390('0x1f')]=qs[_0xa390('0x1f')](_0xacd4b2['query'][_0xa390('0x1f')]);_0x8dd695['offset']=qs[_0xa390('0x1e')](_0xacd4b2[_0xa390('0x2f')][_0xa390('0x1e')]);}_0x8dd695[_0xa390('0x37')]=qs['sort'](_0xacd4b2['query'][_0xa390('0x38')]);_0x8dd695[_0xa390('0x39')]=qs[_0xa390('0x3a')](_[_0xa390('0x3b')](_0xacd4b2[_0xa390('0x2f')],_0x2da6bb['filters']));if(_0xacd4b2['query'][_0xa390('0x3c')]){_0x8dd695[_0xa390('0x39')]=_[_0xa390('0x3d')](_0x8dd695[_0xa390('0x39')],{'$or':_[_0xa390('0x2a')](_0x351d42,function(_0x320585){if(_0x320585['type']!==_0xa390('0x3e')){var _0x1bc130={};_0x1bc130[_0x320585[_0xa390('0x28')]]={'$like':'%'+_0xacd4b2[_0xa390('0x2f')][_0xa390('0x3c')]+'%'};return _0x1bc130;}})});}_0x8dd695=_[_0xa390('0x3d')]({},_0x8dd695,_0xacd4b2[_0xa390('0x3f')]);var _0x18a0e0={'where':_0x8dd695[_0xa390('0x39')]};return db['Attachment'][_0xa390('0x1d')](_0x18a0e0)[_0xa390('0x24')](function(_0x5e2080){_0x5f02cd['count']=_0x5e2080;if(_0xacd4b2[_0xa390('0x2f')][_0xa390('0x40')]){_0x8dd695[_0xa390('0x41')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x8dd695);})['then'](function(_0x279a90){_0x5f02cd[_0xa390('0x42')]=_0x279a90;return _0x5f02cd;})[_0xa390('0x24')](respondWithFilteredResult(_0x2e20c2,_0x8dd695))['catch'](handleError(_0x2e20c2,null));};exports['show']=function(_0x390ed5,_0xac9e1a){var _0x4ed48e={'raw':!![],'where':{'id':_0x390ed5[_0xa390('0x43')]['id']}},_0x248d36={};_0x248d36[_0xa390('0x31')]=_[_0xa390('0x30')](db[_0xa390('0x2b')]['rawAttributes']);_0x248d36['query']=_[_0xa390('0x30')](_0x390ed5['query']);_0x248d36[_0xa390('0x3a')]=_[_0xa390('0x33')](_0x248d36[_0xa390('0x31')],_0x248d36[_0xa390('0x2f')]);_0x4ed48e['attributes']=_[_0xa390('0x33')](_0x248d36[_0xa390('0x31')],qs[_0xa390('0x44')](_0x390ed5[_0xa390('0x2f')][_0xa390('0x44')]));_0x4ed48e[_0xa390('0x32')]=_0x4ed48e[_0xa390('0x32')][_0xa390('0x34')]?_0x4ed48e['attributes']:_0x248d36['model'];if(_0x390ed5[_0xa390('0x2f')]['includeAll']){_0x4ed48e['include']=[{'all':!![]}];}_0x4ed48e=_['merge']({},_0x4ed48e,_0x390ed5[_0xa390('0x3f')]);return db[_0xa390('0x2b')]['find'](_0x4ed48e)[_0xa390('0x24')](handleEntityNotFound(_0xac9e1a,null))[_0xa390('0x24')](respondWithResult(_0xac9e1a,null))[_0xa390('0x45')](handleError(_0xac9e1a,null));};exports[_0xa390('0x46')]=function(_0x5a135b,_0x56e037){var _0xc93ce6={'where':{'id':_0x5a135b[_0xa390('0x43')]['id']}},_0x37aac3={};_0x37aac3['model']=_[_0xa390('0x30')](db['Attachment'][_0xa390('0x2c')]);_0xc93ce6[_0xa390('0x32')]=_[_0xa390('0x33')](_0x37aac3[_0xa390('0x31')],qs[_0xa390('0x44')](_0x5a135b[_0xa390('0x2f')][_0xa390('0x44')]));_0xc93ce6['attributes']=_0xc93ce6[_0xa390('0x32')][_0xa390('0x34')]?_0xc93ce6['attributes']:_0x37aac3[_0xa390('0x31')];if(_0x5a135b[_0xa390('0x2f')]['includeAll']){_0xc93ce6[_0xa390('0x41')]=[{'all':!![]}];}_0xc93ce6=_[_0xa390('0x3d')]({},_0xc93ce6,_0x5a135b[_0xa390('0x3f')]);return db[_0xa390('0x2b')][_0xa390('0x47')](_0xc93ce6)['then'](handleEntityNotFound(_0x56e037,null))['then'](function(_0x1eb8f0){if(_0x1eb8f0){var _0x59bff0=_0x1eb8f0[_0xa390('0x48')]({'plain':!![]});_0x59bff0=qs['omit'](_0x59bff0,['id',_0xa390('0x49'),_0xa390('0x4a')]);_0x5a135b[_0xa390('0x4b')]=_[_0xa390('0x4c')](_0x5a135b[_0xa390('0x4b')],['id',_0xa390('0x49'),_0xa390('0x4a')]);return db[_0xa390('0x2b')]['create'](_[_0xa390('0x3d')](_0x59bff0,_0x5a135b[_0xa390('0x4b')]),{'include':_0x5a135b['query'][_0xa390('0x40')]?[{'all':!![]}]:undefined});}})[_0xa390('0x24')](respondWithResult(_0x56e037,0xc9))[_0xa390('0x45')](handleError(_0x56e037,null));};exports[_0xa390('0x4d')]=function(_0x3e120e,_0xa53225){if(_0x3e120e[_0xa390('0x4b')]['id']){delete _0x3e120e[_0xa390('0x4b')]['id'];}return db[_0xa390('0x2b')][_0xa390('0x47')]({'where':{'id':_0x3e120e[_0xa390('0x43')]['id']}})[_0xa390('0x24')](handleEntityNotFound(_0xa53225,null))[_0xa390('0x24')](saveUpdates(_0x3e120e[_0xa390('0x4b')],null))[_0xa390('0x24')](respondWithResult(_0xa53225,null))[_0xa390('0x45')](handleError(_0xa53225,null));};exports[_0xa390('0x25')]=function(_0xe68435,_0x5399a1){return db['Attachment'][_0xa390('0x47')]({'where':{'id':_0xe68435[_0xa390('0x43')]['id']}})['then'](handleEntityNotFound(_0x5399a1,null))['then'](removeEntity(_0x5399a1,null))['catch'](handleError(_0x5399a1,null));};exports[_0xa390('0x4e')]=function(_0x457a58,_0x2a6183,_0x16d859){_0x457a58[_0xa390('0x4b')]['name']=_0x457a58['file']['originalname'];_0x457a58[_0xa390('0x4b')][_0xa390('0x4f')]=_0x457a58[_0xa390('0x50')]['filename'];_0x457a58[_0xa390('0x4b')][_0xa390('0x51')]=_0x457a58[_0xa390('0x50')][_0xa390('0x52')];return db[_0xa390('0x2b')][_0xa390('0x4e')](_0x457a58['body'])[_0xa390('0x24')](respondWithResult(_0x2a6183,0xc9))['catch'](handleError(_0x2a6183,null));};exports[_0xa390('0x53')]=function(_0x132cc4,_0x370c0c,_0x5a8293){return db['Attachment'][_0xa390('0x54')]({'where':{'id':_0x132cc4[_0xa390('0x43')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x370c0c,null))[_0xa390('0x24')](function(_0x15ef09){if(_0x15ef09){return _0x370c0c[_0xa390('0x53')](path[_0xa390('0x55')](config[_0xa390('0x56')],'server/files/attachments/',_0x15ef09[_0xa390('0x4f')]));}})[_0xa390('0x45')](handleError(_0x370c0c,null));}; \ No newline at end of file +var _0x2659=['offset','limit','set','Content-Range','apply','update','then','destroy','error','name','send','map','Attachment','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','clone','rawAttributes','omit','body','updatedAt','create','catch','file','originalname','basename','filename','mimetype','download','join','root','server/files/attachments/','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','squel','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x2659,0xd6));var _0x9265=function(_0x217a6f,_0x3ecd8b){_0x217a6f=_0x217a6f-0x0;var _0x5553f3=_0x2659[_0x217a6f];return _0x5553f3;};'use strict';var pdf=require(_0x9265('0x0'));var emlformat=require(_0x9265('0x1'));var rimraf=require(_0x9265('0x2'));var zipdir=require(_0x9265('0x3'));var jsonpatch=require(_0x9265('0x4'));var rp=require(_0x9265('0x5'));var moment=require(_0x9265('0x6'));var BPromise=require(_0x9265('0x7'));var Mustache=require('mustache');var util=require(_0x9265('0x8'));var path=require(_0x9265('0x9'));var sox=require(_0x9265('0xa'));var csv=require('to-csv');var ejs=require(_0x9265('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9265('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9265('0xd'));var toCsv=require(_0x9265('0xe'));var querystring=require(_0x9265('0xf'));var Papa=require(_0x9265('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9265('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9265('0x12'))(_0x9265('0x13'));var utils=require(_0x9265('0x14'));var config=require(_0x9265('0x15'));var db=require(_0x9265('0x16'))['db'];function respondWithStatusCode(_0x7215ba,_0x163d09){_0x163d09=_0x163d09||0xcc;return function(_0x40cbed){if(_0x40cbed){return _0x7215ba[_0x9265('0x17')](_0x163d09);}return _0x7215ba[_0x9265('0x18')](_0x163d09)['end']();};}function respondWithResult(_0x3afb75,_0x5260d8){_0x5260d8=_0x5260d8||0xc8;return function(_0x194edd){if(_0x194edd){return _0x3afb75[_0x9265('0x18')](_0x5260d8)['json'](_0x194edd);}};}function respondWithFilteredResult(_0x3642d1,_0x49ed19){return function(_0x5c4d0a){if(_0x5c4d0a){var _0x17314f=_0x5c4d0a[_0x9265('0x19')],_0x130474=_0x49ed19[_0x9265('0x1a')],_0x4ae204=_0x49ed19[_0x9265('0x1a')]+_0x49ed19[_0x9265('0x1b')],_0x4c2b37;if(_0x4ae204>=_0x17314f){_0x4ae204=_0x17314f;_0x4c2b37=0xc8;}else{_0x4c2b37=0xce;}_0x3642d1[_0x9265('0x18')](_0x4c2b37);return _0x3642d1[_0x9265('0x1c')](_0x9265('0x1d'),_0x130474+'-'+_0x4ae204+'/'+_0x17314f)['json'](_0x5c4d0a);}return null;};}function patchUpdates(_0x283dc1){return function(_0xb7b2e7){try{jsonpatch[_0x9265('0x1e')](_0xb7b2e7,_0x283dc1,!![]);}catch(_0x2413e8){return BPromise['reject'](_0x2413e8);}return _0xb7b2e7['save']();};}function saveUpdates(_0x25ff29,_0x1cf46e){return function(_0x1b2d14){if(_0x1b2d14){return _0x1b2d14[_0x9265('0x1f')](_0x25ff29)[_0x9265('0x20')](function(_0x124742){return _0x124742;});}return null;};}function removeEntity(_0x3e4784,_0x24e9b8){return function(_0x13eaa9){if(_0x13eaa9){return _0x13eaa9[_0x9265('0x21')]()['then'](function(){_0x3e4784[_0x9265('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e9622,_0x55ae1c){return function(_0x3e7143){if(!_0x3e7143){_0x2e9622[_0x9265('0x17')](0x194);}return _0x3e7143;};}function handleError(_0xe2be90,_0x2cae98){_0x2cae98=_0x2cae98||0x1f4;return function(_0x367716){logger[_0x9265('0x22')](_0x367716['stack']);if(_0x367716[_0x9265('0x23')]){delete _0x367716[_0x9265('0x23')];}_0xe2be90[_0x9265('0x18')](_0x2cae98)[_0x9265('0x24')](_0x367716);};}exports['index']=function(_0x193bd0,_0x140900){var _0x3a1c38={},_0x2b0f68={},_0x11a2eb={'count':0x0,'rows':[]};var _0x2393de=_[_0x9265('0x25')](db[_0x9265('0x26')]['rawAttributes'],function(_0x3020a9){return{'name':_0x3020a9['fieldName'],'type':_0x3020a9['type']['key']};});_0x2b0f68[_0x9265('0x27')]=_['map'](_0x2393de,_0x9265('0x23'));_0x2b0f68[_0x9265('0x28')]=_['keys'](_0x193bd0[_0x9265('0x28')]);_0x2b0f68[_0x9265('0x29')]=_[_0x9265('0x2a')](_0x2b0f68['model'],_0x2b0f68[_0x9265('0x28')]);_0x3a1c38['attributes']=_[_0x9265('0x2a')](_0x2b0f68[_0x9265('0x27')],qs[_0x9265('0x2b')](_0x193bd0[_0x9265('0x28')][_0x9265('0x2b')]));_0x3a1c38[_0x9265('0x2c')]=_0x3a1c38[_0x9265('0x2c')][_0x9265('0x2d')]?_0x3a1c38['attributes']:_0x2b0f68[_0x9265('0x27')];if(!_0x193bd0[_0x9265('0x28')][_0x9265('0x2e')](_0x9265('0x2f'))){_0x3a1c38['limit']=qs[_0x9265('0x1b')](_0x193bd0[_0x9265('0x28')][_0x9265('0x1b')]);_0x3a1c38[_0x9265('0x1a')]=qs[_0x9265('0x1a')](_0x193bd0[_0x9265('0x28')][_0x9265('0x1a')]);}_0x3a1c38[_0x9265('0x30')]=qs['sort'](_0x193bd0[_0x9265('0x28')][_0x9265('0x31')]);_0x3a1c38['where']=qs[_0x9265('0x29')](_['pick'](_0x193bd0[_0x9265('0x28')],_0x2b0f68[_0x9265('0x29')]));if(_0x193bd0[_0x9265('0x28')][_0x9265('0x32')]){_0x3a1c38['where']=_[_0x9265('0x33')](_0x3a1c38[_0x9265('0x34')],{'$or':_['map'](_0x2393de,function(_0x544f76){if(_0x544f76[_0x9265('0x35')]!==_0x9265('0x36')){var _0x211a6b={};_0x211a6b[_0x544f76['name']]={'$like':'%'+_0x193bd0['query'][_0x9265('0x32')]+'%'};return _0x211a6b;}})});}_0x3a1c38=_[_0x9265('0x33')]({},_0x3a1c38,_0x193bd0[_0x9265('0x37')]);var _0x473939={'where':_0x3a1c38[_0x9265('0x34')]};return db['Attachment']['count'](_0x473939)[_0x9265('0x20')](function(_0x27a78d){_0x11a2eb[_0x9265('0x19')]=_0x27a78d;if(_0x193bd0['query'][_0x9265('0x38')]){_0x3a1c38[_0x9265('0x39')]=[{'all':!![]}];}return db[_0x9265('0x26')][_0x9265('0x3a')](_0x3a1c38);})[_0x9265('0x20')](function(_0x1f8187){_0x11a2eb[_0x9265('0x3b')]=_0x1f8187;return _0x11a2eb;})[_0x9265('0x20')](respondWithFilteredResult(_0x140900,_0x3a1c38))['catch'](handleError(_0x140900,null));};exports[_0x9265('0x3c')]=function(_0x5187e4,_0x3d4331){var _0x1bb507={'raw':!![],'where':{'id':_0x5187e4[_0x9265('0x3d')]['id']}},_0x5aee59={};_0x5aee59[_0x9265('0x27')]=_[_0x9265('0x3e')](db[_0x9265('0x26')]['rawAttributes']);_0x5aee59[_0x9265('0x28')]=_['keys'](_0x5187e4[_0x9265('0x28')]);_0x5aee59[_0x9265('0x29')]=_[_0x9265('0x2a')](_0x5aee59[_0x9265('0x27')],_0x5aee59[_0x9265('0x28')]);_0x1bb507[_0x9265('0x2c')]=_['intersection'](_0x5aee59[_0x9265('0x27')],qs[_0x9265('0x2b')](_0x5187e4[_0x9265('0x28')]['fields']));_0x1bb507[_0x9265('0x2c')]=_0x1bb507[_0x9265('0x2c')][_0x9265('0x2d')]?_0x1bb507[_0x9265('0x2c')]:_0x5aee59[_0x9265('0x27')];if(_0x5187e4[_0x9265('0x28')][_0x9265('0x38')]){_0x1bb507[_0x9265('0x39')]=[{'all':!![]}];}_0x1bb507=_[_0x9265('0x33')]({},_0x1bb507,_0x5187e4[_0x9265('0x37')]);return db[_0x9265('0x26')][_0x9265('0x3f')](_0x1bb507)[_0x9265('0x20')](handleEntityNotFound(_0x3d4331,null))[_0x9265('0x20')](respondWithResult(_0x3d4331,null))['catch'](handleError(_0x3d4331,null));};exports[_0x9265('0x40')]=function(_0x1386cc,_0x8f3775){var _0x505883={'where':{'id':_0x1386cc[_0x9265('0x3d')]['id']}},_0x46576b={};_0x46576b[_0x9265('0x27')]=_[_0x9265('0x3e')](db[_0x9265('0x26')][_0x9265('0x41')]);_0x505883['attributes']=_['intersection'](_0x46576b[_0x9265('0x27')],qs['fields'](_0x1386cc['query'][_0x9265('0x2b')]));_0x505883[_0x9265('0x2c')]=_0x505883['attributes'][_0x9265('0x2d')]?_0x505883[_0x9265('0x2c')]:_0x46576b[_0x9265('0x27')];if(_0x1386cc[_0x9265('0x28')]['includeAll']){_0x505883[_0x9265('0x39')]=[{'all':!![]}];}_0x505883=_[_0x9265('0x33')]({},_0x505883,_0x1386cc[_0x9265('0x37')]);return db['Attachment'][_0x9265('0x3f')](_0x505883)[_0x9265('0x20')](handleEntityNotFound(_0x8f3775,null))[_0x9265('0x20')](function(_0x3031dc){if(_0x3031dc){var _0x39bf06=_0x3031dc['get']({'plain':!![]});_0x39bf06=qs[_0x9265('0x42')](_0x39bf06,['id','createdAt','updatedAt']);_0x1386cc[_0x9265('0x43')]=_[_0x9265('0x42')](_0x1386cc[_0x9265('0x43')],['id','createdAt',_0x9265('0x44')]);return db[_0x9265('0x26')][_0x9265('0x45')](_[_0x9265('0x33')](_0x39bf06,_0x1386cc[_0x9265('0x43')]),{'include':_0x1386cc[_0x9265('0x28')][_0x9265('0x38')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x8f3775,0xc9))[_0x9265('0x46')](handleError(_0x8f3775,null));};exports[_0x9265('0x1f')]=function(_0x2975dd,_0x2cd352){if(_0x2975dd[_0x9265('0x43')]['id']){delete _0x2975dd[_0x9265('0x43')]['id'];}return db[_0x9265('0x26')][_0x9265('0x3f')]({'where':{'id':_0x2975dd['params']['id']}})[_0x9265('0x20')](handleEntityNotFound(_0x2cd352,null))['then'](saveUpdates(_0x2975dd[_0x9265('0x43')],null))['then'](respondWithResult(_0x2cd352,null))[_0x9265('0x46')](handleError(_0x2cd352,null));};exports[_0x9265('0x21')]=function(_0x3159c5,_0x361ae0){return db[_0x9265('0x26')][_0x9265('0x3f')]({'where':{'id':_0x3159c5[_0x9265('0x3d')]['id']}})[_0x9265('0x20')](handleEntityNotFound(_0x361ae0,null))['then'](removeEntity(_0x361ae0,null))[_0x9265('0x46')](handleError(_0x361ae0,null));};exports[_0x9265('0x45')]=function(_0x34c4ec,_0x34a919,_0xca6ea3){_0x34c4ec[_0x9265('0x43')][_0x9265('0x23')]=_0x34c4ec[_0x9265('0x47')][_0x9265('0x48')];_0x34c4ec['body'][_0x9265('0x49')]=_0x34c4ec[_0x9265('0x47')][_0x9265('0x4a')];_0x34c4ec[_0x9265('0x43')][_0x9265('0x35')]=_0x34c4ec[_0x9265('0x47')][_0x9265('0x4b')];return db['Attachment'][_0x9265('0x45')](_0x34c4ec['body'])[_0x9265('0x20')](respondWithResult(_0x34a919,0xc9))['catch'](handleError(_0x34a919,null));};exports[_0x9265('0x4c')]=function(_0x1c6763,_0x3232e5,_0x21cf35){return db['Attachment']['findOne']({'where':{'id':_0x1c6763['params']['id']},'raw':!![]})[_0x9265('0x20')](handleEntityNotFound(_0x3232e5,null))[_0x9265('0x20')](function(_0x344666){if(_0x344666){return _0x3232e5['download'](path[_0x9265('0x4d')](config[_0x9265('0x4e')],_0x9265('0x4f'),_0x344666['basename']));}})[_0x9265('0x46')](handleError(_0x3232e5,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index b49055b..0cab18a 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 _0xa846=['define','attachments','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0xd68edb,_0xc0092b){var _0x19142b=function(_0x28552e){while(--_0x28552e){_0xd68edb['push'](_0xd68edb['shift']());}};_0x19142b(++_0xc0092b);}(_0xa846,0x70));var _0x6a84=function(_0x2e5baf,_0x4b77a1){_0x2e5baf=_0x2e5baf-0x0;var _0x4c0797=_0xa846[_0x2e5baf];return _0x4c0797;};'use strict';var _=require('lodash');var util=require(_0x6a84('0x0'));var logger=require(_0x6a84('0x1'))(_0x6a84('0x2'));var moment=require(_0x6a84('0x3'));var BPromise=require(_0x6a84('0x4'));var rp=require(_0x6a84('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6a84('0x6'));var config=require(_0x6a84('0x7'));var attributes=require('./attachment.attributes');module[_0x6a84('0x8')]=function(_0x1d803f,_0x42c692){return _0x1d803f[_0x6a84('0x9')]('Attachment',attributes,{'tableName':_0x6a84('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2032=['attachments','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment'];(function(_0x49424f,_0x129f4b){var _0x41eb17=function(_0x296740){while(--_0x296740){_0x49424f['push'](_0x49424f['shift']());}};_0x41eb17(++_0x129f4b);}(_0x2032,0xd9));var _0x2203=function(_0x15540c,_0x4eee87){_0x15540c=_0x15540c-0x0;var _0x453d29=_0x2032[_0x15540c];return _0x453d29;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 33e47bc..c22ed61 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 _0xc3c6=['debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','options','info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','Attachment,\x20%s,\x20%s'];(function(_0x5b814a,_0x48fa1e){var _0x43f574=function(_0x35ffd3){while(--_0x35ffd3){_0x5b814a['push'](_0x5b814a['shift']());}};_0x43f574(++_0x48fa1e);}(_0xc3c6,0x101));var _0x6c3c=function(_0x130870,_0x251de1){_0x130870=_0x130870-0x0;var _0x3c6a4b=_0xc3c6[_0x130870];return _0x3c6a4b;};'use strict';var _=require(_0x6c3c('0x0'));var util=require(_0x6c3c('0x1'));var moment=require('moment');var BPromise=require(_0x6c3c('0x2'));var rs=require(_0x6c3c('0x3'));var fs=require('fs');var Redis=require(_0x6c3c('0x4'));var db=require(_0x6c3c('0x5'))['db'];var utils=require(_0x6c3c('0x6'));var logger=require(_0x6c3c('0x7'))(_0x6c3c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6c3c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x556566,_0x417d5d,_0xc17269){return new BPromise(function(_0x2d6e15,_0x7ebfb0){return client[_0x6c3c('0xa')](_0x556566,_0xc17269)[_0x6c3c('0xb')](function(_0xd53885){logger['info'](_0x6c3c('0xc'),_0x417d5d,'request\x20sent');logger[_0x6c3c('0xd')](_0x6c3c('0xe'),_0x417d5d,_0x6c3c('0xf'),JSON[_0x6c3c('0x10')](_0xd53885));if(_0xd53885[_0x6c3c('0x11')]){if(_0xd53885[_0x6c3c('0x11')][_0x6c3c('0x12')]===0x1f4){logger[_0x6c3c('0x11')](_0x6c3c('0xc'),_0x417d5d,_0xd53885[_0x6c3c('0x11')][_0x6c3c('0x13')]);return _0x7ebfb0(_0xd53885[_0x6c3c('0x11')][_0x6c3c('0x13')]);}logger[_0x6c3c('0x11')](_0x6c3c('0xc'),_0x417d5d,_0xd53885[_0x6c3c('0x11')][_0x6c3c('0x13')]);return _0x2d6e15(_0xd53885[_0x6c3c('0x11')][_0x6c3c('0x13')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x417d5d,_0x6c3c('0xf'));_0x2d6e15(_0xd53885[_0x6c3c('0x14')][_0x6c3c('0x13')]);}})[_0x6c3c('0x15')](function(_0x4f9e48){logger[_0x6c3c('0x11')](_0x6c3c('0xc'),_0x417d5d,_0x4f9e48);_0x7ebfb0(_0x4f9e48);});});}exports[_0x6c3c('0x16')]=function(_0x28ce65){var _0x27d373=this;return new Promise(function(_0x5eb65d,_0x35d779){return db[_0x6c3c('0x17')][_0x6c3c('0x18')](_0x28ce65['body'],{'raw':_0x28ce65[_0x6c3c('0x19')]?_0x28ce65[_0x6c3c('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x6c3c('0xb')](function(_0xbfd164){logger[_0x6c3c('0x1a')](_0x6c3c('0x16'),_0x28ce65);logger[_0x6c3c('0xd')](_0x6c3c('0x16'),_0x28ce65,JSON[_0x6c3c('0x10')](_0xbfd164));_0x5eb65d(_0xbfd164);})[_0x6c3c('0x15')](function(_0x2b1942){logger[_0x6c3c('0x11')](_0x6c3c('0x16'),_0x2b1942[_0x6c3c('0x13')],_0x28ce65);_0x35d779(_0x27d373[_0x6c3c('0x11')](0x1f4,_0x2b1942[_0x6c3c('0x13')]));});});}; \ No newline at end of file +var _0x72e8=['Attachment,\x20%s,\x20%s','request\x20sent','error','message','info','result','Attachment','create','options','CreateAttachment','debug','stringify','util','moment','randomstring','ioredis','rpc','http','then'];(function(_0x205f87,_0x20ce3a){var _0x2c85a5=function(_0x2c0ddd){while(--_0x2c0ddd){_0x205f87['push'](_0x205f87['shift']());}};_0x2c85a5(++_0x20ce3a);}(_0x72e8,0x7e));var _0x872e=function(_0x2a1bce,_0x284a0e){_0x2a1bce=_0x2a1bce-0x0;var _0x3746c4=_0x72e8[_0x2a1bce];return _0x3746c4;};'use strict';var _=require('lodash');var util=require(_0x872e('0x0'));var moment=require(_0x872e('0x1'));var BPromise=require('bluebird');var rs=require(_0x872e('0x2'));var fs=require('fs');var Redis=require(_0x872e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x872e('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x872e('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x372f0b,_0x45c163,_0x5b6bbd){return new BPromise(function(_0x43f7a2,_0x5d7527){return client['request'](_0x372f0b,_0x5b6bbd)[_0x872e('0x6')](function(_0x35bb7a){logger['info'](_0x872e('0x7'),_0x45c163,_0x872e('0x8'));logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0x45c163,_0x872e('0x8'),JSON['stringify'](_0x35bb7a));if(_0x35bb7a[_0x872e('0x9')]){if(_0x35bb7a[_0x872e('0x9')]['code']===0x1f4){logger[_0x872e('0x9')]('Attachment,\x20%s,\x20%s',_0x45c163,_0x35bb7a[_0x872e('0x9')]['message']);return _0x5d7527(_0x35bb7a[_0x872e('0x9')][_0x872e('0xa')]);}logger[_0x872e('0x9')](_0x872e('0x7'),_0x45c163,_0x35bb7a['error'][_0x872e('0xa')]);return _0x43f7a2(_0x35bb7a[_0x872e('0x9')][_0x872e('0xa')]);}else{logger[_0x872e('0xb')]('Attachment,\x20%s,\x20%s',_0x45c163,_0x872e('0x8'));_0x43f7a2(_0x35bb7a[_0x872e('0xc')][_0x872e('0xa')]);}})['catch'](function(_0x595868){logger[_0x872e('0x9')](_0x872e('0x7'),_0x45c163,_0x595868);_0x5d7527(_0x595868);});});}exports['CreateAttachment']=function(_0x2ee16a){var _0x4d5a59=this;return new Promise(function(_0xf16031,_0xf537fb){return db[_0x872e('0xd')][_0x872e('0xe')](_0x2ee16a['body'],{'raw':_0x2ee16a[_0x872e('0xf')]?_0x2ee16a[_0x872e('0xf')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1877b7){logger[_0x872e('0xb')](_0x872e('0x10'),_0x2ee16a);logger[_0x872e('0x11')](_0x872e('0x10'),_0x2ee16a,JSON[_0x872e('0x12')](_0x1877b7));_0xf16031(_0x1877b7);})['catch'](function(_0x4b8ce0){logger[_0x872e('0x9')]('CreateAttachment',_0x4b8ce0[_0x872e('0xa')],_0x2ee16a);_0xf537fb(_0x4d5a59[_0x872e('0x9')](0x1f4,_0x4b8ce0[_0x872e('0xa')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index c2dc126..ccf4831 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 _0x97e7=['post','/:id/clone','clone','diskStorage','root','server/files/attachments/','originalname','single','file','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','./attachment.controller','get','index','/:id','isAuthenticated','show','/:id/download'];(function(_0x29b929,_0x2a4b10){var _0x3a8ce6=function(_0x1e2759){while(--_0x1e2759){_0x29b929['push'](_0x29b929['shift']());}};_0x3a8ce6(++_0x2a4b10);}(_0x97e7,0x7a));var _0x797e=function(_0x54458c,_0x28bb7d){_0x54458c=_0x54458c-0x0;var _0x398da9=_0x97e7[_0x54458c];return _0x398da9;};'use strict';var multer=require(_0x797e('0x0'));var util=require(_0x797e('0x1'));var path=require('path');var timeout=require(_0x797e('0x2'));var express=require(_0x797e('0x3'));var router=express[_0x797e('0x4')]();var auth=require(_0x797e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x797e('0x6'));router[_0x797e('0x7')]('/',auth['isAuthenticated'](),controller[_0x797e('0x8')]);router['get'](_0x797e('0x9'),auth[_0x797e('0xa')](),controller[_0x797e('0xb')]);router['get'](_0x797e('0xc'),auth[_0x797e('0xa')](),controller['download']);router[_0x797e('0xd')](_0x797e('0xe'),auth[_0x797e('0xa')](),controller[_0x797e('0xf')]);var upload=multer({'storage':multer[_0x797e('0x10')]({'destination':function(_0x12ed5d,_0x488fc1,_0x43e0e8){_0x43e0e8(null,path['join'](config[_0x797e('0x11')],_0x797e('0x12')));},'filename':function(_0x3da234,_0x302ccb,_0x5b7315){_0x5b7315(null,util['format']('%s-%s',Date['now'](),_0x302ccb[_0x797e('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x797e('0xd')]('/',upload[_0x797e('0x14')](_0x797e('0x15')),controller[_0x797e('0x16')]);router[_0x797e('0x17')]('/:id',auth[_0x797e('0xa')](),controller['update']);router[_0x797e('0x18')](_0x797e('0x9'),auth[_0x797e('0xa')](),controller[_0x797e('0x19')]);module[_0x797e('0x1a')]=router; \ No newline at end of file +var _0x80e4=['format','%s-%s','now','originalname','file','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','clone','diskStorage','root','server/files/attachments/'];(function(_0xe9a4e8,_0xbfccf0){var _0x5b6db3=function(_0x1c5984){while(--_0x1c5984){_0xe9a4e8['push'](_0xe9a4e8['shift']());}};_0x5b6db3(++_0xbfccf0);}(_0x80e4,0x103));var _0x480e=function(_0x53d172,_0x46611b){_0x53d172=_0x53d172-0x0;var _0x1bd0a2=_0x80e4[_0x53d172];return _0x1bd0a2;};'use strict';var multer=require(_0x480e('0x0'));var util=require(_0x480e('0x1'));var path=require(_0x480e('0x2'));var timeout=require('connect-timeout');var express=require(_0x480e('0x3'));var router=express[_0x480e('0x4')]();var auth=require(_0x480e('0x5'));var interaction=require(_0x480e('0x6'));var config=require(_0x480e('0x7'));var controller=require('./attachment.controller');router[_0x480e('0x8')]('/',auth[_0x480e('0x9')](),controller[_0x480e('0xa')]);router[_0x480e('0x8')](_0x480e('0xb'),auth[_0x480e('0x9')](),controller[_0x480e('0xc')]);router[_0x480e('0x8')](_0x480e('0xd'),auth[_0x480e('0x9')](),controller[_0x480e('0xe')]);router[_0x480e('0xf')]('/:id/clone',auth[_0x480e('0x9')](),controller[_0x480e('0x10')]);var upload=multer({'storage':multer[_0x480e('0x11')]({'destination':function(_0x234eba,_0x30fb77,_0x3eb5eb){_0x3eb5eb(null,path['join'](config[_0x480e('0x12')],_0x480e('0x13')));},'filename':function(_0x1abb70,_0xbd69cf,_0x5ced0f){_0x5ced0f(null,util[_0x480e('0x14')](_0x480e('0x15'),Date[_0x480e('0x16')](),_0xbd69cf[_0x480e('0x17')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x480e('0xf')]('/',upload['single'](_0x480e('0x18')),controller[_0x480e('0x19')]);router[_0x480e('0x1a')](_0x480e('0xb'),auth['isAuthenticated'](),controller[_0x480e('0x1b')]);router[_0x480e('0x1c')](_0x480e('0xb'),auth[_0x480e('0x9')](),controller[_0x480e('0x1d')]);module[_0x480e('0x1e')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index c1ed1a0..2943016 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 _0x9408=['clientSecret','callbackURL','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','disabled','blockedAt','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../components/auth/service','signToken','login','authenticate','google','/login','callback','use','clientID'];(function(_0x3f8e5e,_0x45dd58){var _0x1214cb=function(_0x518f8a){while(--_0x518f8a){_0x3f8e5e['push'](_0x3f8e5e['shift']());}};_0x1214cb(++_0x45dd58);}(_0x9408,0x109));var _0x8940=function(_0x1794b1,_0x44ccc8){_0x1794b1=_0x1794b1-0x0;var _0x39cb44=_0x9408[_0x1794b1];return _0x39cb44;};'use strict';var _=require(_0x8940('0x0'));var passport=require(_0x8940('0x1'));var GoogleStrategy=require(_0x8940('0x2'))[_0x8940('0x3')];var moment=require(_0x8940('0x4'));var db=require(_0x8940('0x5'))['db'];var config=require('../../config/environment');var signToken=require(_0x8940('0x6'))[_0x8940('0x7')];var utils=require('../../config/utils');exports[_0x8940('0x8')]=passport[_0x8940('0x9')](_0x8940('0xa'),{'failureRedirect':_0x8940('0xb'),'scope':['profile','email'],'session':![]});exports[_0x8940('0xc')]=passport['authenticate'](_0x8940('0xa'),{'failureRedirect':_0x8940('0xb'),'session':![]});passport[_0x8940('0xd')](new GoogleStrategy({'clientID':config[_0x8940('0xa')]?config[_0x8940('0xa')][_0x8940('0xe')]:'id','clientSecret':config[_0x8940('0xa')]?config[_0x8940('0xa')][_0x8940('0xf')]:'secret','callbackURL':config['google']?config[_0x8940('0xa')][_0x8940('0x10')]:''},function(_0x55084b,_0x3e0bf5,_0x3e420b,_0x2a9ed2){var _0x2276ab,_0x3aaee5;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x8940('0x11'),_0x8940('0x12')],'raw':!![]})[_0x8940('0x13')](function(_0xd76591){_0x2276ab=_0xd76591;return db[_0x8940('0x14')][_0x8940('0x15')]({'where':{'email':_[_0x8940('0x16')](_0x3e420b['emails'],_0x8940('0x17')),'role':{'$or':[_0x8940('0x18'),_0x8940('0x19'),_0x8940('0x1a')]}}});})[_0x8940('0x13')](function(_0x5455a5){_0x3aaee5=_0x5455a5;if(_0x3aaee5){if(_0x3aaee5[_0x8940('0x1b')]){return _0x2a9ed2('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x2276ab[_0x8940('0x12')]>0x0){if(_0x3aaee5['blocked']){if(moment(_0x3aaee5[_0x8940('0x1c')])[_0x8940('0x1d')](_0x2276ab[_0x8940('0x12')],_0x8940('0x1e'))>moment()){return _0x2a9ed2(_0x8940('0x1f'));}else{return utils[_0x8940('0x20')](_0x3aaee5,0x0,![],null)[_0x8940('0x13')](function(){return utils[_0x8940('0x21')](_0x3aaee5);})[_0x8940('0x13')](function(){return _0x2a9ed2(null,_0x3aaee5);});}}else{return utils[_0x8940('0x21')](_0x3aaee5)[_0x8940('0x13')](function(){return _0x2a9ed2(null,_0x3aaee5);});}}else{return utils[_0x8940('0x21')](_0x3aaee5)[_0x8940('0x13')](function(){return _0x2a9ed2(null,_0x3aaee5);});}}return _0x2a9ed2(_0x8940('0x1f'));})[_0x8940('0x22')](function(_0x562fcb){_0x2a9ed2(_0x562fcb);});})); \ No newline at end of file +var _0x5afc=['blockedAt','add','minutes','getLicense','lodash','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','profile','email','callback','/login','clientID','secret','callbackURL','Setting','findOne','blockDuration','then','User','emails','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked'];(function(_0x2ef2dc,_0x40be6a){var _0xefdade=function(_0x165f33){while(--_0x165f33){_0x2ef2dc['push'](_0x2ef2dc['shift']());}};_0xefdade(++_0x40be6a);}(_0x5afc,0x88));var _0xc5af=function(_0xd449,_0x346ad6){_0xd449=_0xd449-0x0;var _0xfb8b4a=_0x5afc[_0xd449];return _0xfb8b4a;};'use strict';var _=require(_0xc5af('0x0'));var passport=require('passport');var GoogleStrategy=require('passport-google-oauth20')[_0xc5af('0x1')];var moment=require(_0xc5af('0x2'));var db=require(_0xc5af('0x3'))['db'];var config=require(_0xc5af('0x4'));var signToken=require(_0xc5af('0x5'))[_0xc5af('0x6')];var utils=require(_0xc5af('0x7'));exports[_0xc5af('0x8')]=passport[_0xc5af('0x9')](_0xc5af('0xa'),{'failureRedirect':'/login','scope':[_0xc5af('0xb'),_0xc5af('0xc')],'session':![]});exports[_0xc5af('0xd')]=passport['authenticate']('google',{'failureRedirect':_0xc5af('0xe'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0xc5af('0xa')]?config[_0xc5af('0xa')][_0xc5af('0xf')]:'id','clientSecret':config[_0xc5af('0xa')]?config['google']['clientSecret']:_0xc5af('0x10'),'callbackURL':config[_0xc5af('0xa')]?config[_0xc5af('0xa')][_0xc5af('0x11')]:''},function(_0x19f858,_0xe84a7f,_0x4dece0,_0x2ba46a){var _0x80e92c,_0x549283;return db[_0xc5af('0x12')][_0xc5af('0x13')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc5af('0x14')],'raw':!![]})[_0xc5af('0x15')](function(_0x74aa80){_0x80e92c=_0x74aa80;return db[_0xc5af('0x16')]['find']({'where':{'email':_['map'](_0x4dece0[_0xc5af('0x17')],'value'),'role':{'$or':[_0xc5af('0x18'),_0xc5af('0x19'),_0xc5af('0x1a')]}}});})[_0xc5af('0x15')](function(_0x65ddeb){_0x549283=_0x65ddeb;if(_0x549283){if(_0x549283['disabled']){return _0x2ba46a(_0xc5af('0x1b'));}else if(_0x80e92c[_0xc5af('0x14')]>0x0){if(_0x549283[_0xc5af('0x1c')]){if(moment(_0x549283[_0xc5af('0x1d')])[_0xc5af('0x1e')](_0x80e92c[_0xc5af('0x14')],_0xc5af('0x1f'))>moment()){return _0x2ba46a(_0xc5af('0x1b'));}else{return utils['clearBlockUser'](_0x549283,0x0,![],null)[_0xc5af('0x15')](function(){return utils[_0xc5af('0x20')](_0x549283);})[_0xc5af('0x15')](function(){return _0x2ba46a(null,_0x549283);});}}else{return utils['getLicense'](_0x549283)[_0xc5af('0x15')](function(){return _0x2ba46a(null,_0x549283);});}}else{return utils[_0xc5af('0x20')](_0x549283)[_0xc5af('0x15')](function(){return _0x2ba46a(null,_0x549283);});}}return _0x2ba46a(_0xc5af('0x1b'));})['catch'](function(_0x19e334){_0x2ba46a(_0x19e334);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 20e0e92..2fdcbd0 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 _0x1978=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','setTokenCookie','exports','passport','Router'];(function(_0x35dea7,_0x1f7e22){var _0x3ddd9f=function(_0x1cdffd){while(--_0x1cdffd){_0x35dea7['push'](_0x35dea7['shift']());}};_0x3ddd9f(++_0x1f7e22);}(_0x1978,0x174));var _0x8197=function(_0x2ae2bb,_0x47af44){_0x2ae2bb=_0x2ae2bb-0x0;var _0x4912b6=_0x1978[_0x2ae2bb];return _0x4912b6;};'use strict';var express=require('express');var passport=require(_0x8197('0x0'));var router=express[_0x8197('0x1')]();var controller=require(_0x8197('0x2'));var userController=require(_0x8197('0x3'));var authService=require(_0x8197('0x4'));router[_0x8197('0x5')]('/',controller[_0x8197('0x6')]);router[_0x8197('0x5')](_0x8197('0x7'),controller[_0x8197('0x8')],authService['isMiddleware'],userController[_0x8197('0x6')],authService[_0x8197('0x9')]);module[_0x8197('0xa')]=router; \ No newline at end of file +var _0xf9bc=['login','/callback','callback','setTokenCookie','exports','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xf9bc,0x7e));var _0xcf9b=function(_0x4dc9cb,_0x20715b){_0x4dc9cb=_0x4dc9cb-0x0;var _0x809d77=_0xf9bc[_0x4dc9cb];return _0x809d77;};'use strict';var express=require('express');var passport=require(_0xcf9b('0x0'));var router=express[_0xcf9b('0x1')]();var controller=require(_0xcf9b('0x2'));var userController=require(_0xcf9b('0x3'));var authService=require(_0xcf9b('0x4'));router[_0xcf9b('0x5')]('/',controller[_0xcf9b('0x6')]);router[_0xcf9b('0x5')](_0xcf9b('0x7'),controller[_0xcf9b('0x8')],authService['isMiddleware'],userController['login'],authService[_0xcf9b('0x9')]);module[_0xcf9b('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 4ec4c42..2fbbf6c 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 _0xd671=['format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','Email\x20parameter\x20is\x20missing','generate','body','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','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','Reset\x20Email\x20sent!','reset','params','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','Setting','securePassword','save','Password\x20reset!','use','util','passport','passport-local','lodash','moment','../../mysqldb','../../components/auth/service','client','http','allowedLoginAttempts','blockDuration','then','findOne','password','salt','role','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','name','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge'];(function(_0x365a69,_0x78f175){var _0x604e13=function(_0x25c9e4){while(--_0x25c9e4){_0x365a69['push'](_0x365a69['shift']());}};_0x604e13(++_0x78f175);}(_0xd671,0x172));var _0x1d67=function(_0x3ab687,_0x2f3a18){_0x3ab687=_0x3ab687-0x0;var _0x512596=_0xd671[_0x3ab687];return _0x512596;};'use strict';var util=require(_0x1d67('0x0'));var passport=require(_0x1d67('0x1'));var LocalStrategy=require(_0x1d67('0x2'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0x1d67('0x3'));var rs=require('randomstring');var moment=require(_0x1d67('0x4'));var db=require(_0x1d67('0x5'))['db'];var authService=require(_0x1d67('0x6'));var utils=require('../../config/utils');var client=jayson[_0x1d67('0x7')][_0x1d67('0x8')]({'port':0x232b});function localAuthenticate(_0x226100,_0x3568e6,_0x2b7229,_0x525169){var _0x3f5f95,_0x34512d;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x1d67('0x9'),_0x1d67('0xa')],'raw':!![]})[_0x1d67('0xb')](function(_0x195fd5){_0x3f5f95=_0x195fd5;return _0x226100[_0x1d67('0xc')]({'attributes':['id','name',_0x1d67('0xd'),_0x1d67('0xe'),_0x1d67('0xf'),'disabled',_0x1d67('0x10'),_0x1d67('0x11'),_0x1d67('0x12')],'where':{'name':_0x3568e6,'role':{'$or':[_0x1d67('0x13'),_0x1d67('0x14'),_0x1d67('0x15')]}}});})[_0x1d67('0xb')](function(_0x712ab2){if(!_0x712ab2||_0x712ab2&&_0x712ab2['name']!==_0x3568e6){throw new Error(_0x1d67('0x16'));}else{_0x34512d=_0x712ab2;return _0x34512d;}})['then'](function(){_0x34512d[_0x1d67('0x17')](_0x2b7229,function(_0x2b1187,_0x57e815){var _0x339fcc=_0x34512d[_0x1d67('0x12')]+0x1;if(_0x2b1187){return _0x525169(_0x2b1187);}else if(!_0x57e815){if(_0x34512d[_0x1d67('0x18')]){return _0x525169(null,![],{'message':_0x1d67('0x16')});}else if(_0x3f5f95[_0x1d67('0x9')]>0x0){if(_0x34512d['blocked']){if(_0x3f5f95[_0x1d67('0xa')]>0x0){if(moment(_0x34512d[_0x1d67('0x11')])[_0x1d67('0x19')](_0x3f5f95[_0x1d67('0xa')],_0x1d67('0x1a'))>moment()){return _0x525169(null,![],{'message':_0x1d67('0x16')});}else{return utils[_0x1d67('0x1b')](_0x34512d,_0x339fcc,![],null)[_0x1d67('0xb')](function(){return _0x525169(null,![],{'message':_0x1d67('0x16')});});}}else{return _0x525169(null,![],{'message':_0x1d67('0x16')});}}else{if(_0x339fcc>=_0x3f5f95[_0x1d67('0x9')]){return utils[_0x1d67('0x1b')](_0x34512d,0x0,!![],moment())['then'](function(){return _0x525169(null,![],{'message':_0x1d67('0x16')});});}else{return utils['clearBlockUser'](_0x34512d,_0x339fcc,![],null)['then'](function(){return _0x525169(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x525169(null,![],{'message':_0x1d67('0x16')});}}else{if(_0x34512d[_0x1d67('0x18')]){return _0x525169(null,![],{'message':_0x1d67('0x16')});}else if(_0x3f5f95['allowedLoginAttempts']>0x0){if(_0x34512d['blocked']){if(_0x3f5f95[_0x1d67('0xa')]>0x0){if(moment(_0x34512d[_0x1d67('0x11')])[_0x1d67('0x19')](_0x3f5f95[_0x1d67('0xa')],_0x1d67('0x1a'))>moment()){return _0x525169(null,![],{'message':_0x1d67('0x16')});}else{return utils[_0x1d67('0x1b')](_0x34512d,0x0,![],null)[_0x1d67('0xb')](function(){return utils[_0x1d67('0x1c')](_0x34512d);})[_0x1d67('0xb')](function(){return _0x525169(null,_0x34512d);});}}else{return _0x525169(null,![],{'message':_0x1d67('0x16')});}}else{return utils[_0x1d67('0x1b')](_0x34512d,0x0,![],null)[_0x1d67('0xb')](function(){return utils[_0x1d67('0x1c')](_0x34512d);})[_0x1d67('0xb')](function(){return _0x525169(null,_0x34512d);})[_0x1d67('0x1d')](function(_0x19f767){return _0x525169(null,![],_0x19f767);});}}else{if(_0x34512d['blocked']){return _0x525169(null,![],{'message':_0x1d67('0x16')});}else{return utils['getLicense'](_0x34512d)[_0x1d67('0xb')](function(){return _0x525169(null,_0x34512d);});}}}});})[_0x1d67('0x1d')](function(_0x24fb6b){return _0x525169(null,![],_0x24fb6b);});}function sendServiceMail(_0x5267ab){return db[_0x1d67('0x1e')][_0x1d67('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x1d67('0x20'),_0x1d67('0x21')],'include':[{'model':db[_0x1d67('0x22')],'as':_0x1d67('0x23')}]})['then'](function(_0x3b932b){if(!_0x3b932b){throw new Error(_0x1d67('0x24'));}var _0x3d1613={'tls':{'rejectUnauthorized':![]}};if(_0x3b932b[_0x1d67('0x23')]['service']){_0x3d1613['service']=_0x3b932b[_0x1d67('0x23')][_0x1d67('0x25')];}else{_0x3d1613[_0x1d67('0x26')]=_0x3b932b[_0x1d67('0x23')]['host'];_0x3d1613[_0x1d67('0x27')]=_0x3b932b[_0x1d67('0x23')][_0x1d67('0x27')];_0x3d1613[_0x1d67('0x28')]=_0x3b932b['Smtp'][_0x1d67('0x28')];}if(_0x3b932b[_0x1d67('0x23')][_0x1d67('0x29')]){_0x3d1613[_0x1d67('0x2a')]={'user':_0x3b932b[_0x1d67('0x23')]['user'],'pass':_0x3b932b[_0x1d67('0x23')][_0x1d67('0x2b')]};}var _0x153787={'account':_0x3d1613,'message':_[_0x1d67('0x2c')]({'from':util[_0x1d67('0x2d')](_0x1d67('0x2e'),_0x3b932b['name'],_0x3b932b[_0x1d67('0x21')]||_0x3b932b[_0x1d67('0x23')]['user'])},_0x5267ab)};return client['request'](_0x1d67('0x2f'),_0x153787);})[_0x1d67('0xb')](function(_0x592f7c){if(_0x592f7c[_0x1d67('0x30')]){throw new Error(util['format'](_0x1d67('0x31'),_0x592f7c['error'][_0x1d67('0x32')]||JSON['stringify'](_0x592f7c[_0x1d67('0x30')])));}return!![];});}function handleError(_0x3519d6,_0x6bbbbe,_0xb6a46d){return _0x3519d6[_0x1d67('0x33')](_0x6bbbbe||0x1f4)[_0x1d67('0x34')]({'message':_0xb6a46d?_0xb6a46d[_0x1d67('0x32')]||_0xb6a46d:''});}function checkPasswordPattern(_0x7d2740,_0x3cd9c6,_0x19ee10){if(_0x19ee10){var _0x20c063=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x20c063['test'](_0x3cd9c6)){return _0x7d2740;}else{throw new Error(_0x1d67('0x35'));}}else{return _0x7d2740;}}exports[_0x1d67('0x36')]=function(_0x7a99c3,_0x42daf2,_0x5b9067){passport[_0x1d67('0x17')](_0x1d67('0x37'),function(_0x55f758,_0xa69727,_0x515a12){var _0x5f3715=_0x55f758||_0x515a12;if(_0x5f3715){return handleError(_0x42daf2,0x191,_0x5f3715);}if(!_0xa69727){return handleError(_0x42daf2,0x194,{'message':_0x1d67('0x38')});}else{var _0x5295b8={'payload':{'id':_0xa69727['id'],'role':_0xa69727['role']},'options':{'expiresIn':0x15180}};return authService[_0x1d67('0x39')](_0x5295b8)[_0x1d67('0xb')](function(_0x102fe7){_0x42daf2['json']({'id':_0xa69727['id'],'token':_0x102fe7,'statusCall':'','isAlreadyLogged':_0xa69727[_0x1d67('0x3a')]});});}})(_0x7a99c3,_0x42daf2,_0x5b9067);};exports['forgot']=function(_0x2922a2,_0x158340,_0x2257c0){if(!_0x2922a2['body'][_0x1d67('0x21')]){return handleError(_0x158340,0x1f4,{'message':_0x1d67('0x3b')});}var _0xf6cbbe=rs[_0x1d67('0x3c')]();_0x2922a2['body'][_0x1d67('0x21')]=_0x2922a2[_0x1d67('0x3d')][_0x1d67('0x21')]['trim']()['toLowerCase']();var _0x5c0f9e;return db['Setting'][_0x1d67('0xc')]({'where':{'id':0x1},'attributes':[_0x1d67('0x9'),_0x1d67('0xa')],'raw':!![]})['then'](function(_0x1960b4){_0x5c0f9e=_0x1960b4;return db[_0x1d67('0x3e')]['find']({'where':{'email':_0x2922a2['body'][_0x1d67('0x21')]}});})[_0x1d67('0xb')](function(_0x35df67){if(!_0x35df67){throw new Error(_0x1d67('0x3f'));}if(_0x35df67['disabled']){throw new Error(_0x1d67('0x40'));}if(_0x35df67['blocked']){if(moment(_0x35df67[_0x1d67('0x11')])[_0x1d67('0x19')](_0x5c0f9e['blockDuration'],'minutes')>moment()){throw new Error(_0x1d67('0x41'));}else{_0x35df67[_0x1d67('0x10')]=![];_0x35df67[_0x1d67('0x11')]=null;}}_0x35df67[_0x1d67('0x42')]=_0xf6cbbe;_0x35df67['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x35df67['save']();})[_0x1d67('0xb')](function(){return sendServiceMail({'to':_0x2922a2[_0x1d67('0x3d')][_0x1d67('0x21')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x1d67('0x43')+_0x1d67('0x44')+_0x1d67('0x45')+_0x2922a2[_0x1d67('0x46')][_0x1d67('0x26')]+_0x1d67('0x47')+_0xf6cbbe+'\x0a\x0a'+_0x1d67('0x48')});})['then'](function(){_0x158340[_0x1d67('0x33')](0xc8)['send']({'message':_0x1d67('0x49')});})['catch'](function(_0xeed854){return handleError(_0x158340,0x1f4,_0xeed854);});};exports[_0x1d67('0x4a')]=function(_0x3cf3ce,_0x2ba679,_0x4e0845){var _0x2ecb4e;return db[_0x1d67('0x3e')]['find']({'where':{'resetPasswordToken':_0x3cf3ce[_0x1d67('0x4b')]['token'],'resetPasswordExpires':{'$gt':Date[_0x1d67('0x4c')]()}}})['then'](function(_0x323216){_0x2ecb4e=_0x323216;if(!_0x2ecb4e){throw new Error(_0x1d67('0x4d'));}return db[_0x1d67('0x4e')]['findOne']({'attributes':['id',_0x1d67('0x4f')]});})[_0x1d67('0xb')](function(_0x84f484){return checkPasswordPattern(_0x84f484,_0x3cf3ce[_0x1d67('0x3d')][_0x1d67('0xd')],_0x84f484[_0x1d67('0x4f')]);})[_0x1d67('0xb')](function(){_0x2ecb4e[_0x1d67('0xd')]=_0x3cf3ce['body']['password'];_0x2ecb4e[_0x1d67('0x42')]=null;_0x2ecb4e['resetPasswordExpires']=null;return _0x2ecb4e[_0x1d67('0x50')]();})[_0x1d67('0xb')](function(){_0x2ba679[_0x1d67('0x33')](0xc8)[_0x1d67('0x34')]({'message':_0x1d67('0x51')});})['catch'](function(_0x3c34d8){return handleError(_0x2ba679,0x1f4,_0x3c34d8);});};passport[_0x1d67('0x52')](new LocalStrategy({'usernameField':'name','passwordField':_0x1d67('0xd')},function(_0x52475c,_0xa80d7d,_0x5113fc){return localAuthenticate(db[_0x1d67('0x3e')],_0x52475c,_0xa80d7d,_0x5113fc);})); \ No newline at end of file +var _0xd0fe=['Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','merge','format','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','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','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','minutes','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','Password\x20reset!','util','passport','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','client','http','allowedLoginAttempts','then','findOne','password','salt','role','blocked','blockedAt','loginAttempts','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','blockDuration','add','clearBlockUser','getLicense','catch','MailAccount','find'];(function(_0x13f980,_0x1e1c56){var _0x27153c=function(_0x3953d5){while(--_0x3953d5){_0x13f980['push'](_0x13f980['shift']());}};_0x27153c(++_0x1e1c56);}(_0xd0fe,0xdb));var _0xed0f=function(_0x56ac85,_0x3b9f06){_0x56ac85=_0x56ac85-0x0;var _0x232bf5=_0xd0fe[_0x56ac85];return _0x232bf5;};'use strict';var util=require(_0xed0f('0x0'));var passport=require(_0xed0f('0x1'));var LocalStrategy=require('passport-local')[_0xed0f('0x2')];var jayson=require('jayson/promise');var _=require(_0xed0f('0x3'));var rs=require(_0xed0f('0x4'));var moment=require(_0xed0f('0x5'));var db=require(_0xed0f('0x6'))['db'];var authService=require(_0xed0f('0x7'));var utils=require('../../config/utils');var client=jayson[_0xed0f('0x8')][_0xed0f('0x9')]({'port':0x232b});function localAuthenticate(_0x227f72,_0x265ecf,_0xe35300,_0x2a154c){var _0x56a894,_0x7fc67e;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xed0f('0xa'),'blockDuration'],'raw':!![]})[_0xed0f('0xb')](function(_0x45caac){_0x56a894=_0x45caac;return _0x227f72[_0xed0f('0xc')]({'attributes':['id','name',_0xed0f('0xd'),_0xed0f('0xe'),_0xed0f('0xf'),'disabled',_0xed0f('0x10'),_0xed0f('0x11'),_0xed0f('0x12')],'where':{'name':_0x265ecf,'role':{'$or':[_0xed0f('0x13'),_0xed0f('0x14'),_0xed0f('0x15')]}}});})['then'](function(_0x3c8af8){if(!_0x3c8af8||_0x3c8af8&&_0x3c8af8[_0xed0f('0x16')]!==_0x265ecf){throw new Error(_0xed0f('0x17'));}else{_0x7fc67e=_0x3c8af8;return _0x7fc67e;}})['then'](function(){_0x7fc67e[_0xed0f('0x18')](_0xe35300,function(_0x3a75d1,_0x27a3e8){var _0x46085d=_0x7fc67e[_0xed0f('0x12')]+0x1;if(_0x3a75d1){return _0x2a154c(_0x3a75d1);}else if(!_0x27a3e8){if(_0x7fc67e[_0xed0f('0x19')]){return _0x2a154c(null,![],{'message':_0xed0f('0x17')});}else if(_0x56a894[_0xed0f('0xa')]>0x0){if(_0x7fc67e['blocked']){if(_0x56a894[_0xed0f('0x1a')]>0x0){if(moment(_0x7fc67e[_0xed0f('0x11')])[_0xed0f('0x1b')](_0x56a894[_0xed0f('0x1a')],'minutes')>moment()){return _0x2a154c(null,![],{'message':_0xed0f('0x17')});}else{return utils['clearBlockUser'](_0x7fc67e,_0x46085d,![],null)[_0xed0f('0xb')](function(){return _0x2a154c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x2a154c(null,![],{'message':_0xed0f('0x17')});}}else{if(_0x46085d>=_0x56a894[_0xed0f('0xa')]){return utils[_0xed0f('0x1c')](_0x7fc67e,0x0,!![],moment())['then'](function(){return _0x2a154c(null,![],{'message':_0xed0f('0x17')});});}else{return utils[_0xed0f('0x1c')](_0x7fc67e,_0x46085d,![],null)[_0xed0f('0xb')](function(){return _0x2a154c(null,![],{'message':_0xed0f('0x17')});});}}}else{return _0x2a154c(null,![],{'message':_0xed0f('0x17')});}}else{if(_0x7fc67e['disabled']){return _0x2a154c(null,![],{'message':_0xed0f('0x17')});}else if(_0x56a894[_0xed0f('0xa')]>0x0){if(_0x7fc67e[_0xed0f('0x10')]){if(_0x56a894[_0xed0f('0x1a')]>0x0){if(moment(_0x7fc67e[_0xed0f('0x11')])[_0xed0f('0x1b')](_0x56a894[_0xed0f('0x1a')],'minutes')>moment()){return _0x2a154c(null,![],{'message':_0xed0f('0x17')});}else{return utils[_0xed0f('0x1c')](_0x7fc67e,0x0,![],null)[_0xed0f('0xb')](function(){return utils[_0xed0f('0x1d')](_0x7fc67e);})[_0xed0f('0xb')](function(){return _0x2a154c(null,_0x7fc67e);});}}else{return _0x2a154c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x7fc67e,0x0,![],null)[_0xed0f('0xb')](function(){return utils['getLicense'](_0x7fc67e);})[_0xed0f('0xb')](function(){return _0x2a154c(null,_0x7fc67e);})['catch'](function(_0x540e1f){return _0x2a154c(null,![],_0x540e1f);});}}else{if(_0x7fc67e[_0xed0f('0x10')]){return _0x2a154c(null,![],{'message':_0xed0f('0x17')});}else{return utils[_0xed0f('0x1d')](_0x7fc67e)[_0xed0f('0xb')](function(){return _0x2a154c(null,_0x7fc67e);});}}}});})[_0xed0f('0x1e')](function(_0x1c0df7){return _0x2a154c(null,![],_0x1c0df7);});}function sendServiceMail(_0x2642f2){return db[_0xed0f('0x1f')][_0xed0f('0x20')]({'where':{'service':!![]},'attributes':['id',_0xed0f('0x16'),'email'],'include':[{'model':db['MailServerOut'],'as':_0xed0f('0x21')}]})[_0xed0f('0xb')](function(_0x23c78e){if(!_0x23c78e){throw new Error(_0xed0f('0x22'));}var _0x34ca6e={'tls':{'rejectUnauthorized':![]}};if(_0x23c78e[_0xed0f('0x21')][_0xed0f('0x23')]){_0x34ca6e[_0xed0f('0x23')]=_0x23c78e[_0xed0f('0x21')][_0xed0f('0x23')];}else{_0x34ca6e[_0xed0f('0x24')]=_0x23c78e['Smtp'][_0xed0f('0x24')];_0x34ca6e['port']=_0x23c78e[_0xed0f('0x21')][_0xed0f('0x25')];_0x34ca6e[_0xed0f('0x26')]=_0x23c78e[_0xed0f('0x21')][_0xed0f('0x26')];}if(_0x23c78e[_0xed0f('0x21')][_0xed0f('0x27')]){_0x34ca6e[_0xed0f('0x28')]={'user':_0x23c78e['Smtp'][_0xed0f('0x14')],'pass':_0x23c78e['Smtp']['pass']};}var _0x1f36ff={'account':_0x34ca6e,'message':_[_0xed0f('0x29')]({'from':util[_0xed0f('0x2a')]('\x22%s\x22\x20<%s>',_0x23c78e['name'],_0x23c78e[_0xed0f('0x2b')]||_0x23c78e[_0xed0f('0x21')][_0xed0f('0x14')])},_0x2642f2)};return client[_0xed0f('0x2c')](_0xed0f('0x2d'),_0x1f36ff);})[_0xed0f('0xb')](function(_0x104348){if(_0x104348[_0xed0f('0x2e')]){throw new Error(util[_0xed0f('0x2a')](_0xed0f('0x2f'),_0x104348[_0xed0f('0x2e')][_0xed0f('0x30')]||JSON[_0xed0f('0x31')](_0x104348[_0xed0f('0x2e')])));}return!![];});}function handleError(_0x29761e,_0x38400b,_0x385bc3){return _0x29761e['status'](_0x38400b||0x1f4)['send']({'message':_0x385bc3?_0x385bc3[_0xed0f('0x30')]||_0x385bc3:''});}function checkPasswordPattern(_0x1f86c1,_0x2ecfdb,_0x3d46b4){if(_0x3d46b4){var _0x36963a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x36963a[_0xed0f('0x32')](_0x2ecfdb)){return _0x1f86c1;}else{throw new Error(_0xed0f('0x33'));}}else{return _0x1f86c1;}}exports[_0xed0f('0x34')]=function(_0x22e7a7,_0x20db26,_0x342a38){passport[_0xed0f('0x18')](_0xed0f('0x35'),function(_0x48bc10,_0x25dae9,_0x333bb2){var _0x5067f2=_0x48bc10||_0x333bb2;if(_0x5067f2){return handleError(_0x20db26,0x191,_0x5067f2);}if(!_0x25dae9){return handleError(_0x20db26,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x41ae35={'payload':{'id':_0x25dae9['id'],'role':_0x25dae9['role']},'options':{'expiresIn':0x15180}};return authService[_0xed0f('0x36')](_0x41ae35)[_0xed0f('0xb')](function(_0x28d99a){_0x20db26['json']({'id':_0x25dae9['id'],'token':_0x28d99a,'statusCall':'','isAlreadyLogged':_0x25dae9[_0xed0f('0x37')]});});}})(_0x22e7a7,_0x20db26,_0x342a38);};exports[_0xed0f('0x38')]=function(_0x683e85,_0x59f91a,_0x5fe96a){if(!_0x683e85[_0xed0f('0x39')][_0xed0f('0x2b')]){return handleError(_0x59f91a,0x1f4,{'message':_0xed0f('0x3a')});}var _0x4db98c=rs[_0xed0f('0x3b')]();_0x683e85['body'][_0xed0f('0x2b')]=_0x683e85[_0xed0f('0x39')][_0xed0f('0x2b')]['trim']()[_0xed0f('0x3c')]();var _0xb757d6;return db[_0xed0f('0x3d')][_0xed0f('0xc')]({'where':{'id':0x1},'attributes':[_0xed0f('0xa'),_0xed0f('0x1a')],'raw':!![]})[_0xed0f('0xb')](function(_0x52c5c4){_0xb757d6=_0x52c5c4;return db[_0xed0f('0x3e')][_0xed0f('0x20')]({'where':{'email':_0x683e85['body'][_0xed0f('0x2b')]}});})[_0xed0f('0xb')](function(_0x5183aa){if(!_0x5183aa){throw new Error(_0xed0f('0x3f'));}if(_0x5183aa[_0xed0f('0x19')]){throw new Error(_0xed0f('0x40'));}if(_0x5183aa['blocked']){if(moment(_0x5183aa['blockedAt'])['add'](_0xb757d6[_0xed0f('0x1a')],_0xed0f('0x41'))>moment()){throw new Error(_0xed0f('0x42'));}else{_0x5183aa[_0xed0f('0x10')]=![];_0x5183aa['blockedAt']=null;}}_0x5183aa[_0xed0f('0x43')]=_0x4db98c;_0x5183aa[_0xed0f('0x44')]=Date['now']()+0x36ee80;return _0x5183aa[_0xed0f('0x45')]();})['then'](function(){return sendServiceMail({'to':_0x683e85[_0xed0f('0x39')][_0xed0f('0x2b')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xed0f('0x46')+_0xed0f('0x47')+_0xed0f('0x48')+_0x683e85[_0xed0f('0x49')]['host']+_0xed0f('0x4a')+_0x4db98c+'\x0a\x0a'+_0xed0f('0x4b')});})[_0xed0f('0xb')](function(){_0x59f91a['status'](0xc8)[_0xed0f('0x4c')]({'message':_0xed0f('0x4d')});})['catch'](function(_0x1e9d6b){return handleError(_0x59f91a,0x1f4,_0x1e9d6b);});};exports[_0xed0f('0x4e')]=function(_0xbbb1e5,_0x1089fd,_0xdc1a9c){var _0xf46b0a;return db['User']['find']({'where':{'resetPasswordToken':_0xbbb1e5[_0xed0f('0x4f')]['token'],'resetPasswordExpires':{'$gt':Date[_0xed0f('0x50')]()}}})['then'](function(_0x28f7a9){_0xf46b0a=_0x28f7a9;if(!_0xf46b0a){throw new Error(_0xed0f('0x51'));}return db[_0xed0f('0x3d')]['findOne']({'attributes':['id',_0xed0f('0x52')]});})['then'](function(_0x32e3d2){return checkPasswordPattern(_0x32e3d2,_0xbbb1e5[_0xed0f('0x39')][_0xed0f('0xd')],_0x32e3d2[_0xed0f('0x52')]);})[_0xed0f('0xb')](function(){_0xf46b0a['password']=_0xbbb1e5[_0xed0f('0x39')]['password'];_0xf46b0a[_0xed0f('0x43')]=null;_0xf46b0a[_0xed0f('0x44')]=null;return _0xf46b0a[_0xed0f('0x45')]();})[_0xed0f('0xb')](function(){_0x1089fd['status'](0xc8)[_0xed0f('0x4c')]({'message':_0xed0f('0x53')});})[_0xed0f('0x1e')](function(_0x2493e0){return handleError(_0x1089fd,0x1f4,_0x2493e0);});};passport['use'](new LocalStrategy({'usernameField':_0xed0f('0x16'),'passwordField':'password'},function(_0x318875,_0x458961,_0x56336d){return localAuthenticate(db[_0xed0f('0x3e')],_0x318875,_0x458961,_0x56336d);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 1b59de4..65e38ae 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 _0xe803=['/reset/:token','reset','exports','express','Router','post','login','/forgot'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe803,0xa3));var _0x3e80=function(_0x126249,_0xca0ba2){_0x126249=_0x126249-0x0;var _0x212ab6=_0xe803[_0x126249];return _0x212ab6;};'use strict';var express=require(_0x3e80('0x0'));var router=express[_0x3e80('0x1')]();var controller=require('./authLocal.controller');router[_0x3e80('0x2')]('/',controller[_0x3e80('0x3')]);router[_0x3e80('0x2')](_0x3e80('0x4'),controller['forgot']);router[_0x3e80('0x2')](_0x3e80('0x5'),controller[_0x3e80('0x6')]);module[_0x3e80('0x7')]=router; \ No newline at end of file +var _0x461d=['Router','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','exports','express'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x461d,0x1b7));var _0xd461=function(_0xeae037,_0x32a656){_0xeae037=_0xeae037-0x0;var _0x2759ad=_0x461d[_0xeae037];return _0x2759ad;};'use strict';var express=require(_0xd461('0x0'));var router=express[_0xd461('0x1')]();var controller=require(_0xd461('0x2'));router[_0xd461('0x3')]('/',controller[_0xd461('0x4')]);router[_0xd461('0x3')](_0xd461('0x5'),controller[_0xd461('0x6')]);router[_0xd461('0x3')](_0xd461('0x7'),controller[_0xd461('0x8')]);module[_0xd461('0x9')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 46ecff6..26dadc7 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 _0x9d9b=['sequelize','exports','STRING','INTEGER'];(function(_0x313452,_0x5ea1f2){var _0x16c93e=function(_0x2f2950){while(--_0x2f2950){_0x313452['push'](_0x313452['shift']());}};_0x16c93e(++_0x5ea1f2);}(_0x9d9b,0x18c));var _0xb9d9=function(_0xfb6fd1,_0x1429d4){_0xfb6fd1=_0xfb6fd1-0x0;var _0x167516=_0x9d9b[_0xfb6fd1];return _0x167516;};'use strict';var Sequelize=require(_0xb9d9('0x0'));module[_0xb9d9('0x1')]={'name':{'type':Sequelize[_0xb9d9('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xb9d9('0x2')]},'description':{'type':Sequelize[_0xb9d9('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb9d9('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x3bb4=['BOOLEAN','INTEGER','exports','STRING'];(function(_0x3a3437,_0xab48bd){var _0x1c7d12=function(_0x5261bf){while(--_0x5261bf){_0x3a3437['push'](_0x3a3437['shift']());}};_0x1c7d12(++_0xab48bd);}(_0x3bb4,0x19e));var _0x43bb=function(_0x56f630,_0x460fe2){_0x56f630=_0x56f630-0x0;var _0xd245b5=_0x3bb4[_0x56f630];return _0xd245b5;};'use strict';var Sequelize=require('sequelize');module[_0x43bb('0x0')]={'name':{'type':Sequelize[_0x43bb('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x43bb('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x43bb('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x43bb('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 734d4ee..59dc40e 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 _0x1ba2=['error','stack','index','map','Automation','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','options','include','catch','show','params','rawAttributes','includeAll','merge','find','create','body','destroy','addConditions','Condition','ids','omit','getConditions','addActions','Action','getActions','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then'];(function(_0x223b71,_0x597bfb){var _0x4131e4=function(_0x411d23){while(--_0x411d23){_0x223b71['push'](_0x223b71['shift']());}};_0x4131e4(++_0x597bfb);}(_0x1ba2,0x1aa));var _0x21ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1ba2[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x21ba('0x0'));var emlformat=require(_0x21ba('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x21ba('0x2'));var rp=require(_0x21ba('0x3'));var moment=require('moment');var BPromise=require(_0x21ba('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x21ba('0x5'));var sox=require(_0x21ba('0x6'));var csv=require(_0x21ba('0x7'));var ejs=require(_0x21ba('0x8'));var fs=require('fs');var _=require(_0x21ba('0x9'));var squel=require('squel');var crypto=require(_0x21ba('0xa'));var jsforce=require(_0x21ba('0xb'));var deskjs=require(_0x21ba('0xc'));var toCsv=require(_0x21ba('0x7'));var querystring=require(_0x21ba('0xd'));var Papa=require('papaparse');var Redis=require(_0x21ba('0xe'));var authService=require(_0x21ba('0xf'));var qs=require(_0x21ba('0x10'));var as=require(_0x21ba('0x11'));var hardwareService=require(_0x21ba('0x12'));var logger=require(_0x21ba('0x13'))(_0x21ba('0x14'));var utils=require(_0x21ba('0x15'));var config=require(_0x21ba('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19dddf,_0x5213bd){_0x5213bd=_0x5213bd||0xcc;return function(_0x31cbb8){if(_0x31cbb8){return _0x19dddf[_0x21ba('0x17')](_0x5213bd);}return _0x19dddf[_0x21ba('0x18')](_0x5213bd)[_0x21ba('0x19')]();};}function respondWithResult(_0x31401b,_0xac3064){_0xac3064=_0xac3064||0xc8;return function(_0x91da50){if(_0x91da50){return _0x31401b['status'](_0xac3064)[_0x21ba('0x1a')](_0x91da50);}};}function respondWithFilteredResult(_0x27240c,_0x3cab77){return function(_0x2f56b7){if(_0x2f56b7){var _0x3ebb7c=_0x2f56b7[_0x21ba('0x1b')],_0x39b1dc=_0x3cab77[_0x21ba('0x1c')],_0x5f225d=_0x3cab77[_0x21ba('0x1c')]+_0x3cab77[_0x21ba('0x1d')],_0x2cca5d;if(_0x5f225d>=_0x3ebb7c){_0x5f225d=_0x3ebb7c;_0x2cca5d=0xc8;}else{_0x2cca5d=0xce;}_0x27240c['status'](_0x2cca5d);return _0x27240c['set'](_0x21ba('0x1e'),_0x39b1dc+'-'+_0x5f225d+'/'+_0x3ebb7c)[_0x21ba('0x1a')](_0x2f56b7);}return null;};}function patchUpdates(_0x12ae50){return function(_0x176267){try{jsonpatch[_0x21ba('0x1f')](_0x176267,_0x12ae50,!![]);}catch(_0x477b47){return BPromise[_0x21ba('0x20')](_0x477b47);}return _0x176267[_0x21ba('0x21')]();};}function saveUpdates(_0x215c2a,_0x2573cf){return function(_0x5d6ed0){if(_0x5d6ed0){return _0x5d6ed0[_0x21ba('0x22')](_0x215c2a)[_0x21ba('0x23')](function(_0x2380ee){return _0x2380ee;});}return null;};}function removeEntity(_0x549b0a,_0x1a146b){return function(_0x562f3e){if(_0x562f3e){return _0x562f3e['destroy']()['then'](function(){_0x549b0a[_0x21ba('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3afb2b,_0x3fe8eb){return function(_0xd131bb){if(!_0xd131bb){_0x3afb2b[_0x21ba('0x17')](0x194);}return _0xd131bb;};}function handleError(_0x470c4f,_0x1f0c23){_0x1f0c23=_0x1f0c23||0x1f4;return function(_0x2f12b5){logger[_0x21ba('0x24')](_0x2f12b5[_0x21ba('0x25')]);if(_0x2f12b5['name']){delete _0x2f12b5['name'];}_0x470c4f[_0x21ba('0x18')](_0x1f0c23)['send'](_0x2f12b5);};}exports[_0x21ba('0x26')]=function(_0x4c6429,_0xeac14f){var _0x39e91a={},_0x5849e4={},_0x38fb97={'count':0x0,'rows':[]};var _0x5cb78d=_[_0x21ba('0x27')](db[_0x21ba('0x28')]['rawAttributes'],function(_0x11e65b){return{'name':_0x11e65b['fieldName'],'type':_0x11e65b[_0x21ba('0x29')]['key']};});_0x5849e4[_0x21ba('0x2a')]=_[_0x21ba('0x27')](_0x5cb78d,_0x21ba('0x2b'));_0x5849e4[_0x21ba('0x2c')]=_[_0x21ba('0x2d')](_0x4c6429[_0x21ba('0x2c')]);_0x5849e4[_0x21ba('0x2e')]=_[_0x21ba('0x2f')](_0x5849e4[_0x21ba('0x2a')],_0x5849e4['query']);_0x39e91a[_0x21ba('0x30')]=_[_0x21ba('0x2f')](_0x5849e4['model'],qs[_0x21ba('0x31')](_0x4c6429[_0x21ba('0x2c')]['fields']));_0x39e91a['attributes']=_0x39e91a[_0x21ba('0x30')][_0x21ba('0x32')]?_0x39e91a[_0x21ba('0x30')]:_0x5849e4[_0x21ba('0x2a')];if(!_0x4c6429[_0x21ba('0x2c')][_0x21ba('0x33')](_0x21ba('0x34'))){_0x39e91a['limit']=qs[_0x21ba('0x1d')](_0x4c6429[_0x21ba('0x2c')][_0x21ba('0x1d')]);_0x39e91a['offset']=qs[_0x21ba('0x1c')](_0x4c6429[_0x21ba('0x2c')][_0x21ba('0x1c')]);}_0x39e91a[_0x21ba('0x35')]=qs['sort'](_0x4c6429['query'][_0x21ba('0x36')]);_0x39e91a[_0x21ba('0x37')]=qs[_0x21ba('0x2e')](_['pick'](_0x4c6429[_0x21ba('0x2c')],_0x5849e4['filters']));if(_0x4c6429[_0x21ba('0x2c')][_0x21ba('0x38')]){_0x39e91a[_0x21ba('0x37')]=_['merge'](_0x39e91a['where'],{'$or':_[_0x21ba('0x27')](_0x5cb78d,function(_0x138c2a){if(_0x138c2a[_0x21ba('0x29')]!=='VIRTUAL'){var _0x2bdc96={};_0x2bdc96[_0x138c2a['name']]={'$like':'%'+_0x4c6429[_0x21ba('0x2c')]['filter']+'%'};return _0x2bdc96;}})});}_0x39e91a=_['merge']({},_0x39e91a,_0x4c6429[_0x21ba('0x39')]);var _0x560f05={'where':_0x39e91a['where']};return db[_0x21ba('0x28')][_0x21ba('0x1b')](_0x560f05)[_0x21ba('0x23')](function(_0x272b4d){_0x38fb97[_0x21ba('0x1b')]=_0x272b4d;if(_0x4c6429[_0x21ba('0x2c')]['includeAll']){_0x39e91a[_0x21ba('0x3a')]=[{'all':!![]}];}return db[_0x21ba('0x28')]['findAll'](_0x39e91a);})[_0x21ba('0x23')](function(_0x7bff62){_0x38fb97['rows']=_0x7bff62;return _0x38fb97;})[_0x21ba('0x23')](respondWithFilteredResult(_0xeac14f,_0x39e91a))[_0x21ba('0x3b')](handleError(_0xeac14f,null));};exports[_0x21ba('0x3c')]=function(_0x239689,_0x57cdfa){var _0x4a393e={'raw':![],'where':{'id':_0x239689[_0x21ba('0x3d')]['id']}},_0xf25b5f={};_0xf25b5f[_0x21ba('0x2a')]=_[_0x21ba('0x2d')](db[_0x21ba('0x28')][_0x21ba('0x3e')]);_0xf25b5f['query']=_['keys'](_0x239689[_0x21ba('0x2c')]);_0xf25b5f['filters']=_[_0x21ba('0x2f')](_0xf25b5f['model'],_0xf25b5f[_0x21ba('0x2c')]);_0x4a393e[_0x21ba('0x30')]=_[_0x21ba('0x2f')](_0xf25b5f[_0x21ba('0x2a')],qs[_0x21ba('0x31')](_0x239689[_0x21ba('0x2c')][_0x21ba('0x31')]));_0x4a393e[_0x21ba('0x30')]=_0x4a393e[_0x21ba('0x30')][_0x21ba('0x32')]?_0x4a393e[_0x21ba('0x30')]:_0xf25b5f[_0x21ba('0x2a')];if(_0x239689[_0x21ba('0x2c')][_0x21ba('0x3f')]){_0x4a393e['include']=[{'all':!![]}];}_0x4a393e=_[_0x21ba('0x40')]({},_0x4a393e,_0x239689[_0x21ba('0x39')]);return db['Automation'][_0x21ba('0x41')](_0x4a393e)[_0x21ba('0x23')](handleEntityNotFound(_0x57cdfa,null))[_0x21ba('0x23')](respondWithResult(_0x57cdfa,null))[_0x21ba('0x3b')](handleError(_0x57cdfa,null));};exports['create']=function(_0x413839,_0x10781c){return db[_0x21ba('0x28')][_0x21ba('0x42')](_0x413839['body'],{})[_0x21ba('0x23')](respondWithResult(_0x10781c,0xc9))['catch'](handleError(_0x10781c,null));};exports['update']=function(_0x3b5fdb,_0x1a6020){if(_0x3b5fdb['body']['id']){delete _0x3b5fdb[_0x21ba('0x43')]['id'];}return db[_0x21ba('0x28')][_0x21ba('0x41')]({'where':{'id':_0x3b5fdb[_0x21ba('0x3d')]['id']}})[_0x21ba('0x23')](handleEntityNotFound(_0x1a6020,null))[_0x21ba('0x23')](saveUpdates(_0x3b5fdb[_0x21ba('0x43')],null))['then'](respondWithResult(_0x1a6020,null))[_0x21ba('0x3b')](handleError(_0x1a6020,null));};exports[_0x21ba('0x44')]=function(_0x2d130a,_0x21c328){return db[_0x21ba('0x28')][_0x21ba('0x41')]({'where':{'id':_0x2d130a[_0x21ba('0x3d')]['id']}})['then'](handleEntityNotFound(_0x21c328,null))[_0x21ba('0x23')](removeEntity(_0x21c328,null))[_0x21ba('0x3b')](handleError(_0x21c328,null));};exports[_0x21ba('0x45')]=function(_0x5f2846,_0x1cdaf6,_0x331ced){return db[_0x21ba('0x46')]['find']({'where':{'id':_0x5f2846[_0x21ba('0x3d')]['id']}})[_0x21ba('0x23')](handleEntityNotFound(_0x1cdaf6,null))[_0x21ba('0x23')](function(_0x41adc7){if(_0x41adc7){return _0x41adc7[_0x21ba('0x45')](_0x5f2846[_0x21ba('0x43')][_0x21ba('0x47')],_[_0x21ba('0x48')](_0x5f2846[_0x21ba('0x43')],['ids','id'])||{});}})[_0x21ba('0x23')](respondWithResult(_0x1cdaf6,null))[_0x21ba('0x3b')](handleError(_0x1cdaf6,null));};exports[_0x21ba('0x49')]=function(_0x3091b2,_0x45f78c,_0x40ec29){var _0x3b21fe={};var _0x48a4d7={};var _0x1a1219;var _0x559277;return db[_0x21ba('0x28')]['findOne']({'where':{'id':_0x3091b2[_0x21ba('0x3d')]['id']}})[_0x21ba('0x23')](handleEntityNotFound(_0x45f78c,null))[_0x21ba('0x23')](function(_0x4954aa){if(_0x4954aa){_0x1a1219=_0x4954aa;_0x48a4d7[_0x21ba('0x2a')]=_[_0x21ba('0x2d')](db[_0x21ba('0x46')]['rawAttributes']);_0x48a4d7[_0x21ba('0x2c')]=_[_0x21ba('0x2d')](_0x3091b2[_0x21ba('0x2c')]);_0x48a4d7[_0x21ba('0x2e')]=_['intersection'](_0x48a4d7[_0x21ba('0x2a')],_0x48a4d7[_0x21ba('0x2c')]);_0x3b21fe[_0x21ba('0x30')]=_[_0x21ba('0x2f')](_0x48a4d7[_0x21ba('0x2a')],qs[_0x21ba('0x31')](_0x3091b2[_0x21ba('0x2c')][_0x21ba('0x31')]));_0x3b21fe[_0x21ba('0x30')]=_0x3b21fe[_0x21ba('0x30')]['length']?_0x3b21fe[_0x21ba('0x30')]:_0x48a4d7[_0x21ba('0x2a')];_0x3b21fe[_0x21ba('0x35')]=qs[_0x21ba('0x36')](_0x3091b2[_0x21ba('0x2c')][_0x21ba('0x36')]);_0x3b21fe['where']=qs['filters'](_['pick'](_0x3091b2[_0x21ba('0x2c')],_0x48a4d7[_0x21ba('0x2e')]));if(_0x3091b2[_0x21ba('0x2c')]['filter']){_0x3b21fe[_0x21ba('0x37')]=_[_0x21ba('0x40')](_0x3b21fe['where'],{'$or':_[_0x21ba('0x27')](_0x3b21fe[_0x21ba('0x30')],function(_0x11b469){var _0x6f850c={};_0x6f850c[_0x11b469]={'$like':'%'+_0x3091b2['query']['filter']+'%'};return _0x6f850c;})});}_0x3b21fe=_['merge']({},_0x3b21fe,_0x3091b2[_0x21ba('0x39')]);return _0x1a1219[_0x21ba('0x49')](_0x3b21fe);}})[_0x21ba('0x23')](function(_0xd457e0){if(_0xd457e0){_0x559277=_0xd457e0[_0x21ba('0x32')];if(!_0x3091b2[_0x21ba('0x2c')][_0x21ba('0x33')]('nolimit')){_0x3b21fe[_0x21ba('0x1d')]=qs[_0x21ba('0x1d')](_0x3091b2['query'][_0x21ba('0x1d')]);_0x3b21fe[_0x21ba('0x1c')]=qs[_0x21ba('0x1c')](_0x3091b2[_0x21ba('0x2c')][_0x21ba('0x1c')]);}return _0x1a1219[_0x21ba('0x49')](_0x3b21fe);}})[_0x21ba('0x23')](function(_0x49e592){if(_0x49e592){return _0x49e592?{'count':_0x559277,'rows':_0x49e592}:null;}})[_0x21ba('0x23')](respondWithResult(_0x45f78c,null))[_0x21ba('0x3b')](handleError(_0x45f78c,null));};exports[_0x21ba('0x4a')]=function(_0x204111,_0x48085d,_0x38469b){return db[_0x21ba('0x4b')][_0x21ba('0x41')]({'where':{'id':_0x204111[_0x21ba('0x3d')]['id']}})[_0x21ba('0x23')](handleEntityNotFound(_0x48085d,null))[_0x21ba('0x23')](function(_0x3f2310){if(_0x3f2310){return _0x3f2310[_0x21ba('0x4a')](_0x204111[_0x21ba('0x43')][_0x21ba('0x47')],_[_0x21ba('0x48')](_0x204111[_0x21ba('0x43')],[_0x21ba('0x47'),'id'])||{});}})[_0x21ba('0x23')](respondWithResult(_0x48085d,null))[_0x21ba('0x3b')](handleError(_0x48085d,null));};exports[_0x21ba('0x4c')]=function(_0xbb01ba,_0x31ef98,_0x1e0e03){var _0x55690={};var _0x9d53b3={};var _0x1f96ba;var _0x45adda;return db[_0x21ba('0x28')]['findOne']({'where':{'id':_0xbb01ba[_0x21ba('0x3d')]['id']}})[_0x21ba('0x23')](handleEntityNotFound(_0x31ef98,null))['then'](function(_0x5271f3){if(_0x5271f3){_0x1f96ba=_0x5271f3;_0x9d53b3['model']=_[_0x21ba('0x2d')](db[_0x21ba('0x4b')][_0x21ba('0x3e')]);_0x9d53b3[_0x21ba('0x2c')]=_[_0x21ba('0x2d')](_0xbb01ba[_0x21ba('0x2c')]);_0x9d53b3[_0x21ba('0x2e')]=_['intersection'](_0x9d53b3[_0x21ba('0x2a')],_0x9d53b3['query']);_0x55690['attributes']=_[_0x21ba('0x2f')](_0x9d53b3[_0x21ba('0x2a')],qs[_0x21ba('0x31')](_0xbb01ba[_0x21ba('0x2c')][_0x21ba('0x31')]));_0x55690[_0x21ba('0x30')]=_0x55690[_0x21ba('0x30')][_0x21ba('0x32')]?_0x55690[_0x21ba('0x30')]:_0x9d53b3[_0x21ba('0x2a')];_0x55690[_0x21ba('0x35')]=qs[_0x21ba('0x36')](_0xbb01ba[_0x21ba('0x2c')][_0x21ba('0x36')]);_0x55690['where']=qs[_0x21ba('0x2e')](_['pick'](_0xbb01ba[_0x21ba('0x2c')],_0x9d53b3['filters']));if(_0xbb01ba[_0x21ba('0x2c')][_0x21ba('0x38')]){_0x55690[_0x21ba('0x37')]=_['merge'](_0x55690[_0x21ba('0x37')],{'$or':_[_0x21ba('0x27')](_0x55690[_0x21ba('0x30')],function(_0x35c23e){var _0xf50de9={};_0xf50de9[_0x35c23e]={'$like':'%'+_0xbb01ba['query'][_0x21ba('0x38')]+'%'};return _0xf50de9;})});}_0x55690=_[_0x21ba('0x40')]({},_0x55690,_0xbb01ba[_0x21ba('0x39')]);return _0x1f96ba[_0x21ba('0x4c')](_0x55690);}})['then'](function(_0x51d85b){if(_0x51d85b){_0x45adda=_0x51d85b['length'];if(!_0xbb01ba[_0x21ba('0x2c')][_0x21ba('0x33')](_0x21ba('0x34'))){_0x55690[_0x21ba('0x1d')]=qs['limit'](_0xbb01ba[_0x21ba('0x2c')][_0x21ba('0x1d')]);_0x55690[_0x21ba('0x1c')]=qs[_0x21ba('0x1c')](_0xbb01ba['query']['offset']);}return _0x1f96ba[_0x21ba('0x4c')](_0x55690);}})[_0x21ba('0x23')](function(_0x523fa1){if(_0x523fa1){return _0x523fa1?{'count':_0x45adda,'rows':_0x523fa1}:null;}})['then'](respondWithResult(_0x31ef98,null))['catch'](handleError(_0x31ef98,null));}; \ No newline at end of file +var _0xe5a4=['mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','reject','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','Automation','count','includeAll','include','findAll','rows','catch','params','keys','length','create','body','find','addConditions','omit','getConditions','findOne','addActions','Action','ids','getActions','eml-format','rimraf','fast-json-patch','moment','bluebird'];(function(_0x28cbc5,_0x326e44){var _0x310541=function(_0x23a322){while(--_0x23a322){_0x28cbc5['push'](_0x28cbc5['shift']());}};_0x310541(++_0x326e44);}(_0xe5a4,0x195));var _0x4e5a=function(_0x5d0594,_0x3d8ede){_0x5d0594=_0x5d0594-0x0;var _0x179e9a=_0xe5a4[_0x5d0594];return _0x179e9a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4e5a('0x0'));var rimraf=require(_0x4e5a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4e5a('0x2'));var rp=require('request-promise');var moment=require(_0x4e5a('0x3'));var BPromise=require(_0x4e5a('0x4'));var Mustache=require(_0x4e5a('0x5'));var util=require('util');var path=require(_0x4e5a('0x6'));var sox=require(_0x4e5a('0x7'));var csv=require(_0x4e5a('0x8'));var ejs=require(_0x4e5a('0x9'));var fs=require('fs');var _=require(_0x4e5a('0xa'));var squel=require('squel');var crypto=require(_0x4e5a('0xb'));var jsforce=require(_0x4e5a('0xc'));var deskjs=require(_0x4e5a('0xd'));var toCsv=require(_0x4e5a('0x8'));var querystring=require(_0x4e5a('0xe'));var Papa=require(_0x4e5a('0xf'));var Redis=require(_0x4e5a('0x10'));var authService=require(_0x4e5a('0x11'));var qs=require(_0x4e5a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e5a('0x13'));var logger=require(_0x4e5a('0x14'))(_0x4e5a('0x15'));var utils=require(_0x4e5a('0x16'));var config=require(_0x4e5a('0x17'));var db=require(_0x4e5a('0x18'))['db'];function respondWithStatusCode(_0x14f213,_0x1b6603){_0x1b6603=_0x1b6603||0xcc;return function(_0xd361cc){if(_0xd361cc){return _0x14f213[_0x4e5a('0x19')](_0x1b6603);}return _0x14f213[_0x4e5a('0x1a')](_0x1b6603)[_0x4e5a('0x1b')]();};}function respondWithResult(_0x498895,_0x3956c6){_0x3956c6=_0x3956c6||0xc8;return function(_0x3f6645){if(_0x3f6645){return _0x498895['status'](_0x3956c6)[_0x4e5a('0x1c')](_0x3f6645);}};}function respondWithFilteredResult(_0x58e52f,_0x304bfb){return function(_0x40c4a8){if(_0x40c4a8){var _0x2dc23a=_0x40c4a8['count'],_0x4a0421=_0x304bfb[_0x4e5a('0x1d')],_0x3b8a27=_0x304bfb['offset']+_0x304bfb[_0x4e5a('0x1e')],_0x93c16;if(_0x3b8a27>=_0x2dc23a){_0x3b8a27=_0x2dc23a;_0x93c16=0xc8;}else{_0x93c16=0xce;}_0x58e52f[_0x4e5a('0x1a')](_0x93c16);return _0x58e52f['set'](_0x4e5a('0x1f'),_0x4a0421+'-'+_0x3b8a27+'/'+_0x2dc23a)[_0x4e5a('0x1c')](_0x40c4a8);}return null;};}function patchUpdates(_0x4ffb14){return function(_0x4a897f){try{jsonpatch['apply'](_0x4a897f,_0x4ffb14,!![]);}catch(_0x4b0a90){return BPromise[_0x4e5a('0x20')](_0x4b0a90);}return _0x4a897f['save']();};}function saveUpdates(_0x655a13,_0x53323b){return function(_0x7b3e07){if(_0x7b3e07){return _0x7b3e07[_0x4e5a('0x21')](_0x655a13)[_0x4e5a('0x22')](function(_0x44e2f9){return _0x44e2f9;});}return null;};}function removeEntity(_0x39fde3,_0x479024){return function(_0x106263){if(_0x106263){return _0x106263[_0x4e5a('0x23')]()[_0x4e5a('0x22')](function(){_0x39fde3[_0x4e5a('0x1a')](0xcc)[_0x4e5a('0x1b')]();});}};}function handleEntityNotFound(_0x4806db,_0x4d6872){return function(_0x48bbb7){if(!_0x48bbb7){_0x4806db[_0x4e5a('0x19')](0x194);}return _0x48bbb7;};}function handleError(_0x5b5356,_0x41779a){_0x41779a=_0x41779a||0x1f4;return function(_0x597be7){logger[_0x4e5a('0x24')](_0x597be7['stack']);if(_0x597be7[_0x4e5a('0x25')]){delete _0x597be7[_0x4e5a('0x25')];}_0x5b5356[_0x4e5a('0x1a')](_0x41779a)[_0x4e5a('0x26')](_0x597be7);};}exports[_0x4e5a('0x27')]=function(_0x1baa71,_0x23dfbb){var _0x58ce58={},_0x20e4b6={},_0x174b09={'count':0x0,'rows':[]};var _0x57a477=_[_0x4e5a('0x28')](db['Automation'][_0x4e5a('0x29')],function(_0x32d221){return{'name':_0x32d221[_0x4e5a('0x2a')],'type':_0x32d221['type'][_0x4e5a('0x2b')]};});_0x20e4b6[_0x4e5a('0x2c')]=_['map'](_0x57a477,_0x4e5a('0x25'));_0x20e4b6[_0x4e5a('0x2d')]=_['keys'](_0x1baa71[_0x4e5a('0x2d')]);_0x20e4b6[_0x4e5a('0x2e')]=_[_0x4e5a('0x2f')](_0x20e4b6[_0x4e5a('0x2c')],_0x20e4b6[_0x4e5a('0x2d')]);_0x58ce58[_0x4e5a('0x30')]=_[_0x4e5a('0x2f')](_0x20e4b6[_0x4e5a('0x2c')],qs[_0x4e5a('0x31')](_0x1baa71['query'][_0x4e5a('0x31')]));_0x58ce58['attributes']=_0x58ce58['attributes']['length']?_0x58ce58[_0x4e5a('0x30')]:_0x20e4b6[_0x4e5a('0x2c')];if(!_0x1baa71[_0x4e5a('0x2d')][_0x4e5a('0x32')](_0x4e5a('0x33'))){_0x58ce58[_0x4e5a('0x1e')]=qs[_0x4e5a('0x1e')](_0x1baa71[_0x4e5a('0x2d')]['limit']);_0x58ce58[_0x4e5a('0x1d')]=qs[_0x4e5a('0x1d')](_0x1baa71[_0x4e5a('0x2d')][_0x4e5a('0x1d')]);}_0x58ce58[_0x4e5a('0x34')]=qs['sort'](_0x1baa71[_0x4e5a('0x2d')][_0x4e5a('0x35')]);_0x58ce58[_0x4e5a('0x36')]=qs[_0x4e5a('0x2e')](_[_0x4e5a('0x37')](_0x1baa71[_0x4e5a('0x2d')],_0x20e4b6['filters']));if(_0x1baa71['query']['filter']){_0x58ce58['where']=_[_0x4e5a('0x38')](_0x58ce58[_0x4e5a('0x36')],{'$or':_[_0x4e5a('0x28')](_0x57a477,function(_0x2877fb){if(_0x2877fb[_0x4e5a('0x39')]!==_0x4e5a('0x3a')){var _0x385741={};_0x385741[_0x2877fb[_0x4e5a('0x25')]]={'$like':'%'+_0x1baa71['query'][_0x4e5a('0x3b')]+'%'};return _0x385741;}})});}_0x58ce58=_[_0x4e5a('0x38')]({},_0x58ce58,_0x1baa71[_0x4e5a('0x3c')]);var _0x2bace9={'where':_0x58ce58[_0x4e5a('0x36')]};return db[_0x4e5a('0x3d')][_0x4e5a('0x3e')](_0x2bace9)['then'](function(_0x5a56ea){_0x174b09['count']=_0x5a56ea;if(_0x1baa71[_0x4e5a('0x2d')][_0x4e5a('0x3f')]){_0x58ce58[_0x4e5a('0x40')]=[{'all':!![]}];}return db['Automation'][_0x4e5a('0x41')](_0x58ce58);})[_0x4e5a('0x22')](function(_0x47f107){_0x174b09[_0x4e5a('0x42')]=_0x47f107;return _0x174b09;})[_0x4e5a('0x22')](respondWithFilteredResult(_0x23dfbb,_0x58ce58))[_0x4e5a('0x43')](handleError(_0x23dfbb,null));};exports['show']=function(_0x259a28,_0x2313f8){var _0x16b09e={'raw':![],'where':{'id':_0x259a28[_0x4e5a('0x44')]['id']}},_0x2e8dd9={};_0x2e8dd9['model']=_[_0x4e5a('0x45')](db['Automation'][_0x4e5a('0x29')]);_0x2e8dd9['query']=_[_0x4e5a('0x45')](_0x259a28[_0x4e5a('0x2d')]);_0x2e8dd9['filters']=_['intersection'](_0x2e8dd9[_0x4e5a('0x2c')],_0x2e8dd9[_0x4e5a('0x2d')]);_0x16b09e[_0x4e5a('0x30')]=_[_0x4e5a('0x2f')](_0x2e8dd9[_0x4e5a('0x2c')],qs[_0x4e5a('0x31')](_0x259a28['query'][_0x4e5a('0x31')]));_0x16b09e[_0x4e5a('0x30')]=_0x16b09e[_0x4e5a('0x30')][_0x4e5a('0x46')]?_0x16b09e[_0x4e5a('0x30')]:_0x2e8dd9[_0x4e5a('0x2c')];if(_0x259a28['query'][_0x4e5a('0x3f')]){_0x16b09e['include']=[{'all':!![]}];}_0x16b09e=_[_0x4e5a('0x38')]({},_0x16b09e,_0x259a28['options']);return db[_0x4e5a('0x3d')]['find'](_0x16b09e)[_0x4e5a('0x22')](handleEntityNotFound(_0x2313f8,null))[_0x4e5a('0x22')](respondWithResult(_0x2313f8,null))[_0x4e5a('0x43')](handleError(_0x2313f8,null));};exports[_0x4e5a('0x47')]=function(_0x3b7fca,_0x21cb69){return db[_0x4e5a('0x3d')][_0x4e5a('0x47')](_0x3b7fca[_0x4e5a('0x48')],{})[_0x4e5a('0x22')](respondWithResult(_0x21cb69,0xc9))[_0x4e5a('0x43')](handleError(_0x21cb69,null));};exports[_0x4e5a('0x21')]=function(_0x3299a9,_0x493191){if(_0x3299a9[_0x4e5a('0x48')]['id']){delete _0x3299a9[_0x4e5a('0x48')]['id'];}return db['Automation'][_0x4e5a('0x49')]({'where':{'id':_0x3299a9[_0x4e5a('0x44')]['id']}})[_0x4e5a('0x22')](handleEntityNotFound(_0x493191,null))['then'](saveUpdates(_0x3299a9[_0x4e5a('0x48')],null))[_0x4e5a('0x22')](respondWithResult(_0x493191,null))[_0x4e5a('0x43')](handleError(_0x493191,null));};exports['destroy']=function(_0x3377ff,_0x31d9a7){return db[_0x4e5a('0x3d')][_0x4e5a('0x49')]({'where':{'id':_0x3377ff[_0x4e5a('0x44')]['id']}})[_0x4e5a('0x22')](handleEntityNotFound(_0x31d9a7,null))[_0x4e5a('0x22')](removeEntity(_0x31d9a7,null))['catch'](handleError(_0x31d9a7,null));};exports[_0x4e5a('0x4a')]=function(_0x2d7349,_0x4f65f3,_0x4855d8){return db['Condition'][_0x4e5a('0x49')]({'where':{'id':_0x2d7349['params']['id']}})[_0x4e5a('0x22')](handleEntityNotFound(_0x4f65f3,null))[_0x4e5a('0x22')](function(_0x527b84){if(_0x527b84){return _0x527b84[_0x4e5a('0x4a')](_0x2d7349[_0x4e5a('0x48')]['ids'],_[_0x4e5a('0x4b')](_0x2d7349['body'],['ids','id'])||{});}})[_0x4e5a('0x22')](respondWithResult(_0x4f65f3,null))['catch'](handleError(_0x4f65f3,null));};exports[_0x4e5a('0x4c')]=function(_0x5c0e58,_0x2ede9f,_0x58f1b6){var _0x57df06={};var _0xc39cb8={};var _0x3a107a;var _0x37b18a;return db[_0x4e5a('0x3d')][_0x4e5a('0x4d')]({'where':{'id':_0x5c0e58[_0x4e5a('0x44')]['id']}})[_0x4e5a('0x22')](handleEntityNotFound(_0x2ede9f,null))[_0x4e5a('0x22')](function(_0x12db54){if(_0x12db54){_0x3a107a=_0x12db54;_0xc39cb8[_0x4e5a('0x2c')]=_['keys'](db['Condition']['rawAttributes']);_0xc39cb8[_0x4e5a('0x2d')]=_[_0x4e5a('0x45')](_0x5c0e58[_0x4e5a('0x2d')]);_0xc39cb8[_0x4e5a('0x2e')]=_[_0x4e5a('0x2f')](_0xc39cb8[_0x4e5a('0x2c')],_0xc39cb8[_0x4e5a('0x2d')]);_0x57df06[_0x4e5a('0x30')]=_[_0x4e5a('0x2f')](_0xc39cb8[_0x4e5a('0x2c')],qs[_0x4e5a('0x31')](_0x5c0e58[_0x4e5a('0x2d')]['fields']));_0x57df06[_0x4e5a('0x30')]=_0x57df06[_0x4e5a('0x30')][_0x4e5a('0x46')]?_0x57df06['attributes']:_0xc39cb8[_0x4e5a('0x2c')];_0x57df06[_0x4e5a('0x34')]=qs['sort'](_0x5c0e58[_0x4e5a('0x2d')][_0x4e5a('0x35')]);_0x57df06['where']=qs[_0x4e5a('0x2e')](_[_0x4e5a('0x37')](_0x5c0e58[_0x4e5a('0x2d')],_0xc39cb8[_0x4e5a('0x2e')]));if(_0x5c0e58[_0x4e5a('0x2d')][_0x4e5a('0x3b')]){_0x57df06[_0x4e5a('0x36')]=_[_0x4e5a('0x38')](_0x57df06[_0x4e5a('0x36')],{'$or':_[_0x4e5a('0x28')](_0x57df06[_0x4e5a('0x30')],function(_0x382228){var _0x4ce4f6={};_0x4ce4f6[_0x382228]={'$like':'%'+_0x5c0e58['query']['filter']+'%'};return _0x4ce4f6;})});}_0x57df06=_[_0x4e5a('0x38')]({},_0x57df06,_0x5c0e58[_0x4e5a('0x3c')]);return _0x3a107a['getConditions'](_0x57df06);}})['then'](function(_0x3627d5){if(_0x3627d5){_0x37b18a=_0x3627d5[_0x4e5a('0x46')];if(!_0x5c0e58['query'][_0x4e5a('0x32')](_0x4e5a('0x33'))){_0x57df06[_0x4e5a('0x1e')]=qs[_0x4e5a('0x1e')](_0x5c0e58[_0x4e5a('0x2d')][_0x4e5a('0x1e')]);_0x57df06[_0x4e5a('0x1d')]=qs['offset'](_0x5c0e58[_0x4e5a('0x2d')][_0x4e5a('0x1d')]);}return _0x3a107a['getConditions'](_0x57df06);}})[_0x4e5a('0x22')](function(_0x2e99a5){if(_0x2e99a5){return _0x2e99a5?{'count':_0x37b18a,'rows':_0x2e99a5}:null;}})[_0x4e5a('0x22')](respondWithResult(_0x2ede9f,null))['catch'](handleError(_0x2ede9f,null));};exports[_0x4e5a('0x4e')]=function(_0x820416,_0x3980e9,_0x4ebdc5){return db[_0x4e5a('0x4f')]['find']({'where':{'id':_0x820416['params']['id']}})[_0x4e5a('0x22')](handleEntityNotFound(_0x3980e9,null))[_0x4e5a('0x22')](function(_0xe22b27){if(_0xe22b27){return _0xe22b27[_0x4e5a('0x4e')](_0x820416[_0x4e5a('0x48')][_0x4e5a('0x50')],_['omit'](_0x820416[_0x4e5a('0x48')],[_0x4e5a('0x50'),'id'])||{});}})[_0x4e5a('0x22')](respondWithResult(_0x3980e9,null))[_0x4e5a('0x43')](handleError(_0x3980e9,null));};exports[_0x4e5a('0x51')]=function(_0x4c1114,_0x45df04,_0x309a38){var _0x36bdf4={};var _0x2e2768={};var _0x144ea7;var _0x89dcb;return db[_0x4e5a('0x3d')][_0x4e5a('0x4d')]({'where':{'id':_0x4c1114[_0x4e5a('0x44')]['id']}})[_0x4e5a('0x22')](handleEntityNotFound(_0x45df04,null))['then'](function(_0x40c990){if(_0x40c990){_0x144ea7=_0x40c990;_0x2e2768['model']=_['keys'](db[_0x4e5a('0x4f')][_0x4e5a('0x29')]);_0x2e2768[_0x4e5a('0x2d')]=_[_0x4e5a('0x45')](_0x4c1114[_0x4e5a('0x2d')]);_0x2e2768['filters']=_['intersection'](_0x2e2768[_0x4e5a('0x2c')],_0x2e2768[_0x4e5a('0x2d')]);_0x36bdf4[_0x4e5a('0x30')]=_[_0x4e5a('0x2f')](_0x2e2768[_0x4e5a('0x2c')],qs[_0x4e5a('0x31')](_0x4c1114['query']['fields']));_0x36bdf4[_0x4e5a('0x30')]=_0x36bdf4['attributes']['length']?_0x36bdf4[_0x4e5a('0x30')]:_0x2e2768[_0x4e5a('0x2c')];_0x36bdf4['order']=qs[_0x4e5a('0x35')](_0x4c1114[_0x4e5a('0x2d')][_0x4e5a('0x35')]);_0x36bdf4[_0x4e5a('0x36')]=qs[_0x4e5a('0x2e')](_['pick'](_0x4c1114[_0x4e5a('0x2d')],_0x2e2768[_0x4e5a('0x2e')]));if(_0x4c1114[_0x4e5a('0x2d')]['filter']){_0x36bdf4['where']=_['merge'](_0x36bdf4[_0x4e5a('0x36')],{'$or':_['map'](_0x36bdf4[_0x4e5a('0x30')],function(_0x143272){var _0x28850f={};_0x28850f[_0x143272]={'$like':'%'+_0x4c1114[_0x4e5a('0x2d')][_0x4e5a('0x3b')]+'%'};return _0x28850f;})});}_0x36bdf4=_[_0x4e5a('0x38')]({},_0x36bdf4,_0x4c1114['options']);return _0x144ea7[_0x4e5a('0x51')](_0x36bdf4);}})[_0x4e5a('0x22')](function(_0x4cc3d8){if(_0x4cc3d8){_0x89dcb=_0x4cc3d8[_0x4e5a('0x46')];if(!_0x4c1114[_0x4e5a('0x2d')][_0x4e5a('0x32')](_0x4e5a('0x33'))){_0x36bdf4[_0x4e5a('0x1e')]=qs['limit'](_0x4c1114[_0x4e5a('0x2d')]['limit']);_0x36bdf4[_0x4e5a('0x1d')]=qs[_0x4e5a('0x1d')](_0x4c1114[_0x4e5a('0x2d')][_0x4e5a('0x1d')]);}return _0x144ea7[_0x4e5a('0x51')](_0x36bdf4);}})['then'](function(_0x4a2f55){if(_0x4a2f55){return _0x4a2f55?{'count':_0x89dcb,'rows':_0x4a2f55}:null;}})['then'](respondWithResult(_0x45df04,null))[_0x4e5a('0x43')](handleError(_0x45df04,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 4250f10..2852fec 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 _0xa2b1=['../../config/environment','./automation.attributes','define','Automation','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa2b1,0x184));var _0x1a2b=function(_0x5bdf83,_0x3fd84c){_0x5bdf83=_0x5bdf83-0x0;var _0x224548=_0xa2b1[_0x5bdf83];return _0x224548;};'use strict';var _=require(_0x1a2b('0x0'));var util=require(_0x1a2b('0x1'));var logger=require(_0x1a2b('0x2'))('api');var moment=require(_0x1a2b('0x3'));var BPromise=require(_0x1a2b('0x4'));var rp=require(_0x1a2b('0x5'));var fs=require('fs');var path=require(_0x1a2b('0x6'));var rimraf=require(_0x1a2b('0x7'));var config=require(_0x1a2b('0x8'));var attributes=require(_0x1a2b('0x9'));module['exports']=function(_0x345a0e,_0x2424a4){return _0x345a0e[_0x1a2b('0xa')](_0x1a2b('0xb'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0621=['path','rimraf','exports','define','util','api','moment','request-promise'];(function(_0x49f67f,_0x4113a4){var _0x4779a1=function(_0x5064b0){while(--_0x5064b0){_0x49f67f['push'](_0x49f67f['shift']());}};_0x4779a1(++_0x4113a4);}(_0x0621,0x194));var _0x1062=function(_0x1edd7d,_0x444176){_0x1edd7d=_0x1edd7d-0x0;var _0x4c714c=_0x0621[_0x1edd7d];return _0x4c714c;};'use strict';var _=require('lodash');var util=require(_0x1062('0x0'));var logger=require('../../config/logger')(_0x1062('0x1'));var moment=require(_0x1062('0x2'));var BPromise=require('bluebird');var rp=require(_0x1062('0x3'));var fs=require('fs');var path=require(_0x1062('0x4'));var rimraf=require(_0x1062('0x5'));var config=require('../../config/environment');var attributes=require('./automation.attributes');module[_0x1062('0x6')]=function(_0x5e3aa9,_0x8a1040){return _0x5e3aa9[_0x1062('0x7')]('Automation',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 f6c7b17..a393fb6 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 _0xce1b=['stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x5807c9,_0x882976){var _0x27d993=function(_0xb8356b){while(--_0xb8356b){_0x5807c9['push'](_0x5807c9['shift']());}};_0x27d993(++_0x882976);}(_0xce1b,0x1d0));var _0xbce1=function(_0x43ffd6,_0x100ac0){_0x43ffd6=_0x43ffd6-0x0;var _0x410512=_0xce1b[_0x43ffd6];return _0x410512;};'use strict';var _=require(_0xbce1('0x0'));var util=require(_0xbce1('0x1'));var moment=require(_0xbce1('0x2'));var BPromise=require(_0xbce1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbce1('0x4'));var db=require(_0xbce1('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbce1('0x6'));var config=require(_0xbce1('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbce1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4134c3,_0x43c27b,_0x1a4a4b){return new BPromise(function(_0x13a507,_0x15fe66){return client[_0xbce1('0x9')](_0x4134c3,_0x1a4a4b)[_0xbce1('0xa')](function(_0x45b774){logger[_0xbce1('0xb')](_0xbce1('0xc'),_0x43c27b,_0xbce1('0xd'));logger[_0xbce1('0xe')](_0xbce1('0xf'),_0x43c27b,_0xbce1('0xd'),JSON[_0xbce1('0x10')](_0x45b774));if(_0x45b774[_0xbce1('0x11')]){if(_0x45b774[_0xbce1('0x11')]['code']===0x1f4){logger['error'](_0xbce1('0xc'),_0x43c27b,_0x45b774[_0xbce1('0x11')][_0xbce1('0x12')]);return _0x15fe66(_0x45b774[_0xbce1('0x11')]['message']);}logger['error'](_0xbce1('0xc'),_0x43c27b,_0x45b774[_0xbce1('0x11')]['message']);return _0x13a507(_0x45b774[_0xbce1('0x11')]['message']);}else{logger[_0xbce1('0xb')](_0xbce1('0xc'),_0x43c27b,'request\x20sent');_0x13a507(_0x45b774[_0xbce1('0x13')]['message']);}})['catch'](function(_0x21ae78){logger[_0xbce1('0x11')]('Automation,\x20%s,\x20%s',_0x43c27b,_0x21ae78);_0x15fe66(_0x21ae78);});});} \ No newline at end of file +var _0x3631=['request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x3631,0x1ec));var _0x1363=function(_0x3146d5,_0x483d94){_0x3146d5=_0x3146d5-0x0;var _0x551674=_0x3631[_0x3146d5];return _0x551674;};'use strict';var _=require('lodash');var util=require(_0x1363('0x0'));var moment=require(_0x1363('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1363('0x2'))['db'];var utils=require(_0x1363('0x3'));var logger=require(_0x1363('0x4'))(_0x1363('0x5'));var config=require(_0x1363('0x6'));var jayson=require(_0x1363('0x7'));var client=jayson[_0x1363('0x8')][_0x1363('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2de635,_0x3d215,_0x567f04){return new BPromise(function(_0x1e9c0d,_0x1091b3){return client[_0x1363('0xa')](_0x2de635,_0x567f04)[_0x1363('0xb')](function(_0x146207){logger[_0x1363('0xc')](_0x1363('0xd'),_0x3d215,_0x1363('0xe'));logger[_0x1363('0xf')](_0x1363('0x10'),_0x3d215,_0x1363('0xe'),JSON[_0x1363('0x11')](_0x146207));if(_0x146207[_0x1363('0x12')]){if(_0x146207['error']['code']===0x1f4){logger[_0x1363('0x12')]('Automation,\x20%s,\x20%s',_0x3d215,_0x146207[_0x1363('0x12')][_0x1363('0x13')]);return _0x1091b3(_0x146207[_0x1363('0x12')][_0x1363('0x13')]);}logger['error'](_0x1363('0xd'),_0x3d215,_0x146207['error'][_0x1363('0x13')]);return _0x1e9c0d(_0x146207[_0x1363('0x12')][_0x1363('0x13')]);}else{logger[_0x1363('0xc')]('Automation,\x20%s,\x20%s',_0x3d215,_0x1363('0xe'));_0x1e9c0d(_0x146207[_0x1363('0x14')][_0x1363('0x13')]);}})[_0x1363('0x15')](function(_0x24fff8){logger['error'](_0x1363('0xd'),_0x3d215,_0x24fff8);_0x1091b3(_0x24fff8);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index f0c40e3..49aa7f9 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 _0xe5a9=['put','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./automation.controller','get','/:id','isAuthenticated','show','/:id/conditions','getConditions','getActions','post','addConditions','addActions'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0xe5a9,0x9e));var _0x9e5a=function(_0x42879f,_0x3b68ed){_0x42879f=_0x42879f-0x0;var _0x328d93=_0xe5a9[_0x42879f];return _0x328d93;};'use strict';var multer=require('multer');var util=require(_0x9e5a('0x0'));var path=require(_0x9e5a('0x1'));var timeout=require(_0x9e5a('0x2'));var express=require(_0x9e5a('0x3'));var router=express[_0x9e5a('0x4')]();var auth=require(_0x9e5a('0x5'));var interaction=require(_0x9e5a('0x6'));var config=require('../../config/environment');var controller=require(_0x9e5a('0x7'));router[_0x9e5a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x9e5a('0x9'),auth[_0x9e5a('0xa')](),controller[_0x9e5a('0xb')]);router['get'](_0x9e5a('0xc'),auth[_0x9e5a('0xa')](),controller[_0x9e5a('0xd')]);router[_0x9e5a('0x8')]('/:id/actions',auth[_0x9e5a('0xa')](),controller[_0x9e5a('0xe')]);router[_0x9e5a('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9e5a('0xf')]('/:id/conditions',auth[_0x9e5a('0xa')](),controller[_0x9e5a('0x10')]);router[_0x9e5a('0xf')]('/:id/actions',auth[_0x9e5a('0xa')](),controller[_0x9e5a('0x11')]);router[_0x9e5a('0x12')]('/:id',auth[_0x9e5a('0xa')](),controller[_0x9e5a('0x13')]);router['delete'](_0x9e5a('0x9'),auth[_0x9e5a('0xa')](),controller[_0x9e5a('0x14')]);module[_0x9e5a('0x15')]=router; \ No newline at end of file +var _0x17fd=['/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x17fd,0x119));var _0xd17f=function(_0x1f2150,_0x76722e){_0x1f2150=_0x1f2150-0x0;var _0x4fd476=_0x17fd[_0x1f2150];return _0x4fd476;};'use strict';var multer=require(_0xd17f('0x0'));var util=require(_0xd17f('0x1'));var path=require(_0xd17f('0x2'));var timeout=require(_0xd17f('0x3'));var express=require(_0xd17f('0x4'));var router=express[_0xd17f('0x5')]();var auth=require(_0xd17f('0x6'));var interaction=require(_0xd17f('0x7'));var config=require('../../config/environment');var controller=require(_0xd17f('0x8'));router[_0xd17f('0x9')]('/',auth[_0xd17f('0xa')](),controller[_0xd17f('0xb')]);router[_0xd17f('0x9')](_0xd17f('0xc'),auth[_0xd17f('0xa')](),controller[_0xd17f('0xd')]);router[_0xd17f('0x9')](_0xd17f('0xe'),auth[_0xd17f('0xa')](),controller[_0xd17f('0xf')]);router[_0xd17f('0x9')](_0xd17f('0x10'),auth[_0xd17f('0xa')](),controller[_0xd17f('0x11')]);router[_0xd17f('0x12')]('/',auth[_0xd17f('0xa')](),controller[_0xd17f('0x13')]);router[_0xd17f('0x12')](_0xd17f('0xe'),auth[_0xd17f('0xa')](),controller[_0xd17f('0x14')]);router[_0xd17f('0x12')](_0xd17f('0x10'),auth[_0xd17f('0xa')](),controller[_0xd17f('0x15')]);router[_0xd17f('0x16')]('/:id',auth[_0xd17f('0xa')](),controller[_0xd17f('0x17')]);router[_0xd17f('0x18')](_0xd17f('0xc'),auth['isAuthenticated'](),controller[_0xd17f('0x19')]);module[_0xd17f('0x1a')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index a70f943..0b895ce 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 _0xf27c=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','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','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x1d307e,_0x250246){var _0x4b34fd=function(_0x4a45df){while(--_0x4a45df){_0x1d307e['push'](_0x1d307e['shift']());}};_0x4b34fd(++_0x250246);}(_0xf27c,0x111));var _0xcf27=function(_0x7c5ce8,_0x3ef259){_0x7c5ce8=_0x7c5ce8-0x0;var _0x5a406a=_0xf27c[_0x7c5ce8];return _0x5a406a;};'use strict';var Sequelize=require(_0xcf27('0x0'));module[_0xcf27('0x1')]={'name':{'type':Sequelize[_0xcf27('0x2')],'unique':_0xcf27('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xcf27('0x4')](_0xcf27('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xcf27('0x6')],'defaultValue':0x0,'comment':_0xcf27('0x7')},'limitCalls':{'type':Sequelize[_0xcf27('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xcf27('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xcf27('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xcf27('0x8')](0x3)[_0xcf27('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcf27('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xcf27('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcf27('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xcf27('0x8')](0x5)[_0xcf27('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xcf27('0x8')](0x3)[_0xcf27('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xcf27('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcf27('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xcf27('0x8')](0x3)[_0xcf27('0x9')],'defaultValue':0x3,'comment':_0xcf27('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xcf27('0x8')](0x5)[_0xcf27('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcf27('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xcf27('0x8')](0x3)[_0xcf27('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xcf27('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xcf27('0x2')],'defaultValue':_0xcf27('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xcf27('0x4')]('always','never',_0xcf27('0x11')),'defaultValue':_0xcf27('0x12')},'dialAMDActive':{'type':Sequelize[_0xcf27('0x6')],'defaultValue':0x0,'comment':_0xcf27('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xcf27('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xcf27('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xcf27('0x8')](0x9)[_0xcf27('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xcf27('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xcf27('0x8')](0x9)[_0xcf27('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xcf27('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xcf27('0x8')](0x9)[_0xcf27('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xcf27('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xcf27('0x8')](0x9)[_0xcf27('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xcf27('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xcf27('0x8')](0x9)[_0xcf27('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xcf27('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xcf27('0x8')](0x9)[_0xcf27('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xcf27('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xcf27('0x8')](0x5)[_0xcf27('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xcf27('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xcf27('0x4')]('DESC',_0xcf27('0x1c')),'defaultValue':_0xcf27('0x1d')},'dialPrefix':{'type':Sequelize[_0xcf27('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xcf27('0x8')](0x3)[_0xcf27('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xcf27('0x1e')},'dialCutDigit':{'type':Sequelize[_0xcf27('0x8')](0x3)[_0xcf27('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xcf27('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xcf27('0x8')](0x5)[_0xcf27('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcf27('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xcf27('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcf27('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xcf27('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xcf27('0x8')](0x3)[_0xcf27('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcf27('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xcf27('0x8')](0x5)[_0xcf27('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xcf27('0x8')](0x3)[_0xcf27('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xcf27('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xcf27('0x8')](0x3)[_0xcf27('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcf27('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xcf27('0x8')](0x5)[_0xcf27('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcf27('0x23')}}; \ No newline at end of file +var _0x78cd=['Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ENUM','DESC','ASC','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)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x78cd,0xf7));var _0xd78c=function(_0x2a59bb,_0x42f223){_0x2a59bb=_0x2a59bb-0x0;var _0x1688d5=_0x78cd[_0x2a59bb];return _0x1688d5;};'use strict';var Sequelize=require(_0xd78c('0x0'));module[_0xd78c('0x1')]={'name':{'type':Sequelize[_0xd78c('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0xd78c('0x3')},'description':{'type':Sequelize[_0xd78c('0x2')]},'active':{'type':Sequelize[_0xd78c('0x4')],'defaultValue':0x0,'comment':_0xd78c('0x5')},'limitCalls':{'type':Sequelize[_0xd78c('0x6')](0x4)[_0xd78c('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd78c('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd78c('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xd78c('0x6')](0x3)[_0xd78c('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd78c('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xd78c('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd78c('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd78c('0x6')](0x5)[_0xd78c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xd78c('0x6')](0x3)[_0xd78c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd78c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd78c('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd78c('0x6')](0x3)[_0xd78c('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd78c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd78c('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xd78c('0x6')](0x3)[_0xd78c('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xd78c('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xd78c('0xd')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xd78c('0xe'),_0xd78c('0xf'),_0xd78c('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xd78c('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0xd78c('0x6')](0x9)[_0xd78c('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd78c('0x12')},'dialAMDGreeting':{'type':Sequelize[_0xd78c('0x6')](0x9)[_0xd78c('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd78c('0x6')](0x9)[_0xd78c('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd78c('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd78c('0x13')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xd78c('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd78c('0x6')](0x9)[_0xd78c('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd78c('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xd78c('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xd78c('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd78c('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd78c('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd78c('0x16')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd78c('0x17')](_0xd78c('0x18'),_0xd78c('0x19')),'defaultValue':_0xd78c('0x18')},'dialPrefix':{'type':Sequelize[_0xd78c('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd78c('0x6')](0x3)[_0xd78c('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd78c('0x1a')},'dialCutDigit':{'type':Sequelize[_0xd78c('0x6')](0x3)[_0xd78c('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd78c('0x6')](0x3)[_0xd78c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd78c('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd78c('0x6')](0x5)[_0xd78c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd78c('0x1c')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd78c('0x1d')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd78c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd78c('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd78c('0x6')](0x5)[_0xd78c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd78c('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0xd78c('0x6')](0x3)[_0xd78c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd78c('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0xd78c('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd78c('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd78c('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd78c('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd78c('0x6')](0x5)[_0xd78c('0x7')],'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 0df3641..1a4de70 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 _0x9bde=['model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','intersection','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','autoAssociation','getHoppers','CmHopper','pick','rows','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','findOne','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','select','field','phone','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId','phone\x20IS\x20NOT\x20NULL','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','sendStatus','stack','name','send','index','map','Campaign','rawAttributes','type','key'];(function(_0x4ef7d6,_0x5d2ca3){var _0x471cd1=function(_0x2f1af9){while(--_0x2f1af9){_0x4ef7d6['push'](_0x4ef7d6['shift']());}};_0x471cd1(++_0x5d2ca3);}(_0x9bde,0xe1));var _0xe9bd=function(_0x2ae288,_0x5b2700){_0x2ae288=_0x2ae288-0x0;var _0x1fcd38=_0x9bde[_0x2ae288];return _0x1fcd38;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe9bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe9bd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe9bd('0x2'));var moment=require(_0xe9bd('0x3'));var BPromise=require(_0xe9bd('0x4'));var Mustache=require(_0xe9bd('0x5'));var util=require(_0xe9bd('0x6'));var path=require(_0xe9bd('0x7'));var sox=require(_0xe9bd('0x8'));var csv=require('to-csv');var ejs=require(_0xe9bd('0x9'));var fs=require('fs');var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0xf'));var querystring=require(_0xe9bd('0x10'));var Papa=require(_0xe9bd('0x11'));var Redis=require(_0xe9bd('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x13'));var hardwareService=require(_0xe9bd('0x14'));var logger=require(_0xe9bd('0x15'))('api');var utils=require(_0xe9bd('0x16'));var config=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];function respondWithStatusCode(_0x141587,_0x5e022a){_0x5e022a=_0x5e022a||0xcc;return function(_0x2c1d98){if(_0x2c1d98){return _0x141587['sendStatus'](_0x5e022a);}return _0x141587[_0xe9bd('0x19')](_0x5e022a)[_0xe9bd('0x1a')]();};}function respondWithResult(_0x3435b4,_0x51109f){_0x51109f=_0x51109f||0xc8;return function(_0x47ba5e){if(_0x47ba5e){return _0x3435b4[_0xe9bd('0x19')](_0x51109f)[_0xe9bd('0x1b')](_0x47ba5e);}};}function respondWithFilteredResult(_0x3a9e5f,_0x46a59b){return function(_0x3360bd){if(_0x3360bd){var _0x389e7b=_0x3360bd[_0xe9bd('0x1c')],_0x45a9f2=_0x46a59b[_0xe9bd('0x1d')],_0x573350=_0x46a59b['offset']+_0x46a59b[_0xe9bd('0x1e')],_0x1d11a0;if(_0x573350>=_0x389e7b){_0x573350=_0x389e7b;_0x1d11a0=0xc8;}else{_0x1d11a0=0xce;}_0x3a9e5f[_0xe9bd('0x19')](_0x1d11a0);return _0x3a9e5f[_0xe9bd('0x1f')](_0xe9bd('0x20'),_0x45a9f2+'-'+_0x573350+'/'+_0x389e7b)['json'](_0x3360bd);}return null;};}function patchUpdates(_0x20ec32){return function(_0x50a5e8){try{jsonpatch[_0xe9bd('0x21')](_0x50a5e8,_0x20ec32,!![]);}catch(_0x55b869){return BPromise[_0xe9bd('0x22')](_0x55b869);}return _0x50a5e8[_0xe9bd('0x23')]();};}function saveUpdates(_0x134c4e,_0x3dda13){return function(_0x1acb82){if(_0x1acb82){return _0x1acb82[_0xe9bd('0x24')](_0x134c4e)[_0xe9bd('0x25')](function(_0x49165b){return _0x49165b;});}return null;};}function removeEntity(_0x133318,_0x28cd17){return function(_0x4ecaf5){if(_0x4ecaf5){return _0x4ecaf5[_0xe9bd('0x26')]()['then'](function(){var _0x238ab1=_0x4ecaf5[_0xe9bd('0x27')]({'plain':!![]});var _0x36f8c0=_0xe9bd('0x28');return db['UserProfileResource'][_0xe9bd('0x26')]({'where':{'type':_0x36f8c0,'resourceId':_0x238ab1['id']}})[_0xe9bd('0x25')](function(){return _0x4ecaf5;});})[_0xe9bd('0x25')](function(){_0x133318[_0xe9bd('0x19')](0xcc)[_0xe9bd('0x1a')]();});}};}function handleEntityNotFound(_0xb52d45,_0x399f3c){return function(_0x43ea90){if(!_0x43ea90){_0xb52d45[_0xe9bd('0x29')](0x194);}return _0x43ea90;};}function handleError(_0x5987af,_0x3c211a){_0x3c211a=_0x3c211a||0x1f4;return function(_0x38fdfa){logger['error'](_0x38fdfa[_0xe9bd('0x2a')]);if(_0x38fdfa[_0xe9bd('0x2b')]){delete _0x38fdfa[_0xe9bd('0x2b')];}_0x5987af[_0xe9bd('0x19')](_0x3c211a)[_0xe9bd('0x2c')](_0x38fdfa);};}exports[_0xe9bd('0x2d')]=function(_0x519f48,_0x5b7f1d){var _0x1de54c={},_0x56e409={},_0xa45eb0={'count':0x0,'rows':[]};var _0x1f2c0e=_[_0xe9bd('0x2e')](db[_0xe9bd('0x2f')][_0xe9bd('0x30')],function(_0x509e36){return{'name':_0x509e36['fieldName'],'type':_0x509e36[_0xe9bd('0x31')][_0xe9bd('0x32')]};});_0x56e409[_0xe9bd('0x33')]=_[_0xe9bd('0x2e')](_0x1f2c0e,_0xe9bd('0x2b'));_0x56e409[_0xe9bd('0x34')]=_[_0xe9bd('0x35')](_0x519f48[_0xe9bd('0x34')]);_0x56e409[_0xe9bd('0x36')]=_['intersection'](_0x56e409[_0xe9bd('0x33')],_0x56e409[_0xe9bd('0x34')]);_0x1de54c[_0xe9bd('0x37')]=_['intersection'](_0x56e409['model'],qs[_0xe9bd('0x38')](_0x519f48[_0xe9bd('0x34')][_0xe9bd('0x38')]));_0x1de54c[_0xe9bd('0x37')]=_0x1de54c[_0xe9bd('0x37')][_0xe9bd('0x39')]?_0x1de54c[_0xe9bd('0x37')]:_0x56e409[_0xe9bd('0x33')];if(!_0x519f48[_0xe9bd('0x34')][_0xe9bd('0x3a')](_0xe9bd('0x3b'))){_0x1de54c[_0xe9bd('0x1e')]=qs[_0xe9bd('0x1e')](_0x519f48[_0xe9bd('0x34')][_0xe9bd('0x1e')]);_0x1de54c[_0xe9bd('0x1d')]=qs[_0xe9bd('0x1d')](_0x519f48[_0xe9bd('0x34')]['offset']);}_0x1de54c[_0xe9bd('0x3c')]=qs[_0xe9bd('0x3d')](_0x519f48['query'][_0xe9bd('0x3d')]);_0x1de54c[_0xe9bd('0x3e')]=qs['filters'](_['pick'](_0x519f48[_0xe9bd('0x34')],_0x56e409[_0xe9bd('0x36')]));if(_0x519f48['query'][_0xe9bd('0x3f')]){_0x1de54c[_0xe9bd('0x3e')]=_[_0xe9bd('0x40')](_0x1de54c['where'],{'$or':_[_0xe9bd('0x2e')](_0x1f2c0e,function(_0x4d1945){if(_0x4d1945[_0xe9bd('0x31')]!==_0xe9bd('0x41')){var _0x63d67c={};_0x63d67c[_0x4d1945[_0xe9bd('0x2b')]]={'$like':'%'+_0x519f48['query'][_0xe9bd('0x3f')]+'%'};return _0x63d67c;}})});}_0x1de54c=_[_0xe9bd('0x40')]({},_0x1de54c,_0x519f48[_0xe9bd('0x42')]);var _0x3f1212={'where':_0x1de54c[_0xe9bd('0x3e')]};return db[_0xe9bd('0x2f')][_0xe9bd('0x1c')](_0x3f1212)[_0xe9bd('0x25')](function(_0x2b5a71){_0xa45eb0[_0xe9bd('0x1c')]=_0x2b5a71;if(_0x519f48['query']['includeAll']){_0x1de54c[_0xe9bd('0x43')]=[{'all':!![]}];}return db['Campaign'][_0xe9bd('0x44')](_0x1de54c);})[_0xe9bd('0x25')](function(_0x41881a){_0xa45eb0['rows']=_0x41881a;return _0xa45eb0;})[_0xe9bd('0x25')](respondWithFilteredResult(_0x5b7f1d,_0x1de54c))[_0xe9bd('0x45')](handleError(_0x5b7f1d,null));};exports[_0xe9bd('0x46')]=function(_0x5a4460,_0x2ef01b){var _0x3a5703={'raw':![],'where':{'id':_0x5a4460[_0xe9bd('0x47')]['id']}},_0x2b3cd7={};_0x2b3cd7[_0xe9bd('0x33')]=_[_0xe9bd('0x35')](db[_0xe9bd('0x2f')][_0xe9bd('0x30')]);_0x2b3cd7[_0xe9bd('0x34')]=_[_0xe9bd('0x35')](_0x5a4460[_0xe9bd('0x34')]);_0x2b3cd7[_0xe9bd('0x36')]=_[_0xe9bd('0x48')](_0x2b3cd7[_0xe9bd('0x33')],_0x2b3cd7[_0xe9bd('0x34')]);_0x3a5703['attributes']=_['intersection'](_0x2b3cd7[_0xe9bd('0x33')],qs[_0xe9bd('0x38')](_0x5a4460[_0xe9bd('0x34')]['fields']));_0x3a5703['attributes']=_0x3a5703[_0xe9bd('0x37')][_0xe9bd('0x39')]?_0x3a5703[_0xe9bd('0x37')]:_0x2b3cd7[_0xe9bd('0x33')];if(_0x5a4460[_0xe9bd('0x34')][_0xe9bd('0x49')]){_0x3a5703[_0xe9bd('0x43')]=[{'all':!![]}];}_0x3a5703=_['merge']({},_0x3a5703,_0x5a4460[_0xe9bd('0x42')]);return db['Campaign'][_0xe9bd('0x4a')](_0x3a5703)[_0xe9bd('0x25')](handleEntityNotFound(_0x2ef01b,null))[_0xe9bd('0x25')](respondWithResult(_0x2ef01b,null))[_0xe9bd('0x45')](handleError(_0x2ef01b,null));};exports[_0xe9bd('0x4b')]=function(_0x4b7b67,_0x3317d6){return db[_0xe9bd('0x2f')][_0xe9bd('0x4b')](_0x4b7b67['body'],{})[_0xe9bd('0x25')](function(_0x476f23){var _0x34f787=_0x4b7b67['user'][_0xe9bd('0x27')]({'plain':!![]});if(!_0x34f787)throw new Error(_0xe9bd('0x4c'));if(_0x34f787[_0xe9bd('0x4d')]===_0xe9bd('0x4e')){var _0x1ee09c=_0x476f23['get']({'plain':!![]});var _0x3f4833='IvrCampaigns';return db[_0xe9bd('0x4f')][_0xe9bd('0x4a')]({'where':{'name':_0x3f4833,'userProfileId':_0x34f787[_0xe9bd('0x50')]},'raw':!![]})[_0xe9bd('0x25')](function(_0x194b7d){if(_0x194b7d&&_0x194b7d['autoAssociation']===0x0){return db[_0xe9bd('0x51')]['create']({'name':_0x1ee09c[_0xe9bd('0x2b')],'resourceId':_0x1ee09c['id'],'type':_0x194b7d[_0xe9bd('0x2b')],'sectionId':_0x194b7d['id']},{})['then'](function(){return _0x476f23;});}else{return _0x476f23;}})['catch'](function(_0x1ce539){logger['error'](_0xe9bd('0x52'),_0x1ce539);throw _0x1ce539;});}return _0x476f23;})['then'](respondWithResult(_0x3317d6,0xc9))[_0xe9bd('0x45')](handleError(_0x3317d6,null));};exports[_0xe9bd('0x53')]=function(_0x5496d7,_0x55f619){var _0x4d6021={'where':{'id':_0x5496d7[_0xe9bd('0x47')]['id']}},_0x3aeda2={};_0x3aeda2[_0xe9bd('0x33')]=_['keys'](db[_0xe9bd('0x2f')][_0xe9bd('0x30')]);_0x4d6021[_0xe9bd('0x37')]=_[_0xe9bd('0x48')](_0x3aeda2['model'],qs['fields'](_0x5496d7[_0xe9bd('0x34')]['fields']));_0x4d6021[_0xe9bd('0x37')]=_0x4d6021[_0xe9bd('0x37')][_0xe9bd('0x39')]?_0x4d6021[_0xe9bd('0x37')]:_0x3aeda2[_0xe9bd('0x33')];if(_0x5496d7[_0xe9bd('0x34')][_0xe9bd('0x49')]){_0x4d6021[_0xe9bd('0x43')]=[{'all':!![]}];}_0x4d6021=_[_0xe9bd('0x40')]({},_0x4d6021,_0x5496d7[_0xe9bd('0x42')]);return db[_0xe9bd('0x2f')][_0xe9bd('0x4a')](_0x4d6021)['then'](handleEntityNotFound(_0x55f619,null))['then'](function(_0x566dd8){if(_0x566dd8){var _0x10e685=_0x566dd8['get']({'plain':!![]});_0x10e685=qs[_0xe9bd('0x54')](_0x10e685,['id',_0xe9bd('0x55'),_0xe9bd('0x56')]);_0x5496d7[_0xe9bd('0x57')]=_[_0xe9bd('0x54')](_0x5496d7[_0xe9bd('0x57')],['id',_0xe9bd('0x55'),_0xe9bd('0x56')]);return db[_0xe9bd('0x2f')]['create'](_[_0xe9bd('0x40')](_0x10e685,_0x5496d7[_0xe9bd('0x57')]),{'include':_0x5496d7[_0xe9bd('0x34')][_0xe9bd('0x49')]?[{'all':!![]}]:undefined})['then'](function(_0x1c8765){var _0xc44b92=_0x5496d7[_0xe9bd('0x4e')]['get']({'plain':!![]});if(!_0xc44b92)throw new Error(_0xe9bd('0x4c'));if(_0xc44b92[_0xe9bd('0x4d')]===_0xe9bd('0x4e')){var _0xfe82f7=_0x1c8765['get']({'plain':!![]});var _0x4b3447=_0xe9bd('0x28');return db[_0xe9bd('0x4f')][_0xe9bd('0x4a')]({'where':{'name':_0x4b3447,'userProfileId':_0xc44b92[_0xe9bd('0x50')]},'raw':!![]})['then'](function(_0x49add9){if(_0x49add9&&_0x49add9[_0xe9bd('0x58')]===0x0){return db[_0xe9bd('0x51')][_0xe9bd('0x4b')]({'name':_0xfe82f7[_0xe9bd('0x2b')],'resourceId':_0xfe82f7['id'],'type':_0x49add9[_0xe9bd('0x2b')],'sectionId':_0x49add9['id']},{})[_0xe9bd('0x25')](function(){return _0x1c8765;});}else{return _0x1c8765;}})['catch'](function(_0x179c8d){logger['error'](_0xe9bd('0x52'),_0x179c8d);throw _0x179c8d;});}return _0x1c8765;});}})[_0xe9bd('0x25')](respondWithResult(_0x55f619,0xc9))[_0xe9bd('0x45')](handleError(_0x55f619,null));};exports[_0xe9bd('0x24')]=function(_0x5bc1f8,_0x1cc054){if(_0x5bc1f8[_0xe9bd('0x57')]['id']){delete _0x5bc1f8[_0xe9bd('0x57')]['id'];}return db['Campaign'][_0xe9bd('0x4a')]({'where':{'id':_0x5bc1f8[_0xe9bd('0x47')]['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x1cc054,null))[_0xe9bd('0x25')](saveUpdates(_0x5bc1f8[_0xe9bd('0x57')],null))[_0xe9bd('0x25')](respondWithResult(_0x1cc054,null))[_0xe9bd('0x45')](handleError(_0x1cc054,null));};exports[_0xe9bd('0x26')]=function(_0x38e2bf,_0x37bb08){return db[_0xe9bd('0x2f')][_0xe9bd('0x4a')]({'where':{'id':_0x38e2bf['params']['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x37bb08,null))[_0xe9bd('0x25')](removeEntity(_0x37bb08,null))['catch'](handleError(_0x37bb08,null));};exports[_0xe9bd('0x59')]=function(_0xe82570,_0x59b8be,_0x561165){var _0x3eeaa5={'raw':!![],'where':{}};var _0x4190f0={};var _0x4ec6ec={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0xe82570[_0xe9bd('0x47')]['id']}})['then'](handleEntityNotFound(_0x59b8be,null))['then'](function(_0x4b5bfb){if(_0x4b5bfb){_0x4190f0['model']=_[_0xe9bd('0x35')](db[_0xe9bd('0x5a')][_0xe9bd('0x30')]);_0x4190f0['query']=_[_0xe9bd('0x35')](_0xe82570[_0xe9bd('0x34')]);_0x4190f0[_0xe9bd('0x36')]=_[_0xe9bd('0x48')](_0x4190f0['model'],_0x4190f0[_0xe9bd('0x34')]);_0x3eeaa5[_0xe9bd('0x37')]=_[_0xe9bd('0x48')](_0x4190f0['model'],qs['fields'](_0xe82570[_0xe9bd('0x34')][_0xe9bd('0x38')]));_0x3eeaa5[_0xe9bd('0x37')]=_0x3eeaa5[_0xe9bd('0x37')][_0xe9bd('0x39')]?_0x3eeaa5[_0xe9bd('0x37')]:_0x4190f0[_0xe9bd('0x33')];if(!_0xe82570[_0xe9bd('0x34')]['hasOwnProperty'](_0xe9bd('0x3b'))){_0x3eeaa5[_0xe9bd('0x1e')]=qs[_0xe9bd('0x1e')](_0xe82570[_0xe9bd('0x34')][_0xe9bd('0x1e')]);_0x3eeaa5['offset']=qs[_0xe9bd('0x1d')](_0xe82570['query']['offset']);}_0x3eeaa5[_0xe9bd('0x3c')]=qs[_0xe9bd('0x3d')](_0xe82570['query'][_0xe9bd('0x3d')]);_0x3eeaa5[_0xe9bd('0x3e')]=qs[_0xe9bd('0x36')](_[_0xe9bd('0x5b')](_0xe82570['query'],_0x4190f0[_0xe9bd('0x36')]));_0x3eeaa5[_0xe9bd('0x3e')]['CampaignId']=_0x4b5bfb['id'];if(_0xe82570[_0xe9bd('0x34')][_0xe9bd('0x3f')]){_0x3eeaa5[_0xe9bd('0x3e')]=_[_0xe9bd('0x40')](_0x3eeaa5[_0xe9bd('0x3e')],{'$or':_[_0xe9bd('0x2e')](_0x3eeaa5[_0xe9bd('0x37')],function(_0x5e127b){var _0x1b0929={};_0x1b0929[_0x5e127b]={'$like':'%'+_0xe82570[_0xe9bd('0x34')][_0xe9bd('0x3f')]+'%'};return _0x1b0929;})});}_0x3eeaa5=_[_0xe9bd('0x40')]({},_0x3eeaa5,_0xe82570[_0xe9bd('0x42')]);return db[_0xe9bd('0x5a')][_0xe9bd('0x1c')]({'where':_0x3eeaa5[_0xe9bd('0x3e')]})[_0xe9bd('0x25')](function(_0x5a7dfd){_0x4ec6ec[_0xe9bd('0x1c')]=_0x5a7dfd;if(_0xe82570[_0xe9bd('0x34')][_0xe9bd('0x49')]){_0x3eeaa5[_0xe9bd('0x43')]=[{'all':!![]}];}return db[_0xe9bd('0x5a')][_0xe9bd('0x44')](_0x3eeaa5);})[_0xe9bd('0x25')](function(_0x4b9c08){_0x4ec6ec[_0xe9bd('0x5c')]=_0x4b9c08;return _0x4ec6ec;});}})[_0xe9bd('0x25')](respondWithFilteredResult(_0x59b8be,_0x3eeaa5))['catch'](handleError(_0x59b8be,null));};exports[_0xe9bd('0x5d')]=function(_0x17f733,_0x2d86b6,_0x2083c4){var _0x242110={'raw':!![],'where':{}};var _0x332228={};var _0x28331d={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x17f733[_0xe9bd('0x47')]['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x2d86b6,null))[_0xe9bd('0x25')](function(_0x1b863f){if(_0x1b863f){_0x332228[_0xe9bd('0x33')]=_[_0xe9bd('0x35')](db[_0xe9bd('0x5e')]['rawAttributes']);_0x332228[_0xe9bd('0x34')]=_[_0xe9bd('0x35')](_0x17f733[_0xe9bd('0x34')]);_0x332228[_0xe9bd('0x36')]=_[_0xe9bd('0x48')](_0x332228[_0xe9bd('0x33')],_0x332228[_0xe9bd('0x34')]);_0x242110['attributes']=_['intersection'](_0x332228['model'],qs[_0xe9bd('0x38')](_0x17f733['query']['fields']));_0x242110['attributes']=_0x242110[_0xe9bd('0x37')][_0xe9bd('0x39')]?_0x242110[_0xe9bd('0x37')]:_0x332228[_0xe9bd('0x33')];if(!_0x17f733[_0xe9bd('0x34')][_0xe9bd('0x3a')](_0xe9bd('0x3b'))){_0x242110[_0xe9bd('0x1e')]=qs[_0xe9bd('0x1e')](_0x17f733['query'][_0xe9bd('0x1e')]);_0x242110['offset']=qs[_0xe9bd('0x1d')](_0x17f733[_0xe9bd('0x34')][_0xe9bd('0x1d')]);}_0x242110[_0xe9bd('0x3c')]=qs[_0xe9bd('0x3d')](_0x17f733['query']['sort']);_0x242110['where']=qs[_0xe9bd('0x36')](_[_0xe9bd('0x5b')](_0x17f733['query'],_0x332228[_0xe9bd('0x36')]));_0x242110[_0xe9bd('0x3e')][_0xe9bd('0x5f')]=_0x1b863f['id'];if(_0x17f733[_0xe9bd('0x34')][_0xe9bd('0x3f')]){_0x242110['where']=_[_0xe9bd('0x40')](_0x242110[_0xe9bd('0x3e')],{'$or':_[_0xe9bd('0x2e')](_0x242110[_0xe9bd('0x37')],function(_0x399429){var _0x1f9829={};_0x1f9829[_0x399429]={'$like':'%'+_0x17f733[_0xe9bd('0x34')][_0xe9bd('0x3f')]+'%'};return _0x1f9829;})});}_0x242110=_[_0xe9bd('0x40')]({},_0x242110,_0x17f733[_0xe9bd('0x42')]);return db['CmHopperHistory']['count']({'where':_0x242110['where']})['then'](function(_0x4039c7){_0x28331d[_0xe9bd('0x1c')]=_0x4039c7;if(_0x17f733[_0xe9bd('0x34')]['includeAll']){_0x242110[_0xe9bd('0x43')]=[{'all':!![]}];}return db[_0xe9bd('0x5e')]['findAll'](_0x242110);})['then'](function(_0xb607c0){_0x28331d[_0xe9bd('0x5c')]=_0xb607c0;return _0x28331d;});}})[_0xe9bd('0x25')](respondWithFilteredResult(_0x2d86b6,_0x242110))[_0xe9bd('0x45')](handleError(_0x2d86b6,null));};exports[_0xe9bd('0x60')]=function(_0x59364c,_0x5bd400,_0x499771){var _0x223f56={'raw':!![],'where':{}};var _0x2c7a14={};var _0x448f82={'count':0x0,'rows':[]};return db[_0xe9bd('0x2f')][_0xe9bd('0x61')]({'where':{'id':_0x59364c[_0xe9bd('0x47')]['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x5bd400,null))[_0xe9bd('0x25')](function(_0x2fae04){if(_0x2fae04){_0x2c7a14[_0xe9bd('0x33')]=_['keys'](db[_0xe9bd('0x62')]['rawAttributes']);_0x2c7a14[_0xe9bd('0x34')]=_['keys'](_0x59364c['query']);_0x2c7a14[_0xe9bd('0x36')]=_['intersection'](_0x2c7a14[_0xe9bd('0x33')],_0x2c7a14['query']);_0x223f56[_0xe9bd('0x37')]=_[_0xe9bd('0x48')](_0x2c7a14[_0xe9bd('0x33')],qs[_0xe9bd('0x38')](_0x59364c[_0xe9bd('0x34')][_0xe9bd('0x38')]));_0x223f56['attributes']=_0x223f56[_0xe9bd('0x37')][_0xe9bd('0x39')]?_0x223f56['attributes']:_0x2c7a14[_0xe9bd('0x33')];if(!_0x59364c[_0xe9bd('0x34')][_0xe9bd('0x3a')]('nolimit')){_0x223f56[_0xe9bd('0x1e')]=qs[_0xe9bd('0x1e')](_0x59364c[_0xe9bd('0x34')][_0xe9bd('0x1e')]);_0x223f56[_0xe9bd('0x1d')]=qs['offset'](_0x59364c[_0xe9bd('0x34')][_0xe9bd('0x1d')]);}_0x223f56['order']=qs[_0xe9bd('0x3d')](_0x59364c[_0xe9bd('0x34')][_0xe9bd('0x3d')]);_0x223f56[_0xe9bd('0x3e')]=qs['filters'](_[_0xe9bd('0x5b')](_0x59364c[_0xe9bd('0x34')],_0x2c7a14[_0xe9bd('0x36')]));_0x223f56[_0xe9bd('0x3e')][_0xe9bd('0x5f')]=_0x2fae04['id'];if(_0x59364c[_0xe9bd('0x34')][_0xe9bd('0x3f')]){_0x223f56['where']=_[_0xe9bd('0x40')](_0x223f56['where'],{'$or':_[_0xe9bd('0x2e')](_0x223f56[_0xe9bd('0x37')],function(_0x11ac8d){var _0x5e08e0={};_0x5e08e0[_0x11ac8d]={'$like':'%'+_0x59364c[_0xe9bd('0x34')]['filter']+'%'};return _0x5e08e0;})});}_0x223f56=_[_0xe9bd('0x40')]({},_0x223f56,_0x59364c[_0xe9bd('0x42')]);return db[_0xe9bd('0x62')][_0xe9bd('0x1c')]({'where':_0x223f56[_0xe9bd('0x3e')]})[_0xe9bd('0x25')](function(_0x4f6a50){_0x448f82[_0xe9bd('0x1c')]=_0x4f6a50;if(_0x59364c[_0xe9bd('0x34')][_0xe9bd('0x49')]){_0x223f56[_0xe9bd('0x43')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xe9bd('0x44')](_0x223f56);})[_0xe9bd('0x25')](function(_0x261af6){_0x448f82['rows']=_0x261af6;return _0x448f82;});}})[_0xe9bd('0x25')](respondWithFilteredResult(_0x5bd400,_0x223f56))[_0xe9bd('0x45')](handleError(_0x5bd400,null));};exports['getHopperBlacks']=function(_0x59bfc1,_0x571fc1,_0x52df8f){var _0x458bff={'raw':!![],'where':{}};var _0x3b32a9={};var _0x1c0c0a={'count':0x0,'rows':[]};return db['Campaign'][_0xe9bd('0x61')]({'where':{'id':_0x59bfc1[_0xe9bd('0x47')]['id']}})['then'](handleEntityNotFound(_0x571fc1,null))[_0xe9bd('0x25')](function(_0x35894c){if(_0x35894c){_0x3b32a9[_0xe9bd('0x33')]=_[_0xe9bd('0x35')](db[_0xe9bd('0x63')]['rawAttributes']);_0x3b32a9[_0xe9bd('0x34')]=_[_0xe9bd('0x35')](_0x59bfc1['query']);_0x3b32a9['filters']=_['intersection'](_0x3b32a9['model'],_0x3b32a9[_0xe9bd('0x34')]);_0x458bff[_0xe9bd('0x37')]=_[_0xe9bd('0x48')](_0x3b32a9[_0xe9bd('0x33')],qs['fields'](_0x59bfc1['query'][_0xe9bd('0x38')]));_0x458bff[_0xe9bd('0x37')]=_0x458bff[_0xe9bd('0x37')]['length']?_0x458bff[_0xe9bd('0x37')]:_0x3b32a9[_0xe9bd('0x33')];if(!_0x59bfc1['query']['hasOwnProperty'](_0xe9bd('0x3b'))){_0x458bff[_0xe9bd('0x1e')]=qs[_0xe9bd('0x1e')](_0x59bfc1[_0xe9bd('0x34')][_0xe9bd('0x1e')]);_0x458bff[_0xe9bd('0x1d')]=qs[_0xe9bd('0x1d')](_0x59bfc1[_0xe9bd('0x34')][_0xe9bd('0x1d')]);}_0x458bff['order']=qs[_0xe9bd('0x3d')](_0x59bfc1[_0xe9bd('0x34')][_0xe9bd('0x3d')]);_0x458bff[_0xe9bd('0x3e')]=qs[_0xe9bd('0x36')](_[_0xe9bd('0x5b')](_0x59bfc1['query'],_0x3b32a9[_0xe9bd('0x36')]));_0x458bff['where'][_0xe9bd('0x5f')]=_0x35894c['id'];if(_0x59bfc1['query'][_0xe9bd('0x3f')]){_0x458bff[_0xe9bd('0x3e')]=_['merge'](_0x458bff[_0xe9bd('0x3e')],{'$or':_[_0xe9bd('0x2e')](_0x458bff['attributes'],function(_0x95e011){var _0x9bd62a={};_0x9bd62a[_0x95e011]={'$like':'%'+_0x59bfc1[_0xe9bd('0x34')][_0xe9bd('0x3f')]+'%'};return _0x9bd62a;})});}_0x458bff=_['merge']({},_0x458bff,_0x59bfc1[_0xe9bd('0x42')]);return db[_0xe9bd('0x63')]['count']({'where':_0x458bff[_0xe9bd('0x3e')]})[_0xe9bd('0x25')](function(_0x2d5601){_0x1c0c0a['count']=_0x2d5601;if(_0x59bfc1[_0xe9bd('0x34')][_0xe9bd('0x49')]){_0x458bff[_0xe9bd('0x43')]=[{'all':!![]}];}return db[_0xe9bd('0x63')][_0xe9bd('0x44')](_0x458bff);})[_0xe9bd('0x25')](function(_0x136aa0){_0x1c0c0a['rows']=_0x136aa0;return _0x1c0c0a;});}})[_0xe9bd('0x25')](respondWithFilteredResult(_0x571fc1,_0x458bff))[_0xe9bd('0x45')](handleError(_0x571fc1,null));};exports[_0xe9bd('0x64')]=function(_0x5a0758,_0x67bd92,_0x57c26d){var _0x5ba105={};var _0x4e1eb8={};var _0x1939ed;var _0x48af68;return db['Campaign'][_0xe9bd('0x61')]({'where':{'id':_0x5a0758[_0xe9bd('0x47')]['id']}})['then'](handleEntityNotFound(_0x67bd92,null))[_0xe9bd('0x25')](function(_0x48f4cd){if(_0x48f4cd){_0x1939ed=_0x48f4cd;_0x4e1eb8['model']=_['keys'](db[_0xe9bd('0x65')]['rawAttributes']);_0x4e1eb8['query']=_[_0xe9bd('0x35')](_0x5a0758[_0xe9bd('0x34')]);_0x4e1eb8[_0xe9bd('0x36')]=_[_0xe9bd('0x48')](_0x4e1eb8[_0xe9bd('0x33')],_0x4e1eb8[_0xe9bd('0x34')]);_0x5ba105[_0xe9bd('0x37')]=_['intersection'](_0x4e1eb8[_0xe9bd('0x33')],qs['fields'](_0x5a0758['query'][_0xe9bd('0x38')]));_0x5ba105[_0xe9bd('0x37')]=_0x5ba105[_0xe9bd('0x37')][_0xe9bd('0x39')]?_0x5ba105[_0xe9bd('0x37')]:_0x4e1eb8['model'];_0x5ba105[_0xe9bd('0x3c')]=qs[_0xe9bd('0x3d')](_0x5a0758[_0xe9bd('0x34')][_0xe9bd('0x3d')]);_0x5ba105[_0xe9bd('0x3e')]=qs[_0xe9bd('0x36')](_['pick'](_0x5a0758[_0xe9bd('0x34')],_0x4e1eb8[_0xe9bd('0x36')]));if(_0x5a0758[_0xe9bd('0x34')][_0xe9bd('0x3f')]){_0x5ba105[_0xe9bd('0x3e')]=_[_0xe9bd('0x40')](_0x5ba105['where'],{'$or':_[_0xe9bd('0x2e')](_0x5ba105[_0xe9bd('0x37')],function(_0x4d88c8){var _0x1e5c54={};_0x1e5c54[_0x4d88c8]={'$like':'%'+_0x5a0758[_0xe9bd('0x34')][_0xe9bd('0x3f')]+'%'};return _0x1e5c54;})});}_0x5ba105=_[_0xe9bd('0x40')]({},_0x5ba105,_0x5a0758['options']);return _0x1939ed[_0xe9bd('0x64')](_0x5ba105);}})[_0xe9bd('0x25')](function(_0x4249f5){if(_0x4249f5){_0x48af68=_0x4249f5[_0xe9bd('0x39')];if(!_0x5a0758[_0xe9bd('0x34')][_0xe9bd('0x3a')](_0xe9bd('0x3b'))){_0x5ba105[_0xe9bd('0x1e')]=qs[_0xe9bd('0x1e')](_0x5a0758['query'][_0xe9bd('0x1e')]);_0x5ba105[_0xe9bd('0x1d')]=qs[_0xe9bd('0x1d')](_0x5a0758[_0xe9bd('0x34')][_0xe9bd('0x1d')]);}return _0x1939ed[_0xe9bd('0x64')](_0x5ba105);}})[_0xe9bd('0x25')](function(_0x4a8358){if(_0x4a8358){return _0x4a8358?{'count':_0x48af68,'rows':_0x4a8358}:null;}})[_0xe9bd('0x25')](respondWithResult(_0x67bd92,null))['catch'](handleError(_0x67bd92,null));};exports[_0xe9bd('0x66')]=function(_0xbc686e,_0x2db271,_0x1c2d6d){var _0x3f0e49,_0x2b8645;return db['Campaign'][_0xe9bd('0x4a')]({'where':{'id':_0xbc686e[_0xe9bd('0x47')]['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x2db271,null))['then'](function(_0x457536){if(_0x457536){_0x2b8645=_0x457536;return _0x457536[_0xe9bd('0x66')](_0xbc686e[_0xe9bd('0x57')][_0xe9bd('0x67')],_[_0xe9bd('0x54')](_0xbc686e[_0xe9bd('0x57')],[_0xe9bd('0x67'),'id'])||{});}return null;})[_0xe9bd('0x68')](function(_0x20a8ce){var _0x3b0874;_0x3f0e49=_0x20a8ce||[];var _0x5c0b2d=[];if(_0x20a8ce){for(var _0x464f7a=0x0;_0x464f7a<_0x20a8ce[_0xe9bd('0x39')];_0x464f7a+=0x1){var _0x31aae8=_0x20a8ce[_0x464f7a]['get']({'plain':!![]});_0x2b8645[_0xe9bd('0x69')]=_0xbc686e[_0xe9bd('0x57')][_0xe9bd('0x69')]?_0xbc686e['body']['dialCheckDuplicateType']:_0x2b8645[_0xe9bd('0x69')];switch(_0x2b8645[_0xe9bd('0x69')]){case _0xe9bd('0x6a'):_0x3b0874=squel[_0xe9bd('0x6b')]()[_0xe9bd('0x6c')](_0xe9bd('0x6d'))[_0xe9bd('0x6e')](['phone',_0xe9bd('0x6f'),_0xe9bd('0x70'),'ListId',_0xe9bd('0x5f'),_0xe9bd('0x55'),_0xe9bd('0x56')],squel[_0xe9bd('0x71')]()[_0xe9bd('0x72')](_0xe9bd('0x73'),_0xe9bd('0x73'))[_0xe9bd('0x72')](_0xe9bd('0x74'),_0xe9bd('0x6f'))[_0xe9bd('0x72')]('id',_0xe9bd('0x70'))[_0xe9bd('0x72')](_0x31aae8[_0xe9bd('0x75')][_0xe9bd('0x76')](),'ListId')[_0xe9bd('0x72')](_0xbc686e[_0xe9bd('0x47')]['id'][_0xe9bd('0x76')](),_0xe9bd('0x5f'))[_0xe9bd('0x72')]('NOW()',_0xe9bd('0x55'))[_0xe9bd('0x72')](_0xe9bd('0x74'),_0xe9bd('0x56'))[_0xe9bd('0x77')](_0xe9bd('0x78'))[_0xe9bd('0x3e')](_0xe9bd('0x79'))[_0xe9bd('0x3e')](_0xe9bd('0x7a'),_0x31aae8[_0xe9bd('0x75')][_0xe9bd('0x76')]())[_0xe9bd('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0xe9bd('0x3e')](_0xe9bd('0x7b'),squel[_0xe9bd('0x71')]()[_0xe9bd('0x72')](_0xe9bd('0x7c'))[_0xe9bd('0x77')](_0xe9bd('0x7d'))[_0xe9bd('0x3e')](_0xe9bd('0x7e'),_0xbc686e[_0xe9bd('0x47')]['id'][_0xe9bd('0x76')]()))[_0xe9bd('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0xe9bd('0x71')]()[_0xe9bd('0x72')](_0xe9bd('0x7f'))[_0xe9bd('0x77')](_0xe9bd('0x6d'))['where'](_0xe9bd('0x7e'),_0xbc686e[_0xe9bd('0x47')]['id'][_0xe9bd('0x76')]())))['toString']();break;case _0xe9bd('0x80'):_0x3b0874=squel[_0xe9bd('0x6b')]()['into']('cm_hopper')['fromQuery']([_0xe9bd('0x73'),_0xe9bd('0x6f'),'ContactId',_0xe9bd('0x81'),_0xe9bd('0x5f'),_0xe9bd('0x55'),'updatedAt'],squel[_0xe9bd('0x71')]()[_0xe9bd('0x72')](_0xe9bd('0x73'),_0xe9bd('0x73'))['field'](_0xe9bd('0x74'),_0xe9bd('0x6f'))['field']('id',_0xe9bd('0x70'))[_0xe9bd('0x72')](_0x31aae8[_0xe9bd('0x75')][_0xe9bd('0x76')](),'ListId')['field'](_0xbc686e['params']['id'][_0xe9bd('0x76')](),'CampaignId')[_0xe9bd('0x72')](_0xe9bd('0x74'),_0xe9bd('0x55'))[_0xe9bd('0x72')](_0xe9bd('0x74'),_0xe9bd('0x56'))['from'](_0xe9bd('0x78'))[_0xe9bd('0x3e')](_0xe9bd('0x79'))[_0xe9bd('0x3e')](_0xe9bd('0x7a'),_0x31aae8[_0xe9bd('0x75')][_0xe9bd('0x76')]())['where'](_0xe9bd('0x82'))[_0xe9bd('0x3e')](_0xe9bd('0x7b'),squel[_0xe9bd('0x71')]()['field'](_0xe9bd('0x7f'))[_0xe9bd('0x77')](_0xe9bd('0x6d'))[_0xe9bd('0x3e')](_0xe9bd('0x7e'),_0xbc686e[_0xe9bd('0x47')]['id'][_0xe9bd('0x76')]())))[_0xe9bd('0x76')]();break;default:_0x3b0874=squel[_0xe9bd('0x6b')]()[_0xe9bd('0x6c')](_0xe9bd('0x6d'))[_0xe9bd('0x6e')]([_0xe9bd('0x73'),'scheduledAt',_0xe9bd('0x70'),_0xe9bd('0x81'),'CampaignId',_0xe9bd('0x55'),_0xe9bd('0x56')],squel[_0xe9bd('0x71')]()['field'](_0xe9bd('0x73'),_0xe9bd('0x73'))[_0xe9bd('0x72')](_0xe9bd('0x74'),'scheduledAt')[_0xe9bd('0x72')]('id',_0xe9bd('0x70'))[_0xe9bd('0x72')](_0x31aae8[_0xe9bd('0x75')][_0xe9bd('0x76')](),_0xe9bd('0x81'))['field'](_0xbc686e[_0xe9bd('0x47')]['id']['toString'](),'CampaignId')[_0xe9bd('0x72')]('NOW()',_0xe9bd('0x55'))['field'](_0xe9bd('0x74'),_0xe9bd('0x56'))['from'](_0xe9bd('0x78'))[_0xe9bd('0x3e')](_0xe9bd('0x79'))[_0xe9bd('0x3e')](_0xe9bd('0x7a'),_0x31aae8[_0xe9bd('0x75')][_0xe9bd('0x76')]())['where'](_0xe9bd('0x82')))[_0xe9bd('0x76')]();}_0x5c0b2d[_0xe9bd('0x83')](db[_0xe9bd('0x84')][_0xe9bd('0x34')](_0x3b0874));}return BPromise[_0xe9bd('0x85')](_0x5c0b2d);}})['then'](function(){return _0x3f0e49;})[_0xe9bd('0x25')](respondWithResult(_0x2db271,null))[_0xe9bd('0x45')](handleError(_0x2db271,null));};exports[_0xe9bd('0x86')]=function(_0x377e3f,_0x4747de,_0x5692ab){return db['Campaign']['find']({'where':{'id':_0x377e3f[_0xe9bd('0x47')]['id']}})['then'](handleEntityNotFound(_0x4747de,null))[_0xe9bd('0x25')](function(_0x1c340c){if(_0x1c340c){return _0x1c340c['removeLists'](_0x377e3f[_0xe9bd('0x34')][_0xe9bd('0x67')]);}})[_0xe9bd('0x25')](function(_0x3d9732){if(_0x3d9732){return db[_0xe9bd('0x5a')][_0xe9bd('0x26')]({'where':{'ListId':_0x377e3f[_0xe9bd('0x34')]['ids'],'CampaignId':_0x377e3f['params']['id']}})[_0xe9bd('0x25')](function(){return _0x3d9732;});}})['then'](respondWithStatusCode(_0x4747de,null))['catch'](handleError(_0x4747de,null));};exports[_0xe9bd('0x87')]=function(_0x7de714,_0x63af04,_0x391b6b){var _0x2d2872={'raw':!![],'where':{}};var _0x43fe2f={};var _0x3a9bc4={'count':0x0,'rows':[]};return db[_0xe9bd('0x2f')][_0xe9bd('0x61')]({'where':{'id':_0x7de714[_0xe9bd('0x47')]['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x63af04,null))['then'](function(_0x287012){if(_0x287012){_0x43fe2f['model']=_[_0xe9bd('0x35')](db[_0xe9bd('0x65')][_0xe9bd('0x30')]);_0x43fe2f[_0xe9bd('0x34')]=_['keys'](_0x7de714[_0xe9bd('0x34')]);_0x43fe2f[_0xe9bd('0x36')]=_[_0xe9bd('0x48')](_0x43fe2f['model'],_0x43fe2f['query']);_0x2d2872[_0xe9bd('0x37')]=_[_0xe9bd('0x48')](_0x43fe2f[_0xe9bd('0x33')],qs[_0xe9bd('0x38')](_0x7de714[_0xe9bd('0x34')][_0xe9bd('0x38')]));_0x2d2872['attributes']=_0x2d2872[_0xe9bd('0x37')][_0xe9bd('0x39')]?_0x2d2872[_0xe9bd('0x37')]:_0x43fe2f[_0xe9bd('0x33')];if(!_0x7de714['query'][_0xe9bd('0x3a')](_0xe9bd('0x3b'))){_0x2d2872[_0xe9bd('0x1e')]=qs['limit'](_0x7de714[_0xe9bd('0x34')][_0xe9bd('0x1e')]);_0x2d2872[_0xe9bd('0x1d')]=qs[_0xe9bd('0x1d')](_0x7de714[_0xe9bd('0x34')][_0xe9bd('0x1d')]);}_0x2d2872[_0xe9bd('0x3c')]=qs['sort'](_0x7de714['query'][_0xe9bd('0x3d')]);_0x2d2872[_0xe9bd('0x3e')]=qs[_0xe9bd('0x36')](_['pick'](_0x7de714['query'],_0x43fe2f[_0xe9bd('0x36')]));_0x2d2872[_0xe9bd('0x3e')][_0xe9bd('0x5f')]=_0x287012['id'];if(_0x7de714['query'][_0xe9bd('0x3f')]){_0x2d2872['where']=_[_0xe9bd('0x40')](_0x2d2872[_0xe9bd('0x3e')],{'$or':_[_0xe9bd('0x2e')](_0x2d2872[_0xe9bd('0x37')],function(_0x1c1593){var _0x7673f3={};_0x7673f3[_0x1c1593]={'$like':'%'+_0x7de714[_0xe9bd('0x34')][_0xe9bd('0x3f')]+'%'};return _0x7673f3;})});}_0x2d2872=_[_0xe9bd('0x40')]({},_0x2d2872,_0x7de714['options']);return db['CmList'][_0xe9bd('0x1c')]({'where':_0x2d2872[_0xe9bd('0x3e')]})[_0xe9bd('0x25')](function(_0x2c0457){_0x3a9bc4[_0xe9bd('0x1c')]=_0x2c0457;if(_0x7de714[_0xe9bd('0x34')][_0xe9bd('0x49')]){_0x2d2872[_0xe9bd('0x43')]=[{'all':!![]}];}return db['CmList'][_0xe9bd('0x44')](_0x2d2872);})[_0xe9bd('0x25')](function(_0x55a0ec){_0x3a9bc4[_0xe9bd('0x5c')]=_0x55a0ec;return _0x3a9bc4;});}})['then'](respondWithFilteredResult(_0x63af04,_0x2d2872))[_0xe9bd('0x45')](handleError(_0x63af04,null));};exports[_0xe9bd('0x88')]=function(_0x401924,_0x5a7a61,_0x4c7419){var _0x1f0452,_0x488000;return db[_0xe9bd('0x2f')][_0xe9bd('0x4a')]({'where':{'id':_0x401924[_0xe9bd('0x47')]['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x5a7a61,null))[_0xe9bd('0x25')](function(_0x4eb22e){if(_0x4eb22e){_0x488000=_0x4eb22e;return _0x4eb22e[_0xe9bd('0x88')](_0x401924[_0xe9bd('0x57')][_0xe9bd('0x67')],_[_0xe9bd('0x54')](_0x401924[_0xe9bd('0x57')],[_0xe9bd('0x67'),'id'])||{});}return null;})['spread'](function(_0x39e8e5){var _0x5a2edb;_0x1f0452=_0x39e8e5||[];var _0x25d15b=[];if(_0x39e8e5){for(var _0x560ed7=0x0;_0x560ed7<_0x39e8e5[_0xe9bd('0x39')];_0x560ed7+=0x1){var _0x1ec28e=_0x39e8e5[_0x560ed7]['get']({'plain':!![]});_0x5a2edb=squel[_0xe9bd('0x6b')]()[_0xe9bd('0x6c')]('cm_hopper_black')[_0xe9bd('0x6e')](['phone','ContactId','ListId',_0xe9bd('0x5f'),_0xe9bd('0x55'),'updatedAt'],squel['select']()[_0xe9bd('0x72')]('phone',_0xe9bd('0x73'))[_0xe9bd('0x72')]('id','ContactId')[_0xe9bd('0x72')](_0x1ec28e[_0xe9bd('0x75')][_0xe9bd('0x76')](),_0xe9bd('0x81'))[_0xe9bd('0x72')](_0x401924[_0xe9bd('0x47')]['id'][_0xe9bd('0x76')](),_0xe9bd('0x5f'))[_0xe9bd('0x72')](_0xe9bd('0x74'),_0xe9bd('0x55'))[_0xe9bd('0x72')](_0xe9bd('0x74'),'updatedAt')[_0xe9bd('0x77')](_0xe9bd('0x78'))[_0xe9bd('0x3e')](_0xe9bd('0x79'))[_0xe9bd('0x3e')]('ListId\x20=\x20?',_0x1ec28e[_0xe9bd('0x75')][_0xe9bd('0x76')]())[_0xe9bd('0x3e')](_0xe9bd('0x82')))[_0xe9bd('0x76')]();_0x25d15b[_0xe9bd('0x83')](db[_0xe9bd('0x84')]['query'](_0x5a2edb));}return BPromise[_0xe9bd('0x85')](_0x25d15b);}})[_0xe9bd('0x25')](function(){return _0x1f0452;})['then'](respondWithResult(_0x5a7a61,null))[_0xe9bd('0x45')](handleError(_0x5a7a61,null));};exports[_0xe9bd('0x89')]=function(_0x3ea71a,_0x271ab8,_0x24aef6){return db[_0xe9bd('0x2f')][_0xe9bd('0x4a')]({'where':{'id':_0x3ea71a[_0xe9bd('0x47')]['id']}})['then'](handleEntityNotFound(_0x271ab8,null))[_0xe9bd('0x25')](function(_0x1b52e2){if(_0x1b52e2){return _0x1b52e2[_0xe9bd('0x89')](_0x3ea71a['query'][_0xe9bd('0x67')]);}})[_0xe9bd('0x25')](function(_0x5ceed4){if(_0x5ceed4){return db['CmHopperBlack'][_0xe9bd('0x26')]({'where':{'ListId':_0x3ea71a['query'][_0xe9bd('0x67')],'CampaignId':_0x3ea71a[_0xe9bd('0x47')]['id']}})[_0xe9bd('0x25')](function(){return _0x5ceed4;});}})[_0xe9bd('0x25')](respondWithStatusCode(_0x271ab8,null))[_0xe9bd('0x45')](handleError(_0x271ab8,null));}; \ No newline at end of file +var _0xd64b=['userProfileId','autoAssociation','UserProfileResource','clone','omit','createdAt','updatedAt','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','CampaignId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','NOW()','field','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','spread','cm_hopper_black','removeBlackLists','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','update','then','destroy','IvrCampaigns','stack','index','map','Campaign','rawAttributes','fieldName','type','key','model','name','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','count','rows','catch','show','params','keys','includeAll','include','merge','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection'];(function(_0x20c8e3,_0x27e7b9){var _0x78908d=function(_0xaa989e){while(--_0xaa989e){_0x20c8e3['push'](_0x20c8e3['shift']());}};_0x78908d(++_0x27e7b9);}(_0xd64b,0xc1));var _0xbd64=function(_0x503d48,_0x42e5a9){_0x503d48=_0x503d48-0x0;var _0x59743e=_0xd64b[_0x503d48];return _0x59743e;};'use strict';var pdf=require(_0xbd64('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbd64('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd64('0x2'));var rp=require(_0xbd64('0x3'));var moment=require(_0xbd64('0x4'));var BPromise=require(_0xbd64('0x5'));var Mustache=require(_0xbd64('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbd64('0x7'));var fs=require('fs');var _=require(_0xbd64('0x8'));var squel=require(_0xbd64('0x9'));var crypto=require(_0xbd64('0xa'));var jsforce=require(_0xbd64('0xb'));var deskjs=require(_0xbd64('0xc'));var toCsv=require(_0xbd64('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbd64('0xe'));var authService=require(_0xbd64('0xf'));var qs=require(_0xbd64('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd64('0x11'));var logger=require(_0xbd64('0x12'))(_0xbd64('0x13'));var utils=require(_0xbd64('0x14'));var config=require('../../config/environment');var db=require(_0xbd64('0x15'))['db'];function respondWithStatusCode(_0x5f2adf,_0x136f60){_0x136f60=_0x136f60||0xcc;return function(_0x2729d8){if(_0x2729d8){return _0x5f2adf[_0xbd64('0x16')](_0x136f60);}return _0x5f2adf[_0xbd64('0x17')](_0x136f60)[_0xbd64('0x18')]();};}function respondWithResult(_0x27438c,_0x2e23f2){_0x2e23f2=_0x2e23f2||0xc8;return function(_0x269e2f){if(_0x269e2f){return _0x27438c[_0xbd64('0x17')](_0x2e23f2)['json'](_0x269e2f);}};}function respondWithFilteredResult(_0x2d1159,_0x13e7a4){return function(_0x3ff550){if(_0x3ff550){var _0x32fd34=_0x3ff550['count'],_0x29fc16=_0x13e7a4[_0xbd64('0x19')],_0x49a914=_0x13e7a4[_0xbd64('0x19')]+_0x13e7a4[_0xbd64('0x1a')],_0x352e6b;if(_0x49a914>=_0x32fd34){_0x49a914=_0x32fd34;_0x352e6b=0xc8;}else{_0x352e6b=0xce;}_0x2d1159[_0xbd64('0x17')](_0x352e6b);return _0x2d1159[_0xbd64('0x1b')](_0xbd64('0x1c'),_0x29fc16+'-'+_0x49a914+'/'+_0x32fd34)[_0xbd64('0x1d')](_0x3ff550);}return null;};}function patchUpdates(_0x32c4c7){return function(_0x5d3b00){try{jsonpatch[_0xbd64('0x1e')](_0x5d3b00,_0x32c4c7,!![]);}catch(_0x1f618b){return BPromise['reject'](_0x1f618b);}return _0x5d3b00['save']();};}function saveUpdates(_0xa4647f,_0x42b328){return function(_0x196d21){if(_0x196d21){return _0x196d21[_0xbd64('0x1f')](_0xa4647f)[_0xbd64('0x20')](function(_0x816e00){return _0x816e00;});}return null;};}function removeEntity(_0x5dc2bd,_0x4d4a16){return function(_0x6038f){if(_0x6038f){return _0x6038f[_0xbd64('0x21')]()[_0xbd64('0x20')](function(){var _0x365d88=_0x6038f['get']({'plain':!![]});var _0x51d118=_0xbd64('0x22');return db['UserProfileResource'][_0xbd64('0x21')]({'where':{'type':_0x51d118,'resourceId':_0x365d88['id']}})['then'](function(){return _0x6038f;});})[_0xbd64('0x20')](function(){_0x5dc2bd[_0xbd64('0x17')](0xcc)[_0xbd64('0x18')]();});}};}function handleEntityNotFound(_0x2d0993,_0x5ae417){return function(_0x9d0fb8){if(!_0x9d0fb8){_0x2d0993[_0xbd64('0x16')](0x194);}return _0x9d0fb8;};}function handleError(_0x13f527,_0x2a44d0){_0x2a44d0=_0x2a44d0||0x1f4;return function(_0x4d1563){logger['error'](_0x4d1563[_0xbd64('0x23')]);if(_0x4d1563['name']){delete _0x4d1563['name'];}_0x13f527[_0xbd64('0x17')](_0x2a44d0)['send'](_0x4d1563);};}exports[_0xbd64('0x24')]=function(_0x5300e8,_0x28199c){var _0x5d8c35={},_0x1db9f3={},_0x3c0eaf={'count':0x0,'rows':[]};var _0x3be63a=_[_0xbd64('0x25')](db[_0xbd64('0x26')][_0xbd64('0x27')],function(_0x4ed44a){return{'name':_0x4ed44a[_0xbd64('0x28')],'type':_0x4ed44a[_0xbd64('0x29')][_0xbd64('0x2a')]};});_0x1db9f3[_0xbd64('0x2b')]=_[_0xbd64('0x25')](_0x3be63a,_0xbd64('0x2c'));_0x1db9f3['query']=_['keys'](_0x5300e8[_0xbd64('0x2d')]);_0x1db9f3['filters']=_[_0xbd64('0x2e')](_0x1db9f3[_0xbd64('0x2b')],_0x1db9f3['query']);_0x5d8c35['attributes']=_[_0xbd64('0x2e')](_0x1db9f3['model'],qs['fields'](_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x5d8c35[_0xbd64('0x30')]=_0x5d8c35['attributes'][_0xbd64('0x31')]?_0x5d8c35['attributes']:_0x1db9f3[_0xbd64('0x2b')];if(!_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x32')](_0xbd64('0x33'))){_0x5d8c35[_0xbd64('0x1a')]=qs[_0xbd64('0x1a')](_0x5300e8['query']['limit']);_0x5d8c35[_0xbd64('0x19')]=qs[_0xbd64('0x19')](_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x19')]);}_0x5d8c35[_0xbd64('0x34')]=qs[_0xbd64('0x35')](_0x5300e8['query']['sort']);_0x5d8c35[_0xbd64('0x36')]=qs[_0xbd64('0x37')](_[_0xbd64('0x38')](_0x5300e8['query'],_0x1db9f3['filters']));if(_0x5300e8[_0xbd64('0x2d')]['filter']){_0x5d8c35[_0xbd64('0x36')]=_['merge'](_0x5d8c35[_0xbd64('0x36')],{'$or':_[_0xbd64('0x25')](_0x3be63a,function(_0x550221){if(_0x550221[_0xbd64('0x29')]!=='VIRTUAL'){var _0x534091={};_0x534091[_0x550221[_0xbd64('0x2c')]]={'$like':'%'+_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x39')]+'%'};return _0x534091;}})});}_0x5d8c35=_['merge']({},_0x5d8c35,_0x5300e8['options']);var _0x5d6bcf={'where':_0x5d8c35[_0xbd64('0x36')]};return db[_0xbd64('0x26')]['count'](_0x5d6bcf)[_0xbd64('0x20')](function(_0x34b19a){_0x3c0eaf[_0xbd64('0x3a')]=_0x34b19a;if(_0x5300e8[_0xbd64('0x2d')]['includeAll']){_0x5d8c35['include']=[{'all':!![]}];}return db[_0xbd64('0x26')]['findAll'](_0x5d8c35);})['then'](function(_0x231fa6){_0x3c0eaf[_0xbd64('0x3b')]=_0x231fa6;return _0x3c0eaf;})[_0xbd64('0x20')](respondWithFilteredResult(_0x28199c,_0x5d8c35))[_0xbd64('0x3c')](handleError(_0x28199c,null));};exports[_0xbd64('0x3d')]=function(_0x3155b3,_0x247775){var _0x762380={'raw':![],'where':{'id':_0x3155b3[_0xbd64('0x3e')]['id']}},_0x4870fd={};_0x4870fd[_0xbd64('0x2b')]=_['keys'](db[_0xbd64('0x26')][_0xbd64('0x27')]);_0x4870fd[_0xbd64('0x2d')]=_[_0xbd64('0x3f')](_0x3155b3[_0xbd64('0x2d')]);_0x4870fd[_0xbd64('0x37')]=_[_0xbd64('0x2e')](_0x4870fd['model'],_0x4870fd[_0xbd64('0x2d')]);_0x762380['attributes']=_[_0xbd64('0x2e')](_0x4870fd['model'],qs[_0xbd64('0x2f')](_0x3155b3[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x762380['attributes']=_0x762380[_0xbd64('0x30')]['length']?_0x762380['attributes']:_0x4870fd['model'];if(_0x3155b3[_0xbd64('0x2d')][_0xbd64('0x40')]){_0x762380[_0xbd64('0x41')]=[{'all':!![]}];}_0x762380=_[_0xbd64('0x42')]({},_0x762380,_0x3155b3[_0xbd64('0x43')]);return db[_0xbd64('0x26')][_0xbd64('0x44')](_0x762380)['then'](handleEntityNotFound(_0x247775,null))[_0xbd64('0x20')](respondWithResult(_0x247775,null))[_0xbd64('0x3c')](handleError(_0x247775,null));};exports[_0xbd64('0x45')]=function(_0x4e5efe,_0x105bee){return db[_0xbd64('0x26')][_0xbd64('0x45')](_0x4e5efe[_0xbd64('0x46')],{})[_0xbd64('0x20')](function(_0x5a6b5e){var _0x283699=_0x4e5efe[_0xbd64('0x47')][_0xbd64('0x48')]({'plain':!![]});if(!_0x283699)throw new Error(_0xbd64('0x49'));if(_0x283699['role']==='user'){var _0x1e008f=_0x5a6b5e[_0xbd64('0x48')]({'plain':!![]});var _0x3b7d4a=_0xbd64('0x22');return db[_0xbd64('0x4a')][_0xbd64('0x44')]({'where':{'name':_0x3b7d4a,'userProfileId':_0x283699[_0xbd64('0x4b')]},'raw':!![]})[_0xbd64('0x20')](function(_0x460158){if(_0x460158&&_0x460158[_0xbd64('0x4c')]===0x0){return db[_0xbd64('0x4d')][_0xbd64('0x45')]({'name':_0x1e008f[_0xbd64('0x2c')],'resourceId':_0x1e008f['id'],'type':_0x460158[_0xbd64('0x2c')],'sectionId':_0x460158['id']},{})[_0xbd64('0x20')](function(){return _0x5a6b5e;});}else{return _0x5a6b5e;}})['catch'](function(_0x245685){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x245685);throw _0x245685;});}return _0x5a6b5e;})['then'](respondWithResult(_0x105bee,0xc9))['catch'](handleError(_0x105bee,null));};exports[_0xbd64('0x4e')]=function(_0x2f56df,_0x5480f5){var _0x31c0e4={'where':{'id':_0x2f56df[_0xbd64('0x3e')]['id']}},_0x1b0a0b={};_0x1b0a0b['model']=_[_0xbd64('0x3f')](db[_0xbd64('0x26')][_0xbd64('0x27')]);_0x31c0e4[_0xbd64('0x30')]=_[_0xbd64('0x2e')](_0x1b0a0b[_0xbd64('0x2b')],qs['fields'](_0x2f56df['query']['fields']));_0x31c0e4[_0xbd64('0x30')]=_0x31c0e4[_0xbd64('0x30')][_0xbd64('0x31')]?_0x31c0e4[_0xbd64('0x30')]:_0x1b0a0b['model'];if(_0x2f56df[_0xbd64('0x2d')][_0xbd64('0x40')]){_0x31c0e4[_0xbd64('0x41')]=[{'all':!![]}];}_0x31c0e4=_[_0xbd64('0x42')]({},_0x31c0e4,_0x2f56df[_0xbd64('0x43')]);return db[_0xbd64('0x26')]['find'](_0x31c0e4)[_0xbd64('0x20')](handleEntityNotFound(_0x5480f5,null))[_0xbd64('0x20')](function(_0x15f1fc){if(_0x15f1fc){var _0x1fe3e5=_0x15f1fc[_0xbd64('0x48')]({'plain':!![]});_0x1fe3e5=qs[_0xbd64('0x4f')](_0x1fe3e5,['id',_0xbd64('0x50'),_0xbd64('0x51')]);_0x2f56df[_0xbd64('0x46')]=_[_0xbd64('0x4f')](_0x2f56df[_0xbd64('0x46')],['id',_0xbd64('0x50'),'updatedAt']);return db['Campaign'][_0xbd64('0x45')](_[_0xbd64('0x42')](_0x1fe3e5,_0x2f56df['body']),{'include':_0x2f56df['query'][_0xbd64('0x40')]?[{'all':!![]}]:undefined})[_0xbd64('0x20')](function(_0x49051a){var _0x6facf3=_0x2f56df[_0xbd64('0x47')][_0xbd64('0x48')]({'plain':!![]});if(!_0x6facf3)throw new Error(_0xbd64('0x49'));if(_0x6facf3[_0xbd64('0x52')]===_0xbd64('0x47')){var _0x2d788=_0x49051a[_0xbd64('0x48')]({'plain':!![]});var _0x3174ec='IvrCampaigns';return db[_0xbd64('0x4a')][_0xbd64('0x44')]({'where':{'name':_0x3174ec,'userProfileId':_0x6facf3[_0xbd64('0x4b')]},'raw':!![]})['then'](function(_0x8ec428){if(_0x8ec428&&_0x8ec428[_0xbd64('0x4c')]===0x0){return db['UserProfileResource'][_0xbd64('0x45')]({'name':_0x2d788[_0xbd64('0x2c')],'resourceId':_0x2d788['id'],'type':_0x8ec428[_0xbd64('0x2c')],'sectionId':_0x8ec428['id']},{})[_0xbd64('0x20')](function(){return _0x49051a;});}else{return _0x49051a;}})[_0xbd64('0x3c')](function(_0x1594e9){logger['error'](_0xbd64('0x53'),_0x1594e9);throw _0x1594e9;});}return _0x49051a;});}})[_0xbd64('0x20')](respondWithResult(_0x5480f5,0xc9))[_0xbd64('0x3c')](handleError(_0x5480f5,null));};exports[_0xbd64('0x1f')]=function(_0x4c8882,_0xff862e){if(_0x4c8882[_0xbd64('0x46')]['id']){delete _0x4c8882['body']['id'];}return db[_0xbd64('0x26')]['find']({'where':{'id':_0x4c8882[_0xbd64('0x3e')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0xff862e,null))[_0xbd64('0x20')](saveUpdates(_0x4c8882[_0xbd64('0x46')],null))['then'](respondWithResult(_0xff862e,null))[_0xbd64('0x3c')](handleError(_0xff862e,null));};exports[_0xbd64('0x21')]=function(_0x30bdef,_0x23925c){return db[_0xbd64('0x26')][_0xbd64('0x44')]({'where':{'id':_0x30bdef['params']['id']}})['then'](handleEntityNotFound(_0x23925c,null))['then'](removeEntity(_0x23925c,null))[_0xbd64('0x3c')](handleError(_0x23925c,null));};exports[_0xbd64('0x54')]=function(_0x182dcd,_0x41d397,_0x1a8e6f){var _0x140632={'raw':!![],'where':{}};var _0x53b6f4={};var _0x30eddc={'count':0x0,'rows':[]};return db[_0xbd64('0x26')][_0xbd64('0x55')]({'where':{'id':_0x182dcd[_0xbd64('0x3e')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x41d397,null))[_0xbd64('0x20')](function(_0x2f3516){if(_0x2f3516){_0x53b6f4[_0xbd64('0x2b')]=_[_0xbd64('0x3f')](db[_0xbd64('0x56')][_0xbd64('0x27')]);_0x53b6f4[_0xbd64('0x2d')]=_['keys'](_0x182dcd['query']);_0x53b6f4[_0xbd64('0x37')]=_[_0xbd64('0x2e')](_0x53b6f4[_0xbd64('0x2b')],_0x53b6f4['query']);_0x140632[_0xbd64('0x30')]=_['intersection'](_0x53b6f4[_0xbd64('0x2b')],qs[_0xbd64('0x2f')](_0x182dcd[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x140632['attributes']=_0x140632[_0xbd64('0x30')]['length']?_0x140632[_0xbd64('0x30')]:_0x53b6f4[_0xbd64('0x2b')];if(!_0x182dcd[_0xbd64('0x2d')][_0xbd64('0x32')](_0xbd64('0x33'))){_0x140632['limit']=qs[_0xbd64('0x1a')](_0x182dcd[_0xbd64('0x2d')]['limit']);_0x140632[_0xbd64('0x19')]=qs[_0xbd64('0x19')](_0x182dcd[_0xbd64('0x2d')][_0xbd64('0x19')]);}_0x140632['order']=qs[_0xbd64('0x35')](_0x182dcd['query'][_0xbd64('0x35')]);_0x140632[_0xbd64('0x36')]=qs[_0xbd64('0x37')](_['pick'](_0x182dcd['query'],_0x53b6f4['filters']));_0x140632['where'][_0xbd64('0x57')]=_0x2f3516['id'];if(_0x182dcd[_0xbd64('0x2d')][_0xbd64('0x39')]){_0x140632[_0xbd64('0x36')]=_[_0xbd64('0x42')](_0x140632['where'],{'$or':_[_0xbd64('0x25')](_0x140632[_0xbd64('0x30')],function(_0xac13e6){var _0x186946={};_0x186946[_0xac13e6]={'$like':'%'+_0x182dcd[_0xbd64('0x2d')]['filter']+'%'};return _0x186946;})});}_0x140632=_[_0xbd64('0x42')]({},_0x140632,_0x182dcd[_0xbd64('0x43')]);return db[_0xbd64('0x56')][_0xbd64('0x3a')]({'where':_0x140632['where']})['then'](function(_0x73971b){_0x30eddc[_0xbd64('0x3a')]=_0x73971b;if(_0x182dcd[_0xbd64('0x2d')][_0xbd64('0x40')]){_0x140632[_0xbd64('0x41')]=[{'all':!![]}];}return db[_0xbd64('0x56')][_0xbd64('0x58')](_0x140632);})[_0xbd64('0x20')](function(_0x499831){_0x30eddc[_0xbd64('0x3b')]=_0x499831;return _0x30eddc;});}})['then'](respondWithFilteredResult(_0x41d397,_0x140632))[_0xbd64('0x3c')](handleError(_0x41d397,null));};exports[_0xbd64('0x59')]=function(_0x1aca4d,_0x4994c9,_0x15b625){var _0x5c30f9={'raw':!![],'where':{}};var _0x5c3efa={};var _0x3da482={'count':0x0,'rows':[]};return db[_0xbd64('0x26')][_0xbd64('0x55')]({'where':{'id':_0x1aca4d['params']['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x4994c9,null))[_0xbd64('0x20')](function(_0x8150bb){if(_0x8150bb){_0x5c3efa[_0xbd64('0x2b')]=_['keys'](db[_0xbd64('0x5a')][_0xbd64('0x27')]);_0x5c3efa[_0xbd64('0x2d')]=_[_0xbd64('0x3f')](_0x1aca4d[_0xbd64('0x2d')]);_0x5c3efa[_0xbd64('0x37')]=_[_0xbd64('0x2e')](_0x5c3efa[_0xbd64('0x2b')],_0x5c3efa[_0xbd64('0x2d')]);_0x5c30f9[_0xbd64('0x30')]=_[_0xbd64('0x2e')](_0x5c3efa[_0xbd64('0x2b')],qs[_0xbd64('0x2f')](_0x1aca4d[_0xbd64('0x2d')]['fields']));_0x5c30f9['attributes']=_0x5c30f9[_0xbd64('0x30')][_0xbd64('0x31')]?_0x5c30f9[_0xbd64('0x30')]:_0x5c3efa['model'];if(!_0x1aca4d[_0xbd64('0x2d')]['hasOwnProperty'](_0xbd64('0x33'))){_0x5c30f9[_0xbd64('0x1a')]=qs[_0xbd64('0x1a')](_0x1aca4d[_0xbd64('0x2d')]['limit']);_0x5c30f9[_0xbd64('0x19')]=qs[_0xbd64('0x19')](_0x1aca4d['query'][_0xbd64('0x19')]);}_0x5c30f9['order']=qs[_0xbd64('0x35')](_0x1aca4d[_0xbd64('0x2d')][_0xbd64('0x35')]);_0x5c30f9[_0xbd64('0x36')]=qs[_0xbd64('0x37')](_[_0xbd64('0x38')](_0x1aca4d['query'],_0x5c3efa[_0xbd64('0x37')]));_0x5c30f9['where'][_0xbd64('0x57')]=_0x8150bb['id'];if(_0x1aca4d[_0xbd64('0x2d')]['filter']){_0x5c30f9[_0xbd64('0x36')]=_['merge'](_0x5c30f9[_0xbd64('0x36')],{'$or':_[_0xbd64('0x25')](_0x5c30f9[_0xbd64('0x30')],function(_0x4bf21a){var _0x219f6a={};_0x219f6a[_0x4bf21a]={'$like':'%'+_0x1aca4d[_0xbd64('0x2d')][_0xbd64('0x39')]+'%'};return _0x219f6a;})});}_0x5c30f9=_[_0xbd64('0x42')]({},_0x5c30f9,_0x1aca4d[_0xbd64('0x43')]);return db['CmHopperHistory']['count']({'where':_0x5c30f9[_0xbd64('0x36')]})[_0xbd64('0x20')](function(_0xeb9c51){_0x3da482[_0xbd64('0x3a')]=_0xeb9c51;if(_0x1aca4d[_0xbd64('0x2d')][_0xbd64('0x40')]){_0x5c30f9[_0xbd64('0x41')]=[{'all':!![]}];}return db[_0xbd64('0x5a')][_0xbd64('0x58')](_0x5c30f9);})[_0xbd64('0x20')](function(_0x1474bf){_0x3da482[_0xbd64('0x3b')]=_0x1474bf;return _0x3da482;});}})[_0xbd64('0x20')](respondWithFilteredResult(_0x4994c9,_0x5c30f9))['catch'](handleError(_0x4994c9,null));};exports[_0xbd64('0x5b')]=function(_0x2655ed,_0x4e14c8,_0x3a375c){var _0x1dcc5f={'raw':!![],'where':{}};var _0x2e4f78={};var _0x3e837d={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x2655ed[_0xbd64('0x3e')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x4e14c8,null))[_0xbd64('0x20')](function(_0x2af19c){if(_0x2af19c){_0x2e4f78[_0xbd64('0x2b')]=_[_0xbd64('0x3f')](db[_0xbd64('0x5c')][_0xbd64('0x27')]);_0x2e4f78[_0xbd64('0x2d')]=_[_0xbd64('0x3f')](_0x2655ed[_0xbd64('0x2d')]);_0x2e4f78[_0xbd64('0x37')]=_['intersection'](_0x2e4f78[_0xbd64('0x2b')],_0x2e4f78[_0xbd64('0x2d')]);_0x1dcc5f[_0xbd64('0x30')]=_['intersection'](_0x2e4f78['model'],qs[_0xbd64('0x2f')](_0x2655ed[_0xbd64('0x2d')]['fields']));_0x1dcc5f[_0xbd64('0x30')]=_0x1dcc5f[_0xbd64('0x30')][_0xbd64('0x31')]?_0x1dcc5f[_0xbd64('0x30')]:_0x2e4f78[_0xbd64('0x2b')];if(!_0x2655ed[_0xbd64('0x2d')][_0xbd64('0x32')](_0xbd64('0x33'))){_0x1dcc5f[_0xbd64('0x1a')]=qs[_0xbd64('0x1a')](_0x2655ed[_0xbd64('0x2d')][_0xbd64('0x1a')]);_0x1dcc5f['offset']=qs[_0xbd64('0x19')](_0x2655ed['query'][_0xbd64('0x19')]);}_0x1dcc5f[_0xbd64('0x34')]=qs[_0xbd64('0x35')](_0x2655ed[_0xbd64('0x2d')][_0xbd64('0x35')]);_0x1dcc5f['where']=qs[_0xbd64('0x37')](_[_0xbd64('0x38')](_0x2655ed[_0xbd64('0x2d')],_0x2e4f78[_0xbd64('0x37')]));_0x1dcc5f['where'][_0xbd64('0x57')]=_0x2af19c['id'];if(_0x2655ed['query'][_0xbd64('0x39')]){_0x1dcc5f[_0xbd64('0x36')]=_[_0xbd64('0x42')](_0x1dcc5f[_0xbd64('0x36')],{'$or':_[_0xbd64('0x25')](_0x1dcc5f[_0xbd64('0x30')],function(_0x42a94b){var _0x5263cf={};_0x5263cf[_0x42a94b]={'$like':'%'+_0x2655ed[_0xbd64('0x2d')][_0xbd64('0x39')]+'%'};return _0x5263cf;})});}_0x1dcc5f=_[_0xbd64('0x42')]({},_0x1dcc5f,_0x2655ed[_0xbd64('0x43')]);return db['CmHopperFinal'][_0xbd64('0x3a')]({'where':_0x1dcc5f[_0xbd64('0x36')]})[_0xbd64('0x20')](function(_0x19a780){_0x3e837d[_0xbd64('0x3a')]=_0x19a780;if(_0x2655ed[_0xbd64('0x2d')][_0xbd64('0x40')]){_0x1dcc5f['include']=[{'all':!![]}];}return db[_0xbd64('0x5c')]['findAll'](_0x1dcc5f);})[_0xbd64('0x20')](function(_0x59cc30){_0x3e837d['rows']=_0x59cc30;return _0x3e837d;});}})[_0xbd64('0x20')](respondWithFilteredResult(_0x4e14c8,_0x1dcc5f))[_0xbd64('0x3c')](handleError(_0x4e14c8,null));};exports[_0xbd64('0x5d')]=function(_0x544ab5,_0x3773e8,_0x49d6fe){var _0x11fdd8={'raw':!![],'where':{}};var _0x48a1b1={};var _0x5944d7={'count':0x0,'rows':[]};return db[_0xbd64('0x26')][_0xbd64('0x55')]({'where':{'id':_0x544ab5[_0xbd64('0x3e')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x3773e8,null))[_0xbd64('0x20')](function(_0x2e67e9){if(_0x2e67e9){_0x48a1b1[_0xbd64('0x2b')]=_[_0xbd64('0x3f')](db['CmHopperBlack']['rawAttributes']);_0x48a1b1[_0xbd64('0x2d')]=_['keys'](_0x544ab5[_0xbd64('0x2d')]);_0x48a1b1[_0xbd64('0x37')]=_[_0xbd64('0x2e')](_0x48a1b1['model'],_0x48a1b1[_0xbd64('0x2d')]);_0x11fdd8[_0xbd64('0x30')]=_['intersection'](_0x48a1b1[_0xbd64('0x2b')],qs[_0xbd64('0x2f')](_0x544ab5['query']['fields']));_0x11fdd8[_0xbd64('0x30')]=_0x11fdd8[_0xbd64('0x30')][_0xbd64('0x31')]?_0x11fdd8[_0xbd64('0x30')]:_0x48a1b1[_0xbd64('0x2b')];if(!_0x544ab5[_0xbd64('0x2d')][_0xbd64('0x32')](_0xbd64('0x33'))){_0x11fdd8[_0xbd64('0x1a')]=qs[_0xbd64('0x1a')](_0x544ab5[_0xbd64('0x2d')][_0xbd64('0x1a')]);_0x11fdd8[_0xbd64('0x19')]=qs[_0xbd64('0x19')](_0x544ab5[_0xbd64('0x2d')]['offset']);}_0x11fdd8[_0xbd64('0x34')]=qs['sort'](_0x544ab5[_0xbd64('0x2d')][_0xbd64('0x35')]);_0x11fdd8['where']=qs[_0xbd64('0x37')](_['pick'](_0x544ab5[_0xbd64('0x2d')],_0x48a1b1[_0xbd64('0x37')]));_0x11fdd8[_0xbd64('0x36')][_0xbd64('0x57')]=_0x2e67e9['id'];if(_0x544ab5['query'][_0xbd64('0x39')]){_0x11fdd8[_0xbd64('0x36')]=_[_0xbd64('0x42')](_0x11fdd8[_0xbd64('0x36')],{'$or':_['map'](_0x11fdd8['attributes'],function(_0xa1c281){var _0x8623c3={};_0x8623c3[_0xa1c281]={'$like':'%'+_0x544ab5[_0xbd64('0x2d')]['filter']+'%'};return _0x8623c3;})});}_0x11fdd8=_[_0xbd64('0x42')]({},_0x11fdd8,_0x544ab5['options']);return db[_0xbd64('0x5e')][_0xbd64('0x3a')]({'where':_0x11fdd8[_0xbd64('0x36')]})[_0xbd64('0x20')](function(_0x37ca27){_0x5944d7['count']=_0x37ca27;if(_0x544ab5['query'][_0xbd64('0x40')]){_0x11fdd8[_0xbd64('0x41')]=[{'all':!![]}];}return db[_0xbd64('0x5e')]['findAll'](_0x11fdd8);})[_0xbd64('0x20')](function(_0x4e1359){_0x5944d7[_0xbd64('0x3b')]=_0x4e1359;return _0x5944d7;});}})[_0xbd64('0x20')](respondWithFilteredResult(_0x3773e8,_0x11fdd8))[_0xbd64('0x3c')](handleError(_0x3773e8,null));};exports['getLists']=function(_0x370b83,_0xb40b73,_0x496475){var _0x4d5ad0={};var _0x13be0b={};var _0x4dd76f;var _0x4d1a95;return db[_0xbd64('0x26')][_0xbd64('0x55')]({'where':{'id':_0x370b83['params']['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0xb40b73,null))['then'](function(_0x4011c5){if(_0x4011c5){_0x4dd76f=_0x4011c5;_0x13be0b[_0xbd64('0x2b')]=_[_0xbd64('0x3f')](db['CmList'][_0xbd64('0x27')]);_0x13be0b['query']=_['keys'](_0x370b83['query']);_0x13be0b[_0xbd64('0x37')]=_[_0xbd64('0x2e')](_0x13be0b[_0xbd64('0x2b')],_0x13be0b['query']);_0x4d5ad0[_0xbd64('0x30')]=_['intersection'](_0x13be0b[_0xbd64('0x2b')],qs['fields'](_0x370b83['query']['fields']));_0x4d5ad0[_0xbd64('0x30')]=_0x4d5ad0[_0xbd64('0x30')][_0xbd64('0x31')]?_0x4d5ad0[_0xbd64('0x30')]:_0x13be0b['model'];_0x4d5ad0[_0xbd64('0x34')]=qs[_0xbd64('0x35')](_0x370b83[_0xbd64('0x2d')]['sort']);_0x4d5ad0[_0xbd64('0x36')]=qs['filters'](_[_0xbd64('0x38')](_0x370b83[_0xbd64('0x2d')],_0x13be0b[_0xbd64('0x37')]));if(_0x370b83[_0xbd64('0x2d')][_0xbd64('0x39')]){_0x4d5ad0[_0xbd64('0x36')]=_[_0xbd64('0x42')](_0x4d5ad0[_0xbd64('0x36')],{'$or':_[_0xbd64('0x25')](_0x4d5ad0[_0xbd64('0x30')],function(_0x251f0b){var _0x17f82d={};_0x17f82d[_0x251f0b]={'$like':'%'+_0x370b83[_0xbd64('0x2d')]['filter']+'%'};return _0x17f82d;})});}_0x4d5ad0=_['merge']({},_0x4d5ad0,_0x370b83[_0xbd64('0x43')]);return _0x4dd76f[_0xbd64('0x5f')](_0x4d5ad0);}})[_0xbd64('0x20')](function(_0x3275d4){if(_0x3275d4){_0x4d1a95=_0x3275d4['length'];if(!_0x370b83[_0xbd64('0x2d')]['hasOwnProperty'](_0xbd64('0x33'))){_0x4d5ad0['limit']=qs['limit'](_0x370b83[_0xbd64('0x2d')][_0xbd64('0x1a')]);_0x4d5ad0['offset']=qs[_0xbd64('0x19')](_0x370b83['query'][_0xbd64('0x19')]);}return _0x4dd76f['getLists'](_0x4d5ad0);}})[_0xbd64('0x20')](function(_0x1a03df){if(_0x1a03df){return _0x1a03df?{'count':_0x4d1a95,'rows':_0x1a03df}:null;}})[_0xbd64('0x20')](respondWithResult(_0xb40b73,null))['catch'](handleError(_0xb40b73,null));};exports[_0xbd64('0x60')]=function(_0x287a9a,_0x314899,_0x3fac1a){var _0x21a8e6,_0x17415d;return db[_0xbd64('0x26')]['find']({'where':{'id':_0x287a9a[_0xbd64('0x3e')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x314899,null))['then'](function(_0x497b8e){if(_0x497b8e){_0x17415d=_0x497b8e;return _0x497b8e['addLists'](_0x287a9a[_0xbd64('0x46')][_0xbd64('0x61')],_[_0xbd64('0x4f')](_0x287a9a['body'],[_0xbd64('0x61'),'id'])||{});}return null;})['spread'](function(_0x1e7182){var _0x507ddc;_0x21a8e6=_0x1e7182||[];var _0x2678bb=[];if(_0x1e7182){for(var _0x133cb4=0x0;_0x133cb4<_0x1e7182[_0xbd64('0x31')];_0x133cb4+=0x1){var _0x114599=_0x1e7182[_0x133cb4][_0xbd64('0x48')]({'plain':!![]});_0x17415d[_0xbd64('0x62')]=_0x287a9a[_0xbd64('0x46')][_0xbd64('0x62')]?_0x287a9a[_0xbd64('0x46')][_0xbd64('0x62')]:_0x17415d[_0xbd64('0x62')];switch(_0x17415d['dialCheckDuplicateType']){case _0xbd64('0x63'):_0x507ddc=squel[_0xbd64('0x64')]()[_0xbd64('0x65')](_0xbd64('0x66'))[_0xbd64('0x67')]([_0xbd64('0x68'),_0xbd64('0x69'),_0xbd64('0x6a'),_0xbd64('0x6b'),'CampaignId','createdAt',_0xbd64('0x51')],squel[_0xbd64('0x6c')]()['field'](_0xbd64('0x68'),_0xbd64('0x68'))['field'](_0xbd64('0x6d'),'scheduledAt')[_0xbd64('0x6e')]('id',_0xbd64('0x6a'))[_0xbd64('0x6e')](_0x114599[_0xbd64('0x6f')][_0xbd64('0x70')](),'ListId')['field'](_0x287a9a['params']['id']['toString'](),_0xbd64('0x57'))['field'](_0xbd64('0x6d'),'createdAt')['field'](_0xbd64('0x6d'),_0xbd64('0x51'))[_0xbd64('0x71')](_0xbd64('0x72'))[_0xbd64('0x36')](_0xbd64('0x73'))[_0xbd64('0x36')](_0xbd64('0x74'),_0x114599[_0xbd64('0x6f')][_0xbd64('0x70')]())[_0xbd64('0x36')](_0xbd64('0x75'))['where'](_0xbd64('0x76'),squel[_0xbd64('0x6c')]()[_0xbd64('0x6e')](_0xbd64('0x77'))[_0xbd64('0x71')](_0xbd64('0x78'))['where'](_0xbd64('0x79'),_0x287a9a[_0xbd64('0x3e')]['id'][_0xbd64('0x70')]()))[_0xbd64('0x36')]('phone\x20NOT\x20IN\x20(?)',squel[_0xbd64('0x6c')]()[_0xbd64('0x6e')](_0xbd64('0x7a'))[_0xbd64('0x71')]('cm_hopper')[_0xbd64('0x36')]('CampaignId\x20=\x20?',_0x287a9a['params']['id']['toString']())))[_0xbd64('0x70')]();break;case _0xbd64('0x7b'):_0x507ddc=squel['insert']()['into'](_0xbd64('0x66'))[_0xbd64('0x67')]([_0xbd64('0x68'),_0xbd64('0x69'),'ContactId','ListId',_0xbd64('0x57'),'createdAt',_0xbd64('0x51')],squel['select']()[_0xbd64('0x6e')](_0xbd64('0x68'),_0xbd64('0x68'))[_0xbd64('0x6e')]('NOW()',_0xbd64('0x69'))[_0xbd64('0x6e')]('id',_0xbd64('0x6a'))[_0xbd64('0x6e')](_0x114599['CmListId'][_0xbd64('0x70')](),_0xbd64('0x6b'))[_0xbd64('0x6e')](_0x287a9a[_0xbd64('0x3e')]['id'][_0xbd64('0x70')](),_0xbd64('0x57'))[_0xbd64('0x6e')](_0xbd64('0x6d'),_0xbd64('0x50'))['field']('NOW()',_0xbd64('0x51'))['from'](_0xbd64('0x72'))[_0xbd64('0x36')](_0xbd64('0x73'))['where']('ListId\x20=\x20?',_0x114599[_0xbd64('0x6f')][_0xbd64('0x70')]())[_0xbd64('0x36')](_0xbd64('0x75'))[_0xbd64('0x36')](_0xbd64('0x76'),squel[_0xbd64('0x6c')]()[_0xbd64('0x6e')](_0xbd64('0x7a'))['from']('cm_hopper')[_0xbd64('0x36')](_0xbd64('0x79'),_0x287a9a[_0xbd64('0x3e')]['id'][_0xbd64('0x70')]())))['toString']();break;default:_0x507ddc=squel[_0xbd64('0x64')]()['into'](_0xbd64('0x66'))['fromQuery']([_0xbd64('0x68'),'scheduledAt',_0xbd64('0x6a'),_0xbd64('0x6b'),_0xbd64('0x57'),_0xbd64('0x50'),_0xbd64('0x51')],squel[_0xbd64('0x6c')]()['field'](_0xbd64('0x68'),'phone')[_0xbd64('0x6e')]('NOW()','scheduledAt')[_0xbd64('0x6e')]('id',_0xbd64('0x6a'))[_0xbd64('0x6e')](_0x114599['CmListId'][_0xbd64('0x70')](),_0xbd64('0x6b'))[_0xbd64('0x6e')](_0x287a9a[_0xbd64('0x3e')]['id'][_0xbd64('0x70')](),'CampaignId')[_0xbd64('0x6e')]('NOW()','createdAt')[_0xbd64('0x6e')](_0xbd64('0x6d'),_0xbd64('0x51'))[_0xbd64('0x71')](_0xbd64('0x72'))[_0xbd64('0x36')](_0xbd64('0x73'))[_0xbd64('0x36')](_0xbd64('0x74'),_0x114599[_0xbd64('0x6f')][_0xbd64('0x70')]())['where'](_0xbd64('0x75')))[_0xbd64('0x70')]();}_0x2678bb[_0xbd64('0x7c')](db[_0xbd64('0x7d')]['query'](_0x507ddc));}return BPromise[_0xbd64('0x7e')](_0x2678bb);}})[_0xbd64('0x20')](function(){return _0x21a8e6;})['then'](respondWithResult(_0x314899,null))['catch'](handleError(_0x314899,null));};exports[_0xbd64('0x7f')]=function(_0x19ccdb,_0x14f015,_0x26d208){return db[_0xbd64('0x26')][_0xbd64('0x44')]({'where':{'id':_0x19ccdb['params']['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x14f015,null))[_0xbd64('0x20')](function(_0x3356f5){if(_0x3356f5){return _0x3356f5[_0xbd64('0x7f')](_0x19ccdb['query'][_0xbd64('0x61')]);}})['then'](function(_0x1afe04){if(_0x1afe04){return db[_0xbd64('0x56')][_0xbd64('0x21')]({'where':{'ListId':_0x19ccdb[_0xbd64('0x2d')]['ids'],'CampaignId':_0x19ccdb[_0xbd64('0x3e')]['id']}})['then'](function(){return _0x1afe04;});}})[_0xbd64('0x20')](respondWithStatusCode(_0x14f015,null))['catch'](handleError(_0x14f015,null));};exports[_0xbd64('0x80')]=function(_0x5071fc,_0x130ea4,_0x3760ec){var _0x4e7d2a={'raw':!![],'where':{}};var _0x1b775c={};var _0x4238ae={'count':0x0,'rows':[]};return db['Campaign'][_0xbd64('0x55')]({'where':{'id':_0x5071fc[_0xbd64('0x3e')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x130ea4,null))['then'](function(_0x3fe214){if(_0x3fe214){_0x1b775c[_0xbd64('0x2b')]=_[_0xbd64('0x3f')](db['CmList'][_0xbd64('0x27')]);_0x1b775c[_0xbd64('0x2d')]=_['keys'](_0x5071fc['query']);_0x1b775c[_0xbd64('0x37')]=_['intersection'](_0x1b775c['model'],_0x1b775c[_0xbd64('0x2d')]);_0x4e7d2a[_0xbd64('0x30')]=_[_0xbd64('0x2e')](_0x1b775c['model'],qs[_0xbd64('0x2f')](_0x5071fc['query'][_0xbd64('0x2f')]));_0x4e7d2a['attributes']=_0x4e7d2a[_0xbd64('0x30')][_0xbd64('0x31')]?_0x4e7d2a['attributes']:_0x1b775c[_0xbd64('0x2b')];if(!_0x5071fc[_0xbd64('0x2d')][_0xbd64('0x32')](_0xbd64('0x33'))){_0x4e7d2a[_0xbd64('0x1a')]=qs[_0xbd64('0x1a')](_0x5071fc['query'][_0xbd64('0x1a')]);_0x4e7d2a[_0xbd64('0x19')]=qs[_0xbd64('0x19')](_0x5071fc[_0xbd64('0x2d')][_0xbd64('0x19')]);}_0x4e7d2a[_0xbd64('0x34')]=qs['sort'](_0x5071fc['query'][_0xbd64('0x35')]);_0x4e7d2a[_0xbd64('0x36')]=qs[_0xbd64('0x37')](_['pick'](_0x5071fc[_0xbd64('0x2d')],_0x1b775c[_0xbd64('0x37')]));_0x4e7d2a[_0xbd64('0x36')][_0xbd64('0x57')]=_0x3fe214['id'];if(_0x5071fc[_0xbd64('0x2d')][_0xbd64('0x39')]){_0x4e7d2a[_0xbd64('0x36')]=_['merge'](_0x4e7d2a[_0xbd64('0x36')],{'$or':_[_0xbd64('0x25')](_0x4e7d2a[_0xbd64('0x30')],function(_0x35137e){var _0x5e8914={};_0x5e8914[_0x35137e]={'$like':'%'+_0x5071fc['query']['filter']+'%'};return _0x5e8914;})});}_0x4e7d2a=_[_0xbd64('0x42')]({},_0x4e7d2a,_0x5071fc['options']);return db[_0xbd64('0x81')][_0xbd64('0x3a')]({'where':_0x4e7d2a[_0xbd64('0x36')]})['then'](function(_0x14a684){_0x4238ae[_0xbd64('0x3a')]=_0x14a684;if(_0x5071fc[_0xbd64('0x2d')][_0xbd64('0x40')]){_0x4e7d2a[_0xbd64('0x41')]=[{'all':!![]}];}return db[_0xbd64('0x81')][_0xbd64('0x58')](_0x4e7d2a);})[_0xbd64('0x20')](function(_0x2d98e1){_0x4238ae[_0xbd64('0x3b')]=_0x2d98e1;return _0x4238ae;});}})[_0xbd64('0x20')](respondWithFilteredResult(_0x130ea4,_0x4e7d2a))[_0xbd64('0x3c')](handleError(_0x130ea4,null));};exports[_0xbd64('0x82')]=function(_0x58564d,_0x233441,_0x500480){var _0x352162,_0x400779;return db[_0xbd64('0x26')][_0xbd64('0x44')]({'where':{'id':_0x58564d[_0xbd64('0x3e')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x233441,null))['then'](function(_0x5dc75a){if(_0x5dc75a){_0x400779=_0x5dc75a;return _0x5dc75a['addBlackLists'](_0x58564d['body'][_0xbd64('0x61')],_[_0xbd64('0x4f')](_0x58564d[_0xbd64('0x46')],[_0xbd64('0x61'),'id'])||{});}return null;})[_0xbd64('0x83')](function(_0x35d11f){var _0x46b0dd;_0x352162=_0x35d11f||[];var _0x1b0095=[];if(_0x35d11f){for(var _0x50abe1=0x0;_0x50abe1<_0x35d11f[_0xbd64('0x31')];_0x50abe1+=0x1){var _0xca8e3d=_0x35d11f[_0x50abe1]['get']({'plain':!![]});_0x46b0dd=squel[_0xbd64('0x64')]()[_0xbd64('0x65')](_0xbd64('0x84'))[_0xbd64('0x67')]([_0xbd64('0x68'),_0xbd64('0x6a'),_0xbd64('0x6b'),_0xbd64('0x57'),_0xbd64('0x50'),_0xbd64('0x51')],squel[_0xbd64('0x6c')]()['field'](_0xbd64('0x68'),_0xbd64('0x68'))[_0xbd64('0x6e')]('id','ContactId')[_0xbd64('0x6e')](_0xca8e3d['CmListId'][_0xbd64('0x70')](),_0xbd64('0x6b'))[_0xbd64('0x6e')](_0x58564d['params']['id']['toString'](),_0xbd64('0x57'))[_0xbd64('0x6e')]('NOW()',_0xbd64('0x50'))['field'](_0xbd64('0x6d'),_0xbd64('0x51'))[_0xbd64('0x71')](_0xbd64('0x72'))[_0xbd64('0x36')](_0xbd64('0x73'))[_0xbd64('0x36')](_0xbd64('0x74'),_0xca8e3d[_0xbd64('0x6f')][_0xbd64('0x70')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xbd64('0x70')]();_0x1b0095[_0xbd64('0x7c')](db['sequelize'][_0xbd64('0x2d')](_0x46b0dd));}return BPromise[_0xbd64('0x7e')](_0x1b0095);}})[_0xbd64('0x20')](function(){return _0x352162;})[_0xbd64('0x20')](respondWithResult(_0x233441,null))['catch'](handleError(_0x233441,null));};exports[_0xbd64('0x85')]=function(_0x2bbb99,_0x26d977,_0x4b9d94){return db['Campaign'][_0xbd64('0x44')]({'where':{'id':_0x2bbb99[_0xbd64('0x3e')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x26d977,null))['then'](function(_0x1d2990){if(_0x1d2990){return _0x1d2990['removeBlackLists'](_0x2bbb99[_0xbd64('0x2d')]['ids']);}})[_0xbd64('0x20')](function(_0x494fdb){if(_0x494fdb){return db[_0xbd64('0x5e')][_0xbd64('0x21')]({'where':{'ListId':_0x2bbb99[_0xbd64('0x2d')][_0xbd64('0x61')],'CampaignId':_0x2bbb99['params']['id']}})[_0xbd64('0x20')](function(){return _0x494fdb;});}})[_0xbd64('0x20')](respondWithStatusCode(_0x26d977,null))[_0xbd64('0x3c')](handleError(_0x26d977,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 4b9303a..eff80d0 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 _0xfe57=['exports','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2d9e0d,_0x171441){var _0x241da1=function(_0x3491d0){while(--_0x3491d0){_0x2d9e0d['push'](_0x2d9e0d['shift']());}};_0x241da1(++_0x171441);}(_0xfe57,0x191));var _0x7fe5=function(_0x506d83,_0x1899e9){_0x506d83=_0x506d83-0x0;var _0x335e8b=_0xfe57[_0x506d83];return _0x335e8b;};'use strict';var _=require(_0x7fe5('0x0'));var util=require('util');var logger=require(_0x7fe5('0x1'))(_0x7fe5('0x2'));var moment=require(_0x7fe5('0x3'));var BPromise=require(_0x7fe5('0x4'));var rp=require(_0x7fe5('0x5'));var fs=require('fs');var path=require(_0x7fe5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./campaign.attributes');module[_0x7fe5('0x7')]=function(_0x4ced14,_0x5c2ac0){return _0x4ced14['define']('Campaign',attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0417=['api','path','rimraf','./campaign.attributes','exports','define','Campaign','campaigns','lodash','../../config/logger'];(function(_0x67f95e,_0x3ca797){var _0x538f5a=function(_0xc919e9){while(--_0xc919e9){_0x67f95e['push'](_0x67f95e['shift']());}};_0x538f5a(++_0x3ca797);}(_0x0417,0x1e8));var _0x7041=function(_0x4b6923,_0x10e0c8){_0x4b6923=_0x4b6923-0x0;var _0x5d5603=_0x0417[_0x4b6923];return _0x5d5603;};'use strict';var _=require(_0x7041('0x0'));var util=require('util');var logger=require(_0x7041('0x1'))(_0x7041('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7041('0x3'));var rimraf=require(_0x7041('0x4'));var config=require('../../config/environment');var attributes=require(_0x7041('0x5'));module[_0x7041('0x6')]=function(_0x3e0b38,_0x17d9db){return _0x3e0b38[_0x7041('0x7')](_0x7041('0x8'),attributes,{'tableName':_0x7041('0x9'),'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 065777b..6455c45 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(_0x2f90ff,_0x4b9ee2){var _0x56b690=function(_0xf714){while(--_0xf714){_0x2f90ff['push'](_0x2f90ff['shift']());}};_0x56b690(++_0x4b9ee2);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 _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(_0x218697,_0xea54bf){var _0x29cac1=function(_0x51e3c8){while(--_0x51e3c8){_0x218697['push'](_0x218697['shift']());}};_0x29cac1(++_0xea54bf);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Campaign'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'limit':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')]['include']?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')][_0x7995('0x20')],function(_0x285437){return{'model':db[_0x285437[_0x7995('0x21')]],'as':_0x285437['as'],'attributes':_0x285437[_0x7995('0x1d')],'include':_0x285437[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x285437['include'],function(_0x39df42){return{'model':db[_0x39df42[_0x7995('0x21')]],'as':_0x39df42['as'],'attributes':_0x39df42[_0x7995('0x1d')],'include':_0x39df42[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x39df42[_0x7995('0x20')],function(_0x56691a){return{'model':db[_0x56691a[_0x7995('0x21')]],'as':_0x56691a['as'],'attributes':_0x56691a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0xc')](function(_0x49bc7e){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')]('GetCampaign',_0x291317,JSON[_0x7995('0x12')](_0x49bc7e));_0x37a7d4(_0x49bc7e);})['catch'](function(_0x456a28){logger[_0x7995('0x13')](_0x7995('0x18'),_0x456a28['message'],_0x291317);_0x4faa60(_0x1e1415['error'](0x1f4,_0x456a28['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index aaca0ad..71b2152 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 _0xb111=['getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories'];(function(_0x2e436b,_0x17c82d){var _0x382742=function(_0x3611b2){while(--_0x3611b2){_0x2e436b['push'](_0x2e436b['shift']());}};_0x382742(++_0x17c82d);}(_0xb111,0x189));var _0x1b11=function(_0x3911cc,_0x484843){_0x3911cc=_0x3911cc-0x0;var _0x2bc606=_0xb111[_0x3911cc];return _0x2bc606;};'use strict';var multer=require(_0x1b11('0x0'));var util=require(_0x1b11('0x1'));var path=require('path');var timeout=require(_0x1b11('0x2'));var express=require(_0x1b11('0x3'));var router=express[_0x1b11('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x1b11('0x5'));var config=require(_0x1b11('0x6'));var controller=require('./campaign.controller');router[_0x1b11('0x7')]('/',auth[_0x1b11('0x8')](),controller[_0x1b11('0x9')]);router['get'](_0x1b11('0xa'),auth[_0x1b11('0x8')](),controller[_0x1b11('0xb')]);router[_0x1b11('0x7')]('/:id/hoppers',auth[_0x1b11('0x8')](),controller[_0x1b11('0xc')]);router[_0x1b11('0x7')](_0x1b11('0xd'),auth[_0x1b11('0x8')](),controller[_0x1b11('0xe')]);router[_0x1b11('0x7')]('/:id/hopper_finals',auth[_0x1b11('0x8')](),controller[_0x1b11('0xf')]);router['get'](_0x1b11('0x10'),auth[_0x1b11('0x8')](),controller[_0x1b11('0x11')]);router[_0x1b11('0x7')](_0x1b11('0x12'),auth[_0x1b11('0x8')](),controller[_0x1b11('0x13')]);router[_0x1b11('0x7')](_0x1b11('0x14'),auth[_0x1b11('0x8')](),controller[_0x1b11('0x15')]);router[_0x1b11('0x16')]('/',auth['isAuthenticated'](),controller[_0x1b11('0x17')]);router[_0x1b11('0x16')](_0x1b11('0x18'),auth[_0x1b11('0x8')](),controller[_0x1b11('0x19')]);router[_0x1b11('0x16')](_0x1b11('0x12'),auth['isAuthenticated'](),controller['addLists']);router[_0x1b11('0x16')]('/:id/blacklists',auth[_0x1b11('0x8')](),controller[_0x1b11('0x1a')]);router[_0x1b11('0x1b')](_0x1b11('0xa'),auth[_0x1b11('0x8')](),controller[_0x1b11('0x1c')]);router[_0x1b11('0x1d')](_0x1b11('0xa'),auth[_0x1b11('0x8')](),controller[_0x1b11('0x1e')]);router[_0x1b11('0x1d')](_0x1b11('0x12'),auth[_0x1b11('0x8')](),controller[_0x1b11('0x1f')]);router[_0x1b11('0x1d')]('/:id/blacklists',auth[_0x1b11('0x8')](),controller[_0x1b11('0x20')]);module[_0x1b11('0x21')]=router; \ No newline at end of file +var _0x983e=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','clone','addLists','addBlackLists','update','delete','destroy','removeLists'];(function(_0x12ec23,_0x44ef36){var _0x5db01f=function(_0x13539f){while(--_0x13539f){_0x12ec23['push'](_0x12ec23['shift']());}};_0x5db01f(++_0x44ef36);}(_0x983e,0xc1));var _0xe983=function(_0xb0dc5e,_0x5c4c92){_0xb0dc5e=_0xb0dc5e-0x0;var _0x387b10=_0x983e[_0xb0dc5e];return _0x387b10;};'use strict';var multer=require('multer');var util=require(_0xe983('0x0'));var path=require(_0xe983('0x1'));var timeout=require(_0xe983('0x2'));var express=require('express');var router=express[_0xe983('0x3')]();var auth=require(_0xe983('0x4'));var interaction=require(_0xe983('0x5'));var config=require(_0xe983('0x6'));var controller=require(_0xe983('0x7'));router['get']('/',auth[_0xe983('0x8')](),controller[_0xe983('0x9')]);router[_0xe983('0xa')](_0xe983('0xb'),auth[_0xe983('0x8')](),controller[_0xe983('0xc')]);router[_0xe983('0xa')](_0xe983('0xd'),auth[_0xe983('0x8')](),controller[_0xe983('0xe')]);router[_0xe983('0xa')]('/:id/hopper_histories',auth[_0xe983('0x8')](),controller['getHopperHistories']);router[_0xe983('0xa')](_0xe983('0xf'),auth[_0xe983('0x8')](),controller[_0xe983('0x10')]);router[_0xe983('0xa')](_0xe983('0x11'),auth[_0xe983('0x8')](),controller[_0xe983('0x12')]);router['get'](_0xe983('0x13'),auth['isAuthenticated'](),controller[_0xe983('0x14')]);router[_0xe983('0xa')](_0xe983('0x15'),auth[_0xe983('0x8')](),controller[_0xe983('0x16')]);router[_0xe983('0x17')]('/',auth[_0xe983('0x8')](),controller['create']);router['post']('/:id/clone',auth[_0xe983('0x8')](),controller[_0xe983('0x18')]);router['post'](_0xe983('0x13'),auth[_0xe983('0x8')](),controller[_0xe983('0x19')]);router[_0xe983('0x17')](_0xe983('0x15'),auth['isAuthenticated'](),controller[_0xe983('0x1a')]);router['put'](_0xe983('0xb'),auth['isAuthenticated'](),controller[_0xe983('0x1b')]);router[_0xe983('0x1c')](_0xe983('0xb'),auth[_0xe983('0x8')](),controller[_0xe983('0x1d')]);router[_0xe983('0x1c')](_0xe983('0x13'),auth[_0xe983('0x8')](),controller[_0xe983('0x1e')]);router['delete'](_0xe983('0x15'),auth[_0xe983('0x8')](),controller['removeBlackLists']);module[_0xe983('0x1f')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index c60fb56..d235036 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 _0xcbfc=['getDataValue','sequelize','STRING','TEXT'];(function(_0x2a6387,_0x4c5702){var _0xfc7c54=function(_0x23ac08){while(--_0x23ac08){_0x2a6387['push'](_0x2a6387['shift']());}};_0xfc7c54(++_0x4c5702);}(_0xcbfc,0x1b9));var _0xccbf=function(_0x7be23c,_0x368608){_0x7be23c=_0x7be23c-0x0;var _0x46b4f5=_0xcbfc[_0x7be23c];return _0x46b4f5;};'use strict';var Sequelize=require(_0xccbf('0x0'));module['exports']={'key':{'type':Sequelize[_0xccbf('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xccbf('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xccbf('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xccbf('0x3')]('key');}}}; \ No newline at end of file +var _0xf8ec=['STRING','VIRTUAL','getDataValue','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf8ec,0x166));var _0xcf8e=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0xf8ec[_0x1f36bb];return _0xaf97fa;};'use strict';var Sequelize=require(_0xcf8e('0x0'));module[_0xcf8e('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xcf8e('0x2')]},'name':{'type':Sequelize[_0xcf8e('0x3')],'get':function(){return this[_0xcf8e('0x4')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 044a0b7..6fe0a31 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(_0x265dcd,_0x1e86f7){var _0x1eea2c=function(_0x1c33c5){while(--_0x1c33c5){_0x265dcd['push'](_0x265dcd['shift']());}};_0x1eea2c(++_0x1e86f7);}(_0x34e8,0x12c));var _0x834e=function(_0x1e664d,_0x4a538d){_0x1e664d=_0x1e664d-0x0;var _0x3bf48b=_0x34e8[_0x1e664d];return _0x3bf48b;};'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 _0xa9e0=['filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','name','send','index','map','CannedAnswer','rawAttributes','type','key','model','query','keys'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){var _0x38e7c4=_0x588269[_0x0a9e('0x21')]({'plain':!![]});var _0x4abc77=_0x0a9e('0x22');return db[_0x0a9e('0x23')][_0x0a9e('0x20')]({'where':{'type':_0x4abc77,'resourceId':_0x38e7c4['id']}})[_0x0a9e('0x1f')](function(){return _0x588269;});})[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x24')]();});}};}function handleEntityNotFound(_0x5ea472,_0x59181e){return function(_0x197ec0){if(!_0x197ec0){_0x5ea472[_0x0a9e('0x14')](0x194);}return _0x197ec0;};}function handleError(_0x40c424,_0x33161b){_0x33161b=_0x33161b||0x1f4;return function(_0x526cf3){logger[_0x0a9e('0x25')](_0x526cf3['stack']);if(_0x526cf3[_0x0a9e('0x26')]){delete _0x526cf3['name'];}_0x40c424[_0x0a9e('0x15')](_0x33161b)[_0x0a9e('0x27')](_0x526cf3);};}exports[_0x0a9e('0x28')]=function(_0x14433c,_0x140511){var _0x1538a4={},_0x11c3b6={},_0x14de77={'count':0x0,'rows':[]};var _0x5a101a=_[_0x0a9e('0x29')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')],function(_0x2ec755){return{'name':_0x2ec755['fieldName'],'type':_0x2ec755[_0x0a9e('0x2c')][_0x0a9e('0x2d')]};});_0x11c3b6[_0x0a9e('0x2e')]=_[_0x0a9e('0x29')](_0x5a101a,_0x0a9e('0x26'));_0x11c3b6[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x14433c[_0x0a9e('0x2f')]);_0x11c3b6[_0x0a9e('0x31')]=_['intersection'](_0x11c3b6[_0x0a9e('0x2e')],_0x11c3b6['query']);_0x1538a4[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x11c3b6[_0x0a9e('0x2e')],qs[_0x0a9e('0x34')](_0x14433c[_0x0a9e('0x2f')]['fields']));_0x1538a4[_0x0a9e('0x32')]=_0x1538a4[_0x0a9e('0x32')][_0x0a9e('0x35')]?_0x1538a4[_0x0a9e('0x32')]:_0x11c3b6[_0x0a9e('0x2e')];if(!_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x36')](_0x0a9e('0x37'))){_0x1538a4['limit']=qs[_0x0a9e('0x38')](_0x14433c['query'][_0x0a9e('0x38')]);_0x1538a4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x14433c[_0x0a9e('0x2f')]['offset']);}_0x1538a4[_0x0a9e('0x39')]=qs[_0x0a9e('0x3a')](_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x3a')]);_0x1538a4['where']=qs['filters'](_[_0x0a9e('0x3b')](_0x14433c['query'],_0x11c3b6[_0x0a9e('0x31')]));if(_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x3c')]){_0x1538a4[_0x0a9e('0x3d')]=_['merge'](_0x1538a4[_0x0a9e('0x3d')],{'$or':_[_0x0a9e('0x29')](_0x5a101a,function(_0x3cae){if(_0x3cae['type']!==_0x0a9e('0x3e')){var _0x1a180b={};_0x1a180b[_0x3cae[_0x0a9e('0x26')]]={'$like':'%'+_0x14433c['query']['filter']+'%'};return _0x1a180b;}})});}_0x1538a4=_[_0x0a9e('0x3f')]({},_0x1538a4,_0x14433c[_0x0a9e('0x40')]);var _0x5adda1={'where':_0x1538a4[_0x0a9e('0x3d')]};return db[_0x0a9e('0x2a')][_0x0a9e('0x17')](_0x5adda1)[_0x0a9e('0x1f')](function(_0x4b38d9){_0x14de77['count']=_0x4b38d9;if(_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x41')]){_0x1538a4['include']=[{'all':!![]}];}return db[_0x0a9e('0x2a')][_0x0a9e('0x42')](_0x1538a4);})[_0x0a9e('0x1f')](function(_0x5b4f5e){_0x14de77[_0x0a9e('0x43')]=_0x5b4f5e;return _0x14de77;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x140511,_0x1538a4))[_0x0a9e('0x44')](handleError(_0x140511,null));};exports[_0x0a9e('0x45')]=function(_0x13cb1f,_0xeaa5e5){var _0x2881b3={'raw':!![],'where':{'id':_0x13cb1f[_0x0a9e('0x46')]['id']}},_0x45a9b8={};_0x45a9b8[_0x0a9e('0x2e')]=_[_0x0a9e('0x30')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x45a9b8[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x13cb1f['query']);_0x45a9b8['filters']=_[_0x0a9e('0x33')](_0x45a9b8[_0x0a9e('0x2e')],_0x45a9b8[_0x0a9e('0x2f')]);_0x2881b3[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x45a9b8[_0x0a9e('0x2e')],qs[_0x0a9e('0x34')](_0x13cb1f[_0x0a9e('0x2f')][_0x0a9e('0x34')]));_0x2881b3[_0x0a9e('0x32')]=_0x2881b3[_0x0a9e('0x32')][_0x0a9e('0x35')]?_0x2881b3['attributes']:_0x45a9b8[_0x0a9e('0x2e')];if(_0x13cb1f[_0x0a9e('0x2f')][_0x0a9e('0x41')]){_0x2881b3[_0x0a9e('0x47')]=[{'all':!![]}];}_0x2881b3=_[_0x0a9e('0x3f')]({},_0x2881b3,_0x13cb1f[_0x0a9e('0x40')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x48')](_0x2881b3)['then'](handleEntityNotFound(_0xeaa5e5,null))[_0x0a9e('0x1f')](respondWithResult(_0xeaa5e5,null))['catch'](handleError(_0xeaa5e5,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x49')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x48')]({'where':{'id':_0x476688[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x49')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x44')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x2a')][_0x0a9e('0x48')]({'where':{'id':_0x1b5e80[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};exports[_0x0a9e('0x4a')]=function(_0x3fe430,_0x4f7240){var _0x4ae14b={'key':_0x3fe430['body'][_0x0a9e('0x2d')]};if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4b')]){_0x4ae14b[_0x0a9e('0x4b')]=_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4b')];}else if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4c')]){_0x4ae14b['SmsAccountId']=_0x3fe430['body']['SmsAccountId'];}else if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4d')]){_0x4ae14b[_0x0a9e('0x4d')]=_0x3fe430['body'][_0x0a9e('0x4d')];}else if(_0x3fe430[_0x0a9e('0x49')]['ChatWebsiteId']){_0x4ae14b['ChatWebsiteId']=_0x3fe430[_0x0a9e('0x49')]['ChatWebsiteId'];}return db[_0x0a9e('0x2a')]['find']({'where':_0x4ae14b})[_0x0a9e('0x1f')](function(_0x3c20b2){if(_0x3c20b2){throw new db[(_0x0a9e('0x4e'))]['ValidationError'](_0x0a9e('0x4f'));}return db[_0x0a9e('0x2a')]['create'](_0x3fe430['body']);})[_0x0a9e('0x1f')](function(_0x3aedd0){var _0x49c095=_0x3fe430[_0x0a9e('0x50')]['get']({'plain':!![]});if(!_0x49c095)throw new Error(_0x0a9e('0x51'));if(_0x49c095['role']===_0x0a9e('0x50')){var _0x4a6deb=_0x3aedd0['get']({'plain':!![]});return db['UserProfileSection'][_0x0a9e('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x49c095[_0x0a9e('0x52')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x3cfd00){if(_0x3cfd00&&_0x3cfd00[_0x0a9e('0x53')]===0x0){return db[_0x0a9e('0x23')][_0x0a9e('0x4a')]({'name':_0x4a6deb[_0x0a9e('0x26')],'resourceId':_0x4a6deb['id'],'type':_0x3cfd00[_0x0a9e('0x26')],'sectionId':_0x3cfd00['id']},{})['then'](function(){return _0x3aedd0;});}else{return _0x3aedd0;}})[_0x0a9e('0x44')](function(_0x121cef){logger[_0x0a9e('0x25')](_0x0a9e('0x54'),_0x121cef);throw _0x121cef;});}return _0x3aedd0;})[_0x0a9e('0x1f')](respondWithResult(_0x4f7240,0xc9))[_0x0a9e('0x44')](handleError(_0x4f7240,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 04b61fc..7be3470 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 _0x20bc=['utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4'];(function(_0x389ae2,_0xfc71dd){var _0x460f87=function(_0x74d953){while(--_0x74d953){_0x389ae2['push'](_0x389ae2['shift']());}};_0x460f87(++_0xfc71dd);}(_0x20bc,0xb5));var _0xc20b=function(_0x60878f,_0x1166d3){_0x60878f=_0x60878f-0x0;var _0x1fbefb=_0x20bc[_0x60878f];return _0x1fbefb;};'use strict';var _=require(_0xc20b('0x0'));var util=require(_0xc20b('0x1'));var logger=require('../../config/logger')(_0xc20b('0x2'));var moment=require(_0xc20b('0x3'));var BPromise=require('bluebird');var rp=require(_0xc20b('0x4'));var fs=require('fs');var path=require(_0xc20b('0x5'));var rimraf=require(_0xc20b('0x6'));var config=require(_0xc20b('0x7'));var attributes=require(_0xc20b('0x8'));module[_0xc20b('0x9')]=function(_0x3230e8,_0x44cbfb){return _0x3230e8[_0xc20b('0xa')](_0xc20b('0xb'),attributes,{'tableName':_0xc20b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc20b('0xd'),'collate':_0xc20b('0xe')});}; \ No newline at end of file +var _0x0a6d=['../../config/environment','./cannedAnswer.attributes','exports','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x57f09e,_0x2b4366){var _0x22e46a=function(_0x54391a){while(--_0x54391a){_0x57f09e['push'](_0x57f09e['shift']());}};_0x22e46a(++_0x2b4366);}(_0x0a6d,0xd1));var _0xd0a6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0a6d[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xd0a6('0x0'));var util=require(_0xd0a6('0x1'));var logger=require('../../config/logger')(_0xd0a6('0x2'));var moment=require(_0xd0a6('0x3'));var BPromise=require(_0xd0a6('0x4'));var rp=require(_0xd0a6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd0a6('0x6'));var config=require(_0xd0a6('0x7'));var attributes=require(_0xd0a6('0x8'));module[_0xd0a6('0x9')]=function(_0x1f22f0,_0x58d7cb){return _0x1f22f0['define']('CannedAnswer',attributes,{'tableName':_0xd0a6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd0a6('0xb')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 812237a..a4a1b85 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 _0xcaff=['request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','CannedAnswer,\x20%s,\x20%s'];(function(_0x263a2f,_0x1e81e3){var _0x8020e8=function(_0x39f91a){while(--_0x39f91a){_0x263a2f['push'](_0x263a2f['shift']());}};_0x8020e8(++_0x1e81e3);}(_0xcaff,0xe6));var _0xfcaf=function(_0xd75918,_0x35865){_0xd75918=_0xd75918-0x0;var _0x147237=_0xcaff[_0xd75918];return _0x147237;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfcaf('0x0'));var BPromise=require(_0xfcaf('0x1'));var rs=require(_0xfcaf('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcaf('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xfcaf('0x4'))(_0xfcaf('0x5'));var config=require(_0xfcaf('0x6'));var jayson=require(_0xfcaf('0x7'));var client=jayson[_0xfcaf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c9747,_0x5ad222,_0x102e2a){return new BPromise(function(_0x32f773,_0x1ae595){return client[_0xfcaf('0x9')](_0x2c9747,_0x102e2a)[_0xfcaf('0xa')](function(_0x2bdcee){logger['info'](_0xfcaf('0xb'),_0x5ad222,_0xfcaf('0xc'));logger[_0xfcaf('0xd')](_0xfcaf('0xe'),_0x5ad222,_0xfcaf('0xc'),JSON[_0xfcaf('0xf')](_0x2bdcee));if(_0x2bdcee[_0xfcaf('0x10')]){if(_0x2bdcee[_0xfcaf('0x10')][_0xfcaf('0x11')]===0x1f4){logger[_0xfcaf('0x10')](_0xfcaf('0xb'),_0x5ad222,_0x2bdcee[_0xfcaf('0x10')][_0xfcaf('0x12')]);return _0x1ae595(_0x2bdcee[_0xfcaf('0x10')]['message']);}logger[_0xfcaf('0x10')]('CannedAnswer,\x20%s,\x20%s',_0x5ad222,_0x2bdcee[_0xfcaf('0x10')][_0xfcaf('0x12')]);return _0x32f773(_0x2bdcee['error'][_0xfcaf('0x12')]);}else{logger[_0xfcaf('0x13')]('CannedAnswer,\x20%s,\x20%s',_0x5ad222,_0xfcaf('0xc'));_0x32f773(_0x2bdcee[_0xfcaf('0x14')]['message']);}})[_0xfcaf('0x15')](function(_0x2bd232){logger[_0xfcaf('0x10')]('CannedAnswer,\x20%s,\x20%s',_0x5ad222,_0x2bd232);_0x1ae595(_0x2bd232);});});} \ No newline at end of file +var _0xd0fe=['code','CannedAnswer,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x478708,_0x816b6c){var _0x5c4bf0=function(_0x296658){while(--_0x296658){_0x478708['push'](_0x478708['shift']());}};_0x5c4bf0(++_0x816b6c);}(_0xd0fe,0x19d));var _0xed0f=function(_0x30e98d,_0x30e9e2){_0x30e98d=_0x30e98d-0x0;var _0x30466a=_0xd0fe[_0x30e98d];return _0x30466a;};'use strict';var _=require(_0xed0f('0x0'));var util=require('util');var moment=require(_0xed0f('0x1'));var BPromise=require(_0xed0f('0x2'));var rs=require(_0xed0f('0x3'));var fs=require('fs');var Redis=require(_0xed0f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed0f('0x5'));var logger=require(_0xed0f('0x6'))(_0xed0f('0x7'));var config=require(_0xed0f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xed0f('0x9')][_0xed0f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3700b4,_0x170105,_0x5f36d2){return new BPromise(function(_0x382f4d,_0x56af72){return client[_0xed0f('0xb')](_0x3700b4,_0x5f36d2)[_0xed0f('0xc')](function(_0x3e94e2){logger[_0xed0f('0xd')]('CannedAnswer,\x20%s,\x20%s',_0x170105,'request\x20sent');logger[_0xed0f('0xe')](_0xed0f('0xf'),_0x170105,_0xed0f('0x10'),JSON[_0xed0f('0x11')](_0x3e94e2));if(_0x3e94e2[_0xed0f('0x12')]){if(_0x3e94e2[_0xed0f('0x12')][_0xed0f('0x13')]===0x1f4){logger[_0xed0f('0x12')](_0xed0f('0x14'),_0x170105,_0x3e94e2[_0xed0f('0x12')][_0xed0f('0x15')]);return _0x56af72(_0x3e94e2[_0xed0f('0x12')][_0xed0f('0x15')]);}logger['error'](_0xed0f('0x14'),_0x170105,_0x3e94e2[_0xed0f('0x12')][_0xed0f('0x15')]);return _0x382f4d(_0x3e94e2[_0xed0f('0x12')][_0xed0f('0x15')]);}else{logger[_0xed0f('0xd')](_0xed0f('0x14'),_0x170105,'request\x20sent');_0x382f4d(_0x3e94e2[_0xed0f('0x16')][_0xed0f('0x15')]);}})[_0xed0f('0x17')](function(_0x48475f){logger[_0xed0f('0x12')](_0xed0f('0x14'),_0x170105,_0x48475f);_0x56af72(_0x48475f);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 192ad5d..3e5b460 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 _0xc5c7=['put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','post','create'];(function(_0x17408f,_0xf4a0f5){var _0x357065=function(_0xbbb58c){while(--_0xbbb58c){_0x17408f['push'](_0x17408f['shift']());}};_0x357065(++_0xf4a0f5);}(_0xc5c7,0x1cf));var _0x7c5c=function(_0x5d3464,_0x1ae22b){_0x5d3464=_0x5d3464-0x0;var _0x26f1c3=_0xc5c7[_0x5d3464];return _0x26f1c3;};'use strict';var multer=require('multer');var util=require(_0x7c5c('0x0'));var path=require(_0x7c5c('0x1'));var timeout=require(_0x7c5c('0x2'));var express=require(_0x7c5c('0x3'));var router=express[_0x7c5c('0x4')]();var auth=require(_0x7c5c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7c5c('0x6'));var controller=require(_0x7c5c('0x7'));router[_0x7c5c('0x8')]('/',auth[_0x7c5c('0x9')](),controller[_0x7c5c('0xa')]);router['get']('/:id',auth[_0x7c5c('0x9')](),controller['show']);router[_0x7c5c('0xb')]('/',auth['isAuthenticated'](),controller[_0x7c5c('0xc')]);router[_0x7c5c('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x7c5c('0xe')]);router[_0x7c5c('0xf')]('/:id',auth[_0x7c5c('0x9')](),controller['destroy']);module[_0x7c5c('0x10')]=router; \ No newline at end of file +var _0xe8cb=['get','isAuthenticated','index','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','./cannedAnswer.controller'];(function(_0x13e3d5,_0x201b3a){var _0x1b66e1=function(_0x482103){while(--_0x482103){_0x13e3d5['push'](_0x13e3d5['shift']());}};_0x1b66e1(++_0x201b3a);}(_0xe8cb,0x11a));var _0xbe8c=function(_0x390f05,_0x2d2a1c){_0x390f05=_0x390f05-0x0;var _0x2e115b=_0xe8cb[_0x390f05];return _0x2e115b;};'use strict';var multer=require(_0xbe8c('0x0'));var util=require(_0xbe8c('0x1'));var path=require(_0xbe8c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbe8c('0x3')]();var auth=require(_0xbe8c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe8c('0x5'));router[_0xbe8c('0x6')]('/',auth[_0xbe8c('0x7')](),controller[_0xbe8c('0x8')]);router[_0xbe8c('0x6')]('/:id',auth[_0xbe8c('0x7')](),controller[_0xbe8c('0x9')]);router[_0xbe8c('0xa')]('/',auth[_0xbe8c('0x7')](),controller[_0xbe8c('0xb')]);router[_0xbe8c('0xc')]('/:id',auth[_0xbe8c('0x7')](),controller[_0xbe8c('0xd')]);router[_0xbe8c('0xe')](_0xbe8c('0xf'),auth[_0xbe8c('0x7')](),controller[_0xbe8c('0x10')]);module[_0xbe8c('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 867155c..87fc54b 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 _0x7806=['STRING','INTEGER','exports','1970-01-01\x2000:00:01'];(function(_0x3f994d,_0x249d72){var _0x5309b4=function(_0x545307){while(--_0x545307){_0x3f994d['push'](_0x3f994d['shift']());}};_0x5309b4(++_0x249d72);}(_0x7806,0x10a));var _0x6780=function(_0x3ee19a,_0x2d2717){_0x3ee19a=_0x3ee19a-0x0;var _0xcb900f=_0x7806[_0x3ee19a];return _0xcb900f;};'use strict';var Sequelize=require('sequelize');module[_0x6780('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x6780('0x1')},'clid':{'type':Sequelize[_0x6780('0x2')]},'src':{'type':Sequelize[_0x6780('0x2')]},'dst':{'type':Sequelize[_0x6780('0x2')]},'dcontext':{'type':Sequelize[_0x6780('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x6780('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x6780('0x2')]},'duration':{'type':Sequelize[_0x6780('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6780('0x2')]},'amaflags':{'type':Sequelize[_0x6780('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x6780('0x2')]},'userfield':{'type':Sequelize[_0x6780('0x2')]},'uniqueid':{'type':Sequelize[_0x6780('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x6780('0x2')]},'peeraccount':{'type':Sequelize[_0x6780('0x2')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x6780('0x2')]}}; \ No newline at end of file +var _0x0179=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x57f7b8,_0x5c9638){var _0x4ea8aa=function(_0x502ea7){while(--_0x502ea7){_0x57f7b8['push'](_0x57f7b8['shift']());}};_0x4ea8aa(++_0x5c9638);}(_0x0179,0x70));var _0x9017=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x0179[_0x1abb09];return _0xea1c07;};'use strict';var Sequelize=require(_0x9017('0x0'));module[_0x9017('0x1')]={'calldate':{'type':Sequelize[_0x9017('0x2')],'allowNull':![],'defaultValue':_0x9017('0x3')},'clid':{'type':Sequelize[_0x9017('0x4')]},'src':{'type':Sequelize[_0x9017('0x4')]},'dst':{'type':Sequelize[_0x9017('0x4')]},'dcontext':{'type':Sequelize[_0x9017('0x4')]},'channel':{'type':Sequelize[_0x9017('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x9017('0x4')]},'lastdata':{'type':Sequelize[_0x9017('0x4')]},'duration':{'type':Sequelize[_0x9017('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x9017('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x9017('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x9017('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x9017('0x4')]},'linkedid':{'type':Sequelize[_0x9017('0x4')]},'sequence':{'type':Sequelize[_0x9017('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9017('0x4')]},'tag':{'type':Sequelize[_0x9017('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index c03a0f2..d0939e8 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 _0x1388=['name','send','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','find','body','update','describe','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','apply','reject','then','destroy','stack'];(function(_0xcd90ac,_0x5ae6f6){var _0x4d92f9=function(_0x20069c){while(--_0x20069c){_0xcd90ac['push'](_0xcd90ac['shift']());}};_0x4d92f9(++_0x5ae6f6);}(_0x1388,0x101));var _0x8138=function(_0x4702ee,_0xaf6a45){_0x4702ee=_0x4702ee-0x0;var _0x62ca7d=_0x1388[_0x4702ee];return _0x62ca7d;};'use strict';var pdf=require(_0x8138('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8138('0x1'));var jsonpatch=require(_0x8138('0x2'));var rp=require('request-promise');var moment=require(_0x8138('0x3'));var BPromise=require(_0x8138('0x4'));var Mustache=require(_0x8138('0x5'));var util=require('util');var path=require('path');var sox=require(_0x8138('0x6'));var csv=require(_0x8138('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8138('0x8'));var squel=require(_0x8138('0x9'));var crypto=require(_0x8138('0xa'));var jsforce=require(_0x8138('0xb'));var deskjs=require(_0x8138('0xc'));var toCsv=require(_0x8138('0x7'));var querystring=require(_0x8138('0xd'));var Papa=require(_0x8138('0xe'));var Redis=require(_0x8138('0xf'));var authService=require(_0x8138('0x10'));var qs=require(_0x8138('0x11'));var as=require(_0x8138('0x12'));var hardwareService=require(_0x8138('0x13'));var logger=require('../../config/logger')(_0x8138('0x14'));var utils=require(_0x8138('0x15'));var config=require(_0x8138('0x16'));var db=require(_0x8138('0x17'))['db'];function respondWithStatusCode(_0x2dab0c,_0x2ecd93){_0x2ecd93=_0x2ecd93||0xcc;return function(_0x433fcd){if(_0x433fcd){return _0x2dab0c['sendStatus'](_0x2ecd93);}return _0x2dab0c[_0x8138('0x18')](_0x2ecd93)[_0x8138('0x19')]();};}function respondWithResult(_0x143435,_0x35bb69){_0x35bb69=_0x35bb69||0xc8;return function(_0x3b2b88){if(_0x3b2b88){return _0x143435[_0x8138('0x18')](_0x35bb69)[_0x8138('0x1a')](_0x3b2b88);}};}function respondWithFilteredResult(_0x3f15fe,_0x1364dd){return function(_0x3f185a){if(_0x3f185a){var _0xe6e31c=_0x3f185a[_0x8138('0x1b')],_0x289c69=_0x1364dd[_0x8138('0x1c')],_0x5751e0=_0x1364dd['offset']+_0x1364dd['limit'],_0x1259d9;if(_0x5751e0>=_0xe6e31c){_0x5751e0=_0xe6e31c;_0x1259d9=0xc8;}else{_0x1259d9=0xce;}_0x3f15fe[_0x8138('0x18')](_0x1259d9);return _0x3f15fe[_0x8138('0x1d')]('Content-Range',_0x289c69+'-'+_0x5751e0+'/'+_0xe6e31c)[_0x8138('0x1a')](_0x3f185a);}return null;};}function patchUpdates(_0xd872fe){return function(_0x4f2fe0){try{jsonpatch[_0x8138('0x1e')](_0x4f2fe0,_0xd872fe,!![]);}catch(_0x16ab00){return BPromise[_0x8138('0x1f')](_0x16ab00);}return _0x4f2fe0['save']();};}function saveUpdates(_0x54946e,_0xcbaec8){return function(_0x5beb4c){if(_0x5beb4c){return _0x5beb4c['update'](_0x54946e)[_0x8138('0x20')](function(_0x124965){return _0x124965;});}return null;};}function removeEntity(_0x2fbbeb,_0x26685b){return function(_0x3be49c){if(_0x3be49c){return _0x3be49c[_0x8138('0x21')]()['then'](function(){_0x2fbbeb[_0x8138('0x18')](0xcc)[_0x8138('0x19')]();});}};}function handleEntityNotFound(_0x415b4a,_0x3f6c59){return function(_0x177d0b){if(!_0x177d0b){_0x415b4a['sendStatus'](0x194);}return _0x177d0b;};}function handleError(_0x174f00,_0x4ec671){_0x4ec671=_0x4ec671||0x1f4;return function(_0x1d65ef){logger['error'](_0x1d65ef[_0x8138('0x22')]);if(_0x1d65ef[_0x8138('0x23')]){delete _0x1d65ef[_0x8138('0x23')];}_0x174f00[_0x8138('0x18')](_0x4ec671)[_0x8138('0x24')](_0x1d65ef);};}exports['index']=function(_0xf51290,_0x91edd5){var _0x33c27f={},_0x3d4067={},_0x369c6a={'count':0x0,'rows':[]};var _0xaa9a7a=_[_0x8138('0x25')](db[_0x8138('0x26')][_0x8138('0x27')],function(_0x582b63){return{'name':_0x582b63[_0x8138('0x28')],'type':_0x582b63[_0x8138('0x29')][_0x8138('0x2a')]};});_0x3d4067[_0x8138('0x2b')]=_[_0x8138('0x25')](_0xaa9a7a,_0x8138('0x23'));_0x3d4067[_0x8138('0x2c')]=_[_0x8138('0x2d')](_0xf51290[_0x8138('0x2c')]);_0x3d4067[_0x8138('0x2e')]=_[_0x8138('0x2f')](_0x3d4067[_0x8138('0x2b')],_0x3d4067[_0x8138('0x2c')]);_0x33c27f[_0x8138('0x30')]=_['intersection'](_0x3d4067['model'],qs['fields'](_0xf51290[_0x8138('0x2c')]['fields']));_0x33c27f[_0x8138('0x30')]=_0x33c27f[_0x8138('0x30')][_0x8138('0x31')]?_0x33c27f[_0x8138('0x30')]:_0x3d4067['model'];if(!_0xf51290[_0x8138('0x2c')][_0x8138('0x32')](_0x8138('0x33'))){_0x33c27f[_0x8138('0x34')]=qs[_0x8138('0x34')](_0xf51290[_0x8138('0x2c')][_0x8138('0x34')]);_0x33c27f[_0x8138('0x1c')]=qs['offset'](_0xf51290['query'][_0x8138('0x1c')]);}_0x33c27f[_0x8138('0x35')]=qs['sort'](_0xf51290[_0x8138('0x2c')][_0x8138('0x36')]);_0x33c27f['where']=qs['filters'](_[_0x8138('0x37')](_0xf51290[_0x8138('0x2c')],_0x3d4067[_0x8138('0x2e')]));if(_0xf51290['query'][_0x8138('0x38')]){_0x33c27f[_0x8138('0x39')]=_[_0x8138('0x3a')](_0x33c27f[_0x8138('0x39')],{'$or':_['map'](_0xaa9a7a,function(_0x454d2c){if(_0x454d2c[_0x8138('0x29')]!==_0x8138('0x3b')){var _0x48fade={};_0x48fade[_0x454d2c['name']]={'$like':'%'+_0xf51290['query'][_0x8138('0x38')]+'%'};return _0x48fade;}})});}_0x33c27f=_[_0x8138('0x3a')]({},_0x33c27f,_0xf51290[_0x8138('0x3c')]);var _0x172b66={'where':_0x33c27f[_0x8138('0x39')]};return db[_0x8138('0x26')][_0x8138('0x1b')](_0x172b66)['then'](function(_0x2f8361){_0x369c6a[_0x8138('0x1b')]=_0x2f8361;if(_0xf51290[_0x8138('0x2c')][_0x8138('0x3d')]){_0x33c27f[_0x8138('0x3e')]=[{'all':!![]}];}return db[_0x8138('0x26')][_0x8138('0x3f')](_0x33c27f);})[_0x8138('0x20')](function(_0x1c8090){_0x369c6a[_0x8138('0x40')]=_0x1c8090;return _0x369c6a;})[_0x8138('0x20')](respondWithFilteredResult(_0x91edd5,_0x33c27f))[_0x8138('0x41')](handleError(_0x91edd5,null));};exports[_0x8138('0x42')]=function(_0x2bbf5d,_0x162931){var _0x396354={'raw':!![],'where':{'id':_0x2bbf5d[_0x8138('0x43')]['id']}},_0xf17a6e={};_0xf17a6e[_0x8138('0x2b')]=_[_0x8138('0x2d')](db[_0x8138('0x26')][_0x8138('0x27')]);_0xf17a6e['query']=_[_0x8138('0x2d')](_0x2bbf5d[_0x8138('0x2c')]);_0xf17a6e[_0x8138('0x2e')]=_[_0x8138('0x2f')](_0xf17a6e[_0x8138('0x2b')],_0xf17a6e[_0x8138('0x2c')]);_0x396354[_0x8138('0x30')]=_[_0x8138('0x2f')](_0xf17a6e[_0x8138('0x2b')],qs[_0x8138('0x44')](_0x2bbf5d[_0x8138('0x2c')][_0x8138('0x44')]));_0x396354[_0x8138('0x30')]=_0x396354[_0x8138('0x30')][_0x8138('0x31')]?_0x396354[_0x8138('0x30')]:_0xf17a6e['model'];if(_0x2bbf5d[_0x8138('0x2c')][_0x8138('0x3d')]){_0x396354[_0x8138('0x3e')]=[{'all':!![]}];}_0x396354=_[_0x8138('0x3a')]({},_0x396354,_0x2bbf5d[_0x8138('0x3c')]);return db[_0x8138('0x26')][_0x8138('0x45')](_0x396354)[_0x8138('0x20')](handleEntityNotFound(_0x162931,null))[_0x8138('0x20')](respondWithResult(_0x162931,null))[_0x8138('0x41')](handleError(_0x162931,null));};exports['create']=function(_0x3199bf,_0x4c2628){return db[_0x8138('0x26')]['create'](_0x3199bf[_0x8138('0x46')],{})[_0x8138('0x20')](respondWithResult(_0x4c2628,0xc9))['catch'](handleError(_0x4c2628,null));};exports[_0x8138('0x47')]=function(_0xb50a9d,_0x35aa84){if(_0xb50a9d[_0x8138('0x46')]['id']){delete _0xb50a9d[_0x8138('0x46')]['id'];}return db[_0x8138('0x26')]['find']({'where':{'id':_0xb50a9d['params']['id']}})[_0x8138('0x20')](handleEntityNotFound(_0x35aa84,null))[_0x8138('0x20')](saveUpdates(_0xb50a9d[_0x8138('0x46')],null))['then'](respondWithResult(_0x35aa84,null))[_0x8138('0x41')](handleError(_0x35aa84,null));};exports['destroy']=function(_0x3112d4,_0x19ed16){return db[_0x8138('0x26')]['find']({'where':{'id':_0x3112d4[_0x8138('0x43')]['id']}})[_0x8138('0x20')](handleEntityNotFound(_0x19ed16,null))[_0x8138('0x20')](removeEntity(_0x19ed16,null))[_0x8138('0x41')](handleError(_0x19ed16,null));};exports[_0x8138('0x48')]=function(_0x28bfb9,_0x2c89c5){return db[_0x8138('0x26')][_0x8138('0x48')]()[_0x8138('0x20')](respondWithResult(_0x2c89c5,null))[_0x8138('0x41')](handleError(_0x2c89c5,null));}; \ No newline at end of file +var _0x2642=['../../config/environment','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','where','merge','VIRTUAL','filter','options','Cdr','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils'];(function(_0x114859,_0x531590){var _0x16180f=function(_0x4b377b){while(--_0x4b377b){_0x114859['push'](_0x114859['shift']());}};_0x16180f(++_0x531590);}(_0x2642,0x11c));var _0x2264=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x2642[_0x6131cd];return _0x47e916;};'use strict';var pdf=require(_0x2264('0x0'));var emlformat=require(_0x2264('0x1'));var rimraf=require(_0x2264('0x2'));var zipdir=require(_0x2264('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2264('0x4'));var moment=require(_0x2264('0x5'));var BPromise=require(_0x2264('0x6'));var Mustache=require(_0x2264('0x7'));var util=require(_0x2264('0x8'));var path=require(_0x2264('0x9'));var sox=require(_0x2264('0xa'));var csv=require('to-csv');var ejs=require(_0x2264('0xb'));var fs=require('fs');var _=require(_0x2264('0xc'));var squel=require(_0x2264('0xd'));var crypto=require(_0x2264('0xe'));var jsforce=require(_0x2264('0xf'));var deskjs=require(_0x2264('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2264('0x11'));var Papa=require(_0x2264('0x12'));var Redis=require(_0x2264('0x13'));var authService=require(_0x2264('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2264('0x15'))(_0x2264('0x16'));var utils=require(_0x2264('0x17'));var config=require(_0x2264('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x450dbd,_0x50c1c2){_0x50c1c2=_0x50c1c2||0xcc;return function(_0x5e9f70){if(_0x5e9f70){return _0x450dbd[_0x2264('0x19')](_0x50c1c2);}return _0x450dbd['status'](_0x50c1c2)['end']();};}function respondWithResult(_0x411ef3,_0x5e4e75){_0x5e4e75=_0x5e4e75||0xc8;return function(_0x5ea634){if(_0x5ea634){return _0x411ef3[_0x2264('0x1a')](_0x5e4e75)['json'](_0x5ea634);}};}function respondWithFilteredResult(_0x1484cd,_0x25e20a){return function(_0x48a539){if(_0x48a539){var _0x40089a=_0x48a539[_0x2264('0x1b')],_0x52e6dd=_0x25e20a[_0x2264('0x1c')],_0x4ad9ba=_0x25e20a[_0x2264('0x1c')]+_0x25e20a[_0x2264('0x1d')],_0x5749a5;if(_0x4ad9ba>=_0x40089a){_0x4ad9ba=_0x40089a;_0x5749a5=0xc8;}else{_0x5749a5=0xce;}_0x1484cd[_0x2264('0x1a')](_0x5749a5);return _0x1484cd[_0x2264('0x1e')](_0x2264('0x1f'),_0x52e6dd+'-'+_0x4ad9ba+'/'+_0x40089a)[_0x2264('0x20')](_0x48a539);}return null;};}function patchUpdates(_0x20843a){return function(_0xc8509d){try{jsonpatch[_0x2264('0x21')](_0xc8509d,_0x20843a,!![]);}catch(_0x5af665){return BPromise[_0x2264('0x22')](_0x5af665);}return _0xc8509d[_0x2264('0x23')]();};}function saveUpdates(_0x192fdb,_0x59e0f2){return function(_0x5c1ee1){if(_0x5c1ee1){return _0x5c1ee1[_0x2264('0x24')](_0x192fdb)[_0x2264('0x25')](function(_0x296640){return _0x296640;});}return null;};}function removeEntity(_0x5d5e3b,_0x48da7c){return function(_0xab6d5c){if(_0xab6d5c){return _0xab6d5c[_0x2264('0x26')]()[_0x2264('0x25')](function(){_0x5d5e3b[_0x2264('0x1a')](0xcc)[_0x2264('0x27')]();});}};}function handleEntityNotFound(_0x1ea50b,_0x318838){return function(_0x290e26){if(!_0x290e26){_0x1ea50b[_0x2264('0x19')](0x194);}return _0x290e26;};}function handleError(_0x2da635,_0x5a066b){_0x5a066b=_0x5a066b||0x1f4;return function(_0x537f3c){logger[_0x2264('0x28')](_0x537f3c[_0x2264('0x29')]);if(_0x537f3c[_0x2264('0x2a')]){delete _0x537f3c['name'];}_0x2da635['status'](_0x5a066b)[_0x2264('0x2b')](_0x537f3c);};}exports[_0x2264('0x2c')]=function(_0x2e6149,_0x48674e){var _0x1ad065={},_0x9ea408={},_0x5acba5={'count':0x0,'rows':[]};var _0x534ea6=_[_0x2264('0x2d')](db['Cdr']['rawAttributes'],function(_0x378d56){return{'name':_0x378d56[_0x2264('0x2e')],'type':_0x378d56[_0x2264('0x2f')][_0x2264('0x30')]};});_0x9ea408['model']=_['map'](_0x534ea6,'name');_0x9ea408[_0x2264('0x31')]=_[_0x2264('0x32')](_0x2e6149['query']);_0x9ea408[_0x2264('0x33')]=_[_0x2264('0x34')](_0x9ea408[_0x2264('0x35')],_0x9ea408[_0x2264('0x31')]);_0x1ad065[_0x2264('0x36')]=_[_0x2264('0x34')](_0x9ea408[_0x2264('0x35')],qs[_0x2264('0x37')](_0x2e6149[_0x2264('0x31')][_0x2264('0x37')]));_0x1ad065[_0x2264('0x36')]=_0x1ad065[_0x2264('0x36')]['length']?_0x1ad065[_0x2264('0x36')]:_0x9ea408[_0x2264('0x35')];if(!_0x2e6149[_0x2264('0x31')][_0x2264('0x38')](_0x2264('0x39'))){_0x1ad065[_0x2264('0x1d')]=qs['limit'](_0x2e6149[_0x2264('0x31')][_0x2264('0x1d')]);_0x1ad065[_0x2264('0x1c')]=qs['offset'](_0x2e6149[_0x2264('0x31')][_0x2264('0x1c')]);}_0x1ad065['order']=qs['sort'](_0x2e6149[_0x2264('0x31')]['sort']);_0x1ad065['where']=qs[_0x2264('0x33')](_['pick'](_0x2e6149[_0x2264('0x31')],_0x9ea408[_0x2264('0x33')]));if(_0x2e6149[_0x2264('0x31')]['filter']){_0x1ad065[_0x2264('0x3a')]=_[_0x2264('0x3b')](_0x1ad065[_0x2264('0x3a')],{'$or':_['map'](_0x534ea6,function(_0x24a40c){if(_0x24a40c[_0x2264('0x2f')]!==_0x2264('0x3c')){var _0x6c9035={};_0x6c9035[_0x24a40c[_0x2264('0x2a')]]={'$like':'%'+_0x2e6149[_0x2264('0x31')][_0x2264('0x3d')]+'%'};return _0x6c9035;}})});}_0x1ad065=_[_0x2264('0x3b')]({},_0x1ad065,_0x2e6149[_0x2264('0x3e')]);var _0x186cf9={'where':_0x1ad065[_0x2264('0x3a')]};return db[_0x2264('0x3f')][_0x2264('0x1b')](_0x186cf9)['then'](function(_0xec7cbb){_0x5acba5[_0x2264('0x1b')]=_0xec7cbb;if(_0x2e6149['query'][_0x2264('0x40')]){_0x1ad065[_0x2264('0x41')]=[{'all':!![]}];}return db['Cdr'][_0x2264('0x42')](_0x1ad065);})['then'](function(_0xde8b61){_0x5acba5[_0x2264('0x43')]=_0xde8b61;return _0x5acba5;})['then'](respondWithFilteredResult(_0x48674e,_0x1ad065))[_0x2264('0x44')](handleError(_0x48674e,null));};exports[_0x2264('0x45')]=function(_0x211c0a,_0x621e9b){var _0x1c4786={'raw':!![],'where':{'id':_0x211c0a[_0x2264('0x46')]['id']}},_0x3ffeb4={};_0x3ffeb4[_0x2264('0x35')]=_[_0x2264('0x32')](db[_0x2264('0x3f')][_0x2264('0x47')]);_0x3ffeb4['query']=_[_0x2264('0x32')](_0x211c0a[_0x2264('0x31')]);_0x3ffeb4[_0x2264('0x33')]=_[_0x2264('0x34')](_0x3ffeb4[_0x2264('0x35')],_0x3ffeb4[_0x2264('0x31')]);_0x1c4786[_0x2264('0x36')]=_[_0x2264('0x34')](_0x3ffeb4[_0x2264('0x35')],qs[_0x2264('0x37')](_0x211c0a['query']['fields']));_0x1c4786[_0x2264('0x36')]=_0x1c4786[_0x2264('0x36')][_0x2264('0x48')]?_0x1c4786[_0x2264('0x36')]:_0x3ffeb4[_0x2264('0x35')];if(_0x211c0a[_0x2264('0x31')][_0x2264('0x40')]){_0x1c4786[_0x2264('0x41')]=[{'all':!![]}];}_0x1c4786=_['merge']({},_0x1c4786,_0x211c0a[_0x2264('0x3e')]);return db[_0x2264('0x3f')][_0x2264('0x49')](_0x1c4786)[_0x2264('0x25')](handleEntityNotFound(_0x621e9b,null))['then'](respondWithResult(_0x621e9b,null))[_0x2264('0x44')](handleError(_0x621e9b,null));};exports[_0x2264('0x4a')]=function(_0xedbf84,_0x59bd7e){return db[_0x2264('0x3f')][_0x2264('0x4a')](_0xedbf84[_0x2264('0x4b')],{})[_0x2264('0x25')](respondWithResult(_0x59bd7e,0xc9))['catch'](handleError(_0x59bd7e,null));};exports[_0x2264('0x24')]=function(_0x197951,_0x1803fa){if(_0x197951[_0x2264('0x4b')]['id']){delete _0x197951['body']['id'];}return db[_0x2264('0x3f')]['find']({'where':{'id':_0x197951[_0x2264('0x46')]['id']}})[_0x2264('0x25')](handleEntityNotFound(_0x1803fa,null))[_0x2264('0x25')](saveUpdates(_0x197951[_0x2264('0x4b')],null))[_0x2264('0x25')](respondWithResult(_0x1803fa,null))[_0x2264('0x44')](handleError(_0x1803fa,null));};exports[_0x2264('0x26')]=function(_0x3d15b4,_0x8583df){return db[_0x2264('0x3f')][_0x2264('0x49')]({'where':{'id':_0x3d15b4[_0x2264('0x46')]['id']}})[_0x2264('0x25')](handleEntityNotFound(_0x8583df,null))[_0x2264('0x25')](removeEntity(_0x8583df,null))[_0x2264('0x44')](handleError(_0x8583df,null));};exports[_0x2264('0x4c')]=function(_0x4be9a8,_0x2c90fd){return db[_0x2264('0x3f')][_0x2264('0x4c')]()[_0x2264('0x25')](respondWithResult(_0x2c90fd,null))[_0x2264('0x44')](handleError(_0x2c90fd,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 7b3ccb9..cb15504 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 _0xf61e=['src','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cdr.attributes','exports','define','cdr','accountcode','disposition','dst'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xf61e,0x191));var _0xef61=function(_0x3b25d5,_0x30a7be){_0x3b25d5=_0x3b25d5-0x0;var _0x22ff16=_0xf61e[_0x3b25d5];return _0x22ff16;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var logger=require(_0xef61('0x2'))(_0xef61('0x3'));var moment=require(_0xef61('0x4'));var BPromise=require(_0xef61('0x5'));var rp=require(_0xef61('0x6'));var fs=require('fs');var path=require(_0xef61('0x7'));var rimraf=require(_0xef61('0x8'));var config=require(_0xef61('0x9'));var attributes=require(_0xef61('0xa'));module[_0xef61('0xb')]=function(_0x5b00b2,_0x9e17f4){return _0x5b00b2[_0xef61('0xc')]('Cdr',attributes,{'tableName':_0xef61('0xd'),'paranoid':![],'indexes':[{'name':_0xef61('0xe'),'fields':[_0xef61('0xe')]},{'name':'calldate','fields':['calldate']},{'name':_0xef61('0xf'),'fields':[_0xef61('0xf')]},{'name':_0xef61('0x10'),'fields':[_0xef61('0x10')]},{'name':_0xef61('0x11'),'fields':[_0xef61('0x11')]},{'name':_0xef61('0x12'),'fields':[_0xef61('0x12')]}],'timestamps':![]});}; \ No newline at end of file +var _0x90b1=['path','rimraf','define','Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x3ff182,_0x1a93e5){var _0x47aef9=function(_0x1dab32){while(--_0x1dab32){_0x3ff182['push'](_0x3ff182['shift']());}};_0x47aef9(++_0x1a93e5);}(_0x90b1,0x1bb));var _0x190b=function(_0x220882,_0x42619b){_0x220882=_0x220882-0x0;var _0xbcf788=_0x90b1[_0x220882];return _0xbcf788;};'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 diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 695d1f7..96279a4 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 _0xdc72=['bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x7f6bc8,_0x98c3bf){var _0xb899c7=function(_0x334535){while(--_0x334535){_0x7f6bc8['push'](_0x7f6bc8['shift']());}};_0xb899c7(++_0x98c3bf);}(_0xdc72,0xd5));var _0x2dc7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc72[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2dc7('0x0'));var util=require(_0x2dc7('0x1'));var moment=require(_0x2dc7('0x2'));var BPromise=require(_0x2dc7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2dc7('0x4'));var db=require(_0x2dc7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2dc7('0x6'));var config=require(_0x2dc7('0x7'));var jayson=require(_0x2dc7('0x8'));var client=jayson[_0x2dc7('0x9')][_0x2dc7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x441cb7,_0x4ce294,_0x567ab6){return new BPromise(function(_0x1c5be5,_0x26369c){return client[_0x2dc7('0xb')](_0x441cb7,_0x567ab6)[_0x2dc7('0xc')](function(_0x1da0ca){logger[_0x2dc7('0xd')](_0x2dc7('0xe'),_0x4ce294,_0x2dc7('0xf'));logger[_0x2dc7('0x10')](_0x2dc7('0x11'),_0x4ce294,'request\x20sent',JSON[_0x2dc7('0x12')](_0x1da0ca));if(_0x1da0ca[_0x2dc7('0x13')]){if(_0x1da0ca['error'][_0x2dc7('0x14')]===0x1f4){logger[_0x2dc7('0x13')]('Cdr,\x20%s,\x20%s',_0x4ce294,_0x1da0ca[_0x2dc7('0x13')][_0x2dc7('0x15')]);return _0x26369c(_0x1da0ca[_0x2dc7('0x13')]['message']);}logger['error'](_0x2dc7('0xe'),_0x4ce294,_0x1da0ca['error'][_0x2dc7('0x15')]);return _0x1c5be5(_0x1da0ca[_0x2dc7('0x13')][_0x2dc7('0x15')]);}else{logger[_0x2dc7('0xd')](_0x2dc7('0xe'),_0x4ce294,_0x2dc7('0xf'));_0x1c5be5(_0x1da0ca[_0x2dc7('0x16')][_0x2dc7('0x15')]);}})[_0x2dc7('0x17')](function(_0x151a0c){logger[_0x2dc7('0x13')]('Cdr,\x20%s,\x20%s',_0x4ce294,_0x151a0c);_0x26369c(_0x151a0c);});});} \ No newline at end of file +var _0xbd00=['request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x5c1196,_0x33c0d6){var _0x46ff0d=function(_0x1f72e1){while(--_0x1f72e1){_0x5c1196['push'](_0x5c1196['shift']());}};_0x46ff0d(++_0x33c0d6);}(_0xbd00,0x17c));var _0x0bd0=function(_0x15449d,_0x537b1d){_0x15449d=_0x15449d-0x0;var _0x55cf8c=_0xbd00[_0x15449d];return _0x55cf8c;};'use strict';var _=require(_0x0bd0('0x0'));var util=require(_0x0bd0('0x1'));var moment=require(_0x0bd0('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bd0('0x3'));var fs=require('fs');var Redis=require(_0x0bd0('0x4'));var db=require(_0x0bd0('0x5'))['db'];var utils=require(_0x0bd0('0x6'));var logger=require('../../config/logger')(_0x0bd0('0x7'));var config=require('../../config/environment');var jayson=require(_0x0bd0('0x8'));var client=jayson[_0x0bd0('0x9')][_0x0bd0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19750f,_0x5e25e9,_0x4f5ad7){return new BPromise(function(_0x57023b,_0x3abf2c){return client[_0x0bd0('0xb')](_0x19750f,_0x4f5ad7)[_0x0bd0('0xc')](function(_0x177fe4){logger[_0x0bd0('0xd')](_0x0bd0('0xe'),_0x5e25e9,_0x0bd0('0xf'));logger[_0x0bd0('0x10')](_0x0bd0('0x11'),_0x5e25e9,'request\x20sent',JSON[_0x0bd0('0x12')](_0x177fe4));if(_0x177fe4[_0x0bd0('0x13')]){if(_0x177fe4[_0x0bd0('0x13')][_0x0bd0('0x14')]===0x1f4){logger['error'](_0x0bd0('0xe'),_0x5e25e9,_0x177fe4['error'][_0x0bd0('0x15')]);return _0x3abf2c(_0x177fe4[_0x0bd0('0x13')]['message']);}logger[_0x0bd0('0x13')](_0x0bd0('0xe'),_0x5e25e9,_0x177fe4['error']['message']);return _0x57023b(_0x177fe4[_0x0bd0('0x13')][_0x0bd0('0x15')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x5e25e9,_0x0bd0('0xf'));_0x57023b(_0x177fe4['result']['message']);}})[_0x0bd0('0x16')](function(_0x7ddc66){logger[_0x0bd0('0x13')](_0x0bd0('0xe'),_0x5e25e9,_0x7ddc66);_0x3abf2c(_0x7ddc66);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 709e022..432cad8 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 _0x54c4=['put','/:id','update','delete','destroy','exports','multer','path','Router','../../components/auth/service','../../config/environment','./cdr.controller','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0x3081e8,_0x4f715b){var _0x4641e5=function(_0x44df2d){while(--_0x44df2d){_0x3081e8['push'](_0x3081e8['shift']());}};_0x4641e5(++_0x4f715b);}(_0x54c4,0x182));var _0x454c=function(_0x8dca03,_0x307dd3){_0x8dca03=_0x8dca03-0x0;var _0x47007d=_0x54c4[_0x8dca03];return _0x47007d;};'use strict';var multer=require(_0x454c('0x0'));var util=require('util');var path=require(_0x454c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x454c('0x2')]();var auth=require(_0x454c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x454c('0x4'));var controller=require(_0x454c('0x5'));router[_0x454c('0x6')]('/',auth[_0x454c('0x7')](),controller[_0x454c('0x8')]);router['get'](_0x454c('0x9'),auth['isAuthenticated'](),controller[_0x454c('0xa')]);router['get']('/:id',auth[_0x454c('0x7')](),controller[_0x454c('0xb')]);router[_0x454c('0xc')]('/',auth[_0x454c('0x7')](),controller[_0x454c('0xd')]);router[_0x454c('0xe')](_0x454c('0xf'),auth[_0x454c('0x7')](),controller[_0x454c('0x10')]);router[_0x454c('0x11')](_0x454c('0xf'),auth[_0x454c('0x7')](),controller[_0x454c('0x12')]);module[_0x454c('0x13')]=router; \ No newline at end of file +var _0xec05=['express','Router','./cdr.controller','get','index','/describe','isAuthenticated','/:id','post','create','put','update','destroy','exports','path'];(function(_0x59d35c,_0xafbb4b){var _0x4f0ded=function(_0x3033a2){while(--_0x3033a2){_0x59d35c['push'](_0x59d35c['shift']());}};_0x4f0ded(++_0xafbb4b);}(_0xec05,0x194));var _0x5ec0=function(_0x454cba,_0xf6820c){_0x454cba=_0x454cba-0x0;var _0x19f516=_0xec05[_0x454cba];return _0x19f516;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5ec0('0x0'));var timeout=require('connect-timeout');var express=require(_0x5ec0('0x1'));var router=express[_0x5ec0('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5ec0('0x3'));router[_0x5ec0('0x4')]('/',auth['isAuthenticated'](),controller[_0x5ec0('0x5')]);router[_0x5ec0('0x4')](_0x5ec0('0x6'),auth[_0x5ec0('0x7')](),controller['describe']);router['get'](_0x5ec0('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x5ec0('0x9')]('/',auth[_0x5ec0('0x7')](),controller[_0x5ec0('0xa')]);router[_0x5ec0('0xb')](_0x5ec0('0x8'),auth[_0x5ec0('0x7')](),controller[_0x5ec0('0xc')]);router['delete'](_0x5ec0('0x8'),auth[_0x5ec0('0x7')](),controller[_0x5ec0('0xd')]);module[_0x5ec0('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 152efde..606af79 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 _0x5d31=['STRING','*,*,*,*','exports','INTEGER'];(function(_0x4c36a8,_0x1fb420){var _0x3c0859=function(_0xa60ca7){while(--_0xa60ca7){_0x4c36a8['push'](_0x4c36a8['shift']());}};_0x3c0859(++_0x1fb420);}(_0x5d31,0x8e));var _0x15d3=function(_0x4e291f,_0x202c9){_0x4e291f=_0x4e291f-0x0;var _0x3b2d52=_0x5d31[_0x4e291f];return _0x3b2d52;};'use strict';var Sequelize=require('sequelize');module[_0x15d3('0x0')]={'priority':{'type':Sequelize[_0x15d3('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x15d3('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x15d3('0x2')],'defaultValue':_0x15d3('0x3')}}; \ No newline at end of file +var _0xb4bf=['STRING','noop','sequelize','exports','INTEGER'];(function(_0x357d03,_0x2c94a9){var _0x49ee5c=function(_0x44c8b3){while(--_0x44c8b3){_0x357d03['push'](_0x357d03['shift']());}};_0x49ee5c(++_0x2c94a9);}(_0xb4bf,0x156));var _0xfb4b=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xb4bf[_0x5f3f88];return _0xd08119;};'use strict';var Sequelize=require(_0xfb4b('0x0'));module[_0xfb4b('0x1')]={'priority':{'type':Sequelize[_0xfb4b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xfb4b('0x3')],'allowNull':![],'defaultValue':_0xfb4b('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xfb4b('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index ba62c20..5f029cc 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 _0x888d=['json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','name','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','options','find','catch','body','html-pdf','rimraf','zip-dir','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','../../config/utils','../../mysqldb','sendStatus','status','end'];(function(_0x4ed625,_0x384757){var _0x5b4bad=function(_0x4b4baf){while(--_0x4b4baf){_0x4ed625['push'](_0x4ed625['shift']());}};_0x5b4bad(++_0x384757);}(_0x888d,0x1e7));var _0xd888=function(_0x4c7a72,_0x419681){_0x4c7a72=_0x4c7a72-0x0;var _0x581ec3=_0x888d[_0x4c7a72];return _0x581ec3;};'use strict';var pdf=require(_0xd888('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd888('0x1'));var zipdir=require(_0xd888('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd888('0x3'));var Mustache=require(_0xd888('0x4'));var util=require('util');var path=require(_0xd888('0x5'));var sox=require(_0xd888('0x6'));var csv=require(_0xd888('0x7'));var ejs=require(_0xd888('0x8'));var fs=require('fs');var _=require(_0xd888('0x9'));var squel=require(_0xd888('0xa'));var crypto=require(_0xd888('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd888('0xc'));var toCsv=require(_0xd888('0x7'));var querystring=require('querystring');var Papa=require(_0xd888('0xd'));var Redis=require(_0xd888('0xe'));var authService=require(_0xd888('0xf'));var qs=require(_0xd888('0x10'));var as=require(_0xd888('0x11'));var hardwareService=require(_0xd888('0x12'));var logger=require(_0xd888('0x13'))(_0xd888('0x14'));var utils=require(_0xd888('0x15'));var config=require('../../config/environment');var db=require(_0xd888('0x16'))['db'];function respondWithStatusCode(_0x38d824,_0x2e6763){_0x2e6763=_0x2e6763||0xcc;return function(_0x20ef53){if(_0x20ef53){return _0x38d824[_0xd888('0x17')](_0x2e6763);}return _0x38d824[_0xd888('0x18')](_0x2e6763)[_0xd888('0x19')]();};}function respondWithResult(_0x3f1d12,_0x23ab26){_0x23ab26=_0x23ab26||0xc8;return function(_0x2ccfc5){if(_0x2ccfc5){return _0x3f1d12[_0xd888('0x18')](_0x23ab26)[_0xd888('0x1a')](_0x2ccfc5);}};}function respondWithFilteredResult(_0x482ca7,_0x1f623d){return function(_0x51cb6f){if(_0x51cb6f){var _0x383f07=_0x51cb6f[_0xd888('0x1b')],_0x44c335=_0x1f623d[_0xd888('0x1c')],_0x5aadaf=_0x1f623d[_0xd888('0x1c')]+_0x1f623d[_0xd888('0x1d')],_0x405ec5;if(_0x5aadaf>=_0x383f07){_0x5aadaf=_0x383f07;_0x405ec5=0xc8;}else{_0x405ec5=0xce;}_0x482ca7['status'](_0x405ec5);return _0x482ca7[_0xd888('0x1e')]('Content-Range',_0x44c335+'-'+_0x5aadaf+'/'+_0x383f07)[_0xd888('0x1a')](_0x51cb6f);}return null;};}function patchUpdates(_0xbb9068){return function(_0x274118){try{jsonpatch[_0xd888('0x1f')](_0x274118,_0xbb9068,!![]);}catch(_0xae7e24){return BPromise[_0xd888('0x20')](_0xae7e24);}return _0x274118[_0xd888('0x21')]();};}function saveUpdates(_0x22a669,_0x40a839){return function(_0x462ed4){if(_0x462ed4){return _0x462ed4[_0xd888('0x22')](_0x22a669)[_0xd888('0x23')](function(_0x263939){return _0x263939;});}return null;};}function removeEntity(_0x1b67e3,_0x5f5085){return function(_0x1399c8){if(_0x1399c8){return _0x1399c8[_0xd888('0x24')]()['then'](function(){_0x1b67e3['status'](0xcc)[_0xd888('0x19')]();});}};}function handleEntityNotFound(_0x551179,_0x426686){return function(_0x50bd46){if(!_0x50bd46){_0x551179[_0xd888('0x17')](0x194);}return _0x50bd46;};}function handleError(_0x4e666d,_0x4dd5ab){_0x4dd5ab=_0x4dd5ab||0x1f4;return function(_0x48df52){logger[_0xd888('0x25')](_0x48df52['stack']);if(_0x48df52['name']){delete _0x48df52[_0xd888('0x26')];}_0x4e666d[_0xd888('0x18')](_0x4dd5ab)['send'](_0x48df52);};}exports[_0xd888('0x27')]=function(_0x59757f,_0x4d7292){var _0x2fa5b7={'raw':!![],'where':{'id':_0x59757f[_0xd888('0x28')]['id']}},_0x45ab4a={};_0x45ab4a[_0xd888('0x29')]=_[_0xd888('0x2a')](db[_0xd888('0x2b')][_0xd888('0x2c')]);_0x45ab4a[_0xd888('0x2d')]=_['keys'](_0x59757f[_0xd888('0x2d')]);_0x45ab4a[_0xd888('0x2e')]=_['intersection'](_0x45ab4a[_0xd888('0x29')],_0x45ab4a[_0xd888('0x2d')]);_0x2fa5b7['attributes']=_[_0xd888('0x2f')](_0x45ab4a['model'],qs[_0xd888('0x30')](_0x59757f[_0xd888('0x2d')][_0xd888('0x30')]));_0x2fa5b7[_0xd888('0x31')]=_0x2fa5b7[_0xd888('0x31')][_0xd888('0x32')]?_0x2fa5b7['attributes']:_0x45ab4a['model'];if(_0x59757f['query'][_0xd888('0x33')]){_0x2fa5b7[_0xd888('0x34')]=[{'all':!![]}];}_0x2fa5b7=_['merge']({},_0x2fa5b7,_0x59757f[_0xd888('0x35')]);return db[_0xd888('0x2b')][_0xd888('0x36')](_0x2fa5b7)['then'](handleEntityNotFound(_0x4d7292,null))[_0xd888('0x23')](respondWithResult(_0x4d7292,null))[_0xd888('0x37')](handleError(_0x4d7292,null));};exports[_0xd888('0x22')]=function(_0x13b0fa,_0x656ed1){if(_0x13b0fa[_0xd888('0x38')]['id']){delete _0x13b0fa[_0xd888('0x38')]['id'];}return db['ChatApplication'][_0xd888('0x36')]({'where':{'id':_0x13b0fa[_0xd888('0x28')]['id']}})[_0xd888('0x23')](handleEntityNotFound(_0x656ed1,null))[_0xd888('0x23')](saveUpdates(_0x13b0fa[_0xd888('0x38')],null))[_0xd888('0x23')](respondWithResult(_0x656ed1,null))[_0xd888('0x37')](handleError(_0x656ed1,null));};exports[_0xd888('0x24')]=function(_0x25fd85,_0x2a8caa){return db[_0xd888('0x2b')]['find']({'where':{'id':_0x25fd85[_0xd888('0x28')]['id']}})[_0xd888('0x23')](handleEntityNotFound(_0x2a8caa,null))[_0xd888('0x23')](removeEntity(_0x2a8caa,null))[_0xd888('0x37')](handleError(_0x2a8caa,null));}; \ No newline at end of file +var _0x3f82=['name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','merge','options','catch','update','body','find','html-pdf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','then','destroy','error','stack'];(function(_0xbe6ec6,_0x2f330f){var _0x3d18c3=function(_0x48031b){while(--_0x48031b){_0xbe6ec6['push'](_0xbe6ec6['shift']());}};_0x3d18c3(++_0x2f330f);}(_0x3f82,0x15d));var _0x23f8=function(_0xbb082f,_0x12c31e){_0xbb082f=_0xbb082f-0x0;var _0x351fc6=_0x3f82[_0xbb082f];return _0x351fc6;};'use strict';var pdf=require(_0x23f8('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x23f8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x23f8('0x2'));var moment=require(_0x23f8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x23f8('0x4'));var util=require(_0x23f8('0x5'));var path=require('path');var sox=require(_0x23f8('0x6'));var csv=require(_0x23f8('0x7'));var ejs=require(_0x23f8('0x8'));var fs=require('fs');var _=require(_0x23f8('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x23f8('0xa'));var Papa=require(_0x23f8('0xb'));var Redis=require(_0x23f8('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x23f8('0xd'));var as=require(_0x23f8('0xe'));var hardwareService=require(_0x23f8('0xf'));var logger=require(_0x23f8('0x10'))(_0x23f8('0x11'));var utils=require(_0x23f8('0x12'));var config=require(_0x23f8('0x13'));var db=require(_0x23f8('0x14'))['db'];function respondWithStatusCode(_0xb9a832,_0x3aedab){_0x3aedab=_0x3aedab||0xcc;return function(_0x359280){if(_0x359280){return _0xb9a832[_0x23f8('0x15')](_0x3aedab);}return _0xb9a832[_0x23f8('0x16')](_0x3aedab)[_0x23f8('0x17')]();};}function respondWithResult(_0x58d4cd,_0x194ca7){_0x194ca7=_0x194ca7||0xc8;return function(_0x1b00a2){if(_0x1b00a2){return _0x58d4cd[_0x23f8('0x16')](_0x194ca7)['json'](_0x1b00a2);}};}function respondWithFilteredResult(_0x19176b,_0x22030e){return function(_0x15175d){if(_0x15175d){var _0x182f29=_0x15175d[_0x23f8('0x18')],_0x555e94=_0x22030e['offset'],_0x33226f=_0x22030e[_0x23f8('0x19')]+_0x22030e[_0x23f8('0x1a')],_0x3ab8a0;if(_0x33226f>=_0x182f29){_0x33226f=_0x182f29;_0x3ab8a0=0xc8;}else{_0x3ab8a0=0xce;}_0x19176b['status'](_0x3ab8a0);return _0x19176b['set'](_0x23f8('0x1b'),_0x555e94+'-'+_0x33226f+'/'+_0x182f29)[_0x23f8('0x1c')](_0x15175d);}return null;};}function patchUpdates(_0x19710a){return function(_0x1fd153){try{jsonpatch[_0x23f8('0x1d')](_0x1fd153,_0x19710a,!![]);}catch(_0x4c7968){return BPromise[_0x23f8('0x1e')](_0x4c7968);}return _0x1fd153[_0x23f8('0x1f')]();};}function saveUpdates(_0x1fd445,_0x4923b9){return function(_0x1412c5){if(_0x1412c5){return _0x1412c5['update'](_0x1fd445)[_0x23f8('0x20')](function(_0x26af8b){return _0x26af8b;});}return null;};}function removeEntity(_0x26ad20,_0x1341b8){return function(_0x305c36){if(_0x305c36){return _0x305c36[_0x23f8('0x21')]()[_0x23f8('0x20')](function(){_0x26ad20['status'](0xcc)[_0x23f8('0x17')]();});}};}function handleEntityNotFound(_0x7483f7,_0x2b1431){return function(_0x13799b){if(!_0x13799b){_0x7483f7[_0x23f8('0x15')](0x194);}return _0x13799b;};}function handleError(_0x2a7653,_0x2d79a4){_0x2d79a4=_0x2d79a4||0x1f4;return function(_0x30d890){logger[_0x23f8('0x22')](_0x30d890[_0x23f8('0x23')]);if(_0x30d890[_0x23f8('0x24')]){delete _0x30d890[_0x23f8('0x24')];}_0x2a7653[_0x23f8('0x16')](_0x2d79a4)[_0x23f8('0x25')](_0x30d890);};}exports[_0x23f8('0x26')]=function(_0x2854fa,_0x368d75){var _0x5e5435={'raw':!![],'where':{'id':_0x2854fa[_0x23f8('0x27')]['id']}},_0x94dad9={};_0x94dad9[_0x23f8('0x28')]=_[_0x23f8('0x29')](db[_0x23f8('0x2a')][_0x23f8('0x2b')]);_0x94dad9['query']=_[_0x23f8('0x29')](_0x2854fa[_0x23f8('0x2c')]);_0x94dad9[_0x23f8('0x2d')]=_[_0x23f8('0x2e')](_0x94dad9[_0x23f8('0x28')],_0x94dad9[_0x23f8('0x2c')]);_0x5e5435[_0x23f8('0x2f')]=_[_0x23f8('0x2e')](_0x94dad9['model'],qs[_0x23f8('0x30')](_0x2854fa[_0x23f8('0x2c')][_0x23f8('0x30')]));_0x5e5435['attributes']=_0x5e5435[_0x23f8('0x2f')]['length']?_0x5e5435[_0x23f8('0x2f')]:_0x94dad9[_0x23f8('0x28')];if(_0x2854fa[_0x23f8('0x2c')]['includeAll']){_0x5e5435['include']=[{'all':!![]}];}_0x5e5435=_[_0x23f8('0x31')]({},_0x5e5435,_0x2854fa[_0x23f8('0x32')]);return db[_0x23f8('0x2a')]['find'](_0x5e5435)[_0x23f8('0x20')](handleEntityNotFound(_0x368d75,null))['then'](respondWithResult(_0x368d75,null))[_0x23f8('0x33')](handleError(_0x368d75,null));};exports[_0x23f8('0x34')]=function(_0xac6ce6,_0x22a527){if(_0xac6ce6['body']['id']){delete _0xac6ce6[_0x23f8('0x35')]['id'];}return db[_0x23f8('0x2a')]['find']({'where':{'id':_0xac6ce6[_0x23f8('0x27')]['id']}})[_0x23f8('0x20')](handleEntityNotFound(_0x22a527,null))['then'](saveUpdates(_0xac6ce6[_0x23f8('0x35')],null))[_0x23f8('0x20')](respondWithResult(_0x22a527,null))['catch'](handleError(_0x22a527,null));};exports[_0x23f8('0x21')]=function(_0x3f62b9,_0x3c4398){return db[_0x23f8('0x2a')][_0x23f8('0x36')]({'where':{'id':_0x3f62b9['params']['id']}})[_0x23f8('0x20')](handleEntityNotFound(_0x3c4398,null))[_0x23f8('0x20')](removeEntity(_0x3c4398,null))['catch'](handleError(_0x3c4398,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index c263f3d..db33588 100644 --- a/server/api/chatApplication/chatApplication.model.js +++ b/server/api/chatApplication/chatApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 5e99b53..0012f65 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 _0xc6e4=['ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','client','request','then','info','request\x20sent','debug'];(function(_0x215760,_0x580ac2){var _0xc3d8eb=function(_0x48ace1){while(--_0x48ace1){_0x215760['push'](_0x215760['shift']());}};_0xc3d8eb(++_0x580ac2);}(_0xc6e4,0x143));var _0x4c6e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc6e4[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x4c6e('0x0'));var util=require(_0x4c6e('0x1'));var moment=require(_0x4c6e('0x2'));var BPromise=require(_0x4c6e('0x3'));var rs=require(_0x4c6e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4c6e('0x5'))(_0x4c6e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4c6e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24a8e1,_0x10acdc,_0x52fc12){return new BPromise(function(_0x118012,_0x44315e){return client[_0x4c6e('0x8')](_0x24a8e1,_0x52fc12)[_0x4c6e('0x9')](function(_0x15c52c){logger[_0x4c6e('0xa')]('ChatApplication,\x20%s,\x20%s',_0x10acdc,_0x4c6e('0xb'));logger[_0x4c6e('0xc')](_0x4c6e('0xd'),_0x10acdc,_0x4c6e('0xb'),JSON[_0x4c6e('0xe')](_0x15c52c));if(_0x15c52c[_0x4c6e('0xf')]){if(_0x15c52c[_0x4c6e('0xf')][_0x4c6e('0x10')]===0x1f4){logger[_0x4c6e('0xf')](_0x4c6e('0x11'),_0x10acdc,_0x15c52c[_0x4c6e('0xf')][_0x4c6e('0x12')]);return _0x44315e(_0x15c52c['error']['message']);}logger[_0x4c6e('0xf')](_0x4c6e('0x11'),_0x10acdc,_0x15c52c[_0x4c6e('0xf')]['message']);return _0x118012(_0x15c52c[_0x4c6e('0xf')][_0x4c6e('0x12')]);}else{logger[_0x4c6e('0xa')](_0x4c6e('0x11'),_0x10acdc,_0x4c6e('0xb'));_0x118012(_0x15c52c[_0x4c6e('0x13')][_0x4c6e('0x12')]);}})[_0x4c6e('0x14')](function(_0x2a4e5a){logger[_0x4c6e('0xf')](_0x4c6e('0x11'),_0x10acdc,_0x2a4e5a);_0x44315e(_0x2a4e5a);});});} \ No newline at end of file +var _0xd2d3=['request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd2d3,0x15c));var _0x3d2d=function(_0x44e8af,_0xb5afa){_0x44e8af=_0x44e8af-0x0;var _0x1fbee3=_0xd2d3[_0x44e8af];return _0x1fbee3;};'use strict';var _=require(_0x3d2d('0x0'));var util=require(_0x3d2d('0x1'));var moment=require('moment');var BPromise=require(_0x3d2d('0x2'));var rs=require(_0x3d2d('0x3'));var fs=require('fs');var Redis=require(_0x3d2d('0x4'));var db=require(_0x3d2d('0x5'))['db'];var utils=require(_0x3d2d('0x6'));var logger=require(_0x3d2d('0x7'))(_0x3d2d('0x8'));var config=require(_0x3d2d('0x9'));var jayson=require(_0x3d2d('0xa'));var client=jayson['client'][_0x3d2d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x159e11,_0x103b27,_0x22637e){return new BPromise(function(_0x53f509,_0x592f9e){return client[_0x3d2d('0xc')](_0x159e11,_0x22637e)[_0x3d2d('0xd')](function(_0x446da4){logger[_0x3d2d('0xe')](_0x3d2d('0xf'),_0x103b27,_0x3d2d('0x10'));logger[_0x3d2d('0x11')](_0x3d2d('0x12'),_0x103b27,'request\x20sent',JSON[_0x3d2d('0x13')](_0x446da4));if(_0x446da4[_0x3d2d('0x14')]){if(_0x446da4[_0x3d2d('0x14')][_0x3d2d('0x15')]===0x1f4){logger[_0x3d2d('0x14')]('ChatApplication,\x20%s,\x20%s',_0x103b27,_0x446da4['error']['message']);return _0x592f9e(_0x446da4['error'][_0x3d2d('0x16')]);}logger['error'](_0x3d2d('0xf'),_0x103b27,_0x446da4['error'][_0x3d2d('0x16')]);return _0x53f509(_0x446da4['error']['message']);}else{logger[_0x3d2d('0xe')](_0x3d2d('0xf'),_0x103b27,_0x3d2d('0x10'));_0x53f509(_0x446da4['result'][_0x3d2d('0x16')]);}})[_0x3d2d('0x17')](function(_0x362f64){logger[_0x3d2d('0x14')]('ChatApplication,\x20%s,\x20%s',_0x103b27,_0x362f64);_0x592f9e(_0x362f64);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 930e402..c1af479 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 _0x0d62=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer'];(function(_0x24a7a4,_0x4b23ac){var _0x23aa4a=function(_0x3cc01f){while(--_0x3cc01f){_0x24a7a4['push'](_0x24a7a4['shift']());}};_0x23aa4a(++_0x4b23ac);}(_0x0d62,0x98));var _0x20d6=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x0d62[_0x34843e];return _0x598f7f;};'use strict';var multer=require(_0x20d6('0x0'));var util=require(_0x20d6('0x1'));var path=require('path');var timeout=require(_0x20d6('0x2'));var express=require(_0x20d6('0x3'));var router=express[_0x20d6('0x4')]();var auth=require(_0x20d6('0x5'));var interaction=require(_0x20d6('0x6'));var config=require('../../config/environment');var controller=require(_0x20d6('0x7'));router[_0x20d6('0x8')](_0x20d6('0x9'),auth[_0x20d6('0xa')](),controller[_0x20d6('0xb')]);router[_0x20d6('0xc')]('/:id',auth[_0x20d6('0xa')](),controller[_0x20d6('0xd')]);router[_0x20d6('0xe')](_0x20d6('0x9'),auth[_0x20d6('0xa')](),controller[_0x20d6('0xf')]);module[_0x20d6('0x10')]=router; \ No newline at end of file +var _0x240e=['../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','exports','util','connect-timeout','Router','../../components/interaction/service'];(function(_0x9a23df,_0x2edc93){var _0x44c94e=function(_0xb17494){while(--_0xb17494){_0x9a23df['push'](_0x9a23df['shift']());}};_0x44c94e(++_0x2edc93);}(_0x240e,0x96));var _0xe240=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x240e[_0x243b2f];return _0xcb3c2d;};'use strict';var multer=require('multer');var util=require(_0xe240('0x0'));var path=require('path');var timeout=require(_0xe240('0x1'));var express=require('express');var router=express[_0xe240('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xe240('0x3'));var config=require(_0xe240('0x4'));var controller=require(_0xe240('0x5'));router[_0xe240('0x6')](_0xe240('0x7'),auth[_0xe240('0x8')](),controller[_0xe240('0x9')]);router['put'](_0xe240('0x7'),auth[_0xe240('0x8')](),controller['update']);router['delete']('/:id',auth[_0xe240('0x8')](),controller['destroy']);module[_0xe240('0xa')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 82a8ed6..14aadb2 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 _0xea86=['BOOLEAN','exports','STRING'];(function(_0x2c9531,_0x3554a8){var _0x5c4723=function(_0x1a054a){while(--_0x1a054a){_0x2c9531['push'](_0x2c9531['shift']());}};_0x5c4723(++_0x3554a8);}(_0xea86,0x1d8));var _0x6ea8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xea86[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x6ea8('0x0')]={'name':{'type':Sequelize[_0x6ea8('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x6ea8('0x1')]},'write':{'type':Sequelize[_0x6ea8('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xe18f=['BOOLEAN','sequelize','STRING'];(function(_0x1b423d,_0x3d43c2){var _0x5312b7=function(_0x26423c){while(--_0x26423c){_0x1b423d['push'](_0x1b423d['shift']());}};_0x5312b7(++_0x3d43c2);}(_0xe18f,0x169));var _0xfe18=function(_0x266347,_0x52de7a){_0x266347=_0x266347-0x0;var _0x32eb07=_0xe18f[_0x266347];return _0x32eb07;};'use strict';var Sequelize=require(_0xfe18('0x0'));module['exports']={'name':{'type':Sequelize[_0xfe18('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xfe18('0x1')]},'write':{'type':Sequelize[_0xfe18('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 ae15c54..441e735 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 _0x697c=['addMessage','ChatGroupId','$gte','split','getMessages','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','set','apply','reject','save','update','name','map','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','merge','ChatGroup','count','includeAll','include','findAll','rows','show','options','find','create','body','params','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','findOne','User','pick','filter','getMembers','removeMembers'];(function(_0x164af1,_0x3cf772){var _0x5d81a2=function(_0xa57547){while(--_0xa57547){_0x164af1['push'](_0x164af1['shift']());}};_0x5d81a2(++_0x3cf772);}(_0x697c,0x6d));var _0xc697=function(_0x3f0123,_0x4a8c0e){_0x3f0123=_0x3f0123-0x0;var _0x397eb9=_0x697c[_0x3f0123];return _0x397eb9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc697('0x0'));var rimraf=require(_0xc697('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc697('0x2'));var rp=require(_0xc697('0x3'));var moment=require(_0xc697('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc697('0x5'));var util=require(_0xc697('0x6'));var path=require(_0xc697('0x7'));var sox=require(_0xc697('0x8'));var csv=require(_0xc697('0x9'));var ejs=require(_0xc697('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc697('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc697('0x9'));var querystring=require(_0xc697('0xc'));var Papa=require(_0xc697('0xd'));var Redis=require(_0xc697('0xe'));var authService=require(_0xc697('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc697('0x10'));var hardwareService=require(_0xc697('0x11'));var logger=require(_0xc697('0x12'))(_0xc697('0x13'));var utils=require(_0xc697('0x14'));var config=require(_0xc697('0x15'));var db=require(_0xc697('0x16'))['db'];config[_0xc697('0x17')]=_[_0xc697('0x18')](config[_0xc697('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xc697('0x19'))(new Redis(config[_0xc697('0x17')]));require(_0xc697('0x1a'))[_0xc697('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc697('0x1c')][_0xc697('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x15d50a,_0xec576e,_0x1140a8){if(_0x1140a8){var _0x4b8353=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4b8353[_0xc697('0x1e')](_0xec576e)){return _0x15d50a;}else{throw new db['Sequelize']['ValidationError'](_0xc697('0x1f'));}}else{return _0x15d50a;}}function respondWithRpcPromise(_0x45438e,_0x1a1e26,_0x2818a8,_0x18afc4){return new BPromise(function(_0x5c5044,_0xdb95e9){var _0x9c26c5=_0x18afc4||client;return _0x9c26c5[_0xc697('0x20')](_0x45438e,_0x2818a8)[_0xc697('0x21')](function(_0x1ee0d0){logger[_0xc697('0x22')](_0xc697('0x23'),_0x1a1e26,_0xc697('0x24'));logger[_0xc697('0x25')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x1a1e26,_0xc697('0x24'),JSON[_0xc697('0x26')](_0x1ee0d0));if(_0x1ee0d0[_0xc697('0x27')]){if(_0x1ee0d0[_0xc697('0x27')][_0xc697('0x28')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x1a1e26,_0x1ee0d0[_0xc697('0x27')][_0xc697('0x29')]);return _0xdb95e9(_0x1ee0d0[_0xc697('0x27')][_0xc697('0x29')]);}logger[_0xc697('0x27')]('ChatGroup,\x20%s,\x20%s',_0x1a1e26,_0x1ee0d0[_0xc697('0x27')][_0xc697('0x29')]);return _0x5c5044(_0x1ee0d0[_0xc697('0x27')][_0xc697('0x29')]);}else{logger[_0xc697('0x22')]('ChatGroup,\x20%s,\x20%s',_0x1a1e26,'request\x20sent');_0x5c5044(_0x1ee0d0[_0xc697('0x2a')][_0xc697('0x29')]);}})[_0xc697('0x2b')](function(_0x1099ba){logger[_0xc697('0x27')](_0xc697('0x23'),_0x1a1e26,_0x1099ba);_0xdb95e9(_0x1099ba);});});}function respondWithStatusCode(_0x2a6a7d,_0x4f28f6){_0x4f28f6=_0x4f28f6||0xcc;return function(_0x238773){if(_0x238773){return _0x2a6a7d[_0xc697('0x2c')](_0x4f28f6);}return _0x2a6a7d[_0xc697('0x2d')](_0x4f28f6)[_0xc697('0x2e')]();};}function respondWithResult(_0x57d98a,_0x41cf92){_0x41cf92=_0x41cf92||0xc8;return function(_0x20e9f6){if(_0x20e9f6){return _0x57d98a['status'](_0x41cf92)['json'](_0x20e9f6);}};}function respondWithFilteredResult(_0x248d19,_0x1d8606){return function(_0x126193){if(_0x126193){var _0x34cf5d=_0x126193['count'],_0x3cb2ea=_0x1d8606[_0xc697('0x2f')],_0x3c1cfd=_0x1d8606[_0xc697('0x2f')]+_0x1d8606[_0xc697('0x30')],_0x57214e;if(_0x3c1cfd>=_0x34cf5d){_0x3c1cfd=_0x34cf5d;_0x57214e=0xc8;}else{_0x57214e=0xce;}_0x248d19[_0xc697('0x2d')](_0x57214e);return _0x248d19[_0xc697('0x31')]('Content-Range',_0x3cb2ea+'-'+_0x3c1cfd+'/'+_0x34cf5d)['json'](_0x126193);}return null;};}function patchUpdates(_0x576065){return function(_0x4029ec){try{jsonpatch[_0xc697('0x32')](_0x4029ec,_0x576065,!![]);}catch(_0x17a113){return BPromise[_0xc697('0x33')](_0x17a113);}return _0x4029ec[_0xc697('0x34')]();};}function saveUpdates(_0x4d6e7a,_0x410195){return function(_0x3e782e){if(_0x3e782e){return _0x3e782e[_0xc697('0x35')](_0x4d6e7a)['then'](function(_0x3756ec){return _0x3756ec;});}return null;};}function removeEntity(_0x407271,_0x4dff4e){return function(_0x415151){if(_0x415151){return _0x415151['destroy']()[_0xc697('0x21')](function(){_0x407271[_0xc697('0x2d')](0xcc)[_0xc697('0x2e')]();});}};}function handleEntityNotFound(_0x453a98,_0x532d70){return function(_0xa986ca){if(!_0xa986ca){_0x453a98[_0xc697('0x2c')](0x194);}return _0xa986ca;};}function handleError(_0x5b8390,_0x34b854){_0x34b854=_0x34b854||0x1f4;return function(_0xae1ca2){logger[_0xc697('0x27')](_0xae1ca2['stack']);if(_0xae1ca2[_0xc697('0x36')]){delete _0xae1ca2['name'];}_0x5b8390[_0xc697('0x2d')](_0x34b854)['send'](_0xae1ca2);};}exports['index']=function(_0x1450f5,_0xb8febc){var _0x1417a4={},_0x5d5800={},_0x574d16={'count':0x0,'rows':[]};var _0x5bb860=_[_0xc697('0x37')](db['ChatGroup'][_0xc697('0x38')],function(_0x12d7fa){return{'name':_0x12d7fa['fieldName'],'type':_0x12d7fa['type']['key']};});_0x5d5800['model']=_[_0xc697('0x37')](_0x5bb860,'name');_0x5d5800[_0xc697('0x39')]=_[_0xc697('0x3a')](_0x1450f5[_0xc697('0x39')]);_0x5d5800[_0xc697('0x3b')]=_[_0xc697('0x3c')](_0x5d5800[_0xc697('0x3d')],_0x5d5800[_0xc697('0x39')]);_0x1417a4[_0xc697('0x3e')]=_['intersection'](_0x5d5800[_0xc697('0x3d')],qs[_0xc697('0x3f')](_0x1450f5[_0xc697('0x39')][_0xc697('0x3f')]));_0x1417a4[_0xc697('0x3e')]=_0x1417a4[_0xc697('0x3e')][_0xc697('0x40')]?_0x1417a4[_0xc697('0x3e')]:_0x5d5800[_0xc697('0x3d')];if(!_0x1450f5[_0xc697('0x39')][_0xc697('0x41')](_0xc697('0x42'))){_0x1417a4[_0xc697('0x30')]=qs['limit'](_0x1450f5[_0xc697('0x39')][_0xc697('0x30')]);_0x1417a4['offset']=qs['offset'](_0x1450f5[_0xc697('0x39')][_0xc697('0x2f')]);}_0x1417a4[_0xc697('0x43')]=qs['sort'](_0x1450f5['query'][_0xc697('0x44')]);_0x1417a4['where']=qs[_0xc697('0x3b')](_['pick'](_0x1450f5[_0xc697('0x39')],_0x5d5800['filters']));if(_0x1450f5[_0xc697('0x39')]['filter']){_0x1417a4[_0xc697('0x45')]=_['merge'](_0x1417a4[_0xc697('0x45')],{'$or':_[_0xc697('0x37')](_0x5bb860,function(_0x552f0d){if(_0x552f0d[_0xc697('0x46')]!==_0xc697('0x47')){var _0x4a107f={};_0x4a107f[_0x552f0d[_0xc697('0x36')]]={'$like':'%'+_0x1450f5[_0xc697('0x39')]['filter']+'%'};return _0x4a107f;}})});}_0x1417a4=_[_0xc697('0x48')]({},_0x1417a4,_0x1450f5['options']);var _0x43f67a={'where':_0x1417a4[_0xc697('0x45')]};return db[_0xc697('0x49')][_0xc697('0x4a')](_0x43f67a)[_0xc697('0x21')](function(_0x3e8e12){_0x574d16[_0xc697('0x4a')]=_0x3e8e12;if(_0x1450f5['query'][_0xc697('0x4b')]){_0x1417a4[_0xc697('0x4c')]=[{'all':!![]}];}return db[_0xc697('0x49')][_0xc697('0x4d')](_0x1417a4);})[_0xc697('0x21')](function(_0x175fb){_0x574d16[_0xc697('0x4e')]=_0x175fb;return _0x574d16;})[_0xc697('0x21')](respondWithFilteredResult(_0xb8febc,_0x1417a4))['catch'](handleError(_0xb8febc,null));};exports[_0xc697('0x4f')]=function(_0x380c5c,_0x46da5c){var _0x1e01b8={'raw':!![],'where':{'id':_0x380c5c['params']['id']}},_0x1e1b5f={};_0x1e1b5f[_0xc697('0x3d')]=_[_0xc697('0x3a')](db['ChatGroup'][_0xc697('0x38')]);_0x1e1b5f[_0xc697('0x39')]=_[_0xc697('0x3a')](_0x380c5c[_0xc697('0x39')]);_0x1e1b5f[_0xc697('0x3b')]=_[_0xc697('0x3c')](_0x1e1b5f[_0xc697('0x3d')],_0x1e1b5f[_0xc697('0x39')]);_0x1e01b8[_0xc697('0x3e')]=_['intersection'](_0x1e1b5f[_0xc697('0x3d')],qs[_0xc697('0x3f')](_0x380c5c['query'][_0xc697('0x3f')]));_0x1e01b8[_0xc697('0x3e')]=_0x1e01b8[_0xc697('0x3e')]['length']?_0x1e01b8[_0xc697('0x3e')]:_0x1e1b5f[_0xc697('0x3d')];if(_0x380c5c[_0xc697('0x39')][_0xc697('0x4b')]){_0x1e01b8[_0xc697('0x4c')]=[{'all':!![]}];}_0x1e01b8=_[_0xc697('0x48')]({},_0x1e01b8,_0x380c5c[_0xc697('0x50')]);return db['ChatGroup'][_0xc697('0x51')](_0x1e01b8)[_0xc697('0x21')](handleEntityNotFound(_0x46da5c,null))['then'](respondWithResult(_0x46da5c,null))[_0xc697('0x2b')](handleError(_0x46da5c,null));};exports[_0xc697('0x52')]=function(_0x47b611,_0x4a03ff){return db[_0xc697('0x49')][_0xc697('0x52')](_0x47b611[_0xc697('0x53')],{})[_0xc697('0x21')](respondWithResult(_0x4a03ff,0xc9))['catch'](handleError(_0x4a03ff,null));};exports[_0xc697('0x35')]=function(_0x4f1442,_0x4f983a){if(_0x4f1442['body']['id']){delete _0x4f1442['body']['id'];}return db[_0xc697('0x49')][_0xc697('0x51')]({'where':{'id':_0x4f1442[_0xc697('0x54')]['id']}})[_0xc697('0x21')](handleEntityNotFound(_0x4f983a,null))['then'](saveUpdates(_0x4f1442[_0xc697('0x53')],null))['then'](respondWithResult(_0x4f983a,null))[_0xc697('0x2b')](handleError(_0x4f983a,null));};exports[_0xc697('0x55')]=function(_0x32fbb7,_0x16de8e){return db[_0xc697('0x49')]['find']({'where':{'id':_0x32fbb7[_0xc697('0x54')]['id']}})[_0xc697('0x21')](handleEntityNotFound(_0x16de8e,null))[_0xc697('0x21')](removeEntity(_0x16de8e,null))['catch'](handleError(_0x16de8e,null));};exports[_0xc697('0x56')]=function(_0x1175b6,_0x31d2a5){return db[_0xc697('0x49')][_0xc697('0x56')]()['then'](respondWithResult(_0x31d2a5,null))[_0xc697('0x2b')](handleError(_0x31d2a5,null));};exports[_0xc697('0x57')]=function(_0x41f540,_0x3a2c59,_0x1ba863){return db[_0xc697('0x58')][_0xc697('0x4a')]({'where':{'ChatGroupId':_0x41f540[_0xc697('0x54')]['id'],'ToId':_0x41f540[_0xc697('0x59')]['id'],'read':![]}})[_0xc697('0x21')](function(_0x53fa27){return{'id':_[_0xc697('0x5a')](_0x41f540[_0xc697('0x54')]['id']),'count':_0x53fa27};})['then'](respondWithResult(_0x3a2c59,null))['catch'](handleError(_0x3a2c59,null));};exports[_0xc697('0x5b')]=function(_0x426f8d,_0x5c2d7d,_0x23206f){return db[_0xc697('0x49')][_0xc697('0x51')]({'where':{'id':_0x426f8d['params']['id']}})['then'](handleEntityNotFound(_0x5c2d7d,null))['then'](function(_0x2cee78){if(_0x2cee78){return _0x2cee78[_0xc697('0x5b')](_0x426f8d[_0xc697('0x53')][_0xc697('0x5c')],_['omit'](_0x426f8d[_0xc697('0x53')],[_0xc697('0x5c'),'id'])||{});}})[_0xc697('0x21')](respondWithResult(_0x5c2d7d,null))[_0xc697('0x2b')](handleError(_0x5c2d7d,null));};exports['getMembers']=function(_0x31ef58,_0x125f5c,_0x58d1c4){var _0x10c099={};var _0x2b28df={};var _0x2cf44f;var _0xda221;return db[_0xc697('0x49')][_0xc697('0x5d')]({'where':{'id':_0x31ef58[_0xc697('0x54')]['id']}})['then'](handleEntityNotFound(_0x125f5c,null))[_0xc697('0x21')](function(_0x135df2){if(_0x135df2){_0x2cf44f=_0x135df2;_0x2b28df['model']=_['keys'](db[_0xc697('0x5e')]['rawAttributes']);_0x2b28df['query']=_[_0xc697('0x3a')](_0x31ef58[_0xc697('0x39')]);_0x2b28df['filters']=_[_0xc697('0x3c')](_0x2b28df[_0xc697('0x3d')],_0x2b28df[_0xc697('0x39')]);_0x10c099[_0xc697('0x3e')]=_['intersection'](_0x2b28df[_0xc697('0x3d')],qs[_0xc697('0x3f')](_0x31ef58[_0xc697('0x39')][_0xc697('0x3f')]));_0x10c099[_0xc697('0x3e')]=_0x10c099[_0xc697('0x3e')]['length']?_0x10c099[_0xc697('0x3e')]:_0x2b28df['model'];_0x10c099['order']=qs[_0xc697('0x44')](_0x31ef58['query']['sort']);_0x10c099['where']=qs[_0xc697('0x3b')](_[_0xc697('0x5f')](_0x31ef58[_0xc697('0x39')],_0x2b28df[_0xc697('0x3b')]));if(_0x31ef58[_0xc697('0x39')][_0xc697('0x60')]){_0x10c099[_0xc697('0x45')]=_[_0xc697('0x48')](_0x10c099[_0xc697('0x45')],{'$or':_['map'](_0x10c099['attributes'],function(_0x25a092){var _0x494831={};_0x494831[_0x25a092]={'$like':'%'+_0x31ef58[_0xc697('0x39')][_0xc697('0x60')]+'%'};return _0x494831;})});}_0x10c099=_[_0xc697('0x48')]({},_0x10c099,_0x31ef58[_0xc697('0x50')]);return _0x2cf44f[_0xc697('0x61')](_0x10c099);}})[_0xc697('0x21')](function(_0xede0d){if(_0xede0d){_0xda221=_0xede0d[_0xc697('0x40')];if(!_0x31ef58[_0xc697('0x39')][_0xc697('0x41')]('nolimit')){_0x10c099['limit']=qs[_0xc697('0x30')](_0x31ef58[_0xc697('0x39')][_0xc697('0x30')]);_0x10c099['offset']=qs[_0xc697('0x2f')](_0x31ef58[_0xc697('0x39')][_0xc697('0x2f')]);}return _0x2cf44f['getMembers'](_0x10c099);}})[_0xc697('0x21')](function(_0x499cb2){if(_0x499cb2){return _0x499cb2?{'count':_0xda221,'rows':_0x499cb2}:null;}})['then'](respondWithResult(_0x125f5c,null))[_0xc697('0x2b')](handleError(_0x125f5c,null));};exports['removeMembers']=function(_0x2dd3bf,_0x2cc217,_0x168729){return db['ChatGroup'][_0xc697('0x51')]({'where':{'id':_0x2dd3bf[_0xc697('0x54')]['id']}})[_0xc697('0x21')](handleEntityNotFound(_0x2cc217,null))[_0xc697('0x21')](function(_0x72b90c){if(_0x72b90c){return _0x72b90c[_0xc697('0x62')](_0x2dd3bf[_0xc697('0x39')][_0xc697('0x5c')]);}})[_0xc697('0x21')](respondWithStatusCode(_0x2cc217,null))['catch'](handleError(_0x2cc217,null));};exports[_0xc697('0x63')]=function(_0x2a407e,_0x13bf70,_0x4ff0ef){if(_0x2a407e[_0xc697('0x53')]['id']){delete _0x2a407e[_0xc697('0x53')]['id'];}return db[_0xc697('0x49')][_0xc697('0x51')]({'where':{'id':_0x2a407e[_0xc697('0x54')]['id']}})['then'](handleEntityNotFound(_0x13bf70,null))['then'](function(_0x3e7c73){if(_0x3e7c73){_0x2a407e['body'][_0xc697('0x64')]=_0x3e7c73['id'];return db['ChatInternalMessage']['create'](_0x2a407e[_0xc697('0x53')]);}})[_0xc697('0x21')](respondWithResult(_0x13bf70,null))[_0xc697('0x2b')](handleError(_0x13bf70,null));};exports['getMessages']=function(_0x28a9d5,_0x56c83e,_0x1d2b4c){var _0x224149={};var _0x1312d7={};var _0x1c51cc;var _0x11ad16;return db[_0xc697('0x49')][_0xc697('0x5d')]({'where':{'id':_0x28a9d5[_0xc697('0x54')]['id']}})[_0xc697('0x21')](handleEntityNotFound(_0x56c83e,null))[_0xc697('0x21')](function(_0xddb468){if(_0xddb468){_0x1c51cc=_0xddb468;_0x1312d7[_0xc697('0x3d')]=_[_0xc697('0x3a')](db['ChatInternalMessage'][_0xc697('0x38')]);_0x1312d7[_0xc697('0x39')]=_[_0xc697('0x3a')](_0x28a9d5[_0xc697('0x39')]);_0x1312d7['filters']=_[_0xc697('0x3c')](_0x1312d7['model'],_0x1312d7['query']);_0x224149[_0xc697('0x3e')]=_['intersection'](_0x1312d7[_0xc697('0x3d')],qs[_0xc697('0x3f')](_0x28a9d5[_0xc697('0x39')][_0xc697('0x3f')]));_0x224149[_0xc697('0x3e')]=_0x224149[_0xc697('0x3e')][_0xc697('0x40')]?_0x224149[_0xc697('0x3e')]:_0x1312d7['model'];_0x224149[_0xc697('0x43')]=qs[_0xc697('0x44')](_0x28a9d5[_0xc697('0x39')][_0xc697('0x44')]);_0x224149['where']=qs[_0xc697('0x3b')](_[_0xc697('0x5f')](_0x28a9d5[_0xc697('0x39')],_0x1312d7[_0xc697('0x3b')]));if(_0x28a9d5['query'][_0xc697('0x60')]){_0x224149[_0xc697('0x45')]=_[_0xc697('0x48')](_0x224149[_0xc697('0x45')],{'$or':_[_0xc697('0x37')](_0x224149[_0xc697('0x3e')],function(_0x116e4d){var _0x4b18bc={};_0x4b18bc[_0x116e4d]={'$like':'%'+_0x28a9d5[_0xc697('0x39')][_0xc697('0x60')]+'%'};return _0x4b18bc;})});}if(_0x28a9d5[_0xc697('0x39')][_0xc697('0x65')]){var _0xdb92e5=_0x28a9d5[_0xc697('0x39')][_0xc697('0x65')][_0xc697('0x66')](',');var _0x56dda8={};_0x56dda8[_0xdb92e5[0x0]]={'$gte':moment(_0xdb92e5[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x224149['where']=_[_0xc697('0x48')](_0x224149['where'],_0x56dda8);}_0x224149=_['merge']({},_0x224149,_0x28a9d5[_0xc697('0x50')]);return _0x1c51cc[_0xc697('0x67')](_0x224149);}})[_0xc697('0x21')](function(_0x409a9b){if(_0x409a9b){_0x11ad16=_0x409a9b['length'];if(!_0x28a9d5[_0xc697('0x39')][_0xc697('0x41')](_0xc697('0x42'))){_0x224149[_0xc697('0x30')]=qs[_0xc697('0x30')](_0x28a9d5[_0xc697('0x39')][_0xc697('0x30')]);_0x224149[_0xc697('0x2f')]=qs[_0xc697('0x2f')](_0x28a9d5[_0xc697('0x39')]['offset']);}return _0x1c51cc[_0xc697('0x67')](_0x224149);}})[_0xc697('0x21')](function(_0x48d562){if(_0x48d562){return _0x48d562?{'count':_0x11ad16,'rows':_0x48d562}:null;}})[_0xc697('0x21')](respondWithResult(_0x56c83e,null))['catch'](handleError(_0x56c83e,null));}; \ No newline at end of file +var _0x48a2=['rows','params','length','find','catch','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','merge','removeMembers','addMessage','ChatGroupId','getMessages','findOne','order','$gte','split','eml-format','rimraf','moment','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','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','register','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','findAll'];(function(_0x215dc8,_0x52c245){var _0x583ea3=function(_0x32350d){while(--_0x32350d){_0x215dc8['push'](_0x215dc8['shift']());}};_0x583ea3(++_0x52c245);}(_0x48a2,0x1bc));var _0x248a=function(_0x17b0d4,_0x377add){_0x17b0d4=_0x17b0d4-0x0;var _0x2d02c7=_0x48a2[_0x17b0d4];return _0x2d02c7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x248a('0x0'));var rimraf=require(_0x248a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x248a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x248a('0x3'));var util=require(_0x248a('0x4'));var path=require(_0x248a('0x5'));var sox=require('sox');var csv=require(_0x248a('0x6'));var ejs=require(_0x248a('0x7'));var fs=require('fs');var _=require(_0x248a('0x8'));var squel=require('squel');var crypto=require(_0x248a('0x9'));var jsforce=require(_0x248a('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x248a('0xb'));var authService=require(_0x248a('0xc'));var qs=require(_0x248a('0xd'));var as=require(_0x248a('0xe'));var hardwareService=require(_0x248a('0xf'));var logger=require(_0x248a('0x10'))(_0x248a('0x11'));var utils=require(_0x248a('0x12'));var config=require('../../config/environment');var db=require(_0x248a('0x13'))['db'];config[_0x248a('0x14')]=_[_0x248a('0x15')](config[_0x248a('0x14')],{'host':_0x248a('0x16'),'port':0x18eb});var socket=require(_0x248a('0x17'))(new Redis(config[_0x248a('0x14')]));require('./chatGroup.socket')[_0x248a('0x18')](socket);var jayson=require(_0x248a('0x19'));var client=jayson[_0x248a('0x1a')][_0x248a('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x566027,_0x19b150,_0x2517a9){if(_0x2517a9){var _0x25b5aa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25b5aa[_0x248a('0x1c')](_0x19b150)){return _0x566027;}else{throw new db[(_0x248a('0x1d'))][(_0x248a('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 _0x566027;}}function respondWithRpcPromise(_0x4f5a3c,_0x3fa327,_0x1da78d,_0x3d302b){return new BPromise(function(_0x272bed,_0x13fc5c){var _0x4eabba=_0x3d302b||client;return _0x4eabba[_0x248a('0x1f')](_0x4f5a3c,_0x1da78d)[_0x248a('0x20')](function(_0x3b1364){logger[_0x248a('0x21')](_0x248a('0x22'),_0x3fa327,'request\x20sent');logger[_0x248a('0x23')](_0x248a('0x24'),_0x3fa327,_0x248a('0x25'),JSON[_0x248a('0x26')](_0x3b1364));if(_0x3b1364[_0x248a('0x27')]){if(_0x3b1364['error']['code']===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x3fa327,_0x3b1364['error'][_0x248a('0x28')]);return _0x13fc5c(_0x3b1364[_0x248a('0x27')][_0x248a('0x28')]);}logger['error'](_0x248a('0x22'),_0x3fa327,_0x3b1364[_0x248a('0x27')][_0x248a('0x28')]);return _0x272bed(_0x3b1364[_0x248a('0x27')]['message']);}else{logger[_0x248a('0x21')](_0x248a('0x22'),_0x3fa327,_0x248a('0x25'));_0x272bed(_0x3b1364[_0x248a('0x29')]['message']);}})['catch'](function(_0xd9658){logger[_0x248a('0x27')](_0x248a('0x22'),_0x3fa327,_0xd9658);_0x13fc5c(_0xd9658);});});}function respondWithStatusCode(_0xead67c,_0xff4de9){_0xff4de9=_0xff4de9||0xcc;return function(_0x55dcd2){if(_0x55dcd2){return _0xead67c[_0x248a('0x2a')](_0xff4de9);}return _0xead67c[_0x248a('0x2b')](_0xff4de9)[_0x248a('0x2c')]();};}function respondWithResult(_0x53d024,_0x388dbd){_0x388dbd=_0x388dbd||0xc8;return function(_0x592436){if(_0x592436){return _0x53d024[_0x248a('0x2b')](_0x388dbd)[_0x248a('0x2d')](_0x592436);}};}function respondWithFilteredResult(_0x377e1d,_0x1113f1){return function(_0x1aa9cc){if(_0x1aa9cc){var _0x8cac1d=_0x1aa9cc[_0x248a('0x2e')],_0x39fe87=_0x1113f1[_0x248a('0x2f')],_0x5a6b58=_0x1113f1[_0x248a('0x2f')]+_0x1113f1['limit'],_0x446af1;if(_0x5a6b58>=_0x8cac1d){_0x5a6b58=_0x8cac1d;_0x446af1=0xc8;}else{_0x446af1=0xce;}_0x377e1d[_0x248a('0x2b')](_0x446af1);return _0x377e1d[_0x248a('0x30')](_0x248a('0x31'),_0x39fe87+'-'+_0x5a6b58+'/'+_0x8cac1d)[_0x248a('0x2d')](_0x1aa9cc);}return null;};}function patchUpdates(_0xf47cbf){return function(_0x319952){try{jsonpatch[_0x248a('0x32')](_0x319952,_0xf47cbf,!![]);}catch(_0x489a0f){return BPromise[_0x248a('0x33')](_0x489a0f);}return _0x319952['save']();};}function saveUpdates(_0x57c5cb,_0xd2ef6e){return function(_0x6f6442){if(_0x6f6442){return _0x6f6442[_0x248a('0x34')](_0x57c5cb)[_0x248a('0x20')](function(_0x3932e9){return _0x3932e9;});}return null;};}function removeEntity(_0x8c0e0b,_0x166780){return function(_0x3c1986){if(_0x3c1986){return _0x3c1986[_0x248a('0x35')]()[_0x248a('0x20')](function(){_0x8c0e0b['status'](0xcc)[_0x248a('0x2c')]();});}};}function handleEntityNotFound(_0x11df92,_0x181d84){return function(_0x265255){if(!_0x265255){_0x11df92[_0x248a('0x2a')](0x194);}return _0x265255;};}function handleError(_0x7761ec,_0x302850){_0x302850=_0x302850||0x1f4;return function(_0x459bd9){logger['error'](_0x459bd9[_0x248a('0x36')]);if(_0x459bd9[_0x248a('0x37')]){delete _0x459bd9[_0x248a('0x37')];}_0x7761ec[_0x248a('0x2b')](_0x302850)[_0x248a('0x38')](_0x459bd9);};}exports[_0x248a('0x39')]=function(_0x388e29,_0x4e2482){var _0x4d9940={},_0x22c45b={},_0x1af3fd={'count':0x0,'rows':[]};var _0x37d98e=_[_0x248a('0x3a')](db[_0x248a('0x3b')][_0x248a('0x3c')],function(_0x17f639){return{'name':_0x17f639[_0x248a('0x3d')],'type':_0x17f639[_0x248a('0x3e')]['key']};});_0x22c45b[_0x248a('0x3f')]=_['map'](_0x37d98e,_0x248a('0x37'));_0x22c45b['query']=_[_0x248a('0x40')](_0x388e29[_0x248a('0x41')]);_0x22c45b['filters']=_['intersection'](_0x22c45b[_0x248a('0x3f')],_0x22c45b['query']);_0x4d9940[_0x248a('0x42')]=_[_0x248a('0x43')](_0x22c45b['model'],qs[_0x248a('0x44')](_0x388e29[_0x248a('0x41')][_0x248a('0x44')]));_0x4d9940[_0x248a('0x42')]=_0x4d9940['attributes']['length']?_0x4d9940[_0x248a('0x42')]:_0x22c45b[_0x248a('0x3f')];if(!_0x388e29[_0x248a('0x41')][_0x248a('0x45')](_0x248a('0x46'))){_0x4d9940[_0x248a('0x47')]=qs['limit'](_0x388e29['query'][_0x248a('0x47')]);_0x4d9940[_0x248a('0x2f')]=qs[_0x248a('0x2f')](_0x388e29[_0x248a('0x41')][_0x248a('0x2f')]);}_0x4d9940['order']=qs[_0x248a('0x48')](_0x388e29['query'][_0x248a('0x48')]);_0x4d9940[_0x248a('0x49')]=qs[_0x248a('0x4a')](_[_0x248a('0x4b')](_0x388e29[_0x248a('0x41')],_0x22c45b[_0x248a('0x4a')]));if(_0x388e29[_0x248a('0x41')][_0x248a('0x4c')]){_0x4d9940[_0x248a('0x49')]=_['merge'](_0x4d9940[_0x248a('0x49')],{'$or':_[_0x248a('0x3a')](_0x37d98e,function(_0x1a6550){if(_0x1a6550['type']!==_0x248a('0x4d')){var _0x4652ad={};_0x4652ad[_0x1a6550[_0x248a('0x37')]]={'$like':'%'+_0x388e29[_0x248a('0x41')][_0x248a('0x4c')]+'%'};return _0x4652ad;}})});}_0x4d9940=_['merge']({},_0x4d9940,_0x388e29[_0x248a('0x4e')]);var _0x4401a2={'where':_0x4d9940[_0x248a('0x49')]};return db['ChatGroup'][_0x248a('0x2e')](_0x4401a2)['then'](function(_0x249331){_0x1af3fd[_0x248a('0x2e')]=_0x249331;if(_0x388e29[_0x248a('0x41')][_0x248a('0x4f')]){_0x4d9940['include']=[{'all':!![]}];}return db[_0x248a('0x3b')][_0x248a('0x50')](_0x4d9940);})[_0x248a('0x20')](function(_0x31cb83){_0x1af3fd[_0x248a('0x51')]=_0x31cb83;return _0x1af3fd;})[_0x248a('0x20')](respondWithFilteredResult(_0x4e2482,_0x4d9940))['catch'](handleError(_0x4e2482,null));};exports['show']=function(_0xefccc3,_0x58a785){var _0x56d553={'raw':!![],'where':{'id':_0xefccc3[_0x248a('0x52')]['id']}},_0x33edb0={};_0x33edb0[_0x248a('0x3f')]=_[_0x248a('0x40')](db[_0x248a('0x3b')]['rawAttributes']);_0x33edb0['query']=_[_0x248a('0x40')](_0xefccc3[_0x248a('0x41')]);_0x33edb0[_0x248a('0x4a')]=_[_0x248a('0x43')](_0x33edb0[_0x248a('0x3f')],_0x33edb0[_0x248a('0x41')]);_0x56d553[_0x248a('0x42')]=_['intersection'](_0x33edb0['model'],qs['fields'](_0xefccc3[_0x248a('0x41')]['fields']));_0x56d553[_0x248a('0x42')]=_0x56d553[_0x248a('0x42')][_0x248a('0x53')]?_0x56d553['attributes']:_0x33edb0[_0x248a('0x3f')];if(_0xefccc3[_0x248a('0x41')][_0x248a('0x4f')]){_0x56d553['include']=[{'all':!![]}];}_0x56d553=_['merge']({},_0x56d553,_0xefccc3['options']);return db[_0x248a('0x3b')][_0x248a('0x54')](_0x56d553)[_0x248a('0x20')](handleEntityNotFound(_0x58a785,null))[_0x248a('0x20')](respondWithResult(_0x58a785,null))[_0x248a('0x55')](handleError(_0x58a785,null));};exports[_0x248a('0x56')]=function(_0x246a0b,_0x375e71){return db['ChatGroup'][_0x248a('0x56')](_0x246a0b[_0x248a('0x57')],{})['then'](respondWithResult(_0x375e71,0xc9))[_0x248a('0x55')](handleError(_0x375e71,null));};exports['update']=function(_0x3a6377,_0x4a2936){if(_0x3a6377['body']['id']){delete _0x3a6377[_0x248a('0x57')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x3a6377[_0x248a('0x52')]['id']}})[_0x248a('0x20')](handleEntityNotFound(_0x4a2936,null))[_0x248a('0x20')](saveUpdates(_0x3a6377[_0x248a('0x57')],null))[_0x248a('0x20')](respondWithResult(_0x4a2936,null))['catch'](handleError(_0x4a2936,null));};exports[_0x248a('0x35')]=function(_0x3e8c74,_0xc02483){return db[_0x248a('0x3b')][_0x248a('0x54')]({'where':{'id':_0x3e8c74[_0x248a('0x52')]['id']}})[_0x248a('0x20')](handleEntityNotFound(_0xc02483,null))[_0x248a('0x20')](removeEntity(_0xc02483,null))['catch'](handleError(_0xc02483,null));};exports[_0x248a('0x58')]=function(_0x3db440,_0xc5301d){return db['ChatGroup'][_0x248a('0x58')]()[_0x248a('0x20')](respondWithResult(_0xc5301d,null))[_0x248a('0x55')](handleError(_0xc5301d,null));};exports[_0x248a('0x59')]=function(_0x414f26,_0x6e7e64,_0x17a430){return db[_0x248a('0x5a')]['count']({'where':{'ChatGroupId':_0x414f26['params']['id'],'ToId':_0x414f26[_0x248a('0x5b')]['id'],'read':![]}})[_0x248a('0x20')](function(_0x4c47cb){return{'id':_[_0x248a('0x5c')](_0x414f26[_0x248a('0x52')]['id']),'count':_0x4c47cb};})['then'](respondWithResult(_0x6e7e64,null))[_0x248a('0x55')](handleError(_0x6e7e64,null));};exports[_0x248a('0x5d')]=function(_0x423216,_0xfcd96a,_0x297240){return db['ChatGroup']['find']({'where':{'id':_0x423216[_0x248a('0x52')]['id']}})[_0x248a('0x20')](handleEntityNotFound(_0xfcd96a,null))['then'](function(_0xa0c1b3){if(_0xa0c1b3){return _0xa0c1b3['addMembers'](_0x423216[_0x248a('0x57')][_0x248a('0x5e')],_['omit'](_0x423216[_0x248a('0x57')],[_0x248a('0x5e'),'id'])||{});}})[_0x248a('0x20')](respondWithResult(_0xfcd96a,null))['catch'](handleError(_0xfcd96a,null));};exports[_0x248a('0x5f')]=function(_0x23f6ba,_0x47d019,_0x7fa1eb){var _0x356ab6={};var _0x4e3586={};var _0x55e1dd;var _0x2255ee;return db[_0x248a('0x3b')]['findOne']({'where':{'id':_0x23f6ba['params']['id']}})['then'](handleEntityNotFound(_0x47d019,null))[_0x248a('0x20')](function(_0x85b210){if(_0x85b210){_0x55e1dd=_0x85b210;_0x4e3586['model']=_['keys'](db['User'][_0x248a('0x3c')]);_0x4e3586[_0x248a('0x41')]=_[_0x248a('0x40')](_0x23f6ba['query']);_0x4e3586[_0x248a('0x4a')]=_[_0x248a('0x43')](_0x4e3586[_0x248a('0x3f')],_0x4e3586[_0x248a('0x41')]);_0x356ab6[_0x248a('0x42')]=_['intersection'](_0x4e3586[_0x248a('0x3f')],qs[_0x248a('0x44')](_0x23f6ba[_0x248a('0x41')][_0x248a('0x44')]));_0x356ab6[_0x248a('0x42')]=_0x356ab6[_0x248a('0x42')][_0x248a('0x53')]?_0x356ab6[_0x248a('0x42')]:_0x4e3586[_0x248a('0x3f')];_0x356ab6['order']=qs[_0x248a('0x48')](_0x23f6ba[_0x248a('0x41')][_0x248a('0x48')]);_0x356ab6[_0x248a('0x49')]=qs['filters'](_[_0x248a('0x4b')](_0x23f6ba[_0x248a('0x41')],_0x4e3586[_0x248a('0x4a')]));if(_0x23f6ba[_0x248a('0x41')][_0x248a('0x4c')]){_0x356ab6[_0x248a('0x49')]=_[_0x248a('0x60')](_0x356ab6[_0x248a('0x49')],{'$or':_[_0x248a('0x3a')](_0x356ab6[_0x248a('0x42')],function(_0x497295){var _0x2cb076={};_0x2cb076[_0x497295]={'$like':'%'+_0x23f6ba['query'][_0x248a('0x4c')]+'%'};return _0x2cb076;})});}_0x356ab6=_[_0x248a('0x60')]({},_0x356ab6,_0x23f6ba[_0x248a('0x4e')]);return _0x55e1dd['getMembers'](_0x356ab6);}})['then'](function(_0x4a3983){if(_0x4a3983){_0x2255ee=_0x4a3983['length'];if(!_0x23f6ba[_0x248a('0x41')]['hasOwnProperty'](_0x248a('0x46'))){_0x356ab6[_0x248a('0x47')]=qs[_0x248a('0x47')](_0x23f6ba[_0x248a('0x41')]['limit']);_0x356ab6['offset']=qs['offset'](_0x23f6ba['query']['offset']);}return _0x55e1dd[_0x248a('0x5f')](_0x356ab6);}})[_0x248a('0x20')](function(_0x36cda5){if(_0x36cda5){return _0x36cda5?{'count':_0x2255ee,'rows':_0x36cda5}:null;}})[_0x248a('0x20')](respondWithResult(_0x47d019,null))[_0x248a('0x55')](handleError(_0x47d019,null));};exports[_0x248a('0x61')]=function(_0x4eb3b4,_0x3be04f,_0x36e655){return db[_0x248a('0x3b')]['find']({'where':{'id':_0x4eb3b4[_0x248a('0x52')]['id']}})['then'](handleEntityNotFound(_0x3be04f,null))[_0x248a('0x20')](function(_0x442826){if(_0x442826){return _0x442826['removeMembers'](_0x4eb3b4[_0x248a('0x41')][_0x248a('0x5e')]);}})[_0x248a('0x20')](respondWithStatusCode(_0x3be04f,null))[_0x248a('0x55')](handleError(_0x3be04f,null));};exports[_0x248a('0x62')]=function(_0x2c3e82,_0x2609e5,_0x37d8a7){if(_0x2c3e82['body']['id']){delete _0x2c3e82[_0x248a('0x57')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x2c3e82[_0x248a('0x52')]['id']}})[_0x248a('0x20')](handleEntityNotFound(_0x2609e5,null))[_0x248a('0x20')](function(_0x211c4a){if(_0x211c4a){_0x2c3e82[_0x248a('0x57')][_0x248a('0x63')]=_0x211c4a['id'];return db['ChatInternalMessage'][_0x248a('0x56')](_0x2c3e82[_0x248a('0x57')]);}})['then'](respondWithResult(_0x2609e5,null))[_0x248a('0x55')](handleError(_0x2609e5,null));};exports[_0x248a('0x64')]=function(_0x4c5d8b,_0x2d0360,_0x53bcab){var _0x40e4ef={};var _0xe0cb66={};var _0x524df2;var _0x3b3751;return db[_0x248a('0x3b')][_0x248a('0x65')]({'where':{'id':_0x4c5d8b[_0x248a('0x52')]['id']}})[_0x248a('0x20')](handleEntityNotFound(_0x2d0360,null))['then'](function(_0x38f183){if(_0x38f183){_0x524df2=_0x38f183;_0xe0cb66[_0x248a('0x3f')]=_[_0x248a('0x40')](db['ChatInternalMessage'][_0x248a('0x3c')]);_0xe0cb66['query']=_[_0x248a('0x40')](_0x4c5d8b[_0x248a('0x41')]);_0xe0cb66[_0x248a('0x4a')]=_[_0x248a('0x43')](_0xe0cb66[_0x248a('0x3f')],_0xe0cb66[_0x248a('0x41')]);_0x40e4ef[_0x248a('0x42')]=_['intersection'](_0xe0cb66[_0x248a('0x3f')],qs[_0x248a('0x44')](_0x4c5d8b[_0x248a('0x41')]['fields']));_0x40e4ef[_0x248a('0x42')]=_0x40e4ef[_0x248a('0x42')]['length']?_0x40e4ef[_0x248a('0x42')]:_0xe0cb66[_0x248a('0x3f')];_0x40e4ef[_0x248a('0x66')]=qs['sort'](_0x4c5d8b[_0x248a('0x41')]['sort']);_0x40e4ef[_0x248a('0x49')]=qs['filters'](_['pick'](_0x4c5d8b[_0x248a('0x41')],_0xe0cb66['filters']));if(_0x4c5d8b[_0x248a('0x41')][_0x248a('0x4c')]){_0x40e4ef[_0x248a('0x49')]=_[_0x248a('0x60')](_0x40e4ef[_0x248a('0x49')],{'$or':_[_0x248a('0x3a')](_0x40e4ef[_0x248a('0x42')],function(_0x54afec){var _0x323ee6={};_0x323ee6[_0x54afec]={'$like':'%'+_0x4c5d8b['query'][_0x248a('0x4c')]+'%'};return _0x323ee6;})});}if(_0x4c5d8b[_0x248a('0x41')][_0x248a('0x67')]){var _0x3c17d6=_0x4c5d8b['query'][_0x248a('0x67')][_0x248a('0x68')](',');var _0x4ba0c7={};_0x4ba0c7[_0x3c17d6[0x0]]={'$gte':moment(_0x3c17d6[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x40e4ef[_0x248a('0x49')]=_['merge'](_0x40e4ef[_0x248a('0x49')],_0x4ba0c7);}_0x40e4ef=_['merge']({},_0x40e4ef,_0x4c5d8b['options']);return _0x524df2[_0x248a('0x64')](_0x40e4ef);}})[_0x248a('0x20')](function(_0x2a7512){if(_0x2a7512){_0x3b3751=_0x2a7512[_0x248a('0x53')];if(!_0x4c5d8b[_0x248a('0x41')]['hasOwnProperty'](_0x248a('0x46'))){_0x40e4ef[_0x248a('0x47')]=qs[_0x248a('0x47')](_0x4c5d8b['query'][_0x248a('0x47')]);_0x40e4ef[_0x248a('0x2f')]=qs['offset'](_0x4c5d8b['query']['offset']);}return _0x524df2['getMessages'](_0x40e4ef);}})['then'](function(_0x30f7ad){if(_0x30f7ad){return _0x30f7ad?{'count':_0x3b3751,'rows':_0x30f7ad}:null;}})[_0x248a('0x20')](respondWithResult(_0x2d0360,null))['catch'](handleError(_0x2d0360,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index e6a7c26..ebd0c95 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 _0xdb28=['ChatGroup','setMaxListeners','update','remove','emit','exports','events','../../mysqldb'];(function(_0x3dbb5d,_0x4d5392){var _0x905117=function(_0x3387f7){while(--_0x3387f7){_0x3dbb5d['push'](_0x3dbb5d['shift']());}};_0x905117(++_0x4d5392);}(_0xdb28,0x106));var _0x8db2=function(_0xdf672b,_0x2de946){_0xdf672b=_0xdf672b-0x0;var _0x535246=_0xdb28[_0xdf672b];return _0x535246;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var ChatGroup=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db2('0x4'),'afterDestroy':_0x8db2('0x5')};function emitEvent(_0xfcf49f){return function(_0x4426fe,_0x11109e,_0x52bf99){ChatGroupEvents[_0x8db2('0x6')](_0xfcf49f+':'+_0x4426fe['id'],_0x4426fe);ChatGroupEvents[_0x8db2('0x6')](_0xfcf49f,_0x4426fe);_0x52bf99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x8db2('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0x0b0e=['ChatGroup','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x2a45d0,_0x4a89f1){var _0x5c4e2f=function(_0x3af60d){while(--_0x3af60d){_0x2a45d0['push'](_0x2a45d0['shift']());}};_0x5c4e2f(++_0x4a89f1);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5e8fc,_0x1ccc06){_0x5e8fc=_0x5e8fc-0x0;var _0x41c58c=_0x0b0e[_0x5e8fc];return _0x41c58c;};'use strict';var EventEmitter=require(_0xe0b0('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xe0b0('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe0b0('0x2'),'afterUpdate':_0xe0b0('0x3'),'afterDestroy':_0xe0b0('0x4')};function emitEvent(_0x25153a){return function(_0x28040c,_0x38a058,_0x399e67){ChatGroupEvents[_0xe0b0('0x5')](_0x25153a+':'+_0x28040c['id'],_0x28040c);ChatGroupEvents[_0xe0b0('0x5')](_0x25153a,_0x28040c);_0x399e67(null);};}for(var e in events){if(events[_0xe0b0('0x6')](e)){var event=events[e];ChatGroup[_0xe0b0('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 1250760..c9be526 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 _0xe0c3=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup','chat_groups'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe0c3,0xea));var _0x3e0c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe0c3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3e0c('0x0'));var util=require('util');var logger=require(_0x3e0c('0x1'))(_0x3e0c('0x2'));var moment=require(_0x3e0c('0x3'));var BPromise=require(_0x3e0c('0x4'));var rp=require(_0x3e0c('0x5'));var fs=require('fs');var path=require(_0x3e0c('0x6'));var rimraf=require(_0x3e0c('0x7'));var config=require(_0x3e0c('0x8'));var attributes=require(_0x3e0c('0x9'));module['exports']=function(_0x530ebf,_0x163adf){return _0x530ebf[_0x3e0c('0xa')](_0x3e0c('0xb'),attributes,{'tableName':_0x3e0c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3cd8=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups'];(function(_0x588823,_0x3c3011){var _0x5bfcff=function(_0x38b9ec){while(--_0x38b9ec){_0x588823['push'](_0x588823['shift']());}};_0x5bfcff(++_0x3c3011);}(_0x3cd8,0x150));var _0x83cd=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x3cd8[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0x83cd('0x0'));var util=require(_0x83cd('0x1'));var logger=require(_0x83cd('0x2'))(_0x83cd('0x3'));var moment=require(_0x83cd('0x4'));var BPromise=require(_0x83cd('0x5'));var rp=require(_0x83cd('0x6'));var fs=require('fs');var path=require(_0x83cd('0x7'));var rimraf=require('rimraf');var config=require(_0x83cd('0x8'));var attributes=require(_0x83cd('0x9'));module[_0x83cd('0xa')]=function(_0x2d20d8,_0x340fa9){return _0x2d20d8[_0x83cd('0xb')](_0x83cd('0xc'),attributes,{'tableName':_0x83cd('0xd'),'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 0fb9676..64ab157 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 _0x43de=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x307bec,_0x248900){var _0x25c2ec=function(_0x46c0d6){while(--_0x46c0d6){_0x307bec['push'](_0x307bec['shift']());}};_0x25c2ec(++_0x248900);}(_0x43de,0x189));var _0xe43d=function(_0xb90c93,_0x1c85c4){_0xb90c93=_0xb90c93-0x0;var _0x267c48=_0x43de[_0xb90c93];return _0x267c48;};'use strict';var _=require(_0xe43d('0x0'));var util=require(_0xe43d('0x1'));var moment=require(_0xe43d('0x2'));var BPromise=require(_0xe43d('0x3'));var rs=require(_0xe43d('0x4'));var fs=require('fs');var Redis=require(_0xe43d('0x5'));var db=require(_0xe43d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe43d('0x7'))(_0xe43d('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe43d('0x9')][_0xe43d('0xa')]({'port':0x232a});config[_0xe43d('0xb')]=_[_0xe43d('0xc')](config[_0xe43d('0xb')],{'host':_0xe43d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe43d('0xb')]));require('./chatGroup.socket')[_0xe43d('0xe')](socket);function respondWithRpcPromise(_0x38e604,_0x44a270,_0x17dd46){return new BPromise(function(_0x62e765,_0x17afd4){return client[_0xe43d('0xf')](_0x38e604,_0x17dd46)[_0xe43d('0x10')](function(_0xef4755){logger[_0xe43d('0x11')](_0xe43d('0x12'),_0x44a270,_0xe43d('0x13'));logger[_0xe43d('0x14')](_0xe43d('0x15'),_0x44a270,_0xe43d('0x13'),JSON[_0xe43d('0x16')](_0xef4755));if(_0xef4755[_0xe43d('0x17')]){if(_0xef4755['error'][_0xe43d('0x18')]===0x1f4){logger[_0xe43d('0x17')](_0xe43d('0x12'),_0x44a270,_0xef4755[_0xe43d('0x17')][_0xe43d('0x19')]);return _0x17afd4(_0xef4755[_0xe43d('0x17')][_0xe43d('0x19')]);}logger['error'](_0xe43d('0x12'),_0x44a270,_0xef4755[_0xe43d('0x17')]['message']);return _0x62e765(_0xef4755['error']['message']);}else{logger[_0xe43d('0x11')](_0xe43d('0x12'),_0x44a270,_0xe43d('0x13'));_0x62e765(_0xef4755[_0xe43d('0x1a')]['message']);}})[_0xe43d('0x1b')](function(_0xbafe09){logger['error'](_0xe43d('0x12'),_0x44a270,_0xbafe09);_0x17afd4(_0xbafe09);});});} \ No newline at end of file +var _0xf809=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','defaults','localhost','socket.io-emitter','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x4a9fdf,_0x18c716){var _0x2ed5df=function(_0x34b99a){while(--_0x34b99a){_0x4a9fdf['push'](_0x4a9fdf['shift']());}};_0x2ed5df(++_0x18c716);}(_0xf809,0x1a6));var _0x9f80=function(_0x4800c4,_0x13b31e){_0x4800c4=_0x4800c4-0x0;var _0x5bd103=_0xf809[_0x4800c4];return _0x5bd103;};'use strict';var _=require('lodash');var util=require(_0x9f80('0x0'));var moment=require(_0x9f80('0x1'));var BPromise=require(_0x9f80('0x2'));var rs=require(_0x9f80('0x3'));var fs=require('fs');var Redis=require(_0x9f80('0x4'));var db=require(_0x9f80('0x5'))['db'];var utils=require(_0x9f80('0x6'));var logger=require(_0x9f80('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9f80('0x8'));var client=jayson[_0x9f80('0x9')]['http']({'port':0x232a});config['redis']=_[_0x9f80('0xa')](config['redis'],{'host':_0x9f80('0xb'),'port':0x18eb});var socket=require(_0x9f80('0xc'))(new Redis(config['redis']));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x3e909d,_0x18f036,_0x5b3be6){return new BPromise(function(_0x51349a,_0x45c869){return client[_0x9f80('0xd')](_0x3e909d,_0x5b3be6)[_0x9f80('0xe')](function(_0x2bc6bd){logger[_0x9f80('0xf')](_0x9f80('0x10'),_0x18f036,_0x9f80('0x11'));logger[_0x9f80('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x18f036,_0x9f80('0x11'),JSON[_0x9f80('0x13')](_0x2bc6bd));if(_0x2bc6bd[_0x9f80('0x14')]){if(_0x2bc6bd['error'][_0x9f80('0x15')]===0x1f4){logger[_0x9f80('0x14')](_0x9f80('0x10'),_0x18f036,_0x2bc6bd[_0x9f80('0x14')]['message']);return _0x45c869(_0x2bc6bd['error'][_0x9f80('0x16')]);}logger[_0x9f80('0x14')](_0x9f80('0x10'),_0x18f036,_0x2bc6bd[_0x9f80('0x14')]['message']);return _0x51349a(_0x2bc6bd[_0x9f80('0x14')][_0x9f80('0x16')]);}else{logger[_0x9f80('0xf')](_0x9f80('0x10'),_0x18f036,_0x9f80('0x11'));_0x51349a(_0x2bc6bd[_0x9f80('0x17')]['message']);}})[_0x9f80('0x18')](function(_0x31b6ad){logger[_0x9f80('0x14')](_0x9f80('0x10'),_0x18f036,_0x31b6ad);_0x45c869(_0x31b6ad);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 3573638..3c8acaa 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 _0xec30=['register','chatGroup:','save','update','emit','removeListener'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0xec30,0x68));var _0x0ec3=function(_0x55d946,_0x644bc4){_0x55d946=_0x55d946-0x0;var _0xc53385=_0xec30[_0x55d946];return _0xc53385;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x0ec3('0x0'),'remove',_0x0ec3('0x1')];function createListener(_0x24c175,_0x3cd4c7){return function(_0x544c58){_0x3cd4c7[_0x0ec3('0x2')](_0x24c175,_0x544c58);};}function removeListener(_0x1b2797,_0xe54cd0){return function(){ChatGroupEvents[_0x0ec3('0x3')](_0x1b2797,_0xe54cd0);};}exports[_0x0ec3('0x4')]=function(_0x580c8c){for(var _0x2f812e=0x0,_0x59f372=events['length'];_0x2f812e<_0x59f372;_0x2f812e++){var _0xbbf538=events[_0x2f812e];var _0x6d36e=createListener(_0x0ec3('0x5')+_0xbbf538,_0x580c8c);ChatGroupEvents['on'](_0xbbf538,_0x6d36e);}}; \ No newline at end of file +var _0x1036=['length','./chatGroup.events','save','remove','removeListener','register'];(function(_0x43f50f,_0x25fe1e){var _0x4b8888=function(_0x5966e7){while(--_0x5966e7){_0x43f50f['push'](_0x43f50f['shift']());}};_0x4b8888(++_0x25fe1e);}(_0x1036,0x1b7));var _0x6103=function(_0x42272a,_0x1d1dcd){_0x42272a=_0x42272a-0x0;var _0x5d863c=_0x1036[_0x42272a];return _0x5d863c;};'use strict';var ChatGroupEvents=require(_0x6103('0x0'));var events=[_0x6103('0x1'),_0x6103('0x2'),'update'];function createListener(_0x3f87a7,_0x24cf84){return function(_0x49e844){_0x24cf84['emit'](_0x3f87a7,_0x49e844);};}function removeListener(_0x56db05,_0x5922ac){return function(){ChatGroupEvents[_0x6103('0x3')](_0x56db05,_0x5922ac);};}exports[_0x6103('0x4')]=function(_0x4a2cfb){for(var _0x272773=0x0,_0x15b840=events[_0x6103('0x5')];_0x272773<_0x15b840;_0x272773++){var _0x106ac8=events[_0x272773];var _0xa180f6=createListener('chatGroup:'+_0x106ac8,_0x4a2cfb);ChatGroupEvents['on'](_0x106ac8,_0xa180f6);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 630ae94..ec9c9e3 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 _0x2816=['/describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','addMembers','/:id/messages','put','update','delete','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated'];(function(_0x44213c,_0x1e17d7){var _0x4c04bb=function(_0x3df8e4){while(--_0x3df8e4){_0x44213c['push'](_0x44213c['shift']());}};_0x4c04bb(++_0x1e17d7);}(_0x2816,0x8c));var _0x6281=function(_0x1f63e2,_0x1bf2f5){_0x1f63e2=_0x1f63e2-0x0;var _0x48fa55=_0x2816[_0x1f63e2];return _0x48fa55;};'use strict';var multer=require(_0x6281('0x0'));var util=require(_0x6281('0x1'));var path=require('path');var timeout=require(_0x6281('0x2'));var express=require(_0x6281('0x3'));var router=express['Router']();var auth=require(_0x6281('0x4'));var interaction=require(_0x6281('0x5'));var config=require(_0x6281('0x6'));var controller=require(_0x6281('0x7'));router[_0x6281('0x8')]('/',auth[_0x6281('0x9')](),controller['index']);router[_0x6281('0x8')](_0x6281('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x6281('0x8')](_0x6281('0xb'),auth[_0x6281('0x9')](),controller[_0x6281('0xc')]);router[_0x6281('0x8')](_0x6281('0xd'),auth[_0x6281('0x9')](),controller[_0x6281('0xe')]);router['get'](_0x6281('0xf'),auth['isAuthenticated'](),controller[_0x6281('0x10')]);router['get']('/:id/messages',auth[_0x6281('0x9')](),controller[_0x6281('0x11')]);router[_0x6281('0x12')]('/',auth[_0x6281('0x9')](),controller['create']);router[_0x6281('0x12')](_0x6281('0xf'),auth[_0x6281('0x9')](),controller[_0x6281('0x13')]);router[_0x6281('0x12')](_0x6281('0x14'),auth[_0x6281('0x9')](),controller['addMessage']);router[_0x6281('0x15')](_0x6281('0xb'),auth[_0x6281('0x9')](),controller[_0x6281('0x16')]);router[_0x6281('0x17')](_0x6281('0xb'),auth[_0x6281('0x9')](),controller['destroy']);router[_0x6281('0x17')](_0x6281('0xf'),auth[_0x6281('0x9')](),controller['removeMembers']);module[_0x6281('0x18')]=router; \ No newline at end of file +var _0x96eb=['update','destroy','delete','removeMembers','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/unread','/:id/members','getMembers','/:id/messages','post','create'];(function(_0x41d4a1,_0x258e2d){var _0x5ecdfc=function(_0x4ad5d8){while(--_0x4ad5d8){_0x41d4a1['push'](_0x41d4a1['shift']());}};_0x5ecdfc(++_0x258e2d);}(_0x96eb,0x123));var _0xb96e=function(_0x21a4af,_0x6daa7c){_0x21a4af=_0x21a4af-0x0;var _0x430c0e=_0x96eb[_0x21a4af];return _0x430c0e;};'use strict';var multer=require(_0xb96e('0x0'));var util=require(_0xb96e('0x1'));var path=require(_0xb96e('0x2'));var timeout=require(_0xb96e('0x3'));var express=require('express');var router=express[_0xb96e('0x4')]();var auth=require(_0xb96e('0x5'));var interaction=require(_0xb96e('0x6'));var config=require(_0xb96e('0x7'));var controller=require('./chatGroup.controller');router[_0xb96e('0x8')]('/',auth['isAuthenticated'](),controller[_0xb96e('0x9')]);router[_0xb96e('0x8')](_0xb96e('0xa'),auth['isAuthenticated'](),controller[_0xb96e('0xb')]);router[_0xb96e('0x8')](_0xb96e('0xc'),auth[_0xb96e('0xd')](),controller[_0xb96e('0xe')]);router[_0xb96e('0x8')](_0xb96e('0xf'),auth[_0xb96e('0xd')](),controller['getUnread']);router[_0xb96e('0x8')](_0xb96e('0x10'),auth[_0xb96e('0xd')](),controller[_0xb96e('0x11')]);router[_0xb96e('0x8')](_0xb96e('0x12'),auth['isAuthenticated'](),controller['getMessages']);router[_0xb96e('0x13')]('/',auth['isAuthenticated'](),controller[_0xb96e('0x14')]);router[_0xb96e('0x13')](_0xb96e('0x10'),auth[_0xb96e('0xd')](),controller['addMembers']);router[_0xb96e('0x13')]('/:id/messages',auth[_0xb96e('0xd')](),controller['addMessage']);router['put'](_0xb96e('0xc'),auth[_0xb96e('0xd')](),controller[_0xb96e('0x15')]);router['delete'](_0xb96e('0xc'),auth[_0xb96e('0xd')](),controller[_0xb96e('0x16')]);router[_0xb96e('0x17')](_0xb96e('0x10'),auth['isAuthenticated'](),controller[_0xb96e('0x18')]);module[_0xb96e('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 3c6fdc8..98047db 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 _0xa79e=['star','thumb','TEXT','STRING','DATE','long','BOOLEAN','INTEGER','ENUM'];(function(_0x114319,_0x35893e){var _0x124d04=function(_0x4e147a){while(--_0x4e147a){_0x114319['push'](_0x114319['shift']());}};_0x124d04(++_0x35893e);}(_0xa79e,0x177));var _0xea79=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa79e[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xea79('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xea79('0x1')]},'ratingType':{'type':Sequelize[_0xea79('0x2')](_0xea79('0x3'),_0xea79('0x4')),'defaultValue':_0xea79('0x3')},'ratingMessage':{'type':Sequelize[_0xea79('0x5')]},'pathTranscript':{'type':Sequelize[_0xea79('0x5')]},'mailTranscript':{'type':Sequelize[_0xea79('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xea79('0x7')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xea79('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xea79('0x6')]},'osVersion':{'type':Sequelize[_0xea79('0x6')]},'deviceModel':{'type':Sequelize[_0xea79('0x6')]},'deviceVendor':{'type':Sequelize[_0xea79('0x6')]},'deviceType':{'type':Sequelize[_0xea79('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xea79('0x6')]},'formData':{'type':Sequelize[_0xea79('0x5')](_0xea79('0x8'))},'read1stAt':{'type':Sequelize[_0xea79('0x7')]},'lastMsgAt':{'type':Sequelize[_0xea79('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xea79('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xea79('0x6')]},'customerPort':{'type':Sequelize[_0xea79('0x6')]}}; \ No newline at end of file +var _0xeadc=['BOOLEAN','star','thumb','TEXT','STRING','long','DATE','ENUM','sequelize','exports'];(function(_0x5c3f57,_0x381c32){var _0x2899df=function(_0x1c6ff9){while(--_0x1c6ff9){_0x5c3f57['push'](_0x5c3f57['shift']());}};_0x2899df(++_0x381c32);}(_0xeadc,0x1d4));var _0xcead=function(_0x46d0e1,_0x590921){_0x46d0e1=_0x46d0e1-0x0;var _0x2f7ef2=_0xeadc[_0x46d0e1];return _0x2f7ef2;};'use strict';var Sequelize=require(_0xcead('0x0'));module[_0xcead('0x1')]={'closed':{'type':Sequelize[_0xcead('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0xcead('0x3'),_0xcead('0x4')),'defaultValue':_0xcead('0x3')},'ratingMessage':{'type':Sequelize[_0xcead('0x5')]},'pathTranscript':{'type':Sequelize[_0xcead('0x5')]},'mailTranscript':{'type':Sequelize[_0xcead('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xcead('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xcead('0x6')]},'browserVersion':{'type':Sequelize[_0xcead('0x6')]},'osName':{'type':Sequelize[_0xcead('0x6')]},'osVersion':{'type':Sequelize[_0xcead('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xcead('0x6')]},'deviceType':{'type':Sequelize[_0xcead('0x6')]},'referer':{'type':Sequelize[_0xcead('0x5')]},'customerIp':{'type':Sequelize[_0xcead('0x6')]},'formData':{'type':Sequelize['TEXT'](_0xcead('0x7'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xcead('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xcead('0x9')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xcead('0x6')]},'customerPort':{'type':Sequelize[_0xcead('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 961a0a4..ba867b2 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 _0x25fa=['stringify','error','code','message','sendStatus','end','status','count','offset','limit','set','Content-Range','json','reject','save','update','stack','name','send','Users','map','TagIds','Tags','forEach','push','index','ChatInteraction','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','user_has_chat_interactions','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','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','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','show','params','includeAll','options','catch','create','destroy','describe','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','Unauthorized','findOne','download','join','close','root','format','transcript-%s.txt','pathTranscript','ChatMessage','Messages','User','ChatWebsite','CmContact','agentAlias','System','customer','%s%d','agentIdentifier','agent_alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','SendMail','sendMail','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','include','getMyMessages','includeAgent','alias','findAll','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','tmp','files','attachments','transcript-%d-%s.zip','lastName','direction','Account','get','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
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','Chat','YYYY-MM-DD','Owner','closedAt','browserName','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','out','Contact','firstName','renderFile','views','downloadInteraction.html','toFile','.pdf','log','unlinkSync','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatInteraction.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','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x36d9eb,_0x4c1ebf){var _0x10f24e=function(_0x441747){while(--_0x441747){_0x36d9eb['push'](_0x36d9eb['shift']());}};_0x10f24e(++_0x4c1ebf);}(_0x25fa,0x109));var _0xa25f=function(_0x5ab744,_0x445f3e){_0x5ab744=_0x5ab744-0x0;var _0x55ebb4=_0x25fa[_0x5ab744];return _0x55ebb4;};'use strict';var pdf=require(_0xa25f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa25f('0x1'));var zipdir=require(_0xa25f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa25f('0x3'));var moment=require(_0xa25f('0x4'));var BPromise=require(_0xa25f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa25f('0x6'));var sox=require('sox');var csv=require(_0xa25f('0x7'));var ejs=require(_0xa25f('0x8'));var fs=require('fs');var _=require(_0xa25f('0x9'));var squel=require(_0xa25f('0xa'));var crypto=require(_0xa25f('0xb'));var jsforce=require(_0xa25f('0xc'));var deskjs=require(_0xa25f('0xd'));var toCsv=require(_0xa25f('0x7'));var querystring=require(_0xa25f('0xe'));var Papa=require('papaparse');var Redis=require(_0xa25f('0xf'));var authService=require(_0xa25f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa25f('0x11'));var hardwareService=require(_0xa25f('0x12'));var logger=require(_0xa25f('0x13'))(_0xa25f('0x14'));var utils=require('../../config/utils');var config=require(_0xa25f('0x15'));var db=require(_0xa25f('0x16'))['db'];config['redis']=_[_0xa25f('0x17')](config[_0xa25f('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xa25f('0x19'))(new Redis(config[_0xa25f('0x18')]));require(_0xa25f('0x1a'))[_0xa25f('0x1b')](socket);var jayson=require(_0xa25f('0x1c'));var client=jayson[_0xa25f('0x1d')][_0xa25f('0x1e')]({'port':0x232b});var client9004=jayson[_0xa25f('0x1d')][_0xa25f('0x1e')]({'port':0x232c});function checkPasswordPattern(_0x2d2417,_0x1e5836,_0x1859ba){if(_0x1859ba){var _0x57ada6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x57ada6[_0xa25f('0x1f')](_0x1e5836)){return _0x2d2417;}else{throw new db[(_0xa25f('0x20'))][(_0xa25f('0x21'))](_0xa25f('0x22'));}}else{return _0x2d2417;}}function respondWithRpcPromise(_0x18705c,_0x427105,_0x4a4805,_0x292171){return new BPromise(function(_0x5a2d5c,_0x32b868){var _0x562573=_0x292171||client;return _0x562573['request'](_0x18705c,_0x4a4805)[_0xa25f('0x23')](function(_0x489c83){logger[_0xa25f('0x24')](_0xa25f('0x25'),_0x427105,_0xa25f('0x26'));logger[_0xa25f('0x27')](_0xa25f('0x28'),_0x427105,'request\x20sent',JSON[_0xa25f('0x29')](_0x489c83));if(_0x489c83[_0xa25f('0x2a')]){if(_0x489c83[_0xa25f('0x2a')][_0xa25f('0x2b')]===0x1f4){logger['error'](_0xa25f('0x25'),_0x427105,_0x489c83[_0xa25f('0x2a')][_0xa25f('0x2c')]);return _0x32b868(_0x489c83[_0xa25f('0x2a')]['message']);}logger[_0xa25f('0x2a')](_0xa25f('0x25'),_0x427105,_0x489c83[_0xa25f('0x2a')][_0xa25f('0x2c')]);return _0x5a2d5c(_0x489c83['error'][_0xa25f('0x2c')]);}else{logger[_0xa25f('0x24')]('ChatInteraction,\x20%s,\x20%s',_0x427105,_0xa25f('0x26'));_0x5a2d5c(_0x489c83['result'][_0xa25f('0x2c')]);}})['catch'](function(_0x1e1fbd){logger[_0xa25f('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x427105,_0x1e1fbd);_0x32b868(_0x1e1fbd);});});}function respondWithStatusCode(_0xf6c928,_0x1412b6){_0x1412b6=_0x1412b6||0xcc;return function(_0x54d98c){if(_0x54d98c){return _0xf6c928[_0xa25f('0x2d')](_0x1412b6);}return _0xf6c928['status'](_0x1412b6)[_0xa25f('0x2e')]();};}function respondWithResult(_0x41a847,_0x472114){_0x472114=_0x472114||0xc8;return function(_0x208518){if(_0x208518){return _0x41a847[_0xa25f('0x2f')](_0x472114)['json'](_0x208518);}};}function respondWithFilteredResult(_0x24e358,_0x28d84e){return function(_0x119ffc){if(_0x119ffc){var _0x245684=_0x119ffc[_0xa25f('0x30')],_0x3bdde0=_0x28d84e[_0xa25f('0x31')],_0x501372=_0x28d84e[_0xa25f('0x31')]+_0x28d84e[_0xa25f('0x32')],_0x1ca4a3;if(_0x501372>=_0x245684){_0x501372=_0x245684;_0x1ca4a3=0xc8;}else{_0x1ca4a3=0xce;}_0x24e358[_0xa25f('0x2f')](_0x1ca4a3);return _0x24e358[_0xa25f('0x33')](_0xa25f('0x34'),_0x3bdde0+'-'+_0x501372+'/'+_0x245684)[_0xa25f('0x35')](_0x119ffc);}return null;};}function patchUpdates(_0x5621ab){return function(_0x597233){try{jsonpatch['apply'](_0x597233,_0x5621ab,!![]);}catch(_0x41093d){return BPromise[_0xa25f('0x36')](_0x41093d);}return _0x597233[_0xa25f('0x37')]();};}function saveUpdates(_0x370759,_0x311ba8){return function(_0xaefd9){if(_0xaefd9){return _0xaefd9[_0xa25f('0x38')](_0x370759)[_0xa25f('0x23')](function(_0x3ef65f){return _0x3ef65f;});}return null;};}function removeEntity(_0x291351,_0x3c0561){return function(_0x574149){if(_0x574149){return _0x574149['destroy']()[_0xa25f('0x23')](function(){_0x291351[_0xa25f('0x2f')](0xcc)[_0xa25f('0x2e')]();});}};}function handleEntityNotFound(_0x5d3103,_0x5a558d){return function(_0x4aadc1){if(!_0x4aadc1){_0x5d3103[_0xa25f('0x2d')](0x194);}return _0x4aadc1;};}function handleError(_0x25952d,_0x1078c4){_0x1078c4=_0x1078c4||0x1f4;return function(_0x4a334b){logger['error'](_0x4a334b[_0xa25f('0x39')]);if(_0x4a334b[_0xa25f('0x3a')]){delete _0x4a334b['name'];}_0x25952d['status'](_0x1078c4)[_0xa25f('0x3b')](_0x4a334b);};}function getInteractionUsers(_0x33ad7a,_0x8c753){return new BPromise(function(_0x494e4c,_0x151c4b){try{if(_0x8c753[_0x33ad7a['id']]){_0x33ad7a[_0xa25f('0x3c')]=_[_0xa25f('0x3d')](_0x8c753[_0x33ad7a['id']],function(_0x49556e){return{'id':_0x49556e['id'],'fullname':_0x49556e['fullname']};});}}catch(_0x3108bb){_0x151c4b(_0x3108bb);}_0x494e4c(_0x33ad7a);});}function getInteractionTags(_0x44c9c8,_0xe6cb75){return new BPromise(function(_0x32c745,_0x4649a7){try{if(_0x44c9c8[_0xa25f('0x3e')]){_0x44c9c8[_0xa25f('0x3f')]=[];_0x44c9c8[_0xa25f('0x3e')]['split'](',')[_0xa25f('0x40')](function(_0x773d41){_0x44c9c8[_0xa25f('0x3f')][_0xa25f('0x41')](_0xe6cb75[_0x773d41]);});}delete _0x44c9c8[_0xa25f('0x3e')];}catch(_0xd285eb){_0x4649a7(_0xd285eb);}_0x32c745(_0x44c9c8);});}function updateChatInteraction(_0x38bacd,_0x4603a9,_0x3f052f){return new BPromise(function(_0x370375,_0xd91854){return getInteractionUsers(_0x38bacd,_0x3f052f)[_0xa25f('0x23')](function(_0x82ddbf){return getInteractionTags(_0x82ddbf,_0x4603a9);})['then'](function(_0x20400d){_0x370375(_0x20400d);})['catch'](function(_0xace015){_0xd91854(_0xace015);});});}exports[_0xa25f('0x42')]=function(_0x36afe4,_0x559874){var _0x9f2276={},_0x1eaa67={},_0x37d94d={'count':0x0,'rows':[]};var _0x19724c=_['map'](db[_0xa25f('0x43')][_0xa25f('0x44')],function(_0x25123c){return{'name':_0x25123c[_0xa25f('0x45')],'type':_0x25123c[_0xa25f('0x46')][_0xa25f('0x47')]};});_0x1eaa67['model']=_[_0xa25f('0x3d')](_0x19724c,_0xa25f('0x3a'));_0x1eaa67['query']=_[_0xa25f('0x48')](_0x36afe4[_0xa25f('0x49')]);_0x1eaa67[_0xa25f('0x4a')]=_[_0xa25f('0x4b')](_0x1eaa67[_0xa25f('0x4c')],_0x1eaa67[_0xa25f('0x49')]);_0x9f2276[_0xa25f('0x4d')]=_[_0xa25f('0x4b')](_0x1eaa67[_0xa25f('0x4c')],qs[_0xa25f('0x4e')](_0x36afe4[_0xa25f('0x49')][_0xa25f('0x4e')]));_0x9f2276[_0xa25f('0x4d')]=_0x9f2276['attributes'][_0xa25f('0x4f')]?_0x9f2276[_0xa25f('0x4d')]:_0x1eaa67[_0xa25f('0x4c')];if(!_0x36afe4[_0xa25f('0x49')]['hasOwnProperty'](_0xa25f('0x50'))){_0x9f2276[_0xa25f('0x32')]=qs[_0xa25f('0x32')](_0x36afe4['query'][_0xa25f('0x32')]);_0x9f2276[_0xa25f('0x31')]=qs[_0xa25f('0x31')](_0x36afe4[_0xa25f('0x49')][_0xa25f('0x31')]);}_0x9f2276[_0xa25f('0x51')]=qs[_0xa25f('0x52')](_0x36afe4[_0xa25f('0x49')]['sort']);_0x9f2276[_0xa25f('0x53')]=qs[_0xa25f('0x4a')](_[_0xa25f('0x54')](_0x36afe4[_0xa25f('0x49')],_0x1eaa67[_0xa25f('0x4a')]));var _0x37ebf2=[];var _0x3057a5=squel[_0xa25f('0x55')]()[_0xa25f('0x56')]('id')[_0xa25f('0x56')](_0xa25f('0x3a'))[_0xa25f('0x56')](_0xa25f('0x57'))[_0xa25f('0x58')](_0xa25f('0x59'));var _0x22ab7f=squel[_0xa25f('0x55')]()[_0xa25f('0x56')](_0xa25f('0x5a'))[_0xa25f('0x56')](_0xa25f('0x5b'))[_0xa25f('0x56')]('ui.ChatInteractionId')[_0xa25f('0x58')](_0xa25f('0x5c'),'ui')[_0xa25f('0x5d')](_0xa25f('0x5e'),'u','u.id\x20=\x20ui.UserId');var _0x34cb3b=squel['select']()[_0xa25f('0x58')]('chat_interactions','i')['left_join'](_0xa25f('0x5f'),'c',_0xa25f('0x60'))[_0xa25f('0x5d')](_0xa25f('0x5e'),'o',_0xa25f('0x61'))[_0xa25f('0x5d')](_0xa25f('0x62'),'a',_0xa25f('0x63'))[_0xa25f('0x5d')](_0xa25f('0x64'),'me',_0xa25f('0x65'))[_0xa25f('0x5d')]('chat_interaction_has_tags','it',_0xa25f('0x66'))[_0xa25f('0x5d')](_0xa25f('0x59'),'t',_0xa25f('0x67'));var _0x50dd10=squel[_0xa25f('0x68')]();var _0x5c7d08=[];var _0x19b74a=squel[_0xa25f('0x68')]();var _0x36d202;if(_0x36afe4[_0xa25f('0x49')]['search']){_0x36d202=as[_0xa25f('0x69')](_0x36afe4[_0xa25f('0x49')][_0xa25f('0x6a')]);var _0x56c6bf=_0x36d202[_0xa25f('0x6b')];for(var _0x5094e5=0x0;_0x5094e5<_0x36d202[_0xa25f('0x6c')]['length'];_0x5094e5++){var _0x40ab78=_0x36d202[_0xa25f('0x6c')][_0x5094e5];var _0x15073a='i';var _0x37aae1=_[_0xa25f('0x6d')](_0x19724c,[_0xa25f('0x3a'),_0x40ab78['field']]);if(!_0x37aae1){switch(_0x40ab78[_0xa25f('0x56')]){case _0xa25f('0x6e'):if(_0x40ab78[_0xa25f('0x6f')]==0x1){_0x34cb3b[_0xa25f('0x70')]('`'+_0x40ab78[_0xa25f('0x56')]+_0xa25f('0x71'));}else{_0x34cb3b[_0xa25f('0x70')]('`'+_0x40ab78['field']+'`\x20>\x200');}break;case'Contact':if(_0x40ab78[_0xa25f('0x72')]===_0xa25f('0x73')){if(_0x40ab78[_0xa25f('0x6f')][_0xa25f('0x74')]('\x20')[_0xa25f('0x4f')]>0x1){_0x50dd10[_0x56c6bf](_0xa25f('0x75'),qs[_0xa25f('0x76')](_0x40ab78[_0xa25f('0x6f')]),null);}else{var _0x3ffa53='%'+_0x40ab78[_0xa25f('0x6f')]+'%';_0x50dd10[_0x56c6bf](_0xa25f('0x77'),_0x3ffa53,_0x3ffa53,_0x3ffa53);}}else{_0x37aae1=_['find'](_0x19724c,[_0xa25f('0x3a'),_0xa25f('0x78')]);_0x40ab78[_0xa25f('0x56')]=_0xa25f('0x78');_0x73d61e=as[_0xa25f('0x79')](_0x15073a,_0x37aae1['type'],_0x40ab78);_0x50dd10[_0x56c6bf](_0x73d61e[_0xa25f('0x7a')],_0x73d61e[_0xa25f('0x6f')]['start'],_0x73d61e[_0xa25f('0x6f')][_0xa25f('0x2e')]);}break;case'Tag':var _0x381a01=_0x40ab78[_0xa25f('0x6f')][_0xa25f('0x74')](',')[_0xa25f('0x3d')](function(_0x380f61){return Number(_0x380f61);});_0x381a01['forEach'](function(_0xa3ddab){_0x19b74a['or'](_0xa25f('0x7b'),'%,'+_0xa3ddab+',%');});_0x5c7d08=_[_0xa25f('0x7c')](_0x5c7d08,_0x381a01);break;case'User':if(_0x40ab78[_0xa25f('0x72')]===_0xa25f('0x73')){_0x50dd10[_0x56c6bf](_0xa25f('0x7d'),'%'+_0x40ab78['value']+'%',null);}else{_0x37aae1=_[_0xa25f('0x6d')](_0x19724c,[_0xa25f('0x3a'),_0xa25f('0x7e')]);_0x40ab78[_0xa25f('0x56')]='UserId';_0x73d61e=as['buildExpression'](_0x15073a,_0x37aae1[_0xa25f('0x46')],_0x40ab78);_0x50dd10[_0x56c6bf](_0x73d61e[_0xa25f('0x7a')],_0x73d61e[_0xa25f('0x6f')][_0xa25f('0x7f')],_0x73d61e[_0xa25f('0x6f')][_0xa25f('0x2e')]);}break;case _0xa25f('0x80'):_0x73d61e=as['buildExpression']('me',null,_0x40ab78);_0x50dd10[_0x56c6bf](_0x73d61e['text'],_0x73d61e[_0xa25f('0x6f')]['start'],_0x73d61e[_0xa25f('0x6f')][_0xa25f('0x2e')]);break;}}else{var _0x73d61e=as[_0xa25f('0x79')](_0x15073a,_0x37aae1[_0xa25f('0x46')],_0x40ab78);_0x50dd10[_0x56c6bf](_0x73d61e[_0xa25f('0x7a')],_0x73d61e[_0xa25f('0x6f')]['start'],_0x73d61e[_0xa25f('0x6f')]['end']);}}}else{var _0x44de55=_(_0x36afe4[_0xa25f('0x49')])[_0xa25f('0x48')]()[_0xa25f('0x3d')](function(_0x34dd3d){return _[_0xa25f('0x81')](_0x19724c,[_0xa25f('0x3a'),_0x34dd3d])?_0x34dd3d:undefined;})[_0xa25f('0x82')]()[_0xa25f('0x6f')]();if(!_[_0xa25f('0x83')](_0x44de55)){_0x44de55[_0xa25f('0x40')](function(_0x1023e9){if(_0x1023e9===_0xa25f('0x84')){_0x34cb3b[_0xa25f('0x53')](_0xa25f('0x85'),[][_0xa25f('0x86')](_0x36afe4[_0xa25f('0x49')][_0x1023e9]));}else if(_0x1023e9===_0xa25f('0x87')){var _0xe32668=JSON[_0xa25f('0x88')](_0x36afe4['query'][_0x1023e9])[_0xa25f('0x89')];var _0x5c8c87=JSON[_0xa25f('0x88')](_0x36afe4[_0xa25f('0x49')][_0x1023e9])[_0xa25f('0x8a')];_0x34cb3b[_0xa25f('0x53')](_0xa25f('0x8b'),_0xe32668,_0x5c8c87);}else{if(_0x36afe4[_0xa25f('0x49')][_0x1023e9]===_0xa25f('0x8c')){_0x34cb3b['where']('i.'+_0x1023e9+_0xa25f('0x8d'));}else{_0x34cb3b[_0xa25f('0x53')]('i.'+_0x1023e9+_0xa25f('0x8e'),_0x36afe4[_0xa25f('0x49')][_0x1023e9]);}}});}if(_0x36afe4[_0xa25f('0x49')][_0xa25f('0x8f')]){if(_0x36afe4[_0xa25f('0x49')][_0xa25f('0x8f')]==0x1){_0x34cb3b[_0xa25f('0x70')](_0xa25f('0x90'));}else{_0x34cb3b['having'](_0xa25f('0x91'));}}if(_0x36afe4[_0xa25f('0x49')][_0xa25f('0x92')]){_0x5c7d08=_[_0xa25f('0x93')](_0x36afe4['query'][_0xa25f('0x92')])?_0x36afe4[_0xa25f('0x49')][_0xa25f('0x92')]:new Array(_0x36afe4[_0xa25f('0x49')][_0xa25f('0x92')]);_0x5c7d08[_0xa25f('0x40')](function(_0x4dc03c){_0x19b74a['or'](_0xa25f('0x7b'),'%,'+_0x4dc03c+',%');});}if(_0x36afe4['query'][_0xa25f('0x94')]){var _0x1b2e63=_0x36afe4[_0xa25f('0x49')]['filter'][_0xa25f('0x95')]('\x5c','\x5c\x5c')[_0xa25f('0x95')]('\x27\x27',_0xa25f('0x96'));if(qs[_0xa25f('0x97')](_0x1b2e63)){_0x50dd10['or']('i.id\x20LIKE\x20?',_0x1b2e63+'%');}else{_0x50dd10['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa25f('0x76')](_0x1b2e63))['or'](_0xa25f('0x98'),_0x1b2e63+'%');}}}_0x34cb3b[_0xa25f('0x53')](_0x50dd10);_0x34cb3b['group'](_0xa25f('0x99'));var _0x299e8c={'type':db['Sequelize'][_0xa25f('0x9a')][_0xa25f('0x9b')],'raw':!![]};var _0x5e1fe2=_0x34cb3b[_0xa25f('0x9c')]();_0x5e1fe2[_0xa25f('0x56')](_0xa25f('0x99'));_0x5e1fe2['field'](_0xa25f('0x9d'),_0xa25f('0x6e'));if(_0x9f2276['order']){_0x9f2276[_0xa25f('0x51')][_0xa25f('0x40')](function(_0x4561b5){_0x34cb3b[_0xa25f('0x51')]('i.'+_0x4561b5[0x0],_0x4561b5[0x1]===_0xa25f('0x9e')?![]:!![]);});}if(!_[_0xa25f('0x83')](_0x5c7d08)){_0x34cb3b[_0xa25f('0x70')](_0x19b74a);_0x5e1fe2['where']('t.id\x20IN\x20?',_0x5c7d08);}BPromise[_0xa25f('0x9f')]()[_0xa25f('0x23')](function(){if(!_0x36d202){if(_0x36afe4[_0xa25f('0x49')][_0xa25f('0x84')]||_0x36afe4[_0xa25f('0x49')]['journey'])return;_0x5e1fe2[_0xa25f('0x53')](_0xa25f('0xa0'));_0x34cb3b['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}return _0x36afe4['user']['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0xa25f('0x23')](function(_0x5d07b0){if(_[_0xa25f('0x83')](_0x5d07b0)){_0x5e1fe2[_0xa25f('0x53')]('i.ChatWebsiteId\x20IS\x20NULL');_0x34cb3b['where'](_0xa25f('0xa1'));}else{_0x5e1fe2[_0xa25f('0x53')](_0xa25f('0x85'),_['map'](_0x5d07b0,'id'));_0x34cb3b[_0xa25f('0x53')](_0xa25f('0x85'),_[_0xa25f('0x3d')](_0x5d07b0,'id'));}});})[_0xa25f('0x23')](function(){db[_0xa25f('0xa2')][_0xa25f('0x49')](_0x5e1fe2['toString'](),_0x299e8c)['then'](function(_0x65d748){_0x37d94d[_0xa25f('0x30')]=_0x65d748[_0xa25f('0x4f')];if(_0x37d94d['count']===0x0)return[];return db[_0xa25f('0xa2')][_0xa25f('0x49')](_0x3057a5[_0xa25f('0xa3')](),_0x299e8c)[_0xa25f('0x23')](function(_0x23b561){_0x37ebf2=_['keyBy'](_0x23b561,'id');_0x299e8c=_[_0xa25f('0xa4')](_0x299e8c,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x36afe4[_0xa25f('0x49')][_0xa25f('0x4e')]){_0x9f2276[_0xa25f('0x4d')][_0xa25f('0x40')](function(_0x287151){_0x34cb3b[_0xa25f('0x56')]('i.'+_0x287151);});}else{_0x34cb3b[_0xa25f('0x56')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa25f('0x6e'));_0x34cb3b['field'](_0xa25f('0xa5'),_0xa25f('0xa6'));_0x34cb3b[_0xa25f('0x56')](_0xa25f('0xa7'),_0xa25f('0xa8'));_0x34cb3b[_0xa25f('0x56')](_0xa25f('0xa9'));_0x34cb3b['field'](_0xa25f('0xaa'),_0xa25f('0xab'));_0x34cb3b[_0xa25f('0x56')](_0xa25f('0xac'),_0xa25f('0xad'));_0x34cb3b[_0xa25f('0x56')](_0xa25f('0xae'),_0xa25f('0xaf'));_0x34cb3b[_0xa25f('0x56')](_0xa25f('0xb0'),'Contact.phone');_0x34cb3b['field'](_0xa25f('0xb1'),_0xa25f('0xb2'));_0x34cb3b[_0xa25f('0x56')]('c.fax',_0xa25f('0xb3'));_0x34cb3b[_0xa25f('0x56')]('o.fullname',_0xa25f('0xb4'));_0x34cb3b[_0xa25f('0x56')](_0xa25f('0xb5'),'Owner.internal');_0x34cb3b[_0xa25f('0x56')](_0xa25f('0xb6'),_0xa25f('0x3e'));}_0x34cb3b[_0xa25f('0x32')](_0x9f2276[_0xa25f('0x32')]);_0x34cb3b[_0xa25f('0x31')](_0x9f2276[_0xa25f('0x31')]);return db['sequelize'][_0xa25f('0x49')](_0x34cb3b[_0xa25f('0xa3')](),_0x299e8c);})[_0xa25f('0x23')](function(_0x1f1a8b){_0x22ab7f['where'](_0xa25f('0xb7'),_[_0xa25f('0x3d')](_0x1f1a8b,'id'));return db['sequelize']['query'](_0x22ab7f['toString'](),_0x299e8c)['then'](function(_0x181617){var _0x2d975a=_['groupBy'](_0x181617,_0xa25f('0xb8'));var _0x2b88b5=[];_0x1f1a8b[_0xa25f('0x40')](function(_0x5bb31e){_0x2b88b5[_0xa25f('0x41')](updateChatInteraction(_0x5bb31e,_0x37ebf2,_0x2d975a));});return BPromise[_0xa25f('0xb9')](_0x2b88b5);});});})[_0xa25f('0x23')](function(_0x36f702){_0x37d94d[_0xa25f('0xba')]=_0x36f702;return _0x37d94d;})[_0xa25f('0x23')](respondWithFilteredResult(_0x559874,_0x9f2276));})['catch'](handleError(_0x559874,null));};exports[_0xa25f('0xbb')]=function(_0x53fd94,_0x45924d){var _0x19a399={'raw':![],'where':{'id':_0x53fd94[_0xa25f('0xbc')]['id']}},_0x269c50={};_0x269c50[_0xa25f('0x4c')]=_[_0xa25f('0x48')](db[_0xa25f('0x43')]['rawAttributes']);_0x269c50[_0xa25f('0x49')]=_[_0xa25f('0x48')](_0x53fd94[_0xa25f('0x49')]);_0x269c50[_0xa25f('0x4a')]=_[_0xa25f('0x4b')](_0x269c50[_0xa25f('0x4c')],_0x269c50[_0xa25f('0x49')]);_0x19a399['attributes']=_[_0xa25f('0x4b')](_0x269c50[_0xa25f('0x4c')],qs[_0xa25f('0x4e')](_0x53fd94[_0xa25f('0x49')][_0xa25f('0x4e')]));_0x19a399[_0xa25f('0x4d')]=_0x19a399['attributes'][_0xa25f('0x4f')]?_0x19a399[_0xa25f('0x4d')]:_0x269c50[_0xa25f('0x4c')];if(_0x53fd94[_0xa25f('0x49')][_0xa25f('0xbd')]){_0x19a399['include']=[{'all':!![]}];}_0x19a399=_[_0xa25f('0xa4')]({},_0x19a399,_0x53fd94[_0xa25f('0xbe')]);return db['ChatInteraction'][_0xa25f('0x6d')](_0x19a399)[_0xa25f('0x23')](handleEntityNotFound(_0x45924d,null))[_0xa25f('0x23')](respondWithResult(_0x45924d,null))[_0xa25f('0xbf')](handleError(_0x45924d,null));};exports[_0xa25f('0xc0')]=function(_0x45a7ae,_0x426693){return db[_0xa25f('0x43')]['create'](_0x45a7ae['body'],{})['then'](respondWithResult(_0x426693,0xc9))[_0xa25f('0xbf')](handleError(_0x426693,null));};exports[_0xa25f('0x38')]=function(_0x120156,_0x585a7c){if(_0x120156[_0xa25f('0x80')]['id']){delete _0x120156[_0xa25f('0x80')]['id'];}return db[_0xa25f('0x43')][_0xa25f('0x6d')]({'where':{'id':_0x120156[_0xa25f('0xbc')]['id']}})[_0xa25f('0x23')](handleEntityNotFound(_0x585a7c,null))[_0xa25f('0x23')](saveUpdates(_0x120156[_0xa25f('0x80')],null))[_0xa25f('0x23')](respondWithResult(_0x585a7c,null))[_0xa25f('0xbf')](handleError(_0x585a7c,null));};exports[_0xa25f('0xc1')]=function(_0xab44b9,_0x4f83d2){return db[_0xa25f('0x43')][_0xa25f('0x6d')]({'where':{'id':_0xab44b9[_0xa25f('0xbc')]['id']}})[_0xa25f('0x23')](handleEntityNotFound(_0x4f83d2,null))[_0xa25f('0x23')](removeEntity(_0x4f83d2,null))[_0xa25f('0xbf')](handleError(_0x4f83d2,null));};exports[_0xa25f('0xc2')]=function(_0x8a1f2f,_0x2eaabc){return db['ChatInteraction'][_0xa25f('0xc2')]()[_0xa25f('0x23')](respondWithResult(_0x2eaabc,null))['catch'](handleError(_0x2eaabc,null));};exports[_0xa25f('0xc3')]=function(_0x225b70,_0x3be85f){if(_0x225b70[_0xa25f('0x80')]['id']){delete _0x225b70[_0xa25f('0x80')]['id'];}return db[_0xa25f('0x43')][_0xa25f('0x6d')]({'where':{'id':_0x225b70[_0xa25f('0xbc')]['id']}})[_0xa25f('0x23')](handleEntityNotFound(_0x3be85f,null))[_0xa25f('0x23')](saveUpdates(_0x225b70['body'],null))[_0xa25f('0x23')](respondWithResult(_0x3be85f,null))[_0xa25f('0xbf')](handleError(_0x3be85f,null));};exports[_0xa25f('0xc4')]=function(_0x1dbb44,_0x41cc3f,_0x5e7f1e){if(_0x1dbb44[_0xa25f('0x80')]['id']){delete _0x1dbb44[_0xa25f('0x80')]['id'];}return db['ChatInteraction'][_0xa25f('0x6d')]({'where':{'id':_0x1dbb44['params']['id']}})[_0xa25f('0x23')](function(_0x122f79){if(!_0x122f79){logger[_0xa25f('0x2a')](_0xa25f('0xc5'),'abandon',0x194,_0xa25f('0xc6'));_0x41cc3f['sendStatus'](0x194);}else{if(_0x122f79[_0xa25f('0x7e')]){throw new db['Sequelize'][(_0xa25f('0x21'))](_0xa25f('0xc7'));}}return _0x122f79;})[_0xa25f('0x23')](function(_0x3ed00e){if(_0x3ed00e){return _0x3ed00e[_0xa25f('0x38')]({'closed':_0x1dbb44[_0xa25f('0x80')][_0xa25f('0xc8')],'disposition':_0x1dbb44['body'][_0xa25f('0xc9')]})[_0xa25f('0x23')](function(_0x14b4f3){return _0x14b4f3;});}})[_0xa25f('0x23')](function(_0x37cf51){return respondWithRpcPromise('AbandonInteraction',_0xa25f('0xc4'),_0x1dbb44['body'],client9004);})[_0xa25f('0x23')](respondWithResult(_0x41cc3f,null))[_0xa25f('0xbf')](handleError(_0x41cc3f,null));};exports[_0xa25f('0xca')]=function(_0x1849ea,_0x253ce8,_0x138f6c){_0x1849ea[_0xa25f('0x80')][_0xa25f('0x3a')]=_0x1849ea[_0xa25f('0xcb')][_0xa25f('0xcc')];_0x1849ea[_0xa25f('0x80')][_0xa25f('0xcd')]=_0x1849ea['file'][_0xa25f('0xce')];_0x1849ea[_0xa25f('0x80')][_0xa25f('0x46')]=_0x1849ea['file'][_0xa25f('0xcf')];return db[_0xa25f('0xd0')]['create'](_0x1849ea[_0xa25f('0x80')])[_0xa25f('0x23')](respondWithResult(_0x253ce8,0xc9))[_0xa25f('0xbf')](handleError(_0x253ce8,null));};exports['attachmentDownload']=function(_0x31be73,_0x47228a,_0x23ca04){return db[_0xa25f('0x43')]['findOne']({'where':{'id':_0x31be73['params']['id']},'raw':!![]})[_0xa25f('0x23')](handleEntityNotFound(_0x47228a,null))['then'](function(_0x4ae936){if(_0x4ae936){if(_0x4ae936[_0xa25f('0xc8')]){return _0x47228a[_0xa25f('0x2f')](0x193)['json']({'status':0x193,'message':_0xa25f('0xd1')});}return db[_0xa25f('0xd0')][_0xa25f('0xd2')]({'where':{'id':_0x31be73['query']['attachId']},'raw':!![]})[_0xa25f('0x23')](handleEntityNotFound(_0x47228a,null));}})[_0xa25f('0x23')](function(_0x6ba1cc){if(_0x6ba1cc){return _0x47228a[_0xa25f('0xd3')](path[_0xa25f('0xd4')](config['root'],'server/files/attachments/',_0x6ba1cc['basename']));}})[_0xa25f('0xbf')](handleError(_0x47228a,null));};exports[_0xa25f('0xd5')]=function(_0x5e910d,_0x26bf41){var _0x3fa53f=null;var _0x4c388a=null;var _0x40ac08=null;var _0x5a8258=null;if(_0x5e910d['body']['id']){delete _0x5e910d[_0xa25f('0x80')]['id'];}if(_0x5e910d[_0xa25f('0x80')]['mailTranscript']){_0x5a8258=path[_0xa25f('0xd4')](config[_0xa25f('0xd6')],'server/files/chat/upload/',util[_0xa25f('0xd7')](_0xa25f('0xd8'),Date['now']()));_0x5e910d[_0xa25f('0x80')][_0xa25f('0xd9')]=_0x5a8258;}return db[_0xa25f('0x43')][_0xa25f('0x6d')]({'where':{'id':_0x5e910d[_0xa25f('0xbc')]['id']},'include':[{'model':db[_0xa25f('0xda')],'as':_0xa25f('0xdb'),'include':[{'model':db[_0xa25f('0xdc')],'as':_0xa25f('0xdc')}]}]})[_0xa25f('0x23')](handleEntityNotFound(_0x26bf41,null))[_0xa25f('0x23')](saveUpdates(_0x5e910d[_0xa25f('0x80')],null))[_0xa25f('0x23')](function(_0x228c6a){if(_0x228c6a){_0x3fa53f=_0x228c6a;return db[_0xa25f('0xdd')][_0xa25f('0x6d')]({'where':{'id':_0x3fa53f[_0xa25f('0x84')]}});}})[_0xa25f('0x23')](function(_0x12ef8b){if(_0x12ef8b){_0x40ac08=_0x12ef8b;return db[_0xa25f('0xde')]['find']({'where':{'id':_0x3fa53f['ContactId']}});}})[_0xa25f('0x23')](function(_0x4c34f0){if(_0x4c34f0){_0x4c388a=_0x4c34f0;if(_0x5a8258){var _0x4eeb5d=null;for(var _0x5257ae=0x1;_0x5257ae<_0x3fa53f[_0xa25f('0xdb')]['length'];++_0x5257ae){_0x4eeb5d=_0x3fa53f[_0xa25f('0xdb')][_0x5257ae];var _0x5009cd=_0x4eeb5d[_0xa25f('0x7e')]?util[_0xa25f('0xd7')]('%s%d',_0x40ac08[_0xa25f('0xdf')],_0x4eeb5d['UserId']):_0xa25f('0xe0');var _0x4243e0=_0x5e910d[_0xa25f('0x80')][_0xa25f('0xe1')]||util[_0xa25f('0xd7')](_0xa25f('0xe2'),'Visitor',_0x4eeb5d[_0xa25f('0x78')]);switch(_0x40ac08[_0xa25f('0xe3')]){case'website_alias':_0x5009cd=_0x4eeb5d['UserId']?util[_0xa25f('0xd7')](_0xa25f('0xe2'),_0x40ac08[_0xa25f('0xdf')],_0x4eeb5d[_0xa25f('0x7e')]):_0xa25f('0xe0');break;case _0xa25f('0xe4'):_0x5009cd=_0x4eeb5d[_0xa25f('0x7e')]?_0x4eeb5d[_0xa25f('0xdc')]['alias']||_0x4eeb5d['User'][_0xa25f('0xe5')]:_0xa25f('0xe0');break;case _0xa25f('0xe6'):_0x5009cd=_0x4eeb5d[_0xa25f('0x7e')]?_0x4eeb5d[_0xa25f('0xdc')][_0xa25f('0xe5')]:_0xa25f('0xe0');break;default:_0x5009cd=_0x4eeb5d[_0xa25f('0x7e')]?util[_0xa25f('0xd7')](_0xa25f('0xe2'),_0x40ac08[_0xa25f('0xdf')],_0x4eeb5d[_0xa25f('0x7e')]):_0xa25f('0xe0');}var _0xa41acd=util[_0xa25f('0xd7')](_0xa25f('0xe7'),moment(_0x4eeb5d[_0xa25f('0x87')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x4eeb5d['direction']==='in'?_0x4243e0:_0x5009cd,_0x4eeb5d[_0xa25f('0x80')]);if(!_0x4eeb5d[_0xa25f('0xe8')]){fs['appendFileSync'](_0x5a8258,_0xa41acd);}}return db[_0xa25f('0xe9')][_0xa25f('0xd2')]({'where':{'service':!![]},'include':[{'model':db[_0xa25f('0xea')],'as':_0xa25f('0xeb'),'raw':!![]}]});}}})['then'](function(_0x3080a0){if(_0x3080a0&&_0x3080a0[_0xa25f('0xeb')]&&_0x5e910d[_0xa25f('0x80')]){var _0x4d9215={'tls':{'rejectUnauthorized':![]}};if(_0x3080a0[_0xa25f('0xeb')][_0xa25f('0xec')]){_0x4d9215[_0xa25f('0xec')]=_0x3080a0[_0xa25f('0xeb')][_0xa25f('0xec')];}else{_0x4d9215[_0xa25f('0xed')]=_0x3080a0[_0xa25f('0xeb')]['host'];_0x4d9215[_0xa25f('0xee')]=_0x3080a0[_0xa25f('0xeb')]['port'];_0x4d9215[_0xa25f('0xef')]=_0x3080a0[_0xa25f('0xeb')][_0xa25f('0xef')];}if(_0x3080a0[_0xa25f('0xeb')][_0xa25f('0xf0')]){_0x4d9215[_0xa25f('0xf1')]={'user':_0x3080a0[_0xa25f('0xeb')][_0xa25f('0xf2')],'pass':_0x3080a0[_0xa25f('0xeb')][_0xa25f('0xf3')]};}return respondWithRpcPromise(_0xa25f('0xf4'),_0xa25f('0xf5'),{'account':_0x4d9215,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x3080a0[_0xa25f('0x3a')],_0x3080a0[_0xa25f('0xf6')]||_0x3080a0['Smtp']['user']),'to':_0x5e910d[_0xa25f('0x80')]['mailTranscript'],'subject':_0xa25f('0xf7'),'text':util[_0xa25f('0xd7')](_0xa25f('0xf8'),_0x5e910d[_0xa25f('0x80')]['mailTranscript']),'attachments':[{'path':_0x5a8258}]}})[_0xa25f('0x23')](function(){return _0x3fa53f;})[_0xa25f('0xbf')](function(_0x472698){console[_0xa25f('0x2a')](_0x472698);});}else{return _0x3fa53f;}})[_0xa25f('0x23')](respondWithStatusCode(_0x26bf41,0xc8))[_0xa25f('0xbf')](handleError(_0x26bf41,null));};exports[_0xa25f('0xf9')]=function(_0x4c28a4,_0x21eacb,_0x29779c){return db[_0xa25f('0xda')][_0xa25f('0x6d')]({'where':{'id':_0x4c28a4[_0xa25f('0xbc')]['id']}})[_0xa25f('0x23')](handleEntityNotFound(_0x21eacb,null))[_0xa25f('0x23')](function(_0x16eb64){if(_0x16eb64){return _0x16eb64['addMessage'](_0x4c28a4[_0xa25f('0x80')][_0xa25f('0xfa')],_[_0xa25f('0xfb')](_0x4c28a4[_0xa25f('0x80')],[_0xa25f('0xfa'),'id'])||{});}})['then'](respondWithResult(_0x21eacb,null))[_0xa25f('0xbf')](handleError(_0x21eacb,null));};exports[_0xa25f('0xfc')]=function(_0x5a64da,_0x33fcbe,_0x10993a){var _0xa489ca={'raw':![],'where':{}};var _0x1ed641={};var _0x30d7cc={'count':0x0,'rows':[]};return db[_0xa25f('0x43')][_0xa25f('0xd2')]({'where':{'id':_0x5a64da['params']['id']}})[_0xa25f('0x23')](handleEntityNotFound(_0x33fcbe,null))[_0xa25f('0x23')](function(_0x3f239d){if(_0x3f239d){_0x1ed641['model']=_[_0xa25f('0x48')](db[_0xa25f('0xda')][_0xa25f('0x44')]);_0x1ed641[_0xa25f('0x49')]=_[_0xa25f('0x48')](_0x5a64da[_0xa25f('0x49')]);_0x1ed641[_0xa25f('0x4a')]=_[_0xa25f('0x4b')](_0x1ed641[_0xa25f('0x4c')],_0x1ed641['query']);_0xa489ca[_0xa25f('0x4d')]=_[_0xa25f('0x4b')](_0x1ed641[_0xa25f('0x4c')],qs[_0xa25f('0x4e')](_0x5a64da[_0xa25f('0x49')]['fields']));_0xa489ca['attributes']=_0xa489ca['attributes'][_0xa25f('0x4f')]?_0xa489ca[_0xa25f('0x4d')]:_0x1ed641[_0xa25f('0x4c')];if(!_0x5a64da[_0xa25f('0x49')][_0xa25f('0xfd')](_0xa25f('0x50'))){_0xa489ca[_0xa25f('0x32')]=qs[_0xa25f('0x32')](_0x5a64da[_0xa25f('0x49')][_0xa25f('0x32')]);_0xa489ca[_0xa25f('0x31')]=qs[_0xa25f('0x31')](_0x5a64da['query'][_0xa25f('0x31')]);}_0xa489ca['order']=qs['sort'](_0x5a64da[_0xa25f('0x49')]['sort']);_0xa489ca['where']=qs[_0xa25f('0x4a')](_[_0xa25f('0x54')](_0x5a64da[_0xa25f('0x49')],_0x1ed641[_0xa25f('0x4a')]));_0xa489ca[_0xa25f('0x53')][_0xa25f('0xb8')]=_0x3f239d['id'];if(_0x5a64da[_0xa25f('0x49')]['filter']){_0xa489ca['where']=_[_0xa25f('0xa4')](_0xa489ca[_0xa25f('0x53')],{'$or':_[_0xa25f('0x3d')](_0xa489ca['attributes'],function(_0x9d43ce){var _0x461bbe={};_0x461bbe[_0x9d43ce]={'$like':'%'+_0x5a64da[_0xa25f('0x49')][_0xa25f('0x94')]+'%'};return _0x461bbe;})});}if(_0x5a64da[_0xa25f('0x49')][_0xa25f('0x89')]){var _0x1006bd=_0x5a64da['query']['$gte'][_0xa25f('0x74')](',');var _0x750e9e={};_0x750e9e[_0x1006bd[0x0]]={'$gte':moment(_0x1006bd[0x1])[_0xa25f('0xd7')](_0xa25f('0xfe'))};_0xa489ca[_0xa25f('0x53')]=_[_0xa25f('0xa4')](_0xa489ca['where'],_0x750e9e);}_0xa489ca=_['merge']({},_0xa489ca,_0x5a64da[_0xa25f('0xbe')]);return db[_0xa25f('0xda')][_0xa25f('0x30')]({'where':_0xa489ca[_0xa25f('0x53')]})['then'](function(_0x166b26){_0x30d7cc['count']=_0x166b26;if(_0x5a64da['query']['includeAll']){_0xa489ca[_0xa25f('0xff')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0xa489ca);})['then'](function(_0x121da3){_0x30d7cc[_0xa25f('0xba')]=_0x121da3;return _0x30d7cc;});}})['then'](respondWithFilteredResult(_0x33fcbe,_0xa489ca))[_0xa25f('0xbf')](handleError(_0x33fcbe,null));};exports[_0xa25f('0x100')]=function(_0xcabf2e,_0x39711b,_0x3512e5){var _0x14c03b={'where':{}},_0x1988bb={},_0x1b9b9a={'count':0x0,'rows':[]};return db[_0xa25f('0x43')][_0xa25f('0xd2')]({'where':{'id':_0xcabf2e['params']['id']}})['then'](handleEntityNotFound(_0x39711b,null))[_0xa25f('0x23')](function(_0x107c84){if(_0x107c84){_0x1988bb[_0xa25f('0x4c')]=_['keys'](db[_0xa25f('0xda')][_0xa25f('0x44')]);_0x1988bb[_0xa25f('0x49')]=_[_0xa25f('0x48')](_0xcabf2e['query']);_0x1988bb[_0xa25f('0x4a')]=_['intersection'](_0x1988bb[_0xa25f('0x4c')],_0x1988bb[_0xa25f('0x49')]);_0x14c03b['attributes']=_[_0xa25f('0x4b')](_0x1988bb[_0xa25f('0x4c')],qs[_0xa25f('0x4e')](_0xcabf2e[_0xa25f('0x49')][_0xa25f('0x4e')]));_0x14c03b[_0xa25f('0x4d')]=_0x14c03b[_0xa25f('0x4d')][_0xa25f('0x4f')]?_0x14c03b[_0xa25f('0x4d')]:_0x1988bb[_0xa25f('0x4c')];if(!_0xcabf2e[_0xa25f('0x49')][_0xa25f('0xfd')](_0xa25f('0x50'))){_0x14c03b[_0xa25f('0x32')]=qs[_0xa25f('0x32')](_0xcabf2e[_0xa25f('0x49')][_0xa25f('0x32')]);_0x14c03b[_0xa25f('0x31')]=qs['offset'](_0xcabf2e[_0xa25f('0x49')]['offset']);}_0x14c03b[_0xa25f('0x51')]=qs['sort'](_0xcabf2e['query'][_0xa25f('0x52')]);_0x14c03b[_0xa25f('0x53')]=qs['filters'](_['pick'](_0xcabf2e[_0xa25f('0x49')],_0x1988bb[_0xa25f('0x4a')]));_0x14c03b[_0xa25f('0x53')][_0xa25f('0xb8')]=_0x107c84['id'];if(_0xcabf2e['query'][_0xa25f('0x94')]){_0x14c03b[_0xa25f('0x53')]=_['merge'](_0x14c03b[_0xa25f('0x53')],{'$or':_['map'](_0x14c03b[_0xa25f('0x4d')],function(_0x4de4aa){var _0x4f945a={};_0x4f945a[_0x4de4aa]={'$like':'%'+_0xcabf2e[_0xa25f('0x49')][_0xa25f('0x94')]+'%'};return _0x4f945a;})});}_0x14c03b[_0xa25f('0x53')][_0xa25f('0xe8')]=![];if(_0xcabf2e[_0xa25f('0x49')]['id']){_0x14c03b['where']['id']={'$gt':_0xcabf2e[_0xa25f('0x49')]['id']};}_0x14c03b=_['merge']({},_0x14c03b,_0xcabf2e[_0xa25f('0xbe')]);return db[_0xa25f('0xda')][_0xa25f('0x30')]({'where':_0x14c03b[_0xa25f('0x53')]})['then'](function(_0x217642){_0x1b9b9a['count']=_0x217642;_0x14c03b[_0xa25f('0xff')]=[];if(_0xcabf2e['query'][_0xa25f('0x101')]){_0x14c03b[_0xa25f('0xff')]['push']({'model':db['User'],'as':_0xa25f('0xdc'),'attributes':['id',_0xa25f('0xe5'),_0xa25f('0x102')]});}if(_0xcabf2e[_0xa25f('0x49')]['includeAll']){_0x14c03b[_0xa25f('0xff')]=[{'all':!![]}];}return db['ChatMessage'][_0xa25f('0x103')](_0x14c03b);})['then'](function(_0xdb4e26){_0x1b9b9a[_0xa25f('0xba')]=_0xdb4e26;return _0x1b9b9a;});}})['then'](respondWithFilteredResult(_0x39711b,_0x14c03b))[_0xa25f('0xbf')](handleError(_0x39711b,null));};exports[_0xa25f('0x104')]=function(_0x96e5d8,_0x19928a,_0x8c84d3){return db[_0xa25f('0x43')][_0xa25f('0x6d')]({'where':{'id':_0x96e5d8[_0xa25f('0xbc')]['id']}})[_0xa25f('0x23')](handleEntityNotFound(_0x19928a,null))[_0xa25f('0x23')](function(_0xf37871){if(_0xf37871){return _0xf37871[_0xa25f('0x105')](_0x96e5d8[_0xa25f('0x80')][_0xa25f('0xfa')],_[_0xa25f('0xfb')](_0x96e5d8['body'],[_0xa25f('0xfa'),'id'])||{})[_0xa25f('0x106')](function(){return db['Tag'][_0xa25f('0x103')]({'attributes':['id','name',_0xa25f('0x57')],'where':{'id':_0x96e5d8[_0xa25f('0x80')][_0xa25f('0xfa')]}});})['then'](function(_0x5e2ab2){socket[_0xa25f('0x107')](_0xa25f('0x108'),{'id':Number(_0x96e5d8['params']['id']),'tags':_0x5e2ab2||[]});return{'id':Number(_0x96e5d8[_0xa25f('0xbc')]['id']),'tags':_0x5e2ab2||[]};});}})['then'](respondWithResult(_0x19928a,null))[_0xa25f('0xbf')](handleError(_0x19928a,null));};exports[_0xa25f('0x109')]=function(_0x1254d0,_0x5c42c5,_0x76b84){return db[_0xa25f('0x43')][_0xa25f('0x6d')]({'where':{'id':_0x1254d0[_0xa25f('0xbc')]['id']}})[_0xa25f('0x23')](handleEntityNotFound(_0x5c42c5,null))[_0xa25f('0x23')](function(_0x1e6eb4){if(_0x1e6eb4){return _0x1e6eb4[_0xa25f('0x109')](_0x1254d0['query']['ids']);}})[_0xa25f('0x23')](respondWithStatusCode(_0x5c42c5,null))[_0xa25f('0xbf')](handleError(_0x5c42c5,null));};exports[_0xa25f('0xd3')]=function(_0x19f6b2,_0x96648d){var _0x2c7359=moment()[_0xa25f('0x10a')]()[_0xa25f('0xa3')]();var _0x226a28=path[_0xa25f('0xd4')](config['root'],_0xa25f('0x10b'),'files',_0xa25f('0x10c'));var _0x46a2be=path[_0xa25f('0xd4')](config['root'],_0xa25f('0x10b'),_0xa25f('0x10d'),_0xa25f('0x10e'));var _0x41fc1d=path[_0xa25f('0xd4')](_0x226a28,_0x2c7359);var _0x9547cf=util[_0xa25f('0xd7')](_0xa25f('0x10f'),_0x19f6b2[_0xa25f('0xbc')]['id'],_0x2c7359);var _0xc6d3fd=path[_0xa25f('0xd4')](_0x226a28,_0x9547cf);var _0x3799dc=[];_0x3799dc[_0xa25f('0x41')]({'model':db[_0xa25f('0xdc')],'as':_0xa25f('0xdc'),'attributes':['id','fullname'],'raw':!![]});_0x3799dc[_0xa25f('0x41')]({'model':db[_0xa25f('0xde')],'as':'Contact','attributes':['id','firstName',_0xa25f('0x110')],'raw':!![]});if(_0x19f6b2['query'][_0xa25f('0x10e')]){_0x3799dc['push']({'model':db['Attachment'],'as':_0xa25f('0xd0'),'raw':!![]});}var _0xeb16af=[{'model':db[_0xa25f('0xda')],'as':'Messages','attributes':['id',_0xa25f('0x80'),_0xa25f('0x87'),_0xa25f('0x111'),_0xa25f('0xe8'),_0xa25f('0x8f')],'include':_0x3799dc}];_0xeb16af[_0xa25f('0x41')]({'model':db['ChatWebsite'],'as':_0xa25f('0x112'),'attributes':['id',_0xa25f('0x3a')]});_0xeb16af[_0xa25f('0x41')]({'model':db[_0xa25f('0xdc')],'as':'Owner','attributes':['id',_0xa25f('0xe5')]});return db[_0xa25f('0x43')]['find']({'where':{'id':_0x19f6b2['params']['id']},'include':_0xeb16af})[_0xa25f('0x23')](handleEntityNotFound(_0x96648d,null))['then'](function(_0x191004){if(_0x191004){var _0x10c910=_0x191004[_0xa25f('0x113')]({'plain':!![]});fs['mkdirSync'](_0x41fc1d);var _0x14f32a={'format':'A4','border':'10px','header':{'height':_0xa25f('0x114'),'contents':{'first':_0xa25f('0x115')}},'footer':{'height':_0xa25f('0x116'),'contents':{'default':util['format'](_0xa25f('0x117'),util[_0xa25f('0xd7')](_0xa25f('0x118'),_0xa25f('0x119'),_0x10c910['id']),moment()['format'](_0xa25f('0x11a'))['toString']())}}};var _0x3f29e4={'channel':_0xa25f('0x119'),'account':_0x10c910[_0xa25f('0x112')]['name'],'agent':_0x10c910[_0xa25f('0x11b')]?_0x10c910[_0xa25f('0x11b')][_0xa25f('0xe5')]:'N.A.','createdAt':moment(_0x10c910[_0xa25f('0x87')])[_0xa25f('0xd7')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa25f('0xa3')](),'closedAt':_0x10c910[_0xa25f('0xc8')]?moment(_0x10c910[_0xa25f('0x11c')])[_0xa25f('0xd7')](_0xa25f('0xfe'))[_0xa25f('0xa3')]():'','disposition':_0x10c910[_0xa25f('0xc9')],'chatInfo':{'browser':_0x10c910[_0xa25f('0x11d')],'os':_0x10c910[_0xa25f('0x11e')],'referer':_0x10c910[_0xa25f('0x11f')],'customerIp':_0x10c910[_0xa25f('0x120')],'customerPort':_0x10c910[_0xa25f('0x121')]?_0x10c910[_0xa25f('0x121')]:_0xa25f('0x122')},'messages':_(_0x10c910[_0xa25f('0xdb')])[_0xa25f('0x123')]()[_0xa25f('0x94')]({'secret':![]})[_0xa25f('0x3d')](function(_0x2f3650){if(_0x2f3650[_0xa25f('0xd0')]){var _0x1a3d5d=path[_0xa25f('0xd4')](_0x46a2be,_0x2f3650[_0xa25f('0xd0')][_0xa25f('0xcd')]);if(fs[_0xa25f('0x124')](_0x1a3d5d)){fs[_0xa25f('0x125')](_0x1a3d5d)[_0xa25f('0x126')](fs[_0xa25f('0x127')](path[_0xa25f('0xd4')](_0x41fc1d,_0x2f3650[_0xa25f('0xd0')][_0xa25f('0xcd')])));}}return{'date':moment(_0x2f3650[_0xa25f('0x87')])[_0xa25f('0xd7')](_0xa25f('0xfe'))[_0xa25f('0xa3')](),'sender':_0x2f3650['direction']===_0xa25f('0x128')?_0x2f3650[_0xa25f('0xdc')]?_0x2f3650[_0xa25f('0xdc')][_0xa25f('0xe5')]:_0xa25f('0xe0'):_0x2f3650[_0xa25f('0x129')][_0xa25f('0x12a')]+(_0x2f3650[_0xa25f('0x129')][_0xa25f('0x110')]?'\x20'+_0x2f3650[_0xa25f('0x129')][_0xa25f('0x110')]:''),'body':_0x2f3650['Attachment']?_0x2f3650['Attachment'][_0xa25f('0xcd')]:_0x2f3650['body'],'direction':_0x2f3650[_0xa25f('0x111')]===_0xa25f('0x128')?'A':'C','secret':_0x2f3650[_0xa25f('0xe8')],'read':_0x2f3650[_0xa25f('0x8f')],'attachment':_0x2f3650['Attachment']};})['value']()};return ejs[_0xa25f('0x12b')](path[_0xa25f('0xd4')](config['root'],'server',_0xa25f('0x12c'),_0xa25f('0x12d')),{'interaction':_0x3f29e4})[_0xa25f('0x23')](function(_0x424cca){return new BPromise(function(_0x405909,_0x2e9d8){pdf[_0xa25f('0xc0')](_0x424cca,_0x14f32a)[_0xa25f('0x12e')](path[_0xa25f('0xd4')](_0x41fc1d,'transcript-'+_0x10c910['id']+'-'+_0x2c7359+_0xa25f('0x12f')),function(_0x4e544a,_0x21e921){if(_0x4e544a)return _0x2e9d8(_0x4e544a);_0x405909(_0x21e921);});});})[_0xa25f('0x23')](function(){return new BPromise(function(_0x293b5d,_0x10f89a){zipdir(_0x41fc1d,{'saveTo':_0xc6d3fd},function(_0x1d8e74,_0x5f246d){if(_0x1d8e74)return _0x10f89a(_0x1d8e74);return _0x293b5d(_0x5f246d);});})['then'](function(){return new BPromise(function(_0xf669d5,_0x530bd5){rimraf(_0x41fc1d,function(_0x34e62a){if(_0x34e62a)_0x530bd5(_0x34e62a);return _0xf669d5();});});})[_0xa25f('0x23')](function(){return _0x96648d['download'](_0xc6d3fd,_0x9547cf,function(_0x1f4c57){if(_0x1f4c57){console[_0xa25f('0x130')]('err',_0x1f4c57);}else{fs[_0xa25f('0x131')](_0xc6d3fd);}});});});}else{return _0x96648d[_0xa25f('0x2d')](0xc8);}})[_0xa25f('0xbf')](handleError(_0x96648d,null));}; \ No newline at end of file +var _0xda19=['user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','length','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','split','value','find','ContactId','text','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','start','body','keys','compact','ChatWebsiteId','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','journey','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','push','all','show','includeAll','include','merge','options','create','params','describe','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','closed','disposition','AbandonInteraction','abandon','attachmentUpload','file','originalname','basename','mimetype','findOne','Attachment','download','server/files/attachments/','close','mailTranscript','join','root','server/files/chat/upload/','now','ChatMessage','Messages','ChatWebsite','format','agentAlias','System','%s%d','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','includeAgent','findAll','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','transcript-%d-%s.zip','CmContact','lastName','attachments','Account','Owner','get','mkdirSync','10px','40px','30px','%s\x20#%d','Chat','YYYY-MM-DD','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','out','firstName','toFile','transcript-','err','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','localhost','socket.io-emitter','register','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','status','json','count','offset','limit','set','apply','reject','update','end','sendStatus','stack','name','map','fullname','Tags','TagIds','forEach','index','ChatInteraction','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','select','field','color','from','u.id','u.fullname','ui.ChatInteractionId'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xda19,0xd5));var _0x9da1=function(_0x2c1ab6,_0x2748ba){_0x2c1ab6=_0x2c1ab6-0x0;var _0x39be2d=_0xda19[_0x2c1ab6];return _0x39be2d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9da1('0x0'));var rimraf=require(_0x9da1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9da1('0x2'));var rp=require('request-promise');var moment=require(_0x9da1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9da1('0x4'));var util=require(_0x9da1('0x5'));var path=require(_0x9da1('0x6'));var sox=require(_0x9da1('0x7'));var csv=require(_0x9da1('0x8'));var ejs=require(_0x9da1('0x9'));var fs=require('fs');var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x9da1('0x16')]=_['defaults'](config[_0x9da1('0x16')],{'host':_0x9da1('0x17'),'port':0x18eb});var socket=require(_0x9da1('0x18'))(new Redis(config[_0x9da1('0x16')]));require('./chatInteraction.socket')[_0x9da1('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x9da1('0x1a')]({'port':0x232b});var client9004=jayson['client'][_0x9da1('0x1a')]({'port':0x232c});function checkPasswordPattern(_0x43c093,_0x37653d,_0x1a1a6b){if(_0x1a1a6b){var _0x7f1a64=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x7f1a64['test'](_0x37653d)){return _0x43c093;}else{throw new db[(_0x9da1('0x1b'))][(_0x9da1('0x1c'))](_0x9da1('0x1d'));}}else{return _0x43c093;}}function respondWithRpcPromise(_0x77347a,_0xfb278d,_0x42a9c7,_0x497676){return new BPromise(function(_0x4d4541,_0x17205d){var _0x8da712=_0x497676||client;return _0x8da712[_0x9da1('0x1e')](_0x77347a,_0x42a9c7)[_0x9da1('0x1f')](function(_0x40a967){logger[_0x9da1('0x20')](_0x9da1('0x21'),_0xfb278d,'request\x20sent');logger[_0x9da1('0x22')](_0x9da1('0x23'),_0xfb278d,_0x9da1('0x24'),JSON[_0x9da1('0x25')](_0x40a967));if(_0x40a967[_0x9da1('0x26')]){if(_0x40a967['error']['code']===0x1f4){logger[_0x9da1('0x26')](_0x9da1('0x21'),_0xfb278d,_0x40a967[_0x9da1('0x26')][_0x9da1('0x27')]);return _0x17205d(_0x40a967[_0x9da1('0x26')][_0x9da1('0x27')]);}logger['error'](_0x9da1('0x21'),_0xfb278d,_0x40a967[_0x9da1('0x26')]['message']);return _0x4d4541(_0x40a967[_0x9da1('0x26')][_0x9da1('0x27')]);}else{logger['info'](_0x9da1('0x21'),_0xfb278d,_0x9da1('0x24'));_0x4d4541(_0x40a967['result'][_0x9da1('0x27')]);}})[_0x9da1('0x28')](function(_0x55cd3d){logger['error'](_0x9da1('0x21'),_0xfb278d,_0x55cd3d);_0x17205d(_0x55cd3d);});});}function respondWithStatusCode(_0x47055e,_0x5eca5b){_0x5eca5b=_0x5eca5b||0xcc;return function(_0x27c6e2){if(_0x27c6e2){return _0x47055e['sendStatus'](_0x5eca5b);}return _0x47055e['status'](_0x5eca5b)['end']();};}function respondWithResult(_0x31b826,_0x404b86){_0x404b86=_0x404b86||0xc8;return function(_0x24c6d5){if(_0x24c6d5){return _0x31b826[_0x9da1('0x29')](_0x404b86)[_0x9da1('0x2a')](_0x24c6d5);}};}function respondWithFilteredResult(_0x4c0ade,_0x269628){return function(_0x4e6083){if(_0x4e6083){var _0x1feae0=_0x4e6083[_0x9da1('0x2b')],_0x235ced=_0x269628['offset'],_0x5b38b3=_0x269628[_0x9da1('0x2c')]+_0x269628[_0x9da1('0x2d')],_0xc29ba8;if(_0x5b38b3>=_0x1feae0){_0x5b38b3=_0x1feae0;_0xc29ba8=0xc8;}else{_0xc29ba8=0xce;}_0x4c0ade[_0x9da1('0x29')](_0xc29ba8);return _0x4c0ade[_0x9da1('0x2e')]('Content-Range',_0x235ced+'-'+_0x5b38b3+'/'+_0x1feae0)['json'](_0x4e6083);}return null;};}function patchUpdates(_0x4733c3){return function(_0x354733){try{jsonpatch[_0x9da1('0x2f')](_0x354733,_0x4733c3,!![]);}catch(_0x3ddd57){return BPromise[_0x9da1('0x30')](_0x3ddd57);}return _0x354733['save']();};}function saveUpdates(_0x4b83f3,_0x343c64){return function(_0xd7f28f){if(_0xd7f28f){return _0xd7f28f[_0x9da1('0x31')](_0x4b83f3)[_0x9da1('0x1f')](function(_0x266ee8){return _0x266ee8;});}return null;};}function removeEntity(_0x50c2f5,_0xa43301){return function(_0x5af570){if(_0x5af570){return _0x5af570['destroy']()[_0x9da1('0x1f')](function(){_0x50c2f5['status'](0xcc)[_0x9da1('0x32')]();});}};}function handleEntityNotFound(_0x23b8e5,_0x35be8b){return function(_0x42311c){if(!_0x42311c){_0x23b8e5[_0x9da1('0x33')](0x194);}return _0x42311c;};}function handleError(_0x5efa40,_0x3b280a){_0x3b280a=_0x3b280a||0x1f4;return function(_0x1d6c77){logger['error'](_0x1d6c77[_0x9da1('0x34')]);if(_0x1d6c77['name']){delete _0x1d6c77[_0x9da1('0x35')];}_0x5efa40['status'](_0x3b280a)['send'](_0x1d6c77);};}function getInteractionUsers(_0x1ce0f8,_0x4d1d2e){return new BPromise(function(_0x4593f4,_0x227a1c){try{if(_0x4d1d2e[_0x1ce0f8['id']]){_0x1ce0f8['Users']=_[_0x9da1('0x36')](_0x4d1d2e[_0x1ce0f8['id']],function(_0x1b750f){return{'id':_0x1b750f['id'],'fullname':_0x1b750f[_0x9da1('0x37')]};});}}catch(_0x468d91){_0x227a1c(_0x468d91);}_0x4593f4(_0x1ce0f8);});}function getInteractionTags(_0x56bd49,_0x257c2e){return new BPromise(function(_0x5e7846,_0x2bb9e4){try{if(_0x56bd49['TagIds']){_0x56bd49[_0x9da1('0x38')]=[];_0x56bd49[_0x9da1('0x39')]['split'](',')[_0x9da1('0x3a')](function(_0xca8d9b){_0x56bd49[_0x9da1('0x38')]['push'](_0x257c2e[_0xca8d9b]);});}delete _0x56bd49['TagIds'];}catch(_0x53fc15){_0x2bb9e4(_0x53fc15);}_0x5e7846(_0x56bd49);});}function updateChatInteraction(_0x27e78c,_0x5541c4,_0x5b215c){return new BPromise(function(_0x287afe,_0x118be7){return getInteractionUsers(_0x27e78c,_0x5b215c)[_0x9da1('0x1f')](function(_0x54f188){return getInteractionTags(_0x54f188,_0x5541c4);})[_0x9da1('0x1f')](function(_0x2e1b8b){_0x287afe(_0x2e1b8b);})[_0x9da1('0x28')](function(_0x173dc6){_0x118be7(_0x173dc6);});});}exports[_0x9da1('0x3b')]=function(_0x26c225,_0x28e0b2){var _0x4f78b1={},_0x467350={},_0x515f3f={'count':0x0,'rows':[]};var _0x3bb1da=_['map'](db[_0x9da1('0x3c')][_0x9da1('0x3d')],function(_0x599211){return{'name':_0x599211[_0x9da1('0x3e')],'type':_0x599211[_0x9da1('0x3f')]['key']};});_0x467350[_0x9da1('0x40')]=_['map'](_0x3bb1da,_0x9da1('0x35'));_0x467350[_0x9da1('0x41')]=_['keys'](_0x26c225['query']);_0x467350[_0x9da1('0x42')]=_[_0x9da1('0x43')](_0x467350[_0x9da1('0x40')],_0x467350[_0x9da1('0x41')]);_0x4f78b1[_0x9da1('0x44')]=_[_0x9da1('0x43')](_0x467350[_0x9da1('0x40')],qs[_0x9da1('0x45')](_0x26c225['query'][_0x9da1('0x45')]));_0x4f78b1[_0x9da1('0x44')]=_0x4f78b1[_0x9da1('0x44')]['length']?_0x4f78b1[_0x9da1('0x44')]:_0x467350[_0x9da1('0x40')];if(!_0x26c225[_0x9da1('0x41')]['hasOwnProperty'](_0x9da1('0x46'))){_0x4f78b1[_0x9da1('0x2d')]=qs[_0x9da1('0x2d')](_0x26c225['query'][_0x9da1('0x2d')]);_0x4f78b1['offset']=qs['offset'](_0x26c225[_0x9da1('0x41')][_0x9da1('0x2c')]);}_0x4f78b1['order']=qs[_0x9da1('0x47')](_0x26c225[_0x9da1('0x41')]['sort']);_0x4f78b1[_0x9da1('0x48')]=qs[_0x9da1('0x42')](_[_0x9da1('0x49')](_0x26c225[_0x9da1('0x41')],_0x467350[_0x9da1('0x42')]));var _0x39ca29=[];var _0x24a4e1=squel[_0x9da1('0x4a')]()[_0x9da1('0x4b')]('id')['field'](_0x9da1('0x35'))[_0x9da1('0x4b')](_0x9da1('0x4c'))[_0x9da1('0x4d')]('tools_tags');var _0x59c6da=squel[_0x9da1('0x4a')]()[_0x9da1('0x4b')](_0x9da1('0x4e'))[_0x9da1('0x4b')](_0x9da1('0x4f'))[_0x9da1('0x4b')](_0x9da1('0x50'))[_0x9da1('0x4d')](_0x9da1('0x51'),'ui')[_0x9da1('0x52')](_0x9da1('0x53'),'u',_0x9da1('0x54'));var _0x368ee7=squel[_0x9da1('0x4a')]()['from'](_0x9da1('0x55'),'i')[_0x9da1('0x52')]('cm_contacts','c',_0x9da1('0x56'))['left_join'](_0x9da1('0x53'),'o','o.id\x20=\x20i.UserId')[_0x9da1('0x52')](_0x9da1('0x57'),'a',_0x9da1('0x58'))[_0x9da1('0x52')](_0x9da1('0x59'),'me',_0x9da1('0x5a'))[_0x9da1('0x52')](_0x9da1('0x5b'),'it',_0x9da1('0x5c'))[_0x9da1('0x52')]('tools_tags','t',_0x9da1('0x5d'));var _0x1de7d9=squel[_0x9da1('0x5e')]();var _0xa125d7=[];var _0x2aae1b=squel[_0x9da1('0x5e')]();var _0x2020d0;if(_0x26c225[_0x9da1('0x41')][_0x9da1('0x5f')]){_0x2020d0=as[_0x9da1('0x60')](_0x26c225['query'][_0x9da1('0x5f')]);var _0x374a1a=_0x2020d0['sqlOperator'];for(var _0x39e79e=0x0;_0x39e79e<_0x2020d0[_0x9da1('0x61')][_0x9da1('0x62')];_0x39e79e++){var _0x1bd260=_0x2020d0[_0x9da1('0x61')][_0x39e79e];var _0x13d94e='i';var _0x3081d7=_['find'](_0x3bb1da,[_0x9da1('0x35'),_0x1bd260[_0x9da1('0x4b')]]);if(!_0x3081d7){switch(_0x1bd260[_0x9da1('0x4b')]){case _0x9da1('0x63'):if(_0x1bd260['value']==0x1){_0x368ee7[_0x9da1('0x64')]('`'+_0x1bd260['field']+_0x9da1('0x65'));}else{_0x368ee7[_0x9da1('0x64')]('`'+_0x1bd260[_0x9da1('0x4b')]+_0x9da1('0x66'));}break;case _0x9da1('0x67'):if(_0x1bd260[_0x9da1('0x68')]==='$substring'){if(_0x1bd260['value'][_0x9da1('0x69')]('\x20')['length']>0x1){_0x1de7d9[_0x374a1a]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x1bd260[_0x9da1('0x6a')]),null);}else{var _0x497d49='%'+_0x1bd260[_0x9da1('0x6a')]+'%';_0x1de7d9[_0x374a1a]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x497d49,_0x497d49,_0x497d49);}}else{_0x3081d7=_[_0x9da1('0x6b')](_0x3bb1da,[_0x9da1('0x35'),'ContactId']);_0x1bd260[_0x9da1('0x4b')]=_0x9da1('0x6c');_0x5b6d9f=as['buildExpression'](_0x13d94e,_0x3081d7[_0x9da1('0x3f')],_0x1bd260);_0x1de7d9[_0x374a1a](_0x5b6d9f[_0x9da1('0x6d')],_0x5b6d9f['value']['start'],_0x5b6d9f[_0x9da1('0x6a')][_0x9da1('0x32')]);}break;case _0x9da1('0x6e'):var _0x3ca531=_0x1bd260[_0x9da1('0x6a')][_0x9da1('0x69')](',')['map'](function(_0x3d2c25){return Number(_0x3d2c25);});_0x3ca531['forEach'](function(_0x590d3b){_0x2aae1b['or'](_0x9da1('0x6f'),'%,'+_0x590d3b+',%');});_0xa125d7=_[_0x9da1('0x70')](_0xa125d7,_0x3ca531);break;case _0x9da1('0x71'):if(_0x1bd260[_0x9da1('0x68')]===_0x9da1('0x72')){_0x1de7d9[_0x374a1a](_0x9da1('0x73'),'%'+_0x1bd260[_0x9da1('0x6a')]+'%',null);}else{_0x3081d7=_[_0x9da1('0x6b')](_0x3bb1da,[_0x9da1('0x35'),'UserId']);_0x1bd260[_0x9da1('0x4b')]=_0x9da1('0x74');_0x5b6d9f=as[_0x9da1('0x75')](_0x13d94e,_0x3081d7[_0x9da1('0x3f')],_0x1bd260);_0x1de7d9[_0x374a1a](_0x5b6d9f[_0x9da1('0x6d')],_0x5b6d9f['value'][_0x9da1('0x76')],_0x5b6d9f[_0x9da1('0x6a')][_0x9da1('0x32')]);}break;case _0x9da1('0x77'):_0x5b6d9f=as[_0x9da1('0x75')]('me',null,_0x1bd260);_0x1de7d9[_0x374a1a](_0x5b6d9f[_0x9da1('0x6d')],_0x5b6d9f['value'][_0x9da1('0x76')],_0x5b6d9f['value'][_0x9da1('0x32')]);break;}}else{var _0x5b6d9f=as[_0x9da1('0x75')](_0x13d94e,_0x3081d7[_0x9da1('0x3f')],_0x1bd260);_0x1de7d9[_0x374a1a](_0x5b6d9f[_0x9da1('0x6d')],_0x5b6d9f[_0x9da1('0x6a')]['start'],_0x5b6d9f['value']['end']);}}}else{var _0x73a2fc=_(_0x26c225[_0x9da1('0x41')])[_0x9da1('0x78')]()[_0x9da1('0x36')](function(_0x4aa5f3){return _['some'](_0x3bb1da,[_0x9da1('0x35'),_0x4aa5f3])?_0x4aa5f3:undefined;})[_0x9da1('0x79')]()[_0x9da1('0x6a')]();if(!_['isEmpty'](_0x73a2fc)){_0x73a2fc['forEach'](function(_0x343d6d){if(_0x343d6d===_0x9da1('0x7a')){_0x368ee7[_0x9da1('0x48')]('i.ChatWebsiteId\x20IN\x20?',[]['concat'](_0x26c225[_0x9da1('0x41')][_0x343d6d]));}else if(_0x343d6d===_0x9da1('0x7b')){var _0x27c9a0=JSON[_0x9da1('0x7c')](_0x26c225[_0x9da1('0x41')][_0x343d6d])['$gte'];var _0x3dcb6b=JSON[_0x9da1('0x7c')](_0x26c225[_0x9da1('0x41')][_0x343d6d])[_0x9da1('0x7d')];_0x368ee7['where'](_0x9da1('0x7e'),_0x27c9a0,_0x3dcb6b);}else{if(_0x26c225[_0x9da1('0x41')][_0x343d6d]===_0x9da1('0x7f')){_0x368ee7['where']('i.'+_0x343d6d+_0x9da1('0x80'));}else{_0x368ee7[_0x9da1('0x48')]('i.'+_0x343d6d+_0x9da1('0x81'),_0x26c225['query'][_0x343d6d]);}}});}if(_0x26c225[_0x9da1('0x41')][_0x9da1('0x82')]){if(_0x26c225['query'][_0x9da1('0x82')]==0x1){_0x368ee7['having'](_0x9da1('0x83'));}else{_0x368ee7['having'](_0x9da1('0x84'));}}if(_0x26c225[_0x9da1('0x41')][_0x9da1('0x85')]){_0xa125d7=_[_0x9da1('0x86')](_0x26c225[_0x9da1('0x41')][_0x9da1('0x85')])?_0x26c225[_0x9da1('0x41')][_0x9da1('0x85')]:new Array(_0x26c225[_0x9da1('0x41')][_0x9da1('0x85')]);_0xa125d7[_0x9da1('0x3a')](function(_0x2bd73d){_0x2aae1b['or'](_0x9da1('0x6f'),'%,'+_0x2bd73d+',%');});}if(_0x26c225['query'][_0x9da1('0x87')]){var _0x30c5a8=_0x26c225[_0x9da1('0x41')][_0x9da1('0x87')][_0x9da1('0x88')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x9da1('0x89'));if(qs[_0x9da1('0x8a')](_0x30c5a8)){_0x1de7d9['or']('i.id\x20LIKE\x20?',_0x30c5a8+'%');}else{_0x1de7d9['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9da1('0x8b')](_0x30c5a8))['or'](_0x9da1('0x8c'),_0x30c5a8+'%');}}}_0x368ee7[_0x9da1('0x48')](_0x1de7d9);_0x368ee7[_0x9da1('0x8d')](_0x9da1('0x8e'));var _0x4701b3={'type':db[_0x9da1('0x1b')][_0x9da1('0x8f')][_0x9da1('0x90')],'raw':!![]};var _0x1d02ff=_0x368ee7[_0x9da1('0x91')]();_0x1d02ff[_0x9da1('0x4b')](_0x9da1('0x8e'));_0x1d02ff['field'](_0x9da1('0x92'),_0x9da1('0x63'));if(_0x4f78b1[_0x9da1('0x93')]){_0x4f78b1[_0x9da1('0x93')][_0x9da1('0x3a')](function(_0x5e6b67){_0x368ee7[_0x9da1('0x93')]('i.'+_0x5e6b67[0x0],_0x5e6b67[0x1]===_0x9da1('0x94')?![]:!![]);});}if(!_['isEmpty'](_0xa125d7)){_0x368ee7[_0x9da1('0x64')](_0x2aae1b);_0x1d02ff['where'](_0x9da1('0x95'),_0xa125d7);}BPromise['resolve']()[_0x9da1('0x1f')](function(){if(!_0x2020d0){if(_0x26c225[_0x9da1('0x41')][_0x9da1('0x7a')]||_0x26c225[_0x9da1('0x41')][_0x9da1('0x96')])return;_0x1d02ff[_0x9da1('0x48')](_0x9da1('0x97'));_0x368ee7[_0x9da1('0x48')](_0x9da1('0x97'));return;}return _0x26c225[_0x9da1('0x98')][_0x9da1('0x99')]({'attributes':['id'],'raw':!![]})[_0x9da1('0x1f')](function(_0x5d329c){if(_[_0x9da1('0x9a')](_0x5d329c)){_0x1d02ff[_0x9da1('0x48')](_0x9da1('0x9b'));_0x368ee7[_0x9da1('0x48')](_0x9da1('0x9b'));}else{_0x1d02ff[_0x9da1('0x48')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x5d329c,'id'));_0x368ee7[_0x9da1('0x48')](_0x9da1('0x9c'),_[_0x9da1('0x36')](_0x5d329c,'id'));}});})['then'](function(){db[_0x9da1('0x9d')][_0x9da1('0x41')](_0x1d02ff[_0x9da1('0x9e')](),_0x4701b3)[_0x9da1('0x1f')](function(_0x210e49){_0x515f3f[_0x9da1('0x2b')]=_0x210e49[_0x9da1('0x62')];if(_0x515f3f['count']===0x0)return[];return db[_0x9da1('0x9d')][_0x9da1('0x41')](_0x24a4e1['toString'](),_0x4701b3)['then'](function(_0x392d19){_0x39ca29=_['keyBy'](_0x392d19,'id');_0x4701b3=_['merge'](_0x4701b3,{'model':db[_0x9da1('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x26c225[_0x9da1('0x41')][_0x9da1('0x45')]){_0x4f78b1[_0x9da1('0x44')][_0x9da1('0x3a')](function(_0x30065d){_0x368ee7[_0x9da1('0x4b')]('i.'+_0x30065d);});}else{_0x368ee7[_0x9da1('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x368ee7[_0x9da1('0x4b')](_0x9da1('0x9f'),_0x9da1('0xa0'));_0x368ee7[_0x9da1('0x4b')](_0x9da1('0xa1'),_0x9da1('0xa2'));_0x368ee7[_0x9da1('0x4b')](_0x9da1('0xa3'));_0x368ee7['field'](_0x9da1('0xa4'),'Contact.firstName');_0x368ee7[_0x9da1('0x4b')](_0x9da1('0xa5'),_0x9da1('0xa6'));_0x368ee7[_0x9da1('0x4b')](_0x9da1('0xa7'),_0x9da1('0xa8'));_0x368ee7[_0x9da1('0x4b')]('c.phone',_0x9da1('0xa9'));_0x368ee7['field'](_0x9da1('0xaa'),_0x9da1('0xab'));_0x368ee7[_0x9da1('0x4b')](_0x9da1('0xac'),'Contact.fax');_0x368ee7[_0x9da1('0x4b')](_0x9da1('0xad'),_0x9da1('0xae'));_0x368ee7[_0x9da1('0x4b')](_0x9da1('0xaf'),_0x9da1('0xb0'));_0x368ee7[_0x9da1('0x4b')](_0x9da1('0xb1'),_0x9da1('0x39'));}_0x368ee7[_0x9da1('0x2d')](_0x4f78b1[_0x9da1('0x2d')]);_0x368ee7[_0x9da1('0x2c')](_0x4f78b1[_0x9da1('0x2c')]);return db[_0x9da1('0x9d')]['query'](_0x368ee7[_0x9da1('0x9e')](),_0x4701b3);})['then'](function(_0x4a06b3){_0x59c6da['where'](_0x9da1('0xb2'),_[_0x9da1('0x36')](_0x4a06b3,'id'));return db[_0x9da1('0x9d')][_0x9da1('0x41')](_0x59c6da[_0x9da1('0x9e')](),_0x4701b3)[_0x9da1('0x1f')](function(_0x35b73e){var _0x25afb2=_['groupBy'](_0x35b73e,_0x9da1('0xb3'));var _0x1d4552=[];_0x4a06b3['forEach'](function(_0x329d99){_0x1d4552[_0x9da1('0xb4')](updateChatInteraction(_0x329d99,_0x39ca29,_0x25afb2));});return BPromise[_0x9da1('0xb5')](_0x1d4552);});});})['then'](function(_0x5ce039){_0x515f3f['rows']=_0x5ce039;return _0x515f3f;})[_0x9da1('0x1f')](respondWithFilteredResult(_0x28e0b2,_0x4f78b1));})[_0x9da1('0x28')](handleError(_0x28e0b2,null));};exports[_0x9da1('0xb6')]=function(_0x4a49af,_0x5071b1){var _0x386083={'raw':![],'where':{'id':_0x4a49af['params']['id']}},_0x3b67af={};_0x3b67af[_0x9da1('0x40')]=_['keys'](db['ChatInteraction']['rawAttributes']);_0x3b67af[_0x9da1('0x41')]=_[_0x9da1('0x78')](_0x4a49af[_0x9da1('0x41')]);_0x3b67af[_0x9da1('0x42')]=_[_0x9da1('0x43')](_0x3b67af[_0x9da1('0x40')],_0x3b67af[_0x9da1('0x41')]);_0x386083[_0x9da1('0x44')]=_[_0x9da1('0x43')](_0x3b67af[_0x9da1('0x40')],qs[_0x9da1('0x45')](_0x4a49af['query']['fields']));_0x386083['attributes']=_0x386083[_0x9da1('0x44')][_0x9da1('0x62')]?_0x386083['attributes']:_0x3b67af[_0x9da1('0x40')];if(_0x4a49af[_0x9da1('0x41')][_0x9da1('0xb7')]){_0x386083[_0x9da1('0xb8')]=[{'all':!![]}];}_0x386083=_[_0x9da1('0xb9')]({},_0x386083,_0x4a49af[_0x9da1('0xba')]);return db[_0x9da1('0x3c')][_0x9da1('0x6b')](_0x386083)['then'](handleEntityNotFound(_0x5071b1,null))[_0x9da1('0x1f')](respondWithResult(_0x5071b1,null))[_0x9da1('0x28')](handleError(_0x5071b1,null));};exports[_0x9da1('0xbb')]=function(_0x188d27,_0x2ec20c){return db['ChatInteraction'][_0x9da1('0xbb')](_0x188d27['body'],{})[_0x9da1('0x1f')](respondWithResult(_0x2ec20c,0xc9))[_0x9da1('0x28')](handleError(_0x2ec20c,null));};exports[_0x9da1('0x31')]=function(_0x4897e6,_0x4a258d){if(_0x4897e6[_0x9da1('0x77')]['id']){delete _0x4897e6[_0x9da1('0x77')]['id'];}return db[_0x9da1('0x3c')]['find']({'where':{'id':_0x4897e6[_0x9da1('0xbc')]['id']}})[_0x9da1('0x1f')](handleEntityNotFound(_0x4a258d,null))['then'](saveUpdates(_0x4897e6[_0x9da1('0x77')],null))[_0x9da1('0x1f')](respondWithResult(_0x4a258d,null))['catch'](handleError(_0x4a258d,null));};exports['destroy']=function(_0x489b3f,_0x1133d7){return db['ChatInteraction'][_0x9da1('0x6b')]({'where':{'id':_0x489b3f[_0x9da1('0xbc')]['id']}})[_0x9da1('0x1f')](handleEntityNotFound(_0x1133d7,null))[_0x9da1('0x1f')](removeEntity(_0x1133d7,null))[_0x9da1('0x28')](handleError(_0x1133d7,null));};exports[_0x9da1('0xbd')]=function(_0x53412e,_0x355a71){return db[_0x9da1('0x3c')]['describe']()[_0x9da1('0x1f')](respondWithResult(_0x355a71,null))[_0x9da1('0x28')](handleError(_0x355a71,null));};exports[_0x9da1('0xbe')]=function(_0x1b6d98,_0x5c5368){if(_0x1b6d98[_0x9da1('0x77')]['id']){delete _0x1b6d98[_0x9da1('0x77')]['id'];}return db[_0x9da1('0x3c')][_0x9da1('0x6b')]({'where':{'id':_0x1b6d98[_0x9da1('0xbc')]['id']}})[_0x9da1('0x1f')](handleEntityNotFound(_0x5c5368,null))[_0x9da1('0x1f')](saveUpdates(_0x1b6d98[_0x9da1('0x77')],null))['then'](respondWithResult(_0x5c5368,null))[_0x9da1('0x28')](handleError(_0x5c5368,null));};exports['abandon']=function(_0x3dd3e0,_0x356d6d,_0x8f947a){if(_0x3dd3e0[_0x9da1('0x77')]['id']){delete _0x3dd3e0[_0x9da1('0x77')]['id'];}return db[_0x9da1('0x3c')][_0x9da1('0x6b')]({'where':{'id':_0x3dd3e0[_0x9da1('0xbc')]['id']}})['then'](function(_0x1b0359){if(!_0x1b0359){logger[_0x9da1('0x26')](_0x9da1('0xbf'),'abandon',0x194,'entity\x20not\x20found');_0x356d6d[_0x9da1('0x33')](0x194);}else{if(_0x1b0359['UserId']){throw new db['Sequelize']['ValidationError']('Interaction\x20already\x20assigned');}}return _0x1b0359;})['then'](function(_0x17f6a1){if(_0x17f6a1){return _0x17f6a1[_0x9da1('0x31')]({'closed':_0x3dd3e0[_0x9da1('0x77')][_0x9da1('0xc0')],'disposition':_0x3dd3e0['body'][_0x9da1('0xc1')]})[_0x9da1('0x1f')](function(_0x21a99d){return _0x21a99d;});}})[_0x9da1('0x1f')](function(_0x455c02){return respondWithRpcPromise(_0x9da1('0xc2'),_0x9da1('0xc3'),_0x3dd3e0[_0x9da1('0x77')],client9004);})[_0x9da1('0x1f')](respondWithResult(_0x356d6d,null))[_0x9da1('0x28')](handleError(_0x356d6d,null));};exports[_0x9da1('0xc4')]=function(_0x505908,_0x25021d,_0x458384){_0x505908['body']['name']=_0x505908[_0x9da1('0xc5')][_0x9da1('0xc6')];_0x505908[_0x9da1('0x77')][_0x9da1('0xc7')]=_0x505908[_0x9da1('0xc5')]['filename'];_0x505908[_0x9da1('0x77')]['type']=_0x505908[_0x9da1('0xc5')][_0x9da1('0xc8')];return db['Attachment'][_0x9da1('0xbb')](_0x505908[_0x9da1('0x77')])[_0x9da1('0x1f')](respondWithResult(_0x25021d,0xc9))[_0x9da1('0x28')](handleError(_0x25021d,null));};exports['attachmentDownload']=function(_0x44fedf,_0x5afefa,_0x47cbdd){return db['ChatInteraction'][_0x9da1('0xc9')]({'where':{'id':_0x44fedf[_0x9da1('0xbc')]['id']},'raw':!![]})[_0x9da1('0x1f')](handleEntityNotFound(_0x5afefa,null))['then'](function(_0x17307a){if(_0x17307a){if(_0x17307a[_0x9da1('0xc0')]){return _0x5afefa['status'](0x193)[_0x9da1('0x2a')]({'status':0x193,'message':'Unauthorized'});}return db[_0x9da1('0xca')]['findOne']({'where':{'id':_0x44fedf['query']['attachId']},'raw':!![]})[_0x9da1('0x1f')](handleEntityNotFound(_0x5afefa,null));}})['then'](function(_0x425581){if(_0x425581){return _0x5afefa[_0x9da1('0xcb')](path['join'](config['root'],_0x9da1('0xcc'),_0x425581['basename']));}})[_0x9da1('0x28')](handleError(_0x5afefa,null));};exports[_0x9da1('0xcd')]=function(_0x53d0bc,_0x5afa96){var _0xfa4d88=null;var _0x362c14=null;var _0x28e0c8=null;var _0x202d22=null;if(_0x53d0bc['body']['id']){delete _0x53d0bc['body']['id'];}if(_0x53d0bc[_0x9da1('0x77')][_0x9da1('0xce')]){_0x202d22=path[_0x9da1('0xcf')](config[_0x9da1('0xd0')],_0x9da1('0xd1'),util['format']('transcript-%s.txt',Date[_0x9da1('0xd2')]()));_0x53d0bc[_0x9da1('0x77')]['pathTranscript']=_0x202d22;}return db[_0x9da1('0x3c')]['find']({'where':{'id':_0x53d0bc[_0x9da1('0xbc')]['id']},'include':[{'model':db[_0x9da1('0xd3')],'as':_0x9da1('0xd4'),'include':[{'model':db[_0x9da1('0x71')],'as':_0x9da1('0x71')}]}]})[_0x9da1('0x1f')](handleEntityNotFound(_0x5afa96,null))['then'](saveUpdates(_0x53d0bc[_0x9da1('0x77')],null))[_0x9da1('0x1f')](function(_0x2465fe){if(_0x2465fe){_0xfa4d88=_0x2465fe;return db[_0x9da1('0xd5')]['find']({'where':{'id':_0xfa4d88[_0x9da1('0x7a')]}});}})[_0x9da1('0x1f')](function(_0x34b850){if(_0x34b850){_0x28e0c8=_0x34b850;return db['CmContact']['find']({'where':{'id':_0xfa4d88[_0x9da1('0x6c')]}});}})[_0x9da1('0x1f')](function(_0x5810f7){if(_0x5810f7){_0x362c14=_0x5810f7;if(_0x202d22){var _0x5b269b=null;for(var _0x24650c=0x1;_0x24650c<_0xfa4d88[_0x9da1('0xd4')][_0x9da1('0x62')];++_0x24650c){_0x5b269b=_0xfa4d88[_0x9da1('0xd4')][_0x24650c];var _0x220358=_0x5b269b['UserId']?util[_0x9da1('0xd6')]('%s%d',_0x28e0c8[_0x9da1('0xd7')],_0x5b269b[_0x9da1('0x74')]):_0x9da1('0xd8');var _0xb7bc85=_0x53d0bc['body']['customer']||util[_0x9da1('0xd6')](_0x9da1('0xd9'),_0x9da1('0xda'),_0x5b269b[_0x9da1('0x6c')]);switch(_0x28e0c8[_0x9da1('0xdb')]){case _0x9da1('0xdc'):_0x220358=_0x5b269b['UserId']?util[_0x9da1('0xd6')](_0x9da1('0xd9'),_0x28e0c8[_0x9da1('0xd7')],_0x5b269b[_0x9da1('0x74')]):_0x9da1('0xd8');break;case _0x9da1('0xdd'):_0x220358=_0x5b269b['UserId']?_0x5b269b[_0x9da1('0x71')][_0x9da1('0xde')]||_0x5b269b['User']['fullname']:'System';break;case _0x9da1('0xdf'):_0x220358=_0x5b269b[_0x9da1('0x74')]?_0x5b269b[_0x9da1('0x71')]['fullname']:_0x9da1('0xd8');break;default:_0x220358=_0x5b269b[_0x9da1('0x74')]?util[_0x9da1('0xd6')](_0x9da1('0xd9'),_0x28e0c8[_0x9da1('0xd7')],_0x5b269b['UserId']):_0x9da1('0xd8');}var _0x5431d3=util['format'](_0x9da1('0xe0'),moment(_0x5b269b[_0x9da1('0x7b')])[_0x9da1('0xd6')](_0x9da1('0xe1')),_0x5b269b[_0x9da1('0xe2')]==='in'?_0xb7bc85:_0x220358,_0x5b269b['body']);if(!_0x5b269b[_0x9da1('0xe3')]){fs[_0x9da1('0xe4')](_0x202d22,_0x5431d3);}}return db[_0x9da1('0xe5')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x9da1('0xe6')],'as':_0x9da1('0xe7'),'raw':!![]}]});}}})[_0x9da1('0x1f')](function(_0xe108e4){if(_0xe108e4&&_0xe108e4['Smtp']&&_0x53d0bc[_0x9da1('0x77')]){var _0x537d81={'tls':{'rejectUnauthorized':![]}};if(_0xe108e4[_0x9da1('0xe7')][_0x9da1('0xe8')]){_0x537d81[_0x9da1('0xe8')]=_0xe108e4[_0x9da1('0xe7')][_0x9da1('0xe8')];}else{_0x537d81['host']=_0xe108e4[_0x9da1('0xe7')][_0x9da1('0xe9')];_0x537d81['port']=_0xe108e4[_0x9da1('0xe7')][_0x9da1('0xea')];_0x537d81[_0x9da1('0xeb')]=_0xe108e4[_0x9da1('0xe7')][_0x9da1('0xeb')];}if(_0xe108e4['Smtp'][_0x9da1('0xec')]){_0x537d81[_0x9da1('0xed')]={'user':_0xe108e4[_0x9da1('0xe7')][_0x9da1('0x98')],'pass':_0xe108e4[_0x9da1('0xe7')][_0x9da1('0xee')]};}return respondWithRpcPromise('SendMail',_0x9da1('0xef'),{'account':_0x537d81,'message':{'from':util['format'](_0x9da1('0xf0'),_0xe108e4[_0x9da1('0x35')],_0xe108e4[_0x9da1('0xf1')]||_0xe108e4[_0x9da1('0xe7')][_0x9da1('0x98')]),'to':_0x53d0bc[_0x9da1('0x77')][_0x9da1('0xce')],'subject':_0x9da1('0xf2'),'text':util[_0x9da1('0xd6')](_0x9da1('0xf3'),_0x53d0bc[_0x9da1('0x77')][_0x9da1('0xce')]),'attachments':[{'path':_0x202d22}]}})[_0x9da1('0x1f')](function(){return _0xfa4d88;})['catch'](function(_0x23b791){console[_0x9da1('0x26')](_0x23b791);});}else{return _0xfa4d88;}})[_0x9da1('0x1f')](respondWithStatusCode(_0x5afa96,0xc8))[_0x9da1('0x28')](handleError(_0x5afa96,null));};exports[_0x9da1('0xf4')]=function(_0x1852c8,_0x3a2d90,_0x1a0f57){return db[_0x9da1('0xd3')]['find']({'where':{'id':_0x1852c8['params']['id']}})[_0x9da1('0x1f')](handleEntityNotFound(_0x3a2d90,null))[_0x9da1('0x1f')](function(_0x2889a1){if(_0x2889a1){return _0x2889a1[_0x9da1('0xf4')](_0x1852c8[_0x9da1('0x77')][_0x9da1('0xf5')],_[_0x9da1('0xf6')](_0x1852c8[_0x9da1('0x77')],[_0x9da1('0xf5'),'id'])||{});}})[_0x9da1('0x1f')](respondWithResult(_0x3a2d90,null))[_0x9da1('0x28')](handleError(_0x3a2d90,null));};exports[_0x9da1('0xf7')]=function(_0x41a9d8,_0x1bbf35,_0xdc1495){var _0x265bc8={'raw':![],'where':{}};var _0x26d913={};var _0x473a36={'count':0x0,'rows':[]};return db[_0x9da1('0x3c')]['findOne']({'where':{'id':_0x41a9d8[_0x9da1('0xbc')]['id']}})['then'](handleEntityNotFound(_0x1bbf35,null))[_0x9da1('0x1f')](function(_0x1e384d){if(_0x1e384d){_0x26d913[_0x9da1('0x40')]=_[_0x9da1('0x78')](db['ChatMessage'][_0x9da1('0x3d')]);_0x26d913[_0x9da1('0x41')]=_[_0x9da1('0x78')](_0x41a9d8[_0x9da1('0x41')]);_0x26d913[_0x9da1('0x42')]=_[_0x9da1('0x43')](_0x26d913[_0x9da1('0x40')],_0x26d913[_0x9da1('0x41')]);_0x265bc8['attributes']=_[_0x9da1('0x43')](_0x26d913[_0x9da1('0x40')],qs[_0x9da1('0x45')](_0x41a9d8[_0x9da1('0x41')][_0x9da1('0x45')]));_0x265bc8['attributes']=_0x265bc8[_0x9da1('0x44')]['length']?_0x265bc8[_0x9da1('0x44')]:_0x26d913[_0x9da1('0x40')];if(!_0x41a9d8[_0x9da1('0x41')][_0x9da1('0xf8')]('nolimit')){_0x265bc8[_0x9da1('0x2d')]=qs['limit'](_0x41a9d8[_0x9da1('0x41')][_0x9da1('0x2d')]);_0x265bc8['offset']=qs[_0x9da1('0x2c')](_0x41a9d8[_0x9da1('0x41')][_0x9da1('0x2c')]);}_0x265bc8[_0x9da1('0x93')]=qs['sort'](_0x41a9d8[_0x9da1('0x41')]['sort']);_0x265bc8[_0x9da1('0x48')]=qs[_0x9da1('0x42')](_[_0x9da1('0x49')](_0x41a9d8[_0x9da1('0x41')],_0x26d913['filters']));_0x265bc8[_0x9da1('0x48')][_0x9da1('0xb3')]=_0x1e384d['id'];if(_0x41a9d8[_0x9da1('0x41')]['filter']){_0x265bc8[_0x9da1('0x48')]=_['merge'](_0x265bc8[_0x9da1('0x48')],{'$or':_[_0x9da1('0x36')](_0x265bc8[_0x9da1('0x44')],function(_0x12cd25){var _0x158b63={};_0x158b63[_0x12cd25]={'$like':'%'+_0x41a9d8[_0x9da1('0x41')]['filter']+'%'};return _0x158b63;})});}if(_0x41a9d8[_0x9da1('0x41')]['$gte']){var _0x352651=_0x41a9d8[_0x9da1('0x41')][_0x9da1('0xf9')][_0x9da1('0x69')](',');var _0x3357f5={};_0x3357f5[_0x352651[0x0]]={'$gte':moment(_0x352651[0x1])[_0x9da1('0xd6')](_0x9da1('0xfa'))};_0x265bc8[_0x9da1('0x48')]=_[_0x9da1('0xb9')](_0x265bc8[_0x9da1('0x48')],_0x3357f5);}_0x265bc8=_[_0x9da1('0xb9')]({},_0x265bc8,_0x41a9d8[_0x9da1('0xba')]);return db[_0x9da1('0xd3')][_0x9da1('0x2b')]({'where':_0x265bc8['where']})[_0x9da1('0x1f')](function(_0x2cc68b){_0x473a36[_0x9da1('0x2b')]=_0x2cc68b;if(_0x41a9d8[_0x9da1('0x41')][_0x9da1('0xb7')]){_0x265bc8[_0x9da1('0xb8')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x265bc8);})[_0x9da1('0x1f')](function(_0x28436b){_0x473a36[_0x9da1('0xfb')]=_0x28436b;return _0x473a36;});}})[_0x9da1('0x1f')](respondWithFilteredResult(_0x1bbf35,_0x265bc8))[_0x9da1('0x28')](handleError(_0x1bbf35,null));};exports[_0x9da1('0xfc')]=function(_0x3734dd,_0x25146a,_0x236f38){var _0x1ca341={'where':{}},_0x35fc65={},_0x3cf8b6={'count':0x0,'rows':[]};return db[_0x9da1('0x3c')][_0x9da1('0xc9')]({'where':{'id':_0x3734dd[_0x9da1('0xbc')]['id']}})[_0x9da1('0x1f')](handleEntityNotFound(_0x25146a,null))[_0x9da1('0x1f')](function(_0xcab98c){if(_0xcab98c){_0x35fc65[_0x9da1('0x40')]=_[_0x9da1('0x78')](db['ChatMessage'][_0x9da1('0x3d')]);_0x35fc65['query']=_[_0x9da1('0x78')](_0x3734dd[_0x9da1('0x41')]);_0x35fc65[_0x9da1('0x42')]=_[_0x9da1('0x43')](_0x35fc65[_0x9da1('0x40')],_0x35fc65['query']);_0x1ca341['attributes']=_[_0x9da1('0x43')](_0x35fc65[_0x9da1('0x40')],qs[_0x9da1('0x45')](_0x3734dd[_0x9da1('0x41')][_0x9da1('0x45')]));_0x1ca341[_0x9da1('0x44')]=_0x1ca341[_0x9da1('0x44')][_0x9da1('0x62')]?_0x1ca341[_0x9da1('0x44')]:_0x35fc65[_0x9da1('0x40')];if(!_0x3734dd[_0x9da1('0x41')][_0x9da1('0xf8')](_0x9da1('0x46'))){_0x1ca341['limit']=qs[_0x9da1('0x2d')](_0x3734dd[_0x9da1('0x41')][_0x9da1('0x2d')]);_0x1ca341[_0x9da1('0x2c')]=qs[_0x9da1('0x2c')](_0x3734dd['query'][_0x9da1('0x2c')]);}_0x1ca341[_0x9da1('0x93')]=qs[_0x9da1('0x47')](_0x3734dd[_0x9da1('0x41')][_0x9da1('0x47')]);_0x1ca341[_0x9da1('0x48')]=qs['filters'](_[_0x9da1('0x49')](_0x3734dd['query'],_0x35fc65[_0x9da1('0x42')]));_0x1ca341[_0x9da1('0x48')]['ChatInteractionId']=_0xcab98c['id'];if(_0x3734dd[_0x9da1('0x41')][_0x9da1('0x87')]){_0x1ca341[_0x9da1('0x48')]=_['merge'](_0x1ca341['where'],{'$or':_[_0x9da1('0x36')](_0x1ca341[_0x9da1('0x44')],function(_0x5cdd3b){var _0x1cdb6d={};_0x1cdb6d[_0x5cdd3b]={'$like':'%'+_0x3734dd[_0x9da1('0x41')][_0x9da1('0x87')]+'%'};return _0x1cdb6d;})});}_0x1ca341[_0x9da1('0x48')][_0x9da1('0xe3')]=![];if(_0x3734dd[_0x9da1('0x41')]['id']){_0x1ca341[_0x9da1('0x48')]['id']={'$gt':_0x3734dd[_0x9da1('0x41')]['id']};}_0x1ca341=_[_0x9da1('0xb9')]({},_0x1ca341,_0x3734dd[_0x9da1('0xba')]);return db[_0x9da1('0xd3')][_0x9da1('0x2b')]({'where':_0x1ca341[_0x9da1('0x48')]})[_0x9da1('0x1f')](function(_0x30e161){_0x3cf8b6['count']=_0x30e161;_0x1ca341[_0x9da1('0xb8')]=[];if(_0x3734dd['query'][_0x9da1('0xfd')]){_0x1ca341['include'][_0x9da1('0xb4')]({'model':db[_0x9da1('0x71')],'as':_0x9da1('0x71'),'attributes':['id',_0x9da1('0x37'),'alias']});}if(_0x3734dd['query'][_0x9da1('0xb7')]){_0x1ca341[_0x9da1('0xb8')]=[{'all':!![]}];}return db[_0x9da1('0xd3')][_0x9da1('0xfe')](_0x1ca341);})[_0x9da1('0x1f')](function(_0x1a4c73){_0x3cf8b6[_0x9da1('0xfb')]=_0x1a4c73;return _0x3cf8b6;});}})['then'](respondWithFilteredResult(_0x25146a,_0x1ca341))[_0x9da1('0x28')](handleError(_0x25146a,null));};exports[_0x9da1('0xff')]=function(_0x33220a,_0x3da804,_0xb9eb00){return db[_0x9da1('0x3c')][_0x9da1('0x6b')]({'where':{'id':_0x33220a['params']['id']}})['then'](handleEntityNotFound(_0x3da804,null))['then'](function(_0x3cbe1d){if(_0x3cbe1d){return _0x3cbe1d[_0x9da1('0x100')](_0x33220a['body']['ids'],_[_0x9da1('0xf6')](_0x33220a[_0x9da1('0x77')],[_0x9da1('0xf5'),'id'])||{})[_0x9da1('0x101')](function(){return db['Tag'][_0x9da1('0xfe')]({'attributes':['id',_0x9da1('0x35'),_0x9da1('0x4c')],'where':{'id':_0x33220a['body'][_0x9da1('0xf5')]}});})[_0x9da1('0x1f')](function(_0x478a62){socket[_0x9da1('0x102')](_0x9da1('0x103'),{'id':Number(_0x33220a[_0x9da1('0xbc')]['id']),'tags':_0x478a62||[]});return{'id':Number(_0x33220a[_0x9da1('0xbc')]['id']),'tags':_0x478a62||[]};});}})[_0x9da1('0x1f')](respondWithResult(_0x3da804,null))[_0x9da1('0x28')](handleError(_0x3da804,null));};exports['removeTags']=function(_0x49194f,_0x4df5ee,_0x4561e0){return db[_0x9da1('0x3c')][_0x9da1('0x6b')]({'where':{'id':_0x49194f[_0x9da1('0xbc')]['id']}})[_0x9da1('0x1f')](handleEntityNotFound(_0x4df5ee,null))[_0x9da1('0x1f')](function(_0x2c2580){if(_0x2c2580){return _0x2c2580[_0x9da1('0x104')](_0x49194f[_0x9da1('0x41')][_0x9da1('0xf5')]);}})[_0x9da1('0x1f')](respondWithStatusCode(_0x4df5ee,null))[_0x9da1('0x28')](handleError(_0x4df5ee,null));};exports[_0x9da1('0xcb')]=function(_0x2d9d8c,_0x276302){var _0x17dc1a=moment()[_0x9da1('0x105')]()[_0x9da1('0x9e')]();var _0x32b908=path['join'](config[_0x9da1('0xd0')],_0x9da1('0x106'),'files','tmp');var _0x32a1e2=path[_0x9da1('0xcf')](config[_0x9da1('0xd0')],_0x9da1('0x106'),'files','attachments');var _0x58cd81=path[_0x9da1('0xcf')](_0x32b908,_0x17dc1a);var _0x327c10=util[_0x9da1('0xd6')](_0x9da1('0x107'),_0x2d9d8c['params']['id'],_0x17dc1a);var _0x594ba3=path[_0x9da1('0xcf')](_0x32b908,_0x327c10);var _0x2e489d=[];_0x2e489d['push']({'model':db[_0x9da1('0x71')],'as':_0x9da1('0x71'),'attributes':['id',_0x9da1('0x37')],'raw':!![]});_0x2e489d['push']({'model':db[_0x9da1('0x108')],'as':_0x9da1('0x67'),'attributes':['id','firstName',_0x9da1('0x109')],'raw':!![]});if(_0x2d9d8c[_0x9da1('0x41')][_0x9da1('0x10a')]){_0x2e489d[_0x9da1('0xb4')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x46c70e=[{'model':db['ChatMessage'],'as':_0x9da1('0xd4'),'attributes':['id',_0x9da1('0x77'),_0x9da1('0x7b'),_0x9da1('0xe2'),'secret',_0x9da1('0x82')],'include':_0x2e489d}];_0x46c70e[_0x9da1('0xb4')]({'model':db[_0x9da1('0xd5')],'as':_0x9da1('0x10b'),'attributes':['id',_0x9da1('0x35')]});_0x46c70e[_0x9da1('0xb4')]({'model':db['User'],'as':_0x9da1('0x10c'),'attributes':['id','fullname']});return db[_0x9da1('0x3c')][_0x9da1('0x6b')]({'where':{'id':_0x2d9d8c[_0x9da1('0xbc')]['id']},'include':_0x46c70e})[_0x9da1('0x1f')](handleEntityNotFound(_0x276302,null))[_0x9da1('0x1f')](function(_0x108ca5){if(_0x108ca5){var _0x455219=_0x108ca5[_0x9da1('0x10d')]({'plain':!![]});fs[_0x9da1('0x10e')](_0x58cd81);var _0x2b704d={'format':'A4','border':_0x9da1('0x10f'),'header':{'height':_0x9da1('0x110'),'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':_0x9da1('0x111'),'contents':{'default':util[_0x9da1('0xd6')]('\x0a\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[_0x9da1('0xd6')](_0x9da1('0x112'),_0x9da1('0x113'),_0x455219['id']),moment()[_0x9da1('0xd6')](_0x9da1('0x114'))[_0x9da1('0x9e')]())}}};var _0x4dd255={'channel':_0x9da1('0x113'),'account':_0x455219['Account'][_0x9da1('0x35')],'agent':_0x455219[_0x9da1('0x10c')]?_0x455219['Owner']['fullname']:_0x9da1('0x115'),'createdAt':moment(_0x455219[_0x9da1('0x7b')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x455219['closed']?moment(_0x455219[_0x9da1('0x116')])[_0x9da1('0xd6')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9da1('0x9e')]():'','disposition':_0x455219['disposition'],'chatInfo':{'browser':_0x455219[_0x9da1('0x117')],'os':_0x455219[_0x9da1('0x118')],'referer':_0x455219[_0x9da1('0x119')],'customerIp':_0x455219[_0x9da1('0x11a')],'customerPort':_0x455219[_0x9da1('0x11b')]?_0x455219[_0x9da1('0x11b')]:'N.A.'},'messages':_(_0x455219[_0x9da1('0xd4')])[_0x9da1('0x11c')]()[_0x9da1('0x87')]({'secret':![]})[_0x9da1('0x36')](function(_0x4eb998){if(_0x4eb998[_0x9da1('0xca')]){var _0x3b01db=path[_0x9da1('0xcf')](_0x32a1e2,_0x4eb998[_0x9da1('0xca')][_0x9da1('0xc7')]);if(fs[_0x9da1('0x11d')](_0x3b01db)){fs[_0x9da1('0x11e')](_0x3b01db)[_0x9da1('0x11f')](fs[_0x9da1('0x120')](path[_0x9da1('0xcf')](_0x58cd81,_0x4eb998[_0x9da1('0xca')]['basename'])));}}return{'date':moment(_0x4eb998['createdAt'])[_0x9da1('0xd6')](_0x9da1('0xfa'))[_0x9da1('0x9e')](),'sender':_0x4eb998[_0x9da1('0xe2')]===_0x9da1('0x121')?_0x4eb998[_0x9da1('0x71')]?_0x4eb998[_0x9da1('0x71')][_0x9da1('0x37')]:'System':_0x4eb998[_0x9da1('0x67')][_0x9da1('0x122')]+(_0x4eb998['Contact'][_0x9da1('0x109')]?'\x20'+_0x4eb998[_0x9da1('0x67')][_0x9da1('0x109')]:''),'body':_0x4eb998[_0x9da1('0xca')]?_0x4eb998[_0x9da1('0xca')][_0x9da1('0xc7')]:_0x4eb998[_0x9da1('0x77')],'direction':_0x4eb998[_0x9da1('0xe2')]===_0x9da1('0x121')?'A':'C','secret':_0x4eb998[_0x9da1('0xe3')],'read':_0x4eb998[_0x9da1('0x82')],'attachment':_0x4eb998[_0x9da1('0xca')]};})[_0x9da1('0x6a')]()};return ejs['renderFile'](path[_0x9da1('0xcf')](config[_0x9da1('0xd0')],_0x9da1('0x106'),'views','downloadInteraction.html'),{'interaction':_0x4dd255})[_0x9da1('0x1f')](function(_0x3ebc4a){return new BPromise(function(_0x293df4,_0x5208fb){pdf['create'](_0x3ebc4a,_0x2b704d)[_0x9da1('0x123')](path[_0x9da1('0xcf')](_0x58cd81,_0x9da1('0x124')+_0x455219['id']+'-'+_0x17dc1a+'.pdf'),function(_0x4aa906,_0x29e5ea){if(_0x4aa906)return _0x5208fb(_0x4aa906);_0x293df4(_0x29e5ea);});});})['then'](function(){return new BPromise(function(_0x6cf1ab,_0x25bf8b){zipdir(_0x58cd81,{'saveTo':_0x594ba3},function(_0x5865c4,_0x7b1b2d){if(_0x5865c4)return _0x25bf8b(_0x5865c4);return _0x6cf1ab(_0x7b1b2d);});})[_0x9da1('0x1f')](function(){return new BPromise(function(_0x5643e3,_0x27d462){rimraf(_0x58cd81,function(_0x1e6cb0){if(_0x1e6cb0)_0x27d462(_0x1e6cb0);return _0x5643e3();});});})[_0x9da1('0x1f')](function(){return _0x276302['download'](_0x594ba3,_0x327c10,function(_0x172c29){if(_0x172c29){console['log'](_0x9da1('0x125'),_0x172c29);}else{fs['unlinkSync'](_0x594ba3);}});});});}else{return _0x276302[_0x9da1('0x33')](0xc8);}})[_0x9da1('0x28')](handleError(_0x276302,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index be0f53c..85708c1 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 _0x4dcb=['remove','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4dcb,0x186));var _0xb4dc=function(_0x38596a,_0xfca7c8){_0x38596a=_0x38596a-0x0;var _0x254154=_0x4dcb[_0x38596a];return _0x254154;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xb4dc('0x0'))['db'][_0xb4dc('0x1')];var ChatMessage=require(_0xb4dc('0x0'))['db'][_0xb4dc('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb4dc('0x3')](0x0);var events={'afterCreate':_0xb4dc('0x4'),'afterUpdate':_0xb4dc('0x5'),'afterDestroy':_0xb4dc('0x6')};function emitEvent(_0x161991){return function(_0x56a262,_0x5c031c,_0x244be0){_0x56a262['getUsers']({'attributes':['id'],'raw':!![]})[_0xb4dc('0x7')](function(_0x14790e){_0x56a262[_0xb4dc('0x8')](_0xb4dc('0x9'),_0x14790e[_0xb4dc('0xa')](function(_0x168305){return{'id':_0x168305['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x56a262['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb4dc('0x7')](function(_0x43e354){_0x56a262[_0xb4dc('0x8')](_0xb4dc('0xb'),_0x43e354[_0xb4dc('0xc')]);ChatInteractionEvents[_0xb4dc('0xd')](_0x161991+':'+_0x56a262['id'],_0x56a262);ChatInteractionEvents[_0xb4dc('0xd')](_0x161991,_0x56a262);_0x244be0(null);})[_0xb4dc('0xe')](_0x244be0(null));};}for(var e in events){if(events[_0xb4dc('0xf')](e)){var event=events[e];ChatInteraction[_0xb4dc('0x10')](e,emitEvent(event));}}module[_0xb4dc('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0x5f43=['then','emit','hasOwnProperty','exports','events','../../mysqldb','ChatInteraction','ChatMessage','update','remove','getUsers','setDataValue','Users','findAll'];(function(_0x2d6ed6,_0x4d8672){var _0x793da1=function(_0x3d229c){while(--_0x3d229c){_0x2d6ed6['push'](_0x2d6ed6['shift']());}};_0x793da1(++_0x4d8672);}(_0x5f43,0xe4));var _0x35f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f43[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x35f4('0x0'));var ChatInteraction=require(_0x35f4('0x1'))['db'][_0x35f4('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x35f4('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x35f4('0x4'),'afterDestroy':_0x35f4('0x5')};function emitEvent(_0x529c8f){return function(_0xe783fe,_0x574990,_0x12334f){_0xe783fe[_0x35f4('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x56a2ee){_0xe783fe[_0x35f4('0x7')](_0x35f4('0x8'),_0x56a2ee['map'](function(_0x32ba6d){return{'id':_0x32ba6d['id']};}));return ChatMessage[_0x35f4('0x9')]({'where':{'ChatInteractionId':_0xe783fe['id'],'direction':'in','read':![]},'raw':!![]});})[_0x35f4('0xa')](function(_0x3752e8){_0xe783fe[_0x35f4('0x7')]('unreadMessages',_0x3752e8['length']);ChatInteractionEvents[_0x35f4('0xb')](_0x529c8f+':'+_0xe783fe['id'],_0xe783fe);ChatInteractionEvents[_0x35f4('0xb')](_0x529c8f,_0xe783fe);_0x12334f(null);})['catch'](_0x12334f(null));};}for(var e in events){if(events[_0x35f4('0xc')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x35f4('0xd')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 32b68cb..12f0728 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 _0x5bcd=['./chatInteraction.attributes','define','chat_interactions','closed','format','utf8mb4','utf8mb4_unicode_ci','util','api','bluebird','rimraf','../../config/environment'];(function(_0x4af07b,_0x24429d){var _0x59ae3f=function(_0xf1bdec){while(--_0xf1bdec){_0x4af07b['push'](_0x4af07b['shift']());}};_0x59ae3f(++_0x24429d);}(_0x5bcd,0x1c3));var _0xd5bc=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x5bcd[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require('lodash');var util=require(_0xd5bc('0x0'));var logger=require('../../config/logger')(_0xd5bc('0x1'));var moment=require('moment');var BPromise=require(_0xd5bc('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd5bc('0x3'));var config=require(_0xd5bc('0x4'));var attributes=require(_0xd5bc('0x5'));module['exports']=function(_0x2843c2,_0x3ec55e){return _0x2843c2[_0xd5bc('0x6')]('ChatInteraction',attributes,{'tableName':_0xd5bc('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a7703,_0x4cf005,_0x10b82c){if(_0x5a7703['changed'](_0xd5bc('0x8'))){_0x5a7703['closedAt']=moment()[_0xd5bc('0x9')]('YYYY-MM-DD\x20HH:mm:ss');}_0x10b82c(null,_0x5a7703);}},'charset':_0xd5bc('0xa'),'collate':_0xd5bc('0xb')});}; \ No newline at end of file +var _0xe990=['lodash','api','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','ChatInteraction','changed','closed','closedAt','format','utf8mb4_unicode_ci'];(function(_0xf1653a,_0x5b7a7e){var _0x13b3f6=function(_0x4028bb){while(--_0x4028bb){_0xf1653a['push'](_0xf1653a['shift']());}};_0x13b3f6(++_0x5b7a7e);}(_0xe990,0xf7));var _0x0e99=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xe990[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require(_0x0e99('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0e99('0x1'));var moment=require('moment');var BPromise=require(_0x0e99('0x2'));var rp=require(_0x0e99('0x3'));var fs=require('fs');var path=require(_0x0e99('0x4'));var rimraf=require(_0x0e99('0x5'));var config=require('../../config/environment');var attributes=require(_0x0e99('0x6'));module['exports']=function(_0x1286aa,_0x4a60af){return _0x1286aa['define'](_0x0e99('0x7'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x48b284,_0x1755e7,_0x4f8f96){if(_0x48b284[_0x0e99('0x8')](_0x0e99('0x9'))){_0x48b284[_0x0e99('0xa')]=moment()[_0x0e99('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4f8f96(null,_0x48b284);}},'charset':'utf8mb4','collate':_0x0e99('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 4c9131b..bf484f4 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 _0xb243=['UpdateChatInteraction','update','options','raw','where','attributes','limit','catch','AddTagsToChatInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb243,0x10c));var _0x3b24=function(_0x92d4f3,_0x5bf702){_0x92d4f3=_0x92d4f3-0x0;var _0x35221e=_0xb243[_0x92d4f3];return _0x35221e;};'use strict';var _=require(_0x3b24('0x0'));var util=require('util');var moment=require(_0x3b24('0x1'));var BPromise=require(_0x3b24('0x2'));var rs=require(_0x3b24('0x3'));var fs=require('fs');var Redis=require(_0x3b24('0x4'));var db=require(_0x3b24('0x5'))['db'];var utils=require(_0x3b24('0x6'));var logger=require(_0x3b24('0x7'))('rpc');var config=require(_0x3b24('0x8'));var jayson=require(_0x3b24('0x9'));var client=jayson[_0x3b24('0xa')][_0x3b24('0xb')]({'port':0x232a});config[_0x3b24('0xc')]=_[_0x3b24('0xd')](config[_0x3b24('0xc')],{'host':_0x3b24('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3b24('0xf'))['register'](socket);function respondWithRpcPromise(_0x5ee729,_0x1b947e,_0x2a97f9){return new BPromise(function(_0x438cbf,_0x174bde){return client[_0x3b24('0x10')](_0x5ee729,_0x2a97f9)[_0x3b24('0x11')](function(_0xce7744){logger[_0x3b24('0x12')](_0x3b24('0x13'),_0x1b947e,_0x3b24('0x14'));logger[_0x3b24('0x15')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x1b947e,_0x3b24('0x14'),JSON[_0x3b24('0x16')](_0xce7744));if(_0xce7744[_0x3b24('0x17')]){if(_0xce7744[_0x3b24('0x17')]['code']===0x1f4){logger[_0x3b24('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x1b947e,_0xce7744[_0x3b24('0x17')]['message']);return _0x174bde(_0xce7744[_0x3b24('0x17')][_0x3b24('0x18')]);}logger[_0x3b24('0x17')](_0x3b24('0x13'),_0x1b947e,_0xce7744[_0x3b24('0x17')][_0x3b24('0x18')]);return _0x438cbf(_0xce7744[_0x3b24('0x17')][_0x3b24('0x18')]);}else{logger[_0x3b24('0x12')](_0x3b24('0x13'),_0x1b947e,_0x3b24('0x14'));_0x438cbf(_0xce7744[_0x3b24('0x19')][_0x3b24('0x18')]);}})['catch'](function(_0x486263){logger[_0x3b24('0x17')](_0x3b24('0x13'),_0x1b947e,_0x486263);_0x174bde(_0x486263);});});}exports[_0x3b24('0x1a')]=function(_0xd8ce0a){var _0x534356=this;return new Promise(function(_0x5701b2,_0x347143){return db['ChatInteraction'][_0x3b24('0x1b')](_0xd8ce0a['body'],{'raw':_0xd8ce0a[_0x3b24('0x1c')]?_0xd8ce0a[_0x3b24('0x1c')][_0x3b24('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd8ce0a[_0x3b24('0x1c')]?_0xd8ce0a[_0x3b24('0x1c')][_0x3b24('0x1e')]||null:null,'attributes':_0xd8ce0a[_0x3b24('0x1c')]?_0xd8ce0a[_0x3b24('0x1c')][_0x3b24('0x1f')]||null:null,'limit':_0xd8ce0a[_0x3b24('0x1c')]?_0xd8ce0a[_0x3b24('0x1c')][_0x3b24('0x20')]||null:null})[_0x3b24('0x11')](function(_0x27fc9c){logger[_0x3b24('0x12')](_0x3b24('0x1a'),_0xd8ce0a);logger[_0x3b24('0x15')](_0x3b24('0x1a'),_0xd8ce0a,JSON[_0x3b24('0x16')](_0x27fc9c));_0x5701b2(_0x27fc9c);})[_0x3b24('0x21')](function(_0x363baf){logger[_0x3b24('0x17')](_0x3b24('0x1a'),_0x363baf['message'],_0xd8ce0a);_0x347143(_0x534356['error'](0x1f4,_0x363baf['message']));});});};exports[_0x3b24('0x22')]=function(_0x177f32){return new Promise(function(_0x1e2eae,_0x34ffbb){return db['ChatInteraction'][_0x3b24('0x23')]({'where':_0x177f32['options']?_0x177f32[_0x3b24('0x1c')][_0x3b24('0x1e')]||null:null})[_0x3b24('0x11')](function(_0x2e4d1c){if(_0x2e4d1c){return _0x2e4d1c[_0x3b24('0x24')](_0x177f32[_0x3b24('0x25')][_0x3b24('0x26')],_[_0x3b24('0x27')](_0x177f32[_0x3b24('0x25')],[_0x3b24('0x26'),'id'])||{});}})[_0x3b24('0x28')](function(_0x51bd1b){logger['info']('AddTags',_0x177f32);logger[_0x3b24('0x15')](_0x3b24('0x29'),_0x177f32,JSON[_0x3b24('0x16')](_0x51bd1b));_0x1e2eae(_0x51bd1b);})[_0x3b24('0x21')](function(_0x548be4){logger[_0x3b24('0x17')](_0x3b24('0x29'),_0x548be4[_0x3b24('0x18')],_0x177f32);_0x34ffbb(_this[_0x3b24('0x17')](0x1f4,_0x548be4[_0x3b24('0x18')]));});});}; \ No newline at end of file +var _0xfb67=['stringify','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ChatInteraction','update','options','raw','where','limit','UpdateChatInteraction'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xfb67,0x13c));var _0x7fb6=function(_0x1d8703,_0x4de38c){_0x1d8703=_0x1d8703-0x0;var _0xc21424=_0xfb67[_0x1d8703];return _0xc21424;};'use strict';var _=require(_0x7fb6('0x0'));var util=require(_0x7fb6('0x1'));var moment=require(_0x7fb6('0x2'));var BPromise=require(_0x7fb6('0x3'));var rs=require(_0x7fb6('0x4'));var fs=require('fs');var Redis=require(_0x7fb6('0x5'));var db=require(_0x7fb6('0x6'))['db'];var utils=require(_0x7fb6('0x7'));var logger=require(_0x7fb6('0x8'))('rpc');var config=require(_0x7fb6('0x9'));var jayson=require(_0x7fb6('0xa'));var client=jayson[_0x7fb6('0xb')][_0x7fb6('0xc')]({'port':0x232a});config['redis']=_[_0x7fb6('0xd')](config[_0x7fb6('0xe')],{'host':_0x7fb6('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7fb6('0xe')]));require(_0x7fb6('0x10'))[_0x7fb6('0x11')](socket);function respondWithRpcPromise(_0x5daa33,_0x5a1177,_0x4ecbb5){return new BPromise(function(_0x2f4952,_0x316283){return client[_0x7fb6('0x12')](_0x5daa33,_0x4ecbb5)[_0x7fb6('0x13')](function(_0x258645){logger[_0x7fb6('0x14')](_0x7fb6('0x15'),_0x5a1177,_0x7fb6('0x16'));logger[_0x7fb6('0x17')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x5a1177,'request\x20sent',JSON['stringify'](_0x258645));if(_0x258645[_0x7fb6('0x18')]){if(_0x258645['error'][_0x7fb6('0x19')]===0x1f4){logger[_0x7fb6('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x5a1177,_0x258645[_0x7fb6('0x18')][_0x7fb6('0x1a')]);return _0x316283(_0x258645[_0x7fb6('0x18')][_0x7fb6('0x1a')]);}logger[_0x7fb6('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x5a1177,_0x258645[_0x7fb6('0x18')][_0x7fb6('0x1a')]);return _0x2f4952(_0x258645[_0x7fb6('0x18')][_0x7fb6('0x1a')]);}else{logger[_0x7fb6('0x14')](_0x7fb6('0x15'),_0x5a1177,_0x7fb6('0x16'));_0x2f4952(_0x258645[_0x7fb6('0x1b')][_0x7fb6('0x1a')]);}})[_0x7fb6('0x1c')](function(_0x482039){logger['error'](_0x7fb6('0x15'),_0x5a1177,_0x482039);_0x316283(_0x482039);});});}exports['UpdateChatInteraction']=function(_0x4b6fd1){var _0x584e06=this;return new Promise(function(_0x3f445a,_0x12dde){return db[_0x7fb6('0x1d')][_0x7fb6('0x1e')](_0x4b6fd1['body'],{'raw':_0x4b6fd1['options']?_0x4b6fd1[_0x7fb6('0x1f')][_0x7fb6('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b6fd1[_0x7fb6('0x1f')]?_0x4b6fd1[_0x7fb6('0x1f')][_0x7fb6('0x21')]||null:null,'attributes':_0x4b6fd1[_0x7fb6('0x1f')]?_0x4b6fd1[_0x7fb6('0x1f')]['attributes']||null:null,'limit':_0x4b6fd1[_0x7fb6('0x1f')]?_0x4b6fd1[_0x7fb6('0x1f')][_0x7fb6('0x22')]||null:null})[_0x7fb6('0x13')](function(_0x292c6d){logger['info'](_0x7fb6('0x23'),_0x4b6fd1);logger[_0x7fb6('0x17')]('UpdateChatInteraction',_0x4b6fd1,JSON[_0x7fb6('0x24')](_0x292c6d));_0x3f445a(_0x292c6d);})[_0x7fb6('0x1c')](function(_0x529512){logger[_0x7fb6('0x18')]('UpdateChatInteraction',_0x529512[_0x7fb6('0x1a')],_0x4b6fd1);_0x12dde(_0x584e06[_0x7fb6('0x18')](0x1f4,_0x529512[_0x7fb6('0x1a')]));});});};exports['AddTagsToChatInteraction']=function(_0x39afdf){return new Promise(function(_0x134617,_0x149ddf){return db[_0x7fb6('0x1d')][_0x7fb6('0x25')]({'where':_0x39afdf['options']?_0x39afdf[_0x7fb6('0x1f')]['where']||null:null})[_0x7fb6('0x13')](function(_0x307484){if(_0x307484){return _0x307484[_0x7fb6('0x26')](_0x39afdf[_0x7fb6('0x27')][_0x7fb6('0x28')],_[_0x7fb6('0x29')](_0x39afdf[_0x7fb6('0x27')],[_0x7fb6('0x28'),'id'])||{});}})[_0x7fb6('0x2a')](function(_0x4bdf08){logger[_0x7fb6('0x14')](_0x7fb6('0x2b'),_0x39afdf);logger[_0x7fb6('0x17')](_0x7fb6('0x2b'),_0x39afdf,JSON[_0x7fb6('0x24')](_0x4bdf08));_0x134617(_0x4bdf08);})[_0x7fb6('0x1c')](function(_0x48d1ff){logger[_0x7fb6('0x18')]('AddTags',_0x48d1ff[_0x7fb6('0x1a')],_0x39afdf);_0x149ddf(_this['error'](0x1f4,_0x48d1ff['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index a4e8eeb..f219587 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 _0x03c1=['./chatInteraction.events','save','remove','update','emit','length','chatInteraction:'];(function(_0x1f8240,_0x449dd8){var _0x4b2c81=function(_0x51247f){while(--_0x51247f){_0x1f8240['push'](_0x1f8240['shift']());}};_0x4b2c81(++_0x449dd8);}(_0x03c1,0x118));var _0x103c=function(_0x251e8c,_0x277c33){_0x251e8c=_0x251e8c-0x0;var _0x1e0c1d=_0x03c1[_0x251e8c];return _0x1e0c1d;};'use strict';var ChatInteractionEvents=require(_0x103c('0x0'));var events=[_0x103c('0x1'),_0x103c('0x2'),_0x103c('0x3')];function createListener(_0x3f42dc,_0x3eaff9){return function(_0x57fe2c){_0x3eaff9[_0x103c('0x4')](_0x3f42dc,_0x57fe2c);};}function removeListener(_0x420cd3,_0x3936f5){return function(){ChatInteractionEvents['removeListener'](_0x420cd3,_0x3936f5);};}exports['register']=function(_0xdd5704){for(var _0x3bddde=0x0,_0x35e042=events[_0x103c('0x5')];_0x3bddde<_0x35e042;_0x3bddde++){var _0x2a325c=events[_0x3bddde];var _0x5bcdf3=createListener(_0x103c('0x6')+_0x2a325c,_0xdd5704);ChatInteractionEvents['on'](_0x2a325c,_0x5bcdf3);}}; \ No newline at end of file +var _0x9e28=['remove','update','emit','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x2a4fee,_0x53ca95){var _0x215530=function(_0x3be8f2){while(--_0x3be8f2){_0x2a4fee['push'](_0x2a4fee['shift']());}};_0x215530(++_0x53ca95);}(_0x9e28,0x1ae));var _0x89e2=function(_0x26ee56,_0x2a46cd){_0x26ee56=_0x26ee56-0x0;var _0x575109=_0x9e28[_0x26ee56];return _0x575109;};'use strict';var ChatInteractionEvents=require(_0x89e2('0x0'));var events=[_0x89e2('0x1'),_0x89e2('0x2'),_0x89e2('0x3')];function createListener(_0x24bb22,_0x1ba158){return function(_0x128f6a){_0x1ba158[_0x89e2('0x4')](_0x24bb22,_0x128f6a);};}function removeListener(_0x3e3028,_0x45352b){return function(){ChatInteractionEvents['removeListener'](_0x3e3028,_0x45352b);};}exports[_0x89e2('0x5')]=function(_0x47fb84){for(var _0x31a7af=0x0,_0x4d28f8=events[_0x89e2('0x6')];_0x31a7af<_0x4d28f8;_0x31a7af++){var _0x4fc2d8=events[_0x31a7af];var _0xe606a9=createListener(_0x89e2('0x7')+_0x4fc2d8,_0x47fb84);ChatInteractionEvents['on'](_0x4fc2d8,_0xe606a9);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 93d74ac..02f94d5 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 _0xb8a2=['chatinteraction:destroy','delete','/:id/tags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','post','create','diskStorage','join','root','server/files/attachments/','format','%s-%s','single','file','addMessage','tracked','chat','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close'];(function(_0x2e6544,_0x168aef){var _0x8dceb5=function(_0x54d448){while(--_0x54d448){_0x2e6544['push'](_0x2e6544['shift']());}};_0x8dceb5(++_0x168aef);}(_0xb8a2,0x1ee));var _0x2b8a=function(_0x1538d1,_0x1fb930){_0x1538d1=_0x1538d1-0x0;var _0x2b5747=_0xb8a2[_0x1538d1];return _0x2b5747;};'use strict';var multer=require('multer');var util=require(_0x2b8a('0x0'));var path=require(_0x2b8a('0x1'));var timeout=require(_0x2b8a('0x2'));var express=require(_0x2b8a('0x3'));var router=express[_0x2b8a('0x4')]();var auth=require(_0x2b8a('0x5'));var interaction=require(_0x2b8a('0x6'));var config=require(_0x2b8a('0x7'));var controller=require(_0x2b8a('0x8'));router[_0x2b8a('0x9')]('/',auth[_0x2b8a('0xa')](),controller[_0x2b8a('0xb')]);router[_0x2b8a('0x9')](_0x2b8a('0xc'),auth['isAuthenticated'](),controller[_0x2b8a('0xd')]);router[_0x2b8a('0x9')](_0x2b8a('0xe'),auth[_0x2b8a('0xf')](),controller[_0x2b8a('0x10')]);router[_0x2b8a('0x9')](_0x2b8a('0x11'),auth[_0x2b8a('0xf')](),controller[_0x2b8a('0x12')]);router[_0x2b8a('0x9')](_0x2b8a('0x13'),auth[_0x2b8a('0xa')](),controller[_0x2b8a('0x14')]);router[_0x2b8a('0x9')](_0x2b8a('0x15'),auth[_0x2b8a('0xf')](),controller['getMyMessages']);router['get'](_0x2b8a('0x16'),auth[_0x2b8a('0xa')](),controller['download']);router[_0x2b8a('0x17')]('/',auth[_0x2b8a('0xa')](),controller[_0x2b8a('0x18')]);var upload=multer({'storage':multer[_0x2b8a('0x19')]({'destination':function(_0x231479,_0x584c36,_0x3433a8){_0x3433a8(null,path[_0x2b8a('0x1a')](config[_0x2b8a('0x1b')],_0x2b8a('0x1c')));},'filename':function(_0x2d142e,_0xb960da,_0xfeb695){_0xfeb695(null,util[_0x2b8a('0x1d')](_0x2b8a('0x1e'),Date['now'](),_0xb960da['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2b8a('0x17')]('/:id/attachment_upload',upload[_0x2b8a('0x1f')](_0x2b8a('0x20')),controller['attachmentUpload']);router[_0x2b8a('0x17')](_0x2b8a('0x13'),auth[_0x2b8a('0xf')](),controller[_0x2b8a('0x21')]);router[_0x2b8a('0x17')]('/:id/tags',auth[_0x2b8a('0xa')](),interaction[_0x2b8a('0x22')](_0x2b8a('0x23'),'chatinteraction:addtags'),controller[_0x2b8a('0x24')]);router[_0x2b8a('0x25')](_0x2b8a('0xe'),auth[_0x2b8a('0xa')](),interaction[_0x2b8a('0x22')](_0x2b8a('0x23'),_0x2b8a('0x26')),controller[_0x2b8a('0x27')]);router[_0x2b8a('0x25')](_0x2b8a('0x28'),controller[_0x2b8a('0x29')]);router[_0x2b8a('0x25')](_0x2b8a('0x2a'),auth[_0x2b8a('0xf')](),controller['abandon']);router[_0x2b8a('0x25')](_0x2b8a('0x2b'),controller[_0x2b8a('0x2c')]);router['delete'](_0x2b8a('0xe'),auth[_0x2b8a('0xa')](),interaction[_0x2b8a('0x22')](_0x2b8a('0x23'),_0x2b8a('0x2d')),controller['destroy']);router[_0x2b8a('0x2e')](_0x2b8a('0x2f'),auth[_0x2b8a('0xa')](),controller['removeTags']);module[_0x2b8a('0x30')]=router; \ No newline at end of file +var _0x3efd=['format','%s-%s','now','originalname','/:id/attachment_upload','single','file','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','../../components/interaction/service','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','diskStorage','join','root','server/files/attachments/'];(function(_0x559739,_0x55a17d){var _0x42412a=function(_0x2d3f3e){while(--_0x2d3f3e){_0x559739['push'](_0x559739['shift']());}};_0x42412a(++_0x55a17d);}(_0x3efd,0x15f));var _0xd3ef=function(_0x1c985d,_0xa40ee9){_0x1c985d=_0x1c985d-0x0;var _0x35c453=_0x3efd[_0x1c985d];return _0x35c453;};'use strict';var multer=require(_0xd3ef('0x0'));var util=require('util');var path=require(_0xd3ef('0x1'));var timeout=require(_0xd3ef('0x2'));var express=require(_0xd3ef('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xd3ef('0x4'));var config=require('../../config/environment');var controller=require(_0xd3ef('0x5'));router['get']('/',auth[_0xd3ef('0x6')](),controller[_0xd3ef('0x7')]);router[_0xd3ef('0x8')](_0xd3ef('0x9'),auth['isAuthenticated'](),controller[_0xd3ef('0xa')]);router[_0xd3ef('0x8')](_0xd3ef('0xb'),auth['isChatInteractionAuthorized'](),controller[_0xd3ef('0xc')]);router[_0xd3ef('0x8')](_0xd3ef('0xd'),auth[_0xd3ef('0xe')](),controller[_0xd3ef('0xf')]);router[_0xd3ef('0x8')](_0xd3ef('0x10'),auth[_0xd3ef('0x6')](),controller['getMessages']);router[_0xd3ef('0x8')](_0xd3ef('0x11'),auth[_0xd3ef('0xe')](),controller[_0xd3ef('0x12')]);router[_0xd3ef('0x8')](_0xd3ef('0x13'),auth[_0xd3ef('0x6')](),controller[_0xd3ef('0x14')]);router[_0xd3ef('0x15')]('/',auth[_0xd3ef('0x6')](),controller[_0xd3ef('0x16')]);var upload=multer({'storage':multer[_0xd3ef('0x17')]({'destination':function(_0x235f5d,_0x58a51e,_0x59c952){_0x59c952(null,path[_0xd3ef('0x18')](config[_0xd3ef('0x19')],_0xd3ef('0x1a')));},'filename':function(_0x54ca24,_0x466fe4,_0x11805e){_0x11805e(null,util[_0xd3ef('0x1b')](_0xd3ef('0x1c'),Date[_0xd3ef('0x1d')](),_0x466fe4[_0xd3ef('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd3ef('0x15')](_0xd3ef('0x1f'),upload[_0xd3ef('0x20')](_0xd3ef('0x21')),controller['attachmentUpload']);router[_0xd3ef('0x15')](_0xd3ef('0x10'),auth['isChatInteractionAuthorized'](),controller[_0xd3ef('0x22')]);router[_0xd3ef('0x15')](_0xd3ef('0x23'),auth['isAuthenticated'](),interaction[_0xd3ef('0x24')](_0xd3ef('0x25'),_0xd3ef('0x26')),controller[_0xd3ef('0x27')]);router[_0xd3ef('0x28')]('/:id',auth[_0xd3ef('0x6')](),interaction['tracked'](_0xd3ef('0x25'),_0xd3ef('0x29')),controller[_0xd3ef('0x2a')]);router[_0xd3ef('0x28')](_0xd3ef('0x2b'),controller[_0xd3ef('0x2c')]);router[_0xd3ef('0x28')](_0xd3ef('0x2d'),auth['isChatInteractionAuthorized'](),controller[_0xd3ef('0x2e')]);router['put'](_0xd3ef('0x2f'),controller[_0xd3ef('0x30')]);router[_0xd3ef('0x31')](_0xd3ef('0xb'),auth['isAuthenticated'](),interaction[_0xd3ef('0x24')](_0xd3ef('0x25'),_0xd3ef('0x32')),controller[_0xd3ef('0x33')]);router[_0xd3ef('0x31')](_0xd3ef('0x23'),auth[_0xd3ef('0x6')](),controller[_0xd3ef('0x34')]);module[_0xd3ef('0x35')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index b4f7bf3..ce57afd 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.attributes.js +++ b/server/api/chatInternalMessage/chatInternalMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['TEXT','BOOLEAN','INTEGER','sequelize'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x0b0e,0x187));var _0xe0b0=function(_0x47159c,_0x1c8216){_0x47159c=_0x47159c-0x0;var _0x454dbe=_0x0b0e[_0x47159c];return _0x454dbe;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe0b0('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xe0b0('0x3')]}}; \ No newline at end of file +var _0x5f2f=['INTEGER','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x3f6984,_0x37eb8){var _0x5c883b=function(_0x97976){while(--_0x97976){_0x3f6984['push'](_0x3f6984['shift']());}};_0x5c883b(++_0x37eb8);}(_0x5f2f,0x73));var _0xf5f2=function(_0x189199,_0x6f2eff){_0x189199=_0x189199-0x0;var _0x24c186=_0x5f2f[_0x189199];return _0x24c186;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf5f2('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xf5f2('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 299cd70..f140ba2 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 _0xf989=['api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','json','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','ChatInternalMessage','key','keys','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filters','filter','where','merge','type','VIRTUAL','options','count','includeAll','rows','catch','show','params','rawAttributes','include','create','body','find','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','admin','user','fullname','userpic','internal','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','isEmpty','role','push','FromId','read','-createdAt','all','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x2e6b02,_0x1937ca){var _0x5444c2=function(_0xa5c467){while(--_0xa5c467){_0x2e6b02['push'](_0x2e6b02['shift']());}};_0x5444c2(++_0x1937ca);}(_0xf989,0x1a5));var _0x9f98=function(_0x3a2118,_0x31fc3c){_0x3a2118=_0x3a2118-0x0;var _0x1d181d=_0xf989[_0x3a2118];return _0x1d181d;};'use strict';var pdf=require(_0x9f98('0x0'));var emlformat=require(_0x9f98('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9f98('0x2'));var jsonpatch=require(_0x9f98('0x3'));var rp=require('request-promise');var moment=require(_0x9f98('0x4'));var BPromise=require(_0x9f98('0x5'));var Mustache=require(_0x9f98('0x6'));var util=require(_0x9f98('0x7'));var path=require('path');var sox=require(_0x9f98('0x8'));var csv=require(_0x9f98('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x9f98('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9f98('0xb'));var toCsv=require(_0x9f98('0x9'));var querystring=require(_0x9f98('0xc'));var Papa=require(_0x9f98('0xd'));var Redis=require(_0x9f98('0xe'));var authService=require(_0x9f98('0xf'));var qs=require(_0x9f98('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9f98('0x11'));var logger=require(_0x9f98('0x12'))(_0x9f98('0x13'));var utils=require(_0x9f98('0x14'));var config=require(_0x9f98('0x15'));var db=require(_0x9f98('0x16'))['db'];config[_0x9f98('0x17')]=_[_0x9f98('0x18')](config['redis'],{'host':_0x9f98('0x19'),'port':0x18eb});var socket=require(_0x9f98('0x1a'))(new Redis(config['redis']));require(_0x9f98('0x1b'))['register'](socket);function respondWithStatusCode(_0x5b1be3,_0x172d12){_0x172d12=_0x172d12||0xcc;return function(_0x49fdc9){if(_0x49fdc9){return _0x5b1be3[_0x9f98('0x1c')](_0x172d12);}return _0x5b1be3[_0x9f98('0x1d')](_0x172d12)[_0x9f98('0x1e')]();};}function respondWithResult(_0x52114e,_0x4c83f5){_0x4c83f5=_0x4c83f5||0xc8;return function(_0x19b452){if(_0x19b452){return _0x52114e[_0x9f98('0x1d')](_0x4c83f5)[_0x9f98('0x1f')](_0x19b452);}};}function respondWithFilteredResult(_0x3d9087,_0x1eeff9){return function(_0x36282c){if(_0x36282c){var _0x4eaf01=_0x36282c['count'],_0x109cfb=_0x1eeff9[_0x9f98('0x20')],_0x5e16c1=_0x1eeff9[_0x9f98('0x20')]+_0x1eeff9['limit'],_0x26e76d;if(_0x5e16c1>=_0x4eaf01){_0x5e16c1=_0x4eaf01;_0x26e76d=0xc8;}else{_0x26e76d=0xce;}_0x3d9087[_0x9f98('0x1d')](_0x26e76d);return _0x3d9087[_0x9f98('0x21')]('Content-Range',_0x109cfb+'-'+_0x5e16c1+'/'+_0x4eaf01)[_0x9f98('0x1f')](_0x36282c);}return null;};}function patchUpdates(_0x1c0d0f){return function(_0x3e07bc){try{jsonpatch[_0x9f98('0x22')](_0x3e07bc,_0x1c0d0f,!![]);}catch(_0x577083){return BPromise[_0x9f98('0x23')](_0x577083);}return _0x3e07bc[_0x9f98('0x24')]();};}function saveUpdates(_0x351088,_0xc069ca){return function(_0x2cd561){if(_0x2cd561){return _0x2cd561[_0x9f98('0x25')](_0x351088)[_0x9f98('0x26')](function(_0xb043c1){return _0xb043c1;});}return null;};}function removeEntity(_0xbcaf2e,_0x281516){return function(_0x13ff6e){if(_0x13ff6e){return _0x13ff6e[_0x9f98('0x27')]()[_0x9f98('0x26')](function(){_0xbcaf2e[_0x9f98('0x1d')](0xcc)[_0x9f98('0x1e')]();});}};}function handleEntityNotFound(_0x1de46b,_0x1645a7){return function(_0x453f9b){if(!_0x453f9b){_0x1de46b[_0x9f98('0x1c')](0x194);}return _0x453f9b;};}function handleError(_0xe733da,_0x37b023){_0x37b023=_0x37b023||0x1f4;return function(_0x46fb54){logger[_0x9f98('0x28')](_0x46fb54[_0x9f98('0x29')]);if(_0x46fb54['name']){delete _0x46fb54[_0x9f98('0x2a')];}_0xe733da[_0x9f98('0x1d')](_0x37b023)[_0x9f98('0x2b')](_0x46fb54);};}exports['index']=function(_0x5151c7,_0x50af24){var _0x441784={},_0x363a1f={},_0x3b69d3={'count':0x0,'rows':[]};var _0x28fcb1=_[_0x9f98('0x2c')](db[_0x9f98('0x2d')]['rawAttributes'],function(_0x4304a7){return{'name':_0x4304a7['fieldName'],'type':_0x4304a7['type'][_0x9f98('0x2e')]};});_0x363a1f['model']=_['map'](_0x28fcb1,_0x9f98('0x2a'));_0x363a1f['query']=_[_0x9f98('0x2f')](_0x5151c7['query']);_0x363a1f['filters']=_[_0x9f98('0x30')](_0x363a1f[_0x9f98('0x31')],_0x363a1f['query']);_0x441784['attributes']=_[_0x9f98('0x30')](_0x363a1f[_0x9f98('0x31')],qs['fields'](_0x5151c7[_0x9f98('0x32')][_0x9f98('0x33')]));_0x441784[_0x9f98('0x34')]=_0x441784[_0x9f98('0x34')][_0x9f98('0x35')]?_0x441784[_0x9f98('0x34')]:_0x363a1f[_0x9f98('0x31')];if(!_0x5151c7['query'][_0x9f98('0x36')](_0x9f98('0x37'))){_0x441784[_0x9f98('0x38')]=qs[_0x9f98('0x38')](_0x5151c7[_0x9f98('0x32')][_0x9f98('0x38')]);_0x441784[_0x9f98('0x20')]=qs[_0x9f98('0x20')](_0x5151c7[_0x9f98('0x32')][_0x9f98('0x20')]);}_0x441784[_0x9f98('0x39')]=qs[_0x9f98('0x3a')](_0x5151c7[_0x9f98('0x32')]['sort']);_0x441784['where']=qs['filters'](_[_0x9f98('0x3b')](_0x5151c7[_0x9f98('0x32')],_0x363a1f[_0x9f98('0x3c')]));if(_0x5151c7[_0x9f98('0x32')][_0x9f98('0x3d')]){_0x441784[_0x9f98('0x3e')]=_[_0x9f98('0x3f')](_0x441784[_0x9f98('0x3e')],{'$or':_['map'](_0x28fcb1,function(_0x50e390){if(_0x50e390[_0x9f98('0x40')]!==_0x9f98('0x41')){var _0x26c5f4={};_0x26c5f4[_0x50e390[_0x9f98('0x2a')]]={'$like':'%'+_0x5151c7['query'][_0x9f98('0x3d')]+'%'};return _0x26c5f4;}})});}_0x441784=_[_0x9f98('0x3f')]({},_0x441784,_0x5151c7[_0x9f98('0x42')]);var _0x288901={'where':_0x441784[_0x9f98('0x3e')]};return db[_0x9f98('0x2d')]['count'](_0x288901)[_0x9f98('0x26')](function(_0x433947){_0x3b69d3[_0x9f98('0x43')]=_0x433947;if(_0x5151c7['query'][_0x9f98('0x44')]){_0x441784['include']=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x441784);})[_0x9f98('0x26')](function(_0x40716a){_0x3b69d3[_0x9f98('0x45')]=_0x40716a;return _0x3b69d3;})[_0x9f98('0x26')](respondWithFilteredResult(_0x50af24,_0x441784))[_0x9f98('0x46')](handleError(_0x50af24,null));};exports[_0x9f98('0x47')]=function(_0x337eb7,_0x6e251){var _0x251b7b={'raw':!![],'where':{'id':_0x337eb7[_0x9f98('0x48')]['id']}},_0x2e178b={};_0x2e178b[_0x9f98('0x31')]=_[_0x9f98('0x2f')](db['ChatInternalMessage'][_0x9f98('0x49')]);_0x2e178b['query']=_[_0x9f98('0x2f')](_0x337eb7[_0x9f98('0x32')]);_0x2e178b[_0x9f98('0x3c')]=_[_0x9f98('0x30')](_0x2e178b[_0x9f98('0x31')],_0x2e178b['query']);_0x251b7b['attributes']=_[_0x9f98('0x30')](_0x2e178b['model'],qs['fields'](_0x337eb7[_0x9f98('0x32')][_0x9f98('0x33')]));_0x251b7b[_0x9f98('0x34')]=_0x251b7b[_0x9f98('0x34')][_0x9f98('0x35')]?_0x251b7b[_0x9f98('0x34')]:_0x2e178b['model'];if(_0x337eb7[_0x9f98('0x32')]['includeAll']){_0x251b7b[_0x9f98('0x4a')]=[{'all':!![]}];}_0x251b7b=_[_0x9f98('0x3f')]({},_0x251b7b,_0x337eb7[_0x9f98('0x42')]);return db['ChatInternalMessage']['find'](_0x251b7b)[_0x9f98('0x26')](handleEntityNotFound(_0x6e251,null))[_0x9f98('0x26')](respondWithResult(_0x6e251,null))[_0x9f98('0x46')](handleError(_0x6e251,null));};exports[_0x9f98('0x4b')]=function(_0xa022f3,_0x5f0c19){return db['ChatInternalMessage'][_0x9f98('0x4b')](_0xa022f3['body'],{})[_0x9f98('0x26')](respondWithResult(_0x5f0c19,0xc9))[_0x9f98('0x46')](handleError(_0x5f0c19,null));};exports[_0x9f98('0x25')]=function(_0x4fba7b,_0x44ef2a){if(_0x4fba7b[_0x9f98('0x4c')]['id']){delete _0x4fba7b[_0x9f98('0x4c')]['id'];}return db[_0x9f98('0x2d')][_0x9f98('0x4d')]({'where':{'id':_0x4fba7b[_0x9f98('0x48')]['id']}})[_0x9f98('0x26')](handleEntityNotFound(_0x44ef2a,null))['then'](saveUpdates(_0x4fba7b['body'],null))[_0x9f98('0x26')](respondWithResult(_0x44ef2a,null))['catch'](handleError(_0x44ef2a,null));};exports[_0x9f98('0x27')]=function(_0x25e87c,_0x340203){return db[_0x9f98('0x2d')][_0x9f98('0x4d')]({'where':{'id':_0x25e87c[_0x9f98('0x48')]['id']}})[_0x9f98('0x26')](handleEntityNotFound(_0x340203,null))[_0x9f98('0x26')](removeEntity(_0x340203,null))[_0x9f98('0x46')](handleError(_0x340203,null));};exports['describe']=function(_0xbeac9d,_0x2a9d84){return db[_0x9f98('0x2d')][_0x9f98('0x4e')]()[_0x9f98('0x26')](respondWithResult(_0x2a9d84,null))[_0x9f98('0x46')](handleError(_0x2a9d84,null));};function wrapUser(_0x49c3fd){return function(_0x3490ff){var _0x16adc5=_0x49c3fd[_0x9f98('0x4f')]({'plain':!![]});_0x16adc5[_0x9f98('0x50')]=[];if(_0x3490ff){_0x16adc5[_0x9f98('0x51')]=_0x3490ff[_0x9f98('0x52')];_0x16adc5[_0x9f98('0x53')]=_0x3490ff;}else{_0x16adc5[_0x9f98('0x51')]=moment(0x0)[_0x9f98('0x54')](_0x9f98('0x55'));_0x16adc5[_0x9f98('0x53')]={};}return _0x16adc5;};}exports[_0x9f98('0x56')]=function(_0x1ee3f2,_0x3a5f00,_0x411647){var _0x44b45c=[];return db[_0x9f98('0x57')][_0x9f98('0x58')]({'where':{'role':[_0x9f98('0x59'),_0x9f98('0x5a'),_0x9f98('0x5b')]},'attributes':['id',_0x9f98('0x5c'),_0x9f98('0x2a'),'role',_0x9f98('0x5d'),_0x9f98('0x5e'),'online','lastLoginAt','allowmessenger',_0x9f98('0x5f')],'order':qs[_0x9f98('0x3a')](_0x9f98('0x60')),'include':[{'model':db[_0x9f98('0x61')],'as':_0x9f98('0x62'),'attributes':['id','name',_0x9f98('0x40')],'through':{'attributes':[]}}]})[_0x9f98('0x26')](function(_0x482add){if(_0x482add){var _0x12c93e=_0x1ee3f2['user'][_0x9f98('0x4f')]({'plain':!![]});if(!_0x12c93e)throw new Error(_0x9f98('0x63'));if(_0x12c93e['role']===_0x9f98('0x5b')){return db[_0x9f98('0x64')][_0x9f98('0x4d')]({'where':{'name':'Agents','userProfileId':_0x12c93e['userProfileId']},'raw':!![]})['then'](function(_0x47f2d9){if(_0x47f2d9){if(_0x47f2d9[_0x9f98('0x65')]===0x0){return db[_0x9f98('0x66')]['findAll']({'where':{'sectionId':_0x47f2d9['id']},'raw':!![]})['then'](function(_0x1f1f75){var _0x1c73a4=[];if(_[_0x9f98('0x67')](_0x1f1f75)){_0x1c73a4=_[_0x9f98('0x3d')](_0x482add,function(_0x1b4b9c){if(_0x1b4b9c[_0x9f98('0x68')]!==_0x9f98('0x59')){return _0x1b4b9c;}});return _0x1c73a4;}else{for(var _0x427ad4=0x0;_0x427ad4<_0x482add[_0x9f98('0x35')];_0x427ad4++){var _0x4d255b=_0x482add[_0x427ad4];if(_0x4d255b[_0x9f98('0x68')]===_0x9f98('0x59')){var _0x3a5e34=_[_0x9f98('0x4d')](_0x1f1f75,function(_0x75106e){return _0x75106e['resourceId']===_0x4d255b['id'];});if(_0x3a5e34)_0x1c73a4[_0x9f98('0x69')](_0x4d255b);}else{_0x1c73a4['push'](_0x4d255b);}}return _0x1c73a4;}});}else{return _0x482add;}}else{var _0x6ba415=_[_0x9f98('0x3d')](_0x482add,function(_0x5c547d){if(_0x5c547d[_0x9f98('0x68')]!==_0x9f98('0x59')){return _0x5c547d;}});return _0x6ba415;}});}else{return _0x482add;}}})['then'](function(_0x5082a8){var _0x5c8b8a=[];if(_0x5082a8){_0x44b45c=_0x5082a8;for(var _0x1a7cb1=0x0;_0x1a7cb1<_0x5082a8['length'];_0x1a7cb1+=0x1){_0x44b45c[_0x1a7cb1]['messages']=[];_0x5c8b8a[_0x9f98('0x69')](db[_0x9f98('0x2d')][_0x9f98('0x4d')]({'where':{'FromId':[_0x1ee3f2[_0x9f98('0x5b')]['id'],_0x5082a8[_0x1a7cb1]['id']],'ToId':[_0x1ee3f2['user']['id'],_0x5082a8[_0x1a7cb1]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x9f98('0x6a'),'ToId',_0x9f98('0x6b'),_0x9f98('0x4c')],'order':qs['sort'](_0x9f98('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x9f98('0x26')](wrapUser(_0x5082a8[_0x1a7cb1])));}return BPromise[_0x9f98('0x6d')](_0x5c8b8a);}return[];})['then'](function(_0x3ceefe){return{'rows':_0x3ceefe,'count':_0x3ceefe[_0x9f98('0x35')]};})['then'](respondWithResult(_0x3a5f00,null))['catch'](handleError(_0x3a5f00,null));}; \ No newline at end of file +var _0x8aba=['filters','attributes','fields','length','hasOwnProperty','order','where','pick','merge','type','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','intersection','include','find','create','body','describe','messages','lastMessageAt','lastMessage','format','getUsers','User','agent','admin','user','role','userpic','internal','online','allowmessenger','-online','VoiceQueue','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','ToId','read','sort','-createdAt','all','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','ChatInternalMessage','fieldName','key','model','map','query','keys'];(function(_0x2dddd2,_0x54a420){var _0x426e11=function(_0x5a7c70){while(--_0x5a7c70){_0x2dddd2['push'](_0x2dddd2['shift']());}};_0x426e11(++_0x54a420);}(_0x8aba,0x1f0));var _0xa8ab=function(_0x28342d,_0x336d2f){_0x28342d=_0x28342d-0x0;var _0x412ce8=_0x8aba[_0x28342d];return _0x412ce8;};'use strict';var pdf=require(_0xa8ab('0x0'));var emlformat=require(_0xa8ab('0x1'));var rimraf=require(_0xa8ab('0x2'));var zipdir=require(_0xa8ab('0x3'));var jsonpatch=require(_0xa8ab('0x4'));var rp=require('request-promise');var moment=require(_0xa8ab('0x5'));var BPromise=require(_0xa8ab('0x6'));var Mustache=require(_0xa8ab('0x7'));var util=require(_0xa8ab('0x8'));var path=require(_0xa8ab('0x9'));var sox=require(_0xa8ab('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xa8ab('0xb'));var squel=require(_0xa8ab('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa8ab('0xd'));var toCsv=require(_0xa8ab('0xe'));var querystring=require(_0xa8ab('0xf'));var Papa=require(_0xa8ab('0x10'));var Redis=require(_0xa8ab('0x11'));var authService=require(_0xa8ab('0x12'));var qs=require(_0xa8ab('0x13'));var as=require(_0xa8ab('0x14'));var hardwareService=require(_0xa8ab('0x15'));var logger=require('../../config/logger')(_0xa8ab('0x16'));var utils=require(_0xa8ab('0x17'));var config=require(_0xa8ab('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xa8ab('0x19')],{'host':_0xa8ab('0x1a'),'port':0x18eb});var socket=require(_0xa8ab('0x1b'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x28a56e,_0x376923){_0x376923=_0x376923||0xcc;return function(_0x26fff8){if(_0x26fff8){return _0x28a56e[_0xa8ab('0x1c')](_0x376923);}return _0x28a56e[_0xa8ab('0x1d')](_0x376923)['end']();};}function respondWithResult(_0x1eaf29,_0x1861fd){_0x1861fd=_0x1861fd||0xc8;return function(_0x20adc7){if(_0x20adc7){return _0x1eaf29[_0xa8ab('0x1d')](_0x1861fd)['json'](_0x20adc7);}};}function respondWithFilteredResult(_0x480df7,_0x1d7710){return function(_0x109cb3){if(_0x109cb3){var _0x48a13b=_0x109cb3[_0xa8ab('0x1e')],_0x385911=_0x1d7710[_0xa8ab('0x1f')],_0x3f0365=_0x1d7710[_0xa8ab('0x1f')]+_0x1d7710[_0xa8ab('0x20')],_0x3a6320;if(_0x3f0365>=_0x48a13b){_0x3f0365=_0x48a13b;_0x3a6320=0xc8;}else{_0x3a6320=0xce;}_0x480df7[_0xa8ab('0x1d')](_0x3a6320);return _0x480df7[_0xa8ab('0x21')](_0xa8ab('0x22'),_0x385911+'-'+_0x3f0365+'/'+_0x48a13b)[_0xa8ab('0x23')](_0x109cb3);}return null;};}function patchUpdates(_0x16ea8b){return function(_0x97f9ac){try{jsonpatch[_0xa8ab('0x24')](_0x97f9ac,_0x16ea8b,!![]);}catch(_0x968690){return BPromise[_0xa8ab('0x25')](_0x968690);}return _0x97f9ac[_0xa8ab('0x26')]();};}function saveUpdates(_0x431f37,_0x4c077a){return function(_0xa770a3){if(_0xa770a3){return _0xa770a3[_0xa8ab('0x27')](_0x431f37)[_0xa8ab('0x28')](function(_0x4dc142){return _0x4dc142;});}return null;};}function removeEntity(_0x22466e,_0x3b93c5){return function(_0x1489c5){if(_0x1489c5){return _0x1489c5[_0xa8ab('0x29')]()['then'](function(){_0x22466e[_0xa8ab('0x1d')](0xcc)[_0xa8ab('0x2a')]();});}};}function handleEntityNotFound(_0x4a70a2,_0x46cb1f){return function(_0x2b6661){if(!_0x2b6661){_0x4a70a2[_0xa8ab('0x1c')](0x194);}return _0x2b6661;};}function handleError(_0x29d973,_0x51ff23){_0x51ff23=_0x51ff23||0x1f4;return function(_0x3dad62){logger[_0xa8ab('0x2b')](_0x3dad62[_0xa8ab('0x2c')]);if(_0x3dad62[_0xa8ab('0x2d')]){delete _0x3dad62['name'];}_0x29d973['status'](_0x51ff23)[_0xa8ab('0x2e')](_0x3dad62);};}exports['index']=function(_0x4cdeb8,_0x583b4d){var _0x22b439={},_0x31ef7a={},_0x11f2e6={'count':0x0,'rows':[]};var _0x411fd0=_['map'](db[_0xa8ab('0x2f')]['rawAttributes'],function(_0x1036b0){return{'name':_0x1036b0[_0xa8ab('0x30')],'type':_0x1036b0['type'][_0xa8ab('0x31')]};});_0x31ef7a[_0xa8ab('0x32')]=_[_0xa8ab('0x33')](_0x411fd0,_0xa8ab('0x2d'));_0x31ef7a[_0xa8ab('0x34')]=_[_0xa8ab('0x35')](_0x4cdeb8['query']);_0x31ef7a[_0xa8ab('0x36')]=_['intersection'](_0x31ef7a['model'],_0x31ef7a[_0xa8ab('0x34')]);_0x22b439[_0xa8ab('0x37')]=_['intersection'](_0x31ef7a[_0xa8ab('0x32')],qs[_0xa8ab('0x38')](_0x4cdeb8['query'][_0xa8ab('0x38')]));_0x22b439[_0xa8ab('0x37')]=_0x22b439[_0xa8ab('0x37')][_0xa8ab('0x39')]?_0x22b439[_0xa8ab('0x37')]:_0x31ef7a[_0xa8ab('0x32')];if(!_0x4cdeb8[_0xa8ab('0x34')][_0xa8ab('0x3a')]('nolimit')){_0x22b439['limit']=qs[_0xa8ab('0x20')](_0x4cdeb8[_0xa8ab('0x34')][_0xa8ab('0x20')]);_0x22b439[_0xa8ab('0x1f')]=qs[_0xa8ab('0x1f')](_0x4cdeb8[_0xa8ab('0x34')][_0xa8ab('0x1f')]);}_0x22b439[_0xa8ab('0x3b')]=qs['sort'](_0x4cdeb8[_0xa8ab('0x34')]['sort']);_0x22b439[_0xa8ab('0x3c')]=qs['filters'](_[_0xa8ab('0x3d')](_0x4cdeb8['query'],_0x31ef7a[_0xa8ab('0x36')]));if(_0x4cdeb8['query']['filter']){_0x22b439[_0xa8ab('0x3c')]=_[_0xa8ab('0x3e')](_0x22b439['where'],{'$or':_['map'](_0x411fd0,function(_0x170ed1){if(_0x170ed1[_0xa8ab('0x3f')]!==_0xa8ab('0x40')){var _0x30ffb8={};_0x30ffb8[_0x170ed1[_0xa8ab('0x2d')]]={'$like':'%'+_0x4cdeb8[_0xa8ab('0x34')][_0xa8ab('0x41')]+'%'};return _0x30ffb8;}})});}_0x22b439=_[_0xa8ab('0x3e')]({},_0x22b439,_0x4cdeb8['options']);var _0xab4e7={'where':_0x22b439['where']};return db[_0xa8ab('0x2f')][_0xa8ab('0x1e')](_0xab4e7)[_0xa8ab('0x28')](function(_0x2939bb){_0x11f2e6[_0xa8ab('0x1e')]=_0x2939bb;if(_0x4cdeb8[_0xa8ab('0x34')][_0xa8ab('0x42')]){_0x22b439['include']=[{'all':!![]}];}return db[_0xa8ab('0x2f')][_0xa8ab('0x43')](_0x22b439);})[_0xa8ab('0x28')](function(_0x292cc){_0x11f2e6[_0xa8ab('0x44')]=_0x292cc;return _0x11f2e6;})[_0xa8ab('0x28')](respondWithFilteredResult(_0x583b4d,_0x22b439))[_0xa8ab('0x45')](handleError(_0x583b4d,null));};exports[_0xa8ab('0x46')]=function(_0x558c10,_0xcd8f27){var _0xa5be96={'raw':!![],'where':{'id':_0x558c10[_0xa8ab('0x47')]['id']}},_0x3ec967={};_0x3ec967[_0xa8ab('0x32')]=_[_0xa8ab('0x35')](db[_0xa8ab('0x2f')]['rawAttributes']);_0x3ec967[_0xa8ab('0x34')]=_['keys'](_0x558c10[_0xa8ab('0x34')]);_0x3ec967[_0xa8ab('0x36')]=_[_0xa8ab('0x48')](_0x3ec967[_0xa8ab('0x32')],_0x3ec967[_0xa8ab('0x34')]);_0xa5be96[_0xa8ab('0x37')]=_[_0xa8ab('0x48')](_0x3ec967[_0xa8ab('0x32')],qs['fields'](_0x558c10['query'][_0xa8ab('0x38')]));_0xa5be96[_0xa8ab('0x37')]=_0xa5be96[_0xa8ab('0x37')][_0xa8ab('0x39')]?_0xa5be96[_0xa8ab('0x37')]:_0x3ec967[_0xa8ab('0x32')];if(_0x558c10[_0xa8ab('0x34')][_0xa8ab('0x42')]){_0xa5be96[_0xa8ab('0x49')]=[{'all':!![]}];}_0xa5be96=_[_0xa8ab('0x3e')]({},_0xa5be96,_0x558c10['options']);return db[_0xa8ab('0x2f')][_0xa8ab('0x4a')](_0xa5be96)[_0xa8ab('0x28')](handleEntityNotFound(_0xcd8f27,null))[_0xa8ab('0x28')](respondWithResult(_0xcd8f27,null))[_0xa8ab('0x45')](handleError(_0xcd8f27,null));};exports[_0xa8ab('0x4b')]=function(_0x3890ca,_0x48dc44){return db[_0xa8ab('0x2f')][_0xa8ab('0x4b')](_0x3890ca[_0xa8ab('0x4c')],{})[_0xa8ab('0x28')](respondWithResult(_0x48dc44,0xc9))['catch'](handleError(_0x48dc44,null));};exports[_0xa8ab('0x27')]=function(_0xe0fe3a,_0x553593){if(_0xe0fe3a['body']['id']){delete _0xe0fe3a[_0xa8ab('0x4c')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0xe0fe3a['params']['id']}})['then'](handleEntityNotFound(_0x553593,null))[_0xa8ab('0x28')](saveUpdates(_0xe0fe3a['body'],null))['then'](respondWithResult(_0x553593,null))[_0xa8ab('0x45')](handleError(_0x553593,null));};exports[_0xa8ab('0x29')]=function(_0x181d63,_0xb3091f){return db[_0xa8ab('0x2f')][_0xa8ab('0x4a')]({'where':{'id':_0x181d63[_0xa8ab('0x47')]['id']}})[_0xa8ab('0x28')](handleEntityNotFound(_0xb3091f,null))[_0xa8ab('0x28')](removeEntity(_0xb3091f,null))[_0xa8ab('0x45')](handleError(_0xb3091f,null));};exports[_0xa8ab('0x4d')]=function(_0x4489b7,_0x48b86a){return db[_0xa8ab('0x2f')][_0xa8ab('0x4d')]()[_0xa8ab('0x28')](respondWithResult(_0x48b86a,null))['catch'](handleError(_0x48b86a,null));};function wrapUser(_0x5a61d9){return function(_0x275edf){var _0x51ef7f=_0x5a61d9['get']({'plain':!![]});_0x51ef7f[_0xa8ab('0x4e')]=[];if(_0x275edf){_0x51ef7f[_0xa8ab('0x4f')]=_0x275edf['createdAt'];_0x51ef7f[_0xa8ab('0x50')]=_0x275edf;}else{_0x51ef7f[_0xa8ab('0x4f')]=moment(0x0)[_0xa8ab('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x51ef7f[_0xa8ab('0x50')]={};}return _0x51ef7f;};}exports[_0xa8ab('0x52')]=function(_0x403f33,_0x1e050b,_0x1c8af2){var _0x2e8068=[];return db[_0xa8ab('0x53')][_0xa8ab('0x43')]({'where':{'role':[_0xa8ab('0x54'),_0xa8ab('0x55'),_0xa8ab('0x56')]},'attributes':['id','fullname',_0xa8ab('0x2d'),_0xa8ab('0x57'),_0xa8ab('0x58'),_0xa8ab('0x59'),_0xa8ab('0x5a'),'lastLoginAt',_0xa8ab('0x5b'),'showWebBar'],'order':qs['sort'](_0xa8ab('0x5c')),'include':[{'model':db[_0xa8ab('0x5d')],'as':'VoiceQueues','attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0xa8ab('0x28')](function(_0x45442a){if(_0x45442a){var _0xdc8237=_0x403f33[_0xa8ab('0x56')][_0xa8ab('0x5e')]({'plain':!![]});if(!_0xdc8237)throw new Error(_0xa8ab('0x5f'));if(_0xdc8237[_0xa8ab('0x57')]===_0xa8ab('0x56')){return db[_0xa8ab('0x60')]['find']({'where':{'name':_0xa8ab('0x61'),'userProfileId':_0xdc8237[_0xa8ab('0x62')]},'raw':!![]})[_0xa8ab('0x28')](function(_0x15d7a5){if(_0x15d7a5){if(_0x15d7a5['autoAssociation']===0x0){return db[_0xa8ab('0x63')]['findAll']({'where':{'sectionId':_0x15d7a5['id']},'raw':!![]})[_0xa8ab('0x28')](function(_0x4f269b){var _0xe8b06d=[];if(_[_0xa8ab('0x64')](_0x4f269b)){_0xe8b06d=_[_0xa8ab('0x41')](_0x45442a,function(_0x58a2e5){if(_0x58a2e5[_0xa8ab('0x57')]!=='agent'){return _0x58a2e5;}});return _0xe8b06d;}else{for(var _0x1d3bb1=0x0;_0x1d3bb1<_0x45442a[_0xa8ab('0x39')];_0x1d3bb1++){var _0x4ebffa=_0x45442a[_0x1d3bb1];if(_0x4ebffa[_0xa8ab('0x57')]===_0xa8ab('0x54')){var _0x580290=_[_0xa8ab('0x4a')](_0x4f269b,function(_0x1d7cb1){return _0x1d7cb1[_0xa8ab('0x65')]===_0x4ebffa['id'];});if(_0x580290)_0xe8b06d[_0xa8ab('0x66')](_0x4ebffa);}else{_0xe8b06d[_0xa8ab('0x66')](_0x4ebffa);}}return _0xe8b06d;}});}else{return _0x45442a;}}else{var _0x5d60d6=_[_0xa8ab('0x41')](_0x45442a,function(_0x5f54ac){if(_0x5f54ac[_0xa8ab('0x57')]!==_0xa8ab('0x54')){return _0x5f54ac;}});return _0x5d60d6;}});}else{return _0x45442a;}}})['then'](function(_0x39cae6){var _0x58353e=[];if(_0x39cae6){_0x2e8068=_0x39cae6;for(var _0x44ebd5=0x0;_0x44ebd5<_0x39cae6[_0xa8ab('0x39')];_0x44ebd5+=0x1){_0x2e8068[_0x44ebd5][_0xa8ab('0x4e')]=[];_0x58353e[_0xa8ab('0x66')](db[_0xa8ab('0x2f')][_0xa8ab('0x4a')]({'where':{'FromId':[_0x403f33['user']['id'],_0x39cae6[_0x44ebd5]['id']],'ToId':[_0x403f33['user']['id'],_0x39cae6[_0x44ebd5]['id']],'ChatGroupId':null},'attributes':['id',_0xa8ab('0x67'),_0xa8ab('0x68'),_0xa8ab('0x69'),_0xa8ab('0x6a'),_0xa8ab('0x4c')],'order':qs[_0xa8ab('0x6b')](_0xa8ab('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa8ab('0x28')](wrapUser(_0x39cae6[_0x44ebd5])));}return BPromise[_0xa8ab('0x6d')](_0x58353e);}return[];})['then'](function(_0x3e7d8e){return{'rows':_0x3e7d8e,'count':_0x3e7d8e[_0xa8ab('0x39')]};})['then'](respondWithResult(_0x1e050b,null))[_0xa8ab('0x45')](handleError(_0x1e050b,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index f27c857..bd8a7c2 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 _0xfd8f=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x374c66,_0x47be09){var _0x19f463=function(_0x4ededf){while(--_0x4ededf){_0x374c66['push'](_0x374c66['shift']());}};_0x19f463(++_0x47be09);}(_0xfd8f,0xae));var _0xffd8=function(_0x447a26,_0x3fd123){_0x447a26=_0x447a26-0x0;var _0x2e3e63=_0xfd8f[_0x447a26];return _0x2e3e63;};'use strict';var EventEmitter=require(_0xffd8('0x0'));var ChatInternalMessage=require(_0xffd8('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xffd8('0x2')](0x0);var events={'afterCreate':_0xffd8('0x3'),'afterUpdate':_0xffd8('0x4'),'afterDestroy':_0xffd8('0x5')};function emitEvent(_0x5dcec3){return function(_0x123f30,_0x190f79,_0x50c670){ChatInternalMessageEvents[_0xffd8('0x6')](_0x5dcec3+':'+_0x123f30['id'],_0x123f30);ChatInternalMessageEvents[_0xffd8('0x6')](_0x5dcec3,_0x123f30);_0x50c670(null);};}for(var e in events){if(events[_0xffd8('0x7')](e)){var event=events[e];ChatInternalMessage[_0xffd8('0x8')](e,emitEvent(event));}}module[_0xffd8('0x9')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xa8eb=['exports','events','ChatInternalMessage','save','update','remove','emit','hasOwnProperty'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0xa8eb,0x179));var _0xba8e=function(_0x108bf5,_0x211fd6){_0x108bf5=_0x108bf5-0x0;var _0x2d846d=_0xa8eb[_0x108bf5];return _0x2d846d;};'use strict';var EventEmitter=require(_0xba8e('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xba8e('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xba8e('0x2'),'afterUpdate':_0xba8e('0x3'),'afterDestroy':_0xba8e('0x4')};function emitEvent(_0x5c94e6){return function(_0x353df2,_0x368ce6,_0x4c5cd0){ChatInternalMessageEvents[_0xba8e('0x5')](_0x5c94e6+':'+_0x353df2['id'],_0x353df2);ChatInternalMessageEvents['emit'](_0x5c94e6,_0x353df2);_0x4c5cd0(null);};}for(var e in events){if(events[_0xba8e('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xba8e('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 316aa0c..58bc28a 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.model.js +++ b/server/api/chatInternalMessage/chatInternalMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x15ea09,_0x2f30ab){var _0x3e9c78=function(_0x15f8ba){while(--_0x15f8ba){_0x15ea09['push'](_0x15ea09['shift']());}};_0x3e9c78(++_0x2f30ab);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3071('0xc'),'collate':_0x3071('0xd')});}; \ No newline at end of file +var _0xbdb7=['define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes'];(function(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x242117,_0x505596){_0x242117=_0x242117-0x0;var _0x51e9df=_0xbdb7[_0x242117];return _0x51e9df;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var moment=require(_0x7bdb('0x4'));var BPromise=require(_0x7bdb('0x5'));var rp=require(_0x7bdb('0x6'));var fs=require('fs');var path=require(_0x7bdb('0x7'));var rimraf=require(_0x7bdb('0x8'));var config=require('../../config/environment');var attributes=require(_0x7bdb('0x9'));module['exports']=function(_0x4b5fff,_0xffdc86){return _0x4b5fff[_0x7bdb('0xa')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7bdb('0xb'),'collate':_0x7bdb('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index cd34455..7ce4c26 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 _0x702a=['debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','request','info','request\x20sent'];(function(_0x1355bd,_0x4cb6e8){var _0x550a07=function(_0x31c58a){while(--_0x31c58a){_0x1355bd['push'](_0x1355bd['shift']());}};_0x550a07(++_0x4cb6e8);}(_0x702a,0x175));var _0xa702=function(_0x4e3fca,_0x2713c8){_0x4e3fca=_0x4e3fca-0x0;var _0x367a34=_0x702a[_0x4e3fca];return _0x367a34;};'use strict';var _=require(_0xa702('0x0'));var util=require(_0xa702('0x1'));var moment=require(_0xa702('0x2'));var BPromise=require(_0xa702('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa702('0x4'))['db'];var utils=require(_0xa702('0x5'));var logger=require(_0xa702('0x6'))(_0xa702('0x7'));var config=require(_0xa702('0x8'));var jayson=require(_0xa702('0x9'));var client=jayson[_0xa702('0xa')]['http']({'port':0x232a});config[_0xa702('0xb')]=_[_0xa702('0xc')](config[_0xa702('0xb')],{'host':_0xa702('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x50c6da,_0x374b68,_0x2ba07c){return new BPromise(function(_0x5c6437,_0x2ca938){return client[_0xa702('0xe')](_0x50c6da,_0x2ba07c)['then'](function(_0x429e39){logger[_0xa702('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x374b68,_0xa702('0x10'));logger[_0xa702('0x11')](_0xa702('0x12'),_0x374b68,_0xa702('0x10'),JSON[_0xa702('0x13')](_0x429e39));if(_0x429e39['error']){if(_0x429e39[_0xa702('0x14')][_0xa702('0x15')]===0x1f4){logger[_0xa702('0x14')](_0xa702('0x16'),_0x374b68,_0x429e39[_0xa702('0x14')]['message']);return _0x2ca938(_0x429e39[_0xa702('0x14')][_0xa702('0x17')]);}logger[_0xa702('0x14')](_0xa702('0x16'),_0x374b68,_0x429e39[_0xa702('0x14')][_0xa702('0x17')]);return _0x5c6437(_0x429e39[_0xa702('0x14')]['message']);}else{logger[_0xa702('0xf')](_0xa702('0x16'),_0x374b68,_0xa702('0x10'));_0x5c6437(_0x429e39[_0xa702('0x18')][_0xa702('0x17')]);}})[_0xa702('0x19')](function(_0x5588c6){logger[_0xa702('0x14')](_0xa702('0x16'),_0x374b68,_0x5588c6);_0x2ca938(_0x5588c6);});});} \ No newline at end of file +var _0x6889=['error','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x6889,0x99));var _0x9688=function(_0x5a9d15,_0x23d58f){_0x5a9d15=_0x5a9d15-0x0;var _0x15cb4d=_0x6889[_0x5a9d15];return _0x15cb4d;};'use strict';var _=require(_0x9688('0x0'));var util=require(_0x9688('0x1'));var moment=require(_0x9688('0x2'));var BPromise=require(_0x9688('0x3'));var rs=require(_0x9688('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9688('0x5'));var logger=require(_0x9688('0x6'))(_0x9688('0x7'));var config=require(_0x9688('0x8'));var jayson=require(_0x9688('0x9'));var client=jayson['client'][_0x9688('0xa')]({'port':0x232a});config[_0x9688('0xb')]=_['defaults'](config[_0x9688('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9688('0xb')]));require(_0x9688('0xc'))[_0x9688('0xd')](socket);function respondWithRpcPromise(_0x4f3c4f,_0x1e38c7,_0x3fdc52){return new BPromise(function(_0x39a00a,_0x1fa9bc){return client[_0x9688('0xe')](_0x4f3c4f,_0x3fdc52)[_0x9688('0xf')](function(_0x32f094){logger[_0x9688('0x10')](_0x9688('0x11'),_0x1e38c7,_0x9688('0x12'));logger[_0x9688('0x13')](_0x9688('0x14'),_0x1e38c7,'request\x20sent',JSON[_0x9688('0x15')](_0x32f094));if(_0x32f094['error']){if(_0x32f094[_0x9688('0x16')]['code']===0x1f4){logger[_0x9688('0x16')](_0x9688('0x11'),_0x1e38c7,_0x32f094[_0x9688('0x16')][_0x9688('0x17')]);return _0x1fa9bc(_0x32f094[_0x9688('0x16')][_0x9688('0x17')]);}logger[_0x9688('0x16')](_0x9688('0x11'),_0x1e38c7,_0x32f094[_0x9688('0x16')]['message']);return _0x39a00a(_0x32f094[_0x9688('0x16')][_0x9688('0x17')]);}else{logger[_0x9688('0x10')](_0x9688('0x11'),_0x1e38c7,_0x9688('0x12'));_0x39a00a(_0x32f094['result']['message']);}})[_0x9688('0x18')](function(_0x1ba0ec){logger['error'](_0x9688('0x11'),_0x1e38c7,_0x1ba0ec);_0x1fa9bc(_0x1ba0ec);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 06accab..ff99431 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 _0xad36=['remove','update','emit','register','save'];(function(_0x4d08b8,_0x34c445){var _0x70214a=function(_0x4db67c){while(--_0x4db67c){_0x4d08b8['push'](_0x4d08b8['shift']());}};_0x70214a(++_0x34c445);}(_0xad36,0x11c));var _0x6ad3=function(_0x3bc262,_0x5b4697){_0x3bc262=_0x3bc262-0x0;var _0x1d2fd8=_0xad36[_0x3bc262];return _0x1d2fd8;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x6ad3('0x0'),_0x6ad3('0x1'),_0x6ad3('0x2')];function createListener(_0x1164e0,_0x32fb2f){return function(_0x35a0ee){_0x32fb2f[_0x6ad3('0x3')](_0x1164e0,_0x35a0ee);};}function removeListener(_0x17a9b2,_0x3d8fee){return function(){ChatInternalMessageEvents['removeListener'](_0x17a9b2,_0x3d8fee);};}exports[_0x6ad3('0x4')]=function(_0x3d669f){for(var _0x3c3041=0x0,_0xb38339=events['length'];_0x3c3041<_0xb38339;_0x3c3041++){var _0x5693c1=events[_0x3c3041];var _0x50913c=createListener('chatInternalMessage:'+_0x5693c1,_0x3d669f);ChatInternalMessageEvents['on'](_0x5693c1,_0x50913c);}}; \ No newline at end of file +var _0xe799=['length','chatInternalMessage:','./chatInternalMessage.events','remove','emit','register'];(function(_0x17feae,_0x1cd9ad){var _0x476a8d=function(_0x184882){while(--_0x184882){_0x17feae['push'](_0x17feae['shift']());}};_0x476a8d(++_0x1cd9ad);}(_0xe799,0x170));var _0x9e79=function(_0x2eae34,_0x3cb646){_0x2eae34=_0x2eae34-0x0;var _0x245b27=_0xe799[_0x2eae34];return _0x245b27;};'use strict';var ChatInternalMessageEvents=require(_0x9e79('0x0'));var events=['save',_0x9e79('0x1'),'update'];function createListener(_0x42f653,_0x34b481){return function(_0x528d88){_0x34b481[_0x9e79('0x2')](_0x42f653,_0x528d88);};}function removeListener(_0x3f0a4f,_0x809ffd){return function(){ChatInternalMessageEvents['removeListener'](_0x3f0a4f,_0x809ffd);};}exports[_0x9e79('0x3')]=function(_0x4e7bb3){for(var _0x3239df=0x0,_0x7f49fe=events[_0x9e79('0x4')];_0x3239df<_0x7f49fe;_0x3239df++){var _0x4a35c5=events[_0x3239df];var _0x29bb3d=createListener(_0x9e79('0x5')+_0x4a35c5,_0x4e7bb3);ChatInternalMessageEvents['on'](_0x4a35c5,_0x29bb3d);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index e7cbea6..5d947f9 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 _0x0713=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','put','update','delete'];(function(_0x1ca910,_0x251afe){var _0x442d18=function(_0x43ca46){while(--_0x43ca46){_0x1ca910['push'](_0x1ca910['shift']());}};_0x442d18(++_0x251afe);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var auth=require(_0x3071('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3071('0x5'));var controller=require(_0x3071('0x6'));router[_0x3071('0x7')]('/',auth[_0x3071('0x8')](),controller[_0x3071('0x9')]);router[_0x3071('0x7')](_0x3071('0xa'),auth[_0x3071('0x8')](),controller[_0x3071('0xb')]);router[_0x3071('0x7')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0xd')]);router['get'](_0x3071('0xe'),auth[_0x3071('0x8')](),controller[_0x3071('0xf')]);router[_0x3071('0x10')]('/',auth[_0x3071('0x8')](),controller['create']);router[_0x3071('0x11')](_0x3071('0xe'),controller[_0x3071('0x12')]);router[_0x3071('0x13')](_0x3071('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x3071('0x14')]=router; \ No newline at end of file +var _0xcb91=['isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x3d2881,_0x5d5d9b){var _0xcb0b76=function(_0x5db07d){while(--_0x5db07d){_0x3d2881['push'](_0x3d2881['shift']());}};_0xcb0b76(++_0x5d5d9b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x340380,_0x4bd2a8){_0x340380=_0x340380-0x0;var _0x49ce1c=_0xcb91[_0x340380];return _0x49ce1c;};'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('./chatInternalMessage.controller');router[_0x1cb9('0x6')]('/',auth[_0x1cb9('0x7')](),controller['index']);router[_0x1cb9('0x6')](_0x1cb9('0x8'),auth['isAuthenticated'](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0x6')]('/users',auth[_0x1cb9('0x7')](),controller['getUsers']);router['get'](_0x1cb9('0xa'),auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xb')]);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x7')](),controller['create']);router[_0x1cb9('0xd')](_0x1cb9('0xa'),controller[_0x1cb9('0xe')]);router[_0x1cb9('0xf')](_0x1cb9('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index c6f559d..daa4d7d 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 _0xb158=['out','DATE','sequelize','exports','TEXT','ENUM'];(function(_0x42fb16,_0x39fd7a){var _0x53a6ff=function(_0x1f0eca){while(--_0x1f0eca){_0x42fb16['push'](_0x42fb16['shift']());}};_0x53a6ff(++_0x39fd7a);}(_0xb158,0x92));var _0x8b15=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xb158[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x8b15('0x0'));module[_0x8b15('0x1')]={'body':{'type':Sequelize[_0x8b15('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x8b15('0x3')]('in',_0x8b15('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x8b15('0x5')]}}; \ No newline at end of file +var _0xc265=['TEXT','medium','BOOLEAN','ENUM','out','sequelize'];(function(_0x508568,_0x3f1c1e){var _0xd89b98=function(_0x16bb0d){while(--_0x16bb0d){_0x508568['push'](_0x508568['shift']());}};_0xd89b98(++_0x3f1c1e);}(_0xc265,0x1b5));var _0x5c26=function(_0x505d9f,_0x21723e){_0x505d9f=_0x505d9f-0x0;var _0x5bd7c9=_0xc265[_0x505d9f];return _0x5bd7c9;};'use strict';var Sequelize=require(_0x5c26('0x0'));module['exports']={'body':{'type':Sequelize[_0x5c26('0x1')](_0x5c26('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5c26('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x5c26('0x4')]('in',_0x5c26('0x5')),'defaultValue':_0x5c26('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 92f534f..3ccbc70 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 _0xd338=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ChatMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','sendStatus','end','status','json','count','offset','set','Content-Range','apply','save','then','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','create','body','find','describe','chat-interactions','chat','read','readAt','format','UserId','CmContact','Contact','get','ChatInteractionId','update','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','manual','interface','SIP/%s','channel','event','accept','acceptmessage','parse','reject','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','EventManager','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce'];(function(_0x1c9c91,_0x16eccb){var _0x1f3215=function(_0x466ebd){while(--_0x466ebd){_0x1c9c91['push'](_0x1c9c91['shift']());}};_0x1f3215(++_0x16eccb);}(_0xd338,0x73));var _0x8d33=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xd338[_0x1a36a5];return _0x746243;};'use strict';var pdf=require(_0x8d33('0x0'));var emlformat=require(_0x8d33('0x1'));var rimraf=require(_0x8d33('0x2'));var zipdir=require(_0x8d33('0x3'));var jsonpatch=require(_0x8d33('0x4'));var rp=require(_0x8d33('0x5'));var moment=require(_0x8d33('0x6'));var BPromise=require(_0x8d33('0x7'));var Mustache=require('mustache');var util=require(_0x8d33('0x8'));var path=require(_0x8d33('0x9'));var sox=require(_0x8d33('0xa'));var csv=require(_0x8d33('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8d33('0xc'));var squel=require('squel');var crypto=require(_0x8d33('0xd'));var jsforce=require(_0x8d33('0xe'));var deskjs=require(_0x8d33('0xf'));var toCsv=require(_0x8d33('0xb'));var querystring=require(_0x8d33('0x10'));var Papa=require('papaparse');var Redis=require(_0x8d33('0x11'));var authService=require(_0x8d33('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8d33('0x13'));var hardwareService=require(_0x8d33('0x14'));var logger=require(_0x8d33('0x15'))(_0x8d33('0x16'));var utils=require(_0x8d33('0x17'));var config=require(_0x8d33('0x18'));var db=require(_0x8d33('0x19'))['db'];config['redis']=_[_0x8d33('0x1a')](config[_0x8d33('0x1b')],{'host':_0x8d33('0x1c'),'port':0x18eb});var socket=require(_0x8d33('0x1d'))(new Redis(config[_0x8d33('0x1b')]));require(_0x8d33('0x1e'))[_0x8d33('0x1f')](socket);var jayson=require(_0x8d33('0x20'));var client=jayson[_0x8d33('0x21')][_0x8d33('0x22')]({'port':0x232c});var client9002=jayson[_0x8d33('0x21')][_0x8d33('0x22')]({'port':0x232a});function checkPasswordPattern(_0x47b423,_0x2d997c,_0x2c938e){if(_0x2c938e){var _0x483295=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x483295['test'](_0x2d997c)){return _0x47b423;}else{throw new db['Sequelize'][(_0x8d33('0x23'))](_0x8d33('0x24'));}}else{return _0x47b423;}}function respondWithRpcPromise(_0x2f41a2,_0x203b0f,_0x4afbda,_0x187d39){return new BPromise(function(_0x15f942,_0x3b0265){var _0x3feaa5=_0x187d39||client;return _0x3feaa5[_0x8d33('0x25')](_0x2f41a2,_0x4afbda)['then'](function(_0x4483a0){logger[_0x8d33('0x26')](_0x8d33('0x27'),_0x203b0f,'request\x20sent');logger[_0x8d33('0x28')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x203b0f,_0x8d33('0x29'),JSON[_0x8d33('0x2a')](_0x4483a0));if(_0x4483a0[_0x8d33('0x2b')]){if(_0x4483a0[_0x8d33('0x2b')][_0x8d33('0x2c')]===0x1f4){logger['error'](_0x8d33('0x27'),_0x203b0f,_0x4483a0[_0x8d33('0x2b')][_0x8d33('0x2d')]);return _0x3b0265(_0x4483a0[_0x8d33('0x2b')][_0x8d33('0x2d')]);}logger[_0x8d33('0x2b')]('ChatMessage,\x20%s,\x20%s',_0x203b0f,_0x4483a0[_0x8d33('0x2b')][_0x8d33('0x2d')]);return _0x15f942(_0x4483a0[_0x8d33('0x2b')][_0x8d33('0x2d')]);}else{logger['info'](_0x8d33('0x27'),_0x203b0f,'request\x20sent');_0x15f942(_0x4483a0['result']['message']);}})[_0x8d33('0x2e')](function(_0x5cd75e){logger[_0x8d33('0x2b')](_0x8d33('0x27'),_0x203b0f,_0x5cd75e);_0x3b0265(_0x5cd75e);});});}function respondWithStatusCode(_0x4c1dba,_0x186814){_0x186814=_0x186814||0xcc;return function(_0x4b038c){if(_0x4b038c){return _0x4c1dba[_0x8d33('0x2f')](_0x186814);}return _0x4c1dba['status'](_0x186814)[_0x8d33('0x30')]();};}function respondWithResult(_0x258ef2,_0x125cea){_0x125cea=_0x125cea||0xc8;return function(_0x3bd8c0){if(_0x3bd8c0){return _0x258ef2[_0x8d33('0x31')](_0x125cea)[_0x8d33('0x32')](_0x3bd8c0);}};}function respondWithFilteredResult(_0x3a82bd,_0x5380c3){return function(_0x401333){if(_0x401333){var _0x4de6d8=_0x401333[_0x8d33('0x33')],_0x4fe7b2=_0x5380c3[_0x8d33('0x34')],_0x1d7ad8=_0x5380c3[_0x8d33('0x34')]+_0x5380c3['limit'],_0x3d2aa;if(_0x1d7ad8>=_0x4de6d8){_0x1d7ad8=_0x4de6d8;_0x3d2aa=0xc8;}else{_0x3d2aa=0xce;}_0x3a82bd[_0x8d33('0x31')](_0x3d2aa);return _0x3a82bd[_0x8d33('0x35')](_0x8d33('0x36'),_0x4fe7b2+'-'+_0x1d7ad8+'/'+_0x4de6d8)['json'](_0x401333);}return null;};}function patchUpdates(_0x283d76){return function(_0x5d5eae){try{jsonpatch[_0x8d33('0x37')](_0x5d5eae,_0x283d76,!![]);}catch(_0x2510aa){return BPromise['reject'](_0x2510aa);}return _0x5d5eae[_0x8d33('0x38')]();};}function saveUpdates(_0x5a3956,_0xd094bd){return function(_0x48cb7b){if(_0x48cb7b){return _0x48cb7b['update'](_0x5a3956)[_0x8d33('0x39')](function(_0x2c4621){return _0x2c4621;});}return null;};}function removeEntity(_0x105923,_0x1a4656){return function(_0x1f2246){if(_0x1f2246){return _0x1f2246[_0x8d33('0x3a')]()['then'](function(){_0x105923['status'](0xcc)[_0x8d33('0x30')]();});}};}function handleEntityNotFound(_0xead132,_0x4bbade){return function(_0x2194df){if(!_0x2194df){_0xead132[_0x8d33('0x2f')](0x194);}return _0x2194df;};}function handleError(_0x504744,_0x27b6c7){_0x27b6c7=_0x27b6c7||0x1f4;return function(_0x2b290a){logger[_0x8d33('0x2b')](_0x2b290a[_0x8d33('0x3b')]);if(_0x2b290a['name']){delete _0x2b290a[_0x8d33('0x3c')];}_0x504744[_0x8d33('0x31')](_0x27b6c7)[_0x8d33('0x3d')](_0x2b290a);};}exports[_0x8d33('0x3e')]=function(_0x1b1165,_0x53aab8){var _0x3a683b={},_0x182c5a={},_0x49673f={'count':0x0,'rows':[]};var _0x49903b=_[_0x8d33('0x3f')](db[_0x8d33('0x40')][_0x8d33('0x41')],function(_0x4aacb2){return{'name':_0x4aacb2[_0x8d33('0x42')],'type':_0x4aacb2[_0x8d33('0x43')]['key']};});_0x182c5a['model']=_[_0x8d33('0x3f')](_0x49903b,'name');_0x182c5a[_0x8d33('0x44')]=_['keys'](_0x1b1165[_0x8d33('0x44')]);_0x182c5a[_0x8d33('0x45')]=_[_0x8d33('0x46')](_0x182c5a[_0x8d33('0x47')],_0x182c5a[_0x8d33('0x44')]);_0x3a683b[_0x8d33('0x48')]=_[_0x8d33('0x46')](_0x182c5a['model'],qs[_0x8d33('0x49')](_0x1b1165[_0x8d33('0x44')][_0x8d33('0x49')]));_0x3a683b['attributes']=_0x3a683b[_0x8d33('0x48')][_0x8d33('0x4a')]?_0x3a683b[_0x8d33('0x48')]:_0x182c5a[_0x8d33('0x47')];if(!_0x1b1165[_0x8d33('0x44')][_0x8d33('0x4b')]('nolimit')){_0x3a683b[_0x8d33('0x4c')]=qs['limit'](_0x1b1165[_0x8d33('0x44')]['limit']);_0x3a683b['offset']=qs[_0x8d33('0x34')](_0x1b1165[_0x8d33('0x44')][_0x8d33('0x34')]);}_0x3a683b[_0x8d33('0x4d')]=qs[_0x8d33('0x4e')](_0x1b1165[_0x8d33('0x44')][_0x8d33('0x4e')]);_0x3a683b[_0x8d33('0x4f')]=qs[_0x8d33('0x45')](_['pick'](_0x1b1165[_0x8d33('0x44')],_0x182c5a['filters']));if(_0x1b1165[_0x8d33('0x44')]['filter']){_0x3a683b[_0x8d33('0x4f')]=_[_0x8d33('0x50')](_0x3a683b[_0x8d33('0x4f')],{'$or':_[_0x8d33('0x3f')](_0x49903b,function(_0x4f4d42){if(_0x4f4d42[_0x8d33('0x43')]!==_0x8d33('0x51')){var _0xc5de41={};_0xc5de41[_0x4f4d42[_0x8d33('0x3c')]]={'$like':'%'+_0x1b1165[_0x8d33('0x44')][_0x8d33('0x52')]+'%'};return _0xc5de41;}})});}_0x3a683b=_[_0x8d33('0x50')]({},_0x3a683b,_0x1b1165[_0x8d33('0x53')]);var _0x57ed97={'where':_0x3a683b[_0x8d33('0x4f')]};return db['ChatMessage'][_0x8d33('0x33')](_0x57ed97)[_0x8d33('0x39')](function(_0x236ebc){_0x49673f[_0x8d33('0x33')]=_0x236ebc;if(_0x1b1165[_0x8d33('0x44')][_0x8d33('0x54')]){_0x3a683b[_0x8d33('0x55')]=[{'all':!![]}];}return db['ChatMessage'][_0x8d33('0x56')](_0x3a683b);})[_0x8d33('0x39')](function(_0x30c953){_0x49673f[_0x8d33('0x57')]=_0x30c953;return _0x49673f;})[_0x8d33('0x39')](respondWithFilteredResult(_0x53aab8,_0x3a683b))[_0x8d33('0x2e')](handleError(_0x53aab8,null));};exports[_0x8d33('0x58')]=function(_0xe3212,_0x5e0a93){var _0x13059a={'raw':!![],'where':{'id':_0xe3212[_0x8d33('0x59')]['id']}},_0x2bef07={};_0x2bef07[_0x8d33('0x47')]=_[_0x8d33('0x5a')](db['ChatMessage'][_0x8d33('0x41')]);_0x2bef07[_0x8d33('0x44')]=_[_0x8d33('0x5a')](_0xe3212['query']);_0x2bef07[_0x8d33('0x45')]=_[_0x8d33('0x46')](_0x2bef07[_0x8d33('0x47')],_0x2bef07['query']);_0x13059a[_0x8d33('0x48')]=_[_0x8d33('0x46')](_0x2bef07[_0x8d33('0x47')],qs['fields'](_0xe3212[_0x8d33('0x44')][_0x8d33('0x49')]));_0x13059a[_0x8d33('0x48')]=_0x13059a[_0x8d33('0x48')]['length']?_0x13059a['attributes']:_0x2bef07[_0x8d33('0x47')];if(_0xe3212[_0x8d33('0x44')][_0x8d33('0x54')]){_0x13059a['include']=[{'all':!![]}];}_0x13059a=_[_0x8d33('0x50')]({},_0x13059a,_0xe3212[_0x8d33('0x53')]);return db['ChatMessage']['find'](_0x13059a)['then'](handleEntityNotFound(_0x5e0a93,null))[_0x8d33('0x39')](respondWithResult(_0x5e0a93,null))[_0x8d33('0x2e')](handleError(_0x5e0a93,null));};exports[_0x8d33('0x5b')]=function(_0x43ffd5,_0x564a9e){return db[_0x8d33('0x40')][_0x8d33('0x5b')](_0x43ffd5[_0x8d33('0x5c')],{})[_0x8d33('0x39')](respondWithResult(_0x564a9e,0xc9))['catch'](handleError(_0x564a9e,null));};exports['update']=function(_0x58f141,_0x2a0b22){if(_0x58f141[_0x8d33('0x5c')]['id']){delete _0x58f141[_0x8d33('0x5c')]['id'];}return db[_0x8d33('0x40')][_0x8d33('0x5d')]({'where':{'id':_0x58f141[_0x8d33('0x59')]['id']}})['then'](handleEntityNotFound(_0x2a0b22,null))[_0x8d33('0x39')](saveUpdates(_0x58f141[_0x8d33('0x5c')],null))[_0x8d33('0x39')](respondWithResult(_0x2a0b22,null))[_0x8d33('0x2e')](handleError(_0x2a0b22,null));};exports[_0x8d33('0x3a')]=function(_0x4c73a8,_0xf0e6d4){return db[_0x8d33('0x40')][_0x8d33('0x5d')]({'where':{'id':_0x4c73a8['params']['id']}})[_0x8d33('0x39')](handleEntityNotFound(_0xf0e6d4,null))[_0x8d33('0x39')](removeEntity(_0xf0e6d4,null))[_0x8d33('0x2e')](handleError(_0xf0e6d4,null));};exports[_0x8d33('0x5e')]=function(_0xf28598,_0x5d894f){return db[_0x8d33('0x40')][_0x8d33('0x5e')]()[_0x8d33('0x39')](respondWithResult(_0x5d894f,null))[_0x8d33('0x2e')](handleError(_0x5d894f,null));};var interaction_log=require(_0x8d33('0x15'))(_0x8d33('0x5f'));exports['accept']=function(_0x10f025,_0x532ffc,_0x505408){var _0x47e799={'channel':_0x8d33('0x60')};if(_0x10f025[_0x8d33('0x5c')]['id']){delete _0x10f025[_0x8d33('0x5c')]['id'];}_0x10f025[_0x8d33('0x5c')][_0x8d33('0x61')]=!![];_0x10f025[_0x8d33('0x5c')][_0x8d33('0x62')]=moment()[_0x8d33('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x10f025[_0x8d33('0x5c')][_0x8d33('0x64')]=_0x10f025[_0x8d33('0x5c')]['UserId']||_0x10f025['user']['id'];return db[_0x8d33('0x40')]['find']({'where':{'id':_0x10f025['params']['id'],'UserId':null},'include':[{'model':db[_0x8d33('0x65')],'as':_0x8d33('0x66')}]})[_0x8d33('0x39')](handleEntityNotFound(_0x532ffc,null))['then'](saveUpdates(_0x10f025[_0x8d33('0x5c')],null))[_0x8d33('0x39')](function(_0x4068c7){if(_0x4068c7){_0x47e799[_0x8d33('0x2d')]=_0x4068c7[_0x8d33('0x67')]({'plain':!![]});return db['ChatInteraction'][_0x8d33('0x5d')]({'where':{'id':_0x4068c7[_0x8d33('0x68')]}});}return null;})[_0x8d33('0x39')](handleEntityNotFound(_0x532ffc,null))[_0x8d33('0x39')](function(_0x120271){if(_0x120271){return _0x120271[_0x8d33('0x69')]({'UserId':_0x10f025[_0x8d33('0x5c')][_0x8d33('0x64')],'read1stAt':_[_0x8d33('0x6a')](_0x120271[_0x8d33('0x6b')])?moment()[_0x8d33('0x63')](_0x8d33('0x6c')):undefined});}return null;})['then'](function(_0x19b5fb){if(_0x19b5fb){_0x47e799[_0x8d33('0x6d')]=_0x19b5fb['get']({'plain':!![]});interaction_log[_0x8d33('0x26')](_0x8d33('0x6e'),_0x10f025[_0x8d33('0x6f')]['id'],_0x10f025[_0x8d33('0x6f')][_0x8d33('0x3c')],_0x10f025[_0x8d33('0x6f')][_0x8d33('0x70')],_0x47e799[_0x8d33('0x6d')]['id'],_0x10f025[_0x8d33('0x5c')]?JSON['stringify'](_0x10f025[_0x8d33('0x5c')]):'null');return respondWithRpcPromise(_0x8d33('0x71'),'acceptMessage',_0x47e799);}return null;})[_0x8d33('0x39')](function(_0x5ed611){if(_0x5ed611){if(_0x10f025['body'][_0x8d33('0x72')]){_0x47e799['message'][_0x8d33('0x73')]=util[_0x8d33('0x63')](_0x8d33('0x74'),_0x10f025['user']['name']);_0x47e799[_0x8d33('0x2d')][_0x8d33('0x75')]=_0x47e799[_0x8d33('0x75')];_0x47e799['message'][_0x8d33('0x76')]=_0x8d33('0x77');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x8d33('0x78'),'message':_[_0x8d33('0x50')](_0x47e799[_0x8d33('0x2d')],JSON[_0x8d33('0x79')](_0x47e799[_0x8d33('0x6d')]['formData']))},client9002)['then'](function(){return _0x47e799;});}return _0x47e799;}return null;})[_0x8d33('0x39')](respondWithResult(_0x532ffc,null))[_0x8d33('0x2e')](handleError(_0x532ffc,null));};var interaction_log=require(_0x8d33('0x15'))(_0x8d33('0x5f'));exports[_0x8d33('0x7a')]=function(_0x1c865d,_0x1e1b46,_0x2f97cf){var _0x3ffbc1={'agent':{},'channel':'chat'};if(_0x1c865d[_0x8d33('0x5c')]['id']){delete _0x1c865d[_0x8d33('0x5c')]['id'];}_0x1c865d['body'][_0x8d33('0x64')]=_0x1c865d[_0x8d33('0x5c')][_0x8d33('0x64')]||_0x1c865d[_0x8d33('0x6f')]['id'];_0x3ffbc1['agent']['id']=_0x1c865d[_0x8d33('0x5c')][_0x8d33('0x64')];return db[_0x8d33('0x40')][_0x8d33('0x5d')]({'where':{'id':_0x1c865d[_0x8d33('0x59')]['id'],'UserId':null}})[_0x8d33('0x39')](handleEntityNotFound(_0x1e1b46,null))['then'](function(_0x75eec5){if(_0x75eec5){_0x3ffbc1[_0x8d33('0x2d')]=_0x75eec5[_0x8d33('0x67')]({'plain':!![]});return db[_0x8d33('0x7b')][_0x8d33('0x5d')]({'where':{'id':_0x75eec5[_0x8d33('0x68')]}});}return null;})[_0x8d33('0x39')](handleEntityNotFound(_0x1e1b46,null))[_0x8d33('0x39')](function(_0x507839){if(_0x507839){_0x3ffbc1['interaction']=_0x507839[_0x8d33('0x67')]({'plain':!![]});interaction_log['info'](_0x8d33('0x7c'),_0x1c865d[_0x8d33('0x6f')]['id'],_0x1c865d[_0x8d33('0x6f')]['name'],_0x1c865d[_0x8d33('0x6f')][_0x8d33('0x70')],_0x3ffbc1[_0x8d33('0x6d')]['id'],_0x1c865d['body']?JSON[_0x8d33('0x2a')](_0x1c865d['body']):_0x8d33('0x7d'));return respondWithRpcPromise(_0x8d33('0x7e'),_0x8d33('0x7f'),_0x3ffbc1);}return null;})[_0x8d33('0x39')](function(_0x212268){if(_0x212268){_0x212268[_0x8d33('0x2d')][_0x8d33('0x73')]=util[_0x8d33('0x63')](_0x8d33('0x74'),_0x1c865d[_0x8d33('0x6f')]['name']);_0x212268['message'][_0x8d33('0x75')]=_0x3ffbc1[_0x8d33('0x75')];_0x212268[_0x8d33('0x2d')]['event']='reject';respondWithRpcPromise(_0x8d33('0x80'),'EventManager',{'event':_0x8d33('0x81'),'message':_0x212268[_0x8d33('0x2d')]},client9002);return _0x3ffbc1;}return null;})[_0x8d33('0x39')](respondWithResult(_0x1e1b46,null))[_0x8d33('0x2e')](handleError(_0x1e1b46,null));}; \ No newline at end of file +var _0xcbe7=['null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','accept','EventManager','parse','formData','chat','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','redis','defaults','./chatMessage.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','sendStatus','status','end','offset','limit','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','ChatMessage','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','count','includeAll','include','findAll','rows','show','params','options','find','create','body','describe','chat-interactions','read','readAt','YYYY-MM-DD\x20HH:mm:ss','user','get','ChatInteraction','ChatInteractionId','UserId','isNil','read1stAt','format','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify'];(function(_0x560317,_0x421bac){var _0x405716=function(_0x19462a){while(--_0x19462a){_0x560317['push'](_0x560317['shift']());}};_0x405716(++_0x421bac);}(_0xcbe7,0x10a));var _0x7cbe=function(_0x179bd9,_0xf0a1ae){_0x179bd9=_0x179bd9-0x0;var _0x210fbb=_0xcbe7[_0x179bd9];return _0x210fbb;};'use strict';var pdf=require(_0x7cbe('0x0'));var emlformat=require(_0x7cbe('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7cbe('0x2'));var jsonpatch=require(_0x7cbe('0x3'));var rp=require(_0x7cbe('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7cbe('0x5'));var sox=require(_0x7cbe('0x6'));var csv=require(_0x7cbe('0x7'));var ejs=require(_0x7cbe('0x8'));var fs=require('fs');var _=require(_0x7cbe('0x9'));var squel=require('squel');var crypto=require(_0x7cbe('0xa'));var jsforce=require(_0x7cbe('0xb'));var deskjs=require(_0x7cbe('0xc'));var toCsv=require(_0x7cbe('0x7'));var querystring=require('querystring');var Papa=require(_0x7cbe('0xd'));var Redis=require(_0x7cbe('0xe'));var authService=require(_0x7cbe('0xf'));var qs=require(_0x7cbe('0x10'));var as=require(_0x7cbe('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7cbe('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x7cbe('0x13'))['db'];config[_0x7cbe('0x14')]=_[_0x7cbe('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7cbe('0x16'))[_0x7cbe('0x17')](socket);var jayson=require(_0x7cbe('0x18'));var client=jayson[_0x7cbe('0x19')][_0x7cbe('0x1a')]({'port':0x232c});var client9002=jayson[_0x7cbe('0x19')][_0x7cbe('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x59fedd,_0x4453b0,_0x33d6e4){if(_0x33d6e4){var _0x459be1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x459be1[_0x7cbe('0x1b')](_0x4453b0)){return _0x59fedd;}else{throw new db[(_0x7cbe('0x1c'))][(_0x7cbe('0x1d'))](_0x7cbe('0x1e'));}}else{return _0x59fedd;}}function respondWithRpcPromise(_0x15d339,_0x213671,_0x20d64e,_0x10189f){return new BPromise(function(_0x3c82bf,_0x582e2d){var _0x1ac2b0=_0x10189f||client;return _0x1ac2b0[_0x7cbe('0x1f')](_0x15d339,_0x20d64e)[_0x7cbe('0x20')](function(_0x87b8cf){logger[_0x7cbe('0x21')](_0x7cbe('0x22'),_0x213671,'request\x20sent');logger[_0x7cbe('0x23')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x213671,_0x7cbe('0x24'),JSON['stringify'](_0x87b8cf));if(_0x87b8cf[_0x7cbe('0x25')]){if(_0x87b8cf[_0x7cbe('0x25')][_0x7cbe('0x26')]===0x1f4){logger[_0x7cbe('0x25')]('ChatMessage,\x20%s,\x20%s',_0x213671,_0x87b8cf[_0x7cbe('0x25')]['message']);return _0x582e2d(_0x87b8cf[_0x7cbe('0x25')][_0x7cbe('0x27')]);}logger[_0x7cbe('0x25')]('ChatMessage,\x20%s,\x20%s',_0x213671,_0x87b8cf[_0x7cbe('0x25')]['message']);return _0x3c82bf(_0x87b8cf[_0x7cbe('0x25')][_0x7cbe('0x27')]);}else{logger[_0x7cbe('0x21')]('ChatMessage,\x20%s,\x20%s',_0x213671,'request\x20sent');_0x3c82bf(_0x87b8cf[_0x7cbe('0x28')][_0x7cbe('0x27')]);}})[_0x7cbe('0x29')](function(_0x2a0b96){logger[_0x7cbe('0x25')](_0x7cbe('0x22'),_0x213671,_0x2a0b96);_0x582e2d(_0x2a0b96);});});}function respondWithStatusCode(_0x19c16a,_0x2f9b62){_0x2f9b62=_0x2f9b62||0xcc;return function(_0x259d91){if(_0x259d91){return _0x19c16a[_0x7cbe('0x2a')](_0x2f9b62);}return _0x19c16a[_0x7cbe('0x2b')](_0x2f9b62)[_0x7cbe('0x2c')]();};}function respondWithResult(_0x5c8cb6,_0x5e3c11){_0x5e3c11=_0x5e3c11||0xc8;return function(_0x50acaa){if(_0x50acaa){return _0x5c8cb6[_0x7cbe('0x2b')](_0x5e3c11)['json'](_0x50acaa);}};}function respondWithFilteredResult(_0x1a822b,_0x48231d){return function(_0x31f30a){if(_0x31f30a){var _0x2444c5=_0x31f30a['count'],_0x4cf33d=_0x48231d[_0x7cbe('0x2d')],_0x121b24=_0x48231d[_0x7cbe('0x2d')]+_0x48231d[_0x7cbe('0x2e')],_0x4310d5;if(_0x121b24>=_0x2444c5){_0x121b24=_0x2444c5;_0x4310d5=0xc8;}else{_0x4310d5=0xce;}_0x1a822b[_0x7cbe('0x2b')](_0x4310d5);return _0x1a822b['set'](_0x7cbe('0x2f'),_0x4cf33d+'-'+_0x121b24+'/'+_0x2444c5)[_0x7cbe('0x30')](_0x31f30a);}return null;};}function patchUpdates(_0x148514){return function(_0x323549){try{jsonpatch[_0x7cbe('0x31')](_0x323549,_0x148514,!![]);}catch(_0x26ef17){return BPromise[_0x7cbe('0x32')](_0x26ef17);}return _0x323549[_0x7cbe('0x33')]();};}function saveUpdates(_0x1f46f1,_0x48206a){return function(_0x2c8cb7){if(_0x2c8cb7){return _0x2c8cb7[_0x7cbe('0x34')](_0x1f46f1)['then'](function(_0x51bb8b){return _0x51bb8b;});}return null;};}function removeEntity(_0x4ce247,_0x4da911){return function(_0x11a7b9){if(_0x11a7b9){return _0x11a7b9[_0x7cbe('0x35')]()['then'](function(){_0x4ce247[_0x7cbe('0x2b')](0xcc)[_0x7cbe('0x2c')]();});}};}function handleEntityNotFound(_0x54eb69,_0x599dd3){return function(_0x3d089e){if(!_0x3d089e){_0x54eb69[_0x7cbe('0x2a')](0x194);}return _0x3d089e;};}function handleError(_0x2b8493,_0x3c9c69){_0x3c9c69=_0x3c9c69||0x1f4;return function(_0x54d530){logger['error'](_0x54d530[_0x7cbe('0x36')]);if(_0x54d530[_0x7cbe('0x37')]){delete _0x54d530['name'];}_0x2b8493[_0x7cbe('0x2b')](_0x3c9c69)[_0x7cbe('0x38')](_0x54d530);};}exports['index']=function(_0x53f823,_0x13b0b5){var _0x53f4c={},_0x568f68={},_0x6a7b9b={'count':0x0,'rows':[]};var _0x4ff72c=_['map'](db[_0x7cbe('0x39')][_0x7cbe('0x3a')],function(_0x18d841){return{'name':_0x18d841['fieldName'],'type':_0x18d841[_0x7cbe('0x3b')][_0x7cbe('0x3c')]};});_0x568f68[_0x7cbe('0x3d')]=_[_0x7cbe('0x3e')](_0x4ff72c,'name');_0x568f68[_0x7cbe('0x3f')]=_[_0x7cbe('0x40')](_0x53f823['query']);_0x568f68[_0x7cbe('0x41')]=_[_0x7cbe('0x42')](_0x568f68[_0x7cbe('0x3d')],_0x568f68['query']);_0x53f4c[_0x7cbe('0x43')]=_['intersection'](_0x568f68[_0x7cbe('0x3d')],qs[_0x7cbe('0x44')](_0x53f823[_0x7cbe('0x3f')][_0x7cbe('0x44')]));_0x53f4c[_0x7cbe('0x43')]=_0x53f4c[_0x7cbe('0x43')][_0x7cbe('0x45')]?_0x53f4c[_0x7cbe('0x43')]:_0x568f68[_0x7cbe('0x3d')];if(!_0x53f823['query']['hasOwnProperty'](_0x7cbe('0x46'))){_0x53f4c[_0x7cbe('0x2e')]=qs['limit'](_0x53f823['query']['limit']);_0x53f4c['offset']=qs[_0x7cbe('0x2d')](_0x53f823[_0x7cbe('0x3f')][_0x7cbe('0x2d')]);}_0x53f4c[_0x7cbe('0x47')]=qs[_0x7cbe('0x48')](_0x53f823[_0x7cbe('0x3f')][_0x7cbe('0x48')]);_0x53f4c[_0x7cbe('0x49')]=qs[_0x7cbe('0x41')](_[_0x7cbe('0x4a')](_0x53f823[_0x7cbe('0x3f')],_0x568f68[_0x7cbe('0x41')]));if(_0x53f823[_0x7cbe('0x3f')]['filter']){_0x53f4c[_0x7cbe('0x49')]=_['merge'](_0x53f4c[_0x7cbe('0x49')],{'$or':_[_0x7cbe('0x3e')](_0x4ff72c,function(_0x247261){if(_0x247261[_0x7cbe('0x3b')]!==_0x7cbe('0x4b')){var _0xfa4d8={};_0xfa4d8[_0x247261[_0x7cbe('0x37')]]={'$like':'%'+_0x53f823[_0x7cbe('0x3f')][_0x7cbe('0x4c')]+'%'};return _0xfa4d8;}})});}_0x53f4c=_[_0x7cbe('0x4d')]({},_0x53f4c,_0x53f823['options']);var _0x36f423={'where':_0x53f4c[_0x7cbe('0x49')]};return db[_0x7cbe('0x39')][_0x7cbe('0x4e')](_0x36f423)[_0x7cbe('0x20')](function(_0x1a01eb){_0x6a7b9b['count']=_0x1a01eb;if(_0x53f823[_0x7cbe('0x3f')][_0x7cbe('0x4f')]){_0x53f4c[_0x7cbe('0x50')]=[{'all':!![]}];}return db[_0x7cbe('0x39')][_0x7cbe('0x51')](_0x53f4c);})['then'](function(_0x18d356){_0x6a7b9b[_0x7cbe('0x52')]=_0x18d356;return _0x6a7b9b;})['then'](respondWithFilteredResult(_0x13b0b5,_0x53f4c))['catch'](handleError(_0x13b0b5,null));};exports[_0x7cbe('0x53')]=function(_0xa497de,_0x49f346){var _0x25dc7e={'raw':!![],'where':{'id':_0xa497de[_0x7cbe('0x54')]['id']}},_0x51d95b={};_0x51d95b[_0x7cbe('0x3d')]=_[_0x7cbe('0x40')](db['ChatMessage']['rawAttributes']);_0x51d95b[_0x7cbe('0x3f')]=_[_0x7cbe('0x40')](_0xa497de[_0x7cbe('0x3f')]);_0x51d95b[_0x7cbe('0x41')]=_[_0x7cbe('0x42')](_0x51d95b[_0x7cbe('0x3d')],_0x51d95b[_0x7cbe('0x3f')]);_0x25dc7e[_0x7cbe('0x43')]=_[_0x7cbe('0x42')](_0x51d95b[_0x7cbe('0x3d')],qs[_0x7cbe('0x44')](_0xa497de[_0x7cbe('0x3f')][_0x7cbe('0x44')]));_0x25dc7e['attributes']=_0x25dc7e[_0x7cbe('0x43')][_0x7cbe('0x45')]?_0x25dc7e[_0x7cbe('0x43')]:_0x51d95b[_0x7cbe('0x3d')];if(_0xa497de[_0x7cbe('0x3f')][_0x7cbe('0x4f')]){_0x25dc7e[_0x7cbe('0x50')]=[{'all':!![]}];}_0x25dc7e=_['merge']({},_0x25dc7e,_0xa497de[_0x7cbe('0x55')]);return db[_0x7cbe('0x39')][_0x7cbe('0x56')](_0x25dc7e)[_0x7cbe('0x20')](handleEntityNotFound(_0x49f346,null))[_0x7cbe('0x20')](respondWithResult(_0x49f346,null))[_0x7cbe('0x29')](handleError(_0x49f346,null));};exports[_0x7cbe('0x57')]=function(_0x5e62f2,_0x558897){return db[_0x7cbe('0x39')][_0x7cbe('0x57')](_0x5e62f2[_0x7cbe('0x58')],{})['then'](respondWithResult(_0x558897,0xc9))[_0x7cbe('0x29')](handleError(_0x558897,null));};exports[_0x7cbe('0x34')]=function(_0x235d22,_0xece06e){if(_0x235d22[_0x7cbe('0x58')]['id']){delete _0x235d22[_0x7cbe('0x58')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x235d22['params']['id']}})['then'](handleEntityNotFound(_0xece06e,null))[_0x7cbe('0x20')](saveUpdates(_0x235d22[_0x7cbe('0x58')],null))[_0x7cbe('0x20')](respondWithResult(_0xece06e,null))[_0x7cbe('0x29')](handleError(_0xece06e,null));};exports['destroy']=function(_0x3e5277,_0x2e48c6){return db['ChatMessage'][_0x7cbe('0x56')]({'where':{'id':_0x3e5277[_0x7cbe('0x54')]['id']}})['then'](handleEntityNotFound(_0x2e48c6,null))[_0x7cbe('0x20')](removeEntity(_0x2e48c6,null))[_0x7cbe('0x29')](handleError(_0x2e48c6,null));};exports[_0x7cbe('0x59')]=function(_0x277642,_0x35fedd){return db[_0x7cbe('0x39')]['describe']()[_0x7cbe('0x20')](respondWithResult(_0x35fedd,null))[_0x7cbe('0x29')](handleError(_0x35fedd,null));};var interaction_log=require('../../config/logger')(_0x7cbe('0x5a'));exports['accept']=function(_0x28247f,_0x40e514,_0x4b08b7){var _0x11158a={'channel':'chat'};if(_0x28247f[_0x7cbe('0x58')]['id']){delete _0x28247f['body']['id'];}_0x28247f['body'][_0x7cbe('0x5b')]=!![];_0x28247f['body'][_0x7cbe('0x5c')]=moment()['format'](_0x7cbe('0x5d'));_0x28247f['body']['UserId']=_0x28247f[_0x7cbe('0x58')]['UserId']||_0x28247f[_0x7cbe('0x5e')]['id'];return db[_0x7cbe('0x39')][_0x7cbe('0x56')]({'where':{'id':_0x28247f[_0x7cbe('0x54')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})['then'](handleEntityNotFound(_0x40e514,null))[_0x7cbe('0x20')](saveUpdates(_0x28247f[_0x7cbe('0x58')],null))[_0x7cbe('0x20')](function(_0x2f44e3){if(_0x2f44e3){_0x11158a['message']=_0x2f44e3[_0x7cbe('0x5f')]({'plain':!![]});return db[_0x7cbe('0x60')]['find']({'where':{'id':_0x2f44e3[_0x7cbe('0x61')]}});}return null;})[_0x7cbe('0x20')](handleEntityNotFound(_0x40e514,null))[_0x7cbe('0x20')](function(_0x16d44e){if(_0x16d44e){return _0x16d44e['update']({'UserId':_0x28247f[_0x7cbe('0x58')][_0x7cbe('0x62')],'read1stAt':_[_0x7cbe('0x63')](_0x16d44e[_0x7cbe('0x64')])?moment()[_0x7cbe('0x65')](_0x7cbe('0x5d')):undefined});}return null;})['then'](function(_0x4b6b1a){if(_0x4b6b1a){_0x11158a['interaction']=_0x4b6b1a[_0x7cbe('0x5f')]({'plain':!![]});interaction_log[_0x7cbe('0x21')](_0x7cbe('0x66'),_0x28247f[_0x7cbe('0x5e')]['id'],_0x28247f['user'][_0x7cbe('0x37')],_0x28247f[_0x7cbe('0x5e')][_0x7cbe('0x67')],_0x11158a[_0x7cbe('0x68')]['id'],_0x28247f['body']?JSON[_0x7cbe('0x69')](_0x28247f['body']):_0x7cbe('0x6a'));return respondWithRpcPromise(_0x7cbe('0x6b'),_0x7cbe('0x6c'),_0x11158a);}return null;})['then'](function(_0x2ca19a){if(_0x2ca19a){if(_0x28247f[_0x7cbe('0x58')][_0x7cbe('0x6d')]){_0x11158a[_0x7cbe('0x27')][_0x7cbe('0x6e')]=util['format'](_0x7cbe('0x6f'),_0x28247f[_0x7cbe('0x5e')][_0x7cbe('0x37')]);_0x11158a[_0x7cbe('0x27')][_0x7cbe('0x70')]=_0x11158a['channel'];_0x11158a['message'][_0x7cbe('0x71')]=_0x7cbe('0x72');return respondWithRpcPromise('EventManager',_0x7cbe('0x73'),{'event':'acceptmessage','message':_[_0x7cbe('0x4d')](_0x11158a[_0x7cbe('0x27')],JSON[_0x7cbe('0x74')](_0x11158a[_0x7cbe('0x68')][_0x7cbe('0x75')]))},client9002)[_0x7cbe('0x20')](function(){return _0x11158a;});}return _0x11158a;}return null;})[_0x7cbe('0x20')](respondWithResult(_0x40e514,null))['catch'](handleError(_0x40e514,null));};var interaction_log=require(_0x7cbe('0x12'))(_0x7cbe('0x5a'));exports[_0x7cbe('0x32')]=function(_0x1880a3,_0x128b50,_0x4bfb8b){var _0x1b57ad={'agent':{},'channel':_0x7cbe('0x76')};if(_0x1880a3['body']['id']){delete _0x1880a3[_0x7cbe('0x58')]['id'];}_0x1880a3[_0x7cbe('0x58')]['UserId']=_0x1880a3[_0x7cbe('0x58')][_0x7cbe('0x62')]||_0x1880a3[_0x7cbe('0x5e')]['id'];_0x1b57ad[_0x7cbe('0x77')]['id']=_0x1880a3[_0x7cbe('0x58')][_0x7cbe('0x62')];return db[_0x7cbe('0x39')][_0x7cbe('0x56')]({'where':{'id':_0x1880a3['params']['id'],'UserId':null}})[_0x7cbe('0x20')](handleEntityNotFound(_0x128b50,null))['then'](function(_0x992466){if(_0x992466){_0x1b57ad[_0x7cbe('0x27')]=_0x992466['get']({'plain':!![]});return db['ChatInteraction'][_0x7cbe('0x56')]({'where':{'id':_0x992466[_0x7cbe('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x128b50,null))[_0x7cbe('0x20')](function(_0x255005){if(_0x255005){_0x1b57ad[_0x7cbe('0x68')]=_0x255005[_0x7cbe('0x5f')]({'plain':!![]});interaction_log[_0x7cbe('0x21')](_0x7cbe('0x78'),_0x1880a3[_0x7cbe('0x5e')]['id'],_0x1880a3[_0x7cbe('0x5e')]['name'],_0x1880a3[_0x7cbe('0x5e')]['role'],_0x1b57ad['interaction']['id'],_0x1880a3[_0x7cbe('0x58')]?JSON[_0x7cbe('0x69')](_0x1880a3[_0x7cbe('0x58')]):_0x7cbe('0x6a'));return respondWithRpcPromise(_0x7cbe('0x79'),_0x7cbe('0x7a'),_0x1b57ad);}return null;})[_0x7cbe('0x20')](function(_0x4d7c98){if(_0x4d7c98){_0x4d7c98['message']['interface']=util[_0x7cbe('0x65')](_0x7cbe('0x6f'),_0x1880a3['user'][_0x7cbe('0x37')]);_0x4d7c98[_0x7cbe('0x27')][_0x7cbe('0x70')]=_0x1b57ad['channel'];_0x4d7c98[_0x7cbe('0x27')][_0x7cbe('0x71')]=_0x7cbe('0x32');respondWithRpcPromise('EventManager',_0x7cbe('0x73'),{'event':_0x7cbe('0x7b'),'message':_0x4d7c98['message']},client9002);return _0x1b57ad;}return null;})['then'](respondWithResult(_0x128b50,null))[_0x7cbe('0x29')](handleError(_0x128b50,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index ccb7d60..83cd053 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 _0xd1da=['exports','events','ChatMessage','setMaxListeners','remove','hasOwnProperty','hook'];(function(_0x1f1695,_0x23167b){var _0x56dca5=function(_0x1c2013){while(--_0x1c2013){_0x1f1695['push'](_0x1f1695['shift']());}};_0x56dca5(++_0x23167b);}(_0xd1da,0xe1));var _0xad1d=function(_0x100682,_0x11afec){_0x100682=_0x100682-0x0;var _0xcb6e87=_0xd1da[_0x100682];return _0xcb6e87;};'use strict';var EventEmitter=require(_0xad1d('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xad1d('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xad1d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xad1d('0x3')};function emitEvent(_0x1b37d8){return function(_0x131258,_0x32abbc,_0x16bcf4){ChatMessageEvents['emit'](_0x1b37d8+':'+_0x131258['id'],_0x131258);ChatMessageEvents['emit'](_0x1b37d8,_0x131258);_0x16bcf4(null);};}for(var e in events){if(events[_0xad1d('0x4')](e)){var event=events[e];ChatMessage[_0xad1d('0x5')](e,emitEvent(event));}}module[_0xad1d('0x6')]=ChatMessageEvents; \ No newline at end of file +var _0xf10a=['remove','emit','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xf10a,0xe5));var _0xaf10=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0xf10a[_0x3da832];return _0xe602f2;};'use strict';var EventEmitter=require(_0xaf10('0x0'));var ChatMessage=require(_0xaf10('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xaf10('0x2')](0x0);var events={'afterCreate':_0xaf10('0x3'),'afterUpdate':_0xaf10('0x4'),'afterDestroy':_0xaf10('0x5')};function emitEvent(_0x5774de){return function(_0x1453c1,_0x50926a,_0x30971e){ChatMessageEvents[_0xaf10('0x6')](_0x5774de+':'+_0x1453c1['id'],_0x1453c1);ChatMessageEvents['emit'](_0x5774de,_0x1453c1);_0x30971e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xaf10('0x7')](e,emitEvent(event));}}module[_0xaf10('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index d7c6a5d..e2e5842 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 _0xaa4f=['FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','define','chat_messages','body'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0xaa4f,0x1a7));var _0xfaa4=function(_0x1d0445,_0x36e26f){_0x1d0445=_0x1d0445-0x0;var _0x5e2abd=_0xaa4f[_0x1d0445];return _0x5e2abd;};'use strict';var _=require(_0xfaa4('0x0'));var util=require(_0xfaa4('0x1'));var logger=require(_0xfaa4('0x2'))('api');var moment=require(_0xfaa4('0x3'));var BPromise=require(_0xfaa4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfaa4('0x5'));var rimraf=require(_0xfaa4('0x6'));var config=require(_0xfaa4('0x7'));var attributes=require(_0xfaa4('0x8'));module['exports']=function(_0x3638d2,_0x10d82a){return _0x3638d2[_0xfaa4('0x9')]('ChatMessage',attributes,{'tableName':_0xfaa4('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xfaa4('0xb')],'type':_0xfaa4('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xcab365,_0x58771a,_0x5d25f5){var _0x562b0b=_0x3638d2[_0xfaa4('0xd')];var _0x7ae524=_0xcab365[_0xfaa4('0xe')]({'plain':!![]});if(_0x7ae524[_0xfaa4('0xf')][_0xfaa4('0x10')]()==='in'||_0x7ae524[_0xfaa4('0xf')][_0xfaa4('0x10')]()==='out'&&!_0x7ae524[_0xfaa4('0x11')]&&!_[_0xfaa4('0x12')](_0x7ae524[_0xfaa4('0x13')])){_0x562b0b[_0xfaa4('0x14')][_0xfaa4('0x15')]({'where':{'id':_0x7ae524[_0xfaa4('0x16')]}})[_0xfaa4('0x17')](function(_0x25f7a4){if(_0x25f7a4){_0x25f7a4[_0xfaa4('0x18')]({'lastMsgAt':_0x7ae524['createdAt'],'lastMsgDirection':_0x7ae524['direction'][_0xfaa4('0x10')]()});}})[_0xfaa4('0x19')](function(_0x21ff83){console[_0xfaa4('0x1a')](_0x21ff83);});}_0x5d25f5();}},'charset':_0xfaa4('0x1b'),'collate':_0xfaa4('0x1c')});}; \ No newline at end of file +var _0x0b7c=['createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','get','direction','out','secret','ChatInteraction','findOne','ChatInteractionId','then','update'];(function(_0x38fe7e,_0x167364){var _0x53a0a6=function(_0x3a9362){while(--_0x3a9362){_0x38fe7e['push'](_0x38fe7e['shift']());}};_0x53a0a6(++_0x167364);}(_0x0b7c,0x11d));var _0xc0b7=function(_0x27604f,_0x5ae336){_0x27604f=_0x27604f-0x0;var _0x40d189=_0x0b7c[_0x27604f];return _0x40d189;};'use strict';var _=require(_0xc0b7('0x0'));var util=require(_0xc0b7('0x1'));var logger=require(_0xc0b7('0x2'))(_0xc0b7('0x3'));var moment=require(_0xc0b7('0x4'));var BPromise=require(_0xc0b7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc0b7('0x6'));var rimraf=require('rimraf');var config=require(_0xc0b7('0x7'));var attributes=require(_0xc0b7('0x8'));module['exports']=function(_0x22881d,_0x16ba3c){return _0x22881d[_0xc0b7('0x9')](_0xc0b7('0xa'),attributes,{'tableName':_0xc0b7('0xb'),'paranoid':![],'indexes':[{'name':_0xc0b7('0xc'),'fields':['body'],'type':_0xc0b7('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x528375,_0x282382,_0x5a97de){var _0x4572fd=_0x22881d['models'];var _0x227d55=_0x528375[_0xc0b7('0xe')]({'plain':!![]});if(_0x227d55[_0xc0b7('0xf')]['toLowerCase']()==='in'||_0x227d55['direction']['toLowerCase']()===_0xc0b7('0x10')&&!_0x227d55[_0xc0b7('0x11')]&&!_['isNil'](_0x227d55['UserId'])){_0x4572fd[_0xc0b7('0x12')][_0xc0b7('0x13')]({'where':{'id':_0x227d55[_0xc0b7('0x14')]}})[_0xc0b7('0x15')](function(_0x504f9d){if(_0x504f9d){_0x504f9d[_0xc0b7('0x16')]({'lastMsgAt':_0x227d55[_0xc0b7('0x17')],'lastMsgDirection':_0x227d55[_0xc0b7('0xf')]['toLowerCase']()});}})[_0xc0b7('0x18')](function(_0x382b2b){console[_0xc0b7('0x19')](_0x382b2b);});}_0x5a97de();}},'charset':_0xc0b7('0x1a'),'collate':_0xc0b7('0x1b')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 6302e96..e83404c 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 _0xdfa8=['code','message','catch','ChatMessage','body','options','CreateChatMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x4e8ea2,_0x55e417){var _0x692947=function(_0x34b8cc){while(--_0x34b8cc){_0x4e8ea2['push'](_0x4e8ea2['shift']());}};_0x692947(++_0x55e417);}(_0xdfa8,0x1e7));var _0x8dfa=function(_0x32b004,_0x3a4f15){_0x32b004=_0x32b004-0x0;var _0x228f5d=_0xdfa8[_0x32b004];return _0x228f5d;};'use strict';var _=require(_0x8dfa('0x0'));var util=require(_0x8dfa('0x1'));var moment=require(_0x8dfa('0x2'));var BPromise=require(_0x8dfa('0x3'));var rs=require(_0x8dfa('0x4'));var fs=require('fs');var Redis=require(_0x8dfa('0x5'));var db=require(_0x8dfa('0x6'))['db'];var utils=require(_0x8dfa('0x7'));var logger=require(_0x8dfa('0x8'))(_0x8dfa('0x9'));var config=require(_0x8dfa('0xa'));var jayson=require(_0x8dfa('0xb'));var client=jayson['client']['http']({'port':0x232a});config[_0x8dfa('0xc')]=_[_0x8dfa('0xd')](config[_0x8dfa('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x8dfa('0xe'))(new Redis(config['redis']));require(_0x8dfa('0xf'))[_0x8dfa('0x10')](socket);function respondWithRpcPromise(_0x10d83e,_0x4c891b,_0xa13c87){return new BPromise(function(_0x51d177,_0x2133fc){return client[_0x8dfa('0x11')](_0x10d83e,_0xa13c87)[_0x8dfa('0x12')](function(_0x425a44){logger[_0x8dfa('0x13')](_0x8dfa('0x14'),_0x4c891b,_0x8dfa('0x15'));logger[_0x8dfa('0x16')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4c891b,'request\x20sent',JSON[_0x8dfa('0x17')](_0x425a44));if(_0x425a44[_0x8dfa('0x18')]){if(_0x425a44['error'][_0x8dfa('0x19')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x4c891b,_0x425a44[_0x8dfa('0x18')][_0x8dfa('0x1a')]);return _0x2133fc(_0x425a44[_0x8dfa('0x18')][_0x8dfa('0x1a')]);}logger[_0x8dfa('0x18')]('ChatMessage,\x20%s,\x20%s',_0x4c891b,_0x425a44[_0x8dfa('0x18')]['message']);return _0x51d177(_0x425a44[_0x8dfa('0x18')][_0x8dfa('0x1a')]);}else{logger[_0x8dfa('0x13')]('ChatMessage,\x20%s,\x20%s',_0x4c891b,_0x8dfa('0x15'));_0x51d177(_0x425a44['result'][_0x8dfa('0x1a')]);}})[_0x8dfa('0x1b')](function(_0x2a801f){logger[_0x8dfa('0x18')](_0x8dfa('0x14'),_0x4c891b,_0x2a801f);_0x2133fc(_0x2a801f);});});}exports['CreateChatMessage']=function(_0x32fc45){var _0x59367a=this;return new Promise(function(_0x4aad93,_0x105cec){return db[_0x8dfa('0x1c')]['create'](_0x32fc45[_0x8dfa('0x1d')],{'raw':_0x32fc45[_0x8dfa('0x1e')]?_0x32fc45[_0x8dfa('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x8dfa('0x12')](function(_0x2741d9){logger[_0x8dfa('0x13')](_0x8dfa('0x1f'),_0x32fc45);logger[_0x8dfa('0x16')](_0x8dfa('0x1f'),_0x32fc45,JSON['stringify'](_0x2741d9));_0x4aad93(_0x2741d9);})['catch'](function(_0x3322b7){logger[_0x8dfa('0x18')]('CreateChatMessage',_0x3322b7['message'],_0x32fc45);_0x105cec(_0x59367a[_0x8dfa('0x18')](0x1f4,_0x3322b7['message']));});});}; \ No newline at end of file +var _0x02cc=['debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','ChatMessage,\x20%s,\x20%s','result','ChatMessage','create','body','options','raw','stringify','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','request\x20sent'];(function(_0x15a26e,_0x334582){var _0x25bef6=function(_0x2fab4f){while(--_0x2fab4f){_0x15a26e['push'](_0x15a26e['shift']());}};_0x25bef6(++_0x334582);}(_0x02cc,0x162));var _0xc02c=function(_0x3e8a85,_0x59ad86){_0x3e8a85=_0x3e8a85-0x0;var _0x31ddb0=_0x02cc[_0x3e8a85];return _0x31ddb0;};'use strict';var _=require(_0xc02c('0x0'));var util=require(_0xc02c('0x1'));var moment=require('moment');var BPromise=require(_0xc02c('0x2'));var rs=require(_0xc02c('0x3'));var fs=require('fs');var Redis=require(_0xc02c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc02c('0x5'))('rpc');var config=require(_0xc02c('0x6'));var jayson=require(_0xc02c('0x7'));var client=jayson[_0xc02c('0x8')][_0xc02c('0x9')]({'port':0x232a});config[_0xc02c('0xa')]=_[_0xc02c('0xb')](config[_0xc02c('0xa')],{'host':_0xc02c('0xc'),'port':0x18eb});var socket=require(_0xc02c('0xd'))(new Redis(config[_0xc02c('0xa')]));require(_0xc02c('0xe'))[_0xc02c('0xf')](socket);function respondWithRpcPromise(_0xe08863,_0x3de4e2,_0x1a048d){return new BPromise(function(_0x3092c4,_0x4893d0){return client[_0xc02c('0x10')](_0xe08863,_0x1a048d)[_0xc02c('0x11')](function(_0x28a205){logger[_0xc02c('0x12')]('ChatMessage,\x20%s,\x20%s',_0x3de4e2,_0xc02c('0x13'));logger[_0xc02c('0x14')](_0xc02c('0x15'),_0x3de4e2,_0xc02c('0x13'),JSON['stringify'](_0x28a205));if(_0x28a205['error']){if(_0x28a205[_0xc02c('0x16')][_0xc02c('0x17')]===0x1f4){logger[_0xc02c('0x16')]('ChatMessage,\x20%s,\x20%s',_0x3de4e2,_0x28a205[_0xc02c('0x16')]['message']);return _0x4893d0(_0x28a205[_0xc02c('0x16')][_0xc02c('0x18')]);}logger['error'](_0xc02c('0x19'),_0x3de4e2,_0x28a205['error']['message']);return _0x3092c4(_0x28a205[_0xc02c('0x16')]['message']);}else{logger[_0xc02c('0x12')](_0xc02c('0x19'),_0x3de4e2,_0xc02c('0x13'));_0x3092c4(_0x28a205[_0xc02c('0x1a')][_0xc02c('0x18')]);}})['catch'](function(_0x533b92){logger[_0xc02c('0x16')](_0xc02c('0x19'),_0x3de4e2,_0x533b92);_0x4893d0(_0x533b92);});});}exports['CreateChatMessage']=function(_0x3c1f7e){var _0x58540d=this;return new Promise(function(_0x50f40d,_0x2d96f5){return db[_0xc02c('0x1b')][_0xc02c('0x1c')](_0x3c1f7e[_0xc02c('0x1d')],{'raw':_0x3c1f7e[_0xc02c('0x1e')]?_0x3c1f7e['options'][_0xc02c('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x59e1ba){logger[_0xc02c('0x12')]('CreateChatMessage',_0x3c1f7e);logger[_0xc02c('0x14')]('CreateChatMessage',_0x3c1f7e,JSON[_0xc02c('0x20')](_0x59e1ba));_0x50f40d(_0x59e1ba);})[_0xc02c('0x21')](function(_0x3ed5d0){logger[_0xc02c('0x16')]('CreateChatMessage',_0x3ed5d0[_0xc02c('0x18')],_0x3c1f7e);_0x2d96f5(_0x58540d[_0xc02c('0x16')](0x1f4,_0x3ed5d0[_0xc02c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 69d6db5..9a8f191 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 _0x2675=['register','length','chatMessage:','./chatMessage.events','emit','removeListener'];(function(_0x43aee5,_0x11268b){var _0x76d1d0=function(_0x3faee6){while(--_0x3faee6){_0x43aee5['push'](_0x43aee5['shift']());}};_0x76d1d0(++_0x11268b);}(_0x2675,0x75));var _0x5267=function(_0x205e6a,_0xfa8d0d){_0x205e6a=_0x205e6a-0x0;var _0x330d5c=_0x2675[_0x205e6a];return _0x330d5c;};'use strict';var ChatMessageEvents=require(_0x5267('0x0'));var events=['save','remove','update'];function createListener(_0x1da342,_0x2ae442){return function(_0x57c95a){_0x2ae442[_0x5267('0x1')](_0x1da342,_0x57c95a);};}function removeListener(_0x36bdf0,_0x4e2548){return function(){ChatMessageEvents[_0x5267('0x2')](_0x36bdf0,_0x4e2548);};}exports[_0x5267('0x3')]=function(_0x4bd042){for(var _0x10f92c=0x0,_0x20f065=events[_0x5267('0x4')];_0x10f92c<_0x20f065;_0x10f92c++){var _0x527c16=events[_0x10f92c];var _0x9e0a27=createListener(_0x5267('0x5')+_0x527c16,_0x4bd042);ChatMessageEvents['on'](_0x527c16,_0x9e0a27);}}; \ No newline at end of file +var _0x4137=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update'];(function(_0x348309,_0x309fdd){var _0x39a925=function(_0x8373a2){while(--_0x8373a2){_0x348309['push'](_0x348309['shift']());}};_0x39a925(++_0x309fdd);}(_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 5d4320b..edd796a 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 _0xcd5e=['post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','reject','delete','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x5b3b9b,_0x1c71b0){var _0x47c1d7=function(_0x34c20b){while(--_0x34c20b){_0x5b3b9b['push'](_0x5b3b9b['shift']());}};_0x47c1d7(++_0x1c71b0);}(_0xcd5e,0x114));var _0xecd5=function(_0x2a0813,_0x5028b6){_0x2a0813=_0x2a0813-0x0;var _0x4d69c2=_0xcd5e[_0x2a0813];return _0x4d69c2;};'use strict';var multer=require(_0xecd5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xecd5('0x1'));var express=require(_0xecd5('0x2'));var router=express[_0xecd5('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xecd5('0x4'));var config=require(_0xecd5('0x5'));var controller=require(_0xecd5('0x6'));router[_0xecd5('0x7')]('/',auth[_0xecd5('0x8')](),controller[_0xecd5('0x9')]);router[_0xecd5('0x7')](_0xecd5('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xecd5('0x7')](_0xecd5('0xb'),auth[_0xecd5('0x8')](),controller['show']);router[_0xecd5('0xc')]('/',auth[_0xecd5('0x8')](),interaction[_0xecd5('0xd')](_0xecd5('0xe'),_0xecd5('0xf')),controller[_0xecd5('0x10')]);router[_0xecd5('0x11')](_0xecd5('0xb'),controller[_0xecd5('0x12')]);router[_0xecd5('0x11')](_0xecd5('0x13'),auth[_0xecd5('0x8')](),controller[_0xecd5('0x14')]);router[_0xecd5('0x11')]('/:id/reject',auth[_0xecd5('0x8')](),controller[_0xecd5('0x15')]);router[_0xecd5('0x16')](_0xecd5('0xb'),auth[_0xecd5('0x8')](),controller['destroy']);module[_0xecd5('0x17')]=router; \ No newline at end of file +var _0x0f82=['tracked','chat','create','put','update','/:id/accept','reject','destroy','multer','path','express','Router','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x0f82,0x1c0));var _0x20f8=function(_0x74115b,_0x31f752){_0x74115b=_0x74115b-0x0;var _0x57ebbd=_0x0f82[_0x74115b];return _0x57ebbd;};'use strict';var multer=require(_0x20f8('0x0'));var util=require('util');var path=require(_0x20f8('0x1'));var timeout=require('connect-timeout');var express=require(_0x20f8('0x2'));var router=express[_0x20f8('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x20f8('0x4'));var config=require(_0x20f8('0x5'));var controller=require(_0x20f8('0x6'));router[_0x20f8('0x7')]('/',auth[_0x20f8('0x8')](),controller[_0x20f8('0x9')]);router[_0x20f8('0x7')](_0x20f8('0xa'),auth[_0x20f8('0x8')](),controller['describe']);router[_0x20f8('0x7')](_0x20f8('0xb'),auth[_0x20f8('0x8')](),controller[_0x20f8('0xc')]);router[_0x20f8('0xd')]('/',auth[_0x20f8('0x8')](),interaction[_0x20f8('0xe')](_0x20f8('0xf'),'chatmessage:create'),controller[_0x20f8('0x10')]);router[_0x20f8('0x11')](_0x20f8('0xb'),controller[_0x20f8('0x12')]);router['put'](_0x20f8('0x13'),auth[_0x20f8('0x8')](),controller['accept']);router[_0x20f8('0x11')]('/:id/reject',auth['isAuthenticated'](),controller[_0x20f8('0x14')]);router['delete'](_0x20f8('0xb'),auth['isAuthenticated'](),controller[_0x20f8('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 67071d5..12d0181 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 _0x01dc=['TEXT','medium','sequelize','exports'];(function(_0x213928,_0x450266){var _0x5aec54=function(_0x29c4ed){while(--_0x29c4ed){_0x213928['push'](_0x213928['shift']());}};_0x5aec54(++_0x450266);}(_0x01dc,0x176));var _0xc01d=function(_0x357a01,_0x1e57d0){_0x357a01=_0x357a01-0x0;var _0x252c1f=_0x01dc[_0x357a01];return _0x252c1f;};'use strict';var Sequelize=require(_0xc01d('0x0'));module[_0xc01d('0x1')]={'body':{'type':Sequelize[_0xc01d('0x2')](_0xc01d('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0xe313=['sequelize','exports'];(function(_0x4e4f69,_0x4462ec){var _0x453aed=function(_0x41c81c){while(--_0x41c81c){_0x4e4f69['push'](_0x4e4f69['shift']());}};_0x453aed(++_0x4462ec);}(_0xe313,0x1aa));var _0x3e31=function(_0xb61aec,_0x3b2f87){_0xb61aec=_0xb61aec-0x0;var _0x39c28a=_0xe313[_0xb61aec];return _0x39c28a;};'use strict';var Sequelize=require(_0x3e31('0x0'));module[_0x3e31('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 1eefd2f..f7fa191 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 _0x18f9=['keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','options','includeAll','include','findAll','catch','show','params','find','body','describe','html-pdf','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','ChatOfflineMessage','rawAttributes','fieldName','type','model','query'];(function(_0x328c0d,_0x54f765){var _0x319640=function(_0x19d63f){while(--_0x19d63f){_0x328c0d['push'](_0x328c0d['shift']());}};_0x319640(++_0x54f765);}(_0x18f9,0x9b));var _0x918f=function(_0x45b190,_0x6297da){_0x45b190=_0x45b190-0x0;var _0x46234d=_0x18f9[_0x45b190];return _0x46234d;};'use strict';var pdf=require(_0x918f('0x0'));var emlformat=require(_0x918f('0x1'));var rimraf=require(_0x918f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x918f('0x3'));var BPromise=require(_0x918f('0x4'));var Mustache=require(_0x918f('0x5'));var util=require(_0x918f('0x6'));var path=require(_0x918f('0x7'));var sox=require(_0x918f('0x8'));var csv=require(_0x918f('0x9'));var ejs=require(_0x918f('0xa'));var fs=require('fs');var _=require(_0x918f('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x918f('0xc'));var deskjs=require(_0x918f('0xd'));var toCsv=require(_0x918f('0x9'));var querystring=require(_0x918f('0xe'));var Papa=require(_0x918f('0xf'));var Redis=require('ioredis');var authService=require(_0x918f('0x10'));var qs=require(_0x918f('0x11'));var as=require(_0x918f('0x12'));var hardwareService=require(_0x918f('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x918f('0x14'))['db'];function respondWithStatusCode(_0x30ee49,_0x16cf47){_0x16cf47=_0x16cf47||0xcc;return function(_0x1ab530){if(_0x1ab530){return _0x30ee49[_0x918f('0x15')](_0x16cf47);}return _0x30ee49[_0x918f('0x16')](_0x16cf47)['end']();};}function respondWithResult(_0x1c6f15,_0x28d4ec){_0x28d4ec=_0x28d4ec||0xc8;return function(_0x46da41){if(_0x46da41){return _0x1c6f15['status'](_0x28d4ec)[_0x918f('0x17')](_0x46da41);}};}function respondWithFilteredResult(_0x400a8a,_0x420835){return function(_0x281c0e){if(_0x281c0e){var _0x5514e5=_0x281c0e[_0x918f('0x18')],_0xca058f=_0x420835['offset'],_0x3e0841=_0x420835['offset']+_0x420835[_0x918f('0x19')],_0x13c2eb;if(_0x3e0841>=_0x5514e5){_0x3e0841=_0x5514e5;_0x13c2eb=0xc8;}else{_0x13c2eb=0xce;}_0x400a8a[_0x918f('0x16')](_0x13c2eb);return _0x400a8a[_0x918f('0x1a')](_0x918f('0x1b'),_0xca058f+'-'+_0x3e0841+'/'+_0x5514e5)['json'](_0x281c0e);}return null;};}function patchUpdates(_0x5c793a){return function(_0x6330c4){try{jsonpatch[_0x918f('0x1c')](_0x6330c4,_0x5c793a,!![]);}catch(_0x20eb4e){return BPromise[_0x918f('0x1d')](_0x20eb4e);}return _0x6330c4['save']();};}function saveUpdates(_0x202b3b,_0x2548e1){return function(_0x58f86c){if(_0x58f86c){return _0x58f86c[_0x918f('0x1e')](_0x202b3b)[_0x918f('0x1f')](function(_0x13eccc){return _0x13eccc;});}return null;};}function removeEntity(_0x19b27e,_0x17d2ef){return function(_0x3e00ed){if(_0x3e00ed){return _0x3e00ed[_0x918f('0x20')]()[_0x918f('0x1f')](function(){_0x19b27e['status'](0xcc)[_0x918f('0x21')]();});}};}function handleEntityNotFound(_0x4aa959,_0x17033d){return function(_0x26bfc0){if(!_0x26bfc0){_0x4aa959[_0x918f('0x15')](0x194);}return _0x26bfc0;};}function handleError(_0x4098e5,_0x401191){_0x401191=_0x401191||0x1f4;return function(_0x2fe2f2){logger[_0x918f('0x22')](_0x2fe2f2[_0x918f('0x23')]);if(_0x2fe2f2['name']){delete _0x2fe2f2[_0x918f('0x24')];}_0x4098e5['status'](_0x401191)[_0x918f('0x25')](_0x2fe2f2);};}exports[_0x918f('0x26')]=function(_0x3286e8,_0x399784){var _0x3560a6={},_0x3a4712={},_0x22525f={'count':0x0,'rows':[]};var _0x85875d=_[_0x918f('0x27')](db[_0x918f('0x28')][_0x918f('0x29')],function(_0x3248b9){return{'name':_0x3248b9[_0x918f('0x2a')],'type':_0x3248b9[_0x918f('0x2b')]['key']};});_0x3a4712[_0x918f('0x2c')]=_[_0x918f('0x27')](_0x85875d,_0x918f('0x24'));_0x3a4712[_0x918f('0x2d')]=_[_0x918f('0x2e')](_0x3286e8[_0x918f('0x2d')]);_0x3a4712[_0x918f('0x2f')]=_['intersection'](_0x3a4712[_0x918f('0x2c')],_0x3a4712[_0x918f('0x2d')]);_0x3560a6[_0x918f('0x30')]=_[_0x918f('0x31')](_0x3a4712[_0x918f('0x2c')],qs['fields'](_0x3286e8[_0x918f('0x2d')][_0x918f('0x32')]));_0x3560a6['attributes']=_0x3560a6[_0x918f('0x30')][_0x918f('0x33')]?_0x3560a6[_0x918f('0x30')]:_0x3a4712[_0x918f('0x2c')];if(!_0x3286e8['query'][_0x918f('0x34')](_0x918f('0x35'))){_0x3560a6['limit']=qs['limit'](_0x3286e8[_0x918f('0x2d')]['limit']);_0x3560a6['offset']=qs['offset'](_0x3286e8[_0x918f('0x2d')]['offset']);}_0x3560a6[_0x918f('0x36')]=qs[_0x918f('0x37')](_0x3286e8[_0x918f('0x2d')][_0x918f('0x37')]);_0x3560a6[_0x918f('0x38')]=qs[_0x918f('0x2f')](_['pick'](_0x3286e8[_0x918f('0x2d')],_0x3a4712[_0x918f('0x2f')]));if(_0x3286e8[_0x918f('0x2d')]['filter']){_0x3560a6[_0x918f('0x38')]=_['merge'](_0x3560a6[_0x918f('0x38')],{'$or':_[_0x918f('0x27')](_0x85875d,function(_0x4a98be){if(_0x4a98be['type']!=='VIRTUAL'){var _0x32c5bd={};_0x32c5bd[_0x4a98be['name']]={'$like':'%'+_0x3286e8[_0x918f('0x2d')]['filter']+'%'};return _0x32c5bd;}})});}_0x3560a6=_['merge']({},_0x3560a6,_0x3286e8[_0x918f('0x39')]);var _0x4abb7a={'where':_0x3560a6['where']};return db['ChatOfflineMessage'][_0x918f('0x18')](_0x4abb7a)[_0x918f('0x1f')](function(_0x13856c){_0x22525f[_0x918f('0x18')]=_0x13856c;if(_0x3286e8[_0x918f('0x2d')][_0x918f('0x3a')]){_0x3560a6[_0x918f('0x3b')]=[{'all':!![]}];}return db['ChatOfflineMessage'][_0x918f('0x3c')](_0x3560a6);})[_0x918f('0x1f')](function(_0x333af8){_0x22525f['rows']=_0x333af8;return _0x22525f;})[_0x918f('0x1f')](respondWithFilteredResult(_0x399784,_0x3560a6))[_0x918f('0x3d')](handleError(_0x399784,null));};exports[_0x918f('0x3e')]=function(_0x39c1f6,_0x193d95){var _0x5d5cb7={'raw':!![],'where':{'id':_0x39c1f6[_0x918f('0x3f')]['id']}},_0x454fe8={};_0x454fe8[_0x918f('0x2c')]=_[_0x918f('0x2e')](db[_0x918f('0x28')]['rawAttributes']);_0x454fe8[_0x918f('0x2d')]=_[_0x918f('0x2e')](_0x39c1f6[_0x918f('0x2d')]);_0x454fe8['filters']=_[_0x918f('0x31')](_0x454fe8[_0x918f('0x2c')],_0x454fe8[_0x918f('0x2d')]);_0x5d5cb7['attributes']=_[_0x918f('0x31')](_0x454fe8['model'],qs[_0x918f('0x32')](_0x39c1f6[_0x918f('0x2d')][_0x918f('0x32')]));_0x5d5cb7['attributes']=_0x5d5cb7[_0x918f('0x30')][_0x918f('0x33')]?_0x5d5cb7[_0x918f('0x30')]:_0x454fe8['model'];if(_0x39c1f6[_0x918f('0x2d')]['includeAll']){_0x5d5cb7[_0x918f('0x3b')]=[{'all':!![]}];}_0x5d5cb7=_['merge']({},_0x5d5cb7,_0x39c1f6[_0x918f('0x39')]);return db[_0x918f('0x28')][_0x918f('0x40')](_0x5d5cb7)[_0x918f('0x1f')](handleEntityNotFound(_0x193d95,null))[_0x918f('0x1f')](respondWithResult(_0x193d95,null))['catch'](handleError(_0x193d95,null));};exports['create']=function(_0x41b6ef,_0x55aa43){return db[_0x918f('0x28')]['create'](_0x41b6ef[_0x918f('0x41')],{})[_0x918f('0x1f')](respondWithResult(_0x55aa43,0xc9))['catch'](handleError(_0x55aa43,null));};exports[_0x918f('0x1e')]=function(_0x25f040,_0x3c9d1a){if(_0x25f040['body']['id']){delete _0x25f040[_0x918f('0x41')]['id'];}return db[_0x918f('0x28')][_0x918f('0x40')]({'where':{'id':_0x25f040['params']['id']}})[_0x918f('0x1f')](handleEntityNotFound(_0x3c9d1a,null))[_0x918f('0x1f')](saveUpdates(_0x25f040[_0x918f('0x41')],null))[_0x918f('0x1f')](respondWithResult(_0x3c9d1a,null))['catch'](handleError(_0x3c9d1a,null));};exports[_0x918f('0x20')]=function(_0x167ab6,_0x4bd541){return db[_0x918f('0x28')][_0x918f('0x40')]({'where':{'id':_0x167ab6[_0x918f('0x3f')]['id']}})[_0x918f('0x1f')](handleEntityNotFound(_0x4bd541,null))[_0x918f('0x1f')](removeEntity(_0x4bd541,null))[_0x918f('0x3d')](handleError(_0x4bd541,null));};exports[_0x918f('0x42')]=function(_0x11f430,_0x56d3d6){return db[_0x918f('0x28')]['describe']()[_0x918f('0x1f')](respondWithResult(_0x56d3d6,null))[_0x918f('0x3d')](handleError(_0x56d3d6,null));}; \ No newline at end of file +var _0x496b=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','show','params','includeAll','find','catch','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','error','stack','name','send','index','map','ChatOfflineMessage','rawAttributes','fieldName','type','key'];(function(_0x559d42,_0x1e6890){var _0x3d907e=function(_0x337447){while(--_0x337447){_0x559d42['push'](_0x559d42['shift']());}};_0x3d907e(++_0x1e6890);}(_0x496b,0x137));var _0xb496=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x496b[_0x5f1391];return _0x50ebe3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb496('0x0'));var rimraf=require(_0xb496('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb496('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb496('0x3'));var Mustache=require(_0xb496('0x4'));var util=require(_0xb496('0x5'));var path=require(_0xb496('0x6'));var sox=require('sox');var csv=require(_0xb496('0x7'));var ejs=require(_0xb496('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb496('0x9'));var crypto=require(_0xb496('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xb496('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb496('0xc'));var Redis=require(_0xb496('0xd'));var authService=require(_0xb496('0xe'));var qs=require(_0xb496('0xf'));var as=require(_0xb496('0x10'));var hardwareService=require(_0xb496('0x11'));var logger=require(_0xb496('0x12'))('api');var utils=require(_0xb496('0x13'));var config=require(_0xb496('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c7dc8,_0x41010b){_0x41010b=_0x41010b||0xcc;return function(_0x5dcff5){if(_0x5dcff5){return _0x2c7dc8[_0xb496('0x15')](_0x41010b);}return _0x2c7dc8[_0xb496('0x16')](_0x41010b)[_0xb496('0x17')]();};}function respondWithResult(_0x17ef0d,_0x18c9f8){_0x18c9f8=_0x18c9f8||0xc8;return function(_0xfa7064){if(_0xfa7064){return _0x17ef0d[_0xb496('0x16')](_0x18c9f8)[_0xb496('0x18')](_0xfa7064);}};}function respondWithFilteredResult(_0x3ebee6,_0xbdf2e2){return function(_0x4682ae){if(_0x4682ae){var _0x534bca=_0x4682ae[_0xb496('0x19')],_0x45ec70=_0xbdf2e2[_0xb496('0x1a')],_0x2254c6=_0xbdf2e2['offset']+_0xbdf2e2[_0xb496('0x1b')],_0x3d3805;if(_0x2254c6>=_0x534bca){_0x2254c6=_0x534bca;_0x3d3805=0xc8;}else{_0x3d3805=0xce;}_0x3ebee6[_0xb496('0x16')](_0x3d3805);return _0x3ebee6[_0xb496('0x1c')](_0xb496('0x1d'),_0x45ec70+'-'+_0x2254c6+'/'+_0x534bca)['json'](_0x4682ae);}return null;};}function patchUpdates(_0x107c1f){return function(_0x3a05a4){try{jsonpatch['apply'](_0x3a05a4,_0x107c1f,!![]);}catch(_0x10c8bd){return BPromise['reject'](_0x10c8bd);}return _0x3a05a4[_0xb496('0x1e')]();};}function saveUpdates(_0x261842,_0x12bb35){return function(_0x29fdcb){if(_0x29fdcb){return _0x29fdcb[_0xb496('0x1f')](_0x261842)[_0xb496('0x20')](function(_0x48b2dc){return _0x48b2dc;});}return null;};}function removeEntity(_0xfda9c2,_0x357d79){return function(_0x3ba66a){if(_0x3ba66a){return _0x3ba66a['destroy']()[_0xb496('0x20')](function(){_0xfda9c2[_0xb496('0x16')](0xcc)[_0xb496('0x17')]();});}};}function handleEntityNotFound(_0x526f6e,_0x183b69){return function(_0x4463a3){if(!_0x4463a3){_0x526f6e[_0xb496('0x15')](0x194);}return _0x4463a3;};}function handleError(_0x3cec88,_0x1fd204){_0x1fd204=_0x1fd204||0x1f4;return function(_0x4535ca){logger[_0xb496('0x21')](_0x4535ca[_0xb496('0x22')]);if(_0x4535ca[_0xb496('0x23')]){delete _0x4535ca[_0xb496('0x23')];}_0x3cec88[_0xb496('0x16')](_0x1fd204)[_0xb496('0x24')](_0x4535ca);};}exports[_0xb496('0x25')]=function(_0x46e1fa,_0x2f69da){var _0x327748={},_0x31ec9f={},_0x585395={'count':0x0,'rows':[]};var _0x366ce0=_[_0xb496('0x26')](db[_0xb496('0x27')][_0xb496('0x28')],function(_0x1995c4){return{'name':_0x1995c4[_0xb496('0x29')],'type':_0x1995c4[_0xb496('0x2a')][_0xb496('0x2b')]};});_0x31ec9f[_0xb496('0x2c')]=_[_0xb496('0x26')](_0x366ce0,'name');_0x31ec9f[_0xb496('0x2d')]=_[_0xb496('0x2e')](_0x46e1fa['query']);_0x31ec9f[_0xb496('0x2f')]=_[_0xb496('0x30')](_0x31ec9f['model'],_0x31ec9f[_0xb496('0x2d')]);_0x327748[_0xb496('0x31')]=_[_0xb496('0x30')](_0x31ec9f['model'],qs[_0xb496('0x32')](_0x46e1fa[_0xb496('0x2d')][_0xb496('0x32')]));_0x327748[_0xb496('0x31')]=_0x327748[_0xb496('0x31')][_0xb496('0x33')]?_0x327748['attributes']:_0x31ec9f[_0xb496('0x2c')];if(!_0x46e1fa[_0xb496('0x2d')][_0xb496('0x34')](_0xb496('0x35'))){_0x327748[_0xb496('0x1b')]=qs[_0xb496('0x1b')](_0x46e1fa['query'][_0xb496('0x1b')]);_0x327748[_0xb496('0x1a')]=qs[_0xb496('0x1a')](_0x46e1fa[_0xb496('0x2d')][_0xb496('0x1a')]);}_0x327748['order']=qs[_0xb496('0x36')](_0x46e1fa['query'][_0xb496('0x36')]);_0x327748[_0xb496('0x37')]=qs[_0xb496('0x2f')](_[_0xb496('0x38')](_0x46e1fa[_0xb496('0x2d')],_0x31ec9f[_0xb496('0x2f')]));if(_0x46e1fa[_0xb496('0x2d')][_0xb496('0x39')]){_0x327748[_0xb496('0x37')]=_['merge'](_0x327748[_0xb496('0x37')],{'$or':_[_0xb496('0x26')](_0x366ce0,function(_0x38da5d){if(_0x38da5d[_0xb496('0x2a')]!=='VIRTUAL'){var _0x1ed55b={};_0x1ed55b[_0x38da5d[_0xb496('0x23')]]={'$like':'%'+_0x46e1fa[_0xb496('0x2d')][_0xb496('0x39')]+'%'};return _0x1ed55b;}})});}_0x327748=_[_0xb496('0x3a')]({},_0x327748,_0x46e1fa[_0xb496('0x3b')]);var _0x51de9e={'where':_0x327748[_0xb496('0x37')]};return db[_0xb496('0x27')]['count'](_0x51de9e)[_0xb496('0x20')](function(_0x9cca57){_0x585395[_0xb496('0x19')]=_0x9cca57;if(_0x46e1fa[_0xb496('0x2d')]['includeAll']){_0x327748[_0xb496('0x3c')]=[{'all':!![]}];}return db[_0xb496('0x27')][_0xb496('0x3d')](_0x327748);})['then'](function(_0x3db389){_0x585395['rows']=_0x3db389;return _0x585395;})[_0xb496('0x20')](respondWithFilteredResult(_0x2f69da,_0x327748))['catch'](handleError(_0x2f69da,null));};exports[_0xb496('0x3e')]=function(_0x5895b8,_0x499e97){var _0x4520fb={'raw':!![],'where':{'id':_0x5895b8[_0xb496('0x3f')]['id']}},_0x5687aa={};_0x5687aa[_0xb496('0x2c')]=_[_0xb496('0x2e')](db[_0xb496('0x27')]['rawAttributes']);_0x5687aa[_0xb496('0x2d')]=_['keys'](_0x5895b8[_0xb496('0x2d')]);_0x5687aa[_0xb496('0x2f')]=_[_0xb496('0x30')](_0x5687aa['model'],_0x5687aa[_0xb496('0x2d')]);_0x4520fb[_0xb496('0x31')]=_[_0xb496('0x30')](_0x5687aa[_0xb496('0x2c')],qs[_0xb496('0x32')](_0x5895b8[_0xb496('0x2d')][_0xb496('0x32')]));_0x4520fb[_0xb496('0x31')]=_0x4520fb[_0xb496('0x31')][_0xb496('0x33')]?_0x4520fb[_0xb496('0x31')]:_0x5687aa[_0xb496('0x2c')];if(_0x5895b8[_0xb496('0x2d')][_0xb496('0x40')]){_0x4520fb[_0xb496('0x3c')]=[{'all':!![]}];}_0x4520fb=_[_0xb496('0x3a')]({},_0x4520fb,_0x5895b8[_0xb496('0x3b')]);return db[_0xb496('0x27')][_0xb496('0x41')](_0x4520fb)[_0xb496('0x20')](handleEntityNotFound(_0x499e97,null))[_0xb496('0x20')](respondWithResult(_0x499e97,null))[_0xb496('0x42')](handleError(_0x499e97,null));};exports[_0xb496('0x43')]=function(_0x586494,_0x247163){return db['ChatOfflineMessage'][_0xb496('0x43')](_0x586494[_0xb496('0x44')],{})[_0xb496('0x20')](respondWithResult(_0x247163,0xc9))['catch'](handleError(_0x247163,null));};exports['update']=function(_0x4322cb,_0x1cd034){if(_0x4322cb[_0xb496('0x44')]['id']){delete _0x4322cb[_0xb496('0x44')]['id'];}return db[_0xb496('0x27')]['find']({'where':{'id':_0x4322cb['params']['id']}})['then'](handleEntityNotFound(_0x1cd034,null))[_0xb496('0x20')](saveUpdates(_0x4322cb[_0xb496('0x44')],null))['then'](respondWithResult(_0x1cd034,null))[_0xb496('0x42')](handleError(_0x1cd034,null));};exports[_0xb496('0x45')]=function(_0x3535f4,_0x4d3829){return db['ChatOfflineMessage'][_0xb496('0x41')]({'where':{'id':_0x3535f4[_0xb496('0x3f')]['id']}})[_0xb496('0x20')](handleEntityNotFound(_0x4d3829,null))[_0xb496('0x20')](removeEntity(_0x4d3829,null))['catch'](handleError(_0x4d3829,null));};exports[_0xb496('0x46')]=function(_0x15cfc9,_0x173c2b){return db[_0xb496('0x27')][_0xb496('0x46')]()[_0xb496('0x20')](respondWithResult(_0x173c2b,null))[_0xb496('0x42')](handleError(_0x173c2b,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 57a1663..8083c76 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 _0xfd28=['moment','request-promise','path','rimraf','./chatOfflineMessage.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x42ae96,_0x48c45b){var _0x5ada45=function(_0x1ccad8){while(--_0x1ccad8){_0x42ae96['push'](_0x42ae96['shift']());}};_0x5ada45(++_0x48c45b);}(_0xfd28,0x148));var _0x8fd2=function(_0x474d97,_0x5909ce){_0x474d97=_0x474d97-0x0;var _0x1edf25=_0xfd28[_0x474d97];return _0x1edf25;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var logger=require(_0x8fd2('0x1'))('api');var moment=require(_0x8fd2('0x2'));var BPromise=require('bluebird');var rp=require(_0x8fd2('0x3'));var fs=require('fs');var path=require(_0x8fd2('0x4'));var rimraf=require(_0x8fd2('0x5'));var config=require('../../config/environment');var attributes=require(_0x8fd2('0x6'));module[_0x8fd2('0x7')]=function(_0x2ee87e,_0x36178a){return _0x2ee87e[_0x8fd2('0x8')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8fd2('0x9'),'collate':_0x8fd2('0xa')});}; \ No newline at end of file +var _0x207c=['bluebird','request-promise','path','../../config/environment','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0xedd5a2,_0x331e9a){var _0x260bbb=function(_0x1cd14e){while(--_0x1cd14e){_0xedd5a2['push'](_0xedd5a2['shift']());}};_0x260bbb(++_0x331e9a);}(_0x207c,0x1e8));var _0xc207=function(_0x32e264,_0x41cee8){_0x32e264=_0x32e264-0x0;var _0x1d7175=_0x207c[_0x32e264];return _0x1d7175;};'use strict';var _=require('lodash');var util=require(_0xc207('0x0'));var logger=require(_0xc207('0x1'))(_0xc207('0x2'));var moment=require(_0xc207('0x3'));var BPromise=require(_0xc207('0x4'));var rp=require(_0xc207('0x5'));var fs=require('fs');var path=require(_0xc207('0x6'));var rimraf=require('rimraf');var config=require(_0xc207('0x7'));var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x55023e,_0xc88789){return _0x55023e[_0xc207('0x8')](_0xc207('0x9'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc207('0xa'),'collate':_0xc207('0xb')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index a43ea73..ab4e589 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 _0x6a9e=['request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x6a9e,0xb4));var _0xe6a9=function(_0x5bd239,_0x50dfd9){_0x5bd239=_0x5bd239-0x0;var _0x1e9bab=_0x6a9e[_0x5bd239];return _0x1e9bab;};'use strict';var _=require(_0xe6a9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe6a9('0x1'));var rs=require(_0xe6a9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe6a9('0x3'))['db'];var utils=require(_0xe6a9('0x4'));var logger=require(_0xe6a9('0x5'))('rpc');var config=require(_0xe6a9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe6a9('0x7')][_0xe6a9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2fd1cf,_0x2de50b,_0x53ad1b){return new BPromise(function(_0x394b2d,_0x1c4b49){return client[_0xe6a9('0x9')](_0x2fd1cf,_0x53ad1b)[_0xe6a9('0xa')](function(_0x5a88b8){logger[_0xe6a9('0xb')](_0xe6a9('0xc'),_0x2de50b,_0xe6a9('0xd'));logger[_0xe6a9('0xe')](_0xe6a9('0xf'),_0x2de50b,_0xe6a9('0xd'),JSON[_0xe6a9('0x10')](_0x5a88b8));if(_0x5a88b8[_0xe6a9('0x11')]){if(_0x5a88b8[_0xe6a9('0x11')][_0xe6a9('0x12')]===0x1f4){logger[_0xe6a9('0x11')](_0xe6a9('0xc'),_0x2de50b,_0x5a88b8[_0xe6a9('0x11')][_0xe6a9('0x13')]);return _0x1c4b49(_0x5a88b8[_0xe6a9('0x11')]['message']);}logger[_0xe6a9('0x11')](_0xe6a9('0xc'),_0x2de50b,_0x5a88b8[_0xe6a9('0x11')]['message']);return _0x394b2d(_0x5a88b8['error'][_0xe6a9('0x13')]);}else{logger[_0xe6a9('0xb')](_0xe6a9('0xc'),_0x2de50b,_0xe6a9('0xd'));_0x394b2d(_0x5a88b8['result'][_0xe6a9('0x13')]);}})[_0xe6a9('0x14')](function(_0x44779c){logger[_0xe6a9('0x11')](_0xe6a9('0xc'),_0x2de50b,_0x44779c);_0x1c4b49(_0x44779c);});});} \ No newline at end of file +var _0x066b=['info','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','ChatOfflineMessage,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x544d22,_0x35c188){var _0x4690c3=function(_0x1e4781){while(--_0x1e4781){_0x544d22['push'](_0x544d22['shift']());}};_0x4690c3(++_0x35c188);}(_0x066b,0x12a));var _0xb066=function(_0x497809,_0x451ba0){_0x497809=_0x497809-0x0;var _0x865565=_0x066b[_0x497809];return _0x865565;};'use strict';var _=require(_0xb066('0x0'));var util=require(_0xb066('0x1'));var moment=require(_0xb066('0x2'));var BPromise=require(_0xb066('0x3'));var rs=require(_0xb066('0x4'));var fs=require('fs');var Redis=require(_0xb066('0x5'));var db=require(_0xb066('0x6'))['db'];var utils=require(_0xb066('0x7'));var logger=require(_0xb066('0x8'))(_0xb066('0x9'));var config=require(_0xb066('0xa'));var jayson=require(_0xb066('0xb'));var client=jayson[_0xb066('0xc')][_0xb066('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xe2589a,_0x119cde,_0x45ca24){return new BPromise(function(_0x53a9e7,_0x487fc5){return client['request'](_0xe2589a,_0x45ca24)['then'](function(_0x548780){logger[_0xb066('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x119cde,'request\x20sent');logger[_0xb066('0xf')](_0xb066('0x10'),_0x119cde,_0xb066('0x11'),JSON[_0xb066('0x12')](_0x548780));if(_0x548780[_0xb066('0x13')]){if(_0x548780[_0xb066('0x13')]['code']===0x1f4){logger[_0xb066('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x119cde,_0x548780[_0xb066('0x13')][_0xb066('0x14')]);return _0x487fc5(_0x548780['error']['message']);}logger[_0xb066('0x13')](_0xb066('0x15'),_0x119cde,_0x548780[_0xb066('0x13')][_0xb066('0x14')]);return _0x53a9e7(_0x548780[_0xb066('0x13')][_0xb066('0x14')]);}else{logger['info'](_0xb066('0x15'),_0x119cde,_0xb066('0x11'));_0x53a9e7(_0x548780[_0xb066('0x16')][_0xb066('0x14')]);}})[_0xb066('0x17')](function(_0x1d2fd8){logger[_0xb066('0x13')](_0xb066('0x15'),_0x119cde,_0x1d2fd8);_0x487fc5(_0x1d2fd8);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index c009479..8739023 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 _0x1282=['post','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x34779a,_0x2d912){var _0x4ce21c=function(_0x3ff6ce){while(--_0x3ff6ce){_0x34779a['push'](_0x34779a['shift']());}};_0x4ce21c(++_0x2d912);}(_0x1282,0xad));var _0x2128=function(_0x47efba,_0x3ccb7c){_0x47efba=_0x47efba-0x0;var _0xf883a6=_0x1282[_0x47efba];return _0xf883a6;};'use strict';var multer=require(_0x2128('0x0'));var util=require(_0x2128('0x1'));var path=require(_0x2128('0x2'));var timeout=require(_0x2128('0x3'));var express=require(_0x2128('0x4'));var router=express[_0x2128('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x2128('0x6'));var config=require(_0x2128('0x7'));var controller=require(_0x2128('0x8'));router[_0x2128('0x9')]('/',auth[_0x2128('0xa')](),controller[_0x2128('0xb')]);router[_0x2128('0x9')](_0x2128('0xc'),auth[_0x2128('0xa')](),controller[_0x2128('0xd')]);router['get'](_0x2128('0xe'),auth[_0x2128('0xa')](),controller[_0x2128('0xf')]);router[_0x2128('0x10')]('/',auth[_0x2128('0xa')](),controller['create']);router[_0x2128('0x11')](_0x2128('0xe'),auth[_0x2128('0xa')](),controller[_0x2128('0x12')]);router[_0x2128('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x2128('0x14')]=router; \ No newline at end of file +var _0xbd09=['post','create','put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/describe','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbd09,0xc5));var _0x9bd0=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbd09[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x9bd0('0x0'));var util=require(_0x9bd0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9bd0('0x2')]();var auth=require(_0x9bd0('0x3'));var interaction=require(_0x9bd0('0x4'));var config=require(_0x9bd0('0x5'));var controller=require(_0x9bd0('0x6'));router[_0x9bd0('0x7')]('/',auth[_0x9bd0('0x8')](),controller['index']);router[_0x9bd0('0x7')](_0x9bd0('0x9'),auth[_0x9bd0('0x8')](),controller['describe']);router[_0x9bd0('0x7')](_0x9bd0('0xa'),auth[_0x9bd0('0x8')](),controller[_0x9bd0('0xb')]);router[_0x9bd0('0xc')]('/',auth[_0x9bd0('0x8')](),controller[_0x9bd0('0xd')]);router[_0x9bd0('0xe')](_0x9bd0('0xa'),auth['isAuthenticated'](),controller[_0x9bd0('0xf')]);router[_0x9bd0('0x10')]('/:id',auth[_0x9bd0('0x8')](),controller[_0x9bd0('0x11')]);module[_0x9bd0('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 4031ce6..6a84784 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 _0xd581=['INTEGER','sequelize','exports','STRING','mouseOver','timeout'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xd581,0xeb));var _0x1d58=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0xd581[_0x22b68a];return _0x1ac67a;};'use strict';var Sequelize=require(_0x1d58('0x0'));module[_0x1d58('0x1')]={'name':{'type':Sequelize[_0x1d58('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x1d58('0x3'),_0x1d58('0x4')),'defaultValue':_0x1d58('0x3')},'selector':{'type':Sequelize[_0x1d58('0x2')]},'timeout':{'type':Sequelize[_0x1d58('0x5')]}}; \ No newline at end of file +var _0x9642=['timeout','mouseOver','INTEGER','exports','STRING','ENUM'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x9642,0x135));var _0x2964=function(_0x220863,_0x5479f7){_0x220863=_0x220863-0x0;var _0x653962=_0x9642[_0x220863];return _0x653962;};'use strict';var Sequelize=require('sequelize');module[_0x2964('0x0')]={'name':{'type':Sequelize[_0x2964('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x2964('0x2')]('mouseOver',_0x2964('0x3')),'defaultValue':_0x2964('0x4')},'selector':{'type':Sequelize[_0x2964('0x1')]},'timeout':{'type':Sequelize[_0x2964('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 08ac436..54483aa 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(_0x41b648,_0x4b0578){var _0x24abc7=function(_0x200941){while(--_0x200941){_0x41b648['push'](_0x41b648['shift']());}};_0x24abc7(++_0x4b0578);}(_0x70e0,0x17b));var _0x070e=function(_0x5c4d74,_0x1c4c05){_0x5c4d74=_0x5c4d74-0x0;var _0xd2ccf7=_0x70e0[_0x5c4d74];return _0xd2ccf7;};'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 _0xcb91=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','length','includeAll','merge','options','find','catch','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','to-csv','ioredis','../../components/auth/service'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xf79bae,_0x263b2a){_0xf79bae=_0xf79bae-0x0;var _0x5d2cb7=_0xcb91[_0xf79bae];return _0x5d2cb7;};'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'];function respondWithStatusCode(_0x46af58,_0x5445e1){_0x5445e1=_0x5445e1||0xcc;return function(_0x5e3c19){if(_0x5e3c19){return _0x46af58['sendStatus'](_0x5445e1);}return _0x46af58[_0x1cb9('0x16')](_0x5445e1)[_0x1cb9('0x17')]();};}function respondWithResult(_0x384496,_0x1c714f){_0x1c714f=_0x1c714f||0xc8;return function(_0x56884d){if(_0x56884d){return _0x384496[_0x1cb9('0x16')](_0x1c714f)[_0x1cb9('0x18')](_0x56884d);}};}function respondWithFilteredResult(_0x1b3cd7,_0x8dfa55){return function(_0x3e2d11){if(_0x3e2d11){var _0x5806d8=_0x3e2d11[_0x1cb9('0x19')],_0x5572cb=_0x8dfa55[_0x1cb9('0x1a')],_0xd446a3=_0x8dfa55[_0x1cb9('0x1a')]+_0x8dfa55[_0x1cb9('0x1b')],_0x3cc765;if(_0xd446a3>=_0x5806d8){_0xd446a3=_0x5806d8;_0x3cc765=0xc8;}else{_0x3cc765=0xce;}_0x1b3cd7[_0x1cb9('0x16')](_0x3cc765);return _0x1b3cd7['set']('Content-Range',_0x5572cb+'-'+_0xd446a3+'/'+_0x5806d8)[_0x1cb9('0x18')](_0x3e2d11);}return null;};}function patchUpdates(_0x41ac41){return function(_0x2b2669){try{jsonpatch[_0x1cb9('0x1c')](_0x2b2669,_0x41ac41,!![]);}catch(_0x280a84){return BPromise[_0x1cb9('0x1d')](_0x280a84);}return _0x2b2669[_0x1cb9('0x1e')]();};}function saveUpdates(_0x4ac422,_0x559bcc){return function(_0x1a5a72){if(_0x1a5a72){return _0x1a5a72['update'](_0x4ac422)[_0x1cb9('0x1f')](function(_0x2265ea){return _0x2265ea;});}return null;};}function removeEntity(_0x523b26,_0x599275){return function(_0x2e3854){if(_0x2e3854){return _0x2e3854[_0x1cb9('0x20')]()[_0x1cb9('0x1f')](function(){_0x523b26[_0x1cb9('0x16')](0xcc)[_0x1cb9('0x17')]();});}};}function handleEntityNotFound(_0x27db16,_0x59ebea){return function(_0x55b232){if(!_0x55b232){_0x27db16[_0x1cb9('0x21')](0x194);}return _0x55b232;};}function handleError(_0x557199,_0x10a419){_0x10a419=_0x10a419||0x1f4;return function(_0x2b1275){logger[_0x1cb9('0x22')](_0x2b1275[_0x1cb9('0x23')]);if(_0x2b1275[_0x1cb9('0x24')]){delete _0x2b1275['name'];}_0x557199[_0x1cb9('0x16')](_0x10a419)[_0x1cb9('0x25')](_0x2b1275);};}exports['show']=function(_0xd6891c,_0x21effa){var _0x41a9a0={'raw':!![],'where':{'id':_0xd6891c[_0x1cb9('0x26')]['id']}},_0x1804fd={};_0x1804fd[_0x1cb9('0x27')]=_[_0x1cb9('0x28')](db[_0x1cb9('0x29')][_0x1cb9('0x2a')]);_0x1804fd[_0x1cb9('0x2b')]=_['keys'](_0xd6891c[_0x1cb9('0x2b')]);_0x1804fd['filters']=_[_0x1cb9('0x2c')](_0x1804fd['model'],_0x1804fd[_0x1cb9('0x2b')]);_0x41a9a0[_0x1cb9('0x2d')]=_[_0x1cb9('0x2c')](_0x1804fd[_0x1cb9('0x27')],qs['fields'](_0xd6891c[_0x1cb9('0x2b')]['fields']));_0x41a9a0[_0x1cb9('0x2d')]=_0x41a9a0[_0x1cb9('0x2d')][_0x1cb9('0x2e')]?_0x41a9a0['attributes']:_0x1804fd[_0x1cb9('0x27')];if(_0xd6891c['query'][_0x1cb9('0x2f')]){_0x41a9a0['include']=[{'all':!![]}];}_0x41a9a0=_[_0x1cb9('0x30')]({},_0x41a9a0,_0xd6891c[_0x1cb9('0x31')]);return db[_0x1cb9('0x29')][_0x1cb9('0x32')](_0x41a9a0)['then'](handleEntityNotFound(_0x21effa,null))[_0x1cb9('0x1f')](respondWithResult(_0x21effa,null))[_0x1cb9('0x33')](handleError(_0x21effa,null));};exports[_0x1cb9('0x34')]=function(_0x91a1db,_0xc6784c){return db[_0x1cb9('0x29')][_0x1cb9('0x34')](_0x91a1db[_0x1cb9('0x35')],{})[_0x1cb9('0x1f')](respondWithResult(_0xc6784c,0xc9))[_0x1cb9('0x33')](handleError(_0xc6784c,null));};exports[_0x1cb9('0x36')]=function(_0x26b950,_0x29f149){if(_0x26b950['body']['id']){delete _0x26b950['body']['id'];}return db[_0x1cb9('0x29')][_0x1cb9('0x32')]({'where':{'id':_0x26b950[_0x1cb9('0x26')]['id']}})[_0x1cb9('0x1f')](handleEntityNotFound(_0x29f149,null))[_0x1cb9('0x1f')](saveUpdates(_0x26b950[_0x1cb9('0x35')],null))[_0x1cb9('0x1f')](respondWithResult(_0x29f149,null))[_0x1cb9('0x33')](handleError(_0x29f149,null));};exports['destroy']=function(_0x2aa59b,_0x1482c4){return db[_0x1cb9('0x29')]['find']({'where':{'id':_0x2aa59b[_0x1cb9('0x26')]['id']}})['then'](handleEntityNotFound(_0x1482c4,null))[_0x1cb9('0x1f')](removeEntity(_0x1482c4,null))['catch'](handleError(_0x1482c4,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index e468d28..00223c5 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 _0x4e5b=['chat_proactive_actions','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction'];(function(_0x2b8ecb,_0x42ec28){var _0x2090ff=function(_0x41e17d){while(--_0x41e17d){_0x2b8ecb['push'](_0x2b8ecb['shift']());}};_0x2090ff(++_0x42ec28);}(_0x4e5b,0x1a3));var _0xb4e5=function(_0x32c655,_0x292267){_0x32c655=_0x32c655-0x0;var _0x24a94b=_0x4e5b[_0x32c655];return _0x24a94b;};'use strict';var _=require('lodash');var util=require(_0xb4e5('0x0'));var logger=require(_0xb4e5('0x1'))(_0xb4e5('0x2'));var moment=require(_0xb4e5('0x3'));var BPromise=require('bluebird');var rp=require(_0xb4e5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb4e5('0x5'));var config=require(_0xb4e5('0x6'));var attributes=require(_0xb4e5('0x7'));module[_0xb4e5('0x8')]=function(_0x39f130,_0x3e3c1e){return _0x39f130['define'](_0xb4e5('0x9'),attributes,{'tableName':_0xb4e5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeaf6=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x2c006e,_0x15f8b1){var _0x15fd4e=function(_0x28f926){while(--_0x28f926){_0x2c006e['push'](_0x2c006e['shift']());}};_0x15fd4e(++_0x15f8b1);}(_0xeaf6,0xf0));var _0x6eaf=function(_0x2325c3,_0x85e138){_0x2325c3=_0x2325c3-0x0;var _0x363b8c=_0xeaf6[_0x2325c3];return _0x363b8c;};'use strict';var _=require('lodash');var util=require(_0x6eaf('0x0'));var logger=require(_0x6eaf('0x1'))(_0x6eaf('0x2'));var moment=require(_0x6eaf('0x3'));var BPromise=require(_0x6eaf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6eaf('0x5'));var rimraf=require('rimraf');var config=require(_0x6eaf('0x6'));var attributes=require(_0x6eaf('0x7'));module[_0x6eaf('0x8')]=function(_0x4113e1,_0x5ce9ea){return _0x4113e1[_0x6eaf('0x9')](_0x6eaf('0xa'),attributes,{'tableName':_0x6eaf('0xb'),'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 8775358..765b55b 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 _0x2704=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x137e04,_0x3c0799){var _0x4c6762=function(_0x45f489){while(--_0x45f489){_0x137e04['push'](_0x137e04['shift']());}};_0x4c6762(++_0x3c0799);}(_0x2704,0x198));var _0x4270=function(_0x28d1ea,_0x426311){_0x28d1ea=_0x28d1ea-0x0;var _0x1667b6=_0x2704[_0x28d1ea];return _0x1667b6;};'use strict';var _=require(_0x4270('0x0'));var util=require('util');var moment=require(_0x4270('0x1'));var BPromise=require(_0x4270('0x2'));var rs=require(_0x4270('0x3'));var fs=require('fs');var Redis=require(_0x4270('0x4'));var db=require(_0x4270('0x5'))['db'];var utils=require(_0x4270('0x6'));var logger=require(_0x4270('0x7'))(_0x4270('0x8'));var config=require(_0x4270('0x9'));var jayson=require(_0x4270('0xa'));var client=jayson[_0x4270('0xb')][_0x4270('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x459c76,_0x359efa,_0x47587f){return new BPromise(function(_0x3305ed,_0x494c54){return client[_0x4270('0xd')](_0x459c76,_0x47587f)[_0x4270('0xe')](function(_0x5078b6){logger[_0x4270('0xf')](_0x4270('0x10'),_0x359efa,'request\x20sent');logger[_0x4270('0x11')](_0x4270('0x12'),_0x359efa,_0x4270('0x13'),JSON[_0x4270('0x14')](_0x5078b6));if(_0x5078b6[_0x4270('0x15')]){if(_0x5078b6[_0x4270('0x15')][_0x4270('0x16')]===0x1f4){logger['error'](_0x4270('0x10'),_0x359efa,_0x5078b6[_0x4270('0x15')]['message']);return _0x494c54(_0x5078b6[_0x4270('0x15')][_0x4270('0x17')]);}logger[_0x4270('0x15')](_0x4270('0x10'),_0x359efa,_0x5078b6[_0x4270('0x15')][_0x4270('0x17')]);return _0x3305ed(_0x5078b6['error'][_0x4270('0x17')]);}else{logger[_0x4270('0xf')](_0x4270('0x10'),_0x359efa,'request\x20sent');_0x3305ed(_0x5078b6[_0x4270('0x18')][_0x4270('0x17')]);}})[_0x4270('0x19')](function(_0x5ede76){logger[_0x4270('0x15')](_0x4270('0x10'),_0x359efa,_0x5ede76);_0x494c54(_0x5ede76);});});} \ No newline at end of file +var _0x5d97=['request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','info','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x2b0d88,_0x5b5ef2){var _0x1c9256=function(_0x1ea041){while(--_0x1ea041){_0x2b0d88['push'](_0x2b0d88['shift']());}};_0x1c9256(++_0x5b5ef2);}(_0x5d97,0x9b));var _0x75d9=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5d97[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x75d9('0x0'));var util=require(_0x75d9('0x1'));var moment=require(_0x75d9('0x2'));var BPromise=require(_0x75d9('0x3'));var rs=require(_0x75d9('0x4'));var fs=require('fs');var Redis=require(_0x75d9('0x5'));var db=require(_0x75d9('0x6'))['db'];var utils=require(_0x75d9('0x7'));var logger=require('../../config/logger')(_0x75d9('0x8'));var config=require(_0x75d9('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x75d9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2975f0,_0x52d547,_0x159258){return new BPromise(function(_0x302c51,_0x102082){return client['request'](_0x2975f0,_0x159258)['then'](function(_0x1d3131){logger[_0x75d9('0xb')](_0x75d9('0xc'),_0x52d547,_0x75d9('0xd'));logger[_0x75d9('0xe')](_0x75d9('0xf'),_0x52d547,'request\x20sent',JSON[_0x75d9('0x10')](_0x1d3131));if(_0x1d3131[_0x75d9('0x11')]){if(_0x1d3131[_0x75d9('0x11')][_0x75d9('0x12')]===0x1f4){logger[_0x75d9('0x11')](_0x75d9('0xc'),_0x52d547,_0x1d3131['error']['message']);return _0x102082(_0x1d3131['error'][_0x75d9('0x13')]);}logger['error'](_0x75d9('0xc'),_0x52d547,_0x1d3131[_0x75d9('0x11')][_0x75d9('0x13')]);return _0x302c51(_0x1d3131[_0x75d9('0x11')][_0x75d9('0x13')]);}else{logger['info'](_0x75d9('0xc'),_0x52d547,_0x75d9('0xd'));_0x302c51(_0x1d3131[_0x75d9('0x14')][_0x75d9('0x13')]);}})['catch'](function(_0x8f486f){logger[_0x75d9('0x11')](_0x75d9('0xc'),_0x52d547,_0x8f486f);_0x102082(_0x8f486f);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index f2d8528..4d01dc2 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 _0xaffe=['post','put','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x1ecf1c,_0x339929){var _0x2ca1b2=function(_0x5c7834){while(--_0x5c7834){_0x1ecf1c['push'](_0x1ecf1c['shift']());}};_0x2ca1b2(++_0x339929);}(_0xaffe,0x158));var _0xeaff=function(_0x187e6c,_0x4802f9){_0x187e6c=_0x187e6c-0x0;var _0x7c946e=_0xaffe[_0x187e6c];return _0x7c946e;};'use strict';var multer=require(_0xeaff('0x0'));var util=require(_0xeaff('0x1'));var path=require(_0xeaff('0x2'));var timeout=require('connect-timeout');var express=require(_0xeaff('0x3'));var router=express[_0xeaff('0x4')]();var auth=require(_0xeaff('0x5'));var interaction=require(_0xeaff('0x6'));var config=require(_0xeaff('0x7'));var controller=require(_0xeaff('0x8'));router[_0xeaff('0x9')](_0xeaff('0xa'),auth[_0xeaff('0xb')](),controller[_0xeaff('0xc')]);router[_0xeaff('0xd')]('/',auth[_0xeaff('0xb')](),controller['create']);router[_0xeaff('0xe')](_0xeaff('0xa'),auth[_0xeaff('0xb')](),controller['update']);router[_0xeaff('0xf')](_0xeaff('0xa'),auth[_0xeaff('0xb')](),controller[_0xeaff('0x10')]);module['exports']=router; \ No newline at end of file +var _0x7005=['post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','isAuthenticated','show'];(function(_0x35b195,_0x8893d5){var _0x2433bf=function(_0x22be07){while(--_0x22be07){_0x35b195['push'](_0x35b195['shift']());}};_0x2433bf(++_0x8893d5);}(_0x7005,0x148));var _0x5700=function(_0x43fb19,_0x5f5b87){_0x43fb19=_0x43fb19-0x0;var _0x5682be=_0x7005[_0x43fb19];return _0x5682be;};'use strict';var multer=require('multer');var util=require(_0x5700('0x0'));var path=require(_0x5700('0x1'));var timeout=require(_0x5700('0x2'));var express=require(_0x5700('0x3'));var router=express[_0x5700('0x4')]();var auth=require(_0x5700('0x5'));var interaction=require(_0x5700('0x6'));var config=require(_0x5700('0x7'));var controller=require(_0x5700('0x8'));router[_0x5700('0x9')]('/:id',auth[_0x5700('0xa')](),controller[_0x5700('0xb')]);router[_0x5700('0xc')]('/',auth[_0x5700('0xa')](),controller[_0x5700('0xd')]);router[_0x5700('0xe')](_0x5700('0xf'),auth[_0x5700('0xa')](),controller[_0x5700('0x10')]);router[_0x5700('0x11')](_0x5700('0xf'),auth[_0x5700('0xa')](),controller[_0x5700('0x12')]);module[_0x5700('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 6f5568f..d894535 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 _0x10ff=['ENUM','beepall','roundrobin','sequelize','STRING','INTEGER'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x10ff,0x18f));var _0xf10f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x10ff[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xf10f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf10f('0x1')]},'timeout':{'type':Sequelize[_0xf10f('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf10f('0x3')]('rrmemory',_0xf10f('0x4'),_0xf10f('0x5'))}}; \ No newline at end of file +var _0x4032=['name','INTEGER','ENUM','roundrobin','sequelize','exports','STRING'];(function(_0x2d2346,_0x102162){var _0x54e9d2=function(_0x38c47b){while(--_0x38c47b){_0x2d2346['push'](_0x2d2346['shift']());}};_0x54e9d2(++_0x102162);}(_0x4032,0x1e0));var _0x2403=function(_0x6ec894,_0x45f53b){_0x6ec894=_0x6ec894-0x0;var _0x545e6e=_0x4032[_0x6ec894];return _0x545e6e;};'use strict';var Sequelize=require(_0x2403('0x0'));module[_0x2403('0x1')]={'name':{'type':Sequelize[_0x2403('0x2')],'unique':_0x2403('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x2403('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2403('0x5')]('rrmemory','beepall',_0x2403('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 279a9c7..31562fb 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 _0xbff5=['../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','result','catch','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','destroy','get','ChatQueues','UserProfileResource','stack','name','index','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','UserChatQueue','nolimit','order','pick','map','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','userChatQueue:save','select','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','removeTeams','emit','addAgents','omit','spread','removeAgents','userChatQueue:remove','findOne','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0xbff5,0x1bc));var _0x5bff=function(_0x302297,_0x375562){_0x302297=_0x302297-0x0;var _0x3b41a5=_0xbff5[_0x302297];return _0x3b41a5;};'use strict';var pdf=require(_0x5bff('0x0'));var emlformat=require(_0x5bff('0x1'));var rimraf=require(_0x5bff('0x2'));var zipdir=require(_0x5bff('0x3'));var jsonpatch=require(_0x5bff('0x4'));var rp=require(_0x5bff('0x5'));var moment=require(_0x5bff('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x5bff('0x7'));var util=require('util');var path=require('path');var sox=require(_0x5bff('0x8'));var csv=require(_0x5bff('0x9'));var ejs=require(_0x5bff('0xa'));var fs=require('fs');var _=require(_0x5bff('0xb'));var squel=require(_0x5bff('0xc'));var crypto=require(_0x5bff('0xd'));var jsforce=require(_0x5bff('0xe'));var deskjs=require(_0x5bff('0xf'));var toCsv=require(_0x5bff('0x9'));var querystring=require('querystring');var Papa=require(_0x5bff('0x10'));var Redis=require('ioredis');var authService=require(_0x5bff('0x11'));var qs=require(_0x5bff('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bff('0x13'));var logger=require('../../config/logger')(_0x5bff('0x14'));var utils=require('../../config/utils');var config=require(_0x5bff('0x15'));var db=require(_0x5bff('0x16'))['db'];config['redis']=_[_0x5bff('0x17')](config['redis'],{'host':_0x5bff('0x18'),'port':0x18eb});var socket=require(_0x5bff('0x19'))(new Redis(config['redis']));require(_0x5bff('0x1a'))[_0x5bff('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x5bff('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x1d300e,_0x3a507c,_0x4d883e){if(_0x4d883e){var _0x2d22ab=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2d22ab[_0x5bff('0x1d')](_0x3a507c)){return _0x1d300e;}else{throw new db[(_0x5bff('0x1e'))]['ValidationError'](_0x5bff('0x1f'));}}else{return _0x1d300e;}}function respondWithRpcPromise(_0x40c7f6,_0x38daa0,_0x546351,_0xc9fbc3){return new BPromise(function(_0x279c22,_0x36653b){var _0x32cf60=_0xc9fbc3||client;return _0x32cf60['request'](_0x40c7f6,_0x546351)[_0x5bff('0x20')](function(_0x5357d4){logger[_0x5bff('0x21')]('ChatQueue,\x20%s,\x20%s',_0x38daa0,_0x5bff('0x22'));logger[_0x5bff('0x23')](_0x5bff('0x24'),_0x38daa0,_0x5bff('0x22'),JSON[_0x5bff('0x25')](_0x5357d4));if(_0x5357d4[_0x5bff('0x26')]){if(_0x5357d4[_0x5bff('0x26')][_0x5bff('0x27')]===0x1f4){logger[_0x5bff('0x26')]('ChatQueue,\x20%s,\x20%s',_0x38daa0,_0x5357d4[_0x5bff('0x26')][_0x5bff('0x28')]);return _0x36653b(_0x5357d4[_0x5bff('0x26')][_0x5bff('0x28')]);}logger[_0x5bff('0x26')](_0x5bff('0x29'),_0x38daa0,_0x5357d4[_0x5bff('0x26')][_0x5bff('0x28')]);return _0x279c22(_0x5357d4['error']['message']);}else{logger[_0x5bff('0x21')]('ChatQueue,\x20%s,\x20%s',_0x38daa0,_0x5bff('0x22'));_0x279c22(_0x5357d4[_0x5bff('0x2a')][_0x5bff('0x28')]);}})[_0x5bff('0x2b')](function(_0xfa361d){logger[_0x5bff('0x26')](_0x5bff('0x29'),_0x38daa0,_0xfa361d);_0x36653b(_0xfa361d);});});}function respondWithStatusCode(_0xedba9d,_0x5a4e82){_0x5a4e82=_0x5a4e82||0xcc;return function(_0x4df57a){if(_0x4df57a){return _0xedba9d[_0x5bff('0x2c')](_0x5a4e82);}return _0xedba9d[_0x5bff('0x2d')](_0x5a4e82)['end']();};}function respondWithResult(_0x36a7d2,_0x588078){_0x588078=_0x588078||0xc8;return function(_0x5470cb){if(_0x5470cb){return _0x36a7d2[_0x5bff('0x2d')](_0x588078)['json'](_0x5470cb);}};}function respondWithFilteredResult(_0x3ed23b,_0x64e22){return function(_0x2d692a){if(_0x2d692a){var _0x11d48a=_0x2d692a[_0x5bff('0x2e')],_0x48aee1=_0x64e22['offset'],_0x71783=_0x64e22[_0x5bff('0x2f')]+_0x64e22[_0x5bff('0x30')],_0x4ee6f1;if(_0x71783>=_0x11d48a){_0x71783=_0x11d48a;_0x4ee6f1=0xc8;}else{_0x4ee6f1=0xce;}_0x3ed23b[_0x5bff('0x2d')](_0x4ee6f1);return _0x3ed23b[_0x5bff('0x31')](_0x5bff('0x32'),_0x48aee1+'-'+_0x71783+'/'+_0x11d48a)[_0x5bff('0x33')](_0x2d692a);}return null;};}function patchUpdates(_0x49155d){return function(_0x31b175){try{jsonpatch[_0x5bff('0x34')](_0x31b175,_0x49155d,!![]);}catch(_0x3fef83){return BPromise[_0x5bff('0x35')](_0x3fef83);}return _0x31b175[_0x5bff('0x36')]();};}function saveUpdates(_0x276862,_0x36ae08){return function(_0x16b3c2){if(_0x16b3c2){return _0x16b3c2['update'](_0x276862)[_0x5bff('0x20')](function(_0x16042d){return _0x16042d;});}return null;};}function removeEntity(_0x2f50e1,_0x320ff0){return function(_0x4fc35f){if(_0x4fc35f){return _0x4fc35f[_0x5bff('0x37')]()[_0x5bff('0x20')](function(){var _0x5a24be=_0x4fc35f[_0x5bff('0x38')]({'plain':!![]});var _0x118e07=_0x5bff('0x39');return db[_0x5bff('0x3a')]['destroy']({'where':{'type':_0x118e07,'resourceId':_0x5a24be['id']}})[_0x5bff('0x20')](function(){return _0x4fc35f;});})[_0x5bff('0x20')](function(){_0x2f50e1[_0x5bff('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1065d1,_0x55f603){return function(_0x4572e6){if(!_0x4572e6){_0x1065d1[_0x5bff('0x2c')](0x194);}return _0x4572e6;};}function handleError(_0x4422f7,_0x557ef4){_0x557ef4=_0x557ef4||0x1f4;return function(_0x368110){logger[_0x5bff('0x26')](_0x368110[_0x5bff('0x3b')]);if(_0x368110['name']){delete _0x368110[_0x5bff('0x3c')];}_0x4422f7[_0x5bff('0x2d')](_0x557ef4)['send'](_0x368110);};}exports[_0x5bff('0x3d')]=function(_0x1151d4,_0x2ff182){var _0x77a071={},_0x3b0f99={},_0x4c239f={'count':0x0,'rows':[]};var _0x35796f=_['map'](db[_0x5bff('0x3e')][_0x5bff('0x3f')],function(_0x1c3f65){return{'name':_0x1c3f65[_0x5bff('0x40')],'type':_0x1c3f65[_0x5bff('0x41')][_0x5bff('0x42')]};});_0x3b0f99[_0x5bff('0x43')]=_['map'](_0x35796f,'name');_0x3b0f99[_0x5bff('0x44')]=_[_0x5bff('0x45')](_0x1151d4[_0x5bff('0x44')]);_0x3b0f99[_0x5bff('0x46')]=_[_0x5bff('0x47')](_0x3b0f99[_0x5bff('0x43')],_0x3b0f99[_0x5bff('0x44')]);_0x77a071[_0x5bff('0x48')]=_['intersection'](_0x3b0f99[_0x5bff('0x43')],qs['fields'](_0x1151d4[_0x5bff('0x44')][_0x5bff('0x49')]));_0x77a071['attributes']=_0x77a071[_0x5bff('0x48')][_0x5bff('0x4a')]?_0x77a071['attributes']:_0x3b0f99[_0x5bff('0x43')];if(!_0x1151d4[_0x5bff('0x44')][_0x5bff('0x4b')]('nolimit')){_0x77a071[_0x5bff('0x30')]=qs[_0x5bff('0x30')](_0x1151d4[_0x5bff('0x44')]['limit']);_0x77a071[_0x5bff('0x2f')]=qs[_0x5bff('0x2f')](_0x1151d4[_0x5bff('0x44')][_0x5bff('0x2f')]);}_0x77a071['order']=qs[_0x5bff('0x4c')](_0x1151d4['query']['sort']);_0x77a071[_0x5bff('0x4d')]=qs[_0x5bff('0x46')](_['pick'](_0x1151d4[_0x5bff('0x44')],_0x3b0f99[_0x5bff('0x46')]));if(_0x1151d4['query'][_0x5bff('0x4e')]){_0x77a071[_0x5bff('0x4d')]=_[_0x5bff('0x4f')](_0x77a071[_0x5bff('0x4d')],{'$or':_['map'](_0x35796f,function(_0x579a8d){if(_0x579a8d[_0x5bff('0x41')]!==_0x5bff('0x50')){var _0x738700={};_0x738700[_0x579a8d[_0x5bff('0x3c')]]={'$like':'%'+_0x1151d4[_0x5bff('0x44')]['filter']+'%'};return _0x738700;}})});}_0x77a071=_[_0x5bff('0x4f')]({},_0x77a071,_0x1151d4[_0x5bff('0x51')]);var _0x5d5b1f={'where':_0x77a071[_0x5bff('0x4d')]};return db['ChatQueue']['count'](_0x5d5b1f)['then'](function(_0x3ac8ad){_0x4c239f[_0x5bff('0x2e')]=_0x3ac8ad;if(_0x1151d4['query'][_0x5bff('0x52')]){_0x77a071[_0x5bff('0x53')]=[{'all':!![]}];}return db[_0x5bff('0x3e')][_0x5bff('0x54')](_0x77a071);})[_0x5bff('0x20')](function(_0x4a63b3){_0x4c239f[_0x5bff('0x55')]=_0x4a63b3;return _0x4c239f;})[_0x5bff('0x20')](respondWithFilteredResult(_0x2ff182,_0x77a071))['catch'](handleError(_0x2ff182,null));};exports[_0x5bff('0x56')]=function(_0x48feaa,_0x1b0b69){var _0x8c5211={'raw':!![],'where':{'id':_0x48feaa[_0x5bff('0x57')]['id']}},_0x455937={};_0x455937[_0x5bff('0x43')]=_['keys'](db[_0x5bff('0x3e')][_0x5bff('0x3f')]);_0x455937['query']=_[_0x5bff('0x45')](_0x48feaa[_0x5bff('0x44')]);_0x455937['filters']=_[_0x5bff('0x47')](_0x455937[_0x5bff('0x43')],_0x455937[_0x5bff('0x44')]);_0x8c5211[_0x5bff('0x48')]=_[_0x5bff('0x47')](_0x455937[_0x5bff('0x43')],qs['fields'](_0x48feaa['query'][_0x5bff('0x49')]));_0x8c5211['attributes']=_0x8c5211[_0x5bff('0x48')][_0x5bff('0x4a')]?_0x8c5211[_0x5bff('0x48')]:_0x455937[_0x5bff('0x43')];if(_0x48feaa[_0x5bff('0x44')][_0x5bff('0x52')]){_0x8c5211[_0x5bff('0x53')]=[{'all':!![]}];}_0x8c5211=_[_0x5bff('0x4f')]({},_0x8c5211,_0x48feaa[_0x5bff('0x51')]);return db[_0x5bff('0x3e')][_0x5bff('0x58')](_0x8c5211)['then'](handleEntityNotFound(_0x1b0b69,null))['then'](respondWithResult(_0x1b0b69,null))[_0x5bff('0x2b')](handleError(_0x1b0b69,null));};exports['create']=function(_0x27e34d,_0x47b0b2){return db[_0x5bff('0x3e')][_0x5bff('0x59')](_0x27e34d[_0x5bff('0x5a')],{})[_0x5bff('0x20')](function(_0x3d1b1c){var _0x1021b1=_0x27e34d[_0x5bff('0x5b')][_0x5bff('0x38')]({'plain':!![]});if(!_0x1021b1)throw new Error(_0x5bff('0x5c'));if(_0x1021b1[_0x5bff('0x5d')]===_0x5bff('0x5b')){var _0x57053a=_0x3d1b1c[_0x5bff('0x38')]({'plain':!![]});var _0x56eff2='ChatQueues';return db['UserProfileSection'][_0x5bff('0x58')]({'where':{'name':_0x56eff2,'userProfileId':_0x1021b1['userProfileId']},'raw':!![]})[_0x5bff('0x20')](function(_0x17d6f2){if(_0x17d6f2&&_0x17d6f2[_0x5bff('0x5e')]===0x0){return db[_0x5bff('0x3a')]['create']({'name':_0x57053a['name'],'resourceId':_0x57053a['id'],'type':_0x17d6f2['name'],'sectionId':_0x17d6f2['id']},{})[_0x5bff('0x20')](function(){return _0x3d1b1c;});}else{return _0x3d1b1c;}})[_0x5bff('0x2b')](function(_0x5893b9){logger[_0x5bff('0x26')](_0x5bff('0x5f'),_0x5893b9);throw _0x5893b9;});}return _0x3d1b1c;})[_0x5bff('0x20')](respondWithResult(_0x47b0b2,0xc9))[_0x5bff('0x2b')](handleError(_0x47b0b2,null));};exports[_0x5bff('0x60')]=function(_0x20ff8a,_0x134268){if(_0x20ff8a[_0x5bff('0x5a')]['id']){delete _0x20ff8a[_0x5bff('0x5a')]['id'];}return db[_0x5bff('0x3e')][_0x5bff('0x58')]({'where':{'id':_0x20ff8a[_0x5bff('0x57')]['id']}})[_0x5bff('0x20')](handleEntityNotFound(_0x134268,null))[_0x5bff('0x20')](saveUpdates(_0x20ff8a['body'],null))[_0x5bff('0x20')](respondWithResult(_0x134268,null))[_0x5bff('0x2b')](handleError(_0x134268,null));};exports[_0x5bff('0x37')]=function(_0x13980a,_0x3ae675){return db[_0x5bff('0x3e')][_0x5bff('0x58')]({'where':{'id':_0x13980a[_0x5bff('0x57')]['id']}})[_0x5bff('0x20')](handleEntityNotFound(_0x3ae675,null))[_0x5bff('0x20')](removeEntity(_0x3ae675,null))[_0x5bff('0x2b')](handleError(_0x3ae675,null));};exports[_0x5bff('0x61')]=function(_0x44f512,_0x4d3e37){return db[_0x5bff('0x3e')][_0x5bff('0x61')]()[_0x5bff('0x20')](respondWithResult(_0x4d3e37,null))[_0x5bff('0x2b')](handleError(_0x4d3e37,null));};exports[_0x5bff('0x62')]=function(_0x5e3cec,_0x78f4c9,_0xd71b86){var _0x5b8f25={'raw':!![],'where':{}},_0x1b35ae={},_0x1e3eab;return db[_0x5bff('0x3e')]['findOne']({'where':{'id':_0x5e3cec[_0x5bff('0x57')]['id']}})[_0x5bff('0x20')](handleEntityNotFound(_0x78f4c9,null))[_0x5bff('0x20')](function(_0x3bf744){if(_0x3bf744){_0x1e3eab=_0x3bf744[_0x5bff('0x38')]({'plain':!![]});_0x1b35ae[_0x5bff('0x43')]=_[_0x5bff('0x45')](db[_0x5bff('0x63')][_0x5bff('0x3f')]);_0x1b35ae[_0x5bff('0x44')]=_[_0x5bff('0x45')](_0x5e3cec[_0x5bff('0x44')]);_0x1b35ae['filters']=_['intersection'](_0x1b35ae[_0x5bff('0x43')],_0x1b35ae[_0x5bff('0x44')]);_0x5b8f25[_0x5bff('0x48')]=_['intersection'](_0x1b35ae[_0x5bff('0x43')],qs['fields'](_0x5e3cec['query'][_0x5bff('0x49')]));_0x5b8f25['attributes']=_0x5b8f25['attributes'][_0x5bff('0x4a')]?_0x5b8f25[_0x5bff('0x48')]:_0x1b35ae['model'];if(!_0x5e3cec[_0x5bff('0x44')][_0x5bff('0x4b')](_0x5bff('0x64'))){_0x5b8f25[_0x5bff('0x30')]=qs[_0x5bff('0x30')](_0x5e3cec[_0x5bff('0x44')][_0x5bff('0x30')]);_0x5b8f25[_0x5bff('0x2f')]=qs[_0x5bff('0x2f')](_0x5e3cec[_0x5bff('0x44')][_0x5bff('0x2f')]);}_0x5b8f25[_0x5bff('0x65')]=qs[_0x5bff('0x4c')](_0x5e3cec[_0x5bff('0x44')][_0x5bff('0x4c')]);_0x5b8f25[_0x5bff('0x4d')]=qs[_0x5bff('0x46')](_[_0x5bff('0x66')](_0x5e3cec[_0x5bff('0x44')],_0x1b35ae[_0x5bff('0x46')]));_0x5b8f25[_0x5bff('0x4d')]['ChatQueueId']=_0x3bf744['id'];if(_0x5e3cec[_0x5bff('0x44')][_0x5bff('0x4e')]){_0x5b8f25['where']=_[_0x5bff('0x4f')](_0x5b8f25['where'],{'$or':_[_0x5bff('0x67')](_0x5b8f25[_0x5bff('0x48')],function(_0x515850){var _0x198391={};_0x198391[_0x515850]={'$like':'%'+_0x5e3cec[_0x5bff('0x44')][_0x5bff('0x4e')]+'%'};return _0x198391;})});}_0x5b8f25=_[_0x5bff('0x4f')]({},_0x5b8f25,_0x5e3cec[_0x5bff('0x51')]);return db[_0x5bff('0x63')][_0x5bff('0x54')](_0x5b8f25);}})[_0x5bff('0x20')](function(_0x37314a){if(_0x37314a){return db[_0x5bff('0x68')][_0x5bff('0x69')]({'where':{'id':_['map'](_0x37314a,_0x5bff('0x6a')),'role':_0x5bff('0x6b')},'attributes':['id','name',_0x5bff('0x6c'),_0x5bff('0x6d'),_0x5bff('0x6e')]});}})[_0x5bff('0x20')](function(_0x3c7965){if(_0x3c7965){return{'count':_0x3c7965[_0x5bff('0x2e')],'rows':_[_0x5bff('0x67')](_0x3c7965[_0x5bff('0x55')],function(_0x57ae4d){return{'membername':_0x57ae4d['name'],'UserId':_0x57ae4d['id'],'queue_name':_0x1e3eab[_0x5bff('0x3c')],'ChatQueueId':_0x1e3eab['id'],'interface':util['format'](_0x5bff('0x6f'),_0x5bff('0x70'),_0x57ae4d[_0x5bff('0x3c')]),'penalty':0x0,'paused':_0x57ae4d['chatPause'],'createdAt':_0x57ae4d[_0x5bff('0x6e')],'updatedAt':_0x57ae4d[_0x5bff('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5bff('0x20')](respondWithFilteredResult(_0x78f4c9,_0x5b8f25))[_0x5bff('0x2b')](handleError(_0x78f4c9,null));};exports[_0x5bff('0x71')]=function(_0x4774c2,_0x4b40c5,_0x341e79){var _0x16cc32={};var _0x4750d3={};var _0x1143aa;var _0x5b0acf;return db[_0x5bff('0x3e')]['findOne']({'where':{'id':_0x4774c2[_0x5bff('0x57')]['id']}})[_0x5bff('0x20')](handleEntityNotFound(_0x4b40c5,null))[_0x5bff('0x20')](function(_0x2e965f){if(_0x2e965f){_0x1143aa=_0x2e965f;_0x4750d3[_0x5bff('0x43')]=_[_0x5bff('0x45')](db[_0x5bff('0x72')]['rawAttributes']);_0x4750d3[_0x5bff('0x44')]=_['keys'](_0x4774c2['query']);_0x4750d3[_0x5bff('0x46')]=_[_0x5bff('0x47')](_0x4750d3['model'],_0x4750d3['query']);_0x16cc32[_0x5bff('0x48')]=_[_0x5bff('0x47')](_0x4750d3[_0x5bff('0x43')],qs[_0x5bff('0x49')](_0x4774c2['query'][_0x5bff('0x49')]));_0x16cc32['attributes']=_0x16cc32[_0x5bff('0x48')][_0x5bff('0x4a')]?_0x16cc32[_0x5bff('0x48')]:_0x4750d3['model'];_0x16cc32[_0x5bff('0x65')]=qs['sort'](_0x4774c2[_0x5bff('0x44')][_0x5bff('0x4c')]);_0x16cc32[_0x5bff('0x4d')]=qs['filters'](_['pick'](_0x4774c2[_0x5bff('0x44')],_0x4750d3[_0x5bff('0x46')]));if(_0x4774c2[_0x5bff('0x44')][_0x5bff('0x4e')]){_0x16cc32[_0x5bff('0x4d')]=_[_0x5bff('0x4f')](_0x16cc32[_0x5bff('0x4d')],{'$or':_[_0x5bff('0x67')](_0x16cc32[_0x5bff('0x48')],function(_0x59efd7){var _0x435076={};_0x435076[_0x59efd7]={'$like':'%'+_0x4774c2[_0x5bff('0x44')][_0x5bff('0x4e')]+'%'};return _0x435076;})});}_0x16cc32=_['merge']({},_0x16cc32,_0x4774c2['options']);return _0x1143aa[_0x5bff('0x71')](_0x16cc32);}})[_0x5bff('0x20')](function(_0x4b216f){if(_0x4b216f){_0x5b0acf=_0x4b216f['length'];if(!_0x4774c2[_0x5bff('0x44')]['hasOwnProperty'](_0x5bff('0x64'))){_0x16cc32[_0x5bff('0x30')]=qs[_0x5bff('0x30')](_0x4774c2[_0x5bff('0x44')]['limit']);_0x16cc32[_0x5bff('0x2f')]=qs['offset'](_0x4774c2[_0x5bff('0x44')][_0x5bff('0x2f')]);}return _0x1143aa[_0x5bff('0x71')](_0x16cc32);}})[_0x5bff('0x20')](function(_0x63b716){if(_0x63b716){return _0x63b716?{'count':_0x5b0acf,'rows':_0x63b716}:null;}})['then'](respondWithResult(_0x4b40c5,null))[_0x5bff('0x2b')](handleError(_0x4b40c5,null));};exports[_0x5bff('0x73')]=function(_0x523123,_0x1d7454,_0x494872){var _0xf05c8a=_0x523123[_0x5bff('0x5a')][_0x5bff('0x74')];return db['Team'][_0x5bff('0x54')]({'where':{'id':_0xf05c8a},'attributes':['id'],'include':[{'model':db[_0x5bff('0x68')],'as':_0x5bff('0x75'),'attributes':['id',_0x5bff('0x3c'),_0x5bff('0x76'),_0x5bff('0x77'),'interface'],'raw':!![]}]})[_0x5bff('0x20')](function(_0x4be1a0){if(_0x4be1a0){var _0x1f0a8a=_[_0x5bff('0x78')](_0x4be1a0,function(_0x1ed775){var _0x3b240f=_0x1ed775[_0x5bff('0x38')]({'plain':!![]});return _0x3b240f[_0x5bff('0x75')];});return db[_0x5bff('0x3e')][_0x5bff('0x58')]({'where':{'id':_0x523123[_0x5bff('0x57')]['id']}})[_0x5bff('0x20')](function(_0x429263){return db[_0x5bff('0x79')][_0x5bff('0x7a')](function(_0x4cfb5b){return _0x429263['addTeams'](_0xf05c8a,{'transaction':_0x4cfb5b})[_0x5bff('0x20')](function(){return BPromise[_0x5bff('0x7b')](_0x1f0a8a,function(_0x76387){return db[_0x5bff('0x63')][_0x5bff('0x7c')]({'where':{'UserId':_0x76387['id'],'ChatQueueId':_0x523123['params']['id']},'transaction':_0x4cfb5b});});})[_0x5bff('0x20')](function(){_0x1f0a8a[_0x5bff('0x7d')](function(_0x1d5599){socket['emit'](_0x5bff('0x7e'),{'UserId':_0x1d5599['id'],'ChatQueueId':_0x429263['id']});});});});});}})['then'](respondWithStatusCode(_0x1d7454,null))[_0x5bff('0x2b')](handleError(_0x1d7454,null));};exports['removeTeams']=function(_0x338e0c,_0x4888de,_0xe39373){return db[_0x5bff('0x72')][_0x5bff('0x54')]({'where':{'id':_0x338e0c['query'][_0x5bff('0x74')]},'attributes':['id'],'include':[{'model':db[_0x5bff('0x68')],'as':_0x5bff('0x75'),'attributes':['id'],'raw':!![]}]})[_0x5bff('0x20')](handleEntityNotFound(_0x4888de,null))[_0x5bff('0x20')](function(_0x1bd28a){var _0x2ca82e=_[_0x5bff('0x67')](_0x1bd28a,'id');var _0x2f9221=[];var _0x11b49d=[];var _0x4d5581=squel[_0x5bff('0x7f')]();_0x4d5581[_0x5bff('0x80')]('tq.TeamId')[_0x5bff('0x81')]('team_has_chat_queues','tq')['join'](_0x5bff('0x82'),'ut',_0x5bff('0x83'))[_0x5bff('0x4d')](_0x5bff('0x84'),_0x338e0c['params']['id']);for(var _0x5e83b8=0x0;_0x5e83b8<_0x1bd28a[_0x5bff('0x4a')];_0x5e83b8+=0x1){let _0x15d606=_0x1bd28a[_0x5e83b8];for(var _0xafa91a=0x0;_0xafa91a<_0x15d606['Agents'][_0x5bff('0x4a')];_0xafa91a+=0x1){let _0x248b2c=_0x15d606[_0x5bff('0x75')][_0xafa91a];var _0x23aaef=_0x4d5581[_0x5bff('0x85')]();_0x23aaef['where'](_0x5bff('0x86'),_0x248b2c['id']);_0x11b49d[_0x5bff('0x87')](db['sequelize'][_0x5bff('0x44')](_0x23aaef[_0x5bff('0x88')](),{'type':db[_0x5bff('0x79')][_0x5bff('0x89')]['SELECT']})['then'](function(_0x436d86){if(_0x436d86[_0x5bff('0x4a')]===0x1){return _0x248b2c['id'];}else{var _0xe25ae8=_[_0x5bff('0x8a')](_[_0x5bff('0x67')](_0x436d86,_0x5bff('0x8b')),function(_0x3f9ecd){return _[_0x5bff('0x8c')](_0x2ca82e,_0x3f9ecd);});if(_0xe25ae8){return _0x248b2c['id'];}}}));}}return BPromise[_0x5bff('0x8d')](_0x11b49d)[_0x5bff('0x20')](function(_0x4c6a55){_0x2f9221=_(_0x2f9221)[_0x5bff('0x8e')](_0x4c6a55)[_0x5bff('0x8f')]()[_0x5bff('0x90')]();return db[_0x5bff('0x3e')]['find']({'where':{'id':_0x338e0c['params']['id']}})[_0x5bff('0x20')](function(_0xd37db6){return db[_0x5bff('0x79')][_0x5bff('0x7a')](function(_0x39da05){return _0xd37db6[_0x5bff('0x91')](_0x338e0c[_0x5bff('0x44')]['ids'],{'transaction':_0x39da05})['then'](function(){if(!_['isEmpty'](_0x2f9221)){return _0xd37db6['removeAgents'](_0x2f9221,{'transaction':_0x39da05});}})[_0x5bff('0x20')](function(){_0x2f9221[_0x5bff('0x7d')](function(_0x1cd2c6){socket[_0x5bff('0x92')]('userChatQueue:remove',{'UserId':_0x1cd2c6,'ChatQueueId':_0xd37db6['id']});});});});});});})['then'](respondWithStatusCode(_0x4888de,null))[_0x5bff('0x2b')](handleError(_0x4888de,null));};exports[_0x5bff('0x93')]=function(_0x356a1d,_0x10cf74,_0x355333){return db[_0x5bff('0x3e')]['find']({'where':{'id':_0x356a1d['params']['id']}})['then'](handleEntityNotFound(_0x10cf74,null))['then'](function(_0x98350){if(_0x98350){return _0x98350[_0x5bff('0x93')](_0x356a1d['body'][_0x5bff('0x74')],_[_0x5bff('0x94')](_0x356a1d[_0x5bff('0x5a')],['ids','id'])||{})[_0x5bff('0x95')](function(_0x5ac000){for(var _0x4f7c78=0x0;_0x4f7c78<_0x356a1d[_0x5bff('0x5a')][_0x5bff('0x74')][_0x5bff('0x4a')];_0x4f7c78+=0x1){socket[_0x5bff('0x92')]('userChatQueue:save',{'UserId':_0x356a1d[_0x5bff('0x5a')][_0x5bff('0x74')][_0x4f7c78],'ChatQueueId':_0x356a1d[_0x5bff('0x57')]['id']});}return _0x5ac000;});}})['then'](respondWithResult(_0x10cf74,null))[_0x5bff('0x2b')](handleError(_0x10cf74,null));};exports[_0x5bff('0x96')]=function(_0xa88013,_0x41c9d0,_0x3bd9c2){return db['ChatQueue'][_0x5bff('0x58')]({'where':{'id':_0xa88013['params']['id']}})[_0x5bff('0x20')](handleEntityNotFound(_0x41c9d0,null))['then'](function(_0xb3bab4){if(_0xb3bab4){return _0xb3bab4[_0x5bff('0x96')](_0xa88013[_0x5bff('0x44')][_0x5bff('0x74')])[_0x5bff('0x20')](function(){if(_['isArray'](_0xa88013['query']['ids'])){for(var _0x4a4b12=0x0;_0x4a4b12<_0xa88013[_0x5bff('0x44')]['ids']['length'];_0x4a4b12+=0x1){socket['emit'](_0x5bff('0x97'),{'UserId':Number(_0xa88013['query']['ids'][_0x4a4b12]),'ChatQueueId':Number(_0xa88013[_0x5bff('0x57')]['id'])});}}else{socket[_0x5bff('0x92')](_0x5bff('0x97'),{'UserId':Number(_0xa88013[_0x5bff('0x44')][_0x5bff('0x74')]),'ChatQueueId':Number(_0xa88013['params']['id'])});}});}})['then'](respondWithStatusCode(_0x41c9d0,null))['catch'](handleError(_0x41c9d0,null));};exports['getAgents']=function(_0xd62f75,_0x462abb,_0x5a8b9d){var _0x4ef3a9={};var _0x3f151f={};var _0x23044a;var _0x5453bd;return db['ChatQueue'][_0x5bff('0x98')]({'where':{'id':_0xd62f75[_0x5bff('0x57')]['id']}})[_0x5bff('0x20')](handleEntityNotFound(_0x462abb,null))[_0x5bff('0x20')](function(_0x40b41f){if(_0x40b41f){_0x23044a=_0x40b41f;_0x3f151f[_0x5bff('0x43')]=_['keys'](db[_0x5bff('0x68')]['rawAttributes']);_0x3f151f[_0x5bff('0x44')]=_['keys'](_0xd62f75[_0x5bff('0x44')]);_0x3f151f[_0x5bff('0x46')]=_[_0x5bff('0x47')](_0x3f151f[_0x5bff('0x43')],_0x3f151f[_0x5bff('0x44')]);_0x4ef3a9['attributes']=_[_0x5bff('0x47')](_0x3f151f[_0x5bff('0x43')],qs[_0x5bff('0x49')](_0xd62f75['query'][_0x5bff('0x49')]));_0x4ef3a9[_0x5bff('0x48')]=_0x4ef3a9[_0x5bff('0x48')][_0x5bff('0x4a')]?_0x4ef3a9[_0x5bff('0x48')]:_0x3f151f[_0x5bff('0x43')];_0x4ef3a9['order']=qs['sort'](_0xd62f75[_0x5bff('0x44')]['sort']);_0x4ef3a9[_0x5bff('0x4d')]=qs['filters'](_[_0x5bff('0x66')](_0xd62f75['query'],_0x3f151f[_0x5bff('0x46')]));if(_0xd62f75[_0x5bff('0x44')]['filter']){_0x4ef3a9['where']=_[_0x5bff('0x4f')](_0x4ef3a9[_0x5bff('0x4d')],{'$or':_[_0x5bff('0x67')](_0x4ef3a9[_0x5bff('0x48')],function(_0x2b8f70){var _0x32352e={};_0x32352e[_0x2b8f70]={'$like':'%'+_0xd62f75[_0x5bff('0x44')][_0x5bff('0x4e')]+'%'};return _0x32352e;})});}_0x4ef3a9=_[_0x5bff('0x4f')]({},_0x4ef3a9,_0xd62f75[_0x5bff('0x51')]);return _0x23044a[_0x5bff('0x99')](_0x4ef3a9);}})[_0x5bff('0x20')](function(_0x232197){if(_0x232197){_0x5453bd=_0x232197[_0x5bff('0x4a')];if(!_0xd62f75[_0x5bff('0x44')][_0x5bff('0x4b')]('nolimit')){_0x4ef3a9[_0x5bff('0x30')]=qs[_0x5bff('0x30')](_0xd62f75['query'][_0x5bff('0x30')]);_0x4ef3a9[_0x5bff('0x2f')]=qs['offset'](_0xd62f75['query']['offset']);}return _0x23044a[_0x5bff('0x99')](_0x4ef3a9);}})['then'](function(_0x25d550){if(_0x25d550){return _0x25d550?{'count':_0x5453bd,'rows':_0x25d550}:null;}})['then'](respondWithResult(_0x462abb,null))[_0x5bff('0x2b')](handleError(_0x462abb,null));}; \ No newline at end of file +var _0xbe2c=['key','model','map','keys','filters','attributes','intersection','fields','length','query','hasOwnProperty','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','order','sort','ChatQueueId','User','findAndCountAll','agent','updatedAt','createdAt','format','%s/%s','SIP','chatPause','getTeams','Team','nolimit','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','emit','removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','forEach','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','removeAgents','isArray','getAgents','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','count','offset','limit','set','json','save','update','get','ChatQueues','UserProfileResource','stack','name','ChatQueue','rawAttributes','fieldName','type'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xbe2c,0x18f));var _0xcbe2=function(_0xe51229,_0x53f813){_0xe51229=_0xe51229-0x0;var _0xf26f95=_0xbe2c[_0xe51229];return _0xf26f95;};'use strict';var pdf=require(_0xcbe2('0x0'));var emlformat=require(_0xcbe2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xcbe2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcbe2('0x3'));var moment=require(_0xcbe2('0x4'));var BPromise=require(_0xcbe2('0x5'));var Mustache=require(_0xcbe2('0x6'));var util=require(_0xcbe2('0x7'));var path=require('path');var sox=require(_0xcbe2('0x8'));var csv=require(_0xcbe2('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xcbe2('0xa'));var squel=require(_0xcbe2('0xb'));var crypto=require(_0xcbe2('0xc'));var jsforce=require(_0xcbe2('0xd'));var deskjs=require(_0xcbe2('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcbe2('0xf'));var Redis=require(_0xcbe2('0x10'));var authService=require(_0xcbe2('0x11'));var qs=require(_0xcbe2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbe2('0x13'))(_0xcbe2('0x14'));var utils=require(_0xcbe2('0x15'));var config=require(_0xcbe2('0x16'));var db=require(_0xcbe2('0x17'))['db'];config[_0xcbe2('0x18')]=_['defaults'](config[_0xcbe2('0x18')],{'host':_0xcbe2('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcbe2('0x18')]));require('./chatQueue.socket')[_0xcbe2('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xcbe2('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x570b3d,_0xb89337,_0x4ec284){if(_0x4ec284){var _0xb2995b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xb2995b[_0xcbe2('0x1c')](_0xb89337)){return _0x570b3d;}else{throw new db[(_0xcbe2('0x1d'))][(_0xcbe2('0x1e'))](_0xcbe2('0x1f'));}}else{return _0x570b3d;}}function respondWithRpcPromise(_0x23d495,_0x126aa9,_0x5c84c9,_0xb968ac){return new BPromise(function(_0x5acacd,_0x1c09cb){var _0xff2918=_0xb968ac||client;return _0xff2918[_0xcbe2('0x20')](_0x23d495,_0x5c84c9)[_0xcbe2('0x21')](function(_0x537eb2){logger[_0xcbe2('0x22')]('ChatQueue,\x20%s,\x20%s',_0x126aa9,'request\x20sent');logger[_0xcbe2('0x23')](_0xcbe2('0x24'),_0x126aa9,_0xcbe2('0x25'),JSON['stringify'](_0x537eb2));if(_0x537eb2[_0xcbe2('0x26')]){if(_0x537eb2[_0xcbe2('0x26')][_0xcbe2('0x27')]===0x1f4){logger['error'](_0xcbe2('0x28'),_0x126aa9,_0x537eb2[_0xcbe2('0x26')][_0xcbe2('0x29')]);return _0x1c09cb(_0x537eb2[_0xcbe2('0x26')][_0xcbe2('0x29')]);}logger[_0xcbe2('0x26')](_0xcbe2('0x28'),_0x126aa9,_0x537eb2[_0xcbe2('0x26')]['message']);return _0x5acacd(_0x537eb2[_0xcbe2('0x26')][_0xcbe2('0x29')]);}else{logger['info'](_0xcbe2('0x28'),_0x126aa9,_0xcbe2('0x25'));_0x5acacd(_0x537eb2[_0xcbe2('0x2a')][_0xcbe2('0x29')]);}})[_0xcbe2('0x2b')](function(_0x4833cd){logger[_0xcbe2('0x26')](_0xcbe2('0x28'),_0x126aa9,_0x4833cd);_0x1c09cb(_0x4833cd);});});}function respondWithStatusCode(_0x4b43d8,_0xce7167){_0xce7167=_0xce7167||0xcc;return function(_0x5ad2e9){if(_0x5ad2e9){return _0x4b43d8[_0xcbe2('0x2c')](_0xce7167);}return _0x4b43d8[_0xcbe2('0x2d')](_0xce7167)[_0xcbe2('0x2e')]();};}function respondWithResult(_0x431631,_0x4c194d){_0x4c194d=_0x4c194d||0xc8;return function(_0xdee879){if(_0xdee879){return _0x431631[_0xcbe2('0x2d')](_0x4c194d)['json'](_0xdee879);}};}function respondWithFilteredResult(_0x3596be,_0x2410e4){return function(_0x2def48){if(_0x2def48){var _0x1dc0ea=_0x2def48[_0xcbe2('0x2f')],_0x26d570=_0x2410e4[_0xcbe2('0x30')],_0x3cffd1=_0x2410e4[_0xcbe2('0x30')]+_0x2410e4[_0xcbe2('0x31')],_0x3744f3;if(_0x3cffd1>=_0x1dc0ea){_0x3cffd1=_0x1dc0ea;_0x3744f3=0xc8;}else{_0x3744f3=0xce;}_0x3596be[_0xcbe2('0x2d')](_0x3744f3);return _0x3596be[_0xcbe2('0x32')]('Content-Range',_0x26d570+'-'+_0x3cffd1+'/'+_0x1dc0ea)[_0xcbe2('0x33')](_0x2def48);}return null;};}function patchUpdates(_0xe2ec6){return function(_0x55c233){try{jsonpatch['apply'](_0x55c233,_0xe2ec6,!![]);}catch(_0x3881ce){return BPromise['reject'](_0x3881ce);}return _0x55c233[_0xcbe2('0x34')]();};}function saveUpdates(_0x2e3a99,_0x1b745c){return function(_0x8f97c3){if(_0x8f97c3){return _0x8f97c3[_0xcbe2('0x35')](_0x2e3a99)[_0xcbe2('0x21')](function(_0x183953){return _0x183953;});}return null;};}function removeEntity(_0x4a5579,_0x32e13e){return function(_0x579a37){if(_0x579a37){return _0x579a37['destroy']()[_0xcbe2('0x21')](function(){var _0x4bd628=_0x579a37[_0xcbe2('0x36')]({'plain':!![]});var _0x5a8074=_0xcbe2('0x37');return db[_0xcbe2('0x38')]['destroy']({'where':{'type':_0x5a8074,'resourceId':_0x4bd628['id']}})[_0xcbe2('0x21')](function(){return _0x579a37;});})['then'](function(){_0x4a5579[_0xcbe2('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e9023,_0x319fa9){return function(_0x594804){if(!_0x594804){_0x5e9023['sendStatus'](0x194);}return _0x594804;};}function handleError(_0x30e661,_0x5b6a18){_0x5b6a18=_0x5b6a18||0x1f4;return function(_0x16430d){logger[_0xcbe2('0x26')](_0x16430d[_0xcbe2('0x39')]);if(_0x16430d['name']){delete _0x16430d[_0xcbe2('0x3a')];}_0x30e661[_0xcbe2('0x2d')](_0x5b6a18)['send'](_0x16430d);};}exports['index']=function(_0x570177,_0x3eff90){var _0x4347a7={},_0x5cd9f9={},_0x1121c1={'count':0x0,'rows':[]};var _0x391500=_['map'](db[_0xcbe2('0x3b')][_0xcbe2('0x3c')],function(_0x581d37){return{'name':_0x581d37[_0xcbe2('0x3d')],'type':_0x581d37[_0xcbe2('0x3e')][_0xcbe2('0x3f')]};});_0x5cd9f9[_0xcbe2('0x40')]=_[_0xcbe2('0x41')](_0x391500,_0xcbe2('0x3a'));_0x5cd9f9['query']=_[_0xcbe2('0x42')](_0x570177['query']);_0x5cd9f9[_0xcbe2('0x43')]=_['intersection'](_0x5cd9f9[_0xcbe2('0x40')],_0x5cd9f9['query']);_0x4347a7[_0xcbe2('0x44')]=_[_0xcbe2('0x45')](_0x5cd9f9[_0xcbe2('0x40')],qs[_0xcbe2('0x46')](_0x570177['query'][_0xcbe2('0x46')]));_0x4347a7['attributes']=_0x4347a7[_0xcbe2('0x44')][_0xcbe2('0x47')]?_0x4347a7[_0xcbe2('0x44')]:_0x5cd9f9['model'];if(!_0x570177[_0xcbe2('0x48')][_0xcbe2('0x49')]('nolimit')){_0x4347a7[_0xcbe2('0x31')]=qs['limit'](_0x570177[_0xcbe2('0x48')][_0xcbe2('0x31')]);_0x4347a7[_0xcbe2('0x30')]=qs[_0xcbe2('0x30')](_0x570177[_0xcbe2('0x48')][_0xcbe2('0x30')]);}_0x4347a7['order']=qs['sort'](_0x570177[_0xcbe2('0x48')]['sort']);_0x4347a7[_0xcbe2('0x4a')]=qs[_0xcbe2('0x43')](_[_0xcbe2('0x4b')](_0x570177[_0xcbe2('0x48')],_0x5cd9f9[_0xcbe2('0x43')]));if(_0x570177[_0xcbe2('0x48')][_0xcbe2('0x4c')]){_0x4347a7[_0xcbe2('0x4a')]=_[_0xcbe2('0x4d')](_0x4347a7[_0xcbe2('0x4a')],{'$or':_[_0xcbe2('0x41')](_0x391500,function(_0x22011d){if(_0x22011d[_0xcbe2('0x3e')]!==_0xcbe2('0x4e')){var _0x56b9a0={};_0x56b9a0[_0x22011d[_0xcbe2('0x3a')]]={'$like':'%'+_0x570177[_0xcbe2('0x48')][_0xcbe2('0x4c')]+'%'};return _0x56b9a0;}})});}_0x4347a7=_[_0xcbe2('0x4d')]({},_0x4347a7,_0x570177[_0xcbe2('0x4f')]);var _0x506601={'where':_0x4347a7[_0xcbe2('0x4a')]};return db[_0xcbe2('0x3b')]['count'](_0x506601)[_0xcbe2('0x21')](function(_0x4303cb){_0x1121c1[_0xcbe2('0x2f')]=_0x4303cb;if(_0x570177['query']['includeAll']){_0x4347a7['include']=[{'all':!![]}];}return db[_0xcbe2('0x3b')][_0xcbe2('0x50')](_0x4347a7);})[_0xcbe2('0x21')](function(_0x3a6113){_0x1121c1[_0xcbe2('0x51')]=_0x3a6113;return _0x1121c1;})[_0xcbe2('0x21')](respondWithFilteredResult(_0x3eff90,_0x4347a7))[_0xcbe2('0x2b')](handleError(_0x3eff90,null));};exports[_0xcbe2('0x52')]=function(_0x427db8,_0x558590){var _0x5c01f2={'raw':!![],'where':{'id':_0x427db8[_0xcbe2('0x53')]['id']}},_0x53d5af={};_0x53d5af[_0xcbe2('0x40')]=_[_0xcbe2('0x42')](db[_0xcbe2('0x3b')][_0xcbe2('0x3c')]);_0x53d5af[_0xcbe2('0x48')]=_[_0xcbe2('0x42')](_0x427db8['query']);_0x53d5af['filters']=_[_0xcbe2('0x45')](_0x53d5af['model'],_0x53d5af['query']);_0x5c01f2[_0xcbe2('0x44')]=_[_0xcbe2('0x45')](_0x53d5af[_0xcbe2('0x40')],qs[_0xcbe2('0x46')](_0x427db8[_0xcbe2('0x48')][_0xcbe2('0x46')]));_0x5c01f2[_0xcbe2('0x44')]=_0x5c01f2[_0xcbe2('0x44')][_0xcbe2('0x47')]?_0x5c01f2['attributes']:_0x53d5af[_0xcbe2('0x40')];if(_0x427db8[_0xcbe2('0x48')]['includeAll']){_0x5c01f2[_0xcbe2('0x54')]=[{'all':!![]}];}_0x5c01f2=_[_0xcbe2('0x4d')]({},_0x5c01f2,_0x427db8[_0xcbe2('0x4f')]);return db[_0xcbe2('0x3b')]['find'](_0x5c01f2)[_0xcbe2('0x21')](handleEntityNotFound(_0x558590,null))['then'](respondWithResult(_0x558590,null))[_0xcbe2('0x2b')](handleError(_0x558590,null));};exports['create']=function(_0x3ffc89,_0x4f623c){return db[_0xcbe2('0x3b')][_0xcbe2('0x55')](_0x3ffc89[_0xcbe2('0x56')],{})[_0xcbe2('0x21')](function(_0xc289bd){var _0x1300aa=_0x3ffc89['user'][_0xcbe2('0x36')]({'plain':!![]});if(!_0x1300aa)throw new Error(_0xcbe2('0x57'));if(_0x1300aa[_0xcbe2('0x58')]===_0xcbe2('0x59')){var _0x3c3a96=_0xc289bd[_0xcbe2('0x36')]({'plain':!![]});var _0x54c055='ChatQueues';return db[_0xcbe2('0x5a')][_0xcbe2('0x5b')]({'where':{'name':_0x54c055,'userProfileId':_0x1300aa[_0xcbe2('0x5c')]},'raw':!![]})[_0xcbe2('0x21')](function(_0x47f9c6){if(_0x47f9c6&&_0x47f9c6[_0xcbe2('0x5d')]===0x0){return db[_0xcbe2('0x38')][_0xcbe2('0x55')]({'name':_0x3c3a96[_0xcbe2('0x3a')],'resourceId':_0x3c3a96['id'],'type':_0x47f9c6[_0xcbe2('0x3a')],'sectionId':_0x47f9c6['id']},{})['then'](function(){return _0xc289bd;});}else{return _0xc289bd;}})[_0xcbe2('0x2b')](function(_0x12b7fd){logger['error'](_0xcbe2('0x5e'),_0x12b7fd);throw _0x12b7fd;});}return _0xc289bd;})[_0xcbe2('0x21')](respondWithResult(_0x4f623c,0xc9))['catch'](handleError(_0x4f623c,null));};exports[_0xcbe2('0x35')]=function(_0x26a60b,_0x392803){if(_0x26a60b['body']['id']){delete _0x26a60b[_0xcbe2('0x56')]['id'];}return db['ChatQueue'][_0xcbe2('0x5b')]({'where':{'id':_0x26a60b[_0xcbe2('0x53')]['id']}})['then'](handleEntityNotFound(_0x392803,null))[_0xcbe2('0x21')](saveUpdates(_0x26a60b['body'],null))['then'](respondWithResult(_0x392803,null))[_0xcbe2('0x2b')](handleError(_0x392803,null));};exports['destroy']=function(_0x58c863,_0x4cbbf0){return db['ChatQueue'][_0xcbe2('0x5b')]({'where':{'id':_0x58c863[_0xcbe2('0x53')]['id']}})[_0xcbe2('0x21')](handleEntityNotFound(_0x4cbbf0,null))[_0xcbe2('0x21')](removeEntity(_0x4cbbf0,null))[_0xcbe2('0x2b')](handleError(_0x4cbbf0,null));};exports['describe']=function(_0x38ce75,_0x518038){return db['ChatQueue'][_0xcbe2('0x5f')]()[_0xcbe2('0x21')](respondWithResult(_0x518038,null))[_0xcbe2('0x2b')](handleError(_0x518038,null));};exports[_0xcbe2('0x60')]=function(_0x1f4fc7,_0x2cb625,_0x43a454){var _0x342d71={'raw':!![],'where':{}},_0x368059={},_0x2f02fa;return db[_0xcbe2('0x3b')][_0xcbe2('0x61')]({'where':{'id':_0x1f4fc7[_0xcbe2('0x53')]['id']}})[_0xcbe2('0x21')](handleEntityNotFound(_0x2cb625,null))[_0xcbe2('0x21')](function(_0x3c4d7b){if(_0x3c4d7b){_0x2f02fa=_0x3c4d7b[_0xcbe2('0x36')]({'plain':!![]});_0x368059[_0xcbe2('0x40')]=_[_0xcbe2('0x42')](db[_0xcbe2('0x62')][_0xcbe2('0x3c')]);_0x368059[_0xcbe2('0x48')]=_[_0xcbe2('0x42')](_0x1f4fc7[_0xcbe2('0x48')]);_0x368059[_0xcbe2('0x43')]=_[_0xcbe2('0x45')](_0x368059[_0xcbe2('0x40')],_0x368059['query']);_0x342d71[_0xcbe2('0x44')]=_[_0xcbe2('0x45')](_0x368059[_0xcbe2('0x40')],qs['fields'](_0x1f4fc7[_0xcbe2('0x48')][_0xcbe2('0x46')]));_0x342d71[_0xcbe2('0x44')]=_0x342d71[_0xcbe2('0x44')][_0xcbe2('0x47')]?_0x342d71['attributes']:_0x368059[_0xcbe2('0x40')];if(!_0x1f4fc7['query'][_0xcbe2('0x49')]('nolimit')){_0x342d71[_0xcbe2('0x31')]=qs[_0xcbe2('0x31')](_0x1f4fc7[_0xcbe2('0x48')]['limit']);_0x342d71[_0xcbe2('0x30')]=qs[_0xcbe2('0x30')](_0x1f4fc7[_0xcbe2('0x48')][_0xcbe2('0x30')]);}_0x342d71[_0xcbe2('0x63')]=qs[_0xcbe2('0x64')](_0x1f4fc7[_0xcbe2('0x48')][_0xcbe2('0x64')]);_0x342d71[_0xcbe2('0x4a')]=qs['filters'](_[_0xcbe2('0x4b')](_0x1f4fc7[_0xcbe2('0x48')],_0x368059[_0xcbe2('0x43')]));_0x342d71[_0xcbe2('0x4a')][_0xcbe2('0x65')]=_0x3c4d7b['id'];if(_0x1f4fc7[_0xcbe2('0x48')][_0xcbe2('0x4c')]){_0x342d71[_0xcbe2('0x4a')]=_[_0xcbe2('0x4d')](_0x342d71['where'],{'$or':_[_0xcbe2('0x41')](_0x342d71[_0xcbe2('0x44')],function(_0x2085b2){var _0x494d0a={};_0x494d0a[_0x2085b2]={'$like':'%'+_0x1f4fc7['query'][_0xcbe2('0x4c')]+'%'};return _0x494d0a;})});}_0x342d71=_[_0xcbe2('0x4d')]({},_0x342d71,_0x1f4fc7[_0xcbe2('0x4f')]);return db[_0xcbe2('0x62')]['findAll'](_0x342d71);}})['then'](function(_0x3014c1){if(_0x3014c1){return db[_0xcbe2('0x66')][_0xcbe2('0x67')]({'where':{'id':_[_0xcbe2('0x41')](_0x3014c1,'UserId'),'role':_0xcbe2('0x68')},'attributes':['id',_0xcbe2('0x3a'),'chatPause',_0xcbe2('0x69'),_0xcbe2('0x6a')]});}})[_0xcbe2('0x21')](function(_0x2e6afa){if(_0x2e6afa){return{'count':_0x2e6afa[_0xcbe2('0x2f')],'rows':_['map'](_0x2e6afa[_0xcbe2('0x51')],function(_0x5d99e6){return{'membername':_0x5d99e6[_0xcbe2('0x3a')],'UserId':_0x5d99e6['id'],'queue_name':_0x2f02fa['name'],'ChatQueueId':_0x2f02fa['id'],'interface':util[_0xcbe2('0x6b')](_0xcbe2('0x6c'),_0xcbe2('0x6d'),_0x5d99e6['name']),'penalty':0x0,'paused':_0x5d99e6[_0xcbe2('0x6e')],'createdAt':_0x5d99e6[_0xcbe2('0x6a')],'updatedAt':_0x5d99e6[_0xcbe2('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xcbe2('0x21')](respondWithFilteredResult(_0x2cb625,_0x342d71))[_0xcbe2('0x2b')](handleError(_0x2cb625,null));};exports[_0xcbe2('0x6f')]=function(_0x2051e9,_0x41da66,_0x48157f){var _0x9a9aa8={};var _0x532dcc={};var _0x34c022;var _0x343162;return db[_0xcbe2('0x3b')][_0xcbe2('0x61')]({'where':{'id':_0x2051e9[_0xcbe2('0x53')]['id']}})[_0xcbe2('0x21')](handleEntityNotFound(_0x41da66,null))[_0xcbe2('0x21')](function(_0x560ae4){if(_0x560ae4){_0x34c022=_0x560ae4;_0x532dcc[_0xcbe2('0x40')]=_[_0xcbe2('0x42')](db[_0xcbe2('0x70')][_0xcbe2('0x3c')]);_0x532dcc[_0xcbe2('0x48')]=_['keys'](_0x2051e9[_0xcbe2('0x48')]);_0x532dcc[_0xcbe2('0x43')]=_[_0xcbe2('0x45')](_0x532dcc['model'],_0x532dcc[_0xcbe2('0x48')]);_0x9a9aa8['attributes']=_[_0xcbe2('0x45')](_0x532dcc['model'],qs[_0xcbe2('0x46')](_0x2051e9[_0xcbe2('0x48')][_0xcbe2('0x46')]));_0x9a9aa8[_0xcbe2('0x44')]=_0x9a9aa8['attributes'][_0xcbe2('0x47')]?_0x9a9aa8[_0xcbe2('0x44')]:_0x532dcc['model'];_0x9a9aa8[_0xcbe2('0x63')]=qs['sort'](_0x2051e9['query'][_0xcbe2('0x64')]);_0x9a9aa8[_0xcbe2('0x4a')]=qs['filters'](_[_0xcbe2('0x4b')](_0x2051e9['query'],_0x532dcc[_0xcbe2('0x43')]));if(_0x2051e9['query'][_0xcbe2('0x4c')]){_0x9a9aa8['where']=_[_0xcbe2('0x4d')](_0x9a9aa8[_0xcbe2('0x4a')],{'$or':_['map'](_0x9a9aa8[_0xcbe2('0x44')],function(_0x5bbb17){var _0xd6a348={};_0xd6a348[_0x5bbb17]={'$like':'%'+_0x2051e9[_0xcbe2('0x48')][_0xcbe2('0x4c')]+'%'};return _0xd6a348;})});}_0x9a9aa8=_[_0xcbe2('0x4d')]({},_0x9a9aa8,_0x2051e9[_0xcbe2('0x4f')]);return _0x34c022['getTeams'](_0x9a9aa8);}})[_0xcbe2('0x21')](function(_0x1ccff2){if(_0x1ccff2){_0x343162=_0x1ccff2[_0xcbe2('0x47')];if(!_0x2051e9[_0xcbe2('0x48')]['hasOwnProperty'](_0xcbe2('0x71'))){_0x9a9aa8['limit']=qs['limit'](_0x2051e9['query'][_0xcbe2('0x31')]);_0x9a9aa8[_0xcbe2('0x30')]=qs[_0xcbe2('0x30')](_0x2051e9[_0xcbe2('0x48')][_0xcbe2('0x30')]);}return _0x34c022[_0xcbe2('0x6f')](_0x9a9aa8);}})[_0xcbe2('0x21')](function(_0x5831f5){if(_0x5831f5){return _0x5831f5?{'count':_0x343162,'rows':_0x5831f5}:null;}})[_0xcbe2('0x21')](respondWithResult(_0x41da66,null))['catch'](handleError(_0x41da66,null));};exports[_0xcbe2('0x72')]=function(_0x1db9be,_0x5abf01,_0x9ebacb){var _0x50b3e8=_0x1db9be[_0xcbe2('0x56')][_0xcbe2('0x73')];return db[_0xcbe2('0x70')][_0xcbe2('0x50')]({'where':{'id':_0x50b3e8},'attributes':['id'],'include':[{'model':db[_0xcbe2('0x66')],'as':_0xcbe2('0x74'),'attributes':['id',_0xcbe2('0x3a'),_0xcbe2('0x75'),_0xcbe2('0x76'),'interface'],'raw':!![]}]})[_0xcbe2('0x21')](function(_0x21b4a3){if(_0x21b4a3){var _0x3f9b5e=_[_0xcbe2('0x77')](_0x21b4a3,function(_0x46e753){var _0x2cd4c5=_0x46e753[_0xcbe2('0x36')]({'plain':!![]});return _0x2cd4c5[_0xcbe2('0x74')];});return db['ChatQueue']['find']({'where':{'id':_0x1db9be['params']['id']}})[_0xcbe2('0x21')](function(_0x465736){return db[_0xcbe2('0x78')][_0xcbe2('0x79')](function(_0x37a305){return _0x465736['addTeams'](_0x50b3e8,{'transaction':_0x37a305})[_0xcbe2('0x21')](function(){return BPromise[_0xcbe2('0x7a')](_0x3f9b5e,function(_0x5b79eb){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x5b79eb['id'],'ChatQueueId':_0x1db9be[_0xcbe2('0x53')]['id']},'transaction':_0x37a305});});})[_0xcbe2('0x21')](function(){_0x3f9b5e['forEach'](function(_0x2d8340){socket[_0xcbe2('0x7b')]('userChatQueue:save',{'UserId':_0x2d8340['id'],'ChatQueueId':_0x465736['id']});});});});});}})[_0xcbe2('0x21')](respondWithStatusCode(_0x5abf01,null))['catch'](handleError(_0x5abf01,null));};exports[_0xcbe2('0x7c')]=function(_0x4771cb,_0x2ef90e,_0x387831){return db[_0xcbe2('0x70')][_0xcbe2('0x50')]({'where':{'id':_0x4771cb[_0xcbe2('0x48')]['ids']},'attributes':['id'],'include':[{'model':db[_0xcbe2('0x66')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xcbe2('0x21')](handleEntityNotFound(_0x2ef90e,null))[_0xcbe2('0x21')](function(_0x378dc6){var _0x357beb=_['map'](_0x378dc6,'id');var _0x1ac297=[];var _0x50f9ab=[];var _0x21ddec=squel['select']();_0x21ddec[_0xcbe2('0x7d')](_0xcbe2('0x7e'))[_0xcbe2('0x7f')](_0xcbe2('0x80'),'tq')[_0xcbe2('0x81')](_0xcbe2('0x82'),'ut',_0xcbe2('0x83'))[_0xcbe2('0x4a')](_0xcbe2('0x84'),_0x4771cb['params']['id']);for(var _0x427947=0x0;_0x427947<_0x378dc6[_0xcbe2('0x47')];_0x427947+=0x1){let _0xf4b6c1=_0x378dc6[_0x427947];for(var _0x7b0c0b=0x0;_0x7b0c0b<_0xf4b6c1[_0xcbe2('0x74')][_0xcbe2('0x47')];_0x7b0c0b+=0x1){let _0x371c65=_0xf4b6c1[_0xcbe2('0x74')][_0x7b0c0b];var _0x5c5435=_0x21ddec[_0xcbe2('0x85')]();_0x5c5435['where'](_0xcbe2('0x86'),_0x371c65['id']);_0x50f9ab[_0xcbe2('0x87')](db['sequelize'][_0xcbe2('0x48')](_0x5c5435['toString'](),{'type':db[_0xcbe2('0x78')][_0xcbe2('0x88')][_0xcbe2('0x89')]})[_0xcbe2('0x21')](function(_0x333e93){if(_0x333e93[_0xcbe2('0x47')]===0x1){return _0x371c65['id'];}else{var _0x3642ef=_['every'](_['map'](_0x333e93,_0xcbe2('0x8a')),function(_0x29b0b2){return _[_0xcbe2('0x8b')](_0x357beb,_0x29b0b2);});if(_0x3642ef){return _0x371c65['id'];}}}));}}return BPromise[_0xcbe2('0x8c')](_0x50f9ab)['then'](function(_0x180f1b){_0x1ac297=_(_0x1ac297)[_0xcbe2('0x8d')](_0x180f1b)[_0xcbe2('0x8e')]()[_0xcbe2('0x8f')]();return db[_0xcbe2('0x3b')][_0xcbe2('0x5b')]({'where':{'id':_0x4771cb[_0xcbe2('0x53')]['id']}})[_0xcbe2('0x21')](function(_0x2b8977){return db[_0xcbe2('0x78')]['transaction'](function(_0x2c8760){return _0x2b8977[_0xcbe2('0x7c')](_0x4771cb[_0xcbe2('0x48')][_0xcbe2('0x73')],{'transaction':_0x2c8760})['then'](function(){if(!_[_0xcbe2('0x90')](_0x1ac297)){return _0x2b8977['removeAgents'](_0x1ac297,{'transaction':_0x2c8760});}})[_0xcbe2('0x21')](function(){_0x1ac297[_0xcbe2('0x91')](function(_0x115fc0){socket[_0xcbe2('0x7b')](_0xcbe2('0x92'),{'UserId':_0x115fc0,'ChatQueueId':_0x2b8977['id']});});});});});});})[_0xcbe2('0x21')](respondWithStatusCode(_0x2ef90e,null))['catch'](handleError(_0x2ef90e,null));};exports[_0xcbe2('0x93')]=function(_0x5b34a9,_0x328617,_0x4c969d){return db[_0xcbe2('0x3b')]['find']({'where':{'id':_0x5b34a9[_0xcbe2('0x53')]['id']}})[_0xcbe2('0x21')](handleEntityNotFound(_0x328617,null))['then'](function(_0x520682){if(_0x520682){return _0x520682[_0xcbe2('0x93')](_0x5b34a9[_0xcbe2('0x56')][_0xcbe2('0x73')],_[_0xcbe2('0x94')](_0x5b34a9[_0xcbe2('0x56')],[_0xcbe2('0x73'),'id'])||{})[_0xcbe2('0x95')](function(_0x292139){for(var _0x443d26=0x0;_0x443d26<_0x5b34a9['body']['ids'][_0xcbe2('0x47')];_0x443d26+=0x1){socket[_0xcbe2('0x7b')](_0xcbe2('0x96'),{'UserId':_0x5b34a9[_0xcbe2('0x56')]['ids'][_0x443d26],'ChatQueueId':_0x5b34a9[_0xcbe2('0x53')]['id']});}return _0x292139;});}})['then'](respondWithResult(_0x328617,null))[_0xcbe2('0x2b')](handleError(_0x328617,null));};exports['removeAgents']=function(_0x37e543,_0x1b7dbe,_0x5b1e08){return db[_0xcbe2('0x3b')][_0xcbe2('0x5b')]({'where':{'id':_0x37e543[_0xcbe2('0x53')]['id']}})[_0xcbe2('0x21')](handleEntityNotFound(_0x1b7dbe,null))[_0xcbe2('0x21')](function(_0x5e3361){if(_0x5e3361){return _0x5e3361[_0xcbe2('0x97')](_0x37e543['query']['ids'])[_0xcbe2('0x21')](function(){if(_[_0xcbe2('0x98')](_0x37e543[_0xcbe2('0x48')]['ids'])){for(var _0x23ce94=0x0;_0x23ce94<_0x37e543[_0xcbe2('0x48')][_0xcbe2('0x73')][_0xcbe2('0x47')];_0x23ce94+=0x1){socket[_0xcbe2('0x7b')](_0xcbe2('0x92'),{'UserId':Number(_0x37e543[_0xcbe2('0x48')][_0xcbe2('0x73')][_0x23ce94]),'ChatQueueId':Number(_0x37e543[_0xcbe2('0x53')]['id'])});}}else{socket[_0xcbe2('0x7b')]('userChatQueue:remove',{'UserId':Number(_0x37e543[_0xcbe2('0x48')][_0xcbe2('0x73')]),'ChatQueueId':Number(_0x37e543['params']['id'])});}});}})[_0xcbe2('0x21')](respondWithStatusCode(_0x1b7dbe,null))[_0xcbe2('0x2b')](handleError(_0x1b7dbe,null));};exports[_0xcbe2('0x99')]=function(_0x359383,_0x2d0a6c,_0x45926c){var _0x114e99={};var _0x459367={};var _0x1f9838;var _0x1bba8e;return db[_0xcbe2('0x3b')][_0xcbe2('0x61')]({'where':{'id':_0x359383[_0xcbe2('0x53')]['id']}})[_0xcbe2('0x21')](handleEntityNotFound(_0x2d0a6c,null))[_0xcbe2('0x21')](function(_0x5aca3f){if(_0x5aca3f){_0x1f9838=_0x5aca3f;_0x459367[_0xcbe2('0x40')]=_['keys'](db[_0xcbe2('0x66')][_0xcbe2('0x3c')]);_0x459367[_0xcbe2('0x48')]=_[_0xcbe2('0x42')](_0x359383[_0xcbe2('0x48')]);_0x459367[_0xcbe2('0x43')]=_['intersection'](_0x459367[_0xcbe2('0x40')],_0x459367[_0xcbe2('0x48')]);_0x114e99[_0xcbe2('0x44')]=_[_0xcbe2('0x45')](_0x459367[_0xcbe2('0x40')],qs[_0xcbe2('0x46')](_0x359383['query'][_0xcbe2('0x46')]));_0x114e99[_0xcbe2('0x44')]=_0x114e99['attributes'][_0xcbe2('0x47')]?_0x114e99[_0xcbe2('0x44')]:_0x459367[_0xcbe2('0x40')];_0x114e99[_0xcbe2('0x63')]=qs[_0xcbe2('0x64')](_0x359383[_0xcbe2('0x48')][_0xcbe2('0x64')]);_0x114e99[_0xcbe2('0x4a')]=qs[_0xcbe2('0x43')](_[_0xcbe2('0x4b')](_0x359383['query'],_0x459367[_0xcbe2('0x43')]));if(_0x359383[_0xcbe2('0x48')][_0xcbe2('0x4c')]){_0x114e99[_0xcbe2('0x4a')]=_[_0xcbe2('0x4d')](_0x114e99['where'],{'$or':_[_0xcbe2('0x41')](_0x114e99[_0xcbe2('0x44')],function(_0x4c0f3a){var _0x2f70b8={};_0x2f70b8[_0x4c0f3a]={'$like':'%'+_0x359383[_0xcbe2('0x48')]['filter']+'%'};return _0x2f70b8;})});}_0x114e99=_[_0xcbe2('0x4d')]({},_0x114e99,_0x359383[_0xcbe2('0x4f')]);return _0x1f9838[_0xcbe2('0x99')](_0x114e99);}})[_0xcbe2('0x21')](function(_0x2b0a0e){if(_0x2b0a0e){_0x1bba8e=_0x2b0a0e[_0xcbe2('0x47')];if(!_0x359383['query'][_0xcbe2('0x49')](_0xcbe2('0x71'))){_0x114e99[_0xcbe2('0x31')]=qs[_0xcbe2('0x31')](_0x359383['query'][_0xcbe2('0x31')]);_0x114e99[_0xcbe2('0x30')]=qs[_0xcbe2('0x30')](_0x359383[_0xcbe2('0x48')][_0xcbe2('0x30')]);}return _0x1f9838[_0xcbe2('0x99')](_0x114e99);}})['then'](function(_0x26cf84){if(_0x26cf84){return _0x26cf84?{'count':_0x1bba8e,'rows':_0x26cf84}:null;}})[_0xcbe2('0x21')](respondWithResult(_0x2d0a6c,null))[_0xcbe2('0x2b')](handleError(_0x2d0a6c,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 7ef86c6..514a794 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 _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x91d3cf,_0x8ee4b5){var _0x3715ef=function(_0x50f4d7){while(--_0x50f4d7){_0x91d3cf['push'](_0x91d3cf['shift']());}};_0x3715ef(++_0x8ee4b5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x516f71,_0x38fc8b){_0x516f71=_0x516f71-0x0;var _0x4707b0=_0x5f2f[_0x516f71];return _0x4707b0;};'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 +var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0xce4af8,_0x7568bd){var _0x8849c6=function(_0x5d2a96){while(--_0x5d2a96){_0xce4af8['push'](_0xce4af8['shift']());}};_0x8849c6(++_0x7568bd);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5edf3a,_0x27276c){_0x5edf3a=_0x5edf3a-0x0;var _0x3236f9=_0x5f2f[_0x5edf3a];return _0x3236f9;};'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 e7ede0a..1787866 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 _0x1f23=['moment','request-promise','path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger'];(function(_0x310489,_0x142a75){var _0x436a69=function(_0xa06d7a){while(--_0xa06d7a){_0x310489['push'](_0x310489['shift']());}};_0x436a69(++_0x142a75);}(_0x1f23,0x1e7));var _0x31f2=function(_0x388440,_0x4699fa){_0x388440=_0x388440-0x0;var _0x16e634=_0x1f23[_0x388440];return _0x16e634;};'use strict';var _=require(_0x31f2('0x0'));var util=require(_0x31f2('0x1'));var logger=require(_0x31f2('0x2'))('api');var moment=require(_0x31f2('0x3'));var BPromise=require('bluebird');var rp=require(_0x31f2('0x4'));var fs=require('fs');var path=require(_0x31f2('0x5'));var rimraf=require(_0x31f2('0x6'));var config=require(_0x31f2('0x7'));var attributes=require('./chatQueue.attributes');module[_0x31f2('0x8')]=function(_0x51c702,_0x46ba9a){return _0x51c702[_0x31f2('0x9')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x31bc=['../../config/environment','./chatQueue.attributes','exports','chat_queues','../../config/logger','api','moment','path'];(function(_0xab4799,_0x1f4c07){var _0x131c16=function(_0x4de772){while(--_0x4de772){_0xab4799['push'](_0xab4799['shift']());}};_0x131c16(++_0x1f4c07);}(_0x31bc,0x114));var _0xc31b=function(_0x5c538e,_0x5d4b90){_0x5c538e=_0x5c538e-0x0;var _0x3da2f6=_0x31bc[_0x5c538e];return _0x3da2f6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc31b('0x0'))(_0xc31b('0x1'));var moment=require(_0xc31b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc31b('0x3'));var rimraf=require('rimraf');var config=require(_0xc31b('0x4'));var attributes=require(_0xc31b('0x5'));module[_0xc31b('0x6')]=function(_0x17e0fd,_0x3ad3fb){return _0x17e0fd['define']('ChatQueue',attributes,{'tableName':_0xc31b('0x7'),'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 72e0d53..bd245a8 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 _0x5950=['model','map','debug','catch','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','./chatQueue.socket','register','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','include','attributes'];(function(_0x395f63,_0x2cfb5f){var _0x580f5c=function(_0x5ebbbf){while(--_0x5ebbbf){_0x395f63['push'](_0x395f63['shift']());}};_0x580f5c(++_0x2cfb5f);}(_0x5950,0x11e));var _0x0595=function(_0x2524d1,_0x4d8490){_0x2524d1=_0x2524d1-0x0;var _0x4fe978=_0x5950[_0x2524d1];return _0x4fe978;};'use strict';var _=require(_0x0595('0x0'));var util=require(_0x0595('0x1'));var moment=require(_0x0595('0x2'));var BPromise=require(_0x0595('0x3'));var rs=require(_0x0595('0x4'));var fs=require('fs');var Redis=require(_0x0595('0x5'));var db=require(_0x0595('0x6'))['db'];var utils=require(_0x0595('0x7'));var logger=require(_0x0595('0x8'))(_0x0595('0x9'));var config=require(_0x0595('0xa'));var jayson=require(_0x0595('0xb'));var client=jayson[_0x0595('0xc')]['http']({'port':0x232a});config['redis']=_[_0x0595('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0595('0xe')]));require(_0x0595('0xf'))[_0x0595('0x10')](socket);function respondWithRpcPromise(_0x56c464,_0x58c6f5,_0x141c3f){return new BPromise(function(_0x4e4313,_0xb04683){return client['request'](_0x56c464,_0x141c3f)[_0x0595('0x11')](function(_0x5db2eb){logger['info'](_0x0595('0x12'),_0x58c6f5,_0x0595('0x13'));logger['debug'](_0x0595('0x14'),_0x58c6f5,'request\x20sent',JSON[_0x0595('0x15')](_0x5db2eb));if(_0x5db2eb[_0x0595('0x16')]){if(_0x5db2eb['error']['code']===0x1f4){logger[_0x0595('0x16')]('ChatQueue,\x20%s,\x20%s',_0x58c6f5,_0x5db2eb[_0x0595('0x16')][_0x0595('0x17')]);return _0xb04683(_0x5db2eb['error'][_0x0595('0x17')]);}logger[_0x0595('0x16')]('ChatQueue,\x20%s,\x20%s',_0x58c6f5,_0x5db2eb[_0x0595('0x16')][_0x0595('0x17')]);return _0x4e4313(_0x5db2eb[_0x0595('0x16')][_0x0595('0x17')]);}else{logger[_0x0595('0x18')](_0x0595('0x12'),_0x58c6f5,_0x0595('0x13'));_0x4e4313(_0x5db2eb['result'][_0x0595('0x17')]);}})['catch'](function(_0x44e9c7){logger['error']('ChatQueue,\x20%s,\x20%s',_0x58c6f5,_0x44e9c7);_0xb04683(_0x44e9c7);});});}exports[_0x0595('0x19')]=function(_0x5f2626){var _0x23a77c=this;return new Promise(function(_0x19437d,_0x2d8b17){return db[_0x0595('0x1a')][_0x0595('0x1b')]({'raw':_0x5f2626[_0x0595('0x1c')]?_0x5f2626[_0x0595('0x1c')][_0x0595('0x1d')]===undefined?!![]:![]:!![],'where':_0x5f2626[_0x0595('0x1c')]?_0x5f2626['options'][_0x0595('0x1e')]||null:null,'attributes':_0x5f2626[_0x0595('0x1c')]?_0x5f2626[_0x0595('0x1c')]['attributes']||null:null,'limit':_0x5f2626['options']?_0x5f2626[_0x0595('0x1c')][_0x0595('0x1f')]||null:null,'include':_0x5f2626[_0x0595('0x1c')]?_0x5f2626[_0x0595('0x1c')]['include']?_['map'](_0x5f2626[_0x0595('0x1c')][_0x0595('0x20')],function(_0x4153b4){return{'model':db[_0x4153b4['model']],'as':_0x4153b4['as'],'attributes':_0x4153b4[_0x0595('0x21')],'include':_0x4153b4['include']?_['map'](_0x4153b4[_0x0595('0x20')],function(_0x21ea1d){return{'model':db[_0x21ea1d[_0x0595('0x22')]],'as':_0x21ea1d['as'],'attributes':_0x21ea1d[_0x0595('0x21')],'include':_0x21ea1d[_0x0595('0x20')]?_[_0x0595('0x23')](_0x21ea1d[_0x0595('0x20')],function(_0x31abae){return{'model':db[_0x31abae['model']],'as':_0x31abae['as'],'attributes':_0x31abae[_0x0595('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x910032){logger[_0x0595('0x18')]('GetChatQueue',_0x5f2626);logger[_0x0595('0x24')]('GetChatQueue',_0x5f2626,JSON[_0x0595('0x15')](_0x910032));_0x19437d(_0x910032);})[_0x0595('0x25')](function(_0x1bad53){logger['error'](_0x0595('0x19'),_0x1bad53[_0x0595('0x17')],_0x5f2626);_0x2d8b17(_0x23a77c['error'](0x1f4,_0x1bad53[_0x0595('0x17')]));});});};exports[_0x0595('0x26')]=function(_0x2b6f43){var _0x48243b=this;return new Promise(function(_0x130d7e,_0x54075c){return db[_0x0595('0x1a')][_0x0595('0x27')]({'raw':_0x2b6f43[_0x0595('0x1c')]?_0x2b6f43['options'][_0x0595('0x1d')]===undefined?!![]:![]:!![],'where':_0x2b6f43[_0x0595('0x1c')]?_0x2b6f43[_0x0595('0x1c')][_0x0595('0x1e')]||null:null,'attributes':_0x2b6f43[_0x0595('0x1c')]?_0x2b6f43[_0x0595('0x1c')][_0x0595('0x21')]||null:null,'include':_0x2b6f43['options']?_0x2b6f43[_0x0595('0x1c')][_0x0595('0x20')]?_['map'](_0x2b6f43[_0x0595('0x1c')][_0x0595('0x20')],function(_0x2ac492){return{'model':db[_0x2ac492[_0x0595('0x22')]],'as':_0x2ac492['as'],'attributes':_0x2ac492[_0x0595('0x21')],'include':_0x2ac492[_0x0595('0x20')]?_[_0x0595('0x23')](_0x2ac492[_0x0595('0x20')],function(_0x3fec29){return{'model':db[_0x3fec29[_0x0595('0x22')]],'as':_0x3fec29['as'],'attributes':_0x3fec29['attributes'],'include':_0x3fec29[_0x0595('0x20')]?_[_0x0595('0x23')](_0x3fec29['include'],function(_0x253042){return{'model':db[_0x253042['model']],'as':_0x253042['as'],'attributes':_0x253042[_0x0595('0x21')]};}):[]};}):[]};}):[]:[]})[_0x0595('0x11')](function(_0x4f2ff1){logger['info'](_0x0595('0x26'),_0x2b6f43);logger[_0x0595('0x24')]('ShowChatQueue',_0x2b6f43,JSON['stringify'](_0x4f2ff1));_0x130d7e(_0x4f2ff1);})[_0x0595('0x25')](function(_0x163f63){logger[_0x0595('0x16')](_0x0595('0x26'),_0x163f63[_0x0595('0x17')],_0x2b6f43);_0x54075c(_0x48243b['error'](0x1f4,_0x163f63[_0x0595('0x17')]));});});}; \ No newline at end of file +var _0x09b0=['limit','include','map','model','ShowChatQueue','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x09b0,0x1f3));var _0x009b=function(_0xe2f20e,_0x3adbd6){_0xe2f20e=_0xe2f20e-0x0;var _0x13b9c1=_0x09b0[_0xe2f20e];return _0x13b9c1;};'use strict';var _=require(_0x009b('0x0'));var util=require('util');var moment=require(_0x009b('0x1'));var BPromise=require('bluebird');var rs=require(_0x009b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x009b('0x3'));var logger=require(_0x009b('0x4'))(_0x009b('0x5'));var config=require('../../config/environment');var jayson=require(_0x009b('0x6'));var client=jayson[_0x009b('0x7')]['http']({'port':0x232a});config[_0x009b('0x8')]=_[_0x009b('0x9')](config[_0x009b('0x8')],{'host':_0x009b('0xa'),'port':0x18eb});var socket=require(_0x009b('0xb'))(new Redis(config[_0x009b('0x8')]));require(_0x009b('0xc'))[_0x009b('0xd')](socket);function respondWithRpcPromise(_0x25c45a,_0x2463e9,_0x1e5d18){return new BPromise(function(_0x3dd246,_0x20223f){return client[_0x009b('0xe')](_0x25c45a,_0x1e5d18)[_0x009b('0xf')](function(_0x5a977e){logger[_0x009b('0x10')](_0x009b('0x11'),_0x2463e9,_0x009b('0x12'));logger[_0x009b('0x13')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2463e9,'request\x20sent',JSON[_0x009b('0x14')](_0x5a977e));if(_0x5a977e[_0x009b('0x15')]){if(_0x5a977e[_0x009b('0x15')][_0x009b('0x16')]===0x1f4){logger[_0x009b('0x15')](_0x009b('0x11'),_0x2463e9,_0x5a977e['error']['message']);return _0x20223f(_0x5a977e[_0x009b('0x15')][_0x009b('0x17')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x2463e9,_0x5a977e['error'][_0x009b('0x17')]);return _0x3dd246(_0x5a977e[_0x009b('0x15')][_0x009b('0x17')]);}else{logger[_0x009b('0x10')](_0x009b('0x11'),_0x2463e9,_0x009b('0x12'));_0x3dd246(_0x5a977e[_0x009b('0x18')][_0x009b('0x17')]);}})[_0x009b('0x19')](function(_0x3a70ec){logger[_0x009b('0x15')]('ChatQueue,\x20%s,\x20%s',_0x2463e9,_0x3a70ec);_0x20223f(_0x3a70ec);});});}exports[_0x009b('0x1a')]=function(_0x27a6e2){var _0x5f57b5=this;return new Promise(function(_0x3d431b,_0x219442){return db[_0x009b('0x1b')][_0x009b('0x1c')]({'raw':_0x27a6e2['options']?_0x27a6e2[_0x009b('0x1d')][_0x009b('0x1e')]===undefined?!![]:![]:!![],'where':_0x27a6e2[_0x009b('0x1d')]?_0x27a6e2[_0x009b('0x1d')][_0x009b('0x1f')]||null:null,'attributes':_0x27a6e2[_0x009b('0x1d')]?_0x27a6e2[_0x009b('0x1d')][_0x009b('0x20')]||null:null,'limit':_0x27a6e2[_0x009b('0x1d')]?_0x27a6e2['options'][_0x009b('0x21')]||null:null,'include':_0x27a6e2[_0x009b('0x1d')]?_0x27a6e2[_0x009b('0x1d')][_0x009b('0x22')]?_[_0x009b('0x23')](_0x27a6e2[_0x009b('0x1d')][_0x009b('0x22')],function(_0x2834fe){return{'model':db[_0x2834fe[_0x009b('0x24')]],'as':_0x2834fe['as'],'attributes':_0x2834fe[_0x009b('0x20')],'include':_0x2834fe[_0x009b('0x22')]?_['map'](_0x2834fe['include'],function(_0x3d986e){return{'model':db[_0x3d986e[_0x009b('0x24')]],'as':_0x3d986e['as'],'attributes':_0x3d986e[_0x009b('0x20')],'include':_0x3d986e[_0x009b('0x22')]?_[_0x009b('0x23')](_0x3d986e['include'],function(_0x4d3728){return{'model':db[_0x4d3728['model']],'as':_0x4d3728['as'],'attributes':_0x4d3728[_0x009b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x009b('0xf')](function(_0x144475){logger[_0x009b('0x10')](_0x009b('0x1a'),_0x27a6e2);logger[_0x009b('0x13')](_0x009b('0x1a'),_0x27a6e2,JSON[_0x009b('0x14')](_0x144475));_0x3d431b(_0x144475);})[_0x009b('0x19')](function(_0x1c1e5d){logger[_0x009b('0x15')](_0x009b('0x1a'),_0x1c1e5d[_0x009b('0x17')],_0x27a6e2);_0x219442(_0x5f57b5[_0x009b('0x15')](0x1f4,_0x1c1e5d[_0x009b('0x17')]));});});};exports['ShowChatQueue']=function(_0xd47903){var _0x61d2ae=this;return new Promise(function(_0x44c97b,_0x11a789){return db[_0x009b('0x1b')]['find']({'raw':_0xd47903[_0x009b('0x1d')]?_0xd47903[_0x009b('0x1d')][_0x009b('0x1e')]===undefined?!![]:![]:!![],'where':_0xd47903[_0x009b('0x1d')]?_0xd47903['options'][_0x009b('0x1f')]||null:null,'attributes':_0xd47903[_0x009b('0x1d')]?_0xd47903['options'][_0x009b('0x20')]||null:null,'include':_0xd47903[_0x009b('0x1d')]?_0xd47903['options'][_0x009b('0x22')]?_['map'](_0xd47903[_0x009b('0x1d')][_0x009b('0x22')],function(_0xa12093){return{'model':db[_0xa12093['model']],'as':_0xa12093['as'],'attributes':_0xa12093[_0x009b('0x20')],'include':_0xa12093[_0x009b('0x22')]?_['map'](_0xa12093[_0x009b('0x22')],function(_0x116c49){return{'model':db[_0x116c49[_0x009b('0x24')]],'as':_0x116c49['as'],'attributes':_0x116c49['attributes'],'include':_0x116c49[_0x009b('0x22')]?_['map'](_0x116c49[_0x009b('0x22')],function(_0x1c34a8){return{'model':db[_0x1c34a8['model']],'as':_0x1c34a8['as'],'attributes':_0x1c34a8[_0x009b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x009b('0xf')](function(_0xa5313a){logger['info'](_0x009b('0x25'),_0xd47903);logger[_0x009b('0x13')](_0x009b('0x25'),_0xd47903,JSON[_0x009b('0x14')](_0xa5313a));_0x44c97b(_0xa5313a);})[_0x009b('0x19')](function(_0x1a30d1){logger[_0x009b('0x15')](_0x009b('0x25'),_0x1a30d1[_0x009b('0x17')],_0xd47903);_0x11a789(_0x61d2ae[_0x009b('0x15')](0x1f4,_0x1a30d1['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 6f10807..6424031 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 _0xbaf0=['removeListener','register','length','chatQueue:','save','remove','update'];(function(_0x4c406a,_0x22fed9){var _0x332aaf=function(_0x101190){while(--_0x101190){_0x4c406a['push'](_0x4c406a['shift']());}};_0x332aaf(++_0x22fed9);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var ChatQueueEvents=require('./chatQueue.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(){ChatQueueEvents[_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);ChatQueueEvents['on'](_0x1d0a0d,_0x5f5030);}}; \ No newline at end of file +var _0xbaf0=['removeListener','register','length','chatQueue:','save','remove','update'];(function(_0x3c7876,_0xfb67c2){var _0x265ebe=function(_0x10673f){while(--_0x10673f){_0x3c7876['push'](_0x3c7876['shift']());}};_0x265ebe(++_0xfb67c2);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var ChatQueueEvents=require('./chatQueue.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(){ChatQueueEvents[_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);ChatQueueEvents['on'](_0x1d0a0d,_0x5f5030);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 08c403d..90f8a07 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 _0xbc26=['/:id','show','/:id/members','getMembers','getTeams','/:id/users','create','/:id/teams','addTeams','post','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','get','isAuthenticated','index','/describe','describe'];(function(_0x52bb76,_0x325703){var _0x2f2f21=function(_0x888a73){while(--_0x888a73){_0x52bb76['push'](_0x52bb76['shift']());}};_0x2f2f21(++_0x325703);}(_0xbc26,0x1a5));var _0x6bc2=function(_0x62f044,_0x47f8df){_0x62f044=_0x62f044-0x0;var _0x1b2d7b=_0xbc26[_0x62f044];return _0x1b2d7b;};'use strict';var multer=require(_0x6bc2('0x0'));var util=require(_0x6bc2('0x1'));var path=require(_0x6bc2('0x2'));var timeout=require('connect-timeout');var express=require(_0x6bc2('0x3'));var router=express[_0x6bc2('0x4')]();var auth=require(_0x6bc2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatQueue.controller');router[_0x6bc2('0x6')]('/',auth[_0x6bc2('0x7')](),controller[_0x6bc2('0x8')]);router[_0x6bc2('0x6')](_0x6bc2('0x9'),auth[_0x6bc2('0x7')](),controller[_0x6bc2('0xa')]);router['get'](_0x6bc2('0xb'),auth[_0x6bc2('0x7')](),controller[_0x6bc2('0xc')]);router[_0x6bc2('0x6')](_0x6bc2('0xd'),auth[_0x6bc2('0x7')](),controller[_0x6bc2('0xe')]);router[_0x6bc2('0x6')]('/:id/teams',auth['isAuthenticated'](),controller[_0x6bc2('0xf')]);router[_0x6bc2('0x6')](_0x6bc2('0x10'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x6bc2('0x11')]);router['post'](_0x6bc2('0x12'),auth[_0x6bc2('0x7')](),controller[_0x6bc2('0x13')]);router[_0x6bc2('0x14')]('/:id/users',auth[_0x6bc2('0x7')](),controller['addAgents']);router['put'](_0x6bc2('0xb'),auth[_0x6bc2('0x7')](),controller[_0x6bc2('0x15')]);router[_0x6bc2('0x16')](_0x6bc2('0xb'),auth[_0x6bc2('0x7')](),controller[_0x6bc2('0x17')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x6bc2('0x18')]);router[_0x6bc2('0x16')](_0x6bc2('0x10'),auth['isAuthenticated'](),controller[_0x6bc2('0x19')]);module[_0x6bc2('0x1a')]=router; \ No newline at end of file +var _0x99b9=['create','put','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','post'];(function(_0x13187a,_0x2fcec4){var _0x65b85f=function(_0x33bf1f){while(--_0x33bf1f){_0x13187a['push'](_0x13187a['shift']());}};_0x65b85f(++_0x2fcec4);}(_0x99b9,0x116));var _0x999b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x99b9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x999b('0x0'));var util=require(_0x999b('0x1'));var path=require('path');var timeout=require(_0x999b('0x2'));var express=require(_0x999b('0x3'));var router=express[_0x999b('0x4')]();var auth=require(_0x999b('0x5'));var interaction=require(_0x999b('0x6'));var config=require(_0x999b('0x7'));var controller=require('./chatQueue.controller');router[_0x999b('0x8')]('/',auth['isAuthenticated'](),controller[_0x999b('0x9')]);router[_0x999b('0x8')]('/describe',auth[_0x999b('0xa')](),controller[_0x999b('0xb')]);router[_0x999b('0x8')](_0x999b('0xc'),auth[_0x999b('0xa')](),controller[_0x999b('0xd')]);router[_0x999b('0x8')](_0x999b('0xe'),auth[_0x999b('0xa')](),controller[_0x999b('0xf')]);router[_0x999b('0x8')](_0x999b('0x10'),auth[_0x999b('0xa')](),controller[_0x999b('0x11')]);router[_0x999b('0x8')]('/:id/users',auth[_0x999b('0xa')](),controller['getAgents']);router[_0x999b('0x12')]('/',auth[_0x999b('0xa')](),controller[_0x999b('0x13')]);router['post'](_0x999b('0x10'),auth[_0x999b('0xa')](),controller['addTeams']);router[_0x999b('0x12')]('/:id/users',auth[_0x999b('0xa')](),controller['addAgents']);router[_0x999b('0x14')](_0x999b('0xc'),auth[_0x999b('0xa')](),controller[_0x999b('0x15')]);router['delete'](_0x999b('0xc'),auth['isAuthenticated'](),controller[_0x999b('0x16')]);router[_0x999b('0x17')]('/:id/teams',auth[_0x999b('0xa')](),controller[_0x999b('0x18')]);router[_0x999b('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0x999b('0x19')]);module[_0x999b('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index dda224b..c0bf73c 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 _0x50c5=['DATE','sequelize','STRING'];(function(_0x464510,_0x32d71f){var _0x98d71e=function(_0x4bbecc){while(--_0x4bbecc){_0x464510['push'](_0x464510['shift']());}};_0x98d71e(++_0x32d71f);}(_0x50c5,0xc1));var _0x550c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x50c5[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require(_0x550c('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x550c('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x550c('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x550c('0x2')]},'reason':{'type':Sequelize[_0x550c('0x1')]}}; \ No newline at end of file +var _0x69fd=['moment','exports','STRING','DATE'];(function(_0x1aeda2,_0x1217eb){var _0x32dc6d=function(_0x34a460){while(--_0x34a460){_0x1aeda2['push'](_0x1aeda2['shift']());}};_0x32dc6d(++_0x1217eb);}(_0x69fd,0x90));var _0xd69f=function(_0x32039b,_0x399c59){_0x32039b=_0x32039b-0x0;var _0x25c7ae=_0x69fd[_0x32039b];return _0x25c7ae;};'use strict';var moment=require(_0xd69f('0x0'));var Sequelize=require('sequelize');module[_0xd69f('0x1')]={'uniqueid':{'type':Sequelize[_0xd69f('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd69f('0x2')]},'joinAt':{'type':Sequelize[_0xd69f('0x3')]},'leaveAt':{'type':Sequelize[_0xd69f('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xd69f('0x3')]},'reason':{'type':Sequelize[_0xd69f('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 01e65af..a1177af 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 _0xe772=['index','map','ChatQueueReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','send'];(function(_0x803e24,_0x3b4793){var _0x5efc2c=function(_0x1a9d71){while(--_0x1a9d71){_0x803e24['push'](_0x803e24['shift']());}};_0x5efc2c(++_0x3b4793);}(_0xe772,0x199));var _0x2e77=function(_0x53417c,_0x126dee){_0x53417c=_0x53417c-0x0;var _0x49407d=_0xe772[_0x53417c];return _0x49407d;};'use strict';var pdf=require(_0x2e77('0x0'));var emlformat=require(_0x2e77('0x1'));var rimraf=require(_0x2e77('0x2'));var zipdir=require(_0x2e77('0x3'));var jsonpatch=require(_0x2e77('0x4'));var rp=require(_0x2e77('0x5'));var moment=require('moment');var BPromise=require(_0x2e77('0x6'));var Mustache=require(_0x2e77('0x7'));var util=require('util');var path=require(_0x2e77('0x8'));var sox=require(_0x2e77('0x9'));var csv=require('to-csv');var ejs=require(_0x2e77('0xa'));var fs=require('fs');var _=require(_0x2e77('0xb'));var squel=require('squel');var crypto=require(_0x2e77('0xc'));var jsforce=require(_0x2e77('0xd'));var deskjs=require(_0x2e77('0xe'));var toCsv=require(_0x2e77('0xf'));var querystring=require('querystring');var Papa=require(_0x2e77('0x10'));var Redis=require(_0x2e77('0x11'));var authService=require(_0x2e77('0x12'));var qs=require(_0x2e77('0x13'));var as=require(_0x2e77('0x14'));var hardwareService=require(_0x2e77('0x15'));var logger=require(_0x2e77('0x16'))(_0x2e77('0x17'));var utils=require(_0x2e77('0x18'));var config=require(_0x2e77('0x19'));var db=require(_0x2e77('0x1a'))['db'];function respondWithStatusCode(_0x5cd5b3,_0x3c0195){_0x3c0195=_0x3c0195||0xcc;return function(_0x5a579c){if(_0x5a579c){return _0x5cd5b3['sendStatus'](_0x3c0195);}return _0x5cd5b3[_0x2e77('0x1b')](_0x3c0195)[_0x2e77('0x1c')]();};}function respondWithResult(_0x2ac260,_0x557a60){_0x557a60=_0x557a60||0xc8;return function(_0x1d02b3){if(_0x1d02b3){return _0x2ac260[_0x2e77('0x1b')](_0x557a60)['json'](_0x1d02b3);}};}function respondWithFilteredResult(_0x1f56e8,_0x2ef320){return function(_0x2d8972){if(_0x2d8972){var _0x4e0d4d=_0x2d8972['count'],_0xa1bfa1=_0x2ef320[_0x2e77('0x1d')],_0x3504fd=_0x2ef320[_0x2e77('0x1d')]+_0x2ef320[_0x2e77('0x1e')],_0x26d63b;if(_0x3504fd>=_0x4e0d4d){_0x3504fd=_0x4e0d4d;_0x26d63b=0xc8;}else{_0x26d63b=0xce;}_0x1f56e8['status'](_0x26d63b);return _0x1f56e8[_0x2e77('0x1f')](_0x2e77('0x20'),_0xa1bfa1+'-'+_0x3504fd+'/'+_0x4e0d4d)['json'](_0x2d8972);}return null;};}function patchUpdates(_0x2ee3d5){return function(_0x2333f5){try{jsonpatch[_0x2e77('0x21')](_0x2333f5,_0x2ee3d5,!![]);}catch(_0x3e135e){return BPromise[_0x2e77('0x22')](_0x3e135e);}return _0x2333f5['save']();};}function saveUpdates(_0x3b6a89,_0x532792){return function(_0xa96908){if(_0xa96908){return _0xa96908[_0x2e77('0x23')](_0x3b6a89)[_0x2e77('0x24')](function(_0x591e40){return _0x591e40;});}return null;};}function removeEntity(_0x13328e,_0x57260c){return function(_0x114fe7){if(_0x114fe7){return _0x114fe7[_0x2e77('0x25')]()[_0x2e77('0x24')](function(){_0x13328e['status'](0xcc)[_0x2e77('0x1c')]();});}};}function handleEntityNotFound(_0x37f3a7,_0x382f0d){return function(_0x5833e0){if(!_0x5833e0){_0x37f3a7['sendStatus'](0x194);}return _0x5833e0;};}function handleError(_0x41b21e,_0x1208bc){_0x1208bc=_0x1208bc||0x1f4;return function(_0x1f160e){logger['error'](_0x1f160e[_0x2e77('0x26')]);if(_0x1f160e[_0x2e77('0x27')]){delete _0x1f160e[_0x2e77('0x27')];}_0x41b21e[_0x2e77('0x1b')](_0x1208bc)[_0x2e77('0x28')](_0x1f160e);};}exports[_0x2e77('0x29')]=function(_0x83d15c,_0x5f3908){var _0x24dddd={},_0x597788={},_0x52cf21={'count':0x0,'rows':[]};var _0x493753=_[_0x2e77('0x2a')](db[_0x2e77('0x2b')]['rawAttributes'],function(_0x286325){return{'name':_0x286325[_0x2e77('0x2c')],'type':_0x286325[_0x2e77('0x2d')][_0x2e77('0x2e')]};});_0x597788[_0x2e77('0x2f')]=_[_0x2e77('0x2a')](_0x493753,_0x2e77('0x27'));_0x597788[_0x2e77('0x30')]=_[_0x2e77('0x31')](_0x83d15c[_0x2e77('0x30')]);_0x597788[_0x2e77('0x32')]=_[_0x2e77('0x33')](_0x597788[_0x2e77('0x2f')],_0x597788['query']);_0x24dddd[_0x2e77('0x34')]=_['intersection'](_0x597788[_0x2e77('0x2f')],qs[_0x2e77('0x35')](_0x83d15c[_0x2e77('0x30')][_0x2e77('0x35')]));_0x24dddd[_0x2e77('0x34')]=_0x24dddd[_0x2e77('0x34')][_0x2e77('0x36')]?_0x24dddd[_0x2e77('0x34')]:_0x597788['model'];if(!_0x83d15c[_0x2e77('0x30')]['hasOwnProperty'](_0x2e77('0x37'))){_0x24dddd['limit']=qs['limit'](_0x83d15c['query']['limit']);_0x24dddd[_0x2e77('0x1d')]=qs[_0x2e77('0x1d')](_0x83d15c[_0x2e77('0x30')][_0x2e77('0x1d')]);}_0x24dddd[_0x2e77('0x38')]=qs[_0x2e77('0x39')](_0x83d15c[_0x2e77('0x30')][_0x2e77('0x39')]);_0x24dddd[_0x2e77('0x3a')]=qs['filters'](_[_0x2e77('0x3b')](_0x83d15c[_0x2e77('0x30')],_0x597788[_0x2e77('0x32')]));if(_0x83d15c['query'][_0x2e77('0x3c')]){_0x24dddd[_0x2e77('0x3a')]=_[_0x2e77('0x3d')](_0x24dddd[_0x2e77('0x3a')],{'$or':_[_0x2e77('0x2a')](_0x493753,function(_0x554a82){if(_0x554a82[_0x2e77('0x2d')]!==_0x2e77('0x3e')){var _0x5452d5={};_0x5452d5[_0x554a82[_0x2e77('0x27')]]={'$like':'%'+_0x83d15c[_0x2e77('0x30')]['filter']+'%'};return _0x5452d5;}})});}_0x24dddd=_[_0x2e77('0x3d')]({},_0x24dddd,_0x83d15c['options']);var _0x4db443={'where':_0x24dddd['where']};return db[_0x2e77('0x2b')][_0x2e77('0x3f')](_0x4db443)['then'](function(_0x31aff7){_0x52cf21[_0x2e77('0x3f')]=_0x31aff7;if(_0x83d15c[_0x2e77('0x30')][_0x2e77('0x40')]){_0x24dddd[_0x2e77('0x41')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x2e77('0x42')](_0x24dddd);})[_0x2e77('0x24')](function(_0x44ae43){_0x52cf21[_0x2e77('0x43')]=_0x44ae43;return _0x52cf21;})[_0x2e77('0x24')](respondWithFilteredResult(_0x5f3908,_0x24dddd))[_0x2e77('0x44')](handleError(_0x5f3908,null));};exports['show']=function(_0x4e96ac,_0x1117e0){var _0xd2f33={'raw':!![],'where':{'id':_0x4e96ac[_0x2e77('0x45')]['id']}},_0x10457d={};_0x10457d[_0x2e77('0x2f')]=_['keys'](db[_0x2e77('0x2b')][_0x2e77('0x46')]);_0x10457d[_0x2e77('0x30')]=_['keys'](_0x4e96ac[_0x2e77('0x30')]);_0x10457d[_0x2e77('0x32')]=_['intersection'](_0x10457d[_0x2e77('0x2f')],_0x10457d[_0x2e77('0x30')]);_0xd2f33[_0x2e77('0x34')]=_[_0x2e77('0x33')](_0x10457d[_0x2e77('0x2f')],qs[_0x2e77('0x35')](_0x4e96ac[_0x2e77('0x30')][_0x2e77('0x35')]));_0xd2f33[_0x2e77('0x34')]=_0xd2f33['attributes'][_0x2e77('0x36')]?_0xd2f33[_0x2e77('0x34')]:_0x10457d['model'];if(_0x4e96ac[_0x2e77('0x30')][_0x2e77('0x40')]){_0xd2f33[_0x2e77('0x41')]=[{'all':!![]}];}_0xd2f33=_[_0x2e77('0x3d')]({},_0xd2f33,_0x4e96ac['options']);return db[_0x2e77('0x2b')][_0x2e77('0x47')](_0xd2f33)[_0x2e77('0x24')](handleEntityNotFound(_0x1117e0,null))[_0x2e77('0x24')](respondWithResult(_0x1117e0,null))[_0x2e77('0x44')](handleError(_0x1117e0,null));};exports[_0x2e77('0x48')]=function(_0x18c168,_0xe18b4c){return db[_0x2e77('0x2b')]['create'](_0x18c168['body'],{})[_0x2e77('0x24')](respondWithResult(_0xe18b4c,0xc9))[_0x2e77('0x44')](handleError(_0xe18b4c,null));};exports[_0x2e77('0x23')]=function(_0x13680b,_0x2befcc){if(_0x13680b[_0x2e77('0x49')]['id']){delete _0x13680b[_0x2e77('0x49')]['id'];}return db[_0x2e77('0x2b')][_0x2e77('0x47')]({'where':{'id':_0x13680b[_0x2e77('0x45')]['id']}})[_0x2e77('0x24')](handleEntityNotFound(_0x2befcc,null))[_0x2e77('0x24')](saveUpdates(_0x13680b['body'],null))[_0x2e77('0x24')](respondWithResult(_0x2befcc,null))[_0x2e77('0x44')](handleError(_0x2befcc,null));};exports['destroy']=function(_0x5115d9,_0x25be57){return db[_0x2e77('0x2b')][_0x2e77('0x47')]({'where':{'id':_0x5115d9[_0x2e77('0x45')]['id']}})[_0x2e77('0x24')](handleEntityNotFound(_0x25be57,null))[_0x2e77('0x24')](removeEntity(_0x25be57,null))['catch'](handleError(_0x25be57,null));};exports['describe']=function(_0x5e5741,_0x1ef4a6){return db['ChatQueueReport'][_0x2e77('0x4a')]()[_0x2e77('0x24')](respondWithResult(_0x1ef4a6,null))['catch'](handleError(_0x1ef4a6,null));}; \ No newline at end of file +var _0x785e=['name','send','index','map','ChatQueueReport','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','params','rawAttributes','length','find','catch','create','body','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','end','error','stack'];(function(_0x467379,_0x2c8374){var _0x2a8d22=function(_0x2bf585){while(--_0x2bf585){_0x467379['push'](_0x467379['shift']());}};_0x2a8d22(++_0x2c8374);}(_0x785e,0xf8));var _0xe785=function(_0x322318,_0x276d64){_0x322318=_0x322318-0x0;var _0x59ce6f=_0x785e[_0x322318];return _0x59ce6f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe785('0x0'));var rimraf=require(_0xe785('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe785('0x2'));var moment=require('moment');var BPromise=require(_0xe785('0x3'));var Mustache=require(_0xe785('0x4'));var util=require(_0xe785('0x5'));var path=require(_0xe785('0x6'));var sox=require(_0xe785('0x7'));var csv=require(_0xe785('0x8'));var ejs=require(_0xe785('0x9'));var fs=require('fs');var _=require(_0xe785('0xa'));var squel=require(_0xe785('0xb'));var crypto=require(_0xe785('0xc'));var jsforce=require(_0xe785('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe785('0x8'));var querystring=require(_0xe785('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe785('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe785('0x10'));var hardwareService=require(_0xe785('0x11'));var logger=require(_0xe785('0x12'))(_0xe785('0x13'));var utils=require(_0xe785('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c3cee,_0x2f9535){_0x2f9535=_0x2f9535||0xcc;return function(_0xc5821e){if(_0xc5821e){return _0x2c3cee[_0xe785('0x15')](_0x2f9535);}return _0x2c3cee[_0xe785('0x16')](_0x2f9535)['end']();};}function respondWithResult(_0x32b082,_0x5affc4){_0x5affc4=_0x5affc4||0xc8;return function(_0x5fb7bd){if(_0x5fb7bd){return _0x32b082[_0xe785('0x16')](_0x5affc4)[_0xe785('0x17')](_0x5fb7bd);}};}function respondWithFilteredResult(_0x510321,_0x3fca6e){return function(_0x294048){if(_0x294048){var _0x24cbdf=_0x294048[_0xe785('0x18')],_0x798ad8=_0x3fca6e[_0xe785('0x19')],_0x5b33f5=_0x3fca6e[_0xe785('0x19')]+_0x3fca6e['limit'],_0x1f2e35;if(_0x5b33f5>=_0x24cbdf){_0x5b33f5=_0x24cbdf;_0x1f2e35=0xc8;}else{_0x1f2e35=0xce;}_0x510321['status'](_0x1f2e35);return _0x510321[_0xe785('0x1a')](_0xe785('0x1b'),_0x798ad8+'-'+_0x5b33f5+'/'+_0x24cbdf)['json'](_0x294048);}return null;};}function patchUpdates(_0x4c0918){return function(_0x493bbc){try{jsonpatch[_0xe785('0x1c')](_0x493bbc,_0x4c0918,!![]);}catch(_0x5151f6){return BPromise[_0xe785('0x1d')](_0x5151f6);}return _0x493bbc['save']();};}function saveUpdates(_0x21cf76,_0x250ff){return function(_0x3fd5b9){if(_0x3fd5b9){return _0x3fd5b9[_0xe785('0x1e')](_0x21cf76)[_0xe785('0x1f')](function(_0xb45299){return _0xb45299;});}return null;};}function removeEntity(_0x26a8d7,_0x3bf1ef){return function(_0x39b47f){if(_0x39b47f){return _0x39b47f[_0xe785('0x20')]()[_0xe785('0x1f')](function(){_0x26a8d7[_0xe785('0x16')](0xcc)[_0xe785('0x21')]();});}};}function handleEntityNotFound(_0x38fff4,_0x300f4c){return function(_0x31e306){if(!_0x31e306){_0x38fff4['sendStatus'](0x194);}return _0x31e306;};}function handleError(_0x51c557,_0x3c01f0){_0x3c01f0=_0x3c01f0||0x1f4;return function(_0x4a1b94){logger[_0xe785('0x22')](_0x4a1b94[_0xe785('0x23')]);if(_0x4a1b94[_0xe785('0x24')]){delete _0x4a1b94[_0xe785('0x24')];}_0x51c557[_0xe785('0x16')](_0x3c01f0)[_0xe785('0x25')](_0x4a1b94);};}exports[_0xe785('0x26')]=function(_0x3883b3,_0xa60842){var _0x3e9f64={},_0x51b9b3={},_0x4ba59a={'count':0x0,'rows':[]};var _0x5e5147=_[_0xe785('0x27')](db[_0xe785('0x28')]['rawAttributes'],function(_0x2cdd33){return{'name':_0x2cdd33[_0xe785('0x29')],'type':_0x2cdd33['type'][_0xe785('0x2a')]};});_0x51b9b3[_0xe785('0x2b')]=_[_0xe785('0x27')](_0x5e5147,'name');_0x51b9b3[_0xe785('0x2c')]=_[_0xe785('0x2d')](_0x3883b3['query']);_0x51b9b3[_0xe785('0x2e')]=_[_0xe785('0x2f')](_0x51b9b3[_0xe785('0x2b')],_0x51b9b3[_0xe785('0x2c')]);_0x3e9f64['attributes']=_[_0xe785('0x2f')](_0x51b9b3[_0xe785('0x2b')],qs['fields'](_0x3883b3[_0xe785('0x2c')][_0xe785('0x30')]));_0x3e9f64[_0xe785('0x31')]=_0x3e9f64['attributes']['length']?_0x3e9f64[_0xe785('0x31')]:_0x51b9b3[_0xe785('0x2b')];if(!_0x3883b3[_0xe785('0x2c')][_0xe785('0x32')](_0xe785('0x33'))){_0x3e9f64[_0xe785('0x34')]=qs[_0xe785('0x34')](_0x3883b3[_0xe785('0x2c')][_0xe785('0x34')]);_0x3e9f64[_0xe785('0x19')]=qs[_0xe785('0x19')](_0x3883b3['query'][_0xe785('0x19')]);}_0x3e9f64[_0xe785('0x35')]=qs[_0xe785('0x36')](_0x3883b3[_0xe785('0x2c')][_0xe785('0x36')]);_0x3e9f64['where']=qs[_0xe785('0x2e')](_['pick'](_0x3883b3[_0xe785('0x2c')],_0x51b9b3[_0xe785('0x2e')]));if(_0x3883b3['query'][_0xe785('0x37')]){_0x3e9f64[_0xe785('0x38')]=_[_0xe785('0x39')](_0x3e9f64['where'],{'$or':_[_0xe785('0x27')](_0x5e5147,function(_0x2f464c){if(_0x2f464c['type']!==_0xe785('0x3a')){var _0x202780={};_0x202780[_0x2f464c[_0xe785('0x24')]]={'$like':'%'+_0x3883b3[_0xe785('0x2c')][_0xe785('0x37')]+'%'};return _0x202780;}})});}_0x3e9f64=_['merge']({},_0x3e9f64,_0x3883b3[_0xe785('0x3b')]);var _0x5a66a1={'where':_0x3e9f64[_0xe785('0x38')]};return db[_0xe785('0x28')]['count'](_0x5a66a1)[_0xe785('0x1f')](function(_0x412777){_0x4ba59a['count']=_0x412777;if(_0x3883b3['query'][_0xe785('0x3c')]){_0x3e9f64[_0xe785('0x3d')]=[{'all':!![]}];}return db[_0xe785('0x28')][_0xe785('0x3e')](_0x3e9f64);})[_0xe785('0x1f')](function(_0x37c5f4){_0x4ba59a['rows']=_0x37c5f4;return _0x4ba59a;})[_0xe785('0x1f')](respondWithFilteredResult(_0xa60842,_0x3e9f64))['catch'](handleError(_0xa60842,null));};exports['show']=function(_0xbce5de,_0x1807cf){var _0x4c6095={'raw':!![],'where':{'id':_0xbce5de[_0xe785('0x3f')]['id']}},_0x2ca764={};_0x2ca764[_0xe785('0x2b')]=_[_0xe785('0x2d')](db['ChatQueueReport'][_0xe785('0x40')]);_0x2ca764['query']=_['keys'](_0xbce5de[_0xe785('0x2c')]);_0x2ca764[_0xe785('0x2e')]=_[_0xe785('0x2f')](_0x2ca764[_0xe785('0x2b')],_0x2ca764[_0xe785('0x2c')]);_0x4c6095[_0xe785('0x31')]=_[_0xe785('0x2f')](_0x2ca764['model'],qs[_0xe785('0x30')](_0xbce5de[_0xe785('0x2c')]['fields']));_0x4c6095[_0xe785('0x31')]=_0x4c6095[_0xe785('0x31')][_0xe785('0x41')]?_0x4c6095[_0xe785('0x31')]:_0x2ca764[_0xe785('0x2b')];if(_0xbce5de['query']['includeAll']){_0x4c6095[_0xe785('0x3d')]=[{'all':!![]}];}_0x4c6095=_[_0xe785('0x39')]({},_0x4c6095,_0xbce5de[_0xe785('0x3b')]);return db['ChatQueueReport'][_0xe785('0x42')](_0x4c6095)[_0xe785('0x1f')](handleEntityNotFound(_0x1807cf,null))['then'](respondWithResult(_0x1807cf,null))[_0xe785('0x43')](handleError(_0x1807cf,null));};exports[_0xe785('0x44')]=function(_0x4e9b64,_0x5b4da4){return db[_0xe785('0x28')]['create'](_0x4e9b64[_0xe785('0x45')],{})[_0xe785('0x1f')](respondWithResult(_0x5b4da4,0xc9))[_0xe785('0x43')](handleError(_0x5b4da4,null));};exports['update']=function(_0x2c7ab6,_0x5ae417){if(_0x2c7ab6[_0xe785('0x45')]['id']){delete _0x2c7ab6[_0xe785('0x45')]['id'];}return db['ChatQueueReport'][_0xe785('0x42')]({'where':{'id':_0x2c7ab6[_0xe785('0x3f')]['id']}})[_0xe785('0x1f')](handleEntityNotFound(_0x5ae417,null))[_0xe785('0x1f')](saveUpdates(_0x2c7ab6['body'],null))[_0xe785('0x1f')](respondWithResult(_0x5ae417,null))[_0xe785('0x43')](handleError(_0x5ae417,null));};exports['destroy']=function(_0x2427f2,_0x3c0e8b){return db[_0xe785('0x28')][_0xe785('0x42')]({'where':{'id':_0x2427f2[_0xe785('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3c0e8b,null))[_0xe785('0x1f')](removeEntity(_0x3c0e8b,null))[_0xe785('0x43')](handleError(_0x3c0e8b,null));};exports[_0xe785('0x46')]=function(_0x4d8e8f,_0x5c3d08){return db[_0xe785('0x28')][_0xe785('0x46')]()[_0xe785('0x1f')](respondWithResult(_0x5c3d08,null))[_0xe785('0x43')](handleError(_0x5c3d08,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 30d7e78..5d2a259 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 _0x5a9a=['bluebird','path','rimraf','../../config/environment','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x28cf60,_0x2fe9d9){var _0x2b61e5=function(_0x28b6ba){while(--_0x28b6ba){_0x28cf60['push'](_0x28cf60['shift']());}};_0x2b61e5(++_0x2fe9d9);}(_0x5a9a,0x11a));var _0xa5a9=function(_0x2cc6de,_0x4b0348){_0x2cc6de=_0x2cc6de-0x0;var _0x47a21e=_0x5a9a[_0x2cc6de];return _0x47a21e;};'use strict';var _=require(_0xa5a9('0x0'));var util=require('util');var logger=require(_0xa5a9('0x1'))(_0xa5a9('0x2'));var moment=require(_0xa5a9('0x3'));var BPromise=require(_0xa5a9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa5a9('0x5'));var rimraf=require(_0xa5a9('0x6'));var config=require(_0xa5a9('0x7'));var attributes=require('./chatQueueReport.attributes');module[_0xa5a9('0x8')]=function(_0x14aa6f,_0x26cc84){return _0x14aa6f[_0xa5a9('0x9')](_0xa5a9('0xa'),attributes,{'tableName':_0xa5a9('0xb'),'paranoid':![],'indexes':[{'name':_0xa5a9('0xc'),'fields':[_0xa5a9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9acd=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','report_chat_queue','uniqueid'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x9acd,0x78));var _0xd9ac=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9acd[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0xd9ac('0x0'));var util=require(_0xd9ac('0x1'));var logger=require('../../config/logger')(_0xd9ac('0x2'));var moment=require(_0xd9ac('0x3'));var BPromise=require(_0xd9ac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd9ac('0x5'));var rimraf=require(_0xd9ac('0x6'));var config=require(_0xd9ac('0x7'));var attributes=require('./chatQueueReport.attributes');module[_0xd9ac('0x8')]=function(_0x2e7b12,_0x50213c){return _0x2e7b12[_0xd9ac('0x9')]('ChatQueueReport',attributes,{'tableName':_0xd9ac('0xa'),'paranoid':![],'indexes':[{'name':_0xd9ac('0xb'),'fields':[_0xd9ac('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 9c6d900..7fee26c 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 _0x95aa=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','stringify','UpdateChatQueueReport','update','limit','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x234cdc,_0x5e14d6){var _0xfe8b6a=function(_0x5c6f6f){while(--_0x5c6f6f){_0x234cdc['push'](_0x234cdc['shift']());}};_0xfe8b6a(++_0x5e14d6);}(_0x95aa,0x123));var _0xa95a=function(_0x4a5494,_0x3ad336){_0x4a5494=_0x4a5494-0x0;var _0x57cbb5=_0x95aa[_0x4a5494];return _0x57cbb5;};'use strict';var _=require(_0xa95a('0x0'));var util=require(_0xa95a('0x1'));var moment=require(_0xa95a('0x2'));var BPromise=require(_0xa95a('0x3'));var rs=require(_0xa95a('0x4'));var fs=require('fs');var Redis=require(_0xa95a('0x5'));var db=require(_0xa95a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa95a('0x7'))(_0xa95a('0x8'));var config=require(_0xa95a('0x9'));var jayson=require(_0xa95a('0xa'));var client=jayson[_0xa95a('0xb')][_0xa95a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x20c619,_0x5ba3d9,_0x1a19ca){return new BPromise(function(_0x3dd883,_0x56aeb0){return client[_0xa95a('0xd')](_0x20c619,_0x1a19ca)[_0xa95a('0xe')](function(_0x165848){logger[_0xa95a('0xf')](_0xa95a('0x10'),_0x5ba3d9,_0xa95a('0x11'));logger[_0xa95a('0x12')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x5ba3d9,_0xa95a('0x11'),JSON['stringify'](_0x165848));if(_0x165848[_0xa95a('0x13')]){if(_0x165848[_0xa95a('0x13')][_0xa95a('0x14')]===0x1f4){logger[_0xa95a('0x13')](_0xa95a('0x10'),_0x5ba3d9,_0x165848[_0xa95a('0x13')][_0xa95a('0x15')]);return _0x56aeb0(_0x165848['error'][_0xa95a('0x15')]);}logger[_0xa95a('0x13')](_0xa95a('0x10'),_0x5ba3d9,_0x165848[_0xa95a('0x13')][_0xa95a('0x15')]);return _0x3dd883(_0x165848[_0xa95a('0x13')]['message']);}else{logger[_0xa95a('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x5ba3d9,_0xa95a('0x11'));_0x3dd883(_0x165848[_0xa95a('0x16')][_0xa95a('0x15')]);}})[_0xa95a('0x17')](function(_0x1d6d12){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x5ba3d9,_0x1d6d12);_0x56aeb0(_0x1d6d12);});});}exports[_0xa95a('0x18')]=function(_0x1ba4f3){var _0x213dab=this;return new Promise(function(_0x5c9a2c,_0x4887f5){return db[_0xa95a('0x19')]['create'](_0x1ba4f3[_0xa95a('0x1a')],{'raw':_0x1ba4f3[_0xa95a('0x1b')]?_0x1ba4f3['options'][_0xa95a('0x1c')]===undefined?!![]:![]:!![]})[_0xa95a('0xe')](function(_0x348d52){logger[_0xa95a('0xf')](_0xa95a('0x18'),_0x1ba4f3);logger[_0xa95a('0x12')](_0xa95a('0x18'),_0x1ba4f3,JSON[_0xa95a('0x1d')](_0x348d52));_0x5c9a2c(_0x348d52);})[_0xa95a('0x17')](function(_0x579ab2){logger['error'](_0xa95a('0x18'),_0x579ab2[_0xa95a('0x15')],_0x1ba4f3);_0x4887f5(_0x213dab[_0xa95a('0x13')](0x1f4,_0x579ab2[_0xa95a('0x15')]));});});};exports[_0xa95a('0x1e')]=function(_0x1c1eef){var _0x4c77b8=this;return new Promise(function(_0x5d145f,_0x209919){return db[_0xa95a('0x19')][_0xa95a('0x1f')](_0x1c1eef[_0xa95a('0x1a')],{'raw':_0x1c1eef[_0xa95a('0x1b')]?_0x1c1eef['options'][_0xa95a('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c1eef[_0xa95a('0x1b')]?_0x1c1eef[_0xa95a('0x1b')]['where']||null:null,'attributes':_0x1c1eef['options']?_0x1c1eef[_0xa95a('0x1b')]['attributes']||null:null,'limit':_0x1c1eef[_0xa95a('0x1b')]?_0x1c1eef[_0xa95a('0x1b')][_0xa95a('0x20')]||null:null})[_0xa95a('0xe')](function(_0x53764f){logger['info'](_0xa95a('0x1e'),_0x1c1eef);logger[_0xa95a('0x12')]('UpdateChatQueueReport',_0x1c1eef,JSON[_0xa95a('0x1d')](_0x53764f));_0x5d145f(_0x53764f);})[_0xa95a('0x17')](function(_0x57fe35){logger[_0xa95a('0x13')](_0xa95a('0x1e'),_0x57fe35[_0xa95a('0x15')],_0x1c1eef);_0x209919(_0x4c77b8['error'](0x1f4,_0x57fe35['message']));});});}; \ No newline at end of file +var _0x9967=['create','body','options','raw','UpdateChatQueueReport','where','attributes','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport'];(function(_0x307af5,_0x5b3d6c){var _0x35f71b=function(_0x540d9c){while(--_0x540d9c){_0x307af5['push'](_0x307af5['shift']());}};_0x35f71b(++_0x5b3d6c);}(_0x9967,0xe1));var _0x7996=function(_0x31c9bd,_0x27f98d){_0x31c9bd=_0x31c9bd-0x0;var _0x42947d=_0x9967[_0x31c9bd];return _0x42947d;};'use strict';var _=require(_0x7996('0x0'));var util=require(_0x7996('0x1'));var moment=require('moment');var BPromise=require(_0x7996('0x2'));var rs=require(_0x7996('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7996('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7996('0x5'))(_0x7996('0x6'));var config=require('../../config/environment');var jayson=require(_0x7996('0x7'));var client=jayson[_0x7996('0x8')][_0x7996('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ff626,_0x2ca0b2,_0x5bc047){return new BPromise(function(_0x315435,_0x24efb8){return client[_0x7996('0xa')](_0x1ff626,_0x5bc047)[_0x7996('0xb')](function(_0x1e317e){logger[_0x7996('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x2ca0b2,_0x7996('0xd'));logger[_0x7996('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x2ca0b2,_0x7996('0xd'),JSON[_0x7996('0xf')](_0x1e317e));if(_0x1e317e[_0x7996('0x10')]){if(_0x1e317e['error']['code']===0x1f4){logger[_0x7996('0x10')](_0x7996('0x11'),_0x2ca0b2,_0x1e317e[_0x7996('0x10')]['message']);return _0x24efb8(_0x1e317e[_0x7996('0x10')][_0x7996('0x12')]);}logger['error'](_0x7996('0x11'),_0x2ca0b2,_0x1e317e['error'][_0x7996('0x12')]);return _0x315435(_0x1e317e[_0x7996('0x10')][_0x7996('0x12')]);}else{logger[_0x7996('0xc')](_0x7996('0x11'),_0x2ca0b2,_0x7996('0xd'));_0x315435(_0x1e317e[_0x7996('0x13')][_0x7996('0x12')]);}})[_0x7996('0x14')](function(_0x465386){logger[_0x7996('0x10')](_0x7996('0x11'),_0x2ca0b2,_0x465386);_0x24efb8(_0x465386);});});}exports[_0x7996('0x15')]=function(_0x4ec235){var _0x1f3f3f=this;return new Promise(function(_0x174d2d,_0x611f77){return db[_0x7996('0x16')][_0x7996('0x17')](_0x4ec235[_0x7996('0x18')],{'raw':_0x4ec235[_0x7996('0x19')]?_0x4ec235[_0x7996('0x19')][_0x7996('0x1a')]===undefined?!![]:![]:!![]})[_0x7996('0xb')](function(_0x49af83){logger[_0x7996('0xc')](_0x7996('0x15'),_0x4ec235);logger['debug'](_0x7996('0x15'),_0x4ec235,JSON[_0x7996('0xf')](_0x49af83));_0x174d2d(_0x49af83);})[_0x7996('0x14')](function(_0x3e6eca){logger[_0x7996('0x10')](_0x7996('0x15'),_0x3e6eca[_0x7996('0x12')],_0x4ec235);_0x611f77(_0x1f3f3f[_0x7996('0x10')](0x1f4,_0x3e6eca[_0x7996('0x12')]));});});};exports[_0x7996('0x1b')]=function(_0x360b05){var _0x35294b=this;return new Promise(function(_0x135de1,_0x62239){return db[_0x7996('0x16')]['update'](_0x360b05[_0x7996('0x18')],{'raw':_0x360b05['options']?_0x360b05['options'][_0x7996('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x360b05[_0x7996('0x19')]?_0x360b05[_0x7996('0x19')][_0x7996('0x1c')]||null:null,'attributes':_0x360b05[_0x7996('0x19')]?_0x360b05[_0x7996('0x19')][_0x7996('0x1d')]||null:null,'limit':_0x360b05[_0x7996('0x19')]?_0x360b05[_0x7996('0x19')][_0x7996('0x1e')]||null:null})['then'](function(_0x266e44){logger[_0x7996('0xc')](_0x7996('0x1b'),_0x360b05);logger['debug'](_0x7996('0x1b'),_0x360b05,JSON[_0x7996('0xf')](_0x266e44));_0x135de1(_0x266e44);})[_0x7996('0x14')](function(_0x3fd242){logger['error'](_0x7996('0x1b'),_0x3fd242[_0x7996('0x12')],_0x360b05);_0x62239(_0x35294b[_0x7996('0x10')](0x1f4,_0x3fd242[_0x7996('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index e9716d1..f4adb9b 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 _0x65a3=['update','destroy','exports','multer','util','path','express','Router','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create'];(function(_0x91b449,_0x3c5762){var _0x572947=function(_0xd63277){while(--_0xd63277){_0x91b449['push'](_0x91b449['shift']());}};_0x572947(++_0x3c5762);}(_0x65a3,0x1f0));var _0x365a=function(_0x4deaea,_0x41b3dd){_0x4deaea=_0x4deaea-0x0;var _0x5c63fd=_0x65a3[_0x4deaea];return _0x5c63fd;};'use strict';var multer=require(_0x365a('0x0'));var util=require(_0x365a('0x1'));var path=require(_0x365a('0x2'));var timeout=require('connect-timeout');var express=require(_0x365a('0x3'));var router=express[_0x365a('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x365a('0x5'));router[_0x365a('0x6')]('/',auth[_0x365a('0x7')](),controller[_0x365a('0x8')]);router[_0x365a('0x6')](_0x365a('0x9'),auth['isAuthenticated'](),controller[_0x365a('0xa')]);router['get'](_0x365a('0xb'),auth[_0x365a('0x7')](),controller[_0x365a('0xc')]);router['post']('/',auth[_0x365a('0x7')](),controller[_0x365a('0xd')]);router['put'](_0x365a('0xb'),auth['isAuthenticated'](),controller[_0x365a('0xe')]);router['delete'](_0x365a('0xb'),auth['isAuthenticated'](),controller[_0x365a('0xf')]);module[_0x365a('0x10')]=router; \ No newline at end of file +var _0x5651=['../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','describe','show','create','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x5651,0x188));var _0x1565=function(_0x5550b3,_0x2d0ee0){_0x5550b3=_0x5550b3-0x0;var _0x4b8fc4=_0x5651[_0x5550b3];return _0x4b8fc4;};'use strict';var multer=require(_0x1565('0x0'));var util=require(_0x1565('0x1'));var path=require(_0x1565('0x2'));var timeout=require(_0x1565('0x3'));var express=require(_0x1565('0x4'));var router=express[_0x1565('0x5')]();var auth=require(_0x1565('0x6'));var interaction=require(_0x1565('0x7'));var config=require(_0x1565('0x8'));var controller=require(_0x1565('0x9'));router['get']('/',auth[_0x1565('0xa')](),controller[_0x1565('0xb')]);router[_0x1565('0xc')]('/describe',auth[_0x1565('0xa')](),controller[_0x1565('0xd')]);router[_0x1565('0xc')]('/:id',auth[_0x1565('0xa')](),controller[_0x1565('0xe')]);router['post']('/',auth[_0x1565('0xa')](),controller[_0x1565('0xf')]);router[_0x1565('0x10')](_0x1565('0x11'),auth[_0x1565('0xa')](),controller[_0x1565('0x12')]);router['delete'](_0x1565('0x11'),auth[_0x1565('0xa')](),controller['destroy']);module[_0x1565('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 30ca818..b73746d 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 _0x6fa8=['ENUM','account','agent','queue','moment','sequelize','exports','STRING'];(function(_0x3e531a,_0x28a82a){var _0x3c2574=function(_0x4a0c98){while(--_0x4a0c98){_0x3e531a['push'](_0x3e531a['shift']());}};_0x3c2574(++_0x28a82a);}(_0x6fa8,0x184));var _0x86fa=function(_0x32e54a,_0x59fc0d){_0x32e54a=_0x32e54a-0x0;var _0x109af4=_0x6fa8[_0x32e54a];return _0x109af4;};'use strict';var moment=require(_0x86fa('0x0'));var Sequelize=require(_0x86fa('0x1'));module[_0x86fa('0x2')]={'uniqueid':{'type':Sequelize[_0x86fa('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x86fa('0x4')](_0x86fa('0x5'),_0x86fa('0x6'),'queue'),'allowNull':![],'defaultValue':_0x86fa('0x7')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x4c13=['ENUM','account','agent','queue','DATE','NOW','exports','STRING'];(function(_0x13588c,_0x49a8ae){var _0x475acd=function(_0x37dee0){while(--_0x37dee0){_0x13588c['push'](_0x13588c['shift']());}};_0x475acd(++_0x49a8ae);}(_0x4c13,0x18e));var _0x34c1=function(_0x10ed8f,_0x832260){_0x10ed8f=_0x10ed8f-0x0;var _0x4e7e0d=_0x4c13[_0x10ed8f];return _0x4e7e0d;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x34c1('0x0')]={'uniqueid':{'type':Sequelize[_0x34c1('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x34c1('0x2')](_0x34c1('0x3'),_0x34c1('0x4'),_0x34c1('0x5')),'allowNull':![],'defaultValue':_0x34c1('0x5')},'transferredAt':{'type':Sequelize[_0x34c1('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x34c1('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 23abdd3..7e4ae23 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 _0x8c0e=['sendStatus','status','end','json','offset','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','describe','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8c0e,0x81));var _0xe8c0=function(_0x50bc93,_0x4f0dac){_0x50bc93=_0x50bc93-0x0;var _0x3f2c93=_0x8c0e[_0x50bc93];return _0x3f2c93;};'use strict';var pdf=require(_0xe8c0('0x0'));var emlformat=require(_0xe8c0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe8c0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe8c0('0x3'));var moment=require(_0xe8c0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe8c0('0x5'));var util=require(_0xe8c0('0x6'));var path=require(_0xe8c0('0x7'));var sox=require(_0xe8c0('0x8'));var csv=require(_0xe8c0('0x9'));var ejs=require(_0xe8c0('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe8c0('0xb'));var crypto=require(_0xe8c0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe8c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe8c0('0xe'));var Papa=require(_0xe8c0('0xf'));var Redis=require(_0xe8c0('0x10'));var authService=require(_0xe8c0('0x11'));var qs=require(_0xe8c0('0x12'));var as=require(_0xe8c0('0x13'));var hardwareService=require(_0xe8c0('0x14'));var logger=require('../../config/logger')(_0xe8c0('0x15'));var utils=require(_0xe8c0('0x16'));var config=require(_0xe8c0('0x17'));var db=require(_0xe8c0('0x18'))['db'];function respondWithStatusCode(_0x13f376,_0x7aa30b){_0x7aa30b=_0x7aa30b||0xcc;return function(_0x56ce19){if(_0x56ce19){return _0x13f376[_0xe8c0('0x19')](_0x7aa30b);}return _0x13f376[_0xe8c0('0x1a')](_0x7aa30b)[_0xe8c0('0x1b')]();};}function respondWithResult(_0x369627,_0x586ccd){_0x586ccd=_0x586ccd||0xc8;return function(_0x5dd3f5){if(_0x5dd3f5){return _0x369627['status'](_0x586ccd)[_0xe8c0('0x1c')](_0x5dd3f5);}};}function respondWithFilteredResult(_0x3c1425,_0x326775){return function(_0xa257a){if(_0xa257a){var _0x5722b8=_0xa257a['count'],_0x2db03d=_0x326775[_0xe8c0('0x1d')],_0x1de8c2=_0x326775[_0xe8c0('0x1d')]+_0x326775['limit'],_0x57c9ae;if(_0x1de8c2>=_0x5722b8){_0x1de8c2=_0x5722b8;_0x57c9ae=0xc8;}else{_0x57c9ae=0xce;}_0x3c1425[_0xe8c0('0x1a')](_0x57c9ae);return _0x3c1425[_0xe8c0('0x1e')](_0xe8c0('0x1f'),_0x2db03d+'-'+_0x1de8c2+'/'+_0x5722b8)[_0xe8c0('0x1c')](_0xa257a);}return null;};}function patchUpdates(_0x109ad7){return function(_0x1681bd){try{jsonpatch[_0xe8c0('0x20')](_0x1681bd,_0x109ad7,!![]);}catch(_0x3f4d1e){return BPromise[_0xe8c0('0x21')](_0x3f4d1e);}return _0x1681bd['save']();};}function saveUpdates(_0x12beb7,_0x41702a){return function(_0x25f039){if(_0x25f039){return _0x25f039['update'](_0x12beb7)[_0xe8c0('0x22')](function(_0xae7c5e){return _0xae7c5e;});}return null;};}function removeEntity(_0x16df82,_0x2b12df){return function(_0x56f6f2){if(_0x56f6f2){return _0x56f6f2[_0xe8c0('0x23')]()[_0xe8c0('0x22')](function(){_0x16df82[_0xe8c0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x214c5a,_0x478ea3){return function(_0x432da0){if(!_0x432da0){_0x214c5a[_0xe8c0('0x19')](0x194);}return _0x432da0;};}function handleError(_0x281b54,_0x462f01){_0x462f01=_0x462f01||0x1f4;return function(_0x20dae7){logger[_0xe8c0('0x24')](_0x20dae7[_0xe8c0('0x25')]);if(_0x20dae7[_0xe8c0('0x26')]){delete _0x20dae7[_0xe8c0('0x26')];}_0x281b54[_0xe8c0('0x1a')](_0x462f01)[_0xe8c0('0x27')](_0x20dae7);};}exports[_0xe8c0('0x28')]=function(_0x257d8f,_0x370dd3){var _0xd8c85={},_0xadaaa={},_0x3bc072={'count':0x0,'rows':[]};var _0x175c2c=_[_0xe8c0('0x29')](db['ChatTransferReport'][_0xe8c0('0x2a')],function(_0x202ed6){return{'name':_0x202ed6[_0xe8c0('0x2b')],'type':_0x202ed6[_0xe8c0('0x2c')][_0xe8c0('0x2d')]};});_0xadaaa[_0xe8c0('0x2e')]=_['map'](_0x175c2c,_0xe8c0('0x26'));_0xadaaa[_0xe8c0('0x2f')]=_['keys'](_0x257d8f[_0xe8c0('0x2f')]);_0xadaaa['filters']=_[_0xe8c0('0x30')](_0xadaaa['model'],_0xadaaa[_0xe8c0('0x2f')]);_0xd8c85[_0xe8c0('0x31')]=_[_0xe8c0('0x30')](_0xadaaa[_0xe8c0('0x2e')],qs['fields'](_0x257d8f[_0xe8c0('0x2f')][_0xe8c0('0x32')]));_0xd8c85[_0xe8c0('0x31')]=_0xd8c85[_0xe8c0('0x31')][_0xe8c0('0x33')]?_0xd8c85[_0xe8c0('0x31')]:_0xadaaa[_0xe8c0('0x2e')];if(!_0x257d8f[_0xe8c0('0x2f')][_0xe8c0('0x34')](_0xe8c0('0x35'))){_0xd8c85['limit']=qs[_0xe8c0('0x36')](_0x257d8f[_0xe8c0('0x2f')][_0xe8c0('0x36')]);_0xd8c85[_0xe8c0('0x1d')]=qs['offset'](_0x257d8f['query']['offset']);}_0xd8c85['order']=qs[_0xe8c0('0x37')](_0x257d8f[_0xe8c0('0x2f')][_0xe8c0('0x37')]);_0xd8c85[_0xe8c0('0x38')]=qs[_0xe8c0('0x39')](_[_0xe8c0('0x3a')](_0x257d8f['query'],_0xadaaa[_0xe8c0('0x39')]));if(_0x257d8f[_0xe8c0('0x2f')][_0xe8c0('0x3b')]){_0xd8c85[_0xe8c0('0x38')]=_[_0xe8c0('0x3c')](_0xd8c85[_0xe8c0('0x38')],{'$or':_[_0xe8c0('0x29')](_0x175c2c,function(_0x5eaa73){if(_0x5eaa73['type']!==_0xe8c0('0x3d')){var _0xacdb4e={};_0xacdb4e[_0x5eaa73[_0xe8c0('0x26')]]={'$like':'%'+_0x257d8f['query'][_0xe8c0('0x3b')]+'%'};return _0xacdb4e;}})});}_0xd8c85=_[_0xe8c0('0x3c')]({},_0xd8c85,_0x257d8f[_0xe8c0('0x3e')]);var _0x6248a8={'where':_0xd8c85[_0xe8c0('0x38')]};return db[_0xe8c0('0x3f')]['count'](_0x6248a8)[_0xe8c0('0x22')](function(_0x222bab){_0x3bc072['count']=_0x222bab;if(_0x257d8f[_0xe8c0('0x2f')][_0xe8c0('0x40')]){_0xd8c85[_0xe8c0('0x41')]=[{'all':!![]}];}return db[_0xe8c0('0x3f')][_0xe8c0('0x42')](_0xd8c85);})[_0xe8c0('0x22')](function(_0xd6571e){_0x3bc072[_0xe8c0('0x43')]=_0xd6571e;return _0x3bc072;})['then'](respondWithFilteredResult(_0x370dd3,_0xd8c85))[_0xe8c0('0x44')](handleError(_0x370dd3,null));};exports[_0xe8c0('0x45')]=function(_0x5ca4c7,_0x292cea){var _0xc5336d={'raw':!![],'where':{'id':_0x5ca4c7[_0xe8c0('0x46')]['id']}},_0x1f33d6={};_0x1f33d6[_0xe8c0('0x2e')]=_[_0xe8c0('0x47')](db[_0xe8c0('0x3f')][_0xe8c0('0x2a')]);_0x1f33d6[_0xe8c0('0x2f')]=_[_0xe8c0('0x47')](_0x5ca4c7['query']);_0x1f33d6[_0xe8c0('0x39')]=_['intersection'](_0x1f33d6[_0xe8c0('0x2e')],_0x1f33d6['query']);_0xc5336d[_0xe8c0('0x31')]=_[_0xe8c0('0x30')](_0x1f33d6[_0xe8c0('0x2e')],qs[_0xe8c0('0x32')](_0x5ca4c7['query'][_0xe8c0('0x32')]));_0xc5336d[_0xe8c0('0x31')]=_0xc5336d['attributes'][_0xe8c0('0x33')]?_0xc5336d[_0xe8c0('0x31')]:_0x1f33d6['model'];if(_0x5ca4c7[_0xe8c0('0x2f')][_0xe8c0('0x40')]){_0xc5336d[_0xe8c0('0x41')]=[{'all':!![]}];}_0xc5336d=_[_0xe8c0('0x3c')]({},_0xc5336d,_0x5ca4c7[_0xe8c0('0x3e')]);return db[_0xe8c0('0x3f')][_0xe8c0('0x48')](_0xc5336d)[_0xe8c0('0x22')](handleEntityNotFound(_0x292cea,null))[_0xe8c0('0x22')](respondWithResult(_0x292cea,null))[_0xe8c0('0x44')](handleError(_0x292cea,null));};exports[_0xe8c0('0x49')]=function(_0x3c29a8,_0x740c75){return db[_0xe8c0('0x3f')][_0xe8c0('0x49')](_0x3c29a8[_0xe8c0('0x4a')],{})[_0xe8c0('0x22')](respondWithResult(_0x740c75,0xc9))[_0xe8c0('0x44')](handleError(_0x740c75,null));};exports[_0xe8c0('0x4b')]=function(_0x4516e2,_0x27c102){if(_0x4516e2[_0xe8c0('0x4a')]['id']){delete _0x4516e2[_0xe8c0('0x4a')]['id'];}return db[_0xe8c0('0x3f')][_0xe8c0('0x48')]({'where':{'id':_0x4516e2[_0xe8c0('0x46')]['id']}})[_0xe8c0('0x22')](handleEntityNotFound(_0x27c102,null))[_0xe8c0('0x22')](saveUpdates(_0x4516e2[_0xe8c0('0x4a')],null))[_0xe8c0('0x22')](respondWithResult(_0x27c102,null))[_0xe8c0('0x44')](handleError(_0x27c102,null));};exports[_0xe8c0('0x23')]=function(_0x1aca90,_0x5c9ccc){return db[_0xe8c0('0x3f')]['find']({'where':{'id':_0x1aca90[_0xe8c0('0x46')]['id']}})['then'](handleEntityNotFound(_0x5c9ccc,null))[_0xe8c0('0x22')](removeEntity(_0x5c9ccc,null))[_0xe8c0('0x44')](handleError(_0x5c9ccc,null));};exports[_0xe8c0('0x4c')]=function(_0x3a859a,_0x13721a){return db[_0xe8c0('0x3f')][_0xe8c0('0x4c')]()[_0xe8c0('0x22')](respondWithResult(_0x13721a,null))[_0xe8c0('0x44')](handleError(_0x13721a,null));}; \ No newline at end of file +var _0xde69=['count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','catch','show','find','create','body','update','params','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x414655,_0x79d916){var _0x237884=function(_0x2737d9){while(--_0x2737d9){_0x414655['push'](_0x414655['shift']());}};_0x237884(++_0x79d916);}(_0xde69,0xcd));var _0x9de6=function(_0xd37e3d,_0x5c9573){_0xd37e3d=_0xd37e3d-0x0;var _0xff1ac0=_0xde69[_0xd37e3d];return _0xff1ac0;};'use strict';var pdf=require(_0x9de6('0x0'));var emlformat=require(_0x9de6('0x1'));var rimraf=require(_0x9de6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9de6('0x3'));var moment=require(_0x9de6('0x4'));var BPromise=require(_0x9de6('0x5'));var Mustache=require('mustache');var util=require(_0x9de6('0x6'));var path=require(_0x9de6('0x7'));var sox=require(_0x9de6('0x8'));var csv=require('to-csv');var ejs=require(_0x9de6('0x9'));var fs=require('fs');var _=require(_0x9de6('0xa'));var squel=require(_0x9de6('0xb'));var crypto=require(_0x9de6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9de6('0xd'));var toCsv=require(_0x9de6('0xe'));var querystring=require(_0x9de6('0xf'));var Papa=require(_0x9de6('0x10'));var Redis=require(_0x9de6('0x11'));var authService=require(_0x9de6('0x12'));var qs=require(_0x9de6('0x13'));var as=require(_0x9de6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9de6('0x15'))(_0x9de6('0x16'));var utils=require(_0x9de6('0x17'));var config=require(_0x9de6('0x18'));var db=require(_0x9de6('0x19'))['db'];function respondWithStatusCode(_0x288ad9,_0x422524){_0x422524=_0x422524||0xcc;return function(_0xb823c){if(_0xb823c){return _0x288ad9[_0x9de6('0x1a')](_0x422524);}return _0x288ad9[_0x9de6('0x1b')](_0x422524)[_0x9de6('0x1c')]();};}function respondWithResult(_0xab4c12,_0x6a89d5){_0x6a89d5=_0x6a89d5||0xc8;return function(_0x4b4952){if(_0x4b4952){return _0xab4c12[_0x9de6('0x1b')](_0x6a89d5)['json'](_0x4b4952);}};}function respondWithFilteredResult(_0x13a04f,_0x4f9099){return function(_0x59cd1e){if(_0x59cd1e){var _0x664d59=_0x59cd1e[_0x9de6('0x1d')],_0x360f0d=_0x4f9099[_0x9de6('0x1e')],_0xa3eb1e=_0x4f9099['offset']+_0x4f9099[_0x9de6('0x1f')],_0x36dee9;if(_0xa3eb1e>=_0x664d59){_0xa3eb1e=_0x664d59;_0x36dee9=0xc8;}else{_0x36dee9=0xce;}_0x13a04f[_0x9de6('0x1b')](_0x36dee9);return _0x13a04f[_0x9de6('0x20')](_0x9de6('0x21'),_0x360f0d+'-'+_0xa3eb1e+'/'+_0x664d59)[_0x9de6('0x22')](_0x59cd1e);}return null;};}function patchUpdates(_0x10163a){return function(_0x4525df){try{jsonpatch[_0x9de6('0x23')](_0x4525df,_0x10163a,!![]);}catch(_0x2f88d3){return BPromise[_0x9de6('0x24')](_0x2f88d3);}return _0x4525df[_0x9de6('0x25')]();};}function saveUpdates(_0x2b9800,_0x16a2f2){return function(_0x3f2822){if(_0x3f2822){return _0x3f2822['update'](_0x2b9800)[_0x9de6('0x26')](function(_0x38efd5){return _0x38efd5;});}return null;};}function removeEntity(_0x5796b3,_0x2135c1){return function(_0x29ac85){if(_0x29ac85){return _0x29ac85[_0x9de6('0x27')]()[_0x9de6('0x26')](function(){_0x5796b3[_0x9de6('0x1b')](0xcc)[_0x9de6('0x1c')]();});}};}function handleEntityNotFound(_0x5e431d,_0x261586){return function(_0x4a183e){if(!_0x4a183e){_0x5e431d[_0x9de6('0x1a')](0x194);}return _0x4a183e;};}function handleError(_0xd95008,_0x442a98){_0x442a98=_0x442a98||0x1f4;return function(_0x359e9f){logger[_0x9de6('0x28')](_0x359e9f[_0x9de6('0x29')]);if(_0x359e9f[_0x9de6('0x2a')]){delete _0x359e9f[_0x9de6('0x2a')];}_0xd95008[_0x9de6('0x1b')](_0x442a98)[_0x9de6('0x2b')](_0x359e9f);};}exports[_0x9de6('0x2c')]=function(_0x1626b5,_0x2fb6be){var _0x1852e7={},_0x875539={},_0x1325a8={'count':0x0,'rows':[]};var _0x2d7132=_[_0x9de6('0x2d')](db[_0x9de6('0x2e')][_0x9de6('0x2f')],function(_0x4a60fb){return{'name':_0x4a60fb[_0x9de6('0x30')],'type':_0x4a60fb[_0x9de6('0x31')][_0x9de6('0x32')]};});_0x875539[_0x9de6('0x33')]=_[_0x9de6('0x2d')](_0x2d7132,_0x9de6('0x2a'));_0x875539[_0x9de6('0x34')]=_[_0x9de6('0x35')](_0x1626b5['query']);_0x875539['filters']=_[_0x9de6('0x36')](_0x875539[_0x9de6('0x33')],_0x875539[_0x9de6('0x34')]);_0x1852e7[_0x9de6('0x37')]=_[_0x9de6('0x36')](_0x875539['model'],qs[_0x9de6('0x38')](_0x1626b5[_0x9de6('0x34')][_0x9de6('0x38')]));_0x1852e7['attributes']=_0x1852e7['attributes'][_0x9de6('0x39')]?_0x1852e7[_0x9de6('0x37')]:_0x875539[_0x9de6('0x33')];if(!_0x1626b5[_0x9de6('0x34')][_0x9de6('0x3a')](_0x9de6('0x3b'))){_0x1852e7[_0x9de6('0x1f')]=qs[_0x9de6('0x1f')](_0x1626b5[_0x9de6('0x34')][_0x9de6('0x1f')]);_0x1852e7[_0x9de6('0x1e')]=qs[_0x9de6('0x1e')](_0x1626b5[_0x9de6('0x34')][_0x9de6('0x1e')]);}_0x1852e7['order']=qs['sort'](_0x1626b5['query'][_0x9de6('0x3c')]);_0x1852e7[_0x9de6('0x3d')]=qs['filters'](_[_0x9de6('0x3e')](_0x1626b5[_0x9de6('0x34')],_0x875539[_0x9de6('0x3f')]));if(_0x1626b5[_0x9de6('0x34')][_0x9de6('0x40')]){_0x1852e7[_0x9de6('0x3d')]=_['merge'](_0x1852e7[_0x9de6('0x3d')],{'$or':_[_0x9de6('0x2d')](_0x2d7132,function(_0x19589b){if(_0x19589b[_0x9de6('0x31')]!==_0x9de6('0x41')){var _0x1a73e2={};_0x1a73e2[_0x19589b[_0x9de6('0x2a')]]={'$like':'%'+_0x1626b5[_0x9de6('0x34')][_0x9de6('0x40')]+'%'};return _0x1a73e2;}})});}_0x1852e7=_[_0x9de6('0x42')]({},_0x1852e7,_0x1626b5[_0x9de6('0x43')]);var _0x5733ea={'where':_0x1852e7['where']};return db[_0x9de6('0x2e')]['count'](_0x5733ea)[_0x9de6('0x26')](function(_0x252dea){_0x1325a8['count']=_0x252dea;if(_0x1626b5[_0x9de6('0x34')][_0x9de6('0x44')]){_0x1852e7[_0x9de6('0x45')]=[{'all':!![]}];}return db[_0x9de6('0x2e')]['findAll'](_0x1852e7);})[_0x9de6('0x26')](function(_0x3ad459){_0x1325a8['rows']=_0x3ad459;return _0x1325a8;})[_0x9de6('0x26')](respondWithFilteredResult(_0x2fb6be,_0x1852e7))[_0x9de6('0x46')](handleError(_0x2fb6be,null));};exports[_0x9de6('0x47')]=function(_0x9ba192,_0xaf50f){var _0x2d6a17={'raw':!![],'where':{'id':_0x9ba192['params']['id']}},_0x525e02={};_0x525e02[_0x9de6('0x33')]=_['keys'](db[_0x9de6('0x2e')]['rawAttributes']);_0x525e02['query']=_['keys'](_0x9ba192[_0x9de6('0x34')]);_0x525e02['filters']=_['intersection'](_0x525e02[_0x9de6('0x33')],_0x525e02[_0x9de6('0x34')]);_0x2d6a17[_0x9de6('0x37')]=_[_0x9de6('0x36')](_0x525e02[_0x9de6('0x33')],qs[_0x9de6('0x38')](_0x9ba192[_0x9de6('0x34')][_0x9de6('0x38')]));_0x2d6a17[_0x9de6('0x37')]=_0x2d6a17['attributes'][_0x9de6('0x39')]?_0x2d6a17[_0x9de6('0x37')]:_0x525e02['model'];if(_0x9ba192[_0x9de6('0x34')]['includeAll']){_0x2d6a17['include']=[{'all':!![]}];}_0x2d6a17=_['merge']({},_0x2d6a17,_0x9ba192['options']);return db['ChatTransferReport'][_0x9de6('0x48')](_0x2d6a17)[_0x9de6('0x26')](handleEntityNotFound(_0xaf50f,null))[_0x9de6('0x26')](respondWithResult(_0xaf50f,null))['catch'](handleError(_0xaf50f,null));};exports[_0x9de6('0x49')]=function(_0x220fd2,_0x3fd7e1){return db['ChatTransferReport']['create'](_0x220fd2[_0x9de6('0x4a')],{})[_0x9de6('0x26')](respondWithResult(_0x3fd7e1,0xc9))[_0x9de6('0x46')](handleError(_0x3fd7e1,null));};exports[_0x9de6('0x4b')]=function(_0x3ab264,_0x5e767c){if(_0x3ab264['body']['id']){delete _0x3ab264['body']['id'];}return db[_0x9de6('0x2e')][_0x9de6('0x48')]({'where':{'id':_0x3ab264[_0x9de6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5e767c,null))[_0x9de6('0x26')](saveUpdates(_0x3ab264['body'],null))[_0x9de6('0x26')](respondWithResult(_0x5e767c,null))[_0x9de6('0x46')](handleError(_0x5e767c,null));};exports['destroy']=function(_0x4e133f,_0xdf195d){return db[_0x9de6('0x2e')][_0x9de6('0x48')]({'where':{'id':_0x4e133f[_0x9de6('0x4c')]['id']}})['then'](handleEntityNotFound(_0xdf195d,null))[_0x9de6('0x26')](removeEntity(_0xdf195d,null))[_0x9de6('0x46')](handleError(_0xdf195d,null));};exports['describe']=function(_0x1d04a8,_0x309b68){return db['ChatTransferReport'][_0x9de6('0x4d')]()['then'](respondWithResult(_0x309b68,null))['catch'](handleError(_0x309b68,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 345bf4d..ccad451 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 _0x3738=['exports','define','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes'];(function(_0x5e8906,_0x18f1e7){var _0x3b6622=function(_0x47ca57){while(--_0x47ca57){_0x5e8906['push'](_0x5e8906['shift']());}};_0x3b6622(++_0x18f1e7);}(_0x3738,0x1e5));var _0x8373=function(_0x15a880,_0x52363b){_0x15a880=_0x15a880-0x0;var _0x414afe=_0x3738[_0x15a880];return _0x414afe;};'use strict';var _=require('lodash');var util=require(_0x8373('0x0'));var logger=require(_0x8373('0x1'))(_0x8373('0x2'));var moment=require(_0x8373('0x3'));var BPromise=require(_0x8373('0x4'));var rp=require(_0x8373('0x5'));var fs=require('fs');var path=require(_0x8373('0x6'));var rimraf=require(_0x8373('0x7'));var config=require(_0x8373('0x8'));var attributes=require(_0x8373('0x9'));module[_0x8373('0xa')]=function(_0x22fdf0,_0x5f3c70){return _0x22fdf0[_0x8373('0xb')](_0x8373('0xc'),attributes,{'tableName':_0x8373('0xd'),'paranoid':![],'indexes':[{'name':_0x8373('0xe'),'fields':[_0x8373('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5383=['uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','exports','define','ChatTransferReport','report_chat_transfer'];(function(_0x2bf644,_0x4b9735){var _0x2ba23c=function(_0x393eba){while(--_0x393eba){_0x2bf644['push'](_0x2bf644['shift']());}};_0x2ba23c(++_0x4b9735);}(_0x5383,0x85));var _0x3538=function(_0x3da2f3,_0x195eb7){_0x3da2f3=_0x3da2f3-0x0;var _0x5f1c96=_0x5383[_0x3da2f3];return _0x5f1c96;};'use strict';var _=require(_0x3538('0x0'));var util=require(_0x3538('0x1'));var logger=require(_0x3538('0x2'))(_0x3538('0x3'));var moment=require('moment');var BPromise=require(_0x3538('0x4'));var rp=require(_0x3538('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3538('0x6'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0x3538('0x7')]=function(_0x4c8352,_0x446bd6){return _0x4c8352[_0x3538('0x8')](_0x3538('0x9'),attributes,{'tableName':_0x3538('0xa'),'paranoid':![],'indexes':[{'name':_0x3538('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 4b6ed4d..729f506 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 _0xc35b=['error','message','result','util','moment','randomstring','../../config/logger','rpc','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x34c6a3,_0x3e1a91){var _0x58fcda=function(_0x104547){while(--_0x104547){_0x34c6a3['push'](_0x34c6a3['shift']());}};_0x58fcda(++_0x3e1a91);}(_0xc35b,0xa3));var _0xbc35=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xc35b[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require('lodash');var util=require(_0xbc35('0x0'));var moment=require(_0xbc35('0x1'));var BPromise=require('bluebird');var rs=require(_0xbc35('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbc35('0x3'))(_0xbc35('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbc35('0x5')][_0xbc35('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2db8fd,_0x75ef4d,_0x2ae7b0){return new BPromise(function(_0x51b00b,_0x478893){return client['request'](_0x2db8fd,_0x2ae7b0)[_0xbc35('0x7')](function(_0x590a33){logger[_0xbc35('0x8')](_0xbc35('0x9'),_0x75ef4d,_0xbc35('0xa'));logger['debug'](_0xbc35('0xb'),_0x75ef4d,_0xbc35('0xa'),JSON[_0xbc35('0xc')](_0x590a33));if(_0x590a33[_0xbc35('0xd')]){if(_0x590a33[_0xbc35('0xd')]['code']===0x1f4){logger[_0xbc35('0xd')](_0xbc35('0x9'),_0x75ef4d,_0x590a33[_0xbc35('0xd')]['message']);return _0x478893(_0x590a33['error'][_0xbc35('0xe')]);}logger['error'](_0xbc35('0x9'),_0x75ef4d,_0x590a33[_0xbc35('0xd')]['message']);return _0x51b00b(_0x590a33[_0xbc35('0xd')][_0xbc35('0xe')]);}else{logger[_0xbc35('0x8')](_0xbc35('0x9'),_0x75ef4d,'request\x20sent');_0x51b00b(_0x590a33[_0xbc35('0xf')][_0xbc35('0xe')]);}})['catch'](function(_0x3166f1){logger['error'](_0xbc35('0x9'),_0x75ef4d,_0x3166f1);_0x478893(_0x3166f1);});});} \ No newline at end of file +var _0x52cd=['request\x20sent','error','code','message','ChatTransferReport,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x38ee8c,_0x41ae11){var _0x95d48c=function(_0x269647){while(--_0x269647){_0x38ee8c['push'](_0x38ee8c['shift']());}};_0x95d48c(++_0x41ae11);}(_0x52cd,0xf9));var _0xd52c=function(_0x49863b,_0x57ea09){_0x49863b=_0x49863b-0x0;var _0x4e3891=_0x52cd[_0x49863b];return _0x4e3891;};'use strict';var _=require(_0xd52c('0x0'));var util=require(_0xd52c('0x1'));var moment=require(_0xd52c('0x2'));var BPromise=require('bluebird');var rs=require(_0xd52c('0x3'));var fs=require('fs');var Redis=require(_0xd52c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd52c('0x5'));var logger=require(_0xd52c('0x6'))(_0xd52c('0x7'));var config=require(_0xd52c('0x8'));var jayson=require(_0xd52c('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x55cd41,_0x4572da,_0x463ce6){return new BPromise(function(_0x5190c3,_0x375c07){return client[_0xd52c('0xa')](_0x55cd41,_0x463ce6)[_0xd52c('0xb')](function(_0x14f67d){logger[_0xd52c('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x4572da,'request\x20sent');logger[_0xd52c('0xd')](_0xd52c('0xe'),_0x4572da,_0xd52c('0xf'),JSON['stringify'](_0x14f67d));if(_0x14f67d[_0xd52c('0x10')]){if(_0x14f67d['error'][_0xd52c('0x11')]===0x1f4){logger[_0xd52c('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x4572da,_0x14f67d['error'][_0xd52c('0x12')]);return _0x375c07(_0x14f67d[_0xd52c('0x10')][_0xd52c('0x12')]);}logger[_0xd52c('0x10')](_0xd52c('0x13'),_0x4572da,_0x14f67d[_0xd52c('0x10')][_0xd52c('0x12')]);return _0x5190c3(_0x14f67d[_0xd52c('0x10')][_0xd52c('0x12')]);}else{logger['info'](_0xd52c('0x13'),_0x4572da,_0xd52c('0xf'));_0x5190c3(_0x14f67d[_0xd52c('0x14')][_0xd52c('0x12')]);}})[_0xd52c('0x15')](function(_0x190309){logger[_0xd52c('0x10')](_0xd52c('0x13'),_0x4572da,_0x190309);_0x375c07(_0x190309);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index a52d4f3..158a75c 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 _0x2032=['describe','/:id','post','create','put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x3b4a85,_0x5b9652){var _0x44860c=function(_0x55a8e5){while(--_0x55a8e5){_0x3b4a85['push'](_0x3b4a85['shift']());}};_0x44860c(++_0x5b9652);}(_0x2032,0xd9));var _0x2203=function(_0x387dc0,_0x20e364){_0x387dc0=_0x387dc0-0x0;var _0x1d5551=_0x2032[_0x387dc0];return _0x1d5551;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var auth=require(_0x2203('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2203('0x5'));var controller=require(_0x2203('0x6'));router[_0x2203('0x7')]('/',auth[_0x2203('0x8')](),controller[_0x2203('0x9')]);router[_0x2203('0x7')](_0x2203('0xa'),auth[_0x2203('0x8')](),controller[_0x2203('0xb')]);router[_0x2203('0x7')](_0x2203('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller[_0x2203('0xe')]);router[_0x2203('0xf')](_0x2203('0xc'),auth['isAuthenticated'](),controller[_0x2203('0x10')]);router['delete'](_0x2203('0xc'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);module[_0x2203('0x12')]=router; \ No newline at end of file +var _0x2032=['describe','/:id','post','create','put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x57750a,_0x5b523d){var _0x5d25e1=function(_0x21b551){while(--_0x21b551){_0x57750a['push'](_0x57750a['shift']());}};_0x5d25e1(++_0x5b523d);}(_0x2032,0xd9));var _0x2203=function(_0x854f30,_0x25c77c){_0x854f30=_0x854f30-0x0;var _0x211b6a=_0x2032[_0x854f30];return _0x211b6a;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var auth=require(_0x2203('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2203('0x5'));var controller=require(_0x2203('0x6'));router[_0x2203('0x7')]('/',auth[_0x2203('0x8')](),controller[_0x2203('0x9')]);router[_0x2203('0x7')](_0x2203('0xa'),auth[_0x2203('0x8')](),controller[_0x2203('0xb')]);router[_0x2203('0x7')](_0x2203('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller[_0x2203('0xe')]);router[_0x2203('0xf')](_0x2203('0xc'),auth['isAuthenticated'](),controller[_0x2203('0x10')]);router['delete'](_0x2203('0xc'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);module[_0x2203('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 7148dbc..b9a667d 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 _0x682f=['New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','address','email','Agent','#9f946a','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'];(function(_0x21ce26,_0x1e809b){var _0x575fba=function(_0x10104d){while(--_0x10104d){_0x21ce26['push'](_0x21ce26['shift']());}};_0x575fba(++_0x1e809b);}(_0x682f,0xdd));var _0xf682=function(_0x372f0e,_0x52d3a9){_0x372f0e=_0x372f0e-0x0;var _0x55308b=_0x682f[_0x372f0e];return _0x55308b;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xf682('0x0'));module[_0xf682('0x1')]={'name':{'type':Sequelize[_0xf682('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf682('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xf682('0x4')},'mapKeyOffline':{'type':Sequelize[_0xf682('0x2')],'defaultValue':_0xf682('0x4')},'key':{'type':Sequelize[_0xf682('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xf682('0x2')],'defaultValue':_0xf682('0x5')},'customerAlias':{'type':Sequelize[_0xf682('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf682('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf682('0x2')],'allowNull':![],'defaultValue':_0xf682('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf682('0x2')],'allowNull':![],'defaultValue':_0xf682('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf682('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf682('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xf682('0x9')](_0xf682('0xa'),_0xf682('0xb')),'defaultValue':_0xf682('0xa')},'header_online':{'type':Sequelize[_0xf682('0x2')],'defaultValue':_0xf682('0xc')},'start_chat_button':{'type':Sequelize[_0xf682('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xf682('0x2')],'defaultValue':_0xf682('0xd')},'header_offline':{'type':Sequelize[_0xf682('0x2')],'defaultValue':_0xf682('0xe')},'download_transcript':{'type':Sequelize[_0xf682('0xf')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xf682('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xf682('0xf')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xf682('0x2')],'defaultValue':_0xf682('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xf682('0x2')],'defaultValue':_0xf682('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xf682('0x2')],'defaultValue':_0xf682('0x13')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xf682('0x14')},'placeholderMessage':{'type':Sequelize[_0xf682('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xf682('0x2')],'defaultValue':_0xf682('0x15')},'closingMessageButton':{'type':Sequelize[_0xf682('0x2')],'defaultValue':_0xf682('0xd')},'skipMessageButton':{'type':Sequelize[_0xf682('0x2')],'defaultValue':_0xf682('0x16')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xf682('0xf')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xf682('0xf')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xf682('0x2')],'defaultValue':_0xf682('0x17')},'ratingType':{'type':Sequelize[_0xf682('0x9')](_0xf682('0x18'),_0xf682('0x19')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xf682('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xf682('0x1a')]({'items':[{'type':_0xf682('0x1b'),'variable':null,'config':{'placeholder':_0xf682('0x1c'),'type':_0xf682('0x1d'),'required':!![]},'props':{'title':_0xf682('0x1c'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xf682('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf682('0x1e')](_0xf682('0x1f'))?JSON[_0xf682('0x20')](this[_0xf682('0x1e')]('onlineForm')):{};},'set':function(_0x2104b4){return this[_0xf682('0x21')](_0xf682('0x1f'),JSON[_0xf682('0x1a')](_0x2104b4));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xf682('0x1a')]({'items':[{'type':_0xf682('0x1b'),'props':{'title':_0xf682('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xf682('0x4')},'variable':null},{'type':_0xf682('0x22'),'config':{'placeholder':_0xf682('0x23')},'props':{'title':'Comments','helpText':_0xf682('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0xf682('0x1e')](_0xf682('0x25'))?JSON[_0xf682('0x20')](this[_0xf682('0x1e')](_0xf682('0x25'))):{};},'set':function(_0x57164a){return this[_0xf682('0x21')]('offlineForm',JSON['stringify'](_0x57164a));}},'token':{'type':Sequelize[_0xf682('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xf682('0xf')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf682('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xf682('0x2')]},'forwardOffline':{'type':Sequelize[_0xf682('0xf')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xf682('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xf682('0x26')},'waitingMessage':{'type':Sequelize[_0xf682('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xf682('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xf682('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0xf682('0xf')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xf682('0x2')],'defaultValue':_0xf682('0x29')},'skipUnmanaged':{'type':Sequelize[_0xf682('0x2')],'defaultValue':_0xf682('0x16')},'sendUnmanaged':{'type':Sequelize[_0xf682('0x2')],'defaultValue':_0xf682('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xf682('0xf')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xf682('0xf')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xf682('0xf')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xf682('0x2a')],'defaultValue':function(){return _0xf682('0x2b');}},'notificationSound':{'type':Sequelize[_0xf682('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf682('0xf')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xf682('0xf')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf682('0x2')],'defaultValue':_0xf682('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0xf682('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xf682('0x2d')},'verticalAlignment':{'type':Sequelize[_0xf682('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xf682('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xf682('0x2')]},'customerAvatar':{'type':Sequelize[_0xf682('0x2a')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xf682('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf682('0x2')],'allowNull':![],'defaultValue':_0xf682('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xf682('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf682('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf682('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf682('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf682('0x2')],'defaultValue':_0xf682('0x2f')},'systemAvatar':{'type':Sequelize[_0xf682('0x2a')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf682('0x8')],'comment':_0xf682('0x30')},'mandatoryDisposition':{'type':Sequelize[_0xf682('0xf')],'defaultValue':![],'comment':_0xf682('0x31'),'set':function(_0x1f81c2){if(!_0x1f81c2)this[_0xf682('0x21')](_0xf682('0x32'),null);this['setDataValue'](_0xf682('0x33'),_0x1f81c2);}}}; \ No newline at end of file +var _0x63b6=['Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','address','email','Agent','#9f946a','#ffffff','INTEGER','BOOLEAN','squared','rounded','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'];(function(_0x927391,_0x357652){var _0x56586a=function(_0x595049){while(--_0x595049){_0x927391['push'](_0x927391['shift']());}};_0x56586a(++_0x357652);}(_0x63b6,0x14c));var _0x663b=function(_0x1b8b69,_0x3d18a8){_0x1b8b69=_0x1b8b69-0x0;var _0x585581=_0x63b6[_0x1b8b69];return _0x585581;};'use strict';var Sequelize=require(_0x663b('0x0'));var rs=require(_0x663b('0x1'));module['exports']={'name':{'type':Sequelize[_0x663b('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x663b('0x3')},'description':{'type':Sequelize[_0x663b('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x663b('0x4')},'mapKeyOffline':{'type':Sequelize[_0x663b('0x2')],'defaultValue':_0x663b('0x4')},'key':{'type':Sequelize[_0x663b('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x663b('0x2')],'defaultValue':_0x663b('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x663b('0x2')],'allowNull':![],'defaultValue':_0x663b('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x663b('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x663b('0x2')],'allowNull':![],'defaultValue':_0x663b('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x663b('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x663b('0x2')]},'animation':{'type':Sequelize[_0x663b('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0x663b('0xa')),'defaultValue':_0x663b('0xb')},'header_online':{'type':Sequelize[_0x663b('0x2')],'defaultValue':_0x663b('0xc')},'start_chat_button':{'type':Sequelize[_0x663b('0x2')],'defaultValue':_0x663b('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x663b('0xe')},'header_offline':{'type':Sequelize[_0x663b('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x663b('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x663b('0x2')],'defaultValue':_0x663b('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x663b('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x663b('0x10')]},'closingQuestion':{'type':Sequelize[_0x663b('0x2')],'defaultValue':_0x663b('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x663b('0x2')],'defaultValue':_0x663b('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x663b('0x13')},'noteTitle':{'type':Sequelize[_0x663b('0x2')],'defaultValue':_0x663b('0x14')},'placeholderMessage':{'type':Sequelize[_0x663b('0x2')],'defaultValue':_0x663b('0x15')},'closingMessage':{'type':Sequelize[_0x663b('0x2')],'defaultValue':_0x663b('0x16')},'closingMessageButton':{'type':Sequelize[_0x663b('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x663b('0x2')],'defaultValue':_0x663b('0x17')},'conditionAgreement':{'type':Sequelize[_0x663b('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x663b('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x663b('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0x663b('0x18'),_0x663b('0x19')),'defaultValue':_0x663b('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x663b('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x663b('0x1a')]({'items':[{'type':_0x663b('0x1b'),'variable':null,'config':{'placeholder':_0x663b('0x1c'),'type':_0x663b('0x1d'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x663b('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x663b('0x1e')](_0x663b('0x1f'))?JSON[_0x663b('0x20')](this[_0x663b('0x1e')](_0x663b('0x1f'))):{};},'set':function(_0x305a1e){return this[_0x663b('0x21')](_0x663b('0x1f'),JSON[_0x663b('0x1a')](_0x305a1e));}},'offlineForm':{'type':Sequelize[_0x663b('0x10')],'defaultValue':function(){return JSON[_0x663b('0x1a')]({'items':[{'type':_0x663b('0x1b'),'props':{'title':_0x663b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x663b('0x4'),'type':_0x663b('0x4')},'variable':null},{'type':_0x663b('0x22'),'config':{'placeholder':_0x663b('0x23')},'props':{'title':_0x663b('0x23'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x663b('0x1e')](_0x663b('0x24'))?JSON['parse'](this[_0x663b('0x1e')](_0x663b('0x24'))):{};},'set':function(_0x247380){return this[_0x663b('0x21')](_0x663b('0x24'),JSON['stringify'](_0x247380));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x663b('0x25')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x663b('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x663b('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x663b('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x663b('0x2')]},'waitingTitle':{'type':Sequelize[_0x663b('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x663b('0x26')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x663b('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x663b('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x663b('0x2')],'defaultValue':_0x663b('0x28')},'skipUnmanaged':{'type':Sequelize[_0x663b('0x2')],'defaultValue':_0x663b('0x17')},'sendUnmanaged':{'type':Sequelize[_0x663b('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x663b('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x663b('0x10')],'defaultValue':function(){return _0x663b('0x29');}},'notificationSound':{'type':Sequelize[_0x663b('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x663b('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x663b('0x2')],'defaultValue':_0x663b('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x663b('0x2b')},'verticalAlignment':{'type':Sequelize[_0x663b('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x663b('0x2c')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x663b('0x10')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x663b('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x663b('0x2')],'allowNull':![],'defaultValue':_0x663b('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x663b('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x663b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x663b('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x663b('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x663b('0x8')],'comment':_0x663b('0x2e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x663b('0x2f'),'set':function(_0x28b748){if(!_0x28b748)this[_0x663b('0x21')](_0x663b('0x30'),null);this['setDataValue'](_0x663b('0x31'),_0x28b748);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 766afe1..b6cc65a 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 _0xb168=['threadId','externalUrl','ChatInteraction','interaction','contact','lastName','messageId','created','autoclose','push','unmanaged','*,*,*,*','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','EventManager','offline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','spread','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','email','omit','getInteractions','Contact','Tag','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','getProactiveActions','getLicense','virtual','License','chatLicenseExceeded','Intervals','all','some','readFileSync','server/files/chat/iframe.js','connection','replace','alignment','verticalAlignment','color','textColor','addApplications','sequelize','transaction','ChatApplication','bulkCreate','findAndCountAll','addProactiveActions','chatProactiveAction','getFields','online','offlineForm','onlineForm','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','http','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','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','limit','set','apply','reject','save','update','destroy','get','ChatWebsites','UserProfileResource','sendStatus','stack','name','send','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','query','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','params','keys','include','create','body','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','Disposition','getDispositions','ChatWebsiteId','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','ids','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','server/files/images/logos/default_logo.png','../../config/license/util','custom','isNil','existsSync','join','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','Applications','List','account','applications','list','orderBy','priority','asc','defaults','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','%s\x20%s\x20%s','vendor'];(function(_0x3e4419,_0x454b62){var _0x218914=function(_0x5d7eff){while(--_0x5d7eff){_0x3e4419['push'](_0x3e4419['shift']());}};_0x218914(++_0x454b62);}(_0xb168,0x17b));var _0x8b16=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xb168[_0x1beef3];return _0x5af964;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x8b16('0x0'));var zipdir=require(_0x8b16('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8b16('0x2'));var moment=require('moment');var BPromise=require(_0x8b16('0x3'));var Mustache=require(_0x8b16('0x4'));var util=require(_0x8b16('0x5'));var path=require('path');var sox=require(_0x8b16('0x6'));var csv=require(_0x8b16('0x7'));var ejs=require(_0x8b16('0x8'));var fs=require('fs');var _=require(_0x8b16('0x9'));var squel=require(_0x8b16('0xa'));var crypto=require('crypto');var jsforce=require(_0x8b16('0xb'));var deskjs=require(_0x8b16('0xc'));var toCsv=require(_0x8b16('0x7'));var querystring=require(_0x8b16('0xd'));var Papa=require(_0x8b16('0xe'));var Redis=require(_0x8b16('0xf'));var authService=require(_0x8b16('0x10'));var qs=require(_0x8b16('0x11'));var as=require(_0x8b16('0x12'));var hardwareService=require(_0x8b16('0x13'));var logger=require(_0x8b16('0x14'))(_0x8b16('0x15'));var utils=require(_0x8b16('0x16'));var config=require('../../config/environment');var db=require(_0x8b16('0x17'))['db'];config[_0x8b16('0x18')]=_['defaults'](config[_0x8b16('0x18')],{'host':_0x8b16('0x19'),'port':0x18eb});var socket=require(_0x8b16('0x1a'))(new Redis(config[_0x8b16('0x18')]));require('./chatWebsite.socket')[_0x8b16('0x1b')](socket);var jayson=require(_0x8b16('0x1c'));var client=jayson['client'][_0x8b16('0x1d')]({'port':0x232c});var client9002=jayson[_0x8b16('0x1e')][_0x8b16('0x1d')]({'port':0x232a});var client9003=jayson[_0x8b16('0x1e')][_0x8b16('0x1d')]({'port':0x232b});function checkPasswordPattern(_0x258112,_0x55cec2,_0x2c0b81){if(_0x2c0b81){var _0x326612=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x326612['test'](_0x55cec2)){return _0x258112;}else{throw new db[(_0x8b16('0x1f'))][(_0x8b16('0x20'))](_0x8b16('0x21'));}}else{return _0x258112;}}function respondWithRpcPromise(_0x42c6de,_0x4c6e7f,_0x165463,_0x987892){return new BPromise(function(_0x1adf32,_0x30cae0){var _0x931f9c=_0x987892||client;return _0x931f9c[_0x8b16('0x22')](_0x42c6de,_0x165463)[_0x8b16('0x23')](function(_0x30cd6c){logger[_0x8b16('0x24')](_0x8b16('0x25'),_0x4c6e7f,_0x8b16('0x26'));logger[_0x8b16('0x27')](_0x8b16('0x28'),_0x4c6e7f,_0x8b16('0x26'),JSON[_0x8b16('0x29')](_0x30cd6c));if(_0x30cd6c[_0x8b16('0x2a')]){if(_0x30cd6c['error'][_0x8b16('0x2b')]===0x1f4){logger[_0x8b16('0x2a')](_0x8b16('0x25'),_0x4c6e7f,_0x30cd6c[_0x8b16('0x2a')][_0x8b16('0x2c')]);return _0x30cae0(_0x30cd6c[_0x8b16('0x2a')][_0x8b16('0x2c')]);}logger['error'](_0x8b16('0x25'),_0x4c6e7f,_0x30cd6c[_0x8b16('0x2a')][_0x8b16('0x2c')]);return _0x1adf32(_0x30cd6c['error'][_0x8b16('0x2c')]);}else{logger['info'](_0x8b16('0x25'),_0x4c6e7f,_0x8b16('0x26'));_0x1adf32(_0x30cd6c[_0x8b16('0x2d')][_0x8b16('0x2c')]);}})[_0x8b16('0x2e')](function(_0x102a9c){logger[_0x8b16('0x2a')](_0x8b16('0x25'),_0x4c6e7f,_0x102a9c);_0x30cae0(_0x102a9c);});});}function respondWithStatusCode(_0x1f916a,_0x1bb1ef){_0x1bb1ef=_0x1bb1ef||0xcc;return function(_0x1668be){if(_0x1668be){return _0x1f916a['sendStatus'](_0x1bb1ef);}return _0x1f916a[_0x8b16('0x2f')](_0x1bb1ef)[_0x8b16('0x30')]();};}function respondWithResult(_0x3e2c22,_0x509d87){_0x509d87=_0x509d87||0xc8;return function(_0x3ad213){if(_0x3ad213){return _0x3e2c22[_0x8b16('0x2f')](_0x509d87)[_0x8b16('0x31')](_0x3ad213);}};}function respondWithFilteredResult(_0xf28dd0,_0x22e3fe){return function(_0x2bbea5){if(_0x2bbea5){var _0x55b1d0=_0x2bbea5['count'],_0x440aaf=_0x22e3fe['offset'],_0x970cfc=_0x22e3fe[_0x8b16('0x32')]+_0x22e3fe[_0x8b16('0x33')],_0x37357c;if(_0x970cfc>=_0x55b1d0){_0x970cfc=_0x55b1d0;_0x37357c=0xc8;}else{_0x37357c=0xce;}_0xf28dd0[_0x8b16('0x2f')](_0x37357c);return _0xf28dd0[_0x8b16('0x34')]('Content-Range',_0x440aaf+'-'+_0x970cfc+'/'+_0x55b1d0)[_0x8b16('0x31')](_0x2bbea5);}return null;};}function patchUpdates(_0x3adc2a){return function(_0x350d31){try{jsonpatch[_0x8b16('0x35')](_0x350d31,_0x3adc2a,!![]);}catch(_0x5b6bb0){return BPromise[_0x8b16('0x36')](_0x5b6bb0);}return _0x350d31[_0x8b16('0x37')]();};}function saveUpdates(_0xff4251,_0x4b8835){return function(_0x2bebda){if(_0x2bebda){return _0x2bebda[_0x8b16('0x38')](_0xff4251)[_0x8b16('0x23')](function(_0x1c6064){return _0x1c6064;});}return null;};}function removeEntity(_0x4f2ae1,_0x2c3c27){return function(_0x4a93bd){if(_0x4a93bd){return _0x4a93bd[_0x8b16('0x39')]()[_0x8b16('0x23')](function(){var _0x549604=_0x4a93bd[_0x8b16('0x3a')]({'plain':!![]});var _0x5f4177=_0x8b16('0x3b');return db[_0x8b16('0x3c')][_0x8b16('0x39')]({'where':{'type':_0x5f4177,'resourceId':_0x549604['id']}})[_0x8b16('0x23')](function(){return _0x4a93bd;});})['then'](function(){_0x4f2ae1[_0x8b16('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30ceff,_0x28327b){return function(_0x2fb12f){if(!_0x2fb12f){_0x30ceff[_0x8b16('0x3d')](0x194);}return _0x2fb12f;};}function handleError(_0x1ea489,_0x152360){_0x152360=_0x152360||0x1f4;return function(_0xb12077){logger[_0x8b16('0x2a')](_0xb12077[_0x8b16('0x3e')]);if(_0xb12077[_0x8b16('0x3f')]){delete _0xb12077[_0x8b16('0x3f')];}_0x1ea489[_0x8b16('0x2f')](_0x152360)[_0x8b16('0x40')](_0xb12077);};}exports['index']=function(_0x18bdd4,_0x5aa0a9){var _0x241699={'include':[{'model':db[_0x8b16('0x41')],'as':_0x8b16('0x42')}]},_0x4f7cad={},_0x297536={'count':0x0,'rows':[]};var _0x6bd9a4=_[_0x8b16('0x43')](db[_0x8b16('0x44')][_0x8b16('0x45')],function(_0x4b8d60){return{'name':_0x4b8d60[_0x8b16('0x46')],'type':_0x4b8d60[_0x8b16('0x47')][_0x8b16('0x48')]};});_0x4f7cad['model']=_[_0x8b16('0x43')](_0x6bd9a4,'name');_0x4f7cad[_0x8b16('0x49')]=_['keys'](_0x18bdd4[_0x8b16('0x49')]);_0x4f7cad['filters']=_['intersection'](_0x4f7cad[_0x8b16('0x4a')],_0x4f7cad['query']);_0x241699['attributes']=_[_0x8b16('0x4b')](_0x4f7cad['model'],qs[_0x8b16('0x4c')](_0x18bdd4['query']['fields']));_0x241699[_0x8b16('0x4d')]=_0x241699[_0x8b16('0x4d')][_0x8b16('0x4e')]?_0x241699[_0x8b16('0x4d')]:_0x4f7cad[_0x8b16('0x4a')];if(!_0x18bdd4['query'][_0x8b16('0x4f')](_0x8b16('0x50'))){_0x241699[_0x8b16('0x33')]=qs[_0x8b16('0x33')](_0x18bdd4['query'][_0x8b16('0x33')]);_0x241699[_0x8b16('0x32')]=qs[_0x8b16('0x32')](_0x18bdd4[_0x8b16('0x49')]['offset']);}_0x241699[_0x8b16('0x51')]=qs[_0x8b16('0x52')](_0x18bdd4[_0x8b16('0x49')][_0x8b16('0x52')]);_0x241699[_0x8b16('0x53')]=qs[_0x8b16('0x54')](_[_0x8b16('0x55')](_0x18bdd4[_0x8b16('0x49')],_0x4f7cad[_0x8b16('0x54')]));if(_0x18bdd4['query'][_0x8b16('0x56')]){_0x241699[_0x8b16('0x53')]=_[_0x8b16('0x57')](_0x241699['where'],{'$or':_[_0x8b16('0x43')](_0x6bd9a4,function(_0x322de6){if(_0x322de6[_0x8b16('0x47')]!==_0x8b16('0x58')){var _0xa6f57f={};_0xa6f57f[_0x322de6[_0x8b16('0x3f')]]={'$like':'%'+_0x18bdd4[_0x8b16('0x49')]['filter']+'%'};return _0xa6f57f;}})});}_0x241699=_['merge']({},_0x241699,_0x18bdd4[_0x8b16('0x59')]);var _0x34dd91={'where':_0x241699['where']};return db['ChatWebsite']['count'](_0x34dd91)['then'](function(_0x3cf0de){_0x297536[_0x8b16('0x5a')]=_0x3cf0de;if(_0x18bdd4[_0x8b16('0x49')][_0x8b16('0x5b')]){_0x241699['include']=[{'all':!![]}];}return db[_0x8b16('0x44')][_0x8b16('0x5c')](_0x241699);})[_0x8b16('0x23')](function(_0x2420fb){_0x297536[_0x8b16('0x5d')]=_0x2420fb;return _0x297536;})[_0x8b16('0x23')](respondWithFilteredResult(_0x5aa0a9,_0x241699))[_0x8b16('0x2e')](handleError(_0x5aa0a9,null));};exports['show']=function(_0x95ab2b,_0x27505c){var _0x3e5852={'raw':![],'where':{'id':_0x95ab2b[_0x8b16('0x5e')]['id']},'include':[{'model':db[_0x8b16('0x41')],'as':_0x8b16('0x42')}]},_0x3d6445={};_0x3d6445[_0x8b16('0x4a')]=_[_0x8b16('0x5f')](db[_0x8b16('0x44')][_0x8b16('0x45')]);_0x3d6445[_0x8b16('0x49')]=_[_0x8b16('0x5f')](_0x95ab2b[_0x8b16('0x49')]);_0x3d6445[_0x8b16('0x54')]=_['intersection'](_0x3d6445['model'],_0x3d6445[_0x8b16('0x49')]);_0x3e5852[_0x8b16('0x4d')]=_[_0x8b16('0x4b')](_0x3d6445['model'],qs['fields'](_0x95ab2b['query'][_0x8b16('0x4c')]));_0x3e5852[_0x8b16('0x4d')]=_0x3e5852[_0x8b16('0x4d')]['length']?_0x3e5852[_0x8b16('0x4d')]:_0x3d6445[_0x8b16('0x4a')];if(_0x95ab2b[_0x8b16('0x49')][_0x8b16('0x5b')]){_0x3e5852[_0x8b16('0x60')]=[{'all':!![]}];}_0x3e5852=_[_0x8b16('0x57')]({},_0x3e5852,_0x95ab2b[_0x8b16('0x59')]);return db[_0x8b16('0x44')]['find'](_0x3e5852)[_0x8b16('0x23')](handleEntityNotFound(_0x27505c,null))['then'](respondWithResult(_0x27505c,null))['catch'](handleError(_0x27505c,null));};exports[_0x8b16('0x61')]=function(_0x33795c,_0x54b98e){return db[_0x8b16('0x44')]['create'](_0x33795c[_0x8b16('0x62')],{})['then'](function(_0x1e67c7){var _0x229a53=_0x33795c[_0x8b16('0x63')][_0x8b16('0x3a')]({'plain':!![]});if(!_0x229a53)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x229a53['role']==='user'){var _0x3f2775=_0x1e67c7[_0x8b16('0x3a')]({'plain':!![]});var _0x2c7b8a=_0x8b16('0x3b');return db['UserProfileSection']['find']({'where':{'name':_0x2c7b8a,'userProfileId':_0x229a53[_0x8b16('0x64')]},'raw':!![]})[_0x8b16('0x23')](function(_0x218a7f){if(_0x218a7f&&_0x218a7f[_0x8b16('0x65')]===0x0){return db[_0x8b16('0x3c')]['create']({'name':_0x3f2775[_0x8b16('0x3f')],'resourceId':_0x3f2775['id'],'type':_0x218a7f[_0x8b16('0x3f')],'sectionId':_0x218a7f['id']},{})[_0x8b16('0x23')](function(){return _0x1e67c7;});}else{return _0x1e67c7;}})[_0x8b16('0x2e')](function(_0x1a8815){logger[_0x8b16('0x2a')](_0x8b16('0x66'),_0x1a8815);throw _0x1a8815;});}return _0x1e67c7;})[_0x8b16('0x23')](respondWithResult(_0x54b98e,0xc9))[_0x8b16('0x2e')](handleError(_0x54b98e,null));};exports[_0x8b16('0x38')]=function(_0x363ad9,_0x41636d){if(_0x363ad9['body']['id']){delete _0x363ad9['body']['id'];}return db[_0x8b16('0x44')][_0x8b16('0x67')]({'where':{'id':_0x363ad9[_0x8b16('0x5e')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x8b16('0x23')](handleEntityNotFound(_0x41636d,null))[_0x8b16('0x23')](saveUpdates(_0x363ad9[_0x8b16('0x62')],null))[_0x8b16('0x23')](respondWithResult(_0x41636d,null))[_0x8b16('0x2e')](handleError(_0x41636d,null));};exports[_0x8b16('0x39')]=function(_0x4be587,_0x4a04d9){return db[_0x8b16('0x44')][_0x8b16('0x67')]({'where':{'id':_0x4be587[_0x8b16('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4a04d9,null))[_0x8b16('0x23')](removeEntity(_0x4a04d9,null))['catch'](handleError(_0x4a04d9,null));};exports[_0x8b16('0x68')]=function(_0x3cc581,_0x312c54){return db['ChatWebsite'][_0x8b16('0x68')]()['then'](respondWithResult(_0x312c54,null))['catch'](handleError(_0x312c54,null));};exports[_0x8b16('0x69')]=function(_0x214999,_0x5bf64d,_0x15e0cb){if(_0x214999['body']['id']){delete _0x214999['body']['id'];}return db[_0x8b16('0x44')][_0x8b16('0x67')]({'where':{'id':_0x214999[_0x8b16('0x5e')]['id']}})[_0x8b16('0x23')](handleEntityNotFound(_0x5bf64d,null))[_0x8b16('0x23')](function(_0x3d6588){if(_0x3d6588){_0x214999['body']['ChatWebsiteId']=_0x3d6588['id'];return db[_0x8b16('0x6a')]['create'](_0x214999[_0x8b16('0x62')]);}})[_0x8b16('0x23')](respondWithResult(_0x5bf64d,null))['catch'](handleError(_0x5bf64d,null));};exports[_0x8b16('0x6b')]=function(_0x34d05e,_0x67b7cd,_0x1fccdc){var _0x1645ff={'raw':![],'where':{}};var _0x52a021={};var _0x2c19e3={'count':0x0,'rows':[]};return db[_0x8b16('0x44')]['findOne']({'where':{'id':_0x34d05e[_0x8b16('0x5e')]['id']}})[_0x8b16('0x23')](handleEntityNotFound(_0x67b7cd,null))['then'](function(_0x3f4205){if(_0x3f4205){_0x52a021['model']=_[_0x8b16('0x5f')](db[_0x8b16('0x6a')][_0x8b16('0x45')]);_0x52a021['query']=_[_0x8b16('0x5f')](_0x34d05e[_0x8b16('0x49')]);_0x52a021[_0x8b16('0x54')]=_[_0x8b16('0x4b')](_0x52a021[_0x8b16('0x4a')],_0x52a021[_0x8b16('0x49')]);_0x1645ff[_0x8b16('0x4d')]=_[_0x8b16('0x4b')](_0x52a021[_0x8b16('0x4a')],qs[_0x8b16('0x4c')](_0x34d05e[_0x8b16('0x49')][_0x8b16('0x4c')]));_0x1645ff[_0x8b16('0x4d')]=_0x1645ff[_0x8b16('0x4d')]['length']?_0x1645ff[_0x8b16('0x4d')]:_0x52a021[_0x8b16('0x4a')];if(!_0x34d05e[_0x8b16('0x49')]['hasOwnProperty'](_0x8b16('0x50'))){_0x1645ff[_0x8b16('0x33')]=qs[_0x8b16('0x33')](_0x34d05e[_0x8b16('0x49')]['limit']);_0x1645ff[_0x8b16('0x32')]=qs[_0x8b16('0x32')](_0x34d05e[_0x8b16('0x49')][_0x8b16('0x32')]);}_0x1645ff['order']=qs['sort'](_0x34d05e[_0x8b16('0x49')]['sort']);_0x1645ff[_0x8b16('0x53')]=qs[_0x8b16('0x54')](_[_0x8b16('0x55')](_0x34d05e['query'],_0x52a021[_0x8b16('0x54')]));_0x1645ff[_0x8b16('0x53')][_0x8b16('0x6c')]=_0x3f4205['id'];if(_0x34d05e['query'][_0x8b16('0x56')]){_0x1645ff[_0x8b16('0x53')]=_[_0x8b16('0x57')](_0x1645ff[_0x8b16('0x53')],{'$or':_[_0x8b16('0x43')](_0x1645ff[_0x8b16('0x4d')],function(_0x322c0e){var _0x1fc2e0={};_0x1fc2e0[_0x322c0e]={'$like':'%'+_0x34d05e['query'][_0x8b16('0x56')]+'%'};return _0x1fc2e0;})});}_0x1645ff=_['merge']({},_0x1645ff,_0x34d05e[_0x8b16('0x59')]);return db[_0x8b16('0x6a')][_0x8b16('0x5a')]({'where':_0x1645ff[_0x8b16('0x53')]})[_0x8b16('0x23')](function(_0x10d97a){_0x2c19e3[_0x8b16('0x5a')]=_0x10d97a;if(_0x34d05e[_0x8b16('0x49')][_0x8b16('0x5b')]){_0x1645ff['include']=[{'all':!![]}];}return db['Disposition'][_0x8b16('0x5c')](_0x1645ff);})[_0x8b16('0x23')](function(_0x15bc5a){_0x2c19e3['rows']=_0x15bc5a;return _0x2c19e3;});}})[_0x8b16('0x23')](respondWithFilteredResult(_0x67b7cd,_0x1645ff))[_0x8b16('0x2e')](handleError(_0x67b7cd,null));};exports['removeDispositions']=function(_0x41f96c,_0x539476,_0x439577){return db['ChatWebsite'][_0x8b16('0x67')]({'where':{'id':_0x41f96c[_0x8b16('0x5e')]['id']}})[_0x8b16('0x23')](handleEntityNotFound(_0x539476,null))[_0x8b16('0x23')](function(_0x20e2d7){if(_0x20e2d7){return _0x20e2d7['removeDispositions'](_0x41f96c['query']['ids']);}})[_0x8b16('0x23')](respondWithStatusCode(_0x539476,null))[_0x8b16('0x2e')](handleError(_0x539476,null));};exports[_0x8b16('0x6d')]=function(_0x12cef0,_0x1bccd7,_0x23ce8c){if(_0x12cef0[_0x8b16('0x62')]['id']){delete _0x12cef0[_0x8b16('0x62')]['id'];}return db[_0x8b16('0x44')][_0x8b16('0x67')]({'where':{'id':_0x12cef0['params']['id']}})['then'](handleEntityNotFound(_0x1bccd7,null))[_0x8b16('0x23')](function(_0x54761c){if(_0x54761c){_0x12cef0[_0x8b16('0x62')][_0x8b16('0x6c')]=_0x54761c['id'];return db[_0x8b16('0x6e')][_0x8b16('0x61')](_0x12cef0['body']);}})[_0x8b16('0x23')](respondWithResult(_0x1bccd7,null))[_0x8b16('0x2e')](handleError(_0x1bccd7,null));};exports[_0x8b16('0x6f')]=function(_0x1fd67a,_0x174868,_0x4f9431){var _0xcec4cb={'raw':![],'where':{}};var _0x1214db={};var _0x1c4b5e={'count':0x0,'rows':[]};return db[_0x8b16('0x44')][_0x8b16('0x70')]({'where':{'id':_0x1fd67a[_0x8b16('0x5e')]['id']}})[_0x8b16('0x23')](handleEntityNotFound(_0x174868,null))['then'](function(_0x1a84fe){if(_0x1a84fe){_0x1214db[_0x8b16('0x4a')]=_['keys'](db[_0x8b16('0x6e')][_0x8b16('0x45')]);_0x1214db[_0x8b16('0x49')]=_[_0x8b16('0x5f')](_0x1fd67a[_0x8b16('0x49')]);_0x1214db[_0x8b16('0x54')]=_[_0x8b16('0x4b')](_0x1214db[_0x8b16('0x4a')],_0x1214db[_0x8b16('0x49')]);_0xcec4cb['attributes']=_[_0x8b16('0x4b')](_0x1214db['model'],qs['fields'](_0x1fd67a[_0x8b16('0x49')][_0x8b16('0x4c')]));_0xcec4cb[_0x8b16('0x4d')]=_0xcec4cb[_0x8b16('0x4d')]['length']?_0xcec4cb['attributes']:_0x1214db[_0x8b16('0x4a')];if(!_0x1fd67a[_0x8b16('0x49')][_0x8b16('0x4f')](_0x8b16('0x50'))){_0xcec4cb[_0x8b16('0x33')]=qs['limit'](_0x1fd67a[_0x8b16('0x49')][_0x8b16('0x33')]);_0xcec4cb[_0x8b16('0x32')]=qs[_0x8b16('0x32')](_0x1fd67a[_0x8b16('0x49')][_0x8b16('0x32')]);}_0xcec4cb['order']=qs[_0x8b16('0x52')](_0x1fd67a['query']['sort']);_0xcec4cb[_0x8b16('0x53')]=qs[_0x8b16('0x54')](_[_0x8b16('0x55')](_0x1fd67a[_0x8b16('0x49')],_0x1214db['filters']));_0xcec4cb[_0x8b16('0x53')][_0x8b16('0x6c')]=_0x1a84fe['id'];if(_0x1fd67a[_0x8b16('0x49')][_0x8b16('0x56')]){_0xcec4cb['where']=_['merge'](_0xcec4cb[_0x8b16('0x53')],{'$or':_[_0x8b16('0x43')](_0xcec4cb[_0x8b16('0x4d')],function(_0x4be5db){var _0xf60d1d={};_0xf60d1d[_0x4be5db]={'$like':'%'+_0x1fd67a[_0x8b16('0x49')][_0x8b16('0x56')]+'%'};return _0xf60d1d;})});}_0xcec4cb=_[_0x8b16('0x57')]({},_0xcec4cb,_0x1fd67a['options']);return db['CannedAnswer']['count']({'where':_0xcec4cb[_0x8b16('0x53')]})[_0x8b16('0x23')](function(_0x38a5d6){_0x1c4b5e[_0x8b16('0x5a')]=_0x38a5d6;if(_0x1fd67a[_0x8b16('0x49')][_0x8b16('0x5b')]){_0xcec4cb[_0x8b16('0x60')]=[{'all':!![]}];}return db[_0x8b16('0x6e')][_0x8b16('0x5c')](_0xcec4cb);})[_0x8b16('0x23')](function(_0x149fc1){_0x1c4b5e[_0x8b16('0x5d')]=_0x149fc1;return _0x1c4b5e;});}})['then'](respondWithFilteredResult(_0x174868,_0xcec4cb))[_0x8b16('0x2e')](handleError(_0x174868,null));};exports[_0x8b16('0x71')]=function(_0x22bac3,_0x42799f,_0x4398c7){return db[_0x8b16('0x44')][_0x8b16('0x67')]({'where':{'id':_0x22bac3[_0x8b16('0x5e')]['id']}})[_0x8b16('0x23')](handleEntityNotFound(_0x42799f,null))[_0x8b16('0x23')](function(_0x3ba37d){if(_0x3ba37d){return _0x3ba37d['removeAnswers'](_0x22bac3['query'][_0x8b16('0x72')]);}})[_0x8b16('0x23')](respondWithStatusCode(_0x42799f,null))[_0x8b16('0x2e')](handleError(_0x42799f,null));};exports['addLogo']=function(_0x23cae8,_0x372acc,_0x2f4ef9){_0x23cae8[_0x8b16('0x62')][_0x8b16('0x73')]=_0x23cae8[_0x8b16('0x74')][_0x8b16('0x75')];return db[_0x8b16('0x44')]['find']({'where':{'id':_0x23cae8[_0x8b16('0x5e')]['id']}})[_0x8b16('0x23')](handleEntityNotFound(_0x372acc,null))['then'](saveUpdates(_0x23cae8[_0x8b16('0x62')],null))[_0x8b16('0x23')](respondWithResult(_0x372acc,null))['catch'](handleError(_0x372acc,null));};exports[_0x8b16('0x76')]=function(_0x2e709f,_0x368975,_0x4177ce){_0x2e709f[_0x8b16('0x62')][_0x8b16('0x77')]=_0x2e709f[_0x8b16('0x74')]['filename'];return db[_0x8b16('0x44')][_0x8b16('0x67')]({'where':{'id':_0x2e709f['params']['id']}})[_0x8b16('0x23')](handleEntityNotFound(_0x368975,null))[_0x8b16('0x23')](saveUpdates(_0x2e709f['body'],null))[_0x8b16('0x23')](respondWithResult(_0x368975,null))['catch'](handleError(_0x368975,null));};exports[_0x8b16('0x78')]=function(_0x2e8d38,_0x292362,_0x29206c){_0x2e8d38[_0x8b16('0x62')][_0x8b16('0x79')]=_0x2e8d38[_0x8b16('0x74')][_0x8b16('0x75')];return db[_0x8b16('0x44')]['find']({'where':{'id':_0x2e8d38[_0x8b16('0x5e')]['id']}})[_0x8b16('0x23')](handleEntityNotFound(_0x292362,null))[_0x8b16('0x23')](saveUpdates(_0x2e8d38[_0x8b16('0x62')],null))[_0x8b16('0x23')](respondWithResult(_0x292362,null))[_0x8b16('0x2e')](handleError(_0x292362,null));};exports['addSystemAvatar']=function(_0x21ffe0,_0x497477,_0x67230d){_0x21ffe0['body'][_0x8b16('0x7a')]=_0x21ffe0['file'][_0x8b16('0x75')];return db['ChatWebsite']['find']({'where':{'id':_0x21ffe0[_0x8b16('0x5e')]['id']}})[_0x8b16('0x23')](handleEntityNotFound(_0x497477,null))[_0x8b16('0x23')](saveUpdates(_0x21ffe0[_0x8b16('0x62')],null))[_0x8b16('0x23')](respondWithResult(_0x497477,null))[_0x8b16('0x2e')](handleError(_0x497477,null));};exports[_0x8b16('0x7b')]=function(_0x31843d,_0x478ee4,_0xd4b779){var _0xf80695=path['join'](config['root'],_0x8b16('0x7c'));var _0xd6f18a={'where':{'id':_0x31843d[_0x8b16('0x5e')]['id']},'attributes':['id',_0x8b16('0x73')],'raw':!![]};var _0x29ea0a=![];return require(_0x8b16('0x7d'))['getLicense']()[_0x8b16('0x23')](function(_0x193d0a){if(_0x193d0a){_0x29ea0a=_0x193d0a[_0x8b16('0x7e')];}})[_0x8b16('0x23')](function(){return db[_0x8b16('0x44')][_0x8b16('0x67')](_0xd6f18a);})['then'](handleEntityNotFound(_0x478ee4,null))[_0x8b16('0x23')](function(_0x5606f0){if(_0x5606f0){if(!_[_0x8b16('0x7f')](_0x5606f0[_0x8b16('0x73')])){if(fs[_0x8b16('0x80')](path[_0x8b16('0x81')](config[_0x8b16('0x82')],_0x8b16('0x83'),_0x5606f0[_0x8b16('0x73')]))&&_0x29ea0a){_0xf80695=path[_0x8b16('0x81')](config[_0x8b16('0x82')],_0x8b16('0x83'),_0x5606f0[_0x8b16('0x73')]);}}return _0x478ee4[_0x8b16('0x84')](_0xf80695);}})[_0x8b16('0x2e')](handleError(_0x478ee4,null));};exports[_0x8b16('0x85')]=function(_0x4c747f,_0x5507dc,_0x58bc8c){var _0xd55c25=path[_0x8b16('0x81')](config[_0x8b16('0x82')],_0x8b16('0x86'));var _0xc9e210={'where':{'id':_0x4c747f[_0x8b16('0x5e')]['id']},'attributes':['id',_0x8b16('0x77')],'raw':!![]};return db[_0x8b16('0x44')][_0x8b16('0x67')](_0xc9e210)['then'](handleEntityNotFound(_0x5507dc,null))[_0x8b16('0x23')](function(_0x532e9c){if(_0x532e9c){if(!_[_0x8b16('0x7f')](_0x532e9c[_0x8b16('0x77')])){if(fs[_0x8b16('0x80')](path['join'](config['root'],'server/files/images/avatars/',_0x532e9c['agentAvatar']))){_0xd55c25=path[_0x8b16('0x81')](config[_0x8b16('0x82')],_0x8b16('0x87'),_0x532e9c['agentAvatar']);}}return _0x5507dc[_0x8b16('0x84')](_0xd55c25);}})['catch'](handleError(_0x5507dc,null));};exports[_0x8b16('0x88')]=function(_0x3154e4,_0x3c14b2,_0x333c94){var _0xca83ba=path[_0x8b16('0x81')](config[_0x8b16('0x82')],_0x8b16('0x89'));var _0x5defa5={'where':{'id':_0x3154e4[_0x8b16('0x5e')]['id']},'attributes':['id',_0x8b16('0x79'),_0x8b16('0x8a')],'raw':!![]};return db[_0x8b16('0x44')][_0x8b16('0x67')](_0x5defa5)['then'](handleEntityNotFound(_0x3c14b2,null))[_0x8b16('0x23')](function(_0x49c4d6){if(_0x49c4d6){if(!_[_0x8b16('0x7f')](_0x49c4d6[_0x8b16('0x79')])){if(fs[_0x8b16('0x80')](path[_0x8b16('0x81')](config[_0x8b16('0x82')],_0x8b16('0x87'),_0x49c4d6[_0x8b16('0x79')]))&&_0x49c4d6[_0x8b16('0x8a')]){_0xca83ba=path['join'](config['root'],_0x8b16('0x87'),_0x49c4d6['customerAvatar']);}}return _0x3c14b2[_0x8b16('0x84')](_0xca83ba);}})['catch'](handleError(_0x3c14b2,null));};exports[_0x8b16('0x8b')]=function(_0xec563e,_0x135938,_0x4c9bc3){var _0x3bdb09=path[_0x8b16('0x81')](config[_0x8b16('0x82')],_0x8b16('0x8c'));var _0x2e5f61={'where':{'id':_0xec563e['params']['id']},'attributes':['id',_0x8b16('0x7a')],'raw':!![]};return db[_0x8b16('0x44')][_0x8b16('0x67')](_0x2e5f61)['then'](handleEntityNotFound(_0x135938,null))[_0x8b16('0x23')](function(_0x441b4d){if(_0x441b4d){if(!_[_0x8b16('0x7f')](_0x441b4d[_0x8b16('0x7a')])){if(fs[_0x8b16('0x80')](path['join'](config[_0x8b16('0x82')],_0x8b16('0x87'),_0x441b4d[_0x8b16('0x7a')]))){_0x3bdb09=path[_0x8b16('0x81')](config['root'],_0x8b16('0x87'),_0x441b4d[_0x8b16('0x7a')]);}}return _0x135938[_0x8b16('0x84')](_0x3bdb09);}})['catch'](handleError(_0x135938,null));};exports[_0x8b16('0x8d')]=function(_0x4ff383,_0x210f77,_0x3331e2){var _0x5ae60e=require(_0x8b16('0x8e'));var _0x322324=new _0x5ae60e();var _0x2ab64e=_0x322324[_0x8b16('0x8f')](_0x4ff383[_0x8b16('0x90')][_0x8b16('0x91')])[_0x8b16('0x92')]();var _0x5a66c4={'body':_0x4ff383[_0x8b16('0x62')],'channel':_0x8b16('0x93')};var _0x2cf18a=[];var _0x2b0022=[];var _0x523f41={};var _0x5796b2=![];return db[_0x8b16('0x94')][_0x8b16('0x68')]()['then'](function(_0x74b2f6){if(!_0x74b2f6){throw new db[(_0x8b16('0x1f'))]['ValidationError'](_0x8b16('0x95'));}_0x2cf18a=_['difference'](_[_0x8b16('0x5f')](_0x74b2f6),[_0x8b16('0x96'),_0x8b16('0x97')]);_0x2b0022=_[_0x8b16('0x98')](_[_0x8b16('0x5f')](_0x74b2f6),[_0x8b16('0x96'),_0x8b16('0x97'),_0x8b16('0x99'),_0x8b16('0x9a')]);if(_0x4ff383['body']['id']){delete _0x4ff383['body']['id'];}if(_[_0x8b16('0x7f')](_0x4ff383[_0x8b16('0x62')][_0x8b16('0x9b')])){throw new db[(_0x8b16('0x1f'))][(_0x8b16('0x20'))](_0x8b16('0x9c'));}if(_[_0x8b16('0x7f')](_0x4ff383[_0x8b16('0x62')][_0x8b16('0x62')])||_0x4ff383['body']['body']===''){throw new db['Sequelize'][(_0x8b16('0x20'))](_0x8b16('0x9d'));}if(_[_0x8b16('0x7f')](_0x4ff383[_0x8b16('0x62')][_0x8b16('0x9e')])){throw new db[(_0x8b16('0x1f'))][(_0x8b16('0x20'))](_0x8b16('0x9f')+_0x2b0022);}if(!_[_0x8b16('0xa0')](_0x2b0022,_0x4ff383[_0x8b16('0x62')][_0x8b16('0x9e')])){throw new db[(_0x8b16('0x1f'))]['ValidationError'](_0x8b16('0xa1')+_0x2b0022);}_0x523f41[_0x4ff383[_0x8b16('0x62')][_0x8b16('0x9e')]]=_0x4ff383['body'][_0x8b16('0x9b')];})[_0x8b16('0x23')](function(){return db[_0x8b16('0x44')]['find']({'where':{'id':_0x4ff383['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x8b16('0x94')],'as':_0x8b16('0xa2'),'where':_0x523f41,'limit':0x1,'order':[['updatedAt',_0x8b16('0xa3')]]}]},{'model':db['ChatApplication'],'as':_0x8b16('0xa4')}]});})[_0x8b16('0x23')](handleEntityNotFound(_0x210f77,null))[_0x8b16('0x23')](function(_0x91013){if(_0x91013&&_0x91013[_0x8b16('0xa5')]){_0x5a66c4[_0x8b16('0xa6')]=_0x91013;_0x5a66c4[_0x8b16('0xa7')]=_0x91013['Applications'];_0x5a66c4[_0x8b16('0xa8')]=_0x91013['List'];_0x5a66c4[_0x8b16('0xa7')]=_[_0x8b16('0xa9')](_0x5a66c4[_0x8b16('0xa7')],[_0x8b16('0xaa')],[_0x8b16('0xab')]);if(_0x5a66c4[_0x8b16('0xa6')][_0x8b16('0xa4')]){delete _0x5a66c4[_0x8b16('0xa6')][_0x8b16('0xa4')];}if(_0x5a66c4[_0x8b16('0xa6')][_0x8b16('0xa5')]&&_0x5a66c4[_0x8b16('0xa6')]['List']['Contacts'][_0x8b16('0x4e')]){return _0x5a66c4['account'][_0x8b16('0xa5')][_0x8b16('0xa2')][0x0];}var _0x45a981=_[_0x8b16('0xac')](_0x4ff383['body'],{'firstName':_0x4ff383[_0x8b16('0x62')][_0x8b16('0x9b')],'ListId':_0x91013[_0x8b16('0x9a')]});_0x45a981[_0x4ff383[_0x8b16('0x62')][_0x8b16('0x9e')]]=_0x4ff383[_0x8b16('0x62')][_0x8b16('0x9b')];return db[_0x8b16('0x94')][_0x8b16('0x61')](_0x45a981,{'fields':_0x2cf18a,'raw':!![]});}})[_0x8b16('0x23')](handleEntityNotFound(_0x210f77,null))[_0x8b16('0x23')](function(_0x132a54){_0x5a66c4['contact']=_0x132a54;var _0x232145=_0x4ff383['body'][_0x8b16('0xad')];if(_0x4ff383['headers'][_0x8b16('0xae')]){_0x232145=_0x4ff383[_0x8b16('0x90')]['cf-connecting-ip'];}else if(_0x4ff383[_0x8b16('0x90')][_0x8b16('0xaf')]){_0x232145=_[_0x8b16('0xb0')](_0x4ff383[_0x8b16('0x90')][_0x8b16('0xaf')][_0x8b16('0xb1')](','));}if(_0x132a54){var _0x42e2b0={'ContactId':_0x132a54['id'],'ChatWebsiteId':_0x4ff383['params']['id'],'from':(_0x132a54[_0x8b16('0xb2')]||'')+'\x20'+(_0x132a54['lastName']||''),'customerIp':_0x232145,'customerPort':_0x4ff383[_0x8b16('0x90')][_0x8b16('0xb3')]?_0x4ff383[_0x8b16('0x90')][_0x8b16('0xb3')]:null,'referer':_0x4ff383['body'][_0x8b16('0xb4')],'browserName':_0x2ab64e[_0x8b16('0xb5')][_0x8b16('0x3f')]&&_0x2ab64e[_0x8b16('0xb5')][_0x8b16('0xb6')]?util[_0x8b16('0xb7')]('%s\x20%s',_0x2ab64e['browser'][_0x8b16('0x3f')],_0x2ab64e[_0x8b16('0xb5')][_0x8b16('0xb6')]):_0x8b16('0xb8'),'browserVersion':_0x2ab64e[_0x8b16('0xb5')]['version']||_0x8b16('0xb8'),'osName':util[_0x8b16('0xb7')](_0x8b16('0xb9'),_0x2ab64e['os'][_0x8b16('0x3f')],_0x2ab64e['os'][_0x8b16('0xb6')]),'osVersion':_0x2ab64e['os'][_0x8b16('0xb6')],'deviceModel':_0x2ab64e[_0x8b16('0xba')][_0x8b16('0x4a')]&&_0x2ab64e[_0x8b16('0xba')]['vendor']?util[_0x8b16('0xb7')](_0x8b16('0xbb'),_0x2ab64e[_0x8b16('0xba')][_0x8b16('0x4a')],_0x2ab64e[_0x8b16('0xba')][_0x8b16('0xbc')],_0x2ab64e[_0x8b16('0xba')][_0x8b16('0x47')]):null,'deviceVendor':_0x2ab64e[_0x8b16('0xba')][_0x8b16('0xbc')],'deviceType':_0x2ab64e[_0x8b16('0xba')]['type'],'formData':JSON[_0x8b16('0x29')](_0x4ff383[_0x8b16('0x62')])};var _0x4b426a={'ChatWebsiteId':_0x4ff383[_0x8b16('0x5e')]['id'],'closed':![]};if(_0x4ff383[_0x8b16('0x62')][_0x8b16('0xbd')]){_0x4b426a[_0x8b16('0xbd')]=_0x4ff383['body']['threadId'];return db['ChatInteraction'][_0x8b16('0x67')]({'where':_0x4b426a})[_0x8b16('0x23')](function(_0x1f724d){if(_0x1f724d){return[_0x1f724d,![]];}_0x42e2b0[_0x8b16('0xbd')]=_0x4ff383['body'][_0x8b16('0xbd')];_0x42e2b0[_0x8b16('0xbe')]=_0x4ff383[_0x8b16('0x62')][_0x8b16('0xbe')];return db[_0x8b16('0xbf')][_0x8b16('0x61')](_0x42e2b0)['then'](function(_0x395675){return[_0x395675,!![]];});});}_0x4b426a['ContactId']=_0x132a54['id'];if(_0x4ff383[_0x8b16('0x62')][_0x8b16('0xc0')]&&_0x4ff383['body'][_0x8b16('0xc0')]['id']){_0x4b426a['id']=_0x4ff383[_0x8b16('0x62')][_0x8b16('0xc0')]['id'];return db[_0x8b16('0xbf')][_0x8b16('0x67')]({'where':_0x4b426a})[_0x8b16('0x23')](function(_0x35d124){if(_0x35d124){return[_0x35d124,![]];}return db['ChatInteraction'][_0x8b16('0x61')](_0x42e2b0)[_0x8b16('0x23')](function(_0x382270){return[_0x382270,!![]];});});}return db[_0x8b16('0xbf')][_0x8b16('0x61')](_0x42e2b0)['then'](function(_0x22f5cb){return[_0x22f5cb,!![]];});}})['spread'](function(_0x289fa2,_0xde131){if(_0x289fa2){_0x5796b2=_0xde131;if(!_0xde131){var _0x4db19a={'from':(_0x5a66c4[_0x8b16('0xc1')][_0x8b16('0xb2')]||'')+'\x20'+(_0x5a66c4['contact'][_0x8b16('0xc2')]||'')};if(_0x4ff383[_0x8b16('0x62')][_0x8b16('0xbd')]&&_0x4ff383[_0x8b16('0x62')][_0x8b16('0xc3')]&&_0x4ff383['body'][_0x8b16('0xbd')]!=_0x4ff383[_0x8b16('0x62')][_0x8b16('0xc3')]){_0x4db19a['threadId']=_0x4ff383['body'][_0x8b16('0xc3')];}return _0x289fa2[_0x8b16('0x38')](_0x4db19a);}else{return _0x289fa2;}}})[_0x8b16('0x23')](function(_0x2e8c22){_0x5a66c4[_0x8b16('0xc0')]=_0x2e8c22[_0x8b16('0x3a')]({'plain':!![]});_0x5a66c4[_0x8b16('0xc0')][_0x8b16('0xc4')]=_0x5796b2;if(_0x5a66c4['interaction'][_0x8b16('0xc4')]){if(_0x5a66c4['account'][_0x8b16('0xc5')]){_0x5a66c4[_0x8b16('0xa7')][_0x8b16('0xc6')]({'id':0x0,'priority':_0x5a66c4[_0x8b16('0xa7')][_0x8b16('0x4e')]+0x1,'app':'close','appdata':_0x8b16('0xc7'),'interval':_0x8b16('0xc8')});}}return db['ChatMessage'][_0x8b16('0x61')]({'body':_0x4ff383[_0x8b16('0x62')][_0x8b16('0x62')],'ChatWebsiteId':_0x4ff383[_0x8b16('0x5e')]['id'],'ChatInteractionId':_0x2e8c22['id'],'direction':'in','ContactId':_0x5a66c4[_0x8b16('0xc1')]['id'],'AttachmentId':_0x4ff383[_0x8b16('0x62')]['AttachmentId']});})['then'](function(_0x430049){_0x5a66c4[_0x8b16('0x2c')]=_0x430049;if(_0x5a66c4[_0x8b16('0xc0')][_0x8b16('0xc9')]){return db[_0x8b16('0xca')][_0x8b16('0x67')]({'attributes':['id','name'],'where':{'id':_0x5a66c4[_0x8b16('0xc0')][_0x8b16('0xc9')]}})[_0x8b16('0x23')](function(_0x26ea2f){if(_0x26ea2f){_0x5a66c4[_0x8b16('0xa7')][_0x8b16('0xcb')]({'id':0x0,'priority':0x0,'app':_0x8b16('0xcc'),'appdata':_0x26ea2f['name']+','+(_0x5a66c4[_0x8b16('0xa6')][_0x8b16('0xcd')]||0xa),'interval':'*,*,*,*'});_0x5a66c4[_0x8b16('0xce')]=!![];}return respondWithRpcPromise(_0x8b16('0xcf'),'startRouting',_0x5a66c4);});}return respondWithRpcPromise(_0x8b16('0xcf'),'startRouting',_0x5a66c4);})[_0x8b16('0x23')](function(_0x1f415e){respondWithRpcPromise(_0x8b16('0xd0'),'EventManager',{'event':_0x8b16('0x8d'),'message':_0x1f415e},client9002);return _0x1f415e;})['then'](respondWithResult(_0x210f77,null))['catch'](handleError(_0x210f77,null));};exports[_0x8b16('0xd1')]=function(_0x313be1,_0x4a7c78,_0x6a0db6){var _0x5181c9,_0x3cad05,_0x3e7ce1;var _0x2fb5c2=[];var _0x4cb0c2=[];var _0x339358={};return db['CmContact'][_0x8b16('0x68')]()[_0x8b16('0x23')](function(_0x33afcf){if(!_0x33afcf){throw new db['Sequelize'][(_0x8b16('0x20'))](_0x8b16('0x95'));}_0x4cb0c2=_['difference'](_[_0x8b16('0x5f')](_0x33afcf),['createdAt',_0x8b16('0x97')]);_0x2fb5c2=_['difference'](_[_0x8b16('0x5f')](_0x33afcf),[_0x8b16('0x96'),'updatedAt','CompanyId',_0x8b16('0x9a')]);if(_0x313be1[_0x8b16('0x62')]['id']){delete _0x313be1['body']['id'];}if(_[_0x8b16('0x7f')](_0x313be1['body'][_0x8b16('0x9b')])){throw _0x4a7c78[_0x8b16('0x2f')](0x1f4)[_0x8b16('0x40')](new db[(_0x8b16('0x1f'))][(_0x8b16('0x20'))]('from\x20is\x20mandatory'));}if(_[_0x8b16('0x7f')](_0x313be1[_0x8b16('0x62')][_0x8b16('0x62')])||_0x313be1[_0x8b16('0x62')][_0x8b16('0x62')]===''){throw _0x4a7c78[_0x8b16('0x2f')](0x1f4)[_0x8b16('0x40')](new db[(_0x8b16('0x1f'))][(_0x8b16('0x20'))](_0x8b16('0x9d')));}if(_['isNil'](_0x313be1[_0x8b16('0x62')]['mapKeyOffline'])){throw _0x4a7c78[_0x8b16('0x2f')](0x1f4)[_0x8b16('0x40')](new db['Sequelize'][(_0x8b16('0x20'))](_0x8b16('0xd2')+_0x2fb5c2));}if(!_[_0x8b16('0xa0')](_0x2fb5c2,_0x313be1[_0x8b16('0x62')][_0x8b16('0xd3')])){throw _0x4a7c78[_0x8b16('0x2f')](0x1f4)['send'](new db[(_0x8b16('0x1f'))][(_0x8b16('0x20'))](_0x8b16('0xd4')+_0x2fb5c2));}_0x339358[_0x313be1[_0x8b16('0x62')][_0x8b16('0xd3')]]=_0x313be1[_0x8b16('0x62')]['from'];})['then'](function(){return db[_0x8b16('0x44')]['find']({'where':{'id':_0x313be1[_0x8b16('0x5e')]['id']},'include':[{'model':db['CmList'],'as':_0x8b16('0xa5')}]});})[_0x8b16('0x23')](handleEntityNotFound(_0x4a7c78,null))[_0x8b16('0x23')](function(_0x57d9cd){if(_0x57d9cd&&_0x57d9cd[_0x8b16('0xa5')]){_0x3cad05=_0x57d9cd;var _0x29e9fe=_[_0x8b16('0xac')](_0x313be1[_0x8b16('0x62')],{'firstName':_0x313be1['body']['from'],'phone':_0x313be1[_0x8b16('0x62')][_0x8b16('0x9b')],'ListId':_0x57d9cd[_0x8b16('0x9a')]});_0x29e9fe[_0x313be1[_0x8b16('0x62')][_0x8b16('0xd3')]]=_0x313be1['body']['from'];return db[_0x8b16('0x94')]['findOrCreate']({'where':_0x339358,'defaults':_0x29e9fe});}})[_0x8b16('0xd5')](function(_0x20373f){if(_0x20373f){_0x3e7ce1=_0x20373f;var _0x5d612d=fs['readFileSync'](path[_0x8b16('0x81')](config[_0x8b16('0x82')],_0x8b16('0xd6')),_0x8b16('0xd7'));var _0x17ccc3=ejs[_0x8b16('0xd8')](_0x5d612d,{'body':_[_0x8b16('0xd9')](_0x313be1['body'][_0x8b16('0x62')]),'bodyTitle':_0x3cad05['offlineMessageBody']});return db['ChatOfflineMessage'][_0x8b16('0x61')]({'body':_0x17ccc3,'ContactId':_0x20373f['id'],'ChatWebsiteId':_0x3cad05['id']});}})['then'](function(_0x566f15){if(_0x566f15){_0x5181c9=_0x566f15;return db[_0x8b16('0xda')][_0x8b16('0x70')]({'where':{'service':!![]},'include':[{'model':db[_0x8b16('0xdb')],'as':_0x8b16('0xdc'),'raw':!![]}]});}})[_0x8b16('0x23')](function(_0x5071f2){if(_0x5071f2&&_0x5071f2[_0x8b16('0xdc')]&&_0x3cad05[_0x8b16('0xdd')]){var _0x338e30={'tls':{'rejectUnauthorized':![]}};if(_0x5071f2['Smtp'][_0x8b16('0xde')]){_0x338e30[_0x8b16('0xde')]=_0x5071f2[_0x8b16('0xdc')][_0x8b16('0xde')];}else{_0x338e30['host']=_0x5071f2['Smtp'][_0x8b16('0xdf')];_0x338e30[_0x8b16('0xe0')]=_0x5071f2[_0x8b16('0xdc')]['port'];_0x338e30[_0x8b16('0xe1')]=_0x5071f2[_0x8b16('0xdc')][_0x8b16('0xe1')];}if(_0x5071f2[_0x8b16('0xdc')][_0x8b16('0xe2')]){_0x338e30[_0x8b16('0xe3')]={'user':_0x5071f2[_0x8b16('0xdc')][_0x8b16('0x63')],'pass':_0x5071f2['Smtp'][_0x8b16('0xe4')]};}return respondWithRpcPromise(_0x8b16('0xe5'),'sendMail',{'account':_0x338e30,'message':{'from':util[_0x8b16('0xb7')]('\x22%s\x22\x20<%s>',_0x5071f2[_0x8b16('0x3f')],_0x5071f2[_0x8b16('0xe6')]||_0x5071f2[_0x8b16('0xdc')][_0x8b16('0x63')]),'to':_0x3cad05[_0x8b16('0xdd')],'subject':_0x3cad05['offlineMessageSubject'],'text':_0x5181c9['body']}},client9003)[_0x8b16('0x23')](function(){return _0x5181c9;})[_0x8b16('0x2e')](function(_0x1d5b8a){console['error'](_0x1d5b8a);});}})[_0x8b16('0x23')](function(){if(_0x5181c9){return _0x5181c9;}})['then'](respondWithResult(_0x4a7c78,null))[_0x8b16('0x2e')](handleError(_0x4a7c78,null));};exports['addInteraction']=function(_0x4139a9,_0x5accd5,_0x517066){return db[_0x8b16('0xbf')][_0x8b16('0x67')]({'where':{'id':_0x4139a9[_0x8b16('0x5e')]['id']}})[_0x8b16('0x23')](handleEntityNotFound(_0x5accd5,null))['then'](function(_0x4053b4){if(_0x4053b4){return _0x4053b4['addInteraction'](_0x4139a9[_0x8b16('0x62')][_0x8b16('0x72')],_[_0x8b16('0xe7')](_0x4139a9[_0x8b16('0x62')],['ids','id'])||{});}})['then'](respondWithResult(_0x5accd5,null))[_0x8b16('0x2e')](handleError(_0x5accd5,null));};exports[_0x8b16('0xe8')]=function(_0x4edd56,_0x5b0995,_0x14b9ed){var _0x4ff4a2={'raw':![],'where':{}};var _0x5a1801={};var _0xd475f5={'count':0x0,'rows':[]};return db[_0x8b16('0x44')][_0x8b16('0x70')]({'where':{'id':_0x4edd56['params']['id']}})[_0x8b16('0x23')](handleEntityNotFound(_0x5b0995,null))[_0x8b16('0x23')](function(_0x52ba71){if(_0x52ba71){_0x5a1801[_0x8b16('0x4a')]=_[_0x8b16('0x5f')](db['ChatInteraction'][_0x8b16('0x45')]);_0x5a1801[_0x8b16('0x49')]=_[_0x8b16('0x5f')](_0x4edd56[_0x8b16('0x49')]);_0x5a1801[_0x8b16('0x54')]=_[_0x8b16('0x4b')](_0x5a1801[_0x8b16('0x4a')],_0x5a1801[_0x8b16('0x49')]);_0x4ff4a2[_0x8b16('0x4d')]=_[_0x8b16('0x4b')](_0x5a1801[_0x8b16('0x4a')],qs[_0x8b16('0x4c')](_0x4edd56[_0x8b16('0x49')][_0x8b16('0x4c')]));_0x4ff4a2[_0x8b16('0x4d')]=_0x4ff4a2[_0x8b16('0x4d')]['length']?_0x4ff4a2[_0x8b16('0x4d')]:_0x5a1801['model'];if(!_0x4edd56[_0x8b16('0x49')]['hasOwnProperty'](_0x8b16('0x50'))){_0x4ff4a2['limit']=qs[_0x8b16('0x33')](_0x4edd56['query'][_0x8b16('0x33')]);_0x4ff4a2[_0x8b16('0x32')]=qs['offset'](_0x4edd56[_0x8b16('0x49')][_0x8b16('0x32')]);}_0x4ff4a2['order']=qs[_0x8b16('0x52')](_0x4edd56[_0x8b16('0x49')][_0x8b16('0x52')]);_0x4ff4a2[_0x8b16('0x53')]=qs['filters'](_[_0x8b16('0x55')](_0x4edd56['query'],_0x5a1801['filters']));_0x4ff4a2[_0x8b16('0x53')][_0x8b16('0x6c')]=_0x52ba71['id'];if(_0x4edd56[_0x8b16('0x49')]['filter']){_0x4ff4a2[_0x8b16('0x53')]=_[_0x8b16('0x57')](_0x4ff4a2['where'],{'$or':_[_0x8b16('0x43')](_0x4ff4a2[_0x8b16('0x4d')],function(_0x3bdf2b){var _0x2a87c1={};_0x2a87c1[_0x3bdf2b]={'$like':'%'+_0x4edd56['query'][_0x8b16('0x56')]+'%'};return _0x2a87c1;})});}_0x4ff4a2=_['merge']({},_0x4ff4a2,_0x4edd56[_0x8b16('0x59')]);return db[_0x8b16('0xbf')][_0x8b16('0x5a')]({'where':_0x4ff4a2['where']})['then'](function(_0x1ebfd7){_0xd475f5[_0x8b16('0x5a')]=_0x1ebfd7;if(_0x4edd56[_0x8b16('0x49')][_0x8b16('0x5b')]){_0x4ff4a2['include']=[{'model':db[_0x8b16('0x94')],'as':_0x8b16('0xe9'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x8b16('0x3f'),'fullname','internal'],'required':![]},{'model':db[_0x8b16('0xea')],'as':'Tags','attributes':['id',_0x8b16('0x3f'),'color'],'where':_0x4edd56[_0x8b16('0x49')][_0x8b16('0xeb')]?{'id':_0x4edd56[_0x8b16('0x49')][_0x8b16('0xeb')]}:undefined,'required':_0x4edd56[_0x8b16('0x49')]['tag']?!![]:![]}];}return db[_0x8b16('0xbf')][_0x8b16('0x5c')](_0x4ff4a2);})[_0x8b16('0x23')](function(_0x2383db){_0xd475f5[_0x8b16('0x5d')]=_0x2383db;return _0xd475f5;});}})[_0x8b16('0x23')](respondWithFilteredResult(_0x5b0995,_0x4ff4a2))[_0x8b16('0x2e')](handleError(_0x5b0995,null));};function iftimePromise(_0x473a35,_0x29147c){return respondWithRpcPromise(_0x8b16('0xec'),_0x8b16('0xed'),{'command':_0x29147c[_0x8b16('0xee')]?util[_0x8b16('0xb7')](_0x8b16('0xef'),_0x473a35[_0x8b16('0xf0')],_0x29147c['timezone']):util[_0x8b16('0xb7')]('iftime\x20%s',_0x473a35[_0x8b16('0xf0')])},client9002)[_0x8b16('0x23')](function(_0x5e0736){var _0x3c9cc3=_0x5e0736&&_0x5e0736['indexOf']('true')>=0x0?!![]:![];logger[_0x8b16('0x24')](_0x8b16('0xf1'),_0x29147c['id'],_0x473a35['id'],_0x473a35[_0x8b16('0xf0')],_0x3c9cc3?_0x8b16('0xf2'):_0x8b16('0xf3'),_0x29147c[_0x8b16('0xee')]?_0x29147c[_0x8b16('0xee')]:'No\x20timezone');return _0x3c9cc3;})[_0x8b16('0x2e')](function(_0x4cb737){logger[_0x8b16('0x2a')](_0x8b16('0xf1'),_0x29147c['id'],_0x473a35['id'],_0x473a35[_0x8b16('0xf0')],util['inspect'](_0x4cb737,{'showHidden':![],'depth':null}),_0x29147c[_0x8b16('0xee')]?_0x29147c['timezone']:_0x8b16('0xf4'));return![];});}exports[_0x8b16('0xed')]=function(_0xbc47a6,_0x55e34a,_0x4a8cf4){var _0x4c2cf0=0x0;var _0x55572f=0x0;var _0x2eb154=![];var _0x5353fe;var _0xeaef09;return db['ChatWebsite'][_0x8b16('0x67')]({'where':{'id':_0xbc47a6['params']['id']},'include':[{'model':db[_0x8b16('0xf5')],'as':'Interval','include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x8b16('0xf0')],'raw':!![]}]}]})[_0x8b16('0x23')](handleEntityNotFound(_0x55e34a,null))[_0x8b16('0x23')](function(_0x200a1a){if(_0x200a1a){_0x5353fe=_0x200a1a;return _0x200a1a[_0x8b16('0xf6')]({'raw':!![]});}})[_0x8b16('0x23')](function(_0x3faa88){if(_0x5353fe){if(_0x3faa88){_0xeaef09=_0x3faa88;}}return require(_0x8b16('0x7d'))[_0x8b16('0xf7')]();})[_0x8b16('0x23')](function(_0x2712d1){if(_0x2712d1){_0x55572f=_0x2712d1[_0x8b16('0xf8')];_0x2eb154=_0x2712d1[_0x8b16('0x7e')];}})['then'](function(){return db[_0x8b16('0xbf')][_0x8b16('0x5a')]({'where':{'closed':![]}});})[_0x8b16('0x23')](function(_0x55c68d){_0x4c2cf0=_0x55c68d;if(_0x55572f&&_0x55c68d>_0x55572f){return db[_0x8b16('0xf9')]['findOne']({'where':{'id':0x1}})['then'](function(_0x432adb){if(_0x432adb){_0x432adb['increment'](_0x8b16('0xfa'));}});}})[_0x8b16('0x23')](function(){if(_0x5353fe['Interval']&&_0x5353fe[_0x8b16('0xf5')][_0x8b16('0xfb')]){var _0x459b21=[];for(var _0x1bee8b=0x0;_0x1bee8b<_0x5353fe[_0x8b16('0xf5')]['Intervals']['length'];_0x1bee8b++){var _0x56857b=_0x5353fe[_0x8b16('0xf5')][_0x8b16('0xfb')][_0x1bee8b]['get']({'plain':!![]});_0x459b21[_0x8b16('0xc6')](iftimePromise(_0x56857b,_0x5353fe));}return BPromise[_0x8b16('0xfc')](_0x459b21)['then'](function(_0x526d14){return _[_0x8b16('0xfd')](_0x526d14);});}else{return!![];}})[_0x8b16('0x23')](function(_0x2f0ca3){var _0x203dde=fs[_0x8b16('0xfe')](path['join'](config[_0x8b16('0x82')],_0x8b16('0xff')),'utf8');var _0x536144={'remote':_0x5353fe['remote'],'query':querystring[_0x8b16('0x29')](_['merge'](_0x5353fe[_0x8b16('0x3a')]({'plain':!![]}),{'customerIp':_0xbc47a6[_0x8b16('0x90')][_0x8b16('0xaf')]||_0xbc47a6['headers']['x-real-ip']||_0xbc47a6[_0x8b16('0x100')]['remoteAddress']||_0xbc47a6['ip'],'referer':_0xbc47a6[_0x8b16('0x90')][_0x8b16('0xb4')],'openedInteractions':_0x4c2cf0,'maxInteractions':_0x55572f,'virtual':_0x2eb154[_0x8b16('0xf8')],'online':_0x2f0ca3,'custom':_0x2eb154}))[_0x8b16('0x101')](/'/g,'\x5c\x27')};_0x55e34a['send'](ejs[_0x8b16('0xd8')](Mustache[_0x8b16('0xd8')](_0x203dde,_0x536144),{'proactiveActions':_0xeaef09,'alignment':_0x5353fe[_0x8b16('0x102')],'verticalAlignment':_0x5353fe[_0x8b16('0x103')],'div_color':_0x5353fe[_0x8b16('0x104')],'text_color':_0x5353fe[_0x8b16('0x105')]}));})['catch'](handleError(_0x55e34a,null));};exports[_0x8b16('0x106')]=function(_0x54f1a8,_0x5dfd6d,_0x1fec19){return db[_0x8b16('0x44')][_0x8b16('0x70')]({'where':{'id':_0x54f1a8[_0x8b16('0x5e')]['id']}})[_0x8b16('0x23')](handleEntityNotFound(_0x5dfd6d,null))['then'](function(_0x51c52c){if(_0x51c52c){return db[_0x8b16('0x107')][_0x8b16('0x108')](function(_0x36c0b4){return db[_0x8b16('0x109')][_0x8b16('0x39')]({'where':{'ChatWebsiteId':_0x54f1a8[_0x8b16('0x5e')]['id']},'transaction':_0x36c0b4})['then'](function(_0x5981d0){var _0x358014=_[_0x8b16('0x43')](_0x54f1a8['body'],function(_0x2a15ba){_0x2a15ba[_0x8b16('0x6c')]=_0x54f1a8[_0x8b16('0x5e')]['id'];return _0x2a15ba;});return db[_0x8b16('0x109')][_0x8b16('0x10a')](_0x358014,{'transaction':_0x36c0b4});});})[_0x8b16('0x23')](function(){return db[_0x8b16('0x109')][_0x8b16('0x10b')]({'where':{'ChatWebsiteId':_0x54f1a8['params']['id']},'order':_0x8b16('0xaa')});});}})[_0x8b16('0x23')](respondWithResult(_0x5dfd6d,null))[_0x8b16('0x2e')](handleError(_0x5dfd6d,null));};exports['getApplications']=function(_0x28a9d8,_0x39c126,_0x269c81){var _0x4bb339={};var _0x2459eb={};var _0x6c7b5f;var _0x2b1eae;return db['ChatWebsite'][_0x8b16('0x70')]({'where':{'id':_0x28a9d8['params']['id']}})[_0x8b16('0x23')](handleEntityNotFound(_0x39c126,null))['then'](function(_0x31b70c){if(_0x31b70c){_0x6c7b5f=_0x31b70c;_0x2459eb[_0x8b16('0x4a')]=_[_0x8b16('0x5f')](db[_0x8b16('0x109')][_0x8b16('0x45')]);_0x2459eb[_0x8b16('0x49')]=_[_0x8b16('0x5f')](_0x28a9d8[_0x8b16('0x49')]);_0x2459eb[_0x8b16('0x54')]=_[_0x8b16('0x4b')](_0x2459eb[_0x8b16('0x4a')],_0x2459eb[_0x8b16('0x49')]);_0x4bb339[_0x8b16('0x4d')]=_[_0x8b16('0x4b')](_0x2459eb[_0x8b16('0x4a')],qs[_0x8b16('0x4c')](_0x28a9d8['query'][_0x8b16('0x4c')]));_0x4bb339[_0x8b16('0x4d')]=_0x4bb339[_0x8b16('0x4d')][_0x8b16('0x4e')]?_0x4bb339[_0x8b16('0x4d')]:_0x2459eb[_0x8b16('0x4a')];_0x4bb339[_0x8b16('0x51')]=qs['sort'](_0x28a9d8[_0x8b16('0x49')]['sort']);_0x4bb339[_0x8b16('0x53')]=qs[_0x8b16('0x54')](_['pick'](_0x28a9d8[_0x8b16('0x49')],_0x2459eb[_0x8b16('0x54')]));if(_0x28a9d8[_0x8b16('0x49')][_0x8b16('0x56')]){_0x4bb339['where']=_[_0x8b16('0x57')](_0x4bb339[_0x8b16('0x53')],{'$or':_[_0x8b16('0x43')](_0x4bb339['attributes'],function(_0x18f402){var _0x3f1278={};_0x3f1278[_0x18f402]={'$like':'%'+_0x28a9d8['query'][_0x8b16('0x56')]+'%'};return _0x3f1278;})});}_0x4bb339=_[_0x8b16('0x57')]({},_0x4bb339,_0x28a9d8[_0x8b16('0x59')]);return _0x6c7b5f['getApplications'](_0x4bb339);}})[_0x8b16('0x23')](function(_0x31036e){if(_0x31036e){_0x2b1eae=_0x31036e['length'];if(!_0x28a9d8[_0x8b16('0x49')][_0x8b16('0x4f')](_0x8b16('0x50'))){_0x4bb339[_0x8b16('0x33')]=qs[_0x8b16('0x33')](_0x28a9d8['query'][_0x8b16('0x33')]);_0x4bb339[_0x8b16('0x32')]=qs['offset'](_0x28a9d8['query'][_0x8b16('0x32')]);}return _0x6c7b5f['getApplications'](_0x4bb339);}})['then'](function(_0x190b6a){if(_0x190b6a){return _0x190b6a?{'count':_0x2b1eae,'rows':_0x190b6a}:null;}})[_0x8b16('0x23')](respondWithResult(_0x39c126,null))[_0x8b16('0x2e')](handleError(_0x39c126,null));};exports[_0x8b16('0x10c')]=function(_0x55548c,_0x88c8f7,_0x3df816){return db[_0x8b16('0x10d')]['find']({'where':{'id':_0x55548c[_0x8b16('0x5e')]['id']}})[_0x8b16('0x23')](handleEntityNotFound(_0x88c8f7,null))[_0x8b16('0x23')](function(_0x2ddb6e){if(_0x2ddb6e){return _0x2ddb6e[_0x8b16('0x10c')](_0x55548c[_0x8b16('0x62')][_0x8b16('0x72')],_['omit'](_0x55548c[_0x8b16('0x62')],[_0x8b16('0x72'),'id'])||{});}})[_0x8b16('0x23')](respondWithResult(_0x88c8f7,null))[_0x8b16('0x2e')](handleError(_0x88c8f7,null));};exports[_0x8b16('0xf6')]=function(_0x26044d,_0x54c1dc,_0x5c5427){var _0x315ce5={};var _0x16c140={};var _0x37e01c;var _0x3e04dc;return db[_0x8b16('0x44')][_0x8b16('0x70')]({'where':{'id':_0x26044d['params']['id']}})[_0x8b16('0x23')](handleEntityNotFound(_0x54c1dc,null))[_0x8b16('0x23')](function(_0x308ed8){if(_0x308ed8){_0x37e01c=_0x308ed8;_0x16c140[_0x8b16('0x4a')]=_[_0x8b16('0x5f')](db['ChatProactiveAction'][_0x8b16('0x45')]);_0x16c140[_0x8b16('0x49')]=_['keys'](_0x26044d[_0x8b16('0x49')]);_0x16c140['filters']=_['intersection'](_0x16c140[_0x8b16('0x4a')],_0x16c140[_0x8b16('0x49')]);_0x315ce5[_0x8b16('0x4d')]=_[_0x8b16('0x4b')](_0x16c140['model'],qs[_0x8b16('0x4c')](_0x26044d[_0x8b16('0x49')][_0x8b16('0x4c')]));_0x315ce5[_0x8b16('0x4d')]=_0x315ce5[_0x8b16('0x4d')][_0x8b16('0x4e')]?_0x315ce5[_0x8b16('0x4d')]:_0x16c140[_0x8b16('0x4a')];_0x315ce5[_0x8b16('0x51')]=qs[_0x8b16('0x52')](_0x26044d[_0x8b16('0x49')][_0x8b16('0x52')]);_0x315ce5['where']=qs[_0x8b16('0x54')](_[_0x8b16('0x55')](_0x26044d[_0x8b16('0x49')],_0x16c140[_0x8b16('0x54')]));if(_0x26044d['query'][_0x8b16('0x56')]){_0x315ce5[_0x8b16('0x53')]=_[_0x8b16('0x57')](_0x315ce5['where'],{'$or':_[_0x8b16('0x43')](_0x315ce5[_0x8b16('0x4d')],function(_0xcf2e3d){var _0x4bce1b={};_0x4bce1b[_0xcf2e3d]={'$like':'%'+_0x26044d['query'][_0x8b16('0x56')]+'%'};return _0x4bce1b;})});}_0x315ce5=_[_0x8b16('0x57')]({},_0x315ce5,_0x26044d['options']);return _0x37e01c['getProactiveActions'](_0x315ce5);}})[_0x8b16('0x23')](function(_0x54c8bb){if(_0x54c8bb){_0x3e04dc=_0x54c8bb[_0x8b16('0x4e')];if(!_0x26044d['query'][_0x8b16('0x4f')]('nolimit')){_0x315ce5['limit']=qs[_0x8b16('0x33')](_0x26044d[_0x8b16('0x49')][_0x8b16('0x33')]);_0x315ce5[_0x8b16('0x32')]=qs['offset'](_0x26044d[_0x8b16('0x49')][_0x8b16('0x32')]);}return _0x37e01c[_0x8b16('0xf6')](_0x315ce5);}})['then'](function(_0xb7447c){if(_0xb7447c){return _0xb7447c?{'count':_0x3e04dc,'rows':_0xb7447c}:null;}})[_0x8b16('0x23')](respondWithResult(_0x54c1dc,null))['catch'](handleError(_0x54c1dc,null));};exports[_0x8b16('0x10e')]=function(_0x148207,_0x3396fd,_0x3998d7){var _0x21d5c2=_0x148207[_0x8b16('0x49')][_0x8b16('0x10f')]==='false'?_0x8b16('0x110'):_0x8b16('0x111');return db[_0x8b16('0x44')][_0x8b16('0x67')]({'attributes':['id',_0x21d5c2],'where':{'id':_0x148207[_0x8b16('0x5e')]['id']}})['then'](handleEntityNotFound(_0x3396fd,null))[_0x8b16('0x23')](function(_0x47dced){if(_0x47dced){var _0x6ce066=_0x47dced[_0x21d5c2];var _0x42b28e=_0x6ce066&&_0x6ce066['items']?_0x6ce066['items']:[];_0x3396fd[_0x8b16('0x40')]({'fromKey':_['isNil'](_0x6ce066[_0x8b16('0x112')])?undefined:_0x6ce066[_0x8b16('0x112')],'count':_0x42b28e[_0x8b16('0x4e')],'rows':_0x42b28e});}})[_0x8b16('0x2e')](handleError(_0x3396fd,null));};exports[_0x8b16('0x113')]=function(_0x43b234,_0xdf536,_0x5bd5df){var _0x4f1dfa={'raw':![],'where':{}};var _0x51d7cc={};var _0x534ee7={'count':0x0,'rows':[]};return db[_0x8b16('0x44')][_0x8b16('0x70')]({'where':{'id':_0x43b234[_0x8b16('0x5e')]['id']}})[_0x8b16('0x23')](handleEntityNotFound(_0xdf536,null))[_0x8b16('0x23')](function(_0x56df2d){if(_0x56df2d){_0x51d7cc['model']=_[_0x8b16('0x5f')](db[_0x8b16('0x114')]['rawAttributes']);_0x51d7cc[_0x8b16('0x49')]=_['keys'](_0x43b234[_0x8b16('0x49')]);_0x51d7cc['filters']=_['intersection'](_0x51d7cc[_0x8b16('0x4a')],_0x51d7cc[_0x8b16('0x49')]);_0x4f1dfa['attributes']=_['intersection'](_0x51d7cc[_0x8b16('0x4a')],qs[_0x8b16('0x4c')](_0x43b234[_0x8b16('0x49')][_0x8b16('0x4c')]));_0x4f1dfa[_0x8b16('0x4d')]=_0x4f1dfa[_0x8b16('0x4d')]['length']?_0x4f1dfa[_0x8b16('0x4d')]:_0x51d7cc['model'];if(!_0x43b234['query']['hasOwnProperty'](_0x8b16('0x50'))){_0x4f1dfa[_0x8b16('0x33')]=qs[_0x8b16('0x33')](_0x43b234[_0x8b16('0x49')][_0x8b16('0x33')]);_0x4f1dfa[_0x8b16('0x32')]=qs[_0x8b16('0x32')](_0x43b234[_0x8b16('0x49')][_0x8b16('0x32')]);}_0x4f1dfa[_0x8b16('0x51')]=qs['sort'](_0x43b234[_0x8b16('0x49')][_0x8b16('0x52')]);_0x4f1dfa[_0x8b16('0x53')]=qs[_0x8b16('0x54')](_[_0x8b16('0x55')](_0x43b234[_0x8b16('0x49')],_0x51d7cc['filters']));_0x4f1dfa[_0x8b16('0x53')][_0x8b16('0x6c')]=_0x56df2d['id'];if(_0x43b234[_0x8b16('0x49')][_0x8b16('0x56')]){_0x4f1dfa[_0x8b16('0x53')]=_[_0x8b16('0x57')](_0x4f1dfa[_0x8b16('0x53')],{'$or':_[_0x8b16('0x43')](_0x4f1dfa['attributes'],function(_0x58ed5e){var _0x1d60f3={};_0x1d60f3[_0x58ed5e]={'$like':'%'+_0x43b234[_0x8b16('0x49')][_0x8b16('0x56')]+'%'};return _0x1d60f3;})});}_0x4f1dfa=_[_0x8b16('0x57')]({},_0x4f1dfa,_0x43b234['options']);return db[_0x8b16('0x114')][_0x8b16('0x5a')]({'where':_0x4f1dfa['where']})[_0x8b16('0x23')](function(_0x9c179f){_0x534ee7['count']=_0x9c179f;if(_0x43b234[_0x8b16('0x49')]['includeAll']){_0x4f1dfa['include']=[{'all':!![]}];}else{_0x4f1dfa[_0x8b16('0x60')]=[{'model':db[_0x8b16('0x94')],'as':_0x8b16('0xe9'),'required':![]}];}return db[_0x8b16('0x114')][_0x8b16('0x5c')](_0x4f1dfa);})['then'](function(_0x1fa8f0){_0x534ee7['rows']=_0x1fa8f0;return _0x534ee7;});}})[_0x8b16('0x23')](respondWithFilteredResult(_0xdf536,_0x4f1dfa))[_0x8b16('0x2e')](handleError(_0xdf536,null));};exports[_0x8b16('0x115')]=function(_0x2ad35a,_0x1efbfd,_0xf648fd){return db['ChatWebsite'][_0x8b16('0x67')]({'where':{'id':_0x2ad35a[_0x8b16('0x5e')]['id']}})[_0x8b16('0x23')](handleEntityNotFound(_0x1efbfd,null))['then'](function(_0x459438){if(_0x459438){return _0x459438[_0x8b16('0x115')](_0x2ad35a[_0x8b16('0x62')]['ids'],_['omit'](_0x2ad35a[_0x8b16('0x62')],[_0x8b16('0x72'),'id'])||{})['spread'](function(_0x3f2592){for(var _0x5367ac=0x0;_0x5367ac<_0x2ad35a[_0x8b16('0x62')][_0x8b16('0x72')][_0x8b16('0x4e')];_0x5367ac+=0x1){socket[_0x8b16('0x116')](_0x8b16('0x117'),{'UserId':_0x2ad35a['body']['ids'][_0x5367ac],'ChatWebsiteId':_0x2ad35a[_0x8b16('0x5e')]['id']});}return _0x3f2592;});}})[_0x8b16('0x23')](respondWithResult(_0x1efbfd,null))[_0x8b16('0x2e')](handleError(_0x1efbfd,null));};exports[_0x8b16('0x118')]=function(_0x48ec66,_0x851398,_0x31578a){return db[_0x8b16('0x44')][_0x8b16('0x67')]({'where':{'id':_0x48ec66[_0x8b16('0x5e')]['id']}})['then'](handleEntityNotFound(_0x851398,null))[_0x8b16('0x23')](function(_0xc8db92){if(_0xc8db92){return _0xc8db92['removeAgents'](_0x48ec66[_0x8b16('0x49')][_0x8b16('0x72')])['then'](function(){if(_[_0x8b16('0x119')](_0x48ec66['query'][_0x8b16('0x72')])){for(var _0x181c02=0x0;_0x181c02<_0x48ec66[_0x8b16('0x49')][_0x8b16('0x72')][_0x8b16('0x4e')];_0x181c02+=0x1){socket[_0x8b16('0x116')]('userChatWebsite:remove',{'UserId':Number(_0x48ec66['query']['ids'][_0x181c02]),'ChatWebsiteId':Number(_0x48ec66[_0x8b16('0x5e')]['id'])});}}else{socket[_0x8b16('0x116')](_0x8b16('0x11a'),{'UserId':Number(_0x48ec66[_0x8b16('0x49')][_0x8b16('0x72')]),'ChatWebsiteId':Number(_0x48ec66[_0x8b16('0x5e')]['id'])});}});}})[_0x8b16('0x23')](respondWithStatusCode(_0x851398,null))['catch'](handleError(_0x851398,null));};exports[_0x8b16('0x11b')]=function(_0x4cce9d,_0x38b0fb,_0x17af8f){var _0x2a4d10={};var _0x29bd55={};var _0x2aa577;var _0xf3d478;return db[_0x8b16('0x44')][_0x8b16('0x70')]({'where':{'id':_0x4cce9d['params']['id']}})['then'](handleEntityNotFound(_0x38b0fb,null))[_0x8b16('0x23')](function(_0x1c265e){if(_0x1c265e){_0x2aa577=_0x1c265e;_0x29bd55[_0x8b16('0x4a')]=_[_0x8b16('0x5f')](db['User'][_0x8b16('0x45')]);_0x29bd55[_0x8b16('0x49')]=_[_0x8b16('0x5f')](_0x4cce9d['query']);_0x29bd55[_0x8b16('0x54')]=_[_0x8b16('0x4b')](_0x29bd55[_0x8b16('0x4a')],_0x29bd55[_0x8b16('0x49')]);_0x2a4d10[_0x8b16('0x4d')]=_[_0x8b16('0x4b')](_0x29bd55[_0x8b16('0x4a')],qs['fields'](_0x4cce9d[_0x8b16('0x49')][_0x8b16('0x4c')]));_0x2a4d10['attributes']=_0x2a4d10[_0x8b16('0x4d')][_0x8b16('0x4e')]?_0x2a4d10[_0x8b16('0x4d')]:_0x29bd55[_0x8b16('0x4a')];_0x2a4d10[_0x8b16('0x51')]=qs[_0x8b16('0x52')](_0x4cce9d[_0x8b16('0x49')][_0x8b16('0x52')]);_0x2a4d10[_0x8b16('0x53')]=qs['filters'](_[_0x8b16('0x55')](_0x4cce9d['query'],_0x29bd55[_0x8b16('0x54')]));if(_0x4cce9d[_0x8b16('0x49')]['filter']){_0x2a4d10[_0x8b16('0x53')]=_['merge'](_0x2a4d10['where'],{'$or':_[_0x8b16('0x43')](_0x2a4d10[_0x8b16('0x4d')],function(_0x56d6f1){var _0x55bc8a={};_0x55bc8a[_0x56d6f1]={'$like':'%'+_0x4cce9d['query']['filter']+'%'};return _0x55bc8a;})});}_0x2a4d10=_['merge']({},_0x2a4d10,_0x4cce9d['options']);return _0x2aa577[_0x8b16('0x11b')](_0x2a4d10);}})[_0x8b16('0x23')](function(_0x5af3e8){if(_0x5af3e8){_0xf3d478=_0x5af3e8[_0x8b16('0x4e')];if(!_0x4cce9d[_0x8b16('0x49')][_0x8b16('0x4f')]('nolimit')){_0x2a4d10['limit']=qs[_0x8b16('0x33')](_0x4cce9d[_0x8b16('0x49')]['limit']);_0x2a4d10[_0x8b16('0x32')]=qs['offset'](_0x4cce9d[_0x8b16('0x49')]['offset']);}return _0x2aa577[_0x8b16('0x11b')](_0x2a4d10);}})[_0x8b16('0x23')](function(_0x48eb5d){if(_0x48eb5d){return _0x48eb5d?{'count':_0xf3d478,'rows':_0x48eb5d}:null;}})[_0x8b16('0x23')](respondWithResult(_0x38b0fb,null))[_0x8b16('0x2e')](handleError(_0x38b0fb,null));}; \ No newline at end of file +var _0xccf0=['html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','get','UserProfileResource','destroy','name','index','mandatoryDispositionPause','ChatWebsite','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','Pause','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','filename','addAvatar','agentAvatar','file','addCustomerAvatar','addSystemAvatar','systemAvatar','root','server/files/images/logos/default_logo.png','sitepic','../../config/license/util','getLicense','isNil','existsSync','join','server/files/images/logos/','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','chat','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','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','CmList','CmContact','ChatApplication','Applications','List','account','applications','list','orderBy','priority','Contacts','defaults','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','User','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','CompanyId','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','omit','getInteractions','Owner','Tag','Tags','color','tag','getSnippet','iftime\x20%s,%s','timezone','iftime\x20%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','virtual','License','increment','Intervals','all','some','server/files/chat/iframe.js','remote','x-real-ip','connection','remoteAddress','referer','replace','alignment','verticalAlignment','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xccf0,0x127));var _0x0ccf=function(_0x5afdf1,_0x4f9d1c){_0x5afdf1=_0x5afdf1-0x0;var _0x2d50d0=_0xccf0[_0x5afdf1];return _0x2d50d0;};'use strict';var pdf=require(_0x0ccf('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0ccf('0x1'));var zipdir=require(_0x0ccf('0x2'));var jsonpatch=require(_0x0ccf('0x3'));var rp=require(_0x0ccf('0x4'));var moment=require(_0x0ccf('0x5'));var BPromise=require(_0x0ccf('0x6'));var Mustache=require(_0x0ccf('0x7'));var util=require(_0x0ccf('0x8'));var path=require(_0x0ccf('0x9'));var sox=require(_0x0ccf('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x0ccf('0xb'));var squel=require('squel');var crypto=require(_0x0ccf('0xc'));var jsforce=require(_0x0ccf('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0ccf('0xe'));var querystring=require('querystring');var Papa=require(_0x0ccf('0xf'));var Redis=require(_0x0ccf('0x10'));var authService=require(_0x0ccf('0x11'));var qs=require(_0x0ccf('0x12'));var as=require(_0x0ccf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ccf('0x14'))(_0x0ccf('0x15'));var utils=require(_0x0ccf('0x16'));var config=require(_0x0ccf('0x17'));var db=require(_0x0ccf('0x18'))['db'];config[_0x0ccf('0x19')]=_['defaults'](config['redis'],{'host':_0x0ccf('0x1a'),'port':0x18eb});var socket=require(_0x0ccf('0x1b'))(new Redis(config[_0x0ccf('0x19')]));require(_0x0ccf('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x0ccf('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x0ccf('0x1d')][_0x0ccf('0x1e')]({'port':0x232a});var client9003=jayson[_0x0ccf('0x1d')][_0x0ccf('0x1e')]({'port':0x232b});function checkPasswordPattern(_0x29adde,_0x536fa2,_0x1ccd4d){if(_0x1ccd4d){var _0x4f0ef9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4f0ef9[_0x0ccf('0x1f')](_0x536fa2)){return _0x29adde;}else{throw new db[(_0x0ccf('0x20'))][(_0x0ccf('0x21'))](_0x0ccf('0x22'));}}else{return _0x29adde;}}function respondWithRpcPromise(_0x280905,_0x4ecedb,_0x3bd9f7,_0x2cdf49){return new BPromise(function(_0xeb904d,_0x4e4ee3){var _0x4eb748=_0x2cdf49||client;return _0x4eb748[_0x0ccf('0x23')](_0x280905,_0x3bd9f7)[_0x0ccf('0x24')](function(_0x34da99){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x4ecedb,_0x0ccf('0x25'));logger[_0x0ccf('0x26')](_0x0ccf('0x27'),_0x4ecedb,_0x0ccf('0x25'),JSON[_0x0ccf('0x28')](_0x34da99));if(_0x34da99['error']){if(_0x34da99[_0x0ccf('0x29')][_0x0ccf('0x2a')]===0x1f4){logger[_0x0ccf('0x29')](_0x0ccf('0x2b'),_0x4ecedb,_0x34da99['error'][_0x0ccf('0x2c')]);return _0x4e4ee3(_0x34da99[_0x0ccf('0x29')][_0x0ccf('0x2c')]);}logger[_0x0ccf('0x29')](_0x0ccf('0x2b'),_0x4ecedb,_0x34da99[_0x0ccf('0x29')]['message']);return _0xeb904d(_0x34da99[_0x0ccf('0x29')][_0x0ccf('0x2c')]);}else{logger[_0x0ccf('0x2d')](_0x0ccf('0x2b'),_0x4ecedb,_0x0ccf('0x25'));_0xeb904d(_0x34da99[_0x0ccf('0x2e')][_0x0ccf('0x2c')]);}})['catch'](function(_0x443e55){logger['error'](_0x0ccf('0x2b'),_0x4ecedb,_0x443e55);_0x4e4ee3(_0x443e55);});});}function respondWithStatusCode(_0x5d1325,_0x280735){_0x280735=_0x280735||0xcc;return function(_0x475173){if(_0x475173){return _0x5d1325[_0x0ccf('0x2f')](_0x280735);}return _0x5d1325[_0x0ccf('0x30')](_0x280735)[_0x0ccf('0x31')]();};}function respondWithResult(_0x5a19fd,_0xa580ff){_0xa580ff=_0xa580ff||0xc8;return function(_0x4e7090){if(_0x4e7090){return _0x5a19fd['status'](_0xa580ff)['json'](_0x4e7090);}};}function respondWithFilteredResult(_0x262bef,_0x771c76){return function(_0x35d642){if(_0x35d642){var _0x49d0ba=_0x35d642[_0x0ccf('0x32')],_0x3fde01=_0x771c76['offset'],_0x32ccc8=_0x771c76[_0x0ccf('0x33')]+_0x771c76[_0x0ccf('0x34')],_0x407c5e;if(_0x32ccc8>=_0x49d0ba){_0x32ccc8=_0x49d0ba;_0x407c5e=0xc8;}else{_0x407c5e=0xce;}_0x262bef[_0x0ccf('0x30')](_0x407c5e);return _0x262bef['set'](_0x0ccf('0x35'),_0x3fde01+'-'+_0x32ccc8+'/'+_0x49d0ba)[_0x0ccf('0x36')](_0x35d642);}return null;};}function patchUpdates(_0x203bb3){return function(_0x1481a9){try{jsonpatch[_0x0ccf('0x37')](_0x1481a9,_0x203bb3,!![]);}catch(_0x1a7b0b){return BPromise[_0x0ccf('0x38')](_0x1a7b0b);}return _0x1481a9[_0x0ccf('0x39')]();};}function saveUpdates(_0x84201e,_0x3ff316){return function(_0x5695bb){if(_0x5695bb){return _0x5695bb[_0x0ccf('0x3a')](_0x84201e)['then'](function(_0x2688f1){return _0x2688f1;});}return null;};}function removeEntity(_0x2da459,_0x26ffcb){return function(_0x11b614){if(_0x11b614){return _0x11b614['destroy']()[_0x0ccf('0x24')](function(){var _0x38d5fb=_0x11b614[_0x0ccf('0x3b')]({'plain':!![]});var _0x476e6b='ChatWebsites';return db[_0x0ccf('0x3c')][_0x0ccf('0x3d')]({'where':{'type':_0x476e6b,'resourceId':_0x38d5fb['id']}})[_0x0ccf('0x24')](function(){return _0x11b614;});})[_0x0ccf('0x24')](function(){_0x2da459[_0x0ccf('0x30')](0xcc)[_0x0ccf('0x31')]();});}};}function handleEntityNotFound(_0x266888,_0x453710){return function(_0x5e30f1){if(!_0x5e30f1){_0x266888[_0x0ccf('0x2f')](0x194);}return _0x5e30f1;};}function handleError(_0x5e0c94,_0x46f8ad){_0x46f8ad=_0x46f8ad||0x1f4;return function(_0x411d99){logger[_0x0ccf('0x29')](_0x411d99['stack']);if(_0x411d99[_0x0ccf('0x3e')]){delete _0x411d99[_0x0ccf('0x3e')];}_0x5e0c94['status'](_0x46f8ad)['send'](_0x411d99);};}exports[_0x0ccf('0x3f')]=function(_0xbe0e72,_0x3de147){var _0x3e4d11={'include':[{'model':db['Pause'],'as':_0x0ccf('0x40')}]},_0x224fcb={},_0x4f57a5={'count':0x0,'rows':[]};var _0x31004d=_['map'](db[_0x0ccf('0x41')][_0x0ccf('0x42')],function(_0x151e0e){return{'name':_0x151e0e['fieldName'],'type':_0x151e0e[_0x0ccf('0x43')][_0x0ccf('0x44')]};});_0x224fcb[_0x0ccf('0x45')]=_['map'](_0x31004d,_0x0ccf('0x3e'));_0x224fcb[_0x0ccf('0x46')]=_[_0x0ccf('0x47')](_0xbe0e72[_0x0ccf('0x46')]);_0x224fcb[_0x0ccf('0x48')]=_[_0x0ccf('0x49')](_0x224fcb[_0x0ccf('0x45')],_0x224fcb[_0x0ccf('0x46')]);_0x3e4d11[_0x0ccf('0x4a')]=_[_0x0ccf('0x49')](_0x224fcb[_0x0ccf('0x45')],qs[_0x0ccf('0x4b')](_0xbe0e72['query']['fields']));_0x3e4d11[_0x0ccf('0x4a')]=_0x3e4d11[_0x0ccf('0x4a')][_0x0ccf('0x4c')]?_0x3e4d11[_0x0ccf('0x4a')]:_0x224fcb[_0x0ccf('0x45')];if(!_0xbe0e72['query'][_0x0ccf('0x4d')](_0x0ccf('0x4e'))){_0x3e4d11[_0x0ccf('0x34')]=qs[_0x0ccf('0x34')](_0xbe0e72[_0x0ccf('0x46')][_0x0ccf('0x34')]);_0x3e4d11['offset']=qs[_0x0ccf('0x33')](_0xbe0e72['query'][_0x0ccf('0x33')]);}_0x3e4d11[_0x0ccf('0x4f')]=qs['sort'](_0xbe0e72['query'][_0x0ccf('0x50')]);_0x3e4d11[_0x0ccf('0x51')]=qs[_0x0ccf('0x48')](_[_0x0ccf('0x52')](_0xbe0e72[_0x0ccf('0x46')],_0x224fcb[_0x0ccf('0x48')]));if(_0xbe0e72['query'][_0x0ccf('0x53')]){_0x3e4d11[_0x0ccf('0x51')]=_['merge'](_0x3e4d11[_0x0ccf('0x51')],{'$or':_[_0x0ccf('0x54')](_0x31004d,function(_0x133e86){if(_0x133e86['type']!==_0x0ccf('0x55')){var _0x18640d={};_0x18640d[_0x133e86[_0x0ccf('0x3e')]]={'$like':'%'+_0xbe0e72['query'][_0x0ccf('0x53')]+'%'};return _0x18640d;}})});}_0x3e4d11=_[_0x0ccf('0x56')]({},_0x3e4d11,_0xbe0e72['options']);var _0x380ba7={'where':_0x3e4d11[_0x0ccf('0x51')]};return db[_0x0ccf('0x41')][_0x0ccf('0x32')](_0x380ba7)[_0x0ccf('0x24')](function(_0x594cdb){_0x4f57a5[_0x0ccf('0x32')]=_0x594cdb;if(_0xbe0e72[_0x0ccf('0x46')][_0x0ccf('0x57')]){_0x3e4d11[_0x0ccf('0x58')]=[{'all':!![]}];}return db['ChatWebsite'][_0x0ccf('0x59')](_0x3e4d11);})['then'](function(_0x533e6a){_0x4f57a5['rows']=_0x533e6a;return _0x4f57a5;})[_0x0ccf('0x24')](respondWithFilteredResult(_0x3de147,_0x3e4d11))[_0x0ccf('0x5a')](handleError(_0x3de147,null));};exports[_0x0ccf('0x5b')]=function(_0x1e117e,_0x4957f6){var _0x2e3ff0={'raw':![],'where':{'id':_0x1e117e[_0x0ccf('0x5c')]['id']},'include':[{'model':db[_0x0ccf('0x5d')],'as':_0x0ccf('0x40')}]},_0x50006f={};_0x50006f['model']=_['keys'](db[_0x0ccf('0x41')][_0x0ccf('0x42')]);_0x50006f[_0x0ccf('0x46')]=_[_0x0ccf('0x47')](_0x1e117e[_0x0ccf('0x46')]);_0x50006f['filters']=_['intersection'](_0x50006f[_0x0ccf('0x45')],_0x50006f[_0x0ccf('0x46')]);_0x2e3ff0[_0x0ccf('0x4a')]=_['intersection'](_0x50006f[_0x0ccf('0x45')],qs['fields'](_0x1e117e[_0x0ccf('0x46')]['fields']));_0x2e3ff0[_0x0ccf('0x4a')]=_0x2e3ff0[_0x0ccf('0x4a')][_0x0ccf('0x4c')]?_0x2e3ff0[_0x0ccf('0x4a')]:_0x50006f['model'];if(_0x1e117e[_0x0ccf('0x46')]['includeAll']){_0x2e3ff0['include']=[{'all':!![]}];}_0x2e3ff0=_[_0x0ccf('0x56')]({},_0x2e3ff0,_0x1e117e[_0x0ccf('0x5e')]);return db[_0x0ccf('0x41')][_0x0ccf('0x5f')](_0x2e3ff0)[_0x0ccf('0x24')](handleEntityNotFound(_0x4957f6,null))[_0x0ccf('0x24')](respondWithResult(_0x4957f6,null))[_0x0ccf('0x5a')](handleError(_0x4957f6,null));};exports[_0x0ccf('0x60')]=function(_0x1413ea,_0x1996f3){return db[_0x0ccf('0x41')][_0x0ccf('0x60')](_0x1413ea[_0x0ccf('0x61')],{})[_0x0ccf('0x24')](function(_0x36096c){var _0x38ab7b=_0x1413ea['user']['get']({'plain':!![]});if(!_0x38ab7b)throw new Error(_0x0ccf('0x62'));if(_0x38ab7b['role']===_0x0ccf('0x63')){var _0x2b3cd0=_0x36096c['get']({'plain':!![]});var _0x1f1565=_0x0ccf('0x64');return db[_0x0ccf('0x65')][_0x0ccf('0x5f')]({'where':{'name':_0x1f1565,'userProfileId':_0x38ab7b[_0x0ccf('0x66')]},'raw':!![]})['then'](function(_0x4e901d){if(_0x4e901d&&_0x4e901d[_0x0ccf('0x67')]===0x0){return db['UserProfileResource'][_0x0ccf('0x60')]({'name':_0x2b3cd0[_0x0ccf('0x3e')],'resourceId':_0x2b3cd0['id'],'type':_0x4e901d[_0x0ccf('0x3e')],'sectionId':_0x4e901d['id']},{})[_0x0ccf('0x24')](function(){return _0x36096c;});}else{return _0x36096c;}})[_0x0ccf('0x5a')](function(_0x42ed51){logger[_0x0ccf('0x29')](_0x0ccf('0x68'),_0x42ed51);throw _0x42ed51;});}return _0x36096c;})[_0x0ccf('0x24')](respondWithResult(_0x1996f3,0xc9))[_0x0ccf('0x5a')](handleError(_0x1996f3,null));};exports[_0x0ccf('0x3a')]=function(_0x2a2549,_0x527cc5){if(_0x2a2549['body']['id']){delete _0x2a2549['body']['id'];}return db['ChatWebsite'][_0x0ccf('0x5f')]({'where':{'id':_0x2a2549[_0x0ccf('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x0ccf('0x40')}]})[_0x0ccf('0x24')](handleEntityNotFound(_0x527cc5,null))[_0x0ccf('0x24')](saveUpdates(_0x2a2549[_0x0ccf('0x61')],null))['then'](respondWithResult(_0x527cc5,null))['catch'](handleError(_0x527cc5,null));};exports['destroy']=function(_0x265bd7,_0x34a6c7){return db[_0x0ccf('0x41')]['find']({'where':{'id':_0x265bd7[_0x0ccf('0x5c')]['id']}})[_0x0ccf('0x24')](handleEntityNotFound(_0x34a6c7,null))[_0x0ccf('0x24')](removeEntity(_0x34a6c7,null))[_0x0ccf('0x5a')](handleError(_0x34a6c7,null));};exports['describe']=function(_0x4bc1e0,_0x335c30){return db['ChatWebsite'][_0x0ccf('0x69')]()['then'](respondWithResult(_0x335c30,null))['catch'](handleError(_0x335c30,null));};exports[_0x0ccf('0x6a')]=function(_0x4b9074,_0x3f26fb,_0x311055){if(_0x4b9074[_0x0ccf('0x61')]['id']){delete _0x4b9074[_0x0ccf('0x61')]['id'];}return db[_0x0ccf('0x41')][_0x0ccf('0x5f')]({'where':{'id':_0x4b9074[_0x0ccf('0x5c')]['id']}})[_0x0ccf('0x24')](handleEntityNotFound(_0x3f26fb,null))[_0x0ccf('0x24')](function(_0x429cc3){if(_0x429cc3){_0x4b9074['body'][_0x0ccf('0x6b')]=_0x429cc3['id'];return db[_0x0ccf('0x6c')][_0x0ccf('0x60')](_0x4b9074[_0x0ccf('0x61')]);}})[_0x0ccf('0x24')](respondWithResult(_0x3f26fb,null))[_0x0ccf('0x5a')](handleError(_0x3f26fb,null));};exports[_0x0ccf('0x6d')]=function(_0x1ca7ca,_0x11a5eb,_0xa5597a){var _0x590cf7={'raw':![],'where':{}};var _0xf1eff7={};var _0x2815d2={'count':0x0,'rows':[]};return db[_0x0ccf('0x41')][_0x0ccf('0x6e')]({'where':{'id':_0x1ca7ca[_0x0ccf('0x5c')]['id']}})['then'](handleEntityNotFound(_0x11a5eb,null))[_0x0ccf('0x24')](function(_0x5b010a){if(_0x5b010a){_0xf1eff7[_0x0ccf('0x45')]=_[_0x0ccf('0x47')](db[_0x0ccf('0x6c')]['rawAttributes']);_0xf1eff7['query']=_[_0x0ccf('0x47')](_0x1ca7ca[_0x0ccf('0x46')]);_0xf1eff7['filters']=_['intersection'](_0xf1eff7['model'],_0xf1eff7['query']);_0x590cf7['attributes']=_['intersection'](_0xf1eff7[_0x0ccf('0x45')],qs[_0x0ccf('0x4b')](_0x1ca7ca['query']['fields']));_0x590cf7[_0x0ccf('0x4a')]=_0x590cf7[_0x0ccf('0x4a')]['length']?_0x590cf7[_0x0ccf('0x4a')]:_0xf1eff7[_0x0ccf('0x45')];if(!_0x1ca7ca[_0x0ccf('0x46')][_0x0ccf('0x4d')](_0x0ccf('0x4e'))){_0x590cf7['limit']=qs[_0x0ccf('0x34')](_0x1ca7ca[_0x0ccf('0x46')]['limit']);_0x590cf7[_0x0ccf('0x33')]=qs[_0x0ccf('0x33')](_0x1ca7ca[_0x0ccf('0x46')]['offset']);}_0x590cf7[_0x0ccf('0x4f')]=qs[_0x0ccf('0x50')](_0x1ca7ca['query'][_0x0ccf('0x50')]);_0x590cf7['where']=qs[_0x0ccf('0x48')](_[_0x0ccf('0x52')](_0x1ca7ca['query'],_0xf1eff7[_0x0ccf('0x48')]));_0x590cf7[_0x0ccf('0x51')][_0x0ccf('0x6b')]=_0x5b010a['id'];if(_0x1ca7ca[_0x0ccf('0x46')][_0x0ccf('0x53')]){_0x590cf7[_0x0ccf('0x51')]=_[_0x0ccf('0x56')](_0x590cf7['where'],{'$or':_['map'](_0x590cf7['attributes'],function(_0x4d022a){var _0x4bc3de={};_0x4bc3de[_0x4d022a]={'$like':'%'+_0x1ca7ca[_0x0ccf('0x46')][_0x0ccf('0x53')]+'%'};return _0x4bc3de;})});}_0x590cf7=_[_0x0ccf('0x56')]({},_0x590cf7,_0x1ca7ca[_0x0ccf('0x5e')]);return db[_0x0ccf('0x6c')][_0x0ccf('0x32')]({'where':_0x590cf7[_0x0ccf('0x51')]})[_0x0ccf('0x24')](function(_0x104388){_0x2815d2[_0x0ccf('0x32')]=_0x104388;if(_0x1ca7ca[_0x0ccf('0x46')][_0x0ccf('0x57')]){_0x590cf7['include']=[{'all':!![]}];}return db[_0x0ccf('0x6c')][_0x0ccf('0x59')](_0x590cf7);})[_0x0ccf('0x24')](function(_0x24c1ea){_0x2815d2[_0x0ccf('0x6f')]=_0x24c1ea;return _0x2815d2;});}})['then'](respondWithFilteredResult(_0x11a5eb,_0x590cf7))[_0x0ccf('0x5a')](handleError(_0x11a5eb,null));};exports[_0x0ccf('0x70')]=function(_0x5994e6,_0x12f100,_0x27d64f){return db[_0x0ccf('0x41')][_0x0ccf('0x5f')]({'where':{'id':_0x5994e6['params']['id']}})[_0x0ccf('0x24')](handleEntityNotFound(_0x12f100,null))['then'](function(_0x22d45e){if(_0x22d45e){return _0x22d45e[_0x0ccf('0x70')](_0x5994e6[_0x0ccf('0x46')][_0x0ccf('0x71')]);}})[_0x0ccf('0x24')](respondWithStatusCode(_0x12f100,null))[_0x0ccf('0x5a')](handleError(_0x12f100,null));};exports[_0x0ccf('0x72')]=function(_0x40b027,_0x369fa4,_0x366e1e){if(_0x40b027[_0x0ccf('0x61')]['id']){delete _0x40b027[_0x0ccf('0x61')]['id'];}return db[_0x0ccf('0x41')][_0x0ccf('0x5f')]({'where':{'id':_0x40b027[_0x0ccf('0x5c')]['id']}})[_0x0ccf('0x24')](handleEntityNotFound(_0x369fa4,null))['then'](function(_0x1d0fb6){if(_0x1d0fb6){_0x40b027['body'][_0x0ccf('0x6b')]=_0x1d0fb6['id'];return db[_0x0ccf('0x73')]['create'](_0x40b027[_0x0ccf('0x61')]);}})['then'](respondWithResult(_0x369fa4,null))[_0x0ccf('0x5a')](handleError(_0x369fa4,null));};exports[_0x0ccf('0x74')]=function(_0x40ebbc,_0x3f0afa,_0x12bddf){var _0x50b47b={'raw':![],'where':{}};var _0x33853a={};var _0x2b150e={'count':0x0,'rows':[]};return db[_0x0ccf('0x41')][_0x0ccf('0x6e')]({'where':{'id':_0x40ebbc[_0x0ccf('0x5c')]['id']}})[_0x0ccf('0x24')](handleEntityNotFound(_0x3f0afa,null))[_0x0ccf('0x24')](function(_0x42f23c){if(_0x42f23c){_0x33853a[_0x0ccf('0x45')]=_[_0x0ccf('0x47')](db['CannedAnswer'][_0x0ccf('0x42')]);_0x33853a[_0x0ccf('0x46')]=_[_0x0ccf('0x47')](_0x40ebbc[_0x0ccf('0x46')]);_0x33853a[_0x0ccf('0x48')]=_[_0x0ccf('0x49')](_0x33853a[_0x0ccf('0x45')],_0x33853a['query']);_0x50b47b[_0x0ccf('0x4a')]=_[_0x0ccf('0x49')](_0x33853a[_0x0ccf('0x45')],qs[_0x0ccf('0x4b')](_0x40ebbc[_0x0ccf('0x46')][_0x0ccf('0x4b')]));_0x50b47b[_0x0ccf('0x4a')]=_0x50b47b['attributes'][_0x0ccf('0x4c')]?_0x50b47b[_0x0ccf('0x4a')]:_0x33853a[_0x0ccf('0x45')];if(!_0x40ebbc[_0x0ccf('0x46')][_0x0ccf('0x4d')]('nolimit')){_0x50b47b[_0x0ccf('0x34')]=qs[_0x0ccf('0x34')](_0x40ebbc[_0x0ccf('0x46')]['limit']);_0x50b47b[_0x0ccf('0x33')]=qs[_0x0ccf('0x33')](_0x40ebbc[_0x0ccf('0x46')][_0x0ccf('0x33')]);}_0x50b47b[_0x0ccf('0x4f')]=qs[_0x0ccf('0x50')](_0x40ebbc[_0x0ccf('0x46')][_0x0ccf('0x50')]);_0x50b47b[_0x0ccf('0x51')]=qs[_0x0ccf('0x48')](_['pick'](_0x40ebbc['query'],_0x33853a[_0x0ccf('0x48')]));_0x50b47b[_0x0ccf('0x51')][_0x0ccf('0x6b')]=_0x42f23c['id'];if(_0x40ebbc[_0x0ccf('0x46')]['filter']){_0x50b47b[_0x0ccf('0x51')]=_[_0x0ccf('0x56')](_0x50b47b[_0x0ccf('0x51')],{'$or':_['map'](_0x50b47b[_0x0ccf('0x4a')],function(_0x8ebf94){var _0x40fb84={};_0x40fb84[_0x8ebf94]={'$like':'%'+_0x40ebbc['query'][_0x0ccf('0x53')]+'%'};return _0x40fb84;})});}_0x50b47b=_[_0x0ccf('0x56')]({},_0x50b47b,_0x40ebbc[_0x0ccf('0x5e')]);return db['CannedAnswer'][_0x0ccf('0x32')]({'where':_0x50b47b['where']})['then'](function(_0x30cbaf){_0x2b150e[_0x0ccf('0x32')]=_0x30cbaf;if(_0x40ebbc[_0x0ccf('0x46')][_0x0ccf('0x57')]){_0x50b47b[_0x0ccf('0x58')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x50b47b);})['then'](function(_0x9477f8){_0x2b150e['rows']=_0x9477f8;return _0x2b150e;});}})[_0x0ccf('0x24')](respondWithFilteredResult(_0x3f0afa,_0x50b47b))[_0x0ccf('0x5a')](handleError(_0x3f0afa,null));};exports[_0x0ccf('0x75')]=function(_0x2494b3,_0x372054,_0x3f91a0){return db[_0x0ccf('0x41')][_0x0ccf('0x5f')]({'where':{'id':_0x2494b3[_0x0ccf('0x5c')]['id']}})[_0x0ccf('0x24')](handleEntityNotFound(_0x372054,null))[_0x0ccf('0x24')](function(_0x26daeb){if(_0x26daeb){return _0x26daeb[_0x0ccf('0x75')](_0x2494b3[_0x0ccf('0x46')][_0x0ccf('0x71')]);}})[_0x0ccf('0x24')](respondWithStatusCode(_0x372054,null))[_0x0ccf('0x5a')](handleError(_0x372054,null));};exports[_0x0ccf('0x76')]=function(_0x27738a,_0x11b7bb,_0xc5acc9){_0x27738a[_0x0ccf('0x61')]['sitepic']=_0x27738a['file'][_0x0ccf('0x77')];return db['ChatWebsite'][_0x0ccf('0x5f')]({'where':{'id':_0x27738a[_0x0ccf('0x5c')]['id']}})[_0x0ccf('0x24')](handleEntityNotFound(_0x11b7bb,null))[_0x0ccf('0x24')](saveUpdates(_0x27738a[_0x0ccf('0x61')],null))['then'](respondWithResult(_0x11b7bb,null))[_0x0ccf('0x5a')](handleError(_0x11b7bb,null));};exports[_0x0ccf('0x78')]=function(_0x5262fb,_0x5c7793,_0x52e6ef){_0x5262fb['body'][_0x0ccf('0x79')]=_0x5262fb[_0x0ccf('0x7a')][_0x0ccf('0x77')];return db[_0x0ccf('0x41')][_0x0ccf('0x5f')]({'where':{'id':_0x5262fb[_0x0ccf('0x5c')]['id']}})[_0x0ccf('0x24')](handleEntityNotFound(_0x5c7793,null))[_0x0ccf('0x24')](saveUpdates(_0x5262fb[_0x0ccf('0x61')],null))[_0x0ccf('0x24')](respondWithResult(_0x5c7793,null))[_0x0ccf('0x5a')](handleError(_0x5c7793,null));};exports[_0x0ccf('0x7b')]=function(_0x42f214,_0x2f099f,_0xe5522f){_0x42f214['body']['customerAvatar']=_0x42f214['file'][_0x0ccf('0x77')];return db['ChatWebsite'][_0x0ccf('0x5f')]({'where':{'id':_0x42f214['params']['id']}})[_0x0ccf('0x24')](handleEntityNotFound(_0x2f099f,null))[_0x0ccf('0x24')](saveUpdates(_0x42f214[_0x0ccf('0x61')],null))['then'](respondWithResult(_0x2f099f,null))[_0x0ccf('0x5a')](handleError(_0x2f099f,null));};exports[_0x0ccf('0x7c')]=function(_0x436916,_0x143e09,_0x3d086b){_0x436916[_0x0ccf('0x61')][_0x0ccf('0x7d')]=_0x436916[_0x0ccf('0x7a')]['filename'];return db[_0x0ccf('0x41')][_0x0ccf('0x5f')]({'where':{'id':_0x436916[_0x0ccf('0x5c')]['id']}})['then'](handleEntityNotFound(_0x143e09,null))[_0x0ccf('0x24')](saveUpdates(_0x436916[_0x0ccf('0x61')],null))[_0x0ccf('0x24')](respondWithResult(_0x143e09,null))[_0x0ccf('0x5a')](handleError(_0x143e09,null));};exports['getLogo']=function(_0x4cfc07,_0x3e054c,_0x11037b){var _0x2085cb=path['join'](config[_0x0ccf('0x7e')],_0x0ccf('0x7f'));var _0x286326={'where':{'id':_0x4cfc07[_0x0ccf('0x5c')]['id']},'attributes':['id',_0x0ccf('0x80')],'raw':!![]};var _0x86035b=![];return require(_0x0ccf('0x81'))[_0x0ccf('0x82')]()[_0x0ccf('0x24')](function(_0x500ecf){if(_0x500ecf){_0x86035b=_0x500ecf['custom'];}})[_0x0ccf('0x24')](function(){return db['ChatWebsite'][_0x0ccf('0x5f')](_0x286326);})[_0x0ccf('0x24')](handleEntityNotFound(_0x3e054c,null))[_0x0ccf('0x24')](function(_0x1d1786){if(_0x1d1786){if(!_[_0x0ccf('0x83')](_0x1d1786[_0x0ccf('0x80')])){if(fs[_0x0ccf('0x84')](path[_0x0ccf('0x85')](config[_0x0ccf('0x7e')],_0x0ccf('0x86'),_0x1d1786['sitepic']))&&_0x86035b){_0x2085cb=path[_0x0ccf('0x85')](config[_0x0ccf('0x7e')],'server/files/images/logos/',_0x1d1786[_0x0ccf('0x80')]);}}return _0x3e054c['download'](_0x2085cb);}})[_0x0ccf('0x5a')](handleError(_0x3e054c,null));};exports['getAvatar']=function(_0x3637c6,_0x2c84e3,_0x4c45d1){var _0x52caec=path[_0x0ccf('0x85')](config[_0x0ccf('0x7e')],_0x0ccf('0x87'));var _0x290eca={'where':{'id':_0x3637c6['params']['id']},'attributes':['id',_0x0ccf('0x79')],'raw':!![]};return db[_0x0ccf('0x41')][_0x0ccf('0x5f')](_0x290eca)['then'](handleEntityNotFound(_0x2c84e3,null))[_0x0ccf('0x24')](function(_0x1449d3){if(_0x1449d3){if(!_['isNil'](_0x1449d3[_0x0ccf('0x79')])){if(fs[_0x0ccf('0x84')](path[_0x0ccf('0x85')](config[_0x0ccf('0x7e')],_0x0ccf('0x88'),_0x1449d3[_0x0ccf('0x79')]))){_0x52caec=path[_0x0ccf('0x85')](config['root'],_0x0ccf('0x88'),_0x1449d3[_0x0ccf('0x79')]);}}return _0x2c84e3[_0x0ccf('0x89')](_0x52caec);}})[_0x0ccf('0x5a')](handleError(_0x2c84e3,null));};exports[_0x0ccf('0x8a')]=function(_0x4fed23,_0x1ff974,_0x4e6bd2){var _0x40d4f4=path['join'](config[_0x0ccf('0x7e')],_0x0ccf('0x8b'));var _0x5347fe={'where':{'id':_0x4fed23['params']['id']},'attributes':['id',_0x0ccf('0x8c'),_0x0ccf('0x8d')],'raw':!![]};return db[_0x0ccf('0x41')]['find'](_0x5347fe)[_0x0ccf('0x24')](handleEntityNotFound(_0x1ff974,null))[_0x0ccf('0x24')](function(_0x537e14){if(_0x537e14){if(!_[_0x0ccf('0x83')](_0x537e14[_0x0ccf('0x8c')])){if(fs[_0x0ccf('0x84')](path['join'](config[_0x0ccf('0x7e')],_0x0ccf('0x88'),_0x537e14[_0x0ccf('0x8c')]))&&_0x537e14[_0x0ccf('0x8d')]){_0x40d4f4=path[_0x0ccf('0x85')](config[_0x0ccf('0x7e')],'server/files/images/avatars/',_0x537e14[_0x0ccf('0x8c')]);}}return _0x1ff974['download'](_0x40d4f4);}})[_0x0ccf('0x5a')](handleError(_0x1ff974,null));};exports[_0x0ccf('0x8e')]=function(_0xa04547,_0xd3a1b,_0x2f779a){var _0x522dc7=path[_0x0ccf('0x85')](config[_0x0ccf('0x7e')],_0x0ccf('0x8f'));var _0x22fcba={'where':{'id':_0xa04547[_0x0ccf('0x5c')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x0ccf('0x41')][_0x0ccf('0x5f')](_0x22fcba)['then'](handleEntityNotFound(_0xd3a1b,null))[_0x0ccf('0x24')](function(_0x4a84d7){if(_0x4a84d7){if(!_[_0x0ccf('0x83')](_0x4a84d7[_0x0ccf('0x7d')])){if(fs['existsSync'](path[_0x0ccf('0x85')](config[_0x0ccf('0x7e')],'server/files/images/avatars/',_0x4a84d7[_0x0ccf('0x7d')]))){_0x522dc7=path[_0x0ccf('0x85')](config['root'],_0x0ccf('0x88'),_0x4a84d7[_0x0ccf('0x7d')]);}}return _0xd3a1b[_0x0ccf('0x89')](_0x522dc7);}})[_0x0ccf('0x5a')](handleError(_0xd3a1b,null));};exports[_0x0ccf('0x90')]=function(_0x57ff2a,_0x4160ec,_0x2892dd){var _0x285370=require(_0x0ccf('0x91'));var _0x287708=new _0x285370();var _0x33c404=_0x287708[_0x0ccf('0x92')](_0x57ff2a[_0x0ccf('0x93')]['user-agent'])['getResult']();var _0xbff3e5={'body':_0x57ff2a[_0x0ccf('0x61')],'channel':_0x0ccf('0x94')};var _0x954db1=[];var _0x4484f1=[];var _0x333d03={};var _0x73e205=![];return db['CmContact'][_0x0ccf('0x69')]()[_0x0ccf('0x24')](function(_0x5c2c19){if(!_0x5c2c19){throw new db[(_0x0ccf('0x20'))][(_0x0ccf('0x21'))](_0x0ccf('0x95'));}_0x954db1=_[_0x0ccf('0x96')](_[_0x0ccf('0x47')](_0x5c2c19),[_0x0ccf('0x97'),'updatedAt']);_0x4484f1=_['difference'](_['keys'](_0x5c2c19),['createdAt',_0x0ccf('0x98'),'CompanyId',_0x0ccf('0x99')]);if(_0x57ff2a[_0x0ccf('0x61')]['id']){delete _0x57ff2a[_0x0ccf('0x61')]['id'];}if(_[_0x0ccf('0x83')](_0x57ff2a['body'][_0x0ccf('0x9a')])){throw new db[(_0x0ccf('0x20'))][(_0x0ccf('0x21'))](_0x0ccf('0x9b'));}if(_[_0x0ccf('0x83')](_0x57ff2a[_0x0ccf('0x61')][_0x0ccf('0x61')])||_0x57ff2a['body'][_0x0ccf('0x61')]===''){throw new db[(_0x0ccf('0x20'))][(_0x0ccf('0x21'))](_0x0ccf('0x9c'));}if(_[_0x0ccf('0x83')](_0x57ff2a[_0x0ccf('0x61')]['mapKey'])){throw new db[(_0x0ccf('0x20'))][(_0x0ccf('0x21'))](_0x0ccf('0x9d')+_0x4484f1);}if(!_[_0x0ccf('0x9e')](_0x4484f1,_0x57ff2a['body'][_0x0ccf('0x9f')])){throw new db[(_0x0ccf('0x20'))][(_0x0ccf('0x21'))](_0x0ccf('0xa0')+_0x4484f1);}_0x333d03[_0x57ff2a['body'][_0x0ccf('0x9f')]]=_0x57ff2a[_0x0ccf('0x61')]['from'];})[_0x0ccf('0x24')](function(){return db[_0x0ccf('0x41')]['find']({'where':{'id':_0x57ff2a[_0x0ccf('0x5c')]['id']},'include':[{'model':db[_0x0ccf('0xa1')],'as':'List','include':[{'model':db[_0x0ccf('0xa2')],'as':'Contacts','where':_0x333d03,'limit':0x1,'order':[[_0x0ccf('0x98'),'DESC']]}]},{'model':db[_0x0ccf('0xa3')],'as':_0x0ccf('0xa4')}]});})[_0x0ccf('0x24')](handleEntityNotFound(_0x4160ec,null))['then'](function(_0x4ef93f){if(_0x4ef93f&&_0x4ef93f[_0x0ccf('0xa5')]){_0xbff3e5[_0x0ccf('0xa6')]=_0x4ef93f;_0xbff3e5[_0x0ccf('0xa7')]=_0x4ef93f['Applications'];_0xbff3e5[_0x0ccf('0xa8')]=_0x4ef93f[_0x0ccf('0xa5')];_0xbff3e5[_0x0ccf('0xa7')]=_[_0x0ccf('0xa9')](_0xbff3e5[_0x0ccf('0xa7')],[_0x0ccf('0xaa')],['asc']);if(_0xbff3e5['account'][_0x0ccf('0xa4')]){delete _0xbff3e5[_0x0ccf('0xa6')]['Applications'];}if(_0xbff3e5['account'][_0x0ccf('0xa5')]&&_0xbff3e5[_0x0ccf('0xa6')][_0x0ccf('0xa5')][_0x0ccf('0xab')][_0x0ccf('0x4c')]){return _0xbff3e5['account'][_0x0ccf('0xa5')]['Contacts'][0x0];}var _0x44df45=_[_0x0ccf('0xac')](_0x57ff2a[_0x0ccf('0x61')],{'firstName':_0x57ff2a[_0x0ccf('0x61')][_0x0ccf('0x9a')],'ListId':_0x4ef93f[_0x0ccf('0x99')]});_0x44df45[_0x57ff2a[_0x0ccf('0x61')][_0x0ccf('0x9f')]]=_0x57ff2a[_0x0ccf('0x61')]['from'];return db['CmContact'][_0x0ccf('0x60')](_0x44df45,{'fields':_0x954db1,'raw':!![]});}})[_0x0ccf('0x24')](handleEntityNotFound(_0x4160ec,null))[_0x0ccf('0x24')](function(_0x4cf2c4){_0xbff3e5[_0x0ccf('0xad')]=_0x4cf2c4;var _0x13dd98=_0x57ff2a[_0x0ccf('0x61')][_0x0ccf('0xae')];if(_0x57ff2a[_0x0ccf('0x93')][_0x0ccf('0xaf')]){_0x13dd98=_0x57ff2a[_0x0ccf('0x93')]['cf-connecting-ip'];}else if(_0x57ff2a[_0x0ccf('0x93')][_0x0ccf('0xb0')]){_0x13dd98=_[_0x0ccf('0xb1')](_0x57ff2a[_0x0ccf('0x93')][_0x0ccf('0xb0')][_0x0ccf('0xb2')](','));}if(_0x4cf2c4){var _0x106e48={'ContactId':_0x4cf2c4['id'],'ChatWebsiteId':_0x57ff2a[_0x0ccf('0x5c')]['id'],'from':(_0x4cf2c4['firstName']||'')+'\x20'+(_0x4cf2c4[_0x0ccf('0xb3')]||''),'customerIp':_0x13dd98,'customerPort':_0x57ff2a[_0x0ccf('0x93')]['x-real-port']?_0x57ff2a[_0x0ccf('0x93')][_0x0ccf('0xb4')]:null,'referer':_0x57ff2a['body']['referer'],'browserName':_0x33c404[_0x0ccf('0xb5')][_0x0ccf('0x3e')]&&_0x33c404[_0x0ccf('0xb5')][_0x0ccf('0xb6')]?util[_0x0ccf('0xb7')](_0x0ccf('0xb8'),_0x33c404['browser']['name'],_0x33c404[_0x0ccf('0xb5')][_0x0ccf('0xb6')]):_0x0ccf('0xb9'),'browserVersion':_0x33c404[_0x0ccf('0xb5')][_0x0ccf('0xb6')]||_0x0ccf('0xb9'),'osName':util[_0x0ccf('0xb7')](_0x0ccf('0xb8'),_0x33c404['os'][_0x0ccf('0x3e')],_0x33c404['os'][_0x0ccf('0xb6')]),'osVersion':_0x33c404['os'][_0x0ccf('0xb6')],'deviceModel':_0x33c404['device'][_0x0ccf('0x45')]&&_0x33c404[_0x0ccf('0xba')][_0x0ccf('0xbb')]?util[_0x0ccf('0xb7')](_0x0ccf('0xbc'),_0x33c404[_0x0ccf('0xba')]['model'],_0x33c404[_0x0ccf('0xba')][_0x0ccf('0xbb')],_0x33c404[_0x0ccf('0xba')]['type']):null,'deviceVendor':_0x33c404['device'][_0x0ccf('0xbb')],'deviceType':_0x33c404[_0x0ccf('0xba')][_0x0ccf('0x43')],'formData':JSON[_0x0ccf('0x28')](_0x57ff2a[_0x0ccf('0x61')])};var _0x471820={'ChatWebsiteId':_0x57ff2a[_0x0ccf('0x5c')]['id'],'closed':![]};if(_0x57ff2a[_0x0ccf('0x61')][_0x0ccf('0xbd')]){_0x471820[_0x0ccf('0xbd')]=_0x57ff2a[_0x0ccf('0x61')][_0x0ccf('0xbd')];return db[_0x0ccf('0xbe')]['find']({'where':_0x471820})[_0x0ccf('0x24')](function(_0x77fdb5){if(_0x77fdb5){return[_0x77fdb5,![]];}_0x106e48[_0x0ccf('0xbd')]=_0x57ff2a['body']['threadId'];_0x106e48['externalUrl']=_0x57ff2a[_0x0ccf('0x61')][_0x0ccf('0xbf')];return db['ChatInteraction'][_0x0ccf('0x60')](_0x106e48)['then'](function(_0x28bb2c){return[_0x28bb2c,!![]];});});}_0x471820[_0x0ccf('0xc0')]=_0x4cf2c4['id'];if(_0x57ff2a[_0x0ccf('0x61')][_0x0ccf('0xc1')]&&_0x57ff2a[_0x0ccf('0x61')][_0x0ccf('0xc1')]['id']){_0x471820['id']=_0x57ff2a[_0x0ccf('0x61')][_0x0ccf('0xc1')]['id'];return db['ChatInteraction'][_0x0ccf('0x5f')]({'where':_0x471820})[_0x0ccf('0x24')](function(_0x4ab428){if(_0x4ab428){return[_0x4ab428,![]];}return db['ChatInteraction'][_0x0ccf('0x60')](_0x106e48)['then'](function(_0x187944){return[_0x187944,!![]];});});}return db[_0x0ccf('0xbe')]['create'](_0x106e48)[_0x0ccf('0x24')](function(_0x58ab89){return[_0x58ab89,!![]];});}})[_0x0ccf('0xc2')](function(_0x58465b,_0x5139c3){if(_0x58465b){_0x73e205=_0x5139c3;if(!_0x5139c3){var _0x3fa905={'from':(_0xbff3e5[_0x0ccf('0xad')][_0x0ccf('0xc3')]||'')+'\x20'+(_0xbff3e5[_0x0ccf('0xad')][_0x0ccf('0xb3')]||'')};if(_0x57ff2a[_0x0ccf('0x61')][_0x0ccf('0xbd')]&&_0x57ff2a['body']['messageId']&&_0x57ff2a[_0x0ccf('0x61')]['threadId']!=_0x57ff2a[_0x0ccf('0x61')][_0x0ccf('0xc4')]){_0x3fa905[_0x0ccf('0xbd')]=_0x57ff2a['body'][_0x0ccf('0xc4')];}return _0x58465b['update'](_0x3fa905);}else{return _0x58465b;}}})[_0x0ccf('0x24')](function(_0x3885da){_0xbff3e5[_0x0ccf('0xc1')]=_0x3885da[_0x0ccf('0x3b')]({'plain':!![]});_0xbff3e5[_0x0ccf('0xc1')][_0x0ccf('0xc5')]=_0x73e205;if(_0xbff3e5[_0x0ccf('0xc1')][_0x0ccf('0xc5')]){if(_0xbff3e5[_0x0ccf('0xa6')][_0x0ccf('0xc6')]){_0xbff3e5[_0x0ccf('0xa7')][_0x0ccf('0xc7')]({'id':0x0,'priority':_0xbff3e5[_0x0ccf('0xa7')]['length']+0x1,'app':'close','appdata':_0x0ccf('0xc8'),'interval':_0x0ccf('0xc9')});}}return db[_0x0ccf('0xca')][_0x0ccf('0x60')]({'body':_0x57ff2a['body'][_0x0ccf('0x61')],'ChatWebsiteId':_0x57ff2a['params']['id'],'ChatInteractionId':_0x3885da['id'],'direction':'in','ContactId':_0xbff3e5[_0x0ccf('0xad')]['id'],'AttachmentId':_0x57ff2a[_0x0ccf('0x61')]['AttachmentId']});})[_0x0ccf('0x24')](function(_0x330f0b){_0xbff3e5[_0x0ccf('0x2c')]=_0x330f0b;if(_0xbff3e5[_0x0ccf('0xc1')]['UserId']){return db[_0x0ccf('0xcb')][_0x0ccf('0x5f')]({'attributes':['id','name'],'where':{'id':_0xbff3e5['interaction'][_0x0ccf('0xcc')]}})['then'](function(_0x545b4e){if(_0x545b4e){_0xbff3e5[_0x0ccf('0xa7')][_0x0ccf('0xcd')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x545b4e[_0x0ccf('0x3e')]+','+(_0xbff3e5['account'][_0x0ccf('0xce')]||0xa),'interval':_0x0ccf('0xc9')});_0xbff3e5[_0x0ccf('0xcf')]=!![];}return respondWithRpcPromise(_0x0ccf('0xd0'),_0x0ccf('0xd1'),_0xbff3e5);});}return respondWithRpcPromise(_0x0ccf('0xd0'),_0x0ccf('0xd1'),_0xbff3e5);})[_0x0ccf('0x24')](function(_0x18fb44){respondWithRpcPromise(_0x0ccf('0xd2'),_0x0ccf('0xd2'),{'event':_0x0ccf('0x90'),'message':_0x18fb44},client9002);return _0x18fb44;})[_0x0ccf('0x24')](respondWithResult(_0x4160ec,null))['catch'](handleError(_0x4160ec,null));};exports[_0x0ccf('0xd3')]=function(_0x11cb5a,_0x7ec879,_0x272ad5){var _0x2f5165,_0x5c4144,_0x13ca0d;var _0x491b16=[];var _0x3508ea=[];var _0x2ccfad={};return db[_0x0ccf('0xa2')][_0x0ccf('0x69')]()['then'](function(_0x4c9b46){if(!_0x4c9b46){throw new db['Sequelize'][(_0x0ccf('0x21'))]('no\x20available\x20attributes');}_0x3508ea=_[_0x0ccf('0x96')](_[_0x0ccf('0x47')](_0x4c9b46),[_0x0ccf('0x97'),_0x0ccf('0x98')]);_0x491b16=_[_0x0ccf('0x96')](_[_0x0ccf('0x47')](_0x4c9b46),['createdAt',_0x0ccf('0x98'),_0x0ccf('0xd4'),_0x0ccf('0x99')]);if(_0x11cb5a[_0x0ccf('0x61')]['id']){delete _0x11cb5a[_0x0ccf('0x61')]['id'];}if(_[_0x0ccf('0x83')](_0x11cb5a['body']['from'])){throw _0x7ec879[_0x0ccf('0x30')](0x1f4)[_0x0ccf('0xd5')](new db[(_0x0ccf('0x20'))]['ValidationError'](_0x0ccf('0x9b')));}if(_[_0x0ccf('0x83')](_0x11cb5a['body'][_0x0ccf('0x61')])||_0x11cb5a[_0x0ccf('0x61')][_0x0ccf('0x61')]===''){throw _0x7ec879[_0x0ccf('0x30')](0x1f4)[_0x0ccf('0xd5')](new db[(_0x0ccf('0x20'))]['ValidationError'](_0x0ccf('0x9c')));}if(_[_0x0ccf('0x83')](_0x11cb5a[_0x0ccf('0x61')]['mapKeyOffline'])){throw _0x7ec879[_0x0ccf('0x30')](0x1f4)[_0x0ccf('0xd5')](new db[(_0x0ccf('0x20'))][(_0x0ccf('0x21'))](_0x0ccf('0xd6')+_0x491b16));}if(!_['includes'](_0x491b16,_0x11cb5a[_0x0ccf('0x61')]['mapKeyOffline'])){throw _0x7ec879[_0x0ccf('0x30')](0x1f4)['send'](new db[(_0x0ccf('0x20'))][(_0x0ccf('0x21'))](_0x0ccf('0xd7')+_0x491b16));}_0x2ccfad[_0x11cb5a['body'][_0x0ccf('0xd8')]]=_0x11cb5a[_0x0ccf('0x61')][_0x0ccf('0x9a')];})[_0x0ccf('0x24')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x11cb5a['params']['id']},'include':[{'model':db[_0x0ccf('0xa1')],'as':_0x0ccf('0xa5')}]});})[_0x0ccf('0x24')](handleEntityNotFound(_0x7ec879,null))['then'](function(_0x333b70){if(_0x333b70&&_0x333b70['List']){_0x5c4144=_0x333b70;var _0x241ee8=_[_0x0ccf('0xac')](_0x11cb5a[_0x0ccf('0x61')],{'firstName':_0x11cb5a[_0x0ccf('0x61')][_0x0ccf('0x9a')],'phone':_0x11cb5a['body'][_0x0ccf('0x9a')],'ListId':_0x333b70[_0x0ccf('0x99')]});_0x241ee8[_0x11cb5a[_0x0ccf('0x61')][_0x0ccf('0xd8')]]=_0x11cb5a[_0x0ccf('0x61')][_0x0ccf('0x9a')];return db[_0x0ccf('0xa2')][_0x0ccf('0xd9')]({'where':_0x2ccfad,'defaults':_0x241ee8});}})[_0x0ccf('0xc2')](function(_0x9d6d3d){if(_0x9d6d3d){_0x13ca0d=_0x9d6d3d;var _0x1ea2f9=fs[_0x0ccf('0xda')](path[_0x0ccf('0x85')](config[_0x0ccf('0x7e')],'server/files/templates/chatOfflineMessage.ejs'),_0x0ccf('0xdb'));var _0x288c8e=ejs[_0x0ccf('0xdc')](_0x1ea2f9,{'body':_[_0x0ccf('0xdd')](_0x11cb5a[_0x0ccf('0x61')][_0x0ccf('0x61')]),'bodyTitle':_0x5c4144[_0x0ccf('0xde')]});return db[_0x0ccf('0xdf')][_0x0ccf('0x60')]({'body':_0x288c8e,'ContactId':_0x9d6d3d['id'],'ChatWebsiteId':_0x5c4144['id']});}})[_0x0ccf('0x24')](function(_0x46d96b){if(_0x46d96b){_0x2f5165=_0x46d96b;return db[_0x0ccf('0xe0')][_0x0ccf('0x6e')]({'where':{'service':!![]},'include':[{'model':db[_0x0ccf('0xe1')],'as':_0x0ccf('0xe2'),'raw':!![]}]});}})['then'](function(_0x808f4e){if(_0x808f4e&&_0x808f4e[_0x0ccf('0xe2')]&&_0x5c4144[_0x0ccf('0xe3')]){var _0xebf50f={'tls':{'rejectUnauthorized':![]}};if(_0x808f4e['Smtp'][_0x0ccf('0xe4')]){_0xebf50f[_0x0ccf('0xe4')]=_0x808f4e[_0x0ccf('0xe2')][_0x0ccf('0xe4')];}else{_0xebf50f[_0x0ccf('0xe5')]=_0x808f4e[_0x0ccf('0xe2')]['host'];_0xebf50f[_0x0ccf('0xe6')]=_0x808f4e['Smtp'][_0x0ccf('0xe6')];_0xebf50f['secure']=_0x808f4e[_0x0ccf('0xe2')]['secure'];}if(_0x808f4e['Smtp'][_0x0ccf('0xe7')]){_0xebf50f[_0x0ccf('0xe8')]={'user':_0x808f4e[_0x0ccf('0xe2')][_0x0ccf('0x63')],'pass':_0x808f4e[_0x0ccf('0xe2')]['pass']};}return respondWithRpcPromise(_0x0ccf('0xe9'),_0x0ccf('0xea'),{'account':_0xebf50f,'message':{'from':util[_0x0ccf('0xb7')](_0x0ccf('0xeb'),_0x808f4e['name'],_0x808f4e[_0x0ccf('0xec')]||_0x808f4e['Smtp'][_0x0ccf('0x63')]),'to':_0x5c4144[_0x0ccf('0xe3')],'subject':_0x5c4144[_0x0ccf('0xed')],'text':_0x2f5165['body']}},client9003)['then'](function(){return _0x2f5165;})['catch'](function(_0x1eddcc){console[_0x0ccf('0x29')](_0x1eddcc);});}})['then'](function(){if(_0x2f5165){return _0x2f5165;}})[_0x0ccf('0x24')](respondWithResult(_0x7ec879,null))[_0x0ccf('0x5a')](handleError(_0x7ec879,null));};exports[_0x0ccf('0xee')]=function(_0x1abe68,_0x2a919c,_0x2006d8){return db[_0x0ccf('0xbe')]['find']({'where':{'id':_0x1abe68[_0x0ccf('0x5c')]['id']}})[_0x0ccf('0x24')](handleEntityNotFound(_0x2a919c,null))['then'](function(_0x224977){if(_0x224977){return _0x224977[_0x0ccf('0xee')](_0x1abe68[_0x0ccf('0x61')][_0x0ccf('0x71')],_[_0x0ccf('0xef')](_0x1abe68['body'],['ids','id'])||{});}})[_0x0ccf('0x24')](respondWithResult(_0x2a919c,null))[_0x0ccf('0x5a')](handleError(_0x2a919c,null));};exports[_0x0ccf('0xf0')]=function(_0x268c12,_0x54f626,_0x3680ee){var _0xe7521f={'raw':![],'where':{}};var _0x47038c={};var _0x3771d2={'count':0x0,'rows':[]};return db[_0x0ccf('0x41')][_0x0ccf('0x6e')]({'where':{'id':_0x268c12['params']['id']}})[_0x0ccf('0x24')](handleEntityNotFound(_0x54f626,null))[_0x0ccf('0x24')](function(_0x4dd4a4){if(_0x4dd4a4){_0x47038c[_0x0ccf('0x45')]=_[_0x0ccf('0x47')](db[_0x0ccf('0xbe')][_0x0ccf('0x42')]);_0x47038c[_0x0ccf('0x46')]=_['keys'](_0x268c12[_0x0ccf('0x46')]);_0x47038c['filters']=_[_0x0ccf('0x49')](_0x47038c[_0x0ccf('0x45')],_0x47038c[_0x0ccf('0x46')]);_0xe7521f['attributes']=_['intersection'](_0x47038c[_0x0ccf('0x45')],qs[_0x0ccf('0x4b')](_0x268c12['query']['fields']));_0xe7521f['attributes']=_0xe7521f[_0x0ccf('0x4a')][_0x0ccf('0x4c')]?_0xe7521f[_0x0ccf('0x4a')]:_0x47038c[_0x0ccf('0x45')];if(!_0x268c12[_0x0ccf('0x46')][_0x0ccf('0x4d')](_0x0ccf('0x4e'))){_0xe7521f[_0x0ccf('0x34')]=qs[_0x0ccf('0x34')](_0x268c12['query']['limit']);_0xe7521f[_0x0ccf('0x33')]=qs[_0x0ccf('0x33')](_0x268c12[_0x0ccf('0x46')]['offset']);}_0xe7521f[_0x0ccf('0x4f')]=qs['sort'](_0x268c12[_0x0ccf('0x46')][_0x0ccf('0x50')]);_0xe7521f[_0x0ccf('0x51')]=qs[_0x0ccf('0x48')](_[_0x0ccf('0x52')](_0x268c12[_0x0ccf('0x46')],_0x47038c['filters']));_0xe7521f['where'][_0x0ccf('0x6b')]=_0x4dd4a4['id'];if(_0x268c12[_0x0ccf('0x46')][_0x0ccf('0x53')]){_0xe7521f[_0x0ccf('0x51')]=_['merge'](_0xe7521f[_0x0ccf('0x51')],{'$or':_[_0x0ccf('0x54')](_0xe7521f[_0x0ccf('0x4a')],function(_0x5152e6){var _0x5b77ec={};_0x5b77ec[_0x5152e6]={'$like':'%'+_0x268c12['query'][_0x0ccf('0x53')]+'%'};return _0x5b77ec;})});}_0xe7521f=_[_0x0ccf('0x56')]({},_0xe7521f,_0x268c12['options']);return db[_0x0ccf('0xbe')]['count']({'where':_0xe7521f[_0x0ccf('0x51')]})[_0x0ccf('0x24')](function(_0x57187c){_0x3771d2[_0x0ccf('0x32')]=_0x57187c;if(_0x268c12['query'][_0x0ccf('0x57')]){_0xe7521f[_0x0ccf('0x58')]=[{'model':db[_0x0ccf('0xa2')],'as':'Contact','required':![]},{'model':db[_0x0ccf('0xcb')],'as':_0x0ccf('0xf1'),'attributes':[_0x0ccf('0x3e'),'fullname','internal'],'required':![]},{'model':db[_0x0ccf('0xf2')],'as':_0x0ccf('0xf3'),'attributes':['id',_0x0ccf('0x3e'),_0x0ccf('0xf4')],'where':_0x268c12[_0x0ccf('0x46')][_0x0ccf('0xf5')]?{'id':_0x268c12['query'][_0x0ccf('0xf5')]}:undefined,'required':_0x268c12[_0x0ccf('0x46')][_0x0ccf('0xf5')]?!![]:![]}];}return db[_0x0ccf('0xbe')][_0x0ccf('0x59')](_0xe7521f);})[_0x0ccf('0x24')](function(_0x37e8c0){_0x3771d2[_0x0ccf('0x6f')]=_0x37e8c0;return _0x3771d2;});}})['then'](respondWithFilteredResult(_0x54f626,_0xe7521f))[_0x0ccf('0x5a')](handleError(_0x54f626,null));};function iftimePromise(_0x4cdf03,_0x3820bc){return respondWithRpcPromise('Command',_0x0ccf('0xf6'),{'command':_0x3820bc['timezone']?util[_0x0ccf('0xb7')](_0x0ccf('0xf7'),_0x4cdf03['interval'],_0x3820bc[_0x0ccf('0xf8')]):util[_0x0ccf('0xb7')](_0x0ccf('0xf9'),_0x4cdf03[_0x0ccf('0xfa')])},client9002)[_0x0ccf('0x24')](function(_0x1803c5){var _0x51f308=_0x1803c5&&_0x1803c5[_0x0ccf('0xfb')](_0x0ccf('0xfc'))>=0x0?!![]:![];logger[_0x0ccf('0x2d')](_0x0ccf('0xfd'),_0x3820bc['id'],_0x4cdf03['id'],_0x4cdf03['interval'],_0x51f308?_0x0ccf('0xfe'):_0x0ccf('0xff'),_0x3820bc[_0x0ccf('0xf8')]?_0x3820bc[_0x0ccf('0xf8')]:_0x0ccf('0x100'));return _0x51f308;})[_0x0ccf('0x5a')](function(_0x1adaee){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x3820bc['id'],_0x4cdf03['id'],_0x4cdf03[_0x0ccf('0xfa')],util[_0x0ccf('0x101')](_0x1adaee,{'showHidden':![],'depth':null}),_0x3820bc['timezone']?_0x3820bc[_0x0ccf('0xf8')]:_0x0ccf('0x100'));return![];});}exports[_0x0ccf('0xf6')]=function(_0x2dc926,_0x204018,_0x45dc5d){var _0x1b6b26=0x0;var _0x227645=0x0;var _0x4988bc=![];var _0x5cb65c;var _0x10af28;return db[_0x0ccf('0x41')][_0x0ccf('0x5f')]({'where':{'id':_0x2dc926['params']['id']},'include':[{'model':db[_0x0ccf('0x102')],'as':'Interval','include':[{'model':db[_0x0ccf('0x102')],'as':'Intervals','attributes':['id',_0x0ccf('0xfa')],'raw':!![]}]}]})[_0x0ccf('0x24')](handleEntityNotFound(_0x204018,null))[_0x0ccf('0x24')](function(_0x4afcfc){if(_0x4afcfc){_0x5cb65c=_0x4afcfc;return _0x4afcfc[_0x0ccf('0x103')]({'raw':!![]});}})[_0x0ccf('0x24')](function(_0x11f6e0){if(_0x5cb65c){if(_0x11f6e0){_0x10af28=_0x11f6e0;}}return require(_0x0ccf('0x81'))[_0x0ccf('0x82')]();})[_0x0ccf('0x24')](function(_0x401e4c){if(_0x401e4c){_0x227645=_0x401e4c[_0x0ccf('0x104')];_0x4988bc=_0x401e4c['custom'];}})['then'](function(){return db[_0x0ccf('0xbe')]['count']({'where':{'closed':![]}});})['then'](function(_0x1d5028){_0x1b6b26=_0x1d5028;if(_0x227645&&_0x1d5028>_0x227645){return db[_0x0ccf('0x105')][_0x0ccf('0x6e')]({'where':{'id':0x1}})[_0x0ccf('0x24')](function(_0x4555e7){if(_0x4555e7){_0x4555e7[_0x0ccf('0x106')]('chatLicenseExceeded');}});}})[_0x0ccf('0x24')](function(){if(_0x5cb65c['Interval']&&_0x5cb65c[_0x0ccf('0x102')][_0x0ccf('0x107')]){var _0x16ab1c=[];for(var _0x2096b3=0x0;_0x2096b3<_0x5cb65c[_0x0ccf('0x102')][_0x0ccf('0x107')][_0x0ccf('0x4c')];_0x2096b3++){var _0x5449dc=_0x5cb65c[_0x0ccf('0x102')][_0x0ccf('0x107')][_0x2096b3][_0x0ccf('0x3b')]({'plain':!![]});_0x16ab1c['push'](iftimePromise(_0x5449dc,_0x5cb65c));}return BPromise[_0x0ccf('0x108')](_0x16ab1c)[_0x0ccf('0x24')](function(_0x14434f){return _[_0x0ccf('0x109')](_0x14434f);});}else{return!![];}})[_0x0ccf('0x24')](function(_0xfd1a80){var _0x221795=fs['readFileSync'](path['join'](config[_0x0ccf('0x7e')],_0x0ccf('0x10a')),_0x0ccf('0xdb'));var _0x4b6f61={'remote':_0x5cb65c[_0x0ccf('0x10b')],'query':querystring[_0x0ccf('0x28')](_['merge'](_0x5cb65c[_0x0ccf('0x3b')]({'plain':!![]}),{'customerIp':_0x2dc926['headers'][_0x0ccf('0xb0')]||_0x2dc926[_0x0ccf('0x93')][_0x0ccf('0x10c')]||_0x2dc926[_0x0ccf('0x10d')][_0x0ccf('0x10e')]||_0x2dc926['ip'],'referer':_0x2dc926[_0x0ccf('0x93')][_0x0ccf('0x10f')],'openedInteractions':_0x1b6b26,'maxInteractions':_0x227645,'virtual':_0x4988bc[_0x0ccf('0x104')],'online':_0xfd1a80,'custom':_0x4988bc}))[_0x0ccf('0x110')](/'/g,'\x5c\x27')};_0x204018[_0x0ccf('0xd5')](ejs[_0x0ccf('0xdc')](Mustache[_0x0ccf('0xdc')](_0x221795,_0x4b6f61),{'proactiveActions':_0x10af28,'alignment':_0x5cb65c[_0x0ccf('0x111')],'verticalAlignment':_0x5cb65c[_0x0ccf('0x112')],'div_color':_0x5cb65c[_0x0ccf('0xf4')],'text_color':_0x5cb65c['textColor']}));})[_0x0ccf('0x5a')](handleError(_0x204018,null));};exports['addApplications']=function(_0x42a577,_0x3c7de9,_0x36b35b){return db[_0x0ccf('0x41')][_0x0ccf('0x6e')]({'where':{'id':_0x42a577[_0x0ccf('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3c7de9,null))[_0x0ccf('0x24')](function(_0x1f32ee){if(_0x1f32ee){return db[_0x0ccf('0x113')][_0x0ccf('0x114')](function(_0x525264){return db[_0x0ccf('0xa3')][_0x0ccf('0x3d')]({'where':{'ChatWebsiteId':_0x42a577[_0x0ccf('0x5c')]['id']},'transaction':_0x525264})[_0x0ccf('0x24')](function(_0x218077){var _0x112306=_[_0x0ccf('0x54')](_0x42a577[_0x0ccf('0x61')],function(_0x18ff41){_0x18ff41[_0x0ccf('0x6b')]=_0x42a577['params']['id'];return _0x18ff41;});return db[_0x0ccf('0xa3')][_0x0ccf('0x115')](_0x112306,{'transaction':_0x525264});});})[_0x0ccf('0x24')](function(){return db[_0x0ccf('0xa3')][_0x0ccf('0x116')]({'where':{'ChatWebsiteId':_0x42a577[_0x0ccf('0x5c')]['id']},'order':_0x0ccf('0xaa')});});}})['then'](respondWithResult(_0x3c7de9,null))[_0x0ccf('0x5a')](handleError(_0x3c7de9,null));};exports[_0x0ccf('0x117')]=function(_0x553591,_0x528103,_0x4d71ac){var _0x31ef3b={};var _0x15ed10={};var _0x5bfa42;var _0x237609;return db[_0x0ccf('0x41')][_0x0ccf('0x6e')]({'where':{'id':_0x553591['params']['id']}})[_0x0ccf('0x24')](handleEntityNotFound(_0x528103,null))[_0x0ccf('0x24')](function(_0x4e4e1d){if(_0x4e4e1d){_0x5bfa42=_0x4e4e1d;_0x15ed10[_0x0ccf('0x45')]=_[_0x0ccf('0x47')](db[_0x0ccf('0xa3')]['rawAttributes']);_0x15ed10[_0x0ccf('0x46')]=_['keys'](_0x553591[_0x0ccf('0x46')]);_0x15ed10[_0x0ccf('0x48')]=_[_0x0ccf('0x49')](_0x15ed10[_0x0ccf('0x45')],_0x15ed10['query']);_0x31ef3b[_0x0ccf('0x4a')]=_[_0x0ccf('0x49')](_0x15ed10['model'],qs[_0x0ccf('0x4b')](_0x553591[_0x0ccf('0x46')][_0x0ccf('0x4b')]));_0x31ef3b[_0x0ccf('0x4a')]=_0x31ef3b[_0x0ccf('0x4a')][_0x0ccf('0x4c')]?_0x31ef3b[_0x0ccf('0x4a')]:_0x15ed10[_0x0ccf('0x45')];_0x31ef3b['order']=qs[_0x0ccf('0x50')](_0x553591[_0x0ccf('0x46')][_0x0ccf('0x50')]);_0x31ef3b[_0x0ccf('0x51')]=qs[_0x0ccf('0x48')](_['pick'](_0x553591[_0x0ccf('0x46')],_0x15ed10[_0x0ccf('0x48')]));if(_0x553591[_0x0ccf('0x46')][_0x0ccf('0x53')]){_0x31ef3b[_0x0ccf('0x51')]=_['merge'](_0x31ef3b[_0x0ccf('0x51')],{'$or':_[_0x0ccf('0x54')](_0x31ef3b[_0x0ccf('0x4a')],function(_0x11f809){var _0x472ebc={};_0x472ebc[_0x11f809]={'$like':'%'+_0x553591[_0x0ccf('0x46')]['filter']+'%'};return _0x472ebc;})});}_0x31ef3b=_[_0x0ccf('0x56')]({},_0x31ef3b,_0x553591['options']);return _0x5bfa42['getApplications'](_0x31ef3b);}})[_0x0ccf('0x24')](function(_0x221725){if(_0x221725){_0x237609=_0x221725[_0x0ccf('0x4c')];if(!_0x553591[_0x0ccf('0x46')][_0x0ccf('0x4d')](_0x0ccf('0x4e'))){_0x31ef3b['limit']=qs['limit'](_0x553591[_0x0ccf('0x46')]['limit']);_0x31ef3b[_0x0ccf('0x33')]=qs[_0x0ccf('0x33')](_0x553591[_0x0ccf('0x46')][_0x0ccf('0x33')]);}return _0x5bfa42[_0x0ccf('0x117')](_0x31ef3b);}})['then'](function(_0xe97d04){if(_0xe97d04){return _0xe97d04?{'count':_0x237609,'rows':_0xe97d04}:null;}})[_0x0ccf('0x24')](respondWithResult(_0x528103,null))[_0x0ccf('0x5a')](handleError(_0x528103,null));};exports[_0x0ccf('0x118')]=function(_0x1ba40e,_0x34691f,_0x35ee8d){return db[_0x0ccf('0x119')]['find']({'where':{'id':_0x1ba40e[_0x0ccf('0x5c')]['id']}})['then'](handleEntityNotFound(_0x34691f,null))[_0x0ccf('0x24')](function(_0xa88a5d){if(_0xa88a5d){return _0xa88a5d[_0x0ccf('0x118')](_0x1ba40e['body'][_0x0ccf('0x71')],_[_0x0ccf('0xef')](_0x1ba40e[_0x0ccf('0x61')],[_0x0ccf('0x71'),'id'])||{});}})['then'](respondWithResult(_0x34691f,null))[_0x0ccf('0x5a')](handleError(_0x34691f,null));};exports[_0x0ccf('0x103')]=function(_0x276fe7,_0x9fd9c7,_0x1b24c8){var _0x2d6020={};var _0x2c91e4={};var _0x292e54;var _0x522093;return db[_0x0ccf('0x41')][_0x0ccf('0x6e')]({'where':{'id':_0x276fe7[_0x0ccf('0x5c')]['id']}})[_0x0ccf('0x24')](handleEntityNotFound(_0x9fd9c7,null))[_0x0ccf('0x24')](function(_0x2218e0){if(_0x2218e0){_0x292e54=_0x2218e0;_0x2c91e4[_0x0ccf('0x45')]=_[_0x0ccf('0x47')](db['ChatProactiveAction'][_0x0ccf('0x42')]);_0x2c91e4[_0x0ccf('0x46')]=_[_0x0ccf('0x47')](_0x276fe7[_0x0ccf('0x46')]);_0x2c91e4['filters']=_['intersection'](_0x2c91e4[_0x0ccf('0x45')],_0x2c91e4['query']);_0x2d6020['attributes']=_['intersection'](_0x2c91e4[_0x0ccf('0x45')],qs['fields'](_0x276fe7[_0x0ccf('0x46')][_0x0ccf('0x4b')]));_0x2d6020[_0x0ccf('0x4a')]=_0x2d6020[_0x0ccf('0x4a')]['length']?_0x2d6020[_0x0ccf('0x4a')]:_0x2c91e4[_0x0ccf('0x45')];_0x2d6020[_0x0ccf('0x4f')]=qs[_0x0ccf('0x50')](_0x276fe7['query']['sort']);_0x2d6020[_0x0ccf('0x51')]=qs[_0x0ccf('0x48')](_[_0x0ccf('0x52')](_0x276fe7[_0x0ccf('0x46')],_0x2c91e4[_0x0ccf('0x48')]));if(_0x276fe7[_0x0ccf('0x46')][_0x0ccf('0x53')]){_0x2d6020[_0x0ccf('0x51')]=_[_0x0ccf('0x56')](_0x2d6020[_0x0ccf('0x51')],{'$or':_[_0x0ccf('0x54')](_0x2d6020[_0x0ccf('0x4a')],function(_0x2e67aa){var _0xf6530e={};_0xf6530e[_0x2e67aa]={'$like':'%'+_0x276fe7[_0x0ccf('0x46')][_0x0ccf('0x53')]+'%'};return _0xf6530e;})});}_0x2d6020=_['merge']({},_0x2d6020,_0x276fe7['options']);return _0x292e54[_0x0ccf('0x103')](_0x2d6020);}})[_0x0ccf('0x24')](function(_0x2fefb5){if(_0x2fefb5){_0x522093=_0x2fefb5[_0x0ccf('0x4c')];if(!_0x276fe7['query'][_0x0ccf('0x4d')](_0x0ccf('0x4e'))){_0x2d6020['limit']=qs[_0x0ccf('0x34')](_0x276fe7[_0x0ccf('0x46')][_0x0ccf('0x34')]);_0x2d6020[_0x0ccf('0x33')]=qs[_0x0ccf('0x33')](_0x276fe7['query'][_0x0ccf('0x33')]);}return _0x292e54['getProactiveActions'](_0x2d6020);}})[_0x0ccf('0x24')](function(_0x1207ad){if(_0x1207ad){return _0x1207ad?{'count':_0x522093,'rows':_0x1207ad}:null;}})['then'](respondWithResult(_0x9fd9c7,null))[_0x0ccf('0x5a')](handleError(_0x9fd9c7,null));};exports[_0x0ccf('0x11a')]=function(_0x27c6ae,_0x2948de,_0x37a2cc){var _0x3b46a9=_0x27c6ae[_0x0ccf('0x46')][_0x0ccf('0x11b')]===_0x0ccf('0x11c')?'offlineForm':_0x0ccf('0x11d');return db[_0x0ccf('0x41')][_0x0ccf('0x5f')]({'attributes':['id',_0x3b46a9],'where':{'id':_0x27c6ae[_0x0ccf('0x5c')]['id']}})[_0x0ccf('0x24')](handleEntityNotFound(_0x2948de,null))[_0x0ccf('0x24')](function(_0x5b5b65){if(_0x5b5b65){var _0x3a7041=_0x5b5b65[_0x3b46a9];var _0x26f749=_0x3a7041&&_0x3a7041[_0x0ccf('0x11e')]?_0x3a7041['items']:[];_0x2948de[_0x0ccf('0xd5')]({'fromKey':_[_0x0ccf('0x83')](_0x3a7041[_0x0ccf('0x11f')])?undefined:_0x3a7041[_0x0ccf('0x11f')],'count':_0x26f749[_0x0ccf('0x4c')],'rows':_0x26f749});}})[_0x0ccf('0x5a')](handleError(_0x2948de,null));};exports[_0x0ccf('0x120')]=function(_0x4e11ed,_0x1dc774,_0x1564f5){var _0x1a11b4={'raw':![],'where':{}};var _0x19c7de={};var _0x10c467={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0ccf('0x6e')]({'where':{'id':_0x4e11ed[_0x0ccf('0x5c')]['id']}})[_0x0ccf('0x24')](handleEntityNotFound(_0x1dc774,null))[_0x0ccf('0x24')](function(_0x2df29f){if(_0x2df29f){_0x19c7de['model']=_['keys'](db[_0x0ccf('0xdf')][_0x0ccf('0x42')]);_0x19c7de['query']=_['keys'](_0x4e11ed[_0x0ccf('0x46')]);_0x19c7de[_0x0ccf('0x48')]=_[_0x0ccf('0x49')](_0x19c7de[_0x0ccf('0x45')],_0x19c7de[_0x0ccf('0x46')]);_0x1a11b4['attributes']=_[_0x0ccf('0x49')](_0x19c7de[_0x0ccf('0x45')],qs[_0x0ccf('0x4b')](_0x4e11ed['query'][_0x0ccf('0x4b')]));_0x1a11b4[_0x0ccf('0x4a')]=_0x1a11b4[_0x0ccf('0x4a')][_0x0ccf('0x4c')]?_0x1a11b4[_0x0ccf('0x4a')]:_0x19c7de[_0x0ccf('0x45')];if(!_0x4e11ed[_0x0ccf('0x46')][_0x0ccf('0x4d')](_0x0ccf('0x4e'))){_0x1a11b4[_0x0ccf('0x34')]=qs[_0x0ccf('0x34')](_0x4e11ed[_0x0ccf('0x46')][_0x0ccf('0x34')]);_0x1a11b4[_0x0ccf('0x33')]=qs[_0x0ccf('0x33')](_0x4e11ed['query'][_0x0ccf('0x33')]);}_0x1a11b4['order']=qs[_0x0ccf('0x50')](_0x4e11ed[_0x0ccf('0x46')][_0x0ccf('0x50')]);_0x1a11b4[_0x0ccf('0x51')]=qs[_0x0ccf('0x48')](_[_0x0ccf('0x52')](_0x4e11ed[_0x0ccf('0x46')],_0x19c7de[_0x0ccf('0x48')]));_0x1a11b4[_0x0ccf('0x51')][_0x0ccf('0x6b')]=_0x2df29f['id'];if(_0x4e11ed[_0x0ccf('0x46')][_0x0ccf('0x53')]){_0x1a11b4[_0x0ccf('0x51')]=_[_0x0ccf('0x56')](_0x1a11b4[_0x0ccf('0x51')],{'$or':_['map'](_0x1a11b4[_0x0ccf('0x4a')],function(_0xfd1475){var _0x1af355={};_0x1af355[_0xfd1475]={'$like':'%'+_0x4e11ed[_0x0ccf('0x46')][_0x0ccf('0x53')]+'%'};return _0x1af355;})});}_0x1a11b4=_[_0x0ccf('0x56')]({},_0x1a11b4,_0x4e11ed[_0x0ccf('0x5e')]);return db[_0x0ccf('0xdf')]['count']({'where':_0x1a11b4['where']})[_0x0ccf('0x24')](function(_0x4a7743){_0x10c467[_0x0ccf('0x32')]=_0x4a7743;if(_0x4e11ed[_0x0ccf('0x46')][_0x0ccf('0x57')]){_0x1a11b4[_0x0ccf('0x58')]=[{'all':!![]}];}else{_0x1a11b4[_0x0ccf('0x58')]=[{'model':db[_0x0ccf('0xa2')],'as':'Contact','required':![]}];}return db[_0x0ccf('0xdf')]['findAll'](_0x1a11b4);})[_0x0ccf('0x24')](function(_0x54ecec){_0x10c467[_0x0ccf('0x6f')]=_0x54ecec;return _0x10c467;});}})[_0x0ccf('0x24')](respondWithFilteredResult(_0x1dc774,_0x1a11b4))[_0x0ccf('0x5a')](handleError(_0x1dc774,null));};exports[_0x0ccf('0x121')]=function(_0x30619a,_0x2f4812,_0x339ed4){return db[_0x0ccf('0x41')][_0x0ccf('0x5f')]({'where':{'id':_0x30619a[_0x0ccf('0x5c')]['id']}})[_0x0ccf('0x24')](handleEntityNotFound(_0x2f4812,null))[_0x0ccf('0x24')](function(_0x174ad9){if(_0x174ad9){return _0x174ad9[_0x0ccf('0x121')](_0x30619a['body'][_0x0ccf('0x71')],_[_0x0ccf('0xef')](_0x30619a[_0x0ccf('0x61')],[_0x0ccf('0x71'),'id'])||{})['spread'](function(_0x2c7f7b){for(var _0x15a352=0x0;_0x15a352<_0x30619a[_0x0ccf('0x61')][_0x0ccf('0x71')][_0x0ccf('0x4c')];_0x15a352+=0x1){socket[_0x0ccf('0x122')]('userChatWebsite:save',{'UserId':_0x30619a[_0x0ccf('0x61')][_0x0ccf('0x71')][_0x15a352],'ChatWebsiteId':_0x30619a[_0x0ccf('0x5c')]['id']});}return _0x2c7f7b;});}})[_0x0ccf('0x24')](respondWithResult(_0x2f4812,null))['catch'](handleError(_0x2f4812,null));};exports['removeAgents']=function(_0x36497f,_0x567481,_0x34e196){return db['ChatWebsite'][_0x0ccf('0x5f')]({'where':{'id':_0x36497f[_0x0ccf('0x5c')]['id']}})[_0x0ccf('0x24')](handleEntityNotFound(_0x567481,null))[_0x0ccf('0x24')](function(_0x526d0e){if(_0x526d0e){return _0x526d0e[_0x0ccf('0x123')](_0x36497f['query'][_0x0ccf('0x71')])['then'](function(){if(_[_0x0ccf('0x124')](_0x36497f[_0x0ccf('0x46')][_0x0ccf('0x71')])){for(var _0x56b6e0=0x0;_0x56b6e0<_0x36497f[_0x0ccf('0x46')][_0x0ccf('0x71')][_0x0ccf('0x4c')];_0x56b6e0+=0x1){socket[_0x0ccf('0x122')](_0x0ccf('0x125'),{'UserId':Number(_0x36497f[_0x0ccf('0x46')][_0x0ccf('0x71')][_0x56b6e0]),'ChatWebsiteId':Number(_0x36497f[_0x0ccf('0x5c')]['id'])});}}else{socket[_0x0ccf('0x122')](_0x0ccf('0x125'),{'UserId':Number(_0x36497f[_0x0ccf('0x46')][_0x0ccf('0x71')]),'ChatWebsiteId':Number(_0x36497f[_0x0ccf('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x567481,null))[_0x0ccf('0x5a')](handleError(_0x567481,null));};exports[_0x0ccf('0x126')]=function(_0x4c1897,_0x183ae7,_0x23bd96){var _0x501e8e={};var _0x48c647={};var _0x39efbe;var _0x6d584f;return db[_0x0ccf('0x41')][_0x0ccf('0x6e')]({'where':{'id':_0x4c1897[_0x0ccf('0x5c')]['id']}})[_0x0ccf('0x24')](handleEntityNotFound(_0x183ae7,null))['then'](function(_0x4baea4){if(_0x4baea4){_0x39efbe=_0x4baea4;_0x48c647[_0x0ccf('0x45')]=_[_0x0ccf('0x47')](db[_0x0ccf('0xcb')][_0x0ccf('0x42')]);_0x48c647[_0x0ccf('0x46')]=_['keys'](_0x4c1897[_0x0ccf('0x46')]);_0x48c647[_0x0ccf('0x48')]=_[_0x0ccf('0x49')](_0x48c647[_0x0ccf('0x45')],_0x48c647['query']);_0x501e8e[_0x0ccf('0x4a')]=_[_0x0ccf('0x49')](_0x48c647[_0x0ccf('0x45')],qs['fields'](_0x4c1897[_0x0ccf('0x46')][_0x0ccf('0x4b')]));_0x501e8e['attributes']=_0x501e8e['attributes'][_0x0ccf('0x4c')]?_0x501e8e[_0x0ccf('0x4a')]:_0x48c647[_0x0ccf('0x45')];_0x501e8e[_0x0ccf('0x4f')]=qs[_0x0ccf('0x50')](_0x4c1897['query'][_0x0ccf('0x50')]);_0x501e8e['where']=qs[_0x0ccf('0x48')](_[_0x0ccf('0x52')](_0x4c1897[_0x0ccf('0x46')],_0x48c647[_0x0ccf('0x48')]));if(_0x4c1897[_0x0ccf('0x46')][_0x0ccf('0x53')]){_0x501e8e[_0x0ccf('0x51')]=_['merge'](_0x501e8e[_0x0ccf('0x51')],{'$or':_['map'](_0x501e8e[_0x0ccf('0x4a')],function(_0x4cda9f){var _0x455e5b={};_0x455e5b[_0x4cda9f]={'$like':'%'+_0x4c1897[_0x0ccf('0x46')]['filter']+'%'};return _0x455e5b;})});}_0x501e8e=_[_0x0ccf('0x56')]({},_0x501e8e,_0x4c1897[_0x0ccf('0x5e')]);return _0x39efbe[_0x0ccf('0x126')](_0x501e8e);}})[_0x0ccf('0x24')](function(_0x1397c4){if(_0x1397c4){_0x6d584f=_0x1397c4[_0x0ccf('0x4c')];if(!_0x4c1897[_0x0ccf('0x46')][_0x0ccf('0x4d')](_0x0ccf('0x4e'))){_0x501e8e[_0x0ccf('0x34')]=qs[_0x0ccf('0x34')](_0x4c1897[_0x0ccf('0x46')][_0x0ccf('0x34')]);_0x501e8e[_0x0ccf('0x33')]=qs[_0x0ccf('0x33')](_0x4c1897[_0x0ccf('0x46')][_0x0ccf('0x33')]);}return _0x39efbe[_0x0ccf('0x126')](_0x501e8e);}})['then'](function(_0x39cb0e){if(_0x39cb0e){return _0x39cb0e?{'count':_0x6d584f,'rows':_0x39cb0e}:null;}})[_0x0ccf('0x24')](respondWithResult(_0x183ae7,null))[_0x0ccf('0x5a')](handleError(_0x183ae7,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 11076a5..c92c8db 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 _0xef1c=['setMaxListeners','save','update','remove','emit','hook','events','../../mysqldb'];(function(_0x1a1fbd,_0x266bbf){var _0x2361a0=function(_0x4442bd){while(--_0x4442bd){_0x1a1fbd['push'](_0x1a1fbd['shift']());}};_0x2361a0(++_0x266bbf);}(_0xef1c,0x176));var _0xcef1=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xef1c[_0x397e5f];return _0x5302b8;};'use strict';var EventEmitter=require(_0xcef1('0x0'));var ChatWebsite=require(_0xcef1('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xcef1('0x2')](0x0);var events={'afterCreate':_0xcef1('0x3'),'afterUpdate':_0xcef1('0x4'),'afterDestroy':_0xcef1('0x5')};function emitEvent(_0x34a1ce){return function(_0x3872e2,_0x58f00c,_0x1e6fd3){ChatWebsiteEvents[_0xcef1('0x6')](_0x34a1ce+':'+_0x3872e2['id'],_0x3872e2);ChatWebsiteEvents[_0xcef1('0x6')](_0x34a1ce,_0x3872e2);_0x1e6fd3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xcef1('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0x39d9=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove'];(function(_0x2cea58,_0x153c15){var _0x192933=function(_0x4f1e9b){while(--_0x4f1e9b){_0x2cea58['push'](_0x2cea58['shift']());}};_0x192933(++_0x153c15);}(_0x39d9,0x17f));var _0x939d=function(_0x36450f,_0x42044b){_0x36450f=_0x36450f-0x0;var _0x4dfac7=_0x39d9[_0x36450f];return _0x4dfac7;};'use strict';var EventEmitter=require(_0x939d('0x0'));var ChatWebsite=require(_0x939d('0x1'))['db'][_0x939d('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x939d('0x3')](0x0);var events={'afterCreate':_0x939d('0x4'),'afterUpdate':_0x939d('0x5'),'afterDestroy':_0x939d('0x6')};function emitEvent(_0x470ba7){return function(_0x57ab6c,_0x2a9e29,_0x2730aa){ChatWebsiteEvents[_0x939d('0x7')](_0x470ba7+':'+_0x57ab6c['id'],_0x57ab6c);ChatWebsiteEvents['emit'](_0x470ba7,_0x57ab6c);_0x2730aa(null);};}for(var e in events){if(events[_0x939d('0x8')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x939d('0x9')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index d1f2bde..8f650f9 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 _0x1bca=['ChatWebsite','chat_websites','util','moment','request-promise','path','rimraf','./chatWebsite.attributes','exports'];(function(_0x4321d7,_0x4db446){var _0x558610=function(_0x4e75d1){while(--_0x4e75d1){_0x4321d7['push'](_0x4321d7['shift']());}};_0x558610(++_0x4db446);}(_0x1bca,0xb6));var _0xa1bc=function(_0x309288,_0x51468f){_0x309288=_0x309288-0x0;var _0x9d03c1=_0x1bca[_0x309288];return _0x9d03c1;};'use strict';var _=require('lodash');var util=require(_0xa1bc('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa1bc('0x1'));var BPromise=require('bluebird');var rp=require(_0xa1bc('0x2'));var fs=require('fs');var path=require(_0xa1bc('0x3'));var rimraf=require(_0xa1bc('0x4'));var config=require('../../config/environment');var attributes=require(_0xa1bc('0x5'));module[_0xa1bc('0x6')]=function(_0x168b44,_0x268ced){return _0x168b44['define'](_0xa1bc('0x7'),attributes,{'tableName':_0xa1bc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','util'];(function(_0x118a51,_0x612bb){var _0x5d8cd3=function(_0x25272f){while(--_0x25272f){_0x118a51['push'](_0x118a51['shift']());}};_0x5d8cd3(++_0x612bb);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'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/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index a750612..9088ae3 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 _0x1a37=['rpc','jayson/promise','http','redis','defaults','register','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x53fb63,_0x2497b0){var _0x3fd488=function(_0x41848a){while(--_0x41848a){_0x53fb63['push'](_0x53fb63['shift']());}};_0x3fd488(++_0x2497b0);}(_0x1a37,0xb4));var _0x71a3=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x1a37[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var moment=require(_0x71a3('0x2'));var BPromise=require(_0x71a3('0x3'));var rs=require(_0x71a3('0x4'));var fs=require('fs');var Redis=require(_0x71a3('0x5'));var db=require(_0x71a3('0x6'))['db'];var utils=require(_0x71a3('0x7'));var logger=require(_0x71a3('0x8'))(_0x71a3('0x9'));var config=require('../../config/environment');var jayson=require(_0x71a3('0xa'));var client=jayson['client'][_0x71a3('0xb')]({'port':0x232a});config[_0x71a3('0xc')]=_[_0x71a3('0xd')](config[_0x71a3('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')[_0x71a3('0xe')](socket);function respondWithRpcPromise(_0x18320a,_0x3709bc,_0x3aeb48){return new BPromise(function(_0x3a7fc1,_0x2215f2){return client[_0x71a3('0xf')](_0x18320a,_0x3aeb48)[_0x71a3('0x10')](function(_0x5c464c){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x3709bc,_0x71a3('0x11'));logger[_0x71a3('0x12')](_0x71a3('0x13'),_0x3709bc,_0x71a3('0x11'),JSON[_0x71a3('0x14')](_0x5c464c));if(_0x5c464c[_0x71a3('0x15')]){if(_0x5c464c[_0x71a3('0x15')][_0x71a3('0x16')]===0x1f4){logger[_0x71a3('0x15')](_0x71a3('0x17'),_0x3709bc,_0x5c464c[_0x71a3('0x15')]['message']);return _0x2215f2(_0x5c464c[_0x71a3('0x15')][_0x71a3('0x18')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x3709bc,_0x5c464c[_0x71a3('0x15')][_0x71a3('0x18')]);return _0x3a7fc1(_0x5c464c[_0x71a3('0x15')][_0x71a3('0x18')]);}else{logger[_0x71a3('0x19')](_0x71a3('0x17'),_0x3709bc,'request\x20sent');_0x3a7fc1(_0x5c464c[_0x71a3('0x1a')][_0x71a3('0x18')]);}})['catch'](function(_0x5f4562){logger[_0x71a3('0x15')](_0x71a3('0x17'),_0x3709bc,_0x5f4562);_0x2215f2(_0x5f4562);});});} \ No newline at end of file +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(_0x13e172,_0xf2b3c8){var _0x38c695=function(_0x31aa0f){while(--_0x31aa0f){_0x13e172['push'](_0x13e172['shift']());}};_0x38c695(++_0xf2b3c8);}(_0x1261,0x144));var _0x1126=function(_0x30e004,_0x46f8c2){_0x30e004=_0x30e004-0x0;var _0x5ca247=_0x1261[_0x30e004];return _0x5ca247;};'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 diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index f9aa723..b61e969 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(_0x4c9f76,_0x5e0403){var _0x551afe=function(_0x1a3d2a){while(--_0x1a3d2a){_0x4c9f76['push'](_0x4c9f76['shift']());}};_0x551afe(++_0x5e0403);}(_0x5f2f,0x73));var _0xf5f2=function(_0x12258d,_0x11ff9a){_0x12258d=_0x12258d-0x0;var _0x3f322c=_0x5f2f[_0x12258d];return _0x3f322c;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file +var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x171e4d,_0x4f2493){var _0x2d2bf4=function(_0x3a74cc){while(--_0x3a74cc){_0x171e4d['push'](_0x171e4d['shift']());}};_0x2d2bf4(++_0x4f2493);}(_0x5f2f,0x73));var _0xf5f2=function(_0x27b2ed,_0xd747ef){_0x27b2ed=_0x27b2ed-0x0;var _0x1ada1b=_0x5f2f[_0x27b2ed];return _0x1ada1b;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index cf32986..eda75f5 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 _0x76e0=['addCustomerAvatar','originalname','single','/:id/offline','offline','addInteraction','addApplications','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatWebsite.controller','index','get','/describe','isAuthenticated','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','create','/:id/dispositions','addDisposition','post','addAnswer','diskStorage','server/files/images/logos/','format','%s-%s','now','file','join','root','server/files/images/avatars/','/:id/avatar','addAvatar'];(function(_0x345dd0,_0x16f4eb){var _0x3f0320=function(_0x930094){while(--_0x930094){_0x345dd0['push'](_0x345dd0['shift']());}};_0x3f0320(++_0x16f4eb);}(_0x76e0,0x18d));var _0x076e=function(_0x38870a,_0x537c99){_0x38870a=_0x38870a-0x0;var _0x828eec=_0x76e0[_0x38870a];return _0x828eec;};'use strict';var multer=require(_0x076e('0x0'));var util=require(_0x076e('0x1'));var path=require(_0x076e('0x2'));var timeout=require(_0x076e('0x3'));var express=require(_0x076e('0x4'));var router=express[_0x076e('0x5')]();var auth=require(_0x076e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x076e('0x7'));var controller=require(_0x076e('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x076e('0x9')]);router[_0x076e('0xa')](_0x076e('0xb'),auth[_0x076e('0xc')](),controller['describe']);router[_0x076e('0xa')](_0x076e('0xd'),auth[_0x076e('0xc')](),controller[_0x076e('0xe')]);router[_0x076e('0xa')]('/:id/dispositions',auth[_0x076e('0xc')](),controller[_0x076e('0xf')]);router[_0x076e('0xa')](_0x076e('0x10'),auth[_0x076e('0xc')](),controller[_0x076e('0x11')]);router['get'](_0x076e('0x12'),controller[_0x076e('0x13')]);router[_0x076e('0xa')]('/:id/avatar',controller[_0x076e('0x14')]);router[_0x076e('0xa')](_0x076e('0x15'),controller[_0x076e('0x16')]);router[_0x076e('0xa')]('/:id/system_avatar',controller[_0x076e('0x17')]);router[_0x076e('0xa')](_0x076e('0x18'),auth[_0x076e('0xc')](),controller['getInteractions']);router[_0x076e('0xa')]('/:id/snippet',controller[_0x076e('0x19')]);router['get'](_0x076e('0x1a'),auth[_0x076e('0xc')](),controller[_0x076e('0x1b')]);router[_0x076e('0xa')](_0x076e('0x1c'),auth[_0x076e('0xc')](),controller[_0x076e('0x1d')]);router['get'](_0x076e('0x1e'),controller[_0x076e('0x1f')]);router[_0x076e('0xa')](_0x076e('0x20'),auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0x076e('0xa')](_0x076e('0x21'),auth['isAuthenticated'](),controller[_0x076e('0x22')]);router['post']('/',auth[_0x076e('0xc')](),controller[_0x076e('0x23')]);router['post'](_0x076e('0x24'),auth['isAuthenticated'](),controller[_0x076e('0x25')]);router[_0x076e('0x26')](_0x076e('0x10'),auth[_0x076e('0xc')](),controller[_0x076e('0x27')]);var upload=multer({'storage':multer[_0x076e('0x28')]({'destination':function(_0x212c57,_0xad8572,_0x6d5f00){_0x6d5f00(null,path['join'](config['root'],_0x076e('0x29')));},'filename':function(_0x3052de,_0x4f373c,_0x5e6d84){_0x5e6d84(null,util[_0x076e('0x2a')](_0x076e('0x2b'),Date[_0x076e('0x2c')](),_0x4f373c['originalname']));}})});router['post'](_0x076e('0x12'),upload['single'](_0x076e('0x2d')),controller['addLogo']);var upload=multer({'storage':multer[_0x076e('0x28')]({'destination':function(_0x1a8b12,_0x959a93,_0x22fc82){_0x22fc82(null,path[_0x076e('0x2e')](config[_0x076e('0x2f')],_0x076e('0x30')));},'filename':function(_0x3900b8,_0x5bbe0f,_0x448ef5){_0x448ef5(null,util[_0x076e('0x2a')](_0x076e('0x2b'),Date[_0x076e('0x2c')](),_0x5bbe0f['originalname']));}})});router[_0x076e('0x26')](_0x076e('0x31'),upload['single']('file'),controller[_0x076e('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x596d26,_0x580381,_0x546f9a){_0x546f9a(null,path[_0x076e('0x2e')](config[_0x076e('0x2f')],'server/files/images/avatars/'));},'filename':function(_0x1b2f02,_0x4b2497,_0x4f6bc7){_0x4f6bc7(null,util[_0x076e('0x2a')]('%s-%s',Date['now'](),_0x4b2497['originalname']));}})});router[_0x076e('0x26')](_0x076e('0x15'),upload['single'](_0x076e('0x2d')),controller[_0x076e('0x33')]);var upload=multer({'storage':multer[_0x076e('0x28')]({'destination':function(_0xe3fb81,_0x1075de,_0x8f34d0){_0x8f34d0(null,path[_0x076e('0x2e')](config[_0x076e('0x2f')],_0x076e('0x30')));},'filename':function(_0x492639,_0x536076,_0x29ddce){_0x29ddce(null,util[_0x076e('0x2a')](_0x076e('0x2b'),Date[_0x076e('0x2c')](),_0x536076[_0x076e('0x34')]));}})});router[_0x076e('0x26')]('/:id/system_avatar',upload[_0x076e('0x35')](_0x076e('0x2d')),controller['addSystemAvatar']);router[_0x076e('0x26')]('/:id/notify',controller['notify']);router[_0x076e('0x26')](_0x076e('0x36'),controller[_0x076e('0x37')]);router[_0x076e('0x26')](_0x076e('0x18'),auth[_0x076e('0xc')](),controller[_0x076e('0x38')]);router[_0x076e('0x26')](_0x076e('0x1a'),auth[_0x076e('0xc')](),controller[_0x076e('0x39')]);router[_0x076e('0x26')](_0x076e('0x1c'),auth[_0x076e('0xc')](),controller['addProactiveActions']);router['post']('/:id/users',auth[_0x076e('0xc')](),controller['addAgents']);router['put'](_0x076e('0xd'),auth[_0x076e('0xc')](),controller[_0x076e('0x3a')]);router[_0x076e('0x3b')](_0x076e('0xd'),auth['isAuthenticated'](),controller[_0x076e('0x3c')]);router[_0x076e('0x3b')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0x076e('0x3b')](_0x076e('0x10'),auth['isAuthenticated'](),controller[_0x076e('0x3d')]);router[_0x076e('0x3b')](_0x076e('0x21'),auth[_0x076e('0xc')](),controller[_0x076e('0x3e')]);module[_0x076e('0x3f')]=router; \ No newline at end of file +var _0x7672=['/:id/dispositions','getDispositions','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','root','server/files/images/logos/','format','now','originalname','file','addLogo','%s-%s','single','addAvatar','server/files/images/avatars/','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','/:id/offline','addInteraction','/:id/applications','addApplications','addProactiveActions','/:id/users','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','isAuthenticated','describe','/:id'];(function(_0x3480f2,_0x4947fa){var _0x1e4899=function(_0x4a884f){while(--_0x4a884f){_0x3480f2['push'](_0x3480f2['shift']());}};_0x1e4899(++_0x4947fa);}(_0x7672,0xf2));var _0x2767=function(_0x2e81b2,_0x4dab93){_0x2e81b2=_0x2e81b2-0x0;var _0x309fd4=_0x7672[_0x2e81b2];return _0x309fd4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x2767('0x0'));var express=require('express');var router=express['Router']();var auth=require(_0x2767('0x1'));var interaction=require(_0x2767('0x2'));var config=require(_0x2767('0x3'));var controller=require(_0x2767('0x4'));router[_0x2767('0x5')]('/',auth['isAuthenticated'](),controller[_0x2767('0x6')]);router[_0x2767('0x5')]('/describe',auth[_0x2767('0x7')](),controller[_0x2767('0x8')]);router['get'](_0x2767('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0x2767('0xa'),auth['isAuthenticated'](),controller[_0x2767('0xb')]);router[_0x2767('0x5')]('/:id/canned_answers',auth[_0x2767('0x7')](),controller['getAnswers']);router['get']('/:id/logo',controller[_0x2767('0xc')]);router['get'](_0x2767('0xd'),controller[_0x2767('0xe')]);router[_0x2767('0x5')]('/:id/customer_avatar',controller[_0x2767('0xf')]);router[_0x2767('0x5')](_0x2767('0x10'),controller['getSystemAvatar']);router[_0x2767('0x5')](_0x2767('0x11'),auth['isAuthenticated'](),controller[_0x2767('0x12')]);router[_0x2767('0x5')](_0x2767('0x13'),controller[_0x2767('0x14')]);router[_0x2767('0x5')]('/:id/applications',auth['isAuthenticated'](),controller[_0x2767('0x15')]);router[_0x2767('0x5')](_0x2767('0x16'),auth[_0x2767('0x7')](),controller[_0x2767('0x17')]);router['get']('/:id/fields',controller[_0x2767('0x18')]);router['get'](_0x2767('0x19'),auth[_0x2767('0x7')](),controller[_0x2767('0x1a')]);router['get']('/:id/users',auth[_0x2767('0x7')](),controller[_0x2767('0x1b')]);router[_0x2767('0x1c')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2767('0x1c')](_0x2767('0xa'),auth['isAuthenticated'](),controller[_0x2767('0x1d')]);router[_0x2767('0x1c')](_0x2767('0x1e'),auth[_0x2767('0x7')](),controller[_0x2767('0x1f')]);var upload=multer({'storage':multer[_0x2767('0x20')]({'destination':function(_0x592b74,_0x1ce30e,_0x32c12b){_0x32c12b(null,path['join'](config[_0x2767('0x21')],_0x2767('0x22')));},'filename':function(_0x2cf442,_0x391aa7,_0x270bfc){_0x270bfc(null,util[_0x2767('0x23')]('%s-%s',Date[_0x2767('0x24')](),_0x391aa7[_0x2767('0x25')]));}})});router[_0x2767('0x1c')]('/:id/logo',upload['single'](_0x2767('0x26')),controller[_0x2767('0x27')]);var upload=multer({'storage':multer[_0x2767('0x20')]({'destination':function(_0x1c8543,_0x502ebd,_0x37d921){_0x37d921(null,path['join'](config[_0x2767('0x21')],'server/files/images/avatars/'));},'filename':function(_0x1751e8,_0x50518c,_0x9e2e49){_0x9e2e49(null,util[_0x2767('0x23')](_0x2767('0x28'),Date[_0x2767('0x24')](),_0x50518c[_0x2767('0x25')]));}})});router[_0x2767('0x1c')](_0x2767('0xd'),upload[_0x2767('0x29')](_0x2767('0x26')),controller[_0x2767('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x379bf3,_0x4c4a5c,_0x48c531){_0x48c531(null,path['join'](config['root'],_0x2767('0x2b')));},'filename':function(_0x51720a,_0x2e7fb8,_0x34a8e3){_0x34a8e3(null,util['format'](_0x2767('0x28'),Date[_0x2767('0x24')](),_0x2e7fb8[_0x2767('0x25')]));}})});router['post'](_0x2767('0x2c'),upload[_0x2767('0x29')](_0x2767('0x26')),controller[_0x2767('0x2d')]);var upload=multer({'storage':multer[_0x2767('0x20')]({'destination':function(_0x5d1931,_0x5ceb06,_0x136922){_0x136922(null,path['join'](config['root'],_0x2767('0x2b')));},'filename':function(_0x3bf0de,_0x3a7c31,_0x34c9ac){_0x34c9ac(null,util[_0x2767('0x23')](_0x2767('0x28'),Date['now'](),_0x3a7c31['originalname']));}})});router['post']('/:id/system_avatar',upload[_0x2767('0x29')](_0x2767('0x26')),controller[_0x2767('0x2e')]);router[_0x2767('0x1c')](_0x2767('0x2f'),controller[_0x2767('0x30')]);router[_0x2767('0x1c')](_0x2767('0x31'),controller['offline']);router[_0x2767('0x1c')](_0x2767('0x11'),auth[_0x2767('0x7')](),controller[_0x2767('0x32')]);router['post'](_0x2767('0x33'),auth[_0x2767('0x7')](),controller[_0x2767('0x34')]);router['post'](_0x2767('0x16'),auth[_0x2767('0x7')](),controller[_0x2767('0x35')]);router[_0x2767('0x1c')](_0x2767('0x36'),auth[_0x2767('0x7')](),controller[_0x2767('0x37')]);router[_0x2767('0x38')](_0x2767('0x9'),auth[_0x2767('0x7')](),controller[_0x2767('0x39')]);router[_0x2767('0x3a')](_0x2767('0x9'),auth[_0x2767('0x7')](),controller[_0x2767('0x3b')]);router[_0x2767('0x3a')]('/:id/dispositions',auth[_0x2767('0x7')](),controller[_0x2767('0x3c')]);router['delete'](_0x2767('0x1e'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x2767('0x3a')](_0x2767('0x36'),auth[_0x2767('0x7')](),controller[_0x2767('0x3d')]);module[_0x2767('0x3e')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index ccc862a..83cc0fd 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 _0x6c1d=['name','STRING','exports'];(function(_0x103391,_0x2c19a1){var _0x473c50=function(_0x2031d3){while(--_0x2031d3){_0x103391['push'](_0x103391['shift']());}};_0x473c50(++_0x2c19a1);}(_0x6c1d,0x1a9));var _0xd6c1=function(_0x24dc28,_0x187aca){_0x24dc28=_0x24dc28-0x0;var _0x98d80c=_0x6c1d[_0x24dc28];return _0x98d80c;};'use strict';var Sequelize=require('sequelize');module[_0xd6c1('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xd6c1('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd6c1('0x2')]},'companyId':{'type':Sequelize[_0xd6c1('0x2')]},'website':{'type':Sequelize[_0xd6c1('0x2')]},'phone':{'type':Sequelize[_0xd6c1('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd6c1('0x2')]},'street':{'type':Sequelize[_0xd6c1('0x2')]},'postalCode':{'type':Sequelize[_0xd6c1('0x2')]},'city':{'type':Sequelize[_0xd6c1('0x2')]},'country':{'type':Sequelize[_0xd6c1('0x2')]},'email':{'type':Sequelize[_0xd6c1('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xd6c1('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xd6c1('0x2')]},'sCountry':{'type':Sequelize[_0xd6c1('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xde73=['STRING','name'];(function(_0x300266,_0x5daa84){var _0x4fa23e=function(_0xf5803){while(--_0xf5803){_0x300266['push'](_0x300266['shift']());}};_0x4fa23e(++_0x5daa84);}(_0xde73,0xa9));var _0x3de7=function(_0x2d6939,_0x60fc90){_0x2d6939=_0x2d6939-0x0;var _0x366e33=_0xde73[_0x2d6939];return _0x366e33;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x3de7('0x0'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x3de7('0x1')]},'companyId':{'type':Sequelize[_0x3de7('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x3de7('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x3de7('0x1')]},'postalCode':{'type':Sequelize[_0x3de7('0x1')]},'city':{'type':Sequelize[_0x3de7('0x1')]},'country':{'type':Sequelize[_0x3de7('0x1')]},'email':{'type':Sequelize[_0x3de7('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x3de7('0x1')]},'sStreet':{'type':Sequelize[_0x3de7('0x1')]},'sPostalCode':{'type':Sequelize[_0x3de7('0x1')]},'sCity':{'type':Sequelize[_0x3de7('0x1')]},'sCountry':{'type':Sequelize[_0x3de7('0x1')]},'description':{'type':Sequelize[_0x3de7('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index a704a80..829afe6 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 _0xa5dd=['body','get','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','omit','getContacts','findOne','sort','pick','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','Content-Range','apply','reject','update','then','destroy','Companies','UserProfileResource','error','name','index','CmCompany','describe','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','filters','filter','merge','map','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','find','create'];(function(_0x5bca19,_0x5e3dd0){var _0x811b8f=function(_0x209828){while(--_0x209828){_0x5bca19['push'](_0x5bca19['shift']());}};_0x811b8f(++_0x5e3dd0);}(_0xa5dd,0x1b3));var _0xda5d=function(_0x24d9e9,_0x1ef9db){_0x24d9e9=_0x24d9e9-0x0;var _0x558526=_0xa5dd[_0x24d9e9];return _0x558526;};'use strict';var pdf=require(_0xda5d('0x0'));var emlformat=require(_0xda5d('0x1'));var rimraf=require(_0xda5d('0x2'));var zipdir=require(_0xda5d('0x3'));var jsonpatch=require(_0xda5d('0x4'));var rp=require(_0xda5d('0x5'));var moment=require(_0xda5d('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xda5d('0x7'));var path=require(_0xda5d('0x8'));var sox=require(_0xda5d('0x9'));var csv=require(_0xda5d('0xa'));var ejs=require(_0xda5d('0xb'));var fs=require('fs');var _=require(_0xda5d('0xc'));var squel=require(_0xda5d('0xd'));var crypto=require(_0xda5d('0xe'));var jsforce=require(_0xda5d('0xf'));var deskjs=require(_0xda5d('0x10'));var toCsv=require(_0xda5d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xda5d('0x11'));var authService=require(_0xda5d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xda5d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xda5d('0x14'))(_0xda5d('0x15'));var utils=require(_0xda5d('0x16'));var config=require(_0xda5d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc41c87,_0xaf7c95){_0xaf7c95=_0xaf7c95||0xcc;return function(_0x577b2f){if(_0x577b2f){return _0xc41c87[_0xda5d('0x18')](_0xaf7c95);}return _0xc41c87[_0xda5d('0x19')](_0xaf7c95)[_0xda5d('0x1a')]();};}function respondWithResult(_0x335b2b,_0x37eb18){_0x37eb18=_0x37eb18||0xc8;return function(_0x1f6eb7){if(_0x1f6eb7){return _0x335b2b[_0xda5d('0x19')](_0x37eb18)['json'](_0x1f6eb7);}};}function respondWithFilteredResult(_0xae7589,_0x5becb4){return function(_0x5e4c49){if(_0x5e4c49){var _0x1b2596=_0x5e4c49[_0xda5d('0x1b')],_0x529733=_0x5becb4[_0xda5d('0x1c')],_0x45da94=_0x5becb4['offset']+_0x5becb4[_0xda5d('0x1d')],_0x1c1cf2;if(_0x45da94>=_0x1b2596){_0x45da94=_0x1b2596;_0x1c1cf2=0xc8;}else{_0x1c1cf2=0xce;}_0xae7589[_0xda5d('0x19')](_0x1c1cf2);return _0xae7589['set'](_0xda5d('0x1e'),_0x529733+'-'+_0x45da94+'/'+_0x1b2596)['json'](_0x5e4c49);}return null;};}function patchUpdates(_0x2ab302){return function(_0x4440a9){try{jsonpatch[_0xda5d('0x1f')](_0x4440a9,_0x2ab302,!![]);}catch(_0x3b1008){return BPromise[_0xda5d('0x20')](_0x3b1008);}return _0x4440a9['save']();};}function saveUpdates(_0x322ae4,_0x4f53d1){return function(_0x4a847b){if(_0x4a847b){return _0x4a847b[_0xda5d('0x21')](_0x322ae4)[_0xda5d('0x22')](function(_0x24a169){return _0x24a169;});}return null;};}function removeEntity(_0x2698bc,_0x3511e4){return function(_0x6c710){if(_0x6c710){return _0x6c710[_0xda5d('0x23')]()['then'](function(){var _0x4680bc=_0x6c710['get']({'plain':!![]});var _0x596be5=_0xda5d('0x24');return db[_0xda5d('0x25')][_0xda5d('0x23')]({'where':{'type':_0x596be5,'resourceId':_0x4680bc['id']}})['then'](function(){return _0x6c710;});})[_0xda5d('0x22')](function(){_0x2698bc[_0xda5d('0x19')](0xcc)[_0xda5d('0x1a')]();});}};}function handleEntityNotFound(_0x3c029e,_0x27c343){return function(_0x25a0de){if(!_0x25a0de){_0x3c029e[_0xda5d('0x18')](0x194);}return _0x25a0de;};}function handleError(_0x5722ff,_0x90b41a){_0x90b41a=_0x90b41a||0x1f4;return function(_0x351113){logger[_0xda5d('0x26')](_0x351113['stack']);if(_0x351113[_0xda5d('0x27')]){delete _0x351113['name'];}_0x5722ff[_0xda5d('0x19')](_0x90b41a)['send'](_0x351113);};}exports[_0xda5d('0x28')]=function(_0x46e6bb,_0x328d15){var _0x38a0b1={},_0x3504de={},_0x1b0d84={'count':0x0,'rows':[]};return db[_0xda5d('0x29')][_0xda5d('0x2a')]()[_0xda5d('0x22')](function(_0xfd0512){_0x3504de[_0xda5d('0x2b')]=_[_0xda5d('0x2c')](_0xfd0512);_0x3504de['query']=_[_0xda5d('0x2c')](_0x46e6bb[_0xda5d('0x2d')]);_0x3504de['filters']=_['intersection'](_0x3504de[_0xda5d('0x2b')],_0x3504de['query']);_0x38a0b1[_0xda5d('0x2e')]=_[_0xda5d('0x2f')](_0x3504de['model'],qs[_0xda5d('0x30')](_0x46e6bb['query'][_0xda5d('0x30')]));_0x38a0b1[_0xda5d('0x2e')]=_0x38a0b1[_0xda5d('0x2e')]['length']?_0x38a0b1['attributes']:_0x3504de['model'];if(!_0x46e6bb[_0xda5d('0x2d')][_0xda5d('0x31')](_0xda5d('0x32'))){_0x38a0b1['limit']=qs[_0xda5d('0x1d')](_0x46e6bb[_0xda5d('0x2d')][_0xda5d('0x1d')]);_0x38a0b1[_0xda5d('0x1c')]=qs['offset'](_0x46e6bb[_0xda5d('0x2d')][_0xda5d('0x1c')]);}_0x38a0b1[_0xda5d('0x33')]=qs['sort'](_0x46e6bb[_0xda5d('0x2d')]['sort']);_0x38a0b1[_0xda5d('0x34')]=qs[_0xda5d('0x35')](_['pick'](_0x46e6bb[_0xda5d('0x2d')],_0x3504de['filters']));if(_0x46e6bb[_0xda5d('0x2d')][_0xda5d('0x36')]){_0x38a0b1[_0xda5d('0x34')]=_[_0xda5d('0x37')](_0x38a0b1['where'],{'$or':_[_0xda5d('0x38')](_0x38a0b1[_0xda5d('0x2e')],function(_0x470b7f){var _0x445362={};_0x445362[_0x470b7f]={'$like':'%'+_0x46e6bb[_0xda5d('0x2d')][_0xda5d('0x36')]+'%'};return _0x445362;})});}_0x38a0b1=_[_0xda5d('0x37')]({},_0x38a0b1,_0x46e6bb[_0xda5d('0x39')]);var _0x36c746={'where':_0x38a0b1[_0xda5d('0x34')]};return db['CmCompany'][_0xda5d('0x1b')](_0x36c746)['then'](function(_0x321ea4){_0x1b0d84['count']=_0x321ea4;if(_0x46e6bb[_0xda5d('0x2d')][_0xda5d('0x3a')]){_0x38a0b1['include']=[{'all':!![]}];}return db[_0xda5d('0x29')][_0xda5d('0x3b')](_0x38a0b1);})[_0xda5d('0x22')](function(_0x53a0fd){_0x1b0d84[_0xda5d('0x3c')]=_0x53a0fd;return _0x1b0d84;})['then'](respondWithFilteredResult(_0x328d15,_0x38a0b1))[_0xda5d('0x3d')](handleError(_0x328d15,null));})[_0xda5d('0x3d')](handleError(_0x328d15,null));};exports[_0xda5d('0x3e')]=function(_0x6c7b20,_0x501f1b){var _0x31cad3={'raw':![],'where':{'id':_0x6c7b20[_0xda5d('0x3f')]['id']}},_0x29dbd4={};_0x29dbd4[_0xda5d('0x2b')]=_[_0xda5d('0x2c')](db[_0xda5d('0x29')][_0xda5d('0x40')]);_0x29dbd4[_0xda5d('0x2d')]=_[_0xda5d('0x2c')](_0x6c7b20['query']);_0x29dbd4['filters']=_[_0xda5d('0x2f')](_0x29dbd4[_0xda5d('0x2b')],_0x29dbd4[_0xda5d('0x2d')]);_0x31cad3['attributes']=_[_0xda5d('0x2f')](_0x29dbd4[_0xda5d('0x2b')],qs[_0xda5d('0x30')](_0x6c7b20['query'][_0xda5d('0x30')]));_0x31cad3[_0xda5d('0x2e')]=_0x31cad3[_0xda5d('0x2e')][_0xda5d('0x41')]?_0x31cad3[_0xda5d('0x2e')]:_0x29dbd4['model'];if(_0x6c7b20[_0xda5d('0x2d')][_0xda5d('0x3a')]){_0x31cad3[_0xda5d('0x42')]=[{'all':!![]}];}_0x31cad3=_[_0xda5d('0x37')]({},_0x31cad3,_0x6c7b20[_0xda5d('0x39')]);return db['CmCompany'][_0xda5d('0x43')](_0x31cad3)[_0xda5d('0x22')](handleEntityNotFound(_0x501f1b,null))[_0xda5d('0x22')](respondWithResult(_0x501f1b,null))[_0xda5d('0x3d')](handleError(_0x501f1b,null));};exports[_0xda5d('0x44')]=function(_0x101f7d,_0x5d4bd4){return db['CmCompany'][_0xda5d('0x44')](_0x101f7d[_0xda5d('0x45')],{})[_0xda5d('0x22')](function(_0x22985b){var _0x4221fc=_0x101f7d['user'][_0xda5d('0x46')]({'plain':!![]});if(!_0x4221fc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4221fc[_0xda5d('0x47')]===_0xda5d('0x48')){var _0x30a901=_0x22985b[_0xda5d('0x46')]({'plain':!![]});var _0xfb00b2='Companies';return db[_0xda5d('0x49')][_0xda5d('0x43')]({'where':{'name':_0xfb00b2,'userProfileId':_0x4221fc[_0xda5d('0x4a')]},'raw':!![]})[_0xda5d('0x22')](function(_0x242138){if(_0x242138&&_0x242138[_0xda5d('0x4b')]===0x0){return db[_0xda5d('0x25')]['create']({'name':_0x30a901[_0xda5d('0x27')],'resourceId':_0x30a901['id'],'type':_0x242138[_0xda5d('0x27')],'sectionId':_0x242138['id']},{})[_0xda5d('0x22')](function(){return _0x22985b;});}else{return _0x22985b;}})[_0xda5d('0x3d')](function(_0x52af45){logger[_0xda5d('0x26')](_0xda5d('0x4c'),_0x52af45);throw _0x52af45;});}return _0x22985b;})['then'](respondWithResult(_0x5d4bd4,0xc9))[_0xda5d('0x3d')](handleError(_0x5d4bd4,null));};exports[_0xda5d('0x21')]=function(_0x5b703d,_0x31d398){if(_0x5b703d['body']['id']){delete _0x5b703d['body']['id'];}return db[_0xda5d('0x29')][_0xda5d('0x43')]({'where':{'id':_0x5b703d[_0xda5d('0x3f')]['id']}})[_0xda5d('0x22')](handleEntityNotFound(_0x31d398,null))[_0xda5d('0x22')](saveUpdates(_0x5b703d[_0xda5d('0x45')],null))[_0xda5d('0x22')](respondWithResult(_0x31d398,null))['catch'](handleError(_0x31d398,null));};exports[_0xda5d('0x23')]=function(_0x5e9856,_0x3e7258){return db[_0xda5d('0x29')][_0xda5d('0x43')]({'where':{'id':_0x5e9856['params']['id']}})[_0xda5d('0x22')](handleEntityNotFound(_0x3e7258,null))['then'](removeEntity(_0x3e7258,null))['catch'](handleError(_0x3e7258,null));};exports[_0xda5d('0x2a')]=function(_0x29cc88,_0x1a29b4){return db[_0xda5d('0x29')]['describe']()['then'](respondWithResult(_0x1a29b4,null))['catch'](handleError(_0x1a29b4,null));};exports[_0xda5d('0x4d')]=function(_0xd1ec55,_0x4e5ae3,_0x545186){return db['CmContact'][_0xda5d('0x43')]({'where':{'id':_0xd1ec55['params']['id']}})[_0xda5d('0x22')](handleEntityNotFound(_0x4e5ae3,null))[_0xda5d('0x22')](function(_0xcc8208){if(_0xcc8208){return _0xcc8208[_0xda5d('0x4d')](_0xd1ec55[_0xda5d('0x45')][_0xda5d('0x4e')],_[_0xda5d('0x4f')](_0xd1ec55['body'],[_0xda5d('0x4e'),'id'])||{});}})[_0xda5d('0x22')](respondWithResult(_0x4e5ae3,null))['catch'](handleError(_0x4e5ae3,null));};exports[_0xda5d('0x50')]=function(_0xb2a870,_0x111b76,_0x4efa1e){var _0x158da4={};var _0x326a84={};var _0x2900db;var _0x9ff825;return db[_0xda5d('0x29')][_0xda5d('0x51')]({'where':{'id':_0xb2a870['params']['id']}})[_0xda5d('0x22')](handleEntityNotFound(_0x111b76,null))['then'](function(_0x465f69){if(_0x465f69){_0x2900db=_0x465f69;_0x326a84[_0xda5d('0x2b')]=_[_0xda5d('0x2c')](db['CmContact'][_0xda5d('0x40')]);_0x326a84['query']=_[_0xda5d('0x2c')](_0xb2a870[_0xda5d('0x2d')]);_0x326a84[_0xda5d('0x35')]=_['intersection'](_0x326a84[_0xda5d('0x2b')],_0x326a84[_0xda5d('0x2d')]);_0x158da4[_0xda5d('0x2e')]=_[_0xda5d('0x2f')](_0x326a84[_0xda5d('0x2b')],qs['fields'](_0xb2a870[_0xda5d('0x2d')][_0xda5d('0x30')]));_0x158da4[_0xda5d('0x2e')]=_0x158da4[_0xda5d('0x2e')][_0xda5d('0x41')]?_0x158da4['attributes']:_0x326a84[_0xda5d('0x2b')];_0x158da4[_0xda5d('0x33')]=qs[_0xda5d('0x52')](_0xb2a870['query'][_0xda5d('0x52')]);_0x158da4['where']=qs[_0xda5d('0x35')](_[_0xda5d('0x53')](_0xb2a870['query'],_0x326a84[_0xda5d('0x35')]));if(_0xb2a870[_0xda5d('0x2d')][_0xda5d('0x36')]){_0x158da4[_0xda5d('0x34')]=_[_0xda5d('0x37')](_0x158da4[_0xda5d('0x34')],{'$or':_[_0xda5d('0x38')](_0x158da4[_0xda5d('0x2e')],function(_0x264970){var _0x234e07={};_0x234e07[_0x264970]={'$like':'%'+_0xb2a870[_0xda5d('0x2d')][_0xda5d('0x36')]+'%'};return _0x234e07;})});}_0x158da4=_[_0xda5d('0x37')]({},_0x158da4,_0xb2a870[_0xda5d('0x39')]);return _0x2900db[_0xda5d('0x50')](_0x158da4);}})['then'](function(_0x30cf64){if(_0x30cf64){_0x9ff825=_0x30cf64[_0xda5d('0x41')];if(!_0xb2a870['query'][_0xda5d('0x31')](_0xda5d('0x32'))){_0x158da4[_0xda5d('0x1d')]=qs[_0xda5d('0x1d')](_0xb2a870[_0xda5d('0x2d')][_0xda5d('0x1d')]);_0x158da4['offset']=qs[_0xda5d('0x1c')](_0xb2a870[_0xda5d('0x2d')][_0xda5d('0x1c')]);}return _0x2900db[_0xda5d('0x50')](_0x158da4);}})['then'](function(_0x5f140e){if(_0x5f140e){return _0x5f140e?{'count':_0x9ff825,'rows':_0x5f140e}:null;}})[_0xda5d('0x22')](respondWithResult(_0x111b76,null))[_0xda5d('0x3d')](handleError(_0x111b76,null));}; \ No newline at end of file +var _0x6cf4=['ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','apply','reject','save','update','then','UserProfileResource','destroy','end','sendStatus','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','getContacts','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv'];(function(_0x36b88c,_0x3133a2){var _0x30ad73=function(_0x2b88b1){while(--_0x2b88b1){_0x36b88c['push'](_0x36b88c['shift']());}};_0x30ad73(++_0x3133a2);}(_0x6cf4,0x100));var _0x46cf=function(_0x350182,_0x2a9feb){_0x350182=_0x350182-0x0;var _0x4a0892=_0x6cf4[_0x350182];return _0x4a0892;};'use strict';var pdf=require(_0x46cf('0x0'));var emlformat=require(_0x46cf('0x1'));var rimraf=require(_0x46cf('0x2'));var zipdir=require(_0x46cf('0x3'));var jsonpatch=require(_0x46cf('0x4'));var rp=require(_0x46cf('0x5'));var moment=require('moment');var BPromise=require(_0x46cf('0x6'));var Mustache=require('mustache');var util=require(_0x46cf('0x7'));var path=require(_0x46cf('0x8'));var sox=require(_0x46cf('0x9'));var csv=require(_0x46cf('0xa'));var ejs=require(_0x46cf('0xb'));var fs=require('fs');var _=require(_0x46cf('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x46cf('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x46cf('0xa'));var querystring=require(_0x46cf('0xe'));var Papa=require(_0x46cf('0xf'));var Redis=require(_0x46cf('0x10'));var authService=require(_0x46cf('0x11'));var qs=require(_0x46cf('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x46cf('0x13'));var logger=require(_0x46cf('0x14'))(_0x46cf('0x15'));var utils=require(_0x46cf('0x16'));var config=require(_0x46cf('0x17'));var db=require(_0x46cf('0x18'))['db'];function respondWithStatusCode(_0x50e99f,_0x24618b){_0x24618b=_0x24618b||0xcc;return function(_0x3e0afb){if(_0x3e0afb){return _0x50e99f['sendStatus'](_0x24618b);}return _0x50e99f[_0x46cf('0x19')](_0x24618b)['end']();};}function respondWithResult(_0x3ecd72,_0xd36418){_0xd36418=_0xd36418||0xc8;return function(_0x486eda){if(_0x486eda){return _0x3ecd72[_0x46cf('0x19')](_0xd36418)[_0x46cf('0x1a')](_0x486eda);}};}function respondWithFilteredResult(_0x2b28d8,_0x4e3777){return function(_0x37f075){if(_0x37f075){var _0x93231c=_0x37f075['count'],_0x563ec2=_0x4e3777['offset'],_0x1131ec=_0x4e3777[_0x46cf('0x1b')]+_0x4e3777[_0x46cf('0x1c')],_0x30b132;if(_0x1131ec>=_0x93231c){_0x1131ec=_0x93231c;_0x30b132=0xc8;}else{_0x30b132=0xce;}_0x2b28d8[_0x46cf('0x19')](_0x30b132);return _0x2b28d8['set']('Content-Range',_0x563ec2+'-'+_0x1131ec+'/'+_0x93231c)[_0x46cf('0x1a')](_0x37f075);}return null;};}function patchUpdates(_0x4b3fd9){return function(_0x387b36){try{jsonpatch[_0x46cf('0x1d')](_0x387b36,_0x4b3fd9,!![]);}catch(_0x513033){return BPromise[_0x46cf('0x1e')](_0x513033);}return _0x387b36[_0x46cf('0x1f')]();};}function saveUpdates(_0x3a1453,_0x424eed){return function(_0x95b2d1){if(_0x95b2d1){return _0x95b2d1[_0x46cf('0x20')](_0x3a1453)['then'](function(_0x3142c4){return _0x3142c4;});}return null;};}function removeEntity(_0x106aa3,_0x9fa038){return function(_0x28b8ed){if(_0x28b8ed){return _0x28b8ed['destroy']()[_0x46cf('0x21')](function(){var _0x4b1946=_0x28b8ed['get']({'plain':!![]});var _0x2786ab='Companies';return db[_0x46cf('0x22')][_0x46cf('0x23')]({'where':{'type':_0x2786ab,'resourceId':_0x4b1946['id']}})[_0x46cf('0x21')](function(){return _0x28b8ed;});})[_0x46cf('0x21')](function(){_0x106aa3[_0x46cf('0x19')](0xcc)[_0x46cf('0x24')]();});}};}function handleEntityNotFound(_0x27cd78,_0x25fda2){return function(_0x156729){if(!_0x156729){_0x27cd78[_0x46cf('0x25')](0x194);}return _0x156729;};}function handleError(_0x5c5fde,_0x40344d){_0x40344d=_0x40344d||0x1f4;return function(_0x3d71c7){logger[_0x46cf('0x26')](_0x3d71c7[_0x46cf('0x27')]);if(_0x3d71c7[_0x46cf('0x28')]){delete _0x3d71c7[_0x46cf('0x28')];}_0x5c5fde[_0x46cf('0x19')](_0x40344d)[_0x46cf('0x29')](_0x3d71c7);};}exports[_0x46cf('0x2a')]=function(_0x48c729,_0x5007a0){var _0x384f88={},_0x243ffe={},_0x42b7d7={'count':0x0,'rows':[]};return db[_0x46cf('0x2b')][_0x46cf('0x2c')]()['then'](function(_0x37f7e5){_0x243ffe[_0x46cf('0x2d')]=_[_0x46cf('0x2e')](_0x37f7e5);_0x243ffe[_0x46cf('0x2f')]=_[_0x46cf('0x2e')](_0x48c729[_0x46cf('0x2f')]);_0x243ffe[_0x46cf('0x30')]=_['intersection'](_0x243ffe[_0x46cf('0x2d')],_0x243ffe['query']);_0x384f88[_0x46cf('0x31')]=_[_0x46cf('0x32')](_0x243ffe[_0x46cf('0x2d')],qs['fields'](_0x48c729[_0x46cf('0x2f')][_0x46cf('0x33')]));_0x384f88[_0x46cf('0x31')]=_0x384f88[_0x46cf('0x31')][_0x46cf('0x34')]?_0x384f88[_0x46cf('0x31')]:_0x243ffe[_0x46cf('0x2d')];if(!_0x48c729['query'][_0x46cf('0x35')](_0x46cf('0x36'))){_0x384f88[_0x46cf('0x1c')]=qs['limit'](_0x48c729['query'][_0x46cf('0x1c')]);_0x384f88['offset']=qs[_0x46cf('0x1b')](_0x48c729[_0x46cf('0x2f')]['offset']);}_0x384f88[_0x46cf('0x37')]=qs[_0x46cf('0x38')](_0x48c729[_0x46cf('0x2f')][_0x46cf('0x38')]);_0x384f88[_0x46cf('0x39')]=qs[_0x46cf('0x30')](_[_0x46cf('0x3a')](_0x48c729[_0x46cf('0x2f')],_0x243ffe[_0x46cf('0x30')]));if(_0x48c729['query']['filter']){_0x384f88[_0x46cf('0x39')]=_[_0x46cf('0x3b')](_0x384f88[_0x46cf('0x39')],{'$or':_[_0x46cf('0x3c')](_0x384f88['attributes'],function(_0x4514c5){var _0x2144d2={};_0x2144d2[_0x4514c5]={'$like':'%'+_0x48c729[_0x46cf('0x2f')][_0x46cf('0x3d')]+'%'};return _0x2144d2;})});}_0x384f88=_[_0x46cf('0x3b')]({},_0x384f88,_0x48c729[_0x46cf('0x3e')]);var _0x51f113={'where':_0x384f88['where']};return db['CmCompany'][_0x46cf('0x3f')](_0x51f113)['then'](function(_0x89636e){_0x42b7d7[_0x46cf('0x3f')]=_0x89636e;if(_0x48c729[_0x46cf('0x2f')][_0x46cf('0x40')]){_0x384f88[_0x46cf('0x41')]=[{'all':!![]}];}return db['CmCompany'][_0x46cf('0x42')](_0x384f88);})[_0x46cf('0x21')](function(_0x1c5e4a){_0x42b7d7[_0x46cf('0x43')]=_0x1c5e4a;return _0x42b7d7;})[_0x46cf('0x21')](respondWithFilteredResult(_0x5007a0,_0x384f88))['catch'](handleError(_0x5007a0,null));})[_0x46cf('0x44')](handleError(_0x5007a0,null));};exports[_0x46cf('0x45')]=function(_0x135c56,_0x270df8){var _0x42407a={'raw':![],'where':{'id':_0x135c56[_0x46cf('0x46')]['id']}},_0x510abb={};_0x510abb['model']=_[_0x46cf('0x2e')](db[_0x46cf('0x2b')][_0x46cf('0x47')]);_0x510abb[_0x46cf('0x2f')]=_['keys'](_0x135c56[_0x46cf('0x2f')]);_0x510abb[_0x46cf('0x30')]=_[_0x46cf('0x32')](_0x510abb[_0x46cf('0x2d')],_0x510abb[_0x46cf('0x2f')]);_0x42407a[_0x46cf('0x31')]=_['intersection'](_0x510abb[_0x46cf('0x2d')],qs[_0x46cf('0x33')](_0x135c56[_0x46cf('0x2f')][_0x46cf('0x33')]));_0x42407a['attributes']=_0x42407a[_0x46cf('0x31')][_0x46cf('0x34')]?_0x42407a['attributes']:_0x510abb[_0x46cf('0x2d')];if(_0x135c56['query'][_0x46cf('0x40')]){_0x42407a[_0x46cf('0x41')]=[{'all':!![]}];}_0x42407a=_[_0x46cf('0x3b')]({},_0x42407a,_0x135c56[_0x46cf('0x3e')]);return db[_0x46cf('0x2b')][_0x46cf('0x48')](_0x42407a)[_0x46cf('0x21')](handleEntityNotFound(_0x270df8,null))[_0x46cf('0x21')](respondWithResult(_0x270df8,null))[_0x46cf('0x44')](handleError(_0x270df8,null));};exports[_0x46cf('0x49')]=function(_0x1aae76,_0x1a22fd){return db[_0x46cf('0x2b')][_0x46cf('0x49')](_0x1aae76[_0x46cf('0x4a')],{})['then'](function(_0x4fdf91){var _0x53265f=_0x1aae76[_0x46cf('0x4b')][_0x46cf('0x4c')]({'plain':!![]});if(!_0x53265f)throw new Error(_0x46cf('0x4d'));if(_0x53265f[_0x46cf('0x4e')]===_0x46cf('0x4b')){var _0x3a70b9=_0x4fdf91['get']({'plain':!![]});var _0xe66a15=_0x46cf('0x4f');return db[_0x46cf('0x50')][_0x46cf('0x48')]({'where':{'name':_0xe66a15,'userProfileId':_0x53265f[_0x46cf('0x51')]},'raw':!![]})[_0x46cf('0x21')](function(_0x3300fe){if(_0x3300fe&&_0x3300fe[_0x46cf('0x52')]===0x0){return db[_0x46cf('0x22')][_0x46cf('0x49')]({'name':_0x3a70b9[_0x46cf('0x28')],'resourceId':_0x3a70b9['id'],'type':_0x3300fe[_0x46cf('0x28')],'sectionId':_0x3300fe['id']},{})[_0x46cf('0x21')](function(){return _0x4fdf91;});}else{return _0x4fdf91;}})[_0x46cf('0x44')](function(_0x512705){logger[_0x46cf('0x26')](_0x46cf('0x53'),_0x512705);throw _0x512705;});}return _0x4fdf91;})[_0x46cf('0x21')](respondWithResult(_0x1a22fd,0xc9))[_0x46cf('0x44')](handleError(_0x1a22fd,null));};exports['update']=function(_0x5eb81f,_0x15f7ec){if(_0x5eb81f['body']['id']){delete _0x5eb81f[_0x46cf('0x4a')]['id'];}return db['CmCompany'][_0x46cf('0x48')]({'where':{'id':_0x5eb81f['params']['id']}})['then'](handleEntityNotFound(_0x15f7ec,null))[_0x46cf('0x21')](saveUpdates(_0x5eb81f[_0x46cf('0x4a')],null))[_0x46cf('0x21')](respondWithResult(_0x15f7ec,null))[_0x46cf('0x44')](handleError(_0x15f7ec,null));};exports['destroy']=function(_0x4328f4,_0x5d33f1){return db[_0x46cf('0x2b')][_0x46cf('0x48')]({'where':{'id':_0x4328f4[_0x46cf('0x46')]['id']}})[_0x46cf('0x21')](handleEntityNotFound(_0x5d33f1,null))[_0x46cf('0x21')](removeEntity(_0x5d33f1,null))[_0x46cf('0x44')](handleError(_0x5d33f1,null));};exports[_0x46cf('0x2c')]=function(_0x5cce9c,_0x1fe3ae){return db[_0x46cf('0x2b')][_0x46cf('0x2c')]()[_0x46cf('0x21')](respondWithResult(_0x1fe3ae,null))[_0x46cf('0x44')](handleError(_0x1fe3ae,null));};exports[_0x46cf('0x54')]=function(_0x311814,_0x14c73f,_0x5a609a){return db[_0x46cf('0x55')][_0x46cf('0x48')]({'where':{'id':_0x311814['params']['id']}})[_0x46cf('0x21')](handleEntityNotFound(_0x14c73f,null))['then'](function(_0x217f45){if(_0x217f45){return _0x217f45[_0x46cf('0x54')](_0x311814['body'][_0x46cf('0x56')],_['omit'](_0x311814[_0x46cf('0x4a')],['ids','id'])||{});}})[_0x46cf('0x21')](respondWithResult(_0x14c73f,null))['catch'](handleError(_0x14c73f,null));};exports[_0x46cf('0x57')]=function(_0x14a232,_0x58fc5c,_0x480d98){var _0x8c9d0e={};var _0x11ebd3={};var _0xa69de6;var _0x3d71ec;return db['CmCompany'][_0x46cf('0x58')]({'where':{'id':_0x14a232['params']['id']}})['then'](handleEntityNotFound(_0x58fc5c,null))['then'](function(_0x5c7c3c){if(_0x5c7c3c){_0xa69de6=_0x5c7c3c;_0x11ebd3[_0x46cf('0x2d')]=_[_0x46cf('0x2e')](db[_0x46cf('0x55')][_0x46cf('0x47')]);_0x11ebd3[_0x46cf('0x2f')]=_[_0x46cf('0x2e')](_0x14a232['query']);_0x11ebd3[_0x46cf('0x30')]=_['intersection'](_0x11ebd3[_0x46cf('0x2d')],_0x11ebd3['query']);_0x8c9d0e['attributes']=_[_0x46cf('0x32')](_0x11ebd3['model'],qs[_0x46cf('0x33')](_0x14a232[_0x46cf('0x2f')]['fields']));_0x8c9d0e['attributes']=_0x8c9d0e[_0x46cf('0x31')][_0x46cf('0x34')]?_0x8c9d0e[_0x46cf('0x31')]:_0x11ebd3[_0x46cf('0x2d')];_0x8c9d0e['order']=qs['sort'](_0x14a232[_0x46cf('0x2f')]['sort']);_0x8c9d0e[_0x46cf('0x39')]=qs[_0x46cf('0x30')](_[_0x46cf('0x3a')](_0x14a232[_0x46cf('0x2f')],_0x11ebd3[_0x46cf('0x30')]));if(_0x14a232[_0x46cf('0x2f')][_0x46cf('0x3d')]){_0x8c9d0e[_0x46cf('0x39')]=_['merge'](_0x8c9d0e[_0x46cf('0x39')],{'$or':_['map'](_0x8c9d0e[_0x46cf('0x31')],function(_0x816ed6){var _0x2dbb78={};_0x2dbb78[_0x816ed6]={'$like':'%'+_0x14a232[_0x46cf('0x2f')][_0x46cf('0x3d')]+'%'};return _0x2dbb78;})});}_0x8c9d0e=_[_0x46cf('0x3b')]({},_0x8c9d0e,_0x14a232[_0x46cf('0x3e')]);return _0xa69de6['getContacts'](_0x8c9d0e);}})[_0x46cf('0x21')](function(_0x36257c){if(_0x36257c){_0x3d71ec=_0x36257c[_0x46cf('0x34')];if(!_0x14a232['query'][_0x46cf('0x35')](_0x46cf('0x36'))){_0x8c9d0e[_0x46cf('0x1c')]=qs['limit'](_0x14a232[_0x46cf('0x2f')][_0x46cf('0x1c')]);_0x8c9d0e['offset']=qs[_0x46cf('0x1b')](_0x14a232[_0x46cf('0x2f')]['offset']);}return _0xa69de6[_0x46cf('0x57')](_0x8c9d0e);}})[_0x46cf('0x21')](function(_0x53cb84){if(_0x53cb84){return _0x53cb84?{'count':_0x3d71ec,'rows':_0x53cb84}:null;}})[_0x46cf('0x21')](respondWithResult(_0x58fc5c,null))['catch'](handleError(_0x58fc5c,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index c516e9e..22c4849 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 _0xb7a8=['request-promise','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','util','../../config/logger','moment','bluebird'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xb7a8,0xec));var _0x8b7a=function(_0x813845,_0x763acb){_0x813845=_0x813845-0x0;var _0x2eca19=_0xb7a8[_0x813845];return _0x2eca19;};'use strict';var _=require('lodash');var util=require(_0x8b7a('0x0'));var logger=require(_0x8b7a('0x1'))('api');var moment=require(_0x8b7a('0x2'));var BPromise=require(_0x8b7a('0x3'));var rp=require(_0x8b7a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b7a('0x5'));var config=require(_0x8b7a('0x6'));var attributes=require(_0x8b7a('0x7'));module[_0x8b7a('0x8')]=function(_0x1d61f3,_0x42e4c1){return _0x1d61f3[_0x8b7a('0x9')](_0x8b7a('0xa'),attributes,{'tableName':_0x8b7a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb2a=['bluebird','request-promise','rimraf','./cmCompany.attributes','exports','define','cm_companies','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb2a,0x16f));var _0xadb2=function(_0x263d86,_0x344378){_0x263d86=_0x263d86-0x0;var _0x42d6a7=_0xdb2a[_0x263d86];return _0x42d6a7;};'use strict';var _=require(_0xadb2('0x0'));var util=require(_0xadb2('0x1'));var logger=require(_0xadb2('0x2'))('api');var moment=require('moment');var BPromise=require(_0xadb2('0x3'));var rp=require(_0xadb2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xadb2('0x5'));var config=require('../../config/environment');var attributes=require(_0xadb2('0x6'));module[_0xadb2('0x7')]=function(_0x1f5c7e,_0x297e69){return _0x1f5c7e[_0xadb2('0x8')]('CmCompany',attributes,{'tableName':_0xadb2('0x9'),'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 9462a3f..bd891fd 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 _0x0763=['http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x0763,0x172));var _0x3076=function(_0x152fe3,_0x12b0c8){_0x152fe3=_0x152fe3-0x0;var _0xc5bb39=_0x0763[_0x152fe3];return _0xc5bb39;};'use strict';var _=require(_0x3076('0x0'));var util=require(_0x3076('0x1'));var moment=require(_0x3076('0x2'));var BPromise=require(_0x3076('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3076('0x4'));var db=require(_0x3076('0x5'))['db'];var utils=require(_0x3076('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3076('0x7'));var jayson=require(_0x3076('0x8'));var client=jayson[_0x3076('0x9')][_0x3076('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b8489,_0x4b284e,_0x236dd3){return new BPromise(function(_0x5f0b8b,_0x20c631){return client[_0x3076('0xb')](_0x2b8489,_0x236dd3)['then'](function(_0x4aa4a3){logger[_0x3076('0xc')](_0x3076('0xd'),_0x4b284e,_0x3076('0xe'));logger['debug'](_0x3076('0xf'),_0x4b284e,'request\x20sent',JSON['stringify'](_0x4aa4a3));if(_0x4aa4a3[_0x3076('0x10')]){if(_0x4aa4a3[_0x3076('0x10')][_0x3076('0x11')]===0x1f4){logger['error'](_0x3076('0xd'),_0x4b284e,_0x4aa4a3[_0x3076('0x10')][_0x3076('0x12')]);return _0x20c631(_0x4aa4a3[_0x3076('0x10')][_0x3076('0x12')]);}logger['error'](_0x3076('0xd'),_0x4b284e,_0x4aa4a3[_0x3076('0x10')]['message']);return _0x5f0b8b(_0x4aa4a3[_0x3076('0x10')][_0x3076('0x12')]);}else{logger[_0x3076('0xc')](_0x3076('0xd'),_0x4b284e,_0x3076('0xe'));_0x5f0b8b(_0x4aa4a3[_0x3076('0x13')]['message']);}})['catch'](function(_0x58f48f){logger[_0x3076('0x10')](_0x3076('0xd'),_0x4b284e,_0x58f48f);_0x20c631(_0x58f48f);});});} \ No newline at end of file +var _0xa0e8=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','CmCompany,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x61b3ab,_0x1fc298){var _0x57097f=function(_0x25970b){while(--_0x25970b){_0x61b3ab['push'](_0x61b3ab['shift']());}};_0x57097f(++_0x1fc298);}(_0xa0e8,0x1ee));var _0x8a0e=function(_0x4017f2,_0x4c46d2){_0x4017f2=_0x4017f2-0x0;var _0x30df53=_0xa0e8[_0x4017f2];return _0x30df53;};'use strict';var _=require(_0x8a0e('0x0'));var util=require(_0x8a0e('0x1'));var moment=require('moment');var BPromise=require(_0x8a0e('0x2'));var rs=require(_0x8a0e('0x3'));var fs=require('fs');var Redis=require(_0x8a0e('0x4'));var db=require(_0x8a0e('0x5'))['db'];var utils=require(_0x8a0e('0x6'));var logger=require(_0x8a0e('0x7'))('rpc');var config=require(_0x8a0e('0x8'));var jayson=require(_0x8a0e('0x9'));var client=jayson[_0x8a0e('0xa')][_0x8a0e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b41da,_0x34d2e0,_0x5386bd){return new BPromise(function(_0xa5d0f2,_0x31f416){return client['request'](_0x3b41da,_0x5386bd)[_0x8a0e('0xc')](function(_0x441c90){logger['info'](_0x8a0e('0xd'),_0x34d2e0,_0x8a0e('0xe'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x34d2e0,_0x8a0e('0xe'),JSON['stringify'](_0x441c90));if(_0x441c90[_0x8a0e('0xf')]){if(_0x441c90[_0x8a0e('0xf')][_0x8a0e('0x10')]===0x1f4){logger['error'](_0x8a0e('0xd'),_0x34d2e0,_0x441c90[_0x8a0e('0xf')][_0x8a0e('0x11')]);return _0x31f416(_0x441c90['error'][_0x8a0e('0x11')]);}logger[_0x8a0e('0xf')](_0x8a0e('0xd'),_0x34d2e0,_0x441c90[_0x8a0e('0xf')][_0x8a0e('0x11')]);return _0xa5d0f2(_0x441c90[_0x8a0e('0xf')]['message']);}else{logger[_0x8a0e('0x12')](_0x8a0e('0xd'),_0x34d2e0,'request\x20sent');_0xa5d0f2(_0x441c90['result'][_0x8a0e('0x11')]);}})[_0x8a0e('0x13')](function(_0x47a00f){logger['error'](_0x8a0e('0xd'),_0x34d2e0,_0x47a00f);_0x31f416(_0x47a00f);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 5bf4cee..d99526b 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 _0xc1c6=['multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','/:id','show','getContacts','post','/:id/contacts','put','delete','destroy','exports'];(function(_0x20303d,_0x490178){var _0x598cbd=function(_0x1fa142){while(--_0x1fa142){_0x20303d['push'](_0x20303d['shift']());}};_0x598cbd(++_0x490178);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x47c96b,_0x33d301){_0x47c96b=_0x47c96b-0x0;var _0x4ec0d8=_0xc1c6[_0x47c96b];return _0x4ec0d8;};'use strict';var multer=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var path=require(_0x6c1c('0x2'));var timeout=require('connect-timeout');var express=require(_0x6c1c('0x3'));var router=express['Router']();var auth=require(_0x6c1c('0x4'));var interaction=require(_0x6c1c('0x5'));var config=require(_0x6c1c('0x6'));var controller=require('./cmCompany.controller');router['get']('/',auth[_0x6c1c('0x7')](),controller['index']);router[_0x6c1c('0x8')]('/describe',auth[_0x6c1c('0x7')](),controller[_0x6c1c('0x9')]);router[_0x6c1c('0x8')](_0x6c1c('0xa'),auth['isAuthenticated'](),controller[_0x6c1c('0xb')]);router[_0x6c1c('0x8')]('/:id/contacts',auth[_0x6c1c('0x7')](),controller[_0x6c1c('0xc')]);router[_0x6c1c('0xd')]('/',auth[_0x6c1c('0x7')](),controller['create']);router[_0x6c1c('0xd')](_0x6c1c('0xe'),auth[_0x6c1c('0x7')](),controller['addContacts']);router[_0x6c1c('0xf')](_0x6c1c('0xa'),auth[_0x6c1c('0x7')](),controller['update']);router[_0x6c1c('0x10')]('/:id',auth[_0x6c1c('0x7')](),controller[_0x6c1c('0x11')]);module[_0x6c1c('0x12')]=router; \ No newline at end of file +var _0x4991=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/contacts','post','update','delete','exports'];(function(_0x1d5e9f,_0x154f02){var _0x5664d7=function(_0x3d37fe){while(--_0x3d37fe){_0x1d5e9f['push'](_0x1d5e9f['shift']());}};_0x5664d7(++_0x154f02);}(_0x4991,0xf7));var _0x1499=function(_0x28a1f8,_0x4a5f5e){_0x28a1f8=_0x28a1f8-0x0;var _0x2a504b=_0x4991[_0x28a1f8];return _0x2a504b;};'use strict';var multer=require(_0x1499('0x0'));var util=require('util');var path=require(_0x1499('0x1'));var timeout=require('connect-timeout');var express=require(_0x1499('0x2'));var router=express[_0x1499('0x3')]();var auth=require(_0x1499('0x4'));var interaction=require(_0x1499('0x5'));var config=require(_0x1499('0x6'));var controller=require(_0x1499('0x7'));router[_0x1499('0x8')]('/',auth[_0x1499('0x9')](),controller['index']);router[_0x1499('0x8')](_0x1499('0xa'),auth[_0x1499('0x9')](),controller[_0x1499('0xb')]);router[_0x1499('0x8')](_0x1499('0xc'),auth[_0x1499('0x9')](),controller[_0x1499('0xd')]);router['get'](_0x1499('0xe'),auth[_0x1499('0x9')](),controller['getContacts']);router[_0x1499('0xf')]('/',auth[_0x1499('0x9')](),controller['create']);router[_0x1499('0xf')](_0x1499('0xe'),auth['isAuthenticated'](),controller['addContacts']);router['put'](_0x1499('0xc'),auth[_0x1499('0x9')](),controller[_0x1499('0x10')]);router[_0x1499('0x11')](_0x1499('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x1499('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 04b48d8..660824b 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 _0x98da=['INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING','TEXT'];(function(_0x396289,_0x2e3e55){var _0x1a30e1=function(_0x15f387){while(--_0x15f387){_0x396289['push'](_0x396289['shift']());}};_0x1a30e1(++_0x2e3e55);}(_0x98da,0xe5));var _0xa98d=function(_0x38a801,_0x29d0a9){_0x38a801=_0x38a801-0x0;var _0x5d2991=_0x98da[_0x38a801];return _0x5d2991;};'use strict';var _=require(_0xa98d('0x0'));var Sequelize=require(_0xa98d('0x1'));module[_0xa98d('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xa98d('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xa98d('0x3')]},'dateOfBirth':{'type':Sequelize[_0xa98d('0x3')]},'description':{'type':Sequelize[_0xa98d('0x4')]},'phone':{'type':Sequelize[_0xa98d('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xa98d('0x3')]},'url':{'type':Sequelize[_0xa98d('0x3')]},'facebook':{'type':Sequelize[_0xa98d('0x3')]},'fb_data':{'type':Sequelize[_0xa98d('0x3')]},'twitter':{'type':Sequelize[_0xa98d('0x3')]},'skype':{'type':Sequelize[_0xa98d('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xa98d('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xa98d('0x3')]},'telegram':{'type':Sequelize[_0xa98d('0x3')]},'UserId':{'type':Sequelize[_0xa98d('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xa98d('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa98d('0x7')],'defaultValue':Sequelize[_0xa98d('0x8')]}}; \ No newline at end of file +var _0xc959=['sequelize','STRING','INTEGER','UNSIGNED','DATE','NOW','lodash'];(function(_0x5b582b,_0x231536){var _0x3e9554=function(_0x3def9f){while(--_0x3def9f){_0x5b582b['push'](_0x5b582b['shift']());}};_0x3e9554(++_0x231536);}(_0xc959,0x1c6));var _0x9c95=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc959[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x9c95('0x0'));var Sequelize=require(_0x9c95('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x9c95('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x9c95('0x2')]},'street':{'type':Sequelize[_0x9c95('0x2')]},'postalCode':{'type':Sequelize[_0x9c95('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x9c95('0x2')]},'dateOfBirth':{'type':Sequelize[_0x9c95('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x9c95('0x2')]},'mobile':{'type':Sequelize[_0x9c95('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x9c95('0x2')]},'facebook':{'type':Sequelize[_0x9c95('0x2')]},'fb_data':{'type':Sequelize[_0x9c95('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x9c95('0x2')]},'viber':{'type':Sequelize[_0x9c95('0x2')]},'line':{'type':Sequelize[_0x9c95('0x2')]},'wechat':{'type':Sequelize[_0x9c95('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x9c95('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x9c95('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x9c95('0x5')],'defaultValue':Sequelize[_0x9c95('0x6')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 4c7e671..b8fcd46 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 _0x4ad0=['fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','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','redis','defaults','socket.io-emitter','status','end','json','offset','limit','set','Content-Range','save','update','then','sendStatus','error','stack','index','CmContact','keys','length','push','CmCustomField','cf_','all','fieldType','type','query','filters','intersection','model','attributes','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','left_join','cm_contact_has_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','find','Tag','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','DATE','buildExpression','value','start','filter','isNil','Contact','isEmpty','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','isArray','tag','replace','split','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?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','t.id\x20IN\x20?','some','conditions','user','getLists','sequelize','toString','count','keyBy','fields','c.firstName','c.phone','c.mobile','c.email','c.ListId','c.deletedAt','TagIds','Tags','catch','destroy','describe','startsWith','columnName','findAll','alias','custom','values','merge','body','get','mergeWith','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','SmsQueueReport','create','bulkCreate','each','duplicates','$or','ListId','findOrCreate','spread','show','params','name','$and','format','cf_%d','table','cm_contacts','setFields','id\x20=\x20?','toParam','phone','findOne','rawAttributes','getTags','setTags','ids','getHoppers','ContactId','options','includeAll','include','getHopperHistories','rows','getHopperFinals','getJscriptySessions','JscriptySessionReport','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','send','upload','path','parse','meta','agent','No\x20ListId\x20specified','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','error\x20child\x20process','html-pdf','eml-format','rimraf','zip-dir'];(function(_0xe72669,_0x4fe3a1){var _0x419835=function(_0x158ada){while(--_0x158ada){_0xe72669['push'](_0xe72669['shift']());}};_0x419835(++_0x4fe3a1);}(_0x4ad0,0xe7));var _0x04ad=function(_0x338316,_0x5d766c){_0x338316=_0x338316-0x0;var _0x26def0=_0x4ad0[_0x338316];return _0x26def0;};'use strict';var pdf=require(_0x04ad('0x0'));var emlformat=require(_0x04ad('0x1'));var rimraf=require(_0x04ad('0x2'));var zipdir=require(_0x04ad('0x3'));var jsonpatch=require(_0x04ad('0x4'));var rp=require('request-promise');var moment=require(_0x04ad('0x5'));var BPromise=require(_0x04ad('0x6'));var Mustache=require(_0x04ad('0x7'));var util=require(_0x04ad('0x8'));var path=require('path');var sox=require(_0x04ad('0x9'));var csv=require(_0x04ad('0xa'));var ejs=require(_0x04ad('0xb'));var fs=require('fs');var _=require(_0x04ad('0xc'));var squel=require(_0x04ad('0xd'));var crypto=require(_0x04ad('0xe'));var jsforce=require(_0x04ad('0xf'));var deskjs=require(_0x04ad('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x04ad('0x11'));var Redis=require(_0x04ad('0x12'));var authService=require(_0x04ad('0x13'));var qs=require(_0x04ad('0x14'));var as=require(_0x04ad('0x15'));var hardwareService=require(_0x04ad('0x16'));var logger=require(_0x04ad('0x17'))(_0x04ad('0x18'));var utils=require(_0x04ad('0x19'));var config=require(_0x04ad('0x1a'));var db=require('../../mysqldb')['db'];config[_0x04ad('0x1b')]=_[_0x04ad('0x1c')](config[_0x04ad('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x04ad('0x1d'))(new Redis(config[_0x04ad('0x1b')]));require('./cmContact.socket')['register'](socket);function respondWithStatusCode(_0x368a9c,_0x24231d){_0x24231d=_0x24231d||0xcc;return function(_0x22c445){if(_0x22c445){return _0x368a9c['sendStatus'](_0x24231d);}return _0x368a9c[_0x04ad('0x1e')](_0x24231d)[_0x04ad('0x1f')]();};}function respondWithResult(_0x323836,_0x36ded5){_0x36ded5=_0x36ded5||0xc8;return function(_0x596309){if(_0x596309){return _0x323836[_0x04ad('0x1e')](_0x36ded5)[_0x04ad('0x20')](_0x596309);}};}function respondWithFilteredResult(_0x58222e,_0x2a5d02){return function(_0x345d07){if(_0x345d07){var _0x131efd=_0x345d07['count'],_0x222646=_0x2a5d02[_0x04ad('0x21')],_0x22de49=_0x2a5d02[_0x04ad('0x21')]+_0x2a5d02[_0x04ad('0x22')],_0x21da0f;if(_0x22de49>=_0x131efd){_0x22de49=_0x131efd;_0x21da0f=0xc8;}else{_0x21da0f=0xce;}_0x58222e[_0x04ad('0x1e')](_0x21da0f);return _0x58222e[_0x04ad('0x23')](_0x04ad('0x24'),_0x222646+'-'+_0x22de49+'/'+_0x131efd)[_0x04ad('0x20')](_0x345d07);}return null;};}function patchUpdates(_0x116fc2){return function(_0x102fd7){try{jsonpatch['apply'](_0x102fd7,_0x116fc2,!![]);}catch(_0x101d5e){return BPromise['reject'](_0x101d5e);}return _0x102fd7[_0x04ad('0x25')]();};}function saveUpdates(_0x19688f,_0x2b4cee){return function(_0xd91e91){if(_0xd91e91){return _0xd91e91[_0x04ad('0x26')](_0x19688f)[_0x04ad('0x27')](function(_0x446b16){return _0x446b16;});}return null;};}function removeEntity(_0x3fb6a4,_0x58c29c){return function(_0x3939f7){if(_0x3939f7){return _0x3939f7['destroy']()['then'](function(){_0x3fb6a4[_0x04ad('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x351333,_0x493c9e){return function(_0x313bad){if(!_0x313bad){_0x351333[_0x04ad('0x28')](0x194);}return _0x313bad;};}function handleError(_0x4322d7,_0x47e26f){_0x47e26f=_0x47e26f||0x1f4;return function(_0xdb8f4){logger[_0x04ad('0x29')](_0xdb8f4[_0x04ad('0x2a')]);if(_0xdb8f4['name']){delete _0xdb8f4['name'];}_0x4322d7[_0x04ad('0x1e')](_0x47e26f)['send'](_0xdb8f4);};}exports[_0x04ad('0x2b')]=function(_0x2ba266,_0xd347be){var _0x279083={},_0x1d7ac1={},_0x26114b={'count':0x0,'rows':[]};return db[_0x04ad('0x2c')]['describe']()[_0x04ad('0x27')](function(_0x174961){var _0x15e2b2=[];for(var _0x43e839=0x0;_0x43e8390x1){_0x22bd0e['or'](_0x04ad('0x64'),qs[_0x04ad('0x65')](_0x216d1b),null);}else{if(qs[_0x04ad('0x66')](_0x216d1b)){_0x22bd0e['or'](_0x04ad('0x67'),_0x216d1b+'%');_0x22bd0e['or'](_0x04ad('0x68'),_0x216d1b+'%');_0x22bd0e['or'](_0x04ad('0x69'),_0x216d1b+'%');_0x22bd0e['or']('c.fax\x20LIKE\x20?',_0x216d1b+'%');}else if(qs['isEmail'](_0x216d1b)){_0x22bd0e['or'](_0x04ad('0x6a'),_0x216d1b+'%');}else{_0x22bd0e['or'](_0x04ad('0x6b'),'%'+_0x216d1b+'%');_0x22bd0e['or'](_0x04ad('0x6c'),'%'+_0x216d1b+'%');_0x22bd0e['or']('c.email\x20LIKE\x20?','%'+_0x216d1b+'%');}}}}_0x4f4465[_0x04ad('0x3e')](_0x22bd0e);_0x4f4465[_0x04ad('0x6d')](_0x04ad('0x6e'));var _0x4b182f={'type':db[_0x04ad('0x6f')][_0x04ad('0x70')][_0x04ad('0x71')],'raw':!![]};var _0x452bd2=_0x4f4465[_0x04ad('0x72')]()[_0x04ad('0x41')](_0x04ad('0x6e'));if(_0x279083[_0x04ad('0x3c')]){_0x279083[_0x04ad('0x3c')][_0x04ad('0x4e')](function(_0x30a339){_0x4f4465[_0x04ad('0x3c')]('c.'+_0x30a339[0x0],_0x30a339[0x1]===_0x04ad('0x73')?![]:!![]);});}if(!_[_0x04ad('0x5c')](_0x445c2b)){_0x4f4465['having'](_0x5a9704);_0x452bd2['where'](_0x04ad('0x74'),_0x445c2b);}BPromise['resolve']()[_0x04ad('0x27')](function(){if(_0xdb6ff7&&!_[_0x04ad('0x75')](_0xdb6ff7[_0x04ad('0x76')],[_0x04ad('0x41'),_0x04ad('0x51')])){return _0x2ba266[_0x04ad('0x77')][_0x04ad('0x78')]({'attributes':['id'],'raw':!![]})[_0x04ad('0x27')](function(_0x3aea69){if(_[_0x04ad('0x5c')](_0x3aea69)){_0x452bd2['where']('c.ListId\x20IS\x20NULL');_0x4f4465[_0x04ad('0x3e')]('c.ListId\x20IS\x20NULL');}else{_0x452bd2['where']('c.ListId\x20IN\x20?',_[_0x04ad('0x4d')](_0x3aea69,'id'));_0x4f4465[_0x04ad('0x3e')](_0x04ad('0x5d'),_['map'](_0x3aea69,'id'));}});}else{return;}})[_0x04ad('0x27')](function(){db[_0x04ad('0x79')][_0x04ad('0x35')](_0x452bd2[_0x04ad('0x7a')](),_0x4b182f)['then'](function(_0x555f29){_0x26114b[_0x04ad('0x7b')]=_0x555f29['length'];if(_0x26114b[_0x04ad('0x7b')]===0x0)return[];return db[_0x04ad('0x79')]['query'](_0x1437ec['toString'](),_0x4b182f);})['then'](function(_0x5a6dd0){_0xb30fd3=_[_0x04ad('0x7c')](_0x5a6dd0,'id');_0x4b182f=_['merge'](_0x4b182f,{'model':db[_0x04ad('0x2c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2ba266[_0x04ad('0x35')][_0x04ad('0x7d')]){_0x279083[_0x04ad('0x39')][_0x04ad('0x4e')](function(_0x18288f){_0x4f4465[_0x04ad('0x41')]('c.'+_0x18288f);});}else{_0x4f4465[_0x04ad('0x41')]('c.id');_0x4f4465['field'](_0x04ad('0x7e'));_0x4f4465['field']('c.lastName');_0x4f4465['field'](_0x04ad('0x7f'));_0x4f4465[_0x04ad('0x41')](_0x04ad('0x80'));_0x4f4465[_0x04ad('0x41')]('c.fax');_0x4f4465[_0x04ad('0x41')](_0x04ad('0x81'));_0x4f4465['field'](_0x04ad('0x82'));_0x4f4465[_0x04ad('0x41')](_0x04ad('0x83'));_0x4f4465[_0x04ad('0x41')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x04ad('0x84'));}if(_0x279083['limit'])_0x4f4465[_0x04ad('0x22')](_0x279083[_0x04ad('0x22')]);if(_0x279083['offset'])_0x4f4465[_0x04ad('0x21')](_0x279083[_0x04ad('0x21')]);return db[_0x04ad('0x79')][_0x04ad('0x35')](_0x4f4465[_0x04ad('0x7a')](),_0x4b182f);})['then'](function(_0x405d5b){_0x405d5b[_0x04ad('0x4e')](function(_0x4c44d9){if(_0x4c44d9['TagIds']){_0x4c44d9[_0x04ad('0x85')]=[];_0x4c44d9[_0x04ad('0x84')][_0x04ad('0x63')](',')[_0x04ad('0x4e')](function(_0x275376){_0x4c44d9[_0x04ad('0x85')][_0x04ad('0x2f')](_0xb30fd3[_0x275376]);});}delete _0x4c44d9[_0x04ad('0x84')];});_0x26114b['rows']=_0x405d5b;return _0x26114b;})[_0x04ad('0x27')](respondWithFilteredResult(_0xd347be,_0x279083));});})[_0x04ad('0x86')](handleError(_0xd347be,null));};exports[_0x04ad('0x87')]=function(_0x330c8c,_0x1cc2a2){return db[_0x04ad('0x2c')][_0x04ad('0x4b')]({'where':{'id':_0x330c8c['params']['id']}})['then'](handleEntityNotFound(_0x1cc2a2,null))[_0x04ad('0x27')](removeEntity(_0x1cc2a2,null))[_0x04ad('0x86')](handleError(_0x1cc2a2,null));};exports['describe']=function(_0x23838c,_0x19248b){return db['CmContact'][_0x04ad('0x88')]()[_0x04ad('0x27')](function(_0x5843a6){delete _0x5843a6['tags'];for(var _0x5db2cd=0x0;_0x5db2cd=_0x44a48c){_0x3b65b5=_0x44a48c;_0x277e8e=0xc8;}else{_0x277e8e=0xce;}_0x3b3bf4[_0x5281('0x1c')](_0x277e8e);return _0x3b3bf4[_0x5281('0x20')](_0x5281('0x21'),_0x284e78+'-'+_0x3b65b5+'/'+_0x44a48c)['json'](_0x452779);}return null;};}function patchUpdates(_0x17233f){return function(_0x525079){try{jsonpatch[_0x5281('0x22')](_0x525079,_0x17233f,!![]);}catch(_0x4521a0){return BPromise[_0x5281('0x23')](_0x4521a0);}return _0x525079[_0x5281('0x24')]();};}function saveUpdates(_0xc68ec5,_0x22fa0c){return function(_0x105e00){if(_0x105e00){return _0x105e00[_0x5281('0x25')](_0xc68ec5)[_0x5281('0x26')](function(_0x176b4f){return _0x176b4f;});}return null;};}function removeEntity(_0x5abb66,_0xf193ce){return function(_0x2fee42){if(_0x2fee42){return _0x2fee42[_0x5281('0x27')]()[_0x5281('0x26')](function(){_0x5abb66[_0x5281('0x1c')](0xcc)[_0x5281('0x1d')]();});}};}function handleEntityNotFound(_0x42eb28,_0x108941){return function(_0x59f451){if(!_0x59f451){_0x42eb28[_0x5281('0x28')](0x194);}return _0x59f451;};}function handleError(_0xc6b60b,_0x3bed0d){_0x3bed0d=_0x3bed0d||0x1f4;return function(_0x3c1950){logger[_0x5281('0x29')](_0x3c1950[_0x5281('0x2a')]);if(_0x3c1950[_0x5281('0x2b')]){delete _0x3c1950[_0x5281('0x2b')];}_0xc6b60b[_0x5281('0x1c')](_0x3bed0d)[_0x5281('0x2c')](_0x3c1950);};}exports[_0x5281('0x2d')]=function(_0x136f56,_0x3200b8){var _0x370fa9={},_0x15fe2e={},_0x516811={'count':0x0,'rows':[]};return db[_0x5281('0x2e')][_0x5281('0x2f')]()[_0x5281('0x26')](function(_0x1d6a52){var _0x2da0e6=[];for(var _0x325bf9=0x0;_0x325bf90x1){_0x1acbae['or'](_0x5281('0x6b'),qs['getFullTextValue'](_0x484aea),null);}else{if(qs[_0x5281('0x6c')](_0x484aea)){_0x1acbae['or'](_0x5281('0x6d'),_0x484aea+'%');_0x1acbae['or'](_0x5281('0x6e'),_0x484aea+'%');_0x1acbae['or']('c.mobile\x20LIKE\x20?',_0x484aea+'%');_0x1acbae['or'](_0x5281('0x6f'),_0x484aea+'%');}else if(qs[_0x5281('0x70')](_0x484aea)){_0x1acbae['or'](_0x5281('0x71'),_0x484aea+'%');}else{_0x1acbae['or'](_0x5281('0x72'),'%'+_0x484aea+'%');_0x1acbae['or'](_0x5281('0x73'),'%'+_0x484aea+'%');_0x1acbae['or'](_0x5281('0x71'),'%'+_0x484aea+'%');}}}}_0x6202ad[_0x5281('0x42')](_0x1acbae);_0x6202ad[_0x5281('0x74')](_0x5281('0x75'));var _0xa725f4={'type':db[_0x5281('0x76')][_0x5281('0x77')][_0x5281('0x78')],'raw':!![]};var _0x28b1e1=_0x6202ad['clone']()[_0x5281('0x44')](_0x5281('0x75'));if(_0x370fa9['order']){_0x370fa9[_0x5281('0x79')]['forEach'](function(_0x20b7ad){_0x6202ad[_0x5281('0x79')]('c.'+_0x20b7ad[0x0],_0x20b7ad[0x1]==='DESC'?![]:!![]);});}if(!_[_0x5281('0x61')](_0x1c9d03)){_0x6202ad['having'](_0x7fbc0a);_0x28b1e1[_0x5281('0x42')](_0x5281('0x7a'),_0x1c9d03);}BPromise[_0x5281('0x7b')]()[_0x5281('0x26')](function(){if(_0x4039f1&&!_[_0x5281('0x7c')](_0x4039f1[_0x5281('0x52')],[_0x5281('0x44'),_0x5281('0x58')])){return _0x136f56[_0x5281('0x7d')][_0x5281('0x7e')]({'attributes':['id'],'raw':!![]})[_0x5281('0x26')](function(_0x2980ec){if(_['isEmpty'](_0x2980ec)){_0x28b1e1[_0x5281('0x42')](_0x5281('0x7f'));_0x6202ad[_0x5281('0x42')](_0x5281('0x7f'));}else{_0x28b1e1[_0x5281('0x42')](_0x5281('0x63'),_[_0x5281('0x55')](_0x2980ec,'id'));_0x6202ad['where'](_0x5281('0x63'),_['map'](_0x2980ec,'id'));}});}else{return;}})[_0x5281('0x26')](function(){db[_0x5281('0x80')][_0x5281('0x39')](_0x28b1e1[_0x5281('0x81')](),_0xa725f4)['then'](function(_0x30c7a7){_0x516811[_0x5281('0x82')]=_0x30c7a7['length'];if(_0x516811[_0x5281('0x82')]===0x0)return[];return db['sequelize'][_0x5281('0x39')](_0x1cb4c7['toString'](),_0xa725f4);})[_0x5281('0x26')](function(_0x59c948){_0x781ed0=_[_0x5281('0x83')](_0x59c948,'id');_0xa725f4=_[_0x5281('0x84')](_0xa725f4,{'model':db[_0x5281('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x136f56[_0x5281('0x39')][_0x5281('0x3e')]){_0x370fa9[_0x5281('0x3c')][_0x5281('0x56')](function(_0x2b9234){_0x6202ad[_0x5281('0x44')]('c.'+_0x2b9234);});}else{_0x6202ad[_0x5281('0x44')]('c.id');_0x6202ad[_0x5281('0x44')]('c.firstName');_0x6202ad[_0x5281('0x44')](_0x5281('0x85'));_0x6202ad['field'](_0x5281('0x86'));_0x6202ad['field']('c.mobile');_0x6202ad[_0x5281('0x44')](_0x5281('0x87'));_0x6202ad[_0x5281('0x44')]('c.email');_0x6202ad[_0x5281('0x44')](_0x5281('0x88'));_0x6202ad[_0x5281('0x44')]('c.deletedAt');_0x6202ad[_0x5281('0x44')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x370fa9[_0x5281('0x1f')])_0x6202ad[_0x5281('0x1f')](_0x370fa9[_0x5281('0x1f')]);if(_0x370fa9[_0x5281('0x1e')])_0x6202ad['offset'](_0x370fa9['offset']);return db[_0x5281('0x80')][_0x5281('0x39')](_0x6202ad['toString'](),_0xa725f4);})[_0x5281('0x26')](function(_0x9a7390){_0x9a7390[_0x5281('0x56')](function(_0x5a38b8){if(_0x5a38b8['TagIds']){_0x5a38b8['Tags']=[];_0x5a38b8[_0x5281('0x89')][_0x5281('0x6a')](',')['forEach'](function(_0x3e2788){_0x5a38b8[_0x5281('0x8a')]['push'](_0x781ed0[_0x3e2788]);});}delete _0x5a38b8['TagIds'];});_0x516811['rows']=_0x9a7390;return _0x516811;})[_0x5281('0x26')](respondWithFilteredResult(_0x3200b8,_0x370fa9));});})[_0x5281('0x8b')](handleError(_0x3200b8,null));};exports[_0x5281('0x27')]=function(_0x45f100,_0x576bc3){return db['CmContact']['find']({'where':{'id':_0x45f100[_0x5281('0x8c')]['id']}})[_0x5281('0x26')](handleEntityNotFound(_0x576bc3,null))['then'](removeEntity(_0x576bc3,null))[_0x5281('0x8b')](handleError(_0x576bc3,null));};exports['describe']=function(_0x34ec3a,_0x5a46a1){return db['CmContact'][_0x5281('0x2f')]()[_0x5281('0x26')](function(_0x120db3){delete _0x120db3['tags'];for(var _0x843777=0x0;_0x843777{}\s\\|]/g,'-');_0x19af92(null,util[_0x76aa('0x22')](_0x76aa('0x23'),path[_0x76aa('0x24')](_0x191560['originalname'],path[_0x76aa('0x25')](_0x191560[_0x76aa('0x21')])),Date[_0x76aa('0x26')](),path[_0x76aa('0x25')](_0x191560[_0x76aa('0x21')])));}})});router[_0x76aa('0x18')](_0x76aa('0x27'),upload[_0x76aa('0x28')](_0x76aa('0x29')),controller[_0x76aa('0x2a')]);var upload=multer({'storage':multer[_0x76aa('0x1d')]({'destination':function(_0x26b75e,_0x3599a9,_0x4ef9b0){_0x4ef9b0(null,path[_0x76aa('0x1e')](config[_0x76aa('0x1f')],_0x76aa('0x20')));},'filename':function(_0x2e7ab4,_0xa1e6,_0x2f9316){_0xa1e6[_0x76aa('0x21')]=_0xa1e6[_0x76aa('0x21')][_0x76aa('0x2b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2f9316(null,util[_0x76aa('0x22')]('%s-%s%s',path[_0x76aa('0x24')](_0xa1e6['originalname'],path[_0x76aa('0x25')](_0xa1e6[_0x76aa('0x21')])),Date[_0x76aa('0x26')](),path[_0x76aa('0x25')](_0xa1e6[_0x76aa('0x21')])));}})});router[_0x76aa('0x18')](_0x76aa('0x2c'),upload[_0x76aa('0x28')](_0x76aa('0x29')),controller[_0x76aa('0x2d')]);router['post'](_0x76aa('0x2e'),auth[_0x76aa('0xa')](),controller[_0x76aa('0x2f')]);router[_0x76aa('0x30')](_0x76aa('0xc'),auth[_0x76aa('0xa')](),controller[_0x76aa('0x31')]);router['delete'](_0x76aa('0xc'),auth[_0x76aa('0xa')](),controller['destroy']);module[_0x76aa('0x32')]=router; \ No newline at end of file +var _0x98a8=['/describe','describe','/:id','show','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/jscripty_sessions','getJscriptySessions','post','/merge','create','/create_many','bulkCreate','setTags','join','root','originalname','replace','format','%s-%s%s','extname','now','/csv','single','file','uploadCsv','diskStorage','basename','/upload','upload','/upload/:id','import','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index'];(function(_0x43f92e,_0x26229c){var _0x329ded=function(_0x52dd7a){while(--_0x52dd7a){_0x43f92e['push'](_0x43f92e['shift']());}};_0x329ded(++_0x26229c);}(_0x98a8,0x12c));var _0x898a=function(_0x489c49,_0xd4c35b){_0x489c49=_0x489c49-0x0;var _0x48b47e=_0x98a8[_0x489c49];return _0x48b47e;};'use strict';var multer=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var path=require(_0x898a('0x2'));var timeout=require(_0x898a('0x3'));var express=require(_0x898a('0x4'));var router=express[_0x898a('0x5')]();var auth=require(_0x898a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x898a('0x7'));var controller=require(_0x898a('0x8'));router[_0x898a('0x9')]('/',auth[_0x898a('0xa')](),controller[_0x898a('0xb')]);router['get'](_0x898a('0xc'),auth['isAuthenticated'](),controller[_0x898a('0xd')]);router['get'](_0x898a('0xe'),auth[_0x898a('0xa')](),controller[_0x898a('0xf')]);router[_0x898a('0x9')](_0x898a('0x10'),auth[_0x898a('0xa')](),controller[_0x898a('0x11')]);router[_0x898a('0x9')](_0x898a('0x12'),auth['isAuthenticated'](),controller[_0x898a('0x13')]);router['get'](_0x898a('0x14'),auth['isAuthenticated'](),controller[_0x898a('0x15')]);router[_0x898a('0x9')](_0x898a('0x16'),auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x898a('0x17'),auth[_0x898a('0xa')](),controller[_0x898a('0x18')]);router[_0x898a('0x19')](_0x898a('0x1a'),auth[_0x898a('0xa')](),controller['merge']);router[_0x898a('0x19')]('/',auth['isAuthenticated'](),controller[_0x898a('0x1b')]);router['post'](_0x898a('0x1c'),auth['isAuthenticated'](),controller[_0x898a('0x1d')]);router['post'](_0x898a('0x10'),auth[_0x898a('0xa')](),controller[_0x898a('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1faf4c,_0x5960e0,_0x54c8f3){_0x54c8f3(null,path[_0x898a('0x1f')](config[_0x898a('0x20')],'server/files/tmp'));},'filename':function(_0x4d374b,_0x12bc0f,_0x26449a){_0x12bc0f[_0x898a('0x21')]=_0x12bc0f[_0x898a('0x21')][_0x898a('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x26449a(null,util[_0x898a('0x23')](_0x898a('0x24'),path['basename'](_0x12bc0f[_0x898a('0x21')],path[_0x898a('0x25')](_0x12bc0f[_0x898a('0x21')])),Date[_0x898a('0x26')](),path[_0x898a('0x25')](_0x12bc0f[_0x898a('0x21')])));}})});router['post'](_0x898a('0x27'),upload[_0x898a('0x28')](_0x898a('0x29')),controller[_0x898a('0x2a')]);var upload=multer({'storage':multer[_0x898a('0x2b')]({'destination':function(_0x1426e3,_0x5b7719,_0x20bde0){_0x20bde0(null,path['join'](config['root'],'server/files/tmp'));},'filename':function(_0x3678be,_0x1f4d86,_0x420b25){_0x1f4d86[_0x898a('0x21')]=_0x1f4d86[_0x898a('0x21')][_0x898a('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x420b25(null,util[_0x898a('0x23')](_0x898a('0x24'),path[_0x898a('0x2c')](_0x1f4d86['originalname'],path['extname'](_0x1f4d86['originalname'])),Date[_0x898a('0x26')](),path[_0x898a('0x25')](_0x1f4d86[_0x898a('0x21')])));}})});router[_0x898a('0x19')](_0x898a('0x2d'),upload[_0x898a('0x28')](_0x898a('0x29')),controller[_0x898a('0x2e')]);router[_0x898a('0x19')](_0x898a('0x2f'),auth[_0x898a('0xa')](),controller[_0x898a('0x30')]);router['put'](_0x898a('0xe'),auth[_0x898a('0xa')](),controller[_0x898a('0x31')]);router[_0x898a('0x32')](_0x898a('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x898a('0x33')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 120a3e5..dc1b1bb 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 _0xd704=['name','long','type','select','values','isArray','stringify','BOOLEAN','sequelize','lodash','alias','STRING','setDataValue','getDataValue'];(function(_0x475287,_0x4f2b3b){var _0x16f72c=function(_0x45413a){while(--_0x45413a){_0x475287['push'](_0x475287['shift']());}};_0x16f72c(++_0x4f2b3b);}(_0xd704,0xf6));var _0x4d70=function(_0x5f15f3,_0x13c5e6){_0x5f15f3=_0x5f15f3-0x0;var _0x4e6eeb=_0xd704[_0x5f15f3];return _0x4e6eeb;};'use strict';var Sequelize=require(_0x4d70('0x0'));var _=require(_0x4d70('0x1'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2608bb){return this['getDataValue'](_0x4d70('0x2'));}},'alias':{'type':Sequelize[_0x4d70('0x3')],'allowNull':![],'set':function(_0x11a4dc){this[_0x4d70('0x4')]('alias',_0x11a4dc?_0x11a4dc:this[_0x4d70('0x5')](_0x4d70('0x6')));}},'type':{'type':Sequelize[_0x4d70('0x3')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x4d70('0x7')),'get':function(){if(this[_0x4d70('0x5')](_0x4d70('0x8'))===_0x4d70('0x9')){return JSON['parse'](this[_0x4d70('0x5')](_0x4d70('0xa')));}else{return this[_0x4d70('0x5')](_0x4d70('0xa'));}},'set':function(_0x524c96){if(Array[_0x4d70('0xb')](_0x524c96)){this[_0x4d70('0x4')](_0x4d70('0xa'),JSON[_0x4d70('0xc')](_0x524c96));}else{this[_0x4d70('0x4')](_0x4d70('0xa'),_0x524c96);}}},'required':{'type':Sequelize[_0x4d70('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0x2c0b=['alias','STRING','setDataValue','name','TEXT','long','type','parse','values','stringify','BOOLEAN','sequelize','lodash','VIRTUAL','getDataValue'];(function(_0x527aaa,_0xe460f3){var _0x50061f=function(_0x2e4f70){while(--_0x2e4f70){_0x527aaa['push'](_0x527aaa['shift']());}};_0x50061f(++_0xe460f3);}(_0x2c0b,0xfb));var _0xb2c0=function(_0x3419af,_0x92ce89){_0x3419af=_0x3419af-0x0;var _0x473682=_0x2c0b[_0x3419af];return _0x473682;};'use strict';var Sequelize=require(_0xb2c0('0x0'));var _=require(_0xb2c0('0x1'));module['exports']={'name':{'type':Sequelize[_0xb2c0('0x2')],'get':function(_0xa71414){return this[_0xb2c0('0x3')](_0xb2c0('0x4'));}},'alias':{'type':Sequelize[_0xb2c0('0x5')],'allowNull':![],'set':function(_0x24daf6){this[_0xb2c0('0x6')](_0xb2c0('0x4'),_0x24daf6?_0x24daf6:this[_0xb2c0('0x3')](_0xb2c0('0x7')));}},'type':{'type':Sequelize[_0xb2c0('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xb2c0('0x8')](_0xb2c0('0x9')),'get':function(){if(this['getDataValue'](_0xb2c0('0xa'))==='select'){return JSON[_0xb2c0('0xb')](this[_0xb2c0('0x3')](_0xb2c0('0xc')));}else{return this[_0xb2c0('0x3')](_0xb2c0('0xc'));}},'set':function(_0x4de1a8){if(Array['isArray'](_0x4de1a8)){this[_0xb2c0('0x6')](_0xb2c0('0xc'),JSON[_0xb2c0('0xd')](_0x4de1a8));}else{this['setDataValue'](_0xb2c0('0xc'),_0x4de1a8);}}},'required':{'type':Sequelize[_0xb2c0('0xe')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index dc02c89..d36aebd 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 _0x300c=['../../config/utils','../../config/environment','status','end','json','offset','limit','set','apply','save','update','destroy','sendStatus','stack','map','rawAttributes','fieldName','type','key','model','differenceBy','name','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','CmCustomField','count','then','includeAll','findAll','catch','params','fields','include','find','body','transaction','create','TEXT','text','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','format','cf_%d','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x300c,0x126));var _0xc300=function(_0x1e01c0,_0x38d2f4){_0x1e01c0=_0x1e01c0-0x0;var _0x2a96b7=_0x300c[_0x1e01c0];return _0x2a96b7;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc300('0x0'));var jsonpatch=require(_0xc300('0x1'));var rp=require(_0xc300('0x2'));var moment=require(_0xc300('0x3'));var BPromise=require(_0xc300('0x4'));var Mustache=require('mustache');var util=require(_0xc300('0x5'));var path=require('path');var sox=require(_0xc300('0x6'));var csv=require(_0xc300('0x7'));var ejs=require(_0xc300('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc300('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc300('0xa'));var toCsv=require(_0xc300('0x7'));var querystring=require(_0xc300('0xb'));var Papa=require('papaparse');var Redis=require(_0xc300('0xc'));var authService=require(_0xc300('0xd'));var qs=require(_0xc300('0xe'));var as=require(_0xc300('0xf'));var hardwareService=require(_0xc300('0x10'));var logger=require('../../config/logger')(_0xc300('0x11'));var utils=require(_0xc300('0x12'));var config=require(_0xc300('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x524184,_0x1eb5b3){_0x1eb5b3=_0x1eb5b3||0xcc;return function(_0x25d0d6){if(_0x25d0d6){return _0x524184['sendStatus'](_0x1eb5b3);}return _0x524184[_0xc300('0x14')](_0x1eb5b3)[_0xc300('0x15')]();};}function respondWithResult(_0xff7d26,_0x2f9af5){_0x2f9af5=_0x2f9af5||0xc8;return function(_0x3114e1){if(_0x3114e1){return _0xff7d26['status'](_0x2f9af5)[_0xc300('0x16')](_0x3114e1);}};}function respondWithFilteredResult(_0x1e7580,_0x59cf20){return function(_0x1fac95){if(_0x1fac95){var _0x15a754=_0x1fac95['count'],_0xf29025=_0x59cf20[_0xc300('0x17')],_0x1aa9b6=_0x59cf20[_0xc300('0x17')]+_0x59cf20[_0xc300('0x18')],_0x5f2f6e;if(_0x1aa9b6>=_0x15a754){_0x1aa9b6=_0x15a754;_0x5f2f6e=0xc8;}else{_0x5f2f6e=0xce;}_0x1e7580['status'](_0x5f2f6e);return _0x1e7580[_0xc300('0x19')]('Content-Range',_0xf29025+'-'+_0x1aa9b6+'/'+_0x15a754)[_0xc300('0x16')](_0x1fac95);}return null;};}function patchUpdates(_0x24c7ff){return function(_0x40c6af){try{jsonpatch[_0xc300('0x1a')](_0x40c6af,_0x24c7ff,!![]);}catch(_0x2bb2e0){return BPromise['reject'](_0x2bb2e0);}return _0x40c6af[_0xc300('0x1b')]();};}function saveUpdates(_0x52bb26,_0x2d7c27){return function(_0x1860ca){if(_0x1860ca){return _0x1860ca[_0xc300('0x1c')](_0x52bb26)['then'](function(_0x122844){return _0x122844;});}return null;};}function removeEntity(_0x6744dc,_0x21cb98){return function(_0x1c14c9){if(_0x1c14c9){return _0x1c14c9[_0xc300('0x1d')]()['then'](function(){_0x6744dc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3194c8,_0x1db13a){return function(_0x250f64){if(!_0x250f64){_0x3194c8[_0xc300('0x1e')](0x194);}return _0x250f64;};}function handleError(_0x286d3c,_0x138990){_0x138990=_0x138990||0x1f4;return function(_0x44d431){logger['error'](_0x44d431[_0xc300('0x1f')]);if(_0x44d431['name']){delete _0x44d431['name'];}_0x286d3c[_0xc300('0x14')](_0x138990)['send'](_0x44d431);};}exports['index']=function(_0x4da738,_0x4ab87e){var _0x230d89={},_0x4cd2e1={},_0x754da={'count':0x0,'rows':[]};var _0x4fec9b=_[_0xc300('0x20')](db['CmCustomField'][_0xc300('0x21')],function(_0x4fded7){return{'name':_0x4fded7[_0xc300('0x22')],'type':_0x4fded7[_0xc300('0x23')][_0xc300('0x24')]};});_0x4cd2e1[_0xc300('0x25')]=_[_0xc300('0x26')](_['map'](_0x4fec9b,_0xc300('0x27')),[_0xc300('0x27')]);_0x4cd2e1[_0xc300('0x28')]=_[_0xc300('0x29')](_0x4da738[_0xc300('0x28')]);_0x4cd2e1[_0xc300('0x2a')]=_[_0xc300('0x2b')](_0x4cd2e1['model'],_0x4cd2e1[_0xc300('0x28')]);_0x230d89[_0xc300('0x2c')]=_[_0xc300('0x2b')](_0x4cd2e1[_0xc300('0x25')],qs['fields'](_0x4da738[_0xc300('0x28')]['fields']));_0x230d89[_0xc300('0x2c')]=_0x230d89[_0xc300('0x2c')][_0xc300('0x2d')]?_0x230d89[_0xc300('0x2c')]:_0x4cd2e1['model'];if(!_0x4da738[_0xc300('0x28')]['hasOwnProperty'](_0xc300('0x2e'))){_0x230d89[_0xc300('0x18')]=qs[_0xc300('0x18')](_0x4da738['query'][_0xc300('0x18')]);_0x230d89[_0xc300('0x17')]=qs[_0xc300('0x17')](_0x4da738['query'][_0xc300('0x17')]);}_0x230d89[_0xc300('0x2f')]=qs[_0xc300('0x30')](_0x4da738[_0xc300('0x28')][_0xc300('0x30')]);_0x230d89[_0xc300('0x31')]=qs[_0xc300('0x2a')](_[_0xc300('0x32')](_0x4da738[_0xc300('0x28')],_0x4cd2e1[_0xc300('0x2a')]));if(_0x4da738[_0xc300('0x28')][_0xc300('0x33')]){_0x230d89['where']=_['merge'](_0x230d89['where'],{'$or':_[_0xc300('0x20')](_0x4fec9b,function(_0x503272){if(_0x503272[_0xc300('0x23')]!=='VIRTUAL'){var _0x98685={};_0x98685[_0x503272[_0xc300('0x27')]]={'$like':'%'+_0x4da738[_0xc300('0x28')]['filter']+'%'};return _0x98685;}})});}_0x230d89=_[_0xc300('0x34')]({},_0x230d89,_0x4da738[_0xc300('0x35')]);var _0x5aa288={'where':_0x230d89[_0xc300('0x31')]};return db[_0xc300('0x36')][_0xc300('0x37')](_0x5aa288)[_0xc300('0x38')](function(_0x43a8ca){_0x754da['count']=_0x43a8ca;if(_0x4da738['query'][_0xc300('0x39')]){_0x230d89['include']=[{'all':!![]}];}return db[_0xc300('0x36')][_0xc300('0x3a')](_0x230d89);})[_0xc300('0x38')](function(_0x589645){_0x754da['rows']=_0x589645;return _0x754da;})[_0xc300('0x38')](respondWithFilteredResult(_0x4ab87e,_0x230d89))[_0xc300('0x3b')](handleError(_0x4ab87e,null));};exports['show']=function(_0x59c5cf,_0x4d8c40){var _0x530cb6={'raw':!![],'where':{'id':_0x59c5cf[_0xc300('0x3c')]['id']}},_0x5024ff={};_0x5024ff[_0xc300('0x25')]=_['keys'](db[_0xc300('0x36')][_0xc300('0x21')]);_0x5024ff['query']=_['keys'](_0x59c5cf['query']);_0x5024ff['filters']=_[_0xc300('0x2b')](_0x5024ff['model'],_0x5024ff[_0xc300('0x28')]);_0x530cb6[_0xc300('0x2c')]=_['intersection'](_0x5024ff['model'],qs['fields'](_0x59c5cf[_0xc300('0x28')][_0xc300('0x3d')]));_0x530cb6[_0xc300('0x2c')]=_0x530cb6[_0xc300('0x2c')][_0xc300('0x2d')]?_0x530cb6[_0xc300('0x2c')]:_0x5024ff[_0xc300('0x25')];if(_0x59c5cf[_0xc300('0x28')][_0xc300('0x39')]){_0x530cb6[_0xc300('0x3e')]=[{'all':!![]}];}_0x530cb6=_[_0xc300('0x34')]({},_0x530cb6,_0x59c5cf[_0xc300('0x35')]);return db['CmCustomField'][_0xc300('0x3f')](_0x530cb6)[_0xc300('0x38')](handleEntityNotFound(_0x4d8c40,null))[_0xc300('0x38')](respondWithResult(_0x4d8c40,null))[_0xc300('0x3b')](handleError(_0x4d8c40,null));};exports['update']=function(_0x436822,_0x32f5af){if(_0x436822[_0xc300('0x40')]['id']){delete _0x436822[_0xc300('0x40')]['id'];}return db[_0xc300('0x36')][_0xc300('0x3f')]({'where':{'id':_0x436822[_0xc300('0x3c')]['id']}})[_0xc300('0x38')](handleEntityNotFound(_0x32f5af,null))['then'](saveUpdates(_0x436822[_0xc300('0x40')],null))[_0xc300('0x38')](respondWithResult(_0x32f5af,null))[_0xc300('0x3b')](handleError(_0x32f5af,null));};exports['destroy']=function(_0x371d01,_0x4ac83f){return db['CmCustomField']['find']({'where':{'id':_0x371d01[_0xc300('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4ac83f,null))[_0xc300('0x38')](removeEntity(_0x4ac83f,null))['catch'](handleError(_0x4ac83f,null));};exports['create']=function(_0x432396,_0x23ddf9){var _0x262253;return db['sequelize'][_0xc300('0x41')](function(_0x589eb5){return db[_0xc300('0x36')][_0xc300('0x42')](_0x432396[_0xc300('0x40')],{'transaction':_0x589eb5})[_0xc300('0x38')](function(_0x3015fd){_0x262253=_0x3015fd;var _0x149998={'type':db['Sequelize'][_0xc300('0x43')],'transaction':_0x589eb5};switch(_0x432396['body']['type']){case _0xc300('0x44'):_0x149998['type']=db[_0xc300('0x45')][_0xc300('0x43')];break;case'number':_0x149998[_0xc300('0x23')]=db[_0xc300('0x45')][_0xc300('0x46')];break;case _0xc300('0x47'):_0x149998[_0xc300('0x23')]=db[_0xc300('0x45')][_0xc300('0x48')];_0x149998[_0xc300('0x49')]=![];break;default:}return db['sequelize']['queryInterface'][_0xc300('0x4a')](_0xc300('0x4b'),util[_0xc300('0x4c')](_0xc300('0x4d'),_0x262253['id']),_0x149998);})[_0xc300('0x38')](function(){return _0x262253;});})[_0xc300('0x38')](respondWithResult(_0x23ddf9,0xc9))[_0xc300('0x3b')](handleError(_0x23ddf9,null));}; \ No newline at end of file +var _0x72d9=['sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','end','error','name','map','CmCustomField','rawAttributes','fieldName','type','key','differenceBy','query','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','includeAll','include','findAll','catch','show','params','keys','find','body','create','sequelize','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment'];(function(_0x1a60c5,_0x14cbd4){var _0x43678c=function(_0x3eb4b3){while(--_0x3eb4b3){_0x1a60c5['push'](_0x1a60c5['shift']());}};_0x43678c(++_0x14cbd4);}(_0x72d9,0xdf));var _0x972d=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x72d9[_0x413feb];return _0x40ee88;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x972d('0x0'));var rimraf=require(_0x972d('0x1'));var zipdir=require(_0x972d('0x2'));var jsonpatch=require(_0x972d('0x3'));var rp=require(_0x972d('0x4'));var moment=require(_0x972d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x972d('0x6'));var util=require(_0x972d('0x7'));var path=require(_0x972d('0x8'));var sox=require(_0x972d('0x9'));var csv=require('to-csv');var ejs=require(_0x972d('0xa'));var fs=require('fs');var _=require(_0x972d('0xb'));var squel=require(_0x972d('0xc'));var crypto=require('crypto');var jsforce=require(_0x972d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x972d('0xe'));var Papa=require(_0x972d('0xf'));var Redis=require(_0x972d('0x10'));var authService=require(_0x972d('0x11'));var qs=require(_0x972d('0x12'));var as=require(_0x972d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x972d('0x14'))(_0x972d('0x15'));var utils=require('../../config/utils');var config=require(_0x972d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x554fc6,_0x1e3e2c){_0x1e3e2c=_0x1e3e2c||0xcc;return function(_0xc348fd){if(_0xc348fd){return _0x554fc6[_0x972d('0x17')](_0x1e3e2c);}return _0x554fc6[_0x972d('0x18')](_0x1e3e2c)['end']();};}function respondWithResult(_0x5a1e86,_0x3e87eb){_0x3e87eb=_0x3e87eb||0xc8;return function(_0x25d4ee){if(_0x25d4ee){return _0x5a1e86[_0x972d('0x18')](_0x3e87eb)['json'](_0x25d4ee);}};}function respondWithFilteredResult(_0x2368b0,_0x170e33){return function(_0x28ff37){if(_0x28ff37){var _0x4ddc1f=_0x28ff37[_0x972d('0x19')],_0x2784f7=_0x170e33[_0x972d('0x1a')],_0x120415=_0x170e33[_0x972d('0x1a')]+_0x170e33[_0x972d('0x1b')],_0x4eca3b;if(_0x120415>=_0x4ddc1f){_0x120415=_0x4ddc1f;_0x4eca3b=0xc8;}else{_0x4eca3b=0xce;}_0x2368b0[_0x972d('0x18')](_0x4eca3b);return _0x2368b0[_0x972d('0x1c')](_0x972d('0x1d'),_0x2784f7+'-'+_0x120415+'/'+_0x4ddc1f)[_0x972d('0x1e')](_0x28ff37);}return null;};}function patchUpdates(_0x4945d3){return function(_0xbdb09a){try{jsonpatch[_0x972d('0x1f')](_0xbdb09a,_0x4945d3,!![]);}catch(_0x2738a3){return BPromise[_0x972d('0x20')](_0x2738a3);}return _0xbdb09a[_0x972d('0x21')]();};}function saveUpdates(_0x23dd1f,_0x4cbd56){return function(_0x54977e){if(_0x54977e){return _0x54977e[_0x972d('0x22')](_0x23dd1f)['then'](function(_0x26cf0f){return _0x26cf0f;});}return null;};}function removeEntity(_0x396f4d,_0x55658b){return function(_0x4500ce){if(_0x4500ce){return _0x4500ce[_0x972d('0x23')]()[_0x972d('0x24')](function(){_0x396f4d['status'](0xcc)[_0x972d('0x25')]();});}};}function handleEntityNotFound(_0xd31c3f,_0x14b390){return function(_0x4cc083){if(!_0x4cc083){_0xd31c3f[_0x972d('0x17')](0x194);}return _0x4cc083;};}function handleError(_0x274979,_0x15f27c){_0x15f27c=_0x15f27c||0x1f4;return function(_0x3c0277){logger[_0x972d('0x26')](_0x3c0277['stack']);if(_0x3c0277[_0x972d('0x27')]){delete _0x3c0277[_0x972d('0x27')];}_0x274979['status'](_0x15f27c)['send'](_0x3c0277);};}exports['index']=function(_0x46c4c8,_0x3f6bd5){var _0x47c55f={},_0x5c873b={},_0x2925ee={'count':0x0,'rows':[]};var _0x53bbb8=_[_0x972d('0x28')](db[_0x972d('0x29')][_0x972d('0x2a')],function(_0x6eaf15){return{'name':_0x6eaf15[_0x972d('0x2b')],'type':_0x6eaf15[_0x972d('0x2c')][_0x972d('0x2d')]};});_0x5c873b['model']=_[_0x972d('0x2e')](_[_0x972d('0x28')](_0x53bbb8,_0x972d('0x27')),[_0x972d('0x27')]);_0x5c873b[_0x972d('0x2f')]=_['keys'](_0x46c4c8[_0x972d('0x2f')]);_0x5c873b['filters']=_[_0x972d('0x30')](_0x5c873b[_0x972d('0x31')],_0x5c873b[_0x972d('0x2f')]);_0x47c55f[_0x972d('0x32')]=_[_0x972d('0x30')](_0x5c873b[_0x972d('0x31')],qs['fields'](_0x46c4c8[_0x972d('0x2f')][_0x972d('0x33')]));_0x47c55f[_0x972d('0x32')]=_0x47c55f[_0x972d('0x32')][_0x972d('0x34')]?_0x47c55f['attributes']:_0x5c873b[_0x972d('0x31')];if(!_0x46c4c8[_0x972d('0x2f')][_0x972d('0x35')]('nolimit')){_0x47c55f[_0x972d('0x1b')]=qs['limit'](_0x46c4c8[_0x972d('0x2f')][_0x972d('0x1b')]);_0x47c55f[_0x972d('0x1a')]=qs['offset'](_0x46c4c8[_0x972d('0x2f')]['offset']);}_0x47c55f['order']=qs['sort'](_0x46c4c8['query'][_0x972d('0x36')]);_0x47c55f[_0x972d('0x37')]=qs[_0x972d('0x38')](_[_0x972d('0x39')](_0x46c4c8['query'],_0x5c873b[_0x972d('0x38')]));if(_0x46c4c8[_0x972d('0x2f')][_0x972d('0x3a')]){_0x47c55f['where']=_['merge'](_0x47c55f[_0x972d('0x37')],{'$or':_['map'](_0x53bbb8,function(_0x3a7443){if(_0x3a7443[_0x972d('0x2c')]!=='VIRTUAL'){var _0x57b429={};_0x57b429[_0x3a7443['name']]={'$like':'%'+_0x46c4c8['query']['filter']+'%'};return _0x57b429;}})});}_0x47c55f=_[_0x972d('0x3b')]({},_0x47c55f,_0x46c4c8['options']);var _0x4682d7={'where':_0x47c55f[_0x972d('0x37')]};return db[_0x972d('0x29')][_0x972d('0x19')](_0x4682d7)[_0x972d('0x24')](function(_0x5f3eaf){_0x2925ee[_0x972d('0x19')]=_0x5f3eaf;if(_0x46c4c8[_0x972d('0x2f')][_0x972d('0x3c')]){_0x47c55f[_0x972d('0x3d')]=[{'all':!![]}];}return db[_0x972d('0x29')][_0x972d('0x3e')](_0x47c55f);})[_0x972d('0x24')](function(_0x1ede63){_0x2925ee['rows']=_0x1ede63;return _0x2925ee;})[_0x972d('0x24')](respondWithFilteredResult(_0x3f6bd5,_0x47c55f))[_0x972d('0x3f')](handleError(_0x3f6bd5,null));};exports[_0x972d('0x40')]=function(_0x5523fe,_0x3f231f){var _0x34f99a={'raw':!![],'where':{'id':_0x5523fe[_0x972d('0x41')]['id']}},_0x2b224f={};_0x2b224f['model']=_['keys'](db[_0x972d('0x29')]['rawAttributes']);_0x2b224f[_0x972d('0x2f')]=_[_0x972d('0x42')](_0x5523fe[_0x972d('0x2f')]);_0x2b224f[_0x972d('0x38')]=_[_0x972d('0x30')](_0x2b224f[_0x972d('0x31')],_0x2b224f[_0x972d('0x2f')]);_0x34f99a[_0x972d('0x32')]=_[_0x972d('0x30')](_0x2b224f['model'],qs[_0x972d('0x33')](_0x5523fe['query']['fields']));_0x34f99a[_0x972d('0x32')]=_0x34f99a['attributes'][_0x972d('0x34')]?_0x34f99a[_0x972d('0x32')]:_0x2b224f[_0x972d('0x31')];if(_0x5523fe[_0x972d('0x2f')]['includeAll']){_0x34f99a[_0x972d('0x3d')]=[{'all':!![]}];}_0x34f99a=_['merge']({},_0x34f99a,_0x5523fe['options']);return db[_0x972d('0x29')][_0x972d('0x43')](_0x34f99a)['then'](handleEntityNotFound(_0x3f231f,null))[_0x972d('0x24')](respondWithResult(_0x3f231f,null))[_0x972d('0x3f')](handleError(_0x3f231f,null));};exports[_0x972d('0x22')]=function(_0x170cd5,_0x97eb8b){if(_0x170cd5['body']['id']){delete _0x170cd5[_0x972d('0x44')]['id'];}return db[_0x972d('0x29')][_0x972d('0x43')]({'where':{'id':_0x170cd5[_0x972d('0x41')]['id']}})[_0x972d('0x24')](handleEntityNotFound(_0x97eb8b,null))[_0x972d('0x24')](saveUpdates(_0x170cd5[_0x972d('0x44')],null))['then'](respondWithResult(_0x97eb8b,null))['catch'](handleError(_0x97eb8b,null));};exports['destroy']=function(_0x52dde3,_0x407911){return db[_0x972d('0x29')]['find']({'where':{'id':_0x52dde3['params']['id']}})[_0x972d('0x24')](handleEntityNotFound(_0x407911,null))[_0x972d('0x24')](removeEntity(_0x407911,null))[_0x972d('0x3f')](handleError(_0x407911,null));};exports[_0x972d('0x45')]=function(_0x1958f2,_0x2f4d5b){var _0x1a3d68;return db[_0x972d('0x46')]['transaction'](function(_0x494000){return db[_0x972d('0x29')][_0x972d('0x45')](_0x1958f2[_0x972d('0x44')],{'transaction':_0x494000})['then'](function(_0x493c77){_0x1a3d68=_0x493c77;var _0x2a40a5={'type':db[_0x972d('0x47')][_0x972d('0x48')],'transaction':_0x494000};switch(_0x1958f2[_0x972d('0x44')][_0x972d('0x2c')]){case _0x972d('0x49'):_0x2a40a5[_0x972d('0x2c')]=db[_0x972d('0x47')][_0x972d('0x48')];break;case'number':_0x2a40a5['type']=db['Sequelize'][_0x972d('0x4a')];break;case _0x972d('0x4b'):_0x2a40a5[_0x972d('0x2c')]=db[_0x972d('0x47')][_0x972d('0x4c')];_0x2a40a5[_0x972d('0x4d')]=![];break;default:}return db[_0x972d('0x46')][_0x972d('0x4e')][_0x972d('0x4f')]('cm_contacts',util[_0x972d('0x50')](_0x972d('0x51'),_0x1a3d68['id']),_0x2a40a5);})[_0x972d('0x24')](function(){return _0x1a3d68;});})[_0x972d('0x24')](respondWithResult(_0x2f4d5b,0xc9))['catch'](handleError(_0x2f4d5b,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 32b723d..662fa8c 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 _0x6caf=['cm_custom_fields','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6caf,0x90));var _0xf6ca=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x6caf[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0xf6ca('0x0'));var util=require(_0xf6ca('0x1'));var logger=require(_0xf6ca('0x2'))('api');var moment=require(_0xf6ca('0x3'));var BPromise=require(_0xf6ca('0x4'));var rp=require(_0xf6ca('0x5'));var fs=require('fs');var path=require(_0xf6ca('0x6'));var rimraf=require(_0xf6ca('0x7'));var config=require(_0xf6ca('0x8'));var attributes=require(_0xf6ca('0x9'));module['exports']=function(_0x1b6097,_0x4042a9){return _0x1b6097['define']('CmCustomField',attributes,{'tableName':_0xf6ca('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a4b=['bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','define','api','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0a4b,0x14b));var _0xb0a4=function(_0x4acb16,_0x34d1c4){_0x4acb16=_0x4acb16-0x0;var _0x221d2a=_0x0a4b[_0x4acb16];return _0x221d2a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb0a4('0x0'));var moment=require(_0xb0a4('0x1'));var BPromise=require(_0xb0a4('0x2'));var rp=require(_0xb0a4('0x3'));var fs=require('fs');var path=require(_0xb0a4('0x4'));var rimraf=require(_0xb0a4('0x5'));var config=require(_0xb0a4('0x6'));var attributes=require(_0xb0a4('0x7'));module['exports']=function(_0x5f4975,_0x4f56fa){return _0x5f4975[_0xb0a4('0x8')]('CmCustomField',attributes,{'tableName':'cm_custom_fields','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 cb36499..cae77a9 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 _0x579c=['message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5ac06f,_0x41f6ff){var _0x44f3c2=function(_0x3e1cf1){while(--_0x3e1cf1){_0x5ac06f['push'](_0x5ac06f['shift']());}};_0x44f3c2(++_0x41f6ff);}(_0x579c,0xda));var _0xc579=function(_0x22ba1e,_0x4b25fd){_0x22ba1e=_0x22ba1e-0x0;var _0x3b42e4=_0x579c[_0x22ba1e];return _0x3b42e4;};'use strict';var _=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var moment=require(_0xc579('0x2'));var BPromise=require(_0xc579('0x3'));var rs=require(_0xc579('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc579('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc579('0x6'))(_0xc579('0x7'));var config=require(_0xc579('0x8'));var jayson=require(_0xc579('0x9'));var client=jayson[_0xc579('0xa')][_0xc579('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e451b,_0x585167,_0x1c6d9c){return new BPromise(function(_0x293c4a,_0x2ce949){return client[_0xc579('0xc')](_0x2e451b,_0x1c6d9c)[_0xc579('0xd')](function(_0x44b151){logger[_0xc579('0xe')](_0xc579('0xf'),_0x585167,'request\x20sent');logger[_0xc579('0x10')](_0xc579('0x11'),_0x585167,_0xc579('0x12'),JSON[_0xc579('0x13')](_0x44b151));if(_0x44b151[_0xc579('0x14')]){if(_0x44b151[_0xc579('0x14')][_0xc579('0x15')]===0x1f4){logger[_0xc579('0x14')](_0xc579('0xf'),_0x585167,_0x44b151[_0xc579('0x14')][_0xc579('0x16')]);return _0x2ce949(_0x44b151['error'][_0xc579('0x16')]);}logger['error'](_0xc579('0xf'),_0x585167,_0x44b151['error'][_0xc579('0x16')]);return _0x293c4a(_0x44b151['error'][_0xc579('0x16')]);}else{logger['info'](_0xc579('0xf'),_0x585167,_0xc579('0x12'));_0x293c4a(_0x44b151['result']['message']);}})[_0xc579('0x17')](function(_0x2abc55){logger[_0xc579('0x14')](_0xc579('0xf'),_0x585167,_0x2abc55);_0x2ce949(_0x2abc55);});});} \ No newline at end of file +var _0x68fc=['stringify','error','code','message','result','lodash','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3612ef,_0x5ee0f1){var _0x4e8abb=function(_0x15f5db){while(--_0x15f5db){_0x3612ef['push'](_0x3612ef['shift']());}};_0x4e8abb(++_0x5ee0f1);}(_0x68fc,0xa5));var _0xc68f=function(_0x40ef2b,_0x5de4c3){_0x40ef2b=_0x40ef2b-0x0;var _0x21694a=_0x68fc[_0x40ef2b];return _0x21694a;};'use strict';var _=require(_0xc68f('0x0'));var util=require(_0xc68f('0x1'));var moment=require(_0xc68f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc68f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc68f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc68f('0x5'));var jayson=require(_0xc68f('0x6'));var client=jayson[_0xc68f('0x7')][_0xc68f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4fcce4,_0x4a6f7d,_0x9f2705){return new BPromise(function(_0x2bf3fd,_0x370977){return client[_0xc68f('0x9')](_0x4fcce4,_0x9f2705)[_0xc68f('0xa')](function(_0x1ee022){logger[_0xc68f('0xb')](_0xc68f('0xc'),_0x4a6f7d,_0xc68f('0xd'));logger[_0xc68f('0xe')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x4a6f7d,_0xc68f('0xd'),JSON[_0xc68f('0xf')](_0x1ee022));if(_0x1ee022[_0xc68f('0x10')]){if(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x11')]===0x1f4){logger[_0xc68f('0x10')](_0xc68f('0xc'),_0x4a6f7d,_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);return _0x370977(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);}logger['error'](_0xc68f('0xc'),_0x4a6f7d,_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);return _0x2bf3fd(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);}else{logger[_0xc68f('0xb')](_0xc68f('0xc'),_0x4a6f7d,_0xc68f('0xd'));_0x2bf3fd(_0x1ee022[_0xc68f('0x13')]['message']);}})['catch'](function(_0x3a6c06){logger[_0xc68f('0x10')](_0xc68f('0xc'),_0x4a6f7d,_0x3a6c06);_0x370977(_0x3a6c06);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index f221e54..ade7032 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 _0xde47=['index','get','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','isAuthenticated'];(function(_0x423acc,_0x702fd1){var _0x51eefe=function(_0x2c7499){while(--_0x2c7499){_0x423acc['push'](_0x423acc['shift']());}};_0x51eefe(++_0x702fd1);}(_0xde47,0x185));var _0x7de4=function(_0x2d7226,_0x35edb1){_0x2d7226=_0x2d7226-0x0;var _0x59b03f=_0xde47[_0x2d7226];return _0x59b03f;};'use strict';var multer=require(_0x7de4('0x0'));var util=require(_0x7de4('0x1'));var path=require(_0x7de4('0x2'));var timeout=require(_0x7de4('0x3'));var express=require('express');var router=express[_0x7de4('0x4')]();var auth=require(_0x7de4('0x5'));var interaction=require(_0x7de4('0x6'));var config=require(_0x7de4('0x7'));var controller=require(_0x7de4('0x8'));router['get']('/',auth[_0x7de4('0x9')](),controller[_0x7de4('0xa')]);router[_0x7de4('0xb')](_0x7de4('0xc'),auth[_0x7de4('0x9')](),controller[_0x7de4('0xd')]);router['post']('/',auth[_0x7de4('0x9')](),controller[_0x7de4('0xe')]);router[_0x7de4('0xf')](_0x7de4('0xc'),auth['isAuthenticated'](),controller[_0x7de4('0x10')]);router['delete'](_0x7de4('0xc'),auth['isAuthenticated'](),controller[_0x7de4('0x11')]);module[_0x7de4('0x12')]=router; \ No newline at end of file +var _0x083f=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x083f,0xd1));var _0xf083=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x083f[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0xf083('0x0'));var util=require(_0xf083('0x1'));var path=require(_0xf083('0x2'));var timeout=require(_0xf083('0x3'));var express=require(_0xf083('0x4'));var router=express[_0xf083('0x5')]();var auth=require(_0xf083('0x6'));var interaction=require(_0xf083('0x7'));var config=require(_0xf083('0x8'));var controller=require(_0xf083('0x9'));router[_0xf083('0xa')]('/',auth[_0xf083('0xb')](),controller[_0xf083('0xc')]);router[_0xf083('0xa')](_0xf083('0xd'),auth[_0xf083('0xb')](),controller[_0xf083('0xe')]);router[_0xf083('0xf')]('/',auth[_0xf083('0xb')](),controller[_0xf083('0x10')]);router[_0xf083('0x11')](_0xf083('0xd'),auth[_0xf083('0xb')](),controller[_0xf083('0x12')]);router['delete'](_0xf083('0xd'),auth[_0xf083('0xb')](),controller[_0xf083('0x13')]);module[_0xf083('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 33e9e88..d2b2465 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 _0x9c5a=['format','INTEGER','contactListQueue','moment','sequelize','STRING','BOOLEAN','DATE'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x196040,_0x49a032){_0x196040=_0x196040-0x0;var _0x540ad5=_0x9c5a[_0x196040];return _0x540ad5;};'use strict';var moment=require(_0xa9c5('0x0'));var Sequelize=require(_0xa9c5('0x1'));module['exports']={'phone':{'type':Sequelize[_0xa9c5('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xa9c5('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xa9c5('0x4')],'defaultValue':moment()[_0xa9c5('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xa9c5('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa9c5('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xa9c5('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa9c5('0x4')]},'priority':{'type':Sequelize[_0xa9c5('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xa9c5('0x6')],'unique':_0xa9c5('0x7')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xa9c5('0x7')},'UserId':{'type':Sequelize[_0xa9c5('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xa9c5('0x7')},'CampaignId':{'type':Sequelize[_0xa9c5('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa9c5('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa9c5('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa9c5('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3435=['moment','sequelize','exports','STRING','BOOLEAN','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue'];(function(_0x3af9ad,_0x2ebcb4){var _0x1b85da=function(_0x556d87){while(--_0x556d87){_0x3af9ad['push'](_0x3af9ad['shift']());}};_0x1b85da(++_0x2ebcb4);}(_0x3435,0xfa));var _0x5343=function(_0x2becba,_0x4ea656){_0x2becba=_0x2becba-0x0;var _0x90b5dd=_0x3435[_0x2becba];return _0x90b5dd;};'use strict';var moment=require(_0x5343('0x0'));var Sequelize=require(_0x5343('0x1'));module[_0x5343('0x2')]={'phone':{'type':Sequelize[_0x5343('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x5343('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x5343('0x5')],'defaultValue':moment()['format'](_0x5343('0x6'))},'countbusyretry':{'type':Sequelize[_0x5343('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x5343('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5343('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x5343('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x5343('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x5343('0x7')],'unique':_0x5343('0x9')},'ListId':{'type':Sequelize[_0x5343('0x7')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x5343('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x5343('0x9')},'CampaignId':{'type':Sequelize[_0x5343('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x5343('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5343('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5343('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5343('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 3314609..7209ce9 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 _0x3c55=['campaigntype','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','outbound','sequelize','YYYY-MM-DD\x20HH:mm:ss','direction','isEmpty','hopperIds','priority','ASC','scheduledAt','dialOrderByScheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','Contact','CmCompany','Company','CmList','List','dialActive','update','getOpenContacts','getVoiceQueues','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','rimraf','fast-json-patch','moment','bluebird','sox','to-csv','ejs','squel','crypto','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','then','destroy','error','name','send','CmHopper','rawAttributes','fieldName','type','model','query','keys','intersection','filters','concat','$and','$or','$gt','$lte','$ne','$between','$notBetween','$in','$notLike','$iLike','$notILike','$like','$overlap','$contains','$contained','$any','attributes','fields','length','nolimit','sort','pick','filter','merge','where','options','includeAll','include','rows','show','params','find','create','body','catch','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','state','statedesc','deleted','campaign','membername','user','UserId','format','calleridnum','phone'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0x3c55,0x131));var _0x53c5=function(_0x526360,_0x2d33bd){_0x526360=_0x526360-0x0;var _0x15d868=_0x3c55[_0x526360];return _0x15d868;};'use strict';var pdf=require(_0x53c5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x53c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x53c5('0x2'));var rp=require('request-promise');var moment=require(_0x53c5('0x3'));var BPromise=require(_0x53c5('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x53c5('0x5'));var csv=require(_0x53c5('0x6'));var ejs=require(_0x53c5('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x53c5('0x8'));var crypto=require(_0x53c5('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x53c5('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x53c5('0xa'));var qs=require('../../components/parsers/qs');var as=require(_0x53c5('0xb'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x53c5('0xc'));var utils=require('../../config/utils');var config=require(_0x53c5('0xd'));var db=require(_0x53c5('0xe'))['db'];function respondWithStatusCode(_0xd39be0,_0x267312){_0x267312=_0x267312||0xcc;return function(_0xb40553){if(_0xb40553){return _0xd39be0[_0x53c5('0xf')](_0x267312);}return _0xd39be0[_0x53c5('0x10')](_0x267312)[_0x53c5('0x11')]();};}function respondWithResult(_0x366ed3,_0x5a1191){_0x5a1191=_0x5a1191||0xc8;return function(_0x48217d){if(_0x48217d){return _0x366ed3[_0x53c5('0x10')](_0x5a1191)['json'](_0x48217d);}};}function respondWithFilteredResult(_0x3b0228,_0xa0d0fb){return function(_0xe4ada){if(_0xe4ada){var _0xecffbe=_0xe4ada[_0x53c5('0x12')],_0x4a8f0=_0xa0d0fb[_0x53c5('0x13')],_0x53eb52=_0xa0d0fb[_0x53c5('0x13')]+_0xa0d0fb[_0x53c5('0x14')],_0x534273;if(_0x53eb52>=_0xecffbe){_0x53eb52=_0xecffbe;_0x534273=0xc8;}else{_0x534273=0xce;}_0x3b0228[_0x53c5('0x10')](_0x534273);return _0x3b0228[_0x53c5('0x15')](_0x53c5('0x16'),_0x4a8f0+'-'+_0x53eb52+'/'+_0xecffbe)[_0x53c5('0x17')](_0xe4ada);}return null;};}function patchUpdates(_0x3c2f89){return function(_0xa72cd7){try{jsonpatch[_0x53c5('0x18')](_0xa72cd7,_0x3c2f89,!![]);}catch(_0xf0ab90){return BPromise['reject'](_0xf0ab90);}return _0xa72cd7[_0x53c5('0x19')]();};}function saveUpdates(_0x445754,_0x42db07){return function(_0x21de4e){if(_0x21de4e){return _0x21de4e['update'](_0x445754)[_0x53c5('0x1a')](function(_0x27339a){return _0x27339a;});}return null;};}function removeEntity(_0xfa9445,_0x11fbf1){return function(_0x27b740){if(_0x27b740){return _0x27b740[_0x53c5('0x1b')]()[_0x53c5('0x1a')](function(){_0xfa9445[_0x53c5('0x10')](0xcc)[_0x53c5('0x11')]();});}};}function handleEntityNotFound(_0x279dcb,_0x304ebd){return function(_0x4ef65d){if(!_0x4ef65d){_0x279dcb[_0x53c5('0xf')](0x194);}return _0x4ef65d;};}function handleError(_0x3f75c0,_0x2ce3b7){_0x2ce3b7=_0x2ce3b7||0x1f4;return function(_0x2a3b5c){logger[_0x53c5('0x1c')](_0x2a3b5c['stack']);if(_0x2a3b5c[_0x53c5('0x1d')]){delete _0x2a3b5c[_0x53c5('0x1d')];}_0x3f75c0[_0x53c5('0x10')](_0x2ce3b7)[_0x53c5('0x1e')](_0x2a3b5c);};}exports['index']=function(_0x5f5437,_0x315389){var _0x558b09={},_0x458900={},_0x456983={'count':0x0,'rows':[]};var _0x478aa0=_['map'](db[_0x53c5('0x1f')][_0x53c5('0x20')],function(_0x1aec90){return{'name':_0x1aec90[_0x53c5('0x21')],'type':_0x1aec90[_0x53c5('0x22')]['key']};});_0x458900[_0x53c5('0x23')]=_['map'](_0x478aa0,'name');_0x458900[_0x53c5('0x24')]=_[_0x53c5('0x25')](_0x5f5437[_0x53c5('0x24')]);_0x458900['filters']=_[_0x53c5('0x26')](_0x458900[_0x53c5('0x23')],_0x458900[_0x53c5('0x24')]);_0x458900[_0x53c5('0x27')]=_[_0x53c5('0x28')](_0x458900['filters'],[_0x53c5('0x29'),_0x53c5('0x2a'),_0x53c5('0x2b'),'$gte','$lt',_0x53c5('0x2c'),_0x53c5('0x2d'),'$eq','$not',_0x53c5('0x2e'),_0x53c5('0x2f'),_0x53c5('0x30'),'$notIn','$like',_0x53c5('0x31'),_0x53c5('0x32'),_0x53c5('0x33'),_0x53c5('0x34'),_0x53c5('0x35'),_0x53c5('0x36'),_0x53c5('0x37'),_0x53c5('0x38')]);_0x558b09[_0x53c5('0x39')]=_[_0x53c5('0x26')](_0x458900['model'],qs[_0x53c5('0x3a')](_0x5f5437[_0x53c5('0x24')][_0x53c5('0x3a')]));_0x558b09['attributes']=_0x558b09[_0x53c5('0x39')][_0x53c5('0x3b')]?_0x558b09[_0x53c5('0x39')]:_0x458900[_0x53c5('0x23')];if(!_0x5f5437['query']['hasOwnProperty'](_0x53c5('0x3c'))){_0x558b09[_0x53c5('0x14')]=qs['limit'](_0x5f5437['query']['limit']);_0x558b09[_0x53c5('0x13')]=qs[_0x53c5('0x13')](_0x5f5437[_0x53c5('0x24')]['offset']);}_0x558b09['order']=qs[_0x53c5('0x3d')](_0x5f5437[_0x53c5('0x24')][_0x53c5('0x3d')]);_0x558b09['where']=qs[_0x53c5('0x27')](_[_0x53c5('0x3e')](_0x5f5437[_0x53c5('0x24')],_0x458900[_0x53c5('0x27')]));if(_0x5f5437['query'][_0x53c5('0x3f')]){_0x558b09['where']=_[_0x53c5('0x40')](_0x558b09[_0x53c5('0x41')],{'$or':_['map'](_0x478aa0,function(_0x53f4d5){if(_0x53f4d5[_0x53c5('0x22')]!=='VIRTUAL'){var _0x343944={};_0x343944[_0x53f4d5[_0x53c5('0x1d')]]={'$like':'%'+_0x5f5437['query'][_0x53c5('0x3f')]+'%'};return _0x343944;}})});}_0x558b09=_[_0x53c5('0x40')]({},_0x558b09,_0x5f5437[_0x53c5('0x42')]);var _0x5e18aa={'where':_0x558b09['where']};return db[_0x53c5('0x1f')]['count'](_0x5e18aa)[_0x53c5('0x1a')](function(_0x230571){_0x456983['count']=_0x230571;if(_0x5f5437[_0x53c5('0x24')][_0x53c5('0x43')]){_0x558b09[_0x53c5('0x44')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x558b09);})[_0x53c5('0x1a')](function(_0x1dfc0c){_0x456983[_0x53c5('0x45')]=_0x1dfc0c;return _0x456983;})[_0x53c5('0x1a')](respondWithFilteredResult(_0x315389,_0x558b09))['catch'](handleError(_0x315389,null));};exports[_0x53c5('0x46')]=function(_0x5b906c,_0x2f7ac7){var _0x19e912={'raw':!![],'where':{'id':_0x5b906c[_0x53c5('0x47')]['id']}},_0x4391fe={};_0x4391fe[_0x53c5('0x23')]=_['keys'](db['CmHopper'][_0x53c5('0x20')]);_0x4391fe[_0x53c5('0x24')]=_[_0x53c5('0x25')](_0x5b906c['query']);_0x4391fe['filters']=_[_0x53c5('0x26')](_0x4391fe[_0x53c5('0x23')],_0x4391fe[_0x53c5('0x24')]);_0x19e912[_0x53c5('0x39')]=_[_0x53c5('0x26')](_0x4391fe[_0x53c5('0x23')],qs[_0x53c5('0x3a')](_0x5b906c['query']['fields']));_0x19e912[_0x53c5('0x39')]=_0x19e912[_0x53c5('0x39')][_0x53c5('0x3b')]?_0x19e912[_0x53c5('0x39')]:_0x4391fe[_0x53c5('0x23')];if(_0x5b906c[_0x53c5('0x24')][_0x53c5('0x43')]){_0x19e912[_0x53c5('0x44')]=[{'all':!![]}];}_0x19e912=_[_0x53c5('0x40')]({},_0x19e912,_0x5b906c[_0x53c5('0x42')]);return db[_0x53c5('0x1f')][_0x53c5('0x48')](_0x19e912)[_0x53c5('0x1a')](handleEntityNotFound(_0x2f7ac7,null))[_0x53c5('0x1a')](respondWithResult(_0x2f7ac7,null))['catch'](handleError(_0x2f7ac7,null));};exports[_0x53c5('0x49')]=function(_0x37059a,_0x7470d3){return db[_0x53c5('0x1f')][_0x53c5('0x49')](_0x37059a[_0x53c5('0x4a')],{})[_0x53c5('0x1a')](respondWithResult(_0x7470d3,0xc9))['catch'](handleError(_0x7470d3,null));};exports['update']=function(_0xf7e173,_0x4d9c96){if(_0xf7e173['body']['id']){delete _0xf7e173[_0x53c5('0x4a')]['id'];}return db[_0x53c5('0x1f')][_0x53c5('0x48')]({'where':{'id':_0xf7e173[_0x53c5('0x47')]['id']}})[_0x53c5('0x1a')](handleEntityNotFound(_0x4d9c96,null))[_0x53c5('0x1a')](saveUpdates(_0xf7e173[_0x53c5('0x4a')],null))[_0x53c5('0x1a')](respondWithResult(_0x4d9c96,null))[_0x53c5('0x4b')](handleError(_0x4d9c96,null));};exports[_0x53c5('0x4c')]=function(_0x546bdf,_0x374698){return db[_0x53c5('0x1f')]['describe']()[_0x53c5('0x1a')](respondWithResult(_0x374698,null))[_0x53c5('0x4b')](handleError(_0x374698,null));};exports['destroy']=function(_0x42c315,_0x3f7da1){var _0x28563f;return db[_0x53c5('0x1f')]['find']({'where':{'id':_0x42c315[_0x53c5('0x47')]['id']}})[_0x53c5('0x1a')](handleEntityNotFound(_0x3f7da1,null))['then'](function(_0x36671a){if(_0x36671a){return _0x36671a['destroy']()[_0x53c5('0x1a')](function(_0x520ab8){return _0x520ab8;});}})['then'](function(_0x3947fc){_0x28563f=_0x3947fc;if(_0x3947fc){if(_0x3947fc[_0x53c5('0x4d')]||_0x3947fc[_0x53c5('0x4e')]){return db[_0x3947fc[_0x53c5('0x4d')]?_0x53c5('0x4f'):_0x53c5('0x50')][_0x53c5('0x48')]({'where':{'id':_0x3947fc[_0x53c5('0x4d')]?_0x3947fc['VoiceQueueId']:_0x3947fc[_0x53c5('0x4e')]},'attributes':['id',_0x53c5('0x1d')],'raw':!![]});}}})[_0x53c5('0x1a')](function(_0x156faa){var _0x197602={};if(_0x156faa){_['merge'](_0x197602,_[_0x53c5('0x51')](_0x28563f[_0x53c5('0x52')],[_0x53c5('0x53'),'updatedAt','id']));_0x197602[_0x53c5('0x54')]=0x15;_0x197602[_0x53c5('0x55')]=_0x53c5('0x56');_0x197602[_0x53c5('0x57')]=_0x156faa[_0x53c5('0x1d')];_0x197602[_0x53c5('0x58')]=_0x42c315[_0x53c5('0x59')][_0x53c5('0x1d')];_0x197602[_0x53c5('0x5a')]=_0x42c315[_0x53c5('0x59')]['id'];_0x197602[_0x53c5('0x56')]=!![];_0x197602['deletedat']=moment()[_0x53c5('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x197602[_0x53c5('0x5c')]=_0x28563f[_0x53c5('0x5d')];_0x197602[_0x53c5('0x5e')]=_0x28563f[_0x53c5('0x4d')]?'queue':_0x53c5('0x5f');return db[_0x53c5('0x60')]['find']({'where':{'id':_0x197602[_0x53c5('0x61')]},'attributes':[_0x53c5('0x62'),_0x53c5('0x63')]})['then'](function(_0x42be03){if(!_[_0x53c5('0x64')](_0x3f7da1)&&!_[_0x53c5('0x64')](_0x42be03[_0x53c5('0x62')])){_0x197602['calleridname']=_0x42be03[_0x53c5('0x62')];if(!_[_0x53c5('0x64')](_0x42be03[_0x53c5('0x63')])){_0x197602[_0x53c5('0x65')]+='\x20'+_0x42be03['lastName'];}}})[_0x53c5('0x66')](function(){return db[_0x53c5('0x67')][_0x53c5('0x49')](_0x197602);});}})[_0x53c5('0x1a')](function(){return _0x3f7da1[_0x53c5('0x10')](0xcc)['end']();})[_0x53c5('0x4b')](handleError(_0x3f7da1,null));};exports[_0x53c5('0x68')]=function(_0x2aa36f,_0x276100,_0x105cfd){var _0x3dfd17=[];return db[_0x53c5('0x60')]['describe']()['then'](function(_0x55be50){_0x3dfd17=_[_0x53c5('0x25')](_0x55be50);return _0x2aa36f[_0x53c5('0x59')]['getVoiceQueues']({'where':{'type':_0x53c5('0x69'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})[_0x53c5('0x1a')](function(_0x2a4108){if(_0x2a4108&&_0x2a4108[_0x53c5('0x3b')]){return db[_0x53c5('0x6a')]['transaction'](function(_0x453a9c){var _0x364378={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x53c5('0x5b')](_0x53c5('0x6b'))},'VoiceQueueId':{'$in':_['map'](_0x2a4108,'id')},'$or':[{'UserId':null},{'UserId':_0x2aa36f[_0x53c5('0x59')]['id']}]};var _0x39c1f4=[];if(_0x2aa36f['body'][_0x53c5('0x6c')]&&_0x2aa36f['body']['direction']==='prev'){if(!_[_0x53c5('0x6d')](_0x2aa36f['body'][_0x53c5('0x6e')])){_0x364378['id']={'$in':_0x2aa36f[_0x53c5('0x4a')][_0x53c5('0x6e')]};}_0x39c1f4=[[_0x53c5('0x6f'),_0x53c5('0x70')],[_0x53c5('0x71'),_0x2a4108[0x0][_0x53c5('0x72')]===_0x53c5('0x70')?'DESC':_0x53c5('0x70')],db[_0x53c5('0x6a')][_0x53c5('0x73')](_0x53c5('0x74')),['id',_0x53c5('0x75')]];}else{if(!_[_0x53c5('0x6d')](_0x2aa36f[_0x53c5('0x4a')]['hopperIds'])){_0x364378['id']={'$notIn':_0x2aa36f[_0x53c5('0x4a')][_0x53c5('0x6e')]};}_0x39c1f4=[[_0x53c5('0x6f'),_0x53c5('0x75')],['scheduledAt',_0x2a4108[0x0][_0x53c5('0x72')]],db[_0x53c5('0x6a')]['literal'](_0x53c5('0x76')),['id',_0x53c5('0x70')]];}return db['CmHopper'][_0x53c5('0x77')]({'attributes':['id','scheduledat'],'where':_0x364378,'order':_0x39c1f4,'transaction':_0x453a9c,'lock':_0x453a9c[_0x53c5('0x78')]['UPDATE'],'include':[{'model':db[_0x53c5('0x60')],'as':_0x53c5('0x79'),'attributes':_0x3dfd17,'include':[{'model':db[_0x53c5('0x7a')],'as':_0x53c5('0x7b'),'attributes':['id',_0x53c5('0x1d')]}]},{'model':db[_0x53c5('0x7c')],'as':_0x53c5('0x7d'),'attributes':['id',_0x53c5('0x1d')]},{'model':db[_0x53c5('0x4f')],'as':'Queue','attributes':['id',_0x53c5('0x1d'),_0x53c5('0x7e')]}]})[_0x53c5('0x1a')](function(_0x133f89){if(_0x133f89){return _0x133f89[_0x53c5('0x7f')]({'UserId':_0x2aa36f['user']['id']},{'transaction':_0x453a9c});}});});}})['then'](handleEntityNotFound(_0x276100,null))[_0x53c5('0x1a')](respondWithResult(_0x276100,null))[_0x53c5('0x4b')](handleError(_0x276100,null));};exports[_0x53c5('0x80')]=function(_0x57bc5d,_0x4d7e20,_0x252a07){return _0x57bc5d['user'][_0x53c5('0x81')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x53c5('0x1a')](function(_0x29f58a){if(_0x29f58a&&_0x29f58a[_0x53c5('0x3b')]){return db[_0x53c5('0x1f')][_0x53c5('0x12')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x53c5('0x5b')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x29f58a,'id')},'$or':[{'UserId':null},{'UserId':_0x57bc5d['user']['id']}]}});}return 0x0;})[_0x53c5('0x1a')](function(_0x3d8cf1){if(!_[_0x53c5('0x64')](_0x3d8cf1)&&_[_0x53c5('0x82')](_0x3d8cf1)){return _0x4d7e20[_0x53c5('0x10')](0xc8)[_0x53c5('0x17')]({'contacts':_0x3d8cf1});}else{logger[_0x53c5('0x1c')](_0x53c5('0x83'),_0x53c5('0x80'),0x194,_0x53c5('0x84'));_0x4d7e20[_0x53c5('0xf')](0x194);}})[_0x53c5('0x4b')](handleError(_0x4d7e20,null));}; \ No newline at end of file +var _0x7ce0=['createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','deletedat','phone','campaigntype','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','format','direction','prev','isEmpty','hopperIds','priority','scheduledAt','DESC','ASC','COALESCE(CmHopper.UserId,\x200)\x20ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','Contact','Company','List','Queue','getOpenContacts','getVoiceQueues','entity\x20not\x20found','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','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/logger','api','../../config/utils','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','CmHopper','fieldName','type','key','query','keys','filters','intersection','model','$and','$or','$gt','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','include','rows','catch','show','params','rawAttributes','fields','options','find','create','body','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x7ce0,0x14d));var _0x07ce=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0x7ce0[_0x421196];return _0x2738af;};'use strict';var pdf=require(_0x07ce('0x0'));var emlformat=require(_0x07ce('0x1'));var rimraf=require(_0x07ce('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x07ce('0x3'));var rp=require(_0x07ce('0x4'));var moment=require('moment');var BPromise=require(_0x07ce('0x5'));var Mustache=require(_0x07ce('0x6'));var util=require(_0x07ce('0x7'));var path=require(_0x07ce('0x8'));var sox=require(_0x07ce('0x9'));var csv=require(_0x07ce('0xa'));var ejs=require(_0x07ce('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x07ce('0xc'));var crypto=require(_0x07ce('0xd'));var jsforce=require(_0x07ce('0xe'));var deskjs=require(_0x07ce('0xf'));var toCsv=require(_0x07ce('0xa'));var querystring=require(_0x07ce('0x10'));var Papa=require(_0x07ce('0x11'));var Redis=require('ioredis');var authService=require(_0x07ce('0x12'));var qs=require(_0x07ce('0x13'));var as=require(_0x07ce('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x07ce('0x15'))(_0x07ce('0x16'));var utils=require(_0x07ce('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x163ea2,_0x307c7c){_0x307c7c=_0x307c7c||0xcc;return function(_0x5bbd73){if(_0x5bbd73){return _0x163ea2['sendStatus'](_0x307c7c);}return _0x163ea2[_0x07ce('0x18')](_0x307c7c)[_0x07ce('0x19')]();};}function respondWithResult(_0x341796,_0x4c177f){_0x4c177f=_0x4c177f||0xc8;return function(_0x4ab204){if(_0x4ab204){return _0x341796[_0x07ce('0x18')](_0x4c177f)[_0x07ce('0x1a')](_0x4ab204);}};}function respondWithFilteredResult(_0x59c07d,_0x51d80f){return function(_0x789026){if(_0x789026){var _0x2158d5=_0x789026[_0x07ce('0x1b')],_0x1c0325=_0x51d80f['offset'],_0xd4e1de=_0x51d80f[_0x07ce('0x1c')]+_0x51d80f[_0x07ce('0x1d')],_0x3dc41f;if(_0xd4e1de>=_0x2158d5){_0xd4e1de=_0x2158d5;_0x3dc41f=0xc8;}else{_0x3dc41f=0xce;}_0x59c07d['status'](_0x3dc41f);return _0x59c07d[_0x07ce('0x1e')](_0x07ce('0x1f'),_0x1c0325+'-'+_0xd4e1de+'/'+_0x2158d5)[_0x07ce('0x1a')](_0x789026);}return null;};}function patchUpdates(_0x3d6f6d){return function(_0x1c5af4){try{jsonpatch[_0x07ce('0x20')](_0x1c5af4,_0x3d6f6d,!![]);}catch(_0x6cf73f){return BPromise[_0x07ce('0x21')](_0x6cf73f);}return _0x1c5af4[_0x07ce('0x22')]();};}function saveUpdates(_0x40904b,_0x332e48){return function(_0x5ce0c8){if(_0x5ce0c8){return _0x5ce0c8[_0x07ce('0x23')](_0x40904b)[_0x07ce('0x24')](function(_0x847312){return _0x847312;});}return null;};}function removeEntity(_0x166671,_0x43e748){return function(_0x2e8528){if(_0x2e8528){return _0x2e8528['destroy']()[_0x07ce('0x24')](function(){_0x166671[_0x07ce('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ac40d,_0x200e7b){return function(_0x4af665){if(!_0x4af665){_0x4ac40d[_0x07ce('0x25')](0x194);}return _0x4af665;};}function handleError(_0x550c3a,_0x7f7639){_0x7f7639=_0x7f7639||0x1f4;return function(_0x58ea6a){logger[_0x07ce('0x26')](_0x58ea6a[_0x07ce('0x27')]);if(_0x58ea6a[_0x07ce('0x28')]){delete _0x58ea6a[_0x07ce('0x28')];}_0x550c3a[_0x07ce('0x18')](_0x7f7639)[_0x07ce('0x29')](_0x58ea6a);};}exports[_0x07ce('0x2a')]=function(_0xa37d7f,_0xfdb8bd){var _0x4810e4={},_0x4631ac={},_0x18ae68={'count':0x0,'rows':[]};var _0x217d46=_[_0x07ce('0x2b')](db[_0x07ce('0x2c')]['rawAttributes'],function(_0xe24677){return{'name':_0xe24677[_0x07ce('0x2d')],'type':_0xe24677[_0x07ce('0x2e')][_0x07ce('0x2f')]};});_0x4631ac['model']=_[_0x07ce('0x2b')](_0x217d46,'name');_0x4631ac[_0x07ce('0x30')]=_[_0x07ce('0x31')](_0xa37d7f[_0x07ce('0x30')]);_0x4631ac[_0x07ce('0x32')]=_[_0x07ce('0x33')](_0x4631ac[_0x07ce('0x34')],_0x4631ac[_0x07ce('0x30')]);_0x4631ac[_0x07ce('0x32')]=_['concat'](_0x4631ac[_0x07ce('0x32')],[_0x07ce('0x35'),_0x07ce('0x36'),_0x07ce('0x37'),'$gte',_0x07ce('0x38'),_0x07ce('0x39'),_0x07ce('0x3a'),_0x07ce('0x3b'),_0x07ce('0x3c'),_0x07ce('0x3d'),_0x07ce('0x3e'),_0x07ce('0x3f'),_0x07ce('0x40'),_0x07ce('0x41'),_0x07ce('0x42'),_0x07ce('0x43'),_0x07ce('0x44'),_0x07ce('0x41'),_0x07ce('0x45'),_0x07ce('0x46'),_0x07ce('0x47'),_0x07ce('0x48')]);_0x4810e4[_0x07ce('0x49')]=_[_0x07ce('0x33')](_0x4631ac['model'],qs['fields'](_0xa37d7f[_0x07ce('0x30')]['fields']));_0x4810e4[_0x07ce('0x49')]=_0x4810e4[_0x07ce('0x49')][_0x07ce('0x4a')]?_0x4810e4['attributes']:_0x4631ac[_0x07ce('0x34')];if(!_0xa37d7f[_0x07ce('0x30')][_0x07ce('0x4b')](_0x07ce('0x4c'))){_0x4810e4[_0x07ce('0x1d')]=qs[_0x07ce('0x1d')](_0xa37d7f[_0x07ce('0x30')][_0x07ce('0x1d')]);_0x4810e4[_0x07ce('0x1c')]=qs['offset'](_0xa37d7f['query']['offset']);}_0x4810e4[_0x07ce('0x4d')]=qs[_0x07ce('0x4e')](_0xa37d7f[_0x07ce('0x30')]['sort']);_0x4810e4[_0x07ce('0x4f')]=qs['filters'](_['pick'](_0xa37d7f[_0x07ce('0x30')],_0x4631ac['filters']));if(_0xa37d7f[_0x07ce('0x30')]['filter']){_0x4810e4[_0x07ce('0x4f')]=_[_0x07ce('0x50')](_0x4810e4[_0x07ce('0x4f')],{'$or':_[_0x07ce('0x2b')](_0x217d46,function(_0x2fc496){if(_0x2fc496['type']!==_0x07ce('0x51')){var _0x4b5644={};_0x4b5644[_0x2fc496['name']]={'$like':'%'+_0xa37d7f[_0x07ce('0x30')][_0x07ce('0x52')]+'%'};return _0x4b5644;}})});}_0x4810e4=_[_0x07ce('0x50')]({},_0x4810e4,_0xa37d7f['options']);var _0x35ed1d={'where':_0x4810e4[_0x07ce('0x4f')]};return db['CmHopper'][_0x07ce('0x1b')](_0x35ed1d)[_0x07ce('0x24')](function(_0x4e0d80){_0x18ae68[_0x07ce('0x1b')]=_0x4e0d80;if(_0xa37d7f[_0x07ce('0x30')]['includeAll']){_0x4810e4[_0x07ce('0x53')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x4810e4);})[_0x07ce('0x24')](function(_0x29a6e7){_0x18ae68[_0x07ce('0x54')]=_0x29a6e7;return _0x18ae68;})[_0x07ce('0x24')](respondWithFilteredResult(_0xfdb8bd,_0x4810e4))[_0x07ce('0x55')](handleError(_0xfdb8bd,null));};exports[_0x07ce('0x56')]=function(_0x1ccc02,_0x520b04){var _0x276249={'raw':!![],'where':{'id':_0x1ccc02[_0x07ce('0x57')]['id']}},_0x25f6d1={};_0x25f6d1[_0x07ce('0x34')]=_[_0x07ce('0x31')](db[_0x07ce('0x2c')][_0x07ce('0x58')]);_0x25f6d1[_0x07ce('0x30')]=_[_0x07ce('0x31')](_0x1ccc02[_0x07ce('0x30')]);_0x25f6d1[_0x07ce('0x32')]=_[_0x07ce('0x33')](_0x25f6d1[_0x07ce('0x34')],_0x25f6d1[_0x07ce('0x30')]);_0x276249[_0x07ce('0x49')]=_[_0x07ce('0x33')](_0x25f6d1['model'],qs[_0x07ce('0x59')](_0x1ccc02[_0x07ce('0x30')]['fields']));_0x276249[_0x07ce('0x49')]=_0x276249[_0x07ce('0x49')][_0x07ce('0x4a')]?_0x276249[_0x07ce('0x49')]:_0x25f6d1[_0x07ce('0x34')];if(_0x1ccc02['query']['includeAll']){_0x276249[_0x07ce('0x53')]=[{'all':!![]}];}_0x276249=_[_0x07ce('0x50')]({},_0x276249,_0x1ccc02[_0x07ce('0x5a')]);return db['CmHopper'][_0x07ce('0x5b')](_0x276249)[_0x07ce('0x24')](handleEntityNotFound(_0x520b04,null))[_0x07ce('0x24')](respondWithResult(_0x520b04,null))[_0x07ce('0x55')](handleError(_0x520b04,null));};exports[_0x07ce('0x5c')]=function(_0x4ae598,_0x5b97a6){return db[_0x07ce('0x2c')][_0x07ce('0x5c')](_0x4ae598[_0x07ce('0x5d')],{})[_0x07ce('0x24')](respondWithResult(_0x5b97a6,0xc9))['catch'](handleError(_0x5b97a6,null));};exports[_0x07ce('0x23')]=function(_0x4c905a,_0x23eb7e){if(_0x4c905a[_0x07ce('0x5d')]['id']){delete _0x4c905a[_0x07ce('0x5d')]['id'];}return db[_0x07ce('0x2c')][_0x07ce('0x5b')]({'where':{'id':_0x4c905a[_0x07ce('0x57')]['id']}})[_0x07ce('0x24')](handleEntityNotFound(_0x23eb7e,null))[_0x07ce('0x24')](saveUpdates(_0x4c905a[_0x07ce('0x5d')],null))[_0x07ce('0x24')](respondWithResult(_0x23eb7e,null))[_0x07ce('0x55')](handleError(_0x23eb7e,null));};exports[_0x07ce('0x5e')]=function(_0x208cd4,_0x9ab40d){return db[_0x07ce('0x2c')]['describe']()[_0x07ce('0x24')](respondWithResult(_0x9ab40d,null))[_0x07ce('0x55')](handleError(_0x9ab40d,null));};exports[_0x07ce('0x5f')]=function(_0x33687a,_0x80effc){var _0x343fd0;return db['CmHopper'][_0x07ce('0x5b')]({'where':{'id':_0x33687a[_0x07ce('0x57')]['id']}})['then'](handleEntityNotFound(_0x80effc,null))['then'](function(_0x3f24c1){if(_0x3f24c1){return _0x3f24c1['destroy']()['then'](function(_0x784ccc){return _0x784ccc;});}})[_0x07ce('0x24')](function(_0x4beea5){_0x343fd0=_0x4beea5;if(_0x4beea5){if(_0x4beea5['VoiceQueueId']||_0x4beea5[_0x07ce('0x60')]){return db[_0x4beea5[_0x07ce('0x61')]?_0x07ce('0x62'):_0x07ce('0x63')]['find']({'where':{'id':_0x4beea5[_0x07ce('0x61')]?_0x4beea5[_0x07ce('0x61')]:_0x4beea5[_0x07ce('0x60')]},'attributes':['id',_0x07ce('0x28')],'raw':!![]});}}})['then'](function(_0xb30a3d){var _0x21dc17={};if(_0xb30a3d){_['merge'](_0x21dc17,_[_0x07ce('0x64')](_0x343fd0[_0x07ce('0x65')],[_0x07ce('0x66'),_0x07ce('0x67'),'id']));_0x21dc17[_0x07ce('0x68')]=0x15;_0x21dc17[_0x07ce('0x69')]=_0x07ce('0x6a');_0x21dc17[_0x07ce('0x6b')]=_0xb30a3d[_0x07ce('0x28')];_0x21dc17[_0x07ce('0x6c')]=_0x33687a['user'][_0x07ce('0x28')];_0x21dc17['UserId']=_0x33687a[_0x07ce('0x6d')]['id'];_0x21dc17[_0x07ce('0x6a')]=!![];_0x21dc17[_0x07ce('0x6e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x21dc17['calleridnum']=_0x343fd0[_0x07ce('0x6f')];_0x21dc17[_0x07ce('0x70')]=_0x343fd0[_0x07ce('0x61')]?'queue':'ivr';return db[_0x07ce('0x71')][_0x07ce('0x5b')]({'where':{'id':_0x21dc17[_0x07ce('0x72')]},'attributes':[_0x07ce('0x73'),_0x07ce('0x74')]})[_0x07ce('0x24')](function(_0x111097){if(!_[_0x07ce('0x75')](_0x80effc)&&!_['isNil'](_0x111097[_0x07ce('0x73')])){_0x21dc17[_0x07ce('0x76')]=_0x111097[_0x07ce('0x73')];if(!_['isNil'](_0x111097[_0x07ce('0x74')])){_0x21dc17[_0x07ce('0x76')]+='\x20'+_0x111097['lastName'];}}})[_0x07ce('0x77')](function(){return db['CmHopperFinal']['create'](_0x21dc17);});}})[_0x07ce('0x24')](function(){return _0x80effc[_0x07ce('0x18')](0xcc)['end']();})[_0x07ce('0x55')](handleError(_0x80effc,null));};exports['getPreview']=function(_0x3b249a,_0x5a45e1,_0x28570f){var _0x2492d9=[];return db[_0x07ce('0x71')][_0x07ce('0x5e')]()[_0x07ce('0x24')](function(_0x59cd40){_0x2492d9=_['keys'](_0x59cd40);return _0x3b249a[_0x07ce('0x6d')]['getVoiceQueues']({'where':{'type':_0x07ce('0x78'),'dialActive':!![],'dialMethod':_0x07ce('0x79')},'attributes':['id',_0x07ce('0x7a')],'raw':!![]});})[_0x07ce('0x24')](function(_0x76f739){if(_0x76f739&&_0x76f739[_0x07ce('0x4a')]){return db[_0x07ce('0x7b')][_0x07ce('0x7c')](function(_0x1b94c8){var _0x51edbc={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x07ce('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x07ce('0x2b')](_0x76f739,'id')},'$or':[{'UserId':null},{'UserId':_0x3b249a['user']['id']}]};var _0x2f573f=[];if(_0x3b249a[_0x07ce('0x5d')][_0x07ce('0x7e')]&&_0x3b249a[_0x07ce('0x5d')][_0x07ce('0x7e')]===_0x07ce('0x7f')){if(!_[_0x07ce('0x80')](_0x3b249a[_0x07ce('0x5d')][_0x07ce('0x81')])){_0x51edbc['id']={'$in':_0x3b249a[_0x07ce('0x5d')][_0x07ce('0x81')]};}_0x2f573f=[[_0x07ce('0x82'),'ASC'],[_0x07ce('0x83'),_0x76f739[0x0][_0x07ce('0x7a')]==='ASC'?_0x07ce('0x84'):_0x07ce('0x85')],db[_0x07ce('0x7b')]['literal'](_0x07ce('0x86')),['id',_0x07ce('0x84')]];}else{if(!_[_0x07ce('0x80')](_0x3b249a[_0x07ce('0x5d')][_0x07ce('0x81')])){_0x51edbc['id']={'$notIn':_0x3b249a[_0x07ce('0x5d')][_0x07ce('0x81')]};}_0x2f573f=[[_0x07ce('0x82'),_0x07ce('0x84')],[_0x07ce('0x83'),_0x76f739[0x0][_0x07ce('0x7a')]],db[_0x07ce('0x7b')][_0x07ce('0x87')](_0x07ce('0x88')),['id',_0x07ce('0x85')]];}return db[_0x07ce('0x2c')][_0x07ce('0x89')]({'attributes':['id','scheduledat'],'where':_0x51edbc,'order':_0x2f573f,'transaction':_0x1b94c8,'lock':_0x1b94c8['LOCK']['UPDATE'],'include':[{'model':db[_0x07ce('0x71')],'as':_0x07ce('0x8a'),'attributes':_0x2492d9,'include':[{'model':db['CmCompany'],'as':_0x07ce('0x8b'),'attributes':['id',_0x07ce('0x28')]}]},{'model':db['CmList'],'as':_0x07ce('0x8c'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':_0x07ce('0x8d'),'attributes':['id',_0x07ce('0x28'),'dialActive']}]})['then'](function(_0x1035ee){if(_0x1035ee){return _0x1035ee['update']({'UserId':_0x3b249a[_0x07ce('0x6d')]['id']},{'transaction':_0x1b94c8});}});});}})[_0x07ce('0x24')](handleEntityNotFound(_0x5a45e1,null))[_0x07ce('0x24')](respondWithResult(_0x5a45e1,null))['catch'](handleError(_0x5a45e1,null));};exports[_0x07ce('0x8e')]=function(_0x106555,_0x326c63,_0x4f79ae){return _0x106555[_0x07ce('0x6d')][_0x07ce('0x8f')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x07ce('0x79')},'attributes':['id'],'raw':!![]})[_0x07ce('0x24')](function(_0xc95de6){if(_0xc95de6&&_0xc95de6['length']){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x07ce('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x07ce('0x2b')](_0xc95de6,'id')},'$or':[{'UserId':null},{'UserId':_0x106555[_0x07ce('0x6d')]['id']}]}});}return 0x0;})[_0x07ce('0x24')](function(_0x3edfe5){if(!_[_0x07ce('0x75')](_0x3edfe5)&&_['isNumber'](_0x3edfe5)){return _0x326c63[_0x07ce('0x18')](0xc8)[_0x07ce('0x1a')]({'contacts':_0x3edfe5});}else{logger[_0x07ce('0x26')]('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,_0x07ce('0x90'));_0x326c63[_0x07ce('0x25')](0x194);}})[_0x07ce('0x55')](handleError(_0x326c63,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index e15dd20..e0e91dd 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 _0x1ad3=['priority','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./cmHopper.attributes','exports','define','cm_hopper','scheduledat','phone'];(function(_0x49fbd8,_0x80d004){var _0x4d398f=function(_0x4f49d1){while(--_0x4f49d1){_0x49fbd8['push'](_0x49fbd8['shift']());}};_0x4d398f(++_0x80d004);}(_0x1ad3,0x14b));var _0x31ad=function(_0xe0b81f,_0x1fb734){_0xe0b81f=_0xe0b81f-0x0;var _0x290e5e=_0x1ad3[_0xe0b81f];return _0x290e5e;};'use strict';var _=require(_0x31ad('0x0'));var util=require(_0x31ad('0x1'));var logger=require(_0x31ad('0x2'))(_0x31ad('0x3'));var moment=require(_0x31ad('0x4'));var BPromise=require(_0x31ad('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x31ad('0x6'));var rimraf=require('rimraf');var config=require(_0x31ad('0x7'));var attributes=require(_0x31ad('0x8'));module[_0x31ad('0x9')]=function(_0x113525,_0x21c914){return _0x113525[_0x31ad('0xa')]('CmHopper',attributes,{'tableName':_0x31ad('0xb'),'paranoid':![],'indexes':[{'name':_0x31ad('0xc'),'fields':['scheduledat']},{'name':_0x31ad('0xd'),'fields':[_0x31ad('0xd')]},{'name':_0x31ad('0xe'),'fields':[_0x31ad('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0198=['define','cm_hopper','scheduledat','priority','util','../../config/logger','moment','request-promise','../../config/environment','./cmHopper.attributes','exports'];(function(_0x540e2a,_0x104322){var _0x1f7b2e=function(_0x427a3a){while(--_0x427a3a){_0x540e2a['push'](_0x540e2a['shift']());}};_0x1f7b2e(++_0x104322);}(_0x0198,0xca));var _0x8019=function(_0x27ddf5,_0x5a3e18){_0x27ddf5=_0x27ddf5-0x0;var _0x26e74a=_0x0198[_0x27ddf5];return _0x26e74a;};'use strict';var _=require('lodash');var util=require(_0x8019('0x0'));var logger=require(_0x8019('0x1'))('api');var moment=require(_0x8019('0x2'));var BPromise=require('bluebird');var rp=require(_0x8019('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8019('0x4'));var attributes=require(_0x8019('0x5'));module[_0x8019('0x6')]=function(_0x9cd605,_0x1f5f8c){return _0x9cd605[_0x8019('0x7')]('CmHopper',attributes,{'tableName':_0x8019('0x8'),'paranoid':![],'indexes':[{'name':_0x8019('0x9'),'fields':['scheduledat']},{'name':'phone','fields':['phone']},{'name':_0x8019('0xa'),'fields':[_0x8019('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index c74716a..18b534b 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(_0x48a0a1,_0x3c6f34){_0x48a0a1=_0x48a0a1-0x0;var _0x2aa583=_0x7a54[_0x48a0a1];return _0x2aa583;};'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(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7a54,0x106));var _0x47a5=function(_0x2494e8,_0x482aa2){_0x2494e8=_0x2494e8-0x0;var _0x7b8681=_0x7a54[_0x2494e8];return _0x7b8681;};'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 dcc65ac..e078ccd 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 _0xdf5d=['create','post','/preview','getPreview','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/:id','show'];(function(_0x4a92f7,_0x24e95d){var _0x30a7a5=function(_0x4a7bb5){while(--_0x4a7bb5){_0x4a92f7['push'](_0x4a92f7['shift']());}};_0x30a7a5(++_0x24e95d);}(_0xdf5d,0x126));var _0xddf5=function(_0x337f0b,_0x2773df){_0x337f0b=_0x337f0b-0x0;var _0x55744d=_0xdf5d[_0x337f0b];return _0x55744d;};'use strict';var multer=require(_0xddf5('0x0'));var util=require(_0xddf5('0x1'));var path=require(_0xddf5('0x2'));var timeout=require(_0xddf5('0x3'));var express=require(_0xddf5('0x4'));var router=express[_0xddf5('0x5')]();var auth=require(_0xddf5('0x6'));var interaction=require(_0xddf5('0x7'));var config=require('../../config/environment');var controller=require(_0xddf5('0x8'));router[_0xddf5('0x9')]('/',auth[_0xddf5('0xa')](),controller[_0xddf5('0xb')]);router[_0xddf5('0x9')](_0xddf5('0xc'),auth[_0xddf5('0xa')](),controller[_0xddf5('0xd')]);router[_0xddf5('0x9')](_0xddf5('0xe'),auth[_0xddf5('0xa')](),controller[_0xddf5('0xf')]);router[_0xddf5('0x9')](_0xddf5('0x10'),auth[_0xddf5('0xa')](),controller[_0xddf5('0x11')]);router['post']('/',auth[_0xddf5('0xa')](),controller[_0xddf5('0x12')]);router[_0xddf5('0x13')](_0xddf5('0x14'),auth[_0xddf5('0xa')](),controller[_0xddf5('0x15')]);router[_0xddf5('0x16')](_0xddf5('0x10'),auth['isAuthenticated'](),controller['update']);router[_0xddf5('0x17')](_0xddf5('0x10'),auth[_0xddf5('0xa')](),controller[_0xddf5('0x18')]);module[_0xddf5('0x19')]=router; \ No newline at end of file +var _0x1c7c=['describe','/opencontacts','getOpenContacts','/:id','post','/preview','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe'];(function(_0x3444a3,_0x499c2c){var _0x45b967=function(_0x302cf6){while(--_0x302cf6){_0x3444a3['push'](_0x3444a3['shift']());}};_0x45b967(++_0x499c2c);}(_0x1c7c,0x164));var _0xc1c7=function(_0x307720,_0x1cf933){_0x307720=_0x307720-0x0;var _0xd13d0=_0x1c7c[_0x307720];return _0xd13d0;};'use strict';var multer=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var path=require(_0xc1c7('0x2'));var timeout=require(_0xc1c7('0x3'));var express=require('express');var router=express[_0xc1c7('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc1c7('0x5'));var config=require(_0xc1c7('0x6'));var controller=require(_0xc1c7('0x7'));router[_0xc1c7('0x8')]('/',auth[_0xc1c7('0x9')](),controller[_0xc1c7('0xa')]);router[_0xc1c7('0x8')](_0xc1c7('0xb'),auth[_0xc1c7('0x9')](),controller[_0xc1c7('0xc')]);router[_0xc1c7('0x8')](_0xc1c7('0xd'),auth[_0xc1c7('0x9')](),controller[_0xc1c7('0xe')]);router[_0xc1c7('0x8')](_0xc1c7('0xf'),auth[_0xc1c7('0x9')](),controller['show']);router[_0xc1c7('0x10')]('/',auth[_0xc1c7('0x9')](),controller['create']);router[_0xc1c7('0x10')](_0xc1c7('0x11'),auth[_0xc1c7('0x9')](),controller['getPreview']);router[_0xc1c7('0x12')](_0xc1c7('0xf'),auth[_0xc1c7('0x9')](),controller[_0xc1c7('0x13')]);router[_0xc1c7('0x14')](_0xc1c7('0xf'),auth[_0xc1c7('0x9')](),controller[_0xc1c7('0x15')]);module[_0xc1c7('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index a94ee49..a77ae20 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 _0x1d10=['INTEGER','contactListQueue','moment','sequelize','STRING'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x1d10,0x8e));var _0x01d1=function(_0x57fbf3,_0x1558c9){_0x57fbf3=_0x57fbf3-0x0;var _0x105755=_0x1d10[_0x57fbf3];return _0x105755;};'use strict';var moment=require(_0x01d1('0x0'));var Sequelize=require(_0x01d1('0x1'));module['exports']={'phone':{'type':Sequelize[_0x01d1('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x01d1('0x3')],'unique':_0x01d1('0x4')},'ListId':{'type':Sequelize[_0x01d1('0x3')],'unique':_0x01d1('0x4')},'VoiceQueueId':{'type':Sequelize[_0x01d1('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x9b36=['INTEGER','moment','sequelize','exports','STRING','contactListQueue'];(function(_0x401cb0,_0x19e457){var _0x5a2215=function(_0x3d5189){while(--_0x3d5189){_0x401cb0['push'](_0x401cb0['shift']());}};_0x5a2215(++_0x19e457);}(_0x9b36,0x1ed));var _0x69b3=function(_0x2abd2b,_0x30241d){_0x2abd2b=_0x2abd2b-0x0;var _0x5debf3=_0x9b36[_0x2abd2b];return _0x5debf3;};'use strict';var moment=require(_0x69b3('0x0'));var Sequelize=require(_0x69b3('0x1'));module[_0x69b3('0x2')]={'phone':{'type':Sequelize[_0x69b3('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x69b3('0x4')},'ListId':{'type':Sequelize[_0x69b3('0x5')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x69b3('0x5')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index ac63803..1b478dc 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 _0xd08d=['../../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','send','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','CmHopperBlack','findAll','rows','catch','show','rawAttributes','length','include','options','find','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd08d,0x81));var _0xdd08=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xd08d[_0x525c7b];return _0x27b33e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdd08('0x0'));var rimraf=require(_0xdd08('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdd08('0x2'));var rp=require(_0xdd08('0x3'));var moment=require(_0xdd08('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdd08('0x5'));var util=require(_0xdd08('0x6'));var path=require(_0xdd08('0x7'));var sox=require('sox');var csv=require(_0xdd08('0x8'));var ejs=require(_0xdd08('0x9'));var fs=require('fs');var _=require(_0xdd08('0xa'));var squel=require(_0xdd08('0xb'));var crypto=require(_0xdd08('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdd08('0xd'));var toCsv=require(_0xdd08('0x8'));var querystring=require(_0xdd08('0xe'));var Papa=require('papaparse');var Redis=require(_0xdd08('0xf'));var authService=require(_0xdd08('0x10'));var qs=require(_0xdd08('0x11'));var as=require(_0xdd08('0x12'));var hardwareService=require(_0xdd08('0x13'));var logger=require(_0xdd08('0x14'))(_0xdd08('0x15'));var utils=require(_0xdd08('0x16'));var config=require(_0xdd08('0x17'));var db=require(_0xdd08('0x18'))['db'];function respondWithStatusCode(_0x20a566,_0x1543c8){_0x1543c8=_0x1543c8||0xcc;return function(_0x4bf79b){if(_0x4bf79b){return _0x20a566[_0xdd08('0x19')](_0x1543c8);}return _0x20a566[_0xdd08('0x1a')](_0x1543c8)[_0xdd08('0x1b')]();};}function respondWithResult(_0x240f3b,_0x415169){_0x415169=_0x415169||0xc8;return function(_0x3ed0d1){if(_0x3ed0d1){return _0x240f3b[_0xdd08('0x1a')](_0x415169)[_0xdd08('0x1c')](_0x3ed0d1);}};}function respondWithFilteredResult(_0x7417dd,_0x11aad3){return function(_0x2fc29c){if(_0x2fc29c){var _0x9a6225=_0x2fc29c[_0xdd08('0x1d')],_0x784541=_0x11aad3[_0xdd08('0x1e')],_0xe7a7c9=_0x11aad3[_0xdd08('0x1e')]+_0x11aad3[_0xdd08('0x1f')],_0x46838e;if(_0xe7a7c9>=_0x9a6225){_0xe7a7c9=_0x9a6225;_0x46838e=0xc8;}else{_0x46838e=0xce;}_0x7417dd[_0xdd08('0x1a')](_0x46838e);return _0x7417dd[_0xdd08('0x20')]('Content-Range',_0x784541+'-'+_0xe7a7c9+'/'+_0x9a6225)['json'](_0x2fc29c);}return null;};}function patchUpdates(_0x435dc4){return function(_0xcdad2e){try{jsonpatch[_0xdd08('0x21')](_0xcdad2e,_0x435dc4,!![]);}catch(_0x47d653){return BPromise['reject'](_0x47d653);}return _0xcdad2e[_0xdd08('0x22')]();};}function saveUpdates(_0x13de65,_0x1cfc12){return function(_0x4a587b){if(_0x4a587b){return _0x4a587b[_0xdd08('0x23')](_0x13de65)[_0xdd08('0x24')](function(_0x344e48){return _0x344e48;});}return null;};}function removeEntity(_0x12f5d3,_0x5c9ebe){return function(_0x4f807b){if(_0x4f807b){return _0x4f807b[_0xdd08('0x25')]()['then'](function(){_0x12f5d3[_0xdd08('0x1a')](0xcc)[_0xdd08('0x1b')]();});}};}function handleEntityNotFound(_0x5f0166,_0x4b1be1){return function(_0x2f3361){if(!_0x2f3361){_0x5f0166[_0xdd08('0x19')](0x194);}return _0x2f3361;};}function handleError(_0x56a337,_0x37b095){_0x37b095=_0x37b095||0x1f4;return function(_0x53afa1){logger[_0xdd08('0x26')](_0x53afa1[_0xdd08('0x27')]);if(_0x53afa1['name']){delete _0x53afa1[_0xdd08('0x28')];}_0x56a337[_0xdd08('0x1a')](_0x37b095)[_0xdd08('0x29')](_0x53afa1);};}exports['index']=function(_0x5d67d2,_0x13d1ab){var _0x879dcb={},_0x26cbf8={},_0x268304={'count':0x0,'rows':[]};var _0x3e9b2f=_[_0xdd08('0x2a')](db['CmHopperBlack']['rawAttributes'],function(_0x2aaf75){return{'name':_0x2aaf75[_0xdd08('0x2b')],'type':_0x2aaf75[_0xdd08('0x2c')][_0xdd08('0x2d')]};});_0x26cbf8[_0xdd08('0x2e')]=_[_0xdd08('0x2a')](_0x3e9b2f,_0xdd08('0x28'));_0x26cbf8['query']=_[_0xdd08('0x2f')](_0x5d67d2[_0xdd08('0x30')]);_0x26cbf8[_0xdd08('0x31')]=_[_0xdd08('0x32')](_0x26cbf8[_0xdd08('0x2e')],_0x26cbf8[_0xdd08('0x30')]);_0x879dcb[_0xdd08('0x33')]=_[_0xdd08('0x32')](_0x26cbf8['model'],qs['fields'](_0x5d67d2[_0xdd08('0x30')][_0xdd08('0x34')]));_0x879dcb[_0xdd08('0x33')]=_0x879dcb['attributes']['length']?_0x879dcb[_0xdd08('0x33')]:_0x26cbf8[_0xdd08('0x2e')];if(!_0x5d67d2[_0xdd08('0x30')][_0xdd08('0x35')](_0xdd08('0x36'))){_0x879dcb[_0xdd08('0x1f')]=qs[_0xdd08('0x1f')](_0x5d67d2['query'][_0xdd08('0x1f')]);_0x879dcb[_0xdd08('0x1e')]=qs[_0xdd08('0x1e')](_0x5d67d2[_0xdd08('0x30')][_0xdd08('0x1e')]);}_0x879dcb[_0xdd08('0x37')]=qs[_0xdd08('0x38')](_0x5d67d2['query'][_0xdd08('0x38')]);_0x879dcb['where']=qs['filters'](_['pick'](_0x5d67d2[_0xdd08('0x30')],_0x26cbf8['filters']));if(_0x5d67d2[_0xdd08('0x30')][_0xdd08('0x39')]){_0x879dcb[_0xdd08('0x3a')]=_['merge'](_0x879dcb[_0xdd08('0x3a')],{'$or':_['map'](_0x3e9b2f,function(_0x58b675){if(_0x58b675['type']!==_0xdd08('0x3b')){var _0x2311b3={};_0x2311b3[_0x58b675[_0xdd08('0x28')]]={'$like':'%'+_0x5d67d2[_0xdd08('0x30')][_0xdd08('0x39')]+'%'};return _0x2311b3;}})});}_0x879dcb=_[_0xdd08('0x3c')]({},_0x879dcb,_0x5d67d2['options']);var _0x36d557={'where':_0x879dcb[_0xdd08('0x3a')]};return db[_0xdd08('0x3d')]['count'](_0x36d557)['then'](function(_0x2ced9b){_0x268304[_0xdd08('0x1d')]=_0x2ced9b;if(_0x5d67d2['query']['includeAll']){_0x879dcb['include']=[{'all':!![]}];}return db[_0xdd08('0x3d')][_0xdd08('0x3e')](_0x879dcb);})['then'](function(_0xe1dfa6){_0x268304[_0xdd08('0x3f')]=_0xe1dfa6;return _0x268304;})['then'](respondWithFilteredResult(_0x13d1ab,_0x879dcb))[_0xdd08('0x40')](handleError(_0x13d1ab,null));};exports[_0xdd08('0x41')]=function(_0x553b5a,_0xf740c4){var _0x58f39e={'raw':!![],'where':{'id':_0x553b5a['params']['id']}},_0x4807a0={};_0x4807a0[_0xdd08('0x2e')]=_[_0xdd08('0x2f')](db[_0xdd08('0x3d')][_0xdd08('0x42')]);_0x4807a0[_0xdd08('0x30')]=_['keys'](_0x553b5a[_0xdd08('0x30')]);_0x4807a0[_0xdd08('0x31')]=_['intersection'](_0x4807a0[_0xdd08('0x2e')],_0x4807a0[_0xdd08('0x30')]);_0x58f39e['attributes']=_[_0xdd08('0x32')](_0x4807a0[_0xdd08('0x2e')],qs[_0xdd08('0x34')](_0x553b5a[_0xdd08('0x30')][_0xdd08('0x34')]));_0x58f39e['attributes']=_0x58f39e['attributes'][_0xdd08('0x43')]?_0x58f39e[_0xdd08('0x33')]:_0x4807a0[_0xdd08('0x2e')];if(_0x553b5a[_0xdd08('0x30')]['includeAll']){_0x58f39e[_0xdd08('0x44')]=[{'all':!![]}];}_0x58f39e=_[_0xdd08('0x3c')]({},_0x58f39e,_0x553b5a[_0xdd08('0x45')]);return db[_0xdd08('0x3d')][_0xdd08('0x46')](_0x58f39e)[_0xdd08('0x24')](handleEntityNotFound(_0xf740c4,null))[_0xdd08('0x24')](respondWithResult(_0xf740c4,null))[_0xdd08('0x40')](handleError(_0xf740c4,null));};exports[_0xdd08('0x23')]=function(_0x54c85b,_0x324997){if(_0x54c85b[_0xdd08('0x47')]['id']){delete _0x54c85b[_0xdd08('0x47')]['id'];}return db['CmHopperBlack'][_0xdd08('0x46')]({'where':{'id':_0x54c85b['params']['id']}})[_0xdd08('0x24')](handleEntityNotFound(_0x324997,null))['then'](saveUpdates(_0x54c85b['body'],null))['then'](respondWithResult(_0x324997,null))['catch'](handleError(_0x324997,null));};exports[_0xdd08('0x25')]=function(_0x315275,_0x419c1b){return db[_0xdd08('0x3d')]['find']({'where':{'id':_0x315275[_0xdd08('0x48')]['id']}})['then'](handleEntityNotFound(_0x419c1b,null))[_0xdd08('0x24')](removeEntity(_0x419c1b,null))[_0xdd08('0x40')](handleError(_0x419c1b,null));};exports[_0xdd08('0x49')]=function(_0x78c399,_0x1d3a9e){return db[_0xdd08('0x3d')]['describe']()[_0xdd08('0x24')](respondWithResult(_0x1d3a9e,null))[_0xdd08('0x40')](handleError(_0x1d3a9e,null));}; \ No newline at end of file +var _0xd509=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','body','destroy','describe','catch','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch'];(function(_0x1f48e4,_0x49017d){var _0xe61052=function(_0x1e6e97){while(--_0x1e6e97){_0x1f48e4['push'](_0x1f48e4['shift']());}};_0xe61052(++_0x49017d);}(_0xd509,0xc9));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x9d50('0x0'));var zipdir=require(_0x9d50('0x1'));var jsonpatch=require(_0x9d50('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9d50('0x3'));var Mustache=require(_0x9d50('0x4'));var util=require('util');var path=require(_0x9d50('0x5'));var sox=require(_0x9d50('0x6'));var csv=require(_0x9d50('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9d50('0x8'));var squel=require('squel');var crypto=require(_0x9d50('0x9'));var jsforce=require(_0x9d50('0xa'));var deskjs=require(_0x9d50('0xb'));var toCsv=require(_0x9d50('0x7'));var querystring=require(_0x9d50('0xc'));var Papa=require('papaparse');var Redis=require(_0x9d50('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9d50('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d50('0xf'))(_0x9d50('0x10'));var utils=require(_0x9d50('0x11'));var config=require(_0x9d50('0x12'));var db=require(_0x9d50('0x13'))['db'];function respondWithStatusCode(_0xd92a70,_0x3bc884){_0x3bc884=_0x3bc884||0xcc;return function(_0x5c1d1b){if(_0x5c1d1b){return _0xd92a70[_0x9d50('0x14')](_0x3bc884);}return _0xd92a70['status'](_0x3bc884)[_0x9d50('0x15')]();};}function respondWithResult(_0x450777,_0x1fcdd7){_0x1fcdd7=_0x1fcdd7||0xc8;return function(_0x2fd96b){if(_0x2fd96b){return _0x450777[_0x9d50('0x16')](_0x1fcdd7)[_0x9d50('0x17')](_0x2fd96b);}};}function respondWithFilteredResult(_0x339598,_0x3c115b){return function(_0x25f253){if(_0x25f253){var _0x304b42=_0x25f253[_0x9d50('0x18')],_0x38d651=_0x3c115b[_0x9d50('0x19')],_0x441b11=_0x3c115b[_0x9d50('0x19')]+_0x3c115b[_0x9d50('0x1a')],_0x4f39ab;if(_0x441b11>=_0x304b42){_0x441b11=_0x304b42;_0x4f39ab=0xc8;}else{_0x4f39ab=0xce;}_0x339598[_0x9d50('0x16')](_0x4f39ab);return _0x339598[_0x9d50('0x1b')](_0x9d50('0x1c'),_0x38d651+'-'+_0x441b11+'/'+_0x304b42)[_0x9d50('0x17')](_0x25f253);}return null;};}function patchUpdates(_0x9c7a90){return function(_0x2d5619){try{jsonpatch[_0x9d50('0x1d')](_0x2d5619,_0x9c7a90,!![]);}catch(_0x161b40){return BPromise[_0x9d50('0x1e')](_0x161b40);}return _0x2d5619[_0x9d50('0x1f')]();};}function saveUpdates(_0x243f64,_0x8905d3){return function(_0xdedc47){if(_0xdedc47){return _0xdedc47[_0x9d50('0x20')](_0x243f64)[_0x9d50('0x21')](function(_0x3dfe77){return _0x3dfe77;});}return null;};}function removeEntity(_0x18f02d,_0xfcb55e){return function(_0x3febd6){if(_0x3febd6){return _0x3febd6['destroy']()[_0x9d50('0x21')](function(){_0x18f02d[_0x9d50('0x16')](0xcc)[_0x9d50('0x15')]();});}};}function handleEntityNotFound(_0x1adf7d,_0x12ae02){return function(_0x257738){if(!_0x257738){_0x1adf7d[_0x9d50('0x14')](0x194);}return _0x257738;};}function handleError(_0x269837,_0x9f445d){_0x9f445d=_0x9f445d||0x1f4;return function(_0x4c7712){logger[_0x9d50('0x22')](_0x4c7712['stack']);if(_0x4c7712['name']){delete _0x4c7712[_0x9d50('0x23')];}_0x269837[_0x9d50('0x16')](_0x9f445d)[_0x9d50('0x24')](_0x4c7712);};}exports[_0x9d50('0x25')]=function(_0x5b46a4,_0x9623aa){var _0x161c34={},_0x5ce77a={},_0x3db94d={'count':0x0,'rows':[]};var _0x5a52ad=_[_0x9d50('0x26')](db[_0x9d50('0x27')][_0x9d50('0x28')],function(_0x5b3642){return{'name':_0x5b3642[_0x9d50('0x29')],'type':_0x5b3642['type'][_0x9d50('0x2a')]};});_0x5ce77a[_0x9d50('0x2b')]=_[_0x9d50('0x26')](_0x5a52ad,_0x9d50('0x23'));_0x5ce77a[_0x9d50('0x2c')]=_[_0x9d50('0x2d')](_0x5b46a4[_0x9d50('0x2c')]);_0x5ce77a[_0x9d50('0x2e')]=_[_0x9d50('0x2f')](_0x5ce77a['model'],_0x5ce77a[_0x9d50('0x2c')]);_0x161c34['attributes']=_['intersection'](_0x5ce77a[_0x9d50('0x2b')],qs[_0x9d50('0x30')](_0x5b46a4[_0x9d50('0x2c')]['fields']));_0x161c34[_0x9d50('0x31')]=_0x161c34[_0x9d50('0x31')][_0x9d50('0x32')]?_0x161c34[_0x9d50('0x31')]:_0x5ce77a[_0x9d50('0x2b')];if(!_0x5b46a4[_0x9d50('0x2c')][_0x9d50('0x33')](_0x9d50('0x34'))){_0x161c34[_0x9d50('0x1a')]=qs[_0x9d50('0x1a')](_0x5b46a4[_0x9d50('0x2c')][_0x9d50('0x1a')]);_0x161c34[_0x9d50('0x19')]=qs[_0x9d50('0x19')](_0x5b46a4[_0x9d50('0x2c')]['offset']);}_0x161c34[_0x9d50('0x35')]=qs['sort'](_0x5b46a4[_0x9d50('0x2c')]['sort']);_0x161c34[_0x9d50('0x36')]=qs[_0x9d50('0x2e')](_[_0x9d50('0x37')](_0x5b46a4[_0x9d50('0x2c')],_0x5ce77a[_0x9d50('0x2e')]));if(_0x5b46a4['query'][_0x9d50('0x38')]){_0x161c34[_0x9d50('0x36')]=_[_0x9d50('0x39')](_0x161c34[_0x9d50('0x36')],{'$or':_[_0x9d50('0x26')](_0x5a52ad,function(_0x21ec80){if(_0x21ec80[_0x9d50('0x3a')]!==_0x9d50('0x3b')){var _0x555dfa={};_0x555dfa[_0x21ec80[_0x9d50('0x23')]]={'$like':'%'+_0x5b46a4['query'][_0x9d50('0x38')]+'%'};return _0x555dfa;}})});}_0x161c34=_[_0x9d50('0x39')]({},_0x161c34,_0x5b46a4[_0x9d50('0x3c')]);var _0x174a89={'where':_0x161c34[_0x9d50('0x36')]};return db[_0x9d50('0x27')]['count'](_0x174a89)['then'](function(_0x3305f0){_0x3db94d[_0x9d50('0x18')]=_0x3305f0;if(_0x5b46a4[_0x9d50('0x2c')][_0x9d50('0x3d')]){_0x161c34[_0x9d50('0x3e')]=[{'all':!![]}];}return db[_0x9d50('0x27')][_0x9d50('0x3f')](_0x161c34);})[_0x9d50('0x21')](function(_0x70da6){_0x3db94d[_0x9d50('0x40')]=_0x70da6;return _0x3db94d;})[_0x9d50('0x21')](respondWithFilteredResult(_0x9623aa,_0x161c34))['catch'](handleError(_0x9623aa,null));};exports[_0x9d50('0x41')]=function(_0xeba9ae,_0x4d1140){var _0x14e4a7={'raw':!![],'where':{'id':_0xeba9ae[_0x9d50('0x42')]['id']}},_0x436cb5={};_0x436cb5[_0x9d50('0x2b')]=_[_0x9d50('0x2d')](db[_0x9d50('0x27')][_0x9d50('0x28')]);_0x436cb5['query']=_['keys'](_0xeba9ae['query']);_0x436cb5[_0x9d50('0x2e')]=_[_0x9d50('0x2f')](_0x436cb5[_0x9d50('0x2b')],_0x436cb5[_0x9d50('0x2c')]);_0x14e4a7[_0x9d50('0x31')]=_['intersection'](_0x436cb5['model'],qs[_0x9d50('0x30')](_0xeba9ae[_0x9d50('0x2c')][_0x9d50('0x30')]));_0x14e4a7[_0x9d50('0x31')]=_0x14e4a7[_0x9d50('0x31')][_0x9d50('0x32')]?_0x14e4a7[_0x9d50('0x31')]:_0x436cb5[_0x9d50('0x2b')];if(_0xeba9ae[_0x9d50('0x2c')][_0x9d50('0x3d')]){_0x14e4a7['include']=[{'all':!![]}];}_0x14e4a7=_[_0x9d50('0x39')]({},_0x14e4a7,_0xeba9ae[_0x9d50('0x3c')]);return db[_0x9d50('0x27')][_0x9d50('0x43')](_0x14e4a7)[_0x9d50('0x21')](handleEntityNotFound(_0x4d1140,null))['then'](respondWithResult(_0x4d1140,null))['catch'](handleError(_0x4d1140,null));};exports[_0x9d50('0x20')]=function(_0x39aa69,_0x18883b){if(_0x39aa69[_0x9d50('0x44')]['id']){delete _0x39aa69[_0x9d50('0x44')]['id'];}return db['CmHopperBlack'][_0x9d50('0x43')]({'where':{'id':_0x39aa69[_0x9d50('0x42')]['id']}})['then'](handleEntityNotFound(_0x18883b,null))[_0x9d50('0x21')](saveUpdates(_0x39aa69[_0x9d50('0x44')],null))['then'](respondWithResult(_0x18883b,null))['catch'](handleError(_0x18883b,null));};exports[_0x9d50('0x45')]=function(_0xaddd2d,_0x35b699){return db[_0x9d50('0x27')]['find']({'where':{'id':_0xaddd2d['params']['id']}})[_0x9d50('0x21')](handleEntityNotFound(_0x35b699,null))['then'](removeEntity(_0x35b699,null))['catch'](handleError(_0x35b699,null));};exports[_0x9d50('0x46')]=function(_0x42922c,_0x57b14e){return db['CmHopperBlack'][_0x9d50('0x46')]()[_0x9d50('0x21')](respondWithResult(_0x57b14e,null))[_0x9d50('0x47')](handleError(_0x57b14e,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 4b64774..ae1f503 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 _0x32ca=['request-promise','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','cm_hopper_black','lodash','util','moment','bluebird'];(function(_0x1058db,_0x7e3063){var _0x195b98=function(_0x1db9ce){while(--_0x1db9ce){_0x1058db['push'](_0x1058db['shift']());}};_0x195b98(++_0x7e3063);}(_0x32ca,0x96));var _0xa32c=function(_0x1de62e,_0x173bb4){_0x1de62e=_0x1de62e-0x0;var _0x34f094=_0x32ca[_0x1de62e];return _0x34f094;};'use strict';var _=require(_0xa32c('0x0'));var util=require(_0xa32c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa32c('0x2'));var BPromise=require(_0xa32c('0x3'));var rp=require(_0xa32c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa32c('0x5'));var config=require(_0xa32c('0x6'));var attributes=require(_0xa32c('0x7'));module[_0xa32c('0x8')]=function(_0x174d3c,_0x7eab9){return _0x174d3c[_0xa32c('0x9')]('CmHopperBlack',attributes,{'tableName':_0xa32c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc84b=['request-promise','path','rimraf','../../config/environment','exports','define','CmHopperBlack','cm_hopper_black','util','../../config/logger','api','moment','bluebird'];(function(_0x5ab1c2,_0x511b55){var _0x23a0d1=function(_0x5c4483){while(--_0x5c4483){_0x5ab1c2['push'](_0x5ab1c2['shift']());}};_0x23a0d1(++_0x511b55);}(_0xc84b,0x1dc));var _0xbc84=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xc84b[_0x2f45ea];return _0x485a84;};'use strict';var _=require('lodash');var util=require(_0xbc84('0x0'));var logger=require(_0xbc84('0x1'))(_0xbc84('0x2'));var moment=require(_0xbc84('0x3'));var BPromise=require(_0xbc84('0x4'));var rp=require(_0xbc84('0x5'));var fs=require('fs');var path=require(_0xbc84('0x6'));var rimraf=require(_0xbc84('0x7'));var config=require(_0xbc84('0x8'));var attributes=require('./cmHopperBlack.attributes');module[_0xbc84('0x9')]=function(_0x399036,_0x236757){return _0x399036[_0xbc84('0xa')](_0xbc84('0xb'),attributes,{'tableName':_0xbc84('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index cb1aa56..7b37ae3 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 _0xfc2f=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','include','map','model','info','UpdateCmHopperBlack','update','body','limit','DestroyCmHopperBlack','lodash','util','moment','bluebird','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc2f,0x70));var _0xffc2=function(_0x5c13fe,_0x4a71d7){_0x5c13fe=_0x5c13fe-0x0;var _0x1ea093=_0xfc2f[_0x5c13fe];return _0x1ea093;};'use strict';var _=require(_0xffc2('0x0'));var util=require(_0xffc2('0x1'));var moment=require(_0xffc2('0x2'));var BPromise=require(_0xffc2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xffc2('0x4'));var db=require(_0xffc2('0x5'))['db'];var utils=require(_0xffc2('0x6'));var logger=require(_0xffc2('0x7'))(_0xffc2('0x8'));var config=require(_0xffc2('0x9'));var jayson=require(_0xffc2('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x372a46,_0x30b4ad,_0x17c9fd){return new BPromise(function(_0x51517b,_0x4759cd){return client[_0xffc2('0xb')](_0x372a46,_0x17c9fd)[_0xffc2('0xc')](function(_0x463371){logger['info'](_0xffc2('0xd'),_0x30b4ad,_0xffc2('0xe'));logger[_0xffc2('0xf')](_0xffc2('0x10'),_0x30b4ad,_0xffc2('0xe'),JSON[_0xffc2('0x11')](_0x463371));if(_0x463371['error']){if(_0x463371[_0xffc2('0x12')][_0xffc2('0x13')]===0x1f4){logger['error'](_0xffc2('0xd'),_0x30b4ad,_0x463371[_0xffc2('0x12')][_0xffc2('0x14')]);return _0x4759cd(_0x463371['error']['message']);}logger[_0xffc2('0x12')](_0xffc2('0xd'),_0x30b4ad,_0x463371[_0xffc2('0x12')][_0xffc2('0x14')]);return _0x51517b(_0x463371[_0xffc2('0x12')][_0xffc2('0x14')]);}else{logger['info'](_0xffc2('0xd'),_0x30b4ad,'request\x20sent');_0x51517b(_0x463371[_0xffc2('0x15')][_0xffc2('0x14')]);}})[_0xffc2('0x16')](function(_0x330610){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x30b4ad,_0x330610);_0x4759cd(_0x330610);});});}exports[_0xffc2('0x17')]=function(_0x47cfbf){var _0x4b8fba=this;return new Promise(function(_0x14ad70,_0x48e9e4){return db[_0xffc2('0x18')][_0xffc2('0x19')]({'raw':_0x47cfbf[_0xffc2('0x1a')]?_0x47cfbf['options'][_0xffc2('0x1b')]===undefined?!![]:![]:!![],'where':_0x47cfbf[_0xffc2('0x1a')]?_0x47cfbf['options'][_0xffc2('0x1c')]||null:null,'attributes':_0x47cfbf[_0xffc2('0x1a')]?_0x47cfbf[_0xffc2('0x1a')][_0xffc2('0x1d')]||null:null,'limit':_0x47cfbf['options']?_0x47cfbf[_0xffc2('0x1a')]['limit']||null:null,'include':_0x47cfbf[_0xffc2('0x1a')]?_0x47cfbf[_0xffc2('0x1a')][_0xffc2('0x1e')]?_[_0xffc2('0x1f')](_0x47cfbf[_0xffc2('0x1a')][_0xffc2('0x1e')],function(_0x48ae3b){return{'model':db[_0x48ae3b[_0xffc2('0x20')]],'as':_0x48ae3b['as'],'attributes':_0x48ae3b[_0xffc2('0x1d')],'include':_0x48ae3b[_0xffc2('0x1e')]?_[_0xffc2('0x1f')](_0x48ae3b[_0xffc2('0x1e')],function(_0x5b155e){return{'model':db[_0x5b155e[_0xffc2('0x20')]],'as':_0x5b155e['as'],'attributes':_0x5b155e[_0xffc2('0x1d')],'include':_0x5b155e[_0xffc2('0x1e')]?_[_0xffc2('0x1f')](_0x5b155e['include'],function(_0x1aafc1){return{'model':db[_0x1aafc1[_0xffc2('0x20')]],'as':_0x1aafc1['as'],'attributes':_0x1aafc1[_0xffc2('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x53c06f){logger[_0xffc2('0x21')]('GetCmHopperBlack',_0x47cfbf);logger[_0xffc2('0xf')](_0xffc2('0x17'),_0x47cfbf,JSON[_0xffc2('0x11')](_0x53c06f));_0x14ad70(_0x53c06f);})[_0xffc2('0x16')](function(_0x19d628){logger['error'](_0xffc2('0x17'),_0x19d628[_0xffc2('0x14')],_0x47cfbf);_0x48e9e4(_0x4b8fba['error'](0x1f4,_0x19d628[_0xffc2('0x14')]));});});};exports[_0xffc2('0x22')]=function(_0x190256){var _0x189ba3=this;return new Promise(function(_0x1b309d,_0x2a385c){return db[_0xffc2('0x18')][_0xffc2('0x23')](_0x190256[_0xffc2('0x24')],{'raw':_0x190256[_0xffc2('0x1a')]?_0x190256[_0xffc2('0x1a')][_0xffc2('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x190256['options']?_0x190256[_0xffc2('0x1a')][_0xffc2('0x1c')]||null:null,'attributes':_0x190256[_0xffc2('0x1a')]?_0x190256[_0xffc2('0x1a')][_0xffc2('0x1d')]||null:null,'limit':_0x190256[_0xffc2('0x1a')]?_0x190256[_0xffc2('0x1a')][_0xffc2('0x25')]||null:null})[_0xffc2('0xc')](function(_0x555c57){logger[_0xffc2('0x21')](_0xffc2('0x22'),_0x190256);logger[_0xffc2('0xf')]('UpdateCmHopperBlack',_0x190256,JSON['stringify'](_0x555c57));_0x1b309d(_0x555c57);})[_0xffc2('0x16')](function(_0x251e16){logger[_0xffc2('0x12')]('UpdateCmHopperBlack',_0x251e16[_0xffc2('0x14')],_0x190256);_0x2a385c(_0x189ba3['error'](0x1f4,_0x251e16[_0xffc2('0x14')]));});});};exports[_0xffc2('0x26')]=function(_0x120e59){var _0x4a6d23=this;return new Promise(function(_0x41d316,_0x1e02d4){return db[_0xffc2('0x18')]['destroy']({'where':_0x120e59['options']?_0x120e59['options']['where']||null:null})[_0xffc2('0xc')](function(_0x157221){logger[_0xffc2('0x21')](_0xffc2('0x26'),_0x120e59);logger[_0xffc2('0xf')]('DestroyCmHopperBlack',_0x120e59,JSON[_0xffc2('0x11')](_0x157221));_0x41d316(_0x157221);})['catch'](function(_0x1d9e6e){logger['error'](_0xffc2('0x26'),_0x1d9e6e[_0xffc2('0x14')],_0x120e59);_0x1e02d4(_0x4a6d23[_0xffc2('0x12')](0x1f4,_0x1d9e6e[_0xffc2('0x14')]));});});}; \ No newline at end of file +var _0x805d=['attributes','info','stringify','UpdateCmHopperBlack','update','raw','DestroyCmHopperBlack','destroy','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','GetCmHopperBlack','CmHopperBlack','options','where','limit','include','model','map'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0x805d,0x1dd));var _0xd805=function(_0x2a6fdd,_0x1e11e5){_0x2a6fdd=_0x2a6fdd-0x0;var _0x54dd1f=_0x805d[_0x2a6fdd];return _0x54dd1f;};'use strict';var _=require(_0xd805('0x0'));var util=require(_0xd805('0x1'));var moment=require(_0xd805('0x2'));var BPromise=require(_0xd805('0x3'));var rs=require(_0xd805('0x4'));var fs=require('fs');var Redis=require(_0xd805('0x5'));var db=require(_0xd805('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd805('0x7'))(_0xd805('0x8'));var config=require(_0xd805('0x9'));var jayson=require(_0xd805('0xa'));var client=jayson[_0xd805('0xb')][_0xd805('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4203c3,_0x10a984,_0x4d2ec0){return new BPromise(function(_0x50da6f,_0x4920a5){return client[_0xd805('0xd')](_0x4203c3,_0x4d2ec0)[_0xd805('0xe')](function(_0x2745bc){logger['info'](_0xd805('0xf'),_0x10a984,_0xd805('0x10'));logger[_0xd805('0x11')](_0xd805('0x12'),_0x10a984,_0xd805('0x10'),JSON['stringify'](_0x2745bc));if(_0x2745bc[_0xd805('0x13')]){if(_0x2745bc[_0xd805('0x13')][_0xd805('0x14')]===0x1f4){logger[_0xd805('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x10a984,_0x2745bc[_0xd805('0x13')]['message']);return _0x4920a5(_0x2745bc[_0xd805('0x13')]['message']);}logger[_0xd805('0x13')](_0xd805('0xf'),_0x10a984,_0x2745bc[_0xd805('0x13')][_0xd805('0x15')]);return _0x50da6f(_0x2745bc[_0xd805('0x13')][_0xd805('0x15')]);}else{logger['info'](_0xd805('0xf'),_0x10a984,_0xd805('0x10'));_0x50da6f(_0x2745bc['result'][_0xd805('0x15')]);}})['catch'](function(_0x317d6c){logger[_0xd805('0x13')](_0xd805('0xf'),_0x10a984,_0x317d6c);_0x4920a5(_0x317d6c);});});}exports[_0xd805('0x16')]=function(_0xf11e7e){var _0x32e254=this;return new Promise(function(_0x1c4ce0,_0x229134){return db[_0xd805('0x17')]['findAll']({'raw':_0xf11e7e[_0xd805('0x18')]?_0xf11e7e['options']['raw']===undefined?!![]:![]:!![],'where':_0xf11e7e['options']?_0xf11e7e[_0xd805('0x18')][_0xd805('0x19')]||null:null,'attributes':_0xf11e7e[_0xd805('0x18')]?_0xf11e7e['options']['attributes']||null:null,'limit':_0xf11e7e[_0xd805('0x18')]?_0xf11e7e['options'][_0xd805('0x1a')]||null:null,'include':_0xf11e7e['options']?_0xf11e7e[_0xd805('0x18')][_0xd805('0x1b')]?_['map'](_0xf11e7e[_0xd805('0x18')][_0xd805('0x1b')],function(_0x2c70ec){return{'model':db[_0x2c70ec[_0xd805('0x1c')]],'as':_0x2c70ec['as'],'attributes':_0x2c70ec['attributes'],'include':_0x2c70ec['include']?_[_0xd805('0x1d')](_0x2c70ec[_0xd805('0x1b')],function(_0xc91d85){return{'model':db[_0xc91d85[_0xd805('0x1c')]],'as':_0xc91d85['as'],'attributes':_0xc91d85[_0xd805('0x1e')],'include':_0xc91d85['include']?_[_0xd805('0x1d')](_0xc91d85[_0xd805('0x1b')],function(_0x1d3ab8){return{'model':db[_0x1d3ab8[_0xd805('0x1c')]],'as':_0x1d3ab8['as'],'attributes':_0x1d3ab8[_0xd805('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd805('0xe')](function(_0x90567e){logger[_0xd805('0x1f')]('GetCmHopperBlack',_0xf11e7e);logger[_0xd805('0x11')](_0xd805('0x16'),_0xf11e7e,JSON[_0xd805('0x20')](_0x90567e));_0x1c4ce0(_0x90567e);})['catch'](function(_0x1af4fd){logger[_0xd805('0x13')](_0xd805('0x16'),_0x1af4fd[_0xd805('0x15')],_0xf11e7e);_0x229134(_0x32e254[_0xd805('0x13')](0x1f4,_0x1af4fd[_0xd805('0x15')]));});});};exports[_0xd805('0x21')]=function(_0x104a3f){var _0x473bb6=this;return new Promise(function(_0x130c2a,_0x1eaacb){return db['CmHopperBlack'][_0xd805('0x22')](_0x104a3f['body'],{'raw':_0x104a3f[_0xd805('0x18')]?_0x104a3f[_0xd805('0x18')][_0xd805('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x104a3f['options']?_0x104a3f[_0xd805('0x18')][_0xd805('0x19')]||null:null,'attributes':_0x104a3f[_0xd805('0x18')]?_0x104a3f[_0xd805('0x18')][_0xd805('0x1e')]||null:null,'limit':_0x104a3f['options']?_0x104a3f[_0xd805('0x18')][_0xd805('0x1a')]||null:null})['then'](function(_0x37f2d8){logger['info'](_0xd805('0x21'),_0x104a3f);logger[_0xd805('0x11')](_0xd805('0x21'),_0x104a3f,JSON[_0xd805('0x20')](_0x37f2d8));_0x130c2a(_0x37f2d8);})['catch'](function(_0x150482){logger[_0xd805('0x13')](_0xd805('0x21'),_0x150482[_0xd805('0x15')],_0x104a3f);_0x1eaacb(_0x473bb6[_0xd805('0x13')](0x1f4,_0x150482[_0xd805('0x15')]));});});};exports[_0xd805('0x24')]=function(_0x18bcb2){var _0x5b3021=this;return new Promise(function(_0x366265,_0x3737b0){return db['CmHopperBlack'][_0xd805('0x25')]({'where':_0x18bcb2[_0xd805('0x18')]?_0x18bcb2[_0xd805('0x18')]['where']||null:null})[_0xd805('0xe')](function(_0x56a16d){logger['info'](_0xd805('0x24'),_0x18bcb2);logger[_0xd805('0x11')]('DestroyCmHopperBlack',_0x18bcb2,JSON[_0xd805('0x20')](_0x56a16d));_0x366265(_0x56a16d);})[_0xd805('0x26')](function(_0x17fde7){logger[_0xd805('0x13')]('DestroyCmHopperBlack',_0x17fde7['message'],_0x18bcb2);_0x3737b0(_0x5b3021['error'](0x1f4,_0x17fde7[_0xd805('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 351f6c1..7c07784 100644 --- a/server/api/cmHopperBlack/index.js +++ b/server/api/cmHopperBlack/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','put'];(function(_0x25eaaf,_0x1a48d3){var _0x5ba923=function(_0x24feb4){while(--_0x24feb4){_0x25eaaf['push'](_0x25eaaf['shift']());}};_0x5ba923(++_0x1a48d3);}(_0x008c,0x188));var _0xc008=function(_0x276f6d,_0x10a50e){_0x276f6d=_0x276f6d-0x0;var _0xda31b5=_0x008c[_0x276f6d];return _0xda31b5;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var auth=require(_0xc008('0x5'));var interaction=require(_0xc008('0x6'));var config=require(_0xc008('0x7'));var controller=require(_0xc008('0x8'));router[_0xc008('0x9')]('/',auth[_0xc008('0xa')](),controller[_0xc008('0xb')]);router[_0xc008('0x9')](_0xc008('0xc'),auth['isAuthenticated'](),controller[_0xc008('0xd')]);router['get'](_0xc008('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xc008('0xf')](_0xc008('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xe'),auth[_0xc008('0xa')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file +var _0x207c=['./cmHopperBlack.controller','get','/describe','isAuthenticated','/:id','put','update','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3b0c9d,_0x3ddeb5){var _0xcfc8d7=function(_0x320dc6){while(--_0x320dc6){_0x3b0c9d['push'](_0x3b0c9d['shift']());}};_0xcfc8d7(++_0x3ddeb5);}(_0x207c,0x1e8));var _0xc207=function(_0x49fcfb,_0x504dec){_0x49fcfb=_0x49fcfb-0x0;var _0x964926=_0x207c[_0x49fcfb];return _0x964926;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var auth=require(_0xc207('0x5'));var interaction=require(_0xc207('0x6'));var config=require('../../config/environment');var controller=require(_0xc207('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc207('0x8')](_0xc207('0x9'),auth[_0xc207('0xa')](),controller['describe']);router[_0xc207('0x8')](_0xc207('0xb'),auth[_0xc207('0xa')](),controller['show']);router[_0xc207('0xc')](_0xc207('0xb'),auth[_0xc207('0xa')](),controller[_0xc207('0xd')]);router[_0xc207('0xe')](_0xc207('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index f906743..5264e6a 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 _0x8f28=['setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime'];(function(_0x3514f1,_0x450eb3){var _0x581967=function(_0x10d32d){while(--_0x10d32d){_0x3514f1['push'](_0x3514f1['shift']());}};_0x581967(++_0x450eb3);}(_0x8f28,0x6e));var _0x88f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8f28[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x88f2('0x0'));module[_0x88f2('0x1')]={'state':{'type':Sequelize[_0x88f2('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x88f2('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x88f2('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x88f2('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x88f2('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x88f2('0x3')]},'originatecalleridname':{'type':Sequelize[_0x88f2('0x3')]},'calleridnum':{'type':Sequelize[_0x88f2('0x3')]},'calleridname':{'type':Sequelize[_0x88f2('0x3')]},'starttime':{'type':Sequelize[_0x88f2('0x4')]},'responsetime':{'type':Sequelize[_0x88f2('0x4')]},'answertime':{'type':Sequelize[_0x88f2('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x88f2('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x88f2('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x88f2('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x88f2('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x88f2('0x3')]},'membername':{'type':Sequelize[_0x88f2('0x3')]},'reason':{'type':Sequelize[_0x88f2('0x3')]},'disposition':{'type':Sequelize[_0x88f2('0x3')]},'dispositionat':{'type':Sequelize[_0x88f2('0x4')],'set':function(_0x27e34a){var _0x3fe361=this[_0x88f2('0x5')](_0x88f2('0x6'));if(_0x3fe361&&_0x27e34a){this[_0x88f2('0x7')](_0x88f2('0x8'),moment(_0x27e34a)[_0x88f2('0x9')](moment(_0x3fe361),_0x88f2('0xa')));}return this['setDataValue'](_0x88f2('0xb'),_0x27e34a);}},'amd':{'type':Sequelize[_0x88f2('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x88f2('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x88f2('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x88f2('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x88f2('0x4')]},'callback':{'type':Sequelize[_0x88f2('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x88f2('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x88f2('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x88f2('0x4')]},'recallme':{'type':Sequelize[_0x88f2('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x88f2('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x88f2('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x88f2('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x88f2('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x88f2('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb589=['INTEGER','getDataValue','endtime','followuptime','diff','seconds','setDataValue','dispositionat','BOOLEAN','sequelize','moment','STRING','DATE'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xb589,0x19c));var _0x9b58=function(_0x37fbbc,_0xb7338a){_0x37fbbc=_0x37fbbc-0x0;var _0x48e4fe=_0xb589[_0x37fbbc];return _0x48e4fe;};'use strict';var Sequelize=require(_0x9b58('0x0'));var moment=require(_0x9b58('0x1'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x9b58('0x2')]},'scheduledat':{'type':Sequelize[_0x9b58('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9b58('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9b58('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x9b58('0x2')]},'originatecalleridname':{'type':Sequelize[_0x9b58('0x2')]},'calleridnum':{'type':Sequelize[_0x9b58('0x2')]},'calleridname':{'type':Sequelize[_0x9b58('0x2')]},'starttime':{'type':Sequelize[_0x9b58('0x3')]},'responsetime':{'type':Sequelize[_0x9b58('0x3')]},'answertime':{'type':Sequelize[_0x9b58('0x3')]},'droptime':{'type':Sequelize[_0x9b58('0x3')]},'endtime':{'type':Sequelize[_0x9b58('0x3')]},'ringtime':{'type':Sequelize[_0x9b58('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x9b58('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x9b58('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x9b58('0x2')]},'campaign':{'type':Sequelize[_0x9b58('0x2')]},'campaigntype':{'type':Sequelize[_0x9b58('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x9b58('0x2')]},'dispositionat':{'type':Sequelize[_0x9b58('0x3')],'set':function(_0x57424a){var _0x1ec566=this[_0x9b58('0x5')](_0x9b58('0x6'));if(_0x1ec566&&_0x57424a){this['setDataValue'](_0x9b58('0x7'),moment(_0x57424a)[_0x9b58('0x8')](moment(_0x1ec566),_0x9b58('0x9')));}return this[_0x9b58('0xa')](_0x9b58('0xb'),_0x57424a);}},'amd':{'type':Sequelize[_0x9b58('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x9b58('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x9b58('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x9b58('0x3')]},'callback':{'type':Sequelize[_0x9b58('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9b58('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9b58('0x3')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x9b58('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9b58('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9b58('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9b58('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9b58('0x4')],'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 f35c6d3..313c5b7 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 _0x4c24=['status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','count','includeAll','findAll','catch','show','params','length','include','describe','body','uniqueid','find','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','answeringMachine','noAnswerContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','into','cm_hopper','fromQuery','phone','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','field','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','NOW()','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus'];(function(_0x38ba09,_0x20a382){var _0x40c94f=function(_0x46e840){while(--_0x46e840){_0x38ba09['push'](_0x38ba09['shift']());}};_0x40c94f(++_0x20a382);}(_0x4c24,0x171));var _0x44c2=function(_0x3d6017,_0x1cac69){_0x3d6017=_0x3d6017-0x0;var _0x484cec=_0x4c24[_0x3d6017];return _0x484cec;};'use strict';var pdf=require(_0x44c2('0x0'));var emlformat=require(_0x44c2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x44c2('0x2'));var jsonpatch=require(_0x44c2('0x3'));var rp=require(_0x44c2('0x4'));var moment=require(_0x44c2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x44c2('0x6'));var util=require('util');var path=require(_0x44c2('0x7'));var sox=require('sox');var csv=require(_0x44c2('0x8'));var ejs=require(_0x44c2('0x9'));var fs=require('fs');var _=require(_0x44c2('0xa'));var squel=require('squel');var crypto=require(_0x44c2('0xb'));var jsforce=require(_0x44c2('0xc'));var deskjs=require(_0x44c2('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x44c2('0xe'));var Redis=require(_0x44c2('0xf'));var authService=require(_0x44c2('0x10'));var qs=require(_0x44c2('0x11'));var as=require(_0x44c2('0x12'));var hardwareService=require(_0x44c2('0x13'));var logger=require(_0x44c2('0x14'))('api');var utils=require(_0x44c2('0x15'));var config=require(_0x44c2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xacc210,_0x4afc17){_0x4afc17=_0x4afc17||0xcc;return function(_0x4006e6){if(_0x4006e6){return _0xacc210[_0x44c2('0x17')](_0x4afc17);}return _0xacc210[_0x44c2('0x18')](_0x4afc17)[_0x44c2('0x19')]();};}function respondWithResult(_0x4d2a4c,_0x268481){_0x268481=_0x268481||0xc8;return function(_0x30022b){if(_0x30022b){return _0x4d2a4c[_0x44c2('0x18')](_0x268481)[_0x44c2('0x1a')](_0x30022b);}};}function respondWithFilteredResult(_0x5ba5c1,_0x31ba36){return function(_0x221a9b){if(_0x221a9b){var _0x19f7a3=_0x221a9b['count'],_0x2ca4ab=_0x31ba36[_0x44c2('0x1b')],_0x38e5f3=_0x31ba36[_0x44c2('0x1b')]+_0x31ba36[_0x44c2('0x1c')],_0x4427f1;if(_0x38e5f3>=_0x19f7a3){_0x38e5f3=_0x19f7a3;_0x4427f1=0xc8;}else{_0x4427f1=0xce;}_0x5ba5c1[_0x44c2('0x18')](_0x4427f1);return _0x5ba5c1[_0x44c2('0x1d')](_0x44c2('0x1e'),_0x2ca4ab+'-'+_0x38e5f3+'/'+_0x19f7a3)[_0x44c2('0x1a')](_0x221a9b);}return null;};}function patchUpdates(_0x13f965){return function(_0x523e48){try{jsonpatch[_0x44c2('0x1f')](_0x523e48,_0x13f965,!![]);}catch(_0x14cd3b){return BPromise[_0x44c2('0x20')](_0x14cd3b);}return _0x523e48[_0x44c2('0x21')]();};}function saveUpdates(_0x471f33,_0x27ac34){return function(_0x48f323){if(_0x48f323){return _0x48f323[_0x44c2('0x22')](_0x471f33)[_0x44c2('0x23')](function(_0x14f4cb){return _0x14f4cb;});}return null;};}function removeEntity(_0x1d8c13,_0x8170e6){return function(_0x4936ef){if(_0x4936ef){return _0x4936ef[_0x44c2('0x24')]()['then'](function(){_0x1d8c13['status'](0xcc)[_0x44c2('0x19')]();});}};}function handleEntityNotFound(_0x297e5f,_0x210ed7){return function(_0x3ce31a){if(!_0x3ce31a){_0x297e5f[_0x44c2('0x17')](0x194);}return _0x3ce31a;};}function handleError(_0x5e7d69,_0x3da331){_0x3da331=_0x3da331||0x1f4;return function(_0xdc4852){logger['error'](_0xdc4852[_0x44c2('0x25')]);if(_0xdc4852[_0x44c2('0x26')]){delete _0xdc4852[_0x44c2('0x26')];}_0x5e7d69[_0x44c2('0x18')](_0x3da331)[_0x44c2('0x27')](_0xdc4852);};}exports[_0x44c2('0x28')]=function(_0x2795c3,_0x5ddeec){var _0x9375be={},_0x315077={},_0x2359d2={'count':0x0,'rows':[]};var _0x1062ab=_[_0x44c2('0x29')](db[_0x44c2('0x2a')][_0x44c2('0x2b')],function(_0x5bb51e){return{'name':_0x5bb51e[_0x44c2('0x2c')],'type':_0x5bb51e['type'][_0x44c2('0x2d')]};});_0x315077[_0x44c2('0x2e')]=_[_0x44c2('0x29')](_0x1062ab,_0x44c2('0x26'));_0x315077[_0x44c2('0x2f')]=_[_0x44c2('0x30')](_0x2795c3['query']);_0x315077['filters']=_[_0x44c2('0x31')](_0x315077[_0x44c2('0x2e')],_0x315077['query']);_0x9375be[_0x44c2('0x32')]=_[_0x44c2('0x31')](_0x315077[_0x44c2('0x2e')],qs[_0x44c2('0x33')](_0x2795c3[_0x44c2('0x2f')]['fields']));_0x9375be[_0x44c2('0x32')]=_0x9375be[_0x44c2('0x32')]['length']?_0x9375be[_0x44c2('0x32')]:_0x315077[_0x44c2('0x2e')];if(!_0x2795c3[_0x44c2('0x2f')][_0x44c2('0x34')](_0x44c2('0x35'))){_0x9375be['limit']=qs[_0x44c2('0x1c')](_0x2795c3[_0x44c2('0x2f')][_0x44c2('0x1c')]);_0x9375be[_0x44c2('0x1b')]=qs[_0x44c2('0x1b')](_0x2795c3['query'][_0x44c2('0x1b')]);}_0x9375be[_0x44c2('0x36')]=qs[_0x44c2('0x37')](_0x2795c3[_0x44c2('0x2f')][_0x44c2('0x37')]);_0x9375be[_0x44c2('0x38')]=qs[_0x44c2('0x39')](_[_0x44c2('0x3a')](_0x2795c3['query'],_0x315077[_0x44c2('0x39')]));if(_0x2795c3[_0x44c2('0x2f')][_0x44c2('0x3b')]){_0x9375be[_0x44c2('0x38')]=_[_0x44c2('0x3c')](_0x9375be[_0x44c2('0x38')],{'$or':_[_0x44c2('0x29')](_0x1062ab,function(_0x23f635){if(_0x23f635[_0x44c2('0x3d')]!==_0x44c2('0x3e')){var _0x45e70d={};_0x45e70d[_0x23f635['name']]={'$like':'%'+_0x2795c3[_0x44c2('0x2f')][_0x44c2('0x3b')]+'%'};return _0x45e70d;}})});}_0x9375be=_[_0x44c2('0x3c')]({},_0x9375be,_0x2795c3[_0x44c2('0x3f')]);var _0x4a76c5={'where':_0x9375be[_0x44c2('0x38')]};return db[_0x44c2('0x2a')][_0x44c2('0x40')](_0x4a76c5)[_0x44c2('0x23')](function(_0x179d88){_0x2359d2[_0x44c2('0x40')]=_0x179d88;if(_0x2795c3[_0x44c2('0x2f')][_0x44c2('0x41')]){_0x9375be['include']=[{'all':!![]}];}return db[_0x44c2('0x2a')][_0x44c2('0x42')](_0x9375be);})[_0x44c2('0x23')](function(_0x1dc73e){_0x2359d2['rows']=_0x1dc73e;return _0x2359d2;})['then'](respondWithFilteredResult(_0x5ddeec,_0x9375be))[_0x44c2('0x43')](handleError(_0x5ddeec,null));};exports[_0x44c2('0x44')]=function(_0x81115c,_0x2afc9d){var _0xaae806={'raw':!![],'where':{'id':_0x81115c[_0x44c2('0x45')]['id']}},_0x120c0f={};_0x120c0f[_0x44c2('0x2e')]=_[_0x44c2('0x30')](db['CmHopperFinal']['rawAttributes']);_0x120c0f[_0x44c2('0x2f')]=_[_0x44c2('0x30')](_0x81115c[_0x44c2('0x2f')]);_0x120c0f[_0x44c2('0x39')]=_['intersection'](_0x120c0f[_0x44c2('0x2e')],_0x120c0f[_0x44c2('0x2f')]);_0xaae806[_0x44c2('0x32')]=_['intersection'](_0x120c0f[_0x44c2('0x2e')],qs[_0x44c2('0x33')](_0x81115c['query'][_0x44c2('0x33')]));_0xaae806[_0x44c2('0x32')]=_0xaae806['attributes'][_0x44c2('0x46')]?_0xaae806[_0x44c2('0x32')]:_0x120c0f['model'];if(_0x81115c[_0x44c2('0x2f')][_0x44c2('0x41')]){_0xaae806[_0x44c2('0x47')]=[{'all':!![]}];}_0xaae806=_[_0x44c2('0x3c')]({},_0xaae806,_0x81115c[_0x44c2('0x3f')]);return db[_0x44c2('0x2a')]['find'](_0xaae806)['then'](handleEntityNotFound(_0x2afc9d,null))[_0x44c2('0x23')](respondWithResult(_0x2afc9d,null))[_0x44c2('0x43')](handleError(_0x2afc9d,null));};exports[_0x44c2('0x48')]=function(_0x311fb0,_0x4467d7){return db[_0x44c2('0x2a')][_0x44c2('0x48')]()[_0x44c2('0x23')](respondWithResult(_0x4467d7,null))['catch'](handleError(_0x4467d7,null));};exports[_0x44c2('0x22')]=function(_0x5ea1d8,_0x4e31f6){if(_0x5ea1d8[_0x44c2('0x49')][_0x44c2('0x4a')]){delete _0x5ea1d8[_0x44c2('0x49')][_0x44c2('0x4a')];}return db[_0x44c2('0x2a')][_0x44c2('0x4b')]({'where':{'uniqueid':_0x5ea1d8[_0x44c2('0x45')]['id']}})[_0x44c2('0x23')](handleEntityNotFound(_0x4e31f6,null))[_0x44c2('0x23')](saveUpdates(_0x5ea1d8['body'],null))[_0x44c2('0x23')](respondWithResult(_0x4e31f6,null))[_0x44c2('0x43')](handleError(_0x4e31f6,null));};exports[_0x44c2('0x4c')]=function(_0x11e3de,_0x458e4c,_0x470474){return db['CmHopperFinal'][_0x44c2('0x42')]({'raw':![],'where':{'VoiceQueueId':_0x11e3de[_0x44c2('0x45')]['id']},'attributes':[[db[_0x44c2('0x4d')]['fn'](_0x44c2('0x4e'),db[_0x44c2('0x4d')]['fn']('IF',db[_0x44c2('0x4d')][_0x44c2('0x4f')]('`state`\x20=\x200,\x201,\x20null'))),_0x44c2('0x50')],[db[_0x44c2('0x4d')]['fn'](_0x44c2('0x4e'),db[_0x44c2('0x4d')]['fn']('IF',db[_0x44c2('0x4d')][_0x44c2('0x4f')](_0x44c2('0x51')))),'noAnswerContacts'],[db[_0x44c2('0x4d')]['fn'](_0x44c2('0x4e'),db[_0x44c2('0x4d')]['fn']('IF',db[_0x44c2('0x4d')]['literal'](_0x44c2('0x52')))),_0x44c2('0x53')],[db[_0x44c2('0x4d')]['fn'](_0x44c2('0x4e'),db['sequelize']['fn']('IF',db[_0x44c2('0x4d')]['literal'](_0x44c2('0x54')))),_0x44c2('0x55')],[db[_0x44c2('0x4d')]['fn'](_0x44c2('0x4e'),db[_0x44c2('0x4d')]['fn']('IF',db[_0x44c2('0x4d')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),'dropContacts'],[db['sequelize']['fn'](_0x44c2('0x4e'),db[_0x44c2('0x4d')]['fn']('IF',db[_0x44c2('0x4d')][_0x44c2('0x4f')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x44c2('0x56')],[db[_0x44c2('0x4d')]['fn'](_0x44c2('0x4e'),db[_0x44c2('0x4d')]['fn']('IF',db[_0x44c2('0x4d')][_0x44c2('0x4f')](_0x44c2('0x57')))),_0x44c2('0x58')],[db[_0x44c2('0x4d')]['fn'](_0x44c2('0x4e'),db[_0x44c2('0x4d')]['fn']('IF',db[_0x44c2('0x4d')][_0x44c2('0x4f')]('`state`\x20=\x2019,\x201,\x20null'))),_0x44c2('0x59')]]})[_0x44c2('0x23')](handleEntityNotFound(_0x458e4c,null))[_0x44c2('0x23')](respondWithResult(_0x458e4c,null))['catch'](handleError(_0x458e4c,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x11b7a5,_0x135aaa,_0x5356ae){return db['CmHopperFinal'][_0x44c2('0x42')]({'raw':![],'where':{'CampaignId':_0x11b7a5[_0x44c2('0x45')]['id']},'attributes':[[db[_0x44c2('0x4d')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x44c2('0x4f')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0x44c2('0x4d')]['fn']('COUNT',db[_0x44c2('0x4d')]['fn']('IF',db[_0x44c2('0x4d')][_0x44c2('0x4f')](_0x44c2('0x51')))),_0x44c2('0x5a')],[db[_0x44c2('0x4d')]['fn']('COUNT',db[_0x44c2('0x4d')]['fn']('IF',db[_0x44c2('0x4d')]['literal'](_0x44c2('0x52')))),'busyContacts'],[db['sequelize']['fn'](_0x44c2('0x4e'),db[_0x44c2('0x4d')]['fn']('IF',db[_0x44c2('0x4d')][_0x44c2('0x4f')](_0x44c2('0x54')))),_0x44c2('0x55')],[db[_0x44c2('0x4d')]['fn']('COUNT',db[_0x44c2('0x4d')]['fn']('IF',db[_0x44c2('0x4d')]['literal'](_0x44c2('0x5b')))),_0x44c2('0x5c')],[db[_0x44c2('0x4d')]['fn'](_0x44c2('0x4e'),db[_0x44c2('0x4d')]['fn']('IF',db[_0x44c2('0x4d')][_0x44c2('0x4f')](_0x44c2('0x5d')))),'abandonedContacts'],[db['sequelize']['fn'](_0x44c2('0x4e'),db[_0x44c2('0x4d')]['fn']('IF',db['sequelize'][_0x44c2('0x4f')]('`state`\x20=\x2022,\x201,\x20null'))),_0x44c2('0x58')],[db[_0x44c2('0x4d')]['fn'](_0x44c2('0x4e'),db[_0x44c2('0x4d')]['fn']('IF',db['sequelize']['literal'](_0x44c2('0x5e')))),_0x44c2('0x59')]]})[_0x44c2('0x23')](handleEntityNotFound(_0x135aaa,null))['then'](respondWithResult(_0x135aaa,null))[_0x44c2('0x43')](handleError(_0x135aaa,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x33a8a6,_0x3e6c45,_0x46c601){return db['VoiceQueue'][_0x44c2('0x4b')]({'where':{'id':_0x33a8a6[_0x44c2('0x45')]['id']}})[_0x44c2('0x23')](handleEntityNotFound(_0x3e6c45,null))['then'](function(_0x2dee38){var _0x9af81e;if(_0x2dee38){_0x9af81e=squel['insert']()[_0x44c2('0x5f')](_0x44c2('0x60'))[_0x44c2('0x61')]([_0x44c2('0x62'),'scheduledAt',_0x44c2('0x63'),_0x44c2('0x64'),_0x44c2('0x65'),_0x44c2('0x66'),_0x44c2('0x67')],squel[_0x44c2('0x68')]()['field'](_0x44c2('0x69'),_0x44c2('0x62'))[_0x44c2('0x6a')]('NOW()',_0x44c2('0x6b'))[_0x44c2('0x6a')](_0x44c2('0x6c'),'ContactId')[_0x44c2('0x6a')](_0x44c2('0x6d'),_0x44c2('0x64'))[_0x44c2('0x6a')](_0x44c2('0x6e'),_0x44c2('0x65'))[_0x44c2('0x6a')](_0x44c2('0x6f'),_0x44c2('0x66'))[_0x44c2('0x6a')](_0x44c2('0x6f'),_0x44c2('0x67'))['from'](_0x44c2('0x70'))[_0x44c2('0x38')](_0x44c2('0x71'),_0x33a8a6['params']['id']['toString']())[_0x44c2('0x38')](_0x44c2('0x72'),_0x33a8a6[_0x44c2('0x49')][_0x44c2('0x73')][_0x44c2('0x74')]())[_0x44c2('0x38')](_0x44c2('0x75'))['where'](_0x44c2('0x76'),squel[_0x44c2('0x68')]()['field'](_0x44c2('0x62'))[_0x44c2('0x77')](_0x44c2('0x60'))[_0x44c2('0x38')](_0x44c2('0x71'),_0x33a8a6[_0x44c2('0x45')]['id'][_0x44c2('0x74')]()))[_0x44c2('0x38')](_0x44c2('0x76'),squel[_0x44c2('0x68')]()[_0x44c2('0x6a')](_0x44c2('0x78'))[_0x44c2('0x77')](_0x44c2('0x70'))[_0x44c2('0x38')]('VoiceQueueId\x20=\x20?',_0x33a8a6[_0x44c2('0x45')]['id'][_0x44c2('0x74')]())['where'](_0x44c2('0x79')))[_0x44c2('0x7a')](_0x44c2('0x63')))[_0x44c2('0x74')]();return db['sequelize'][_0x44c2('0x2f')](_0x9af81e);}return[];})[_0x44c2('0x23')](respondWithResult(_0x3e6c45,null))[_0x44c2('0x43')](handleError(_0x3e6c45,null));};exports[_0x44c2('0x7b')]=function(_0x4e9f67,_0x158b24,_0x3badde){return db[_0x44c2('0x7c')][_0x44c2('0x4b')]({'where':{'id':_0x4e9f67[_0x44c2('0x45')]['id']}})[_0x44c2('0x23')](handleEntityNotFound(_0x158b24,null))['then'](function(_0x2b8f7c){var _0x41a712;if(_0x2b8f7c){_0x41a712=squel[_0x44c2('0x7d')]()['into'](_0x44c2('0x60'))[_0x44c2('0x61')]([_0x44c2('0x62'),_0x44c2('0x6b'),_0x44c2('0x63'),'ListId',_0x44c2('0x7e'),_0x44c2('0x66'),_0x44c2('0x67')],squel[_0x44c2('0x68')]()[_0x44c2('0x6a')](_0x44c2('0x69'),_0x44c2('0x62'))[_0x44c2('0x6a')](_0x44c2('0x6f'),'scheduledAt')['field'](_0x44c2('0x6c'),_0x44c2('0x63'))[_0x44c2('0x6a')](_0x44c2('0x6d'),'ListId')[_0x44c2('0x6a')](_0x44c2('0x7f'),_0x44c2('0x7e'))[_0x44c2('0x6a')](_0x44c2('0x6f'),_0x44c2('0x66'))['field']('NOW()','updatedAt')[_0x44c2('0x77')]('cm_hopper_final')[_0x44c2('0x38')](_0x44c2('0x80'),_0x4e9f67[_0x44c2('0x45')]['id']['toString']())[_0x44c2('0x38')]('state\x20=\x20?',_0x4e9f67[_0x44c2('0x49')][_0x44c2('0x73')][_0x44c2('0x74')]())['where'](_0x44c2('0x75'))['where'](_0x44c2('0x76'),squel['select']()['field'](_0x44c2('0x62'))['from'](_0x44c2('0x60'))['where'](_0x44c2('0x80'),_0x4e9f67['params']['id'][_0x44c2('0x74')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x44c2('0x6a')](_0x44c2('0x78'))['from'](_0x44c2('0x70'))[_0x44c2('0x38')](_0x44c2('0x80'),_0x4e9f67[_0x44c2('0x45')]['id'][_0x44c2('0x74')]())[_0x44c2('0x38')](_0x44c2('0x79')))[_0x44c2('0x7a')](_0x44c2('0x63')))[_0x44c2('0x74')]();return db[_0x44c2('0x4d')]['query'](_0x41a712);}return[];})[_0x44c2('0x23')](respondWithResult(_0x158b24,null))['catch'](handleError(_0x158b24,null));};exports[_0x44c2('0x81')]=function(_0x1ecebb,_0x4797be,_0x43143e){return db[_0x44c2('0x82')]['findOne']({'where':{'VoiceQueueId':_0x1ecebb[_0x44c2('0x49')]['VoiceQueueId'],'CampaignId':_0x1ecebb[_0x44c2('0x49')][_0x44c2('0x7e')],'ContactId':_0x1ecebb['body'][_0x44c2('0x63')]}})[_0x44c2('0x23')](handleEntityNotFound(_0x4797be,null))[_0x44c2('0x23')](function(_0x5dbd6b){if(_0x5dbd6b){return _0x5dbd6b;}return null;})[_0x44c2('0x23')](respondWithResult(_0x4797be,null))['catch'](handleError(_0x4797be,null));}; \ No newline at end of file +var _0x3963=['countContactsIvrCampaignHopperFinal','noSuchContacts','busyContacts','reCallContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','fromQuery','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','ANY_VALUE(ContactId)','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','calleridnum','from','group','moveContactsIvrCampaignHopperFinal','Campaign','NOW()','CampaignId','CampaignId\x20=\x20?','state\x20=\x204','CmHopper','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','map','CmHopperFinal','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine'];(function(_0x30c7c5,_0x168208){var _0x29e24e=function(_0x427d3e){while(--_0x427d3e){_0x30c7c5['push'](_0x30c7c5['shift']());}};_0x29e24e(++_0x168208);}(_0x3963,0xa5));var _0x3396=function(_0x462999,_0x24d200){_0x462999=_0x462999-0x0;var _0x4b1366=_0x3963[_0x462999];return _0x4b1366;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3396('0x0'));var rimraf=require(_0x3396('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3396('0x2'));var rp=require(_0x3396('0x3'));var moment=require('moment');var BPromise=require(_0x3396('0x4'));var Mustache=require(_0x3396('0x5'));var util=require(_0x3396('0x6'));var path=require(_0x3396('0x7'));var sox=require(_0x3396('0x8'));var csv=require(_0x3396('0x9'));var ejs=require(_0x3396('0xa'));var fs=require('fs');var _=require(_0x3396('0xb'));var squel=require(_0x3396('0xc'));var crypto=require(_0x3396('0xd'));var jsforce=require(_0x3396('0xe'));var deskjs=require(_0x3396('0xf'));var toCsv=require(_0x3396('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3396('0x10'));var authService=require(_0x3396('0x11'));var qs=require(_0x3396('0x12'));var as=require(_0x3396('0x13'));var hardwareService=require(_0x3396('0x14'));var logger=require(_0x3396('0x15'))(_0x3396('0x16'));var utils=require(_0x3396('0x17'));var config=require(_0x3396('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30b3a4,_0x2c49cc){_0x2c49cc=_0x2c49cc||0xcc;return function(_0x171ed1){if(_0x171ed1){return _0x30b3a4[_0x3396('0x19')](_0x2c49cc);}return _0x30b3a4[_0x3396('0x1a')](_0x2c49cc)['end']();};}function respondWithResult(_0x500ab3,_0x2ac322){_0x2ac322=_0x2ac322||0xc8;return function(_0x4e1c44){if(_0x4e1c44){return _0x500ab3[_0x3396('0x1a')](_0x2ac322)[_0x3396('0x1b')](_0x4e1c44);}};}function respondWithFilteredResult(_0x45ccd4,_0x127c26){return function(_0x3715f9){if(_0x3715f9){var _0x1966d3=_0x3715f9[_0x3396('0x1c')],_0x215c03=_0x127c26[_0x3396('0x1d')],_0xd05787=_0x127c26['offset']+_0x127c26[_0x3396('0x1e')],_0x15cbc5;if(_0xd05787>=_0x1966d3){_0xd05787=_0x1966d3;_0x15cbc5=0xc8;}else{_0x15cbc5=0xce;}_0x45ccd4[_0x3396('0x1a')](_0x15cbc5);return _0x45ccd4[_0x3396('0x1f')](_0x3396('0x20'),_0x215c03+'-'+_0xd05787+'/'+_0x1966d3)[_0x3396('0x1b')](_0x3715f9);}return null;};}function patchUpdates(_0x166468){return function(_0x413a6a){try{jsonpatch[_0x3396('0x21')](_0x413a6a,_0x166468,!![]);}catch(_0x48d387){return BPromise[_0x3396('0x22')](_0x48d387);}return _0x413a6a[_0x3396('0x23')]();};}function saveUpdates(_0x1d1833,_0x4a5beb){return function(_0x4ebf06){if(_0x4ebf06){return _0x4ebf06[_0x3396('0x24')](_0x1d1833)[_0x3396('0x25')](function(_0x3da0a5){return _0x3da0a5;});}return null;};}function removeEntity(_0x58cc74,_0x125aaf){return function(_0x4d507d){if(_0x4d507d){return _0x4d507d[_0x3396('0x26')]()['then'](function(){_0x58cc74[_0x3396('0x1a')](0xcc)[_0x3396('0x27')]();});}};}function handleEntityNotFound(_0x1e35d4,_0x15ef50){return function(_0x42b50f){if(!_0x42b50f){_0x1e35d4['sendStatus'](0x194);}return _0x42b50f;};}function handleError(_0x2fe2fa,_0x21df04){_0x21df04=_0x21df04||0x1f4;return function(_0x49965e){logger[_0x3396('0x28')](_0x49965e[_0x3396('0x29')]);if(_0x49965e['name']){delete _0x49965e['name'];}_0x2fe2fa['status'](_0x21df04)['send'](_0x49965e);};}exports['index']=function(_0x44782a,_0x4b8051){var _0x11c7e8={},_0x109c40={},_0x2f783a={'count':0x0,'rows':[]};var _0x3f7178=_[_0x3396('0x2a')](db[_0x3396('0x2b')]['rawAttributes'],function(_0x5f5579){return{'name':_0x5f5579[_0x3396('0x2c')],'type':_0x5f5579[_0x3396('0x2d')][_0x3396('0x2e')]};});_0x109c40[_0x3396('0x2f')]=_[_0x3396('0x2a')](_0x3f7178,_0x3396('0x30'));_0x109c40[_0x3396('0x31')]=_[_0x3396('0x32')](_0x44782a['query']);_0x109c40['filters']=_[_0x3396('0x33')](_0x109c40['model'],_0x109c40[_0x3396('0x31')]);_0x11c7e8[_0x3396('0x34')]=_[_0x3396('0x33')](_0x109c40[_0x3396('0x2f')],qs['fields'](_0x44782a[_0x3396('0x31')][_0x3396('0x35')]));_0x11c7e8['attributes']=_0x11c7e8[_0x3396('0x34')][_0x3396('0x36')]?_0x11c7e8[_0x3396('0x34')]:_0x109c40[_0x3396('0x2f')];if(!_0x44782a[_0x3396('0x31')][_0x3396('0x37')]('nolimit')){_0x11c7e8[_0x3396('0x1e')]=qs[_0x3396('0x1e')](_0x44782a[_0x3396('0x31')][_0x3396('0x1e')]);_0x11c7e8[_0x3396('0x1d')]=qs[_0x3396('0x1d')](_0x44782a[_0x3396('0x31')][_0x3396('0x1d')]);}_0x11c7e8['order']=qs[_0x3396('0x38')](_0x44782a[_0x3396('0x31')][_0x3396('0x38')]);_0x11c7e8[_0x3396('0x39')]=qs[_0x3396('0x3a')](_[_0x3396('0x3b')](_0x44782a[_0x3396('0x31')],_0x109c40[_0x3396('0x3a')]));if(_0x44782a['query']['filter']){_0x11c7e8[_0x3396('0x39')]=_[_0x3396('0x3c')](_0x11c7e8[_0x3396('0x39')],{'$or':_[_0x3396('0x2a')](_0x3f7178,function(_0x5b959b){if(_0x5b959b[_0x3396('0x2d')]!=='VIRTUAL'){var _0x5453a5={};_0x5453a5[_0x5b959b['name']]={'$like':'%'+_0x44782a[_0x3396('0x31')][_0x3396('0x3d')]+'%'};return _0x5453a5;}})});}_0x11c7e8=_[_0x3396('0x3c')]({},_0x11c7e8,_0x44782a[_0x3396('0x3e')]);var _0x5ba3b5={'where':_0x11c7e8['where']};return db[_0x3396('0x2b')][_0x3396('0x1c')](_0x5ba3b5)[_0x3396('0x25')](function(_0x42d3a7){_0x2f783a[_0x3396('0x1c')]=_0x42d3a7;if(_0x44782a['query'][_0x3396('0x3f')]){_0x11c7e8[_0x3396('0x40')]=[{'all':!![]}];}return db[_0x3396('0x2b')][_0x3396('0x41')](_0x11c7e8);})[_0x3396('0x25')](function(_0x1bb165){_0x2f783a[_0x3396('0x42')]=_0x1bb165;return _0x2f783a;})['then'](respondWithFilteredResult(_0x4b8051,_0x11c7e8))[_0x3396('0x43')](handleError(_0x4b8051,null));};exports[_0x3396('0x44')]=function(_0x2647cc,_0x136530){var _0xe294c3={'raw':!![],'where':{'id':_0x2647cc[_0x3396('0x45')]['id']}},_0x59d731={};_0x59d731[_0x3396('0x2f')]=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x59d731['query']=_[_0x3396('0x32')](_0x2647cc[_0x3396('0x31')]);_0x59d731[_0x3396('0x3a')]=_[_0x3396('0x33')](_0x59d731[_0x3396('0x2f')],_0x59d731[_0x3396('0x31')]);_0xe294c3[_0x3396('0x34')]=_[_0x3396('0x33')](_0x59d731['model'],qs[_0x3396('0x35')](_0x2647cc['query']['fields']));_0xe294c3[_0x3396('0x34')]=_0xe294c3[_0x3396('0x34')]['length']?_0xe294c3[_0x3396('0x34')]:_0x59d731[_0x3396('0x2f')];if(_0x2647cc[_0x3396('0x31')][_0x3396('0x3f')]){_0xe294c3[_0x3396('0x40')]=[{'all':!![]}];}_0xe294c3=_['merge']({},_0xe294c3,_0x2647cc[_0x3396('0x3e')]);return db[_0x3396('0x2b')][_0x3396('0x46')](_0xe294c3)[_0x3396('0x25')](handleEntityNotFound(_0x136530,null))[_0x3396('0x25')](respondWithResult(_0x136530,null))[_0x3396('0x43')](handleError(_0x136530,null));};exports[_0x3396('0x47')]=function(_0x313974,_0x16ae03){return db[_0x3396('0x2b')][_0x3396('0x47')]()['then'](respondWithResult(_0x16ae03,null))['catch'](handleError(_0x16ae03,null));};exports['update']=function(_0x2c71fa,_0x18a296){if(_0x2c71fa[_0x3396('0x48')][_0x3396('0x49')]){delete _0x2c71fa[_0x3396('0x48')][_0x3396('0x49')];}return db[_0x3396('0x2b')][_0x3396('0x46')]({'where':{'uniqueid':_0x2c71fa[_0x3396('0x45')]['id']}})['then'](handleEntityNotFound(_0x18a296,null))['then'](saveUpdates(_0x2c71fa[_0x3396('0x48')],null))[_0x3396('0x25')](respondWithResult(_0x18a296,null))['catch'](handleError(_0x18a296,null));};exports[_0x3396('0x4a')]=function(_0x1e6c62,_0x475aaa,_0x12d4ce){return db[_0x3396('0x2b')][_0x3396('0x41')]({'raw':![],'where':{'VoiceQueueId':_0x1e6c62[_0x3396('0x45')]['id']},'attributes':[[db[_0x3396('0x4b')]['fn']('COUNT',db[_0x3396('0x4b')]['fn']('IF',db[_0x3396('0x4b')][_0x3396('0x4c')](_0x3396('0x4d')))),'noSuchContacts'],[db[_0x3396('0x4b')]['fn'](_0x3396('0x4e'),db[_0x3396('0x4b')]['fn']('IF',db[_0x3396('0x4b')]['literal'](_0x3396('0x4f')))),_0x3396('0x50')],[db[_0x3396('0x4b')]['fn'](_0x3396('0x4e'),db[_0x3396('0x4b')]['fn']('IF',db[_0x3396('0x4b')][_0x3396('0x4c')](_0x3396('0x51')))),'busyContacts'],[db['sequelize']['fn'](_0x3396('0x4e'),db[_0x3396('0x4b')]['fn']('IF',db[_0x3396('0x4b')][_0x3396('0x4c')](_0x3396('0x52')))),_0x3396('0x53')],[db['sequelize']['fn'](_0x3396('0x4e'),db[_0x3396('0x4b')]['fn']('IF',db[_0x3396('0x4b')][_0x3396('0x4c')](_0x3396('0x54')))),_0x3396('0x55')],[db[_0x3396('0x4b')]['fn'](_0x3396('0x4e'),db[_0x3396('0x4b')]['fn']('IF',db[_0x3396('0x4b')][_0x3396('0x4c')](_0x3396('0x56')))),_0x3396('0x57')],[db[_0x3396('0x4b')]['fn'](_0x3396('0x4e'),db[_0x3396('0x4b')]['fn']('IF',db[_0x3396('0x4b')][_0x3396('0x4c')](_0x3396('0x58')))),'reCallContacts'],[db[_0x3396('0x4b')]['fn'](_0x3396('0x4e'),db[_0x3396('0x4b')]['fn']('IF',db[_0x3396('0x4b')]['literal'](_0x3396('0x59')))),_0x3396('0x5a')]]})['then'](handleEntityNotFound(_0x475aaa,null))[_0x3396('0x25')](respondWithResult(_0x475aaa,null))['catch'](handleError(_0x475aaa,null));};exports[_0x3396('0x5b')]=function(_0xad10e9,_0x3a5c97,_0x2c77ae){return db[_0x3396('0x2b')][_0x3396('0x41')]({'raw':![],'where':{'CampaignId':_0xad10e9['params']['id']},'attributes':[[db[_0x3396('0x4b')]['fn']('COUNT',db[_0x3396('0x4b')]['fn']('IF',db['sequelize'][_0x3396('0x4c')](_0x3396('0x4d')))),_0x3396('0x5c')],[db['sequelize']['fn']('COUNT',db[_0x3396('0x4b')]['fn']('IF',db['sequelize']['literal'](_0x3396('0x4f')))),_0x3396('0x50')],[db['sequelize']['fn']('COUNT',db[_0x3396('0x4b')]['fn']('IF',db[_0x3396('0x4b')][_0x3396('0x4c')](_0x3396('0x51')))),_0x3396('0x5d')],[db[_0x3396('0x4b')]['fn'](_0x3396('0x4e'),db['sequelize']['fn']('IF',db[_0x3396('0x4b')][_0x3396('0x4c')](_0x3396('0x52')))),_0x3396('0x53')],[db['sequelize']['fn'](_0x3396('0x4e'),db[_0x3396('0x4b')]['fn']('IF',db[_0x3396('0x4b')]['literal'](_0x3396('0x54')))),_0x3396('0x55')],[db[_0x3396('0x4b')]['fn'](_0x3396('0x4e'),db[_0x3396('0x4b')]['fn']('IF',db[_0x3396('0x4b')][_0x3396('0x4c')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x3396('0x57')],[db[_0x3396('0x4b')]['fn'](_0x3396('0x4e'),db['sequelize']['fn']('IF',db[_0x3396('0x4b')][_0x3396('0x4c')](_0x3396('0x58')))),_0x3396('0x5e')],[db[_0x3396('0x4b')]['fn'](_0x3396('0x4e'),db[_0x3396('0x4b')]['fn']('IF',db[_0x3396('0x4b')][_0x3396('0x4c')](_0x3396('0x59')))),_0x3396('0x5a')]]})[_0x3396('0x25')](handleEntityNotFound(_0x3a5c97,null))[_0x3396('0x25')](respondWithResult(_0x3a5c97,null))[_0x3396('0x43')](handleError(_0x3a5c97,null));};exports[_0x3396('0x5f')]=function(_0x47916d,_0x1d5ff7,_0x156ea1){return db[_0x3396('0x60')]['find']({'where':{'id':_0x47916d[_0x3396('0x45')]['id']}})[_0x3396('0x25')](handleEntityNotFound(_0x1d5ff7,null))[_0x3396('0x25')](function(_0x17736a){var _0x44100a;if(_0x17736a){_0x44100a=squel[_0x3396('0x61')]()['into']('cm_hopper')[_0x3396('0x62')](['phone',_0x3396('0x63'),_0x3396('0x64'),_0x3396('0x65'),_0x3396('0x66'),_0x3396('0x67'),_0x3396('0x68')],squel[_0x3396('0x69')]()[_0x3396('0x6a')](_0x3396('0x6b'),_0x3396('0x6c'))[_0x3396('0x6a')]('NOW()','scheduledAt')['field'](_0x3396('0x6d'),_0x3396('0x64'))[_0x3396('0x6a')]('ANY_VALUE(ListId)',_0x3396('0x65'))['field']('ANY_VALUE(VoiceQueueId)',_0x3396('0x66'))[_0x3396('0x6a')]('NOW()','createdAt')['field']('NOW()',_0x3396('0x68'))['from'](_0x3396('0x6e'))[_0x3396('0x39')](_0x3396('0x6f'),_0x47916d['params']['id'][_0x3396('0x70')]())[_0x3396('0x39')](_0x3396('0x71'),_0x47916d[_0x3396('0x48')][_0x3396('0x72')]['toString']())[_0x3396('0x39')](_0x3396('0x73'))[_0x3396('0x39')](_0x3396('0x74'),squel[_0x3396('0x69')]()[_0x3396('0x6a')]('phone')['from'](_0x3396('0x75'))[_0x3396('0x39')](_0x3396('0x6f'),_0x47916d['params']['id'][_0x3396('0x70')]()))[_0x3396('0x39')](_0x3396('0x74'),squel[_0x3396('0x69')]()[_0x3396('0x6a')](_0x3396('0x76'))[_0x3396('0x77')](_0x3396('0x6e'))[_0x3396('0x39')](_0x3396('0x6f'),_0x47916d[_0x3396('0x45')]['id'][_0x3396('0x70')]())[_0x3396('0x39')]('state\x20=\x204'))[_0x3396('0x78')](_0x3396('0x64')))[_0x3396('0x70')]();return db[_0x3396('0x4b')][_0x3396('0x31')](_0x44100a);}return[];})[_0x3396('0x25')](respondWithResult(_0x1d5ff7,null))['catch'](handleError(_0x1d5ff7,null));};exports[_0x3396('0x79')]=function(_0x340004,_0x54223e,_0x2fe404){return db[_0x3396('0x7a')]['find']({'where':{'id':_0x340004[_0x3396('0x45')]['id']}})[_0x3396('0x25')](handleEntityNotFound(_0x54223e,null))[_0x3396('0x25')](function(_0x1ce1e5){var _0x47df7c;if(_0x1ce1e5){_0x47df7c=squel[_0x3396('0x61')]()['into'](_0x3396('0x75'))[_0x3396('0x62')]([_0x3396('0x6c'),_0x3396('0x63'),_0x3396('0x64'),_0x3396('0x65'),'CampaignId',_0x3396('0x67'),_0x3396('0x68')],squel['select']()[_0x3396('0x6a')](_0x3396('0x6b'),_0x3396('0x6c'))[_0x3396('0x6a')](_0x3396('0x7b'),'scheduledAt')['field'](_0x3396('0x6d'),_0x3396('0x64'))[_0x3396('0x6a')]('ANY_VALUE(ListId)',_0x3396('0x65'))['field']('ANY_VALUE(CampaignId)',_0x3396('0x7c'))[_0x3396('0x6a')](_0x3396('0x7b'),_0x3396('0x67'))[_0x3396('0x6a')]('NOW()',_0x3396('0x68'))[_0x3396('0x77')](_0x3396('0x6e'))[_0x3396('0x39')](_0x3396('0x7d'),_0x340004['params']['id'][_0x3396('0x70')]())[_0x3396('0x39')](_0x3396('0x71'),_0x340004[_0x3396('0x48')][_0x3396('0x72')][_0x3396('0x70')]())['where'](_0x3396('0x73'))[_0x3396('0x39')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x3396('0x69')]()[_0x3396('0x6a')](_0x3396('0x6c'))[_0x3396('0x77')]('cm_hopper')['where'](_0x3396('0x7d'),_0x340004[_0x3396('0x45')]['id'][_0x3396('0x70')]()))['where'](_0x3396('0x74'),squel[_0x3396('0x69')]()[_0x3396('0x6a')](_0x3396('0x76'))[_0x3396('0x77')]('cm_hopper_final')[_0x3396('0x39')](_0x3396('0x7d'),_0x340004['params']['id']['toString']())[_0x3396('0x39')](_0x3396('0x7e')))['group'](_0x3396('0x64')))[_0x3396('0x70')]();return db['sequelize'][_0x3396('0x31')](_0x47df7c);}return[];})['then'](respondWithResult(_0x54223e,null))[_0x3396('0x43')](handleError(_0x54223e,null));};exports['checkContactHopper']=function(_0x1fcf2a,_0x1e7f75,_0x14f2fb){return db[_0x3396('0x7f')]['findOne']({'where':{'VoiceQueueId':_0x1fcf2a[_0x3396('0x48')][_0x3396('0x66')],'CampaignId':_0x1fcf2a['body'][_0x3396('0x7c')],'ContactId':_0x1fcf2a[_0x3396('0x48')][_0x3396('0x64')]}})[_0x3396('0x25')](handleEntityNotFound(_0x1e7f75,null))[_0x3396('0x25')](function(_0x5292f7){if(_0x5292f7){return _0x5292f7;}return null;})['then'](respondWithResult(_0x1e7f75,null))['catch'](handleError(_0x1e7f75,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 840567f..1a78ccf 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 _0xf115=['uniqueid','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','calleridnum'];(function(_0xe6edd7,_0x2993d2){var _0xc07080=function(_0x14d02b){while(--_0x14d02b){_0xe6edd7['push'](_0xe6edd7['shift']());}};_0xc07080(++_0x2993d2);}(_0xf115,0xfd));var _0x5f11=function(_0x2f974c,_0x2a9938){_0x2f974c=_0x2f974c-0x0;var _0xd74bc6=_0xf115[_0x2f974c];return _0xd74bc6;};'use strict';var _=require('lodash');var util=require(_0x5f11('0x0'));var logger=require(_0x5f11('0x1'))(_0x5f11('0x2'));var moment=require(_0x5f11('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f11('0x4'));var rimraf=require(_0x5f11('0x5'));var config=require(_0x5f11('0x6'));var attributes=require(_0x5f11('0x7'));module[_0x5f11('0x8')]=function(_0x755ef3,_0x2e43d8){return _0x755ef3['define'](_0x5f11('0x9'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x5f11('0xa'),'fields':['calleridnum']},{'name':'uniqueid','fields':[_0x5f11('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe35f=['rimraf','./cmHopperFinal.attributes','define','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x512b27,_0x55c73b){var _0x2ad648=function(_0xe0b23b){while(--_0xe0b23b){_0x512b27['push'](_0x512b27['shift']());}};_0x2ad648(++_0x55c73b);}(_0xe35f,0x1d4));var _0xfe35=function(_0x589b8a,_0x3aea07){_0x589b8a=_0x589b8a-0x0;var _0x197625=_0xe35f[_0x589b8a];return _0x197625;};'use strict';var _=require(_0xfe35('0x0'));var util=require(_0xfe35('0x1'));var logger=require(_0xfe35('0x2'))(_0xfe35('0x3'));var moment=require(_0xfe35('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfe35('0x5'));var config=require('../../config/environment');var attributes=require(_0xfe35('0x6'));module['exports']=function(_0x4f7cba,_0x26c1c5){return _0x4f7cba[_0xfe35('0x7')]('CmHopperFinal',attributes,{'tableName':_0xfe35('0x8'),'paranoid':![],'indexes':[{'name':_0xfe35('0x9'),'fields':[_0xfe35('0x9')]},{'name':_0xfe35('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 2a9cb26..35ceb21 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 _0xbfa9=['request','then','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateCmHopperFinal','CmHopperFinal','create','body','options','raw','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xe39824,_0xbdf61f){var _0x4bc31e=function(_0x594760){while(--_0x594760){_0xe39824['push'](_0xe39824['shift']());}};_0x4bc31e(++_0xbdf61f);}(_0xbfa9,0x83));var _0x9bfa=function(_0x4c96e4,_0x2fe2ea){_0x4c96e4=_0x4c96e4-0x0;var _0x2dd5d2=_0xbfa9[_0x4c96e4];return _0x2dd5d2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9bfa('0x0'));var BPromise=require('bluebird');var rs=require(_0x9bfa('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9bfa('0x2'))['db'];var utils=require(_0x9bfa('0x3'));var logger=require('../../config/logger')(_0x9bfa('0x4'));var config=require(_0x9bfa('0x5'));var jayson=require(_0x9bfa('0x6'));var client=jayson[_0x9bfa('0x7')][_0x9bfa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1e512b,_0x14cfe2,_0x1c411b){return new BPromise(function(_0x4dd8b1,_0x458cf4){return client[_0x9bfa('0x9')](_0x1e512b,_0x1c411b)[_0x9bfa('0xa')](function(_0x3be59a){logger[_0x9bfa('0xb')](_0x9bfa('0xc'),_0x14cfe2,_0x9bfa('0xd'));logger[_0x9bfa('0xe')](_0x9bfa('0xf'),_0x14cfe2,'request\x20sent',JSON[_0x9bfa('0x10')](_0x3be59a));if(_0x3be59a[_0x9bfa('0x11')]){if(_0x3be59a[_0x9bfa('0x11')][_0x9bfa('0x12')]===0x1f4){logger['error'](_0x9bfa('0xc'),_0x14cfe2,_0x3be59a[_0x9bfa('0x11')][_0x9bfa('0x13')]);return _0x458cf4(_0x3be59a[_0x9bfa('0x11')][_0x9bfa('0x13')]);}logger[_0x9bfa('0x11')](_0x9bfa('0xc'),_0x14cfe2,_0x3be59a[_0x9bfa('0x11')][_0x9bfa('0x13')]);return _0x4dd8b1(_0x3be59a['error'][_0x9bfa('0x13')]);}else{logger[_0x9bfa('0xb')](_0x9bfa('0xc'),_0x14cfe2,'request\x20sent');_0x4dd8b1(_0x3be59a[_0x9bfa('0x14')][_0x9bfa('0x13')]);}})[_0x9bfa('0x15')](function(_0x587a05){logger[_0x9bfa('0x11')]('CmHopperFinal,\x20%s,\x20%s',_0x14cfe2,_0x587a05);_0x458cf4(_0x587a05);});});}exports[_0x9bfa('0x16')]=function(_0x50f8c3){var _0x2023c0=this;return new Promise(function(_0x19f3d2,_0x3d6729){return db[_0x9bfa('0x17')][_0x9bfa('0x18')](_0x50f8c3[_0x9bfa('0x19')],{'raw':_0x50f8c3[_0x9bfa('0x1a')]?_0x50f8c3[_0x9bfa('0x1a')][_0x9bfa('0x1b')]===undefined?!![]:![]:!![]})[_0x9bfa('0xa')](function(_0x13e116){logger['info'](_0x9bfa('0x16'),_0x50f8c3);logger['debug'](_0x9bfa('0x16'),_0x50f8c3,JSON[_0x9bfa('0x10')](_0x13e116));_0x19f3d2(_0x13e116);})['catch'](function(_0x24244e){logger['error'](_0x9bfa('0x16'),_0x24244e[_0x9bfa('0x13')],_0x50f8c3);_0x3d6729(_0x2023c0[_0x9bfa('0x11')](0x1f4,_0x24244e[_0x9bfa('0x13')]));});});}; \ No newline at end of file +var _0x3f60=['../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','error','message','result','catch','CmHopperFinal','options','raw','CreateCmHopperFinal','stringify','util','moment','bluebird','randomstring'];(function(_0x384c23,_0x30cd65){var _0x1fdf67=function(_0x21d205){while(--_0x21d205){_0x384c23['push'](_0x384c23['shift']());}};_0x1fdf67(++_0x30cd65);}(_0x3f60,0xc4));var _0x03f6=function(_0x71cd05,_0x36ac11){_0x71cd05=_0x71cd05-0x0;var _0x59c9e7=_0x3f60[_0x71cd05];return _0x59c9e7;};'use strict';var _=require('lodash');var util=require(_0x03f6('0x0'));var moment=require(_0x03f6('0x1'));var BPromise=require(_0x03f6('0x2'));var rs=require(_0x03f6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x03f6('0x4'))['db'];var utils=require(_0x03f6('0x5'));var logger=require(_0x03f6('0x6'))(_0x03f6('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x03f6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9a6bdf,_0x4bb291,_0x336fc6){return new BPromise(function(_0x2af956,_0x18031e){return client[_0x03f6('0x9')](_0x9a6bdf,_0x336fc6)[_0x03f6('0xa')](function(_0x16604f){logger[_0x03f6('0xb')](_0x03f6('0xc'),_0x4bb291,_0x03f6('0xd'));logger[_0x03f6('0xe')](_0x03f6('0xf'),_0x4bb291,'request\x20sent',JSON['stringify'](_0x16604f));if(_0x16604f['error']){if(_0x16604f[_0x03f6('0x10')]['code']===0x1f4){logger[_0x03f6('0x10')](_0x03f6('0xc'),_0x4bb291,_0x16604f[_0x03f6('0x10')][_0x03f6('0x11')]);return _0x18031e(_0x16604f[_0x03f6('0x10')]['message']);}logger[_0x03f6('0x10')](_0x03f6('0xc'),_0x4bb291,_0x16604f['error'][_0x03f6('0x11')]);return _0x2af956(_0x16604f[_0x03f6('0x10')][_0x03f6('0x11')]);}else{logger['info'](_0x03f6('0xc'),_0x4bb291,_0x03f6('0xd'));_0x2af956(_0x16604f[_0x03f6('0x12')][_0x03f6('0x11')]);}})[_0x03f6('0x13')](function(_0x3a6bf4){logger[_0x03f6('0x10')](_0x03f6('0xc'),_0x4bb291,_0x3a6bf4);_0x18031e(_0x3a6bf4);});});}exports['CreateCmHopperFinal']=function(_0x4d9ac6){var _0x20264a=this;return new Promise(function(_0x2ed950,_0x3c2c57){return db[_0x03f6('0x14')]['create'](_0x4d9ac6['body'],{'raw':_0x4d9ac6[_0x03f6('0x15')]?_0x4d9ac6[_0x03f6('0x15')][_0x03f6('0x16')]===undefined?!![]:![]:!![]})[_0x03f6('0xa')](function(_0x5824f8){logger[_0x03f6('0xb')](_0x03f6('0x17'),_0x4d9ac6);logger[_0x03f6('0xe')](_0x03f6('0x17'),_0x4d9ac6,JSON[_0x03f6('0x18')](_0x5824f8));_0x2ed950(_0x5824f8);})[_0x03f6('0x13')](function(_0x1e5618){logger[_0x03f6('0x10')](_0x03f6('0x17'),_0x1e5618[_0x03f6('0x11')],_0x4d9ac6);_0x3c2c57(_0x20264a[_0x03f6('0x10')](0x1f4,_0x1e5618[_0x03f6('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 5d9e4f0..7e2f27b 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 _0x09f0=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper'];(function(_0x3dc68b,_0x4be2c9){var _0x316cb5=function(_0x42af89){while(--_0x42af89){_0x3dc68b['push'](_0x3dc68b['shift']());}};_0x316cb5(++_0x4be2c9);}(_0x09f0,0xf1));var _0x009f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x09f0[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x009f('0x0'));var util=require(_0x009f('0x1'));var path=require(_0x009f('0x2'));var timeout=require(_0x009f('0x3'));var express=require(_0x009f('0x4'));var router=express[_0x009f('0x5')]();var auth=require(_0x009f('0x6'));var interaction=require(_0x009f('0x7'));var config=require(_0x009f('0x8'));var controller=require('./cmHopperFinal.controller');router[_0x009f('0x9')]('/',auth[_0x009f('0xa')](),controller[_0x009f('0xb')]);router['get'](_0x009f('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x009f('0x9')](_0x009f('0xd'),auth['isAuthenticated'](),controller[_0x009f('0xe')]);router[_0x009f('0x9')](_0x009f('0xf'),auth[_0x009f('0xa')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x009f('0x9')](_0x009f('0x10'),auth['isAuthenticated'](),controller[_0x009f('0x11')]);router[_0x009f('0x12')](_0x009f('0x13'),auth[_0x009f('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x009f('0x12')](_0x009f('0x14'),auth[_0x009f('0xa')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x009f('0x12')](_0x009f('0x15'),auth['isAuthenticated'](),controller[_0x009f('0x16')]);router['put']('/:id',auth[_0x009f('0xa')](),controller['update']);module[_0x009f('0x17')]=router; \ No newline at end of file +var _0x6d71=['show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','put','/:id','update','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./cmHopperFinal.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x5cef79,_0x1f9e63){var _0xb4431e=function(_0xbb5564){while(--_0xbb5564){_0x5cef79['push'](_0x5cef79['shift']());}};_0xb4431e(++_0x1f9e63);}(_0x6d71,0x139));var _0x16d7=function(_0x5ea2bf,_0x3a59d5){_0x5ea2bf=_0x5ea2bf-0x0;var _0x33468c=_0x6d71[_0x5ea2bf];return _0x33468c;};'use strict';var multer=require(_0x16d7('0x0'));var util=require(_0x16d7('0x1'));var path=require(_0x16d7('0x2'));var timeout=require(_0x16d7('0x3'));var express=require('express');var router=express[_0x16d7('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x16d7('0x5'));var config=require('../../config/environment');var controller=require(_0x16d7('0x6'));router['get']('/',auth[_0x16d7('0x7')](),controller[_0x16d7('0x8')]);router[_0x16d7('0x9')](_0x16d7('0xa'),auth[_0x16d7('0x7')](),controller[_0x16d7('0xb')]);router['get']('/:id',auth[_0x16d7('0x7')](),controller[_0x16d7('0xc')]);router['get'](_0x16d7('0xd'),auth[_0x16d7('0x7')](),controller[_0x16d7('0xe')]);router[_0x16d7('0x9')]('/campaign/countAttributes/:id',auth['isAuthenticated'](),controller[_0x16d7('0xf')]);router[_0x16d7('0x10')](_0x16d7('0x11'),auth[_0x16d7('0x7')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x16d7('0x10')](_0x16d7('0x12'),auth[_0x16d7('0x7')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x16d7('0x10')](_0x16d7('0x13'),auth['isAuthenticated'](),controller[_0x16d7('0x14')]);router[_0x16d7('0x15')](_0x16d7('0x16'),auth['isAuthenticated'](),controller[_0x16d7('0x17')]);module[_0x16d7('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index b6a6300..58f656f 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 _0xe241=['exports','INTEGER','STRING','DATE','BOOLEAN','sequelize'];(function(_0x960b64,_0x1a8a15){var _0x5e4af8=function(_0x986714){while(--_0x986714){_0x960b64['push'](_0x960b64['shift']());}};_0x5e4af8(++_0x1a8a15);}(_0xe241,0x14f));var _0x1e24=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xe241[_0x5a776b];return _0xbbef59;};'use strict';var Sequelize=require(_0x1e24('0x0'));module[_0x1e24('0x1')]={'state':{'type':Sequelize[_0x1e24('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x1e24('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1e24('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x1e24('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x1e24('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x1e24('0x3')]},'calleridnum':{'type':Sequelize[_0x1e24('0x3')]},'calleridname':{'type':Sequelize[_0x1e24('0x3')]},'starttime':{'type':Sequelize[_0x1e24('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x1e24('0x4')]},'droptime':{'type':Sequelize[_0x1e24('0x4')]},'endtime':{'type':Sequelize[_0x1e24('0x4')]},'ringtime':{'type':Sequelize[_0x1e24('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x1e24('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x1e24('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x1e24('0x3')]},'campaigntype':{'type':Sequelize[_0x1e24('0x3')]},'membername':{'type':Sequelize[_0x1e24('0x3')]},'reason':{'type':Sequelize[_0x1e24('0x3')]},'amd':{'type':Sequelize[_0x1e24('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x1e24('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x1e24('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1e24('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1e24('0x4')]},'recallme':{'type':Sequelize[_0x1e24('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x1e24('0x4')]},'edited':{'type':Sequelize[_0x1e24('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x1e24('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1e24('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1e24('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x22b1=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x2f6e51,_0xec8f33){var _0x40ad78=function(_0x23fb1a){while(--_0x23fb1a){_0x2f6e51['push'](_0x2f6e51['shift']());}};_0x40ad78(++_0xec8f33);}(_0x22b1,0xf2));var _0x122b=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x22b1[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x122b('0x0'));module[_0x122b('0x1')]={'state':{'type':Sequelize[_0x122b('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x122b('0x3')]},'scheduledat':{'type':Sequelize[_0x122b('0x4')]},'countbusyretry':{'type':Sequelize[_0x122b('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x122b('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x122b('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x122b('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x122b('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x122b('0x3')]},'calleridnum':{'type':Sequelize[_0x122b('0x3')]},'calleridname':{'type':Sequelize[_0x122b('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x122b('0x4')]},'answertime':{'type':Sequelize[_0x122b('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x122b('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x122b('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x122b('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x122b('0x3')]},'campaign':{'type':Sequelize[_0x122b('0x3')]},'campaigntype':{'type':Sequelize[_0x122b('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x122b('0x3')]},'amd':{'type':Sequelize[_0x122b('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x122b('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x122b('0x4')]},'recallme':{'type':Sequelize[_0x122b('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x122b('0x4')]},'edited':{'type':Sequelize[_0x122b('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x122b('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x122b('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x122b('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x122b('0x2')],'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 ba557ea..792fafb 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 _0x1e33=['fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','describe','uniqueid','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','index','CmHopperHistory','rawAttributes'];(function(_0x45d1fd,_0x463212){var _0xd0e542=function(_0x23ebc9){while(--_0x23ebc9){_0x45d1fd['push'](_0x45d1fd['shift']());}};_0xd0e542(++_0x463212);}(_0x1e33,0x1e4));var _0x31e3=function(_0x3dd247,_0xad3ad0){_0x3dd247=_0x3dd247-0x0;var _0x38bbd7=_0x1e33[_0x3dd247];return _0x38bbd7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x31e3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x31e3('0x1'));var jsonpatch=require(_0x31e3('0x2'));var rp=require(_0x31e3('0x3'));var moment=require(_0x31e3('0x4'));var BPromise=require(_0x31e3('0x5'));var Mustache=require(_0x31e3('0x6'));var util=require(_0x31e3('0x7'));var path=require(_0x31e3('0x8'));var sox=require(_0x31e3('0x9'));var csv=require(_0x31e3('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x31e3('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x31e3('0xc'));var toCsv=require(_0x31e3('0xa'));var querystring=require('querystring');var Papa=require(_0x31e3('0xd'));var Redis=require(_0x31e3('0xe'));var authService=require(_0x31e3('0xf'));var qs=require(_0x31e3('0x10'));var as=require(_0x31e3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x31e3('0x12'))(_0x31e3('0x13'));var utils=require('../../config/utils');var config=require(_0x31e3('0x14'));var db=require(_0x31e3('0x15'))['db'];function respondWithStatusCode(_0x482943,_0x4c21d7){_0x4c21d7=_0x4c21d7||0xcc;return function(_0x505b5a){if(_0x505b5a){return _0x482943['sendStatus'](_0x4c21d7);}return _0x482943[_0x31e3('0x16')](_0x4c21d7)[_0x31e3('0x17')]();};}function respondWithResult(_0x4a1ba8,_0x2e0337){_0x2e0337=_0x2e0337||0xc8;return function(_0x167c08){if(_0x167c08){return _0x4a1ba8['status'](_0x2e0337)[_0x31e3('0x18')](_0x167c08);}};}function respondWithFilteredResult(_0x48815d,_0x566bc8){return function(_0x2b676f){if(_0x2b676f){var _0x2eb17b=_0x2b676f[_0x31e3('0x19')],_0x3a9c70=_0x566bc8['offset'],_0x43f26e=_0x566bc8[_0x31e3('0x1a')]+_0x566bc8[_0x31e3('0x1b')],_0x5c09f8;if(_0x43f26e>=_0x2eb17b){_0x43f26e=_0x2eb17b;_0x5c09f8=0xc8;}else{_0x5c09f8=0xce;}_0x48815d[_0x31e3('0x16')](_0x5c09f8);return _0x48815d[_0x31e3('0x1c')](_0x31e3('0x1d'),_0x3a9c70+'-'+_0x43f26e+'/'+_0x2eb17b)[_0x31e3('0x18')](_0x2b676f);}return null;};}function patchUpdates(_0x5a467c){return function(_0x31b40a){try{jsonpatch['apply'](_0x31b40a,_0x5a467c,!![]);}catch(_0x102d80){return BPromise[_0x31e3('0x1e')](_0x102d80);}return _0x31b40a['save']();};}function saveUpdates(_0x2aae39,_0x286df5){return function(_0x3b4518){if(_0x3b4518){return _0x3b4518[_0x31e3('0x1f')](_0x2aae39)[_0x31e3('0x20')](function(_0x5dbd5c){return _0x5dbd5c;});}return null;};}function removeEntity(_0x14dce7,_0x59b382){return function(_0x262b5d){if(_0x262b5d){return _0x262b5d[_0x31e3('0x21')]()[_0x31e3('0x20')](function(){_0x14dce7[_0x31e3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39a5e3,_0x469947){return function(_0x34f326){if(!_0x34f326){_0x39a5e3[_0x31e3('0x22')](0x194);}return _0x34f326;};}function handleError(_0x5b6e82,_0x3102ca){_0x3102ca=_0x3102ca||0x1f4;return function(_0x1bcef9){logger[_0x31e3('0x23')](_0x1bcef9[_0x31e3('0x24')]);if(_0x1bcef9[_0x31e3('0x25')]){delete _0x1bcef9[_0x31e3('0x25')];}_0x5b6e82[_0x31e3('0x16')](_0x3102ca)['send'](_0x1bcef9);};}exports[_0x31e3('0x26')]=function(_0x10fd3a,_0x4c4edb){var _0x3ba10f={},_0x2a9040={},_0x31cfdb={'count':0x0,'rows':[]};var _0x5c9bcd=_['map'](db[_0x31e3('0x27')][_0x31e3('0x28')],function(_0x5aaa2b){return{'name':_0x5aaa2b[_0x31e3('0x29')],'type':_0x5aaa2b[_0x31e3('0x2a')][_0x31e3('0x2b')]};});_0x2a9040['model']=_['map'](_0x5c9bcd,_0x31e3('0x25'));_0x2a9040[_0x31e3('0x2c')]=_[_0x31e3('0x2d')](_0x10fd3a['query']);_0x2a9040[_0x31e3('0x2e')]=_[_0x31e3('0x2f')](_0x2a9040[_0x31e3('0x30')],_0x2a9040[_0x31e3('0x2c')]);_0x3ba10f[_0x31e3('0x31')]=_[_0x31e3('0x2f')](_0x2a9040['model'],qs['fields'](_0x10fd3a['query'][_0x31e3('0x32')]));_0x3ba10f[_0x31e3('0x31')]=_0x3ba10f['attributes'][_0x31e3('0x33')]?_0x3ba10f['attributes']:_0x2a9040[_0x31e3('0x30')];if(!_0x10fd3a[_0x31e3('0x2c')][_0x31e3('0x34')](_0x31e3('0x35'))){_0x3ba10f[_0x31e3('0x1b')]=qs[_0x31e3('0x1b')](_0x10fd3a[_0x31e3('0x2c')]['limit']);_0x3ba10f[_0x31e3('0x1a')]=qs[_0x31e3('0x1a')](_0x10fd3a[_0x31e3('0x2c')][_0x31e3('0x1a')]);}_0x3ba10f[_0x31e3('0x36')]=qs[_0x31e3('0x37')](_0x10fd3a['query']['sort']);_0x3ba10f[_0x31e3('0x38')]=qs[_0x31e3('0x2e')](_[_0x31e3('0x39')](_0x10fd3a[_0x31e3('0x2c')],_0x2a9040[_0x31e3('0x2e')]));if(_0x10fd3a['query'][_0x31e3('0x3a')]){_0x3ba10f[_0x31e3('0x38')]=_[_0x31e3('0x3b')](_0x3ba10f[_0x31e3('0x38')],{'$or':_[_0x31e3('0x3c')](_0x5c9bcd,function(_0x3896ea){if(_0x3896ea['type']!==_0x31e3('0x3d')){var _0x37e471={};_0x37e471[_0x3896ea[_0x31e3('0x25')]]={'$like':'%'+_0x10fd3a['query'][_0x31e3('0x3a')]+'%'};return _0x37e471;}})});}_0x3ba10f=_[_0x31e3('0x3b')]({},_0x3ba10f,_0x10fd3a[_0x31e3('0x3e')]);var _0x5e539b={'where':_0x3ba10f[_0x31e3('0x38')]};return db[_0x31e3('0x27')][_0x31e3('0x19')](_0x5e539b)['then'](function(_0x231ab1){_0x31cfdb[_0x31e3('0x19')]=_0x231ab1;if(_0x10fd3a['query'][_0x31e3('0x3f')]){_0x3ba10f[_0x31e3('0x40')]=[{'all':!![]}];}return db[_0x31e3('0x27')][_0x31e3('0x41')](_0x3ba10f);})['then'](function(_0x573c1f){_0x31cfdb[_0x31e3('0x42')]=_0x573c1f;return _0x31cfdb;})[_0x31e3('0x20')](respondWithFilteredResult(_0x4c4edb,_0x3ba10f))[_0x31e3('0x43')](handleError(_0x4c4edb,null));};exports[_0x31e3('0x44')]=function(_0x181daa,_0x2a003d){var _0x4c4de2={'raw':!![],'where':{'id':_0x181daa['params']['id']}},_0x4557fa={};_0x4557fa['model']=_[_0x31e3('0x2d')](db[_0x31e3('0x27')][_0x31e3('0x28')]);_0x4557fa['query']=_[_0x31e3('0x2d')](_0x181daa[_0x31e3('0x2c')]);_0x4557fa['filters']=_[_0x31e3('0x2f')](_0x4557fa[_0x31e3('0x30')],_0x4557fa[_0x31e3('0x2c')]);_0x4c4de2[_0x31e3('0x31')]=_[_0x31e3('0x2f')](_0x4557fa[_0x31e3('0x30')],qs[_0x31e3('0x32')](_0x181daa[_0x31e3('0x2c')][_0x31e3('0x32')]));_0x4c4de2[_0x31e3('0x31')]=_0x4c4de2[_0x31e3('0x31')][_0x31e3('0x33')]?_0x4c4de2[_0x31e3('0x31')]:_0x4557fa[_0x31e3('0x30')];if(_0x181daa[_0x31e3('0x2c')][_0x31e3('0x3f')]){_0x4c4de2[_0x31e3('0x40')]=[{'all':!![]}];}_0x4c4de2=_[_0x31e3('0x3b')]({},_0x4c4de2,_0x181daa[_0x31e3('0x3e')]);return db[_0x31e3('0x27')][_0x31e3('0x45')](_0x4c4de2)[_0x31e3('0x20')](handleEntityNotFound(_0x2a003d,null))[_0x31e3('0x20')](respondWithResult(_0x2a003d,null))[_0x31e3('0x43')](handleError(_0x2a003d,null));};exports[_0x31e3('0x46')]=function(_0x92b8d,_0x209b3f){return db[_0x31e3('0x27')][_0x31e3('0x46')](_0x92b8d[_0x31e3('0x47')],{})[_0x31e3('0x20')](respondWithResult(_0x209b3f,0xc9))[_0x31e3('0x43')](handleError(_0x209b3f,null));};exports[_0x31e3('0x48')]=function(_0xca8990,_0x4ab3ca){return db[_0x31e3('0x27')]['describe']()[_0x31e3('0x20')](respondWithResult(_0x4ab3ca,null))[_0x31e3('0x43')](handleError(_0x4ab3ca,null));};exports['update']=function(_0x54a652,_0x412ff0){if(_0x54a652[_0x31e3('0x47')]['uniqueid']){delete _0x54a652[_0x31e3('0x47')][_0x31e3('0x49')];}return db['CmHopperHistory'][_0x31e3('0x45')]({'where':{'uniqueid':_0x54a652[_0x31e3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x412ff0,null))[_0x31e3('0x20')](saveUpdates(_0x54a652['body'],null))[_0x31e3('0x20')](respondWithResult(_0x412ff0,null))['catch'](handleError(_0x412ff0,null));}; \ No newline at end of file +var _0xbad9=['set','Content-Range','json','reject','update','then','destroy','sendStatus','error','stack','name','map','CmHopperHistory','rawAttributes','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','fields','options','find','create','body','describe','uniqueid','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','count','offset','limit'];(function(_0x549b9d,_0x5675ce){var _0x522679=function(_0x1d1525){while(--_0x1d1525){_0x549b9d['push'](_0x549b9d['shift']());}};_0x522679(++_0x5675ce);}(_0xbad9,0x1f0));var _0x9bad=function(_0x41ae56,_0x213081){_0x41ae56=_0x41ae56-0x0;var _0x6bca54=_0xbad9[_0x41ae56];return _0x6bca54;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9bad('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9bad('0x1'));var rp=require(_0x9bad('0x2'));var moment=require(_0x9bad('0x3'));var BPromise=require(_0x9bad('0x4'));var Mustache=require(_0x9bad('0x5'));var util=require(_0x9bad('0x6'));var path=require(_0x9bad('0x7'));var sox=require(_0x9bad('0x8'));var csv=require(_0x9bad('0x9'));var ejs=require(_0x9bad('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9bad('0xb'));var crypto=require(_0x9bad('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9bad('0xd'));var toCsv=require(_0x9bad('0x9'));var querystring=require(_0x9bad('0xe'));var Papa=require(_0x9bad('0xf'));var Redis=require(_0x9bad('0x10'));var authService=require(_0x9bad('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9bad('0x12'));var hardwareService=require(_0x9bad('0x13'));var logger=require(_0x9bad('0x14'))(_0x9bad('0x15'));var utils=require(_0x9bad('0x16'));var config=require('../../config/environment');var db=require(_0x9bad('0x17'))['db'];function respondWithStatusCode(_0x25308e,_0x2df7b6){_0x2df7b6=_0x2df7b6||0xcc;return function(_0xff1dbd){if(_0xff1dbd){return _0x25308e['sendStatus'](_0x2df7b6);}return _0x25308e['status'](_0x2df7b6)[_0x9bad('0x18')]();};}function respondWithResult(_0x36c33b,_0x1050b5){_0x1050b5=_0x1050b5||0xc8;return function(_0x44bc1b){if(_0x44bc1b){return _0x36c33b[_0x9bad('0x19')](_0x1050b5)['json'](_0x44bc1b);}};}function respondWithFilteredResult(_0x15a2c6,_0x596b69){return function(_0x41476a){if(_0x41476a){var _0x51b8e7=_0x41476a[_0x9bad('0x1a')],_0xd6cc7d=_0x596b69[_0x9bad('0x1b')],_0x2c5e20=_0x596b69['offset']+_0x596b69[_0x9bad('0x1c')],_0x26776f;if(_0x2c5e20>=_0x51b8e7){_0x2c5e20=_0x51b8e7;_0x26776f=0xc8;}else{_0x26776f=0xce;}_0x15a2c6[_0x9bad('0x19')](_0x26776f);return _0x15a2c6[_0x9bad('0x1d')](_0x9bad('0x1e'),_0xd6cc7d+'-'+_0x2c5e20+'/'+_0x51b8e7)[_0x9bad('0x1f')](_0x41476a);}return null;};}function patchUpdates(_0x498980){return function(_0x2b746a){try{jsonpatch['apply'](_0x2b746a,_0x498980,!![]);}catch(_0x1cf5a5){return BPromise[_0x9bad('0x20')](_0x1cf5a5);}return _0x2b746a['save']();};}function saveUpdates(_0x270e21,_0x384f44){return function(_0xd2acf2){if(_0xd2acf2){return _0xd2acf2[_0x9bad('0x21')](_0x270e21)[_0x9bad('0x22')](function(_0x3b4708){return _0x3b4708;});}return null;};}function removeEntity(_0x331726,_0x4380c3){return function(_0x1c19a1){if(_0x1c19a1){return _0x1c19a1[_0x9bad('0x23')]()[_0x9bad('0x22')](function(){_0x331726[_0x9bad('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53e0a8,_0x3f1a0f){return function(_0x9550b8){if(!_0x9550b8){_0x53e0a8[_0x9bad('0x24')](0x194);}return _0x9550b8;};}function handleError(_0x2de098,_0x682943){_0x682943=_0x682943||0x1f4;return function(_0x3b7c54){logger[_0x9bad('0x25')](_0x3b7c54[_0x9bad('0x26')]);if(_0x3b7c54[_0x9bad('0x27')]){delete _0x3b7c54[_0x9bad('0x27')];}_0x2de098[_0x9bad('0x19')](_0x682943)['send'](_0x3b7c54);};}exports['index']=function(_0x1be6d4,_0x333ab4){var _0x46bc18={},_0x3a137b={},_0x366674={'count':0x0,'rows':[]};var _0x43c895=_[_0x9bad('0x28')](db[_0x9bad('0x29')][_0x9bad('0x2a')],function(_0x3abd92){return{'name':_0x3abd92['fieldName'],'type':_0x3abd92['type'][_0x9bad('0x2b')]};});_0x3a137b[_0x9bad('0x2c')]=_[_0x9bad('0x28')](_0x43c895,_0x9bad('0x27'));_0x3a137b[_0x9bad('0x2d')]=_[_0x9bad('0x2e')](_0x1be6d4[_0x9bad('0x2d')]);_0x3a137b[_0x9bad('0x2f')]=_[_0x9bad('0x30')](_0x3a137b[_0x9bad('0x2c')],_0x3a137b[_0x9bad('0x2d')]);_0x46bc18['attributes']=_[_0x9bad('0x30')](_0x3a137b[_0x9bad('0x2c')],qs['fields'](_0x1be6d4[_0x9bad('0x2d')]['fields']));_0x46bc18[_0x9bad('0x31')]=_0x46bc18[_0x9bad('0x31')][_0x9bad('0x32')]?_0x46bc18['attributes']:_0x3a137b[_0x9bad('0x2c')];if(!_0x1be6d4[_0x9bad('0x2d')][_0x9bad('0x33')](_0x9bad('0x34'))){_0x46bc18['limit']=qs[_0x9bad('0x1c')](_0x1be6d4[_0x9bad('0x2d')][_0x9bad('0x1c')]);_0x46bc18['offset']=qs['offset'](_0x1be6d4[_0x9bad('0x2d')][_0x9bad('0x1b')]);}_0x46bc18[_0x9bad('0x35')]=qs['sort'](_0x1be6d4['query'][_0x9bad('0x36')]);_0x46bc18[_0x9bad('0x37')]=qs[_0x9bad('0x2f')](_[_0x9bad('0x38')](_0x1be6d4[_0x9bad('0x2d')],_0x3a137b[_0x9bad('0x2f')]));if(_0x1be6d4[_0x9bad('0x2d')][_0x9bad('0x39')]){_0x46bc18[_0x9bad('0x37')]=_[_0x9bad('0x3a')](_0x46bc18['where'],{'$or':_['map'](_0x43c895,function(_0x1b8bb){if(_0x1b8bb[_0x9bad('0x3b')]!==_0x9bad('0x3c')){var _0x4fca9f={};_0x4fca9f[_0x1b8bb[_0x9bad('0x27')]]={'$like':'%'+_0x1be6d4[_0x9bad('0x2d')]['filter']+'%'};return _0x4fca9f;}})});}_0x46bc18=_[_0x9bad('0x3a')]({},_0x46bc18,_0x1be6d4['options']);var _0xf7bbb5={'where':_0x46bc18[_0x9bad('0x37')]};return db[_0x9bad('0x29')][_0x9bad('0x1a')](_0xf7bbb5)[_0x9bad('0x22')](function(_0x2435aa){_0x366674['count']=_0x2435aa;if(_0x1be6d4[_0x9bad('0x2d')][_0x9bad('0x3d')]){_0x46bc18[_0x9bad('0x3e')]=[{'all':!![]}];}return db[_0x9bad('0x29')][_0x9bad('0x3f')](_0x46bc18);})[_0x9bad('0x22')](function(_0x26e872){_0x366674[_0x9bad('0x40')]=_0x26e872;return _0x366674;})[_0x9bad('0x22')](respondWithFilteredResult(_0x333ab4,_0x46bc18))[_0x9bad('0x41')](handleError(_0x333ab4,null));};exports[_0x9bad('0x42')]=function(_0x23ceb9,_0x35c12b){var _0x3774b9={'raw':!![],'where':{'id':_0x23ceb9[_0x9bad('0x43')]['id']}},_0xcfeb6f={};_0xcfeb6f[_0x9bad('0x2c')]=_[_0x9bad('0x2e')](db[_0x9bad('0x29')][_0x9bad('0x2a')]);_0xcfeb6f[_0x9bad('0x2d')]=_[_0x9bad('0x2e')](_0x23ceb9['query']);_0xcfeb6f[_0x9bad('0x2f')]=_[_0x9bad('0x30')](_0xcfeb6f['model'],_0xcfeb6f[_0x9bad('0x2d')]);_0x3774b9[_0x9bad('0x31')]=_[_0x9bad('0x30')](_0xcfeb6f[_0x9bad('0x2c')],qs[_0x9bad('0x44')](_0x23ceb9[_0x9bad('0x2d')][_0x9bad('0x44')]));_0x3774b9[_0x9bad('0x31')]=_0x3774b9[_0x9bad('0x31')][_0x9bad('0x32')]?_0x3774b9[_0x9bad('0x31')]:_0xcfeb6f[_0x9bad('0x2c')];if(_0x23ceb9[_0x9bad('0x2d')][_0x9bad('0x3d')]){_0x3774b9['include']=[{'all':!![]}];}_0x3774b9=_[_0x9bad('0x3a')]({},_0x3774b9,_0x23ceb9[_0x9bad('0x45')]);return db[_0x9bad('0x29')][_0x9bad('0x46')](_0x3774b9)[_0x9bad('0x22')](handleEntityNotFound(_0x35c12b,null))['then'](respondWithResult(_0x35c12b,null))[_0x9bad('0x41')](handleError(_0x35c12b,null));};exports[_0x9bad('0x47')]=function(_0xd1a686,_0x596323){return db[_0x9bad('0x29')][_0x9bad('0x47')](_0xd1a686[_0x9bad('0x48')],{})['then'](respondWithResult(_0x596323,0xc9))[_0x9bad('0x41')](handleError(_0x596323,null));};exports[_0x9bad('0x49')]=function(_0x4173d1,_0x29af49){return db['CmHopperHistory'][_0x9bad('0x49')]()['then'](respondWithResult(_0x29af49,null))['catch'](handleError(_0x29af49,null));};exports[_0x9bad('0x21')]=function(_0x1d915d,_0xc337cb){if(_0x1d915d[_0x9bad('0x48')][_0x9bad('0x4a')]){delete _0x1d915d[_0x9bad('0x48')][_0x9bad('0x4a')];}return db[_0x9bad('0x29')][_0x9bad('0x46')]({'where':{'uniqueid':_0x1d915d[_0x9bad('0x43')]['id']}})['then'](handleEntityNotFound(_0xc337cb,null))[_0x9bad('0x22')](saveUpdates(_0x1d915d[_0x9bad('0x48')],null))['then'](respondWithResult(_0xc337cb,null))[_0x9bad('0x41')](handleError(_0xc337cb,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 7109d66..c39d557 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 _0xa5a9=['path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','uniqueid','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x10b745,_0x1eaf04){var _0x2d34b9=function(_0x45b22f){while(--_0x45b22f){_0x10b745['push'](_0x10b745['shift']());}};_0x2d34b9(++_0x1eaf04);}(_0xa5a9,0x135));var _0x9a5a=function(_0x2eb15c,_0x21c769){_0x2eb15c=_0x2eb15c-0x0;var _0x523ed4=_0xa5a9[_0x2eb15c];return _0x523ed4;};'use strict';var _=require(_0x9a5a('0x0'));var util=require(_0x9a5a('0x1'));var logger=require(_0x9a5a('0x2'))(_0x9a5a('0x3'));var moment=require(_0x9a5a('0x4'));var BPromise=require('bluebird');var rp=require(_0x9a5a('0x5'));var fs=require('fs');var path=require(_0x9a5a('0x6'));var rimraf=require(_0x9a5a('0x7'));var config=require(_0x9a5a('0x8'));var attributes=require(_0x9a5a('0x9'));module[_0x9a5a('0xa')]=function(_0x252069,_0x44c30){return _0x252069[_0x9a5a('0xb')](_0x9a5a('0xc'),attributes,{'tableName':_0x9a5a('0xd'),'paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':_0x9a5a('0xe'),'fields':[_0x9a5a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa6d6=['endtime','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','./cmHopperHistory.attributes','exports','define','CmHopperHistory'];(function(_0x3ea61c,_0x42150f){var _0x5a9497=function(_0x454713){while(--_0x454713){_0x3ea61c['push'](_0x3ea61c['shift']());}};_0x5a9497(++_0x42150f);}(_0xa6d6,0xab));var _0x6a6d=function(_0x70173d,_0x2373c0){_0x70173d=_0x70173d-0x0;var _0x13621d=_0xa6d6[_0x70173d];return _0x13621d;};'use strict';var _=require(_0x6a6d('0x0'));var util=require(_0x6a6d('0x1'));var logger=require('../../config/logger')(_0x6a6d('0x2'));var moment=require(_0x6a6d('0x3'));var BPromise=require(_0x6a6d('0x4'));var rp=require(_0x6a6d('0x5'));var fs=require('fs');var path=require(_0x6a6d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6a6d('0x7'));module[_0x6a6d('0x8')]=function(_0x3784d2,_0x164900){return _0x3784d2[_0x6a6d('0x9')](_0x6a6d('0xa'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':[_0x6a6d('0xb')]},{'name':_0x6a6d('0xc'),'fields':[_0x6a6d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 79a5800..0aa5659 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 _0xa571=['CreateCmHopperHistory','CmHopperHistory','create','body','options','AvgHandleTime','findAll','raw','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa571,0x107));var _0x1a57=function(_0x4676cc,_0x5da0a0){_0x4676cc=_0x4676cc-0x0;var _0x19c34f=_0xa571[_0x4676cc];return _0x19c34f;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var moment=require(_0x1a57('0x2'));var BPromise=require(_0x1a57('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a57('0x4'));var db=require(_0x1a57('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1a57('0x6'));var config=require('../../config/environment');var jayson=require(_0x1a57('0x7'));var client=jayson[_0x1a57('0x8')][_0x1a57('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c5352,_0x2492f5,_0x924873){return new BPromise(function(_0x5d9f45,_0x3edb40){return client[_0x1a57('0xa')](_0x3c5352,_0x924873)[_0x1a57('0xb')](function(_0x58e266){logger[_0x1a57('0xc')](_0x1a57('0xd'),_0x2492f5,_0x1a57('0xe'));logger[_0x1a57('0xf')](_0x1a57('0x10'),_0x2492f5,_0x1a57('0xe'),JSON[_0x1a57('0x11')](_0x58e266));if(_0x58e266[_0x1a57('0x12')]){if(_0x58e266['error']['code']===0x1f4){logger[_0x1a57('0x12')](_0x1a57('0xd'),_0x2492f5,_0x58e266[_0x1a57('0x12')]['message']);return _0x3edb40(_0x58e266[_0x1a57('0x12')][_0x1a57('0x13')]);}logger['error'](_0x1a57('0xd'),_0x2492f5,_0x58e266['error'][_0x1a57('0x13')]);return _0x5d9f45(_0x58e266[_0x1a57('0x12')][_0x1a57('0x13')]);}else{logger[_0x1a57('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x2492f5,_0x1a57('0xe'));_0x5d9f45(_0x58e266['result']['message']);}})[_0x1a57('0x14')](function(_0x1c537f){logger[_0x1a57('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x2492f5,_0x1c537f);_0x3edb40(_0x1c537f);});});}exports[_0x1a57('0x15')]=function(_0x1662a3){var _0x80f8c1=this;return new Promise(function(_0x53bb20,_0x3daa66){return db[_0x1a57('0x16')][_0x1a57('0x17')](_0x1662a3[_0x1a57('0x18')],{'raw':_0x1662a3[_0x1a57('0x19')]?_0x1662a3['options']['raw']===undefined?!![]:![]:!![]})[_0x1a57('0xb')](function(_0x21e811){logger[_0x1a57('0xc')]('CreateCmHopperHistory',_0x1662a3);logger['debug']('CreateCmHopperHistory',_0x1662a3,JSON[_0x1a57('0x11')](_0x21e811));_0x53bb20(_0x21e811);})[_0x1a57('0x14')](function(_0x3f52b9){logger[_0x1a57('0x12')](_0x1a57('0x15'),_0x3f52b9[_0x1a57('0x13')],_0x1662a3);_0x3daa66(_0x80f8c1[_0x1a57('0x12')](0x1f4,_0x3f52b9[_0x1a57('0x13')]));});});};exports[_0x1a57('0x1a')]=function(_0x35d5dc){var _0x29e7cd=this;return new Promise(function(_0x36b17e,_0x26cdd3){return db[_0x1a57('0x16')][_0x1a57('0x1b')]({'raw':_0x35d5dc[_0x1a57('0x19')]?_0x35d5dc[_0x1a57('0x19')][_0x1a57('0x1c')]===undefined?!![]:![]:!![],'where':_0x35d5dc[_0x1a57('0x19')]?_0x35d5dc[_0x1a57('0x19')][_0x1a57('0x1d')]||null:null,'attributes':[[db[_0x1a57('0x1e')]['fn']('COUNT',db['sequelize'][_0x1a57('0x1f')]('id')),_0x1a57('0x20')],[db['sequelize']['fn'](_0x1a57('0x21'),db['sequelize']['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0x1a57('0x23')],[db[_0x1a57('0x1e')]['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')]['fn']('IF',db['sequelize'][_0x1a57('0x22')](_0x1a57('0x24')))),_0x1a57('0x25')],[db[_0x1a57('0x1e')]['fn']('COUNT',db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')](_0x1a57('0x26')))),_0x1a57('0x27')],[db[_0x1a57('0x1e')]['fn'](_0x1a57('0x28'),db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')]['literal'](_0x1a57('0x29')))),_0x1a57('0x2a')],[db['sequelize']['fn']('AVG',db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')](_0x1a57('0x2b')))),_0x1a57('0x2c')]]})[_0x1a57('0xb')](function(_0xe80d94){logger[_0x1a57('0xc')](_0x1a57('0x1a'),_0x35d5dc);logger[_0x1a57('0xf')](_0x1a57('0x1a'),_0x35d5dc,JSON[_0x1a57('0x11')](_0xe80d94));_0x36b17e(_0xe80d94);})[_0x1a57('0x14')](function(_0x1a6231){logger[_0x1a57('0x12')](_0x1a57('0x1a'),_0x1a6231[_0x1a57('0x13')],_0x35d5dc);_0x26cdd3(_0x29e7cd[_0x1a57('0x12')](0x1f4,_0x1a6231['message']));});});};exports[_0x1a57('0x2d')]=function(_0x173671){var _0x137920=this;return new Promise(function(_0x3dad7c,_0x58b7dc){return db[_0x1a57('0x16')][_0x1a57('0x1b')]({'raw':_0x173671[_0x1a57('0x19')]?_0x173671[_0x1a57('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x173671['options']?_0x173671['options']['where']||null:null,'attributes':[[_0x1a57('0x2e'),_0x1a57('0x2f')],[db[_0x1a57('0x1e')]['fn']('COUNT',db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')](_0x1a57('0x30')))),'outboundNoSuchCallsDay'],[db[_0x1a57('0x1e')]['fn']('COUNT',db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')]('`state`\x20=\x203,\x201,\x20null'))),_0x1a57('0x31')],[db[_0x1a57('0x1e')]['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')]['literal'](_0x1a57('0x32')))),'outboundAnswerCallsDay'],[db['sequelize']['fn'](_0x1a57('0x21'),db['sequelize']['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')](_0x1a57('0x33')))),'outboundBusyCallsDay'],[db[_0x1a57('0x1e')]['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')]['literal'](_0x1a57('0x34')))),_0x1a57('0x35')],[db['sequelize']['fn'](_0x1a57('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0x1a57('0x22')](_0x1a57('0x36')))),_0x1a57('0x37')],[db[_0x1a57('0x1e')]['fn']('COUNT',db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')](_0x1a57('0x38')))),_0x1a57('0x39')],[db['sequelize']['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')]('`state`\x20=\x2012,\x201,\x20null'))),_0x1a57('0x3a')],[db['sequelize']['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')](_0x1a57('0x3b')))),_0x1a57('0x3c')],[db[_0x1a57('0x1e')]['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')](_0x1a57('0x3d')))),_0x1a57('0x3e')],[db['sequelize']['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')](_0x1a57('0x3f')))),_0x1a57('0x40')],[db[_0x1a57('0x1e')]['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')]('`state`\x20=\x2016,\x201,\x20null'))),_0x1a57('0x41')],[db[_0x1a57('0x1e')]['fn']('COUNT',db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')]['literal'](_0x1a57('0x42')))),_0x1a57('0x40')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x1a57('0x43')]],'group':[_0x1a57('0x2e')]})['then'](function(_0x5e510e){logger['info'](_0x1a57('0x2d'),_0x173671);logger[_0x1a57('0xf')](_0x1a57('0x2d'),_0x173671,JSON[_0x1a57('0x11')](_0x5e510e));_0x3dad7c(_0x5e510e);})[_0x1a57('0x14')](function(_0x33379c){logger[_0x1a57('0x12')](_0x1a57('0x2d'),_0x33379c['message'],_0x173671);_0x58b7dc(_0x137920['error'](0x1f4,_0x33379c['message']));});});};exports['GetCampaignHopperHistory']=function(_0x554208){var _0xd0261c=this;return new Promise(function(_0x13c04d,_0xcba9f0){return db[_0x1a57('0x16')][_0x1a57('0x1b')]({'raw':_0x554208[_0x1a57('0x19')]?_0x554208[_0x1a57('0x19')][_0x1a57('0x1c')]===undefined?!![]:![]:!![],'where':_0x554208['options']?_0x554208['options']['where']||null:null,'attributes':[[_0x1a57('0x2e'),'name'],[db[_0x1a57('0x1e')]['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')][_0x1a57('0x1f')]('id')),_0x1a57('0x44')],[db[_0x1a57('0x1e')]['fn'](_0x1a57('0x21'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x1a57('0x32')))),_0x1a57('0x45')]],'group':[_0x1a57('0x2e')]})[_0x1a57('0xb')](function(_0x2db770){logger[_0x1a57('0xc')](_0x1a57('0x46'),_0x554208);logger['debug']('GetCampaignHopperHistory',_0x554208,JSON[_0x1a57('0x11')](_0x2db770));_0x13c04d(_0x2db770);})[_0x1a57('0x14')](function(_0x231154){logger[_0x1a57('0x12')](_0x1a57('0x46'),_0x231154[_0x1a57('0x13')],_0x554208);_0xcba9f0(_0xd0261c['error'](0x1f4,_0x231154['message']));});});}; \ No newline at end of file +var _0xac4a=['COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`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','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','AvgHandleTime','findAll','where','sequelize'];(function(_0x4bb147,_0x326c8a){var _0x244a7f=function(_0x15e3ec){while(--_0x15e3ec){_0x4bb147['push'](_0x4bb147['shift']());}};_0x244a7f(++_0x326c8a);}(_0xac4a,0x13f));var _0xaac4=function(_0x54e61e,_0x3c4a47){_0x54e61e=_0x54e61e-0x0;var _0x5e3895=_0xac4a[_0x54e61e];return _0x5e3895;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});}exports[_0xaac4('0x15')]=function(_0x52085a){var _0x220630=this;return new Promise(function(_0x5b6fd6,_0x3ce35a){return db[_0xaac4('0x16')][_0xaac4('0x17')](_0x52085a[_0xaac4('0x18')],{'raw':_0x52085a[_0xaac4('0x19')]?_0x52085a[_0xaac4('0x19')][_0xaac4('0x1a')]===undefined?!![]:![]:!![]})[_0xaac4('0xa')](function(_0x4166ee){logger['info'](_0xaac4('0x15'),_0x52085a);logger['debug'](_0xaac4('0x15'),_0x52085a,JSON[_0xaac4('0xf')](_0x4166ee));_0x5b6fd6(_0x4166ee);})[_0xaac4('0x14')](function(_0x477b77){logger[_0xaac4('0x10')](_0xaac4('0x15'),_0x477b77['message'],_0x52085a);_0x3ce35a(_0x220630[_0xaac4('0x10')](0x1f4,_0x477b77[_0xaac4('0x12')]));});});};exports[_0xaac4('0x1b')]=function(_0x4f10ec){var _0x3dd059=this;return new Promise(function(_0x2dcc59,_0xb2577b){return db['CmHopperHistory'][_0xaac4('0x1c')]({'raw':_0x4f10ec['options']?_0x4f10ec['options']['raw']===undefined?!![]:![]:!![],'where':_0x4f10ec['options']?_0x4f10ec[_0xaac4('0x19')][_0xaac4('0x1d')]||null:null,'attributes':[[db[_0xaac4('0x1e')]['fn'](_0xaac4('0x1f'),db[_0xaac4('0x1e')][_0xaac4('0x20')]('id')),_0xaac4('0x21')],[db[_0xaac4('0x1e')]['fn'](_0xaac4('0x1f'),db[_0xaac4('0x1e')]['fn']('IF',db['sequelize'][_0xaac4('0x22')](_0xaac4('0x23')))),_0xaac4('0x24')],[db[_0xaac4('0x1e')]['fn'](_0xaac4('0x1f'),db[_0xaac4('0x1e')]['fn']('IF',db['sequelize'][_0xaac4('0x22')]('`state`\x20=\x2010,\x201,\x20null'))),_0xaac4('0x25')],[db[_0xaac4('0x1e')]['fn'](_0xaac4('0x1f'),db[_0xaac4('0x1e')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011,\x201,\x20null'))),_0xaac4('0x26')],[db[_0xaac4('0x1e')]['fn'](_0xaac4('0x27'),db[_0xaac4('0x1e')]['fn']('IF',db[_0xaac4('0x1e')][_0xaac4('0x22')](_0xaac4('0x28')))),_0xaac4('0x29')],[db[_0xaac4('0x1e')]['fn'](_0xaac4('0x27'),db[_0xaac4('0x1e')]['fn']('IF',db[_0xaac4('0x1e')][_0xaac4('0x22')](_0xaac4('0x2a')))),_0xaac4('0x2b')]]})['then'](function(_0x5bad9f){logger[_0xaac4('0xb')](_0xaac4('0x1b'),_0x4f10ec);logger[_0xaac4('0xc')]('AvgHandleTime',_0x4f10ec,JSON[_0xaac4('0xf')](_0x5bad9f));_0x2dcc59(_0x5bad9f);})[_0xaac4('0x14')](function(_0x2cbf8d){logger[_0xaac4('0x10')](_0xaac4('0x1b'),_0x2cbf8d[_0xaac4('0x12')],_0x4f10ec);_0xb2577b(_0x3dd059[_0xaac4('0x10')](0x1f4,_0x2cbf8d['message']));});});};exports[_0xaac4('0x2c')]=function(_0x31ec51){var _0x1ffa56=this;return new Promise(function(_0x5d64a2,_0x36d84a){return db['CmHopperHistory']['findAll']({'raw':_0x31ec51[_0xaac4('0x19')]?_0x31ec51[_0xaac4('0x19')][_0xaac4('0x1a')]===undefined?!![]:![]:!![],'where':_0x31ec51['options']?_0x31ec51['options'][_0xaac4('0x1d')]||null:null,'attributes':[[_0xaac4('0x2d'),_0xaac4('0x2e')],[db[_0xaac4('0x1e')]['fn'](_0xaac4('0x1f'),db[_0xaac4('0x1e')]['fn']('IF',db['sequelize']['literal'](_0xaac4('0x2f')))),_0xaac4('0x30')],[db['sequelize']['fn'](_0xaac4('0x1f'),db[_0xaac4('0x1e')]['fn']('IF',db[_0xaac4('0x1e')]['literal'](_0xaac4('0x31')))),_0xaac4('0x32')],[db[_0xaac4('0x1e')]['fn']('COUNT',db[_0xaac4('0x1e')]['fn']('IF',db[_0xaac4('0x1e')][_0xaac4('0x22')](_0xaac4('0x23')))),'outboundAnswerCallsDay'],[db[_0xaac4('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xaac4('0x1e')][_0xaac4('0x22')](_0xaac4('0x33')))),_0xaac4('0x34')],[db[_0xaac4('0x1e')]['fn'](_0xaac4('0x1f'),db[_0xaac4('0x1e')]['fn']('IF',db[_0xaac4('0x1e')]['literal'](_0xaac4('0x35')))),_0xaac4('0x36')],[db[_0xaac4('0x1e')]['fn'](_0xaac4('0x1f'),db['sequelize']['fn']('IF',db[_0xaac4('0x1e')][_0xaac4('0x22')](_0xaac4('0x37')))),'outboundDropCallsDayTimeout'],[db[_0xaac4('0x1e')]['fn'](_0xaac4('0x1f'),db[_0xaac4('0x1e')]['fn']('IF',db[_0xaac4('0x1e')]['literal'](_0xaac4('0x38')))),_0xaac4('0x39')],[db[_0xaac4('0x1e')]['fn']('COUNT',db[_0xaac4('0x1e')]['fn']('IF',db[_0xaac4('0x1e')][_0xaac4('0x22')](_0xaac4('0x3a')))),_0xaac4('0x3b')],[db[_0xaac4('0x1e')]['fn'](_0xaac4('0x1f'),db[_0xaac4('0x1e')]['fn']('IF',db[_0xaac4('0x1e')]['literal'](_0xaac4('0x3c')))),_0xaac4('0x3d')],[db[_0xaac4('0x1e')]['fn'](_0xaac4('0x1f'),db[_0xaac4('0x1e')]['fn']('IF',db['sequelize']['literal'](_0xaac4('0x3e')))),_0xaac4('0x3f')],[db[_0xaac4('0x1e')]['fn'](_0xaac4('0x1f'),db['sequelize']['fn']('IF',db[_0xaac4('0x1e')]['literal'](_0xaac4('0x40')))),_0xaac4('0x41')],[db['sequelize']['fn'](_0xaac4('0x1f'),db[_0xaac4('0x1e')]['fn']('IF',db[_0xaac4('0x1e')]['literal']('`state`\x20=\x2016,\x201,\x20null'))),_0xaac4('0x42')],[db[_0xaac4('0x1e')]['fn'](_0xaac4('0x1f'),db[_0xaac4('0x1e')]['fn']('IF',db[_0xaac4('0x1e')][_0xaac4('0x22')]('`state`\x20=\x2020,\x201,\x20null'))),_0xaac4('0x41')],[db[_0xaac4('0x1e')]['fn'](_0xaac4('0x1f'),db[_0xaac4('0x1e')]['fn']('IF',db['sequelize'][_0xaac4('0x22')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xaac4('0x43')]],'group':[_0xaac4('0x2d')]})[_0xaac4('0xa')](function(_0x3922a0){logger[_0xaac4('0xb')](_0xaac4('0x2c'),_0x31ec51);logger[_0xaac4('0xc')](_0xaac4('0x2c'),_0x31ec51,JSON[_0xaac4('0xf')](_0x3922a0));_0x5d64a2(_0x3922a0);})[_0xaac4('0x14')](function(_0x1a637e){logger[_0xaac4('0x10')](_0xaac4('0x2c'),_0x1a637e[_0xaac4('0x12')],_0x31ec51);_0x36d84a(_0x1ffa56['error'](0x1f4,_0x1a637e[_0xaac4('0x12')]));});});};exports[_0xaac4('0x44')]=function(_0x1f0e9f){var _0x1e6e0e=this;return new Promise(function(_0x3b39a1,_0x10e218){return db[_0xaac4('0x16')][_0xaac4('0x1c')]({'raw':_0x1f0e9f['options']?_0x1f0e9f[_0xaac4('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1f0e9f[_0xaac4('0x19')]?_0x1f0e9f['options'][_0xaac4('0x1d')]||null:null,'attributes':[['campaign','name'],[db[_0xaac4('0x1e')]['fn'](_0xaac4('0x1f'),db['sequelize'][_0xaac4('0x20')]('id')),_0xaac4('0x45')],[db[_0xaac4('0x1e')]['fn'](_0xaac4('0x1f'),db[_0xaac4('0x1e')]['fn']('IF',db[_0xaac4('0x1e')]['literal'](_0xaac4('0x23')))),'ivrAnswerCallsDay']],'group':[_0xaac4('0x2d')]})['then'](function(_0x4dcc7d){logger['info'](_0xaac4('0x44'),_0x1f0e9f);logger[_0xaac4('0xc')](_0xaac4('0x44'),_0x1f0e9f,JSON[_0xaac4('0xf')](_0x4dcc7d));_0x3b39a1(_0x4dcc7d);})['catch'](function(_0x372f96){logger[_0xaac4('0x10')](_0xaac4('0x44'),_0x372f96['message'],_0x1f0e9f);_0x10e218(_0x1e6e0e[_0xaac4('0x10')](0x1f4,_0x372f96[_0xaac4('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index fa9009f..c675a7d 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 _0xc0e1=['create','put','/:id','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xc0e1,0x147));var _0x1c0e=function(_0x15fc7a,_0xd21741){_0x15fc7a=_0x15fc7a-0x0;var _0x3aa9f4=_0xc0e1[_0x15fc7a];return _0x3aa9f4;};'use strict';var multer=require(_0x1c0e('0x0'));var util=require(_0x1c0e('0x1'));var path=require(_0x1c0e('0x2'));var timeout=require('connect-timeout');var express=require(_0x1c0e('0x3'));var router=express[_0x1c0e('0x4')]();var auth=require(_0x1c0e('0x5'));var interaction=require(_0x1c0e('0x6'));var config=require(_0x1c0e('0x7'));var controller=require(_0x1c0e('0x8'));router[_0x1c0e('0x9')]('/',auth[_0x1c0e('0xa')](),controller[_0x1c0e('0xb')]);router[_0x1c0e('0x9')](_0x1c0e('0xc'),auth[_0x1c0e('0xa')](),controller[_0x1c0e('0xd')]);router[_0x1c0e('0x9')]('/:id',auth[_0x1c0e('0xa')](),controller[_0x1c0e('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1c0e('0xf')]);router[_0x1c0e('0x10')](_0x1c0e('0x11'),auth['isAuthenticated'](),controller['update']);module[_0x1c0e('0x12')]=router; \ No newline at end of file +var _0x36cd=['express','Router','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe','describe','show','post','put','exports','util'];(function(_0x45e042,_0x99ac4e){var _0x19ef37=function(_0x3239a0){while(--_0x3239a0){_0x45e042['push'](_0x45e042['shift']());}};_0x19ef37(++_0x99ac4e);}(_0x36cd,0x1a3));var _0xd36c=function(_0x4b3d13,_0x1993d5){_0x4b3d13=_0x4b3d13-0x0;var _0xf64dd8=_0x36cd[_0x4b3d13];return _0xf64dd8;};'use strict';var multer=require('multer');var util=require(_0xd36c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd36c('0x1'));var router=express[_0xd36c('0x2')]();var auth=require(_0xd36c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd36c('0x4'));var controller=require(_0xd36c('0x5'));router[_0xd36c('0x6')]('/',auth[_0xd36c('0x7')](),controller['index']);router[_0xd36c('0x6')](_0xd36c('0x8'),auth[_0xd36c('0x7')](),controller[_0xd36c('0x9')]);router[_0xd36c('0x6')]('/:id',auth[_0xd36c('0x7')](),controller[_0xd36c('0xa')]);router[_0xd36c('0xb')]('/',auth[_0xd36c('0x7')](),controller['create']);router[_0xd36c('0xc')]('/:id',auth[_0xd36c('0x7')](),controller['update']);module[_0xd36c('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 94d6a1a..c3a1702 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 _0x093e=['sequelize','exports','name','STRING'];(function(_0x545f89,_0x34b3e5){var _0x22cfdc=function(_0x13f3ed){while(--_0x13f3ed){_0x545f89['push'](_0x545f89['shift']());}};_0x22cfdc(++_0x34b3e5);}(_0x093e,0x1b4));var _0xe093=function(_0x441e82,_0x77d687){_0x441e82=_0x441e82-0x0;var _0x5efb76=_0x093e[_0x441e82];return _0x5efb76;};'use strict';var Sequelize=require(_0xe093('0x0'));module[_0xe093('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe093('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe093('0x3')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd759=['sequelize','exports','STRING'];(function(_0x10df87,_0x4e3dcb){var _0x22923d=function(_0x439738){while(--_0x439738){_0x10df87['push'](_0x10df87['shift']());}};_0x22923d(++_0x4e3dcb);}(_0xd759,0x6c));var _0x9d75=function(_0x50bace,_0x16f8b7){_0x50bace=_0x50bace-0x0;var _0x25dc5e=_0xd759[_0x50bace];return _0x25dc5e;};'use strict';var Sequelize=require(_0x9d75('0x0'));module[_0x9d75('0x1')]={'name':{'type':Sequelize[_0x9d75('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9d75('0x2')]},'dialPrefix':{'type':Sequelize[_0x9d75('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 3084584..a401a62 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(_0x2967c1,_0x202a72){var _0x103397=function(_0x14b5cc){while(--_0x14b5cc){_0x2967c1['push'](_0x2967c1['shift']());}};_0x103397(++_0x202a72);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x323d87,_0x4ef3f9){_0x323d87=_0x323d87-0x0;var _0x5e8f74=_0xcb91[_0x323d87];return _0x5e8f74;};'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 _0xedd9=['end','json','count','offset','Content-Range','apply','save','update','then','destroy','get','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','include','rows','catch','show','params','length','includeAll','find','create','body','user','role','Lists','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','getDispositions','Disposition','findAll','removeDispositions','addContacts','CmContact','tags','isArray','join','push','omit','ids','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','cf_%d','raw','getContactsCsv','CustomFields','format','isEmpty','now','writeFileSync','setHeader','Content-disposition','list_%d_%s.csv','Content-type','download','/tmp/list_%d_%s.csv','addCustomField','addCustomFields','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','findOne','findAndCountAll','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','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','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status'];(function(_0x498ebd,_0x259e8f){var _0x4104e3=function(_0x542c6c){while(--_0x542c6c){_0x498ebd['push'](_0x498ebd['shift']());}};_0x4104e3(++_0x259e8f);}(_0xedd9,0xfc));var _0x9edd=function(_0xc75470,_0x20a365){_0xc75470=_0xc75470-0x0;var _0x51b422=_0xedd9[_0xc75470];return _0x51b422;};'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'];config[_0x9edd('0x17')]=_[_0x9edd('0x18')](config[_0x9edd('0x17')],{'host':_0x9edd('0x19'),'port':0x18eb});var socket=require(_0x9edd('0x1a'))(new Redis(config[_0x9edd('0x17')]));require('./cmList.socket')[_0x9edd('0x1b')](socket);function respondWithStatusCode(_0x44fc7c,_0x891832){_0x891832=_0x891832||0xcc;return function(_0x4d9a7){if(_0x4d9a7){return _0x44fc7c[_0x9edd('0x1c')](_0x891832);}return _0x44fc7c[_0x9edd('0x1d')](_0x891832)[_0x9edd('0x1e')]();};}function respondWithResult(_0x75a4ab,_0x4ea60f){_0x4ea60f=_0x4ea60f||0xc8;return function(_0x5f5bf4){if(_0x5f5bf4){return _0x75a4ab[_0x9edd('0x1d')](_0x4ea60f)[_0x9edd('0x1f')](_0x5f5bf4);}};}function respondWithFilteredResult(_0x5acf65,_0x1b54c0){return function(_0x35f454){if(_0x35f454){var _0x40ba32=_0x35f454[_0x9edd('0x20')],_0x4d8f33=_0x1b54c0[_0x9edd('0x21')],_0x43dc70=_0x1b54c0['offset']+_0x1b54c0['limit'],_0x5d879c;if(_0x43dc70>=_0x40ba32){_0x43dc70=_0x40ba32;_0x5d879c=0xc8;}else{_0x5d879c=0xce;}_0x5acf65[_0x9edd('0x1d')](_0x5d879c);return _0x5acf65['set'](_0x9edd('0x22'),_0x4d8f33+'-'+_0x43dc70+'/'+_0x40ba32)['json'](_0x35f454);}return null;};}function patchUpdates(_0x535f37){return function(_0x356751){try{jsonpatch[_0x9edd('0x23')](_0x356751,_0x535f37,!![]);}catch(_0x4fb7bf){return BPromise['reject'](_0x4fb7bf);}return _0x356751[_0x9edd('0x24')]();};}function saveUpdates(_0x186186,_0x477878){return function(_0x542172){if(_0x542172){return _0x542172[_0x9edd('0x25')](_0x186186)[_0x9edd('0x26')](function(_0x44a6c1){return _0x44a6c1;});}return null;};}function removeEntity(_0x2ca65f,_0x339a0d){return function(_0x4c75d2){if(_0x4c75d2){return _0x4c75d2[_0x9edd('0x27')]()[_0x9edd('0x26')](function(){var _0x3a1ea5=_0x4c75d2[_0x9edd('0x28')]({'plain':!![]});var _0x310a4d='Lists';return db['UserProfileResource'][_0x9edd('0x27')]({'where':{'type':_0x310a4d,'resourceId':_0x3a1ea5['id']}})[_0x9edd('0x26')](function(){return _0x4c75d2;});})[_0x9edd('0x26')](function(){_0x2ca65f[_0x9edd('0x1d')](0xcc)[_0x9edd('0x1e')]();});}};}function handleEntityNotFound(_0x4fe471,_0x57a2cc){return function(_0x214d0a){if(!_0x214d0a){_0x4fe471[_0x9edd('0x1c')](0x194);}return _0x214d0a;};}function handleError(_0x1c762c,_0x52746a){_0x52746a=_0x52746a||0x1f4;return function(_0x238b22){logger[_0x9edd('0x29')](_0x238b22[_0x9edd('0x2a')]);if(_0x238b22[_0x9edd('0x2b')]){delete _0x238b22['name'];}_0x1c762c[_0x9edd('0x1d')](_0x52746a)[_0x9edd('0x2c')](_0x238b22);};}exports[_0x9edd('0x2d')]=function(_0x12c1bc,_0xbbf08f){var _0x42e664={},_0x209aba={},_0x1fba7b={'count':0x0,'rows':[]};var _0x19b6c1=_[_0x9edd('0x2e')](db[_0x9edd('0x2f')][_0x9edd('0x30')],function(_0x6907a5){return{'name':_0x6907a5[_0x9edd('0x31')],'type':_0x6907a5[_0x9edd('0x32')]['key']};});_0x209aba[_0x9edd('0x33')]=_[_0x9edd('0x2e')](_0x19b6c1,_0x9edd('0x2b'));_0x209aba['query']=_[_0x9edd('0x34')](_0x12c1bc[_0x9edd('0x35')]);_0x209aba[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x209aba[_0x9edd('0x33')],_0x209aba[_0x9edd('0x35')]);_0x42e664[_0x9edd('0x38')]=_[_0x9edd('0x37')](_0x209aba[_0x9edd('0x33')],qs[_0x9edd('0x39')](_0x12c1bc[_0x9edd('0x35')][_0x9edd('0x39')]));_0x42e664[_0x9edd('0x38')]=_0x42e664[_0x9edd('0x38')]['length']?_0x42e664[_0x9edd('0x38')]:_0x209aba['model'];if(!_0x12c1bc[_0x9edd('0x35')][_0x9edd('0x3a')](_0x9edd('0x3b'))){_0x42e664[_0x9edd('0x3c')]=qs[_0x9edd('0x3c')](_0x12c1bc['query'][_0x9edd('0x3c')]);_0x42e664[_0x9edd('0x21')]=qs[_0x9edd('0x21')](_0x12c1bc[_0x9edd('0x35')][_0x9edd('0x21')]);}_0x42e664[_0x9edd('0x3d')]=qs[_0x9edd('0x3e')](_0x12c1bc[_0x9edd('0x35')][_0x9edd('0x3e')]);_0x42e664[_0x9edd('0x3f')]=qs['filters'](_[_0x9edd('0x40')](_0x12c1bc['query'],_0x209aba[_0x9edd('0x36')]));if(_0x12c1bc['query'][_0x9edd('0x41')]){_0x42e664[_0x9edd('0x3f')]=_[_0x9edd('0x42')](_0x42e664['where'],{'$or':_[_0x9edd('0x2e')](_0x19b6c1,function(_0xcbd0ef){if(_0xcbd0ef[_0x9edd('0x32')]!=='VIRTUAL'){var _0x1b5a43={};_0x1b5a43[_0xcbd0ef['name']]={'$like':'%'+_0x12c1bc[_0x9edd('0x35')][_0x9edd('0x41')]+'%'};return _0x1b5a43;}})});}_0x42e664=_['merge']({},_0x42e664,_0x12c1bc[_0x9edd('0x43')]);var _0x40fdfb={'where':_0x42e664[_0x9edd('0x3f')]};return db[_0x9edd('0x2f')]['count'](_0x40fdfb)[_0x9edd('0x26')](function(_0x5bbdf8){_0x1fba7b[_0x9edd('0x20')]=_0x5bbdf8;if(_0x12c1bc[_0x9edd('0x35')]['includeAll']){_0x42e664[_0x9edd('0x44')]=[{'all':!![]}];}return db['CmList']['findAll'](_0x42e664);})[_0x9edd('0x26')](function(_0x9cab86){_0x1fba7b[_0x9edd('0x45')]=_0x9cab86;return _0x1fba7b;})[_0x9edd('0x26')](respondWithFilteredResult(_0xbbf08f,_0x42e664))[_0x9edd('0x46')](handleError(_0xbbf08f,null));};exports[_0x9edd('0x47')]=function(_0x3ff512,_0x75efbe){var _0x18c149={'raw':![],'where':{'id':_0x3ff512[_0x9edd('0x48')]['id']}},_0x2b081a={};_0x2b081a[_0x9edd('0x33')]=_[_0x9edd('0x34')](db[_0x9edd('0x2f')][_0x9edd('0x30')]);_0x2b081a['query']=_[_0x9edd('0x34')](_0x3ff512[_0x9edd('0x35')]);_0x2b081a[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x2b081a[_0x9edd('0x33')],_0x2b081a[_0x9edd('0x35')]);_0x18c149[_0x9edd('0x38')]=_['intersection'](_0x2b081a['model'],qs['fields'](_0x3ff512[_0x9edd('0x35')]['fields']));_0x18c149[_0x9edd('0x38')]=_0x18c149[_0x9edd('0x38')][_0x9edd('0x49')]?_0x18c149[_0x9edd('0x38')]:_0x2b081a[_0x9edd('0x33')];if(_0x3ff512['query'][_0x9edd('0x4a')]){_0x18c149[_0x9edd('0x44')]=[{'all':!![]}];}_0x18c149=_[_0x9edd('0x42')]({},_0x18c149,_0x3ff512['options']);return db[_0x9edd('0x2f')][_0x9edd('0x4b')](_0x18c149)[_0x9edd('0x26')](handleEntityNotFound(_0x75efbe,null))[_0x9edd('0x26')](respondWithResult(_0x75efbe,null))[_0x9edd('0x46')](handleError(_0x75efbe,null));};exports[_0x9edd('0x4c')]=function(_0x4d4f33,_0x441e4a){return db[_0x9edd('0x2f')]['create'](_0x4d4f33[_0x9edd('0x4d')],{})[_0x9edd('0x26')](function(_0x4bb324){var _0x2bd089=_0x4d4f33[_0x9edd('0x4e')][_0x9edd('0x28')]({'plain':!![]});if(!_0x2bd089)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2bd089[_0x9edd('0x4f')]===_0x9edd('0x4e')){var _0x317a60=_0x4bb324[_0x9edd('0x28')]({'plain':!![]});var _0x53f6e3=_0x9edd('0x50');return db[_0x9edd('0x51')][_0x9edd('0x4b')]({'where':{'name':_0x53f6e3,'userProfileId':_0x2bd089['userProfileId']},'raw':!![]})[_0x9edd('0x26')](function(_0x21f6ce){if(_0x21f6ce&&_0x21f6ce['autoAssociation']===0x0){return db[_0x9edd('0x52')]['create']({'name':_0x317a60[_0x9edd('0x2b')],'resourceId':_0x317a60['id'],'type':_0x21f6ce[_0x9edd('0x2b')],'sectionId':_0x21f6ce['id']},{})[_0x9edd('0x26')](function(){return _0x4bb324;});}else{return _0x4bb324;}})[_0x9edd('0x46')](function(_0x1e3c19){logger[_0x9edd('0x29')](_0x9edd('0x53'),_0x1e3c19);throw _0x1e3c19;});}return _0x4bb324;})[_0x9edd('0x26')](respondWithResult(_0x441e4a,0xc9))[_0x9edd('0x46')](handleError(_0x441e4a,null));};exports[_0x9edd('0x25')]=function(_0x31272d,_0x5a3b1d){if(_0x31272d[_0x9edd('0x4d')]['id']){delete _0x31272d[_0x9edd('0x4d')]['id'];}return db[_0x9edd('0x2f')]['find']({'where':{'id':_0x31272d[_0x9edd('0x48')]['id']}})['then'](handleEntityNotFound(_0x5a3b1d,null))['then'](saveUpdates(_0x31272d['body'],null))[_0x9edd('0x26')](respondWithResult(_0x5a3b1d,null))[_0x9edd('0x46')](handleError(_0x5a3b1d,null));};exports[_0x9edd('0x27')]=function(_0x35ddb3,_0x48a900){return db['CmList']['find']({'where':{'id':_0x35ddb3[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x48a900,null))[_0x9edd('0x26')](removeEntity(_0x48a900,null))[_0x9edd('0x46')](handleError(_0x48a900,null));};exports[_0x9edd('0x54')]=function(_0x41ec97,_0x25906c){return db[_0x9edd('0x2f')]['describe']()[_0x9edd('0x26')](respondWithResult(_0x25906c,null))['catch'](handleError(_0x25906c,null));};exports[_0x9edd('0x55')]=function(_0x6a1cfc,_0x4b7e68,_0x22b91a){if(_0x6a1cfc[_0x9edd('0x4d')]['id']){delete _0x6a1cfc[_0x9edd('0x4d')]['id'];}return db['CmList'][_0x9edd('0x4b')]({'where':{'id':_0x6a1cfc[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x4b7e68,null))[_0x9edd('0x26')](function(_0x1720b1){if(_0x1720b1){_0x6a1cfc[_0x9edd('0x4d')]['ListId']=_0x1720b1['id'];return db['Disposition'][_0x9edd('0x4c')](_0x6a1cfc['body']);}})[_0x9edd('0x26')](respondWithResult(_0x4b7e68,null))[_0x9edd('0x46')](handleError(_0x4b7e68,null));};exports[_0x9edd('0x56')]=function(_0x17d2f2,_0x5df1d7,_0x21ead2){var _0x507cce={'raw':![],'where':{}};var _0x3e5dca={};var _0x344692={'count':0x0,'rows':[]};return db[_0x9edd('0x2f')]['findOne']({'where':{'id':_0x17d2f2[_0x9edd('0x48')]['id']}})['then'](handleEntityNotFound(_0x5df1d7,null))[_0x9edd('0x26')](function(_0x4e1eda){if(_0x4e1eda){_0x3e5dca['model']=_[_0x9edd('0x34')](db['Disposition'][_0x9edd('0x30')]);_0x3e5dca[_0x9edd('0x35')]=_[_0x9edd('0x34')](_0x17d2f2['query']);_0x3e5dca[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x3e5dca[_0x9edd('0x33')],_0x3e5dca[_0x9edd('0x35')]);_0x507cce[_0x9edd('0x38')]=_['intersection'](_0x3e5dca['model'],qs[_0x9edd('0x39')](_0x17d2f2[_0x9edd('0x35')]['fields']));_0x507cce['attributes']=_0x507cce['attributes'][_0x9edd('0x49')]?_0x507cce['attributes']:_0x3e5dca['model'];if(!_0x17d2f2[_0x9edd('0x35')][_0x9edd('0x3a')]('nolimit')){_0x507cce[_0x9edd('0x3c')]=qs[_0x9edd('0x3c')](_0x17d2f2[_0x9edd('0x35')]['limit']);_0x507cce[_0x9edd('0x21')]=qs['offset'](_0x17d2f2[_0x9edd('0x35')][_0x9edd('0x21')]);}_0x507cce['order']=qs[_0x9edd('0x3e')](_0x17d2f2[_0x9edd('0x35')]['sort']);_0x507cce[_0x9edd('0x3f')]=qs[_0x9edd('0x36')](_[_0x9edd('0x40')](_0x17d2f2[_0x9edd('0x35')],_0x3e5dca['filters']));_0x507cce[_0x9edd('0x3f')]['ListId']=_0x4e1eda['id'];if(_0x17d2f2[_0x9edd('0x35')][_0x9edd('0x41')]){_0x507cce[_0x9edd('0x3f')]=_['merge'](_0x507cce[_0x9edd('0x3f')],{'$or':_[_0x9edd('0x2e')](_0x507cce[_0x9edd('0x38')],function(_0x383cb9){var _0x25626a={};_0x25626a[_0x383cb9]={'$like':'%'+_0x17d2f2[_0x9edd('0x35')][_0x9edd('0x41')]+'%'};return _0x25626a;})});}_0x507cce=_['merge']({},_0x507cce,_0x17d2f2['options']);return db[_0x9edd('0x57')][_0x9edd('0x20')]({'where':_0x507cce[_0x9edd('0x3f')]})[_0x9edd('0x26')](function(_0x1e2126){_0x344692['count']=_0x1e2126;if(_0x17d2f2[_0x9edd('0x35')][_0x9edd('0x4a')]){_0x507cce[_0x9edd('0x44')]=[{'all':!![]}];}return db['Disposition'][_0x9edd('0x58')](_0x507cce);})[_0x9edd('0x26')](function(_0x4b1c12){_0x344692[_0x9edd('0x45')]=_0x4b1c12;return _0x344692;});}})[_0x9edd('0x26')](respondWithFilteredResult(_0x5df1d7,_0x507cce))['catch'](handleError(_0x5df1d7,null));};exports[_0x9edd('0x59')]=function(_0x1e2de6,_0x566be7,_0x3f08ac){return db['CmList']['find']({'where':{'id':_0x1e2de6[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x566be7,null))[_0x9edd('0x26')](function(_0x5b56c7){if(_0x5b56c7){return _0x5b56c7[_0x9edd('0x59')](_0x1e2de6[_0x9edd('0x35')]['ids']);}})[_0x9edd('0x26')](respondWithStatusCode(_0x566be7,null))[_0x9edd('0x46')](handleError(_0x566be7,null));};exports[_0x9edd('0x5a')]=function(_0x1ad198,_0x54ac71,_0x5e68db){return db[_0x9edd('0x2f')]['find']({'where':{'id':_0x1ad198[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x54ac71,null))[_0x9edd('0x26')](function(_0x3cfd35){if(_0x3cfd35){var _0x195921=[];var _0x4786f8={'success':[],'errors':[]};return db[_0x9edd('0x5b')][_0x9edd('0x54')]()[_0x9edd('0x26')](function(_0x554241){if(_0x1ad198[_0x9edd('0x4d')][_0x9edd('0x5c')]&&_[_0x9edd('0x5d')](_0x1ad198[_0x9edd('0x4d')][_0x9edd('0x5c')])){if(_0x1ad198[_0x9edd('0x4d')][_0x9edd('0x5c')]['length']){_0x1ad198[_0x9edd('0x4d')][_0x9edd('0x5c')]=_0x1ad198['body'][_0x9edd('0x5c')][_0x9edd('0x5e')](';')+';';}else{_0x1ad198['body'][_0x9edd('0x5c')]=null;}}else{_0x1ad198[_0x9edd('0x4d')][_0x9edd('0x5c')]=null;}if(_0x1ad198['body']&&_[_0x9edd('0x5d')](_0x1ad198[_0x9edd('0x4d')])){for(var _0x3f04d3=0x0;_0x3f04d3<_0x1ad198['body']['length'];_0x3f04d3+=0x1){_0x1ad198['body'][_0x3f04d3]['ListId']=_0x1ad198[_0x9edd('0x48')]['id'];_0x195921[_0x9edd('0x5f')](_0x1ad198[_0x9edd('0x4d')][_0x3f04d3]);}return BPromise['each'](_0x195921,function(_0x53e141){return db['CmContact'][_0x9edd('0x4c')](_[_0x9edd('0x60')](_0x53e141,[_0x9edd('0x61'),'id'])||{},{'fields':_[_0x9edd('0x34')](_0x554241),'raw':!![]})[_0x9edd('0x26')](function(_0x18b25e){_0x4786f8[_0x9edd('0x62')][_0x9edd('0x5f')](_0x18b25e[_0x9edd('0x63')]);})[_0x9edd('0x46')](function(_0x2523b5){_0x4786f8[_0x9edd('0x64')]['push']({'data':_0x53e141,'error':_0x2523b5[_0x9edd('0x65')]});});})[_0x9edd('0x26')](function(_0x33b5dc){return _0x4786f8;})[_0x9edd('0x46')](function(_0x104afc){return _0x104afc;});}else{_0x54ac71[_0x9edd('0x1d')](0x190)[_0x9edd('0x1f')]({'message':_0x9edd('0x66')});}});}})['then'](respondWithResult(_0x54ac71,null))['catch'](handleError(_0x54ac71,null));};exports[_0x9edd('0x67')]=function(_0x4ec836,_0x35950b,_0x4a685e){var _0x21c35f;return db[_0x9edd('0x2f')]['find']({'where':{'id':_0x4ec836[_0x9edd('0x48')]['id']},'include':[{'model':db[_0x9edd('0x68')],'as':'CustomFields'}]})[_0x9edd('0x26')](handleEntityNotFound(_0x35950b,null))[_0x9edd('0x26')](function(_0x42d546){if(_0x42d546){_0x21c35f=_0x42d546;return db[_0x9edd('0x5b')][_0x9edd('0x30')];}})['then'](function(_0x33a077){if(_0x33a077){var _0x3ff07e={};var _0x3ec531={};_0x3ec531[_0x9edd('0x33')]=_[_0x9edd('0x69')](_['keys'](_0x33a077),_['map'](_0x21c35f['CustomFields'],function(_0x50316a){return util['format'](_0x9edd('0x6a'),_0x50316a['id']);}));_0x3ec531['query']=_['keys'](_0x4ec836[_0x9edd('0x35')]);_0x3ec531[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x3ec531[_0x9edd('0x33')],_0x3ec531[_0x9edd('0x35')]);_0x3ff07e[_0x9edd('0x38')]=_[_0x9edd('0x37')](_0x3ec531[_0x9edd('0x33')],qs[_0x9edd('0x39')](_0x4ec836[_0x9edd('0x35')]['fields']));_0x3ff07e[_0x9edd('0x38')]=_0x3ff07e[_0x9edd('0x38')][_0x9edd('0x49')]?_0x3ff07e[_0x9edd('0x38')]:_0x3ec531[_0x9edd('0x33')];if(!_0x4ec836[_0x9edd('0x35')][_0x9edd('0x3a')](_0x9edd('0x3b'))){_0x3ff07e['limit']=qs['limit'](_0x4ec836[_0x9edd('0x35')][_0x9edd('0x3c')]);_0x3ff07e[_0x9edd('0x21')]=qs[_0x9edd('0x21')](_0x4ec836[_0x9edd('0x35')][_0x9edd('0x21')]);}_0x3ff07e[_0x9edd('0x3d')]=qs[_0x9edd('0x3e')](_0x4ec836[_0x9edd('0x35')][_0x9edd('0x3e')]);_0x3ff07e[_0x9edd('0x3f')]=qs[_0x9edd('0x36')](_[_0x9edd('0x40')](_0x4ec836[_0x9edd('0x35')],_0x3ec531['filters']));_0x3ff07e[_0x9edd('0x6b')]=!![];if(_0x4ec836[_0x9edd('0x35')]['filter']){_0x3ff07e[_0x9edd('0x3f')]=_[_0x9edd('0x42')](_0x3ff07e[_0x9edd('0x3f')],{'$or':_[_0x9edd('0x2e')](_0x3ff07e['attributes'],function(_0x3429b6){var _0x398c34={};_0x398c34[_0x3429b6]={'$like':'%'+_0x4ec836[_0x9edd('0x35')][_0x9edd('0x41')]+'%'};return _0x398c34;})});}_0x3ff07e=_[_0x9edd('0x42')]({},_0x3ff07e,_0x4ec836['options']);return _0x21c35f[_0x9edd('0x67')](_0x3ff07e);}})[_0x9edd('0x26')](respondWithResult(_0x35950b,null))[_0x9edd('0x46')](handleError(_0x35950b,null));};exports[_0x9edd('0x6c')]=function(_0xa8d944,_0x59927d,_0x4d0734){var _0x2f8ce1;return db['CmList'][_0x9edd('0x4b')]({'where':{'id':_0xa8d944['params']['id']},'include':[{'model':db[_0x9edd('0x68')],'as':_0x9edd('0x6d')}]})[_0x9edd('0x26')](handleEntityNotFound(_0x59927d,null))[_0x9edd('0x26')](function(_0x2c7245){if(_0x2c7245){_0x2f8ce1=_0x2c7245;return db[_0x9edd('0x5b')]['rawAttributes'];}})[_0x9edd('0x26')](function(_0x33beb7){if(_0x33beb7){var _0x3aae72={};var _0x39d6dd={};_0x39d6dd[_0x9edd('0x33')]=_[_0x9edd('0x69')](_[_0x9edd('0x34')](_0x33beb7),_[_0x9edd('0x2e')](_0x2f8ce1['CustomFields'],function(_0x195088){return util[_0x9edd('0x6e')](_0x9edd('0x6a'),_0x195088['id']);}));_0x39d6dd[_0x9edd('0x35')]=_[_0x9edd('0x34')](_0xa8d944[_0x9edd('0x35')]);_0x39d6dd[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x39d6dd[_0x9edd('0x33')],_0x39d6dd[_0x9edd('0x35')]);_0x3aae72[_0x9edd('0x38')]=_[_0x9edd('0x37')](_0x39d6dd[_0x9edd('0x33')],qs[_0x9edd('0x39')](_0xa8d944[_0x9edd('0x35')][_0x9edd('0x39')]));_0x3aae72[_0x9edd('0x38')]=_0x3aae72[_0x9edd('0x38')][_0x9edd('0x49')]?_0x3aae72[_0x9edd('0x38')]:_0x39d6dd[_0x9edd('0x33')];if(!_0xa8d944['query'][_0x9edd('0x3a')]('nolimit')){_0x3aae72['limit']=qs[_0x9edd('0x3c')](_0xa8d944[_0x9edd('0x35')][_0x9edd('0x3c')]);_0x3aae72[_0x9edd('0x21')]=qs[_0x9edd('0x21')](_0xa8d944[_0x9edd('0x35')][_0x9edd('0x21')]);}_0x3aae72[_0x9edd('0x3d')]=qs[_0x9edd('0x3e')](_0xa8d944[_0x9edd('0x35')]['sort']);_0x3aae72[_0x9edd('0x3f')]=qs[_0x9edd('0x36')](_['pick'](_0xa8d944['query'],_0x39d6dd[_0x9edd('0x36')]));_0x3aae72[_0x9edd('0x6b')]=!![];if(_0xa8d944[_0x9edd('0x35')][_0x9edd('0x41')]){_0x3aae72['where']=_['merge'](_0x3aae72[_0x9edd('0x3f')],{'$or':_['map'](_0x3aae72[_0x9edd('0x38')],function(_0x24a9d1){var _0x3e2404={};_0x3e2404[_0x24a9d1]={'$like':'%'+_0xa8d944['query']['filter']+'%'};return _0x3e2404;})});}_0x3aae72=_['merge']({},_0x3aae72,_0xa8d944[_0x9edd('0x43')]);return _0x2f8ce1[_0x9edd('0x67')](_0x3aae72);}})[_0x9edd('0x26')](function(_0x5bfbfd){if(!_[_0x9edd('0x6f')](_0x5bfbfd)){var _0x402574=toCsv(_0x5bfbfd);var _0x4f12b9=Date[_0x9edd('0x70')]();fs[_0x9edd('0x71')](util['format']('/tmp/list_%d_%s.csv',_0x2f8ce1['id'],_0x4f12b9),_0x402574);_0x59927d[_0x9edd('0x72')](_0x9edd('0x73'),'attachment;\x20filename='+util[_0x9edd('0x6e')](_0x9edd('0x74'),_0x2f8ce1['id'],_0x4f12b9));_0x59927d['setHeader'](_0x9edd('0x75'),'text/csv');return _0x59927d[_0x9edd('0x76')](util[_0x9edd('0x6e')](_0x9edd('0x77'),_0x2f8ce1['id'],_0x4f12b9));}else{return _0x59927d[_0x9edd('0x1c')](0xcc);}})[_0x9edd('0x46')](handleError(_0x59927d,null));};exports[_0x9edd('0x78')]=function(_0x58bc3c,_0x2fe810,_0x22aa2b){var _0x68047e;delete _0x58bc3c['body']['id'];return db[_0x9edd('0x2f')]['findOne']({'where':{'id':_0x58bc3c[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x2fe810,null))[_0x9edd('0x26')](function(_0x41b0ea){if(_0x41b0ea){return db['sequelize']['transaction'](function(_0x4e9242){return db[_0x9edd('0x68')][_0x9edd('0x4c')](_0x58bc3c[_0x9edd('0x4d')],{'transaction':_0x4e9242})['then'](function(_0x41a761){_0x68047e=_0x41a761;return _0x41b0ea[_0x9edd('0x79')](_0x41a761,{'transaction':_0x4e9242});})[_0x9edd('0x26')](function(){var _0xb66eaf={'type':db[_0x9edd('0x7a')][_0x9edd('0x7b')],'transaction':_0x4e9242};switch(_0x58bc3c['body']['type']){case _0x9edd('0x7c'):_0xb66eaf[_0x9edd('0x32')]=db[_0x9edd('0x7a')]['TEXT'];break;case _0x9edd('0x7d'):_0xb66eaf[_0x9edd('0x32')]=db[_0x9edd('0x7a')][_0x9edd('0x7e')];break;case'switch':_0xb66eaf[_0x9edd('0x32')]=db['Sequelize'][_0x9edd('0x7f')];_0xb66eaf[_0x9edd('0x80')]=![];break;default:}return db[_0x9edd('0x81')][_0x9edd('0x82')][_0x9edd('0x83')]('cm_contacts',util[_0x9edd('0x6e')]('cf_%s',_0x68047e['id']),_0xb66eaf);})[_0x9edd('0x26')](function(){return _0x68047e;});});}})['then'](respondWithResult(_0x2fe810,null))[_0x9edd('0x46')](handleError(_0x2fe810,null));};exports['getCustomFields']=function(_0x363c5c,_0x96e3d7,_0x3bc495){var _0x575377={};var _0x244dce={};var _0x7512ea;var _0x1c5038;return db[_0x9edd('0x2f')][_0x9edd('0x84')]({'where':{'id':_0x363c5c[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x96e3d7,null))[_0x9edd('0x26')](function(_0x365b27){if(_0x365b27){_0x7512ea=_0x365b27;_0x244dce[_0x9edd('0x33')]=_[_0x9edd('0x34')](db[_0x9edd('0x68')][_0x9edd('0x30')]);_0x244dce[_0x9edd('0x35')]=_[_0x9edd('0x34')](_0x363c5c[_0x9edd('0x35')]);_0x244dce[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x244dce[_0x9edd('0x33')],_0x244dce[_0x9edd('0x35')]);_0x575377[_0x9edd('0x38')]=_[_0x9edd('0x37')](_0x244dce['model'],qs[_0x9edd('0x39')](_0x363c5c['query'][_0x9edd('0x39')]));_0x575377[_0x9edd('0x38')]=_0x575377[_0x9edd('0x38')][_0x9edd('0x49')]?_0x575377[_0x9edd('0x38')]:_0x244dce['model'];_0x575377[_0x9edd('0x3d')]=qs['sort'](_0x363c5c[_0x9edd('0x35')][_0x9edd('0x3e')]);_0x575377[_0x9edd('0x3f')]=qs[_0x9edd('0x36')](_[_0x9edd('0x40')](_0x363c5c[_0x9edd('0x35')],_0x244dce['filters']));_0x575377[_0x9edd('0x3f')]=_[_0x9edd('0x42')](_0x575377['where'],{'$or':[{'ListId':_0x365b27['id']},{'ListId':null}]});if(_0x363c5c['query']['filter']){_0x575377['where']=_[_0x9edd('0x42')](_0x575377[_0x9edd('0x3f')],{'$or':_[_0x9edd('0x2e')](_0x575377[_0x9edd('0x38')],function(_0x239774){var _0x229a92={};_0x229a92[_0x239774]={'$like':'%'+_0x363c5c[_0x9edd('0x35')][_0x9edd('0x41')]+'%'};return _0x229a92;})});}_0x575377=_[_0x9edd('0x42')]({},_0x575377,_0x363c5c[_0x9edd('0x43')]);return db['CmCustomField'][_0x9edd('0x85')](_0x575377);}})['then'](respondWithResult(_0x96e3d7,null))['catch'](handleError(_0x96e3d7,null));};exports[_0x9edd('0x86')]=function(_0x2dafd2,_0x35e9b9,_0x42a142){return db[_0x9edd('0x2f')]['find']({'where':{'id':_0x2dafd2[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x35e9b9,null))[_0x9edd('0x26')](function(_0x181469){if(_0x181469){return _0x181469['addAgents'](_0x2dafd2[_0x9edd('0x4d')][_0x9edd('0x61')],_[_0x9edd('0x60')](_0x2dafd2[_0x9edd('0x4d')],[_0x9edd('0x61'),'id'])||{})[_0x9edd('0x87')](function(_0x55052b){for(var _0x9ff2d3=0x0;_0x9ff2d3<_0x2dafd2[_0x9edd('0x4d')][_0x9edd('0x61')][_0x9edd('0x49')];_0x9ff2d3+=0x1){socket['emit'](_0x9edd('0x88'),{'UserId':_0x2dafd2[_0x9edd('0x4d')][_0x9edd('0x61')][_0x9ff2d3],'CmListId':_0x2dafd2[_0x9edd('0x48')]['id']});}return _0x55052b;});}})[_0x9edd('0x26')](respondWithResult(_0x35e9b9,null))[_0x9edd('0x46')](handleError(_0x35e9b9,null));};exports[_0x9edd('0x89')]=function(_0x39e3b3,_0x4a3955,_0x4a19a0){return db['CmList'][_0x9edd('0x4b')]({'where':{'id':_0x39e3b3[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x4a3955,null))[_0x9edd('0x26')](function(_0x223c42){if(_0x223c42){return _0x223c42[_0x9edd('0x89')](_0x39e3b3[_0x9edd('0x35')][_0x9edd('0x61')])[_0x9edd('0x26')](function(){if(_[_0x9edd('0x5d')](_0x39e3b3['query'][_0x9edd('0x61')])){for(var _0x56dc7e=0x0;_0x56dc7e<_0x39e3b3['query'][_0x9edd('0x61')][_0x9edd('0x49')];_0x56dc7e+=0x1){socket[_0x9edd('0x8a')]('userCmList:remove',{'UserId':Number(_0x39e3b3['query']['ids'][_0x56dc7e]),'CmListId':Number(_0x39e3b3['params']['id'])});}}else{socket['emit'](_0x9edd('0x8b'),{'UserId':Number(_0x39e3b3[_0x9edd('0x35')][_0x9edd('0x61')]),'CmListId':Number(_0x39e3b3['params']['id'])});}});}})[_0x9edd('0x26')](respondWithStatusCode(_0x4a3955,null))[_0x9edd('0x46')](handleError(_0x4a3955,null));};exports[_0x9edd('0x8c')]=function(_0x557156,_0x2c2f00,_0x4afe0b){var _0x16a1c8={};var _0x1a2376={};var _0xc84fb7;var _0x259d33;return db['CmList'][_0x9edd('0x84')]({'where':{'id':_0x557156[_0x9edd('0x48')]['id']}})['then'](handleEntityNotFound(_0x2c2f00,null))[_0x9edd('0x26')](function(_0x36e825){if(_0x36e825){_0xc84fb7=_0x36e825;_0x1a2376[_0x9edd('0x33')]=_[_0x9edd('0x34')](db['User'][_0x9edd('0x30')]);_0x1a2376[_0x9edd('0x35')]=_[_0x9edd('0x34')](_0x557156[_0x9edd('0x35')]);_0x1a2376[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x1a2376[_0x9edd('0x33')],_0x1a2376['query']);_0x16a1c8[_0x9edd('0x38')]=_['intersection'](_0x1a2376[_0x9edd('0x33')],qs[_0x9edd('0x39')](_0x557156['query'][_0x9edd('0x39')]));_0x16a1c8[_0x9edd('0x38')]=_0x16a1c8[_0x9edd('0x38')]['length']?_0x16a1c8[_0x9edd('0x38')]:_0x1a2376[_0x9edd('0x33')];_0x16a1c8[_0x9edd('0x3d')]=qs['sort'](_0x557156[_0x9edd('0x35')]['sort']);_0x16a1c8[_0x9edd('0x3f')]=qs[_0x9edd('0x36')](_[_0x9edd('0x40')](_0x557156[_0x9edd('0x35')],_0x1a2376['filters']));if(_0x557156['query'][_0x9edd('0x41')]){_0x16a1c8[_0x9edd('0x3f')]=_[_0x9edd('0x42')](_0x16a1c8[_0x9edd('0x3f')],{'$or':_[_0x9edd('0x2e')](_0x16a1c8['attributes'],function(_0x1a1938){var _0x235762={};_0x235762[_0x1a1938]={'$like':'%'+_0x557156[_0x9edd('0x35')][_0x9edd('0x41')]+'%'};return _0x235762;})});}_0x16a1c8=_[_0x9edd('0x42')]({},_0x16a1c8,_0x557156[_0x9edd('0x43')]);return _0xc84fb7[_0x9edd('0x8c')](_0x16a1c8);}})[_0x9edd('0x26')](function(_0x3173fa){if(_0x3173fa){_0x259d33=_0x3173fa[_0x9edd('0x49')];if(!_0x557156[_0x9edd('0x35')][_0x9edd('0x3a')](_0x9edd('0x3b'))){_0x16a1c8['limit']=qs[_0x9edd('0x3c')](_0x557156[_0x9edd('0x35')][_0x9edd('0x3c')]);_0x16a1c8[_0x9edd('0x21')]=qs['offset'](_0x557156[_0x9edd('0x35')][_0x9edd('0x21')]);}return _0xc84fb7[_0x9edd('0x8c')](_0x16a1c8);}})['then'](function(_0x910adf){if(_0x910adf){return _0x910adf?{'count':_0x259d33,'rows':_0x910adf}:null;}})['then'](respondWithResult(_0x2c2f00,null))['catch'](handleError(_0x2c2f00,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index c6e0c65..36a0b79 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 _0x98fe=['emit','hasOwnProperty','exports','events','CmList','save','update'];(function(_0x3eea1b,_0x4df786){var _0x322e24=function(_0x3d6a89){while(--_0x3d6a89){_0x3eea1b['push'](_0x3eea1b['shift']());}};_0x322e24(++_0x4df786);}(_0x98fe,0xea));var _0xe98f=function(_0x5c71a9,_0x2fe991){_0x5c71a9=_0x5c71a9-0x0;var _0x1962c4=_0x98fe[_0x5c71a9];return _0x1962c4;};'use strict';var EventEmitter=require(_0xe98f('0x0'));var CmList=require('../../mysqldb')['db'][_0xe98f('0x1')];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe98f('0x2'),'afterUpdate':_0xe98f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3ee42c){return function(_0x43db3e,_0x3aa3bd,_0x5637d8){CmListEvents[_0xe98f('0x4')](_0x3ee42c+':'+_0x43db3e['id'],_0x43db3e);CmListEvents[_0xe98f('0x4')](_0x3ee42c,_0x43db3e);_0x5637d8(null);};}for(var e in events){if(events[_0xe98f('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0xe98f('0x6')]=CmListEvents; \ No newline at end of file +var _0x57ed=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList','setMaxListeners'];(function(_0x1d2bc8,_0x2860bc){var _0x1857e1=function(_0x3a3073){while(--_0x3a3073){_0x1d2bc8['push'](_0x1d2bc8['shift']());}};_0x1857e1(++_0x2860bc);}(_0x57ed,0x7a));var _0xd57e=function(_0x132fa0,_0x2a86cc){_0x132fa0=_0x132fa0-0x0;var _0x59fe34=_0x57ed[_0x132fa0];return _0x59fe34;};'use strict';var EventEmitter=require(_0xd57e('0x0'));var CmList=require(_0xd57e('0x1'))['db'][_0xd57e('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xd57e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd57e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3da55d){return function(_0x3e509e,_0x35f89c,_0x220a3c){CmListEvents[_0xd57e('0x5')](_0x3da55d+':'+_0x3e509e['id'],_0x3e509e);CmListEvents['emit'](_0x3da55d,_0x3e509e);_0x220a3c(null);};}for(var e in events){if(events[_0xd57e('0x6')](e)){var event=events[e];CmList[_0xd57e('0x7')](e,emitEvent(event));}}module[_0xd57e('0x8')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 2774375..cd7bccb 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 _0xa8ec=['cm_lists','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','CmList'];(function(_0x252ef1,_0x2e0041){var _0x25817c=function(_0x243776){while(--_0x243776){_0x252ef1['push'](_0x252ef1['shift']());}};_0x25817c(++_0x2e0041);}(_0xa8ec,0x69));var _0xca8e=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xa8ec[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var util=require(_0xca8e('0x0'));var logger=require(_0xca8e('0x1'))(_0xca8e('0x2'));var moment=require(_0xca8e('0x3'));var BPromise=require(_0xca8e('0x4'));var rp=require(_0xca8e('0x5'));var fs=require('fs');var path=require(_0xca8e('0x6'));var rimraf=require(_0xca8e('0x7'));var config=require(_0xca8e('0x8'));var attributes=require(_0xca8e('0x9'));module[_0xca8e('0xa')]=function(_0x2f74ce,_0x134f9d){return _0x2f74ce['define'](_0xca8e('0xb'),attributes,{'tableName':_0xca8e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e7e=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists'];(function(_0x4a7843,_0x24f6d1){var _0x2c57fe=function(_0x37fbc9){while(--_0x37fbc9){_0x4a7843['push'](_0x4a7843['shift']());}};_0x2c57fe(++_0x24f6d1);}(_0x8e7e,0x186));var _0xe8e7=function(_0x647e13,_0x4b816b){_0x647e13=_0x647e13-0x0;var _0xb285f2=_0x8e7e[_0x647e13];return _0xb285f2;};'use strict';var _=require(_0xe8e7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe8e7('0x1'));var moment=require(_0xe8e7('0x2'));var BPromise=require(_0xe8e7('0x3'));var rp=require(_0xe8e7('0x4'));var fs=require('fs');var path=require(_0xe8e7('0x5'));var rimraf=require(_0xe8e7('0x6'));var config=require(_0xe8e7('0x7'));var attributes=require(_0xe8e7('0x8'));module[_0xe8e7('0x9')]=function(_0x2b0948,_0x4bc862){return _0x2b0948[_0xe8e7('0xa')](_0xe8e7('0xb'),attributes,{'tableName':_0xe8e7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 4a6407e..6b03194 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 _0x0b2d=['then','info','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message','CmList,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./cmList.socket','request'];(function(_0x485cac,_0x3186fc){var _0x3790e8=function(_0x4df115){while(--_0x4df115){_0x485cac['push'](_0x485cac['shift']());}};_0x3790e8(++_0x3186fc);}(_0x0b2d,0x11c));var _0xd0b2=function(_0x453e90,_0x92ca66){_0x453e90=_0x453e90-0x0;var _0x33c869=_0x0b2d[_0x453e90];return _0x33c869;};'use strict';var _=require(_0xd0b2('0x0'));var util=require(_0xd0b2('0x1'));var moment=require(_0xd0b2('0x2'));var BPromise=require(_0xd0b2('0x3'));var rs=require(_0xd0b2('0x4'));var fs=require('fs');var Redis=require(_0xd0b2('0x5'));var db=require(_0xd0b2('0x6'))['db'];var utils=require(_0xd0b2('0x7'));var logger=require('../../config/logger')(_0xd0b2('0x8'));var config=require('../../config/environment');var jayson=require(_0xd0b2('0x9'));var client=jayson['client'][_0xd0b2('0xa')]({'port':0x232a});config[_0xd0b2('0xb')]=_['defaults'](config[_0xd0b2('0xb')],{'host':_0xd0b2('0xc'),'port':0x18eb});var socket=require(_0xd0b2('0xd'))(new Redis(config[_0xd0b2('0xb')]));require(_0xd0b2('0xe'))['register'](socket);function respondWithRpcPromise(_0x2edb0b,_0x2fc1d1,_0xb026b3){return new BPromise(function(_0x11c888,_0x45d4b4){return client[_0xd0b2('0xf')](_0x2edb0b,_0xb026b3)[_0xd0b2('0x10')](function(_0x87509b){logger[_0xd0b2('0x11')]('CmList,\x20%s,\x20%s',_0x2fc1d1,_0xd0b2('0x12'));logger['debug'](_0xd0b2('0x13'),_0x2fc1d1,_0xd0b2('0x12'),JSON[_0xd0b2('0x14')](_0x87509b));if(_0x87509b[_0xd0b2('0x15')]){if(_0x87509b[_0xd0b2('0x15')]['code']===0x1f4){logger[_0xd0b2('0x15')]('CmList,\x20%s,\x20%s',_0x2fc1d1,_0x87509b[_0xd0b2('0x15')]['message']);return _0x45d4b4(_0x87509b[_0xd0b2('0x15')][_0xd0b2('0x16')]);}logger[_0xd0b2('0x15')](_0xd0b2('0x17'),_0x2fc1d1,_0x87509b[_0xd0b2('0x15')][_0xd0b2('0x16')]);return _0x11c888(_0x87509b[_0xd0b2('0x15')][_0xd0b2('0x16')]);}else{logger[_0xd0b2('0x11')](_0xd0b2('0x17'),_0x2fc1d1,'request\x20sent');_0x11c888(_0x87509b['result'][_0xd0b2('0x16')]);}})[_0xd0b2('0x18')](function(_0x41adf1){logger[_0xd0b2('0x15')]('CmList,\x20%s,\x20%s',_0x2fc1d1,_0x41adf1);_0x45d4b4(_0x41adf1);});});} \ No newline at end of file +var _0x28e7=['info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x28e7,0xa5));var _0x728e=function(_0x2fd2bf,_0x4ec5b6){_0x2fd2bf=_0x2fd2bf-0x0;var _0x39bc30=_0x28e7[_0x2fd2bf];return _0x39bc30;};'use strict';var _=require(_0x728e('0x0'));var util=require(_0x728e('0x1'));var moment=require('moment');var BPromise=require(_0x728e('0x2'));var rs=require(_0x728e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x728e('0x4'))['db'];var utils=require(_0x728e('0x5'));var logger=require(_0x728e('0x6'))(_0x728e('0x7'));var config=require(_0x728e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x728e('0x9')][_0x728e('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x728e('0xb')],{'host':_0x728e('0xc'),'port':0x18eb});var socket=require(_0x728e('0xd'))(new Redis(config['redis']));require('./cmList.socket')[_0x728e('0xe')](socket);function respondWithRpcPromise(_0x70d57f,_0x390c84,_0x2b9826){return new BPromise(function(_0x4fd789,_0x1fbd34){return client[_0x728e('0xf')](_0x70d57f,_0x2b9826)[_0x728e('0x10')](function(_0x2c289b){logger[_0x728e('0x11')](_0x728e('0x12'),_0x390c84,_0x728e('0x13'));logger['debug'](_0x728e('0x14'),_0x390c84,_0x728e('0x13'),JSON[_0x728e('0x15')](_0x2c289b));if(_0x2c289b['error']){if(_0x2c289b[_0x728e('0x16')][_0x728e('0x17')]===0x1f4){logger['error'](_0x728e('0x12'),_0x390c84,_0x2c289b[_0x728e('0x16')][_0x728e('0x18')]);return _0x1fbd34(_0x2c289b[_0x728e('0x16')]['message']);}logger[_0x728e('0x16')](_0x728e('0x12'),_0x390c84,_0x2c289b['error'][_0x728e('0x18')]);return _0x4fd789(_0x2c289b['error'][_0x728e('0x18')]);}else{logger[_0x728e('0x11')](_0x728e('0x12'),_0x390c84,_0x728e('0x13'));_0x4fd789(_0x2c289b['result']['message']);}})[_0x728e('0x19')](function(_0x4983a4){logger[_0x728e('0x16')](_0x728e('0x12'),_0x390c84,_0x4983a4);_0x1fbd34(_0x4983a4);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index c37c70e..8209876 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 _0x254a=['emit','register','./cmList.events','save','remove'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x254a,0x138));var _0xa254=function(_0x2e0af0,_0x83719c){_0x2e0af0=_0x2e0af0-0x0;var _0x2dfdc9=_0x254a[_0x2e0af0];return _0x2dfdc9;};'use strict';var CmListEvents=require(_0xa254('0x0'));var events=[_0xa254('0x1'),_0xa254('0x2'),'update'];function createListener(_0xdd386c,_0x3e56d3){return function(_0x34467a){_0x3e56d3[_0xa254('0x3')](_0xdd386c,_0x34467a);};}function removeListener(_0x500e29,_0x8fbfaf){return function(){CmListEvents['removeListener'](_0x500e29,_0x8fbfaf);};}exports[_0xa254('0x4')]=function(_0x3d5886){for(var _0x1201ae=0x0,_0x597d72=events['length'];_0x1201ae<_0x597d72;_0x1201ae++){var _0xaeed42=events[_0x1201ae];var _0x352a44=createListener('cmList:'+_0xaeed42,_0x3d5886);CmListEvents['on'](_0xaeed42,_0x352a44);}}; \ No newline at end of file +var _0x64f5=['removeListener','register','length','cmList:','./cmList.events','emit'];(function(_0x150fa2,_0x156632){var _0x88e6ba=function(_0x23536e){while(--_0x23536e){_0x150fa2['push'](_0x150fa2['shift']());}};_0x88e6ba(++_0x156632);}(_0x64f5,0x17e));var _0x564f=function(_0x179e80,_0x4d212e){_0x179e80=_0x179e80-0x0;var _0x2f5827=_0x64f5[_0x179e80];return _0x2f5827;};'use strict';var CmListEvents=require(_0x564f('0x0'));var events=['save','remove','update'];function createListener(_0x39903b,_0x493091){return function(_0x2e7142){_0x493091[_0x564f('0x1')](_0x39903b,_0x2e7142);};}function removeListener(_0x59c424,_0x2607d6){return function(){CmListEvents[_0x564f('0x2')](_0x59c424,_0x2607d6);};}exports[_0x564f('0x3')]=function(_0x72b009){for(var _0x4bbedf=0x0,_0x4d3dae=events[_0x564f('0x4')];_0x4bbedf<_0x4d3dae;_0x4bbedf++){var _0x28db5a=events[_0x4bbedf];var _0x275bd6=createListener(_0x564f('0x5')+_0x28db5a,_0x72b009);CmListEvents['on'](_0x28db5a,_0x275bd6);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index ea0ad90..52b6d05 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 _0x8aed=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','getContacts','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField','addAgents','update','destroy','delete','removeDispositions','removeAgents','exports','multer','path','connect-timeout','express','Router'];(function(_0x151217,_0x3283b7){var _0x6fd20c=function(_0x392a96){while(--_0x392a96){_0x151217['push'](_0x151217['shift']());}};_0x6fd20c(++_0x3283b7);}(_0x8aed,0x171));var _0xd8ae=function(_0x7d58e8,_0x2b7c5d){_0x7d58e8=_0x7d58e8-0x0;var _0x42bd97=_0x8aed[_0x7d58e8];return _0x42bd97;};'use strict';var multer=require(_0xd8ae('0x0'));var util=require('util');var path=require(_0xd8ae('0x1'));var timeout=require(_0xd8ae('0x2'));var express=require(_0xd8ae('0x3'));var router=express[_0xd8ae('0x4')]();var auth=require(_0xd8ae('0x5'));var interaction=require(_0xd8ae('0x6'));var config=require(_0xd8ae('0x7'));var controller=require(_0xd8ae('0x8'));router[_0xd8ae('0x9')]('/',auth[_0xd8ae('0xa')](),controller[_0xd8ae('0xb')]);router['get'](_0xd8ae('0xc'),auth[_0xd8ae('0xa')](),controller[_0xd8ae('0xd')]);router[_0xd8ae('0x9')](_0xd8ae('0xe'),auth[_0xd8ae('0xa')](),controller['show']);router[_0xd8ae('0x9')](_0xd8ae('0xf'),auth['isAuthenticated'](),controller[_0xd8ae('0x10')]);router[_0xd8ae('0x9')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xd8ae('0x11')]);router[_0xd8ae('0x9')]('/:id/contacts/csv',auth['isAuthenticated'](),controller['getContactsCsv']);router[_0xd8ae('0x9')](_0xd8ae('0x12'),auth[_0xd8ae('0xa')](),controller[_0xd8ae('0x13')]);router[_0xd8ae('0x9')](_0xd8ae('0x14'),auth[_0xd8ae('0xa')](),controller[_0xd8ae('0x15')]);router[_0xd8ae('0x16')]('/',auth[_0xd8ae('0xa')](),controller[_0xd8ae('0x17')]);router[_0xd8ae('0x16')]('/:id/dispositions',auth[_0xd8ae('0xa')](),controller[_0xd8ae('0x18')]);router[_0xd8ae('0x16')]('/:id/contacts',auth[_0xd8ae('0xa')](),controller[_0xd8ae('0x19')]);router[_0xd8ae('0x16')]('/:id/fields',auth[_0xd8ae('0xa')](),controller[_0xd8ae('0x1a')]);router[_0xd8ae('0x16')]('/:id/users',auth[_0xd8ae('0xa')](),controller[_0xd8ae('0x1b')]);router['put'](_0xd8ae('0xe'),auth[_0xd8ae('0xa')](),controller[_0xd8ae('0x1c')]);router['delete'](_0xd8ae('0xe'),auth['isAuthenticated'](),controller[_0xd8ae('0x1d')]);router[_0xd8ae('0x1e')](_0xd8ae('0xf'),auth[_0xd8ae('0xa')](),controller[_0xd8ae('0x1f')]);router[_0xd8ae('0x1e')](_0xd8ae('0x14'),auth[_0xd8ae('0xa')](),controller[_0xd8ae('0x20')]);module[_0xd8ae('0x21')]=router; \ No newline at end of file +var _0xb632=['show','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField','put','removeDispositions','delete','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./cmList.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb632,0xd4));var _0x2b63=function(_0x130b4e,_0x23f3d4){_0x130b4e=_0x130b4e-0x0;var _0x39cc47=_0xb632[_0x130b4e];return _0x39cc47;};'use strict';var multer=require(_0x2b63('0x0'));var util=require(_0x2b63('0x1'));var path=require(_0x2b63('0x2'));var timeout=require(_0x2b63('0x3'));var express=require('express');var router=express[_0x2b63('0x4')]();var auth=require(_0x2b63('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2b63('0x6'));router[_0x2b63('0x7')]('/',auth[_0x2b63('0x8')](),controller[_0x2b63('0x9')]);router['get']('/describe',auth[_0x2b63('0x8')](),controller[_0x2b63('0xa')]);router[_0x2b63('0x7')](_0x2b63('0xb'),auth[_0x2b63('0x8')](),controller[_0x2b63('0xc')]);router[_0x2b63('0x7')](_0x2b63('0xd'),auth[_0x2b63('0x8')](),controller[_0x2b63('0xe')]);router['get']('/:id/contacts',auth['isAuthenticated'](),controller[_0x2b63('0xf')]);router[_0x2b63('0x7')](_0x2b63('0x10'),auth[_0x2b63('0x8')](),controller[_0x2b63('0x11')]);router['get'](_0x2b63('0x12'),auth[_0x2b63('0x8')](),controller[_0x2b63('0x13')]);router[_0x2b63('0x7')](_0x2b63('0x14'),auth[_0x2b63('0x8')](),controller[_0x2b63('0x15')]);router[_0x2b63('0x16')]('/',auth[_0x2b63('0x8')](),controller[_0x2b63('0x17')]);router[_0x2b63('0x16')](_0x2b63('0xd'),auth[_0x2b63('0x8')](),controller[_0x2b63('0x18')]);router[_0x2b63('0x16')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x2b63('0x19')]);router['post'](_0x2b63('0x12'),auth[_0x2b63('0x8')](),controller[_0x2b63('0x1a')]);router['post'](_0x2b63('0x14'),auth['isAuthenticated'](),controller['addAgents']);router[_0x2b63('0x1b')](_0x2b63('0xb'),auth[_0x2b63('0x8')](),controller['update']);router['delete'](_0x2b63('0xb'),auth[_0x2b63('0x8')](),controller['destroy']);router['delete'](_0x2b63('0xd'),auth[_0x2b63('0x8')](),controller[_0x2b63('0x1c')]);router[_0x2b63('0x1d')](_0x2b63('0x14'),auth[_0x2b63('0x8')](),controller[_0x2b63('0x1e')]);module[_0x2b63('0x1f')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index ede1418..2b87c0d 100644 --- a/server/api/condition/condition.attributes.js +++ b/server/api/condition/condition.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0x488612,_0x543afa){var _0x2cfbea=function(_0x1d2c5c){while(--_0x1d2c5c){_0x488612['push'](_0x488612['shift']());}};_0x2cfbea(++_0x543afa);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'field':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x1ddd88,_0x54bd4c){var _0x573814=function(_0x1f8a46){while(--_0x1f8a46){_0x1ddd88['push'](_0x1ddd88['shift']());}};_0x573814(++_0x54bd4c);}(_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')]={'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 71bcf8d..d393e11 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 _0xa327=['limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','body','find','params','catch','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x31ec29,_0x58915c){var _0x3275fc=function(_0x435075){while(--_0x435075){_0x31ec29['push'](_0x31ec29['shift']());}};_0x3275fc(++_0x58915c);}(_0xa327,0x136));var _0x7a32=function(_0x52151d,_0x599ee5){_0x52151d=_0x52151d-0x0;var _0x2f3738=_0xa327[_0x52151d];return _0x2f3738;};'use strict';var pdf=require(_0x7a32('0x0'));var emlformat=require(_0x7a32('0x1'));var rimraf=require(_0x7a32('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7a32('0x3'));var rp=require(_0x7a32('0x4'));var moment=require('moment');var BPromise=require(_0x7a32('0x5'));var Mustache=require(_0x7a32('0x6'));var util=require(_0x7a32('0x7'));var path=require(_0x7a32('0x8'));var sox=require(_0x7a32('0x9'));var csv=require(_0x7a32('0xa'));var ejs=require(_0x7a32('0xb'));var fs=require('fs');var _=require(_0x7a32('0xc'));var squel=require('squel');var crypto=require(_0x7a32('0xd'));var jsforce=require(_0x7a32('0xe'));var deskjs=require(_0x7a32('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7a32('0x10'));var Papa=require(_0x7a32('0x11'));var Redis=require(_0x7a32('0x12'));var authService=require(_0x7a32('0x13'));var qs=require(_0x7a32('0x14'));var as=require(_0x7a32('0x15'));var hardwareService=require(_0x7a32('0x16'));var logger=require(_0x7a32('0x17'))(_0x7a32('0x18'));var utils=require(_0x7a32('0x19'));var config=require(_0x7a32('0x1a'));var db=require(_0x7a32('0x1b'))['db'];function respondWithStatusCode(_0x272b39,_0x32d219){_0x32d219=_0x32d219||0xcc;return function(_0x27fdc5){if(_0x27fdc5){return _0x272b39[_0x7a32('0x1c')](_0x32d219);}return _0x272b39[_0x7a32('0x1d')](_0x32d219)[_0x7a32('0x1e')]();};}function respondWithResult(_0x39693f,_0x2880c7){_0x2880c7=_0x2880c7||0xc8;return function(_0x445c89){if(_0x445c89){return _0x39693f['status'](_0x2880c7)[_0x7a32('0x1f')](_0x445c89);}};}function respondWithFilteredResult(_0x4d1f64,_0x35f8b5){return function(_0x526286){if(_0x526286){var _0x20ff4f=_0x526286['count'],_0x24ee01=_0x35f8b5['offset'],_0x482416=_0x35f8b5[_0x7a32('0x20')]+_0x35f8b5[_0x7a32('0x21')],_0x247da8;if(_0x482416>=_0x20ff4f){_0x482416=_0x20ff4f;_0x247da8=0xc8;}else{_0x247da8=0xce;}_0x4d1f64[_0x7a32('0x1d')](_0x247da8);return _0x4d1f64[_0x7a32('0x22')](_0x7a32('0x23'),_0x24ee01+'-'+_0x482416+'/'+_0x20ff4f)[_0x7a32('0x1f')](_0x526286);}return null;};}function patchUpdates(_0x564d85){return function(_0x5f3dda){try{jsonpatch[_0x7a32('0x24')](_0x5f3dda,_0x564d85,!![]);}catch(_0x303e30){return BPromise['reject'](_0x303e30);}return _0x5f3dda[_0x7a32('0x25')]();};}function saveUpdates(_0x3ec7cf,_0x49d35c){return function(_0x507203){if(_0x507203){return _0x507203[_0x7a32('0x26')](_0x3ec7cf)[_0x7a32('0x27')](function(_0x3660b9){return _0x3660b9;});}return null;};}function removeEntity(_0x407ccf,_0x57e90b){return function(_0x2e84ad){if(_0x2e84ad){return _0x2e84ad[_0x7a32('0x28')]()['then'](function(){_0x407ccf['status'](0xcc)[_0x7a32('0x1e')]();});}};}function handleEntityNotFound(_0x31146f,_0x1d3b01){return function(_0x3acbc7){if(!_0x3acbc7){_0x31146f['sendStatus'](0x194);}return _0x3acbc7;};}function handleError(_0x184865,_0x43433f){_0x43433f=_0x43433f||0x1f4;return function(_0x4ea221){logger[_0x7a32('0x29')](_0x4ea221[_0x7a32('0x2a')]);if(_0x4ea221['name']){delete _0x4ea221[_0x7a32('0x2b')];}_0x184865['status'](_0x43433f)[_0x7a32('0x2c')](_0x4ea221);};}exports[_0x7a32('0x26')]=function(_0x40e753,_0x108d10){if(_0x40e753['body']['id']){delete _0x40e753[_0x7a32('0x2d')]['id'];}return db['Condition'][_0x7a32('0x2e')]({'where':{'id':_0x40e753[_0x7a32('0x2f')]['id']}})[_0x7a32('0x27')](handleEntityNotFound(_0x108d10,null))[_0x7a32('0x27')](saveUpdates(_0x40e753['body'],null))[_0x7a32('0x27')](respondWithResult(_0x108d10,null))[_0x7a32('0x30')](handleError(_0x108d10,null));};exports[_0x7a32('0x28')]=function(_0x55608c,_0x4868c5){return db['Condition']['find']({'where':{'id':_0x55608c[_0x7a32('0x2f')]['id']}})[_0x7a32('0x27')](handleEntityNotFound(_0x4868c5,null))[_0x7a32('0x27')](removeEntity(_0x4868c5,null))['catch'](handleError(_0x4868c5,null));}; \ No newline at end of file +var _0xaebd=['ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','Condition','find','params','body','catch','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring'];(function(_0x59140a,_0xd9449a){var _0x3a1ecc=function(_0x159a82){while(--_0x159a82){_0x59140a['push'](_0x59140a['shift']());}};_0x3a1ecc(++_0xd9449a);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x88f3f7,_0x19517d){_0x88f3f7=_0x88f3f7-0x0;var _0x44b641=_0xaebd[_0x88f3f7];return _0x44b641;};'use strict';var pdf=require(_0xdaeb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdaeb('0x1'));var zipdir=require(_0xdaeb('0x2'));var jsonpatch=require(_0xdaeb('0x3'));var rp=require(_0xdaeb('0x4'));var moment=require(_0xdaeb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdaeb('0x6'));var util=require(_0xdaeb('0x7'));var path=require(_0xdaeb('0x8'));var sox=require(_0xdaeb('0x9'));var csv=require(_0xdaeb('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdaeb('0xb'));var squel=require(_0xdaeb('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdaeb('0xd'));var toCsv=require(_0xdaeb('0xa'));var querystring=require(_0xdaeb('0xe'));var Papa=require('papaparse');var Redis=require(_0xdaeb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xdaeb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdaeb('0x11'));var logger=require('../../config/logger')(_0xdaeb('0x12'));var utils=require(_0xdaeb('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29a4bd,_0x5aedaa){_0x5aedaa=_0x5aedaa||0xcc;return function(_0x4ee3cc){if(_0x4ee3cc){return _0x29a4bd[_0xdaeb('0x14')](_0x5aedaa);}return _0x29a4bd[_0xdaeb('0x15')](_0x5aedaa)[_0xdaeb('0x16')]();};}function respondWithResult(_0x1ca86d,_0x1f31be){_0x1f31be=_0x1f31be||0xc8;return function(_0xc6c611){if(_0xc6c611){return _0x1ca86d['status'](_0x1f31be)['json'](_0xc6c611);}};}function respondWithFilteredResult(_0x96371f,_0x306bdb){return function(_0x34b2fe){if(_0x34b2fe){var _0x18ec4e=_0x34b2fe['count'],_0x538a25=_0x306bdb['offset'],_0x4c3bf3=_0x306bdb[_0xdaeb('0x17')]+_0x306bdb[_0xdaeb('0x18')],_0x24b898;if(_0x4c3bf3>=_0x18ec4e){_0x4c3bf3=_0x18ec4e;_0x24b898=0xc8;}else{_0x24b898=0xce;}_0x96371f[_0xdaeb('0x15')](_0x24b898);return _0x96371f[_0xdaeb('0x19')](_0xdaeb('0x1a'),_0x538a25+'-'+_0x4c3bf3+'/'+_0x18ec4e)[_0xdaeb('0x1b')](_0x34b2fe);}return null;};}function patchUpdates(_0x501f77){return function(_0x22089c){try{jsonpatch['apply'](_0x22089c,_0x501f77,!![]);}catch(_0x16d5e3){return BPromise[_0xdaeb('0x1c')](_0x16d5e3);}return _0x22089c[_0xdaeb('0x1d')]();};}function saveUpdates(_0x5360ce,_0x4e97e0){return function(_0x13563c){if(_0x13563c){return _0x13563c[_0xdaeb('0x1e')](_0x5360ce)[_0xdaeb('0x1f')](function(_0x236ccb){return _0x236ccb;});}return null;};}function removeEntity(_0xc274f8,_0x536aae){return function(_0x597bb7){if(_0x597bb7){return _0x597bb7[_0xdaeb('0x20')]()[_0xdaeb('0x1f')](function(){_0xc274f8[_0xdaeb('0x15')](0xcc)[_0xdaeb('0x16')]();});}};}function handleEntityNotFound(_0x39dfae,_0x55c825){return function(_0x254c3b){if(!_0x254c3b){_0x39dfae['sendStatus'](0x194);}return _0x254c3b;};}function handleError(_0x130c35,_0x398616){_0x398616=_0x398616||0x1f4;return function(_0x451101){logger[_0xdaeb('0x21')](_0x451101[_0xdaeb('0x22')]);if(_0x451101['name']){delete _0x451101[_0xdaeb('0x23')];}_0x130c35[_0xdaeb('0x15')](_0x398616)[_0xdaeb('0x24')](_0x451101);};}exports['update']=function(_0x57c2c4,_0x43095f){if(_0x57c2c4['body']['id']){delete _0x57c2c4['body']['id'];}return db[_0xdaeb('0x25')][_0xdaeb('0x26')]({'where':{'id':_0x57c2c4[_0xdaeb('0x27')]['id']}})['then'](handleEntityNotFound(_0x43095f,null))['then'](saveUpdates(_0x57c2c4[_0xdaeb('0x28')],null))[_0xdaeb('0x1f')](respondWithResult(_0x43095f,null))[_0xdaeb('0x29')](handleError(_0x43095f,null));};exports['destroy']=function(_0x36c933,_0x510607){return db['Condition'][_0xdaeb('0x26')]({'where':{'id':_0x36c933[_0xdaeb('0x27')]['id']}})[_0xdaeb('0x1f')](handleEntityNotFound(_0x510607,null))[_0xdaeb('0x1f')](removeEntity(_0x510607,null))[_0xdaeb('0x29')](handleError(_0x510607,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 030b7f1..2456c49 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 _0x7a49=['path','rimraf','./condition.attributes','exports','Condition','tools_conditions','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2044cb,_0x13f554){var _0x69f7dd=function(_0x3d945d){while(--_0x3d945d){_0x2044cb['push'](_0x2044cb['shift']());}};_0x69f7dd(++_0x13f554);}(_0x7a49,0x1b6));var _0x97a4=function(_0x5ce16f,_0x2be67a){_0x5ce16f=_0x5ce16f-0x0;var _0x2a864a=_0x7a49[_0x5ce16f];return _0x2a864a;};'use strict';var _=require(_0x97a4('0x0'));var util=require('util');var logger=require(_0x97a4('0x1'))(_0x97a4('0x2'));var moment=require(_0x97a4('0x3'));var BPromise=require(_0x97a4('0x4'));var rp=require(_0x97a4('0x5'));var fs=require('fs');var path=require(_0x97a4('0x6'));var rimraf=require(_0x97a4('0x7'));var config=require('../../config/environment');var attributes=require(_0x97a4('0x8'));module[_0x97a4('0x9')]=function(_0xb26ef8,_0x365dd4){return _0xb26ef8['define'](_0x97a4('0xa'),attributes,{'tableName':_0x97a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ff1=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions'];(function(_0x5c887d,_0x134d54){var _0x19a982=function(_0x4b0e73){while(--_0x4b0e73){_0x5c887d['push'](_0x5c887d['shift']());}};_0x19a982(++_0x134d54);}(_0x9ff1,0x1ea));var _0x19ff=function(_0x567fc7,_0x5bd825){_0x567fc7=_0x567fc7-0x0;var _0x474606=_0x9ff1[_0x567fc7];return _0x474606;};'use strict';var _=require(_0x19ff('0x0'));var util=require(_0x19ff('0x1'));var logger=require(_0x19ff('0x2'))('api');var moment=require(_0x19ff('0x3'));var BPromise=require(_0x19ff('0x4'));var rp=require(_0x19ff('0x5'));var fs=require('fs');var path=require(_0x19ff('0x6'));var rimraf=require(_0x19ff('0x7'));var config=require(_0x19ff('0x8'));var attributes=require(_0x19ff('0x9'));module[_0x19ff('0xa')]=function(_0x46945b,_0x5e07b2){return _0x46945b[_0x19ff('0xb')](_0x19ff('0xc'),attributes,{'tableName':_0x19ff('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 99df4d2..02989ac 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 _0x14ef=['request\x20sent','debug','error','Condition,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','then','info'];(function(_0x1631ad,_0x3769e8){var _0x44be06=function(_0x380b08){while(--_0x380b08){_0x1631ad['push'](_0x1631ad['shift']());}};_0x44be06(++_0x3769e8);}(_0x14ef,0x1cf));var _0xf14e=function(_0x3ed25d,_0x6c37b2){_0x3ed25d=_0x3ed25d-0x0;var _0x5e0998=_0x14ef[_0x3ed25d];return _0x5e0998;};'use strict';var _=require(_0xf14e('0x0'));var util=require(_0xf14e('0x1'));var moment=require(_0xf14e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf14e('0x3'));var fs=require('fs');var Redis=require(_0xf14e('0x4'));var db=require(_0xf14e('0x5'))['db'];var utils=require(_0xf14e('0x6'));var logger=require(_0xf14e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf14e('0x8')][_0xf14e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x139fcc,_0x1e8dc3,_0x5715a7){return new BPromise(function(_0x22620c,_0x4dffa2){return client['request'](_0x139fcc,_0x5715a7)[_0xf14e('0xa')](function(_0x295bb1){logger[_0xf14e('0xb')]('Condition,\x20%s,\x20%s',_0x1e8dc3,_0xf14e('0xc'));logger[_0xf14e('0xd')]('Condition,\x20%s,\x20%s,\x20%s',_0x1e8dc3,_0xf14e('0xc'),JSON['stringify'](_0x295bb1));if(_0x295bb1[_0xf14e('0xe')]){if(_0x295bb1[_0xf14e('0xe')]['code']===0x1f4){logger['error'](_0xf14e('0xf'),_0x1e8dc3,_0x295bb1[_0xf14e('0xe')][_0xf14e('0x10')]);return _0x4dffa2(_0x295bb1[_0xf14e('0xe')]['message']);}logger[_0xf14e('0xe')](_0xf14e('0xf'),_0x1e8dc3,_0x295bb1[_0xf14e('0xe')]['message']);return _0x22620c(_0x295bb1[_0xf14e('0xe')][_0xf14e('0x10')]);}else{logger[_0xf14e('0xb')](_0xf14e('0xf'),_0x1e8dc3,_0xf14e('0xc'));_0x22620c(_0x295bb1[_0xf14e('0x11')][_0xf14e('0x10')]);}})[_0xf14e('0x12')](function(_0x437907){logger[_0xf14e('0xe')]('Condition,\x20%s,\x20%s',_0x1e8dc3,_0x437907);_0x4dffa2(_0x437907);});});} \ No newline at end of file +var _0xa358=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x2d08c5,_0x2b19f1){var _0x5c71b1=function(_0x1c2af2){while(--_0x1c2af2){_0x2d08c5['push'](_0x2d08c5['shift']());}};_0x5c71b1(++_0x2b19f1);}(_0xa358,0x1cf));var _0x8a35=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa358[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8a35('0x0'));var util=require(_0x8a35('0x1'));var moment=require(_0x8a35('0x2'));var BPromise=require(_0x8a35('0x3'));var rs=require(_0x8a35('0x4'));var fs=require('fs');var Redis=require(_0x8a35('0x5'));var db=require(_0x8a35('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8a35('0x7')][_0x8a35('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a3cf1,_0x392d1a,_0x414454){return new BPromise(function(_0xb6b4c3,_0x25db48){return client[_0x8a35('0x9')](_0x5a3cf1,_0x414454)[_0x8a35('0xa')](function(_0x1489bd){logger[_0x8a35('0xb')](_0x8a35('0xc'),_0x392d1a,_0x8a35('0xd'));logger['debug']('Condition,\x20%s,\x20%s,\x20%s',_0x392d1a,_0x8a35('0xd'),JSON[_0x8a35('0xe')](_0x1489bd));if(_0x1489bd[_0x8a35('0xf')]){if(_0x1489bd[_0x8a35('0xf')][_0x8a35('0x10')]===0x1f4){logger[_0x8a35('0xf')]('Condition,\x20%s,\x20%s',_0x392d1a,_0x1489bd[_0x8a35('0xf')]['message']);return _0x25db48(_0x1489bd[_0x8a35('0xf')][_0x8a35('0x11')]);}logger[_0x8a35('0xf')](_0x8a35('0xc'),_0x392d1a,_0x1489bd[_0x8a35('0xf')][_0x8a35('0x11')]);return _0xb6b4c3(_0x1489bd[_0x8a35('0xf')][_0x8a35('0x11')]);}else{logger['info'](_0x8a35('0xc'),_0x392d1a,_0x8a35('0xd'));_0xb6b4c3(_0x1489bd[_0x8a35('0x12')][_0x8a35('0x11')]);}})[_0x8a35('0x13')](function(_0x3ab782){logger[_0x8a35('0xf')]('Condition,\x20%s,\x20%s',_0x392d1a,_0x3ab782);_0x25db48(_0x3ab782);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 4d272c4..8c858cc 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 _0x62f3=['update','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./condition.controller','/:id','isAuthenticated'];(function(_0x4ed281,_0x1d23b0){var _0x300161=function(_0x186cc8){while(--_0x186cc8){_0x4ed281['push'](_0x4ed281['shift']());}};_0x300161(++_0x1d23b0);}(_0x62f3,0x1a6));var _0x362f=function(_0x413ce5,_0x26c4ab){_0x413ce5=_0x413ce5-0x0;var _0x43d335=_0x62f3[_0x413ce5];return _0x43d335;};'use strict';var multer=require(_0x362f('0x0'));var util=require(_0x362f('0x1'));var path=require(_0x362f('0x2'));var timeout=require(_0x362f('0x3'));var express=require(_0x362f('0x4'));var router=express['Router']();var auth=require(_0x362f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x362f('0x6'));var controller=require(_0x362f('0x7'));router['put'](_0x362f('0x8'),auth[_0x362f('0x9')](),controller[_0x362f('0xa')]);router[_0x362f('0xb')](_0x362f('0x8'),auth[_0x362f('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6e88=['exports','multer','path','connect-timeout','../../components/interaction/service','./condition.controller','put','isAuthenticated','update','delete','/:id','destroy'];(function(_0x2e58c7,_0x23d092){var _0x26eb00=function(_0x343124){while(--_0x343124){_0x2e58c7['push'](_0x2e58c7['shift']());}};_0x26eb00(++_0x23d092);}(_0x6e88,0x169));var _0x86e8=function(_0x2a7820,_0x12d346){_0x2a7820=_0x2a7820-0x0;var _0x403436=_0x6e88[_0x2a7820];return _0x403436;};'use strict';var multer=require(_0x86e8('0x0'));var util=require('util');var path=require(_0x86e8('0x1'));var timeout=require(_0x86e8('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x86e8('0x3'));var config=require('../../config/environment');var controller=require(_0x86e8('0x4'));router[_0x86e8('0x5')]('/:id',auth[_0x86e8('0x6')](),controller[_0x86e8('0x7')]);router[_0x86e8('0x8')](_0x86e8('0x9'),auth[_0x86e8('0x6')](),controller[_0x86e8('0xa')]);module[_0x86e8('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 85a745f..bcd250f 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 _0xeac1=['STRING','name','exports'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xeac1,0x146));var _0x1eac=function(_0x5a06d9,_0xbcb06){_0x5a06d9=_0x5a06d9-0x0;var _0x42478b=_0xeac1[_0x5a06d9];return _0x42478b;};'use strict';var Sequelize=require('sequelize');module[_0x1eac('0x0')]={'name':{'type':Sequelize[_0x1eac('0x1')],'allowNull':![],'unique':_0x1eac('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x444f=['name','exports','STRING'];(function(_0x541d95,_0x2220bf){var _0xc52e8=function(_0x5a71ff){while(--_0x5a71ff){_0x541d95['push'](_0x541d95['shift']());}};_0xc52e8(++_0x2220bf);}(_0x444f,0xb5));var _0xf444=function(_0x1c6856,_0x8786ba){_0x1c6856=_0x1c6856-0x0;var _0x310ca5=_0x444f[_0x1c6856];return _0x310ca5;};'use strict';var Sequelize=require('sequelize');module[_0xf444('0x0')]={'name':{'type':Sequelize[_0xf444('0x1')],'allowNull':![],'unique':_0xf444('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index a5415d7..d49f8b6 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 _0x5bbd=['rawAttributes','fieldName','type','key','map','query','filters','model','attributes','intersection','fields','length','nolimit','sort','pick','filter','VIRTUAL','options','where','include','findAll','rows','catch','params','keys','includeAll','merge','find','body','user','get','role','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','attrUrl','attrs','value','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','defaults','localhost','redis','./dashboard.socket','end','status','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','CustomDashboards','UserProfileResource','sendStatus','error','stack','name','send','index','Dashboard'];(function(_0x2281af,_0x251abd){var _0x10b37f=function(_0x51e1ad){while(--_0x51e1ad){_0x2281af['push'](_0x2281af['shift']());}};_0x10b37f(++_0x251abd);}(_0x5bbd,0x12b));var _0xd5bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5bbd[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xd5bb('0x0'));var emlformat=require(_0xd5bb('0x1'));var rimraf=require(_0xd5bb('0x2'));var zipdir=require(_0xd5bb('0x3'));var jsonpatch=require(_0xd5bb('0x4'));var rp=require(_0xd5bb('0x5'));var moment=require(_0xd5bb('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd5bb('0x7'));var sox=require(_0xd5bb('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xd5bb('0x9'));var squel=require('squel');var crypto=require(_0xd5bb('0xa'));var jsforce=require(_0xd5bb('0xb'));var deskjs=require(_0xd5bb('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd5bb('0xd'));var Redis=require(_0xd5bb('0xe'));var authService=require(_0xd5bb('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd5bb('0x10'));var hardwareService=require(_0xd5bb('0x11'));var logger=require(_0xd5bb('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xd5bb('0x13'));var db=require(_0xd5bb('0x14'))['db'];config['redis']=_[_0xd5bb('0x15')](config['redis'],{'host':_0xd5bb('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd5bb('0x17')]));require(_0xd5bb('0x18'))['register'](socket);function respondWithStatusCode(_0x37bb78,_0x1f54eb){_0x1f54eb=_0x1f54eb||0xcc;return function(_0x140b49){if(_0x140b49){return _0x37bb78['sendStatus'](_0x1f54eb);}return _0x37bb78['status'](_0x1f54eb)[_0xd5bb('0x19')]();};}function respondWithResult(_0xa014fe,_0x516418){_0x516418=_0x516418||0xc8;return function(_0x2210d0){if(_0x2210d0){return _0xa014fe[_0xd5bb('0x1a')](_0x516418)[_0xd5bb('0x1b')](_0x2210d0);}};}function respondWithFilteredResult(_0x34c529,_0x510d9b){return function(_0x2de3c8){if(_0x2de3c8){var _0x41bc89=_0x2de3c8[_0xd5bb('0x1c')],_0x567d06=_0x510d9b['offset'],_0x3d312f=_0x510d9b[_0xd5bb('0x1d')]+_0x510d9b[_0xd5bb('0x1e')],_0x222b0c;if(_0x3d312f>=_0x41bc89){_0x3d312f=_0x41bc89;_0x222b0c=0xc8;}else{_0x222b0c=0xce;}_0x34c529[_0xd5bb('0x1a')](_0x222b0c);return _0x34c529[_0xd5bb('0x1f')](_0xd5bb('0x20'),_0x567d06+'-'+_0x3d312f+'/'+_0x41bc89)[_0xd5bb('0x1b')](_0x2de3c8);}return null;};}function patchUpdates(_0x56a68c){return function(_0x1b5a78){try{jsonpatch['apply'](_0x1b5a78,_0x56a68c,!![]);}catch(_0x502e86){return BPromise[_0xd5bb('0x21')](_0x502e86);}return _0x1b5a78['save']();};}function saveUpdates(_0x53f959,_0x118e3d){return function(_0x4765b7){if(_0x4765b7){return _0x4765b7[_0xd5bb('0x22')](_0x53f959)[_0xd5bb('0x23')](function(_0x285609){return _0x285609;});}return null;};}function removeEntity(_0x52383c,_0x2685ad){return function(_0x44e419){if(_0x44e419){return _0x44e419[_0xd5bb('0x24')]()[_0xd5bb('0x23')](function(){var _0xe53b0=_0x44e419['get']({'plain':!![]});var _0x5d5dac=_0xd5bb('0x25');return db[_0xd5bb('0x26')][_0xd5bb('0x24')]({'where':{'type':_0x5d5dac,'resourceId':_0xe53b0['id']}})[_0xd5bb('0x23')](function(){return _0x44e419;});})[_0xd5bb('0x23')](function(){_0x52383c['status'](0xcc)[_0xd5bb('0x19')]();});}};}function handleEntityNotFound(_0x4f6ec6,_0x30fa6d){return function(_0x188b13){if(!_0x188b13){_0x4f6ec6[_0xd5bb('0x27')](0x194);}return _0x188b13;};}function handleError(_0x32a83e,_0x10e5a6){_0x10e5a6=_0x10e5a6||0x1f4;return function(_0x31d1d1){logger[_0xd5bb('0x28')](_0x31d1d1[_0xd5bb('0x29')]);if(_0x31d1d1[_0xd5bb('0x2a')]){delete _0x31d1d1[_0xd5bb('0x2a')];}_0x32a83e[_0xd5bb('0x1a')](_0x10e5a6)[_0xd5bb('0x2b')](_0x31d1d1);};}exports[_0xd5bb('0x2c')]=function(_0x965a7f,_0x12aeea){var _0x2a6a4a={},_0x4db50b={},_0x12fa21={'count':0x0,'rows':[]};var _0x1a0166=_['map'](db[_0xd5bb('0x2d')][_0xd5bb('0x2e')],function(_0x4b8625){return{'name':_0x4b8625[_0xd5bb('0x2f')],'type':_0x4b8625[_0xd5bb('0x30')][_0xd5bb('0x31')]};});_0x4db50b['model']=_[_0xd5bb('0x32')](_0x1a0166,_0xd5bb('0x2a'));_0x4db50b['query']=_['keys'](_0x965a7f[_0xd5bb('0x33')]);_0x4db50b[_0xd5bb('0x34')]=_['intersection'](_0x4db50b[_0xd5bb('0x35')],_0x4db50b['query']);_0x2a6a4a[_0xd5bb('0x36')]=_[_0xd5bb('0x37')](_0x4db50b['model'],qs[_0xd5bb('0x38')](_0x965a7f[_0xd5bb('0x33')][_0xd5bb('0x38')]));_0x2a6a4a[_0xd5bb('0x36')]=_0x2a6a4a[_0xd5bb('0x36')][_0xd5bb('0x39')]?_0x2a6a4a['attributes']:_0x4db50b[_0xd5bb('0x35')];if(!_0x965a7f[_0xd5bb('0x33')]['hasOwnProperty'](_0xd5bb('0x3a'))){_0x2a6a4a[_0xd5bb('0x1e')]=qs[_0xd5bb('0x1e')](_0x965a7f[_0xd5bb('0x33')][_0xd5bb('0x1e')]);_0x2a6a4a[_0xd5bb('0x1d')]=qs[_0xd5bb('0x1d')](_0x965a7f[_0xd5bb('0x33')]['offset']);}_0x2a6a4a['order']=qs[_0xd5bb('0x3b')](_0x965a7f['query'][_0xd5bb('0x3b')]);_0x2a6a4a['where']=qs['filters'](_[_0xd5bb('0x3c')](_0x965a7f[_0xd5bb('0x33')],_0x4db50b[_0xd5bb('0x34')]));if(_0x965a7f[_0xd5bb('0x33')][_0xd5bb('0x3d')]){_0x2a6a4a['where']=_['merge'](_0x2a6a4a['where'],{'$or':_[_0xd5bb('0x32')](_0x1a0166,function(_0x1b1680){if(_0x1b1680[_0xd5bb('0x30')]!==_0xd5bb('0x3e')){var _0x5b7e32={};_0x5b7e32[_0x1b1680[_0xd5bb('0x2a')]]={'$like':'%'+_0x965a7f[_0xd5bb('0x33')][_0xd5bb('0x3d')]+'%'};return _0x5b7e32;}})});}_0x2a6a4a=_['merge']({},_0x2a6a4a,_0x965a7f[_0xd5bb('0x3f')]);var _0x54c5d8={'where':_0x2a6a4a[_0xd5bb('0x40')]};return db['Dashboard']['count'](_0x54c5d8)[_0xd5bb('0x23')](function(_0x50471b){_0x12fa21['count']=_0x50471b;if(_0x965a7f[_0xd5bb('0x33')]['includeAll']){_0x2a6a4a[_0xd5bb('0x41')]=[{'all':!![]}];}return db[_0xd5bb('0x2d')][_0xd5bb('0x42')](_0x2a6a4a);})['then'](function(_0x2fb4e8){_0x12fa21[_0xd5bb('0x43')]=_0x2fb4e8;return _0x12fa21;})[_0xd5bb('0x23')](respondWithFilteredResult(_0x12aeea,_0x2a6a4a))[_0xd5bb('0x44')](handleError(_0x12aeea,null));};exports['show']=function(_0x56a1ba,_0x47d1ee){var _0x30c47e={'raw':![],'where':{'id':_0x56a1ba[_0xd5bb('0x45')]['id']}},_0x2b9691={};_0x2b9691[_0xd5bb('0x35')]=_[_0xd5bb('0x46')](db[_0xd5bb('0x2d')][_0xd5bb('0x2e')]);_0x2b9691['query']=_[_0xd5bb('0x46')](_0x56a1ba[_0xd5bb('0x33')]);_0x2b9691[_0xd5bb('0x34')]=_[_0xd5bb('0x37')](_0x2b9691[_0xd5bb('0x35')],_0x2b9691[_0xd5bb('0x33')]);_0x30c47e['attributes']=_[_0xd5bb('0x37')](_0x2b9691[_0xd5bb('0x35')],qs[_0xd5bb('0x38')](_0x56a1ba[_0xd5bb('0x33')][_0xd5bb('0x38')]));_0x30c47e['attributes']=_0x30c47e['attributes'][_0xd5bb('0x39')]?_0x30c47e[_0xd5bb('0x36')]:_0x2b9691['model'];if(_0x56a1ba[_0xd5bb('0x33')][_0xd5bb('0x47')]){_0x30c47e['include']=[{'all':!![]}];}_0x30c47e=_[_0xd5bb('0x48')]({},_0x30c47e,_0x56a1ba['options']);return db[_0xd5bb('0x2d')][_0xd5bb('0x49')](_0x30c47e)[_0xd5bb('0x23')](handleEntityNotFound(_0x47d1ee,null))[_0xd5bb('0x23')](respondWithResult(_0x47d1ee,null))[_0xd5bb('0x44')](handleError(_0x47d1ee,null));};exports['create']=function(_0x1cbb68,_0x552d72){return db[_0xd5bb('0x2d')]['create'](_0x1cbb68[_0xd5bb('0x4a')],{})['then'](function(_0x4ea20b){var _0x2b697f=_0x1cbb68[_0xd5bb('0x4b')][_0xd5bb('0x4c')]({'plain':!![]});if(!_0x2b697f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b697f[_0xd5bb('0x4d')]===_0xd5bb('0x4b')){var _0x1664ac=_0x4ea20b[_0xd5bb('0x4c')]({'plain':!![]});var _0xc1fd5c=_0xd5bb('0x25');return db[_0xd5bb('0x4e')][_0xd5bb('0x49')]({'where':{'name':_0xc1fd5c,'userProfileId':_0x2b697f[_0xd5bb('0x4f')]},'raw':!![]})[_0xd5bb('0x23')](function(_0x1ee231){if(_0x1ee231&&_0x1ee231['autoAssociation']===0x0){return db[_0xd5bb('0x26')][_0xd5bb('0x50')]({'name':_0x1664ac[_0xd5bb('0x2a')],'resourceId':_0x1664ac['id'],'type':_0x1ee231[_0xd5bb('0x2a')],'sectionId':_0x1ee231['id']},{})[_0xd5bb('0x23')](function(){return _0x4ea20b;});}else{return _0x4ea20b;}})['catch'](function(_0x4f3d0a){logger[_0xd5bb('0x28')](_0xd5bb('0x51'),_0x4f3d0a);throw _0x4f3d0a;});}return _0x4ea20b;})[_0xd5bb('0x23')](respondWithResult(_0x552d72,0xc9))[_0xd5bb('0x44')](handleError(_0x552d72,null));};exports['clone']=function(_0x1abe56,_0x5f3bc7){var _0xbc62db={'where':{'id':_0x1abe56['params']['id']}},_0x2864c9={};_0x2864c9[_0xd5bb('0x35')]=_['keys'](db['Dashboard'][_0xd5bb('0x2e')]);_0xbc62db[_0xd5bb('0x36')]=_[_0xd5bb('0x37')](_0x2864c9[_0xd5bb('0x35')],qs[_0xd5bb('0x38')](_0x1abe56[_0xd5bb('0x33')][_0xd5bb('0x38')]));_0xbc62db[_0xd5bb('0x36')]=_0xbc62db[_0xd5bb('0x36')][_0xd5bb('0x39')]?_0xbc62db[_0xd5bb('0x36')]:_0x2864c9[_0xd5bb('0x35')];if(_0x1abe56[_0xd5bb('0x33')][_0xd5bb('0x47')]){_0xbc62db[_0xd5bb('0x41')]=[{'all':!![]}];}_0xbc62db=_['merge']({},_0xbc62db,_0x1abe56[_0xd5bb('0x3f')]);return db[_0xd5bb('0x2d')][_0xd5bb('0x49')](_0xbc62db)[_0xd5bb('0x23')](handleEntityNotFound(_0x5f3bc7,null))[_0xd5bb('0x23')](function(_0x50d89d){if(_0x50d89d){var _0x52ae78=_0x50d89d[_0xd5bb('0x4c')]({'plain':!![]});_0x52ae78=qs['omit'](_0x52ae78,['id',_0xd5bb('0x52'),_0xd5bb('0x53')]);_0x1abe56[_0xd5bb('0x4a')]=_[_0xd5bb('0x54')](_0x1abe56[_0xd5bb('0x4a')],['id',_0xd5bb('0x52'),_0xd5bb('0x53')]);return db[_0xd5bb('0x2d')]['create'](_[_0xd5bb('0x48')](_0x52ae78,_0x1abe56[_0xd5bb('0x4a')]),{'include':_0x1abe56[_0xd5bb('0x33')][_0xd5bb('0x47')]?[{'all':!![]}]:undefined})[_0xd5bb('0x23')](function(_0x2561e2){var _0xbcd6f5=_0x1abe56[_0xd5bb('0x4b')][_0xd5bb('0x4c')]({'plain':!![]});if(!_0xbcd6f5)throw new Error(_0xd5bb('0x55'));if(_0xbcd6f5['role']===_0xd5bb('0x4b')){var _0x5ade1f=_0x2561e2[_0xd5bb('0x4c')]({'plain':!![]});var _0x5075e9=_0xd5bb('0x25');return db[_0xd5bb('0x4e')][_0xd5bb('0x49')]({'where':{'name':_0x5075e9,'userProfileId':_0xbcd6f5[_0xd5bb('0x4f')]},'raw':!![]})[_0xd5bb('0x23')](function(_0x4d25fd){if(_0x4d25fd&&_0x4d25fd['autoAssociation']===0x0){return db[_0xd5bb('0x26')]['create']({'name':_0x5ade1f[_0xd5bb('0x2a')],'resourceId':_0x5ade1f['id'],'type':_0x4d25fd['name'],'sectionId':_0x4d25fd['id']},{})['then'](function(){return _0x2561e2;});}else{return _0x2561e2;}})['catch'](function(_0x266920){logger[_0xd5bb('0x28')](_0xd5bb('0x51'),_0x266920);throw _0x266920;});}return _0x2561e2;});}})[_0xd5bb('0x23')](respondWithResult(_0x5f3bc7,0xc9))[_0xd5bb('0x44')](handleError(_0x5f3bc7,null));};exports[_0xd5bb('0x22')]=function(_0x29aeb0,_0x298dff){if(_0x29aeb0[_0xd5bb('0x4a')]['id']){delete _0x29aeb0[_0xd5bb('0x4a')]['id'];}return db[_0xd5bb('0x2d')][_0xd5bb('0x49')]({'where':{'id':_0x29aeb0[_0xd5bb('0x45')]['id']}})[_0xd5bb('0x23')](handleEntityNotFound(_0x298dff,null))[_0xd5bb('0x23')](saveUpdates(_0x29aeb0['body'],null))[_0xd5bb('0x23')](respondWithResult(_0x298dff,null))[_0xd5bb('0x44')](handleError(_0x298dff,null));};exports[_0xd5bb('0x24')]=function(_0x9fc8fb,_0x31d2eb){return db['Dashboard'][_0xd5bb('0x49')]({'where':{'id':_0x9fc8fb['params']['id']}})[_0xd5bb('0x23')](handleEntityNotFound(_0x31d2eb,null))['then'](removeEntity(_0x31d2eb,null))['catch'](handleError(_0x31d2eb,null));};function widgetAttributes(_0xfe1322){try{switch(_0xfe1322[_0xd5bb('0x30')]){case'iframe':return[{'name':_0xd5bb('0x56'),'value':_0xfe1322[_0xd5bb('0x56')]||(_0xfe1322[_0xd5bb('0x57')]&&_0xfe1322['attrs'][0x0]?_0xfe1322[_0xd5bb('0x57')][0x0][_0xd5bb('0x58')]:undefined)||'https://'}];case _0xd5bb('0x59'):return[{'name':'attrPath','value':_0xfe1322[_0xd5bb('0x5a')]||(_0xfe1322[_0xd5bb('0x57')]&&_0xfe1322[_0xd5bb('0x57')][0x0]?_0xfe1322['attrs'][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0xd5bb('0x5b'),'value':_0xfe1322[_0xd5bb('0x5b')]||(_0xfe1322[_0xd5bb('0x57')]&&_0xfe1322[_0xd5bb('0x57')][0x0]?_0xfe1322['attrs'][0x0][_0xd5bb('0x58')]:undefined)||_0xd5bb('0x5c')},{'name':_0xd5bb('0x5d'),'value':_0xfe1322[_0xd5bb('0x5d')]||(_0xfe1322['attrs']&&_0xfe1322[_0xd5bb('0x57')][0x1]?_0xfe1322[_0xd5bb('0x57')][0x1]['value']:undefined)||_0xd5bb('0x5e')},{'name':_0xd5bb('0x5f'),'value':_0xfe1322['attrFontSize']||(_0xfe1322['attrs']&&_0xfe1322[_0xd5bb('0x57')][0x2]?_0xfe1322[_0xd5bb('0x57')][0x2][_0xd5bb('0x58')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0xfe1322['attrMetric']||(_0xfe1322[_0xd5bb('0x57')]&&_0xfe1322['attrs'][0x0]?_0xfe1322[_0xd5bb('0x57')][0x0]['value']:undefined)||_0xd5bb('0x60')},{'name':_0xd5bb('0x61'),'value':_0xfe1322[_0xd5bb('0x61')]||(_0xfe1322['attrs']&&_0xfe1322[_0xd5bb('0x57')][0x1]?_0xfe1322[_0xd5bb('0x57')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0xfe1322[_0xd5bb('0x5f')]||(_0xfe1322[_0xd5bb('0x57')]&&_0xfe1322[_0xd5bb('0x57')][0x2]?_0xfe1322['attrs'][0x2][_0xd5bb('0x58')]:undefined)||0x14}];case _0xd5bb('0x62'):case _0xd5bb('0x63'):return[{'name':_0xd5bb('0x64'),'value':_0xfe1322[_0xd5bb('0x64')]||(_0xfe1322[_0xd5bb('0x57')]&&_0xfe1322['attrs'][0x0]?_0xfe1322[_0xd5bb('0x57')][0x0][_0xd5bb('0x58')]:undefined)||'total'},{'name':_0xd5bb('0x65'),'value':_0xfe1322[_0xd5bb('0x65')]||(_0xfe1322[_0xd5bb('0x57')]&&_0xfe1322[_0xd5bb('0x57')][0x1]?_0xfe1322['attrs'][0x1][_0xd5bb('0x58')]:undefined)||null},{'name':'attrSerie3','value':_0xfe1322[_0xd5bb('0x66')]||(_0xfe1322['attrs']&&_0xfe1322[_0xd5bb('0x57')][0x2]?_0xfe1322[_0xd5bb('0x57')][0x2][_0xd5bb('0x58')]:undefined)||null},{'name':_0xd5bb('0x61'),'value':_0xfe1322[_0xd5bb('0x61')]||(_0xfe1322[_0xd5bb('0x57')]&&_0xfe1322[_0xd5bb('0x57')][0x3]?_0xfe1322[_0xd5bb('0x57')][0x3][_0xd5bb('0x58')]:undefined)||[]}];case _0xd5bb('0x67'):return[{'name':_0xd5bb('0x68'),'type':_0xfe1322[_0xd5bb('0x69')]||(_0xfe1322[_0xd5bb('0x57')]&&_0xfe1322[_0xd5bb('0x57')][0x0]?_0xfe1322['attrs'][0x0][_0xd5bb('0x30')]:undefined)||null,'value':_0xfe1322[_0xd5bb('0x68')]||(_0xfe1322[_0xd5bb('0x57')]&&_0xfe1322[_0xd5bb('0x57')][0x0]?_0xfe1322[_0xd5bb('0x57')][0x0]['value']:undefined)||null},{'name':_0xd5bb('0x6a'),'value':_0xfe1322['attrRefresh']||(_0xfe1322['attrs']&&_0xfe1322['attrs'][0x1]?_0xfe1322[_0xd5bb('0x57')][0x1][_0xd5bb('0x58')]:undefined)||0x0}];default:return[];}}catch(_0x1d858d){logger[_0xd5bb('0x28')](_0xd5bb('0x6b'),JSON[_0xd5bb('0x6c')](_0x1d858d));return[];}}exports[_0xd5bb('0x6d')]=function(_0xa33a6c,_0x44954a,_0x619033){if(_0xa33a6c[_0xd5bb('0x4a')]['id']){delete _0xa33a6c[_0xd5bb('0x4a')]['id'];}return db[_0xd5bb('0x2d')]['find']({'where':{'id':_0xa33a6c[_0xd5bb('0x45')]['id']}})[_0xd5bb('0x23')](handleEntityNotFound(_0x44954a,null))[_0xd5bb('0x23')](function(_0x4485c1){if(_0x4485c1){_0xa33a6c['body'][_0xd5bb('0x6e')]=_0x4485c1['id'];_0xa33a6c[_0xd5bb('0x4a')][_0xd5bb('0x57')]=widgetAttributes(_0xa33a6c[_0xd5bb('0x4a')]);return db[_0xd5bb('0x6f')]['create'](_0xa33a6c[_0xd5bb('0x4a')]);}})[_0xd5bb('0x23')](respondWithResult(_0x44954a,null))[_0xd5bb('0x44')](handleError(_0x44954a,null));};exports[_0xd5bb('0x70')]=function(_0x5cdbb3,_0x2af7c9,_0x573033){var _0x352c76={};var _0x1b278e={};var _0x5beee4;var _0x53c0bd;return db[_0xd5bb('0x2d')][_0xd5bb('0x71')]({'where':{'id':_0x5cdbb3[_0xd5bb('0x45')]['id']}})[_0xd5bb('0x23')](handleEntityNotFound(_0x2af7c9,null))['then'](function(_0x4260a){if(_0x4260a){_0x5beee4=_0x4260a;_0x1b278e[_0xd5bb('0x35')]=_[_0xd5bb('0x46')](db['DashboardItem'][_0xd5bb('0x2e')]);_0x1b278e[_0xd5bb('0x33')]=_[_0xd5bb('0x46')](_0x5cdbb3[_0xd5bb('0x33')]);_0x1b278e[_0xd5bb('0x34')]=_['intersection'](_0x1b278e[_0xd5bb('0x35')],_0x1b278e[_0xd5bb('0x33')]);_0x352c76[_0xd5bb('0x36')]=_[_0xd5bb('0x37')](_0x1b278e[_0xd5bb('0x35')],qs[_0xd5bb('0x38')](_0x5cdbb3['query'][_0xd5bb('0x38')]));_0x352c76[_0xd5bb('0x36')]=_0x352c76[_0xd5bb('0x36')][_0xd5bb('0x39')]?_0x352c76[_0xd5bb('0x36')]:_0x1b278e[_0xd5bb('0x35')];_0x352c76['order']=qs['sort'](_0x5cdbb3[_0xd5bb('0x33')][_0xd5bb('0x3b')]);_0x352c76[_0xd5bb('0x40')]=qs['filters'](_[_0xd5bb('0x3c')](_0x5cdbb3['query'],_0x1b278e[_0xd5bb('0x34')]));if(_0x5cdbb3['query'][_0xd5bb('0x3d')]){_0x352c76[_0xd5bb('0x40')]=_['merge'](_0x352c76[_0xd5bb('0x40')],{'$or':_[_0xd5bb('0x32')](_0x352c76[_0xd5bb('0x36')],function(_0x2a1f2e){var _0x5a89ac={};_0x5a89ac[_0x2a1f2e]={'$like':'%'+_0x5cdbb3[_0xd5bb('0x33')][_0xd5bb('0x3d')]+'%'};return _0x5a89ac;})});}_0x352c76=_[_0xd5bb('0x48')]({},_0x352c76,_0x5cdbb3[_0xd5bb('0x3f')]);return _0x5beee4[_0xd5bb('0x70')](_0x352c76);}})[_0xd5bb('0x23')](function(_0x19c81d){if(_0x19c81d){_0x53c0bd=_0x19c81d[_0xd5bb('0x39')];if(!_0x5cdbb3[_0xd5bb('0x33')][_0xd5bb('0x72')](_0xd5bb('0x3a'))){_0x352c76[_0xd5bb('0x1e')]=qs[_0xd5bb('0x1e')](_0x5cdbb3[_0xd5bb('0x33')][_0xd5bb('0x1e')]);_0x352c76[_0xd5bb('0x1d')]=qs[_0xd5bb('0x1d')](_0x5cdbb3[_0xd5bb('0x33')]['offset']);}return _0x5beee4[_0xd5bb('0x70')](_0x352c76);}})[_0xd5bb('0x23')](function(_0x514dfe){if(_0x514dfe){return _0x514dfe?{'count':_0x53c0bd,'rows':_0x514dfe}:null;}})['then'](respondWithResult(_0x2af7c9,null))['catch'](handleError(_0x2af7c9,null));}; \ No newline at end of file +var _0x644a=['clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','multibar-chart','attrSerie2','attrSerie3','attrVoiceQueues','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','rawAttributes','where','pick','getItems','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./dashboard.socket','register','status','json','count','offset','limit','set','reject','update','then','destroy','get','UserProfileResource','end','error','name','send','map','Dashboard','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','VIRTUAL','include','findAll','rows','show','params','includeAll','options','find','catch','create','user','role','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','iframe','attrUrl','attrs','value','https://','attrPath'];(function(_0x133ee2,_0x1365ff){var _0x28e86f=function(_0x162938){while(--_0x162938){_0x133ee2['push'](_0x133ee2['shift']());}};_0x28e86f(++_0x1365ff);}(_0x644a,0xfd));var _0xa644=function(_0x380e75,_0x486360){_0x380e75=_0x380e75-0x0;var _0x444d96=_0x644a[_0x380e75];return _0x444d96;};'use strict';var pdf=require(_0xa644('0x0'));var emlformat=require(_0xa644('0x1'));var rimraf=require(_0xa644('0x2'));var zipdir=require(_0xa644('0x3'));var jsonpatch=require(_0xa644('0x4'));var rp=require('request-promise');var moment=require(_0xa644('0x5'));var BPromise=require(_0xa644('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa644('0x7'));var sox=require(_0xa644('0x8'));var csv=require(_0xa644('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa644('0xa'));var squel=require(_0xa644('0xb'));var crypto=require('crypto');var jsforce=require(_0xa644('0xc'));var deskjs=require(_0xa644('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa644('0xe'));var Redis=require(_0xa644('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa644('0x10'));var as=require(_0xa644('0x11'));var hardwareService=require(_0xa644('0x12'));var logger=require(_0xa644('0x13'))(_0xa644('0x14'));var utils=require('../../config/utils');var config=require(_0xa644('0x15'));var db=require(_0xa644('0x16'))['db'];config[_0xa644('0x17')]=_[_0xa644('0x18')](config[_0xa644('0x17')],{'host':_0xa644('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa644('0x17')]));require(_0xa644('0x1a'))[_0xa644('0x1b')](socket);function respondWithStatusCode(_0x10783c,_0x3abf72){_0x3abf72=_0x3abf72||0xcc;return function(_0x270e3d){if(_0x270e3d){return _0x10783c['sendStatus'](_0x3abf72);}return _0x10783c['status'](_0x3abf72)['end']();};}function respondWithResult(_0x57ccc2,_0x593e84){_0x593e84=_0x593e84||0xc8;return function(_0x490c61){if(_0x490c61){return _0x57ccc2[_0xa644('0x1c')](_0x593e84)[_0xa644('0x1d')](_0x490c61);}};}function respondWithFilteredResult(_0x583045,_0x11efbc){return function(_0x2cad68){if(_0x2cad68){var _0x1536ee=_0x2cad68[_0xa644('0x1e')],_0x6fb957=_0x11efbc[_0xa644('0x1f')],_0x2cf6c9=_0x11efbc[_0xa644('0x1f')]+_0x11efbc[_0xa644('0x20')],_0x300aa0;if(_0x2cf6c9>=_0x1536ee){_0x2cf6c9=_0x1536ee;_0x300aa0=0xc8;}else{_0x300aa0=0xce;}_0x583045[_0xa644('0x1c')](_0x300aa0);return _0x583045[_0xa644('0x21')]('Content-Range',_0x6fb957+'-'+_0x2cf6c9+'/'+_0x1536ee)[_0xa644('0x1d')](_0x2cad68);}return null;};}function patchUpdates(_0x266e05){return function(_0xaddc7d){try{jsonpatch['apply'](_0xaddc7d,_0x266e05,!![]);}catch(_0x38806b){return BPromise[_0xa644('0x22')](_0x38806b);}return _0xaddc7d['save']();};}function saveUpdates(_0x384a2d,_0x8ff425){return function(_0x549f60){if(_0x549f60){return _0x549f60[_0xa644('0x23')](_0x384a2d)[_0xa644('0x24')](function(_0x45532a){return _0x45532a;});}return null;};}function removeEntity(_0x3eeb0d,_0x13dfd6){return function(_0x285a35){if(_0x285a35){return _0x285a35[_0xa644('0x25')]()[_0xa644('0x24')](function(){var _0x5d72e3=_0x285a35[_0xa644('0x26')]({'plain':!![]});var _0x41d671='CustomDashboards';return db[_0xa644('0x27')][_0xa644('0x25')]({'where':{'type':_0x41d671,'resourceId':_0x5d72e3['id']}})[_0xa644('0x24')](function(){return _0x285a35;});})[_0xa644('0x24')](function(){_0x3eeb0d['status'](0xcc)[_0xa644('0x28')]();});}};}function handleEntityNotFound(_0x332ad5,_0x38615f){return function(_0x214bdc){if(!_0x214bdc){_0x332ad5['sendStatus'](0x194);}return _0x214bdc;};}function handleError(_0x4bb142,_0x47032f){_0x47032f=_0x47032f||0x1f4;return function(_0x3d9fea){logger[_0xa644('0x29')](_0x3d9fea['stack']);if(_0x3d9fea['name']){delete _0x3d9fea[_0xa644('0x2a')];}_0x4bb142[_0xa644('0x1c')](_0x47032f)[_0xa644('0x2b')](_0x3d9fea);};}exports['index']=function(_0x1e84eb,_0x449580){var _0x41c7e5={},_0x5a038f={},_0x569590={'count':0x0,'rows':[]};var _0x25a8c8=_[_0xa644('0x2c')](db[_0xa644('0x2d')]['rawAttributes'],function(_0x586945){return{'name':_0x586945['fieldName'],'type':_0x586945[_0xa644('0x2e')][_0xa644('0x2f')]};});_0x5a038f['model']=_[_0xa644('0x2c')](_0x25a8c8,_0xa644('0x2a'));_0x5a038f[_0xa644('0x30')]=_[_0xa644('0x31')](_0x1e84eb[_0xa644('0x30')]);_0x5a038f[_0xa644('0x32')]=_[_0xa644('0x33')](_0x5a038f[_0xa644('0x34')],_0x5a038f[_0xa644('0x30')]);_0x41c7e5[_0xa644('0x35')]=_['intersection'](_0x5a038f[_0xa644('0x34')],qs[_0xa644('0x36')](_0x1e84eb[_0xa644('0x30')][_0xa644('0x36')]));_0x41c7e5[_0xa644('0x35')]=_0x41c7e5['attributes'][_0xa644('0x37')]?_0x41c7e5['attributes']:_0x5a038f[_0xa644('0x34')];if(!_0x1e84eb[_0xa644('0x30')][_0xa644('0x38')](_0xa644('0x39'))){_0x41c7e5[_0xa644('0x20')]=qs[_0xa644('0x20')](_0x1e84eb[_0xa644('0x30')]['limit']);_0x41c7e5[_0xa644('0x1f')]=qs[_0xa644('0x1f')](_0x1e84eb[_0xa644('0x30')][_0xa644('0x1f')]);}_0x41c7e5[_0xa644('0x3a')]=qs['sort'](_0x1e84eb[_0xa644('0x30')][_0xa644('0x3b')]);_0x41c7e5['where']=qs[_0xa644('0x32')](_['pick'](_0x1e84eb[_0xa644('0x30')],_0x5a038f[_0xa644('0x32')]));if(_0x1e84eb[_0xa644('0x30')][_0xa644('0x3c')]){_0x41c7e5['where']=_[_0xa644('0x3d')](_0x41c7e5['where'],{'$or':_[_0xa644('0x2c')](_0x25a8c8,function(_0x40f218){if(_0x40f218['type']!==_0xa644('0x3e')){var _0x55a360={};_0x55a360[_0x40f218[_0xa644('0x2a')]]={'$like':'%'+_0x1e84eb['query'][_0xa644('0x3c')]+'%'};return _0x55a360;}})});}_0x41c7e5=_[_0xa644('0x3d')]({},_0x41c7e5,_0x1e84eb['options']);var _0x49f615={'where':_0x41c7e5['where']};return db['Dashboard'][_0xa644('0x1e')](_0x49f615)[_0xa644('0x24')](function(_0x52b395){_0x569590[_0xa644('0x1e')]=_0x52b395;if(_0x1e84eb['query']['includeAll']){_0x41c7e5[_0xa644('0x3f')]=[{'all':!![]}];}return db[_0xa644('0x2d')][_0xa644('0x40')](_0x41c7e5);})[_0xa644('0x24')](function(_0x135bd7){_0x569590[_0xa644('0x41')]=_0x135bd7;return _0x569590;})[_0xa644('0x24')](respondWithFilteredResult(_0x449580,_0x41c7e5))['catch'](handleError(_0x449580,null));};exports[_0xa644('0x42')]=function(_0x517f3d,_0x218572){var _0x1df6f5={'raw':![],'where':{'id':_0x517f3d[_0xa644('0x43')]['id']}},_0xaa3cb9={};_0xaa3cb9[_0xa644('0x34')]=_['keys'](db[_0xa644('0x2d')]['rawAttributes']);_0xaa3cb9[_0xa644('0x30')]=_[_0xa644('0x31')](_0x517f3d[_0xa644('0x30')]);_0xaa3cb9[_0xa644('0x32')]=_[_0xa644('0x33')](_0xaa3cb9['model'],_0xaa3cb9[_0xa644('0x30')]);_0x1df6f5[_0xa644('0x35')]=_[_0xa644('0x33')](_0xaa3cb9['model'],qs['fields'](_0x517f3d['query'][_0xa644('0x36')]));_0x1df6f5['attributes']=_0x1df6f5[_0xa644('0x35')][_0xa644('0x37')]?_0x1df6f5[_0xa644('0x35')]:_0xaa3cb9[_0xa644('0x34')];if(_0x517f3d[_0xa644('0x30')][_0xa644('0x44')]){_0x1df6f5[_0xa644('0x3f')]=[{'all':!![]}];}_0x1df6f5=_[_0xa644('0x3d')]({},_0x1df6f5,_0x517f3d[_0xa644('0x45')]);return db[_0xa644('0x2d')][_0xa644('0x46')](_0x1df6f5)['then'](handleEntityNotFound(_0x218572,null))[_0xa644('0x24')](respondWithResult(_0x218572,null))[_0xa644('0x47')](handleError(_0x218572,null));};exports[_0xa644('0x48')]=function(_0x761fcf,_0x3da3aa){return db[_0xa644('0x2d')]['create'](_0x761fcf['body'],{})['then'](function(_0x2806ef){var _0x48ed40=_0x761fcf[_0xa644('0x49')][_0xa644('0x26')]({'plain':!![]});if(!_0x48ed40)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x48ed40[_0xa644('0x4a')]===_0xa644('0x49')){var _0xdc92b7=_0x2806ef[_0xa644('0x26')]({'plain':!![]});var _0x4d40b0=_0xa644('0x4b');return db[_0xa644('0x4c')][_0xa644('0x46')]({'where':{'name':_0x4d40b0,'userProfileId':_0x48ed40[_0xa644('0x4d')]},'raw':!![]})[_0xa644('0x24')](function(_0x922dc5){if(_0x922dc5&&_0x922dc5[_0xa644('0x4e')]===0x0){return db[_0xa644('0x27')][_0xa644('0x48')]({'name':_0xdc92b7['name'],'resourceId':_0xdc92b7['id'],'type':_0x922dc5[_0xa644('0x2a')],'sectionId':_0x922dc5['id']},{})[_0xa644('0x24')](function(){return _0x2806ef;});}else{return _0x2806ef;}})['catch'](function(_0xe54467){logger[_0xa644('0x29')](_0xa644('0x4f'),_0xe54467);throw _0xe54467;});}return _0x2806ef;})[_0xa644('0x24')](respondWithResult(_0x3da3aa,0xc9))[_0xa644('0x47')](handleError(_0x3da3aa,null));};exports[_0xa644('0x50')]=function(_0x1edaaf,_0x427f25){var _0x15850e={'where':{'id':_0x1edaaf['params']['id']}},_0x32b3e5={};_0x32b3e5['model']=_[_0xa644('0x31')](db[_0xa644('0x2d')]['rawAttributes']);_0x15850e['attributes']=_[_0xa644('0x33')](_0x32b3e5[_0xa644('0x34')],qs[_0xa644('0x36')](_0x1edaaf[_0xa644('0x30')][_0xa644('0x36')]));_0x15850e[_0xa644('0x35')]=_0x15850e[_0xa644('0x35')]['length']?_0x15850e['attributes']:_0x32b3e5[_0xa644('0x34')];if(_0x1edaaf['query'][_0xa644('0x44')]){_0x15850e['include']=[{'all':!![]}];}_0x15850e=_[_0xa644('0x3d')]({},_0x15850e,_0x1edaaf['options']);return db[_0xa644('0x2d')]['find'](_0x15850e)['then'](handleEntityNotFound(_0x427f25,null))[_0xa644('0x24')](function(_0x3e242a){if(_0x3e242a){var _0x2969d3=_0x3e242a[_0xa644('0x26')]({'plain':!![]});_0x2969d3=qs['omit'](_0x2969d3,['id',_0xa644('0x51'),_0xa644('0x52')]);_0x1edaaf[_0xa644('0x53')]=_[_0xa644('0x54')](_0x1edaaf[_0xa644('0x53')],['id','createdAt',_0xa644('0x52')]);return db[_0xa644('0x2d')][_0xa644('0x48')](_['merge'](_0x2969d3,_0x1edaaf[_0xa644('0x53')]),{'include':_0x1edaaf[_0xa644('0x30')][_0xa644('0x44')]?[{'all':!![]}]:undefined})[_0xa644('0x24')](function(_0x21434f){var _0x4ec06c=_0x1edaaf['user'][_0xa644('0x26')]({'plain':!![]});if(!_0x4ec06c)throw new Error(_0xa644('0x55'));if(_0x4ec06c[_0xa644('0x4a')]==='user'){var _0x3027f9=_0x21434f[_0xa644('0x26')]({'plain':!![]});var _0x1705e4='CustomDashboards';return db[_0xa644('0x4c')]['find']({'where':{'name':_0x1705e4,'userProfileId':_0x4ec06c[_0xa644('0x4d')]},'raw':!![]})[_0xa644('0x24')](function(_0x417058){if(_0x417058&&_0x417058[_0xa644('0x4e')]===0x0){return db[_0xa644('0x27')][_0xa644('0x48')]({'name':_0x3027f9[_0xa644('0x2a')],'resourceId':_0x3027f9['id'],'type':_0x417058[_0xa644('0x2a')],'sectionId':_0x417058['id']},{})['then'](function(){return _0x21434f;});}else{return _0x21434f;}})[_0xa644('0x47')](function(_0x1e7014){logger[_0xa644('0x29')](_0xa644('0x4f'),_0x1e7014);throw _0x1e7014;});}return _0x21434f;});}})[_0xa644('0x24')](respondWithResult(_0x427f25,0xc9))['catch'](handleError(_0x427f25,null));};exports[_0xa644('0x23')]=function(_0x8c6f5c,_0x3ebcc){if(_0x8c6f5c['body']['id']){delete _0x8c6f5c[_0xa644('0x53')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x8c6f5c[_0xa644('0x43')]['id']}})[_0xa644('0x24')](handleEntityNotFound(_0x3ebcc,null))[_0xa644('0x24')](saveUpdates(_0x8c6f5c['body'],null))[_0xa644('0x24')](respondWithResult(_0x3ebcc,null))[_0xa644('0x47')](handleError(_0x3ebcc,null));};exports['destroy']=function(_0x54a9c1,_0x94b869){return db[_0xa644('0x2d')][_0xa644('0x46')]({'where':{'id':_0x54a9c1['params']['id']}})['then'](handleEntityNotFound(_0x94b869,null))[_0xa644('0x24')](removeEntity(_0x94b869,null))[_0xa644('0x47')](handleError(_0x94b869,null));};function widgetAttributes(_0x25d8c3){try{switch(_0x25d8c3[_0xa644('0x2e')]){case _0xa644('0x56'):return[{'name':_0xa644('0x57'),'value':_0x25d8c3['attrUrl']||(_0x25d8c3['attrs']&&_0x25d8c3['attrs'][0x0]?_0x25d8c3[_0xa644('0x58')][0x0][_0xa644('0x59')]:undefined)||_0xa644('0x5a')}];case'custom':return[{'name':_0xa644('0x5b'),'value':_0x25d8c3['attrPath']||(_0x25d8c3[_0xa644('0x58')]&&_0x25d8c3[_0xa644('0x58')][0x0]?_0x25d8c3[_0xa644('0x58')][0x0][_0xa644('0x59')]:undefined)||''}];case _0xa644('0x5c'):return[{'name':_0xa644('0x5d'),'value':_0x25d8c3[_0xa644('0x5d')]||(_0x25d8c3[_0xa644('0x58')]&&_0x25d8c3[_0xa644('0x58')][0x0]?_0x25d8c3[_0xa644('0x58')][0x0][_0xa644('0x59')]:undefined)||_0xa644('0x5e')},{'name':'attrTimezone','value':_0x25d8c3[_0xa644('0x5f')]||(_0x25d8c3[_0xa644('0x58')]&&_0x25d8c3[_0xa644('0x58')][0x1]?_0x25d8c3[_0xa644('0x58')][0x1][_0xa644('0x59')]:undefined)||_0xa644('0x60')},{'name':_0xa644('0x61'),'value':_0x25d8c3[_0xa644('0x61')]||(_0x25d8c3['attrs']&&_0x25d8c3[_0xa644('0x58')][0x2]?_0x25d8c3[_0xa644('0x58')][0x2][_0xa644('0x59')]:undefined)||0xc}];case'counter':return[{'name':_0xa644('0x62'),'value':_0x25d8c3['attrMetric']||(_0x25d8c3[_0xa644('0x58')]&&_0x25d8c3[_0xa644('0x58')][0x0]?_0x25d8c3[_0xa644('0x58')][0x0][_0xa644('0x59')]:undefined)||_0xa644('0x63')},{'name':'attrVoiceQueues','value':_0x25d8c3['attrVoiceQueues']||(_0x25d8c3['attrs']&&_0x25d8c3[_0xa644('0x58')][0x1]?_0x25d8c3['attrs'][0x1][_0xa644('0x59')]:undefined)||[]},{'name':_0xa644('0x61'),'value':_0x25d8c3['attrFontSize']||(_0x25d8c3[_0xa644('0x58')]&&_0x25d8c3[_0xa644('0x58')][0x2]?_0x25d8c3[_0xa644('0x58')][0x2][_0xa644('0x59')]:undefined)||0x14}];case _0xa644('0x64'):case'pie-chart':return[{'name':'attrSerie1','value':_0x25d8c3['attrSerie1']||(_0x25d8c3[_0xa644('0x58')]&&_0x25d8c3[_0xa644('0x58')][0x0]?_0x25d8c3[_0xa644('0x58')][0x0][_0xa644('0x59')]:undefined)||_0xa644('0x63')},{'name':_0xa644('0x65'),'value':_0x25d8c3['attrSerie2']||(_0x25d8c3[_0xa644('0x58')]&&_0x25d8c3['attrs'][0x1]?_0x25d8c3[_0xa644('0x58')][0x1][_0xa644('0x59')]:undefined)||null},{'name':_0xa644('0x66'),'value':_0x25d8c3[_0xa644('0x66')]||(_0x25d8c3[_0xa644('0x58')]&&_0x25d8c3['attrs'][0x2]?_0x25d8c3[_0xa644('0x58')][0x2]['value']:undefined)||null},{'name':_0xa644('0x67'),'value':_0x25d8c3[_0xa644('0x67')]||(_0x25d8c3[_0xa644('0x58')]&&_0x25d8c3[_0xa644('0x58')][0x3]?_0x25d8c3[_0xa644('0x58')][0x3][_0xa644('0x59')]:undefined)||[]}];case'web-report':return[{'name':_0xa644('0x68'),'type':_0x25d8c3['reportType']||(_0x25d8c3['attrs']&&_0x25d8c3[_0xa644('0x58')][0x0]?_0x25d8c3[_0xa644('0x58')][0x0]['type']:undefined)||null,'value':_0x25d8c3[_0xa644('0x68')]||(_0x25d8c3['attrs']&&_0x25d8c3['attrs'][0x0]?_0x25d8c3['attrs'][0x0][_0xa644('0x59')]:undefined)||null},{'name':'attrRefresh','value':_0x25d8c3[_0xa644('0x69')]||(_0x25d8c3['attrs']&&_0x25d8c3[_0xa644('0x58')][0x1]?_0x25d8c3[_0xa644('0x58')][0x1][_0xa644('0x59')]:undefined)||0x0}];default:return[];}}catch(_0x485184){logger[_0xa644('0x29')](_0xa644('0x6a'),JSON[_0xa644('0x6b')](_0x485184));return[];}}exports[_0xa644('0x6c')]=function(_0x4410db,_0x22cca7,_0x20fd25){if(_0x4410db[_0xa644('0x53')]['id']){delete _0x4410db[_0xa644('0x53')]['id'];}return db[_0xa644('0x2d')][_0xa644('0x46')]({'where':{'id':_0x4410db['params']['id']}})[_0xa644('0x24')](handleEntityNotFound(_0x22cca7,null))['then'](function(_0x37af93){if(_0x37af93){_0x4410db['body'][_0xa644('0x6d')]=_0x37af93['id'];_0x4410db[_0xa644('0x53')][_0xa644('0x58')]=widgetAttributes(_0x4410db[_0xa644('0x53')]);return db['DashboardItem'][_0xa644('0x48')](_0x4410db[_0xa644('0x53')]);}})['then'](respondWithResult(_0x22cca7,null))['catch'](handleError(_0x22cca7,null));};exports['getItems']=function(_0x340599,_0x1903f8,_0x9db448){var _0x3e6b4d={};var _0x4ca169={};var _0x607aed;var _0x14bd90;return db[_0xa644('0x2d')]['findOne']({'where':{'id':_0x340599['params']['id']}})[_0xa644('0x24')](handleEntityNotFound(_0x1903f8,null))[_0xa644('0x24')](function(_0x2625b1){if(_0x2625b1){_0x607aed=_0x2625b1;_0x4ca169[_0xa644('0x34')]=_[_0xa644('0x31')](db[_0xa644('0x6e')][_0xa644('0x6f')]);_0x4ca169[_0xa644('0x30')]=_[_0xa644('0x31')](_0x340599['query']);_0x4ca169['filters']=_[_0xa644('0x33')](_0x4ca169['model'],_0x4ca169['query']);_0x3e6b4d['attributes']=_[_0xa644('0x33')](_0x4ca169[_0xa644('0x34')],qs[_0xa644('0x36')](_0x340599[_0xa644('0x30')]['fields']));_0x3e6b4d['attributes']=_0x3e6b4d[_0xa644('0x35')]['length']?_0x3e6b4d[_0xa644('0x35')]:_0x4ca169[_0xa644('0x34')];_0x3e6b4d[_0xa644('0x3a')]=qs[_0xa644('0x3b')](_0x340599[_0xa644('0x30')]['sort']);_0x3e6b4d[_0xa644('0x70')]=qs[_0xa644('0x32')](_[_0xa644('0x71')](_0x340599[_0xa644('0x30')],_0x4ca169[_0xa644('0x32')]));if(_0x340599['query'][_0xa644('0x3c')]){_0x3e6b4d[_0xa644('0x70')]=_[_0xa644('0x3d')](_0x3e6b4d[_0xa644('0x70')],{'$or':_['map'](_0x3e6b4d['attributes'],function(_0x466e3f){var _0x267ab0={};_0x267ab0[_0x466e3f]={'$like':'%'+_0x340599[_0xa644('0x30')]['filter']+'%'};return _0x267ab0;})});}_0x3e6b4d=_[_0xa644('0x3d')]({},_0x3e6b4d,_0x340599[_0xa644('0x45')]);return _0x607aed['getItems'](_0x3e6b4d);}})[_0xa644('0x24')](function(_0x3a4880){if(_0x3a4880){_0x14bd90=_0x3a4880[_0xa644('0x37')];if(!_0x340599[_0xa644('0x30')][_0xa644('0x38')]('nolimit')){_0x3e6b4d[_0xa644('0x20')]=qs['limit'](_0x340599['query']['limit']);_0x3e6b4d['offset']=qs[_0xa644('0x1f')](_0x340599[_0xa644('0x30')][_0xa644('0x1f')]);}return _0x607aed[_0xa644('0x72')](_0x3e6b4d);}})['then'](function(_0x33b47c){if(_0x33b47c){return _0x33b47c?{'count':_0x14bd90,'rows':_0x33b47c}:null;}})[_0xa644('0x24')](respondWithResult(_0x1903f8,null))[_0xa644('0x47')](handleError(_0x1903f8,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 6cc88f1..3041b93 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 _0x8e78=['../../mysqldb','Dashboard','setMaxListeners','save','hook','exports','events'];(function(_0x2298f0,_0x3bbf4f){var _0x39b136=function(_0xc2cd6e){while(--_0xc2cd6e){_0x2298f0['push'](_0x2298f0['shift']());}};_0x39b136(++_0x3bbf4f);}(_0x8e78,0xf4));var _0x88e7=function(_0x20228b,_0x3c6232){_0x20228b=_0x20228b-0x0;var _0x3986fd=_0x8e78[_0x20228b];return _0x3986fd;};'use strict';var EventEmitter=require(_0x88e7('0x0'));var Dashboard=require(_0x88e7('0x1'))['db'][_0x88e7('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x88e7('0x3')](0x0);var events={'afterCreate':_0x88e7('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2c61a1){return function(_0x29cf0a,_0x3bd339,_0x57b12a){DashboardEvents['emit'](_0x2c61a1+':'+_0x29cf0a['id'],_0x29cf0a);DashboardEvents['emit'](_0x2c61a1,_0x29cf0a);_0x57b12a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x88e7('0x5')](e,emitEvent(event));}}module[_0x88e7('0x6')]=DashboardEvents; \ No newline at end of file +var _0x9718=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard'];(function(_0x42bb32,_0x149bb3){var _0x505504=function(_0x4dbfdc){while(--_0x4dbfdc){_0x42bb32['push'](_0x42bb32['shift']());}};_0x505504(++_0x149bb3);}(_0x9718,0x9d));var _0x8971=function(_0xb05b4c,_0x4a5db0){_0xb05b4c=_0xb05b4c-0x0;var _0x2ebaeb=_0x9718[_0xb05b4c];return _0x2ebaeb;};'use strict';var EventEmitter=require(_0x8971('0x0'));var Dashboard=require(_0x8971('0x1'))['db'][_0x8971('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8971('0x3'),'afterUpdate':_0x8971('0x4'),'afterDestroy':_0x8971('0x5')};function emitEvent(_0xd27bd2){return function(_0x864218,_0x12bbff,_0x4f5c53){DashboardEvents[_0x8971('0x6')](_0xd27bd2+':'+_0x864218['id'],_0x864218);DashboardEvents[_0x8971('0x6')](_0xd27bd2,_0x864218);_0x4f5c53(null);};}for(var e in events){if(events[_0x8971('0x7')](e)){var event=events[e];Dashboard[_0x8971('0x8')](e,emitEvent(event));}}module[_0x8971('0x9')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 6e4cc65..46f6d57 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 _0xb364=['lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','define','Dashboard'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0xb364,0xdc));var _0x4b36=function(_0x551f61,_0x492e3d){_0x551f61=_0x551f61-0x0;var _0x3a3ceb=_0xb364[_0x551f61];return _0x3a3ceb;};'use strict';var _=require(_0x4b36('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4b36('0x1'));var BPromise=require(_0x4b36('0x2'));var rp=require(_0x4b36('0x3'));var fs=require('fs');var path=require(_0x4b36('0x4'));var rimraf=require(_0x4b36('0x5'));var config=require(_0x4b36('0x6'));var attributes=require(_0x4b36('0x7'));module['exports']=function(_0x2d2e93,_0x2e12f2){return _0x2d2e93[_0x4b36('0x8')](_0x4b36('0x9'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc713=['define','Dashboard','dashboards','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xc713,0x1df));var _0x3c71=function(_0x3f2146,_0x4e86a4){_0x3f2146=_0x3f2146-0x0;var _0xc33e7d=_0xc713[_0x3f2146];return _0xc33e7d;};'use strict';var _=require(_0x3c71('0x0'));var util=require(_0x3c71('0x1'));var logger=require('../../config/logger')(_0x3c71('0x2'));var moment=require(_0x3c71('0x3'));var BPromise=require(_0x3c71('0x4'));var rp=require(_0x3c71('0x5'));var fs=require('fs');var path=require(_0x3c71('0x6'));var rimraf=require(_0x3c71('0x7'));var config=require(_0x3c71('0x8'));var attributes=require(_0x3c71('0x9'));module[_0x3c71('0xa')]=function(_0x114b2a,_0x32de6f){return _0x114b2a[_0x3c71('0xb')](_0x3c71('0xc'),attributes,{'tableName':_0x3c71('0xd'),'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 9e3d8da..9e401d2 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 _0x02f3=['Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','./dashboard.socket','register','request','then','Dashboard,\x20%s,\x20%s','request\x20sent'];(function(_0x28e3d9,_0x26dd13){var _0x4da3c2=function(_0x55b82f){while(--_0x55b82f){_0x28e3d9['push'](_0x28e3d9['shift']());}};_0x4da3c2(++_0x26dd13);}(_0x02f3,0x1a7));var _0x302f=function(_0x3371af,_0x51c2f2){_0x3371af=_0x3371af-0x0;var _0x2f4af5=_0x02f3[_0x3371af];return _0x2f4af5;};'use strict';var _=require(_0x302f('0x0'));var util=require('util');var moment=require(_0x302f('0x1'));var BPromise=require(_0x302f('0x2'));var rs=require(_0x302f('0x3'));var fs=require('fs');var Redis=require(_0x302f('0x4'));var db=require(_0x302f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x302f('0x6'))(_0x302f('0x7'));var config=require(_0x302f('0x8'));var jayson=require(_0x302f('0x9'));var client=jayson[_0x302f('0xa')][_0x302f('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x302f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x302f('0xd'))[_0x302f('0xe')](socket);function respondWithRpcPromise(_0xb6e451,_0x1fa190,_0x41d1eb){return new BPromise(function(_0x17db45,_0x20fc5e){return client[_0x302f('0xf')](_0xb6e451,_0x41d1eb)[_0x302f('0x10')](function(_0x801bfd){logger['info'](_0x302f('0x11'),_0x1fa190,_0x302f('0x12'));logger['debug'](_0x302f('0x13'),_0x1fa190,_0x302f('0x12'),JSON[_0x302f('0x14')](_0x801bfd));if(_0x801bfd[_0x302f('0x15')]){if(_0x801bfd[_0x302f('0x15')][_0x302f('0x16')]===0x1f4){logger[_0x302f('0x15')](_0x302f('0x11'),_0x1fa190,_0x801bfd[_0x302f('0x15')]['message']);return _0x20fc5e(_0x801bfd['error']['message']);}logger[_0x302f('0x15')]('Dashboard,\x20%s,\x20%s',_0x1fa190,_0x801bfd[_0x302f('0x15')]['message']);return _0x17db45(_0x801bfd[_0x302f('0x15')][_0x302f('0x17')]);}else{logger[_0x302f('0x18')](_0x302f('0x11'),_0x1fa190,_0x302f('0x12'));_0x17db45(_0x801bfd['result']['message']);}})[_0x302f('0x19')](function(_0x577841){logger[_0x302f('0x15')](_0x302f('0x11'),_0x1fa190,_0x577841);_0x20fc5e(_0x577841);});});} \ No newline at end of file +var _0x861d=['info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboard.socket','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x861d,0x19a));var _0xd861=function(_0x305766,_0x4ed775){_0x305766=_0x305766-0x0;var _0x1d6353=_0x861d[_0x305766];return _0x1d6353;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd861('0x0'));var BPromise=require(_0xd861('0x1'));var rs=require(_0xd861('0x2'));var fs=require('fs');var Redis=require(_0xd861('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd861('0x4'))(_0xd861('0x5'));var config=require(_0xd861('0x6'));var jayson=require(_0xd861('0x7'));var client=jayson[_0xd861('0x8')][_0xd861('0x9')]({'port':0x232a});config[_0xd861('0xa')]=_['defaults'](config[_0xd861('0xa')],{'host':_0xd861('0xb'),'port':0x18eb});var socket=require(_0xd861('0xc'))(new Redis(config[_0xd861('0xa')]));require(_0xd861('0xd'))['register'](socket);function respondWithRpcPromise(_0x633364,_0xd5c921,_0x929562){return new BPromise(function(_0x487dbc,_0x4953e8){return client[_0xd861('0xe')](_0x633364,_0x929562)['then'](function(_0x9fc9b){logger[_0xd861('0xf')](_0xd861('0x10'),_0xd5c921,_0xd861('0x11'));logger[_0xd861('0x12')](_0xd861('0x13'),_0xd5c921,_0xd861('0x11'),JSON[_0xd861('0x14')](_0x9fc9b));if(_0x9fc9b[_0xd861('0x15')]){if(_0x9fc9b[_0xd861('0x15')][_0xd861('0x16')]===0x1f4){logger['error'](_0xd861('0x10'),_0xd5c921,_0x9fc9b[_0xd861('0x15')][_0xd861('0x17')]);return _0x4953e8(_0x9fc9b['error'][_0xd861('0x17')]);}logger['error']('Dashboard,\x20%s,\x20%s',_0xd5c921,_0x9fc9b[_0xd861('0x15')][_0xd861('0x17')]);return _0x487dbc(_0x9fc9b[_0xd861('0x15')][_0xd861('0x17')]);}else{logger['info'](_0xd861('0x10'),_0xd5c921,_0xd861('0x11'));_0x487dbc(_0x9fc9b[_0xd861('0x18')][_0xd861('0x17')]);}})['catch'](function(_0x1365a3){logger[_0xd861('0x15')](_0xd861('0x10'),_0xd5c921,_0x1365a3);_0x4953e8(_0x1365a3);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 0a0eb8b..522a9a7 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 _0xd70e=['./dashboard.events','remove','update','emit','removeListener','register','dashboard:'];(function(_0x296a0e,_0x219c50){var _0x47f68a=function(_0x38f943){while(--_0x38f943){_0x296a0e['push'](_0x296a0e['shift']());}};_0x47f68a(++_0x219c50);}(_0xd70e,0x69));var _0xed70=function(_0x2592c8,_0x470e74){_0x2592c8=_0x2592c8-0x0;var _0x376adb=_0xd70e[_0x2592c8];return _0x376adb;};'use strict';var DashboardEvents=require(_0xed70('0x0'));var events=['save',_0xed70('0x1'),_0xed70('0x2')];function createListener(_0x34e454,_0x13b36e){return function(_0x4ec3c9){_0x13b36e[_0xed70('0x3')](_0x34e454,_0x4ec3c9);};}function removeListener(_0x1fabb1,_0x38d898){return function(){DashboardEvents[_0xed70('0x4')](_0x1fabb1,_0x38d898);};}exports[_0xed70('0x5')]=function(_0x32ddd3){for(var _0x3f7ff2=0x0,_0x2f91c7=events['length'];_0x3f7ff2<_0x2f91c7;_0x3f7ff2++){var _0x30ac5b=events[_0x3f7ff2];var _0xc64f6a=createListener(_0xed70('0x6')+_0x30ac5b,_0x32ddd3);DashboardEvents['on'](_0x30ac5b,_0xc64f6a);}}; \ No newline at end of file +var _0x5169=['./dashboard.events','save','remove','update','emit','removeListener','dashboard:'];(function(_0x2dce9f,_0x1d1880){var _0x1cd454=function(_0x2a909c){while(--_0x2a909c){_0x2dce9f['push'](_0x2dce9f['shift']());}};_0x1cd454(++_0x1d1880);}(_0x5169,0x173));var _0x9516=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5169[_0x19950b];return _0x3c6b41;};'use strict';var DashboardEvents=require(_0x9516('0x0'));var events=[_0x9516('0x1'),_0x9516('0x2'),_0x9516('0x3')];function createListener(_0x26dc7d,_0x203380){return function(_0x41db86){_0x203380[_0x9516('0x4')](_0x26dc7d,_0x41db86);};}function removeListener(_0x270e42,_0x202e70){return function(){DashboardEvents[_0x9516('0x5')](_0x270e42,_0x202e70);};}exports['register']=function(_0x2c5a08){for(var _0x342281=0x0,_0x45f3ea=events['length'];_0x342281<_0x45f3ea;_0x342281++){var _0x1c05be=events[_0x342281];var _0x4bcbdf=createListener(_0x9516('0x6')+_0x1c05be,_0x2c5a08);DashboardEvents['on'](_0x1c05be,_0x4bcbdf);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 8752c5e..30f9a77 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 _0xd8b0=['../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','index','get','/:id','show','isAuthenticated','getItems','post','create','/:id/clone','addItem','put','update','delete','destroy','exports','multer','util','Router'];(function(_0x35a274,_0x98b399){var _0x40d905=function(_0x5c8455){while(--_0x5c8455){_0x35a274['push'](_0x35a274['shift']());}};_0x40d905(++_0x98b399);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id/items',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xd')](_0x0d8b('0xf'),auth[_0x0d8b('0xb')](),controller['clone']);router[_0x0d8b('0xd')]('/:id/items',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x10')]);router[_0x0d8b('0x11')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x13')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x14')]);module[_0x0d8b('0x15')]=router; \ No newline at end of file +var _0xd8b0=['../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','index','get','/:id','show','isAuthenticated','getItems','post','create','/:id/clone','addItem','put','update','delete','destroy','exports','multer','util','Router'];(function(_0x30a956,_0x11222e){var _0x2ac17d=function(_0x3be1d2){while(--_0x3be1d2){_0x30a956['push'](_0x30a956['shift']());}};_0x2ac17d(++_0x11222e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id/items',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xd')](_0x0d8b('0xf'),auth[_0x0d8b('0xb')](),controller['clone']);router[_0x0d8b('0xd')]('/:id/items',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x10')]);router[_0x0d8b('0x11')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x13')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x14')]);module[_0x0d8b('0x15')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 0541f9b..4464240 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 _0xaaf9=['squel','lodash','STRING','TEXT','long','parse','getDataValue','setDataValue','attrs','INTEGER','#ffffff','#2196f3','sequelize'];(function(_0x57b829,_0xbe5545){var _0x35659=function(_0xf66a62){while(--_0xf66a62){_0x57b829['push'](_0x57b829['shift']());}};_0x35659(++_0xbe5545);}(_0xaaf9,0xe9));var _0x9aaf=function(_0x1ce97b,_0x463732){_0x1ce97b=_0x1ce97b-0x0;var _0x3abc65=_0xaaf9[_0x1ce97b];return _0x3abc65;};'use strict';var Sequelize=require(_0x9aaf('0x0'));var squel=require(_0x9aaf('0x1'));var _=require(_0x9aaf('0x2'));module['exports']={'title':{'type':Sequelize[_0x9aaf('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x9aaf('0x4')](_0x9aaf('0x5')),'get':function(){try{return JSON[_0x9aaf('0x6')](this[_0x9aaf('0x7')]('attrs'));}catch(_0xd63913){return[];}},'set':function(_0x2826e3){try{this[_0x9aaf('0x8')]('attrs',JSON['stringify'](_0x2826e3));}catch(_0x33c3bc){this[_0x9aaf('0x8')](_0x9aaf('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x9aaf('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x9aaf('0xa')]},'col':{'type':Sequelize[_0x9aaf('0xa')]},'background':{'type':Sequelize[_0x9aaf('0x3')],'allowNull':![],'defaultValue':_0x9aaf('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x9aaf('0x3')],'allowNull':![],'defaultValue':_0x9aaf('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x9aaf('0x3')]}}; \ No newline at end of file +var _0x85f3=['sequelize','squel','lodash','exports','STRING','TEXT','parse','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3'];(function(_0xb7ced6,_0x1592fd){var _0x1d53c4=function(_0x3153e3){while(--_0x3153e3){_0xb7ced6['push'](_0xb7ced6['shift']());}};_0x1d53c4(++_0x1592fd);}(_0x85f3,0x82));var _0x385f=function(_0x44c974,_0x1bcfde){_0x44c974=_0x44c974-0x0;var _0x5214c6=_0x85f3[_0x44c974];return _0x5214c6;};'use strict';var Sequelize=require(_0x385f('0x0'));var squel=require(_0x385f('0x1'));var _=require(_0x385f('0x2'));module[_0x385f('0x3')]={'title':{'type':Sequelize[_0x385f('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x385f('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x385f('0x5')]('long'),'get':function(){try{return JSON[_0x385f('0x6')](this['getDataValue'](_0x385f('0x7')));}catch(_0x1ec14b){return[];}},'set':function(_0x589848){try{this[_0x385f('0x8')](_0x385f('0x7'),JSON[_0x385f('0x9')](_0x589848));}catch(_0x4a3b1c){this['setDataValue'](_0x385f('0x7'),JSON[_0x385f('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0x385f('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x385f('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x385f('0xa')]},'col':{'type':Sequelize[_0x385f('0xa')]},'background':{'type':Sequelize[_0x385f('0x4')],'allowNull':![],'defaultValue':_0x385f('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x385f('0x4')],'allowNull':![],'defaultValue':_0x385f('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x385f('0x4')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 305f612..aac66d9 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 _0xa165=['attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./dashboardItem.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','find','catch','type','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0xa165,0x67));var _0x5a16=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xa165[_0x2c7618];return _0x5ce3f0;};'use strict';var pdf=require(_0x5a16('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5a16('0x1'));var zipdir=require(_0x5a16('0x2'));var jsonpatch=require(_0x5a16('0x3'));var rp=require('request-promise');var moment=require(_0x5a16('0x4'));var BPromise=require(_0x5a16('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5a16('0x6'));var sox=require('sox');var csv=require(_0x5a16('0x7'));var ejs=require(_0x5a16('0x8'));var fs=require('fs');var _=require(_0x5a16('0x9'));var squel=require(_0x5a16('0xa'));var crypto=require(_0x5a16('0xb'));var jsforce=require(_0x5a16('0xc'));var deskjs=require(_0x5a16('0xd'));var toCsv=require(_0x5a16('0x7'));var querystring=require(_0x5a16('0xe'));var Papa=require('papaparse');var Redis=require(_0x5a16('0xf'));var authService=require(_0x5a16('0x10'));var qs=require(_0x5a16('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5a16('0x12'));var logger=require('../../config/logger')(_0x5a16('0x13'));var utils=require('../../config/utils');var config=require(_0x5a16('0x14'));var db=require(_0x5a16('0x15'))['db'];config['redis']=_[_0x5a16('0x16')](config['redis'],{'host':_0x5a16('0x17'),'port':0x18eb});var socket=require(_0x5a16('0x18'))(new Redis(config[_0x5a16('0x19')]));require(_0x5a16('0x1a'))[_0x5a16('0x1b')](socket);function respondWithStatusCode(_0x4f721a,_0x32a834){_0x32a834=_0x32a834||0xcc;return function(_0x4e4a3b){if(_0x4e4a3b){return _0x4f721a[_0x5a16('0x1c')](_0x32a834);}return _0x4f721a[_0x5a16('0x1d')](_0x32a834)[_0x5a16('0x1e')]();};}function respondWithResult(_0x232792,_0x6d3b8c){_0x6d3b8c=_0x6d3b8c||0xc8;return function(_0x4e55a4){if(_0x4e55a4){return _0x232792[_0x5a16('0x1d')](_0x6d3b8c)[_0x5a16('0x1f')](_0x4e55a4);}};}function respondWithFilteredResult(_0x59f793,_0x1708e7){return function(_0x2d1805){if(_0x2d1805){var _0x191916=_0x2d1805['count'],_0x1c56d3=_0x1708e7[_0x5a16('0x20')],_0x1cfd36=_0x1708e7[_0x5a16('0x20')]+_0x1708e7[_0x5a16('0x21')],_0x52074b;if(_0x1cfd36>=_0x191916){_0x1cfd36=_0x191916;_0x52074b=0xc8;}else{_0x52074b=0xce;}_0x59f793[_0x5a16('0x1d')](_0x52074b);return _0x59f793[_0x5a16('0x22')](_0x5a16('0x23'),_0x1c56d3+'-'+_0x1cfd36+'/'+_0x191916)['json'](_0x2d1805);}return null;};}function patchUpdates(_0xe82a8a){return function(_0x4b3f3c){try{jsonpatch[_0x5a16('0x24')](_0x4b3f3c,_0xe82a8a,!![]);}catch(_0x804a5b){return BPromise[_0x5a16('0x25')](_0x804a5b);}return _0x4b3f3c['save']();};}function saveUpdates(_0x59345d,_0x5148cf){return function(_0x3dab99){if(_0x3dab99){return _0x3dab99[_0x5a16('0x26')](_0x59345d)[_0x5a16('0x27')](function(_0x3f42e7){return _0x3f42e7;});}return null;};}function removeEntity(_0x14e9c4,_0x2e97d9){return function(_0x2da2c1){if(_0x2da2c1){return _0x2da2c1[_0x5a16('0x28')]()[_0x5a16('0x27')](function(){_0x14e9c4[_0x5a16('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b99ce,_0x4e7157){return function(_0x4bee7b){if(!_0x4bee7b){_0x1b99ce[_0x5a16('0x1c')](0x194);}return _0x4bee7b;};}function handleError(_0x1111e8,_0x504309){_0x504309=_0x504309||0x1f4;return function(_0x5eda3f){logger[_0x5a16('0x29')](_0x5eda3f[_0x5a16('0x2a')]);if(_0x5eda3f['name']){delete _0x5eda3f[_0x5a16('0x2b')];}_0x1111e8['status'](_0x504309)[_0x5a16('0x2c')](_0x5eda3f);};}exports[_0x5a16('0x2d')]=function(_0x4207c1,_0x4ccc2a){var _0x49125d={'raw':![],'where':{'id':_0x4207c1[_0x5a16('0x2e')]['id']}},_0x2478b1={};_0x2478b1[_0x5a16('0x2f')]=_[_0x5a16('0x30')](db[_0x5a16('0x31')][_0x5a16('0x32')]);_0x2478b1[_0x5a16('0x33')]=_[_0x5a16('0x30')](_0x4207c1[_0x5a16('0x33')]);_0x2478b1[_0x5a16('0x34')]=_[_0x5a16('0x35')](_0x2478b1['model'],_0x2478b1[_0x5a16('0x33')]);_0x49125d[_0x5a16('0x36')]=_[_0x5a16('0x35')](_0x2478b1['model'],qs[_0x5a16('0x37')](_0x4207c1[_0x5a16('0x33')]['fields']));_0x49125d[_0x5a16('0x36')]=_0x49125d[_0x5a16('0x36')][_0x5a16('0x38')]?_0x49125d[_0x5a16('0x36')]:_0x2478b1[_0x5a16('0x2f')];if(_0x4207c1[_0x5a16('0x33')][_0x5a16('0x39')]){_0x49125d[_0x5a16('0x3a')]=[{'all':!![]}];}_0x49125d=_[_0x5a16('0x3b')]({},_0x49125d,_0x4207c1['options']);return db[_0x5a16('0x31')][_0x5a16('0x3c')](_0x49125d)[_0x5a16('0x27')](handleEntityNotFound(_0x4ccc2a,null))[_0x5a16('0x27')](respondWithResult(_0x4ccc2a,null))[_0x5a16('0x3d')](handleError(_0x4ccc2a,null));};exports[_0x5a16('0x28')]=function(_0x6fe4bf,_0x45e494){return db[_0x5a16('0x31')][_0x5a16('0x3c')]({'where':{'id':_0x6fe4bf[_0x5a16('0x2e')]['id']}})['then'](handleEntityNotFound(_0x45e494,null))['then'](removeEntity(_0x45e494,null))['catch'](handleError(_0x45e494,null));};function widgetAttributes(_0x3dfdcf){try{switch(_0x3dfdcf[_0x5a16('0x3e')]){case _0x5a16('0x3f'):return[{'name':_0x5a16('0x40'),'value':_0x3dfdcf[_0x5a16('0x40')]||(_0x3dfdcf[_0x5a16('0x41')]&&_0x3dfdcf[_0x5a16('0x41')][0x0]?_0x3dfdcf[_0x5a16('0x41')][0x0][_0x5a16('0x42')]:undefined)||'https://'}];case _0x5a16('0x43'):return[{'name':_0x5a16('0x44'),'value':_0x3dfdcf[_0x5a16('0x44')]||(_0x3dfdcf[_0x5a16('0x41')]&&_0x3dfdcf[_0x5a16('0x41')][0x0]?_0x3dfdcf['attrs'][0x0]['value']:undefined)||''}];case _0x5a16('0x45'):return[{'name':'attrHourFormat','value':_0x3dfdcf[_0x5a16('0x46')]||(_0x3dfdcf[_0x5a16('0x41')]&&_0x3dfdcf[_0x5a16('0x41')][0x0]?_0x3dfdcf[_0x5a16('0x41')][0x0][_0x5a16('0x42')]:undefined)||'HH:mm:ss'},{'name':_0x5a16('0x47'),'value':_0x3dfdcf[_0x5a16('0x47')]||(_0x3dfdcf['attrs']&&_0x3dfdcf[_0x5a16('0x41')][0x1]?_0x3dfdcf[_0x5a16('0x41')][0x1][_0x5a16('0x42')]:undefined)||_0x5a16('0x48')},{'name':_0x5a16('0x49'),'value':_0x3dfdcf[_0x5a16('0x49')]||(_0x3dfdcf[_0x5a16('0x41')]&&_0x3dfdcf[_0x5a16('0x41')][0x2]?_0x3dfdcf[_0x5a16('0x41')][0x2][_0x5a16('0x42')]:undefined)||0xc}];case _0x5a16('0x4a'):return[{'name':_0x5a16('0x4b'),'value':_0x3dfdcf[_0x5a16('0x4b')]||(_0x3dfdcf[_0x5a16('0x41')]&&_0x3dfdcf['attrs'][0x0]?_0x3dfdcf[_0x5a16('0x41')][0x0][_0x5a16('0x42')]:undefined)||_0x5a16('0x4c')},{'name':_0x5a16('0x4d'),'value':_0x3dfdcf[_0x5a16('0x4d')]||(_0x3dfdcf[_0x5a16('0x41')]&&_0x3dfdcf[_0x5a16('0x41')][0x1]?_0x3dfdcf['attrs'][0x1][_0x5a16('0x42')]:undefined)||[]},{'name':'attrFontSize','value':_0x3dfdcf[_0x5a16('0x49')]||(_0x3dfdcf['attrs']&&_0x3dfdcf[_0x5a16('0x41')][0x2]?_0x3dfdcf[_0x5a16('0x41')][0x2][_0x5a16('0x42')]:undefined)||0x14}];case _0x5a16('0x4e'):case _0x5a16('0x4f'):return[{'name':'attrSerie1','value':_0x3dfdcf[_0x5a16('0x50')]||(_0x3dfdcf['attrs']&&_0x3dfdcf[_0x5a16('0x41')][0x0]?_0x3dfdcf[_0x5a16('0x41')][0x0][_0x5a16('0x42')]:undefined)||_0x5a16('0x4c')},{'name':_0x5a16('0x51'),'value':_0x3dfdcf[_0x5a16('0x51')]||(_0x3dfdcf['attrs']&&_0x3dfdcf[_0x5a16('0x41')][0x1]?_0x3dfdcf[_0x5a16('0x41')][0x1]['value']:undefined)||null},{'name':_0x5a16('0x52'),'value':_0x3dfdcf[_0x5a16('0x52')]||(_0x3dfdcf['attrs']&&_0x3dfdcf[_0x5a16('0x41')][0x2]?_0x3dfdcf[_0x5a16('0x41')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x3dfdcf[_0x5a16('0x4d')]||(_0x3dfdcf['attrs']&&_0x3dfdcf[_0x5a16('0x41')][0x3]?_0x3dfdcf['attrs'][0x3][_0x5a16('0x42')]:undefined)||[]}];case _0x5a16('0x53'):return[{'name':_0x5a16('0x54'),'type':_0x3dfdcf[_0x5a16('0x55')]||(_0x3dfdcf[_0x5a16('0x41')]&&_0x3dfdcf['attrs'][0x0]?_0x3dfdcf[_0x5a16('0x41')][0x0][_0x5a16('0x3e')]:undefined)||null,'value':_0x3dfdcf[_0x5a16('0x54')]||(_0x3dfdcf[_0x5a16('0x41')]&&_0x3dfdcf[_0x5a16('0x41')][0x0]?_0x3dfdcf['attrs'][0x0][_0x5a16('0x42')]:undefined)||null},{'name':_0x5a16('0x56'),'value':_0x3dfdcf[_0x5a16('0x56')]||(_0x3dfdcf[_0x5a16('0x41')]&&_0x3dfdcf[_0x5a16('0x41')][0x1]?_0x3dfdcf['attrs'][0x1][_0x5a16('0x42')]:undefined)||0x0}];default:return[];}}catch(_0x2db1a7){logger[_0x5a16('0x29')](_0x5a16('0x57'),JSON['stringify'](_0x2db1a7));return[];}}exports[_0x5a16('0x58')]=function(_0x53bab8,_0x6a0ec1){if(_0x53bab8[_0x5a16('0x59')]){_0x53bab8[_0x5a16('0x59')][_0x5a16('0x41')]=widgetAttributes(_0x53bab8[_0x5a16('0x59')]);}return db[_0x5a16('0x31')]['create'](_0x53bab8[_0x5a16('0x59')],{})[_0x5a16('0x27')](respondWithResult(_0x6a0ec1,0xc9))[_0x5a16('0x3d')](handleError(_0x6a0ec1,null));};exports[_0x5a16('0x26')]=function(_0x37c0a0,_0x14667a){if(_0x37c0a0[_0x5a16('0x59')]['id']){delete _0x37c0a0[_0x5a16('0x59')]['id'];}_0x37c0a0['body'][_0x5a16('0x41')]=widgetAttributes(_0x37c0a0[_0x5a16('0x59')]);return db['DashboardItem'][_0x5a16('0x3c')]({'where':{'id':_0x37c0a0[_0x5a16('0x2e')]['id']}})[_0x5a16('0x27')](handleEntityNotFound(_0x14667a,null))['then'](saveUpdates(_0x37c0a0[_0x5a16('0x59')],null))[_0x5a16('0x27')](respondWithResult(_0x14667a,null))[_0x5a16('0x3d')](handleError(_0x14667a,null));}; \ No newline at end of file +var _0x3444=['DashboardItem','filters','intersection','query','fields','attributes','length','includeAll','include','merge','find','destroy','params','type','iframe','attrUrl','attrs','value','https://','custom','clock','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','body','create','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','error','name','send','show','model','keys'];(function(_0x4d5c11,_0x482ae0){var _0x1ce899=function(_0x3d0c1f){while(--_0x3d0c1f){_0x4d5c11['push'](_0x4d5c11['shift']());}};_0x1ce899(++_0x482ae0);}(_0x3444,0xcd));var _0x4344=function(_0x3174cb,_0x38bb92){_0x3174cb=_0x3174cb-0x0;var _0x1a7bef=_0x3444[_0x3174cb];return _0x1a7bef;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x4344('0x0'));var zipdir=require(_0x4344('0x1'));var jsonpatch=require(_0x4344('0x2'));var rp=require('request-promise');var moment=require(_0x4344('0x3'));var BPromise=require(_0x4344('0x4'));var Mustache=require('mustache');var util=require(_0x4344('0x5'));var path=require(_0x4344('0x6'));var sox=require(_0x4344('0x7'));var csv=require(_0x4344('0x8'));var ejs=require(_0x4344('0x9'));var fs=require('fs');var _=require(_0x4344('0xa'));var squel=require(_0x4344('0xb'));var crypto=require('crypto');var jsforce=require(_0x4344('0xc'));var deskjs=require(_0x4344('0xd'));var toCsv=require(_0x4344('0x8'));var querystring=require(_0x4344('0xe'));var Papa=require(_0x4344('0xf'));var Redis=require(_0x4344('0x10'));var authService=require(_0x4344('0x11'));var qs=require(_0x4344('0x12'));var as=require(_0x4344('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4344('0x14'))(_0x4344('0x15'));var utils=require('../../config/utils');var config=require(_0x4344('0x16'));var db=require('../../mysqldb')['db'];config[_0x4344('0x17')]=_[_0x4344('0x18')](config[_0x4344('0x17')],{'host':_0x4344('0x19'),'port':0x18eb});var socket=require(_0x4344('0x1a'))(new Redis(config[_0x4344('0x17')]));require(_0x4344('0x1b'))[_0x4344('0x1c')](socket);function respondWithStatusCode(_0x5b7994,_0x361ddf){_0x361ddf=_0x361ddf||0xcc;return function(_0x359f7b){if(_0x359f7b){return _0x5b7994[_0x4344('0x1d')](_0x361ddf);}return _0x5b7994[_0x4344('0x1e')](_0x361ddf)[_0x4344('0x1f')]();};}function respondWithResult(_0x152755,_0x38d04d){_0x38d04d=_0x38d04d||0xc8;return function(_0x32862f){if(_0x32862f){return _0x152755[_0x4344('0x1e')](_0x38d04d)[_0x4344('0x20')](_0x32862f);}};}function respondWithFilteredResult(_0x30eec5,_0x1daa89){return function(_0x5ba370){if(_0x5ba370){var _0x430bf9=_0x5ba370[_0x4344('0x21')],_0x351da=_0x1daa89[_0x4344('0x22')],_0x44c785=_0x1daa89[_0x4344('0x22')]+_0x1daa89[_0x4344('0x23')],_0x5f2e68;if(_0x44c785>=_0x430bf9){_0x44c785=_0x430bf9;_0x5f2e68=0xc8;}else{_0x5f2e68=0xce;}_0x30eec5[_0x4344('0x1e')](_0x5f2e68);return _0x30eec5[_0x4344('0x24')]('Content-Range',_0x351da+'-'+_0x44c785+'/'+_0x430bf9)[_0x4344('0x20')](_0x5ba370);}return null;};}function patchUpdates(_0x2b5a98){return function(_0x4cfa58){try{jsonpatch[_0x4344('0x25')](_0x4cfa58,_0x2b5a98,!![]);}catch(_0x1b04eb){return BPromise['reject'](_0x1b04eb);}return _0x4cfa58[_0x4344('0x26')]();};}function saveUpdates(_0x1bf666,_0x1b1708){return function(_0x231198){if(_0x231198){return _0x231198[_0x4344('0x27')](_0x1bf666)[_0x4344('0x28')](function(_0x1f7c03){return _0x1f7c03;});}return null;};}function removeEntity(_0x26b985,_0x4cee06){return function(_0x3f0c6a){if(_0x3f0c6a){return _0x3f0c6a['destroy']()[_0x4344('0x28')](function(){_0x26b985[_0x4344('0x1e')](0xcc)[_0x4344('0x1f')]();});}};}function handleEntityNotFound(_0x24dc45,_0x40e73e){return function(_0x5c1779){if(!_0x5c1779){_0x24dc45[_0x4344('0x1d')](0x194);}return _0x5c1779;};}function handleError(_0x140f1c,_0x15fd22){_0x15fd22=_0x15fd22||0x1f4;return function(_0x487a16){logger[_0x4344('0x29')](_0x487a16['stack']);if(_0x487a16[_0x4344('0x2a')]){delete _0x487a16[_0x4344('0x2a')];}_0x140f1c[_0x4344('0x1e')](_0x15fd22)[_0x4344('0x2b')](_0x487a16);};}exports[_0x4344('0x2c')]=function(_0x4de295,_0xca2b4a){var _0x3c62be={'raw':![],'where':{'id':_0x4de295['params']['id']}},_0x421c94={};_0x421c94[_0x4344('0x2d')]=_[_0x4344('0x2e')](db[_0x4344('0x2f')]['rawAttributes']);_0x421c94['query']=_['keys'](_0x4de295['query']);_0x421c94[_0x4344('0x30')]=_[_0x4344('0x31')](_0x421c94['model'],_0x421c94[_0x4344('0x32')]);_0x3c62be['attributes']=_['intersection'](_0x421c94[_0x4344('0x2d')],qs[_0x4344('0x33')](_0x4de295[_0x4344('0x32')][_0x4344('0x33')]));_0x3c62be[_0x4344('0x34')]=_0x3c62be[_0x4344('0x34')][_0x4344('0x35')]?_0x3c62be['attributes']:_0x421c94[_0x4344('0x2d')];if(_0x4de295[_0x4344('0x32')][_0x4344('0x36')]){_0x3c62be[_0x4344('0x37')]=[{'all':!![]}];}_0x3c62be=_[_0x4344('0x38')]({},_0x3c62be,_0x4de295['options']);return db['DashboardItem'][_0x4344('0x39')](_0x3c62be)[_0x4344('0x28')](handleEntityNotFound(_0xca2b4a,null))[_0x4344('0x28')](respondWithResult(_0xca2b4a,null))['catch'](handleError(_0xca2b4a,null));};exports[_0x4344('0x3a')]=function(_0x263a20,_0x4afe8a){return db[_0x4344('0x2f')][_0x4344('0x39')]({'where':{'id':_0x263a20[_0x4344('0x3b')]['id']}})[_0x4344('0x28')](handleEntityNotFound(_0x4afe8a,null))['then'](removeEntity(_0x4afe8a,null))['catch'](handleError(_0x4afe8a,null));};function widgetAttributes(_0x21ff10){try{switch(_0x21ff10[_0x4344('0x3c')]){case _0x4344('0x3d'):return[{'name':_0x4344('0x3e'),'value':_0x21ff10['attrUrl']||(_0x21ff10[_0x4344('0x3f')]&&_0x21ff10[_0x4344('0x3f')][0x0]?_0x21ff10[_0x4344('0x3f')][0x0][_0x4344('0x40')]:undefined)||_0x4344('0x41')}];case _0x4344('0x42'):return[{'name':'attrPath','value':_0x21ff10['attrPath']||(_0x21ff10[_0x4344('0x3f')]&&_0x21ff10['attrs'][0x0]?_0x21ff10[_0x4344('0x3f')][0x0]['value']:undefined)||''}];case _0x4344('0x43'):return[{'name':'attrHourFormat','value':_0x21ff10['attrHourFormat']||(_0x21ff10[_0x4344('0x3f')]&&_0x21ff10[_0x4344('0x3f')][0x0]?_0x21ff10[_0x4344('0x3f')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0x4344('0x44'),'value':_0x21ff10[_0x4344('0x44')]||(_0x21ff10['attrs']&&_0x21ff10[_0x4344('0x3f')][0x1]?_0x21ff10[_0x4344('0x3f')][0x1][_0x4344('0x40')]:undefined)||'0.00'},{'name':_0x4344('0x45'),'value':_0x21ff10['attrFontSize']||(_0x21ff10[_0x4344('0x3f')]&&_0x21ff10[_0x4344('0x3f')][0x2]?_0x21ff10[_0x4344('0x3f')][0x2][_0x4344('0x40')]:undefined)||0xc}];case _0x4344('0x46'):return[{'name':_0x4344('0x47'),'value':_0x21ff10[_0x4344('0x47')]||(_0x21ff10['attrs']&&_0x21ff10[_0x4344('0x3f')][0x0]?_0x21ff10['attrs'][0x0][_0x4344('0x40')]:undefined)||_0x4344('0x48')},{'name':_0x4344('0x49'),'value':_0x21ff10['attrVoiceQueues']||(_0x21ff10[_0x4344('0x3f')]&&_0x21ff10[_0x4344('0x3f')][0x1]?_0x21ff10[_0x4344('0x3f')][0x1][_0x4344('0x40')]:undefined)||[]},{'name':'attrFontSize','value':_0x21ff10['attrFontSize']||(_0x21ff10['attrs']&&_0x21ff10[_0x4344('0x3f')][0x2]?_0x21ff10[_0x4344('0x3f')][0x2][_0x4344('0x40')]:undefined)||0x14}];case _0x4344('0x4a'):case'pie-chart':return[{'name':_0x4344('0x4b'),'value':_0x21ff10[_0x4344('0x4b')]||(_0x21ff10[_0x4344('0x3f')]&&_0x21ff10[_0x4344('0x3f')][0x0]?_0x21ff10['attrs'][0x0][_0x4344('0x40')]:undefined)||_0x4344('0x48')},{'name':'attrSerie2','value':_0x21ff10[_0x4344('0x4c')]||(_0x21ff10[_0x4344('0x3f')]&&_0x21ff10[_0x4344('0x3f')][0x1]?_0x21ff10['attrs'][0x1][_0x4344('0x40')]:undefined)||null},{'name':'attrSerie3','value':_0x21ff10[_0x4344('0x4d')]||(_0x21ff10['attrs']&&_0x21ff10['attrs'][0x2]?_0x21ff10['attrs'][0x2][_0x4344('0x40')]:undefined)||null},{'name':_0x4344('0x49'),'value':_0x21ff10['attrVoiceQueues']||(_0x21ff10[_0x4344('0x3f')]&&_0x21ff10[_0x4344('0x3f')][0x3]?_0x21ff10[_0x4344('0x3f')][0x3][_0x4344('0x40')]:undefined)||[]}];case _0x4344('0x4e'):return[{'name':_0x4344('0x4f'),'type':_0x21ff10[_0x4344('0x50')]||(_0x21ff10[_0x4344('0x3f')]&&_0x21ff10[_0x4344('0x3f')][0x0]?_0x21ff10['attrs'][0x0][_0x4344('0x3c')]:undefined)||null,'value':_0x21ff10[_0x4344('0x4f')]||(_0x21ff10[_0x4344('0x3f')]&&_0x21ff10[_0x4344('0x3f')][0x0]?_0x21ff10[_0x4344('0x3f')][0x0][_0x4344('0x40')]:undefined)||null},{'name':_0x4344('0x51'),'value':_0x21ff10[_0x4344('0x51')]||(_0x21ff10[_0x4344('0x3f')]&&_0x21ff10[_0x4344('0x3f')][0x1]?_0x21ff10['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x234839){logger[_0x4344('0x29')]('widgetAttributes:\x20%s',JSON['stringify'](_0x234839));return[];}}exports['create']=function(_0x4e215e,_0x3d1d4a){if(_0x4e215e['body']){_0x4e215e['body'][_0x4344('0x3f')]=widgetAttributes(_0x4e215e[_0x4344('0x52')]);}return db[_0x4344('0x2f')][_0x4344('0x53')](_0x4e215e[_0x4344('0x52')],{})[_0x4344('0x28')](respondWithResult(_0x3d1d4a,0xc9))['catch'](handleError(_0x3d1d4a,null));};exports[_0x4344('0x27')]=function(_0x2baa64,_0x489559){if(_0x2baa64['body']['id']){delete _0x2baa64[_0x4344('0x52')]['id'];}_0x2baa64[_0x4344('0x52')][_0x4344('0x3f')]=widgetAttributes(_0x2baa64[_0x4344('0x52')]);return db[_0x4344('0x2f')]['find']({'where':{'id':_0x2baa64[_0x4344('0x3b')]['id']}})[_0x4344('0x28')](handleEntityNotFound(_0x489559,null))[_0x4344('0x28')](saveUpdates(_0x2baa64['body'],null))[_0x4344('0x28')](respondWithResult(_0x489559,null))['catch'](handleError(_0x489559,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index bd800d6..3fa57a7 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 _0x00bc=['hasOwnProperty','exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','update','emit'];(function(_0x59571c,_0x327ea1){var _0x2c3889=function(_0x508e5e){while(--_0x508e5e){_0x59571c['push'](_0x59571c['shift']());}};_0x2c3889(++_0x327ea1);}(_0x00bc,0x17c));var _0xc00b=function(_0x5059a5,_0x37451b){_0x5059a5=_0x5059a5-0x0;var _0x2258e2=_0x00bc[_0x5059a5];return _0x2258e2;};'use strict';var EventEmitter=require(_0xc00b('0x0'));var DashboardItem=require(_0xc00b('0x1'))['db'][_0xc00b('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xc00b('0x3')](0x0);var events={'afterCreate':_0xc00b('0x4'),'afterUpdate':_0xc00b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5622b0){return function(_0x5599c4,_0x1252da,_0x596f4e){DashboardItemEvents[_0xc00b('0x6')](_0x5622b0+':'+_0x5599c4['id'],_0x5599c4);DashboardItemEvents['emit'](_0x5622b0,_0x5599c4);_0x596f4e(null);};}for(var e in events){if(events[_0xc00b('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xc00b('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0xc5fa=['hook','exports','events','../../mysqldb','update','emit'];(function(_0xa203b7,_0x21a09f){var _0x2921dd=function(_0x1f086b){while(--_0x1f086b){_0xa203b7['push'](_0xa203b7['shift']());}};_0x2921dd(++_0x21a09f);}(_0xc5fa,0x164));var _0xac5f=function(_0x243ae7,_0x1c713e){_0x243ae7=_0x243ae7-0x0;var _0x4e8679=_0xc5fa[_0x243ae7];return _0x4e8679;};'use strict';var EventEmitter=require(_0xac5f('0x0'));var DashboardItem=require(_0xac5f('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xac5f('0x2'),'afterDestroy':'remove'};function emitEvent(_0x5224c3){return function(_0x48fec3,_0x37ea8b,_0x59e52a){DashboardItemEvents[_0xac5f('0x3')](_0x5224c3+':'+_0x48fec3['id'],_0x48fec3);DashboardItemEvents[_0xac5f('0x3')](_0x5224c3,_0x48fec3);_0x59e52a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xac5f('0x4')](e,emitEvent(event));}}module[_0xac5f('0x5')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 4cd88a4..b8be0a4 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 _0xe26d=['moment','bluebird','request-promise','../../config/environment','dashboard_items','lodash','util','api'];(function(_0x375325,_0x57a850){var _0x228f57=function(_0x2ad744){while(--_0x2ad744){_0x375325['push'](_0x375325['shift']());}};_0x228f57(++_0x57a850);}(_0xe26d,0x1e5));var _0xde26=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe26d[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xde26('0x0'));var util=require(_0xde26('0x1'));var logger=require('../../config/logger')(_0xde26('0x2'));var moment=require(_0xde26('0x3'));var BPromise=require(_0xde26('0x4'));var rp=require(_0xde26('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xde26('0x6'));var attributes=require('./dashboardItem.attributes');module['exports']=function(_0x1676ef,_0x580d26){return _0x1676ef['define']('DashboardItem',attributes,{'tableName':_0xde26('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc740=['bluebird','path','../../config/environment','./dashboardItem.attributes','DashboardItem','lodash','util','../../config/logger','api','moment'];(function(_0x5787b8,_0x479681){var _0x5011ff=function(_0x3e6bc6){while(--_0x3e6bc6){_0x5787b8['push'](_0x5787b8['shift']());}};_0x5011ff(++_0x479681);}(_0xc740,0x159));var _0x0c74=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xc740[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0x0c74('0x0'));var util=require(_0x0c74('0x1'));var logger=require(_0x0c74('0x2'))(_0x0c74('0x3'));var moment=require(_0x0c74('0x4'));var BPromise=require(_0x0c74('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c74('0x6'));var rimraf=require('rimraf');var config=require(_0x0c74('0x7'));var attributes=require(_0x0c74('0x8'));module['exports']=function(_0x5520a7,_0x2f2d9b){return _0x5520a7['define'](_0x0c74('0x9'),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 59d3459..f7e71d6 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 _0x2952=['message','request\x20sent','result','catch','lodash','util','moment','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x10d0bf,_0x5f3acb){var _0x2dabd4=function(_0x288ab9){while(--_0x288ab9){_0x10d0bf['push'](_0x10d0bf['shift']());}};_0x2dabd4(++_0x5f3acb);}(_0x2952,0x86));var _0x2295=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x2952[_0x819464];return _0x49dcc0;};'use strict';var _=require(_0x2295('0x0'));var util=require(_0x2295('0x1'));var moment=require(_0x2295('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2295('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2295('0x4'));var config=require(_0x2295('0x5'));var jayson=require(_0x2295('0x6'));var client=jayson[_0x2295('0x7')][_0x2295('0x8')]({'port':0x232a});config[_0x2295('0x9')]=_[_0x2295('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2295('0xb'))(new Redis(config['redis']));require(_0x2295('0xc'))[_0x2295('0xd')](socket);function respondWithRpcPromise(_0x3a1b61,_0x1e6559,_0x34d881){return new BPromise(function(_0x2c2f08,_0x29c3af){return client[_0x2295('0xe')](_0x3a1b61,_0x34d881)[_0x2295('0xf')](function(_0x1493cc){logger[_0x2295('0x10')](_0x2295('0x11'),_0x1e6559,'request\x20sent');logger[_0x2295('0x12')](_0x2295('0x13'),_0x1e6559,'request\x20sent',JSON['stringify'](_0x1493cc));if(_0x1493cc[_0x2295('0x14')]){if(_0x1493cc[_0x2295('0x14')][_0x2295('0x15')]===0x1f4){logger[_0x2295('0x14')](_0x2295('0x11'),_0x1e6559,_0x1493cc[_0x2295('0x14')][_0x2295('0x16')]);return _0x29c3af(_0x1493cc[_0x2295('0x14')][_0x2295('0x16')]);}logger[_0x2295('0x14')](_0x2295('0x11'),_0x1e6559,_0x1493cc[_0x2295('0x14')]['message']);return _0x2c2f08(_0x1493cc[_0x2295('0x14')]['message']);}else{logger[_0x2295('0x10')](_0x2295('0x11'),_0x1e6559,_0x2295('0x17'));_0x2c2f08(_0x1493cc[_0x2295('0x18')][_0x2295('0x16')]);}})[_0x2295('0x19')](function(_0x3ff056){logger[_0x2295('0x14')]('DashboardItem,\x20%s,\x20%s',_0x1e6559,_0x3ff056);_0x29c3af(_0x3ff056);});});} \ No newline at end of file +var _0x51d0=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','register','request','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','DashboardItem,\x20%s,\x20%s','info','result','catch','lodash','util'];(function(_0x20dd45,_0x35a4e6){var _0x43c774=function(_0x4f52a1){while(--_0x4f52a1){_0x20dd45['push'](_0x20dd45['shift']());}};_0x43c774(++_0x35a4e6);}(_0x51d0,0xd6));var _0x051d=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x51d0[_0x44bcb0];return _0xfaf881;};'use strict';var _=require(_0x051d('0x0'));var util=require(_0x051d('0x1'));var moment=require(_0x051d('0x2'));var BPromise=require('bluebird');var rs=require(_0x051d('0x3'));var fs=require('fs');var Redis=require(_0x051d('0x4'));var db=require(_0x051d('0x5'))['db'];var utils=require(_0x051d('0x6'));var logger=require('../../config/logger')(_0x051d('0x7'));var config=require(_0x051d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x051d('0x9')][_0x051d('0xa')]({'port':0x232a});config['redis']=_[_0x051d('0xb')](config[_0x051d('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x051d('0xc')]));require('./dashboardItem.socket')[_0x051d('0xd')](socket);function respondWithRpcPromise(_0x4b8b2f,_0x2dc5d6,_0x59ca13){return new BPromise(function(_0x44f0bb,_0x17ed21){return client[_0x051d('0xe')](_0x4b8b2f,_0x59ca13)['then'](function(_0x4642d5){logger['info']('DashboardItem,\x20%s,\x20%s',_0x2dc5d6,'request\x20sent');logger['debug'](_0x051d('0xf'),_0x2dc5d6,_0x051d('0x10'),JSON[_0x051d('0x11')](_0x4642d5));if(_0x4642d5[_0x051d('0x12')]){if(_0x4642d5[_0x051d('0x12')]['code']===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x2dc5d6,_0x4642d5[_0x051d('0x12')][_0x051d('0x13')]);return _0x17ed21(_0x4642d5[_0x051d('0x12')][_0x051d('0x13')]);}logger[_0x051d('0x12')](_0x051d('0x14'),_0x2dc5d6,_0x4642d5[_0x051d('0x12')]['message']);return _0x44f0bb(_0x4642d5['error'][_0x051d('0x13')]);}else{logger[_0x051d('0x15')](_0x051d('0x14'),_0x2dc5d6,'request\x20sent');_0x44f0bb(_0x4642d5[_0x051d('0x16')]['message']);}})[_0x051d('0x17')](function(_0x3c30ad){logger[_0x051d('0x12')](_0x051d('0x14'),_0x2dc5d6,_0x3c30ad);_0x17ed21(_0x3c30ad);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 275423c..d743ed1 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 _0xc053=['emit','removeListener','length','dashboardItem:','./dashboardItem.events','save','remove','update'];(function(_0x726eba,_0x23d3be){var _0x29a451=function(_0x2c72c6){while(--_0x2c72c6){_0x726eba['push'](_0x726eba['shift']());}};_0x29a451(++_0x23d3be);}(_0xc053,0x64));var _0x3c05=function(_0x3cd241,_0x2483d3){_0x3cd241=_0x3cd241-0x0;var _0x1e702c=_0xc053[_0x3cd241];return _0x1e702c;};'use strict';var DashboardItemEvents=require(_0x3c05('0x0'));var events=[_0x3c05('0x1'),_0x3c05('0x2'),_0x3c05('0x3')];function createListener(_0xf56b6e,_0x41ef27){return function(_0x27a949){_0x41ef27[_0x3c05('0x4')](_0xf56b6e,_0x27a949);};}function removeListener(_0x3141fb,_0x567d5e){return function(){DashboardItemEvents[_0x3c05('0x5')](_0x3141fb,_0x567d5e);};}exports['register']=function(_0x1eacab){for(var _0x147018=0x0,_0x3ffc95=events[_0x3c05('0x6')];_0x147018<_0x3ffc95;_0x147018++){var _0x249444=events[_0x147018];var _0x15afdc=createListener(_0x3c05('0x7')+_0x249444,_0x1eacab);DashboardItemEvents['on'](_0x249444,_0x15afdc);}}; \ No newline at end of file +var _0x4ed8=['emit','register','length','dashboardItem:','./dashboardItem.events','save','update'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x4ed8,0x1a8));var _0x84ed=function(_0x487037,_0x50af77){_0x487037=_0x487037-0x0;var _0x9ba741=_0x4ed8[_0x487037];return _0x9ba741;};'use strict';var DashboardItemEvents=require(_0x84ed('0x0'));var events=[_0x84ed('0x1'),'remove',_0x84ed('0x2')];function createListener(_0x36959f,_0x49f485){return function(_0x26909b){_0x49f485[_0x84ed('0x3')](_0x36959f,_0x26909b);};}function removeListener(_0x1b1a27,_0x259be5){return function(){DashboardItemEvents['removeListener'](_0x1b1a27,_0x259be5);};}exports[_0x84ed('0x4')]=function(_0x39fb4c){for(var _0x14012f=0x0,_0x33be45=events[_0x84ed('0x5')];_0x14012f<_0x33be45;_0x14012f++){var _0x223401=events[_0x14012f];var _0x45a38d=createListener(_0x84ed('0x6')+_0x223401,_0x39fb4c);DashboardItemEvents['on'](_0x223401,_0x45a38d);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index c02a331..a0f6183 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(_0x4ce028,_0x526d4b){var _0x583d0c=function(_0x874178){while(--_0x874178){_0x4ce028['push'](_0x4ce028['shift']());}};_0x583d0c(++_0x526d4b);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x219a5b,_0x5779ce){_0x219a5b=_0x219a5b-0x0;var _0x36aa92=_0x9c5a[_0x219a5b];return _0x36aa92;};'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 _0x814b=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','post','put'];(function(_0x18f0dd,_0x14e342){var _0x12dd99=function(_0x384d0e){while(--_0x384d0e){_0x18f0dd['push'](_0x18f0dd['shift']());}};_0x12dd99(++_0x14e342);}(_0x814b,0x1a2));var _0xb814=function(_0x4fc80b,_0xfe1b3d){_0x4fc80b=_0x4fc80b-0x0;var _0x119dba=_0x814b[_0x4fc80b];return _0x119dba;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')](_0xb814('0xa'),auth[_0xb814('0xb')](),controller['show']);router[_0xb814('0xc')]('/',auth[_0xb814('0xb')](),controller['create']);router[_0xb814('0xd')](_0xb814('0xa'),auth[_0xb814('0xb')](),controller[_0xb814('0xe')]);router[_0xb814('0xf')](_0xb814('0xa'),auth[_0xb814('0xb')](),controller[_0xb814('0x10')]);module[_0xb814('0x11')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 23ca7a9..bdf7066 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 _0x9328=['exports'];(function(_0x395bfe,_0x4db521){var _0x35c81c=function(_0x484a1b){while(--_0x484a1b){_0x395bfe['push'](_0x395bfe['shift']());}};_0x35c81c(++_0x4db521);}(_0x9328,0x1d5));var _0x8932=function(_0x16d4ec,_0x502285){_0x16d4ec=_0x16d4ec-0x0;var _0x39104a=_0x9328[_0x16d4ec];return _0x39104a;};'use strict';var Sequelize=require('sequelize');module[_0x8932('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x9f57=['sequelize','exports'];(function(_0x39ce74,_0x4fc373){var _0x57248e=function(_0x73646e){while(--_0x73646e){_0x39ce74['push'](_0x39ce74['shift']());}};_0x57248e(++_0x4fc373);}(_0x9f57,0x1e8));var _0x79f5=function(_0x25c09a,_0x456ca1){_0x25c09a=_0x25c09a-0x0;var _0x4b44ed=_0x9f57[_0x25c09a];return _0x4b44ed;};'use strict';var Sequelize=require(_0x79f5('0x0'));module[_0x79f5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index d379ec0..d108db5 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 _0x4d9e=['show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','zip-dir','request-promise','bluebird','mustache','path','sox','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','../../config/environment','status','count','limit','Content-Range','apply','save','update','then','destroy','get','Dispositions','UserProfileResource','end','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','offset','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch'];(function(_0x5406b7,_0x89ac7c){var _0x307f9a=function(_0xae1495){while(--_0xae1495){_0x5406b7['push'](_0x5406b7['shift']());}};_0x307f9a(++_0x89ac7c);}(_0x4d9e,0x18c));var _0xe4d9=function(_0xeaae90,_0x5d33bf){_0xeaae90=_0xeaae90-0x0;var _0x487f65=_0x4d9e[_0xeaae90];return _0x487f65;};'use strict';var pdf=require(_0xe4d9('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe4d9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe4d9('0x2'));var moment=require('moment');var BPromise=require(_0xe4d9('0x3'));var Mustache=require(_0xe4d9('0x4'));var util=require('util');var path=require(_0xe4d9('0x5'));var sox=require(_0xe4d9('0x6'));var csv=require(_0xe4d9('0x7'));var ejs=require(_0xe4d9('0x8'));var fs=require('fs');var _=require(_0xe4d9('0x9'));var squel=require(_0xe4d9('0xa'));var crypto=require('crypto');var jsforce=require(_0xe4d9('0xb'));var deskjs=require(_0xe4d9('0xc'));var toCsv=require(_0xe4d9('0x7'));var querystring=require(_0xe4d9('0xd'));var Papa=require(_0xe4d9('0xe'));var Redis=require(_0xe4d9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe4d9('0x10'));var as=require(_0xe4d9('0x11'));var hardwareService=require(_0xe4d9('0x12'));var logger=require(_0xe4d9('0x13'))(_0xe4d9('0x14'));var utils=require(_0xe4d9('0x15'));var config=require(_0xe4d9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ee099,_0x580c50){_0x580c50=_0x580c50||0xcc;return function(_0x4e0d15){if(_0x4e0d15){return _0x5ee099['sendStatus'](_0x580c50);}return _0x5ee099['status'](_0x580c50)['end']();};}function respondWithResult(_0x5649e1,_0x15c0eb){_0x15c0eb=_0x15c0eb||0xc8;return function(_0x3238d4){if(_0x3238d4){return _0x5649e1[_0xe4d9('0x17')](_0x15c0eb)['json'](_0x3238d4);}};}function respondWithFilteredResult(_0x9f0442,_0x3f6ce4){return function(_0xe4f133){if(_0xe4f133){var _0x4283f7=_0xe4f133[_0xe4d9('0x18')],_0x58d0cf=_0x3f6ce4['offset'],_0x331ef3=_0x3f6ce4['offset']+_0x3f6ce4[_0xe4d9('0x19')],_0x35cbc2;if(_0x331ef3>=_0x4283f7){_0x331ef3=_0x4283f7;_0x35cbc2=0xc8;}else{_0x35cbc2=0xce;}_0x9f0442[_0xe4d9('0x17')](_0x35cbc2);return _0x9f0442['set'](_0xe4d9('0x1a'),_0x58d0cf+'-'+_0x331ef3+'/'+_0x4283f7)['json'](_0xe4f133);}return null;};}function patchUpdates(_0x469931){return function(_0x19f8ce){try{jsonpatch[_0xe4d9('0x1b')](_0x19f8ce,_0x469931,!![]);}catch(_0x2522f3){return BPromise['reject'](_0x2522f3);}return _0x19f8ce[_0xe4d9('0x1c')]();};}function saveUpdates(_0x3c2017,_0x151220){return function(_0x171224){if(_0x171224){return _0x171224[_0xe4d9('0x1d')](_0x3c2017)[_0xe4d9('0x1e')](function(_0x30d923){return _0x30d923;});}return null;};}function removeEntity(_0x29e0c9,_0x562bab){return function(_0x4fed7f){if(_0x4fed7f){return _0x4fed7f[_0xe4d9('0x1f')]()[_0xe4d9('0x1e')](function(){var _0x4f2143=_0x4fed7f[_0xe4d9('0x20')]({'plain':!![]});var _0x50d377=_0xe4d9('0x21');return db[_0xe4d9('0x22')]['destroy']({'where':{'type':_0x50d377,'resourceId':_0x4f2143['id']}})[_0xe4d9('0x1e')](function(){return _0x4fed7f;});})[_0xe4d9('0x1e')](function(){_0x29e0c9['status'](0xcc)[_0xe4d9('0x23')]();});}};}function handleEntityNotFound(_0x2af9b0,_0x36444c){return function(_0x5bb43b){if(!_0x5bb43b){_0x2af9b0['sendStatus'](0x194);}return _0x5bb43b;};}function handleError(_0x42e6a0,_0x2846e2){_0x2846e2=_0x2846e2||0x1f4;return function(_0x52ef56){logger['error'](_0x52ef56['stack']);if(_0x52ef56['name']){delete _0x52ef56[_0xe4d9('0x24')];}_0x42e6a0['status'](_0x2846e2)[_0xe4d9('0x25')](_0x52ef56);};}exports[_0xe4d9('0x26')]=function(_0x4192bb,_0x535200){var _0xec8d64={},_0x2a0d1f={},_0x250de5={'count':0x0,'rows':[]};var _0x45e8a3=_[_0xe4d9('0x27')](db[_0xe4d9('0x28')][_0xe4d9('0x29')],function(_0x449cb8){return{'name':_0x449cb8[_0xe4d9('0x2a')],'type':_0x449cb8[_0xe4d9('0x2b')][_0xe4d9('0x2c')]};});_0x2a0d1f[_0xe4d9('0x2d')]=_['map'](_0x45e8a3,_0xe4d9('0x24'));_0x2a0d1f[_0xe4d9('0x2e')]=_[_0xe4d9('0x2f')](_0x4192bb[_0xe4d9('0x2e')]);_0x2a0d1f[_0xe4d9('0x30')]=_[_0xe4d9('0x31')](_0x2a0d1f['model'],_0x2a0d1f['query']);_0xec8d64['attributes']=_[_0xe4d9('0x31')](_0x2a0d1f[_0xe4d9('0x2d')],qs[_0xe4d9('0x32')](_0x4192bb['query']['fields']));_0xec8d64['attributes']=_0xec8d64['attributes'][_0xe4d9('0x33')]?_0xec8d64[_0xe4d9('0x34')]:_0x2a0d1f['model'];if(!_0x4192bb[_0xe4d9('0x2e')][_0xe4d9('0x35')]('nolimit')){_0xec8d64[_0xe4d9('0x19')]=qs[_0xe4d9('0x19')](_0x4192bb[_0xe4d9('0x2e')][_0xe4d9('0x19')]);_0xec8d64[_0xe4d9('0x36')]=qs[_0xe4d9('0x36')](_0x4192bb[_0xe4d9('0x2e')][_0xe4d9('0x36')]);}_0xec8d64[_0xe4d9('0x37')]=qs[_0xe4d9('0x38')](_0x4192bb[_0xe4d9('0x2e')][_0xe4d9('0x38')]);_0xec8d64[_0xe4d9('0x39')]=qs[_0xe4d9('0x30')](_['pick'](_0x4192bb[_0xe4d9('0x2e')],_0x2a0d1f[_0xe4d9('0x30')]));if(_0x4192bb[_0xe4d9('0x2e')][_0xe4d9('0x3a')]){_0xec8d64[_0xe4d9('0x39')]=_[_0xe4d9('0x3b')](_0xec8d64[_0xe4d9('0x39')],{'$or':_[_0xe4d9('0x27')](_0x45e8a3,function(_0x96a350){if(_0x96a350['type']!=='VIRTUAL'){var _0x5f5bc5={};_0x5f5bc5[_0x96a350[_0xe4d9('0x24')]]={'$like':'%'+_0x4192bb[_0xe4d9('0x2e')][_0xe4d9('0x3a')]+'%'};return _0x5f5bc5;}})});}_0xec8d64=_[_0xe4d9('0x3b')]({},_0xec8d64,_0x4192bb[_0xe4d9('0x3c')]);var _0x324679={'where':_0xec8d64[_0xe4d9('0x39')]};return db['Disposition']['count'](_0x324679)['then'](function(_0x3437cd){_0x250de5[_0xe4d9('0x18')]=_0x3437cd;if(_0x4192bb['query'][_0xe4d9('0x3d')]){_0xec8d64[_0xe4d9('0x3e')]=[{'all':!![]}];}return db[_0xe4d9('0x28')][_0xe4d9('0x3f')](_0xec8d64);})['then'](function(_0x2f5423){_0x250de5[_0xe4d9('0x40')]=_0x2f5423;return _0x250de5;})[_0xe4d9('0x1e')](respondWithFilteredResult(_0x535200,_0xec8d64))[_0xe4d9('0x41')](handleError(_0x535200,null));};exports[_0xe4d9('0x42')]=function(_0x1b9d00,_0x25b1f0){var _0x3e9653={'raw':!![],'where':{'id':_0x1b9d00[_0xe4d9('0x43')]['id']}},_0x86bc71={};_0x86bc71[_0xe4d9('0x2d')]=_['keys'](db[_0xe4d9('0x28')][_0xe4d9('0x29')]);_0x86bc71[_0xe4d9('0x2e')]=_[_0xe4d9('0x2f')](_0x1b9d00[_0xe4d9('0x2e')]);_0x86bc71['filters']=_[_0xe4d9('0x31')](_0x86bc71[_0xe4d9('0x2d')],_0x86bc71[_0xe4d9('0x2e')]);_0x3e9653[_0xe4d9('0x34')]=_[_0xe4d9('0x31')](_0x86bc71[_0xe4d9('0x2d')],qs[_0xe4d9('0x32')](_0x1b9d00[_0xe4d9('0x2e')][_0xe4d9('0x32')]));_0x3e9653[_0xe4d9('0x34')]=_0x3e9653['attributes'][_0xe4d9('0x33')]?_0x3e9653[_0xe4d9('0x34')]:_0x86bc71[_0xe4d9('0x2d')];if(_0x1b9d00['query'][_0xe4d9('0x3d')]){_0x3e9653[_0xe4d9('0x3e')]=[{'all':!![]}];}_0x3e9653=_[_0xe4d9('0x3b')]({},_0x3e9653,_0x1b9d00[_0xe4d9('0x3c')]);return db[_0xe4d9('0x28')][_0xe4d9('0x44')](_0x3e9653)[_0xe4d9('0x1e')](handleEntityNotFound(_0x25b1f0,null))['then'](respondWithResult(_0x25b1f0,null))[_0xe4d9('0x41')](handleError(_0x25b1f0,null));};exports[_0xe4d9('0x45')]=function(_0x38bc8f,_0x15ea5a){return db[_0xe4d9('0x28')][_0xe4d9('0x45')](_0x38bc8f['body'],{})[_0xe4d9('0x1e')](function(_0x119bdc){var _0x87f230=_0x38bc8f[_0xe4d9('0x46')][_0xe4d9('0x20')]({'plain':!![]});if(!_0x87f230)throw new Error(_0xe4d9('0x47'));if(_0x87f230['role']===_0xe4d9('0x46')){var _0x29e038=_0x119bdc['get']({'plain':!![]});var _0x3eccd4='Dispositions';return db[_0xe4d9('0x48')][_0xe4d9('0x44')]({'where':{'name':_0x3eccd4,'userProfileId':_0x87f230['userProfileId']},'raw':!![]})[_0xe4d9('0x1e')](function(_0x5e5267){if(_0x5e5267&&_0x5e5267[_0xe4d9('0x49')]===0x0){return db[_0xe4d9('0x22')][_0xe4d9('0x45')]({'name':_0x29e038['name'],'resourceId':_0x29e038['id'],'type':_0x5e5267[_0xe4d9('0x24')],'sectionId':_0x5e5267['id']},{})[_0xe4d9('0x1e')](function(){return _0x119bdc;});}else{return _0x119bdc;}})['catch'](function(_0x11ca7d){logger[_0xe4d9('0x4a')](_0xe4d9('0x4b'),_0x11ca7d);throw _0x11ca7d;});}return _0x119bdc;})[_0xe4d9('0x1e')](respondWithResult(_0x15ea5a,0xc9))['catch'](handleError(_0x15ea5a,null));};exports['update']=function(_0x198e92,_0x40674d){if(_0x198e92[_0xe4d9('0x4c')]['id']){delete _0x198e92[_0xe4d9('0x4c')]['id'];}return db[_0xe4d9('0x28')][_0xe4d9('0x44')]({'where':{'id':_0x198e92['params']['id']}})['then'](handleEntityNotFound(_0x40674d,null))[_0xe4d9('0x1e')](saveUpdates(_0x198e92[_0xe4d9('0x4c')],null))[_0xe4d9('0x1e')](respondWithResult(_0x40674d,null))[_0xe4d9('0x41')](handleError(_0x40674d,null));};exports[_0xe4d9('0x1f')]=function(_0x390e64,_0x5893cb){return db[_0xe4d9('0x28')][_0xe4d9('0x44')]({'where':{'id':_0x390e64[_0xe4d9('0x43')]['id']}})['then'](handleEntityNotFound(_0x5893cb,null))[_0xe4d9('0x1e')](removeEntity(_0x5893cb,null))[_0xe4d9('0x41')](handleError(_0x5893cb,null));}; \ No newline at end of file +var _0x9b67=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','get','Dispositions','destroy','stack','name','index','map','Disposition','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes'];(function(_0x768e6d,_0x42927e){var _0x5d10d0=function(_0x54d160){while(--_0x54d160){_0x768e6d['push'](_0x768e6d['shift']());}};_0x5d10d0(++_0x42927e);}(_0x9b67,0xf6));var _0x79b6=function(_0x5cfd02,_0x4848c6){_0x5cfd02=_0x5cfd02-0x0;var _0x21961c=_0x9b67[_0x5cfd02];return _0x21961c;};'use strict';var pdf=require(_0x79b6('0x0'));var emlformat=require(_0x79b6('0x1'));var rimraf=require(_0x79b6('0x2'));var zipdir=require(_0x79b6('0x3'));var jsonpatch=require(_0x79b6('0x4'));var rp=require('request-promise');var moment=require(_0x79b6('0x5'));var BPromise=require(_0x79b6('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x79b6('0x7'));var sox=require(_0x79b6('0x8'));var csv=require(_0x79b6('0x9'));var ejs=require(_0x79b6('0xa'));var fs=require('fs');var _=require(_0x79b6('0xb'));var squel=require(_0x79b6('0xc'));var crypto=require(_0x79b6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x79b6('0xe'));var toCsv=require(_0x79b6('0x9'));var querystring=require(_0x79b6('0xf'));var Papa=require(_0x79b6('0x10'));var Redis=require(_0x79b6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x79b6('0x12'));var as=require(_0x79b6('0x13'));var hardwareService=require(_0x79b6('0x14'));var logger=require(_0x79b6('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x79b6('0x16'));var db=require(_0x79b6('0x17'))['db'];function respondWithStatusCode(_0x303cfb,_0x526727){_0x526727=_0x526727||0xcc;return function(_0xc05a77){if(_0xc05a77){return _0x303cfb[_0x79b6('0x18')](_0x526727);}return _0x303cfb[_0x79b6('0x19')](_0x526727)[_0x79b6('0x1a')]();};}function respondWithResult(_0x3b0721,_0x40478d){_0x40478d=_0x40478d||0xc8;return function(_0x19d5b2){if(_0x19d5b2){return _0x3b0721[_0x79b6('0x19')](_0x40478d)[_0x79b6('0x1b')](_0x19d5b2);}};}function respondWithFilteredResult(_0x114d8c,_0x2ac966){return function(_0x3563cc){if(_0x3563cc){var _0x1e8bf1=_0x3563cc[_0x79b6('0x1c')],_0x4cf491=_0x2ac966[_0x79b6('0x1d')],_0x207bcc=_0x2ac966[_0x79b6('0x1d')]+_0x2ac966[_0x79b6('0x1e')],_0x2a75d5;if(_0x207bcc>=_0x1e8bf1){_0x207bcc=_0x1e8bf1;_0x2a75d5=0xc8;}else{_0x2a75d5=0xce;}_0x114d8c[_0x79b6('0x19')](_0x2a75d5);return _0x114d8c[_0x79b6('0x1f')](_0x79b6('0x20'),_0x4cf491+'-'+_0x207bcc+'/'+_0x1e8bf1)[_0x79b6('0x1b')](_0x3563cc);}return null;};}function patchUpdates(_0x323376){return function(_0xa1a29a){try{jsonpatch[_0x79b6('0x21')](_0xa1a29a,_0x323376,!![]);}catch(_0x52a70f){return BPromise[_0x79b6('0x22')](_0x52a70f);}return _0xa1a29a['save']();};}function saveUpdates(_0x22a9eb,_0x532e65){return function(_0x28b9c2){if(_0x28b9c2){return _0x28b9c2[_0x79b6('0x23')](_0x22a9eb)[_0x79b6('0x24')](function(_0x56ebf4){return _0x56ebf4;});}return null;};}function removeEntity(_0x46304b,_0x30dc0b){return function(_0x53208a){if(_0x53208a){return _0x53208a['destroy']()[_0x79b6('0x24')](function(){var _0x2e2948=_0x53208a[_0x79b6('0x25')]({'plain':!![]});var _0x268826=_0x79b6('0x26');return db['UserProfileResource'][_0x79b6('0x27')]({'where':{'type':_0x268826,'resourceId':_0x2e2948['id']}})[_0x79b6('0x24')](function(){return _0x53208a;});})[_0x79b6('0x24')](function(){_0x46304b[_0x79b6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53c03c,_0x40ef76){return function(_0x2d16b2){if(!_0x2d16b2){_0x53c03c[_0x79b6('0x18')](0x194);}return _0x2d16b2;};}function handleError(_0xc25c99,_0x4adf15){_0x4adf15=_0x4adf15||0x1f4;return function(_0x6f6ca1){logger['error'](_0x6f6ca1[_0x79b6('0x28')]);if(_0x6f6ca1[_0x79b6('0x29')]){delete _0x6f6ca1[_0x79b6('0x29')];}_0xc25c99[_0x79b6('0x19')](_0x4adf15)['send'](_0x6f6ca1);};}exports[_0x79b6('0x2a')]=function(_0x310832,_0x53b463){var _0x158221={},_0x2d219c={},_0x1b1f2b={'count':0x0,'rows':[]};var _0x4f47dc=_[_0x79b6('0x2b')](db[_0x79b6('0x2c')]['rawAttributes'],function(_0x160d2a){return{'name':_0x160d2a[_0x79b6('0x2d')],'type':_0x160d2a[_0x79b6('0x2e')][_0x79b6('0x2f')]};});_0x2d219c[_0x79b6('0x30')]=_[_0x79b6('0x2b')](_0x4f47dc,'name');_0x2d219c[_0x79b6('0x31')]=_[_0x79b6('0x32')](_0x310832[_0x79b6('0x31')]);_0x2d219c['filters']=_['intersection'](_0x2d219c[_0x79b6('0x30')],_0x2d219c[_0x79b6('0x31')]);_0x158221[_0x79b6('0x33')]=_[_0x79b6('0x34')](_0x2d219c[_0x79b6('0x30')],qs[_0x79b6('0x35')](_0x310832['query']['fields']));_0x158221[_0x79b6('0x33')]=_0x158221['attributes'][_0x79b6('0x36')]?_0x158221['attributes']:_0x2d219c[_0x79b6('0x30')];if(!_0x310832[_0x79b6('0x31')]['hasOwnProperty'](_0x79b6('0x37'))){_0x158221[_0x79b6('0x1e')]=qs['limit'](_0x310832[_0x79b6('0x31')]['limit']);_0x158221[_0x79b6('0x1d')]=qs[_0x79b6('0x1d')](_0x310832[_0x79b6('0x31')][_0x79b6('0x1d')]);}_0x158221[_0x79b6('0x38')]=qs[_0x79b6('0x39')](_0x310832[_0x79b6('0x31')][_0x79b6('0x39')]);_0x158221[_0x79b6('0x3a')]=qs[_0x79b6('0x3b')](_['pick'](_0x310832['query'],_0x2d219c['filters']));if(_0x310832[_0x79b6('0x31')][_0x79b6('0x3c')]){_0x158221['where']=_[_0x79b6('0x3d')](_0x158221['where'],{'$or':_[_0x79b6('0x2b')](_0x4f47dc,function(_0x42757a){if(_0x42757a[_0x79b6('0x2e')]!=='VIRTUAL'){var _0x601bb8={};_0x601bb8[_0x42757a['name']]={'$like':'%'+_0x310832[_0x79b6('0x31')][_0x79b6('0x3c')]+'%'};return _0x601bb8;}})});}_0x158221=_[_0x79b6('0x3d')]({},_0x158221,_0x310832[_0x79b6('0x3e')]);var _0x1cb2a6={'where':_0x158221['where']};return db['Disposition'][_0x79b6('0x1c')](_0x1cb2a6)['then'](function(_0x4037c8){_0x1b1f2b[_0x79b6('0x1c')]=_0x4037c8;if(_0x310832[_0x79b6('0x31')][_0x79b6('0x3f')]){_0x158221[_0x79b6('0x40')]=[{'all':!![]}];}return db[_0x79b6('0x2c')][_0x79b6('0x41')](_0x158221);})['then'](function(_0x109514){_0x1b1f2b[_0x79b6('0x42')]=_0x109514;return _0x1b1f2b;})[_0x79b6('0x24')](respondWithFilteredResult(_0x53b463,_0x158221))[_0x79b6('0x43')](handleError(_0x53b463,null));};exports['show']=function(_0x12ea22,_0x4f803c){var _0x4ba212={'raw':!![],'where':{'id':_0x12ea22[_0x79b6('0x44')]['id']}},_0x22025a={};_0x22025a[_0x79b6('0x30')]=_[_0x79b6('0x32')](db[_0x79b6('0x2c')][_0x79b6('0x45')]);_0x22025a[_0x79b6('0x31')]=_[_0x79b6('0x32')](_0x12ea22['query']);_0x22025a[_0x79b6('0x3b')]=_['intersection'](_0x22025a['model'],_0x22025a[_0x79b6('0x31')]);_0x4ba212[_0x79b6('0x33')]=_[_0x79b6('0x34')](_0x22025a[_0x79b6('0x30')],qs[_0x79b6('0x35')](_0x12ea22[_0x79b6('0x31')][_0x79b6('0x35')]));_0x4ba212[_0x79b6('0x33')]=_0x4ba212[_0x79b6('0x33')]['length']?_0x4ba212[_0x79b6('0x33')]:_0x22025a[_0x79b6('0x30')];if(_0x12ea22[_0x79b6('0x31')][_0x79b6('0x3f')]){_0x4ba212[_0x79b6('0x40')]=[{'all':!![]}];}_0x4ba212=_['merge']({},_0x4ba212,_0x12ea22[_0x79b6('0x3e')]);return db[_0x79b6('0x2c')]['find'](_0x4ba212)['then'](handleEntityNotFound(_0x4f803c,null))[_0x79b6('0x24')](respondWithResult(_0x4f803c,null))[_0x79b6('0x43')](handleError(_0x4f803c,null));};exports[_0x79b6('0x46')]=function(_0xa0c396,_0x37f4b1){return db[_0x79b6('0x2c')][_0x79b6('0x46')](_0xa0c396[_0x79b6('0x47')],{})[_0x79b6('0x24')](function(_0x909351){var _0x15c795=_0xa0c396[_0x79b6('0x48')][_0x79b6('0x25')]({'plain':!![]});if(!_0x15c795)throw new Error(_0x79b6('0x49'));if(_0x15c795[_0x79b6('0x4a')]===_0x79b6('0x48')){var _0x26ab29=_0x909351[_0x79b6('0x25')]({'plain':!![]});var _0x29216c='Dispositions';return db['UserProfileSection']['find']({'where':{'name':_0x29216c,'userProfileId':_0x15c795['userProfileId']},'raw':!![]})['then'](function(_0x412c1e){if(_0x412c1e&&_0x412c1e[_0x79b6('0x4b')]===0x0){return db[_0x79b6('0x4c')][_0x79b6('0x46')]({'name':_0x26ab29[_0x79b6('0x29')],'resourceId':_0x26ab29['id'],'type':_0x412c1e[_0x79b6('0x29')],'sectionId':_0x412c1e['id']},{})['then'](function(){return _0x909351;});}else{return _0x909351;}})[_0x79b6('0x43')](function(_0xa2ba0e){logger['error'](_0x79b6('0x4d'),_0xa2ba0e);throw _0xa2ba0e;});}return _0x909351;})['then'](respondWithResult(_0x37f4b1,0xc9))[_0x79b6('0x43')](handleError(_0x37f4b1,null));};exports['update']=function(_0x48dd20,_0x46adb4){if(_0x48dd20[_0x79b6('0x47')]['id']){delete _0x48dd20[_0x79b6('0x47')]['id'];}return db[_0x79b6('0x2c')][_0x79b6('0x4e')]({'where':{'id':_0x48dd20[_0x79b6('0x44')]['id']}})['then'](handleEntityNotFound(_0x46adb4,null))['then'](saveUpdates(_0x48dd20[_0x79b6('0x47')],null))[_0x79b6('0x24')](respondWithResult(_0x46adb4,null))['catch'](handleError(_0x46adb4,null));};exports[_0x79b6('0x27')]=function(_0x251118,_0x12cb4c){return db[_0x79b6('0x2c')][_0x79b6('0x4e')]({'where':{'id':_0x251118[_0x79b6('0x44')]['id']}})[_0x79b6('0x24')](handleEntityNotFound(_0x12cb4c,null))['then'](removeEntity(_0x12cb4c,null))[_0x79b6('0x43')](handleError(_0x12cb4c,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 3a52b0a..e60d3af 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 _0xb82b=['define','tools_dispositions','name_voice','ListId','name_chat','name','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','util','moment','bluebird','request-promise','path'];(function(_0x417dee,_0x2a6f81){var _0x4a554b=function(_0x21b4e2){while(--_0x21b4e2){_0x417dee['push'](_0x417dee['shift']());}};_0x4a554b(++_0x2a6f81);}(_0xb82b,0x1b0));var _0xbb82=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb82b[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0xbb82('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xbb82('0x1'));var BPromise=require(_0xbb82('0x2'));var rp=require(_0xbb82('0x3'));var fs=require('fs');var path=require(_0xbb82('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./disposition.attributes');module['exports']=function(_0x1240be,_0x3f6a45){return _0x1240be[_0xbb82('0x5')]('Disposition',attributes,{'tableName':_0xbb82('0x6'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xbb82('0x7'),'fields':['name',_0xbb82('0x8')]},{'unique':!![],'name':_0xbb82('0x9'),'fields':[_0xbb82('0xa'),_0xbb82('0xb')]},{'unique':!![],'name':'name_mail','fields':['name',_0xbb82('0xc')]},{'unique':!![],'name':_0xbb82('0xd'),'fields':[_0xbb82('0xa'),_0xbb82('0xe')]},{'unique':!![],'name':_0xbb82('0xf'),'fields':[_0xbb82('0xa'),_0xbb82('0x10')]},{'unique':!![],'name':_0xbb82('0x11'),'fields':['name',_0xbb82('0x12')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x833b=['ChatWebsiteId','name_mail','name_sms','SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId','util','api','moment','rimraf','../../config/environment','./disposition.attributes','exports','Disposition','tools_dispositions','name_voice','name','name_chat'];(function(_0x446258,_0x6ee4bd){var _0x86c780=function(_0x1de354){while(--_0x1de354){_0x446258['push'](_0x446258['shift']());}};_0x86c780(++_0x6ee4bd);}(_0x833b,0x15d));var _0xb833=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x833b[_0x263a74];return _0x2aa86c;};'use strict';var _=require('lodash');var util=require(_0xb833('0x0'));var logger=require('../../config/logger')(_0xb833('0x1'));var moment=require(_0xb833('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb833('0x3'));var config=require(_0xb833('0x4'));var attributes=require(_0xb833('0x5'));module[_0xb833('0x6')]=function(_0x2c39e1,_0x3776fb){return _0x2c39e1['define'](_0xb833('0x7'),attributes,{'tableName':_0xb833('0x8'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xb833('0x9'),'fields':[_0xb833('0xa'),'ListId']},{'unique':!![],'name':_0xb833('0xb'),'fields':['name',_0xb833('0xc')]},{'unique':!![],'name':_0xb833('0xd'),'fields':[_0xb833('0xa'),'MailAccountId']},{'unique':!![],'name':_0xb833('0xe'),'fields':['name',_0xb833('0xf')]},{'unique':!![],'name':_0xb833('0x10'),'fields':[_0xb833('0xa'),_0xb833('0x11')]},{'unique':!![],'name':'name_openchannel','fields':[_0xb833('0xa'),_0xb833('0x12')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index bbf62d1..0507209 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 _0xcbd5=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','error','code','Disposition,\x20%s,\x20%s','message','result','lodash','util','moment'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xcbd5,0xd5));var _0x5cbd=function(_0x51b0dc,_0x5307b7){_0x51b0dc=_0x51b0dc-0x0;var _0x13fa89=_0xcbd5[_0x51b0dc];return _0x13fa89;};'use strict';var _=require(_0x5cbd('0x0'));var util=require(_0x5cbd('0x1'));var moment=require(_0x5cbd('0x2'));var BPromise=require(_0x5cbd('0x3'));var rs=require(_0x5cbd('0x4'));var fs=require('fs');var Redis=require(_0x5cbd('0x5'));var db=require(_0x5cbd('0x6'))['db'];var utils=require(_0x5cbd('0x7'));var logger=require(_0x5cbd('0x8'))('rpc');var config=require(_0x5cbd('0x9'));var jayson=require(_0x5cbd('0xa'));var client=jayson[_0x5cbd('0xb')][_0x5cbd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4f8f45,_0x4a7507,_0x543f42){return new BPromise(function(_0x56126d,_0x541f4d){return client[_0x5cbd('0xd')](_0x4f8f45,_0x543f42)[_0x5cbd('0xe')](function(_0x5e0cdb){logger[_0x5cbd('0xf')]('Disposition,\x20%s,\x20%s',_0x4a7507,_0x5cbd('0x10'));logger[_0x5cbd('0x11')](_0x5cbd('0x12'),_0x4a7507,_0x5cbd('0x10'),JSON['stringify'](_0x5e0cdb));if(_0x5e0cdb[_0x5cbd('0x13')]){if(_0x5e0cdb[_0x5cbd('0x13')][_0x5cbd('0x14')]===0x1f4){logger[_0x5cbd('0x13')](_0x5cbd('0x15'),_0x4a7507,_0x5e0cdb[_0x5cbd('0x13')][_0x5cbd('0x16')]);return _0x541f4d(_0x5e0cdb['error'][_0x5cbd('0x16')]);}logger[_0x5cbd('0x13')](_0x5cbd('0x15'),_0x4a7507,_0x5e0cdb[_0x5cbd('0x13')]['message']);return _0x56126d(_0x5e0cdb[_0x5cbd('0x13')][_0x5cbd('0x16')]);}else{logger['info'](_0x5cbd('0x15'),_0x4a7507,'request\x20sent');_0x56126d(_0x5e0cdb[_0x5cbd('0x17')][_0x5cbd('0x16')]);}})['catch'](function(_0x3e78a2){logger[_0x5cbd('0x13')]('Disposition,\x20%s,\x20%s',_0x4a7507,_0x3e78a2);_0x541f4d(_0x3e78a2);});});} \ No newline at end of file +var _0x9b2e=['debug','Disposition,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Disposition,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x9b2e,0xaf));var _0xe9b2=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9b2e[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0xe9b2('0x0'));var moment=require(_0xe9b2('0x1'));var BPromise=require(_0xe9b2('0x2'));var rs=require(_0xe9b2('0x3'));var fs=require('fs');var Redis=require(_0xe9b2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe9b2('0x5'));var logger=require(_0xe9b2('0x6'))(_0xe9b2('0x7'));var config=require('../../config/environment');var jayson=require(_0xe9b2('0x8'));var client=jayson[_0xe9b2('0x9')][_0xe9b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x205878,_0x27d5d7,_0x510cc8){return new BPromise(function(_0x2ae33f,_0xbf9247){return client[_0xe9b2('0xb')](_0x205878,_0x510cc8)[_0xe9b2('0xc')](function(_0x34ca66){logger[_0xe9b2('0xd')]('Disposition,\x20%s,\x20%s',_0x27d5d7,'request\x20sent');logger[_0xe9b2('0xe')](_0xe9b2('0xf'),_0x27d5d7,_0xe9b2('0x10'),JSON['stringify'](_0x34ca66));if(_0x34ca66[_0xe9b2('0x11')]){if(_0x34ca66[_0xe9b2('0x11')][_0xe9b2('0x12')]===0x1f4){logger[_0xe9b2('0x11')](_0xe9b2('0x13'),_0x27d5d7,_0x34ca66['error'][_0xe9b2('0x14')]);return _0xbf9247(_0x34ca66[_0xe9b2('0x11')][_0xe9b2('0x14')]);}logger[_0xe9b2('0x11')](_0xe9b2('0x13'),_0x27d5d7,_0x34ca66[_0xe9b2('0x11')][_0xe9b2('0x14')]);return _0x2ae33f(_0x34ca66['error']['message']);}else{logger[_0xe9b2('0xd')](_0xe9b2('0x13'),_0x27d5d7,'request\x20sent');_0x2ae33f(_0x34ca66['result'][_0xe9b2('0x14')]);}})['catch'](function(_0x2c66c8){logger[_0xe9b2('0x11')](_0xe9b2('0x13'),_0x27d5d7,_0x2c66c8);_0xbf9247(_0x2c66c8);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 0e721e5..fbcd839 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 _0x5f2f=['create','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','post'];(function(_0x44cb92,_0x59afa3){var _0x56b9e6=function(_0x2841e0){while(--_0x2841e0){_0x44cb92['push'](_0x44cb92['shift']());}};_0x56b9e6(++_0x59afa3);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1b2172,_0x2a18ea){_0x1b2172=_0x1b2172-0x0;var _0x3b2c86=_0x5f2f[_0x1b2172];return _0x3b2c86;};'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('./disposition.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0xc')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xd')]);router['put'](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xe')]);router['delete'](_0xf5f2('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xf5f2('0xf')]=router; \ No newline at end of file +var _0xf4c9=['isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','post'];(function(_0x13d4a9,_0x5d88ac){var _0x4b8281=function(_0x2976ed){while(--_0x2976ed){_0x13d4a9['push'](_0x13d4a9['shift']());}};_0x4b8281(++_0x5d88ac);}(_0xf4c9,0x1aa));var _0x9f4c=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xf4c9[_0x45783c];return _0x1161da;};'use strict';var multer=require(_0x9f4c('0x0'));var util=require(_0x9f4c('0x1'));var path=require(_0x9f4c('0x2'));var timeout=require('connect-timeout');var express=require(_0x9f4c('0x3'));var router=express['Router']();var auth=require(_0x9f4c('0x4'));var interaction=require(_0x9f4c('0x5'));var config=require(_0x9f4c('0x6'));var controller=require('./disposition.controller');router[_0x9f4c('0x7')]('/',auth['isAuthenticated'](),controller[_0x9f4c('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9f4c('0x9')]);router[_0x9f4c('0xa')]('/',auth[_0x9f4c('0xb')](),controller[_0x9f4c('0xc')]);router[_0x9f4c('0xd')](_0x9f4c('0xe'),auth['isAuthenticated'](),controller[_0x9f4c('0xf')]);router[_0x9f4c('0x10')](_0x9f4c('0xe'),auth[_0x9f4c('0xb')](),controller[_0x9f4c('0x11')]);module[_0x9f4c('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 388d669..f500b39 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 _0xfb85=['STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','14400','v17,v27,v29','SIP','IAX','DADHI','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x6757eb,_0x5c0b74){var _0x5f276a=function(_0x16bd37){while(--_0x16bd37){_0x6757eb['push'](_0x6757eb['shift']());}};_0x5f276a(++_0x5c0b74);}(_0xfb85,0xe6));var _0x5fb8=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xfb85[_0x1928c9];return _0x51b5fb;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5fb8('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5fb8('0x0')]},'ecm':{'type':Sequelize[_0x5fb8('0x1')](_0x5fb8('0x2'),'no'),'defaultValue':_0x5fb8('0x2')},'headerinfo':{'type':Sequelize[_0x5fb8('0x0')],'defaultValue':_0x5fb8('0x3')},'localstationid':{'type':Sequelize[_0x5fb8('0x0')],'unique':_0x5fb8('0x4')},'minrate':{'type':Sequelize[_0x5fb8('0x1')](_0x5fb8('0x5'),_0x5fb8('0x6'),_0x5fb8('0x7'),_0x5fb8('0x8'),_0x5fb8('0x9'),'14400'),'defaultValue':_0x5fb8('0x6')},'maxrate':{'type':Sequelize[_0x5fb8('0x1')](_0x5fb8('0x5'),_0x5fb8('0x6'),'7200',_0x5fb8('0x8'),'12000',_0x5fb8('0xa')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x5fb8('0x0')],'defaultValue':_0x5fb8('0xb')},'gateway':{'type':Sequelize[_0x5fb8('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x5fb8('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x5fb8('0x1')](_0x5fb8('0xc'),_0x5fb8('0xd'),_0x5fb8('0xe'),_0x5fb8('0xf')),'defaultValue':_0x5fb8('0xc')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x5fb8('0x10');}},'notificationSound':{'type':Sequelize[_0x5fb8('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5fb8('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5fb8('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5fb8('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5fb8('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5fb8('0x12')],'allowNull':!![],'defaultValue':null,'comment':_0x5fb8('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x5fb8('0x11')],'defaultValue':![],'comment':_0x5fb8('0x14'),'set':function(_0x2d2a6e){if(!_0x2d2a6e)this[_0x5fb8('0x15')](_0x5fb8('0x16'),null);this[_0x5fb8('0x15')]('mandatoryDisposition',_0x2d2a6e);}}}; \ No newline at end of file +var _0x52d1=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','sequelize','exports','ENUM','yes','STRING','localstationid','2400','4800','7200','9600','12000','14400','SIP','DADHI','KHOMP'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x52d1,0x193));var _0x152d=function(_0x5b5a17,_0x1f447f){_0x5b5a17=_0x5b5a17-0x0;var _0x188157=_0x52d1[_0x5b5a17];return _0x188157;};'use strict';var Sequelize=require(_0x152d('0x0'));module[_0x152d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x152d('0x2')](_0x152d('0x3'),'no'),'defaultValue':_0x152d('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x152d('0x4')],'unique':_0x152d('0x5')},'minrate':{'type':Sequelize[_0x152d('0x2')](_0x152d('0x6'),_0x152d('0x7'),_0x152d('0x8'),_0x152d('0x9'),_0x152d('0xa'),_0x152d('0xb')),'defaultValue':_0x152d('0x7')},'maxrate':{'type':Sequelize[_0x152d('0x2')]('2400',_0x152d('0x7'),_0x152d('0x8'),'9600','12000',_0x152d('0xb')),'defaultValue':_0x152d('0xb')},'modem':{'type':Sequelize[_0x152d('0x4')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x152d('0x4')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x152d('0x4')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x152d('0x2')](_0x152d('0xc'),'IAX',_0x152d('0xd'),_0x152d('0xe')),'defaultValue':_0x152d('0xc')},'key':{'type':Sequelize[_0x152d('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x152d('0xf')],'defaultValue':function(){return _0x152d('0x10');}},'notificationSound':{'type':Sequelize[_0x152d('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x152d('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x152d('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x152d('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x152d('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x152d('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x152d('0x12')],'allowNull':!![],'defaultValue':null,'comment':_0x152d('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x152d('0x11')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x277865){if(!_0x277865)this[_0x152d('0x14')]('mandatoryDispositionPauseId',null);this[_0x152d('0x14')](_0x152d('0x15'),_0x277865);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 4fadcd1..ed1add8 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 _0x757b=['fields','length','hasOwnProperty','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','nolimit','order','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addInteraction','getInteractions','FaxInteraction','CmContact','Contact','User','Owner','Tag','Tags','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','app','system','description','Fax\x20Extension','appdata','push','Answer','localstationid','gateway','maxrate','minrate','modem','t38timeout','FAXOPT(','Set','Wait','ReceiveFax','addAccountApplications','update','VoiceExtension','omit','createdAt','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','split','send','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','emit','userFaxAccount:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','count','offset','limit','set','apply','reject','then','get','FaxAccounts','UserProfileResource','destroy','stack','name','index','Pause','mandatoryDispositionPause','map','FaxAccount','type','key','query','filters','intersection','model','attributes'];(function(_0x22b04c,_0x3f501f){var _0xba01a2=function(_0x45d41b){while(--_0x45d41b){_0x22b04c['push'](_0x22b04c['shift']());}};_0xba01a2(++_0x3f501f);}(_0x757b,0x7a));var _0xb757=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x757b[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xb757('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb757('0x1'));var zipdir=require(_0xb757('0x2'));var jsonpatch=require(_0xb757('0x3'));var rp=require('request-promise');var moment=require(_0xb757('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb757('0x5'));var util=require('util');var path=require(_0xb757('0x6'));var sox=require(_0xb757('0x7'));var csv=require(_0xb757('0x8'));var ejs=require(_0xb757('0x9'));var fs=require('fs');var _=require(_0xb757('0xa'));var squel=require(_0xb757('0xb'));var crypto=require(_0xb757('0xc'));var jsforce=require(_0xb757('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb757('0x8'));var querystring=require(_0xb757('0xe'));var Papa=require(_0xb757('0xf'));var Redis=require(_0xb757('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb757('0x11'));var as=require(_0xb757('0x12'));var hardwareService=require(_0xb757('0x13'));var logger=require(_0xb757('0x14'))('api');var utils=require(_0xb757('0x15'));var config=require('../../config/environment');var db=require(_0xb757('0x16'))['db'];config[_0xb757('0x17')]=_[_0xb757('0x18')](config[_0xb757('0x17')],{'host':_0xb757('0x19'),'port':0x18eb});var socket=require(_0xb757('0x1a'))(new Redis(config[_0xb757('0x17')]));require(_0xb757('0x1b'))[_0xb757('0x1c')](socket);var jayson=require(_0xb757('0x1d'));var client=jayson[_0xb757('0x1e')][_0xb757('0x1f')]({'port':0x232c});var client9002=jayson[_0xb757('0x1e')]['http']({'port':0x232a});function checkPasswordPattern(_0x540169,_0x42a904,_0x5ca871){if(_0x5ca871){var _0x137ae3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x137ae3[_0xb757('0x20')](_0x42a904)){return _0x540169;}else{throw new db[(_0xb757('0x21'))][(_0xb757('0x22'))](_0xb757('0x23'));}}else{return _0x540169;}}function respondWithRpcPromise(_0x3560d6,_0x3550e8,_0x42d9ad,_0x176d83){return new BPromise(function(_0x10e7bf,_0x3eca19){var _0x53550b=_0x176d83||client;return _0x53550b[_0xb757('0x24')](_0x3560d6,_0x42d9ad)['then'](function(_0x1cb222){logger[_0xb757('0x25')](_0xb757('0x26'),_0x3550e8,_0xb757('0x27'));logger[_0xb757('0x28')](_0xb757('0x29'),_0x3550e8,_0xb757('0x27'),JSON[_0xb757('0x2a')](_0x1cb222));if(_0x1cb222[_0xb757('0x2b')]){if(_0x1cb222[_0xb757('0x2b')][_0xb757('0x2c')]===0x1f4){logger[_0xb757('0x2b')]('FaxAccount,\x20%s,\x20%s',_0x3550e8,_0x1cb222[_0xb757('0x2b')][_0xb757('0x2d')]);return _0x3eca19(_0x1cb222[_0xb757('0x2b')][_0xb757('0x2d')]);}logger[_0xb757('0x2b')](_0xb757('0x26'),_0x3550e8,_0x1cb222[_0xb757('0x2b')][_0xb757('0x2d')]);return _0x10e7bf(_0x1cb222[_0xb757('0x2b')][_0xb757('0x2d')]);}else{logger[_0xb757('0x25')](_0xb757('0x26'),_0x3550e8,_0xb757('0x27'));_0x10e7bf(_0x1cb222[_0xb757('0x2e')]['message']);}})[_0xb757('0x2f')](function(_0x4bd208){logger[_0xb757('0x2b')](_0xb757('0x26'),_0x3550e8,_0x4bd208);_0x3eca19(_0x4bd208);});});}function respondWithStatusCode(_0x1b51a4,_0x1e502c){_0x1e502c=_0x1e502c||0xcc;return function(_0x225b9d){if(_0x225b9d){return _0x1b51a4['sendStatus'](_0x1e502c);}return _0x1b51a4[_0xb757('0x30')](_0x1e502c)['end']();};}function respondWithResult(_0x322db0,_0x14b556){_0x14b556=_0x14b556||0xc8;return function(_0x4f8149){if(_0x4f8149){return _0x322db0[_0xb757('0x30')](_0x14b556)[_0xb757('0x31')](_0x4f8149);}};}function respondWithFilteredResult(_0x5607aa,_0xdad4d2){return function(_0x211a53){if(_0x211a53){var _0x142429=_0x211a53[_0xb757('0x32')],_0x25dae3=_0xdad4d2[_0xb757('0x33')],_0x108981=_0xdad4d2[_0xb757('0x33')]+_0xdad4d2[_0xb757('0x34')],_0x36ef9e;if(_0x108981>=_0x142429){_0x108981=_0x142429;_0x36ef9e=0xc8;}else{_0x36ef9e=0xce;}_0x5607aa['status'](_0x36ef9e);return _0x5607aa[_0xb757('0x35')]('Content-Range',_0x25dae3+'-'+_0x108981+'/'+_0x142429)[_0xb757('0x31')](_0x211a53);}return null;};}function patchUpdates(_0x3ce118){return function(_0x3a69b0){try{jsonpatch[_0xb757('0x36')](_0x3a69b0,_0x3ce118,!![]);}catch(_0x5105ed){return BPromise[_0xb757('0x37')](_0x5105ed);}return _0x3a69b0['save']();};}function saveUpdates(_0x31f8e6,_0x52d890){return function(_0x8becd9){if(_0x8becd9){return _0x8becd9['update'](_0x31f8e6)[_0xb757('0x38')](function(_0x57d955){return _0x57d955;});}return null;};}function removeEntity(_0x267e25,_0x4c4ace){return function(_0x5ebc94){if(_0x5ebc94){return _0x5ebc94['destroy']()[_0xb757('0x38')](function(){var _0x28359d=_0x5ebc94[_0xb757('0x39')]({'plain':!![]});var _0x1b376c=_0xb757('0x3a');return db[_0xb757('0x3b')][_0xb757('0x3c')]({'where':{'type':_0x1b376c,'resourceId':_0x28359d['id']}})[_0xb757('0x38')](function(){return _0x5ebc94;});})[_0xb757('0x38')](function(){_0x267e25[_0xb757('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42744b,_0x901732){return function(_0x5684c0){if(!_0x5684c0){_0x42744b['sendStatus'](0x194);}return _0x5684c0;};}function handleError(_0x5a63a6,_0x183146){_0x183146=_0x183146||0x1f4;return function(_0x2d322e){logger[_0xb757('0x2b')](_0x2d322e[_0xb757('0x3d')]);if(_0x2d322e[_0xb757('0x3e')]){delete _0x2d322e[_0xb757('0x3e')];}_0x5a63a6[_0xb757('0x30')](_0x183146)['send'](_0x2d322e);};}exports[_0xb757('0x3f')]=function(_0x2617bb,_0x5d6624){var _0x569f6b={'include':[{'model':db[_0xb757('0x40')],'as':_0xb757('0x41')}]},_0x3f35fb={},_0x1534de={'count':0x0,'rows':[]};var _0x57f91f=_[_0xb757('0x42')](db[_0xb757('0x43')]['rawAttributes'],function(_0x3515d2){return{'name':_0x3515d2['fieldName'],'type':_0x3515d2[_0xb757('0x44')][_0xb757('0x45')]};});_0x3f35fb['model']=_[_0xb757('0x42')](_0x57f91f,_0xb757('0x3e'));_0x3f35fb[_0xb757('0x46')]=_['keys'](_0x2617bb[_0xb757('0x46')]);_0x3f35fb[_0xb757('0x47')]=_[_0xb757('0x48')](_0x3f35fb[_0xb757('0x49')],_0x3f35fb[_0xb757('0x46')]);_0x569f6b[_0xb757('0x4a')]=_[_0xb757('0x48')](_0x3f35fb[_0xb757('0x49')],qs['fields'](_0x2617bb[_0xb757('0x46')][_0xb757('0x4b')]));_0x569f6b[_0xb757('0x4a')]=_0x569f6b[_0xb757('0x4a')][_0xb757('0x4c')]?_0x569f6b[_0xb757('0x4a')]:_0x3f35fb[_0xb757('0x49')];if(!_0x2617bb['query'][_0xb757('0x4d')]('nolimit')){_0x569f6b[_0xb757('0x34')]=qs[_0xb757('0x34')](_0x2617bb[_0xb757('0x46')]['limit']);_0x569f6b['offset']=qs['offset'](_0x2617bb[_0xb757('0x46')][_0xb757('0x33')]);}_0x569f6b['order']=qs[_0xb757('0x4e')](_0x2617bb[_0xb757('0x46')][_0xb757('0x4e')]);_0x569f6b[_0xb757('0x4f')]=qs['filters'](_['pick'](_0x2617bb[_0xb757('0x46')],_0x3f35fb['filters']));if(_0x2617bb[_0xb757('0x46')][_0xb757('0x50')]){_0x569f6b[_0xb757('0x4f')]=_['merge'](_0x569f6b['where'],{'$or':_[_0xb757('0x42')](_0x57f91f,function(_0x254153){if(_0x254153[_0xb757('0x44')]!==_0xb757('0x51')){var _0x1aa586={};_0x1aa586[_0x254153[_0xb757('0x3e')]]={'$like':'%'+_0x2617bb[_0xb757('0x46')][_0xb757('0x50')]+'%'};return _0x1aa586;}})});}_0x569f6b=_[_0xb757('0x52')]({},_0x569f6b,_0x2617bb[_0xb757('0x53')]);var _0x5163b7={'where':_0x569f6b['where']};return db[_0xb757('0x43')][_0xb757('0x32')](_0x5163b7)[_0xb757('0x38')](function(_0x1077dc){_0x1534de['count']=_0x1077dc;if(_0x2617bb[_0xb757('0x46')]['includeAll']){_0x569f6b[_0xb757('0x54')]=[{'all':!![]}];}return db[_0xb757('0x43')][_0xb757('0x55')](_0x569f6b);})[_0xb757('0x38')](function(_0x5399a4){_0x1534de[_0xb757('0x56')]=_0x5399a4;return _0x1534de;})['then'](respondWithFilteredResult(_0x5d6624,_0x569f6b))[_0xb757('0x2f')](handleError(_0x5d6624,null));};exports[_0xb757('0x57')]=function(_0x5158a1,_0x49242d){var _0x17c887={'raw':![],'where':{'id':_0x5158a1[_0xb757('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0xb757('0x41')}]},_0x5e0680={};_0x5e0680['model']=_[_0xb757('0x59')](db['FaxAccount'][_0xb757('0x5a')]);_0x5e0680[_0xb757('0x46')]=_['keys'](_0x5158a1[_0xb757('0x46')]);_0x5e0680['filters']=_[_0xb757('0x48')](_0x5e0680[_0xb757('0x49')],_0x5e0680[_0xb757('0x46')]);_0x17c887[_0xb757('0x4a')]=_[_0xb757('0x48')](_0x5e0680[_0xb757('0x49')],qs[_0xb757('0x4b')](_0x5158a1[_0xb757('0x46')][_0xb757('0x4b')]));_0x17c887[_0xb757('0x4a')]=_0x17c887[_0xb757('0x4a')][_0xb757('0x4c')]?_0x17c887['attributes']:_0x5e0680[_0xb757('0x49')];if(_0x5158a1[_0xb757('0x46')][_0xb757('0x5b')]){_0x17c887[_0xb757('0x54')]=[{'all':!![]}];}_0x17c887=_[_0xb757('0x52')]({},_0x17c887,_0x5158a1[_0xb757('0x53')]);return db['FaxAccount'][_0xb757('0x5c')](_0x17c887)['then'](handleEntityNotFound(_0x49242d,null))[_0xb757('0x38')](respondWithResult(_0x49242d,null))[_0xb757('0x2f')](handleError(_0x49242d,null));};exports['create']=function(_0x2df111,_0x4a64e8){return db['FaxAccount'][_0xb757('0x5d')](_0x2df111[_0xb757('0x5e')],{})['then'](function(_0x3eeecf){var _0x5b2484=_0x2df111[_0xb757('0x5f')][_0xb757('0x39')]({'plain':!![]});if(!_0x5b2484)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b2484[_0xb757('0x60')]===_0xb757('0x5f')){var _0x5af8d2=_0x3eeecf[_0xb757('0x39')]({'plain':!![]});var _0x449deb=_0xb757('0x3a');return db[_0xb757('0x61')][_0xb757('0x5c')]({'where':{'name':_0x449deb,'userProfileId':_0x5b2484['userProfileId']},'raw':!![]})[_0xb757('0x38')](function(_0x353b62){if(_0x353b62&&_0x353b62[_0xb757('0x62')]===0x0){return db[_0xb757('0x3b')]['create']({'name':_0x5af8d2[_0xb757('0x3e')],'resourceId':_0x5af8d2['id'],'type':_0x353b62[_0xb757('0x3e')],'sectionId':_0x353b62['id']},{})[_0xb757('0x38')](function(){return _0x3eeecf;});}else{return _0x3eeecf;}})[_0xb757('0x2f')](function(_0xce6f15){logger[_0xb757('0x2b')](_0xb757('0x63'),_0xce6f15);throw _0xce6f15;});}return _0x3eeecf;})[_0xb757('0x38')](respondWithResult(_0x4a64e8,0xc9))[_0xb757('0x2f')](handleError(_0x4a64e8,null));};exports['update']=function(_0x3457b7,_0x1d7c08){if(_0x3457b7[_0xb757('0x5e')]['id']){delete _0x3457b7[_0xb757('0x5e')]['id'];}return db[_0xb757('0x43')][_0xb757('0x5c')]({'where':{'id':_0x3457b7[_0xb757('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0xb757('0x41')}]})[_0xb757('0x38')](handleEntityNotFound(_0x1d7c08,null))[_0xb757('0x38')](saveUpdates(_0x3457b7[_0xb757('0x5e')],null))[_0xb757('0x38')](respondWithResult(_0x1d7c08,null))[_0xb757('0x2f')](handleError(_0x1d7c08,null));};exports['destroy']=function(_0x3aa308,_0x426674){return db[_0xb757('0x43')]['find']({'where':{'id':_0x3aa308[_0xb757('0x58')]['id']}})[_0xb757('0x38')](handleEntityNotFound(_0x426674,null))[_0xb757('0x38')](removeEntity(_0x426674,null))['catch'](handleError(_0x426674,null));};exports[_0xb757('0x64')]=function(_0x46a739,_0x2b29bc){return db['FaxAccount'][_0xb757('0x64')]()['then'](respondWithResult(_0x2b29bc,null))[_0xb757('0x2f')](handleError(_0x2b29bc,null));};exports[_0xb757('0x65')]=function(_0x2eedc7,_0x28144c,_0x207c34){if(_0x2eedc7['body']['id']){delete _0x2eedc7[_0xb757('0x5e')]['id'];}return db[_0xb757('0x43')]['find']({'where':{'id':_0x2eedc7[_0xb757('0x58')]['id']}})['then'](handleEntityNotFound(_0x28144c,null))[_0xb757('0x38')](function(_0x206e1d){if(_0x206e1d){_0x2eedc7[_0xb757('0x5e')][_0xb757('0x66')]=_0x206e1d['id'];return db[_0xb757('0x67')][_0xb757('0x5d')](_0x2eedc7[_0xb757('0x5e')]);}})[_0xb757('0x38')](respondWithResult(_0x28144c,null))[_0xb757('0x2f')](handleError(_0x28144c,null));};exports[_0xb757('0x68')]=function(_0x5233bb,_0x320e67,_0x18c9f0){var _0x4cff64={'raw':![],'where':{}};var _0x56dab6={};var _0x27b3af={'count':0x0,'rows':[]};return db[_0xb757('0x43')]['findOne']({'where':{'id':_0x5233bb['params']['id']}})[_0xb757('0x38')](handleEntityNotFound(_0x320e67,null))[_0xb757('0x38')](function(_0x57bdc5){if(_0x57bdc5){_0x56dab6[_0xb757('0x49')]=_[_0xb757('0x59')](db[_0xb757('0x67')]['rawAttributes']);_0x56dab6[_0xb757('0x46')]=_['keys'](_0x5233bb[_0xb757('0x46')]);_0x56dab6[_0xb757('0x47')]=_[_0xb757('0x48')](_0x56dab6[_0xb757('0x49')],_0x56dab6[_0xb757('0x46')]);_0x4cff64[_0xb757('0x4a')]=_[_0xb757('0x48')](_0x56dab6[_0xb757('0x49')],qs[_0xb757('0x4b')](_0x5233bb['query'][_0xb757('0x4b')]));_0x4cff64[_0xb757('0x4a')]=_0x4cff64[_0xb757('0x4a')][_0xb757('0x4c')]?_0x4cff64['attributes']:_0x56dab6['model'];if(!_0x5233bb['query'][_0xb757('0x4d')](_0xb757('0x69'))){_0x4cff64[_0xb757('0x34')]=qs[_0xb757('0x34')](_0x5233bb[_0xb757('0x46')][_0xb757('0x34')]);_0x4cff64[_0xb757('0x33')]=qs[_0xb757('0x33')](_0x5233bb['query'][_0xb757('0x33')]);}_0x4cff64[_0xb757('0x6a')]=qs[_0xb757('0x4e')](_0x5233bb[_0xb757('0x46')][_0xb757('0x4e')]);_0x4cff64[_0xb757('0x4f')]=qs['filters'](_[_0xb757('0x6b')](_0x5233bb['query'],_0x56dab6[_0xb757('0x47')]));_0x4cff64[_0xb757('0x4f')]['FaxAccountId']=_0x57bdc5['id'];if(_0x5233bb[_0xb757('0x46')][_0xb757('0x50')]){_0x4cff64['where']=_[_0xb757('0x52')](_0x4cff64[_0xb757('0x4f')],{'$or':_[_0xb757('0x42')](_0x4cff64[_0xb757('0x4a')],function(_0x1f9d91){var _0x3bb1a6={};_0x3bb1a6[_0x1f9d91]={'$like':'%'+_0x5233bb[_0xb757('0x46')][_0xb757('0x50')]+'%'};return _0x3bb1a6;})});}_0x4cff64=_['merge']({},_0x4cff64,_0x5233bb[_0xb757('0x53')]);return db[_0xb757('0x67')][_0xb757('0x32')]({'where':_0x4cff64[_0xb757('0x4f')]})['then'](function(_0x5edff4){_0x27b3af[_0xb757('0x32')]=_0x5edff4;if(_0x5233bb[_0xb757('0x46')][_0xb757('0x5b')]){_0x4cff64[_0xb757('0x54')]=[{'all':!![]}];}return db[_0xb757('0x67')][_0xb757('0x55')](_0x4cff64);})[_0xb757('0x38')](function(_0x3b2454){_0x27b3af['rows']=_0x3b2454;return _0x27b3af;});}})['then'](respondWithFilteredResult(_0x320e67,_0x4cff64))['catch'](handleError(_0x320e67,null));};exports[_0xb757('0x6c')]=function(_0x3053c5,_0x5f3160,_0x574e5e){return db['FaxAccount'][_0xb757('0x5c')]({'where':{'id':_0x3053c5[_0xb757('0x58')]['id']}})[_0xb757('0x38')](handleEntityNotFound(_0x5f3160,null))[_0xb757('0x38')](function(_0x411dd3){if(_0x411dd3){return _0x411dd3[_0xb757('0x6c')](_0x3053c5['query'][_0xb757('0x6d')]);}})[_0xb757('0x38')](respondWithStatusCode(_0x5f3160,null))['catch'](handleError(_0x5f3160,null));};exports[_0xb757('0x6e')]=function(_0x13586d,_0x42d278,_0x4d1256){if(_0x13586d[_0xb757('0x5e')]['id']){delete _0x13586d[_0xb757('0x5e')]['id'];}return db[_0xb757('0x43')][_0xb757('0x5c')]({'where':{'id':_0x13586d[_0xb757('0x58')]['id']}})[_0xb757('0x38')](handleEntityNotFound(_0x42d278,null))[_0xb757('0x38')](function(_0x4b9bf1){if(_0x4b9bf1){_0x13586d['body']['FaxAccountId']=_0x4b9bf1['id'];return db[_0xb757('0x6f')][_0xb757('0x5d')](_0x13586d[_0xb757('0x5e')]);}})[_0xb757('0x38')](respondWithResult(_0x42d278,null))[_0xb757('0x2f')](handleError(_0x42d278,null));};exports[_0xb757('0x70')]=function(_0x3e6034,_0x19c2a0,_0xf8c354){var _0x2d1cbc={'raw':![],'where':{}};var _0x5de7f0={};var _0x14e09a={'count':0x0,'rows':[]};return db['FaxAccount'][_0xb757('0x71')]({'where':{'id':_0x3e6034['params']['id']}})[_0xb757('0x38')](handleEntityNotFound(_0x19c2a0,null))[_0xb757('0x38')](function(_0x337826){if(_0x337826){_0x5de7f0['model']=_[_0xb757('0x59')](db[_0xb757('0x6f')][_0xb757('0x5a')]);_0x5de7f0[_0xb757('0x46')]=_[_0xb757('0x59')](_0x3e6034[_0xb757('0x46')]);_0x5de7f0[_0xb757('0x47')]=_[_0xb757('0x48')](_0x5de7f0[_0xb757('0x49')],_0x5de7f0[_0xb757('0x46')]);_0x2d1cbc[_0xb757('0x4a')]=_[_0xb757('0x48')](_0x5de7f0[_0xb757('0x49')],qs[_0xb757('0x4b')](_0x3e6034[_0xb757('0x46')][_0xb757('0x4b')]));_0x2d1cbc[_0xb757('0x4a')]=_0x2d1cbc[_0xb757('0x4a')][_0xb757('0x4c')]?_0x2d1cbc[_0xb757('0x4a')]:_0x5de7f0[_0xb757('0x49')];if(!_0x3e6034[_0xb757('0x46')][_0xb757('0x4d')]('nolimit')){_0x2d1cbc[_0xb757('0x34')]=qs[_0xb757('0x34')](_0x3e6034[_0xb757('0x46')][_0xb757('0x34')]);_0x2d1cbc[_0xb757('0x33')]=qs['offset'](_0x3e6034[_0xb757('0x46')][_0xb757('0x33')]);}_0x2d1cbc[_0xb757('0x6a')]=qs[_0xb757('0x4e')](_0x3e6034[_0xb757('0x46')]['sort']);_0x2d1cbc[_0xb757('0x4f')]=qs[_0xb757('0x47')](_[_0xb757('0x6b')](_0x3e6034[_0xb757('0x46')],_0x5de7f0[_0xb757('0x47')]));_0x2d1cbc[_0xb757('0x4f')]['FaxAccountId']=_0x337826['id'];if(_0x3e6034[_0xb757('0x46')]['filter']){_0x2d1cbc[_0xb757('0x4f')]=_['merge'](_0x2d1cbc[_0xb757('0x4f')],{'$or':_[_0xb757('0x42')](_0x2d1cbc[_0xb757('0x4a')],function(_0x4da9b7){var _0x181fa8={};_0x181fa8[_0x4da9b7]={'$like':'%'+_0x3e6034[_0xb757('0x46')][_0xb757('0x50')]+'%'};return _0x181fa8;})});}_0x2d1cbc=_[_0xb757('0x52')]({},_0x2d1cbc,_0x3e6034[_0xb757('0x53')]);return db[_0xb757('0x6f')][_0xb757('0x32')]({'where':_0x2d1cbc['where']})[_0xb757('0x38')](function(_0x2725f9){_0x14e09a[_0xb757('0x32')]=_0x2725f9;if(_0x3e6034['query'][_0xb757('0x5b')]){_0x2d1cbc[_0xb757('0x54')]=[{'all':!![]}];}return db[_0xb757('0x6f')][_0xb757('0x55')](_0x2d1cbc);})[_0xb757('0x38')](function(_0x1fa915){_0x14e09a['rows']=_0x1fa915;return _0x14e09a;});}})[_0xb757('0x38')](respondWithFilteredResult(_0x19c2a0,_0x2d1cbc))[_0xb757('0x2f')](handleError(_0x19c2a0,null));};exports[_0xb757('0x72')]=function(_0x35895e,_0x2fb969,_0x307266){return db[_0xb757('0x43')][_0xb757('0x5c')]({'where':{'id':_0x35895e[_0xb757('0x58')]['id']}})[_0xb757('0x38')](handleEntityNotFound(_0x2fb969,null))[_0xb757('0x38')](function(_0x52a87b){if(_0x52a87b){return _0x52a87b[_0xb757('0x72')](_0x35895e[_0xb757('0x46')][_0xb757('0x6d')]);}})['then'](respondWithStatusCode(_0x2fb969,null))[_0xb757('0x2f')](handleError(_0x2fb969,null));};exports[_0xb757('0x73')]=function(_0x1fc993,_0x25ea97,_0xbfde8b){return db['FaxInteraction'][_0xb757('0x5c')]({'where':{'id':_0x1fc993[_0xb757('0x58')]['id']}})[_0xb757('0x38')](handleEntityNotFound(_0x25ea97,null))['then'](function(_0x10c05b){if(_0x10c05b){return _0x10c05b[_0xb757('0x73')](_0x1fc993['body'][_0xb757('0x6d')],_['omit'](_0x1fc993[_0xb757('0x5e')],[_0xb757('0x6d'),'id'])||{});}})[_0xb757('0x38')](respondWithResult(_0x25ea97,null))[_0xb757('0x2f')](handleError(_0x25ea97,null));};exports[_0xb757('0x74')]=function(_0x5c2c9d,_0x140077,_0x5b4aef){var _0x43369f={'raw':![],'where':{}};var _0x28137b={};var _0x474a98={'count':0x0,'rows':[]};return db[_0xb757('0x43')]['findOne']({'where':{'id':_0x5c2c9d[_0xb757('0x58')]['id']}})[_0xb757('0x38')](handleEntityNotFound(_0x140077,null))['then'](function(_0xa6857a){if(_0xa6857a){_0x28137b[_0xb757('0x49')]=_[_0xb757('0x59')](db[_0xb757('0x75')][_0xb757('0x5a')]);_0x28137b[_0xb757('0x46')]=_[_0xb757('0x59')](_0x5c2c9d[_0xb757('0x46')]);_0x28137b[_0xb757('0x47')]=_[_0xb757('0x48')](_0x28137b['model'],_0x28137b[_0xb757('0x46')]);_0x43369f[_0xb757('0x4a')]=_[_0xb757('0x48')](_0x28137b[_0xb757('0x49')],qs[_0xb757('0x4b')](_0x5c2c9d[_0xb757('0x46')][_0xb757('0x4b')]));_0x43369f['attributes']=_0x43369f[_0xb757('0x4a')]['length']?_0x43369f[_0xb757('0x4a')]:_0x28137b[_0xb757('0x49')];if(!_0x5c2c9d[_0xb757('0x46')][_0xb757('0x4d')](_0xb757('0x69'))){_0x43369f[_0xb757('0x34')]=qs[_0xb757('0x34')](_0x5c2c9d['query'][_0xb757('0x34')]);_0x43369f[_0xb757('0x33')]=qs[_0xb757('0x33')](_0x5c2c9d['query'][_0xb757('0x33')]);}_0x43369f['order']=qs[_0xb757('0x4e')](_0x5c2c9d[_0xb757('0x46')][_0xb757('0x4e')]);_0x43369f['where']=qs[_0xb757('0x47')](_['pick'](_0x5c2c9d[_0xb757('0x46')],_0x28137b[_0xb757('0x47')]));_0x43369f[_0xb757('0x4f')]['FaxAccountId']=_0xa6857a['id'];if(_0x5c2c9d['query']['filter']){_0x43369f[_0xb757('0x4f')]=_[_0xb757('0x52')](_0x43369f['where'],{'$or':_[_0xb757('0x42')](_0x43369f[_0xb757('0x4a')],function(_0x52bf25){var _0x5294eb={};_0x5294eb[_0x52bf25]={'$like':'%'+_0x5c2c9d['query'][_0xb757('0x50')]+'%'};return _0x5294eb;})});}_0x43369f=_['merge']({},_0x43369f,_0x5c2c9d[_0xb757('0x53')]);return db[_0xb757('0x75')]['count']({'where':_0x43369f[_0xb757('0x4f')]})['then'](function(_0x540227){_0x474a98[_0xb757('0x32')]=_0x540227;if(_0x5c2c9d[_0xb757('0x46')][_0xb757('0x5b')]){_0x43369f['include']=[{'model':db[_0xb757('0x76')],'as':_0xb757('0x77'),'required':![]},{'model':db[_0xb757('0x78')],'as':_0xb757('0x79'),'attributes':[_0xb757('0x3e'),'fullname','internal'],'required':![]},{'model':db[_0xb757('0x7a')],'as':_0xb757('0x7b'),'attributes':['id','name','color'],'where':_0x5c2c9d[_0xb757('0x46')]['tag']?{'id':_0x5c2c9d[_0xb757('0x46')][_0xb757('0x7c')]}:undefined,'required':_0x5c2c9d[_0xb757('0x46')][_0xb757('0x7c')]?!![]:![]}];}return db[_0xb757('0x75')][_0xb757('0x55')](_0x43369f);})[_0xb757('0x38')](function(_0x5006eb){_0x474a98[_0xb757('0x56')]=_0x5006eb;return _0x474a98;});}})[_0xb757('0x38')](respondWithFilteredResult(_0x140077,_0x43369f))[_0xb757('0x2f')](handleError(_0x140077,null));};exports[_0xb757('0x7d')]=function(_0x5518f7,_0x33f54f,_0x1d725a){return db['FaxAccount']['findOne']({'where':{'id':_0x5518f7[_0xb757('0x58')]['id']}})[_0xb757('0x38')](handleEntityNotFound(_0x33f54f,null))[_0xb757('0x38')](function(_0x24126){if(_0x24126){return db[_0xb757('0x7e')][_0xb757('0x7f')](function(_0x4f8d1f){return db[_0xb757('0x80')]['destroy']({'where':{'FaxAccountId':_0x5518f7[_0xb757('0x58')]['id']},'transaction':_0x4f8d1f})[_0xb757('0x38')](function(_0x42f366){var _0x173f1d=_[_0xb757('0x42')](_0x5518f7[_0xb757('0x5e')],function(_0x1a2f3f){_0x1a2f3f[_0xb757('0x66')]=_0x5518f7['params']['id'];return _0x1a2f3f;});return db[_0xb757('0x80')][_0xb757('0x81')](_0x173f1d,{'transaction':_0x4f8d1f});});})[_0xb757('0x38')](function(){return db[_0xb757('0x80')][_0xb757('0x82')]({'where':{'FaxAccountId':_0x5518f7[_0xb757('0x58')]['id']},'order':_0xb757('0x83')});});}})[_0xb757('0x38')](respondWithResult(_0x33f54f,null))[_0xb757('0x2f')](handleError(_0x33f54f,null));};exports[_0xb757('0x84')]=function(_0x340c46,_0x20127c,_0x2cb65c){var _0x46ced1={};var _0x2d6fef={};var _0x14571a;var _0x57646d;return db['FaxAccount']['findOne']({'where':{'id':_0x340c46[_0xb757('0x58')]['id']}})[_0xb757('0x38')](handleEntityNotFound(_0x20127c,null))[_0xb757('0x38')](function(_0x423524){if(_0x423524){_0x14571a=_0x423524;_0x2d6fef[_0xb757('0x49')]=_['keys'](db['FaxApplication']['rawAttributes']);_0x2d6fef[_0xb757('0x46')]=_[_0xb757('0x59')](_0x340c46[_0xb757('0x46')]);_0x2d6fef[_0xb757('0x47')]=_['intersection'](_0x2d6fef[_0xb757('0x49')],_0x2d6fef[_0xb757('0x46')]);_0x46ced1[_0xb757('0x4a')]=_['intersection'](_0x2d6fef[_0xb757('0x49')],qs['fields'](_0x340c46['query'][_0xb757('0x4b')]));_0x46ced1[_0xb757('0x4a')]=_0x46ced1['attributes'][_0xb757('0x4c')]?_0x46ced1[_0xb757('0x4a')]:_0x2d6fef['model'];_0x46ced1[_0xb757('0x6a')]=qs[_0xb757('0x4e')](_0x340c46[_0xb757('0x46')][_0xb757('0x4e')]);_0x46ced1['where']=qs[_0xb757('0x47')](_[_0xb757('0x6b')](_0x340c46['query'],_0x2d6fef['filters']));if(_0x340c46['query'][_0xb757('0x50')]){_0x46ced1[_0xb757('0x4f')]=_['merge'](_0x46ced1[_0xb757('0x4f')],{'$or':_[_0xb757('0x42')](_0x46ced1[_0xb757('0x4a')],function(_0x1c0b60){var _0xe00001={};_0xe00001[_0x1c0b60]={'$like':'%'+_0x340c46[_0xb757('0x46')][_0xb757('0x50')]+'%'};return _0xe00001;})});}_0x46ced1=_[_0xb757('0x52')]({},_0x46ced1,_0x340c46['options']);return _0x14571a[_0xb757('0x84')](_0x46ced1);}})[_0xb757('0x38')](function(_0x593ebd){if(_0x593ebd){_0x57646d=_0x593ebd[_0xb757('0x4c')];if(!_0x340c46[_0xb757('0x46')]['hasOwnProperty'](_0xb757('0x69'))){_0x46ced1[_0xb757('0x34')]=qs['limit'](_0x340c46[_0xb757('0x46')][_0xb757('0x34')]);_0x46ced1['offset']=qs[_0xb757('0x33')](_0x340c46[_0xb757('0x46')][_0xb757('0x33')]);}return _0x14571a[_0xb757('0x84')](_0x46ced1);}})[_0xb757('0x38')](function(_0xcd614c){if(_0xcd614c){return _0xcd614c?{'count':_0x57646d,'rows':_0xcd614c}:null;}})['then'](respondWithResult(_0x20127c,null))[_0xb757('0x2f')](handleError(_0x20127c,null));};function Extension(_0x16d8fb,_0x37a921,_0x5a1d8a,_0x2ffcf4){this[_0xb757('0x85')]=_0xb757('0x86');this[_0xb757('0x87')]=_0x16d8fb['localstationid'];this[_0xb757('0x88')]=_0x2ffcf4;this[_0xb757('0x44')]=_0xb757('0x89');this[_0xb757('0x8a')]=_0xb757('0x8b');this['FaxAccountId']=_0x16d8fb['id'];this[_0xb757('0x83')]=_0x37a921;this[_0xb757('0x8c')]=_0x5a1d8a;}function createExtensionsReciveFax(_0x1f0157){var _0x4d171f=0x1;var _0x1e3d37=[];_0x1e3d37[_0xb757('0x8d')](new Extension(_0x1f0157,_0x4d171f,'',_0xb757('0x8e')));_0x4d171f+=0x1;_0x1e3d37['push'](new Extension(_0x1f0157,_0x4d171f,'CDR(type)=inbound-fax','Set'));_0x4d171f+=0x1;for(var _0x1b2475 in _0x1f0157){if(_0x1f0157[_0xb757('0x4d')](_0x1b2475)&&(_0x1b2475==='ecm'||_0x1b2475===_0xb757('0x8f')||_0x1b2475===_0xb757('0x90')||_0x1b2475==='faxdetect'||_0x1b2475==='headerinfo'||_0x1b2475===_0xb757('0x91')||_0x1b2475===_0xb757('0x92')||_0x1b2475===_0xb757('0x93')||_0x1b2475===_0xb757('0x94'))){_0x1e3d37[_0xb757('0x8d')](new Extension(_0x1f0157,_0x4d171f,_0xb757('0x95')+_0x1b2475+')='+_0x1f0157[_0x1b2475],_0xb757('0x96')));_0x4d171f+=0x1;}}_0x1e3d37[_0xb757('0x8d')](new Extension(_0x1f0157,_0x4d171f,'6',_0xb757('0x97')));_0x4d171f+=0x1;_0x1e3d37[_0xb757('0x8d')](new Extension(_0x1f0157,_0x4d171f,'/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',_0xb757('0x98')));_0x4d171f=0x0;return _0x1e3d37;}exports[_0xb757('0x99')]=function(_0x27c1de,_0x447753,_0x28e3c8){var _0x2e6f9e;return db['sequelize'][_0xb757('0x7f')](function(_0x1f45d8){return db[_0xb757('0x43')][_0xb757('0x5d')](_0x27c1de['body'],{'transaction':_0x1f45d8})[_0xb757('0x38')](function(_0x654d80){_0x2e6f9e=_0x654d80[_0xb757('0x39')]({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x2e6f9e),{'transaction':_0x1f45d8});});})[_0xb757('0x38')](function(){return _0x2e6f9e;})[_0xb757('0x38')](respondWithResult(_0x447753,null))[_0xb757('0x2f')](handleError(_0x447753,null));};exports['updateAccountApplications']=function(_0x21d208,_0x2ea0ae,_0x48fc16){var _0xa75d1f;return db[_0xb757('0x7e')]['transaction'](function(_0x57065e){return db['FaxAccount'][_0xb757('0x9a')](_0x21d208[_0xb757('0x5e')],{'where':{'id':_0x21d208[_0xb757('0x5e')]['id']},'transaction':_0x57065e})[_0xb757('0x38')](function(_0xdcbf56){return db['VoiceExtension'][_0xb757('0x3c')]({'where':{'FaxAccountId':_0x21d208[_0xb757('0x5e')]['id']},'transaction':_0x57065e})[_0xb757('0x38')](function(_0x5f06fd){return db[_0xb757('0x9b')]['bulkCreate'](createExtensionsReciveFax(_[_0xb757('0x9c')](_0x21d208['body'],['tech',_0xb757('0x45'),_0xb757('0x9d'),_0xb757('0x9e'),_0xb757('0x9f'),_0xb757('0xa0')])),{'transaction':_0x57065e});});});})[_0xb757('0x38')](function(){return db[_0xb757('0x43')][_0xb757('0xa1')](_0x21d208[_0xb757('0x5e')]['id']);})[_0xb757('0x38')](respondWithResult(_0x2ea0ae,null))[_0xb757('0x2f')](handleError(_0x2ea0ae,null));};exports['getMessages']=function(_0x4752a1,_0x42bae5,_0x915201){var _0xb992f6={'raw':!![],'where':{}};var _0x5936b6={};var _0x39850a={'count':0x0,'rows':[]};return db[_0xb757('0x43')][_0xb757('0x71')]({'where':{'id':_0x4752a1[_0xb757('0x58')]['id']}})['then'](handleEntityNotFound(_0x42bae5,null))[_0xb757('0x38')](function(_0x909942){if(_0x909942){_0x5936b6[_0xb757('0x49')]=_[_0xb757('0x59')](db[_0xb757('0xa2')][_0xb757('0x5a')]);_0x5936b6['query']=_[_0xb757('0x59')](_0x4752a1[_0xb757('0x46')]);_0x5936b6[_0xb757('0x47')]=_['intersection'](_0x5936b6['model'],_0x5936b6[_0xb757('0x46')]);_0xb992f6['attributes']=_[_0xb757('0x48')](_0x5936b6[_0xb757('0x49')],qs['fields'](_0x4752a1['query'][_0xb757('0x4b')]));_0xb992f6[_0xb757('0x4a')]=_0xb992f6[_0xb757('0x4a')][_0xb757('0x4c')]?_0xb992f6[_0xb757('0x4a')]:_0x5936b6[_0xb757('0x49')];if(!_0x4752a1[_0xb757('0x46')]['hasOwnProperty']('nolimit')){_0xb992f6[_0xb757('0x34')]=qs[_0xb757('0x34')](_0x4752a1[_0xb757('0x46')][_0xb757('0x34')]);_0xb992f6['offset']=qs['offset'](_0x4752a1['query'][_0xb757('0x33')]);}_0xb992f6['order']=qs[_0xb757('0x4e')](_0x4752a1[_0xb757('0x46')][_0xb757('0x4e')]);_0xb992f6['where']=qs[_0xb757('0x47')](_[_0xb757('0x6b')](_0x4752a1['query'],_0x5936b6[_0xb757('0x47')]));_0xb992f6[_0xb757('0x4f')][_0xb757('0x66')]=_0x909942['id'];if(_0x4752a1[_0xb757('0x46')][_0xb757('0x50')]){_0xb992f6[_0xb757('0x4f')]=_[_0xb757('0x52')](_0xb992f6[_0xb757('0x4f')],{'$or':_[_0xb757('0x42')](_0xb992f6[_0xb757('0x4a')],function(_0x4ce92b){var _0x190e35={};_0x190e35[_0x4ce92b]={'$like':'%'+_0x4752a1[_0xb757('0x46')]['filter']+'%'};return _0x190e35;})});}if(_0x4752a1[_0xb757('0x46')]['$gte']){var _0x39bbf9=_0x4752a1[_0xb757('0x46')][_0xb757('0xa3')][_0xb757('0xa4')](',');var _0xf973d={};_0xf973d[_0x39bbf9[0x0]]={'$gte':moment(_0x39bbf9[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0xb992f6[_0xb757('0x4f')]=_[_0xb757('0x52')](_0xb992f6[_0xb757('0x4f')],_0xf973d);}_0xb992f6=_[_0xb757('0x52')]({},_0xb992f6,_0x4752a1[_0xb757('0x53')]);return db[_0xb757('0xa2')]['count']({'where':_0xb992f6[_0xb757('0x4f')]})['then'](function(_0x1ebc45){_0x39850a[_0xb757('0x32')]=_0x1ebc45;if(_0x4752a1[_0xb757('0x46')][_0xb757('0x5b')]){_0xb992f6[_0xb757('0x54')]=[{'all':!![]}];}return db[_0xb757('0xa2')][_0xb757('0x55')](_0xb992f6);})[_0xb757('0x38')](function(_0x2fe46e){_0x39850a[_0xb757('0x56')]=_0x2fe46e;return _0x39850a;});}})[_0xb757('0x38')](respondWithFilteredResult(_0x42bae5,_0xb992f6))[_0xb757('0x2f')](handleError(_0x42bae5,null));};exports[_0xb757('0xa5')]=function(_0x4d5174,_0x4782dc,_0x25acf4){var _0x4ec065,_0x1d5c1e={},_0x2749c0;if(_0x4d5174[_0xb757('0x5e')]['to']){_0x2749c0=_0x4d5174[_0xb757('0x5e')]['to'][0x0];}return db['FaxAccount'][_0xb757('0x5c')]({'where':{'id':_0x4d5174[_0xb757('0x58')]['id']},'include':[{'model':db[_0xb757('0xa6')],'as':_0xb757('0xa7'),'include':[{'model':db['CmContact'],'as':_0xb757('0xa8'),'where':{'fax':_0x2749c0},'limit':0x1,'order':[[_0xb757('0x9e'),_0xb757('0xa9')]]}]}]})['then'](handleEntityNotFound(_0x4782dc,null))[_0xb757('0x38')](function(_0xbf4a72){_0x4ec065=_0xbf4a72;if(_0x4d5174['body'][_0xb757('0xaa')]&&_0x4d5174['body'][_0xb757('0xaa')][_0xb757('0x4c')]){for(var _0x288eb6=0x0;_0x288eb6<_0x4d5174[_0xb757('0x5e')][_0xb757('0xaa')]['length'];_0x288eb6+=0x1){_0x4d5174[_0xb757('0x5e')]['attachments'][_0x288eb6]={'filename':_0x4d5174[_0xb757('0x5e')][_0xb757('0xaa')][_0x288eb6][_0xb757('0x3e')],'id':_0x4d5174[_0xb757('0x5e')][_0xb757('0xaa')][_0x288eb6]['id'],'path':path[_0xb757('0xab')](config[_0xb757('0xac')],_0xb757('0xad'),_0x4d5174[_0xb757('0x5e')][_0xb757('0xaa')][_0x288eb6][_0xb757('0xae')])};}}return respondWithRpcPromise(_0xb757('0xaf'),'CheckAfterSend',{'FaxAccountId':_[_0xb757('0xb0')](_0x4d5174[_0xb757('0x58')]['id'])?undefined:_0x4d5174['params']['id'],'path':_[_0xb757('0xb0')](_0x4d5174[_0xb757('0x5e')]['attachments'][0x0][_0xb757('0x6')])?undefined:_0x4d5174[_0xb757('0x5e')]['attachments'][0x0][_0xb757('0x6')],'fax':_[_0xb757('0xb0')](_0x4d5174[_0xb757('0x5e')]['to'][0x0])?undefined:_0x4d5174[_0xb757('0x5e')]['to'][0x0]},client9002);})['then'](function(){if(_0x4ec065){if(_[_0xb757('0xb0')](_0x4d5174[_0xb757('0x5e')][_0xb757('0xb1')])){_0x4d5174[_0xb757('0x5e')][_0xb757('0xb1')]=util[_0xb757('0xb2')](_0xb757('0xb3'),_0x4ec065[_0xb757('0x3e')],_0x4ec065['fax']);}if(_0x4ec065[_0xb757('0xa7')]){if(_0x4ec065[_0xb757('0xa7')]['Contacts'][_0xb757('0x4c')]){return _0x4ec065[_0xb757('0xa7')][_0xb757('0xa8')][0x0];}else{return db['CmContact'][_0xb757('0x5d')](_['defaults'](_0x4d5174[_0xb757('0x5e')],{'firstName':_0x4d5174[_0xb757('0x5e')]['to'][0x0],'phone':_0x4d5174[_0xb757('0x5e')]['to'][0x0],'fax':_0x4d5174['body']['to'][0x0],'ListId':_0x4ec065[_0xb757('0xa0')]}));}}else{throw new Error(_0xb757('0xb4'));}}else{throw new Error(_0xb757('0xb5'));}})[_0xb757('0x38')](function(_0x1106b4){if(_0x1106b4){return db[_0xb757('0x75')][_0xb757('0x5c')]({'where':{'ContactId':_0x1106b4['id'],'closed':![],'FaxAccountId':_0x4ec065['id']}})[_0xb757('0x38')](function(_0x32bb01){if(_0x32bb01){return[_0x32bb01,![]];}return db[_0xb757('0x75')]['create']({'UserId':_0x4d5174[_0xb757('0x5f')]['id'],'ContactId':_0x1106b4['id'],'FaxAccountId':_0x4ec065['id'],'fax':_0x4d5174[_0xb757('0x5e')]['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x4d5174[_0xb757('0x5e')],{'read':![],'body':_0x4d5174[_0xb757('0x5e')][_0xb757('0xaa')][0x0][_0xb757('0xb6')],'FaxAccountId':_0x4ec065['id'],'UserId':_0x4d5174[_0xb757('0x5f')]['id'],'ContactId':_0x1106b4['id'],'AttachmentId':_0x4d5174[_0xb757('0x5e')][_0xb757('0xaa')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xb757('0xb7')}]})['then'](function(_0x5f0dcf){return[_0x5f0dcf,!![]];});});}else{throw new Error(_0xb757('0xb8'));}})[_0xb757('0xb9')](function(_0x5e6858,_0x13118f){if(_0x13118f){return _0x5e6858;}return db[_0xb757('0xa2')][_0xb757('0x5d')]({'direction':_0xb757('0xba'),'read':![],'body':_0x4d5174[_0xb757('0x5e')]['attachments'][0x0][_0xb757('0xb6')],'FaxAccountId':_0x4ec065['id'],'FaxInteractionId':_0x5e6858['id'],'UserId':_0x4d5174[_0xb757('0x5f')]['id'],'ContactId':_0x5e6858[_0xb757('0xbb')],'AttachmentId':_0x4d5174[_0xb757('0x5e')][_0xb757('0xaa')][0x0]['id']})[_0xb757('0x38')](function(_0x495ef5){_0x5e6858['dataValues'][_0xb757('0xb7')]=[];_0x5e6858[_0xb757('0xbc')][_0xb757('0xb7')][_0xb757('0x8d')](_0x495ef5[_0xb757('0xbc')]);return _0x5e6858;});})[_0xb757('0x38')](function(_0x529cf7){respondWithRpcPromise(_0xb757('0xbd'),_0xb757('0xbd'),{'FaxAccountId':_['isNil'](_0x4d5174['params']['id'])?undefined:_0x4d5174['params']['id'],'path':_[_0xb757('0xb0')](_0x4d5174['body']['attachments'][0x0][_0xb757('0x6')])?undefined:_0x4d5174['body'][_0xb757('0xaa')][0x0]['path'],'fax':_['isNil'](_0x4d5174[_0xb757('0x5e')]['to'][0x0])?undefined:_0x4d5174[_0xb757('0x5e')]['to'][0x0],'AttachmentId':_0x4d5174[_0xb757('0x5e')]['attachments'][0x0]['id']},client9002)[_0xb757('0x38')](function(_0x33f33e){logger[_0xb757('0x25')](_0xb757('0xbe'),_0x33f33e);})[_0xb757('0x2f')](function(_0x6ff73f){logger[_0xb757('0x25')]('SendFaxRpc,\x20%s',_0x6ff73f);});return _0x529cf7;})[_0xb757('0x38')](respondWithResult(_0x4782dc,null))[_0xb757('0x2f')](handleError(_0x4782dc,null));};exports['addAgents']=function(_0x1fb737,_0x5072a3,_0x1d20bd){return db[_0xb757('0x43')]['find']({'where':{'id':_0x1fb737[_0xb757('0x58')]['id']}})[_0xb757('0x38')](handleEntityNotFound(_0x5072a3,null))['then'](function(_0x4f686d){if(_0x4f686d){return _0x4f686d[_0xb757('0xbf')](_0x1fb737[_0xb757('0x5e')][_0xb757('0x6d')],_[_0xb757('0x9c')](_0x1fb737[_0xb757('0x5e')],[_0xb757('0x6d'),'id'])||{})['spread'](function(_0x28cdbc){for(var _0x43a486=0x0;_0x43a486<_0x1fb737[_0xb757('0x5e')][_0xb757('0x6d')][_0xb757('0x4c')];_0x43a486+=0x1){socket['emit'](_0xb757('0xc0'),{'UserId':_0x1fb737[_0xb757('0x5e')]['ids'][_0x43a486],'FaxAccountId':_0x1fb737['params']['id']});}return _0x28cdbc;});}})[_0xb757('0x38')](respondWithResult(_0x5072a3,null))[_0xb757('0x2f')](handleError(_0x5072a3,null));};exports[_0xb757('0xc1')]=function(_0x3b5273,_0x19be21,_0x2e6445){return db['FaxAccount']['find']({'where':{'id':_0x3b5273[_0xb757('0x58')]['id']}})[_0xb757('0x38')](handleEntityNotFound(_0x19be21,null))['then'](function(_0x30dd1e){if(_0x30dd1e){return _0x30dd1e[_0xb757('0xc1')](_0x3b5273[_0xb757('0x46')][_0xb757('0x6d')])[_0xb757('0x38')](function(){if(_['isArray'](_0x3b5273[_0xb757('0x46')][_0xb757('0x6d')])){for(var _0x1e8e02=0x0;_0x1e8e02<_0x3b5273['query'][_0xb757('0x6d')][_0xb757('0x4c')];_0x1e8e02+=0x1){socket[_0xb757('0xc2')](_0xb757('0xc3'),{'UserId':Number(_0x3b5273[_0xb757('0x46')]['ids'][_0x1e8e02]),'FaxAccountId':Number(_0x3b5273[_0xb757('0x58')]['id'])});}}else{socket[_0xb757('0xc2')](_0xb757('0xc3'),{'UserId':Number(_0x3b5273['query'][_0xb757('0x6d')]),'FaxAccountId':Number(_0x3b5273[_0xb757('0x58')]['id'])});}});}})[_0xb757('0x38')](respondWithStatusCode(_0x19be21,null))['catch'](handleError(_0x19be21,null));};exports['getAgents']=function(_0x570cf1,_0x5b6e23,_0x469485){var _0x17e6a8={};var _0x4ec41d={};var _0x1e502d;var _0x5d3ed2;return db[_0xb757('0x43')][_0xb757('0x71')]({'where':{'id':_0x570cf1[_0xb757('0x58')]['id']}})[_0xb757('0x38')](handleEntityNotFound(_0x5b6e23,null))[_0xb757('0x38')](function(_0x5ee199){if(_0x5ee199){_0x1e502d=_0x5ee199;_0x4ec41d[_0xb757('0x49')]=_[_0xb757('0x59')](db[_0xb757('0x78')][_0xb757('0x5a')]);_0x4ec41d[_0xb757('0x46')]=_[_0xb757('0x59')](_0x570cf1[_0xb757('0x46')]);_0x4ec41d['filters']=_[_0xb757('0x48')](_0x4ec41d[_0xb757('0x49')],_0x4ec41d[_0xb757('0x46')]);_0x17e6a8[_0xb757('0x4a')]=_[_0xb757('0x48')](_0x4ec41d[_0xb757('0x49')],qs[_0xb757('0x4b')](_0x570cf1[_0xb757('0x46')][_0xb757('0x4b')]));_0x17e6a8[_0xb757('0x4a')]=_0x17e6a8[_0xb757('0x4a')][_0xb757('0x4c')]?_0x17e6a8[_0xb757('0x4a')]:_0x4ec41d[_0xb757('0x49')];_0x17e6a8[_0xb757('0x6a')]=qs[_0xb757('0x4e')](_0x570cf1['query'][_0xb757('0x4e')]);_0x17e6a8[_0xb757('0x4f')]=qs[_0xb757('0x47')](_[_0xb757('0x6b')](_0x570cf1['query'],_0x4ec41d['filters']));if(_0x570cf1[_0xb757('0x46')][_0xb757('0x50')]){_0x17e6a8[_0xb757('0x4f')]=_['merge'](_0x17e6a8[_0xb757('0x4f')],{'$or':_[_0xb757('0x42')](_0x17e6a8[_0xb757('0x4a')],function(_0x4df962){var _0x173d43={};_0x173d43[_0x4df962]={'$like':'%'+_0x570cf1['query'][_0xb757('0x50')]+'%'};return _0x173d43;})});}_0x17e6a8=_[_0xb757('0x52')]({},_0x17e6a8,_0x570cf1['options']);return _0x1e502d[_0xb757('0xc4')](_0x17e6a8);}})[_0xb757('0x38')](function(_0x5cf08f){if(_0x5cf08f){_0x5d3ed2=_0x5cf08f[_0xb757('0x4c')];if(!_0x570cf1[_0xb757('0x46')][_0xb757('0x4d')]('nolimit')){_0x17e6a8[_0xb757('0x34')]=qs['limit'](_0x570cf1[_0xb757('0x46')]['limit']);_0x17e6a8[_0xb757('0x33')]=qs[_0xb757('0x33')](_0x570cf1[_0xb757('0x46')][_0xb757('0x33')]);}return _0x1e502d[_0xb757('0xc4')](_0x17e6a8);}})[_0xb757('0x38')](function(_0x507a76){if(_0x507a76){return _0x507a76?{'count':_0x5d3ed2,'rows':_0x507a76}:null;}})[_0xb757('0x38')](respondWithResult(_0x5b6e23,null))['catch'](handleError(_0x5b6e23,null));}; \ No newline at end of file +var _0x13fe=['limit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','show','params','rawAttributes','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','order','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','User','Owner','internal','Tag','color','tag','addApplications','sequelize','transaction','FaxApplication','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','description','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','maxrate','minrate','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','updateAccountApplications','VoiceExtension','bulkCreate','updatedAt','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','jayson/promise','client','http','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','catch','end','status','json','count','offset','set','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x3292ce,_0x29179a){var _0x392f5b=function(_0x1b88e4){while(--_0x1b88e4){_0x3292ce['push'](_0x3292ce['shift']());}};_0x392f5b(++_0x29179a);}(_0x13fe,0x138));var _0xe13f=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x13fe[_0x6131cd];return _0x47e916;};'use strict';var pdf=require(_0xe13f('0x0'));var emlformat=require(_0xe13f('0x1'));var rimraf=require(_0xe13f('0x2'));var zipdir=require(_0xe13f('0x3'));var jsonpatch=require(_0xe13f('0x4'));var rp=require(_0xe13f('0x5'));var moment=require('moment');var BPromise=require(_0xe13f('0x6'));var Mustache=require(_0xe13f('0x7'));var util=require(_0xe13f('0x8'));var path=require(_0xe13f('0x9'));var sox=require(_0xe13f('0xa'));var csv=require(_0xe13f('0xb'));var ejs=require(_0xe13f('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe13f('0xd'));var jsforce=require(_0xe13f('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe13f('0xf'));var Papa=require(_0xe13f('0x10'));var Redis=require('ioredis');var authService=require(_0xe13f('0x11'));var qs=require(_0xe13f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe13f('0x13'))(_0xe13f('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xe13f('0x15'))['db'];config[_0xe13f('0x16')]=_[_0xe13f('0x17')](config[_0xe13f('0x16')],{'host':_0xe13f('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe13f('0x16')]));require(_0xe13f('0x19'))['register'](socket);var jayson=require(_0xe13f('0x1a'));var client=jayson[_0xe13f('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0xe13f('0x1b')][_0xe13f('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x2f1f4f,_0x474730,_0x398c2e){if(_0x398c2e){var _0x196080=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x196080['test'](_0x474730)){return _0x2f1f4f;}else{throw new db[(_0xe13f('0x1d'))]['ValidationError'](_0xe13f('0x1e'));}}else{return _0x2f1f4f;}}function respondWithRpcPromise(_0x4b5697,_0x28770d,_0x5b01d7,_0x39852b){return new BPromise(function(_0x3f4c0b,_0x1e3a7b){var _0x16968f=_0x39852b||client;return _0x16968f[_0xe13f('0x1f')](_0x4b5697,_0x5b01d7)[_0xe13f('0x20')](function(_0x27cf79){logger[_0xe13f('0x21')]('FaxAccount,\x20%s,\x20%s',_0x28770d,'request\x20sent');logger[_0xe13f('0x22')](_0xe13f('0x23'),_0x28770d,_0xe13f('0x24'),JSON[_0xe13f('0x25')](_0x27cf79));if(_0x27cf79[_0xe13f('0x26')]){if(_0x27cf79[_0xe13f('0x26')][_0xe13f('0x27')]===0x1f4){logger['error'](_0xe13f('0x28'),_0x28770d,_0x27cf79[_0xe13f('0x26')][_0xe13f('0x29')]);return _0x1e3a7b(_0x27cf79[_0xe13f('0x26')][_0xe13f('0x29')]);}logger[_0xe13f('0x26')]('FaxAccount,\x20%s,\x20%s',_0x28770d,_0x27cf79[_0xe13f('0x26')][_0xe13f('0x29')]);return _0x3f4c0b(_0x27cf79[_0xe13f('0x26')][_0xe13f('0x29')]);}else{logger['info'](_0xe13f('0x28'),_0x28770d,_0xe13f('0x24'));_0x3f4c0b(_0x27cf79['result']['message']);}})[_0xe13f('0x2a')](function(_0x2ae303){logger[_0xe13f('0x26')](_0xe13f('0x28'),_0x28770d,_0x2ae303);_0x1e3a7b(_0x2ae303);});});}function respondWithStatusCode(_0x213480,_0x1d6dab){_0x1d6dab=_0x1d6dab||0xcc;return function(_0x479981){if(_0x479981){return _0x213480['sendStatus'](_0x1d6dab);}return _0x213480['status'](_0x1d6dab)[_0xe13f('0x2b')]();};}function respondWithResult(_0x1b4f4f,_0x1bf59c){_0x1bf59c=_0x1bf59c||0xc8;return function(_0x1d6ec8){if(_0x1d6ec8){return _0x1b4f4f[_0xe13f('0x2c')](_0x1bf59c)[_0xe13f('0x2d')](_0x1d6ec8);}};}function respondWithFilteredResult(_0x30f0ac,_0x2b607f){return function(_0x7053ff){if(_0x7053ff){var _0x156cbd=_0x7053ff[_0xe13f('0x2e')],_0x33a373=_0x2b607f[_0xe13f('0x2f')],_0x58abe7=_0x2b607f['offset']+_0x2b607f['limit'],_0x3f9cf9;if(_0x58abe7>=_0x156cbd){_0x58abe7=_0x156cbd;_0x3f9cf9=0xc8;}else{_0x3f9cf9=0xce;}_0x30f0ac[_0xe13f('0x2c')](_0x3f9cf9);return _0x30f0ac[_0xe13f('0x30')]('Content-Range',_0x33a373+'-'+_0x58abe7+'/'+_0x156cbd)['json'](_0x7053ff);}return null;};}function patchUpdates(_0x1b6fe1){return function(_0x12f5de){try{jsonpatch[_0xe13f('0x31')](_0x12f5de,_0x1b6fe1,!![]);}catch(_0x5011d4){return BPromise[_0xe13f('0x32')](_0x5011d4);}return _0x12f5de[_0xe13f('0x33')]();};}function saveUpdates(_0x430557,_0x379c04){return function(_0x3eb4cc){if(_0x3eb4cc){return _0x3eb4cc[_0xe13f('0x34')](_0x430557)[_0xe13f('0x20')](function(_0x3ae71c){return _0x3ae71c;});}return null;};}function removeEntity(_0x579c6b,_0x58b1d0){return function(_0x234b36){if(_0x234b36){return _0x234b36[_0xe13f('0x35')]()['then'](function(){var _0x46be98=_0x234b36[_0xe13f('0x36')]({'plain':!![]});var _0x417430=_0xe13f('0x37');return db[_0xe13f('0x38')][_0xe13f('0x35')]({'where':{'type':_0x417430,'resourceId':_0x46be98['id']}})[_0xe13f('0x20')](function(){return _0x234b36;});})['then'](function(){_0x579c6b['status'](0xcc)[_0xe13f('0x2b')]();});}};}function handleEntityNotFound(_0x1bfe34,_0x59b2bd){return function(_0x53eb4a){if(!_0x53eb4a){_0x1bfe34['sendStatus'](0x194);}return _0x53eb4a;};}function handleError(_0x33258c,_0x2647e0){_0x2647e0=_0x2647e0||0x1f4;return function(_0x183e2c){logger[_0xe13f('0x26')](_0x183e2c[_0xe13f('0x39')]);if(_0x183e2c['name']){delete _0x183e2c[_0xe13f('0x3a')];}_0x33258c[_0xe13f('0x2c')](_0x2647e0)[_0xe13f('0x3b')](_0x183e2c);};}exports[_0xe13f('0x3c')]=function(_0x82be48,_0x4ad623){var _0x35a58b={'include':[{'model':db[_0xe13f('0x3d')],'as':_0xe13f('0x3e')}]},_0x1c9951={},_0x2bace1={'count':0x0,'rows':[]};var _0x23b6b1=_[_0xe13f('0x3f')](db[_0xe13f('0x40')]['rawAttributes'],function(_0xbef70c){return{'name':_0xbef70c[_0xe13f('0x41')],'type':_0xbef70c[_0xe13f('0x42')][_0xe13f('0x43')]};});_0x1c9951[_0xe13f('0x44')]=_[_0xe13f('0x3f')](_0x23b6b1,'name');_0x1c9951[_0xe13f('0x45')]=_[_0xe13f('0x46')](_0x82be48[_0xe13f('0x45')]);_0x1c9951[_0xe13f('0x47')]=_[_0xe13f('0x48')](_0x1c9951[_0xe13f('0x44')],_0x1c9951[_0xe13f('0x45')]);_0x35a58b['attributes']=_['intersection'](_0x1c9951[_0xe13f('0x44')],qs[_0xe13f('0x49')](_0x82be48['query']['fields']));_0x35a58b[_0xe13f('0x4a')]=_0x35a58b[_0xe13f('0x4a')][_0xe13f('0x4b')]?_0x35a58b[_0xe13f('0x4a')]:_0x1c9951[_0xe13f('0x44')];if(!_0x82be48[_0xe13f('0x45')][_0xe13f('0x4c')](_0xe13f('0x4d'))){_0x35a58b['limit']=qs[_0xe13f('0x4e')](_0x82be48['query'][_0xe13f('0x4e')]);_0x35a58b['offset']=qs['offset'](_0x82be48[_0xe13f('0x45')][_0xe13f('0x2f')]);}_0x35a58b['order']=qs[_0xe13f('0x4f')](_0x82be48[_0xe13f('0x45')][_0xe13f('0x4f')]);_0x35a58b[_0xe13f('0x50')]=qs[_0xe13f('0x47')](_[_0xe13f('0x51')](_0x82be48['query'],_0x1c9951['filters']));if(_0x82be48[_0xe13f('0x45')]['filter']){_0x35a58b[_0xe13f('0x50')]=_[_0xe13f('0x52')](_0x35a58b['where'],{'$or':_[_0xe13f('0x3f')](_0x23b6b1,function(_0x41f036){if(_0x41f036[_0xe13f('0x42')]!==_0xe13f('0x53')){var _0xb2b3a0={};_0xb2b3a0[_0x41f036[_0xe13f('0x3a')]]={'$like':'%'+_0x82be48[_0xe13f('0x45')][_0xe13f('0x54')]+'%'};return _0xb2b3a0;}})});}_0x35a58b=_[_0xe13f('0x52')]({},_0x35a58b,_0x82be48[_0xe13f('0x55')]);var _0x4bce3c={'where':_0x35a58b[_0xe13f('0x50')]};return db['FaxAccount'][_0xe13f('0x2e')](_0x4bce3c)[_0xe13f('0x20')](function(_0x355bd3){_0x2bace1[_0xe13f('0x2e')]=_0x355bd3;if(_0x82be48[_0xe13f('0x45')][_0xe13f('0x56')]){_0x35a58b['include']=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x35a58b);})['then'](function(_0x365aff){_0x2bace1[_0xe13f('0x57')]=_0x365aff;return _0x2bace1;})[_0xe13f('0x20')](respondWithFilteredResult(_0x4ad623,_0x35a58b))[_0xe13f('0x2a')](handleError(_0x4ad623,null));};exports[_0xe13f('0x58')]=function(_0x1a8bf8,_0x24fd49){var _0x35ef2e={'raw':![],'where':{'id':_0x1a8bf8[_0xe13f('0x59')]['id']},'include':[{'model':db[_0xe13f('0x3d')],'as':_0xe13f('0x3e')}]},_0x54f378={};_0x54f378['model']=_[_0xe13f('0x46')](db[_0xe13f('0x40')][_0xe13f('0x5a')]);_0x54f378['query']=_['keys'](_0x1a8bf8['query']);_0x54f378['filters']=_[_0xe13f('0x48')](_0x54f378['model'],_0x54f378[_0xe13f('0x45')]);_0x35ef2e[_0xe13f('0x4a')]=_['intersection'](_0x54f378[_0xe13f('0x44')],qs[_0xe13f('0x49')](_0x1a8bf8['query'][_0xe13f('0x49')]));_0x35ef2e[_0xe13f('0x4a')]=_0x35ef2e[_0xe13f('0x4a')]['length']?_0x35ef2e[_0xe13f('0x4a')]:_0x54f378[_0xe13f('0x44')];if(_0x1a8bf8['query'][_0xe13f('0x56')]){_0x35ef2e[_0xe13f('0x5b')]=[{'all':!![]}];}_0x35ef2e=_[_0xe13f('0x52')]({},_0x35ef2e,_0x1a8bf8[_0xe13f('0x55')]);return db[_0xe13f('0x40')][_0xe13f('0x5c')](_0x35ef2e)[_0xe13f('0x20')](handleEntityNotFound(_0x24fd49,null))['then'](respondWithResult(_0x24fd49,null))[_0xe13f('0x2a')](handleError(_0x24fd49,null));};exports[_0xe13f('0x5d')]=function(_0x50080a,_0x3416d6){return db[_0xe13f('0x40')][_0xe13f('0x5d')](_0x50080a['body'],{})['then'](function(_0x4a3de4){var _0x4130f7=_0x50080a[_0xe13f('0x5e')]['get']({'plain':!![]});if(!_0x4130f7)throw new Error(_0xe13f('0x5f'));if(_0x4130f7[_0xe13f('0x60')]===_0xe13f('0x5e')){var _0x2125cf=_0x4a3de4[_0xe13f('0x36')]({'plain':!![]});var _0x568101='FaxAccounts';return db[_0xe13f('0x61')]['find']({'where':{'name':_0x568101,'userProfileId':_0x4130f7[_0xe13f('0x62')]},'raw':!![]})[_0xe13f('0x20')](function(_0x5bf209){if(_0x5bf209&&_0x5bf209['autoAssociation']===0x0){return db[_0xe13f('0x38')]['create']({'name':_0x2125cf[_0xe13f('0x3a')],'resourceId':_0x2125cf['id'],'type':_0x5bf209[_0xe13f('0x3a')],'sectionId':_0x5bf209['id']},{})[_0xe13f('0x20')](function(){return _0x4a3de4;});}else{return _0x4a3de4;}})['catch'](function(_0x598dbd){logger[_0xe13f('0x26')](_0xe13f('0x63'),_0x598dbd);throw _0x598dbd;});}return _0x4a3de4;})[_0xe13f('0x20')](respondWithResult(_0x3416d6,0xc9))[_0xe13f('0x2a')](handleError(_0x3416d6,null));};exports[_0xe13f('0x34')]=function(_0x7f0657,_0x2cfc10){if(_0x7f0657[_0xe13f('0x64')]['id']){delete _0x7f0657['body']['id'];}return db[_0xe13f('0x40')][_0xe13f('0x5c')]({'where':{'id':_0x7f0657[_0xe13f('0x59')]['id']},'include':[{'model':db[_0xe13f('0x3d')],'as':_0xe13f('0x3e')}]})[_0xe13f('0x20')](handleEntityNotFound(_0x2cfc10,null))[_0xe13f('0x20')](saveUpdates(_0x7f0657[_0xe13f('0x64')],null))[_0xe13f('0x20')](respondWithResult(_0x2cfc10,null))['catch'](handleError(_0x2cfc10,null));};exports[_0xe13f('0x35')]=function(_0x16f8e5,_0x322849){return db[_0xe13f('0x40')][_0xe13f('0x5c')]({'where':{'id':_0x16f8e5['params']['id']}})[_0xe13f('0x20')](handleEntityNotFound(_0x322849,null))[_0xe13f('0x20')](removeEntity(_0x322849,null))[_0xe13f('0x2a')](handleError(_0x322849,null));};exports[_0xe13f('0x65')]=function(_0x9d69f7,_0x53060b){return db[_0xe13f('0x40')]['describe']()[_0xe13f('0x20')](respondWithResult(_0x53060b,null))[_0xe13f('0x2a')](handleError(_0x53060b,null));};exports[_0xe13f('0x66')]=function(_0x29df11,_0x5e430c,_0x5569d6){if(_0x29df11[_0xe13f('0x64')]['id']){delete _0x29df11[_0xe13f('0x64')]['id'];}return db[_0xe13f('0x40')][_0xe13f('0x5c')]({'where':{'id':_0x29df11[_0xe13f('0x59')]['id']}})[_0xe13f('0x20')](handleEntityNotFound(_0x5e430c,null))[_0xe13f('0x20')](function(_0x2c4385){if(_0x2c4385){_0x29df11[_0xe13f('0x64')][_0xe13f('0x67')]=_0x2c4385['id'];return db[_0xe13f('0x68')][_0xe13f('0x5d')](_0x29df11['body']);}})[_0xe13f('0x20')](respondWithResult(_0x5e430c,null))[_0xe13f('0x2a')](handleError(_0x5e430c,null));};exports[_0xe13f('0x69')]=function(_0x13e58b,_0x4920d9,_0x5419fb){var _0x5766b2={'raw':![],'where':{}};var _0x2298b3={};var _0x2ee9be={'count':0x0,'rows':[]};return db[_0xe13f('0x40')][_0xe13f('0x6a')]({'where':{'id':_0x13e58b[_0xe13f('0x59')]['id']}})[_0xe13f('0x20')](handleEntityNotFound(_0x4920d9,null))['then'](function(_0x3c832a){if(_0x3c832a){_0x2298b3['model']=_['keys'](db['Disposition'][_0xe13f('0x5a')]);_0x2298b3['query']=_[_0xe13f('0x46')](_0x13e58b['query']);_0x2298b3[_0xe13f('0x47')]=_[_0xe13f('0x48')](_0x2298b3[_0xe13f('0x44')],_0x2298b3[_0xe13f('0x45')]);_0x5766b2[_0xe13f('0x4a')]=_['intersection'](_0x2298b3[_0xe13f('0x44')],qs[_0xe13f('0x49')](_0x13e58b[_0xe13f('0x45')][_0xe13f('0x49')]));_0x5766b2['attributes']=_0x5766b2[_0xe13f('0x4a')]['length']?_0x5766b2[_0xe13f('0x4a')]:_0x2298b3[_0xe13f('0x44')];if(!_0x13e58b[_0xe13f('0x45')]['hasOwnProperty']('nolimit')){_0x5766b2[_0xe13f('0x4e')]=qs[_0xe13f('0x4e')](_0x13e58b[_0xe13f('0x45')]['limit']);_0x5766b2[_0xe13f('0x2f')]=qs[_0xe13f('0x2f')](_0x13e58b['query'][_0xe13f('0x2f')]);}_0x5766b2[_0xe13f('0x6b')]=qs['sort'](_0x13e58b[_0xe13f('0x45')][_0xe13f('0x4f')]);_0x5766b2[_0xe13f('0x50')]=qs[_0xe13f('0x47')](_['pick'](_0x13e58b[_0xe13f('0x45')],_0x2298b3[_0xe13f('0x47')]));_0x5766b2[_0xe13f('0x50')]['FaxAccountId']=_0x3c832a['id'];if(_0x13e58b[_0xe13f('0x45')][_0xe13f('0x54')]){_0x5766b2[_0xe13f('0x50')]=_['merge'](_0x5766b2[_0xe13f('0x50')],{'$or':_['map'](_0x5766b2[_0xe13f('0x4a')],function(_0x459979){var _0x1ede99={};_0x1ede99[_0x459979]={'$like':'%'+_0x13e58b['query']['filter']+'%'};return _0x1ede99;})});}_0x5766b2=_[_0xe13f('0x52')]({},_0x5766b2,_0x13e58b[_0xe13f('0x55')]);return db[_0xe13f('0x68')][_0xe13f('0x2e')]({'where':_0x5766b2['where']})[_0xe13f('0x20')](function(_0x39ffeb){_0x2ee9be[_0xe13f('0x2e')]=_0x39ffeb;if(_0x13e58b[_0xe13f('0x45')][_0xe13f('0x56')]){_0x5766b2['include']=[{'all':!![]}];}return db[_0xe13f('0x68')][_0xe13f('0x6c')](_0x5766b2);})['then'](function(_0x2b4973){_0x2ee9be[_0xe13f('0x57')]=_0x2b4973;return _0x2ee9be;});}})[_0xe13f('0x20')](respondWithFilteredResult(_0x4920d9,_0x5766b2))[_0xe13f('0x2a')](handleError(_0x4920d9,null));};exports[_0xe13f('0x6d')]=function(_0x593538,_0x27b73d,_0x19154e){return db['FaxAccount']['find']({'where':{'id':_0x593538['params']['id']}})[_0xe13f('0x20')](handleEntityNotFound(_0x27b73d,null))[_0xe13f('0x20')](function(_0x39ca9a){if(_0x39ca9a){return _0x39ca9a[_0xe13f('0x6d')](_0x593538[_0xe13f('0x45')][_0xe13f('0x6e')]);}})[_0xe13f('0x20')](respondWithStatusCode(_0x27b73d,null))[_0xe13f('0x2a')](handleError(_0x27b73d,null));};exports[_0xe13f('0x6f')]=function(_0x59cc72,_0x51e230,_0x51bb05){if(_0x59cc72[_0xe13f('0x64')]['id']){delete _0x59cc72[_0xe13f('0x64')]['id'];}return db[_0xe13f('0x40')][_0xe13f('0x5c')]({'where':{'id':_0x59cc72['params']['id']}})[_0xe13f('0x20')](handleEntityNotFound(_0x51e230,null))[_0xe13f('0x20')](function(_0x409d29){if(_0x409d29){_0x59cc72[_0xe13f('0x64')][_0xe13f('0x67')]=_0x409d29['id'];return db[_0xe13f('0x70')][_0xe13f('0x5d')](_0x59cc72[_0xe13f('0x64')]);}})[_0xe13f('0x20')](respondWithResult(_0x51e230,null))[_0xe13f('0x2a')](handleError(_0x51e230,null));};exports[_0xe13f('0x71')]=function(_0x4e9155,_0x2ccf05,_0x5db32e){var _0x2e64e3={'raw':![],'where':{}};var _0x2f45fa={};var _0x3e2fd7={'count':0x0,'rows':[]};return db[_0xe13f('0x40')][_0xe13f('0x6a')]({'where':{'id':_0x4e9155[_0xe13f('0x59')]['id']}})[_0xe13f('0x20')](handleEntityNotFound(_0x2ccf05,null))[_0xe13f('0x20')](function(_0x3b8d55){if(_0x3b8d55){_0x2f45fa[_0xe13f('0x44')]=_[_0xe13f('0x46')](db[_0xe13f('0x70')][_0xe13f('0x5a')]);_0x2f45fa[_0xe13f('0x45')]=_[_0xe13f('0x46')](_0x4e9155[_0xe13f('0x45')]);_0x2f45fa[_0xe13f('0x47')]=_[_0xe13f('0x48')](_0x2f45fa[_0xe13f('0x44')],_0x2f45fa[_0xe13f('0x45')]);_0x2e64e3['attributes']=_[_0xe13f('0x48')](_0x2f45fa[_0xe13f('0x44')],qs['fields'](_0x4e9155[_0xe13f('0x45')][_0xe13f('0x49')]));_0x2e64e3['attributes']=_0x2e64e3[_0xe13f('0x4a')][_0xe13f('0x4b')]?_0x2e64e3[_0xe13f('0x4a')]:_0x2f45fa[_0xe13f('0x44')];if(!_0x4e9155[_0xe13f('0x45')]['hasOwnProperty'](_0xe13f('0x4d'))){_0x2e64e3[_0xe13f('0x4e')]=qs[_0xe13f('0x4e')](_0x4e9155[_0xe13f('0x45')][_0xe13f('0x4e')]);_0x2e64e3[_0xe13f('0x2f')]=qs[_0xe13f('0x2f')](_0x4e9155[_0xe13f('0x45')][_0xe13f('0x2f')]);}_0x2e64e3[_0xe13f('0x6b')]=qs[_0xe13f('0x4f')](_0x4e9155[_0xe13f('0x45')][_0xe13f('0x4f')]);_0x2e64e3[_0xe13f('0x50')]=qs[_0xe13f('0x47')](_['pick'](_0x4e9155[_0xe13f('0x45')],_0x2f45fa['filters']));_0x2e64e3[_0xe13f('0x50')][_0xe13f('0x67')]=_0x3b8d55['id'];if(_0x4e9155['query'][_0xe13f('0x54')]){_0x2e64e3[_0xe13f('0x50')]=_['merge'](_0x2e64e3[_0xe13f('0x50')],{'$or':_['map'](_0x2e64e3[_0xe13f('0x4a')],function(_0x388563){var _0x3aaae5={};_0x3aaae5[_0x388563]={'$like':'%'+_0x4e9155['query'][_0xe13f('0x54')]+'%'};return _0x3aaae5;})});}_0x2e64e3=_[_0xe13f('0x52')]({},_0x2e64e3,_0x4e9155['options']);return db[_0xe13f('0x70')][_0xe13f('0x2e')]({'where':_0x2e64e3[_0xe13f('0x50')]})[_0xe13f('0x20')](function(_0x3623c1){_0x3e2fd7[_0xe13f('0x2e')]=_0x3623c1;if(_0x4e9155[_0xe13f('0x45')][_0xe13f('0x56')]){_0x2e64e3[_0xe13f('0x5b')]=[{'all':!![]}];}return db[_0xe13f('0x70')][_0xe13f('0x6c')](_0x2e64e3);})['then'](function(_0x29a4f1){_0x3e2fd7[_0xe13f('0x57')]=_0x29a4f1;return _0x3e2fd7;});}})[_0xe13f('0x20')](respondWithFilteredResult(_0x2ccf05,_0x2e64e3))[_0xe13f('0x2a')](handleError(_0x2ccf05,null));};exports['removeAnswers']=function(_0x53c9b4,_0x4cc986,_0x3d3df9){return db['FaxAccount']['find']({'where':{'id':_0x53c9b4[_0xe13f('0x59')]['id']}})[_0xe13f('0x20')](handleEntityNotFound(_0x4cc986,null))[_0xe13f('0x20')](function(_0x2212f8){if(_0x2212f8){return _0x2212f8[_0xe13f('0x72')](_0x53c9b4[_0xe13f('0x45')][_0xe13f('0x6e')]);}})[_0xe13f('0x20')](respondWithStatusCode(_0x4cc986,null))[_0xe13f('0x2a')](handleError(_0x4cc986,null));};exports[_0xe13f('0x73')]=function(_0x50febe,_0x1fdb0c,_0x23fa3f){return db['FaxInteraction'][_0xe13f('0x5c')]({'where':{'id':_0x50febe['params']['id']}})[_0xe13f('0x20')](handleEntityNotFound(_0x1fdb0c,null))[_0xe13f('0x20')](function(_0x4fd0b1){if(_0x4fd0b1){return _0x4fd0b1[_0xe13f('0x73')](_0x50febe[_0xe13f('0x64')][_0xe13f('0x6e')],_[_0xe13f('0x74')](_0x50febe[_0xe13f('0x64')],[_0xe13f('0x6e'),'id'])||{});}})['then'](respondWithResult(_0x1fdb0c,null))['catch'](handleError(_0x1fdb0c,null));};exports[_0xe13f('0x75')]=function(_0x7843f5,_0x43c508,_0x260b66){var _0x399874={'raw':![],'where':{}};var _0x1a07e8={};var _0x50c5f3={'count':0x0,'rows':[]};return db[_0xe13f('0x40')][_0xe13f('0x6a')]({'where':{'id':_0x7843f5['params']['id']}})[_0xe13f('0x20')](handleEntityNotFound(_0x43c508,null))[_0xe13f('0x20')](function(_0x253162){if(_0x253162){_0x1a07e8['model']=_[_0xe13f('0x46')](db[_0xe13f('0x76')]['rawAttributes']);_0x1a07e8[_0xe13f('0x45')]=_[_0xe13f('0x46')](_0x7843f5[_0xe13f('0x45')]);_0x1a07e8[_0xe13f('0x47')]=_[_0xe13f('0x48')](_0x1a07e8[_0xe13f('0x44')],_0x1a07e8[_0xe13f('0x45')]);_0x399874[_0xe13f('0x4a')]=_[_0xe13f('0x48')](_0x1a07e8[_0xe13f('0x44')],qs['fields'](_0x7843f5['query'][_0xe13f('0x49')]));_0x399874['attributes']=_0x399874[_0xe13f('0x4a')][_0xe13f('0x4b')]?_0x399874[_0xe13f('0x4a')]:_0x1a07e8[_0xe13f('0x44')];if(!_0x7843f5[_0xe13f('0x45')][_0xe13f('0x4c')](_0xe13f('0x4d'))){_0x399874[_0xe13f('0x4e')]=qs[_0xe13f('0x4e')](_0x7843f5[_0xe13f('0x45')]['limit']);_0x399874[_0xe13f('0x2f')]=qs[_0xe13f('0x2f')](_0x7843f5['query']['offset']);}_0x399874['order']=qs['sort'](_0x7843f5['query'][_0xe13f('0x4f')]);_0x399874[_0xe13f('0x50')]=qs[_0xe13f('0x47')](_[_0xe13f('0x51')](_0x7843f5[_0xe13f('0x45')],_0x1a07e8[_0xe13f('0x47')]));_0x399874[_0xe13f('0x50')]['FaxAccountId']=_0x253162['id'];if(_0x7843f5['query'][_0xe13f('0x54')]){_0x399874[_0xe13f('0x50')]=_[_0xe13f('0x52')](_0x399874['where'],{'$or':_['map'](_0x399874[_0xe13f('0x4a')],function(_0x1dff71){var _0x58454f={};_0x58454f[_0x1dff71]={'$like':'%'+_0x7843f5[_0xe13f('0x45')]['filter']+'%'};return _0x58454f;})});}_0x399874=_[_0xe13f('0x52')]({},_0x399874,_0x7843f5[_0xe13f('0x55')]);return db['FaxInteraction']['count']({'where':_0x399874[_0xe13f('0x50')]})[_0xe13f('0x20')](function(_0x2f1156){_0x50c5f3[_0xe13f('0x2e')]=_0x2f1156;if(_0x7843f5['query'][_0xe13f('0x56')]){_0x399874[_0xe13f('0x5b')]=[{'model':db[_0xe13f('0x77')],'as':_0xe13f('0x78'),'required':![]},{'model':db[_0xe13f('0x79')],'as':_0xe13f('0x7a'),'attributes':['name','fullname',_0xe13f('0x7b')],'required':![]},{'model':db[_0xe13f('0x7c')],'as':'Tags','attributes':['id',_0xe13f('0x3a'),_0xe13f('0x7d')],'where':_0x7843f5['query'][_0xe13f('0x7e')]?{'id':_0x7843f5[_0xe13f('0x45')][_0xe13f('0x7e')]}:undefined,'required':_0x7843f5[_0xe13f('0x45')][_0xe13f('0x7e')]?!![]:![]}];}return db[_0xe13f('0x76')][_0xe13f('0x6c')](_0x399874);})['then'](function(_0x4d6778){_0x50c5f3[_0xe13f('0x57')]=_0x4d6778;return _0x50c5f3;});}})[_0xe13f('0x20')](respondWithFilteredResult(_0x43c508,_0x399874))[_0xe13f('0x2a')](handleError(_0x43c508,null));};exports[_0xe13f('0x7f')]=function(_0x188fc6,_0x4d5fb4,_0x524e2e){return db[_0xe13f('0x40')][_0xe13f('0x6a')]({'where':{'id':_0x188fc6['params']['id']}})[_0xe13f('0x20')](handleEntityNotFound(_0x4d5fb4,null))[_0xe13f('0x20')](function(_0x2c45c7){if(_0x2c45c7){return db[_0xe13f('0x80')][_0xe13f('0x81')](function(_0x55d65){return db[_0xe13f('0x82')]['destroy']({'where':{'FaxAccountId':_0x188fc6[_0xe13f('0x59')]['id']},'transaction':_0x55d65})[_0xe13f('0x20')](function(_0x19d165){var _0x45b066=_[_0xe13f('0x3f')](_0x188fc6[_0xe13f('0x64')],function(_0x2b7ae8){_0x2b7ae8['FaxAccountId']=_0x188fc6[_0xe13f('0x59')]['id'];return _0x2b7ae8;});return db[_0xe13f('0x82')]['bulkCreate'](_0x45b066,{'transaction':_0x55d65});});})[_0xe13f('0x20')](function(){return db[_0xe13f('0x82')][_0xe13f('0x83')]({'where':{'FaxAccountId':_0x188fc6[_0xe13f('0x59')]['id']},'order':_0xe13f('0x84')});});}})['then'](respondWithResult(_0x4d5fb4,null))[_0xe13f('0x2a')](handleError(_0x4d5fb4,null));};exports[_0xe13f('0x85')]=function(_0x4fc31d,_0x2576a1,_0x4536db){var _0x5ee432={};var _0xdfaf70={};var _0x35738a;var _0x1a031c;return db[_0xe13f('0x40')][_0xe13f('0x6a')]({'where':{'id':_0x4fc31d[_0xe13f('0x59')]['id']}})['then'](handleEntityNotFound(_0x2576a1,null))['then'](function(_0x28dde3){if(_0x28dde3){_0x35738a=_0x28dde3;_0xdfaf70[_0xe13f('0x44')]=_['keys'](db[_0xe13f('0x82')][_0xe13f('0x5a')]);_0xdfaf70['query']=_['keys'](_0x4fc31d['query']);_0xdfaf70[_0xe13f('0x47')]=_[_0xe13f('0x48')](_0xdfaf70[_0xe13f('0x44')],_0xdfaf70[_0xe13f('0x45')]);_0x5ee432['attributes']=_[_0xe13f('0x48')](_0xdfaf70[_0xe13f('0x44')],qs['fields'](_0x4fc31d['query'][_0xe13f('0x49')]));_0x5ee432[_0xe13f('0x4a')]=_0x5ee432[_0xe13f('0x4a')][_0xe13f('0x4b')]?_0x5ee432[_0xe13f('0x4a')]:_0xdfaf70['model'];_0x5ee432['order']=qs['sort'](_0x4fc31d[_0xe13f('0x45')][_0xe13f('0x4f')]);_0x5ee432[_0xe13f('0x50')]=qs[_0xe13f('0x47')](_['pick'](_0x4fc31d[_0xe13f('0x45')],_0xdfaf70[_0xe13f('0x47')]));if(_0x4fc31d[_0xe13f('0x45')][_0xe13f('0x54')]){_0x5ee432[_0xe13f('0x50')]=_[_0xe13f('0x52')](_0x5ee432[_0xe13f('0x50')],{'$or':_[_0xe13f('0x3f')](_0x5ee432['attributes'],function(_0x49669c){var _0x766c19={};_0x766c19[_0x49669c]={'$like':'%'+_0x4fc31d[_0xe13f('0x45')][_0xe13f('0x54')]+'%'};return _0x766c19;})});}_0x5ee432=_[_0xe13f('0x52')]({},_0x5ee432,_0x4fc31d[_0xe13f('0x55')]);return _0x35738a[_0xe13f('0x85')](_0x5ee432);}})[_0xe13f('0x20')](function(_0x1ccd1d){if(_0x1ccd1d){_0x1a031c=_0x1ccd1d[_0xe13f('0x4b')];if(!_0x4fc31d['query']['hasOwnProperty']('nolimit')){_0x5ee432[_0xe13f('0x4e')]=qs[_0xe13f('0x4e')](_0x4fc31d[_0xe13f('0x45')]['limit']);_0x5ee432[_0xe13f('0x2f')]=qs[_0xe13f('0x2f')](_0x4fc31d[_0xe13f('0x45')][_0xe13f('0x2f')]);}return _0x35738a[_0xe13f('0x85')](_0x5ee432);}})[_0xe13f('0x20')](function(_0x183193){if(_0x183193){return _0x183193?{'count':_0x1a031c,'rows':_0x183193}:null;}})['then'](respondWithResult(_0x2576a1,null))['catch'](handleError(_0x2576a1,null));};function Extension(_0x520991,_0x195e8a,_0x3315f5,_0x2cff8a){this[_0xe13f('0x86')]=_0xe13f('0x87');this[_0xe13f('0x88')]=_0x520991[_0xe13f('0x89')];this[_0xe13f('0x8a')]=_0x2cff8a;this[_0xe13f('0x42')]='system';this[_0xe13f('0x8b')]=_0xe13f('0x8c');this[_0xe13f('0x67')]=_0x520991['id'];this[_0xe13f('0x84')]=_0x195e8a;this['appdata']=_0x3315f5;}function createExtensionsReciveFax(_0x571505){var _0x124597=0x1;var _0x55a215=[];_0x55a215[_0xe13f('0x8d')](new Extension(_0x571505,_0x124597,'',_0xe13f('0x8e')));_0x124597+=0x1;_0x55a215[_0xe13f('0x8d')](new Extension(_0x571505,_0x124597,_0xe13f('0x8f'),_0xe13f('0x90')));_0x124597+=0x1;for(var _0x2102de in _0x571505){if(_0x571505[_0xe13f('0x4c')](_0x2102de)&&(_0x2102de===_0xe13f('0x91')||_0x2102de===_0xe13f('0x89')||_0x2102de===_0xe13f('0x92')||_0x2102de===_0xe13f('0x93')||_0x2102de==='headerinfo'||_0x2102de===_0xe13f('0x94')||_0x2102de===_0xe13f('0x95')||_0x2102de==='modem'||_0x2102de===_0xe13f('0x96'))){_0x55a215[_0xe13f('0x8d')](new Extension(_0x571505,_0x124597,_0xe13f('0x97')+_0x2102de+')='+_0x571505[_0x2102de],_0xe13f('0x90')));_0x124597+=0x1;}}_0x55a215['push'](new Extension(_0x571505,_0x124597,'6','Wait'));_0x124597+=0x1;_0x55a215[_0xe13f('0x8d')](new Extension(_0x571505,_0x124597,_0xe13f('0x98'),_0xe13f('0x99')));_0x124597=0x0;return _0x55a215;}exports[_0xe13f('0x9a')]=function(_0x37965e,_0x77987b,_0xf78dd4){var _0x52bb90;return db[_0xe13f('0x80')][_0xe13f('0x81')](function(_0x3766e1){return db[_0xe13f('0x40')]['create'](_0x37965e[_0xe13f('0x64')],{'transaction':_0x3766e1})[_0xe13f('0x20')](function(_0x28e6d2){_0x52bb90=_0x28e6d2[_0xe13f('0x36')]({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x52bb90),{'transaction':_0x3766e1});});})[_0xe13f('0x20')](function(){return _0x52bb90;})[_0xe13f('0x20')](respondWithResult(_0x77987b,null))[_0xe13f('0x2a')](handleError(_0x77987b,null));};exports[_0xe13f('0x9b')]=function(_0x331d17,_0x4542e9,_0x3a51f1){var _0x3bbb27;return db[_0xe13f('0x80')][_0xe13f('0x81')](function(_0x2b04d5){return db[_0xe13f('0x40')][_0xe13f('0x34')](_0x331d17[_0xe13f('0x64')],{'where':{'id':_0x331d17[_0xe13f('0x64')]['id']},'transaction':_0x2b04d5})[_0xe13f('0x20')](function(_0x28f1e2){return db[_0xe13f('0x9c')]['destroy']({'where':{'FaxAccountId':_0x331d17[_0xe13f('0x64')]['id']},'transaction':_0x2b04d5})[_0xe13f('0x20')](function(_0x3b2f1c){return db['VoiceExtension'][_0xe13f('0x9d')](createExtensionsReciveFax(_[_0xe13f('0x74')](_0x331d17[_0xe13f('0x64')],['tech',_0xe13f('0x43'),'createdAt',_0xe13f('0x9e'),'TrunkId',_0xe13f('0x9f')])),{'transaction':_0x2b04d5});});});})[_0xe13f('0x20')](function(){return db[_0xe13f('0x40')][_0xe13f('0xa0')](_0x331d17[_0xe13f('0x64')]['id']);})[_0xe13f('0x20')](respondWithResult(_0x4542e9,null))['catch'](handleError(_0x4542e9,null));};exports[_0xe13f('0xa1')]=function(_0x5e51df,_0x3028d9,_0x50a73b){var _0x214439={'raw':!![],'where':{}};var _0x2c90b7={};var _0x34dacc={'count':0x0,'rows':[]};return db[_0xe13f('0x40')]['findOne']({'where':{'id':_0x5e51df[_0xe13f('0x59')]['id']}})[_0xe13f('0x20')](handleEntityNotFound(_0x3028d9,null))['then'](function(_0x30ee8b){if(_0x30ee8b){_0x2c90b7[_0xe13f('0x44')]=_['keys'](db[_0xe13f('0xa2')][_0xe13f('0x5a')]);_0x2c90b7[_0xe13f('0x45')]=_[_0xe13f('0x46')](_0x5e51df[_0xe13f('0x45')]);_0x2c90b7[_0xe13f('0x47')]=_[_0xe13f('0x48')](_0x2c90b7['model'],_0x2c90b7['query']);_0x214439[_0xe13f('0x4a')]=_[_0xe13f('0x48')](_0x2c90b7['model'],qs[_0xe13f('0x49')](_0x5e51df[_0xe13f('0x45')][_0xe13f('0x49')]));_0x214439[_0xe13f('0x4a')]=_0x214439[_0xe13f('0x4a')]['length']?_0x214439['attributes']:_0x2c90b7[_0xe13f('0x44')];if(!_0x5e51df[_0xe13f('0x45')]['hasOwnProperty'](_0xe13f('0x4d'))){_0x214439[_0xe13f('0x4e')]=qs[_0xe13f('0x4e')](_0x5e51df['query']['limit']);_0x214439[_0xe13f('0x2f')]=qs[_0xe13f('0x2f')](_0x5e51df[_0xe13f('0x45')][_0xe13f('0x2f')]);}_0x214439[_0xe13f('0x6b')]=qs['sort'](_0x5e51df['query'][_0xe13f('0x4f')]);_0x214439[_0xe13f('0x50')]=qs[_0xe13f('0x47')](_[_0xe13f('0x51')](_0x5e51df[_0xe13f('0x45')],_0x2c90b7[_0xe13f('0x47')]));_0x214439[_0xe13f('0x50')][_0xe13f('0x67')]=_0x30ee8b['id'];if(_0x5e51df[_0xe13f('0x45')][_0xe13f('0x54')]){_0x214439[_0xe13f('0x50')]=_[_0xe13f('0x52')](_0x214439[_0xe13f('0x50')],{'$or':_[_0xe13f('0x3f')](_0x214439['attributes'],function(_0x36a97f){var _0x4f53b7={};_0x4f53b7[_0x36a97f]={'$like':'%'+_0x5e51df[_0xe13f('0x45')][_0xe13f('0x54')]+'%'};return _0x4f53b7;})});}if(_0x5e51df['query'][_0xe13f('0xa3')]){var _0x2a86fd=_0x5e51df[_0xe13f('0x45')][_0xe13f('0xa3')][_0xe13f('0xa4')](',');var _0x5acb1a={};_0x5acb1a[_0x2a86fd[0x0]]={'$gte':moment(_0x2a86fd[0x1])[_0xe13f('0xa5')](_0xe13f('0xa6'))};_0x214439[_0xe13f('0x50')]=_[_0xe13f('0x52')](_0x214439[_0xe13f('0x50')],_0x5acb1a);}_0x214439=_[_0xe13f('0x52')]({},_0x214439,_0x5e51df['options']);return db[_0xe13f('0xa2')][_0xe13f('0x2e')]({'where':_0x214439[_0xe13f('0x50')]})[_0xe13f('0x20')](function(_0x3ef68a){_0x34dacc[_0xe13f('0x2e')]=_0x3ef68a;if(_0x5e51df[_0xe13f('0x45')][_0xe13f('0x56')]){_0x214439[_0xe13f('0x5b')]=[{'all':!![]}];}return db['FaxMessage'][_0xe13f('0x6c')](_0x214439);})[_0xe13f('0x20')](function(_0x4aa9ba){_0x34dacc['rows']=_0x4aa9ba;return _0x34dacc;});}})['then'](respondWithFilteredResult(_0x3028d9,_0x214439))[_0xe13f('0x2a')](handleError(_0x3028d9,null));};exports[_0xe13f('0x3b')]=function(_0x583933,_0x4af352,_0xc6f720){var _0x4091b3,_0x12730d={},_0x40a5d4;if(_0x583933[_0xe13f('0x64')]['to']){_0x40a5d4=_0x583933[_0xe13f('0x64')]['to'][0x0];}return db[_0xe13f('0x40')][_0xe13f('0x5c')]({'where':{'id':_0x583933[_0xe13f('0x59')]['id']},'include':[{'model':db[_0xe13f('0xa7')],'as':_0xe13f('0xa8'),'include':[{'model':db[_0xe13f('0x77')],'as':_0xe13f('0xa9'),'where':{'fax':_0x40a5d4},'limit':0x1,'order':[[_0xe13f('0x9e'),_0xe13f('0xaa')]]}]}]})[_0xe13f('0x20')](handleEntityNotFound(_0x4af352,null))['then'](function(_0x44e497){_0x4091b3=_0x44e497;if(_0x583933[_0xe13f('0x64')][_0xe13f('0xab')]&&_0x583933[_0xe13f('0x64')][_0xe13f('0xab')][_0xe13f('0x4b')]){for(var _0x473a34=0x0;_0x473a34<_0x583933[_0xe13f('0x64')][_0xe13f('0xab')][_0xe13f('0x4b')];_0x473a34+=0x1){_0x583933['body']['attachments'][_0x473a34]={'filename':_0x583933[_0xe13f('0x64')][_0xe13f('0xab')][_0x473a34][_0xe13f('0x3a')],'id':_0x583933['body']['attachments'][_0x473a34]['id'],'path':path[_0xe13f('0xac')](config['root'],_0xe13f('0xad'),_0x583933[_0xe13f('0x64')][_0xe13f('0xab')][_0x473a34][_0xe13f('0xae')])};}}return respondWithRpcPromise('CheckAfterSend',_0xe13f('0xaf'),{'FaxAccountId':_['isNil'](_0x583933['params']['id'])?undefined:_0x583933[_0xe13f('0x59')]['id'],'path':_[_0xe13f('0xb0')](_0x583933[_0xe13f('0x64')][_0xe13f('0xab')][0x0][_0xe13f('0x9')])?undefined:_0x583933[_0xe13f('0x64')][_0xe13f('0xab')][0x0][_0xe13f('0x9')],'fax':_[_0xe13f('0xb0')](_0x583933[_0xe13f('0x64')]['to'][0x0])?undefined:_0x583933[_0xe13f('0x64')]['to'][0x0]},client9002);})[_0xe13f('0x20')](function(){if(_0x4091b3){if(_[_0xe13f('0xb0')](_0x583933[_0xe13f('0x64')][_0xe13f('0xb1')])){_0x583933[_0xe13f('0x64')][_0xe13f('0xb1')]=util[_0xe13f('0xa5')]('\x22%s\x22\x20<%s>',_0x4091b3['name'],_0x4091b3[_0xe13f('0xb2')]);}if(_0x4091b3[_0xe13f('0xa8')]){if(_0x4091b3[_0xe13f('0xa8')][_0xe13f('0xa9')]['length']){return _0x4091b3[_0xe13f('0xa8')]['Contacts'][0x0];}else{return db['CmContact'][_0xe13f('0x5d')](_['defaults'](_0x583933['body'],{'firstName':_0x583933['body']['to'][0x0],'phone':_0x583933[_0xe13f('0x64')]['to'][0x0],'fax':_0x583933[_0xe13f('0x64')]['to'][0x0],'ListId':_0x4091b3['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xe13f('0xb3'));}})[_0xe13f('0x20')](function(_0x3bfefa){if(_0x3bfefa){return db['FaxInteraction']['find']({'where':{'ContactId':_0x3bfefa['id'],'closed':![],'FaxAccountId':_0x4091b3['id']}})['then'](function(_0x3c71f0){if(_0x3c71f0){return[_0x3c71f0,![]];}return db[_0xe13f('0x76')][_0xe13f('0x5d')]({'UserId':_0x583933[_0xe13f('0x5e')]['id'],'ContactId':_0x3bfefa['id'],'FaxAccountId':_0x4091b3['id'],'fax':_0x583933[_0xe13f('0x64')]['to'][0x0],'firstMsgDirection':_0xe13f('0xb4'),'Messages':[_[_0xe13f('0x52')](_0x583933[_0xe13f('0x64')],{'read':![],'body':_0x583933[_0xe13f('0x64')][_0xe13f('0xab')][0x0][_0xe13f('0xb5')],'FaxAccountId':_0x4091b3['id'],'UserId':_0x583933[_0xe13f('0x5e')]['id'],'ContactId':_0x3bfefa['id'],'AttachmentId':_0x583933[_0xe13f('0x64')][_0xe13f('0xab')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xe13f('0xb6')}]})[_0xe13f('0x20')](function(_0x2494c0){return[_0x2494c0,!![]];});});}else{throw new Error(_0xe13f('0xb7'));}})[_0xe13f('0xb8')](function(_0x34db6e,_0xa6f078){if(_0xa6f078){return _0x34db6e;}return db[_0xe13f('0xa2')][_0xe13f('0x5d')]({'direction':'out','read':![],'body':_0x583933[_0xe13f('0x64')][_0xe13f('0xab')][0x0][_0xe13f('0xb5')],'FaxAccountId':_0x4091b3['id'],'FaxInteractionId':_0x34db6e['id'],'UserId':_0x583933[_0xe13f('0x5e')]['id'],'ContactId':_0x34db6e[_0xe13f('0xb9')],'AttachmentId':_0x583933['body'][_0xe13f('0xab')][0x0]['id']})['then'](function(_0x172239){_0x34db6e[_0xe13f('0xba')][_0xe13f('0xb6')]=[];_0x34db6e[_0xe13f('0xba')][_0xe13f('0xb6')]['push'](_0x172239[_0xe13f('0xba')]);return _0x34db6e;});})[_0xe13f('0x20')](function(_0x15086d){respondWithRpcPromise(_0xe13f('0xbb'),_0xe13f('0xbb'),{'FaxAccountId':_['isNil'](_0x583933[_0xe13f('0x59')]['id'])?undefined:_0x583933[_0xe13f('0x59')]['id'],'path':_[_0xe13f('0xb0')](_0x583933[_0xe13f('0x64')]['attachments'][0x0][_0xe13f('0x9')])?undefined:_0x583933[_0xe13f('0x64')][_0xe13f('0xab')][0x0][_0xe13f('0x9')],'fax':_['isNil'](_0x583933['body']['to'][0x0])?undefined:_0x583933[_0xe13f('0x64')]['to'][0x0],'AttachmentId':_0x583933['body'][_0xe13f('0xab')][0x0]['id']},client9002)[_0xe13f('0x20')](function(_0xaff2be){logger[_0xe13f('0x21')](_0xe13f('0xbc'),_0xaff2be);})[_0xe13f('0x2a')](function(_0x1af7a1){logger[_0xe13f('0x21')](_0xe13f('0xbc'),_0x1af7a1);});return _0x15086d;})[_0xe13f('0x20')](respondWithResult(_0x4af352,null))[_0xe13f('0x2a')](handleError(_0x4af352,null));};exports[_0xe13f('0xbd')]=function(_0x1ce830,_0x15a014,_0x1d62f4){return db[_0xe13f('0x40')][_0xe13f('0x5c')]({'where':{'id':_0x1ce830[_0xe13f('0x59')]['id']}})[_0xe13f('0x20')](handleEntityNotFound(_0x15a014,null))[_0xe13f('0x20')](function(_0xbe152c){if(_0xbe152c){return _0xbe152c[_0xe13f('0xbd')](_0x1ce830[_0xe13f('0x64')][_0xe13f('0x6e')],_['omit'](_0x1ce830[_0xe13f('0x64')],[_0xe13f('0x6e'),'id'])||{})[_0xe13f('0xb8')](function(_0x4ec729){for(var _0xe17788=0x0;_0xe17788<_0x1ce830[_0xe13f('0x64')][_0xe13f('0x6e')][_0xe13f('0x4b')];_0xe17788+=0x1){socket['emit']('userFaxAccount:save',{'UserId':_0x1ce830[_0xe13f('0x64')][_0xe13f('0x6e')][_0xe17788],'FaxAccountId':_0x1ce830[_0xe13f('0x59')]['id']});}return _0x4ec729;});}})[_0xe13f('0x20')](respondWithResult(_0x15a014,null))[_0xe13f('0x2a')](handleError(_0x15a014,null));};exports[_0xe13f('0xbe')]=function(_0x41b8b5,_0x2ca0fd,_0x17113){return db['FaxAccount'][_0xe13f('0x5c')]({'where':{'id':_0x41b8b5[_0xe13f('0x59')]['id']}})[_0xe13f('0x20')](handleEntityNotFound(_0x2ca0fd,null))[_0xe13f('0x20')](function(_0x40c13a){if(_0x40c13a){return _0x40c13a['removeAgents'](_0x41b8b5[_0xe13f('0x45')][_0xe13f('0x6e')])[_0xe13f('0x20')](function(){if(_[_0xe13f('0xbf')](_0x41b8b5[_0xe13f('0x45')][_0xe13f('0x6e')])){for(var _0x37de35=0x0;_0x37de35<_0x41b8b5[_0xe13f('0x45')][_0xe13f('0x6e')][_0xe13f('0x4b')];_0x37de35+=0x1){socket[_0xe13f('0xc0')](_0xe13f('0xc1'),{'UserId':Number(_0x41b8b5['query'][_0xe13f('0x6e')][_0x37de35]),'FaxAccountId':Number(_0x41b8b5[_0xe13f('0x59')]['id'])});}}else{socket[_0xe13f('0xc0')](_0xe13f('0xc1'),{'UserId':Number(_0x41b8b5[_0xe13f('0x45')][_0xe13f('0x6e')]),'FaxAccountId':Number(_0x41b8b5[_0xe13f('0x59')]['id'])});}});}})[_0xe13f('0x20')](respondWithStatusCode(_0x2ca0fd,null))['catch'](handleError(_0x2ca0fd,null));};exports[_0xe13f('0xc2')]=function(_0x4dce3c,_0x5d6f8e,_0x35889c){var _0x4a9314={};var _0x806b64={};var _0x4bab9a;var _0x32be38;return db[_0xe13f('0x40')][_0xe13f('0x6a')]({'where':{'id':_0x4dce3c[_0xe13f('0x59')]['id']}})[_0xe13f('0x20')](handleEntityNotFound(_0x5d6f8e,null))['then'](function(_0x9410fc){if(_0x9410fc){_0x4bab9a=_0x9410fc;_0x806b64[_0xe13f('0x44')]=_[_0xe13f('0x46')](db[_0xe13f('0x79')]['rawAttributes']);_0x806b64[_0xe13f('0x45')]=_[_0xe13f('0x46')](_0x4dce3c[_0xe13f('0x45')]);_0x806b64[_0xe13f('0x47')]=_[_0xe13f('0x48')](_0x806b64['model'],_0x806b64['query']);_0x4a9314['attributes']=_['intersection'](_0x806b64[_0xe13f('0x44')],qs['fields'](_0x4dce3c[_0xe13f('0x45')][_0xe13f('0x49')]));_0x4a9314['attributes']=_0x4a9314['attributes'][_0xe13f('0x4b')]?_0x4a9314[_0xe13f('0x4a')]:_0x806b64['model'];_0x4a9314[_0xe13f('0x6b')]=qs['sort'](_0x4dce3c[_0xe13f('0x45')][_0xe13f('0x4f')]);_0x4a9314[_0xe13f('0x50')]=qs['filters'](_['pick'](_0x4dce3c[_0xe13f('0x45')],_0x806b64[_0xe13f('0x47')]));if(_0x4dce3c[_0xe13f('0x45')]['filter']){_0x4a9314['where']=_[_0xe13f('0x52')](_0x4a9314[_0xe13f('0x50')],{'$or':_[_0xe13f('0x3f')](_0x4a9314['attributes'],function(_0x2db136){var _0x2613c9={};_0x2613c9[_0x2db136]={'$like':'%'+_0x4dce3c[_0xe13f('0x45')][_0xe13f('0x54')]+'%'};return _0x2613c9;})});}_0x4a9314=_[_0xe13f('0x52')]({},_0x4a9314,_0x4dce3c['options']);return _0x4bab9a[_0xe13f('0xc2')](_0x4a9314);}})['then'](function(_0x1d6e3a){if(_0x1d6e3a){_0x32be38=_0x1d6e3a[_0xe13f('0x4b')];if(!_0x4dce3c[_0xe13f('0x45')][_0xe13f('0x4c')]('nolimit')){_0x4a9314[_0xe13f('0x4e')]=qs[_0xe13f('0x4e')](_0x4dce3c[_0xe13f('0x45')][_0xe13f('0x4e')]);_0x4a9314[_0xe13f('0x2f')]=qs[_0xe13f('0x2f')](_0x4dce3c[_0xe13f('0x45')][_0xe13f('0x2f')]);}return _0x4bab9a[_0xe13f('0xc2')](_0x4a9314);}})[_0xe13f('0x20')](function(_0x1e6f75){if(_0x1e6f75){return _0x1e6f75?{'count':_0x32be38,'rows':_0x1e6f75}:null;}})['then'](respondWithResult(_0x5d6f8e,null))[_0xe13f('0x2a')](handleError(_0x5d6f8e,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 4d1ea67..75852c4 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 _0xccdd=['FaxAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2d2bc9,_0xff9213){var _0x4f2e14=function(_0x5d1378){while(--_0x5d1378){_0x2d2bc9['push'](_0x2d2bc9['shift']());}};_0x4f2e14(++_0xff9213);}(_0xccdd,0x170));var _0xdccd=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0xccdd[_0x35da42];return _0x370035;};'use strict';var EventEmitter=require(_0xdccd('0x0'));var FaxAccount=require(_0xdccd('0x1'))['db'][_0xdccd('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xdccd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdccd('0x4'),'afterDestroy':_0xdccd('0x5')};function emitEvent(_0x46bf6e){return function(_0x47a50d,_0x5c2e50,_0x21f3b9){FaxAccountEvents[_0xdccd('0x6')](_0x46bf6e+':'+_0x47a50d['id'],_0x47a50d);FaxAccountEvents[_0xdccd('0x6')](_0x46bf6e,_0x47a50d);_0x21f3b9(null);};}for(var e in events){if(events[_0xdccd('0x7')](e)){var event=events[e];FaxAccount[_0xdccd('0x8')](e,emitEvent(event));}}module[_0xdccd('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0xda33=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0xda33,0x16d));var _0x3da3=function(_0x401bca,_0x550399){_0x401bca=_0x401bca-0x0;var _0x4a2013=_0xda33[_0x401bca];return _0x4a2013;};'use strict';var EventEmitter=require(_0x3da3('0x0'));var FaxAccount=require(_0x3da3('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x3da3('0x2')](0x0);var events={'afterCreate':_0x3da3('0x3'),'afterUpdate':_0x3da3('0x4'),'afterDestroy':_0x3da3('0x5')};function emitEvent(_0x27f609){return function(_0xed1e4b,_0x5d57a6,_0x53c66d){FaxAccountEvents[_0x3da3('0x6')](_0x27f609+':'+_0xed1e4b['id'],_0xed1e4b);FaxAccountEvents[_0x3da3('0x6')](_0x27f609,_0xed1e4b);_0x53c66d(null);};}for(var e in events){if(events[_0x3da3('0x7')](e)){var event=events[e];FaxAccount[_0x3da3('0x8')](e,emitEvent(event));}}module[_0x3da3('0x9')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index b6a2111..598bb72 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 _0xf66e=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','lodash'];(function(_0x28eb00,_0x5d6873){var _0x4f76aa=function(_0x482ad5){while(--_0x482ad5){_0x28eb00['push'](_0x28eb00['shift']());}};_0x4f76aa(++_0x5d6873);}(_0xf66e,0xa4));var _0xef66=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xf66e[_0x173441];return _0x2423a8;};'use strict';var _=require(_0xef66('0x0'));var util=require(_0xef66('0x1'));var logger=require(_0xef66('0x2'))(_0xef66('0x3'));var moment=require(_0xef66('0x4'));var BPromise=require(_0xef66('0x5'));var rp=require(_0xef66('0x6'));var fs=require('fs');var path=require(_0xef66('0x7'));var rimraf=require('rimraf');var config=require(_0xef66('0x8'));var attributes=require('./faxAccount.attributes');module[_0xef66('0x9')]=function(_0x2db930,_0xe8458d){return _0x2db930[_0xef66('0xa')]('FaxAccount',attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ab0=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','fax_accounts','lodash','util','../../config/logger','api'];(function(_0x60df74,_0x458e29){var _0x5ee872=function(_0x356888){while(--_0x356888){_0x60df74['push'](_0x60df74['shift']());}};_0x5ee872(++_0x458e29);}(_0x7ab0,0xb7));var _0x07ab=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x7ab0[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x07ab('0x0'));var util=require(_0x07ab('0x1'));var logger=require(_0x07ab('0x2'))(_0x07ab('0x3'));var moment=require(_0x07ab('0x4'));var BPromise=require(_0x07ab('0x5'));var rp=require(_0x07ab('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x07ab('0x7'));var config=require(_0x07ab('0x8'));var attributes=require('./faxAccount.attributes');module[_0x07ab('0x9')]=function(_0x2d98dd,_0x322bf6){return _0x2d98dd['define']('FaxAccount',attributes,{'tableName':_0x07ab('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 da13fcd..f836327 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 _0xfb1c=['list','applications','orderBy','priority','asc','Contacts','length','contact','FaxInteraction','create','autoclose','push','close','*,*,*,*','created','interaction','ContactId','AttachmentId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetFaxAccount','FaxAccount','findAll','options','raw','where','limit','include','map','model','attributes','stringify','catch','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','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','find','account','CmList','FaxApplication','List','get','Applications'];(function(_0x4ba9cb,_0x2c9563){var _0x4a0f37=function(_0x3a194c){while(--_0x3a194c){_0x4ba9cb['push'](_0x4ba9cb['shift']());}};_0x4a0f37(++_0x2c9563);}(_0xfb1c,0xd2));var _0xcfb1=function(_0x11141a,_0x669621){_0x11141a=_0x11141a-0x0;var _0x1c08c5=_0xfb1c[_0x11141a];return _0x1c08c5;};'use strict';var _=require(_0xcfb1('0x0'));var util=require(_0xcfb1('0x1'));var moment=require(_0xcfb1('0x2'));var BPromise=require(_0xcfb1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcfb1('0x4'));var db=require(_0xcfb1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcfb1('0x6'))(_0xcfb1('0x7'));var config=require('../../config/environment');var jayson=require(_0xcfb1('0x8'));var client=jayson['client'][_0xcfb1('0x9')]({'port':0x232c});config[_0xcfb1('0xa')]=_[_0xcfb1('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcfb1('0xc'))(new Redis(config[_0xcfb1('0xa')]));require(_0xcfb1('0xd'))['register'](socket);function respondWithRpcPromise(_0x2e09b3,_0x2d1a8,_0x37ef5f){return new BPromise(function(_0x11788c,_0x5dc48f){return client[_0xcfb1('0xe')](_0x2e09b3,_0x37ef5f)[_0xcfb1('0xf')](function(_0xbdd0c8){logger[_0xcfb1('0x10')](_0xcfb1('0x11'),_0x2d1a8,'request\x20sent');logger[_0xcfb1('0x12')](_0xcfb1('0x13'),_0x2d1a8,_0xcfb1('0x14'),JSON['stringify'](_0xbdd0c8));if(_0xbdd0c8[_0xcfb1('0x15')]){if(_0xbdd0c8['error'][_0xcfb1('0x16')]===0x1f4){logger[_0xcfb1('0x15')](_0xcfb1('0x11'),_0x2d1a8,_0xbdd0c8[_0xcfb1('0x15')][_0xcfb1('0x17')]);return _0x5dc48f(_0xbdd0c8['error'][_0xcfb1('0x17')]);}logger[_0xcfb1('0x15')](_0xcfb1('0x11'),_0x2d1a8,_0xbdd0c8[_0xcfb1('0x15')]['message']);return _0x11788c(_0xbdd0c8[_0xcfb1('0x15')][_0xcfb1('0x17')]);}else{logger['info'](_0xcfb1('0x11'),_0x2d1a8,'request\x20sent');_0x11788c(_0xbdd0c8[_0xcfb1('0x18')]['message']);}})['catch'](function(_0x3f34e3){logger[_0xcfb1('0x15')](_0xcfb1('0x11'),_0x2d1a8,_0x3f34e3);_0x5dc48f(_0x3f34e3);});});}exports[_0xcfb1('0x19')]=function(_0x145215){var _0x5e3638=this;return new Promise(function(_0x1d71f2,_0x3e0152){return db[_0xcfb1('0x1a')][_0xcfb1('0x1b')]({'raw':_0x145215[_0xcfb1('0x1c')]?_0x145215[_0xcfb1('0x1c')][_0xcfb1('0x1d')]===undefined?!![]:![]:!![],'where':_0x145215['options']?_0x145215[_0xcfb1('0x1c')][_0xcfb1('0x1e')]||null:null,'attributes':_0x145215[_0xcfb1('0x1c')]?_0x145215['options']['attributes']||null:null,'limit':_0x145215[_0xcfb1('0x1c')]?_0x145215[_0xcfb1('0x1c')][_0xcfb1('0x1f')]||null:null,'include':_0x145215[_0xcfb1('0x1c')]?_0x145215['options'][_0xcfb1('0x20')]?_[_0xcfb1('0x21')](_0x145215[_0xcfb1('0x1c')][_0xcfb1('0x20')],function(_0x40e640){return{'model':db[_0x40e640[_0xcfb1('0x22')]],'as':_0x40e640['as'],'attributes':_0x40e640[_0xcfb1('0x23')],'include':_0x40e640[_0xcfb1('0x20')]?_['map'](_0x40e640[_0xcfb1('0x20')],function(_0x5ae2f3){return{'model':db[_0x5ae2f3[_0xcfb1('0x22')]],'as':_0x5ae2f3['as'],'attributes':_0x5ae2f3[_0xcfb1('0x23')],'include':_0x5ae2f3[_0xcfb1('0x20')]?_['map'](_0x5ae2f3[_0xcfb1('0x20')],function(_0x495a01){return{'model':db[_0x495a01[_0xcfb1('0x22')]],'as':_0x495a01['as'],'attributes':_0x495a01['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x18695c){logger[_0xcfb1('0x10')]('GetFaxAccount',_0x145215);logger['debug'](_0xcfb1('0x19'),_0x145215,JSON[_0xcfb1('0x24')](_0x18695c));_0x1d71f2(_0x18695c);})[_0xcfb1('0x25')](function(_0x16a335){logger[_0xcfb1('0x15')](_0xcfb1('0x19'),_0x16a335[_0xcfb1('0x17')],_0x145215);_0x3e0152(_0x5e3638[_0xcfb1('0x15')](0x1f4,_0x16a335[_0xcfb1('0x17')]));});});};exports['NotifyFaxAccount']=function(_0x1b16be,_0x1b90b5,_0x60ae6c){var _0x308108=this;return new Promise(function(_0x54b454,_0x53bac4){var _0x2b2c6e={'body':_0x1b16be[_0xcfb1('0x26')],'channel':_0xcfb1('0x27')};var _0x44d60a=[];var _0x17321d=[];var _0x363a3a={};return db[_0xcfb1('0x28')][_0xcfb1('0x29')]()[_0xcfb1('0xf')](function(_0x58639c){if(!_0x58639c){throw new db[(_0xcfb1('0x2a'))][(_0xcfb1('0x2b'))](_0xcfb1('0x2c'));}_0x44d60a=_[_0xcfb1('0x2d')](_[_0xcfb1('0x2e')](_0x58639c),[_0xcfb1('0x2f'),_0xcfb1('0x30')]);_0x17321d=_[_0xcfb1('0x2d')](_[_0xcfb1('0x2e')](_0x58639c),[_0xcfb1('0x2f'),_0xcfb1('0x30'),_0xcfb1('0x31'),_0xcfb1('0x32')]);if(_0x1b16be[_0xcfb1('0x26')]['id']){delete _0x1b16be[_0xcfb1('0x26')]['id'];}if(_['isNil'](_0x1b16be[_0xcfb1('0x26')][_0xcfb1('0x33')])){throw new db[(_0xcfb1('0x2a'))][(_0xcfb1('0x2b'))](_0xcfb1('0x34'));}if(_['isNil'](_0x1b16be['body'][_0xcfb1('0x26')])||_0x1b16be[_0xcfb1('0x26')][_0xcfb1('0x26')]===''){throw new db[(_0xcfb1('0x2a'))][(_0xcfb1('0x2b'))](_0xcfb1('0x35'));}if(_[_0xcfb1('0x36')](_0x1b16be[_0xcfb1('0x26')][_0xcfb1('0x37')])){throw new db[(_0xcfb1('0x2a'))][(_0xcfb1('0x2b'))](_0xcfb1('0x38')+_0x17321d);}if(!_[_0xcfb1('0x39')](_0x17321d,_0x1b16be[_0xcfb1('0x26')][_0xcfb1('0x37')])){throw new db[(_0xcfb1('0x2a'))]['ValidationError'](_0xcfb1('0x3a')+_0x17321d);}_0x363a3a[_0x1b16be[_0xcfb1('0x26')][_0xcfb1('0x37')]]=_0x1b16be['body'][_0xcfb1('0x33')];})[_0xcfb1('0xf')](function(){return db[_0xcfb1('0x1a')][_0xcfb1('0x3b')]({'where':{'id':_0x1b16be[_0xcfb1('0x3c')]['id']},'include':[{'model':db[_0xcfb1('0x3d')],'as':'List','include':[{'model':db[_0xcfb1('0x28')],'as':'Contacts','where':_0x363a3a,'limit':0x1,'order':[[_0xcfb1('0x30'),'DESC']]}]},{'model':db[_0xcfb1('0x3e')],'as':'Applications'}]});})['then'](function(_0x53128b){if(_0x53128b&&_0x53128b[_0xcfb1('0x3f')]){var _0x2d43fb=_0x53128b[_0xcfb1('0x40')]({'plain':!![]});_0x2b2c6e[_0xcfb1('0x3c')]=_0x2d43fb;_0x2b2c6e['applications']=_0x2d43fb[_0xcfb1('0x41')];_0x2b2c6e[_0xcfb1('0x42')]=_0x2d43fb[_0xcfb1('0x3f')];_0x2b2c6e[_0xcfb1('0x43')]=_[_0xcfb1('0x44')](_0x2b2c6e['applications'],[_0xcfb1('0x45')],[_0xcfb1('0x46')]);if(_0x2b2c6e['account']['Applications']){delete _0x2b2c6e['account'][_0xcfb1('0x41')];}if(_0x2b2c6e[_0xcfb1('0x3c')][_0xcfb1('0x3f')]&&_0x2b2c6e[_0xcfb1('0x3c')][_0xcfb1('0x3f')][_0xcfb1('0x47')][_0xcfb1('0x48')]){return _0x2b2c6e['account']['List']['Contacts'][0x0];}var _0x411c0f=_[_0xcfb1('0xb')](_0x1b16be[_0xcfb1('0x26')],{'firstName':_0x1b16be[_0xcfb1('0x26')][_0xcfb1('0x33')],'ListId':_0x2d43fb[_0xcfb1('0x32')]});_0x411c0f[_0x1b16be['body'][_0xcfb1('0x37')]]=_0x1b16be[_0xcfb1('0x26')][_0xcfb1('0x33')];return db[_0xcfb1('0x28')]['create'](_0x411c0f,{'fields':_0x44d60a,'raw':!![]});}})[_0xcfb1('0xf')](function(_0x244a3d){_0x2b2c6e[_0xcfb1('0x49')]=_0x244a3d;if(_0x244a3d){var _0x2ecb55={'ContactId':_0x244a3d['id'],'FaxAccountId':_0x1b16be['account']['id'],'fax':_0x244a3d[_0xcfb1('0x27')]};return db[_0xcfb1('0x4a')]['find']({'where':{'ContactId':_0x244a3d['id'],'closed':![],'FaxAccountId':_0x1b16be[_0xcfb1('0x3c')]['id']}})[_0xcfb1('0xf')](function(_0x2c5ee3){if(_0x2c5ee3){return[_0x2c5ee3,![]];}return db[_0xcfb1('0x4a')][_0xcfb1('0x4b')](_0x2ecb55)[_0xcfb1('0xf')](function(_0x22fc30){return[_0x22fc30,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x104781,_0x400345){var _0x3c1c92=_0x104781[_0xcfb1('0x40')]({'plain':!![]});if(_0x400345){if(_0x2b2c6e[_0xcfb1('0x3c')][_0xcfb1('0x4c')]){_0x2b2c6e[_0xcfb1('0x43')][_0xcfb1('0x4d')]({'id':0x0,'priority':_0x2b2c6e['applications']['length']+0x1,'app':_0xcfb1('0x4e'),'appdata':'unmanaged','interval':_0xcfb1('0x4f')});}_0x3c1c92[_0xcfb1('0x50')]=!![];}else{_0x3c1c92[_0xcfb1('0x50')]=![];}_0x2b2c6e[_0xcfb1('0x51')]=_0x3c1c92;return db['FaxMessage'][_0xcfb1('0x4b')]({'body':_0x1b16be[_0xcfb1('0x26')]['body'],'FaxAccountId':_0x1b16be[_0xcfb1('0x3c')]['id'],'FaxInteractionId':_0x104781['id'],'direction':'in','ContactId':_0x104781[_0xcfb1('0x52')],'AttachmentId':_0x1b16be[_0xcfb1('0x26')][_0xcfb1('0x53')]});})[_0xcfb1('0xf')](function(_0x2a229a){_0x2b2c6e[_0xcfb1('0x17')]=_0x2a229a;if(_0x2b2c6e[_0xcfb1('0x51')][_0xcfb1('0x54')]){return db[_0xcfb1('0x55')]['find']({'attributes':['id',_0xcfb1('0x56')],'where':{'id':_0x2b2c6e[_0xcfb1('0x51')][_0xcfb1('0x54')]}})['then'](function(_0x3d3725){if(_0x3d3725){_0x2b2c6e[_0xcfb1('0x43')][_0xcfb1('0x57')]({'id':0x0,'priority':0x0,'app':_0xcfb1('0x58'),'appdata':_0x3d3725[_0xcfb1('0x56')]+','+(_0x2b2c6e[_0xcfb1('0x3c')][_0xcfb1('0x59')]||0xa),'interval':_0xcfb1('0x4f')});}return respondWithRpcPromise(_0xcfb1('0x5a'),_0xcfb1('0x5b'),_0x2b2c6e);});}return respondWithRpcPromise('Start',_0xcfb1('0x5b'),_0x2b2c6e);})[_0xcfb1('0xf')](function(_0x3bfb0e){_0x54b454(_0x3bfb0e);})[_0xcfb1('0x25')](function(_0x5b844e){_0x53bac4(_0x308108[_0xcfb1('0x15')](0x1f4,_0x5b844e[_0xcfb1('0x17')]));});});}; \ No newline at end of file +var _0xe980=['find','account','CmList','List','Contacts','DESC','FaxApplication','applications','Applications','priority','asc','length','create','contact','FaxInteraction','spread','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','AttachmentId','User','agent','name','waitForTheAssignedAgent','Start','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','register','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','model','map','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe980,0x74));var _0x0e98=function(_0x4eb467,_0x21c157){_0x4eb467=_0x4eb467-0x0;var _0x515d3d=_0xe980[_0x4eb467];return _0x515d3d;};'use strict';var _=require(_0x0e98('0x0'));var util=require(_0x0e98('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0e98('0x2'));var fs=require('fs');var Redis=require(_0x0e98('0x3'));var db=require(_0x0e98('0x4'))['db'];var utils=require(_0x0e98('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0e98('0x6'));var jayson=require(_0x0e98('0x7'));var client=jayson[_0x0e98('0x8')][_0x0e98('0x9')]({'port':0x232c});config[_0x0e98('0xa')]=_['defaults'](config['redis'],{'host':_0x0e98('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0e98('0xa')]));require('./faxAccount.socket')[_0x0e98('0xc')](socket);function respondWithRpcPromise(_0x88224a,_0x3c09b2,_0x1c9801){return new BPromise(function(_0x3edf0b,_0x19f415){return client['request'](_0x88224a,_0x1c9801)[_0x0e98('0xd')](function(_0xe35f95){logger[_0x0e98('0xe')](_0x0e98('0xf'),_0x3c09b2,_0x0e98('0x10'));logger[_0x0e98('0x11')](_0x0e98('0x12'),_0x3c09b2,'request\x20sent',JSON[_0x0e98('0x13')](_0xe35f95));if(_0xe35f95[_0x0e98('0x14')]){if(_0xe35f95['error'][_0x0e98('0x15')]===0x1f4){logger[_0x0e98('0x14')]('FaxAccount,\x20%s,\x20%s',_0x3c09b2,_0xe35f95['error'][_0x0e98('0x16')]);return _0x19f415(_0xe35f95['error'][_0x0e98('0x16')]);}logger['error'](_0x0e98('0xf'),_0x3c09b2,_0xe35f95[_0x0e98('0x14')]['message']);return _0x3edf0b(_0xe35f95[_0x0e98('0x14')][_0x0e98('0x16')]);}else{logger[_0x0e98('0xe')](_0x0e98('0xf'),_0x3c09b2,_0x0e98('0x10'));_0x3edf0b(_0xe35f95[_0x0e98('0x17')]['message']);}})[_0x0e98('0x18')](function(_0xee991c){logger[_0x0e98('0x14')](_0x0e98('0xf'),_0x3c09b2,_0xee991c);_0x19f415(_0xee991c);});});}exports[_0x0e98('0x19')]=function(_0x31a7eb){var _0x312530=this;return new Promise(function(_0x2c1ed5,_0x495e3b){return db[_0x0e98('0x1a')][_0x0e98('0x1b')]({'raw':_0x31a7eb[_0x0e98('0x1c')]?_0x31a7eb[_0x0e98('0x1c')][_0x0e98('0x1d')]===undefined?!![]:![]:!![],'where':_0x31a7eb[_0x0e98('0x1c')]?_0x31a7eb['options'][_0x0e98('0x1e')]||null:null,'attributes':_0x31a7eb[_0x0e98('0x1c')]?_0x31a7eb[_0x0e98('0x1c')][_0x0e98('0x1f')]||null:null,'limit':_0x31a7eb[_0x0e98('0x1c')]?_0x31a7eb[_0x0e98('0x1c')][_0x0e98('0x20')]||null:null,'include':_0x31a7eb[_0x0e98('0x1c')]?_0x31a7eb['options'][_0x0e98('0x21')]?_['map'](_0x31a7eb['options'][_0x0e98('0x21')],function(_0x32ff70){return{'model':db[_0x32ff70[_0x0e98('0x22')]],'as':_0x32ff70['as'],'attributes':_0x32ff70[_0x0e98('0x1f')],'include':_0x32ff70[_0x0e98('0x21')]?_['map'](_0x32ff70[_0x0e98('0x21')],function(_0x13751f){return{'model':db[_0x13751f[_0x0e98('0x22')]],'as':_0x13751f['as'],'attributes':_0x13751f[_0x0e98('0x1f')],'include':_0x13751f[_0x0e98('0x21')]?_[_0x0e98('0x23')](_0x13751f[_0x0e98('0x21')],function(_0x24f049){return{'model':db[_0x24f049[_0x0e98('0x22')]],'as':_0x24f049['as'],'attributes':_0x24f049['attributes']};}):[]};}):[]};}):[]:[]})[_0x0e98('0xd')](function(_0x5bac9f){logger[_0x0e98('0xe')](_0x0e98('0x19'),_0x31a7eb);logger[_0x0e98('0x11')](_0x0e98('0x19'),_0x31a7eb,JSON[_0x0e98('0x13')](_0x5bac9f));_0x2c1ed5(_0x5bac9f);})[_0x0e98('0x18')](function(_0x3febc6){logger[_0x0e98('0x14')](_0x0e98('0x19'),_0x3febc6[_0x0e98('0x16')],_0x31a7eb);_0x495e3b(_0x312530[_0x0e98('0x14')](0x1f4,_0x3febc6[_0x0e98('0x16')]));});});};exports[_0x0e98('0x24')]=function(_0x8d3dc6,_0x2a7f99,_0x2f0b01){var _0x3c42ab=this;return new Promise(function(_0x193bdc,_0x31584f){var _0x5a7f2d={'body':_0x8d3dc6[_0x0e98('0x25')],'channel':_0x0e98('0x26')};var _0xa0b5d4=[];var _0xfa5f44=[];var _0x20ac3f={};return db[_0x0e98('0x27')][_0x0e98('0x28')]()[_0x0e98('0xd')](function(_0x2277ca){if(!_0x2277ca){throw new db[(_0x0e98('0x29'))][(_0x0e98('0x2a'))](_0x0e98('0x2b'));}_0xa0b5d4=_[_0x0e98('0x2c')](_[_0x0e98('0x2d')](_0x2277ca),[_0x0e98('0x2e'),_0x0e98('0x2f')]);_0xfa5f44=_['difference'](_['keys'](_0x2277ca),['createdAt',_0x0e98('0x2f'),_0x0e98('0x30'),_0x0e98('0x31')]);if(_0x8d3dc6[_0x0e98('0x25')]['id']){delete _0x8d3dc6['body']['id'];}if(_[_0x0e98('0x32')](_0x8d3dc6[_0x0e98('0x25')][_0x0e98('0x33')])){throw new db[(_0x0e98('0x29'))][(_0x0e98('0x2a'))](_0x0e98('0x34'));}if(_[_0x0e98('0x32')](_0x8d3dc6['body']['body'])||_0x8d3dc6[_0x0e98('0x25')][_0x0e98('0x25')]===''){throw new db[(_0x0e98('0x29'))]['ValidationError'](_0x0e98('0x35'));}if(_['isNil'](_0x8d3dc6[_0x0e98('0x25')][_0x0e98('0x36')])){throw new db[(_0x0e98('0x29'))][(_0x0e98('0x2a'))](_0x0e98('0x37')+_0xfa5f44);}if(!_[_0x0e98('0x38')](_0xfa5f44,_0x8d3dc6['body'][_0x0e98('0x36')])){throw new db[(_0x0e98('0x29'))][(_0x0e98('0x2a'))](_0x0e98('0x39')+_0xfa5f44);}_0x20ac3f[_0x8d3dc6[_0x0e98('0x25')][_0x0e98('0x36')]]=_0x8d3dc6[_0x0e98('0x25')][_0x0e98('0x33')];})[_0x0e98('0xd')](function(){return db[_0x0e98('0x1a')][_0x0e98('0x3a')]({'where':{'id':_0x8d3dc6[_0x0e98('0x3b')]['id']},'include':[{'model':db[_0x0e98('0x3c')],'as':_0x0e98('0x3d'),'include':[{'model':db[_0x0e98('0x27')],'as':_0x0e98('0x3e'),'where':_0x20ac3f,'limit':0x1,'order':[[_0x0e98('0x2f'),_0x0e98('0x3f')]]}]},{'model':db[_0x0e98('0x40')],'as':'Applications'}]});})['then'](function(_0xc5802d){if(_0xc5802d&&_0xc5802d[_0x0e98('0x3d')]){var _0x22a737=_0xc5802d['get']({'plain':!![]});_0x5a7f2d[_0x0e98('0x3b')]=_0x22a737;_0x5a7f2d[_0x0e98('0x41')]=_0x22a737[_0x0e98('0x42')];_0x5a7f2d['list']=_0x22a737['List'];_0x5a7f2d[_0x0e98('0x41')]=_['orderBy'](_0x5a7f2d['applications'],[_0x0e98('0x43')],[_0x0e98('0x44')]);if(_0x5a7f2d[_0x0e98('0x3b')][_0x0e98('0x42')]){delete _0x5a7f2d[_0x0e98('0x3b')][_0x0e98('0x42')];}if(_0x5a7f2d[_0x0e98('0x3b')][_0x0e98('0x3d')]&&_0x5a7f2d[_0x0e98('0x3b')]['List'][_0x0e98('0x3e')][_0x0e98('0x45')]){return _0x5a7f2d[_0x0e98('0x3b')][_0x0e98('0x3d')][_0x0e98('0x3e')][0x0];}var _0x53950d=_['defaults'](_0x8d3dc6[_0x0e98('0x25')],{'firstName':_0x8d3dc6['body'][_0x0e98('0x33')],'ListId':_0x22a737[_0x0e98('0x31')]});_0x53950d[_0x8d3dc6[_0x0e98('0x25')][_0x0e98('0x36')]]=_0x8d3dc6[_0x0e98('0x25')]['from'];return db['CmContact'][_0x0e98('0x46')](_0x53950d,{'fields':_0xa0b5d4,'raw':!![]});}})[_0x0e98('0xd')](function(_0x21eca2){_0x5a7f2d[_0x0e98('0x47')]=_0x21eca2;if(_0x21eca2){var _0x326ff4={'ContactId':_0x21eca2['id'],'FaxAccountId':_0x8d3dc6[_0x0e98('0x3b')]['id'],'fax':_0x21eca2[_0x0e98('0x26')]};return db[_0x0e98('0x48')][_0x0e98('0x3a')]({'where':{'ContactId':_0x21eca2['id'],'closed':![],'FaxAccountId':_0x8d3dc6[_0x0e98('0x3b')]['id']}})['then'](function(_0x1d4545){if(_0x1d4545){return[_0x1d4545,![]];}return db['FaxInteraction'][_0x0e98('0x46')](_0x326ff4)[_0x0e98('0xd')](function(_0x4c0aff){return[_0x4c0aff,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x0e98('0x49')](function(_0x29a3be,_0x5dd2b4){var _0x371b78=_0x29a3be['get']({'plain':!![]});if(_0x5dd2b4){if(_0x5a7f2d['account']['autoclose']){_0x5a7f2d[_0x0e98('0x41')][_0x0e98('0x4a')]({'id':0x0,'priority':_0x5a7f2d[_0x0e98('0x41')][_0x0e98('0x45')]+0x1,'app':_0x0e98('0x4b'),'appdata':_0x0e98('0x4c'),'interval':_0x0e98('0x4d')});}_0x371b78[_0x0e98('0x4e')]=!![];}else{_0x371b78[_0x0e98('0x4e')]=![];}_0x5a7f2d[_0x0e98('0x4f')]=_0x371b78;return db[_0x0e98('0x50')]['create']({'body':_0x8d3dc6[_0x0e98('0x25')]['body'],'FaxAccountId':_0x8d3dc6[_0x0e98('0x3b')]['id'],'FaxInteractionId':_0x29a3be['id'],'direction':'in','ContactId':_0x29a3be['ContactId'],'AttachmentId':_0x8d3dc6[_0x0e98('0x25')][_0x0e98('0x51')]});})['then'](function(_0x1153b4){_0x5a7f2d[_0x0e98('0x16')]=_0x1153b4;if(_0x5a7f2d[_0x0e98('0x4f')]['UserId']){return db[_0x0e98('0x52')][_0x0e98('0x3a')]({'attributes':['id','name'],'where':{'id':_0x5a7f2d[_0x0e98('0x4f')]['UserId']}})[_0x0e98('0xd')](function(_0x565185){if(_0x565185){_0x5a7f2d['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x0e98('0x53'),'appdata':_0x565185[_0x0e98('0x54')]+','+(_0x5a7f2d[_0x0e98('0x3b')][_0x0e98('0x55')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x0e98('0x56'),'startRouting',_0x5a7f2d);});}return respondWithRpcPromise(_0x0e98('0x56'),'startRouting',_0x5a7f2d);})[_0x0e98('0xd')](function(_0xe4f586){_0x193bdc(_0xe4f586);})[_0x0e98('0x18')](function(_0x55b8d8){_0x31584f(_0x3c42ab['error'](0x1f4,_0x55b8d8[_0x0e98('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 896da7d..161c495 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 _0x1a37=['remove','update','emit','register','length','./faxAccount.events','save'];(function(_0xfa4cf6,_0x124e4e){var _0x1d5e45=function(_0xce067d){while(--_0xce067d){_0xfa4cf6['push'](_0xfa4cf6['shift']());}};_0x1d5e45(++_0x124e4e);}(_0x1a37,0xb4));var _0x71a3=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x1a37[_0x24061a];return _0x82054e;};'use strict';var FaxAccountEvents=require(_0x71a3('0x0'));var events=[_0x71a3('0x1'),_0x71a3('0x2'),_0x71a3('0x3')];function createListener(_0x353cf0,_0x20d8a7){return function(_0x348395){_0x20d8a7[_0x71a3('0x4')](_0x353cf0,_0x348395);};}function removeListener(_0x29c54f,_0x100181){return function(){FaxAccountEvents['removeListener'](_0x29c54f,_0x100181);};}exports[_0x71a3('0x5')]=function(_0x4f6b7a){for(var _0xd09f7=0x0,_0x45050a=events[_0x71a3('0x6')];_0xd09f7<_0x45050a;_0xd09f7++){var _0x2bb6a2=events[_0xd09f7];var _0x4a9ab2=createListener('faxAccount:'+_0x2bb6a2,_0x4f6b7a);FaxAccountEvents['on'](_0x2bb6a2,_0x4a9ab2);}}; \ No newline at end of file +var _0x5496=['faxAccount:','./faxAccount.events','save','remove','update','removeListener'];(function(_0x3e5145,_0x571344){var _0x3dab37=function(_0x30f81b){while(--_0x30f81b){_0x3e5145['push'](_0x3e5145['shift']());}};_0x3dab37(++_0x571344);}(_0x5496,0x175));var _0x6549=function(_0x5e716b,_0x28fd1c){_0x5e716b=_0x5e716b-0x0;var _0x4c6bfb=_0x5496[_0x5e716b];return _0x4c6bfb;};'use strict';var FaxAccountEvents=require(_0x6549('0x0'));var events=[_0x6549('0x1'),_0x6549('0x2'),_0x6549('0x3')];function createListener(_0x465fee,_0x4b616a){return function(_0x21585c){_0x4b616a['emit'](_0x465fee,_0x21585c);};}function removeListener(_0x2d2155,_0x8112c5){return function(){FaxAccountEvents[_0x6549('0x4')](_0x2d2155,_0x8112c5);};}exports['register']=function(_0x5a4658){for(var _0x43cb17=0x0,_0x1d8cea=events['length'];_0x43cb17<_0x1d8cea;_0x43cb17++){var _0x1ca8fc=events[_0x43cb17];var _0x3442c3=createListener(_0x6549('0x5')+_0x1ca8fc,_0x5a4658);FaxAccountEvents['on'](_0x1ca8fc,_0x3442c3);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index e846336..e991625 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 _0x1535=['show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','create','post','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x292f16,_0x54de9f){var _0x50e784=function(_0x419560){while(--_0x419560){_0x292f16['push'](_0x292f16['shift']());}};_0x50e784(++_0x54de9f);}(_0x1535,0xbf));var _0x5153=function(_0x480589,_0x34cdaa){_0x480589=_0x480589-0x0;var _0x1f159f=_0x1535[_0x480589];return _0x1f159f;};'use strict';var multer=require(_0x5153('0x0'));var util=require(_0x5153('0x1'));var path=require('path');var timeout=require(_0x5153('0x2'));var express=require(_0x5153('0x3'));var router=express[_0x5153('0x4')]();var auth=require(_0x5153('0x5'));var interaction=require(_0x5153('0x6'));var config=require(_0x5153('0x7'));var controller=require(_0x5153('0x8'));router[_0x5153('0x9')]('/',auth[_0x5153('0xa')](),controller[_0x5153('0xb')]);router['get'](_0x5153('0xc'),auth[_0x5153('0xa')](),controller['describe']);router[_0x5153('0x9')](_0x5153('0xd'),auth['isAuthenticated'](),controller[_0x5153('0xe')]);router[_0x5153('0x9')](_0x5153('0xf'),auth[_0x5153('0xa')](),controller['getDispositions']);router[_0x5153('0x9')](_0x5153('0x10'),auth[_0x5153('0xa')](),controller[_0x5153('0x11')]);router[_0x5153('0x9')](_0x5153('0x12'),auth[_0x5153('0xa')](),controller[_0x5153('0x13')]);router[_0x5153('0x9')](_0x5153('0x14'),auth['isAuthenticated'](),controller['getApplications']);router[_0x5153('0x9')](_0x5153('0x15'),auth[_0x5153('0xa')](),controller[_0x5153('0x16')]);router[_0x5153('0x9')](_0x5153('0x17'),auth[_0x5153('0xa')](),controller[_0x5153('0x18')]);router['post']('/',auth[_0x5153('0xa')](),controller[_0x5153('0x19')]);router[_0x5153('0x1a')](_0x5153('0xf'),auth[_0x5153('0xa')](),controller['addDisposition']);router[_0x5153('0x1a')](_0x5153('0x10'),auth[_0x5153('0xa')](),controller[_0x5153('0x1b')]);router['post']('/:id/interactions',auth[_0x5153('0xa')](),controller[_0x5153('0x1c')]);router[_0x5153('0x1a')]('/:id/applications',auth[_0x5153('0xa')](),controller[_0x5153('0x1d')]);router['post']('/addaccountapplications',auth[_0x5153('0xa')](),controller[_0x5153('0x1e')]);router['post'](_0x5153('0x1f'),auth[_0x5153('0xa')](),controller[_0x5153('0x20')]);router['post'](_0x5153('0x21'),auth['isAuthenticated'](),controller['send']);router[_0x5153('0x1a')](_0x5153('0x17'),auth[_0x5153('0xa')](),controller['addAgents']);router[_0x5153('0x22')]('/:id',auth[_0x5153('0xa')](),controller[_0x5153('0x23')]);router['delete'](_0x5153('0xd'),auth[_0x5153('0xa')](),controller[_0x5153('0x24')]);router[_0x5153('0x25')](_0x5153('0xf'),auth[_0x5153('0xa')](),controller[_0x5153('0x26')]);router[_0x5153('0x25')](_0x5153('0x10'),auth[_0x5153('0xa')](),controller[_0x5153('0x27')]);router[_0x5153('0x25')](_0x5153('0x17'),auth[_0x5153('0xa')](),controller[_0x5153('0x28')]);module['exports']=router; \ No newline at end of file +var _0xc6ff=['isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/interactions','getInteractions','/:id/applications','getAgents','post','addDisposition','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','/:id/users','addAgents','put','update','removeDispositions','delete','removeAnswers','removeAgents','exports','multer','util','path','../../components/interaction/service','../../config/environment','./faxAccount.controller','get'];(function(_0x1f9cb3,_0x2e0f28){var _0x54e769=function(_0x18e1f8){while(--_0x18e1f8){_0x1f9cb3['push'](_0x1f9cb3['shift']());}};_0x54e769(++_0x2e0f28);}(_0xc6ff,0x89));var _0xfc6f=function(_0xae864c,_0xf04a6b){_0xae864c=_0xae864c-0x0;var _0x5b0527=_0xc6ff[_0xae864c];return _0x5b0527;};'use strict';var multer=require(_0xfc6f('0x0'));var util=require(_0xfc6f('0x1'));var path=require(_0xfc6f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xfc6f('0x3'));var config=require(_0xfc6f('0x4'));var controller=require(_0xfc6f('0x5'));router[_0xfc6f('0x6')]('/',auth[_0xfc6f('0x7')](),controller['index']);router['get']('/describe',auth[_0xfc6f('0x7')](),controller[_0xfc6f('0x8')]);router['get'](_0xfc6f('0x9'),auth[_0xfc6f('0x7')](),controller[_0xfc6f('0xa')]);router[_0xfc6f('0x6')](_0xfc6f('0xb'),auth['isAuthenticated'](),controller[_0xfc6f('0xc')]);router[_0xfc6f('0x6')](_0xfc6f('0xd'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xfc6f('0x6')](_0xfc6f('0xe'),auth[_0xfc6f('0x7')](),controller[_0xfc6f('0xf')]);router[_0xfc6f('0x6')](_0xfc6f('0x10'),auth['isAuthenticated'](),controller['getApplications']);router[_0xfc6f('0x6')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router['get']('/:id/users',auth[_0xfc6f('0x7')](),controller[_0xfc6f('0x11')]);router[_0xfc6f('0x12')]('/',auth[_0xfc6f('0x7')](),controller['create']);router['post'](_0xfc6f('0xb'),auth[_0xfc6f('0x7')](),controller[_0xfc6f('0x13')]);router[_0xfc6f('0x12')](_0xfc6f('0xd'),auth[_0xfc6f('0x7')](),controller['addAnswer']);router[_0xfc6f('0x12')](_0xfc6f('0xe'),auth[_0xfc6f('0x7')](),controller[_0xfc6f('0x14')]);router[_0xfc6f('0x12')](_0xfc6f('0x10'),auth['isAuthenticated'](),controller[_0xfc6f('0x15')]);router[_0xfc6f('0x12')](_0xfc6f('0x16'),auth[_0xfc6f('0x7')](),controller[_0xfc6f('0x17')]);router[_0xfc6f('0x12')](_0xfc6f('0x18'),auth[_0xfc6f('0x7')](),controller[_0xfc6f('0x19')]);router['post'](_0xfc6f('0x1a'),auth[_0xfc6f('0x7')](),controller['send']);router[_0xfc6f('0x12')](_0xfc6f('0x1b'),auth['isAuthenticated'](),controller[_0xfc6f('0x1c')]);router[_0xfc6f('0x1d')](_0xfc6f('0x9'),auth['isAuthenticated'](),controller[_0xfc6f('0x1e')]);router['delete'](_0xfc6f('0x9'),auth[_0xfc6f('0x7')](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0xfc6f('0x7')](),controller[_0xfc6f('0x1f')]);router[_0xfc6f('0x20')](_0xfc6f('0xd'),auth[_0xfc6f('0x7')](),controller[_0xfc6f('0x21')]);router[_0xfc6f('0x20')](_0xfc6f('0x1b'),auth[_0xfc6f('0x7')](),controller[_0xfc6f('0x22')]);module[_0xfc6f('0x23')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 7677345..05d40bf 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 _0xb4d9=['TEXT','*,*,*,*','sequelize','exports','STRING','noop'];(function(_0x1be861,_0x1eff71){var _0x364b4b=function(_0x327687){while(--_0x327687){_0x1be861['push'](_0x1be861['shift']());}};_0x364b4b(++_0x1eff71);}(_0xb4d9,0xce));var _0x9b4d=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xb4d9[_0x45d3f0];return _0x314b79;};'use strict';var Sequelize=require(_0x9b4d('0x0'));module[_0x9b4d('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x9b4d('0x2')],'allowNull':![],'defaultValue':_0x9b4d('0x3')},'appdata':{'type':Sequelize[_0x9b4d('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x9b4d('0x2')],'defaultValue':_0x9b4d('0x5')}}; \ No newline at end of file +var _0x471a=['STRING','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x471a,0x18d));var _0xa471=function(_0x594b57,_0x6115fb){_0x594b57=_0x594b57-0x0;var _0xa6ab15=_0x471a[_0x594b57];return _0xa6ab15;};'use strict';var Sequelize=require(_0xa471('0x0'));module[_0xa471('0x1')]={'priority':{'type':Sequelize[_0xa471('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa471('0x3')},'appdata':{'type':Sequelize[_0xa471('0x4')]()},'description':{'type':Sequelize[_0xa471('0x5')]},'interval':{'type':Sequelize[_0xa471('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 7886a4e..00ec08c 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 _0xecd5=['../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','destroy','error','stack','name','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','then','catch','show','params','options','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x5c0a4b,_0x1b5b4a){var _0x136dea=function(_0x3e6b6f){while(--_0x3e6b6f){_0x5c0a4b['push'](_0x5c0a4b['shift']());}};_0x136dea(++_0x1b5b4a);}(_0xecd5,0x110));var _0x5ecd=function(_0x135d61,_0x59431b){_0x135d61=_0x135d61-0x0;var _0x505976=_0xecd5[_0x135d61];return _0x505976;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5ecd('0x0'));var rimraf=require(_0x5ecd('0x1'));var zipdir=require(_0x5ecd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5ecd('0x3'));var moment=require(_0x5ecd('0x4'));var BPromise=require(_0x5ecd('0x5'));var Mustache=require(_0x5ecd('0x6'));var util=require('util');var path=require(_0x5ecd('0x7'));var sox=require('sox');var csv=require(_0x5ecd('0x8'));var ejs=require(_0x5ecd('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5ecd('0xa'));var crypto=require(_0x5ecd('0xb'));var jsforce=require(_0x5ecd('0xc'));var deskjs=require(_0x5ecd('0xd'));var toCsv=require(_0x5ecd('0x8'));var querystring=require(_0x5ecd('0xe'));var Papa=require(_0x5ecd('0xf'));var Redis=require(_0x5ecd('0x10'));var authService=require(_0x5ecd('0x11'));var qs=require(_0x5ecd('0x12'));var as=require(_0x5ecd('0x13'));var hardwareService=require(_0x5ecd('0x14'));var logger=require('../../config/logger')(_0x5ecd('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5ecd('0x16'))['db'];function respondWithStatusCode(_0x15dec9,_0x4b7add){_0x4b7add=_0x4b7add||0xcc;return function(_0x4fc1ec){if(_0x4fc1ec){return _0x15dec9[_0x5ecd('0x17')](_0x4b7add);}return _0x15dec9[_0x5ecd('0x18')](_0x4b7add)[_0x5ecd('0x19')]();};}function respondWithResult(_0x37bfe1,_0x57bd97){_0x57bd97=_0x57bd97||0xc8;return function(_0x3b918c){if(_0x3b918c){return _0x37bfe1[_0x5ecd('0x18')](_0x57bd97)['json'](_0x3b918c);}};}function respondWithFilteredResult(_0x3619c8,_0xacc5c4){return function(_0x48442a){if(_0x48442a){var _0x458899=_0x48442a[_0x5ecd('0x1a')],_0x4a0e19=_0xacc5c4[_0x5ecd('0x1b')],_0x308374=_0xacc5c4[_0x5ecd('0x1b')]+_0xacc5c4[_0x5ecd('0x1c')],_0x36fb64;if(_0x308374>=_0x458899){_0x308374=_0x458899;_0x36fb64=0xc8;}else{_0x36fb64=0xce;}_0x3619c8[_0x5ecd('0x18')](_0x36fb64);return _0x3619c8[_0x5ecd('0x1d')](_0x5ecd('0x1e'),_0x4a0e19+'-'+_0x308374+'/'+_0x458899)[_0x5ecd('0x1f')](_0x48442a);}return null;};}function patchUpdates(_0x3a0db9){return function(_0x2c18f8){try{jsonpatch['apply'](_0x2c18f8,_0x3a0db9,!![]);}catch(_0x249988){return BPromise[_0x5ecd('0x20')](_0x249988);}return _0x2c18f8[_0x5ecd('0x21')]();};}function saveUpdates(_0x2c191b,_0xea18b7){return function(_0x5e7d1f){if(_0x5e7d1f){return _0x5e7d1f[_0x5ecd('0x22')](_0x2c191b)['then'](function(_0x450669){return _0x450669;});}return null;};}function removeEntity(_0x38ea0e,_0x38e74e){return function(_0x3c8e2b){if(_0x3c8e2b){return _0x3c8e2b[_0x5ecd('0x23')]()['then'](function(){_0x38ea0e[_0x5ecd('0x18')](0xcc)[_0x5ecd('0x19')]();});}};}function handleEntityNotFound(_0x1d9161,_0x57168b){return function(_0xe80905){if(!_0xe80905){_0x1d9161[_0x5ecd('0x17')](0x194);}return _0xe80905;};}function handleError(_0x257d4a,_0x29116a){_0x29116a=_0x29116a||0x1f4;return function(_0x29f8c0){logger[_0x5ecd('0x24')](_0x29f8c0[_0x5ecd('0x25')]);if(_0x29f8c0[_0x5ecd('0x26')]){delete _0x29f8c0['name'];}_0x257d4a[_0x5ecd('0x18')](_0x29116a)['send'](_0x29f8c0);};}exports[_0x5ecd('0x27')]=function(_0x36d964,_0x3d70da){var _0x27e422={},_0x1729c2={},_0x57a775={'count':0x0,'rows':[]};var _0x446324=_[_0x5ecd('0x28')](db[_0x5ecd('0x29')][_0x5ecd('0x2a')],function(_0x389b88){return{'name':_0x389b88[_0x5ecd('0x2b')],'type':_0x389b88[_0x5ecd('0x2c')][_0x5ecd('0x2d')]};});_0x1729c2[_0x5ecd('0x2e')]=_[_0x5ecd('0x28')](_0x446324,_0x5ecd('0x26'));_0x1729c2[_0x5ecd('0x2f')]=_[_0x5ecd('0x30')](_0x36d964[_0x5ecd('0x2f')]);_0x1729c2[_0x5ecd('0x31')]=_[_0x5ecd('0x32')](_0x1729c2[_0x5ecd('0x2e')],_0x1729c2['query']);_0x27e422[_0x5ecd('0x33')]=_[_0x5ecd('0x32')](_0x1729c2[_0x5ecd('0x2e')],qs[_0x5ecd('0x34')](_0x36d964[_0x5ecd('0x2f')]['fields']));_0x27e422[_0x5ecd('0x33')]=_0x27e422[_0x5ecd('0x33')][_0x5ecd('0x35')]?_0x27e422[_0x5ecd('0x33')]:_0x1729c2[_0x5ecd('0x2e')];if(!_0x36d964['query'][_0x5ecd('0x36')](_0x5ecd('0x37'))){_0x27e422[_0x5ecd('0x1c')]=qs['limit'](_0x36d964[_0x5ecd('0x2f')][_0x5ecd('0x1c')]);_0x27e422[_0x5ecd('0x1b')]=qs[_0x5ecd('0x1b')](_0x36d964[_0x5ecd('0x2f')][_0x5ecd('0x1b')]);}_0x27e422['order']=qs[_0x5ecd('0x38')](_0x36d964['query']['sort']);_0x27e422[_0x5ecd('0x39')]=qs[_0x5ecd('0x31')](_[_0x5ecd('0x3a')](_0x36d964[_0x5ecd('0x2f')],_0x1729c2[_0x5ecd('0x31')]));if(_0x36d964[_0x5ecd('0x2f')]['filter']){_0x27e422['where']=_[_0x5ecd('0x3b')](_0x27e422[_0x5ecd('0x39')],{'$or':_[_0x5ecd('0x28')](_0x446324,function(_0x3df69c){if(_0x3df69c[_0x5ecd('0x2c')]!==_0x5ecd('0x3c')){var _0x5fe996={};_0x5fe996[_0x3df69c['name']]={'$like':'%'+_0x36d964[_0x5ecd('0x2f')][_0x5ecd('0x3d')]+'%'};return _0x5fe996;}})});}_0x27e422=_[_0x5ecd('0x3b')]({},_0x27e422,_0x36d964['options']);var _0x27e45c={'where':_0x27e422[_0x5ecd('0x39')]};return db[_0x5ecd('0x29')]['count'](_0x27e45c)['then'](function(_0x5c553f){_0x57a775[_0x5ecd('0x1a')]=_0x5c553f;if(_0x36d964['query'][_0x5ecd('0x3e')]){_0x27e422[_0x5ecd('0x3f')]=[{'all':!![]}];}return db['FaxApplication'][_0x5ecd('0x40')](_0x27e422);})[_0x5ecd('0x41')](function(_0x1c6550){_0x57a775['rows']=_0x1c6550;return _0x57a775;})[_0x5ecd('0x41')](respondWithFilteredResult(_0x3d70da,_0x27e422))[_0x5ecd('0x42')](handleError(_0x3d70da,null));};exports[_0x5ecd('0x43')]=function(_0xd8837f,_0x9d895f){var _0x4bacdc={'raw':!![],'where':{'id':_0xd8837f[_0x5ecd('0x44')]['id']}},_0x129eed={};_0x129eed['model']=_['keys'](db[_0x5ecd('0x29')][_0x5ecd('0x2a')]);_0x129eed[_0x5ecd('0x2f')]=_['keys'](_0xd8837f[_0x5ecd('0x2f')]);_0x129eed['filters']=_[_0x5ecd('0x32')](_0x129eed['model'],_0x129eed['query']);_0x4bacdc['attributes']=_[_0x5ecd('0x32')](_0x129eed[_0x5ecd('0x2e')],qs[_0x5ecd('0x34')](_0xd8837f['query']['fields']));_0x4bacdc[_0x5ecd('0x33')]=_0x4bacdc['attributes'][_0x5ecd('0x35')]?_0x4bacdc[_0x5ecd('0x33')]:_0x129eed[_0x5ecd('0x2e')];if(_0xd8837f['query']['includeAll']){_0x4bacdc['include']=[{'all':!![]}];}_0x4bacdc=_['merge']({},_0x4bacdc,_0xd8837f[_0x5ecd('0x45')]);return db['FaxApplication']['find'](_0x4bacdc)[_0x5ecd('0x41')](handleEntityNotFound(_0x9d895f,null))[_0x5ecd('0x41')](respondWithResult(_0x9d895f,null))['catch'](handleError(_0x9d895f,null));};exports[_0x5ecd('0x46')]=function(_0x173947,_0x477b74){return db['FaxApplication'][_0x5ecd('0x46')](_0x173947[_0x5ecd('0x47')],{})[_0x5ecd('0x41')](respondWithResult(_0x477b74,0xc9))[_0x5ecd('0x42')](handleError(_0x477b74,null));};exports[_0x5ecd('0x22')]=function(_0x3e6504,_0x2cf571){if(_0x3e6504[_0x5ecd('0x47')]['id']){delete _0x3e6504[_0x5ecd('0x47')]['id'];}return db['FaxApplication'][_0x5ecd('0x48')]({'where':{'id':_0x3e6504[_0x5ecd('0x44')]['id']}})[_0x5ecd('0x41')](handleEntityNotFound(_0x2cf571,null))[_0x5ecd('0x41')](saveUpdates(_0x3e6504[_0x5ecd('0x47')],null))[_0x5ecd('0x41')](respondWithResult(_0x2cf571,null))[_0x5ecd('0x42')](handleError(_0x2cf571,null));};exports[_0x5ecd('0x23')]=function(_0x53de39,_0x1867f6){return db[_0x5ecd('0x29')]['find']({'where':{'id':_0x53de39[_0x5ecd('0x44')]['id']}})[_0x5ecd('0x41')](handleEntityNotFound(_0x1867f6,null))['then'](removeEntity(_0x1867f6,null))[_0x5ecd('0x42')](handleError(_0x1867f6,null));}; \ No newline at end of file +var _0x43fd=['count','set','Content-Range','apply','save','destroy','then','error','stack','name','send','index','FaxApplication','rawAttributes','fieldName','type','key','map','keys','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','limit','offset','order','sort','filters','pick','filter','where','merge','VIRTUAL','include','findAll','catch','show','params','includeAll','options','find','create','body','update','eml-format','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x5acc0c,_0x4da668){var _0x58a940=function(_0x5c13cf){while(--_0x5c13cf){_0x5acc0c['push'](_0x5acc0c['shift']());}};_0x58a940(++_0x4da668);}(_0x43fd,0x1ec));var _0xd43f=function(_0xf5d03a,_0x26f0b4){_0xf5d03a=_0xf5d03a-0x0;var _0x99d531=_0x43fd[_0xf5d03a];return _0x99d531;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd43f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd43f('0x1'));var rp=require(_0xd43f('0x2'));var moment=require('moment');var BPromise=require(_0xd43f('0x3'));var Mustache=require('mustache');var util=require(_0xd43f('0x4'));var path=require(_0xd43f('0x5'));var sox=require(_0xd43f('0x6'));var csv=require(_0xd43f('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd43f('0x8'));var squel=require(_0xd43f('0x9'));var crypto=require(_0xd43f('0xa'));var jsforce=require(_0xd43f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd43f('0x7'));var querystring=require(_0xd43f('0xc'));var Papa=require('papaparse');var Redis=require(_0xd43f('0xd'));var authService=require(_0xd43f('0xe'));var qs=require(_0xd43f('0xf'));var as=require(_0xd43f('0x10'));var hardwareService=require(_0xd43f('0x11'));var logger=require('../../config/logger')(_0xd43f('0x12'));var utils=require(_0xd43f('0x13'));var config=require(_0xd43f('0x14'));var db=require(_0xd43f('0x15'))['db'];function respondWithStatusCode(_0x430977,_0x396916){_0x396916=_0x396916||0xcc;return function(_0x22f057){if(_0x22f057){return _0x430977[_0xd43f('0x16')](_0x396916);}return _0x430977[_0xd43f('0x17')](_0x396916)[_0xd43f('0x18')]();};}function respondWithResult(_0x1eba90,_0x504568){_0x504568=_0x504568||0xc8;return function(_0x3d979d){if(_0x3d979d){return _0x1eba90[_0xd43f('0x17')](_0x504568)[_0xd43f('0x19')](_0x3d979d);}};}function respondWithFilteredResult(_0x5802f2,_0x4c576e){return function(_0x4a2b49){if(_0x4a2b49){var _0x1c729a=_0x4a2b49[_0xd43f('0x1a')],_0x3ca2d4=_0x4c576e['offset'],_0x4f8862=_0x4c576e['offset']+_0x4c576e['limit'],_0x3c0953;if(_0x4f8862>=_0x1c729a){_0x4f8862=_0x1c729a;_0x3c0953=0xc8;}else{_0x3c0953=0xce;}_0x5802f2['status'](_0x3c0953);return _0x5802f2[_0xd43f('0x1b')](_0xd43f('0x1c'),_0x3ca2d4+'-'+_0x4f8862+'/'+_0x1c729a)['json'](_0x4a2b49);}return null;};}function patchUpdates(_0x2d2a3b){return function(_0x2a8fa5){try{jsonpatch[_0xd43f('0x1d')](_0x2a8fa5,_0x2d2a3b,!![]);}catch(_0x469a42){return BPromise['reject'](_0x469a42);}return _0x2a8fa5[_0xd43f('0x1e')]();};}function saveUpdates(_0xd3933,_0xb37d52){return function(_0x564261){if(_0x564261){return _0x564261['update'](_0xd3933)['then'](function(_0x76f13a){return _0x76f13a;});}return null;};}function removeEntity(_0x25007c,_0x2c1ba9){return function(_0x399cb8){if(_0x399cb8){return _0x399cb8[_0xd43f('0x1f')]()[_0xd43f('0x20')](function(){_0x25007c[_0xd43f('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x262023,_0x4a1d8b){return function(_0x352102){if(!_0x352102){_0x262023['sendStatus'](0x194);}return _0x352102;};}function handleError(_0x5ab88f,_0x310195){_0x310195=_0x310195||0x1f4;return function(_0x2dca76){logger[_0xd43f('0x21')](_0x2dca76[_0xd43f('0x22')]);if(_0x2dca76[_0xd43f('0x23')]){delete _0x2dca76[_0xd43f('0x23')];}_0x5ab88f[_0xd43f('0x17')](_0x310195)[_0xd43f('0x24')](_0x2dca76);};}exports[_0xd43f('0x25')]=function(_0x49d043,_0x26a6c9){var _0x2d5915={},_0x366cf7={},_0x2d54a7={'count':0x0,'rows':[]};var _0x209ccd=_['map'](db[_0xd43f('0x26')][_0xd43f('0x27')],function(_0x285b86){return{'name':_0x285b86[_0xd43f('0x28')],'type':_0x285b86[_0xd43f('0x29')][_0xd43f('0x2a')]};});_0x366cf7['model']=_[_0xd43f('0x2b')](_0x209ccd,_0xd43f('0x23'));_0x366cf7['query']=_[_0xd43f('0x2c')](_0x49d043['query']);_0x366cf7['filters']=_[_0xd43f('0x2d')](_0x366cf7[_0xd43f('0x2e')],_0x366cf7[_0xd43f('0x2f')]);_0x2d5915['attributes']=_[_0xd43f('0x2d')](_0x366cf7[_0xd43f('0x2e')],qs['fields'](_0x49d043['query'][_0xd43f('0x30')]));_0x2d5915[_0xd43f('0x31')]=_0x2d5915[_0xd43f('0x31')][_0xd43f('0x32')]?_0x2d5915['attributes']:_0x366cf7[_0xd43f('0x2e')];if(!_0x49d043[_0xd43f('0x2f')][_0xd43f('0x33')](_0xd43f('0x34'))){_0x2d5915[_0xd43f('0x35')]=qs[_0xd43f('0x35')](_0x49d043[_0xd43f('0x2f')]['limit']);_0x2d5915[_0xd43f('0x36')]=qs['offset'](_0x49d043[_0xd43f('0x2f')][_0xd43f('0x36')]);}_0x2d5915[_0xd43f('0x37')]=qs['sort'](_0x49d043[_0xd43f('0x2f')][_0xd43f('0x38')]);_0x2d5915['where']=qs[_0xd43f('0x39')](_[_0xd43f('0x3a')](_0x49d043[_0xd43f('0x2f')],_0x366cf7['filters']));if(_0x49d043[_0xd43f('0x2f')][_0xd43f('0x3b')]){_0x2d5915[_0xd43f('0x3c')]=_[_0xd43f('0x3d')](_0x2d5915[_0xd43f('0x3c')],{'$or':_['map'](_0x209ccd,function(_0x3386d9){if(_0x3386d9['type']!==_0xd43f('0x3e')){var _0x2d8bfe={};_0x2d8bfe[_0x3386d9[_0xd43f('0x23')]]={'$like':'%'+_0x49d043['query'][_0xd43f('0x3b')]+'%'};return _0x2d8bfe;}})});}_0x2d5915=_[_0xd43f('0x3d')]({},_0x2d5915,_0x49d043['options']);var _0x1ec478={'where':_0x2d5915['where']};return db['FaxApplication'][_0xd43f('0x1a')](_0x1ec478)['then'](function(_0x5b648f){_0x2d54a7[_0xd43f('0x1a')]=_0x5b648f;if(_0x49d043['query']['includeAll']){_0x2d5915[_0xd43f('0x3f')]=[{'all':!![]}];}return db[_0xd43f('0x26')][_0xd43f('0x40')](_0x2d5915);})[_0xd43f('0x20')](function(_0x3538c6){_0x2d54a7['rows']=_0x3538c6;return _0x2d54a7;})[_0xd43f('0x20')](respondWithFilteredResult(_0x26a6c9,_0x2d5915))[_0xd43f('0x41')](handleError(_0x26a6c9,null));};exports[_0xd43f('0x42')]=function(_0x3a823b,_0x31e8c2){var _0x3ab035={'raw':!![],'where':{'id':_0x3a823b[_0xd43f('0x43')]['id']}},_0x20e56f={};_0x20e56f[_0xd43f('0x2e')]=_[_0xd43f('0x2c')](db[_0xd43f('0x26')]['rawAttributes']);_0x20e56f[_0xd43f('0x2f')]=_[_0xd43f('0x2c')](_0x3a823b['query']);_0x20e56f['filters']=_[_0xd43f('0x2d')](_0x20e56f[_0xd43f('0x2e')],_0x20e56f[_0xd43f('0x2f')]);_0x3ab035['attributes']=_[_0xd43f('0x2d')](_0x20e56f[_0xd43f('0x2e')],qs[_0xd43f('0x30')](_0x3a823b[_0xd43f('0x2f')]['fields']));_0x3ab035['attributes']=_0x3ab035[_0xd43f('0x31')][_0xd43f('0x32')]?_0x3ab035[_0xd43f('0x31')]:_0x20e56f['model'];if(_0x3a823b[_0xd43f('0x2f')][_0xd43f('0x44')]){_0x3ab035[_0xd43f('0x3f')]=[{'all':!![]}];}_0x3ab035=_[_0xd43f('0x3d')]({},_0x3ab035,_0x3a823b[_0xd43f('0x45')]);return db[_0xd43f('0x26')][_0xd43f('0x46')](_0x3ab035)[_0xd43f('0x20')](handleEntityNotFound(_0x31e8c2,null))['then'](respondWithResult(_0x31e8c2,null))[_0xd43f('0x41')](handleError(_0x31e8c2,null));};exports[_0xd43f('0x47')]=function(_0x386dfa,_0x400273){return db[_0xd43f('0x26')][_0xd43f('0x47')](_0x386dfa[_0xd43f('0x48')],{})[_0xd43f('0x20')](respondWithResult(_0x400273,0xc9))[_0xd43f('0x41')](handleError(_0x400273,null));};exports[_0xd43f('0x49')]=function(_0x3a17fe,_0x517509){if(_0x3a17fe[_0xd43f('0x48')]['id']){delete _0x3a17fe[_0xd43f('0x48')]['id'];}return db[_0xd43f('0x26')][_0xd43f('0x46')]({'where':{'id':_0x3a17fe[_0xd43f('0x43')]['id']}})[_0xd43f('0x20')](handleEntityNotFound(_0x517509,null))['then'](saveUpdates(_0x3a17fe[_0xd43f('0x48')],null))['then'](respondWithResult(_0x517509,null))[_0xd43f('0x41')](handleError(_0x517509,null));};exports['destroy']=function(_0x38f9fc,_0x89fb8e){return db[_0xd43f('0x26')][_0xd43f('0x46')]({'where':{'id':_0x38f9fc[_0xd43f('0x43')]['id']}})[_0xd43f('0x20')](handleEntityNotFound(_0x89fb8e,null))[_0xd43f('0x20')](removeEntity(_0x89fb8e,null))[_0xd43f('0x41')](handleError(_0x89fb8e,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index ef668ea..fea41bd 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 _0x0b80=['bluebird','request-promise','path','rimraf','../../config/environment','FaxApplication','fax_applications','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0b80,0x1b8));var _0x00b8=function(_0x1c8897,_0x5a5a0d){_0x1c8897=_0x1c8897-0x0;var _0x23af63=_0x0b80[_0x1c8897];return _0x23af63;};'use strict';var _=require(_0x00b8('0x0'));var util=require(_0x00b8('0x1'));var logger=require(_0x00b8('0x2'))(_0x00b8('0x3'));var moment=require('moment');var BPromise=require(_0x00b8('0x4'));var rp=require(_0x00b8('0x5'));var fs=require('fs');var path=require(_0x00b8('0x6'));var rimraf=require(_0x00b8('0x7'));var config=require(_0x00b8('0x8'));var attributes=require('./faxApplication.attributes');module['exports']=function(_0x249058,_0x3cbdb0){return _0x249058['define'](_0x00b8('0x9'),attributes,{'tableName':_0x00b8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x00b8('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x5f7b=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxApplication.attributes','define','fax_applications','utf8mb4'];(function(_0x359d8b,_0x44f92a){var _0x4d7372=function(_0x1ed9ec){while(--_0x1ed9ec){_0x359d8b['push'](_0x359d8b['shift']());}};_0x4d7372(++_0x44f92a);}(_0x5f7b,0x194));var _0xb5f7=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x5f7b[_0x2aec52];return _0x3b8835;};'use strict';var _=require('lodash');var util=require(_0xb5f7('0x0'));var logger=require(_0xb5f7('0x1'))(_0xb5f7('0x2'));var moment=require(_0xb5f7('0x3'));var BPromise=require(_0xb5f7('0x4'));var rp=require(_0xb5f7('0x5'));var fs=require('fs');var path=require(_0xb5f7('0x6'));var rimraf=require('rimraf');var config=require(_0xb5f7('0x7'));var attributes=require(_0xb5f7('0x8'));module['exports']=function(_0x25e937,_0x2f9dd9){return _0x25e937[_0xb5f7('0x9')]('FaxApplication',attributes,{'tableName':_0xb5f7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb5f7('0xb'),'collate':_0xb5f7('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index c67f131..7da9096 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 _0x9502=['request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','FaxApplication,\x20%s,\x20%s','message','result','catch','FaxApplication','update','options','raw','where','attributes','UpdateFaxApplication','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info'];(function(_0x1111f3,_0x585ba8){var _0x5d30a7=function(_0x2202e4){while(--_0x2202e4){_0x1111f3['push'](_0x1111f3['shift']());}};_0x5d30a7(++_0x585ba8);}(_0x9502,0x1ec));var _0x2950=function(_0xbb146,_0x1b3260){_0xbb146=_0xbb146-0x0;var _0x5094d0=_0x9502[_0xbb146];return _0x5094d0;};'use strict';var _=require(_0x2950('0x0'));var util=require('util');var moment=require(_0x2950('0x1'));var BPromise=require(_0x2950('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2950('0x3'));var db=require(_0x2950('0x4'))['db'];var utils=require(_0x2950('0x5'));var logger=require('../../config/logger')(_0x2950('0x6'));var config=require(_0x2950('0x7'));var jayson=require(_0x2950('0x8'));var client=jayson[_0x2950('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21bcb5,_0x272d31,_0x26b1e5){return new BPromise(function(_0x6f9e04,_0x16f68c){return client['request'](_0x21bcb5,_0x26b1e5)[_0x2950('0xa')](function(_0x1e88d3){logger[_0x2950('0xb')]('FaxApplication,\x20%s,\x20%s',_0x272d31,_0x2950('0xc'));logger[_0x2950('0xd')](_0x2950('0xe'),_0x272d31,_0x2950('0xc'),JSON[_0x2950('0xf')](_0x1e88d3));if(_0x1e88d3[_0x2950('0x10')]){if(_0x1e88d3[_0x2950('0x10')]['code']===0x1f4){logger[_0x2950('0x10')](_0x2950('0x11'),_0x272d31,_0x1e88d3[_0x2950('0x10')]['message']);return _0x16f68c(_0x1e88d3[_0x2950('0x10')][_0x2950('0x12')]);}logger[_0x2950('0x10')](_0x2950('0x11'),_0x272d31,_0x1e88d3[_0x2950('0x10')][_0x2950('0x12')]);return _0x6f9e04(_0x1e88d3[_0x2950('0x10')]['message']);}else{logger[_0x2950('0xb')]('FaxApplication,\x20%s,\x20%s',_0x272d31,'request\x20sent');_0x6f9e04(_0x1e88d3[_0x2950('0x13')]['message']);}})[_0x2950('0x14')](function(_0x23c6a2){logger['error'](_0x2950('0x11'),_0x272d31,_0x23c6a2);_0x16f68c(_0x23c6a2);});});}exports['UpdateFaxApplication']=function(_0x40814e){var _0x436a61=this;return new Promise(function(_0x3e3e59,_0x436aed){return db[_0x2950('0x15')][_0x2950('0x16')](_0x40814e['body'],{'raw':_0x40814e[_0x2950('0x17')]?_0x40814e[_0x2950('0x17')][_0x2950('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40814e[_0x2950('0x17')]?_0x40814e[_0x2950('0x17')][_0x2950('0x19')]||null:null,'attributes':_0x40814e[_0x2950('0x17')]?_0x40814e[_0x2950('0x17')][_0x2950('0x1a')]||null:null,'limit':_0x40814e[_0x2950('0x17')]?_0x40814e['options']['limit']||null:null})['then'](function(_0x46b06c){logger['info'](_0x2950('0x1b'),_0x40814e);logger['debug'](_0x2950('0x1b'),_0x40814e,JSON[_0x2950('0xf')](_0x46b06c));_0x3e3e59(_0x46b06c);})[_0x2950('0x14')](function(_0x5b99f5){logger[_0x2950('0x10')](_0x2950('0x1b'),_0x5b99f5[_0x2950('0x12')],_0x40814e);_0x436aed(_0x436a61[_0x2950('0x10')](0x1f4,_0x5b99f5['message']));});});}; \ No newline at end of file +var _0x1b6c=['limit','UpdateFaxApplication','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','FaxApplication','update','body','options','raw','where','attributes'];(function(_0x36888d,_0x22988e){var _0x14f524=function(_0x5cdbfe){while(--_0x5cdbfe){_0x36888d['push'](_0x36888d['shift']());}};_0x14f524(++_0x22988e);}(_0x1b6c,0x1b4));var _0xc1b6=function(_0x35cf05,_0x801e3a){_0x35cf05=_0x35cf05-0x0;var _0x57ca7c=_0x1b6c[_0x35cf05];return _0x57ca7c;};'use strict';var _=require(_0xc1b6('0x0'));var util=require(_0xc1b6('0x1'));var moment=require('moment');var BPromise=require(_0xc1b6('0x2'));var rs=require(_0xc1b6('0x3'));var fs=require('fs');var Redis=require(_0xc1b6('0x4'));var db=require(_0xc1b6('0x5'))['db'];var utils=require(_0xc1b6('0x6'));var logger=require(_0xc1b6('0x7'))(_0xc1b6('0x8'));var config=require(_0xc1b6('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc1b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x105b19,_0x3811e2,_0xc0a3bf){return new BPromise(function(_0xf94e6c,_0x166cb9){return client[_0xc1b6('0xb')](_0x105b19,_0xc0a3bf)[_0xc1b6('0xc')](function(_0x5f3a83){logger[_0xc1b6('0xd')](_0xc1b6('0xe'),_0x3811e2,_0xc1b6('0xf'));logger[_0xc1b6('0x10')](_0xc1b6('0x11'),_0x3811e2,_0xc1b6('0xf'),JSON[_0xc1b6('0x12')](_0x5f3a83));if(_0x5f3a83[_0xc1b6('0x13')]){if(_0x5f3a83[_0xc1b6('0x13')]['code']===0x1f4){logger[_0xc1b6('0x13')](_0xc1b6('0xe'),_0x3811e2,_0x5f3a83['error'][_0xc1b6('0x14')]);return _0x166cb9(_0x5f3a83['error'][_0xc1b6('0x14')]);}logger[_0xc1b6('0x13')](_0xc1b6('0xe'),_0x3811e2,_0x5f3a83[_0xc1b6('0x13')][_0xc1b6('0x14')]);return _0xf94e6c(_0x5f3a83[_0xc1b6('0x13')][_0xc1b6('0x14')]);}else{logger['info']('FaxApplication,\x20%s,\x20%s',_0x3811e2,'request\x20sent');_0xf94e6c(_0x5f3a83[_0xc1b6('0x15')][_0xc1b6('0x14')]);}})['catch'](function(_0x482ac3){logger[_0xc1b6('0x13')](_0xc1b6('0xe'),_0x3811e2,_0x482ac3);_0x166cb9(_0x482ac3);});});}exports['UpdateFaxApplication']=function(_0x5ac333){var _0x909b7=this;return new Promise(function(_0x2d1335,_0x9841cc){return db[_0xc1b6('0x16')][_0xc1b6('0x17')](_0x5ac333[_0xc1b6('0x18')],{'raw':_0x5ac333[_0xc1b6('0x19')]?_0x5ac333[_0xc1b6('0x19')][_0xc1b6('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ac333['options']?_0x5ac333[_0xc1b6('0x19')][_0xc1b6('0x1b')]||null:null,'attributes':_0x5ac333[_0xc1b6('0x19')]?_0x5ac333[_0xc1b6('0x19')][_0xc1b6('0x1c')]||null:null,'limit':_0x5ac333['options']?_0x5ac333[_0xc1b6('0x19')][_0xc1b6('0x1d')]||null:null})[_0xc1b6('0xc')](function(_0x2df5b3){logger['info'](_0xc1b6('0x1e'),_0x5ac333);logger[_0xc1b6('0x10')](_0xc1b6('0x1e'),_0x5ac333,JSON[_0xc1b6('0x12')](_0x2df5b3));_0x2d1335(_0x2df5b3);})['catch'](function(_0x108b0a){logger[_0xc1b6('0x13')]('UpdateFaxApplication',_0x108b0a['message'],_0x5ac333);_0x9841cc(_0x909b7['error'](0x1f4,_0x108b0a[_0xc1b6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 559578f..d8dcdfd 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 _0xeff8=['index','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxApplication.controller','get'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xeff8,0x186));var _0x8eff=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0xeff8[_0x2555d0];return _0x3bb486;};'use strict';var multer=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var path=require('path');var timeout=require(_0x8eff('0x2'));var express=require(_0x8eff('0x3'));var router=express[_0x8eff('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8eff('0x5'));var config=require(_0x8eff('0x6'));var controller=require(_0x8eff('0x7'));router[_0x8eff('0x8')]('/',auth['isAuthenticated'](),controller[_0x8eff('0x9')]);router[_0x8eff('0x8')](_0x8eff('0xa'),auth[_0x8eff('0xb')](),controller['show']);router[_0x8eff('0xc')]('/',auth[_0x8eff('0xb')](),controller[_0x8eff('0xd')]);router[_0x8eff('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x8eff('0xf')]);router[_0x8eff('0x10')](_0x8eff('0xa'),auth['isAuthenticated'](),controller[_0x8eff('0x11')]);module[_0x8eff('0x12')]=router; \ No newline at end of file +var _0xeda8=['isAuthenticated','index','/:id','show','post','create','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get'];(function(_0x2f826d,_0x19de77){var _0x3e75c1=function(_0x147fa1){while(--_0x147fa1){_0x2f826d['push'](_0x2f826d['shift']());}};_0x3e75c1(++_0x19de77);}(_0xeda8,0x104));var _0x8eda=function(_0x4d40c5,_0x3eb4e9){_0x4d40c5=_0x4d40c5-0x0;var _0x118729=_0xeda8[_0x4d40c5];return _0x118729;};'use strict';var multer=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var path=require('path');var timeout=require(_0x8eda('0x2'));var express=require(_0x8eda('0x3'));var router=express[_0x8eda('0x4')]();var auth=require(_0x8eda('0x5'));var interaction=require(_0x8eda('0x6'));var config=require(_0x8eda('0x7'));var controller=require(_0x8eda('0x8'));router[_0x8eda('0x9')]('/',auth[_0x8eda('0xa')](),controller[_0x8eda('0xb')]);router[_0x8eda('0x9')](_0x8eda('0xc'),auth['isAuthenticated'](),controller[_0x8eda('0xd')]);router[_0x8eda('0xe')]('/',auth[_0x8eda('0xa')](),controller[_0x8eda('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8eda('0x10')](_0x8eda('0xc'),auth[_0x8eda('0xa')](),controller['destroy']);module[_0x8eda('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index b8f60b6..07c368c 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 _0xec1f=['STRING','out','ENUM','sequelize','exports','BOOLEAN'];(function(_0x46486e,_0x5e912f){var _0x1444df=function(_0x391755){while(--_0x391755){_0x46486e['push'](_0x46486e['shift']());}};_0x1444df(++_0x5e912f);}(_0xec1f,0x87));var _0xfec1=function(_0x3578df,_0x379018){_0x3578df=_0x3578df-0x0;var _0x5ab4ba=_0xec1f[_0x3578df];return _0x5ab4ba;};'use strict';var Sequelize=require(_0xfec1('0x0'));module[_0xfec1('0x1')]={'closed':{'type':Sequelize[_0xfec1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xfec1('0x3')]},'note':{'type':Sequelize[_0xfec1('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xfec1('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xfec1('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xfec1('0x5')]('in',_0xfec1('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xb5a5=['sequelize','exports','BOOLEAN','DATE','STRING','out','ENUM'];(function(_0x22868f,_0x450f48){var _0x97bc75=function(_0x447cb4){while(--_0x447cb4){_0x22868f['push'](_0x22868f['shift']());}};_0x97bc75(++_0x450f48);}(_0xb5a5,0xe7));var _0x5b5a=function(_0x5afdc4,_0x40b638){_0x5afdc4=_0x5afdc4-0x0;var _0x3e21b5=_0xb5a5[_0x5afdc4];return _0x3e21b5;};'use strict';var Sequelize=require(_0x5b5a('0x0'));module[_0x5b5a('0x1')]={'closed':{'type':Sequelize[_0x5b5a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5b5a('0x3')]},'disposition':{'type':Sequelize[_0x5b5a('0x4')]},'note':{'type':Sequelize[_0x5b5a('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x5b5a('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x5b5a('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5b5a('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x5b5a('0x6')]('in','out'),'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 c5cb91c..8de210c 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 _0xe0a1=['Content-Range','reject','save','update','destroy','then','error','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','index','FaxInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','select','field','from','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','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','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','buildExpression','some','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','tag','isArray','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','Sequelize','QueryTypes','SELECT','i.id','DESC','isEmpty','t.id\x20IN\x20?','resolve','journey','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','rows','catch','show','params','rawAttributes','includeAll','include','merge','create','describe','addMessage','FaxMessage','ids','findOne','pick','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','omit','spread','color','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','count','offset','set'];(function(_0x3f132a,_0x359822){var _0x224a39=function(_0x5c44df){while(--_0x5c44df){_0x3f132a['push'](_0x3f132a['shift']());}};_0x224a39(++_0x359822);}(_0xe0a1,0xb3));var _0x1e0a=function(_0x3bfffa,_0x46123d){_0x3bfffa=_0x3bfffa-0x0;var _0x28e970=_0xe0a1[_0x3bfffa];return _0x28e970;};'use strict';var pdf=require(_0x1e0a('0x0'));var emlformat=require(_0x1e0a('0x1'));var rimraf=require(_0x1e0a('0x2'));var zipdir=require(_0x1e0a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1e0a('0x4'));var moment=require(_0x1e0a('0x5'));var BPromise=require(_0x1e0a('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1e0a('0x7'));var csv=require(_0x1e0a('0x8'));var ejs=require(_0x1e0a('0x9'));var fs=require('fs');var _=require(_0x1e0a('0xa'));var squel=require('squel');var crypto=require(_0x1e0a('0xb'));var jsforce=require(_0x1e0a('0xc'));var deskjs=require(_0x1e0a('0xd'));var toCsv=require(_0x1e0a('0x8'));var querystring=require(_0x1e0a('0xe'));var Papa=require(_0x1e0a('0xf'));var Redis=require(_0x1e0a('0x10'));var authService=require(_0x1e0a('0x11'));var qs=require(_0x1e0a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1e0a('0x13'));var logger=require(_0x1e0a('0x14'))(_0x1e0a('0x15'));var utils=require(_0x1e0a('0x16'));var config=require('../../config/environment');var db=require(_0x1e0a('0x17'))['db'];config[_0x1e0a('0x18')]=_[_0x1e0a('0x19')](config['redis'],{'host':_0x1e0a('0x1a'),'port':0x18eb});var socket=require(_0x1e0a('0x1b'))(new Redis(config['redis']));require('./faxInteraction.socket')['register'](socket);function respondWithStatusCode(_0x57e6d4,_0x21da19){_0x21da19=_0x21da19||0xcc;return function(_0x2ed1b6){if(_0x2ed1b6){return _0x57e6d4[_0x1e0a('0x1c')](_0x21da19);}return _0x57e6d4[_0x1e0a('0x1d')](_0x21da19)[_0x1e0a('0x1e')]();};}function respondWithResult(_0x33ec96,_0x14eac4){_0x14eac4=_0x14eac4||0xc8;return function(_0x30d2db){if(_0x30d2db){return _0x33ec96[_0x1e0a('0x1d')](_0x14eac4)[_0x1e0a('0x1f')](_0x30d2db);}};}function respondWithFilteredResult(_0x516d3e,_0x1f0f81){return function(_0x22e622){if(_0x22e622){var _0x41d6dc=_0x22e622[_0x1e0a('0x20')],_0x34808b=_0x1f0f81[_0x1e0a('0x21')],_0x3ffd7b=_0x1f0f81[_0x1e0a('0x21')]+_0x1f0f81['limit'],_0x1ad4c9;if(_0x3ffd7b>=_0x41d6dc){_0x3ffd7b=_0x41d6dc;_0x1ad4c9=0xc8;}else{_0x1ad4c9=0xce;}_0x516d3e[_0x1e0a('0x1d')](_0x1ad4c9);return _0x516d3e[_0x1e0a('0x22')](_0x1e0a('0x23'),_0x34808b+'-'+_0x3ffd7b+'/'+_0x41d6dc)[_0x1e0a('0x1f')](_0x22e622);}return null;};}function patchUpdates(_0x581386){return function(_0x127fff){try{jsonpatch['apply'](_0x127fff,_0x581386,!![]);}catch(_0x1c2d17){return BPromise[_0x1e0a('0x24')](_0x1c2d17);}return _0x127fff[_0x1e0a('0x25')]();};}function saveUpdates(_0x25ab6e,_0x55c295){return function(_0x277af0){if(_0x277af0){return _0x277af0[_0x1e0a('0x26')](_0x25ab6e)['then'](function(_0x387601){return _0x387601;});}return null;};}function removeEntity(_0x32d40e,_0x2d85ad){return function(_0x5c2906){if(_0x5c2906){return _0x5c2906[_0x1e0a('0x27')]()[_0x1e0a('0x28')](function(){_0x32d40e['status'](0xcc)[_0x1e0a('0x1e')]();});}};}function handleEntityNotFound(_0x4377b8,_0xb08979){return function(_0x4a4d90){if(!_0x4a4d90){_0x4377b8['sendStatus'](0x194);}return _0x4a4d90;};}function handleError(_0xee8422,_0xd3e1d3){_0xd3e1d3=_0xd3e1d3||0x1f4;return function(_0x46412c){logger[_0x1e0a('0x29')](_0x46412c['stack']);if(_0x46412c[_0x1e0a('0x2a')]){delete _0x46412c[_0x1e0a('0x2a')];}_0xee8422[_0x1e0a('0x1d')](_0xd3e1d3)[_0x1e0a('0x2b')](_0x46412c);};}function getInteractionUsers(_0x4acbc4,_0x22ffcf){return new BPromise(function(_0x3a413a,_0x367c46){try{if(_0x22ffcf[_0x4acbc4['id']]){_0x4acbc4[_0x1e0a('0x2c')]=_[_0x1e0a('0x2d')](_0x22ffcf[_0x4acbc4['id']],function(_0x4cb7b7){return{'id':_0x4cb7b7['id'],'fullname':_0x4cb7b7[_0x1e0a('0x2e')]};});}}catch(_0x36f1a9){_0x367c46(_0x36f1a9);}_0x3a413a(_0x4acbc4);});}function getInteractionTags(_0x4d739f,_0x4fdda3){return new BPromise(function(_0x1b9d4c,_0x503a70){try{if(_0x4d739f[_0x1e0a('0x2f')]){_0x4d739f[_0x1e0a('0x30')]=[];_0x4d739f[_0x1e0a('0x2f')][_0x1e0a('0x31')](',')[_0x1e0a('0x32')](function(_0x290b4d){_0x4d739f['Tags'][_0x1e0a('0x33')](_0x4fdda3[_0x290b4d]);});}delete _0x4d739f['TagIds'];}catch(_0x15446d){_0x503a70(_0x15446d);}_0x1b9d4c(_0x4d739f);});}function updateFaxInteraction(_0x2d684d,_0x3a166a,_0x801947){return new BPromise(function(_0x393935,_0x145a43){return getInteractionUsers(_0x2d684d,_0x801947)[_0x1e0a('0x28')](function(_0x2caf97){return getInteractionTags(_0x2caf97,_0x3a166a);})[_0x1e0a('0x28')](function(_0x2cecd1){_0x393935(_0x2cecd1);})['catch'](function(_0x16b02f){_0x145a43(_0x16b02f);});});}exports[_0x1e0a('0x34')]=function(_0x57368c,_0x4acb03){var _0x3639c0={},_0x5aa78f={},_0x14c497={'count':0x0,'rows':[]};var _0x285e0e=_[_0x1e0a('0x2d')](db[_0x1e0a('0x35')]['rawAttributes'],function(_0x525197){return{'name':_0x525197[_0x1e0a('0x36')],'type':_0x525197[_0x1e0a('0x37')][_0x1e0a('0x38')]};});_0x5aa78f[_0x1e0a('0x39')]=_[_0x1e0a('0x2d')](_0x285e0e,_0x1e0a('0x2a'));_0x5aa78f[_0x1e0a('0x3a')]=_[_0x1e0a('0x3b')](_0x57368c[_0x1e0a('0x3a')]);_0x5aa78f[_0x1e0a('0x3c')]=_[_0x1e0a('0x3d')](_0x5aa78f['model'],_0x5aa78f[_0x1e0a('0x3a')]);_0x3639c0[_0x1e0a('0x3e')]=_[_0x1e0a('0x3d')](_0x5aa78f[_0x1e0a('0x39')],qs[_0x1e0a('0x3f')](_0x57368c['query'][_0x1e0a('0x3f')]));_0x3639c0[_0x1e0a('0x3e')]=_0x3639c0[_0x1e0a('0x3e')][_0x1e0a('0x40')]?_0x3639c0[_0x1e0a('0x3e')]:_0x5aa78f[_0x1e0a('0x39')];if(!_0x57368c[_0x1e0a('0x3a')][_0x1e0a('0x41')](_0x1e0a('0x42'))){_0x3639c0[_0x1e0a('0x43')]=qs['limit'](_0x57368c[_0x1e0a('0x3a')][_0x1e0a('0x43')]);_0x3639c0['offset']=qs[_0x1e0a('0x21')](_0x57368c['query'][_0x1e0a('0x21')]);}_0x3639c0[_0x1e0a('0x44')]=qs[_0x1e0a('0x45')](_0x57368c[_0x1e0a('0x3a')]['sort']);_0x3639c0['where']=qs[_0x1e0a('0x3c')](_['pick'](_0x57368c['query'],_0x5aa78f['filters']));var _0xb6d1ef=[];var _0x2ab17=squel[_0x1e0a('0x46')]()['field']('id')['field']('name')[_0x1e0a('0x47')]('color')[_0x1e0a('0x48')]('tools_tags');var _0x537f52=squel[_0x1e0a('0x46')]()[_0x1e0a('0x47')](_0x1e0a('0x49'))['field']('u.fullname')[_0x1e0a('0x47')](_0x1e0a('0x4a'))[_0x1e0a('0x48')](_0x1e0a('0x4b'),'ui')[_0x1e0a('0x4c')](_0x1e0a('0x4d'),'u','u.id\x20=\x20ui.UserId');var _0x1595ae=squel[_0x1e0a('0x46')]()[_0x1e0a('0x48')](_0x1e0a('0x4e'),'i')['left_join']('cm_contacts','c',_0x1e0a('0x4f'))[_0x1e0a('0x4c')](_0x1e0a('0x4d'),'o',_0x1e0a('0x50'))[_0x1e0a('0x4c')](_0x1e0a('0x51'),'a',_0x1e0a('0x52'))[_0x1e0a('0x4c')]('fax_messages','me','me.FaxInteractionId\x20=\x20i.id')[_0x1e0a('0x4c')](_0x1e0a('0x53'),'it',_0x1e0a('0x54'))[_0x1e0a('0x4c')]('tools_tags','t',_0x1e0a('0x55'));var _0xc0b6ac=squel[_0x1e0a('0x56')]();var _0x423191=[];var _0x3725e0=squel[_0x1e0a('0x56')]();var _0x2c1d65;if(_0x57368c[_0x1e0a('0x3a')]['search']){_0x2c1d65=as[_0x1e0a('0x57')](_0x57368c['query'][_0x1e0a('0x58')]);var _0x128336=_0x2c1d65['sqlOperator'];for(var _0x3c1944=0x0;_0x3c1944<_0x2c1d65[_0x1e0a('0x59')][_0x1e0a('0x40')];_0x3c1944++){var _0x2710c2=_0x2c1d65[_0x1e0a('0x59')][_0x3c1944];var _0x155c91='i';var _0x231faf=_[_0x1e0a('0x5a')](_0x285e0e,[_0x1e0a('0x2a'),_0x2710c2[_0x1e0a('0x47')]]);if(!_0x231faf){switch(_0x2710c2[_0x1e0a('0x47')]){case _0x1e0a('0x5b'):if(_0x2710c2[_0x1e0a('0x5c')]==0x1){_0x1595ae[_0x1e0a('0x5d')]('`'+_0x2710c2['field']+'`\x20=\x200');}else{_0x1595ae[_0x1e0a('0x5d')]('`'+_0x2710c2[_0x1e0a('0x47')]+_0x1e0a('0x5e'));}break;case _0x1e0a('0x5f'):if(_0x2710c2[_0x1e0a('0x60')]===_0x1e0a('0x61')){if(_0x2710c2[_0x1e0a('0x5c')]['split']('\x20')[_0x1e0a('0x40')]>0x1){_0xc0b6ac[_0x128336](_0x1e0a('0x62'),qs[_0x1e0a('0x63')](_0x2710c2['value']),null);}else{var _0x405721='%'+_0x2710c2[_0x1e0a('0x5c')]+'%';_0xc0b6ac[_0x128336]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x405721,_0x405721,_0x405721);}}else{_0x231faf=_[_0x1e0a('0x5a')](_0x285e0e,[_0x1e0a('0x2a'),_0x1e0a('0x64')]);_0x2710c2[_0x1e0a('0x47')]='ContactId';_0x1b872f=as['buildExpression'](_0x155c91,_0x231faf[_0x1e0a('0x37')],_0x2710c2);_0xc0b6ac[_0x128336](_0x1b872f[_0x1e0a('0x65')],_0x1b872f[_0x1e0a('0x5c')][_0x1e0a('0x66')],_0x1b872f[_0x1e0a('0x5c')][_0x1e0a('0x1e')]);}break;case _0x1e0a('0x67'):var _0x5dd6dd=_0x2710c2[_0x1e0a('0x5c')][_0x1e0a('0x31')](',')[_0x1e0a('0x2d')](function(_0x5ba739){return Number(_0x5ba739);});_0x5dd6dd[_0x1e0a('0x32')](function(_0x21e503){_0x3725e0['or'](_0x1e0a('0x68'),'%,'+_0x21e503+',%');});_0x423191=_[_0x1e0a('0x69')](_0x423191,_0x5dd6dd);break;case _0x1e0a('0x6a'):if(_0x2710c2[_0x1e0a('0x60')]===_0x1e0a('0x61')){_0xc0b6ac[_0x128336](_0x1e0a('0x6b'),'%'+_0x2710c2[_0x1e0a('0x5c')]+'%',null);}else{_0x231faf=_[_0x1e0a('0x5a')](_0x285e0e,[_0x1e0a('0x2a'),'UserId']);_0x2710c2['field']=_0x1e0a('0x6c');_0x1b872f=as['buildExpression'](_0x155c91,_0x231faf[_0x1e0a('0x37')],_0x2710c2);_0xc0b6ac[_0x128336](_0x1b872f['text'],_0x1b872f[_0x1e0a('0x5c')]['start'],_0x1b872f[_0x1e0a('0x5c')]['end']);}break;case _0x1e0a('0x6d'):_0x1b872f=as[_0x1e0a('0x6e')]('me',null,_0x2710c2);_0xc0b6ac[_0x128336](_0x1b872f[_0x1e0a('0x65')],_0x1b872f[_0x1e0a('0x5c')][_0x1e0a('0x66')],_0x1b872f[_0x1e0a('0x5c')]['end']);break;}}else{var _0x1b872f=as[_0x1e0a('0x6e')](_0x155c91,_0x231faf[_0x1e0a('0x37')],_0x2710c2);_0xc0b6ac[_0x128336](_0x1b872f['text'],_0x1b872f[_0x1e0a('0x5c')][_0x1e0a('0x66')],_0x1b872f[_0x1e0a('0x5c')][_0x1e0a('0x1e')]);}}}else{var _0xd676e2=_(_0x57368c[_0x1e0a('0x3a')])['keys']()[_0x1e0a('0x2d')](function(_0x48fcb0){return _[_0x1e0a('0x6f')](_0x285e0e,[_0x1e0a('0x2a'),_0x48fcb0])?_0x48fcb0:undefined;})['compact']()['value']();if(!_['isEmpty'](_0xd676e2)){_0xd676e2[_0x1e0a('0x32')](function(_0x5f4a09){if(_0x5f4a09===_0x1e0a('0x70')){_0x1595ae[_0x1e0a('0x71')](_0x1e0a('0x72'),[][_0x1e0a('0x73')](_0x57368c[_0x1e0a('0x3a')][_0x5f4a09]));}else if(_0x5f4a09===_0x1e0a('0x74')){var _0x225878=JSON[_0x1e0a('0x75')](_0x57368c[_0x1e0a('0x3a')][_0x5f4a09])[_0x1e0a('0x76')];var _0x113784=JSON[_0x1e0a('0x75')](_0x57368c[_0x1e0a('0x3a')][_0x5f4a09])[_0x1e0a('0x77')];_0x1595ae['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x225878,_0x113784);}else{if(_0x57368c[_0x1e0a('0x3a')][_0x5f4a09]===_0x1e0a('0x78')){_0x1595ae[_0x1e0a('0x71')]('i.'+_0x5f4a09+_0x1e0a('0x79'));}else{_0x1595ae['where']('i.'+_0x5f4a09+_0x1e0a('0x7a'),_0x57368c[_0x1e0a('0x3a')][_0x5f4a09]);}}});}if(_0x57368c[_0x1e0a('0x3a')]['read']){if(_0x57368c[_0x1e0a('0x3a')]['read']==0x1){_0x1595ae[_0x1e0a('0x5d')]('`unreadMessages`\x20=\x200');}else{_0x1595ae['having']('`unreadMessages`\x20>\x200');}}if(_0x57368c[_0x1e0a('0x3a')][_0x1e0a('0x7b')]){_0x423191=_[_0x1e0a('0x7c')](_0x57368c['query'][_0x1e0a('0x7b')])?_0x57368c[_0x1e0a('0x3a')]['tag']:new Array(_0x57368c[_0x1e0a('0x3a')][_0x1e0a('0x7b')]);_0x423191[_0x1e0a('0x32')](function(_0x189d0f){_0x3725e0['or'](_0x1e0a('0x68'),'%,'+_0x189d0f+',%');});}if(_0x57368c[_0x1e0a('0x3a')][_0x1e0a('0x7d')]){var _0x139129=_0x57368c[_0x1e0a('0x3a')]['filter'][_0x1e0a('0x7e')]('\x5c','\x5c\x5c')[_0x1e0a('0x7e')]('\x27\x27',_0x1e0a('0x7f'));if(qs[_0x1e0a('0x80')](_0x139129)){_0xc0b6ac['or'](_0x1e0a('0x81'),_0x139129+'%')['or'](_0x1e0a('0x82'),_0x139129+'%');}_0xc0b6ac['or'](_0x1e0a('0x83'),_0x139129+'%');}}_0x1595ae['where'](_0xc0b6ac);_0x1595ae[_0x1e0a('0x84')]('i.id');var _0x3cedfc={'type':db[_0x1e0a('0x85')][_0x1e0a('0x86')][_0x1e0a('0x87')],'raw':!![]};var _0x5d22ec=_0x1595ae['clone']();_0x5d22ec[_0x1e0a('0x47')](_0x1e0a('0x88'));_0x5d22ec['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x1e0a('0x5b'));if(_0x3639c0[_0x1e0a('0x44')]){_0x3639c0[_0x1e0a('0x44')][_0x1e0a('0x32')](function(_0x5c9a58){_0x1595ae[_0x1e0a('0x44')]('i.'+_0x5c9a58[0x0],_0x5c9a58[0x1]===_0x1e0a('0x89')?![]:!![]);});}if(!_[_0x1e0a('0x8a')](_0x423191)){_0x1595ae[_0x1e0a('0x5d')](_0x3725e0);_0x5d22ec[_0x1e0a('0x71')](_0x1e0a('0x8b'),_0x423191);}BPromise[_0x1e0a('0x8c')]()[_0x1e0a('0x28')](function(){if(!_0x2c1d65){if(_0x57368c[_0x1e0a('0x3a')][_0x1e0a('0x70')]||_0x57368c['query'][_0x1e0a('0x8d')])return;_0x5d22ec['where']('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x1595ae[_0x1e0a('0x71')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}return _0x57368c['user'][_0x1e0a('0x8e')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4e9a4f){if(_[_0x1e0a('0x8a')](_0x4e9a4f)){_0x5d22ec[_0x1e0a('0x71')]('i.FaxAccountId\x20IS\x20NULL');_0x1595ae['where'](_0x1e0a('0x8f'));}else{_0x5d22ec[_0x1e0a('0x71')]('i.FaxAccountId\x20IN\x20?',_[_0x1e0a('0x2d')](_0x4e9a4f,'id'));_0x1595ae['where'](_0x1e0a('0x72'),_['map'](_0x4e9a4f,'id'));}});})['then'](function(){db[_0x1e0a('0x90')][_0x1e0a('0x3a')](_0x5d22ec['toString'](),_0x3cedfc)[_0x1e0a('0x28')](function(_0xe152bf){_0x14c497[_0x1e0a('0x20')]=_0xe152bf[_0x1e0a('0x40')];if(_0x14c497[_0x1e0a('0x20')]===0x0)return[];return db[_0x1e0a('0x90')][_0x1e0a('0x3a')](_0x2ab17[_0x1e0a('0x91')](),_0x3cedfc)['then'](function(_0x4f50db){_0xb6d1ef=_[_0x1e0a('0x92')](_0x4f50db,'id');_0x3cedfc=_['merge'](_0x3cedfc,{'model':db[_0x1e0a('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x57368c[_0x1e0a('0x3a')]['fields']){_0x3639c0['attributes'][_0x1e0a('0x32')](function(_0x1809d4){_0x1595ae[_0x1e0a('0x47')]('i.'+_0x1809d4);});}else{_0x1595ae[_0x1e0a('0x47')](_0x1e0a('0x93'),_0x1e0a('0x5b'));_0x1595ae[_0x1e0a('0x47')]('a.key',_0x1e0a('0x94'));_0x1595ae['field'](_0x1e0a('0x95'),_0x1e0a('0x96'));_0x1595ae[_0x1e0a('0x47')](_0x1e0a('0x97'));_0x1595ae['field']('c.firstName',_0x1e0a('0x98'));_0x1595ae['field'](_0x1e0a('0x99'),_0x1e0a('0x9a'));_0x1595ae[_0x1e0a('0x47')](_0x1e0a('0x9b'),_0x1e0a('0x9c'));_0x1595ae[_0x1e0a('0x47')](_0x1e0a('0x9d'),_0x1e0a('0x9e'));_0x1595ae[_0x1e0a('0x47')]('c.mobile',_0x1e0a('0x9f'));_0x1595ae[_0x1e0a('0x47')](_0x1e0a('0xa0'),_0x1e0a('0xa1'));_0x1595ae[_0x1e0a('0x47')]('o.fullname',_0x1e0a('0xa2'));_0x1595ae[_0x1e0a('0x47')](_0x1e0a('0xa3'),_0x1e0a('0xa4'));_0x1595ae[_0x1e0a('0x47')](_0x1e0a('0xa5'),_0x1e0a('0x2f'));}_0x1595ae[_0x1e0a('0x43')](_0x3639c0[_0x1e0a('0x43')]);_0x1595ae[_0x1e0a('0x21')](_0x3639c0[_0x1e0a('0x21')]);return db[_0x1e0a('0x90')]['query'](_0x1595ae[_0x1e0a('0x91')](),_0x3cedfc);})[_0x1e0a('0x28')](function(_0x48e614){_0x537f52[_0x1e0a('0x71')](_0x1e0a('0xa6'),_[_0x1e0a('0x2d')](_0x48e614,'id'));return db[_0x1e0a('0x90')][_0x1e0a('0x3a')](_0x537f52[_0x1e0a('0x91')](),_0x3cedfc)['then'](function(_0x24e6a1){var _0x52bc6b=_['groupBy'](_0x24e6a1,_0x1e0a('0xa7'));var _0x12135f=[];_0x48e614['forEach'](function(_0x115279){_0x12135f[_0x1e0a('0x33')](updateFaxInteraction(_0x115279,_0xb6d1ef,_0x52bc6b));});return BPromise['all'](_0x12135f);});});})[_0x1e0a('0x28')](function(_0x242450){_0x14c497[_0x1e0a('0xa8')]=_0x242450;return _0x14c497;})[_0x1e0a('0x28')](respondWithFilteredResult(_0x4acb03,_0x3639c0));})[_0x1e0a('0xa9')](handleError(_0x4acb03,null));};exports[_0x1e0a('0xaa')]=function(_0x16f208,_0x7ff30){var _0x5468ac={'raw':![],'where':{'id':_0x16f208[_0x1e0a('0xab')]['id']}},_0x4d4984={};_0x4d4984[_0x1e0a('0x39')]=_[_0x1e0a('0x3b')](db[_0x1e0a('0x35')][_0x1e0a('0xac')]);_0x4d4984[_0x1e0a('0x3a')]=_[_0x1e0a('0x3b')](_0x16f208[_0x1e0a('0x3a')]);_0x4d4984[_0x1e0a('0x3c')]=_[_0x1e0a('0x3d')](_0x4d4984['model'],_0x4d4984['query']);_0x5468ac[_0x1e0a('0x3e')]=_[_0x1e0a('0x3d')](_0x4d4984[_0x1e0a('0x39')],qs['fields'](_0x16f208[_0x1e0a('0x3a')][_0x1e0a('0x3f')]));_0x5468ac[_0x1e0a('0x3e')]=_0x5468ac[_0x1e0a('0x3e')]['length']?_0x5468ac[_0x1e0a('0x3e')]:_0x4d4984[_0x1e0a('0x39')];if(_0x16f208[_0x1e0a('0x3a')][_0x1e0a('0xad')]){_0x5468ac[_0x1e0a('0xae')]=[{'all':!![]}];}_0x5468ac=_[_0x1e0a('0xaf')]({},_0x5468ac,_0x16f208['options']);return db[_0x1e0a('0x35')][_0x1e0a('0x5a')](_0x5468ac)[_0x1e0a('0x28')](handleEntityNotFound(_0x7ff30,null))[_0x1e0a('0x28')](respondWithResult(_0x7ff30,null))[_0x1e0a('0xa9')](handleError(_0x7ff30,null));};exports['create']=function(_0x545559,_0x11a95a){return db[_0x1e0a('0x35')][_0x1e0a('0xb0')](_0x545559[_0x1e0a('0x6d')],{})[_0x1e0a('0x28')](respondWithResult(_0x11a95a,0xc9))[_0x1e0a('0xa9')](handleError(_0x11a95a,null));};exports[_0x1e0a('0x26')]=function(_0x297496,_0x275381){if(_0x297496[_0x1e0a('0x6d')]['id']){delete _0x297496['body']['id'];}return db[_0x1e0a('0x35')][_0x1e0a('0x5a')]({'where':{'id':_0x297496[_0x1e0a('0xab')]['id']}})[_0x1e0a('0x28')](handleEntityNotFound(_0x275381,null))[_0x1e0a('0x28')](saveUpdates(_0x297496[_0x1e0a('0x6d')],null))[_0x1e0a('0x28')](respondWithResult(_0x275381,null))[_0x1e0a('0xa9')](handleError(_0x275381,null));};exports[_0x1e0a('0x27')]=function(_0x2f4a45,_0x4e5884){return db[_0x1e0a('0x35')][_0x1e0a('0x5a')]({'where':{'id':_0x2f4a45[_0x1e0a('0xab')]['id']}})[_0x1e0a('0x28')](handleEntityNotFound(_0x4e5884,null))[_0x1e0a('0x28')](removeEntity(_0x4e5884,null))['catch'](handleError(_0x4e5884,null));};exports[_0x1e0a('0xb1')]=function(_0x4410fe,_0x186cf2){return db[_0x1e0a('0x35')][_0x1e0a('0xb1')]()[_0x1e0a('0x28')](respondWithResult(_0x186cf2,null))[_0x1e0a('0xa9')](handleError(_0x186cf2,null));};exports[_0x1e0a('0xb2')]=function(_0x84431e,_0x38f692,_0x56413f){return db[_0x1e0a('0xb3')]['find']({'where':{'id':_0x84431e[_0x1e0a('0xab')]['id']}})[_0x1e0a('0x28')](handleEntityNotFound(_0x38f692,null))[_0x1e0a('0x28')](function(_0x540e63){if(_0x540e63){return _0x540e63[_0x1e0a('0xb2')](_0x84431e[_0x1e0a('0x6d')][_0x1e0a('0xb4')],_['omit'](_0x84431e['body'],[_0x1e0a('0xb4'),'id'])||{});}})[_0x1e0a('0x28')](respondWithResult(_0x38f692,null))[_0x1e0a('0xa9')](handleError(_0x38f692,null));};exports['getMessages']=function(_0x3dfef8,_0x80c6d3,_0x3df221){var _0x17c244={'raw':![],'where':{}};var _0x5528f4={};var _0x5779bd={'count':0x0,'rows':[]};return db[_0x1e0a('0x35')][_0x1e0a('0xb5')]({'where':{'id':_0x3dfef8[_0x1e0a('0xab')]['id']}})[_0x1e0a('0x28')](handleEntityNotFound(_0x80c6d3,null))[_0x1e0a('0x28')](function(_0x23ffb2){if(_0x23ffb2){_0x5528f4[_0x1e0a('0x39')]=_[_0x1e0a('0x3b')](db[_0x1e0a('0xb3')][_0x1e0a('0xac')]);_0x5528f4[_0x1e0a('0x3a')]=_[_0x1e0a('0x3b')](_0x3dfef8['query']);_0x5528f4[_0x1e0a('0x3c')]=_[_0x1e0a('0x3d')](_0x5528f4[_0x1e0a('0x39')],_0x5528f4[_0x1e0a('0x3a')]);_0x17c244[_0x1e0a('0x3e')]=_[_0x1e0a('0x3d')](_0x5528f4[_0x1e0a('0x39')],qs[_0x1e0a('0x3f')](_0x3dfef8['query']['fields']));_0x17c244[_0x1e0a('0x3e')]=_0x17c244[_0x1e0a('0x3e')][_0x1e0a('0x40')]?_0x17c244[_0x1e0a('0x3e')]:_0x5528f4[_0x1e0a('0x39')];if(!_0x3dfef8[_0x1e0a('0x3a')]['hasOwnProperty'](_0x1e0a('0x42'))){_0x17c244[_0x1e0a('0x43')]=qs[_0x1e0a('0x43')](_0x3dfef8['query'][_0x1e0a('0x43')]);_0x17c244[_0x1e0a('0x21')]=qs[_0x1e0a('0x21')](_0x3dfef8[_0x1e0a('0x3a')][_0x1e0a('0x21')]);}_0x17c244[_0x1e0a('0x44')]=qs[_0x1e0a('0x45')](_0x3dfef8['query']['sort']);_0x17c244['where']=qs[_0x1e0a('0x3c')](_[_0x1e0a('0xb6')](_0x3dfef8['query'],_0x5528f4[_0x1e0a('0x3c')]));_0x17c244[_0x1e0a('0x71')]['FaxInteractionId']=_0x23ffb2['id'];if(_0x3dfef8[_0x1e0a('0x3a')][_0x1e0a('0x7d')]){_0x17c244[_0x1e0a('0x71')]=_[_0x1e0a('0xaf')](_0x17c244[_0x1e0a('0x71')],{'$or':_['map'](_0x17c244[_0x1e0a('0x3e')],function(_0x3cbcb3){var _0x527995={};_0x527995[_0x3cbcb3]={'$like':'%'+_0x3dfef8[_0x1e0a('0x3a')]['filter']+'%'};return _0x527995;})});}if(_0x3dfef8[_0x1e0a('0x3a')][_0x1e0a('0x76')]){var _0x16e293=_0x3dfef8['query'][_0x1e0a('0x76')][_0x1e0a('0x31')](',');var _0x4c1d84={};_0x4c1d84[_0x16e293[0x0]]={'$gte':moment(_0x16e293[0x1])[_0x1e0a('0xb7')](_0x1e0a('0xb8'))};_0x17c244[_0x1e0a('0x71')]=_['merge'](_0x17c244['where'],_0x4c1d84);}_0x17c244=_['merge']({},_0x17c244,_0x3dfef8['options']);return db[_0x1e0a('0xb3')][_0x1e0a('0x20')]({'where':_0x17c244[_0x1e0a('0x71')]})[_0x1e0a('0x28')](function(_0x44a04f){_0x5779bd['count']=_0x44a04f;if(_0x3dfef8[_0x1e0a('0x3a')][_0x1e0a('0xad')]){_0x17c244[_0x1e0a('0xae')]=[{'all':!![]}];}return db['FaxMessage'][_0x1e0a('0xb9')](_0x17c244);})[_0x1e0a('0x28')](function(_0xdeeebd){_0x5779bd['rows']=_0xdeeebd;return _0x5779bd;});}})[_0x1e0a('0x28')](respondWithFilteredResult(_0x80c6d3,_0x17c244))[_0x1e0a('0xa9')](handleError(_0x80c6d3,null));};exports[_0x1e0a('0xba')]=function(_0x1b9fed,_0x394647,_0x2023d7){return db[_0x1e0a('0x35')][_0x1e0a('0x5a')]({'where':{'id':_0x1b9fed[_0x1e0a('0xab')]['id']}})[_0x1e0a('0x28')](handleEntityNotFound(_0x394647,null))[_0x1e0a('0x28')](function(_0x4c8d11){if(_0x4c8d11){return _0x4c8d11['setTags'](_0x1b9fed[_0x1e0a('0x6d')]['ids'],_[_0x1e0a('0xbb')](_0x1b9fed[_0x1e0a('0x6d')],[_0x1e0a('0xb4'),'id'])||{})[_0x1e0a('0xbc')](function(){return db['Tag'][_0x1e0a('0xb9')]({'attributes':['id',_0x1e0a('0x2a'),_0x1e0a('0xbd')],'where':{'id':_0x1b9fed[_0x1e0a('0x6d')][_0x1e0a('0xb4')]}});})['then'](function(_0x27faad){socket[_0x1e0a('0xbe')](_0x1e0a('0xbf'),{'id':Number(_0x1b9fed[_0x1e0a('0xab')]['id']),'tags':_0x27faad||[]});return{'id':Number(_0x1b9fed[_0x1e0a('0xab')]['id']),'tags':_0x27faad||[]};});}})[_0x1e0a('0x28')](respondWithResult(_0x394647,null))[_0x1e0a('0xa9')](handleError(_0x394647,null));};exports[_0x1e0a('0xc0')]=function(_0x34a2cf,_0x1de28b,_0x39d5a9){return db[_0x1e0a('0x35')][_0x1e0a('0x5a')]({'where':{'id':_0x34a2cf[_0x1e0a('0xab')]['id']}})[_0x1e0a('0x28')](handleEntityNotFound(_0x1de28b,null))['then'](function(_0x1fd85f){if(_0x1fd85f){return _0x1fd85f['removeTags'](_0x34a2cf[_0x1e0a('0x3a')][_0x1e0a('0xb4')]);}})['then'](respondWithStatusCode(_0x1de28b,null))['catch'](handleError(_0x1de28b,null));};exports[_0x1e0a('0xc1')]=function(_0x12e3f0,_0x33c9f3){var _0x2939d3=moment()[_0x1e0a('0xc2')]()[_0x1e0a('0x91')]();var _0x49c465=path[_0x1e0a('0xc3')](config[_0x1e0a('0xc4')],_0x1e0a('0xc5'),_0x1e0a('0xc6'),_0x1e0a('0xc7'));var _0x8a4465=path[_0x1e0a('0xc3')](config[_0x1e0a('0xc4')],_0x1e0a('0xc5'),_0x1e0a('0xc6'),_0x1e0a('0xc8'));var _0x427c27=path[_0x1e0a('0xc3')](_0x49c465,_0x2939d3);var _0x5090e2=util[_0x1e0a('0xb7')](_0x1e0a('0xc9'),_0x12e3f0['params']['id'],_0x2939d3);var _0x48f76b=path[_0x1e0a('0xc3')](_0x49c465,_0x5090e2);var _0x2cbe58=[];_0x2cbe58['push']({'model':db[_0x1e0a('0xca')],'as':_0x1e0a('0xca'),'raw':!![]});var _0x28ccb6=[{'model':db[_0x1e0a('0xb3')],'as':_0x1e0a('0xcb'),'attributes':['id',_0x1e0a('0x6d'),'createdAt'],'include':_0x2cbe58}];return db[_0x1e0a('0x35')]['find']({'where':{'id':_0x12e3f0[_0x1e0a('0xab')]['id']},'include':_0x28ccb6})[_0x1e0a('0x28')](handleEntityNotFound(_0x33c9f3,null))[_0x1e0a('0x28')](function(_0x346f8f){if(_0x346f8f&&_0x346f8f['Messages']){var _0x27e705=_0x346f8f[_0x1e0a('0xcc')]({'plain':!![]});fs[_0x1e0a('0xcd')](_0x427c27);for(var _0x4de06f=0x0;_0x4de06f<_0x27e705[_0x1e0a('0xcb')]['length'];_0x4de06f++){var _0x4e3df8=_0x27e705[_0x1e0a('0xcb')][_0x4de06f][_0x1e0a('0xca')];if(_0x4e3df8){var _0x9da658=path[_0x1e0a('0xc3')](_0x8a4465,_0x4e3df8[_0x1e0a('0xce')]);if(fs[_0x1e0a('0xcf')](_0x9da658)){fs[_0x1e0a('0xd0')](_0x9da658)[_0x1e0a('0xd1')](fs[_0x1e0a('0xd2')](path[_0x1e0a('0xc3')](_0x427c27,_0x4e3df8[_0x1e0a('0xce')])));}}}return BPromise[_0x1e0a('0x8c')]()[_0x1e0a('0x28')](function(){return new BPromise(function(_0x2391f5,_0x3605c0){zipdir(_0x427c27,{'saveTo':_0x48f76b},function(_0x2bc5ef,_0x426785){if(_0x2bc5ef)return _0x3605c0(_0x2bc5ef);return _0x2391f5(_0x426785);});})[_0x1e0a('0x28')](function(){return new BPromise(function(_0xefc894,_0x3043db){rimraf(_0x427c27,function(_0x2c0876){if(_0x2c0876)_0x3043db(_0x2c0876);return _0xefc894();});});})[_0x1e0a('0x28')](function(){return _0x33c9f3[_0x1e0a('0xc1')](_0x48f76b,_0x5090e2,function(_0x57e8d7){if(_0x57e8d7){console[_0x1e0a('0xd3')](_0x1e0a('0xd4'),_0x57e8d7);}else{fs[_0x1e0a('0xd5')](_0x48f76b);}});});});}else{return _0x33c9f3[_0x1e0a('0x1c')](0xc8);}})[_0x1e0a('0xa9')](handleError(_0x33c9f3,null));}; \ No newline at end of file +var _0xeda8=['createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','groupBy','FaxInteractionId','rows','show','params','includeAll','include','merge','options','create','update','body','describe','FaxMessage','addMessage','ids','omit','getMessages','findOne','format','findAll','setTags','spread','emit','faxInteractionTags:save','removeTags','unix','toString','join','files','tmp','root','server','attachments','transcript-%d-%s.zip','Attachment','Messages','get','basename','createReadStream','pipe','createWriteStream','download','err','unlinkSync','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','json','count','offset','Content-Range','reject','destroy','then','end','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','FaxInteraction','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','field','color','from','tools_tags','select','u.id','ui.FaxInteractionId','left_join','users','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat'];(function(_0xc5d16d,_0x1bdef3){var _0x5a1e52=function(_0x3c2aee){while(--_0x3c2aee){_0xc5d16d['push'](_0xc5d16d['shift']());}};_0x5a1e52(++_0x1bdef3);}(_0xeda8,0x1ed));var _0x8eda=function(_0x18a71c,_0xc76cff){_0x18a71c=_0x18a71c-0x0;var _0x4c2529=_0xeda8[_0x18a71c];return _0x4c2529;};'use strict';var pdf=require(_0x8eda('0x0'));var emlformat=require(_0x8eda('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8eda('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8eda('0x3'));var moment=require('moment');var BPromise=require(_0x8eda('0x4'));var Mustache=require(_0x8eda('0x5'));var util=require('util');var path=require(_0x8eda('0x6'));var sox=require(_0x8eda('0x7'));var csv=require(_0x8eda('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8eda('0x9'));var squel=require(_0x8eda('0xa'));var crypto=require('crypto');var jsforce=require(_0x8eda('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8eda('0x8'));var querystring=require(_0x8eda('0xc'));var Papa=require(_0x8eda('0xd'));var Redis=require(_0x8eda('0xe'));var authService=require(_0x8eda('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8eda('0x10'));var logger=require(_0x8eda('0x11'))(_0x8eda('0x12'));var utils=require('../../config/utils');var config=require(_0x8eda('0x13'));var db=require(_0x8eda('0x14'))['db'];config[_0x8eda('0x15')]=_[_0x8eda('0x16')](config[_0x8eda('0x15')],{'host':_0x8eda('0x17'),'port':0x18eb});var socket=require(_0x8eda('0x18'))(new Redis(config[_0x8eda('0x15')]));require(_0x8eda('0x19'))[_0x8eda('0x1a')](socket);function respondWithStatusCode(_0x585e93,_0x2d6a39){_0x2d6a39=_0x2d6a39||0xcc;return function(_0x240644){if(_0x240644){return _0x585e93[_0x8eda('0x1b')](_0x2d6a39);}return _0x585e93[_0x8eda('0x1c')](_0x2d6a39)['end']();};}function respondWithResult(_0x2e1716,_0x51d7b5){_0x51d7b5=_0x51d7b5||0xc8;return function(_0x30418a){if(_0x30418a){return _0x2e1716[_0x8eda('0x1c')](_0x51d7b5)[_0x8eda('0x1d')](_0x30418a);}};}function respondWithFilteredResult(_0x3d443f,_0xfd4e70){return function(_0xe448b2){if(_0xe448b2){var _0x5df25b=_0xe448b2[_0x8eda('0x1e')],_0x27277a=_0xfd4e70[_0x8eda('0x1f')],_0x373f4a=_0xfd4e70[_0x8eda('0x1f')]+_0xfd4e70['limit'],_0x398411;if(_0x373f4a>=_0x5df25b){_0x373f4a=_0x5df25b;_0x398411=0xc8;}else{_0x398411=0xce;}_0x3d443f[_0x8eda('0x1c')](_0x398411);return _0x3d443f['set'](_0x8eda('0x20'),_0x27277a+'-'+_0x373f4a+'/'+_0x5df25b)[_0x8eda('0x1d')](_0xe448b2);}return null;};}function patchUpdates(_0x79ed3f){return function(_0x55132c){try{jsonpatch['apply'](_0x55132c,_0x79ed3f,!![]);}catch(_0x3d63dd){return BPromise[_0x8eda('0x21')](_0x3d63dd);}return _0x55132c['save']();};}function saveUpdates(_0x458cdc,_0x363170){return function(_0x5aaec5){if(_0x5aaec5){return _0x5aaec5['update'](_0x458cdc)['then'](function(_0x2aab1f){return _0x2aab1f;});}return null;};}function removeEntity(_0x1901e0,_0x479ba7){return function(_0x2672c0){if(_0x2672c0){return _0x2672c0[_0x8eda('0x22')]()[_0x8eda('0x23')](function(){_0x1901e0[_0x8eda('0x1c')](0xcc)[_0x8eda('0x24')]();});}};}function handleEntityNotFound(_0x3b10dc,_0x51bd83){return function(_0x4b6977){if(!_0x4b6977){_0x3b10dc[_0x8eda('0x1b')](0x194);}return _0x4b6977;};}function handleError(_0x3355af,_0x193d7d){_0x193d7d=_0x193d7d||0x1f4;return function(_0x5c53d5){logger[_0x8eda('0x25')](_0x5c53d5[_0x8eda('0x26')]);if(_0x5c53d5[_0x8eda('0x27')]){delete _0x5c53d5['name'];}_0x3355af['status'](_0x193d7d)[_0x8eda('0x28')](_0x5c53d5);};}function getInteractionUsers(_0x1bb180,_0x55bcbe){return new BPromise(function(_0x279f8c,_0x49518e){try{if(_0x55bcbe[_0x1bb180['id']]){_0x1bb180[_0x8eda('0x29')]=_[_0x8eda('0x2a')](_0x55bcbe[_0x1bb180['id']],function(_0x20ea75){return{'id':_0x20ea75['id'],'fullname':_0x20ea75[_0x8eda('0x2b')]};});}}catch(_0x4d5dbc){_0x49518e(_0x4d5dbc);}_0x279f8c(_0x1bb180);});}function getInteractionTags(_0x598342,_0x23a6ef){return new BPromise(function(_0x456b4f,_0x47e5d9){try{if(_0x598342[_0x8eda('0x2c')]){_0x598342[_0x8eda('0x2d')]=[];_0x598342['TagIds'][_0x8eda('0x2e')](',')[_0x8eda('0x2f')](function(_0x3c043c){_0x598342[_0x8eda('0x2d')][_0x8eda('0x30')](_0x23a6ef[_0x3c043c]);});}delete _0x598342[_0x8eda('0x2c')];}catch(_0x53177c){_0x47e5d9(_0x53177c);}_0x456b4f(_0x598342);});}function updateFaxInteraction(_0x5b554a,_0x459a56,_0xa635d8){return new BPromise(function(_0x1c351a,_0x23a63d){return getInteractionUsers(_0x5b554a,_0xa635d8)[_0x8eda('0x23')](function(_0x3b50f0){return getInteractionTags(_0x3b50f0,_0x459a56);})[_0x8eda('0x23')](function(_0x38ea71){_0x1c351a(_0x38ea71);})[_0x8eda('0x31')](function(_0x321a34){_0x23a63d(_0x321a34);});});}exports[_0x8eda('0x32')]=function(_0x2fa427,_0x1b00d2){var _0x1128c8={},_0xacac13={},_0x134155={'count':0x0,'rows':[]};var _0x4fe9e5=_[_0x8eda('0x2a')](db[_0x8eda('0x33')][_0x8eda('0x34')],function(_0x54a7c0){return{'name':_0x54a7c0[_0x8eda('0x35')],'type':_0x54a7c0['type']['key']};});_0xacac13[_0x8eda('0x36')]=_['map'](_0x4fe9e5,_0x8eda('0x27'));_0xacac13[_0x8eda('0x37')]=_[_0x8eda('0x38')](_0x2fa427['query']);_0xacac13[_0x8eda('0x39')]=_['intersection'](_0xacac13[_0x8eda('0x36')],_0xacac13[_0x8eda('0x37')]);_0x1128c8['attributes']=_[_0x8eda('0x3a')](_0xacac13[_0x8eda('0x36')],qs['fields'](_0x2fa427[_0x8eda('0x37')][_0x8eda('0x3b')]));_0x1128c8[_0x8eda('0x3c')]=_0x1128c8['attributes'][_0x8eda('0x3d')]?_0x1128c8[_0x8eda('0x3c')]:_0xacac13['model'];if(!_0x2fa427[_0x8eda('0x37')][_0x8eda('0x3e')](_0x8eda('0x3f'))){_0x1128c8[_0x8eda('0x40')]=qs['limit'](_0x2fa427[_0x8eda('0x37')]['limit']);_0x1128c8[_0x8eda('0x1f')]=qs['offset'](_0x2fa427['query'][_0x8eda('0x1f')]);}_0x1128c8['order']=qs['sort'](_0x2fa427['query'][_0x8eda('0x41')]);_0x1128c8[_0x8eda('0x42')]=qs['filters'](_[_0x8eda('0x43')](_0x2fa427['query'],_0xacac13[_0x8eda('0x39')]));var _0x4746ca=[];var _0x481983=squel['select']()[_0x8eda('0x44')]('id')[_0x8eda('0x44')]('name')[_0x8eda('0x44')](_0x8eda('0x45'))[_0x8eda('0x46')](_0x8eda('0x47'));var _0x323dc7=squel[_0x8eda('0x48')]()[_0x8eda('0x44')](_0x8eda('0x49'))[_0x8eda('0x44')]('u.fullname')['field'](_0x8eda('0x4a'))[_0x8eda('0x46')]('user_has_fax_interactions','ui')[_0x8eda('0x4b')](_0x8eda('0x4c'),'u','u.id\x20=\x20ui.UserId');var _0x166e6c=squel['select']()[_0x8eda('0x46')](_0x8eda('0x4d'),'i')[_0x8eda('0x4b')]('cm_contacts','c',_0x8eda('0x4e'))[_0x8eda('0x4b')](_0x8eda('0x4c'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x8eda('0x4f'),'a',_0x8eda('0x50'))[_0x8eda('0x4b')](_0x8eda('0x51'),'me',_0x8eda('0x52'))[_0x8eda('0x4b')](_0x8eda('0x53'),'it',_0x8eda('0x54'))[_0x8eda('0x4b')](_0x8eda('0x47'),'t','t.id\x20=\x20it.TagId');var _0x8de0d1=squel[_0x8eda('0x55')]();var _0x1f9ac9=[];var _0x1b44d3=squel[_0x8eda('0x55')]();var _0x3e852a;if(_0x2fa427['query'][_0x8eda('0x56')]){_0x3e852a=as[_0x8eda('0x57')](_0x2fa427[_0x8eda('0x37')][_0x8eda('0x56')]);var _0x171864=_0x3e852a['sqlOperator'];for(var _0x5adff7=0x0;_0x5adff7<_0x3e852a[_0x8eda('0x58')][_0x8eda('0x3d')];_0x5adff7++){var _0x473741=_0x3e852a[_0x8eda('0x58')][_0x5adff7];var _0x25bb6a='i';var _0x2b4a63=_['find'](_0x4fe9e5,[_0x8eda('0x27'),_0x473741[_0x8eda('0x44')]]);if(!_0x2b4a63){switch(_0x473741[_0x8eda('0x44')]){case _0x8eda('0x59'):if(_0x473741[_0x8eda('0x5a')]==0x1){_0x166e6c[_0x8eda('0x5b')]('`'+_0x473741[_0x8eda('0x44')]+'`\x20=\x200');}else{_0x166e6c['having']('`'+_0x473741[_0x8eda('0x44')]+_0x8eda('0x5c'));}break;case _0x8eda('0x5d'):if(_0x473741[_0x8eda('0x5e')]===_0x8eda('0x5f')){if(_0x473741['value'][_0x8eda('0x2e')]('\x20')[_0x8eda('0x3d')]>0x1){_0x8de0d1[_0x171864](_0x8eda('0x60'),qs[_0x8eda('0x61')](_0x473741[_0x8eda('0x5a')]),null);}else{var _0x5e1954='%'+_0x473741[_0x8eda('0x5a')]+'%';_0x8de0d1[_0x171864](_0x8eda('0x62'),_0x5e1954,_0x5e1954,_0x5e1954);}}else{_0x2b4a63=_[_0x8eda('0x63')](_0x4fe9e5,[_0x8eda('0x27'),_0x8eda('0x64')]);_0x473741[_0x8eda('0x44')]=_0x8eda('0x64');_0x45fb78=as['buildExpression'](_0x25bb6a,_0x2b4a63[_0x8eda('0x65')],_0x473741);_0x8de0d1[_0x171864](_0x45fb78[_0x8eda('0x66')],_0x45fb78['value'][_0x8eda('0x67')],_0x45fb78[_0x8eda('0x5a')][_0x8eda('0x24')]);}break;case _0x8eda('0x68'):var _0x138721=_0x473741[_0x8eda('0x5a')][_0x8eda('0x2e')](',')[_0x8eda('0x2a')](function(_0x56fdb0){return Number(_0x56fdb0);});_0x138721['forEach'](function(_0xdf30e9){_0x1b44d3['or'](_0x8eda('0x69'),'%,'+_0xdf30e9+',%');});_0x1f9ac9=_[_0x8eda('0x6a')](_0x1f9ac9,_0x138721);break;case _0x8eda('0x6b'):if(_0x473741[_0x8eda('0x5e')]===_0x8eda('0x5f')){_0x8de0d1[_0x171864](_0x8eda('0x6c'),'%'+_0x473741['value']+'%',null);}else{_0x2b4a63=_[_0x8eda('0x63')](_0x4fe9e5,[_0x8eda('0x27'),_0x8eda('0x6d')]);_0x473741[_0x8eda('0x44')]=_0x8eda('0x6d');_0x45fb78=as[_0x8eda('0x6e')](_0x25bb6a,_0x2b4a63['type'],_0x473741);_0x8de0d1[_0x171864](_0x45fb78[_0x8eda('0x66')],_0x45fb78['value']['start'],_0x45fb78[_0x8eda('0x5a')][_0x8eda('0x24')]);}break;case'body':_0x45fb78=as[_0x8eda('0x6e')]('me',null,_0x473741);_0x8de0d1[_0x171864](_0x45fb78[_0x8eda('0x66')],_0x45fb78[_0x8eda('0x5a')][_0x8eda('0x67')],_0x45fb78['value'][_0x8eda('0x24')]);break;}}else{var _0x45fb78=as[_0x8eda('0x6e')](_0x25bb6a,_0x2b4a63[_0x8eda('0x65')],_0x473741);_0x8de0d1[_0x171864](_0x45fb78[_0x8eda('0x66')],_0x45fb78['value'][_0x8eda('0x67')],_0x45fb78['value'][_0x8eda('0x24')]);}}}else{var _0x250efe=_(_0x2fa427[_0x8eda('0x37')])[_0x8eda('0x38')]()[_0x8eda('0x2a')](function(_0x66b8d4){return _['some'](_0x4fe9e5,[_0x8eda('0x27'),_0x66b8d4])?_0x66b8d4:undefined;})[_0x8eda('0x6f')]()[_0x8eda('0x5a')]();if(!_[_0x8eda('0x70')](_0x250efe)){_0x250efe[_0x8eda('0x2f')](function(_0x29f7f2){if(_0x29f7f2===_0x8eda('0x71')){_0x166e6c[_0x8eda('0x42')](_0x8eda('0x72'),[][_0x8eda('0x73')](_0x2fa427[_0x8eda('0x37')][_0x29f7f2]));}else if(_0x29f7f2===_0x8eda('0x74')){var _0x4812e1=JSON[_0x8eda('0x75')](_0x2fa427[_0x8eda('0x37')][_0x29f7f2])[_0x8eda('0x76')];var _0x177209=JSON[_0x8eda('0x75')](_0x2fa427[_0x8eda('0x37')][_0x29f7f2])['$lte'];_0x166e6c['where'](_0x8eda('0x77'),_0x4812e1,_0x177209);}else{if(_0x2fa427[_0x8eda('0x37')][_0x29f7f2]==='null'){_0x166e6c[_0x8eda('0x42')]('i.'+_0x29f7f2+_0x8eda('0x78'));}else{_0x166e6c[_0x8eda('0x42')]('i.'+_0x29f7f2+_0x8eda('0x79'),_0x2fa427['query'][_0x29f7f2]);}}});}if(_0x2fa427['query']['read']){if(_0x2fa427['query']['read']==0x1){_0x166e6c[_0x8eda('0x5b')]('`unreadMessages`\x20=\x200');}else{_0x166e6c['having']('`unreadMessages`\x20>\x200');}}if(_0x2fa427[_0x8eda('0x37')][_0x8eda('0x7a')]){_0x1f9ac9=_['isArray'](_0x2fa427['query']['tag'])?_0x2fa427[_0x8eda('0x37')]['tag']:new Array(_0x2fa427['query']['tag']);_0x1f9ac9[_0x8eda('0x2f')](function(_0x50a11b){_0x1b44d3['or'](_0x8eda('0x69'),'%,'+_0x50a11b+',%');});}if(_0x2fa427[_0x8eda('0x37')]['filter']){var _0x119091=_0x2fa427[_0x8eda('0x37')][_0x8eda('0x7b')][_0x8eda('0x7c')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x8eda('0x7d'));if(qs[_0x8eda('0x7e')](_0x119091)){_0x8de0d1['or']('i.id\x20LIKE\x20?',_0x119091+'%')['or'](_0x8eda('0x7f'),_0x119091+'%');}_0x8de0d1['or'](_0x8eda('0x80'),_0x119091+'%');}}_0x166e6c[_0x8eda('0x42')](_0x8de0d1);_0x166e6c[_0x8eda('0x81')](_0x8eda('0x82'));var _0x40df91={'type':db[_0x8eda('0x83')][_0x8eda('0x84')]['SELECT'],'raw':!![]};var _0x183186=_0x166e6c[_0x8eda('0x85')]();_0x183186[_0x8eda('0x44')](_0x8eda('0x82'));_0x183186['field'](_0x8eda('0x86'),'unreadMessages');if(_0x1128c8[_0x8eda('0x87')]){_0x1128c8[_0x8eda('0x87')]['forEach'](function(_0x22fef2){_0x166e6c[_0x8eda('0x87')]('i.'+_0x22fef2[0x0],_0x22fef2[0x1]===_0x8eda('0x88')?![]:!![]);});}if(!_[_0x8eda('0x70')](_0x1f9ac9)){_0x166e6c[_0x8eda('0x5b')](_0x1b44d3);_0x183186[_0x8eda('0x42')](_0x8eda('0x89'),_0x1f9ac9);}BPromise[_0x8eda('0x8a')]()[_0x8eda('0x23')](function(){if(!_0x3e852a){if(_0x2fa427[_0x8eda('0x37')]['FaxAccountId']||_0x2fa427[_0x8eda('0x37')]['journey'])return;_0x183186[_0x8eda('0x42')](_0x8eda('0x8b'));_0x166e6c[_0x8eda('0x42')](_0x8eda('0x8b'));return;}return _0x2fa427[_0x8eda('0x8c')][_0x8eda('0x8d')]({'attributes':['id'],'raw':!![]})[_0x8eda('0x23')](function(_0x487a0e){if(_[_0x8eda('0x70')](_0x487a0e)){_0x183186[_0x8eda('0x42')](_0x8eda('0x8e'));_0x166e6c['where']('i.FaxAccountId\x20IS\x20NULL');}else{_0x183186[_0x8eda('0x42')](_0x8eda('0x72'),_['map'](_0x487a0e,'id'));_0x166e6c['where']('i.FaxAccountId\x20IN\x20?',_[_0x8eda('0x2a')](_0x487a0e,'id'));}});})[_0x8eda('0x23')](function(){db[_0x8eda('0x8f')][_0x8eda('0x37')](_0x183186['toString'](),_0x40df91)[_0x8eda('0x23')](function(_0x233668){_0x134155[_0x8eda('0x1e')]=_0x233668[_0x8eda('0x3d')];if(_0x134155[_0x8eda('0x1e')]===0x0)return[];return db['sequelize'][_0x8eda('0x37')](_0x481983['toString'](),_0x40df91)[_0x8eda('0x23')](function(_0x5d4ce5){_0x4746ca=_[_0x8eda('0x90')](_0x5d4ce5,'id');_0x40df91=_['merge'](_0x40df91,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2fa427[_0x8eda('0x37')][_0x8eda('0x3b')]){_0x1128c8[_0x8eda('0x3c')][_0x8eda('0x2f')](function(_0x3cb345){_0x166e6c[_0x8eda('0x44')]('i.'+_0x3cb345);});}else{_0x166e6c[_0x8eda('0x44')](_0x8eda('0x86'),_0x8eda('0x59'));_0x166e6c['field'](_0x8eda('0x91'),_0x8eda('0x92'));_0x166e6c[_0x8eda('0x44')]('a.mandatoryDisposition',_0x8eda('0x93'));_0x166e6c[_0x8eda('0x44')]('i.*');_0x166e6c[_0x8eda('0x44')](_0x8eda('0x94'),_0x8eda('0x95'));_0x166e6c[_0x8eda('0x44')](_0x8eda('0x96'),'Contact.lastName');_0x166e6c[_0x8eda('0x44')](_0x8eda('0x97'),'Contact.email');_0x166e6c[_0x8eda('0x44')](_0x8eda('0x98'),_0x8eda('0x99'));_0x166e6c['field'](_0x8eda('0x9a'),_0x8eda('0x9b'));_0x166e6c[_0x8eda('0x44')](_0x8eda('0x9c'),_0x8eda('0x9d'));_0x166e6c[_0x8eda('0x44')]('o.fullname','Owner.fullname');_0x166e6c['field']('o.internal','Owner.internal');_0x166e6c[_0x8eda('0x44')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x8eda('0x2c'));}_0x166e6c['limit'](_0x1128c8[_0x8eda('0x40')]);_0x166e6c['offset'](_0x1128c8[_0x8eda('0x1f')]);return db[_0x8eda('0x8f')][_0x8eda('0x37')](_0x166e6c['toString'](),_0x40df91);})[_0x8eda('0x23')](function(_0x62bd29){_0x323dc7['where']('ui.FaxInteractionId\x20IN\x20?',_[_0x8eda('0x2a')](_0x62bd29,'id'));return db['sequelize']['query'](_0x323dc7['toString'](),_0x40df91)['then'](function(_0x2852ef){var _0x185569=_[_0x8eda('0x9e')](_0x2852ef,_0x8eda('0x9f'));var _0x319e74=[];_0x62bd29[_0x8eda('0x2f')](function(_0x56f0e4){_0x319e74[_0x8eda('0x30')](updateFaxInteraction(_0x56f0e4,_0x4746ca,_0x185569));});return BPromise['all'](_0x319e74);});});})['then'](function(_0x5108c1){_0x134155[_0x8eda('0xa0')]=_0x5108c1;return _0x134155;})[_0x8eda('0x23')](respondWithFilteredResult(_0x1b00d2,_0x1128c8));})[_0x8eda('0x31')](handleError(_0x1b00d2,null));};exports[_0x8eda('0xa1')]=function(_0x1d821f,_0x2faded){var _0x57983b={'raw':![],'where':{'id':_0x1d821f[_0x8eda('0xa2')]['id']}},_0x547de4={};_0x547de4[_0x8eda('0x36')]=_['keys'](db[_0x8eda('0x33')][_0x8eda('0x34')]);_0x547de4['query']=_[_0x8eda('0x38')](_0x1d821f[_0x8eda('0x37')]);_0x547de4[_0x8eda('0x39')]=_[_0x8eda('0x3a')](_0x547de4[_0x8eda('0x36')],_0x547de4[_0x8eda('0x37')]);_0x57983b[_0x8eda('0x3c')]=_[_0x8eda('0x3a')](_0x547de4[_0x8eda('0x36')],qs[_0x8eda('0x3b')](_0x1d821f[_0x8eda('0x37')][_0x8eda('0x3b')]));_0x57983b[_0x8eda('0x3c')]=_0x57983b['attributes'][_0x8eda('0x3d')]?_0x57983b['attributes']:_0x547de4[_0x8eda('0x36')];if(_0x1d821f[_0x8eda('0x37')][_0x8eda('0xa3')]){_0x57983b[_0x8eda('0xa4')]=[{'all':!![]}];}_0x57983b=_[_0x8eda('0xa5')]({},_0x57983b,_0x1d821f[_0x8eda('0xa6')]);return db['FaxInteraction'][_0x8eda('0x63')](_0x57983b)['then'](handleEntityNotFound(_0x2faded,null))[_0x8eda('0x23')](respondWithResult(_0x2faded,null))['catch'](handleError(_0x2faded,null));};exports['create']=function(_0x5da2d8,_0x2c7a77){return db[_0x8eda('0x33')][_0x8eda('0xa7')](_0x5da2d8['body'],{})['then'](respondWithResult(_0x2c7a77,0xc9))[_0x8eda('0x31')](handleError(_0x2c7a77,null));};exports[_0x8eda('0xa8')]=function(_0x479137,_0x138c53){if(_0x479137[_0x8eda('0xa9')]['id']){delete _0x479137['body']['id'];}return db[_0x8eda('0x33')][_0x8eda('0x63')]({'where':{'id':_0x479137[_0x8eda('0xa2')]['id']}})[_0x8eda('0x23')](handleEntityNotFound(_0x138c53,null))[_0x8eda('0x23')](saveUpdates(_0x479137[_0x8eda('0xa9')],null))[_0x8eda('0x23')](respondWithResult(_0x138c53,null))[_0x8eda('0x31')](handleError(_0x138c53,null));};exports[_0x8eda('0x22')]=function(_0x5e10fc,_0x375c20){return db[_0x8eda('0x33')][_0x8eda('0x63')]({'where':{'id':_0x5e10fc[_0x8eda('0xa2')]['id']}})[_0x8eda('0x23')](handleEntityNotFound(_0x375c20,null))['then'](removeEntity(_0x375c20,null))[_0x8eda('0x31')](handleError(_0x375c20,null));};exports['describe']=function(_0x3b830f,_0x4ec4e3){return db['FaxInteraction'][_0x8eda('0xaa')]()['then'](respondWithResult(_0x4ec4e3,null))[_0x8eda('0x31')](handleError(_0x4ec4e3,null));};exports['addMessage']=function(_0x444812,_0x2d5bdc,_0x288e68){return db[_0x8eda('0xab')][_0x8eda('0x63')]({'where':{'id':_0x444812['params']['id']}})[_0x8eda('0x23')](handleEntityNotFound(_0x2d5bdc,null))[_0x8eda('0x23')](function(_0x2860f8){if(_0x2860f8){return _0x2860f8[_0x8eda('0xac')](_0x444812[_0x8eda('0xa9')][_0x8eda('0xad')],_[_0x8eda('0xae')](_0x444812[_0x8eda('0xa9')],[_0x8eda('0xad'),'id'])||{});}})['then'](respondWithResult(_0x2d5bdc,null))['catch'](handleError(_0x2d5bdc,null));};exports[_0x8eda('0xaf')]=function(_0x8f83b9,_0x1a0d1f,_0x4e5c5d){var _0x39b84c={'raw':![],'where':{}};var _0x41edab={};var _0x5d5683={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x8eda('0xb0')]({'where':{'id':_0x8f83b9['params']['id']}})[_0x8eda('0x23')](handleEntityNotFound(_0x1a0d1f,null))[_0x8eda('0x23')](function(_0x13f4fa){if(_0x13f4fa){_0x41edab[_0x8eda('0x36')]=_['keys'](db['FaxMessage'][_0x8eda('0x34')]);_0x41edab[_0x8eda('0x37')]=_[_0x8eda('0x38')](_0x8f83b9[_0x8eda('0x37')]);_0x41edab['filters']=_['intersection'](_0x41edab[_0x8eda('0x36')],_0x41edab[_0x8eda('0x37')]);_0x39b84c[_0x8eda('0x3c')]=_['intersection'](_0x41edab[_0x8eda('0x36')],qs[_0x8eda('0x3b')](_0x8f83b9[_0x8eda('0x37')][_0x8eda('0x3b')]));_0x39b84c['attributes']=_0x39b84c[_0x8eda('0x3c')][_0x8eda('0x3d')]?_0x39b84c[_0x8eda('0x3c')]:_0x41edab[_0x8eda('0x36')];if(!_0x8f83b9[_0x8eda('0x37')][_0x8eda('0x3e')](_0x8eda('0x3f'))){_0x39b84c[_0x8eda('0x40')]=qs[_0x8eda('0x40')](_0x8f83b9['query'][_0x8eda('0x40')]);_0x39b84c[_0x8eda('0x1f')]=qs[_0x8eda('0x1f')](_0x8f83b9[_0x8eda('0x37')][_0x8eda('0x1f')]);}_0x39b84c[_0x8eda('0x87')]=qs[_0x8eda('0x41')](_0x8f83b9[_0x8eda('0x37')]['sort']);_0x39b84c['where']=qs[_0x8eda('0x39')](_[_0x8eda('0x43')](_0x8f83b9[_0x8eda('0x37')],_0x41edab['filters']));_0x39b84c[_0x8eda('0x42')][_0x8eda('0x9f')]=_0x13f4fa['id'];if(_0x8f83b9[_0x8eda('0x37')][_0x8eda('0x7b')]){_0x39b84c[_0x8eda('0x42')]=_[_0x8eda('0xa5')](_0x39b84c[_0x8eda('0x42')],{'$or':_['map'](_0x39b84c[_0x8eda('0x3c')],function(_0x7fae90){var _0x4500d2={};_0x4500d2[_0x7fae90]={'$like':'%'+_0x8f83b9['query']['filter']+'%'};return _0x4500d2;})});}if(_0x8f83b9[_0x8eda('0x37')][_0x8eda('0x76')]){var _0x1f2f23=_0x8f83b9[_0x8eda('0x37')][_0x8eda('0x76')]['split'](',');var _0x2765c0={};_0x2765c0[_0x1f2f23[0x0]]={'$gte':moment(_0x1f2f23[0x1])[_0x8eda('0xb1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x39b84c[_0x8eda('0x42')]=_[_0x8eda('0xa5')](_0x39b84c[_0x8eda('0x42')],_0x2765c0);}_0x39b84c=_[_0x8eda('0xa5')]({},_0x39b84c,_0x8f83b9[_0x8eda('0xa6')]);return db['FaxMessage']['count']({'where':_0x39b84c['where']})[_0x8eda('0x23')](function(_0x3dfda3){_0x5d5683[_0x8eda('0x1e')]=_0x3dfda3;if(_0x8f83b9[_0x8eda('0x37')]['includeAll']){_0x39b84c[_0x8eda('0xa4')]=[{'all':!![]}];}return db[_0x8eda('0xab')][_0x8eda('0xb2')](_0x39b84c);})[_0x8eda('0x23')](function(_0x3f1d27){_0x5d5683[_0x8eda('0xa0')]=_0x3f1d27;return _0x5d5683;});}})[_0x8eda('0x23')](respondWithFilteredResult(_0x1a0d1f,_0x39b84c))[_0x8eda('0x31')](handleError(_0x1a0d1f,null));};exports['addTags']=function(_0xaa32b5,_0x3d0cf2,_0x552bb9){return db[_0x8eda('0x33')][_0x8eda('0x63')]({'where':{'id':_0xaa32b5[_0x8eda('0xa2')]['id']}})[_0x8eda('0x23')](handleEntityNotFound(_0x3d0cf2,null))['then'](function(_0x4b1592){if(_0x4b1592){return _0x4b1592[_0x8eda('0xb3')](_0xaa32b5[_0x8eda('0xa9')]['ids'],_[_0x8eda('0xae')](_0xaa32b5[_0x8eda('0xa9')],[_0x8eda('0xad'),'id'])||{})[_0x8eda('0xb4')](function(){return db[_0x8eda('0x68')][_0x8eda('0xb2')]({'attributes':['id',_0x8eda('0x27'),_0x8eda('0x45')],'where':{'id':_0xaa32b5[_0x8eda('0xa9')][_0x8eda('0xad')]}});})[_0x8eda('0x23')](function(_0x43cfc4){socket[_0x8eda('0xb5')](_0x8eda('0xb6'),{'id':Number(_0xaa32b5[_0x8eda('0xa2')]['id']),'tags':_0x43cfc4||[]});return{'id':Number(_0xaa32b5[_0x8eda('0xa2')]['id']),'tags':_0x43cfc4||[]};});}})[_0x8eda('0x23')](respondWithResult(_0x3d0cf2,null))[_0x8eda('0x31')](handleError(_0x3d0cf2,null));};exports[_0x8eda('0xb7')]=function(_0x49f36c,_0x28cfbe,_0x494d22){return db[_0x8eda('0x33')][_0x8eda('0x63')]({'where':{'id':_0x49f36c['params']['id']}})[_0x8eda('0x23')](handleEntityNotFound(_0x28cfbe,null))[_0x8eda('0x23')](function(_0x411ea3){if(_0x411ea3){return _0x411ea3[_0x8eda('0xb7')](_0x49f36c[_0x8eda('0x37')][_0x8eda('0xad')]);}})['then'](respondWithStatusCode(_0x28cfbe,null))['catch'](handleError(_0x28cfbe,null));};exports['download']=function(_0x3432af,_0x3a133b){var _0x5cac45=moment()[_0x8eda('0xb8')]()[_0x8eda('0xb9')]();var _0xb8dbf0=path[_0x8eda('0xba')](config['root'],'server',_0x8eda('0xbb'),_0x8eda('0xbc'));var _0x42b5ff=path[_0x8eda('0xba')](config[_0x8eda('0xbd')],_0x8eda('0xbe'),_0x8eda('0xbb'),_0x8eda('0xbf'));var _0x3170ad=path[_0x8eda('0xba')](_0xb8dbf0,_0x5cac45);var _0x28c583=util['format'](_0x8eda('0xc0'),_0x3432af[_0x8eda('0xa2')]['id'],_0x5cac45);var _0x37accf=path[_0x8eda('0xba')](_0xb8dbf0,_0x28c583);var _0x1363bc=[];_0x1363bc[_0x8eda('0x30')]({'model':db[_0x8eda('0xc1')],'as':'Attachment','raw':!![]});var _0x221336=[{'model':db[_0x8eda('0xab')],'as':_0x8eda('0xc2'),'attributes':['id',_0x8eda('0xa9'),_0x8eda('0x74')],'include':_0x1363bc}];return db[_0x8eda('0x33')][_0x8eda('0x63')]({'where':{'id':_0x3432af[_0x8eda('0xa2')]['id']},'include':_0x221336})[_0x8eda('0x23')](handleEntityNotFound(_0x3a133b,null))[_0x8eda('0x23')](function(_0x3c8941){if(_0x3c8941&&_0x3c8941[_0x8eda('0xc2')]){var _0x2127e0=_0x3c8941[_0x8eda('0xc3')]({'plain':!![]});fs['mkdirSync'](_0x3170ad);for(var _0x3c7a4d=0x0;_0x3c7a4d<_0x2127e0['Messages'][_0x8eda('0x3d')];_0x3c7a4d++){var _0x533b7f=_0x2127e0['Messages'][_0x3c7a4d][_0x8eda('0xc1')];if(_0x533b7f){var _0x509eb0=path[_0x8eda('0xba')](_0x42b5ff,_0x533b7f[_0x8eda('0xc4')]);if(fs['existsSync'](_0x509eb0)){fs[_0x8eda('0xc5')](_0x509eb0)[_0x8eda('0xc6')](fs[_0x8eda('0xc7')](path[_0x8eda('0xba')](_0x3170ad,_0x533b7f[_0x8eda('0xc4')])));}}}return BPromise[_0x8eda('0x8a')]()['then'](function(){return new BPromise(function(_0x123428,_0x22ede7){zipdir(_0x3170ad,{'saveTo':_0x37accf},function(_0x1c5d24,_0x3e5544){if(_0x1c5d24)return _0x22ede7(_0x1c5d24);return _0x123428(_0x3e5544);});})[_0x8eda('0x23')](function(){return new BPromise(function(_0x91588d,_0x39972a){rimraf(_0x3170ad,function(_0x42cb5e){if(_0x42cb5e)_0x39972a(_0x42cb5e);return _0x91588d();});});})[_0x8eda('0x23')](function(){return _0x3a133b[_0x8eda('0xc8')](_0x37accf,_0x28c583,function(_0x227e08){if(_0x227e08){console['log'](_0x8eda('0xc9'),_0x227e08);}else{fs[_0x8eda('0xca')](_0x37accf);}});});});}else{return _0x3a133b[_0x8eda('0x1b')](0xc8);}})[_0x8eda('0x31')](handleError(_0x3a133b,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 4a6f6ae..693d9ae 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 _0x1261=['exports','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','hasOwnProperty'];(function(_0x30777d,_0x2c85b2){var _0x533cc5=function(_0x29ed0f){while(--_0x29ed0f){_0x30777d['push'](_0x30777d['shift']());}};_0x533cc5(++_0x2c85b2);}(_0x1261,0x144));var _0x1126=function(_0x21eb3c,_0x7ce88b){_0x21eb3c=_0x21eb3c-0x0;var _0x4bd2aa=_0x1261[_0x21eb3c];return _0x4bd2aa;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x1126('0x0'))['db'][_0x1126('0x1')];var FaxMessage=require(_0x1126('0x0'))['db'][_0x1126('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x1126('0x3')](0x0);var events={'afterCreate':_0x1126('0x4'),'afterUpdate':_0x1126('0x5'),'afterDestroy':_0x1126('0x6')};function emitEvent(_0x21a480){return function(_0x75a851,_0x5a2189,_0x5c68c8){_0x75a851[_0x1126('0x7')]({'attributes':['id'],'raw':!![]})[_0x1126('0x8')](function(_0x4f239c){_0x75a851[_0x1126('0x9')](_0x1126('0xa'),_0x4f239c[_0x1126('0xb')](function(_0x3abb0b){return{'id':_0x3abb0b['id']};}));return FaxMessage[_0x1126('0xc')]({'where':{'FaxInteractionId':_0x75a851['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3f09ac){_0x75a851[_0x1126('0x9')](_0x1126('0xd'),_0x3f09ac['length']);FaxInteractionEvents[_0x1126('0xe')](_0x21a480+':'+_0x75a851['id'],_0x75a851);FaxInteractionEvents['emit'](_0x21a480,_0x75a851);_0x5c68c8(null);})['catch'](_0x5c68c8(null));};}for(var e in events){if(events[_0x1126('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x1126('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0x326f=['../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','unreadMessages','length','emit','hasOwnProperty','exports','events'];(function(_0x57cbbf,_0x103d59){var _0x55a7ab=function(_0x12d921){while(--_0x12d921){_0x57cbbf['push'](_0x57cbbf['shift']());}};_0x55a7ab(++_0x103d59);}(_0x326f,0xd1));var _0xf326=function(_0x493ee0,_0xd8805f){_0x493ee0=_0x493ee0-0x0;var _0x58ac3d=_0x326f[_0x493ee0];return _0x58ac3d;};'use strict';var EventEmitter=require(_0xf326('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0xf326('0x1'))['db'][_0xf326('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xf326('0x3')](0x0);var events={'afterCreate':_0xf326('0x4'),'afterUpdate':_0xf326('0x5'),'afterDestroy':_0xf326('0x6')};function emitEvent(_0x9445c6){return function(_0xf1c243,_0x1b5a56,_0x3ace29){_0xf1c243['getUsers']({'attributes':['id'],'raw':!![]})[_0xf326('0x7')](function(_0x3851eb){_0xf1c243[_0xf326('0x8')](_0xf326('0x9'),_0x3851eb['map'](function(_0x4c206c){return{'id':_0x4c206c['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0xf1c243['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf326('0x7')](function(_0x1fc80e){_0xf1c243[_0xf326('0x8')](_0xf326('0xa'),_0x1fc80e[_0xf326('0xb')]);FaxInteractionEvents['emit'](_0x9445c6+':'+_0xf1c243['id'],_0xf1c243);FaxInteractionEvents[_0xf326('0xc')](_0x9445c6,_0xf1c243);_0x3ace29(null);})['catch'](_0x3ace29(null));};}for(var e in events){if(events[_0xf326('0xd')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xf326('0xe')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 5e69540..7931890 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 _0xd7f5=['rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','closedAt','format','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2f17e4,_0x1d4bc3){var _0x397e3a=function(_0xfefbaa){while(--_0xfefbaa){_0x2f17e4['push'](_0x2f17e4['shift']());}};_0x397e3a(++_0x1d4bc3);}(_0xd7f5,0x119));var _0x5d7f=function(_0x555ebb,_0x4b1b68){_0x555ebb=_0x555ebb-0x0;var _0x3c0a4a=_0xd7f5[_0x555ebb];return _0x3c0a4a;};'use strict';var _=require(_0x5d7f('0x0'));var util=require('util');var logger=require(_0x5d7f('0x1'))(_0x5d7f('0x2'));var moment=require(_0x5d7f('0x3'));var BPromise=require(_0x5d7f('0x4'));var rp=require(_0x5d7f('0x5'));var fs=require('fs');var path=require(_0x5d7f('0x6'));var rimraf=require(_0x5d7f('0x7'));var config=require(_0x5d7f('0x8'));var attributes=require(_0x5d7f('0x9'));module[_0x5d7f('0xa')]=function(_0x494854,_0x57ea34){return _0x494854[_0x5d7f('0xb')](_0x5d7f('0xc'),attributes,{'tableName':_0x5d7f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x15ce6e,_0x470aca,_0x5cfcab){if(_0x15ce6e['changed']('closed')){_0x15ce6e[_0x5d7f('0xe')]=moment()[_0x5d7f('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5cfcab(null,_0x15ce6e);}}});}; \ No newline at end of file +var _0x1fad=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','closed','closedAt','format'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x1fad,0x188));var _0xd1fa=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x1fad[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xd1fa('0x0'));var util=require(_0xd1fa('0x1'));var logger=require(_0xd1fa('0x2'))(_0xd1fa('0x3'));var moment=require(_0xd1fa('0x4'));var BPromise=require('bluebird');var rp=require(_0xd1fa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd1fa('0x6'));var config=require(_0xd1fa('0x7'));var attributes=require(_0xd1fa('0x8'));module[_0xd1fa('0x9')]=function(_0x1eb5d7,_0x5dc26d){return _0x1eb5d7[_0xd1fa('0xa')](_0xd1fa('0xb'),attributes,{'tableName':_0xd1fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x43b20e,_0x9c76ed,_0x45329f){if(_0x43b20e['changed'](_0xd1fa('0xd'))){_0x43b20e[_0xd1fa('0xe')]=moment()[_0xd1fa('0xf')](_0xd1fa('0x10'));}_0x45329f(null,_0x43b20e);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 933fe1b..be014e6 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 _0xc0ab=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','FaxInteraction,\x20%s,\x20%s','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','debug','stringify','catch','AddTagsToFaxInteraction','find','addTags','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x2e301d,_0x26b5f0){var _0x3b370c=function(_0x1e5999){while(--_0x1e5999){_0x2e301d['push'](_0x2e301d['shift']());}};_0x3b370c(++_0x26b5f0);}(_0xc0ab,0x7d));var _0xbc0a=function(_0x17fdde,_0x4b3717){_0x17fdde=_0x17fdde-0x0;var _0x4fd885=_0xc0ab[_0x17fdde];return _0x4fd885;};'use strict';var _=require(_0xbc0a('0x0'));var util=require(_0xbc0a('0x1'));var moment=require(_0xbc0a('0x2'));var BPromise=require(_0xbc0a('0x3'));var rs=require(_0xbc0a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc0a('0x5'))['db'];var utils=require(_0xbc0a('0x6'));var logger=require('../../config/logger')(_0xbc0a('0x7'));var config=require(_0xbc0a('0x8'));var jayson=require(_0xbc0a('0x9'));var client=jayson[_0xbc0a('0xa')][_0xbc0a('0xb')]({'port':0x232a});config[_0xbc0a('0xc')]=_[_0xbc0a('0xd')](config['redis'],{'host':_0xbc0a('0xe'),'port':0x18eb});var socket=require(_0xbc0a('0xf'))(new Redis(config['redis']));require(_0xbc0a('0x10'))[_0xbc0a('0x11')](socket);function respondWithRpcPromise(_0xa7a8aa,_0x2a7d2c,_0xb647f5){return new BPromise(function(_0x6aaf47,_0x3d3c1b){return client[_0xbc0a('0x12')](_0xa7a8aa,_0xb647f5)[_0xbc0a('0x13')](function(_0x1dc6b8){logger['info'](_0xbc0a('0x14'),_0x2a7d2c,'request\x20sent');logger['debug'](_0xbc0a('0x15'),_0x2a7d2c,_0xbc0a('0x16'),JSON['stringify'](_0x1dc6b8));if(_0x1dc6b8['error']){if(_0x1dc6b8[_0xbc0a('0x17')]['code']===0x1f4){logger[_0xbc0a('0x17')](_0xbc0a('0x14'),_0x2a7d2c,_0x1dc6b8['error'][_0xbc0a('0x18')]);return _0x3d3c1b(_0x1dc6b8[_0xbc0a('0x17')][_0xbc0a('0x18')]);}logger[_0xbc0a('0x17')](_0xbc0a('0x14'),_0x2a7d2c,_0x1dc6b8[_0xbc0a('0x17')]['message']);return _0x6aaf47(_0x1dc6b8[_0xbc0a('0x17')]['message']);}else{logger[_0xbc0a('0x19')](_0xbc0a('0x14'),_0x2a7d2c,_0xbc0a('0x16'));_0x6aaf47(_0x1dc6b8[_0xbc0a('0x1a')][_0xbc0a('0x18')]);}})['catch'](function(_0x1dbe67){logger[_0xbc0a('0x17')](_0xbc0a('0x14'),_0x2a7d2c,_0x1dbe67);_0x3d3c1b(_0x1dbe67);});});}exports[_0xbc0a('0x1b')]=function(_0x2784e6){var _0x74bcfb=this;return new Promise(function(_0x3c6d03,_0x38816d){return db[_0xbc0a('0x1c')][_0xbc0a('0x1d')](_0x2784e6[_0xbc0a('0x1e')],{'raw':_0x2784e6[_0xbc0a('0x1f')]?_0x2784e6[_0xbc0a('0x1f')][_0xbc0a('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2784e6[_0xbc0a('0x1f')]?_0x2784e6[_0xbc0a('0x1f')][_0xbc0a('0x21')]||null:null,'attributes':_0x2784e6[_0xbc0a('0x1f')]?_0x2784e6['options'][_0xbc0a('0x22')]||null:null,'limit':_0x2784e6['options']?_0x2784e6[_0xbc0a('0x1f')][_0xbc0a('0x23')]||null:null})[_0xbc0a('0x13')](function(_0x499d56){logger[_0xbc0a('0x19')](_0xbc0a('0x1b'),_0x2784e6);logger[_0xbc0a('0x24')](_0xbc0a('0x1b'),_0x2784e6,JSON[_0xbc0a('0x25')](_0x499d56));_0x3c6d03(_0x499d56);})[_0xbc0a('0x26')](function(_0x11299e){logger[_0xbc0a('0x17')]('UpdateFaxInteraction',_0x11299e[_0xbc0a('0x18')],_0x2784e6);_0x38816d(_0x74bcfb[_0xbc0a('0x17')](0x1f4,_0x11299e['message']));});});};exports[_0xbc0a('0x27')]=function(_0x5d203a){return new Promise(function(_0x1df51a,_0x2cd4da){return db[_0xbc0a('0x1c')][_0xbc0a('0x28')]({'where':_0x5d203a[_0xbc0a('0x1f')]?_0x5d203a[_0xbc0a('0x1f')][_0xbc0a('0x21')]||null:null})['then'](function(_0x56566a){if(_0x56566a){return _0x56566a[_0xbc0a('0x29')](_0x5d203a[_0xbc0a('0x1e')]['ids'],_['omit'](_0x5d203a[_0xbc0a('0x1e')],['ids','id'])||{});}})[_0xbc0a('0x2a')](function(_0x69c16e){logger[_0xbc0a('0x19')](_0xbc0a('0x2b'),_0x5d203a);logger[_0xbc0a('0x24')](_0xbc0a('0x2b'),_0x5d203a,JSON[_0xbc0a('0x25')](_0x69c16e));_0x1df51a(_0x69c16e);})['catch'](function(_0x35d132){logger[_0xbc0a('0x17')](_0xbc0a('0x2b'),_0x35d132[_0xbc0a('0x18')],_0x5d203a);_0x2cd4da(_this[_0xbc0a('0x17')](0x1f4,_0x35d132[_0xbc0a('0x18')]));});});}; \ No newline at end of file +var _0x37e3=['limit','info','catch','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','request','then','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes'];(function(_0x41d426,_0x3fa567){var _0x4a4867=function(_0x2cc56c){while(--_0x2cc56c){_0x41d426['push'](_0x41d426['shift']());}};_0x4a4867(++_0x3fa567);}(_0x37e3,0x1b8));var _0x337e=function(_0x4b408e,_0xcf8f14){_0x4b408e=_0x4b408e-0x0;var _0x3f464c=_0x37e3[_0x4b408e];return _0x3f464c;};'use strict';var _=require(_0x337e('0x0'));var util=require(_0x337e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x337e('0x2'));var fs=require('fs');var Redis=require(_0x337e('0x3'));var db=require(_0x337e('0x4'))['db'];var utils=require(_0x337e('0x5'));var logger=require(_0x337e('0x6'))(_0x337e('0x7'));var config=require(_0x337e('0x8'));var jayson=require(_0x337e('0x9'));var client=jayson['client'][_0x337e('0xa')]({'port':0x232a});config['redis']=_[_0x337e('0xb')](config[_0x337e('0xc')],{'host':_0x337e('0xd'),'port':0x18eb});var socket=require(_0x337e('0xe'))(new Redis(config[_0x337e('0xc')]));require('./faxInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x5da87b,_0x53d7d0,_0x344027){return new BPromise(function(_0x281d86,_0x3f3674){return client[_0x337e('0xf')](_0x5da87b,_0x344027)[_0x337e('0x10')](function(_0x5490de){logger['info'](_0x337e('0x11'),_0x53d7d0,'request\x20sent');logger[_0x337e('0x12')](_0x337e('0x13'),_0x53d7d0,_0x337e('0x14'),JSON[_0x337e('0x15')](_0x5490de));if(_0x5490de[_0x337e('0x16')]){if(_0x5490de[_0x337e('0x16')]['code']===0x1f4){logger[_0x337e('0x16')](_0x337e('0x11'),_0x53d7d0,_0x5490de['error'][_0x337e('0x17')]);return _0x3f3674(_0x5490de[_0x337e('0x16')][_0x337e('0x17')]);}logger[_0x337e('0x16')](_0x337e('0x11'),_0x53d7d0,_0x5490de['error'][_0x337e('0x17')]);return _0x281d86(_0x5490de[_0x337e('0x16')][_0x337e('0x17')]);}else{logger['info'](_0x337e('0x11'),_0x53d7d0,'request\x20sent');_0x281d86(_0x5490de[_0x337e('0x18')]['message']);}})['catch'](function(_0x1e11ff){logger[_0x337e('0x16')](_0x337e('0x11'),_0x53d7d0,_0x1e11ff);_0x3f3674(_0x1e11ff);});});}exports[_0x337e('0x19')]=function(_0x32dfc6){var _0x3b356a=this;return new Promise(function(_0x242931,_0x45a5d7){return db[_0x337e('0x1a')][_0x337e('0x1b')](_0x32dfc6[_0x337e('0x1c')],{'raw':_0x32dfc6[_0x337e('0x1d')]?_0x32dfc6[_0x337e('0x1d')][_0x337e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32dfc6[_0x337e('0x1d')]?_0x32dfc6['options'][_0x337e('0x1f')]||null:null,'attributes':_0x32dfc6[_0x337e('0x1d')]?_0x32dfc6['options'][_0x337e('0x20')]||null:null,'limit':_0x32dfc6[_0x337e('0x1d')]?_0x32dfc6[_0x337e('0x1d')][_0x337e('0x21')]||null:null})[_0x337e('0x10')](function(_0x3c5e6d){logger[_0x337e('0x22')](_0x337e('0x19'),_0x32dfc6);logger[_0x337e('0x12')](_0x337e('0x19'),_0x32dfc6,JSON[_0x337e('0x15')](_0x3c5e6d));_0x242931(_0x3c5e6d);})[_0x337e('0x23')](function(_0x1ee3bf){logger[_0x337e('0x16')](_0x337e('0x19'),_0x1ee3bf[_0x337e('0x17')],_0x32dfc6);_0x45a5d7(_0x3b356a[_0x337e('0x16')](0x1f4,_0x1ee3bf[_0x337e('0x17')]));});});};exports[_0x337e('0x24')]=function(_0x46d5ed){return new Promise(function(_0x16d46d,_0x334ffa){return db[_0x337e('0x1a')][_0x337e('0x25')]({'where':_0x46d5ed[_0x337e('0x1d')]?_0x46d5ed[_0x337e('0x1d')][_0x337e('0x1f')]||null:null})[_0x337e('0x10')](function(_0x8c6952){if(_0x8c6952){return _0x8c6952[_0x337e('0x26')](_0x46d5ed[_0x337e('0x1c')][_0x337e('0x27')],_[_0x337e('0x28')](_0x46d5ed[_0x337e('0x1c')],[_0x337e('0x27'),'id'])||{});}})[_0x337e('0x29')](function(_0x329afd){logger['info']('AddTags',_0x46d5ed);logger[_0x337e('0x12')]('AddTags',_0x46d5ed,JSON[_0x337e('0x15')](_0x329afd));_0x16d46d(_0x329afd);})[_0x337e('0x23')](function(_0x60ee72){logger[_0x337e('0x16')](_0x337e('0x2a'),_0x60ee72[_0x337e('0x17')],_0x46d5ed);_0x334ffa(_this[_0x337e('0x16')](0x1f4,_0x60ee72['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 5d4ef14..cdec157 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 _0x3828=['save','remove','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events'];(function(_0x30ca20,_0x50f0ed){var _0x3b7563=function(_0x40a813){while(--_0x40a813){_0x30ca20['push'](_0x30ca20['shift']());}};_0x3b7563(++_0x50f0ed);}(_0x3828,0x1bf));var _0x8382=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x3828[_0x18ab2a];return _0x16dcee;};'use strict';var FaxInteractionEvents=require(_0x8382('0x0'));var events=[_0x8382('0x1'),_0x8382('0x2'),'update'];function createListener(_0x58fe74,_0x1141c6){return function(_0x355dc3){_0x1141c6[_0x8382('0x3')](_0x58fe74,_0x355dc3);};}function removeListener(_0x42f4ac,_0x4d6058){return function(){FaxInteractionEvents[_0x8382('0x4')](_0x42f4ac,_0x4d6058);};}exports[_0x8382('0x5')]=function(_0x36335a){for(var _0x48189e=0x0,_0x4f760d=events[_0x8382('0x6')];_0x48189e<_0x4f760d;_0x48189e++){var _0x273552=events[_0x48189e];var _0x1f38a2=createListener(_0x8382('0x7')+_0x273552,_0x36335a);FaxInteractionEvents['on'](_0x273552,_0x1f38a2);}}; \ No newline at end of file +var _0x9684=['length','faxInteraction:','save','remove','update','emit','removeListener'];(function(_0x5f0501,_0x19196e){var _0x3c2c45=function(_0x107fe6){while(--_0x107fe6){_0x5f0501['push'](_0x5f0501['shift']());}};_0x3c2c45(++_0x19196e);}(_0x9684,0xf0));var _0x4968=function(_0xd4926e,_0x5367a0){_0xd4926e=_0xd4926e-0x0;var _0x10be65=_0x9684[_0xd4926e];return _0x10be65;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x4968('0x0'),_0x4968('0x1'),_0x4968('0x2')];function createListener(_0x28cdf5,_0xd88779){return function(_0x40bb75){_0xd88779[_0x4968('0x3')](_0x28cdf5,_0x40bb75);};}function removeListener(_0x30df02,_0x41752a){return function(){FaxInteractionEvents[_0x4968('0x4')](_0x30df02,_0x41752a);};}exports['register']=function(_0x483c72){for(var _0x248b7e=0x0,_0x24660e=events[_0x4968('0x5')];_0x248b7e<_0x24660e;_0x248b7e++){var _0x3f85de=events[_0x248b7e];var _0x38d888=createListener(_0x4968('0x6')+_0x3f85de,_0x483c72);FaxInteractionEvents['on'](_0x3f85de,_0x38d888);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 2c83138..1cbe110 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 _0xebbd=['isAuthenticated','index','/describe','describe','/:id','show','getMessages','/:id/download','download','post','addMessage','/:id/tags','fax','faxinteraction:addtags','put','tracked','faxinteraction:update','update','delete','faxinteraction:destroy','removeTags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xebbd,0x196));var _0xdebb=function(_0x3ee91e,_0x466a5a){_0x3ee91e=_0x3ee91e-0x0;var _0x239405=_0xebbd[_0x3ee91e];return _0x239405;};'use strict';var multer=require('multer');var util=require(_0xdebb('0x0'));var path=require(_0xdebb('0x1'));var timeout=require(_0xdebb('0x2'));var express=require(_0xdebb('0x3'));var router=express[_0xdebb('0x4')]();var auth=require(_0xdebb('0x5'));var interaction=require(_0xdebb('0x6'));var config=require(_0xdebb('0x7'));var controller=require(_0xdebb('0x8'));router[_0xdebb('0x9')]('/',auth[_0xdebb('0xa')](),controller[_0xdebb('0xb')]);router[_0xdebb('0x9')](_0xdebb('0xc'),auth[_0xdebb('0xa')](),controller[_0xdebb('0xd')]);router[_0xdebb('0x9')](_0xdebb('0xe'),auth[_0xdebb('0xa')](),controller[_0xdebb('0xf')]);router[_0xdebb('0x9')]('/:id/messages',auth[_0xdebb('0xa')](),controller[_0xdebb('0x10')]);router['get'](_0xdebb('0x11'),auth[_0xdebb('0xa')](),controller[_0xdebb('0x12')]);router['post']('/',auth[_0xdebb('0xa')](),controller['create']);router[_0xdebb('0x13')]('/:id/messages',auth[_0xdebb('0xa')](),controller[_0xdebb('0x14')]);router['post'](_0xdebb('0x15'),auth[_0xdebb('0xa')](),interaction['tracked'](_0xdebb('0x16'),_0xdebb('0x17')),controller['addTags']);router[_0xdebb('0x18')](_0xdebb('0xe'),auth['isAuthenticated'](),interaction[_0xdebb('0x19')]('fax',_0xdebb('0x1a')),controller[_0xdebb('0x1b')]);router[_0xdebb('0x1c')]('/:id',auth['isAuthenticated'](),interaction[_0xdebb('0x19')](_0xdebb('0x16'),_0xdebb('0x1d')),controller['destroy']);router[_0xdebb('0x1c')](_0xdebb('0x15'),auth[_0xdebb('0xa')](),controller[_0xdebb('0x1e')]);module[_0xdebb('0x1f')]=router; \ No newline at end of file +var _0xbfa1=['removeTags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','update','delete','faxinteraction:destroy'];(function(_0x19997d,_0x2c92a4){var _0x49be7f=function(_0x2e5d31){while(--_0x2e5d31){_0x19997d['push'](_0x19997d['shift']());}};_0x49be7f(++_0x2c92a4);}(_0xbfa1,0xfa));var _0x1bfa=function(_0x101f40,_0x3b2127){_0x101f40=_0x101f40-0x0;var _0x5a41e8=_0xbfa1[_0x101f40];return _0x5a41e8;};'use strict';var multer=require('multer');var util=require(_0x1bfa('0x0'));var path=require(_0x1bfa('0x1'));var timeout=require(_0x1bfa('0x2'));var express=require(_0x1bfa('0x3'));var router=express[_0x1bfa('0x4')]();var auth=require(_0x1bfa('0x5'));var interaction=require(_0x1bfa('0x6'));var config=require('../../config/environment');var controller=require('./faxInteraction.controller');router[_0x1bfa('0x7')]('/',auth[_0x1bfa('0x8')](),controller[_0x1bfa('0x9')]);router['get']('/describe',auth[_0x1bfa('0x8')](),controller[_0x1bfa('0xa')]);router[_0x1bfa('0x7')](_0x1bfa('0xb'),auth[_0x1bfa('0x8')](),controller[_0x1bfa('0xc')]);router[_0x1bfa('0x7')](_0x1bfa('0xd'),auth['isAuthenticated'](),controller[_0x1bfa('0xe')]);router[_0x1bfa('0x7')](_0x1bfa('0xf'),auth['isAuthenticated'](),controller[_0x1bfa('0x10')]);router[_0x1bfa('0x11')]('/',auth[_0x1bfa('0x8')](),controller[_0x1bfa('0x12')]);router[_0x1bfa('0x11')](_0x1bfa('0xd'),auth[_0x1bfa('0x8')](),controller[_0x1bfa('0x13')]);router[_0x1bfa('0x11')](_0x1bfa('0x14'),auth[_0x1bfa('0x8')](),interaction[_0x1bfa('0x15')](_0x1bfa('0x16'),_0x1bfa('0x17')),controller[_0x1bfa('0x18')]);router[_0x1bfa('0x19')](_0x1bfa('0xb'),auth[_0x1bfa('0x8')](),interaction[_0x1bfa('0x15')]('fax','faxinteraction:update'),controller[_0x1bfa('0x1a')]);router[_0x1bfa('0x1b')](_0x1bfa('0xb'),auth[_0x1bfa('0x8')](),interaction['tracked'](_0x1bfa('0x16'),_0x1bfa('0x1c')),controller['destroy']);router['delete']('/:id/tags',auth['isAuthenticated'](),controller[_0x1bfa('0x1d')]);module[_0x1bfa('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index e77a074..2bbb058 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 _0xb6fa=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x4f83ca,_0x46f67a){var _0x1fbac3=function(_0x19e401){while(--_0x19e401){_0x4f83ca['push'](_0x4f83ca['shift']());}};_0x1fbac3(++_0x46f67a);}(_0xb6fa,0xae));var _0xab6f=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xb6fa[_0x11ce46];return _0x368a1e;};'use strict';var Sequelize=require(_0xab6f('0x0'));module['exports']={'body':{'type':Sequelize[_0xab6f('0x1')](_0xab6f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xab6f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xab6f('0x4')]('in',_0xab6f('0x5')),'defaultValue':_0xab6f('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xab6f('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xab6f('0x6')]}}; \ No newline at end of file +var _0x536a=['out','DATE','TEXT','medium','BOOLEAN','ENUM'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x536a,0x158));var _0xa536=function(_0x45c451,_0xc6105c){_0x45c451=_0x45c451-0x0;var _0x40bbfd=_0x536a[_0x45c451];return _0x40bbfd;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xa536('0x0')](_0xa536('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xa536('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa536('0x3')]('in',_0xa536('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xa536('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 763158a..5c15273 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(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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 _0xa9e0=['format','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','interface','channel','event','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','EventManager','rejectmessage','create','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','join','server','files','attachments','Attachment','download','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','name','options','FaxMessage','includeAll','include','findAll','rows','show','intersection','find','body','params','describe','../../config/logger','fax-interactions','accept','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','FaxInteraction','isNil','read1stAt'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];config[_0x0a9e('0x14')]=_[_0x0a9e('0x15')](config[_0x0a9e('0x14')],{'host':_0x0a9e('0x16'),'port':0x18eb});var socket=require(_0x0a9e('0x17'))(new Redis(config['redis']));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson[_0x0a9e('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x22dccb,_0x5d0880,_0x1985b6){if(_0x1985b6){var _0x519dfd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x519dfd[_0x0a9e('0x1d')](_0x5d0880)){return _0x22dccb;}else{throw new db[(_0x0a9e('0x1e'))]['ValidationError'](_0x0a9e('0x1f'));}}else{return _0x22dccb;}}function respondWithRpcPromise(_0x5a0a06,_0x459eb1,_0x478723,_0x106033){return new BPromise(function(_0x205fd6,_0x31b1ca){var _0x2eb11f=_0x106033||client;return _0x2eb11f[_0x0a9e('0x20')](_0x5a0a06,_0x478723)[_0x0a9e('0x21')](function(_0x1314ae){logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x459eb1,_0x0a9e('0x24'));logger['debug'](_0x0a9e('0x25'),_0x459eb1,_0x0a9e('0x24'),JSON['stringify'](_0x1314ae));if(_0x1314ae[_0x0a9e('0x26')]){if(_0x1314ae['error']['code']===0x1f4){logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x31b1ca(_0x1314ae['error'][_0x0a9e('0x27')]);}logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x205fd6(_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x0a9e('0x24'));_0x205fd6(_0x1314ae[_0x0a9e('0x28')][_0x0a9e('0x27')]);}})[_0x0a9e('0x29')](function(_0x526cf3){logger[_0x0a9e('0x26')]('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x526cf3);_0x31b1ca(_0x526cf3);});});}function respondWithStatusCode(_0x45a1e7,_0x5bfb33){_0x5bfb33=_0x5bfb33||0xcc;return function(_0x1dc186){if(_0x1dc186){return _0x45a1e7[_0x0a9e('0x2a')](_0x5bfb33);}return _0x45a1e7[_0x0a9e('0x2b')](_0x5bfb33)[_0x0a9e('0x2c')]();};}function respondWithResult(_0x140511,_0x1538a4){_0x1538a4=_0x1538a4||0xc8;return function(_0x11c3b6){if(_0x11c3b6){return _0x140511[_0x0a9e('0x2b')](_0x1538a4)['json'](_0x11c3b6);}};}function respondWithFilteredResult(_0x3652a7,_0x468813){return function(_0x2b1f27){if(_0x2b1f27){var _0x2ec755=_0x2b1f27[_0x0a9e('0x2d')],_0x5c877d=_0x468813[_0x0a9e('0x2e')],_0x15b200=_0x468813[_0x0a9e('0x2e')]+_0x468813[_0x0a9e('0x2f')],_0x40e7a3;if(_0x15b200>=_0x2ec755){_0x15b200=_0x2ec755;_0x40e7a3=0xc8;}else{_0x40e7a3=0xce;}_0x3652a7[_0x0a9e('0x2b')](_0x40e7a3);return _0x3652a7[_0x0a9e('0x30')](_0x0a9e('0x31'),_0x5c877d+'-'+_0x15b200+'/'+_0x2ec755)['json'](_0x2b1f27);}return null;};}function patchUpdates(_0x426950){return function(_0x5d1e0e){try{jsonpatch[_0x0a9e('0x32')](_0x5d1e0e,_0x426950,!![]);}catch(_0x3ae878){return BPromise[_0x0a9e('0x33')](_0x3ae878);}return _0x5d1e0e[_0x0a9e('0x34')]();};}function saveUpdates(_0x25ce3a,_0x5180f1){return function(_0x66c1d2){if(_0x66c1d2){return _0x66c1d2[_0x0a9e('0x35')](_0x25ce3a)[_0x0a9e('0x21')](function(_0x2da5c0){return _0x2da5c0;});}return null;};}function removeEntity(_0x2b45ea,_0x409319){return function(_0x332d35){if(_0x332d35){return _0x332d35[_0x0a9e('0x36')]()['then'](function(){_0x2b45ea[_0x0a9e('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cc7a0,_0x14b13f){return function(_0x2b7e7f){if(!_0x2b7e7f){_0x2cc7a0[_0x0a9e('0x2a')](0x194);}return _0x2b7e7f;};}function handleError(_0x567193,_0x191e91){_0x191e91=_0x191e91||0x1f4;return function(_0xd1836d){logger[_0x0a9e('0x26')](_0xd1836d[_0x0a9e('0x37')]);if(_0xd1836d['name']){delete _0xd1836d['name'];}_0x567193[_0x0a9e('0x2b')](_0x191e91)['send'](_0xd1836d);};}exports[_0x0a9e('0x38')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x39')](db['FaxMessage'][_0x0a9e('0x3a')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x3b')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x3c')]=_[_0x0a9e('0x39')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x3d9717[_0x0a9e('0x3d')]);_0x4f41ae[_0x0a9e('0x3f')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x3d')]);_0x1ef87a[_0x0a9e('0x40')]=_['intersection'](_0x4f41ae[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x3d')]['fields']));_0x1ef87a[_0x0a9e('0x40')]=_0x1ef87a[_0x0a9e('0x40')][_0x0a9e('0x42')]?_0x1ef87a[_0x0a9e('0x40')]:_0x4f41ae[_0x0a9e('0x3c')];if(!_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x1ef87a[_0x0a9e('0x2f')]=qs[_0x0a9e('0x2f')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x2f')]);_0x1ef87a[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x3d9717[_0x0a9e('0x3d')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x45')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x45')]);_0x1ef87a[_0x0a9e('0x46')]=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x47')](_0x3d9717[_0x0a9e('0x3d')],_0x4f41ae[_0x0a9e('0x3f')]));if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]){_0x1ef87a[_0x0a9e('0x46')]=_[_0x0a9e('0x49')](_0x1ef87a['where'],{'$or':_[_0x0a9e('0x39')](_0x3bfce8,function(_0x138b8b){if(_0x138b8b[_0x0a9e('0x4a')]!==_0x0a9e('0x4b')){var _0x2e8caf={};_0x2e8caf[_0x138b8b[_0x0a9e('0x4c')]]={'$like':'%'+_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]+'%'};return _0x2e8caf;}})});}_0x1ef87a=_['merge']({},_0x1ef87a,_0x3d9717[_0x0a9e('0x4d')]);var _0x48fd45={'where':_0x1ef87a[_0x0a9e('0x46')]};return db[_0x0a9e('0x4e')][_0x0a9e('0x2d')](_0x48fd45)['then'](function(_0x14bec2){_0x31916f[_0x0a9e('0x2d')]=_0x14bec2;if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x4f')]){_0x1ef87a[_0x0a9e('0x50')]=[{'all':!![]}];}return db[_0x0a9e('0x4e')][_0x0a9e('0x51')](_0x1ef87a);})['then'](function(_0x13f44d){_0x31916f[_0x0a9e('0x52')]=_0x13f44d;return _0x31916f;})[_0x0a9e('0x21')](respondWithFilteredResult(_0x381c37,_0x1ef87a))[_0x0a9e('0x29')](handleError(_0x381c37,null));};exports[_0x0a9e('0x53')]=function(_0x992c77,_0x6054ee){var _0x19383e={'raw':!![],'where':{'id':_0x992c77['params']['id']}},_0x34febd={};_0x34febd[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](db['FaxMessage']['rawAttributes']);_0x34febd['query']=_[_0x0a9e('0x3e')](_0x992c77[_0x0a9e('0x3d')]);_0x34febd[_0x0a9e('0x3f')]=_[_0x0a9e('0x54')](_0x34febd[_0x0a9e('0x3c')],_0x34febd[_0x0a9e('0x3d')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x54')](_0x34febd['model'],qs['fields'](_0x992c77['query'][_0x0a9e('0x41')]));_0x19383e[_0x0a9e('0x40')]=_0x19383e[_0x0a9e('0x40')]['length']?_0x19383e[_0x0a9e('0x40')]:_0x34febd[_0x0a9e('0x3c')];if(_0x992c77['query']['includeAll']){_0x19383e[_0x0a9e('0x50')]=[{'all':!![]}];}_0x19383e=_['merge']({},_0x19383e,_0x992c77[_0x0a9e('0x4d')]);return db['FaxMessage'][_0x0a9e('0x55')](_0x19383e)[_0x0a9e('0x21')](handleEntityNotFound(_0x6054ee,null))[_0x0a9e('0x21')](respondWithResult(_0x6054ee,null))['catch'](handleError(_0x6054ee,null));};exports[_0x0a9e('0x35')]=function(_0x1bf38a,_0x508b47){if(_0x1bf38a['body']['id']){delete _0x1bf38a[_0x0a9e('0x56')]['id'];}return db[_0x0a9e('0x4e')]['find']({'where':{'id':_0x1bf38a[_0x0a9e('0x57')]['id']}})['then'](handleEntityNotFound(_0x508b47,null))[_0x0a9e('0x21')](saveUpdates(_0x1bf38a['body'],null))[_0x0a9e('0x21')](respondWithResult(_0x508b47,null))['catch'](handleError(_0x508b47,null));};exports['destroy']=function(_0x5df0ad,_0x2da03c){return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5df0ad[_0x0a9e('0x57')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x2da03c,null))[_0x0a9e('0x21')](removeEntity(_0x2da03c,null))[_0x0a9e('0x29')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x58')]=function(_0xd10662,_0x28d814){return db['FaxMessage'][_0x0a9e('0x58')]()[_0x0a9e('0x21')](respondWithResult(_0x28d814,null))[_0x0a9e('0x29')](handleError(_0x28d814,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x5b')]=function(_0x5d86e9,_0x956fbe,_0x26bc80){var _0x5239ef={'channel':_0x0a9e('0x5c')};if(_0x5d86e9['body']['id']){delete _0x5d86e9[_0x0a9e('0x56')]['id'];}_0x5d86e9['body']['read']=!![];_0x5d86e9['body'][_0x0a9e('0x5d')]=moment()['format'](_0x0a9e('0x5e'));_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]=_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]||_0x5d86e9[_0x0a9e('0x60')]['id'];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5d86e9['params']['id'],'UserId':null},'include':[{'model':db[_0x0a9e('0x61')],'as':_0x0a9e('0x62')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))['then'](saveUpdates(_0x5d86e9[_0x0a9e('0x56')],null))[_0x0a9e('0x21')](function(_0x119677){if(_0x119677){_0x5239ef[_0x0a9e('0x27')]=_0x119677['get']({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x119677['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))[_0x0a9e('0x21')](function(_0x88dcbf){if(_0x88dcbf){return _0x88dcbf[_0x0a9e('0x35')]({'UserId':_0x5d86e9[_0x0a9e('0x56')]['UserId'],'read1stAt':_[_0x0a9e('0x64')](_0x88dcbf[_0x0a9e('0x65')])?moment()[_0x0a9e('0x66')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0a9e('0x21')](function(_0x4f1e60){if(_0x4f1e60){_0x5239ef['interaction']=_0x4f1e60[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x68'),_0x5d86e9[_0x0a9e('0x60')]['id'],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x69')],_0x5239ef[_0x0a9e('0x6a')]['id'],_0x5d86e9[_0x0a9e('0x56')]?JSON[_0x0a9e('0x6b')](_0x5d86e9[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x6d'),_0x0a9e('0x6e'),_0x5239ef);}return null;})[_0x0a9e('0x21')](function(_0x2a28c0){if(_0x2a28c0){if(_0x5d86e9[_0x0a9e('0x56')]['manual']){_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util[_0x0a9e('0x66')]('SIP/%s',_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x5239ef['message'][_0x0a9e('0x70')]=_0x5239ef[_0x0a9e('0x70')];_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x71')]=_0x0a9e('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x5239ef[_0x0a9e('0x27')]},client9002)[_0x0a9e('0x21')](function(){return _0x5239ef;});}return _0x5239ef;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x956fbe,null))[_0x0a9e('0x29')](handleError(_0x956fbe,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x33')]=function(_0x1a0677,_0x5512d1,_0x235f8f){var _0xcbc8b2={'agent':{},'channel':_0x0a9e('0x5c')};if(_0x1a0677['body']['id']){delete _0x1a0677[_0x0a9e('0x56')]['id'];}_0x1a0677['body'][_0x0a9e('0x5f')]=_0x1a0677[_0x0a9e('0x56')]['UserId']||_0x1a0677[_0x0a9e('0x60')]['id'];_0xcbc8b2[_0x0a9e('0x72')]['id']=_0x1a0677[_0x0a9e('0x56')][_0x0a9e('0x5f')];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x1a0677[_0x0a9e('0x57')]['id'],'UserId':null}})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x5b7fc3){if(_0x5b7fc3){_0xcbc8b2[_0x0a9e('0x27')]=_0x5b7fc3[_0x0a9e('0x67')]({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x5b7fc3['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x30a4c7){if(_0x30a4c7){_0xcbc8b2[_0x0a9e('0x6a')]=_0x30a4c7[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x73'),_0x1a0677[_0x0a9e('0x60')]['id'],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x69')],_0xcbc8b2[_0x0a9e('0x6a')]['id'],_0x1a0677[_0x0a9e('0x56')]?JSON['stringify'](_0x1a0677[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x74'),'rejectMessage',_0xcbc8b2);}return null;})[_0x0a9e('0x21')](function(_0x33dda0){if(_0x33dda0){_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util['format']('SIP/%s',_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x33dda0['message'][_0x0a9e('0x70')]=_0xcbc8b2['channel'];_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x71')]='reject';respondWithRpcPromise(_0x0a9e('0x75'),_0x0a9e('0x75'),{'event':_0x0a9e('0x76'),'message':_0x33dda0[_0x0a9e('0x27')]},client9002);return _0xcbc8b2;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x5512d1,null))[_0x0a9e('0x29')](handleError(_0x5512d1,null));};exports[_0x0a9e('0x77')]=function(_0x482ca2,_0x2973d3){var _0x3ca9b9;return db[_0x0a9e('0x4e')][_0x0a9e('0x77')](_0x482ca2['body'],{})[_0x0a9e('0x21')](function(_0xf0db1){_0x3ca9b9=_0xf0db1;return db['CmContact'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9['ContactId']}});})[_0x0a9e('0x21')](function(_0x2bb25a){if(_[_0x0a9e('0x64')](_0x2bb25a)){return;}else{_0x3ca9b9[_0x0a9e('0x5c')]=_0x2bb25a['fax'];return db['Attachment'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9[_0x0a9e('0x79')]}});}})[_0x0a9e('0x21')](function(_0x5ac73d){return respondWithRpcPromise(_0x0a9e('0x7a'),_0x0a9e('0x7a'),{'FaxAccountId':_['isNil'](_0x482ca2['body'])?undefined:_0x482ca2[_0x0a9e('0x56')]['FaxAccountId'],'path':_['isNil'](_0x5ac73d)?undefined:util['format'](_0x0a9e('0x7b'),_0x5ac73d[_0x0a9e('0x7c')]),'fax':_[_0x0a9e('0x64')](_0x3ca9b9[_0x0a9e('0x5c')])?undefined:_0x3ca9b9[_0x0a9e('0x5c')],'AttachmentId':_0x3ca9b9[_0x0a9e('0x79')]},client9002);})['then'](respondWithResult(_0x2973d3,0xc9))[_0x0a9e('0x29')](handleError(_0x2973d3,null));};exports['download']=function(_0x2871c1,_0x2aabab){var _0x18ad56=path[_0x0a9e('0x7d')](config['root'],_0x0a9e('0x7e'),_0x0a9e('0x7f'),_0x0a9e('0x80'));return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x2871c1[_0x0a9e('0x57')]['id']},'include':[{'model':db[_0x0a9e('0x81')],'as':_0x0a9e('0x81')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x2aabab,null))[_0x0a9e('0x21')](function(_0x32b9bd){if(_0x32b9bd){return _0x2aabab[_0x0a9e('0x82')](path['join'](_0x18ad56,_0x32b9bd[_0x0a9e('0x81')][_0x0a9e('0x7c')]));}})['catch'](handleError(_0x2aabab,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 9313bcb..e87a863 100644 --- a/server/api/faxMessage/faxMessage.events.js +++ b/server/api/faxMessage/faxMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0x55ca,0x126));var _0xa55c=function(_0x59522a,_0x14d1e5){_0x59522a=_0x59522a-0x0;var _0x30f09d=_0x55ca[_0x59522a];return _0x30f09d;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var FaxMessage=require(_0xa55c('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){FaxMessageEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);FaxMessageEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];FaxMessage[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe14b,0x93));var _0xbe14=function(_0x5269b6,_0x28ace6){_0x5269b6=_0x5269b6-0x0;var _0x15e3c2=_0xe14b[_0x5269b6];return _0x15e3c2;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var FaxMessage=require(_0xbe14('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){FaxMessageEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);FaxMessageEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];FaxMessage[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 20a444f..092ceae 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 _0xf278=['rimraf','../../config/environment','exports','define','fti_fax_messages','body','get','direction','toLowerCase','out','isNil','UserId','FaxInteraction','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x3c623f,_0x55efeb){var _0xcd5f57=function(_0x47b121){while(--_0x47b121){_0x3c623f['push'](_0x3c623f['shift']());}};_0xcd5f57(++_0x55efeb);}(_0xf278,0xbd));var _0x8f27=function(_0x282712,_0x489bbe){_0x282712=_0x282712-0x0;var _0xc1c850=_0xf278[_0x282712];return _0xc1c850;};'use strict';var _=require(_0x8f27('0x0'));var util=require(_0x8f27('0x1'));var logger=require('../../config/logger')(_0x8f27('0x2'));var moment=require(_0x8f27('0x3'));var BPromise=require(_0x8f27('0x4'));var rp=require(_0x8f27('0x5'));var fs=require('fs');var path=require(_0x8f27('0x6'));var rimraf=require(_0x8f27('0x7'));var config=require(_0x8f27('0x8'));var attributes=require('./faxMessage.attributes');module[_0x8f27('0x9')]=function(_0x16972e,_0x581339){return _0x16972e[_0x8f27('0xa')]('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x8f27('0xb'),'fields':[_0x8f27('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x32672b,_0x41514e,_0x49beac){var _0x4bf4e8=_0x16972e['models'];var _0x4f2b3b=_0x32672b[_0x8f27('0xd')]({'plain':!![]});if(_0x4f2b3b[_0x8f27('0xe')][_0x8f27('0xf')]()==='in'||_0x4f2b3b[_0x8f27('0xe')][_0x8f27('0xf')]()===_0x8f27('0x10')&&!_0x4f2b3b['secret']&&!_[_0x8f27('0x11')](_0x4f2b3b[_0x8f27('0x12')])){_0x4bf4e8[_0x8f27('0x13')]['findOne']({'where':{'id':_0x4f2b3b[_0x8f27('0x14')]}})[_0x8f27('0x15')](function(_0x7fd6b8){if(_0x7fd6b8){_0x7fd6b8[_0x8f27('0x16')]({'lastMsgAt':_0x4f2b3b[_0x8f27('0x17')],'lastMsgDirection':_0x4f2b3b[_0x8f27('0xe')][_0x8f27('0xf')]()});}})[_0x8f27('0x18')](function(_0x195517){console[_0x8f27('0x19')](_0x195517);});}_0x49beac();}},'charset':_0x8f27('0x1a'),'collate':_0x8f27('0x1b')});}; \ No newline at end of file +var _0xe6c7=['models','toLowerCase','direction','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','exports','define','FaxMessage','fax_messages','body'];(function(_0x3d31d0,_0x5f31b7){var _0x54a715=function(_0x344fea){while(--_0x344fea){_0x3d31d0['push'](_0x3d31d0['shift']());}};_0x54a715(++_0x5f31b7);}(_0xe6c7,0x1ec));var _0x7e6c=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0xe6c7[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require(_0x7e6c('0x0'));var util=require('util');var logger=require(_0x7e6c('0x1'))(_0x7e6c('0x2'));var moment=require(_0x7e6c('0x3'));var BPromise=require(_0x7e6c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7e6c('0x5'));var rimraf=require(_0x7e6c('0x6'));var config=require('../../config/environment');var attributes=require('./faxMessage.attributes');module[_0x7e6c('0x7')]=function(_0x1619dc,_0x5ed9cf){return _0x1619dc[_0x7e6c('0x8')](_0x7e6c('0x9'),attributes,{'tableName':_0x7e6c('0xa'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x7e6c('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3412be,_0x186ea8,_0x278740){var _0x382153=_0x1619dc[_0x7e6c('0xc')];var _0xfbeb1f=_0x3412be['get']({'plain':!![]});if(_0xfbeb1f['direction'][_0x7e6c('0xd')]()==='in'||_0xfbeb1f[_0x7e6c('0xe')][_0x7e6c('0xd')]()===_0x7e6c('0xf')&&!_0xfbeb1f[_0x7e6c('0x10')]&&!_[_0x7e6c('0x11')](_0xfbeb1f[_0x7e6c('0x12')])){_0x382153[_0x7e6c('0x13')][_0x7e6c('0x14')]({'where':{'id':_0xfbeb1f[_0x7e6c('0x15')]}})[_0x7e6c('0x16')](function(_0x15991a){if(_0x15991a){_0x15991a[_0x7e6c('0x17')]({'lastMsgAt':_0xfbeb1f[_0x7e6c('0x18')],'lastMsgDirection':_0xfbeb1f[_0x7e6c('0xe')]['toLowerCase']()});}})[_0x7e6c('0x19')](function(_0x5f51b7){console['error'](_0x5f51b7);});}_0x278740();}},'charset':_0x7e6c('0x1a'),'collate':_0x7e6c('0x1b')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 139ab0e..22858b5 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 _0x6e1a=['redis','defaults','localhost','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','attributes','limit','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x51e1c7,_0x4f19bd){var _0x111e6e=function(_0x5c909b){while(--_0x5c909b){_0x51e1c7['push'](_0x51e1c7['shift']());}};_0x111e6e(++_0x4f19bd);}(_0x6e1a,0xde));var _0xa6e1=function(_0x24450f,_0x5961e9){_0x24450f=_0x24450f-0x0;var _0x13e4bd=_0x6e1a[_0x24450f];return _0x13e4bd;};'use strict';var _=require('lodash');var util=require(_0xa6e1('0x0'));var moment=require(_0xa6e1('0x1'));var BPromise=require(_0xa6e1('0x2'));var rs=require(_0xa6e1('0x3'));var fs=require('fs');var Redis=require(_0xa6e1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa6e1('0x5'));var logger=require(_0xa6e1('0x6'))(_0xa6e1('0x7'));var config=require(_0xa6e1('0x8'));var jayson=require(_0xa6e1('0x9'));var client=jayson[_0xa6e1('0xa')][_0xa6e1('0xb')]({'port':0x232a});config[_0xa6e1('0xc')]=_[_0xa6e1('0xd')](config[_0xa6e1('0xc')],{'host':_0xa6e1('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa6e1('0xc')]));require(_0xa6e1('0xf'))[_0xa6e1('0x10')](socket);function respondWithRpcPromise(_0x227f38,_0x18fefb,_0x99559a){return new BPromise(function(_0x5b7248,_0x3e1b00){return client[_0xa6e1('0x11')](_0x227f38,_0x99559a)[_0xa6e1('0x12')](function(_0xcb16c8){logger[_0xa6e1('0x13')](_0xa6e1('0x14'),_0x18fefb,_0xa6e1('0x15'));logger[_0xa6e1('0x16')](_0xa6e1('0x17'),_0x18fefb,_0xa6e1('0x15'),JSON[_0xa6e1('0x18')](_0xcb16c8));if(_0xcb16c8['error']){if(_0xcb16c8[_0xa6e1('0x19')][_0xa6e1('0x1a')]===0x1f4){logger['error'](_0xa6e1('0x14'),_0x18fefb,_0xcb16c8[_0xa6e1('0x19')]['message']);return _0x3e1b00(_0xcb16c8[_0xa6e1('0x19')][_0xa6e1('0x1b')]);}logger[_0xa6e1('0x19')](_0xa6e1('0x14'),_0x18fefb,_0xcb16c8[_0xa6e1('0x19')][_0xa6e1('0x1b')]);return _0x5b7248(_0xcb16c8['error'][_0xa6e1('0x1b')]);}else{logger[_0xa6e1('0x13')](_0xa6e1('0x14'),_0x18fefb,_0xa6e1('0x15'));_0x5b7248(_0xcb16c8[_0xa6e1('0x1c')][_0xa6e1('0x1b')]);}})['catch'](function(_0x3371b0){logger[_0xa6e1('0x19')](_0xa6e1('0x14'),_0x18fefb,_0x3371b0);_0x3e1b00(_0x3371b0);});});}exports[_0xa6e1('0x1d')]=function(_0x14a1b5){var _0x55916c=this;return new Promise(function(_0x2a4edb,_0x27e9a7){return db[_0xa6e1('0x1e')][_0xa6e1('0x1f')](_0x14a1b5[_0xa6e1('0x20')],{'raw':_0x14a1b5[_0xa6e1('0x21')]?_0x14a1b5[_0xa6e1('0x21')][_0xa6e1('0x22')]===undefined?!![]:![]:!![]})[_0xa6e1('0x12')](function(_0x323a9e){logger[_0xa6e1('0x13')](_0xa6e1('0x1d'),_0x14a1b5);logger[_0xa6e1('0x16')]('CreateFaxMessage',_0x14a1b5,JSON['stringify'](_0x323a9e));_0x2a4edb(_0x323a9e);})['catch'](function(_0x46b81f){logger[_0xa6e1('0x19')](_0xa6e1('0x1d'),_0x46b81f[_0xa6e1('0x1b')],_0x14a1b5);_0x27e9a7(_0x55916c[_0xa6e1('0x19')](0x1f4,_0x46b81f[_0xa6e1('0x1b')]));});});};exports[_0xa6e1('0x23')]=function(_0x104afd){var _0x13ef40=this;return new Promise(function(_0x1abfd7,_0x5e46ca){return db[_0xa6e1('0x1e')]['update'](_0x104afd['body'],{'raw':_0x104afd[_0xa6e1('0x21')]?_0x104afd[_0xa6e1('0x21')][_0xa6e1('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x104afd[_0xa6e1('0x21')]?_0x104afd[_0xa6e1('0x21')]['where']||null:null,'attributes':_0x104afd[_0xa6e1('0x21')]?_0x104afd[_0xa6e1('0x21')][_0xa6e1('0x24')]||null:null,'limit':_0x104afd[_0xa6e1('0x21')]?_0x104afd['options'][_0xa6e1('0x25')]||null:null})['then'](function(_0x3e25ad){logger[_0xa6e1('0x13')](_0xa6e1('0x23'),_0x104afd);logger[_0xa6e1('0x16')](_0xa6e1('0x23'),_0x104afd,JSON[_0xa6e1('0x18')](_0x3e25ad));_0x1abfd7(_0x3e25ad);})[_0xa6e1('0x26')](function(_0x2abda6){logger[_0xa6e1('0x19')](_0xa6e1('0x23'),_0x2abda6[_0xa6e1('0x1b')],_0x104afd);_0x5e46ca(_0x13ef40[_0xa6e1('0x19')](0x1f4,_0x2abda6['message']));});});}; \ No newline at end of file +var _0x908b=['options','raw','stringify','where','attributes','limit','UpdateFaxMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','body'];(function(_0x4c5545,_0x55e942){var _0x5c4548=function(_0x846c44){while(--_0x846c44){_0x4c5545['push'](_0x4c5545['shift']());}};_0x5c4548(++_0x55e942);}(_0x908b,0x137));var _0xb908=function(_0x27301c,_0x5d44e2){_0x27301c=_0x27301c-0x0;var _0x5440a8=_0x908b[_0x27301c];return _0x5440a8;};'use strict';var _=require('lodash');var util=require(_0xb908('0x0'));var moment=require(_0xb908('0x1'));var BPromise=require(_0xb908('0x2'));var rs=require(_0xb908('0x3'));var fs=require('fs');var Redis=require(_0xb908('0x4'));var db=require(_0xb908('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb908('0x6'))(_0xb908('0x7'));var config=require(_0xb908('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb908('0x9')][_0xb908('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb908('0xb')],{'host':_0xb908('0xc'),'port':0x18eb});var socket=require(_0xb908('0xd'))(new Redis(config[_0xb908('0xb')]));require('./faxMessage.socket')[_0xb908('0xe')](socket);function respondWithRpcPromise(_0x4eab9c,_0x1fac20,_0x341735){return new BPromise(function(_0x7fc9e7,_0x734162){return client[_0xb908('0xf')](_0x4eab9c,_0x341735)[_0xb908('0x10')](function(_0x588ef0){logger['info'](_0xb908('0x11'),_0x1fac20,_0xb908('0x12'));logger[_0xb908('0x13')](_0xb908('0x14'),_0x1fac20,_0xb908('0x12'),JSON['stringify'](_0x588ef0));if(_0x588ef0[_0xb908('0x15')]){if(_0x588ef0['error'][_0xb908('0x16')]===0x1f4){logger[_0xb908('0x15')](_0xb908('0x11'),_0x1fac20,_0x588ef0[_0xb908('0x15')][_0xb908('0x17')]);return _0x734162(_0x588ef0[_0xb908('0x15')]['message']);}logger[_0xb908('0x15')]('FaxMessage,\x20%s,\x20%s',_0x1fac20,_0x588ef0[_0xb908('0x15')][_0xb908('0x17')]);return _0x7fc9e7(_0x588ef0[_0xb908('0x15')][_0xb908('0x17')]);}else{logger[_0xb908('0x18')](_0xb908('0x11'),_0x1fac20,_0xb908('0x12'));_0x7fc9e7(_0x588ef0[_0xb908('0x19')]['message']);}})[_0xb908('0x1a')](function(_0x41d566){logger[_0xb908('0x15')](_0xb908('0x11'),_0x1fac20,_0x41d566);_0x734162(_0x41d566);});});}exports[_0xb908('0x1b')]=function(_0x12f5cf){var _0x5a29e8=this;return new Promise(function(_0x33d910,_0x34da6){return db[_0xb908('0x1c')][_0xb908('0x1d')](_0x12f5cf[_0xb908('0x1e')],{'raw':_0x12f5cf[_0xb908('0x1f')]?_0x12f5cf[_0xb908('0x1f')][_0xb908('0x20')]===undefined?!![]:![]:!![]})[_0xb908('0x10')](function(_0xb8227f){logger[_0xb908('0x18')]('CreateFaxMessage',_0x12f5cf);logger[_0xb908('0x13')](_0xb908('0x1b'),_0x12f5cf,JSON[_0xb908('0x21')](_0xb8227f));_0x33d910(_0xb8227f);})['catch'](function(_0x5799a7){logger[_0xb908('0x15')]('CreateFaxMessage',_0x5799a7[_0xb908('0x17')],_0x12f5cf);_0x34da6(_0x5a29e8[_0xb908('0x15')](0x1f4,_0x5799a7[_0xb908('0x17')]));});});};exports['UpdateFaxMessage']=function(_0x18ea26){var _0x55b8d6=this;return new Promise(function(_0x6c39fa,_0x511242){return db[_0xb908('0x1c')]['update'](_0x18ea26['body'],{'raw':_0x18ea26[_0xb908('0x1f')]?_0x18ea26[_0xb908('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18ea26[_0xb908('0x1f')]?_0x18ea26[_0xb908('0x1f')][_0xb908('0x22')]||null:null,'attributes':_0x18ea26[_0xb908('0x1f')]?_0x18ea26['options'][_0xb908('0x23')]||null:null,'limit':_0x18ea26['options']?_0x18ea26[_0xb908('0x1f')][_0xb908('0x24')]||null:null})[_0xb908('0x10')](function(_0x1e69d5){logger['info'](_0xb908('0x25'),_0x18ea26);logger[_0xb908('0x13')](_0xb908('0x25'),_0x18ea26,JSON['stringify'](_0x1e69d5));_0x6c39fa(_0x1e69d5);})[_0xb908('0x1a')](function(_0x315b2a){logger[_0xb908('0x15')](_0xb908('0x25'),_0x315b2a[_0xb908('0x17')],_0x18ea26);_0x511242(_0x55b8d6['error'](0x1f4,_0x315b2a[_0xb908('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index d82e8ac..167fd9e 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(_0x2dacca,_0x3b55a5){var _0x4e8745=function(_0x4c4515){while(--_0x4c4515){_0x2dacca['push'](_0x2dacca['shift']());}};_0x4e8745(++_0x3b55a5);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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 f6a56e6..1388f1e 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 _0x46cd=['../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','post','fax','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x524b26,_0x4241c1){var _0x50acf5=function(_0x22722b){while(--_0x22722b){_0x524b26['push'](_0x524b26['shift']());}};_0x50acf5(++_0x4241c1);}(_0x46cd,0x181));var _0xd46c=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x46cd[_0x4ff09b];return _0x3f5c2e;};'use strict';var multer=require('multer');var util=require(_0xd46c('0x0'));var path=require(_0xd46c('0x1'));var timeout=require(_0xd46c('0x2'));var express=require('express');var router=express[_0xd46c('0x3')]();var auth=require(_0xd46c('0x4'));var interaction=require(_0xd46c('0x5'));var config=require(_0xd46c('0x6'));var controller=require('./faxMessage.controller');router[_0xd46c('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xd46c('0x8'),auth[_0xd46c('0x9')](),controller[_0xd46c('0xa')]);router['get'](_0xd46c('0xb'),auth['isAuthenticated'](),controller[_0xd46c('0xc')]);router['get'](_0xd46c('0xd'),auth[_0xd46c('0x9')](),controller[_0xd46c('0xe')]);router[_0xd46c('0xf')]('/',auth[_0xd46c('0x9')](),interaction['tracked'](_0xd46c('0x10'),_0xd46c('0x11')),controller[_0xd46c('0x12')]);router[_0xd46c('0x13')](_0xd46c('0xb'),auth[_0xd46c('0x9')](),controller[_0xd46c('0x14')]);router[_0xd46c('0x13')](_0xd46c('0x15'),auth[_0xd46c('0x9')](),controller[_0xd46c('0x16')]);router[_0xd46c('0x13')](_0xd46c('0x17'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0xd46c('0xb'),auth['isAuthenticated'](),controller[_0xd46c('0x18')]);module[_0xd46c('0x19')]=router; \ No newline at end of file +var _0xcaef=['post','fax','put','update','/:id/accept','/:id/reject','reject','delete','destroy','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download'];(function(_0x2507ce,_0x46b49e){var _0x22481a=function(_0x13610d){while(--_0x13610d){_0x2507ce['push'](_0x2507ce['shift']());}};_0x22481a(++_0x46b49e);}(_0xcaef,0x141));var _0xfcae=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0xcaef[_0x556bb1];return _0x45455f;};'use strict';var multer=require('multer');var util=require(_0xfcae('0x0'));var path=require(_0xfcae('0x1'));var timeout=require(_0xfcae('0x2'));var express=require(_0xfcae('0x3'));var router=express['Router']();var auth=require(_0xfcae('0x4'));var interaction=require(_0xfcae('0x5'));var config=require(_0xfcae('0x6'));var controller=require(_0xfcae('0x7'));router[_0xfcae('0x8')]('/',auth[_0xfcae('0x9')](),controller['index']);router[_0xfcae('0x8')](_0xfcae('0xa'),auth['isAuthenticated'](),controller[_0xfcae('0xb')]);router['get'](_0xfcae('0xc'),auth['isAuthenticated'](),controller[_0xfcae('0xd')]);router[_0xfcae('0x8')](_0xfcae('0xe'),auth[_0xfcae('0x9')](),controller['download']);router[_0xfcae('0xf')]('/',auth[_0xfcae('0x9')](),interaction['tracked'](_0xfcae('0x10'),'faxmessage:create'),controller['create']);router[_0xfcae('0x11')](_0xfcae('0xc'),auth[_0xfcae('0x9')](),controller[_0xfcae('0x12')]);router[_0xfcae('0x11')](_0xfcae('0x13'),auth[_0xfcae('0x9')](),controller['accept']);router[_0xfcae('0x11')](_0xfcae('0x14'),auth[_0xfcae('0x9')](),controller[_0xfcae('0x15')]);router[_0xfcae('0x16')]('/:id',auth[_0xfcae('0x9')](),controller[_0xfcae('0x17')]);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 555eab5..a190ded 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 _0xc0f3=['name','INTEGER','beepall','roundrobin','exports','STRING'];(function(_0x303da2,_0x7e567a){var _0x149ea5=function(_0x5cce4c){while(--_0x5cce4c){_0x303da2['push'](_0x303da2['shift']());}};_0x149ea5(++_0x7e567a);}(_0xc0f3,0x1d8));var _0x3c0f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc0f3[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x3c0f('0x0')]={'name':{'type':Sequelize[_0x3c0f('0x1')],'unique':_0x3c0f('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x3c0f('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x3c0f('0x4'),_0x3c0f('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x3c0f('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2c11=['exports','STRING','name','INTEGER','ENUM','beepall'];(function(_0x5e9018,_0x5d3a28){var _0x2062e2=function(_0x4aa0d8){while(--_0x4aa0d8){_0x5e9018['push'](_0x5e9018['shift']());}};_0x2062e2(++_0x5d3a28);}(_0x2c11,0xd2));var _0x12c1=function(_0x47f5ae,_0x110721){_0x47f5ae=_0x47f5ae-0x0;var _0x13e341=_0x2c11[_0x47f5ae];return _0x13e341;};'use strict';var Sequelize=require('sequelize');module[_0x12c1('0x0')]={'name':{'type':Sequelize[_0x12c1('0x1')],'unique':_0x12c1('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x12c1('0x1')]},'timeout':{'type':Sequelize[_0x12c1('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x12c1('0x4')]('rrmemory',_0x12c1('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x12c1('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index a924b6a..256707e 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 _0x110f=['UserProfileResource','error','name','send','index','FaxQueue','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','count','include','findAll','show','params','length','includeAll','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','User','UserId','updatedAt','createdAt','rows','faxPause','getTeams','Team','addTeams','ids','Agents','voicePause','interface','sequelize','each','forEach','emit','removeTeams','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','toString','SELECT','every','TeamId','all','union','compact','value','isEmpty','userFaxQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','html-pdf','eml-format','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','destroy','then'];(function(_0x5c6f53,_0x5f08f6){var _0x4b9fff=function(_0x34595f){while(--_0x34595f){_0x5c6f53['push'](_0x5c6f53['shift']());}};_0x4b9fff(++_0x5f08f6);}(_0x110f,0x1e6));var _0xf110=function(_0x1a3f9d,_0x2fe212){_0x1a3f9d=_0x1a3f9d-0x0;var _0x4465a3=_0x110f[_0x1a3f9d];return _0x4465a3;};'use strict';var pdf=require(_0xf110('0x0'));var emlformat=require(_0xf110('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf110('0x2'));var moment=require('moment');var BPromise=require(_0xf110('0x3'));var Mustache=require(_0xf110('0x4'));var util=require(_0xf110('0x5'));var path=require('path');var sox=require(_0xf110('0x6'));var csv=require(_0xf110('0x7'));var ejs=require(_0xf110('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf110('0x9'));var crypto=require(_0xf110('0xa'));var jsforce=require(_0xf110('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf110('0x7'));var querystring=require(_0xf110('0xc'));var Papa=require(_0xf110('0xd'));var Redis=require('ioredis');var authService=require(_0xf110('0xe'));var qs=require(_0xf110('0xf'));var as=require(_0xf110('0x10'));var hardwareService=require(_0xf110('0x11'));var logger=require('../../config/logger')(_0xf110('0x12'));var utils=require(_0xf110('0x13'));var config=require('../../config/environment');var db=require(_0xf110('0x14'))['db'];config[_0xf110('0x15')]=_[_0xf110('0x16')](config[_0xf110('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xf110('0x17'))(new Redis(config[_0xf110('0x15')]));require(_0xf110('0x18'))['register'](socket);function respondWithStatusCode(_0xb21d63,_0x206703){_0x206703=_0x206703||0xcc;return function(_0x5c33b8){if(_0x5c33b8){return _0xb21d63[_0xf110('0x19')](_0x206703);}return _0xb21d63[_0xf110('0x1a')](_0x206703)[_0xf110('0x1b')]();};}function respondWithResult(_0x325496,_0x32df98){_0x32df98=_0x32df98||0xc8;return function(_0x47cabf){if(_0x47cabf){return _0x325496[_0xf110('0x1a')](_0x32df98)[_0xf110('0x1c')](_0x47cabf);}};}function respondWithFilteredResult(_0x3a0c81,_0x4fb0ea){return function(_0x31dd1c){if(_0x31dd1c){var _0x2d0bb9=_0x31dd1c['count'],_0x3ab2cc=_0x4fb0ea[_0xf110('0x1d')],_0x4ce8c3=_0x4fb0ea[_0xf110('0x1d')]+_0x4fb0ea[_0xf110('0x1e')],_0x3eacf9;if(_0x4ce8c3>=_0x2d0bb9){_0x4ce8c3=_0x2d0bb9;_0x3eacf9=0xc8;}else{_0x3eacf9=0xce;}_0x3a0c81[_0xf110('0x1a')](_0x3eacf9);return _0x3a0c81[_0xf110('0x1f')]('Content-Range',_0x3ab2cc+'-'+_0x4ce8c3+'/'+_0x2d0bb9)[_0xf110('0x1c')](_0x31dd1c);}return null;};}function patchUpdates(_0xed3418){return function(_0x52e6cf){try{jsonpatch[_0xf110('0x20')](_0x52e6cf,_0xed3418,!![]);}catch(_0x105c20){return BPromise[_0xf110('0x21')](_0x105c20);}return _0x52e6cf[_0xf110('0x22')]();};}function saveUpdates(_0x1634bf,_0x4e7aad){return function(_0x2d0f0d){if(_0x2d0f0d){return _0x2d0f0d[_0xf110('0x23')](_0x1634bf)['then'](function(_0x9980ec){return _0x9980ec;});}return null;};}function removeEntity(_0xc52064,_0x11eb1c){return function(_0x2f3ddd){if(_0x2f3ddd){return _0x2f3ddd[_0xf110('0x24')]()[_0xf110('0x25')](function(){var _0x36ac5e=_0x2f3ddd['get']({'plain':!![]});var _0xb4fde2='FaxQueues';return db[_0xf110('0x26')]['destroy']({'where':{'type':_0xb4fde2,'resourceId':_0x36ac5e['id']}})['then'](function(){return _0x2f3ddd;});})['then'](function(){_0xc52064['status'](0xcc)[_0xf110('0x1b')]();});}};}function handleEntityNotFound(_0x1cb61c,_0x585616){return function(_0x26a4e2){if(!_0x26a4e2){_0x1cb61c[_0xf110('0x19')](0x194);}return _0x26a4e2;};}function handleError(_0x32a4d3,_0x4e0087){_0x4e0087=_0x4e0087||0x1f4;return function(_0x2f3488){logger[_0xf110('0x27')](_0x2f3488['stack']);if(_0x2f3488[_0xf110('0x28')]){delete _0x2f3488[_0xf110('0x28')];}_0x32a4d3[_0xf110('0x1a')](_0x4e0087)[_0xf110('0x29')](_0x2f3488);};}exports[_0xf110('0x2a')]=function(_0x32dff4,_0x1ca73f){var _0xe9f387={},_0x5143b0={},_0x509036={'count':0x0,'rows':[]};var _0x2bdeef=_['map'](db[_0xf110('0x2b')][_0xf110('0x2c')],function(_0x1f568d){return{'name':_0x1f568d[_0xf110('0x2d')],'type':_0x1f568d[_0xf110('0x2e')][_0xf110('0x2f')]};});_0x5143b0[_0xf110('0x30')]=_[_0xf110('0x31')](_0x2bdeef,_0xf110('0x28'));_0x5143b0['query']=_[_0xf110('0x32')](_0x32dff4[_0xf110('0x33')]);_0x5143b0[_0xf110('0x34')]=_[_0xf110('0x35')](_0x5143b0[_0xf110('0x30')],_0x5143b0[_0xf110('0x33')]);_0xe9f387[_0xf110('0x36')]=_[_0xf110('0x35')](_0x5143b0[_0xf110('0x30')],qs[_0xf110('0x37')](_0x32dff4[_0xf110('0x33')][_0xf110('0x37')]));_0xe9f387[_0xf110('0x36')]=_0xe9f387[_0xf110('0x36')]['length']?_0xe9f387[_0xf110('0x36')]:_0x5143b0[_0xf110('0x30')];if(!_0x32dff4[_0xf110('0x33')][_0xf110('0x38')](_0xf110('0x39'))){_0xe9f387[_0xf110('0x1e')]=qs[_0xf110('0x1e')](_0x32dff4[_0xf110('0x33')][_0xf110('0x1e')]);_0xe9f387[_0xf110('0x1d')]=qs['offset'](_0x32dff4[_0xf110('0x33')][_0xf110('0x1d')]);}_0xe9f387[_0xf110('0x3a')]=qs[_0xf110('0x3b')](_0x32dff4[_0xf110('0x33')][_0xf110('0x3b')]);_0xe9f387[_0xf110('0x3c')]=qs[_0xf110('0x34')](_[_0xf110('0x3d')](_0x32dff4[_0xf110('0x33')],_0x5143b0[_0xf110('0x34')]));if(_0x32dff4[_0xf110('0x33')]['filter']){_0xe9f387['where']=_[_0xf110('0x3e')](_0xe9f387[_0xf110('0x3c')],{'$or':_[_0xf110('0x31')](_0x2bdeef,function(_0x880dc5){if(_0x880dc5[_0xf110('0x2e')]!=='VIRTUAL'){var _0x323f52={};_0x323f52[_0x880dc5[_0xf110('0x28')]]={'$like':'%'+_0x32dff4[_0xf110('0x33')][_0xf110('0x3f')]+'%'};return _0x323f52;}})});}_0xe9f387=_['merge']({},_0xe9f387,_0x32dff4[_0xf110('0x40')]);var _0x336319={'where':_0xe9f387['where']};return db[_0xf110('0x2b')][_0xf110('0x41')](_0x336319)[_0xf110('0x25')](function(_0x21e98d){_0x509036['count']=_0x21e98d;if(_0x32dff4[_0xf110('0x33')]['includeAll']){_0xe9f387[_0xf110('0x42')]=[{'all':!![]}];}return db['FaxQueue'][_0xf110('0x43')](_0xe9f387);})[_0xf110('0x25')](function(_0x2f9fe5){_0x509036['rows']=_0x2f9fe5;return _0x509036;})[_0xf110('0x25')](respondWithFilteredResult(_0x1ca73f,_0xe9f387))['catch'](handleError(_0x1ca73f,null));};exports[_0xf110('0x44')]=function(_0x355432,_0xff83b5){var _0x19a203={'raw':!![],'where':{'id':_0x355432[_0xf110('0x45')]['id']}},_0x13978c={};_0x13978c[_0xf110('0x30')]=_[_0xf110('0x32')](db[_0xf110('0x2b')][_0xf110('0x2c')]);_0x13978c['query']=_['keys'](_0x355432[_0xf110('0x33')]);_0x13978c[_0xf110('0x34')]=_['intersection'](_0x13978c[_0xf110('0x30')],_0x13978c['query']);_0x19a203[_0xf110('0x36')]=_[_0xf110('0x35')](_0x13978c[_0xf110('0x30')],qs[_0xf110('0x37')](_0x355432[_0xf110('0x33')][_0xf110('0x37')]));_0x19a203[_0xf110('0x36')]=_0x19a203[_0xf110('0x36')][_0xf110('0x46')]?_0x19a203[_0xf110('0x36')]:_0x13978c['model'];if(_0x355432[_0xf110('0x33')][_0xf110('0x47')]){_0x19a203[_0xf110('0x42')]=[{'all':!![]}];}_0x19a203=_[_0xf110('0x3e')]({},_0x19a203,_0x355432['options']);return db[_0xf110('0x2b')]['find'](_0x19a203)['then'](handleEntityNotFound(_0xff83b5,null))[_0xf110('0x25')](respondWithResult(_0xff83b5,null))[_0xf110('0x48')](handleError(_0xff83b5,null));};exports[_0xf110('0x49')]=function(_0x50e457,_0x105b07){return db[_0xf110('0x2b')][_0xf110('0x49')](_0x50e457[_0xf110('0x4a')],{})[_0xf110('0x25')](function(_0x831013){var _0x1ac0fb=_0x50e457[_0xf110('0x4b')][_0xf110('0x4c')]({'plain':!![]});if(!_0x1ac0fb)throw new Error(_0xf110('0x4d'));if(_0x1ac0fb[_0xf110('0x4e')]==='user'){var _0x25b056=_0x831013[_0xf110('0x4c')]({'plain':!![]});var _0x548ea2=_0xf110('0x4f');return db['UserProfileSection']['find']({'where':{'name':_0x548ea2,'userProfileId':_0x1ac0fb['userProfileId']},'raw':!![]})[_0xf110('0x25')](function(_0x13007a){if(_0x13007a&&_0x13007a[_0xf110('0x50')]===0x0){return db['UserProfileResource'][_0xf110('0x49')]({'name':_0x25b056['name'],'resourceId':_0x25b056['id'],'type':_0x13007a[_0xf110('0x28')],'sectionId':_0x13007a['id']},{})['then'](function(){return _0x831013;});}else{return _0x831013;}})['catch'](function(_0x1d9f83){logger[_0xf110('0x27')](_0xf110('0x51'),_0x1d9f83);throw _0x1d9f83;});}return _0x831013;})[_0xf110('0x25')](respondWithResult(_0x105b07,0xc9))[_0xf110('0x48')](handleError(_0x105b07,null));};exports[_0xf110('0x23')]=function(_0x199c18,_0x1e8984){if(_0x199c18[_0xf110('0x4a')]['id']){delete _0x199c18['body']['id'];}return db[_0xf110('0x2b')][_0xf110('0x52')]({'where':{'id':_0x199c18[_0xf110('0x45')]['id']}})['then'](handleEntityNotFound(_0x1e8984,null))[_0xf110('0x25')](saveUpdates(_0x199c18[_0xf110('0x4a')],null))[_0xf110('0x25')](respondWithResult(_0x1e8984,null))[_0xf110('0x48')](handleError(_0x1e8984,null));};exports[_0xf110('0x24')]=function(_0x460806,_0x4d41e5){return db[_0xf110('0x2b')][_0xf110('0x52')]({'where':{'id':_0x460806['params']['id']}})[_0xf110('0x25')](handleEntityNotFound(_0x4d41e5,null))[_0xf110('0x25')](removeEntity(_0x4d41e5,null))[_0xf110('0x48')](handleError(_0x4d41e5,null));};exports[_0xf110('0x53')]=function(_0x4e5445,_0x1fc17b){return db[_0xf110('0x2b')][_0xf110('0x53')]()[_0xf110('0x25')](respondWithResult(_0x1fc17b,null))['catch'](handleError(_0x1fc17b,null));};exports[_0xf110('0x54')]=function(_0x17a0f6,_0xc4d32d,_0x6cb9c4){var _0xeffa42={'raw':!![],'where':{}},_0x2709a2={},_0x2765cf;return db['FaxQueue'][_0xf110('0x55')]({'where':{'id':_0x17a0f6[_0xf110('0x45')]['id']}})[_0xf110('0x25')](handleEntityNotFound(_0xc4d32d,null))[_0xf110('0x25')](function(_0x3098fd){if(_0x3098fd){_0x2765cf=_0x3098fd[_0xf110('0x4c')]({'plain':!![]});_0x2709a2[_0xf110('0x30')]=_[_0xf110('0x32')](db[_0xf110('0x56')][_0xf110('0x2c')]);_0x2709a2[_0xf110('0x33')]=_[_0xf110('0x32')](_0x17a0f6['query']);_0x2709a2[_0xf110('0x34')]=_['intersection'](_0x2709a2[_0xf110('0x30')],_0x2709a2['query']);_0xeffa42[_0xf110('0x36')]=_[_0xf110('0x35')](_0x2709a2['model'],qs[_0xf110('0x37')](_0x17a0f6[_0xf110('0x33')]['fields']));_0xeffa42[_0xf110('0x36')]=_0xeffa42['attributes'][_0xf110('0x46')]?_0xeffa42[_0xf110('0x36')]:_0x2709a2[_0xf110('0x30')];if(!_0x17a0f6[_0xf110('0x33')][_0xf110('0x38')]('nolimit')){_0xeffa42['limit']=qs['limit'](_0x17a0f6[_0xf110('0x33')][_0xf110('0x1e')]);_0xeffa42[_0xf110('0x1d')]=qs[_0xf110('0x1d')](_0x17a0f6[_0xf110('0x33')]['offset']);}_0xeffa42[_0xf110('0x3a')]=qs[_0xf110('0x3b')](_0x17a0f6[_0xf110('0x33')][_0xf110('0x3b')]);_0xeffa42[_0xf110('0x3c')]=qs[_0xf110('0x34')](_[_0xf110('0x3d')](_0x17a0f6[_0xf110('0x33')],_0x2709a2[_0xf110('0x34')]));_0xeffa42[_0xf110('0x3c')][_0xf110('0x57')]=_0x3098fd['id'];if(_0x17a0f6[_0xf110('0x33')][_0xf110('0x3f')]){_0xeffa42[_0xf110('0x3c')]=_[_0xf110('0x3e')](_0xeffa42[_0xf110('0x3c')],{'$or':_['map'](_0xeffa42[_0xf110('0x36')],function(_0x53d417){var _0x4aea36={};_0x4aea36[_0x53d417]={'$like':'%'+_0x17a0f6['query'][_0xf110('0x3f')]+'%'};return _0x4aea36;})});}_0xeffa42=_[_0xf110('0x3e')]({},_0xeffa42,_0x17a0f6[_0xf110('0x40')]);return db['UserFaxQueue'][_0xf110('0x43')](_0xeffa42);}})[_0xf110('0x25')](function(_0x378dea){if(_0x378dea){return db[_0xf110('0x58')]['findAndCountAll']({'where':{'id':_['map'](_0x378dea,_0xf110('0x59')),'role':'agent'},'attributes':['id',_0xf110('0x28'),'faxPause',_0xf110('0x5a'),_0xf110('0x5b')]});}})[_0xf110('0x25')](function(_0x27b4b7){if(_0x27b4b7){return{'count':_0x27b4b7['count'],'rows':_[_0xf110('0x31')](_0x27b4b7[_0xf110('0x5c')],function(_0xcc19cf){return{'membername':_0xcc19cf[_0xf110('0x28')],'UserId':_0xcc19cf['id'],'queue_name':_0x2765cf['name'],'FaxQueueId':_0x2765cf['id'],'interface':util['format']('%s/%s','SIP',_0xcc19cf[_0xf110('0x28')]),'penalty':0x0,'paused':_0xcc19cf[_0xf110('0x5d')],'createdAt':_0xcc19cf[_0xf110('0x5b')],'updatedAt':_0xcc19cf[_0xf110('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf110('0x25')](respondWithFilteredResult(_0xc4d32d,_0xeffa42))[_0xf110('0x48')](handleError(_0xc4d32d,null));};exports[_0xf110('0x5e')]=function(_0x2dec30,_0xe452cd,_0x24caf2){var _0x546c34={};var _0x2c57d1={};var _0x549817;var _0x5f3ded;return db['FaxQueue'][_0xf110('0x55')]({'where':{'id':_0x2dec30[_0xf110('0x45')]['id']}})[_0xf110('0x25')](handleEntityNotFound(_0xe452cd,null))[_0xf110('0x25')](function(_0x298384){if(_0x298384){_0x549817=_0x298384;_0x2c57d1[_0xf110('0x30')]=_[_0xf110('0x32')](db[_0xf110('0x5f')][_0xf110('0x2c')]);_0x2c57d1[_0xf110('0x33')]=_[_0xf110('0x32')](_0x2dec30['query']);_0x2c57d1[_0xf110('0x34')]=_['intersection'](_0x2c57d1['model'],_0x2c57d1[_0xf110('0x33')]);_0x546c34[_0xf110('0x36')]=_[_0xf110('0x35')](_0x2c57d1[_0xf110('0x30')],qs['fields'](_0x2dec30[_0xf110('0x33')][_0xf110('0x37')]));_0x546c34[_0xf110('0x36')]=_0x546c34[_0xf110('0x36')][_0xf110('0x46')]?_0x546c34[_0xf110('0x36')]:_0x2c57d1[_0xf110('0x30')];_0x546c34[_0xf110('0x3a')]=qs['sort'](_0x2dec30[_0xf110('0x33')][_0xf110('0x3b')]);_0x546c34[_0xf110('0x3c')]=qs[_0xf110('0x34')](_[_0xf110('0x3d')](_0x2dec30[_0xf110('0x33')],_0x2c57d1[_0xf110('0x34')]));if(_0x2dec30['query'][_0xf110('0x3f')]){_0x546c34['where']=_[_0xf110('0x3e')](_0x546c34[_0xf110('0x3c')],{'$or':_[_0xf110('0x31')](_0x546c34['attributes'],function(_0x3f60cc){var _0x3ac981={};_0x3ac981[_0x3f60cc]={'$like':'%'+_0x2dec30['query']['filter']+'%'};return _0x3ac981;})});}_0x546c34=_[_0xf110('0x3e')]({},_0x546c34,_0x2dec30[_0xf110('0x40')]);return _0x549817['getTeams'](_0x546c34);}})[_0xf110('0x25')](function(_0x431bce){if(_0x431bce){_0x5f3ded=_0x431bce[_0xf110('0x46')];if(!_0x2dec30[_0xf110('0x33')]['hasOwnProperty'](_0xf110('0x39'))){_0x546c34[_0xf110('0x1e')]=qs[_0xf110('0x1e')](_0x2dec30[_0xf110('0x33')]['limit']);_0x546c34[_0xf110('0x1d')]=qs['offset'](_0x2dec30[_0xf110('0x33')][_0xf110('0x1d')]);}return _0x549817[_0xf110('0x5e')](_0x546c34);}})['then'](function(_0x4e0d30){if(_0x4e0d30){return _0x4e0d30?{'count':_0x5f3ded,'rows':_0x4e0d30}:null;}})[_0xf110('0x25')](respondWithResult(_0xe452cd,null))[_0xf110('0x48')](handleError(_0xe452cd,null));};exports[_0xf110('0x60')]=function(_0x45470b,_0x404139,_0x5d0353){var _0x289634=_0x45470b['body'][_0xf110('0x61')];return db[_0xf110('0x5f')][_0xf110('0x43')]({'where':{'id':_0x289634},'attributes':['id'],'include':[{'model':db[_0xf110('0x58')],'as':_0xf110('0x62'),'attributes':['id','name','online',_0xf110('0x63'),_0xf110('0x64')],'raw':!![]}]})[_0xf110('0x25')](function(_0x11aa1d){if(_0x11aa1d){var _0x161289=_['flatMap'](_0x11aa1d,function(_0x50a809){var _0x40b3a3=_0x50a809[_0xf110('0x4c')]({'plain':!![]});return _0x40b3a3[_0xf110('0x62')];});return db['FaxQueue'][_0xf110('0x52')]({'where':{'id':_0x45470b[_0xf110('0x45')]['id']}})['then'](function(_0x5067b2){return db[_0xf110('0x65')]['transaction'](function(_0x1b9323){return _0x5067b2[_0xf110('0x60')](_0x289634,{'transaction':_0x1b9323})[_0xf110('0x25')](function(){return BPromise[_0xf110('0x66')](_0x161289,function(_0x42aa5a){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x42aa5a['id'],'FaxQueueId':_0x45470b['params']['id']},'transaction':_0x1b9323});});})['then'](function(){_0x161289[_0xf110('0x67')](function(_0x3188ff){socket[_0xf110('0x68')]('userFaxQueue:save',{'UserId':_0x3188ff['id'],'FaxQueueId':_0x5067b2['id']});});});});});}})['then'](respondWithStatusCode(_0x404139,null))[_0xf110('0x48')](handleError(_0x404139,null));};exports[_0xf110('0x69')]=function(_0xe3bc02,_0x2e5173,_0x1738c8){return db['Team'][_0xf110('0x43')]({'where':{'id':_0xe3bc02[_0xf110('0x33')][_0xf110('0x61')]},'attributes':['id'],'include':[{'model':db[_0xf110('0x58')],'as':_0xf110('0x62'),'attributes':['id'],'raw':!![]}]})[_0xf110('0x25')](handleEntityNotFound(_0x2e5173,null))['then'](function(_0xe84f45){var _0x57f295=_[_0xf110('0x31')](_0xe84f45,'id');var _0x10c2be=[];var _0x33f57f=[];var _0x14f335=squel['select']();_0x14f335[_0xf110('0x6a')](_0xf110('0x6b'))[_0xf110('0x6c')]('team_has_fax_queues','tq')[_0xf110('0x6d')](_0xf110('0x6e'),'ut',_0xf110('0x6f'))[_0xf110('0x3c')](_0xf110('0x70'),_0xe3bc02[_0xf110('0x45')]['id']);for(var _0x35516a=0x0;_0x35516a<_0xe84f45[_0xf110('0x46')];_0x35516a+=0x1){let _0x73ac6e=_0xe84f45[_0x35516a];for(var _0x4a45e7=0x0;_0x4a45e7<_0x73ac6e['Agents'][_0xf110('0x46')];_0x4a45e7+=0x1){let _0x347459=_0x73ac6e[_0xf110('0x62')][_0x4a45e7];var _0x431968=_0x14f335[_0xf110('0x71')]();_0x431968[_0xf110('0x3c')]('ut.UserId\x20=\x20?',_0x347459['id']);_0x33f57f[_0xf110('0x72')](db['sequelize'][_0xf110('0x33')](_0x431968[_0xf110('0x73')](),{'type':db[_0xf110('0x65')]['QueryTypes'][_0xf110('0x74')]})[_0xf110('0x25')](function(_0x3e70fc){if(_0x3e70fc[_0xf110('0x46')]===0x1){return _0x347459['id'];}else{var _0x1a0ef8=_[_0xf110('0x75')](_[_0xf110('0x31')](_0x3e70fc,_0xf110('0x76')),function(_0x3152bc){return _['includes'](_0x57f295,_0x3152bc);});if(_0x1a0ef8){return _0x347459['id'];}}}));}}return BPromise[_0xf110('0x77')](_0x33f57f)['then'](function(_0x35393a){_0x10c2be=_(_0x10c2be)[_0xf110('0x78')](_0x35393a)[_0xf110('0x79')]()[_0xf110('0x7a')]();return db['FaxQueue'][_0xf110('0x52')]({'where':{'id':_0xe3bc02[_0xf110('0x45')]['id']}})[_0xf110('0x25')](function(_0x2abc4f){return db[_0xf110('0x65')]['transaction'](function(_0x2b8a68){return _0x2abc4f['removeTeams'](_0xe3bc02['query'][_0xf110('0x61')],{'transaction':_0x2b8a68})[_0xf110('0x25')](function(){if(!_[_0xf110('0x7b')](_0x10c2be)){return _0x2abc4f['removeAgents'](_0x10c2be,{'transaction':_0x2b8a68});}})[_0xf110('0x25')](function(){_0x10c2be[_0xf110('0x67')](function(_0x1fb49c){socket['emit'](_0xf110('0x7c'),{'UserId':_0x1fb49c,'FaxQueueId':_0x2abc4f['id']});});});});});});})[_0xf110('0x25')](respondWithStatusCode(_0x2e5173,null))['catch'](handleError(_0x2e5173,null));};exports['addAgents']=function(_0x22754c,_0x26ea86,_0x195356){return db[_0xf110('0x2b')]['find']({'where':{'id':_0x22754c[_0xf110('0x45')]['id']}})[_0xf110('0x25')](handleEntityNotFound(_0x26ea86,null))[_0xf110('0x25')](function(_0x2e7cd1){if(_0x2e7cd1){return _0x2e7cd1[_0xf110('0x7d')](_0x22754c['body'][_0xf110('0x61')],_[_0xf110('0x7e')](_0x22754c[_0xf110('0x4a')],['ids','id'])||{})[_0xf110('0x7f')](function(_0x4b40c9){for(var _0x3f7ccc=0x0;_0x3f7ccc<_0x22754c[_0xf110('0x4a')]['ids'][_0xf110('0x46')];_0x3f7ccc+=0x1){socket[_0xf110('0x68')]('userFaxQueue:save',{'UserId':_0x22754c['body'][_0xf110('0x61')][_0x3f7ccc],'FaxQueueId':_0x22754c[_0xf110('0x45')]['id']});}return _0x4b40c9;});}})[_0xf110('0x25')](respondWithResult(_0x26ea86,null))['catch'](handleError(_0x26ea86,null));};exports[_0xf110('0x80')]=function(_0x59321d,_0x402bf3,_0x5a748a){return db[_0xf110('0x2b')]['find']({'where':{'id':_0x59321d['params']['id']}})['then'](handleEntityNotFound(_0x402bf3,null))[_0xf110('0x25')](function(_0x1608e6){if(_0x1608e6){return _0x1608e6[_0xf110('0x80')](_0x59321d['query'][_0xf110('0x61')])[_0xf110('0x25')](function(){if(_[_0xf110('0x81')](_0x59321d[_0xf110('0x33')][_0xf110('0x61')])){for(var _0x48e243=0x0;_0x48e243<_0x59321d['query'][_0xf110('0x61')]['length'];_0x48e243+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x59321d[_0xf110('0x33')][_0xf110('0x61')][_0x48e243]),'FaxQueueId':Number(_0x59321d[_0xf110('0x45')]['id'])});}}else{socket[_0xf110('0x68')]('userFaxQueue:remove',{'UserId':Number(_0x59321d[_0xf110('0x33')]['ids']),'FaxQueueId':Number(_0x59321d['params']['id'])});}});}})[_0xf110('0x25')](respondWithStatusCode(_0x402bf3,null))[_0xf110('0x48')](handleError(_0x402bf3,null));};exports['getAgents']=function(_0x51a0b4,_0x578576,_0x868714){var _0x326122={};var _0x5b0db2={};var _0x521bd1;var _0x4fce9f;return db[_0xf110('0x2b')][_0xf110('0x55')]({'where':{'id':_0x51a0b4[_0xf110('0x45')]['id']}})[_0xf110('0x25')](handleEntityNotFound(_0x578576,null))[_0xf110('0x25')](function(_0x4ea257){if(_0x4ea257){_0x521bd1=_0x4ea257;_0x5b0db2[_0xf110('0x30')]=_['keys'](db['User']['rawAttributes']);_0x5b0db2[_0xf110('0x33')]=_[_0xf110('0x32')](_0x51a0b4[_0xf110('0x33')]);_0x5b0db2[_0xf110('0x34')]=_['intersection'](_0x5b0db2[_0xf110('0x30')],_0x5b0db2[_0xf110('0x33')]);_0x326122['attributes']=_['intersection'](_0x5b0db2[_0xf110('0x30')],qs[_0xf110('0x37')](_0x51a0b4[_0xf110('0x33')][_0xf110('0x37')]));_0x326122[_0xf110('0x36')]=_0x326122[_0xf110('0x36')][_0xf110('0x46')]?_0x326122[_0xf110('0x36')]:_0x5b0db2[_0xf110('0x30')];_0x326122[_0xf110('0x3a')]=qs[_0xf110('0x3b')](_0x51a0b4[_0xf110('0x33')][_0xf110('0x3b')]);_0x326122['where']=qs[_0xf110('0x34')](_['pick'](_0x51a0b4[_0xf110('0x33')],_0x5b0db2[_0xf110('0x34')]));if(_0x51a0b4[_0xf110('0x33')][_0xf110('0x3f')]){_0x326122['where']=_[_0xf110('0x3e')](_0x326122[_0xf110('0x3c')],{'$or':_[_0xf110('0x31')](_0x326122[_0xf110('0x36')],function(_0x39db05){var _0x59c669={};_0x59c669[_0x39db05]={'$like':'%'+_0x51a0b4[_0xf110('0x33')]['filter']+'%'};return _0x59c669;})});}_0x326122=_['merge']({},_0x326122,_0x51a0b4[_0xf110('0x40')]);return _0x521bd1[_0xf110('0x82')](_0x326122);}})[_0xf110('0x25')](function(_0x865e95){if(_0x865e95){_0x4fce9f=_0x865e95[_0xf110('0x46')];if(!_0x51a0b4[_0xf110('0x33')][_0xf110('0x38')](_0xf110('0x39'))){_0x326122[_0xf110('0x1e')]=qs[_0xf110('0x1e')](_0x51a0b4[_0xf110('0x33')][_0xf110('0x1e')]);_0x326122[_0xf110('0x1d')]=qs[_0xf110('0x1d')](_0x51a0b4[_0xf110('0x33')][_0xf110('0x1d')]);}return _0x521bd1[_0xf110('0x82')](_0x326122);}})[_0xf110('0x25')](function(_0x57e72a){if(_0x57e72a){return _0x57e72a?{'count':_0x4fce9f,'rows':_0x57e72a}:null;}})['then'](respondWithResult(_0x578576,null))[_0xf110('0x48')](handleError(_0x578576,null));}; \ No newline at end of file +var _0x4959=['push','toString','SELECT','TeamId','includes','all','compact','value','emit','userFaxQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','end','status','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','error','name','send','index','map','FaxQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','filter','merge','type','options','includeAll','include','rows','catch','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMembers','findOne','UserFaxQueue','pick','FaxQueueId','findAll','User','UserId','faxPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userFaxQueue:save','removeTeams','ids','Agents','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x4959,0x9b));var _0x9495=function(_0x49a21a,_0x4e699a){_0x49a21a=_0x49a21a-0x0;var _0x21c24d=_0x4959[_0x49a21a];return _0x21c24d;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x9495('0x0'));var zipdir=require(_0x9495('0x1'));var jsonpatch=require(_0x9495('0x2'));var rp=require('request-promise');var moment=require(_0x9495('0x3'));var BPromise=require(_0x9495('0x4'));var Mustache=require(_0x9495('0x5'));var util=require(_0x9495('0x6'));var path=require('path');var sox=require(_0x9495('0x7'));var csv=require(_0x9495('0x8'));var ejs=require(_0x9495('0x9'));var fs=require('fs');var _=require(_0x9495('0xa'));var squel=require(_0x9495('0xb'));var crypto=require(_0x9495('0xc'));var jsforce=require(_0x9495('0xd'));var deskjs=require(_0x9495('0xe'));var toCsv=require(_0x9495('0x8'));var querystring=require(_0x9495('0xf'));var Papa=require(_0x9495('0x10'));var Redis=require('ioredis');var authService=require(_0x9495('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9495('0x12'));var utils=require(_0x9495('0x13'));var config=require(_0x9495('0x14'));var db=require(_0x9495('0x15'))['db'];config[_0x9495('0x16')]=_[_0x9495('0x17')](config[_0x9495('0x16')],{'host':_0x9495('0x18'),'port':0x18eb});var socket=require(_0x9495('0x19'))(new Redis(config[_0x9495('0x16')]));require(_0x9495('0x1a'))[_0x9495('0x1b')](socket);function respondWithStatusCode(_0x3ab519,_0xf7e975){_0xf7e975=_0xf7e975||0xcc;return function(_0x41312c){if(_0x41312c){return _0x3ab519[_0x9495('0x1c')](_0xf7e975);}return _0x3ab519['status'](_0xf7e975)[_0x9495('0x1d')]();};}function respondWithResult(_0x17d951,_0x3cf201){_0x3cf201=_0x3cf201||0xc8;return function(_0xcfc1e8){if(_0xcfc1e8){return _0x17d951[_0x9495('0x1e')](_0x3cf201)['json'](_0xcfc1e8);}};}function respondWithFilteredResult(_0x45d5fd,_0x16a07e){return function(_0x1efcc2){if(_0x1efcc2){var _0x7ca882=_0x1efcc2[_0x9495('0x1f')],_0x22feb8=_0x16a07e['offset'],_0x502562=_0x16a07e['offset']+_0x16a07e['limit'],_0x213bab;if(_0x502562>=_0x7ca882){_0x502562=_0x7ca882;_0x213bab=0xc8;}else{_0x213bab=0xce;}_0x45d5fd['status'](_0x213bab);return _0x45d5fd[_0x9495('0x20')](_0x9495('0x21'),_0x22feb8+'-'+_0x502562+'/'+_0x7ca882)[_0x9495('0x22')](_0x1efcc2);}return null;};}function patchUpdates(_0x1ca75b){return function(_0x38207a){try{jsonpatch[_0x9495('0x23')](_0x38207a,_0x1ca75b,!![]);}catch(_0x214747){return BPromise[_0x9495('0x24')](_0x214747);}return _0x38207a[_0x9495('0x25')]();};}function saveUpdates(_0x4053bb,_0x4acbaa){return function(_0x439715){if(_0x439715){return _0x439715[_0x9495('0x26')](_0x4053bb)[_0x9495('0x27')](function(_0x2fb493){return _0x2fb493;});}return null;};}function removeEntity(_0x40d9d1,_0x8fa430){return function(_0xf3bf59){if(_0xf3bf59){return _0xf3bf59[_0x9495('0x28')]()[_0x9495('0x27')](function(){var _0x5751c4=_0xf3bf59[_0x9495('0x29')]({'plain':!![]});var _0x195dc6=_0x9495('0x2a');return db[_0x9495('0x2b')][_0x9495('0x28')]({'where':{'type':_0x195dc6,'resourceId':_0x5751c4['id']}})[_0x9495('0x27')](function(){return _0xf3bf59;});})[_0x9495('0x27')](function(){_0x40d9d1[_0x9495('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xea3162,_0x13b1b6){return function(_0x2438db){if(!_0x2438db){_0xea3162[_0x9495('0x1c')](0x194);}return _0x2438db;};}function handleError(_0x5ee329,_0xbaa782){_0xbaa782=_0xbaa782||0x1f4;return function(_0x36aac0){logger[_0x9495('0x2c')](_0x36aac0['stack']);if(_0x36aac0[_0x9495('0x2d')]){delete _0x36aac0[_0x9495('0x2d')];}_0x5ee329[_0x9495('0x1e')](_0xbaa782)[_0x9495('0x2e')](_0x36aac0);};}exports[_0x9495('0x2f')]=function(_0x2fdb30,_0x4770ed){var _0x5e2d9e={},_0x3f6df9={},_0x1d641b={'count':0x0,'rows':[]};var _0x3d2fe8=_[_0x9495('0x30')](db[_0x9495('0x31')][_0x9495('0x32')],function(_0x2b2ef8){return{'name':_0x2b2ef8[_0x9495('0x33')],'type':_0x2b2ef8['type'][_0x9495('0x34')]};});_0x3f6df9['model']=_['map'](_0x3d2fe8,'name');_0x3f6df9[_0x9495('0x35')]=_[_0x9495('0x36')](_0x2fdb30[_0x9495('0x35')]);_0x3f6df9[_0x9495('0x37')]=_[_0x9495('0x38')](_0x3f6df9[_0x9495('0x39')],_0x3f6df9[_0x9495('0x35')]);_0x5e2d9e[_0x9495('0x3a')]=_[_0x9495('0x38')](_0x3f6df9[_0x9495('0x39')],qs[_0x9495('0x3b')](_0x2fdb30[_0x9495('0x35')][_0x9495('0x3b')]));_0x5e2d9e['attributes']=_0x5e2d9e[_0x9495('0x3a')][_0x9495('0x3c')]?_0x5e2d9e[_0x9495('0x3a')]:_0x3f6df9[_0x9495('0x39')];if(!_0x2fdb30[_0x9495('0x35')][_0x9495('0x3d')](_0x9495('0x3e'))){_0x5e2d9e['limit']=qs['limit'](_0x2fdb30[_0x9495('0x35')][_0x9495('0x3f')]);_0x5e2d9e['offset']=qs[_0x9495('0x40')](_0x2fdb30[_0x9495('0x35')]['offset']);}_0x5e2d9e[_0x9495('0x41')]=qs[_0x9495('0x42')](_0x2fdb30['query'][_0x9495('0x42')]);_0x5e2d9e[_0x9495('0x43')]=qs[_0x9495('0x37')](_['pick'](_0x2fdb30[_0x9495('0x35')],_0x3f6df9[_0x9495('0x37')]));if(_0x2fdb30[_0x9495('0x35')][_0x9495('0x44')]){_0x5e2d9e[_0x9495('0x43')]=_[_0x9495('0x45')](_0x5e2d9e['where'],{'$or':_[_0x9495('0x30')](_0x3d2fe8,function(_0x182495){if(_0x182495[_0x9495('0x46')]!=='VIRTUAL'){var _0x46a286={};_0x46a286[_0x182495[_0x9495('0x2d')]]={'$like':'%'+_0x2fdb30[_0x9495('0x35')][_0x9495('0x44')]+'%'};return _0x46a286;}})});}_0x5e2d9e=_[_0x9495('0x45')]({},_0x5e2d9e,_0x2fdb30[_0x9495('0x47')]);var _0x171e21={'where':_0x5e2d9e[_0x9495('0x43')]};return db['FaxQueue'][_0x9495('0x1f')](_0x171e21)[_0x9495('0x27')](function(_0x1a3376){_0x1d641b['count']=_0x1a3376;if(_0x2fdb30[_0x9495('0x35')][_0x9495('0x48')]){_0x5e2d9e[_0x9495('0x49')]=[{'all':!![]}];}return db[_0x9495('0x31')]['findAll'](_0x5e2d9e);})[_0x9495('0x27')](function(_0x3ea2c2){_0x1d641b[_0x9495('0x4a')]=_0x3ea2c2;return _0x1d641b;})[_0x9495('0x27')](respondWithFilteredResult(_0x4770ed,_0x5e2d9e))[_0x9495('0x4b')](handleError(_0x4770ed,null));};exports[_0x9495('0x4c')]=function(_0x2606d2,_0x3975b8){var _0x16ce80={'raw':!![],'where':{'id':_0x2606d2['params']['id']}},_0x3493ff={};_0x3493ff[_0x9495('0x39')]=_[_0x9495('0x36')](db[_0x9495('0x31')][_0x9495('0x32')]);_0x3493ff[_0x9495('0x35')]=_['keys'](_0x2606d2[_0x9495('0x35')]);_0x3493ff[_0x9495('0x37')]=_[_0x9495('0x38')](_0x3493ff[_0x9495('0x39')],_0x3493ff[_0x9495('0x35')]);_0x16ce80['attributes']=_[_0x9495('0x38')](_0x3493ff[_0x9495('0x39')],qs['fields'](_0x2606d2[_0x9495('0x35')][_0x9495('0x3b')]));_0x16ce80['attributes']=_0x16ce80['attributes']['length']?_0x16ce80['attributes']:_0x3493ff[_0x9495('0x39')];if(_0x2606d2[_0x9495('0x35')][_0x9495('0x48')]){_0x16ce80[_0x9495('0x49')]=[{'all':!![]}];}_0x16ce80=_[_0x9495('0x45')]({},_0x16ce80,_0x2606d2[_0x9495('0x47')]);return db[_0x9495('0x31')]['find'](_0x16ce80)[_0x9495('0x27')](handleEntityNotFound(_0x3975b8,null))[_0x9495('0x27')](respondWithResult(_0x3975b8,null))[_0x9495('0x4b')](handleError(_0x3975b8,null));};exports[_0x9495('0x4d')]=function(_0x5ec40d,_0x25325a){return db['FaxQueue'][_0x9495('0x4d')](_0x5ec40d[_0x9495('0x4e')],{})['then'](function(_0x4f4977){var _0x105de4=_0x5ec40d[_0x9495('0x4f')]['get']({'plain':!![]});if(!_0x105de4)throw new Error(_0x9495('0x50'));if(_0x105de4[_0x9495('0x51')]===_0x9495('0x4f')){var _0x28bba3=_0x4f4977['get']({'plain':!![]});var _0x54db1d='FaxQueues';return db[_0x9495('0x52')][_0x9495('0x53')]({'where':{'name':_0x54db1d,'userProfileId':_0x105de4[_0x9495('0x54')]},'raw':!![]})[_0x9495('0x27')](function(_0x1371b0){if(_0x1371b0&&_0x1371b0['autoAssociation']===0x0){return db['UserProfileResource'][_0x9495('0x4d')]({'name':_0x28bba3['name'],'resourceId':_0x28bba3['id'],'type':_0x1371b0[_0x9495('0x2d')],'sectionId':_0x1371b0['id']},{})[_0x9495('0x27')](function(){return _0x4f4977;});}else{return _0x4f4977;}})[_0x9495('0x4b')](function(_0x220446){logger['error'](_0x9495('0x55'),_0x220446);throw _0x220446;});}return _0x4f4977;})[_0x9495('0x27')](respondWithResult(_0x25325a,0xc9))[_0x9495('0x4b')](handleError(_0x25325a,null));};exports[_0x9495('0x26')]=function(_0x3d7436,_0x522372){if(_0x3d7436['body']['id']){delete _0x3d7436['body']['id'];}return db[_0x9495('0x31')][_0x9495('0x53')]({'where':{'id':_0x3d7436['params']['id']}})['then'](handleEntityNotFound(_0x522372,null))[_0x9495('0x27')](saveUpdates(_0x3d7436[_0x9495('0x4e')],null))['then'](respondWithResult(_0x522372,null))['catch'](handleError(_0x522372,null));};exports['destroy']=function(_0x426acf,_0x16ae15){return db[_0x9495('0x31')]['find']({'where':{'id':_0x426acf[_0x9495('0x56')]['id']}})[_0x9495('0x27')](handleEntityNotFound(_0x16ae15,null))[_0x9495('0x27')](removeEntity(_0x16ae15,null))['catch'](handleError(_0x16ae15,null));};exports['describe']=function(_0x5ca814,_0x29c7e4){return db[_0x9495('0x31')]['describe']()[_0x9495('0x27')](respondWithResult(_0x29c7e4,null))[_0x9495('0x4b')](handleError(_0x29c7e4,null));};exports[_0x9495('0x57')]=function(_0x4e9173,_0x26e74b,_0x2c0613){var _0x2b8fd0={'raw':!![],'where':{}},_0x271132={},_0x129a38;return db[_0x9495('0x31')][_0x9495('0x58')]({'where':{'id':_0x4e9173[_0x9495('0x56')]['id']}})[_0x9495('0x27')](handleEntityNotFound(_0x26e74b,null))[_0x9495('0x27')](function(_0x1f45ef){if(_0x1f45ef){_0x129a38=_0x1f45ef[_0x9495('0x29')]({'plain':!![]});_0x271132[_0x9495('0x39')]=_[_0x9495('0x36')](db[_0x9495('0x59')][_0x9495('0x32')]);_0x271132[_0x9495('0x35')]=_['keys'](_0x4e9173['query']);_0x271132[_0x9495('0x37')]=_[_0x9495('0x38')](_0x271132[_0x9495('0x39')],_0x271132[_0x9495('0x35')]);_0x2b8fd0[_0x9495('0x3a')]=_['intersection'](_0x271132[_0x9495('0x39')],qs[_0x9495('0x3b')](_0x4e9173['query'][_0x9495('0x3b')]));_0x2b8fd0[_0x9495('0x3a')]=_0x2b8fd0['attributes']['length']?_0x2b8fd0['attributes']:_0x271132['model'];if(!_0x4e9173[_0x9495('0x35')][_0x9495('0x3d')](_0x9495('0x3e'))){_0x2b8fd0[_0x9495('0x3f')]=qs[_0x9495('0x3f')](_0x4e9173['query'][_0x9495('0x3f')]);_0x2b8fd0[_0x9495('0x40')]=qs['offset'](_0x4e9173[_0x9495('0x35')][_0x9495('0x40')]);}_0x2b8fd0[_0x9495('0x41')]=qs[_0x9495('0x42')](_0x4e9173[_0x9495('0x35')][_0x9495('0x42')]);_0x2b8fd0[_0x9495('0x43')]=qs['filters'](_[_0x9495('0x5a')](_0x4e9173[_0x9495('0x35')],_0x271132['filters']));_0x2b8fd0[_0x9495('0x43')][_0x9495('0x5b')]=_0x1f45ef['id'];if(_0x4e9173[_0x9495('0x35')][_0x9495('0x44')]){_0x2b8fd0[_0x9495('0x43')]=_['merge'](_0x2b8fd0[_0x9495('0x43')],{'$or':_[_0x9495('0x30')](_0x2b8fd0[_0x9495('0x3a')],function(_0x35b21f){var _0x1d3157={};_0x1d3157[_0x35b21f]={'$like':'%'+_0x4e9173[_0x9495('0x35')][_0x9495('0x44')]+'%'};return _0x1d3157;})});}_0x2b8fd0=_[_0x9495('0x45')]({},_0x2b8fd0,_0x4e9173['options']);return db[_0x9495('0x59')][_0x9495('0x5c')](_0x2b8fd0);}})[_0x9495('0x27')](function(_0x52dc69){if(_0x52dc69){return db[_0x9495('0x5d')]['findAndCountAll']({'where':{'id':_[_0x9495('0x30')](_0x52dc69,_0x9495('0x5e')),'role':'agent'},'attributes':['id',_0x9495('0x2d'),_0x9495('0x5f'),_0x9495('0x60'),_0x9495('0x61')]});}})[_0x9495('0x27')](function(_0x33c805){if(_0x33c805){return{'count':_0x33c805[_0x9495('0x1f')],'rows':_[_0x9495('0x30')](_0x33c805[_0x9495('0x4a')],function(_0x1d1472){return{'membername':_0x1d1472[_0x9495('0x2d')],'UserId':_0x1d1472['id'],'queue_name':_0x129a38['name'],'FaxQueueId':_0x129a38['id'],'interface':util[_0x9495('0x62')]('%s/%s',_0x9495('0x63'),_0x1d1472[_0x9495('0x2d')]),'penalty':0x0,'paused':_0x1d1472[_0x9495('0x5f')],'createdAt':_0x1d1472[_0x9495('0x61')],'updatedAt':_0x1d1472['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x9495('0x27')](respondWithFilteredResult(_0x26e74b,_0x2b8fd0))[_0x9495('0x4b')](handleError(_0x26e74b,null));};exports[_0x9495('0x64')]=function(_0x7264e6,_0x21fa2b,_0x23e0a6){var _0xcf6579={};var _0x4cca5a={};var _0x9ac028;var _0xe92dfa;return db[_0x9495('0x31')][_0x9495('0x58')]({'where':{'id':_0x7264e6[_0x9495('0x56')]['id']}})[_0x9495('0x27')](handleEntityNotFound(_0x21fa2b,null))[_0x9495('0x27')](function(_0x352ebb){if(_0x352ebb){_0x9ac028=_0x352ebb;_0x4cca5a[_0x9495('0x39')]=_[_0x9495('0x36')](db[_0x9495('0x65')]['rawAttributes']);_0x4cca5a['query']=_[_0x9495('0x36')](_0x7264e6[_0x9495('0x35')]);_0x4cca5a[_0x9495('0x37')]=_[_0x9495('0x38')](_0x4cca5a[_0x9495('0x39')],_0x4cca5a[_0x9495('0x35')]);_0xcf6579[_0x9495('0x3a')]=_['intersection'](_0x4cca5a[_0x9495('0x39')],qs['fields'](_0x7264e6['query'][_0x9495('0x3b')]));_0xcf6579['attributes']=_0xcf6579[_0x9495('0x3a')]['length']?_0xcf6579[_0x9495('0x3a')]:_0x4cca5a[_0x9495('0x39')];_0xcf6579[_0x9495('0x41')]=qs[_0x9495('0x42')](_0x7264e6[_0x9495('0x35')][_0x9495('0x42')]);_0xcf6579[_0x9495('0x43')]=qs['filters'](_[_0x9495('0x5a')](_0x7264e6[_0x9495('0x35')],_0x4cca5a[_0x9495('0x37')]));if(_0x7264e6[_0x9495('0x35')]['filter']){_0xcf6579[_0x9495('0x43')]=_[_0x9495('0x45')](_0xcf6579[_0x9495('0x43')],{'$or':_[_0x9495('0x30')](_0xcf6579[_0x9495('0x3a')],function(_0x240042){var _0x3021c7={};_0x3021c7[_0x240042]={'$like':'%'+_0x7264e6['query'][_0x9495('0x44')]+'%'};return _0x3021c7;})});}_0xcf6579=_[_0x9495('0x45')]({},_0xcf6579,_0x7264e6[_0x9495('0x47')]);return _0x9ac028[_0x9495('0x64')](_0xcf6579);}})['then'](function(_0x25ba53){if(_0x25ba53){_0xe92dfa=_0x25ba53[_0x9495('0x3c')];if(!_0x7264e6['query'][_0x9495('0x3d')](_0x9495('0x3e'))){_0xcf6579['limit']=qs[_0x9495('0x3f')](_0x7264e6[_0x9495('0x35')][_0x9495('0x3f')]);_0xcf6579[_0x9495('0x40')]=qs[_0x9495('0x40')](_0x7264e6[_0x9495('0x35')][_0x9495('0x40')]);}return _0x9ac028[_0x9495('0x64')](_0xcf6579);}})[_0x9495('0x27')](function(_0x24d87c){if(_0x24d87c){return _0x24d87c?{'count':_0xe92dfa,'rows':_0x24d87c}:null;}})[_0x9495('0x27')](respondWithResult(_0x21fa2b,null))[_0x9495('0x4b')](handleError(_0x21fa2b,null));};exports[_0x9495('0x66')]=function(_0x2c6782,_0x356391,_0x4826a7){var _0x42b289=_0x2c6782[_0x9495('0x4e')]['ids'];return db[_0x9495('0x65')][_0x9495('0x5c')]({'where':{'id':_0x42b289},'attributes':['id'],'include':[{'model':db[_0x9495('0x5d')],'as':'Agents','attributes':['id',_0x9495('0x2d'),_0x9495('0x67'),_0x9495('0x68'),_0x9495('0x69')],'raw':!![]}]})[_0x9495('0x27')](function(_0x644578){if(_0x644578){var _0x1d6f5b=_[_0x9495('0x6a')](_0x644578,function(_0x47dc90){var _0x40124d=_0x47dc90[_0x9495('0x29')]({'plain':!![]});return _0x40124d['Agents'];});return db[_0x9495('0x31')][_0x9495('0x53')]({'where':{'id':_0x2c6782[_0x9495('0x56')]['id']}})['then'](function(_0x2a2bca){return db[_0x9495('0x6b')][_0x9495('0x6c')](function(_0x1f7f3f){return _0x2a2bca[_0x9495('0x66')](_0x42b289,{'transaction':_0x1f7f3f})[_0x9495('0x27')](function(){return BPromise[_0x9495('0x6d')](_0x1d6f5b,function(_0x222dc4){return db[_0x9495('0x59')][_0x9495('0x6e')]({'where':{'UserId':_0x222dc4['id'],'FaxQueueId':_0x2c6782[_0x9495('0x56')]['id']},'transaction':_0x1f7f3f});});})['then'](function(){_0x1d6f5b[_0x9495('0x6f')](function(_0x48ae60){socket['emit'](_0x9495('0x70'),{'UserId':_0x48ae60['id'],'FaxQueueId':_0x2a2bca['id']});});});});});}})['then'](respondWithStatusCode(_0x356391,null))['catch'](handleError(_0x356391,null));};exports[_0x9495('0x71')]=function(_0xe06eb9,_0x28f597,_0x362779){return db['Team'][_0x9495('0x5c')]({'where':{'id':_0xe06eb9['query'][_0x9495('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9495('0x73'),'attributes':['id'],'raw':!![]}]})[_0x9495('0x27')](handleEntityNotFound(_0x28f597,null))[_0x9495('0x27')](function(_0x2310e1){var _0x22e4cb=_[_0x9495('0x30')](_0x2310e1,'id');var _0x17693f=[];var _0xbb3e25=[];var _0x15f537=squel[_0x9495('0x74')]();_0x15f537[_0x9495('0x75')](_0x9495('0x76'))[_0x9495('0x77')](_0x9495('0x78'),'tq')[_0x9495('0x79')](_0x9495('0x7a'),'ut',_0x9495('0x7b'))[_0x9495('0x43')](_0x9495('0x7c'),_0xe06eb9[_0x9495('0x56')]['id']);for(var _0x35758e=0x0;_0x35758e<_0x2310e1[_0x9495('0x3c')];_0x35758e+=0x1){let _0x3fcf93=_0x2310e1[_0x35758e];for(var _0x4f33e0=0x0;_0x4f33e0<_0x3fcf93[_0x9495('0x73')][_0x9495('0x3c')];_0x4f33e0+=0x1){let _0x58a4e3=_0x3fcf93[_0x9495('0x73')][_0x4f33e0];var _0x278eb3=_0x15f537['clone']();_0x278eb3[_0x9495('0x43')]('ut.UserId\x20=\x20?',_0x58a4e3['id']);_0xbb3e25[_0x9495('0x7d')](db[_0x9495('0x6b')][_0x9495('0x35')](_0x278eb3[_0x9495('0x7e')](),{'type':db[_0x9495('0x6b')]['QueryTypes'][_0x9495('0x7f')]})[_0x9495('0x27')](function(_0x3deceb){if(_0x3deceb[_0x9495('0x3c')]===0x1){return _0x58a4e3['id'];}else{var _0xdbb403=_['every'](_[_0x9495('0x30')](_0x3deceb,_0x9495('0x80')),function(_0x40317b){return _[_0x9495('0x81')](_0x22e4cb,_0x40317b);});if(_0xdbb403){return _0x58a4e3['id'];}}}));}}return BPromise[_0x9495('0x82')](_0xbb3e25)[_0x9495('0x27')](function(_0x2aeed3){_0x17693f=_(_0x17693f)['union'](_0x2aeed3)[_0x9495('0x83')]()[_0x9495('0x84')]();return db[_0x9495('0x31')]['find']({'where':{'id':_0xe06eb9[_0x9495('0x56')]['id']}})[_0x9495('0x27')](function(_0x3686cf){return db[_0x9495('0x6b')][_0x9495('0x6c')](function(_0x244d82){return _0x3686cf[_0x9495('0x71')](_0xe06eb9['query'][_0x9495('0x72')],{'transaction':_0x244d82})[_0x9495('0x27')](function(){if(!_['isEmpty'](_0x17693f)){return _0x3686cf['removeAgents'](_0x17693f,{'transaction':_0x244d82});}})['then'](function(){_0x17693f['forEach'](function(_0x4a6f48){socket[_0x9495('0x85')](_0x9495('0x86'),{'UserId':_0x4a6f48,'FaxQueueId':_0x3686cf['id']});});});});});});})[_0x9495('0x27')](respondWithStatusCode(_0x28f597,null))[_0x9495('0x4b')](handleError(_0x28f597,null));};exports[_0x9495('0x87')]=function(_0x4834ae,_0x48d623,_0xa2427f){return db[_0x9495('0x31')]['find']({'where':{'id':_0x4834ae[_0x9495('0x56')]['id']}})['then'](handleEntityNotFound(_0x48d623,null))[_0x9495('0x27')](function(_0x114c60){if(_0x114c60){return _0x114c60[_0x9495('0x87')](_0x4834ae[_0x9495('0x4e')][_0x9495('0x72')],_[_0x9495('0x88')](_0x4834ae[_0x9495('0x4e')],[_0x9495('0x72'),'id'])||{})['spread'](function(_0x96b83e){for(var _0x2bc2ab=0x0;_0x2bc2ab<_0x4834ae[_0x9495('0x4e')][_0x9495('0x72')][_0x9495('0x3c')];_0x2bc2ab+=0x1){socket[_0x9495('0x85')](_0x9495('0x70'),{'UserId':_0x4834ae[_0x9495('0x4e')]['ids'][_0x2bc2ab],'FaxQueueId':_0x4834ae[_0x9495('0x56')]['id']});}return _0x96b83e;});}})['then'](respondWithResult(_0x48d623,null))['catch'](handleError(_0x48d623,null));};exports[_0x9495('0x89')]=function(_0x137ed3,_0x4ce4c4,_0x1df771){return db[_0x9495('0x31')][_0x9495('0x53')]({'where':{'id':_0x137ed3['params']['id']}})[_0x9495('0x27')](handleEntityNotFound(_0x4ce4c4,null))[_0x9495('0x27')](function(_0x599018){if(_0x599018){return _0x599018['removeAgents'](_0x137ed3[_0x9495('0x35')][_0x9495('0x72')])[_0x9495('0x27')](function(){if(_[_0x9495('0x8a')](_0x137ed3[_0x9495('0x35')][_0x9495('0x72')])){for(var _0x2865aa=0x0;_0x2865aa<_0x137ed3['query'][_0x9495('0x72')][_0x9495('0x3c')];_0x2865aa+=0x1){socket[_0x9495('0x85')](_0x9495('0x86'),{'UserId':Number(_0x137ed3[_0x9495('0x35')]['ids'][_0x2865aa]),'FaxQueueId':Number(_0x137ed3[_0x9495('0x56')]['id'])});}}else{socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x137ed3['query'][_0x9495('0x72')]),'FaxQueueId':Number(_0x137ed3[_0x9495('0x56')]['id'])});}});}})[_0x9495('0x27')](respondWithStatusCode(_0x4ce4c4,null))[_0x9495('0x4b')](handleError(_0x4ce4c4,null));};exports[_0x9495('0x8b')]=function(_0x10c08e,_0x22abcc,_0x44013f){var _0xecf62d={};var _0x5e2644={};var _0x25a031;var _0x309e5b;return db[_0x9495('0x31')]['findOne']({'where':{'id':_0x10c08e[_0x9495('0x56')]['id']}})[_0x9495('0x27')](handleEntityNotFound(_0x22abcc,null))[_0x9495('0x27')](function(_0x18b472){if(_0x18b472){_0x25a031=_0x18b472;_0x5e2644[_0x9495('0x39')]=_['keys'](db[_0x9495('0x5d')][_0x9495('0x32')]);_0x5e2644[_0x9495('0x35')]=_['keys'](_0x10c08e[_0x9495('0x35')]);_0x5e2644['filters']=_[_0x9495('0x38')](_0x5e2644[_0x9495('0x39')],_0x5e2644[_0x9495('0x35')]);_0xecf62d['attributes']=_[_0x9495('0x38')](_0x5e2644['model'],qs[_0x9495('0x3b')](_0x10c08e[_0x9495('0x35')][_0x9495('0x3b')]));_0xecf62d['attributes']=_0xecf62d[_0x9495('0x3a')][_0x9495('0x3c')]?_0xecf62d[_0x9495('0x3a')]:_0x5e2644[_0x9495('0x39')];_0xecf62d[_0x9495('0x41')]=qs[_0x9495('0x42')](_0x10c08e[_0x9495('0x35')][_0x9495('0x42')]);_0xecf62d[_0x9495('0x43')]=qs[_0x9495('0x37')](_[_0x9495('0x5a')](_0x10c08e[_0x9495('0x35')],_0x5e2644['filters']));if(_0x10c08e[_0x9495('0x35')][_0x9495('0x44')]){_0xecf62d[_0x9495('0x43')]=_['merge'](_0xecf62d['where'],{'$or':_[_0x9495('0x30')](_0xecf62d['attributes'],function(_0x5c995b){var _0x1cb0dd={};_0x1cb0dd[_0x5c995b]={'$like':'%'+_0x10c08e['query'][_0x9495('0x44')]+'%'};return _0x1cb0dd;})});}_0xecf62d=_[_0x9495('0x45')]({},_0xecf62d,_0x10c08e[_0x9495('0x47')]);return _0x25a031['getAgents'](_0xecf62d);}})[_0x9495('0x27')](function(_0x21234f){if(_0x21234f){_0x309e5b=_0x21234f[_0x9495('0x3c')];if(!_0x10c08e[_0x9495('0x35')][_0x9495('0x3d')](_0x9495('0x3e'))){_0xecf62d[_0x9495('0x3f')]=qs[_0x9495('0x3f')](_0x10c08e[_0x9495('0x35')][_0x9495('0x3f')]);_0xecf62d[_0x9495('0x40')]=qs[_0x9495('0x40')](_0x10c08e[_0x9495('0x35')]['offset']);}return _0x25a031[_0x9495('0x8b')](_0xecf62d);}})['then'](function(_0x3d7d87){if(_0x3d7d87){return _0x3d7d87?{'count':_0x309e5b,'rows':_0x3d7d87}:null;}})[_0x9495('0x27')](respondWithResult(_0x22abcc,null))[_0x9495('0x4b')](handleError(_0x22abcc,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index a35291c..a68af10 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 _0x3c5e=['update','remove','emit','hasOwnProperty','exports','events','FaxQueue','setMaxListeners','save'];(function(_0x58ca9e,_0x55ed97){var _0x2135e4=function(_0x4bf9e7){while(--_0x4bf9e7){_0x58ca9e['push'](_0x58ca9e['shift']());}};_0x2135e4(++_0x55ed97);}(_0x3c5e,0x140));var _0xe3c5=function(_0xa0c891,_0x20564b){_0xa0c891=_0xa0c891-0x0;var _0xc32d32=_0x3c5e[_0xa0c891];return _0xc32d32;};'use strict';var EventEmitter=require(_0xe3c5('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0xe3c5('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xe3c5('0x2')](0x0);var events={'afterCreate':_0xe3c5('0x3'),'afterUpdate':_0xe3c5('0x4'),'afterDestroy':_0xe3c5('0x5')};function emitEvent(_0xd1a7c9){return function(_0x1e6f4c,_0x20268b,_0x35adda){FaxQueueEvents[_0xe3c5('0x6')](_0xd1a7c9+':'+_0x1e6f4c['id'],_0x1e6f4c);FaxQueueEvents[_0xe3c5('0x6')](_0xd1a7c9,_0x1e6f4c);_0x35adda(null);};}for(var e in events){if(events[_0xe3c5('0x7')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xe3c5('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0x94cc=['FaxQueue','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x195a53,_0x24f149){var _0x283883=function(_0x4d9408){while(--_0x4d9408){_0x195a53['push'](_0x195a53['shift']());}};_0x283883(++_0x24f149);}(_0x94cc,0x6f));var _0xc94c=function(_0x1737b7,_0x53f1bc){_0x1737b7=_0x1737b7-0x0;var _0x4a8bf8=_0x94cc[_0x1737b7];return _0x4a8bf8;};'use strict';var EventEmitter=require(_0xc94c('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0xc94c('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xc94c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc94c('0x3'),'afterDestroy':_0xc94c('0x4')};function emitEvent(_0x92af65){return function(_0x4a043d,_0x33c098,_0x5dda78){FaxQueueEvents[_0xc94c('0x5')](_0x92af65+':'+_0x4a043d['id'],_0x4a043d);FaxQueueEvents[_0xc94c('0x5')](_0x92af65,_0x4a043d);_0x5dda78(null);};}for(var e in events){if(events[_0xc94c('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xc94c('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 1fe07bc..f4fcadc 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 _0xe948=['FaxQueue','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxQueue.attributes','exports'];(function(_0x47a433,_0x144e05){var _0xbab002=function(_0xfd547b){while(--_0xfd547b){_0x47a433['push'](_0x47a433['shift']());}};_0xbab002(++_0x144e05);}(_0xe948,0x90));var _0x8e94=function(_0x51c4fb,_0x174cdf){_0x51c4fb=_0x51c4fb-0x0;var _0x18f13c=_0xe948[_0x51c4fb];return _0x18f13c;};'use strict';var _=require('lodash');var util=require(_0x8e94('0x0'));var logger=require(_0x8e94('0x1'))(_0x8e94('0x2'));var moment=require(_0x8e94('0x3'));var BPromise=require(_0x8e94('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e94('0x5'));var rimraf=require(_0x8e94('0x6'));var config=require(_0x8e94('0x7'));var attributes=require(_0x8e94('0x8'));module[_0x8e94('0x9')]=function(_0x580a98,_0x193508){return _0x580a98['define'](_0x8e94('0xa'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b9f=['api','bluebird','request-promise','../../config/environment','./faxQueue.attributes','exports','define','fax_queues','lodash'];(function(_0x53a725,_0xa856d5){var _0x22ccf8=function(_0x2461e1){while(--_0x2461e1){_0x53a725['push'](_0x53a725['shift']());}};_0x22ccf8(++_0xa856d5);}(_0x6b9f,0xc5));var _0xf6b9=function(_0x12b9c8,_0x341a5f){_0x12b9c8=_0x12b9c8-0x0;var _0x486e4d=_0x6b9f[_0x12b9c8];return _0x486e4d;};'use strict';var _=require(_0xf6b9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf6b9('0x1'));var moment=require('moment');var BPromise=require(_0xf6b9('0x2'));var rp=require(_0xf6b9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf6b9('0x4'));var attributes=require(_0xf6b9('0x5'));module[_0xf6b9('0x6')]=function(_0x119014,_0x464537){return _0x119014[_0xf6b9('0x7')]('FaxQueue',attributes,{'tableName':_0xf6b9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index d036fc1..b15d44b 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 _0x91c7=['map','model','then','ShowFaxQueue','find','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','socket.io-emitter','./faxQueue.socket','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFaxQueue','FaxQueue','options','raw','where','attributes','include'];(function(_0x4e35dc,_0x599a85){var _0x76c104=function(_0x5e2222){while(--_0x5e2222){_0x4e35dc['push'](_0x4e35dc['shift']());}};_0x76c104(++_0x599a85);}(_0x91c7,0x8d));var _0x791c=function(_0x5c12ae,_0x29ab56){_0x5c12ae=_0x5c12ae-0x0;var _0x6b60d1=_0x91c7[_0x5c12ae];return _0x6b60d1;};'use strict';var _=require('lodash');var util=require(_0x791c('0x0'));var moment=require(_0x791c('0x1'));var BPromise=require(_0x791c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x791c('0x3'))['db'];var utils=require(_0x791c('0x4'));var logger=require(_0x791c('0x5'))(_0x791c('0x6'));var config=require('../../config/environment');var jayson=require(_0x791c('0x7'));var client=jayson[_0x791c('0x8')]['http']({'port':0x232a});config[_0x791c('0x9')]=_['defaults'](config[_0x791c('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x791c('0xa'))(new Redis(config[_0x791c('0x9')]));require(_0x791c('0xb'))['register'](socket);function respondWithRpcPromise(_0x2f9f92,_0x4b1814,_0x4e0485){return new BPromise(function(_0x101589,_0x58d021){return client['request'](_0x2f9f92,_0x4e0485)['then'](function(_0x3d27f9){logger[_0x791c('0xc')](_0x791c('0xd'),_0x4b1814,_0x791c('0xe'));logger[_0x791c('0xf')](_0x791c('0x10'),_0x4b1814,_0x791c('0xe'),JSON[_0x791c('0x11')](_0x3d27f9));if(_0x3d27f9['error']){if(_0x3d27f9[_0x791c('0x12')][_0x791c('0x13')]===0x1f4){logger['error'](_0x791c('0xd'),_0x4b1814,_0x3d27f9['error'][_0x791c('0x14')]);return _0x58d021(_0x3d27f9[_0x791c('0x12')][_0x791c('0x14')]);}logger['error']('FaxQueue,\x20%s,\x20%s',_0x4b1814,_0x3d27f9[_0x791c('0x12')][_0x791c('0x14')]);return _0x101589(_0x3d27f9[_0x791c('0x12')]['message']);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x4b1814,'request\x20sent');_0x101589(_0x3d27f9['result'][_0x791c('0x14')]);}})[_0x791c('0x15')](function(_0x310c07){logger[_0x791c('0x12')](_0x791c('0xd'),_0x4b1814,_0x310c07);_0x58d021(_0x310c07);});});}exports[_0x791c('0x16')]=function(_0x6f2909){var _0x8cea92=this;return new Promise(function(_0x1a441a,_0x415d78){return db[_0x791c('0x17')]['findAll']({'raw':_0x6f2909[_0x791c('0x18')]?_0x6f2909[_0x791c('0x18')][_0x791c('0x19')]===undefined?!![]:![]:!![],'where':_0x6f2909[_0x791c('0x18')]?_0x6f2909['options'][_0x791c('0x1a')]||null:null,'attributes':_0x6f2909[_0x791c('0x18')]?_0x6f2909['options'][_0x791c('0x1b')]||null:null,'limit':_0x6f2909[_0x791c('0x18')]?_0x6f2909[_0x791c('0x18')]['limit']||null:null,'include':_0x6f2909[_0x791c('0x18')]?_0x6f2909['options'][_0x791c('0x1c')]?_[_0x791c('0x1d')](_0x6f2909[_0x791c('0x18')][_0x791c('0x1c')],function(_0x43fc8e){return{'model':db[_0x43fc8e[_0x791c('0x1e')]],'as':_0x43fc8e['as'],'attributes':_0x43fc8e[_0x791c('0x1b')],'include':_0x43fc8e[_0x791c('0x1c')]?_['map'](_0x43fc8e[_0x791c('0x1c')],function(_0x496033){return{'model':db[_0x496033[_0x791c('0x1e')]],'as':_0x496033['as'],'attributes':_0x496033[_0x791c('0x1b')],'include':_0x496033[_0x791c('0x1c')]?_[_0x791c('0x1d')](_0x496033[_0x791c('0x1c')],function(_0x10c42f){return{'model':db[_0x10c42f[_0x791c('0x1e')]],'as':_0x10c42f['as'],'attributes':_0x10c42f[_0x791c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x791c('0x1f')](function(_0x166d60){logger[_0x791c('0xc')]('GetFaxQueue',_0x6f2909);logger[_0x791c('0xf')]('GetFaxQueue',_0x6f2909,JSON[_0x791c('0x11')](_0x166d60));_0x1a441a(_0x166d60);})[_0x791c('0x15')](function(_0x321bca){logger[_0x791c('0x12')](_0x791c('0x16'),_0x321bca[_0x791c('0x14')],_0x6f2909);_0x415d78(_0x8cea92[_0x791c('0x12')](0x1f4,_0x321bca[_0x791c('0x14')]));});});};exports[_0x791c('0x20')]=function(_0x4bcd21){var _0x1597a3=this;return new Promise(function(_0xbb3e2d,_0xa45a6b){return db[_0x791c('0x17')][_0x791c('0x21')]({'raw':_0x4bcd21['options']?_0x4bcd21['options'][_0x791c('0x19')]===undefined?!![]:![]:!![],'where':_0x4bcd21[_0x791c('0x18')]?_0x4bcd21[_0x791c('0x18')][_0x791c('0x1a')]||null:null,'attributes':_0x4bcd21['options']?_0x4bcd21['options'][_0x791c('0x1b')]||null:null,'include':_0x4bcd21[_0x791c('0x18')]?_0x4bcd21['options']['include']?_[_0x791c('0x1d')](_0x4bcd21[_0x791c('0x18')]['include'],function(_0x33c676){return{'model':db[_0x33c676[_0x791c('0x1e')]],'as':_0x33c676['as'],'attributes':_0x33c676[_0x791c('0x1b')],'include':_0x33c676[_0x791c('0x1c')]?_[_0x791c('0x1d')](_0x33c676[_0x791c('0x1c')],function(_0x10fde1){return{'model':db[_0x10fde1[_0x791c('0x1e')]],'as':_0x10fde1['as'],'attributes':_0x10fde1[_0x791c('0x1b')],'include':_0x10fde1[_0x791c('0x1c')]?_['map'](_0x10fde1[_0x791c('0x1c')],function(_0x41c44e){return{'model':db[_0x41c44e['model']],'as':_0x41c44e['as'],'attributes':_0x41c44e[_0x791c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x791c('0x1f')](function(_0x10b6a5){logger['info'](_0x791c('0x20'),_0x4bcd21);logger[_0x791c('0xf')](_0x791c('0x20'),_0x4bcd21,JSON['stringify'](_0x10b6a5));_0xbb3e2d(_0x10b6a5);})[_0x791c('0x15')](function(_0x5a6c96){logger[_0x791c('0x12')](_0x791c('0x20'),_0x5a6c96[_0x791c('0x14')],_0x4bcd21);_0xa45a6b(_0x1597a3[_0x791c('0x12')](0x1f4,_0x5a6c96['message']));});});}; \ No newline at end of file +var _0x30bc=['FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','model','map','catch','find','ShowFaxQueue','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info'];(function(_0x4309eb,_0x319008){var _0x45cbe7=function(_0x4102a6){while(--_0x4102a6){_0x4309eb['push'](_0x4309eb['shift']());}};_0x45cbe7(++_0x319008);}(_0x30bc,0x14b));var _0xc30b=function(_0x35c506,_0x18351c){_0x35c506=_0x35c506-0x0;var _0x4d025c=_0x30bc[_0x35c506];return _0x4d025c;};'use strict';var _=require(_0xc30b('0x0'));var util=require(_0xc30b('0x1'));var moment=require(_0xc30b('0x2'));var BPromise=require(_0xc30b('0x3'));var rs=require(_0xc30b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc30b('0x5'));var logger=require(_0xc30b('0x6'))(_0xc30b('0x7'));var config=require(_0xc30b('0x8'));var jayson=require(_0xc30b('0x9'));var client=jayson[_0xc30b('0xa')][_0xc30b('0xb')]({'port':0x232a});config[_0xc30b('0xc')]=_[_0xc30b('0xd')](config['redis'],{'host':_0xc30b('0xe'),'port':0x18eb});var socket=require(_0xc30b('0xf'))(new Redis(config[_0xc30b('0xc')]));require(_0xc30b('0x10'))[_0xc30b('0x11')](socket);function respondWithRpcPromise(_0x362643,_0x48d61d,_0x278455){return new BPromise(function(_0x20f846,_0x34b840){return client[_0xc30b('0x12')](_0x362643,_0x278455)[_0xc30b('0x13')](function(_0x28c087){logger[_0xc30b('0x14')](_0xc30b('0x15'),_0x48d61d,'request\x20sent');logger[_0xc30b('0x16')](_0xc30b('0x17'),_0x48d61d,_0xc30b('0x18'),JSON[_0xc30b('0x19')](_0x28c087));if(_0x28c087[_0xc30b('0x1a')]){if(_0x28c087[_0xc30b('0x1a')][_0xc30b('0x1b')]===0x1f4){logger[_0xc30b('0x1a')](_0xc30b('0x15'),_0x48d61d,_0x28c087[_0xc30b('0x1a')]['message']);return _0x34b840(_0x28c087['error'][_0xc30b('0x1c')]);}logger[_0xc30b('0x1a')]('FaxQueue,\x20%s,\x20%s',_0x48d61d,_0x28c087[_0xc30b('0x1a')][_0xc30b('0x1c')]);return _0x20f846(_0x28c087['error'][_0xc30b('0x1c')]);}else{logger['info'](_0xc30b('0x15'),_0x48d61d,_0xc30b('0x18'));_0x20f846(_0x28c087[_0xc30b('0x1d')]['message']);}})['catch'](function(_0x1df3f3){logger[_0xc30b('0x1a')](_0xc30b('0x15'),_0x48d61d,_0x1df3f3);_0x34b840(_0x1df3f3);});});}exports[_0xc30b('0x1e')]=function(_0x16fb1a){var _0x147f5b=this;return new Promise(function(_0x23e3fd,_0x3d2966){return db[_0xc30b('0x1f')][_0xc30b('0x20')]({'raw':_0x16fb1a[_0xc30b('0x21')]?_0x16fb1a[_0xc30b('0x21')][_0xc30b('0x22')]===undefined?!![]:![]:!![],'where':_0x16fb1a[_0xc30b('0x21')]?_0x16fb1a[_0xc30b('0x21')][_0xc30b('0x23')]||null:null,'attributes':_0x16fb1a['options']?_0x16fb1a[_0xc30b('0x21')][_0xc30b('0x24')]||null:null,'limit':_0x16fb1a[_0xc30b('0x21')]?_0x16fb1a[_0xc30b('0x21')][_0xc30b('0x25')]||null:null,'include':_0x16fb1a[_0xc30b('0x21')]?_0x16fb1a[_0xc30b('0x21')][_0xc30b('0x26')]?_['map'](_0x16fb1a[_0xc30b('0x21')][_0xc30b('0x26')],function(_0x4d910b){return{'model':db[_0x4d910b[_0xc30b('0x27')]],'as':_0x4d910b['as'],'attributes':_0x4d910b['attributes'],'include':_0x4d910b[_0xc30b('0x26')]?_['map'](_0x4d910b[_0xc30b('0x26')],function(_0x218390){return{'model':db[_0x218390[_0xc30b('0x27')]],'as':_0x218390['as'],'attributes':_0x218390[_0xc30b('0x24')],'include':_0x218390[_0xc30b('0x26')]?_[_0xc30b('0x28')](_0x218390[_0xc30b('0x26')],function(_0x59f11c){return{'model':db[_0x59f11c[_0xc30b('0x27')]],'as':_0x59f11c['as'],'attributes':_0x59f11c[_0xc30b('0x24')]};}):[]};}):[]};}):[]:[]})[_0xc30b('0x13')](function(_0x28a526){logger[_0xc30b('0x14')]('GetFaxQueue',_0x16fb1a);logger['debug'](_0xc30b('0x1e'),_0x16fb1a,JSON[_0xc30b('0x19')](_0x28a526));_0x23e3fd(_0x28a526);})[_0xc30b('0x29')](function(_0x5b6ff8){logger[_0xc30b('0x1a')](_0xc30b('0x1e'),_0x5b6ff8[_0xc30b('0x1c')],_0x16fb1a);_0x3d2966(_0x147f5b[_0xc30b('0x1a')](0x1f4,_0x5b6ff8['message']));});});};exports['ShowFaxQueue']=function(_0x5eb72c){var _0x32e7a6=this;return new Promise(function(_0x55cd1f,_0x1d9dc9){return db[_0xc30b('0x1f')][_0xc30b('0x2a')]({'raw':_0x5eb72c[_0xc30b('0x21')]?_0x5eb72c['options'][_0xc30b('0x22')]===undefined?!![]:![]:!![],'where':_0x5eb72c[_0xc30b('0x21')]?_0x5eb72c[_0xc30b('0x21')][_0xc30b('0x23')]||null:null,'attributes':_0x5eb72c[_0xc30b('0x21')]?_0x5eb72c[_0xc30b('0x21')][_0xc30b('0x24')]||null:null,'include':_0x5eb72c[_0xc30b('0x21')]?_0x5eb72c['options'][_0xc30b('0x26')]?_[_0xc30b('0x28')](_0x5eb72c['options'][_0xc30b('0x26')],function(_0x17d01c){return{'model':db[_0x17d01c[_0xc30b('0x27')]],'as':_0x17d01c['as'],'attributes':_0x17d01c[_0xc30b('0x24')],'include':_0x17d01c['include']?_[_0xc30b('0x28')](_0x17d01c[_0xc30b('0x26')],function(_0xc976d2){return{'model':db[_0xc976d2[_0xc30b('0x27')]],'as':_0xc976d2['as'],'attributes':_0xc976d2[_0xc30b('0x24')],'include':_0xc976d2[_0xc30b('0x26')]?_[_0xc30b('0x28')](_0xc976d2[_0xc30b('0x26')],function(_0x3823ff){return{'model':db[_0x3823ff['model']],'as':_0x3823ff['as'],'attributes':_0x3823ff[_0xc30b('0x24')]};}):[]};}):[]};}):[]:[]})[_0xc30b('0x13')](function(_0x30a710){logger[_0xc30b('0x14')](_0xc30b('0x2b'),_0x5eb72c);logger[_0xc30b('0x16')](_0xc30b('0x2b'),_0x5eb72c,JSON[_0xc30b('0x19')](_0x30a710));_0x55cd1f(_0x30a710);})[_0xc30b('0x29')](function(_0x3771be){logger[_0xc30b('0x1a')](_0xc30b('0x2b'),_0x3771be['message'],_0x5eb72c);_0x1d9dc9(_0x32e7a6[_0xc30b('0x1a')](0x1f4,_0x3771be[_0xc30b('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index e747a69..1b7696d 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 _0xb751=['removeListener','register','length','faxQueue:','remove','update'];(function(_0x3a4249,_0x484329){var _0x2910b6=function(_0x164d3e){while(--_0x164d3e){_0x3a4249['push'](_0x3a4249['shift']());}};_0x2910b6(++_0x484329);}(_0xb751,0x1f0));var _0x1b75=function(_0x2d5f53,_0x1d2f95){_0x2d5f53=_0x2d5f53-0x0;var _0xb3d5b8=_0xb751[_0x2d5f53];return _0xb3d5b8;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=['save',_0x1b75('0x0'),_0x1b75('0x1')];function createListener(_0x1dafdd,_0x11e7c8){return function(_0x283a60){_0x11e7c8['emit'](_0x1dafdd,_0x283a60);};}function removeListener(_0x225a40,_0x56311b){return function(){FaxQueueEvents[_0x1b75('0x2')](_0x225a40,_0x56311b);};}exports[_0x1b75('0x3')]=function(_0x391fe6){for(var _0x37fe68=0x0,_0x46b853=events[_0x1b75('0x4')];_0x37fe68<_0x46b853;_0x37fe68++){var _0x1a5d22=events[_0x37fe68];var _0x12943e=createListener(_0x1b75('0x5')+_0x1a5d22,_0x391fe6);FaxQueueEvents['on'](_0x1a5d22,_0x12943e);}}; \ No newline at end of file +var _0xbce2=['./faxQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x581210,_0x1960f4){var _0xde67f5=function(_0x6d48ea){while(--_0x6d48ea){_0x581210['push'](_0x581210['shift']());}};_0xde67f5(++_0x1960f4);}(_0xbce2,0x80));var _0x2bce=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xbce2[_0x199572];return _0x13cfa3;};'use strict';var FaxQueueEvents=require(_0x2bce('0x0'));var events=[_0x2bce('0x1'),_0x2bce('0x2'),_0x2bce('0x3')];function createListener(_0x147686,_0x4ba746){return function(_0x1ffdbe){_0x4ba746[_0x2bce('0x4')](_0x147686,_0x1ffdbe);};}function removeListener(_0x4c614c,_0x16801b){return function(){FaxQueueEvents[_0x2bce('0x5')](_0x4c614c,_0x16801b);};}exports[_0x2bce('0x6')]=function(_0x57b884){for(var _0x5c7a3c=0x0,_0xd74493=events[_0x2bce('0x7')];_0x5c7a3c<_0xd74493;_0x5c7a3c++){var _0x63499a=events[_0x5c7a3c];var _0x5c8f15=createListener('faxQueue:'+_0x63499a,_0x57b884);FaxQueueEvents['on'](_0x63499a,_0x5c8f15);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index e348d88..b7d07ad 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(_0x14c093,_0x12cae1){var _0x473746=function(_0x4cfe44){while(--_0x4cfe44){_0x14c093['push'](_0x14c093['shift']());}};_0x473746(++_0x12cae1);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['get'](_0x0baf('0xd'),auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0x8')](_0x0baf('0xf'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x8')](_0x0baf('0x11'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x8')](_0x0baf('0x13'),auth['isAuthenticated'](),controller['getAgents']);router[_0x0baf('0x14')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0x15')]);router[_0x0baf('0x14')]('/:id/teams',auth[_0x0baf('0x9')](),controller['addTeams']);router[_0x0baf('0x14')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x16')]);router[_0x0baf('0x17')](_0x0baf('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x0baf('0x18')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x19')]);router[_0x0baf('0x18')](_0x0baf('0x11'),auth['isAuthenticated'](),controller[_0x0baf('0x1a')]);router[_0x0baf('0x18')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x1b')]);module[_0x0baf('0x1c')]=router; \ No newline at end of file +var _0xb10b=['addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xb10b,0x12a));var _0xbb10=function(_0x497948,_0x4ca60c){_0x497948=_0x497948-0x0;var _0x39bb36=_0xb10b[_0x497948];return _0x39bb36;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getMembers']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['get'](_0xbb10('0x11'),auth['isAuthenticated'](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x13')](_0xbb10('0xf'),auth['isAuthenticated'](),controller[_0xbb10('0x15')]);router[_0xbb10('0x13')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x16')]);router[_0xbb10('0x17')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x18')]);router[_0xbb10('0x19')]('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x19')](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1b')]);router[_0xbb10('0x19')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 1fec7e8..3b31479 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 _0x06e2=['DATE','moment','sequelize','exports','STRING'];(function(_0x2d5fe0,_0x16b806){var _0x92a5a6=function(_0x24b801){while(--_0x24b801){_0x2d5fe0['push'](_0x2d5fe0['shift']());}};_0x92a5a6(++_0x16b806);}(_0x06e2,0x19b));var _0x206e=function(_0xf48b1e,_0xd1673a){_0xf48b1e=_0xf48b1e-0x0;var _0x50b98f=_0x06e2[_0xf48b1e];return _0x50b98f;};'use strict';var moment=require(_0x206e('0x0'));var Sequelize=require(_0x206e('0x1'));module[_0x206e('0x2')]={'uniqueid':{'type':Sequelize[_0x206e('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x206e('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x206e('0x4')]},'exitAt':{'type':Sequelize[_0x206e('0x4')]},'reason':{'type':Sequelize[_0x206e('0x3')]}}; \ No newline at end of file +var _0x9f3e=['sequelize','STRING','DATE','moment'];(function(_0x374ccf,_0xa945c4){var _0x443cde=function(_0x27ff10){while(--_0x27ff10){_0x374ccf['push'](_0x374ccf['shift']());}};_0x443cde(++_0xa945c4);}(_0x9f3e,0x7f));var _0xe9f3=function(_0x3f3323,_0x16a07e){_0x3f3323=_0x3f3323-0x0;var _0x4249ea=_0x9f3e[_0x3f3323];return _0x4249ea;};'use strict';var moment=require(_0xe9f3('0x0'));var Sequelize=require(_0xe9f3('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9f3('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xe9f3('0x2')]},'joinAt':{'type':Sequelize[_0xe9f3('0x3')]},'leaveAt':{'type':Sequelize[_0xe9f3('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xe9f3('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 1022a9a..d237271 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 _0x6de5=['catch','show','params','keys','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','FaxQueueReport','includeAll','include','findAll'];(function(_0xbe7e8c,_0x57cb4e){var _0x3ed22f=function(_0x76ce8f){while(--_0x76ce8f){_0xbe7e8c['push'](_0xbe7e8c['shift']());}};_0x3ed22f(++_0x57cb4e);}(_0x6de5,0x1b8));var _0x56de=function(_0x345dd9,_0x25e13b){_0x345dd9=_0x345dd9-0x0;var _0x3a4fe3=_0x6de5[_0x345dd9];return _0x3a4fe3;};'use strict';var pdf=require(_0x56de('0x0'));var emlformat=require(_0x56de('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x56de('0x2'));var jsonpatch=require(_0x56de('0x3'));var rp=require('request-promise');var moment=require(_0x56de('0x4'));var BPromise=require(_0x56de('0x5'));var Mustache=require(_0x56de('0x6'));var util=require(_0x56de('0x7'));var path=require('path');var sox=require(_0x56de('0x8'));var csv=require(_0x56de('0x9'));var ejs=require(_0x56de('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x56de('0xb'));var crypto=require(_0x56de('0xc'));var jsforce=require(_0x56de('0xd'));var deskjs=require(_0x56de('0xe'));var toCsv=require(_0x56de('0x9'));var querystring=require('querystring');var Papa=require(_0x56de('0xf'));var Redis=require(_0x56de('0x10'));var authService=require(_0x56de('0x11'));var qs=require(_0x56de('0x12'));var as=require(_0x56de('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x56de('0x14'))(_0x56de('0x15'));var utils=require('../../config/utils');var config=require(_0x56de('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c5a10,_0x4c3430){_0x4c3430=_0x4c3430||0xcc;return function(_0x3ddf97){if(_0x3ddf97){return _0x1c5a10[_0x56de('0x17')](_0x4c3430);}return _0x1c5a10['status'](_0x4c3430)[_0x56de('0x18')]();};}function respondWithResult(_0x247cdb,_0x1aa7a7){_0x1aa7a7=_0x1aa7a7||0xc8;return function(_0x11788c){if(_0x11788c){return _0x247cdb[_0x56de('0x19')](_0x1aa7a7)[_0x56de('0x1a')](_0x11788c);}};}function respondWithFilteredResult(_0x3da5dd,_0x599d56){return function(_0x5d4a2e){if(_0x5d4a2e){var _0x41d984=_0x5d4a2e[_0x56de('0x1b')],_0x28ba5b=_0x599d56[_0x56de('0x1c')],_0x556d32=_0x599d56[_0x56de('0x1c')]+_0x599d56[_0x56de('0x1d')],_0x340fc9;if(_0x556d32>=_0x41d984){_0x556d32=_0x41d984;_0x340fc9=0xc8;}else{_0x340fc9=0xce;}_0x3da5dd[_0x56de('0x19')](_0x340fc9);return _0x3da5dd['set'](_0x56de('0x1e'),_0x28ba5b+'-'+_0x556d32+'/'+_0x41d984)['json'](_0x5d4a2e);}return null;};}function patchUpdates(_0x51d9c5){return function(_0x554e70){try{jsonpatch[_0x56de('0x1f')](_0x554e70,_0x51d9c5,!![]);}catch(_0x66f376){return BPromise[_0x56de('0x20')](_0x66f376);}return _0x554e70['save']();};}function saveUpdates(_0x8f2a6d,_0x3d6360){return function(_0x3372ed){if(_0x3372ed){return _0x3372ed[_0x56de('0x21')](_0x8f2a6d)[_0x56de('0x22')](function(_0x53f2ad){return _0x53f2ad;});}return null;};}function removeEntity(_0x29f904,_0xccdb92){return function(_0x2a8df2){if(_0x2a8df2){return _0x2a8df2[_0x56de('0x23')]()[_0x56de('0x22')](function(){_0x29f904[_0x56de('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51b900,_0x24bec7){return function(_0x33e308){if(!_0x33e308){_0x51b900[_0x56de('0x17')](0x194);}return _0x33e308;};}function handleError(_0x226b54,_0x248513){_0x248513=_0x248513||0x1f4;return function(_0x4b9d6c){logger['error'](_0x4b9d6c[_0x56de('0x24')]);if(_0x4b9d6c[_0x56de('0x25')]){delete _0x4b9d6c['name'];}_0x226b54[_0x56de('0x19')](_0x248513)[_0x56de('0x26')](_0x4b9d6c);};}exports[_0x56de('0x27')]=function(_0x4fd8b3,_0xedb7a9){var _0x5f422f={},_0x124cd8={},_0x27f522={'count':0x0,'rows':[]};var _0x13d3e4=_[_0x56de('0x28')](db['FaxQueueReport'][_0x56de('0x29')],function(_0xb77a32){return{'name':_0xb77a32['fieldName'],'type':_0xb77a32[_0x56de('0x2a')][_0x56de('0x2b')]};});_0x124cd8[_0x56de('0x2c')]=_[_0x56de('0x28')](_0x13d3e4,_0x56de('0x25'));_0x124cd8['query']=_['keys'](_0x4fd8b3[_0x56de('0x2d')]);_0x124cd8[_0x56de('0x2e')]=_[_0x56de('0x2f')](_0x124cd8[_0x56de('0x2c')],_0x124cd8['query']);_0x5f422f['attributes']=_['intersection'](_0x124cd8[_0x56de('0x2c')],qs[_0x56de('0x30')](_0x4fd8b3[_0x56de('0x2d')]['fields']));_0x5f422f[_0x56de('0x31')]=_0x5f422f[_0x56de('0x31')][_0x56de('0x32')]?_0x5f422f[_0x56de('0x31')]:_0x124cd8[_0x56de('0x2c')];if(!_0x4fd8b3[_0x56de('0x2d')][_0x56de('0x33')](_0x56de('0x34'))){_0x5f422f[_0x56de('0x1d')]=qs[_0x56de('0x1d')](_0x4fd8b3['query']['limit']);_0x5f422f[_0x56de('0x1c')]=qs['offset'](_0x4fd8b3['query'][_0x56de('0x1c')]);}_0x5f422f[_0x56de('0x35')]=qs['sort'](_0x4fd8b3['query'][_0x56de('0x36')]);_0x5f422f['where']=qs[_0x56de('0x2e')](_[_0x56de('0x37')](_0x4fd8b3[_0x56de('0x2d')],_0x124cd8['filters']));if(_0x4fd8b3['query']['filter']){_0x5f422f[_0x56de('0x38')]=_[_0x56de('0x39')](_0x5f422f['where'],{'$or':_['map'](_0x13d3e4,function(_0x353560){if(_0x353560[_0x56de('0x2a')]!=='VIRTUAL'){var _0x1a185e={};_0x1a185e[_0x353560[_0x56de('0x25')]]={'$like':'%'+_0x4fd8b3[_0x56de('0x2d')][_0x56de('0x3a')]+'%'};return _0x1a185e;}})});}_0x5f422f=_[_0x56de('0x39')]({},_0x5f422f,_0x4fd8b3[_0x56de('0x3b')]);var _0x4c19e0={'where':_0x5f422f[_0x56de('0x38')]};return db[_0x56de('0x3c')][_0x56de('0x1b')](_0x4c19e0)['then'](function(_0x398a14){_0x27f522['count']=_0x398a14;if(_0x4fd8b3['query'][_0x56de('0x3d')]){_0x5f422f[_0x56de('0x3e')]=[{'all':!![]}];}return db[_0x56de('0x3c')][_0x56de('0x3f')](_0x5f422f);})[_0x56de('0x22')](function(_0x599951){_0x27f522['rows']=_0x599951;return _0x27f522;})[_0x56de('0x22')](respondWithFilteredResult(_0xedb7a9,_0x5f422f))[_0x56de('0x40')](handleError(_0xedb7a9,null));};exports[_0x56de('0x41')]=function(_0x155ef0,_0x22e2f2){var _0x4d5458={'raw':!![],'where':{'id':_0x155ef0[_0x56de('0x42')]['id']}},_0x3a792d={};_0x3a792d[_0x56de('0x2c')]=_[_0x56de('0x43')](db[_0x56de('0x3c')][_0x56de('0x29')]);_0x3a792d[_0x56de('0x2d')]=_['keys'](_0x155ef0['query']);_0x3a792d['filters']=_[_0x56de('0x2f')](_0x3a792d[_0x56de('0x2c')],_0x3a792d[_0x56de('0x2d')]);_0x4d5458[_0x56de('0x31')]=_['intersection'](_0x3a792d[_0x56de('0x2c')],qs[_0x56de('0x30')](_0x155ef0[_0x56de('0x2d')][_0x56de('0x30')]));_0x4d5458[_0x56de('0x31')]=_0x4d5458['attributes']['length']?_0x4d5458['attributes']:_0x3a792d[_0x56de('0x2c')];if(_0x155ef0[_0x56de('0x2d')][_0x56de('0x3d')]){_0x4d5458[_0x56de('0x3e')]=[{'all':!![]}];}_0x4d5458=_[_0x56de('0x39')]({},_0x4d5458,_0x155ef0[_0x56de('0x3b')]);return db[_0x56de('0x3c')][_0x56de('0x44')](_0x4d5458)[_0x56de('0x22')](handleEntityNotFound(_0x22e2f2,null))[_0x56de('0x22')](respondWithResult(_0x22e2f2,null))['catch'](handleError(_0x22e2f2,null));};exports[_0x56de('0x45')]=function(_0x2cdca4,_0x298910){return db[_0x56de('0x3c')][_0x56de('0x45')](_0x2cdca4[_0x56de('0x46')],{})[_0x56de('0x22')](respondWithResult(_0x298910,0xc9))[_0x56de('0x40')](handleError(_0x298910,null));};exports[_0x56de('0x21')]=function(_0x803a7c,_0x199eeb){if(_0x803a7c[_0x56de('0x46')]['id']){delete _0x803a7c[_0x56de('0x46')]['id'];}return db[_0x56de('0x3c')][_0x56de('0x44')]({'where':{'id':_0x803a7c['params']['id']}})['then'](handleEntityNotFound(_0x199eeb,null))[_0x56de('0x22')](saveUpdates(_0x803a7c[_0x56de('0x46')],null))[_0x56de('0x22')](respondWithResult(_0x199eeb,null))[_0x56de('0x40')](handleError(_0x199eeb,null));};exports[_0x56de('0x23')]=function(_0x225688,_0x2e305e){return db[_0x56de('0x3c')][_0x56de('0x44')]({'where':{'id':_0x225688[_0x56de('0x42')]['id']}})['then'](handleEntityNotFound(_0x2e305e,null))[_0x56de('0x22')](removeEntity(_0x2e305e,null))[_0x56de('0x40')](handleError(_0x2e305e,null));};exports[_0x56de('0x47')]=function(_0x2e9a50,_0x45eff8){return db[_0x56de('0x3c')][_0x56de('0x47')]()[_0x56de('0x22')](respondWithResult(_0x45eff8,null))[_0x56de('0x40')](handleError(_0x45eff8,null));}; \ No newline at end of file +var _0xe72a=['rows','catch','params','length','include','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','error','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','limit','order','sort','where','pick','merge','filter','options','includeAll'];(function(_0xe9aeb7,_0x153d97){var _0x7e98a9=function(_0x57992c){while(--_0x57992c){_0xe9aeb7['push'](_0xe9aeb7['shift']());}};_0x7e98a9(++_0x153d97);}(_0xe72a,0x13a));var _0xae72=function(_0x49eab7,_0x41f197){_0x49eab7=_0x49eab7-0x0;var _0x2504ef=_0xe72a[_0x49eab7];return _0x2504ef;};'use strict';var pdf=require(_0xae72('0x0'));var emlformat=require(_0xae72('0x1'));var rimraf=require(_0xae72('0x2'));var zipdir=require(_0xae72('0x3'));var jsonpatch=require(_0xae72('0x4'));var rp=require(_0xae72('0x5'));var moment=require('moment');var BPromise=require(_0xae72('0x6'));var Mustache=require(_0xae72('0x7'));var util=require(_0xae72('0x8'));var path=require(_0xae72('0x9'));var sox=require(_0xae72('0xa'));var csv=require(_0xae72('0xb'));var ejs=require(_0xae72('0xc'));var fs=require('fs');var _=require(_0xae72('0xd'));var squel=require('squel');var crypto=require(_0xae72('0xe'));var jsforce=require(_0xae72('0xf'));var deskjs=require(_0xae72('0x10'));var toCsv=require(_0xae72('0xb'));var querystring=require(_0xae72('0x11'));var Papa=require(_0xae72('0x12'));var Redis=require(_0xae72('0x13'));var authService=require(_0xae72('0x14'));var qs=require(_0xae72('0x15'));var as=require(_0xae72('0x16'));var hardwareService=require(_0xae72('0x17'));var logger=require(_0xae72('0x18'))(_0xae72('0x19'));var utils=require(_0xae72('0x1a'));var config=require('../../config/environment');var db=require(_0xae72('0x1b'))['db'];function respondWithStatusCode(_0x1df259,_0x1fb744){_0x1fb744=_0x1fb744||0xcc;return function(_0x4feeb2){if(_0x4feeb2){return _0x1df259[_0xae72('0x1c')](_0x1fb744);}return _0x1df259[_0xae72('0x1d')](_0x1fb744)[_0xae72('0x1e')]();};}function respondWithResult(_0x4c7097,_0x25a447){_0x25a447=_0x25a447||0xc8;return function(_0x16068d){if(_0x16068d){return _0x4c7097[_0xae72('0x1d')](_0x25a447)[_0xae72('0x1f')](_0x16068d);}};}function respondWithFilteredResult(_0x443710,_0x3e5366){return function(_0x427f9a){if(_0x427f9a){var _0x3b6a14=_0x427f9a[_0xae72('0x20')],_0x503932=_0x3e5366[_0xae72('0x21')],_0x35491e=_0x3e5366['offset']+_0x3e5366['limit'],_0x23eac9;if(_0x35491e>=_0x3b6a14){_0x35491e=_0x3b6a14;_0x23eac9=0xc8;}else{_0x23eac9=0xce;}_0x443710[_0xae72('0x1d')](_0x23eac9);return _0x443710[_0xae72('0x22')](_0xae72('0x23'),_0x503932+'-'+_0x35491e+'/'+_0x3b6a14)[_0xae72('0x1f')](_0x427f9a);}return null;};}function patchUpdates(_0x19e67d){return function(_0x59f240){try{jsonpatch[_0xae72('0x24')](_0x59f240,_0x19e67d,!![]);}catch(_0x3a314c){return BPromise[_0xae72('0x25')](_0x3a314c);}return _0x59f240['save']();};}function saveUpdates(_0x572b43,_0x102dbe){return function(_0x4c4d02){if(_0x4c4d02){return _0x4c4d02[_0xae72('0x26')](_0x572b43)[_0xae72('0x27')](function(_0x42298c){return _0x42298c;});}return null;};}function removeEntity(_0x4fe693,_0xb80b0c){return function(_0x2ef425){if(_0x2ef425){return _0x2ef425['destroy']()['then'](function(){_0x4fe693['status'](0xcc)[_0xae72('0x1e')]();});}};}function handleEntityNotFound(_0x122f02,_0x423a05){return function(_0xc27f29){if(!_0xc27f29){_0x122f02['sendStatus'](0x194);}return _0xc27f29;};}function handleError(_0x1581ae,_0x40bf97){_0x40bf97=_0x40bf97||0x1f4;return function(_0x10624e){logger[_0xae72('0x28')](_0x10624e['stack']);if(_0x10624e[_0xae72('0x29')]){delete _0x10624e[_0xae72('0x29')];}_0x1581ae['status'](_0x40bf97)[_0xae72('0x2a')](_0x10624e);};}exports[_0xae72('0x2b')]=function(_0x1ede6a,_0x210b72){var _0x29eecc={},_0x563c19={},_0x17d290={'count':0x0,'rows':[]};var _0x32884a=_[_0xae72('0x2c')](db[_0xae72('0x2d')][_0xae72('0x2e')],function(_0x31aada){return{'name':_0x31aada[_0xae72('0x2f')],'type':_0x31aada['type'][_0xae72('0x30')]};});_0x563c19[_0xae72('0x31')]=_[_0xae72('0x2c')](_0x32884a,_0xae72('0x29'));_0x563c19[_0xae72('0x32')]=_[_0xae72('0x33')](_0x1ede6a[_0xae72('0x32')]);_0x563c19[_0xae72('0x34')]=_['intersection'](_0x563c19[_0xae72('0x31')],_0x563c19[_0xae72('0x32')]);_0x29eecc['attributes']=_[_0xae72('0x35')](_0x563c19[_0xae72('0x31')],qs['fields'](_0x1ede6a[_0xae72('0x32')][_0xae72('0x36')]));_0x29eecc[_0xae72('0x37')]=_0x29eecc[_0xae72('0x37')]['length']?_0x29eecc[_0xae72('0x37')]:_0x563c19[_0xae72('0x31')];if(!_0x1ede6a[_0xae72('0x32')]['hasOwnProperty'](_0xae72('0x38'))){_0x29eecc[_0xae72('0x39')]=qs['limit'](_0x1ede6a[_0xae72('0x32')]['limit']);_0x29eecc[_0xae72('0x21')]=qs[_0xae72('0x21')](_0x1ede6a[_0xae72('0x32')][_0xae72('0x21')]);}_0x29eecc[_0xae72('0x3a')]=qs[_0xae72('0x3b')](_0x1ede6a[_0xae72('0x32')][_0xae72('0x3b')]);_0x29eecc[_0xae72('0x3c')]=qs[_0xae72('0x34')](_[_0xae72('0x3d')](_0x1ede6a[_0xae72('0x32')],_0x563c19[_0xae72('0x34')]));if(_0x1ede6a[_0xae72('0x32')]['filter']){_0x29eecc['where']=_[_0xae72('0x3e')](_0x29eecc[_0xae72('0x3c')],{'$or':_['map'](_0x32884a,function(_0x4aa684){if(_0x4aa684['type']!=='VIRTUAL'){var _0x34b34e={};_0x34b34e[_0x4aa684['name']]={'$like':'%'+_0x1ede6a[_0xae72('0x32')][_0xae72('0x3f')]+'%'};return _0x34b34e;}})});}_0x29eecc=_[_0xae72('0x3e')]({},_0x29eecc,_0x1ede6a[_0xae72('0x40')]);var _0x26a1ba={'where':_0x29eecc[_0xae72('0x3c')]};return db[_0xae72('0x2d')][_0xae72('0x20')](_0x26a1ba)[_0xae72('0x27')](function(_0xe62da5){_0x17d290[_0xae72('0x20')]=_0xe62da5;if(_0x1ede6a[_0xae72('0x32')][_0xae72('0x41')]){_0x29eecc['include']=[{'all':!![]}];}return db[_0xae72('0x2d')]['findAll'](_0x29eecc);})[_0xae72('0x27')](function(_0x204821){_0x17d290[_0xae72('0x42')]=_0x204821;return _0x17d290;})[_0xae72('0x27')](respondWithFilteredResult(_0x210b72,_0x29eecc))[_0xae72('0x43')](handleError(_0x210b72,null));};exports['show']=function(_0x3a1646,_0x1e9186){var _0x382dce={'raw':!![],'where':{'id':_0x3a1646[_0xae72('0x44')]['id']}},_0xe8c0fb={};_0xe8c0fb[_0xae72('0x31')]=_[_0xae72('0x33')](db[_0xae72('0x2d')][_0xae72('0x2e')]);_0xe8c0fb[_0xae72('0x32')]=_['keys'](_0x3a1646[_0xae72('0x32')]);_0xe8c0fb[_0xae72('0x34')]=_[_0xae72('0x35')](_0xe8c0fb[_0xae72('0x31')],_0xe8c0fb[_0xae72('0x32')]);_0x382dce[_0xae72('0x37')]=_[_0xae72('0x35')](_0xe8c0fb[_0xae72('0x31')],qs[_0xae72('0x36')](_0x3a1646[_0xae72('0x32')][_0xae72('0x36')]));_0x382dce[_0xae72('0x37')]=_0x382dce[_0xae72('0x37')][_0xae72('0x45')]?_0x382dce[_0xae72('0x37')]:_0xe8c0fb['model'];if(_0x3a1646[_0xae72('0x32')][_0xae72('0x41')]){_0x382dce[_0xae72('0x46')]=[{'all':!![]}];}_0x382dce=_[_0xae72('0x3e')]({},_0x382dce,_0x3a1646[_0xae72('0x40')]);return db[_0xae72('0x2d')][_0xae72('0x47')](_0x382dce)[_0xae72('0x27')](handleEntityNotFound(_0x1e9186,null))[_0xae72('0x27')](respondWithResult(_0x1e9186,null))['catch'](handleError(_0x1e9186,null));};exports[_0xae72('0x48')]=function(_0x326e5d,_0x282b27){return db[_0xae72('0x2d')][_0xae72('0x48')](_0x326e5d[_0xae72('0x49')],{})['then'](respondWithResult(_0x282b27,0xc9))[_0xae72('0x43')](handleError(_0x282b27,null));};exports['update']=function(_0x41d69b,_0x1c9808){if(_0x41d69b[_0xae72('0x49')]['id']){delete _0x41d69b['body']['id'];}return db[_0xae72('0x2d')][_0xae72('0x47')]({'where':{'id':_0x41d69b[_0xae72('0x44')]['id']}})[_0xae72('0x27')](handleEntityNotFound(_0x1c9808,null))[_0xae72('0x27')](saveUpdates(_0x41d69b[_0xae72('0x49')],null))[_0xae72('0x27')](respondWithResult(_0x1c9808,null))[_0xae72('0x43')](handleError(_0x1c9808,null));};exports[_0xae72('0x4a')]=function(_0x5c8d93,_0x2e2fcc){return db[_0xae72('0x2d')][_0xae72('0x47')]({'where':{'id':_0x5c8d93[_0xae72('0x44')]['id']}})[_0xae72('0x27')](handleEntityNotFound(_0x2e2fcc,null))[_0xae72('0x27')](removeEntity(_0x2e2fcc,null))[_0xae72('0x43')](handleError(_0x2e2fcc,null));};exports[_0xae72('0x4b')]=function(_0x1bfa4d,_0x410193){return db[_0xae72('0x2d')][_0xae72('0x4b')]()[_0xae72('0x27')](respondWithResult(_0x410193,null))['catch'](handleError(_0x410193,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 10bd117..ab41f1a 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 _0xa110=['report_fax_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x2f48cd,_0x46a75a){var _0x193ae2=function(_0x253c01){while(--_0x253c01){_0x2f48cd['push'](_0x2f48cd['shift']());}};_0x193ae2(++_0x46a75a);}(_0xa110,0x136));var _0x0a11=function(_0xcc966d,_0x228009){_0xcc966d=_0xcc966d-0x0;var _0x536e83=_0xa110[_0xcc966d];return _0x536e83;};'use strict';var _=require('lodash');var util=require(_0x0a11('0x0'));var logger=require(_0x0a11('0x1'))(_0x0a11('0x2'));var moment=require(_0x0a11('0x3'));var BPromise=require(_0x0a11('0x4'));var rp=require(_0x0a11('0x5'));var fs=require('fs');var path=require(_0x0a11('0x6'));var rimraf=require(_0x0a11('0x7'));var config=require('../../config/environment');var attributes=require('./faxQueueReport.attributes');module[_0x0a11('0x8')]=function(_0x130d07,_0x115f9c){return _0x130d07['define']('FaxQueueReport',attributes,{'tableName':_0x0a11('0x9'),'paranoid':![],'indexes':[{'name':_0x0a11('0xa'),'fields':[_0x0a11('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4991=['report_fax_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxQueueReport'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x4991,0x198));var _0x1499=function(_0xd784c5,_0x303e4){_0xd784c5=_0xd784c5-0x0;var _0x16cc31=_0x4991[_0xd784c5];return _0x16cc31;};'use strict';var _=require('lodash');var util=require(_0x1499('0x0'));var logger=require(_0x1499('0x1'))(_0x1499('0x2'));var moment=require(_0x1499('0x3'));var BPromise=require(_0x1499('0x4'));var rp=require(_0x1499('0x5'));var fs=require('fs');var path=require(_0x1499('0x6'));var rimraf=require(_0x1499('0x7'));var config=require(_0x1499('0x8'));var attributes=require('./faxQueueReport.attributes');module[_0x1499('0x9')]=function(_0x2d7a09,_0x2045c3){return _0x2d7a09[_0x1499('0xa')](_0x1499('0xb'),attributes,{'tableName':_0x1499('0xc'),'paranoid':![],'indexes':[{'name':_0x1499('0xd'),'fields':[_0x1499('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index cbf4a35..08f9689 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 _0x39e9=['message','result','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','then','catch','UpdateFaxQueueReport','update','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x39e9,0x1a7));var _0x939e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x39e9[_0x220dbb];return _0x2b77de;};'use strict';var _=require(_0x939e('0x0'));var util=require('util');var moment=require(_0x939e('0x1'));var BPromise=require(_0x939e('0x2'));var rs=require(_0x939e('0x3'));var fs=require('fs');var Redis=require(_0x939e('0x4'));var db=require(_0x939e('0x5'))['db'];var utils=require(_0x939e('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x939e('0x7'));var jayson=require(_0x939e('0x8'));var client=jayson['client'][_0x939e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41d40e,_0x41d008,_0x28f3b0){return new BPromise(function(_0xc133a5,_0x1396c2){return client[_0x939e('0xa')](_0x41d40e,_0x28f3b0)['then'](function(_0x1f81e5){logger[_0x939e('0xb')](_0x939e('0xc'),_0x41d008,_0x939e('0xd'));logger[_0x939e('0xe')](_0x939e('0xf'),_0x41d008,_0x939e('0xd'),JSON[_0x939e('0x10')](_0x1f81e5));if(_0x1f81e5[_0x939e('0x11')]){if(_0x1f81e5[_0x939e('0x11')][_0x939e('0x12')]===0x1f4){logger[_0x939e('0x11')](_0x939e('0xc'),_0x41d008,_0x1f81e5[_0x939e('0x11')][_0x939e('0x13')]);return _0x1396c2(_0x1f81e5[_0x939e('0x11')][_0x939e('0x13')]);}logger[_0x939e('0x11')](_0x939e('0xc'),_0x41d008,_0x1f81e5[_0x939e('0x11')][_0x939e('0x13')]);return _0xc133a5(_0x1f81e5[_0x939e('0x11')]['message']);}else{logger[_0x939e('0xb')](_0x939e('0xc'),_0x41d008,'request\x20sent');_0xc133a5(_0x1f81e5[_0x939e('0x14')][_0x939e('0x13')]);}})['catch'](function(_0x560908){logger[_0x939e('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x41d008,_0x560908);_0x1396c2(_0x560908);});});}exports[_0x939e('0x15')]=function(_0x1653c1){var _0x3f0167=this;return new Promise(function(_0xf229d2,_0x3716aa){return db[_0x939e('0x16')][_0x939e('0x17')](_0x1653c1[_0x939e('0x18')],{'raw':_0x1653c1[_0x939e('0x19')]?_0x1653c1[_0x939e('0x19')][_0x939e('0x1a')]===undefined?!![]:![]:!![]})[_0x939e('0x1b')](function(_0x458a52){logger['info']('CreateFaxQueueReport',_0x1653c1);logger[_0x939e('0xe')](_0x939e('0x15'),_0x1653c1,JSON[_0x939e('0x10')](_0x458a52));_0xf229d2(_0x458a52);})[_0x939e('0x1c')](function(_0x5f0ed9){logger[_0x939e('0x11')](_0x939e('0x15'),_0x5f0ed9['message'],_0x1653c1);_0x3716aa(_0x3f0167[_0x939e('0x11')](0x1f4,_0x5f0ed9[_0x939e('0x13')]));});});};exports[_0x939e('0x1d')]=function(_0x14ed48){var _0x4f4376=this;return new Promise(function(_0x633ecd,_0x157cb2){return db['FaxQueueReport'][_0x939e('0x1e')](_0x14ed48[_0x939e('0x18')],{'raw':_0x14ed48['options']?_0x14ed48[_0x939e('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14ed48[_0x939e('0x19')]?_0x14ed48[_0x939e('0x19')][_0x939e('0x1f')]||null:null,'attributes':_0x14ed48[_0x939e('0x19')]?_0x14ed48['options'][_0x939e('0x20')]||null:null,'limit':_0x14ed48[_0x939e('0x19')]?_0x14ed48['options'][_0x939e('0x21')]||null:null})['then'](function(_0x2f4fbf){logger[_0x939e('0xb')](_0x939e('0x1d'),_0x14ed48);logger[_0x939e('0xe')]('UpdateFaxQueueReport',_0x14ed48,JSON[_0x939e('0x10')](_0x2f4fbf));_0x633ecd(_0x2f4fbf);})[_0x939e('0x1c')](function(_0x4eefce){logger[_0x939e('0x11')](_0x939e('0x1d'),_0x4eefce[_0x939e('0x13')],_0x14ed48);_0x157cb2(_0x4f4376[_0x939e('0x11')](0x1f4,_0x4eefce[_0x939e('0x13')]));});});}; \ No newline at end of file +var _0xda09=['stringify','error','code','message','info','result','catch','CreateFaxQueueReport','create','body','options','raw','then','UpdateFaxQueueReport','FaxQueueReport','update','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x127697,_0x56bb8d){var _0x1aab5f=function(_0x293011){while(--_0x293011){_0x127697['push'](_0x127697['shift']());}};_0x1aab5f(++_0x56bb8d);}(_0xda09,0x1df));var _0x9da0=function(_0x3f2ebb,_0x255e19){_0x3f2ebb=_0x3f2ebb-0x0;var _0x3f9c49=_0xda09[_0x3f2ebb];return _0x3f9c49;};'use strict';var _=require(_0x9da0('0x0'));var util=require('util');var moment=require(_0x9da0('0x1'));var BPromise=require(_0x9da0('0x2'));var rs=require(_0x9da0('0x3'));var fs=require('fs');var Redis=require(_0x9da0('0x4'));var db=require(_0x9da0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9da0('0x6'))('rpc');var config=require(_0x9da0('0x7'));var jayson=require(_0x9da0('0x8'));var client=jayson[_0x9da0('0x9')][_0x9da0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bdc03,_0x509dbc,_0x328ede){return new BPromise(function(_0x2a5252,_0x5cc871){return client[_0x9da0('0xb')](_0x3bdc03,_0x328ede)['then'](function(_0x20b342){logger['info'](_0x9da0('0xc'),_0x509dbc,_0x9da0('0xd'));logger[_0x9da0('0xe')](_0x9da0('0xf'),_0x509dbc,_0x9da0('0xd'),JSON[_0x9da0('0x10')](_0x20b342));if(_0x20b342[_0x9da0('0x11')]){if(_0x20b342[_0x9da0('0x11')][_0x9da0('0x12')]===0x1f4){logger[_0x9da0('0x11')](_0x9da0('0xc'),_0x509dbc,_0x20b342[_0x9da0('0x11')][_0x9da0('0x13')]);return _0x5cc871(_0x20b342[_0x9da0('0x11')][_0x9da0('0x13')]);}logger[_0x9da0('0x11')](_0x9da0('0xc'),_0x509dbc,_0x20b342[_0x9da0('0x11')][_0x9da0('0x13')]);return _0x2a5252(_0x20b342[_0x9da0('0x11')][_0x9da0('0x13')]);}else{logger[_0x9da0('0x14')](_0x9da0('0xc'),_0x509dbc,_0x9da0('0xd'));_0x2a5252(_0x20b342[_0x9da0('0x15')]['message']);}})[_0x9da0('0x16')](function(_0x6c2ebe){logger['error'](_0x9da0('0xc'),_0x509dbc,_0x6c2ebe);_0x5cc871(_0x6c2ebe);});});}exports[_0x9da0('0x17')]=function(_0x6c28ce){var _0x14ea73=this;return new Promise(function(_0x116b68,_0x374b9e){return db['FaxQueueReport'][_0x9da0('0x18')](_0x6c28ce[_0x9da0('0x19')],{'raw':_0x6c28ce[_0x9da0('0x1a')]?_0x6c28ce[_0x9da0('0x1a')][_0x9da0('0x1b')]===undefined?!![]:![]:!![]})[_0x9da0('0x1c')](function(_0x23ee30){logger[_0x9da0('0x14')](_0x9da0('0x17'),_0x6c28ce);logger[_0x9da0('0xe')]('CreateFaxQueueReport',_0x6c28ce,JSON[_0x9da0('0x10')](_0x23ee30));_0x116b68(_0x23ee30);})[_0x9da0('0x16')](function(_0x5c55dd){logger[_0x9da0('0x11')](_0x9da0('0x17'),_0x5c55dd[_0x9da0('0x13')],_0x6c28ce);_0x374b9e(_0x14ea73[_0x9da0('0x11')](0x1f4,_0x5c55dd[_0x9da0('0x13')]));});});};exports[_0x9da0('0x1d')]=function(_0x2c09e1){var _0x2682de=this;return new Promise(function(_0x5ef5f2,_0xf232b9){return db[_0x9da0('0x1e')][_0x9da0('0x1f')](_0x2c09e1[_0x9da0('0x19')],{'raw':_0x2c09e1[_0x9da0('0x1a')]?_0x2c09e1[_0x9da0('0x1a')][_0x9da0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c09e1[_0x9da0('0x1a')]?_0x2c09e1[_0x9da0('0x1a')][_0x9da0('0x20')]||null:null,'attributes':_0x2c09e1['options']?_0x2c09e1[_0x9da0('0x1a')]['attributes']||null:null,'limit':_0x2c09e1['options']?_0x2c09e1['options']['limit']||null:null})[_0x9da0('0x1c')](function(_0x1a497e){logger[_0x9da0('0x14')](_0x9da0('0x1d'),_0x2c09e1);logger[_0x9da0('0xe')]('UpdateFaxQueueReport',_0x2c09e1,JSON[_0x9da0('0x10')](_0x1a497e));_0x5ef5f2(_0x1a497e);})[_0x9da0('0x16')](function(_0x25d634){logger[_0x9da0('0x11')]('UpdateFaxQueueReport',_0x25d634[_0x9da0('0x13')],_0x2c09e1);_0xf232b9(_0x2682de['error'](0x1f4,_0x25d634[_0x9da0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 0cf5291..d1dfbdf 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 _0x39e7=['Router','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3bc598,_0x388250){var _0x1a75f0=function(_0x5c2924){while(--_0x5c2924){_0x3bc598['push'](_0x3bc598['shift']());}};_0x1a75f0(++_0x388250);}(_0x39e7,0x93));var _0x739e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x39e7[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x739e('0x0'));var util=require(_0x739e('0x1'));var path=require(_0x739e('0x2'));var timeout=require(_0x739e('0x3'));var express=require(_0x739e('0x4'));var router=express[_0x739e('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x739e('0x6'));var controller=require('./faxQueueReport.controller');router[_0x739e('0x7')]('/',auth[_0x739e('0x8')](),controller[_0x739e('0x9')]);router[_0x739e('0x7')](_0x739e('0xa'),auth[_0x739e('0x8')](),controller[_0x739e('0xb')]);router['get'](_0x739e('0xc'),auth[_0x739e('0x8')](),controller[_0x739e('0xd')]);router['post']('/',auth[_0x739e('0x8')](),controller['create']);router[_0x739e('0xe')](_0x739e('0xc'),auth[_0x739e('0x8')](),controller[_0x739e('0xf')]);router[_0x739e('0x10')](_0x739e('0xc'),auth[_0x739e('0x8')](),controller[_0x739e('0x11')]);module[_0x739e('0x12')]=router; \ No newline at end of file +var _0xcdff=['get','isAuthenticated','index','describe','show','put','/:id','update','delete','destroy','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./faxQueueReport.controller'];(function(_0x20d0f3,_0x3b891e){var _0xb05963=function(_0x1f2d3b){while(--_0x1f2d3b){_0x20d0f3['push'](_0x20d0f3['shift']());}};_0xb05963(++_0x3b891e);}(_0xcdff,0x173));var _0xfcdf=function(_0x389717,_0x40633c){_0x389717=_0x389717-0x0;var _0x360dc2=_0xcdff[_0x389717];return _0x360dc2;};'use strict';var multer=require(_0xfcdf('0x0'));var util=require(_0xfcdf('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfcdf('0x2'));var router=express[_0xfcdf('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xfcdf('0x4'));var config=require(_0xfcdf('0x5'));var controller=require(_0xfcdf('0x6'));router[_0xfcdf('0x7')]('/',auth[_0xfcdf('0x8')](),controller[_0xfcdf('0x9')]);router[_0xfcdf('0x7')]('/describe',auth[_0xfcdf('0x8')](),controller[_0xfcdf('0xa')]);router['get']('/:id',auth[_0xfcdf('0x8')](),controller[_0xfcdf('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xfcdf('0xc')](_0xfcdf('0xd'),auth[_0xfcdf('0x8')](),controller[_0xfcdf('0xe')]);router[_0xfcdf('0xf')](_0xfcdf('0xd'),auth[_0xfcdf('0x8')](),controller[_0xfcdf('0x10')]);module[_0xfcdf('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index be79cfd..939c382 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 _0x8563=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x283c0b,_0x3ec8e0){var _0x534c59=function(_0x4a6cf2){while(--_0x4a6cf2){_0x283c0b['push'](_0x283c0b['shift']());}};_0x534c59(++_0x3ec8e0);}(_0x8563,0x67));var _0x3856=function(_0x39866a,_0xcd7493){_0x39866a=_0x39866a-0x0;var _0x29ccbe=_0x8563[_0x39866a];return _0x29ccbe;};'use strict';var moment=require(_0x3856('0x0'));var Sequelize=require(_0x3856('0x1'));module[_0x3856('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x3856('0x3')](_0x3856('0x4'),_0x3856('0x5'),_0x3856('0x6')),'allowNull':![],'defaultValue':_0x3856('0x6')},'transferredAt':{'type':Sequelize[_0x3856('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x3856('0x8')]}}; \ No newline at end of file +var _0xee75=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0xee75,0x1c4));var _0x5ee7=function(_0x9dc6e3,_0x297239){_0x9dc6e3=_0x9dc6e3-0x0;var _0x435a17=_0xee75[_0x9dc6e3];return _0x435a17;};'use strict';var moment=require(_0x5ee7('0x0'));var Sequelize=require(_0x5ee7('0x1'));module[_0x5ee7('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x5ee7('0x3')]('account',_0x5ee7('0x4'),_0x5ee7('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x5ee7('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x5ee7('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 9f22b64..c5655b3 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 _0xe886=['rows','catch','show','params','keys','rawAttributes','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','index','map','FaxTransferReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll'];(function(_0x4c5bf0,_0x5db1a4){var _0xbc103f=function(_0x2a9607){while(--_0x2a9607){_0x4c5bf0['push'](_0x4c5bf0['shift']());}};_0xbc103f(++_0x5db1a4);}(_0xe886,0x13a));var _0x6e88=function(_0x5cdd5a,_0xb86805){_0x5cdd5a=_0x5cdd5a-0x0;var _0x12a715=_0xe886[_0x5cdd5a];return _0x12a715;};'use strict';var pdf=require(_0x6e88('0x0'));var emlformat=require(_0x6e88('0x1'));var rimraf=require(_0x6e88('0x2'));var zipdir=require(_0x6e88('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e88('0x4'));var moment=require(_0x6e88('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6e88('0x6'));var util=require(_0x6e88('0x7'));var path=require('path');var sox=require(_0x6e88('0x8'));var csv=require(_0x6e88('0x9'));var ejs=require(_0x6e88('0xa'));var fs=require('fs');var _=require(_0x6e88('0xb'));var squel=require('squel');var crypto=require(_0x6e88('0xc'));var jsforce=require(_0x6e88('0xd'));var deskjs=require(_0x6e88('0xe'));var toCsv=require(_0x6e88('0x9'));var querystring=require(_0x6e88('0xf'));var Papa=require('papaparse');var Redis=require(_0x6e88('0x10'));var authService=require(_0x6e88('0x11'));var qs=require(_0x6e88('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6e88('0x13'));var logger=require('../../config/logger')(_0x6e88('0x14'));var utils=require(_0x6e88('0x15'));var config=require(_0x6e88('0x16'));var db=require(_0x6e88('0x17'))['db'];function respondWithStatusCode(_0x2f8c9f,_0x426d24){_0x426d24=_0x426d24||0xcc;return function(_0x15ae0a){if(_0x15ae0a){return _0x2f8c9f[_0x6e88('0x18')](_0x426d24);}return _0x2f8c9f[_0x6e88('0x19')](_0x426d24)['end']();};}function respondWithResult(_0xf9dec,_0x16a714){_0x16a714=_0x16a714||0xc8;return function(_0x4e93c3){if(_0x4e93c3){return _0xf9dec[_0x6e88('0x19')](_0x16a714)[_0x6e88('0x1a')](_0x4e93c3);}};}function respondWithFilteredResult(_0x2aadb6,_0x4bf29c){return function(_0x54fce0){if(_0x54fce0){var _0x5b7d55=_0x54fce0[_0x6e88('0x1b')],_0x59d60e=_0x4bf29c[_0x6e88('0x1c')],_0x2a3b10=_0x4bf29c[_0x6e88('0x1c')]+_0x4bf29c['limit'],_0x363446;if(_0x2a3b10>=_0x5b7d55){_0x2a3b10=_0x5b7d55;_0x363446=0xc8;}else{_0x363446=0xce;}_0x2aadb6[_0x6e88('0x19')](_0x363446);return _0x2aadb6[_0x6e88('0x1d')](_0x6e88('0x1e'),_0x59d60e+'-'+_0x2a3b10+'/'+_0x5b7d55)[_0x6e88('0x1a')](_0x54fce0);}return null;};}function patchUpdates(_0x43b0a4){return function(_0x1b5c03){try{jsonpatch[_0x6e88('0x1f')](_0x1b5c03,_0x43b0a4,!![]);}catch(_0x2b885c){return BPromise[_0x6e88('0x20')](_0x2b885c);}return _0x1b5c03[_0x6e88('0x21')]();};}function saveUpdates(_0x4d7666,_0x351a55){return function(_0x167bdf){if(_0x167bdf){return _0x167bdf[_0x6e88('0x22')](_0x4d7666)[_0x6e88('0x23')](function(_0x306a9e){return _0x306a9e;});}return null;};}function removeEntity(_0x264cf6,_0x454722){return function(_0x4aed9f){if(_0x4aed9f){return _0x4aed9f[_0x6e88('0x24')]()['then'](function(){_0x264cf6[_0x6e88('0x19')](0xcc)[_0x6e88('0x25')]();});}};}function handleEntityNotFound(_0x51aa51,_0x5d0c61){return function(_0x37feec){if(!_0x37feec){_0x51aa51['sendStatus'](0x194);}return _0x37feec;};}function handleError(_0x28066e,_0x245e83){_0x245e83=_0x245e83||0x1f4;return function(_0x2b056c){logger['error'](_0x2b056c['stack']);if(_0x2b056c[_0x6e88('0x26')]){delete _0x2b056c[_0x6e88('0x26')];}_0x28066e[_0x6e88('0x19')](_0x245e83)[_0x6e88('0x27')](_0x2b056c);};}exports[_0x6e88('0x28')]=function(_0x3e6fd3,_0x274668){var _0x5c456d={},_0x3e1b70={},_0x4bcfee={'count':0x0,'rows':[]};var _0x2b9c20=_[_0x6e88('0x29')](db[_0x6e88('0x2a')]['rawAttributes'],function(_0xa61aee){return{'name':_0xa61aee[_0x6e88('0x2b')],'type':_0xa61aee[_0x6e88('0x2c')][_0x6e88('0x2d')]};});_0x3e1b70[_0x6e88('0x2e')]=_['map'](_0x2b9c20,_0x6e88('0x26'));_0x3e1b70[_0x6e88('0x2f')]=_['keys'](_0x3e6fd3[_0x6e88('0x2f')]);_0x3e1b70[_0x6e88('0x30')]=_[_0x6e88('0x31')](_0x3e1b70[_0x6e88('0x2e')],_0x3e1b70[_0x6e88('0x2f')]);_0x5c456d[_0x6e88('0x32')]=_['intersection'](_0x3e1b70[_0x6e88('0x2e')],qs[_0x6e88('0x33')](_0x3e6fd3[_0x6e88('0x2f')]['fields']));_0x5c456d[_0x6e88('0x32')]=_0x5c456d[_0x6e88('0x32')][_0x6e88('0x34')]?_0x5c456d[_0x6e88('0x32')]:_0x3e1b70[_0x6e88('0x2e')];if(!_0x3e6fd3[_0x6e88('0x2f')][_0x6e88('0x35')](_0x6e88('0x36'))){_0x5c456d[_0x6e88('0x37')]=qs['limit'](_0x3e6fd3[_0x6e88('0x2f')][_0x6e88('0x37')]);_0x5c456d[_0x6e88('0x1c')]=qs[_0x6e88('0x1c')](_0x3e6fd3[_0x6e88('0x2f')][_0x6e88('0x1c')]);}_0x5c456d[_0x6e88('0x38')]=qs[_0x6e88('0x39')](_0x3e6fd3[_0x6e88('0x2f')][_0x6e88('0x39')]);_0x5c456d['where']=qs[_0x6e88('0x30')](_[_0x6e88('0x3a')](_0x3e6fd3['query'],_0x3e1b70[_0x6e88('0x30')]));if(_0x3e6fd3[_0x6e88('0x2f')][_0x6e88('0x3b')]){_0x5c456d['where']=_[_0x6e88('0x3c')](_0x5c456d[_0x6e88('0x3d')],{'$or':_[_0x6e88('0x29')](_0x2b9c20,function(_0x32b607){if(_0x32b607['type']!==_0x6e88('0x3e')){var _0x1ee647={};_0x1ee647[_0x32b607[_0x6e88('0x26')]]={'$like':'%'+_0x3e6fd3[_0x6e88('0x2f')]['filter']+'%'};return _0x1ee647;}})});}_0x5c456d=_[_0x6e88('0x3c')]({},_0x5c456d,_0x3e6fd3[_0x6e88('0x3f')]);var _0xd2d4c4={'where':_0x5c456d['where']};return db[_0x6e88('0x2a')][_0x6e88('0x1b')](_0xd2d4c4)[_0x6e88('0x23')](function(_0x4009d1){_0x4bcfee[_0x6e88('0x1b')]=_0x4009d1;if(_0x3e6fd3[_0x6e88('0x2f')][_0x6e88('0x40')]){_0x5c456d['include']=[{'all':!![]}];}return db[_0x6e88('0x2a')][_0x6e88('0x41')](_0x5c456d);})['then'](function(_0xf78922){_0x4bcfee[_0x6e88('0x42')]=_0xf78922;return _0x4bcfee;})[_0x6e88('0x23')](respondWithFilteredResult(_0x274668,_0x5c456d))[_0x6e88('0x43')](handleError(_0x274668,null));};exports[_0x6e88('0x44')]=function(_0x13ff83,_0x52dca2){var _0x304901={'raw':!![],'where':{'id':_0x13ff83[_0x6e88('0x45')]['id']}},_0x285862={};_0x285862['model']=_[_0x6e88('0x46')](db[_0x6e88('0x2a')][_0x6e88('0x47')]);_0x285862[_0x6e88('0x2f')]=_[_0x6e88('0x46')](_0x13ff83[_0x6e88('0x2f')]);_0x285862[_0x6e88('0x30')]=_[_0x6e88('0x31')](_0x285862[_0x6e88('0x2e')],_0x285862[_0x6e88('0x2f')]);_0x304901[_0x6e88('0x32')]=_[_0x6e88('0x31')](_0x285862[_0x6e88('0x2e')],qs[_0x6e88('0x33')](_0x13ff83[_0x6e88('0x2f')][_0x6e88('0x33')]));_0x304901[_0x6e88('0x32')]=_0x304901[_0x6e88('0x32')]['length']?_0x304901[_0x6e88('0x32')]:_0x285862[_0x6e88('0x2e')];if(_0x13ff83['query'][_0x6e88('0x40')]){_0x304901['include']=[{'all':!![]}];}_0x304901=_['merge']({},_0x304901,_0x13ff83[_0x6e88('0x3f')]);return db['FaxTransferReport']['find'](_0x304901)['then'](handleEntityNotFound(_0x52dca2,null))[_0x6e88('0x23')](respondWithResult(_0x52dca2,null))[_0x6e88('0x43')](handleError(_0x52dca2,null));};exports[_0x6e88('0x48')]=function(_0x455e71,_0x5292d9){return db['FaxTransferReport'][_0x6e88('0x48')](_0x455e71[_0x6e88('0x49')],{})['then'](respondWithResult(_0x5292d9,0xc9))[_0x6e88('0x43')](handleError(_0x5292d9,null));};exports[_0x6e88('0x22')]=function(_0x25745c,_0x48f7ca){if(_0x25745c['body']['id']){delete _0x25745c[_0x6e88('0x49')]['id'];}return db['FaxTransferReport'][_0x6e88('0x4a')]({'where':{'id':_0x25745c[_0x6e88('0x45')]['id']}})[_0x6e88('0x23')](handleEntityNotFound(_0x48f7ca,null))[_0x6e88('0x23')](saveUpdates(_0x25745c[_0x6e88('0x49')],null))[_0x6e88('0x23')](respondWithResult(_0x48f7ca,null))[_0x6e88('0x43')](handleError(_0x48f7ca,null));};exports[_0x6e88('0x24')]=function(_0x475d57,_0x2eb870){return db[_0x6e88('0x2a')]['find']({'where':{'id':_0x475d57[_0x6e88('0x45')]['id']}})['then'](handleEntityNotFound(_0x2eb870,null))['then'](removeEntity(_0x2eb870,null))['catch'](handleError(_0x2eb870,null));};exports[_0x6e88('0x4b')]=function(_0x2f89dd,_0x563a85){return db[_0x6e88('0x2a')][_0x6e88('0x4b')]()[_0x6e88('0x23')](respondWithResult(_0x563a85,null))['catch'](handleError(_0x563a85,null));}; \ No newline at end of file +var _0x1d25=['body','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','catch','show','merge','find','create'];(function(_0x1fb7d1,_0x108781){var _0x2480d8=function(_0x9bc3d9){while(--_0x9bc3d9){_0x1fb7d1['push'](_0x1fb7d1['shift']());}};_0x2480d8(++_0x108781);}(_0x1d25,0x11b));var _0x51d2=function(_0x1d2bbb,_0x202267){_0x1d2bbb=_0x1d2bbb-0x0;var _0x38082b=_0x1d25[_0x1d2bbb];return _0x38082b;};'use strict';var pdf=require(_0x51d2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x51d2('0x1'));var zipdir=require(_0x51d2('0x2'));var jsonpatch=require(_0x51d2('0x3'));var rp=require(_0x51d2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51d2('0x5'));var util=require('util');var path=require(_0x51d2('0x6'));var sox=require(_0x51d2('0x7'));var csv=require(_0x51d2('0x8'));var ejs=require(_0x51d2('0x9'));var fs=require('fs');var _=require(_0x51d2('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x51d2('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x51d2('0xc'));var Papa=require('papaparse');var Redis=require(_0x51d2('0xd'));var authService=require(_0x51d2('0xe'));var qs=require(_0x51d2('0xf'));var as=require(_0x51d2('0x10'));var hardwareService=require(_0x51d2('0x11'));var logger=require(_0x51d2('0x12'))(_0x51d2('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f0129,_0x284d97){_0x284d97=_0x284d97||0xcc;return function(_0x277e28){if(_0x277e28){return _0x2f0129[_0x51d2('0x14')](_0x284d97);}return _0x2f0129[_0x51d2('0x15')](_0x284d97)[_0x51d2('0x16')]();};}function respondWithResult(_0x854fd5,_0x2fc389){_0x2fc389=_0x2fc389||0xc8;return function(_0x327ef9){if(_0x327ef9){return _0x854fd5[_0x51d2('0x15')](_0x2fc389)[_0x51d2('0x17')](_0x327ef9);}};}function respondWithFilteredResult(_0x4ae137,_0x569e2b){return function(_0x54a99a){if(_0x54a99a){var _0x104145=_0x54a99a[_0x51d2('0x18')],_0xa3eeec=_0x569e2b[_0x51d2('0x19')],_0x3ba14f=_0x569e2b[_0x51d2('0x19')]+_0x569e2b[_0x51d2('0x1a')],_0xb8043a;if(_0x3ba14f>=_0x104145){_0x3ba14f=_0x104145;_0xb8043a=0xc8;}else{_0xb8043a=0xce;}_0x4ae137[_0x51d2('0x15')](_0xb8043a);return _0x4ae137[_0x51d2('0x1b')]('Content-Range',_0xa3eeec+'-'+_0x3ba14f+'/'+_0x104145)[_0x51d2('0x17')](_0x54a99a);}return null;};}function patchUpdates(_0xaa3b19){return function(_0x5140dd){try{jsonpatch[_0x51d2('0x1c')](_0x5140dd,_0xaa3b19,!![]);}catch(_0x908ef1){return BPromise[_0x51d2('0x1d')](_0x908ef1);}return _0x5140dd[_0x51d2('0x1e')]();};}function saveUpdates(_0xbd0e05,_0x377f22){return function(_0x192f33){if(_0x192f33){return _0x192f33[_0x51d2('0x1f')](_0xbd0e05)[_0x51d2('0x20')](function(_0x38cbce){return _0x38cbce;});}return null;};}function removeEntity(_0x465d9f,_0x12679f){return function(_0x78c0dc){if(_0x78c0dc){return _0x78c0dc[_0x51d2('0x21')]()[_0x51d2('0x20')](function(){_0x465d9f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5203ca,_0x16337e){return function(_0x43412d){if(!_0x43412d){_0x5203ca['sendStatus'](0x194);}return _0x43412d;};}function handleError(_0x564def,_0xcea5d9){_0xcea5d9=_0xcea5d9||0x1f4;return function(_0x332ea8){logger[_0x51d2('0x22')](_0x332ea8[_0x51d2('0x23')]);if(_0x332ea8[_0x51d2('0x24')]){delete _0x332ea8['name'];}_0x564def['status'](_0xcea5d9)[_0x51d2('0x25')](_0x332ea8);};}exports['index']=function(_0x4fb377,_0x7dd941){var _0x4664a7={},_0x3c87ae={},_0x53cf87={'count':0x0,'rows':[]};var _0x3accee=_[_0x51d2('0x26')](db[_0x51d2('0x27')][_0x51d2('0x28')],function(_0x17c283){return{'name':_0x17c283[_0x51d2('0x29')],'type':_0x17c283[_0x51d2('0x2a')][_0x51d2('0x2b')]};});_0x3c87ae[_0x51d2('0x2c')]=_[_0x51d2('0x26')](_0x3accee,'name');_0x3c87ae[_0x51d2('0x2d')]=_[_0x51d2('0x2e')](_0x4fb377[_0x51d2('0x2d')]);_0x3c87ae[_0x51d2('0x2f')]=_['intersection'](_0x3c87ae[_0x51d2('0x2c')],_0x3c87ae[_0x51d2('0x2d')]);_0x4664a7[_0x51d2('0x30')]=_[_0x51d2('0x31')](_0x3c87ae[_0x51d2('0x2c')],qs[_0x51d2('0x32')](_0x4fb377[_0x51d2('0x2d')]['fields']));_0x4664a7[_0x51d2('0x30')]=_0x4664a7['attributes']['length']?_0x4664a7[_0x51d2('0x30')]:_0x3c87ae[_0x51d2('0x2c')];if(!_0x4fb377[_0x51d2('0x2d')][_0x51d2('0x33')](_0x51d2('0x34'))){_0x4664a7[_0x51d2('0x1a')]=qs[_0x51d2('0x1a')](_0x4fb377[_0x51d2('0x2d')][_0x51d2('0x1a')]);_0x4664a7['offset']=qs[_0x51d2('0x19')](_0x4fb377['query']['offset']);}_0x4664a7[_0x51d2('0x35')]=qs[_0x51d2('0x36')](_0x4fb377['query'][_0x51d2('0x36')]);_0x4664a7[_0x51d2('0x37')]=qs['filters'](_[_0x51d2('0x38')](_0x4fb377['query'],_0x3c87ae[_0x51d2('0x2f')]));if(_0x4fb377[_0x51d2('0x2d')][_0x51d2('0x39')]){_0x4664a7[_0x51d2('0x37')]=_['merge'](_0x4664a7[_0x51d2('0x37')],{'$or':_[_0x51d2('0x26')](_0x3accee,function(_0x4ddbad){if(_0x4ddbad[_0x51d2('0x2a')]!==_0x51d2('0x3a')){var _0x5783c0={};_0x5783c0[_0x4ddbad[_0x51d2('0x24')]]={'$like':'%'+_0x4fb377[_0x51d2('0x2d')][_0x51d2('0x39')]+'%'};return _0x5783c0;}})});}_0x4664a7=_['merge']({},_0x4664a7,_0x4fb377[_0x51d2('0x3b')]);var _0x5b3509={'where':_0x4664a7[_0x51d2('0x37')]};return db[_0x51d2('0x27')][_0x51d2('0x18')](_0x5b3509)[_0x51d2('0x20')](function(_0x2bb2b3){_0x53cf87[_0x51d2('0x18')]=_0x2bb2b3;if(_0x4fb377['query']['includeAll']){_0x4664a7[_0x51d2('0x3c')]=[{'all':!![]}];}return db[_0x51d2('0x27')][_0x51d2('0x3d')](_0x4664a7);})[_0x51d2('0x20')](function(_0x48c847){_0x53cf87['rows']=_0x48c847;return _0x53cf87;})[_0x51d2('0x20')](respondWithFilteredResult(_0x7dd941,_0x4664a7))[_0x51d2('0x3e')](handleError(_0x7dd941,null));};exports[_0x51d2('0x3f')]=function(_0x55bdc1,_0x16da5f){var _0x5d7a9a={'raw':!![],'where':{'id':_0x55bdc1['params']['id']}},_0xf45458={};_0xf45458[_0x51d2('0x2c')]=_[_0x51d2('0x2e')](db['FaxTransferReport'][_0x51d2('0x28')]);_0xf45458[_0x51d2('0x2d')]=_[_0x51d2('0x2e')](_0x55bdc1[_0x51d2('0x2d')]);_0xf45458['filters']=_[_0x51d2('0x31')](_0xf45458['model'],_0xf45458[_0x51d2('0x2d')]);_0x5d7a9a[_0x51d2('0x30')]=_[_0x51d2('0x31')](_0xf45458[_0x51d2('0x2c')],qs[_0x51d2('0x32')](_0x55bdc1[_0x51d2('0x2d')][_0x51d2('0x32')]));_0x5d7a9a[_0x51d2('0x30')]=_0x5d7a9a[_0x51d2('0x30')]['length']?_0x5d7a9a[_0x51d2('0x30')]:_0xf45458[_0x51d2('0x2c')];if(_0x55bdc1[_0x51d2('0x2d')]['includeAll']){_0x5d7a9a[_0x51d2('0x3c')]=[{'all':!![]}];}_0x5d7a9a=_[_0x51d2('0x40')]({},_0x5d7a9a,_0x55bdc1['options']);return db[_0x51d2('0x27')][_0x51d2('0x41')](_0x5d7a9a)[_0x51d2('0x20')](handleEntityNotFound(_0x16da5f,null))[_0x51d2('0x20')](respondWithResult(_0x16da5f,null))[_0x51d2('0x3e')](handleError(_0x16da5f,null));};exports[_0x51d2('0x42')]=function(_0x2750be,_0x50b3f2){return db[_0x51d2('0x27')][_0x51d2('0x42')](_0x2750be[_0x51d2('0x43')],{})[_0x51d2('0x20')](respondWithResult(_0x50b3f2,0xc9))[_0x51d2('0x3e')](handleError(_0x50b3f2,null));};exports[_0x51d2('0x1f')]=function(_0x453162,_0x1ecc4d){if(_0x453162[_0x51d2('0x43')]['id']){delete _0x453162[_0x51d2('0x43')]['id'];}return db[_0x51d2('0x27')][_0x51d2('0x41')]({'where':{'id':_0x453162[_0x51d2('0x44')]['id']}})[_0x51d2('0x20')](handleEntityNotFound(_0x1ecc4d,null))['then'](saveUpdates(_0x453162[_0x51d2('0x43')],null))[_0x51d2('0x20')](respondWithResult(_0x1ecc4d,null))[_0x51d2('0x3e')](handleError(_0x1ecc4d,null));};exports['destroy']=function(_0xbf42c2,_0x4f8ec8){return db[_0x51d2('0x27')][_0x51d2('0x41')]({'where':{'id':_0xbf42c2[_0x51d2('0x44')]['id']}})['then'](handleEntityNotFound(_0x4f8ec8,null))[_0x51d2('0x20')](removeEntity(_0x4f8ec8,null))[_0x51d2('0x3e')](handleError(_0x4f8ec8,null));};exports[_0x51d2('0x45')]=function(_0x1222db,_0xedc5b0){return db[_0x51d2('0x27')][_0x51d2('0x45')]()[_0x51d2('0x20')](respondWithResult(_0xedc5b0,null))[_0x51d2('0x3e')](handleError(_0xedc5b0,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index f356013..ef65593 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 _0xc90a=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid'];(function(_0x570077,_0x3086b9){var _0x4ec6f6=function(_0x27e694){while(--_0x27e694){_0x570077['push'](_0x570077['shift']());}};_0x4ec6f6(++_0x3086b9);}(_0xc90a,0x188));var _0xac90=function(_0x2af459,_0x1f0619){_0x2af459=_0x2af459-0x0;var _0x3a3c1b=_0xc90a[_0x2af459];return _0x3a3c1b;};'use strict';var _=require(_0xac90('0x0'));var util=require(_0xac90('0x1'));var logger=require(_0xac90('0x2'))('api');var moment=require('moment');var BPromise=require(_0xac90('0x3'));var rp=require(_0xac90('0x4'));var fs=require('fs');var path=require(_0xac90('0x5'));var rimraf=require(_0xac90('0x6'));var config=require(_0xac90('0x7'));var attributes=require(_0xac90('0x8'));module[_0xac90('0x9')]=function(_0x36b61b,_0x42f634){return _0x36b61b[_0xac90('0xa')](_0xac90('0xb'),attributes,{'tableName':_0xac90('0xc'),'paranoid':![],'indexes':[{'name':_0xac90('0xd'),'fields':[_0xac90('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x38d8=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxTransferReport.attributes','exports','define','report_fax_transfer','uniqueid','lodash'];(function(_0x265eff,_0x4d0ac1){var _0x31b8ce=function(_0x49ea4b){while(--_0x49ea4b){_0x265eff['push'](_0x265eff['shift']());}};_0x31b8ce(++_0x4d0ac1);}(_0x38d8,0x14f));var _0x838d=function(_0x20229e,_0xa59f8a){_0x20229e=_0x20229e-0x0;var _0x317377=_0x38d8[_0x20229e];return _0x317377;};'use strict';var _=require(_0x838d('0x0'));var util=require(_0x838d('0x1'));var logger=require(_0x838d('0x2'))(_0x838d('0x3'));var moment=require(_0x838d('0x4'));var BPromise=require(_0x838d('0x5'));var rp=require(_0x838d('0x6'));var fs=require('fs');var path=require(_0x838d('0x7'));var rimraf=require(_0x838d('0x8'));var config=require('../../config/environment');var attributes=require(_0x838d('0x9'));module[_0x838d('0xa')]=function(_0x20235b,_0x554987){return _0x20235b[_0x838d('0xb')]('FaxTransferReport',attributes,{'tableName':_0x838d('0xc'),'paranoid':![],'indexes':[{'name':_0x838d('0xd'),'fields':[_0x838d('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 348bcd9..e1b4c3a 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 _0xeeb3=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message'];(function(_0x5cd3bf,_0x69dc7c){var _0x11ed4a=function(_0x3ef610){while(--_0x3ef610){_0x5cd3bf['push'](_0x5cd3bf['shift']());}};_0x11ed4a(++_0x69dc7c);}(_0xeeb3,0x104));var _0x3eeb=function(_0x505255,_0x58a043){_0x505255=_0x505255-0x0;var _0x5001e0=_0xeeb3[_0x505255];return _0x5001e0;};'use strict';var _=require(_0x3eeb('0x0'));var util=require('util');var moment=require(_0x3eeb('0x1'));var BPromise=require(_0x3eeb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3eeb('0x3'));var db=require(_0x3eeb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3eeb('0x5'))(_0x3eeb('0x6'));var config=require(_0x3eeb('0x7'));var jayson=require(_0x3eeb('0x8'));var client=jayson[_0x3eeb('0x9')][_0x3eeb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2eaf44,_0x17ce6e,_0x1a1524){return new BPromise(function(_0x1b2ea2,_0x3d89fb){return client[_0x3eeb('0xb')](_0x2eaf44,_0x1a1524)['then'](function(_0x5014af){logger[_0x3eeb('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x17ce6e,_0x3eeb('0xd'));logger[_0x3eeb('0xe')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x17ce6e,_0x3eeb('0xd'),JSON[_0x3eeb('0xf')](_0x5014af));if(_0x5014af[_0x3eeb('0x10')]){if(_0x5014af[_0x3eeb('0x10')][_0x3eeb('0x11')]===0x1f4){logger[_0x3eeb('0x10')](_0x3eeb('0x12'),_0x17ce6e,_0x5014af[_0x3eeb('0x10')][_0x3eeb('0x13')]);return _0x3d89fb(_0x5014af['error']['message']);}logger[_0x3eeb('0x10')](_0x3eeb('0x12'),_0x17ce6e,_0x5014af[_0x3eeb('0x10')][_0x3eeb('0x13')]);return _0x1b2ea2(_0x5014af['error']['message']);}else{logger[_0x3eeb('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x17ce6e,_0x3eeb('0xd'));_0x1b2ea2(_0x5014af['result']['message']);}})['catch'](function(_0x20d802){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x17ce6e,_0x20d802);_0x3d89fb(_0x20d802);});});} \ No newline at end of file +var _0xceb4=['error','message','info','catch','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1ca4df,_0x29417c){var _0x241d90=function(_0x4dd62d){while(--_0x4dd62d){_0x1ca4df['push'](_0x1ca4df['shift']());}};_0x241d90(++_0x29417c);}(_0xceb4,0x100));var _0x4ceb=function(_0x415ba5,_0x54bcc0){_0x415ba5=_0x415ba5-0x0;var _0x30423e=_0xceb4[_0x415ba5];return _0x30423e;};'use strict';var _=require('lodash');var util=require(_0x4ceb('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4ceb('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4ceb('0x2'));var logger=require(_0x4ceb('0x3'))(_0x4ceb('0x4'));var config=require(_0x4ceb('0x5'));var jayson=require(_0x4ceb('0x6'));var client=jayson['client'][_0x4ceb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4e3316,_0x46a40c,_0x353d55){return new BPromise(function(_0x4fafbc,_0x36f015){return client[_0x4ceb('0x8')](_0x4e3316,_0x353d55)['then'](function(_0x329e7d){logger['info'](_0x4ceb('0x9'),_0x46a40c,_0x4ceb('0xa'));logger[_0x4ceb('0xb')](_0x4ceb('0xc'),_0x46a40c,_0x4ceb('0xa'),JSON[_0x4ceb('0xd')](_0x329e7d));if(_0x329e7d[_0x4ceb('0xe')]){if(_0x329e7d[_0x4ceb('0xe')]['code']===0x1f4){logger[_0x4ceb('0xe')](_0x4ceb('0x9'),_0x46a40c,_0x329e7d['error'][_0x4ceb('0xf')]);return _0x36f015(_0x329e7d[_0x4ceb('0xe')]['message']);}logger[_0x4ceb('0xe')](_0x4ceb('0x9'),_0x46a40c,_0x329e7d[_0x4ceb('0xe')]['message']);return _0x4fafbc(_0x329e7d['error']['message']);}else{logger[_0x4ceb('0x10')](_0x4ceb('0x9'),_0x46a40c,_0x4ceb('0xa'));_0x4fafbc(_0x329e7d['result'][_0x4ceb('0xf')]);}})[_0x4ceb('0x11')](function(_0x3054bb){logger[_0x4ceb('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x46a40c,_0x3054bb);_0x36f015(_0x3054bb);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 2bd3bda..941bf29 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 _0x201c=['describe','/:id','show','put','update','delete','destroy','exports','connect-timeout','Router','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated'];(function(_0x1d5ba8,_0x412a52){var _0x1022a2=function(_0x187f11){while(--_0x187f11){_0x1d5ba8['push'](_0x1d5ba8['shift']());}};_0x1022a2(++_0x412a52);}(_0x201c,0x1e4));var _0xc201=function(_0x465f84,_0x27e25d){_0x465f84=_0x465f84-0x0;var _0x5c8432=_0x201c[_0x465f84];return _0x5c8432;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xc201('0x0'));var express=require('express');var router=express[_0xc201('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xc201('0x2'));var config=require('../../config/environment');var controller=require(_0xc201('0x3'));router[_0xc201('0x4')]('/',auth[_0xc201('0x5')](),controller['index']);router[_0xc201('0x4')]('/describe',auth[_0xc201('0x5')](),controller[_0xc201('0x6')]);router[_0xc201('0x4')](_0xc201('0x7'),auth[_0xc201('0x5')](),controller[_0xc201('0x8')]);router['post']('/',auth[_0xc201('0x5')](),controller['create']);router[_0xc201('0x9')](_0xc201('0x7'),auth[_0xc201('0x5')](),controller[_0xc201('0xa')]);router[_0xc201('0xb')](_0xc201('0x7'),auth[_0xc201('0x5')](),controller[_0xc201('0xc')]);module[_0xc201('0xd')]=router; \ No newline at end of file +var _0xe3fc=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0x3644b6,_0x2ff036){var _0x155a3b=function(_0x11307d){while(--_0x11307d){_0x3644b6['push'](_0x3644b6['shift']());}};_0x155a3b(++_0x2ff036);}(_0xe3fc,0xa5));var _0xce3f=function(_0x570496,_0x26a150){_0x570496=_0x570496-0x0;var _0x1d4204=_0xe3fc[_0x570496];return _0x1d4204;};'use strict';var multer=require(_0xce3f('0x0'));var util=require(_0xce3f('0x1'));var path=require(_0xce3f('0x2'));var timeout=require(_0xce3f('0x3'));var express=require('express');var router=express[_0xce3f('0x4')]();var auth=require(_0xce3f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xce3f('0x6'));var controller=require(_0xce3f('0x7'));router[_0xce3f('0x8')]('/',auth[_0xce3f('0x9')](),controller['index']);router['get'](_0xce3f('0xa'),auth[_0xce3f('0x9')](),controller[_0xce3f('0xb')]);router['get'](_0xce3f('0xc'),auth['isAuthenticated'](),controller[_0xce3f('0xd')]);router[_0xce3f('0xe')]('/',auth[_0xce3f('0x9')](),controller[_0xce3f('0xf')]);router['put'](_0xce3f('0xc'),auth[_0xce3f('0x9')](),controller[_0xce3f('0x10')]);router[_0xce3f('0x11')](_0xce3f('0xc'),auth['isAuthenticated'](),controller[_0xce3f('0x12')]);module[_0xce3f('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index a78fc12..719b236 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 _0x4300=['destroy','exports','multer','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','get','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','/:id'];(function(_0x4ad6fb,_0x51ca5e){var _0xe278a1=function(_0x1d0e3c){while(--_0x1d0e3c){_0x4ad6fb['push'](_0x4ad6fb['shift']());}};_0xe278a1(++_0x51ca5e);}(_0x4300,0x1a6));var _0x0430=function(_0x39f045,_0x21b2c3){_0x39f045=_0x39f045-0x0;var _0x2b46fa=_0x4300[_0x39f045];return _0x2b46fa;};'use strict';var multer=require(_0x0430('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0430('0x1')]();var auth=require(_0x0430('0x2'));var interaction=require(_0x0430('0x3'));var config=require(_0x0430('0x4'));var controller=require(_0x0430('0x5'));router['get']('/',auth[_0x0430('0x6')](),controller['index']);router[_0x0430('0x7')]('/:id',auth[_0x0430('0x6')](),controller[_0x0430('0x8')]);router[_0x0430('0x7')](_0x0430('0x9'),auth[_0x0430('0x6')](),controller[_0x0430('0xa')]);router[_0x0430('0x7')](_0x0430('0xb'),auth[_0x0430('0x6')](),controller['getFields']);router[_0x0430('0xc')]('/',auth[_0x0430('0x6')](),controller[_0x0430('0xd')]);router[_0x0430('0xc')](_0x0430('0x9'),auth[_0x0430('0x6')](),controller[_0x0430('0xe')]);router[_0x0430('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x0430('0x10')]);router[_0x0430('0x11')](_0x0430('0x12'),auth[_0x0430('0x6')](),controller[_0x0430('0x13')]);module[_0x0430('0x14')]=router; \ No newline at end of file +var _0xef17=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','getFields','post','update','delete'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xef17,0x136));var _0x7ef1=function(_0x45caa5,_0x53ec55){_0x45caa5=_0x45caa5-0x0;var _0x3ead5e=_0xef17[_0x45caa5];return _0x3ead5e;};'use strict';var multer=require(_0x7ef1('0x0'));var util=require(_0x7ef1('0x1'));var path=require(_0x7ef1('0x2'));var timeout=require(_0x7ef1('0x3'));var express=require(_0x7ef1('0x4'));var router=express[_0x7ef1('0x5')]();var auth=require(_0x7ef1('0x6'));var interaction=require(_0x7ef1('0x7'));var config=require(_0x7ef1('0x8'));var controller=require('./intDeskAccount.controller');router[_0x7ef1('0x9')]('/',auth['isAuthenticated'](),controller[_0x7ef1('0xa')]);router['get'](_0x7ef1('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x7ef1('0x9')](_0x7ef1('0xc'),auth['isAuthenticated'](),controller[_0x7ef1('0xd')]);router[_0x7ef1('0x9')](_0x7ef1('0xe'),auth[_0x7ef1('0xf')](),controller[_0x7ef1('0x10')]);router[_0x7ef1('0x11')]('/',auth[_0x7ef1('0xf')](),controller['create']);router['post'](_0x7ef1('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x7ef1('0xb'),auth['isAuthenticated'](),controller[_0x7ef1('0x12')]);router[_0x7ef1('0x13')](_0x7ef1('0xb'),auth[_0x7ef1('0xf')](),controller[_0x7ef1('0x14')]);module[_0x7ef1('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 815387e..9c7d12b 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 _0xa386=['exports','STRING','ENUM','basic','integrationTab','newTab'];(function(_0x369633,_0x263fb9){var _0x1eda8c=function(_0x3b1b46){while(--_0x3b1b46){_0x369633['push'](_0x369633['shift']());}};_0x1eda8c(++_0x263fb9);}(_0xa386,0xcc));var _0x6a38=function(_0x1c30bf,_0x247c31){_0x1c30bf=_0x1c30bf-0x0;var _0x255b5e=_0xa386[_0x1c30bf];return _0x255b5e;};'use strict';var Sequelize=require('sequelize');module[_0x6a38('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6a38('0x1')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x6a38('0x1')]},'authType':{'type':Sequelize[_0x6a38('0x2')](_0x6a38('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x6a38('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x6a38('0x1')]},'tokenSecret':{'type':Sequelize[_0x6a38('0x1')]},'serverUrl':{'type':Sequelize[_0x6a38('0x1')]},'type':{'type':Sequelize[_0x6a38('0x2')](_0x6a38('0x4'),_0x6a38('0x5')),'defaultValue':_0x6a38('0x4')}}; \ No newline at end of file +var _0x0e8e=['basic','ENUM','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x461fc2,_0x5a142e){var _0x26abd6=function(_0x18cad1){while(--_0x18cad1){_0x461fc2['push'](_0x461fc2['shift']());}};_0x26abd6(++_0x5a142e);}(_0x0e8e,0x100));var _0xe0e8=function(_0x317976,_0x25e192){_0x317976=_0x317976-0x0;var _0x1056f7=_0x0e8e[_0x317976];return _0x1056f7;};'use strict';var Sequelize=require(_0xe0e8('0x0'));module[_0xe0e8('0x1')]={'name':{'type':Sequelize[_0xe0e8('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe0e8('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM'](_0xe0e8('0x3')),'defaultValue':_0xe0e8('0x3')},'password':{'type':Sequelize[_0xe0e8('0x2')]},'consumerKey':{'type':Sequelize[_0xe0e8('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xe0e8('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe0e8('0x4')](_0xe0e8('0x5'),_0xe0e8('0x6')),'defaultValue':_0xe0e8('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 3f98283..3223c69 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 _0xf3be=['headers','Authorization','format','Basic\x20%s','%s:%s','base64','concat','_embedded','entries','active','label','stringify','send','Wrong\x20credentials','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../components/integrations/configuration','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','DeskAccount,\x20%s,\x20%s','message','result','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','stack','name','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','DeskAccount','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','destroy','getConfigurations','findOne','DeskConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','tokenSecret','substring','lastIndexOf','GET','application/json','basic'];(function(_0x26a922,_0x2ff12b){var _0x10955f=function(_0x54dfe6){while(--_0x54dfe6){_0x26a922['push'](_0x26a922['shift']());}};_0x10955f(++_0x2ff12b);}(_0xf3be,0x191));var _0xef3b=function(_0x2e4c45,_0xc38fed){_0x2e4c45=_0x2e4c45-0x0;var _0x5c70fc=_0xf3be[_0x2e4c45];return _0x5c70fc;};'use strict';var pdf=require(_0xef3b('0x0'));var emlformat=require(_0xef3b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xef3b('0x2'));var jsonpatch=require(_0xef3b('0x3'));var rp=require(_0xef3b('0x4'));var moment=require('moment');var BPromise=require(_0xef3b('0x5'));var Mustache=require('mustache');var util=require(_0xef3b('0x6'));var path=require(_0xef3b('0x7'));var sox=require(_0xef3b('0x8'));var csv=require(_0xef3b('0x9'));var ejs=require(_0xef3b('0xa'));var fs=require('fs');var _=require(_0xef3b('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xef3b('0xc'));var deskjs=require(_0xef3b('0xd'));var toCsv=require(_0xef3b('0x9'));var querystring=require(_0xef3b('0xe'));var Papa=require(_0xef3b('0xf'));var Redis=require(_0xef3b('0x10'));var authService=require(_0xef3b('0x11'));var qs=require(_0xef3b('0x12'));var as=require(_0xef3b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xef3b('0x14'));var utils=require(_0xef3b('0x15'));var config=require(_0xef3b('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xef3b('0x17'));var jayson=require('jayson/promise');var client=jayson[_0xef3b('0x18')][_0xef3b('0x19')]({'port':0x232a});function checkPasswordPattern(_0x5913cb,_0xe99b8,_0x22393f){if(_0x22393f){var _0x1a166a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1a166a[_0xef3b('0x1a')](_0xe99b8)){return _0x5913cb;}else{throw new db[(_0xef3b('0x1b'))][(_0xef3b('0x1c'))](_0xef3b('0x1d'));}}else{return _0x5913cb;}}function respondWithRpcPromise(_0x454f53,_0x2abe94,_0x2ccef3,_0xdda775){return new BPromise(function(_0x535f15,_0x431da3){var _0x3c24a4=_0xdda775||client;return _0x3c24a4[_0xef3b('0x1e')](_0x454f53,_0x2ccef3)['then'](function(_0x232dba){logger[_0xef3b('0x1f')]('DeskAccount,\x20%s,\x20%s',_0x2abe94,_0xef3b('0x20'));logger['debug'](_0xef3b('0x21'),_0x2abe94,'request\x20sent',JSON['stringify'](_0x232dba));if(_0x232dba[_0xef3b('0x22')]){if(_0x232dba[_0xef3b('0x22')][_0xef3b('0x23')]===0x1f4){logger[_0xef3b('0x22')](_0xef3b('0x24'),_0x2abe94,_0x232dba[_0xef3b('0x22')]['message']);return _0x431da3(_0x232dba['error'][_0xef3b('0x25')]);}logger[_0xef3b('0x22')](_0xef3b('0x24'),_0x2abe94,_0x232dba['error'][_0xef3b('0x25')]);return _0x535f15(_0x232dba['error'][_0xef3b('0x25')]);}else{logger[_0xef3b('0x1f')]('DeskAccount,\x20%s,\x20%s',_0x2abe94,'request\x20sent');_0x535f15(_0x232dba[_0xef3b('0x26')][_0xef3b('0x25')]);}})['catch'](function(_0x129344){logger['error'](_0xef3b('0x24'),_0x2abe94,_0x129344);_0x431da3(_0x129344);});});}function respondWithStatusCode(_0xf1d0c,_0x536e78){_0x536e78=_0x536e78||0xcc;return function(_0x2601c3){if(_0x2601c3){return _0xf1d0c[_0xef3b('0x27')](_0x536e78);}return _0xf1d0c[_0xef3b('0x28')](_0x536e78)[_0xef3b('0x29')]();};}function respondWithResult(_0x760099,_0x18e5dd){_0x18e5dd=_0x18e5dd||0xc8;return function(_0x191659){if(_0x191659){return _0x760099[_0xef3b('0x28')](_0x18e5dd)['json'](_0x191659);}};}function respondWithFilteredResult(_0x18047a,_0x219ef6){return function(_0x4ca9b0){if(_0x4ca9b0){var _0x352f06=_0x4ca9b0[_0xef3b('0x2a')],_0x2fbf2f=_0x219ef6[_0xef3b('0x2b')],_0x14f2c4=_0x219ef6['offset']+_0x219ef6[_0xef3b('0x2c')],_0x244568;if(_0x14f2c4>=_0x352f06){_0x14f2c4=_0x352f06;_0x244568=0xc8;}else{_0x244568=0xce;}_0x18047a[_0xef3b('0x28')](_0x244568);return _0x18047a[_0xef3b('0x2d')](_0xef3b('0x2e'),_0x2fbf2f+'-'+_0x14f2c4+'/'+_0x352f06)[_0xef3b('0x2f')](_0x4ca9b0);}return null;};}function patchUpdates(_0x1d667b){return function(_0x4b4916){try{jsonpatch[_0xef3b('0x30')](_0x4b4916,_0x1d667b,!![]);}catch(_0x21a2cc){return BPromise[_0xef3b('0x31')](_0x21a2cc);}return _0x4b4916[_0xef3b('0x32')]();};}function saveUpdates(_0x40a6b5,_0x4eaae2){return function(_0x43b003){if(_0x43b003){return _0x43b003[_0xef3b('0x33')](_0x40a6b5)['then'](function(_0x57140e){return _0x57140e;});}return null;};}function removeEntity(_0x296999,_0x11086b){return function(_0x577301){if(_0x577301){return _0x577301['destroy']()[_0xef3b('0x34')](function(){_0x296999[_0xef3b('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49316a,_0x154066){return function(_0x559ce5){if(!_0x559ce5){_0x49316a[_0xef3b('0x27')](0x194);}return _0x559ce5;};}function handleError(_0x292762,_0x2648bc){_0x2648bc=_0x2648bc||0x1f4;return function(_0x4f3339){logger[_0xef3b('0x22')](_0x4f3339[_0xef3b('0x35')]);if(_0x4f3339[_0xef3b('0x36')]){delete _0x4f3339[_0xef3b('0x36')];}_0x292762['status'](_0x2648bc)['send'](_0x4f3339);};}exports[_0xef3b('0x37')]=function(_0x5b8418,_0x3ac3a5){var _0x4077cd={},_0x56eb0d={},_0x2436fc={'count':0x0,'rows':[]};var _0x6e0498=_['map'](db['DeskAccount'][_0xef3b('0x38')],function(_0x5644d3){return{'name':_0x5644d3['fieldName'],'type':_0x5644d3[_0xef3b('0x39')][_0xef3b('0x3a')]};});_0x56eb0d[_0xef3b('0x3b')]=_[_0xef3b('0x3c')](_0x6e0498,'name');_0x56eb0d[_0xef3b('0x3d')]=_[_0xef3b('0x3e')](_0x5b8418['query']);_0x56eb0d[_0xef3b('0x3f')]=_[_0xef3b('0x40')](_0x56eb0d[_0xef3b('0x3b')],_0x56eb0d['query']);_0x4077cd[_0xef3b('0x41')]=_[_0xef3b('0x40')](_0x56eb0d[_0xef3b('0x3b')],qs['fields'](_0x5b8418['query']['fields']));_0x4077cd[_0xef3b('0x41')]=_0x4077cd[_0xef3b('0x41')][_0xef3b('0x42')]?_0x4077cd[_0xef3b('0x41')]:_0x56eb0d[_0xef3b('0x3b')];if(!_0x5b8418[_0xef3b('0x3d')][_0xef3b('0x43')]('nolimit')){_0x4077cd[_0xef3b('0x2c')]=qs['limit'](_0x5b8418['query']['limit']);_0x4077cd['offset']=qs[_0xef3b('0x2b')](_0x5b8418[_0xef3b('0x3d')][_0xef3b('0x2b')]);}_0x4077cd[_0xef3b('0x44')]=qs[_0xef3b('0x45')](_0x5b8418[_0xef3b('0x3d')]['sort']);_0x4077cd['where']=qs['filters'](_[_0xef3b('0x46')](_0x5b8418[_0xef3b('0x3d')],_0x56eb0d[_0xef3b('0x3f')]));if(_0x5b8418[_0xef3b('0x3d')][_0xef3b('0x47')]){_0x4077cd[_0xef3b('0x48')]=_[_0xef3b('0x49')](_0x4077cd[_0xef3b('0x48')],{'$or':_[_0xef3b('0x3c')](_0x6e0498,function(_0x996a72){if(_0x996a72[_0xef3b('0x39')]!==_0xef3b('0x4a')){var _0x519bbc={};_0x519bbc[_0x996a72['name']]={'$like':'%'+_0x5b8418[_0xef3b('0x3d')][_0xef3b('0x47')]+'%'};return _0x519bbc;}})});}_0x4077cd=_[_0xef3b('0x49')]({},_0x4077cd,_0x5b8418[_0xef3b('0x4b')]);var _0x211b35={'where':_0x4077cd['where']};return db[_0xef3b('0x4c')][_0xef3b('0x2a')](_0x211b35)[_0xef3b('0x34')](function(_0x5af200){_0x2436fc['count']=_0x5af200;if(_0x5b8418[_0xef3b('0x3d')][_0xef3b('0x4d')]){_0x4077cd[_0xef3b('0x4e')]=[{'all':!![]}];}return db[_0xef3b('0x4c')][_0xef3b('0x4f')](_0x4077cd);})[_0xef3b('0x34')](function(_0x199ba6){_0x2436fc[_0xef3b('0x50')]=_0x199ba6;return _0x2436fc;})['then'](respondWithFilteredResult(_0x3ac3a5,_0x4077cd))[_0xef3b('0x51')](handleError(_0x3ac3a5,null));};exports[_0xef3b('0x52')]=function(_0x453c3f,_0x4604d3){var _0x50166f={'raw':![],'where':{'id':_0x453c3f[_0xef3b('0x53')]['id']}},_0x2f762d={};_0x2f762d[_0xef3b('0x3b')]=_[_0xef3b('0x3e')](db[_0xef3b('0x4c')][_0xef3b('0x38')]);_0x2f762d[_0xef3b('0x3d')]=_['keys'](_0x453c3f[_0xef3b('0x3d')]);_0x2f762d[_0xef3b('0x3f')]=_[_0xef3b('0x40')](_0x2f762d[_0xef3b('0x3b')],_0x2f762d[_0xef3b('0x3d')]);_0x50166f['attributes']=_[_0xef3b('0x40')](_0x2f762d[_0xef3b('0x3b')],qs[_0xef3b('0x54')](_0x453c3f['query'][_0xef3b('0x54')]));_0x50166f['attributes']=_0x50166f[_0xef3b('0x41')][_0xef3b('0x42')]?_0x50166f[_0xef3b('0x41')]:_0x2f762d['model'];if(_0x453c3f['query']['includeAll']){_0x50166f[_0xef3b('0x4e')]=[{'all':!![]}];}_0x50166f=_['merge']({},_0x50166f,_0x453c3f[_0xef3b('0x4b')]);return db[_0xef3b('0x4c')][_0xef3b('0x55')](_0x50166f)['then'](handleEntityNotFound(_0x4604d3,null))[_0xef3b('0x34')](respondWithResult(_0x4604d3,null))[_0xef3b('0x51')](handleError(_0x4604d3,null));};exports[_0xef3b('0x56')]=function(_0x262b87,_0x2f0c5f){return db['DeskAccount'][_0xef3b('0x56')](_0x262b87['body'],{})[_0xef3b('0x34')](respondWithResult(_0x2f0c5f,0xc9))['catch'](handleError(_0x2f0c5f,null));};exports['update']=function(_0x1aa794,_0x483834){if(_0x1aa794['body']['id']){delete _0x1aa794[_0xef3b('0x57')]['id'];}return db[_0xef3b('0x4c')]['find']({'where':{'id':_0x1aa794[_0xef3b('0x53')]['id']}})[_0xef3b('0x34')](handleEntityNotFound(_0x483834,null))['then'](saveUpdates(_0x1aa794[_0xef3b('0x57')],null))[_0xef3b('0x34')](respondWithResult(_0x483834,null))[_0xef3b('0x51')](handleError(_0x483834,null));};exports[_0xef3b('0x58')]=function(_0xf3d10f,_0x40f0a8){return db['DeskAccount'][_0xef3b('0x55')]({'where':{'id':_0xf3d10f['params']['id']}})['then'](handleEntityNotFound(_0x40f0a8,null))[_0xef3b('0x34')](removeEntity(_0x40f0a8,null))[_0xef3b('0x51')](handleError(_0x40f0a8,null));};exports[_0xef3b('0x59')]=function(_0x209231,_0x549407,_0x480351){var _0x30cd61={};var _0x485ce4={};var _0x5b1c68;var _0x5012e6;return db[_0xef3b('0x4c')][_0xef3b('0x5a')]({'where':{'id':_0x209231[_0xef3b('0x53')]['id']}})['then'](handleEntityNotFound(_0x549407,null))['then'](function(_0x4146a0){if(_0x4146a0){_0x5b1c68=_0x4146a0;_0x485ce4[_0xef3b('0x3b')]=_['keys'](db[_0xef3b('0x5b')]['rawAttributes']);_0x485ce4['query']=_[_0xef3b('0x3e')](_0x209231['query']);_0x485ce4[_0xef3b('0x3f')]=_[_0xef3b('0x40')](_0x485ce4['model'],_0x485ce4[_0xef3b('0x3d')]);_0x30cd61['attributes']=_[_0xef3b('0x40')](_0x485ce4[_0xef3b('0x3b')],qs[_0xef3b('0x54')](_0x209231[_0xef3b('0x3d')][_0xef3b('0x54')]));_0x30cd61[_0xef3b('0x41')]=_0x30cd61[_0xef3b('0x41')][_0xef3b('0x42')]?_0x30cd61[_0xef3b('0x41')]:_0x485ce4[_0xef3b('0x3b')];_0x30cd61[_0xef3b('0x44')]=qs[_0xef3b('0x45')](_0x209231[_0xef3b('0x3d')][_0xef3b('0x45')]);_0x30cd61[_0xef3b('0x48')]=qs['filters'](_['pick'](_0x209231[_0xef3b('0x3d')],_0x485ce4[_0xef3b('0x3f')]));if(_0x209231[_0xef3b('0x3d')][_0xef3b('0x47')]){_0x30cd61[_0xef3b('0x48')]=_[_0xef3b('0x49')](_0x30cd61[_0xef3b('0x48')],{'$or':_[_0xef3b('0x3c')](_0x30cd61[_0xef3b('0x41')],function(_0x42229e){var _0x2e8b28={};_0x2e8b28[_0x42229e]={'$like':'%'+_0x209231[_0xef3b('0x3d')][_0xef3b('0x47')]+'%'};return _0x2e8b28;})});}_0x30cd61=_[_0xef3b('0x49')]({},_0x30cd61,_0x209231['options']);return _0x5b1c68[_0xef3b('0x59')](_0x30cd61);}})[_0xef3b('0x34')](function(_0x1302e7){if(_0x1302e7){_0x5012e6=_0x1302e7['length'];if(!_0x209231[_0xef3b('0x3d')][_0xef3b('0x43')](_0xef3b('0x5c'))){_0x30cd61[_0xef3b('0x2c')]=qs['limit'](_0x209231['query']['limit']);_0x30cd61[_0xef3b('0x2b')]=qs[_0xef3b('0x2b')](_0x209231[_0xef3b('0x3d')][_0xef3b('0x2b')]);}return _0x5b1c68['getConfigurations'](_0x30cd61);}})[_0xef3b('0x34')](function(_0x2e690c){if(_0x2e690c){return _0x2e690c?{'count':_0x5012e6,'rows':_0x2e690c}:null;}})[_0xef3b('0x34')](respondWithResult(_0x549407,null))[_0xef3b('0x51')](handleError(_0x549407,null));};exports[_0xef3b('0x5d')]=function(_0x5674bb,_0xce367,_0x199c83){if(_0x5674bb[_0xef3b('0x57')]['id']){delete _0x5674bb[_0xef3b('0x57')]['id'];}return db[_0xef3b('0x4c')]['findOne']({'where':{'id':_0x5674bb['params']['id']}})['then'](handleEntityNotFound(_0xce367,null))[_0xef3b('0x34')](function(_0x269133){if(_0x269133){_0x5674bb['body'][_0xef3b('0x5e')]=_0x269133['id'];_0x5674bb[_0xef3b('0x57')][_0xef3b('0x5f')]=integrations[_0xef3b('0x60')](_0x5674bb[_0xef3b('0x57')][_0xef3b('0x61')],_0x5674bb[_0xef3b('0x57')][_0xef3b('0x39')]);_0x5674bb[_0xef3b('0x57')][_0xef3b('0x62')]=integrations[_0xef3b('0x63')](_0x5674bb[_0xef3b('0x57')][_0xef3b('0x61')],_0x5674bb['body'][_0xef3b('0x39')]);return db['DeskConfiguration'][_0xef3b('0x56')](_0x5674bb[_0xef3b('0x57')],{'include':[{'model':db[_0xef3b('0x64')],'as':'Subjects'},{'model':db['DeskField'],'as':_0xef3b('0x62')}]});}return null;})[_0xef3b('0x34')](respondWithResult(_0xce367,null))[_0xef3b('0x51')](handleError(_0xce367,null));};exports[_0xef3b('0x65')]=function(_0x4c6137,_0x8fabc,_0x1b8e02){var _0x4fce06=[{'name':_0xef3b('0x66'),'label':_0xef3b('0x66'),'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 _0x28522b='';return db[_0xef3b('0x4c')][_0xef3b('0x5a')]({'where':{'id':_0x4c6137[_0xef3b('0x53')]['id']},'attributes':['id',_0xef3b('0x67'),_0xef3b('0x68'),_0xef3b('0x69'),_0xef3b('0x6a'),_0xef3b('0x6b'),_0xef3b('0x6c'),'token',_0xef3b('0x6d')]})[_0xef3b('0x34')](handleEntityNotFound(_0x8fabc,null))[_0xef3b('0x34')](function(_0x2d0e18){if(_0x2d0e18){_0x28522b=_0x2d0e18[_0xef3b('0x67')];var _0x1442f9=_0x28522b['slice'](-0x1);if(_0x1442f9==='/'){_0x28522b=_0x28522b[_0xef3b('0x6e')](0x0,_0x28522b[_0xef3b('0x6f')](_0x1442f9));}var _0x580a99={'method':_0xef3b('0x70'),'uri':util['format']('%s/custom_fields',_0x28522b),'headers':{'Content-Type':_0xef3b('0x71'),'Accept':_0xef3b('0x71')},'json':!![]};if(_0x2d0e18[_0xef3b('0x68')]===_0xef3b('0x72')){_0x580a99[_0xef3b('0x73')][_0xef3b('0x74')]=util[_0xef3b('0x75')](_0xef3b('0x76'),new Buffer(util[_0xef3b('0x75')](_0xef3b('0x77'),_0x2d0e18[_0xef3b('0x69')],_0x2d0e18[_0xef3b('0x6a')]))['toString'](_0xef3b('0x78')));}return rp(_0x580a99)[_0xef3b('0x34')](function(_0x38b063){return _0x4fce06[_0xef3b('0x79')](_[_0xef3b('0x3c')](_0x38b063[_0xef3b('0x7a')][_0xef3b('0x7b')],function(_0x93ae3a){return{'id':_0x93ae3a[_0xef3b('0x36')],'name':_0x93ae3a[_0xef3b('0x36')],'type':_0x93ae3a['type'],'active':_0x93ae3a[_0xef3b('0x7c')],'label':_0x93ae3a[_0xef3b('0x7d')],'custom':!![]};}));});}})[_0xef3b('0x34')](function(_0x40ddbf){return{'count':_0x40ddbf['length'],'rows':_0x40ddbf};})[_0xef3b('0x34')](respondWithResult(_0x8fabc,null))['catch'](function(_0x42c59c){var _0x2381aa=_0x4c6137[_0xef3b('0x3d')][_0xef3b('0x1a')]?0x1f4:_0x42c59c['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xef3b('0x65'),_0x2381aa,JSON[_0xef3b('0x7e')](_0x42c59c));delete _0x42c59c[_0xef3b('0x36')];if(_0x2381aa===0x191){_0x2381aa=0x190;}_0x8fabc['status'](_0x2381aa)[_0xef3b('0x7f')](_0x4c6137[_0xef3b('0x3d')][_0xef3b('0x1a')]?{'message':_0xef3b('0x80'),'statusCode':_0x42c59c['statusCode']}:_0x42c59c);});}; \ No newline at end of file +var _0x50b0=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','end','status','count','offset','Content-Range','apply','reject','update','destroy','sendStatus','stack','name','map','DeskAccount','rawAttributes','fieldName','type','key','query','intersection','attributes','fields','length','model','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','getConfigurations','findOne','DeskConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','DeskField','getFields','priority','remoteUri','username','password','consumerSecret','token','slice','substring','GET','%s/custom_fields','application/json','authType','basic','headers','Authorization','format','Basic\x20%s','toString','base64','_embedded','entries','active','label','statusCode','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x2df864,_0x1e1504){var _0x17a34b=function(_0x549b90){while(--_0x549b90){_0x2df864['push'](_0x2df864['shift']());}};_0x17a34b(++_0x1e1504);}(_0x50b0,0x16c));var _0x050b=function(_0x188a50,_0x593551){_0x188a50=_0x188a50-0x0;var _0x10942c=_0x50b0[_0x188a50];return _0x10942c;};'use strict';var pdf=require(_0x050b('0x0'));var emlformat=require(_0x050b('0x1'));var rimraf=require(_0x050b('0x2'));var zipdir=require(_0x050b('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x050b('0x4'));var moment=require('moment');var BPromise=require(_0x050b('0x5'));var Mustache=require(_0x050b('0x6'));var util=require(_0x050b('0x7'));var path=require(_0x050b('0x8'));var sox=require(_0x050b('0x9'));var csv=require(_0x050b('0xa'));var ejs=require(_0x050b('0xb'));var fs=require('fs');var _=require(_0x050b('0xc'));var squel=require(_0x050b('0xd'));var crypto=require(_0x050b('0xe'));var jsforce=require(_0x050b('0xf'));var deskjs=require(_0x050b('0x10'));var toCsv=require(_0x050b('0xa'));var querystring=require('querystring');var Papa=require(_0x050b('0x11'));var Redis=require(_0x050b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x050b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x050b('0x14'));var logger=require(_0x050b('0x15'))(_0x050b('0x16'));var utils=require(_0x050b('0x17'));var config=require(_0x050b('0x18'));var db=require(_0x050b('0x19'))['db'];var integrations=require(_0x050b('0x1a'));var jayson=require(_0x050b('0x1b'));var client=jayson[_0x050b('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x42a019,_0x25fbb0,_0x2855de){if(_0x2855de){var _0x26ae98=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x26ae98[_0x050b('0x1d')](_0x25fbb0)){return _0x42a019;}else{throw new db[(_0x050b('0x1e'))][(_0x050b('0x1f'))](_0x050b('0x20'));}}else{return _0x42a019;}}function respondWithRpcPromise(_0x46a1ec,_0x89ec80,_0x14313c,_0x39d257){return new BPromise(function(_0x41d968,_0xa2f614){var _0x25a9be=_0x39d257||client;return _0x25a9be[_0x050b('0x21')](_0x46a1ec,_0x14313c)[_0x050b('0x22')](function(_0xd637b7){logger[_0x050b('0x23')](_0x050b('0x24'),_0x89ec80,_0x050b('0x25'));logger[_0x050b('0x26')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x89ec80,_0x050b('0x25'),JSON[_0x050b('0x27')](_0xd637b7));if(_0xd637b7[_0x050b('0x28')]){if(_0xd637b7['error']['code']===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x89ec80,_0xd637b7[_0x050b('0x28')][_0x050b('0x29')]);return _0xa2f614(_0xd637b7[_0x050b('0x28')][_0x050b('0x29')]);}logger['error']('DeskAccount,\x20%s,\x20%s',_0x89ec80,_0xd637b7[_0x050b('0x28')]['message']);return _0x41d968(_0xd637b7[_0x050b('0x28')][_0x050b('0x29')]);}else{logger[_0x050b('0x23')](_0x050b('0x24'),_0x89ec80,'request\x20sent');_0x41d968(_0xd637b7[_0x050b('0x2a')][_0x050b('0x29')]);}})[_0x050b('0x2b')](function(_0x33aa01){logger['error'](_0x050b('0x24'),_0x89ec80,_0x33aa01);_0xa2f614(_0x33aa01);});});}function respondWithStatusCode(_0x5e09e7,_0x56cec5){_0x56cec5=_0x56cec5||0xcc;return function(_0x46abe6){if(_0x46abe6){return _0x5e09e7['sendStatus'](_0x56cec5);}return _0x5e09e7['status'](_0x56cec5)[_0x050b('0x2c')]();};}function respondWithResult(_0x3c2bfe,_0x45d725){_0x45d725=_0x45d725||0xc8;return function(_0x353a3c){if(_0x353a3c){return _0x3c2bfe[_0x050b('0x2d')](_0x45d725)['json'](_0x353a3c);}};}function respondWithFilteredResult(_0x102645,_0x3121e9){return function(_0xf472a7){if(_0xf472a7){var _0x28373c=_0xf472a7[_0x050b('0x2e')],_0x205985=_0x3121e9[_0x050b('0x2f')],_0x4131c0=_0x3121e9[_0x050b('0x2f')]+_0x3121e9['limit'],_0x11b0aa;if(_0x4131c0>=_0x28373c){_0x4131c0=_0x28373c;_0x11b0aa=0xc8;}else{_0x11b0aa=0xce;}_0x102645[_0x050b('0x2d')](_0x11b0aa);return _0x102645['set'](_0x050b('0x30'),_0x205985+'-'+_0x4131c0+'/'+_0x28373c)['json'](_0xf472a7);}return null;};}function patchUpdates(_0xbcb6c1){return function(_0x59bd26){try{jsonpatch[_0x050b('0x31')](_0x59bd26,_0xbcb6c1,!![]);}catch(_0x369e71){return BPromise[_0x050b('0x32')](_0x369e71);}return _0x59bd26['save']();};}function saveUpdates(_0x2409c7,_0x4f09d8){return function(_0x46d3d8){if(_0x46d3d8){return _0x46d3d8[_0x050b('0x33')](_0x2409c7)[_0x050b('0x22')](function(_0x11d678){return _0x11d678;});}return null;};}function removeEntity(_0x14df62,_0x3f44b8){return function(_0x163c08){if(_0x163c08){return _0x163c08[_0x050b('0x34')]()[_0x050b('0x22')](function(){_0x14df62[_0x050b('0x2d')](0xcc)[_0x050b('0x2c')]();});}};}function handleEntityNotFound(_0x15e412,_0x32201b){return function(_0x331ac8){if(!_0x331ac8){_0x15e412[_0x050b('0x35')](0x194);}return _0x331ac8;};}function handleError(_0x3388a3,_0x53f6c3){_0x53f6c3=_0x53f6c3||0x1f4;return function(_0x2a9a7b){logger['error'](_0x2a9a7b[_0x050b('0x36')]);if(_0x2a9a7b['name']){delete _0x2a9a7b[_0x050b('0x37')];}_0x3388a3[_0x050b('0x2d')](_0x53f6c3)['send'](_0x2a9a7b);};}exports['index']=function(_0x5060c5,_0x5a892a){var _0x2e6070={},_0x55fd9f={},_0x173d9e={'count':0x0,'rows':[]};var _0x21d493=_[_0x050b('0x38')](db[_0x050b('0x39')][_0x050b('0x3a')],function(_0x681bae){return{'name':_0x681bae[_0x050b('0x3b')],'type':_0x681bae[_0x050b('0x3c')][_0x050b('0x3d')]};});_0x55fd9f['model']=_[_0x050b('0x38')](_0x21d493,_0x050b('0x37'));_0x55fd9f[_0x050b('0x3e')]=_['keys'](_0x5060c5[_0x050b('0x3e')]);_0x55fd9f['filters']=_[_0x050b('0x3f')](_0x55fd9f['model'],_0x55fd9f[_0x050b('0x3e')]);_0x2e6070[_0x050b('0x40')]=_[_0x050b('0x3f')](_0x55fd9f['model'],qs[_0x050b('0x41')](_0x5060c5[_0x050b('0x3e')][_0x050b('0x41')]));_0x2e6070['attributes']=_0x2e6070['attributes'][_0x050b('0x42')]?_0x2e6070[_0x050b('0x40')]:_0x55fd9f[_0x050b('0x43')];if(!_0x5060c5[_0x050b('0x3e')]['hasOwnProperty']('nolimit')){_0x2e6070[_0x050b('0x44')]=qs[_0x050b('0x44')](_0x5060c5['query'][_0x050b('0x44')]);_0x2e6070[_0x050b('0x2f')]=qs['offset'](_0x5060c5[_0x050b('0x3e')]['offset']);}_0x2e6070[_0x050b('0x45')]=qs[_0x050b('0x46')](_0x5060c5['query']['sort']);_0x2e6070[_0x050b('0x47')]=qs[_0x050b('0x48')](_[_0x050b('0x49')](_0x5060c5[_0x050b('0x3e')],_0x55fd9f[_0x050b('0x48')]));if(_0x5060c5[_0x050b('0x3e')]['filter']){_0x2e6070[_0x050b('0x47')]=_[_0x050b('0x4a')](_0x2e6070['where'],{'$or':_['map'](_0x21d493,function(_0x113bd9){if(_0x113bd9['type']!==_0x050b('0x4b')){var _0x51f422={};_0x51f422[_0x113bd9[_0x050b('0x37')]]={'$like':'%'+_0x5060c5['query'][_0x050b('0x4c')]+'%'};return _0x51f422;}})});}_0x2e6070=_[_0x050b('0x4a')]({},_0x2e6070,_0x5060c5[_0x050b('0x4d')]);var _0x2bb827={'where':_0x2e6070[_0x050b('0x47')]};return db[_0x050b('0x39')]['count'](_0x2bb827)['then'](function(_0x2dd44b){_0x173d9e['count']=_0x2dd44b;if(_0x5060c5['query'][_0x050b('0x4e')]){_0x2e6070[_0x050b('0x4f')]=[{'all':!![]}];}return db[_0x050b('0x39')][_0x050b('0x50')](_0x2e6070);})[_0x050b('0x22')](function(_0x4b8ccb){_0x173d9e[_0x050b('0x51')]=_0x4b8ccb;return _0x173d9e;})['then'](respondWithFilteredResult(_0x5a892a,_0x2e6070))[_0x050b('0x2b')](handleError(_0x5a892a,null));};exports[_0x050b('0x52')]=function(_0x478894,_0x17cc92){var _0x4630da={'raw':![],'where':{'id':_0x478894[_0x050b('0x53')]['id']}},_0x395510={};_0x395510['model']=_[_0x050b('0x54')](db['DeskAccount'][_0x050b('0x3a')]);_0x395510[_0x050b('0x3e')]=_[_0x050b('0x54')](_0x478894[_0x050b('0x3e')]);_0x395510[_0x050b('0x48')]=_[_0x050b('0x3f')](_0x395510[_0x050b('0x43')],_0x395510['query']);_0x4630da['attributes']=_['intersection'](_0x395510['model'],qs[_0x050b('0x41')](_0x478894[_0x050b('0x3e')][_0x050b('0x41')]));_0x4630da['attributes']=_0x4630da[_0x050b('0x40')][_0x050b('0x42')]?_0x4630da[_0x050b('0x40')]:_0x395510[_0x050b('0x43')];if(_0x478894[_0x050b('0x3e')]['includeAll']){_0x4630da[_0x050b('0x4f')]=[{'all':!![]}];}_0x4630da=_[_0x050b('0x4a')]({},_0x4630da,_0x478894[_0x050b('0x4d')]);return db[_0x050b('0x39')][_0x050b('0x55')](_0x4630da)[_0x050b('0x22')](handleEntityNotFound(_0x17cc92,null))[_0x050b('0x22')](respondWithResult(_0x17cc92,null))[_0x050b('0x2b')](handleError(_0x17cc92,null));};exports[_0x050b('0x56')]=function(_0xb0cdb4,_0x370c35){return db[_0x050b('0x39')][_0x050b('0x56')](_0xb0cdb4[_0x050b('0x57')],{})['then'](respondWithResult(_0x370c35,0xc9))[_0x050b('0x2b')](handleError(_0x370c35,null));};exports['update']=function(_0xfa7e54,_0x3686b4){if(_0xfa7e54[_0x050b('0x57')]['id']){delete _0xfa7e54[_0x050b('0x57')]['id'];}return db['DeskAccount']['find']({'where':{'id':_0xfa7e54[_0x050b('0x53')]['id']}})[_0x050b('0x22')](handleEntityNotFound(_0x3686b4,null))['then'](saveUpdates(_0xfa7e54['body'],null))[_0x050b('0x22')](respondWithResult(_0x3686b4,null))['catch'](handleError(_0x3686b4,null));};exports[_0x050b('0x34')]=function(_0x13a6d6,_0x40d1fc){return db[_0x050b('0x39')][_0x050b('0x55')]({'where':{'id':_0x13a6d6[_0x050b('0x53')]['id']}})[_0x050b('0x22')](handleEntityNotFound(_0x40d1fc,null))['then'](removeEntity(_0x40d1fc,null))[_0x050b('0x2b')](handleError(_0x40d1fc,null));};exports[_0x050b('0x58')]=function(_0x47f5c8,_0x1cd8bf,_0x3b76bc){var _0x2e42dd={};var _0x5823b2={};var _0x4cedf6;var _0x44c579;return db['DeskAccount'][_0x050b('0x59')]({'where':{'id':_0x47f5c8[_0x050b('0x53')]['id']}})[_0x050b('0x22')](handleEntityNotFound(_0x1cd8bf,null))[_0x050b('0x22')](function(_0x1a1d57){if(_0x1a1d57){_0x4cedf6=_0x1a1d57;_0x5823b2[_0x050b('0x43')]=_[_0x050b('0x54')](db[_0x050b('0x5a')][_0x050b('0x3a')]);_0x5823b2[_0x050b('0x3e')]=_[_0x050b('0x54')](_0x47f5c8['query']);_0x5823b2[_0x050b('0x48')]=_['intersection'](_0x5823b2[_0x050b('0x43')],_0x5823b2[_0x050b('0x3e')]);_0x2e42dd[_0x050b('0x40')]=_[_0x050b('0x3f')](_0x5823b2['model'],qs[_0x050b('0x41')](_0x47f5c8['query'][_0x050b('0x41')]));_0x2e42dd[_0x050b('0x40')]=_0x2e42dd['attributes'][_0x050b('0x42')]?_0x2e42dd[_0x050b('0x40')]:_0x5823b2[_0x050b('0x43')];_0x2e42dd[_0x050b('0x45')]=qs[_0x050b('0x46')](_0x47f5c8[_0x050b('0x3e')][_0x050b('0x46')]);_0x2e42dd[_0x050b('0x47')]=qs['filters'](_[_0x050b('0x49')](_0x47f5c8[_0x050b('0x3e')],_0x5823b2[_0x050b('0x48')]));if(_0x47f5c8['query'][_0x050b('0x4c')]){_0x2e42dd[_0x050b('0x47')]=_[_0x050b('0x4a')](_0x2e42dd[_0x050b('0x47')],{'$or':_[_0x050b('0x38')](_0x2e42dd['attributes'],function(_0x50e4ef){var _0x2e455f={};_0x2e455f[_0x50e4ef]={'$like':'%'+_0x47f5c8[_0x050b('0x3e')][_0x050b('0x4c')]+'%'};return _0x2e455f;})});}_0x2e42dd=_['merge']({},_0x2e42dd,_0x47f5c8['options']);return _0x4cedf6[_0x050b('0x58')](_0x2e42dd);}})[_0x050b('0x22')](function(_0x26dc7f){if(_0x26dc7f){_0x44c579=_0x26dc7f['length'];if(!_0x47f5c8[_0x050b('0x3e')][_0x050b('0x5b')]('nolimit')){_0x2e42dd[_0x050b('0x44')]=qs['limit'](_0x47f5c8['query']['limit']);_0x2e42dd[_0x050b('0x2f')]=qs[_0x050b('0x2f')](_0x47f5c8[_0x050b('0x3e')][_0x050b('0x2f')]);}return _0x4cedf6['getConfigurations'](_0x2e42dd);}})[_0x050b('0x22')](function(_0x478276){if(_0x478276){return _0x478276?{'count':_0x44c579,'rows':_0x478276}:null;}})['then'](respondWithResult(_0x1cd8bf,null))['catch'](handleError(_0x1cd8bf,null));};exports[_0x050b('0x5c')]=function(_0x394618,_0x38fec0,_0x5ebef2){if(_0x394618['body']['id']){delete _0x394618[_0x050b('0x57')]['id'];}return db['DeskAccount'][_0x050b('0x59')]({'where':{'id':_0x394618['params']['id']}})[_0x050b('0x22')](handleEntityNotFound(_0x38fec0,null))[_0x050b('0x22')](function(_0x52da7b){if(_0x52da7b){_0x394618['body'][_0x050b('0x5d')]=_0x52da7b['id'];_0x394618['body'][_0x050b('0x5e')]=integrations[_0x050b('0x5f')](_0x394618['body'][_0x050b('0x60')],_0x394618[_0x050b('0x57')]['type']);_0x394618['body'][_0x050b('0x61')]=integrations['getDescriptions'](_0x394618['body'][_0x050b('0x60')],_0x394618[_0x050b('0x57')][_0x050b('0x3c')]);return db[_0x050b('0x5a')][_0x050b('0x56')](_0x394618['body'],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db[_0x050b('0x62')],'as':_0x050b('0x61')}]});}return null;})[_0x050b('0x22')](respondWithResult(_0x38fec0,null))[_0x050b('0x2b')](handleError(_0x38fec0,null));};exports[_0x050b('0x63')]=function(_0x27e2ab,_0xc3cd06,_0x51f53){var _0x55d56d=[{'name':_0x050b('0x64'),'label':_0x050b('0x64'),'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 _0x16b5ab='';return db['DeskAccount'][_0x050b('0x59')]({'where':{'id':_0x27e2ab[_0x050b('0x53')]['id']},'attributes':['id',_0x050b('0x65'),'authType',_0x050b('0x66'),_0x050b('0x67'),'consumerKey',_0x050b('0x68'),_0x050b('0x69'),'tokenSecret']})['then'](handleEntityNotFound(_0xc3cd06,null))['then'](function(_0x149beb){if(_0x149beb){_0x16b5ab=_0x149beb[_0x050b('0x65')];var _0x18cc50=_0x16b5ab[_0x050b('0x6a')](-0x1);if(_0x18cc50==='/'){_0x16b5ab=_0x16b5ab[_0x050b('0x6b')](0x0,_0x16b5ab['lastIndexOf'](_0x18cc50));}var _0x4987f9={'method':_0x050b('0x6c'),'uri':util['format'](_0x050b('0x6d'),_0x16b5ab),'headers':{'Content-Type':_0x050b('0x6e'),'Accept':'application/json'},'json':!![]};if(_0x149beb[_0x050b('0x6f')]===_0x050b('0x70')){_0x4987f9[_0x050b('0x71')][_0x050b('0x72')]=util[_0x050b('0x73')](_0x050b('0x74'),new Buffer(util[_0x050b('0x73')]('%s:%s',_0x149beb[_0x050b('0x66')],_0x149beb[_0x050b('0x67')]))[_0x050b('0x75')](_0x050b('0x76')));}return rp(_0x4987f9)[_0x050b('0x22')](function(_0x5625ca){return _0x55d56d['concat'](_[_0x050b('0x38')](_0x5625ca[_0x050b('0x77')][_0x050b('0x78')],function(_0x3c3364){return{'id':_0x3c3364[_0x050b('0x37')],'name':_0x3c3364[_0x050b('0x37')],'type':_0x3c3364[_0x050b('0x3c')],'active':_0x3c3364[_0x050b('0x79')],'label':_0x3c3364[_0x050b('0x7a')],'custom':!![]};}));});}})[_0x050b('0x22')](function(_0x3b126c){return{'count':_0x3b126c[_0x050b('0x42')],'rows':_0x3b126c};})['then'](respondWithResult(_0xc3cd06,null))['catch'](function(_0xa79f){var _0x17d35a=_0x27e2ab['query'][_0x050b('0x1d')]?0x1f4:_0xa79f[_0x050b('0x7b')]||0x1f4;logger[_0x050b('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x050b('0x63'),_0x17d35a,JSON['stringify'](_0xa79f));delete _0xa79f['name'];if(_0x17d35a===0x191){_0x17d35a=0x190;}_0xc3cd06['status'](_0x17d35a)[_0x050b('0x7c')](_0x27e2ab[_0x050b('0x3e')][_0x050b('0x1d')]?{'message':_0x050b('0x7d'),'statusCode':_0xa79f['statusCode']}:_0xa79f);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 3ef30e7..f2fffdb 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 _0xcff9=['api','rimraf','../../config/environment','../../components/integrations/configuration','exports','int_desk_accounts','lodash','util','../../config/logger'];(function(_0x8bf294,_0x1ca4ae){var _0x596021=function(_0x2d1e15){while(--_0x2d1e15){_0x8bf294['push'](_0x8bf294['shift']());}};_0x596021(++_0x1ca4ae);}(_0xcff9,0x1ad));var _0x9cff=function(_0x55e573,_0x3b6daf){_0x55e573=_0x55e573-0x0;var _0x436e0f=_0xcff9[_0x55e573];return _0x436e0f;};'use strict';var _=require(_0x9cff('0x0'));var util=require(_0x9cff('0x1'));var logger=require(_0x9cff('0x2'))(_0x9cff('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(_0x9cff('0x4'));var config=require(_0x9cff('0x5'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x9cff('0x6'));module[_0x9cff('0x7')]=function(_0x32bf90,_0x3cc12e){return _0x32bf90['define']('DeskAccount',attributes,{'tableName':_0x9cff('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9aac=['../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x13b257,_0x496c6c){var _0x444268=function(_0x1129f7){while(--_0x1129f7){_0x13b257['push'](_0x13b257['shift']());}};_0x444268(++_0x496c6c);}(_0x9aac,0xab));var _0xc9aa=function(_0x5cf995,_0x3957cd){_0x5cf995=_0x5cf995-0x0;var _0x20814=_0x9aac[_0x5cf995];return _0x20814;};'use strict';var _=require(_0xc9aa('0x0'));var util=require(_0xc9aa('0x1'));var logger=require(_0xc9aa('0x2'))(_0xc9aa('0x3'));var moment=require(_0xc9aa('0x4'));var BPromise=require(_0xc9aa('0x5'));var rp=require(_0xc9aa('0x6'));var fs=require('fs');var path=require(_0xc9aa('0x7'));var rimraf=require(_0xc9aa('0x8'));var config=require(_0xc9aa('0x9'));var attributes=require(_0xc9aa('0xa'));var integrations=require(_0xc9aa('0xb'));module['exports']=function(_0xd14ba6,_0x2e3082){return _0xd14ba6[_0xc9aa('0xc')](_0xc9aa('0xd'),attributes,{'tableName':_0xc9aa('0xe'),'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 f86ee20..050a7ac 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 _0x02fc=['catch','DeskAccount','findAll','options','raw','where','attributes','limit','map','model','include','then','GetDeskAccount','ShowDeskAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result'];(function(_0x517a2d,_0x21e839){var _0x42498c=function(_0x4451b9){while(--_0x4451b9){_0x517a2d['push'](_0x517a2d['shift']());}};_0x42498c(++_0x21e839);}(_0x02fc,0x93));var _0xc02f=function(_0x325b12,_0x19b409){_0x325b12=_0x325b12-0x0;var _0xe1a491=_0x02fc[_0x325b12];return _0xe1a491;};'use strict';var _=require(_0xc02f('0x0'));var util=require(_0xc02f('0x1'));var moment=require(_0xc02f('0x2'));var BPromise=require('bluebird');var rs=require(_0xc02f('0x3'));var fs=require('fs');var Redis=require(_0xc02f('0x4'));var db=require(_0xc02f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc02f('0x6'))(_0xc02f('0x7'));var config=require('../../config/environment');var jayson=require(_0xc02f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x164440,_0xf5a21e,_0x590bfe){return new BPromise(function(_0x17083d,_0x459ed0){return client[_0xc02f('0x9')](_0x164440,_0x590bfe)['then'](function(_0xadbd93){logger['info'](_0xc02f('0xa'),_0xf5a21e,_0xc02f('0xb'));logger[_0xc02f('0xc')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0xf5a21e,'request\x20sent',JSON[_0xc02f('0xd')](_0xadbd93));if(_0xadbd93[_0xc02f('0xe')]){if(_0xadbd93[_0xc02f('0xe')]['code']===0x1f4){logger[_0xc02f('0xe')](_0xc02f('0xa'),_0xf5a21e,_0xadbd93[_0xc02f('0xe')][_0xc02f('0xf')]);return _0x459ed0(_0xadbd93[_0xc02f('0xe')][_0xc02f('0xf')]);}logger[_0xc02f('0xe')](_0xc02f('0xa'),_0xf5a21e,_0xadbd93[_0xc02f('0xe')]['message']);return _0x17083d(_0xadbd93[_0xc02f('0xe')][_0xc02f('0xf')]);}else{logger[_0xc02f('0x10')](_0xc02f('0xa'),_0xf5a21e,_0xc02f('0xb'));_0x17083d(_0xadbd93[_0xc02f('0x11')]['message']);}})[_0xc02f('0x12')](function(_0x59f5b6){logger[_0xc02f('0xe')]('DeskAccount,\x20%s,\x20%s',_0xf5a21e,_0x59f5b6);_0x459ed0(_0x59f5b6);});});}exports['GetDeskAccount']=function(_0x375678){var _0x5ec465=this;return new Promise(function(_0x392b70,_0x15d6a5){return db[_0xc02f('0x13')][_0xc02f('0x14')]({'raw':_0x375678[_0xc02f('0x15')]?_0x375678[_0xc02f('0x15')][_0xc02f('0x16')]===undefined?!![]:![]:!![],'where':_0x375678[_0xc02f('0x15')]?_0x375678[_0xc02f('0x15')][_0xc02f('0x17')]||null:null,'attributes':_0x375678[_0xc02f('0x15')]?_0x375678[_0xc02f('0x15')][_0xc02f('0x18')]||null:null,'limit':_0x375678[_0xc02f('0x15')]?_0x375678[_0xc02f('0x15')][_0xc02f('0x19')]||null:null,'include':_0x375678[_0xc02f('0x15')]?_0x375678[_0xc02f('0x15')]['include']?_[_0xc02f('0x1a')](_0x375678[_0xc02f('0x15')]['include'],function(_0x567e2d){return{'model':db[_0x567e2d[_0xc02f('0x1b')]],'as':_0x567e2d['as'],'attributes':_0x567e2d[_0xc02f('0x18')],'include':_0x567e2d[_0xc02f('0x1c')]?_[_0xc02f('0x1a')](_0x567e2d[_0xc02f('0x1c')],function(_0x22d926){return{'model':db[_0x22d926['model']],'as':_0x22d926['as'],'attributes':_0x22d926[_0xc02f('0x18')],'include':_0x22d926[_0xc02f('0x1c')]?_['map'](_0x22d926[_0xc02f('0x1c')],function(_0x30f419){return{'model':db[_0x30f419[_0xc02f('0x1b')]],'as':_0x30f419['as'],'attributes':_0x30f419['attributes']};}):[]};}):[]};}):[]:[]})[_0xc02f('0x1d')](function(_0x1bd3f4){logger[_0xc02f('0x10')](_0xc02f('0x1e'),_0x375678);logger['debug']('GetDeskAccount',_0x375678,JSON[_0xc02f('0xd')](_0x1bd3f4));_0x392b70(_0x1bd3f4);})[_0xc02f('0x12')](function(_0xcafcc1){logger[_0xc02f('0xe')](_0xc02f('0x1e'),_0xcafcc1[_0xc02f('0xf')],_0x375678);_0x15d6a5(_0x5ec465[_0xc02f('0xe')](0x1f4,_0xcafcc1[_0xc02f('0xf')]));});});};exports[_0xc02f('0x1f')]=function(_0x2a149f){var _0x1dcfbf=this;return new Promise(function(_0x475f1a,_0x2e66dc){return db['DeskAccount'][_0xc02f('0x20')]({'raw':_0x2a149f[_0xc02f('0x15')]?_0x2a149f[_0xc02f('0x15')][_0xc02f('0x16')]===undefined?!![]:![]:!![],'where':_0x2a149f[_0xc02f('0x15')]?_0x2a149f[_0xc02f('0x15')][_0xc02f('0x17')]||null:null,'attributes':_0x2a149f[_0xc02f('0x15')]?_0x2a149f[_0xc02f('0x15')]['attributes']||null:null,'include':_0x2a149f['options']?_0x2a149f[_0xc02f('0x15')][_0xc02f('0x1c')]?_['map'](_0x2a149f[_0xc02f('0x15')]['include'],function(_0x38d372){return{'model':db[_0x38d372[_0xc02f('0x1b')]],'as':_0x38d372['as'],'attributes':_0x38d372['attributes'],'include':_0x38d372[_0xc02f('0x1c')]?_['map'](_0x38d372[_0xc02f('0x1c')],function(_0x49af2c){return{'model':db[_0x49af2c[_0xc02f('0x1b')]],'as':_0x49af2c['as'],'attributes':_0x49af2c[_0xc02f('0x18')],'include':_0x49af2c[_0xc02f('0x1c')]?_['map'](_0x49af2c[_0xc02f('0x1c')],function(_0x19cc8b){return{'model':db[_0x19cc8b[_0xc02f('0x1b')]],'as':_0x19cc8b['as'],'attributes':_0x19cc8b['attributes']};}):[]};}):[]};}):[]:[]})[_0xc02f('0x1d')](function(_0x314dca){logger[_0xc02f('0x10')](_0xc02f('0x1f'),_0x2a149f);logger[_0xc02f('0xc')]('ShowDeskAccount',_0x2a149f,JSON[_0xc02f('0xd')](_0x314dca));_0x475f1a(_0x314dca);})['catch'](function(_0x5ef641){logger[_0xc02f('0xe')](_0xc02f('0x1f'),_0x5ef641[_0xc02f('0xf')],_0x2a149f);_0x2e66dc(_0x1dcfbf[_0xc02f('0xe')](0x1f4,_0x5ef641[_0xc02f('0xf')]));});});}; \ No newline at end of file +var _0x4a77=['limit','include','model','map','stringify','ShowDeskAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetDeskAccount','options','raw','where','attributes'];(function(_0x4c6cf0,_0x826f70){var _0x108145=function(_0x299f69){while(--_0x299f69){_0x4c6cf0['push'](_0x4c6cf0['shift']());}};_0x108145(++_0x826f70);}(_0x4a77,0x127));var _0x74a7=function(_0x53cb20,_0xd5f132){_0x53cb20=_0x53cb20-0x0;var _0x13c5a0=_0x4a77[_0x53cb20];return _0x13c5a0;};'use strict';var _=require(_0x74a7('0x0'));var util=require(_0x74a7('0x1'));var moment=require(_0x74a7('0x2'));var BPromise=require(_0x74a7('0x3'));var rs=require('randomstring');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'))(_0x74a7('0x8'));var config=require(_0x74a7('0x9'));var jayson=require(_0x74a7('0xa'));var client=jayson[_0x74a7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9e7e48,_0x1bde6a,_0x48f0e1){return new BPromise(function(_0x847411,_0x42885f){return client[_0x74a7('0xc')](_0x9e7e48,_0x48f0e1)[_0x74a7('0xd')](function(_0xbc94c3){logger[_0x74a7('0xe')](_0x74a7('0xf'),_0x1bde6a,_0x74a7('0x10'));logger[_0x74a7('0x11')](_0x74a7('0x12'),_0x1bde6a,_0x74a7('0x10'),JSON['stringify'](_0xbc94c3));if(_0xbc94c3['error']){if(_0xbc94c3[_0x74a7('0x13')][_0x74a7('0x14')]===0x1f4){logger['error'](_0x74a7('0xf'),_0x1bde6a,_0xbc94c3[_0x74a7('0x13')][_0x74a7('0x15')]);return _0x42885f(_0xbc94c3[_0x74a7('0x13')]['message']);}logger[_0x74a7('0x13')]('DeskAccount,\x20%s,\x20%s',_0x1bde6a,_0xbc94c3[_0x74a7('0x13')][_0x74a7('0x15')]);return _0x847411(_0xbc94c3[_0x74a7('0x13')][_0x74a7('0x15')]);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0x1bde6a,'request\x20sent');_0x847411(_0xbc94c3[_0x74a7('0x16')]['message']);}})[_0x74a7('0x17')](function(_0x452674){logger[_0x74a7('0x13')](_0x74a7('0xf'),_0x1bde6a,_0x452674);_0x42885f(_0x452674);});});}exports[_0x74a7('0x18')]=function(_0x221840){var _0x550b9a=this;return new Promise(function(_0x4683b6,_0x5eeaa0){return db['DeskAccount']['findAll']({'raw':_0x221840[_0x74a7('0x19')]?_0x221840[_0x74a7('0x19')][_0x74a7('0x1a')]===undefined?!![]:![]:!![],'where':_0x221840[_0x74a7('0x19')]?_0x221840[_0x74a7('0x19')][_0x74a7('0x1b')]||null:null,'attributes':_0x221840[_0x74a7('0x19')]?_0x221840['options'][_0x74a7('0x1c')]||null:null,'limit':_0x221840['options']?_0x221840[_0x74a7('0x19')][_0x74a7('0x1d')]||null:null,'include':_0x221840[_0x74a7('0x19')]?_0x221840[_0x74a7('0x19')][_0x74a7('0x1e')]?_['map'](_0x221840['options'][_0x74a7('0x1e')],function(_0x26b286){return{'model':db[_0x26b286[_0x74a7('0x1f')]],'as':_0x26b286['as'],'attributes':_0x26b286[_0x74a7('0x1c')],'include':_0x26b286[_0x74a7('0x1e')]?_[_0x74a7('0x20')](_0x26b286[_0x74a7('0x1e')],function(_0x5f5e6f){return{'model':db[_0x5f5e6f[_0x74a7('0x1f')]],'as':_0x5f5e6f['as'],'attributes':_0x5f5e6f[_0x74a7('0x1c')],'include':_0x5f5e6f['include']?_[_0x74a7('0x20')](_0x5f5e6f[_0x74a7('0x1e')],function(_0x371567){return{'model':db[_0x371567[_0x74a7('0x1f')]],'as':_0x371567['as'],'attributes':_0x371567[_0x74a7('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x591708){logger['info'](_0x74a7('0x18'),_0x221840);logger['debug']('GetDeskAccount',_0x221840,JSON[_0x74a7('0x21')](_0x591708));_0x4683b6(_0x591708);})[_0x74a7('0x17')](function(_0x4ce695){logger[_0x74a7('0x13')](_0x74a7('0x18'),_0x4ce695['message'],_0x221840);_0x5eeaa0(_0x550b9a[_0x74a7('0x13')](0x1f4,_0x4ce695[_0x74a7('0x15')]));});});};exports[_0x74a7('0x22')]=function(_0x27786f){var _0x10df3c=this;return new Promise(function(_0x26a426,_0x2c4201){return db['DeskAccount'][_0x74a7('0x23')]({'raw':_0x27786f[_0x74a7('0x19')]?_0x27786f[_0x74a7('0x19')][_0x74a7('0x1a')]===undefined?!![]:![]:!![],'where':_0x27786f[_0x74a7('0x19')]?_0x27786f[_0x74a7('0x19')][_0x74a7('0x1b')]||null:null,'attributes':_0x27786f[_0x74a7('0x19')]?_0x27786f[_0x74a7('0x19')][_0x74a7('0x1c')]||null:null,'include':_0x27786f[_0x74a7('0x19')]?_0x27786f[_0x74a7('0x19')]['include']?_[_0x74a7('0x20')](_0x27786f[_0x74a7('0x19')][_0x74a7('0x1e')],function(_0x3ad5fe){return{'model':db[_0x3ad5fe[_0x74a7('0x1f')]],'as':_0x3ad5fe['as'],'attributes':_0x3ad5fe['attributes'],'include':_0x3ad5fe['include']?_[_0x74a7('0x20')](_0x3ad5fe['include'],function(_0x50be1f){return{'model':db[_0x50be1f[_0x74a7('0x1f')]],'as':_0x50be1f['as'],'attributes':_0x50be1f['attributes'],'include':_0x50be1f[_0x74a7('0x1e')]?_['map'](_0x50be1f['include'],function(_0x3422c3){return{'model':db[_0x3422c3[_0x74a7('0x1f')]],'as':_0x3422c3['as'],'attributes':_0x3422c3['attributes']};}):[]};}):[]};}):[]:[]})[_0x74a7('0xd')](function(_0x18d1ed){logger['info'](_0x74a7('0x22'),_0x27786f);logger[_0x74a7('0x11')]('ShowDeskAccount',_0x27786f,JSON['stringify'](_0x18d1ed));_0x26a426(_0x18d1ed);})[_0x74a7('0x17')](function(_0x2c3f05){logger[_0x74a7('0x13')](_0x74a7('0x22'),_0x2c3f05['message'],_0x27786f);_0x2c4201(_0x10df3c[_0x74a7('0x13')](0x1f4,_0x2c3f05[_0x74a7('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 14b23c2..2afa0b7 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 _0x404d=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/fields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x404192,_0x5e084e){var _0x38f955=function(_0x12efdb){while(--_0x12efdb){_0x404192['push'](_0x404192['shift']());}};_0x38f955(++_0x5e084e);}(_0x404d,0x1e9));var _0xd404=function(_0x3bff66,_0x46efa5){_0x3bff66=_0x3bff66-0x0;var _0x3d8ff2=_0x404d[_0x3bff66];return _0x3d8ff2;};'use strict';var multer=require(_0xd404('0x0'));var util=require(_0xd404('0x1'));var path=require(_0xd404('0x2'));var timeout=require(_0xd404('0x3'));var express=require(_0xd404('0x4'));var router=express[_0xd404('0x5')]();var auth=require(_0xd404('0x6'));var interaction=require(_0xd404('0x7'));var config=require(_0xd404('0x8'));var controller=require('./intDeskConfiguration.controller');router[_0xd404('0x9')]('/',auth[_0xd404('0xa')](),controller['index']);router[_0xd404('0x9')](_0xd404('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xd404('0x9')](_0xd404('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0xd404('0x9')](_0xd404('0xd'),auth[_0xd404('0xa')](),controller[_0xd404('0xe')]);router['get']('/:id/descriptions',auth[_0xd404('0xa')](),controller[_0xd404('0xf')]);router['get'](_0xd404('0x10'),auth[_0xd404('0xa')](),controller[_0xd404('0x11')]);router[_0xd404('0x12')]('/',auth[_0xd404('0xa')](),controller[_0xd404('0x13')]);router[_0xd404('0x12')](_0xd404('0x10'),auth[_0xd404('0xa')](),controller[_0xd404('0x14')]);router[_0xd404('0x15')](_0xd404('0xb'),auth[_0xd404('0xa')](),controller[_0xd404('0x16')]);router[_0xd404('0x17')](_0xd404('0xb'),auth[_0xd404('0xa')](),controller[_0xd404('0x18')]);module[_0xd404('0x19')]=router; \ No newline at end of file +var _0x0954=['exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','/:id/subjects','/:id/descriptions','post','create','setTags','put','delete','destroy'];(function(_0xa620b9,_0x4b74e5){var _0x28356d=function(_0x3e09a3){while(--_0x3e09a3){_0xa620b9['push'](_0xa620b9['shift']());}};_0x28356d(++_0x4b74e5);}(_0x0954,0x135));var _0x4095=function(_0x919445,_0x5467dc){_0x919445=_0x919445-0x0;var _0x511b3e=_0x0954[_0x919445];return _0x511b3e;};'use strict';var multer=require(_0x4095('0x0'));var util=require('util');var path=require(_0x4095('0x1'));var timeout=require(_0x4095('0x2'));var express=require('express');var router=express[_0x4095('0x3')]();var auth=require(_0x4095('0x4'));var interaction=require(_0x4095('0x5'));var config=require(_0x4095('0x6'));var controller=require(_0x4095('0x7'));router[_0x4095('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4095('0x9'),auth[_0x4095('0xa')](),controller[_0x4095('0xb')]);router[_0x4095('0x8')](_0x4095('0xc'),auth[_0x4095('0xa')](),controller['getFields']);router[_0x4095('0x8')](_0x4095('0xd'),auth[_0x4095('0xa')](),controller['getSubjects']);router[_0x4095('0x8')](_0x4095('0xe'),auth[_0x4095('0xa')](),controller['getDescriptions']);router[_0x4095('0x8')]('/:id/tags',auth[_0x4095('0xa')](),controller['getTags']);router[_0x4095('0xf')]('/',auth[_0x4095('0xa')](),controller[_0x4095('0x10')]);router['post']('/:id/tags',auth[_0x4095('0xa')](),controller[_0x4095('0x11')]);router[_0x4095('0x12')](_0x4095('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x4095('0x13')](_0x4095('0x9'),auth[_0x4095('0xa')](),controller[_0x4095('0x14')]);module[_0x4095('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index a43914f..a8850bf 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 _0xf9bb=['STRING','sequelize','exports'];(function(_0x41fbdf,_0x2740fe){var _0x20e059=function(_0x521269){while(--_0x521269){_0x41fbdf['push'](_0x41fbdf['shift']());}};_0x20e059(++_0x2740fe);}(_0xf9bb,0x157));var _0xbf9b=function(_0x40cb69,_0x37f2ba){_0x40cb69=_0x40cb69-0x0;var _0x55e036=_0xf9bb[_0x40cb69];return _0x55e036;};'use strict';var Sequelize=require(_0xbf9b('0x0'));module[_0xbf9b('0x1')]={'name':{'type':Sequelize[_0xbf9b('0x2')]},'description':{'type':Sequelize[_0xbf9b('0x2')]}}; \ No newline at end of file +var _0xbb56=['STRING','sequelize','exports'];(function(_0x5ae458,_0xc18d32){var _0x49e315=function(_0x382b71){while(--_0x382b71){_0x5ae458['push'](_0x5ae458['shift']());}};_0x49e315(++_0xc18d32);}(_0xbb56,0x172));var _0x6bb5=function(_0x18352d,_0x5a869e){_0x18352d=_0x18352d-0x0;var _0x33712c=_0xbb56[_0x18352d];return _0x33712c;};'use strict';var Sequelize=require(_0x6bb5('0x0'));module[_0x6bb5('0x1')]={'name':{'type':Sequelize[_0x6bb5('0x2')]},'description':{'type':Sequelize[_0x6bb5('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index b5ce6bc..14481b9 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 _0xf218=['reject','save','update','destroy','stack','name','send','index','map','DeskConfiguration','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','create','findOne','DeskField','pick','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','body','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','test','ValidationError','request','then','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply'];(function(_0x1e5473,_0x44ed5d){var _0x4ead1a=function(_0x395ddc){while(--_0x395ddc){_0x1e5473['push'](_0x1e5473['shift']());}};_0x4ead1a(++_0x44ed5d);}(_0xf218,0x8d));var _0x8f21=function(_0x16fcf9,_0x5a7df9){_0x16fcf9=_0x16fcf9-0x0;var _0x34714b=_0xf218[_0x16fcf9];return _0x34714b;};'use strict';var pdf=require(_0x8f21('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8f21('0x1'));var zipdir=require(_0x8f21('0x2'));var jsonpatch=require(_0x8f21('0x3'));var rp=require('request-promise');var moment=require(_0x8f21('0x4'));var BPromise=require(_0x8f21('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8f21('0x6'));var sox=require(_0x8f21('0x7'));var csv=require(_0x8f21('0x8'));var ejs=require(_0x8f21('0x9'));var fs=require('fs');var _=require(_0x8f21('0xa'));var squel=require('squel');var crypto=require(_0x8f21('0xb'));var jsforce=require(_0x8f21('0xc'));var deskjs=require(_0x8f21('0xd'));var toCsv=require(_0x8f21('0x8'));var querystring=require(_0x8f21('0xe'));var Papa=require(_0x8f21('0xf'));var Redis=require(_0x8f21('0x10'));var authService=require(_0x8f21('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8f21('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8f21('0x13'))(_0x8f21('0x14'));var utils=require(_0x8f21('0x15'));var config=require('../../config/environment');var db=require(_0x8f21('0x16'))['db'];var jayson=require(_0x8f21('0x17'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x4a1d18,_0x16982c,_0x3f991e){if(_0x3f991e){var _0x16cf04=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x16cf04[_0x8f21('0x18')](_0x16982c)){return _0x4a1d18;}else{throw new db['Sequelize'][(_0x8f21('0x19'))]('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 _0x4a1d18;}}function respondWithRpcPromise(_0x15079e,_0x3a2e37,_0x4d3d1b,_0x2aa261){return new BPromise(function(_0x43d978,_0x558881){var _0x10aa5e=_0x2aa261||client;return _0x10aa5e[_0x8f21('0x1a')](_0x15079e,_0x4d3d1b)[_0x8f21('0x1b')](function(_0x4973bb){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x3a2e37,_0x8f21('0x1c'));logger[_0x8f21('0x1d')](_0x8f21('0x1e'),_0x3a2e37,_0x8f21('0x1c'),JSON[_0x8f21('0x1f')](_0x4973bb));if(_0x4973bb[_0x8f21('0x20')]){if(_0x4973bb[_0x8f21('0x20')][_0x8f21('0x21')]===0x1f4){logger['error'](_0x8f21('0x22'),_0x3a2e37,_0x4973bb[_0x8f21('0x20')][_0x8f21('0x23')]);return _0x558881(_0x4973bb[_0x8f21('0x20')][_0x8f21('0x23')]);}logger[_0x8f21('0x20')](_0x8f21('0x22'),_0x3a2e37,_0x4973bb[_0x8f21('0x20')][_0x8f21('0x23')]);return _0x43d978(_0x4973bb['error'][_0x8f21('0x23')]);}else{logger[_0x8f21('0x24')](_0x8f21('0x22'),_0x3a2e37,'request\x20sent');_0x43d978(_0x4973bb[_0x8f21('0x25')][_0x8f21('0x23')]);}})[_0x8f21('0x26')](function(_0x686ca3){logger[_0x8f21('0x20')](_0x8f21('0x22'),_0x3a2e37,_0x686ca3);_0x558881(_0x686ca3);});});}function respondWithStatusCode(_0x4cd3c7,_0x9097c2){_0x9097c2=_0x9097c2||0xcc;return function(_0x4e53ed){if(_0x4e53ed){return _0x4cd3c7[_0x8f21('0x27')](_0x9097c2);}return _0x4cd3c7[_0x8f21('0x28')](_0x9097c2)[_0x8f21('0x29')]();};}function respondWithResult(_0x4e2b28,_0x2777e5){_0x2777e5=_0x2777e5||0xc8;return function(_0x1ef206){if(_0x1ef206){return _0x4e2b28['status'](_0x2777e5)[_0x8f21('0x2a')](_0x1ef206);}};}function respondWithFilteredResult(_0x2a00b2,_0x3ae456){return function(_0x12e9c5){if(_0x12e9c5){var _0x24dbc3=_0x12e9c5[_0x8f21('0x2b')],_0x1647ac=_0x3ae456[_0x8f21('0x2c')],_0x2fbb92=_0x3ae456[_0x8f21('0x2c')]+_0x3ae456[_0x8f21('0x2d')],_0x511ff2;if(_0x2fbb92>=_0x24dbc3){_0x2fbb92=_0x24dbc3;_0x511ff2=0xc8;}else{_0x511ff2=0xce;}_0x2a00b2[_0x8f21('0x28')](_0x511ff2);return _0x2a00b2[_0x8f21('0x2e')](_0x8f21('0x2f'),_0x1647ac+'-'+_0x2fbb92+'/'+_0x24dbc3)[_0x8f21('0x2a')](_0x12e9c5);}return null;};}function patchUpdates(_0x5d191a){return function(_0x131e25){try{jsonpatch[_0x8f21('0x30')](_0x131e25,_0x5d191a,!![]);}catch(_0x2321e7){return BPromise[_0x8f21('0x31')](_0x2321e7);}return _0x131e25[_0x8f21('0x32')]();};}function saveUpdates(_0x51c974,_0x239013){return function(_0x904dad){if(_0x904dad){return _0x904dad[_0x8f21('0x33')](_0x51c974)[_0x8f21('0x1b')](function(_0x55c348){return _0x55c348;});}return null;};}function removeEntity(_0x446526,_0x33ddb0){return function(_0x8ab88a){if(_0x8ab88a){return _0x8ab88a[_0x8f21('0x34')]()['then'](function(){_0x446526[_0x8f21('0x28')](0xcc)[_0x8f21('0x29')]();});}};}function handleEntityNotFound(_0x2dc56e,_0x794f8a){return function(_0x4e28de){if(!_0x4e28de){_0x2dc56e[_0x8f21('0x27')](0x194);}return _0x4e28de;};}function handleError(_0x39ee34,_0x41d01c){_0x41d01c=_0x41d01c||0x1f4;return function(_0x3563a3){logger[_0x8f21('0x20')](_0x3563a3[_0x8f21('0x35')]);if(_0x3563a3[_0x8f21('0x36')]){delete _0x3563a3[_0x8f21('0x36')];}_0x39ee34['status'](_0x41d01c)[_0x8f21('0x37')](_0x3563a3);};}exports[_0x8f21('0x38')]=function(_0xa539d5,_0x11454c){var _0x2cbabe={},_0x870c26={},_0x3311d8={'count':0x0,'rows':[]};var _0xdb84dd=_[_0x8f21('0x39')](db[_0x8f21('0x3a')][_0x8f21('0x3b')],function(_0x5e4bae){return{'name':_0x5e4bae['fieldName'],'type':_0x5e4bae[_0x8f21('0x3c')]['key']};});_0x870c26[_0x8f21('0x3d')]=_[_0x8f21('0x39')](_0xdb84dd,_0x8f21('0x36'));_0x870c26[_0x8f21('0x3e')]=_[_0x8f21('0x3f')](_0xa539d5[_0x8f21('0x3e')]);_0x870c26[_0x8f21('0x40')]=_[_0x8f21('0x41')](_0x870c26[_0x8f21('0x3d')],_0x870c26[_0x8f21('0x3e')]);_0x2cbabe[_0x8f21('0x42')]=_[_0x8f21('0x41')](_0x870c26[_0x8f21('0x3d')],qs[_0x8f21('0x43')](_0xa539d5['query'][_0x8f21('0x43')]));_0x2cbabe[_0x8f21('0x42')]=_0x2cbabe[_0x8f21('0x42')][_0x8f21('0x44')]?_0x2cbabe[_0x8f21('0x42')]:_0x870c26[_0x8f21('0x3d')];if(!_0xa539d5[_0x8f21('0x3e')][_0x8f21('0x45')](_0x8f21('0x46'))){_0x2cbabe['limit']=qs[_0x8f21('0x2d')](_0xa539d5[_0x8f21('0x3e')][_0x8f21('0x2d')]);_0x2cbabe[_0x8f21('0x2c')]=qs[_0x8f21('0x2c')](_0xa539d5['query'][_0x8f21('0x2c')]);}_0x2cbabe[_0x8f21('0x47')]=qs['sort'](_0xa539d5[_0x8f21('0x3e')][_0x8f21('0x48')]);_0x2cbabe[_0x8f21('0x49')]=qs[_0x8f21('0x40')](_['pick'](_0xa539d5['query'],_0x870c26[_0x8f21('0x40')]));if(_0xa539d5[_0x8f21('0x3e')][_0x8f21('0x4a')]){_0x2cbabe[_0x8f21('0x49')]=_[_0x8f21('0x4b')](_0x2cbabe[_0x8f21('0x49')],{'$or':_[_0x8f21('0x39')](_0xdb84dd,function(_0x38b4fc){if(_0x38b4fc[_0x8f21('0x3c')]!==_0x8f21('0x4c')){var _0x378eb5={};_0x378eb5[_0x38b4fc[_0x8f21('0x36')]]={'$like':'%'+_0xa539d5[_0x8f21('0x3e')][_0x8f21('0x4a')]+'%'};return _0x378eb5;}})});}_0x2cbabe=_[_0x8f21('0x4b')]({},_0x2cbabe,_0xa539d5[_0x8f21('0x4d')]);var _0x21803f={'where':_0x2cbabe['where']};return db[_0x8f21('0x3a')][_0x8f21('0x2b')](_0x21803f)['then'](function(_0x22d77d){_0x3311d8[_0x8f21('0x2b')]=_0x22d77d;if(_0xa539d5[_0x8f21('0x3e')][_0x8f21('0x4e')]){_0x2cbabe['include']=[{'all':!![]}];}return db['DeskConfiguration'][_0x8f21('0x4f')](_0x2cbabe);})['then'](function(_0x20a045){_0x3311d8[_0x8f21('0x50')]=_0x20a045;return _0x3311d8;})['then'](respondWithFilteredResult(_0x11454c,_0x2cbabe))[_0x8f21('0x26')](handleError(_0x11454c,null));};exports['show']=function(_0x29f3ce,_0x111586){var _0x3745d8={'raw':![],'where':{'id':_0x29f3ce[_0x8f21('0x51')]['id']}},_0x5c2e50={};_0x5c2e50[_0x8f21('0x3d')]=_[_0x8f21('0x3f')](db['DeskConfiguration'][_0x8f21('0x3b')]);_0x5c2e50[_0x8f21('0x3e')]=_[_0x8f21('0x3f')](_0x29f3ce['query']);_0x5c2e50[_0x8f21('0x40')]=_[_0x8f21('0x41')](_0x5c2e50['model'],_0x5c2e50['query']);_0x3745d8[_0x8f21('0x42')]=_['intersection'](_0x5c2e50[_0x8f21('0x3d')],qs[_0x8f21('0x43')](_0x29f3ce[_0x8f21('0x3e')][_0x8f21('0x43')]));_0x3745d8[_0x8f21('0x42')]=_0x3745d8[_0x8f21('0x42')]['length']?_0x3745d8[_0x8f21('0x42')]:_0x5c2e50[_0x8f21('0x3d')];if(_0x29f3ce[_0x8f21('0x3e')][_0x8f21('0x4e')]){_0x3745d8[_0x8f21('0x52')]=[{'all':!![]}];}_0x3745d8=_[_0x8f21('0x4b')]({},_0x3745d8,_0x29f3ce[_0x8f21('0x4d')]);return db[_0x8f21('0x3a')][_0x8f21('0x53')](_0x3745d8)[_0x8f21('0x1b')](handleEntityNotFound(_0x111586,null))[_0x8f21('0x1b')](respondWithResult(_0x111586,null))[_0x8f21('0x26')](handleError(_0x111586,null));};exports[_0x8f21('0x54')]=function(_0x1b199b,_0x3566a1){return db[_0x8f21('0x3a')][_0x8f21('0x54')](_0x1b199b['body'],{})[_0x8f21('0x1b')](respondWithResult(_0x3566a1,0xc9))[_0x8f21('0x26')](handleError(_0x3566a1,null));};exports[_0x8f21('0x33')]=function(_0x438062,_0x2cff6b){if(_0x438062['body']['id']){delete _0x438062['body']['id'];}return db[_0x8f21('0x3a')][_0x8f21('0x53')]({'where':{'id':_0x438062['params']['id']}})['then'](handleEntityNotFound(_0x2cff6b,null))['then'](saveUpdates(_0x438062['body'],null))[_0x8f21('0x1b')](respondWithResult(_0x2cff6b,null))[_0x8f21('0x26')](handleError(_0x2cff6b,null));};exports[_0x8f21('0x34')]=function(_0x265049,_0xfa173){return db[_0x8f21('0x3a')][_0x8f21('0x53')]({'where':{'id':_0x265049['params']['id']}})[_0x8f21('0x1b')](handleEntityNotFound(_0xfa173,null))['then'](removeEntity(_0xfa173,null))[_0x8f21('0x26')](handleError(_0xfa173,null));};exports['getFields']=function(_0x3e4940,_0x4093a8,_0x34d1e8){var _0x39ee86={};var _0x140ca7={};var _0x52dcf2;var _0x50615b;return db[_0x8f21('0x3a')][_0x8f21('0x55')]({'where':{'id':_0x3e4940[_0x8f21('0x51')]['id']}})['then'](handleEntityNotFound(_0x4093a8,null))[_0x8f21('0x1b')](function(_0xe07875){if(_0xe07875){_0x52dcf2=_0xe07875;_0x140ca7[_0x8f21('0x3d')]=_[_0x8f21('0x3f')](db[_0x8f21('0x56')][_0x8f21('0x3b')]);_0x140ca7[_0x8f21('0x3e')]=_[_0x8f21('0x3f')](_0x3e4940[_0x8f21('0x3e')]);_0x140ca7[_0x8f21('0x40')]=_[_0x8f21('0x41')](_0x140ca7['model'],_0x140ca7[_0x8f21('0x3e')]);_0x39ee86[_0x8f21('0x42')]=_['intersection'](_0x140ca7[_0x8f21('0x3d')],qs[_0x8f21('0x43')](_0x3e4940[_0x8f21('0x3e')][_0x8f21('0x43')]));_0x39ee86[_0x8f21('0x42')]=_0x39ee86['attributes'][_0x8f21('0x44')]?_0x39ee86[_0x8f21('0x42')]:_0x140ca7[_0x8f21('0x3d')];_0x39ee86['order']=qs[_0x8f21('0x48')](_0x3e4940[_0x8f21('0x3e')][_0x8f21('0x48')]);_0x39ee86[_0x8f21('0x49')]=qs[_0x8f21('0x40')](_[_0x8f21('0x57')](_0x3e4940[_0x8f21('0x3e')],_0x140ca7[_0x8f21('0x40')]));if(_0x3e4940[_0x8f21('0x3e')][_0x8f21('0x4a')]){_0x39ee86[_0x8f21('0x49')]=_[_0x8f21('0x4b')](_0x39ee86[_0x8f21('0x49')],{'$or':_['map'](_0x39ee86[_0x8f21('0x42')],function(_0x230994){var _0x1aafe7={};_0x1aafe7[_0x230994]={'$like':'%'+_0x3e4940[_0x8f21('0x3e')][_0x8f21('0x4a')]+'%'};return _0x1aafe7;})});}_0x39ee86=_[_0x8f21('0x4b')]({},_0x39ee86,_0x3e4940[_0x8f21('0x4d')]);return _0x52dcf2[_0x8f21('0x58')](_0x39ee86);}})[_0x8f21('0x1b')](function(_0x536fd0){if(_0x536fd0){_0x50615b=_0x536fd0['length'];if(!_0x3e4940[_0x8f21('0x3e')][_0x8f21('0x45')]('nolimit')){_0x39ee86['limit']=qs[_0x8f21('0x2d')](_0x3e4940['query']['limit']);_0x39ee86[_0x8f21('0x2c')]=qs[_0x8f21('0x2c')](_0x3e4940[_0x8f21('0x3e')][_0x8f21('0x2c')]);}return _0x52dcf2[_0x8f21('0x58')](_0x39ee86);}})[_0x8f21('0x1b')](function(_0x2908c6){if(_0x2908c6){return _0x2908c6?{'count':_0x50615b,'rows':_0x2908c6}:null;}})['then'](respondWithResult(_0x4093a8,null))['catch'](handleError(_0x4093a8,null));};exports[_0x8f21('0x59')]=function(_0x3a7845,_0x42fddf,_0x2535b1){var _0x12478b={};var _0x594d74={};var _0x366abe;var _0x83f452;return db[_0x8f21('0x3a')][_0x8f21('0x55')]({'where':{'id':_0x3a7845[_0x8f21('0x51')]['id']}})[_0x8f21('0x1b')](handleEntityNotFound(_0x42fddf,null))[_0x8f21('0x1b')](function(_0xcceef6){if(_0xcceef6){_0x366abe=_0xcceef6;_0x594d74[_0x8f21('0x3d')]=_[_0x8f21('0x3f')](db[_0x8f21('0x56')][_0x8f21('0x3b')]);_0x594d74[_0x8f21('0x3e')]=_[_0x8f21('0x3f')](_0x3a7845['query']);_0x594d74[_0x8f21('0x40')]=_['intersection'](_0x594d74[_0x8f21('0x3d')],_0x594d74[_0x8f21('0x3e')]);_0x12478b[_0x8f21('0x42')]=_['intersection'](_0x594d74[_0x8f21('0x3d')],qs[_0x8f21('0x43')](_0x3a7845[_0x8f21('0x3e')][_0x8f21('0x43')]));_0x12478b[_0x8f21('0x42')]=_0x12478b[_0x8f21('0x42')][_0x8f21('0x44')]?_0x12478b[_0x8f21('0x42')]:_0x594d74['model'];_0x12478b[_0x8f21('0x47')]=qs[_0x8f21('0x48')](_0x3a7845['query'][_0x8f21('0x48')]);_0x12478b[_0x8f21('0x49')]=qs[_0x8f21('0x40')](_[_0x8f21('0x57')](_0x3a7845[_0x8f21('0x3e')],_0x594d74[_0x8f21('0x40')]));if(_0x3a7845[_0x8f21('0x3e')]['filter']){_0x12478b[_0x8f21('0x49')]=_[_0x8f21('0x4b')](_0x12478b[_0x8f21('0x49')],{'$or':_['map'](_0x12478b[_0x8f21('0x42')],function(_0x28d56b){var _0xfa5b9a={};_0xfa5b9a[_0x28d56b]={'$like':'%'+_0x3a7845[_0x8f21('0x3e')][_0x8f21('0x4a')]+'%'};return _0xfa5b9a;})});}_0x12478b=_[_0x8f21('0x4b')]({},_0x12478b,_0x3a7845[_0x8f21('0x4d')]);return _0x366abe[_0x8f21('0x59')](_0x12478b);}})[_0x8f21('0x1b')](function(_0x1e0166){if(_0x1e0166){_0x83f452=_0x1e0166[_0x8f21('0x44')];if(!_0x3a7845[_0x8f21('0x3e')][_0x8f21('0x45')]('nolimit')){_0x12478b['limit']=qs[_0x8f21('0x2d')](_0x3a7845[_0x8f21('0x3e')][_0x8f21('0x2d')]);_0x12478b[_0x8f21('0x2c')]=qs['offset'](_0x3a7845['query'][_0x8f21('0x2c')]);}return _0x366abe['getSubjects'](_0x12478b);}})[_0x8f21('0x1b')](function(_0x2342a7){if(_0x2342a7){return _0x2342a7?{'count':_0x83f452,'rows':_0x2342a7}:null;}})[_0x8f21('0x1b')](respondWithResult(_0x42fddf,null))[_0x8f21('0x26')](handleError(_0x42fddf,null));};exports[_0x8f21('0x5a')]=function(_0x50d642,_0x47ed16,_0x1db969){var _0x52e288={};var _0x4b9bb7={};var _0x311765;var _0x37aa8b;return db[_0x8f21('0x3a')][_0x8f21('0x55')]({'where':{'id':_0x50d642['params']['id']}})[_0x8f21('0x1b')](handleEntityNotFound(_0x47ed16,null))[_0x8f21('0x1b')](function(_0x528803){if(_0x528803){_0x311765=_0x528803;_0x4b9bb7[_0x8f21('0x3d')]=_['keys'](db['DeskField']['rawAttributes']);_0x4b9bb7['query']=_[_0x8f21('0x3f')](_0x50d642['query']);_0x4b9bb7[_0x8f21('0x40')]=_[_0x8f21('0x41')](_0x4b9bb7[_0x8f21('0x3d')],_0x4b9bb7[_0x8f21('0x3e')]);_0x52e288[_0x8f21('0x42')]=_['intersection'](_0x4b9bb7[_0x8f21('0x3d')],qs[_0x8f21('0x43')](_0x50d642[_0x8f21('0x3e')]['fields']));_0x52e288[_0x8f21('0x42')]=_0x52e288[_0x8f21('0x42')][_0x8f21('0x44')]?_0x52e288[_0x8f21('0x42')]:_0x4b9bb7[_0x8f21('0x3d')];_0x52e288['order']=qs[_0x8f21('0x48')](_0x50d642[_0x8f21('0x3e')][_0x8f21('0x48')]);_0x52e288[_0x8f21('0x49')]=qs['filters'](_[_0x8f21('0x57')](_0x50d642['query'],_0x4b9bb7['filters']));if(_0x50d642['query'][_0x8f21('0x4a')]){_0x52e288['where']=_[_0x8f21('0x4b')](_0x52e288[_0x8f21('0x49')],{'$or':_['map'](_0x52e288[_0x8f21('0x42')],function(_0x22cb8d){var _0x1b820b={};_0x1b820b[_0x22cb8d]={'$like':'%'+_0x50d642[_0x8f21('0x3e')][_0x8f21('0x4a')]+'%'};return _0x1b820b;})});}_0x52e288=_['merge']({},_0x52e288,_0x50d642[_0x8f21('0x4d')]);return _0x311765[_0x8f21('0x5a')](_0x52e288);}})[_0x8f21('0x1b')](function(_0x9b9f7d){if(_0x9b9f7d){_0x37aa8b=_0x9b9f7d['length'];if(!_0x50d642[_0x8f21('0x3e')][_0x8f21('0x45')](_0x8f21('0x46'))){_0x52e288['limit']=qs[_0x8f21('0x2d')](_0x50d642[_0x8f21('0x3e')][_0x8f21('0x2d')]);_0x52e288[_0x8f21('0x2c')]=qs['offset'](_0x50d642['query']['offset']);}return _0x311765[_0x8f21('0x5a')](_0x52e288);}})[_0x8f21('0x1b')](function(_0x150cb0){if(_0x150cb0){return _0x150cb0?{'count':_0x37aa8b,'rows':_0x150cb0}:null;}})[_0x8f21('0x1b')](respondWithResult(_0x47ed16,null))[_0x8f21('0x26')](handleError(_0x47ed16,null));};exports[_0x8f21('0x5b')]=function(_0x506163,_0x536e6b,_0x50cf2b){var _0x18fc26={};var _0x41bd12={};var _0x40f183;var _0x4b3de4;return db['DeskConfiguration'][_0x8f21('0x55')]({'where':{'id':_0x506163[_0x8f21('0x51')]['id']}})[_0x8f21('0x1b')](handleEntityNotFound(_0x536e6b,null))['then'](function(_0x52cc69){if(_0x52cc69){_0x40f183=_0x52cc69;_0x41bd12['model']=_[_0x8f21('0x3f')](db[_0x8f21('0x5c')]['rawAttributes']);_0x41bd12[_0x8f21('0x3e')]=_['keys'](_0x506163[_0x8f21('0x3e')]);_0x41bd12['filters']=_[_0x8f21('0x41')](_0x41bd12[_0x8f21('0x3d')],_0x41bd12[_0x8f21('0x3e')]);_0x18fc26[_0x8f21('0x42')]=_[_0x8f21('0x41')](_0x41bd12['model'],qs[_0x8f21('0x43')](_0x506163['query'][_0x8f21('0x43')]));_0x18fc26['attributes']=_0x18fc26[_0x8f21('0x42')][_0x8f21('0x44')]?_0x18fc26[_0x8f21('0x42')]:_0x41bd12['model'];_0x18fc26[_0x8f21('0x47')]=qs['sort'](_0x506163[_0x8f21('0x3e')][_0x8f21('0x48')]);_0x18fc26[_0x8f21('0x49')]=qs[_0x8f21('0x40')](_[_0x8f21('0x57')](_0x506163['query'],_0x41bd12[_0x8f21('0x40')]));if(_0x506163['query'][_0x8f21('0x4a')]){_0x18fc26[_0x8f21('0x49')]=_[_0x8f21('0x4b')](_0x18fc26[_0x8f21('0x49')],{'$or':_['map'](_0x18fc26['attributes'],function(_0x3d12f2){var _0x4f235c={};_0x4f235c[_0x3d12f2]={'$like':'%'+_0x506163['query'][_0x8f21('0x4a')]+'%'};return _0x4f235c;})});}_0x18fc26=_[_0x8f21('0x4b')]({},_0x18fc26,_0x506163['options']);return _0x40f183[_0x8f21('0x5b')](_0x18fc26);}})[_0x8f21('0x1b')](function(_0x29881d){if(_0x29881d){_0x4b3de4=_0x29881d['length'];if(!_0x506163[_0x8f21('0x3e')][_0x8f21('0x45')](_0x8f21('0x46'))){_0x18fc26['limit']=qs['limit'](_0x506163[_0x8f21('0x3e')][_0x8f21('0x2d')]);_0x18fc26[_0x8f21('0x2c')]=qs[_0x8f21('0x2c')](_0x506163['query'][_0x8f21('0x2c')]);}return _0x40f183['getTags'](_0x18fc26);}})[_0x8f21('0x1b')](function(_0x22b50f){if(_0x22b50f){return _0x22b50f?{'count':_0x4b3de4,'rows':_0x22b50f}:null;}})['then'](respondWithResult(_0x536e6b,null))[_0x8f21('0x26')](handleError(_0x536e6b,null));};exports[_0x8f21('0x5d')]=function(_0xb8c896,_0x3d9dde,_0xc806fa){if(_0xb8c896[_0x8f21('0x5e')]['id']){delete _0xb8c896['body']['id'];}return db[_0x8f21('0x3a')][_0x8f21('0x55')]({'where':{'id':_0xb8c896['params']['id']}})[_0x8f21('0x1b')](handleEntityNotFound(_0x3d9dde,null))[_0x8f21('0x1b')](function(_0x4d6357){if(_0x4d6357){return _0x4d6357['setTags'](_0xb8c896[_0x8f21('0x5e')]['ids']||[]);}return null;})[_0x8f21('0x1b')](respondWithResult(_0x3d9dde,null))[_0x8f21('0x26')](handleError(_0x3d9dde,null));}; \ No newline at end of file +var _0xbc89=['offset','limit','set','Content-Range','apply','reject','save','update','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','DeskConfiguration','count','includeAll','findAll','rows','params','include','find','create','body','getFields','findOne','DeskField','filters','nolimit','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','ValidationError','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','end','status','json'];(function(_0x26e747,_0x2e098f){var _0x151196=function(_0x29fcd0){while(--_0x29fcd0){_0x26e747['push'](_0x26e747['shift']());}};_0x151196(++_0x2e098f);}(_0xbc89,0x99));var _0x9bc8=function(_0x77d310,_0x2b2fe7){_0x77d310=_0x77d310-0x0;var _0x2cdce4=_0xbc89[_0x77d310];return _0x2cdce4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9bc8('0x0'));var rimraf=require(_0x9bc8('0x1'));var zipdir=require(_0x9bc8('0x2'));var jsonpatch=require(_0x9bc8('0x3'));var rp=require(_0x9bc8('0x4'));var moment=require(_0x9bc8('0x5'));var BPromise=require(_0x9bc8('0x6'));var Mustache=require(_0x9bc8('0x7'));var util=require(_0x9bc8('0x8'));var path=require(_0x9bc8('0x9'));var sox=require(_0x9bc8('0xa'));var csv=require(_0x9bc8('0xb'));var ejs=require(_0x9bc8('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9bc8('0xd'));var crypto=require(_0x9bc8('0xe'));var jsforce=require(_0x9bc8('0xf'));var deskjs=require(_0x9bc8('0x10'));var toCsv=require(_0x9bc8('0xb'));var querystring=require(_0x9bc8('0x11'));var Papa=require(_0x9bc8('0x12'));var Redis=require(_0x9bc8('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x9bc8('0x14'));var as=require(_0x9bc8('0x15'));var hardwareService=require(_0x9bc8('0x16'));var logger=require(_0x9bc8('0x17'))(_0x9bc8('0x18'));var utils=require('../../config/utils');var config=require(_0x9bc8('0x19'));var db=require(_0x9bc8('0x1a'))['db'];var jayson=require(_0x9bc8('0x1b'));var client=jayson[_0x9bc8('0x1c')][_0x9bc8('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x3898ba,_0x2370f3,_0x177f91){if(_0x177f91){var _0x26a4e3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x26a4e3[_0x9bc8('0x1e')](_0x2370f3)){return _0x3898ba;}else{throw new db['Sequelize'][(_0x9bc8('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 _0x3898ba;}}function respondWithRpcPromise(_0xf045b1,_0x486447,_0x2aaa97,_0x3228a7){return new BPromise(function(_0x391bb1,_0x77665){var _0x287981=_0x3228a7||client;return _0x287981[_0x9bc8('0x20')](_0xf045b1,_0x2aaa97)[_0x9bc8('0x21')](function(_0x35e569){logger[_0x9bc8('0x22')](_0x9bc8('0x23'),_0x486447,_0x9bc8('0x24'));logger[_0x9bc8('0x25')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x486447,_0x9bc8('0x24'),JSON[_0x9bc8('0x26')](_0x35e569));if(_0x35e569[_0x9bc8('0x27')]){if(_0x35e569['error'][_0x9bc8('0x28')]===0x1f4){logger['error'](_0x9bc8('0x23'),_0x486447,_0x35e569[_0x9bc8('0x27')]['message']);return _0x77665(_0x35e569[_0x9bc8('0x27')][_0x9bc8('0x29')]);}logger[_0x9bc8('0x27')](_0x9bc8('0x23'),_0x486447,_0x35e569[_0x9bc8('0x27')][_0x9bc8('0x29')]);return _0x391bb1(_0x35e569['error'][_0x9bc8('0x29')]);}else{logger[_0x9bc8('0x22')](_0x9bc8('0x23'),_0x486447,_0x9bc8('0x24'));_0x391bb1(_0x35e569['result']['message']);}})[_0x9bc8('0x2a')](function(_0x462dfe){logger['error'](_0x9bc8('0x23'),_0x486447,_0x462dfe);_0x77665(_0x462dfe);});});}function respondWithStatusCode(_0x6aa3a6,_0x3a189c){_0x3a189c=_0x3a189c||0xcc;return function(_0x9a9c09){if(_0x9a9c09){return _0x6aa3a6[_0x9bc8('0x2b')](_0x3a189c);}return _0x6aa3a6['status'](_0x3a189c)[_0x9bc8('0x2c')]();};}function respondWithResult(_0x35c137,_0x5045ef){_0x5045ef=_0x5045ef||0xc8;return function(_0x2871f2){if(_0x2871f2){return _0x35c137[_0x9bc8('0x2d')](_0x5045ef)[_0x9bc8('0x2e')](_0x2871f2);}};}function respondWithFilteredResult(_0x837599,_0x1d685a){return function(_0x188da5){if(_0x188da5){var _0x78dafb=_0x188da5['count'],_0x24a98b=_0x1d685a[_0x9bc8('0x2f')],_0x8262b2=_0x1d685a[_0x9bc8('0x2f')]+_0x1d685a[_0x9bc8('0x30')],_0x302af2;if(_0x8262b2>=_0x78dafb){_0x8262b2=_0x78dafb;_0x302af2=0xc8;}else{_0x302af2=0xce;}_0x837599[_0x9bc8('0x2d')](_0x302af2);return _0x837599[_0x9bc8('0x31')](_0x9bc8('0x32'),_0x24a98b+'-'+_0x8262b2+'/'+_0x78dafb)[_0x9bc8('0x2e')](_0x188da5);}return null;};}function patchUpdates(_0x2808cc){return function(_0x45a1be){try{jsonpatch[_0x9bc8('0x33')](_0x45a1be,_0x2808cc,!![]);}catch(_0x158f14){return BPromise[_0x9bc8('0x34')](_0x158f14);}return _0x45a1be[_0x9bc8('0x35')]();};}function saveUpdates(_0x190524,_0x416800){return function(_0x37305c){if(_0x37305c){return _0x37305c[_0x9bc8('0x36')](_0x190524)[_0x9bc8('0x21')](function(_0x42d18d){return _0x42d18d;});}return null;};}function removeEntity(_0x3b556f,_0x5ee324){return function(_0x400413){if(_0x400413){return _0x400413['destroy']()[_0x9bc8('0x21')](function(){_0x3b556f[_0x9bc8('0x2d')](0xcc)[_0x9bc8('0x2c')]();});}};}function handleEntityNotFound(_0x565cce,_0x26b87e){return function(_0x50e519){if(!_0x50e519){_0x565cce[_0x9bc8('0x2b')](0x194);}return _0x50e519;};}function handleError(_0x450c77,_0x4b6a5f){_0x4b6a5f=_0x4b6a5f||0x1f4;return function(_0xa036b0){logger['error'](_0xa036b0[_0x9bc8('0x37')]);if(_0xa036b0[_0x9bc8('0x38')]){delete _0xa036b0[_0x9bc8('0x38')];}_0x450c77[_0x9bc8('0x2d')](_0x4b6a5f)[_0x9bc8('0x39')](_0xa036b0);};}exports['index']=function(_0x415cf8,_0x2bd6da){var _0x212ddd={},_0x3f6ef2={},_0x26caae={'count':0x0,'rows':[]};var _0x2cee07=_['map'](db['DeskConfiguration'][_0x9bc8('0x3a')],function(_0x194e88){return{'name':_0x194e88[_0x9bc8('0x3b')],'type':_0x194e88[_0x9bc8('0x3c')][_0x9bc8('0x3d')]};});_0x3f6ef2[_0x9bc8('0x3e')]=_[_0x9bc8('0x3f')](_0x2cee07,_0x9bc8('0x38'));_0x3f6ef2[_0x9bc8('0x40')]=_[_0x9bc8('0x41')](_0x415cf8['query']);_0x3f6ef2['filters']=_[_0x9bc8('0x42')](_0x3f6ef2['model'],_0x3f6ef2['query']);_0x212ddd[_0x9bc8('0x43')]=_[_0x9bc8('0x42')](_0x3f6ef2[_0x9bc8('0x3e')],qs[_0x9bc8('0x44')](_0x415cf8[_0x9bc8('0x40')][_0x9bc8('0x44')]));_0x212ddd[_0x9bc8('0x43')]=_0x212ddd[_0x9bc8('0x43')][_0x9bc8('0x45')]?_0x212ddd[_0x9bc8('0x43')]:_0x3f6ef2[_0x9bc8('0x3e')];if(!_0x415cf8['query'][_0x9bc8('0x46')]('nolimit')){_0x212ddd[_0x9bc8('0x30')]=qs[_0x9bc8('0x30')](_0x415cf8[_0x9bc8('0x40')][_0x9bc8('0x30')]);_0x212ddd['offset']=qs[_0x9bc8('0x2f')](_0x415cf8['query']['offset']);}_0x212ddd[_0x9bc8('0x47')]=qs[_0x9bc8('0x48')](_0x415cf8[_0x9bc8('0x40')]['sort']);_0x212ddd[_0x9bc8('0x49')]=qs['filters'](_[_0x9bc8('0x4a')](_0x415cf8['query'],_0x3f6ef2['filters']));if(_0x415cf8['query']['filter']){_0x212ddd['where']=_[_0x9bc8('0x4b')](_0x212ddd[_0x9bc8('0x49')],{'$or':_[_0x9bc8('0x3f')](_0x2cee07,function(_0x505d04){if(_0x505d04[_0x9bc8('0x3c')]!==_0x9bc8('0x4c')){var _0x3058de={};_0x3058de[_0x505d04[_0x9bc8('0x38')]]={'$like':'%'+_0x415cf8[_0x9bc8('0x40')][_0x9bc8('0x4d')]+'%'};return _0x3058de;}})});}_0x212ddd=_[_0x9bc8('0x4b')]({},_0x212ddd,_0x415cf8[_0x9bc8('0x4e')]);var _0x1e74f0={'where':_0x212ddd['where']};return db[_0x9bc8('0x4f')]['count'](_0x1e74f0)[_0x9bc8('0x21')](function(_0xeb734d){_0x26caae[_0x9bc8('0x50')]=_0xeb734d;if(_0x415cf8[_0x9bc8('0x40')][_0x9bc8('0x51')]){_0x212ddd['include']=[{'all':!![]}];}return db[_0x9bc8('0x4f')][_0x9bc8('0x52')](_0x212ddd);})[_0x9bc8('0x21')](function(_0x4dcc3a){_0x26caae[_0x9bc8('0x53')]=_0x4dcc3a;return _0x26caae;})[_0x9bc8('0x21')](respondWithFilteredResult(_0x2bd6da,_0x212ddd))[_0x9bc8('0x2a')](handleError(_0x2bd6da,null));};exports['show']=function(_0x1579c5,_0x4f6e9c){var _0x42776f={'raw':![],'where':{'id':_0x1579c5[_0x9bc8('0x54')]['id']}},_0x298eb5={};_0x298eb5[_0x9bc8('0x3e')]=_[_0x9bc8('0x41')](db['DeskConfiguration'][_0x9bc8('0x3a')]);_0x298eb5[_0x9bc8('0x40')]=_[_0x9bc8('0x41')](_0x1579c5[_0x9bc8('0x40')]);_0x298eb5['filters']=_[_0x9bc8('0x42')](_0x298eb5['model'],_0x298eb5[_0x9bc8('0x40')]);_0x42776f[_0x9bc8('0x43')]=_['intersection'](_0x298eb5[_0x9bc8('0x3e')],qs[_0x9bc8('0x44')](_0x1579c5[_0x9bc8('0x40')][_0x9bc8('0x44')]));_0x42776f[_0x9bc8('0x43')]=_0x42776f[_0x9bc8('0x43')][_0x9bc8('0x45')]?_0x42776f['attributes']:_0x298eb5[_0x9bc8('0x3e')];if(_0x1579c5['query'][_0x9bc8('0x51')]){_0x42776f[_0x9bc8('0x55')]=[{'all':!![]}];}_0x42776f=_[_0x9bc8('0x4b')]({},_0x42776f,_0x1579c5[_0x9bc8('0x4e')]);return db[_0x9bc8('0x4f')][_0x9bc8('0x56')](_0x42776f)[_0x9bc8('0x21')](handleEntityNotFound(_0x4f6e9c,null))[_0x9bc8('0x21')](respondWithResult(_0x4f6e9c,null))[_0x9bc8('0x2a')](handleError(_0x4f6e9c,null));};exports[_0x9bc8('0x57')]=function(_0x60afb9,_0x268311){return db[_0x9bc8('0x4f')][_0x9bc8('0x57')](_0x60afb9[_0x9bc8('0x58')],{})[_0x9bc8('0x21')](respondWithResult(_0x268311,0xc9))['catch'](handleError(_0x268311,null));};exports[_0x9bc8('0x36')]=function(_0x175da6,_0x1b9db1){if(_0x175da6[_0x9bc8('0x58')]['id']){delete _0x175da6[_0x9bc8('0x58')]['id'];}return db[_0x9bc8('0x4f')][_0x9bc8('0x56')]({'where':{'id':_0x175da6['params']['id']}})[_0x9bc8('0x21')](handleEntityNotFound(_0x1b9db1,null))[_0x9bc8('0x21')](saveUpdates(_0x175da6[_0x9bc8('0x58')],null))[_0x9bc8('0x21')](respondWithResult(_0x1b9db1,null))[_0x9bc8('0x2a')](handleError(_0x1b9db1,null));};exports['destroy']=function(_0x250ac9,_0x54159a){return db[_0x9bc8('0x4f')][_0x9bc8('0x56')]({'where':{'id':_0x250ac9[_0x9bc8('0x54')]['id']}})[_0x9bc8('0x21')](handleEntityNotFound(_0x54159a,null))['then'](removeEntity(_0x54159a,null))[_0x9bc8('0x2a')](handleError(_0x54159a,null));};exports[_0x9bc8('0x59')]=function(_0x4ac2f2,_0x2e81fd,_0x49107e){var _0x102c83={};var _0x538f50={};var _0x36749c;var _0xead1bf;return db[_0x9bc8('0x4f')][_0x9bc8('0x5a')]({'where':{'id':_0x4ac2f2['params']['id']}})[_0x9bc8('0x21')](handleEntityNotFound(_0x2e81fd,null))[_0x9bc8('0x21')](function(_0x585655){if(_0x585655){_0x36749c=_0x585655;_0x538f50[_0x9bc8('0x3e')]=_[_0x9bc8('0x41')](db[_0x9bc8('0x5b')][_0x9bc8('0x3a')]);_0x538f50[_0x9bc8('0x40')]=_['keys'](_0x4ac2f2[_0x9bc8('0x40')]);_0x538f50[_0x9bc8('0x5c')]=_['intersection'](_0x538f50[_0x9bc8('0x3e')],_0x538f50[_0x9bc8('0x40')]);_0x102c83['attributes']=_['intersection'](_0x538f50['model'],qs[_0x9bc8('0x44')](_0x4ac2f2[_0x9bc8('0x40')]['fields']));_0x102c83['attributes']=_0x102c83['attributes'][_0x9bc8('0x45')]?_0x102c83[_0x9bc8('0x43')]:_0x538f50['model'];_0x102c83[_0x9bc8('0x47')]=qs[_0x9bc8('0x48')](_0x4ac2f2[_0x9bc8('0x40')][_0x9bc8('0x48')]);_0x102c83[_0x9bc8('0x49')]=qs['filters'](_[_0x9bc8('0x4a')](_0x4ac2f2['query'],_0x538f50[_0x9bc8('0x5c')]));if(_0x4ac2f2[_0x9bc8('0x40')][_0x9bc8('0x4d')]){_0x102c83[_0x9bc8('0x49')]=_[_0x9bc8('0x4b')](_0x102c83[_0x9bc8('0x49')],{'$or':_[_0x9bc8('0x3f')](_0x102c83['attributes'],function(_0x2b387e){var _0x3cbd62={};_0x3cbd62[_0x2b387e]={'$like':'%'+_0x4ac2f2[_0x9bc8('0x40')][_0x9bc8('0x4d')]+'%'};return _0x3cbd62;})});}_0x102c83=_[_0x9bc8('0x4b')]({},_0x102c83,_0x4ac2f2['options']);return _0x36749c[_0x9bc8('0x59')](_0x102c83);}})[_0x9bc8('0x21')](function(_0x144812){if(_0x144812){_0xead1bf=_0x144812[_0x9bc8('0x45')];if(!_0x4ac2f2[_0x9bc8('0x40')][_0x9bc8('0x46')](_0x9bc8('0x5d'))){_0x102c83[_0x9bc8('0x30')]=qs['limit'](_0x4ac2f2[_0x9bc8('0x40')][_0x9bc8('0x30')]);_0x102c83[_0x9bc8('0x2f')]=qs[_0x9bc8('0x2f')](_0x4ac2f2['query'][_0x9bc8('0x2f')]);}return _0x36749c[_0x9bc8('0x59')](_0x102c83);}})[_0x9bc8('0x21')](function(_0x266bdd){if(_0x266bdd){return _0x266bdd?{'count':_0xead1bf,'rows':_0x266bdd}:null;}})[_0x9bc8('0x21')](respondWithResult(_0x2e81fd,null))[_0x9bc8('0x2a')](handleError(_0x2e81fd,null));};exports[_0x9bc8('0x5e')]=function(_0x241c34,_0x4d1dc4,_0x12f06d){var _0x109819={};var _0x1eaf8d={};var _0x20310a;var _0x1e892a;return db['DeskConfiguration']['findOne']({'where':{'id':_0x241c34[_0x9bc8('0x54')]['id']}})[_0x9bc8('0x21')](handleEntityNotFound(_0x4d1dc4,null))[_0x9bc8('0x21')](function(_0x51212d){if(_0x51212d){_0x20310a=_0x51212d;_0x1eaf8d[_0x9bc8('0x3e')]=_[_0x9bc8('0x41')](db[_0x9bc8('0x5b')]['rawAttributes']);_0x1eaf8d['query']=_[_0x9bc8('0x41')](_0x241c34['query']);_0x1eaf8d[_0x9bc8('0x5c')]=_['intersection'](_0x1eaf8d['model'],_0x1eaf8d[_0x9bc8('0x40')]);_0x109819[_0x9bc8('0x43')]=_[_0x9bc8('0x42')](_0x1eaf8d['model'],qs[_0x9bc8('0x44')](_0x241c34[_0x9bc8('0x40')][_0x9bc8('0x44')]));_0x109819[_0x9bc8('0x43')]=_0x109819[_0x9bc8('0x43')][_0x9bc8('0x45')]?_0x109819['attributes']:_0x1eaf8d['model'];_0x109819['order']=qs[_0x9bc8('0x48')](_0x241c34[_0x9bc8('0x40')]['sort']);_0x109819['where']=qs[_0x9bc8('0x5c')](_[_0x9bc8('0x4a')](_0x241c34['query'],_0x1eaf8d[_0x9bc8('0x5c')]));if(_0x241c34['query']['filter']){_0x109819[_0x9bc8('0x49')]=_['merge'](_0x109819[_0x9bc8('0x49')],{'$or':_[_0x9bc8('0x3f')](_0x109819['attributes'],function(_0x59a6c2){var _0x1f2cb2={};_0x1f2cb2[_0x59a6c2]={'$like':'%'+_0x241c34[_0x9bc8('0x40')][_0x9bc8('0x4d')]+'%'};return _0x1f2cb2;})});}_0x109819=_[_0x9bc8('0x4b')]({},_0x109819,_0x241c34[_0x9bc8('0x4e')]);return _0x20310a['getSubjects'](_0x109819);}})[_0x9bc8('0x21')](function(_0x35b87c){if(_0x35b87c){_0x1e892a=_0x35b87c['length'];if(!_0x241c34[_0x9bc8('0x40')]['hasOwnProperty'](_0x9bc8('0x5d'))){_0x109819[_0x9bc8('0x30')]=qs[_0x9bc8('0x30')](_0x241c34[_0x9bc8('0x40')][_0x9bc8('0x30')]);_0x109819[_0x9bc8('0x2f')]=qs[_0x9bc8('0x2f')](_0x241c34['query']['offset']);}return _0x20310a['getSubjects'](_0x109819);}})['then'](function(_0xd5fe23){if(_0xd5fe23){return _0xd5fe23?{'count':_0x1e892a,'rows':_0xd5fe23}:null;}})[_0x9bc8('0x21')](respondWithResult(_0x4d1dc4,null))[_0x9bc8('0x2a')](handleError(_0x4d1dc4,null));};exports[_0x9bc8('0x5f')]=function(_0x55a03d,_0x2b742c,_0x25e59f){var _0x3729f5={};var _0x5976ca={};var _0x1214f9;var _0x5c24a8;return db['DeskConfiguration']['findOne']({'where':{'id':_0x55a03d[_0x9bc8('0x54')]['id']}})[_0x9bc8('0x21')](handleEntityNotFound(_0x2b742c,null))[_0x9bc8('0x21')](function(_0x2a9938){if(_0x2a9938){_0x1214f9=_0x2a9938;_0x5976ca[_0x9bc8('0x3e')]=_[_0x9bc8('0x41')](db[_0x9bc8('0x5b')][_0x9bc8('0x3a')]);_0x5976ca[_0x9bc8('0x40')]=_[_0x9bc8('0x41')](_0x55a03d[_0x9bc8('0x40')]);_0x5976ca['filters']=_[_0x9bc8('0x42')](_0x5976ca['model'],_0x5976ca[_0x9bc8('0x40')]);_0x3729f5[_0x9bc8('0x43')]=_[_0x9bc8('0x42')](_0x5976ca['model'],qs[_0x9bc8('0x44')](_0x55a03d[_0x9bc8('0x40')][_0x9bc8('0x44')]));_0x3729f5[_0x9bc8('0x43')]=_0x3729f5['attributes'][_0x9bc8('0x45')]?_0x3729f5[_0x9bc8('0x43')]:_0x5976ca[_0x9bc8('0x3e')];_0x3729f5[_0x9bc8('0x47')]=qs[_0x9bc8('0x48')](_0x55a03d['query'][_0x9bc8('0x48')]);_0x3729f5[_0x9bc8('0x49')]=qs[_0x9bc8('0x5c')](_[_0x9bc8('0x4a')](_0x55a03d[_0x9bc8('0x40')],_0x5976ca[_0x9bc8('0x5c')]));if(_0x55a03d[_0x9bc8('0x40')][_0x9bc8('0x4d')]){_0x3729f5[_0x9bc8('0x49')]=_[_0x9bc8('0x4b')](_0x3729f5[_0x9bc8('0x49')],{'$or':_[_0x9bc8('0x3f')](_0x3729f5[_0x9bc8('0x43')],function(_0x2cd94f){var _0x3f6409={};_0x3f6409[_0x2cd94f]={'$like':'%'+_0x55a03d[_0x9bc8('0x40')]['filter']+'%'};return _0x3f6409;})});}_0x3729f5=_[_0x9bc8('0x4b')]({},_0x3729f5,_0x55a03d[_0x9bc8('0x4e')]);return _0x1214f9['getDescriptions'](_0x3729f5);}})[_0x9bc8('0x21')](function(_0x5b02d3){if(_0x5b02d3){_0x5c24a8=_0x5b02d3[_0x9bc8('0x45')];if(!_0x55a03d['query'][_0x9bc8('0x46')](_0x9bc8('0x5d'))){_0x3729f5[_0x9bc8('0x30')]=qs[_0x9bc8('0x30')](_0x55a03d[_0x9bc8('0x40')]['limit']);_0x3729f5['offset']=qs[_0x9bc8('0x2f')](_0x55a03d['query'][_0x9bc8('0x2f')]);}return _0x1214f9[_0x9bc8('0x5f')](_0x3729f5);}})[_0x9bc8('0x21')](function(_0x352b60){if(_0x352b60){return _0x352b60?{'count':_0x5c24a8,'rows':_0x352b60}:null;}})[_0x9bc8('0x21')](respondWithResult(_0x2b742c,null))['catch'](handleError(_0x2b742c,null));};exports['getTags']=function(_0x58dbab,_0x3a0e3b,_0x238ee6){var _0x5d9880={};var _0x51dfd9={};var _0x4ddf8c;var _0x35bba3;return db[_0x9bc8('0x4f')]['findOne']({'where':{'id':_0x58dbab[_0x9bc8('0x54')]['id']}})[_0x9bc8('0x21')](handleEntityNotFound(_0x3a0e3b,null))[_0x9bc8('0x21')](function(_0x10e573){if(_0x10e573){_0x4ddf8c=_0x10e573;_0x51dfd9[_0x9bc8('0x3e')]=_[_0x9bc8('0x41')](db[_0x9bc8('0x60')]['rawAttributes']);_0x51dfd9[_0x9bc8('0x40')]=_[_0x9bc8('0x41')](_0x58dbab[_0x9bc8('0x40')]);_0x51dfd9['filters']=_[_0x9bc8('0x42')](_0x51dfd9[_0x9bc8('0x3e')],_0x51dfd9['query']);_0x5d9880['attributes']=_[_0x9bc8('0x42')](_0x51dfd9[_0x9bc8('0x3e')],qs['fields'](_0x58dbab['query'][_0x9bc8('0x44')]));_0x5d9880[_0x9bc8('0x43')]=_0x5d9880[_0x9bc8('0x43')][_0x9bc8('0x45')]?_0x5d9880[_0x9bc8('0x43')]:_0x51dfd9['model'];_0x5d9880[_0x9bc8('0x47')]=qs[_0x9bc8('0x48')](_0x58dbab[_0x9bc8('0x40')][_0x9bc8('0x48')]);_0x5d9880[_0x9bc8('0x49')]=qs['filters'](_[_0x9bc8('0x4a')](_0x58dbab[_0x9bc8('0x40')],_0x51dfd9[_0x9bc8('0x5c')]));if(_0x58dbab[_0x9bc8('0x40')][_0x9bc8('0x4d')]){_0x5d9880[_0x9bc8('0x49')]=_[_0x9bc8('0x4b')](_0x5d9880[_0x9bc8('0x49')],{'$or':_[_0x9bc8('0x3f')](_0x5d9880['attributes'],function(_0x387cde){var _0xbdb21a={};_0xbdb21a[_0x387cde]={'$like':'%'+_0x58dbab[_0x9bc8('0x40')][_0x9bc8('0x4d')]+'%'};return _0xbdb21a;})});}_0x5d9880=_[_0x9bc8('0x4b')]({},_0x5d9880,_0x58dbab['options']);return _0x4ddf8c[_0x9bc8('0x61')](_0x5d9880);}})['then'](function(_0x936b9a){if(_0x936b9a){_0x35bba3=_0x936b9a[_0x9bc8('0x45')];if(!_0x58dbab['query'][_0x9bc8('0x46')](_0x9bc8('0x5d'))){_0x5d9880[_0x9bc8('0x30')]=qs['limit'](_0x58dbab[_0x9bc8('0x40')][_0x9bc8('0x30')]);_0x5d9880[_0x9bc8('0x2f')]=qs[_0x9bc8('0x2f')](_0x58dbab[_0x9bc8('0x40')][_0x9bc8('0x2f')]);}return _0x4ddf8c[_0x9bc8('0x61')](_0x5d9880);}})['then'](function(_0x5d4908){if(_0x5d4908){return _0x5d4908?{'count':_0x35bba3,'rows':_0x5d4908}:null;}})[_0x9bc8('0x21')](respondWithResult(_0x3a0e3b,null))[_0x9bc8('0x2a')](handleError(_0x3a0e3b,null));};exports['setTags']=function(_0x240e7f,_0x2167ec,_0x1328e9){if(_0x240e7f[_0x9bc8('0x58')]['id']){delete _0x240e7f[_0x9bc8('0x58')]['id'];}return db[_0x9bc8('0x4f')][_0x9bc8('0x5a')]({'where':{'id':_0x240e7f[_0x9bc8('0x54')]['id']}})[_0x9bc8('0x21')](handleEntityNotFound(_0x2167ec,null))[_0x9bc8('0x21')](function(_0x1cedce){if(_0x1cedce){return _0x1cedce[_0x9bc8('0x62')](_0x240e7f[_0x9bc8('0x58')][_0x9bc8('0x63')]||[]);}return null;})[_0x9bc8('0x21')](respondWithResult(_0x2167ec,null))[_0x9bc8('0x2a')](handleError(_0x2167ec,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 0a8c5d5..0599347 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 _0xf6a9=['DeskConfiguration','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./intDeskConfiguration.attributes','exports','define'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf6a9,0x1d5));var _0x9f6a=function(_0x3c63f5,_0x172a30){_0x3c63f5=_0x3c63f5-0x0;var _0xaf7055=_0xf6a9[_0x3c63f5];return _0xaf7055;};'use strict';var _=require(_0x9f6a('0x0'));var util=require(_0x9f6a('0x1'));var logger=require('../../config/logger')(_0x9f6a('0x2'));var moment=require(_0x9f6a('0x3'));var BPromise=require(_0x9f6a('0x4'));var rp=require(_0x9f6a('0x5'));var fs=require('fs');var path=require(_0x9f6a('0x6'));var rimraf=require(_0x9f6a('0x7'));var config=require('../../config/environment');var attributes=require(_0x9f6a('0x8'));module[_0x9f6a('0x9')]=function(_0x4f6daf,_0x265683){return _0x4f6daf[_0x9f6a('0xa')](_0x9f6a('0xb'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe70c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','lodash','util','api'];(function(_0x1f3bbd,_0x1a115f){var _0x131496=function(_0x5c2c89){while(--_0x5c2c89){_0x1f3bbd['push'](_0x1f3bbd['shift']());}};_0x131496(++_0x1a115f);}(_0xe70c,0x7f));var _0xce70=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xe70c[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0xce70('0x0'));var util=require(_0xce70('0x1'));var logger=require('../../config/logger')(_0xce70('0x2'));var moment=require(_0xce70('0x3'));var BPromise=require(_0xce70('0x4'));var rp=require(_0xce70('0x5'));var fs=require('fs');var path=require(_0xce70('0x6'));var rimraf=require(_0xce70('0x7'));var config=require(_0xce70('0x8'));var attributes=require(_0xce70('0x9'));module[_0xce70('0xa')]=function(_0x549c20,_0x3e4bfd){return _0x549c20[_0xce70('0xb')](_0xce70('0xc'),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 8df2919..131f1f4 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 _0x2c6a=['request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','DeskConfiguration,\x20%s,\x20%s'];(function(_0x1cb7a6,_0x27884e){var _0x9d7800=function(_0x1710c5){while(--_0x1710c5){_0x1cb7a6['push'](_0x1cb7a6['shift']());}};_0x9d7800(++_0x27884e);}(_0x2c6a,0xa7));var _0xa2c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c6a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa2c6('0x0'));var util=require(_0xa2c6('0x1'));var moment=require(_0xa2c6('0x2'));var BPromise=require(_0xa2c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa2c6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa2c6('0x5'))(_0xa2c6('0x6'));var config=require(_0xa2c6('0x7'));var jayson=require(_0xa2c6('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1a9131,_0x1fa65f,_0x3d1aa0){return new BPromise(function(_0x11aa17,_0x3c2894){return client[_0xa2c6('0x9')](_0x1a9131,_0x3d1aa0)[_0xa2c6('0xa')](function(_0x4b0bdf){logger[_0xa2c6('0xb')](_0xa2c6('0xc'),_0x1fa65f,_0xa2c6('0xd'));logger[_0xa2c6('0xe')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x1fa65f,_0xa2c6('0xd'),JSON['stringify'](_0x4b0bdf));if(_0x4b0bdf[_0xa2c6('0xf')]){if(_0x4b0bdf[_0xa2c6('0xf')][_0xa2c6('0x10')]===0x1f4){logger[_0xa2c6('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x1fa65f,_0x4b0bdf[_0xa2c6('0xf')][_0xa2c6('0x11')]);return _0x3c2894(_0x4b0bdf[_0xa2c6('0xf')]['message']);}logger[_0xa2c6('0xf')](_0xa2c6('0xc'),_0x1fa65f,_0x4b0bdf[_0xa2c6('0xf')][_0xa2c6('0x11')]);return _0x11aa17(_0x4b0bdf[_0xa2c6('0xf')]['message']);}else{logger[_0xa2c6('0xb')](_0xa2c6('0xc'),_0x1fa65f,_0xa2c6('0xd'));_0x11aa17(_0x4b0bdf[_0xa2c6('0x12')][_0xa2c6('0x11')]);}})[_0xa2c6('0x13')](function(_0x4fd220){logger[_0xa2c6('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x1fa65f,_0x4fd220);_0x3c2894(_0x4fd220);});});} \ No newline at end of file +var _0x54f3=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','then','info','DeskConfiguration,\x20%s,\x20%s','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','util'];(function(_0x5021a9,_0x1b0d0a){var _0x516edd=function(_0x6265dc){while(--_0x6265dc){_0x5021a9['push'](_0x5021a9['shift']());}};_0x516edd(++_0x1b0d0a);}(_0x54f3,0x120));var _0x354f=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x54f3[_0x4b055c];return _0x4b62bb;};'use strict';var _=require('lodash');var util=require(_0x354f('0x0'));var moment=require(_0x354f('0x1'));var BPromise=require(_0x354f('0x2'));var rs=require(_0x354f('0x3'));var fs=require('fs');var Redis=require(_0x354f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x354f('0x5'))(_0x354f('0x6'));var config=require(_0x354f('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x354f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51cd16,_0x1da503,_0x4311ad){return new BPromise(function(_0x2f111a,_0x173e1d){return client['request'](_0x51cd16,_0x4311ad)[_0x354f('0x9')](function(_0x5d1e5d){logger[_0x354f('0xa')](_0x354f('0xb'),_0x1da503,'request\x20sent');logger['debug'](_0x354f('0xc'),_0x1da503,_0x354f('0xd'),JSON['stringify'](_0x5d1e5d));if(_0x5d1e5d[_0x354f('0xe')]){if(_0x5d1e5d[_0x354f('0xe')]['code']===0x1f4){logger[_0x354f('0xe')](_0x354f('0xb'),_0x1da503,_0x5d1e5d[_0x354f('0xe')][_0x354f('0xf')]);return _0x173e1d(_0x5d1e5d[_0x354f('0xe')][_0x354f('0xf')]);}logger[_0x354f('0xe')]('DeskConfiguration,\x20%s,\x20%s',_0x1da503,_0x5d1e5d[_0x354f('0xe')][_0x354f('0xf')]);return _0x2f111a(_0x5d1e5d[_0x354f('0xe')]['message']);}else{logger[_0x354f('0xa')](_0x354f('0xb'),_0x1da503,_0x354f('0xd'));_0x2f111a(_0x5d1e5d['result']['message']);}})[_0x354f('0x10')](function(_0x1d7627){logger[_0x354f('0xe')](_0x354f('0xb'),_0x1da503,_0x1d7627);_0x173e1d(_0x1d7627);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 45f88fa..dd86149 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 _0x1227=['update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/:id','show','post','put'];(function(_0x262ccc,_0x1819b2){var _0x197054=function(_0x535584){while(--_0x535584){_0x262ccc['push'](_0x262ccc['shift']());}};_0x197054(++_0x1819b2);}(_0x1227,0x73));var _0x7122=function(_0x893302,_0x477c9f){_0x893302=_0x893302-0x0;var _0x43301f=_0x1227[_0x893302];return _0x43301f;};'use strict';var multer=require('multer');var util=require(_0x7122('0x0'));var path=require(_0x7122('0x1'));var timeout=require(_0x7122('0x2'));var express=require(_0x7122('0x3'));var router=express[_0x7122('0x4')]();var auth=require(_0x7122('0x5'));var interaction=require(_0x7122('0x6'));var config=require('../../config/environment');var controller=require('./intDeskField.controller');router['get']('/',auth[_0x7122('0x7')](),controller['index']);router[_0x7122('0x8')](_0x7122('0x9'),auth[_0x7122('0x7')](),controller[_0x7122('0xa')]);router[_0x7122('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7122('0xc')](_0x7122('0x9'),auth[_0x7122('0x7')](),controller[_0x7122('0xd')]);router[_0x7122('0xe')](_0x7122('0x9'),auth[_0x7122('0x7')](),controller['destroy']);module[_0x7122('0xf')]=router; \ No newline at end of file +var _0x3ded=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','update','delete'];(function(_0x3a33ff,_0x431390){var _0x214ba7=function(_0xfc57fc){while(--_0xfc57fc){_0x3a33ff['push'](_0x3a33ff['shift']());}};_0x214ba7(++_0x431390);}(_0x3ded,0x1f0));var _0xd3de=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x3ded[_0x138f59];return _0x3d114d;};'use strict';var multer=require('multer');var util=require(_0xd3de('0x0'));var path=require(_0xd3de('0x1'));var timeout=require(_0xd3de('0x2'));var express=require('express');var router=express[_0xd3de('0x3')]();var auth=require(_0xd3de('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd3de('0x5'));var controller=require('./intDeskField.controller');router[_0xd3de('0x6')]('/',auth[_0xd3de('0x7')](),controller[_0xd3de('0x8')]);router['get'](_0xd3de('0x9'),auth[_0xd3de('0x7')](),controller[_0xd3de('0xa')]);router[_0xd3de('0xb')]('/',auth[_0xd3de('0x7')](),controller['create']);router['put']('/:id',auth[_0xd3de('0x7')](),controller[_0xd3de('0xc')]);router[_0xd3de('0xd')](_0xd3de('0x9'),auth[_0xd3de('0x7')](),controller['destroy']);module[_0xd3de('0xe')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 2ccc810..700fd12 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 _0x2091=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports'];(function(_0x9383db,_0x16ae2a){var _0x40d237=function(_0x2b8536){while(--_0x2b8536){_0x9383db['push'](_0x9383db['shift']());}};_0x40d237(++_0x16ae2a);}(_0x2091,0x85));var _0x1209=function(_0x225d44,_0x399b52){_0x225d44=_0x225d44-0x0;var _0x4aa98a=_0x2091[_0x225d44];return _0x4aa98a;};'use strict';var Sequelize=require(_0x1209('0x0'));module[_0x1209('0x1')]={'type':{'type':Sequelize[_0x1209('0x2')](_0x1209('0x3'),_0x1209('0x4'),_0x1209('0x5'),_0x1209('0x6')),'defaultValue':_0x1209('0x3')},'content':{'type':Sequelize[_0x1209('0x7')]},'key':{'type':Sequelize[_0x1209('0x7')]},'keyType':{'type':Sequelize[_0x1209('0x2')](_0x1209('0x3'),_0x1209('0x4'),_0x1209('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1209('0x7')]},'nameField':{'type':Sequelize[_0x1209('0x7')]},'customField':{'type':Sequelize[_0x1209('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1209('0x7')]}}; \ No newline at end of file +var _0x803a=['sequelize','ENUM','variable','customVariable','keyValue','string','STRING','BOOLEAN'];(function(_0x5d44e9,_0x4bc46b){var _0x38d196=function(_0x33a769){while(--_0x33a769){_0x5d44e9['push'](_0x5d44e9['shift']());}};_0x38d196(++_0x4bc46b);}(_0x803a,0x1b0));var _0xa803=function(_0x32887d,_0x52b524){_0x32887d=_0x32887d-0x0;var _0x2f13d6=_0x803a[_0x32887d];return _0x2f13d6;};'use strict';var Sequelize=require(_0xa803('0x0'));module['exports']={'type':{'type':Sequelize[_0xa803('0x1')]('string',_0xa803('0x2'),_0xa803('0x3'),_0xa803('0x4')),'defaultValue':_0xa803('0x5')},'content':{'type':Sequelize[_0xa803('0x6')]},'key':{'type':Sequelize[_0xa803('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0xa803('0x2'),_0xa803('0x3'))},'keyContent':{'type':Sequelize[_0xa803('0x6')]},'idField':{'type':Sequelize[_0xa803('0x6')]},'nameField':{'type':Sequelize[_0xa803('0x6')]},'customField':{'type':Sequelize[_0xa803('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa803('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 952ab5c..e7d1d0e 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 _0x4944=['error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','DeskField','findAll','rows','catch','show','intersection','find','create','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','count','limit','set','Content-Range','apply','update','then','end'];(function(_0x27fe26,_0x3b8ca7){var _0x4fcb35=function(_0x35e0ae){while(--_0x35e0ae){_0x27fe26['push'](_0x27fe26['shift']());}};_0x4fcb35(++_0x3b8ca7);}(_0x4944,0x6d));var _0x4494=function(_0x5e5840,_0xc64374){_0x5e5840=_0x5e5840-0x0;var _0x1409aa=_0x4944[_0x5e5840];return _0x1409aa;};'use strict';var pdf=require(_0x4494('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4494('0x1'));var zipdir=require(_0x4494('0x2'));var jsonpatch=require(_0x4494('0x3'));var rp=require(_0x4494('0x4'));var moment=require(_0x4494('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4494('0x6'));var util=require('util');var path=require(_0x4494('0x7'));var sox=require(_0x4494('0x8'));var csv=require(_0x4494('0x9'));var ejs=require(_0x4494('0xa'));var fs=require('fs');var _=require(_0x4494('0xb'));var squel=require(_0x4494('0xc'));var crypto=require(_0x4494('0xd'));var jsforce=require(_0x4494('0xe'));var deskjs=require(_0x4494('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4494('0x10'));var Papa=require(_0x4494('0x11'));var Redis=require(_0x4494('0x12'));var authService=require(_0x4494('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4494('0x14'));var logger=require(_0x4494('0x15'))(_0x4494('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x4494('0x17'))['db'];function respondWithStatusCode(_0x435e4a,_0x221a1d){_0x221a1d=_0x221a1d||0xcc;return function(_0x1c9750){if(_0x1c9750){return _0x435e4a[_0x4494('0x18')](_0x221a1d);}return _0x435e4a[_0x4494('0x19')](_0x221a1d)['end']();};}function respondWithResult(_0x34959d,_0x2325f4){_0x2325f4=_0x2325f4||0xc8;return function(_0x45825c){if(_0x45825c){return _0x34959d[_0x4494('0x19')](_0x2325f4)[_0x4494('0x1a')](_0x45825c);}};}function respondWithFilteredResult(_0x8506a0,_0x3847d6){return function(_0x53fed5){if(_0x53fed5){var _0x2caa38=_0x53fed5[_0x4494('0x1b')],_0x5a0985=_0x3847d6['offset'],_0x5570a4=_0x3847d6['offset']+_0x3847d6[_0x4494('0x1c')],_0x1a93bc;if(_0x5570a4>=_0x2caa38){_0x5570a4=_0x2caa38;_0x1a93bc=0xc8;}else{_0x1a93bc=0xce;}_0x8506a0['status'](_0x1a93bc);return _0x8506a0[_0x4494('0x1d')](_0x4494('0x1e'),_0x5a0985+'-'+_0x5570a4+'/'+_0x2caa38)['json'](_0x53fed5);}return null;};}function patchUpdates(_0x22ed31){return function(_0x5e5806){try{jsonpatch[_0x4494('0x1f')](_0x5e5806,_0x22ed31,!![]);}catch(_0x28884c){return BPromise['reject'](_0x28884c);}return _0x5e5806['save']();};}function saveUpdates(_0x434e43,_0x1768c3){return function(_0x17a2bf){if(_0x17a2bf){return _0x17a2bf[_0x4494('0x20')](_0x434e43)[_0x4494('0x21')](function(_0x35b18a){return _0x35b18a;});}return null;};}function removeEntity(_0x2c1b76,_0xae958d){return function(_0x4cd309){if(_0x4cd309){return _0x4cd309['destroy']()['then'](function(){_0x2c1b76['status'](0xcc)[_0x4494('0x22')]();});}};}function handleEntityNotFound(_0x8b6c21,_0x1b3630){return function(_0x470b2f){if(!_0x470b2f){_0x8b6c21['sendStatus'](0x194);}return _0x470b2f;};}function handleError(_0x10f7fe,_0xdd08b8){_0xdd08b8=_0xdd08b8||0x1f4;return function(_0x5596fb){logger[_0x4494('0x23')](_0x5596fb[_0x4494('0x24')]);if(_0x5596fb[_0x4494('0x25')]){delete _0x5596fb['name'];}_0x10f7fe[_0x4494('0x19')](_0xdd08b8)['send'](_0x5596fb);};}exports[_0x4494('0x26')]=function(_0x48d74d,_0x29e625){var _0x2fcc43={},_0xce3c8d={},_0x54f1ea={'count':0x0,'rows':[]};var _0x2f269a=_[_0x4494('0x27')](db['DeskField'][_0x4494('0x28')],function(_0x303321){return{'name':_0x303321[_0x4494('0x29')],'type':_0x303321['type'][_0x4494('0x2a')]};});_0xce3c8d[_0x4494('0x2b')]=_[_0x4494('0x27')](_0x2f269a,_0x4494('0x25'));_0xce3c8d[_0x4494('0x2c')]=_[_0x4494('0x2d')](_0x48d74d[_0x4494('0x2c')]);_0xce3c8d[_0x4494('0x2e')]=_['intersection'](_0xce3c8d[_0x4494('0x2b')],_0xce3c8d[_0x4494('0x2c')]);_0x2fcc43[_0x4494('0x2f')]=_['intersection'](_0xce3c8d[_0x4494('0x2b')],qs[_0x4494('0x30')](_0x48d74d[_0x4494('0x2c')][_0x4494('0x30')]));_0x2fcc43[_0x4494('0x2f')]=_0x2fcc43[_0x4494('0x2f')][_0x4494('0x31')]?_0x2fcc43['attributes']:_0xce3c8d[_0x4494('0x2b')];if(!_0x48d74d[_0x4494('0x2c')][_0x4494('0x32')](_0x4494('0x33'))){_0x2fcc43[_0x4494('0x1c')]=qs[_0x4494('0x1c')](_0x48d74d['query'][_0x4494('0x1c')]);_0x2fcc43[_0x4494('0x34')]=qs[_0x4494('0x34')](_0x48d74d[_0x4494('0x2c')][_0x4494('0x34')]);}_0x2fcc43['order']=qs[_0x4494('0x35')](_0x48d74d[_0x4494('0x2c')]['sort']);_0x2fcc43[_0x4494('0x36')]=qs['filters'](_['pick'](_0x48d74d['query'],_0xce3c8d[_0x4494('0x2e')]));if(_0x48d74d[_0x4494('0x2c')][_0x4494('0x37')]){_0x2fcc43['where']=_['merge'](_0x2fcc43[_0x4494('0x36')],{'$or':_[_0x4494('0x27')](_0x2f269a,function(_0x17726f){if(_0x17726f[_0x4494('0x38')]!==_0x4494('0x39')){var _0x260561={};_0x260561[_0x17726f[_0x4494('0x25')]]={'$like':'%'+_0x48d74d[_0x4494('0x2c')][_0x4494('0x37')]+'%'};return _0x260561;}})});}_0x2fcc43=_[_0x4494('0x3a')]({},_0x2fcc43,_0x48d74d[_0x4494('0x3b')]);var _0x14542e={'where':_0x2fcc43[_0x4494('0x36')]};return db['DeskField'][_0x4494('0x1b')](_0x14542e)[_0x4494('0x21')](function(_0xdb7757){_0x54f1ea[_0x4494('0x1b')]=_0xdb7757;if(_0x48d74d[_0x4494('0x2c')][_0x4494('0x3c')]){_0x2fcc43[_0x4494('0x3d')]=[{'all':!![]}];}return db[_0x4494('0x3e')][_0x4494('0x3f')](_0x2fcc43);})['then'](function(_0x5c5d95){_0x54f1ea[_0x4494('0x40')]=_0x5c5d95;return _0x54f1ea;})['then'](respondWithFilteredResult(_0x29e625,_0x2fcc43))[_0x4494('0x41')](handleError(_0x29e625,null));};exports[_0x4494('0x42')]=function(_0x28cb6c,_0x335999){var _0x18b713={'raw':!![],'where':{'id':_0x28cb6c['params']['id']}},_0x531782={};_0x531782[_0x4494('0x2b')]=_['keys'](db[_0x4494('0x3e')][_0x4494('0x28')]);_0x531782[_0x4494('0x2c')]=_[_0x4494('0x2d')](_0x28cb6c[_0x4494('0x2c')]);_0x531782[_0x4494('0x2e')]=_[_0x4494('0x43')](_0x531782['model'],_0x531782[_0x4494('0x2c')]);_0x18b713[_0x4494('0x2f')]=_['intersection'](_0x531782[_0x4494('0x2b')],qs[_0x4494('0x30')](_0x28cb6c[_0x4494('0x2c')]['fields']));_0x18b713[_0x4494('0x2f')]=_0x18b713[_0x4494('0x2f')][_0x4494('0x31')]?_0x18b713[_0x4494('0x2f')]:_0x531782['model'];if(_0x28cb6c['query'][_0x4494('0x3c')]){_0x18b713[_0x4494('0x3d')]=[{'all':!![]}];}_0x18b713=_[_0x4494('0x3a')]({},_0x18b713,_0x28cb6c['options']);return db['DeskField'][_0x4494('0x44')](_0x18b713)[_0x4494('0x21')](handleEntityNotFound(_0x335999,null))[_0x4494('0x21')](respondWithResult(_0x335999,null))['catch'](handleError(_0x335999,null));};exports[_0x4494('0x45')]=function(_0x1800dd,_0x4d6295){return db[_0x4494('0x3e')][_0x4494('0x45')](_0x1800dd[_0x4494('0x46')],{})[_0x4494('0x21')](respondWithResult(_0x4d6295,0xc9))[_0x4494('0x41')](handleError(_0x4d6295,null));};exports['update']=function(_0x802d47,_0x3c5475){if(_0x802d47[_0x4494('0x46')]['id']){delete _0x802d47[_0x4494('0x46')]['id'];}return db[_0x4494('0x3e')][_0x4494('0x44')]({'where':{'id':_0x802d47[_0x4494('0x47')]['id']}})[_0x4494('0x21')](handleEntityNotFound(_0x3c5475,null))[_0x4494('0x21')](saveUpdates(_0x802d47[_0x4494('0x46')],null))['then'](respondWithResult(_0x3c5475,null))[_0x4494('0x41')](handleError(_0x3c5475,null));};exports['destroy']=function(_0x1227e4,_0x3d90bc){return db[_0x4494('0x3e')][_0x4494('0x44')]({'where':{'id':_0x1227e4[_0x4494('0x47')]['id']}})['then'](handleEntityNotFound(_0x3d90bc,null))[_0x4494('0x21')](removeEntity(_0x3d90bc,null))['catch'](handleError(_0x3d90bc,null));}; \ No newline at end of file +var _0xb647=['body','update','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','DeskField','rawAttributes','type','key','query','keys','filters','attributes','fields','model','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create'];(function(_0x5425e6,_0x87026e){var _0x1516f8=function(_0x4ce1d1){while(--_0x4ce1d1){_0x5425e6['push'](_0x5425e6['shift']());}};_0x1516f8(++_0x87026e);}(_0xb647,0xdb));var _0x7b64=function(_0x4c86cb,_0x2e88f2){_0x4c86cb=_0x4c86cb-0x0;var _0x48f508=_0xb647[_0x4c86cb];return _0x48f508;};'use strict';var pdf=require(_0x7b64('0x0'));var emlformat=require(_0x7b64('0x1'));var rimraf=require(_0x7b64('0x2'));var zipdir=require(_0x7b64('0x3'));var jsonpatch=require(_0x7b64('0x4'));var rp=require(_0x7b64('0x5'));var moment=require(_0x7b64('0x6'));var BPromise=require(_0x7b64('0x7'));var Mustache=require('mustache');var util=require(_0x7b64('0x8'));var path=require('path');var sox=require(_0x7b64('0x9'));var csv=require(_0x7b64('0xa'));var ejs=require(_0x7b64('0xb'));var fs=require('fs');var _=require(_0x7b64('0xc'));var squel=require(_0x7b64('0xd'));var crypto=require(_0x7b64('0xe'));var jsforce=require(_0x7b64('0xf'));var deskjs=require(_0x7b64('0x10'));var toCsv=require(_0x7b64('0xa'));var querystring=require('querystring');var Papa=require(_0x7b64('0x11'));var Redis=require('ioredis');var authService=require(_0x7b64('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b64('0x13'));var logger=require(_0x7b64('0x14'))('api');var utils=require(_0x7b64('0x15'));var config=require(_0x7b64('0x16'));var db=require(_0x7b64('0x17'))['db'];function respondWithStatusCode(_0x42fb71,_0x25e135){_0x25e135=_0x25e135||0xcc;return function(_0x432626){if(_0x432626){return _0x42fb71[_0x7b64('0x18')](_0x25e135);}return _0x42fb71['status'](_0x25e135)[_0x7b64('0x19')]();};}function respondWithResult(_0x56899c,_0x530938){_0x530938=_0x530938||0xc8;return function(_0x2f21d8){if(_0x2f21d8){return _0x56899c[_0x7b64('0x1a')](_0x530938)[_0x7b64('0x1b')](_0x2f21d8);}};}function respondWithFilteredResult(_0x10ce62,_0x33ebe7){return function(_0x437ddc){if(_0x437ddc){var _0x306a4e=_0x437ddc[_0x7b64('0x1c')],_0x519316=_0x33ebe7[_0x7b64('0x1d')],_0xca026a=_0x33ebe7[_0x7b64('0x1d')]+_0x33ebe7['limit'],_0x40066b;if(_0xca026a>=_0x306a4e){_0xca026a=_0x306a4e;_0x40066b=0xc8;}else{_0x40066b=0xce;}_0x10ce62[_0x7b64('0x1a')](_0x40066b);return _0x10ce62[_0x7b64('0x1e')]('Content-Range',_0x519316+'-'+_0xca026a+'/'+_0x306a4e)[_0x7b64('0x1b')](_0x437ddc);}return null;};}function patchUpdates(_0x28615d){return function(_0x5ef53f){try{jsonpatch[_0x7b64('0x1f')](_0x5ef53f,_0x28615d,!![]);}catch(_0x1c5986){return BPromise[_0x7b64('0x20')](_0x1c5986);}return _0x5ef53f[_0x7b64('0x21')]();};}function saveUpdates(_0x47cef5,_0x123a3b){return function(_0x5c4135){if(_0x5c4135){return _0x5c4135['update'](_0x47cef5)[_0x7b64('0x22')](function(_0x509719){return _0x509719;});}return null;};}function removeEntity(_0x2d2d9a,_0x587da6){return function(_0x1bbd87){if(_0x1bbd87){return _0x1bbd87[_0x7b64('0x23')]()[_0x7b64('0x22')](function(){_0x2d2d9a[_0x7b64('0x1a')](0xcc)[_0x7b64('0x19')]();});}};}function handleEntityNotFound(_0x3c0d97,_0x215ea9){return function(_0x3d4bef){if(!_0x3d4bef){_0x3c0d97[_0x7b64('0x18')](0x194);}return _0x3d4bef;};}function handleError(_0x78a6d1,_0xec557c){_0xec557c=_0xec557c||0x1f4;return function(_0x22ede4){logger[_0x7b64('0x24')](_0x22ede4[_0x7b64('0x25')]);if(_0x22ede4['name']){delete _0x22ede4[_0x7b64('0x26')];}_0x78a6d1['status'](_0xec557c)[_0x7b64('0x27')](_0x22ede4);};}exports[_0x7b64('0x28')]=function(_0x5c10ca,_0x5acdb3){var _0x38738c={},_0x1e1ba7={},_0x1a8d6b={'count':0x0,'rows':[]};var _0x10491a=_[_0x7b64('0x29')](db[_0x7b64('0x2a')][_0x7b64('0x2b')],function(_0x2729f1){return{'name':_0x2729f1['fieldName'],'type':_0x2729f1[_0x7b64('0x2c')][_0x7b64('0x2d')]};});_0x1e1ba7['model']=_[_0x7b64('0x29')](_0x10491a,_0x7b64('0x26'));_0x1e1ba7[_0x7b64('0x2e')]=_[_0x7b64('0x2f')](_0x5c10ca[_0x7b64('0x2e')]);_0x1e1ba7[_0x7b64('0x30')]=_['intersection'](_0x1e1ba7['model'],_0x1e1ba7[_0x7b64('0x2e')]);_0x38738c[_0x7b64('0x31')]=_['intersection'](_0x1e1ba7['model'],qs[_0x7b64('0x32')](_0x5c10ca['query'][_0x7b64('0x32')]));_0x38738c['attributes']=_0x38738c['attributes']['length']?_0x38738c[_0x7b64('0x31')]:_0x1e1ba7[_0x7b64('0x33')];if(!_0x5c10ca[_0x7b64('0x2e')]['hasOwnProperty'](_0x7b64('0x34'))){_0x38738c['limit']=qs[_0x7b64('0x35')](_0x5c10ca[_0x7b64('0x2e')][_0x7b64('0x35')]);_0x38738c[_0x7b64('0x1d')]=qs[_0x7b64('0x1d')](_0x5c10ca['query'][_0x7b64('0x1d')]);}_0x38738c[_0x7b64('0x36')]=qs[_0x7b64('0x37')](_0x5c10ca[_0x7b64('0x2e')]['sort']);_0x38738c[_0x7b64('0x38')]=qs[_0x7b64('0x30')](_[_0x7b64('0x39')](_0x5c10ca[_0x7b64('0x2e')],_0x1e1ba7[_0x7b64('0x30')]));if(_0x5c10ca[_0x7b64('0x2e')][_0x7b64('0x3a')]){_0x38738c['where']=_['merge'](_0x38738c[_0x7b64('0x38')],{'$or':_[_0x7b64('0x29')](_0x10491a,function(_0x107a1b){if(_0x107a1b[_0x7b64('0x2c')]!==_0x7b64('0x3b')){var _0x224e7c={};_0x224e7c[_0x107a1b[_0x7b64('0x26')]]={'$like':'%'+_0x5c10ca[_0x7b64('0x2e')][_0x7b64('0x3a')]+'%'};return _0x224e7c;}})});}_0x38738c=_['merge']({},_0x38738c,_0x5c10ca[_0x7b64('0x3c')]);var _0x2e58b2={'where':_0x38738c[_0x7b64('0x38')]};return db[_0x7b64('0x2a')][_0x7b64('0x1c')](_0x2e58b2)[_0x7b64('0x22')](function(_0x3cf4fc){_0x1a8d6b[_0x7b64('0x1c')]=_0x3cf4fc;if(_0x5c10ca[_0x7b64('0x2e')][_0x7b64('0x3d')]){_0x38738c[_0x7b64('0x3e')]=[{'all':!![]}];}return db[_0x7b64('0x2a')][_0x7b64('0x3f')](_0x38738c);})[_0x7b64('0x22')](function(_0x2cb989){_0x1a8d6b[_0x7b64('0x40')]=_0x2cb989;return _0x1a8d6b;})[_0x7b64('0x22')](respondWithFilteredResult(_0x5acdb3,_0x38738c))[_0x7b64('0x41')](handleError(_0x5acdb3,null));};exports[_0x7b64('0x42')]=function(_0x355e8a,_0x48e816){var _0x442d65={'raw':!![],'where':{'id':_0x355e8a[_0x7b64('0x43')]['id']}},_0x21fbf0={};_0x21fbf0['model']=_[_0x7b64('0x2f')](db[_0x7b64('0x2a')]['rawAttributes']);_0x21fbf0[_0x7b64('0x2e')]=_[_0x7b64('0x2f')](_0x355e8a['query']);_0x21fbf0[_0x7b64('0x30')]=_['intersection'](_0x21fbf0[_0x7b64('0x33')],_0x21fbf0[_0x7b64('0x2e')]);_0x442d65[_0x7b64('0x31')]=_['intersection'](_0x21fbf0[_0x7b64('0x33')],qs[_0x7b64('0x32')](_0x355e8a[_0x7b64('0x2e')][_0x7b64('0x32')]));_0x442d65[_0x7b64('0x31')]=_0x442d65[_0x7b64('0x31')]['length']?_0x442d65[_0x7b64('0x31')]:_0x21fbf0[_0x7b64('0x33')];if(_0x355e8a[_0x7b64('0x2e')][_0x7b64('0x3d')]){_0x442d65[_0x7b64('0x3e')]=[{'all':!![]}];}_0x442d65=_['merge']({},_0x442d65,_0x355e8a['options']);return db['DeskField']['find'](_0x442d65)[_0x7b64('0x22')](handleEntityNotFound(_0x48e816,null))[_0x7b64('0x22')](respondWithResult(_0x48e816,null))[_0x7b64('0x41')](handleError(_0x48e816,null));};exports[_0x7b64('0x44')]=function(_0x3c6be2,_0x131b13){return db[_0x7b64('0x2a')][_0x7b64('0x44')](_0x3c6be2[_0x7b64('0x45')],{})[_0x7b64('0x22')](respondWithResult(_0x131b13,0xc9))[_0x7b64('0x41')](handleError(_0x131b13,null));};exports[_0x7b64('0x46')]=function(_0x4add4d,_0x4c2006){if(_0x4add4d[_0x7b64('0x45')]['id']){delete _0x4add4d[_0x7b64('0x45')]['id'];}return db[_0x7b64('0x2a')][_0x7b64('0x47')]({'where':{'id':_0x4add4d[_0x7b64('0x43')]['id']}})['then'](handleEntityNotFound(_0x4c2006,null))[_0x7b64('0x22')](saveUpdates(_0x4add4d[_0x7b64('0x45')],null))[_0x7b64('0x22')](respondWithResult(_0x4c2006,null))['catch'](handleError(_0x4c2006,null));};exports[_0x7b64('0x23')]=function(_0x214a45,_0x27c9f9){return db[_0x7b64('0x2a')][_0x7b64('0x47')]({'where':{'id':_0x214a45['params']['id']}})[_0x7b64('0x22')](handleEntityNotFound(_0x27c9f9,null))[_0x7b64('0x22')](removeEntity(_0x27c9f9,null))['catch'](handleError(_0x27c9f9,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 581fc4e..e8e3948 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 _0x0c5e=['request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','util','api','moment'];(function(_0x237244,_0x342694){var _0x57606f=function(_0x440169){while(--_0x440169){_0x237244['push'](_0x237244['shift']());}};_0x57606f(++_0x342694);}(_0x0c5e,0xa5));var _0xe0c5=function(_0x547af,_0x17abff){_0x547af=_0x547af-0x0;var _0x22f7f4=_0x0c5e[_0x547af];return _0x22f7f4;};'use strict';var _=require('lodash');var util=require(_0xe0c5('0x0'));var logger=require('../../config/logger')(_0xe0c5('0x1'));var moment=require(_0xe0c5('0x2'));var BPromise=require('bluebird');var rp=require(_0xe0c5('0x3'));var fs=require('fs');var path=require(_0xe0c5('0x4'));var rimraf=require(_0xe0c5('0x5'));var config=require(_0xe0c5('0x6'));var attributes=require(_0xe0c5('0x7'));module['exports']=function(_0x3ad0f7,_0x2c60c1){return _0x3ad0f7[_0xe0c5('0x8')](_0xe0c5('0x9'),attributes,{'tableName':_0xe0c5('0xa'),'paranoid':![],'indexes':[{'name':_0xe0c5('0xb'),'fields':[_0xe0c5('0xc'),_0xe0c5('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0c40=['moment','bluebird','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','FieldId','util','../../config/logger'];(function(_0xf2a78,_0x4fc636){var _0x3939de=function(_0x59373d){while(--_0x59373d){_0xf2a78['push'](_0xf2a78['shift']());}};_0x3939de(++_0x4fc636);}(_0x0c40,0x106));var _0x00c4=function(_0x38d847,_0x2263ad){_0x38d847=_0x38d847-0x0;var _0x2a8d4e=_0x0c40[_0x38d847];return _0x2a8d4e;};'use strict';var _=require('lodash');var util=require(_0x00c4('0x0'));var logger=require(_0x00c4('0x1'))('api');var moment=require(_0x00c4('0x2'));var BPromise=require(_0x00c4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x00c4('0x4'));var config=require(_0x00c4('0x5'));var attributes=require(_0x00c4('0x6'));module[_0x00c4('0x7')]=function(_0x4b1043,_0x21b3d5){return _0x4b1043[_0x00c4('0x8')](_0x00c4('0x9'),attributes,{'tableName':_0x00c4('0xa'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':['idField',_0x00c4('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 47dad02..82bfd8e 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 _0x73c9=['../../config/environment','client','http','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x5b157d,_0x2a04bb){var _0x3f18aa=function(_0x4dc523){while(--_0x4dc523){_0x5b157d['push'](_0x5b157d['shift']());}};_0x3f18aa(++_0x2a04bb);}(_0x73c9,0xcb));var _0x973c=function(_0x3ca1a5,_0x1198e2){_0x3ca1a5=_0x3ca1a5-0x0;var _0x8bead3=_0x73c9[_0x3ca1a5];return _0x8bead3;};'use strict';var _=require(_0x973c('0x0'));var util=require(_0x973c('0x1'));var moment=require('moment');var BPromise=require(_0x973c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x973c('0x3'));var db=require(_0x973c('0x4'))['db'];var utils=require(_0x973c('0x5'));var logger=require('../../config/logger')(_0x973c('0x6'));var config=require(_0x973c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x973c('0x8')][_0x973c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c9504,_0x226aed,_0x4e2683){return new BPromise(function(_0x3cebc5,_0x161dc3){return client[_0x973c('0xa')](_0x4c9504,_0x4e2683)['then'](function(_0x462c99){logger[_0x973c('0xb')](_0x973c('0xc'),_0x226aed,_0x973c('0xd'));logger[_0x973c('0xe')](_0x973c('0xf'),_0x226aed,'request\x20sent',JSON[_0x973c('0x10')](_0x462c99));if(_0x462c99[_0x973c('0x11')]){if(_0x462c99['error']['code']===0x1f4){logger[_0x973c('0x11')]('DeskField,\x20%s,\x20%s',_0x226aed,_0x462c99[_0x973c('0x11')][_0x973c('0x12')]);return _0x161dc3(_0x462c99[_0x973c('0x11')]['message']);}logger['error'](_0x973c('0xc'),_0x226aed,_0x462c99[_0x973c('0x11')][_0x973c('0x12')]);return _0x3cebc5(_0x462c99[_0x973c('0x11')][_0x973c('0x12')]);}else{logger[_0x973c('0xb')]('DeskField,\x20%s,\x20%s',_0x226aed,'request\x20sent');_0x3cebc5(_0x462c99[_0x973c('0x13')]['message']);}})[_0x973c('0x14')](function(_0x34e8d3){logger[_0x973c('0x11')]('DeskField,\x20%s,\x20%s',_0x226aed,_0x34e8d3);_0x161dc3(_0x34e8d3);});});} \ No newline at end of file +var _0x0ec4=['jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','rpc'];(function(_0x5f12fd,_0x33c70d){var _0x58bd80=function(_0x515f56){while(--_0x515f56){_0x5f12fd['push'](_0x5f12fd['shift']());}};_0x58bd80(++_0x33c70d);}(_0x0ec4,0x18a));var _0x40ec=function(_0x331184,_0xa8bc89){_0x331184=_0x331184-0x0;var _0xe872f3=_0x0ec4[_0x331184];return _0xe872f3;};'use strict';var _=require(_0x40ec('0x0'));var util=require(_0x40ec('0x1'));var moment=require(_0x40ec('0x2'));var BPromise=require(_0x40ec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x40ec('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x40ec('0x5'));var config=require('../../config/environment');var jayson=require(_0x40ec('0x6'));var client=jayson[_0x40ec('0x7')][_0x40ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x24b291,_0xa06ebe,_0x3b9e2b){return new BPromise(function(_0x45df41,_0x3c51b4){return client[_0x40ec('0x9')](_0x24b291,_0x3b9e2b)[_0x40ec('0xa')](function(_0x5d6dd9){logger[_0x40ec('0xb')](_0x40ec('0xc'),_0xa06ebe,_0x40ec('0xd'));logger['debug'](_0x40ec('0xe'),_0xa06ebe,_0x40ec('0xd'),JSON[_0x40ec('0xf')](_0x5d6dd9));if(_0x5d6dd9[_0x40ec('0x10')]){if(_0x5d6dd9[_0x40ec('0x10')]['code']===0x1f4){logger[_0x40ec('0x10')](_0x40ec('0xc'),_0xa06ebe,_0x5d6dd9[_0x40ec('0x10')]['message']);return _0x3c51b4(_0x5d6dd9[_0x40ec('0x10')]['message']);}logger[_0x40ec('0x10')](_0x40ec('0xc'),_0xa06ebe,_0x5d6dd9[_0x40ec('0x10')][_0x40ec('0x11')]);return _0x45df41(_0x5d6dd9['error'][_0x40ec('0x11')]);}else{logger[_0x40ec('0xb')]('DeskField,\x20%s,\x20%s',_0xa06ebe,_0x40ec('0xd'));_0x45df41(_0x5d6dd9[_0x40ec('0x12')][_0x40ec('0x11')]);}})[_0x40ec('0x13')](function(_0x5a9321){logger[_0x40ec('0x10')](_0x40ec('0xc'),_0xa06ebe,_0x5a9321);_0x3c51b4(_0x5a9321);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 191b69d..3d4b298 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 _0x19ef=['../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service'];(function(_0x41a836,_0x52f0f2){var _0x34edbd=function(_0x109ad5){while(--_0x109ad5){_0x41a836['push'](_0x41a836['shift']());}};_0x34edbd(++_0x52f0f2);}(_0x19ef,0x1f3));var _0xf19e=function(_0x261b8a,_0x553ec4){_0x261b8a=_0x261b8a-0x0;var _0x3455e8=_0x19ef[_0x261b8a];return _0x3455e8;};'use strict';var multer=require(_0xf19e('0x0'));var util=require(_0xf19e('0x1'));var path=require('path');var timeout=require(_0xf19e('0x2'));var express=require(_0xf19e('0x3'));var router=express['Router']();var auth=require(_0xf19e('0x4'));var interaction=require(_0xf19e('0x5'));var config=require(_0xf19e('0x6'));var controller=require(_0xf19e('0x7'));router[_0xf19e('0x8')]('/',auth[_0xf19e('0x9')](),controller[_0xf19e('0xa')]);router['get'](_0xf19e('0xb'),auth['isAuthenticated'](),controller[_0xf19e('0xc')]);router[_0xf19e('0x8')](_0xf19e('0xd'),auth['isAuthenticated'](),controller[_0xf19e('0xe')]);router[_0xf19e('0x8')](_0xf19e('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0xf19e('0x10')]('/',auth['isAuthenticated'](),controller[_0xf19e('0x11')]);router['post'](_0xf19e('0xd'),auth[_0xf19e('0x9')](),controller['addConfiguration']);router['put'](_0xf19e('0xb'),auth[_0xf19e('0x9')](),controller['update']);router[_0xf19e('0x12')]('/:id',auth[_0xf19e('0x9')](),controller[_0xf19e('0x13')]);module[_0xf19e('0x14')]=router; \ No newline at end of file +var _0x61a8=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','put','delete','destroy','multer','util','path'];(function(_0x2d10f7,_0x36abd0){var _0x94c2f7=function(_0xcb5708){while(--_0xcb5708){_0x2d10f7['push'](_0x2d10f7['shift']());}};_0x94c2f7(++_0x36abd0);}(_0x61a8,0x1cb));var _0x861a=function(_0x1a5946,_0x426991){_0x1a5946=_0x1a5946-0x0;var _0x25e9d5=_0x61a8[_0x1a5946];return _0x25e9d5;};'use strict';var multer=require(_0x861a('0x0'));var util=require(_0x861a('0x1'));var path=require(_0x861a('0x2'));var timeout=require(_0x861a('0x3'));var express=require('express');var router=express[_0x861a('0x4')]();var auth=require(_0x861a('0x5'));var interaction=require(_0x861a('0x6'));var config=require(_0x861a('0x7'));var controller=require(_0x861a('0x8'));router[_0x861a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x861a('0x9')](_0x861a('0xa'),auth[_0x861a('0xb')](),controller[_0x861a('0xc')]);router[_0x861a('0x9')](_0x861a('0xd'),auth[_0x861a('0xb')](),controller[_0x861a('0xe')]);router['get'](_0x861a('0xf'),auth['isAuthenticated'](),controller[_0x861a('0x10')]);router[_0x861a('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x861a('0x11')](_0x861a('0xd'),auth[_0x861a('0xb')](),controller['addConfiguration']);router[_0x861a('0x12')](_0x861a('0xa'),auth[_0x861a('0xb')](),controller['update']);router[_0x861a('0x13')](_0x861a('0xa'),auth[_0x861a('0xb')](),controller[_0x861a('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index d8ce34f..6f7cda6 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 _0x8770=['STRING','exports'];(function(_0x3752dc,_0x315641){var _0x4bbbb4=function(_0x5c495f){while(--_0x5c495f){_0x3752dc['push'](_0x3752dc['shift']());}};_0x4bbbb4(++_0x315641);}(_0x8770,0xfd));var _0x0877=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8770[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x0877('0x0')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x0877('0x1')]},'password':{'type':Sequelize[_0x0877('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x0877('0x1')]},'serverUrl':{'type':Sequelize[_0x0877('0x1')]},'description':{'type':Sequelize[_0x0877('0x1')]}}; \ No newline at end of file +var _0xa3f4=['STRING','sequelize','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa3f4,0x1e1));var _0x4a3f=function(_0xa409c3,_0x930b2e){_0xa409c3=_0xa409c3-0x0;var _0xf7006d=_0xa3f4[_0xa409c3];return _0xf7006d;};'use strict';var Sequelize=require(_0x4a3f('0x0'));module[_0x4a3f('0x1')]={'name':{'type':Sequelize[_0x4a3f('0x2')]},'username':{'type':Sequelize[_0x4a3f('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x4a3f('0x2')]},'tenantId':{'type':Sequelize[_0x4a3f('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x4a3f('0x2')]},'serverUrl':{'type':Sequelize[_0x4a3f('0x2')]},'description':{'type':Sequelize[_0x4a3f('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 0da42f9..dd22675 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 _0x233e=['MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','substring','StringAttributeMetadata','IntegerAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','UserLocalizedLabel','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../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','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Account,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','Dynamics365Account','include','findAll','params','includeAll','options','find','create','body','getConfigurations','Dynamics365Configuration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','incident','PhoneCall','title','description','customerid','ownerid','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','username','remoteUri','tenantId','clientId','clientSecret','slice','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','password','GET','Bearer\x20','4.0','value'];(function(_0x478126,_0x495f2d){var _0x27c7f4=function(_0x4bc558){while(--_0x4bc558){_0x478126['push'](_0x478126['shift']());}};_0x27c7f4(++_0x495f2d);}(_0x233e,0x1dd));var _0xe233=function(_0x316139,_0x1ba0ee){_0x316139=_0x316139-0x0;var _0xd28435=_0x233e[_0x316139];return _0xd28435;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe233('0x0'));var rimraf=require(_0xe233('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe233('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe233('0x3'));var Mustache=require(_0xe233('0x4'));var util=require(_0xe233('0x5'));var path=require(_0xe233('0x6'));var sox=require(_0xe233('0x7'));var csv=require(_0xe233('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe233('0x9'));var squel=require(_0xe233('0xa'));var crypto=require(_0xe233('0xb'));var jsforce=require(_0xe233('0xc'));var deskjs=require(_0xe233('0xd'));var toCsv=require(_0xe233('0x8'));var querystring=require(_0xe233('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe233('0xf'));var qs=require(_0xe233('0x10'));var as=require(_0xe233('0x11'));var hardwareService=require(_0xe233('0x12'));var logger=require(_0xe233('0x13'))('api');var utils=require(_0xe233('0x14'));var config=require(_0xe233('0x15'));var db=require(_0xe233('0x16'))['db'];var integrations=require(_0xe233('0x17'));var jayson=require(_0xe233('0x18'));var client=jayson[_0xe233('0x19')][_0xe233('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x2d2460,_0x19180a,_0x38d2d4){if(_0x38d2d4){var _0x423bf8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x423bf8[_0xe233('0x1b')](_0x19180a)){return _0x2d2460;}else{throw new db[(_0xe233('0x1c'))][(_0xe233('0x1d'))](_0xe233('0x1e'));}}else{return _0x2d2460;}}function respondWithRpcPromise(_0x2d0d42,_0x5c09b8,_0x561655,_0x501d93){return new BPromise(function(_0x18d62a,_0x3634c1){var _0x3d916d=_0x501d93||client;return _0x3d916d[_0xe233('0x1f')](_0x2d0d42,_0x561655)[_0xe233('0x20')](function(_0x403cd9){logger[_0xe233('0x21')]('Dynamics365Account,\x20%s,\x20%s',_0x5c09b8,_0xe233('0x22'));logger['debug'](_0xe233('0x23'),_0x5c09b8,'request\x20sent',JSON[_0xe233('0x24')](_0x403cd9));if(_0x403cd9['error']){if(_0x403cd9[_0xe233('0x25')][_0xe233('0x26')]===0x1f4){logger[_0xe233('0x25')]('Dynamics365Account,\x20%s,\x20%s',_0x5c09b8,_0x403cd9['error'][_0xe233('0x27')]);return _0x3634c1(_0x403cd9[_0xe233('0x25')]['message']);}logger[_0xe233('0x25')]('Dynamics365Account,\x20%s,\x20%s',_0x5c09b8,_0x403cd9[_0xe233('0x25')][_0xe233('0x27')]);return _0x18d62a(_0x403cd9['error'][_0xe233('0x27')]);}else{logger[_0xe233('0x21')](_0xe233('0x28'),_0x5c09b8,_0xe233('0x22'));_0x18d62a(_0x403cd9[_0xe233('0x29')][_0xe233('0x27')]);}})[_0xe233('0x2a')](function(_0x2ae17d){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x5c09b8,_0x2ae17d);_0x3634c1(_0x2ae17d);});});}function respondWithStatusCode(_0x577159,_0x19f81d){_0x19f81d=_0x19f81d||0xcc;return function(_0x3beab0){if(_0x3beab0){return _0x577159[_0xe233('0x2b')](_0x19f81d);}return _0x577159[_0xe233('0x2c')](_0x19f81d)[_0xe233('0x2d')]();};}function respondWithResult(_0x46e8f9,_0x5afd9c){_0x5afd9c=_0x5afd9c||0xc8;return function(_0x18a4be){if(_0x18a4be){return _0x46e8f9[_0xe233('0x2c')](_0x5afd9c)[_0xe233('0x2e')](_0x18a4be);}};}function respondWithFilteredResult(_0x5b832e,_0x420767){return function(_0x35adcd){if(_0x35adcd){var _0x4389ec=_0x35adcd[_0xe233('0x2f')],_0x6080c3=_0x420767['offset'],_0x1afe0f=_0x420767[_0xe233('0x30')]+_0x420767['limit'],_0x1fc185;if(_0x1afe0f>=_0x4389ec){_0x1afe0f=_0x4389ec;_0x1fc185=0xc8;}else{_0x1fc185=0xce;}_0x5b832e[_0xe233('0x2c')](_0x1fc185);return _0x5b832e[_0xe233('0x31')](_0xe233('0x32'),_0x6080c3+'-'+_0x1afe0f+'/'+_0x4389ec)[_0xe233('0x2e')](_0x35adcd);}return null;};}function patchUpdates(_0x476f19){return function(_0x2fbf8e){try{jsonpatch[_0xe233('0x33')](_0x2fbf8e,_0x476f19,!![]);}catch(_0x132428){return BPromise[_0xe233('0x34')](_0x132428);}return _0x2fbf8e[_0xe233('0x35')]();};}function saveUpdates(_0x4bd2e1,_0x124677){return function(_0x2928f3){if(_0x2928f3){return _0x2928f3[_0xe233('0x36')](_0x4bd2e1)[_0xe233('0x20')](function(_0x435acb){return _0x435acb;});}return null;};}function removeEntity(_0x1f6036,_0x1928f1){return function(_0x42f60b){if(_0x42f60b){return _0x42f60b[_0xe233('0x37')]()[_0xe233('0x20')](function(){_0x1f6036[_0xe233('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3621d1,_0x1eee28){return function(_0xdeca1b){if(!_0xdeca1b){_0x3621d1['sendStatus'](0x194);}return _0xdeca1b;};}function handleError(_0x3d89d7,_0x53cb8d){_0x53cb8d=_0x53cb8d||0x1f4;return function(_0x156453){logger['error'](_0x156453['stack']);if(_0x156453[_0xe233('0x38')]){delete _0x156453[_0xe233('0x38')];}_0x3d89d7[_0xe233('0x2c')](_0x53cb8d)['send'](_0x156453);};}exports[_0xe233('0x39')]=function(_0x485031,_0x227aff){var _0x58455d={},_0x34c7d6={},_0x2ed244={'count':0x0,'rows':[]};var _0x58804f=_[_0xe233('0x3a')](db['Dynamics365Account'][_0xe233('0x3b')],function(_0x4425d8){return{'name':_0x4425d8[_0xe233('0x3c')],'type':_0x4425d8[_0xe233('0x3d')][_0xe233('0x3e')]};});_0x34c7d6[_0xe233('0x3f')]=_['map'](_0x58804f,_0xe233('0x38'));_0x34c7d6[_0xe233('0x40')]=_[_0xe233('0x41')](_0x485031['query']);_0x34c7d6[_0xe233('0x42')]=_[_0xe233('0x43')](_0x34c7d6[_0xe233('0x3f')],_0x34c7d6[_0xe233('0x40')]);_0x58455d['attributes']=_[_0xe233('0x43')](_0x34c7d6['model'],qs[_0xe233('0x44')](_0x485031[_0xe233('0x40')]['fields']));_0x58455d[_0xe233('0x45')]=_0x58455d['attributes'][_0xe233('0x46')]?_0x58455d[_0xe233('0x45')]:_0x34c7d6[_0xe233('0x3f')];if(!_0x485031[_0xe233('0x40')][_0xe233('0x47')](_0xe233('0x48'))){_0x58455d[_0xe233('0x49')]=qs[_0xe233('0x49')](_0x485031['query'][_0xe233('0x49')]);_0x58455d[_0xe233('0x30')]=qs[_0xe233('0x30')](_0x485031[_0xe233('0x40')][_0xe233('0x30')]);}_0x58455d[_0xe233('0x4a')]=qs[_0xe233('0x4b')](_0x485031[_0xe233('0x40')][_0xe233('0x4b')]);_0x58455d[_0xe233('0x4c')]=qs['filters'](_['pick'](_0x485031[_0xe233('0x40')],_0x34c7d6[_0xe233('0x42')]));if(_0x485031[_0xe233('0x40')][_0xe233('0x4d')]){_0x58455d['where']=_[_0xe233('0x4e')](_0x58455d[_0xe233('0x4c')],{'$or':_[_0xe233('0x3a')](_0x58804f,function(_0x5d448a){if(_0x5d448a[_0xe233('0x3d')]!==_0xe233('0x4f')){var _0x97fafa={};_0x97fafa[_0x5d448a[_0xe233('0x38')]]={'$like':'%'+_0x485031[_0xe233('0x40')][_0xe233('0x4d')]+'%'};return _0x97fafa;}})});}_0x58455d=_[_0xe233('0x4e')]({},_0x58455d,_0x485031['options']);var _0x846991={'where':_0x58455d[_0xe233('0x4c')]};return db[_0xe233('0x50')]['count'](_0x846991)['then'](function(_0x38cf0b){_0x2ed244[_0xe233('0x2f')]=_0x38cf0b;if(_0x485031[_0xe233('0x40')]['includeAll']){_0x58455d[_0xe233('0x51')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xe233('0x52')](_0x58455d);})['then'](function(_0x3203d6){_0x2ed244['rows']=_0x3203d6;return _0x2ed244;})[_0xe233('0x20')](respondWithFilteredResult(_0x227aff,_0x58455d))[_0xe233('0x2a')](handleError(_0x227aff,null));};exports['show']=function(_0x440287,_0xc792c9){var _0x2b13e1={'raw':![],'where':{'id':_0x440287[_0xe233('0x53')]['id']}},_0x50cb8e={};_0x50cb8e[_0xe233('0x3f')]=_['keys'](db[_0xe233('0x50')][_0xe233('0x3b')]);_0x50cb8e[_0xe233('0x40')]=_[_0xe233('0x41')](_0x440287[_0xe233('0x40')]);_0x50cb8e['filters']=_['intersection'](_0x50cb8e[_0xe233('0x3f')],_0x50cb8e[_0xe233('0x40')]);_0x2b13e1[_0xe233('0x45')]=_['intersection'](_0x50cb8e[_0xe233('0x3f')],qs[_0xe233('0x44')](_0x440287[_0xe233('0x40')][_0xe233('0x44')]));_0x2b13e1[_0xe233('0x45')]=_0x2b13e1['attributes'][_0xe233('0x46')]?_0x2b13e1[_0xe233('0x45')]:_0x50cb8e[_0xe233('0x3f')];if(_0x440287[_0xe233('0x40')][_0xe233('0x54')]){_0x2b13e1[_0xe233('0x51')]=[{'all':!![]}];}_0x2b13e1=_['merge']({},_0x2b13e1,_0x440287[_0xe233('0x55')]);return db[_0xe233('0x50')][_0xe233('0x56')](_0x2b13e1)[_0xe233('0x20')](handleEntityNotFound(_0xc792c9,null))['then'](respondWithResult(_0xc792c9,null))['catch'](handleError(_0xc792c9,null));};exports[_0xe233('0x57')]=function(_0x49a585,_0x44f103){return db[_0xe233('0x50')][_0xe233('0x57')](_0x49a585[_0xe233('0x58')],{})[_0xe233('0x20')](respondWithResult(_0x44f103,0xc9))[_0xe233('0x2a')](handleError(_0x44f103,null));};exports[_0xe233('0x36')]=function(_0x368150,_0x54cb29){if(_0x368150['body']['id']){delete _0x368150[_0xe233('0x58')]['id'];}return db[_0xe233('0x50')][_0xe233('0x56')]({'where':{'id':_0x368150['params']['id']}})[_0xe233('0x20')](handleEntityNotFound(_0x54cb29,null))[_0xe233('0x20')](saveUpdates(_0x368150[_0xe233('0x58')],null))[_0xe233('0x20')](respondWithResult(_0x54cb29,null))[_0xe233('0x2a')](handleError(_0x54cb29,null));};exports['destroy']=function(_0x453158,_0x427f04){return db[_0xe233('0x50')][_0xe233('0x56')]({'where':{'id':_0x453158[_0xe233('0x53')]['id']}})[_0xe233('0x20')](handleEntityNotFound(_0x427f04,null))[_0xe233('0x20')](removeEntity(_0x427f04,null))['catch'](handleError(_0x427f04,null));};exports[_0xe233('0x59')]=function(_0x1d4813,_0x512cee,_0x563bd5){var _0x97dcf5={};var _0x43b6b7={};var _0x894fbc;var _0x590f53;return db[_0xe233('0x50')]['findOne']({'where':{'id':_0x1d4813['params']['id']}})[_0xe233('0x20')](handleEntityNotFound(_0x512cee,null))['then'](function(_0x517b49){if(_0x517b49){_0x894fbc=_0x517b49;_0x43b6b7[_0xe233('0x3f')]=_[_0xe233('0x41')](db[_0xe233('0x5a')]['rawAttributes']);_0x43b6b7[_0xe233('0x40')]=_[_0xe233('0x41')](_0x1d4813[_0xe233('0x40')]);_0x43b6b7[_0xe233('0x42')]=_[_0xe233('0x43')](_0x43b6b7['model'],_0x43b6b7[_0xe233('0x40')]);_0x97dcf5['attributes']=_[_0xe233('0x43')](_0x43b6b7['model'],qs[_0xe233('0x44')](_0x1d4813[_0xe233('0x40')][_0xe233('0x44')]));_0x97dcf5[_0xe233('0x45')]=_0x97dcf5[_0xe233('0x45')]['length']?_0x97dcf5[_0xe233('0x45')]:_0x43b6b7[_0xe233('0x3f')];_0x97dcf5[_0xe233('0x4a')]=qs['sort'](_0x1d4813[_0xe233('0x40')][_0xe233('0x4b')]);_0x97dcf5[_0xe233('0x4c')]=qs['filters'](_['pick'](_0x1d4813['query'],_0x43b6b7[_0xe233('0x42')]));if(_0x1d4813['query']['filter']){_0x97dcf5['where']=_['merge'](_0x97dcf5[_0xe233('0x4c')],{'$or':_[_0xe233('0x3a')](_0x97dcf5['attributes'],function(_0x2e55b6){var _0x13d724={};_0x13d724[_0x2e55b6]={'$like':'%'+_0x1d4813[_0xe233('0x40')]['filter']+'%'};return _0x13d724;})});}_0x97dcf5=_[_0xe233('0x4e')]({},_0x97dcf5,_0x1d4813[_0xe233('0x55')]);return _0x894fbc['getConfigurations'](_0x97dcf5);}})['then'](function(_0x3c7405){if(_0x3c7405){_0x590f53=_0x3c7405[_0xe233('0x46')];if(!_0x1d4813[_0xe233('0x40')][_0xe233('0x47')]('nolimit')){_0x97dcf5[_0xe233('0x49')]=qs[_0xe233('0x49')](_0x1d4813['query'][_0xe233('0x49')]);_0x97dcf5[_0xe233('0x30')]=qs[_0xe233('0x30')](_0x1d4813[_0xe233('0x40')]['offset']);}return _0x894fbc[_0xe233('0x59')](_0x97dcf5);}})[_0xe233('0x20')](function(_0x344e76){if(_0x344e76){return _0x344e76?{'count':_0x590f53,'rows':_0x344e76}:null;}})[_0xe233('0x20')](respondWithResult(_0x512cee,null))[_0xe233('0x2a')](handleError(_0x512cee,null));};exports[_0xe233('0x5b')]=function(_0x5ee4ed,_0x528229,_0x2ac06b){if(_0x5ee4ed['body']['id']){delete _0x5ee4ed['body']['id'];}return db[_0xe233('0x50')][_0xe233('0x5c')]({'where':{'id':_0x5ee4ed['params']['id']}})[_0xe233('0x20')](handleEntityNotFound(_0x528229,null))['then'](function(_0x23ceaa){if(_0x23ceaa){_0x5ee4ed[_0xe233('0x58')][_0xe233('0x5d')]=_0x23ceaa['id'];_0x5ee4ed[_0xe233('0x58')][_0xe233('0x5e')]=integrations[_0xe233('0x5f')](_0x5ee4ed[_0xe233('0x58')][_0xe233('0x60')],_0x5ee4ed[_0xe233('0x58')][_0xe233('0x3d')]);_0x5ee4ed[_0xe233('0x58')][_0xe233('0x61')]=integrations[_0xe233('0x62')](_0x5ee4ed[_0xe233('0x58')][_0xe233('0x60')],_0x5ee4ed[_0xe233('0x58')][_0xe233('0x3d')]);return db[_0xe233('0x5a')][_0xe233('0x57')](_0x5ee4ed[_0xe233('0x58')],{'include':[{'model':db[_0xe233('0x63')],'as':_0xe233('0x5e')},{'model':db[_0xe233('0x63')],'as':_0xe233('0x61')}]});}return null;})[_0xe233('0x20')](respondWithResult(_0x528229,null))[_0xe233('0x2a')](handleError(_0x528229,null));};exports['getFields']=function(_0x5cad7a,_0x18a0c6,_0x5bc105){var _0x15b2e1=_0x5cad7a[_0xe233('0x40')]['ticketType'];var _0x22014c=_0x15b2e1===_0xe233('0x64')?'Incident':_0xe233('0x65');var _0xd8924f='';var _0x20c1d3='';var _0x34670a='';var _0x42c3bc='';var _0x47f2ec='';var _0x2d0784='';var _0x530356='';var _0x4a668c='';var _0x411053=[_0xe233('0x66'),_0xe233('0x67'),_0xe233('0x68'),_0xe233('0x69'),'caseorigincode',_0xe233('0x6a'),_0xe233('0x6b'),_0xe233('0x6c'),_0xe233('0x6d'),_0xe233('0x6e')];var _0x273fbb=[_0xe233('0x6f'),'accountidyominame',_0xe233('0x70'),_0xe233('0x71'),_0xe233('0x72'),_0xe233('0x73'),_0xe233('0x74'),_0xe233('0x75'),_0xe233('0x76'),_0xe233('0x77'),_0xe233('0x78'),_0xe233('0x79'),_0xe233('0x7a'),_0xe233('0x7b'),_0xe233('0x7c'),_0xe233('0x7d'),_0xe233('0x7e'),_0xe233('0x7f'),_0xe233('0x80'),_0xe233('0x81'),_0xe233('0x82'),_0xe233('0x83'),_0xe233('0x84'),_0xe233('0x85'),'firstresponsebykpiidname','followupby','importsequencenumber',_0xe233('0x86'),_0xe233('0x87'),_0xe233('0x88'),'masteridname',_0xe233('0x89'),_0xe233('0x8a'),'modifiedbyname',_0xe233('0x8b'),_0xe233('0x8c'),'modifiedonbehalfbyname',_0xe233('0x8d'),_0xe233('0x8e'),'msdyn_iotalertname',_0xe233('0x8f'),_0xe233('0x90'),_0xe233('0x91'),_0xe233('0x92'),_0xe233('0x93'),_0xe233('0x94'),_0xe233('0x95'),_0xe233('0x96'),'primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby',_0xe233('0x97'),_0xe233('0x98'),_0xe233('0x99'),'responsiblecontactidyominame',_0xe233('0x9a'),_0xe233('0x9b'),_0xe233('0x9c'),_0xe233('0x9d'),_0xe233('0x9e'),'statuscode',_0xe233('0x9f'),_0xe233('0xa0'),_0xe233('0xa1'),_0xe233('0xa2'),_0xe233('0xa3'),_0xe233('0xa4'),_0xe233('0xa5')];var _0x11d63f=_0x411053['concat'](_0x273fbb);return db[_0xe233('0x50')][_0xe233('0x5c')]({'where':{'id':_0x5cad7a[_0xe233('0x53')]['id']},'attributes':['id',_0xe233('0xa6'),'password',_0xe233('0xa7'),_0xe233('0xa8'),_0xe233('0xa9'),_0xe233('0xaa')]})[_0xe233('0x20')](handleEntityNotFound(_0x18a0c6,null))[_0xe233('0x20')](function(_0x49fe3c){if(_0x49fe3c){_0x4a668c=_0x49fe3c[_0xe233('0xa7')];var _0xb7fb83=_0x4a668c[_0xe233('0xab')](-0x1);if(_0xb7fb83==='/'){_0x4a668c=_0x4a668c['substring'](0x0,_0x4a668c[_0xe233('0xac')](_0xb7fb83));}_0x530356=util[_0xe233('0xad')](_0xe233('0xae'),_0x4a668c);var _0x16fbe6={'method':_0xe233('0xaf'),'uri':_0xe233('0xb0')+_0x49fe3c[_0xe233('0xa8')]+_0xe233('0xb1'),'form':{'client_id':_0x49fe3c['clientId'],'resource':_0x4a668c,'username':_0x49fe3c['username'],'password':_0x49fe3c[_0xe233('0xb2')],'grant_type':_0xe233('0xb2'),'client_secret':_0x49fe3c[_0xe233('0xaa')]},'json':!![]};return rp(_0x16fbe6);}})[_0xe233('0x20')](function(_0x5552a0){_0x2d0784=_0x5552a0['access_token'];var _0x2bcb30={'method':_0xe233('0xb3'),'uri':encodeURI(_0x530356+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x22014c+'\x27'),'headers':{'Authorization':_0xe233('0xb4')+_0x2d0784,'If-None-Match':null,'OData-Version':_0xe233('0xb5')},'json':!![]};return rp(_0x2bcb30);})['then'](function(_0x237200){var _0x42982a=_0x237200[_0xe233('0xb6')][0x0];var _0xe6e021=_0x42982a[_0xe233('0xb7')];var _0x12e403={'method':_0xe233('0xb3'),'uri':_0x530356+_0xe233('0xb8')+_0xe6e021+_0xe233('0xb9'),'headers':{'Authorization':_0xe233('0xb4')+_0x2d0784,'If-None-Match':null,'OData-Version':_0xe233('0xb5')},'json':!![]};return rp(_0x12e403);})[_0xe233('0x20')](function(_0x35162e){_0xd8924f=_0x35162e;_0x20c1d3=_0xd8924f[_0xe233('0xba')];_0x20c1d3=_[_0xe233('0xbb')](_0x20c1d3,function(_0x57b9ba){return!_0x11d63f[_0xe233('0xbc')](_0x57b9ba[_0xe233('0xbd')]);});var _0x534103=[];var _0x3c8fb4=[];_0x20c1d3[_0xe233('0xbe')](function(_0x4d000a){if(_0x4d000a[_0xe233('0xbf')]){var _0x5a2082=_0x4d000a[_0xe233('0xbf')]['substring'](_0x4d000a[_0xe233('0xbf')][_0xe233('0xac')]('.')+0x1);if(_0x5a2082===_0xe233('0xc0')){_0x534103[_0xe233('0xc1')](getSelectList(_0x530356,_0x15b2e1,_0x3c8fb4,_0xd8924f[_0xe233('0xb7')],_0x4d000a[_0xe233('0xb7')],_0x2d0784));}}});return Promise[_0xe233('0xc2')](_0x534103);})['then'](function(_0x5daeb2){_0x34670a=_0x5daeb2[0x0];var _0x551be1=[];var _0x27f22=[];_0x20c1d3[_0xe233('0xbe')](function(_0x491f00){if(!_[_0xe233('0xc3')](_0x491f00[_0xe233('0xbf')])){var _0x4ca79b=_0x491f00[_0xe233('0xbf')][_0xe233('0xc4')](_0x491f00[_0xe233('0xbf')][_0xe233('0xac')]('.')+0x1);if(_0x4ca79b==='BooleanAttributeMetadata'){_0x551be1[_0xe233('0xc1')](getBooleanList(_0x530356,_0x15b2e1,_0x27f22,_0xd8924f[_0xe233('0xb7')],_0x491f00['MetadataId'],_0x2d0784));}}});return Promise[_0xe233('0xc2')](_0x551be1);})[_0xe233('0x20')](function(_0x195022){_0x42c3bc=_0x195022[0x0];var _0x17884b=[];var _0x5f223e=[];_0x20c1d3[_0xe233('0xbe')](function(_0x808f71){if(_0x808f71[_0xe233('0xbf')]){var _0x16d063=_0x808f71[_0xe233('0xbf')][_0xe233('0xc4')](_0x808f71[_0xe233('0xbf')][_0xe233('0xac')]('.')+0x1);if(_0x16d063===_0xe233('0xc5')||_0x16d063==='DoubleAttributeMetadata'||_0x16d063==='BigIntAttributeMetadata'||_0x16d063===_0xe233('0xc6')||_0x16d063==='MemoAttributeMetadata'||_0x16d063==='DateTimeAttributeMetadata'||_0x16d063===_0xe233('0xc7')||_0x16d063===_0xe233('0xc8')||_0x16d063===_0xe233('0xc9')||_0x16d063===_0xe233('0xca')){_0x17884b['push'](getInputList(_0x530356,_0x15b2e1,_0x16d063,_0x5f223e,_0xd8924f[_0xe233('0xb7')],_0x808f71[_0xe233('0xb7')],_0x2d0784));}}});return Promise[_0xe233('0xc2')](_0x17884b);})[_0xe233('0x20')](function(_0x260a10){_0x47f2ec=_0x260a10[0x0];var _0x2a2a50=_0x34670a['concat'](_0x42c3bc)['concat'](_0x47f2ec);var _0x181951={'count':_0x2a2a50[_0xe233('0x46')],'rows':_0x2a2a50};return _0x181951;})['then'](respondWithResult(_0x18a0c6,null))['catch'](function(_0x39ab42){var _0x21d5fe=_0x5cad7a[_0xe233('0x40')][_0xe233('0x1b')]?0x1f4:_0x39ab42[_0xe233('0xcb')]||0x1f4;logger[_0xe233('0x25')](_0x39ab42['stack']);delete _0x39ab42['name'];if(_0x21d5fe===0x191){_0x21d5fe=0x190;}_0x18a0c6[_0xe233('0x2c')](_0x21d5fe)['send'](_0x5cad7a[_0xe233('0x40')][_0xe233('0x1b')]?{'message':_0xe233('0xcc'),'statusCode':_0x39ab42[_0xe233('0xcb')]}:_0x39ab42);});};function getSelectList(_0x30abae,_0x6a6e3b,_0x29e283,_0x119580,_0x5607e5,_0x1f25d7){var _0x13fbc8={'method':_0xe233('0xb3'),'uri':_0x30abae+_0xe233('0xb8')+_0x119580+_0xe233('0xcd')+_0x5607e5+_0xe233('0xce')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x1f25d7,'If-None-Match':null,'OData-Version':_0xe233('0xb5')},'json':!![]};return rp(_0x13fbc8)[_0xe233('0x20')](function(_0x3f19cd){var _0x3cf0b2=[];var _0x5282e0=_0x3f19cd[_0xe233('0xcf')][_0xe233('0xd0')];_0x5282e0[_0xe233('0xbe')](function(_0xc14256){_0x3cf0b2[_0xe233('0xc1')]({'name':_0xc14256['Label'][_0xe233('0xd1')][_0xe233('0xd2')],'value':String(_0xc14256[_0xe233('0xd3')])});});var _0x44fdc6={'id':_0x6a6e3b+'_'+_0x3f19cd['LogicalName'],'name':_0x3f19cd[_0xe233('0xd4')][_0xe233('0xd1')][_0xe233('0xd2')],'custom':![],'options':_0x3cf0b2};_0x29e283[_0xe233('0xc1')](_0x44fdc6);return _0x29e283;});}function getBooleanList(_0x34d1fd,_0x50598d,_0xe39075,_0x1b9fd4,_0x380220,_0x2af2e2){var _0x59f545={'method':_0xe233('0xb3'),'uri':_0x34d1fd+_0xe233('0xb8')+_0x1b9fd4+')/Attributes('+_0x380220+_0xe233('0xd5'),'headers':{'Authorization':'Bearer\x20'+_0x2af2e2,'If-None-Match':null,'OData-Version':_0xe233('0xb5')},'json':!![]};return rp(_0x59f545)[_0xe233('0x20')](function(_0x3be1b5){var _0x3cf953=[];_0x3cf953[_0xe233('0xc1')]({'name':_0x3be1b5[_0xe233('0xcf')][_0xe233('0xd6')][_0xe233('0xd2')][_0xe233('0xd1')][_0xe233('0xd2')],'value':_0xe233('0xd7')},{'name':_0x3be1b5[_0xe233('0xcf')][_0xe233('0xd8')][_0xe233('0xd2')][_0xe233('0xd1')][_0xe233('0xd2')],'value':_0xe233('0xd9')});var _0x2abbee={'id':_0x50598d+'_'+_0x3be1b5[_0xe233('0xbd')],'name':_0x3be1b5[_0xe233('0xd4')][_0xe233('0xd1')][_0xe233('0xd2')],'custom':![],'options':_0x3cf953};_0xe39075[_0xe233('0xc1')](_0x2abbee);return _0xe39075;});}function getInputList(_0xd86bc4,_0x4462c7,_0x411e58,_0x5ad3c4,_0x3df8ba,_0x42af0c,_0x48c73a){var _0x566517={'method':_0xe233('0xb3'),'uri':_0xd86bc4+_0xe233('0xb8')+_0x3df8ba+_0xe233('0xcd')+_0x42af0c+_0xe233('0xda')+_0x411e58+_0xe233('0xdb'),'headers':{'Authorization':_0xe233('0xb4')+_0x48c73a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x566517)[_0xe233('0x20')](function(_0x88df7d){var _0x4800dd={'id':_0x4462c7+'_'+_0x88df7d[_0xe233('0xbd')],'name':_0x88df7d[_0xe233('0xd4')]['UserLocalizedLabel']?_0x88df7d['DisplayName']['UserLocalizedLabel']['Label']:_0x88df7d[_0xe233('0xbd')],'custom':![],'options':[]};_0x5ad3c4[_0xe233('0xc1')](_0x4800dd);return _0x5ad3c4;});} \ No newline at end of file +var _0xa109=['EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','push','Label','UserLocalizedLabel','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/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~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','type','options','Dynamics365Account','includeAll','include','findAll','rows','show','params','find','create','body','getConfigurations','findOne','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','Dynamics365Configuration','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','entitlementidname','entityimage_url','escalatedon','firstresponsebykpiidname','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','remoteUri','tenantId','clientSecret','slice','substring','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','clientId','password','access_token','GET','4.0','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','remove','includes','LogicalName','@odata.type','lastIndexOf','all','forEach','isNil','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata'];(function(_0x10da76,_0xe3a698){var _0x3c8164=function(_0x487e3b){while(--_0x487e3b){_0x10da76['push'](_0x10da76['shift']());}};_0x3c8164(++_0xe3a698);}(_0xa109,0xf2));var _0x9a10=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa109[_0x4cf98e];return _0x1623ac;};'use strict';var pdf=require(_0x9a10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9a10('0x1'));var zipdir=require(_0x9a10('0x2'));var jsonpatch=require(_0x9a10('0x3'));var rp=require('request-promise');var moment=require(_0x9a10('0x4'));var BPromise=require(_0x9a10('0x5'));var Mustache=require(_0x9a10('0x6'));var util=require(_0x9a10('0x7'));var path=require(_0x9a10('0x8'));var sox=require(_0x9a10('0x9'));var csv=require(_0x9a10('0xa'));var ejs=require(_0x9a10('0xb'));var fs=require('fs');var _=require(_0x9a10('0xc'));var squel=require(_0x9a10('0xd'));var crypto=require('crypto');var jsforce=require(_0x9a10('0xe'));var deskjs=require(_0x9a10('0xf'));var toCsv=require(_0x9a10('0xa'));var querystring=require(_0x9a10('0x10'));var Papa=require(_0x9a10('0x11'));var Redis=require(_0x9a10('0x12'));var authService=require(_0x9a10('0x13'));var qs=require(_0x9a10('0x14'));var as=require(_0x9a10('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a10('0x16'))(_0x9a10('0x17'));var utils=require(_0x9a10('0x18'));var config=require(_0x9a10('0x19'));var db=require(_0x9a10('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x9a10('0x1b'));var client=jayson[_0x9a10('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x4c0967,_0x59c385,_0x34ba7d){if(_0x34ba7d){var _0x1b6a1c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1b6a1c[_0x9a10('0x1d')](_0x59c385)){return _0x4c0967;}else{throw new db[(_0x9a10('0x1e'))]['ValidationError'](_0x9a10('0x1f'));}}else{return _0x4c0967;}}function respondWithRpcPromise(_0x7c366c,_0x28eb5f,_0x19e9e0,_0x290376){return new BPromise(function(_0xe9b50e,_0xe634e2){var _0x5d0062=_0x290376||client;return _0x5d0062[_0x9a10('0x20')](_0x7c366c,_0x19e9e0)[_0x9a10('0x21')](function(_0x5e5838){logger[_0x9a10('0x22')]('Dynamics365Account,\x20%s,\x20%s',_0x28eb5f,_0x9a10('0x23'));logger[_0x9a10('0x24')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x28eb5f,_0x9a10('0x23'),JSON[_0x9a10('0x25')](_0x5e5838));if(_0x5e5838[_0x9a10('0x26')]){if(_0x5e5838[_0x9a10('0x26')][_0x9a10('0x27')]===0x1f4){logger[_0x9a10('0x26')](_0x9a10('0x28'),_0x28eb5f,_0x5e5838[_0x9a10('0x26')][_0x9a10('0x29')]);return _0xe634e2(_0x5e5838[_0x9a10('0x26')]['message']);}logger[_0x9a10('0x26')](_0x9a10('0x28'),_0x28eb5f,_0x5e5838[_0x9a10('0x26')][_0x9a10('0x29')]);return _0xe9b50e(_0x5e5838[_0x9a10('0x26')][_0x9a10('0x29')]);}else{logger[_0x9a10('0x22')](_0x9a10('0x28'),_0x28eb5f,'request\x20sent');_0xe9b50e(_0x5e5838['result'][_0x9a10('0x29')]);}})[_0x9a10('0x2a')](function(_0x3b883e){logger['error'](_0x9a10('0x28'),_0x28eb5f,_0x3b883e);_0xe634e2(_0x3b883e);});});}function respondWithStatusCode(_0x53ef58,_0x43364e){_0x43364e=_0x43364e||0xcc;return function(_0x59828f){if(_0x59828f){return _0x53ef58[_0x9a10('0x2b')](_0x43364e);}return _0x53ef58[_0x9a10('0x2c')](_0x43364e)['end']();};}function respondWithResult(_0x1288aa,_0x39b73c){_0x39b73c=_0x39b73c||0xc8;return function(_0x48a148){if(_0x48a148){return _0x1288aa[_0x9a10('0x2c')](_0x39b73c)[_0x9a10('0x2d')](_0x48a148);}};}function respondWithFilteredResult(_0x4a1320,_0x5d1a5c){return function(_0x39789d){if(_0x39789d){var _0xe83765=_0x39789d[_0x9a10('0x2e')],_0x22c2de=_0x5d1a5c[_0x9a10('0x2f')],_0x31cb45=_0x5d1a5c[_0x9a10('0x2f')]+_0x5d1a5c[_0x9a10('0x30')],_0x169d12;if(_0x31cb45>=_0xe83765){_0x31cb45=_0xe83765;_0x169d12=0xc8;}else{_0x169d12=0xce;}_0x4a1320[_0x9a10('0x2c')](_0x169d12);return _0x4a1320[_0x9a10('0x31')](_0x9a10('0x32'),_0x22c2de+'-'+_0x31cb45+'/'+_0xe83765)[_0x9a10('0x2d')](_0x39789d);}return null;};}function patchUpdates(_0x2d2caa){return function(_0x1036fd){try{jsonpatch[_0x9a10('0x33')](_0x1036fd,_0x2d2caa,!![]);}catch(_0x11d93a){return BPromise[_0x9a10('0x34')](_0x11d93a);}return _0x1036fd[_0x9a10('0x35')]();};}function saveUpdates(_0x26b0fe,_0x32d9fe){return function(_0x90f7ec){if(_0x90f7ec){return _0x90f7ec[_0x9a10('0x36')](_0x26b0fe)[_0x9a10('0x21')](function(_0x2c5673){return _0x2c5673;});}return null;};}function removeEntity(_0x1b57d6,_0x4bb73e){return function(_0x57bc3e){if(_0x57bc3e){return _0x57bc3e[_0x9a10('0x37')]()[_0x9a10('0x21')](function(){_0x1b57d6[_0x9a10('0x2c')](0xcc)[_0x9a10('0x38')]();});}};}function handleEntityNotFound(_0x236120,_0x5c7a15){return function(_0x408c3f){if(!_0x408c3f){_0x236120[_0x9a10('0x2b')](0x194);}return _0x408c3f;};}function handleError(_0x111d42,_0x1695fb){_0x1695fb=_0x1695fb||0x1f4;return function(_0x3ec413){logger[_0x9a10('0x26')](_0x3ec413[_0x9a10('0x39')]);if(_0x3ec413['name']){delete _0x3ec413[_0x9a10('0x3a')];}_0x111d42[_0x9a10('0x2c')](_0x1695fb)['send'](_0x3ec413);};}exports[_0x9a10('0x3b')]=function(_0x561c92,_0x5b255a){var _0x3cf0fe={},_0x1f4829={},_0x382db9={'count':0x0,'rows':[]};var _0xf05138=_[_0x9a10('0x3c')](db['Dynamics365Account'][_0x9a10('0x3d')],function(_0x47a963){return{'name':_0x47a963[_0x9a10('0x3e')],'type':_0x47a963['type'][_0x9a10('0x3f')]};});_0x1f4829[_0x9a10('0x40')]=_['map'](_0xf05138,_0x9a10('0x3a'));_0x1f4829[_0x9a10('0x41')]=_[_0x9a10('0x42')](_0x561c92[_0x9a10('0x41')]);_0x1f4829['filters']=_[_0x9a10('0x43')](_0x1f4829[_0x9a10('0x40')],_0x1f4829[_0x9a10('0x41')]);_0x3cf0fe[_0x9a10('0x44')]=_[_0x9a10('0x43')](_0x1f4829[_0x9a10('0x40')],qs[_0x9a10('0x45')](_0x561c92[_0x9a10('0x41')][_0x9a10('0x45')]));_0x3cf0fe[_0x9a10('0x44')]=_0x3cf0fe['attributes'][_0x9a10('0x46')]?_0x3cf0fe[_0x9a10('0x44')]:_0x1f4829[_0x9a10('0x40')];if(!_0x561c92[_0x9a10('0x41')][_0x9a10('0x47')]('nolimit')){_0x3cf0fe[_0x9a10('0x30')]=qs[_0x9a10('0x30')](_0x561c92[_0x9a10('0x41')]['limit']);_0x3cf0fe[_0x9a10('0x2f')]=qs['offset'](_0x561c92[_0x9a10('0x41')]['offset']);}_0x3cf0fe[_0x9a10('0x48')]=qs[_0x9a10('0x49')](_0x561c92[_0x9a10('0x41')][_0x9a10('0x49')]);_0x3cf0fe[_0x9a10('0x4a')]=qs['filters'](_[_0x9a10('0x4b')](_0x561c92[_0x9a10('0x41')],_0x1f4829[_0x9a10('0x4c')]));if(_0x561c92[_0x9a10('0x41')][_0x9a10('0x4d')]){_0x3cf0fe['where']=_[_0x9a10('0x4e')](_0x3cf0fe['where'],{'$or':_[_0x9a10('0x3c')](_0xf05138,function(_0x5d5ca0){if(_0x5d5ca0[_0x9a10('0x4f')]!=='VIRTUAL'){var _0x4f8721={};_0x4f8721[_0x5d5ca0[_0x9a10('0x3a')]]={'$like':'%'+_0x561c92[_0x9a10('0x41')][_0x9a10('0x4d')]+'%'};return _0x4f8721;}})});}_0x3cf0fe=_[_0x9a10('0x4e')]({},_0x3cf0fe,_0x561c92[_0x9a10('0x50')]);var _0x212ef0={'where':_0x3cf0fe['where']};return db[_0x9a10('0x51')][_0x9a10('0x2e')](_0x212ef0)[_0x9a10('0x21')](function(_0x2c303e){_0x382db9[_0x9a10('0x2e')]=_0x2c303e;if(_0x561c92['query'][_0x9a10('0x52')]){_0x3cf0fe[_0x9a10('0x53')]=[{'all':!![]}];}return db[_0x9a10('0x51')][_0x9a10('0x54')](_0x3cf0fe);})[_0x9a10('0x21')](function(_0x1696dd){_0x382db9[_0x9a10('0x55')]=_0x1696dd;return _0x382db9;})[_0x9a10('0x21')](respondWithFilteredResult(_0x5b255a,_0x3cf0fe))[_0x9a10('0x2a')](handleError(_0x5b255a,null));};exports[_0x9a10('0x56')]=function(_0x8fafb2,_0x39bacb){var _0x83f0ac={'raw':![],'where':{'id':_0x8fafb2[_0x9a10('0x57')]['id']}},_0x4354d2={};_0x4354d2['model']=_['keys'](db[_0x9a10('0x51')]['rawAttributes']);_0x4354d2[_0x9a10('0x41')]=_[_0x9a10('0x42')](_0x8fafb2['query']);_0x4354d2[_0x9a10('0x4c')]=_[_0x9a10('0x43')](_0x4354d2['model'],_0x4354d2[_0x9a10('0x41')]);_0x83f0ac[_0x9a10('0x44')]=_['intersection'](_0x4354d2[_0x9a10('0x40')],qs['fields'](_0x8fafb2[_0x9a10('0x41')]['fields']));_0x83f0ac[_0x9a10('0x44')]=_0x83f0ac[_0x9a10('0x44')][_0x9a10('0x46')]?_0x83f0ac['attributes']:_0x4354d2['model'];if(_0x8fafb2[_0x9a10('0x41')][_0x9a10('0x52')]){_0x83f0ac[_0x9a10('0x53')]=[{'all':!![]}];}_0x83f0ac=_[_0x9a10('0x4e')]({},_0x83f0ac,_0x8fafb2[_0x9a10('0x50')]);return db[_0x9a10('0x51')][_0x9a10('0x58')](_0x83f0ac)[_0x9a10('0x21')](handleEntityNotFound(_0x39bacb,null))[_0x9a10('0x21')](respondWithResult(_0x39bacb,null))[_0x9a10('0x2a')](handleError(_0x39bacb,null));};exports[_0x9a10('0x59')]=function(_0x51d255,_0x4bbf2e){return db[_0x9a10('0x51')][_0x9a10('0x59')](_0x51d255['body'],{})[_0x9a10('0x21')](respondWithResult(_0x4bbf2e,0xc9))[_0x9a10('0x2a')](handleError(_0x4bbf2e,null));};exports[_0x9a10('0x36')]=function(_0x13de5a,_0xfd082d){if(_0x13de5a[_0x9a10('0x5a')]['id']){delete _0x13de5a[_0x9a10('0x5a')]['id'];}return db[_0x9a10('0x51')]['find']({'where':{'id':_0x13de5a[_0x9a10('0x57')]['id']}})[_0x9a10('0x21')](handleEntityNotFound(_0xfd082d,null))[_0x9a10('0x21')](saveUpdates(_0x13de5a[_0x9a10('0x5a')],null))[_0x9a10('0x21')](respondWithResult(_0xfd082d,null))[_0x9a10('0x2a')](handleError(_0xfd082d,null));};exports['destroy']=function(_0x48b00e,_0x2140c6){return db[_0x9a10('0x51')][_0x9a10('0x58')]({'where':{'id':_0x48b00e[_0x9a10('0x57')]['id']}})[_0x9a10('0x21')](handleEntityNotFound(_0x2140c6,null))[_0x9a10('0x21')](removeEntity(_0x2140c6,null))[_0x9a10('0x2a')](handleError(_0x2140c6,null));};exports[_0x9a10('0x5b')]=function(_0x28f856,_0x2f9d55,_0x3b1344){var _0x9feb2b={};var _0x224541={};var _0x1fe80c;var _0x3a3de5;return db[_0x9a10('0x51')][_0x9a10('0x5c')]({'where':{'id':_0x28f856[_0x9a10('0x57')]['id']}})['then'](handleEntityNotFound(_0x2f9d55,null))[_0x9a10('0x21')](function(_0x520225){if(_0x520225){_0x1fe80c=_0x520225;_0x224541[_0x9a10('0x40')]=_[_0x9a10('0x42')](db['Dynamics365Configuration'][_0x9a10('0x3d')]);_0x224541[_0x9a10('0x41')]=_[_0x9a10('0x42')](_0x28f856['query']);_0x224541[_0x9a10('0x4c')]=_[_0x9a10('0x43')](_0x224541[_0x9a10('0x40')],_0x224541[_0x9a10('0x41')]);_0x9feb2b[_0x9a10('0x44')]=_['intersection'](_0x224541[_0x9a10('0x40')],qs[_0x9a10('0x45')](_0x28f856[_0x9a10('0x41')][_0x9a10('0x45')]));_0x9feb2b[_0x9a10('0x44')]=_0x9feb2b[_0x9a10('0x44')][_0x9a10('0x46')]?_0x9feb2b[_0x9a10('0x44')]:_0x224541[_0x9a10('0x40')];_0x9feb2b[_0x9a10('0x48')]=qs['sort'](_0x28f856[_0x9a10('0x41')][_0x9a10('0x49')]);_0x9feb2b[_0x9a10('0x4a')]=qs[_0x9a10('0x4c')](_[_0x9a10('0x4b')](_0x28f856[_0x9a10('0x41')],_0x224541[_0x9a10('0x4c')]));if(_0x28f856[_0x9a10('0x41')][_0x9a10('0x4d')]){_0x9feb2b[_0x9a10('0x4a')]=_[_0x9a10('0x4e')](_0x9feb2b[_0x9a10('0x4a')],{'$or':_[_0x9a10('0x3c')](_0x9feb2b[_0x9a10('0x44')],function(_0x4fe525){var _0x54fa77={};_0x54fa77[_0x4fe525]={'$like':'%'+_0x28f856['query']['filter']+'%'};return _0x54fa77;})});}_0x9feb2b=_[_0x9a10('0x4e')]({},_0x9feb2b,_0x28f856[_0x9a10('0x50')]);return _0x1fe80c['getConfigurations'](_0x9feb2b);}})[_0x9a10('0x21')](function(_0x33a6a4){if(_0x33a6a4){_0x3a3de5=_0x33a6a4[_0x9a10('0x46')];if(!_0x28f856['query'][_0x9a10('0x47')](_0x9a10('0x5d'))){_0x9feb2b[_0x9a10('0x30')]=qs[_0x9a10('0x30')](_0x28f856['query']['limit']);_0x9feb2b['offset']=qs[_0x9a10('0x2f')](_0x28f856[_0x9a10('0x41')][_0x9a10('0x2f')]);}return _0x1fe80c['getConfigurations'](_0x9feb2b);}})['then'](function(_0x371303){if(_0x371303){return _0x371303?{'count':_0x3a3de5,'rows':_0x371303}:null;}})['then'](respondWithResult(_0x2f9d55,null))[_0x9a10('0x2a')](handleError(_0x2f9d55,null));};exports[_0x9a10('0x5e')]=function(_0x50726a,_0x2af21e,_0x3944be){if(_0x50726a['body']['id']){delete _0x50726a['body']['id'];}return db[_0x9a10('0x51')]['findOne']({'where':{'id':_0x50726a[_0x9a10('0x57')]['id']}})['then'](handleEntityNotFound(_0x2af21e,null))[_0x9a10('0x21')](function(_0x13ef16){if(_0x13ef16){_0x50726a['body'][_0x9a10('0x5f')]=_0x13ef16['id'];_0x50726a[_0x9a10('0x5a')][_0x9a10('0x60')]=integrations['getSubjects'](_0x50726a[_0x9a10('0x5a')][_0x9a10('0x61')],_0x50726a[_0x9a10('0x5a')][_0x9a10('0x4f')]);_0x50726a['body'][_0x9a10('0x62')]=integrations['getDescriptions'](_0x50726a['body'][_0x9a10('0x61')],_0x50726a['body'][_0x9a10('0x4f')]);return db[_0x9a10('0x63')]['create'](_0x50726a[_0x9a10('0x5a')],{'include':[{'model':db['Dynamics365Field'],'as':_0x9a10('0x60')},{'model':db[_0x9a10('0x64')],'as':'Descriptions'}]});}return null;})[_0x9a10('0x21')](respondWithResult(_0x2af21e,null))[_0x9a10('0x2a')](handleError(_0x2af21e,null));};exports[_0x9a10('0x65')]=function(_0x58c516,_0xffd460,_0xb9c5cf){var _0x4b9428=_0x58c516[_0x9a10('0x41')][_0x9a10('0x66')];var _0x286e53=_0x4b9428===_0x9a10('0x67')?_0x9a10('0x68'):_0x9a10('0x69');var _0x227596='';var _0x4b1b48='';var _0x553f50='';var _0x5037e5='';var _0x2a3ab0='';var _0x573705='';var _0x42ec87='';var _0x439f95='';var _0x46f039=[_0x9a10('0x6a'),_0x9a10('0x6b'),_0x9a10('0x6c'),'ownerid',_0x9a10('0x6d'),_0x9a10('0x6e'),_0x9a10('0x6f'),_0x9a10('0x70'),_0x9a10('0x71'),'phonecall_activity_parties'];var _0x535055=[_0x9a10('0x72'),_0x9a10('0x73'),_0x9a10('0x74'),_0x9a10('0x75'),'contactidname','contactidyominame',_0x9a10('0x76'),_0x9a10('0x77'),_0x9a10('0x78'),_0x9a10('0x79'),'createdbyname',_0x9a10('0x7a'),_0x9a10('0x7b'),_0x9a10('0x7c'),_0x9a10('0x7d'),_0x9a10('0x7e'),'customeridtype','customeridyominame','emailaddress',_0x9a10('0x7f'),'entityimage_timestamp',_0x9a10('0x80'),_0x9a10('0x81'),'exchangerate',_0x9a10('0x82'),'followupby','importsequencenumber','influencescore',_0x9a10('0x83'),_0x9a10('0x84'),_0x9a10('0x85'),_0x9a10('0x86'),'modifiedbyexternalpartyyominame',_0x9a10('0x87'),_0x9a10('0x88'),_0x9a10('0x89'),_0x9a10('0x8a'),_0x9a10('0x8b'),_0x9a10('0x8c'),_0x9a10('0x8d'),_0x9a10('0x8e'),_0x9a10('0x8f'),'overriddencreatedon','owneridname','owneridtype',_0x9a10('0x90'),_0x9a10('0x91'),_0x9a10('0x92'),_0x9a10('0x93'),_0x9a10('0x94'),_0x9a10('0x95'),_0x9a10('0x96'),_0x9a10('0x97'),_0x9a10('0x98'),_0x9a10('0x99'),_0x9a10('0x9a'),'responsiblecontactidyominame',_0x9a10('0x9b'),'slainvokedidname',_0x9a10('0x9c'),_0x9a10('0x9d'),_0x9a10('0x9e'),_0x9a10('0x9f'),_0x9a10('0xa0'),_0x9a10('0xa1'),_0x9a10('0xa2'),'transactioncurrencyidname',_0x9a10('0xa3'),_0x9a10('0xa4'),_0x9a10('0xa5')];var _0x3e70fc=_0x46f039[_0x9a10('0xa6')](_0x535055);return db[_0x9a10('0x51')][_0x9a10('0x5c')]({'where':{'id':_0x58c516[_0x9a10('0x57')]['id']},'attributes':['id',_0x9a10('0xa7'),'password',_0x9a10('0xa8'),_0x9a10('0xa9'),'clientId',_0x9a10('0xaa')]})[_0x9a10('0x21')](handleEntityNotFound(_0xffd460,null))[_0x9a10('0x21')](function(_0x9f042c){if(_0x9f042c){_0x439f95=_0x9f042c['remoteUri'];var _0x870abd=_0x439f95[_0x9a10('0xab')](-0x1);if(_0x870abd==='/'){_0x439f95=_0x439f95[_0x9a10('0xac')](0x0,_0x439f95['lastIndexOf'](_0x870abd));}_0x42ec87=util[_0x9a10('0xad')](_0x9a10('0xae'),_0x439f95);var _0x2f1d0d={'method':_0x9a10('0xaf'),'uri':_0x9a10('0xb0')+_0x9f042c[_0x9a10('0xa9')]+_0x9a10('0xb1'),'form':{'client_id':_0x9f042c[_0x9a10('0xb2')],'resource':_0x439f95,'username':_0x9f042c[_0x9a10('0xa7')],'password':_0x9f042c[_0x9a10('0xb3')],'grant_type':_0x9a10('0xb3'),'client_secret':_0x9f042c[_0x9a10('0xaa')]},'json':!![]};return rp(_0x2f1d0d);}})['then'](function(_0x5e08f7){_0x573705=_0x5e08f7[_0x9a10('0xb4')];var _0x4cdd22={'method':_0x9a10('0xb5'),'uri':encodeURI(_0x42ec87+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x286e53+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x573705,'If-None-Match':null,'OData-Version':_0x9a10('0xb6')},'json':!![]};return rp(_0x4cdd22);})['then'](function(_0x5378c3){var _0x14228c=_0x5378c3['value'][0x0];var _0x468542=_0x14228c[_0x9a10('0xb7')];var _0x3be30b={'method':_0x9a10('0xb5'),'uri':_0x42ec87+_0x9a10('0xb8')+_0x468542+_0x9a10('0xb9'),'headers':{'Authorization':_0x9a10('0xba')+_0x573705,'If-None-Match':null,'OData-Version':_0x9a10('0xb6')},'json':!![]};return rp(_0x3be30b);})[_0x9a10('0x21')](function(_0x4ddb38){_0x227596=_0x4ddb38;_0x4b1b48=_0x227596['Attributes'];_0x4b1b48=_[_0x9a10('0xbb')](_0x4b1b48,function(_0x1d22b9){return!_0x3e70fc[_0x9a10('0xbc')](_0x1d22b9[_0x9a10('0xbd')]);});var _0x357540=[];var _0x55e446=[];_0x4b1b48['forEach'](function(_0x3f4aa2){if(_0x3f4aa2[_0x9a10('0xbe')]){var _0x40f12a=_0x3f4aa2[_0x9a10('0xbe')]['substring'](_0x3f4aa2[_0x9a10('0xbe')][_0x9a10('0xbf')]('.')+0x1);if(_0x40f12a==='PicklistAttributeMetadata'){_0x357540['push'](getSelectList(_0x42ec87,_0x4b9428,_0x55e446,_0x227596['MetadataId'],_0x3f4aa2[_0x9a10('0xb7')],_0x573705));}}});return Promise[_0x9a10('0xc0')](_0x357540);})[_0x9a10('0x21')](function(_0x14d49b){_0x553f50=_0x14d49b[0x0];var _0x4bbb72=[];var _0x267cc9=[];_0x4b1b48[_0x9a10('0xc1')](function(_0x2daab2){if(!_[_0x9a10('0xc2')](_0x2daab2[_0x9a10('0xbe')])){var _0x2719eb=_0x2daab2[_0x9a10('0xbe')][_0x9a10('0xac')](_0x2daab2[_0x9a10('0xbe')]['lastIndexOf']('.')+0x1);if(_0x2719eb==='BooleanAttributeMetadata'){_0x4bbb72['push'](getBooleanList(_0x42ec87,_0x4b9428,_0x267cc9,_0x227596[_0x9a10('0xb7')],_0x2daab2[_0x9a10('0xb7')],_0x573705));}}});return Promise[_0x9a10('0xc0')](_0x4bbb72);})[_0x9a10('0x21')](function(_0x310ddf){_0x5037e5=_0x310ddf[0x0];var _0x2316d2=[];var _0x18832e=[];_0x4b1b48[_0x9a10('0xc1')](function(_0x4b236a){if(_0x4b236a[_0x9a10('0xbe')]){var _0x5055f4=_0x4b236a['@odata.type'][_0x9a10('0xac')](_0x4b236a[_0x9a10('0xbe')][_0x9a10('0xbf')]('.')+0x1);if(_0x5055f4===_0x9a10('0xc3')||_0x5055f4===_0x9a10('0xc4')||_0x5055f4===_0x9a10('0xc5')||_0x5055f4===_0x9a10('0xc6')||_0x5055f4===_0x9a10('0xc7')||_0x5055f4===_0x9a10('0xc8')||_0x5055f4===_0x9a10('0xc9')||_0x5055f4===_0x9a10('0xca')||_0x5055f4===_0x9a10('0xcb')||_0x5055f4===_0x9a10('0xcc')){_0x2316d2['push'](getInputList(_0x42ec87,_0x4b9428,_0x5055f4,_0x18832e,_0x227596['MetadataId'],_0x4b236a[_0x9a10('0xb7')],_0x573705));}}});return Promise[_0x9a10('0xc0')](_0x2316d2);})[_0x9a10('0x21')](function(_0x13f5e9){_0x2a3ab0=_0x13f5e9[0x0];var _0x1f44b3=_0x553f50['concat'](_0x5037e5)[_0x9a10('0xa6')](_0x2a3ab0);var _0x5a5828={'count':_0x1f44b3[_0x9a10('0x46')],'rows':_0x1f44b3};return _0x5a5828;})[_0x9a10('0x21')](respondWithResult(_0xffd460,null))[_0x9a10('0x2a')](function(_0x5d8473){var _0x4802e7=_0x58c516[_0x9a10('0x41')][_0x9a10('0x1d')]?0x1f4:_0x5d8473[_0x9a10('0xcd')]||0x1f4;logger[_0x9a10('0x26')](_0x5d8473[_0x9a10('0x39')]);delete _0x5d8473[_0x9a10('0x3a')];if(_0x4802e7===0x191){_0x4802e7=0x190;}_0xffd460[_0x9a10('0x2c')](_0x4802e7)['send'](_0x58c516[_0x9a10('0x41')][_0x9a10('0x1d')]?{'message':_0x9a10('0xce'),'statusCode':_0x5d8473[_0x9a10('0xcd')]}:_0x5d8473);});};function getSelectList(_0x7e35b0,_0x5db8ec,_0x44c5cf,_0x51442b,_0x482ab5,_0x5842c3){var _0x14591f={'method':_0x9a10('0xb5'),'uri':_0x7e35b0+_0x9a10('0xb8')+_0x51442b+_0x9a10('0xcf')+_0x482ab5+_0x9a10('0xd0')+_0x9a10('0xd1'),'headers':{'Authorization':_0x9a10('0xba')+_0x5842c3,'If-None-Match':null,'OData-Version':_0x9a10('0xb6')},'json':!![]};return rp(_0x14591f)[_0x9a10('0x21')](function(_0x493ac0){var _0x438b51=[];var _0x137784=_0x493ac0[_0x9a10('0xd2')][_0x9a10('0xd3')];_0x137784[_0x9a10('0xc1')](function(_0x440ab1){_0x438b51[_0x9a10('0xd4')]({'name':_0x440ab1[_0x9a10('0xd5')][_0x9a10('0xd6')][_0x9a10('0xd5')],'value':String(_0x440ab1['Value'])});});var _0x21fc2c={'id':_0x5db8ec+'_'+_0x493ac0[_0x9a10('0xbd')],'name':_0x493ac0[_0x9a10('0xd7')][_0x9a10('0xd6')][_0x9a10('0xd5')],'custom':![],'options':_0x438b51};_0x44c5cf[_0x9a10('0xd4')](_0x21fc2c);return _0x44c5cf;});}function getBooleanList(_0x203009,_0x4c6671,_0x488f5b,_0x5b4144,_0x9e7d7a,_0x5099cf){var _0x22e97f={'method':'GET','uri':_0x203009+_0x9a10('0xb8')+_0x5b4144+')/Attributes('+_0x9e7d7a+_0x9a10('0xd8'),'headers':{'Authorization':'Bearer\x20'+_0x5099cf,'If-None-Match':null,'OData-Version':_0x9a10('0xb6')},'json':!![]};return rp(_0x22e97f)[_0x9a10('0x21')](function(_0x299e07){var _0x5b4520=[];_0x5b4520[_0x9a10('0xd4')]({'name':_0x299e07[_0x9a10('0xd2')][_0x9a10('0xd9')][_0x9a10('0xd5')][_0x9a10('0xd6')][_0x9a10('0xd5')],'value':_0x9a10('0xda')},{'name':_0x299e07[_0x9a10('0xd2')]['FalseOption']['Label'][_0x9a10('0xd6')]['Label'],'value':_0x9a10('0xdb')});var _0x45641c={'id':_0x4c6671+'_'+_0x299e07[_0x9a10('0xbd')],'name':_0x299e07[_0x9a10('0xd7')][_0x9a10('0xd6')]['Label'],'custom':![],'options':_0x5b4520};_0x488f5b[_0x9a10('0xd4')](_0x45641c);return _0x488f5b;});}function getInputList(_0x34f261,_0x51eb0a,_0x52e55d,_0x90ee2e,_0x269aca,_0x31f75a,_0x5147ef){var _0xc24424={'method':_0x9a10('0xb5'),'uri':_0x34f261+'EntityDefinitions('+_0x269aca+_0x9a10('0xcf')+_0x31f75a+_0x9a10('0xdc')+_0x52e55d+_0x9a10('0xdd'),'headers':{'Authorization':_0x9a10('0xba')+_0x5147ef,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xc24424)[_0x9a10('0x21')](function(_0x1c77de){var _0xbe817b={'id':_0x51eb0a+'_'+_0x1c77de['LogicalName'],'name':_0x1c77de[_0x9a10('0xd7')][_0x9a10('0xd6')]?_0x1c77de[_0x9a10('0xd7')]['UserLocalizedLabel'][_0x9a10('0xd5')]:_0x1c77de[_0x9a10('0xbd')],'custom':![],'options':[]};_0x90ee2e[_0x9a10('0xd4')](_0xbe817b);return _0x90ee2e;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 2c04fc2..ba2f553 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 _0x71a9=['path','rimraf','../../components/integrations/configuration','exports','define','Dynamics365Account','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x71a9,0x17a));var _0x971a=function(_0x104119,_0x2e9f28){_0x104119=_0x104119-0x0;var _0x901609=_0x71a9[_0x104119];return _0x901609;};'use strict';var _=require(_0x971a('0x0'));var util=require('util');var logger=require(_0x971a('0x1'))(_0x971a('0x2'));var moment=require(_0x971a('0x3'));var BPromise=require(_0x971a('0x4'));var rp=require(_0x971a('0x5'));var fs=require('fs');var path=require(_0x971a('0x6'));var rimraf=require(_0x971a('0x7'));var config=require('../../config/environment');var attributes=require('./intDynamics365Account.attributes');var integrations=require(_0x971a('0x8'));module[_0x971a('0x9')]=function(_0x502299,_0x3258e7){return _0x502299[_0x971a('0xa')](_0x971a('0xb'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe552=['exports','define','Dynamics365Account','int_dynamics365_accounts','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x1b16e7,_0x3a270f){var _0x15338c=function(_0x398840){while(--_0x398840){_0x1b16e7['push'](_0x1b16e7['shift']());}};_0x15338c(++_0x3a270f);}(_0xe552,0xe8));var _0x2e55=function(_0x1af385,_0x593bcc){_0x1af385=_0x1af385-0x0;var _0x4660d7=_0xe552[_0x1af385];return _0x4660d7;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2e55('0x0'));var moment=require(_0x2e55('0x1'));var BPromise=require(_0x2e55('0x2'));var rp=require(_0x2e55('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e55('0x4'));var config=require(_0x2e55('0x5'));var attributes=require(_0x2e55('0x6'));var integrations=require(_0x2e55('0x7'));module[_0x2e55('0x8')]=function(_0x28bed8,_0x30f867){return _0x28bed8[_0x2e55('0x9')](_0x2e55('0xa'),attributes,{'tableName':_0x2e55('0xb'),'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 65dafe0..23de8dd 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 _0xe0ae=['map','include','model','ShowDynamics365Account','find','then','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','http','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit'];(function(_0x2d7b97,_0x3c00c5){var _0xd20f92=function(_0x217cdf){while(--_0x217cdf){_0x2d7b97['push'](_0x2d7b97['shift']());}};_0xd20f92(++_0x3c00c5);}(_0xe0ae,0xa1));var _0xee0a=function(_0x367336,_0x18c229){_0x367336=_0x367336-0x0;var _0x3423a7=_0xe0ae[_0x367336];return _0x3423a7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xee0a('0x0'));var BPromise=require(_0xee0a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee0a('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xee0a('0x3'));var logger=require(_0xee0a('0x4'))('rpc');var config=require(_0xee0a('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xee0a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1c5071,_0x347cb3,_0x344355){return new BPromise(function(_0x5e6d2e,_0x2296b9){return client['request'](_0x1c5071,_0x344355)['then'](function(_0x1f9d42){logger[_0xee0a('0x7')](_0xee0a('0x8'),_0x347cb3,'request\x20sent');logger[_0xee0a('0x9')](_0xee0a('0xa'),_0x347cb3,'request\x20sent',JSON[_0xee0a('0xb')](_0x1f9d42));if(_0x1f9d42['error']){if(_0x1f9d42[_0xee0a('0xc')][_0xee0a('0xd')]===0x1f4){logger['error'](_0xee0a('0x8'),_0x347cb3,_0x1f9d42['error'][_0xee0a('0xe')]);return _0x2296b9(_0x1f9d42[_0xee0a('0xc')]['message']);}logger['error'](_0xee0a('0x8'),_0x347cb3,_0x1f9d42[_0xee0a('0xc')][_0xee0a('0xe')]);return _0x5e6d2e(_0x1f9d42[_0xee0a('0xc')][_0xee0a('0xe')]);}else{logger['info'](_0xee0a('0x8'),_0x347cb3,_0xee0a('0xf'));_0x5e6d2e(_0x1f9d42['result'][_0xee0a('0xe')]);}})[_0xee0a('0x10')](function(_0x1bc8e1){logger[_0xee0a('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x347cb3,_0x1bc8e1);_0x2296b9(_0x1bc8e1);});});}exports[_0xee0a('0x11')]=function(_0x1d7a8a){var _0x14ef67=this;return new Promise(function(_0x55c474,_0x1c1be5){return db[_0xee0a('0x12')][_0xee0a('0x13')]({'raw':_0x1d7a8a[_0xee0a('0x14')]?_0x1d7a8a['options'][_0xee0a('0x15')]===undefined?!![]:![]:!![],'where':_0x1d7a8a[_0xee0a('0x14')]?_0x1d7a8a[_0xee0a('0x14')][_0xee0a('0x16')]||null:null,'attributes':_0x1d7a8a['options']?_0x1d7a8a[_0xee0a('0x14')][_0xee0a('0x17')]||null:null,'limit':_0x1d7a8a[_0xee0a('0x14')]?_0x1d7a8a[_0xee0a('0x14')][_0xee0a('0x18')]||null:null,'include':_0x1d7a8a[_0xee0a('0x14')]?_0x1d7a8a[_0xee0a('0x14')]['include']?_[_0xee0a('0x19')](_0x1d7a8a[_0xee0a('0x14')][_0xee0a('0x1a')],function(_0x38d029){return{'model':db[_0x38d029['model']],'as':_0x38d029['as'],'attributes':_0x38d029[_0xee0a('0x17')],'include':_0x38d029[_0xee0a('0x1a')]?_[_0xee0a('0x19')](_0x38d029[_0xee0a('0x1a')],function(_0x4c61e2){return{'model':db[_0x4c61e2['model']],'as':_0x4c61e2['as'],'attributes':_0x4c61e2['attributes'],'include':_0x4c61e2[_0xee0a('0x1a')]?_['map'](_0x4c61e2['include'],function(_0x1c9ad8){return{'model':db[_0x1c9ad8[_0xee0a('0x1b')]],'as':_0x1c9ad8['as'],'attributes':_0x1c9ad8[_0xee0a('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c3d48){logger[_0xee0a('0x7')](_0xee0a('0x11'),_0x1d7a8a);logger[_0xee0a('0x9')](_0xee0a('0x11'),_0x1d7a8a,JSON[_0xee0a('0xb')](_0x3c3d48));_0x55c474(_0x3c3d48);})[_0xee0a('0x10')](function(_0x408909){logger[_0xee0a('0xc')](_0xee0a('0x11'),_0x408909['message'],_0x1d7a8a);_0x1c1be5(_0x14ef67[_0xee0a('0xc')](0x1f4,_0x408909[_0xee0a('0xe')]));});});};exports[_0xee0a('0x1c')]=function(_0x34569c){var _0x45feeb=this;return new Promise(function(_0x3faad3,_0x4cf1df){return db[_0xee0a('0x12')][_0xee0a('0x1d')]({'raw':_0x34569c[_0xee0a('0x14')]?_0x34569c[_0xee0a('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x34569c[_0xee0a('0x14')]?_0x34569c['options'][_0xee0a('0x16')]||null:null,'attributes':_0x34569c[_0xee0a('0x14')]?_0x34569c[_0xee0a('0x14')][_0xee0a('0x17')]||null:null,'include':_0x34569c[_0xee0a('0x14')]?_0x34569c[_0xee0a('0x14')][_0xee0a('0x1a')]?_[_0xee0a('0x19')](_0x34569c['options'][_0xee0a('0x1a')],function(_0x1d4578){return{'model':db[_0x1d4578['model']],'as':_0x1d4578['as'],'attributes':_0x1d4578[_0xee0a('0x17')],'include':_0x1d4578[_0xee0a('0x1a')]?_[_0xee0a('0x19')](_0x1d4578['include'],function(_0x131b60){return{'model':db[_0x131b60[_0xee0a('0x1b')]],'as':_0x131b60['as'],'attributes':_0x131b60[_0xee0a('0x17')],'include':_0x131b60['include']?_[_0xee0a('0x19')](_0x131b60[_0xee0a('0x1a')],function(_0x340dc8){return{'model':db[_0x340dc8['model']],'as':_0x340dc8['as'],'attributes':_0x340dc8['attributes']};}):[]};}):[]};}):[]:[]})[_0xee0a('0x1e')](function(_0x10e8a5){logger[_0xee0a('0x7')](_0xee0a('0x1c'),_0x34569c);logger[_0xee0a('0x9')](_0xee0a('0x1c'),_0x34569c,JSON[_0xee0a('0xb')](_0x10e8a5));_0x3faad3(_0x10e8a5);})[_0xee0a('0x10')](function(_0x22d505){logger['error'](_0xee0a('0x1c'),_0x22d505[_0xee0a('0xe')],_0x34569c);_0x4cf1df(_0x45feeb['error'](0x1f4,_0x22d505[_0xee0a('0xe')]));});});}; \ No newline at end of file +var _0x55c1=['GetDynamics365Account','ShowDynamics365Account','find','stringify','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','message','Dynamics365Account','findAll','options','raw','where','attributes','include','map','model','then','debug'];(function(_0x4809a8,_0x335c11){var _0x2745bf=function(_0xea22a7){while(--_0xea22a7){_0x4809a8['push'](_0x4809a8['shift']());}};_0x2745bf(++_0x335c11);}(_0x55c1,0x1e5));var _0x155c=function(_0x521a00,_0x3e3d24){_0x521a00=_0x521a00-0x0;var _0xc8130=_0x55c1[_0x521a00];return _0xc8130;};'use strict';var _=require(_0x155c('0x0'));var util=require(_0x155c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x155c('0x2'));var db=require(_0x155c('0x3'))['db'];var utils=require(_0x155c('0x4'));var logger=require(_0x155c('0x5'))(_0x155c('0x6'));var config=require('../../config/environment');var jayson=require(_0x155c('0x7'));var client=jayson[_0x155c('0x8')][_0x155c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4df902,_0x1cdd2f,_0x25b08a){return new BPromise(function(_0x22ed0d,_0x5f4274){return client['request'](_0x4df902,_0x25b08a)['then'](function(_0x330e12){logger[_0x155c('0xa')](_0x155c('0xb'),_0x1cdd2f,_0x155c('0xc'));logger['debug'](_0x155c('0xd'),_0x1cdd2f,_0x155c('0xc'),JSON['stringify'](_0x330e12));if(_0x330e12[_0x155c('0xe')]){if(_0x330e12[_0x155c('0xe')]['code']===0x1f4){logger[_0x155c('0xe')](_0x155c('0xb'),_0x1cdd2f,_0x330e12['error'][_0x155c('0xf')]);return _0x5f4274(_0x330e12[_0x155c('0xe')][_0x155c('0xf')]);}logger['error'](_0x155c('0xb'),_0x1cdd2f,_0x330e12[_0x155c('0xe')][_0x155c('0xf')]);return _0x22ed0d(_0x330e12[_0x155c('0xe')][_0x155c('0xf')]);}else{logger['info'](_0x155c('0xb'),_0x1cdd2f,_0x155c('0xc'));_0x22ed0d(_0x330e12['result'][_0x155c('0xf')]);}})['catch'](function(_0x4570e2){logger[_0x155c('0xe')](_0x155c('0xb'),_0x1cdd2f,_0x4570e2);_0x5f4274(_0x4570e2);});});}exports['GetDynamics365Account']=function(_0xe800de){var _0x13667b=this;return new Promise(function(_0x224a3d,_0x2f0099){return db[_0x155c('0x10')][_0x155c('0x11')]({'raw':_0xe800de[_0x155c('0x12')]?_0xe800de[_0x155c('0x12')][_0x155c('0x13')]===undefined?!![]:![]:!![],'where':_0xe800de[_0x155c('0x12')]?_0xe800de[_0x155c('0x12')][_0x155c('0x14')]||null:null,'attributes':_0xe800de[_0x155c('0x12')]?_0xe800de[_0x155c('0x12')][_0x155c('0x15')]||null:null,'limit':_0xe800de[_0x155c('0x12')]?_0xe800de[_0x155c('0x12')]['limit']||null:null,'include':_0xe800de[_0x155c('0x12')]?_0xe800de[_0x155c('0x12')][_0x155c('0x16')]?_[_0x155c('0x17')](_0xe800de[_0x155c('0x12')][_0x155c('0x16')],function(_0x4b6d0d){return{'model':db[_0x4b6d0d['model']],'as':_0x4b6d0d['as'],'attributes':_0x4b6d0d[_0x155c('0x15')],'include':_0x4b6d0d[_0x155c('0x16')]?_[_0x155c('0x17')](_0x4b6d0d[_0x155c('0x16')],function(_0x41e24d){return{'model':db[_0x41e24d[_0x155c('0x18')]],'as':_0x41e24d['as'],'attributes':_0x41e24d[_0x155c('0x15')],'include':_0x41e24d[_0x155c('0x16')]?_[_0x155c('0x17')](_0x41e24d[_0x155c('0x16')],function(_0x36be3d){return{'model':db[_0x36be3d[_0x155c('0x18')]],'as':_0x36be3d['as'],'attributes':_0x36be3d[_0x155c('0x15')]};}):[]};}):[]};}):[]:[]})[_0x155c('0x19')](function(_0x115143){logger[_0x155c('0xa')]('GetDynamics365Account',_0xe800de);logger[_0x155c('0x1a')]('GetDynamics365Account',_0xe800de,JSON['stringify'](_0x115143));_0x224a3d(_0x115143);})['catch'](function(_0x47c89d){logger[_0x155c('0xe')](_0x155c('0x1b'),_0x47c89d[_0x155c('0xf')],_0xe800de);_0x2f0099(_0x13667b['error'](0x1f4,_0x47c89d[_0x155c('0xf')]));});});};exports[_0x155c('0x1c')]=function(_0x32e5b8){var _0x595d47=this;return new Promise(function(_0x5a0ddf,_0x4ad8b4){return db[_0x155c('0x10')][_0x155c('0x1d')]({'raw':_0x32e5b8['options']?_0x32e5b8[_0x155c('0x12')][_0x155c('0x13')]===undefined?!![]:![]:!![],'where':_0x32e5b8[_0x155c('0x12')]?_0x32e5b8['options'][_0x155c('0x14')]||null:null,'attributes':_0x32e5b8['options']?_0x32e5b8[_0x155c('0x12')][_0x155c('0x15')]||null:null,'include':_0x32e5b8['options']?_0x32e5b8[_0x155c('0x12')][_0x155c('0x16')]?_['map'](_0x32e5b8[_0x155c('0x12')][_0x155c('0x16')],function(_0x5b3624){return{'model':db[_0x5b3624[_0x155c('0x18')]],'as':_0x5b3624['as'],'attributes':_0x5b3624[_0x155c('0x15')],'include':_0x5b3624[_0x155c('0x16')]?_[_0x155c('0x17')](_0x5b3624[_0x155c('0x16')],function(_0x2dc388){return{'model':db[_0x2dc388[_0x155c('0x18')]],'as':_0x2dc388['as'],'attributes':_0x2dc388[_0x155c('0x15')],'include':_0x2dc388[_0x155c('0x16')]?_[_0x155c('0x17')](_0x2dc388[_0x155c('0x16')],function(_0x4914dc){return{'model':db[_0x4914dc[_0x155c('0x18')]],'as':_0x4914dc['as'],'attributes':_0x4914dc[_0x155c('0x15')]};}):[]};}):[]};}):[]:[]})[_0x155c('0x19')](function(_0x5a25e4){logger[_0x155c('0xa')](_0x155c('0x1c'),_0x32e5b8);logger['debug']('ShowDynamics365Account',_0x32e5b8,JSON[_0x155c('0x1e')](_0x5a25e4));_0x5a0ddf(_0x5a25e4);})[_0x155c('0x1f')](function(_0x18f952){logger['error'](_0x155c('0x1c'),_0x18f952[_0x155c('0xf')],_0x32e5b8);_0x4ad8b4(_0x595d47[_0x155c('0xe')](0x1f4,_0x18f952['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index dd2d438..ef43129 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 _0x5520=['destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','index','get','/:id','isAuthenticated','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','update','delete'];(function(_0x1034bb,_0x4e20b3){var _0x453fdb=function(_0x455356){while(--_0x455356){_0x1034bb['push'](_0x1034bb['shift']());}};_0x453fdb(++_0x4e20b3);}(_0x5520,0x12d));var _0x0552=function(_0x5af673,_0x4b6254){_0x5af673=_0x5af673-0x0;var _0x42f51b=_0x5520[_0x5af673];return _0x42f51b;};'use strict';var multer=require(_0x0552('0x0'));var util=require(_0x0552('0x1'));var path=require(_0x0552('0x2'));var timeout=require(_0x0552('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x0552('0x4'));var interaction=require(_0x0552('0x5'));var config=require(_0x0552('0x6'));var controller=require(_0x0552('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x0552('0x8')]);router[_0x0552('0x9')](_0x0552('0xa'),auth[_0x0552('0xb')](),controller[_0x0552('0xc')]);router[_0x0552('0x9')](_0x0552('0xd'),auth[_0x0552('0xb')](),controller[_0x0552('0xe')]);router[_0x0552('0x9')]('/:id/subjects',auth[_0x0552('0xb')](),controller[_0x0552('0xf')]);router['get'](_0x0552('0x10'),auth['isAuthenticated'](),controller[_0x0552('0x11')]);router[_0x0552('0x12')]('/',auth[_0x0552('0xb')](),controller['create']);router['put']('/:id',auth[_0x0552('0xb')](),controller[_0x0552('0x13')]);router[_0x0552('0x14')]('/:id',auth[_0x0552('0xb')](),controller[_0x0552('0x15')]);module[_0x0552('0x16')]=router; \ No newline at end of file +var _0xf094=['isAuthenticated','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','/:id','update','multer','util','express','Router','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller'];(function(_0x40aa66,_0x2c7679){var _0x593df7=function(_0x1733d8){while(--_0x1733d8){_0x40aa66['push'](_0x40aa66['shift']());}};_0x593df7(++_0x2c7679);}(_0xf094,0x188));var _0x4f09=function(_0x2e2eab,_0x2e609a){_0x2e2eab=_0x2e2eab-0x0;var _0x2357bc=_0xf094[_0x2e2eab];return _0x2357bc;};'use strict';var multer=require(_0x4f09('0x0'));var util=require(_0x4f09('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4f09('0x2'));var router=express[_0x4f09('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x4f09('0x4'));var config=require(_0x4f09('0x5'));var controller=require(_0x4f09('0x6'));router['get']('/',auth[_0x4f09('0x7')](),controller['index']);router[_0x4f09('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x4f09('0x9')]);router[_0x4f09('0x8')](_0x4f09('0xa'),auth[_0x4f09('0x7')](),controller[_0x4f09('0xb')]);router['get'](_0x4f09('0xc'),auth[_0x4f09('0x7')](),controller[_0x4f09('0xd')]);router[_0x4f09('0x8')](_0x4f09('0xe'),auth[_0x4f09('0x7')](),controller['getDescriptions']);router['post']('/',auth[_0x4f09('0x7')](),controller[_0x4f09('0xf')]);router[_0x4f09('0x10')](_0x4f09('0x11'),auth[_0x4f09('0x7')](),controller[_0x4f09('0x12')]);router['delete'](_0x4f09('0x11'),auth[_0x4f09('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 55b53f6..50875ba 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 _0xea33=['STRING','ENUM','incident','sequelize','exports'];(function(_0x5d19f8,_0x56a7bb){var _0x42e896=function(_0x15d7c6){while(--_0x15d7c6){_0x5d19f8['push'](_0x5d19f8['shift']());}};_0x42e896(++_0x56a7bb);}(_0xea33,0x116));var _0x3ea3=function(_0x22b39b,_0x2b7d63){_0x22b39b=_0x22b39b-0x0;var _0x280e1d=_0xea33[_0x22b39b];return _0x280e1d;};'use strict';var Sequelize=require(_0x3ea3('0x0'));module[_0x3ea3('0x1')]={'name':{'type':Sequelize[_0x3ea3('0x2')]},'description':{'type':Sequelize[_0x3ea3('0x2')]},'ticketType':{'type':Sequelize[_0x3ea3('0x3')](_0x3ea3('0x4'),'phonecall'),'defaultValue':_0x3ea3('0x4')}}; \ No newline at end of file +var _0x9d5d=['sequelize','exports','STRING','ENUM','incident','phonecall'];(function(_0x10aaaa,_0x3d20f7){var _0x4f5319=function(_0x11aef8){while(--_0x11aef8){_0x10aaaa['push'](_0x10aaaa['shift']());}};_0x4f5319(++_0x3d20f7);}(_0x9d5d,0x192));var _0xd9d5=function(_0x23bc40,_0x2dcdab){_0x23bc40=_0x23bc40-0x0;var _0x5e452a=_0x9d5d[_0x23bc40];return _0x5e452a;};'use strict';var Sequelize=require(_0xd9d5('0x0'));module[_0xd9d5('0x1')]={'name':{'type':Sequelize[_0xd9d5('0x2')]},'description':{'type':Sequelize[_0xd9d5('0x2')]},'ticketType':{'type':Sequelize[_0xd9d5('0x3')](_0xd9d5('0x4'),_0xd9d5('0x5')),'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 90b95f5..4208d9e 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 _0x931b=['jayson/promise','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','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','sendStatus','status','end','json','count','offset','Content-Range','apply','save','update','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','Dynamics365Configuration','includeAll','include','findAll','rows','show','params','find','catch','create','body','destroy','getFields','findOne','Dynamics365Field','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x45da5d,_0x578539){var _0x449b5c=function(_0x44a207){while(--_0x44a207){_0x45da5d['push'](_0x45da5d['shift']());}};_0x449b5c(++_0x578539);}(_0x931b,0x107));var _0xb931=function(_0x272c4,_0x466c6f){_0x272c4=_0x272c4-0x0;var _0x510051=_0x931b[_0x272c4];return _0x510051;};'use strict';var pdf=require(_0xb931('0x0'));var emlformat=require(_0xb931('0x1'));var rimraf=require(_0xb931('0x2'));var zipdir=require(_0xb931('0x3'));var jsonpatch=require(_0xb931('0x4'));var rp=require(_0xb931('0x5'));var moment=require(_0xb931('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xb931('0x7'));var util=require(_0xb931('0x8'));var path=require(_0xb931('0x9'));var sox=require(_0xb931('0xa'));var csv=require('to-csv');var ejs=require(_0xb931('0xb'));var fs=require('fs');var _=require(_0xb931('0xc'));var squel=require(_0xb931('0xd'));var crypto=require(_0xb931('0xe'));var jsforce=require(_0xb931('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb931('0x10'));var querystring=require(_0xb931('0x11'));var Papa=require(_0xb931('0x12'));var Redis=require(_0xb931('0x13'));var authService=require(_0xb931('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xb931('0x15'));var hardwareService=require(_0xb931('0x16'));var logger=require(_0xb931('0x17'))(_0xb931('0x18'));var utils=require(_0xb931('0x19'));var config=require(_0xb931('0x1a'));var db=require(_0xb931('0x1b'))['db'];var jayson=require(_0xb931('0x1c'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x10d8a2,_0x544f3c,_0x217af0){if(_0x217af0){var _0x4a1105=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4a1105['test'](_0x544f3c)){return _0x10d8a2;}else{throw new db[(_0xb931('0x1d'))][(_0xb931('0x1e'))](_0xb931('0x1f'));}}else{return _0x10d8a2;}}function respondWithRpcPromise(_0x13e7ae,_0x5a6f1c,_0x1808e3,_0x10e5c1){return new BPromise(function(_0x5619fe,_0x5721ed){var _0x15a903=_0x10e5c1||client;return _0x15a903[_0xb931('0x20')](_0x13e7ae,_0x1808e3)[_0xb931('0x21')](function(_0x10a419){logger['info'](_0xb931('0x22'),_0x5a6f1c,_0xb931('0x23'));logger[_0xb931('0x24')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x5a6f1c,'request\x20sent',JSON[_0xb931('0x25')](_0x10a419));if(_0x10a419['error']){if(_0x10a419[_0xb931('0x26')][_0xb931('0x27')]===0x1f4){logger[_0xb931('0x26')](_0xb931('0x22'),_0x5a6f1c,_0x10a419[_0xb931('0x26')][_0xb931('0x28')]);return _0x5721ed(_0x10a419[_0xb931('0x26')][_0xb931('0x28')]);}logger[_0xb931('0x26')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5a6f1c,_0x10a419[_0xb931('0x26')][_0xb931('0x28')]);return _0x5619fe(_0x10a419[_0xb931('0x26')]['message']);}else{logger[_0xb931('0x29')](_0xb931('0x22'),_0x5a6f1c,_0xb931('0x23'));_0x5619fe(_0x10a419[_0xb931('0x2a')]['message']);}})['catch'](function(_0x587446){logger[_0xb931('0x26')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5a6f1c,_0x587446);_0x5721ed(_0x587446);});});}function respondWithStatusCode(_0x35b92f,_0x2ced80){_0x2ced80=_0x2ced80||0xcc;return function(_0x3026a7){if(_0x3026a7){return _0x35b92f[_0xb931('0x2b')](_0x2ced80);}return _0x35b92f[_0xb931('0x2c')](_0x2ced80)[_0xb931('0x2d')]();};}function respondWithResult(_0x5dc1ff,_0x50a738){_0x50a738=_0x50a738||0xc8;return function(_0x47c7b3){if(_0x47c7b3){return _0x5dc1ff[_0xb931('0x2c')](_0x50a738)[_0xb931('0x2e')](_0x47c7b3);}};}function respondWithFilteredResult(_0x57f223,_0x549403){return function(_0x237353){if(_0x237353){var _0x327afb=_0x237353[_0xb931('0x2f')],_0x3eb794=_0x549403[_0xb931('0x30')],_0x22312c=_0x549403['offset']+_0x549403['limit'],_0x1fd41f;if(_0x22312c>=_0x327afb){_0x22312c=_0x327afb;_0x1fd41f=0xc8;}else{_0x1fd41f=0xce;}_0x57f223['status'](_0x1fd41f);return _0x57f223['set'](_0xb931('0x31'),_0x3eb794+'-'+_0x22312c+'/'+_0x327afb)['json'](_0x237353);}return null;};}function patchUpdates(_0x4304d0){return function(_0x401a5f){try{jsonpatch[_0xb931('0x32')](_0x401a5f,_0x4304d0,!![]);}catch(_0x2cb172){return BPromise['reject'](_0x2cb172);}return _0x401a5f[_0xb931('0x33')]();};}function saveUpdates(_0x2853b5,_0x446452){return function(_0x371cf6){if(_0x371cf6){return _0x371cf6[_0xb931('0x34')](_0x2853b5)[_0xb931('0x21')](function(_0x5c1a1f){return _0x5c1a1f;});}return null;};}function removeEntity(_0x4daede,_0x54f599){return function(_0x1df800){if(_0x1df800){return _0x1df800['destroy']()[_0xb931('0x21')](function(){_0x4daede[_0xb931('0x2c')](0xcc)[_0xb931('0x2d')]();});}};}function handleEntityNotFound(_0x2ec9eb,_0x400af1){return function(_0x4a47cb){if(!_0x4a47cb){_0x2ec9eb[_0xb931('0x2b')](0x194);}return _0x4a47cb;};}function handleError(_0x23c15a,_0x52a3f3){_0x52a3f3=_0x52a3f3||0x1f4;return function(_0x36b349){logger[_0xb931('0x26')](_0x36b349[_0xb931('0x35')]);if(_0x36b349[_0xb931('0x36')]){delete _0x36b349['name'];}_0x23c15a['status'](_0x52a3f3)['send'](_0x36b349);};}exports[_0xb931('0x37')]=function(_0x1bfff7,_0x3a5519){var _0x5c6cc5={},_0x17ea90={},_0x199eb1={'count':0x0,'rows':[]};var _0x5ccb27=_['map'](db['Dynamics365Configuration'][_0xb931('0x38')],function(_0x46e122){return{'name':_0x46e122[_0xb931('0x39')],'type':_0x46e122[_0xb931('0x3a')][_0xb931('0x3b')]};});_0x17ea90[_0xb931('0x3c')]=_[_0xb931('0x3d')](_0x5ccb27,_0xb931('0x36'));_0x17ea90[_0xb931('0x3e')]=_[_0xb931('0x3f')](_0x1bfff7[_0xb931('0x3e')]);_0x17ea90[_0xb931('0x40')]=_[_0xb931('0x41')](_0x17ea90['model'],_0x17ea90[_0xb931('0x3e')]);_0x5c6cc5[_0xb931('0x42')]=_[_0xb931('0x41')](_0x17ea90[_0xb931('0x3c')],qs[_0xb931('0x43')](_0x1bfff7[_0xb931('0x3e')][_0xb931('0x43')]));_0x5c6cc5[_0xb931('0x42')]=_0x5c6cc5[_0xb931('0x42')][_0xb931('0x44')]?_0x5c6cc5[_0xb931('0x42')]:_0x17ea90['model'];if(!_0x1bfff7[_0xb931('0x3e')]['hasOwnProperty'](_0xb931('0x45'))){_0x5c6cc5[_0xb931('0x46')]=qs[_0xb931('0x46')](_0x1bfff7[_0xb931('0x3e')]['limit']);_0x5c6cc5[_0xb931('0x30')]=qs[_0xb931('0x30')](_0x1bfff7[_0xb931('0x3e')]['offset']);}_0x5c6cc5[_0xb931('0x47')]=qs[_0xb931('0x48')](_0x1bfff7[_0xb931('0x3e')][_0xb931('0x48')]);_0x5c6cc5[_0xb931('0x49')]=qs[_0xb931('0x40')](_[_0xb931('0x4a')](_0x1bfff7[_0xb931('0x3e')],_0x17ea90[_0xb931('0x40')]));if(_0x1bfff7[_0xb931('0x3e')][_0xb931('0x4b')]){_0x5c6cc5['where']=_[_0xb931('0x4c')](_0x5c6cc5[_0xb931('0x49')],{'$or':_[_0xb931('0x3d')](_0x5ccb27,function(_0x45b55d){if(_0x45b55d[_0xb931('0x3a')]!==_0xb931('0x4d')){var _0x28a6f0={};_0x28a6f0[_0x45b55d['name']]={'$like':'%'+_0x1bfff7[_0xb931('0x3e')][_0xb931('0x4b')]+'%'};return _0x28a6f0;}})});}_0x5c6cc5=_[_0xb931('0x4c')]({},_0x5c6cc5,_0x1bfff7[_0xb931('0x4e')]);var _0x45527d={'where':_0x5c6cc5['where']};return db[_0xb931('0x4f')][_0xb931('0x2f')](_0x45527d)[_0xb931('0x21')](function(_0x1cba2e){_0x199eb1['count']=_0x1cba2e;if(_0x1bfff7[_0xb931('0x3e')][_0xb931('0x50')]){_0x5c6cc5[_0xb931('0x51')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xb931('0x52')](_0x5c6cc5);})[_0xb931('0x21')](function(_0x4ecdba){_0x199eb1[_0xb931('0x53')]=_0x4ecdba;return _0x199eb1;})['then'](respondWithFilteredResult(_0x3a5519,_0x5c6cc5))['catch'](handleError(_0x3a5519,null));};exports[_0xb931('0x54')]=function(_0x3453d9,_0x1bb4e3){var _0x2f8470={'raw':![],'where':{'id':_0x3453d9[_0xb931('0x55')]['id']}},_0x566a4f={};_0x566a4f['model']=_[_0xb931('0x3f')](db[_0xb931('0x4f')][_0xb931('0x38')]);_0x566a4f['query']=_['keys'](_0x3453d9[_0xb931('0x3e')]);_0x566a4f[_0xb931('0x40')]=_[_0xb931('0x41')](_0x566a4f[_0xb931('0x3c')],_0x566a4f[_0xb931('0x3e')]);_0x2f8470[_0xb931('0x42')]=_[_0xb931('0x41')](_0x566a4f['model'],qs['fields'](_0x3453d9[_0xb931('0x3e')][_0xb931('0x43')]));_0x2f8470[_0xb931('0x42')]=_0x2f8470['attributes'][_0xb931('0x44')]?_0x2f8470['attributes']:_0x566a4f['model'];if(_0x3453d9['query']['includeAll']){_0x2f8470[_0xb931('0x51')]=[{'all':!![]}];}_0x2f8470=_[_0xb931('0x4c')]({},_0x2f8470,_0x3453d9['options']);return db[_0xb931('0x4f')][_0xb931('0x56')](_0x2f8470)['then'](handleEntityNotFound(_0x1bb4e3,null))[_0xb931('0x21')](respondWithResult(_0x1bb4e3,null))[_0xb931('0x57')](handleError(_0x1bb4e3,null));};exports[_0xb931('0x58')]=function(_0x125645,_0x28bb7d){return db['Dynamics365Configuration'][_0xb931('0x58')](_0x125645[_0xb931('0x59')],{})['then'](respondWithResult(_0x28bb7d,0xc9))[_0xb931('0x57')](handleError(_0x28bb7d,null));};exports[_0xb931('0x34')]=function(_0x11500f,_0x44867c){if(_0x11500f['body']['id']){delete _0x11500f[_0xb931('0x59')]['id'];}return db[_0xb931('0x4f')][_0xb931('0x56')]({'where':{'id':_0x11500f[_0xb931('0x55')]['id']}})['then'](handleEntityNotFound(_0x44867c,null))[_0xb931('0x21')](saveUpdates(_0x11500f[_0xb931('0x59')],null))[_0xb931('0x21')](respondWithResult(_0x44867c,null))[_0xb931('0x57')](handleError(_0x44867c,null));};exports[_0xb931('0x5a')]=function(_0x3ef873,_0x44d7d3){return db[_0xb931('0x4f')]['find']({'where':{'id':_0x3ef873[_0xb931('0x55')]['id']}})[_0xb931('0x21')](handleEntityNotFound(_0x44d7d3,null))[_0xb931('0x21')](removeEntity(_0x44d7d3,null))[_0xb931('0x57')](handleError(_0x44d7d3,null));};exports[_0xb931('0x5b')]=function(_0x202d6f,_0x4a433d,_0x1156ce){var _0x9c7db7={};var _0x9d867b={};var _0x142aa8;var _0x20999d;return db[_0xb931('0x4f')][_0xb931('0x5c')]({'where':{'id':_0x202d6f['params']['id']}})[_0xb931('0x21')](handleEntityNotFound(_0x4a433d,null))[_0xb931('0x21')](function(_0x34f4d9){if(_0x34f4d9){_0x142aa8=_0x34f4d9;_0x9d867b[_0xb931('0x3c')]=_['keys'](db[_0xb931('0x5d')][_0xb931('0x38')]);_0x9d867b[_0xb931('0x3e')]=_[_0xb931('0x3f')](_0x202d6f[_0xb931('0x3e')]);_0x9d867b[_0xb931('0x40')]=_['intersection'](_0x9d867b[_0xb931('0x3c')],_0x9d867b[_0xb931('0x3e')]);_0x9c7db7[_0xb931('0x42')]=_[_0xb931('0x41')](_0x9d867b[_0xb931('0x3c')],qs[_0xb931('0x43')](_0x202d6f['query']['fields']));_0x9c7db7[_0xb931('0x42')]=_0x9c7db7[_0xb931('0x42')]['length']?_0x9c7db7[_0xb931('0x42')]:_0x9d867b[_0xb931('0x3c')];_0x9c7db7[_0xb931('0x47')]=qs[_0xb931('0x48')](_0x202d6f[_0xb931('0x3e')][_0xb931('0x48')]);_0x9c7db7[_0xb931('0x49')]=qs[_0xb931('0x40')](_[_0xb931('0x4a')](_0x202d6f['query'],_0x9d867b['filters']));if(_0x202d6f[_0xb931('0x3e')][_0xb931('0x4b')]){_0x9c7db7[_0xb931('0x49')]=_[_0xb931('0x4c')](_0x9c7db7[_0xb931('0x49')],{'$or':_[_0xb931('0x3d')](_0x9c7db7[_0xb931('0x42')],function(_0x11b16d){var _0x222521={};_0x222521[_0x11b16d]={'$like':'%'+_0x202d6f[_0xb931('0x3e')]['filter']+'%'};return _0x222521;})});}_0x9c7db7=_[_0xb931('0x4c')]({},_0x9c7db7,_0x202d6f[_0xb931('0x4e')]);return _0x142aa8[_0xb931('0x5b')](_0x9c7db7);}})[_0xb931('0x21')](function(_0x36042b){if(_0x36042b){_0x20999d=_0x36042b[_0xb931('0x44')];if(!_0x202d6f[_0xb931('0x3e')][_0xb931('0x5e')](_0xb931('0x45'))){_0x9c7db7[_0xb931('0x46')]=qs[_0xb931('0x46')](_0x202d6f['query'][_0xb931('0x46')]);_0x9c7db7[_0xb931('0x30')]=qs['offset'](_0x202d6f[_0xb931('0x3e')][_0xb931('0x30')]);}return _0x142aa8[_0xb931('0x5b')](_0x9c7db7);}})[_0xb931('0x21')](function(_0x231d8a){if(_0x231d8a){return _0x231d8a?{'count':_0x20999d,'rows':_0x231d8a}:null;}})['then'](respondWithResult(_0x4a433d,null))[_0xb931('0x57')](handleError(_0x4a433d,null));};exports[_0xb931('0x5f')]=function(_0x5c4a42,_0x2d7d4a,_0x503889){var _0x29918b={};var _0xfd37de={};var _0x2cf9ea;var _0x9f9d37;return db[_0xb931('0x4f')][_0xb931('0x5c')]({'where':{'id':_0x5c4a42[_0xb931('0x55')]['id']}})['then'](handleEntityNotFound(_0x2d7d4a,null))[_0xb931('0x21')](function(_0xa0d05f){if(_0xa0d05f){_0x2cf9ea=_0xa0d05f;_0xfd37de[_0xb931('0x3c')]=_[_0xb931('0x3f')](db[_0xb931('0x5d')][_0xb931('0x38')]);_0xfd37de[_0xb931('0x3e')]=_[_0xb931('0x3f')](_0x5c4a42[_0xb931('0x3e')]);_0xfd37de[_0xb931('0x40')]=_[_0xb931('0x41')](_0xfd37de['model'],_0xfd37de[_0xb931('0x3e')]);_0x29918b[_0xb931('0x42')]=_[_0xb931('0x41')](_0xfd37de[_0xb931('0x3c')],qs[_0xb931('0x43')](_0x5c4a42[_0xb931('0x3e')][_0xb931('0x43')]));_0x29918b[_0xb931('0x42')]=_0x29918b[_0xb931('0x42')][_0xb931('0x44')]?_0x29918b[_0xb931('0x42')]:_0xfd37de[_0xb931('0x3c')];_0x29918b['order']=qs['sort'](_0x5c4a42[_0xb931('0x3e')][_0xb931('0x48')]);_0x29918b['where']=qs[_0xb931('0x40')](_[_0xb931('0x4a')](_0x5c4a42[_0xb931('0x3e')],_0xfd37de[_0xb931('0x40')]));if(_0x5c4a42[_0xb931('0x3e')]['filter']){_0x29918b['where']=_[_0xb931('0x4c')](_0x29918b[_0xb931('0x49')],{'$or':_['map'](_0x29918b['attributes'],function(_0x5711e4){var _0x34a54d={};_0x34a54d[_0x5711e4]={'$like':'%'+_0x5c4a42[_0xb931('0x3e')][_0xb931('0x4b')]+'%'};return _0x34a54d;})});}_0x29918b=_[_0xb931('0x4c')]({},_0x29918b,_0x5c4a42[_0xb931('0x4e')]);return _0x2cf9ea[_0xb931('0x5f')](_0x29918b);}})[_0xb931('0x21')](function(_0x288c97){if(_0x288c97){_0x9f9d37=_0x288c97[_0xb931('0x44')];if(!_0x5c4a42['query'][_0xb931('0x5e')](_0xb931('0x45'))){_0x29918b[_0xb931('0x46')]=qs['limit'](_0x5c4a42[_0xb931('0x3e')][_0xb931('0x46')]);_0x29918b[_0xb931('0x30')]=qs[_0xb931('0x30')](_0x5c4a42[_0xb931('0x3e')][_0xb931('0x30')]);}return _0x2cf9ea['getSubjects'](_0x29918b);}})[_0xb931('0x21')](function(_0x57d3eb){if(_0x57d3eb){return _0x57d3eb?{'count':_0x9f9d37,'rows':_0x57d3eb}:null;}})[_0xb931('0x21')](respondWithResult(_0x2d7d4a,null))[_0xb931('0x57')](handleError(_0x2d7d4a,null));};exports[_0xb931('0x60')]=function(_0xb534c8,_0x45dbd3,_0x37943e){var _0x1739fb={};var _0x1622f0={};var _0x3ea8cc;var _0xfd37af;return db[_0xb931('0x4f')][_0xb931('0x5c')]({'where':{'id':_0xb534c8[_0xb931('0x55')]['id']}})[_0xb931('0x21')](handleEntityNotFound(_0x45dbd3,null))[_0xb931('0x21')](function(_0x2a351c){if(_0x2a351c){_0x3ea8cc=_0x2a351c;_0x1622f0[_0xb931('0x3c')]=_[_0xb931('0x3f')](db['Dynamics365Field']['rawAttributes']);_0x1622f0[_0xb931('0x3e')]=_['keys'](_0xb534c8[_0xb931('0x3e')]);_0x1622f0['filters']=_[_0xb931('0x41')](_0x1622f0['model'],_0x1622f0[_0xb931('0x3e')]);_0x1739fb[_0xb931('0x42')]=_[_0xb931('0x41')](_0x1622f0[_0xb931('0x3c')],qs[_0xb931('0x43')](_0xb534c8[_0xb931('0x3e')]['fields']));_0x1739fb[_0xb931('0x42')]=_0x1739fb[_0xb931('0x42')]['length']?_0x1739fb[_0xb931('0x42')]:_0x1622f0[_0xb931('0x3c')];_0x1739fb['order']=qs[_0xb931('0x48')](_0xb534c8[_0xb931('0x3e')]['sort']);_0x1739fb['where']=qs[_0xb931('0x40')](_[_0xb931('0x4a')](_0xb534c8[_0xb931('0x3e')],_0x1622f0[_0xb931('0x40')]));if(_0xb534c8['query']['filter']){_0x1739fb[_0xb931('0x49')]=_['merge'](_0x1739fb[_0xb931('0x49')],{'$or':_[_0xb931('0x3d')](_0x1739fb[_0xb931('0x42')],function(_0x3a576d){var _0x16a44a={};_0x16a44a[_0x3a576d]={'$like':'%'+_0xb534c8['query'][_0xb931('0x4b')]+'%'};return _0x16a44a;})});}_0x1739fb=_[_0xb931('0x4c')]({},_0x1739fb,_0xb534c8['options']);return _0x3ea8cc['getDescriptions'](_0x1739fb);}})[_0xb931('0x21')](function(_0x189bd4){if(_0x189bd4){_0xfd37af=_0x189bd4[_0xb931('0x44')];if(!_0xb534c8[_0xb931('0x3e')][_0xb931('0x5e')]('nolimit')){_0x1739fb[_0xb931('0x46')]=qs[_0xb931('0x46')](_0xb534c8[_0xb931('0x3e')][_0xb931('0x46')]);_0x1739fb[_0xb931('0x30')]=qs[_0xb931('0x30')](_0xb534c8['query'][_0xb931('0x30')]);}return _0x3ea8cc[_0xb931('0x60')](_0x1739fb);}})[_0xb931('0x21')](function(_0x27ca8a){if(_0x27ca8a){return _0x27ca8a?{'count':_0xfd37af,'rows':_0x27ca8a}:null;}})[_0xb931('0x21')](respondWithResult(_0x45dbd3,null))[_0xb931('0x57')](handleError(_0x45dbd3,null));}; \ No newline at end of file +var _0x2e99=['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','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','body','destroy','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','Sequelize','ValidationError'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x2e99,0x158));var _0x92e9=function(_0x48190a,_0x2a2619){_0x48190a=_0x48190a-0x0;var _0x421206=_0x2e99[_0x48190a];return _0x421206;};'use strict';var pdf=require(_0x92e9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x92e9('0x1'));var zipdir=require(_0x92e9('0x2'));var jsonpatch=require(_0x92e9('0x3'));var rp=require('request-promise');var moment=require(_0x92e9('0x4'));var BPromise=require(_0x92e9('0x5'));var Mustache=require('mustache');var util=require(_0x92e9('0x6'));var path=require('path');var sox=require(_0x92e9('0x7'));var csv=require(_0x92e9('0x8'));var ejs=require(_0x92e9('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x92e9('0xa'));var crypto=require(_0x92e9('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x92e9('0xc'));var Redis=require('ioredis');var authService=require(_0x92e9('0xd'));var qs=require(_0x92e9('0xe'));var as=require(_0x92e9('0xf'));var hardwareService=require(_0x92e9('0x10'));var logger=require(_0x92e9('0x11'))('api');var utils=require(_0x92e9('0x12'));var config=require(_0x92e9('0x13'));var db=require(_0x92e9('0x14'))['db'];var jayson=require(_0x92e9('0x15'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x3feff5,_0x1f7a4d,_0x22e8ef){if(_0x22e8ef){var _0x2e4c95=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2e4c95['test'](_0x1f7a4d)){return _0x3feff5;}else{throw new db[(_0x92e9('0x16'))][(_0x92e9('0x17'))](_0x92e9('0x18'));}}else{return _0x3feff5;}}function respondWithRpcPromise(_0x5c5338,_0x2a4539,_0x1985fa,_0x338f4f){return new BPromise(function(_0x421123,_0x5b2bc3){var _0x557dd2=_0x338f4f||client;return _0x557dd2[_0x92e9('0x19')](_0x5c5338,_0x1985fa)[_0x92e9('0x1a')](function(_0x330644){logger[_0x92e9('0x1b')](_0x92e9('0x1c'),_0x2a4539,_0x92e9('0x1d'));logger[_0x92e9('0x1e')](_0x92e9('0x1f'),_0x2a4539,_0x92e9('0x1d'),JSON[_0x92e9('0x20')](_0x330644));if(_0x330644[_0x92e9('0x21')]){if(_0x330644[_0x92e9('0x21')][_0x92e9('0x22')]===0x1f4){logger['error'](_0x92e9('0x1c'),_0x2a4539,_0x330644[_0x92e9('0x21')][_0x92e9('0x23')]);return _0x5b2bc3(_0x330644[_0x92e9('0x21')]['message']);}logger[_0x92e9('0x21')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2a4539,_0x330644['error'][_0x92e9('0x23')]);return _0x421123(_0x330644['error'][_0x92e9('0x23')]);}else{logger[_0x92e9('0x1b')](_0x92e9('0x1c'),_0x2a4539,_0x92e9('0x1d'));_0x421123(_0x330644['result'][_0x92e9('0x23')]);}})[_0x92e9('0x24')](function(_0x171d24){logger['error'](_0x92e9('0x1c'),_0x2a4539,_0x171d24);_0x5b2bc3(_0x171d24);});});}function respondWithStatusCode(_0x5aa963,_0x2e8a8f){_0x2e8a8f=_0x2e8a8f||0xcc;return function(_0xb6138a){if(_0xb6138a){return _0x5aa963[_0x92e9('0x25')](_0x2e8a8f);}return _0x5aa963[_0x92e9('0x26')](_0x2e8a8f)[_0x92e9('0x27')]();};}function respondWithResult(_0x2edd02,_0x3b11ee){_0x3b11ee=_0x3b11ee||0xc8;return function(_0x8b5b62){if(_0x8b5b62){return _0x2edd02[_0x92e9('0x26')](_0x3b11ee)[_0x92e9('0x28')](_0x8b5b62);}};}function respondWithFilteredResult(_0x331b47,_0x2f0c14){return function(_0x57e644){if(_0x57e644){var _0x4e1845=_0x57e644[_0x92e9('0x29')],_0x59703d=_0x2f0c14[_0x92e9('0x2a')],_0x1c0dc2=_0x2f0c14[_0x92e9('0x2a')]+_0x2f0c14[_0x92e9('0x2b')],_0x529445;if(_0x1c0dc2>=_0x4e1845){_0x1c0dc2=_0x4e1845;_0x529445=0xc8;}else{_0x529445=0xce;}_0x331b47[_0x92e9('0x26')](_0x529445);return _0x331b47[_0x92e9('0x2c')](_0x92e9('0x2d'),_0x59703d+'-'+_0x1c0dc2+'/'+_0x4e1845)[_0x92e9('0x28')](_0x57e644);}return null;};}function patchUpdates(_0x9e82f){return function(_0x3662db){try{jsonpatch[_0x92e9('0x2e')](_0x3662db,_0x9e82f,!![]);}catch(_0x5c8412){return BPromise[_0x92e9('0x2f')](_0x5c8412);}return _0x3662db[_0x92e9('0x30')]();};}function saveUpdates(_0x55d04e,_0x2a068a){return function(_0x2b4dab){if(_0x2b4dab){return _0x2b4dab[_0x92e9('0x31')](_0x55d04e)[_0x92e9('0x1a')](function(_0x2b74b8){return _0x2b74b8;});}return null;};}function removeEntity(_0x2a3a68,_0x58dc08){return function(_0x58dbfe){if(_0x58dbfe){return _0x58dbfe['destroy']()['then'](function(){_0x2a3a68[_0x92e9('0x26')](0xcc)[_0x92e9('0x27')]();});}};}function handleEntityNotFound(_0x812262,_0x5bd0f4){return function(_0x1b0f04){if(!_0x1b0f04){_0x812262[_0x92e9('0x25')](0x194);}return _0x1b0f04;};}function handleError(_0x4d0146,_0x5896f8){_0x5896f8=_0x5896f8||0x1f4;return function(_0x5a9ea3){logger[_0x92e9('0x21')](_0x5a9ea3[_0x92e9('0x32')]);if(_0x5a9ea3[_0x92e9('0x33')]){delete _0x5a9ea3['name'];}_0x4d0146[_0x92e9('0x26')](_0x5896f8)[_0x92e9('0x34')](_0x5a9ea3);};}exports[_0x92e9('0x35')]=function(_0x5444cb,_0x2eb0f9){var _0x24ee66={},_0x298a1d={},_0x5adfcb={'count':0x0,'rows':[]};var _0x65d40a=_[_0x92e9('0x36')](db[_0x92e9('0x37')][_0x92e9('0x38')],function(_0x56ff7b){return{'name':_0x56ff7b[_0x92e9('0x39')],'type':_0x56ff7b[_0x92e9('0x3a')][_0x92e9('0x3b')]};});_0x298a1d['model']=_[_0x92e9('0x36')](_0x65d40a,_0x92e9('0x33'));_0x298a1d[_0x92e9('0x3c')]=_[_0x92e9('0x3d')](_0x5444cb['query']);_0x298a1d[_0x92e9('0x3e')]=_[_0x92e9('0x3f')](_0x298a1d[_0x92e9('0x40')],_0x298a1d[_0x92e9('0x3c')]);_0x24ee66[_0x92e9('0x41')]=_[_0x92e9('0x3f')](_0x298a1d['model'],qs[_0x92e9('0x42')](_0x5444cb[_0x92e9('0x3c')][_0x92e9('0x42')]));_0x24ee66[_0x92e9('0x41')]=_0x24ee66['attributes'][_0x92e9('0x43')]?_0x24ee66[_0x92e9('0x41')]:_0x298a1d[_0x92e9('0x40')];if(!_0x5444cb[_0x92e9('0x3c')][_0x92e9('0x44')](_0x92e9('0x45'))){_0x24ee66[_0x92e9('0x2b')]=qs[_0x92e9('0x2b')](_0x5444cb[_0x92e9('0x3c')][_0x92e9('0x2b')]);_0x24ee66[_0x92e9('0x2a')]=qs[_0x92e9('0x2a')](_0x5444cb[_0x92e9('0x3c')][_0x92e9('0x2a')]);}_0x24ee66[_0x92e9('0x46')]=qs[_0x92e9('0x47')](_0x5444cb[_0x92e9('0x3c')][_0x92e9('0x47')]);_0x24ee66['where']=qs[_0x92e9('0x3e')](_[_0x92e9('0x48')](_0x5444cb[_0x92e9('0x3c')],_0x298a1d[_0x92e9('0x3e')]));if(_0x5444cb[_0x92e9('0x3c')][_0x92e9('0x49')]){_0x24ee66[_0x92e9('0x4a')]=_[_0x92e9('0x4b')](_0x24ee66[_0x92e9('0x4a')],{'$or':_[_0x92e9('0x36')](_0x65d40a,function(_0xf7aee3){if(_0xf7aee3['type']!==_0x92e9('0x4c')){var _0x1a9321={};_0x1a9321[_0xf7aee3[_0x92e9('0x33')]]={'$like':'%'+_0x5444cb[_0x92e9('0x3c')][_0x92e9('0x49')]+'%'};return _0x1a9321;}})});}_0x24ee66=_['merge']({},_0x24ee66,_0x5444cb[_0x92e9('0x4d')]);var _0x490248={'where':_0x24ee66[_0x92e9('0x4a')]};return db[_0x92e9('0x37')][_0x92e9('0x29')](_0x490248)[_0x92e9('0x1a')](function(_0x4739b2){_0x5adfcb[_0x92e9('0x29')]=_0x4739b2;if(_0x5444cb[_0x92e9('0x3c')][_0x92e9('0x4e')]){_0x24ee66[_0x92e9('0x4f')]=[{'all':!![]}];}return db[_0x92e9('0x37')][_0x92e9('0x50')](_0x24ee66);})[_0x92e9('0x1a')](function(_0x46aa85){_0x5adfcb['rows']=_0x46aa85;return _0x5adfcb;})['then'](respondWithFilteredResult(_0x2eb0f9,_0x24ee66))[_0x92e9('0x24')](handleError(_0x2eb0f9,null));};exports[_0x92e9('0x51')]=function(_0x412a6b,_0x213eb0){var _0x3727d0={'raw':![],'where':{'id':_0x412a6b[_0x92e9('0x52')]['id']}},_0xfb1f70={};_0xfb1f70['model']=_[_0x92e9('0x3d')](db['Dynamics365Configuration']['rawAttributes']);_0xfb1f70[_0x92e9('0x3c')]=_[_0x92e9('0x3d')](_0x412a6b[_0x92e9('0x3c')]);_0xfb1f70[_0x92e9('0x3e')]=_[_0x92e9('0x3f')](_0xfb1f70[_0x92e9('0x40')],_0xfb1f70[_0x92e9('0x3c')]);_0x3727d0['attributes']=_[_0x92e9('0x3f')](_0xfb1f70[_0x92e9('0x40')],qs[_0x92e9('0x42')](_0x412a6b[_0x92e9('0x3c')][_0x92e9('0x42')]));_0x3727d0['attributes']=_0x3727d0[_0x92e9('0x41')][_0x92e9('0x43')]?_0x3727d0[_0x92e9('0x41')]:_0xfb1f70[_0x92e9('0x40')];if(_0x412a6b[_0x92e9('0x3c')]['includeAll']){_0x3727d0[_0x92e9('0x4f')]=[{'all':!![]}];}_0x3727d0=_[_0x92e9('0x4b')]({},_0x3727d0,_0x412a6b['options']);return db['Dynamics365Configuration'][_0x92e9('0x53')](_0x3727d0)['then'](handleEntityNotFound(_0x213eb0,null))[_0x92e9('0x1a')](respondWithResult(_0x213eb0,null))['catch'](handleError(_0x213eb0,null));};exports[_0x92e9('0x54')]=function(_0x2826ae,_0x23048d){return db[_0x92e9('0x37')]['create'](_0x2826ae['body'],{})[_0x92e9('0x1a')](respondWithResult(_0x23048d,0xc9))[_0x92e9('0x24')](handleError(_0x23048d,null));};exports[_0x92e9('0x31')]=function(_0x244bae,_0x2f5bca){if(_0x244bae[_0x92e9('0x55')]['id']){delete _0x244bae[_0x92e9('0x55')]['id'];}return db['Dynamics365Configuration'][_0x92e9('0x53')]({'where':{'id':_0x244bae['params']['id']}})['then'](handleEntityNotFound(_0x2f5bca,null))[_0x92e9('0x1a')](saveUpdates(_0x244bae[_0x92e9('0x55')],null))[_0x92e9('0x1a')](respondWithResult(_0x2f5bca,null))[_0x92e9('0x24')](handleError(_0x2f5bca,null));};exports[_0x92e9('0x56')]=function(_0x40faef,_0x50f876){return db[_0x92e9('0x37')]['find']({'where':{'id':_0x40faef[_0x92e9('0x52')]['id']}})[_0x92e9('0x1a')](handleEntityNotFound(_0x50f876,null))[_0x92e9('0x1a')](removeEntity(_0x50f876,null))[_0x92e9('0x24')](handleError(_0x50f876,null));};exports[_0x92e9('0x57')]=function(_0xd26f5a,_0x13f8a7,_0xb32955){var _0xb8eb78={};var _0x4f408d={};var _0x399f11;var _0x15bc0f;return db['Dynamics365Configuration'][_0x92e9('0x58')]({'where':{'id':_0xd26f5a['params']['id']}})['then'](handleEntityNotFound(_0x13f8a7,null))[_0x92e9('0x1a')](function(_0x401162){if(_0x401162){_0x399f11=_0x401162;_0x4f408d[_0x92e9('0x40')]=_[_0x92e9('0x3d')](db[_0x92e9('0x59')]['rawAttributes']);_0x4f408d[_0x92e9('0x3c')]=_[_0x92e9('0x3d')](_0xd26f5a[_0x92e9('0x3c')]);_0x4f408d['filters']=_[_0x92e9('0x3f')](_0x4f408d['model'],_0x4f408d[_0x92e9('0x3c')]);_0xb8eb78['attributes']=_[_0x92e9('0x3f')](_0x4f408d[_0x92e9('0x40')],qs[_0x92e9('0x42')](_0xd26f5a['query'][_0x92e9('0x42')]));_0xb8eb78[_0x92e9('0x41')]=_0xb8eb78['attributes'][_0x92e9('0x43')]?_0xb8eb78[_0x92e9('0x41')]:_0x4f408d[_0x92e9('0x40')];_0xb8eb78[_0x92e9('0x46')]=qs[_0x92e9('0x47')](_0xd26f5a['query'][_0x92e9('0x47')]);_0xb8eb78[_0x92e9('0x4a')]=qs[_0x92e9('0x3e')](_[_0x92e9('0x48')](_0xd26f5a[_0x92e9('0x3c')],_0x4f408d[_0x92e9('0x3e')]));if(_0xd26f5a[_0x92e9('0x3c')][_0x92e9('0x49')]){_0xb8eb78[_0x92e9('0x4a')]=_[_0x92e9('0x4b')](_0xb8eb78[_0x92e9('0x4a')],{'$or':_[_0x92e9('0x36')](_0xb8eb78[_0x92e9('0x41')],function(_0x44a26c){var _0x18c3ab={};_0x18c3ab[_0x44a26c]={'$like':'%'+_0xd26f5a['query'][_0x92e9('0x49')]+'%'};return _0x18c3ab;})});}_0xb8eb78=_['merge']({},_0xb8eb78,_0xd26f5a[_0x92e9('0x4d')]);return _0x399f11[_0x92e9('0x57')](_0xb8eb78);}})[_0x92e9('0x1a')](function(_0x1b0c1c){if(_0x1b0c1c){_0x15bc0f=_0x1b0c1c['length'];if(!_0xd26f5a['query'][_0x92e9('0x44')]('nolimit')){_0xb8eb78[_0x92e9('0x2b')]=qs[_0x92e9('0x2b')](_0xd26f5a[_0x92e9('0x3c')][_0x92e9('0x2b')]);_0xb8eb78[_0x92e9('0x2a')]=qs['offset'](_0xd26f5a[_0x92e9('0x3c')][_0x92e9('0x2a')]);}return _0x399f11['getFields'](_0xb8eb78);}})[_0x92e9('0x1a')](function(_0x265d52){if(_0x265d52){return _0x265d52?{'count':_0x15bc0f,'rows':_0x265d52}:null;}})[_0x92e9('0x1a')](respondWithResult(_0x13f8a7,null))['catch'](handleError(_0x13f8a7,null));};exports[_0x92e9('0x5a')]=function(_0x4b9057,_0x183f62,_0x59d3bc){var _0x7ce282={};var _0x4b5bd8={};var _0x40e705;var _0x3d3929;return db[_0x92e9('0x37')][_0x92e9('0x58')]({'where':{'id':_0x4b9057[_0x92e9('0x52')]['id']}})[_0x92e9('0x1a')](handleEntityNotFound(_0x183f62,null))[_0x92e9('0x1a')](function(_0x2ae2d3){if(_0x2ae2d3){_0x40e705=_0x2ae2d3;_0x4b5bd8[_0x92e9('0x40')]=_[_0x92e9('0x3d')](db['Dynamics365Field'][_0x92e9('0x38')]);_0x4b5bd8[_0x92e9('0x3c')]=_['keys'](_0x4b9057[_0x92e9('0x3c')]);_0x4b5bd8[_0x92e9('0x3e')]=_[_0x92e9('0x3f')](_0x4b5bd8[_0x92e9('0x40')],_0x4b5bd8[_0x92e9('0x3c')]);_0x7ce282['attributes']=_[_0x92e9('0x3f')](_0x4b5bd8[_0x92e9('0x40')],qs[_0x92e9('0x42')](_0x4b9057[_0x92e9('0x3c')][_0x92e9('0x42')]));_0x7ce282[_0x92e9('0x41')]=_0x7ce282['attributes'][_0x92e9('0x43')]?_0x7ce282[_0x92e9('0x41')]:_0x4b5bd8[_0x92e9('0x40')];_0x7ce282['order']=qs[_0x92e9('0x47')](_0x4b9057[_0x92e9('0x3c')][_0x92e9('0x47')]);_0x7ce282[_0x92e9('0x4a')]=qs[_0x92e9('0x3e')](_[_0x92e9('0x48')](_0x4b9057[_0x92e9('0x3c')],_0x4b5bd8[_0x92e9('0x3e')]));if(_0x4b9057[_0x92e9('0x3c')][_0x92e9('0x49')]){_0x7ce282['where']=_[_0x92e9('0x4b')](_0x7ce282[_0x92e9('0x4a')],{'$or':_[_0x92e9('0x36')](_0x7ce282['attributes'],function(_0x4e4739){var _0x595714={};_0x595714[_0x4e4739]={'$like':'%'+_0x4b9057[_0x92e9('0x3c')][_0x92e9('0x49')]+'%'};return _0x595714;})});}_0x7ce282=_[_0x92e9('0x4b')]({},_0x7ce282,_0x4b9057[_0x92e9('0x4d')]);return _0x40e705[_0x92e9('0x5a')](_0x7ce282);}})[_0x92e9('0x1a')](function(_0x200dbb){if(_0x200dbb){_0x3d3929=_0x200dbb[_0x92e9('0x43')];if(!_0x4b9057[_0x92e9('0x3c')][_0x92e9('0x44')]('nolimit')){_0x7ce282[_0x92e9('0x2b')]=qs[_0x92e9('0x2b')](_0x4b9057['query']['limit']);_0x7ce282[_0x92e9('0x2a')]=qs[_0x92e9('0x2a')](_0x4b9057[_0x92e9('0x3c')]['offset']);}return _0x40e705['getSubjects'](_0x7ce282);}})[_0x92e9('0x1a')](function(_0x2903a6){if(_0x2903a6){return _0x2903a6?{'count':_0x3d3929,'rows':_0x2903a6}:null;}})[_0x92e9('0x1a')](respondWithResult(_0x183f62,null))['catch'](handleError(_0x183f62,null));};exports[_0x92e9('0x5b')]=function(_0x15f618,_0x21b301,_0x4adf1d){var _0x2f6bcb={};var _0x4ac357={};var _0x5f7910;var _0x4329d9;return db[_0x92e9('0x37')]['findOne']({'where':{'id':_0x15f618[_0x92e9('0x52')]['id']}})['then'](handleEntityNotFound(_0x21b301,null))[_0x92e9('0x1a')](function(_0xcf57c6){if(_0xcf57c6){_0x5f7910=_0xcf57c6;_0x4ac357[_0x92e9('0x40')]=_[_0x92e9('0x3d')](db[_0x92e9('0x59')][_0x92e9('0x38')]);_0x4ac357[_0x92e9('0x3c')]=_['keys'](_0x15f618[_0x92e9('0x3c')]);_0x4ac357[_0x92e9('0x3e')]=_[_0x92e9('0x3f')](_0x4ac357[_0x92e9('0x40')],_0x4ac357['query']);_0x2f6bcb['attributes']=_['intersection'](_0x4ac357[_0x92e9('0x40')],qs[_0x92e9('0x42')](_0x15f618[_0x92e9('0x3c')][_0x92e9('0x42')]));_0x2f6bcb[_0x92e9('0x41')]=_0x2f6bcb[_0x92e9('0x41')][_0x92e9('0x43')]?_0x2f6bcb['attributes']:_0x4ac357[_0x92e9('0x40')];_0x2f6bcb[_0x92e9('0x46')]=qs[_0x92e9('0x47')](_0x15f618[_0x92e9('0x3c')]['sort']);_0x2f6bcb[_0x92e9('0x4a')]=qs[_0x92e9('0x3e')](_['pick'](_0x15f618[_0x92e9('0x3c')],_0x4ac357[_0x92e9('0x3e')]));if(_0x15f618[_0x92e9('0x3c')][_0x92e9('0x49')]){_0x2f6bcb[_0x92e9('0x4a')]=_['merge'](_0x2f6bcb[_0x92e9('0x4a')],{'$or':_[_0x92e9('0x36')](_0x2f6bcb[_0x92e9('0x41')],function(_0x3a9f49){var _0x7eeefb={};_0x7eeefb[_0x3a9f49]={'$like':'%'+_0x15f618['query'][_0x92e9('0x49')]+'%'};return _0x7eeefb;})});}_0x2f6bcb=_[_0x92e9('0x4b')]({},_0x2f6bcb,_0x15f618[_0x92e9('0x4d')]);return _0x5f7910[_0x92e9('0x5b')](_0x2f6bcb);}})[_0x92e9('0x1a')](function(_0x2abe05){if(_0x2abe05){_0x4329d9=_0x2abe05[_0x92e9('0x43')];if(!_0x15f618['query'][_0x92e9('0x44')]('nolimit')){_0x2f6bcb[_0x92e9('0x2b')]=qs[_0x92e9('0x2b')](_0x15f618[_0x92e9('0x3c')]['limit']);_0x2f6bcb[_0x92e9('0x2a')]=qs[_0x92e9('0x2a')](_0x15f618[_0x92e9('0x3c')][_0x92e9('0x2a')]);}return _0x5f7910['getDescriptions'](_0x2f6bcb);}})['then'](function(_0x3fcdc2){if(_0x3fcdc2){return _0x3fcdc2?{'count':_0x4329d9,'rows':_0x3fcdc2}:null;}})['then'](respondWithResult(_0x21b301,null))['catch'](handleError(_0x21b301,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index a17a4f3..201e32c 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 _0xc3c4=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','../../config/logger'];(function(_0x5910ab,_0x27b2c8){var _0x4c829c=function(_0x5f254a){while(--_0x5f254a){_0x5910ab['push'](_0x5910ab['shift']());}};_0x4c829c(++_0x27b2c8);}(_0xc3c4,0xf5));var _0x4c3c=function(_0x14f496,_0x26e660){_0x14f496=_0x14f496-0x0;var _0x4af8fc=_0xc3c4[_0x14f496];return _0x4af8fc;};'use strict';var _=require(_0x4c3c('0x0'));var util=require('util');var logger=require(_0x4c3c('0x1'))(_0x4c3c('0x2'));var moment=require(_0x4c3c('0x3'));var BPromise=require(_0x4c3c('0x4'));var rp=require(_0x4c3c('0x5'));var fs=require('fs');var path=require(_0x4c3c('0x6'));var rimraf=require(_0x4c3c('0x7'));var config=require(_0x4c3c('0x8'));var attributes=require(_0x4c3c('0x9'));module[_0x4c3c('0xa')]=function(_0x1f93e5,_0x10cc5f){return _0x1f93e5['define'](_0x4c3c('0xb'),attributes,{'tableName':_0x4c3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a91=['request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','util','../../config/logger','moment','bluebird'];(function(_0xc0754,_0x37f107){var _0x195498=function(_0x23dba7){while(--_0x23dba7){_0xc0754['push'](_0xc0754['shift']());}};_0x195498(++_0x37f107);}(_0x4a91,0x11e));var _0x14a9=function(_0x367e5b,_0x5721e4){_0x367e5b=_0x367e5b-0x0;var _0x4b909e=_0x4a91[_0x367e5b];return _0x4b909e;};'use strict';var _=require('lodash');var util=require(_0x14a9('0x0'));var logger=require(_0x14a9('0x1'))('api');var moment=require(_0x14a9('0x2'));var BPromise=require(_0x14a9('0x3'));var rp=require(_0x14a9('0x4'));var fs=require('fs');var path=require(_0x14a9('0x5'));var rimraf=require('rimraf');var config=require(_0x14a9('0x6'));var attributes=require(_0x14a9('0x7'));module[_0x14a9('0x8')]=function(_0x31f625,_0x4c4e8c){return _0x31f625['define'](_0x14a9('0x9'),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 66a3aa4..b9af693 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 _0xcb24=['info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then'];(function(_0x57e50b,_0x16e856){var _0x4a1016=function(_0x3db554){while(--_0x3db554){_0x57e50b['push'](_0x57e50b['shift']());}};_0x4a1016(++_0x16e856);}(_0xcb24,0xe5));var _0x4cb2=function(_0x14cfde,_0x403505){_0x14cfde=_0x14cfde-0x0;var _0xa40048=_0xcb24[_0x14cfde];return _0xa40048;};'use strict';var _=require(_0x4cb2('0x0'));var util=require(_0x4cb2('0x1'));var moment=require('moment');var BPromise=require(_0x4cb2('0x2'));var rs=require(_0x4cb2('0x3'));var fs=require('fs');var Redis=require(_0x4cb2('0x4'));var db=require(_0x4cb2('0x5'))['db'];var utils=require(_0x4cb2('0x6'));var logger=require(_0x4cb2('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4cb2('0x8'));var client=jayson[_0x4cb2('0x9')][_0x4cb2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x88d657,_0x43bdb0,_0x8db9f2){return new BPromise(function(_0x2714b3,_0x3f88b0){return client[_0x4cb2('0xb')](_0x88d657,_0x8db9f2)[_0x4cb2('0xc')](function(_0x226ed4){logger[_0x4cb2('0xd')](_0x4cb2('0xe'),_0x43bdb0,_0x4cb2('0xf'));logger[_0x4cb2('0x10')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x43bdb0,_0x4cb2('0xf'),JSON['stringify'](_0x226ed4));if(_0x226ed4[_0x4cb2('0x11')]){if(_0x226ed4[_0x4cb2('0x11')][_0x4cb2('0x12')]===0x1f4){logger[_0x4cb2('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x43bdb0,_0x226ed4['error']['message']);return _0x3f88b0(_0x226ed4[_0x4cb2('0x11')][_0x4cb2('0x13')]);}logger[_0x4cb2('0x11')](_0x4cb2('0xe'),_0x43bdb0,_0x226ed4[_0x4cb2('0x11')][_0x4cb2('0x13')]);return _0x2714b3(_0x226ed4[_0x4cb2('0x11')][_0x4cb2('0x13')]);}else{logger[_0x4cb2('0xd')](_0x4cb2('0xe'),_0x43bdb0,_0x4cb2('0xf'));_0x2714b3(_0x226ed4[_0x4cb2('0x14')][_0x4cb2('0x13')]);}})[_0x4cb2('0x15')](function(_0x1a8107){logger[_0x4cb2('0x11')](_0x4cb2('0xe'),_0x43bdb0,_0x1a8107);_0x3f88b0(_0x1a8107);});});} \ No newline at end of file +var _0x7fd6=['catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x5c0108,_0x285fb1){var _0x198438=function(_0x457c3c){while(--_0x457c3c){_0x5c0108['push'](_0x5c0108['shift']());}};_0x198438(++_0x285fb1);}(_0x7fd6,0x157));var _0x67fd=function(_0x45681b,_0x2a1326){_0x45681b=_0x45681b-0x0;var _0x4b58d2=_0x7fd6[_0x45681b];return _0x4b58d2;};'use strict';var _=require(_0x67fd('0x0'));var util=require('util');var moment=require(_0x67fd('0x1'));var BPromise=require(_0x67fd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67fd('0x3'))['db'];var utils=require(_0x67fd('0x4'));var logger=require(_0x67fd('0x5'))('rpc');var config=require(_0x67fd('0x6'));var jayson=require(_0x67fd('0x7'));var client=jayson['client'][_0x67fd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5aff22,_0x309b5b,_0x22ecf0){return new BPromise(function(_0x570b83,_0x3cb725){return client[_0x67fd('0x9')](_0x5aff22,_0x22ecf0)[_0x67fd('0xa')](function(_0x208ad0){logger['info'](_0x67fd('0xb'),_0x309b5b,_0x67fd('0xc'));logger['debug'](_0x67fd('0xd'),_0x309b5b,_0x67fd('0xc'),JSON[_0x67fd('0xe')](_0x208ad0));if(_0x208ad0[_0x67fd('0xf')]){if(_0x208ad0[_0x67fd('0xf')]['code']===0x1f4){logger['error'](_0x67fd('0xb'),_0x309b5b,_0x208ad0[_0x67fd('0xf')][_0x67fd('0x10')]);return _0x3cb725(_0x208ad0[_0x67fd('0xf')][_0x67fd('0x10')]);}logger[_0x67fd('0xf')](_0x67fd('0xb'),_0x309b5b,_0x208ad0[_0x67fd('0xf')][_0x67fd('0x10')]);return _0x570b83(_0x208ad0[_0x67fd('0xf')][_0x67fd('0x10')]);}else{logger[_0x67fd('0x11')](_0x67fd('0xb'),_0x309b5b,_0x67fd('0xc'));_0x570b83(_0x208ad0['result'][_0x67fd('0x10')]);}})[_0x67fd('0x12')](function(_0x38c3cf){logger[_0x67fd('0xf')](_0x67fd('0xb'),_0x309b5b,_0x38c3cf);_0x3cb725(_0x38c3cf);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index f7faef3..91c8567 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 _0x1b32=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','post','destroy','util','path'];(function(_0x5b7a0a,_0x566d2d){var _0x333db9=function(_0x1fa84d){while(--_0x1fa84d){_0x5b7a0a['push'](_0x5b7a0a['shift']());}};_0x333db9(++_0x566d2d);}(_0x1b32,0x85));var _0x21b3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1b32[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require(_0x21b3('0x0'));var path=require(_0x21b3('0x1'));var timeout=require(_0x21b3('0x2'));var express=require(_0x21b3('0x3'));var router=express[_0x21b3('0x4')]();var auth=require(_0x21b3('0x5'));var interaction=require(_0x21b3('0x6'));var config=require(_0x21b3('0x7'));var controller=require(_0x21b3('0x8'));router[_0x21b3('0x9')]('/',auth[_0x21b3('0xa')](),controller[_0x21b3('0xb')]);router[_0x21b3('0x9')](_0x21b3('0xc'),auth[_0x21b3('0xa')](),controller['show']);router[_0x21b3('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x21b3('0xc'),auth[_0x21b3('0xa')](),controller['update']);router['delete'](_0x21b3('0xc'),auth[_0x21b3('0xa')](),controller[_0x21b3('0xe')]);module['exports']=router; \ No newline at end of file +var _0x54ef=['isAuthenticated','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','/:id'];(function(_0x3cd6e4,_0xa727ee){var _0x49bc46=function(_0x9f1a87){while(--_0x9f1a87){_0x3cd6e4['push'](_0x3cd6e4['shift']());}};_0x49bc46(++_0xa727ee);}(_0x54ef,0x112));var _0xf54e=function(_0x255158,_0x13666a){_0x255158=_0x255158-0x0;var _0x5696f8=_0x54ef[_0x255158];return _0x5696f8;};'use strict';var multer=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var path=require(_0xf54e('0x2'));var timeout=require('connect-timeout');var express=require(_0xf54e('0x3'));var router=express[_0xf54e('0x4')]();var auth=require(_0xf54e('0x5'));var interaction=require(_0xf54e('0x6'));var config=require(_0xf54e('0x7'));var controller=require(_0xf54e('0x8'));router[_0xf54e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf54e('0x9')](_0xf54e('0xa'),auth[_0xf54e('0xb')](),controller['show']);router[_0xf54e('0xc')]('/',auth['isAuthenticated'](),controller[_0xf54e('0xd')]);router[_0xf54e('0xe')]('/:id',auth[_0xf54e('0xb')](),controller[_0xf54e('0xf')]);router[_0xf54e('0x10')](_0xf54e('0xa'),auth['isAuthenticated'](),controller[_0xf54e('0x11')]);module[_0xf54e('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 3027a4e..20d44b7 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 _0x4876=['ENUM','customVariable','string','STRING','variable','BOOLEAN'];(function(_0x22136c,_0x2eaa2b){var _0xd0c875=function(_0x16e87b){while(--_0x16e87b){_0x22136c['push'](_0x22136c['shift']());}};_0xd0c875(++_0x2eaa2b);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x6487('0x0')]('string','variable',_0x6487('0x1'),'keyValue'),'defaultValue':_0x6487('0x2')},'content':{'type':Sequelize[_0x6487('0x3')]},'key':{'type':Sequelize[_0x6487('0x3')]},'keyType':{'type':Sequelize[_0x6487('0x0')]('string',_0x6487('0x4'),_0x6487('0x1'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6487('0x3')]},'nameField':{'type':Sequelize[_0x6487('0x3')]},'customField':{'type':Sequelize[_0x6487('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6487('0x3')]}}; \ No newline at end of file +var _0x3aa4=['keyValue','STRING','ENUM','BOOLEAN','exports','string','variable','customVariable'];(function(_0x7148b6,_0xa61534){var _0x111019=function(_0x452d96){while(--_0x452d96){_0x7148b6['push'](_0x7148b6['shift']());}};_0x111019(++_0xa61534);}(_0x3aa4,0x11c));var _0x43aa=function(_0x407147,_0x55c70f){_0x407147=_0x407147-0x0;var _0x7e29b6=_0x3aa4[_0x407147];return _0x7e29b6;};'use strict';var Sequelize=require('sequelize');module[_0x43aa('0x0')]={'type':{'type':Sequelize['ENUM'](_0x43aa('0x1'),_0x43aa('0x2'),_0x43aa('0x3'),_0x43aa('0x4')),'defaultValue':_0x43aa('0x1')},'content':{'type':Sequelize[_0x43aa('0x5')]},'key':{'type':Sequelize[_0x43aa('0x5')]},'keyType':{'type':Sequelize[_0x43aa('0x6')](_0x43aa('0x1'),_0x43aa('0x2'),_0x43aa('0x3'))},'keyContent':{'type':Sequelize[_0x43aa('0x5')]},'idField':{'type':Sequelize[_0x43aa('0x5')]},'nameField':{'type':Sequelize[_0x43aa('0x5')]},'customField':{'type':Sequelize[_0x43aa('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x43aa('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index f3e9e2a..572e364 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 _0xf0f4=['include','findAll','rows','catch','show','params','find','create','body','update','destroy','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','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','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','Dynamics365Field','count','includeAll'];(function(_0x20c383,_0xecccbe){var _0x190833=function(_0x3c45db){while(--_0x3c45db){_0x20c383['push'](_0x20c383['shift']());}};_0x190833(++_0xecccbe);}(_0xf0f4,0x182));var _0x4f0f=function(_0x56ed08,_0x1d68f6){_0x56ed08=_0x56ed08-0x0;var _0x18ca24=_0xf0f4[_0x56ed08];return _0x18ca24;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4f0f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4f0f('0x1'));var rp=require(_0x4f0f('0x2'));var moment=require('moment');var BPromise=require(_0x4f0f('0x3'));var Mustache=require(_0x4f0f('0x4'));var util=require(_0x4f0f('0x5'));var path=require(_0x4f0f('0x6'));var sox=require(_0x4f0f('0x7'));var csv=require(_0x4f0f('0x8'));var ejs=require(_0x4f0f('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4f0f('0xa'));var crypto=require(_0x4f0f('0xb'));var jsforce=require(_0x4f0f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4f0f('0x8'));var querystring=require(_0x4f0f('0xd'));var Papa=require(_0x4f0f('0xe'));var Redis=require(_0x4f0f('0xf'));var authService=require(_0x4f0f('0x10'));var qs=require(_0x4f0f('0x11'));var as=require(_0x4f0f('0x12'));var hardwareService=require(_0x4f0f('0x13'));var logger=require('../../config/logger')(_0x4f0f('0x14'));var utils=require(_0x4f0f('0x15'));var config=require(_0x4f0f('0x16'));var db=require(_0x4f0f('0x17'))['db'];function respondWithStatusCode(_0x2221e5,_0x1a1b94){_0x1a1b94=_0x1a1b94||0xcc;return function(_0x123845){if(_0x123845){return _0x2221e5[_0x4f0f('0x18')](_0x1a1b94);}return _0x2221e5[_0x4f0f('0x19')](_0x1a1b94)[_0x4f0f('0x1a')]();};}function respondWithResult(_0x3fc985,_0x4e1e26){_0x4e1e26=_0x4e1e26||0xc8;return function(_0xebecc0){if(_0xebecc0){return _0x3fc985[_0x4f0f('0x19')](_0x4e1e26)[_0x4f0f('0x1b')](_0xebecc0);}};}function respondWithFilteredResult(_0x22de68,_0x51a713){return function(_0xd9ad12){if(_0xd9ad12){var _0x46d7cf=_0xd9ad12['count'],_0x5783=_0x51a713[_0x4f0f('0x1c')],_0x1c0aa1=_0x51a713[_0x4f0f('0x1c')]+_0x51a713[_0x4f0f('0x1d')],_0x4038fd;if(_0x1c0aa1>=_0x46d7cf){_0x1c0aa1=_0x46d7cf;_0x4038fd=0xc8;}else{_0x4038fd=0xce;}_0x22de68['status'](_0x4038fd);return _0x22de68[_0x4f0f('0x1e')](_0x4f0f('0x1f'),_0x5783+'-'+_0x1c0aa1+'/'+_0x46d7cf)[_0x4f0f('0x1b')](_0xd9ad12);}return null;};}function patchUpdates(_0x5f5363){return function(_0x3a37a9){try{jsonpatch[_0x4f0f('0x20')](_0x3a37a9,_0x5f5363,!![]);}catch(_0x34bba8){return BPromise[_0x4f0f('0x21')](_0x34bba8);}return _0x3a37a9[_0x4f0f('0x22')]();};}function saveUpdates(_0x3bd1b9,_0x537074){return function(_0x276387){if(_0x276387){return _0x276387['update'](_0x3bd1b9)[_0x4f0f('0x23')](function(_0x21ebad){return _0x21ebad;});}return null;};}function removeEntity(_0x5b5889,_0x4e4b28){return function(_0x1bdfb4){if(_0x1bdfb4){return _0x1bdfb4['destroy']()[_0x4f0f('0x23')](function(){_0x5b5889[_0x4f0f('0x19')](0xcc)[_0x4f0f('0x1a')]();});}};}function handleEntityNotFound(_0x17f10c,_0x454720){return function(_0x17a9e9){if(!_0x17a9e9){_0x17f10c['sendStatus'](0x194);}return _0x17a9e9;};}function handleError(_0x1a46dd,_0xcdcd05){_0xcdcd05=_0xcdcd05||0x1f4;return function(_0x37aefe){logger[_0x4f0f('0x24')](_0x37aefe[_0x4f0f('0x25')]);if(_0x37aefe[_0x4f0f('0x26')]){delete _0x37aefe[_0x4f0f('0x26')];}_0x1a46dd[_0x4f0f('0x19')](_0xcdcd05)[_0x4f0f('0x27')](_0x37aefe);};}exports[_0x4f0f('0x28')]=function(_0x37ae8f,_0x394303){var _0x381329={},_0x5c13d1={},_0x1e6941={'count':0x0,'rows':[]};var _0x269563=_[_0x4f0f('0x29')](db['Dynamics365Field'][_0x4f0f('0x2a')],function(_0x4e5f0d){return{'name':_0x4e5f0d[_0x4f0f('0x2b')],'type':_0x4e5f0d[_0x4f0f('0x2c')]['key']};});_0x5c13d1['model']=_[_0x4f0f('0x29')](_0x269563,'name');_0x5c13d1[_0x4f0f('0x2d')]=_[_0x4f0f('0x2e')](_0x37ae8f['query']);_0x5c13d1[_0x4f0f('0x2f')]=_[_0x4f0f('0x30')](_0x5c13d1[_0x4f0f('0x31')],_0x5c13d1[_0x4f0f('0x2d')]);_0x381329['attributes']=_[_0x4f0f('0x30')](_0x5c13d1[_0x4f0f('0x31')],qs[_0x4f0f('0x32')](_0x37ae8f[_0x4f0f('0x2d')]['fields']));_0x381329[_0x4f0f('0x33')]=_0x381329[_0x4f0f('0x33')][_0x4f0f('0x34')]?_0x381329['attributes']:_0x5c13d1[_0x4f0f('0x31')];if(!_0x37ae8f[_0x4f0f('0x2d')]['hasOwnProperty'](_0x4f0f('0x35'))){_0x381329[_0x4f0f('0x1d')]=qs[_0x4f0f('0x1d')](_0x37ae8f[_0x4f0f('0x2d')]['limit']);_0x381329[_0x4f0f('0x1c')]=qs[_0x4f0f('0x1c')](_0x37ae8f[_0x4f0f('0x2d')][_0x4f0f('0x1c')]);}_0x381329[_0x4f0f('0x36')]=qs[_0x4f0f('0x37')](_0x37ae8f[_0x4f0f('0x2d')][_0x4f0f('0x37')]);_0x381329['where']=qs[_0x4f0f('0x2f')](_[_0x4f0f('0x38')](_0x37ae8f[_0x4f0f('0x2d')],_0x5c13d1[_0x4f0f('0x2f')]));if(_0x37ae8f[_0x4f0f('0x2d')][_0x4f0f('0x39')]){_0x381329[_0x4f0f('0x3a')]=_['merge'](_0x381329[_0x4f0f('0x3a')],{'$or':_[_0x4f0f('0x29')](_0x269563,function(_0x32ff59){if(_0x32ff59['type']!==_0x4f0f('0x3b')){var _0x47b3fc={};_0x47b3fc[_0x32ff59[_0x4f0f('0x26')]]={'$like':'%'+_0x37ae8f['query'][_0x4f0f('0x39')]+'%'};return _0x47b3fc;}})});}_0x381329=_[_0x4f0f('0x3c')]({},_0x381329,_0x37ae8f['options']);var _0x76277b={'where':_0x381329[_0x4f0f('0x3a')]};return db[_0x4f0f('0x3d')]['count'](_0x76277b)[_0x4f0f('0x23')](function(_0xda7adc){_0x1e6941[_0x4f0f('0x3e')]=_0xda7adc;if(_0x37ae8f[_0x4f0f('0x2d')][_0x4f0f('0x3f')]){_0x381329[_0x4f0f('0x40')]=[{'all':!![]}];}return db[_0x4f0f('0x3d')][_0x4f0f('0x41')](_0x381329);})[_0x4f0f('0x23')](function(_0x3da96a){_0x1e6941[_0x4f0f('0x42')]=_0x3da96a;return _0x1e6941;})['then'](respondWithFilteredResult(_0x394303,_0x381329))[_0x4f0f('0x43')](handleError(_0x394303,null));};exports[_0x4f0f('0x44')]=function(_0x2e7c5e,_0x204d10){var _0x419cb4={'raw':!![],'where':{'id':_0x2e7c5e[_0x4f0f('0x45')]['id']}},_0x178d74={};_0x178d74['model']=_[_0x4f0f('0x2e')](db[_0x4f0f('0x3d')][_0x4f0f('0x2a')]);_0x178d74[_0x4f0f('0x2d')]=_[_0x4f0f('0x2e')](_0x2e7c5e[_0x4f0f('0x2d')]);_0x178d74['filters']=_[_0x4f0f('0x30')](_0x178d74[_0x4f0f('0x31')],_0x178d74['query']);_0x419cb4['attributes']=_[_0x4f0f('0x30')](_0x178d74[_0x4f0f('0x31')],qs[_0x4f0f('0x32')](_0x2e7c5e['query'][_0x4f0f('0x32')]));_0x419cb4['attributes']=_0x419cb4['attributes'][_0x4f0f('0x34')]?_0x419cb4[_0x4f0f('0x33')]:_0x178d74[_0x4f0f('0x31')];if(_0x2e7c5e[_0x4f0f('0x2d')][_0x4f0f('0x3f')]){_0x419cb4[_0x4f0f('0x40')]=[{'all':!![]}];}_0x419cb4=_['merge']({},_0x419cb4,_0x2e7c5e['options']);return db[_0x4f0f('0x3d')][_0x4f0f('0x46')](_0x419cb4)[_0x4f0f('0x23')](handleEntityNotFound(_0x204d10,null))['then'](respondWithResult(_0x204d10,null))[_0x4f0f('0x43')](handleError(_0x204d10,null));};exports[_0x4f0f('0x47')]=function(_0x343965,_0x4e9265){return db[_0x4f0f('0x3d')]['create'](_0x343965[_0x4f0f('0x48')],{})['then'](respondWithResult(_0x4e9265,0xc9))[_0x4f0f('0x43')](handleError(_0x4e9265,null));};exports[_0x4f0f('0x49')]=function(_0x2b0d3e,_0x45184a){if(_0x2b0d3e[_0x4f0f('0x48')]['id']){delete _0x2b0d3e['body']['id'];}return db['Dynamics365Field'][_0x4f0f('0x46')]({'where':{'id':_0x2b0d3e['params']['id']}})[_0x4f0f('0x23')](handleEntityNotFound(_0x45184a,null))[_0x4f0f('0x23')](saveUpdates(_0x2b0d3e[_0x4f0f('0x48')],null))[_0x4f0f('0x23')](respondWithResult(_0x45184a,null))[_0x4f0f('0x43')](handleError(_0x45184a,null));};exports[_0x4f0f('0x4a')]=function(_0x168383,_0x37c0d5){return db['Dynamics365Field'][_0x4f0f('0x46')]({'where':{'id':_0x168383[_0x4f0f('0x45')]['id']}})[_0x4f0f('0x23')](handleEntityNotFound(_0x37c0d5,null))[_0x4f0f('0x23')](removeEntity(_0x37c0d5,null))[_0x4f0f('0x43')](handleError(_0x37c0d5,null));}; \ No newline at end of file +var _0x8276=['filter','merge','where','VIRTUAL','options','Dynamics365Field','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','map','rawAttributes','type','key','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','pick'];(function(_0x2ea4d8,_0x437260){var _0x1dc527=function(_0x2e8ed8){while(--_0x2e8ed8){_0x2ea4d8['push'](_0x2ea4d8['shift']());}};_0x1dc527(++_0x437260);}(_0x8276,0xa7));var _0x6827=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8276[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x6827('0x0'));var emlformat=require(_0x6827('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6827('0x2'));var rp=require(_0x6827('0x3'));var moment=require('moment');var BPromise=require(_0x6827('0x4'));var Mustache=require(_0x6827('0x5'));var util=require('util');var path=require(_0x6827('0x6'));var sox=require(_0x6827('0x7'));var csv=require(_0x6827('0x8'));var ejs=require(_0x6827('0x9'));var fs=require('fs');var _=require(_0x6827('0xa'));var squel=require(_0x6827('0xb'));var crypto=require(_0x6827('0xc'));var jsforce=require(_0x6827('0xd'));var deskjs=require(_0x6827('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6827('0xf'));var Papa=require(_0x6827('0x10'));var Redis=require(_0x6827('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6827('0x12'));var as=require(_0x6827('0x13'));var hardwareService=require(_0x6827('0x14'));var logger=require('../../config/logger')(_0x6827('0x15'));var utils=require(_0x6827('0x16'));var config=require(_0x6827('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5dde44,_0x5af483){_0x5af483=_0x5af483||0xcc;return function(_0x3fe85d){if(_0x3fe85d){return _0x5dde44[_0x6827('0x18')](_0x5af483);}return _0x5dde44[_0x6827('0x19')](_0x5af483)['end']();};}function respondWithResult(_0x23c9fc,_0x4244e6){_0x4244e6=_0x4244e6||0xc8;return function(_0x587cd9){if(_0x587cd9){return _0x23c9fc['status'](_0x4244e6)[_0x6827('0x1a')](_0x587cd9);}};}function respondWithFilteredResult(_0x2ba38d,_0x2b661c){return function(_0x1eada3){if(_0x1eada3){var _0x1bac80=_0x1eada3[_0x6827('0x1b')],_0x4b4aac=_0x2b661c['offset'],_0x4bdef4=_0x2b661c['offset']+_0x2b661c[_0x6827('0x1c')],_0x1a367c;if(_0x4bdef4>=_0x1bac80){_0x4bdef4=_0x1bac80;_0x1a367c=0xc8;}else{_0x1a367c=0xce;}_0x2ba38d['status'](_0x1a367c);return _0x2ba38d[_0x6827('0x1d')](_0x6827('0x1e'),_0x4b4aac+'-'+_0x4bdef4+'/'+_0x1bac80)[_0x6827('0x1a')](_0x1eada3);}return null;};}function patchUpdates(_0x42cbae){return function(_0x108451){try{jsonpatch[_0x6827('0x1f')](_0x108451,_0x42cbae,!![]);}catch(_0x5bd8bb){return BPromise[_0x6827('0x20')](_0x5bd8bb);}return _0x108451[_0x6827('0x21')]();};}function saveUpdates(_0x595855,_0x1933c0){return function(_0x127e5b){if(_0x127e5b){return _0x127e5b[_0x6827('0x22')](_0x595855)[_0x6827('0x23')](function(_0x17e4cc){return _0x17e4cc;});}return null;};}function removeEntity(_0xe33001,_0x360168){return function(_0x15f8b3){if(_0x15f8b3){return _0x15f8b3[_0x6827('0x24')]()['then'](function(){_0xe33001[_0x6827('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25e37e,_0x5c3a1f){return function(_0x162cdb){if(!_0x162cdb){_0x25e37e[_0x6827('0x18')](0x194);}return _0x162cdb;};}function handleError(_0x475749,_0x40ec0a){_0x40ec0a=_0x40ec0a||0x1f4;return function(_0xfca65c){logger[_0x6827('0x25')](_0xfca65c[_0x6827('0x26')]);if(_0xfca65c['name']){delete _0xfca65c['name'];}_0x475749[_0x6827('0x19')](_0x40ec0a)[_0x6827('0x27')](_0xfca65c);};}exports[_0x6827('0x28')]=function(_0x2afb9b,_0xa378c2){var _0x365b73={},_0x320943={},_0x43300a={'count':0x0,'rows':[]};var _0x3c5e77=_[_0x6827('0x29')](db['Dynamics365Field'][_0x6827('0x2a')],function(_0x56cab3){return{'name':_0x56cab3['fieldName'],'type':_0x56cab3[_0x6827('0x2b')][_0x6827('0x2c')]};});_0x320943[_0x6827('0x2d')]=_['map'](_0x3c5e77,_0x6827('0x2e'));_0x320943[_0x6827('0x2f')]=_['keys'](_0x2afb9b['query']);_0x320943[_0x6827('0x30')]=_[_0x6827('0x31')](_0x320943[_0x6827('0x2d')],_0x320943[_0x6827('0x2f')]);_0x365b73['attributes']=_[_0x6827('0x31')](_0x320943[_0x6827('0x2d')],qs[_0x6827('0x32')](_0x2afb9b[_0x6827('0x2f')]['fields']));_0x365b73['attributes']=_0x365b73[_0x6827('0x33')][_0x6827('0x34')]?_0x365b73[_0x6827('0x33')]:_0x320943['model'];if(!_0x2afb9b[_0x6827('0x2f')][_0x6827('0x35')](_0x6827('0x36'))){_0x365b73[_0x6827('0x1c')]=qs['limit'](_0x2afb9b['query'][_0x6827('0x1c')]);_0x365b73[_0x6827('0x37')]=qs['offset'](_0x2afb9b[_0x6827('0x2f')]['offset']);}_0x365b73[_0x6827('0x38')]=qs['sort'](_0x2afb9b[_0x6827('0x2f')]['sort']);_0x365b73['where']=qs['filters'](_[_0x6827('0x39')](_0x2afb9b[_0x6827('0x2f')],_0x320943[_0x6827('0x30')]));if(_0x2afb9b[_0x6827('0x2f')][_0x6827('0x3a')]){_0x365b73['where']=_[_0x6827('0x3b')](_0x365b73[_0x6827('0x3c')],{'$or':_['map'](_0x3c5e77,function(_0x5b9c12){if(_0x5b9c12[_0x6827('0x2b')]!==_0x6827('0x3d')){var _0x375b7b={};_0x375b7b[_0x5b9c12[_0x6827('0x2e')]]={'$like':'%'+_0x2afb9b[_0x6827('0x2f')][_0x6827('0x3a')]+'%'};return _0x375b7b;}})});}_0x365b73=_[_0x6827('0x3b')]({},_0x365b73,_0x2afb9b[_0x6827('0x3e')]);var _0x349048={'where':_0x365b73[_0x6827('0x3c')]};return db[_0x6827('0x3f')][_0x6827('0x1b')](_0x349048)[_0x6827('0x23')](function(_0x2256e1){_0x43300a[_0x6827('0x1b')]=_0x2256e1;if(_0x2afb9b[_0x6827('0x2f')][_0x6827('0x40')]){_0x365b73[_0x6827('0x41')]=[{'all':!![]}];}return db[_0x6827('0x3f')][_0x6827('0x42')](_0x365b73);})[_0x6827('0x23')](function(_0x2bea4a){_0x43300a[_0x6827('0x43')]=_0x2bea4a;return _0x43300a;})[_0x6827('0x23')](respondWithFilteredResult(_0xa378c2,_0x365b73))[_0x6827('0x44')](handleError(_0xa378c2,null));};exports[_0x6827('0x45')]=function(_0x8eb16,_0x41fd04){var _0x9001a6={'raw':!![],'where':{'id':_0x8eb16['params']['id']}},_0x3e78b2={};_0x3e78b2[_0x6827('0x2d')]=_[_0x6827('0x46')](db[_0x6827('0x3f')][_0x6827('0x2a')]);_0x3e78b2[_0x6827('0x2f')]=_[_0x6827('0x46')](_0x8eb16[_0x6827('0x2f')]);_0x3e78b2[_0x6827('0x30')]=_['intersection'](_0x3e78b2[_0x6827('0x2d')],_0x3e78b2[_0x6827('0x2f')]);_0x9001a6[_0x6827('0x33')]=_[_0x6827('0x31')](_0x3e78b2[_0x6827('0x2d')],qs[_0x6827('0x32')](_0x8eb16[_0x6827('0x2f')][_0x6827('0x32')]));_0x9001a6[_0x6827('0x33')]=_0x9001a6['attributes'][_0x6827('0x34')]?_0x9001a6['attributes']:_0x3e78b2[_0x6827('0x2d')];if(_0x8eb16[_0x6827('0x2f')]['includeAll']){_0x9001a6[_0x6827('0x41')]=[{'all':!![]}];}_0x9001a6=_['merge']({},_0x9001a6,_0x8eb16[_0x6827('0x3e')]);return db[_0x6827('0x3f')][_0x6827('0x47')](_0x9001a6)['then'](handleEntityNotFound(_0x41fd04,null))[_0x6827('0x23')](respondWithResult(_0x41fd04,null))[_0x6827('0x44')](handleError(_0x41fd04,null));};exports['create']=function(_0x1aa566,_0x48e862){return db[_0x6827('0x3f')][_0x6827('0x48')](_0x1aa566[_0x6827('0x49')],{})[_0x6827('0x23')](respondWithResult(_0x48e862,0xc9))[_0x6827('0x44')](handleError(_0x48e862,null));};exports['update']=function(_0x18a9b9,_0x222105){if(_0x18a9b9[_0x6827('0x49')]['id']){delete _0x18a9b9[_0x6827('0x49')]['id'];}return db[_0x6827('0x3f')]['find']({'where':{'id':_0x18a9b9[_0x6827('0x4a')]['id']}})['then'](handleEntityNotFound(_0x222105,null))['then'](saveUpdates(_0x18a9b9[_0x6827('0x49')],null))[_0x6827('0x23')](respondWithResult(_0x222105,null))[_0x6827('0x44')](handleError(_0x222105,null));};exports[_0x6827('0x24')]=function(_0x4c058d,_0x3105ee){return db['Dynamics365Field'][_0x6827('0x47')]({'where':{'id':_0x4c058d[_0x6827('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3105ee,null))[_0x6827('0x23')](removeEntity(_0x3105ee,null))['catch'](handleError(_0x3105ee,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 45022f1..5247d8b 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 _0xabd7=['rimraf','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','lodash','util','moment','bluebird','request-promise'];(function(_0x16c9a6,_0x27a0e3){var _0x4d7aad=function(_0x1dd74d){while(--_0x1dd74d){_0x16c9a6['push'](_0x16c9a6['shift']());}};_0x4d7aad(++_0x27a0e3);}(_0xabd7,0x103));var _0x7abd=function(_0x16db87,_0x454dcc){_0x16db87=_0x16db87-0x0;var _0x2725f7=_0xabd7[_0x16db87];return _0x2725f7;};'use strict';var _=require(_0x7abd('0x0'));var util=require(_0x7abd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7abd('0x2'));var BPromise=require(_0x7abd('0x3'));var rp=require(_0x7abd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7abd('0x5'));var config=require('../../config/environment');var attributes=require(_0x7abd('0x6'));module[_0x7abd('0x7')]=function(_0x49a43f,_0x56705f){return _0x49a43f[_0x7abd('0x8')](_0x7abd('0x9'),attributes,{'tableName':_0x7abd('0xa'),'paranoid':![],'indexes':[{'name':_0x7abd('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3eb6=['bluebird','path','../../config/environment','exports','define','Dynamics365Field','dynamics365_unique_index','idField','FieldId','util','../../config/logger','moment'];(function(_0x306982,_0x5e7720){var _0x42f5e6=function(_0xa5fee2){while(--_0xa5fee2){_0x306982['push'](_0x306982['shift']());}};_0x42f5e6(++_0x5e7720);}(_0x3eb6,0x129));var _0x63eb=function(_0x40aaca,_0x4803f4){_0x40aaca=_0x40aaca-0x0;var _0x1252f7=_0x3eb6[_0x40aaca];return _0x1252f7;};'use strict';var _=require('lodash');var util=require(_0x63eb('0x0'));var logger=require(_0x63eb('0x1'))('api');var moment=require(_0x63eb('0x2'));var BPromise=require(_0x63eb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x63eb('0x4'));var rimraf=require('rimraf');var config=require(_0x63eb('0x5'));var attributes=require('./intDynamics365Field.attributes');module[_0x63eb('0x6')]=function(_0x3907b3,_0xa6241){return _0x3907b3[_0x63eb('0x7')](_0x63eb('0x8'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x63eb('0x9'),'fields':[_0x63eb('0xa'),_0x63eb('0xb')],'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 a5e6979..a9c40a0 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 _0xdf55=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','Dynamics365Field,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x801efa,_0x37ce33){var _0x24e5c5=function(_0x4d77d0){while(--_0x4d77d0){_0x801efa['push'](_0x801efa['shift']());}};_0x24e5c5(++_0x37ce33);}(_0xdf55,0x83));var _0x5df5=function(_0x5dafd0,_0x3bcbb6){_0x5dafd0=_0x5dafd0-0x0;var _0x364354=_0xdf55[_0x5dafd0];return _0x364354;};'use strict';var _=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var moment=require('moment');var BPromise=require(_0x5df5('0x2'));var rs=require(_0x5df5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5df5('0x4'))['db'];var utils=require(_0x5df5('0x5'));var logger=require(_0x5df5('0x6'))('rpc');var config=require(_0x5df5('0x7'));var jayson=require(_0x5df5('0x8'));var client=jayson[_0x5df5('0x9')][_0x5df5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9b8756,_0x2b7ed9,_0x4722a2){return new BPromise(function(_0x3743f3,_0x4d43a3){return client[_0x5df5('0xb')](_0x9b8756,_0x4722a2)[_0x5df5('0xc')](function(_0x41941e){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x2b7ed9,_0x5df5('0xd'));logger['debug'](_0x5df5('0xe'),_0x2b7ed9,_0x5df5('0xd'),JSON['stringify'](_0x41941e));if(_0x41941e['error']){if(_0x41941e[_0x5df5('0xf')][_0x5df5('0x10')]===0x1f4){logger[_0x5df5('0xf')](_0x5df5('0x11'),_0x2b7ed9,_0x41941e[_0x5df5('0xf')][_0x5df5('0x12')]);return _0x4d43a3(_0x41941e[_0x5df5('0xf')][_0x5df5('0x12')]);}logger[_0x5df5('0xf')](_0x5df5('0x11'),_0x2b7ed9,_0x41941e['error'][_0x5df5('0x12')]);return _0x3743f3(_0x41941e['error'][_0x5df5('0x12')]);}else{logger[_0x5df5('0x13')](_0x5df5('0x11'),_0x2b7ed9,_0x5df5('0xd'));_0x3743f3(_0x41941e[_0x5df5('0x14')]['message']);}})[_0x5df5('0x15')](function(_0x457205){logger['error'](_0x5df5('0x11'),_0x2b7ed9,_0x457205);_0x4d43a3(_0x457205);});});} \ No newline at end of file +var _0x3e24=['info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x2c2390,_0x37ef1c){var _0x478b7e=function(_0x2ea947){while(--_0x2ea947){_0x2c2390['push'](_0x2c2390['shift']());}};_0x478b7e(++_0x37ef1c);}(_0x3e24,0x167));var _0x43e2=function(_0x5f150e,_0x5e3a1e){_0x5f150e=_0x5f150e-0x0;var _0x2f6957=_0x3e24[_0x5f150e];return _0x2f6957;};'use strict';var _=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var moment=require(_0x43e2('0x2'));var BPromise=require(_0x43e2('0x3'));var rs=require(_0x43e2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43e2('0x5'))['db'];var utils=require(_0x43e2('0x6'));var logger=require('../../config/logger')(_0x43e2('0x7'));var config=require(_0x43e2('0x8'));var jayson=require(_0x43e2('0x9'));var client=jayson[_0x43e2('0xa')][_0x43e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x121e2e,_0x23b2d8,_0x59956d){return new BPromise(function(_0xb75b,_0x2357bc){return client['request'](_0x121e2e,_0x59956d)[_0x43e2('0xc')](function(_0x2fdf85){logger['info'](_0x43e2('0xd'),_0x23b2d8,_0x43e2('0xe'));logger['debug'](_0x43e2('0xf'),_0x23b2d8,'request\x20sent',JSON['stringify'](_0x2fdf85));if(_0x2fdf85['error']){if(_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x11')]===0x1f4){logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);return _0x2357bc(_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);}logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);return _0xb75b(_0x2fdf85['error'][_0x43e2('0x12')]);}else{logger[_0x43e2('0x13')](_0x43e2('0xd'),_0x23b2d8,_0x43e2('0xe'));_0xb75b(_0x2fdf85['result']['message']);}})[_0x43e2('0x14')](function(_0x417ce5){logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x417ce5);_0x2357bc(_0x417ce5);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 9701898..6cfa64a 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 _0xeaa9=['put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','./intFreshdeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post'];(function(_0x6a5a9c,_0x162627){var _0x34d9ed=function(_0x392642){while(--_0x392642){_0x6a5a9c['push'](_0x6a5a9c['shift']());}};_0x34d9ed(++_0x162627);}(_0xeaa9,0x123));var _0x9eaa=function(_0x788ef0,_0x48e2be){_0x788ef0=_0x788ef0-0x0;var _0x1e665c=_0xeaa9[_0x788ef0];return _0x1e665c;};'use strict';var multer=require(_0x9eaa('0x0'));var util=require(_0x9eaa('0x1'));var path=require(_0x9eaa('0x2'));var timeout=require('connect-timeout');var express=require(_0x9eaa('0x3'));var router=express[_0x9eaa('0x4')]();var auth=require(_0x9eaa('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9eaa('0x6'));router[_0x9eaa('0x7')]('/',auth[_0x9eaa('0x8')](),controller['index']);router[_0x9eaa('0x7')](_0x9eaa('0x9'),auth['isAuthenticated'](),controller[_0x9eaa('0xa')]);router[_0x9eaa('0x7')](_0x9eaa('0xb'),auth[_0x9eaa('0x8')](),controller[_0x9eaa('0xc')]);router['get'](_0x9eaa('0xd'),auth['isAuthenticated'](),controller[_0x9eaa('0xe')]);router['post']('/',auth[_0x9eaa('0x8')](),controller[_0x9eaa('0xf')]);router[_0x9eaa('0x10')]('/:id/configurations',auth[_0x9eaa('0x8')](),controller['addConfiguration']);router[_0x9eaa('0x11')](_0x9eaa('0x9'),auth[_0x9eaa('0x8')](),controller[_0x9eaa('0x12')]);router[_0x9eaa('0x13')]('/:id',auth[_0x9eaa('0x8')](),controller[_0x9eaa('0x14')]);module[_0x9eaa('0x15')]=router; \ No newline at end of file +var _0xddf7=['../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','get','show','/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x19ee96,_0x48b7d5){var _0x57aaf0=function(_0x26f332){while(--_0x26f332){_0x19ee96['push'](_0x19ee96['shift']());}};_0x57aaf0(++_0x48b7d5);}(_0xddf7,0xd8));var _0x7ddf=function(_0x102f97,_0x5bda2f){_0x102f97=_0x102f97-0x0;var _0xd22058=_0xddf7[_0x102f97];return _0xd22058;};'use strict';var multer=require(_0x7ddf('0x0'));var util=require('util');var path=require(_0x7ddf('0x1'));var timeout=require(_0x7ddf('0x2'));var express=require(_0x7ddf('0x3'));var router=express['Router']();var auth=require(_0x7ddf('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7ddf('0x5'));var controller=require(_0x7ddf('0x6'));router['get']('/',auth[_0x7ddf('0x7')](),controller['index']);router[_0x7ddf('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x7ddf('0x9')]);router[_0x7ddf('0x8')]('/:id/configurations',auth[_0x7ddf('0x7')](),controller['getConfigurations']);router[_0x7ddf('0x8')](_0x7ddf('0xa'),auth[_0x7ddf('0x7')](),controller[_0x7ddf('0xb')]);router['post']('/',auth[_0x7ddf('0x7')](),controller[_0x7ddf('0xc')]);router[_0x7ddf('0xd')](_0x7ddf('0xe'),auth[_0x7ddf('0x7')](),controller[_0x7ddf('0xf')]);router[_0x7ddf('0x10')](_0x7ddf('0x11'),auth[_0x7ddf('0x7')](),controller[_0x7ddf('0x12')]);router[_0x7ddf('0x13')](_0x7ddf('0x11'),auth[_0x7ddf('0x7')](),controller[_0x7ddf('0x14')]);module[_0x7ddf('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 4774fbd..fa0dd96 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 _0x1280=['username','sequelize','STRING'];(function(_0x2e52eb,_0x4627af){var _0x42ebbe=function(_0x1d19d6){while(--_0x1d19d6){_0x2e52eb['push'](_0x2e52eb['shift']());}};_0x42ebbe(++_0x4627af);}(_0x1280,0xac));var _0x0128=function(_0x2fc5db,_0x2253b1){_0x2fc5db=_0x2fc5db-0x0;var _0x1ef11b=_0x1280[_0x2fc5db];return _0x1ef11b;};'use strict';var Sequelize=require(_0x0128('0x0'));module['exports']={'name':{'type':Sequelize[_0x0128('0x1')]},'description':{'type':Sequelize[_0x0128('0x1')]},'username':{'type':Sequelize[_0x0128('0x1')],'unique':_0x0128('0x2')},'apiKey':{'type':Sequelize[_0x0128('0x1')]},'remoteUri':{'type':Sequelize[_0x0128('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x0128('0x1')]}}; \ No newline at end of file +var _0xe1d7=['username','STRING','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe1d7,0x1a9));var _0x7e1d=function(_0x206ca8,_0x34739a){_0x206ca8=_0x206ca8-0x0;var _0x508d10=_0xe1d7[_0x206ca8];return _0x508d10;};'use strict';var Sequelize=require('sequelize');module[_0x7e1d('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x7e1d('0x1')},'apiKey':{'type':Sequelize[_0x7e1d('0x2')]},'remoteUri':{'type':Sequelize[_0x7e1d('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x7e1d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 39a56f4..9c4ed24 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 _0x94d6=['update','destroy','stack','name','index','FreshdeskAccount','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','then','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshdeskField','remoteUri','apiKey','slice','lastIndexOf','GET','api/v2/ticket_fields','format','Basic\x20%s','%s:X','base64','requester','subject','agent','description','group','ticket_type','custom_text','custom_dropdown','label','default','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','sendStatus','status','end','json','count','offset','limit','set','apply'];(function(_0x4040ae,_0xf55946){var _0x592c3d=function(_0x4b174c){while(--_0x4b174c){_0x4040ae['push'](_0x4040ae['shift']());}};_0x592c3d(++_0xf55946);}(_0x94d6,0x13a));var _0x694d=function(_0x27c542,_0x31c876){_0x27c542=_0x27c542-0x0;var _0x5dccd9=_0x94d6[_0x27c542];return _0x5dccd9;};'use strict';var pdf=require(_0x694d('0x0'));var emlformat=require(_0x694d('0x1'));var rimraf=require(_0x694d('0x2'));var zipdir=require(_0x694d('0x3'));var jsonpatch=require(_0x694d('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x694d('0x5'));var util=require(_0x694d('0x6'));var path=require(_0x694d('0x7'));var sox=require('sox');var csv=require(_0x694d('0x8'));var ejs=require(_0x694d('0x9'));var fs=require('fs');var _=require(_0x694d('0xa'));var squel=require('squel');var crypto=require(_0x694d('0xb'));var jsforce=require(_0x694d('0xc'));var deskjs=require(_0x694d('0xd'));var toCsv=require(_0x694d('0x8'));var querystring=require(_0x694d('0xe'));var Papa=require(_0x694d('0xf'));var Redis=require('ioredis');var authService=require(_0x694d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x694d('0x11'));var hardwareService=require(_0x694d('0x12'));var logger=require(_0x694d('0x13'))(_0x694d('0x14'));var utils=require(_0x694d('0x15'));var config=require(_0x694d('0x16'));var db=require(_0x694d('0x17'))['db'];var integrations=require(_0x694d('0x18'));var jayson=require(_0x694d('0x19'));var client=jayson[_0x694d('0x1a')][_0x694d('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x5aeb02,_0x38db86,_0x5bb975){if(_0x5bb975){var _0x3b4430=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3b4430[_0x694d('0x1c')](_0x38db86)){return _0x5aeb02;}else{throw new db['Sequelize'][(_0x694d('0x1d'))](_0x694d('0x1e'));}}else{return _0x5aeb02;}}function respondWithRpcPromise(_0x4e7147,_0x2266b9,_0x16f26b,_0x2fb4df){return new BPromise(function(_0x59be74,_0x422480){var _0x54724f=_0x2fb4df||client;return _0x54724f['request'](_0x4e7147,_0x16f26b)['then'](function(_0x54f40d){logger[_0x694d('0x1f')](_0x694d('0x20'),_0x2266b9,_0x694d('0x21'));logger[_0x694d('0x22')](_0x694d('0x23'),_0x2266b9,'request\x20sent',JSON['stringify'](_0x54f40d));if(_0x54f40d['error']){if(_0x54f40d['error'][_0x694d('0x24')]===0x1f4){logger[_0x694d('0x25')](_0x694d('0x20'),_0x2266b9,_0x54f40d[_0x694d('0x25')][_0x694d('0x26')]);return _0x422480(_0x54f40d[_0x694d('0x25')][_0x694d('0x26')]);}logger['error'](_0x694d('0x20'),_0x2266b9,_0x54f40d['error'][_0x694d('0x26')]);return _0x59be74(_0x54f40d[_0x694d('0x25')][_0x694d('0x26')]);}else{logger[_0x694d('0x1f')](_0x694d('0x20'),_0x2266b9,'request\x20sent');_0x59be74(_0x54f40d[_0x694d('0x27')][_0x694d('0x26')]);}})['catch'](function(_0x5491dc){logger['error'](_0x694d('0x20'),_0x2266b9,_0x5491dc);_0x422480(_0x5491dc);});});}function respondWithStatusCode(_0x4c431e,_0x4846a0){_0x4846a0=_0x4846a0||0xcc;return function(_0x323ba1){if(_0x323ba1){return _0x4c431e[_0x694d('0x28')](_0x4846a0);}return _0x4c431e[_0x694d('0x29')](_0x4846a0)[_0x694d('0x2a')]();};}function respondWithResult(_0xd8df05,_0x5472b8){_0x5472b8=_0x5472b8||0xc8;return function(_0x2e8290){if(_0x2e8290){return _0xd8df05['status'](_0x5472b8)[_0x694d('0x2b')](_0x2e8290);}};}function respondWithFilteredResult(_0x38ebcb,_0xd79201){return function(_0xa344f){if(_0xa344f){var _0x25c232=_0xa344f[_0x694d('0x2c')],_0x39febd=_0xd79201[_0x694d('0x2d')],_0x1bd29d=_0xd79201[_0x694d('0x2d')]+_0xd79201[_0x694d('0x2e')],_0x2a7141;if(_0x1bd29d>=_0x25c232){_0x1bd29d=_0x25c232;_0x2a7141=0xc8;}else{_0x2a7141=0xce;}_0x38ebcb[_0x694d('0x29')](_0x2a7141);return _0x38ebcb[_0x694d('0x2f')]('Content-Range',_0x39febd+'-'+_0x1bd29d+'/'+_0x25c232)[_0x694d('0x2b')](_0xa344f);}return null;};}function patchUpdates(_0xd66946){return function(_0x36c132){try{jsonpatch[_0x694d('0x30')](_0x36c132,_0xd66946,!![]);}catch(_0x1d555){return BPromise['reject'](_0x1d555);}return _0x36c132['save']();};}function saveUpdates(_0x2cecda,_0x185af8){return function(_0x22778e){if(_0x22778e){return _0x22778e[_0x694d('0x31')](_0x2cecda)['then'](function(_0x3857ad){return _0x3857ad;});}return null;};}function removeEntity(_0x1e8410,_0x4c641a){return function(_0x443987){if(_0x443987){return _0x443987[_0x694d('0x32')]()['then'](function(){_0x1e8410['status'](0xcc)[_0x694d('0x2a')]();});}};}function handleEntityNotFound(_0x2ee453,_0x4d43ca){return function(_0x47bdbe){if(!_0x47bdbe){_0x2ee453['sendStatus'](0x194);}return _0x47bdbe;};}function handleError(_0x37417f,_0x492588){_0x492588=_0x492588||0x1f4;return function(_0x4f3b53){logger[_0x694d('0x25')](_0x4f3b53[_0x694d('0x33')]);if(_0x4f3b53[_0x694d('0x34')]){delete _0x4f3b53[_0x694d('0x34')];}_0x37417f[_0x694d('0x29')](_0x492588)['send'](_0x4f3b53);};}exports[_0x694d('0x35')]=function(_0x4c8ce7,_0x5bda8a){var _0x4d7a96={},_0x27b8e5={},_0x3d4851={'count':0x0,'rows':[]};var _0x20bbd0=_['map'](db[_0x694d('0x36')]['rawAttributes'],function(_0x40d538){return{'name':_0x40d538[_0x694d('0x37')],'type':_0x40d538[_0x694d('0x38')][_0x694d('0x39')]};});_0x27b8e5[_0x694d('0x3a')]=_[_0x694d('0x3b')](_0x20bbd0,'name');_0x27b8e5['query']=_[_0x694d('0x3c')](_0x4c8ce7[_0x694d('0x3d')]);_0x27b8e5[_0x694d('0x3e')]=_[_0x694d('0x3f')](_0x27b8e5[_0x694d('0x3a')],_0x27b8e5[_0x694d('0x3d')]);_0x4d7a96[_0x694d('0x40')]=_[_0x694d('0x3f')](_0x27b8e5[_0x694d('0x3a')],qs[_0x694d('0x41')](_0x4c8ce7['query'][_0x694d('0x41')]));_0x4d7a96[_0x694d('0x40')]=_0x4d7a96[_0x694d('0x40')][_0x694d('0x42')]?_0x4d7a96[_0x694d('0x40')]:_0x27b8e5['model'];if(!_0x4c8ce7[_0x694d('0x3d')][_0x694d('0x43')]('nolimit')){_0x4d7a96[_0x694d('0x2e')]=qs[_0x694d('0x2e')](_0x4c8ce7['query'][_0x694d('0x2e')]);_0x4d7a96[_0x694d('0x2d')]=qs[_0x694d('0x2d')](_0x4c8ce7['query'][_0x694d('0x2d')]);}_0x4d7a96[_0x694d('0x44')]=qs[_0x694d('0x45')](_0x4c8ce7[_0x694d('0x3d')][_0x694d('0x45')]);_0x4d7a96[_0x694d('0x46')]=qs[_0x694d('0x3e')](_[_0x694d('0x47')](_0x4c8ce7['query'],_0x27b8e5[_0x694d('0x3e')]));if(_0x4c8ce7[_0x694d('0x3d')][_0x694d('0x48')]){_0x4d7a96[_0x694d('0x46')]=_[_0x694d('0x49')](_0x4d7a96['where'],{'$or':_[_0x694d('0x3b')](_0x20bbd0,function(_0x1b3a12){if(_0x1b3a12[_0x694d('0x38')]!=='VIRTUAL'){var _0x5997fb={};_0x5997fb[_0x1b3a12[_0x694d('0x34')]]={'$like':'%'+_0x4c8ce7[_0x694d('0x3d')][_0x694d('0x48')]+'%'};return _0x5997fb;}})});}_0x4d7a96=_[_0x694d('0x49')]({},_0x4d7a96,_0x4c8ce7[_0x694d('0x4a')]);var _0x4538e9={'where':_0x4d7a96[_0x694d('0x46')]};return db['FreshdeskAccount'][_0x694d('0x2c')](_0x4538e9)[_0x694d('0x4b')](function(_0x500b43){_0x3d4851['count']=_0x500b43;if(_0x4c8ce7[_0x694d('0x3d')][_0x694d('0x4c')]){_0x4d7a96['include']=[{'all':!![]}];}return db[_0x694d('0x36')][_0x694d('0x4d')](_0x4d7a96);})[_0x694d('0x4b')](function(_0x1972bf){_0x3d4851[_0x694d('0x4e')]=_0x1972bf;return _0x3d4851;})[_0x694d('0x4b')](respondWithFilteredResult(_0x5bda8a,_0x4d7a96))[_0x694d('0x4f')](handleError(_0x5bda8a,null));};exports[_0x694d('0x50')]=function(_0x41cd9f,_0x15b6c6){var _0x2da06a={'raw':![],'where':{'id':_0x41cd9f[_0x694d('0x51')]['id']}},_0x55a982={};_0x55a982[_0x694d('0x3a')]=_[_0x694d('0x3c')](db[_0x694d('0x36')][_0x694d('0x52')]);_0x55a982[_0x694d('0x3d')]=_[_0x694d('0x3c')](_0x41cd9f[_0x694d('0x3d')]);_0x55a982[_0x694d('0x3e')]=_['intersection'](_0x55a982[_0x694d('0x3a')],_0x55a982['query']);_0x2da06a['attributes']=_[_0x694d('0x3f')](_0x55a982[_0x694d('0x3a')],qs['fields'](_0x41cd9f[_0x694d('0x3d')][_0x694d('0x41')]));_0x2da06a[_0x694d('0x40')]=_0x2da06a[_0x694d('0x40')][_0x694d('0x42')]?_0x2da06a[_0x694d('0x40')]:_0x55a982[_0x694d('0x3a')];if(_0x41cd9f[_0x694d('0x3d')][_0x694d('0x4c')]){_0x2da06a[_0x694d('0x53')]=[{'all':!![]}];}_0x2da06a=_[_0x694d('0x49')]({},_0x2da06a,_0x41cd9f[_0x694d('0x4a')]);return db[_0x694d('0x36')][_0x694d('0x54')](_0x2da06a)[_0x694d('0x4b')](handleEntityNotFound(_0x15b6c6,null))[_0x694d('0x4b')](respondWithResult(_0x15b6c6,null))[_0x694d('0x4f')](handleError(_0x15b6c6,null));};exports[_0x694d('0x55')]=function(_0x11df5a,_0x552b61){return db[_0x694d('0x36')]['create'](_0x11df5a['body'],{})[_0x694d('0x4b')](respondWithResult(_0x552b61,0xc9))[_0x694d('0x4f')](handleError(_0x552b61,null));};exports[_0x694d('0x31')]=function(_0x4f161a,_0x41f1ec){if(_0x4f161a[_0x694d('0x56')]['id']){delete _0x4f161a[_0x694d('0x56')]['id'];}return db[_0x694d('0x36')][_0x694d('0x54')]({'where':{'id':_0x4f161a[_0x694d('0x51')]['id']}})[_0x694d('0x4b')](handleEntityNotFound(_0x41f1ec,null))['then'](saveUpdates(_0x4f161a['body'],null))[_0x694d('0x4b')](respondWithResult(_0x41f1ec,null))[_0x694d('0x4f')](handleError(_0x41f1ec,null));};exports[_0x694d('0x32')]=function(_0x368927,_0x27aae4){return db['FreshdeskAccount'][_0x694d('0x54')]({'where':{'id':_0x368927[_0x694d('0x51')]['id']}})[_0x694d('0x4b')](handleEntityNotFound(_0x27aae4,null))[_0x694d('0x4b')](removeEntity(_0x27aae4,null))[_0x694d('0x4f')](handleError(_0x27aae4,null));};exports[_0x694d('0x57')]=function(_0x10bc4a,_0x5b4456,_0x2c0e33){var _0x216195={};var _0x425a04={};var _0xf78b0b;var _0x1990f2;return db[_0x694d('0x36')][_0x694d('0x58')]({'where':{'id':_0x10bc4a[_0x694d('0x51')]['id']}})['then'](handleEntityNotFound(_0x5b4456,null))[_0x694d('0x4b')](function(_0x146d84){if(_0x146d84){_0xf78b0b=_0x146d84;_0x425a04[_0x694d('0x3a')]=_[_0x694d('0x3c')](db[_0x694d('0x59')][_0x694d('0x52')]);_0x425a04[_0x694d('0x3d')]=_[_0x694d('0x3c')](_0x10bc4a[_0x694d('0x3d')]);_0x425a04[_0x694d('0x3e')]=_[_0x694d('0x3f')](_0x425a04[_0x694d('0x3a')],_0x425a04[_0x694d('0x3d')]);_0x216195['attributes']=_['intersection'](_0x425a04[_0x694d('0x3a')],qs[_0x694d('0x41')](_0x10bc4a[_0x694d('0x3d')][_0x694d('0x41')]));_0x216195[_0x694d('0x40')]=_0x216195[_0x694d('0x40')]['length']?_0x216195['attributes']:_0x425a04[_0x694d('0x3a')];_0x216195[_0x694d('0x44')]=qs[_0x694d('0x45')](_0x10bc4a['query'][_0x694d('0x45')]);_0x216195['where']=qs[_0x694d('0x3e')](_[_0x694d('0x47')](_0x10bc4a[_0x694d('0x3d')],_0x425a04['filters']));if(_0x10bc4a[_0x694d('0x3d')]['filter']){_0x216195[_0x694d('0x46')]=_[_0x694d('0x49')](_0x216195[_0x694d('0x46')],{'$or':_[_0x694d('0x3b')](_0x216195[_0x694d('0x40')],function(_0x4976db){var _0x393c24={};_0x393c24[_0x4976db]={'$like':'%'+_0x10bc4a[_0x694d('0x3d')][_0x694d('0x48')]+'%'};return _0x393c24;})});}_0x216195=_['merge']({},_0x216195,_0x10bc4a[_0x694d('0x4a')]);return _0xf78b0b['getConfigurations'](_0x216195);}})[_0x694d('0x4b')](function(_0x4044b1){if(_0x4044b1){_0x1990f2=_0x4044b1['length'];if(!_0x10bc4a[_0x694d('0x3d')][_0x694d('0x43')]('nolimit')){_0x216195['limit']=qs['limit'](_0x10bc4a['query'][_0x694d('0x2e')]);_0x216195['offset']=qs[_0x694d('0x2d')](_0x10bc4a[_0x694d('0x3d')][_0x694d('0x2d')]);}return _0xf78b0b[_0x694d('0x57')](_0x216195);}})[_0x694d('0x4b')](function(_0x36e2cc){if(_0x36e2cc){return _0x36e2cc?{'count':_0x1990f2,'rows':_0x36e2cc}:null;}})[_0x694d('0x4b')](respondWithResult(_0x5b4456,null))[_0x694d('0x4f')](handleError(_0x5b4456,null));};exports['addConfiguration']=function(_0x1321cc,_0x49765e,_0x5a6090){if(_0x1321cc[_0x694d('0x56')]['id']){delete _0x1321cc['body']['id'];}return db[_0x694d('0x36')]['findOne']({'where':{'id':_0x1321cc[_0x694d('0x51')]['id']}})['then'](handleEntityNotFound(_0x49765e,null))[_0x694d('0x4b')](function(_0x4501f6){if(_0x4501f6){_0x1321cc['body'][_0x694d('0x5a')]=_0x4501f6['id'];_0x1321cc[_0x694d('0x56')][_0x694d('0x5b')]=integrations['getSubjects'](_0x1321cc[_0x694d('0x56')][_0x694d('0x5c')],_0x1321cc['body'][_0x694d('0x38')]);_0x1321cc[_0x694d('0x56')][_0x694d('0x5d')]=integrations[_0x694d('0x5e')](_0x1321cc[_0x694d('0x56')][_0x694d('0x5c')],_0x1321cc['body'][_0x694d('0x38')]);return db[_0x694d('0x59')][_0x694d('0x55')](_0x1321cc['body'],{'include':[{'model':db[_0x694d('0x5f')],'as':_0x694d('0x5b')},{'model':db['FreshdeskField'],'as':_0x694d('0x5d')}]});}return null;})[_0x694d('0x4b')](respondWithResult(_0x49765e,null))[_0x694d('0x4f')](handleError(_0x49765e,null));};exports['getFields']=function(_0x7499cf,_0x11dfa4,_0x4149c9){var _0xce610d='';return db[_0x694d('0x36')][_0x694d('0x58')]({'where':{'id':_0x7499cf[_0x694d('0x51')]['id']},'attributes':['id',_0x694d('0x60'),_0x694d('0x61')]})[_0x694d('0x4b')](handleEntityNotFound(_0x11dfa4,null))[_0x694d('0x4b')](function(_0x596131){if(_0x596131){_0xce610d=_0x596131['remoteUri'];var _0x137c96=_0xce610d[_0x694d('0x62')](-0x1);if(_0x137c96==='/'){_0xce610d=_0xce610d['substring'](0x0,_0xce610d[_0x694d('0x63')](_0x137c96));}return rp({'method':_0x694d('0x64'),'uri':util['format']('%s/%s',_0xce610d,_0x694d('0x65')),'headers':{'Authorization':util[_0x694d('0x66')](_0x694d('0x67'),new Buffer(util[_0x694d('0x66')](_0x694d('0x68'),_0x596131[_0x694d('0x61')]))['toString'](_0x694d('0x69')))},'json':!![]});}})['then'](function(_0x2bd122){if(_0x2bd122){var _0x4d9e18=[_0x694d('0x6a'),_0x694d('0x6b'),_0x694d('0x6c'),_0x694d('0x6d'),_0x694d('0x29'),'priority',_0x694d('0x6e'),'source',_0x694d('0x6f'),_0x694d('0x6e'),'company'];_['remove'](_0x2bd122,function(_0x32410e){return _0x4d9e18['includes'](_0x32410e['name'])||!_0x32410e['default']&&_0x32410e[_0x694d('0x38')]!==_0x694d('0x70')&&_0x32410e[_0x694d('0x38')]!==_0x694d('0x71');});return{'count':_0x2bd122[_0x694d('0x42')],'rows':_[_0x694d('0x3b')](_0x2bd122,function(_0x1b75c5){return{'id':_0x1b75c5[_0x694d('0x34')],'name':_0x1b75c5[_0x694d('0x72')],'custom':!_0x1b75c5[_0x694d('0x73')],'options':_0x1b75c5['choices']?_[_0x694d('0x3b')](_0x1b75c5[_0x694d('0x74')],function(_0x4ac2a5){return{'name':_[_0x694d('0x75')](_0x4ac2a5),'value':_0x4ac2a5};}):[]};})};}})[_0x694d('0x4b')](respondWithResult(_0x11dfa4,null))[_0x694d('0x4f')](function(_0x2b236d){var _0x4c5c6c=_0x7499cf['query']['test']?0x1f4:_0x2b236d[_0x694d('0x76')]||0x1f4;logger[_0x694d('0x25')](_0x694d('0x77'),_0x694d('0x78'),_0x4c5c6c,JSON['stringify'](_0x2b236d));delete _0x2b236d['name'];if(_0x4c5c6c===0x191){_0x4c5c6c=0x190;}_0x11dfa4['status'](_0x4c5c6c)['send'](_0x7499cf[_0x694d('0x3d')][_0x694d('0x1c')]?{'message':'Wrong\x20credentials','statusCode':_0x2b236d[_0x694d('0x76')]}:_0x2b236d);});}; \ No newline at end of file +var _0x6a14=['intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','merge','type','VIRTUAL','filter','options','then','includeAll','include','findAll','rows','catch','show','params','create','body','find','findOne','pick','getConfigurations','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','agent','description','priority','group','source','ticket_type','company','remove','includes','default','custom_text','choices','capitalize','statusCode','send','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','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','sendStatus','status','end','json','count','limit','set','Content-Range','apply','update','destroy','stack','name','index','map','FreshdeskAccount','rawAttributes','fieldName','key','model','query','keys','filters'];(function(_0x4a2690,_0xbe270e){var _0x4e7baf=function(_0x3a530c){while(--_0x3a530c){_0x4a2690['push'](_0x4a2690['shift']());}};_0x4e7baf(++_0xbe270e);}(_0x6a14,0x13a));var _0x46a1=function(_0x3ff032,_0x5de4f7){_0x3ff032=_0x3ff032-0x0;var _0x41dbf5=_0x6a14[_0x3ff032];return _0x41dbf5;};'use strict';var pdf=require(_0x46a1('0x0'));var emlformat=require(_0x46a1('0x1'));var rimraf=require(_0x46a1('0x2'));var zipdir=require(_0x46a1('0x3'));var jsonpatch=require(_0x46a1('0x4'));var rp=require(_0x46a1('0x5'));var moment=require(_0x46a1('0x6'));var BPromise=require(_0x46a1('0x7'));var Mustache=require(_0x46a1('0x8'));var util=require('util');var path=require(_0x46a1('0x9'));var sox=require(_0x46a1('0xa'));var csv=require(_0x46a1('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x46a1('0xc'));var squel=require(_0x46a1('0xd'));var crypto=require(_0x46a1('0xe'));var jsforce=require(_0x46a1('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x46a1('0x10'));var Papa=require(_0x46a1('0x11'));var Redis=require('ioredis');var authService=require(_0x46a1('0x12'));var qs=require(_0x46a1('0x13'));var as=require(_0x46a1('0x14'));var hardwareService=require(_0x46a1('0x15'));var logger=require(_0x46a1('0x16'))('api');var utils=require(_0x46a1('0x17'));var config=require('../../config/environment');var db=require(_0x46a1('0x18'))['db'];var integrations=require(_0x46a1('0x19'));var jayson=require(_0x46a1('0x1a'));var client=jayson[_0x46a1('0x1b')][_0x46a1('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x334ac2,_0x1a2493,_0xaaa0f4){if(_0xaaa0f4){var _0x13cb62=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x13cb62[_0x46a1('0x1d')](_0x1a2493)){return _0x334ac2;}else{throw new db[(_0x46a1('0x1e'))]['ValidationError'](_0x46a1('0x1f'));}}else{return _0x334ac2;}}function respondWithRpcPromise(_0x35b88c,_0x161d31,_0x29706b,_0x167082){return new BPromise(function(_0x32acfd,_0x3366a2){var _0x2e2704=_0x167082||client;return _0x2e2704[_0x46a1('0x20')](_0x35b88c,_0x29706b)['then'](function(_0x2c7787){logger['info'](_0x46a1('0x21'),_0x161d31,_0x46a1('0x22'));logger[_0x46a1('0x23')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x161d31,_0x46a1('0x22'),JSON['stringify'](_0x2c7787));if(_0x2c7787[_0x46a1('0x24')]){if(_0x2c7787['error']['code']===0x1f4){logger[_0x46a1('0x24')](_0x46a1('0x21'),_0x161d31,_0x2c7787[_0x46a1('0x24')][_0x46a1('0x25')]);return _0x3366a2(_0x2c7787[_0x46a1('0x24')][_0x46a1('0x25')]);}logger['error'](_0x46a1('0x21'),_0x161d31,_0x2c7787[_0x46a1('0x24')][_0x46a1('0x25')]);return _0x32acfd(_0x2c7787[_0x46a1('0x24')]['message']);}else{logger['info'](_0x46a1('0x21'),_0x161d31,_0x46a1('0x22'));_0x32acfd(_0x2c7787['result'][_0x46a1('0x25')]);}})['catch'](function(_0x38df7e){logger[_0x46a1('0x24')](_0x46a1('0x21'),_0x161d31,_0x38df7e);_0x3366a2(_0x38df7e);});});}function respondWithStatusCode(_0x24f0a5,_0x43e0d9){_0x43e0d9=_0x43e0d9||0xcc;return function(_0x48dee5){if(_0x48dee5){return _0x24f0a5[_0x46a1('0x26')](_0x43e0d9);}return _0x24f0a5[_0x46a1('0x27')](_0x43e0d9)[_0x46a1('0x28')]();};}function respondWithResult(_0x3d216e,_0x179eda){_0x179eda=_0x179eda||0xc8;return function(_0x2c4a6c){if(_0x2c4a6c){return _0x3d216e[_0x46a1('0x27')](_0x179eda)[_0x46a1('0x29')](_0x2c4a6c);}};}function respondWithFilteredResult(_0x3f52b3,_0xaa2612){return function(_0x37ffe8){if(_0x37ffe8){var _0x2f6c12=_0x37ffe8[_0x46a1('0x2a')],_0x382311=_0xaa2612['offset'],_0x3648d4=_0xaa2612['offset']+_0xaa2612[_0x46a1('0x2b')],_0x134f2b;if(_0x3648d4>=_0x2f6c12){_0x3648d4=_0x2f6c12;_0x134f2b=0xc8;}else{_0x134f2b=0xce;}_0x3f52b3[_0x46a1('0x27')](_0x134f2b);return _0x3f52b3[_0x46a1('0x2c')](_0x46a1('0x2d'),_0x382311+'-'+_0x3648d4+'/'+_0x2f6c12)[_0x46a1('0x29')](_0x37ffe8);}return null;};}function patchUpdates(_0x389147){return function(_0x55095d){try{jsonpatch[_0x46a1('0x2e')](_0x55095d,_0x389147,!![]);}catch(_0xc1c251){return BPromise['reject'](_0xc1c251);}return _0x55095d['save']();};}function saveUpdates(_0x38fbb5,_0x18538e){return function(_0x3c51dd){if(_0x3c51dd){return _0x3c51dd[_0x46a1('0x2f')](_0x38fbb5)['then'](function(_0x5054bd){return _0x5054bd;});}return null;};}function removeEntity(_0x41d066,_0x24d32b){return function(_0x2347f4){if(_0x2347f4){return _0x2347f4[_0x46a1('0x30')]()['then'](function(){_0x41d066[_0x46a1('0x27')](0xcc)[_0x46a1('0x28')]();});}};}function handleEntityNotFound(_0x549058,_0x193446){return function(_0x2af20c){if(!_0x2af20c){_0x549058[_0x46a1('0x26')](0x194);}return _0x2af20c;};}function handleError(_0x18f324,_0x2f34ac){_0x2f34ac=_0x2f34ac||0x1f4;return function(_0x34587f){logger[_0x46a1('0x24')](_0x34587f[_0x46a1('0x31')]);if(_0x34587f[_0x46a1('0x32')]){delete _0x34587f[_0x46a1('0x32')];}_0x18f324[_0x46a1('0x27')](_0x2f34ac)['send'](_0x34587f);};}exports[_0x46a1('0x33')]=function(_0x2fb819,_0x3b321b){var _0x25f9ab={},_0x40e260={},_0x107b9d={'count':0x0,'rows':[]};var _0x475196=_[_0x46a1('0x34')](db[_0x46a1('0x35')][_0x46a1('0x36')],function(_0x1c7ddf){return{'name':_0x1c7ddf[_0x46a1('0x37')],'type':_0x1c7ddf['type'][_0x46a1('0x38')]};});_0x40e260[_0x46a1('0x39')]=_[_0x46a1('0x34')](_0x475196,'name');_0x40e260[_0x46a1('0x3a')]=_[_0x46a1('0x3b')](_0x2fb819[_0x46a1('0x3a')]);_0x40e260[_0x46a1('0x3c')]=_[_0x46a1('0x3d')](_0x40e260['model'],_0x40e260['query']);_0x25f9ab['attributes']=_[_0x46a1('0x3d')](_0x40e260['model'],qs[_0x46a1('0x3e')](_0x2fb819[_0x46a1('0x3a')]['fields']));_0x25f9ab[_0x46a1('0x3f')]=_0x25f9ab['attributes'][_0x46a1('0x40')]?_0x25f9ab[_0x46a1('0x3f')]:_0x40e260[_0x46a1('0x39')];if(!_0x2fb819[_0x46a1('0x3a')][_0x46a1('0x41')](_0x46a1('0x42'))){_0x25f9ab['limit']=qs[_0x46a1('0x2b')](_0x2fb819['query']['limit']);_0x25f9ab[_0x46a1('0x43')]=qs[_0x46a1('0x43')](_0x2fb819[_0x46a1('0x3a')][_0x46a1('0x43')]);}_0x25f9ab[_0x46a1('0x44')]=qs['sort'](_0x2fb819[_0x46a1('0x3a')][_0x46a1('0x45')]);_0x25f9ab[_0x46a1('0x46')]=qs[_0x46a1('0x3c')](_['pick'](_0x2fb819[_0x46a1('0x3a')],_0x40e260[_0x46a1('0x3c')]));if(_0x2fb819[_0x46a1('0x3a')]['filter']){_0x25f9ab[_0x46a1('0x46')]=_[_0x46a1('0x47')](_0x25f9ab[_0x46a1('0x46')],{'$or':_[_0x46a1('0x34')](_0x475196,function(_0x3965bc){if(_0x3965bc[_0x46a1('0x48')]!==_0x46a1('0x49')){var _0x34b8db={};_0x34b8db[_0x3965bc[_0x46a1('0x32')]]={'$like':'%'+_0x2fb819[_0x46a1('0x3a')][_0x46a1('0x4a')]+'%'};return _0x34b8db;}})});}_0x25f9ab=_[_0x46a1('0x47')]({},_0x25f9ab,_0x2fb819[_0x46a1('0x4b')]);var _0x573299={'where':_0x25f9ab['where']};return db['FreshdeskAccount'][_0x46a1('0x2a')](_0x573299)[_0x46a1('0x4c')](function(_0xe51028){_0x107b9d['count']=_0xe51028;if(_0x2fb819[_0x46a1('0x3a')][_0x46a1('0x4d')]){_0x25f9ab[_0x46a1('0x4e')]=[{'all':!![]}];}return db[_0x46a1('0x35')][_0x46a1('0x4f')](_0x25f9ab);})[_0x46a1('0x4c')](function(_0x428e2c){_0x107b9d[_0x46a1('0x50')]=_0x428e2c;return _0x107b9d;})[_0x46a1('0x4c')](respondWithFilteredResult(_0x3b321b,_0x25f9ab))[_0x46a1('0x51')](handleError(_0x3b321b,null));};exports[_0x46a1('0x52')]=function(_0x436b12,_0x3d19ce){var _0xbf1511={'raw':![],'where':{'id':_0x436b12[_0x46a1('0x53')]['id']}},_0x31290a={};_0x31290a[_0x46a1('0x39')]=_[_0x46a1('0x3b')](db[_0x46a1('0x35')]['rawAttributes']);_0x31290a[_0x46a1('0x3a')]=_[_0x46a1('0x3b')](_0x436b12[_0x46a1('0x3a')]);_0x31290a[_0x46a1('0x3c')]=_['intersection'](_0x31290a[_0x46a1('0x39')],_0x31290a[_0x46a1('0x3a')]);_0xbf1511[_0x46a1('0x3f')]=_['intersection'](_0x31290a[_0x46a1('0x39')],qs[_0x46a1('0x3e')](_0x436b12[_0x46a1('0x3a')][_0x46a1('0x3e')]));_0xbf1511[_0x46a1('0x3f')]=_0xbf1511[_0x46a1('0x3f')][_0x46a1('0x40')]?_0xbf1511[_0x46a1('0x3f')]:_0x31290a[_0x46a1('0x39')];if(_0x436b12['query'][_0x46a1('0x4d')]){_0xbf1511[_0x46a1('0x4e')]=[{'all':!![]}];}_0xbf1511=_[_0x46a1('0x47')]({},_0xbf1511,_0x436b12['options']);return db['FreshdeskAccount']['find'](_0xbf1511)[_0x46a1('0x4c')](handleEntityNotFound(_0x3d19ce,null))['then'](respondWithResult(_0x3d19ce,null))[_0x46a1('0x51')](handleError(_0x3d19ce,null));};exports[_0x46a1('0x54')]=function(_0x4eb653,_0x349465){return db[_0x46a1('0x35')]['create'](_0x4eb653[_0x46a1('0x55')],{})[_0x46a1('0x4c')](respondWithResult(_0x349465,0xc9))[_0x46a1('0x51')](handleError(_0x349465,null));};exports[_0x46a1('0x2f')]=function(_0x36b18c,_0x28cb47){if(_0x36b18c['body']['id']){delete _0x36b18c['body']['id'];}return db[_0x46a1('0x35')][_0x46a1('0x56')]({'where':{'id':_0x36b18c['params']['id']}})[_0x46a1('0x4c')](handleEntityNotFound(_0x28cb47,null))[_0x46a1('0x4c')](saveUpdates(_0x36b18c[_0x46a1('0x55')],null))[_0x46a1('0x4c')](respondWithResult(_0x28cb47,null))['catch'](handleError(_0x28cb47,null));};exports[_0x46a1('0x30')]=function(_0xef6498,_0x86c757){return db[_0x46a1('0x35')][_0x46a1('0x56')]({'where':{'id':_0xef6498[_0x46a1('0x53')]['id']}})[_0x46a1('0x4c')](handleEntityNotFound(_0x86c757,null))[_0x46a1('0x4c')](removeEntity(_0x86c757,null))['catch'](handleError(_0x86c757,null));};exports['getConfigurations']=function(_0x106f72,_0x1c0c71,_0x472e5){var _0x447485={};var _0x20c78f={};var _0x50c03d;var _0x46b191;return db[_0x46a1('0x35')][_0x46a1('0x57')]({'where':{'id':_0x106f72[_0x46a1('0x53')]['id']}})[_0x46a1('0x4c')](handleEntityNotFound(_0x1c0c71,null))[_0x46a1('0x4c')](function(_0xa6192c){if(_0xa6192c){_0x50c03d=_0xa6192c;_0x20c78f[_0x46a1('0x39')]=_[_0x46a1('0x3b')](db['FreshdeskConfiguration'][_0x46a1('0x36')]);_0x20c78f[_0x46a1('0x3a')]=_[_0x46a1('0x3b')](_0x106f72[_0x46a1('0x3a')]);_0x20c78f[_0x46a1('0x3c')]=_[_0x46a1('0x3d')](_0x20c78f[_0x46a1('0x39')],_0x20c78f[_0x46a1('0x3a')]);_0x447485['attributes']=_[_0x46a1('0x3d')](_0x20c78f[_0x46a1('0x39')],qs[_0x46a1('0x3e')](_0x106f72[_0x46a1('0x3a')]['fields']));_0x447485['attributes']=_0x447485[_0x46a1('0x3f')][_0x46a1('0x40')]?_0x447485[_0x46a1('0x3f')]:_0x20c78f[_0x46a1('0x39')];_0x447485[_0x46a1('0x44')]=qs[_0x46a1('0x45')](_0x106f72['query']['sort']);_0x447485['where']=qs['filters'](_[_0x46a1('0x58')](_0x106f72[_0x46a1('0x3a')],_0x20c78f[_0x46a1('0x3c')]));if(_0x106f72[_0x46a1('0x3a')][_0x46a1('0x4a')]){_0x447485['where']=_[_0x46a1('0x47')](_0x447485[_0x46a1('0x46')],{'$or':_[_0x46a1('0x34')](_0x447485['attributes'],function(_0x4ff311){var _0x29aa89={};_0x29aa89[_0x4ff311]={'$like':'%'+_0x106f72[_0x46a1('0x3a')][_0x46a1('0x4a')]+'%'};return _0x29aa89;})});}_0x447485=_[_0x46a1('0x47')]({},_0x447485,_0x106f72[_0x46a1('0x4b')]);return _0x50c03d[_0x46a1('0x59')](_0x447485);}})['then'](function(_0x249ff4){if(_0x249ff4){_0x46b191=_0x249ff4[_0x46a1('0x40')];if(!_0x106f72[_0x46a1('0x3a')][_0x46a1('0x41')](_0x46a1('0x42'))){_0x447485[_0x46a1('0x2b')]=qs[_0x46a1('0x2b')](_0x106f72['query']['limit']);_0x447485[_0x46a1('0x43')]=qs[_0x46a1('0x43')](_0x106f72[_0x46a1('0x3a')][_0x46a1('0x43')]);}return _0x50c03d['getConfigurations'](_0x447485);}})['then'](function(_0x25374f){if(_0x25374f){return _0x25374f?{'count':_0x46b191,'rows':_0x25374f}:null;}})[_0x46a1('0x4c')](respondWithResult(_0x1c0c71,null))[_0x46a1('0x51')](handleError(_0x1c0c71,null));};exports['addConfiguration']=function(_0x91df10,_0x35fd2b,_0xfdcc2e){if(_0x91df10[_0x46a1('0x55')]['id']){delete _0x91df10[_0x46a1('0x55')]['id'];}return db[_0x46a1('0x35')]['findOne']({'where':{'id':_0x91df10[_0x46a1('0x53')]['id']}})[_0x46a1('0x4c')](handleEntityNotFound(_0x35fd2b,null))['then'](function(_0x176d4b){if(_0x176d4b){_0x91df10[_0x46a1('0x55')][_0x46a1('0x5a')]=_0x176d4b['id'];_0x91df10[_0x46a1('0x55')][_0x46a1('0x5b')]=integrations[_0x46a1('0x5c')](_0x91df10[_0x46a1('0x55')][_0x46a1('0x5d')],_0x91df10[_0x46a1('0x55')][_0x46a1('0x48')]);_0x91df10[_0x46a1('0x55')]['Descriptions']=integrations[_0x46a1('0x5e')](_0x91df10['body'][_0x46a1('0x5d')],_0x91df10['body'][_0x46a1('0x48')]);return db['FreshdeskConfiguration'][_0x46a1('0x54')](_0x91df10['body'],{'include':[{'model':db[_0x46a1('0x5f')],'as':_0x46a1('0x5b')},{'model':db[_0x46a1('0x5f')],'as':_0x46a1('0x60')}]});}return null;})[_0x46a1('0x4c')](respondWithResult(_0x35fd2b,null))[_0x46a1('0x51')](handleError(_0x35fd2b,null));};exports['getFields']=function(_0x48e45a,_0x19f8dc,_0x1be4f0){var _0x4d52ad='';return db[_0x46a1('0x35')][_0x46a1('0x57')]({'where':{'id':_0x48e45a[_0x46a1('0x53')]['id']},'attributes':['id',_0x46a1('0x61'),_0x46a1('0x62')]})[_0x46a1('0x4c')](handleEntityNotFound(_0x19f8dc,null))[_0x46a1('0x4c')](function(_0x31b211){if(_0x31b211){_0x4d52ad=_0x31b211[_0x46a1('0x61')];var _0x424272=_0x4d52ad[_0x46a1('0x63')](-0x1);if(_0x424272==='/'){_0x4d52ad=_0x4d52ad['substring'](0x0,_0x4d52ad[_0x46a1('0x64')](_0x424272));}return rp({'method':_0x46a1('0x65'),'uri':util[_0x46a1('0x66')](_0x46a1('0x67'),_0x4d52ad,_0x46a1('0x68')),'headers':{'Authorization':util[_0x46a1('0x66')](_0x46a1('0x69'),new Buffer(util[_0x46a1('0x66')](_0x46a1('0x6a'),_0x31b211[_0x46a1('0x62')]))[_0x46a1('0x6b')](_0x46a1('0x6c')))},'json':!![]});}})['then'](function(_0xcdcfec){if(_0xcdcfec){var _0x4964de=['requester','subject',_0x46a1('0x6d'),_0x46a1('0x6e'),'status',_0x46a1('0x6f'),_0x46a1('0x70'),_0x46a1('0x71'),_0x46a1('0x72'),_0x46a1('0x70'),_0x46a1('0x73')];_[_0x46a1('0x74')](_0xcdcfec,function(_0xe37a25){return _0x4964de[_0x46a1('0x75')](_0xe37a25[_0x46a1('0x32')])||!_0xe37a25[_0x46a1('0x76')]&&_0xe37a25[_0x46a1('0x48')]!==_0x46a1('0x77')&&_0xe37a25['type']!=='custom_dropdown';});return{'count':_0xcdcfec[_0x46a1('0x40')],'rows':_[_0x46a1('0x34')](_0xcdcfec,function(_0x3ca128){return{'id':_0x3ca128[_0x46a1('0x32')],'name':_0x3ca128['label'],'custom':!_0x3ca128[_0x46a1('0x76')],'options':_0x3ca128['choices']?_[_0x46a1('0x34')](_0x3ca128[_0x46a1('0x78')],function(_0xade2b5){return{'name':_[_0x46a1('0x79')](_0xade2b5),'value':_0xade2b5};}):[]};})};}})[_0x46a1('0x4c')](respondWithResult(_0x19f8dc,null))['catch'](function(_0x360bd6){var _0x151c27=_0x48e45a[_0x46a1('0x3a')]['test']?0x1f4:_0x360bd6[_0x46a1('0x7a')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x151c27,JSON['stringify'](_0x360bd6));delete _0x360bd6[_0x46a1('0x32')];if(_0x151c27===0x191){_0x151c27=0x190;}_0x19f8dc['status'](_0x151c27)[_0x46a1('0x7b')](_0x48e45a['query'][_0x46a1('0x1d')]?{'message':_0x46a1('0x7c'),'statusCode':_0x360bd6[_0x46a1('0x7a')]}:_0x360bd6);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 5de519d..72b28ed 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 _0xf790=['moment','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger'];(function(_0x59d753,_0x33f421){var _0x36369f=function(_0xe45305){while(--_0xe45305){_0x59d753['push'](_0x59d753['shift']());}};_0x36369f(++_0x33f421);}(_0xf790,0xd9));var _0x0f79=function(_0x2cd481,_0x2629ac){_0x2cd481=_0x2cd481-0x0;var _0x5d5a47=_0xf790[_0x2cd481];return _0x5d5a47;};'use strict';var _=require(_0x0f79('0x0'));var util=require(_0x0f79('0x1'));var logger=require(_0x0f79('0x2'))('api');var moment=require(_0x0f79('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f79('0x4'));var rimraf=require(_0x0f79('0x5'));var config=require(_0x0f79('0x6'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x0f79('0x7'));module[_0x0f79('0x8')]=function(_0x10fa81,_0x309a23){return _0x10fa81['define'](_0x0f79('0x9'),attributes,{'tableName':_0x0f79('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x40db=['path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','api','moment','bluebird','request-promise'];(function(_0xd4627b,_0xff27fe){var _0x30e307=function(_0x4d3124){while(--_0x4d3124){_0xd4627b['push'](_0xd4627b['shift']());}};_0x30e307(++_0xff27fe);}(_0x40db,0x1d6));var _0xb40d=function(_0x3c0d18,_0x57ae89){_0x3c0d18=_0x3c0d18-0x0;var _0x1d62ea=_0x40db[_0x3c0d18];return _0x1d62ea;};'use strict';var _=require(_0xb40d('0x0'));var util=require(_0xb40d('0x1'));var logger=require('../../config/logger')(_0xb40d('0x2'));var moment=require(_0xb40d('0x3'));var BPromise=require(_0xb40d('0x4'));var rp=require(_0xb40d('0x5'));var fs=require('fs');var path=require(_0xb40d('0x6'));var rimraf=require(_0xb40d('0x7'));var config=require(_0xb40d('0x8'));var attributes=require(_0xb40d('0x9'));var integrations=require(_0xb40d('0xa'));module['exports']=function(_0x1b4356,_0x11cf62){return _0x1b4356[_0xb40d('0xb')](_0xb40d('0xc'),attributes,{'tableName':_0xb40d('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 ea728dd..7e43176 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 _0x3617=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','include','map','model','attributes','debug','ShowFreshdeskAccount','find','where','lodash','bluebird','randomstring','ioredis'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3617,0x15a));var _0x7361=function(_0x250221,_0x314636){_0x250221=_0x250221-0x0;var _0xa396d2=_0x3617[_0x250221];return _0xa396d2;};'use strict';var _=require(_0x7361('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7361('0x1'));var rs=require(_0x7361('0x2'));var fs=require('fs');var Redis=require(_0x7361('0x3'));var db=require(_0x7361('0x4'))['db'];var utils=require(_0x7361('0x5'));var logger=require('../../config/logger')(_0x7361('0x6'));var config=require(_0x7361('0x7'));var jayson=require(_0x7361('0x8'));var client=jayson['client'][_0x7361('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40ea83,_0x472202,_0x1881c8){return new BPromise(function(_0x4baf90,_0x270d3b){return client[_0x7361('0xa')](_0x40ea83,_0x1881c8)[_0x7361('0xb')](function(_0x231def){logger[_0x7361('0xc')](_0x7361('0xd'),_0x472202,_0x7361('0xe'));logger['debug'](_0x7361('0xf'),_0x472202,_0x7361('0xe'),JSON[_0x7361('0x10')](_0x231def));if(_0x231def[_0x7361('0x11')]){if(_0x231def[_0x7361('0x11')][_0x7361('0x12')]===0x1f4){logger[_0x7361('0x11')](_0x7361('0xd'),_0x472202,_0x231def[_0x7361('0x11')][_0x7361('0x13')]);return _0x270d3b(_0x231def[_0x7361('0x11')][_0x7361('0x13')]);}logger[_0x7361('0x11')](_0x7361('0xd'),_0x472202,_0x231def[_0x7361('0x11')][_0x7361('0x13')]);return _0x4baf90(_0x231def['error'][_0x7361('0x13')]);}else{logger[_0x7361('0xc')](_0x7361('0xd'),_0x472202,_0x7361('0xe'));_0x4baf90(_0x231def[_0x7361('0x14')]['message']);}})[_0x7361('0x15')](function(_0x2e97e9){logger[_0x7361('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x472202,_0x2e97e9);_0x270d3b(_0x2e97e9);});});}exports[_0x7361('0x16')]=function(_0x49a5ad){var _0x43a491=this;return new Promise(function(_0x40d562,_0x24ae4b){return db[_0x7361('0x17')][_0x7361('0x18')]({'raw':_0x49a5ad[_0x7361('0x19')]?_0x49a5ad[_0x7361('0x19')][_0x7361('0x1a')]===undefined?!![]:![]:!![],'where':_0x49a5ad['options']?_0x49a5ad[_0x7361('0x19')]['where']||null:null,'attributes':_0x49a5ad[_0x7361('0x19')]?_0x49a5ad[_0x7361('0x19')]['attributes']||null:null,'limit':_0x49a5ad['options']?_0x49a5ad['options']['limit']||null:null,'include':_0x49a5ad[_0x7361('0x19')]?_0x49a5ad[_0x7361('0x19')][_0x7361('0x1b')]?_[_0x7361('0x1c')](_0x49a5ad[_0x7361('0x19')][_0x7361('0x1b')],function(_0x3a9882){return{'model':db[_0x3a9882[_0x7361('0x1d')]],'as':_0x3a9882['as'],'attributes':_0x3a9882['attributes'],'include':_0x3a9882['include']?_[_0x7361('0x1c')](_0x3a9882['include'],function(_0x3b1284){return{'model':db[_0x3b1284['model']],'as':_0x3b1284['as'],'attributes':_0x3b1284[_0x7361('0x1e')],'include':_0x3b1284[_0x7361('0x1b')]?_['map'](_0x3b1284[_0x7361('0x1b')],function(_0x5dd855){return{'model':db[_0x5dd855[_0x7361('0x1d')]],'as':_0x5dd855['as'],'attributes':_0x5dd855['attributes']};}):[]};}):[]};}):[]:[]})[_0x7361('0xb')](function(_0x2cb3c7){logger[_0x7361('0xc')](_0x7361('0x16'),_0x49a5ad);logger[_0x7361('0x1f')](_0x7361('0x16'),_0x49a5ad,JSON['stringify'](_0x2cb3c7));_0x40d562(_0x2cb3c7);})['catch'](function(_0x5a8d78){logger[_0x7361('0x11')](_0x7361('0x16'),_0x5a8d78['message'],_0x49a5ad);_0x24ae4b(_0x43a491[_0x7361('0x11')](0x1f4,_0x5a8d78[_0x7361('0x13')]));});});};exports[_0x7361('0x20')]=function(_0x254674){var _0x5eae51=this;return new Promise(function(_0xe813f5,_0x5bb981){return db[_0x7361('0x17')][_0x7361('0x21')]({'raw':_0x254674[_0x7361('0x19')]?_0x254674[_0x7361('0x19')][_0x7361('0x1a')]===undefined?!![]:![]:!![],'where':_0x254674[_0x7361('0x19')]?_0x254674[_0x7361('0x19')][_0x7361('0x22')]||null:null,'attributes':_0x254674[_0x7361('0x19')]?_0x254674[_0x7361('0x19')][_0x7361('0x1e')]||null:null,'include':_0x254674[_0x7361('0x19')]?_0x254674['options'][_0x7361('0x1b')]?_['map'](_0x254674['options'][_0x7361('0x1b')],function(_0x2e0fd8){return{'model':db[_0x2e0fd8[_0x7361('0x1d')]],'as':_0x2e0fd8['as'],'attributes':_0x2e0fd8[_0x7361('0x1e')],'include':_0x2e0fd8['include']?_[_0x7361('0x1c')](_0x2e0fd8[_0x7361('0x1b')],function(_0x58a279){return{'model':db[_0x58a279[_0x7361('0x1d')]],'as':_0x58a279['as'],'attributes':_0x58a279[_0x7361('0x1e')],'include':_0x58a279[_0x7361('0x1b')]?_[_0x7361('0x1c')](_0x58a279['include'],function(_0x300d2f){return{'model':db[_0x300d2f[_0x7361('0x1d')]],'as':_0x300d2f['as'],'attributes':_0x300d2f['attributes']};}):[]};}):[]};}):[]:[]})[_0x7361('0xb')](function(_0x12e3cb){logger[_0x7361('0xc')]('ShowFreshdeskAccount',_0x254674);logger[_0x7361('0x1f')]('ShowFreshdeskAccount',_0x254674,JSON[_0x7361('0x10')](_0x12e3cb));_0xe813f5(_0x12e3cb);})[_0x7361('0x15')](function(_0x69048d){logger['error'](_0x7361('0x20'),_0x69048d[_0x7361('0x13')],_0x254674);_0x5bb981(_0x5eae51[_0x7361('0x11')](0x1f4,_0x69048d[_0x7361('0x13')]));});});}; \ No newline at end of file +var _0xcf88=['FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFreshdeskAccount','options','raw','where','limit','include','map','model','attributes','ShowFreshdeskAccount','FreshdeskAccount','find','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0xcf88,0x1a1));var _0x8cf8=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xcf88[_0x13b02f];return _0x12e9a6;};'use strict';var _=require('lodash');var util=require(_0x8cf8('0x0'));var moment=require(_0x8cf8('0x1'));var BPromise=require('bluebird');var rs=require(_0x8cf8('0x2'));var fs=require('fs');var Redis=require(_0x8cf8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8cf8('0x4'));var logger=require(_0x8cf8('0x5'))(_0x8cf8('0x6'));var config=require(_0x8cf8('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8cf8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3b3d42,_0x44197d,_0x17fde8){return new BPromise(function(_0x2871ea,_0x16ed30){return client[_0x8cf8('0x9')](_0x3b3d42,_0x17fde8)[_0x8cf8('0xa')](function(_0x4e8b7f){logger[_0x8cf8('0xb')](_0x8cf8('0xc'),_0x44197d,_0x8cf8('0xd'));logger[_0x8cf8('0xe')](_0x8cf8('0xf'),_0x44197d,_0x8cf8('0xd'),JSON[_0x8cf8('0x10')](_0x4e8b7f));if(_0x4e8b7f[_0x8cf8('0x11')]){if(_0x4e8b7f[_0x8cf8('0x11')]['code']===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x44197d,_0x4e8b7f['error'][_0x8cf8('0x12')]);return _0x16ed30(_0x4e8b7f['error']['message']);}logger[_0x8cf8('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x44197d,_0x4e8b7f[_0x8cf8('0x11')]['message']);return _0x2871ea(_0x4e8b7f[_0x8cf8('0x11')][_0x8cf8('0x12')]);}else{logger[_0x8cf8('0xb')](_0x8cf8('0xc'),_0x44197d,_0x8cf8('0xd'));_0x2871ea(_0x4e8b7f[_0x8cf8('0x13')][_0x8cf8('0x12')]);}})[_0x8cf8('0x14')](function(_0x5068f5){logger[_0x8cf8('0x11')](_0x8cf8('0xc'),_0x44197d,_0x5068f5);_0x16ed30(_0x5068f5);});});}exports[_0x8cf8('0x15')]=function(_0x62d869){var _0x21f8c7=this;return new Promise(function(_0x137120,_0xa7d5b1){return db['FreshdeskAccount']['findAll']({'raw':_0x62d869['options']?_0x62d869[_0x8cf8('0x16')][_0x8cf8('0x17')]===undefined?!![]:![]:!![],'where':_0x62d869[_0x8cf8('0x16')]?_0x62d869[_0x8cf8('0x16')][_0x8cf8('0x18')]||null:null,'attributes':_0x62d869['options']?_0x62d869[_0x8cf8('0x16')]['attributes']||null:null,'limit':_0x62d869[_0x8cf8('0x16')]?_0x62d869[_0x8cf8('0x16')][_0x8cf8('0x19')]||null:null,'include':_0x62d869['options']?_0x62d869[_0x8cf8('0x16')][_0x8cf8('0x1a')]?_[_0x8cf8('0x1b')](_0x62d869[_0x8cf8('0x16')][_0x8cf8('0x1a')],function(_0x37dc95){return{'model':db[_0x37dc95[_0x8cf8('0x1c')]],'as':_0x37dc95['as'],'attributes':_0x37dc95[_0x8cf8('0x1d')],'include':_0x37dc95[_0x8cf8('0x1a')]?_[_0x8cf8('0x1b')](_0x37dc95[_0x8cf8('0x1a')],function(_0x55ca19){return{'model':db[_0x55ca19[_0x8cf8('0x1c')]],'as':_0x55ca19['as'],'attributes':_0x55ca19[_0x8cf8('0x1d')],'include':_0x55ca19[_0x8cf8('0x1a')]?_[_0x8cf8('0x1b')](_0x55ca19[_0x8cf8('0x1a')],function(_0x153410){return{'model':db[_0x153410[_0x8cf8('0x1c')]],'as':_0x153410['as'],'attributes':_0x153410[_0x8cf8('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59cbbc){logger['info'](_0x8cf8('0x15'),_0x62d869);logger[_0x8cf8('0xe')](_0x8cf8('0x15'),_0x62d869,JSON[_0x8cf8('0x10')](_0x59cbbc));_0x137120(_0x59cbbc);})['catch'](function(_0xe0367){logger[_0x8cf8('0x11')](_0x8cf8('0x15'),_0xe0367[_0x8cf8('0x12')],_0x62d869);_0xa7d5b1(_0x21f8c7['error'](0x1f4,_0xe0367[_0x8cf8('0x12')]));});});};exports[_0x8cf8('0x1e')]=function(_0x778bd6){var _0x2f2ea1=this;return new Promise(function(_0x5f42de,_0x1b23c0){return db[_0x8cf8('0x1f')][_0x8cf8('0x20')]({'raw':_0x778bd6[_0x8cf8('0x16')]?_0x778bd6['options'][_0x8cf8('0x17')]===undefined?!![]:![]:!![],'where':_0x778bd6[_0x8cf8('0x16')]?_0x778bd6[_0x8cf8('0x16')][_0x8cf8('0x18')]||null:null,'attributes':_0x778bd6[_0x8cf8('0x16')]?_0x778bd6['options'][_0x8cf8('0x1d')]||null:null,'include':_0x778bd6[_0x8cf8('0x16')]?_0x778bd6[_0x8cf8('0x16')][_0x8cf8('0x1a')]?_[_0x8cf8('0x1b')](_0x778bd6[_0x8cf8('0x16')][_0x8cf8('0x1a')],function(_0x194e33){return{'model':db[_0x194e33[_0x8cf8('0x1c')]],'as':_0x194e33['as'],'attributes':_0x194e33[_0x8cf8('0x1d')],'include':_0x194e33[_0x8cf8('0x1a')]?_[_0x8cf8('0x1b')](_0x194e33['include'],function(_0x10eb49){return{'model':db[_0x10eb49[_0x8cf8('0x1c')]],'as':_0x10eb49['as'],'attributes':_0x10eb49['attributes'],'include':_0x10eb49[_0x8cf8('0x1a')]?_[_0x8cf8('0x1b')](_0x10eb49[_0x8cf8('0x1a')],function(_0xae6467){return{'model':db[_0xae6467[_0x8cf8('0x1c')]],'as':_0xae6467['as'],'attributes':_0xae6467['attributes']};}):[]};}):[]};}):[]:[]})[_0x8cf8('0xa')](function(_0x5bcffb){logger['info'](_0x8cf8('0x1e'),_0x778bd6);logger[_0x8cf8('0xe')](_0x8cf8('0x1e'),_0x778bd6,JSON[_0x8cf8('0x10')](_0x5bcffb));_0x5f42de(_0x5bcffb);})['catch'](function(_0x449bfa){logger['error'](_0x8cf8('0x1e'),_0x449bfa[_0x8cf8('0x12')],_0x778bd6);_0x1b23c0(_0x2f2ea1[_0x8cf8('0x11')](0x1f4,_0x449bfa['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index ae175df..bf2c69f 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 _0xb4c9=['show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','destroy','exports','util','express','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x5a469e,_0x58be73){var _0x243c35=function(_0x4696c6){while(--_0x4696c6){_0x5a469e['push'](_0x5a469e['shift']());}};_0x243c35(++_0x58be73);}(_0xb4c9,0xbf));var _0x9b4c=function(_0x4c69b7,_0x2fadb3){_0x4c69b7=_0x4c69b7-0x0;var _0xcdd243=_0xb4c9[_0x4c69b7];return _0xcdd243;};'use strict';var multer=require('multer');var util=require(_0x9b4c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9b4c('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x9b4c('0x2'));var config=require(_0x9b4c('0x3'));var controller=require(_0x9b4c('0x4'));router[_0x9b4c('0x5')]('/',auth[_0x9b4c('0x6')](),controller[_0x9b4c('0x7')]);router[_0x9b4c('0x5')](_0x9b4c('0x8'),auth[_0x9b4c('0x6')](),controller[_0x9b4c('0x9')]);router[_0x9b4c('0x5')](_0x9b4c('0xa'),auth[_0x9b4c('0x6')](),controller['getFields']);router[_0x9b4c('0x5')](_0x9b4c('0xb'),auth[_0x9b4c('0x6')](),controller[_0x9b4c('0xc')]);router[_0x9b4c('0x5')](_0x9b4c('0xd'),auth[_0x9b4c('0x6')](),controller[_0x9b4c('0xe')]);router[_0x9b4c('0x5')](_0x9b4c('0xf'),auth['isAuthenticated'](),controller[_0x9b4c('0x10')]);router[_0x9b4c('0x11')]('/',auth['isAuthenticated'](),controller[_0x9b4c('0x12')]);router['post'](_0x9b4c('0xf'),auth['isAuthenticated'](),controller[_0x9b4c('0x13')]);router[_0x9b4c('0x14')](_0x9b4c('0x8'),auth[_0x9b4c('0x6')](),controller[_0x9b4c('0x15')]);router[_0x9b4c('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x9b4c('0x17')]);module[_0x9b4c('0x18')]=router; \ No newline at end of file +var _0xbffb=['create','setTags','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post'];(function(_0x5a67b6,_0x4b8084){var _0x55b9e2=function(_0x298dad){while(--_0x298dad){_0x5a67b6['push'](_0x5a67b6['shift']());}};_0x55b9e2(++_0x4b8084);}(_0xbffb,0x149));var _0xbbff=function(_0x289912,_0x1296a9){_0x289912=_0x289912-0x0;var _0x31d2af=_0xbffb[_0x289912];return _0x31d2af;};'use strict';var multer=require(_0xbbff('0x0'));var util=require(_0xbbff('0x1'));var path=require(_0xbbff('0x2'));var timeout=require(_0xbbff('0x3'));var express=require('express');var router=express[_0xbbff('0x4')]();var auth=require(_0xbbff('0x5'));var interaction=require(_0xbbff('0x6'));var config=require(_0xbbff('0x7'));var controller=require(_0xbbff('0x8'));router[_0xbbff('0x9')]('/',auth[_0xbbff('0xa')](),controller[_0xbbff('0xb')]);router[_0xbbff('0x9')](_0xbbff('0xc'),auth[_0xbbff('0xa')](),controller[_0xbbff('0xd')]);router[_0xbbff('0x9')](_0xbbff('0xe'),auth[_0xbbff('0xa')](),controller[_0xbbff('0xf')]);router[_0xbbff('0x9')](_0xbbff('0x10'),auth[_0xbbff('0xa')](),controller['getSubjects']);router[_0xbbff('0x9')](_0xbbff('0x11'),auth[_0xbbff('0xa')](),controller[_0xbbff('0x12')]);router[_0xbbff('0x9')](_0xbbff('0x13'),auth[_0xbbff('0xa')](),controller[_0xbbff('0x14')]);router[_0xbbff('0x15')]('/',auth[_0xbbff('0xa')](),controller[_0xbbff('0x16')]);router['post']('/:id/tags',auth[_0xbbff('0xa')](),controller[_0xbbff('0x17')]);router['put'](_0xbbff('0xc'),auth[_0xbbff('0xa')](),controller['update']);router[_0xbbff('0x18')](_0xbbff('0xc'),auth[_0xbbff('0xa')](),controller[_0xbbff('0x19')]);module[_0xbbff('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index aaebfa2..d1a5ce3 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 _0xd5ff=['sequelize','STRING'];(function(_0x4513fb,_0x400f2b){var _0x18a8c9=function(_0xce95ac){while(--_0xce95ac){_0x4513fb['push'](_0x4513fb['shift']());}};_0x18a8c9(++_0x400f2b);}(_0xd5ff,0x12a));var _0xfd5f=function(_0x1ce603,_0x962f0b){_0x1ce603=_0x1ce603-0x0;var _0x12d3b5=_0xd5ff[_0x1ce603];return _0x12d3b5;};'use strict';var Sequelize=require(_0xfd5f('0x0'));module['exports']={'name':{'type':Sequelize[_0xfd5f('0x1')]},'description':{'type':Sequelize[_0xfd5f('0x1')]}}; \ No newline at end of file +var _0xbc25=['exports','STRING','sequelize'];(function(_0x19896e,_0x2ae7c4){var _0x49533d=function(_0x516906){while(--_0x516906){_0x19896e['push'](_0x19896e['shift']());}};_0x49533d(++_0x2ae7c4);}(_0xbc25,0x18e));var _0x5bc2=function(_0x1daeaa,_0x102077){_0x1daeaa=_0x1daeaa-0x0;var _0x21e49e=_0xbc25[_0x1daeaa];return _0x21e49e;};'use strict';var Sequelize=require(_0x5bc2('0x0'));module[_0x5bc2('0x1')]={'name':{'type':Sequelize[_0x5bc2('0x2')]},'description':{'type':Sequelize[_0x5bc2('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index d9b95e8..cc8360a 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 _0xd96d=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','offset','set','Content-Range','apply','reject','save','destroy','name','send','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','count','include','findAll','rows','show','params','keys','includeAll','find','create','update','body','getFields','findOne','FreshdeskField','filter','hasOwnProperty','limit','getSubjects','getDescriptions','getTags','Tag','ids','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','../../components/auth/service'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xd96d,0x160));var _0xdd96=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xd96d[_0x3635ce];return _0x97ecd0;};'use strict';var pdf=require(_0xdd96('0x0'));var emlformat=require(_0xdd96('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdd96('0x2'));var rp=require(_0xdd96('0x3'));var moment=require(_0xdd96('0x4'));var BPromise=require(_0xdd96('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xdd96('0x6'));var csv=require(_0xdd96('0x7'));var ejs=require(_0xdd96('0x8'));var fs=require('fs');var _=require(_0xdd96('0x9'));var squel=require(_0xdd96('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdd96('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdd96('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0xdd96('0xc'));var hardwareService=require(_0xdd96('0xd'));var logger=require('../../config/logger')(_0xdd96('0xe'));var utils=require(_0xdd96('0xf'));var config=require(_0xdd96('0x10'));var db=require(_0xdd96('0x11'))['db'];var jayson=require(_0xdd96('0x12'));var client=jayson[_0xdd96('0x13')][_0xdd96('0x14')]({'port':0x232a});function checkPasswordPattern(_0x53cc12,_0x2a8615,_0x18d76d){if(_0x18d76d){var _0x16e8e8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x16e8e8[_0xdd96('0x15')](_0x2a8615)){return _0x53cc12;}else{throw new db['Sequelize'][(_0xdd96('0x16'))](_0xdd96('0x17'));}}else{return _0x53cc12;}}function respondWithRpcPromise(_0x302d8c,_0x3b7cab,_0x55c670,_0x34d43a){return new BPromise(function(_0x2138b5,_0x1a477b){var _0x457fca=_0x34d43a||client;return _0x457fca['request'](_0x302d8c,_0x55c670)[_0xdd96('0x18')](function(_0x40a152){logger[_0xdd96('0x19')](_0xdd96('0x1a'),_0x3b7cab,_0xdd96('0x1b'));logger[_0xdd96('0x1c')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x3b7cab,_0xdd96('0x1b'),JSON[_0xdd96('0x1d')](_0x40a152));if(_0x40a152[_0xdd96('0x1e')]){if(_0x40a152['error'][_0xdd96('0x1f')]===0x1f4){logger[_0xdd96('0x1e')](_0xdd96('0x1a'),_0x3b7cab,_0x40a152['error']['message']);return _0x1a477b(_0x40a152[_0xdd96('0x1e')][_0xdd96('0x20')]);}logger[_0xdd96('0x1e')](_0xdd96('0x1a'),_0x3b7cab,_0x40a152[_0xdd96('0x1e')]['message']);return _0x2138b5(_0x40a152[_0xdd96('0x1e')][_0xdd96('0x20')]);}else{logger[_0xdd96('0x19')](_0xdd96('0x1a'),_0x3b7cab,'request\x20sent');_0x2138b5(_0x40a152[_0xdd96('0x21')][_0xdd96('0x20')]);}})[_0xdd96('0x22')](function(_0x3ef795){logger[_0xdd96('0x1e')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3b7cab,_0x3ef795);_0x1a477b(_0x3ef795);});});}function respondWithStatusCode(_0x319844,_0x5713d0){_0x5713d0=_0x5713d0||0xcc;return function(_0x5f04d){if(_0x5f04d){return _0x319844[_0xdd96('0x23')](_0x5713d0);}return _0x319844[_0xdd96('0x24')](_0x5713d0)[_0xdd96('0x25')]();};}function respondWithResult(_0xe41762,_0x21398d){_0x21398d=_0x21398d||0xc8;return function(_0x5f080f){if(_0x5f080f){return _0xe41762['status'](_0x21398d)['json'](_0x5f080f);}};}function respondWithFilteredResult(_0x23b1aa,_0x557688){return function(_0x446d8a){if(_0x446d8a){var _0x29d684=_0x446d8a['count'],_0x29aac0=_0x557688[_0xdd96('0x26')],_0x39f129=_0x557688[_0xdd96('0x26')]+_0x557688['limit'],_0x167d34;if(_0x39f129>=_0x29d684){_0x39f129=_0x29d684;_0x167d34=0xc8;}else{_0x167d34=0xce;}_0x23b1aa['status'](_0x167d34);return _0x23b1aa[_0xdd96('0x27')](_0xdd96('0x28'),_0x29aac0+'-'+_0x39f129+'/'+_0x29d684)['json'](_0x446d8a);}return null;};}function patchUpdates(_0x5549bb){return function(_0x37b92a){try{jsonpatch[_0xdd96('0x29')](_0x37b92a,_0x5549bb,!![]);}catch(_0x5e8f18){return BPromise[_0xdd96('0x2a')](_0x5e8f18);}return _0x37b92a[_0xdd96('0x2b')]();};}function saveUpdates(_0x3d229b,_0x564edd){return function(_0x18eaeb){if(_0x18eaeb){return _0x18eaeb['update'](_0x3d229b)['then'](function(_0x31d9eb){return _0x31d9eb;});}return null;};}function removeEntity(_0x4ac11e,_0x4f551a){return function(_0xe663fc){if(_0xe663fc){return _0xe663fc[_0xdd96('0x2c')]()[_0xdd96('0x18')](function(){_0x4ac11e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a5610,_0x128009){return function(_0x2fcce6){if(!_0x2fcce6){_0x2a5610[_0xdd96('0x23')](0x194);}return _0x2fcce6;};}function handleError(_0x38aa38,_0x19a2fe){_0x19a2fe=_0x19a2fe||0x1f4;return function(_0x1072aa){logger[_0xdd96('0x1e')](_0x1072aa['stack']);if(_0x1072aa['name']){delete _0x1072aa[_0xdd96('0x2d')];}_0x38aa38[_0xdd96('0x24')](_0x19a2fe)[_0xdd96('0x2e')](_0x1072aa);};}exports['index']=function(_0x4901e9,_0xc62aac){var _0x55d8e2={},_0x222014={},_0x18ade8={'count':0x0,'rows':[]};var _0x265ce1=_['map'](db[_0xdd96('0x2f')][_0xdd96('0x30')],function(_0x2f7a5f){return{'name':_0x2f7a5f[_0xdd96('0x31')],'type':_0x2f7a5f[_0xdd96('0x32')][_0xdd96('0x33')]};});_0x222014[_0xdd96('0x34')]=_[_0xdd96('0x35')](_0x265ce1,_0xdd96('0x2d'));_0x222014['query']=_['keys'](_0x4901e9[_0xdd96('0x36')]);_0x222014['filters']=_[_0xdd96('0x37')](_0x222014[_0xdd96('0x34')],_0x222014[_0xdd96('0x36')]);_0x55d8e2['attributes']=_['intersection'](_0x222014[_0xdd96('0x34')],qs[_0xdd96('0x38')](_0x4901e9[_0xdd96('0x36')][_0xdd96('0x38')]));_0x55d8e2[_0xdd96('0x39')]=_0x55d8e2[_0xdd96('0x39')][_0xdd96('0x3a')]?_0x55d8e2['attributes']:_0x222014[_0xdd96('0x34')];if(!_0x4901e9[_0xdd96('0x36')]['hasOwnProperty'](_0xdd96('0x3b'))){_0x55d8e2['limit']=qs['limit'](_0x4901e9[_0xdd96('0x36')]['limit']);_0x55d8e2[_0xdd96('0x26')]=qs['offset'](_0x4901e9[_0xdd96('0x36')]['offset']);}_0x55d8e2[_0xdd96('0x3c')]=qs[_0xdd96('0x3d')](_0x4901e9[_0xdd96('0x36')][_0xdd96('0x3d')]);_0x55d8e2[_0xdd96('0x3e')]=qs[_0xdd96('0x3f')](_[_0xdd96('0x40')](_0x4901e9[_0xdd96('0x36')],_0x222014[_0xdd96('0x3f')]));if(_0x4901e9[_0xdd96('0x36')]['filter']){_0x55d8e2[_0xdd96('0x3e')]=_[_0xdd96('0x41')](_0x55d8e2['where'],{'$or':_[_0xdd96('0x35')](_0x265ce1,function(_0x330f6a){if(_0x330f6a[_0xdd96('0x32')]!==_0xdd96('0x42')){var _0x17860d={};_0x17860d[_0x330f6a[_0xdd96('0x2d')]]={'$like':'%'+_0x4901e9[_0xdd96('0x36')]['filter']+'%'};return _0x17860d;}})});}_0x55d8e2=_[_0xdd96('0x41')]({},_0x55d8e2,_0x4901e9[_0xdd96('0x43')]);var _0xf0638b={'where':_0x55d8e2[_0xdd96('0x3e')]};return db[_0xdd96('0x2f')][_0xdd96('0x44')](_0xf0638b)[_0xdd96('0x18')](function(_0x88425e){_0x18ade8[_0xdd96('0x44')]=_0x88425e;if(_0x4901e9[_0xdd96('0x36')]['includeAll']){_0x55d8e2[_0xdd96('0x45')]=[{'all':!![]}];}return db[_0xdd96('0x2f')][_0xdd96('0x46')](_0x55d8e2);})[_0xdd96('0x18')](function(_0x270b26){_0x18ade8[_0xdd96('0x47')]=_0x270b26;return _0x18ade8;})[_0xdd96('0x18')](respondWithFilteredResult(_0xc62aac,_0x55d8e2))['catch'](handleError(_0xc62aac,null));};exports[_0xdd96('0x48')]=function(_0x783196,_0x5c8bd5){var _0x1f62b5={'raw':![],'where':{'id':_0x783196[_0xdd96('0x49')]['id']}},_0x119284={};_0x119284[_0xdd96('0x34')]=_['keys'](db['FreshdeskConfiguration'][_0xdd96('0x30')]);_0x119284[_0xdd96('0x36')]=_[_0xdd96('0x4a')](_0x783196['query']);_0x119284[_0xdd96('0x3f')]=_[_0xdd96('0x37')](_0x119284[_0xdd96('0x34')],_0x119284[_0xdd96('0x36')]);_0x1f62b5[_0xdd96('0x39')]=_[_0xdd96('0x37')](_0x119284[_0xdd96('0x34')],qs['fields'](_0x783196['query']['fields']));_0x1f62b5[_0xdd96('0x39')]=_0x1f62b5[_0xdd96('0x39')][_0xdd96('0x3a')]?_0x1f62b5[_0xdd96('0x39')]:_0x119284[_0xdd96('0x34')];if(_0x783196[_0xdd96('0x36')][_0xdd96('0x4b')]){_0x1f62b5[_0xdd96('0x45')]=[{'all':!![]}];}_0x1f62b5=_[_0xdd96('0x41')]({},_0x1f62b5,_0x783196[_0xdd96('0x43')]);return db['FreshdeskConfiguration'][_0xdd96('0x4c')](_0x1f62b5)[_0xdd96('0x18')](handleEntityNotFound(_0x5c8bd5,null))[_0xdd96('0x18')](respondWithResult(_0x5c8bd5,null))[_0xdd96('0x22')](handleError(_0x5c8bd5,null));};exports['create']=function(_0x143f69,_0x111696){return db[_0xdd96('0x2f')][_0xdd96('0x4d')](_0x143f69['body'],{})[_0xdd96('0x18')](respondWithResult(_0x111696,0xc9))['catch'](handleError(_0x111696,null));};exports[_0xdd96('0x4e')]=function(_0x806b5f,_0x597662){if(_0x806b5f[_0xdd96('0x4f')]['id']){delete _0x806b5f[_0xdd96('0x4f')]['id'];}return db[_0xdd96('0x2f')]['find']({'where':{'id':_0x806b5f[_0xdd96('0x49')]['id']}})[_0xdd96('0x18')](handleEntityNotFound(_0x597662,null))[_0xdd96('0x18')](saveUpdates(_0x806b5f['body'],null))[_0xdd96('0x18')](respondWithResult(_0x597662,null))['catch'](handleError(_0x597662,null));};exports[_0xdd96('0x2c')]=function(_0x2b001c,_0x242f3d){return db[_0xdd96('0x2f')][_0xdd96('0x4c')]({'where':{'id':_0x2b001c[_0xdd96('0x49')]['id']}})[_0xdd96('0x18')](handleEntityNotFound(_0x242f3d,null))[_0xdd96('0x18')](removeEntity(_0x242f3d,null))['catch'](handleError(_0x242f3d,null));};exports[_0xdd96('0x50')]=function(_0x5582f0,_0x345d7b,_0x144a96){var _0x515f81={};var _0x4739d2={};var _0x23c873;var _0x53b7b7;return db['FreshdeskConfiguration'][_0xdd96('0x51')]({'where':{'id':_0x5582f0['params']['id']}})['then'](handleEntityNotFound(_0x345d7b,null))['then'](function(_0x277808){if(_0x277808){_0x23c873=_0x277808;_0x4739d2[_0xdd96('0x34')]=_[_0xdd96('0x4a')](db[_0xdd96('0x52')][_0xdd96('0x30')]);_0x4739d2[_0xdd96('0x36')]=_[_0xdd96('0x4a')](_0x5582f0[_0xdd96('0x36')]);_0x4739d2[_0xdd96('0x3f')]=_[_0xdd96('0x37')](_0x4739d2[_0xdd96('0x34')],_0x4739d2['query']);_0x515f81[_0xdd96('0x39')]=_[_0xdd96('0x37')](_0x4739d2[_0xdd96('0x34')],qs['fields'](_0x5582f0[_0xdd96('0x36')][_0xdd96('0x38')]));_0x515f81[_0xdd96('0x39')]=_0x515f81[_0xdd96('0x39')]['length']?_0x515f81[_0xdd96('0x39')]:_0x4739d2[_0xdd96('0x34')];_0x515f81[_0xdd96('0x3c')]=qs['sort'](_0x5582f0[_0xdd96('0x36')][_0xdd96('0x3d')]);_0x515f81[_0xdd96('0x3e')]=qs[_0xdd96('0x3f')](_[_0xdd96('0x40')](_0x5582f0[_0xdd96('0x36')],_0x4739d2['filters']));if(_0x5582f0[_0xdd96('0x36')][_0xdd96('0x53')]){_0x515f81['where']=_[_0xdd96('0x41')](_0x515f81[_0xdd96('0x3e')],{'$or':_[_0xdd96('0x35')](_0x515f81['attributes'],function(_0x280a3d){var _0x2ebf9c={};_0x2ebf9c[_0x280a3d]={'$like':'%'+_0x5582f0['query']['filter']+'%'};return _0x2ebf9c;})});}_0x515f81=_[_0xdd96('0x41')]({},_0x515f81,_0x5582f0[_0xdd96('0x43')]);return _0x23c873[_0xdd96('0x50')](_0x515f81);}})[_0xdd96('0x18')](function(_0xda3cde){if(_0xda3cde){_0x53b7b7=_0xda3cde['length'];if(!_0x5582f0['query'][_0xdd96('0x54')](_0xdd96('0x3b'))){_0x515f81[_0xdd96('0x55')]=qs[_0xdd96('0x55')](_0x5582f0[_0xdd96('0x36')][_0xdd96('0x55')]);_0x515f81[_0xdd96('0x26')]=qs[_0xdd96('0x26')](_0x5582f0[_0xdd96('0x36')][_0xdd96('0x26')]);}return _0x23c873[_0xdd96('0x50')](_0x515f81);}})['then'](function(_0x1bc17e){if(_0x1bc17e){return _0x1bc17e?{'count':_0x53b7b7,'rows':_0x1bc17e}:null;}})[_0xdd96('0x18')](respondWithResult(_0x345d7b,null))[_0xdd96('0x22')](handleError(_0x345d7b,null));};exports[_0xdd96('0x56')]=function(_0x512110,_0x50fbbf,_0x5d2d0c){var _0x10e3ed={};var _0x3890b1={};var _0x5e9086;var _0x22f764;return db[_0xdd96('0x2f')][_0xdd96('0x51')]({'where':{'id':_0x512110['params']['id']}})[_0xdd96('0x18')](handleEntityNotFound(_0x50fbbf,null))['then'](function(_0x2f823d){if(_0x2f823d){_0x5e9086=_0x2f823d;_0x3890b1['model']=_['keys'](db[_0xdd96('0x52')][_0xdd96('0x30')]);_0x3890b1[_0xdd96('0x36')]=_[_0xdd96('0x4a')](_0x512110[_0xdd96('0x36')]);_0x3890b1['filters']=_[_0xdd96('0x37')](_0x3890b1[_0xdd96('0x34')],_0x3890b1[_0xdd96('0x36')]);_0x10e3ed[_0xdd96('0x39')]=_[_0xdd96('0x37')](_0x3890b1[_0xdd96('0x34')],qs[_0xdd96('0x38')](_0x512110['query'][_0xdd96('0x38')]));_0x10e3ed[_0xdd96('0x39')]=_0x10e3ed[_0xdd96('0x39')][_0xdd96('0x3a')]?_0x10e3ed[_0xdd96('0x39')]:_0x3890b1[_0xdd96('0x34')];_0x10e3ed[_0xdd96('0x3c')]=qs[_0xdd96('0x3d')](_0x512110['query'][_0xdd96('0x3d')]);_0x10e3ed[_0xdd96('0x3e')]=qs[_0xdd96('0x3f')](_[_0xdd96('0x40')](_0x512110[_0xdd96('0x36')],_0x3890b1['filters']));if(_0x512110['query'][_0xdd96('0x53')]){_0x10e3ed[_0xdd96('0x3e')]=_['merge'](_0x10e3ed[_0xdd96('0x3e')],{'$or':_[_0xdd96('0x35')](_0x10e3ed[_0xdd96('0x39')],function(_0x457d61){var _0x4f1d74={};_0x4f1d74[_0x457d61]={'$like':'%'+_0x512110[_0xdd96('0x36')][_0xdd96('0x53')]+'%'};return _0x4f1d74;})});}_0x10e3ed=_[_0xdd96('0x41')]({},_0x10e3ed,_0x512110[_0xdd96('0x43')]);return _0x5e9086['getSubjects'](_0x10e3ed);}})[_0xdd96('0x18')](function(_0x4777a1){if(_0x4777a1){_0x22f764=_0x4777a1['length'];if(!_0x512110['query'][_0xdd96('0x54')](_0xdd96('0x3b'))){_0x10e3ed['limit']=qs['limit'](_0x512110[_0xdd96('0x36')][_0xdd96('0x55')]);_0x10e3ed[_0xdd96('0x26')]=qs[_0xdd96('0x26')](_0x512110[_0xdd96('0x36')]['offset']);}return _0x5e9086[_0xdd96('0x56')](_0x10e3ed);}})[_0xdd96('0x18')](function(_0x47b8ad){if(_0x47b8ad){return _0x47b8ad?{'count':_0x22f764,'rows':_0x47b8ad}:null;}})[_0xdd96('0x18')](respondWithResult(_0x50fbbf,null))[_0xdd96('0x22')](handleError(_0x50fbbf,null));};exports[_0xdd96('0x57')]=function(_0x3cb17d,_0x5927b4,_0xf85945){var _0x6be490={};var _0x5d73ad={};var _0x5d18c1;var _0x3f2dac;return db[_0xdd96('0x2f')][_0xdd96('0x51')]({'where':{'id':_0x3cb17d[_0xdd96('0x49')]['id']}})[_0xdd96('0x18')](handleEntityNotFound(_0x5927b4,null))[_0xdd96('0x18')](function(_0x5d2c74){if(_0x5d2c74){_0x5d18c1=_0x5d2c74;_0x5d73ad[_0xdd96('0x34')]=_['keys'](db[_0xdd96('0x52')][_0xdd96('0x30')]);_0x5d73ad['query']=_[_0xdd96('0x4a')](_0x3cb17d[_0xdd96('0x36')]);_0x5d73ad[_0xdd96('0x3f')]=_['intersection'](_0x5d73ad['model'],_0x5d73ad[_0xdd96('0x36')]);_0x6be490['attributes']=_['intersection'](_0x5d73ad[_0xdd96('0x34')],qs[_0xdd96('0x38')](_0x3cb17d[_0xdd96('0x36')][_0xdd96('0x38')]));_0x6be490[_0xdd96('0x39')]=_0x6be490[_0xdd96('0x39')]['length']?_0x6be490[_0xdd96('0x39')]:_0x5d73ad['model'];_0x6be490[_0xdd96('0x3c')]=qs[_0xdd96('0x3d')](_0x3cb17d[_0xdd96('0x36')][_0xdd96('0x3d')]);_0x6be490[_0xdd96('0x3e')]=qs['filters'](_[_0xdd96('0x40')](_0x3cb17d[_0xdd96('0x36')],_0x5d73ad[_0xdd96('0x3f')]));if(_0x3cb17d[_0xdd96('0x36')][_0xdd96('0x53')]){_0x6be490['where']=_['merge'](_0x6be490[_0xdd96('0x3e')],{'$or':_[_0xdd96('0x35')](_0x6be490[_0xdd96('0x39')],function(_0x335493){var _0x1b586b={};_0x1b586b[_0x335493]={'$like':'%'+_0x3cb17d[_0xdd96('0x36')][_0xdd96('0x53')]+'%'};return _0x1b586b;})});}_0x6be490=_[_0xdd96('0x41')]({},_0x6be490,_0x3cb17d[_0xdd96('0x43')]);return _0x5d18c1['getDescriptions'](_0x6be490);}})[_0xdd96('0x18')](function(_0x363bae){if(_0x363bae){_0x3f2dac=_0x363bae['length'];if(!_0x3cb17d['query'][_0xdd96('0x54')]('nolimit')){_0x6be490[_0xdd96('0x55')]=qs['limit'](_0x3cb17d[_0xdd96('0x36')]['limit']);_0x6be490[_0xdd96('0x26')]=qs['offset'](_0x3cb17d[_0xdd96('0x36')][_0xdd96('0x26')]);}return _0x5d18c1[_0xdd96('0x57')](_0x6be490);}})[_0xdd96('0x18')](function(_0xf4937d){if(_0xf4937d){return _0xf4937d?{'count':_0x3f2dac,'rows':_0xf4937d}:null;}})['then'](respondWithResult(_0x5927b4,null))[_0xdd96('0x22')](handleError(_0x5927b4,null));};exports[_0xdd96('0x58')]=function(_0x4520e8,_0x16e5a6,_0xcfeea4){var _0x2a7652={};var _0x344910={};var _0x58e38b;var _0x227c3c;return db[_0xdd96('0x2f')][_0xdd96('0x51')]({'where':{'id':_0x4520e8[_0xdd96('0x49')]['id']}})[_0xdd96('0x18')](handleEntityNotFound(_0x16e5a6,null))['then'](function(_0x49d774){if(_0x49d774){_0x58e38b=_0x49d774;_0x344910[_0xdd96('0x34')]=_[_0xdd96('0x4a')](db[_0xdd96('0x59')][_0xdd96('0x30')]);_0x344910[_0xdd96('0x36')]=_[_0xdd96('0x4a')](_0x4520e8[_0xdd96('0x36')]);_0x344910[_0xdd96('0x3f')]=_['intersection'](_0x344910[_0xdd96('0x34')],_0x344910[_0xdd96('0x36')]);_0x2a7652[_0xdd96('0x39')]=_[_0xdd96('0x37')](_0x344910['model'],qs[_0xdd96('0x38')](_0x4520e8[_0xdd96('0x36')][_0xdd96('0x38')]));_0x2a7652[_0xdd96('0x39')]=_0x2a7652[_0xdd96('0x39')][_0xdd96('0x3a')]?_0x2a7652['attributes']:_0x344910[_0xdd96('0x34')];_0x2a7652['order']=qs[_0xdd96('0x3d')](_0x4520e8[_0xdd96('0x36')][_0xdd96('0x3d')]);_0x2a7652[_0xdd96('0x3e')]=qs[_0xdd96('0x3f')](_['pick'](_0x4520e8[_0xdd96('0x36')],_0x344910[_0xdd96('0x3f')]));if(_0x4520e8[_0xdd96('0x36')][_0xdd96('0x53')]){_0x2a7652[_0xdd96('0x3e')]=_['merge'](_0x2a7652[_0xdd96('0x3e')],{'$or':_['map'](_0x2a7652[_0xdd96('0x39')],function(_0x25ef89){var _0x2e7407={};_0x2e7407[_0x25ef89]={'$like':'%'+_0x4520e8['query'][_0xdd96('0x53')]+'%'};return _0x2e7407;})});}_0x2a7652=_[_0xdd96('0x41')]({},_0x2a7652,_0x4520e8[_0xdd96('0x43')]);return _0x58e38b[_0xdd96('0x58')](_0x2a7652);}})[_0xdd96('0x18')](function(_0x1cceac){if(_0x1cceac){_0x227c3c=_0x1cceac[_0xdd96('0x3a')];if(!_0x4520e8[_0xdd96('0x36')][_0xdd96('0x54')](_0xdd96('0x3b'))){_0x2a7652[_0xdd96('0x55')]=qs[_0xdd96('0x55')](_0x4520e8['query'][_0xdd96('0x55')]);_0x2a7652[_0xdd96('0x26')]=qs['offset'](_0x4520e8['query'][_0xdd96('0x26')]);}return _0x58e38b[_0xdd96('0x58')](_0x2a7652);}})[_0xdd96('0x18')](function(_0x37ca18){if(_0x37ca18){return _0x37ca18?{'count':_0x227c3c,'rows':_0x37ca18}:null;}})[_0xdd96('0x18')](respondWithResult(_0x16e5a6,null))[_0xdd96('0x22')](handleError(_0x16e5a6,null));};exports['setTags']=function(_0x3dbc98,_0x242d9e,_0x16ffe9){if(_0x3dbc98[_0xdd96('0x4f')]['id']){delete _0x3dbc98[_0xdd96('0x4f')]['id'];}return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x3dbc98['params']['id']}})[_0xdd96('0x18')](handleEntityNotFound(_0x242d9e,null))[_0xdd96('0x18')](function(_0x49170c){if(_0x49170c){return _0x49170c['setTags'](_0x3dbc98[_0xdd96('0x4f')][_0xdd96('0x5a')]||[]);}return null;})[_0xdd96('0x18')](respondWithResult(_0x242d9e,null))['catch'](handleError(_0x242d9e,null));}; \ No newline at end of file +var _0x8d74=['../../config/license/hardware','../../config/logger','api','../../config/environment','http','test','Sequelize','ValidationError','request','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','offset','limit','set','json','apply','reject','save','update','then','destroy','end','stack','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','map','VIRTUAL','options','findAll','rows','show','includeAll','include','create','body','find','params','getFields','findOne','FreshdeskField','filter','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x325b41,_0x23ce32){var _0x22120c=function(_0x4f86b9){while(--_0x4f86b9){_0x325b41['push'](_0x325b41['shift']());}};_0x22120c(++_0x23ce32);}(_0x8d74,0x16c));var _0x48d7=function(_0x4cf8ba,_0x4b9fec){_0x4cf8ba=_0x4cf8ba-0x0;var _0x1273c7=_0x8d74[_0x4cf8ba];return _0x1273c7;};'use strict';var pdf=require(_0x48d7('0x0'));var emlformat=require(_0x48d7('0x1'));var rimraf=require(_0x48d7('0x2'));var zipdir=require(_0x48d7('0x3'));var jsonpatch=require(_0x48d7('0x4'));var rp=require(_0x48d7('0x5'));var moment=require(_0x48d7('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x48d7('0x7'));var util=require('util');var path=require(_0x48d7('0x8'));var sox=require(_0x48d7('0x9'));var csv=require(_0x48d7('0xa'));var ejs=require(_0x48d7('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x48d7('0xc'));var crypto=require(_0x48d7('0xd'));var jsforce=require(_0x48d7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x48d7('0xa'));var querystring=require(_0x48d7('0xf'));var Papa=require(_0x48d7('0x10'));var Redis=require('ioredis');var authService=require(_0x48d7('0x11'));var qs=require(_0x48d7('0x12'));var as=require(_0x48d7('0x13'));var hardwareService=require(_0x48d7('0x14'));var logger=require(_0x48d7('0x15'))(_0x48d7('0x16'));var utils=require('../../config/utils');var config=require(_0x48d7('0x17'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x48d7('0x18')]({'port':0x232a});function checkPasswordPattern(_0x44b28e,_0x28e01d,_0x126fff){if(_0x126fff){var _0x369114=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x369114[_0x48d7('0x19')](_0x28e01d)){return _0x44b28e;}else{throw new db[(_0x48d7('0x1a'))][(_0x48d7('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 _0x44b28e;}}function respondWithRpcPromise(_0x1dad6b,_0x4bea1e,_0x4dfb2e,_0x12a036){return new BPromise(function(_0x41324c,_0x45981b){var _0x465cf6=_0x12a036||client;return _0x465cf6[_0x48d7('0x1c')](_0x1dad6b,_0x4dfb2e)['then'](function(_0x5d99a4){logger[_0x48d7('0x1d')](_0x48d7('0x1e'),_0x4bea1e,'request\x20sent');logger[_0x48d7('0x1f')](_0x48d7('0x20'),_0x4bea1e,'request\x20sent',JSON['stringify'](_0x5d99a4));if(_0x5d99a4[_0x48d7('0x21')]){if(_0x5d99a4[_0x48d7('0x21')][_0x48d7('0x22')]===0x1f4){logger[_0x48d7('0x21')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4bea1e,_0x5d99a4[_0x48d7('0x21')][_0x48d7('0x23')]);return _0x45981b(_0x5d99a4['error'][_0x48d7('0x23')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x4bea1e,_0x5d99a4['error'][_0x48d7('0x23')]);return _0x41324c(_0x5d99a4[_0x48d7('0x21')][_0x48d7('0x23')]);}else{logger[_0x48d7('0x1d')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4bea1e,'request\x20sent');_0x41324c(_0x5d99a4[_0x48d7('0x24')][_0x48d7('0x23')]);}})[_0x48d7('0x25')](function(_0x139888){logger[_0x48d7('0x21')](_0x48d7('0x1e'),_0x4bea1e,_0x139888);_0x45981b(_0x139888);});});}function respondWithStatusCode(_0x1c0573,_0x26f120){_0x26f120=_0x26f120||0xcc;return function(_0x42ce80){if(_0x42ce80){return _0x1c0573['sendStatus'](_0x26f120);}return _0x1c0573[_0x48d7('0x26')](_0x26f120)['end']();};}function respondWithResult(_0x5aa527,_0x518a03){_0x518a03=_0x518a03||0xc8;return function(_0x2a2b8c){if(_0x2a2b8c){return _0x5aa527[_0x48d7('0x26')](_0x518a03)['json'](_0x2a2b8c);}};}function respondWithFilteredResult(_0xf29606,_0x20d2c4){return function(_0x1ef9a4){if(_0x1ef9a4){var _0x5027b9=_0x1ef9a4['count'],_0x2e3793=_0x20d2c4[_0x48d7('0x27')],_0x38f655=_0x20d2c4[_0x48d7('0x27')]+_0x20d2c4[_0x48d7('0x28')],_0x28291a;if(_0x38f655>=_0x5027b9){_0x38f655=_0x5027b9;_0x28291a=0xc8;}else{_0x28291a=0xce;}_0xf29606[_0x48d7('0x26')](_0x28291a);return _0xf29606[_0x48d7('0x29')]('Content-Range',_0x2e3793+'-'+_0x38f655+'/'+_0x5027b9)[_0x48d7('0x2a')](_0x1ef9a4);}return null;};}function patchUpdates(_0x562cb8){return function(_0x261bb9){try{jsonpatch[_0x48d7('0x2b')](_0x261bb9,_0x562cb8,!![]);}catch(_0x711a53){return BPromise[_0x48d7('0x2c')](_0x711a53);}return _0x261bb9[_0x48d7('0x2d')]();};}function saveUpdates(_0x455b62,_0x10e237){return function(_0x15e884){if(_0x15e884){return _0x15e884[_0x48d7('0x2e')](_0x455b62)[_0x48d7('0x2f')](function(_0x4bfa2e){return _0x4bfa2e;});}return null;};}function removeEntity(_0x14da9e,_0x405eb0){return function(_0x41f9cc){if(_0x41f9cc){return _0x41f9cc[_0x48d7('0x30')]()[_0x48d7('0x2f')](function(){_0x14da9e[_0x48d7('0x26')](0xcc)[_0x48d7('0x31')]();});}};}function handleEntityNotFound(_0x1b5058,_0x3b00bc){return function(_0x2dbf4e){if(!_0x2dbf4e){_0x1b5058['sendStatus'](0x194);}return _0x2dbf4e;};}function handleError(_0x34d87d,_0x31a4a9){_0x31a4a9=_0x31a4a9||0x1f4;return function(_0x4a53d6){logger[_0x48d7('0x21')](_0x4a53d6[_0x48d7('0x32')]);if(_0x4a53d6[_0x48d7('0x33')]){delete _0x4a53d6[_0x48d7('0x33')];}_0x34d87d[_0x48d7('0x26')](_0x31a4a9)[_0x48d7('0x34')](_0x4a53d6);};}exports[_0x48d7('0x35')]=function(_0x5ea6ae,_0x1dc5dc){var _0x2cdd5e={},_0x108a09={},_0x42994a={'count':0x0,'rows':[]};var _0x46ef7e=_['map'](db[_0x48d7('0x36')][_0x48d7('0x37')],function(_0x103614){return{'name':_0x103614[_0x48d7('0x38')],'type':_0x103614[_0x48d7('0x39')][_0x48d7('0x3a')]};});_0x108a09[_0x48d7('0x3b')]=_['map'](_0x46ef7e,_0x48d7('0x33'));_0x108a09[_0x48d7('0x3c')]=_[_0x48d7('0x3d')](_0x5ea6ae[_0x48d7('0x3c')]);_0x108a09[_0x48d7('0x3e')]=_['intersection'](_0x108a09[_0x48d7('0x3b')],_0x108a09[_0x48d7('0x3c')]);_0x2cdd5e['attributes']=_[_0x48d7('0x3f')](_0x108a09[_0x48d7('0x3b')],qs[_0x48d7('0x40')](_0x5ea6ae[_0x48d7('0x3c')][_0x48d7('0x40')]));_0x2cdd5e[_0x48d7('0x41')]=_0x2cdd5e['attributes'][_0x48d7('0x42')]?_0x2cdd5e[_0x48d7('0x41')]:_0x108a09['model'];if(!_0x5ea6ae[_0x48d7('0x3c')]['hasOwnProperty'](_0x48d7('0x43'))){_0x2cdd5e['limit']=qs[_0x48d7('0x28')](_0x5ea6ae['query'][_0x48d7('0x28')]);_0x2cdd5e[_0x48d7('0x27')]=qs['offset'](_0x5ea6ae[_0x48d7('0x3c')]['offset']);}_0x2cdd5e[_0x48d7('0x44')]=qs[_0x48d7('0x45')](_0x5ea6ae[_0x48d7('0x3c')]['sort']);_0x2cdd5e[_0x48d7('0x46')]=qs['filters'](_[_0x48d7('0x47')](_0x5ea6ae['query'],_0x108a09[_0x48d7('0x3e')]));if(_0x5ea6ae[_0x48d7('0x3c')]['filter']){_0x2cdd5e[_0x48d7('0x46')]=_[_0x48d7('0x48')](_0x2cdd5e['where'],{'$or':_[_0x48d7('0x49')](_0x46ef7e,function(_0x9e9136){if(_0x9e9136[_0x48d7('0x39')]!==_0x48d7('0x4a')){var _0x26b844={};_0x26b844[_0x9e9136[_0x48d7('0x33')]]={'$like':'%'+_0x5ea6ae[_0x48d7('0x3c')]['filter']+'%'};return _0x26b844;}})});}_0x2cdd5e=_[_0x48d7('0x48')]({},_0x2cdd5e,_0x5ea6ae[_0x48d7('0x4b')]);var _0x52635a={'where':_0x2cdd5e['where']};return db[_0x48d7('0x36')]['count'](_0x52635a)[_0x48d7('0x2f')](function(_0xef8fbf){_0x42994a['count']=_0xef8fbf;if(_0x5ea6ae['query']['includeAll']){_0x2cdd5e['include']=[{'all':!![]}];}return db[_0x48d7('0x36')][_0x48d7('0x4c')](_0x2cdd5e);})['then'](function(_0x4b299a){_0x42994a[_0x48d7('0x4d')]=_0x4b299a;return _0x42994a;})[_0x48d7('0x2f')](respondWithFilteredResult(_0x1dc5dc,_0x2cdd5e))[_0x48d7('0x25')](handleError(_0x1dc5dc,null));};exports[_0x48d7('0x4e')]=function(_0x3ccee6,_0x480fdc){var _0x50472c={'raw':![],'where':{'id':_0x3ccee6['params']['id']}},_0x17a2a5={};_0x17a2a5['model']=_[_0x48d7('0x3d')](db[_0x48d7('0x36')]['rawAttributes']);_0x17a2a5[_0x48d7('0x3c')]=_[_0x48d7('0x3d')](_0x3ccee6[_0x48d7('0x3c')]);_0x17a2a5['filters']=_['intersection'](_0x17a2a5[_0x48d7('0x3b')],_0x17a2a5[_0x48d7('0x3c')]);_0x50472c[_0x48d7('0x41')]=_[_0x48d7('0x3f')](_0x17a2a5[_0x48d7('0x3b')],qs[_0x48d7('0x40')](_0x3ccee6[_0x48d7('0x3c')]['fields']));_0x50472c[_0x48d7('0x41')]=_0x50472c['attributes'][_0x48d7('0x42')]?_0x50472c[_0x48d7('0x41')]:_0x17a2a5[_0x48d7('0x3b')];if(_0x3ccee6[_0x48d7('0x3c')][_0x48d7('0x4f')]){_0x50472c[_0x48d7('0x50')]=[{'all':!![]}];}_0x50472c=_[_0x48d7('0x48')]({},_0x50472c,_0x3ccee6[_0x48d7('0x4b')]);return db[_0x48d7('0x36')]['find'](_0x50472c)['then'](handleEntityNotFound(_0x480fdc,null))[_0x48d7('0x2f')](respondWithResult(_0x480fdc,null))[_0x48d7('0x25')](handleError(_0x480fdc,null));};exports[_0x48d7('0x51')]=function(_0x423d34,_0x132eb5){return db['FreshdeskConfiguration'][_0x48d7('0x51')](_0x423d34[_0x48d7('0x52')],{})['then'](respondWithResult(_0x132eb5,0xc9))[_0x48d7('0x25')](handleError(_0x132eb5,null));};exports[_0x48d7('0x2e')]=function(_0x213def,_0x199328){if(_0x213def[_0x48d7('0x52')]['id']){delete _0x213def[_0x48d7('0x52')]['id'];}return db['FreshdeskConfiguration'][_0x48d7('0x53')]({'where':{'id':_0x213def[_0x48d7('0x54')]['id']}})[_0x48d7('0x2f')](handleEntityNotFound(_0x199328,null))[_0x48d7('0x2f')](saveUpdates(_0x213def[_0x48d7('0x52')],null))['then'](respondWithResult(_0x199328,null))[_0x48d7('0x25')](handleError(_0x199328,null));};exports[_0x48d7('0x30')]=function(_0x39de24,_0x24a9ef){return db[_0x48d7('0x36')]['find']({'where':{'id':_0x39de24['params']['id']}})['then'](handleEntityNotFound(_0x24a9ef,null))[_0x48d7('0x2f')](removeEntity(_0x24a9ef,null))[_0x48d7('0x25')](handleError(_0x24a9ef,null));};exports[_0x48d7('0x55')]=function(_0x1318d7,_0x5cd02f,_0x2c4515){var _0x4eb839={};var _0x593f71={};var _0x5ae29d;var _0x1091f8;return db[_0x48d7('0x36')][_0x48d7('0x56')]({'where':{'id':_0x1318d7[_0x48d7('0x54')]['id']}})[_0x48d7('0x2f')](handleEntityNotFound(_0x5cd02f,null))['then'](function(_0x508e57){if(_0x508e57){_0x5ae29d=_0x508e57;_0x593f71[_0x48d7('0x3b')]=_[_0x48d7('0x3d')](db[_0x48d7('0x57')]['rawAttributes']);_0x593f71[_0x48d7('0x3c')]=_[_0x48d7('0x3d')](_0x1318d7[_0x48d7('0x3c')]);_0x593f71['filters']=_[_0x48d7('0x3f')](_0x593f71[_0x48d7('0x3b')],_0x593f71[_0x48d7('0x3c')]);_0x4eb839[_0x48d7('0x41')]=_[_0x48d7('0x3f')](_0x593f71['model'],qs[_0x48d7('0x40')](_0x1318d7[_0x48d7('0x3c')][_0x48d7('0x40')]));_0x4eb839[_0x48d7('0x41')]=_0x4eb839[_0x48d7('0x41')][_0x48d7('0x42')]?_0x4eb839['attributes']:_0x593f71[_0x48d7('0x3b')];_0x4eb839[_0x48d7('0x44')]=qs[_0x48d7('0x45')](_0x1318d7[_0x48d7('0x3c')]['sort']);_0x4eb839['where']=qs[_0x48d7('0x3e')](_[_0x48d7('0x47')](_0x1318d7['query'],_0x593f71['filters']));if(_0x1318d7[_0x48d7('0x3c')]['filter']){_0x4eb839[_0x48d7('0x46')]=_[_0x48d7('0x48')](_0x4eb839[_0x48d7('0x46')],{'$or':_[_0x48d7('0x49')](_0x4eb839[_0x48d7('0x41')],function(_0x5c0654){var _0x565674={};_0x565674[_0x5c0654]={'$like':'%'+_0x1318d7[_0x48d7('0x3c')][_0x48d7('0x58')]+'%'};return _0x565674;})});}_0x4eb839=_[_0x48d7('0x48')]({},_0x4eb839,_0x1318d7['options']);return _0x5ae29d[_0x48d7('0x55')](_0x4eb839);}})['then'](function(_0xc71c9e){if(_0xc71c9e){_0x1091f8=_0xc71c9e[_0x48d7('0x42')];if(!_0x1318d7[_0x48d7('0x3c')][_0x48d7('0x59')](_0x48d7('0x43'))){_0x4eb839['limit']=qs[_0x48d7('0x28')](_0x1318d7['query']['limit']);_0x4eb839[_0x48d7('0x27')]=qs[_0x48d7('0x27')](_0x1318d7[_0x48d7('0x3c')][_0x48d7('0x27')]);}return _0x5ae29d[_0x48d7('0x55')](_0x4eb839);}})['then'](function(_0x4488c7){if(_0x4488c7){return _0x4488c7?{'count':_0x1091f8,'rows':_0x4488c7}:null;}})[_0x48d7('0x2f')](respondWithResult(_0x5cd02f,null))[_0x48d7('0x25')](handleError(_0x5cd02f,null));};exports[_0x48d7('0x5a')]=function(_0x5f51f4,_0x543782,_0x2cf681){var _0x5b0beb={};var _0x5ef31a={};var _0x58d6cf;var _0x480ec8;return db['FreshdeskConfiguration'][_0x48d7('0x56')]({'where':{'id':_0x5f51f4[_0x48d7('0x54')]['id']}})[_0x48d7('0x2f')](handleEntityNotFound(_0x543782,null))[_0x48d7('0x2f')](function(_0x548a05){if(_0x548a05){_0x58d6cf=_0x548a05;_0x5ef31a[_0x48d7('0x3b')]=_[_0x48d7('0x3d')](db[_0x48d7('0x57')][_0x48d7('0x37')]);_0x5ef31a[_0x48d7('0x3c')]=_[_0x48d7('0x3d')](_0x5f51f4['query']);_0x5ef31a[_0x48d7('0x3e')]=_['intersection'](_0x5ef31a['model'],_0x5ef31a[_0x48d7('0x3c')]);_0x5b0beb[_0x48d7('0x41')]=_['intersection'](_0x5ef31a[_0x48d7('0x3b')],qs[_0x48d7('0x40')](_0x5f51f4[_0x48d7('0x3c')][_0x48d7('0x40')]));_0x5b0beb['attributes']=_0x5b0beb[_0x48d7('0x41')]['length']?_0x5b0beb[_0x48d7('0x41')]:_0x5ef31a[_0x48d7('0x3b')];_0x5b0beb['order']=qs[_0x48d7('0x45')](_0x5f51f4[_0x48d7('0x3c')][_0x48d7('0x45')]);_0x5b0beb['where']=qs['filters'](_[_0x48d7('0x47')](_0x5f51f4[_0x48d7('0x3c')],_0x5ef31a[_0x48d7('0x3e')]));if(_0x5f51f4[_0x48d7('0x3c')][_0x48d7('0x58')]){_0x5b0beb[_0x48d7('0x46')]=_[_0x48d7('0x48')](_0x5b0beb[_0x48d7('0x46')],{'$or':_[_0x48d7('0x49')](_0x5b0beb[_0x48d7('0x41')],function(_0x315fd4){var _0x465838={};_0x465838[_0x315fd4]={'$like':'%'+_0x5f51f4['query'][_0x48d7('0x58')]+'%'};return _0x465838;})});}_0x5b0beb=_[_0x48d7('0x48')]({},_0x5b0beb,_0x5f51f4[_0x48d7('0x4b')]);return _0x58d6cf[_0x48d7('0x5a')](_0x5b0beb);}})[_0x48d7('0x2f')](function(_0x428335){if(_0x428335){_0x480ec8=_0x428335['length'];if(!_0x5f51f4[_0x48d7('0x3c')]['hasOwnProperty'](_0x48d7('0x43'))){_0x5b0beb['limit']=qs[_0x48d7('0x28')](_0x5f51f4[_0x48d7('0x3c')][_0x48d7('0x28')]);_0x5b0beb[_0x48d7('0x27')]=qs[_0x48d7('0x27')](_0x5f51f4[_0x48d7('0x3c')]['offset']);}return _0x58d6cf[_0x48d7('0x5a')](_0x5b0beb);}})['then'](function(_0x1acd81){if(_0x1acd81){return _0x1acd81?{'count':_0x480ec8,'rows':_0x1acd81}:null;}})['then'](respondWithResult(_0x543782,null))[_0x48d7('0x25')](handleError(_0x543782,null));};exports[_0x48d7('0x5b')]=function(_0x4856f9,_0x554f9c,_0x59eea0){var _0x4b4fbd={};var _0x386390={};var _0x51a67c;var _0x553617;return db[_0x48d7('0x36')][_0x48d7('0x56')]({'where':{'id':_0x4856f9[_0x48d7('0x54')]['id']}})[_0x48d7('0x2f')](handleEntityNotFound(_0x554f9c,null))['then'](function(_0x5018b4){if(_0x5018b4){_0x51a67c=_0x5018b4;_0x386390[_0x48d7('0x3b')]=_[_0x48d7('0x3d')](db[_0x48d7('0x57')]['rawAttributes']);_0x386390['query']=_[_0x48d7('0x3d')](_0x4856f9[_0x48d7('0x3c')]);_0x386390[_0x48d7('0x3e')]=_['intersection'](_0x386390['model'],_0x386390[_0x48d7('0x3c')]);_0x4b4fbd[_0x48d7('0x41')]=_[_0x48d7('0x3f')](_0x386390[_0x48d7('0x3b')],qs[_0x48d7('0x40')](_0x4856f9[_0x48d7('0x3c')][_0x48d7('0x40')]));_0x4b4fbd[_0x48d7('0x41')]=_0x4b4fbd[_0x48d7('0x41')][_0x48d7('0x42')]?_0x4b4fbd[_0x48d7('0x41')]:_0x386390[_0x48d7('0x3b')];_0x4b4fbd['order']=qs[_0x48d7('0x45')](_0x4856f9['query'][_0x48d7('0x45')]);_0x4b4fbd['where']=qs['filters'](_['pick'](_0x4856f9[_0x48d7('0x3c')],_0x386390['filters']));if(_0x4856f9[_0x48d7('0x3c')][_0x48d7('0x58')]){_0x4b4fbd['where']=_[_0x48d7('0x48')](_0x4b4fbd[_0x48d7('0x46')],{'$or':_[_0x48d7('0x49')](_0x4b4fbd[_0x48d7('0x41')],function(_0x6d52da){var _0xade814={};_0xade814[_0x6d52da]={'$like':'%'+_0x4856f9[_0x48d7('0x3c')][_0x48d7('0x58')]+'%'};return _0xade814;})});}_0x4b4fbd=_['merge']({},_0x4b4fbd,_0x4856f9['options']);return _0x51a67c['getDescriptions'](_0x4b4fbd);}})[_0x48d7('0x2f')](function(_0x3ca621){if(_0x3ca621){_0x553617=_0x3ca621[_0x48d7('0x42')];if(!_0x4856f9['query'][_0x48d7('0x59')](_0x48d7('0x43'))){_0x4b4fbd[_0x48d7('0x28')]=qs[_0x48d7('0x28')](_0x4856f9[_0x48d7('0x3c')][_0x48d7('0x28')]);_0x4b4fbd[_0x48d7('0x27')]=qs[_0x48d7('0x27')](_0x4856f9[_0x48d7('0x3c')][_0x48d7('0x27')]);}return _0x51a67c[_0x48d7('0x5b')](_0x4b4fbd);}})[_0x48d7('0x2f')](function(_0x133f3e){if(_0x133f3e){return _0x133f3e?{'count':_0x553617,'rows':_0x133f3e}:null;}})[_0x48d7('0x2f')](respondWithResult(_0x554f9c,null))[_0x48d7('0x25')](handleError(_0x554f9c,null));};exports[_0x48d7('0x5c')]=function(_0x442639,_0x40300e,_0x2b749d){var _0x5d30db={};var _0xbb0400={};var _0x19e96d;var _0x2a108c;return db[_0x48d7('0x36')][_0x48d7('0x56')]({'where':{'id':_0x442639[_0x48d7('0x54')]['id']}})['then'](handleEntityNotFound(_0x40300e,null))['then'](function(_0x28784b){if(_0x28784b){_0x19e96d=_0x28784b;_0xbb0400['model']=_[_0x48d7('0x3d')](db[_0x48d7('0x5d')]['rawAttributes']);_0xbb0400['query']=_['keys'](_0x442639[_0x48d7('0x3c')]);_0xbb0400[_0x48d7('0x3e')]=_['intersection'](_0xbb0400[_0x48d7('0x3b')],_0xbb0400['query']);_0x5d30db[_0x48d7('0x41')]=_[_0x48d7('0x3f')](_0xbb0400[_0x48d7('0x3b')],qs[_0x48d7('0x40')](_0x442639[_0x48d7('0x3c')][_0x48d7('0x40')]));_0x5d30db['attributes']=_0x5d30db['attributes'][_0x48d7('0x42')]?_0x5d30db[_0x48d7('0x41')]:_0xbb0400['model'];_0x5d30db[_0x48d7('0x44')]=qs[_0x48d7('0x45')](_0x442639[_0x48d7('0x3c')][_0x48d7('0x45')]);_0x5d30db[_0x48d7('0x46')]=qs['filters'](_[_0x48d7('0x47')](_0x442639['query'],_0xbb0400[_0x48d7('0x3e')]));if(_0x442639['query']['filter']){_0x5d30db[_0x48d7('0x46')]=_[_0x48d7('0x48')](_0x5d30db[_0x48d7('0x46')],{'$or':_[_0x48d7('0x49')](_0x5d30db[_0x48d7('0x41')],function(_0x56ff9a){var _0x17544a={};_0x17544a[_0x56ff9a]={'$like':'%'+_0x442639[_0x48d7('0x3c')][_0x48d7('0x58')]+'%'};return _0x17544a;})});}_0x5d30db=_['merge']({},_0x5d30db,_0x442639[_0x48d7('0x4b')]);return _0x19e96d['getTags'](_0x5d30db);}})[_0x48d7('0x2f')](function(_0x25181c){if(_0x25181c){_0x2a108c=_0x25181c[_0x48d7('0x42')];if(!_0x442639[_0x48d7('0x3c')][_0x48d7('0x59')](_0x48d7('0x43'))){_0x5d30db['limit']=qs[_0x48d7('0x28')](_0x442639[_0x48d7('0x3c')][_0x48d7('0x28')]);_0x5d30db[_0x48d7('0x27')]=qs['offset'](_0x442639['query'][_0x48d7('0x27')]);}return _0x19e96d[_0x48d7('0x5c')](_0x5d30db);}})[_0x48d7('0x2f')](function(_0x41f79a){if(_0x41f79a){return _0x41f79a?{'count':_0x2a108c,'rows':_0x41f79a}:null;}})[_0x48d7('0x2f')](respondWithResult(_0x40300e,null))[_0x48d7('0x25')](handleError(_0x40300e,null));};exports[_0x48d7('0x5e')]=function(_0x1d326b,_0x2a188a,_0x595bbf){if(_0x1d326b['body']['id']){delete _0x1d326b[_0x48d7('0x52')]['id'];}return db['FreshdeskConfiguration'][_0x48d7('0x56')]({'where':{'id':_0x1d326b[_0x48d7('0x54')]['id']}})[_0x48d7('0x2f')](handleEntityNotFound(_0x2a188a,null))['then'](function(_0x5cd7b8){if(_0x5cd7b8){return _0x5cd7b8['setTags'](_0x1d326b['body'][_0x48d7('0x5f')]||[]);}return null;})['then'](respondWithResult(_0x2a188a,null))[_0x48d7('0x25')](handleError(_0x2a188a,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 5ee5c72..adb86ab 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 _0x4404=['define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api','moment','bluebird','request-promise','rimraf','exports'];(function(_0x3e21f4,_0x43d310){var _0x40fc49=function(_0x54a8f6){while(--_0x54a8f6){_0x3e21f4['push'](_0x3e21f4['shift']());}};_0x40fc49(++_0x43d310);}(_0x4404,0x1c6));var _0x4440=function(_0x548e20,_0x5a0474){_0x548e20=_0x548e20-0x0;var _0x46bcda=_0x4404[_0x548e20];return _0x46bcda;};'use strict';var _=require(_0x4440('0x0'));var util=require(_0x4440('0x1'));var logger=require('../../config/logger')(_0x4440('0x2'));var moment=require(_0x4440('0x3'));var BPromise=require(_0x4440('0x4'));var rp=require(_0x4440('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4440('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x4440('0x7')]=function(_0x4ef266,_0x3b92b1){return _0x4ef266[_0x4440('0x8')](_0x4440('0x9'),attributes,{'tableName':_0x4440('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2657=['./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','bluebird','request-promise','rimraf'];(function(_0xde3466,_0x3be8b0){var _0x164adb=function(_0x33ad38){while(--_0x33ad38){_0xde3466['push'](_0xde3466['shift']());}};_0x164adb(++_0x3be8b0);}(_0x2657,0x67));var _0x7265=function(_0x1ef308,_0x8bdfb8){_0x1ef308=_0x1ef308-0x0;var _0x36aa44=_0x2657[_0x1ef308];return _0x36aa44;};'use strict';var _=require(_0x7265('0x0'));var util=require(_0x7265('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7265('0x2'));var rp=require(_0x7265('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7265('0x4'));var config=require('../../config/environment');var attributes=require(_0x7265('0x5'));module[_0x7265('0x6')]=function(_0x8469e0,_0x350f8a){return _0x8469e0['define'](_0x7265('0x7'),attributes,{'tableName':_0x7265('0x8'),'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 e9cf4d0..a076166 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 _0xef2a=['jayson/promise','client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x479967,_0x278601){var _0x5e2c05=function(_0x561619){while(--_0x561619){_0x479967['push'](_0x479967['shift']());}};_0x5e2c05(++_0x278601);}(_0xef2a,0x124));var _0xaef2=function(_0x4e5bfd,_0x413fe6){_0x4e5bfd=_0x4e5bfd-0x0;var _0x4c8e92=_0xef2a[_0x4e5bfd];return _0x4c8e92;};'use strict';var _=require(_0xaef2('0x0'));var util=require('util');var moment=require(_0xaef2('0x1'));var BPromise=require('bluebird');var rs=require(_0xaef2('0x2'));var fs=require('fs');var Redis=require(_0xaef2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaef2('0x4'));var logger=require(_0xaef2('0x5'))(_0xaef2('0x6'));var config=require(_0xaef2('0x7'));var jayson=require(_0xaef2('0x8'));var client=jayson[_0xaef2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20df1e,_0x30d7cd,_0x1a1452){return new BPromise(function(_0x5c5b54,_0x400e46){return client[_0xaef2('0xa')](_0x20df1e,_0x1a1452)[_0xaef2('0xb')](function(_0x2d5b7b){logger[_0xaef2('0xc')](_0xaef2('0xd'),_0x30d7cd,_0xaef2('0xe'));logger['debug'](_0xaef2('0xf'),_0x30d7cd,_0xaef2('0xe'),JSON['stringify'](_0x2d5b7b));if(_0x2d5b7b[_0xaef2('0x10')]){if(_0x2d5b7b['error']['code']===0x1f4){logger['error'](_0xaef2('0xd'),_0x30d7cd,_0x2d5b7b[_0xaef2('0x10')][_0xaef2('0x11')]);return _0x400e46(_0x2d5b7b[_0xaef2('0x10')]['message']);}logger[_0xaef2('0x10')](_0xaef2('0xd'),_0x30d7cd,_0x2d5b7b['error'][_0xaef2('0x11')]);return _0x5c5b54(_0x2d5b7b[_0xaef2('0x10')]['message']);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x30d7cd,'request\x20sent');_0x5c5b54(_0x2d5b7b[_0xaef2('0x12')][_0xaef2('0x11')]);}})[_0xaef2('0x13')](function(_0x27ae57){logger[_0xaef2('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x30d7cd,_0x27ae57);_0x400e46(_0x27ae57);});});} \ No newline at end of file +var _0x47db=['rpc','../../config/environment','jayson/promise','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x39e58d,_0x54e68e){var _0x124097=function(_0x4c8491){while(--_0x4c8491){_0x39e58d['push'](_0x39e58d['shift']());}};_0x124097(++_0x54e68e);}(_0x47db,0x12e));var _0xb47d=function(_0xce364d,_0x5032d4){_0xce364d=_0xce364d-0x0;var _0xf4dc17=_0x47db[_0xce364d];return _0xf4dc17;};'use strict';var _=require('lodash');var util=require(_0xb47d('0x0'));var moment=require(_0xb47d('0x1'));var BPromise=require(_0xb47d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb47d('0x3'));var db=require(_0xb47d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb47d('0x5'))(_0xb47d('0x6'));var config=require(_0xb47d('0x7'));var jayson=require(_0xb47d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e06d5,_0xcc6881,_0x189190){return new BPromise(function(_0x2e049f,_0x18e54f){return client[_0xb47d('0x9')](_0x2e06d5,_0x189190)[_0xb47d('0xa')](function(_0x4a129b){logger['info'](_0xb47d('0xb'),_0xcc6881,_0xb47d('0xc'));logger[_0xb47d('0xd')](_0xb47d('0xe'),_0xcc6881,_0xb47d('0xc'),JSON[_0xb47d('0xf')](_0x4a129b));if(_0x4a129b[_0xb47d('0x10')]){if(_0x4a129b[_0xb47d('0x10')][_0xb47d('0x11')]===0x1f4){logger[_0xb47d('0x10')](_0xb47d('0xb'),_0xcc6881,_0x4a129b[_0xb47d('0x10')][_0xb47d('0x12')]);return _0x18e54f(_0x4a129b[_0xb47d('0x10')][_0xb47d('0x12')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0xcc6881,_0x4a129b[_0xb47d('0x10')]['message']);return _0x2e049f(_0x4a129b[_0xb47d('0x10')][_0xb47d('0x12')]);}else{logger[_0xb47d('0x13')](_0xb47d('0xb'),_0xcc6881,_0xb47d('0xc'));_0x2e049f(_0x4a129b[_0xb47d('0x14')]['message']);}})[_0xb47d('0x15')](function(_0x5694a2){logger[_0xb47d('0x10')](_0xb47d('0xb'),_0xcc6881,_0x5694a2);_0x18e54f(_0x5694a2);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index e43c760..cee11a1 100644 --- a/server/api/intFreshdeskField/index.js +++ b/server/api/intFreshdeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['show','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x85e84f,_0x305b33){var _0x12c0e6=function(_0x27d913){while(--_0x27d913){_0x85e84f['push'](_0x85e84f['shift']());}};_0x12c0e6(++_0x305b33);}(_0x008c,0x188));var _0xc008=function(_0x569f5f,_0x1c6c5c){_0x569f5f=_0x569f5f-0x0;var _0x3e8e2e=_0x008c[_0x569f5f];return _0x3e8e2e;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var auth=require(_0xc008('0x5'));var interaction=require(_0xc008('0x6'));var config=require(_0xc008('0x7'));var controller=require(_0xc008('0x8'));router[_0xc008('0x9')]('/',auth[_0xc008('0xa')](),controller[_0xc008('0xb')]);router[_0xc008('0x9')](_0xc008('0xc'),auth['isAuthenticated'](),controller[_0xc008('0xd')]);router['post']('/',auth[_0xc008('0xa')](),controller['create']);router['put'](_0xc008('0xc'),auth[_0xc008('0xa')](),controller['update']);router['delete']('/:id',auth[_0xc008('0xa')](),controller[_0xc008('0xe')]);module['exports']=router; \ No newline at end of file +var _0x9c44=['/:id','isAuthenticated','show','create','put','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index'];(function(_0x32e8f2,_0x33cff3){var _0xefd2e6=function(_0x524abd){while(--_0x524abd){_0x32e8f2['push'](_0x32e8f2['shift']());}};_0xefd2e6(++_0x33cff3);}(_0x9c44,0x178));var _0x49c4=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9c44[_0x18ab2a];return _0x16dcee;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./intFreshdeskField.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['post']('/',auth[_0x49c4('0x9')](),controller[_0x49c4('0xb')]);router[_0x49c4('0xc')](_0x49c4('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x49c4('0xd')](_0x49c4('0x8'),auth['isAuthenticated'](),controller[_0x49c4('0xe')]);module[_0x49c4('0xf')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 57ea5b3..909df94 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 _0x20ec=['string','keyValue','STRING','variable','customVariable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x20ec,0x12f));var _0xc20e=function(_0x52a23f,_0x467b97){_0x52a23f=_0x52a23f-0x0;var _0x14c953=_0x20ec[_0x52a23f];return _0x14c953;};'use strict';var Sequelize=require(_0xc20e('0x0'));module[_0xc20e('0x1')]={'type':{'type':Sequelize[_0xc20e('0x2')](_0xc20e('0x3'),'variable','customVariable',_0xc20e('0x4')),'defaultValue':_0xc20e('0x3')},'content':{'type':Sequelize[_0xc20e('0x5')]},'key':{'type':Sequelize[_0xc20e('0x5')]},'keyType':{'type':Sequelize[_0xc20e('0x2')](_0xc20e('0x3'),_0xc20e('0x6'),_0xc20e('0x7'))},'keyContent':{'type':Sequelize[_0xc20e('0x5')]},'idField':{'type':Sequelize[_0xc20e('0x5')]},'nameField':{'type':Sequelize[_0xc20e('0x5')]},'customField':{'type':Sequelize[_0xc20e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc20e('0x5')]}}; \ No newline at end of file +var _0x180b=['keyValue','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable'];(function(_0x198747,_0x50031a){var _0x37a79d=function(_0x4a4850){while(--_0x4a4850){_0x198747['push'](_0x198747['shift']());}};_0x37a79d(++_0x50031a);}(_0x180b,0xdc));var _0xb180=function(_0x333775,_0x204187){_0x333775=_0x333775-0x0;var _0x210aa6=_0x180b[_0x333775];return _0x210aa6;};'use strict';var Sequelize=require(_0xb180('0x0'));module[_0xb180('0x1')]={'type':{'type':Sequelize[_0xb180('0x2')]('string',_0xb180('0x3'),_0xb180('0x4'),_0xb180('0x5')),'defaultValue':_0xb180('0x6')},'content':{'type':Sequelize[_0xb180('0x7')]},'key':{'type':Sequelize[_0xb180('0x7')]},'keyType':{'type':Sequelize[_0xb180('0x2')](_0xb180('0x6'),_0xb180('0x3'),_0xb180('0x4'))},'keyContent':{'type':Sequelize[_0xb180('0x7')]},'idField':{'type':Sequelize[_0xb180('0x7')]},'nameField':{'type':Sequelize[_0xb180('0x7')]},'customField':{'type':Sequelize[_0xb180('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 23951c0..c3e05b5 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 _0xdd29=['reject','save','update','then','destroy','error','name','index','map','FreshdeskField','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','html-pdf','rimraf','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','apply'];(function(_0x153faa,_0x75f2a){var _0x43c32a=function(_0x1c5721){while(--_0x1c5721){_0x153faa['push'](_0x153faa['shift']());}};_0x43c32a(++_0x75f2a);}(_0xdd29,0x192));var _0x9dd2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdd29[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x9dd2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9dd2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9dd2('0x2'));var moment=require(_0x9dd2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9dd2('0x4'));var util=require(_0x9dd2('0x5'));var path=require('path');var sox=require(_0x9dd2('0x6'));var csv=require(_0x9dd2('0x7'));var ejs=require(_0x9dd2('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9dd2('0x9'));var crypto=require(_0x9dd2('0xa'));var jsforce=require(_0x9dd2('0xb'));var deskjs=require(_0x9dd2('0xc'));var toCsv=require(_0x9dd2('0x7'));var querystring=require(_0x9dd2('0xd'));var Papa=require(_0x9dd2('0xe'));var Redis=require(_0x9dd2('0xf'));var authService=require(_0x9dd2('0x10'));var qs=require(_0x9dd2('0x11'));var as=require(_0x9dd2('0x12'));var hardwareService=require(_0x9dd2('0x13'));var logger=require(_0x9dd2('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x9dd2('0x15'));var db=require(_0x9dd2('0x16'))['db'];function respondWithStatusCode(_0x1dbf5a,_0x1c57f3){_0x1c57f3=_0x1c57f3||0xcc;return function(_0x4b78b8){if(_0x4b78b8){return _0x1dbf5a[_0x9dd2('0x17')](_0x1c57f3);}return _0x1dbf5a[_0x9dd2('0x18')](_0x1c57f3)[_0x9dd2('0x19')]();};}function respondWithResult(_0x384ed9,_0x270b42){_0x270b42=_0x270b42||0xc8;return function(_0x3b469d){if(_0x3b469d){return _0x384ed9[_0x9dd2('0x18')](_0x270b42)[_0x9dd2('0x1a')](_0x3b469d);}};}function respondWithFilteredResult(_0x453bdc,_0x3249ec){return function(_0x598380){if(_0x598380){var _0x3b6f0c=_0x598380[_0x9dd2('0x1b')],_0x4799a0=_0x3249ec[_0x9dd2('0x1c')],_0x43196e=_0x3249ec[_0x9dd2('0x1c')]+_0x3249ec['limit'],_0x1fefee;if(_0x43196e>=_0x3b6f0c){_0x43196e=_0x3b6f0c;_0x1fefee=0xc8;}else{_0x1fefee=0xce;}_0x453bdc[_0x9dd2('0x18')](_0x1fefee);return _0x453bdc['set']('Content-Range',_0x4799a0+'-'+_0x43196e+'/'+_0x3b6f0c)[_0x9dd2('0x1a')](_0x598380);}return null;};}function patchUpdates(_0x4f2f97){return function(_0x4ad2aa){try{jsonpatch[_0x9dd2('0x1d')](_0x4ad2aa,_0x4f2f97,!![]);}catch(_0x381f3c){return BPromise[_0x9dd2('0x1e')](_0x381f3c);}return _0x4ad2aa[_0x9dd2('0x1f')]();};}function saveUpdates(_0x220da7,_0xa91ec3){return function(_0x56aa61){if(_0x56aa61){return _0x56aa61[_0x9dd2('0x20')](_0x220da7)[_0x9dd2('0x21')](function(_0x35f90a){return _0x35f90a;});}return null;};}function removeEntity(_0x205bd1,_0x485bf6){return function(_0x571831){if(_0x571831){return _0x571831[_0x9dd2('0x22')]()[_0x9dd2('0x21')](function(){_0x205bd1[_0x9dd2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x347834,_0xe571f6){return function(_0x39efab){if(!_0x39efab){_0x347834['sendStatus'](0x194);}return _0x39efab;};}function handleError(_0x2fbfe1,_0x146fb2){_0x146fb2=_0x146fb2||0x1f4;return function(_0x109010){logger[_0x9dd2('0x23')](_0x109010['stack']);if(_0x109010['name']){delete _0x109010[_0x9dd2('0x24')];}_0x2fbfe1[_0x9dd2('0x18')](_0x146fb2)['send'](_0x109010);};}exports[_0x9dd2('0x25')]=function(_0x1b2586,_0x2091c8){var _0x3cbc67={},_0x164fe8={},_0x1832d4={'count':0x0,'rows':[]};var _0x410e24=_[_0x9dd2('0x26')](db[_0x9dd2('0x27')][_0x9dd2('0x28')],function(_0x25f983){return{'name':_0x25f983[_0x9dd2('0x29')],'type':_0x25f983['type']['key']};});_0x164fe8[_0x9dd2('0x2a')]=_[_0x9dd2('0x26')](_0x410e24,'name');_0x164fe8[_0x9dd2('0x2b')]=_[_0x9dd2('0x2c')](_0x1b2586[_0x9dd2('0x2b')]);_0x164fe8[_0x9dd2('0x2d')]=_['intersection'](_0x164fe8[_0x9dd2('0x2a')],_0x164fe8[_0x9dd2('0x2b')]);_0x3cbc67[_0x9dd2('0x2e')]=_[_0x9dd2('0x2f')](_0x164fe8[_0x9dd2('0x2a')],qs[_0x9dd2('0x30')](_0x1b2586[_0x9dd2('0x2b')][_0x9dd2('0x30')]));_0x3cbc67[_0x9dd2('0x2e')]=_0x3cbc67[_0x9dd2('0x2e')]['length']?_0x3cbc67[_0x9dd2('0x2e')]:_0x164fe8[_0x9dd2('0x2a')];if(!_0x1b2586['query'][_0x9dd2('0x31')](_0x9dd2('0x32'))){_0x3cbc67[_0x9dd2('0x33')]=qs['limit'](_0x1b2586['query'][_0x9dd2('0x33')]);_0x3cbc67[_0x9dd2('0x1c')]=qs[_0x9dd2('0x1c')](_0x1b2586[_0x9dd2('0x2b')][_0x9dd2('0x1c')]);}_0x3cbc67[_0x9dd2('0x34')]=qs[_0x9dd2('0x35')](_0x1b2586['query'][_0x9dd2('0x35')]);_0x3cbc67[_0x9dd2('0x36')]=qs[_0x9dd2('0x2d')](_[_0x9dd2('0x37')](_0x1b2586[_0x9dd2('0x2b')],_0x164fe8[_0x9dd2('0x2d')]));if(_0x1b2586[_0x9dd2('0x2b')][_0x9dd2('0x38')]){_0x3cbc67[_0x9dd2('0x36')]=_[_0x9dd2('0x39')](_0x3cbc67[_0x9dd2('0x36')],{'$or':_[_0x9dd2('0x26')](_0x410e24,function(_0x2a07da){if(_0x2a07da[_0x9dd2('0x3a')]!==_0x9dd2('0x3b')){var _0x3b9555={};_0x3b9555[_0x2a07da[_0x9dd2('0x24')]]={'$like':'%'+_0x1b2586[_0x9dd2('0x2b')]['filter']+'%'};return _0x3b9555;}})});}_0x3cbc67=_['merge']({},_0x3cbc67,_0x1b2586[_0x9dd2('0x3c')]);var _0x2f829e={'where':_0x3cbc67['where']};return db[_0x9dd2('0x27')]['count'](_0x2f829e)[_0x9dd2('0x21')](function(_0x3a0dc5){_0x1832d4[_0x9dd2('0x1b')]=_0x3a0dc5;if(_0x1b2586[_0x9dd2('0x2b')]['includeAll']){_0x3cbc67[_0x9dd2('0x3d')]=[{'all':!![]}];}return db[_0x9dd2('0x27')][_0x9dd2('0x3e')](_0x3cbc67);})['then'](function(_0x14faac){_0x1832d4[_0x9dd2('0x3f')]=_0x14faac;return _0x1832d4;})[_0x9dd2('0x21')](respondWithFilteredResult(_0x2091c8,_0x3cbc67))[_0x9dd2('0x40')](handleError(_0x2091c8,null));};exports[_0x9dd2('0x41')]=function(_0x286bad,_0x4f1af5){var _0x2f5136={'raw':!![],'where':{'id':_0x286bad[_0x9dd2('0x42')]['id']}},_0x1aa617={};_0x1aa617['model']=_[_0x9dd2('0x2c')](db['FreshdeskField'][_0x9dd2('0x28')]);_0x1aa617[_0x9dd2('0x2b')]=_[_0x9dd2('0x2c')](_0x286bad['query']);_0x1aa617[_0x9dd2('0x2d')]=_[_0x9dd2('0x2f')](_0x1aa617[_0x9dd2('0x2a')],_0x1aa617[_0x9dd2('0x2b')]);_0x2f5136['attributes']=_[_0x9dd2('0x2f')](_0x1aa617['model'],qs[_0x9dd2('0x30')](_0x286bad[_0x9dd2('0x2b')][_0x9dd2('0x30')]));_0x2f5136['attributes']=_0x2f5136[_0x9dd2('0x2e')][_0x9dd2('0x43')]?_0x2f5136[_0x9dd2('0x2e')]:_0x1aa617[_0x9dd2('0x2a')];if(_0x286bad[_0x9dd2('0x2b')][_0x9dd2('0x44')]){_0x2f5136['include']=[{'all':!![]}];}_0x2f5136=_['merge']({},_0x2f5136,_0x286bad[_0x9dd2('0x3c')]);return db[_0x9dd2('0x27')][_0x9dd2('0x45')](_0x2f5136)[_0x9dd2('0x21')](handleEntityNotFound(_0x4f1af5,null))['then'](respondWithResult(_0x4f1af5,null))[_0x9dd2('0x40')](handleError(_0x4f1af5,null));};exports[_0x9dd2('0x46')]=function(_0x2a255c,_0x307184){return db['FreshdeskField'][_0x9dd2('0x46')](_0x2a255c[_0x9dd2('0x47')],{})[_0x9dd2('0x21')](respondWithResult(_0x307184,0xc9))[_0x9dd2('0x40')](handleError(_0x307184,null));};exports[_0x9dd2('0x20')]=function(_0xd3fbc,_0x346616){if(_0xd3fbc[_0x9dd2('0x47')]['id']){delete _0xd3fbc[_0x9dd2('0x47')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0xd3fbc[_0x9dd2('0x42')]['id']}})['then'](handleEntityNotFound(_0x346616,null))[_0x9dd2('0x21')](saveUpdates(_0xd3fbc['body'],null))[_0x9dd2('0x21')](respondWithResult(_0x346616,null))['catch'](handleError(_0x346616,null));};exports['destroy']=function(_0x19086e,_0x4f1e0f){return db['FreshdeskField'][_0x9dd2('0x45')]({'where':{'id':_0x19086e[_0x9dd2('0x42')]['id']}})[_0x9dd2('0x21')](handleEntityNotFound(_0x4f1e0f,null))[_0x9dd2('0x21')](removeEntity(_0x4f1e0f,null))[_0x9dd2('0x40')](handleError(_0x4f1e0f,null));}; \ No newline at end of file +var _0xecca=['apply','reject','save','update','then','error','stack','name','send','index','map','FreshdeskField','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','body','params','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range'];(function(_0xb68fdf,_0x1298bd){var _0x4382bc=function(_0x3d8b85){while(--_0x3d8b85){_0xb68fdf['push'](_0xb68fdf['shift']());}};_0x4382bc(++_0x1298bd);}(_0xecca,0x1a4));var _0xaecc=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xecca[_0x9cd4c3];return _0x4c9025;};'use strict';var pdf=require(_0xaecc('0x0'));var emlformat=require(_0xaecc('0x1'));var rimraf=require(_0xaecc('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaecc('0x3'));var rp=require(_0xaecc('0x4'));var moment=require(_0xaecc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xaecc('0x6'));var util=require('util');var path=require(_0xaecc('0x7'));var sox=require(_0xaecc('0x8'));var csv=require(_0xaecc('0x9'));var ejs=require(_0xaecc('0xa'));var fs=require('fs');var _=require(_0xaecc('0xb'));var squel=require(_0xaecc('0xc'));var crypto=require(_0xaecc('0xd'));var jsforce=require(_0xaecc('0xe'));var deskjs=require(_0xaecc('0xf'));var toCsv=require(_0xaecc('0x9'));var querystring=require('querystring');var Papa=require(_0xaecc('0x10'));var Redis=require(_0xaecc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xaecc('0x12'));var as=require(_0xaecc('0x13'));var hardwareService=require(_0xaecc('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xaecc('0x15'))['db'];function respondWithStatusCode(_0x4eca20,_0x445ddd){_0x445ddd=_0x445ddd||0xcc;return function(_0x22fa8){if(_0x22fa8){return _0x4eca20[_0xaecc('0x16')](_0x445ddd);}return _0x4eca20[_0xaecc('0x17')](_0x445ddd)[_0xaecc('0x18')]();};}function respondWithResult(_0xd8e1ce,_0x51d612){_0x51d612=_0x51d612||0xc8;return function(_0x480f17){if(_0x480f17){return _0xd8e1ce[_0xaecc('0x17')](_0x51d612)[_0xaecc('0x19')](_0x480f17);}};}function respondWithFilteredResult(_0x38619f,_0x2d2397){return function(_0x436d2e){if(_0x436d2e){var _0x4b6525=_0x436d2e[_0xaecc('0x1a')],_0xb7b77=_0x2d2397[_0xaecc('0x1b')],_0x370ecc=_0x2d2397['offset']+_0x2d2397[_0xaecc('0x1c')],_0x25902a;if(_0x370ecc>=_0x4b6525){_0x370ecc=_0x4b6525;_0x25902a=0xc8;}else{_0x25902a=0xce;}_0x38619f[_0xaecc('0x17')](_0x25902a);return _0x38619f['set'](_0xaecc('0x1d'),_0xb7b77+'-'+_0x370ecc+'/'+_0x4b6525)[_0xaecc('0x19')](_0x436d2e);}return null;};}function patchUpdates(_0x782a57){return function(_0x3dbd8c){try{jsonpatch[_0xaecc('0x1e')](_0x3dbd8c,_0x782a57,!![]);}catch(_0x55eaf7){return BPromise[_0xaecc('0x1f')](_0x55eaf7);}return _0x3dbd8c[_0xaecc('0x20')]();};}function saveUpdates(_0x4953a3,_0x1359c4){return function(_0x5c1644){if(_0x5c1644){return _0x5c1644[_0xaecc('0x21')](_0x4953a3)[_0xaecc('0x22')](function(_0x3d757a){return _0x3d757a;});}return null;};}function removeEntity(_0x122f70,_0x17ac5b){return function(_0x422301){if(_0x422301){return _0x422301['destroy']()[_0xaecc('0x22')](function(){_0x122f70[_0xaecc('0x17')](0xcc)[_0xaecc('0x18')]();});}};}function handleEntityNotFound(_0x2dee1e,_0x27b3af){return function(_0x398e7d){if(!_0x398e7d){_0x2dee1e[_0xaecc('0x16')](0x194);}return _0x398e7d;};}function handleError(_0x3bb571,_0x33d138){_0x33d138=_0x33d138||0x1f4;return function(_0x2f8b6d){logger[_0xaecc('0x23')](_0x2f8b6d[_0xaecc('0x24')]);if(_0x2f8b6d[_0xaecc('0x25')]){delete _0x2f8b6d[_0xaecc('0x25')];}_0x3bb571[_0xaecc('0x17')](_0x33d138)[_0xaecc('0x26')](_0x2f8b6d);};}exports[_0xaecc('0x27')]=function(_0x27114e,_0x5c560d){var _0x11d0e6={},_0x2f1f8a={},_0x37b90e={'count':0x0,'rows':[]};var _0x5796b8=_[_0xaecc('0x28')](db[_0xaecc('0x29')]['rawAttributes'],function(_0x27078b){return{'name':_0x27078b[_0xaecc('0x2a')],'type':_0x27078b[_0xaecc('0x2b')][_0xaecc('0x2c')]};});_0x2f1f8a[_0xaecc('0x2d')]=_[_0xaecc('0x28')](_0x5796b8,_0xaecc('0x25'));_0x2f1f8a['query']=_[_0xaecc('0x2e')](_0x27114e['query']);_0x2f1f8a[_0xaecc('0x2f')]=_[_0xaecc('0x30')](_0x2f1f8a[_0xaecc('0x2d')],_0x2f1f8a[_0xaecc('0x31')]);_0x11d0e6[_0xaecc('0x32')]=_[_0xaecc('0x30')](_0x2f1f8a[_0xaecc('0x2d')],qs[_0xaecc('0x33')](_0x27114e[_0xaecc('0x31')][_0xaecc('0x33')]));_0x11d0e6[_0xaecc('0x32')]=_0x11d0e6[_0xaecc('0x32')][_0xaecc('0x34')]?_0x11d0e6[_0xaecc('0x32')]:_0x2f1f8a[_0xaecc('0x2d')];if(!_0x27114e[_0xaecc('0x31')][_0xaecc('0x35')](_0xaecc('0x36'))){_0x11d0e6[_0xaecc('0x1c')]=qs[_0xaecc('0x1c')](_0x27114e['query'][_0xaecc('0x1c')]);_0x11d0e6[_0xaecc('0x1b')]=qs[_0xaecc('0x1b')](_0x27114e[_0xaecc('0x31')][_0xaecc('0x1b')]);}_0x11d0e6[_0xaecc('0x37')]=qs[_0xaecc('0x38')](_0x27114e[_0xaecc('0x31')]['sort']);_0x11d0e6[_0xaecc('0x39')]=qs['filters'](_[_0xaecc('0x3a')](_0x27114e[_0xaecc('0x31')],_0x2f1f8a['filters']));if(_0x27114e[_0xaecc('0x31')][_0xaecc('0x3b')]){_0x11d0e6[_0xaecc('0x39')]=_[_0xaecc('0x3c')](_0x11d0e6[_0xaecc('0x39')],{'$or':_[_0xaecc('0x28')](_0x5796b8,function(_0x4a3731){if(_0x4a3731[_0xaecc('0x2b')]!==_0xaecc('0x3d')){var _0x308266={};_0x308266[_0x4a3731['name']]={'$like':'%'+_0x27114e['query'][_0xaecc('0x3b')]+'%'};return _0x308266;}})});}_0x11d0e6=_[_0xaecc('0x3c')]({},_0x11d0e6,_0x27114e[_0xaecc('0x3e')]);var _0x10c94c={'where':_0x11d0e6[_0xaecc('0x39')]};return db[_0xaecc('0x29')][_0xaecc('0x1a')](_0x10c94c)[_0xaecc('0x22')](function(_0x53e513){_0x37b90e[_0xaecc('0x1a')]=_0x53e513;if(_0x27114e['query'][_0xaecc('0x3f')]){_0x11d0e6[_0xaecc('0x40')]=[{'all':!![]}];}return db[_0xaecc('0x29')][_0xaecc('0x41')](_0x11d0e6);})['then'](function(_0x18e73a){_0x37b90e[_0xaecc('0x42')]=_0x18e73a;return _0x37b90e;})[_0xaecc('0x22')](respondWithFilteredResult(_0x5c560d,_0x11d0e6))['catch'](handleError(_0x5c560d,null));};exports[_0xaecc('0x43')]=function(_0x2fa962,_0x324e3b){var _0x1ab14d={'raw':!![],'where':{'id':_0x2fa962['params']['id']}},_0x305583={};_0x305583[_0xaecc('0x2d')]=_[_0xaecc('0x2e')](db['FreshdeskField'][_0xaecc('0x44')]);_0x305583[_0xaecc('0x31')]=_[_0xaecc('0x2e')](_0x2fa962[_0xaecc('0x31')]);_0x305583[_0xaecc('0x2f')]=_[_0xaecc('0x30')](_0x305583[_0xaecc('0x2d')],_0x305583['query']);_0x1ab14d[_0xaecc('0x32')]=_[_0xaecc('0x30')](_0x305583[_0xaecc('0x2d')],qs[_0xaecc('0x33')](_0x2fa962[_0xaecc('0x31')][_0xaecc('0x33')]));_0x1ab14d[_0xaecc('0x32')]=_0x1ab14d[_0xaecc('0x32')]['length']?_0x1ab14d['attributes']:_0x305583['model'];if(_0x2fa962[_0xaecc('0x31')][_0xaecc('0x3f')]){_0x1ab14d['include']=[{'all':!![]}];}_0x1ab14d=_['merge']({},_0x1ab14d,_0x2fa962[_0xaecc('0x3e')]);return db[_0xaecc('0x29')][_0xaecc('0x45')](_0x1ab14d)['then'](handleEntityNotFound(_0x324e3b,null))[_0xaecc('0x22')](respondWithResult(_0x324e3b,null))[_0xaecc('0x46')](handleError(_0x324e3b,null));};exports['create']=function(_0x6e4286,_0x5f4a2f){return db[_0xaecc('0x29')][_0xaecc('0x47')](_0x6e4286[_0xaecc('0x48')],{})[_0xaecc('0x22')](respondWithResult(_0x5f4a2f,0xc9))[_0xaecc('0x46')](handleError(_0x5f4a2f,null));};exports['update']=function(_0x54025a,_0x11ba0a){if(_0x54025a[_0xaecc('0x48')]['id']){delete _0x54025a[_0xaecc('0x48')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x54025a[_0xaecc('0x49')]['id']}})['then'](handleEntityNotFound(_0x11ba0a,null))[_0xaecc('0x22')](saveUpdates(_0x54025a['body'],null))['then'](respondWithResult(_0x11ba0a,null))['catch'](handleError(_0x11ba0a,null));};exports[_0xaecc('0x4a')]=function(_0x100320,_0x3366c8){return db['FreshdeskField'][_0xaecc('0x45')]({'where':{'id':_0x100320[_0xaecc('0x49')]['id']}})[_0xaecc('0x22')](handleEntityNotFound(_0x3366c8,null))['then'](removeEntity(_0x3366c8,null))[_0xaecc('0x46')](handleError(_0x3366c8,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 1e4ec1e..e975307 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 _0xb1e3=['exports','define','FreshdeskField','freshdesk_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes'];(function(_0x5e9b23,_0x3069fd){var _0x27501f=function(_0x37667c){while(--_0x37667c){_0x5e9b23['push'](_0x5e9b23['shift']());}};_0x27501f(++_0x3069fd);}(_0xb1e3,0xb5));var _0x3b1e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb1e3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3b1e('0x0'));var util=require(_0x3b1e('0x1'));var logger=require(_0x3b1e('0x2'))(_0x3b1e('0x3'));var moment=require(_0x3b1e('0x4'));var BPromise=require(_0x3b1e('0x5'));var rp=require(_0x3b1e('0x6'));var fs=require('fs');var path=require(_0x3b1e('0x7'));var rimraf=require(_0x3b1e('0x8'));var config=require(_0x3b1e('0x9'));var attributes=require(_0x3b1e('0xa'));module[_0x3b1e('0xb')]=function(_0x1d26a3,_0x5bd08c){return _0x1d26a3[_0x3b1e('0xc')](_0x3b1e('0xd'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x3b1e('0xe'),'fields':['idField',_0x3b1e('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7ba=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','int_freshdesk_fields','idField','FieldId'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb7ba,0x11e));var _0xab7b=function(_0x9c6e38,_0x1fc24e){_0x9c6e38=_0x9c6e38-0x0;var _0x148e08=_0xb7ba[_0x9c6e38];return _0x148e08;};'use strict';var _=require(_0xab7b('0x0'));var util=require(_0xab7b('0x1'));var logger=require(_0xab7b('0x2'))(_0xab7b('0x3'));var moment=require(_0xab7b('0x4'));var BPromise=require(_0xab7b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xab7b('0x6'));var rimraf=require(_0xab7b('0x7'));var config=require(_0xab7b('0x8'));var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0x1bc288,_0x18c24e){return _0x1bc288[_0xab7b('0x9')]('FreshdeskField',attributes,{'tableName':_0xab7b('0xa'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xab7b('0xb'),_0xab7b('0xc')],'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 3814127..1adeb00 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(_0x455033,_0x5d8727){var _0x406304=function(_0x2189b0){while(--_0x2189b0){_0x455033['push'](_0x455033['shift']());}};_0x406304(++_0x5d8727);}(_0xb10b,0x12a));var _0xbb10=function(_0x7f9224,_0x186851){_0x7f9224=_0x7f9224-0x0;var _0x3bc305=_0xb10b[_0x7f9224];return _0x3bc305;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file +var _0x7a54=['info','FreshdeskField,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x5be2ba,_0x11569b){_0x5be2ba=_0x5be2ba-0x0;var _0x14dedf=_0x7a54[_0x5be2ba];return _0x14dedf;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 29b4902..30a7b40 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 _0x5694=['../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','destroy','multer','util','connect-timeout','express','Router'];(function(_0x1bd51b,_0x23c389){var _0x3fccf7=function(_0x1e8ec9){while(--_0x1e8ec9){_0x1bd51b['push'](_0x1bd51b['shift']());}};_0x3fccf7(++_0x23c389);}(_0x5694,0x95));var _0x4569=function(_0xcb75d0,_0x35afb7){_0xcb75d0=_0xcb75d0-0x0;var _0x522cbf=_0x5694[_0xcb75d0];return _0x522cbf;};'use strict';var multer=require(_0x4569('0x0'));var util=require(_0x4569('0x1'));var path=require('path');var timeout=require(_0x4569('0x2'));var express=require(_0x4569('0x3'));var router=express[_0x4569('0x4')]();var auth=require(_0x4569('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4569('0x6'));var controller=require('./intFreshsalesAccount.controller');router['get']('/',auth[_0x4569('0x7')](),controller[_0x4569('0x8')]);router[_0x4569('0x9')](_0x4569('0xa'),auth[_0x4569('0x7')](),controller[_0x4569('0xb')]);router[_0x4569('0x9')](_0x4569('0xc'),auth[_0x4569('0x7')](),controller[_0x4569('0xd')]);router[_0x4569('0x9')]('/:id/fields',auth[_0x4569('0x7')](),controller[_0x4569('0xe')]);router[_0x4569('0xf')]('/',auth['isAuthenticated'](),controller[_0x4569('0x10')]);router[_0x4569('0xf')](_0x4569('0xc'),auth[_0x4569('0x7')](),controller[_0x4569('0x11')]);router[_0x4569('0x12')]('/:id',auth[_0x4569('0x7')](),controller[_0x4569('0x13')]);router[_0x4569('0x14')](_0x4569('0xa'),auth['isAuthenticated'](),controller[_0x4569('0x15')]);module['exports']=router; \ No newline at end of file +var _0x4254=['../../components/interaction/service','./intFreshsalesAccount.controller','get','isAuthenticated','/:id','getFields','post','create','/:id/configurations','addConfiguration','put','update','multer','util','express','Router','../../components/auth/service'];(function(_0x23a2eb,_0x3b2e33){var _0x11525f=function(_0x10180c){while(--_0x10180c){_0x23a2eb['push'](_0x23a2eb['shift']());}};_0x11525f(++_0x3b2e33);}(_0x4254,0x13e));var _0x4425=function(_0x4b29da,_0x50c198){_0x4b29da=_0x4b29da-0x0;var _0x51b9c9=_0x4254[_0x4b29da];return _0x51b9c9;};'use strict';var multer=require(_0x4425('0x0'));var util=require(_0x4425('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4425('0x2'));var router=express[_0x4425('0x3')]();var auth=require(_0x4425('0x4'));var interaction=require(_0x4425('0x5'));var config=require('../../config/environment');var controller=require(_0x4425('0x6'));router[_0x4425('0x7')]('/',auth[_0x4425('0x8')](),controller['index']);router[_0x4425('0x7')](_0x4425('0x9'),auth[_0x4425('0x8')](),controller['show']);router[_0x4425('0x7')]('/:id/configurations',auth[_0x4425('0x8')](),controller['getConfigurations']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x4425('0xa')]);router[_0x4425('0xb')]('/',auth[_0x4425('0x8')](),controller[_0x4425('0xc')]);router[_0x4425('0xb')](_0x4425('0xd'),auth[_0x4425('0x8')](),controller[_0x4425('0xe')]);router[_0x4425('0xf')](_0x4425('0x9'),auth[_0x4425('0x8')](),controller[_0x4425('0x10')]);router['delete'](_0x4425('0x9'),auth[_0x4425('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 8ff19ba..d4bc246 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 _0x3746=['username','sequelize','exports','STRING'];(function(_0x396f22,_0x4d87a8){var _0x7aeaa6=function(_0x430844){while(--_0x430844){_0x396f22['push'](_0x396f22['shift']());}};_0x7aeaa6(++_0x4d87a8);}(_0x3746,0xa9));var _0x6374=function(_0x5064f4,_0x4e9545){_0x5064f4=_0x5064f4-0x0;var _0x4260cd=_0x3746[_0x5064f4];return _0x4260cd;};'use strict';var Sequelize=require(_0x6374('0x0'));module[_0x6374('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6374('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x6374('0x3')},'apiKey':{'type':Sequelize[_0x6374('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6374('0x2')]}}; \ No newline at end of file +var _0x57ef=['exports','STRING','username'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x57ef,0xdb));var _0xf57e=function(_0xf19008,_0x2fc5a2){_0xf19008=_0xf19008-0x0;var _0x8ad773=_0x57ef[_0xf19008];return _0x8ad773;};'use strict';var Sequelize=require('sequelize');module[_0xf57e('0x0')]={'name':{'type':Sequelize[_0xf57e('0x1')]},'description':{'type':Sequelize[_0xf57e('0x1')]},'username':{'type':Sequelize[_0xf57e('0x1')],'unique':_0xf57e('0x2')},'apiKey':{'type':Sequelize[_0xf57e('0x1')]},'remoteUri':{'type':Sequelize[_0xf57e('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xf57e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index a1afb39..cf6bbd9 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 _0x94a1=['params','pick','getConfigurations','nolimit','AccountId','getSubjects','Descriptions','getDescriptions','FreshsalesConfiguration','Subjects','getFields','findOne','username','remoteUri','apiKey','substring','lastIndexOf','GET','format','%s%s','Token\x20token=','users','email','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../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','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','count','offset','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','map','rawAttributes','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','filter','merge','where','type','VIRTUAL','options','FreshsalesAccount','includeAll','include','show','find','create','body'];(function(_0x5caf7e,_0x52e1bc){var _0x5c3435=function(_0xb77e11){while(--_0xb77e11){_0x5caf7e['push'](_0x5caf7e['shift']());}};_0x5c3435(++_0x52e1bc);}(_0x94a1,0x8b));var _0x194a=function(_0x1f71d2,_0x5e4cff){_0x1f71d2=_0x1f71d2-0x0;var _0x389d01=_0x94a1[_0x1f71d2];return _0x389d01;};'use strict';var pdf=require(_0x194a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x194a('0x1'));var zipdir=require(_0x194a('0x2'));var jsonpatch=require(_0x194a('0x3'));var rp=require(_0x194a('0x4'));var moment=require(_0x194a('0x5'));var BPromise=require(_0x194a('0x6'));var Mustache=require(_0x194a('0x7'));var util=require('util');var path=require('path');var sox=require(_0x194a('0x8'));var csv=require(_0x194a('0x9'));var ejs=require(_0x194a('0xa'));var fs=require('fs');var _=require(_0x194a('0xb'));var squel=require('squel');var crypto=require(_0x194a('0xc'));var jsforce=require(_0x194a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x194a('0x9'));var querystring=require(_0x194a('0xe'));var Papa=require(_0x194a('0xf'));var Redis=require(_0x194a('0x10'));var authService=require(_0x194a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x194a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x194a('0x13'))(_0x194a('0x14'));var utils=require(_0x194a('0x15'));var config=require(_0x194a('0x16'));var db=require(_0x194a('0x17'))['db'];var integrations=require(_0x194a('0x18'));var jayson=require(_0x194a('0x19'));var client=jayson[_0x194a('0x1a')][_0x194a('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x13121f,_0x136917,_0x5d3540){if(_0x5d3540){var _0x1554ab=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1554ab['test'](_0x136917)){return _0x13121f;}else{throw new db[(_0x194a('0x1c'))]['ValidationError'](_0x194a('0x1d'));}}else{return _0x13121f;}}function respondWithRpcPromise(_0xe395bb,_0x287c87,_0x10b1de,_0x250b8d){return new BPromise(function(_0x682ad0,_0x1f80af){var _0x364292=_0x250b8d||client;return _0x364292[_0x194a('0x1e')](_0xe395bb,_0x10b1de)[_0x194a('0x1f')](function(_0x3278e4){logger[_0x194a('0x20')](_0x194a('0x21'),_0x287c87,_0x194a('0x22'));logger[_0x194a('0x23')](_0x194a('0x24'),_0x287c87,'request\x20sent',JSON[_0x194a('0x25')](_0x3278e4));if(_0x3278e4[_0x194a('0x26')]){if(_0x3278e4['error'][_0x194a('0x27')]===0x1f4){logger[_0x194a('0x26')](_0x194a('0x21'),_0x287c87,_0x3278e4['error']['message']);return _0x1f80af(_0x3278e4[_0x194a('0x26')][_0x194a('0x28')]);}logger['error'](_0x194a('0x21'),_0x287c87,_0x3278e4[_0x194a('0x26')]['message']);return _0x682ad0(_0x3278e4['error'][_0x194a('0x28')]);}else{logger[_0x194a('0x20')](_0x194a('0x21'),_0x287c87,_0x194a('0x22'));_0x682ad0(_0x3278e4['result'][_0x194a('0x28')]);}})[_0x194a('0x29')](function(_0x5e2442){logger[_0x194a('0x26')](_0x194a('0x21'),_0x287c87,_0x5e2442);_0x1f80af(_0x5e2442);});});}function respondWithStatusCode(_0xd02a70,_0xbc0d7b){_0xbc0d7b=_0xbc0d7b||0xcc;return function(_0xc24dd4){if(_0xc24dd4){return _0xd02a70['sendStatus'](_0xbc0d7b);}return _0xd02a70[_0x194a('0x2a')](_0xbc0d7b)[_0x194a('0x2b')]();};}function respondWithResult(_0x31f3af,_0x4fbaec){_0x4fbaec=_0x4fbaec||0xc8;return function(_0x3a09dc){if(_0x3a09dc){return _0x31f3af['status'](_0x4fbaec)['json'](_0x3a09dc);}};}function respondWithFilteredResult(_0x6c029f,_0xa59bcc){return function(_0x263e9f){if(_0x263e9f){var _0x1279ef=_0x263e9f[_0x194a('0x2c')],_0x40a5ab=_0xa59bcc[_0x194a('0x2d')],_0x526897=_0xa59bcc[_0x194a('0x2d')]+_0xa59bcc['limit'],_0x197d8b;if(_0x526897>=_0x1279ef){_0x526897=_0x1279ef;_0x197d8b=0xc8;}else{_0x197d8b=0xce;}_0x6c029f[_0x194a('0x2a')](_0x197d8b);return _0x6c029f[_0x194a('0x2e')](_0x194a('0x2f'),_0x40a5ab+'-'+_0x526897+'/'+_0x1279ef)['json'](_0x263e9f);}return null;};}function patchUpdates(_0x8035c9){return function(_0x5e7f37){try{jsonpatch[_0x194a('0x30')](_0x5e7f37,_0x8035c9,!![]);}catch(_0x3fe597){return BPromise[_0x194a('0x31')](_0x3fe597);}return _0x5e7f37[_0x194a('0x32')]();};}function saveUpdates(_0x9a513d,_0xf42872){return function(_0xaba330){if(_0xaba330){return _0xaba330[_0x194a('0x33')](_0x9a513d)[_0x194a('0x1f')](function(_0x408aa4){return _0x408aa4;});}return null;};}function removeEntity(_0x227e14,_0x5ef8e5){return function(_0x42e649){if(_0x42e649){return _0x42e649[_0x194a('0x34')]()['then'](function(){_0x227e14[_0x194a('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35858c,_0x15bb03){return function(_0x379b0e){if(!_0x379b0e){_0x35858c[_0x194a('0x35')](0x194);}return _0x379b0e;};}function handleError(_0x3734d0,_0x40e73c){_0x40e73c=_0x40e73c||0x1f4;return function(_0x468781){logger[_0x194a('0x26')](_0x468781[_0x194a('0x36')]);if(_0x468781[_0x194a('0x37')]){delete _0x468781[_0x194a('0x37')];}_0x3734d0[_0x194a('0x2a')](_0x40e73c)[_0x194a('0x38')](_0x468781);};}exports['index']=function(_0x26f42d,_0x24186f){var _0x4748e9={},_0x5bbdce={},_0x3795bc={'count':0x0,'rows':[]};var _0x5a6acc=_[_0x194a('0x39')](db['FreshsalesAccount'][_0x194a('0x3a')],function(_0x22b8a2){return{'name':_0x22b8a2['fieldName'],'type':_0x22b8a2['type'][_0x194a('0x3b')]};});_0x5bbdce[_0x194a('0x3c')]=_['map'](_0x5a6acc,_0x194a('0x37'));_0x5bbdce['query']=_[_0x194a('0x3d')](_0x26f42d[_0x194a('0x3e')]);_0x5bbdce[_0x194a('0x3f')]=_['intersection'](_0x5bbdce['model'],_0x5bbdce[_0x194a('0x3e')]);_0x4748e9[_0x194a('0x40')]=_[_0x194a('0x41')](_0x5bbdce[_0x194a('0x3c')],qs[_0x194a('0x42')](_0x26f42d[_0x194a('0x3e')][_0x194a('0x42')]));_0x4748e9['attributes']=_0x4748e9[_0x194a('0x40')][_0x194a('0x43')]?_0x4748e9[_0x194a('0x40')]:_0x5bbdce['model'];if(!_0x26f42d[_0x194a('0x3e')][_0x194a('0x44')]('nolimit')){_0x4748e9[_0x194a('0x45')]=qs[_0x194a('0x45')](_0x26f42d[_0x194a('0x3e')]['limit']);_0x4748e9['offset']=qs[_0x194a('0x2d')](_0x26f42d[_0x194a('0x3e')]['offset']);}_0x4748e9[_0x194a('0x46')]=qs[_0x194a('0x47')](_0x26f42d['query']['sort']);_0x4748e9['where']=qs[_0x194a('0x3f')](_['pick'](_0x26f42d[_0x194a('0x3e')],_0x5bbdce[_0x194a('0x3f')]));if(_0x26f42d['query'][_0x194a('0x48')]){_0x4748e9['where']=_[_0x194a('0x49')](_0x4748e9[_0x194a('0x4a')],{'$or':_[_0x194a('0x39')](_0x5a6acc,function(_0x40690c){if(_0x40690c[_0x194a('0x4b')]!==_0x194a('0x4c')){var _0x3d1149={};_0x3d1149[_0x40690c['name']]={'$like':'%'+_0x26f42d['query'][_0x194a('0x48')]+'%'};return _0x3d1149;}})});}_0x4748e9=_[_0x194a('0x49')]({},_0x4748e9,_0x26f42d[_0x194a('0x4d')]);var _0x11b22c={'where':_0x4748e9[_0x194a('0x4a')]};return db[_0x194a('0x4e')][_0x194a('0x2c')](_0x11b22c)['then'](function(_0x5c120f){_0x3795bc[_0x194a('0x2c')]=_0x5c120f;if(_0x26f42d[_0x194a('0x3e')][_0x194a('0x4f')]){_0x4748e9[_0x194a('0x50')]=[{'all':!![]}];}return db[_0x194a('0x4e')]['findAll'](_0x4748e9);})[_0x194a('0x1f')](function(_0x287e11){_0x3795bc['rows']=_0x287e11;return _0x3795bc;})['then'](respondWithFilteredResult(_0x24186f,_0x4748e9))[_0x194a('0x29')](handleError(_0x24186f,null));};exports[_0x194a('0x51')]=function(_0x10182a,_0x573a92){var _0x275fac={'raw':![],'where':{'id':_0x10182a['params']['id']}},_0x53ecb2={};_0x53ecb2[_0x194a('0x3c')]=_['keys'](db[_0x194a('0x4e')][_0x194a('0x3a')]);_0x53ecb2[_0x194a('0x3e')]=_[_0x194a('0x3d')](_0x10182a[_0x194a('0x3e')]);_0x53ecb2[_0x194a('0x3f')]=_[_0x194a('0x41')](_0x53ecb2[_0x194a('0x3c')],_0x53ecb2[_0x194a('0x3e')]);_0x275fac[_0x194a('0x40')]=_['intersection'](_0x53ecb2['model'],qs[_0x194a('0x42')](_0x10182a[_0x194a('0x3e')][_0x194a('0x42')]));_0x275fac[_0x194a('0x40')]=_0x275fac['attributes'][_0x194a('0x43')]?_0x275fac[_0x194a('0x40')]:_0x53ecb2['model'];if(_0x10182a[_0x194a('0x3e')]['includeAll']){_0x275fac['include']=[{'all':!![]}];}_0x275fac=_[_0x194a('0x49')]({},_0x275fac,_0x10182a[_0x194a('0x4d')]);return db['FreshsalesAccount'][_0x194a('0x52')](_0x275fac)[_0x194a('0x1f')](handleEntityNotFound(_0x573a92,null))[_0x194a('0x1f')](respondWithResult(_0x573a92,null))[_0x194a('0x29')](handleError(_0x573a92,null));};exports['create']=function(_0x19143c,_0x486c96){return db[_0x194a('0x4e')][_0x194a('0x53')](_0x19143c['body'],{})[_0x194a('0x1f')](respondWithResult(_0x486c96,0xc9))['catch'](handleError(_0x486c96,null));};exports['update']=function(_0x2eb332,_0xab76f){if(_0x2eb332[_0x194a('0x54')]['id']){delete _0x2eb332[_0x194a('0x54')]['id'];}return db[_0x194a('0x4e')][_0x194a('0x52')]({'where':{'id':_0x2eb332[_0x194a('0x55')]['id']}})[_0x194a('0x1f')](handleEntityNotFound(_0xab76f,null))['then'](saveUpdates(_0x2eb332['body'],null))[_0x194a('0x1f')](respondWithResult(_0xab76f,null))['catch'](handleError(_0xab76f,null));};exports['destroy']=function(_0x47d12b,_0x25a23a){return db[_0x194a('0x4e')]['find']({'where':{'id':_0x47d12b[_0x194a('0x55')]['id']}})[_0x194a('0x1f')](handleEntityNotFound(_0x25a23a,null))[_0x194a('0x1f')](removeEntity(_0x25a23a,null))[_0x194a('0x29')](handleError(_0x25a23a,null));};exports['getConfigurations']=function(_0x478196,_0x5976c0,_0x3e5587){var _0x40fc0b={};var _0x514c18={};var _0x362f81;var _0x1192b3;return db[_0x194a('0x4e')]['findOne']({'where':{'id':_0x478196[_0x194a('0x55')]['id']}})[_0x194a('0x1f')](handleEntityNotFound(_0x5976c0,null))[_0x194a('0x1f')](function(_0x21fba0){if(_0x21fba0){_0x362f81=_0x21fba0;_0x514c18['model']=_['keys'](db['FreshsalesConfiguration'][_0x194a('0x3a')]);_0x514c18[_0x194a('0x3e')]=_[_0x194a('0x3d')](_0x478196[_0x194a('0x3e')]);_0x514c18[_0x194a('0x3f')]=_[_0x194a('0x41')](_0x514c18[_0x194a('0x3c')],_0x514c18['query']);_0x40fc0b[_0x194a('0x40')]=_[_0x194a('0x41')](_0x514c18['model'],qs[_0x194a('0x42')](_0x478196[_0x194a('0x3e')][_0x194a('0x42')]));_0x40fc0b['attributes']=_0x40fc0b['attributes'][_0x194a('0x43')]?_0x40fc0b[_0x194a('0x40')]:_0x514c18[_0x194a('0x3c')];_0x40fc0b[_0x194a('0x46')]=qs[_0x194a('0x47')](_0x478196['query']['sort']);_0x40fc0b[_0x194a('0x4a')]=qs['filters'](_[_0x194a('0x56')](_0x478196[_0x194a('0x3e')],_0x514c18['filters']));if(_0x478196[_0x194a('0x3e')][_0x194a('0x48')]){_0x40fc0b['where']=_[_0x194a('0x49')](_0x40fc0b['where'],{'$or':_['map'](_0x40fc0b['attributes'],function(_0x45664a){var _0x4caa8f={};_0x4caa8f[_0x45664a]={'$like':'%'+_0x478196['query']['filter']+'%'};return _0x4caa8f;})});}_0x40fc0b=_[_0x194a('0x49')]({},_0x40fc0b,_0x478196[_0x194a('0x4d')]);return _0x362f81[_0x194a('0x57')](_0x40fc0b);}})[_0x194a('0x1f')](function(_0x540059){if(_0x540059){_0x1192b3=_0x540059[_0x194a('0x43')];if(!_0x478196['query']['hasOwnProperty'](_0x194a('0x58'))){_0x40fc0b[_0x194a('0x45')]=qs[_0x194a('0x45')](_0x478196['query']['limit']);_0x40fc0b[_0x194a('0x2d')]=qs[_0x194a('0x2d')](_0x478196['query'][_0x194a('0x2d')]);}return _0x362f81[_0x194a('0x57')](_0x40fc0b);}})[_0x194a('0x1f')](function(_0x3872c1){if(_0x3872c1){return _0x3872c1?{'count':_0x1192b3,'rows':_0x3872c1}:null;}})['then'](respondWithResult(_0x5976c0,null))[_0x194a('0x29')](handleError(_0x5976c0,null));};exports['addConfiguration']=function(_0x47e613,_0x98806f,_0x4202be){if(_0x47e613['body']['id']){delete _0x47e613[_0x194a('0x54')]['id'];}return db[_0x194a('0x4e')]['findOne']({'where':{'id':_0x47e613[_0x194a('0x55')]['id']}})[_0x194a('0x1f')](handleEntityNotFound(_0x98806f,null))[_0x194a('0x1f')](function(_0x5ad57f){if(_0x5ad57f){_0x47e613['body'][_0x194a('0x59')]=_0x5ad57f['id'];_0x47e613[_0x194a('0x54')]['Subjects']=integrations[_0x194a('0x5a')](_0x47e613[_0x194a('0x54')]['channel'],_0x47e613[_0x194a('0x54')][_0x194a('0x4b')]);_0x47e613[_0x194a('0x54')][_0x194a('0x5b')]=integrations[_0x194a('0x5c')](_0x47e613[_0x194a('0x54')]['channel'],_0x47e613[_0x194a('0x54')][_0x194a('0x4b')]);return db[_0x194a('0x5d')]['create'](_0x47e613[_0x194a('0x54')],{'include':[{'model':db['FreshsalesField'],'as':_0x194a('0x5e')},{'model':db['FreshsalesField'],'as':_0x194a('0x5b')}]});}return null;})[_0x194a('0x1f')](respondWithResult(_0x98806f,null))[_0x194a('0x29')](handleError(_0x98806f,null));};exports[_0x194a('0x5f')]=function(_0x31d18d,_0x2f0e65,_0x53b2c3){var _0x221aa7='';var _0x41568a='';return db[_0x194a('0x4e')][_0x194a('0x60')]({'where':{'id':_0x31d18d[_0x194a('0x55')]['id']},'attributes':['id',_0x194a('0x61'),_0x194a('0x62'),_0x194a('0x63')]})[_0x194a('0x1f')](handleEntityNotFound(_0x2f0e65,null))['then'](function(_0x326e03){if(_0x326e03){_0x41568a=_0x326e03[_0x194a('0x61')];_0x221aa7=_0x326e03[_0x194a('0x62')];var _0x1694ea=_0x326e03[_0x194a('0x62')]['slice'](-0x1);if(_0x1694ea==='/'){_0x221aa7=_0x221aa7[_0x194a('0x64')](0x0,_0x221aa7[_0x194a('0x65')](_0x1694ea));}return rp({'method':_0x194a('0x66'),'uri':util[_0x194a('0x67')](_0x194a('0x68'),_0x221aa7,'/api/selector/owners'),'headers':{'Authorization':_0x194a('0x69')+_0x326e03['apiKey']},'json':!![]});}})[_0x194a('0x1f')](function(_0x5d9007){if(_0x5d9007){var _0x151d08=_0x5d9007[_0x194a('0x6a')];var _0x26cdab=![];var _0x1ff78b=null;for(_0x1ff78b=0x0;_0x1ff78b<_0x151d08['length'];_0x1ff78b++){if(_0x151d08[_0x1ff78b][_0x194a('0x6b')]===_0x41568a){_0x26cdab=!![];}}if(_0x26cdab){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x194a('0x1f')](respondWithResult(_0x2f0e65,null))[_0x194a('0x29')](function(_0x1d47fd){var _0x598107=_0x31d18d[_0x194a('0x3e')][_0x194a('0x6c')]?0x1f4:_0x1d47fd['statusCode']||0x1f4;logger[_0x194a('0x26')](_0x194a('0x6d'),_0x194a('0x5f'),_0x598107,JSON[_0x194a('0x25')](_0x1d47fd));delete _0x1d47fd[_0x194a('0x37')];if(_0x598107===0x191){_0x598107=0x190;}_0x2f0e65[_0x194a('0x2a')](_0x598107)[_0x194a('0x38')](_0x31d18d[_0x194a('0x3e')][_0x194a('0x6c')]?{'message':_0x194a('0x6e'),'statusCode':_0x1d47fd[_0x194a('0x6f')]}:_0x1d47fd);});}; \ No newline at end of file +var _0x964c=['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','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~!@#$%^&-_=+[{]}.','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','where','type','filter','merge','FreshsalesAccount','count','findAll','rows','catch','show','params','length','includeAll','include','options','create','body','find','getConfigurations','FreshsalesConfiguration','sort','addConfiguration','findOne','AccountId','channel','Subjects','FreshsalesField','getFields','username','remoteUri','apiKey','slice','lastIndexOf','GET','format','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash'];(function(_0x5df6f3,_0x59618a){var _0x52143d=function(_0x57fbeb){while(--_0x57fbeb){_0x5df6f3['push'](_0x5df6f3['shift']());}};_0x52143d(++_0x59618a);}(_0x964c,0x65));var _0xc964=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x964c[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc964('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc964('0x1'));var moment=require(_0xc964('0x2'));var BPromise=require(_0xc964('0x3'));var Mustache=require(_0xc964('0x4'));var util=require('util');var path=require(_0xc964('0x5'));var sox=require(_0xc964('0x6'));var csv=require(_0xc964('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc964('0x8'));var squel=require('squel');var crypto=require(_0xc964('0x9'));var jsforce=require(_0xc964('0xa'));var deskjs=require(_0xc964('0xb'));var toCsv=require(_0xc964('0x7'));var querystring=require(_0xc964('0xc'));var Papa=require(_0xc964('0xd'));var Redis=require('ioredis');var authService=require(_0xc964('0xe'));var qs=require(_0xc964('0xf'));var as=require(_0xc964('0x10'));var hardwareService=require(_0xc964('0x11'));var logger=require(_0xc964('0x12'))(_0xc964('0x13'));var utils=require(_0xc964('0x14'));var config=require(_0xc964('0x15'));var db=require(_0xc964('0x16'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xc964('0x17'));var client=jayson['client'][_0xc964('0x18')]({'port':0x232a});function checkPasswordPattern(_0x23f1b1,_0x57a918,_0x33ccca){if(_0x33ccca){var _0x105cc1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x105cc1[_0xc964('0x19')](_0x57a918)){return _0x23f1b1;}else{throw new db[(_0xc964('0x1a'))][(_0xc964('0x1b'))](_0xc964('0x1c'));}}else{return _0x23f1b1;}}function respondWithRpcPromise(_0x1a3d94,_0x48a2be,_0x199f4e,_0x31b40f){return new BPromise(function(_0x13bb99,_0x213231){var _0xebd260=_0x31b40f||client;return _0xebd260['request'](_0x1a3d94,_0x199f4e)['then'](function(_0x271b24){logger[_0xc964('0x1d')](_0xc964('0x1e'),_0x48a2be,_0xc964('0x1f'));logger[_0xc964('0x20')](_0xc964('0x21'),_0x48a2be,_0xc964('0x1f'),JSON[_0xc964('0x22')](_0x271b24));if(_0x271b24[_0xc964('0x23')]){if(_0x271b24['error'][_0xc964('0x24')]===0x1f4){logger[_0xc964('0x23')](_0xc964('0x1e'),_0x48a2be,_0x271b24[_0xc964('0x23')][_0xc964('0x25')]);return _0x213231(_0x271b24[_0xc964('0x23')][_0xc964('0x25')]);}logger['error'](_0xc964('0x1e'),_0x48a2be,_0x271b24['error'][_0xc964('0x25')]);return _0x13bb99(_0x271b24[_0xc964('0x23')][_0xc964('0x25')]);}else{logger[_0xc964('0x1d')](_0xc964('0x1e'),_0x48a2be,_0xc964('0x1f'));_0x13bb99(_0x271b24['result'][_0xc964('0x25')]);}})['catch'](function(_0x3637b1){logger[_0xc964('0x23')](_0xc964('0x1e'),_0x48a2be,_0x3637b1);_0x213231(_0x3637b1);});});}function respondWithStatusCode(_0x5ed57b,_0x169f52){_0x169f52=_0x169f52||0xcc;return function(_0x1faceb){if(_0x1faceb){return _0x5ed57b[_0xc964('0x26')](_0x169f52);}return _0x5ed57b[_0xc964('0x27')](_0x169f52)[_0xc964('0x28')]();};}function respondWithResult(_0x124f08,_0x13f392){_0x13f392=_0x13f392||0xc8;return function(_0x2b9a86){if(_0x2b9a86){return _0x124f08[_0xc964('0x27')](_0x13f392)['json'](_0x2b9a86);}};}function respondWithFilteredResult(_0x491725,_0x4af135){return function(_0x36b744){if(_0x36b744){var _0x330d64=_0x36b744['count'],_0x273c21=_0x4af135[_0xc964('0x29')],_0x35efa8=_0x4af135[_0xc964('0x29')]+_0x4af135[_0xc964('0x2a')],_0x21d48c;if(_0x35efa8>=_0x330d64){_0x35efa8=_0x330d64;_0x21d48c=0xc8;}else{_0x21d48c=0xce;}_0x491725[_0xc964('0x27')](_0x21d48c);return _0x491725[_0xc964('0x2b')](_0xc964('0x2c'),_0x273c21+'-'+_0x35efa8+'/'+_0x330d64)[_0xc964('0x2d')](_0x36b744);}return null;};}function patchUpdates(_0x84f930){return function(_0x5cf524){try{jsonpatch[_0xc964('0x2e')](_0x5cf524,_0x84f930,!![]);}catch(_0xbf2348){return BPromise[_0xc964('0x2f')](_0xbf2348);}return _0x5cf524[_0xc964('0x30')]();};}function saveUpdates(_0x300966,_0x371c85){return function(_0x3d9526){if(_0x3d9526){return _0x3d9526[_0xc964('0x31')](_0x300966)[_0xc964('0x32')](function(_0x2e0918){return _0x2e0918;});}return null;};}function removeEntity(_0x20246e,_0x5811d1){return function(_0x11732c){if(_0x11732c){return _0x11732c[_0xc964('0x33')]()[_0xc964('0x32')](function(){_0x20246e['status'](0xcc)[_0xc964('0x28')]();});}};}function handleEntityNotFound(_0x2c3aed,_0x25c03c){return function(_0x5661d1){if(!_0x5661d1){_0x2c3aed[_0xc964('0x26')](0x194);}return _0x5661d1;};}function handleError(_0x2e8fc5,_0x443a2d){_0x443a2d=_0x443a2d||0x1f4;return function(_0x370f12){logger[_0xc964('0x23')](_0x370f12[_0xc964('0x34')]);if(_0x370f12[_0xc964('0x35')]){delete _0x370f12[_0xc964('0x35')];}_0x2e8fc5[_0xc964('0x27')](_0x443a2d)[_0xc964('0x36')](_0x370f12);};}exports[_0xc964('0x37')]=function(_0x1e6ca0,_0x398f78){var _0x36e6dd={},_0x4fe4e4={},_0x234586={'count':0x0,'rows':[]};var _0x3f1879=_[_0xc964('0x38')](db['FreshsalesAccount'][_0xc964('0x39')],function(_0x19f69b){return{'name':_0x19f69b[_0xc964('0x3a')],'type':_0x19f69b['type'][_0xc964('0x3b')]};});_0x4fe4e4[_0xc964('0x3c')]=_[_0xc964('0x38')](_0x3f1879,_0xc964('0x35'));_0x4fe4e4[_0xc964('0x3d')]=_[_0xc964('0x3e')](_0x1e6ca0[_0xc964('0x3d')]);_0x4fe4e4[_0xc964('0x3f')]=_['intersection'](_0x4fe4e4[_0xc964('0x3c')],_0x4fe4e4[_0xc964('0x3d')]);_0x36e6dd[_0xc964('0x40')]=_[_0xc964('0x41')](_0x4fe4e4[_0xc964('0x3c')],qs['fields'](_0x1e6ca0[_0xc964('0x3d')][_0xc964('0x42')]));_0x36e6dd['attributes']=_0x36e6dd[_0xc964('0x40')]['length']?_0x36e6dd[_0xc964('0x40')]:_0x4fe4e4[_0xc964('0x3c')];if(!_0x1e6ca0[_0xc964('0x3d')][_0xc964('0x43')](_0xc964('0x44'))){_0x36e6dd['limit']=qs[_0xc964('0x2a')](_0x1e6ca0[_0xc964('0x3d')][_0xc964('0x2a')]);_0x36e6dd[_0xc964('0x29')]=qs['offset'](_0x1e6ca0[_0xc964('0x3d')][_0xc964('0x29')]);}_0x36e6dd['order']=qs['sort'](_0x1e6ca0['query']['sort']);_0x36e6dd[_0xc964('0x45')]=qs['filters'](_['pick'](_0x1e6ca0[_0xc964('0x3d')],_0x4fe4e4[_0xc964('0x3f')]));if(_0x1e6ca0['query']['filter']){_0x36e6dd['where']=_['merge'](_0x36e6dd[_0xc964('0x45')],{'$or':_[_0xc964('0x38')](_0x3f1879,function(_0xe281e){if(_0xe281e[_0xc964('0x46')]!=='VIRTUAL'){var _0x356dbe={};_0x356dbe[_0xe281e[_0xc964('0x35')]]={'$like':'%'+_0x1e6ca0[_0xc964('0x3d')][_0xc964('0x47')]+'%'};return _0x356dbe;}})});}_0x36e6dd=_[_0xc964('0x48')]({},_0x36e6dd,_0x1e6ca0['options']);var _0x41279e={'where':_0x36e6dd[_0xc964('0x45')]};return db[_0xc964('0x49')][_0xc964('0x4a')](_0x41279e)['then'](function(_0x56840b){_0x234586['count']=_0x56840b;if(_0x1e6ca0[_0xc964('0x3d')]['includeAll']){_0x36e6dd['include']=[{'all':!![]}];}return db[_0xc964('0x49')][_0xc964('0x4b')](_0x36e6dd);})[_0xc964('0x32')](function(_0x12eafb){_0x234586[_0xc964('0x4c')]=_0x12eafb;return _0x234586;})[_0xc964('0x32')](respondWithFilteredResult(_0x398f78,_0x36e6dd))[_0xc964('0x4d')](handleError(_0x398f78,null));};exports[_0xc964('0x4e')]=function(_0x200216,_0x6e9967){var _0x501527={'raw':![],'where':{'id':_0x200216[_0xc964('0x4f')]['id']}},_0x37196c={};_0x37196c[_0xc964('0x3c')]=_[_0xc964('0x3e')](db['FreshsalesAccount'][_0xc964('0x39')]);_0x37196c[_0xc964('0x3d')]=_[_0xc964('0x3e')](_0x200216[_0xc964('0x3d')]);_0x37196c[_0xc964('0x3f')]=_['intersection'](_0x37196c[_0xc964('0x3c')],_0x37196c[_0xc964('0x3d')]);_0x501527['attributes']=_['intersection'](_0x37196c[_0xc964('0x3c')],qs['fields'](_0x200216[_0xc964('0x3d')][_0xc964('0x42')]));_0x501527[_0xc964('0x40')]=_0x501527[_0xc964('0x40')][_0xc964('0x50')]?_0x501527[_0xc964('0x40')]:_0x37196c['model'];if(_0x200216['query'][_0xc964('0x51')]){_0x501527[_0xc964('0x52')]=[{'all':!![]}];}_0x501527=_[_0xc964('0x48')]({},_0x501527,_0x200216[_0xc964('0x53')]);return db[_0xc964('0x49')]['find'](_0x501527)[_0xc964('0x32')](handleEntityNotFound(_0x6e9967,null))['then'](respondWithResult(_0x6e9967,null))[_0xc964('0x4d')](handleError(_0x6e9967,null));};exports['create']=function(_0x4d1edd,_0x111183){return db[_0xc964('0x49')][_0xc964('0x54')](_0x4d1edd[_0xc964('0x55')],{})['then'](respondWithResult(_0x111183,0xc9))[_0xc964('0x4d')](handleError(_0x111183,null));};exports['update']=function(_0x5005c8,_0x4dc3d8){if(_0x5005c8[_0xc964('0x55')]['id']){delete _0x5005c8['body']['id'];}return db['FreshsalesAccount'][_0xc964('0x56')]({'where':{'id':_0x5005c8[_0xc964('0x4f')]['id']}})[_0xc964('0x32')](handleEntityNotFound(_0x4dc3d8,null))[_0xc964('0x32')](saveUpdates(_0x5005c8['body'],null))['then'](respondWithResult(_0x4dc3d8,null))['catch'](handleError(_0x4dc3d8,null));};exports['destroy']=function(_0x3a76d5,_0x35e7b0){return db['FreshsalesAccount'][_0xc964('0x56')]({'where':{'id':_0x3a76d5[_0xc964('0x4f')]['id']}})[_0xc964('0x32')](handleEntityNotFound(_0x35e7b0,null))[_0xc964('0x32')](removeEntity(_0x35e7b0,null))[_0xc964('0x4d')](handleError(_0x35e7b0,null));};exports[_0xc964('0x57')]=function(_0x3e7636,_0x5c5112,_0x582624){var _0x48f6e5={};var _0x48486f={};var _0x274c9e;var _0xf870ca;return db[_0xc964('0x49')]['findOne']({'where':{'id':_0x3e7636['params']['id']}})[_0xc964('0x32')](handleEntityNotFound(_0x5c5112,null))[_0xc964('0x32')](function(_0x5830ad){if(_0x5830ad){_0x274c9e=_0x5830ad;_0x48486f[_0xc964('0x3c')]=_[_0xc964('0x3e')](db[_0xc964('0x58')][_0xc964('0x39')]);_0x48486f['query']=_['keys'](_0x3e7636[_0xc964('0x3d')]);_0x48486f[_0xc964('0x3f')]=_['intersection'](_0x48486f[_0xc964('0x3c')],_0x48486f['query']);_0x48f6e5[_0xc964('0x40')]=_['intersection'](_0x48486f[_0xc964('0x3c')],qs[_0xc964('0x42')](_0x3e7636['query'][_0xc964('0x42')]));_0x48f6e5['attributes']=_0x48f6e5[_0xc964('0x40')]['length']?_0x48f6e5[_0xc964('0x40')]:_0x48486f[_0xc964('0x3c')];_0x48f6e5['order']=qs[_0xc964('0x59')](_0x3e7636['query'][_0xc964('0x59')]);_0x48f6e5[_0xc964('0x45')]=qs[_0xc964('0x3f')](_['pick'](_0x3e7636[_0xc964('0x3d')],_0x48486f['filters']));if(_0x3e7636[_0xc964('0x3d')][_0xc964('0x47')]){_0x48f6e5[_0xc964('0x45')]=_['merge'](_0x48f6e5[_0xc964('0x45')],{'$or':_[_0xc964('0x38')](_0x48f6e5['attributes'],function(_0x4ecd37){var _0x2a2832={};_0x2a2832[_0x4ecd37]={'$like':'%'+_0x3e7636[_0xc964('0x3d')][_0xc964('0x47')]+'%'};return _0x2a2832;})});}_0x48f6e5=_['merge']({},_0x48f6e5,_0x3e7636[_0xc964('0x53')]);return _0x274c9e[_0xc964('0x57')](_0x48f6e5);}})['then'](function(_0xab4d60){if(_0xab4d60){_0xf870ca=_0xab4d60['length'];if(!_0x3e7636[_0xc964('0x3d')]['hasOwnProperty']('nolimit')){_0x48f6e5[_0xc964('0x2a')]=qs['limit'](_0x3e7636[_0xc964('0x3d')][_0xc964('0x2a')]);_0x48f6e5[_0xc964('0x29')]=qs[_0xc964('0x29')](_0x3e7636['query'][_0xc964('0x29')]);}return _0x274c9e[_0xc964('0x57')](_0x48f6e5);}})[_0xc964('0x32')](function(_0x1a778d){if(_0x1a778d){return _0x1a778d?{'count':_0xf870ca,'rows':_0x1a778d}:null;}})[_0xc964('0x32')](respondWithResult(_0x5c5112,null))[_0xc964('0x4d')](handleError(_0x5c5112,null));};exports[_0xc964('0x5a')]=function(_0x418951,_0x3b7677,_0x4454bd){if(_0x418951[_0xc964('0x55')]['id']){delete _0x418951[_0xc964('0x55')]['id'];}return db[_0xc964('0x49')][_0xc964('0x5b')]({'where':{'id':_0x418951['params']['id']}})['then'](handleEntityNotFound(_0x3b7677,null))[_0xc964('0x32')](function(_0x2f58c0){if(_0x2f58c0){_0x418951[_0xc964('0x55')][_0xc964('0x5c')]=_0x2f58c0['id'];_0x418951[_0xc964('0x55')]['Subjects']=integrations['getSubjects'](_0x418951[_0xc964('0x55')][_0xc964('0x5d')],_0x418951[_0xc964('0x55')]['type']);_0x418951[_0xc964('0x55')]['Descriptions']=integrations['getDescriptions'](_0x418951[_0xc964('0x55')]['channel'],_0x418951[_0xc964('0x55')][_0xc964('0x46')]);return db['FreshsalesConfiguration'][_0xc964('0x54')](_0x418951[_0xc964('0x55')],{'include':[{'model':db['FreshsalesField'],'as':_0xc964('0x5e')},{'model':db[_0xc964('0x5f')],'as':'Descriptions'}]});}return null;})[_0xc964('0x32')](respondWithResult(_0x3b7677,null))[_0xc964('0x4d')](handleError(_0x3b7677,null));};exports[_0xc964('0x60')]=function(_0x5e7d42,_0x1450f4,_0x4f3817){var _0x501f9d='';var _0x5999aa='';return db[_0xc964('0x49')][_0xc964('0x5b')]({'where':{'id':_0x5e7d42[_0xc964('0x4f')]['id']},'attributes':['id',_0xc964('0x61'),_0xc964('0x62'),_0xc964('0x63')]})[_0xc964('0x32')](handleEntityNotFound(_0x1450f4,null))[_0xc964('0x32')](function(_0x3af460){if(_0x3af460){_0x5999aa=_0x3af460[_0xc964('0x61')];_0x501f9d=_0x3af460['remoteUri'];var _0x29638b=_0x3af460['remoteUri'][_0xc964('0x64')](-0x1);if(_0x29638b==='/'){_0x501f9d=_0x501f9d['substring'](0x0,_0x501f9d[_0xc964('0x65')](_0x29638b));}return rp({'method':_0xc964('0x66'),'uri':util[_0xc964('0x67')]('%s%s',_0x501f9d,'/api/selector/owners'),'headers':{'Authorization':_0xc964('0x68')+_0x3af460[_0xc964('0x63')]},'json':!![]});}})[_0xc964('0x32')](function(_0x32a6e6){if(_0x32a6e6){var _0x305159=_0x32a6e6['users'];var _0x440d24=![];var _0x3532c8=null;for(_0x3532c8=0x0;_0x3532c8<_0x305159[_0xc964('0x50')];_0x3532c8++){if(_0x305159[_0x3532c8][_0xc964('0x69')]===_0x5999aa){_0x440d24=!![];}}if(_0x440d24){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xc964('0x6a')});}}})[_0xc964('0x32')](respondWithResult(_0x1450f4,null))[_0xc964('0x4d')](function(_0x408e96){var _0x5399e2=_0x5e7d42[_0xc964('0x3d')][_0xc964('0x19')]?0x1f4:_0x408e96[_0xc964('0x6b')]||0x1f4;logger['error'](_0xc964('0x6c'),_0xc964('0x60'),_0x5399e2,JSON[_0xc964('0x22')](_0x408e96));delete _0x408e96[_0xc964('0x35')];if(_0x5399e2===0x191){_0x5399e2=0x190;}_0x1450f4[_0xc964('0x27')](_0x5399e2)['send'](_0x5e7d42['query'][_0xc964('0x19')]?{'message':_0xc964('0x6d'),'statusCode':_0x408e96[_0xc964('0x6b')]}:_0x408e96);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 81d8311..0a98bc0 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 _0xa144=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','FreshsalesAccount','lodash'];(function(_0x4fd360,_0x435775){var _0x5c93d7=function(_0x40870c){while(--_0x40870c){_0x4fd360['push'](_0x4fd360['shift']());}};_0x5c93d7(++_0x435775);}(_0xa144,0x11f));var _0x4a14=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xa144[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x4a14('0x0'));var util=require('util');var logger=require(_0x4a14('0x1'))(_0x4a14('0x2'));var moment=require(_0x4a14('0x3'));var BPromise=require(_0x4a14('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a14('0x5'));var rimraf=require(_0x4a14('0x6'));var config=require(_0x4a14('0x7'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x4a14('0x8'));module[_0x4a14('0x9')]=function(_0x57518e,_0x3b7cdd){return _0x57518e[_0x4a14('0xa')](_0x4a14('0xb'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1544=['FreshsalesAccount','int_freshsales_accounts','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x381929,_0x5b9015){var _0x272cfc=function(_0x75d4ad){while(--_0x75d4ad){_0x381929['push'](_0x381929['shift']());}};_0x272cfc(++_0x5b9015);}(_0x1544,0x6a));var _0x4154=function(_0x53e3bf,_0x547106){_0x53e3bf=_0x53e3bf-0x0;var _0x59b198=_0x1544[_0x53e3bf];return _0x59b198;};'use strict';var _=require(_0x4154('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4154('0x1'));var moment=require(_0x4154('0x2'));var BPromise=require(_0x4154('0x3'));var rp=require(_0x4154('0x4'));var fs=require('fs');var path=require(_0x4154('0x5'));var rimraf=require(_0x4154('0x6'));var config=require(_0x4154('0x7'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x4154('0x8'));module[_0x4154('0x9')]=function(_0x1abc54,_0x48d079){return _0x1abc54[_0x4154('0xa')](_0x4154('0xb'),attributes,{'tableName':_0x4154('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 a4462c0..ddfc356 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 _0xee9c=['info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','limit','include','map','attributes','model','ShowFreshsalesAccount','find','then','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','http','request'];(function(_0x39aef1,_0x3fc5d5){var _0x1478a0=function(_0x3f1be3){while(--_0x3f1be3){_0x39aef1['push'](_0x39aef1['shift']());}};_0x1478a0(++_0x3fc5d5);}(_0xee9c,0x1e6));var _0xcee9=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0xee9c[_0x3e2fcf];return _0x497db7;};'use strict';var _=require('lodash');var util=require(_0xcee9('0x0'));var moment=require(_0xcee9('0x1'));var BPromise=require(_0xcee9('0x2'));var rs=require(_0xcee9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcee9('0x4'));var logger=require(_0xcee9('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcee9('0x6'));var client=jayson['client'][_0xcee9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2bc2cb,_0x34819a,_0x58636f){return new BPromise(function(_0x4d1f9a,_0x2b14da){return client[_0xcee9('0x8')](_0x2bc2cb,_0x58636f)['then'](function(_0x7c80be){logger[_0xcee9('0x9')](_0xcee9('0xa'),_0x34819a,_0xcee9('0xb'));logger[_0xcee9('0xc')](_0xcee9('0xd'),_0x34819a,'request\x20sent',JSON[_0xcee9('0xe')](_0x7c80be));if(_0x7c80be[_0xcee9('0xf')]){if(_0x7c80be['error'][_0xcee9('0x10')]===0x1f4){logger[_0xcee9('0xf')](_0xcee9('0xa'),_0x34819a,_0x7c80be['error'][_0xcee9('0x11')]);return _0x2b14da(_0x7c80be[_0xcee9('0xf')][_0xcee9('0x11')]);}logger[_0xcee9('0xf')](_0xcee9('0xa'),_0x34819a,_0x7c80be['error']['message']);return _0x4d1f9a(_0x7c80be[_0xcee9('0xf')][_0xcee9('0x11')]);}else{logger[_0xcee9('0x9')](_0xcee9('0xa'),_0x34819a,_0xcee9('0xb'));_0x4d1f9a(_0x7c80be[_0xcee9('0x12')][_0xcee9('0x11')]);}})[_0xcee9('0x13')](function(_0x1adcc9){logger[_0xcee9('0xf')](_0xcee9('0xa'),_0x34819a,_0x1adcc9);_0x2b14da(_0x1adcc9);});});}exports[_0xcee9('0x14')]=function(_0x552ca1){var _0x10e6b5=this;return new Promise(function(_0x414032,_0x39f0dc){return db[_0xcee9('0x15')][_0xcee9('0x16')]({'raw':_0x552ca1['options']?_0x552ca1[_0xcee9('0x17')][_0xcee9('0x18')]===undefined?!![]:![]:!![],'where':_0x552ca1[_0xcee9('0x17')]?_0x552ca1[_0xcee9('0x17')]['where']||null:null,'attributes':_0x552ca1[_0xcee9('0x17')]?_0x552ca1[_0xcee9('0x17')]['attributes']||null:null,'limit':_0x552ca1['options']?_0x552ca1[_0xcee9('0x17')][_0xcee9('0x19')]||null:null,'include':_0x552ca1[_0xcee9('0x17')]?_0x552ca1['options'][_0xcee9('0x1a')]?_[_0xcee9('0x1b')](_0x552ca1[_0xcee9('0x17')]['include'],function(_0x2c219){return{'model':db[_0x2c219['model']],'as':_0x2c219['as'],'attributes':_0x2c219[_0xcee9('0x1c')],'include':_0x2c219[_0xcee9('0x1a')]?_[_0xcee9('0x1b')](_0x2c219[_0xcee9('0x1a')],function(_0xef4b0a){return{'model':db[_0xef4b0a[_0xcee9('0x1d')]],'as':_0xef4b0a['as'],'attributes':_0xef4b0a[_0xcee9('0x1c')],'include':_0xef4b0a[_0xcee9('0x1a')]?_[_0xcee9('0x1b')](_0xef4b0a[_0xcee9('0x1a')],function(_0x4cc9a1){return{'model':db[_0x4cc9a1['model']],'as':_0x4cc9a1['as'],'attributes':_0x4cc9a1[_0xcee9('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4593bc){logger[_0xcee9('0x9')](_0xcee9('0x14'),_0x552ca1);logger[_0xcee9('0xc')]('GetFreshsalesAccount',_0x552ca1,JSON[_0xcee9('0xe')](_0x4593bc));_0x414032(_0x4593bc);})[_0xcee9('0x13')](function(_0x3e88cd){logger['error'](_0xcee9('0x14'),_0x3e88cd[_0xcee9('0x11')],_0x552ca1);_0x39f0dc(_0x10e6b5[_0xcee9('0xf')](0x1f4,_0x3e88cd['message']));});});};exports[_0xcee9('0x1e')]=function(_0x6bfe80){var _0x423287=this;return new Promise(function(_0x2e44dc,_0x4de639){return db[_0xcee9('0x15')][_0xcee9('0x1f')]({'raw':_0x6bfe80['options']?_0x6bfe80[_0xcee9('0x17')][_0xcee9('0x18')]===undefined?!![]:![]:!![],'where':_0x6bfe80[_0xcee9('0x17')]?_0x6bfe80[_0xcee9('0x17')]['where']||null:null,'attributes':_0x6bfe80['options']?_0x6bfe80[_0xcee9('0x17')][_0xcee9('0x1c')]||null:null,'include':_0x6bfe80[_0xcee9('0x17')]?_0x6bfe80[_0xcee9('0x17')][_0xcee9('0x1a')]?_[_0xcee9('0x1b')](_0x6bfe80[_0xcee9('0x17')]['include'],function(_0x12169c){return{'model':db[_0x12169c[_0xcee9('0x1d')]],'as':_0x12169c['as'],'attributes':_0x12169c[_0xcee9('0x1c')],'include':_0x12169c['include']?_[_0xcee9('0x1b')](_0x12169c[_0xcee9('0x1a')],function(_0x944ea1){return{'model':db[_0x944ea1[_0xcee9('0x1d')]],'as':_0x944ea1['as'],'attributes':_0x944ea1[_0xcee9('0x1c')],'include':_0x944ea1['include']?_['map'](_0x944ea1[_0xcee9('0x1a')],function(_0x1a2af9){return{'model':db[_0x1a2af9[_0xcee9('0x1d')]],'as':_0x1a2af9['as'],'attributes':_0x1a2af9['attributes']};}):[]};}):[]};}):[]:[]})[_0xcee9('0x20')](function(_0x2f17c5){logger[_0xcee9('0x9')](_0xcee9('0x1e'),_0x6bfe80);logger[_0xcee9('0xc')](_0xcee9('0x1e'),_0x6bfe80,JSON['stringify'](_0x2f17c5));_0x2e44dc(_0x2f17c5);})[_0xcee9('0x13')](function(_0x6f2506){logger[_0xcee9('0xf')](_0xcee9('0x1e'),_0x6f2506['message'],_0x6bfe80);_0x4de639(_0x423287['error'](0x1f4,_0x6f2506[_0xcee9('0x11')]));});});}; \ No newline at end of file +var _0xb2af=['limit','include','map','attributes','model','ShowFreshsalesAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw'];(function(_0x33ee99,_0x5d6e1d){var _0x1d1273=function(_0x3b2206){while(--_0x3b2206){_0x33ee99['push'](_0x33ee99['shift']());}};_0x1d1273(++_0x5d6e1d);}(_0xb2af,0xd2));var _0xfb2a=function(_0x186062,_0x34d568){_0x186062=_0x186062-0x0;var _0x449784=_0xb2af[_0x186062];return _0x449784;};'use strict';var _=require(_0xfb2a('0x0'));var util=require(_0xfb2a('0x1'));var moment=require(_0xfb2a('0x2'));var BPromise=require(_0xfb2a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb2a('0x4'));var db=require(_0xfb2a('0x5'))['db'];var utils=require(_0xfb2a('0x6'));var logger=require(_0xfb2a('0x7'))(_0xfb2a('0x8'));var config=require('../../config/environment');var jayson=require(_0xfb2a('0x9'));var client=jayson[_0xfb2a('0xa')][_0xfb2a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55cf25,_0x715404,_0x3e20de){return new BPromise(function(_0x1f3315,_0x55bb4e){return client[_0xfb2a('0xc')](_0x55cf25,_0x3e20de)[_0xfb2a('0xd')](function(_0x3d3333){logger[_0xfb2a('0xe')](_0xfb2a('0xf'),_0x715404,_0xfb2a('0x10'));logger[_0xfb2a('0x11')](_0xfb2a('0x12'),_0x715404,_0xfb2a('0x10'),JSON[_0xfb2a('0x13')](_0x3d3333));if(_0x3d3333[_0xfb2a('0x14')]){if(_0x3d3333[_0xfb2a('0x14')]['code']===0x1f4){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x715404,_0x3d3333[_0xfb2a('0x14')][_0xfb2a('0x15')]);return _0x55bb4e(_0x3d3333[_0xfb2a('0x14')][_0xfb2a('0x15')]);}logger['error'](_0xfb2a('0xf'),_0x715404,_0x3d3333['error']['message']);return _0x1f3315(_0x3d3333[_0xfb2a('0x14')]['message']);}else{logger['info'](_0xfb2a('0xf'),_0x715404,_0xfb2a('0x10'));_0x1f3315(_0x3d3333[_0xfb2a('0x16')][_0xfb2a('0x15')]);}})[_0xfb2a('0x17')](function(_0xc85abf){logger[_0xfb2a('0x14')](_0xfb2a('0xf'),_0x715404,_0xc85abf);_0x55bb4e(_0xc85abf);});});}exports[_0xfb2a('0x18')]=function(_0x52743a){var _0x1cdaa7=this;return new Promise(function(_0xb5ff5c,_0x288a32){return db[_0xfb2a('0x19')]['findAll']({'raw':_0x52743a[_0xfb2a('0x1a')]?_0x52743a['options'][_0xfb2a('0x1b')]===undefined?!![]:![]:!![],'where':_0x52743a[_0xfb2a('0x1a')]?_0x52743a[_0xfb2a('0x1a')]['where']||null:null,'attributes':_0x52743a['options']?_0x52743a['options']['attributes']||null:null,'limit':_0x52743a[_0xfb2a('0x1a')]?_0x52743a[_0xfb2a('0x1a')][_0xfb2a('0x1c')]||null:null,'include':_0x52743a[_0xfb2a('0x1a')]?_0x52743a[_0xfb2a('0x1a')][_0xfb2a('0x1d')]?_[_0xfb2a('0x1e')](_0x52743a[_0xfb2a('0x1a')][_0xfb2a('0x1d')],function(_0x351489){return{'model':db[_0x351489['model']],'as':_0x351489['as'],'attributes':_0x351489[_0xfb2a('0x1f')],'include':_0x351489['include']?_[_0xfb2a('0x1e')](_0x351489[_0xfb2a('0x1d')],function(_0x5726b3){return{'model':db[_0x5726b3[_0xfb2a('0x20')]],'as':_0x5726b3['as'],'attributes':_0x5726b3[_0xfb2a('0x1f')],'include':_0x5726b3['include']?_[_0xfb2a('0x1e')](_0x5726b3[_0xfb2a('0x1d')],function(_0x4cdb14){return{'model':db[_0x4cdb14[_0xfb2a('0x20')]],'as':_0x4cdb14['as'],'attributes':_0x4cdb14[_0xfb2a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfb2a('0xd')](function(_0x38a7fa){logger[_0xfb2a('0xe')](_0xfb2a('0x18'),_0x52743a);logger[_0xfb2a('0x11')](_0xfb2a('0x18'),_0x52743a,JSON[_0xfb2a('0x13')](_0x38a7fa));_0xb5ff5c(_0x38a7fa);})[_0xfb2a('0x17')](function(_0x4b79e5){logger[_0xfb2a('0x14')](_0xfb2a('0x18'),_0x4b79e5[_0xfb2a('0x15')],_0x52743a);_0x288a32(_0x1cdaa7[_0xfb2a('0x14')](0x1f4,_0x4b79e5[_0xfb2a('0x15')]));});});};exports[_0xfb2a('0x21')]=function(_0x2cecb){var _0x3042fb=this;return new Promise(function(_0x5dcbff,_0x225e04){return db['FreshsalesAccount']['find']({'raw':_0x2cecb[_0xfb2a('0x1a')]?_0x2cecb[_0xfb2a('0x1a')][_0xfb2a('0x1b')]===undefined?!![]:![]:!![],'where':_0x2cecb['options']?_0x2cecb[_0xfb2a('0x1a')]['where']||null:null,'attributes':_0x2cecb[_0xfb2a('0x1a')]?_0x2cecb[_0xfb2a('0x1a')][_0xfb2a('0x1f')]||null:null,'include':_0x2cecb[_0xfb2a('0x1a')]?_0x2cecb[_0xfb2a('0x1a')][_0xfb2a('0x1d')]?_['map'](_0x2cecb['options'][_0xfb2a('0x1d')],function(_0x158497){return{'model':db[_0x158497['model']],'as':_0x158497['as'],'attributes':_0x158497['attributes'],'include':_0x158497[_0xfb2a('0x1d')]?_[_0xfb2a('0x1e')](_0x158497[_0xfb2a('0x1d')],function(_0x299c87){return{'model':db[_0x299c87[_0xfb2a('0x20')]],'as':_0x299c87['as'],'attributes':_0x299c87[_0xfb2a('0x1f')],'include':_0x299c87['include']?_[_0xfb2a('0x1e')](_0x299c87[_0xfb2a('0x1d')],function(_0x1554d3){return{'model':db[_0x1554d3[_0xfb2a('0x20')]],'as':_0x1554d3['as'],'attributes':_0x1554d3[_0xfb2a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfb2a('0xd')](function(_0x3d64a5){logger[_0xfb2a('0xe')](_0xfb2a('0x21'),_0x2cecb);logger[_0xfb2a('0x11')](_0xfb2a('0x21'),_0x2cecb,JSON[_0xfb2a('0x13')](_0x3d64a5));_0x5dcbff(_0x3d64a5);})[_0xfb2a('0x17')](function(_0x17bb29){logger[_0xfb2a('0x14')](_0xfb2a('0x21'),_0x17bb29[_0xfb2a('0x15')],_0x2cecb);_0x225e04(_0x3042fb[_0xfb2a('0x14')](0x1f4,_0x17bb29[_0xfb2a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 4e2a925..6f9198f 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 _0xa753=['getFields','put','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/fields'];(function(_0x53a167,_0x4bf6c7){var _0x150263=function(_0x422191){while(--_0x422191){_0x53a167['push'](_0x53a167['shift']());}};_0x150263(++_0x4bf6c7);}(_0xa753,0x17f));var _0x3a75=function(_0xa8a613,_0x3636aa){_0xa8a613=_0xa8a613-0x0;var _0x261a28=_0xa753[_0xa8a613];return _0x261a28;};'use strict';var multer=require(_0x3a75('0x0'));var util=require(_0x3a75('0x1'));var path=require(_0x3a75('0x2'));var timeout=require(_0x3a75('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x3a75('0x4'));var interaction=require(_0x3a75('0x5'));var config=require(_0x3a75('0x6'));var controller=require(_0x3a75('0x7'));router[_0x3a75('0x8')]('/',auth[_0x3a75('0x9')](),controller[_0x3a75('0xa')]);router[_0x3a75('0x8')](_0x3a75('0xb'),auth[_0x3a75('0x9')](),controller[_0x3a75('0xc')]);router[_0x3a75('0x8')](_0x3a75('0xd'),auth['isAuthenticated'](),controller[_0x3a75('0xe')]);router[_0x3a75('0x8')]('/:id/descriptions',auth[_0x3a75('0x9')](),controller['getDescriptions']);router[_0x3a75('0x8')](_0x3a75('0xf'),auth['isAuthenticated'](),controller[_0x3a75('0x10')]);router['post']('/',auth[_0x3a75('0x9')](),controller['create']);router[_0x3a75('0x11')](_0x3a75('0xb'),auth[_0x3a75('0x9')](),controller['update']);router['delete'](_0x3a75('0xb'),auth[_0x3a75('0x9')](),controller['destroy']);module[_0x3a75('0x12')]=router; \ No newline at end of file +var _0x5ded=['post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','getSubjects','getFields'];(function(_0x1d9ca8,_0x2682b5){var _0x17f049=function(_0x20e6de){while(--_0x20e6de){_0x1d9ca8['push'](_0x1d9ca8['shift']());}};_0x17f049(++_0x2682b5);}(_0x5ded,0x67));var _0xd5de=function(_0x3b05f6,_0x1ee605){_0x3b05f6=_0x3b05f6-0x0;var _0x16e51e=_0x5ded[_0x3b05f6];return _0x16e51e;};'use strict';var multer=require(_0xd5de('0x0'));var util=require(_0xd5de('0x1'));var path=require(_0xd5de('0x2'));var timeout=require(_0xd5de('0x3'));var express=require(_0xd5de('0x4'));var router=express[_0xd5de('0x5')]();var auth=require(_0xd5de('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshsalesConfiguration.controller');router[_0xd5de('0x7')]('/',auth[_0xd5de('0x8')](),controller['index']);router[_0xd5de('0x7')]('/:id',auth[_0xd5de('0x8')](),controller['show']);router[_0xd5de('0x7')]('/:id/subjects',auth[_0xd5de('0x8')](),controller[_0xd5de('0x9')]);router[_0xd5de('0x7')]('/:id/descriptions',auth[_0xd5de('0x8')](),controller['getDescriptions']);router[_0xd5de('0x7')]('/:id/fields',auth[_0xd5de('0x8')](),controller[_0xd5de('0xa')]);router[_0xd5de('0xb')]('/',auth[_0xd5de('0x8')](),controller[_0xd5de('0xc')]);router[_0xd5de('0xd')](_0xd5de('0xe'),auth[_0xd5de('0x8')](),controller[_0xd5de('0xf')]);router[_0xd5de('0x10')]('/:id',auth[_0xd5de('0x8')](),controller[_0xd5de('0x11')]);module[_0xd5de('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 80aa4dc..fe287b3 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 _0x7ecd=['STRING','sequelize','exports'];(function(_0x111ad4,_0x388616){var _0x100369=function(_0x48ff5d){while(--_0x48ff5d){_0x111ad4['push'](_0x111ad4['shift']());}};_0x100369(++_0x388616);}(_0x7ecd,0xb2));var _0xd7ec=function(_0x3e8c58,_0x36ce72){_0x3e8c58=_0x3e8c58-0x0;var _0xb13a98=_0x7ecd[_0x3e8c58];return _0xb13a98;};'use strict';var Sequelize=require(_0xd7ec('0x0'));module[_0xd7ec('0x1')]={'name':{'type':Sequelize[_0xd7ec('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1115=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1115,0x16c));var _0x5111=function(_0xab235,_0x5e6372){_0xab235=_0xab235-0x0;var _0x3fcec6=_0x1115[_0xab235];return _0x3fcec6;};'use strict';var Sequelize=require(_0x5111('0x0'));module[_0x5111('0x1')]={'name':{'type':Sequelize[_0x5111('0x2')]},'description':{'type':Sequelize[_0x5111('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 82d670c..658f3c8 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 _0x7c09=['../../config/environment','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','json','offset','limit','set','apply','reject','save','update','destroy','end','stack','name','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','params','find','create','body','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x49b984,_0x387c83){var _0x49d1e0=function(_0x3664c7){while(--_0x3664c7){_0x49b984['push'](_0x49b984['shift']());}};_0x49d1e0(++_0x387c83);}(_0x7c09,0x102));var _0x97c0=function(_0x17c5ad,_0x463d1f){_0x17c5ad=_0x17c5ad-0x0;var _0x2e6dba=_0x7c09[_0x17c5ad];return _0x2e6dba;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x97c0('0x0'));var rimraf=require(_0x97c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x97c0('0x2'));var rp=require(_0x97c0('0x3'));var moment=require(_0x97c0('0x4'));var BPromise=require(_0x97c0('0x5'));var Mustache=require(_0x97c0('0x6'));var util=require(_0x97c0('0x7'));var path=require(_0x97c0('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x97c0('0x9'));var squel=require(_0x97c0('0xa'));var crypto=require(_0x97c0('0xb'));var jsforce=require(_0x97c0('0xc'));var deskjs=require(_0x97c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x97c0('0xe'));var Papa=require('papaparse');var Redis=require(_0x97c0('0xf'));var authService=require(_0x97c0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x97c0('0x11'));var logger=require(_0x97c0('0x12'))(_0x97c0('0x13'));var utils=require(_0x97c0('0x14'));var config=require(_0x97c0('0x15'));var db=require(_0x97c0('0x16'))['db'];var jayson=require(_0x97c0('0x17'));var client=jayson[_0x97c0('0x18')][_0x97c0('0x19')]({'port':0x232a});function checkPasswordPattern(_0x2ecf34,_0x2810fd,_0x132865){if(_0x132865){var _0x20acfa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x20acfa['test'](_0x2810fd)){return _0x2ecf34;}else{throw new db[(_0x97c0('0x1a'))][(_0x97c0('0x1b'))](_0x97c0('0x1c'));}}else{return _0x2ecf34;}}function respondWithRpcPromise(_0x496017,_0x42027d,_0x9ca6a8,_0x379951){return new BPromise(function(_0x21e5f7,_0x482be5){var _0x13d46e=_0x379951||client;return _0x13d46e['request'](_0x496017,_0x9ca6a8)[_0x97c0('0x1d')](function(_0x3ae7c4){logger['info'](_0x97c0('0x1e'),_0x42027d,_0x97c0('0x1f'));logger[_0x97c0('0x20')](_0x97c0('0x21'),_0x42027d,_0x97c0('0x1f'),JSON[_0x97c0('0x22')](_0x3ae7c4));if(_0x3ae7c4[_0x97c0('0x23')]){if(_0x3ae7c4[_0x97c0('0x23')][_0x97c0('0x24')]===0x1f4){logger[_0x97c0('0x23')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x42027d,_0x3ae7c4['error'][_0x97c0('0x25')]);return _0x482be5(_0x3ae7c4[_0x97c0('0x23')][_0x97c0('0x25')]);}logger['error'](_0x97c0('0x1e'),_0x42027d,_0x3ae7c4[_0x97c0('0x23')][_0x97c0('0x25')]);return _0x21e5f7(_0x3ae7c4[_0x97c0('0x23')][_0x97c0('0x25')]);}else{logger[_0x97c0('0x26')](_0x97c0('0x1e'),_0x42027d,'request\x20sent');_0x21e5f7(_0x3ae7c4[_0x97c0('0x27')][_0x97c0('0x25')]);}})[_0x97c0('0x28')](function(_0x216785){logger['error'](_0x97c0('0x1e'),_0x42027d,_0x216785);_0x482be5(_0x216785);});});}function respondWithStatusCode(_0x14cada,_0x52a429){_0x52a429=_0x52a429||0xcc;return function(_0x2ec9d6){if(_0x2ec9d6){return _0x14cada[_0x97c0('0x29')](_0x52a429);}return _0x14cada[_0x97c0('0x2a')](_0x52a429)['end']();};}function respondWithResult(_0x4f11ba,_0x51f258){_0x51f258=_0x51f258||0xc8;return function(_0x11b8ad){if(_0x11b8ad){return _0x4f11ba[_0x97c0('0x2a')](_0x51f258)[_0x97c0('0x2b')](_0x11b8ad);}};}function respondWithFilteredResult(_0x225e43,_0x26939e){return function(_0x153b14){if(_0x153b14){var _0x4a3645=_0x153b14['count'],_0x10e47e=_0x26939e[_0x97c0('0x2c')],_0x1c183f=_0x26939e[_0x97c0('0x2c')]+_0x26939e[_0x97c0('0x2d')],_0x325090;if(_0x1c183f>=_0x4a3645){_0x1c183f=_0x4a3645;_0x325090=0xc8;}else{_0x325090=0xce;}_0x225e43[_0x97c0('0x2a')](_0x325090);return _0x225e43[_0x97c0('0x2e')]('Content-Range',_0x10e47e+'-'+_0x1c183f+'/'+_0x4a3645)['json'](_0x153b14);}return null;};}function patchUpdates(_0x29ad98){return function(_0x353fc9){try{jsonpatch[_0x97c0('0x2f')](_0x353fc9,_0x29ad98,!![]);}catch(_0x58f2e8){return BPromise[_0x97c0('0x30')](_0x58f2e8);}return _0x353fc9[_0x97c0('0x31')]();};}function saveUpdates(_0x52bdfe,_0x30147b){return function(_0x22833e){if(_0x22833e){return _0x22833e[_0x97c0('0x32')](_0x52bdfe)[_0x97c0('0x1d')](function(_0x28ed7d){return _0x28ed7d;});}return null;};}function removeEntity(_0x2aa05b,_0x4624ed){return function(_0x1a6c4b){if(_0x1a6c4b){return _0x1a6c4b[_0x97c0('0x33')]()[_0x97c0('0x1d')](function(){_0x2aa05b[_0x97c0('0x2a')](0xcc)[_0x97c0('0x34')]();});}};}function handleEntityNotFound(_0x1de938,_0x11485f){return function(_0x287739){if(!_0x287739){_0x1de938['sendStatus'](0x194);}return _0x287739;};}function handleError(_0x292560,_0x1548b6){_0x1548b6=_0x1548b6||0x1f4;return function(_0x2b7f9a){logger[_0x97c0('0x23')](_0x2b7f9a[_0x97c0('0x35')]);if(_0x2b7f9a[_0x97c0('0x36')]){delete _0x2b7f9a[_0x97c0('0x36')];}_0x292560[_0x97c0('0x2a')](_0x1548b6)['send'](_0x2b7f9a);};}exports[_0x97c0('0x37')]=function(_0x4bf42a,_0x23e482){var _0x20291={},_0xc4c795={},_0x3988d3={'count':0x0,'rows':[]};var _0x41e360=_[_0x97c0('0x38')](db[_0x97c0('0x39')][_0x97c0('0x3a')],function(_0x38f37a){return{'name':_0x38f37a[_0x97c0('0x3b')],'type':_0x38f37a[_0x97c0('0x3c')]['key']};});_0xc4c795[_0x97c0('0x3d')]=_[_0x97c0('0x38')](_0x41e360,'name');_0xc4c795[_0x97c0('0x3e')]=_[_0x97c0('0x3f')](_0x4bf42a[_0x97c0('0x3e')]);_0xc4c795[_0x97c0('0x40')]=_['intersection'](_0xc4c795[_0x97c0('0x3d')],_0xc4c795['query']);_0x20291[_0x97c0('0x41')]=_[_0x97c0('0x42')](_0xc4c795['model'],qs[_0x97c0('0x43')](_0x4bf42a[_0x97c0('0x3e')][_0x97c0('0x43')]));_0x20291[_0x97c0('0x41')]=_0x20291[_0x97c0('0x41')][_0x97c0('0x44')]?_0x20291[_0x97c0('0x41')]:_0xc4c795[_0x97c0('0x3d')];if(!_0x4bf42a[_0x97c0('0x3e')][_0x97c0('0x45')](_0x97c0('0x46'))){_0x20291[_0x97c0('0x2d')]=qs[_0x97c0('0x2d')](_0x4bf42a['query'][_0x97c0('0x2d')]);_0x20291[_0x97c0('0x2c')]=qs[_0x97c0('0x2c')](_0x4bf42a[_0x97c0('0x3e')][_0x97c0('0x2c')]);}_0x20291[_0x97c0('0x47')]=qs[_0x97c0('0x48')](_0x4bf42a['query']['sort']);_0x20291[_0x97c0('0x49')]=qs[_0x97c0('0x40')](_[_0x97c0('0x4a')](_0x4bf42a[_0x97c0('0x3e')],_0xc4c795[_0x97c0('0x40')]));if(_0x4bf42a['query']['filter']){_0x20291['where']=_[_0x97c0('0x4b')](_0x20291['where'],{'$or':_['map'](_0x41e360,function(_0x1d0e94){if(_0x1d0e94[_0x97c0('0x3c')]!==_0x97c0('0x4c')){var _0x15e427={};_0x15e427[_0x1d0e94[_0x97c0('0x36')]]={'$like':'%'+_0x4bf42a['query'][_0x97c0('0x4d')]+'%'};return _0x15e427;}})});}_0x20291=_[_0x97c0('0x4b')]({},_0x20291,_0x4bf42a[_0x97c0('0x4e')]);var _0x10a8ea={'where':_0x20291[_0x97c0('0x49')]};return db[_0x97c0('0x39')][_0x97c0('0x4f')](_0x10a8ea)[_0x97c0('0x1d')](function(_0x2c50ff){_0x3988d3[_0x97c0('0x4f')]=_0x2c50ff;if(_0x4bf42a['query'][_0x97c0('0x50')]){_0x20291[_0x97c0('0x51')]=[{'all':!![]}];}return db[_0x97c0('0x39')][_0x97c0('0x52')](_0x20291);})['then'](function(_0x597a0f){_0x3988d3[_0x97c0('0x53')]=_0x597a0f;return _0x3988d3;})[_0x97c0('0x1d')](respondWithFilteredResult(_0x23e482,_0x20291))[_0x97c0('0x28')](handleError(_0x23e482,null));};exports['show']=function(_0x3e09d5,_0xac56ac){var _0x240f68={'raw':![],'where':{'id':_0x3e09d5[_0x97c0('0x54')]['id']}},_0x2fc02f={};_0x2fc02f['model']=_[_0x97c0('0x3f')](db[_0x97c0('0x39')][_0x97c0('0x3a')]);_0x2fc02f['query']=_['keys'](_0x3e09d5[_0x97c0('0x3e')]);_0x2fc02f['filters']=_['intersection'](_0x2fc02f[_0x97c0('0x3d')],_0x2fc02f[_0x97c0('0x3e')]);_0x240f68[_0x97c0('0x41')]=_['intersection'](_0x2fc02f['model'],qs['fields'](_0x3e09d5[_0x97c0('0x3e')][_0x97c0('0x43')]));_0x240f68[_0x97c0('0x41')]=_0x240f68[_0x97c0('0x41')][_0x97c0('0x44')]?_0x240f68[_0x97c0('0x41')]:_0x2fc02f[_0x97c0('0x3d')];if(_0x3e09d5['query'][_0x97c0('0x50')]){_0x240f68[_0x97c0('0x51')]=[{'all':!![]}];}_0x240f68=_[_0x97c0('0x4b')]({},_0x240f68,_0x3e09d5[_0x97c0('0x4e')]);return db[_0x97c0('0x39')][_0x97c0('0x55')](_0x240f68)['then'](handleEntityNotFound(_0xac56ac,null))[_0x97c0('0x1d')](respondWithResult(_0xac56ac,null))[_0x97c0('0x28')](handleError(_0xac56ac,null));};exports['create']=function(_0x245f2a,_0x3e212b){return db[_0x97c0('0x39')][_0x97c0('0x56')](_0x245f2a[_0x97c0('0x57')],{})[_0x97c0('0x1d')](respondWithResult(_0x3e212b,0xc9))[_0x97c0('0x28')](handleError(_0x3e212b,null));};exports['update']=function(_0x2cd43c,_0x14e93c){if(_0x2cd43c[_0x97c0('0x57')]['id']){delete _0x2cd43c[_0x97c0('0x57')]['id'];}return db[_0x97c0('0x39')][_0x97c0('0x55')]({'where':{'id':_0x2cd43c[_0x97c0('0x54')]['id']}})[_0x97c0('0x1d')](handleEntityNotFound(_0x14e93c,null))[_0x97c0('0x1d')](saveUpdates(_0x2cd43c[_0x97c0('0x57')],null))[_0x97c0('0x1d')](respondWithResult(_0x14e93c,null))[_0x97c0('0x28')](handleError(_0x14e93c,null));};exports[_0x97c0('0x33')]=function(_0x57766f,_0x771495){return db[_0x97c0('0x39')][_0x97c0('0x55')]({'where':{'id':_0x57766f[_0x97c0('0x54')]['id']}})[_0x97c0('0x1d')](handleEntityNotFound(_0x771495,null))[_0x97c0('0x1d')](removeEntity(_0x771495,null))['catch'](handleError(_0x771495,null));};exports[_0x97c0('0x58')]=function(_0x1ad855,_0x5f3803,_0x2813e8){var _0x3c9f09={};var _0x1ceae3={};var _0x586ca1;var _0x829ca8;return db['FreshsalesConfiguration'][_0x97c0('0x59')]({'where':{'id':_0x1ad855[_0x97c0('0x54')]['id']}})[_0x97c0('0x1d')](handleEntityNotFound(_0x5f3803,null))[_0x97c0('0x1d')](function(_0x3c5150){if(_0x3c5150){_0x586ca1=_0x3c5150;_0x1ceae3[_0x97c0('0x3d')]=_[_0x97c0('0x3f')](db[_0x97c0('0x5a')][_0x97c0('0x3a')]);_0x1ceae3[_0x97c0('0x3e')]=_[_0x97c0('0x3f')](_0x1ad855['query']);_0x1ceae3[_0x97c0('0x40')]=_[_0x97c0('0x42')](_0x1ceae3[_0x97c0('0x3d')],_0x1ceae3[_0x97c0('0x3e')]);_0x3c9f09['attributes']=_[_0x97c0('0x42')](_0x1ceae3[_0x97c0('0x3d')],qs[_0x97c0('0x43')](_0x1ad855[_0x97c0('0x3e')]['fields']));_0x3c9f09[_0x97c0('0x41')]=_0x3c9f09[_0x97c0('0x41')][_0x97c0('0x44')]?_0x3c9f09['attributes']:_0x1ceae3[_0x97c0('0x3d')];_0x3c9f09[_0x97c0('0x47')]=qs[_0x97c0('0x48')](_0x1ad855[_0x97c0('0x3e')][_0x97c0('0x48')]);_0x3c9f09[_0x97c0('0x49')]=qs[_0x97c0('0x40')](_['pick'](_0x1ad855['query'],_0x1ceae3[_0x97c0('0x40')]));if(_0x1ad855[_0x97c0('0x3e')]['filter']){_0x3c9f09[_0x97c0('0x49')]=_['merge'](_0x3c9f09['where'],{'$or':_[_0x97c0('0x38')](_0x3c9f09['attributes'],function(_0x17101c){var _0x41b122={};_0x41b122[_0x17101c]={'$like':'%'+_0x1ad855['query']['filter']+'%'};return _0x41b122;})});}_0x3c9f09=_['merge']({},_0x3c9f09,_0x1ad855[_0x97c0('0x4e')]);return _0x586ca1['getSubjects'](_0x3c9f09);}})[_0x97c0('0x1d')](function(_0xc02039){if(_0xc02039){_0x829ca8=_0xc02039[_0x97c0('0x44')];if(!_0x1ad855[_0x97c0('0x3e')][_0x97c0('0x45')](_0x97c0('0x46'))){_0x3c9f09[_0x97c0('0x2d')]=qs[_0x97c0('0x2d')](_0x1ad855[_0x97c0('0x3e')][_0x97c0('0x2d')]);_0x3c9f09[_0x97c0('0x2c')]=qs['offset'](_0x1ad855[_0x97c0('0x3e')][_0x97c0('0x2c')]);}return _0x586ca1[_0x97c0('0x58')](_0x3c9f09);}})[_0x97c0('0x1d')](function(_0x7063a1){if(_0x7063a1){return _0x7063a1?{'count':_0x829ca8,'rows':_0x7063a1}:null;}})['then'](respondWithResult(_0x5f3803,null))[_0x97c0('0x28')](handleError(_0x5f3803,null));};exports[_0x97c0('0x5b')]=function(_0x579f54,_0x4116c9,_0x30ffa8){var _0x1cfe22={};var _0x4f52f4={};var _0xa5f32b;var _0x100d97;return db[_0x97c0('0x39')][_0x97c0('0x59')]({'where':{'id':_0x579f54['params']['id']}})['then'](handleEntityNotFound(_0x4116c9,null))['then'](function(_0x443508){if(_0x443508){_0xa5f32b=_0x443508;_0x4f52f4[_0x97c0('0x3d')]=_[_0x97c0('0x3f')](db[_0x97c0('0x5a')][_0x97c0('0x3a')]);_0x4f52f4[_0x97c0('0x3e')]=_[_0x97c0('0x3f')](_0x579f54[_0x97c0('0x3e')]);_0x4f52f4['filters']=_['intersection'](_0x4f52f4[_0x97c0('0x3d')],_0x4f52f4['query']);_0x1cfe22['attributes']=_['intersection'](_0x4f52f4[_0x97c0('0x3d')],qs[_0x97c0('0x43')](_0x579f54[_0x97c0('0x3e')][_0x97c0('0x43')]));_0x1cfe22[_0x97c0('0x41')]=_0x1cfe22['attributes']['length']?_0x1cfe22[_0x97c0('0x41')]:_0x4f52f4[_0x97c0('0x3d')];_0x1cfe22[_0x97c0('0x47')]=qs[_0x97c0('0x48')](_0x579f54['query'][_0x97c0('0x48')]);_0x1cfe22['where']=qs[_0x97c0('0x40')](_[_0x97c0('0x4a')](_0x579f54[_0x97c0('0x3e')],_0x4f52f4[_0x97c0('0x40')]));if(_0x579f54[_0x97c0('0x3e')][_0x97c0('0x4d')]){_0x1cfe22[_0x97c0('0x49')]=_[_0x97c0('0x4b')](_0x1cfe22[_0x97c0('0x49')],{'$or':_[_0x97c0('0x38')](_0x1cfe22['attributes'],function(_0x65f918){var _0x569516={};_0x569516[_0x65f918]={'$like':'%'+_0x579f54['query'][_0x97c0('0x4d')]+'%'};return _0x569516;})});}_0x1cfe22=_[_0x97c0('0x4b')]({},_0x1cfe22,_0x579f54['options']);return _0xa5f32b[_0x97c0('0x5b')](_0x1cfe22);}})['then'](function(_0x1f2380){if(_0x1f2380){_0x100d97=_0x1f2380[_0x97c0('0x44')];if(!_0x579f54['query'][_0x97c0('0x45')]('nolimit')){_0x1cfe22['limit']=qs['limit'](_0x579f54[_0x97c0('0x3e')][_0x97c0('0x2d')]);_0x1cfe22['offset']=qs[_0x97c0('0x2c')](_0x579f54[_0x97c0('0x3e')][_0x97c0('0x2c')]);}return _0xa5f32b[_0x97c0('0x5b')](_0x1cfe22);}})[_0x97c0('0x1d')](function(_0x11db50){if(_0x11db50){return _0x11db50?{'count':_0x100d97,'rows':_0x11db50}:null;}})[_0x97c0('0x1d')](respondWithResult(_0x4116c9,null))[_0x97c0('0x28')](handleError(_0x4116c9,null));};exports['getFields']=function(_0x1b9adf,_0x4e7b60,_0x597cd1){var _0x4062f8={};var _0x4f9307={};var _0x3f69a6;var _0x15f953;return db['FreshsalesConfiguration'][_0x97c0('0x59')]({'where':{'id':_0x1b9adf[_0x97c0('0x54')]['id']}})[_0x97c0('0x1d')](handleEntityNotFound(_0x4e7b60,null))[_0x97c0('0x1d')](function(_0x388ba1){if(_0x388ba1){_0x3f69a6=_0x388ba1;_0x4f9307['model']=_[_0x97c0('0x3f')](db[_0x97c0('0x5a')][_0x97c0('0x3a')]);_0x4f9307['query']=_[_0x97c0('0x3f')](_0x1b9adf[_0x97c0('0x3e')]);_0x4f9307[_0x97c0('0x40')]=_[_0x97c0('0x42')](_0x4f9307['model'],_0x4f9307[_0x97c0('0x3e')]);_0x4062f8[_0x97c0('0x41')]=_[_0x97c0('0x42')](_0x4f9307[_0x97c0('0x3d')],qs[_0x97c0('0x43')](_0x1b9adf['query'][_0x97c0('0x43')]));_0x4062f8[_0x97c0('0x41')]=_0x4062f8['attributes']['length']?_0x4062f8[_0x97c0('0x41')]:_0x4f9307[_0x97c0('0x3d')];_0x4062f8[_0x97c0('0x47')]=qs['sort'](_0x1b9adf['query'][_0x97c0('0x48')]);_0x4062f8['where']=qs[_0x97c0('0x40')](_[_0x97c0('0x4a')](_0x1b9adf[_0x97c0('0x3e')],_0x4f9307[_0x97c0('0x40')]));if(_0x1b9adf[_0x97c0('0x3e')][_0x97c0('0x4d')]){_0x4062f8[_0x97c0('0x49')]=_['merge'](_0x4062f8[_0x97c0('0x49')],{'$or':_[_0x97c0('0x38')](_0x4062f8[_0x97c0('0x41')],function(_0x4ed628){var _0x312ace={};_0x312ace[_0x4ed628]={'$like':'%'+_0x1b9adf[_0x97c0('0x3e')][_0x97c0('0x4d')]+'%'};return _0x312ace;})});}_0x4062f8=_[_0x97c0('0x4b')]({},_0x4062f8,_0x1b9adf[_0x97c0('0x4e')]);return _0x3f69a6[_0x97c0('0x5c')](_0x4062f8);}})[_0x97c0('0x1d')](function(_0x1b2e52){if(_0x1b2e52){_0x15f953=_0x1b2e52[_0x97c0('0x44')];if(!_0x1b9adf[_0x97c0('0x3e')]['hasOwnProperty'](_0x97c0('0x46'))){_0x4062f8[_0x97c0('0x2d')]=qs[_0x97c0('0x2d')](_0x1b9adf[_0x97c0('0x3e')]['limit']);_0x4062f8[_0x97c0('0x2c')]=qs[_0x97c0('0x2c')](_0x1b9adf[_0x97c0('0x3e')][_0x97c0('0x2c')]);}return _0x3f69a6[_0x97c0('0x5c')](_0x4062f8);}})[_0x97c0('0x1d')](function(_0xf4a5c8){if(_0xf4a5c8){return _0xf4a5c8?{'count':_0x15f953,'rows':_0xf4a5c8}:null;}})['then'](respondWithResult(_0x4e7b60,null))[_0x97c0('0x28')](handleError(_0x4e7b60,null));}; \ No newline at end of file +var _0xfcbe=['api','../../config/utils','../../config/environment','../../mysqldb','client','http','Sequelize','ValidationError','request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','json','count','offset','set','Content-Range','apply','save','update','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','limit','order','sort','pick','filter','where','merge','FreshsalesConfiguration','include','findAll','rows','catch','show','params','length','includeAll','options','find','create','body','getSubjects','findOne','hasOwnProperty','getDescriptions','FreshsalesField','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger'];(function(_0x297c55,_0x34fa75){var _0x120389=function(_0x595108){while(--_0x595108){_0x297c55['push'](_0x297c55['shift']());}};_0x120389(++_0x34fa75);}(_0xfcbe,0x1b1));var _0xefcb=function(_0x2b824c,_0x25390f){_0x2b824c=_0x2b824c-0x0;var _0x3e8293=_0xfcbe[_0x2b824c];return _0x3e8293;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xefcb('0x0'));var rimraf=require(_0xefcb('0x1'));var zipdir=require(_0xefcb('0x2'));var jsonpatch=require(_0xefcb('0x3'));var rp=require(_0xefcb('0x4'));var moment=require(_0xefcb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xefcb('0x6'));var util=require(_0xefcb('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xefcb('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xefcb('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xefcb('0xa'));var toCsv=require(_0xefcb('0xb'));var querystring=require(_0xefcb('0xc'));var Papa=require('papaparse');var Redis=require(_0xefcb('0xd'));var authService=require(_0xefcb('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xefcb('0xf'));var logger=require(_0xefcb('0x10'))(_0xefcb('0x11'));var utils=require(_0xefcb('0x12'));var config=require(_0xefcb('0x13'));var db=require(_0xefcb('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xefcb('0x15')][_0xefcb('0x16')]({'port':0x232a});function checkPasswordPattern(_0x2c77dd,_0x30b31d,_0x3bfbb3){if(_0x3bfbb3){var _0x5c1ed6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5c1ed6['test'](_0x30b31d)){return _0x2c77dd;}else{throw new db[(_0xefcb('0x17'))][(_0xefcb('0x18'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2c77dd;}}function respondWithRpcPromise(_0x26f660,_0x565c13,_0x3946ef,_0x565fae){return new BPromise(function(_0x172816,_0x46a22a){var _0x440e20=_0x565fae||client;return _0x440e20[_0xefcb('0x19')](_0x26f660,_0x3946ef)[_0xefcb('0x1a')](function(_0x13d883){logger['info'](_0xefcb('0x1b'),_0x565c13,_0xefcb('0x1c'));logger[_0xefcb('0x1d')](_0xefcb('0x1e'),_0x565c13,_0xefcb('0x1c'),JSON[_0xefcb('0x1f')](_0x13d883));if(_0x13d883[_0xefcb('0x20')]){if(_0x13d883['error'][_0xefcb('0x21')]===0x1f4){logger[_0xefcb('0x20')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x565c13,_0x13d883[_0xefcb('0x20')][_0xefcb('0x22')]);return _0x46a22a(_0x13d883[_0xefcb('0x20')][_0xefcb('0x22')]);}logger[_0xefcb('0x20')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x565c13,_0x13d883[_0xefcb('0x20')][_0xefcb('0x22')]);return _0x172816(_0x13d883[_0xefcb('0x20')][_0xefcb('0x22')]);}else{logger[_0xefcb('0x23')](_0xefcb('0x1b'),_0x565c13,_0xefcb('0x1c'));_0x172816(_0x13d883[_0xefcb('0x24')]['message']);}})['catch'](function(_0x5991c6){logger[_0xefcb('0x20')](_0xefcb('0x1b'),_0x565c13,_0x5991c6);_0x46a22a(_0x5991c6);});});}function respondWithStatusCode(_0x457ff6,_0x1717b7){_0x1717b7=_0x1717b7||0xcc;return function(_0x20f51f){if(_0x20f51f){return _0x457ff6[_0xefcb('0x25')](_0x1717b7);}return _0x457ff6[_0xefcb('0x26')](_0x1717b7)['end']();};}function respondWithResult(_0x3029d1,_0x16f800){_0x16f800=_0x16f800||0xc8;return function(_0xa42610){if(_0xa42610){return _0x3029d1[_0xefcb('0x26')](_0x16f800)[_0xefcb('0x27')](_0xa42610);}};}function respondWithFilteredResult(_0x18f3be,_0x16757b){return function(_0x36521c){if(_0x36521c){var _0x1c7ee1=_0x36521c[_0xefcb('0x28')],_0xe2c2c8=_0x16757b[_0xefcb('0x29')],_0x124546=_0x16757b[_0xefcb('0x29')]+_0x16757b['limit'],_0x160782;if(_0x124546>=_0x1c7ee1){_0x124546=_0x1c7ee1;_0x160782=0xc8;}else{_0x160782=0xce;}_0x18f3be[_0xefcb('0x26')](_0x160782);return _0x18f3be[_0xefcb('0x2a')](_0xefcb('0x2b'),_0xe2c2c8+'-'+_0x124546+'/'+_0x1c7ee1)[_0xefcb('0x27')](_0x36521c);}return null;};}function patchUpdates(_0x301daa){return function(_0xc83f28){try{jsonpatch[_0xefcb('0x2c')](_0xc83f28,_0x301daa,!![]);}catch(_0x5a436c){return BPromise['reject'](_0x5a436c);}return _0xc83f28[_0xefcb('0x2d')]();};}function saveUpdates(_0x423589,_0x494933){return function(_0x24e58b){if(_0x24e58b){return _0x24e58b[_0xefcb('0x2e')](_0x423589)[_0xefcb('0x1a')](function(_0x52f729){return _0x52f729;});}return null;};}function removeEntity(_0x11da4f,_0x287386){return function(_0x43a810){if(_0x43a810){return _0x43a810['destroy']()['then'](function(){_0x11da4f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fe1d6,_0x13f688){return function(_0x3c8e59){if(!_0x3c8e59){_0x2fe1d6[_0xefcb('0x25')](0x194);}return _0x3c8e59;};}function handleError(_0x2b1759,_0x352db0){_0x352db0=_0x352db0||0x1f4;return function(_0x32562b){logger[_0xefcb('0x20')](_0x32562b[_0xefcb('0x2f')]);if(_0x32562b[_0xefcb('0x30')]){delete _0x32562b[_0xefcb('0x30')];}_0x2b1759[_0xefcb('0x26')](_0x352db0)[_0xefcb('0x31')](_0x32562b);};}exports[_0xefcb('0x32')]=function(_0x278cf5,_0x102933){var _0x4b2a43={},_0x194b7b={},_0x22cdff={'count':0x0,'rows':[]};var _0x31418b=_[_0xefcb('0x33')](db['FreshsalesConfiguration'][_0xefcb('0x34')],function(_0x5e5b5a){return{'name':_0x5e5b5a[_0xefcb('0x35')],'type':_0x5e5b5a[_0xefcb('0x36')][_0xefcb('0x37')]};});_0x194b7b[_0xefcb('0x38')]=_['map'](_0x31418b,_0xefcb('0x30'));_0x194b7b[_0xefcb('0x39')]=_[_0xefcb('0x3a')](_0x278cf5['query']);_0x194b7b[_0xefcb('0x3b')]=_[_0xefcb('0x3c')](_0x194b7b[_0xefcb('0x38')],_0x194b7b['query']);_0x4b2a43['attributes']=_[_0xefcb('0x3c')](_0x194b7b['model'],qs['fields'](_0x278cf5[_0xefcb('0x39')][_0xefcb('0x3d')]));_0x4b2a43[_0xefcb('0x3e')]=_0x4b2a43['attributes']['length']?_0x4b2a43['attributes']:_0x194b7b[_0xefcb('0x38')];if(!_0x278cf5[_0xefcb('0x39')]['hasOwnProperty'](_0xefcb('0x3f'))){_0x4b2a43['limit']=qs[_0xefcb('0x40')](_0x278cf5[_0xefcb('0x39')][_0xefcb('0x40')]);_0x4b2a43[_0xefcb('0x29')]=qs[_0xefcb('0x29')](_0x278cf5['query']['offset']);}_0x4b2a43[_0xefcb('0x41')]=qs[_0xefcb('0x42')](_0x278cf5['query']['sort']);_0x4b2a43['where']=qs[_0xefcb('0x3b')](_[_0xefcb('0x43')](_0x278cf5['query'],_0x194b7b[_0xefcb('0x3b')]));if(_0x278cf5['query'][_0xefcb('0x44')]){_0x4b2a43[_0xefcb('0x45')]=_[_0xefcb('0x46')](_0x4b2a43[_0xefcb('0x45')],{'$or':_[_0xefcb('0x33')](_0x31418b,function(_0x564df3){if(_0x564df3[_0xefcb('0x36')]!=='VIRTUAL'){var _0x30a7ac={};_0x30a7ac[_0x564df3['name']]={'$like':'%'+_0x278cf5[_0xefcb('0x39')]['filter']+'%'};return _0x30a7ac;}})});}_0x4b2a43=_[_0xefcb('0x46')]({},_0x4b2a43,_0x278cf5['options']);var _0x13766c={'where':_0x4b2a43[_0xefcb('0x45')]};return db[_0xefcb('0x47')][_0xefcb('0x28')](_0x13766c)[_0xefcb('0x1a')](function(_0x443a93){_0x22cdff['count']=_0x443a93;if(_0x278cf5[_0xefcb('0x39')]['includeAll']){_0x4b2a43[_0xefcb('0x48')]=[{'all':!![]}];}return db[_0xefcb('0x47')][_0xefcb('0x49')](_0x4b2a43);})[_0xefcb('0x1a')](function(_0x3a313f){_0x22cdff[_0xefcb('0x4a')]=_0x3a313f;return _0x22cdff;})['then'](respondWithFilteredResult(_0x102933,_0x4b2a43))[_0xefcb('0x4b')](handleError(_0x102933,null));};exports[_0xefcb('0x4c')]=function(_0x2e4a23,_0x53c7d6){var _0x4bdcc0={'raw':![],'where':{'id':_0x2e4a23[_0xefcb('0x4d')]['id']}},_0x1b34a2={};_0x1b34a2['model']=_[_0xefcb('0x3a')](db[_0xefcb('0x47')][_0xefcb('0x34')]);_0x1b34a2[_0xefcb('0x39')]=_[_0xefcb('0x3a')](_0x2e4a23[_0xefcb('0x39')]);_0x1b34a2['filters']=_[_0xefcb('0x3c')](_0x1b34a2[_0xefcb('0x38')],_0x1b34a2[_0xefcb('0x39')]);_0x4bdcc0[_0xefcb('0x3e')]=_[_0xefcb('0x3c')](_0x1b34a2[_0xefcb('0x38')],qs[_0xefcb('0x3d')](_0x2e4a23['query'][_0xefcb('0x3d')]));_0x4bdcc0[_0xefcb('0x3e')]=_0x4bdcc0[_0xefcb('0x3e')][_0xefcb('0x4e')]?_0x4bdcc0[_0xefcb('0x3e')]:_0x1b34a2[_0xefcb('0x38')];if(_0x2e4a23[_0xefcb('0x39')][_0xefcb('0x4f')]){_0x4bdcc0[_0xefcb('0x48')]=[{'all':!![]}];}_0x4bdcc0=_[_0xefcb('0x46')]({},_0x4bdcc0,_0x2e4a23[_0xefcb('0x50')]);return db[_0xefcb('0x47')][_0xefcb('0x51')](_0x4bdcc0)[_0xefcb('0x1a')](handleEntityNotFound(_0x53c7d6,null))[_0xefcb('0x1a')](respondWithResult(_0x53c7d6,null))[_0xefcb('0x4b')](handleError(_0x53c7d6,null));};exports['create']=function(_0x208fb4,_0x189585){return db['FreshsalesConfiguration'][_0xefcb('0x52')](_0x208fb4[_0xefcb('0x53')],{})[_0xefcb('0x1a')](respondWithResult(_0x189585,0xc9))['catch'](handleError(_0x189585,null));};exports['update']=function(_0x35aea3,_0x19fa18){if(_0x35aea3[_0xefcb('0x53')]['id']){delete _0x35aea3[_0xefcb('0x53')]['id'];}return db['FreshsalesConfiguration'][_0xefcb('0x51')]({'where':{'id':_0x35aea3[_0xefcb('0x4d')]['id']}})[_0xefcb('0x1a')](handleEntityNotFound(_0x19fa18,null))[_0xefcb('0x1a')](saveUpdates(_0x35aea3[_0xefcb('0x53')],null))[_0xefcb('0x1a')](respondWithResult(_0x19fa18,null))[_0xefcb('0x4b')](handleError(_0x19fa18,null));};exports['destroy']=function(_0x4711aa,_0x3ba104){return db[_0xefcb('0x47')][_0xefcb('0x51')]({'where':{'id':_0x4711aa['params']['id']}})[_0xefcb('0x1a')](handleEntityNotFound(_0x3ba104,null))['then'](removeEntity(_0x3ba104,null))[_0xefcb('0x4b')](handleError(_0x3ba104,null));};exports[_0xefcb('0x54')]=function(_0x7812da,_0x1e7ba9,_0x168881){var _0x4050de={};var _0x50a3f5={};var _0xe450bc;var _0x1366ca;return db[_0xefcb('0x47')][_0xefcb('0x55')]({'where':{'id':_0x7812da['params']['id']}})[_0xefcb('0x1a')](handleEntityNotFound(_0x1e7ba9,null))[_0xefcb('0x1a')](function(_0x40a073){if(_0x40a073){_0xe450bc=_0x40a073;_0x50a3f5[_0xefcb('0x38')]=_['keys'](db['FreshsalesField'][_0xefcb('0x34')]);_0x50a3f5[_0xefcb('0x39')]=_[_0xefcb('0x3a')](_0x7812da[_0xefcb('0x39')]);_0x50a3f5[_0xefcb('0x3b')]=_[_0xefcb('0x3c')](_0x50a3f5['model'],_0x50a3f5[_0xefcb('0x39')]);_0x4050de['attributes']=_[_0xefcb('0x3c')](_0x50a3f5[_0xefcb('0x38')],qs['fields'](_0x7812da[_0xefcb('0x39')][_0xefcb('0x3d')]));_0x4050de[_0xefcb('0x3e')]=_0x4050de['attributes'][_0xefcb('0x4e')]?_0x4050de[_0xefcb('0x3e')]:_0x50a3f5[_0xefcb('0x38')];_0x4050de[_0xefcb('0x41')]=qs[_0xefcb('0x42')](_0x7812da[_0xefcb('0x39')][_0xefcb('0x42')]);_0x4050de[_0xefcb('0x45')]=qs[_0xefcb('0x3b')](_[_0xefcb('0x43')](_0x7812da['query'],_0x50a3f5[_0xefcb('0x3b')]));if(_0x7812da[_0xefcb('0x39')][_0xefcb('0x44')]){_0x4050de[_0xefcb('0x45')]=_[_0xefcb('0x46')](_0x4050de[_0xefcb('0x45')],{'$or':_[_0xefcb('0x33')](_0x4050de[_0xefcb('0x3e')],function(_0x28fba7){var _0x52c2b7={};_0x52c2b7[_0x28fba7]={'$like':'%'+_0x7812da[_0xefcb('0x39')][_0xefcb('0x44')]+'%'};return _0x52c2b7;})});}_0x4050de=_[_0xefcb('0x46')]({},_0x4050de,_0x7812da[_0xefcb('0x50')]);return _0xe450bc[_0xefcb('0x54')](_0x4050de);}})[_0xefcb('0x1a')](function(_0x14d2fb){if(_0x14d2fb){_0x1366ca=_0x14d2fb['length'];if(!_0x7812da['query'][_0xefcb('0x56')](_0xefcb('0x3f'))){_0x4050de['limit']=qs[_0xefcb('0x40')](_0x7812da[_0xefcb('0x39')][_0xefcb('0x40')]);_0x4050de[_0xefcb('0x29')]=qs['offset'](_0x7812da[_0xefcb('0x39')][_0xefcb('0x29')]);}return _0xe450bc[_0xefcb('0x54')](_0x4050de);}})[_0xefcb('0x1a')](function(_0x396a43){if(_0x396a43){return _0x396a43?{'count':_0x1366ca,'rows':_0x396a43}:null;}})[_0xefcb('0x1a')](respondWithResult(_0x1e7ba9,null))[_0xefcb('0x4b')](handleError(_0x1e7ba9,null));};exports[_0xefcb('0x57')]=function(_0x313f0f,_0x4cdc46,_0x7eaec9){var _0xdd5ad9={};var _0x1d810c={};var _0x3391ca;var _0x49cd6b;return db[_0xefcb('0x47')][_0xefcb('0x55')]({'where':{'id':_0x313f0f[_0xefcb('0x4d')]['id']}})[_0xefcb('0x1a')](handleEntityNotFound(_0x4cdc46,null))['then'](function(_0x221f27){if(_0x221f27){_0x3391ca=_0x221f27;_0x1d810c[_0xefcb('0x38')]=_[_0xefcb('0x3a')](db[_0xefcb('0x58')][_0xefcb('0x34')]);_0x1d810c[_0xefcb('0x39')]=_['keys'](_0x313f0f[_0xefcb('0x39')]);_0x1d810c[_0xefcb('0x3b')]=_['intersection'](_0x1d810c[_0xefcb('0x38')],_0x1d810c[_0xefcb('0x39')]);_0xdd5ad9[_0xefcb('0x3e')]=_[_0xefcb('0x3c')](_0x1d810c['model'],qs[_0xefcb('0x3d')](_0x313f0f[_0xefcb('0x39')][_0xefcb('0x3d')]));_0xdd5ad9[_0xefcb('0x3e')]=_0xdd5ad9['attributes']['length']?_0xdd5ad9[_0xefcb('0x3e')]:_0x1d810c[_0xefcb('0x38')];_0xdd5ad9[_0xefcb('0x41')]=qs[_0xefcb('0x42')](_0x313f0f[_0xefcb('0x39')]['sort']);_0xdd5ad9[_0xefcb('0x45')]=qs[_0xefcb('0x3b')](_[_0xefcb('0x43')](_0x313f0f[_0xefcb('0x39')],_0x1d810c[_0xefcb('0x3b')]));if(_0x313f0f[_0xefcb('0x39')][_0xefcb('0x44')]){_0xdd5ad9[_0xefcb('0x45')]=_[_0xefcb('0x46')](_0xdd5ad9[_0xefcb('0x45')],{'$or':_['map'](_0xdd5ad9[_0xefcb('0x3e')],function(_0x23e2da){var _0x43e3b1={};_0x43e3b1[_0x23e2da]={'$like':'%'+_0x313f0f[_0xefcb('0x39')][_0xefcb('0x44')]+'%'};return _0x43e3b1;})});}_0xdd5ad9=_[_0xefcb('0x46')]({},_0xdd5ad9,_0x313f0f[_0xefcb('0x50')]);return _0x3391ca['getDescriptions'](_0xdd5ad9);}})[_0xefcb('0x1a')](function(_0x4d0468){if(_0x4d0468){_0x49cd6b=_0x4d0468[_0xefcb('0x4e')];if(!_0x313f0f['query'][_0xefcb('0x56')]('nolimit')){_0xdd5ad9['limit']=qs['limit'](_0x313f0f[_0xefcb('0x39')][_0xefcb('0x40')]);_0xdd5ad9[_0xefcb('0x29')]=qs[_0xefcb('0x29')](_0x313f0f[_0xefcb('0x39')][_0xefcb('0x29')]);}return _0x3391ca[_0xefcb('0x57')](_0xdd5ad9);}})['then'](function(_0x2297dc){if(_0x2297dc){return _0x2297dc?{'count':_0x49cd6b,'rows':_0x2297dc}:null;}})['then'](respondWithResult(_0x4cdc46,null))[_0xefcb('0x4b')](handleError(_0x4cdc46,null));};exports[_0xefcb('0x59')]=function(_0x5af275,_0x81d8a5,_0x4ad008){var _0x2b2a17={};var _0x2c1e9c={};var _0x2ce051;var _0x4571b4;return db[_0xefcb('0x47')][_0xefcb('0x55')]({'where':{'id':_0x5af275[_0xefcb('0x4d')]['id']}})[_0xefcb('0x1a')](handleEntityNotFound(_0x81d8a5,null))[_0xefcb('0x1a')](function(_0x48f825){if(_0x48f825){_0x2ce051=_0x48f825;_0x2c1e9c[_0xefcb('0x38')]=_['keys'](db['FreshsalesField']['rawAttributes']);_0x2c1e9c[_0xefcb('0x39')]=_[_0xefcb('0x3a')](_0x5af275['query']);_0x2c1e9c[_0xefcb('0x3b')]=_['intersection'](_0x2c1e9c[_0xefcb('0x38')],_0x2c1e9c[_0xefcb('0x39')]);_0x2b2a17[_0xefcb('0x3e')]=_[_0xefcb('0x3c')](_0x2c1e9c[_0xefcb('0x38')],qs[_0xefcb('0x3d')](_0x5af275[_0xefcb('0x39')][_0xefcb('0x3d')]));_0x2b2a17['attributes']=_0x2b2a17['attributes'][_0xefcb('0x4e')]?_0x2b2a17[_0xefcb('0x3e')]:_0x2c1e9c[_0xefcb('0x38')];_0x2b2a17[_0xefcb('0x41')]=qs[_0xefcb('0x42')](_0x5af275['query'][_0xefcb('0x42')]);_0x2b2a17[_0xefcb('0x45')]=qs[_0xefcb('0x3b')](_[_0xefcb('0x43')](_0x5af275[_0xefcb('0x39')],_0x2c1e9c['filters']));if(_0x5af275['query'][_0xefcb('0x44')]){_0x2b2a17[_0xefcb('0x45')]=_[_0xefcb('0x46')](_0x2b2a17[_0xefcb('0x45')],{'$or':_[_0xefcb('0x33')](_0x2b2a17['attributes'],function(_0x31f75a){var _0x2bdbf3={};_0x2bdbf3[_0x31f75a]={'$like':'%'+_0x5af275['query'][_0xefcb('0x44')]+'%'};return _0x2bdbf3;})});}_0x2b2a17=_[_0xefcb('0x46')]({},_0x2b2a17,_0x5af275['options']);return _0x2ce051[_0xefcb('0x59')](_0x2b2a17);}})['then'](function(_0x17ac13){if(_0x17ac13){_0x4571b4=_0x17ac13[_0xefcb('0x4e')];if(!_0x5af275['query'][_0xefcb('0x56')]('nolimit')){_0x2b2a17[_0xefcb('0x40')]=qs[_0xefcb('0x40')](_0x5af275[_0xefcb('0x39')][_0xefcb('0x40')]);_0x2b2a17[_0xefcb('0x29')]=qs[_0xefcb('0x29')](_0x5af275['query'][_0xefcb('0x29')]);}return _0x2ce051[_0xefcb('0x59')](_0x2b2a17);}})['then'](function(_0xd20b59){if(_0xd20b59){return _0xd20b59?{'count':_0x4571b4,'rows':_0xd20b59}:null;}})[_0xefcb('0x1a')](respondWithResult(_0x81d8a5,null))[_0xefcb('0x4b')](handleError(_0x81d8a5,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index a2078f7..4da6e5c 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 _0xf39b=['../../config/environment','exports','define','int_freshsales_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x4a9984,_0x1abcab){var _0x269703=function(_0x4ed4ca){while(--_0x4ed4ca){_0x4a9984['push'](_0x4a9984['shift']());}};_0x269703(++_0x1abcab);}(_0xf39b,0x100));var _0xbf39=function(_0x2b53e5,_0x2feac7){_0x2b53e5=_0x2b53e5-0x0;var _0x3db514=_0xf39b[_0x2b53e5];return _0x3db514;};'use strict';var _=require(_0xbf39('0x0'));var util=require(_0xbf39('0x1'));var logger=require(_0xbf39('0x2'))('api');var moment=require(_0xbf39('0x3'));var BPromise=require(_0xbf39('0x4'));var rp=require(_0xbf39('0x5'));var fs=require('fs');var path=require(_0xbf39('0x6'));var rimraf=require(_0xbf39('0x7'));var config=require(_0xbf39('0x8'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xbf39('0x9')]=function(_0x551bac,_0x5a1672){return _0x551bac[_0xbf39('0xa')]('FreshsalesConfiguration',attributes,{'tableName':_0xbf39('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d9f=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','int_freshsales_configurations','lodash','util'];(function(_0xe4d6c6,_0x3bdbf2){var _0x3a8935=function(_0x131483){while(--_0x131483){_0xe4d6c6['push'](_0xe4d6c6['shift']());}};_0x3a8935(++_0x3bdbf2);}(_0x0d9f,0x136));var _0xf0d9=function(_0x5519a9,_0x1c5147){_0x5519a9=_0x5519a9-0x0;var _0x32f2cc=_0x0d9f[_0x5519a9];return _0x32f2cc;};'use strict';var _=require(_0xf0d9('0x0'));var util=require(_0xf0d9('0x1'));var logger=require(_0xf0d9('0x2'))('api');var moment=require(_0xf0d9('0x3'));var BPromise=require(_0xf0d9('0x4'));var rp=require(_0xf0d9('0x5'));var fs=require('fs');var path=require(_0xf0d9('0x6'));var rimraf=require(_0xf0d9('0x7'));var config=require(_0xf0d9('0x8'));var attributes=require(_0xf0d9('0x9'));module[_0xf0d9('0xa')]=function(_0x33331d,_0x36a132){return _0x33331d[_0xf0d9('0xb')]('FreshsalesConfiguration',attributes,{'tableName':_0xf0d9('0xc'),'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 fe16b63..b57c33a 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 _0x983c=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x4ca7b6,_0x12cce1){var _0x3db920=function(_0x50d777){while(--_0x50d777){_0x4ca7b6['push'](_0x4ca7b6['shift']());}};_0x3db920(++_0x12cce1);}(_0x983c,0xf3));var _0xc983=function(_0x5a5f1d,_0x3359d8){_0x5a5f1d=_0x5a5f1d-0x0;var _0x597cf4=_0x983c[_0x5a5f1d];return _0x597cf4;};'use strict';var _=require(_0xc983('0x0'));var util=require(_0xc983('0x1'));var moment=require(_0xc983('0x2'));var BPromise=require(_0xc983('0x3'));var rs=require(_0xc983('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc983('0x5'))['db'];var utils=require(_0xc983('0x6'));var logger=require(_0xc983('0x7'))(_0xc983('0x8'));var config=require(_0xc983('0x9'));var jayson=require(_0xc983('0xa'));var client=jayson[_0xc983('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x346933,_0x363403,_0x141900){return new BPromise(function(_0x11cd44,_0x52025a){return client['request'](_0x346933,_0x141900)['then'](function(_0x5ad672){logger[_0xc983('0xc')](_0xc983('0xd'),_0x363403,_0xc983('0xe'));logger[_0xc983('0xf')](_0xc983('0x10'),_0x363403,_0xc983('0xe'),JSON[_0xc983('0x11')](_0x5ad672));if(_0x5ad672[_0xc983('0x12')]){if(_0x5ad672[_0xc983('0x12')]['code']===0x1f4){logger[_0xc983('0x12')](_0xc983('0xd'),_0x363403,_0x5ad672[_0xc983('0x12')][_0xc983('0x13')]);return _0x52025a(_0x5ad672[_0xc983('0x12')][_0xc983('0x13')]);}logger['error'](_0xc983('0xd'),_0x363403,_0x5ad672[_0xc983('0x12')][_0xc983('0x13')]);return _0x11cd44(_0x5ad672[_0xc983('0x12')][_0xc983('0x13')]);}else{logger[_0xc983('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x363403,_0xc983('0xe'));_0x11cd44(_0x5ad672[_0xc983('0x14')][_0xc983('0x13')]);}})[_0xc983('0x15')](function(_0x2f5dad){logger[_0xc983('0x12')](_0xc983('0xd'),_0x363403,_0x2f5dad);_0x52025a(_0x2f5dad);});});} \ No newline at end of file +var _0xcd60=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch'];(function(_0x2730ad,_0x4d247d){var _0x1d4363=function(_0x17c180){while(--_0x17c180){_0x2730ad['push'](_0x2730ad['shift']());}};_0x1d4363(++_0x4d247d);}(_0xcd60,0xf0));var _0x0cd6=function(_0x22ad33,_0x58f2d3){_0x22ad33=_0x22ad33-0x0;var _0x424b9c=_0xcd60[_0x22ad33];return _0x424b9c;};'use strict';var _=require(_0x0cd6('0x0'));var util=require(_0x0cd6('0x1'));var moment=require(_0x0cd6('0x2'));var BPromise=require(_0x0cd6('0x3'));var rs=require(_0x0cd6('0x4'));var fs=require('fs');var Redis=require(_0x0cd6('0x5'));var db=require(_0x0cd6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0cd6('0x7'))(_0x0cd6('0x8'));var config=require(_0x0cd6('0x9'));var jayson=require(_0x0cd6('0xa'));var client=jayson[_0x0cd6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ceb47,_0x460833,_0x47c8b2){return new BPromise(function(_0x4714bf,_0x4fb298){return client[_0x0cd6('0xc')](_0x2ceb47,_0x47c8b2)[_0x0cd6('0xd')](function(_0x14f396){logger[_0x0cd6('0xe')](_0x0cd6('0xf'),_0x460833,'request\x20sent');logger[_0x0cd6('0x10')](_0x0cd6('0x11'),_0x460833,_0x0cd6('0x12'),JSON[_0x0cd6('0x13')](_0x14f396));if(_0x14f396[_0x0cd6('0x14')]){if(_0x14f396['error']['code']===0x1f4){logger[_0x0cd6('0x14')](_0x0cd6('0xf'),_0x460833,_0x14f396[_0x0cd6('0x14')]['message']);return _0x4fb298(_0x14f396[_0x0cd6('0x14')]['message']);}logger[_0x0cd6('0x14')](_0x0cd6('0xf'),_0x460833,_0x14f396[_0x0cd6('0x14')][_0x0cd6('0x15')]);return _0x4714bf(_0x14f396[_0x0cd6('0x14')][_0x0cd6('0x15')]);}else{logger[_0x0cd6('0xe')](_0x0cd6('0xf'),_0x460833,_0x0cd6('0x12'));_0x4714bf(_0x14f396[_0x0cd6('0x16')][_0x0cd6('0x15')]);}})[_0x0cd6('0x17')](function(_0x30d35c){logger[_0x0cd6('0x14')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x460833,_0x30d35c);_0x4fb298(_0x30d35c);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 9fc47d6..5b25df8 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 _0x8906=['put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','show','post'];(function(_0x3c482a,_0x1f8706){var _0x2ad415=function(_0x44befa){while(--_0x44befa){_0x3c482a['push'](_0x3c482a['shift']());}};_0x2ad415(++_0x1f8706);}(_0x8906,0x64));var _0x6890=function(_0x77acb8,_0x443bec){_0x77acb8=_0x77acb8-0x0;var _0x544a2f=_0x8906[_0x77acb8];return _0x544a2f;};'use strict';var multer=require(_0x6890('0x0'));var util=require('util');var path=require(_0x6890('0x1'));var timeout=require(_0x6890('0x2'));var express=require(_0x6890('0x3'));var router=express[_0x6890('0x4')]();var auth=require(_0x6890('0x5'));var interaction=require(_0x6890('0x6'));var config=require(_0x6890('0x7'));var controller=require(_0x6890('0x8'));router[_0x6890('0x9')]('/',auth[_0x6890('0xa')](),controller[_0x6890('0xb')]);router[_0x6890('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6890('0xc')]);router[_0x6890('0xd')]('/',auth[_0x6890('0xa')](),controller['create']);router[_0x6890('0xe')](_0x6890('0xf'),auth[_0x6890('0xa')](),controller[_0x6890('0x10')]);router[_0x6890('0x11')]('/:id',auth[_0x6890('0xa')](),controller['destroy']);module[_0x6890('0x12')]=router; \ No newline at end of file +var _0xe6b5=['update','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','index','/:id','isAuthenticated','post','create','put'];(function(_0x2ff47e,_0xaee413){var _0x31bd1f=function(_0x44408e){while(--_0x44408e){_0x2ff47e['push'](_0x2ff47e['shift']());}};_0x31bd1f(++_0xaee413);}(_0xe6b5,0x16a));var _0x5e6b=function(_0x1ac5e1,_0x43a483){_0x1ac5e1=_0x1ac5e1-0x0;var _0x3ae80e=_0xe6b5[_0x1ac5e1];return _0x3ae80e;};'use strict';var multer=require('multer');var util=require(_0x5e6b('0x0'));var path=require(_0x5e6b('0x1'));var timeout=require(_0x5e6b('0x2'));var express=require(_0x5e6b('0x3'));var router=express[_0x5e6b('0x4')]();var auth=require(_0x5e6b('0x5'));var interaction=require(_0x5e6b('0x6'));var config=require(_0x5e6b('0x7'));var controller=require(_0x5e6b('0x8'));router[_0x5e6b('0x9')]('/',auth['isAuthenticated'](),controller[_0x5e6b('0xa')]);router[_0x5e6b('0x9')](_0x5e6b('0xb'),auth[_0x5e6b('0xc')](),controller['show']);router[_0x5e6b('0xd')]('/',auth[_0x5e6b('0xc')](),controller[_0x5e6b('0xe')]);router[_0x5e6b('0xf')](_0x5e6b('0xb'),auth[_0x5e6b('0xc')](),controller[_0x5e6b('0x10')]);router[_0x5e6b('0x11')](_0x5e6b('0xb'),auth['isAuthenticated'](),controller['destroy']);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 bffe4e5..07ed2ac 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 _0xfb99=['STRING','ENUM','variable','customVariable','string'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xfb99,0x1e1));var _0x9fb9=function(_0x1bfc60,_0x50aff7){_0x1bfc60=_0x1bfc60-0x0;var _0x2046ae=_0xfb99[_0x1bfc60];return _0x2046ae;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x9fb9('0x0')]('string',_0x9fb9('0x1'),_0x9fb9('0x2'),'keyValue'),'defaultValue':_0x9fb9('0x3')},'content':{'type':Sequelize[_0x9fb9('0x4')]},'key':{'type':Sequelize[_0x9fb9('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0x9fb9('0x3'),_0x9fb9('0x1'),_0x9fb9('0x2'))},'keyContent':{'type':Sequelize[_0x9fb9('0x4')]},'idField':{'type':Sequelize[_0x9fb9('0x4')]},'nameField':{'type':Sequelize[_0x9fb9('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9fb9('0x4')]}}; \ No newline at end of file +var _0x914c=['variable','customVariable','keyValue','ENUM','STRING','BOOLEAN','sequelize','exports','string'];(function(_0x1a9891,_0x33bc30){var _0x11f7f0=function(_0xe1782c){while(--_0xe1782c){_0x1a9891['push'](_0x1a9891['shift']());}};_0x11f7f0(++_0x33bc30);}(_0x914c,0x102));var _0xc914=function(_0x322522,_0x4db288){_0x322522=_0x322522-0x0;var _0x293bcf=_0x914c[_0x322522];return _0x293bcf;};'use strict';var Sequelize=require(_0xc914('0x0'));module[_0xc914('0x1')]={'type':{'type':Sequelize['ENUM'](_0xc914('0x2'),_0xc914('0x3'),_0xc914('0x4'),_0xc914('0x5')),'defaultValue':_0xc914('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc914('0x6')](_0xc914('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xc914('0x7')]},'idField':{'type':Sequelize[_0xc914('0x7')]},'nameField':{'type':Sequelize[_0xc914('0x7')]},'customField':{'type':Sequelize[_0xc914('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc914('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 1b52b35..4d052f5 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 _0xac4a=['set','apply','reject','save','update','destroy','then','sendStatus','error','send','index','map','FreshsalesField','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','keys','rawAttributes','find','create','params','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','count','offset','limit'];(function(_0xa1397e,_0x12d423){var _0x1ee271=function(_0x193864){while(--_0x193864){_0xa1397e['push'](_0xa1397e['shift']());}};_0x1ee271(++_0x12d423);}(_0xac4a,0x13f));var _0xaac4=function(_0x34b948,_0x39c51a){_0x34b948=_0x34b948-0x0;var _0x4fe19d=_0xac4a[_0x34b948];return _0x4fe19d;};'use strict';var pdf=require(_0xaac4('0x0'));var emlformat=require(_0xaac4('0x1'));var rimraf=require(_0xaac4('0x2'));var zipdir=require(_0xaac4('0x3'));var jsonpatch=require(_0xaac4('0x4'));var rp=require(_0xaac4('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaac4('0x6'));var util=require(_0xaac4('0x7'));var path=require(_0xaac4('0x8'));var sox=require('sox');var csv=require(_0xaac4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2348c2,_0x2e2d02){_0x2e2d02=_0x2e2d02||0xcc;return function(_0x45e512){if(_0x45e512){return _0x2348c2['sendStatus'](_0x2e2d02);}return _0x2348c2[_0xaac4('0x14')](_0x2e2d02)[_0xaac4('0x15')]();};}function respondWithResult(_0x5bcacd,_0xf06b1d){_0xf06b1d=_0xf06b1d||0xc8;return function(_0x2b20d0){if(_0x2b20d0){return _0x5bcacd[_0xaac4('0x14')](_0xf06b1d)[_0xaac4('0x16')](_0x2b20d0);}};}function respondWithFilteredResult(_0x187624,_0x2fbeb7){return function(_0x31b7e5){if(_0x31b7e5){var _0x1df9ae=_0x31b7e5[_0xaac4('0x17')],_0x233278=_0x2fbeb7[_0xaac4('0x18')],_0xb8466e=_0x2fbeb7['offset']+_0x2fbeb7[_0xaac4('0x19')],_0x35bc32;if(_0xb8466e>=_0x1df9ae){_0xb8466e=_0x1df9ae;_0x35bc32=0xc8;}else{_0x35bc32=0xce;}_0x187624['status'](_0x35bc32);return _0x187624[_0xaac4('0x1a')]('Content-Range',_0x233278+'-'+_0xb8466e+'/'+_0x1df9ae)[_0xaac4('0x16')](_0x31b7e5);}return null;};}function patchUpdates(_0x27fe7b){return function(_0xa22b76){try{jsonpatch[_0xaac4('0x1b')](_0xa22b76,_0x27fe7b,!![]);}catch(_0x3cbcb1){return BPromise[_0xaac4('0x1c')](_0x3cbcb1);}return _0xa22b76[_0xaac4('0x1d')]();};}function saveUpdates(_0x25b946,_0x4166ee){return function(_0x480fb0){if(_0x480fb0){return _0x480fb0[_0xaac4('0x1e')](_0x25b946)['then'](function(_0x3303f1){return _0x3303f1;});}return null;};}function removeEntity(_0x2013b7,_0x43625c){return function(_0x477b77){if(_0x477b77){return _0x477b77[_0xaac4('0x1f')]()[_0xaac4('0x20')](function(){_0x2013b7['status'](0xcc)[_0xaac4('0x15')]();});}};}function handleEntityNotFound(_0x27a84d,_0x174860){return function(_0x4f10ec){if(!_0x4f10ec){_0x27a84d[_0xaac4('0x21')](0x194);}return _0x4f10ec;};}function handleError(_0x2dcc59,_0xb2577b){_0xb2577b=_0xb2577b||0x1f4;return function(_0x577b3d){logger[_0xaac4('0x22')](_0x577b3d['stack']);if(_0x577b3d['name']){delete _0x577b3d['name'];}_0x2dcc59['status'](_0xb2577b)[_0xaac4('0x23')](_0x577b3d);};}exports[_0xaac4('0x24')]=function(_0x22cda2,_0xe93120){var _0x3c1445={},_0x249a5d={},_0x43b122={'count':0x0,'rows':[]};var _0x2d68b6=_[_0xaac4('0x25')](db[_0xaac4('0x26')]['rawAttributes'],function(_0x316445){return{'name':_0x316445[_0xaac4('0x27')],'type':_0x316445[_0xaac4('0x28')][_0xaac4('0x29')]};});_0x249a5d[_0xaac4('0x2a')]=_[_0xaac4('0x25')](_0x2d68b6,'name');_0x249a5d[_0xaac4('0x2b')]=_['keys'](_0x22cda2[_0xaac4('0x2b')]);_0x249a5d[_0xaac4('0x2c')]=_[_0xaac4('0x2d')](_0x249a5d[_0xaac4('0x2a')],_0x249a5d['query']);_0x3c1445['attributes']=_['intersection'](_0x249a5d[_0xaac4('0x2a')],qs[_0xaac4('0x2e')](_0x22cda2[_0xaac4('0x2b')][_0xaac4('0x2e')]));_0x3c1445[_0xaac4('0x2f')]=_0x3c1445[_0xaac4('0x2f')][_0xaac4('0x30')]?_0x3c1445[_0xaac4('0x2f')]:_0x249a5d[_0xaac4('0x2a')];if(!_0x22cda2[_0xaac4('0x2b')][_0xaac4('0x31')](_0xaac4('0x32'))){_0x3c1445[_0xaac4('0x19')]=qs[_0xaac4('0x19')](_0x22cda2[_0xaac4('0x2b')]['limit']);_0x3c1445['offset']=qs[_0xaac4('0x18')](_0x22cda2[_0xaac4('0x2b')][_0xaac4('0x18')]);}_0x3c1445['order']=qs[_0xaac4('0x33')](_0x22cda2[_0xaac4('0x2b')][_0xaac4('0x33')]);_0x3c1445[_0xaac4('0x34')]=qs[_0xaac4('0x2c')](_[_0xaac4('0x35')](_0x22cda2[_0xaac4('0x2b')],_0x249a5d['filters']));if(_0x22cda2[_0xaac4('0x2b')][_0xaac4('0x36')]){_0x3c1445[_0xaac4('0x34')]=_['merge'](_0x3c1445[_0xaac4('0x34')],{'$or':_['map'](_0x2d68b6,function(_0x577b5b){if(_0x577b5b[_0xaac4('0x28')]!==_0xaac4('0x37')){var _0x2da28a={};_0x2da28a[_0x577b5b['name']]={'$like':'%'+_0x22cda2['query'][_0xaac4('0x36')]+'%'};return _0x2da28a;}})});}_0x3c1445=_[_0xaac4('0x38')]({},_0x3c1445,_0x22cda2[_0xaac4('0x39')]);var _0x268295={'where':_0x3c1445[_0xaac4('0x34')]};return db[_0xaac4('0x26')]['count'](_0x268295)['then'](function(_0x220bdc){_0x43b122[_0xaac4('0x17')]=_0x220bdc;if(_0x22cda2['query'][_0xaac4('0x3a')]){_0x3c1445[_0xaac4('0x3b')]=[{'all':!![]}];}return db[_0xaac4('0x26')]['findAll'](_0x3c1445);})[_0xaac4('0x20')](function(_0x4a4773){_0x43b122[_0xaac4('0x3c')]=_0x4a4773;return _0x43b122;})['then'](respondWithFilteredResult(_0xe93120,_0x3c1445))[_0xaac4('0x3d')](handleError(_0xe93120,null));};exports[_0xaac4('0x3e')]=function(_0x3dcade,_0x33bf83){var _0x51e59d={'raw':!![],'where':{'id':_0x3dcade['params']['id']}},_0x247fea={};_0x247fea['model']=_[_0xaac4('0x3f')](db[_0xaac4('0x26')][_0xaac4('0x40')]);_0x247fea[_0xaac4('0x2b')]=_[_0xaac4('0x3f')](_0x3dcade[_0xaac4('0x2b')]);_0x247fea[_0xaac4('0x2c')]=_[_0xaac4('0x2d')](_0x247fea['model'],_0x247fea[_0xaac4('0x2b')]);_0x51e59d[_0xaac4('0x2f')]=_[_0xaac4('0x2d')](_0x247fea[_0xaac4('0x2a')],qs['fields'](_0x3dcade[_0xaac4('0x2b')][_0xaac4('0x2e')]));_0x51e59d[_0xaac4('0x2f')]=_0x51e59d['attributes'][_0xaac4('0x30')]?_0x51e59d[_0xaac4('0x2f')]:_0x247fea[_0xaac4('0x2a')];if(_0x3dcade[_0xaac4('0x2b')]['includeAll']){_0x51e59d[_0xaac4('0x3b')]=[{'all':!![]}];}_0x51e59d=_[_0xaac4('0x38')]({},_0x51e59d,_0x3dcade[_0xaac4('0x39')]);return db['FreshsalesField'][_0xaac4('0x41')](_0x51e59d)[_0xaac4('0x20')](handleEntityNotFound(_0x33bf83,null))[_0xaac4('0x20')](respondWithResult(_0x33bf83,null))[_0xaac4('0x3d')](handleError(_0x33bf83,null));};exports[_0xaac4('0x42')]=function(_0x1ad713,_0x25e1b1){return db[_0xaac4('0x26')][_0xaac4('0x42')](_0x1ad713['body'],{})[_0xaac4('0x20')](respondWithResult(_0x25e1b1,0xc9))[_0xaac4('0x3d')](handleError(_0x25e1b1,null));};exports[_0xaac4('0x1e')]=function(_0x360420,_0x130bb5){if(_0x360420['body']['id']){delete _0x360420['body']['id'];}return db[_0xaac4('0x26')][_0xaac4('0x41')]({'where':{'id':_0x360420[_0xaac4('0x43')]['id']}})[_0xaac4('0x20')](handleEntityNotFound(_0x130bb5,null))['then'](saveUpdates(_0x360420[_0xaac4('0x44')],null))['then'](respondWithResult(_0x130bb5,null))[_0xaac4('0x3d')](handleError(_0x130bb5,null));};exports[_0xaac4('0x1f')]=function(_0x487203,_0x282de3){return db[_0xaac4('0x26')][_0xaac4('0x41')]({'where':{'id':_0x487203['params']['id']}})['then'](handleEntityNotFound(_0x282de3,null))[_0xaac4('0x20')](removeEntity(_0x282de3,null))[_0xaac4('0x3d')](handleError(_0x282de3,null));}; \ No newline at end of file +var _0x85b5=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit','Content-Range','reject','save','destroy','error','stack','name','send','index','map','FreshsalesField','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','options','count','then','includeAll','include','findAll','rows','show','params','find','catch','create','update','html-pdf','eml-format','zip-dir','request-promise','mustache','path','sox','to-csv','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x85b5,0x7f));var _0x585b=function(_0x3f1487,_0x451629){_0x3f1487=_0x3f1487-0x0;var _0x4d61d4=_0x85b5[_0x3f1487];return _0x4d61d4;};'use strict';var pdf=require(_0x585b('0x0'));var emlformat=require(_0x585b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x585b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x585b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x585b('0x4'));var util=require('util');var path=require(_0x585b('0x5'));var sox=require(_0x585b('0x6'));var csv=require(_0x585b('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x585b('0x8'));var squel=require('squel');var crypto=require(_0x585b('0x9'));var jsforce=require(_0x585b('0xa'));var deskjs=require(_0x585b('0xb'));var toCsv=require(_0x585b('0x7'));var querystring=require('querystring');var Papa=require(_0x585b('0xc'));var Redis=require(_0x585b('0xd'));var authService=require(_0x585b('0xe'));var qs=require(_0x585b('0xf'));var as=require(_0x585b('0x10'));var hardwareService=require(_0x585b('0x11'));var logger=require(_0x585b('0x12'))('api');var utils=require(_0x585b('0x13'));var config=require('../../config/environment');var db=require(_0x585b('0x14'))['db'];function respondWithStatusCode(_0x479304,_0x16d608){_0x16d608=_0x16d608||0xcc;return function(_0x35bda0){if(_0x35bda0){return _0x479304[_0x585b('0x15')](_0x16d608);}return _0x479304['status'](_0x16d608)[_0x585b('0x16')]();};}function respondWithResult(_0x8f10b4,_0x3d15ed){_0x3d15ed=_0x3d15ed||0xc8;return function(_0x299ee4){if(_0x299ee4){return _0x8f10b4[_0x585b('0x17')](_0x3d15ed)[_0x585b('0x18')](_0x299ee4);}};}function respondWithFilteredResult(_0x394361,_0x5ebc1a){return function(_0x2f827f){if(_0x2f827f){var _0x41f50d=_0x2f827f['count'],_0x4c094e=_0x5ebc1a['offset'],_0x4e2a41=_0x5ebc1a[_0x585b('0x19')]+_0x5ebc1a[_0x585b('0x1a')],_0xd53614;if(_0x4e2a41>=_0x41f50d){_0x4e2a41=_0x41f50d;_0xd53614=0xc8;}else{_0xd53614=0xce;}_0x394361[_0x585b('0x17')](_0xd53614);return _0x394361['set'](_0x585b('0x1b'),_0x4c094e+'-'+_0x4e2a41+'/'+_0x41f50d)[_0x585b('0x18')](_0x2f827f);}return null;};}function patchUpdates(_0x326a4e){return function(_0x31f5c2){try{jsonpatch['apply'](_0x31f5c2,_0x326a4e,!![]);}catch(_0xec725d){return BPromise[_0x585b('0x1c')](_0xec725d);}return _0x31f5c2[_0x585b('0x1d')]();};}function saveUpdates(_0x5dd006,_0x5200ec){return function(_0x6bea29){if(_0x6bea29){return _0x6bea29['update'](_0x5dd006)['then'](function(_0x29e033){return _0x29e033;});}return null;};}function removeEntity(_0xb8b33a,_0x48d9f8){return function(_0x183308){if(_0x183308){return _0x183308[_0x585b('0x1e')]()['then'](function(){_0xb8b33a[_0x585b('0x17')](0xcc)[_0x585b('0x16')]();});}};}function handleEntityNotFound(_0x2122e0,_0x5bf9e4){return function(_0x1c8a7b){if(!_0x1c8a7b){_0x2122e0['sendStatus'](0x194);}return _0x1c8a7b;};}function handleError(_0x3c861c,_0x10dd42){_0x10dd42=_0x10dd42||0x1f4;return function(_0x1a3935){logger[_0x585b('0x1f')](_0x1a3935[_0x585b('0x20')]);if(_0x1a3935[_0x585b('0x21')]){delete _0x1a3935[_0x585b('0x21')];}_0x3c861c[_0x585b('0x17')](_0x10dd42)[_0x585b('0x22')](_0x1a3935);};}exports[_0x585b('0x23')]=function(_0x7d8984,_0x35075c){var _0x11dc56={},_0x476ed9={},_0x183e75={'count':0x0,'rows':[]};var _0x554099=_[_0x585b('0x24')](db[_0x585b('0x25')][_0x585b('0x26')],function(_0x2cf48a){return{'name':_0x2cf48a['fieldName'],'type':_0x2cf48a['type'][_0x585b('0x27')]};});_0x476ed9[_0x585b('0x28')]=_['map'](_0x554099,_0x585b('0x21'));_0x476ed9[_0x585b('0x29')]=_['keys'](_0x7d8984[_0x585b('0x29')]);_0x476ed9[_0x585b('0x2a')]=_[_0x585b('0x2b')](_0x476ed9[_0x585b('0x28')],_0x476ed9[_0x585b('0x29')]);_0x11dc56[_0x585b('0x2c')]=_[_0x585b('0x2b')](_0x476ed9[_0x585b('0x28')],qs[_0x585b('0x2d')](_0x7d8984[_0x585b('0x29')]['fields']));_0x11dc56[_0x585b('0x2c')]=_0x11dc56[_0x585b('0x2c')][_0x585b('0x2e')]?_0x11dc56['attributes']:_0x476ed9[_0x585b('0x28')];if(!_0x7d8984[_0x585b('0x29')][_0x585b('0x2f')]('nolimit')){_0x11dc56[_0x585b('0x1a')]=qs[_0x585b('0x1a')](_0x7d8984[_0x585b('0x29')][_0x585b('0x1a')]);_0x11dc56['offset']=qs['offset'](_0x7d8984[_0x585b('0x29')][_0x585b('0x19')]);}_0x11dc56[_0x585b('0x30')]=qs[_0x585b('0x31')](_0x7d8984[_0x585b('0x29')]['sort']);_0x11dc56[_0x585b('0x32')]=qs[_0x585b('0x2a')](_[_0x585b('0x33')](_0x7d8984[_0x585b('0x29')],_0x476ed9[_0x585b('0x2a')]));if(_0x7d8984['query']['filter']){_0x11dc56['where']=_[_0x585b('0x34')](_0x11dc56[_0x585b('0x32')],{'$or':_[_0x585b('0x24')](_0x554099,function(_0x8ecc5f){if(_0x8ecc5f[_0x585b('0x35')]!==_0x585b('0x36')){var _0x1ce2f5={};_0x1ce2f5[_0x8ecc5f[_0x585b('0x21')]]={'$like':'%'+_0x7d8984[_0x585b('0x29')]['filter']+'%'};return _0x1ce2f5;}})});}_0x11dc56=_[_0x585b('0x34')]({},_0x11dc56,_0x7d8984[_0x585b('0x37')]);var _0x4ee74f={'where':_0x11dc56[_0x585b('0x32')]};return db[_0x585b('0x25')][_0x585b('0x38')](_0x4ee74f)[_0x585b('0x39')](function(_0xc82017){_0x183e75[_0x585b('0x38')]=_0xc82017;if(_0x7d8984['query'][_0x585b('0x3a')]){_0x11dc56[_0x585b('0x3b')]=[{'all':!![]}];}return db[_0x585b('0x25')][_0x585b('0x3c')](_0x11dc56);})[_0x585b('0x39')](function(_0x409e4c){_0x183e75[_0x585b('0x3d')]=_0x409e4c;return _0x183e75;})[_0x585b('0x39')](respondWithFilteredResult(_0x35075c,_0x11dc56))['catch'](handleError(_0x35075c,null));};exports[_0x585b('0x3e')]=function(_0x46d003,_0x3bf2b4){var _0x4c5a14={'raw':!![],'where':{'id':_0x46d003[_0x585b('0x3f')]['id']}},_0x402334={};_0x402334[_0x585b('0x28')]=_['keys'](db[_0x585b('0x25')][_0x585b('0x26')]);_0x402334['query']=_['keys'](_0x46d003[_0x585b('0x29')]);_0x402334['filters']=_[_0x585b('0x2b')](_0x402334['model'],_0x402334[_0x585b('0x29')]);_0x4c5a14[_0x585b('0x2c')]=_['intersection'](_0x402334[_0x585b('0x28')],qs['fields'](_0x46d003['query']['fields']));_0x4c5a14[_0x585b('0x2c')]=_0x4c5a14['attributes'][_0x585b('0x2e')]?_0x4c5a14[_0x585b('0x2c')]:_0x402334['model'];if(_0x46d003[_0x585b('0x29')][_0x585b('0x3a')]){_0x4c5a14[_0x585b('0x3b')]=[{'all':!![]}];}_0x4c5a14=_['merge']({},_0x4c5a14,_0x46d003['options']);return db['FreshsalesField'][_0x585b('0x40')](_0x4c5a14)[_0x585b('0x39')](handleEntityNotFound(_0x3bf2b4,null))[_0x585b('0x39')](respondWithResult(_0x3bf2b4,null))[_0x585b('0x41')](handleError(_0x3bf2b4,null));};exports['create']=function(_0x21eba3,_0xf9c56d){return db[_0x585b('0x25')][_0x585b('0x42')](_0x21eba3['body'],{})[_0x585b('0x39')](respondWithResult(_0xf9c56d,0xc9))[_0x585b('0x41')](handleError(_0xf9c56d,null));};exports[_0x585b('0x43')]=function(_0x5bf8b4,_0x8f4fe3){if(_0x5bf8b4['body']['id']){delete _0x5bf8b4['body']['id'];}return db['FreshsalesField'][_0x585b('0x40')]({'where':{'id':_0x5bf8b4['params']['id']}})[_0x585b('0x39')](handleEntityNotFound(_0x8f4fe3,null))['then'](saveUpdates(_0x5bf8b4['body'],null))['then'](respondWithResult(_0x8f4fe3,null))[_0x585b('0x41')](handleError(_0x8f4fe3,null));};exports[_0x585b('0x1e')]=function(_0x47c349,_0x5116a8){return db[_0x585b('0x25')][_0x585b('0x40')]({'where':{'id':_0x47c349[_0x585b('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5116a8,null))[_0x585b('0x39')](removeEntity(_0x5116a8,null))['catch'](handleError(_0x5116a8,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 371c01a..ed69556 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 _0xc3c3=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','FieldId','lodash','util','../../config/logger'];(function(_0x4f4c2a,_0x5f5a28){var _0xd15be6=function(_0x1bc725){while(--_0x1bc725){_0x4f4c2a['push'](_0x4f4c2a['shift']());}};_0xd15be6(++_0x5f5a28);}(_0xc3c3,0x6d));var _0x3c3c=function(_0x24b278,_0x394db0){_0x24b278=_0x24b278-0x0;var _0x1e2646=_0xc3c3[_0x24b278];return _0x1e2646;};'use strict';var _=require(_0x3c3c('0x0'));var util=require(_0x3c3c('0x1'));var logger=require(_0x3c3c('0x2'))(_0x3c3c('0x3'));var moment=require(_0x3c3c('0x4'));var BPromise=require(_0x3c3c('0x5'));var rp=require(_0x3c3c('0x6'));var fs=require('fs');var path=require(_0x3c3c('0x7'));var rimraf=require(_0x3c3c('0x8'));var config=require(_0x3c3c('0x9'));var attributes=require('./intFreshsalesField.attributes');module[_0x3c3c('0xa')]=function(_0x4debba,_0x3013e7){return _0x4debba[_0x3c3c('0xb')](_0x3c3c('0xc'),attributes,{'tableName':_0x3c3c('0xd'),'paranoid':![],'indexes':[{'name':_0x3c3c('0xe'),'fields':['idField',_0x3c3c('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbd11=['FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./intFreshsalesField.attributes','exports','define'];(function(_0x5c0f80,_0x1cf0e9){var _0x3261e0=function(_0x22d40c){while(--_0x22d40c){_0x5c0f80['push'](_0x5c0f80['shift']());}};_0x3261e0(++_0x1cf0e9);}(_0xbd11,0xc5));var _0x1bd1=function(_0x186861,_0x2311c7){_0x186861=_0x186861-0x0;var _0x5be31f=_0xbd11[_0x186861];return _0x5be31f;};'use strict';var _=require(_0x1bd1('0x0'));var util=require(_0x1bd1('0x1'));var logger=require(_0x1bd1('0x2'))(_0x1bd1('0x3'));var moment=require(_0x1bd1('0x4'));var BPromise=require(_0x1bd1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1bd1('0x6'));var rimraf=require('rimraf');var config=require(_0x1bd1('0x7'));var attributes=require(_0x1bd1('0x8'));module[_0x1bd1('0x9')]=function(_0x5196d8,_0xedce0d){return _0x5196d8[_0x1bd1('0xa')](_0x1bd1('0xb'),attributes,{'tableName':_0x1bd1('0xc'),'paranoid':![],'indexes':[{'name':_0x1bd1('0xd'),'fields':[_0x1bd1('0xe'),_0x1bd1('0xf')],'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 25758ca..f0c5664 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 _0x62cc=['request\x20sent','stringify','error','FreshsalesField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','FreshsalesField,\x20%s,\x20%s,\x20%s'];(function(_0x3bba16,_0xb50821){var _0x3da1b7=function(_0x3eecdb){while(--_0x3eecdb){_0x3bba16['push'](_0x3bba16['shift']());}};_0x3da1b7(++_0xb50821);}(_0x62cc,0x9f));var _0xc62c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x62cc[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc62c('0x0'));var util=require(_0xc62c('0x1'));var moment=require(_0xc62c('0x2'));var BPromise=require('bluebird');var rs=require(_0xc62c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc62c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc62c('0x5'))(_0xc62c('0x6'));var config=require(_0xc62c('0x7'));var jayson=require(_0xc62c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1a09be,_0x24c5ff,_0x5d3306){return new BPromise(function(_0x5c1d3a,_0x8784bb){return client[_0xc62c('0x9')](_0x1a09be,_0x5d3306)['then'](function(_0x483b87){logger[_0xc62c('0xa')]('FreshsalesField,\x20%s,\x20%s',_0x24c5ff,'request\x20sent');logger['debug'](_0xc62c('0xb'),_0x24c5ff,_0xc62c('0xc'),JSON[_0xc62c('0xd')](_0x483b87));if(_0x483b87[_0xc62c('0xe')]){if(_0x483b87[_0xc62c('0xe')]['code']===0x1f4){logger['error'](_0xc62c('0xf'),_0x24c5ff,_0x483b87['error']['message']);return _0x8784bb(_0x483b87[_0xc62c('0xe')]['message']);}logger[_0xc62c('0xe')]('FreshsalesField,\x20%s,\x20%s',_0x24c5ff,_0x483b87[_0xc62c('0xe')][_0xc62c('0x10')]);return _0x5c1d3a(_0x483b87[_0xc62c('0xe')][_0xc62c('0x10')]);}else{logger[_0xc62c('0xa')](_0xc62c('0xf'),_0x24c5ff,_0xc62c('0xc'));_0x5c1d3a(_0x483b87[_0xc62c('0x11')][_0xc62c('0x10')]);}})[_0xc62c('0x12')](function(_0x583aec){logger[_0xc62c('0xe')]('FreshsalesField,\x20%s,\x20%s',_0x24c5ff,_0x583aec);_0x8784bb(_0x583aec);});});} \ No newline at end of file +var _0x0ed1=['catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x57f7ea,_0x54da6b){var _0x54a7e4=function(_0x2c9d4f){while(--_0x2c9d4f){_0x57f7ea['push'](_0x57f7ea['shift']());}};_0x54a7e4(++_0x54da6b);}(_0x0ed1,0xb1));var _0x10ed=function(_0x23410e,_0x5c532e){_0x23410e=_0x23410e-0x0;var _0xd89577=_0x0ed1[_0x23410e];return _0xd89577;};'use strict';var _=require(_0x10ed('0x0'));var util=require('util');var moment=require(_0x10ed('0x1'));var BPromise=require('bluebird');var rs=require(_0x10ed('0x2'));var fs=require('fs');var Redis=require(_0x10ed('0x3'));var db=require(_0x10ed('0x4'))['db'];var utils=require(_0x10ed('0x5'));var logger=require(_0x10ed('0x6'))(_0x10ed('0x7'));var config=require(_0x10ed('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x10ed('0x9')][_0x10ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x595003,_0x47584b,_0x226d06){return new BPromise(function(_0x180707,_0x15f7c0){return client[_0x10ed('0xb')](_0x595003,_0x226d06)['then'](function(_0x19bc50){logger[_0x10ed('0xc')](_0x10ed('0xd'),_0x47584b,_0x10ed('0xe'));logger[_0x10ed('0xf')](_0x10ed('0x10'),_0x47584b,'request\x20sent',JSON[_0x10ed('0x11')](_0x19bc50));if(_0x19bc50[_0x10ed('0x12')]){if(_0x19bc50['error'][_0x10ed('0x13')]===0x1f4){logger[_0x10ed('0x12')](_0x10ed('0xd'),_0x47584b,_0x19bc50[_0x10ed('0x12')][_0x10ed('0x14')]);return _0x15f7c0(_0x19bc50[_0x10ed('0x12')]['message']);}logger[_0x10ed('0x12')](_0x10ed('0xd'),_0x47584b,_0x19bc50[_0x10ed('0x12')][_0x10ed('0x14')]);return _0x180707(_0x19bc50[_0x10ed('0x12')][_0x10ed('0x14')]);}else{logger['info'](_0x10ed('0xd'),_0x47584b,_0x10ed('0xe'));_0x180707(_0x19bc50['result'][_0x10ed('0x14')]);}})[_0x10ed('0x15')](function(_0xc855f6){logger[_0x10ed('0x12')](_0x10ed('0xd'),_0x47584b,_0xc855f6);_0x15f7c0(_0xc855f6);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index a15ea07..8054ecb 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 _0xa482=['../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3d3ca6,_0x5f3400){var _0x49c3b4=function(_0x957a02){while(--_0x957a02){_0x3d3ca6['push'](_0x3d3ca6['shift']());}};_0x49c3b4(++_0x5f3400);}(_0xa482,0x181));var _0x2a48=function(_0x1cb005,_0x139e00){_0x1cb005=_0x1cb005-0x0;var _0x487a43=_0xa482[_0x1cb005];return _0x487a43;};'use strict';var multer=require(_0x2a48('0x0'));var util=require(_0x2a48('0x1'));var path=require(_0x2a48('0x2'));var timeout=require(_0x2a48('0x3'));var express=require(_0x2a48('0x4'));var router=express[_0x2a48('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x2a48('0x6'));var config=require(_0x2a48('0x7'));var controller=require(_0x2a48('0x8'));router[_0x2a48('0x9')]('/',auth[_0x2a48('0xa')](),controller[_0x2a48('0xb')]);router[_0x2a48('0x9')](_0x2a48('0xc'),auth[_0x2a48('0xa')](),controller[_0x2a48('0xd')]);router['get'](_0x2a48('0xe'),auth[_0x2a48('0xa')](),controller['getConfigurations']);router[_0x2a48('0x9')](_0x2a48('0xf'),auth[_0x2a48('0xa')](),controller[_0x2a48('0x10')]);router[_0x2a48('0x11')]('/',auth[_0x2a48('0xa')](),controller[_0x2a48('0x12')]);router['post'](_0x2a48('0xe'),auth[_0x2a48('0xa')](),controller[_0x2a48('0x13')]);router[_0x2a48('0x14')]('/:id',auth[_0x2a48('0xa')](),controller['update']);router['delete'](_0x2a48('0xc'),auth[_0x2a48('0xa')](),controller[_0x2a48('0x15')]);module[_0x2a48('0x16')]=router; \ No newline at end of file +var _0x46db=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1319c6,_0x5377a6){var _0x3b3a92=function(_0x19d96c){while(--_0x19d96c){_0x1319c6['push'](_0x1319c6['shift']());}};_0x3b3a92(++_0x5377a6);}(_0x46db,0x1c7));var _0xb46d=function(_0x1d6893,_0x3d57cf){_0x1d6893=_0x1d6893-0x0;var _0x2cc4ad=_0x46db[_0x1d6893];return _0x2cc4ad;};'use strict';var multer=require(_0xb46d('0x0'));var util=require(_0xb46d('0x1'));var path=require(_0xb46d('0x2'));var timeout=require(_0xb46d('0x3'));var express=require(_0xb46d('0x4'));var router=express[_0xb46d('0x5')]();var auth=require(_0xb46d('0x6'));var interaction=require(_0xb46d('0x7'));var config=require(_0xb46d('0x8'));var controller=require('./intSalesforceAccount.controller');router[_0xb46d('0x9')]('/',auth[_0xb46d('0xa')](),controller[_0xb46d('0xb')]);router[_0xb46d('0x9')](_0xb46d('0xc'),auth[_0xb46d('0xa')](),controller[_0xb46d('0xd')]);router[_0xb46d('0x9')]('/:id/configurations',auth[_0xb46d('0xa')](),controller[_0xb46d('0xe')]);router[_0xb46d('0x9')](_0xb46d('0xf'),auth['isAuthenticated'](),controller[_0xb46d('0x10')]);router[_0xb46d('0x11')]('/',auth[_0xb46d('0xa')](),controller[_0xb46d('0x12')]);router[_0xb46d('0x11')](_0xb46d('0x13'),auth[_0xb46d('0xa')](),controller[_0xb46d('0x14')]);router['put'](_0xb46d('0xc'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xb46d('0xa')](),controller[_0xb46d('0x15')]);module[_0xb46d('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 849460a..82cf91b 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 _0x5fc3=['STRING','username','newTab','sequelize','exports'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x5fc3,0xa8));var _0x35fc=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x5fc3[_0x397cfb];return _0x15fed9;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x35fc('0x2')]},'username':{'type':Sequelize[_0x35fc('0x2')],'unique':_0x35fc('0x3')},'remoteUri':{'type':Sequelize[_0x35fc('0x2')]},'password':{'type':Sequelize[_0x35fc('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x35fc('0x2')]},'securityToken':{'type':Sequelize[_0x35fc('0x2')]},'serverUrl':{'type':Sequelize[_0x35fc('0x2')]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x35fc('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x1cb9=['username','ENUM','integrationTab','newTab','sequelize','STRING'];(function(_0x430b45,_0x43668c){var _0xfafd2d=function(_0x594fcb){while(--_0x594fcb){_0x430b45['push'](_0x430b45['shift']());}};_0xfafd2d(++_0x43668c);}(_0x1cb9,0x14e));var _0x91cb=function(_0x5d6391,_0x607b9c){_0x5d6391=_0x5d6391-0x0;var _0x131615=_0x1cb9[_0x5d6391];return _0x131615;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x91cb('0x1')]},'description':{'type':Sequelize[_0x91cb('0x1')]},'username':{'type':Sequelize[_0x91cb('0x1')],'unique':_0x91cb('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x91cb('0x1')]},'clientId':{'type':Sequelize[_0x91cb('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x91cb('0x1')]},'serverUrl':{'type':Sequelize[_0x91cb('0x1')]},'type':{'type':Sequelize[_0x91cb('0x3')](_0x91cb('0x4'),_0x91cb('0x5')),'defaultValue':_0x91cb('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 5bc3d67..5dd6451 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 _0x0295=['info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','SalesforceAccount','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceConfiguration','SalesforceField','getFields','clientId','clientSecret','username','securityToken','remoteUri','substring','lastIndexOf','Connection','password','concat','isNil','ticketType','sobject','describe','CallDisposition','CallObject','CallType','IsArchived','Priority','Status','Case','IsEscalated','SuppliedName','SuppliedCompany','custom','label','picklistValues','value','True','False','false','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','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','../../components/integrations/configuration','jayson/promise','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'];(function(_0x2403ab,_0x5a4ed2){var _0x171f71=function(_0x3f56c4){while(--_0x3f56c4){_0x2403ab['push'](_0x2403ab['shift']());}};_0x171f71(++_0x5a4ed2);}(_0x0295,0x1f0));var _0x5029=function(_0x5a3b09,_0x24a4a3){_0x5a3b09=_0x5a3b09-0x0;var _0x46298a=_0x0295[_0x5a3b09];return _0x46298a;};'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'];var integrations=require(_0x5029('0x14'));var jayson=require(_0x5029('0x15'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x49f836,_0x4aebb6,_0x2484ac){if(_0x2484ac){var _0x2e0369=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2e0369[_0x5029('0x16')](_0x4aebb6)){return _0x49f836;}else{throw new db[(_0x5029('0x17'))][(_0x5029('0x18'))](_0x5029('0x19'));}}else{return _0x49f836;}}function respondWithRpcPromise(_0xe278b7,_0x317c20,_0x10bf55,_0x326923){return new BPromise(function(_0x457c73,_0x353cba){var _0x3786b5=_0x326923||client;return _0x3786b5[_0x5029('0x1a')](_0xe278b7,_0x10bf55)[_0x5029('0x1b')](function(_0x4f7ab4){logger[_0x5029('0x1c')](_0x5029('0x1d'),_0x317c20,_0x5029('0x1e'));logger[_0x5029('0x1f')](_0x5029('0x20'),_0x317c20,_0x5029('0x1e'),JSON[_0x5029('0x21')](_0x4f7ab4));if(_0x4f7ab4['error']){if(_0x4f7ab4[_0x5029('0x22')]['code']===0x1f4){logger[_0x5029('0x22')](_0x5029('0x1d'),_0x317c20,_0x4f7ab4[_0x5029('0x22')][_0x5029('0x23')]);return _0x353cba(_0x4f7ab4['error']['message']);}logger[_0x5029('0x22')]('SalesforceAccount,\x20%s,\x20%s',_0x317c20,_0x4f7ab4[_0x5029('0x22')][_0x5029('0x23')]);return _0x457c73(_0x4f7ab4[_0x5029('0x22')][_0x5029('0x23')]);}else{logger[_0x5029('0x1c')](_0x5029('0x1d'),_0x317c20,_0x5029('0x1e'));_0x457c73(_0x4f7ab4[_0x5029('0x24')][_0x5029('0x23')]);}})['catch'](function(_0x564866){logger['error'](_0x5029('0x1d'),_0x317c20,_0x564866);_0x353cba(_0x564866);});});}function respondWithStatusCode(_0x45666c,_0x51093c){_0x51093c=_0x51093c||0xcc;return function(_0x5727e9){if(_0x5727e9){return _0x45666c[_0x5029('0x25')](_0x51093c);}return _0x45666c[_0x5029('0x26')](_0x51093c)[_0x5029('0x27')]();};}function respondWithResult(_0x5527fc,_0x2c501f){_0x2c501f=_0x2c501f||0xc8;return function(_0xb14bc){if(_0xb14bc){return _0x5527fc['status'](_0x2c501f)[_0x5029('0x28')](_0xb14bc);}};}function respondWithFilteredResult(_0x31f0a0,_0x16ad8b){return function(_0x4a24b9){if(_0x4a24b9){var _0x32da06=_0x4a24b9[_0x5029('0x29')],_0x251f99=_0x16ad8b[_0x5029('0x2a')],_0xe5313e=_0x16ad8b['offset']+_0x16ad8b[_0x5029('0x2b')],_0x4b6f92;if(_0xe5313e>=_0x32da06){_0xe5313e=_0x32da06;_0x4b6f92=0xc8;}else{_0x4b6f92=0xce;}_0x31f0a0[_0x5029('0x26')](_0x4b6f92);return _0x31f0a0[_0x5029('0x2c')](_0x5029('0x2d'),_0x251f99+'-'+_0xe5313e+'/'+_0x32da06)[_0x5029('0x28')](_0x4a24b9);}return null;};}function patchUpdates(_0x2a1ed6){return function(_0x44255a){try{jsonpatch[_0x5029('0x2e')](_0x44255a,_0x2a1ed6,!![]);}catch(_0x250156){return BPromise[_0x5029('0x2f')](_0x250156);}return _0x44255a[_0x5029('0x30')]();};}function saveUpdates(_0x4519c8,_0x4ff3db){return function(_0x11ae38){if(_0x11ae38){return _0x11ae38['update'](_0x4519c8)[_0x5029('0x1b')](function(_0x4f672e){return _0x4f672e;});}return null;};}function removeEntity(_0x48f387,_0x2bc434){return function(_0x447680){if(_0x447680){return _0x447680[_0x5029('0x31')]()['then'](function(){_0x48f387[_0x5029('0x26')](0xcc)[_0x5029('0x27')]();});}};}function handleEntityNotFound(_0x3f20fb,_0x29c59a){return function(_0x1bb896){if(!_0x1bb896){_0x3f20fb[_0x5029('0x25')](0x194);}return _0x1bb896;};}function handleError(_0x46ec59,_0x22205e){_0x22205e=_0x22205e||0x1f4;return function(_0x456cfc){logger['error'](_0x456cfc[_0x5029('0x32')]);if(_0x456cfc[_0x5029('0x33')]){delete _0x456cfc[_0x5029('0x33')];}_0x46ec59[_0x5029('0x26')](_0x22205e)['send'](_0x456cfc);};}exports[_0x5029('0x34')]=function(_0x388cca,_0x3e2d88){var _0x594549={},_0x4904cc={},_0x2d1ccb={'count':0x0,'rows':[]};var _0x17756b=_['map'](db['SalesforceAccount'][_0x5029('0x35')],function(_0x157969){return{'name':_0x157969[_0x5029('0x36')],'type':_0x157969[_0x5029('0x37')][_0x5029('0x38')]};});_0x4904cc[_0x5029('0x39')]=_[_0x5029('0x3a')](_0x17756b,_0x5029('0x33'));_0x4904cc[_0x5029('0x3b')]=_[_0x5029('0x3c')](_0x388cca[_0x5029('0x3b')]);_0x4904cc[_0x5029('0x3d')]=_[_0x5029('0x3e')](_0x4904cc[_0x5029('0x39')],_0x4904cc['query']);_0x594549['attributes']=_[_0x5029('0x3e')](_0x4904cc[_0x5029('0x39')],qs[_0x5029('0x3f')](_0x388cca['query'][_0x5029('0x3f')]));_0x594549[_0x5029('0x40')]=_0x594549['attributes'][_0x5029('0x41')]?_0x594549['attributes']:_0x4904cc[_0x5029('0x39')];if(!_0x388cca['query'][_0x5029('0x42')](_0x5029('0x43'))){_0x594549[_0x5029('0x2b')]=qs[_0x5029('0x2b')](_0x388cca[_0x5029('0x3b')][_0x5029('0x2b')]);_0x594549[_0x5029('0x2a')]=qs[_0x5029('0x2a')](_0x388cca[_0x5029('0x3b')]['offset']);}_0x594549[_0x5029('0x44')]=qs[_0x5029('0x45')](_0x388cca[_0x5029('0x3b')][_0x5029('0x45')]);_0x594549[_0x5029('0x46')]=qs[_0x5029('0x3d')](_['pick'](_0x388cca[_0x5029('0x3b')],_0x4904cc[_0x5029('0x3d')]));if(_0x388cca[_0x5029('0x3b')][_0x5029('0x47')]){_0x594549[_0x5029('0x46')]=_['merge'](_0x594549[_0x5029('0x46')],{'$or':_[_0x5029('0x3a')](_0x17756b,function(_0x248556){if(_0x248556[_0x5029('0x37')]!==_0x5029('0x48')){var _0x128aff={};_0x128aff[_0x248556[_0x5029('0x33')]]={'$like':'%'+_0x388cca[_0x5029('0x3b')][_0x5029('0x47')]+'%'};return _0x128aff;}})});}_0x594549=_['merge']({},_0x594549,_0x388cca[_0x5029('0x49')]);var _0x27d2ad={'where':_0x594549[_0x5029('0x46')]};return db[_0x5029('0x4a')]['count'](_0x27d2ad)['then'](function(_0x17a515){_0x2d1ccb[_0x5029('0x29')]=_0x17a515;if(_0x388cca[_0x5029('0x3b')][_0x5029('0x4b')]){_0x594549[_0x5029('0x4c')]=[{'all':!![]}];}return db[_0x5029('0x4a')][_0x5029('0x4d')](_0x594549);})[_0x5029('0x1b')](function(_0x1257a4){_0x2d1ccb[_0x5029('0x4e')]=_0x1257a4;return _0x2d1ccb;})[_0x5029('0x1b')](respondWithFilteredResult(_0x3e2d88,_0x594549))[_0x5029('0x4f')](handleError(_0x3e2d88,null));};exports[_0x5029('0x50')]=function(_0x18f1f5,_0x3168bd){var _0x175cc0={'raw':![],'where':{'id':_0x18f1f5[_0x5029('0x51')]['id']}},_0x10fc07={};_0x10fc07[_0x5029('0x39')]=_[_0x5029('0x3c')](db[_0x5029('0x4a')]['rawAttributes']);_0x10fc07[_0x5029('0x3b')]=_['keys'](_0x18f1f5[_0x5029('0x3b')]);_0x10fc07[_0x5029('0x3d')]=_['intersection'](_0x10fc07['model'],_0x10fc07[_0x5029('0x3b')]);_0x175cc0['attributes']=_['intersection'](_0x10fc07[_0x5029('0x39')],qs[_0x5029('0x3f')](_0x18f1f5[_0x5029('0x3b')]['fields']));_0x175cc0['attributes']=_0x175cc0[_0x5029('0x40')][_0x5029('0x41')]?_0x175cc0['attributes']:_0x10fc07[_0x5029('0x39')];if(_0x18f1f5['query'][_0x5029('0x4b')]){_0x175cc0['include']=[{'all':!![]}];}_0x175cc0=_[_0x5029('0x52')]({},_0x175cc0,_0x18f1f5[_0x5029('0x49')]);return db[_0x5029('0x4a')][_0x5029('0x53')](_0x175cc0)[_0x5029('0x1b')](handleEntityNotFound(_0x3168bd,null))[_0x5029('0x1b')](respondWithResult(_0x3168bd,null))[_0x5029('0x4f')](handleError(_0x3168bd,null));};exports[_0x5029('0x54')]=function(_0x586936,_0x1df044){return db['SalesforceAccount'][_0x5029('0x54')](_0x586936[_0x5029('0x55')],{})['then'](respondWithResult(_0x1df044,0xc9))[_0x5029('0x4f')](handleError(_0x1df044,null));};exports['update']=function(_0x58928f,_0x55c57c){if(_0x58928f[_0x5029('0x55')]['id']){delete _0x58928f['body']['id'];}return db[_0x5029('0x4a')][_0x5029('0x53')]({'where':{'id':_0x58928f[_0x5029('0x51')]['id']}})['then'](handleEntityNotFound(_0x55c57c,null))[_0x5029('0x1b')](saveUpdates(_0x58928f['body'],null))['then'](respondWithResult(_0x55c57c,null))[_0x5029('0x4f')](handleError(_0x55c57c,null));};exports[_0x5029('0x31')]=function(_0x81e39c,_0x448273){return db[_0x5029('0x4a')]['find']({'where':{'id':_0x81e39c[_0x5029('0x51')]['id']}})[_0x5029('0x1b')](handleEntityNotFound(_0x448273,null))[_0x5029('0x1b')](removeEntity(_0x448273,null))[_0x5029('0x4f')](handleError(_0x448273,null));};exports['getConfigurations']=function(_0x33812b,_0xfffc0d,_0x4d4a2d){var _0x512de9={};var _0x2afd44={};var _0x4685a6;var _0x1263ba;return db[_0x5029('0x4a')]['findOne']({'where':{'id':_0x33812b[_0x5029('0x51')]['id']}})[_0x5029('0x1b')](handleEntityNotFound(_0xfffc0d,null))[_0x5029('0x1b')](function(_0x2aebb3){if(_0x2aebb3){_0x4685a6=_0x2aebb3;_0x2afd44[_0x5029('0x39')]=_[_0x5029('0x3c')](db['SalesforceConfiguration']['rawAttributes']);_0x2afd44[_0x5029('0x3b')]=_[_0x5029('0x3c')](_0x33812b[_0x5029('0x3b')]);_0x2afd44['filters']=_[_0x5029('0x3e')](_0x2afd44[_0x5029('0x39')],_0x2afd44[_0x5029('0x3b')]);_0x512de9[_0x5029('0x40')]=_[_0x5029('0x3e')](_0x2afd44['model'],qs[_0x5029('0x3f')](_0x33812b[_0x5029('0x3b')][_0x5029('0x3f')]));_0x512de9['attributes']=_0x512de9[_0x5029('0x40')]['length']?_0x512de9[_0x5029('0x40')]:_0x2afd44['model'];_0x512de9[_0x5029('0x44')]=qs[_0x5029('0x45')](_0x33812b[_0x5029('0x3b')][_0x5029('0x45')]);_0x512de9[_0x5029('0x46')]=qs[_0x5029('0x3d')](_['pick'](_0x33812b[_0x5029('0x3b')],_0x2afd44[_0x5029('0x3d')]));if(_0x33812b[_0x5029('0x3b')][_0x5029('0x47')]){_0x512de9[_0x5029('0x46')]=_['merge'](_0x512de9[_0x5029('0x46')],{'$or':_['map'](_0x512de9[_0x5029('0x40')],function(_0x539f80){var _0xacab3={};_0xacab3[_0x539f80]={'$like':'%'+_0x33812b['query'][_0x5029('0x47')]+'%'};return _0xacab3;})});}_0x512de9=_['merge']({},_0x512de9,_0x33812b['options']);return _0x4685a6[_0x5029('0x56')](_0x512de9);}})['then'](function(_0x2d2a40){if(_0x2d2a40){_0x1263ba=_0x2d2a40[_0x5029('0x41')];if(!_0x33812b[_0x5029('0x3b')]['hasOwnProperty'](_0x5029('0x43'))){_0x512de9['limit']=qs[_0x5029('0x2b')](_0x33812b[_0x5029('0x3b')][_0x5029('0x2b')]);_0x512de9[_0x5029('0x2a')]=qs[_0x5029('0x2a')](_0x33812b['query'][_0x5029('0x2a')]);}return _0x4685a6[_0x5029('0x56')](_0x512de9);}})['then'](function(_0x6500bb){if(_0x6500bb){return _0x6500bb?{'count':_0x1263ba,'rows':_0x6500bb}:null;}})[_0x5029('0x1b')](respondWithResult(_0xfffc0d,null))[_0x5029('0x4f')](handleError(_0xfffc0d,null));};exports[_0x5029('0x57')]=function(_0x9b1c13,_0x1bd1c6,_0x5bd84e){if(_0x9b1c13['body']['id']){delete _0x9b1c13[_0x5029('0x55')]['id'];}return db['SalesforceAccount'][_0x5029('0x58')]({'where':{'id':_0x9b1c13[_0x5029('0x51')]['id']}})['then'](handleEntityNotFound(_0x1bd1c6,null))[_0x5029('0x1b')](function(_0x574d06){if(_0x574d06){_0x9b1c13['body'][_0x5029('0x59')]=_0x574d06['id'];_0x9b1c13[_0x5029('0x55')][_0x5029('0x5a')]=integrations[_0x5029('0x5b')](_0x9b1c13['body'][_0x5029('0x5c')],_0x9b1c13[_0x5029('0x55')]['type']);_0x9b1c13[_0x5029('0x55')][_0x5029('0x5d')]=integrations['getDescriptions'](_0x9b1c13['body']['channel'],_0x9b1c13[_0x5029('0x55')][_0x5029('0x37')]);return db[_0x5029('0x5e')][_0x5029('0x54')](_0x9b1c13[_0x5029('0x55')],{'include':[{'model':db[_0x5029('0x5f')],'as':_0x5029('0x5a')},{'model':db[_0x5029('0x5f')],'as':_0x5029('0x5d')}]});}return null;})['then'](respondWithResult(_0x1bd1c6,null))['catch'](handleError(_0x1bd1c6,null));};exports[_0x5029('0x60')]=function(_0x413f9e,_0xf51086,_0x15906f){var _0x2d8c9a;var _0x3f5115='';var _0x459230='Task';return db[_0x5029('0x4a')][_0x5029('0x58')]({'where':{'id':_0x413f9e[_0x5029('0x51')]['id']},'attributes':['id','remoteUri',_0x5029('0x61'),_0x5029('0x62'),_0x5029('0x63'),'password',_0x5029('0x64')]})[_0x5029('0x1b')](handleEntityNotFound(_0xf51086,null))[_0x5029('0x1b')](function(_0x50af55){if(_0x50af55){_0x3f5115=_0x50af55[_0x5029('0x65')];var _0x145616=_0x3f5115['slice'](-0x1);if(_0x145616==='/'){_0x3f5115=_0x3f5115[_0x5029('0x66')](0x0,_0x3f5115[_0x5029('0x67')](_0x145616));}_0x2d8c9a=new jsforce[(_0x5029('0x68'))]({'oauth2':{'loginUrl':_0x3f5115,'clientId':_0x50af55[_0x5029('0x61')],'clientSecret':_0x50af55[_0x5029('0x62')]}});return _0x2d8c9a['login'](_0x50af55[_0x5029('0x63')],_0x50af55[_0x5029('0x69')][_0x5029('0x6a')](_0x50af55[_0x5029('0x64')]));}})[_0x5029('0x1b')](function(_0x5e7f50){if(_0x5e7f50){if(!_[_0x5029('0x6b')](_0x413f9e[_0x5029('0x3b')][_0x5029('0x6c')])){_0x459230=_0x413f9e['query'][_0x5029('0x6c')];}return _0x2d8c9a[_0x5029('0x6d')](_0x459230)[_0x5029('0x6e')]();}})[_0x5029('0x1b')](function(_0x1b3860){var _0x320a91=[_0x5029('0x6f'),'CallDurationInSeconds',_0x5029('0x70'),_0x5029('0x71'),_0x5029('0x72'),_0x5029('0x73'),_0x5029('0x74'),'Type'];if(!_[_0x5029('0x6b')](_0x413f9e[_0x5029('0x3b')][_0x5029('0x6c')])&&_0x413f9e['query'][_0x5029('0x6c')]===_0x5029('0x75')){_0x320a91=['Type','Origin','Reason',_0x5029('0x74'),_0x5029('0x73'),_0x5029('0x76'),_0x5029('0x77'),_0x5029('0x78')];}if(_0x1b3860){_['remove'](_0x1b3860[_0x5029('0x3f')],function(_0x2e4782){return _0x2e4782[_0x5029('0x79')]===![]&&!_0x320a91['includes'](_0x2e4782['name']);});return{'count':_0x1b3860[_0x5029('0x3f')][_0x5029('0x41')],'rows':_[_0x5029('0x3a')](_0x1b3860[_0x5029('0x3f')],function(_0x597381){return{'id':_0x597381[_0x5029('0x33')],'name':_0x597381[_0x5029('0x7a')],'custom':_0x597381[_0x5029('0x79')],'options':_0x597381[_0x5029('0x7b')][_0x5029('0x41')]>0x0?_[_0x5029('0x3a')](_0x597381[_0x5029('0x7b')],function(_0xe4b730){return{'name':_0xe4b730['label'],'value':_0xe4b730[_0x5029('0x7c')]};}):_0x597381['type']=='boolean'?[{'name':_0x5029('0x7d'),'value':'true'},{'name':_0x5029('0x7e'),'value':_0x5029('0x7f')}]:[]};})};}})[_0x5029('0x1b')](respondWithResult(_0xf51086,null))[_0x5029('0x4f')](function(_0x1b6f4c){var _0x227d13=_0x413f9e[_0x5029('0x3b')][_0x5029('0x16')]?0x1f4:_0x1b6f4c['statusCode']||0x1f4;logger['error'](_0x5029('0x80'),'getFields',_0x227d13,JSON['stringify'](_0x1b6f4c));delete _0x1b6f4c[_0x5029('0x33')];if(_0x227d13===0x191){_0x227d13=0x190;}_0xf51086['status'](_0x227d13)['send'](_0x413f9e[_0x5029('0x3b')][_0x5029('0x16')]?{'message':_0x5029('0x81'),'statusCode':_0x1b6f4c[_0x5029('0x82')]}:_0x1b6f4c);});}; \ No newline at end of file +var _0x53ec=['Priority','SuppliedName','SuppliedCompany','remove','custom','includes','label','picklistValues','value','True','true','False','false','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','end','status','count','offset','limit','set','json','save','update','destroy','name','send','map','SalesforceAccount','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','order','sort','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','fields','find','create','body','getConfigurations','findOne','SalesforceConfiguration','pick','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','Descriptions','channel','getFields','Task','clientId','clientSecret','username','password','securityToken','remoteUri','substring','Connection','concat','isNil','ticketType','sobject','CallDisposition','CallDurationInSeconds','IsArchived','Status','Type','Origin','Reason'];(function(_0x1decb3,_0x520553){var _0x819b83=function(_0x93b5bb){while(--_0x93b5bb){_0x1decb3['push'](_0x1decb3['shift']());}};_0x819b83(++_0x520553);}(_0x53ec,0x192));var _0xc53e=function(_0x44fede,_0x386a68){_0x44fede=_0x44fede-0x0;var _0x3c478f=_0x53ec[_0x44fede];return _0x3c478f;};'use strict';var pdf=require(_0xc53e('0x0'));var emlformat=require(_0xc53e('0x1'));var rimraf=require(_0xc53e('0x2'));var zipdir=require(_0xc53e('0x3'));var jsonpatch=require(_0xc53e('0x4'));var rp=require(_0xc53e('0x5'));var moment=require('moment');var BPromise=require(_0xc53e('0x6'));var Mustache=require('mustache');var util=require(_0xc53e('0x7'));var path=require(_0xc53e('0x8'));var sox=require('sox');var csv=require(_0xc53e('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0x9'));var querystring=require(_0xc53e('0xe'));var Papa=require(_0xc53e('0xf'));var Redis=require(_0xc53e('0x10'));var authService=require(_0xc53e('0x11'));var qs=require(_0xc53e('0x12'));var as=require(_0xc53e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xc53e('0x15'))['db'];var integrations=require(_0xc53e('0x16'));var jayson=require(_0xc53e('0x17'));var client=jayson[_0xc53e('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x4e74c9,_0x1c06cd,_0x19a772){if(_0x19a772){var _0x7cd798=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x7cd798[_0xc53e('0x19')](_0x1c06cd)){return _0x4e74c9;}else{throw new db[(_0xc53e('0x1a'))][(_0xc53e('0x1b'))](_0xc53e('0x1c'));}}else{return _0x4e74c9;}}function respondWithRpcPromise(_0x19c0d1,_0x455e4d,_0x2ad6eb,_0x5b0a88){return new BPromise(function(_0x8a522e,_0x191567){var _0x535cd4=_0x5b0a88||client;return _0x535cd4[_0xc53e('0x1d')](_0x19c0d1,_0x2ad6eb)[_0xc53e('0x1e')](function(_0x270c78){logger[_0xc53e('0x1f')](_0xc53e('0x20'),_0x455e4d,_0xc53e('0x21'));logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x455e4d,_0xc53e('0x21'),JSON[_0xc53e('0x22')](_0x270c78));if(_0x270c78[_0xc53e('0x23')]){if(_0x270c78[_0xc53e('0x23')][_0xc53e('0x24')]===0x1f4){logger[_0xc53e('0x23')](_0xc53e('0x20'),_0x455e4d,_0x270c78[_0xc53e('0x23')][_0xc53e('0x25')]);return _0x191567(_0x270c78[_0xc53e('0x23')][_0xc53e('0x25')]);}logger[_0xc53e('0x23')](_0xc53e('0x20'),_0x455e4d,_0x270c78['error']['message']);return _0x8a522e(_0x270c78['error'][_0xc53e('0x25')]);}else{logger[_0xc53e('0x1f')](_0xc53e('0x20'),_0x455e4d,_0xc53e('0x21'));_0x8a522e(_0x270c78[_0xc53e('0x26')]['message']);}})['catch'](function(_0xe06e42){logger['error'](_0xc53e('0x20'),_0x455e4d,_0xe06e42);_0x191567(_0xe06e42);});});}function respondWithStatusCode(_0x3a5ce8,_0x443179){_0x443179=_0x443179||0xcc;return function(_0x1166e6){if(_0x1166e6){return _0x3a5ce8[_0xc53e('0x27')](_0x443179);}return _0x3a5ce8['status'](_0x443179)[_0xc53e('0x28')]();};}function respondWithResult(_0x4b9f6a,_0x4d9a68){_0x4d9a68=_0x4d9a68||0xc8;return function(_0x5c65d3){if(_0x5c65d3){return _0x4b9f6a[_0xc53e('0x29')](_0x4d9a68)['json'](_0x5c65d3);}};}function respondWithFilteredResult(_0x28240a,_0x4f203d){return function(_0x24a77e){if(_0x24a77e){var _0x5112d2=_0x24a77e[_0xc53e('0x2a')],_0x5ce216=_0x4f203d[_0xc53e('0x2b')],_0x8f0ee6=_0x4f203d[_0xc53e('0x2b')]+_0x4f203d[_0xc53e('0x2c')],_0x6a62b0;if(_0x8f0ee6>=_0x5112d2){_0x8f0ee6=_0x5112d2;_0x6a62b0=0xc8;}else{_0x6a62b0=0xce;}_0x28240a[_0xc53e('0x29')](_0x6a62b0);return _0x28240a[_0xc53e('0x2d')]('Content-Range',_0x5ce216+'-'+_0x8f0ee6+'/'+_0x5112d2)[_0xc53e('0x2e')](_0x24a77e);}return null;};}function patchUpdates(_0x311835){return function(_0x2d36c0){try{jsonpatch['apply'](_0x2d36c0,_0x311835,!![]);}catch(_0x4057f9){return BPromise['reject'](_0x4057f9);}return _0x2d36c0[_0xc53e('0x2f')]();};}function saveUpdates(_0x2467f4,_0x49ab9b){return function(_0x5a64e2){if(_0x5a64e2){return _0x5a64e2[_0xc53e('0x30')](_0x2467f4)[_0xc53e('0x1e')](function(_0x3f4547){return _0x3f4547;});}return null;};}function removeEntity(_0x30d037,_0x1b95c2){return function(_0x45fedc){if(_0x45fedc){return _0x45fedc[_0xc53e('0x31')]()[_0xc53e('0x1e')](function(){_0x30d037['status'](0xcc)[_0xc53e('0x28')]();});}};}function handleEntityNotFound(_0x3bae8a,_0x19020b){return function(_0x17ad32){if(!_0x17ad32){_0x3bae8a[_0xc53e('0x27')](0x194);}return _0x17ad32;};}function handleError(_0x12b32c,_0x1920c8){_0x1920c8=_0x1920c8||0x1f4;return function(_0x16942c){logger[_0xc53e('0x23')](_0x16942c['stack']);if(_0x16942c[_0xc53e('0x32')]){delete _0x16942c['name'];}_0x12b32c[_0xc53e('0x29')](_0x1920c8)[_0xc53e('0x33')](_0x16942c);};}exports['index']=function(_0x37452a,_0x154f8b){var _0x3254e9={},_0x5ed90b={},_0x4b82bb={'count':0x0,'rows':[]};var _0x17ec92=_[_0xc53e('0x34')](db[_0xc53e('0x35')][_0xc53e('0x36')],function(_0x143101){return{'name':_0x143101[_0xc53e('0x37')],'type':_0x143101['type'][_0xc53e('0x38')]};});_0x5ed90b[_0xc53e('0x39')]=_[_0xc53e('0x34')](_0x17ec92,'name');_0x5ed90b[_0xc53e('0x3a')]=_['keys'](_0x37452a[_0xc53e('0x3a')]);_0x5ed90b[_0xc53e('0x3b')]=_[_0xc53e('0x3c')](_0x5ed90b[_0xc53e('0x39')],_0x5ed90b[_0xc53e('0x3a')]);_0x3254e9['attributes']=_[_0xc53e('0x3c')](_0x5ed90b[_0xc53e('0x39')],qs['fields'](_0x37452a['query']['fields']));_0x3254e9['attributes']=_0x3254e9[_0xc53e('0x3d')][_0xc53e('0x3e')]?_0x3254e9['attributes']:_0x5ed90b[_0xc53e('0x39')];if(!_0x37452a['query']['hasOwnProperty']('nolimit')){_0x3254e9[_0xc53e('0x2c')]=qs['limit'](_0x37452a['query'][_0xc53e('0x2c')]);_0x3254e9['offset']=qs[_0xc53e('0x2b')](_0x37452a[_0xc53e('0x3a')]['offset']);}_0x3254e9[_0xc53e('0x3f')]=qs[_0xc53e('0x40')](_0x37452a['query'][_0xc53e('0x40')]);_0x3254e9['where']=qs['filters'](_['pick'](_0x37452a['query'],_0x5ed90b[_0xc53e('0x3b')]));if(_0x37452a[_0xc53e('0x3a')][_0xc53e('0x41')]){_0x3254e9['where']=_[_0xc53e('0x42')](_0x3254e9[_0xc53e('0x43')],{'$or':_['map'](_0x17ec92,function(_0x58ede2){if(_0x58ede2[_0xc53e('0x44')]!==_0xc53e('0x45')){var _0x162acd={};_0x162acd[_0x58ede2['name']]={'$like':'%'+_0x37452a[_0xc53e('0x3a')][_0xc53e('0x41')]+'%'};return _0x162acd;}})});}_0x3254e9=_[_0xc53e('0x42')]({},_0x3254e9,_0x37452a[_0xc53e('0x46')]);var _0x1295cc={'where':_0x3254e9[_0xc53e('0x43')]};return db[_0xc53e('0x35')]['count'](_0x1295cc)[_0xc53e('0x1e')](function(_0x39c467){_0x4b82bb[_0xc53e('0x2a')]=_0x39c467;if(_0x37452a['query'][_0xc53e('0x47')]){_0x3254e9[_0xc53e('0x48')]=[{'all':!![]}];}return db[_0xc53e('0x35')][_0xc53e('0x49')](_0x3254e9);})[_0xc53e('0x1e')](function(_0x17cea5){_0x4b82bb['rows']=_0x17cea5;return _0x4b82bb;})[_0xc53e('0x1e')](respondWithFilteredResult(_0x154f8b,_0x3254e9))[_0xc53e('0x4a')](handleError(_0x154f8b,null));};exports[_0xc53e('0x4b')]=function(_0x5a6e41,_0x33d45c){var _0x1d2491={'raw':![],'where':{'id':_0x5a6e41[_0xc53e('0x4c')]['id']}},_0x1eeb65={};_0x1eeb65[_0xc53e('0x39')]=_[_0xc53e('0x4d')](db[_0xc53e('0x35')][_0xc53e('0x36')]);_0x1eeb65[_0xc53e('0x3a')]=_[_0xc53e('0x4d')](_0x5a6e41['query']);_0x1eeb65[_0xc53e('0x3b')]=_[_0xc53e('0x3c')](_0x1eeb65[_0xc53e('0x39')],_0x1eeb65[_0xc53e('0x3a')]);_0x1d2491[_0xc53e('0x3d')]=_['intersection'](_0x1eeb65['model'],qs[_0xc53e('0x4e')](_0x5a6e41['query'][_0xc53e('0x4e')]));_0x1d2491['attributes']=_0x1d2491[_0xc53e('0x3d')][_0xc53e('0x3e')]?_0x1d2491[_0xc53e('0x3d')]:_0x1eeb65['model'];if(_0x5a6e41[_0xc53e('0x3a')][_0xc53e('0x47')]){_0x1d2491[_0xc53e('0x48')]=[{'all':!![]}];}_0x1d2491=_['merge']({},_0x1d2491,_0x5a6e41[_0xc53e('0x46')]);return db['SalesforceAccount'][_0xc53e('0x4f')](_0x1d2491)[_0xc53e('0x1e')](handleEntityNotFound(_0x33d45c,null))['then'](respondWithResult(_0x33d45c,null))[_0xc53e('0x4a')](handleError(_0x33d45c,null));};exports[_0xc53e('0x50')]=function(_0x5bba72,_0x44f7cc){return db[_0xc53e('0x35')][_0xc53e('0x50')](_0x5bba72[_0xc53e('0x51')],{})[_0xc53e('0x1e')](respondWithResult(_0x44f7cc,0xc9))[_0xc53e('0x4a')](handleError(_0x44f7cc,null));};exports[_0xc53e('0x30')]=function(_0x117c9b,_0x8e5630){if(_0x117c9b[_0xc53e('0x51')]['id']){delete _0x117c9b[_0xc53e('0x51')]['id'];}return db['SalesforceAccount'][_0xc53e('0x4f')]({'where':{'id':_0x117c9b['params']['id']}})[_0xc53e('0x1e')](handleEntityNotFound(_0x8e5630,null))['then'](saveUpdates(_0x117c9b[_0xc53e('0x51')],null))[_0xc53e('0x1e')](respondWithResult(_0x8e5630,null))['catch'](handleError(_0x8e5630,null));};exports[_0xc53e('0x31')]=function(_0x7f0bc0,_0x9c0112){return db[_0xc53e('0x35')]['find']({'where':{'id':_0x7f0bc0[_0xc53e('0x4c')]['id']}})[_0xc53e('0x1e')](handleEntityNotFound(_0x9c0112,null))['then'](removeEntity(_0x9c0112,null))['catch'](handleError(_0x9c0112,null));};exports[_0xc53e('0x52')]=function(_0x51db9a,_0x5c62c7,_0x57c822){var _0x23a4ee={};var _0x5f5dad={};var _0x32b390;var _0x4ee995;return db[_0xc53e('0x35')][_0xc53e('0x53')]({'where':{'id':_0x51db9a[_0xc53e('0x4c')]['id']}})[_0xc53e('0x1e')](handleEntityNotFound(_0x5c62c7,null))[_0xc53e('0x1e')](function(_0x4caf5f){if(_0x4caf5f){_0x32b390=_0x4caf5f;_0x5f5dad['model']=_[_0xc53e('0x4d')](db[_0xc53e('0x54')][_0xc53e('0x36')]);_0x5f5dad[_0xc53e('0x3a')]=_[_0xc53e('0x4d')](_0x51db9a[_0xc53e('0x3a')]);_0x5f5dad[_0xc53e('0x3b')]=_[_0xc53e('0x3c')](_0x5f5dad[_0xc53e('0x39')],_0x5f5dad[_0xc53e('0x3a')]);_0x23a4ee[_0xc53e('0x3d')]=_[_0xc53e('0x3c')](_0x5f5dad[_0xc53e('0x39')],qs['fields'](_0x51db9a[_0xc53e('0x3a')]['fields']));_0x23a4ee[_0xc53e('0x3d')]=_0x23a4ee[_0xc53e('0x3d')][_0xc53e('0x3e')]?_0x23a4ee[_0xc53e('0x3d')]:_0x5f5dad[_0xc53e('0x39')];_0x23a4ee[_0xc53e('0x3f')]=qs[_0xc53e('0x40')](_0x51db9a[_0xc53e('0x3a')]['sort']);_0x23a4ee['where']=qs['filters'](_[_0xc53e('0x55')](_0x51db9a[_0xc53e('0x3a')],_0x5f5dad[_0xc53e('0x3b')]));if(_0x51db9a[_0xc53e('0x3a')][_0xc53e('0x41')]){_0x23a4ee[_0xc53e('0x43')]=_[_0xc53e('0x42')](_0x23a4ee['where'],{'$or':_['map'](_0x23a4ee['attributes'],function(_0x40c8ba){var _0x150212={};_0x150212[_0x40c8ba]={'$like':'%'+_0x51db9a['query'][_0xc53e('0x41')]+'%'};return _0x150212;})});}_0x23a4ee=_[_0xc53e('0x42')]({},_0x23a4ee,_0x51db9a[_0xc53e('0x46')]);return _0x32b390[_0xc53e('0x52')](_0x23a4ee);}})[_0xc53e('0x1e')](function(_0x20cb31){if(_0x20cb31){_0x4ee995=_0x20cb31['length'];if(!_0x51db9a['query'][_0xc53e('0x56')](_0xc53e('0x57'))){_0x23a4ee[_0xc53e('0x2c')]=qs[_0xc53e('0x2c')](_0x51db9a[_0xc53e('0x3a')][_0xc53e('0x2c')]);_0x23a4ee['offset']=qs[_0xc53e('0x2b')](_0x51db9a[_0xc53e('0x3a')][_0xc53e('0x2b')]);}return _0x32b390[_0xc53e('0x52')](_0x23a4ee);}})['then'](function(_0xdd851e){if(_0xdd851e){return _0xdd851e?{'count':_0x4ee995,'rows':_0xdd851e}:null;}})[_0xc53e('0x1e')](respondWithResult(_0x5c62c7,null))[_0xc53e('0x4a')](handleError(_0x5c62c7,null));};exports[_0xc53e('0x58')]=function(_0x32f954,_0x2d9803,_0x51638a){if(_0x32f954[_0xc53e('0x51')]['id']){delete _0x32f954[_0xc53e('0x51')]['id'];}return db[_0xc53e('0x35')][_0xc53e('0x53')]({'where':{'id':_0x32f954['params']['id']}})['then'](handleEntityNotFound(_0x2d9803,null))[_0xc53e('0x1e')](function(_0x340123){if(_0x340123){_0x32f954[_0xc53e('0x51')][_0xc53e('0x59')]=_0x340123['id'];_0x32f954['body'][_0xc53e('0x5a')]=integrations['getSubjects'](_0x32f954[_0xc53e('0x51')]['channel'],_0x32f954[_0xc53e('0x51')]['type']);_0x32f954[_0xc53e('0x51')][_0xc53e('0x5b')]=integrations['getDescriptions'](_0x32f954[_0xc53e('0x51')][_0xc53e('0x5c')],_0x32f954['body']['type']);return db[_0xc53e('0x54')][_0xc53e('0x50')](_0x32f954['body'],{'include':[{'model':db['SalesforceField'],'as':_0xc53e('0x5a')},{'model':db['SalesforceField'],'as':_0xc53e('0x5b')}]});}return null;})['then'](respondWithResult(_0x2d9803,null))[_0xc53e('0x4a')](handleError(_0x2d9803,null));};exports[_0xc53e('0x5d')]=function(_0x10167b,_0x388874,_0x45cee1){var _0x20067c;var _0x143f15='';var _0x15eac2=_0xc53e('0x5e');return db[_0xc53e('0x35')]['findOne']({'where':{'id':_0x10167b[_0xc53e('0x4c')]['id']},'attributes':['id','remoteUri',_0xc53e('0x5f'),_0xc53e('0x60'),_0xc53e('0x61'),_0xc53e('0x62'),_0xc53e('0x63')]})[_0xc53e('0x1e')](handleEntityNotFound(_0x388874,null))[_0xc53e('0x1e')](function(_0x3cc2c7){if(_0x3cc2c7){_0x143f15=_0x3cc2c7[_0xc53e('0x64')];var _0x1f572b=_0x143f15['slice'](-0x1);if(_0x1f572b==='/'){_0x143f15=_0x143f15[_0xc53e('0x65')](0x0,_0x143f15['lastIndexOf'](_0x1f572b));}_0x20067c=new jsforce[(_0xc53e('0x66'))]({'oauth2':{'loginUrl':_0x143f15,'clientId':_0x3cc2c7[_0xc53e('0x5f')],'clientSecret':_0x3cc2c7[_0xc53e('0x60')]}});return _0x20067c['login'](_0x3cc2c7[_0xc53e('0x61')],_0x3cc2c7[_0xc53e('0x62')][_0xc53e('0x67')](_0x3cc2c7[_0xc53e('0x63')]));}})[_0xc53e('0x1e')](function(_0x508671){if(_0x508671){if(!_[_0xc53e('0x68')](_0x10167b[_0xc53e('0x3a')]['ticketType'])){_0x15eac2=_0x10167b[_0xc53e('0x3a')][_0xc53e('0x69')];}return _0x20067c[_0xc53e('0x6a')](_0x15eac2)['describe']();}})[_0xc53e('0x1e')](function(_0x499725){var _0x49bed2=[_0xc53e('0x6b'),_0xc53e('0x6c'),'CallObject','CallType',_0xc53e('0x6d'),'Priority',_0xc53e('0x6e'),_0xc53e('0x6f')];if(!_[_0xc53e('0x68')](_0x10167b['query'][_0xc53e('0x69')])&&_0x10167b[_0xc53e('0x3a')][_0xc53e('0x69')]==='Case'){_0x49bed2=[_0xc53e('0x6f'),_0xc53e('0x70'),_0xc53e('0x71'),_0xc53e('0x6e'),_0xc53e('0x72'),'IsEscalated',_0xc53e('0x73'),_0xc53e('0x74')];}if(_0x499725){_[_0xc53e('0x75')](_0x499725[_0xc53e('0x4e')],function(_0xe6a976){return _0xe6a976[_0xc53e('0x76')]===![]&&!_0x49bed2[_0xc53e('0x77')](_0xe6a976[_0xc53e('0x32')]);});return{'count':_0x499725[_0xc53e('0x4e')]['length'],'rows':_[_0xc53e('0x34')](_0x499725[_0xc53e('0x4e')],function(_0x1c06bc){return{'id':_0x1c06bc[_0xc53e('0x32')],'name':_0x1c06bc[_0xc53e('0x78')],'custom':_0x1c06bc[_0xc53e('0x76')],'options':_0x1c06bc[_0xc53e('0x79')][_0xc53e('0x3e')]>0x0?_[_0xc53e('0x34')](_0x1c06bc['picklistValues'],function(_0x3a54ef){return{'name':_0x3a54ef[_0xc53e('0x78')],'value':_0x3a54ef[_0xc53e('0x7a')]};}):_0x1c06bc[_0xc53e('0x44')]=='boolean'?[{'name':_0xc53e('0x7b'),'value':_0xc53e('0x7c')},{'name':_0xc53e('0x7d'),'value':_0xc53e('0x7e')}]:[]};})};}})['then'](respondWithResult(_0x388874,null))[_0xc53e('0x4a')](function(_0x138870){var _0xa90198=_0x10167b[_0xc53e('0x3a')][_0xc53e('0x19')]?0x1f4:_0x138870[_0xc53e('0x7f')]||0x1f4;logger[_0xc53e('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0xc53e('0x5d'),_0xa90198,JSON['stringify'](_0x138870));delete _0x138870[_0xc53e('0x32')];if(_0xa90198===0x191){_0xa90198=0x190;}_0x388874[_0xc53e('0x29')](_0xa90198)[_0xc53e('0x33')](_0x10167b['query'][_0xc53e('0x19')]?{'message':_0xc53e('0x80'),'statusCode':_0x138870[_0xc53e('0x7f')]}:_0x138870);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index a5412d0..5f222f6 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 _0x6672=['../../config/logger','api','moment','bluebird','../../config/environment','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash'];(function(_0x4b0211,_0x17f347){var _0x1906fc=function(_0x9e2459){while(--_0x9e2459){_0x4b0211['push'](_0x4b0211['shift']());}};_0x1906fc(++_0x17f347);}(_0x6672,0x107));var _0x2667=function(_0x2f2a6f,_0xe63e10){_0x2f2a6f=_0x2f2a6f-0x0;var _0x14441d=_0x6672[_0x2f2a6f];return _0x14441d;};'use strict';var _=require(_0x2667('0x0'));var util=require('util');var logger=require(_0x2667('0x1'))(_0x2667('0x2'));var moment=require(_0x2667('0x3'));var BPromise=require(_0x2667('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2667('0x5'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x2667('0x6'));module[_0x2667('0x7')]=function(_0x5ae443,_0x2e1cf6){return _0x5ae443[_0x2667('0x8')](_0x2667('0x9'),attributes,{'tableName':_0x2667('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x986b=['SalesforceAccount','int_salesforce_accounts','lodash','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x1b6728,_0x681055){var _0x2af1d0=function(_0x3391dd){while(--_0x3391dd){_0x1b6728['push'](_0x1b6728['shift']());}};_0x2af1d0(++_0x681055);}(_0x986b,0x77));var _0xb986=function(_0x23fcec,_0x48ec4c){_0x23fcec=_0x23fcec-0x0;var _0x447567=_0x986b[_0x23fcec];return _0x447567;};'use strict';var _=require(_0xb986('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb986('0x1'));var BPromise=require(_0xb986('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb986('0x3'));var rimraf=require(_0xb986('0x4'));var config=require(_0xb986('0x5'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x537ec7,_0x18c75e){return _0x537ec7[_0xb986('0x6')](_0xb986('0x7'),attributes,{'tableName':_0xb986('0x8'),'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 2adddf4..dcbeaf4 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 _0xf72b=['then','debug','catch','ShowSalesforceAccount','find','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x49cfdd,_0x25a4f4){var _0x2fe375=function(_0x3bf6ed){while(--_0x3bf6ed){_0x49cfdd['push'](_0x49cfdd['shift']());}};_0x2fe375(++_0x25a4f4);}(_0xf72b,0x1d9));var _0xbf72=function(_0x367d55,_0x15bd4a){_0x367d55=_0x367d55-0x0;var _0x2c1db9=_0xf72b[_0x367d55];return _0x2c1db9;};'use strict';var _=require(_0xbf72('0x0'));var util=require('util');var moment=require(_0xbf72('0x1'));var BPromise=require('bluebird');var rs=require(_0xbf72('0x2'));var fs=require('fs');var Redis=require(_0xbf72('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf72('0x4'));var logger=require(_0xbf72('0x5'))(_0xbf72('0x6'));var config=require(_0xbf72('0x7'));var jayson=require(_0xbf72('0x8'));var client=jayson[_0xbf72('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41c11d,_0xc0842b,_0x119807){return new BPromise(function(_0xd0402c,_0xdd6177){return client[_0xbf72('0xa')](_0x41c11d,_0x119807)['then'](function(_0x455891){logger['info'](_0xbf72('0xb'),_0xc0842b,_0xbf72('0xc'));logger['debug'](_0xbf72('0xd'),_0xc0842b,_0xbf72('0xc'),JSON[_0xbf72('0xe')](_0x455891));if(_0x455891[_0xbf72('0xf')]){if(_0x455891[_0xbf72('0xf')][_0xbf72('0x10')]===0x1f4){logger[_0xbf72('0xf')](_0xbf72('0xb'),_0xc0842b,_0x455891['error'][_0xbf72('0x11')]);return _0xdd6177(_0x455891[_0xbf72('0xf')][_0xbf72('0x11')]);}logger['error'](_0xbf72('0xb'),_0xc0842b,_0x455891['error']['message']);return _0xd0402c(_0x455891['error'][_0xbf72('0x11')]);}else{logger[_0xbf72('0x12')](_0xbf72('0xb'),_0xc0842b,_0xbf72('0xc'));_0xd0402c(_0x455891[_0xbf72('0x13')][_0xbf72('0x11')]);}})['catch'](function(_0x266ce2){logger[_0xbf72('0xf')](_0xbf72('0xb'),_0xc0842b,_0x266ce2);_0xdd6177(_0x266ce2);});});}exports[_0xbf72('0x14')]=function(_0x27dadc){var _0x5b5fc9=this;return new Promise(function(_0x51d4c9,_0x1b8d73){return db[_0xbf72('0x15')][_0xbf72('0x16')]({'raw':_0x27dadc[_0xbf72('0x17')]?_0x27dadc[_0xbf72('0x17')][_0xbf72('0x18')]===undefined?!![]:![]:!![],'where':_0x27dadc[_0xbf72('0x17')]?_0x27dadc['options'][_0xbf72('0x19')]||null:null,'attributes':_0x27dadc[_0xbf72('0x17')]?_0x27dadc[_0xbf72('0x17')][_0xbf72('0x1a')]||null:null,'limit':_0x27dadc[_0xbf72('0x17')]?_0x27dadc['options'][_0xbf72('0x1b')]||null:null,'include':_0x27dadc[_0xbf72('0x17')]?_0x27dadc['options'][_0xbf72('0x1c')]?_[_0xbf72('0x1d')](_0x27dadc[_0xbf72('0x17')]['include'],function(_0x44f3f9){return{'model':db[_0x44f3f9[_0xbf72('0x1e')]],'as':_0x44f3f9['as'],'attributes':_0x44f3f9[_0xbf72('0x1a')],'include':_0x44f3f9[_0xbf72('0x1c')]?_['map'](_0x44f3f9[_0xbf72('0x1c')],function(_0x392a8c){return{'model':db[_0x392a8c[_0xbf72('0x1e')]],'as':_0x392a8c['as'],'attributes':_0x392a8c['attributes'],'include':_0x392a8c[_0xbf72('0x1c')]?_[_0xbf72('0x1d')](_0x392a8c[_0xbf72('0x1c')],function(_0x1a2f55){return{'model':db[_0x1a2f55[_0xbf72('0x1e')]],'as':_0x1a2f55['as'],'attributes':_0x1a2f55[_0xbf72('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbf72('0x1f')](function(_0x25ecdf){logger[_0xbf72('0x12')](_0xbf72('0x14'),_0x27dadc);logger[_0xbf72('0x20')](_0xbf72('0x14'),_0x27dadc,JSON[_0xbf72('0xe')](_0x25ecdf));_0x51d4c9(_0x25ecdf);})[_0xbf72('0x21')](function(_0x37a233){logger['error'](_0xbf72('0x14'),_0x37a233[_0xbf72('0x11')],_0x27dadc);_0x1b8d73(_0x5b5fc9[_0xbf72('0xf')](0x1f4,_0x37a233[_0xbf72('0x11')]));});});};exports[_0xbf72('0x22')]=function(_0x82c0f0){var _0x35ecdc=this;return new Promise(function(_0x209b2b,_0x1be26a){return db[_0xbf72('0x15')][_0xbf72('0x23')]({'raw':_0x82c0f0[_0xbf72('0x17')]?_0x82c0f0[_0xbf72('0x17')][_0xbf72('0x18')]===undefined?!![]:![]:!![],'where':_0x82c0f0['options']?_0x82c0f0[_0xbf72('0x17')][_0xbf72('0x19')]||null:null,'attributes':_0x82c0f0[_0xbf72('0x17')]?_0x82c0f0['options']['attributes']||null:null,'include':_0x82c0f0['options']?_0x82c0f0[_0xbf72('0x17')][_0xbf72('0x1c')]?_[_0xbf72('0x1d')](_0x82c0f0['options'][_0xbf72('0x1c')],function(_0x4c9662){return{'model':db[_0x4c9662['model']],'as':_0x4c9662['as'],'attributes':_0x4c9662[_0xbf72('0x1a')],'include':_0x4c9662['include']?_[_0xbf72('0x1d')](_0x4c9662[_0xbf72('0x1c')],function(_0x5c2f60){return{'model':db[_0x5c2f60['model']],'as':_0x5c2f60['as'],'attributes':_0x5c2f60[_0xbf72('0x1a')],'include':_0x5c2f60[_0xbf72('0x1c')]?_[_0xbf72('0x1d')](_0x5c2f60[_0xbf72('0x1c')],function(_0x297c59){return{'model':db[_0x297c59[_0xbf72('0x1e')]],'as':_0x297c59['as'],'attributes':_0x297c59[_0xbf72('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbf72('0x1f')](function(_0x269b8e){logger['info'](_0xbf72('0x22'),_0x82c0f0);logger[_0xbf72('0x20')](_0xbf72('0x22'),_0x82c0f0,JSON[_0xbf72('0xe')](_0x269b8e));_0x209b2b(_0x269b8e);})['catch'](function(_0xd0a1a8){logger[_0xbf72('0xf')]('ShowSalesforceAccount',_0xd0a1a8[_0xbf72('0x11')],_0x82c0f0);_0x1be26a(_0x35ecdc['error'](0x1f4,_0xd0a1a8['message']));});});}; \ No newline at end of file +var _0xf290=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetSalesforceAccount','findAll','options','raw','where','map','include','model','attributes','stringify','SalesforceAccount','ShowSalesforceAccount','util','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf290,0xde));var _0x0f29=function(_0x2eb3db,_0x4a32c0){_0x2eb3db=_0x2eb3db-0x0;var _0x358f33=_0xf290[_0x2eb3db];return _0x358f33;};'use strict';var _=require('lodash');var util=require(_0x0f29('0x0'));var moment=require('moment');var BPromise=require(_0x0f29('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f29('0x2'));var db=require(_0x0f29('0x3'))['db'];var utils=require(_0x0f29('0x4'));var logger=require(_0x0f29('0x5'))(_0x0f29('0x6'));var config=require('../../config/environment');var jayson=require(_0x0f29('0x7'));var client=jayson['client'][_0x0f29('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c45ec,_0x355e21,_0xaa2675){return new BPromise(function(_0xc78ca2,_0x45350b){return client[_0x0f29('0x9')](_0x1c45ec,_0xaa2675)[_0x0f29('0xa')](function(_0x376de4){logger[_0x0f29('0xb')](_0x0f29('0xc'),_0x355e21,_0x0f29('0xd'));logger[_0x0f29('0xe')](_0x0f29('0xf'),_0x355e21,_0x0f29('0xd'),JSON['stringify'](_0x376de4));if(_0x376de4[_0x0f29('0x10')]){if(_0x376de4['error'][_0x0f29('0x11')]===0x1f4){logger[_0x0f29('0x10')](_0x0f29('0xc'),_0x355e21,_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);return _0x45350b(_0x376de4[_0x0f29('0x10')]['message']);}logger[_0x0f29('0x10')](_0x0f29('0xc'),_0x355e21,_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);return _0xc78ca2(_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);}else{logger[_0x0f29('0xb')](_0x0f29('0xc'),_0x355e21,'request\x20sent');_0xc78ca2(_0x376de4['result'][_0x0f29('0x12')]);}})[_0x0f29('0x13')](function(_0x38031e){logger[_0x0f29('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x355e21,_0x38031e);_0x45350b(_0x38031e);});});}exports[_0x0f29('0x14')]=function(_0x5d72a5){var _0x17b994=this;return new Promise(function(_0x4ca5e8,_0x5ddc74){return db['SalesforceAccount'][_0x0f29('0x15')]({'raw':_0x5d72a5[_0x0f29('0x16')]?_0x5d72a5[_0x0f29('0x16')][_0x0f29('0x17')]===undefined?!![]:![]:!![],'where':_0x5d72a5[_0x0f29('0x16')]?_0x5d72a5[_0x0f29('0x16')][_0x0f29('0x18')]||null:null,'attributes':_0x5d72a5['options']?_0x5d72a5[_0x0f29('0x16')]['attributes']||null:null,'limit':_0x5d72a5['options']?_0x5d72a5['options']['limit']||null:null,'include':_0x5d72a5[_0x0f29('0x16')]?_0x5d72a5[_0x0f29('0x16')]['include']?_[_0x0f29('0x19')](_0x5d72a5[_0x0f29('0x16')][_0x0f29('0x1a')],function(_0x3402dc){return{'model':db[_0x3402dc[_0x0f29('0x1b')]],'as':_0x3402dc['as'],'attributes':_0x3402dc['attributes'],'include':_0x3402dc[_0x0f29('0x1a')]?_['map'](_0x3402dc[_0x0f29('0x1a')],function(_0x26f46f){return{'model':db[_0x26f46f[_0x0f29('0x1b')]],'as':_0x26f46f['as'],'attributes':_0x26f46f[_0x0f29('0x1c')],'include':_0x26f46f['include']?_[_0x0f29('0x19')](_0x26f46f['include'],function(_0x58b201){return{'model':db[_0x58b201[_0x0f29('0x1b')]],'as':_0x58b201['as'],'attributes':_0x58b201['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x57dcc7){logger['info'](_0x0f29('0x14'),_0x5d72a5);logger[_0x0f29('0xe')]('GetSalesforceAccount',_0x5d72a5,JSON[_0x0f29('0x1d')](_0x57dcc7));_0x4ca5e8(_0x57dcc7);})[_0x0f29('0x13')](function(_0x274c9d){logger['error']('GetSalesforceAccount',_0x274c9d[_0x0f29('0x12')],_0x5d72a5);_0x5ddc74(_0x17b994['error'](0x1f4,_0x274c9d[_0x0f29('0x12')]));});});};exports['ShowSalesforceAccount']=function(_0x526364){var _0x7b10f=this;return new Promise(function(_0x409b19,_0xf59431){return db[_0x0f29('0x1e')]['find']({'raw':_0x526364['options']?_0x526364[_0x0f29('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x526364['options']?_0x526364[_0x0f29('0x16')]['where']||null:null,'attributes':_0x526364[_0x0f29('0x16')]?_0x526364['options']['attributes']||null:null,'include':_0x526364[_0x0f29('0x16')]?_0x526364[_0x0f29('0x16')][_0x0f29('0x1a')]?_[_0x0f29('0x19')](_0x526364[_0x0f29('0x16')]['include'],function(_0x426a3e){return{'model':db[_0x426a3e['model']],'as':_0x426a3e['as'],'attributes':_0x426a3e[_0x0f29('0x1c')],'include':_0x426a3e[_0x0f29('0x1a')]?_[_0x0f29('0x19')](_0x426a3e[_0x0f29('0x1a')],function(_0x4852a5){return{'model':db[_0x4852a5[_0x0f29('0x1b')]],'as':_0x4852a5['as'],'attributes':_0x4852a5[_0x0f29('0x1c')],'include':_0x4852a5['include']?_[_0x0f29('0x19')](_0x4852a5[_0x0f29('0x1a')],function(_0x5e40ac){return{'model':db[_0x5e40ac['model']],'as':_0x5e40ac['as'],'attributes':_0x5e40ac[_0x0f29('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0f29('0xa')](function(_0x3691d4){logger[_0x0f29('0xb')](_0x0f29('0x1f'),_0x526364);logger[_0x0f29('0xe')]('ShowSalesforceAccount',_0x526364,JSON[_0x0f29('0x1d')](_0x3691d4));_0x409b19(_0x3691d4);})['catch'](function(_0x331dc7){logger['error'](_0x0f29('0x1f'),_0x331dc7[_0x0f29('0x12')],_0x526364);_0xf59431(_0x7b10f[_0x0f29('0x10')](0x1f4,_0x331dc7['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 22d08ef..2f8200b 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 _0xc337=['./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','update','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc337,0x170));var _0x7c33=function(_0x5ca268,_0x293286){_0x5ca268=_0x5ca268-0x0;var _0x52e674=_0xc337[_0x5ca268];return _0x52e674;};'use strict';var multer=require('multer');var util=require(_0x7c33('0x0'));var path=require(_0x7c33('0x1'));var timeout=require(_0x7c33('0x2'));var express=require(_0x7c33('0x3'));var router=express['Router']();var auth=require(_0x7c33('0x4'));var interaction=require(_0x7c33('0x5'));var config=require('../../config/environment');var controller=require(_0x7c33('0x6'));router[_0x7c33('0x7')]('/',auth[_0x7c33('0x8')](),controller[_0x7c33('0x9')]);router['get'](_0x7c33('0xa'),auth['isAuthenticated'](),controller[_0x7c33('0xb')]);router[_0x7c33('0x7')](_0x7c33('0xc'),auth[_0x7c33('0x8')](),controller[_0x7c33('0xd')]);router[_0x7c33('0x7')](_0x7c33('0xe'),auth['isAuthenticated'](),controller[_0x7c33('0xf')]);router['get'](_0x7c33('0x10'),auth['isAuthenticated'](),controller[_0x7c33('0x11')]);router[_0x7c33('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x7c33('0xa'),auth[_0x7c33('0x8')](),controller[_0x7c33('0x13')]);router['delete'](_0x7c33('0xa'),auth[_0x7c33('0x8')](),controller[_0x7c33('0x14')]);module[_0x7c33('0x15')]=router; \ No newline at end of file +var _0x765e=['/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index'];(function(_0x3c3116,_0x2c7065){var _0x3e17e7=function(_0x2453e3){while(--_0x2453e3){_0x3c3116['push'](_0x3c3116['shift']());}};_0x3e17e7(++_0x2c7065);}(_0x765e,0x18e));var _0xe765=function(_0x21b1e1,_0x2c01a6){_0x21b1e1=_0x21b1e1-0x0;var _0x17099f=_0x765e[_0x21b1e1];return _0x17099f;};'use strict';var multer=require('multer');var util=require(_0xe765('0x0'));var path=require(_0xe765('0x1'));var timeout=require(_0xe765('0x2'));var express=require('express');var router=express[_0xe765('0x3')]();var auth=require(_0xe765('0x4'));var interaction=require(_0xe765('0x5'));var config=require('../../config/environment');var controller=require(_0xe765('0x6'));router[_0xe765('0x7')]('/',auth[_0xe765('0x8')](),controller[_0xe765('0x9')]);router[_0xe765('0x7')](_0xe765('0xa'),auth[_0xe765('0x8')](),controller['show']);router[_0xe765('0x7')](_0xe765('0xb'),auth[_0xe765('0x8')](),controller[_0xe765('0xc')]);router[_0xe765('0x7')](_0xe765('0xd'),auth['isAuthenticated'](),controller[_0xe765('0xe')]);router[_0xe765('0x7')](_0xe765('0xf'),auth[_0xe765('0x8')](),controller[_0xe765('0x10')]);router[_0xe765('0x11')]('/',auth[_0xe765('0x8')](),controller[_0xe765('0x12')]);router[_0xe765('0x13')]('/:id',auth[_0xe765('0x8')](),controller[_0xe765('0x14')]);router[_0xe765('0x15')]('/:id',auth[_0xe765('0x8')](),controller[_0xe765('0x16')]);module[_0xe765('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 6674409..64be10e 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 _0xdc4d=['contact_lead','nothing','lead','sequelize','exports','STRING','ENUM','Case','contact'];(function(_0x1fa759,_0x4ecdce){var _0x2da9f4=function(_0x463e2a){while(--_0x463e2a){_0x1fa759['push'](_0x1fa759['shift']());}};_0x2da9f4(++_0x4ecdce);}(_0xdc4d,0xc0));var _0xddc4=function(_0x519bb9,_0x53a0ae){_0x519bb9=_0x519bb9-0x0;var _0x33ef17=_0xdc4d[_0x519bb9];return _0x33ef17;};'use strict';var Sequelize=require(_0xddc4('0x0'));module[_0xddc4('0x1')]={'name':{'type':Sequelize[_0xddc4('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xddc4('0x3')]('Task',_0xddc4('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xddc4('0x3')]('contact_lead',_0xddc4('0x5'),'lead'),'defaultValue':_0xddc4('0x6')},'moduleCreate':{'type':Sequelize[_0xddc4('0x3')](_0xddc4('0x7'),_0xddc4('0x5'),_0xddc4('0x8')),'defaultValue':_0xddc4('0x8')}}; \ No newline at end of file +var _0xe7b5=['contact','lead','sequelize','exports','STRING','ENUM','Task','Case','contact_lead','nothing'];(function(_0x28af8a,_0xd8ab0e){var _0x132c1b=function(_0x37e85e){while(--_0x37e85e){_0x28af8a['push'](_0x28af8a['shift']());}};_0x132c1b(++_0xd8ab0e);}(_0xe7b5,0x156));var _0x5e7b=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xe7b5[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x5e7b('0x0'));module[_0x5e7b('0x1')]={'name':{'type':Sequelize[_0x5e7b('0x2')]},'description':{'type':Sequelize[_0x5e7b('0x2')]},'ticketType':{'type':Sequelize[_0x5e7b('0x3')](_0x5e7b('0x4'),_0x5e7b('0x5')),'defaultValue':_0x5e7b('0x4')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead','contact','lead'),'defaultValue':_0x5e7b('0x6')},'moduleCreate':{'type':Sequelize[_0x5e7b('0x3')](_0x5e7b('0x7'),_0x5e7b('0x8'),_0x5e7b('0x9')),'defaultValue':'lead'}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 14d1d10..0e9e154 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 _0x4e06=['offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','body','getFields','findOne','SalesforceField','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../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','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count'];(function(_0x39fb91,_0x13635f){var _0x1d764a=function(_0x3a1ece){while(--_0x3a1ece){_0x39fb91['push'](_0x39fb91['shift']());}};_0x1d764a(++_0x13635f);}(_0x4e06,0xec));var _0x64e0=function(_0x10f316,_0x5822db){_0x10f316=_0x10f316-0x0;var _0x568d7e=_0x4e06[_0x10f316];return _0x568d7e;};'use strict';var pdf=require(_0x64e0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x64e0('0x1'));var zipdir=require(_0x64e0('0x2'));var jsonpatch=require(_0x64e0('0x3'));var rp=require(_0x64e0('0x4'));var moment=require(_0x64e0('0x5'));var BPromise=require(_0x64e0('0x6'));var Mustache=require(_0x64e0('0x7'));var util=require(_0x64e0('0x8'));var path=require(_0x64e0('0x9'));var sox=require(_0x64e0('0xa'));var csv=require(_0x64e0('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x64e0('0xc'));var crypto=require('crypto');var jsforce=require(_0x64e0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x64e0('0xb'));var querystring=require(_0x64e0('0xe'));var Papa=require(_0x64e0('0xf'));var Redis=require(_0x64e0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x64e0('0x11'));var as=require(_0x64e0('0x12'));var hardwareService=require(_0x64e0('0x13'));var logger=require('../../config/logger')(_0x64e0('0x14'));var utils=require(_0x64e0('0x15'));var config=require(_0x64e0('0x16'));var db=require(_0x64e0('0x17'))['db'];var jayson=require(_0x64e0('0x18'));var client=jayson[_0x64e0('0x19')][_0x64e0('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x1bcc18,_0x425990,_0x25f496){if(_0x25f496){var _0xdc92f4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xdc92f4[_0x64e0('0x1b')](_0x425990)){return _0x1bcc18;}else{throw new db[(_0x64e0('0x1c'))][(_0x64e0('0x1d'))](_0x64e0('0x1e'));}}else{return _0x1bcc18;}}function respondWithRpcPromise(_0x1c3481,_0x4f9f9c,_0x29c596,_0x2ff606){return new BPromise(function(_0x144cca,_0x2ae109){var _0x5cec18=_0x2ff606||client;return _0x5cec18[_0x64e0('0x1f')](_0x1c3481,_0x29c596)['then'](function(_0x1c977a){logger[_0x64e0('0x20')](_0x64e0('0x21'),_0x4f9f9c,_0x64e0('0x22'));logger['debug'](_0x64e0('0x23'),_0x4f9f9c,_0x64e0('0x22'),JSON['stringify'](_0x1c977a));if(_0x1c977a[_0x64e0('0x24')]){if(_0x1c977a[_0x64e0('0x24')][_0x64e0('0x25')]===0x1f4){logger[_0x64e0('0x24')](_0x64e0('0x21'),_0x4f9f9c,_0x1c977a[_0x64e0('0x24')][_0x64e0('0x26')]);return _0x2ae109(_0x1c977a['error']['message']);}logger['error'](_0x64e0('0x21'),_0x4f9f9c,_0x1c977a[_0x64e0('0x24')][_0x64e0('0x26')]);return _0x144cca(_0x1c977a[_0x64e0('0x24')][_0x64e0('0x26')]);}else{logger[_0x64e0('0x20')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4f9f9c,_0x64e0('0x22'));_0x144cca(_0x1c977a[_0x64e0('0x27')][_0x64e0('0x26')]);}})[_0x64e0('0x28')](function(_0x36b95c){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x4f9f9c,_0x36b95c);_0x2ae109(_0x36b95c);});});}function respondWithStatusCode(_0x49e145,_0x1b6fb0){_0x1b6fb0=_0x1b6fb0||0xcc;return function(_0x25e1ba){if(_0x25e1ba){return _0x49e145[_0x64e0('0x29')](_0x1b6fb0);}return _0x49e145[_0x64e0('0x2a')](_0x1b6fb0)[_0x64e0('0x2b')]();};}function respondWithResult(_0x5102af,_0x595ab6){_0x595ab6=_0x595ab6||0xc8;return function(_0x4b6ae4){if(_0x4b6ae4){return _0x5102af[_0x64e0('0x2a')](_0x595ab6)[_0x64e0('0x2c')](_0x4b6ae4);}};}function respondWithFilteredResult(_0x40a359,_0xa68aad){return function(_0x41c6ab){if(_0x41c6ab){var _0x2da3cf=_0x41c6ab[_0x64e0('0x2d')],_0x129759=_0xa68aad['offset'],_0x91f39=_0xa68aad[_0x64e0('0x2e')]+_0xa68aad[_0x64e0('0x2f')],_0x3c5eec;if(_0x91f39>=_0x2da3cf){_0x91f39=_0x2da3cf;_0x3c5eec=0xc8;}else{_0x3c5eec=0xce;}_0x40a359[_0x64e0('0x2a')](_0x3c5eec);return _0x40a359[_0x64e0('0x30')](_0x64e0('0x31'),_0x129759+'-'+_0x91f39+'/'+_0x2da3cf)[_0x64e0('0x2c')](_0x41c6ab);}return null;};}function patchUpdates(_0x2067b0){return function(_0x4b5956){try{jsonpatch[_0x64e0('0x32')](_0x4b5956,_0x2067b0,!![]);}catch(_0xad98b){return BPromise[_0x64e0('0x33')](_0xad98b);}return _0x4b5956['save']();};}function saveUpdates(_0x2ccccc,_0x550494){return function(_0x5f4e1f){if(_0x5f4e1f){return _0x5f4e1f[_0x64e0('0x34')](_0x2ccccc)[_0x64e0('0x35')](function(_0x13005b){return _0x13005b;});}return null;};}function removeEntity(_0x4a1259,_0x37eb99){return function(_0x3f4c90){if(_0x3f4c90){return _0x3f4c90[_0x64e0('0x36')]()[_0x64e0('0x35')](function(){_0x4a1259['status'](0xcc)[_0x64e0('0x2b')]();});}};}function handleEntityNotFound(_0x8a6b48,_0x54f3c7){return function(_0x3dae4c){if(!_0x3dae4c){_0x8a6b48['sendStatus'](0x194);}return _0x3dae4c;};}function handleError(_0x5b1192,_0x2fb87a){_0x2fb87a=_0x2fb87a||0x1f4;return function(_0x56f685){logger[_0x64e0('0x24')](_0x56f685[_0x64e0('0x37')]);if(_0x56f685[_0x64e0('0x38')]){delete _0x56f685[_0x64e0('0x38')];}_0x5b1192[_0x64e0('0x2a')](_0x2fb87a)['send'](_0x56f685);};}exports['index']=function(_0x338188,_0x2a7b23){var _0x53d6f6={},_0x38b309={},_0x2cc4e8={'count':0x0,'rows':[]};var _0x3ee976=_[_0x64e0('0x39')](db[_0x64e0('0x3a')][_0x64e0('0x3b')],function(_0x364b57){return{'name':_0x364b57[_0x64e0('0x3c')],'type':_0x364b57[_0x64e0('0x3d')][_0x64e0('0x3e')]};});_0x38b309[_0x64e0('0x3f')]=_[_0x64e0('0x39')](_0x3ee976,'name');_0x38b309[_0x64e0('0x40')]=_[_0x64e0('0x41')](_0x338188[_0x64e0('0x40')]);_0x38b309[_0x64e0('0x42')]=_['intersection'](_0x38b309[_0x64e0('0x3f')],_0x38b309['query']);_0x53d6f6['attributes']=_[_0x64e0('0x43')](_0x38b309[_0x64e0('0x3f')],qs[_0x64e0('0x44')](_0x338188[_0x64e0('0x40')]['fields']));_0x53d6f6[_0x64e0('0x45')]=_0x53d6f6[_0x64e0('0x45')][_0x64e0('0x46')]?_0x53d6f6[_0x64e0('0x45')]:_0x38b309[_0x64e0('0x3f')];if(!_0x338188[_0x64e0('0x40')][_0x64e0('0x47')](_0x64e0('0x48'))){_0x53d6f6['limit']=qs[_0x64e0('0x2f')](_0x338188['query'][_0x64e0('0x2f')]);_0x53d6f6[_0x64e0('0x2e')]=qs[_0x64e0('0x2e')](_0x338188[_0x64e0('0x40')][_0x64e0('0x2e')]);}_0x53d6f6[_0x64e0('0x49')]=qs[_0x64e0('0x4a')](_0x338188[_0x64e0('0x40')]['sort']);_0x53d6f6[_0x64e0('0x4b')]=qs['filters'](_[_0x64e0('0x4c')](_0x338188[_0x64e0('0x40')],_0x38b309['filters']));if(_0x338188['query'][_0x64e0('0x4d')]){_0x53d6f6[_0x64e0('0x4b')]=_[_0x64e0('0x4e')](_0x53d6f6['where'],{'$or':_[_0x64e0('0x39')](_0x3ee976,function(_0x3516bc){if(_0x3516bc['type']!==_0x64e0('0x4f')){var _0x51e5fb={};_0x51e5fb[_0x3516bc[_0x64e0('0x38')]]={'$like':'%'+_0x338188[_0x64e0('0x40')][_0x64e0('0x4d')]+'%'};return _0x51e5fb;}})});}_0x53d6f6=_['merge']({},_0x53d6f6,_0x338188[_0x64e0('0x50')]);var _0xd18799={'where':_0x53d6f6[_0x64e0('0x4b')]};return db[_0x64e0('0x3a')]['count'](_0xd18799)[_0x64e0('0x35')](function(_0x2e6ff7){_0x2cc4e8['count']=_0x2e6ff7;if(_0x338188[_0x64e0('0x40')][_0x64e0('0x51')]){_0x53d6f6[_0x64e0('0x52')]=[{'all':!![]}];}return db[_0x64e0('0x3a')][_0x64e0('0x53')](_0x53d6f6);})[_0x64e0('0x35')](function(_0x40f091){_0x2cc4e8['rows']=_0x40f091;return _0x2cc4e8;})[_0x64e0('0x35')](respondWithFilteredResult(_0x2a7b23,_0x53d6f6))['catch'](handleError(_0x2a7b23,null));};exports[_0x64e0('0x54')]=function(_0x49b4f7,_0x9e9097){var _0x426a56={'raw':![],'where':{'id':_0x49b4f7[_0x64e0('0x55')]['id']}},_0x3a391c={};_0x3a391c[_0x64e0('0x3f')]=_['keys'](db['SalesforceConfiguration']['rawAttributes']);_0x3a391c[_0x64e0('0x40')]=_[_0x64e0('0x41')](_0x49b4f7[_0x64e0('0x40')]);_0x3a391c[_0x64e0('0x42')]=_[_0x64e0('0x43')](_0x3a391c[_0x64e0('0x3f')],_0x3a391c[_0x64e0('0x40')]);_0x426a56[_0x64e0('0x45')]=_[_0x64e0('0x43')](_0x3a391c['model'],qs['fields'](_0x49b4f7[_0x64e0('0x40')][_0x64e0('0x44')]));_0x426a56['attributes']=_0x426a56[_0x64e0('0x45')][_0x64e0('0x46')]?_0x426a56[_0x64e0('0x45')]:_0x3a391c[_0x64e0('0x3f')];if(_0x49b4f7['query']['includeAll']){_0x426a56[_0x64e0('0x52')]=[{'all':!![]}];}_0x426a56=_[_0x64e0('0x4e')]({},_0x426a56,_0x49b4f7[_0x64e0('0x50')]);return db[_0x64e0('0x3a')][_0x64e0('0x56')](_0x426a56)[_0x64e0('0x35')](handleEntityNotFound(_0x9e9097,null))[_0x64e0('0x35')](respondWithResult(_0x9e9097,null))[_0x64e0('0x28')](handleError(_0x9e9097,null));};exports[_0x64e0('0x57')]=function(_0x445aa4,_0x32e981){return db[_0x64e0('0x3a')]['create'](_0x445aa4['body'],{})[_0x64e0('0x35')](respondWithResult(_0x32e981,0xc9))['catch'](handleError(_0x32e981,null));};exports[_0x64e0('0x34')]=function(_0x30bb35,_0xb2ac77){if(_0x30bb35[_0x64e0('0x58')]['id']){delete _0x30bb35[_0x64e0('0x58')]['id'];}return db[_0x64e0('0x3a')][_0x64e0('0x56')]({'where':{'id':_0x30bb35['params']['id']}})[_0x64e0('0x35')](handleEntityNotFound(_0xb2ac77,null))[_0x64e0('0x35')](saveUpdates(_0x30bb35[_0x64e0('0x58')],null))['then'](respondWithResult(_0xb2ac77,null))[_0x64e0('0x28')](handleError(_0xb2ac77,null));};exports[_0x64e0('0x36')]=function(_0x2d8b31,_0x1e27b5){return db[_0x64e0('0x3a')]['find']({'where':{'id':_0x2d8b31[_0x64e0('0x55')]['id']}})[_0x64e0('0x35')](handleEntityNotFound(_0x1e27b5,null))['then'](removeEntity(_0x1e27b5,null))[_0x64e0('0x28')](handleError(_0x1e27b5,null));};exports[_0x64e0('0x59')]=function(_0x3a291c,_0x15f2df,_0x3f4706){var _0x58478a={};var _0x12f605={};var _0x12b8ce;var _0x1ea391;return db['SalesforceConfiguration'][_0x64e0('0x5a')]({'where':{'id':_0x3a291c[_0x64e0('0x55')]['id']}})[_0x64e0('0x35')](handleEntityNotFound(_0x15f2df,null))[_0x64e0('0x35')](function(_0x58ebd8){if(_0x58ebd8){_0x12b8ce=_0x58ebd8;_0x12f605[_0x64e0('0x3f')]=_[_0x64e0('0x41')](db[_0x64e0('0x5b')][_0x64e0('0x3b')]);_0x12f605[_0x64e0('0x40')]=_[_0x64e0('0x41')](_0x3a291c[_0x64e0('0x40')]);_0x12f605[_0x64e0('0x42')]=_[_0x64e0('0x43')](_0x12f605[_0x64e0('0x3f')],_0x12f605['query']);_0x58478a[_0x64e0('0x45')]=_[_0x64e0('0x43')](_0x12f605[_0x64e0('0x3f')],qs['fields'](_0x3a291c[_0x64e0('0x40')][_0x64e0('0x44')]));_0x58478a[_0x64e0('0x45')]=_0x58478a[_0x64e0('0x45')]['length']?_0x58478a[_0x64e0('0x45')]:_0x12f605['model'];_0x58478a[_0x64e0('0x49')]=qs[_0x64e0('0x4a')](_0x3a291c['query'][_0x64e0('0x4a')]);_0x58478a['where']=qs[_0x64e0('0x42')](_[_0x64e0('0x4c')](_0x3a291c['query'],_0x12f605[_0x64e0('0x42')]));if(_0x3a291c[_0x64e0('0x40')]['filter']){_0x58478a[_0x64e0('0x4b')]=_[_0x64e0('0x4e')](_0x58478a[_0x64e0('0x4b')],{'$or':_[_0x64e0('0x39')](_0x58478a[_0x64e0('0x45')],function(_0x284952){var _0x4f7d57={};_0x4f7d57[_0x284952]={'$like':'%'+_0x3a291c['query'][_0x64e0('0x4d')]+'%'};return _0x4f7d57;})});}_0x58478a=_[_0x64e0('0x4e')]({},_0x58478a,_0x3a291c['options']);return _0x12b8ce[_0x64e0('0x59')](_0x58478a);}})[_0x64e0('0x35')](function(_0x45962d){if(_0x45962d){_0x1ea391=_0x45962d[_0x64e0('0x46')];if(!_0x3a291c[_0x64e0('0x40')][_0x64e0('0x47')](_0x64e0('0x48'))){_0x58478a[_0x64e0('0x2f')]=qs[_0x64e0('0x2f')](_0x3a291c[_0x64e0('0x40')][_0x64e0('0x2f')]);_0x58478a[_0x64e0('0x2e')]=qs[_0x64e0('0x2e')](_0x3a291c[_0x64e0('0x40')][_0x64e0('0x2e')]);}return _0x12b8ce[_0x64e0('0x59')](_0x58478a);}})['then'](function(_0x5d6040){if(_0x5d6040){return _0x5d6040?{'count':_0x1ea391,'rows':_0x5d6040}:null;}})[_0x64e0('0x35')](respondWithResult(_0x15f2df,null))['catch'](handleError(_0x15f2df,null));};exports[_0x64e0('0x5c')]=function(_0x30c857,_0x366e40,_0x418876){var _0x246561={};var _0x1fb147={};var _0x354a71;var _0xb74f99;return db[_0x64e0('0x3a')]['findOne']({'where':{'id':_0x30c857[_0x64e0('0x55')]['id']}})[_0x64e0('0x35')](handleEntityNotFound(_0x366e40,null))[_0x64e0('0x35')](function(_0x4d3f40){if(_0x4d3f40){_0x354a71=_0x4d3f40;_0x1fb147[_0x64e0('0x3f')]=_[_0x64e0('0x41')](db[_0x64e0('0x5b')][_0x64e0('0x3b')]);_0x1fb147[_0x64e0('0x40')]=_[_0x64e0('0x41')](_0x30c857[_0x64e0('0x40')]);_0x1fb147[_0x64e0('0x42')]=_['intersection'](_0x1fb147[_0x64e0('0x3f')],_0x1fb147[_0x64e0('0x40')]);_0x246561['attributes']=_['intersection'](_0x1fb147['model'],qs[_0x64e0('0x44')](_0x30c857[_0x64e0('0x40')][_0x64e0('0x44')]));_0x246561[_0x64e0('0x45')]=_0x246561['attributes'][_0x64e0('0x46')]?_0x246561[_0x64e0('0x45')]:_0x1fb147['model'];_0x246561[_0x64e0('0x49')]=qs[_0x64e0('0x4a')](_0x30c857[_0x64e0('0x40')][_0x64e0('0x4a')]);_0x246561[_0x64e0('0x4b')]=qs['filters'](_[_0x64e0('0x4c')](_0x30c857['query'],_0x1fb147[_0x64e0('0x42')]));if(_0x30c857['query'][_0x64e0('0x4d')]){_0x246561[_0x64e0('0x4b')]=_[_0x64e0('0x4e')](_0x246561[_0x64e0('0x4b')],{'$or':_[_0x64e0('0x39')](_0x246561[_0x64e0('0x45')],function(_0x183ddb){var _0x4cc7e5={};_0x4cc7e5[_0x183ddb]={'$like':'%'+_0x30c857[_0x64e0('0x40')][_0x64e0('0x4d')]+'%'};return _0x4cc7e5;})});}_0x246561=_[_0x64e0('0x4e')]({},_0x246561,_0x30c857[_0x64e0('0x50')]);return _0x354a71[_0x64e0('0x5c')](_0x246561);}})[_0x64e0('0x35')](function(_0x11831a){if(_0x11831a){_0xb74f99=_0x11831a[_0x64e0('0x46')];if(!_0x30c857[_0x64e0('0x40')][_0x64e0('0x47')](_0x64e0('0x48'))){_0x246561[_0x64e0('0x2f')]=qs[_0x64e0('0x2f')](_0x30c857['query'][_0x64e0('0x2f')]);_0x246561[_0x64e0('0x2e')]=qs[_0x64e0('0x2e')](_0x30c857[_0x64e0('0x40')][_0x64e0('0x2e')]);}return _0x354a71['getSubjects'](_0x246561);}})[_0x64e0('0x35')](function(_0x4b4af5){if(_0x4b4af5){return _0x4b4af5?{'count':_0xb74f99,'rows':_0x4b4af5}:null;}})['then'](respondWithResult(_0x366e40,null))['catch'](handleError(_0x366e40,null));};exports[_0x64e0('0x5d')]=function(_0x223861,_0x54ea90,_0xbce7a0){var _0xa83cd9={};var _0x45d068={};var _0x39e55a;var _0x1eafc0;return db[_0x64e0('0x3a')]['findOne']({'where':{'id':_0x223861[_0x64e0('0x55')]['id']}})['then'](handleEntityNotFound(_0x54ea90,null))[_0x64e0('0x35')](function(_0x209f5b){if(_0x209f5b){_0x39e55a=_0x209f5b;_0x45d068[_0x64e0('0x3f')]=_[_0x64e0('0x41')](db[_0x64e0('0x5b')][_0x64e0('0x3b')]);_0x45d068[_0x64e0('0x40')]=_['keys'](_0x223861[_0x64e0('0x40')]);_0x45d068[_0x64e0('0x42')]=_[_0x64e0('0x43')](_0x45d068[_0x64e0('0x3f')],_0x45d068[_0x64e0('0x40')]);_0xa83cd9[_0x64e0('0x45')]=_[_0x64e0('0x43')](_0x45d068['model'],qs[_0x64e0('0x44')](_0x223861[_0x64e0('0x40')][_0x64e0('0x44')]));_0xa83cd9[_0x64e0('0x45')]=_0xa83cd9[_0x64e0('0x45')][_0x64e0('0x46')]?_0xa83cd9[_0x64e0('0x45')]:_0x45d068[_0x64e0('0x3f')];_0xa83cd9['order']=qs[_0x64e0('0x4a')](_0x223861[_0x64e0('0x40')][_0x64e0('0x4a')]);_0xa83cd9[_0x64e0('0x4b')]=qs[_0x64e0('0x42')](_['pick'](_0x223861[_0x64e0('0x40')],_0x45d068[_0x64e0('0x42')]));if(_0x223861[_0x64e0('0x40')]['filter']){_0xa83cd9['where']=_[_0x64e0('0x4e')](_0xa83cd9[_0x64e0('0x4b')],{'$or':_[_0x64e0('0x39')](_0xa83cd9[_0x64e0('0x45')],function(_0x10afba){var _0x5b2c0c={};_0x5b2c0c[_0x10afba]={'$like':'%'+_0x223861['query']['filter']+'%'};return _0x5b2c0c;})});}_0xa83cd9=_[_0x64e0('0x4e')]({},_0xa83cd9,_0x223861[_0x64e0('0x50')]);return _0x39e55a[_0x64e0('0x5d')](_0xa83cd9);}})[_0x64e0('0x35')](function(_0x2f4c99){if(_0x2f4c99){_0x1eafc0=_0x2f4c99[_0x64e0('0x46')];if(!_0x223861[_0x64e0('0x40')][_0x64e0('0x47')](_0x64e0('0x48'))){_0xa83cd9[_0x64e0('0x2f')]=qs[_0x64e0('0x2f')](_0x223861[_0x64e0('0x40')][_0x64e0('0x2f')]);_0xa83cd9[_0x64e0('0x2e')]=qs[_0x64e0('0x2e')](_0x223861[_0x64e0('0x40')][_0x64e0('0x2e')]);}return _0x39e55a[_0x64e0('0x5d')](_0xa83cd9);}})[_0x64e0('0x35')](function(_0x52d8b5){if(_0x52d8b5){return _0x52d8b5?{'count':_0x1eafc0,'rows':_0x52d8b5}:null;}})['then'](respondWithResult(_0x54ea90,null))[_0x64e0('0x28')](handleError(_0x54ea90,null));}; \ No newline at end of file +var _0x60b9=['../../components/auth/service','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','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','json','count','offset','limit','set','reject','save','update','destroy','end','stack','index','map','fieldName','type','key','model','name','query','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','merge','where','VIRTUAL','SalesforceConfiguration','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','options','find','create','body','params','getFields','findOne','SalesforceField','filter','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','ioredis'];(function(_0x3d2673,_0x4b94e5){var _0x7bab49=function(_0x4cc272){while(--_0x4cc272){_0x3d2673['push'](_0x3d2673['shift']());}};_0x7bab49(++_0x4b94e5);}(_0x60b9,0x106));var _0x960b=function(_0x4a104b,_0x5b35ea){_0x4a104b=_0x4a104b-0x0;var _0x3bc4aa=_0x60b9[_0x4a104b];return _0x3bc4aa;};'use strict';var pdf=require(_0x960b('0x0'));var emlformat=require(_0x960b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x960b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x960b('0x3'));var moment=require(_0x960b('0x4'));var BPromise=require(_0x960b('0x5'));var Mustache=require(_0x960b('0x6'));var util=require(_0x960b('0x7'));var path=require(_0x960b('0x8'));var sox=require(_0x960b('0x9'));var csv=require('to-csv');var ejs=require(_0x960b('0xa'));var fs=require('fs');var _=require(_0x960b('0xb'));var squel=require(_0x960b('0xc'));var crypto=require(_0x960b('0xd'));var jsforce=require(_0x960b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x960b('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x960b('0x10'));var authService=require(_0x960b('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x960b('0x12'));var utils=require('../../config/utils');var config=require(_0x960b('0x13'));var db=require(_0x960b('0x14'))['db'];var jayson=require(_0x960b('0x15'));var client=jayson[_0x960b('0x16')][_0x960b('0x17')]({'port':0x232a});function checkPasswordPattern(_0x989e54,_0x158d5c,_0x223f8a){if(_0x223f8a){var _0x2d7f82=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2d7f82[_0x960b('0x18')](_0x158d5c)){return _0x989e54;}else{throw new db[(_0x960b('0x19'))][(_0x960b('0x1a'))](_0x960b('0x1b'));}}else{return _0x989e54;}}function respondWithRpcPromise(_0x2717ce,_0x2eec86,_0x15b975,_0x11e0cb){return new BPromise(function(_0x375207,_0x24a603){var _0x4d6d7b=_0x11e0cb||client;return _0x4d6d7b[_0x960b('0x1c')](_0x2717ce,_0x15b975)[_0x960b('0x1d')](function(_0x7257b0){logger[_0x960b('0x1e')](_0x960b('0x1f'),_0x2eec86,_0x960b('0x20'));logger[_0x960b('0x21')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x2eec86,_0x960b('0x20'),JSON[_0x960b('0x22')](_0x7257b0));if(_0x7257b0[_0x960b('0x23')]){if(_0x7257b0[_0x960b('0x23')][_0x960b('0x24')]===0x1f4){logger[_0x960b('0x23')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2eec86,_0x7257b0[_0x960b('0x23')]['message']);return _0x24a603(_0x7257b0[_0x960b('0x23')][_0x960b('0x25')]);}logger[_0x960b('0x23')](_0x960b('0x1f'),_0x2eec86,_0x7257b0[_0x960b('0x23')][_0x960b('0x25')]);return _0x375207(_0x7257b0[_0x960b('0x23')]['message']);}else{logger[_0x960b('0x1e')](_0x960b('0x1f'),_0x2eec86,_0x960b('0x20'));_0x375207(_0x7257b0[_0x960b('0x26')][_0x960b('0x25')]);}})['catch'](function(_0x37b3a6){logger[_0x960b('0x23')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2eec86,_0x37b3a6);_0x24a603(_0x37b3a6);});});}function respondWithStatusCode(_0xbf45fb,_0x14d2e6){_0x14d2e6=_0x14d2e6||0xcc;return function(_0x23dec4){if(_0x23dec4){return _0xbf45fb[_0x960b('0x27')](_0x14d2e6);}return _0xbf45fb['status'](_0x14d2e6)['end']();};}function respondWithResult(_0x3195be,_0x2402c2){_0x2402c2=_0x2402c2||0xc8;return function(_0x10c988){if(_0x10c988){return _0x3195be[_0x960b('0x28')](_0x2402c2)[_0x960b('0x29')](_0x10c988);}};}function respondWithFilteredResult(_0x5457d3,_0x2907ca){return function(_0x5f201b){if(_0x5f201b){var _0x23ce27=_0x5f201b[_0x960b('0x2a')],_0x4fa2da=_0x2907ca[_0x960b('0x2b')],_0x275e0b=_0x2907ca[_0x960b('0x2b')]+_0x2907ca[_0x960b('0x2c')],_0xdb0eaa;if(_0x275e0b>=_0x23ce27){_0x275e0b=_0x23ce27;_0xdb0eaa=0xc8;}else{_0xdb0eaa=0xce;}_0x5457d3[_0x960b('0x28')](_0xdb0eaa);return _0x5457d3[_0x960b('0x2d')]('Content-Range',_0x4fa2da+'-'+_0x275e0b+'/'+_0x23ce27)[_0x960b('0x29')](_0x5f201b);}return null;};}function patchUpdates(_0x98482a){return function(_0x22c754){try{jsonpatch['apply'](_0x22c754,_0x98482a,!![]);}catch(_0x278bd3){return BPromise[_0x960b('0x2e')](_0x278bd3);}return _0x22c754[_0x960b('0x2f')]();};}function saveUpdates(_0xb03727,_0x93154f){return function(_0x1b2383){if(_0x1b2383){return _0x1b2383[_0x960b('0x30')](_0xb03727)[_0x960b('0x1d')](function(_0x5e75c3){return _0x5e75c3;});}return null;};}function removeEntity(_0xa24c4a,_0x4b8d8f){return function(_0x1aa3f9){if(_0x1aa3f9){return _0x1aa3f9[_0x960b('0x31')]()['then'](function(){_0xa24c4a['status'](0xcc)[_0x960b('0x32')]();});}};}function handleEntityNotFound(_0xe4c130,_0x49cbe1){return function(_0x95c64a){if(!_0x95c64a){_0xe4c130[_0x960b('0x27')](0x194);}return _0x95c64a;};}function handleError(_0x75bfaa,_0xb11562){_0xb11562=_0xb11562||0x1f4;return function(_0xd6ac12){logger[_0x960b('0x23')](_0xd6ac12[_0x960b('0x33')]);if(_0xd6ac12['name']){delete _0xd6ac12['name'];}_0x75bfaa[_0x960b('0x28')](_0xb11562)['send'](_0xd6ac12);};}exports[_0x960b('0x34')]=function(_0x55c300,_0x526ae6){var _0x1d3c68={},_0x5dfffa={},_0x57740d={'count':0x0,'rows':[]};var _0x34fb7d=_[_0x960b('0x35')](db['SalesforceConfiguration']['rawAttributes'],function(_0x25cc70){return{'name':_0x25cc70[_0x960b('0x36')],'type':_0x25cc70[_0x960b('0x37')][_0x960b('0x38')]};});_0x5dfffa[_0x960b('0x39')]=_[_0x960b('0x35')](_0x34fb7d,_0x960b('0x3a'));_0x5dfffa[_0x960b('0x3b')]=_['keys'](_0x55c300[_0x960b('0x3b')]);_0x5dfffa[_0x960b('0x3c')]=_['intersection'](_0x5dfffa[_0x960b('0x39')],_0x5dfffa[_0x960b('0x3b')]);_0x1d3c68[_0x960b('0x3d')]=_[_0x960b('0x3e')](_0x5dfffa['model'],qs[_0x960b('0x3f')](_0x55c300[_0x960b('0x3b')]['fields']));_0x1d3c68[_0x960b('0x3d')]=_0x1d3c68['attributes'][_0x960b('0x40')]?_0x1d3c68['attributes']:_0x5dfffa[_0x960b('0x39')];if(!_0x55c300['query']['hasOwnProperty'](_0x960b('0x41'))){_0x1d3c68[_0x960b('0x2c')]=qs[_0x960b('0x2c')](_0x55c300['query'][_0x960b('0x2c')]);_0x1d3c68[_0x960b('0x2b')]=qs[_0x960b('0x2b')](_0x55c300[_0x960b('0x3b')][_0x960b('0x2b')]);}_0x1d3c68[_0x960b('0x42')]=qs[_0x960b('0x43')](_0x55c300[_0x960b('0x3b')][_0x960b('0x43')]);_0x1d3c68['where']=qs['filters'](_[_0x960b('0x44')](_0x55c300['query'],_0x5dfffa[_0x960b('0x3c')]));if(_0x55c300[_0x960b('0x3b')]['filter']){_0x1d3c68['where']=_[_0x960b('0x45')](_0x1d3c68[_0x960b('0x46')],{'$or':_[_0x960b('0x35')](_0x34fb7d,function(_0xaa8926){if(_0xaa8926[_0x960b('0x37')]!==_0x960b('0x47')){var _0x3acae7={};_0x3acae7[_0xaa8926['name']]={'$like':'%'+_0x55c300[_0x960b('0x3b')]['filter']+'%'};return _0x3acae7;}})});}_0x1d3c68=_[_0x960b('0x45')]({},_0x1d3c68,_0x55c300['options']);var _0x45c63b={'where':_0x1d3c68[_0x960b('0x46')]};return db[_0x960b('0x48')][_0x960b('0x2a')](_0x45c63b)[_0x960b('0x1d')](function(_0x4c1ec5){_0x57740d[_0x960b('0x2a')]=_0x4c1ec5;if(_0x55c300[_0x960b('0x3b')][_0x960b('0x49')]){_0x1d3c68[_0x960b('0x4a')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x960b('0x4b')](_0x1d3c68);})[_0x960b('0x1d')](function(_0x18405d){_0x57740d[_0x960b('0x4c')]=_0x18405d;return _0x57740d;})[_0x960b('0x1d')](respondWithFilteredResult(_0x526ae6,_0x1d3c68))[_0x960b('0x4d')](handleError(_0x526ae6,null));};exports[_0x960b('0x4e')]=function(_0x35f2f8,_0xebc84a){var _0x13b805={'raw':![],'where':{'id':_0x35f2f8['params']['id']}},_0x47cbe3={};_0x47cbe3[_0x960b('0x39')]=_[_0x960b('0x4f')](db[_0x960b('0x48')][_0x960b('0x50')]);_0x47cbe3[_0x960b('0x3b')]=_[_0x960b('0x4f')](_0x35f2f8['query']);_0x47cbe3['filters']=_[_0x960b('0x3e')](_0x47cbe3[_0x960b('0x39')],_0x47cbe3[_0x960b('0x3b')]);_0x13b805['attributes']=_['intersection'](_0x47cbe3[_0x960b('0x39')],qs[_0x960b('0x3f')](_0x35f2f8[_0x960b('0x3b')][_0x960b('0x3f')]));_0x13b805[_0x960b('0x3d')]=_0x13b805[_0x960b('0x3d')]['length']?_0x13b805[_0x960b('0x3d')]:_0x47cbe3['model'];if(_0x35f2f8[_0x960b('0x3b')]['includeAll']){_0x13b805['include']=[{'all':!![]}];}_0x13b805=_[_0x960b('0x45')]({},_0x13b805,_0x35f2f8[_0x960b('0x51')]);return db[_0x960b('0x48')][_0x960b('0x52')](_0x13b805)[_0x960b('0x1d')](handleEntityNotFound(_0xebc84a,null))[_0x960b('0x1d')](respondWithResult(_0xebc84a,null))[_0x960b('0x4d')](handleError(_0xebc84a,null));};exports[_0x960b('0x53')]=function(_0x556b52,_0x536e2b){return db['SalesforceConfiguration']['create'](_0x556b52[_0x960b('0x54')],{})['then'](respondWithResult(_0x536e2b,0xc9))[_0x960b('0x4d')](handleError(_0x536e2b,null));};exports['update']=function(_0x3e7d98,_0x2d27e5){if(_0x3e7d98[_0x960b('0x54')]['id']){delete _0x3e7d98[_0x960b('0x54')]['id'];}return db['SalesforceConfiguration'][_0x960b('0x52')]({'where':{'id':_0x3e7d98['params']['id']}})[_0x960b('0x1d')](handleEntityNotFound(_0x2d27e5,null))[_0x960b('0x1d')](saveUpdates(_0x3e7d98[_0x960b('0x54')],null))[_0x960b('0x1d')](respondWithResult(_0x2d27e5,null))[_0x960b('0x4d')](handleError(_0x2d27e5,null));};exports[_0x960b('0x31')]=function(_0x64f548,_0x179d55){return db[_0x960b('0x48')]['find']({'where':{'id':_0x64f548[_0x960b('0x55')]['id']}})[_0x960b('0x1d')](handleEntityNotFound(_0x179d55,null))[_0x960b('0x1d')](removeEntity(_0x179d55,null))['catch'](handleError(_0x179d55,null));};exports[_0x960b('0x56')]=function(_0x5d71fe,_0x4faabd,_0x4abb73){var _0x4e69ab={};var _0x4d5c80={};var _0x11fca2;var _0xb7ef9f;return db[_0x960b('0x48')][_0x960b('0x57')]({'where':{'id':_0x5d71fe['params']['id']}})[_0x960b('0x1d')](handleEntityNotFound(_0x4faabd,null))[_0x960b('0x1d')](function(_0x1a9069){if(_0x1a9069){_0x11fca2=_0x1a9069;_0x4d5c80[_0x960b('0x39')]=_[_0x960b('0x4f')](db[_0x960b('0x58')][_0x960b('0x50')]);_0x4d5c80['query']=_['keys'](_0x5d71fe[_0x960b('0x3b')]);_0x4d5c80['filters']=_['intersection'](_0x4d5c80[_0x960b('0x39')],_0x4d5c80['query']);_0x4e69ab[_0x960b('0x3d')]=_[_0x960b('0x3e')](_0x4d5c80['model'],qs[_0x960b('0x3f')](_0x5d71fe['query'][_0x960b('0x3f')]));_0x4e69ab[_0x960b('0x3d')]=_0x4e69ab[_0x960b('0x3d')][_0x960b('0x40')]?_0x4e69ab[_0x960b('0x3d')]:_0x4d5c80['model'];_0x4e69ab[_0x960b('0x42')]=qs['sort'](_0x5d71fe[_0x960b('0x3b')][_0x960b('0x43')]);_0x4e69ab['where']=qs[_0x960b('0x3c')](_[_0x960b('0x44')](_0x5d71fe[_0x960b('0x3b')],_0x4d5c80[_0x960b('0x3c')]));if(_0x5d71fe[_0x960b('0x3b')][_0x960b('0x59')]){_0x4e69ab[_0x960b('0x46')]=_[_0x960b('0x45')](_0x4e69ab[_0x960b('0x46')],{'$or':_[_0x960b('0x35')](_0x4e69ab[_0x960b('0x3d')],function(_0x56cbfd){var _0x49c7a7={};_0x49c7a7[_0x56cbfd]={'$like':'%'+_0x5d71fe[_0x960b('0x3b')][_0x960b('0x59')]+'%'};return _0x49c7a7;})});}_0x4e69ab=_[_0x960b('0x45')]({},_0x4e69ab,_0x5d71fe[_0x960b('0x51')]);return _0x11fca2[_0x960b('0x56')](_0x4e69ab);}})['then'](function(_0x27ee1d){if(_0x27ee1d){_0xb7ef9f=_0x27ee1d[_0x960b('0x40')];if(!_0x5d71fe[_0x960b('0x3b')][_0x960b('0x5a')](_0x960b('0x41'))){_0x4e69ab['limit']=qs[_0x960b('0x2c')](_0x5d71fe['query']['limit']);_0x4e69ab[_0x960b('0x2b')]=qs[_0x960b('0x2b')](_0x5d71fe['query'][_0x960b('0x2b')]);}return _0x11fca2['getFields'](_0x4e69ab);}})[_0x960b('0x1d')](function(_0x28e8b4){if(_0x28e8b4){return _0x28e8b4?{'count':_0xb7ef9f,'rows':_0x28e8b4}:null;}})[_0x960b('0x1d')](respondWithResult(_0x4faabd,null))[_0x960b('0x4d')](handleError(_0x4faabd,null));};exports[_0x960b('0x5b')]=function(_0x467d9d,_0x578dab,_0xe442b0){var _0x1c9cb2={};var _0x25f683={};var _0x151275;var _0x416603;return db[_0x960b('0x48')][_0x960b('0x57')]({'where':{'id':_0x467d9d[_0x960b('0x55')]['id']}})['then'](handleEntityNotFound(_0x578dab,null))[_0x960b('0x1d')](function(_0x4974e6){if(_0x4974e6){_0x151275=_0x4974e6;_0x25f683[_0x960b('0x39')]=_[_0x960b('0x4f')](db[_0x960b('0x58')][_0x960b('0x50')]);_0x25f683[_0x960b('0x3b')]=_['keys'](_0x467d9d[_0x960b('0x3b')]);_0x25f683[_0x960b('0x3c')]=_[_0x960b('0x3e')](_0x25f683[_0x960b('0x39')],_0x25f683['query']);_0x1c9cb2[_0x960b('0x3d')]=_['intersection'](_0x25f683['model'],qs[_0x960b('0x3f')](_0x467d9d[_0x960b('0x3b')][_0x960b('0x3f')]));_0x1c9cb2[_0x960b('0x3d')]=_0x1c9cb2['attributes'][_0x960b('0x40')]?_0x1c9cb2[_0x960b('0x3d')]:_0x25f683[_0x960b('0x39')];_0x1c9cb2[_0x960b('0x42')]=qs['sort'](_0x467d9d[_0x960b('0x3b')][_0x960b('0x43')]);_0x1c9cb2[_0x960b('0x46')]=qs['filters'](_['pick'](_0x467d9d[_0x960b('0x3b')],_0x25f683[_0x960b('0x3c')]));if(_0x467d9d[_0x960b('0x3b')][_0x960b('0x59')]){_0x1c9cb2[_0x960b('0x46')]=_['merge'](_0x1c9cb2['where'],{'$or':_[_0x960b('0x35')](_0x1c9cb2[_0x960b('0x3d')],function(_0x3d840f){var _0x3de422={};_0x3de422[_0x3d840f]={'$like':'%'+_0x467d9d['query'][_0x960b('0x59')]+'%'};return _0x3de422;})});}_0x1c9cb2=_[_0x960b('0x45')]({},_0x1c9cb2,_0x467d9d[_0x960b('0x51')]);return _0x151275[_0x960b('0x5b')](_0x1c9cb2);}})[_0x960b('0x1d')](function(_0x174248){if(_0x174248){_0x416603=_0x174248[_0x960b('0x40')];if(!_0x467d9d[_0x960b('0x3b')][_0x960b('0x5a')](_0x960b('0x41'))){_0x1c9cb2[_0x960b('0x2c')]=qs[_0x960b('0x2c')](_0x467d9d['query']['limit']);_0x1c9cb2['offset']=qs[_0x960b('0x2b')](_0x467d9d['query'][_0x960b('0x2b')]);}return _0x151275[_0x960b('0x5b')](_0x1c9cb2);}})[_0x960b('0x1d')](function(_0x35cdfc){if(_0x35cdfc){return _0x35cdfc?{'count':_0x416603,'rows':_0x35cdfc}:null;}})[_0x960b('0x1d')](respondWithResult(_0x578dab,null))[_0x960b('0x4d')](handleError(_0x578dab,null));};exports[_0x960b('0x5c')]=function(_0x266191,_0x42bd08,_0xad74d3){var _0x20a66b={};var _0xeb8468={};var _0x4f88e3;var _0x46769c;return db[_0x960b('0x48')]['findOne']({'where':{'id':_0x266191[_0x960b('0x55')]['id']}})[_0x960b('0x1d')](handleEntityNotFound(_0x42bd08,null))['then'](function(_0x48bfa1){if(_0x48bfa1){_0x4f88e3=_0x48bfa1;_0xeb8468['model']=_[_0x960b('0x4f')](db[_0x960b('0x58')]['rawAttributes']);_0xeb8468['query']=_[_0x960b('0x4f')](_0x266191[_0x960b('0x3b')]);_0xeb8468[_0x960b('0x3c')]=_[_0x960b('0x3e')](_0xeb8468[_0x960b('0x39')],_0xeb8468['query']);_0x20a66b[_0x960b('0x3d')]=_['intersection'](_0xeb8468[_0x960b('0x39')],qs[_0x960b('0x3f')](_0x266191['query'][_0x960b('0x3f')]));_0x20a66b[_0x960b('0x3d')]=_0x20a66b[_0x960b('0x3d')][_0x960b('0x40')]?_0x20a66b[_0x960b('0x3d')]:_0xeb8468[_0x960b('0x39')];_0x20a66b[_0x960b('0x42')]=qs[_0x960b('0x43')](_0x266191['query'][_0x960b('0x43')]);_0x20a66b['where']=qs[_0x960b('0x3c')](_[_0x960b('0x44')](_0x266191[_0x960b('0x3b')],_0xeb8468[_0x960b('0x3c')]));if(_0x266191[_0x960b('0x3b')][_0x960b('0x59')]){_0x20a66b['where']=_[_0x960b('0x45')](_0x20a66b[_0x960b('0x46')],{'$or':_[_0x960b('0x35')](_0x20a66b['attributes'],function(_0x1ce440){var _0x245289={};_0x245289[_0x1ce440]={'$like':'%'+_0x266191[_0x960b('0x3b')][_0x960b('0x59')]+'%'};return _0x245289;})});}_0x20a66b=_[_0x960b('0x45')]({},_0x20a66b,_0x266191[_0x960b('0x51')]);return _0x4f88e3[_0x960b('0x5c')](_0x20a66b);}})[_0x960b('0x1d')](function(_0x2d47e9){if(_0x2d47e9){_0x46769c=_0x2d47e9[_0x960b('0x40')];if(!_0x266191['query']['hasOwnProperty']('nolimit')){_0x20a66b[_0x960b('0x2c')]=qs[_0x960b('0x2c')](_0x266191[_0x960b('0x3b')]['limit']);_0x20a66b['offset']=qs['offset'](_0x266191[_0x960b('0x3b')]['offset']);}return _0x4f88e3[_0x960b('0x5c')](_0x20a66b);}})[_0x960b('0x1d')](function(_0x2e1272){if(_0x2e1272){return _0x2e1272?{'count':_0x46769c,'rows':_0x2e1272}:null;}})['then'](respondWithResult(_0x42bd08,null))[_0x960b('0x4d')](handleError(_0x42bd08,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 47652f3..3fd7704 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 _0xc3c3=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','api'];(function(_0x3c21fa,_0x4ebbc3){var _0x59ab31=function(_0x54d844){while(--_0x54d844){_0x3c21fa['push'](_0x3c21fa['shift']());}};_0x59ab31(++_0x4ebbc3);}(_0xc3c3,0xc1));var _0x3c3c=function(_0x3438ef,_0x28f1d2){_0x3438ef=_0x3438ef-0x0;var _0x1be734=_0xc3c3[_0x3438ef];return _0x1be734;};'use strict';var _=require(_0x3c3c('0x0'));var util=require(_0x3c3c('0x1'));var logger=require('../../config/logger')(_0x3c3c('0x2'));var moment=require(_0x3c3c('0x3'));var BPromise=require(_0x3c3c('0x4'));var rp=require(_0x3c3c('0x5'));var fs=require('fs');var path=require(_0x3c3c('0x6'));var rimraf=require(_0x3c3c('0x7'));var config=require(_0x3c3c('0x8'));var attributes=require(_0x3c3c('0x9'));module[_0x3c3c('0xa')]=function(_0x3dcd79,_0x5f33fd){return _0x3dcd79[_0x3c3c('0xb')](_0x3c3c('0xc'),attributes,{'tableName':_0x3c3c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07ec=['int_salesforce_configurations','../../config/logger','api','moment','bluebird','path','../../config/environment','./intSalesforceConfiguration.attributes','exports','define'];(function(_0x303787,_0x4c3290){var _0x310608=function(_0x3735cd){while(--_0x3735cd){_0x303787['push'](_0x303787['shift']());}};_0x310608(++_0x4c3290);}(_0x07ec,0x1a5));var _0xc07e=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x07ec[_0x409353];return _0x4f4b59;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc07e('0x0'))(_0xc07e('0x1'));var moment=require(_0xc07e('0x2'));var BPromise=require(_0xc07e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc07e('0x4'));var rimraf=require('rimraf');var config=require(_0xc07e('0x5'));var attributes=require(_0xc07e('0x6'));module[_0xc07e('0x7')]=function(_0x35c28b,_0x28119b){return _0x35c28b[_0xc07e('0x8')]('SalesforceConfiguration',attributes,{'tableName':_0xc07e('0x9'),'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 e664ebc..cb39277 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 _0xaaa6=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1465d1,_0x10aff3){var _0x23aba4=function(_0x3754f8){while(--_0x3754f8){_0x1465d1['push'](_0x1465d1['shift']());}};_0x23aba4(++_0x10aff3);}(_0xaaa6,0x1e4));var _0x6aaa=function(_0x819ce,_0xf25f51){_0x819ce=_0x819ce-0x0;var _0x1edcf0=_0xaaa6[_0x819ce];return _0x1edcf0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6aaa('0x0'));var BPromise=require(_0x6aaa('0x1'));var rs=require(_0x6aaa('0x2'));var fs=require('fs');var Redis=require(_0x6aaa('0x3'));var db=require(_0x6aaa('0x4'))['db'];var utils=require(_0x6aaa('0x5'));var logger=require(_0x6aaa('0x6'))('rpc');var config=require(_0x6aaa('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6aaa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26443d,_0x5d0f35,_0x18cdf1){return new BPromise(function(_0x1f1f92,_0x3c0001){return client['request'](_0x26443d,_0x18cdf1)[_0x6aaa('0x9')](function(_0x1e7d66){logger[_0x6aaa('0xa')](_0x6aaa('0xb'),_0x5d0f35,_0x6aaa('0xc'));logger[_0x6aaa('0xd')](_0x6aaa('0xe'),_0x5d0f35,_0x6aaa('0xc'),JSON[_0x6aaa('0xf')](_0x1e7d66));if(_0x1e7d66[_0x6aaa('0x10')]){if(_0x1e7d66[_0x6aaa('0x10')][_0x6aaa('0x11')]===0x1f4){logger[_0x6aaa('0x10')](_0x6aaa('0xb'),_0x5d0f35,_0x1e7d66[_0x6aaa('0x10')][_0x6aaa('0x12')]);return _0x3c0001(_0x1e7d66['error'][_0x6aaa('0x12')]);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x5d0f35,_0x1e7d66['error'][_0x6aaa('0x12')]);return _0x1f1f92(_0x1e7d66[_0x6aaa('0x10')][_0x6aaa('0x12')]);}else{logger[_0x6aaa('0xa')](_0x6aaa('0xb'),_0x5d0f35,_0x6aaa('0xc'));_0x1f1f92(_0x1e7d66[_0x6aaa('0x13')][_0x6aaa('0x12')]);}})[_0x6aaa('0x14')](function(_0x162772){logger[_0x6aaa('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5d0f35,_0x162772);_0x3c0001(_0x162772);});});} \ No newline at end of file +var _0xdca8=['http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x19084b,_0x31e8e3){var _0x348f21=function(_0x4ed008){while(--_0x4ed008){_0x19084b['push'](_0x19084b['shift']());}};_0x348f21(++_0x31e8e3);}(_0xdca8,0xab));var _0x8dca=function(_0x312dfe,_0x414440){_0x312dfe=_0x312dfe-0x0;var _0x3b1c1b=_0xdca8[_0x312dfe];return _0x3b1c1b;};'use strict';var _=require(_0x8dca('0x0'));var util=require(_0x8dca('0x1'));var moment=require('moment');var BPromise=require(_0x8dca('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8dca('0x3'));var db=require(_0x8dca('0x4'))['db'];var utils=require(_0x8dca('0x5'));var logger=require('../../config/logger')(_0x8dca('0x6'));var config=require(_0x8dca('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8dca('0x8')][_0x8dca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd13d19,_0x21e223,_0x5a1c1f){return new BPromise(function(_0xba52b9,_0x1fb3a7){return client[_0x8dca('0xa')](_0xd13d19,_0x5a1c1f)[_0x8dca('0xb')](function(_0x275149){logger['info'](_0x8dca('0xc'),_0x21e223,_0x8dca('0xd'));logger[_0x8dca('0xe')](_0x8dca('0xf'),_0x21e223,_0x8dca('0xd'),JSON['stringify'](_0x275149));if(_0x275149[_0x8dca('0x10')]){if(_0x275149[_0x8dca('0x10')][_0x8dca('0x11')]===0x1f4){logger[_0x8dca('0x10')](_0x8dca('0xc'),_0x21e223,_0x275149['error'][_0x8dca('0x12')]);return _0x1fb3a7(_0x275149[_0x8dca('0x10')][_0x8dca('0x12')]);}logger['error'](_0x8dca('0xc'),_0x21e223,_0x275149[_0x8dca('0x10')][_0x8dca('0x12')]);return _0xba52b9(_0x275149['error'][_0x8dca('0x12')]);}else{logger['info'](_0x8dca('0xc'),_0x21e223,_0x8dca('0xd'));_0xba52b9(_0x275149['result'][_0x8dca('0x12')]);}})[_0x8dca('0x13')](function(_0x4b2dcd){logger[_0x8dca('0x10')](_0x8dca('0xc'),_0x21e223,_0x4b2dcd);_0x1fb3a7(_0x4b2dcd);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 028fce8..2d03c69 100644 --- a/server/api/intSalesforceField/index.js +++ b/server/api/intSalesforceField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x71ab=['isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get'];(function(_0x52f41a,_0xefc811){var _0x5c9778=function(_0x160ace){while(--_0x160ace){_0x52f41a['push'](_0x52f41a['shift']());}};_0x5c9778(++_0xefc811);}(_0x71ab,0x64));var _0xb71a=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x71ab[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require('multer');var util=require(_0xb71a('0x0'));var path=require('path');var timeout=require(_0xb71a('0x1'));var express=require('express');var router=express[_0xb71a('0x2')]();var auth=require(_0xb71a('0x3'));var interaction=require(_0xb71a('0x4'));var config=require(_0xb71a('0x5'));var controller=require(_0xb71a('0x6'));router[_0xb71a('0x7')]('/',auth[_0xb71a('0x8')](),controller[_0xb71a('0x9')]);router[_0xb71a('0x7')](_0xb71a('0xa'),auth[_0xb71a('0x8')](),controller[_0xb71a('0xb')]);router[_0xb71a('0xc')]('/',auth[_0xb71a('0x8')](),controller[_0xb71a('0xd')]);router[_0xb71a('0xe')](_0xb71a('0xa'),auth[_0xb71a('0x8')](),controller['update']);router[_0xb71a('0xf')]('/:id',auth[_0xb71a('0x8')](),controller[_0xb71a('0x10')]);module[_0xb71a('0x11')]=router; \ No newline at end of file +var _0x9a5a=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','/:id','show','post','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x39b9a0,_0x262c5a){var _0x4e491f=function(_0x493ce5){while(--_0x493ce5){_0x39b9a0['push'](_0x39b9a0['shift']());}};_0x4e491f(++_0x262c5a);}(_0x9a5a,0x194));var _0xa9a5=function(_0x1938fa,_0x28f6e0){_0x1938fa=_0x1938fa-0x0;var _0x5b8b09=_0x9a5a[_0x1938fa];return _0x5b8b09;};'use strict';var multer=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var path=require(_0xa9a5('0x2'));var timeout=require(_0xa9a5('0x3'));var express=require(_0xa9a5('0x4'));var router=express['Router']();var auth=require(_0xa9a5('0x5'));var interaction=require(_0xa9a5('0x6'));var config=require(_0xa9a5('0x7'));var controller=require(_0xa9a5('0x8'));router[_0xa9a5('0x9')]('/',auth[_0xa9a5('0xa')](),controller['index']);router[_0xa9a5('0x9')](_0xa9a5('0xb'),auth[_0xa9a5('0xa')](),controller[_0xa9a5('0xc')]);router[_0xa9a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa9a5('0xb'),auth[_0xa9a5('0xa')](),controller[_0xa9a5('0xe')]);router[_0xa9a5('0xf')](_0xa9a5('0xb'),auth[_0xa9a5('0xa')](),controller[_0xa9a5('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 d2415ff..2389318 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 _0x3219=['variable','customVariable','keyValue','STRING','sequelize','exports','ENUM','string'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0x3219,0xfc));var _0x9321=function(_0x48c612,_0x432076){_0x48c612=_0x48c612-0x0;var _0x5f0583=_0x3219[_0x48c612];return _0x5f0583;};'use strict';var Sequelize=require(_0x9321('0x0'));module[_0x9321('0x1')]={'type':{'type':Sequelize[_0x9321('0x2')](_0x9321('0x3'),_0x9321('0x4'),_0x9321('0x5'),_0x9321('0x6')),'defaultValue':_0x9321('0x3')},'content':{'type':Sequelize[_0x9321('0x7')]},'key':{'type':Sequelize[_0x9321('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x9321('0x3'),'variable',_0x9321('0x5'))},'keyContent':{'type':Sequelize[_0x9321('0x7')]},'idField':{'type':Sequelize[_0x9321('0x7')]},'variableName':{'type':Sequelize[_0x9321('0x7')]}}; \ No newline at end of file +var _0xe41a=['string','variable','customVariable','keyValue','STRING','sequelize','ENUM'];(function(_0x18b290,_0x153396){var _0x30de42=function(_0x1478b3){while(--_0x1478b3){_0x18b290['push'](_0x18b290['shift']());}};_0x30de42(++_0x153396);}(_0xe41a,0x116));var _0xae41=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xe41a[_0x580576];return _0x3f55a0;};'use strict';var Sequelize=require(_0xae41('0x0'));module['exports']={'type':{'type':Sequelize[_0xae41('0x1')](_0xae41('0x2'),_0xae41('0x3'),_0xae41('0x4'),_0xae41('0x5')),'defaultValue':_0xae41('0x2')},'content':{'type':Sequelize[_0xae41('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xae41('0x1')](_0xae41('0x2'),_0xae41('0x3'),_0xae41('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xae41('0x6')]},'variableName':{'type':Sequelize[_0xae41('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 8180fc7..cbbf002 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 _0x0b0e=['update','then','destroy','end','error','name','index','map','SalesforceField','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','count','includeAll','rows','show','params','rawAttributes','include','find','catch','create','body','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','set','reject'];(function(_0x10aba8,_0x4326f4){var _0x360793=function(_0x18c7f9){while(--_0x18c7f9){_0x10aba8['push'](_0x10aba8['shift']());}};_0x360793(++_0x4326f4);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4c3a36,_0xdba60f){_0x4c3a36=_0x4c3a36-0x0;var _0x40f945=_0x0b0e[_0x4c3a36];return _0x40f945;};'use strict';var pdf=require(_0xe0b0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe0b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0b0('0x2'));var rp=require(_0xe0b0('0x3'));var moment=require(_0xe0b0('0x4'));var BPromise=require(_0xe0b0('0x5'));var Mustache=require(_0xe0b0('0x6'));var util=require(_0xe0b0('0x7'));var path=require(_0xe0b0('0x8'));var sox=require(_0xe0b0('0x9'));var csv=require(_0xe0b0('0xa'));var ejs=require(_0xe0b0('0xb'));var fs=require('fs');var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0xa'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3068c0,_0x1c358a){_0x1c358a=_0x1c358a||0xcc;return function(_0x3cc19a){if(_0x3cc19a){return _0x3068c0[_0xe0b0('0x17')](_0x1c358a);}return _0x3068c0[_0xe0b0('0x18')](_0x1c358a)['end']();};}function respondWithResult(_0x3782be,_0x154de6){_0x154de6=_0x154de6||0xc8;return function(_0x743318){if(_0x743318){return _0x3782be[_0xe0b0('0x18')](_0x154de6)[_0xe0b0('0x19')](_0x743318);}};}function respondWithFilteredResult(_0x55d884,_0x41a7e2){return function(_0x5adb01){if(_0x5adb01){var _0x35cb40=_0x5adb01['count'],_0xadee6e=_0x41a7e2[_0xe0b0('0x1a')],_0x519ae8=_0x41a7e2[_0xe0b0('0x1a')]+_0x41a7e2['limit'],_0x11fdca;if(_0x519ae8>=_0x35cb40){_0x519ae8=_0x35cb40;_0x11fdca=0xc8;}else{_0x11fdca=0xce;}_0x55d884['status'](_0x11fdca);return _0x55d884[_0xe0b0('0x1b')]('Content-Range',_0xadee6e+'-'+_0x519ae8+'/'+_0x35cb40)['json'](_0x5adb01);}return null;};}function patchUpdates(_0x4bce65){return function(_0x1920ee){try{jsonpatch['apply'](_0x1920ee,_0x4bce65,!![]);}catch(_0x52598b){return BPromise[_0xe0b0('0x1c')](_0x52598b);}return _0x1920ee['save']();};}function saveUpdates(_0x472286,_0x5dba2f){return function(_0x2c84cc){if(_0x2c84cc){return _0x2c84cc[_0xe0b0('0x1d')](_0x472286)[_0xe0b0('0x1e')](function(_0x310a6d){return _0x310a6d;});}return null;};}function removeEntity(_0x2cf6a1,_0x58b804){return function(_0x4cae54){if(_0x4cae54){return _0x4cae54[_0xe0b0('0x1f')]()['then'](function(){_0x2cf6a1[_0xe0b0('0x18')](0xcc)[_0xe0b0('0x20')]();});}};}function handleEntityNotFound(_0x513e63,_0x170ad8){return function(_0x503883){if(!_0x503883){_0x513e63[_0xe0b0('0x17')](0x194);}return _0x503883;};}function handleError(_0x49a727,_0x28586d){_0x28586d=_0x28586d||0x1f4;return function(_0x576352){logger[_0xe0b0('0x21')](_0x576352['stack']);if(_0x576352[_0xe0b0('0x22')]){delete _0x576352['name'];}_0x49a727[_0xe0b0('0x18')](_0x28586d)['send'](_0x576352);};}exports[_0xe0b0('0x23')]=function(_0x3c3bc2,_0x1f1ebd){var _0x1d91ad={},_0x3ec2={},_0x10745d={'count':0x0,'rows':[]};var _0x5200a6=_[_0xe0b0('0x24')](db[_0xe0b0('0x25')]['rawAttributes'],function(_0x15e13b){return{'name':_0x15e13b[_0xe0b0('0x26')],'type':_0x15e13b[_0xe0b0('0x27')][_0xe0b0('0x28')]};});_0x3ec2[_0xe0b0('0x29')]=_[_0xe0b0('0x24')](_0x5200a6,_0xe0b0('0x22'));_0x3ec2['query']=_[_0xe0b0('0x2a')](_0x3c3bc2[_0xe0b0('0x2b')]);_0x3ec2['filters']=_['intersection'](_0x3ec2[_0xe0b0('0x29')],_0x3ec2[_0xe0b0('0x2b')]);_0x1d91ad[_0xe0b0('0x2c')]=_[_0xe0b0('0x2d')](_0x3ec2[_0xe0b0('0x29')],qs['fields'](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x2e')]));_0x1d91ad[_0xe0b0('0x2c')]=_0x1d91ad[_0xe0b0('0x2c')][_0xe0b0('0x2f')]?_0x1d91ad['attributes']:_0x3ec2[_0xe0b0('0x29')];if(!_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x30')](_0xe0b0('0x31'))){_0x1d91ad[_0xe0b0('0x32')]=qs[_0xe0b0('0x32')](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x32')]);_0x1d91ad[_0xe0b0('0x1a')]=qs[_0xe0b0('0x1a')](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x1a')]);}_0x1d91ad[_0xe0b0('0x33')]=qs[_0xe0b0('0x34')](_0x3c3bc2[_0xe0b0('0x2b')]['sort']);_0x1d91ad[_0xe0b0('0x35')]=qs[_0xe0b0('0x36')](_[_0xe0b0('0x37')](_0x3c3bc2[_0xe0b0('0x2b')],_0x3ec2[_0xe0b0('0x36')]));if(_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x38')]){_0x1d91ad['where']=_['merge'](_0x1d91ad['where'],{'$or':_['map'](_0x5200a6,function(_0x26137c){if(_0x26137c[_0xe0b0('0x27')]!==_0xe0b0('0x39')){var _0x4e4b20={};_0x4e4b20[_0x26137c[_0xe0b0('0x22')]]={'$like':'%'+_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x38')]+'%'};return _0x4e4b20;}})});}_0x1d91ad=_[_0xe0b0('0x3a')]({},_0x1d91ad,_0x3c3bc2['options']);var _0xed3226={'where':_0x1d91ad[_0xe0b0('0x35')]};return db[_0xe0b0('0x25')][_0xe0b0('0x3b')](_0xed3226)[_0xe0b0('0x1e')](function(_0x1205db){_0x10745d[_0xe0b0('0x3b')]=_0x1205db;if(_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x3c')]){_0x1d91ad['include']=[{'all':!![]}];}return db[_0xe0b0('0x25')]['findAll'](_0x1d91ad);})[_0xe0b0('0x1e')](function(_0x2d5f47){_0x10745d[_0xe0b0('0x3d')]=_0x2d5f47;return _0x10745d;})[_0xe0b0('0x1e')](respondWithFilteredResult(_0x1f1ebd,_0x1d91ad))['catch'](handleError(_0x1f1ebd,null));};exports[_0xe0b0('0x3e')]=function(_0x41adcb,_0x33706d){var _0x402a0e={'raw':!![],'where':{'id':_0x41adcb[_0xe0b0('0x3f')]['id']}},_0x19c80e={};_0x19c80e[_0xe0b0('0x29')]=_[_0xe0b0('0x2a')](db['SalesforceField'][_0xe0b0('0x40')]);_0x19c80e[_0xe0b0('0x2b')]=_['keys'](_0x41adcb['query']);_0x19c80e[_0xe0b0('0x36')]=_[_0xe0b0('0x2d')](_0x19c80e['model'],_0x19c80e[_0xe0b0('0x2b')]);_0x402a0e[_0xe0b0('0x2c')]=_[_0xe0b0('0x2d')](_0x19c80e[_0xe0b0('0x29')],qs[_0xe0b0('0x2e')](_0x41adcb['query']['fields']));_0x402a0e['attributes']=_0x402a0e[_0xe0b0('0x2c')][_0xe0b0('0x2f')]?_0x402a0e['attributes']:_0x19c80e[_0xe0b0('0x29')];if(_0x41adcb[_0xe0b0('0x2b')][_0xe0b0('0x3c')]){_0x402a0e[_0xe0b0('0x41')]=[{'all':!![]}];}_0x402a0e=_[_0xe0b0('0x3a')]({},_0x402a0e,_0x41adcb['options']);return db['SalesforceField'][_0xe0b0('0x42')](_0x402a0e)[_0xe0b0('0x1e')](handleEntityNotFound(_0x33706d,null))[_0xe0b0('0x1e')](respondWithResult(_0x33706d,null))[_0xe0b0('0x43')](handleError(_0x33706d,null));};exports[_0xe0b0('0x44')]=function(_0x575c7d,_0x3b1474){return db[_0xe0b0('0x25')]['create'](_0x575c7d['body'],{})['then'](respondWithResult(_0x3b1474,0xc9))[_0xe0b0('0x43')](handleError(_0x3b1474,null));};exports[_0xe0b0('0x1d')]=function(_0x2419ce,_0x364877){if(_0x2419ce['body']['id']){delete _0x2419ce[_0xe0b0('0x45')]['id'];}return db[_0xe0b0('0x25')]['find']({'where':{'id':_0x2419ce['params']['id']}})[_0xe0b0('0x1e')](handleEntityNotFound(_0x364877,null))[_0xe0b0('0x1e')](saveUpdates(_0x2419ce['body'],null))[_0xe0b0('0x1e')](respondWithResult(_0x364877,null))[_0xe0b0('0x43')](handleError(_0x364877,null));};exports['destroy']=function(_0x5cb2b6,_0x123ad2){return db['SalesforceField'][_0xe0b0('0x42')]({'where':{'id':_0x5cb2b6[_0xe0b0('0x3f')]['id']}})[_0xe0b0('0x1e')](handleEntityNotFound(_0x123ad2,null))[_0xe0b0('0x1e')](removeEntity(_0x123ad2,null))[_0xe0b0('0x43')](handleError(_0x123ad2,null));}; \ No newline at end of file +var _0x7a54=['end','json','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','SalesforceField','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','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'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7a54,0x106));var _0x47a5=function(_0x2afd87,_0x1e5876){_0x2afd87=_0x2afd87-0x0;var _0x32bf7c=_0x7a54[_0x2afd87];return _0x32bf7c;};'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['SalesforceField'][_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['SalesforceField'][_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));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 65a23c6..d1bbd36 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 _0x303a=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','FieldId'];(function(_0x415f7e,_0x4630b6){var _0x311ff4=function(_0x19c19d){while(--_0x19c19d){_0x415f7e['push'](_0x415f7e['shift']());}};_0x311ff4(++_0x4630b6);}(_0x303a,0x1a0));var _0xa303=function(_0x1417c6,_0x194309){_0x1417c6=_0x1417c6-0x0;var _0x44db97=_0x303a[_0x1417c6];return _0x44db97;};'use strict';var _=require(_0xa303('0x0'));var util=require('util');var logger=require(_0xa303('0x1'))(_0xa303('0x2'));var moment=require(_0xa303('0x3'));var BPromise=require(_0xa303('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa303('0x5'));var rimraf=require(_0xa303('0x6'));var config=require(_0xa303('0x7'));var attributes=require(_0xa303('0x8'));module[_0xa303('0x9')]=function(_0x1c7ee9,_0x2bc3d7){return _0x1c7ee9[_0xa303('0xa')](_0xa303('0xb'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField',_0xa303('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2516=['int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField'];(function(_0x19ebfd,_0x5ae121){var _0x11017a=function(_0x24db17){while(--_0x24db17){_0x19ebfd['push'](_0x19ebfd['shift']());}};_0x11017a(++_0x5ae121);}(_0x2516,0x9d));var _0x6251=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x2516[_0x1b5aea];return _0x15cfc6;};'use strict';var _=require(_0x6251('0x0'));var util=require(_0x6251('0x1'));var logger=require(_0x6251('0x2'))(_0x6251('0x3'));var moment=require(_0x6251('0x4'));var BPromise=require('bluebird');var rp=require(_0x6251('0x5'));var fs=require('fs');var path=require(_0x6251('0x6'));var rimraf=require(_0x6251('0x7'));var config=require(_0x6251('0x8'));var attributes=require(_0x6251('0x9'));module[_0x6251('0xa')]=function(_0x52d3b7,_0x3be691){return _0x52d3b7[_0x6251('0xb')](_0x6251('0xc'),attributes,{'tableName':_0x6251('0xd'),'paranoid':![],'indexes':[{'name':_0x6251('0xe'),'fields':[_0x6251('0xf'),_0x6251('0x10')],'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 e80f999..93ebbdb 100644 --- a/server/api/intSalesforceField/intSalesforceField.rpc.js +++ b/server/api/intSalesforceField/intSalesforceField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x153f=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x1b28c5,_0x5c3357){var _0x2b80be=function(_0x10ce66){while(--_0x10ce66){_0x1b28c5['push'](_0x1b28c5['shift']());}};_0x2b80be(++_0x5c3357);}(_0x153f,0x15b));var _0xf153=function(_0x4c60df,_0x21a3ab){_0x4c60df=_0x4c60df-0x0;var _0x638975=_0x153f[_0x4c60df];return _0x638975;};'use strict';var _=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var moment=require(_0xf153('0x2'));var BPromise=require(_0xf153('0x3'));var rs=require(_0xf153('0x4'));var fs=require('fs');var Redis=require(_0xf153('0x5'));var db=require(_0xf153('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf153('0x7'))('rpc');var config=require(_0xf153('0x8'));var jayson=require(_0xf153('0x9'));var client=jayson[_0xf153('0xa')][_0xf153('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21f432,_0x4c8ae5,_0x17ba96){return new BPromise(function(_0x143497,_0x224f88){return client[_0xf153('0xc')](_0x21f432,_0x17ba96)[_0xf153('0xd')](function(_0x3e7a82){logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));logger[_0xf153('0x11')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x4c8ae5,_0xf153('0x10'),JSON[_0xf153('0x12')](_0x3e7a82));if(_0x3e7a82[_0xf153('0x13')]){if(_0x3e7a82['error'][_0xf153('0x14')]===0x1f4){logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);return _0x224f88(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82['error'][_0xf153('0x15')]);return _0x143497(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}else{logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));_0x143497(_0x3e7a82[_0xf153('0x16')][_0xf153('0x15')]);}})['catch'](function(_0x35f4e8){logger['error'](_0xf153('0xf'),_0x4c8ae5,_0x35f4e8);_0x224f88(_0x35f4e8);});});} \ No newline at end of file +var _0x9ffd=['SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SalesforceField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x59f4d8,_0x4731c4){var _0x2a6da0=function(_0x54e450){while(--_0x54e450){_0x59f4d8['push'](_0x59f4d8['shift']());}};_0x2a6da0(++_0x4731c4);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x35bfea,_0x129d31){_0x35bfea=_0x35bfea-0x0;var _0x3c4384=_0x9ffd[_0x35bfea];return _0x3c4384;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('SalesforceField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('SalesforceField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('SalesforceField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 674d277..0ebef3e 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 _0xb708=['/:id','delete','destroy','multer','path','express','Router','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','put'];(function(_0x111bd0,_0x34bf7b){var _0x30edfa=function(_0x31e4f9){while(--_0x31e4f9){_0x111bd0['push'](_0x111bd0['shift']());}};_0x30edfa(++_0x34bf7b);}(_0xb708,0xe7));var _0x8b70=function(_0x23f8c8,_0xb536b9){_0x23f8c8=_0x23f8c8-0x0;var _0x3dc718=_0xb708[_0x23f8c8];return _0x3dc718;};'use strict';var multer=require(_0x8b70('0x0'));var util=require('util');var path=require(_0x8b70('0x1'));var timeout=require('connect-timeout');var express=require(_0x8b70('0x2'));var router=express[_0x8b70('0x3')]();var auth=require(_0x8b70('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8b70('0x5'));var controller=require(_0x8b70('0x6'));router[_0x8b70('0x7')]('/',auth['isAuthenticated'](),controller[_0x8b70('0x8')]);router[_0x8b70('0x7')]('/:id',auth[_0x8b70('0x9')](),controller[_0x8b70('0xa')]);router[_0x8b70('0x7')](_0x8b70('0xb'),auth['isAuthenticated'](),controller[_0x8b70('0xc')]);router[_0x8b70('0x7')]('/:id/fields',auth[_0x8b70('0x9')](),controller[_0x8b70('0xd')]);router['post']('/',auth[_0x8b70('0x9')](),controller['create']);router[_0x8b70('0xe')](_0x8b70('0xb'),auth[_0x8b70('0x9')](),controller['addConfiguration']);router[_0x8b70('0xf')](_0x8b70('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x8b70('0x11')]('/:id',auth[_0x8b70('0x9')](),controller[_0x8b70('0x12')]);module['exports']=router; \ No newline at end of file +var _0xb673=['../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','get','/:id','show','post','create','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x492d04,_0x38b095){var _0x28737c=function(_0x1cf243){while(--_0x1cf243){_0x492d04['push'](_0x492d04['shift']());}};_0x28737c(++_0x38b095);}(_0xb673,0xa5));var _0x3b67=function(_0x485ce0,_0x138d5b){_0x485ce0=_0x485ce0-0x0;var _0x419de6=_0xb673[_0x485ce0];return _0x419de6;};'use strict';var multer=require(_0x3b67('0x0'));var util=require(_0x3b67('0x1'));var path=require('path');var timeout=require(_0x3b67('0x2'));var express=require(_0x3b67('0x3'));var router=express[_0x3b67('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x3b67('0x5'));var config=require(_0x3b67('0x6'));var controller=require(_0x3b67('0x7'));router['get']('/',auth[_0x3b67('0x8')](),controller['index']);router[_0x3b67('0x9')](_0x3b67('0xa'),auth[_0x3b67('0x8')](),controller[_0x3b67('0xb')]);router['get']('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0x3b67('0x9')]('/:id/fields',auth[_0x3b67('0x8')](),controller['getFields']);router[_0x3b67('0xc')]('/',auth[_0x3b67('0x8')](),controller[_0x3b67('0xd')]);router[_0x3b67('0xc')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x3b67('0xa'),auth[_0x3b67('0x8')](),controller['update']);router[_0x3b67('0xe')](_0x3b67('0xa'),auth['isAuthenticated'](),controller[_0x3b67('0xf')]);module[_0x3b67('0x10')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index c7524ac..43450fa 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 _0x522b=['sequelize','exports','STRING','username','remoteUri'];(function(_0x1432e0,_0xa2a593){var _0x498a18=function(_0x58bf80){while(--_0x58bf80){_0x1432e0['push'](_0x1432e0['shift']());}};_0x498a18(++_0xa2a593);}(_0x522b,0x1b8));var _0xb522=function(_0x2d4065,_0x38dc95){_0x2d4065=_0x2d4065-0x0;var _0xef6016=_0x522b[_0x2d4065];return _0xef6016;};'use strict';var Sequelize=require(_0xb522('0x0'));module[_0xb522('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb522('0x2')],'unique':_0xb522('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xb522('0x2')]},'remoteUri':{'type':Sequelize[_0xb522('0x2')],'unique':_0xb522('0x4')},'serverUrl':{'type':Sequelize[_0xb522('0x2')]}}; \ No newline at end of file +var _0x0365=['remoteUri','sequelize','exports','STRING','username'];(function(_0x4f3d54,_0x1ab387){var _0x469fb0=function(_0x43a9ac){while(--_0x43a9ac){_0x4f3d54['push'](_0x4f3d54['shift']());}};_0x469fb0(++_0x1ab387);}(_0x0365,0xb5));var _0x5036=function(_0x32e264,_0x41cee8){_0x32e264=_0x32e264-0x0;var _0x1d7175=_0x0365[_0x32e264];return _0x1d7175;};'use strict';var Sequelize=require(_0x5036('0x0'));module[_0x5036('0x1')]={'name':{'type':Sequelize[_0x5036('0x2')]},'description':{'type':Sequelize[_0x5036('0x2')]},'username':{'type':Sequelize[_0x5036('0x2')],'unique':_0x5036('0x3')},'password':{'type':Sequelize[_0x5036('0x2')]},'email':{'type':Sequelize[_0x5036('0x2')]},'remoteUri':{'type':Sequelize[_0x5036('0x2')],'unique':_0x5036('0x4')},'serverUrl':{'type':Sequelize[_0x5036('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index cbef1d3..546fa39 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 _0x4f5d=['substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','forEach','label','push','all','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','statusCode','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','html-pdf','eml-format','zip-dir','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','../../config/utils','../../config/environment','../../mysqldb','../../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~!@#$%^&-_=+[{]}.','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','end','status','json','count','offset','limit','Content-Range','apply','reject','save','destroy','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','options','includeAll','include','findAll','rows','show','params','merge','find','catch','create','body','update','getConfigurations','findOne','ServicenowConfiguration','Subjects','getSubjects','channel','Descriptions','ServicenowField','hold_reason','notify','incident_state','severity','category','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','knowledge','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','expected_start','opened_at','business_duration','group_list','resolved_at','approval_set','subcategory','work_notes','short_description','close_code','correlation_display','work_start','business_stc','additional_assignee_list','description','close_notes','closed_by','contact_type','reopened_by','problem_id','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','due_date','sys_mod_count','escalation','upon_approval','correlation_id','location','username','password','email','serverUrl','slice'];(function(_0x7d9c61,_0x2e8c97){var _0x39e41f=function(_0x917dae){while(--_0x917dae){_0x7d9c61['push'](_0x7d9c61['shift']());}};_0x39e41f(++_0x2e8c97);}(_0x4f5d,0xda));var _0xd4f5=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x4f5d[_0x16b9ed];return _0x66b1f8;};'use strict';var pdf=require(_0xd4f5('0x0'));var emlformat=require(_0xd4f5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd4f5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd4f5('0x3'));var moment=require(_0xd4f5('0x4'));var BPromise=require(_0xd4f5('0x5'));var Mustache=require(_0xd4f5('0x6'));var util=require(_0xd4f5('0x7'));var path=require(_0xd4f5('0x8'));var sox=require('sox');var csv=require(_0xd4f5('0x9'));var ejs=require(_0xd4f5('0xa'));var fs=require('fs');var _=require(_0xd4f5('0xb'));var squel=require(_0xd4f5('0xc'));var crypto=require(_0xd4f5('0xd'));var jsforce=require(_0xd4f5('0xe'));var deskjs=require(_0xd4f5('0xf'));var toCsv=require(_0xd4f5('0x9'));var querystring=require(_0xd4f5('0x10'));var Papa=require(_0xd4f5('0x11'));var Redis=require(_0xd4f5('0x12'));var authService=require(_0xd4f5('0x13'));var qs=require(_0xd4f5('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd4f5('0x15'));var config=require(_0xd4f5('0x16'));var db=require(_0xd4f5('0x17'))['db'];var integrations=require(_0xd4f5('0x18'));var jayson=require('jayson/promise');var client=jayson[_0xd4f5('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x3e4064,_0x3fb7ca,_0x392e9f){if(_0x392e9f){var _0x183302=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x183302[_0xd4f5('0x1a')](_0x3fb7ca)){return _0x3e4064;}else{throw new db[(_0xd4f5('0x1b'))][(_0xd4f5('0x1c'))](_0xd4f5('0x1d'));}}else{return _0x3e4064;}}function respondWithRpcPromise(_0x46ef0b,_0x49b3f9,_0x4c82ab,_0x5216e7){return new BPromise(function(_0x1f3c4d,_0xf9bda6){var _0x1faafc=_0x5216e7||client;return _0x1faafc['request'](_0x46ef0b,_0x4c82ab)[_0xd4f5('0x1e')](function(_0x208b07){logger[_0xd4f5('0x1f')](_0xd4f5('0x20'),_0x49b3f9,_0xd4f5('0x21'));logger[_0xd4f5('0x22')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x49b3f9,_0xd4f5('0x21'),JSON['stringify'](_0x208b07));if(_0x208b07[_0xd4f5('0x23')]){if(_0x208b07[_0xd4f5('0x23')]['code']===0x1f4){logger['error'](_0xd4f5('0x20'),_0x49b3f9,_0x208b07[_0xd4f5('0x23')][_0xd4f5('0x24')]);return _0xf9bda6(_0x208b07[_0xd4f5('0x23')][_0xd4f5('0x24')]);}logger[_0xd4f5('0x23')](_0xd4f5('0x20'),_0x49b3f9,_0x208b07[_0xd4f5('0x23')][_0xd4f5('0x24')]);return _0x1f3c4d(_0x208b07[_0xd4f5('0x23')][_0xd4f5('0x24')]);}else{logger[_0xd4f5('0x1f')]('ServicenowAccount,\x20%s,\x20%s',_0x49b3f9,_0xd4f5('0x21'));_0x1f3c4d(_0x208b07[_0xd4f5('0x25')]['message']);}})['catch'](function(_0x2599c2){logger[_0xd4f5('0x23')](_0xd4f5('0x20'),_0x49b3f9,_0x2599c2);_0xf9bda6(_0x2599c2);});});}function respondWithStatusCode(_0xc53282,_0x12472e){_0x12472e=_0x12472e||0xcc;return function(_0x351d6c){if(_0x351d6c){return _0xc53282['sendStatus'](_0x12472e);}return _0xc53282['status'](_0x12472e)[_0xd4f5('0x26')]();};}function respondWithResult(_0x4b8115,_0x39d90d){_0x39d90d=_0x39d90d||0xc8;return function(_0x218b49){if(_0x218b49){return _0x4b8115[_0xd4f5('0x27')](_0x39d90d)[_0xd4f5('0x28')](_0x218b49);}};}function respondWithFilteredResult(_0x53c6a0,_0x1ae0f2){return function(_0x44cafc){if(_0x44cafc){var _0x3c78bc=_0x44cafc[_0xd4f5('0x29')],_0x560c04=_0x1ae0f2['offset'],_0x3ef4ba=_0x1ae0f2[_0xd4f5('0x2a')]+_0x1ae0f2[_0xd4f5('0x2b')],_0x30e21e;if(_0x3ef4ba>=_0x3c78bc){_0x3ef4ba=_0x3c78bc;_0x30e21e=0xc8;}else{_0x30e21e=0xce;}_0x53c6a0[_0xd4f5('0x27')](_0x30e21e);return _0x53c6a0['set'](_0xd4f5('0x2c'),_0x560c04+'-'+_0x3ef4ba+'/'+_0x3c78bc)[_0xd4f5('0x28')](_0x44cafc);}return null;};}function patchUpdates(_0x54c8dc){return function(_0x59ebc4){try{jsonpatch[_0xd4f5('0x2d')](_0x59ebc4,_0x54c8dc,!![]);}catch(_0x535ddf){return BPromise[_0xd4f5('0x2e')](_0x535ddf);}return _0x59ebc4[_0xd4f5('0x2f')]();};}function saveUpdates(_0x472a35,_0x23de80){return function(_0x3d56ac){if(_0x3d56ac){return _0x3d56ac['update'](_0x472a35)[_0xd4f5('0x1e')](function(_0x188304){return _0x188304;});}return null;};}function removeEntity(_0x297902,_0x492b12){return function(_0x3b6580){if(_0x3b6580){return _0x3b6580[_0xd4f5('0x30')]()['then'](function(){_0x297902[_0xd4f5('0x27')](0xcc)[_0xd4f5('0x26')]();});}};}function handleEntityNotFound(_0x25ca71,_0x3d566f){return function(_0x538aee){if(!_0x538aee){_0x25ca71['sendStatus'](0x194);}return _0x538aee;};}function handleError(_0x31431c,_0x238cc6){_0x238cc6=_0x238cc6||0x1f4;return function(_0x1066ea){logger[_0xd4f5('0x23')](_0x1066ea[_0xd4f5('0x31')]);if(_0x1066ea[_0xd4f5('0x32')]){delete _0x1066ea['name'];}_0x31431c['status'](_0x238cc6)[_0xd4f5('0x33')](_0x1066ea);};}exports['index']=function(_0xe06436,_0x3676d4){var _0x37c456={},_0xda4e39={},_0x291d0b={'count':0x0,'rows':[]};var _0x2831bf=_[_0xd4f5('0x34')](db[_0xd4f5('0x35')][_0xd4f5('0x36')],function(_0x2d9eeb){return{'name':_0x2d9eeb[_0xd4f5('0x37')],'type':_0x2d9eeb[_0xd4f5('0x38')][_0xd4f5('0x39')]};});_0xda4e39[_0xd4f5('0x3a')]=_[_0xd4f5('0x34')](_0x2831bf,_0xd4f5('0x32'));_0xda4e39[_0xd4f5('0x3b')]=_[_0xd4f5('0x3c')](_0xe06436[_0xd4f5('0x3b')]);_0xda4e39['filters']=_[_0xd4f5('0x3d')](_0xda4e39[_0xd4f5('0x3a')],_0xda4e39[_0xd4f5('0x3b')]);_0x37c456['attributes']=_[_0xd4f5('0x3d')](_0xda4e39[_0xd4f5('0x3a')],qs[_0xd4f5('0x3e')](_0xe06436[_0xd4f5('0x3b')][_0xd4f5('0x3e')]));_0x37c456['attributes']=_0x37c456[_0xd4f5('0x3f')][_0xd4f5('0x40')]?_0x37c456['attributes']:_0xda4e39[_0xd4f5('0x3a')];if(!_0xe06436[_0xd4f5('0x3b')][_0xd4f5('0x41')](_0xd4f5('0x42'))){_0x37c456['limit']=qs[_0xd4f5('0x2b')](_0xe06436[_0xd4f5('0x3b')]['limit']);_0x37c456[_0xd4f5('0x2a')]=qs[_0xd4f5('0x2a')](_0xe06436[_0xd4f5('0x3b')][_0xd4f5('0x2a')]);}_0x37c456[_0xd4f5('0x43')]=qs[_0xd4f5('0x44')](_0xe06436[_0xd4f5('0x3b')][_0xd4f5('0x44')]);_0x37c456['where']=qs[_0xd4f5('0x45')](_[_0xd4f5('0x46')](_0xe06436['query'],_0xda4e39['filters']));if(_0xe06436[_0xd4f5('0x3b')][_0xd4f5('0x47')]){_0x37c456[_0xd4f5('0x48')]=_['merge'](_0x37c456[_0xd4f5('0x48')],{'$or':_[_0xd4f5('0x34')](_0x2831bf,function(_0x1482a1){if(_0x1482a1[_0xd4f5('0x38')]!=='VIRTUAL'){var _0x5e395d={};_0x5e395d[_0x1482a1[_0xd4f5('0x32')]]={'$like':'%'+_0xe06436[_0xd4f5('0x3b')]['filter']+'%'};return _0x5e395d;}})});}_0x37c456=_['merge']({},_0x37c456,_0xe06436[_0xd4f5('0x49')]);var _0x22a804={'where':_0x37c456['where']};return db[_0xd4f5('0x35')][_0xd4f5('0x29')](_0x22a804)[_0xd4f5('0x1e')](function(_0x4d122b){_0x291d0b['count']=_0x4d122b;if(_0xe06436[_0xd4f5('0x3b')][_0xd4f5('0x4a')]){_0x37c456[_0xd4f5('0x4b')]=[{'all':!![]}];}return db[_0xd4f5('0x35')][_0xd4f5('0x4c')](_0x37c456);})[_0xd4f5('0x1e')](function(_0x5e43f4){_0x291d0b[_0xd4f5('0x4d')]=_0x5e43f4;return _0x291d0b;})[_0xd4f5('0x1e')](respondWithFilteredResult(_0x3676d4,_0x37c456))['catch'](handleError(_0x3676d4,null));};exports[_0xd4f5('0x4e')]=function(_0x546dda,_0x271dca){var _0x2b3255={'raw':![],'where':{'id':_0x546dda[_0xd4f5('0x4f')]['id']}},_0x23b83e={};_0x23b83e['model']=_[_0xd4f5('0x3c')](db['ServicenowAccount'][_0xd4f5('0x36')]);_0x23b83e['query']=_[_0xd4f5('0x3c')](_0x546dda[_0xd4f5('0x3b')]);_0x23b83e[_0xd4f5('0x45')]=_['intersection'](_0x23b83e['model'],_0x23b83e[_0xd4f5('0x3b')]);_0x2b3255[_0xd4f5('0x3f')]=_[_0xd4f5('0x3d')](_0x23b83e[_0xd4f5('0x3a')],qs[_0xd4f5('0x3e')](_0x546dda['query'][_0xd4f5('0x3e')]));_0x2b3255['attributes']=_0x2b3255['attributes'][_0xd4f5('0x40')]?_0x2b3255[_0xd4f5('0x3f')]:_0x23b83e[_0xd4f5('0x3a')];if(_0x546dda['query'][_0xd4f5('0x4a')]){_0x2b3255[_0xd4f5('0x4b')]=[{'all':!![]}];}_0x2b3255=_[_0xd4f5('0x50')]({},_0x2b3255,_0x546dda[_0xd4f5('0x49')]);return db[_0xd4f5('0x35')][_0xd4f5('0x51')](_0x2b3255)['then'](handleEntityNotFound(_0x271dca,null))['then'](respondWithResult(_0x271dca,null))[_0xd4f5('0x52')](handleError(_0x271dca,null));};exports[_0xd4f5('0x53')]=function(_0x2e0622,_0x37660a){return db[_0xd4f5('0x35')][_0xd4f5('0x53')](_0x2e0622[_0xd4f5('0x54')],{})['then'](respondWithResult(_0x37660a,0xc9))[_0xd4f5('0x52')](handleError(_0x37660a,null));};exports[_0xd4f5('0x55')]=function(_0x59664d,_0xd9a556){if(_0x59664d['body']['id']){delete _0x59664d['body']['id'];}return db[_0xd4f5('0x35')][_0xd4f5('0x51')]({'where':{'id':_0x59664d[_0xd4f5('0x4f')]['id']}})[_0xd4f5('0x1e')](handleEntityNotFound(_0xd9a556,null))[_0xd4f5('0x1e')](saveUpdates(_0x59664d[_0xd4f5('0x54')],null))[_0xd4f5('0x1e')](respondWithResult(_0xd9a556,null))['catch'](handleError(_0xd9a556,null));};exports['destroy']=function(_0x2cd321,_0x3d878b){return db['ServicenowAccount'][_0xd4f5('0x51')]({'where':{'id':_0x2cd321[_0xd4f5('0x4f')]['id']}})[_0xd4f5('0x1e')](handleEntityNotFound(_0x3d878b,null))[_0xd4f5('0x1e')](removeEntity(_0x3d878b,null))[_0xd4f5('0x52')](handleError(_0x3d878b,null));};exports[_0xd4f5('0x56')]=function(_0x3853f6,_0xe911c1,_0x5c6563){var _0x40154c={};var _0x30198c={};var _0x274e2e;var _0x3f99e6;return db[_0xd4f5('0x35')][_0xd4f5('0x57')]({'where':{'id':_0x3853f6[_0xd4f5('0x4f')]['id']}})[_0xd4f5('0x1e')](handleEntityNotFound(_0xe911c1,null))[_0xd4f5('0x1e')](function(_0x2bd132){if(_0x2bd132){_0x274e2e=_0x2bd132;_0x30198c[_0xd4f5('0x3a')]=_[_0xd4f5('0x3c')](db[_0xd4f5('0x58')][_0xd4f5('0x36')]);_0x30198c[_0xd4f5('0x3b')]=_['keys'](_0x3853f6[_0xd4f5('0x3b')]);_0x30198c['filters']=_[_0xd4f5('0x3d')](_0x30198c[_0xd4f5('0x3a')],_0x30198c[_0xd4f5('0x3b')]);_0x40154c['attributes']=_['intersection'](_0x30198c[_0xd4f5('0x3a')],qs[_0xd4f5('0x3e')](_0x3853f6[_0xd4f5('0x3b')][_0xd4f5('0x3e')]));_0x40154c[_0xd4f5('0x3f')]=_0x40154c[_0xd4f5('0x3f')]['length']?_0x40154c[_0xd4f5('0x3f')]:_0x30198c['model'];_0x40154c['order']=qs[_0xd4f5('0x44')](_0x3853f6[_0xd4f5('0x3b')][_0xd4f5('0x44')]);_0x40154c[_0xd4f5('0x48')]=qs['filters'](_['pick'](_0x3853f6[_0xd4f5('0x3b')],_0x30198c['filters']));if(_0x3853f6[_0xd4f5('0x3b')][_0xd4f5('0x47')]){_0x40154c[_0xd4f5('0x48')]=_['merge'](_0x40154c[_0xd4f5('0x48')],{'$or':_[_0xd4f5('0x34')](_0x40154c[_0xd4f5('0x3f')],function(_0x3f4126){var _0x5d5ff4={};_0x5d5ff4[_0x3f4126]={'$like':'%'+_0x3853f6[_0xd4f5('0x3b')]['filter']+'%'};return _0x5d5ff4;})});}_0x40154c=_[_0xd4f5('0x50')]({},_0x40154c,_0x3853f6[_0xd4f5('0x49')]);return _0x274e2e[_0xd4f5('0x56')](_0x40154c);}})[_0xd4f5('0x1e')](function(_0x5ab0c4){if(_0x5ab0c4){_0x3f99e6=_0x5ab0c4[_0xd4f5('0x40')];if(!_0x3853f6[_0xd4f5('0x3b')][_0xd4f5('0x41')](_0xd4f5('0x42'))){_0x40154c[_0xd4f5('0x2b')]=qs['limit'](_0x3853f6[_0xd4f5('0x3b')][_0xd4f5('0x2b')]);_0x40154c['offset']=qs['offset'](_0x3853f6[_0xd4f5('0x3b')][_0xd4f5('0x2a')]);}return _0x274e2e['getConfigurations'](_0x40154c);}})[_0xd4f5('0x1e')](function(_0x203c6d){if(_0x203c6d){return _0x203c6d?{'count':_0x3f99e6,'rows':_0x203c6d}:null;}})[_0xd4f5('0x1e')](respondWithResult(_0xe911c1,null))['catch'](handleError(_0xe911c1,null));};exports['addConfiguration']=function(_0xcaf972,_0x40123b,_0x2598b2){if(_0xcaf972['body']['id']){delete _0xcaf972[_0xd4f5('0x54')]['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0xcaf972[_0xd4f5('0x4f')]['id']}})[_0xd4f5('0x1e')](handleEntityNotFound(_0x40123b,null))[_0xd4f5('0x1e')](function(_0x54c2b1){if(_0x54c2b1){_0xcaf972[_0xd4f5('0x54')]['AccountId']=_0x54c2b1['id'];_0xcaf972['body'][_0xd4f5('0x59')]=integrations[_0xd4f5('0x5a')](_0xcaf972['body'][_0xd4f5('0x5b')],_0xcaf972[_0xd4f5('0x54')][_0xd4f5('0x38')]);_0xcaf972[_0xd4f5('0x54')][_0xd4f5('0x5c')]=integrations['getDescriptions'](_0xcaf972[_0xd4f5('0x54')][_0xd4f5('0x5b')],_0xcaf972[_0xd4f5('0x54')]['type']);return db[_0xd4f5('0x58')][_0xd4f5('0x53')](_0xcaf972[_0xd4f5('0x54')],{'include':[{'model':db[_0xd4f5('0x5d')],'as':'Subjects'},{'model':db[_0xd4f5('0x5d')],'as':_0xd4f5('0x5c')}]});}return null;})[_0xd4f5('0x1e')](respondWithResult(_0x40123b,null))[_0xd4f5('0x52')](handleError(_0x40123b,null));};exports['getFields']=function(_0x40ce57,_0x2232c6,_0x191541){var _0x9de310=['made_sla',_0xd4f5('0x5e'),'knowledge','subcategory','close_code',_0xd4f5('0x5f'),_0xd4f5('0x60'),_0xd4f5('0x61'),_0xd4f5('0x62')];var _0x45a89f=[_0xd4f5('0x63'),_0xd4f5('0x64'),_0xd4f5('0x65'),_0xd4f5('0x66'),_0xd4f5('0x67'),_0xd4f5('0x68'),_0xd4f5('0x69'),_0xd4f5('0x5e'),_0xd4f5('0x6a'),_0xd4f5('0x6b'),_0xd4f5('0x6c'),'sys_updated_by',_0xd4f5('0x6d'),'user_input',_0xd4f5('0x6e'),_0xd4f5('0x6f'),_0xd4f5('0x70'),_0xd4f5('0x71'),_0xd4f5('0x72'),'order','calendar_stc',_0xd4f5('0x73'),_0xd4f5('0x74'),_0xd4f5('0x75'),_0xd4f5('0x76'),_0xd4f5('0x77'),_0xd4f5('0x78'),_0xd4f5('0x79'),_0xd4f5('0x7a'),_0xd4f5('0x7b'),_0xd4f5('0x7c'),'time_worked',_0xd4f5('0x7d'),_0xd4f5('0x7e'),_0xd4f5('0x7f'),_0xd4f5('0x80'),'work_end','reopened_time',_0xd4f5('0x81'),'caller_id',_0xd4f5('0x82'),_0xd4f5('0x83'),_0xd4f5('0x84'),_0xd4f5('0x85'),_0xd4f5('0x86'),_0xd4f5('0x87'),'delivery_task',_0xd4f5('0x88'),'assignment_group',_0xd4f5('0x89'),_0xd4f5('0x8a'),_0xd4f5('0x8b'),'calendar_duration',_0xd4f5('0x5f'),'sys_class_name',_0xd4f5('0x8c'),_0xd4f5('0x8d'),'follow_up','parent_incident','sys_id',_0xd4f5('0x8e'),_0xd4f5('0x8f'),_0xd4f5('0x60'),'urgency',_0xd4f5('0x90'),'company',_0xd4f5('0x91'),_0xd4f5('0x92'),_0xd4f5('0x93'),_0xd4f5('0x61'),_0xd4f5('0x94'),_0xd4f5('0x95'),_0xd4f5('0x96'),'comments_and_work_notes',_0xd4f5('0x97'),_0xd4f5('0x98'),'reopen_count','sys_tags',_0xd4f5('0x99'),_0xd4f5('0x9a'),_0xd4f5('0x9b'),_0xd4f5('0x9c'),_0xd4f5('0x62')];var _0x472e3a='';var _0xa84045='';var _0x403f1f=[];var _0x2a4bc9='';var _0x806b52='';var _0x12d29d=[];var _0x4462a1='';var _0x5d1f7e='';var _0x426f9e={};var _0x4d46eb='';return db[_0xd4f5('0x35')][_0xd4f5('0x57')]({'where':{'id':_0x40ce57[_0xd4f5('0x4f')]['id']},'attributes':['id',_0xd4f5('0x9d'),_0xd4f5('0x9e'),_0xd4f5('0x9f'),'remoteUri',_0xd4f5('0xa0')]})['then'](handleEntityNotFound(_0x2232c6,null))['then'](function(_0x28d5a3){if(_0x28d5a3){_0x4d46eb=_0x28d5a3['remoteUri'];var _0x485424=_0x4d46eb[_0xd4f5('0xa1')](-0x1);if(_0x485424==='/'){_0x4d46eb=_0x4d46eb[_0xd4f5('0xa2')](0x0,_0x4d46eb[_0xd4f5('0xa3')](_0x485424));}_0x5d1f7e=util[_0xd4f5('0xa4')](_0xd4f5('0xa5'),_0x4d46eb);_0x4462a1=util[_0xd4f5('0xa4')](_0xd4f5('0xa6'),_0x4d46eb);_0x426f9e={'user':_0x28d5a3[_0xd4f5('0x9d')],'pass':_0x28d5a3[_0xd4f5('0x9e')]};var _0x1123cc={'method':_0xd4f5('0xa7'),'uri':_0x5d1f7e+_0xd4f5('0xa8'),'auth':_0x426f9e,'json':!![]};return rp(_0x1123cc);}})[_0xd4f5('0x1e')](function(_0x130dd0){if(_0x130dd0['result'][_0xd4f5('0x40')]>0x0){_0x472e3a=_0x130dd0[_0xd4f5('0x25')];}console[_0xd4f5('0xa9')](_0xd4f5('0xaa'),_0x472e3a);_0x12d29d=[];_0xa84045=Object[_0xd4f5('0xab')]([],_0x472e3a);_[_0xd4f5('0xac')](_0xa84045,function(_0x430792){return!_0x9de310['includes'](_0x430792[_0xd4f5('0x32')]);});_0xa84045[_0xd4f5('0xad')](function(_0x27c517){var _0x5aaf82=createFieldObject(_0x4462a1,_0x426f9e,_0x27c517['internalType'],_0x27c517[_0xd4f5('0x32')],_0x27c517[_0xd4f5('0xae')],![]);_0x12d29d[_0xd4f5('0xaf')](_0x5aaf82);});return Promise[_0xd4f5('0xb0')](_0x12d29d);})[_0xd4f5('0x1e')](function(_0x46c0e7){_0x403f1f=_0x46c0e7;_0x2a4bc9=Object['assign']([],_0x472e3a);console[_0xd4f5('0xa9')](_0xd4f5('0xb1'),_0x472e3a);_[_0xd4f5('0xac')](_0x2a4bc9,function(_0x3d73f6){return _0x45a89f[_0xd4f5('0xb2')](_0x3d73f6[_0xd4f5('0x32')]);});console[_0xd4f5('0xa9')](_0xd4f5('0xb3'),_0x2a4bc9);_0x12d29d=[];_0x2a4bc9[_0xd4f5('0xad')](function(_0x4f081c){var _0x423776=createFieldObject(_0x4462a1,_0x426f9e,_0x4f081c[_0xd4f5('0xb4')],_0x4f081c['name'],_0x4f081c['label'],!![]);_0x12d29d[_0xd4f5('0xaf')](_0x423776);});return Promise[_0xd4f5('0xb0')](_0x12d29d);})['then'](function(_0x28bf75){_0x806b52=_0x28bf75;var _0x22a39c=_0x403f1f['concat'](_0x806b52);return{'count':_0x22a39c[_0xd4f5('0x40')],'rows':_0x22a39c};})[_0xd4f5('0x1e')](respondWithResult(_0x2232c6,null))[_0xd4f5('0x52')](function(_0x4f8df3){console[_0xd4f5('0xa9')]('ServiceNow\x20error:\x20'+_0x4f8df3);var _0x5b6da6=_0x40ce57[_0xd4f5('0x3b')]['test']?0x1f4:_0x4f8df3['statusCode']||0x1f4;logger['error'](_0x4f8df3['stack']);delete _0x4f8df3[_0xd4f5('0x32')];if(_0x5b6da6===0x191){_0x5b6da6=0x190;}_0x2232c6[_0xd4f5('0x27')](_0x5b6da6)[_0xd4f5('0x33')](_0x40ce57[_0xd4f5('0x3b')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x4f8df3[_0xd4f5('0xb5')]}:_0x4f8df3);});};function createFieldObject(_0x326b60,_0x4191f3,_0x49fa1c,_0x325353,_0x296f33,_0x26e37a){return new Promise(function(_0x1add8a,_0x3e4cef){var _0x6e95ac={'id':_0x325353,'name':_0x296f33,'custom':_0x26e37a};if(_0x49fa1c===_0xd4f5('0xb6')){_0x6e95ac[_0xd4f5('0x49')]=[{'name':_0xd4f5('0xb7'),'value':_0xd4f5('0xb8')},{'name':_0xd4f5('0xb9'),'value':_0xd4f5('0xba')}];_0x1add8a(_0x6e95ac);}else{var _0x458c68={'method':_0xd4f5('0xa7'),'uri':_0x326b60+_0xd4f5('0xbb')+_0x325353,'auth':_0x4191f3,'json':!![]};return rp(_0x458c68)[_0xd4f5('0x1e')](function(_0x3e4b01){var _0x4ac4c8=[];if(_0x3e4b01[_0xd4f5('0x25')][_0xd4f5('0x40')]>0x0){_0x3e4b01[_0xd4f5('0x25')]['forEach'](function(_0x257ab1){if(_0x257ab1[_0xd4f5('0xbc')]===_0xd4f5('0xba')){var _0x544bd6={'name':_0x257ab1[_0xd4f5('0xae')],'value':_0x257ab1[_0xd4f5('0xbd')]};_0x4ac4c8[_0xd4f5('0xaf')](_0x544bd6);}});}_0x6e95ac['options']=_0x4ac4c8;if(_0x6e95ac['options']['length']>0x0){_0x1add8a(_0x6e95ac);}else{if(_0x26e37a==![]){_0x1add8a();}else{_0x1add8a(_0x6e95ac);}}});}});} \ No newline at end of file +var _0xd560=['length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','fields','options','find','create','body','destroy','getConfigurations','findOne','ServicenowConfiguration','nolimit','Subjects','channel','Descriptions','getDescriptions','ServicenowField','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','made_sla','caused_by','watch_list','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','state','calendar_stc','closed_at','cmdb_ci','impact','work_notes_list','sys_domain_path','rfc','time_worked','expected_start','opened_at','group_list','work_end','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','description','sys_class_name','close_notes','follow_up','parent_incident','sys_id','contact_type','urgency','problem_id','company','activity_due','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','log','assign','forEach','remove','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','label','all','concat','ServiceNow\x20error:\x20','statusCode','stack','Wrong\x20credentials','True','true','False','false','GET','value','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes'];(function(_0x489187,_0x3f382b){var _0x4a332e=function(_0x51e134){while(--_0x51e134){_0x489187['push'](_0x489187['shift']());}};_0x4a332e(++_0x3f382b);}(_0xd560,0x13e));var _0x0d56=function(_0x19fba4,_0x34a771){_0x19fba4=_0x19fba4-0x0;var _0x37ed3b=_0xd560[_0x19fba4];return _0x37ed3b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0d56('0x0'));var rimraf=require(_0x0d56('0x1'));var zipdir=require(_0x0d56('0x2'));var jsonpatch=require(_0x0d56('0x3'));var rp=require(_0x0d56('0x4'));var moment=require(_0x0d56('0x5'));var BPromise=require(_0x0d56('0x6'));var Mustache=require(_0x0d56('0x7'));var util=require(_0x0d56('0x8'));var path=require(_0x0d56('0x9'));var sox=require(_0x0d56('0xa'));var csv=require('to-csv');var ejs=require(_0x0d56('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0d56('0xc'));var crypto=require(_0x0d56('0xd'));var jsforce=require(_0x0d56('0xe'));var deskjs=require(_0x0d56('0xf'));var toCsv=require(_0x0d56('0x10'));var querystring=require(_0x0d56('0x11'));var Papa=require(_0x0d56('0x12'));var Redis=require('ioredis');var authService=require(_0x0d56('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0d56('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0d56('0x15'))(_0x0d56('0x16'));var utils=require('../../config/utils');var config=require(_0x0d56('0x17'));var db=require(_0x0d56('0x18'))['db'];var integrations=require(_0x0d56('0x19'));var jayson=require(_0x0d56('0x1a'));var client=jayson[_0x0d56('0x1b')][_0x0d56('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x1e261d,_0x2dea8c,_0x34cc6a){if(_0x34cc6a){var _0x39c498=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x39c498[_0x0d56('0x1d')](_0x2dea8c)){return _0x1e261d;}else{throw new db['Sequelize']['ValidationError'](_0x0d56('0x1e'));}}else{return _0x1e261d;}}function respondWithRpcPromise(_0x4a2d67,_0x21cc6e,_0x1018db,_0x515d66){return new BPromise(function(_0x537a55,_0x50477e){var _0x442b68=_0x515d66||client;return _0x442b68[_0x0d56('0x1f')](_0x4a2d67,_0x1018db)[_0x0d56('0x20')](function(_0x1d5044){logger[_0x0d56('0x21')](_0x0d56('0x22'),_0x21cc6e,_0x0d56('0x23'));logger[_0x0d56('0x24')](_0x0d56('0x25'),_0x21cc6e,_0x0d56('0x23'),JSON['stringify'](_0x1d5044));if(_0x1d5044[_0x0d56('0x26')]){if(_0x1d5044['error']['code']===0x1f4){logger[_0x0d56('0x26')](_0x0d56('0x22'),_0x21cc6e,_0x1d5044[_0x0d56('0x26')][_0x0d56('0x27')]);return _0x50477e(_0x1d5044[_0x0d56('0x26')]['message']);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x21cc6e,_0x1d5044['error'][_0x0d56('0x27')]);return _0x537a55(_0x1d5044[_0x0d56('0x26')][_0x0d56('0x27')]);}else{logger['info'](_0x0d56('0x22'),_0x21cc6e,_0x0d56('0x23'));_0x537a55(_0x1d5044[_0x0d56('0x28')][_0x0d56('0x27')]);}})['catch'](function(_0x3f7789){logger[_0x0d56('0x26')](_0x0d56('0x22'),_0x21cc6e,_0x3f7789);_0x50477e(_0x3f7789);});});}function respondWithStatusCode(_0x362138,_0x2a5137){_0x2a5137=_0x2a5137||0xcc;return function(_0xc5acb0){if(_0xc5acb0){return _0x362138[_0x0d56('0x29')](_0x2a5137);}return _0x362138[_0x0d56('0x2a')](_0x2a5137)[_0x0d56('0x2b')]();};}function respondWithResult(_0x254678,_0x105c41){_0x105c41=_0x105c41||0xc8;return function(_0x1aa5e2){if(_0x1aa5e2){return _0x254678[_0x0d56('0x2a')](_0x105c41)['json'](_0x1aa5e2);}};}function respondWithFilteredResult(_0x577f38,_0x18ac1d){return function(_0x2c13c5){if(_0x2c13c5){var _0x58d415=_0x2c13c5[_0x0d56('0x2c')],_0x2e0d67=_0x18ac1d[_0x0d56('0x2d')],_0x4d1416=_0x18ac1d[_0x0d56('0x2d')]+_0x18ac1d[_0x0d56('0x2e')],_0x4cdccc;if(_0x4d1416>=_0x58d415){_0x4d1416=_0x58d415;_0x4cdccc=0xc8;}else{_0x4cdccc=0xce;}_0x577f38[_0x0d56('0x2a')](_0x4cdccc);return _0x577f38[_0x0d56('0x2f')](_0x0d56('0x30'),_0x2e0d67+'-'+_0x4d1416+'/'+_0x58d415)[_0x0d56('0x31')](_0x2c13c5);}return null;};}function patchUpdates(_0x5d93d8){return function(_0x27e73c){try{jsonpatch[_0x0d56('0x32')](_0x27e73c,_0x5d93d8,!![]);}catch(_0x5436a9){return BPromise[_0x0d56('0x33')](_0x5436a9);}return _0x27e73c[_0x0d56('0x34')]();};}function saveUpdates(_0x3450c7,_0x3925d3){return function(_0x384e18){if(_0x384e18){return _0x384e18[_0x0d56('0x35')](_0x3450c7)[_0x0d56('0x20')](function(_0x20bbd1){return _0x20bbd1;});}return null;};}function removeEntity(_0x4493b2,_0x50a761){return function(_0x1f17d9){if(_0x1f17d9){return _0x1f17d9['destroy']()[_0x0d56('0x20')](function(){_0x4493b2['status'](0xcc)[_0x0d56('0x2b')]();});}};}function handleEntityNotFound(_0x144dd8,_0x4c522c){return function(_0x3ac1fd){if(!_0x3ac1fd){_0x144dd8[_0x0d56('0x29')](0x194);}return _0x3ac1fd;};}function handleError(_0x1aeff2,_0x2591ce){_0x2591ce=_0x2591ce||0x1f4;return function(_0xc81869){logger['error'](_0xc81869['stack']);if(_0xc81869[_0x0d56('0x36')]){delete _0xc81869[_0x0d56('0x36')];}_0x1aeff2[_0x0d56('0x2a')](_0x2591ce)[_0x0d56('0x37')](_0xc81869);};}exports[_0x0d56('0x38')]=function(_0x2618eb,_0x5b2f28){var _0x173cee={},_0x189529={},_0x2eeecb={'count':0x0,'rows':[]};var _0x17e501=_[_0x0d56('0x39')](db[_0x0d56('0x3a')][_0x0d56('0x3b')],function(_0x41a233){return{'name':_0x41a233[_0x0d56('0x3c')],'type':_0x41a233[_0x0d56('0x3d')][_0x0d56('0x3e')]};});_0x189529[_0x0d56('0x3f')]=_[_0x0d56('0x39')](_0x17e501,_0x0d56('0x36'));_0x189529[_0x0d56('0x40')]=_[_0x0d56('0x41')](_0x2618eb[_0x0d56('0x40')]);_0x189529['filters']=_[_0x0d56('0x42')](_0x189529['model'],_0x189529[_0x0d56('0x40')]);_0x173cee[_0x0d56('0x43')]=_[_0x0d56('0x42')](_0x189529[_0x0d56('0x3f')],qs['fields'](_0x2618eb['query']['fields']));_0x173cee['attributes']=_0x173cee[_0x0d56('0x43')][_0x0d56('0x44')]?_0x173cee[_0x0d56('0x43')]:_0x189529[_0x0d56('0x3f')];if(!_0x2618eb[_0x0d56('0x40')][_0x0d56('0x45')]('nolimit')){_0x173cee['limit']=qs[_0x0d56('0x2e')](_0x2618eb[_0x0d56('0x40')][_0x0d56('0x2e')]);_0x173cee[_0x0d56('0x2d')]=qs[_0x0d56('0x2d')](_0x2618eb['query']['offset']);}_0x173cee[_0x0d56('0x46')]=qs[_0x0d56('0x47')](_0x2618eb[_0x0d56('0x40')][_0x0d56('0x47')]);_0x173cee[_0x0d56('0x48')]=qs[_0x0d56('0x49')](_[_0x0d56('0x4a')](_0x2618eb[_0x0d56('0x40')],_0x189529[_0x0d56('0x49')]));if(_0x2618eb['query'][_0x0d56('0x4b')]){_0x173cee[_0x0d56('0x48')]=_[_0x0d56('0x4c')](_0x173cee['where'],{'$or':_[_0x0d56('0x39')](_0x17e501,function(_0x3fb37b){if(_0x3fb37b[_0x0d56('0x3d')]!=='VIRTUAL'){var _0x44996d={};_0x44996d[_0x3fb37b[_0x0d56('0x36')]]={'$like':'%'+_0x2618eb[_0x0d56('0x40')]['filter']+'%'};return _0x44996d;}})});}_0x173cee=_[_0x0d56('0x4c')]({},_0x173cee,_0x2618eb['options']);var _0x330426={'where':_0x173cee[_0x0d56('0x48')]};return db[_0x0d56('0x3a')][_0x0d56('0x2c')](_0x330426)[_0x0d56('0x20')](function(_0x1b6f25){_0x2eeecb['count']=_0x1b6f25;if(_0x2618eb['query'][_0x0d56('0x4d')]){_0x173cee[_0x0d56('0x4e')]=[{'all':!![]}];}return db[_0x0d56('0x3a')][_0x0d56('0x4f')](_0x173cee);})['then'](function(_0xda512e){_0x2eeecb[_0x0d56('0x50')]=_0xda512e;return _0x2eeecb;})[_0x0d56('0x20')](respondWithFilteredResult(_0x5b2f28,_0x173cee))[_0x0d56('0x51')](handleError(_0x5b2f28,null));};exports[_0x0d56('0x52')]=function(_0x1b72ff,_0x2647fb){var _0x2d65f7={'raw':![],'where':{'id':_0x1b72ff[_0x0d56('0x53')]['id']}},_0x55992b={};_0x55992b[_0x0d56('0x3f')]=_[_0x0d56('0x41')](db[_0x0d56('0x3a')][_0x0d56('0x3b')]);_0x55992b[_0x0d56('0x40')]=_[_0x0d56('0x41')](_0x1b72ff[_0x0d56('0x40')]);_0x55992b['filters']=_[_0x0d56('0x42')](_0x55992b[_0x0d56('0x3f')],_0x55992b[_0x0d56('0x40')]);_0x2d65f7['attributes']=_['intersection'](_0x55992b[_0x0d56('0x3f')],qs[_0x0d56('0x54')](_0x1b72ff[_0x0d56('0x40')]['fields']));_0x2d65f7[_0x0d56('0x43')]=_0x2d65f7['attributes'][_0x0d56('0x44')]?_0x2d65f7[_0x0d56('0x43')]:_0x55992b['model'];if(_0x1b72ff['query']['includeAll']){_0x2d65f7[_0x0d56('0x4e')]=[{'all':!![]}];}_0x2d65f7=_['merge']({},_0x2d65f7,_0x1b72ff[_0x0d56('0x55')]);return db[_0x0d56('0x3a')][_0x0d56('0x56')](_0x2d65f7)[_0x0d56('0x20')](handleEntityNotFound(_0x2647fb,null))[_0x0d56('0x20')](respondWithResult(_0x2647fb,null))[_0x0d56('0x51')](handleError(_0x2647fb,null));};exports[_0x0d56('0x57')]=function(_0x14e567,_0x2ef1cf){return db[_0x0d56('0x3a')][_0x0d56('0x57')](_0x14e567[_0x0d56('0x58')],{})['then'](respondWithResult(_0x2ef1cf,0xc9))[_0x0d56('0x51')](handleError(_0x2ef1cf,null));};exports[_0x0d56('0x35')]=function(_0x49bfd3,_0x197fc3){if(_0x49bfd3[_0x0d56('0x58')]['id']){delete _0x49bfd3[_0x0d56('0x58')]['id'];}return db[_0x0d56('0x3a')][_0x0d56('0x56')]({'where':{'id':_0x49bfd3[_0x0d56('0x53')]['id']}})['then'](handleEntityNotFound(_0x197fc3,null))[_0x0d56('0x20')](saveUpdates(_0x49bfd3[_0x0d56('0x58')],null))[_0x0d56('0x20')](respondWithResult(_0x197fc3,null))[_0x0d56('0x51')](handleError(_0x197fc3,null));};exports[_0x0d56('0x59')]=function(_0x466100,_0x31002c){return db[_0x0d56('0x3a')][_0x0d56('0x56')]({'where':{'id':_0x466100[_0x0d56('0x53')]['id']}})[_0x0d56('0x20')](handleEntityNotFound(_0x31002c,null))['then'](removeEntity(_0x31002c,null))[_0x0d56('0x51')](handleError(_0x31002c,null));};exports[_0x0d56('0x5a')]=function(_0x139982,_0x40bc8f,_0x318a6a){var _0x3a822d={};var _0x4b2ac1={};var _0x3afa8f;var _0x495ea7;return db[_0x0d56('0x3a')][_0x0d56('0x5b')]({'where':{'id':_0x139982[_0x0d56('0x53')]['id']}})[_0x0d56('0x20')](handleEntityNotFound(_0x40bc8f,null))[_0x0d56('0x20')](function(_0x23ede5){if(_0x23ede5){_0x3afa8f=_0x23ede5;_0x4b2ac1[_0x0d56('0x3f')]=_[_0x0d56('0x41')](db[_0x0d56('0x5c')][_0x0d56('0x3b')]);_0x4b2ac1['query']=_[_0x0d56('0x41')](_0x139982['query']);_0x4b2ac1['filters']=_[_0x0d56('0x42')](_0x4b2ac1['model'],_0x4b2ac1[_0x0d56('0x40')]);_0x3a822d[_0x0d56('0x43')]=_[_0x0d56('0x42')](_0x4b2ac1[_0x0d56('0x3f')],qs[_0x0d56('0x54')](_0x139982['query'][_0x0d56('0x54')]));_0x3a822d[_0x0d56('0x43')]=_0x3a822d[_0x0d56('0x43')][_0x0d56('0x44')]?_0x3a822d[_0x0d56('0x43')]:_0x4b2ac1[_0x0d56('0x3f')];_0x3a822d[_0x0d56('0x46')]=qs[_0x0d56('0x47')](_0x139982[_0x0d56('0x40')]['sort']);_0x3a822d[_0x0d56('0x48')]=qs['filters'](_[_0x0d56('0x4a')](_0x139982[_0x0d56('0x40')],_0x4b2ac1[_0x0d56('0x49')]));if(_0x139982['query']['filter']){_0x3a822d[_0x0d56('0x48')]=_[_0x0d56('0x4c')](_0x3a822d[_0x0d56('0x48')],{'$or':_[_0x0d56('0x39')](_0x3a822d['attributes'],function(_0x32fd46){var _0x5d6682={};_0x5d6682[_0x32fd46]={'$like':'%'+_0x139982[_0x0d56('0x40')][_0x0d56('0x4b')]+'%'};return _0x5d6682;})});}_0x3a822d=_[_0x0d56('0x4c')]({},_0x3a822d,_0x139982[_0x0d56('0x55')]);return _0x3afa8f['getConfigurations'](_0x3a822d);}})[_0x0d56('0x20')](function(_0x3ca456){if(_0x3ca456){_0x495ea7=_0x3ca456[_0x0d56('0x44')];if(!_0x139982[_0x0d56('0x40')]['hasOwnProperty'](_0x0d56('0x5d'))){_0x3a822d[_0x0d56('0x2e')]=qs['limit'](_0x139982[_0x0d56('0x40')][_0x0d56('0x2e')]);_0x3a822d['offset']=qs[_0x0d56('0x2d')](_0x139982[_0x0d56('0x40')][_0x0d56('0x2d')]);}return _0x3afa8f[_0x0d56('0x5a')](_0x3a822d);}})['then'](function(_0x4dc0d5){if(_0x4dc0d5){return _0x4dc0d5?{'count':_0x495ea7,'rows':_0x4dc0d5}:null;}})[_0x0d56('0x20')](respondWithResult(_0x40bc8f,null))[_0x0d56('0x51')](handleError(_0x40bc8f,null));};exports['addConfiguration']=function(_0x3fcc6f,_0x33afa3,_0x5b350f){if(_0x3fcc6f[_0x0d56('0x58')]['id']){delete _0x3fcc6f[_0x0d56('0x58')]['id'];}return db[_0x0d56('0x3a')][_0x0d56('0x5b')]({'where':{'id':_0x3fcc6f['params']['id']}})[_0x0d56('0x20')](handleEntityNotFound(_0x33afa3,null))[_0x0d56('0x20')](function(_0x2020a8){if(_0x2020a8){_0x3fcc6f[_0x0d56('0x58')]['AccountId']=_0x2020a8['id'];_0x3fcc6f[_0x0d56('0x58')][_0x0d56('0x5e')]=integrations['getSubjects'](_0x3fcc6f[_0x0d56('0x58')][_0x0d56('0x5f')],_0x3fcc6f[_0x0d56('0x58')][_0x0d56('0x3d')]);_0x3fcc6f['body'][_0x0d56('0x60')]=integrations[_0x0d56('0x61')](_0x3fcc6f['body'][_0x0d56('0x5f')],_0x3fcc6f['body']['type']);return db['ServicenowConfiguration'][_0x0d56('0x57')](_0x3fcc6f[_0x0d56('0x58')],{'include':[{'model':db[_0x0d56('0x62')],'as':'Subjects'},{'model':db[_0x0d56('0x62')],'as':_0x0d56('0x60')}]});}return null;})[_0x0d56('0x20')](respondWithResult(_0x33afa3,null))[_0x0d56('0x51')](handleError(_0x33afa3,null));};exports['getFields']=function(_0x5313e1,_0x54f56d,_0x1c7e18){var _0x129e19=['made_sla',_0x0d56('0x63'),_0x0d56('0x64'),_0x0d56('0x65'),_0x0d56('0x66'),_0x0d56('0x67'),_0x0d56('0x68'),_0x0d56('0x69'),_0x0d56('0x6a')];var _0x51599e=['parent',_0x0d56('0x6b'),_0x0d56('0x6c'),_0x0d56('0x6d'),'upon_reject',_0x0d56('0x6e'),_0x0d56('0x6f'),_0x0d56('0x63'),_0x0d56('0x70'),_0x0d56('0x71'),_0x0d56('0x72'),_0x0d56('0x73'),'opened_by',_0x0d56('0x74'),_0x0d56('0x75'),_0x0d56('0x76'),_0x0d56('0x77'),'sys_created_by',_0x0d56('0x64'),'order',_0x0d56('0x78'),_0x0d56('0x79'),_0x0d56('0x7a'),'delivery_plan',_0x0d56('0x7b'),'active',_0x0d56('0x7c'),'business_service','priority',_0x0d56('0x7d'),_0x0d56('0x7e'),_0x0d56('0x7f'),_0x0d56('0x80'),_0x0d56('0x81'),'business_duration',_0x0d56('0x82'),_0x0d56('0x83'),'reopened_time',_0x0d56('0x84'),_0x0d56('0x85'),_0x0d56('0x86'),'subcategory',_0x0d56('0x87'),_0x0d56('0x88'),_0x0d56('0x66'),_0x0d56('0x89'),_0x0d56('0x8a'),_0x0d56('0x8b'),_0x0d56('0x8c'),_0x0d56('0x8d'),'additional_assignee_list',_0x0d56('0x8e'),'calendar_duration',_0x0d56('0x67'),_0x0d56('0x8f'),_0x0d56('0x90'),'closed_by',_0x0d56('0x91'),_0x0d56('0x92'),_0x0d56('0x93'),_0x0d56('0x94'),'reopened_by',_0x0d56('0x68'),_0x0d56('0x95'),_0x0d56('0x96'),_0x0d56('0x97'),'reassignment_count',_0x0d56('0x98'),'assigned_to',_0x0d56('0x69'),'comments',_0x0d56('0x99'),_0x0d56('0x9a'),_0x0d56('0x9b'),_0x0d56('0x9c'),_0x0d56('0x9d'),_0x0d56('0x9e'),_0x0d56('0x9f'),_0x0d56('0xa0'),_0x0d56('0xa1'),_0x0d56('0xa2'),'location',_0x0d56('0x6a')];var _0x57579a='';var _0x213c80='';var _0x3b1987=[];var _0x18371d='';var _0x1340f2='';var _0x33fe35=[];var _0x533bdb='';var _0x5c67b7='';var _0x521224={};var _0x2635c6='';return db[_0x0d56('0x3a')][_0x0d56('0x5b')]({'where':{'id':_0x5313e1[_0x0d56('0x53')]['id']},'attributes':['id','username',_0x0d56('0xa3'),_0x0d56('0xa4'),_0x0d56('0xa5'),_0x0d56('0xa6')]})[_0x0d56('0x20')](handleEntityNotFound(_0x54f56d,null))['then'](function(_0x187891){if(_0x187891){_0x2635c6=_0x187891[_0x0d56('0xa5')];var _0x3295f6=_0x2635c6[_0x0d56('0xa7')](-0x1);if(_0x3295f6==='/'){_0x2635c6=_0x2635c6[_0x0d56('0xa8')](0x0,_0x2635c6[_0x0d56('0xa9')](_0x3295f6));}_0x5c67b7=util[_0x0d56('0xaa')]('%s/api/now/doc/table/schema/',_0x2635c6);_0x533bdb=util[_0x0d56('0xaa')](_0x0d56('0xab'),_0x2635c6);_0x521224={'user':_0x187891['username'],'pass':_0x187891['password']};var _0x1abe2d={'method':'GET','uri':_0x5c67b7+'incident?sysparm_display_value=all','auth':_0x521224,'json':!![]};return rp(_0x1abe2d);}})['then'](function(_0x529783){if(_0x529783[_0x0d56('0x28')][_0x0d56('0x44')]>0x0){_0x57579a=_0x529783[_0x0d56('0x28')];}console[_0x0d56('0xac')]('incident\x20table\x20objects',_0x57579a);_0x33fe35=[];_0x213c80=Object[_0x0d56('0xad')]([],_0x57579a);_['remove'](_0x213c80,function(_0x197d26){return!_0x129e19['includes'](_0x197d26[_0x0d56('0x36')]);});_0x213c80[_0x0d56('0xae')](function(_0xa55b9e){var _0x5895de=createFieldObject(_0x533bdb,_0x521224,_0xa55b9e['internalType'],_0xa55b9e[_0x0d56('0x36')],_0xa55b9e['label'],![]);_0x33fe35['push'](_0x5895de);});return Promise['all'](_0x33fe35);})[_0x0d56('0x20')](function(_0x3d3b94){_0x3b1987=_0x3d3b94;_0x18371d=Object[_0x0d56('0xad')]([],_0x57579a);console[_0x0d56('0xac')]('TCL:\x20_object',_0x57579a);_[_0x0d56('0xaf')](_0x18371d,function(_0x3863e7){return _0x51599e[_0x0d56('0xb0')](_0x3863e7[_0x0d56('0x36')]);});console[_0x0d56('0xac')](_0x0d56('0xb1'),_0x18371d);_0x33fe35=[];_0x18371d['forEach'](function(_0x3ab14a){var _0x423592=createFieldObject(_0x533bdb,_0x521224,_0x3ab14a[_0x0d56('0xb2')],_0x3ab14a[_0x0d56('0x36')],_0x3ab14a[_0x0d56('0xb3')],!![]);_0x33fe35['push'](_0x423592);});return Promise[_0x0d56('0xb4')](_0x33fe35);})['then'](function(_0x89b820){_0x1340f2=_0x89b820;var _0x41e06c=_0x3b1987[_0x0d56('0xb5')](_0x1340f2);return{'count':_0x41e06c[_0x0d56('0x44')],'rows':_0x41e06c};})['then'](respondWithResult(_0x54f56d,null))[_0x0d56('0x51')](function(_0x227820){console[_0x0d56('0xac')](_0x0d56('0xb6')+_0x227820);var _0x588a2f=_0x5313e1[_0x0d56('0x40')][_0x0d56('0x1d')]?0x1f4:_0x227820[_0x0d56('0xb7')]||0x1f4;logger[_0x0d56('0x26')](_0x227820[_0x0d56('0xb8')]);delete _0x227820[_0x0d56('0x36')];if(_0x588a2f===0x191){_0x588a2f=0x190;}_0x54f56d[_0x0d56('0x2a')](_0x588a2f)[_0x0d56('0x37')](_0x5313e1[_0x0d56('0x40')]['test']?{'message':_0x0d56('0xb9'),'statusCode':_0x227820['statusCode']}:_0x227820);});};function createFieldObject(_0xba680b,_0x3994c2,_0x4e809f,_0x122f90,_0x3d76c2,_0x95d620){return new Promise(function(_0x21bbf1,_0x4368fb){var _0x184a3e={'id':_0x122f90,'name':_0x3d76c2,'custom':_0x95d620};if(_0x4e809f==='boolean'){_0x184a3e[_0x0d56('0x55')]=[{'name':_0x0d56('0xba'),'value':_0x0d56('0xbb')},{'name':_0x0d56('0xbc'),'value':_0x0d56('0xbd')}];_0x21bbf1(_0x184a3e);}else{var _0x36a1d0={'method':_0x0d56('0xbe'),'uri':_0xba680b+'sys_choice?sysparm_query=name=incident^element='+_0x122f90,'auth':_0x3994c2,'json':!![]};return rp(_0x36a1d0)['then'](function(_0x330098){var _0x3e2f60=[];if(_0x330098[_0x0d56('0x28')][_0x0d56('0x44')]>0x0){_0x330098[_0x0d56('0x28')][_0x0d56('0xae')](function(_0x50af9a){if(_0x50af9a['inactive']==='false'){var _0xb61575={'name':_0x50af9a[_0x0d56('0xb3')],'value':_0x50af9a[_0x0d56('0xbf')]};_0x3e2f60[_0x0d56('0xc0')](_0xb61575);}});}_0x184a3e[_0x0d56('0x55')]=_0x3e2f60;if(_0x184a3e[_0x0d56('0x55')][_0x0d56('0x44')]>0x0){_0x21bbf1(_0x184a3e);}else{if(_0x95d620==![]){_0x21bbf1();}else{_0x21bbf1(_0x184a3e);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 7eddcf1..1622ea2 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 _0x6334=['int_servicenow_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x6334,0x119));var _0x4633=function(_0x3f94f9,_0x42774b){_0x3f94f9=_0x3f94f9-0x0;var _0x46f84f=_0x6334[_0x3f94f9];return _0x46f84f;};'use strict';var _=require(_0x4633('0x0'));var util=require(_0x4633('0x1'));var logger=require(_0x4633('0x2'))(_0x4633('0x3'));var moment=require(_0x4633('0x4'));var BPromise=require(_0x4633('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4633('0x6'));var rimraf=require(_0x4633('0x7'));var config=require(_0x4633('0x8'));var attributes=require(_0x4633('0x9'));var integrations=require(_0x4633('0xa'));module[_0x4633('0xb')]=function(_0x175e14,_0x4a8997){return _0x175e14[_0x4633('0xc')]('ServicenowAccount',attributes,{'tableName':_0x4633('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intServicenowAccount.attributes'];(function(_0x2fb87e,_0x483324){var _0x5de4c1=function(_0x4464b5){while(--_0x4464b5){_0x2fb87e['push'](_0x2fb87e['shift']());}};_0x5de4c1(++_0x483324);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));var integrations=require(_0x7995('0x9'));module[_0x7995('0xa')]=function(_0x219534,_0xbda126){return _0x219534[_0x7995('0xb')]('ServicenowAccount',attributes,{'tableName':_0x7995('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 0f526cf..98e5eb4 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 _0xb065=['../../config/utils','../../config/logger','rpc','jayson/promise','request','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','attributes','map','include','model','then','stringify','find','where','ShowServicenowAccount','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x804193,_0x14c4e8){var _0x2f7b5c=function(_0x282ff8){while(--_0x282ff8){_0x804193['push'](_0x804193['shift']());}};_0x2f7b5c(++_0x14c4e8);}(_0xb065,0x1a8));var _0x5b06=function(_0x2036c3,_0x64526c){_0x2036c3=_0x2036c3-0x0;var _0x3d1799=_0xb065[_0x2036c3];return _0x3d1799;};'use strict';var _=require(_0x5b06('0x0'));var util=require(_0x5b06('0x1'));var moment=require(_0x5b06('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5b06('0x3'));var db=require(_0x5b06('0x4'))['db'];var utils=require(_0x5b06('0x5'));var logger=require(_0x5b06('0x6'))(_0x5b06('0x7'));var config=require('../../config/environment');var jayson=require(_0x5b06('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x7f0e0,_0x214eff,_0x5cc064){return new BPromise(function(_0x698a41,_0xdab616){return client[_0x5b06('0x9')](_0x7f0e0,_0x5cc064)['then'](function(_0x2e4324){logger['info'](_0x5b06('0xa'),_0x214eff,_0x5b06('0xb'));logger[_0x5b06('0xc')](_0x5b06('0xd'),_0x214eff,_0x5b06('0xb'),JSON['stringify'](_0x2e4324));if(_0x2e4324[_0x5b06('0xe')]){if(_0x2e4324[_0x5b06('0xe')][_0x5b06('0xf')]===0x1f4){logger[_0x5b06('0xe')](_0x5b06('0xa'),_0x214eff,_0x2e4324[_0x5b06('0xe')][_0x5b06('0x10')]);return _0xdab616(_0x2e4324[_0x5b06('0xe')]['message']);}logger[_0x5b06('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x214eff,_0x2e4324[_0x5b06('0xe')][_0x5b06('0x10')]);return _0x698a41(_0x2e4324['error'][_0x5b06('0x10')]);}else{logger[_0x5b06('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x214eff,_0x5b06('0xb'));_0x698a41(_0x2e4324['result']['message']);}})[_0x5b06('0x12')](function(_0x23098d){logger[_0x5b06('0xe')](_0x5b06('0xa'),_0x214eff,_0x23098d);_0xdab616(_0x23098d);});});}exports[_0x5b06('0x13')]=function(_0x207672){var _0x386826=this;return new Promise(function(_0x349d90,_0x50c333){return db[_0x5b06('0x14')][_0x5b06('0x15')]({'raw':_0x207672[_0x5b06('0x16')]?_0x207672[_0x5b06('0x16')][_0x5b06('0x17')]===undefined?!![]:![]:!![],'where':_0x207672['options']?_0x207672[_0x5b06('0x16')]['where']||null:null,'attributes':_0x207672[_0x5b06('0x16')]?_0x207672[_0x5b06('0x16')][_0x5b06('0x18')]||null:null,'limit':_0x207672[_0x5b06('0x16')]?_0x207672[_0x5b06('0x16')]['limit']||null:null,'include':_0x207672['options']?_0x207672['options']['include']?_[_0x5b06('0x19')](_0x207672['options'][_0x5b06('0x1a')],function(_0x92885a){return{'model':db[_0x92885a['model']],'as':_0x92885a['as'],'attributes':_0x92885a[_0x5b06('0x18')],'include':_0x92885a[_0x5b06('0x1a')]?_['map'](_0x92885a[_0x5b06('0x1a')],function(_0x14c279){return{'model':db[_0x14c279[_0x5b06('0x1b')]],'as':_0x14c279['as'],'attributes':_0x14c279[_0x5b06('0x18')],'include':_0x14c279[_0x5b06('0x1a')]?_['map'](_0x14c279[_0x5b06('0x1a')],function(_0x1edb87){return{'model':db[_0x1edb87[_0x5b06('0x1b')]],'as':_0x1edb87['as'],'attributes':_0x1edb87[_0x5b06('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5b06('0x1c')](function(_0x4fe65c){logger[_0x5b06('0x11')]('GetServicenowAccount',_0x207672);logger[_0x5b06('0xc')](_0x5b06('0x13'),_0x207672,JSON[_0x5b06('0x1d')](_0x4fe65c));_0x349d90(_0x4fe65c);})[_0x5b06('0x12')](function(_0x5f4520){logger[_0x5b06('0xe')]('GetServicenowAccount',_0x5f4520[_0x5b06('0x10')],_0x207672);_0x50c333(_0x386826[_0x5b06('0xe')](0x1f4,_0x5f4520[_0x5b06('0x10')]));});});};exports['ShowServicenowAccount']=function(_0x4d449d){var _0x4a7f4a=this;return new Promise(function(_0x1c6287,_0x15f571){return db['ServicenowAccount'][_0x5b06('0x1e')]({'raw':_0x4d449d[_0x5b06('0x16')]?_0x4d449d[_0x5b06('0x16')][_0x5b06('0x17')]===undefined?!![]:![]:!![],'where':_0x4d449d[_0x5b06('0x16')]?_0x4d449d[_0x5b06('0x16')][_0x5b06('0x1f')]||null:null,'attributes':_0x4d449d[_0x5b06('0x16')]?_0x4d449d[_0x5b06('0x16')]['attributes']||null:null,'include':_0x4d449d['options']?_0x4d449d['options'][_0x5b06('0x1a')]?_[_0x5b06('0x19')](_0x4d449d[_0x5b06('0x16')][_0x5b06('0x1a')],function(_0x48e8dd){return{'model':db[_0x48e8dd[_0x5b06('0x1b')]],'as':_0x48e8dd['as'],'attributes':_0x48e8dd[_0x5b06('0x18')],'include':_0x48e8dd[_0x5b06('0x1a')]?_[_0x5b06('0x19')](_0x48e8dd['include'],function(_0xe33bcb){return{'model':db[_0xe33bcb[_0x5b06('0x1b')]],'as':_0xe33bcb['as'],'attributes':_0xe33bcb[_0x5b06('0x18')],'include':_0xe33bcb[_0x5b06('0x1a')]?_[_0x5b06('0x19')](_0xe33bcb[_0x5b06('0x1a')],function(_0x48f147){return{'model':db[_0x48f147[_0x5b06('0x1b')]],'as':_0x48f147['as'],'attributes':_0x48f147[_0x5b06('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5b06('0x1c')](function(_0x291fd4){logger['info'](_0x5b06('0x20'),_0x4d449d);logger['debug'](_0x5b06('0x20'),_0x4d449d,JSON[_0x5b06('0x1d')](_0x291fd4));_0x1c6287(_0x291fd4);})[_0x5b06('0x12')](function(_0x3a76e4){logger['error']('ShowServicenowAccount',_0x3a76e4['message'],_0x4d449d);_0x15f571(_0x4a7f4a['error'](0x1f4,_0x3a76e4[_0x5b06('0x10')]));});});}; \ No newline at end of file +var _0x5e0e=['catch','findAll','options','raw','where','attributes','limit','include','model','map','GetServicenowAccount','ShowServicenowAccount','ServicenowAccount','find','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x490e0a,_0x1eca50){var _0x212ff2=function(_0x281eb2){while(--_0x281eb2){_0x490e0a['push'](_0x490e0a['shift']());}};_0x212ff2(++_0x1eca50);}(_0x5e0e,0xc7));var _0xe5e0=function(_0x4d36a4,_0x303dd0){_0x4d36a4=_0x4d36a4-0x0;var _0x8d4548=_0x5e0e[_0x4d36a4];return _0x8d4548;};'use strict';var _=require('lodash');var util=require(_0xe5e0('0x0'));var moment=require(_0xe5e0('0x1'));var BPromise=require(_0xe5e0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe5e0('0x3'));var db=require(_0xe5e0('0x4'))['db'];var utils=require(_0xe5e0('0x5'));var logger=require(_0xe5e0('0x6'))(_0xe5e0('0x7'));var config=require(_0xe5e0('0x8'));var jayson=require(_0xe5e0('0x9'));var client=jayson[_0xe5e0('0xa')][_0xe5e0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a9a1d,_0xc5fac5,_0xb546de){return new BPromise(function(_0x26ab6c,_0x955652){return client['request'](_0x1a9a1d,_0xb546de)[_0xe5e0('0xc')](function(_0x52cfea){logger[_0xe5e0('0xd')](_0xe5e0('0xe'),_0xc5fac5,_0xe5e0('0xf'));logger[_0xe5e0('0x10')](_0xe5e0('0x11'),_0xc5fac5,_0xe5e0('0xf'),JSON[_0xe5e0('0x12')](_0x52cfea));if(_0x52cfea[_0xe5e0('0x13')]){if(_0x52cfea[_0xe5e0('0x13')][_0xe5e0('0x14')]===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0xc5fac5,_0x52cfea['error']['message']);return _0x955652(_0x52cfea[_0xe5e0('0x13')][_0xe5e0('0x15')]);}logger['error'](_0xe5e0('0xe'),_0xc5fac5,_0x52cfea[_0xe5e0('0x13')][_0xe5e0('0x15')]);return _0x26ab6c(_0x52cfea[_0xe5e0('0x13')]['message']);}else{logger[_0xe5e0('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0xc5fac5,_0xe5e0('0xf'));_0x26ab6c(_0x52cfea[_0xe5e0('0x16')][_0xe5e0('0x15')]);}})[_0xe5e0('0x17')](function(_0x269c50){logger[_0xe5e0('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0xc5fac5,_0x269c50);_0x955652(_0x269c50);});});}exports['GetServicenowAccount']=function(_0x589493){var _0x292339=this;return new Promise(function(_0x39a470,_0x417063){return db['ServicenowAccount'][_0xe5e0('0x18')]({'raw':_0x589493[_0xe5e0('0x19')]?_0x589493[_0xe5e0('0x19')][_0xe5e0('0x1a')]===undefined?!![]:![]:!![],'where':_0x589493[_0xe5e0('0x19')]?_0x589493['options'][_0xe5e0('0x1b')]||null:null,'attributes':_0x589493[_0xe5e0('0x19')]?_0x589493['options'][_0xe5e0('0x1c')]||null:null,'limit':_0x589493['options']?_0x589493[_0xe5e0('0x19')][_0xe5e0('0x1d')]||null:null,'include':_0x589493[_0xe5e0('0x19')]?_0x589493[_0xe5e0('0x19')][_0xe5e0('0x1e')]?_['map'](_0x589493[_0xe5e0('0x19')][_0xe5e0('0x1e')],function(_0x3d85b2){return{'model':db[_0x3d85b2[_0xe5e0('0x1f')]],'as':_0x3d85b2['as'],'attributes':_0x3d85b2['attributes'],'include':_0x3d85b2[_0xe5e0('0x1e')]?_[_0xe5e0('0x20')](_0x3d85b2['include'],function(_0x1d2f31){return{'model':db[_0x1d2f31[_0xe5e0('0x1f')]],'as':_0x1d2f31['as'],'attributes':_0x1d2f31[_0xe5e0('0x1c')],'include':_0x1d2f31[_0xe5e0('0x1e')]?_[_0xe5e0('0x20')](_0x1d2f31[_0xe5e0('0x1e')],function(_0x563f65){return{'model':db[_0x563f65[_0xe5e0('0x1f')]],'as':_0x563f65['as'],'attributes':_0x563f65[_0xe5e0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe5e0('0xc')](function(_0xab1821){logger[_0xe5e0('0xd')](_0xe5e0('0x21'),_0x589493);logger[_0xe5e0('0x10')]('GetServicenowAccount',_0x589493,JSON[_0xe5e0('0x12')](_0xab1821));_0x39a470(_0xab1821);})[_0xe5e0('0x17')](function(_0x42dae5){logger[_0xe5e0('0x13')](_0xe5e0('0x21'),_0x42dae5[_0xe5e0('0x15')],_0x589493);_0x417063(_0x292339[_0xe5e0('0x13')](0x1f4,_0x42dae5[_0xe5e0('0x15')]));});});};exports[_0xe5e0('0x22')]=function(_0x4b1a77){var _0x38a8fa=this;return new Promise(function(_0x1f8f8b,_0x55095d){return db[_0xe5e0('0x23')][_0xe5e0('0x24')]({'raw':_0x4b1a77[_0xe5e0('0x19')]?_0x4b1a77[_0xe5e0('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4b1a77[_0xe5e0('0x19')]?_0x4b1a77['options'][_0xe5e0('0x1b')]||null:null,'attributes':_0x4b1a77[_0xe5e0('0x19')]?_0x4b1a77[_0xe5e0('0x19')][_0xe5e0('0x1c')]||null:null,'include':_0x4b1a77['options']?_0x4b1a77['options'][_0xe5e0('0x1e')]?_[_0xe5e0('0x20')](_0x4b1a77['options']['include'],function(_0x11288e){return{'model':db[_0x11288e['model']],'as':_0x11288e['as'],'attributes':_0x11288e[_0xe5e0('0x1c')],'include':_0x11288e['include']?_[_0xe5e0('0x20')](_0x11288e['include'],function(_0xc66b55){return{'model':db[_0xc66b55[_0xe5e0('0x1f')]],'as':_0xc66b55['as'],'attributes':_0xc66b55[_0xe5e0('0x1c')],'include':_0xc66b55['include']?_[_0xe5e0('0x20')](_0xc66b55['include'],function(_0x4a802b){return{'model':db[_0x4a802b[_0xe5e0('0x1f')]],'as':_0x4a802b['as'],'attributes':_0x4a802b['attributes']};}):[]};}):[]};}):[]:[]})[_0xe5e0('0xc')](function(_0x2bcd88){logger[_0xe5e0('0xd')](_0xe5e0('0x22'),_0x4b1a77);logger['debug'](_0xe5e0('0x22'),_0x4b1a77,JSON[_0xe5e0('0x12')](_0x2bcd88));_0x1f8f8b(_0x2bcd88);})[_0xe5e0('0x17')](function(_0xba3bc4){logger['error'](_0xe5e0('0x22'),_0xba3bc4[_0xe5e0('0x15')],_0x4b1a77);_0x55095d(_0x38a8fa['error'](0x1f4,_0xba3bc4[_0xe5e0('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 7eed2a6..f8010d2 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 _0x20cb=['../../components/interaction/service','isAuthenticated','index','get','/:id','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x8c9741,_0x1362c8){var _0x580e3e=function(_0x31ee83){while(--_0x31ee83){_0x8c9741['push'](_0x8c9741['shift']());}};_0x580e3e(++_0x1362c8);}(_0x20cb,0x18c));var _0xb20c=function(_0xd88607,_0x8fba24){_0xd88607=_0xd88607-0x0;var _0x3f953c=_0x20cb[_0xd88607];return _0x3f953c;};'use strict';var multer=require('multer');var util=require(_0xb20c('0x0'));var path=require('path');var timeout=require(_0xb20c('0x1'));var express=require(_0xb20c('0x2'));var router=express[_0xb20c('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xb20c('0x4'));var config=require('../../config/environment');var controller=require('./intServicenowConfiguration.controller');router['get']('/',auth[_0xb20c('0x5')](),controller[_0xb20c('0x6')]);router[_0xb20c('0x7')](_0xb20c('0x8'),auth[_0xb20c('0x5')](),controller['show']);router[_0xb20c('0x7')](_0xb20c('0x9'),auth[_0xb20c('0x5')](),controller['getFields']);router[_0xb20c('0x7')](_0xb20c('0xa'),auth['isAuthenticated'](),controller[_0xb20c('0xb')]);router[_0xb20c('0x7')](_0xb20c('0xc'),auth[_0xb20c('0x5')](),controller[_0xb20c('0xd')]);router[_0xb20c('0xe')]('/',auth[_0xb20c('0x5')](),controller['create']);router[_0xb20c('0xf')](_0xb20c('0x8'),auth[_0xb20c('0x5')](),controller[_0xb20c('0x10')]);router[_0xb20c('0x11')](_0xb20c('0x8'),auth[_0xb20c('0x5')](),controller[_0xb20c('0x12')]);module[_0xb20c('0x13')]=router; \ No newline at end of file +var _0x817e=['/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','exports','util','path','express','Router','../../components/interaction/service','./intServicenowConfiguration.controller','isAuthenticated','index','get'];(function(_0x3782ac,_0x296a46){var _0x57ebfc=function(_0x1e542b){while(--_0x1e542b){_0x3782ac['push'](_0x3782ac['shift']());}};_0x57ebfc(++_0x296a46);}(_0x817e,0x6e));var _0xe817=function(_0x7e45c5,_0xc9831e){_0x7e45c5=_0x7e45c5-0x0;var _0x4b3ae8=_0x817e[_0x7e45c5];return _0x4b3ae8;};'use strict';var multer=require('multer');var util=require(_0xe817('0x0'));var path=require(_0xe817('0x1'));var timeout=require('connect-timeout');var express=require(_0xe817('0x2'));var router=express[_0xe817('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xe817('0x4'));var config=require('../../config/environment');var controller=require(_0xe817('0x5'));router['get']('/',auth[_0xe817('0x6')](),controller[_0xe817('0x7')]);router[_0xe817('0x8')]('/:id',auth[_0xe817('0x6')](),controller['show']);router[_0xe817('0x8')](_0xe817('0x9'),auth[_0xe817('0x6')](),controller[_0xe817('0xa')]);router[_0xe817('0x8')](_0xe817('0xb'),auth[_0xe817('0x6')](),controller[_0xe817('0xc')]);router[_0xe817('0x8')](_0xe817('0xd'),auth[_0xe817('0x6')](),controller[_0xe817('0xe')]);router[_0xe817('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xe817('0x6')](),controller['update']);router['delete']('/:id',auth[_0xe817('0x6')](),controller['destroy']);module[_0xe817('0x10')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index ef050a5..7fb7d54 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 _0xfc24=['sequelize','exports','STRING'];(function(_0x3b4922,_0x2fa365){var _0x239729=function(_0x82fd7){while(--_0x82fd7){_0x3b4922['push'](_0x3b4922['shift']());}};_0x239729(++_0x2fa365);}(_0xfc24,0xf9));var _0x4fc2=function(_0x1f3aec,_0x24c18e){_0x1f3aec=_0x1f3aec-0x0;var _0x409f0d=_0xfc24[_0x1f3aec];return _0x409f0d;};'use strict';var Sequelize=require(_0x4fc2('0x0'));module[_0x4fc2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4fc2('0x2')]}}; \ No newline at end of file +var _0x2e9d=['sequelize','STRING'];(function(_0x309078,_0x4ee860){var _0x12d2e2=function(_0x183735){while(--_0x183735){_0x309078['push'](_0x309078['shift']());}};_0x12d2e2(++_0x4ee860);}(_0x2e9d,0xbc));var _0xd2e9=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x2e9d[_0x88cd7b];return _0x56fcc8;};'use strict';var Sequelize=require(_0xd2e9('0x0'));module['exports']={'name':{'type':Sequelize[_0xd2e9('0x1')]},'description':{'type':Sequelize[_0xd2e9('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index f4b78aa..302f99f 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 _0xd3e0=['status','end','json','count','offset','limit','apply','reject','save','destroy','stack','name','send','index','ServicenowConfiguration','rawAttributes','type','key','model','map','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','intersection','find','create','body','update','getFields','getSubjects','findOne','ServicenowField','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','Sequelize','request','then','info','request\x20sent','stringify','error','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus'];(function(_0x2bd43c,_0x26ce58){var _0x145a14=function(_0x43b346){while(--_0x43b346){_0x2bd43c['push'](_0x2bd43c['shift']());}};_0x145a14(++_0x26ce58);}(_0xd3e0,0xf2));var _0x0d3e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd3e0[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x0d3e('0x0'));var emlformat=require(_0x0d3e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0d3e('0x2'));var jsonpatch=require(_0x0d3e('0x3'));var rp=require(_0x0d3e('0x4'));var moment=require(_0x0d3e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0d3e('0x6'));var util=require(_0x0d3e('0x7'));var path=require(_0x0d3e('0x8'));var sox=require(_0x0d3e('0x9'));var csv=require('to-csv');var ejs=require(_0x0d3e('0xa'));var fs=require('fs');var _=require(_0x0d3e('0xb'));var squel=require(_0x0d3e('0xc'));var crypto=require(_0x0d3e('0xd'));var jsforce=require(_0x0d3e('0xe'));var deskjs=require(_0x0d3e('0xf'));var toCsv=require(_0x0d3e('0x10'));var querystring=require(_0x0d3e('0x11'));var Papa=require('papaparse');var Redis=require(_0x0d3e('0x12'));var authService=require(_0x0d3e('0x13'));var qs=require(_0x0d3e('0x14'));var as=require(_0x0d3e('0x15'));var hardwareService=require(_0x0d3e('0x16'));var logger=require(_0x0d3e('0x17'))(_0x0d3e('0x18'));var utils=require(_0x0d3e('0x19'));var config=require(_0x0d3e('0x1a'));var db=require(_0x0d3e('0x1b'))['db'];var jayson=require(_0x0d3e('0x1c'));var client=jayson[_0x0d3e('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x5539c8,_0x3c8afa,_0x1c946e){if(_0x1c946e){var _0x5e47ff=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e47ff[_0x0d3e('0x1e')](_0x3c8afa)){return _0x5539c8;}else{throw new db[(_0x0d3e('0x1f'))]['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 _0x5539c8;}}function respondWithRpcPromise(_0xc1a159,_0x25aa26,_0x8188e1,_0x29bcd2){return new BPromise(function(_0x6c4875,_0x4e9ae6){var _0x39672e=_0x29bcd2||client;return _0x39672e[_0x0d3e('0x20')](_0xc1a159,_0x8188e1)[_0x0d3e('0x21')](function(_0x4bd258){logger[_0x0d3e('0x22')]('ServicenowConfiguration,\x20%s,\x20%s',_0x25aa26,_0x0d3e('0x23'));logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x25aa26,_0x0d3e('0x23'),JSON[_0x0d3e('0x24')](_0x4bd258));if(_0x4bd258['error']){if(_0x4bd258[_0x0d3e('0x25')]['code']===0x1f4){logger['error'](_0x0d3e('0x26'),_0x25aa26,_0x4bd258[_0x0d3e('0x25')][_0x0d3e('0x27')]);return _0x4e9ae6(_0x4bd258['error'][_0x0d3e('0x27')]);}logger[_0x0d3e('0x25')](_0x0d3e('0x26'),_0x25aa26,_0x4bd258['error']['message']);return _0x6c4875(_0x4bd258['error'][_0x0d3e('0x27')]);}else{logger['info'](_0x0d3e('0x26'),_0x25aa26,'request\x20sent');_0x6c4875(_0x4bd258[_0x0d3e('0x28')][_0x0d3e('0x27')]);}})[_0x0d3e('0x29')](function(_0x5219d7){logger[_0x0d3e('0x25')](_0x0d3e('0x26'),_0x25aa26,_0x5219d7);_0x4e9ae6(_0x5219d7);});});}function respondWithStatusCode(_0x5c0052,_0x536a49){_0x536a49=_0x536a49||0xcc;return function(_0x567278){if(_0x567278){return _0x5c0052[_0x0d3e('0x2a')](_0x536a49);}return _0x5c0052[_0x0d3e('0x2b')](_0x536a49)[_0x0d3e('0x2c')]();};}function respondWithResult(_0x426035,_0xd62731){_0xd62731=_0xd62731||0xc8;return function(_0x18109e){if(_0x18109e){return _0x426035[_0x0d3e('0x2b')](_0xd62731)[_0x0d3e('0x2d')](_0x18109e);}};}function respondWithFilteredResult(_0x270ef1,_0x34141e){return function(_0xbc9bd7){if(_0xbc9bd7){var _0xa03e7f=_0xbc9bd7[_0x0d3e('0x2e')],_0x224731=_0x34141e[_0x0d3e('0x2f')],_0x29c384=_0x34141e['offset']+_0x34141e[_0x0d3e('0x30')],_0x40cd6c;if(_0x29c384>=_0xa03e7f){_0x29c384=_0xa03e7f;_0x40cd6c=0xc8;}else{_0x40cd6c=0xce;}_0x270ef1[_0x0d3e('0x2b')](_0x40cd6c);return _0x270ef1['set']('Content-Range',_0x224731+'-'+_0x29c384+'/'+_0xa03e7f)[_0x0d3e('0x2d')](_0xbc9bd7);}return null;};}function patchUpdates(_0x24b971){return function(_0x3f6449){try{jsonpatch[_0x0d3e('0x31')](_0x3f6449,_0x24b971,!![]);}catch(_0x57f2f1){return BPromise[_0x0d3e('0x32')](_0x57f2f1);}return _0x3f6449[_0x0d3e('0x33')]();};}function saveUpdates(_0x406fa1,_0x36461f){return function(_0x3fef35){if(_0x3fef35){return _0x3fef35['update'](_0x406fa1)['then'](function(_0x51745b){return _0x51745b;});}return null;};}function removeEntity(_0x53fc89,_0x97bd32){return function(_0x41e539){if(_0x41e539){return _0x41e539[_0x0d3e('0x34')]()['then'](function(){_0x53fc89[_0x0d3e('0x2b')](0xcc)[_0x0d3e('0x2c')]();});}};}function handleEntityNotFound(_0x50d62,_0x315cca){return function(_0x5309f1){if(!_0x5309f1){_0x50d62[_0x0d3e('0x2a')](0x194);}return _0x5309f1;};}function handleError(_0x2b2710,_0x50cffd){_0x50cffd=_0x50cffd||0x1f4;return function(_0x3ea673){logger[_0x0d3e('0x25')](_0x3ea673[_0x0d3e('0x35')]);if(_0x3ea673[_0x0d3e('0x36')]){delete _0x3ea673[_0x0d3e('0x36')];}_0x2b2710[_0x0d3e('0x2b')](_0x50cffd)[_0x0d3e('0x37')](_0x3ea673);};}exports[_0x0d3e('0x38')]=function(_0x5e37c2,_0x210a69){var _0x48aab3={},_0x5b8da6={},_0x48d88e={'count':0x0,'rows':[]};var _0x56b5d9=_['map'](db[_0x0d3e('0x39')][_0x0d3e('0x3a')],function(_0x5acc24){return{'name':_0x5acc24['fieldName'],'type':_0x5acc24[_0x0d3e('0x3b')][_0x0d3e('0x3c')]};});_0x5b8da6[_0x0d3e('0x3d')]=_[_0x0d3e('0x3e')](_0x56b5d9,_0x0d3e('0x36'));_0x5b8da6[_0x0d3e('0x3f')]=_[_0x0d3e('0x40')](_0x5e37c2[_0x0d3e('0x3f')]);_0x5b8da6['filters']=_['intersection'](_0x5b8da6['model'],_0x5b8da6[_0x0d3e('0x3f')]);_0x48aab3[_0x0d3e('0x41')]=_['intersection'](_0x5b8da6['model'],qs[_0x0d3e('0x42')](_0x5e37c2[_0x0d3e('0x3f')]['fields']));_0x48aab3[_0x0d3e('0x41')]=_0x48aab3['attributes'][_0x0d3e('0x43')]?_0x48aab3['attributes']:_0x5b8da6[_0x0d3e('0x3d')];if(!_0x5e37c2['query'][_0x0d3e('0x44')](_0x0d3e('0x45'))){_0x48aab3[_0x0d3e('0x30')]=qs['limit'](_0x5e37c2[_0x0d3e('0x3f')]['limit']);_0x48aab3[_0x0d3e('0x2f')]=qs[_0x0d3e('0x2f')](_0x5e37c2[_0x0d3e('0x3f')][_0x0d3e('0x2f')]);}_0x48aab3[_0x0d3e('0x46')]=qs[_0x0d3e('0x47')](_0x5e37c2[_0x0d3e('0x3f')][_0x0d3e('0x47')]);_0x48aab3[_0x0d3e('0x48')]=qs['filters'](_[_0x0d3e('0x49')](_0x5e37c2[_0x0d3e('0x3f')],_0x5b8da6[_0x0d3e('0x4a')]));if(_0x5e37c2[_0x0d3e('0x3f')][_0x0d3e('0x4b')]){_0x48aab3[_0x0d3e('0x48')]=_[_0x0d3e('0x4c')](_0x48aab3[_0x0d3e('0x48')],{'$or':_[_0x0d3e('0x3e')](_0x56b5d9,function(_0x486cc3){if(_0x486cc3[_0x0d3e('0x3b')]!==_0x0d3e('0x4d')){var _0x12d362={};_0x12d362[_0x486cc3[_0x0d3e('0x36')]]={'$like':'%'+_0x5e37c2['query']['filter']+'%'};return _0x12d362;}})});}_0x48aab3=_[_0x0d3e('0x4c')]({},_0x48aab3,_0x5e37c2[_0x0d3e('0x4e')]);var _0x47a681={'where':_0x48aab3[_0x0d3e('0x48')]};return db[_0x0d3e('0x39')][_0x0d3e('0x2e')](_0x47a681)[_0x0d3e('0x21')](function(_0x367bf7){_0x48d88e['count']=_0x367bf7;if(_0x5e37c2[_0x0d3e('0x3f')][_0x0d3e('0x4f')]){_0x48aab3[_0x0d3e('0x50')]=[{'all':!![]}];}return db[_0x0d3e('0x39')][_0x0d3e('0x51')](_0x48aab3);})[_0x0d3e('0x21')](function(_0x311834){_0x48d88e[_0x0d3e('0x52')]=_0x311834;return _0x48d88e;})['then'](respondWithFilteredResult(_0x210a69,_0x48aab3))[_0x0d3e('0x29')](handleError(_0x210a69,null));};exports[_0x0d3e('0x53')]=function(_0x11f0ba,_0x12137a){var _0x587346={'raw':![],'where':{'id':_0x11f0ba[_0x0d3e('0x54')]['id']}},_0x28e003={};_0x28e003[_0x0d3e('0x3d')]=_[_0x0d3e('0x40')](db[_0x0d3e('0x39')][_0x0d3e('0x3a')]);_0x28e003[_0x0d3e('0x3f')]=_[_0x0d3e('0x40')](_0x11f0ba[_0x0d3e('0x3f')]);_0x28e003[_0x0d3e('0x4a')]=_[_0x0d3e('0x55')](_0x28e003['model'],_0x28e003['query']);_0x587346[_0x0d3e('0x41')]=_['intersection'](_0x28e003[_0x0d3e('0x3d')],qs[_0x0d3e('0x42')](_0x11f0ba[_0x0d3e('0x3f')][_0x0d3e('0x42')]));_0x587346[_0x0d3e('0x41')]=_0x587346[_0x0d3e('0x41')][_0x0d3e('0x43')]?_0x587346['attributes']:_0x28e003[_0x0d3e('0x3d')];if(_0x11f0ba[_0x0d3e('0x3f')][_0x0d3e('0x4f')]){_0x587346[_0x0d3e('0x50')]=[{'all':!![]}];}_0x587346=_['merge']({},_0x587346,_0x11f0ba[_0x0d3e('0x4e')]);return db['ServicenowConfiguration'][_0x0d3e('0x56')](_0x587346)[_0x0d3e('0x21')](handleEntityNotFound(_0x12137a,null))[_0x0d3e('0x21')](respondWithResult(_0x12137a,null))['catch'](handleError(_0x12137a,null));};exports[_0x0d3e('0x57')]=function(_0x7196d3,_0x1a3209){return db[_0x0d3e('0x39')]['create'](_0x7196d3[_0x0d3e('0x58')],{})[_0x0d3e('0x21')](respondWithResult(_0x1a3209,0xc9))['catch'](handleError(_0x1a3209,null));};exports[_0x0d3e('0x59')]=function(_0x1d72b5,_0x2806f9){if(_0x1d72b5[_0x0d3e('0x58')]['id']){delete _0x1d72b5[_0x0d3e('0x58')]['id'];}return db[_0x0d3e('0x39')][_0x0d3e('0x56')]({'where':{'id':_0x1d72b5[_0x0d3e('0x54')]['id']}})[_0x0d3e('0x21')](handleEntityNotFound(_0x2806f9,null))['then'](saveUpdates(_0x1d72b5['body'],null))[_0x0d3e('0x21')](respondWithResult(_0x2806f9,null))[_0x0d3e('0x29')](handleError(_0x2806f9,null));};exports[_0x0d3e('0x34')]=function(_0x4a6403,_0x222c02){return db[_0x0d3e('0x39')][_0x0d3e('0x56')]({'where':{'id':_0x4a6403['params']['id']}})[_0x0d3e('0x21')](handleEntityNotFound(_0x222c02,null))[_0x0d3e('0x21')](removeEntity(_0x222c02,null))[_0x0d3e('0x29')](handleError(_0x222c02,null));};exports[_0x0d3e('0x5a')]=function(_0x5d739e,_0x4b4872,_0x47e7a4){var _0x4e39e1={};var _0x545184={};var _0x13d156;var _0xe75699;return db[_0x0d3e('0x39')]['findOne']({'where':{'id':_0x5d739e[_0x0d3e('0x54')]['id']}})[_0x0d3e('0x21')](handleEntityNotFound(_0x4b4872,null))['then'](function(_0x44f59a){if(_0x44f59a){_0x13d156=_0x44f59a;_0x545184[_0x0d3e('0x3d')]=_['keys'](db['ServicenowField'][_0x0d3e('0x3a')]);_0x545184[_0x0d3e('0x3f')]=_[_0x0d3e('0x40')](_0x5d739e['query']);_0x545184[_0x0d3e('0x4a')]=_['intersection'](_0x545184[_0x0d3e('0x3d')],_0x545184[_0x0d3e('0x3f')]);_0x4e39e1[_0x0d3e('0x41')]=_['intersection'](_0x545184[_0x0d3e('0x3d')],qs['fields'](_0x5d739e[_0x0d3e('0x3f')][_0x0d3e('0x42')]));_0x4e39e1[_0x0d3e('0x41')]=_0x4e39e1[_0x0d3e('0x41')]['length']?_0x4e39e1[_0x0d3e('0x41')]:_0x545184['model'];_0x4e39e1[_0x0d3e('0x46')]=qs[_0x0d3e('0x47')](_0x5d739e[_0x0d3e('0x3f')]['sort']);_0x4e39e1['where']=qs[_0x0d3e('0x4a')](_[_0x0d3e('0x49')](_0x5d739e[_0x0d3e('0x3f')],_0x545184[_0x0d3e('0x4a')]));if(_0x5d739e[_0x0d3e('0x3f')]['filter']){_0x4e39e1[_0x0d3e('0x48')]=_[_0x0d3e('0x4c')](_0x4e39e1['where'],{'$or':_[_0x0d3e('0x3e')](_0x4e39e1[_0x0d3e('0x41')],function(_0x10e098){var _0x3293be={};_0x3293be[_0x10e098]={'$like':'%'+_0x5d739e[_0x0d3e('0x3f')][_0x0d3e('0x4b')]+'%'};return _0x3293be;})});}_0x4e39e1=_[_0x0d3e('0x4c')]({},_0x4e39e1,_0x5d739e[_0x0d3e('0x4e')]);return _0x13d156[_0x0d3e('0x5a')](_0x4e39e1);}})[_0x0d3e('0x21')](function(_0x1a460e){if(_0x1a460e){_0xe75699=_0x1a460e[_0x0d3e('0x43')];if(!_0x5d739e[_0x0d3e('0x3f')][_0x0d3e('0x44')](_0x0d3e('0x45'))){_0x4e39e1[_0x0d3e('0x30')]=qs['limit'](_0x5d739e[_0x0d3e('0x3f')][_0x0d3e('0x30')]);_0x4e39e1['offset']=qs['offset'](_0x5d739e[_0x0d3e('0x3f')][_0x0d3e('0x2f')]);}return _0x13d156[_0x0d3e('0x5a')](_0x4e39e1);}})[_0x0d3e('0x21')](function(_0x2a2c63){if(_0x2a2c63){return _0x2a2c63?{'count':_0xe75699,'rows':_0x2a2c63}:null;}})[_0x0d3e('0x21')](respondWithResult(_0x4b4872,null))[_0x0d3e('0x29')](handleError(_0x4b4872,null));};exports[_0x0d3e('0x5b')]=function(_0x3b01f2,_0x2c7858,_0x172f5d){var _0x107314={};var _0x5ed1a6={};var _0x3c46ab;var _0x3d1498;return db['ServicenowConfiguration'][_0x0d3e('0x5c')]({'where':{'id':_0x3b01f2[_0x0d3e('0x54')]['id']}})[_0x0d3e('0x21')](handleEntityNotFound(_0x2c7858,null))[_0x0d3e('0x21')](function(_0x6b325f){if(_0x6b325f){_0x3c46ab=_0x6b325f;_0x5ed1a6[_0x0d3e('0x3d')]=_['keys'](db[_0x0d3e('0x5d')][_0x0d3e('0x3a')]);_0x5ed1a6[_0x0d3e('0x3f')]=_['keys'](_0x3b01f2[_0x0d3e('0x3f')]);_0x5ed1a6['filters']=_['intersection'](_0x5ed1a6[_0x0d3e('0x3d')],_0x5ed1a6[_0x0d3e('0x3f')]);_0x107314['attributes']=_[_0x0d3e('0x55')](_0x5ed1a6['model'],qs[_0x0d3e('0x42')](_0x3b01f2[_0x0d3e('0x3f')][_0x0d3e('0x42')]));_0x107314[_0x0d3e('0x41')]=_0x107314[_0x0d3e('0x41')][_0x0d3e('0x43')]?_0x107314[_0x0d3e('0x41')]:_0x5ed1a6[_0x0d3e('0x3d')];_0x107314[_0x0d3e('0x46')]=qs[_0x0d3e('0x47')](_0x3b01f2['query']['sort']);_0x107314[_0x0d3e('0x48')]=qs['filters'](_[_0x0d3e('0x49')](_0x3b01f2[_0x0d3e('0x3f')],_0x5ed1a6['filters']));if(_0x3b01f2[_0x0d3e('0x3f')]['filter']){_0x107314['where']=_[_0x0d3e('0x4c')](_0x107314['where'],{'$or':_[_0x0d3e('0x3e')](_0x107314['attributes'],function(_0x8015b8){var _0x2088cf={};_0x2088cf[_0x8015b8]={'$like':'%'+_0x3b01f2[_0x0d3e('0x3f')][_0x0d3e('0x4b')]+'%'};return _0x2088cf;})});}_0x107314=_[_0x0d3e('0x4c')]({},_0x107314,_0x3b01f2[_0x0d3e('0x4e')]);return _0x3c46ab[_0x0d3e('0x5b')](_0x107314);}})[_0x0d3e('0x21')](function(_0xe1482b){if(_0xe1482b){_0x3d1498=_0xe1482b[_0x0d3e('0x43')];if(!_0x3b01f2[_0x0d3e('0x3f')][_0x0d3e('0x44')]('nolimit')){_0x107314[_0x0d3e('0x30')]=qs['limit'](_0x3b01f2['query'][_0x0d3e('0x30')]);_0x107314[_0x0d3e('0x2f')]=qs[_0x0d3e('0x2f')](_0x3b01f2[_0x0d3e('0x3f')][_0x0d3e('0x2f')]);}return _0x3c46ab[_0x0d3e('0x5b')](_0x107314);}})[_0x0d3e('0x21')](function(_0x3078f1){if(_0x3078f1){return _0x3078f1?{'count':_0x3d1498,'rows':_0x3078f1}:null;}})[_0x0d3e('0x21')](respondWithResult(_0x2c7858,null))['catch'](handleError(_0x2c7858,null));};exports['getDescriptions']=function(_0x2d2741,_0x25100f,_0x4d4f09){var _0x4feb7a={};var _0x1b8d03={};var _0x1b6d97;var _0x5d73de;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x2d2741[_0x0d3e('0x54')]['id']}})[_0x0d3e('0x21')](handleEntityNotFound(_0x25100f,null))[_0x0d3e('0x21')](function(_0x1429aa){if(_0x1429aa){_0x1b6d97=_0x1429aa;_0x1b8d03[_0x0d3e('0x3d')]=_['keys'](db['ServicenowField']['rawAttributes']);_0x1b8d03[_0x0d3e('0x3f')]=_[_0x0d3e('0x40')](_0x2d2741[_0x0d3e('0x3f')]);_0x1b8d03[_0x0d3e('0x4a')]=_[_0x0d3e('0x55')](_0x1b8d03['model'],_0x1b8d03[_0x0d3e('0x3f')]);_0x4feb7a[_0x0d3e('0x41')]=_[_0x0d3e('0x55')](_0x1b8d03[_0x0d3e('0x3d')],qs['fields'](_0x2d2741[_0x0d3e('0x3f')][_0x0d3e('0x42')]));_0x4feb7a[_0x0d3e('0x41')]=_0x4feb7a['attributes'][_0x0d3e('0x43')]?_0x4feb7a[_0x0d3e('0x41')]:_0x1b8d03[_0x0d3e('0x3d')];_0x4feb7a[_0x0d3e('0x46')]=qs[_0x0d3e('0x47')](_0x2d2741['query'][_0x0d3e('0x47')]);_0x4feb7a['where']=qs[_0x0d3e('0x4a')](_[_0x0d3e('0x49')](_0x2d2741[_0x0d3e('0x3f')],_0x1b8d03['filters']));if(_0x2d2741[_0x0d3e('0x3f')][_0x0d3e('0x4b')]){_0x4feb7a[_0x0d3e('0x48')]=_['merge'](_0x4feb7a[_0x0d3e('0x48')],{'$or':_[_0x0d3e('0x3e')](_0x4feb7a['attributes'],function(_0x42c74b){var _0x53444d={};_0x53444d[_0x42c74b]={'$like':'%'+_0x2d2741['query'][_0x0d3e('0x4b')]+'%'};return _0x53444d;})});}_0x4feb7a=_['merge']({},_0x4feb7a,_0x2d2741[_0x0d3e('0x4e')]);return _0x1b6d97[_0x0d3e('0x5e')](_0x4feb7a);}})[_0x0d3e('0x21')](function(_0x1ff0e9){if(_0x1ff0e9){_0x5d73de=_0x1ff0e9[_0x0d3e('0x43')];if(!_0x2d2741[_0x0d3e('0x3f')]['hasOwnProperty'](_0x0d3e('0x45'))){_0x4feb7a[_0x0d3e('0x30')]=qs['limit'](_0x2d2741[_0x0d3e('0x3f')]['limit']);_0x4feb7a['offset']=qs[_0x0d3e('0x2f')](_0x2d2741[_0x0d3e('0x3f')][_0x0d3e('0x2f')]);}return _0x1b6d97[_0x0d3e('0x5e')](_0x4feb7a);}})[_0x0d3e('0x21')](function(_0x464673){if(_0x464673){return _0x464673?{'count':_0x5d73de,'rows':_0x464673}:null;}})[_0x0d3e('0x21')](respondWithResult(_0x25100f,null))[_0x0d3e('0x29')](handleError(_0x25100f,null));}; \ No newline at end of file +var _0x3111=['to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../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','ServicenowConfiguration,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','save','update','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','attributes','intersection','model','fields','length','order','sort','where','pick','filter','merge','options','ServicenowConfiguration','count','includeAll','findAll','rows','show','filters','include','find','create','body','params','destroy','getFields','ServicenowField','hasOwnProperty','nolimit','getSubjects','getDescriptions','findOne','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','squel','crypto','desk.js'];(function(_0x4753f3,_0xfa186e){var _0x124353=function(_0x43a04a){while(--_0x43a04a){_0x4753f3['push'](_0x4753f3['shift']());}};_0x124353(++_0xfa186e);}(_0x3111,0x166));var _0x1311=function(_0x49d06e,_0x7000a9){_0x49d06e=_0x49d06e-0x0;var _0x34b0a9=_0x3111[_0x49d06e];return _0x34b0a9;};'use strict';var pdf=require(_0x1311('0x0'));var emlformat=require(_0x1311('0x1'));var rimraf=require(_0x1311('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1311('0x3'));var rp=require(_0x1311('0x4'));var moment=require(_0x1311('0x5'));var BPromise=require(_0x1311('0x6'));var Mustache=require('mustache');var util=require(_0x1311('0x7'));var path=require(_0x1311('0x8'));var sox=require(_0x1311('0x9'));var csv=require('to-csv');var ejs=require(_0x1311('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1311('0xb'));var crypto=require(_0x1311('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1311('0xd'));var toCsv=require(_0x1311('0xe'));var querystring=require(_0x1311('0xf'));var Papa=require(_0x1311('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1311('0x11'));var as=require(_0x1311('0x12'));var hardwareService=require(_0x1311('0x13'));var logger=require(_0x1311('0x14'))(_0x1311('0x15'));var utils=require('../../config/utils');var config=require(_0x1311('0x16'));var db=require(_0x1311('0x17'))['db'];var jayson=require(_0x1311('0x18'));var client=jayson['client'][_0x1311('0x19')]({'port':0x232a});function checkPasswordPattern(_0x5d5788,_0x2f43d5,_0x24bbf3){if(_0x24bbf3){var _0x2cc0e5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2cc0e5[_0x1311('0x1a')](_0x2f43d5)){return _0x5d5788;}else{throw new db[(_0x1311('0x1b'))][(_0x1311('0x1c'))](_0x1311('0x1d'));}}else{return _0x5d5788;}}function respondWithRpcPromise(_0x164a65,_0x3ae50b,_0x28c5f4,_0x3b5017){return new BPromise(function(_0x26d9e2,_0x45819d){var _0x55c1ac=_0x3b5017||client;return _0x55c1ac[_0x1311('0x1e')](_0x164a65,_0x28c5f4)[_0x1311('0x1f')](function(_0x1b3541){logger['info'](_0x1311('0x20'),_0x3ae50b,'request\x20sent');logger[_0x1311('0x21')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x3ae50b,_0x1311('0x22'),JSON['stringify'](_0x1b3541));if(_0x1b3541[_0x1311('0x23')]){if(_0x1b3541[_0x1311('0x23')][_0x1311('0x24')]===0x1f4){logger[_0x1311('0x23')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3ae50b,_0x1b3541['error'][_0x1311('0x25')]);return _0x45819d(_0x1b3541['error'][_0x1311('0x25')]);}logger[_0x1311('0x23')](_0x1311('0x20'),_0x3ae50b,_0x1b3541[_0x1311('0x23')]['message']);return _0x26d9e2(_0x1b3541[_0x1311('0x23')][_0x1311('0x25')]);}else{logger[_0x1311('0x26')](_0x1311('0x20'),_0x3ae50b,_0x1311('0x22'));_0x26d9e2(_0x1b3541[_0x1311('0x27')][_0x1311('0x25')]);}})[_0x1311('0x28')](function(_0x513548){logger[_0x1311('0x23')](_0x1311('0x20'),_0x3ae50b,_0x513548);_0x45819d(_0x513548);});});}function respondWithStatusCode(_0x279581,_0x3438e6){_0x3438e6=_0x3438e6||0xcc;return function(_0x5c23cc){if(_0x5c23cc){return _0x279581[_0x1311('0x29')](_0x3438e6);}return _0x279581[_0x1311('0x2a')](_0x3438e6)[_0x1311('0x2b')]();};}function respondWithResult(_0x3a0e5,_0x2f1348){_0x2f1348=_0x2f1348||0xc8;return function(_0x9767e5){if(_0x9767e5){return _0x3a0e5[_0x1311('0x2a')](_0x2f1348)[_0x1311('0x2c')](_0x9767e5);}};}function respondWithFilteredResult(_0x384853,_0x129226){return function(_0x164010){if(_0x164010){var _0x3e4ff4=_0x164010['count'],_0x15b706=_0x129226['offset'],_0xbc7187=_0x129226[_0x1311('0x2d')]+_0x129226[_0x1311('0x2e')],_0x3d0d06;if(_0xbc7187>=_0x3e4ff4){_0xbc7187=_0x3e4ff4;_0x3d0d06=0xc8;}else{_0x3d0d06=0xce;}_0x384853[_0x1311('0x2a')](_0x3d0d06);return _0x384853[_0x1311('0x2f')](_0x1311('0x30'),_0x15b706+'-'+_0xbc7187+'/'+_0x3e4ff4)['json'](_0x164010);}return null;};}function patchUpdates(_0x1ee6e5){return function(_0x2a2c5d){try{jsonpatch['apply'](_0x2a2c5d,_0x1ee6e5,!![]);}catch(_0x128593){return BPromise['reject'](_0x128593);}return _0x2a2c5d[_0x1311('0x31')]();};}function saveUpdates(_0x5cd4e6,_0x52d7aa){return function(_0xbd28c3){if(_0xbd28c3){return _0xbd28c3[_0x1311('0x32')](_0x5cd4e6)['then'](function(_0x1ba39b){return _0x1ba39b;});}return null;};}function removeEntity(_0x5511ae,_0x101ca5){return function(_0x1bad3c){if(_0x1bad3c){return _0x1bad3c['destroy']()[_0x1311('0x1f')](function(){_0x5511ae[_0x1311('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a8308,_0x1d7dc5){return function(_0x10ea5a){if(!_0x10ea5a){_0x4a8308[_0x1311('0x29')](0x194);}return _0x10ea5a;};}function handleError(_0x166c4c,_0x42e196){_0x42e196=_0x42e196||0x1f4;return function(_0x31d550){logger[_0x1311('0x23')](_0x31d550['stack']);if(_0x31d550[_0x1311('0x33')]){delete _0x31d550[_0x1311('0x33')];}_0x166c4c[_0x1311('0x2a')](_0x42e196)[_0x1311('0x34')](_0x31d550);};}exports[_0x1311('0x35')]=function(_0x93df5,_0xd4237){var _0x17591f={},_0x424453={},_0x1a9d10={'count':0x0,'rows':[]};var _0x13c921=_[_0x1311('0x36')](db['ServicenowConfiguration'][_0x1311('0x37')],function(_0x2aaf0c){return{'name':_0x2aaf0c[_0x1311('0x38')],'type':_0x2aaf0c[_0x1311('0x39')][_0x1311('0x3a')]};});_0x424453['model']=_['map'](_0x13c921,'name');_0x424453[_0x1311('0x3b')]=_[_0x1311('0x3c')](_0x93df5[_0x1311('0x3b')]);_0x424453['filters']=_['intersection'](_0x424453['model'],_0x424453['query']);_0x17591f[_0x1311('0x3d')]=_[_0x1311('0x3e')](_0x424453[_0x1311('0x3f')],qs[_0x1311('0x40')](_0x93df5[_0x1311('0x3b')][_0x1311('0x40')]));_0x17591f[_0x1311('0x3d')]=_0x17591f['attributes'][_0x1311('0x41')]?_0x17591f['attributes']:_0x424453['model'];if(!_0x93df5[_0x1311('0x3b')]['hasOwnProperty']('nolimit')){_0x17591f['limit']=qs[_0x1311('0x2e')](_0x93df5[_0x1311('0x3b')][_0x1311('0x2e')]);_0x17591f['offset']=qs['offset'](_0x93df5[_0x1311('0x3b')][_0x1311('0x2d')]);}_0x17591f[_0x1311('0x42')]=qs['sort'](_0x93df5['query'][_0x1311('0x43')]);_0x17591f[_0x1311('0x44')]=qs['filters'](_[_0x1311('0x45')](_0x93df5['query'],_0x424453['filters']));if(_0x93df5[_0x1311('0x3b')][_0x1311('0x46')]){_0x17591f[_0x1311('0x44')]=_['merge'](_0x17591f[_0x1311('0x44')],{'$or':_[_0x1311('0x36')](_0x13c921,function(_0x106a5b){if(_0x106a5b[_0x1311('0x39')]!=='VIRTUAL'){var _0x5bf33c={};_0x5bf33c[_0x106a5b[_0x1311('0x33')]]={'$like':'%'+_0x93df5[_0x1311('0x3b')][_0x1311('0x46')]+'%'};return _0x5bf33c;}})});}_0x17591f=_[_0x1311('0x47')]({},_0x17591f,_0x93df5[_0x1311('0x48')]);var _0x15989b={'where':_0x17591f[_0x1311('0x44')]};return db[_0x1311('0x49')][_0x1311('0x4a')](_0x15989b)[_0x1311('0x1f')](function(_0x4cb609){_0x1a9d10[_0x1311('0x4a')]=_0x4cb609;if(_0x93df5[_0x1311('0x3b')][_0x1311('0x4b')]){_0x17591f['include']=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x1311('0x4c')](_0x17591f);})[_0x1311('0x1f')](function(_0x22923f){_0x1a9d10[_0x1311('0x4d')]=_0x22923f;return _0x1a9d10;})[_0x1311('0x1f')](respondWithFilteredResult(_0xd4237,_0x17591f))[_0x1311('0x28')](handleError(_0xd4237,null));};exports[_0x1311('0x4e')]=function(_0xd5fa0b,_0x277e82){var _0x54a2cc={'raw':![],'where':{'id':_0xd5fa0b['params']['id']}},_0x5f25c4={};_0x5f25c4[_0x1311('0x3f')]=_[_0x1311('0x3c')](db[_0x1311('0x49')]['rawAttributes']);_0x5f25c4['query']=_['keys'](_0xd5fa0b[_0x1311('0x3b')]);_0x5f25c4[_0x1311('0x4f')]=_[_0x1311('0x3e')](_0x5f25c4[_0x1311('0x3f')],_0x5f25c4[_0x1311('0x3b')]);_0x54a2cc[_0x1311('0x3d')]=_[_0x1311('0x3e')](_0x5f25c4[_0x1311('0x3f')],qs['fields'](_0xd5fa0b[_0x1311('0x3b')][_0x1311('0x40')]));_0x54a2cc[_0x1311('0x3d')]=_0x54a2cc[_0x1311('0x3d')][_0x1311('0x41')]?_0x54a2cc['attributes']:_0x5f25c4[_0x1311('0x3f')];if(_0xd5fa0b[_0x1311('0x3b')]['includeAll']){_0x54a2cc[_0x1311('0x50')]=[{'all':!![]}];}_0x54a2cc=_[_0x1311('0x47')]({},_0x54a2cc,_0xd5fa0b[_0x1311('0x48')]);return db[_0x1311('0x49')][_0x1311('0x51')](_0x54a2cc)[_0x1311('0x1f')](handleEntityNotFound(_0x277e82,null))[_0x1311('0x1f')](respondWithResult(_0x277e82,null))[_0x1311('0x28')](handleError(_0x277e82,null));};exports[_0x1311('0x52')]=function(_0x2d1f67,_0x1e4755){return db[_0x1311('0x49')][_0x1311('0x52')](_0x2d1f67[_0x1311('0x53')],{})[_0x1311('0x1f')](respondWithResult(_0x1e4755,0xc9))[_0x1311('0x28')](handleError(_0x1e4755,null));};exports[_0x1311('0x32')]=function(_0x3b6a40,_0x474740){if(_0x3b6a40[_0x1311('0x53')]['id']){delete _0x3b6a40[_0x1311('0x53')]['id'];}return db[_0x1311('0x49')][_0x1311('0x51')]({'where':{'id':_0x3b6a40[_0x1311('0x54')]['id']}})[_0x1311('0x1f')](handleEntityNotFound(_0x474740,null))[_0x1311('0x1f')](saveUpdates(_0x3b6a40['body'],null))[_0x1311('0x1f')](respondWithResult(_0x474740,null))[_0x1311('0x28')](handleError(_0x474740,null));};exports[_0x1311('0x55')]=function(_0xd9702c,_0x2f893b){return db[_0x1311('0x49')]['find']({'where':{'id':_0xd9702c['params']['id']}})['then'](handleEntityNotFound(_0x2f893b,null))[_0x1311('0x1f')](removeEntity(_0x2f893b,null))[_0x1311('0x28')](handleError(_0x2f893b,null));};exports[_0x1311('0x56')]=function(_0x3863f3,_0x2f0504,_0x1d3bef){var _0x394a71={};var _0x314ad1={};var _0x4a25cf;var _0x460f1c;return db[_0x1311('0x49')]['findOne']({'where':{'id':_0x3863f3[_0x1311('0x54')]['id']}})['then'](handleEntityNotFound(_0x2f0504,null))['then'](function(_0x11935c){if(_0x11935c){_0x4a25cf=_0x11935c;_0x314ad1[_0x1311('0x3f')]=_['keys'](db[_0x1311('0x57')]['rawAttributes']);_0x314ad1[_0x1311('0x3b')]=_[_0x1311('0x3c')](_0x3863f3['query']);_0x314ad1[_0x1311('0x4f')]=_[_0x1311('0x3e')](_0x314ad1[_0x1311('0x3f')],_0x314ad1['query']);_0x394a71[_0x1311('0x3d')]=_['intersection'](_0x314ad1[_0x1311('0x3f')],qs[_0x1311('0x40')](_0x3863f3[_0x1311('0x3b')][_0x1311('0x40')]));_0x394a71['attributes']=_0x394a71[_0x1311('0x3d')]['length']?_0x394a71[_0x1311('0x3d')]:_0x314ad1[_0x1311('0x3f')];_0x394a71[_0x1311('0x42')]=qs[_0x1311('0x43')](_0x3863f3[_0x1311('0x3b')][_0x1311('0x43')]);_0x394a71['where']=qs[_0x1311('0x4f')](_[_0x1311('0x45')](_0x3863f3[_0x1311('0x3b')],_0x314ad1[_0x1311('0x4f')]));if(_0x3863f3[_0x1311('0x3b')][_0x1311('0x46')]){_0x394a71['where']=_[_0x1311('0x47')](_0x394a71[_0x1311('0x44')],{'$or':_['map'](_0x394a71['attributes'],function(_0xf6c451){var _0x3d9f90={};_0x3d9f90[_0xf6c451]={'$like':'%'+_0x3863f3['query'][_0x1311('0x46')]+'%'};return _0x3d9f90;})});}_0x394a71=_['merge']({},_0x394a71,_0x3863f3[_0x1311('0x48')]);return _0x4a25cf[_0x1311('0x56')](_0x394a71);}})['then'](function(_0x2adbb2){if(_0x2adbb2){_0x460f1c=_0x2adbb2[_0x1311('0x41')];if(!_0x3863f3[_0x1311('0x3b')][_0x1311('0x58')](_0x1311('0x59'))){_0x394a71[_0x1311('0x2e')]=qs['limit'](_0x3863f3[_0x1311('0x3b')]['limit']);_0x394a71[_0x1311('0x2d')]=qs[_0x1311('0x2d')](_0x3863f3['query']['offset']);}return _0x4a25cf[_0x1311('0x56')](_0x394a71);}})[_0x1311('0x1f')](function(_0x4c83af){if(_0x4c83af){return _0x4c83af?{'count':_0x460f1c,'rows':_0x4c83af}:null;}})[_0x1311('0x1f')](respondWithResult(_0x2f0504,null))[_0x1311('0x28')](handleError(_0x2f0504,null));};exports[_0x1311('0x5a')]=function(_0x1e24c8,_0x239716,_0x3e9d89){var _0x112afd={};var _0x3f310f={};var _0x27266f;var _0x370e5a;return db[_0x1311('0x49')]['findOne']({'where':{'id':_0x1e24c8[_0x1311('0x54')]['id']}})[_0x1311('0x1f')](handleEntityNotFound(_0x239716,null))[_0x1311('0x1f')](function(_0x4caf21){if(_0x4caf21){_0x27266f=_0x4caf21;_0x3f310f[_0x1311('0x3f')]=_['keys'](db[_0x1311('0x57')][_0x1311('0x37')]);_0x3f310f[_0x1311('0x3b')]=_[_0x1311('0x3c')](_0x1e24c8[_0x1311('0x3b')]);_0x3f310f[_0x1311('0x4f')]=_['intersection'](_0x3f310f[_0x1311('0x3f')],_0x3f310f[_0x1311('0x3b')]);_0x112afd[_0x1311('0x3d')]=_[_0x1311('0x3e')](_0x3f310f[_0x1311('0x3f')],qs[_0x1311('0x40')](_0x1e24c8[_0x1311('0x3b')]['fields']));_0x112afd[_0x1311('0x3d')]=_0x112afd[_0x1311('0x3d')]['length']?_0x112afd[_0x1311('0x3d')]:_0x3f310f[_0x1311('0x3f')];_0x112afd[_0x1311('0x42')]=qs[_0x1311('0x43')](_0x1e24c8[_0x1311('0x3b')][_0x1311('0x43')]);_0x112afd[_0x1311('0x44')]=qs[_0x1311('0x4f')](_['pick'](_0x1e24c8[_0x1311('0x3b')],_0x3f310f[_0x1311('0x4f')]));if(_0x1e24c8[_0x1311('0x3b')][_0x1311('0x46')]){_0x112afd['where']=_[_0x1311('0x47')](_0x112afd[_0x1311('0x44')],{'$or':_[_0x1311('0x36')](_0x112afd[_0x1311('0x3d')],function(_0x5aceda){var _0x2d5786={};_0x2d5786[_0x5aceda]={'$like':'%'+_0x1e24c8[_0x1311('0x3b')][_0x1311('0x46')]+'%'};return _0x2d5786;})});}_0x112afd=_[_0x1311('0x47')]({},_0x112afd,_0x1e24c8['options']);return _0x27266f[_0x1311('0x5a')](_0x112afd);}})[_0x1311('0x1f')](function(_0x416cc4){if(_0x416cc4){_0x370e5a=_0x416cc4['length'];if(!_0x1e24c8['query'][_0x1311('0x58')](_0x1311('0x59'))){_0x112afd[_0x1311('0x2e')]=qs['limit'](_0x1e24c8[_0x1311('0x3b')][_0x1311('0x2e')]);_0x112afd[_0x1311('0x2d')]=qs[_0x1311('0x2d')](_0x1e24c8[_0x1311('0x3b')][_0x1311('0x2d')]);}return _0x27266f['getSubjects'](_0x112afd);}})['then'](function(_0x2c0cf9){if(_0x2c0cf9){return _0x2c0cf9?{'count':_0x370e5a,'rows':_0x2c0cf9}:null;}})['then'](respondWithResult(_0x239716,null))['catch'](handleError(_0x239716,null));};exports[_0x1311('0x5b')]=function(_0x299f7c,_0x3e6534,_0xfc687c){var _0x42d08f={};var _0x4048c1={};var _0x130028;var _0x1b809a;return db['ServicenowConfiguration'][_0x1311('0x5c')]({'where':{'id':_0x299f7c[_0x1311('0x54')]['id']}})[_0x1311('0x1f')](handleEntityNotFound(_0x3e6534,null))[_0x1311('0x1f')](function(_0x1f4b58){if(_0x1f4b58){_0x130028=_0x1f4b58;_0x4048c1['model']=_['keys'](db[_0x1311('0x57')][_0x1311('0x37')]);_0x4048c1['query']=_[_0x1311('0x3c')](_0x299f7c[_0x1311('0x3b')]);_0x4048c1['filters']=_['intersection'](_0x4048c1[_0x1311('0x3f')],_0x4048c1[_0x1311('0x3b')]);_0x42d08f[_0x1311('0x3d')]=_[_0x1311('0x3e')](_0x4048c1[_0x1311('0x3f')],qs['fields'](_0x299f7c[_0x1311('0x3b')]['fields']));_0x42d08f[_0x1311('0x3d')]=_0x42d08f[_0x1311('0x3d')][_0x1311('0x41')]?_0x42d08f[_0x1311('0x3d')]:_0x4048c1[_0x1311('0x3f')];_0x42d08f[_0x1311('0x42')]=qs[_0x1311('0x43')](_0x299f7c['query'][_0x1311('0x43')]);_0x42d08f[_0x1311('0x44')]=qs[_0x1311('0x4f')](_[_0x1311('0x45')](_0x299f7c[_0x1311('0x3b')],_0x4048c1[_0x1311('0x4f')]));if(_0x299f7c['query'][_0x1311('0x46')]){_0x42d08f[_0x1311('0x44')]=_['merge'](_0x42d08f[_0x1311('0x44')],{'$or':_[_0x1311('0x36')](_0x42d08f[_0x1311('0x3d')],function(_0x28626e){var _0x1875f3={};_0x1875f3[_0x28626e]={'$like':'%'+_0x299f7c[_0x1311('0x3b')][_0x1311('0x46')]+'%'};return _0x1875f3;})});}_0x42d08f=_[_0x1311('0x47')]({},_0x42d08f,_0x299f7c[_0x1311('0x48')]);return _0x130028['getDescriptions'](_0x42d08f);}})[_0x1311('0x1f')](function(_0x216886){if(_0x216886){_0x1b809a=_0x216886['length'];if(!_0x299f7c[_0x1311('0x3b')][_0x1311('0x58')](_0x1311('0x59'))){_0x42d08f[_0x1311('0x2e')]=qs[_0x1311('0x2e')](_0x299f7c[_0x1311('0x3b')][_0x1311('0x2e')]);_0x42d08f[_0x1311('0x2d')]=qs[_0x1311('0x2d')](_0x299f7c[_0x1311('0x3b')][_0x1311('0x2d')]);}return _0x130028[_0x1311('0x5b')](_0x42d08f);}})['then'](function(_0x350bcd){if(_0x350bcd){return _0x350bcd?{'count':_0x1b809a,'rows':_0x350bcd}:null;}})[_0x1311('0x1f')](respondWithResult(_0x3e6534,null))[_0x1311('0x28')](handleError(_0x3e6534,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index c2bd795..eef793a 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 _0x8bfd=['./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5223bf,_0x109da4){var _0x181da4=function(_0x5d7047){while(--_0x5d7047){_0x5223bf['push'](_0x5223bf['shift']());}};_0x181da4(++_0x109da4);}(_0x8bfd,0xae));var _0xd8bf=function(_0xc80b2b,_0x5a12e9){_0xc80b2b=_0xc80b2b-0x0;var _0x22af6f=_0x8bfd[_0xc80b2b];return _0x22af6f;};'use strict';var _=require(_0xd8bf('0x0'));var util=require(_0xd8bf('0x1'));var logger=require(_0xd8bf('0x2'))(_0xd8bf('0x3'));var moment=require(_0xd8bf('0x4'));var BPromise=require(_0xd8bf('0x5'));var rp=require(_0xd8bf('0x6'));var fs=require('fs');var path=require(_0xd8bf('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd8bf('0x8'));module[_0xd8bf('0x9')]=function(_0x543c2f,_0x4ae3d8){return _0x543c2f[_0xd8bf('0xa')](_0xd8bf('0xb'),attributes,{'tableName':_0xd8bf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x321d=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util'];(function(_0x19359d,_0xa50fcf){var _0x4bed8b=function(_0x46e218){while(--_0x46e218){_0x19359d['push'](_0x19359d['shift']());}};_0x4bed8b(++_0xa50fcf);}(_0x321d,0x1b8));var _0xd321=function(_0x256d3b,_0x556910){_0x256d3b=_0x256d3b-0x0;var _0xddad77=_0x321d[_0x256d3b];return _0xddad77;};'use strict';var _=require(_0xd321('0x0'));var util=require(_0xd321('0x1'));var logger=require(_0xd321('0x2'))(_0xd321('0x3'));var moment=require(_0xd321('0x4'));var BPromise=require('bluebird');var rp=require(_0xd321('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd321('0x6'));var config=require(_0xd321('0x7'));var attributes=require(_0xd321('0x8'));module[_0xd321('0x9')]=function(_0x2527d3,_0x48d2a7){return _0x2527d3[_0xd321('0xa')](_0xd321('0xb'),attributes,{'tableName':_0xd321('0xc'),'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 9dac6f5..ef74625 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 _0x3fc9=['ServicenowConfiguration,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x4c5c97,_0x4f85bf){var _0xd5d2cb=function(_0x1e6100){while(--_0x1e6100){_0x4c5c97['push'](_0x4c5c97['shift']());}};_0xd5d2cb(++_0x4f85bf);}(_0x3fc9,0xa2));var _0x93fc=function(_0x20e40d,_0x2a9f0f){_0x20e40d=_0x20e40d-0x0;var _0x558350=_0x3fc9[_0x20e40d];return _0x558350;};'use strict';var _=require(_0x93fc('0x0'));var util=require(_0x93fc('0x1'));var moment=require(_0x93fc('0x2'));var BPromise=require(_0x93fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x93fc('0x4'))['db'];var utils=require(_0x93fc('0x5'));var logger=require(_0x93fc('0x6'))(_0x93fc('0x7'));var config=require(_0x93fc('0x8'));var jayson=require(_0x93fc('0x9'));var client=jayson['client'][_0x93fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16be52,_0x5b8abe,_0x1cba32){return new BPromise(function(_0x33454a,_0x58bffd){return client[_0x93fc('0xb')](_0x16be52,_0x1cba32)[_0x93fc('0xc')](function(_0x102e0d){logger[_0x93fc('0xd')](_0x93fc('0xe'),_0x5b8abe,'request\x20sent');logger[_0x93fc('0xf')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x5b8abe,_0x93fc('0x10'),JSON['stringify'](_0x102e0d));if(_0x102e0d[_0x93fc('0x11')]){if(_0x102e0d[_0x93fc('0x11')][_0x93fc('0x12')]===0x1f4){logger['error'](_0x93fc('0xe'),_0x5b8abe,_0x102e0d[_0x93fc('0x11')][_0x93fc('0x13')]);return _0x58bffd(_0x102e0d[_0x93fc('0x11')]['message']);}logger[_0x93fc('0x11')](_0x93fc('0xe'),_0x5b8abe,_0x102e0d[_0x93fc('0x11')]['message']);return _0x33454a(_0x102e0d[_0x93fc('0x11')][_0x93fc('0x13')]);}else{logger[_0x93fc('0xd')](_0x93fc('0xe'),_0x5b8abe,_0x93fc('0x10'));_0x33454a(_0x102e0d[_0x93fc('0x14')]['message']);}})[_0x93fc('0x15')](function(_0xda0e16){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x5b8abe,_0xda0e16);_0x58bffd(_0xda0e16);});});} \ No newline at end of file +var _0x7f13=['error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x24d5df,_0xc026a1){var _0x65e06a=function(_0x237bbb){while(--_0x237bbb){_0x24d5df['push'](_0x24d5df['shift']());}};_0x65e06a(++_0xc026a1);}(_0x7f13,0x109));var _0x37f1=function(_0x50cb4b,_0x140d9a){_0x50cb4b=_0x50cb4b-0x0;var _0x53b81a=_0x7f13[_0x50cb4b];return _0x53b81a;};'use strict';var _=require('lodash');var util=require(_0x37f1('0x0'));var moment=require(_0x37f1('0x1'));var BPromise=require(_0x37f1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37f1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x37f1('0x4'));var logger=require(_0x37f1('0x5'))(_0x37f1('0x6'));var config=require(_0x37f1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x37f1('0x8')][_0x37f1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x91478,_0x5639a4,_0x3e6d20){return new BPromise(function(_0x2869f1,_0x15fbe9){return client['request'](_0x91478,_0x3e6d20)['then'](function(_0x2fb587){logger[_0x37f1('0xa')](_0x37f1('0xb'),_0x5639a4,_0x37f1('0xc'));logger[_0x37f1('0xd')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x5639a4,_0x37f1('0xc'),JSON[_0x37f1('0xe')](_0x2fb587));if(_0x2fb587[_0x37f1('0xf')]){if(_0x2fb587[_0x37f1('0xf')][_0x37f1('0x10')]===0x1f4){logger[_0x37f1('0xf')](_0x37f1('0xb'),_0x5639a4,_0x2fb587[_0x37f1('0xf')][_0x37f1('0x11')]);return _0x15fbe9(_0x2fb587[_0x37f1('0xf')]['message']);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x5639a4,_0x2fb587[_0x37f1('0xf')][_0x37f1('0x11')]);return _0x2869f1(_0x2fb587[_0x37f1('0xf')]['message']);}else{logger[_0x37f1('0xa')](_0x37f1('0xb'),_0x5639a4,_0x37f1('0xc'));_0x2869f1(_0x2fb587[_0x37f1('0x12')]['message']);}})[_0x37f1('0x13')](function(_0x3ca10d){logger[_0x37f1('0xf')](_0x37f1('0xb'),_0x5639a4,_0x3ca10d);_0x15fbe9(_0x3ca10d);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index ca3f21a..9034b5c 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 _0xa46e=['destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete'];(function(_0x170635,_0x3ffbfb){var _0x154bee=function(_0x15c7d5){while(--_0x15c7d5){_0x170635['push'](_0x170635['shift']());}};_0x154bee(++_0x3ffbfb);}(_0xa46e,0xde));var _0xea46=function(_0x3b4b1d,_0x15029e){_0x3b4b1d=_0x3b4b1d-0x0;var _0x488c36=_0xa46e[_0x3b4b1d];return _0x488c36;};'use strict';var multer=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var path=require('path');var timeout=require(_0xea46('0x2'));var express=require('express');var router=express[_0xea46('0x3')]();var auth=require(_0xea46('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xea46('0x5'));var controller=require(_0xea46('0x6'));router[_0xea46('0x7')]('/',auth[_0xea46('0x8')](),controller[_0xea46('0x9')]);router['get'](_0xea46('0xa'),auth[_0xea46('0x8')](),controller[_0xea46('0xb')]);router[_0xea46('0xc')]('/',auth[_0xea46('0x8')](),controller[_0xea46('0xd')]);router[_0xea46('0xe')](_0xea46('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xea46('0xf')](_0xea46('0xa'),auth['isAuthenticated'](),controller[_0xea46('0x10')]);module['exports']=router; \ No newline at end of file +var _0x127d=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','isAuthenticated','index','get','show','post'];(function(_0x4551fb,_0x2b8b8e){var _0x562381=function(_0x3b3bff){while(--_0x3b3bff){_0x4551fb['push'](_0x4551fb['shift']());}};_0x562381(++_0x2b8b8e);}(_0x127d,0x1d2));var _0xd127=function(_0x4f72e9,_0x4aab40){_0x4f72e9=_0x4f72e9-0x0;var _0x37f9da=_0x127d[_0x4f72e9];return _0x37f9da;};'use strict';var multer=require(_0xd127('0x0'));var util=require(_0xd127('0x1'));var path=require(_0xd127('0x2'));var timeout=require(_0xd127('0x3'));var express=require('express');var router=express[_0xd127('0x4')]();var auth=require(_0xd127('0x5'));var interaction=require(_0xd127('0x6'));var config=require(_0xd127('0x7'));var controller=require(_0xd127('0x8'));router['get']('/',auth[_0xd127('0x9')](),controller[_0xd127('0xa')]);router[_0xd127('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xd127('0xc')]);router[_0xd127('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd127('0xe')](_0xd127('0xf'),auth[_0xd127('0x9')](),controller[_0xd127('0x10')]);router[_0xd127('0x11')]('/:id',auth[_0xd127('0x9')](),controller[_0xd127('0x12')]);module[_0xd127('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 46129ab..9f4bc3c 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 _0x84d8=['string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','keyValue'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x84d8,0x8b));var _0x884d=function(_0x33ae7b,_0x216a78){_0x33ae7b=_0x33ae7b-0x0;var _0x4c91ad=_0x84d8[_0x33ae7b];return _0x4c91ad;};'use strict';var Sequelize=require(_0x884d('0x0'));module[_0x884d('0x1')]={'type':{'type':Sequelize[_0x884d('0x2')]('string',_0x884d('0x3'),'customVariable',_0x884d('0x4')),'defaultValue':_0x884d('0x5')},'content':{'type':Sequelize[_0x884d('0x6')]},'key':{'type':Sequelize[_0x884d('0x6')]},'keyType':{'type':Sequelize[_0x884d('0x2')](_0x884d('0x5'),_0x884d('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x884d('0x6')]},'customField':{'type':Sequelize[_0x884d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x884d('0x6')]}}; \ No newline at end of file +var _0x2ffa=['customVariable','keyValue','string','STRING','ENUM','BOOLEAN','sequelize','variable'];(function(_0x1ed890,_0x2385e3){var _0x1b18a6=function(_0x259e31){while(--_0x259e31){_0x1ed890['push'](_0x1ed890['shift']());}};_0x1b18a6(++_0x2385e3);}(_0x2ffa,0x16e));var _0xa2ff=function(_0x1d0b62,_0x3c8f34){_0x1d0b62=_0x1d0b62-0x0;var _0x1d2e9b=_0x2ffa[_0x1d0b62];return _0x1d2e9b;};'use strict';var Sequelize=require(_0xa2ff('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0xa2ff('0x1'),_0xa2ff('0x2'),_0xa2ff('0x3')),'defaultValue':_0xa2ff('0x4')},'content':{'type':Sequelize[_0xa2ff('0x5')]},'key':{'type':Sequelize[_0xa2ff('0x5')]},'keyType':{'type':Sequelize[_0xa2ff('0x6')](_0xa2ff('0x4'),'variable',_0xa2ff('0x2'))},'keyContent':{'type':Sequelize[_0xa2ff('0x5')]},'idField':{'type':Sequelize[_0xa2ff('0x5')]},'nameField':{'type':Sequelize[_0xa2ff('0x5')]},'customField':{'type':Sequelize[_0xa2ff('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa2ff('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 340b3f4..cdd5fe7 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 _0xdacc=['rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','map','ServicenowField'];(function(_0x3517e5,_0x2c3608){var _0x15ba05=function(_0x6eccbc){while(--_0x6eccbc){_0x3517e5['push'](_0x3517e5['shift']());}};_0x15ba05(++_0x2c3608);}(_0xdacc,0x14f));var _0xcdac=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdacc[_0x14add3];return _0x4a174f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcdac('0x0'));var rimraf=require(_0xcdac('0x1'));var zipdir=require(_0xcdac('0x2'));var jsonpatch=require(_0xcdac('0x3'));var rp=require(_0xcdac('0x4'));var moment=require(_0xcdac('0x5'));var BPromise=require(_0xcdac('0x6'));var Mustache=require('mustache');var util=require(_0xcdac('0x7'));var path=require(_0xcdac('0x8'));var sox=require(_0xcdac('0x9'));var csv=require(_0xcdac('0xa'));var ejs=require(_0xcdac('0xb'));var fs=require('fs');var _=require(_0xcdac('0xc'));var squel=require(_0xcdac('0xd'));var crypto=require(_0xcdac('0xe'));var jsforce=require(_0xcdac('0xf'));var deskjs=require(_0xcdac('0x10'));var toCsv=require(_0xcdac('0xa'));var querystring=require(_0xcdac('0x11'));var Papa=require(_0xcdac('0x12'));var Redis=require(_0xcdac('0x13'));var authService=require(_0xcdac('0x14'));var qs=require(_0xcdac('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcdac('0x16'));var logger=require(_0xcdac('0x17'))('api');var utils=require(_0xcdac('0x18'));var config=require(_0xcdac('0x19'));var db=require(_0xcdac('0x1a'))['db'];function respondWithStatusCode(_0xdc5b0e,_0x3f949d){_0x3f949d=_0x3f949d||0xcc;return function(_0x511f55){if(_0x511f55){return _0xdc5b0e['sendStatus'](_0x3f949d);}return _0xdc5b0e[_0xcdac('0x1b')](_0x3f949d)['end']();};}function respondWithResult(_0x36c582,_0x50b59c){_0x50b59c=_0x50b59c||0xc8;return function(_0x5b3bdd){if(_0x5b3bdd){return _0x36c582[_0xcdac('0x1b')](_0x50b59c)[_0xcdac('0x1c')](_0x5b3bdd);}};}function respondWithFilteredResult(_0x1b4bba,_0x228096){return function(_0x1ff7d3){if(_0x1ff7d3){var _0x2882cc=_0x1ff7d3['count'],_0x53a103=_0x228096[_0xcdac('0x1d')],_0x38ad30=_0x228096[_0xcdac('0x1d')]+_0x228096[_0xcdac('0x1e')],_0x28af17;if(_0x38ad30>=_0x2882cc){_0x38ad30=_0x2882cc;_0x28af17=0xc8;}else{_0x28af17=0xce;}_0x1b4bba[_0xcdac('0x1b')](_0x28af17);return _0x1b4bba[_0xcdac('0x1f')](_0xcdac('0x20'),_0x53a103+'-'+_0x38ad30+'/'+_0x2882cc)[_0xcdac('0x1c')](_0x1ff7d3);}return null;};}function patchUpdates(_0x9e3029){return function(_0x4dcd46){try{jsonpatch['apply'](_0x4dcd46,_0x9e3029,!![]);}catch(_0x7c45b1){return BPromise[_0xcdac('0x21')](_0x7c45b1);}return _0x4dcd46[_0xcdac('0x22')]();};}function saveUpdates(_0x443c86,_0xeb1f4){return function(_0x50bd6e){if(_0x50bd6e){return _0x50bd6e[_0xcdac('0x23')](_0x443c86)[_0xcdac('0x24')](function(_0x367d52){return _0x367d52;});}return null;};}function removeEntity(_0x3e156e,_0x385e56){return function(_0x280d96){if(_0x280d96){return _0x280d96[_0xcdac('0x25')]()[_0xcdac('0x24')](function(){_0x3e156e[_0xcdac('0x1b')](0xcc)[_0xcdac('0x26')]();});}};}function handleEntityNotFound(_0x41bd76,_0x1fe6c9){return function(_0x129103){if(!_0x129103){_0x41bd76['sendStatus'](0x194);}return _0x129103;};}function handleError(_0x3cb041,_0x18f8b9){_0x18f8b9=_0x18f8b9||0x1f4;return function(_0x4689c2){logger[_0xcdac('0x27')](_0x4689c2[_0xcdac('0x28')]);if(_0x4689c2[_0xcdac('0x29')]){delete _0x4689c2['name'];}_0x3cb041[_0xcdac('0x1b')](_0x18f8b9)[_0xcdac('0x2a')](_0x4689c2);};}exports['index']=function(_0x518506,_0x305be2){var _0xf16e7a={},_0x20a058={},_0x26af7c={'count':0x0,'rows':[]};var _0x11806a=_[_0xcdac('0x2b')](db[_0xcdac('0x2c')][_0xcdac('0x2d')],function(_0x508f2a){return{'name':_0x508f2a[_0xcdac('0x2e')],'type':_0x508f2a['type'][_0xcdac('0x2f')]};});_0x20a058[_0xcdac('0x30')]=_['map'](_0x11806a,_0xcdac('0x29'));_0x20a058['query']=_[_0xcdac('0x31')](_0x518506[_0xcdac('0x32')]);_0x20a058[_0xcdac('0x33')]=_[_0xcdac('0x34')](_0x20a058[_0xcdac('0x30')],_0x20a058[_0xcdac('0x32')]);_0xf16e7a['attributes']=_[_0xcdac('0x34')](_0x20a058[_0xcdac('0x30')],qs[_0xcdac('0x35')](_0x518506['query'][_0xcdac('0x35')]));_0xf16e7a[_0xcdac('0x36')]=_0xf16e7a[_0xcdac('0x36')]['length']?_0xf16e7a[_0xcdac('0x36')]:_0x20a058[_0xcdac('0x30')];if(!_0x518506[_0xcdac('0x32')][_0xcdac('0x37')]('nolimit')){_0xf16e7a['limit']=qs[_0xcdac('0x1e')](_0x518506[_0xcdac('0x32')][_0xcdac('0x1e')]);_0xf16e7a['offset']=qs[_0xcdac('0x1d')](_0x518506[_0xcdac('0x32')][_0xcdac('0x1d')]);}_0xf16e7a[_0xcdac('0x38')]=qs[_0xcdac('0x39')](_0x518506[_0xcdac('0x32')][_0xcdac('0x39')]);_0xf16e7a[_0xcdac('0x3a')]=qs[_0xcdac('0x33')](_[_0xcdac('0x3b')](_0x518506[_0xcdac('0x32')],_0x20a058[_0xcdac('0x33')]));if(_0x518506[_0xcdac('0x32')]['filter']){_0xf16e7a[_0xcdac('0x3a')]=_[_0xcdac('0x3c')](_0xf16e7a[_0xcdac('0x3a')],{'$or':_[_0xcdac('0x2b')](_0x11806a,function(_0x5642d8){if(_0x5642d8[_0xcdac('0x3d')]!==_0xcdac('0x3e')){var _0x310af8={};_0x310af8[_0x5642d8[_0xcdac('0x29')]]={'$like':'%'+_0x518506[_0xcdac('0x32')]['filter']+'%'};return _0x310af8;}})});}_0xf16e7a=_[_0xcdac('0x3c')]({},_0xf16e7a,_0x518506[_0xcdac('0x3f')]);var _0x49bf47={'where':_0xf16e7a[_0xcdac('0x3a')]};return db['ServicenowField'][_0xcdac('0x40')](_0x49bf47)['then'](function(_0x474f32){_0x26af7c[_0xcdac('0x40')]=_0x474f32;if(_0x518506[_0xcdac('0x32')][_0xcdac('0x41')]){_0xf16e7a[_0xcdac('0x42')]=[{'all':!![]}];}return db['ServicenowField'][_0xcdac('0x43')](_0xf16e7a);})[_0xcdac('0x24')](function(_0x77b51e){_0x26af7c[_0xcdac('0x44')]=_0x77b51e;return _0x26af7c;})[_0xcdac('0x24')](respondWithFilteredResult(_0x305be2,_0xf16e7a))[_0xcdac('0x45')](handleError(_0x305be2,null));};exports[_0xcdac('0x46')]=function(_0x5ba8b4,_0x3eebbd){var _0x33d40d={'raw':!![],'where':{'id':_0x5ba8b4[_0xcdac('0x47')]['id']}},_0x3868ee={};_0x3868ee[_0xcdac('0x30')]=_['keys'](db[_0xcdac('0x2c')][_0xcdac('0x2d')]);_0x3868ee[_0xcdac('0x32')]=_['keys'](_0x5ba8b4[_0xcdac('0x32')]);_0x3868ee[_0xcdac('0x33')]=_['intersection'](_0x3868ee[_0xcdac('0x30')],_0x3868ee[_0xcdac('0x32')]);_0x33d40d['attributes']=_[_0xcdac('0x34')](_0x3868ee[_0xcdac('0x30')],qs[_0xcdac('0x35')](_0x5ba8b4[_0xcdac('0x32')][_0xcdac('0x35')]));_0x33d40d['attributes']=_0x33d40d[_0xcdac('0x36')][_0xcdac('0x48')]?_0x33d40d[_0xcdac('0x36')]:_0x3868ee[_0xcdac('0x30')];if(_0x5ba8b4[_0xcdac('0x32')][_0xcdac('0x41')]){_0x33d40d[_0xcdac('0x42')]=[{'all':!![]}];}_0x33d40d=_[_0xcdac('0x3c')]({},_0x33d40d,_0x5ba8b4[_0xcdac('0x3f')]);return db['ServicenowField'][_0xcdac('0x49')](_0x33d40d)[_0xcdac('0x24')](handleEntityNotFound(_0x3eebbd,null))['then'](respondWithResult(_0x3eebbd,null))[_0xcdac('0x45')](handleError(_0x3eebbd,null));};exports[_0xcdac('0x4a')]=function(_0x1ee5b0,_0x254073){return db[_0xcdac('0x2c')][_0xcdac('0x4a')](_0x1ee5b0[_0xcdac('0x4b')],{})[_0xcdac('0x24')](respondWithResult(_0x254073,0xc9))['catch'](handleError(_0x254073,null));};exports['update']=function(_0x267168,_0x5d38c7){if(_0x267168[_0xcdac('0x4b')]['id']){delete _0x267168[_0xcdac('0x4b')]['id'];}return db[_0xcdac('0x2c')][_0xcdac('0x49')]({'where':{'id':_0x267168[_0xcdac('0x47')]['id']}})[_0xcdac('0x24')](handleEntityNotFound(_0x5d38c7,null))[_0xcdac('0x24')](saveUpdates(_0x267168[_0xcdac('0x4b')],null))['then'](respondWithResult(_0x5d38c7,null))['catch'](handleError(_0x5d38c7,null));};exports[_0xcdac('0x25')]=function(_0x3a0426,_0x4dca75){return db[_0xcdac('0x2c')]['find']({'where':{'id':_0x3a0426[_0xcdac('0x47')]['id']}})[_0xcdac('0x24')](handleEntityNotFound(_0x4dca75,null))[_0xcdac('0x24')](removeEntity(_0x4dca75,null))[_0xcdac('0x45')](handleError(_0x4dca75,null));}; \ No newline at end of file +var _0xa859=['keys','length','merge','find','create','body','rimraf','zip-dir','request-promise','bluebird','util','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','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','nolimit','sort','where','pick','filter','options','then','includeAll','include','findAll','catch','show','params'];(function(_0x59bada,_0x143dbe){var _0x2bb6b4=function(_0x4ecb62){while(--_0x4ecb62){_0x59bada['push'](_0x59bada['shift']());}};_0x2bb6b4(++_0x143dbe);}(_0xa859,0x94));var _0x9a85=function(_0x3ad628,_0x323d56){_0x3ad628=_0x3ad628-0x0;var _0x36c0f5=_0xa859[_0x3ad628];return _0x36c0f5;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x9a85('0x0'));var zipdir=require(_0x9a85('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9a85('0x2'));var moment=require('moment');var BPromise=require(_0x9a85('0x3'));var Mustache=require('mustache');var util=require(_0x9a85('0x4'));var path=require(_0x9a85('0x5'));var sox=require(_0x9a85('0x6'));var csv=require(_0x9a85('0x7'));var ejs=require(_0x9a85('0x8'));var fs=require('fs');var _=require(_0x9a85('0x9'));var squel=require(_0x9a85('0xa'));var crypto=require(_0x9a85('0xb'));var jsforce=require(_0x9a85('0xc'));var deskjs=require(_0x9a85('0xd'));var toCsv=require(_0x9a85('0x7'));var querystring=require('querystring');var Papa=require(_0x9a85('0xe'));var Redis=require(_0x9a85('0xf'));var authService=require(_0x9a85('0x10'));var qs=require(_0x9a85('0x11'));var as=require(_0x9a85('0x12'));var hardwareService=require(_0x9a85('0x13'));var logger=require(_0x9a85('0x14'))('api');var utils=require(_0x9a85('0x15'));var config=require('../../config/environment');var db=require(_0x9a85('0x16'))['db'];function respondWithStatusCode(_0x28427d,_0x5e5000){_0x5e5000=_0x5e5000||0xcc;return function(_0xf62755){if(_0xf62755){return _0x28427d[_0x9a85('0x17')](_0x5e5000);}return _0x28427d['status'](_0x5e5000)[_0x9a85('0x18')]();};}function respondWithResult(_0x325b1e,_0x1475a2){_0x1475a2=_0x1475a2||0xc8;return function(_0xf950f3){if(_0xf950f3){return _0x325b1e[_0x9a85('0x19')](_0x1475a2)['json'](_0xf950f3);}};}function respondWithFilteredResult(_0x24589a,_0x27a473){return function(_0x1bbb90){if(_0x1bbb90){var _0x357d39=_0x1bbb90[_0x9a85('0x1a')],_0x4aee57=_0x27a473['offset'],_0x5a4b2e=_0x27a473[_0x9a85('0x1b')]+_0x27a473[_0x9a85('0x1c')],_0x271b58;if(_0x5a4b2e>=_0x357d39){_0x5a4b2e=_0x357d39;_0x271b58=0xc8;}else{_0x271b58=0xce;}_0x24589a[_0x9a85('0x19')](_0x271b58);return _0x24589a[_0x9a85('0x1d')](_0x9a85('0x1e'),_0x4aee57+'-'+_0x5a4b2e+'/'+_0x357d39)[_0x9a85('0x1f')](_0x1bbb90);}return null;};}function patchUpdates(_0x22b5ae){return function(_0x4fd281){try{jsonpatch[_0x9a85('0x20')](_0x4fd281,_0x22b5ae,!![]);}catch(_0x8acac7){return BPromise[_0x9a85('0x21')](_0x8acac7);}return _0x4fd281['save']();};}function saveUpdates(_0x50c366,_0x4fafc1){return function(_0x985daa){if(_0x985daa){return _0x985daa[_0x9a85('0x22')](_0x50c366)['then'](function(_0x31e297){return _0x31e297;});}return null;};}function removeEntity(_0x5e8cec,_0x2910e4){return function(_0x41a286){if(_0x41a286){return _0x41a286[_0x9a85('0x23')]()['then'](function(){_0x5e8cec['status'](0xcc)[_0x9a85('0x18')]();});}};}function handleEntityNotFound(_0x3c8c9a,_0x21d1a4){return function(_0x433e49){if(!_0x433e49){_0x3c8c9a[_0x9a85('0x17')](0x194);}return _0x433e49;};}function handleError(_0x1cd085,_0x156fea){_0x156fea=_0x156fea||0x1f4;return function(_0x227964){logger[_0x9a85('0x24')](_0x227964[_0x9a85('0x25')]);if(_0x227964[_0x9a85('0x26')]){delete _0x227964[_0x9a85('0x26')];}_0x1cd085['status'](_0x156fea)[_0x9a85('0x27')](_0x227964);};}exports[_0x9a85('0x28')]=function(_0x26b5fb,_0x29a4e0){var _0xbf81c0={},_0x586ae6={},_0x55f66f={'count':0x0,'rows':[]};var _0x4ac835=_[_0x9a85('0x29')](db[_0x9a85('0x2a')][_0x9a85('0x2b')],function(_0x2b76ba){return{'name':_0x2b76ba[_0x9a85('0x2c')],'type':_0x2b76ba[_0x9a85('0x2d')]['key']};});_0x586ae6['model']=_[_0x9a85('0x29')](_0x4ac835,_0x9a85('0x26'));_0x586ae6[_0x9a85('0x2e')]=_['keys'](_0x26b5fb['query']);_0x586ae6[_0x9a85('0x2f')]=_[_0x9a85('0x30')](_0x586ae6[_0x9a85('0x31')],_0x586ae6['query']);_0xbf81c0[_0x9a85('0x32')]=_[_0x9a85('0x30')](_0x586ae6[_0x9a85('0x31')],qs[_0x9a85('0x33')](_0x26b5fb[_0x9a85('0x2e')][_0x9a85('0x33')]));_0xbf81c0[_0x9a85('0x32')]=_0xbf81c0['attributes']['length']?_0xbf81c0[_0x9a85('0x32')]:_0x586ae6[_0x9a85('0x31')];if(!_0x26b5fb[_0x9a85('0x2e')]['hasOwnProperty'](_0x9a85('0x34'))){_0xbf81c0[_0x9a85('0x1c')]=qs[_0x9a85('0x1c')](_0x26b5fb[_0x9a85('0x2e')][_0x9a85('0x1c')]);_0xbf81c0[_0x9a85('0x1b')]=qs['offset'](_0x26b5fb[_0x9a85('0x2e')][_0x9a85('0x1b')]);}_0xbf81c0['order']=qs[_0x9a85('0x35')](_0x26b5fb[_0x9a85('0x2e')][_0x9a85('0x35')]);_0xbf81c0[_0x9a85('0x36')]=qs['filters'](_[_0x9a85('0x37')](_0x26b5fb[_0x9a85('0x2e')],_0x586ae6[_0x9a85('0x2f')]));if(_0x26b5fb[_0x9a85('0x2e')]['filter']){_0xbf81c0[_0x9a85('0x36')]=_['merge'](_0xbf81c0[_0x9a85('0x36')],{'$or':_[_0x9a85('0x29')](_0x4ac835,function(_0xb10706){if(_0xb10706[_0x9a85('0x2d')]!=='VIRTUAL'){var _0x464100={};_0x464100[_0xb10706[_0x9a85('0x26')]]={'$like':'%'+_0x26b5fb[_0x9a85('0x2e')][_0x9a85('0x38')]+'%'};return _0x464100;}})});}_0xbf81c0=_['merge']({},_0xbf81c0,_0x26b5fb[_0x9a85('0x39')]);var _0x5dd1d9={'where':_0xbf81c0[_0x9a85('0x36')]};return db[_0x9a85('0x2a')][_0x9a85('0x1a')](_0x5dd1d9)[_0x9a85('0x3a')](function(_0x43b197){_0x55f66f[_0x9a85('0x1a')]=_0x43b197;if(_0x26b5fb[_0x9a85('0x2e')][_0x9a85('0x3b')]){_0xbf81c0[_0x9a85('0x3c')]=[{'all':!![]}];}return db[_0x9a85('0x2a')][_0x9a85('0x3d')](_0xbf81c0);})['then'](function(_0x20bc23){_0x55f66f['rows']=_0x20bc23;return _0x55f66f;})[_0x9a85('0x3a')](respondWithFilteredResult(_0x29a4e0,_0xbf81c0))[_0x9a85('0x3e')](handleError(_0x29a4e0,null));};exports[_0x9a85('0x3f')]=function(_0x5dcd81,_0x3f4cb2){var _0x24ece1={'raw':!![],'where':{'id':_0x5dcd81[_0x9a85('0x40')]['id']}},_0x479daa={};_0x479daa['model']=_[_0x9a85('0x41')](db[_0x9a85('0x2a')][_0x9a85('0x2b')]);_0x479daa[_0x9a85('0x2e')]=_[_0x9a85('0x41')](_0x5dcd81[_0x9a85('0x2e')]);_0x479daa[_0x9a85('0x2f')]=_[_0x9a85('0x30')](_0x479daa[_0x9a85('0x31')],_0x479daa[_0x9a85('0x2e')]);_0x24ece1[_0x9a85('0x32')]=_[_0x9a85('0x30')](_0x479daa[_0x9a85('0x31')],qs[_0x9a85('0x33')](_0x5dcd81['query'][_0x9a85('0x33')]));_0x24ece1[_0x9a85('0x32')]=_0x24ece1[_0x9a85('0x32')][_0x9a85('0x42')]?_0x24ece1[_0x9a85('0x32')]:_0x479daa[_0x9a85('0x31')];if(_0x5dcd81[_0x9a85('0x2e')][_0x9a85('0x3b')]){_0x24ece1['include']=[{'all':!![]}];}_0x24ece1=_[_0x9a85('0x43')]({},_0x24ece1,_0x5dcd81[_0x9a85('0x39')]);return db[_0x9a85('0x2a')][_0x9a85('0x44')](_0x24ece1)['then'](handleEntityNotFound(_0x3f4cb2,null))[_0x9a85('0x3a')](respondWithResult(_0x3f4cb2,null))[_0x9a85('0x3e')](handleError(_0x3f4cb2,null));};exports[_0x9a85('0x45')]=function(_0x283151,_0x4415f4){return db[_0x9a85('0x2a')]['create'](_0x283151[_0x9a85('0x46')],{})['then'](respondWithResult(_0x4415f4,0xc9))['catch'](handleError(_0x4415f4,null));};exports[_0x9a85('0x22')]=function(_0x2ca378,_0x3ce6de){if(_0x2ca378[_0x9a85('0x46')]['id']){delete _0x2ca378[_0x9a85('0x46')]['id'];}return db[_0x9a85('0x2a')][_0x9a85('0x44')]({'where':{'id':_0x2ca378['params']['id']}})[_0x9a85('0x3a')](handleEntityNotFound(_0x3ce6de,null))[_0x9a85('0x3a')](saveUpdates(_0x2ca378['body'],null))[_0x9a85('0x3a')](respondWithResult(_0x3ce6de,null))[_0x9a85('0x3e')](handleError(_0x3ce6de,null));};exports[_0x9a85('0x23')]=function(_0x10e6be,_0x5bd2eb){return db['ServicenowField'][_0x9a85('0x44')]({'where':{'id':_0x10e6be['params']['id']}})[_0x9a85('0x3a')](handleEntityNotFound(_0x5bd2eb,null))[_0x9a85('0x3a')](removeEntity(_0x5bd2eb,null))[_0x9a85('0x3e')](handleError(_0x5bd2eb,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 431c17b..989f221 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 _0xaf40=['define','ServicenowField','servicenow_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports'];(function(_0xc07c48,_0x44605c){var _0x12f62a=function(_0x366804){while(--_0x366804){_0xc07c48['push'](_0xc07c48['shift']());}};_0x12f62a(++_0x44605c);}(_0xaf40,0x75));var _0x0af4=function(_0x400943,_0x21a6c2){_0x400943=_0x400943-0x0;var _0x132814=_0xaf40[_0x400943];return _0x132814;};'use strict';var _=require('lodash');var util=require(_0x0af4('0x0'));var logger=require(_0x0af4('0x1'))(_0x0af4('0x2'));var moment=require(_0x0af4('0x3'));var BPromise=require(_0x0af4('0x4'));var rp=require(_0x0af4('0x5'));var fs=require('fs');var path=require(_0x0af4('0x6'));var rimraf=require(_0x0af4('0x7'));var config=require(_0x0af4('0x8'));var attributes=require(_0x0af4('0x9'));module[_0x0af4('0xa')]=function(_0x1aebbe,_0x244b1b){return _0x1aebbe[_0x0af4('0xb')](_0x0af4('0xc'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x0af4('0xd'),'fields':[_0x0af4('0xe'),_0x0af4('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9e87=['path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5b350a,_0x60510e){var _0x5f1e67=function(_0x369f8){while(--_0x369f8){_0x5b350a['push'](_0x5b350a['shift']());}};_0x5f1e67(++_0x60510e);}(_0x9e87,0x1ba));var _0x79e8=function(_0x1a809b,_0x4c15e3){_0x1a809b=_0x1a809b-0x0;var _0x5d90e6=_0x9e87[_0x1a809b];return _0x5d90e6;};'use strict';var _=require('lodash');var util=require(_0x79e8('0x0'));var logger=require(_0x79e8('0x1'))(_0x79e8('0x2'));var moment=require(_0x79e8('0x3'));var BPromise=require(_0x79e8('0x4'));var rp=require(_0x79e8('0x5'));var fs=require('fs');var path=require(_0x79e8('0x6'));var rimraf=require(_0x79e8('0x7'));var config=require(_0x79e8('0x8'));var attributes=require(_0x79e8('0x9'));module[_0x79e8('0xa')]=function(_0x428b59,_0x5ef49c){return _0x428b59[_0x79e8('0xb')](_0x79e8('0xc'),attributes,{'tableName':_0x79e8('0xd'),'paranoid':![],'indexes':[{'name':_0x79e8('0xe'),'fields':[_0x79e8('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index fa7b77c..c00444e 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 _0x50ae=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','ServicenowField,\x20%s,\x20%s','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x327c69,_0x27e755){var _0x49c1af=function(_0x21f59e){while(--_0x21f59e){_0x327c69['push'](_0x327c69['shift']());}};_0x49c1af(++_0x27e755);}(_0x50ae,0x1b4));var _0xe50a=function(_0x53ebd9,_0xf37766){_0x53ebd9=_0x53ebd9-0x0;var _0xbaeac=_0x50ae[_0x53ebd9];return _0xbaeac;};'use strict';var _=require('lodash');var util=require(_0xe50a('0x0'));var moment=require(_0xe50a('0x1'));var BPromise=require(_0xe50a('0x2'));var rs=require(_0xe50a('0x3'));var fs=require('fs');var Redis=require(_0xe50a('0x4'));var db=require(_0xe50a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe50a('0x6'))('rpc');var config=require(_0xe50a('0x7'));var jayson=require(_0xe50a('0x8'));var client=jayson['client'][_0xe50a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e1672,_0x109919,_0x29f574){return new BPromise(function(_0xf0f702,_0x25a2dc){return client[_0xe50a('0xa')](_0x5e1672,_0x29f574)['then'](function(_0x14336d){logger[_0xe50a('0xb')](_0xe50a('0xc'),_0x109919,'request\x20sent');logger['debug'](_0xe50a('0xd'),_0x109919,_0xe50a('0xe'),JSON[_0xe50a('0xf')](_0x14336d));if(_0x14336d[_0xe50a('0x10')]){if(_0x14336d[_0xe50a('0x10')][_0xe50a('0x11')]===0x1f4){logger[_0xe50a('0x10')](_0xe50a('0xc'),_0x109919,_0x14336d['error'][_0xe50a('0x12')]);return _0x25a2dc(_0x14336d[_0xe50a('0x10')][_0xe50a('0x12')]);}logger[_0xe50a('0x10')](_0xe50a('0xc'),_0x109919,_0x14336d[_0xe50a('0x10')][_0xe50a('0x12')]);return _0xf0f702(_0x14336d[_0xe50a('0x10')][_0xe50a('0x12')]);}else{logger[_0xe50a('0xb')]('ServicenowField,\x20%s,\x20%s',_0x109919,'request\x20sent');_0xf0f702(_0x14336d[_0xe50a('0x13')]['message']);}})[_0xe50a('0x14')](function(_0x599c3e){logger['error'](_0xe50a('0xc'),_0x109919,_0x599c3e);_0x25a2dc(_0x599c3e);});});} \ No newline at end of file +var _0xb883=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x1d840c,_0x49d59f){var _0x34c10f=function(_0x28b53b){while(--_0x28b53b){_0x1d840c['push'](_0x1d840c['shift']());}};_0x34c10f(++_0x49d59f);}(_0xb883,0x195));var _0x3b88=function(_0x3d2bbb,_0x2d8796){_0x3d2bbb=_0x3d2bbb-0x0;var _0x1da6d1=_0xb883[_0x3d2bbb];return _0x1da6d1;};'use strict';var _=require(_0x3b88('0x0'));var util=require(_0x3b88('0x1'));var moment=require(_0x3b88('0x2'));var BPromise=require(_0x3b88('0x3'));var rs=require(_0x3b88('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3b88('0x5'))['db'];var utils=require(_0x3b88('0x6'));var logger=require(_0x3b88('0x7'))('rpc');var config=require(_0x3b88('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3b88('0x9')][_0x3b88('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x264ca2,_0x31a03a,_0x1b5257){return new BPromise(function(_0x28ede4,_0x508d3b){return client[_0x3b88('0xb')](_0x264ca2,_0x1b5257)[_0x3b88('0xc')](function(_0x1ff601){logger[_0x3b88('0xd')](_0x3b88('0xe'),_0x31a03a,'request\x20sent');logger[_0x3b88('0xf')](_0x3b88('0x10'),_0x31a03a,_0x3b88('0x11'),JSON[_0x3b88('0x12')](_0x1ff601));if(_0x1ff601['error']){if(_0x1ff601[_0x3b88('0x13')][_0x3b88('0x14')]===0x1f4){logger[_0x3b88('0x13')](_0x3b88('0xe'),_0x31a03a,_0x1ff601['error'][_0x3b88('0x15')]);return _0x508d3b(_0x1ff601['error'][_0x3b88('0x15')]);}logger[_0x3b88('0x13')](_0x3b88('0xe'),_0x31a03a,_0x1ff601[_0x3b88('0x13')][_0x3b88('0x15')]);return _0x28ede4(_0x1ff601[_0x3b88('0x13')][_0x3b88('0x15')]);}else{logger[_0x3b88('0xd')]('ServicenowField,\x20%s,\x20%s',_0x31a03a,_0x3b88('0x11'));_0x28ede4(_0x1ff601[_0x3b88('0x16')][_0x3b88('0x15')]);}})[_0x3b88('0x17')](function(_0x5f1017){logger[_0x3b88('0x13')](_0x3b88('0xe'),_0x31a03a,_0x5f1017);_0x508d3b(_0x5f1017);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 1a03fad..88a7280 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 _0x7fc4=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','delete'];(function(_0x239c42,_0x15322e){var _0x3f06cb=function(_0x316a63){while(--_0x316a63){_0x239c42['push'](_0x239c42['shift']());}};_0x3f06cb(++_0x15322e);}(_0x7fc4,0xaa));var _0x47fc=function(_0x170cf8,_0x5507a6){_0x170cf8=_0x170cf8-0x0;var _0x2883d5=_0x7fc4[_0x170cf8];return _0x2883d5;};'use strict';var multer=require(_0x47fc('0x0'));var util=require(_0x47fc('0x1'));var path=require(_0x47fc('0x2'));var timeout=require(_0x47fc('0x3'));var express=require(_0x47fc('0x4'));var router=express[_0x47fc('0x5')]();var auth=require(_0x47fc('0x6'));var interaction=require(_0x47fc('0x7'));var config=require(_0x47fc('0x8'));var controller=require(_0x47fc('0x9'));router[_0x47fc('0xa')]('/',auth['isAuthenticated'](),controller[_0x47fc('0xb')]);router['get']('/:id',auth[_0x47fc('0xc')](),controller[_0x47fc('0xd')]);router[_0x47fc('0xa')](_0x47fc('0xe'),auth[_0x47fc('0xc')](),controller[_0x47fc('0xf')]);router[_0x47fc('0xa')](_0x47fc('0x10'),auth[_0x47fc('0xc')](),controller[_0x47fc('0x11')]);router[_0x47fc('0x12')]('/',auth['isAuthenticated'](),controller[_0x47fc('0x13')]);router[_0x47fc('0x12')](_0x47fc('0xe'),auth[_0x47fc('0xc')](),controller['addConfiguration']);router[_0x47fc('0x14')]('/:id',auth[_0x47fc('0xc')](),controller['update']);router[_0x47fc('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x47fc('0x16')]);module[_0x47fc('0x17')]=router; \ No newline at end of file +var _0x4a14=['isAuthenticated','getConfigurations','/:id/fields','getFields','create','addConfiguration','put','destroy','multer','util','path','connect-timeout','express','Router','../../config/environment','./intSugarcrmAccount.controller','index','get','/:id','show','/:id/configurations'];(function(_0x2351c4,_0x1dca54){var _0x1dd3f8=function(_0x4c3fa2){while(--_0x4c3fa2){_0x2351c4['push'](_0x2351c4['shift']());}};_0x1dd3f8(++_0x1dca54);}(_0x4a14,0x1d6));var _0x44a1=function(_0x23e541,_0x2b1766){_0x23e541=_0x23e541-0x0;var _0x2310be=_0x4a14[_0x23e541];return _0x2310be;};'use strict';var multer=require(_0x44a1('0x0'));var util=require(_0x44a1('0x1'));var path=require(_0x44a1('0x2'));var timeout=require(_0x44a1('0x3'));var express=require(_0x44a1('0x4'));var router=express[_0x44a1('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x44a1('0x6'));var controller=require(_0x44a1('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x44a1('0x8')]);router[_0x44a1('0x9')](_0x44a1('0xa'),auth['isAuthenticated'](),controller[_0x44a1('0xb')]);router[_0x44a1('0x9')](_0x44a1('0xc'),auth[_0x44a1('0xd')](),controller[_0x44a1('0xe')]);router[_0x44a1('0x9')](_0x44a1('0xf'),auth[_0x44a1('0xd')](),controller[_0x44a1('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x44a1('0x11')]);router['post']('/:id/configurations',auth[_0x44a1('0xd')](),controller[_0x44a1('0x12')]);router[_0x44a1('0x13')](_0x44a1('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x44a1('0xa'),auth[_0x44a1('0xd')](),controller[_0x44a1('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 09a9b0e..5632be4 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 _0x68f8=['sequelize','exports','STRING','username'];(function(_0x2894b4,_0xcbe151){var _0x1ef5fd=function(_0x58aec9){while(--_0x58aec9){_0x2894b4['push'](_0x2894b4['shift']());}};_0x1ef5fd(++_0xcbe151);}(_0x68f8,0x10c));var _0x868f=function(_0xf99fc0,_0x3b8fa3){_0xf99fc0=_0xf99fc0-0x0;var _0x44bb24=_0x68f8[_0xf99fc0];return _0x44bb24;};'use strict';var Sequelize=require(_0x868f('0x0'));module[_0x868f('0x1')]={'name':{'type':Sequelize[_0x868f('0x2')]},'description':{'type':Sequelize[_0x868f('0x2')]},'username':{'type':Sequelize[_0x868f('0x2')],'unique':_0x868f('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x868f('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x868f('0x2')]}}; \ No newline at end of file +var _0x6386=['STRING','username','remoteUri','exports'];(function(_0x397492,_0x48fa73){var _0x31ebde=function(_0x4a1b93){while(--_0x4a1b93){_0x397492['push'](_0x397492['shift']());}};_0x31ebde(++_0x48fa73);}(_0x6386,0x93));var _0x6638=function(_0x4d04ee,_0x2546e4){_0x4d04ee=_0x4d04ee-0x0;var _0x204aab=_0x6386[_0x4d04ee];return _0x204aab;};'use strict';var Sequelize=require('sequelize');module[_0x6638('0x0')]={'name':{'type':Sequelize[_0x6638('0x1')]},'description':{'type':Sequelize[_0x6638('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x6638('0x2')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x6638('0x1')],'unique':_0x6638('0x3')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index f534067..b53983c 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 _0x0fb4=['Invalid\x20Login','Password\x20Expired','format','values','module_fields','remove','label','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','stack','name','send','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','update','findOne','SugarcrmConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','SugarcrmField','getFields','created_by','description','date_start','duration_hours','parent_type','parent_name','username','password','remoteUri','slice','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','JSON','PLAIN','xCALLY\x20Motion\x20Integration'];(function(_0x24310a,_0x22f59f){var _0x34fe89=function(_0x4a26c2){while(--_0x4a26c2){_0x24310a['push'](_0x24310a['shift']());}};_0x34fe89(++_0x22f59f);}(_0x0fb4,0x10e));var _0x40fb=function(_0x3ee1fe,_0x59f2a1){_0x3ee1fe=_0x3ee1fe-0x0;var _0x1ae57a=_0x0fb4[_0x3ee1fe];return _0x1ae57a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x40fb('0x0'));var zipdir=require(_0x40fb('0x1'));var jsonpatch=require(_0x40fb('0x2'));var rp=require(_0x40fb('0x3'));var moment=require(_0x40fb('0x4'));var BPromise=require(_0x40fb('0x5'));var Mustache=require(_0x40fb('0x6'));var util=require('util');var path=require(_0x40fb('0x7'));var sox=require(_0x40fb('0x8'));var csv=require(_0x40fb('0x9'));var ejs=require(_0x40fb('0xa'));var fs=require('fs');var _=require(_0x40fb('0xb'));var squel=require('squel');var crypto=require(_0x40fb('0xc'));var jsforce=require(_0x40fb('0xd'));var deskjs=require(_0x40fb('0xe'));var toCsv=require(_0x40fb('0x9'));var querystring=require(_0x40fb('0xf'));var Papa=require('papaparse');var Redis=require(_0x40fb('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x40fb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x40fb('0x12'));var logger=require(_0x40fb('0x13'))(_0x40fb('0x14'));var utils=require(_0x40fb('0x15'));var config=require(_0x40fb('0x16'));var db=require(_0x40fb('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x40fb('0x18'));var client=jayson[_0x40fb('0x19')][_0x40fb('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x2b3ed6,_0x17b43b,_0x2d39b5){if(_0x2d39b5){var _0x5b66c5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5b66c5[_0x40fb('0x1b')](_0x17b43b)){return _0x2b3ed6;}else{throw new db[(_0x40fb('0x1c'))][(_0x40fb('0x1d'))](_0x40fb('0x1e'));}}else{return _0x2b3ed6;}}function respondWithRpcPromise(_0x327c5c,_0x437246,_0x4f5d29,_0x17d761){return new BPromise(function(_0xc9fda3,_0x430b92){var _0x46b538=_0x17d761||client;return _0x46b538[_0x40fb('0x1f')](_0x327c5c,_0x4f5d29)[_0x40fb('0x20')](function(_0x28c6ee){logger['info'](_0x40fb('0x21'),_0x437246,_0x40fb('0x22'));logger[_0x40fb('0x23')](_0x40fb('0x24'),_0x437246,_0x40fb('0x22'),JSON[_0x40fb('0x25')](_0x28c6ee));if(_0x28c6ee['error']){if(_0x28c6ee[_0x40fb('0x26')][_0x40fb('0x27')]===0x1f4){logger[_0x40fb('0x26')]('SugarcrmAccount,\x20%s,\x20%s',_0x437246,_0x28c6ee['error'][_0x40fb('0x28')]);return _0x430b92(_0x28c6ee['error'][_0x40fb('0x28')]);}logger['error'](_0x40fb('0x21'),_0x437246,_0x28c6ee[_0x40fb('0x26')][_0x40fb('0x28')]);return _0xc9fda3(_0x28c6ee['error'][_0x40fb('0x28')]);}else{logger[_0x40fb('0x29')](_0x40fb('0x21'),_0x437246,_0x40fb('0x22'));_0xc9fda3(_0x28c6ee['result']['message']);}})[_0x40fb('0x2a')](function(_0x26305b){logger['error'](_0x40fb('0x21'),_0x437246,_0x26305b);_0x430b92(_0x26305b);});});}function respondWithStatusCode(_0x3b919a,_0x5a6eaa){_0x5a6eaa=_0x5a6eaa||0xcc;return function(_0x1e1a97){if(_0x1e1a97){return _0x3b919a[_0x40fb('0x2b')](_0x5a6eaa);}return _0x3b919a[_0x40fb('0x2c')](_0x5a6eaa)[_0x40fb('0x2d')]();};}function respondWithResult(_0x3752e0,_0x1af886){_0x1af886=_0x1af886||0xc8;return function(_0x5b2888){if(_0x5b2888){return _0x3752e0[_0x40fb('0x2c')](_0x1af886)[_0x40fb('0x2e')](_0x5b2888);}};}function respondWithFilteredResult(_0x1db1cc,_0x6ff5cf){return function(_0x2ce7b1){if(_0x2ce7b1){var _0x3d1056=_0x2ce7b1[_0x40fb('0x2f')],_0x7e01a7=_0x6ff5cf[_0x40fb('0x30')],_0x3cf0be=_0x6ff5cf[_0x40fb('0x30')]+_0x6ff5cf[_0x40fb('0x31')],_0xa52162;if(_0x3cf0be>=_0x3d1056){_0x3cf0be=_0x3d1056;_0xa52162=0xc8;}else{_0xa52162=0xce;}_0x1db1cc[_0x40fb('0x2c')](_0xa52162);return _0x1db1cc[_0x40fb('0x32')]('Content-Range',_0x7e01a7+'-'+_0x3cf0be+'/'+_0x3d1056)[_0x40fb('0x2e')](_0x2ce7b1);}return null;};}function patchUpdates(_0xba4140){return function(_0x4fd20c){try{jsonpatch[_0x40fb('0x33')](_0x4fd20c,_0xba4140,!![]);}catch(_0x2a7a67){return BPromise[_0x40fb('0x34')](_0x2a7a67);}return _0x4fd20c[_0x40fb('0x35')]();};}function saveUpdates(_0x5e296e,_0x538281){return function(_0x27c30f){if(_0x27c30f){return _0x27c30f['update'](_0x5e296e)['then'](function(_0x1831f6){return _0x1831f6;});}return null;};}function removeEntity(_0x1ae514,_0x3dd1b0){return function(_0x508ce4){if(_0x508ce4){return _0x508ce4['destroy']()['then'](function(){_0x1ae514[_0x40fb('0x2c')](0xcc)[_0x40fb('0x2d')]();});}};}function handleEntityNotFound(_0x4036c8,_0x3fac18){return function(_0x573eaf){if(!_0x573eaf){_0x4036c8[_0x40fb('0x2b')](0x194);}return _0x573eaf;};}function handleError(_0x41d71a,_0x30dc2b){_0x30dc2b=_0x30dc2b||0x1f4;return function(_0x52a0e2){logger['error'](_0x52a0e2[_0x40fb('0x36')]);if(_0x52a0e2[_0x40fb('0x37')]){delete _0x52a0e2[_0x40fb('0x37')];}_0x41d71a['status'](_0x30dc2b)[_0x40fb('0x38')](_0x52a0e2);};}exports['index']=function(_0xea5536,_0x583886){var _0x22e3df={},_0x12456a={},_0x3c6f7c={'count':0x0,'rows':[]};var _0x4e58f1=_[_0x40fb('0x39')](db[_0x40fb('0x3a')][_0x40fb('0x3b')],function(_0x5ac6c8){return{'name':_0x5ac6c8[_0x40fb('0x3c')],'type':_0x5ac6c8[_0x40fb('0x3d')][_0x40fb('0x3e')]};});_0x12456a[_0x40fb('0x3f')]=_[_0x40fb('0x39')](_0x4e58f1,_0x40fb('0x37'));_0x12456a[_0x40fb('0x40')]=_['keys'](_0xea5536['query']);_0x12456a[_0x40fb('0x41')]=_['intersection'](_0x12456a[_0x40fb('0x3f')],_0x12456a[_0x40fb('0x40')]);_0x22e3df[_0x40fb('0x42')]=_[_0x40fb('0x43')](_0x12456a[_0x40fb('0x3f')],qs[_0x40fb('0x44')](_0xea5536[_0x40fb('0x40')]['fields']));_0x22e3df['attributes']=_0x22e3df[_0x40fb('0x42')][_0x40fb('0x45')]?_0x22e3df[_0x40fb('0x42')]:_0x12456a[_0x40fb('0x3f')];if(!_0xea5536['query'][_0x40fb('0x46')](_0x40fb('0x47'))){_0x22e3df[_0x40fb('0x31')]=qs['limit'](_0xea5536['query'][_0x40fb('0x31')]);_0x22e3df[_0x40fb('0x30')]=qs[_0x40fb('0x30')](_0xea5536[_0x40fb('0x40')][_0x40fb('0x30')]);}_0x22e3df[_0x40fb('0x48')]=qs['sort'](_0xea5536[_0x40fb('0x40')][_0x40fb('0x49')]);_0x22e3df[_0x40fb('0x4a')]=qs['filters'](_[_0x40fb('0x4b')](_0xea5536['query'],_0x12456a[_0x40fb('0x41')]));if(_0xea5536[_0x40fb('0x40')][_0x40fb('0x4c')]){_0x22e3df[_0x40fb('0x4a')]=_[_0x40fb('0x4d')](_0x22e3df['where'],{'$or':_[_0x40fb('0x39')](_0x4e58f1,function(_0x2c0ed2){if(_0x2c0ed2[_0x40fb('0x3d')]!==_0x40fb('0x4e')){var _0x5c853f={};_0x5c853f[_0x2c0ed2['name']]={'$like':'%'+_0xea5536['query'][_0x40fb('0x4c')]+'%'};return _0x5c853f;}})});}_0x22e3df=_[_0x40fb('0x4d')]({},_0x22e3df,_0xea5536[_0x40fb('0x4f')]);var _0x50dc47={'where':_0x22e3df[_0x40fb('0x4a')]};return db[_0x40fb('0x3a')][_0x40fb('0x2f')](_0x50dc47)[_0x40fb('0x20')](function(_0x839202){_0x3c6f7c['count']=_0x839202;if(_0xea5536['query'][_0x40fb('0x50')]){_0x22e3df[_0x40fb('0x51')]=[{'all':!![]}];}return db[_0x40fb('0x3a')][_0x40fb('0x52')](_0x22e3df);})['then'](function(_0x49c380){_0x3c6f7c[_0x40fb('0x53')]=_0x49c380;return _0x3c6f7c;})[_0x40fb('0x20')](respondWithFilteredResult(_0x583886,_0x22e3df))[_0x40fb('0x2a')](handleError(_0x583886,null));};exports[_0x40fb('0x54')]=function(_0x4df119,_0x4bbebd){var _0x5868f3={'raw':![],'where':{'id':_0x4df119[_0x40fb('0x55')]['id']}},_0x15ea74={};_0x15ea74['model']=_[_0x40fb('0x56')](db[_0x40fb('0x3a')][_0x40fb('0x3b')]);_0x15ea74[_0x40fb('0x40')]=_[_0x40fb('0x56')](_0x4df119['query']);_0x15ea74['filters']=_[_0x40fb('0x43')](_0x15ea74[_0x40fb('0x3f')],_0x15ea74['query']);_0x5868f3['attributes']=_['intersection'](_0x15ea74[_0x40fb('0x3f')],qs[_0x40fb('0x44')](_0x4df119[_0x40fb('0x40')][_0x40fb('0x44')]));_0x5868f3['attributes']=_0x5868f3[_0x40fb('0x42')][_0x40fb('0x45')]?_0x5868f3['attributes']:_0x15ea74['model'];if(_0x4df119['query']['includeAll']){_0x5868f3[_0x40fb('0x51')]=[{'all':!![]}];}_0x5868f3=_[_0x40fb('0x4d')]({},_0x5868f3,_0x4df119[_0x40fb('0x4f')]);return db[_0x40fb('0x3a')][_0x40fb('0x57')](_0x5868f3)['then'](handleEntityNotFound(_0x4bbebd,null))['then'](respondWithResult(_0x4bbebd,null))[_0x40fb('0x2a')](handleError(_0x4bbebd,null));};exports[_0x40fb('0x58')]=function(_0xebc6a4,_0x37c6cd){return db[_0x40fb('0x3a')][_0x40fb('0x58')](_0xebc6a4[_0x40fb('0x59')],{})[_0x40fb('0x20')](respondWithResult(_0x37c6cd,0xc9))['catch'](handleError(_0x37c6cd,null));};exports[_0x40fb('0x5a')]=function(_0x115fb9,_0x508eee){if(_0x115fb9[_0x40fb('0x59')]['id']){delete _0x115fb9[_0x40fb('0x59')]['id'];}return db[_0x40fb('0x3a')][_0x40fb('0x57')]({'where':{'id':_0x115fb9[_0x40fb('0x55')]['id']}})[_0x40fb('0x20')](handleEntityNotFound(_0x508eee,null))[_0x40fb('0x20')](saveUpdates(_0x115fb9[_0x40fb('0x59')],null))['then'](respondWithResult(_0x508eee,null))[_0x40fb('0x2a')](handleError(_0x508eee,null));};exports['destroy']=function(_0x3b4eaa,_0x4f5f08){return db[_0x40fb('0x3a')][_0x40fb('0x57')]({'where':{'id':_0x3b4eaa[_0x40fb('0x55')]['id']}})['then'](handleEntityNotFound(_0x4f5f08,null))[_0x40fb('0x20')](removeEntity(_0x4f5f08,null))[_0x40fb('0x2a')](handleError(_0x4f5f08,null));};exports['getConfigurations']=function(_0x3dac00,_0x4a9aac,_0xc12e34){var _0x53096d={};var _0x1130f2={};var _0x46adc9;var _0x40fdb5;return db[_0x40fb('0x3a')][_0x40fb('0x5b')]({'where':{'id':_0x3dac00[_0x40fb('0x55')]['id']}})[_0x40fb('0x20')](handleEntityNotFound(_0x4a9aac,null))[_0x40fb('0x20')](function(_0x2c6009){if(_0x2c6009){_0x46adc9=_0x2c6009;_0x1130f2[_0x40fb('0x3f')]=_[_0x40fb('0x56')](db[_0x40fb('0x5c')][_0x40fb('0x3b')]);_0x1130f2[_0x40fb('0x40')]=_[_0x40fb('0x56')](_0x3dac00[_0x40fb('0x40')]);_0x1130f2[_0x40fb('0x41')]=_[_0x40fb('0x43')](_0x1130f2[_0x40fb('0x3f')],_0x1130f2[_0x40fb('0x40')]);_0x53096d[_0x40fb('0x42')]=_[_0x40fb('0x43')](_0x1130f2[_0x40fb('0x3f')],qs[_0x40fb('0x44')](_0x3dac00[_0x40fb('0x40')]['fields']));_0x53096d[_0x40fb('0x42')]=_0x53096d[_0x40fb('0x42')]['length']?_0x53096d[_0x40fb('0x42')]:_0x1130f2[_0x40fb('0x3f')];_0x53096d[_0x40fb('0x48')]=qs['sort'](_0x3dac00[_0x40fb('0x40')][_0x40fb('0x49')]);_0x53096d[_0x40fb('0x4a')]=qs['filters'](_[_0x40fb('0x4b')](_0x3dac00['query'],_0x1130f2[_0x40fb('0x41')]));if(_0x3dac00[_0x40fb('0x40')][_0x40fb('0x4c')]){_0x53096d[_0x40fb('0x4a')]=_[_0x40fb('0x4d')](_0x53096d['where'],{'$or':_[_0x40fb('0x39')](_0x53096d[_0x40fb('0x42')],function(_0x57641d){var _0x5b00a1={};_0x5b00a1[_0x57641d]={'$like':'%'+_0x3dac00[_0x40fb('0x40')][_0x40fb('0x4c')]+'%'};return _0x5b00a1;})});}_0x53096d=_[_0x40fb('0x4d')]({},_0x53096d,_0x3dac00['options']);return _0x46adc9['getConfigurations'](_0x53096d);}})['then'](function(_0x285057){if(_0x285057){_0x40fdb5=_0x285057[_0x40fb('0x45')];if(!_0x3dac00[_0x40fb('0x40')][_0x40fb('0x46')](_0x40fb('0x47'))){_0x53096d[_0x40fb('0x31')]=qs['limit'](_0x3dac00[_0x40fb('0x40')][_0x40fb('0x31')]);_0x53096d[_0x40fb('0x30')]=qs[_0x40fb('0x30')](_0x3dac00[_0x40fb('0x40')][_0x40fb('0x30')]);}return _0x46adc9['getConfigurations'](_0x53096d);}})[_0x40fb('0x20')](function(_0x1c4f75){if(_0x1c4f75){return _0x1c4f75?{'count':_0x40fdb5,'rows':_0x1c4f75}:null;}})[_0x40fb('0x20')](respondWithResult(_0x4a9aac,null))[_0x40fb('0x2a')](handleError(_0x4a9aac,null));};exports['addConfiguration']=function(_0x25a4e0,_0x47bf0b,_0x5a4a17){if(_0x25a4e0['body']['id']){delete _0x25a4e0[_0x40fb('0x59')]['id'];}return db[_0x40fb('0x3a')][_0x40fb('0x5b')]({'where':{'id':_0x25a4e0[_0x40fb('0x55')]['id']}})[_0x40fb('0x20')](handleEntityNotFound(_0x47bf0b,null))['then'](function(_0x20091d){if(_0x20091d){_0x25a4e0[_0x40fb('0x59')][_0x40fb('0x5d')]=_0x20091d['id'];_0x25a4e0[_0x40fb('0x59')][_0x40fb('0x5e')]=integrations[_0x40fb('0x5f')](_0x25a4e0['body']['channel'],_0x25a4e0[_0x40fb('0x59')][_0x40fb('0x3d')]);_0x25a4e0[_0x40fb('0x59')][_0x40fb('0x60')]=integrations['getDescriptions'](_0x25a4e0[_0x40fb('0x59')][_0x40fb('0x61')],_0x25a4e0[_0x40fb('0x59')][_0x40fb('0x3d')]);return db[_0x40fb('0x5c')][_0x40fb('0x58')](_0x25a4e0[_0x40fb('0x59')],{'include':[{'model':db['SugarcrmField'],'as':'Subjects'},{'model':db[_0x40fb('0x62')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x47bf0b,null))[_0x40fb('0x2a')](handleError(_0x47bf0b,null));};exports[_0x40fb('0x63')]=function(_0x361277,_0x2c72fe,_0x37b81a){var _0x33bdd9='';var _0x56c87b=['id',_0x40fb('0x37'),'assigned_user_id',_0x40fb('0x64'),_0x40fb('0x65'),_0x40fb('0x66'),_0x40fb('0x67'),'duration_minutes','parent_id',_0x40fb('0x68'),_0x40fb('0x69'),'direction'];return db[_0x40fb('0x3a')][_0x40fb('0x5b')]({'where':{'id':_0x361277[_0x40fb('0x55')]['id']},'attributes':['id',_0x40fb('0x6a'),_0x40fb('0x6b'),'remoteUri']})[_0x40fb('0x20')](handleEntityNotFound(_0x2c72fe,null))[_0x40fb('0x20')](function(_0x4f2bee){if(_0x4f2bee){_0x33bdd9=_0x4f2bee[_0x40fb('0x6c')];var _0x5b4837=_0x33bdd9[_0x40fb('0x6d')](-0x1);if(_0x5b4837==='/'){_0x33bdd9=_0x33bdd9['substring'](0x0,_0x33bdd9[_0x40fb('0x6e')](_0x5b4837));}return rp({'method':_0x40fb('0x6f'),'uri':util['format'](_0x40fb('0x70'),_0x33bdd9,_0x40fb('0x71')),'json':!![],'form':{'method':'login','input_type':_0x40fb('0x72'),'response_type':'JSON','rest_data':JSON[_0x40fb('0x25')]({'user_auth':{'user_name':_0x4f2bee[_0x40fb('0x6a')],'password':_0x4f2bee[_0x40fb('0x6b')],'encryption':_0x40fb('0x73')},'application':_0x40fb('0x74')})}});}})[_0x40fb('0x20')](function(_0x4c25ba){if(_0x4c25ba&&_0x4c25ba[_0x40fb('0x37')]!==_0x40fb('0x75')&&_0x4c25ba[_0x40fb('0x37')]!==_0x40fb('0x76')){return rp({'method':_0x40fb('0x6f'),'uri':util[_0x40fb('0x77')](_0x40fb('0x70'),_0x33bdd9,_0x40fb('0x71')),'json':!![],'form':{'method':'get_module_fields','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x40fb('0x25')]({'session':_0x4c25ba['id'],'module_name':'Calls'})}})[_0x40fb('0x20')](function(_0xe3ed67){if(_0xe3ed67){var _0x34eeaf=_[_0x40fb('0x78')](_0xe3ed67[_0x40fb('0x79')]);_[_0x40fb('0x7a')](_0x34eeaf,function(_0x434962){return _0x56c87b['includes'](_0x434962[_0x40fb('0x37')]);});return{'count':_0x34eeaf[_0x40fb('0x45')],'rows':_[_0x40fb('0x39')](_0x34eeaf,function(_0x1dafef){return{'id':_0x1dafef[_0x40fb('0x37')],'name':_0x1dafef[_0x40fb('0x7b')],'custom':_[_0x40fb('0x7c')](_0x1dafef[_0x40fb('0x37')],'_c')?!![]:![],'options':_0x1dafef['options']?_['map'](_[_0x40fb('0x78')](_0x1dafef[_0x40fb('0x4f')]),function(_0x40a96f){return{'name':_0x40a96f[_0x40fb('0x7d')],'value':_0x40a96f[_0x40fb('0x37')]};}):[]};})};}})[_0x40fb('0x20')](respondWithResult(_0x2c72fe,null))['catch'](function(_0x1b9294){var _0x590bf0=_0x361277[_0x40fb('0x40')][_0x40fb('0x1b')]?0x1f4:_0x1b9294[_0x40fb('0x7e')]||0x1f4;logger[_0x40fb('0x26')](_0x40fb('0x7f'),_0x40fb('0x63'),_0x590bf0,JSON['stringify'](_0x1b9294));delete _0x1b9294[_0x40fb('0x37')];if(_0x590bf0===0x191){_0x590bf0=0x190;}_0x2c72fe[_0x40fb('0x2c')](_0x590bf0)[_0x40fb('0x38')](_0x361277['query'][_0x40fb('0x1b')]?{'message':'Wrong\x20credentials','statusCode':_0x1b9294[_0x40fb('0x7e')]}:_0x1b9294);});}else{var _0x3563c3=0x1f4;_0x2c72fe['status'](_0x3563c3)[_0x40fb('0x38')]({'message':_0x40fb('0x80'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x8bb3=['slice','substring','lastIndexOf','%s%s','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','format','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','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~!@#$%^&-_=+[{]}.','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','end','status','count','offset','limit','set','json','reject','save','update','then','destroy','stack','name','index','map','SugarcrmAccount','type','key','model','keys','filters','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','find','create','body','catch','getConfigurations','findOne','SugarcrmConfiguration','length','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','assigned_user_id','description','date_start','duration_minutes','parent_id','parent_type','parent_name','direction','username','remoteUri'];(function(_0x483ab9,_0x419148){var _0x35043b=function(_0x3453a3){while(--_0x3453a3){_0x483ab9['push'](_0x483ab9['shift']());}};_0x35043b(++_0x419148);}(_0x8bb3,0xa3));var _0x38bb=function(_0x4c157b,_0x3aabd3){_0x4c157b=_0x4c157b-0x0;var _0x4bf108=_0x8bb3[_0x4c157b];return _0x4bf108;};'use strict';var pdf=require(_0x38bb('0x0'));var emlformat=require(_0x38bb('0x1'));var rimraf=require(_0x38bb('0x2'));var zipdir=require(_0x38bb('0x3'));var jsonpatch=require(_0x38bb('0x4'));var rp=require('request-promise');var moment=require(_0x38bb('0x5'));var BPromise=require(_0x38bb('0x6'));var Mustache=require(_0x38bb('0x7'));var util=require(_0x38bb('0x8'));var path=require(_0x38bb('0x9'));var sox=require(_0x38bb('0xa'));var csv=require(_0x38bb('0xb'));var ejs=require(_0x38bb('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x38bb('0xd'));var crypto=require('crypto');var jsforce=require(_0x38bb('0xe'));var deskjs=require(_0x38bb('0xf'));var toCsv=require(_0x38bb('0xb'));var querystring=require('querystring');var Papa=require(_0x38bb('0x10'));var Redis=require(_0x38bb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x38bb('0x12'));var as=require(_0x38bb('0x13'));var hardwareService=require(_0x38bb('0x14'));var logger=require(_0x38bb('0x15'))('api');var utils=require(_0x38bb('0x16'));var config=require('../../config/environment');var db=require(_0x38bb('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x38bb('0x18'));var client=jayson['client'][_0x38bb('0x19')]({'port':0x232a});function checkPasswordPattern(_0x2c3c38,_0x1dd0ea,_0x2cac16){if(_0x2cac16){var _0x286eb8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x286eb8['test'](_0x1dd0ea)){return _0x2c3c38;}else{throw new db[(_0x38bb('0x1a'))]['ValidationError'](_0x38bb('0x1b'));}}else{return _0x2c3c38;}}function respondWithRpcPromise(_0x551816,_0xe42fe3,_0x2a6582,_0x5df8c4){return new BPromise(function(_0x445f0d,_0x2e29af){var _0x12140=_0x5df8c4||client;return _0x12140[_0x38bb('0x1c')](_0x551816,_0x2a6582)['then'](function(_0x5c8154){logger[_0x38bb('0x1d')](_0x38bb('0x1e'),_0xe42fe3,_0x38bb('0x1f'));logger[_0x38bb('0x20')](_0x38bb('0x21'),_0xe42fe3,'request\x20sent',JSON['stringify'](_0x5c8154));if(_0x5c8154[_0x38bb('0x22')]){if(_0x5c8154[_0x38bb('0x22')][_0x38bb('0x23')]===0x1f4){logger['error'](_0x38bb('0x1e'),_0xe42fe3,_0x5c8154[_0x38bb('0x22')][_0x38bb('0x24')]);return _0x2e29af(_0x5c8154[_0x38bb('0x22')][_0x38bb('0x24')]);}logger[_0x38bb('0x22')](_0x38bb('0x1e'),_0xe42fe3,_0x5c8154[_0x38bb('0x22')][_0x38bb('0x24')]);return _0x445f0d(_0x5c8154[_0x38bb('0x22')][_0x38bb('0x24')]);}else{logger[_0x38bb('0x1d')]('SugarcrmAccount,\x20%s,\x20%s',_0xe42fe3,_0x38bb('0x1f'));_0x445f0d(_0x5c8154[_0x38bb('0x25')][_0x38bb('0x24')]);}})['catch'](function(_0x253bbe){logger['error'](_0x38bb('0x1e'),_0xe42fe3,_0x253bbe);_0x2e29af(_0x253bbe);});});}function respondWithStatusCode(_0x147912,_0x222d58){_0x222d58=_0x222d58||0xcc;return function(_0x323b38){if(_0x323b38){return _0x147912[_0x38bb('0x26')](_0x222d58);}return _0x147912['status'](_0x222d58)[_0x38bb('0x27')]();};}function respondWithResult(_0x8b7bb6,_0x102617){_0x102617=_0x102617||0xc8;return function(_0x4a351f){if(_0x4a351f){return _0x8b7bb6[_0x38bb('0x28')](_0x102617)['json'](_0x4a351f);}};}function respondWithFilteredResult(_0x577492,_0x115706){return function(_0x443287){if(_0x443287){var _0x5d6f8c=_0x443287[_0x38bb('0x29')],_0x423d93=_0x115706['offset'],_0x4d53e2=_0x115706[_0x38bb('0x2a')]+_0x115706[_0x38bb('0x2b')],_0x7ddbd9;if(_0x4d53e2>=_0x5d6f8c){_0x4d53e2=_0x5d6f8c;_0x7ddbd9=0xc8;}else{_0x7ddbd9=0xce;}_0x577492['status'](_0x7ddbd9);return _0x577492[_0x38bb('0x2c')]('Content-Range',_0x423d93+'-'+_0x4d53e2+'/'+_0x5d6f8c)[_0x38bb('0x2d')](_0x443287);}return null;};}function patchUpdates(_0x5b6372){return function(_0x1e99ab){try{jsonpatch['apply'](_0x1e99ab,_0x5b6372,!![]);}catch(_0x575acd){return BPromise[_0x38bb('0x2e')](_0x575acd);}return _0x1e99ab[_0x38bb('0x2f')]();};}function saveUpdates(_0xd7b53,_0x3aab6e){return function(_0x2becb0){if(_0x2becb0){return _0x2becb0[_0x38bb('0x30')](_0xd7b53)[_0x38bb('0x31')](function(_0x1cb4a2){return _0x1cb4a2;});}return null;};}function removeEntity(_0x31ce98,_0x41f369){return function(_0x1dc68c){if(_0x1dc68c){return _0x1dc68c[_0x38bb('0x32')]()[_0x38bb('0x31')](function(){_0x31ce98[_0x38bb('0x28')](0xcc)[_0x38bb('0x27')]();});}};}function handleEntityNotFound(_0x34a69d,_0x56c237){return function(_0x179bd2){if(!_0x179bd2){_0x34a69d[_0x38bb('0x26')](0x194);}return _0x179bd2;};}function handleError(_0x140c38,_0x41f7bc){_0x41f7bc=_0x41f7bc||0x1f4;return function(_0x16513c){logger[_0x38bb('0x22')](_0x16513c[_0x38bb('0x33')]);if(_0x16513c[_0x38bb('0x34')]){delete _0x16513c['name'];}_0x140c38['status'](_0x41f7bc)['send'](_0x16513c);};}exports[_0x38bb('0x35')]=function(_0x3d5b36,_0x5a20ed){var _0xd563a5={},_0x3b2082={},_0x2d30ec={'count':0x0,'rows':[]};var _0x42a094=_[_0x38bb('0x36')](db[_0x38bb('0x37')]['rawAttributes'],function(_0x4fa314){return{'name':_0x4fa314['fieldName'],'type':_0x4fa314[_0x38bb('0x38')][_0x38bb('0x39')]};});_0x3b2082[_0x38bb('0x3a')]=_[_0x38bb('0x36')](_0x42a094,'name');_0x3b2082['query']=_[_0x38bb('0x3b')](_0x3d5b36['query']);_0x3b2082[_0x38bb('0x3c')]=_['intersection'](_0x3b2082[_0x38bb('0x3a')],_0x3b2082[_0x38bb('0x3d')]);_0xd563a5['attributes']=_[_0x38bb('0x3e')](_0x3b2082['model'],qs[_0x38bb('0x3f')](_0x3d5b36['query'][_0x38bb('0x3f')]));_0xd563a5[_0x38bb('0x40')]=_0xd563a5[_0x38bb('0x40')]['length']?_0xd563a5['attributes']:_0x3b2082[_0x38bb('0x3a')];if(!_0x3d5b36['query'][_0x38bb('0x41')](_0x38bb('0x42'))){_0xd563a5['limit']=qs['limit'](_0x3d5b36[_0x38bb('0x3d')][_0x38bb('0x2b')]);_0xd563a5['offset']=qs['offset'](_0x3d5b36[_0x38bb('0x3d')][_0x38bb('0x2a')]);}_0xd563a5[_0x38bb('0x43')]=qs['sort'](_0x3d5b36[_0x38bb('0x3d')][_0x38bb('0x44')]);_0xd563a5[_0x38bb('0x45')]=qs[_0x38bb('0x3c')](_[_0x38bb('0x46')](_0x3d5b36['query'],_0x3b2082['filters']));if(_0x3d5b36[_0x38bb('0x3d')][_0x38bb('0x47')]){_0xd563a5['where']=_[_0x38bb('0x48')](_0xd563a5[_0x38bb('0x45')],{'$or':_[_0x38bb('0x36')](_0x42a094,function(_0x39bb22){if(_0x39bb22[_0x38bb('0x38')]!==_0x38bb('0x49')){var _0x99e57={};_0x99e57[_0x39bb22[_0x38bb('0x34')]]={'$like':'%'+_0x3d5b36[_0x38bb('0x3d')][_0x38bb('0x47')]+'%'};return _0x99e57;}})});}_0xd563a5=_[_0x38bb('0x48')]({},_0xd563a5,_0x3d5b36[_0x38bb('0x4a')]);var _0x1a7c81={'where':_0xd563a5[_0x38bb('0x45')]};return db[_0x38bb('0x37')][_0x38bb('0x29')](_0x1a7c81)['then'](function(_0x503dc4){_0x2d30ec[_0x38bb('0x29')]=_0x503dc4;if(_0x3d5b36[_0x38bb('0x3d')][_0x38bb('0x4b')]){_0xd563a5['include']=[{'all':!![]}];}return db[_0x38bb('0x37')][_0x38bb('0x4c')](_0xd563a5);})[_0x38bb('0x31')](function(_0x1cbf26){_0x2d30ec[_0x38bb('0x4d')]=_0x1cbf26;return _0x2d30ec;})[_0x38bb('0x31')](respondWithFilteredResult(_0x5a20ed,_0xd563a5))['catch'](handleError(_0x5a20ed,null));};exports[_0x38bb('0x4e')]=function(_0x56aa80,_0x1a4640){var _0x3876cb={'raw':![],'where':{'id':_0x56aa80[_0x38bb('0x4f')]['id']}},_0x37a8e9={};_0x37a8e9[_0x38bb('0x3a')]=_[_0x38bb('0x3b')](db['SugarcrmAccount'][_0x38bb('0x50')]);_0x37a8e9[_0x38bb('0x3d')]=_[_0x38bb('0x3b')](_0x56aa80[_0x38bb('0x3d')]);_0x37a8e9[_0x38bb('0x3c')]=_[_0x38bb('0x3e')](_0x37a8e9[_0x38bb('0x3a')],_0x37a8e9[_0x38bb('0x3d')]);_0x3876cb['attributes']=_[_0x38bb('0x3e')](_0x37a8e9[_0x38bb('0x3a')],qs[_0x38bb('0x3f')](_0x56aa80['query'][_0x38bb('0x3f')]));_0x3876cb[_0x38bb('0x40')]=_0x3876cb[_0x38bb('0x40')]['length']?_0x3876cb[_0x38bb('0x40')]:_0x37a8e9['model'];if(_0x56aa80[_0x38bb('0x3d')][_0x38bb('0x4b')]){_0x3876cb['include']=[{'all':!![]}];}_0x3876cb=_[_0x38bb('0x48')]({},_0x3876cb,_0x56aa80[_0x38bb('0x4a')]);return db[_0x38bb('0x37')][_0x38bb('0x51')](_0x3876cb)[_0x38bb('0x31')](handleEntityNotFound(_0x1a4640,null))[_0x38bb('0x31')](respondWithResult(_0x1a4640,null))['catch'](handleError(_0x1a4640,null));};exports[_0x38bb('0x52')]=function(_0x10d860,_0x37b7e2){return db['SugarcrmAccount'][_0x38bb('0x52')](_0x10d860[_0x38bb('0x53')],{})[_0x38bb('0x31')](respondWithResult(_0x37b7e2,0xc9))[_0x38bb('0x54')](handleError(_0x37b7e2,null));};exports[_0x38bb('0x30')]=function(_0x54643e,_0x53e350){if(_0x54643e[_0x38bb('0x53')]['id']){delete _0x54643e['body']['id'];}return db[_0x38bb('0x37')][_0x38bb('0x51')]({'where':{'id':_0x54643e['params']['id']}})['then'](handleEntityNotFound(_0x53e350,null))[_0x38bb('0x31')](saveUpdates(_0x54643e['body'],null))['then'](respondWithResult(_0x53e350,null))[_0x38bb('0x54')](handleError(_0x53e350,null));};exports[_0x38bb('0x32')]=function(_0x28e7a5,_0x2882e7){return db[_0x38bb('0x37')][_0x38bb('0x51')]({'where':{'id':_0x28e7a5['params']['id']}})[_0x38bb('0x31')](handleEntityNotFound(_0x2882e7,null))[_0x38bb('0x31')](removeEntity(_0x2882e7,null))[_0x38bb('0x54')](handleError(_0x2882e7,null));};exports[_0x38bb('0x55')]=function(_0x473333,_0x51094b,_0x4919a8){var _0x5a4048={};var _0x1f7bb7={};var _0x2de842;var _0x5166e8;return db[_0x38bb('0x37')][_0x38bb('0x56')]({'where':{'id':_0x473333['params']['id']}})[_0x38bb('0x31')](handleEntityNotFound(_0x51094b,null))[_0x38bb('0x31')](function(_0x2bb316){if(_0x2bb316){_0x2de842=_0x2bb316;_0x1f7bb7['model']=_[_0x38bb('0x3b')](db[_0x38bb('0x57')][_0x38bb('0x50')]);_0x1f7bb7[_0x38bb('0x3d')]=_[_0x38bb('0x3b')](_0x473333[_0x38bb('0x3d')]);_0x1f7bb7['filters']=_[_0x38bb('0x3e')](_0x1f7bb7[_0x38bb('0x3a')],_0x1f7bb7['query']);_0x5a4048[_0x38bb('0x40')]=_[_0x38bb('0x3e')](_0x1f7bb7[_0x38bb('0x3a')],qs[_0x38bb('0x3f')](_0x473333[_0x38bb('0x3d')]['fields']));_0x5a4048[_0x38bb('0x40')]=_0x5a4048[_0x38bb('0x40')][_0x38bb('0x58')]?_0x5a4048[_0x38bb('0x40')]:_0x1f7bb7[_0x38bb('0x3a')];_0x5a4048[_0x38bb('0x43')]=qs[_0x38bb('0x44')](_0x473333[_0x38bb('0x3d')][_0x38bb('0x44')]);_0x5a4048[_0x38bb('0x45')]=qs[_0x38bb('0x3c')](_['pick'](_0x473333[_0x38bb('0x3d')],_0x1f7bb7['filters']));if(_0x473333[_0x38bb('0x3d')][_0x38bb('0x47')]){_0x5a4048[_0x38bb('0x45')]=_[_0x38bb('0x48')](_0x5a4048['where'],{'$or':_[_0x38bb('0x36')](_0x5a4048[_0x38bb('0x40')],function(_0x379714){var _0x4136da={};_0x4136da[_0x379714]={'$like':'%'+_0x473333[_0x38bb('0x3d')][_0x38bb('0x47')]+'%'};return _0x4136da;})});}_0x5a4048=_[_0x38bb('0x48')]({},_0x5a4048,_0x473333['options']);return _0x2de842[_0x38bb('0x55')](_0x5a4048);}})[_0x38bb('0x31')](function(_0x228c74){if(_0x228c74){_0x5166e8=_0x228c74[_0x38bb('0x58')];if(!_0x473333[_0x38bb('0x3d')][_0x38bb('0x41')](_0x38bb('0x42'))){_0x5a4048['limit']=qs[_0x38bb('0x2b')](_0x473333[_0x38bb('0x3d')][_0x38bb('0x2b')]);_0x5a4048['offset']=qs['offset'](_0x473333[_0x38bb('0x3d')][_0x38bb('0x2a')]);}return _0x2de842[_0x38bb('0x55')](_0x5a4048);}})['then'](function(_0x21a1db){if(_0x21a1db){return _0x21a1db?{'count':_0x5166e8,'rows':_0x21a1db}:null;}})['then'](respondWithResult(_0x51094b,null))[_0x38bb('0x54')](handleError(_0x51094b,null));};exports[_0x38bb('0x59')]=function(_0x3acc84,_0x43b5f3,_0x4d1962){if(_0x3acc84[_0x38bb('0x53')]['id']){delete _0x3acc84[_0x38bb('0x53')]['id'];}return db['SugarcrmAccount'][_0x38bb('0x56')]({'where':{'id':_0x3acc84['params']['id']}})[_0x38bb('0x31')](handleEntityNotFound(_0x43b5f3,null))[_0x38bb('0x31')](function(_0x4f6511){if(_0x4f6511){_0x3acc84[_0x38bb('0x53')][_0x38bb('0x5a')]=_0x4f6511['id'];_0x3acc84['body'][_0x38bb('0x5b')]=integrations[_0x38bb('0x5c')](_0x3acc84['body'][_0x38bb('0x5d')],_0x3acc84[_0x38bb('0x53')][_0x38bb('0x38')]);_0x3acc84['body'][_0x38bb('0x5e')]=integrations[_0x38bb('0x5f')](_0x3acc84['body'][_0x38bb('0x5d')],_0x3acc84[_0x38bb('0x53')]['type']);return db[_0x38bb('0x57')]['create'](_0x3acc84[_0x38bb('0x53')],{'include':[{'model':db[_0x38bb('0x60')],'as':_0x38bb('0x5b')},{'model':db[_0x38bb('0x60')],'as':_0x38bb('0x5e')}]});}return null;})['then'](respondWithResult(_0x43b5f3,null))[_0x38bb('0x54')](handleError(_0x43b5f3,null));};exports['getFields']=function(_0xaf9463,_0x410f5f,_0x450c7f){var _0x37ad03='';var _0x1aa477=['id',_0x38bb('0x34'),_0x38bb('0x61'),'created_by',_0x38bb('0x62'),_0x38bb('0x63'),'duration_hours',_0x38bb('0x64'),_0x38bb('0x65'),_0x38bb('0x66'),_0x38bb('0x67'),_0x38bb('0x68')];return db[_0x38bb('0x37')][_0x38bb('0x56')]({'where':{'id':_0xaf9463[_0x38bb('0x4f')]['id']},'attributes':['id',_0x38bb('0x69'),'password','remoteUri']})['then'](handleEntityNotFound(_0x410f5f,null))[_0x38bb('0x31')](function(_0x17cfdc){if(_0x17cfdc){_0x37ad03=_0x17cfdc[_0x38bb('0x6a')];var _0x512a50=_0x37ad03[_0x38bb('0x6b')](-0x1);if(_0x512a50==='/'){_0x37ad03=_0x37ad03[_0x38bb('0x6c')](0x0,_0x37ad03[_0x38bb('0x6d')](_0x512a50));}return rp({'method':'POST','uri':util['format'](_0x38bb('0x6e'),_0x37ad03,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x38bb('0x6f'),'input_type':_0x38bb('0x70'),'response_type':_0x38bb('0x70'),'rest_data':JSON[_0x38bb('0x71')]({'user_auth':{'user_name':_0x17cfdc[_0x38bb('0x69')],'password':_0x17cfdc['password'],'encryption':_0x38bb('0x72')},'application':_0x38bb('0x73')})}});}})['then'](function(_0x2cd96d){if(_0x2cd96d&&_0x2cd96d[_0x38bb('0x34')]!==_0x38bb('0x74')&&_0x2cd96d[_0x38bb('0x34')]!==_0x38bb('0x75')){return rp({'method':_0x38bb('0x76'),'uri':util[_0x38bb('0x77')](_0x38bb('0x6e'),_0x37ad03,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x38bb('0x78'),'input_type':_0x38bb('0x70'),'response_type':_0x38bb('0x70'),'rest_data':JSON[_0x38bb('0x71')]({'session':_0x2cd96d['id'],'module_name':_0x38bb('0x79')})}})[_0x38bb('0x31')](function(_0x58fde7){if(_0x58fde7){var _0x3a0de2=_[_0x38bb('0x7a')](_0x58fde7[_0x38bb('0x7b')]);_[_0x38bb('0x7c')](_0x3a0de2,function(_0x3a33d8){return _0x1aa477[_0x38bb('0x7d')](_0x3a33d8[_0x38bb('0x34')]);});return{'count':_0x3a0de2[_0x38bb('0x58')],'rows':_[_0x38bb('0x36')](_0x3a0de2,function(_0x1f7094){return{'id':_0x1f7094[_0x38bb('0x34')],'name':_0x1f7094[_0x38bb('0x7e')],'custom':_[_0x38bb('0x7f')](_0x1f7094['name'],'_c')?!![]:![],'options':_0x1f7094[_0x38bb('0x4a')]?_[_0x38bb('0x36')](_[_0x38bb('0x7a')](_0x1f7094[_0x38bb('0x4a')]),function(_0x77939b){return{'name':_0x77939b[_0x38bb('0x80')],'value':_0x77939b[_0x38bb('0x34')]};}):[]};})};}})[_0x38bb('0x31')](respondWithResult(_0x410f5f,null))[_0x38bb('0x54')](function(_0x2dde05){var _0x157354=_0xaf9463['query'][_0x38bb('0x81')]?0x1f4:_0x2dde05[_0x38bb('0x82')]||0x1f4;logger[_0x38bb('0x22')](_0x38bb('0x83'),_0x38bb('0x84'),_0x157354,JSON['stringify'](_0x2dde05));delete _0x2dde05['name'];if(_0x157354===0x191){_0x157354=0x190;}_0x410f5f[_0x38bb('0x28')](_0x157354)[_0x38bb('0x85')](_0xaf9463[_0x38bb('0x3d')]['test']?{'message':_0x38bb('0x86'),'statusCode':_0x2dde05[_0x38bb('0x82')]}:_0x2dde05);});}else{var _0x2666c4=0x1f4;_0x410f5f[_0x38bb('0x28')](_0x2666c4)[_0x38bb('0x85')]({'message':_0x38bb('0x86'),'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 824b5d1..a66a51d 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 _0x31a1=['rimraf','../../config/environment','../../components/integrations/configuration','int_sugarcrm_accounts','api','moment','bluebird','request-promise'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x31a1,0x12c));var _0x131a=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x31a1[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x131a('0x0'));var moment=require(_0x131a('0x1'));var BPromise=require(_0x131a('0x2'));var rp=require(_0x131a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x131a('0x4'));var config=require(_0x131a('0x5'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x131a('0x6'));module['exports']=function(_0xb8e007,_0x25280a){return _0xb8e007['define']('SugarcrmAccount',attributes,{'tableName':_0x131a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a55=['lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts'];(function(_0x4aa838,_0x4aa14f){var _0x3abff0=function(_0x402d55){while(--_0x402d55){_0x4aa838['push'](_0x4aa838['shift']());}};_0x3abff0(++_0x4aa14f);}(_0x4a55,0x82));var _0x54a5=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x4a55[_0x468b0f];return _0x3e74d9;};'use strict';var _=require(_0x54a5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x54a5('0x1'));var moment=require(_0x54a5('0x2'));var BPromise=require(_0x54a5('0x3'));var rp=require(_0x54a5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x54a5('0x5'));var config=require(_0x54a5('0x6'));var attributes=require(_0x54a5('0x7'));var integrations=require(_0x54a5('0x8'));module[_0x54a5('0x9')]=function(_0x29bb13,_0x1ce145){return _0x29bb13[_0x54a5('0xa')](_0x54a5('0xb'),attributes,{'tableName':_0x54a5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 10a17d3..8292940 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 _0x297b=['SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','raw','options','attributes','limit','include','map','model','debug','ShowSugarcrmAccount','find','where','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s'];(function(_0x2939de,_0x3b948c){var _0x36bdc6=function(_0x356f21){while(--_0x356f21){_0x2939de['push'](_0x2939de['shift']());}};_0x36bdc6(++_0x3b948c);}(_0x297b,0xdc));var _0xb297=function(_0x154192,_0x2d360f){_0x154192=_0x154192-0x0;var _0x3c2792=_0x297b[_0x154192];return _0x3c2792;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb297('0x0'));var rs=require(_0xb297('0x1'));var fs=require('fs');var Redis=require(_0xb297('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb297('0x3'));var logger=require(_0xb297('0x4'))(_0xb297('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb297('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d08ed,_0x41e367,_0x20d192){return new BPromise(function(_0x57faa4,_0x40b060){return client[_0xb297('0x7')](_0x3d08ed,_0x20d192)[_0xb297('0x8')](function(_0x19b0c9){logger[_0xb297('0x9')](_0xb297('0xa'),_0x41e367,'request\x20sent');logger['debug'](_0xb297('0xb'),_0x41e367,'request\x20sent',JSON[_0xb297('0xc')](_0x19b0c9));if(_0x19b0c9[_0xb297('0xd')]){if(_0x19b0c9[_0xb297('0xd')][_0xb297('0xe')]===0x1f4){logger[_0xb297('0xd')](_0xb297('0xa'),_0x41e367,_0x19b0c9[_0xb297('0xd')][_0xb297('0xf')]);return _0x40b060(_0x19b0c9[_0xb297('0xd')][_0xb297('0xf')]);}logger[_0xb297('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x41e367,_0x19b0c9[_0xb297('0xd')][_0xb297('0xf')]);return _0x57faa4(_0x19b0c9[_0xb297('0xd')][_0xb297('0xf')]);}else{logger[_0xb297('0x9')](_0xb297('0xa'),_0x41e367,_0xb297('0x10'));_0x57faa4(_0x19b0c9[_0xb297('0x11')]['message']);}})[_0xb297('0x12')](function(_0x173644){logger['error'](_0xb297('0xa'),_0x41e367,_0x173644);_0x40b060(_0x173644);});});}exports[_0xb297('0x13')]=function(_0x3dc898){var _0x576e94=this;return new Promise(function(_0x1690d0,_0x23937b){return db[_0xb297('0x14')][_0xb297('0x15')]({'raw':_0x3dc898['options']?_0x3dc898['options'][_0xb297('0x16')]===undefined?!![]:![]:!![],'where':_0x3dc898['options']?_0x3dc898[_0xb297('0x17')]['where']||null:null,'attributes':_0x3dc898[_0xb297('0x17')]?_0x3dc898[_0xb297('0x17')][_0xb297('0x18')]||null:null,'limit':_0x3dc898[_0xb297('0x17')]?_0x3dc898['options'][_0xb297('0x19')]||null:null,'include':_0x3dc898['options']?_0x3dc898['options'][_0xb297('0x1a')]?_[_0xb297('0x1b')](_0x3dc898[_0xb297('0x17')][_0xb297('0x1a')],function(_0x4cfe1f){return{'model':db[_0x4cfe1f[_0xb297('0x1c')]],'as':_0x4cfe1f['as'],'attributes':_0x4cfe1f[_0xb297('0x18')],'include':_0x4cfe1f[_0xb297('0x1a')]?_['map'](_0x4cfe1f[_0xb297('0x1a')],function(_0x41ad08){return{'model':db[_0x41ad08[_0xb297('0x1c')]],'as':_0x41ad08['as'],'attributes':_0x41ad08[_0xb297('0x18')],'include':_0x41ad08[_0xb297('0x1a')]?_[_0xb297('0x1b')](_0x41ad08['include'],function(_0x3e2e6d){return{'model':db[_0x3e2e6d[_0xb297('0x1c')]],'as':_0x3e2e6d['as'],'attributes':_0x3e2e6d[_0xb297('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb297('0x8')](function(_0x186c3a){logger['info']('GetSugarcrmAccount',_0x3dc898);logger[_0xb297('0x1d')]('GetSugarcrmAccount',_0x3dc898,JSON[_0xb297('0xc')](_0x186c3a));_0x1690d0(_0x186c3a);})[_0xb297('0x12')](function(_0x32febb){logger[_0xb297('0xd')](_0xb297('0x13'),_0x32febb[_0xb297('0xf')],_0x3dc898);_0x23937b(_0x576e94[_0xb297('0xd')](0x1f4,_0x32febb[_0xb297('0xf')]));});});};exports[_0xb297('0x1e')]=function(_0x44605c){var _0x34c6ed=this;return new Promise(function(_0x55d243,_0x436fd5){return db[_0xb297('0x14')][_0xb297('0x1f')]({'raw':_0x44605c['options']?_0x44605c['options'][_0xb297('0x16')]===undefined?!![]:![]:!![],'where':_0x44605c[_0xb297('0x17')]?_0x44605c[_0xb297('0x17')][_0xb297('0x20')]||null:null,'attributes':_0x44605c['options']?_0x44605c[_0xb297('0x17')]['attributes']||null:null,'include':_0x44605c['options']?_0x44605c[_0xb297('0x17')][_0xb297('0x1a')]?_[_0xb297('0x1b')](_0x44605c['options'][_0xb297('0x1a')],function(_0x42afc0){return{'model':db[_0x42afc0[_0xb297('0x1c')]],'as':_0x42afc0['as'],'attributes':_0x42afc0[_0xb297('0x18')],'include':_0x42afc0[_0xb297('0x1a')]?_[_0xb297('0x1b')](_0x42afc0[_0xb297('0x1a')],function(_0x3882cd){return{'model':db[_0x3882cd['model']],'as':_0x3882cd['as'],'attributes':_0x3882cd[_0xb297('0x18')],'include':_0x3882cd['include']?_[_0xb297('0x1b')](_0x3882cd[_0xb297('0x1a')],function(_0x3fe7a7){return{'model':db[_0x3fe7a7[_0xb297('0x1c')]],'as':_0x3fe7a7['as'],'attributes':_0x3fe7a7[_0xb297('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb297('0x8')](function(_0x507afc){logger[_0xb297('0x9')](_0xb297('0x1e'),_0x44605c);logger['debug'](_0xb297('0x1e'),_0x44605c,JSON[_0xb297('0xc')](_0x507afc));_0x55d243(_0x507afc);})['catch'](function(_0x255c3d){logger[_0xb297('0xd')](_0xb297('0x1e'),_0x255c3d[_0xb297('0xf')],_0x44605c);_0x436fd5(_0x34c6ed[_0xb297('0xd')](0x1f4,_0x255c3d[_0xb297('0xf')]));});});}; \ No newline at end of file +var _0xfabb=['request\x20sent','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','raw','options','where','attributes','limit','include','map','model','find','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s'];(function(_0x16a223,_0x31b6e8){var _0x5ded66=function(_0x25eb5f){while(--_0x25eb5f){_0x16a223['push'](_0x16a223['shift']());}};_0x5ded66(++_0x31b6e8);}(_0xfabb,0xf8));var _0xbfab=function(_0x40034b,_0x39fba0){_0x40034b=_0x40034b-0x0;var _0x771f74=_0xfabb[_0x40034b];return _0x771f74;};'use strict';var _=require(_0xbfab('0x0'));var util=require(_0xbfab('0x1'));var moment=require(_0xbfab('0x2'));var BPromise=require(_0xbfab('0x3'));var rs=require(_0xbfab('0x4'));var fs=require('fs');var Redis=require(_0xbfab('0x5'));var db=require(_0xbfab('0x6'))['db'];var utils=require(_0xbfab('0x7'));var logger=require(_0xbfab('0x8'))(_0xbfab('0x9'));var config=require(_0xbfab('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xbfab('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x506836,_0x8be042,_0x4d605d){return new BPromise(function(_0x470a05,_0x1995c4){return client[_0xbfab('0xc')](_0x506836,_0x4d605d)[_0xbfab('0xd')](function(_0x4c1866){logger[_0xbfab('0xe')](_0xbfab('0xf'),_0x8be042,'request\x20sent');logger[_0xbfab('0x10')](_0xbfab('0x11'),_0x8be042,_0xbfab('0x12'),JSON[_0xbfab('0x13')](_0x4c1866));if(_0x4c1866[_0xbfab('0x14')]){if(_0x4c1866[_0xbfab('0x14')][_0xbfab('0x15')]===0x1f4){logger[_0xbfab('0x14')](_0xbfab('0xf'),_0x8be042,_0x4c1866[_0xbfab('0x14')][_0xbfab('0x16')]);return _0x1995c4(_0x4c1866[_0xbfab('0x14')][_0xbfab('0x16')]);}logger[_0xbfab('0x14')]('SugarcrmAccount,\x20%s,\x20%s',_0x8be042,_0x4c1866[_0xbfab('0x14')]['message']);return _0x470a05(_0x4c1866[_0xbfab('0x14')][_0xbfab('0x16')]);}else{logger[_0xbfab('0xe')](_0xbfab('0xf'),_0x8be042,_0xbfab('0x12'));_0x470a05(_0x4c1866[_0xbfab('0x17')]['message']);}})[_0xbfab('0x18')](function(_0x42e4a6){logger[_0xbfab('0x14')](_0xbfab('0xf'),_0x8be042,_0x42e4a6);_0x1995c4(_0x42e4a6);});});}exports[_0xbfab('0x19')]=function(_0x433034){var _0x269bdb=this;return new Promise(function(_0x32a8ca,_0x4712d6){return db[_0xbfab('0x1a')][_0xbfab('0x1b')]({'raw':_0x433034['options']?_0x433034['options'][_0xbfab('0x1c')]===undefined?!![]:![]:!![],'where':_0x433034[_0xbfab('0x1d')]?_0x433034[_0xbfab('0x1d')][_0xbfab('0x1e')]||null:null,'attributes':_0x433034[_0xbfab('0x1d')]?_0x433034['options'][_0xbfab('0x1f')]||null:null,'limit':_0x433034[_0xbfab('0x1d')]?_0x433034['options'][_0xbfab('0x20')]||null:null,'include':_0x433034['options']?_0x433034[_0xbfab('0x1d')][_0xbfab('0x21')]?_['map'](_0x433034[_0xbfab('0x1d')]['include'],function(_0x2bb545){return{'model':db[_0x2bb545['model']],'as':_0x2bb545['as'],'attributes':_0x2bb545['attributes'],'include':_0x2bb545['include']?_[_0xbfab('0x22')](_0x2bb545[_0xbfab('0x21')],function(_0x1ea5bf){return{'model':db[_0x1ea5bf['model']],'as':_0x1ea5bf['as'],'attributes':_0x1ea5bf[_0xbfab('0x1f')],'include':_0x1ea5bf[_0xbfab('0x21')]?_[_0xbfab('0x22')](_0x1ea5bf[_0xbfab('0x21')],function(_0x11ceeb){return{'model':db[_0x11ceeb[_0xbfab('0x23')]],'as':_0x11ceeb['as'],'attributes':_0x11ceeb[_0xbfab('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4de655){logger[_0xbfab('0xe')](_0xbfab('0x19'),_0x433034);logger['debug'](_0xbfab('0x19'),_0x433034,JSON[_0xbfab('0x13')](_0x4de655));_0x32a8ca(_0x4de655);})[_0xbfab('0x18')](function(_0x4885f4){logger[_0xbfab('0x14')](_0xbfab('0x19'),_0x4885f4[_0xbfab('0x16')],_0x433034);_0x4712d6(_0x269bdb[_0xbfab('0x14')](0x1f4,_0x4885f4[_0xbfab('0x16')]));});});};exports['ShowSugarcrmAccount']=function(_0x1174ee){var _0x43ed69=this;return new Promise(function(_0x3b46cd,_0x258da2){return db['SugarcrmAccount'][_0xbfab('0x24')]({'raw':_0x1174ee[_0xbfab('0x1d')]?_0x1174ee['options'][_0xbfab('0x1c')]===undefined?!![]:![]:!![],'where':_0x1174ee['options']?_0x1174ee['options']['where']||null:null,'attributes':_0x1174ee['options']?_0x1174ee['options'][_0xbfab('0x1f')]||null:null,'include':_0x1174ee[_0xbfab('0x1d')]?_0x1174ee[_0xbfab('0x1d')][_0xbfab('0x21')]?_[_0xbfab('0x22')](_0x1174ee[_0xbfab('0x1d')][_0xbfab('0x21')],function(_0x414e50){return{'model':db[_0x414e50[_0xbfab('0x23')]],'as':_0x414e50['as'],'attributes':_0x414e50[_0xbfab('0x1f')],'include':_0x414e50[_0xbfab('0x21')]?_['map'](_0x414e50[_0xbfab('0x21')],function(_0x5cd4ef){return{'model':db[_0x5cd4ef[_0xbfab('0x23')]],'as':_0x5cd4ef['as'],'attributes':_0x5cd4ef[_0xbfab('0x1f')],'include':_0x5cd4ef[_0xbfab('0x21')]?_[_0xbfab('0x22')](_0x5cd4ef[_0xbfab('0x21')],function(_0x445abb){return{'model':db[_0x445abb[_0xbfab('0x23')]],'as':_0x445abb['as'],'attributes':_0x445abb[_0xbfab('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5814a5){logger['info']('ShowSugarcrmAccount',_0x1174ee);logger['debug']('ShowSugarcrmAccount',_0x1174ee,JSON[_0xbfab('0x13')](_0x5814a5));_0x3b46cd(_0x5814a5);})[_0xbfab('0x18')](function(_0x2bcef5){logger[_0xbfab('0x14')](_0xbfab('0x25'),_0x2bcef5[_0xbfab('0x16')],_0x1174ee);_0x258da2(_0x43ed69['error'](0x1f4,_0x2bcef5[_0xbfab('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index cf3d2e4..472e2a6 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 _0xa635=['../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id/fields','/:id/subjects','getSubjects','getDescriptions','create','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x22eaa7,_0x240c84){var _0x57e131=function(_0x215253){while(--_0x215253){_0x22eaa7['push'](_0x22eaa7['shift']());}};_0x57e131(++_0x240c84);}(_0xa635,0x1f1));var _0x5a63=function(_0xa2569a,_0x4437fe){_0xa2569a=_0xa2569a-0x0;var _0xa04d1d=_0xa635[_0xa2569a];return _0xa04d1d;};'use strict';var multer=require(_0x5a63('0x0'));var util=require(_0x5a63('0x1'));var path=require(_0x5a63('0x2'));var timeout=require(_0x5a63('0x3'));var express=require(_0x5a63('0x4'));var router=express[_0x5a63('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x5a63('0x6'));var config=require(_0x5a63('0x7'));var controller=require(_0x5a63('0x8'));router['get']('/',auth[_0x5a63('0x9')](),controller[_0x5a63('0xa')]);router[_0x5a63('0xb')]('/:id',auth[_0x5a63('0x9')](),controller['show']);router['get'](_0x5a63('0xc'),auth[_0x5a63('0x9')](),controller['getFields']);router[_0x5a63('0xb')](_0x5a63('0xd'),auth['isAuthenticated'](),controller[_0x5a63('0xe')]);router[_0x5a63('0xb')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x5a63('0xf')]);router['post']('/',auth[_0x5a63('0x9')](),controller[_0x5a63('0x10')]);router['put']('/:id',auth[_0x5a63('0x9')](),controller[_0x5a63('0x11')]);router[_0x5a63('0x12')](_0x5a63('0x13'),auth[_0x5a63('0x9')](),controller['destroy']);module[_0x5a63('0x14')]=router; \ No newline at end of file +var _0x476f=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','show','getDescriptions','post','create','/:id'];(function(_0x1d128e,_0x2c87de){var _0x3d5236=function(_0x2374ff){while(--_0x2374ff){_0x1d128e['push'](_0x1d128e['shift']());}};_0x3d5236(++_0x2c87de);}(_0x476f,0xf4));var _0xf476=function(_0x1c3144,_0x128a0e){_0x1c3144=_0x1c3144-0x0;var _0x44b427=_0x476f[_0x1c3144];return _0x44b427;};'use strict';var multer=require(_0xf476('0x0'));var util=require(_0xf476('0x1'));var path=require(_0xf476('0x2'));var timeout=require(_0xf476('0x3'));var express=require(_0xf476('0x4'));var router=express['Router']();var auth=require(_0xf476('0x5'));var interaction=require(_0xf476('0x6'));var config=require(_0xf476('0x7'));var controller=require(_0xf476('0x8'));router[_0xf476('0x9')]('/',auth[_0xf476('0xa')](),controller['index']);router[_0xf476('0x9')]('/:id',auth[_0xf476('0xa')](),controller[_0xf476('0xb')]);router[_0xf476('0x9')]('/:id/fields',auth[_0xf476('0xa')](),controller['getFields']);router[_0xf476('0x9')]('/:id/subjects',auth[_0xf476('0xa')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0xf476('0xa')](),controller[_0xf476('0xc')]);router[_0xf476('0xd')]('/',auth['isAuthenticated'](),controller[_0xf476('0xe')]);router['put'](_0xf476('0xf'),auth[_0xf476('0xa')](),controller[_0xf476('0x10')]);router[_0xf476('0x11')](_0xf476('0xf'),auth['isAuthenticated'](),controller[_0xf476('0x12')]);module[_0xf476('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index d06669d..b0663c9 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 _0xda81=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda81,0x136));var _0x1da8=function(_0x16b61a,_0x3f79c8){_0x16b61a=_0x16b61a-0x0;var _0x1fb42a=_0xda81[_0x16b61a];return _0x1fb42a;};'use strict';var Sequelize=require(_0x1da8('0x0'));module[_0x1da8('0x1')]={'name':{'type':Sequelize[_0x1da8('0x2')]},'description':{'type':Sequelize[_0x1da8('0x2')]}}; \ No newline at end of file +var _0xc07a=['sequelize','exports','STRING'];(function(_0xa1029b,_0x1c71cb){var _0x289efd=function(_0xc28f1d){while(--_0xc28f1d){_0xa1029b['push'](_0xa1029b['shift']());}};_0x289efd(++_0x1c71cb);}(_0xc07a,0x8d));var _0xac07=function(_0x13bcd1,_0x4b02b3){_0x13bcd1=_0x13bcd1-0x0;var _0x5519cb=_0xc07a[_0x13bcd1];return _0x5519cb;};'use strict';var Sequelize=require(_0xac07('0x0'));module[_0xac07('0x1')]={'name':{'type':Sequelize[_0xac07('0x2')]},'description':{'type':Sequelize[_0xac07('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index f232e2e..5108937 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 _0x5224=['find','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','test','Sequelize','ValidationError','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','count','offset','limit','set','Content-Range','json','apply','reject','save','then','end','sendStatus','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','intersection','create','body','update'];(function(_0x4bc876,_0x13fc0b){var _0x86ebcb=function(_0x35e651){while(--_0x35e651){_0x4bc876['push'](_0x4bc876['shift']());}};_0x86ebcb(++_0x13fc0b);}(_0x5224,0x66));var _0x4522=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x5224[_0x37bd26];return _0xe83dc4;};'use strict';var pdf=require(_0x4522('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4522('0x1'));var zipdir=require(_0x4522('0x2'));var jsonpatch=require(_0x4522('0x3'));var rp=require(_0x4522('0x4'));var moment=require(_0x4522('0x5'));var BPromise=require(_0x4522('0x6'));var Mustache=require(_0x4522('0x7'));var util=require(_0x4522('0x8'));var path=require(_0x4522('0x9'));var sox=require(_0x4522('0xa'));var csv=require('to-csv');var ejs=require(_0x4522('0xb'));var fs=require('fs');var _=require(_0x4522('0xc'));var squel=require('squel');var crypto=require(_0x4522('0xd'));var jsforce=require(_0x4522('0xe'));var deskjs=require(_0x4522('0xf'));var toCsv=require(_0x4522('0x10'));var querystring=require('querystring');var Papa=require(_0x4522('0x11'));var Redis=require(_0x4522('0x12'));var authService=require(_0x4522('0x13'));var qs=require(_0x4522('0x14'));var as=require(_0x4522('0x15'));var hardwareService=require(_0x4522('0x16'));var logger=require(_0x4522('0x17'))(_0x4522('0x18'));var utils=require(_0x4522('0x19'));var config=require(_0x4522('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0x4522('0x1b'));var client=jayson[_0x4522('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x1487b8,_0x339c0a,_0x1eb4bd){if(_0x1eb4bd){var _0x252f2f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x252f2f[_0x4522('0x1d')](_0x339c0a)){return _0x1487b8;}else{throw new db[(_0x4522('0x1e'))][(_0x4522('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 _0x1487b8;}}function respondWithRpcPromise(_0x38200a,_0x583b95,_0x39f1b3,_0x4220ca){return new BPromise(function(_0x11b6e6,_0x1e9219){var _0x2956cc=_0x4220ca||client;return _0x2956cc['request'](_0x38200a,_0x39f1b3)['then'](function(_0x1c6059){logger[_0x4522('0x20')](_0x4522('0x21'),_0x583b95,_0x4522('0x22'));logger['debug'](_0x4522('0x23'),_0x583b95,_0x4522('0x22'),JSON[_0x4522('0x24')](_0x1c6059));if(_0x1c6059[_0x4522('0x25')]){if(_0x1c6059['error'][_0x4522('0x26')]===0x1f4){logger[_0x4522('0x25')](_0x4522('0x21'),_0x583b95,_0x1c6059[_0x4522('0x25')][_0x4522('0x27')]);return _0x1e9219(_0x1c6059[_0x4522('0x25')][_0x4522('0x27')]);}logger[_0x4522('0x25')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x583b95,_0x1c6059[_0x4522('0x25')][_0x4522('0x27')]);return _0x11b6e6(_0x1c6059[_0x4522('0x25')][_0x4522('0x27')]);}else{logger['info'](_0x4522('0x21'),_0x583b95,'request\x20sent');_0x11b6e6(_0x1c6059['result'][_0x4522('0x27')]);}})[_0x4522('0x28')](function(_0x49469f){logger[_0x4522('0x25')](_0x4522('0x21'),_0x583b95,_0x49469f);_0x1e9219(_0x49469f);});});}function respondWithStatusCode(_0x352c1a,_0x13c04f){_0x13c04f=_0x13c04f||0xcc;return function(_0x2093bc){if(_0x2093bc){return _0x352c1a['sendStatus'](_0x13c04f);}return _0x352c1a[_0x4522('0x29')](_0x13c04f)['end']();};}function respondWithResult(_0x49ccaa,_0x2e3aca){_0x2e3aca=_0x2e3aca||0xc8;return function(_0x2f5e01){if(_0x2f5e01){return _0x49ccaa['status'](_0x2e3aca)['json'](_0x2f5e01);}};}function respondWithFilteredResult(_0x526e46,_0x23427a){return function(_0x3e011e){if(_0x3e011e){var _0x1ad8e0=_0x3e011e[_0x4522('0x2a')],_0x5778c7=_0x23427a['offset'],_0x353e42=_0x23427a[_0x4522('0x2b')]+_0x23427a[_0x4522('0x2c')],_0x8af9eb;if(_0x353e42>=_0x1ad8e0){_0x353e42=_0x1ad8e0;_0x8af9eb=0xc8;}else{_0x8af9eb=0xce;}_0x526e46[_0x4522('0x29')](_0x8af9eb);return _0x526e46[_0x4522('0x2d')](_0x4522('0x2e'),_0x5778c7+'-'+_0x353e42+'/'+_0x1ad8e0)[_0x4522('0x2f')](_0x3e011e);}return null;};}function patchUpdates(_0x35bf37){return function(_0x3138a4){try{jsonpatch[_0x4522('0x30')](_0x3138a4,_0x35bf37,!![]);}catch(_0x5b4e10){return BPromise[_0x4522('0x31')](_0x5b4e10);}return _0x3138a4[_0x4522('0x32')]();};}function saveUpdates(_0x3f7fd3,_0x250117){return function(_0x277d6b){if(_0x277d6b){return _0x277d6b['update'](_0x3f7fd3)[_0x4522('0x33')](function(_0x5a91d4){return _0x5a91d4;});}return null;};}function removeEntity(_0x26b17a,_0x13cf38){return function(_0x37aadc){if(_0x37aadc){return _0x37aadc['destroy']()['then'](function(){_0x26b17a[_0x4522('0x29')](0xcc)[_0x4522('0x34')]();});}};}function handleEntityNotFound(_0x476d64,_0xf8f4de){return function(_0x352a6f){if(!_0x352a6f){_0x476d64[_0x4522('0x35')](0x194);}return _0x352a6f;};}function handleError(_0x2d50d3,_0xb2fba6){_0xb2fba6=_0xb2fba6||0x1f4;return function(_0xed853a){logger['error'](_0xed853a[_0x4522('0x36')]);if(_0xed853a['name']){delete _0xed853a[_0x4522('0x37')];}_0x2d50d3[_0x4522('0x29')](_0xb2fba6)[_0x4522('0x38')](_0xed853a);};}exports[_0x4522('0x39')]=function(_0x4f3daf,_0x2c9d5f){var _0x44ce93={},_0x43b37a={},_0x1aa179={'count':0x0,'rows':[]};var _0x401fe5=_[_0x4522('0x3a')](db[_0x4522('0x3b')][_0x4522('0x3c')],function(_0x258621){return{'name':_0x258621[_0x4522('0x3d')],'type':_0x258621[_0x4522('0x3e')][_0x4522('0x3f')]};});_0x43b37a[_0x4522('0x40')]=_[_0x4522('0x3a')](_0x401fe5,_0x4522('0x37'));_0x43b37a[_0x4522('0x41')]=_['keys'](_0x4f3daf[_0x4522('0x41')]);_0x43b37a[_0x4522('0x42')]=_['intersection'](_0x43b37a['model'],_0x43b37a[_0x4522('0x41')]);_0x44ce93['attributes']=_['intersection'](_0x43b37a[_0x4522('0x40')],qs[_0x4522('0x43')](_0x4f3daf['query'][_0x4522('0x43')]));_0x44ce93[_0x4522('0x44')]=_0x44ce93[_0x4522('0x44')][_0x4522('0x45')]?_0x44ce93[_0x4522('0x44')]:_0x43b37a['model'];if(!_0x4f3daf[_0x4522('0x41')][_0x4522('0x46')](_0x4522('0x47'))){_0x44ce93[_0x4522('0x2c')]=qs[_0x4522('0x2c')](_0x4f3daf['query'][_0x4522('0x2c')]);_0x44ce93['offset']=qs['offset'](_0x4f3daf[_0x4522('0x41')]['offset']);}_0x44ce93[_0x4522('0x48')]=qs[_0x4522('0x49')](_0x4f3daf['query'][_0x4522('0x49')]);_0x44ce93[_0x4522('0x4a')]=qs[_0x4522('0x42')](_[_0x4522('0x4b')](_0x4f3daf['query'],_0x43b37a[_0x4522('0x42')]));if(_0x4f3daf['query'][_0x4522('0x4c')]){_0x44ce93[_0x4522('0x4a')]=_[_0x4522('0x4d')](_0x44ce93[_0x4522('0x4a')],{'$or':_[_0x4522('0x3a')](_0x401fe5,function(_0x44b7b4){if(_0x44b7b4['type']!=='VIRTUAL'){var _0x526085={};_0x526085[_0x44b7b4[_0x4522('0x37')]]={'$like':'%'+_0x4f3daf[_0x4522('0x41')]['filter']+'%'};return _0x526085;}})});}_0x44ce93=_['merge']({},_0x44ce93,_0x4f3daf[_0x4522('0x4e')]);var _0x2c85c2={'where':_0x44ce93[_0x4522('0x4a')]};return db[_0x4522('0x3b')]['count'](_0x2c85c2)[_0x4522('0x33')](function(_0x10a3f8){_0x1aa179[_0x4522('0x2a')]=_0x10a3f8;if(_0x4f3daf[_0x4522('0x41')][_0x4522('0x4f')]){_0x44ce93[_0x4522('0x50')]=[{'all':!![]}];}return db[_0x4522('0x3b')][_0x4522('0x51')](_0x44ce93);})[_0x4522('0x33')](function(_0x3d2366){_0x1aa179[_0x4522('0x52')]=_0x3d2366;return _0x1aa179;})[_0x4522('0x33')](respondWithFilteredResult(_0x2c9d5f,_0x44ce93))[_0x4522('0x28')](handleError(_0x2c9d5f,null));};exports[_0x4522('0x53')]=function(_0x394689,_0x5ae110){var _0x45d9f4={'raw':![],'where':{'id':_0x394689[_0x4522('0x54')]['id']}},_0x18dab0={};_0x18dab0['model']=_[_0x4522('0x55')](db['SugarcrmConfiguration'][_0x4522('0x3c')]);_0x18dab0['query']=_['keys'](_0x394689[_0x4522('0x41')]);_0x18dab0[_0x4522('0x42')]=_['intersection'](_0x18dab0[_0x4522('0x40')],_0x18dab0[_0x4522('0x41')]);_0x45d9f4[_0x4522('0x44')]=_[_0x4522('0x56')](_0x18dab0[_0x4522('0x40')],qs[_0x4522('0x43')](_0x394689[_0x4522('0x41')][_0x4522('0x43')]));_0x45d9f4[_0x4522('0x44')]=_0x45d9f4['attributes'][_0x4522('0x45')]?_0x45d9f4[_0x4522('0x44')]:_0x18dab0['model'];if(_0x394689[_0x4522('0x41')][_0x4522('0x4f')]){_0x45d9f4[_0x4522('0x50')]=[{'all':!![]}];}_0x45d9f4=_[_0x4522('0x4d')]({},_0x45d9f4,_0x394689[_0x4522('0x4e')]);return db[_0x4522('0x3b')]['find'](_0x45d9f4)[_0x4522('0x33')](handleEntityNotFound(_0x5ae110,null))[_0x4522('0x33')](respondWithResult(_0x5ae110,null))['catch'](handleError(_0x5ae110,null));};exports[_0x4522('0x57')]=function(_0xf58c3a,_0x63fa79){return db[_0x4522('0x3b')]['create'](_0xf58c3a[_0x4522('0x58')],{})[_0x4522('0x33')](respondWithResult(_0x63fa79,0xc9))['catch'](handleError(_0x63fa79,null));};exports[_0x4522('0x59')]=function(_0x5909bb,_0x4978d1){if(_0x5909bb[_0x4522('0x58')]['id']){delete _0x5909bb[_0x4522('0x58')]['id'];}return db[_0x4522('0x3b')]['find']({'where':{'id':_0x5909bb['params']['id']}})['then'](handleEntityNotFound(_0x4978d1,null))[_0x4522('0x33')](saveUpdates(_0x5909bb[_0x4522('0x58')],null))[_0x4522('0x33')](respondWithResult(_0x4978d1,null))[_0x4522('0x28')](handleError(_0x4978d1,null));};exports['destroy']=function(_0x1b0275,_0x4b3a37){return db[_0x4522('0x3b')][_0x4522('0x5a')]({'where':{'id':_0x1b0275[_0x4522('0x54')]['id']}})['then'](handleEntityNotFound(_0x4b3a37,null))[_0x4522('0x33')](removeEntity(_0x4b3a37,null))[_0x4522('0x28')](handleError(_0x4b3a37,null));};exports[_0x4522('0x5b')]=function(_0x528fab,_0x462ef9,_0x4243ee){var _0x2c953c={};var _0x17ae16={};var _0x240113;var _0x361f16;return db[_0x4522('0x3b')][_0x4522('0x5c')]({'where':{'id':_0x528fab['params']['id']}})['then'](handleEntityNotFound(_0x462ef9,null))[_0x4522('0x33')](function(_0x3634b2){if(_0x3634b2){_0x240113=_0x3634b2;_0x17ae16['model']=_[_0x4522('0x55')](db[_0x4522('0x5d')][_0x4522('0x3c')]);_0x17ae16['query']=_['keys'](_0x528fab[_0x4522('0x41')]);_0x17ae16['filters']=_[_0x4522('0x56')](_0x17ae16[_0x4522('0x40')],_0x17ae16[_0x4522('0x41')]);_0x2c953c[_0x4522('0x44')]=_[_0x4522('0x56')](_0x17ae16['model'],qs[_0x4522('0x43')](_0x528fab[_0x4522('0x41')][_0x4522('0x43')]));_0x2c953c[_0x4522('0x44')]=_0x2c953c[_0x4522('0x44')]['length']?_0x2c953c[_0x4522('0x44')]:_0x17ae16[_0x4522('0x40')];_0x2c953c[_0x4522('0x48')]=qs[_0x4522('0x49')](_0x528fab['query']['sort']);_0x2c953c['where']=qs[_0x4522('0x42')](_['pick'](_0x528fab[_0x4522('0x41')],_0x17ae16[_0x4522('0x42')]));if(_0x528fab[_0x4522('0x41')][_0x4522('0x4c')]){_0x2c953c[_0x4522('0x4a')]=_[_0x4522('0x4d')](_0x2c953c[_0x4522('0x4a')],{'$or':_['map'](_0x2c953c[_0x4522('0x44')],function(_0x3c0e68){var _0x4ba336={};_0x4ba336[_0x3c0e68]={'$like':'%'+_0x528fab[_0x4522('0x41')][_0x4522('0x4c')]+'%'};return _0x4ba336;})});}_0x2c953c=_[_0x4522('0x4d')]({},_0x2c953c,_0x528fab[_0x4522('0x4e')]);return _0x240113[_0x4522('0x5b')](_0x2c953c);}})[_0x4522('0x33')](function(_0x58d4e5){if(_0x58d4e5){_0x361f16=_0x58d4e5[_0x4522('0x45')];if(!_0x528fab[_0x4522('0x41')][_0x4522('0x46')](_0x4522('0x47'))){_0x2c953c[_0x4522('0x2c')]=qs[_0x4522('0x2c')](_0x528fab['query'][_0x4522('0x2c')]);_0x2c953c['offset']=qs['offset'](_0x528fab['query'][_0x4522('0x2b')]);}return _0x240113['getFields'](_0x2c953c);}})[_0x4522('0x33')](function(_0x130573){if(_0x130573){return _0x130573?{'count':_0x361f16,'rows':_0x130573}:null;}})[_0x4522('0x33')](respondWithResult(_0x462ef9,null))[_0x4522('0x28')](handleError(_0x462ef9,null));};exports[_0x4522('0x5e')]=function(_0x4ef69e,_0x82a240,_0x46776b){var _0x49a310={};var _0x48ad24={};var _0x50c349;var _0x5a77b8;return db[_0x4522('0x3b')][_0x4522('0x5c')]({'where':{'id':_0x4ef69e[_0x4522('0x54')]['id']}})[_0x4522('0x33')](handleEntityNotFound(_0x82a240,null))['then'](function(_0x4c311f){if(_0x4c311f){_0x50c349=_0x4c311f;_0x48ad24['model']=_[_0x4522('0x55')](db[_0x4522('0x5d')][_0x4522('0x3c')]);_0x48ad24[_0x4522('0x41')]=_[_0x4522('0x55')](_0x4ef69e[_0x4522('0x41')]);_0x48ad24['filters']=_[_0x4522('0x56')](_0x48ad24[_0x4522('0x40')],_0x48ad24[_0x4522('0x41')]);_0x49a310[_0x4522('0x44')]=_[_0x4522('0x56')](_0x48ad24[_0x4522('0x40')],qs[_0x4522('0x43')](_0x4ef69e['query'][_0x4522('0x43')]));_0x49a310[_0x4522('0x44')]=_0x49a310[_0x4522('0x44')][_0x4522('0x45')]?_0x49a310['attributes']:_0x48ad24[_0x4522('0x40')];_0x49a310[_0x4522('0x48')]=qs[_0x4522('0x49')](_0x4ef69e['query'][_0x4522('0x49')]);_0x49a310[_0x4522('0x4a')]=qs[_0x4522('0x42')](_[_0x4522('0x4b')](_0x4ef69e['query'],_0x48ad24[_0x4522('0x42')]));if(_0x4ef69e[_0x4522('0x41')][_0x4522('0x4c')]){_0x49a310[_0x4522('0x4a')]=_[_0x4522('0x4d')](_0x49a310[_0x4522('0x4a')],{'$or':_[_0x4522('0x3a')](_0x49a310[_0x4522('0x44')],function(_0x4820cf){var _0x25b400={};_0x25b400[_0x4820cf]={'$like':'%'+_0x4ef69e['query'][_0x4522('0x4c')]+'%'};return _0x25b400;})});}_0x49a310=_[_0x4522('0x4d')]({},_0x49a310,_0x4ef69e[_0x4522('0x4e')]);return _0x50c349['getSubjects'](_0x49a310);}})[_0x4522('0x33')](function(_0x1d962d){if(_0x1d962d){_0x5a77b8=_0x1d962d[_0x4522('0x45')];if(!_0x4ef69e[_0x4522('0x41')][_0x4522('0x46')](_0x4522('0x47'))){_0x49a310['limit']=qs[_0x4522('0x2c')](_0x4ef69e[_0x4522('0x41')][_0x4522('0x2c')]);_0x49a310['offset']=qs[_0x4522('0x2b')](_0x4ef69e['query']['offset']);}return _0x50c349[_0x4522('0x5e')](_0x49a310);}})[_0x4522('0x33')](function(_0xa50c46){if(_0xa50c46){return _0xa50c46?{'count':_0x5a77b8,'rows':_0xa50c46}:null;}})['then'](respondWithResult(_0x82a240,null))['catch'](handleError(_0x82a240,null));};exports[_0x4522('0x5f')]=function(_0x24b03e,_0x2b0bc7,_0x13b7ed){var _0x147126={};var _0x517b5b={};var _0x138e04;var _0x383d05;return db['SugarcrmConfiguration'][_0x4522('0x5c')]({'where':{'id':_0x24b03e[_0x4522('0x54')]['id']}})[_0x4522('0x33')](handleEntityNotFound(_0x2b0bc7,null))[_0x4522('0x33')](function(_0xf29c15){if(_0xf29c15){_0x138e04=_0xf29c15;_0x517b5b[_0x4522('0x40')]=_[_0x4522('0x55')](db[_0x4522('0x5d')]['rawAttributes']);_0x517b5b[_0x4522('0x41')]=_[_0x4522('0x55')](_0x24b03e['query']);_0x517b5b[_0x4522('0x42')]=_[_0x4522('0x56')](_0x517b5b[_0x4522('0x40')],_0x517b5b[_0x4522('0x41')]);_0x147126[_0x4522('0x44')]=_[_0x4522('0x56')](_0x517b5b[_0x4522('0x40')],qs['fields'](_0x24b03e[_0x4522('0x41')][_0x4522('0x43')]));_0x147126[_0x4522('0x44')]=_0x147126['attributes'][_0x4522('0x45')]?_0x147126['attributes']:_0x517b5b[_0x4522('0x40')];_0x147126['order']=qs[_0x4522('0x49')](_0x24b03e[_0x4522('0x41')][_0x4522('0x49')]);_0x147126['where']=qs[_0x4522('0x42')](_[_0x4522('0x4b')](_0x24b03e[_0x4522('0x41')],_0x517b5b['filters']));if(_0x24b03e[_0x4522('0x41')][_0x4522('0x4c')]){_0x147126[_0x4522('0x4a')]=_[_0x4522('0x4d')](_0x147126[_0x4522('0x4a')],{'$or':_[_0x4522('0x3a')](_0x147126[_0x4522('0x44')],function(_0x5aa03c){var _0x34ecaf={};_0x34ecaf[_0x5aa03c]={'$like':'%'+_0x24b03e['query'][_0x4522('0x4c')]+'%'};return _0x34ecaf;})});}_0x147126=_[_0x4522('0x4d')]({},_0x147126,_0x24b03e[_0x4522('0x4e')]);return _0x138e04[_0x4522('0x5f')](_0x147126);}})[_0x4522('0x33')](function(_0x5063d7){if(_0x5063d7){_0x383d05=_0x5063d7['length'];if(!_0x24b03e[_0x4522('0x41')][_0x4522('0x46')](_0x4522('0x47'))){_0x147126[_0x4522('0x2c')]=qs[_0x4522('0x2c')](_0x24b03e[_0x4522('0x41')][_0x4522('0x2c')]);_0x147126['offset']=qs[_0x4522('0x2b')](_0x24b03e[_0x4522('0x41')][_0x4522('0x2b')]);}return _0x138e04['getDescriptions'](_0x147126);}})[_0x4522('0x33')](function(_0x2f3cf9){if(_0x2f3cf9){return _0x2f3cf9?{'count':_0x383d05,'rows':_0x2f3cf9}:null;}})[_0x4522('0x33')](respondWithResult(_0x2b0bc7,null))[_0x4522('0x28')](handleError(_0x2b0bc7,null));}; \ No newline at end of file +var _0xbf60=['code','SugarcrmConfiguration,\x20%s,\x20%s','message','request\x20sent','result','status','end','count','offset','limit','Content-Range','json','reject','update','destroy','sendStatus','name','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','create','body','getFields','findOne','pick','SugarcrmField','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','ejs','lodash','squel','to-csv','papaparse','../../components/auth/service','../../config/logger','api','../../config/environment','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','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x201e1b,_0x1ddea6){var _0x256eb0=function(_0x573f93){while(--_0x573f93){_0x201e1b['push'](_0x201e1b['shift']());}};_0x256eb0(++_0x1ddea6);}(_0xbf60,0x182));var _0x0bf6=function(_0x55e839,_0x3b5345){_0x55e839=_0x55e839-0x0;var _0x39c61a=_0xbf60[_0x55e839];return _0x39c61a;};'use strict';var pdf=require(_0x0bf6('0x0'));var emlformat=require(_0x0bf6('0x1'));var rimraf=require(_0x0bf6('0x2'));var zipdir=require(_0x0bf6('0x3'));var jsonpatch=require(_0x0bf6('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0bf6('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0bf6('0x6'));var sox=require(_0x0bf6('0x7'));var csv=require('to-csv');var ejs=require(_0x0bf6('0x8'));var fs=require('fs');var _=require(_0x0bf6('0x9'));var squel=require(_0x0bf6('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0bf6('0xb'));var querystring=require('querystring');var Papa=require(_0x0bf6('0xc'));var Redis=require('ioredis');var authService=require(_0x0bf6('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0bf6('0xe'))(_0x0bf6('0xf'));var utils=require('../../config/utils');var config=require(_0x0bf6('0x10'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x0bf6('0x11')][_0x0bf6('0x12')]({'port':0x232a});function checkPasswordPattern(_0x516be5,_0x5cd019,_0x2314b2){if(_0x2314b2){var _0xcaa13a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xcaa13a[_0x0bf6('0x13')](_0x5cd019)){return _0x516be5;}else{throw new db['Sequelize'][(_0x0bf6('0x14'))](_0x0bf6('0x15'));}}else{return _0x516be5;}}function respondWithRpcPromise(_0x1bb253,_0x194cee,_0x3f3880,_0x50fd7a){return new BPromise(function(_0x3e33f2,_0x5cf1e9){var _0x41a1ce=_0x50fd7a||client;return _0x41a1ce[_0x0bf6('0x16')](_0x1bb253,_0x3f3880)[_0x0bf6('0x17')](function(_0x232fec){logger[_0x0bf6('0x18')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x194cee,'request\x20sent');logger[_0x0bf6('0x19')](_0x0bf6('0x1a'),_0x194cee,'request\x20sent',JSON[_0x0bf6('0x1b')](_0x232fec));if(_0x232fec[_0x0bf6('0x1c')]){if(_0x232fec[_0x0bf6('0x1c')][_0x0bf6('0x1d')]===0x1f4){logger[_0x0bf6('0x1c')](_0x0bf6('0x1e'),_0x194cee,_0x232fec[_0x0bf6('0x1c')][_0x0bf6('0x1f')]);return _0x5cf1e9(_0x232fec[_0x0bf6('0x1c')][_0x0bf6('0x1f')]);}logger[_0x0bf6('0x1c')](_0x0bf6('0x1e'),_0x194cee,_0x232fec[_0x0bf6('0x1c')][_0x0bf6('0x1f')]);return _0x3e33f2(_0x232fec['error'][_0x0bf6('0x1f')]);}else{logger[_0x0bf6('0x18')](_0x0bf6('0x1e'),_0x194cee,_0x0bf6('0x20'));_0x3e33f2(_0x232fec[_0x0bf6('0x21')][_0x0bf6('0x1f')]);}})['catch'](function(_0x52763e){logger[_0x0bf6('0x1c')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x194cee,_0x52763e);_0x5cf1e9(_0x52763e);});});}function respondWithStatusCode(_0x4dc8c4,_0xae9d61){_0xae9d61=_0xae9d61||0xcc;return function(_0x7b6cd2){if(_0x7b6cd2){return _0x4dc8c4['sendStatus'](_0xae9d61);}return _0x4dc8c4[_0x0bf6('0x22')](_0xae9d61)[_0x0bf6('0x23')]();};}function respondWithResult(_0x2ba35b,_0x4dafc3){_0x4dafc3=_0x4dafc3||0xc8;return function(_0x3dbce1){if(_0x3dbce1){return _0x2ba35b[_0x0bf6('0x22')](_0x4dafc3)['json'](_0x3dbce1);}};}function respondWithFilteredResult(_0x1c89df,_0x4905a1){return function(_0x2b95b4){if(_0x2b95b4){var _0x2dea89=_0x2b95b4[_0x0bf6('0x24')],_0x5c2a63=_0x4905a1[_0x0bf6('0x25')],_0x533b46=_0x4905a1['offset']+_0x4905a1[_0x0bf6('0x26')],_0x51842d;if(_0x533b46>=_0x2dea89){_0x533b46=_0x2dea89;_0x51842d=0xc8;}else{_0x51842d=0xce;}_0x1c89df[_0x0bf6('0x22')](_0x51842d);return _0x1c89df['set'](_0x0bf6('0x27'),_0x5c2a63+'-'+_0x533b46+'/'+_0x2dea89)[_0x0bf6('0x28')](_0x2b95b4);}return null;};}function patchUpdates(_0x1cca7){return function(_0x1420c0){try{jsonpatch['apply'](_0x1420c0,_0x1cca7,!![]);}catch(_0x15454a){return BPromise[_0x0bf6('0x29')](_0x15454a);}return _0x1420c0['save']();};}function saveUpdates(_0x10c782,_0x28c226){return function(_0x10efd8){if(_0x10efd8){return _0x10efd8[_0x0bf6('0x2a')](_0x10c782)[_0x0bf6('0x17')](function(_0xbf2977){return _0xbf2977;});}return null;};}function removeEntity(_0x34dbbe,_0x29e928){return function(_0x44e8cc){if(_0x44e8cc){return _0x44e8cc[_0x0bf6('0x2b')]()[_0x0bf6('0x17')](function(){_0x34dbbe['status'](0xcc)[_0x0bf6('0x23')]();});}};}function handleEntityNotFound(_0x1b30df,_0x583bed){return function(_0x20bb05){if(!_0x20bb05){_0x1b30df[_0x0bf6('0x2c')](0x194);}return _0x20bb05;};}function handleError(_0x11fbef,_0x396753){_0x396753=_0x396753||0x1f4;return function(_0x11e444){logger['error'](_0x11e444['stack']);if(_0x11e444['name']){delete _0x11e444[_0x0bf6('0x2d')];}_0x11fbef['status'](_0x396753)['send'](_0x11e444);};}exports['index']=function(_0x1882f0,_0x3fde37){var _0xdc1274={},_0x5df924={},_0x183807={'count':0x0,'rows':[]};var _0x4bca9a=_[_0x0bf6('0x2e')](db[_0x0bf6('0x2f')][_0x0bf6('0x30')],function(_0x5750c3){return{'name':_0x5750c3[_0x0bf6('0x31')],'type':_0x5750c3[_0x0bf6('0x32')][_0x0bf6('0x33')]};});_0x5df924[_0x0bf6('0x34')]=_['map'](_0x4bca9a,_0x0bf6('0x2d'));_0x5df924['query']=_['keys'](_0x1882f0[_0x0bf6('0x35')]);_0x5df924[_0x0bf6('0x36')]=_[_0x0bf6('0x37')](_0x5df924['model'],_0x5df924[_0x0bf6('0x35')]);_0xdc1274[_0x0bf6('0x38')]=_[_0x0bf6('0x37')](_0x5df924[_0x0bf6('0x34')],qs[_0x0bf6('0x39')](_0x1882f0['query'][_0x0bf6('0x39')]));_0xdc1274[_0x0bf6('0x38')]=_0xdc1274['attributes']['length']?_0xdc1274[_0x0bf6('0x38')]:_0x5df924[_0x0bf6('0x34')];if(!_0x1882f0[_0x0bf6('0x35')][_0x0bf6('0x3a')](_0x0bf6('0x3b'))){_0xdc1274[_0x0bf6('0x26')]=qs[_0x0bf6('0x26')](_0x1882f0[_0x0bf6('0x35')][_0x0bf6('0x26')]);_0xdc1274[_0x0bf6('0x25')]=qs['offset'](_0x1882f0[_0x0bf6('0x35')][_0x0bf6('0x25')]);}_0xdc1274[_0x0bf6('0x3c')]=qs['sort'](_0x1882f0[_0x0bf6('0x35')][_0x0bf6('0x3d')]);_0xdc1274['where']=qs[_0x0bf6('0x36')](_['pick'](_0x1882f0[_0x0bf6('0x35')],_0x5df924['filters']));if(_0x1882f0[_0x0bf6('0x35')][_0x0bf6('0x3e')]){_0xdc1274[_0x0bf6('0x3f')]=_[_0x0bf6('0x40')](_0xdc1274[_0x0bf6('0x3f')],{'$or':_[_0x0bf6('0x2e')](_0x4bca9a,function(_0x48b65a){if(_0x48b65a['type']!=='VIRTUAL'){var _0x59d8d4={};_0x59d8d4[_0x48b65a[_0x0bf6('0x2d')]]={'$like':'%'+_0x1882f0[_0x0bf6('0x35')][_0x0bf6('0x3e')]+'%'};return _0x59d8d4;}})});}_0xdc1274=_[_0x0bf6('0x40')]({},_0xdc1274,_0x1882f0[_0x0bf6('0x41')]);var _0x2f4d94={'where':_0xdc1274[_0x0bf6('0x3f')]};return db[_0x0bf6('0x2f')][_0x0bf6('0x24')](_0x2f4d94)[_0x0bf6('0x17')](function(_0x19549e){_0x183807[_0x0bf6('0x24')]=_0x19549e;if(_0x1882f0[_0x0bf6('0x35')][_0x0bf6('0x42')]){_0xdc1274[_0x0bf6('0x43')]=[{'all':!![]}];}return db[_0x0bf6('0x2f')][_0x0bf6('0x44')](_0xdc1274);})[_0x0bf6('0x17')](function(_0x3c60ad){_0x183807[_0x0bf6('0x45')]=_0x3c60ad;return _0x183807;})[_0x0bf6('0x17')](respondWithFilteredResult(_0x3fde37,_0xdc1274))[_0x0bf6('0x46')](handleError(_0x3fde37,null));};exports[_0x0bf6('0x47')]=function(_0x54ec0a,_0x31d970){var _0x1acdbf={'raw':![],'where':{'id':_0x54ec0a[_0x0bf6('0x48')]['id']}},_0xc358ed={};_0xc358ed['model']=_[_0x0bf6('0x49')](db[_0x0bf6('0x2f')]['rawAttributes']);_0xc358ed[_0x0bf6('0x35')]=_[_0x0bf6('0x49')](_0x54ec0a[_0x0bf6('0x35')]);_0xc358ed[_0x0bf6('0x36')]=_[_0x0bf6('0x37')](_0xc358ed[_0x0bf6('0x34')],_0xc358ed[_0x0bf6('0x35')]);_0x1acdbf[_0x0bf6('0x38')]=_[_0x0bf6('0x37')](_0xc358ed[_0x0bf6('0x34')],qs['fields'](_0x54ec0a[_0x0bf6('0x35')][_0x0bf6('0x39')]));_0x1acdbf[_0x0bf6('0x38')]=_0x1acdbf[_0x0bf6('0x38')][_0x0bf6('0x4a')]?_0x1acdbf[_0x0bf6('0x38')]:_0xc358ed[_0x0bf6('0x34')];if(_0x54ec0a[_0x0bf6('0x35')][_0x0bf6('0x42')]){_0x1acdbf[_0x0bf6('0x43')]=[{'all':!![]}];}_0x1acdbf=_['merge']({},_0x1acdbf,_0x54ec0a['options']);return db[_0x0bf6('0x2f')]['find'](_0x1acdbf)[_0x0bf6('0x17')](handleEntityNotFound(_0x31d970,null))['then'](respondWithResult(_0x31d970,null))[_0x0bf6('0x46')](handleError(_0x31d970,null));};exports[_0x0bf6('0x4b')]=function(_0x3298a6,_0x8f8160){return db['SugarcrmConfiguration'][_0x0bf6('0x4b')](_0x3298a6['body'],{})['then'](respondWithResult(_0x8f8160,0xc9))['catch'](handleError(_0x8f8160,null));};exports[_0x0bf6('0x2a')]=function(_0x45aa80,_0x4c4d43){if(_0x45aa80[_0x0bf6('0x4c')]['id']){delete _0x45aa80[_0x0bf6('0x4c')]['id'];}return db[_0x0bf6('0x2f')]['find']({'where':{'id':_0x45aa80[_0x0bf6('0x48')]['id']}})[_0x0bf6('0x17')](handleEntityNotFound(_0x4c4d43,null))[_0x0bf6('0x17')](saveUpdates(_0x45aa80[_0x0bf6('0x4c')],null))['then'](respondWithResult(_0x4c4d43,null))[_0x0bf6('0x46')](handleError(_0x4c4d43,null));};exports[_0x0bf6('0x2b')]=function(_0x17f5a7,_0x127ff9){return db['SugarcrmConfiguration']['find']({'where':{'id':_0x17f5a7[_0x0bf6('0x48')]['id']}})[_0x0bf6('0x17')](handleEntityNotFound(_0x127ff9,null))[_0x0bf6('0x17')](removeEntity(_0x127ff9,null))['catch'](handleError(_0x127ff9,null));};exports[_0x0bf6('0x4d')]=function(_0x17f758,_0x1a4926,_0x51aea3){var _0x578df0={};var _0x491cb7={};var _0x1509c2;var _0x18e952;return db[_0x0bf6('0x2f')][_0x0bf6('0x4e')]({'where':{'id':_0x17f758[_0x0bf6('0x48')]['id']}})[_0x0bf6('0x17')](handleEntityNotFound(_0x1a4926,null))['then'](function(_0x34a7dd){if(_0x34a7dd){_0x1509c2=_0x34a7dd;_0x491cb7['model']=_['keys'](db['SugarcrmField']['rawAttributes']);_0x491cb7[_0x0bf6('0x35')]=_[_0x0bf6('0x49')](_0x17f758[_0x0bf6('0x35')]);_0x491cb7[_0x0bf6('0x36')]=_[_0x0bf6('0x37')](_0x491cb7[_0x0bf6('0x34')],_0x491cb7['query']);_0x578df0[_0x0bf6('0x38')]=_['intersection'](_0x491cb7['model'],qs[_0x0bf6('0x39')](_0x17f758[_0x0bf6('0x35')][_0x0bf6('0x39')]));_0x578df0[_0x0bf6('0x38')]=_0x578df0[_0x0bf6('0x38')][_0x0bf6('0x4a')]?_0x578df0['attributes']:_0x491cb7['model'];_0x578df0[_0x0bf6('0x3c')]=qs[_0x0bf6('0x3d')](_0x17f758['query']['sort']);_0x578df0[_0x0bf6('0x3f')]=qs[_0x0bf6('0x36')](_[_0x0bf6('0x4f')](_0x17f758[_0x0bf6('0x35')],_0x491cb7['filters']));if(_0x17f758['query'][_0x0bf6('0x3e')]){_0x578df0[_0x0bf6('0x3f')]=_[_0x0bf6('0x40')](_0x578df0['where'],{'$or':_[_0x0bf6('0x2e')](_0x578df0[_0x0bf6('0x38')],function(_0x36fe5b){var _0xf31bee={};_0xf31bee[_0x36fe5b]={'$like':'%'+_0x17f758[_0x0bf6('0x35')][_0x0bf6('0x3e')]+'%'};return _0xf31bee;})});}_0x578df0=_[_0x0bf6('0x40')]({},_0x578df0,_0x17f758['options']);return _0x1509c2[_0x0bf6('0x4d')](_0x578df0);}})[_0x0bf6('0x17')](function(_0x5bc0fd){if(_0x5bc0fd){_0x18e952=_0x5bc0fd[_0x0bf6('0x4a')];if(!_0x17f758[_0x0bf6('0x35')][_0x0bf6('0x3a')](_0x0bf6('0x3b'))){_0x578df0['limit']=qs[_0x0bf6('0x26')](_0x17f758[_0x0bf6('0x35')]['limit']);_0x578df0[_0x0bf6('0x25')]=qs[_0x0bf6('0x25')](_0x17f758[_0x0bf6('0x35')][_0x0bf6('0x25')]);}return _0x1509c2[_0x0bf6('0x4d')](_0x578df0);}})['then'](function(_0x176dc3){if(_0x176dc3){return _0x176dc3?{'count':_0x18e952,'rows':_0x176dc3}:null;}})['then'](respondWithResult(_0x1a4926,null))[_0x0bf6('0x46')](handleError(_0x1a4926,null));};exports['getSubjects']=function(_0x2fb2ac,_0x3d3ba3,_0x9cd34f){var _0x38b0d7={};var _0x334b68={};var _0xb7a2f5;var _0x31a55d;return db['SugarcrmConfiguration'][_0x0bf6('0x4e')]({'where':{'id':_0x2fb2ac[_0x0bf6('0x48')]['id']}})[_0x0bf6('0x17')](handleEntityNotFound(_0x3d3ba3,null))[_0x0bf6('0x17')](function(_0x95bc4b){if(_0x95bc4b){_0xb7a2f5=_0x95bc4b;_0x334b68['model']=_[_0x0bf6('0x49')](db[_0x0bf6('0x50')][_0x0bf6('0x30')]);_0x334b68[_0x0bf6('0x35')]=_[_0x0bf6('0x49')](_0x2fb2ac['query']);_0x334b68[_0x0bf6('0x36')]=_[_0x0bf6('0x37')](_0x334b68[_0x0bf6('0x34')],_0x334b68[_0x0bf6('0x35')]);_0x38b0d7['attributes']=_[_0x0bf6('0x37')](_0x334b68[_0x0bf6('0x34')],qs['fields'](_0x2fb2ac[_0x0bf6('0x35')]['fields']));_0x38b0d7[_0x0bf6('0x38')]=_0x38b0d7[_0x0bf6('0x38')][_0x0bf6('0x4a')]?_0x38b0d7[_0x0bf6('0x38')]:_0x334b68[_0x0bf6('0x34')];_0x38b0d7[_0x0bf6('0x3c')]=qs[_0x0bf6('0x3d')](_0x2fb2ac[_0x0bf6('0x35')][_0x0bf6('0x3d')]);_0x38b0d7[_0x0bf6('0x3f')]=qs['filters'](_[_0x0bf6('0x4f')](_0x2fb2ac[_0x0bf6('0x35')],_0x334b68['filters']));if(_0x2fb2ac[_0x0bf6('0x35')]['filter']){_0x38b0d7[_0x0bf6('0x3f')]=_[_0x0bf6('0x40')](_0x38b0d7['where'],{'$or':_['map'](_0x38b0d7[_0x0bf6('0x38')],function(_0x48df73){var _0x21fd52={};_0x21fd52[_0x48df73]={'$like':'%'+_0x2fb2ac[_0x0bf6('0x35')][_0x0bf6('0x3e')]+'%'};return _0x21fd52;})});}_0x38b0d7=_[_0x0bf6('0x40')]({},_0x38b0d7,_0x2fb2ac[_0x0bf6('0x41')]);return _0xb7a2f5[_0x0bf6('0x51')](_0x38b0d7);}})[_0x0bf6('0x17')](function(_0x453030){if(_0x453030){_0x31a55d=_0x453030[_0x0bf6('0x4a')];if(!_0x2fb2ac[_0x0bf6('0x35')]['hasOwnProperty']('nolimit')){_0x38b0d7[_0x0bf6('0x26')]=qs[_0x0bf6('0x26')](_0x2fb2ac[_0x0bf6('0x35')]['limit']);_0x38b0d7['offset']=qs[_0x0bf6('0x25')](_0x2fb2ac[_0x0bf6('0x35')][_0x0bf6('0x25')]);}return _0xb7a2f5[_0x0bf6('0x51')](_0x38b0d7);}})[_0x0bf6('0x17')](function(_0x42ed94){if(_0x42ed94){return _0x42ed94?{'count':_0x31a55d,'rows':_0x42ed94}:null;}})[_0x0bf6('0x17')](respondWithResult(_0x3d3ba3,null))[_0x0bf6('0x46')](handleError(_0x3d3ba3,null));};exports[_0x0bf6('0x52')]=function(_0x4e8874,_0xe57ab9,_0x5af325){var _0x1e3033={};var _0x235823={};var _0x3fde28;var _0x1a912e;return db[_0x0bf6('0x2f')][_0x0bf6('0x4e')]({'where':{'id':_0x4e8874['params']['id']}})['then'](handleEntityNotFound(_0xe57ab9,null))[_0x0bf6('0x17')](function(_0x647159){if(_0x647159){_0x3fde28=_0x647159;_0x235823[_0x0bf6('0x34')]=_[_0x0bf6('0x49')](db[_0x0bf6('0x50')][_0x0bf6('0x30')]);_0x235823[_0x0bf6('0x35')]=_[_0x0bf6('0x49')](_0x4e8874['query']);_0x235823[_0x0bf6('0x36')]=_[_0x0bf6('0x37')](_0x235823['model'],_0x235823[_0x0bf6('0x35')]);_0x1e3033[_0x0bf6('0x38')]=_[_0x0bf6('0x37')](_0x235823[_0x0bf6('0x34')],qs['fields'](_0x4e8874[_0x0bf6('0x35')][_0x0bf6('0x39')]));_0x1e3033['attributes']=_0x1e3033['attributes'][_0x0bf6('0x4a')]?_0x1e3033['attributes']:_0x235823['model'];_0x1e3033[_0x0bf6('0x3c')]=qs['sort'](_0x4e8874['query']['sort']);_0x1e3033[_0x0bf6('0x3f')]=qs[_0x0bf6('0x36')](_[_0x0bf6('0x4f')](_0x4e8874['query'],_0x235823[_0x0bf6('0x36')]));if(_0x4e8874['query'][_0x0bf6('0x3e')]){_0x1e3033[_0x0bf6('0x3f')]=_['merge'](_0x1e3033[_0x0bf6('0x3f')],{'$or':_[_0x0bf6('0x2e')](_0x1e3033[_0x0bf6('0x38')],function(_0x5ee924){var _0x243cbc={};_0x243cbc[_0x5ee924]={'$like':'%'+_0x4e8874['query'][_0x0bf6('0x3e')]+'%'};return _0x243cbc;})});}_0x1e3033=_[_0x0bf6('0x40')]({},_0x1e3033,_0x4e8874[_0x0bf6('0x41')]);return _0x3fde28[_0x0bf6('0x52')](_0x1e3033);}})[_0x0bf6('0x17')](function(_0x3723be){if(_0x3723be){_0x1a912e=_0x3723be[_0x0bf6('0x4a')];if(!_0x4e8874[_0x0bf6('0x35')][_0x0bf6('0x3a')](_0x0bf6('0x3b'))){_0x1e3033[_0x0bf6('0x26')]=qs[_0x0bf6('0x26')](_0x4e8874['query'][_0x0bf6('0x26')]);_0x1e3033[_0x0bf6('0x25')]=qs[_0x0bf6('0x25')](_0x4e8874[_0x0bf6('0x35')][_0x0bf6('0x25')]);}return _0x3fde28['getDescriptions'](_0x1e3033);}})['then'](function(_0x3f81c7){if(_0x3f81c7){return _0x3f81c7?{'count':_0x1a912e,'rows':_0x3f81c7}:null;}})['then'](respondWithResult(_0xe57ab9,null))[_0x0bf6('0x46')](handleError(_0xe57ab9,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 090e50c..f3a6bde 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 _0x98df=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api'];(function(_0xa8aa3c,_0x1a6859){var _0x33a6f8=function(_0x1fce03){while(--_0x1fce03){_0xa8aa3c['push'](_0xa8aa3c['shift']());}};_0x33a6f8(++_0x1a6859);}(_0x98df,0xce));var _0xf98d=function(_0x34a087,_0x167f6e){_0x34a087=_0x34a087-0x0;var _0x2dcf8b=_0x98df[_0x34a087];return _0x2dcf8b;};'use strict';var _=require(_0xf98d('0x0'));var util=require(_0xf98d('0x1'));var logger=require(_0xf98d('0x2'))(_0xf98d('0x3'));var moment=require(_0xf98d('0x4'));var BPromise=require(_0xf98d('0x5'));var rp=require(_0xf98d('0x6'));var fs=require('fs');var path=require(_0xf98d('0x7'));var rimraf=require(_0xf98d('0x8'));var config=require(_0xf98d('0x9'));var attributes=require(_0xf98d('0xa'));module[_0xf98d('0xb')]=function(_0x471ad3,_0x22e5f8){return _0x471ad3[_0xf98d('0xc')](_0xf98d('0xd'),attributes,{'tableName':_0xf98d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd3d0=['bluebird','path','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','util','../../config/logger','moment'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0xd3d0,0x93));var _0x0d3d=function(_0x434560,_0x5dc682){_0x434560=_0x434560-0x0;var _0x1d5fd7=_0xd3d0[_0x434560];return _0x1d5fd7;};'use strict';var _=require('lodash');var util=require(_0x0d3d('0x0'));var logger=require(_0x0d3d('0x1'))('api');var moment=require(_0x0d3d('0x2'));var BPromise=require(_0x0d3d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0d3d('0x4'));var rimraf=require('rimraf');var config=require(_0x0d3d('0x5'));var attributes=require(_0x0d3d('0x6'));module[_0x0d3d('0x7')]=function(_0x332a89,_0x381dc3){return _0x332a89[_0x0d3d('0x8')](_0x0d3d('0x9'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 4f92538..074470d 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 _0x8122=['result','catch','lodash','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message'];(function(_0x934754,_0x15bd40){var _0x5cf1fc=function(_0x2c1de6){while(--_0x2c1de6){_0x934754['push'](_0x934754['shift']());}};_0x5cf1fc(++_0x15bd40);}(_0x8122,0x156));var _0x2812=function(_0x5137a6,_0x40715c){_0x5137a6=_0x5137a6-0x0;var _0x349c7a=_0x8122[_0x5137a6];return _0x349c7a;};'use strict';var _=require(_0x2812('0x0'));var util=require('util');var moment=require(_0x2812('0x1'));var BPromise=require(_0x2812('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2812('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2812('0x4'))(_0x2812('0x5'));var config=require(_0x2812('0x6'));var jayson=require(_0x2812('0x7'));var client=jayson['client'][_0x2812('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x415f43,_0x2a27d5,_0x24c0b4){return new BPromise(function(_0x31bfae,_0x3daae1){return client[_0x2812('0x9')](_0x415f43,_0x24c0b4)['then'](function(_0x58b7f0){logger[_0x2812('0xa')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2a27d5,_0x2812('0xb'));logger[_0x2812('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x2a27d5,_0x2812('0xb'),JSON[_0x2812('0xd')](_0x58b7f0));if(_0x58b7f0[_0x2812('0xe')]){if(_0x58b7f0[_0x2812('0xe')][_0x2812('0xf')]===0x1f4){logger[_0x2812('0xe')](_0x2812('0x10'),_0x2a27d5,_0x58b7f0['error'][_0x2812('0x11')]);return _0x3daae1(_0x58b7f0[_0x2812('0xe')]['message']);}logger[_0x2812('0xe')](_0x2812('0x10'),_0x2a27d5,_0x58b7f0[_0x2812('0xe')][_0x2812('0x11')]);return _0x31bfae(_0x58b7f0[_0x2812('0xe')]['message']);}else{logger[_0x2812('0xa')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2a27d5,_0x2812('0xb'));_0x31bfae(_0x58b7f0[_0x2812('0x12')][_0x2812('0x11')]);}})[_0x2812('0x13')](function(_0x358cbc){logger[_0x2812('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2a27d5,_0x358cbc);_0x3daae1(_0x358cbc);});});} \ No newline at end of file +var _0x9e98=['client','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s','debug','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x21abf1,_0xcd06d){var _0x8f3ba=function(_0x1c904e){while(--_0x1c904e){_0x21abf1['push'](_0x21abf1['shift']());}};_0x8f3ba(++_0xcd06d);}(_0x9e98,0x9e));var _0x89e9=function(_0x379799,_0x4ccf16){_0x379799=_0x379799-0x0;var _0x46e431=_0x9e98[_0x379799];return _0x46e431;};'use strict';var _=require(_0x89e9('0x0'));var util=require(_0x89e9('0x1'));var moment=require(_0x89e9('0x2'));var BPromise=require(_0x89e9('0x3'));var rs=require(_0x89e9('0x4'));var fs=require('fs');var Redis=require(_0x89e9('0x5'));var db=require(_0x89e9('0x6'))['db'];var utils=require(_0x89e9('0x7'));var logger=require(_0x89e9('0x8'))('rpc');var config=require(_0x89e9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x89e9('0xa')][_0x89e9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32335f,_0x1eedec,_0x1660de){return new BPromise(function(_0x1bb435,_0x3ecd27){return client[_0x89e9('0xc')](_0x32335f,_0x1660de)[_0x89e9('0xd')](function(_0x573bb3){logger['info'](_0x89e9('0xe'),_0x1eedec,'request\x20sent');logger[_0x89e9('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x1eedec,'request\x20sent',JSON['stringify'](_0x573bb3));if(_0x573bb3['error']){if(_0x573bb3[_0x89e9('0x10')]['code']===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x1eedec,_0x573bb3['error'][_0x89e9('0x11')]);return _0x3ecd27(_0x573bb3[_0x89e9('0x10')]['message']);}logger['error'](_0x89e9('0xe'),_0x1eedec,_0x573bb3[_0x89e9('0x10')]['message']);return _0x1bb435(_0x573bb3[_0x89e9('0x10')][_0x89e9('0x11')]);}else{logger[_0x89e9('0x12')](_0x89e9('0xe'),_0x1eedec,'request\x20sent');_0x1bb435(_0x573bb3[_0x89e9('0x13')][_0x89e9('0x11')]);}})[_0x89e9('0x14')](function(_0x46efb7){logger[_0x89e9('0x10')](_0x89e9('0xe'),_0x1eedec,_0x46efb7);_0x3ecd27(_0x46efb7);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 6bb740a..3b2e932 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 _0x9fd4=['path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x5a6b45,_0x48fea6){var _0x2ad452=function(_0x57381c){while(--_0x57381c){_0x5a6b45['push'](_0x5a6b45['shift']());}};_0x2ad452(++_0x48fea6);}(_0x9fd4,0x1ae));var _0x49fd=function(_0x119172,_0x3e83f2){_0x119172=_0x119172-0x0;var _0x1498a8=_0x9fd4[_0x119172];return _0x1498a8;};'use strict';var multer=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var path=require(_0x49fd('0x2'));var timeout=require('connect-timeout');var express=require(_0x49fd('0x3'));var router=express[_0x49fd('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x49fd('0x5'));var config=require(_0x49fd('0x6'));var controller=require('./intSugarcrmField.controller');router[_0x49fd('0x7')]('/',auth[_0x49fd('0x8')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x49fd('0x9')]);router[_0x49fd('0xa')]('/',auth[_0x49fd('0x8')](),controller[_0x49fd('0xb')]);router[_0x49fd('0xc')](_0x49fd('0xd'),auth[_0x49fd('0x8')](),controller[_0x49fd('0xe')]);router[_0x49fd('0xf')](_0x49fd('0xd'),auth['isAuthenticated'](),controller[_0x49fd('0x10')]);module[_0x49fd('0x11')]=router; \ No newline at end of file +var _0x8b65=['put','update','delete','multer','path','express','Router','../../components/auth/service','./intSugarcrmField.controller','isAuthenticated','index','get','/:id','show'];(function(_0x2e9738,_0x2cedd8){var _0x5f154f=function(_0x45229b){while(--_0x45229b){_0x2e9738['push'](_0x2e9738['shift']());}};_0x5f154f(++_0x2cedd8);}(_0x8b65,0x1b5));var _0x58b6=function(_0x2c6bb3,_0x43c90d){_0x2c6bb3=_0x2c6bb3-0x0;var _0xf27aff=_0x8b65[_0x2c6bb3];return _0xf27aff;};'use strict';var multer=require(_0x58b6('0x0'));var util=require('util');var path=require(_0x58b6('0x1'));var timeout=require('connect-timeout');var express=require(_0x58b6('0x2'));var router=express[_0x58b6('0x3')]();var auth=require(_0x58b6('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x58b6('0x5'));router['get']('/',auth[_0x58b6('0x6')](),controller[_0x58b6('0x7')]);router[_0x58b6('0x8')](_0x58b6('0x9'),auth[_0x58b6('0x6')](),controller[_0x58b6('0xa')]);router['post']('/',auth[_0x58b6('0x6')](),controller['create']);router[_0x58b6('0xb')](_0x58b6('0x9'),auth[_0x58b6('0x6')](),controller[_0x58b6('0xc')]);router[_0x58b6('0xd')](_0x58b6('0x9'),auth[_0x58b6('0x6')](),controller['destroy']);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 33c6128..7c282e1 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 _0x1413=['keyValue','STRING','exports','ENUM','string','variable'];(function(_0x55e61f,_0xf21352){var _0xd297bc=function(_0x1b61d3){while(--_0x1b61d3){_0x55e61f['push'](_0x55e61f['shift']());}};_0xd297bc(++_0xf21352);}(_0x1413,0x170));var _0x3141=function(_0x39f50f,_0x157429){_0x39f50f=_0x39f50f-0x0;var _0x22a4f9=_0x1413[_0x39f50f];return _0x22a4f9;};'use strict';var Sequelize=require('sequelize');module[_0x3141('0x0')]={'type':{'type':Sequelize[_0x3141('0x1')](_0x3141('0x2'),_0x3141('0x3'),'customVariable',_0x3141('0x4')),'defaultValue':_0x3141('0x2')},'content':{'type':Sequelize[_0x3141('0x5')]},'key':{'type':Sequelize[_0x3141('0x5')]},'keyType':{'type':Sequelize[_0x3141('0x1')]('string',_0x3141('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x3141('0x5')]},'idField':{'type':Sequelize[_0x3141('0x5')]},'nameField':{'type':Sequelize[_0x3141('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3141('0x5')]}}; \ No newline at end of file +var _0x6c32=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x43e4b3,_0x1444de){var _0x10c655=function(_0x56c01d){while(--_0x56c01d){_0x43e4b3['push'](_0x43e4b3['shift']());}};_0x10c655(++_0x1444de);}(_0x6c32,0x6e));var _0x26c3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6c32[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x26c3('0x0'));module[_0x26c3('0x1')]={'type':{'type':Sequelize[_0x26c3('0x2')](_0x26c3('0x3'),_0x26c3('0x4'),_0x26c3('0x5'),_0x26c3('0x6')),'defaultValue':_0x26c3('0x3')},'content':{'type':Sequelize[_0x26c3('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x26c3('0x2')](_0x26c3('0x3'),_0x26c3('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x26c3('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x26c3('0x7')]},'customField':{'type':Sequelize[_0x26c3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x26c3('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index d7b5b00..41a35f3 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 _0x60f9=['rawAttributes','fieldName','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','rows','show','params','length','includeAll','catch','create','body','find','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmField'];(function(_0x5ea7e0,_0x2f46f2){var _0x1c49c7=function(_0x13db9e){while(--_0x13db9e){_0x5ea7e0['push'](_0x5ea7e0['shift']());}};_0x1c49c7(++_0x2f46f2);}(_0x60f9,0xb2));var _0x960f=function(_0x46b4ab,_0x128023){_0x46b4ab=_0x46b4ab-0x0;var _0x360dc4=_0x60f9[_0x46b4ab];return _0x360dc4;};'use strict';var pdf=require(_0x960f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x960f('0x1'));var zipdir=require(_0x960f('0x2'));var jsonpatch=require(_0x960f('0x3'));var rp=require('request-promise');var moment=require(_0x960f('0x4'));var BPromise=require(_0x960f('0x5'));var Mustache=require(_0x960f('0x6'));var util=require(_0x960f('0x7'));var path=require('path');var sox=require(_0x960f('0x8'));var csv=require(_0x960f('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x960f('0xa'));var crypto=require(_0x960f('0xb'));var jsforce=require(_0x960f('0xc'));var deskjs=require(_0x960f('0xd'));var toCsv=require(_0x960f('0x9'));var querystring=require(_0x960f('0xe'));var Papa=require(_0x960f('0xf'));var Redis=require(_0x960f('0x10'));var authService=require(_0x960f('0x11'));var qs=require(_0x960f('0x12'));var as=require(_0x960f('0x13'));var hardwareService=require(_0x960f('0x14'));var logger=require(_0x960f('0x15'))(_0x960f('0x16'));var utils=require(_0x960f('0x17'));var config=require(_0x960f('0x18'));var db=require(_0x960f('0x19'))['db'];function respondWithStatusCode(_0x45e9ce,_0x119707){_0x119707=_0x119707||0xcc;return function(_0x58e11d){if(_0x58e11d){return _0x45e9ce[_0x960f('0x1a')](_0x119707);}return _0x45e9ce[_0x960f('0x1b')](_0x119707)[_0x960f('0x1c')]();};}function respondWithResult(_0x4e2972,_0x46ba79){_0x46ba79=_0x46ba79||0xc8;return function(_0x4b8b83){if(_0x4b8b83){return _0x4e2972[_0x960f('0x1b')](_0x46ba79)[_0x960f('0x1d')](_0x4b8b83);}};}function respondWithFilteredResult(_0x3b95bf,_0x8f7e53){return function(_0x13fb2c){if(_0x13fb2c){var _0x56bbb1=_0x13fb2c[_0x960f('0x1e')],_0x3bdbbe=_0x8f7e53[_0x960f('0x1f')],_0x5a89e2=_0x8f7e53[_0x960f('0x1f')]+_0x8f7e53[_0x960f('0x20')],_0x4eaca6;if(_0x5a89e2>=_0x56bbb1){_0x5a89e2=_0x56bbb1;_0x4eaca6=0xc8;}else{_0x4eaca6=0xce;}_0x3b95bf[_0x960f('0x1b')](_0x4eaca6);return _0x3b95bf[_0x960f('0x21')](_0x960f('0x22'),_0x3bdbbe+'-'+_0x5a89e2+'/'+_0x56bbb1)[_0x960f('0x1d')](_0x13fb2c);}return null;};}function patchUpdates(_0x4c6f4e){return function(_0x512b4e){try{jsonpatch[_0x960f('0x23')](_0x512b4e,_0x4c6f4e,!![]);}catch(_0xc5445c){return BPromise['reject'](_0xc5445c);}return _0x512b4e[_0x960f('0x24')]();};}function saveUpdates(_0x20560d,_0x41c985){return function(_0x96be6d){if(_0x96be6d){return _0x96be6d[_0x960f('0x25')](_0x20560d)[_0x960f('0x26')](function(_0x2fa411){return _0x2fa411;});}return null;};}function removeEntity(_0x437ea6,_0x4f47ae){return function(_0x5b33cb){if(_0x5b33cb){return _0x5b33cb[_0x960f('0x27')]()['then'](function(){_0x437ea6[_0x960f('0x1b')](0xcc)[_0x960f('0x1c')]();});}};}function handleEntityNotFound(_0x5aa502,_0x2f9aab){return function(_0x4b3215){if(!_0x4b3215){_0x5aa502[_0x960f('0x1a')](0x194);}return _0x4b3215;};}function handleError(_0x4c8131,_0x315f8a){_0x315f8a=_0x315f8a||0x1f4;return function(_0x4a4053){logger[_0x960f('0x28')](_0x4a4053[_0x960f('0x29')]);if(_0x4a4053[_0x960f('0x2a')]){delete _0x4a4053[_0x960f('0x2a')];}_0x4c8131[_0x960f('0x1b')](_0x315f8a)[_0x960f('0x2b')](_0x4a4053);};}exports[_0x960f('0x2c')]=function(_0x1afb44,_0x38443a){var _0x2b3535={},_0x1c2601={},_0x3d3867={'count':0x0,'rows':[]};var _0x5a972a=_[_0x960f('0x2d')](db[_0x960f('0x2e')][_0x960f('0x2f')],function(_0x2a746a){return{'name':_0x2a746a[_0x960f('0x30')],'type':_0x2a746a['type'][_0x960f('0x31')]};});_0x1c2601[_0x960f('0x32')]=_[_0x960f('0x2d')](_0x5a972a,_0x960f('0x2a'));_0x1c2601[_0x960f('0x33')]=_['keys'](_0x1afb44[_0x960f('0x33')]);_0x1c2601['filters']=_[_0x960f('0x34')](_0x1c2601[_0x960f('0x32')],_0x1c2601['query']);_0x2b3535[_0x960f('0x35')]=_[_0x960f('0x34')](_0x1c2601[_0x960f('0x32')],qs[_0x960f('0x36')](_0x1afb44[_0x960f('0x33')][_0x960f('0x36')]));_0x2b3535[_0x960f('0x35')]=_0x2b3535[_0x960f('0x35')]['length']?_0x2b3535[_0x960f('0x35')]:_0x1c2601['model'];if(!_0x1afb44['query']['hasOwnProperty'](_0x960f('0x37'))){_0x2b3535[_0x960f('0x20')]=qs[_0x960f('0x20')](_0x1afb44[_0x960f('0x33')][_0x960f('0x20')]);_0x2b3535[_0x960f('0x1f')]=qs[_0x960f('0x1f')](_0x1afb44[_0x960f('0x33')][_0x960f('0x1f')]);}_0x2b3535[_0x960f('0x38')]=qs[_0x960f('0x39')](_0x1afb44['query'][_0x960f('0x39')]);_0x2b3535[_0x960f('0x3a')]=qs[_0x960f('0x3b')](_[_0x960f('0x3c')](_0x1afb44[_0x960f('0x33')],_0x1c2601['filters']));if(_0x1afb44[_0x960f('0x33')][_0x960f('0x3d')]){_0x2b3535['where']=_[_0x960f('0x3e')](_0x2b3535[_0x960f('0x3a')],{'$or':_[_0x960f('0x2d')](_0x5a972a,function(_0x20bdd5){if(_0x20bdd5[_0x960f('0x3f')]!==_0x960f('0x40')){var _0x129098={};_0x129098[_0x20bdd5[_0x960f('0x2a')]]={'$like':'%'+_0x1afb44[_0x960f('0x33')][_0x960f('0x3d')]+'%'};return _0x129098;}})});}_0x2b3535=_['merge']({},_0x2b3535,_0x1afb44[_0x960f('0x41')]);var _0xa45bf1={'where':_0x2b3535[_0x960f('0x3a')]};return db['SugarcrmField'][_0x960f('0x1e')](_0xa45bf1)['then'](function(_0x33277f){_0x3d3867[_0x960f('0x1e')]=_0x33277f;if(_0x1afb44['query']['includeAll']){_0x2b3535['include']=[{'all':!![]}];}return db[_0x960f('0x2e')]['findAll'](_0x2b3535);})[_0x960f('0x26')](function(_0x5da2a2){_0x3d3867[_0x960f('0x42')]=_0x5da2a2;return _0x3d3867;})['then'](respondWithFilteredResult(_0x38443a,_0x2b3535))['catch'](handleError(_0x38443a,null));};exports[_0x960f('0x43')]=function(_0x33a979,_0x3896a2){var _0x4f084c={'raw':!![],'where':{'id':_0x33a979[_0x960f('0x44')]['id']}},_0x5ca350={};_0x5ca350[_0x960f('0x32')]=_['keys'](db['SugarcrmField'][_0x960f('0x2f')]);_0x5ca350['query']=_['keys'](_0x33a979[_0x960f('0x33')]);_0x5ca350[_0x960f('0x3b')]=_[_0x960f('0x34')](_0x5ca350[_0x960f('0x32')],_0x5ca350[_0x960f('0x33')]);_0x4f084c[_0x960f('0x35')]=_['intersection'](_0x5ca350[_0x960f('0x32')],qs[_0x960f('0x36')](_0x33a979[_0x960f('0x33')][_0x960f('0x36')]));_0x4f084c[_0x960f('0x35')]=_0x4f084c[_0x960f('0x35')][_0x960f('0x45')]?_0x4f084c[_0x960f('0x35')]:_0x5ca350['model'];if(_0x33a979['query'][_0x960f('0x46')]){_0x4f084c['include']=[{'all':!![]}];}_0x4f084c=_['merge']({},_0x4f084c,_0x33a979[_0x960f('0x41')]);return db[_0x960f('0x2e')]['find'](_0x4f084c)[_0x960f('0x26')](handleEntityNotFound(_0x3896a2,null))[_0x960f('0x26')](respondWithResult(_0x3896a2,null))[_0x960f('0x47')](handleError(_0x3896a2,null));};exports[_0x960f('0x48')]=function(_0x551412,_0x2d82c4){return db[_0x960f('0x2e')][_0x960f('0x48')](_0x551412[_0x960f('0x49')],{})['then'](respondWithResult(_0x2d82c4,0xc9))[_0x960f('0x47')](handleError(_0x2d82c4,null));};exports[_0x960f('0x25')]=function(_0x4cc3d0,_0x1ecaec){if(_0x4cc3d0[_0x960f('0x49')]['id']){delete _0x4cc3d0['body']['id'];}return db[_0x960f('0x2e')][_0x960f('0x4a')]({'where':{'id':_0x4cc3d0[_0x960f('0x44')]['id']}})[_0x960f('0x26')](handleEntityNotFound(_0x1ecaec,null))[_0x960f('0x26')](saveUpdates(_0x4cc3d0[_0x960f('0x49')],null))[_0x960f('0x26')](respondWithResult(_0x1ecaec,null))[_0x960f('0x47')](handleError(_0x1ecaec,null));};exports[_0x960f('0x27')]=function(_0x1b34f5,_0x5322b0){return db[_0x960f('0x2e')][_0x960f('0x4a')]({'where':{'id':_0x1b34f5[_0x960f('0x44')]['id']}})['then'](handleEntityNotFound(_0x5322b0,null))[_0x960f('0x26')](removeEntity(_0x5322b0,null))[_0x960f('0x47')](handleError(_0x5322b0,null));}; \ No newline at end of file +var _0x23fb=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','save','update','destroy','then','error','name','index','map','SugarcrmField','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','html-pdf','eml-format','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce'];(function(_0x4046b6,_0x238c36){var _0x1443be=function(_0x2e6c5d){while(--_0x2e6c5d){_0x4046b6['push'](_0x4046b6['shift']());}};_0x1443be(++_0x238c36);}(_0x23fb,0x19d));var _0xb23f=function(_0x6d3491,_0x399cf8){_0x6d3491=_0x6d3491-0x0;var _0x5494b1=_0x23fb[_0x6d3491];return _0x5494b1;};'use strict';var pdf=require(_0xb23f('0x0'));var emlformat=require(_0xb23f('0x1'));var rimraf=require(_0xb23f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb23f('0x3'));var BPromise=require(_0xb23f('0x4'));var Mustache=require(_0xb23f('0x5'));var util=require('util');var path=require(_0xb23f('0x6'));var sox=require(_0xb23f('0x7'));var csv=require(_0xb23f('0x8'));var ejs=require(_0xb23f('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb23f('0xa'));var crypto=require(_0xb23f('0xb'));var jsforce=require(_0xb23f('0xc'));var deskjs=require(_0xb23f('0xd'));var toCsv=require(_0xb23f('0x8'));var querystring=require(_0xb23f('0xe'));var Papa=require(_0xb23f('0xf'));var Redis=require(_0xb23f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb23f('0x11'));var as=require(_0xb23f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb23f('0x13'))(_0xb23f('0x14'));var utils=require(_0xb23f('0x15'));var config=require(_0xb23f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21c671,_0x1b52f3){_0x1b52f3=_0x1b52f3||0xcc;return function(_0xf3519b){if(_0xf3519b){return _0x21c671[_0xb23f('0x17')](_0x1b52f3);}return _0x21c671[_0xb23f('0x18')](_0x1b52f3)[_0xb23f('0x19')]();};}function respondWithResult(_0xd9ac46,_0x1e69da){_0x1e69da=_0x1e69da||0xc8;return function(_0x2fd6a0){if(_0x2fd6a0){return _0xd9ac46[_0xb23f('0x18')](_0x1e69da)[_0xb23f('0x1a')](_0x2fd6a0);}};}function respondWithFilteredResult(_0x8c6577,_0x4e8411){return function(_0xd243ac){if(_0xd243ac){var _0x385f56=_0xd243ac[_0xb23f('0x1b')],_0x54f8d7=_0x4e8411[_0xb23f('0x1c')],_0x90e8ed=_0x4e8411[_0xb23f('0x1c')]+_0x4e8411[_0xb23f('0x1d')],_0x18bf9c;if(_0x90e8ed>=_0x385f56){_0x90e8ed=_0x385f56;_0x18bf9c=0xc8;}else{_0x18bf9c=0xce;}_0x8c6577[_0xb23f('0x18')](_0x18bf9c);return _0x8c6577[_0xb23f('0x1e')]('Content-Range',_0x54f8d7+'-'+_0x90e8ed+'/'+_0x385f56)[_0xb23f('0x1a')](_0xd243ac);}return null;};}function patchUpdates(_0x5ec577){return function(_0xc08b2c){try{jsonpatch['apply'](_0xc08b2c,_0x5ec577,!![]);}catch(_0x4e2a4d){return BPromise['reject'](_0x4e2a4d);}return _0xc08b2c[_0xb23f('0x1f')]();};}function saveUpdates(_0xd68155,_0x4c1a43){return function(_0x57809c){if(_0x57809c){return _0x57809c[_0xb23f('0x20')](_0xd68155)['then'](function(_0x10a70f){return _0x10a70f;});}return null;};}function removeEntity(_0xea0ba0,_0x1e2771){return function(_0x5144f7){if(_0x5144f7){return _0x5144f7[_0xb23f('0x21')]()[_0xb23f('0x22')](function(){_0xea0ba0[_0xb23f('0x18')](0xcc)[_0xb23f('0x19')]();});}};}function handleEntityNotFound(_0xddc461,_0x3e2aca){return function(_0x86dc38){if(!_0x86dc38){_0xddc461[_0xb23f('0x17')](0x194);}return _0x86dc38;};}function handleError(_0x680da5,_0x197367){_0x197367=_0x197367||0x1f4;return function(_0x16778d){logger[_0xb23f('0x23')](_0x16778d['stack']);if(_0x16778d['name']){delete _0x16778d[_0xb23f('0x24')];}_0x680da5[_0xb23f('0x18')](_0x197367)['send'](_0x16778d);};}exports[_0xb23f('0x25')]=function(_0x479fb7,_0x2074fa){var _0x1bb19b={},_0x58c17d={},_0x3983d2={'count':0x0,'rows':[]};var _0x22b7c4=_[_0xb23f('0x26')](db[_0xb23f('0x27')][_0xb23f('0x28')],function(_0x1cd913){return{'name':_0x1cd913[_0xb23f('0x29')],'type':_0x1cd913[_0xb23f('0x2a')]['key']};});_0x58c17d[_0xb23f('0x2b')]=_[_0xb23f('0x26')](_0x22b7c4,_0xb23f('0x24'));_0x58c17d[_0xb23f('0x2c')]=_['keys'](_0x479fb7[_0xb23f('0x2c')]);_0x58c17d[_0xb23f('0x2d')]=_['intersection'](_0x58c17d[_0xb23f('0x2b')],_0x58c17d[_0xb23f('0x2c')]);_0x1bb19b['attributes']=_[_0xb23f('0x2e')](_0x58c17d[_0xb23f('0x2b')],qs[_0xb23f('0x2f')](_0x479fb7['query'][_0xb23f('0x2f')]));_0x1bb19b[_0xb23f('0x30')]=_0x1bb19b[_0xb23f('0x30')][_0xb23f('0x31')]?_0x1bb19b[_0xb23f('0x30')]:_0x58c17d[_0xb23f('0x2b')];if(!_0x479fb7[_0xb23f('0x2c')][_0xb23f('0x32')](_0xb23f('0x33'))){_0x1bb19b[_0xb23f('0x1d')]=qs[_0xb23f('0x1d')](_0x479fb7[_0xb23f('0x2c')][_0xb23f('0x1d')]);_0x1bb19b[_0xb23f('0x1c')]=qs[_0xb23f('0x1c')](_0x479fb7['query'][_0xb23f('0x1c')]);}_0x1bb19b[_0xb23f('0x34')]=qs[_0xb23f('0x35')](_0x479fb7[_0xb23f('0x2c')]['sort']);_0x1bb19b['where']=qs[_0xb23f('0x2d')](_[_0xb23f('0x36')](_0x479fb7['query'],_0x58c17d['filters']));if(_0x479fb7[_0xb23f('0x2c')][_0xb23f('0x37')]){_0x1bb19b[_0xb23f('0x38')]=_[_0xb23f('0x39')](_0x1bb19b[_0xb23f('0x38')],{'$or':_['map'](_0x22b7c4,function(_0x3715b9){if(_0x3715b9[_0xb23f('0x2a')]!==_0xb23f('0x3a')){var _0x498be4={};_0x498be4[_0x3715b9[_0xb23f('0x24')]]={'$like':'%'+_0x479fb7[_0xb23f('0x2c')][_0xb23f('0x37')]+'%'};return _0x498be4;}})});}_0x1bb19b=_[_0xb23f('0x39')]({},_0x1bb19b,_0x479fb7[_0xb23f('0x3b')]);var _0x40f36a={'where':_0x1bb19b[_0xb23f('0x38')]};return db['SugarcrmField'][_0xb23f('0x1b')](_0x40f36a)['then'](function(_0x1e63ae){_0x3983d2['count']=_0x1e63ae;if(_0x479fb7[_0xb23f('0x2c')][_0xb23f('0x3c')]){_0x1bb19b[_0xb23f('0x3d')]=[{'all':!![]}];}return db[_0xb23f('0x27')][_0xb23f('0x3e')](_0x1bb19b);})[_0xb23f('0x22')](function(_0x107f39){_0x3983d2[_0xb23f('0x3f')]=_0x107f39;return _0x3983d2;})[_0xb23f('0x22')](respondWithFilteredResult(_0x2074fa,_0x1bb19b))[_0xb23f('0x40')](handleError(_0x2074fa,null));};exports[_0xb23f('0x41')]=function(_0x3b9e2f,_0x11cb13){var _0x2fb941={'raw':!![],'where':{'id':_0x3b9e2f[_0xb23f('0x42')]['id']}},_0xd51e56={};_0xd51e56[_0xb23f('0x2b')]=_[_0xb23f('0x43')](db['SugarcrmField']['rawAttributes']);_0xd51e56[_0xb23f('0x2c')]=_[_0xb23f('0x43')](_0x3b9e2f[_0xb23f('0x2c')]);_0xd51e56[_0xb23f('0x2d')]=_[_0xb23f('0x2e')](_0xd51e56[_0xb23f('0x2b')],_0xd51e56[_0xb23f('0x2c')]);_0x2fb941['attributes']=_[_0xb23f('0x2e')](_0xd51e56['model'],qs['fields'](_0x3b9e2f[_0xb23f('0x2c')][_0xb23f('0x2f')]));_0x2fb941['attributes']=_0x2fb941[_0xb23f('0x30')][_0xb23f('0x31')]?_0x2fb941[_0xb23f('0x30')]:_0xd51e56[_0xb23f('0x2b')];if(_0x3b9e2f[_0xb23f('0x2c')][_0xb23f('0x3c')]){_0x2fb941['include']=[{'all':!![]}];}_0x2fb941=_['merge']({},_0x2fb941,_0x3b9e2f[_0xb23f('0x3b')]);return db['SugarcrmField']['find'](_0x2fb941)[_0xb23f('0x22')](handleEntityNotFound(_0x11cb13,null))['then'](respondWithResult(_0x11cb13,null))['catch'](handleError(_0x11cb13,null));};exports[_0xb23f('0x44')]=function(_0x3ae0ea,_0x1d3d71){return db[_0xb23f('0x27')][_0xb23f('0x44')](_0x3ae0ea[_0xb23f('0x45')],{})[_0xb23f('0x22')](respondWithResult(_0x1d3d71,0xc9))[_0xb23f('0x40')](handleError(_0x1d3d71,null));};exports[_0xb23f('0x20')]=function(_0xd538cf,_0x4e1838){if(_0xd538cf[_0xb23f('0x45')]['id']){delete _0xd538cf[_0xb23f('0x45')]['id'];}return db[_0xb23f('0x27')][_0xb23f('0x46')]({'where':{'id':_0xd538cf['params']['id']}})[_0xb23f('0x22')](handleEntityNotFound(_0x4e1838,null))[_0xb23f('0x22')](saveUpdates(_0xd538cf['body'],null))[_0xb23f('0x22')](respondWithResult(_0x4e1838,null))['catch'](handleError(_0x4e1838,null));};exports[_0xb23f('0x21')]=function(_0x4a4e6,_0x1ade76){return db[_0xb23f('0x27')][_0xb23f('0x46')]({'where':{'id':_0x4a4e6[_0xb23f('0x42')]['id']}})[_0xb23f('0x22')](handleEntityNotFound(_0x1ade76,null))[_0xb23f('0x22')](removeEntity(_0x1ade76,null))[_0xb23f('0x40')](handleError(_0x1ade76,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 32bb7ee..5b81346 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 _0xff6f=['SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf','./intSugarcrmField.attributes','exports','define'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xff6f,0x17c));var _0xfff6=function(_0x418dab,_0xbf3a05){_0x418dab=_0x418dab-0x0;var _0x194a3a=_0xff6f[_0x418dab];return _0x194a3a;};'use strict';var _=require('lodash');var util=require(_0xfff6('0x0'));var logger=require(_0xfff6('0x1'))(_0xfff6('0x2'));var moment=require(_0xfff6('0x3'));var BPromise=require(_0xfff6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfff6('0x5'));var rimraf=require(_0xfff6('0x6'));var config=require('../../config/environment');var attributes=require(_0xfff6('0x7'));module[_0xfff6('0x8')]=function(_0xf89ab7,_0x5775be){return _0xf89ab7[_0xfff6('0x9')](_0xfff6('0xa'),attributes,{'tableName':_0xfff6('0xb'),'paranoid':![],'indexes':[{'name':_0xfff6('0xc'),'fields':[_0xfff6('0xd'),_0xfff6('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5356=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','int_sugarcrm_fields','idField'];(function(_0x56a1c9,_0x31d21e){var _0x4e5cdc=function(_0x4517b4){while(--_0x4517b4){_0x56a1c9['push'](_0x56a1c9['shift']());}};_0x4e5cdc(++_0x31d21e);}(_0x5356,0x11e));var _0x6535=function(_0x4893b0,_0x2e8249){_0x4893b0=_0x4893b0-0x0;var _0x3cf8e6=_0x5356[_0x4893b0];return _0x3cf8e6;};'use strict';var _=require(_0x6535('0x0'));var util=require(_0x6535('0x1'));var logger=require(_0x6535('0x2'))(_0x6535('0x3'));var moment=require(_0x6535('0x4'));var BPromise=require(_0x6535('0x5'));var rp=require(_0x6535('0x6'));var fs=require('fs');var path=require(_0x6535('0x7'));var rimraf=require(_0x6535('0x8'));var config=require(_0x6535('0x9'));var attributes=require(_0x6535('0xa'));module[_0x6535('0xb')]=function(_0x52cfe4,_0x27228f){return _0x52cfe4['define']('SugarcrmField',attributes,{'tableName':_0x6535('0xc'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x6535('0xd'),_0x6535('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 94a4ddc..4b35aee 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 _0x8603=['message','info','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','error'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x8603,0x190));var _0x3860=function(_0x164e20,_0x4613da){_0x164e20=_0x164e20-0x0;var _0x185d50=_0x8603[_0x164e20];return _0x185d50;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var moment=require(_0x3860('0x1'));var BPromise=require(_0x3860('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3860('0x3'))['db'];var utils=require(_0x3860('0x4'));var logger=require(_0x3860('0x5'))('rpc');var config=require(_0x3860('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3860('0x7')][_0x3860('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1eca44,_0xd3ce26,_0x472bf2){return new BPromise(function(_0x4aba10,_0x5c7350){return client['request'](_0x1eca44,_0x472bf2)[_0x3860('0x9')](function(_0x441dc4){logger['info'](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));logger['debug'](_0x3860('0xc'),_0xd3ce26,_0x3860('0xb'),JSON['stringify'](_0x441dc4));if(_0x441dc4[_0x3860('0xd')]){if(_0x441dc4[_0x3860('0xd')]['code']===0x1f4){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x5c7350(_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);}logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x4aba10(_0x441dc4['error'][_0x3860('0xe')]);}else{logger[_0x3860('0xf')](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));_0x4aba10(_0x441dc4[_0x3860('0x10')][_0x3860('0xe')]);}})[_0x3860('0x11')](function(_0x378305){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x378305);_0x5c7350(_0x378305);});});} \ No newline at end of file +var _0x5eb8=['info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x4741ea,_0x8968e6){var _0x6012bb=function(_0x388f3a){while(--_0x388f3a){_0x4741ea['push'](_0x4741ea['shift']());}};_0x6012bb(++_0x8968e6);}(_0x5eb8,0xb0));var _0x85eb=function(_0x35c2fc,_0xabea37){_0x35c2fc=_0x35c2fc-0x0;var _0x4727fd=_0x5eb8[_0x35c2fc];return _0x4727fd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8814,_0x16d7b9,_0x3af658){return new BPromise(function(_0x448345,_0x5cd4ec){return client[_0x85eb('0xc')](_0x4a8814,_0x3af658)['then'](function(_0x1f0036){logger[_0x85eb('0xd')](_0x85eb('0xe'),_0x16d7b9,_0x85eb('0xf'));logger[_0x85eb('0x10')](_0x85eb('0x11'),_0x16d7b9,_0x85eb('0xf'),JSON['stringify'](_0x1f0036));if(_0x1f0036[_0x85eb('0x12')]){if(_0x1f0036[_0x85eb('0x12')]['code']===0x1f4){logger[_0x85eb('0x12')](_0x85eb('0xe'),_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x5cd4ec(_0x1f0036['error']['message']);}logger[_0x85eb('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 05bc17f..9fe2fc3 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 _0x5616=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x34646f,_0x55a313){var _0x490624=function(_0x327c4f){while(--_0x327c4f){_0x34646f['push'](_0x34646f['shift']());}};_0x490624(++_0x55a313);}(_0x5616,0x19b));var _0x6561=function(_0x6556f3,_0x228c9c){_0x6556f3=_0x6556f3-0x0;var _0x173c20=_0x5616[_0x6556f3];return _0x173c20;};'use strict';var multer=require('multer');var util=require(_0x6561('0x0'));var path=require(_0x6561('0x1'));var timeout=require(_0x6561('0x2'));var express=require(_0x6561('0x3'));var router=express['Router']();var auth=require(_0x6561('0x4'));var interaction=require(_0x6561('0x5'));var config=require(_0x6561('0x6'));var controller=require(_0x6561('0x7'));router[_0x6561('0x8')]('/',auth[_0x6561('0x9')](),controller['index']);router[_0x6561('0x8')]('/:id',auth[_0x6561('0x9')](),controller[_0x6561('0xa')]);router['get'](_0x6561('0xb'),auth[_0x6561('0x9')](),controller['getConfigurations']);router['get'](_0x6561('0xc'),auth[_0x6561('0x9')](),controller[_0x6561('0xd')]);router[_0x6561('0xe')]('/',auth[_0x6561('0x9')](),controller[_0x6561('0xf')]);router[_0x6561('0xe')](_0x6561('0xb'),auth[_0x6561('0x9')](),controller[_0x6561('0x10')]);router[_0x6561('0x11')](_0x6561('0x12'),auth[_0x6561('0x9')](),controller[_0x6561('0x13')]);router[_0x6561('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x6561('0x15')]);module[_0x6561('0x16')]=router; \ No newline at end of file +var _0x7389=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','/:id','/:id/configurations','/:id/fields','getFields','create','addConfiguration','put','delete','destroy','multer','util'];(function(_0x465865,_0x2a3847){var _0x384c8b=function(_0x58dab5){while(--_0x58dab5){_0x465865['push'](_0x465865['shift']());}};_0x384c8b(++_0x2a3847);}(_0x7389,0x166));var _0x9738=function(_0x2335ce,_0x47e37d){_0x2335ce=_0x2335ce-0x0;var _0x340d14=_0x7389[_0x2335ce];return _0x340d14;};'use strict';var multer=require(_0x9738('0x0'));var util=require(_0x9738('0x1'));var path=require('path');var timeout=require(_0x9738('0x2'));var express=require(_0x9738('0x3'));var router=express[_0x9738('0x4')]();var auth=require(_0x9738('0x5'));var interaction=require(_0x9738('0x6'));var config=require(_0x9738('0x7'));var controller=require(_0x9738('0x8'));router[_0x9738('0x9')]('/',auth[_0x9738('0xa')](),controller['index']);router['get'](_0x9738('0xb'),auth[_0x9738('0xa')](),controller['show']);router[_0x9738('0x9')](_0x9738('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x9738('0x9')](_0x9738('0xd'),auth[_0x9738('0xa')](),controller[_0x9738('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9738('0xf')]);router['post'](_0x9738('0xc'),auth['isAuthenticated'](),controller[_0x9738('0x10')]);router[_0x9738('0x11')](_0x9738('0xb'),auth[_0x9738('0xa')](),controller['update']);router[_0x9738('0x12')](_0x9738('0xb'),auth[_0x9738('0xa')](),controller[_0x9738('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index bcee120..87d5c1d 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 _0xd4ef=['HelpDesk','STRING'];(function(_0x4c083b,_0x90e77d){var _0x318bbe=function(_0x2c77e0){while(--_0x2c77e0){_0x4c083b['push'](_0x4c083b['shift']());}};_0x318bbe(++_0x90e77d);}(_0xd4ef,0x17f));var _0xfd4e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4ef[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xfd4e('0x0')]},'username':{'type':Sequelize[_0xfd4e('0x0')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfd4e('0x1')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING']},'accessKey':{'type':Sequelize[_0xfd4e('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x9493=['STRING','sequelize','exports'];(function(_0x44b655,_0x596e94){var _0x46d4fc=function(_0x14c112){while(--_0x14c112){_0x44b655['push'](_0x44b655['shift']());}};_0x46d4fc(++_0x596e94);}(_0x9493,0x64));var _0x3949=function(_0x2f03e4,_0x729330){_0x2f03e4=_0x2f03e4-0x0;var _0x5cbbaf=_0x9493[_0x2f03e4];return _0x5cbbaf;};'use strict';var Sequelize=require(_0x3949('0x0'));module[_0x3949('0x1')]={'name':{'type':Sequelize[_0x3949('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3949('0x2')]},'username':{'type':Sequelize[_0x3949('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x3949('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x3949('0x2')]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index d967a4f..f9e0fd8 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 _0xdf5d=['moduleName','remoteUri','serverUrl','accessKey','slice','substring','%s/webservice.php','GET','getchallenge','POST','login','success','describe','autogenerated','reference','remove','includes','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','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','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','end','status','json','offset','limit','update','then','destroy','stack','name','send','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','findAll','params','include','find','create','body','getConfigurations','findOne','VtigerConfiguration','length','addConfiguration','Subjects','getSubjects','getDescriptions','channel','VtigerField','Descriptions','getFields','username','description'];(function(_0x25f96c,_0x1baacf){var _0x2289a3=function(_0x271219){while(--_0x271219){_0x25f96c['push'](_0x25f96c['shift']());}};_0x2289a3(++_0x1baacf);}(_0xdf5d,0x126));var _0xddf5=function(_0x539c44,_0x33e0e6){_0x539c44=_0x539c44-0x0;var _0x5a3f6f=_0xdf5d[_0x539c44];return _0x5a3f6f;};'use strict';var pdf=require(_0xddf5('0x0'));var emlformat=require(_0xddf5('0x1'));var rimraf=require(_0xddf5('0x2'));var zipdir=require(_0xddf5('0x3'));var jsonpatch=require(_0xddf5('0x4'));var rp=require(_0xddf5('0x5'));var moment=require(_0xddf5('0x6'));var BPromise=require(_0xddf5('0x7'));var Mustache=require('mustache');var util=require(_0xddf5('0x8'));var path=require(_0xddf5('0x9'));var sox=require(_0xddf5('0xa'));var csv=require(_0xddf5('0xb'));var ejs=require(_0xddf5('0xc'));var fs=require('fs');var _=require(_0xddf5('0xd'));var squel=require(_0xddf5('0xe'));var crypto=require(_0xddf5('0xf'));var jsforce=require(_0xddf5('0x10'));var deskjs=require(_0xddf5('0x11'));var toCsv=require(_0xddf5('0xb'));var querystring=require(_0xddf5('0x12'));var Papa=require(_0xddf5('0x13'));var Redis=require(_0xddf5('0x14'));var authService=require(_0xddf5('0x15'));var qs=require(_0xddf5('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xddf5('0x17'));var logger=require(_0xddf5('0x18'))(_0xddf5('0x19'));var utils=require(_0xddf5('0x1a'));var config=require(_0xddf5('0x1b'));var db=require(_0xddf5('0x1c'))['db'];var integrations=require(_0xddf5('0x1d'));var jayson=require(_0xddf5('0x1e'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0xf4c5b5,_0x3782b9,_0x31a822){if(_0x31a822){var _0x3df24c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3df24c[_0xddf5('0x1f')](_0x3782b9)){return _0xf4c5b5;}else{throw new db[(_0xddf5('0x20'))][(_0xddf5('0x21'))](_0xddf5('0x22'));}}else{return _0xf4c5b5;}}function respondWithRpcPromise(_0x49cdfc,_0xe3e3e8,_0x2b2dad,_0x3dd408){return new BPromise(function(_0x1c0c30,_0x19a039){var _0x5ef952=_0x3dd408||client;return _0x5ef952[_0xddf5('0x23')](_0x49cdfc,_0x2b2dad)['then'](function(_0x183a2b){logger['info'](_0xddf5('0x24'),_0xe3e3e8,_0xddf5('0x25'));logger[_0xddf5('0x26')](_0xddf5('0x27'),_0xe3e3e8,'request\x20sent',JSON['stringify'](_0x183a2b));if(_0x183a2b[_0xddf5('0x28')]){if(_0x183a2b[_0xddf5('0x28')][_0xddf5('0x29')]===0x1f4){logger[_0xddf5('0x28')]('VtigerAccount,\x20%s,\x20%s',_0xe3e3e8,_0x183a2b['error'][_0xddf5('0x2a')]);return _0x19a039(_0x183a2b[_0xddf5('0x28')][_0xddf5('0x2a')]);}logger['error'](_0xddf5('0x24'),_0xe3e3e8,_0x183a2b[_0xddf5('0x28')][_0xddf5('0x2a')]);return _0x1c0c30(_0x183a2b[_0xddf5('0x28')]['message']);}else{logger[_0xddf5('0x2b')](_0xddf5('0x24'),_0xe3e3e8,'request\x20sent');_0x1c0c30(_0x183a2b[_0xddf5('0x2c')][_0xddf5('0x2a')]);}})[_0xddf5('0x2d')](function(_0x12ece7){logger['error'](_0xddf5('0x24'),_0xe3e3e8,_0x12ece7);_0x19a039(_0x12ece7);});});}function respondWithStatusCode(_0xc75eb8,_0x256ff0){_0x256ff0=_0x256ff0||0xcc;return function(_0x1eca6a){if(_0x1eca6a){return _0xc75eb8[_0xddf5('0x2e')](_0x256ff0);}return _0xc75eb8['status'](_0x256ff0)[_0xddf5('0x2f')]();};}function respondWithResult(_0x35fc2b,_0x5c0451){_0x5c0451=_0x5c0451||0xc8;return function(_0x4821b7){if(_0x4821b7){return _0x35fc2b[_0xddf5('0x30')](_0x5c0451)[_0xddf5('0x31')](_0x4821b7);}};}function respondWithFilteredResult(_0x1d493e,_0x174cd7){return function(_0x3be6f4){if(_0x3be6f4){var _0x1a476d=_0x3be6f4['count'],_0x5a3548=_0x174cd7[_0xddf5('0x32')],_0x26f43c=_0x174cd7[_0xddf5('0x32')]+_0x174cd7[_0xddf5('0x33')],_0x228073;if(_0x26f43c>=_0x1a476d){_0x26f43c=_0x1a476d;_0x228073=0xc8;}else{_0x228073=0xce;}_0x1d493e['status'](_0x228073);return _0x1d493e['set']('Content-Range',_0x5a3548+'-'+_0x26f43c+'/'+_0x1a476d)[_0xddf5('0x31')](_0x3be6f4);}return null;};}function patchUpdates(_0x25e11e){return function(_0x391c68){try{jsonpatch['apply'](_0x391c68,_0x25e11e,!![]);}catch(_0x3d1c7a){return BPromise['reject'](_0x3d1c7a);}return _0x391c68['save']();};}function saveUpdates(_0x577ee0,_0x129f37){return function(_0x2faf35){if(_0x2faf35){return _0x2faf35[_0xddf5('0x34')](_0x577ee0)[_0xddf5('0x35')](function(_0x11cee5){return _0x11cee5;});}return null;};}function removeEntity(_0x49e5a9,_0x1eca4e){return function(_0x53e916){if(_0x53e916){return _0x53e916[_0xddf5('0x36')]()[_0xddf5('0x35')](function(){_0x49e5a9['status'](0xcc)[_0xddf5('0x2f')]();});}};}function handleEntityNotFound(_0x1fd693,_0x22d01f){return function(_0x431e53){if(!_0x431e53){_0x1fd693[_0xddf5('0x2e')](0x194);}return _0x431e53;};}function handleError(_0x4e0b6f,_0x873d16){_0x873d16=_0x873d16||0x1f4;return function(_0x5478cf){logger[_0xddf5('0x28')](_0x5478cf[_0xddf5('0x37')]);if(_0x5478cf['name']){delete _0x5478cf[_0xddf5('0x38')];}_0x4e0b6f['status'](_0x873d16)[_0xddf5('0x39')](_0x5478cf);};}exports['index']=function(_0x5982d3,_0x1b4cde){var _0x51f6c7={},_0x29ac40={},_0x2cc66b={'count':0x0,'rows':[]};var _0x466ccb=_[_0xddf5('0x3a')](db[_0xddf5('0x3b')][_0xddf5('0x3c')],function(_0x10b7a7){return{'name':_0x10b7a7[_0xddf5('0x3d')],'type':_0x10b7a7[_0xddf5('0x3e')][_0xddf5('0x3f')]};});_0x29ac40[_0xddf5('0x40')]=_[_0xddf5('0x3a')](_0x466ccb,_0xddf5('0x38'));_0x29ac40[_0xddf5('0x41')]=_[_0xddf5('0x42')](_0x5982d3[_0xddf5('0x41')]);_0x29ac40[_0xddf5('0x43')]=_[_0xddf5('0x44')](_0x29ac40['model'],_0x29ac40[_0xddf5('0x41')]);_0x51f6c7[_0xddf5('0x45')]=_[_0xddf5('0x44')](_0x29ac40[_0xddf5('0x40')],qs[_0xddf5('0x46')](_0x5982d3['query']['fields']));_0x51f6c7['attributes']=_0x51f6c7[_0xddf5('0x45')]['length']?_0x51f6c7['attributes']:_0x29ac40[_0xddf5('0x40')];if(!_0x5982d3[_0xddf5('0x41')][_0xddf5('0x47')](_0xddf5('0x48'))){_0x51f6c7[_0xddf5('0x33')]=qs[_0xddf5('0x33')](_0x5982d3[_0xddf5('0x41')][_0xddf5('0x33')]);_0x51f6c7[_0xddf5('0x32')]=qs[_0xddf5('0x32')](_0x5982d3['query']['offset']);}_0x51f6c7[_0xddf5('0x49')]=qs[_0xddf5('0x4a')](_0x5982d3['query']['sort']);_0x51f6c7[_0xddf5('0x4b')]=qs[_0xddf5('0x43')](_[_0xddf5('0x4c')](_0x5982d3[_0xddf5('0x41')],_0x29ac40['filters']));if(_0x5982d3['query'][_0xddf5('0x4d')]){_0x51f6c7[_0xddf5('0x4b')]=_['merge'](_0x51f6c7[_0xddf5('0x4b')],{'$or':_[_0xddf5('0x3a')](_0x466ccb,function(_0x4fa051){if(_0x4fa051[_0xddf5('0x3e')]!=='VIRTUAL'){var _0x378e6e={};_0x378e6e[_0x4fa051[_0xddf5('0x38')]]={'$like':'%'+_0x5982d3[_0xddf5('0x41')]['filter']+'%'};return _0x378e6e;}})});}_0x51f6c7=_[_0xddf5('0x4e')]({},_0x51f6c7,_0x5982d3[_0xddf5('0x4f')]);var _0xd4df47={'where':_0x51f6c7[_0xddf5('0x4b')]};return db[_0xddf5('0x3b')][_0xddf5('0x50')](_0xd4df47)['then'](function(_0x1cacbb){_0x2cc66b[_0xddf5('0x50')]=_0x1cacbb;if(_0x5982d3[_0xddf5('0x41')][_0xddf5('0x51')]){_0x51f6c7['include']=[{'all':!![]}];}return db[_0xddf5('0x3b')][_0xddf5('0x52')](_0x51f6c7);})[_0xddf5('0x35')](function(_0x35b4f2){_0x2cc66b['rows']=_0x35b4f2;return _0x2cc66b;})[_0xddf5('0x35')](respondWithFilteredResult(_0x1b4cde,_0x51f6c7))[_0xddf5('0x2d')](handleError(_0x1b4cde,null));};exports['show']=function(_0x2ea645,_0x597f15){var _0x1727c6={'raw':![],'where':{'id':_0x2ea645[_0xddf5('0x53')]['id']}},_0x2a2ca7={};_0x2a2ca7[_0xddf5('0x40')]=_['keys'](db[_0xddf5('0x3b')][_0xddf5('0x3c')]);_0x2a2ca7['query']=_[_0xddf5('0x42')](_0x2ea645['query']);_0x2a2ca7['filters']=_[_0xddf5('0x44')](_0x2a2ca7[_0xddf5('0x40')],_0x2a2ca7[_0xddf5('0x41')]);_0x1727c6[_0xddf5('0x45')]=_[_0xddf5('0x44')](_0x2a2ca7[_0xddf5('0x40')],qs['fields'](_0x2ea645[_0xddf5('0x41')][_0xddf5('0x46')]));_0x1727c6[_0xddf5('0x45')]=_0x1727c6[_0xddf5('0x45')]['length']?_0x1727c6[_0xddf5('0x45')]:_0x2a2ca7[_0xddf5('0x40')];if(_0x2ea645['query'][_0xddf5('0x51')]){_0x1727c6[_0xddf5('0x54')]=[{'all':!![]}];}_0x1727c6=_['merge']({},_0x1727c6,_0x2ea645[_0xddf5('0x4f')]);return db['VtigerAccount'][_0xddf5('0x55')](_0x1727c6)['then'](handleEntityNotFound(_0x597f15,null))['then'](respondWithResult(_0x597f15,null))['catch'](handleError(_0x597f15,null));};exports[_0xddf5('0x56')]=function(_0x306bd3,_0x41e5c0){return db[_0xddf5('0x3b')][_0xddf5('0x56')](_0x306bd3[_0xddf5('0x57')],{})[_0xddf5('0x35')](respondWithResult(_0x41e5c0,0xc9))[_0xddf5('0x2d')](handleError(_0x41e5c0,null));};exports[_0xddf5('0x34')]=function(_0x18e068,_0x57f2a4){if(_0x18e068[_0xddf5('0x57')]['id']){delete _0x18e068[_0xddf5('0x57')]['id'];}return db[_0xddf5('0x3b')][_0xddf5('0x55')]({'where':{'id':_0x18e068[_0xddf5('0x53')]['id']}})['then'](handleEntityNotFound(_0x57f2a4,null))[_0xddf5('0x35')](saveUpdates(_0x18e068['body'],null))[_0xddf5('0x35')](respondWithResult(_0x57f2a4,null))[_0xddf5('0x2d')](handleError(_0x57f2a4,null));};exports['destroy']=function(_0x11a516,_0x49257e){return db[_0xddf5('0x3b')]['find']({'where':{'id':_0x11a516['params']['id']}})[_0xddf5('0x35')](handleEntityNotFound(_0x49257e,null))[_0xddf5('0x35')](removeEntity(_0x49257e,null))[_0xddf5('0x2d')](handleError(_0x49257e,null));};exports[_0xddf5('0x58')]=function(_0xb62de0,_0x1c4022,_0x51d244){var _0x418278={};var _0x9d3d33={};var _0x120ba8;var _0x346c5c;return db['VtigerAccount'][_0xddf5('0x59')]({'where':{'id':_0xb62de0[_0xddf5('0x53')]['id']}})[_0xddf5('0x35')](handleEntityNotFound(_0x1c4022,null))['then'](function(_0x298dbf){if(_0x298dbf){_0x120ba8=_0x298dbf;_0x9d3d33[_0xddf5('0x40')]=_[_0xddf5('0x42')](db[_0xddf5('0x5a')][_0xddf5('0x3c')]);_0x9d3d33[_0xddf5('0x41')]=_[_0xddf5('0x42')](_0xb62de0[_0xddf5('0x41')]);_0x9d3d33[_0xddf5('0x43')]=_[_0xddf5('0x44')](_0x9d3d33[_0xddf5('0x40')],_0x9d3d33[_0xddf5('0x41')]);_0x418278[_0xddf5('0x45')]=_['intersection'](_0x9d3d33[_0xddf5('0x40')],qs['fields'](_0xb62de0[_0xddf5('0x41')][_0xddf5('0x46')]));_0x418278[_0xddf5('0x45')]=_0x418278[_0xddf5('0x45')][_0xddf5('0x5b')]?_0x418278[_0xddf5('0x45')]:_0x9d3d33['model'];_0x418278[_0xddf5('0x49')]=qs[_0xddf5('0x4a')](_0xb62de0[_0xddf5('0x41')][_0xddf5('0x4a')]);_0x418278[_0xddf5('0x4b')]=qs['filters'](_['pick'](_0xb62de0[_0xddf5('0x41')],_0x9d3d33[_0xddf5('0x43')]));if(_0xb62de0[_0xddf5('0x41')][_0xddf5('0x4d')]){_0x418278['where']=_['merge'](_0x418278[_0xddf5('0x4b')],{'$or':_[_0xddf5('0x3a')](_0x418278[_0xddf5('0x45')],function(_0x3853ac){var _0x9277af={};_0x9277af[_0x3853ac]={'$like':'%'+_0xb62de0[_0xddf5('0x41')][_0xddf5('0x4d')]+'%'};return _0x9277af;})});}_0x418278=_['merge']({},_0x418278,_0xb62de0['options']);return _0x120ba8['getConfigurations'](_0x418278);}})[_0xddf5('0x35')](function(_0x2b90d8){if(_0x2b90d8){_0x346c5c=_0x2b90d8[_0xddf5('0x5b')];if(!_0xb62de0[_0xddf5('0x41')][_0xddf5('0x47')](_0xddf5('0x48'))){_0x418278[_0xddf5('0x33')]=qs['limit'](_0xb62de0[_0xddf5('0x41')][_0xddf5('0x33')]);_0x418278['offset']=qs[_0xddf5('0x32')](_0xb62de0[_0xddf5('0x41')][_0xddf5('0x32')]);}return _0x120ba8[_0xddf5('0x58')](_0x418278);}})['then'](function(_0x23641f){if(_0x23641f){return _0x23641f?{'count':_0x346c5c,'rows':_0x23641f}:null;}})[_0xddf5('0x35')](respondWithResult(_0x1c4022,null))[_0xddf5('0x2d')](handleError(_0x1c4022,null));};exports[_0xddf5('0x5c')]=function(_0x22463b,_0x3f7c95,_0x551666){if(_0x22463b[_0xddf5('0x57')]['id']){delete _0x22463b['body']['id'];}return db['VtigerAccount'][_0xddf5('0x59')]({'where':{'id':_0x22463b['params']['id']}})[_0xddf5('0x35')](handleEntityNotFound(_0x3f7c95,null))[_0xddf5('0x35')](function(_0xd0a191){if(_0xd0a191){_0x22463b[_0xddf5('0x57')]['AccountId']=_0xd0a191['id'];_0x22463b[_0xddf5('0x57')][_0xddf5('0x5d')]=integrations[_0xddf5('0x5e')](_0x22463b[_0xddf5('0x57')]['channel'],_0x22463b[_0xddf5('0x57')]['type']);_0x22463b[_0xddf5('0x57')]['Descriptions']=integrations[_0xddf5('0x5f')](_0x22463b[_0xddf5('0x57')][_0xddf5('0x60')],_0x22463b[_0xddf5('0x57')]['type']);return db['VtigerConfiguration']['create'](_0x22463b[_0xddf5('0x57')],{'include':[{'model':db[_0xddf5('0x61')],'as':_0xddf5('0x5d')},{'model':db[_0xddf5('0x61')],'as':_0xddf5('0x62')}]});}return null;})[_0xddf5('0x35')](respondWithResult(_0x3f7c95,null))[_0xddf5('0x2d')](handleError(_0x3f7c95,null));};var md5=require('md5');exports[_0xddf5('0x63')]=function(_0x2d2cc9,_0x5d66c9,_0x289874){var _0x46274f=null;var _0x673df9=null;var _0x3dd053=null;var _0x4f3560=null;var _0x47e468='';return db['VtigerAccount'][_0xddf5('0x59')]({'where':{'id':_0x2d2cc9['params']['id']},'attributes':['id','name',_0xddf5('0x64'),_0xddf5('0x65'),_0xddf5('0x66'),_0xddf5('0x67'),_0xddf5('0x68'),_0xddf5('0x69')]})[_0xddf5('0x35')](handleEntityNotFound(_0x5d66c9,null))['then'](function(_0x5d5afb){if(_0x5d5afb){_0x46274f=_0x5d5afb[_0xddf5('0x64')];_0x673df9=_0x5d5afb[_0xddf5('0x69')];_0x3dd053=_0x5d5afb['moduleName'];_0x47e468=_0x5d5afb[_0xddf5('0x67')];var _0x5962b4=_0x47e468[_0xddf5('0x6a')](-0x1);if(_0x5962b4==='/'){_0x47e468=_0x47e468[_0xddf5('0x6b')](0x0,_0x47e468['lastIndexOf'](_0x5962b4));}_0x4f3560=util['format'](_0xddf5('0x6c'),_0x47e468);var _0x3c8d38={'method':_0xddf5('0x6d'),'uri':_0x4f3560,'qs':{'operation':_0xddf5('0x6e'),'username':_0x5d5afb[_0xddf5('0x64')]},'json':!![]};return rp(_0x3c8d38);}})[_0xddf5('0x35')](function(_0xa2d0f5){if(_0xa2d0f5['success']){var _0x1bb4fa={'method':_0xddf5('0x6f'),'uri':_0x4f3560,'form':{'operation':_0xddf5('0x70'),'username':_0x46274f,'accessKey':md5(_0xa2d0f5['result']['token']+_0x673df9)},'json':!![]};return rp(_0x1bb4fa);}})['then'](function(_0x57a830){if(_0x57a830[_0xddf5('0x71')]){var _0x3e88b7={'method':'GET','uri':_0x4f3560,'qs':{'operation':_0xddf5('0x72'),'username':_0x46274f,'sessionName':_0x57a830[_0xddf5('0x2c')]['sessionName'],'elementType':_0x3dd053},'json':!![]};return rp(_0x3e88b7);}})[_0xddf5('0x35')](function(_0xedf2d){if(_0xedf2d[_0xddf5('0x71')]){var _0x57f5fa=[_0xddf5('0x73'),_0xddf5('0x74'),'owner'];_[_0xddf5('0x75')](_0xedf2d[_0xddf5('0x2c')][_0xddf5('0x46')],function(_0x6a98a1){return _0x57f5fa[_0xddf5('0x76')](_0x6a98a1['type'][_0xddf5('0x38')]);});_[_0xddf5('0x75')](_0xedf2d[_0xddf5('0x2c')][_0xddf5('0x46')],function(_0x46d144){return _0x46d144['editable']===_0xddf5('0x77');});return{'count':_0xedf2d['result'][_0xddf5('0x46')][_0xddf5('0x5b')],'rows':_[_0xddf5('0x3a')](_0xedf2d[_0xddf5('0x2c')][_0xddf5('0x46')],function(_0x2500cf){return{'id':_0x2500cf[_0xddf5('0x38')],'name':_0x2500cf[_0xddf5('0x78')],'custom':_[_0xddf5('0x79')](_0x2500cf[_0xddf5('0x38')],_0xddf5('0x7a'))?!![]:![],'options':_0x2500cf[_0xddf5('0x3e')][_0xddf5('0x38')]===_0xddf5('0x7b')&&_0x2500cf['type'][_0xddf5('0x7c')]['length']>0x0?_[_0xddf5('0x3a')](_0x2500cf[_0xddf5('0x3e')]['picklistValues'],function(_0x1030d6){return{'name':_0x1030d6['label'],'value':_0x1030d6[_0xddf5('0x7d')]};}):[]};})};}})[_0xddf5('0x35')](respondWithResult(_0x5d66c9,null))['catch'](function(_0x540338){console[_0xddf5('0x7e')](_0xddf5('0x7f')+_0x540338);var _0x20851d=_0x2d2cc9[_0xddf5('0x41')][_0xddf5('0x1f')]?0x1f4:_0x540338[_0xddf5('0x80')]||0x1f4;logger[_0xddf5('0x28')](_0xddf5('0x81'),_0xddf5('0x63'),_0x20851d,JSON[_0xddf5('0x82')](_0x540338));delete _0x540338[_0xddf5('0x38')];if(_0x20851d===0x191){_0x20851d=0x190;}_0x5d66c9[_0xddf5('0x30')](_0x20851d)[_0xddf5('0x39')](_0x2d2cc9[_0xddf5('0x41')]['test']?{'message':_0xddf5('0x83'),'statusCode':_0x540338[_0xddf5('0x80')]}:_0x540338);});}; \ No newline at end of file +var _0x83d9=['include','findAll','rows','show','params','options','find','create','body','update','getConfigurations','findOne','VtigerConfiguration','pick','hasOwnProperty','AccountId','Subjects','getSubjects','Descriptions','channel','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','success','login','token','GET','describe','sessionName','autogenerated','reference','owner','includes','remove','editable','label','startsWith','picklist','picklistValues','value','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../components/integrations/configuration','test','Sequelize','ValidationError','request','then','request\x20sent','debug','stringify','error','code','message','VtigerAccount,\x20%s,\x20%s','info','result','catch','sendStatus','json','count','offset','limit','status','set','Content-Range','apply','save','destroy','end','stack','name','send','index','map','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','VtigerAccount','includeAll'];(function(_0x2e5217,_0x4f14a5){var _0x2b35f8=function(_0x360fcd){while(--_0x360fcd){_0x2e5217['push'](_0x2e5217['shift']());}};_0x2b35f8(++_0x4f14a5);}(_0x83d9,0x134));var _0x983d=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x83d9[_0x9aada2];return _0x196dff;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x983d('0x0'));var rimraf=require(_0x983d('0x1'));var zipdir=require(_0x983d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x983d('0x3'));var Mustache=require(_0x983d('0x4'));var util=require(_0x983d('0x5'));var path=require(_0x983d('0x6'));var sox=require(_0x983d('0x7'));var csv=require(_0x983d('0x8'));var ejs=require(_0x983d('0x9'));var fs=require('fs');var _=require(_0x983d('0xa'));var squel=require(_0x983d('0xb'));var crypto=require(_0x983d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x983d('0x8'));var querystring=require(_0x983d('0xd'));var Papa=require('papaparse');var Redis=require(_0x983d('0xe'));var authService=require(_0x983d('0xf'));var qs=require(_0x983d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x983d('0x11'));var logger=require(_0x983d('0x12'))(_0x983d('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x983d('0x14'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x35bd6f,_0x165a8a,_0x26c313){if(_0x26c313){var _0x9f87ff=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x9f87ff[_0x983d('0x15')](_0x165a8a)){return _0x35bd6f;}else{throw new db[(_0x983d('0x16'))][(_0x983d('0x17'))]('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 _0x35bd6f;}}function respondWithRpcPromise(_0x39c63f,_0x5847ee,_0x2cf3a5,_0x39abb6){return new BPromise(function(_0x3358d1,_0x5de9a2){var _0x23caa9=_0x39abb6||client;return _0x23caa9[_0x983d('0x18')](_0x39c63f,_0x2cf3a5)[_0x983d('0x19')](function(_0x25f5d0){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x5847ee,_0x983d('0x1a'));logger[_0x983d('0x1b')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x5847ee,_0x983d('0x1a'),JSON[_0x983d('0x1c')](_0x25f5d0));if(_0x25f5d0[_0x983d('0x1d')]){if(_0x25f5d0[_0x983d('0x1d')][_0x983d('0x1e')]===0x1f4){logger[_0x983d('0x1d')]('VtigerAccount,\x20%s,\x20%s',_0x5847ee,_0x25f5d0[_0x983d('0x1d')][_0x983d('0x1f')]);return _0x5de9a2(_0x25f5d0[_0x983d('0x1d')][_0x983d('0x1f')]);}logger[_0x983d('0x1d')](_0x983d('0x20'),_0x5847ee,_0x25f5d0[_0x983d('0x1d')][_0x983d('0x1f')]);return _0x3358d1(_0x25f5d0['error'][_0x983d('0x1f')]);}else{logger[_0x983d('0x21')](_0x983d('0x20'),_0x5847ee,'request\x20sent');_0x3358d1(_0x25f5d0[_0x983d('0x22')]['message']);}})[_0x983d('0x23')](function(_0x1e2a8f){logger[_0x983d('0x1d')](_0x983d('0x20'),_0x5847ee,_0x1e2a8f);_0x5de9a2(_0x1e2a8f);});});}function respondWithStatusCode(_0x1ab414,_0x45ce11){_0x45ce11=_0x45ce11||0xcc;return function(_0x3d2252){if(_0x3d2252){return _0x1ab414[_0x983d('0x24')](_0x45ce11);}return _0x1ab414['status'](_0x45ce11)['end']();};}function respondWithResult(_0x4bdacb,_0x553d18){_0x553d18=_0x553d18||0xc8;return function(_0x114367){if(_0x114367){return _0x4bdacb['status'](_0x553d18)[_0x983d('0x25')](_0x114367);}};}function respondWithFilteredResult(_0x108f2b,_0x56c6e1){return function(_0x26e987){if(_0x26e987){var _0x1578d8=_0x26e987[_0x983d('0x26')],_0x32202f=_0x56c6e1[_0x983d('0x27')],_0x3878dd=_0x56c6e1[_0x983d('0x27')]+_0x56c6e1[_0x983d('0x28')],_0x2b70f8;if(_0x3878dd>=_0x1578d8){_0x3878dd=_0x1578d8;_0x2b70f8=0xc8;}else{_0x2b70f8=0xce;}_0x108f2b[_0x983d('0x29')](_0x2b70f8);return _0x108f2b[_0x983d('0x2a')](_0x983d('0x2b'),_0x32202f+'-'+_0x3878dd+'/'+_0x1578d8)['json'](_0x26e987);}return null;};}function patchUpdates(_0x39209b){return function(_0x94c9cc){try{jsonpatch[_0x983d('0x2c')](_0x94c9cc,_0x39209b,!![]);}catch(_0x1f1116){return BPromise['reject'](_0x1f1116);}return _0x94c9cc[_0x983d('0x2d')]();};}function saveUpdates(_0x47a303,_0x292503){return function(_0x631435){if(_0x631435){return _0x631435['update'](_0x47a303)[_0x983d('0x19')](function(_0x63e4ba){return _0x63e4ba;});}return null;};}function removeEntity(_0x2a6b43,_0x51e43e){return function(_0x58b2dd){if(_0x58b2dd){return _0x58b2dd[_0x983d('0x2e')]()[_0x983d('0x19')](function(){_0x2a6b43[_0x983d('0x29')](0xcc)[_0x983d('0x2f')]();});}};}function handleEntityNotFound(_0x558418,_0x411659){return function(_0x377847){if(!_0x377847){_0x558418[_0x983d('0x24')](0x194);}return _0x377847;};}function handleError(_0x351ec3,_0x1c06cd){_0x1c06cd=_0x1c06cd||0x1f4;return function(_0xa506d3){logger['error'](_0xa506d3[_0x983d('0x30')]);if(_0xa506d3[_0x983d('0x31')]){delete _0xa506d3[_0x983d('0x31')];}_0x351ec3[_0x983d('0x29')](_0x1c06cd)[_0x983d('0x32')](_0xa506d3);};}exports[_0x983d('0x33')]=function(_0x33b034,_0xc1c9bf){var _0x4f9a04={},_0x587d96={},_0x23f5a3={'count':0x0,'rows':[]};var _0x4f0b9b=_[_0x983d('0x34')](db['VtigerAccount'][_0x983d('0x35')],function(_0x53f784){return{'name':_0x53f784['fieldName'],'type':_0x53f784[_0x983d('0x36')][_0x983d('0x37')]};});_0x587d96[_0x983d('0x38')]=_[_0x983d('0x34')](_0x4f0b9b,_0x983d('0x31'));_0x587d96['query']=_[_0x983d('0x39')](_0x33b034['query']);_0x587d96[_0x983d('0x3a')]=_[_0x983d('0x3b')](_0x587d96['model'],_0x587d96[_0x983d('0x3c')]);_0x4f9a04[_0x983d('0x3d')]=_[_0x983d('0x3b')](_0x587d96[_0x983d('0x38')],qs[_0x983d('0x3e')](_0x33b034[_0x983d('0x3c')][_0x983d('0x3e')]));_0x4f9a04['attributes']=_0x4f9a04['attributes'][_0x983d('0x3f')]?_0x4f9a04[_0x983d('0x3d')]:_0x587d96[_0x983d('0x38')];if(!_0x33b034['query']['hasOwnProperty'](_0x983d('0x40'))){_0x4f9a04[_0x983d('0x28')]=qs[_0x983d('0x28')](_0x33b034[_0x983d('0x3c')][_0x983d('0x28')]);_0x4f9a04[_0x983d('0x27')]=qs[_0x983d('0x27')](_0x33b034[_0x983d('0x3c')]['offset']);}_0x4f9a04[_0x983d('0x41')]=qs[_0x983d('0x42')](_0x33b034[_0x983d('0x3c')][_0x983d('0x42')]);_0x4f9a04[_0x983d('0x43')]=qs[_0x983d('0x3a')](_['pick'](_0x33b034[_0x983d('0x3c')],_0x587d96[_0x983d('0x3a')]));if(_0x33b034[_0x983d('0x3c')][_0x983d('0x44')]){_0x4f9a04['where']=_[_0x983d('0x45')](_0x4f9a04[_0x983d('0x43')],{'$or':_[_0x983d('0x34')](_0x4f0b9b,function(_0x5b8375){if(_0x5b8375[_0x983d('0x36')]!==_0x983d('0x46')){var _0x2e3e9b={};_0x2e3e9b[_0x5b8375['name']]={'$like':'%'+_0x33b034[_0x983d('0x3c')][_0x983d('0x44')]+'%'};return _0x2e3e9b;}})});}_0x4f9a04=_[_0x983d('0x45')]({},_0x4f9a04,_0x33b034['options']);var _0x5e19a3={'where':_0x4f9a04[_0x983d('0x43')]};return db[_0x983d('0x47')]['count'](_0x5e19a3)[_0x983d('0x19')](function(_0x11aba3){_0x23f5a3[_0x983d('0x26')]=_0x11aba3;if(_0x33b034[_0x983d('0x3c')][_0x983d('0x48')]){_0x4f9a04[_0x983d('0x49')]=[{'all':!![]}];}return db[_0x983d('0x47')][_0x983d('0x4a')](_0x4f9a04);})[_0x983d('0x19')](function(_0x19b455){_0x23f5a3[_0x983d('0x4b')]=_0x19b455;return _0x23f5a3;})[_0x983d('0x19')](respondWithFilteredResult(_0xc1c9bf,_0x4f9a04))['catch'](handleError(_0xc1c9bf,null));};exports[_0x983d('0x4c')]=function(_0x4e2557,_0x17b5b9){var _0x3f55e1={'raw':![],'where':{'id':_0x4e2557[_0x983d('0x4d')]['id']}},_0x2c29b5={};_0x2c29b5['model']=_[_0x983d('0x39')](db[_0x983d('0x47')][_0x983d('0x35')]);_0x2c29b5[_0x983d('0x3c')]=_[_0x983d('0x39')](_0x4e2557['query']);_0x2c29b5[_0x983d('0x3a')]=_[_0x983d('0x3b')](_0x2c29b5[_0x983d('0x38')],_0x2c29b5[_0x983d('0x3c')]);_0x3f55e1[_0x983d('0x3d')]=_[_0x983d('0x3b')](_0x2c29b5[_0x983d('0x38')],qs[_0x983d('0x3e')](_0x4e2557[_0x983d('0x3c')]['fields']));_0x3f55e1[_0x983d('0x3d')]=_0x3f55e1[_0x983d('0x3d')]['length']?_0x3f55e1[_0x983d('0x3d')]:_0x2c29b5[_0x983d('0x38')];if(_0x4e2557['query']['includeAll']){_0x3f55e1[_0x983d('0x49')]=[{'all':!![]}];}_0x3f55e1=_[_0x983d('0x45')]({},_0x3f55e1,_0x4e2557[_0x983d('0x4e')]);return db[_0x983d('0x47')][_0x983d('0x4f')](_0x3f55e1)['then'](handleEntityNotFound(_0x17b5b9,null))[_0x983d('0x19')](respondWithResult(_0x17b5b9,null))[_0x983d('0x23')](handleError(_0x17b5b9,null));};exports[_0x983d('0x50')]=function(_0x35f891,_0x260d0f){return db['VtigerAccount'][_0x983d('0x50')](_0x35f891[_0x983d('0x51')],{})[_0x983d('0x19')](respondWithResult(_0x260d0f,0xc9))[_0x983d('0x23')](handleError(_0x260d0f,null));};exports[_0x983d('0x52')]=function(_0x5a3cbc,_0x19e422){if(_0x5a3cbc[_0x983d('0x51')]['id']){delete _0x5a3cbc[_0x983d('0x51')]['id'];}return db[_0x983d('0x47')]['find']({'where':{'id':_0x5a3cbc['params']['id']}})[_0x983d('0x19')](handleEntityNotFound(_0x19e422,null))[_0x983d('0x19')](saveUpdates(_0x5a3cbc[_0x983d('0x51')],null))[_0x983d('0x19')](respondWithResult(_0x19e422,null))[_0x983d('0x23')](handleError(_0x19e422,null));};exports[_0x983d('0x2e')]=function(_0x54c113,_0x718d5c){return db[_0x983d('0x47')]['find']({'where':{'id':_0x54c113[_0x983d('0x4d')]['id']}})[_0x983d('0x19')](handleEntityNotFound(_0x718d5c,null))[_0x983d('0x19')](removeEntity(_0x718d5c,null))[_0x983d('0x23')](handleError(_0x718d5c,null));};exports[_0x983d('0x53')]=function(_0x2d0f83,_0x1f2b35,_0x3f9173){var _0x231c20={};var _0x3fef17={};var _0x5bcd1c;var _0xfb8b09;return db[_0x983d('0x47')][_0x983d('0x54')]({'where':{'id':_0x2d0f83[_0x983d('0x4d')]['id']}})[_0x983d('0x19')](handleEntityNotFound(_0x1f2b35,null))[_0x983d('0x19')](function(_0x3e9429){if(_0x3e9429){_0x5bcd1c=_0x3e9429;_0x3fef17[_0x983d('0x38')]=_['keys'](db[_0x983d('0x55')][_0x983d('0x35')]);_0x3fef17[_0x983d('0x3c')]=_[_0x983d('0x39')](_0x2d0f83[_0x983d('0x3c')]);_0x3fef17[_0x983d('0x3a')]=_[_0x983d('0x3b')](_0x3fef17[_0x983d('0x38')],_0x3fef17[_0x983d('0x3c')]);_0x231c20['attributes']=_[_0x983d('0x3b')](_0x3fef17[_0x983d('0x38')],qs[_0x983d('0x3e')](_0x2d0f83[_0x983d('0x3c')][_0x983d('0x3e')]));_0x231c20[_0x983d('0x3d')]=_0x231c20[_0x983d('0x3d')][_0x983d('0x3f')]?_0x231c20[_0x983d('0x3d')]:_0x3fef17[_0x983d('0x38')];_0x231c20[_0x983d('0x41')]=qs[_0x983d('0x42')](_0x2d0f83[_0x983d('0x3c')][_0x983d('0x42')]);_0x231c20['where']=qs['filters'](_[_0x983d('0x56')](_0x2d0f83[_0x983d('0x3c')],_0x3fef17[_0x983d('0x3a')]));if(_0x2d0f83[_0x983d('0x3c')][_0x983d('0x44')]){_0x231c20['where']=_[_0x983d('0x45')](_0x231c20[_0x983d('0x43')],{'$or':_[_0x983d('0x34')](_0x231c20[_0x983d('0x3d')],function(_0x53179e){var _0x50bab4={};_0x50bab4[_0x53179e]={'$like':'%'+_0x2d0f83[_0x983d('0x3c')][_0x983d('0x44')]+'%'};return _0x50bab4;})});}_0x231c20=_[_0x983d('0x45')]({},_0x231c20,_0x2d0f83[_0x983d('0x4e')]);return _0x5bcd1c[_0x983d('0x53')](_0x231c20);}})[_0x983d('0x19')](function(_0x5151e2){if(_0x5151e2){_0xfb8b09=_0x5151e2[_0x983d('0x3f')];if(!_0x2d0f83[_0x983d('0x3c')][_0x983d('0x57')](_0x983d('0x40'))){_0x231c20[_0x983d('0x28')]=qs[_0x983d('0x28')](_0x2d0f83[_0x983d('0x3c')][_0x983d('0x28')]);_0x231c20['offset']=qs[_0x983d('0x27')](_0x2d0f83[_0x983d('0x3c')]['offset']);}return _0x5bcd1c[_0x983d('0x53')](_0x231c20);}})[_0x983d('0x19')](function(_0xb4ec9d){if(_0xb4ec9d){return _0xb4ec9d?{'count':_0xfb8b09,'rows':_0xb4ec9d}:null;}})[_0x983d('0x19')](respondWithResult(_0x1f2b35,null))[_0x983d('0x23')](handleError(_0x1f2b35,null));};exports['addConfiguration']=function(_0x5d47f8,_0x384c05,_0xaae0fd){if(_0x5d47f8[_0x983d('0x51')]['id']){delete _0x5d47f8[_0x983d('0x51')]['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0x5d47f8[_0x983d('0x4d')]['id']}})[_0x983d('0x19')](handleEntityNotFound(_0x384c05,null))[_0x983d('0x19')](function(_0x172544){if(_0x172544){_0x5d47f8['body'][_0x983d('0x58')]=_0x172544['id'];_0x5d47f8[_0x983d('0x51')][_0x983d('0x59')]=integrations[_0x983d('0x5a')](_0x5d47f8[_0x983d('0x51')]['channel'],_0x5d47f8['body'][_0x983d('0x36')]);_0x5d47f8[_0x983d('0x51')][_0x983d('0x5b')]=integrations['getDescriptions'](_0x5d47f8[_0x983d('0x51')][_0x983d('0x5c')],_0x5d47f8[_0x983d('0x51')][_0x983d('0x36')]);return db[_0x983d('0x55')]['create'](_0x5d47f8['body'],{'include':[{'model':db[_0x983d('0x5d')],'as':'Subjects'},{'model':db[_0x983d('0x5d')],'as':_0x983d('0x5b')}]});}return null;})[_0x983d('0x19')](respondWithResult(_0x384c05,null))['catch'](handleError(_0x384c05,null));};var md5=require(_0x983d('0x5e'));exports[_0x983d('0x5f')]=function(_0x1e8d8c,_0x51d852,_0x2bcbdd){var _0x9bb83=null;var _0x5de979=null;var _0x530d43=null;var _0x302f01=null;var _0x19b14a='';return db['VtigerAccount'][_0x983d('0x54')]({'where':{'id':_0x1e8d8c[_0x983d('0x4d')]['id']},'attributes':['id','name',_0x983d('0x60'),_0x983d('0x61'),_0x983d('0x62'),_0x983d('0x63'),_0x983d('0x64'),_0x983d('0x65')]})[_0x983d('0x19')](handleEntityNotFound(_0x51d852,null))[_0x983d('0x19')](function(_0x203dc2){if(_0x203dc2){_0x9bb83=_0x203dc2[_0x983d('0x60')];_0x5de979=_0x203dc2[_0x983d('0x65')];_0x530d43=_0x203dc2[_0x983d('0x62')];_0x19b14a=_0x203dc2[_0x983d('0x63')];var _0x54a576=_0x19b14a[_0x983d('0x66')](-0x1);if(_0x54a576==='/'){_0x19b14a=_0x19b14a[_0x983d('0x67')](0x0,_0x19b14a[_0x983d('0x68')](_0x54a576));}_0x302f01=util[_0x983d('0x69')]('%s/webservice.php',_0x19b14a);var _0xb7417e={'method':'GET','uri':_0x302f01,'qs':{'operation':'getchallenge','username':_0x203dc2[_0x983d('0x60')]},'json':!![]};return rp(_0xb7417e);}})[_0x983d('0x19')](function(_0x5d5597){if(_0x5d5597[_0x983d('0x6a')]){var _0x3a1f57={'method':'POST','uri':_0x302f01,'form':{'operation':_0x983d('0x6b'),'username':_0x9bb83,'accessKey':md5(_0x5d5597['result'][_0x983d('0x6c')]+_0x5de979)},'json':!![]};return rp(_0x3a1f57);}})[_0x983d('0x19')](function(_0x1ee825){if(_0x1ee825['success']){var _0x203df8={'method':_0x983d('0x6d'),'uri':_0x302f01,'qs':{'operation':_0x983d('0x6e'),'username':_0x9bb83,'sessionName':_0x1ee825[_0x983d('0x22')][_0x983d('0x6f')],'elementType':_0x530d43},'json':!![]};return rp(_0x203df8);}})[_0x983d('0x19')](function(_0x51d30b){if(_0x51d30b[_0x983d('0x6a')]){var _0x3b02d6=[_0x983d('0x70'),_0x983d('0x71'),_0x983d('0x72')];_['remove'](_0x51d30b[_0x983d('0x22')][_0x983d('0x3e')],function(_0xb7968){return _0x3b02d6[_0x983d('0x73')](_0xb7968[_0x983d('0x36')][_0x983d('0x31')]);});_[_0x983d('0x74')](_0x51d30b[_0x983d('0x22')][_0x983d('0x3e')],function(_0x501b85){return _0x501b85[_0x983d('0x75')]==='false';});return{'count':_0x51d30b['result'][_0x983d('0x3e')][_0x983d('0x3f')],'rows':_[_0x983d('0x34')](_0x51d30b[_0x983d('0x22')][_0x983d('0x3e')],function(_0x36b6ad){return{'id':_0x36b6ad['name'],'name':_0x36b6ad[_0x983d('0x76')],'custom':_[_0x983d('0x77')](_0x36b6ad[_0x983d('0x31')],'cf_')?!![]:![],'options':_0x36b6ad[_0x983d('0x36')][_0x983d('0x31')]===_0x983d('0x78')&&_0x36b6ad[_0x983d('0x36')][_0x983d('0x79')][_0x983d('0x3f')]>0x0?_['map'](_0x36b6ad[_0x983d('0x36')]['picklistValues'],function(_0x1d920e){return{'name':_0x1d920e[_0x983d('0x76')],'value':_0x1d920e[_0x983d('0x7a')]};}):[]};})};}})[_0x983d('0x19')](respondWithResult(_0x51d852,null))[_0x983d('0x23')](function(_0x5dc038){console['log'](_0x983d('0x7b')+_0x5dc038);var _0x2f0076=_0x1e8d8c[_0x983d('0x3c')][_0x983d('0x15')]?0x1f4:_0x5dc038[_0x983d('0x7c')]||0x1f4;logger[_0x983d('0x1d')](_0x983d('0x7d'),'getFields',_0x2f0076,JSON[_0x983d('0x1c')](_0x5dc038));delete _0x5dc038[_0x983d('0x31')];if(_0x2f0076===0x191){_0x2f0076=0x190;}_0x51d852[_0x983d('0x29')](_0x2f0076)[_0x983d('0x32')](_0x1e8d8c[_0x983d('0x3c')][_0x983d('0x15')]?{'message':_0x983d('0x7e'),'statusCode':_0x5dc038['statusCode']}:_0x5dc038);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 7cfaa4d..f09db9c 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 _0xafb9=['define','VtigerAccount','util','api','moment','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x189c9e,_0x1c3b55){var _0x3f38ca=function(_0x4c05ec){while(--_0x4c05ec){_0x189c9e['push'](_0x189c9e['shift']());}};_0x3f38ca(++_0x1c3b55);}(_0xafb9,0x1a6));var _0x9afb=function(_0x236efb,_0x2bc7f9){_0x236efb=_0x236efb-0x0;var _0x3979c9=_0xafb9[_0x236efb];return _0x3979c9;};'use strict';var _=require('lodash');var util=require(_0x9afb('0x0'));var logger=require('../../config/logger')(_0x9afb('0x1'));var moment=require(_0x9afb('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9afb('0x3'));var config=require(_0x9afb('0x4'));var attributes=require(_0x9afb('0x5'));var integrations=require(_0x9afb('0x6'));module[_0x9afb('0x7')]=function(_0x2c4cfe,_0x573f0e){return _0x2c4cfe[_0x9afb('0x8')](_0x9afb('0x9'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac81=['./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','int_vtiger_accounts','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x663925,_0x2472bf){var _0x56f612=function(_0x1ca9b6){while(--_0x1ca9b6){_0x663925['push'](_0x663925['shift']());}};_0x56f612(++_0x2472bf);}(_0xac81,0x95));var _0x1ac8=function(_0x45c412,_0x25178d){_0x45c412=_0x45c412-0x0;var _0xd08e54=_0xac81[_0x45c412];return _0xd08e54;};'use strict';var _=require(_0x1ac8('0x0'));var util=require('util');var logger=require(_0x1ac8('0x1'))('api');var moment=require(_0x1ac8('0x2'));var BPromise=require(_0x1ac8('0x3'));var rp=require(_0x1ac8('0x4'));var fs=require('fs');var path=require(_0x1ac8('0x5'));var rimraf=require(_0x1ac8('0x6'));var config=require('../../config/environment');var attributes=require(_0x1ac8('0x7'));var integrations=require(_0x1ac8('0x8'));module['exports']=function(_0x2c7e65,_0x4dd462){return _0x2c7e65[_0x1ac8('0x9')](_0x1ac8('0xa'),attributes,{'tableName':_0x1ac8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 445e13e..fdafd73 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 _0x924d=['findAll','options','raw','where','attributes','limit','include','map','model','then','ShowVtigerAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount'];(function(_0x2ab377,_0x3c93d5){var _0x498a84=function(_0xf0836c){while(--_0xf0836c){_0x2ab377['push'](_0x2ab377['shift']());}};_0x498a84(++_0x3c93d5);}(_0x924d,0x115));var _0xd924=function(_0x24b8ec,_0x3c8c5b){_0x24b8ec=_0x24b8ec-0x0;var _0x1d1b63=_0x924d[_0x24b8ec];return _0x1d1b63;};'use strict';var _=require(_0xd924('0x0'));var util=require(_0xd924('0x1'));var moment=require('moment');var BPromise=require(_0xd924('0x2'));var rs=require(_0xd924('0x3'));var fs=require('fs');var Redis=require(_0xd924('0x4'));var db=require(_0xd924('0x5'))['db'];var utils=require(_0xd924('0x6'));var logger=require(_0xd924('0x7'))(_0xd924('0x8'));var config=require(_0xd924('0x9'));var jayson=require(_0xd924('0xa'));var client=jayson[_0xd924('0xb')][_0xd924('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x52fa09,_0x223874,_0x21d1da){return new BPromise(function(_0x120b77,_0x2e2200){return client[_0xd924('0xd')](_0x52fa09,_0x21d1da)['then'](function(_0xa8e4e){logger[_0xd924('0xe')](_0xd924('0xf'),_0x223874,_0xd924('0x10'));logger[_0xd924('0x11')](_0xd924('0x12'),_0x223874,_0xd924('0x10'),JSON[_0xd924('0x13')](_0xa8e4e));if(_0xa8e4e[_0xd924('0x14')]){if(_0xa8e4e[_0xd924('0x14')][_0xd924('0x15')]===0x1f4){logger[_0xd924('0x14')](_0xd924('0xf'),_0x223874,_0xa8e4e[_0xd924('0x14')]['message']);return _0x2e2200(_0xa8e4e[_0xd924('0x14')][_0xd924('0x16')]);}logger[_0xd924('0x14')](_0xd924('0xf'),_0x223874,_0xa8e4e[_0xd924('0x14')]['message']);return _0x120b77(_0xa8e4e[_0xd924('0x14')][_0xd924('0x16')]);}else{logger[_0xd924('0xe')](_0xd924('0xf'),_0x223874,_0xd924('0x10'));_0x120b77(_0xa8e4e[_0xd924('0x17')][_0xd924('0x16')]);}})[_0xd924('0x18')](function(_0x528d64){logger[_0xd924('0x14')]('VtigerAccount,\x20%s,\x20%s',_0x223874,_0x528d64);_0x2e2200(_0x528d64);});});}exports[_0xd924('0x19')]=function(_0x1ebe46){var _0x4ebcca=this;return new Promise(function(_0x1b29bd,_0x2e17e3){return db[_0xd924('0x1a')][_0xd924('0x1b')]({'raw':_0x1ebe46[_0xd924('0x1c')]?_0x1ebe46[_0xd924('0x1c')][_0xd924('0x1d')]===undefined?!![]:![]:!![],'where':_0x1ebe46[_0xd924('0x1c')]?_0x1ebe46[_0xd924('0x1c')][_0xd924('0x1e')]||null:null,'attributes':_0x1ebe46[_0xd924('0x1c')]?_0x1ebe46['options'][_0xd924('0x1f')]||null:null,'limit':_0x1ebe46[_0xd924('0x1c')]?_0x1ebe46[_0xd924('0x1c')][_0xd924('0x20')]||null:null,'include':_0x1ebe46[_0xd924('0x1c')]?_0x1ebe46[_0xd924('0x1c')][_0xd924('0x21')]?_[_0xd924('0x22')](_0x1ebe46[_0xd924('0x1c')][_0xd924('0x21')],function(_0x36ac79){return{'model':db[_0x36ac79['model']],'as':_0x36ac79['as'],'attributes':_0x36ac79[_0xd924('0x1f')],'include':_0x36ac79[_0xd924('0x21')]?_[_0xd924('0x22')](_0x36ac79[_0xd924('0x21')],function(_0x8c5daf){return{'model':db[_0x8c5daf[_0xd924('0x23')]],'as':_0x8c5daf['as'],'attributes':_0x8c5daf[_0xd924('0x1f')],'include':_0x8c5daf[_0xd924('0x21')]?_[_0xd924('0x22')](_0x8c5daf[_0xd924('0x21')],function(_0x22d554){return{'model':db[_0x22d554['model']],'as':_0x22d554['as'],'attributes':_0x22d554['attributes']};}):[]};}):[]};}):[]:[]})[_0xd924('0x24')](function(_0x181011){logger['info']('GetVtigerAccount',_0x1ebe46);logger[_0xd924('0x11')]('GetVtigerAccount',_0x1ebe46,JSON[_0xd924('0x13')](_0x181011));_0x1b29bd(_0x181011);})[_0xd924('0x18')](function(_0x4fb5a8){logger['error']('GetVtigerAccount',_0x4fb5a8['message'],_0x1ebe46);_0x2e17e3(_0x4ebcca['error'](0x1f4,_0x4fb5a8[_0xd924('0x16')]));});});};exports[_0xd924('0x25')]=function(_0x45b5ee){var _0x511d76=this;return new Promise(function(_0x33644a,_0x304e6f){return db[_0xd924('0x1a')]['find']({'raw':_0x45b5ee[_0xd924('0x1c')]?_0x45b5ee[_0xd924('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x45b5ee[_0xd924('0x1c')]?_0x45b5ee[_0xd924('0x1c')][_0xd924('0x1e')]||null:null,'attributes':_0x45b5ee[_0xd924('0x1c')]?_0x45b5ee[_0xd924('0x1c')][_0xd924('0x1f')]||null:null,'include':_0x45b5ee[_0xd924('0x1c')]?_0x45b5ee[_0xd924('0x1c')][_0xd924('0x21')]?_[_0xd924('0x22')](_0x45b5ee['options'][_0xd924('0x21')],function(_0x13e7a6){return{'model':db[_0x13e7a6[_0xd924('0x23')]],'as':_0x13e7a6['as'],'attributes':_0x13e7a6['attributes'],'include':_0x13e7a6[_0xd924('0x21')]?_[_0xd924('0x22')](_0x13e7a6[_0xd924('0x21')],function(_0x298fc4){return{'model':db[_0x298fc4[_0xd924('0x23')]],'as':_0x298fc4['as'],'attributes':_0x298fc4[_0xd924('0x1f')],'include':_0x298fc4[_0xd924('0x21')]?_[_0xd924('0x22')](_0x298fc4[_0xd924('0x21')],function(_0xa48e6c){return{'model':db[_0xa48e6c[_0xd924('0x23')]],'as':_0xa48e6c['as'],'attributes':_0xa48e6c[_0xd924('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd924('0x24')](function(_0x81ce7a){logger[_0xd924('0xe')](_0xd924('0x25'),_0x45b5ee);logger[_0xd924('0x11')](_0xd924('0x25'),_0x45b5ee,JSON[_0xd924('0x13')](_0x81ce7a));_0x33644a(_0x81ce7a);})['catch'](function(_0x119aae){logger[_0xd924('0x14')]('ShowVtigerAccount',_0x119aae[_0xd924('0x16')],_0x45b5ee);_0x304e6f(_0x511d76['error'](0x1f4,_0x119aae['message']));});});}; \ No newline at end of file +var _0xb240=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVtigerAccount','findAll','where','attributes','options','include','model','map','then','debug','ShowVtigerAccount','VtigerAccount','raw','util','moment','bluebird','randomstring','ioredis'];(function(_0x8cb71e,_0x11f748){var _0x4b6185=function(_0x9254b8){while(--_0x9254b8){_0x8cb71e['push'](_0x8cb71e['shift']());}};_0x4b6185(++_0x11f748);}(_0xb240,0x187));var _0x0b24=function(_0x128496,_0x203f96){_0x128496=_0x128496-0x0;var _0x39943a=_0xb240[_0x128496];return _0x39943a;};'use strict';var _=require('lodash');var util=require(_0x0b24('0x0'));var moment=require(_0x0b24('0x1'));var BPromise=require(_0x0b24('0x2'));var rs=require(_0x0b24('0x3'));var fs=require('fs');var Redis=require(_0x0b24('0x4'));var db=require(_0x0b24('0x5'))['db'];var utils=require(_0x0b24('0x6'));var logger=require(_0x0b24('0x7'))('rpc');var config=require(_0x0b24('0x8'));var jayson=require(_0x0b24('0x9'));var client=jayson[_0x0b24('0xa')][_0x0b24('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1db98d,_0x494ce5,_0xcde20d){return new BPromise(function(_0xd075f8,_0x2228b5){return client[_0x0b24('0xc')](_0x1db98d,_0xcde20d)['then'](function(_0x47dfce){logger['info'](_0x0b24('0xd'),_0x494ce5,_0x0b24('0xe'));logger['debug'](_0x0b24('0xf'),_0x494ce5,_0x0b24('0xe'),JSON[_0x0b24('0x10')](_0x47dfce));if(_0x47dfce[_0x0b24('0x11')]){if(_0x47dfce[_0x0b24('0x11')][_0x0b24('0x12')]===0x1f4){logger[_0x0b24('0x11')](_0x0b24('0xd'),_0x494ce5,_0x47dfce[_0x0b24('0x11')][_0x0b24('0x13')]);return _0x2228b5(_0x47dfce[_0x0b24('0x11')][_0x0b24('0x13')]);}logger[_0x0b24('0x11')](_0x0b24('0xd'),_0x494ce5,_0x47dfce[_0x0b24('0x11')][_0x0b24('0x13')]);return _0xd075f8(_0x47dfce[_0x0b24('0x11')]['message']);}else{logger[_0x0b24('0x14')](_0x0b24('0xd'),_0x494ce5,_0x0b24('0xe'));_0xd075f8(_0x47dfce[_0x0b24('0x15')][_0x0b24('0x13')]);}})[_0x0b24('0x16')](function(_0x3c805f){logger['error'](_0x0b24('0xd'),_0x494ce5,_0x3c805f);_0x2228b5(_0x3c805f);});});}exports[_0x0b24('0x17')]=function(_0x3cbfe3){var _0x36bca2=this;return new Promise(function(_0x1b3d87,_0x246e1a){return db['VtigerAccount'][_0x0b24('0x18')]({'raw':_0x3cbfe3['options']?_0x3cbfe3['options']['raw']===undefined?!![]:![]:!![],'where':_0x3cbfe3['options']?_0x3cbfe3['options'][_0x0b24('0x19')]||null:null,'attributes':_0x3cbfe3['options']?_0x3cbfe3['options'][_0x0b24('0x1a')]||null:null,'limit':_0x3cbfe3[_0x0b24('0x1b')]?_0x3cbfe3[_0x0b24('0x1b')]['limit']||null:null,'include':_0x3cbfe3[_0x0b24('0x1b')]?_0x3cbfe3['options'][_0x0b24('0x1c')]?_['map'](_0x3cbfe3['options'][_0x0b24('0x1c')],function(_0x2d44df){return{'model':db[_0x2d44df[_0x0b24('0x1d')]],'as':_0x2d44df['as'],'attributes':_0x2d44df['attributes'],'include':_0x2d44df['include']?_[_0x0b24('0x1e')](_0x2d44df[_0x0b24('0x1c')],function(_0x2bf959){return{'model':db[_0x2bf959[_0x0b24('0x1d')]],'as':_0x2bf959['as'],'attributes':_0x2bf959[_0x0b24('0x1a')],'include':_0x2bf959[_0x0b24('0x1c')]?_[_0x0b24('0x1e')](_0x2bf959[_0x0b24('0x1c')],function(_0x4bc559){return{'model':db[_0x4bc559[_0x0b24('0x1d')]],'as':_0x4bc559['as'],'attributes':_0x4bc559[_0x0b24('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0b24('0x1f')](function(_0x5bef3b){logger[_0x0b24('0x14')]('GetVtigerAccount',_0x3cbfe3);logger[_0x0b24('0x20')](_0x0b24('0x17'),_0x3cbfe3,JSON['stringify'](_0x5bef3b));_0x1b3d87(_0x5bef3b);})[_0x0b24('0x16')](function(_0x1a343b){logger[_0x0b24('0x11')](_0x0b24('0x17'),_0x1a343b['message'],_0x3cbfe3);_0x246e1a(_0x36bca2['error'](0x1f4,_0x1a343b['message']));});});};exports[_0x0b24('0x21')]=function(_0x32ad0e){var _0x5454d4=this;return new Promise(function(_0x3151dc,_0x33857b){return db[_0x0b24('0x22')]['find']({'raw':_0x32ad0e[_0x0b24('0x1b')]?_0x32ad0e[_0x0b24('0x1b')][_0x0b24('0x23')]===undefined?!![]:![]:!![],'where':_0x32ad0e[_0x0b24('0x1b')]?_0x32ad0e['options'][_0x0b24('0x19')]||null:null,'attributes':_0x32ad0e[_0x0b24('0x1b')]?_0x32ad0e[_0x0b24('0x1b')]['attributes']||null:null,'include':_0x32ad0e[_0x0b24('0x1b')]?_0x32ad0e['options'][_0x0b24('0x1c')]?_[_0x0b24('0x1e')](_0x32ad0e['options'][_0x0b24('0x1c')],function(_0x9532de){return{'model':db[_0x9532de[_0x0b24('0x1d')]],'as':_0x9532de['as'],'attributes':_0x9532de[_0x0b24('0x1a')],'include':_0x9532de[_0x0b24('0x1c')]?_[_0x0b24('0x1e')](_0x9532de[_0x0b24('0x1c')],function(_0x135cc4){return{'model':db[_0x135cc4[_0x0b24('0x1d')]],'as':_0x135cc4['as'],'attributes':_0x135cc4['attributes'],'include':_0x135cc4[_0x0b24('0x1c')]?_[_0x0b24('0x1e')](_0x135cc4[_0x0b24('0x1c')],function(_0x322ce8){return{'model':db[_0x322ce8[_0x0b24('0x1d')]],'as':_0x322ce8['as'],'attributes':_0x322ce8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ed6c9){logger['info']('ShowVtigerAccount',_0x32ad0e);logger[_0x0b24('0x20')](_0x0b24('0x21'),_0x32ad0e,JSON[_0x0b24('0x10')](_0x4ed6c9));_0x3151dc(_0x4ed6c9);})[_0x0b24('0x16')](function(_0x20c000){logger[_0x0b24('0x11')](_0x0b24('0x21'),_0x20c000['message'],_0x32ad0e);_0x33857b(_0x5454d4[_0x0b24('0x11')](0x1f4,_0x20c000[_0x0b24('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 5da66dc..d1d54d5 100644 --- a/server/api/intVtigerConfiguration/index.js +++ b/server/api/intVtigerConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x5cff9d,_0x30ec88){var _0x4390e4=function(_0x3491b7){while(--_0x3491b7){_0x5cff9d['push'](_0x5cff9d['shift']());}};_0x4390e4(++_0x30ec88);}(_0xb10b,0x12a));var _0xbb10=function(_0x100682,_0x11afec){_0x100682=_0x100682-0x0;var _0xcb6e87=_0xb10b[_0x100682];return _0xcb6e87;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router; \ No newline at end of file +var _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x1d9041,_0x54637c){var _0x3c0f3f=function(_0x4a8dfd){while(--_0x4a8dfd){_0x1d9041['push'](_0x1d9041['shift']());}};_0x3c0f3f(++_0x54637c);}(_0xb10b,0x12a));var _0xbb10=function(_0x13945b,_0x289c94){_0x13945b=_0x13945b-0x0;var _0x1b1643=_0xb10b[_0x13945b];return _0x1b1643;};'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 78e5498..673f69e 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 _0x3267=['STRING','sequelize','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x3267,0x15d));var _0x7326=function(_0x3a3758,_0x4dd8cf){_0x3a3758=_0x3a3758-0x0;var _0x1a9234=_0x3267[_0x3a3758];return _0x1a9234;};'use strict';var Sequelize=require(_0x7326('0x0'));module[_0x7326('0x1')]={'name':{'type':Sequelize[_0x7326('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9bbc=['STRING','sequelize'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x9bbc,0x143));var _0xc9bb=function(_0x172427,_0x5024a9){_0x172427=_0x172427-0x0;var _0x294052=_0x9bbc[_0x172427];return _0x294052;};'use strict';var Sequelize=require(_0xc9bb('0x0'));module['exports']={'name':{'type':Sequelize[_0xc9bb('0x1')]},'description':{'type':Sequelize[_0xc9bb('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 8fd4790..72effbc 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 _0xa87b=['../../config/environment','client','http','test','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','status','json','offset','limit','set','apply','reject','save','update','destroy','end','sendStatus','name','send','VtigerConfiguration','rawAttributes','type','query','keys','filters','model','attributes','intersection','fields','sort','where','pick','filter','merge','map','VIRTUAL','options','count','includeAll','include','findAll','show','params','length','find','create','body','getFields','findOne','order','hasOwnProperty','VtigerField','getSubjects','nolimit','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x1490d2,_0x533695){var _0x3da74d=function(_0x11c454){while(--_0x11c454){_0x1490d2['push'](_0x1490d2['shift']());}};_0x3da74d(++_0x533695);}(_0xa87b,0x199));var _0xba87=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa87b[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xba87('0x0'));var emlformat=require(_0xba87('0x1'));var rimraf=require(_0xba87('0x2'));var zipdir=require(_0xba87('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xba87('0x4'));var moment=require('moment');var BPromise=require(_0xba87('0x5'));var Mustache=require(_0xba87('0x6'));var util=require(_0xba87('0x7'));var path=require(_0xba87('0x8'));var sox=require(_0xba87('0x9'));var csv=require(_0xba87('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xba87('0xb'));var squel=require(_0xba87('0xc'));var crypto=require('crypto');var jsforce=require(_0xba87('0xd'));var deskjs=require(_0xba87('0xe'));var toCsv=require(_0xba87('0xa'));var querystring=require('querystring');var Papa=require(_0xba87('0xf'));var Redis=require(_0xba87('0x10'));var authService=require(_0xba87('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xba87('0x12'));var hardwareService=require(_0xba87('0x13'));var logger=require(_0xba87('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xba87('0x15'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xba87('0x16')][_0xba87('0x17')]({'port':0x232a});function checkPasswordPattern(_0x17cac0,_0x425c45,_0x5e3450){if(_0x5e3450){var _0x5d016b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5d016b[_0xba87('0x18')](_0x425c45)){return _0x17cac0;}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 _0x17cac0;}}function respondWithRpcPromise(_0x24133c,_0x46dbfb,_0x3313cd,_0x1f572e){return new BPromise(function(_0x331d47,_0x2bb9fa){var _0x2ebd0c=_0x1f572e||client;return _0x2ebd0c[_0xba87('0x19')](_0x24133c,_0x3313cd)[_0xba87('0x1a')](function(_0x1a7f9f){logger[_0xba87('0x1b')](_0xba87('0x1c'),_0x46dbfb,_0xba87('0x1d'));logger[_0xba87('0x1e')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x46dbfb,_0xba87('0x1d'),JSON[_0xba87('0x1f')](_0x1a7f9f));if(_0x1a7f9f['error']){if(_0x1a7f9f[_0xba87('0x20')]['code']===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x46dbfb,_0x1a7f9f[_0xba87('0x20')]['message']);return _0x2bb9fa(_0x1a7f9f[_0xba87('0x20')][_0xba87('0x21')]);}logger[_0xba87('0x20')](_0xba87('0x1c'),_0x46dbfb,_0x1a7f9f['error'][_0xba87('0x21')]);return _0x331d47(_0x1a7f9f['error'][_0xba87('0x21')]);}else{logger[_0xba87('0x1b')](_0xba87('0x1c'),_0x46dbfb,'request\x20sent');_0x331d47(_0x1a7f9f[_0xba87('0x22')][_0xba87('0x21')]);}})[_0xba87('0x23')](function(_0x2e5351){logger[_0xba87('0x20')]('VtigerConfiguration,\x20%s,\x20%s',_0x46dbfb,_0x2e5351);_0x2bb9fa(_0x2e5351);});});}function respondWithStatusCode(_0x2b3076,_0x3f368e){_0x3f368e=_0x3f368e||0xcc;return function(_0x359525){if(_0x359525){return _0x2b3076['sendStatus'](_0x3f368e);}return _0x2b3076['status'](_0x3f368e)['end']();};}function respondWithResult(_0x56c04c,_0x2305c2){_0x2305c2=_0x2305c2||0xc8;return function(_0x4a5111){if(_0x4a5111){return _0x56c04c[_0xba87('0x24')](_0x2305c2)[_0xba87('0x25')](_0x4a5111);}};}function respondWithFilteredResult(_0x4daa09,_0x24113d){return function(_0x17f62c){if(_0x17f62c){var _0x22d970=_0x17f62c['count'],_0x2b4861=_0x24113d[_0xba87('0x26')],_0x370b17=_0x24113d[_0xba87('0x26')]+_0x24113d[_0xba87('0x27')],_0x40a0cb;if(_0x370b17>=_0x22d970){_0x370b17=_0x22d970;_0x40a0cb=0xc8;}else{_0x40a0cb=0xce;}_0x4daa09[_0xba87('0x24')](_0x40a0cb);return _0x4daa09[_0xba87('0x28')]('Content-Range',_0x2b4861+'-'+_0x370b17+'/'+_0x22d970)[_0xba87('0x25')](_0x17f62c);}return null;};}function patchUpdates(_0x2a01a1){return function(_0x5cf174){try{jsonpatch[_0xba87('0x29')](_0x5cf174,_0x2a01a1,!![]);}catch(_0x3f55ca){return BPromise[_0xba87('0x2a')](_0x3f55ca);}return _0x5cf174[_0xba87('0x2b')]();};}function saveUpdates(_0x3fd3f3,_0x5b7d8c){return function(_0x3532e5){if(_0x3532e5){return _0x3532e5[_0xba87('0x2c')](_0x3fd3f3)[_0xba87('0x1a')](function(_0x234103){return _0x234103;});}return null;};}function removeEntity(_0x334df0,_0x538c0f){return function(_0x3bd3f1){if(_0x3bd3f1){return _0x3bd3f1[_0xba87('0x2d')]()[_0xba87('0x1a')](function(){_0x334df0['status'](0xcc)[_0xba87('0x2e')]();});}};}function handleEntityNotFound(_0x2932f9,_0x4c1b1b){return function(_0x5739bb){if(!_0x5739bb){_0x2932f9[_0xba87('0x2f')](0x194);}return _0x5739bb;};}function handleError(_0x206190,_0x15eb72){_0x15eb72=_0x15eb72||0x1f4;return function(_0x5cd922){logger[_0xba87('0x20')](_0x5cd922['stack']);if(_0x5cd922[_0xba87('0x30')]){delete _0x5cd922['name'];}_0x206190['status'](_0x15eb72)[_0xba87('0x31')](_0x5cd922);};}exports['index']=function(_0x58f09c,_0x444b1c){var _0x3e7b5f={},_0x28d5ea={},_0x3dec7f={'count':0x0,'rows':[]};var _0x3fd2d9=_['map'](db[_0xba87('0x32')][_0xba87('0x33')],function(_0x2fc404){return{'name':_0x2fc404['fieldName'],'type':_0x2fc404[_0xba87('0x34')]['key']};});_0x28d5ea['model']=_['map'](_0x3fd2d9,_0xba87('0x30'));_0x28d5ea[_0xba87('0x35')]=_[_0xba87('0x36')](_0x58f09c['query']);_0x28d5ea[_0xba87('0x37')]=_['intersection'](_0x28d5ea[_0xba87('0x38')],_0x28d5ea[_0xba87('0x35')]);_0x3e7b5f[_0xba87('0x39')]=_[_0xba87('0x3a')](_0x28d5ea['model'],qs[_0xba87('0x3b')](_0x58f09c['query']['fields']));_0x3e7b5f[_0xba87('0x39')]=_0x3e7b5f[_0xba87('0x39')]['length']?_0x3e7b5f['attributes']:_0x28d5ea[_0xba87('0x38')];if(!_0x58f09c[_0xba87('0x35')]['hasOwnProperty']('nolimit')){_0x3e7b5f[_0xba87('0x27')]=qs['limit'](_0x58f09c[_0xba87('0x35')][_0xba87('0x27')]);_0x3e7b5f[_0xba87('0x26')]=qs[_0xba87('0x26')](_0x58f09c[_0xba87('0x35')][_0xba87('0x26')]);}_0x3e7b5f['order']=qs[_0xba87('0x3c')](_0x58f09c[_0xba87('0x35')][_0xba87('0x3c')]);_0x3e7b5f[_0xba87('0x3d')]=qs[_0xba87('0x37')](_[_0xba87('0x3e')](_0x58f09c[_0xba87('0x35')],_0x28d5ea[_0xba87('0x37')]));if(_0x58f09c['query'][_0xba87('0x3f')]){_0x3e7b5f[_0xba87('0x3d')]=_[_0xba87('0x40')](_0x3e7b5f[_0xba87('0x3d')],{'$or':_[_0xba87('0x41')](_0x3fd2d9,function(_0x21f69c){if(_0x21f69c[_0xba87('0x34')]!==_0xba87('0x42')){var _0x23c6e7={};_0x23c6e7[_0x21f69c[_0xba87('0x30')]]={'$like':'%'+_0x58f09c[_0xba87('0x35')]['filter']+'%'};return _0x23c6e7;}})});}_0x3e7b5f=_[_0xba87('0x40')]({},_0x3e7b5f,_0x58f09c[_0xba87('0x43')]);var _0x443687={'where':_0x3e7b5f[_0xba87('0x3d')]};return db[_0xba87('0x32')][_0xba87('0x44')](_0x443687)[_0xba87('0x1a')](function(_0x4456fc){_0x3dec7f[_0xba87('0x44')]=_0x4456fc;if(_0x58f09c[_0xba87('0x35')][_0xba87('0x45')]){_0x3e7b5f[_0xba87('0x46')]=[{'all':!![]}];}return db[_0xba87('0x32')][_0xba87('0x47')](_0x3e7b5f);})['then'](function(_0x144622){_0x3dec7f['rows']=_0x144622;return _0x3dec7f;})['then'](respondWithFilteredResult(_0x444b1c,_0x3e7b5f))['catch'](handleError(_0x444b1c,null));};exports[_0xba87('0x48')]=function(_0x40e16d,_0x1ee25c){var _0x133c57={'raw':![],'where':{'id':_0x40e16d[_0xba87('0x49')]['id']}},_0x27a3af={};_0x27a3af[_0xba87('0x38')]=_['keys'](db[_0xba87('0x32')][_0xba87('0x33')]);_0x27a3af[_0xba87('0x35')]=_[_0xba87('0x36')](_0x40e16d[_0xba87('0x35')]);_0x27a3af[_0xba87('0x37')]=_[_0xba87('0x3a')](_0x27a3af[_0xba87('0x38')],_0x27a3af['query']);_0x133c57[_0xba87('0x39')]=_['intersection'](_0x27a3af[_0xba87('0x38')],qs[_0xba87('0x3b')](_0x40e16d[_0xba87('0x35')][_0xba87('0x3b')]));_0x133c57[_0xba87('0x39')]=_0x133c57[_0xba87('0x39')][_0xba87('0x4a')]?_0x133c57[_0xba87('0x39')]:_0x27a3af[_0xba87('0x38')];if(_0x40e16d['query']['includeAll']){_0x133c57['include']=[{'all':!![]}];}_0x133c57=_[_0xba87('0x40')]({},_0x133c57,_0x40e16d[_0xba87('0x43')]);return db[_0xba87('0x32')][_0xba87('0x4b')](_0x133c57)[_0xba87('0x1a')](handleEntityNotFound(_0x1ee25c,null))[_0xba87('0x1a')](respondWithResult(_0x1ee25c,null))['catch'](handleError(_0x1ee25c,null));};exports[_0xba87('0x4c')]=function(_0xdcadaa,_0x2790de){return db[_0xba87('0x32')][_0xba87('0x4c')](_0xdcadaa[_0xba87('0x4d')],{})[_0xba87('0x1a')](respondWithResult(_0x2790de,0xc9))[_0xba87('0x23')](handleError(_0x2790de,null));};exports[_0xba87('0x2c')]=function(_0x5edf98,_0x4c1be0){if(_0x5edf98['body']['id']){delete _0x5edf98[_0xba87('0x4d')]['id'];}return db[_0xba87('0x32')][_0xba87('0x4b')]({'where':{'id':_0x5edf98[_0xba87('0x49')]['id']}})[_0xba87('0x1a')](handleEntityNotFound(_0x4c1be0,null))['then'](saveUpdates(_0x5edf98[_0xba87('0x4d')],null))[_0xba87('0x1a')](respondWithResult(_0x4c1be0,null))['catch'](handleError(_0x4c1be0,null));};exports['destroy']=function(_0x1e3023,_0x253746){return db[_0xba87('0x32')][_0xba87('0x4b')]({'where':{'id':_0x1e3023[_0xba87('0x49')]['id']}})[_0xba87('0x1a')](handleEntityNotFound(_0x253746,null))['then'](removeEntity(_0x253746,null))['catch'](handleError(_0x253746,null));};exports[_0xba87('0x4e')]=function(_0x1cf33f,_0x42d984,_0x587aff){var _0x39e510={};var _0x2310be={};var _0x588551;var _0x10190a;return db[_0xba87('0x32')][_0xba87('0x4f')]({'where':{'id':_0x1cf33f[_0xba87('0x49')]['id']}})[_0xba87('0x1a')](handleEntityNotFound(_0x42d984,null))[_0xba87('0x1a')](function(_0x37a23f){if(_0x37a23f){_0x588551=_0x37a23f;_0x2310be[_0xba87('0x38')]=_['keys'](db['VtigerField']['rawAttributes']);_0x2310be['query']=_[_0xba87('0x36')](_0x1cf33f[_0xba87('0x35')]);_0x2310be[_0xba87('0x37')]=_['intersection'](_0x2310be[_0xba87('0x38')],_0x2310be[_0xba87('0x35')]);_0x39e510[_0xba87('0x39')]=_[_0xba87('0x3a')](_0x2310be[_0xba87('0x38')],qs[_0xba87('0x3b')](_0x1cf33f[_0xba87('0x35')][_0xba87('0x3b')]));_0x39e510[_0xba87('0x39')]=_0x39e510[_0xba87('0x39')][_0xba87('0x4a')]?_0x39e510['attributes']:_0x2310be[_0xba87('0x38')];_0x39e510[_0xba87('0x50')]=qs[_0xba87('0x3c')](_0x1cf33f[_0xba87('0x35')][_0xba87('0x3c')]);_0x39e510['where']=qs[_0xba87('0x37')](_['pick'](_0x1cf33f[_0xba87('0x35')],_0x2310be['filters']));if(_0x1cf33f[_0xba87('0x35')][_0xba87('0x3f')]){_0x39e510[_0xba87('0x3d')]=_[_0xba87('0x40')](_0x39e510[_0xba87('0x3d')],{'$or':_[_0xba87('0x41')](_0x39e510[_0xba87('0x39')],function(_0x48f23a){var _0x534483={};_0x534483[_0x48f23a]={'$like':'%'+_0x1cf33f[_0xba87('0x35')][_0xba87('0x3f')]+'%'};return _0x534483;})});}_0x39e510=_[_0xba87('0x40')]({},_0x39e510,_0x1cf33f[_0xba87('0x43')]);return _0x588551['getFields'](_0x39e510);}})[_0xba87('0x1a')](function(_0x1f82fc){if(_0x1f82fc){_0x10190a=_0x1f82fc[_0xba87('0x4a')];if(!_0x1cf33f[_0xba87('0x35')][_0xba87('0x51')]('nolimit')){_0x39e510['limit']=qs['limit'](_0x1cf33f[_0xba87('0x35')]['limit']);_0x39e510[_0xba87('0x26')]=qs[_0xba87('0x26')](_0x1cf33f[_0xba87('0x35')][_0xba87('0x26')]);}return _0x588551['getFields'](_0x39e510);}})[_0xba87('0x1a')](function(_0x1d4886){if(_0x1d4886){return _0x1d4886?{'count':_0x10190a,'rows':_0x1d4886}:null;}})['then'](respondWithResult(_0x42d984,null))[_0xba87('0x23')](handleError(_0x42d984,null));};exports['getSubjects']=function(_0x1a8403,_0x525294,_0x224ccb){var _0x1e78d1={};var _0x509c03={};var _0x583e4b;var _0x5b924c;return db[_0xba87('0x32')][_0xba87('0x4f')]({'where':{'id':_0x1a8403[_0xba87('0x49')]['id']}})[_0xba87('0x1a')](handleEntityNotFound(_0x525294,null))[_0xba87('0x1a')](function(_0x1e4adf){if(_0x1e4adf){_0x583e4b=_0x1e4adf;_0x509c03[_0xba87('0x38')]=_[_0xba87('0x36')](db[_0xba87('0x52')][_0xba87('0x33')]);_0x509c03['query']=_[_0xba87('0x36')](_0x1a8403[_0xba87('0x35')]);_0x509c03[_0xba87('0x37')]=_[_0xba87('0x3a')](_0x509c03['model'],_0x509c03[_0xba87('0x35')]);_0x1e78d1[_0xba87('0x39')]=_[_0xba87('0x3a')](_0x509c03[_0xba87('0x38')],qs[_0xba87('0x3b')](_0x1a8403['query']['fields']));_0x1e78d1['attributes']=_0x1e78d1[_0xba87('0x39')][_0xba87('0x4a')]?_0x1e78d1[_0xba87('0x39')]:_0x509c03[_0xba87('0x38')];_0x1e78d1['order']=qs[_0xba87('0x3c')](_0x1a8403['query']['sort']);_0x1e78d1[_0xba87('0x3d')]=qs[_0xba87('0x37')](_[_0xba87('0x3e')](_0x1a8403['query'],_0x509c03['filters']));if(_0x1a8403['query'][_0xba87('0x3f')]){_0x1e78d1['where']=_[_0xba87('0x40')](_0x1e78d1[_0xba87('0x3d')],{'$or':_[_0xba87('0x41')](_0x1e78d1[_0xba87('0x39')],function(_0x9ce041){var _0x4d67b9={};_0x4d67b9[_0x9ce041]={'$like':'%'+_0x1a8403[_0xba87('0x35')][_0xba87('0x3f')]+'%'};return _0x4d67b9;})});}_0x1e78d1=_['merge']({},_0x1e78d1,_0x1a8403['options']);return _0x583e4b[_0xba87('0x53')](_0x1e78d1);}})['then'](function(_0x738dc4){if(_0x738dc4){_0x5b924c=_0x738dc4['length'];if(!_0x1a8403['query'][_0xba87('0x51')](_0xba87('0x54'))){_0x1e78d1[_0xba87('0x27')]=qs[_0xba87('0x27')](_0x1a8403[_0xba87('0x35')][_0xba87('0x27')]);_0x1e78d1[_0xba87('0x26')]=qs['offset'](_0x1a8403[_0xba87('0x35')][_0xba87('0x26')]);}return _0x583e4b[_0xba87('0x53')](_0x1e78d1);}})[_0xba87('0x1a')](function(_0x22034a){if(_0x22034a){return _0x22034a?{'count':_0x5b924c,'rows':_0x22034a}:null;}})[_0xba87('0x1a')](respondWithResult(_0x525294,null))[_0xba87('0x23')](handleError(_0x525294,null));};exports[_0xba87('0x55')]=function(_0x350bfa,_0x2e8da8,_0x30c307){var _0x1af859={};var _0x2a05bc={};var _0x3c7b02;var _0x13f8f4;return db['VtigerConfiguration'][_0xba87('0x4f')]({'where':{'id':_0x350bfa[_0xba87('0x49')]['id']}})[_0xba87('0x1a')](handleEntityNotFound(_0x2e8da8,null))['then'](function(_0x25e9a7){if(_0x25e9a7){_0x3c7b02=_0x25e9a7;_0x2a05bc[_0xba87('0x38')]=_[_0xba87('0x36')](db[_0xba87('0x52')]['rawAttributes']);_0x2a05bc[_0xba87('0x35')]=_[_0xba87('0x36')](_0x350bfa[_0xba87('0x35')]);_0x2a05bc[_0xba87('0x37')]=_[_0xba87('0x3a')](_0x2a05bc['model'],_0x2a05bc[_0xba87('0x35')]);_0x1af859[_0xba87('0x39')]=_[_0xba87('0x3a')](_0x2a05bc[_0xba87('0x38')],qs[_0xba87('0x3b')](_0x350bfa[_0xba87('0x35')][_0xba87('0x3b')]));_0x1af859['attributes']=_0x1af859[_0xba87('0x39')]['length']?_0x1af859[_0xba87('0x39')]:_0x2a05bc['model'];_0x1af859[_0xba87('0x50')]=qs['sort'](_0x350bfa[_0xba87('0x35')][_0xba87('0x3c')]);_0x1af859[_0xba87('0x3d')]=qs[_0xba87('0x37')](_[_0xba87('0x3e')](_0x350bfa['query'],_0x2a05bc[_0xba87('0x37')]));if(_0x350bfa['query'][_0xba87('0x3f')]){_0x1af859['where']=_[_0xba87('0x40')](_0x1af859[_0xba87('0x3d')],{'$or':_[_0xba87('0x41')](_0x1af859[_0xba87('0x39')],function(_0x2ed372){var _0x38f156={};_0x38f156[_0x2ed372]={'$like':'%'+_0x350bfa[_0xba87('0x35')][_0xba87('0x3f')]+'%'};return _0x38f156;})});}_0x1af859=_['merge']({},_0x1af859,_0x350bfa[_0xba87('0x43')]);return _0x3c7b02[_0xba87('0x55')](_0x1af859);}})[_0xba87('0x1a')](function(_0x42ccd0){if(_0x42ccd0){_0x13f8f4=_0x42ccd0[_0xba87('0x4a')];if(!_0x350bfa[_0xba87('0x35')][_0xba87('0x51')](_0xba87('0x54'))){_0x1af859[_0xba87('0x27')]=qs[_0xba87('0x27')](_0x350bfa[_0xba87('0x35')][_0xba87('0x27')]);_0x1af859[_0xba87('0x26')]=qs[_0xba87('0x26')](_0x350bfa['query'][_0xba87('0x26')]);}return _0x3c7b02[_0xba87('0x55')](_0x1af859);}})[_0xba87('0x1a')](function(_0x3df8cc){if(_0x3df8cc){return _0x3df8cc?{'count':_0x13f8f4,'rows':_0x3df8cc}:null;}})['then'](respondWithResult(_0x2e8da8,null))['catch'](handleError(_0x2e8da8,null));}; \ No newline at end of file +var _0x690e=['filter','options','includeAll','include','rows','show','params','find','body','getFields','VtigerField','order','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','end','status','json','count','offset','reject','save','update','destroy','stack','name','send','index','map','VtigerConfiguration','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','VIRTUAL'];(function(_0x35272b,_0x470097){var _0x34ddd4=function(_0x59f42f){while(--_0x59f42f){_0x35272b['push'](_0x35272b['shift']());}};_0x34ddd4(++_0x470097);}(_0x690e,0x11d));var _0xe690=function(_0x5f36ea,_0x1b0f81){_0x5f36ea=_0x5f36ea-0x0;var _0x1bd689=_0x690e[_0x5f36ea];return _0x1bd689;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe690('0x0'));var rimraf=require(_0xe690('0x1'));var zipdir=require(_0xe690('0x2'));var jsonpatch=require(_0xe690('0x3'));var rp=require('request-promise');var moment=require(_0xe690('0x4'));var BPromise=require(_0xe690('0x5'));var Mustache=require(_0xe690('0x6'));var util=require(_0xe690('0x7'));var path=require(_0xe690('0x8'));var sox=require(_0xe690('0x9'));var csv=require(_0xe690('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xe690('0xb'));var crypto=require(_0xe690('0xc'));var jsforce=require(_0xe690('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe690('0xa'));var querystring=require(_0xe690('0xe'));var Papa=require(_0xe690('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe690('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe690('0x11'));var logger=require('../../config/logger')(_0xe690('0x12'));var utils=require(_0xe690('0x13'));var config=require(_0xe690('0x14'));var db=require(_0xe690('0x15'))['db'];var jayson=require(_0xe690('0x16'));var client=jayson[_0xe690('0x17')][_0xe690('0x18')]({'port':0x232a});function checkPasswordPattern(_0x136abc,_0x5d05ee,_0x4490ea){if(_0x4490ea){var _0x9d8477=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x9d8477[_0xe690('0x19')](_0x5d05ee)){return _0x136abc;}else{throw new db[(_0xe690('0x1a'))][(_0xe690('0x1b'))](_0xe690('0x1c'));}}else{return _0x136abc;}}function respondWithRpcPromise(_0x26a70c,_0x24d3db,_0x2d3a7a,_0xf3c20d){return new BPromise(function(_0x486925,_0x415a21){var _0x54129=_0xf3c20d||client;return _0x54129[_0xe690('0x1d')](_0x26a70c,_0x2d3a7a)[_0xe690('0x1e')](function(_0x75889d){logger['info'](_0xe690('0x1f'),_0x24d3db,_0xe690('0x20'));logger[_0xe690('0x21')](_0xe690('0x22'),_0x24d3db,_0xe690('0x20'),JSON[_0xe690('0x23')](_0x75889d));if(_0x75889d['error']){if(_0x75889d['error'][_0xe690('0x24')]===0x1f4){logger['error'](_0xe690('0x1f'),_0x24d3db,_0x75889d['error']['message']);return _0x415a21(_0x75889d[_0xe690('0x25')]['message']);}logger[_0xe690('0x25')](_0xe690('0x1f'),_0x24d3db,_0x75889d['error'][_0xe690('0x26')]);return _0x486925(_0x75889d[_0xe690('0x25')][_0xe690('0x26')]);}else{logger['info'](_0xe690('0x1f'),_0x24d3db,'request\x20sent');_0x486925(_0x75889d[_0xe690('0x27')][_0xe690('0x26')]);}})[_0xe690('0x28')](function(_0x5a1079){logger[_0xe690('0x25')](_0xe690('0x1f'),_0x24d3db,_0x5a1079);_0x415a21(_0x5a1079);});});}function respondWithStatusCode(_0x7aa826,_0x190d2a){_0x190d2a=_0x190d2a||0xcc;return function(_0x19d223){if(_0x19d223){return _0x7aa826['sendStatus'](_0x190d2a);}return _0x7aa826['status'](_0x190d2a)[_0xe690('0x29')]();};}function respondWithResult(_0x47f53d,_0x4d8d26){_0x4d8d26=_0x4d8d26||0xc8;return function(_0x56fbd2){if(_0x56fbd2){return _0x47f53d[_0xe690('0x2a')](_0x4d8d26)[_0xe690('0x2b')](_0x56fbd2);}};}function respondWithFilteredResult(_0x8eb8bd,_0xcf92ac){return function(_0x47e54d){if(_0x47e54d){var _0x33c3d8=_0x47e54d[_0xe690('0x2c')],_0x3d9c35=_0xcf92ac[_0xe690('0x2d')],_0x146eac=_0xcf92ac[_0xe690('0x2d')]+_0xcf92ac['limit'],_0x483c35;if(_0x146eac>=_0x33c3d8){_0x146eac=_0x33c3d8;_0x483c35=0xc8;}else{_0x483c35=0xce;}_0x8eb8bd['status'](_0x483c35);return _0x8eb8bd['set']('Content-Range',_0x3d9c35+'-'+_0x146eac+'/'+_0x33c3d8)[_0xe690('0x2b')](_0x47e54d);}return null;};}function patchUpdates(_0x531d52){return function(_0x501fc2){try{jsonpatch['apply'](_0x501fc2,_0x531d52,!![]);}catch(_0x37c807){return BPromise[_0xe690('0x2e')](_0x37c807);}return _0x501fc2[_0xe690('0x2f')]();};}function saveUpdates(_0x58e6f5,_0x281239){return function(_0x746ad9){if(_0x746ad9){return _0x746ad9[_0xe690('0x30')](_0x58e6f5)['then'](function(_0xca3392){return _0xca3392;});}return null;};}function removeEntity(_0x246b2c,_0x4ef544){return function(_0x55f623){if(_0x55f623){return _0x55f623[_0xe690('0x31')]()[_0xe690('0x1e')](function(){_0x246b2c['status'](0xcc)[_0xe690('0x29')]();});}};}function handleEntityNotFound(_0xda2bb8,_0x1414d0){return function(_0x3c8d12){if(!_0x3c8d12){_0xda2bb8['sendStatus'](0x194);}return _0x3c8d12;};}function handleError(_0x47dc7b,_0x298584){_0x298584=_0x298584||0x1f4;return function(_0x1c2140){logger[_0xe690('0x25')](_0x1c2140[_0xe690('0x32')]);if(_0x1c2140[_0xe690('0x33')]){delete _0x1c2140['name'];}_0x47dc7b[_0xe690('0x2a')](_0x298584)[_0xe690('0x34')](_0x1c2140);};}exports[_0xe690('0x35')]=function(_0x107999,_0x5f5a17){var _0x9c3ba1={},_0x5539de={},_0x94448d={'count':0x0,'rows':[]};var _0x281774=_[_0xe690('0x36')](db[_0xe690('0x37')][_0xe690('0x38')],function(_0x40696d){return{'name':_0x40696d['fieldName'],'type':_0x40696d[_0xe690('0x39')][_0xe690('0x3a')]};});_0x5539de['model']=_[_0xe690('0x36')](_0x281774,_0xe690('0x33'));_0x5539de[_0xe690('0x3b')]=_[_0xe690('0x3c')](_0x107999[_0xe690('0x3b')]);_0x5539de[_0xe690('0x3d')]=_[_0xe690('0x3e')](_0x5539de[_0xe690('0x3f')],_0x5539de['query']);_0x9c3ba1[_0xe690('0x40')]=_[_0xe690('0x3e')](_0x5539de['model'],qs['fields'](_0x107999['query'][_0xe690('0x41')]));_0x9c3ba1[_0xe690('0x40')]=_0x9c3ba1[_0xe690('0x40')][_0xe690('0x42')]?_0x9c3ba1['attributes']:_0x5539de[_0xe690('0x3f')];if(!_0x107999[_0xe690('0x3b')][_0xe690('0x43')](_0xe690('0x44'))){_0x9c3ba1[_0xe690('0x45')]=qs[_0xe690('0x45')](_0x107999[_0xe690('0x3b')][_0xe690('0x45')]);_0x9c3ba1[_0xe690('0x2d')]=qs[_0xe690('0x2d')](_0x107999['query'][_0xe690('0x2d')]);}_0x9c3ba1['order']=qs[_0xe690('0x46')](_0x107999['query'][_0xe690('0x46')]);_0x9c3ba1[_0xe690('0x47')]=qs[_0xe690('0x3d')](_[_0xe690('0x48')](_0x107999[_0xe690('0x3b')],_0x5539de[_0xe690('0x3d')]));if(_0x107999[_0xe690('0x3b')]['filter']){_0x9c3ba1['where']=_[_0xe690('0x49')](_0x9c3ba1['where'],{'$or':_['map'](_0x281774,function(_0x4c1eee){if(_0x4c1eee[_0xe690('0x39')]!==_0xe690('0x4a')){var _0x46a373={};_0x46a373[_0x4c1eee['name']]={'$like':'%'+_0x107999[_0xe690('0x3b')][_0xe690('0x4b')]+'%'};return _0x46a373;}})});}_0x9c3ba1=_[_0xe690('0x49')]({},_0x9c3ba1,_0x107999[_0xe690('0x4c')]);var _0x529996={'where':_0x9c3ba1[_0xe690('0x47')]};return db[_0xe690('0x37')]['count'](_0x529996)['then'](function(_0x5d65fa){_0x94448d['count']=_0x5d65fa;if(_0x107999[_0xe690('0x3b')][_0xe690('0x4d')]){_0x9c3ba1[_0xe690('0x4e')]=[{'all':!![]}];}return db[_0xe690('0x37')]['findAll'](_0x9c3ba1);})['then'](function(_0x5f51b2){_0x94448d[_0xe690('0x4f')]=_0x5f51b2;return _0x94448d;})[_0xe690('0x1e')](respondWithFilteredResult(_0x5f5a17,_0x9c3ba1))[_0xe690('0x28')](handleError(_0x5f5a17,null));};exports[_0xe690('0x50')]=function(_0x191c4a,_0x201112){var _0x3f03a9={'raw':![],'where':{'id':_0x191c4a[_0xe690('0x51')]['id']}},_0x5018d0={};_0x5018d0[_0xe690('0x3f')]=_[_0xe690('0x3c')](db['VtigerConfiguration'][_0xe690('0x38')]);_0x5018d0[_0xe690('0x3b')]=_[_0xe690('0x3c')](_0x191c4a[_0xe690('0x3b')]);_0x5018d0[_0xe690('0x3d')]=_[_0xe690('0x3e')](_0x5018d0['model'],_0x5018d0[_0xe690('0x3b')]);_0x3f03a9[_0xe690('0x40')]=_['intersection'](_0x5018d0[_0xe690('0x3f')],qs[_0xe690('0x41')](_0x191c4a[_0xe690('0x3b')][_0xe690('0x41')]));_0x3f03a9['attributes']=_0x3f03a9[_0xe690('0x40')][_0xe690('0x42')]?_0x3f03a9[_0xe690('0x40')]:_0x5018d0[_0xe690('0x3f')];if(_0x191c4a['query'][_0xe690('0x4d')]){_0x3f03a9[_0xe690('0x4e')]=[{'all':!![]}];}_0x3f03a9=_['merge']({},_0x3f03a9,_0x191c4a['options']);return db[_0xe690('0x37')][_0xe690('0x52')](_0x3f03a9)[_0xe690('0x1e')](handleEntityNotFound(_0x201112,null))[_0xe690('0x1e')](respondWithResult(_0x201112,null))['catch'](handleError(_0x201112,null));};exports['create']=function(_0x567f71,_0x1321b3){return db['VtigerConfiguration']['create'](_0x567f71[_0xe690('0x53')],{})[_0xe690('0x1e')](respondWithResult(_0x1321b3,0xc9))['catch'](handleError(_0x1321b3,null));};exports[_0xe690('0x30')]=function(_0x25f375,_0x3c6cf9){if(_0x25f375[_0xe690('0x53')]['id']){delete _0x25f375[_0xe690('0x53')]['id'];}return db['VtigerConfiguration'][_0xe690('0x52')]({'where':{'id':_0x25f375['params']['id']}})[_0xe690('0x1e')](handleEntityNotFound(_0x3c6cf9,null))[_0xe690('0x1e')](saveUpdates(_0x25f375[_0xe690('0x53')],null))[_0xe690('0x1e')](respondWithResult(_0x3c6cf9,null))[_0xe690('0x28')](handleError(_0x3c6cf9,null));};exports[_0xe690('0x31')]=function(_0xa301f2,_0x268a34){return db[_0xe690('0x37')][_0xe690('0x52')]({'where':{'id':_0xa301f2[_0xe690('0x51')]['id']}})[_0xe690('0x1e')](handleEntityNotFound(_0x268a34,null))[_0xe690('0x1e')](removeEntity(_0x268a34,null))['catch'](handleError(_0x268a34,null));};exports[_0xe690('0x54')]=function(_0x3af141,_0x9f5e76,_0x9d435c){var _0x451143={};var _0x451cc1={};var _0x394994;var _0xef0f4a;return db[_0xe690('0x37')]['findOne']({'where':{'id':_0x3af141[_0xe690('0x51')]['id']}})[_0xe690('0x1e')](handleEntityNotFound(_0x9f5e76,null))[_0xe690('0x1e')](function(_0x254416){if(_0x254416){_0x394994=_0x254416;_0x451cc1[_0xe690('0x3f')]=_[_0xe690('0x3c')](db[_0xe690('0x55')][_0xe690('0x38')]);_0x451cc1['query']=_[_0xe690('0x3c')](_0x3af141['query']);_0x451cc1['filters']=_[_0xe690('0x3e')](_0x451cc1[_0xe690('0x3f')],_0x451cc1[_0xe690('0x3b')]);_0x451143[_0xe690('0x40')]=_[_0xe690('0x3e')](_0x451cc1[_0xe690('0x3f')],qs[_0xe690('0x41')](_0x3af141[_0xe690('0x3b')][_0xe690('0x41')]));_0x451143[_0xe690('0x40')]=_0x451143[_0xe690('0x40')][_0xe690('0x42')]?_0x451143[_0xe690('0x40')]:_0x451cc1[_0xe690('0x3f')];_0x451143[_0xe690('0x56')]=qs['sort'](_0x3af141[_0xe690('0x3b')][_0xe690('0x46')]);_0x451143[_0xe690('0x47')]=qs[_0xe690('0x3d')](_[_0xe690('0x48')](_0x3af141[_0xe690('0x3b')],_0x451cc1[_0xe690('0x3d')]));if(_0x3af141[_0xe690('0x3b')]['filter']){_0x451143['where']=_[_0xe690('0x49')](_0x451143[_0xe690('0x47')],{'$or':_[_0xe690('0x36')](_0x451143['attributes'],function(_0x580067){var _0x37d820={};_0x37d820[_0x580067]={'$like':'%'+_0x3af141['query']['filter']+'%'};return _0x37d820;})});}_0x451143=_['merge']({},_0x451143,_0x3af141[_0xe690('0x4c')]);return _0x394994[_0xe690('0x54')](_0x451143);}})[_0xe690('0x1e')](function(_0x5eae9f){if(_0x5eae9f){_0xef0f4a=_0x5eae9f['length'];if(!_0x3af141['query'][_0xe690('0x43')](_0xe690('0x44'))){_0x451143[_0xe690('0x45')]=qs[_0xe690('0x45')](_0x3af141[_0xe690('0x3b')]['limit']);_0x451143['offset']=qs[_0xe690('0x2d')](_0x3af141[_0xe690('0x3b')][_0xe690('0x2d')]);}return _0x394994[_0xe690('0x54')](_0x451143);}})['then'](function(_0x494712){if(_0x494712){return _0x494712?{'count':_0xef0f4a,'rows':_0x494712}:null;}})['then'](respondWithResult(_0x9f5e76,null))[_0xe690('0x28')](handleError(_0x9f5e76,null));};exports[_0xe690('0x57')]=function(_0xf65340,_0x58d356,_0x4ea48c){var _0x5569fb={};var _0x220bbd={};var _0x298cfe;var _0x332b8b;return db[_0xe690('0x37')][_0xe690('0x58')]({'where':{'id':_0xf65340[_0xe690('0x51')]['id']}})[_0xe690('0x1e')](handleEntityNotFound(_0x58d356,null))['then'](function(_0xf7ca0a){if(_0xf7ca0a){_0x298cfe=_0xf7ca0a;_0x220bbd['model']=_['keys'](db[_0xe690('0x55')][_0xe690('0x38')]);_0x220bbd[_0xe690('0x3b')]=_['keys'](_0xf65340[_0xe690('0x3b')]);_0x220bbd[_0xe690('0x3d')]=_[_0xe690('0x3e')](_0x220bbd[_0xe690('0x3f')],_0x220bbd[_0xe690('0x3b')]);_0x5569fb[_0xe690('0x40')]=_[_0xe690('0x3e')](_0x220bbd[_0xe690('0x3f')],qs[_0xe690('0x41')](_0xf65340[_0xe690('0x3b')][_0xe690('0x41')]));_0x5569fb[_0xe690('0x40')]=_0x5569fb[_0xe690('0x40')][_0xe690('0x42')]?_0x5569fb['attributes']:_0x220bbd[_0xe690('0x3f')];_0x5569fb[_0xe690('0x56')]=qs[_0xe690('0x46')](_0xf65340['query'][_0xe690('0x46')]);_0x5569fb[_0xe690('0x47')]=qs['filters'](_['pick'](_0xf65340[_0xe690('0x3b')],_0x220bbd['filters']));if(_0xf65340[_0xe690('0x3b')][_0xe690('0x4b')]){_0x5569fb[_0xe690('0x47')]=_[_0xe690('0x49')](_0x5569fb[_0xe690('0x47')],{'$or':_[_0xe690('0x36')](_0x5569fb[_0xe690('0x40')],function(_0x2ea3c1){var _0x229bd8={};_0x229bd8[_0x2ea3c1]={'$like':'%'+_0xf65340['query']['filter']+'%'};return _0x229bd8;})});}_0x5569fb=_[_0xe690('0x49')]({},_0x5569fb,_0xf65340[_0xe690('0x4c')]);return _0x298cfe[_0xe690('0x57')](_0x5569fb);}})[_0xe690('0x1e')](function(_0x4a92f0){if(_0x4a92f0){_0x332b8b=_0x4a92f0[_0xe690('0x42')];if(!_0xf65340['query'][_0xe690('0x43')](_0xe690('0x44'))){_0x5569fb[_0xe690('0x45')]=qs[_0xe690('0x45')](_0xf65340[_0xe690('0x3b')][_0xe690('0x45')]);_0x5569fb['offset']=qs[_0xe690('0x2d')](_0xf65340['query'][_0xe690('0x2d')]);}return _0x298cfe[_0xe690('0x57')](_0x5569fb);}})[_0xe690('0x1e')](function(_0x4b80a4){if(_0x4b80a4){return _0x4b80a4?{'count':_0x332b8b,'rows':_0x4b80a4}:null;}})[_0xe690('0x1e')](respondWithResult(_0x58d356,null))[_0xe690('0x28')](handleError(_0x58d356,null));};exports[_0xe690('0x59')]=function(_0x4efd85,_0x5374ad,_0x561611){var _0x54f96b={};var _0x36c6d2={};var _0x300acb;var _0xf6a9a5;return db['VtigerConfiguration'][_0xe690('0x58')]({'where':{'id':_0x4efd85[_0xe690('0x51')]['id']}})[_0xe690('0x1e')](handleEntityNotFound(_0x5374ad,null))[_0xe690('0x1e')](function(_0x13abc6){if(_0x13abc6){_0x300acb=_0x13abc6;_0x36c6d2[_0xe690('0x3f')]=_['keys'](db[_0xe690('0x55')][_0xe690('0x38')]);_0x36c6d2['query']=_['keys'](_0x4efd85['query']);_0x36c6d2['filters']=_[_0xe690('0x3e')](_0x36c6d2[_0xe690('0x3f')],_0x36c6d2[_0xe690('0x3b')]);_0x54f96b[_0xe690('0x40')]=_[_0xe690('0x3e')](_0x36c6d2[_0xe690('0x3f')],qs[_0xe690('0x41')](_0x4efd85['query'][_0xe690('0x41')]));_0x54f96b[_0xe690('0x40')]=_0x54f96b['attributes']['length']?_0x54f96b[_0xe690('0x40')]:_0x36c6d2['model'];_0x54f96b[_0xe690('0x56')]=qs[_0xe690('0x46')](_0x4efd85[_0xe690('0x3b')]['sort']);_0x54f96b[_0xe690('0x47')]=qs['filters'](_[_0xe690('0x48')](_0x4efd85[_0xe690('0x3b')],_0x36c6d2[_0xe690('0x3d')]));if(_0x4efd85['query'][_0xe690('0x4b')]){_0x54f96b[_0xe690('0x47')]=_['merge'](_0x54f96b[_0xe690('0x47')],{'$or':_[_0xe690('0x36')](_0x54f96b['attributes'],function(_0x22a21d){var _0x37ae5c={};_0x37ae5c[_0x22a21d]={'$like':'%'+_0x4efd85['query']['filter']+'%'};return _0x37ae5c;})});}_0x54f96b=_[_0xe690('0x49')]({},_0x54f96b,_0x4efd85['options']);return _0x300acb[_0xe690('0x59')](_0x54f96b);}})[_0xe690('0x1e')](function(_0x54d7ee){if(_0x54d7ee){_0xf6a9a5=_0x54d7ee['length'];if(!_0x4efd85['query'][_0xe690('0x43')](_0xe690('0x44'))){_0x54f96b[_0xe690('0x45')]=qs[_0xe690('0x45')](_0x4efd85[_0xe690('0x3b')][_0xe690('0x45')]);_0x54f96b['offset']=qs['offset'](_0x4efd85['query']['offset']);}return _0x300acb[_0xe690('0x59')](_0x54f96b);}})[_0xe690('0x1e')](function(_0x23e569){if(_0x23e569){return _0x23e569?{'count':_0xf6a9a5,'rows':_0x23e569}:null;}})[_0xe690('0x1e')](respondWithResult(_0x5374ad,null))[_0xe690('0x28')](handleError(_0x5374ad,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index c070fba..51d12d0 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 _0xe0bb=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations'];(function(_0x446003,_0x2b17dd){var _0x5b8022=function(_0x3c983a){while(--_0x3c983a){_0x446003['push'](_0x446003['shift']());}};_0x5b8022(++_0x2b17dd);}(_0xe0bb,0xdd));var _0xbe0b=function(_0xc8db6b,_0x320abd){_0xc8db6b=_0xc8db6b-0x0;var _0x12cb81=_0xe0bb[_0xc8db6b];return _0x12cb81;};'use strict';var _=require(_0xbe0b('0x0'));var util=require(_0xbe0b('0x1'));var logger=require(_0xbe0b('0x2'))(_0xbe0b('0x3'));var moment=require('moment');var BPromise=require(_0xbe0b('0x4'));var rp=require(_0xbe0b('0x5'));var fs=require('fs');var path=require(_0xbe0b('0x6'));var rimraf=require('rimraf');var config=require(_0xbe0b('0x7'));var attributes=require(_0xbe0b('0x8'));module[_0xbe0b('0x9')]=function(_0x4428dc,_0x15340f){return _0x4428dc[_0xbe0b('0xa')](_0xbe0b('0xb'),attributes,{'tableName':_0xbe0b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b24=['VtigerConfiguration','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x50694c,_0x97a97d){var _0x33111e=function(_0x5f0d6f){while(--_0x5f0d6f){_0x50694c['push'](_0x50694c['shift']());}};_0x33111e(++_0x97a97d);}(_0x2b24,0x160));var _0x42b2=function(_0x288152,_0x125d9e){_0x288152=_0x288152-0x0;var _0x4d2526=_0x2b24[_0x288152];return _0x4d2526;};'use strict';var _=require('lodash');var util=require(_0x42b2('0x0'));var logger=require(_0x42b2('0x1'))(_0x42b2('0x2'));var moment=require(_0x42b2('0x3'));var BPromise=require(_0x42b2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x42b2('0x5'));var rimraf=require('rimraf');var config=require(_0x42b2('0x6'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x42b2('0x7')]=function(_0x329247,_0x453e68){return _0x329247['define'](_0x42b2('0x8'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 7b0a3e5..86f76cb 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 _0x9ed6=['code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x5b667a,_0x144853){var _0x5df1ce=function(_0x415e25){while(--_0x415e25){_0x5b667a['push'](_0x5b667a['shift']());}};_0x5df1ce(++_0x144853);}(_0x9ed6,0xb4));var _0x69ed=function(_0x141dc0,_0x2b04d8){_0x141dc0=_0x141dc0-0x0;var _0x22b224=_0x9ed6[_0x141dc0];return _0x22b224;};'use strict';var _=require(_0x69ed('0x0'));var util=require(_0x69ed('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x69ed('0x2'));var fs=require('fs');var Redis=require(_0x69ed('0x3'));var db=require(_0x69ed('0x4'))['db'];var utils=require(_0x69ed('0x5'));var logger=require(_0x69ed('0x6'))(_0x69ed('0x7'));var config=require(_0x69ed('0x8'));var jayson=require(_0x69ed('0x9'));var client=jayson[_0x69ed('0xa')][_0x69ed('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ab7cd,_0x443245,_0x1719a6){return new BPromise(function(_0x173fc6,_0x1e1ff3){return client['request'](_0x5ab7cd,_0x1719a6)['then'](function(_0x7834c4){logger[_0x69ed('0xc')](_0x69ed('0xd'),_0x443245,_0x69ed('0xe'));logger[_0x69ed('0xf')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x443245,_0x69ed('0xe'),JSON[_0x69ed('0x10')](_0x7834c4));if(_0x7834c4[_0x69ed('0x11')]){if(_0x7834c4[_0x69ed('0x11')][_0x69ed('0x12')]===0x1f4){logger[_0x69ed('0x11')](_0x69ed('0xd'),_0x443245,_0x7834c4[_0x69ed('0x11')][_0x69ed('0x13')]);return _0x1e1ff3(_0x7834c4[_0x69ed('0x11')][_0x69ed('0x13')]);}logger[_0x69ed('0x11')](_0x69ed('0xd'),_0x443245,_0x7834c4['error'][_0x69ed('0x13')]);return _0x173fc6(_0x7834c4[_0x69ed('0x11')][_0x69ed('0x13')]);}else{logger[_0x69ed('0xc')](_0x69ed('0xd'),_0x443245,_0x69ed('0xe'));_0x173fc6(_0x7834c4[_0x69ed('0x14')]['message']);}})[_0x69ed('0x15')](function(_0x103e9c){logger[_0x69ed('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x443245,_0x103e9c);_0x1e1ff3(_0x103e9c);});});} \ No newline at end of file +var _0xb89e=['catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x488c7f,_0x7f85b4){var _0x3c8877=function(_0x338899){while(--_0x338899){_0x488c7f['push'](_0x488c7f['shift']());}};_0x3c8877(++_0x7f85b4);}(_0xb89e,0x17b));var _0xeb89=function(_0x1a9c75,_0xa83750){_0x1a9c75=_0x1a9c75-0x0;var _0xb2f37e=_0xb89e[_0x1a9c75];return _0xb2f37e;};'use strict';var _=require(_0xeb89('0x0'));var util=require('util');var moment=require(_0xeb89('0x1'));var BPromise=require(_0xeb89('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb89('0x3'));var db=require(_0xeb89('0x4'))['db'];var utils=require(_0xeb89('0x5'));var logger=require(_0xeb89('0x6'))(_0xeb89('0x7'));var config=require(_0xeb89('0x8'));var jayson=require(_0xeb89('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3cb80c,_0x1e5dd5,_0x402c68){return new BPromise(function(_0x3a2e59,_0xc8f4ac){return client[_0xeb89('0xa')](_0x3cb80c,_0x402c68)[_0xeb89('0xb')](function(_0x1f8653){logger[_0xeb89('0xc')](_0xeb89('0xd'),_0x1e5dd5,_0xeb89('0xe'));logger['debug'](_0xeb89('0xf'),_0x1e5dd5,_0xeb89('0xe'),JSON[_0xeb89('0x10')](_0x1f8653));if(_0x1f8653[_0xeb89('0x11')]){if(_0x1f8653[_0xeb89('0x11')]['code']===0x1f4){logger[_0xeb89('0x11')](_0xeb89('0xd'),_0x1e5dd5,_0x1f8653['error'][_0xeb89('0x12')]);return _0xc8f4ac(_0x1f8653[_0xeb89('0x11')]['message']);}logger['error'](_0xeb89('0xd'),_0x1e5dd5,_0x1f8653[_0xeb89('0x11')][_0xeb89('0x12')]);return _0x3a2e59(_0x1f8653[_0xeb89('0x11')][_0xeb89('0x12')]);}else{logger[_0xeb89('0xc')](_0xeb89('0xd'),_0x1e5dd5,_0xeb89('0xe'));_0x3a2e59(_0x1f8653[_0xeb89('0x13')][_0xeb89('0x12')]);}})[_0xeb89('0x14')](function(_0x5787c6){logger[_0xeb89('0x11')](_0xeb89('0xd'),_0x1e5dd5,_0x5787c6);_0xc8f4ac(_0x5787c6);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index fa6b9da..68fae6a 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 _0xec46=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xec46,0x8e));var _0x6ec4=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0xec46[_0x26fc81];return _0x9feece;};'use strict';var multer=require(_0x6ec4('0x0'));var util=require(_0x6ec4('0x1'));var path=require(_0x6ec4('0x2'));var timeout=require(_0x6ec4('0x3'));var express=require('express');var router=express[_0x6ec4('0x4')]();var auth=require(_0x6ec4('0x5'));var interaction=require(_0x6ec4('0x6'));var config=require('../../config/environment');var controller=require(_0x6ec4('0x7'));router[_0x6ec4('0x8')]('/',auth[_0x6ec4('0x9')](),controller['index']);router['get'](_0x6ec4('0xa'),auth[_0x6ec4('0x9')](),controller[_0x6ec4('0xb')]);router[_0x6ec4('0xc')]('/',auth[_0x6ec4('0x9')](),controller[_0x6ec4('0xd')]);router[_0x6ec4('0xe')](_0x6ec4('0xa'),auth['isAuthenticated'](),controller[_0x6ec4('0xf')]);router['delete']('/:id',auth[_0x6ec4('0x9')](),controller[_0x6ec4('0x10')]);module[_0x6ec4('0x11')]=router; \ No newline at end of file +var _0x5b0a=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intVtigerField.controller','isAuthenticated','index','get','/:id','show','create','put','delete','destroy','exports','multer','util'];(function(_0x2c8449,_0x4a9b36){var _0x56a0da=function(_0x4bebc1){while(--_0x4bebc1){_0x2c8449['push'](_0x2c8449['shift']());}};_0x56a0da(++_0x4a9b36);}(_0x5b0a,0x6a));var _0xa5b0=function(_0xa11a8e,_0x524a13){_0xa11a8e=_0xa11a8e-0x0;var _0x50638b=_0x5b0a[_0xa11a8e];return _0x50638b;};'use strict';var multer=require(_0xa5b0('0x0'));var util=require(_0xa5b0('0x1'));var path=require(_0xa5b0('0x2'));var timeout=require(_0xa5b0('0x3'));var express=require('express');var router=express[_0xa5b0('0x4')]();var auth=require(_0xa5b0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa5b0('0x6'));var controller=require(_0xa5b0('0x7'));router['get']('/',auth[_0xa5b0('0x8')](),controller[_0xa5b0('0x9')]);router[_0xa5b0('0xa')](_0xa5b0('0xb'),auth[_0xa5b0('0x8')](),controller[_0xa5b0('0xc')]);router['post']('/',auth[_0xa5b0('0x8')](),controller[_0xa5b0('0xd')]);router[_0xa5b0('0xe')](_0xa5b0('0xb'),auth[_0xa5b0('0x8')](),controller['update']);router[_0xa5b0('0xf')](_0xa5b0('0xb'),auth[_0xa5b0('0x8')](),controller[_0xa5b0('0x10')]);module[_0xa5b0('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 15a5bf5..3dfc940 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 _0x3613=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x260af8,_0x1658e9){var _0x342a6e=function(_0x45dc96){while(--_0x45dc96){_0x260af8['push'](_0x260af8['shift']());}};_0x342a6e(++_0x1658e9);}(_0x3613,0x198));var _0x3361=function(_0x304253,_0x44415c){_0x304253=_0x304253-0x0;var _0x2cfb9b=_0x3613[_0x304253];return _0x2cfb9b;};'use strict';var Sequelize=require(_0x3361('0x0'));module[_0x3361('0x1')]={'type':{'type':Sequelize[_0x3361('0x2')](_0x3361('0x3'),_0x3361('0x4'),_0x3361('0x5'),_0x3361('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3361('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x3361('0x2')](_0x3361('0x3'),_0x3361('0x4'),_0x3361('0x5'))},'keyContent':{'type':Sequelize[_0x3361('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x3361('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3361('0x7')]}}; \ No newline at end of file +var _0xa48b=['ENUM','customVariable','STRING','variable','sequelize','exports'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xa48b,0xc4));var _0xba48=function(_0x128d1b,_0x1b863b){_0x128d1b=_0x128d1b-0x0;var _0x3d955c=_0xa48b[_0x128d1b];return _0x3d955c;};'use strict';var Sequelize=require(_0xba48('0x0'));module[_0xba48('0x1')]={'type':{'type':Sequelize[_0xba48('0x2')]('string','variable',_0xba48('0x3'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0xba48('0x4')]},'key':{'type':Sequelize[_0xba48('0x4')]},'keyType':{'type':Sequelize[_0xba48('0x2')]('string',_0xba48('0x5'),_0xba48('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xba48('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xba48('0x4')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 61a1258..1b5bf0b 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 _0x02e8=['name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','status','json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack'];(function(_0x3da0f1,_0x4d01a6){var _0x190c40=function(_0x1564f3){while(--_0x1564f3){_0x3da0f1['push'](_0x3da0f1['shift']());}};_0x190c40(++_0x4d01a6);}(_0x02e8,0xb6));var _0x802e=function(_0x35ccac,_0x28d874){_0x35ccac=_0x35ccac-0x0;var _0x217b96=_0x02e8[_0x35ccac];return _0x217b96;};'use strict';var pdf=require(_0x802e('0x0'));var emlformat=require(_0x802e('0x1'));var rimraf=require(_0x802e('0x2'));var zipdir=require(_0x802e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x802e('0x4'));var moment=require(_0x802e('0x5'));var BPromise=require(_0x802e('0x6'));var Mustache=require(_0x802e('0x7'));var util=require(_0x802e('0x8'));var path=require(_0x802e('0x9'));var sox=require('sox');var csv=require(_0x802e('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x802e('0xb'));var squel=require(_0x802e('0xc'));var crypto=require(_0x802e('0xd'));var jsforce=require(_0x802e('0xe'));var deskjs=require(_0x802e('0xf'));var toCsv=require(_0x802e('0xa'));var querystring=require('querystring');var Papa=require(_0x802e('0x10'));var Redis=require(_0x802e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x802e('0x12'));var as=require(_0x802e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x802e('0x14'));var utils=require(_0x802e('0x15'));var config=require('../../config/environment');var db=require(_0x802e('0x16'))['db'];function respondWithStatusCode(_0x52eccf,_0x17029a){_0x17029a=_0x17029a||0xcc;return function(_0x3b66be){if(_0x3b66be){return _0x52eccf['sendStatus'](_0x17029a);}return _0x52eccf[_0x802e('0x17')](_0x17029a)['end']();};}function respondWithResult(_0x3cb8d8,_0x4c88bf){_0x4c88bf=_0x4c88bf||0xc8;return function(_0x10ec6d){if(_0x10ec6d){return _0x3cb8d8[_0x802e('0x17')](_0x4c88bf)[_0x802e('0x18')](_0x10ec6d);}};}function respondWithFilteredResult(_0x54c592,_0x1102a4){return function(_0x94266b){if(_0x94266b){var _0x1b4113=_0x94266b[_0x802e('0x19')],_0x446db7=_0x1102a4['offset'],_0x115f75=_0x1102a4['offset']+_0x1102a4[_0x802e('0x1a')],_0x962d69;if(_0x115f75>=_0x1b4113){_0x115f75=_0x1b4113;_0x962d69=0xc8;}else{_0x962d69=0xce;}_0x54c592[_0x802e('0x17')](_0x962d69);return _0x54c592[_0x802e('0x1b')](_0x802e('0x1c'),_0x446db7+'-'+_0x115f75+'/'+_0x1b4113)['json'](_0x94266b);}return null;};}function patchUpdates(_0x451d49){return function(_0x28648d){try{jsonpatch[_0x802e('0x1d')](_0x28648d,_0x451d49,!![]);}catch(_0x40288f){return BPromise[_0x802e('0x1e')](_0x40288f);}return _0x28648d[_0x802e('0x1f')]();};}function saveUpdates(_0x324f92,_0x51a890){return function(_0x585d03){if(_0x585d03){return _0x585d03[_0x802e('0x20')](_0x324f92)[_0x802e('0x21')](function(_0x5bcfbb){return _0x5bcfbb;});}return null;};}function removeEntity(_0x1e93c2,_0x4aba39){return function(_0xeef08b){if(_0xeef08b){return _0xeef08b[_0x802e('0x22')]()['then'](function(){_0x1e93c2[_0x802e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5aeb19,_0x1291ba){return function(_0x270b38){if(!_0x270b38){_0x5aeb19['sendStatus'](0x194);}return _0x270b38;};}function handleError(_0xb11511,_0x20c59e){_0x20c59e=_0x20c59e||0x1f4;return function(_0x3998c7){logger[_0x802e('0x23')](_0x3998c7[_0x802e('0x24')]);if(_0x3998c7[_0x802e('0x25')]){delete _0x3998c7[_0x802e('0x25')];}_0xb11511[_0x802e('0x17')](_0x20c59e)[_0x802e('0x26')](_0x3998c7);};}exports[_0x802e('0x27')]=function(_0x90a9c3,_0x42bd67){var _0xe4e2d7={},_0x453280={},_0x5f3ae2={'count':0x0,'rows':[]};var _0x476a59=_[_0x802e('0x28')](db[_0x802e('0x29')][_0x802e('0x2a')],function(_0x1a921e){return{'name':_0x1a921e[_0x802e('0x2b')],'type':_0x1a921e[_0x802e('0x2c')][_0x802e('0x2d')]};});_0x453280[_0x802e('0x2e')]=_[_0x802e('0x28')](_0x476a59,'name');_0x453280['query']=_[_0x802e('0x2f')](_0x90a9c3[_0x802e('0x30')]);_0x453280[_0x802e('0x31')]=_[_0x802e('0x32')](_0x453280[_0x802e('0x2e')],_0x453280[_0x802e('0x30')]);_0xe4e2d7[_0x802e('0x33')]=_[_0x802e('0x32')](_0x453280[_0x802e('0x2e')],qs[_0x802e('0x34')](_0x90a9c3[_0x802e('0x30')][_0x802e('0x34')]));_0xe4e2d7['attributes']=_0xe4e2d7['attributes']['length']?_0xe4e2d7['attributes']:_0x453280[_0x802e('0x2e')];if(!_0x90a9c3[_0x802e('0x30')]['hasOwnProperty'](_0x802e('0x35'))){_0xe4e2d7[_0x802e('0x1a')]=qs[_0x802e('0x1a')](_0x90a9c3[_0x802e('0x30')][_0x802e('0x1a')]);_0xe4e2d7[_0x802e('0x36')]=qs[_0x802e('0x36')](_0x90a9c3[_0x802e('0x30')][_0x802e('0x36')]);}_0xe4e2d7[_0x802e('0x37')]=qs[_0x802e('0x38')](_0x90a9c3['query'][_0x802e('0x38')]);_0xe4e2d7[_0x802e('0x39')]=qs[_0x802e('0x31')](_[_0x802e('0x3a')](_0x90a9c3['query'],_0x453280[_0x802e('0x31')]));if(_0x90a9c3[_0x802e('0x30')][_0x802e('0x3b')]){_0xe4e2d7['where']=_[_0x802e('0x3c')](_0xe4e2d7['where'],{'$or':_[_0x802e('0x28')](_0x476a59,function(_0x1e962a){if(_0x1e962a[_0x802e('0x2c')]!==_0x802e('0x3d')){var _0x562f57={};_0x562f57[_0x1e962a[_0x802e('0x25')]]={'$like':'%'+_0x90a9c3[_0x802e('0x30')][_0x802e('0x3b')]+'%'};return _0x562f57;}})});}_0xe4e2d7=_[_0x802e('0x3c')]({},_0xe4e2d7,_0x90a9c3[_0x802e('0x3e')]);var _0x262144={'where':_0xe4e2d7['where']};return db[_0x802e('0x29')][_0x802e('0x19')](_0x262144)['then'](function(_0x51e05d){_0x5f3ae2[_0x802e('0x19')]=_0x51e05d;if(_0x90a9c3[_0x802e('0x30')][_0x802e('0x3f')]){_0xe4e2d7[_0x802e('0x40')]=[{'all':!![]}];}return db[_0x802e('0x29')][_0x802e('0x41')](_0xe4e2d7);})[_0x802e('0x21')](function(_0x586f27){_0x5f3ae2[_0x802e('0x42')]=_0x586f27;return _0x5f3ae2;})['then'](respondWithFilteredResult(_0x42bd67,_0xe4e2d7))['catch'](handleError(_0x42bd67,null));};exports[_0x802e('0x43')]=function(_0x4ac31c,_0x4fa5cd){var _0x423ad4={'raw':!![],'where':{'id':_0x4ac31c[_0x802e('0x44')]['id']}},_0x501c00={};_0x501c00[_0x802e('0x2e')]=_[_0x802e('0x2f')](db['VtigerField']['rawAttributes']);_0x501c00[_0x802e('0x30')]=_[_0x802e('0x2f')](_0x4ac31c[_0x802e('0x30')]);_0x501c00[_0x802e('0x31')]=_[_0x802e('0x32')](_0x501c00['model'],_0x501c00[_0x802e('0x30')]);_0x423ad4[_0x802e('0x33')]=_['intersection'](_0x501c00['model'],qs[_0x802e('0x34')](_0x4ac31c[_0x802e('0x30')][_0x802e('0x34')]));_0x423ad4[_0x802e('0x33')]=_0x423ad4[_0x802e('0x33')]['length']?_0x423ad4[_0x802e('0x33')]:_0x501c00[_0x802e('0x2e')];if(_0x4ac31c[_0x802e('0x30')][_0x802e('0x3f')]){_0x423ad4[_0x802e('0x40')]=[{'all':!![]}];}_0x423ad4=_['merge']({},_0x423ad4,_0x4ac31c[_0x802e('0x3e')]);return db[_0x802e('0x29')][_0x802e('0x45')](_0x423ad4)[_0x802e('0x21')](handleEntityNotFound(_0x4fa5cd,null))[_0x802e('0x21')](respondWithResult(_0x4fa5cd,null))[_0x802e('0x46')](handleError(_0x4fa5cd,null));};exports[_0x802e('0x47')]=function(_0x293d61,_0x3ae2a1){return db[_0x802e('0x29')][_0x802e('0x47')](_0x293d61[_0x802e('0x48')],{})['then'](respondWithResult(_0x3ae2a1,0xc9))[_0x802e('0x46')](handleError(_0x3ae2a1,null));};exports[_0x802e('0x20')]=function(_0x301ae7,_0x3d2048){if(_0x301ae7[_0x802e('0x48')]['id']){delete _0x301ae7[_0x802e('0x48')]['id'];}return db[_0x802e('0x29')][_0x802e('0x45')]({'where':{'id':_0x301ae7[_0x802e('0x44')]['id']}})['then'](handleEntityNotFound(_0x3d2048,null))[_0x802e('0x21')](saveUpdates(_0x301ae7[_0x802e('0x48')],null))[_0x802e('0x21')](respondWithResult(_0x3d2048,null))[_0x802e('0x46')](handleError(_0x3d2048,null));};exports[_0x802e('0x22')]=function(_0x4ce7de,_0x1894df){return db[_0x802e('0x29')]['find']({'where':{'id':_0x4ce7de[_0x802e('0x44')]['id']}})['then'](handleEntityNotFound(_0x1894df,null))[_0x802e('0x21')](removeEntity(_0x1894df,null))[_0x802e('0x46')](handleError(_0x1894df,null));}; \ No newline at end of file +var _0x18dc=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','then','destroy','error','stack','name','send','index','VtigerField','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','params','rawAttributes','catch','create','body','find','html-pdf','rimraf'];(function(_0x59b545,_0x3828a0){var _0x583fb7=function(_0x4f386a){while(--_0x4f386a){_0x59b545['push'](_0x59b545['shift']());}};_0x583fb7(++_0x3828a0);}(_0x18dc,0x94));var _0xc18d=function(_0x2c7341,_0x293a18){_0x2c7341=_0x2c7341-0x0;var _0x23f3fc=_0x18dc[_0x2c7341];return _0x23f3fc;};'use strict';var pdf=require(_0xc18d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc18d('0x1'));var zipdir=require(_0xc18d('0x2'));var jsonpatch=require(_0xc18d('0x3'));var rp=require(_0xc18d('0x4'));var moment=require(_0xc18d('0x5'));var BPromise=require(_0xc18d('0x6'));var Mustache=require('mustache');var util=require(_0xc18d('0x7'));var path=require(_0xc18d('0x8'));var sox=require(_0xc18d('0x9'));var csv=require(_0xc18d('0xa'));var ejs=require(_0xc18d('0xb'));var fs=require('fs');var _=require(_0xc18d('0xc'));var squel=require(_0xc18d('0xd'));var crypto=require(_0xc18d('0xe'));var jsforce=require(_0xc18d('0xf'));var deskjs=require(_0xc18d('0x10'));var toCsv=require(_0xc18d('0xa'));var querystring=require(_0xc18d('0x11'));var Papa=require('papaparse');var Redis=require(_0xc18d('0x12'));var authService=require(_0xc18d('0x13'));var qs=require(_0xc18d('0x14'));var as=require(_0xc18d('0x15'));var hardwareService=require(_0xc18d('0x16'));var logger=require(_0xc18d('0x17'))(_0xc18d('0x18'));var utils=require('../../config/utils');var config=require(_0xc18d('0x19'));var db=require(_0xc18d('0x1a'))['db'];function respondWithStatusCode(_0x4ad854,_0x10e1ff){_0x10e1ff=_0x10e1ff||0xcc;return function(_0xd1fd16){if(_0xd1fd16){return _0x4ad854[_0xc18d('0x1b')](_0x10e1ff);}return _0x4ad854[_0xc18d('0x1c')](_0x10e1ff)[_0xc18d('0x1d')]();};}function respondWithResult(_0x10f592,_0x1817a1){_0x1817a1=_0x1817a1||0xc8;return function(_0x205b3d){if(_0x205b3d){return _0x10f592[_0xc18d('0x1c')](_0x1817a1)[_0xc18d('0x1e')](_0x205b3d);}};}function respondWithFilteredResult(_0x57b12b,_0x2ec4d6){return function(_0x156e2b){if(_0x156e2b){var _0x268719=_0x156e2b[_0xc18d('0x1f')],_0x3f34c0=_0x2ec4d6[_0xc18d('0x20')],_0x3aa81d=_0x2ec4d6[_0xc18d('0x20')]+_0x2ec4d6[_0xc18d('0x21')],_0x5e1e21;if(_0x3aa81d>=_0x268719){_0x3aa81d=_0x268719;_0x5e1e21=0xc8;}else{_0x5e1e21=0xce;}_0x57b12b[_0xc18d('0x1c')](_0x5e1e21);return _0x57b12b['set'](_0xc18d('0x22'),_0x3f34c0+'-'+_0x3aa81d+'/'+_0x268719)['json'](_0x156e2b);}return null;};}function patchUpdates(_0x4f9b66){return function(_0x541785){try{jsonpatch['apply'](_0x541785,_0x4f9b66,!![]);}catch(_0x591a53){return BPromise[_0xc18d('0x23')](_0x591a53);}return _0x541785[_0xc18d('0x24')]();};}function saveUpdates(_0x2038f1,_0x1a13e4){return function(_0x5e0645){if(_0x5e0645){return _0x5e0645['update'](_0x2038f1)[_0xc18d('0x25')](function(_0xe03016){return _0xe03016;});}return null;};}function removeEntity(_0x23cada,_0x1bb49a){return function(_0x39e0c4){if(_0x39e0c4){return _0x39e0c4[_0xc18d('0x26')]()[_0xc18d('0x25')](function(){_0x23cada[_0xc18d('0x1c')](0xcc)[_0xc18d('0x1d')]();});}};}function handleEntityNotFound(_0x2ef9ca,_0x2f7e1f){return function(_0x527cf9){if(!_0x527cf9){_0x2ef9ca[_0xc18d('0x1b')](0x194);}return _0x527cf9;};}function handleError(_0x3c3be0,_0x1e8eb8){_0x1e8eb8=_0x1e8eb8||0x1f4;return function(_0x14b861){logger[_0xc18d('0x27')](_0x14b861[_0xc18d('0x28')]);if(_0x14b861[_0xc18d('0x29')]){delete _0x14b861[_0xc18d('0x29')];}_0x3c3be0[_0xc18d('0x1c')](_0x1e8eb8)[_0xc18d('0x2a')](_0x14b861);};}exports[_0xc18d('0x2b')]=function(_0x230236,_0x1e7347){var _0x3b66da={},_0x25103a={},_0x305e04={'count':0x0,'rows':[]};var _0x1ada6b=_['map'](db[_0xc18d('0x2c')]['rawAttributes'],function(_0x482d35){return{'name':_0x482d35['fieldName'],'type':_0x482d35['type'][_0xc18d('0x2d')]};});_0x25103a[_0xc18d('0x2e')]=_[_0xc18d('0x2f')](_0x1ada6b,_0xc18d('0x29'));_0x25103a[_0xc18d('0x30')]=_[_0xc18d('0x31')](_0x230236['query']);_0x25103a[_0xc18d('0x32')]=_[_0xc18d('0x33')](_0x25103a[_0xc18d('0x2e')],_0x25103a['query']);_0x3b66da[_0xc18d('0x34')]=_[_0xc18d('0x33')](_0x25103a[_0xc18d('0x2e')],qs[_0xc18d('0x35')](_0x230236[_0xc18d('0x30')]['fields']));_0x3b66da['attributes']=_0x3b66da[_0xc18d('0x34')][_0xc18d('0x36')]?_0x3b66da['attributes']:_0x25103a[_0xc18d('0x2e')];if(!_0x230236[_0xc18d('0x30')][_0xc18d('0x37')](_0xc18d('0x38'))){_0x3b66da['limit']=qs[_0xc18d('0x21')](_0x230236['query'][_0xc18d('0x21')]);_0x3b66da['offset']=qs[_0xc18d('0x20')](_0x230236[_0xc18d('0x30')][_0xc18d('0x20')]);}_0x3b66da[_0xc18d('0x39')]=qs[_0xc18d('0x3a')](_0x230236['query'][_0xc18d('0x3a')]);_0x3b66da[_0xc18d('0x3b')]=qs[_0xc18d('0x32')](_[_0xc18d('0x3c')](_0x230236['query'],_0x25103a[_0xc18d('0x32')]));if(_0x230236[_0xc18d('0x30')][_0xc18d('0x3d')]){_0x3b66da[_0xc18d('0x3b')]=_[_0xc18d('0x3e')](_0x3b66da[_0xc18d('0x3b')],{'$or':_[_0xc18d('0x2f')](_0x1ada6b,function(_0x7a34fe){if(_0x7a34fe[_0xc18d('0x3f')]!==_0xc18d('0x40')){var _0x18fa8b={};_0x18fa8b[_0x7a34fe[_0xc18d('0x29')]]={'$like':'%'+_0x230236[_0xc18d('0x30')][_0xc18d('0x3d')]+'%'};return _0x18fa8b;}})});}_0x3b66da=_[_0xc18d('0x3e')]({},_0x3b66da,_0x230236[_0xc18d('0x41')]);var _0x6833a0={'where':_0x3b66da['where']};return db['VtigerField'][_0xc18d('0x1f')](_0x6833a0)['then'](function(_0x2aff84){_0x305e04[_0xc18d('0x1f')]=_0x2aff84;if(_0x230236[_0xc18d('0x30')][_0xc18d('0x42')]){_0x3b66da[_0xc18d('0x43')]=[{'all':!![]}];}return db['VtigerField']['findAll'](_0x3b66da);})['then'](function(_0x375cbf){_0x305e04[_0xc18d('0x44')]=_0x375cbf;return _0x305e04;})[_0xc18d('0x25')](respondWithFilteredResult(_0x1e7347,_0x3b66da))['catch'](handleError(_0x1e7347,null));};exports['show']=function(_0x132edd,_0x4ca6be){var _0x1b5d25={'raw':!![],'where':{'id':_0x132edd[_0xc18d('0x45')]['id']}},_0x5375ab={};_0x5375ab[_0xc18d('0x2e')]=_['keys'](db['VtigerField'][_0xc18d('0x46')]);_0x5375ab[_0xc18d('0x30')]=_[_0xc18d('0x31')](_0x132edd['query']);_0x5375ab[_0xc18d('0x32')]=_[_0xc18d('0x33')](_0x5375ab[_0xc18d('0x2e')],_0x5375ab[_0xc18d('0x30')]);_0x1b5d25['attributes']=_[_0xc18d('0x33')](_0x5375ab['model'],qs[_0xc18d('0x35')](_0x132edd[_0xc18d('0x30')][_0xc18d('0x35')]));_0x1b5d25[_0xc18d('0x34')]=_0x1b5d25[_0xc18d('0x34')][_0xc18d('0x36')]?_0x1b5d25[_0xc18d('0x34')]:_0x5375ab[_0xc18d('0x2e')];if(_0x132edd[_0xc18d('0x30')]['includeAll']){_0x1b5d25['include']=[{'all':!![]}];}_0x1b5d25=_[_0xc18d('0x3e')]({},_0x1b5d25,_0x132edd[_0xc18d('0x41')]);return db[_0xc18d('0x2c')]['find'](_0x1b5d25)[_0xc18d('0x25')](handleEntityNotFound(_0x4ca6be,null))[_0xc18d('0x25')](respondWithResult(_0x4ca6be,null))[_0xc18d('0x47')](handleError(_0x4ca6be,null));};exports[_0xc18d('0x48')]=function(_0x1e38df,_0x427ee2){return db[_0xc18d('0x2c')]['create'](_0x1e38df[_0xc18d('0x49')],{})['then'](respondWithResult(_0x427ee2,0xc9))[_0xc18d('0x47')](handleError(_0x427ee2,null));};exports['update']=function(_0xf72326,_0x157ab0){if(_0xf72326[_0xc18d('0x49')]['id']){delete _0xf72326[_0xc18d('0x49')]['id'];}return db['VtigerField'][_0xc18d('0x4a')]({'where':{'id':_0xf72326['params']['id']}})[_0xc18d('0x25')](handleEntityNotFound(_0x157ab0,null))[_0xc18d('0x25')](saveUpdates(_0xf72326[_0xc18d('0x49')],null))[_0xc18d('0x25')](respondWithResult(_0x157ab0,null))[_0xc18d('0x47')](handleError(_0x157ab0,null));};exports[_0xc18d('0x26')]=function(_0x5d4c6d,_0x5daef5){return db[_0xc18d('0x2c')][_0xc18d('0x4a')]({'where':{'id':_0x5d4c6d[_0xc18d('0x45')]['id']}})[_0xc18d('0x25')](handleEntityNotFound(_0x5daef5,null))[_0xc18d('0x25')](removeEntity(_0x5daef5,null))['catch'](handleError(_0x5daef5,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 4b89310..6a61d5f 100644 --- a/server/api/intVtigerField/intVtigerField.model.js +++ b/server/api/intVtigerField/intVtigerField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['int_vtiger_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0x38e138,_0x57eb17){var _0xf27fb5=function(_0x3a3dd7){while(--_0x3a3dd7){_0x38e138['push'](_0x38e138['shift']());}};_0xf27fb5(++_0x57eb17);}(_0x7a54,0x106));var _0x47a5=function(_0x5b4afa,_0x1ead1d){_0x5b4afa=_0x5b4afa-0x0;var _0x4f6e0d=_0x7a54[_0x5b4afa];return _0x4f6e0d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['rimraf','./intVtigerField.attributes','exports','define','VtigerField','vtiger_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index a9230bf..ee8f3a0 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 _0xee4f=['VtigerField,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','client','then','info','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x2de8eb,_0x265f10){var _0x29068a=function(_0x57cbfc){while(--_0x57cbfc){_0x2de8eb['push'](_0x2de8eb['shift']());}};_0x29068a(++_0x265f10);}(_0xee4f,0xad));var _0xfee4=function(_0x4157b9,_0x147461){_0x4157b9=_0x4157b9-0x0;var _0x457d88=_0xee4f[_0x4157b9];return _0x457d88;};'use strict';var _=require(_0xfee4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfee4('0x1'));var rs=require(_0xfee4('0x2'));var fs=require('fs');var Redis=require(_0xfee4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfee4('0x4'));var logger=require('../../config/logger')(_0xfee4('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfee4('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52fb6b,_0x2fb1b3,_0x16cc9a){return new BPromise(function(_0x34908a,_0x4d3c71){return client['request'](_0x52fb6b,_0x16cc9a)[_0xfee4('0x7')](function(_0x11556d){logger[_0xfee4('0x8')]('VtigerField,\x20%s,\x20%s',_0x2fb1b3,'request\x20sent');logger[_0xfee4('0x9')](_0xfee4('0xa'),_0x2fb1b3,_0xfee4('0xb'),JSON['stringify'](_0x11556d));if(_0x11556d[_0xfee4('0xc')]){if(_0x11556d[_0xfee4('0xc')][_0xfee4('0xd')]===0x1f4){logger[_0xfee4('0xc')](_0xfee4('0xe'),_0x2fb1b3,_0x11556d[_0xfee4('0xc')][_0xfee4('0xf')]);return _0x4d3c71(_0x11556d['error'][_0xfee4('0xf')]);}logger[_0xfee4('0xc')]('VtigerField,\x20%s,\x20%s',_0x2fb1b3,_0x11556d[_0xfee4('0xc')][_0xfee4('0xf')]);return _0x34908a(_0x11556d[_0xfee4('0xc')][_0xfee4('0xf')]);}else{logger[_0xfee4('0x8')](_0xfee4('0xe'),_0x2fb1b3,_0xfee4('0xb'));_0x34908a(_0x11556d['result'][_0xfee4('0xf')]);}})[_0xfee4('0x10')](function(_0x437979){logger['error'](_0xfee4('0xe'),_0x2fb1b3,_0x437979);_0x4d3c71(_0x437979);});});} \ No newline at end of file +var _0xf682=['VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info'];(function(_0x2e3ec4,_0x55dc6b){var _0x35027f=function(_0x408111){while(--_0x408111){_0x2e3ec4['push'](_0x2e3ec4['shift']());}};_0x35027f(++_0x55dc6b);}(_0xf682,0x12f));var _0x2f68=function(_0x389c3f,_0x57bc9e){_0x389c3f=_0x389c3f-0x0;var _0x2060e0=_0xf682[_0x389c3f];return _0x2060e0;};'use strict';var _=require(_0x2f68('0x0'));var util=require(_0x2f68('0x1'));var moment=require(_0x2f68('0x2'));var BPromise=require(_0x2f68('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f68('0x4'))['db'];var utils=require(_0x2f68('0x5'));var logger=require(_0x2f68('0x6'))(_0x2f68('0x7'));var config=require('../../config/environment');var jayson=require(_0x2f68('0x8'));var client=jayson[_0x2f68('0x9')][_0x2f68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c4e31,_0x48624e,_0x2523dc){return new BPromise(function(_0x3a4dad,_0x56d93c){return client['request'](_0x3c4e31,_0x2523dc)['then'](function(_0x57a6b0){logger[_0x2f68('0xb')](_0x2f68('0xc'),_0x48624e,_0x2f68('0xd'));logger[_0x2f68('0xe')](_0x2f68('0xf'),_0x48624e,_0x2f68('0xd'),JSON[_0x2f68('0x10')](_0x57a6b0));if(_0x57a6b0[_0x2f68('0x11')]){if(_0x57a6b0[_0x2f68('0x11')][_0x2f68('0x12')]===0x1f4){logger[_0x2f68('0x11')](_0x2f68('0xc'),_0x48624e,_0x57a6b0[_0x2f68('0x11')][_0x2f68('0x13')]);return _0x56d93c(_0x57a6b0[_0x2f68('0x11')][_0x2f68('0x13')]);}logger['error'](_0x2f68('0xc'),_0x48624e,_0x57a6b0[_0x2f68('0x11')][_0x2f68('0x13')]);return _0x3a4dad(_0x57a6b0[_0x2f68('0x11')][_0x2f68('0x13')]);}else{logger[_0x2f68('0xb')](_0x2f68('0xc'),_0x48624e,_0x2f68('0xd'));_0x3a4dad(_0x57a6b0['result'][_0x2f68('0x13')]);}})[_0x2f68('0x14')](function(_0xc2b460){logger['error'](_0x2f68('0xc'),_0x48624e,_0xc2b460);_0x56d93c(_0xc2b460);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index d07da80..36f92c6 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 _0x56e5=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0x3b95bc,_0x5a01be){var _0x3b7405=function(_0x28850d){while(--_0x28850d){_0x3b95bc['push'](_0x3b95bc['shift']());}};_0x3b7405(++_0x5a01be);}(_0x56e5,0x14d));var _0x556e=function(_0x31ae9c,_0x33e5cb){_0x31ae9c=_0x31ae9c-0x0;var _0x2012a2=_0x56e5[_0x31ae9c];return _0x2012a2;};'use strict';var multer=require(_0x556e('0x0'));var util=require(_0x556e('0x1'));var path=require(_0x556e('0x2'));var timeout=require(_0x556e('0x3'));var express=require(_0x556e('0x4'));var router=express[_0x556e('0x5')]();var auth=require(_0x556e('0x6'));var interaction=require(_0x556e('0x7'));var config=require(_0x556e('0x8'));var controller=require('./intZendeskAccount.controller');router['get']('/',auth[_0x556e('0x9')](),controller[_0x556e('0xa')]);router[_0x556e('0xb')](_0x556e('0xc'),auth[_0x556e('0x9')](),controller[_0x556e('0xd')]);router[_0x556e('0xb')](_0x556e('0xe'),auth[_0x556e('0x9')](),controller[_0x556e('0xf')]);router[_0x556e('0xb')](_0x556e('0x10'),auth[_0x556e('0x9')](),controller['getFields']);router[_0x556e('0x11')]('/',auth[_0x556e('0x9')](),controller[_0x556e('0x12')]);router[_0x556e('0x11')](_0x556e('0xe'),auth[_0x556e('0x9')](),controller['addConfiguration']);router[_0x556e('0x13')](_0x556e('0xc'),auth[_0x556e('0x9')](),controller[_0x556e('0x14')]);router[_0x556e('0x15')](_0x556e('0xc'),auth[_0x556e('0x9')](),controller[_0x556e('0x16')]);module['exports']=router; \ No newline at end of file +var _0x2985=['get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5c5cfb,_0x856fe6){var _0xb89878=function(_0x32e5d4){while(--_0x32e5d4){_0x5c5cfb['push'](_0x5c5cfb['shift']());}};_0xb89878(++_0x856fe6);}(_0x2985,0x1c0));var _0x5298=function(_0x3ca909,_0x4c4bb1){_0x3ca909=_0x3ca909-0x0;var _0x35168e=_0x2985[_0x3ca909];return _0x35168e;};'use strict';var multer=require(_0x5298('0x0'));var util=require(_0x5298('0x1'));var path=require(_0x5298('0x2'));var timeout=require(_0x5298('0x3'));var express=require('express');var router=express[_0x5298('0x4')]();var auth=require(_0x5298('0x5'));var interaction=require(_0x5298('0x6'));var config=require(_0x5298('0x7'));var controller=require('./intZendeskAccount.controller');router[_0x5298('0x8')]('/',auth['isAuthenticated'](),controller[_0x5298('0x9')]);router[_0x5298('0x8')](_0x5298('0xa'),auth[_0x5298('0xb')](),controller[_0x5298('0xc')]);router['get'](_0x5298('0xd'),auth[_0x5298('0xb')](),controller[_0x5298('0xe')]);router[_0x5298('0x8')](_0x5298('0xf'),auth[_0x5298('0xb')](),controller[_0x5298('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5298('0x11')]);router[_0x5298('0x12')](_0x5298('0xd'),auth[_0x5298('0xb')](),controller['addConfiguration']);router[_0x5298('0x13')](_0x5298('0xa'),auth['isAuthenticated'](),controller[_0x5298('0x14')]);router[_0x5298('0x15')](_0x5298('0xa'),auth[_0x5298('0xb')](),controller[_0x5298('0x16')]);module[_0x5298('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 7c95994..a9f7f73 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 _0x01c1=['STRING','username','remoteUri','ENUM','password','integrationTab','newTab'];(function(_0x4aac5a,_0x15b04c){var _0x42e7bc=function(_0x1da766){while(--_0x1da766){_0x4aac5a['push'](_0x4aac5a['shift']());}};_0x42e7bc(++_0x15b04c);}(_0x01c1,0xa1));var _0x101c=function(_0x39db34,_0x399131){_0x39db34=_0x39db34-0x0;var _0x283a0c=_0x01c1[_0x39db34];return _0x283a0c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x101c('0x0')]},'description':{'type':Sequelize[_0x101c('0x0')]},'username':{'type':Sequelize[_0x101c('0x0')],'unique':_0x101c('0x1')},'password':{'type':Sequelize[_0x101c('0x0')]},'token':{'type':Sequelize[_0x101c('0x0')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x101c('0x2')},'authType':{'type':Sequelize[_0x101c('0x3')](_0x101c('0x4'),'token'),'defaultValue':_0x101c('0x4')},'serverUrl':{'type':Sequelize[_0x101c('0x0')]},'type':{'type':Sequelize[_0x101c('0x3')](_0x101c('0x5'),_0x101c('0x6')),'defaultValue':_0x101c('0x5')}}; \ No newline at end of file +var _0x84fc=['sequelize','exports','STRING','username','remoteUri','ENUM','password','token','integrationTab','newTab'];(function(_0x185759,_0x403f7b){var _0x54ad04=function(_0x37882d){while(--_0x37882d){_0x185759['push'](_0x185759['shift']());}};_0x54ad04(++_0x403f7b);}(_0x84fc,0x186));var _0xc84f=function(_0x52c538,_0x48f45a){_0x52c538=_0x52c538-0x0;var _0x33cb72=_0x84fc[_0x52c538];return _0x33cb72;};'use strict';var Sequelize=require(_0xc84f('0x0'));module[_0xc84f('0x1')]={'name':{'type':Sequelize[_0xc84f('0x2')]},'description':{'type':Sequelize[_0xc84f('0x2')]},'username':{'type':Sequelize[_0xc84f('0x2')],'unique':_0xc84f('0x3')},'password':{'type':Sequelize[_0xc84f('0x2')]},'token':{'type':Sequelize[_0xc84f('0x2')]},'remoteUri':{'type':Sequelize[_0xc84f('0x2')],'unique':_0xc84f('0x4')},'authType':{'type':Sequelize[_0xc84f('0x5')](_0xc84f('0x6'),_0xc84f('0x7')),'defaultValue':_0xc84f('0x6')},'serverUrl':{'type':Sequelize[_0xc84f('0x2')]},'type':{'type':Sequelize[_0xc84f('0x5')](_0xc84f('0x8'),_0xc84f('0x9')),'defaultValue':_0xc84f('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 7ca215d..f1a3b9a 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 _0x29b4=['lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','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','ZendeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','json','count','offset','limit','Content-Range','reject','update','destroy','end','stack','name','send','index','rawAttributes','fieldName','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','ZendeskAccount','includeAll','include','rows','show','params','keys','find','create','body','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','Subjects','channel','getDescriptions','ZendeskField','getFields','username','password','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','authType','headers','Basic\x20%s','base64','token','subject','description','assignee','remove','includes','position','title','system_field_options','custom_field_options','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs'];(function(_0xdba0c,_0x3b4e25){var _0x3f19c4=function(_0x25e8e9){while(--_0x25e8e9){_0xdba0c['push'](_0xdba0c['shift']());}};_0x3f19c4(++_0x3b4e25);}(_0x29b4,0x15b));var _0x429b=function(_0x1105be,_0x1959a5){_0x1105be=_0x1105be-0x0;var _0x100c16=_0x29b4[_0x1105be];return _0x100c16;};'use strict';var pdf=require(_0x429b('0x0'));var emlformat=require(_0x429b('0x1'));var rimraf=require(_0x429b('0x2'));var zipdir=require(_0x429b('0x3'));var jsonpatch=require(_0x429b('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x429b('0x5'));var util=require(_0x429b('0x6'));var path=require(_0x429b('0x7'));var sox=require('sox');var csv=require(_0x429b('0x8'));var ejs=require(_0x429b('0x9'));var fs=require('fs');var _=require(_0x429b('0xa'));var squel=require(_0x429b('0xb'));var crypto=require('crypto');var jsforce=require(_0x429b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x429b('0x8'));var querystring=require('querystring');var Papa=require(_0x429b('0xd'));var Redis=require(_0x429b('0xe'));var authService=require(_0x429b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x429b('0x10'));var hardwareService=require(_0x429b('0x11'));var logger=require(_0x429b('0x12'))(_0x429b('0x13'));var utils=require(_0x429b('0x14'));var config=require(_0x429b('0x15'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x429b('0x16'));var client=jayson[_0x429b('0x17')][_0x429b('0x18')]({'port':0x232a});function checkPasswordPattern(_0x4c3a5e,_0x46248f,_0x9ffbb3){if(_0x9ffbb3){var _0x2a7737=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2a7737[_0x429b('0x19')](_0x46248f)){return _0x4c3a5e;}else{throw new db[(_0x429b('0x1a'))][(_0x429b('0x1b'))](_0x429b('0x1c'));}}else{return _0x4c3a5e;}}function respondWithRpcPromise(_0x5b32b2,_0x444816,_0x5ac30c,_0x58c77e){return new BPromise(function(_0x189209,_0x57afd2){var _0x5508c3=_0x58c77e||client;return _0x5508c3[_0x429b('0x1d')](_0x5b32b2,_0x5ac30c)[_0x429b('0x1e')](function(_0x55f589){logger[_0x429b('0x1f')](_0x429b('0x20'),_0x444816,_0x429b('0x21'));logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x444816,_0x429b('0x21'),JSON[_0x429b('0x22')](_0x55f589));if(_0x55f589[_0x429b('0x23')]){if(_0x55f589[_0x429b('0x23')][_0x429b('0x24')]===0x1f4){logger[_0x429b('0x23')](_0x429b('0x20'),_0x444816,_0x55f589[_0x429b('0x23')]['message']);return _0x57afd2(_0x55f589['error']['message']);}logger[_0x429b('0x23')](_0x429b('0x20'),_0x444816,_0x55f589[_0x429b('0x23')][_0x429b('0x25')]);return _0x189209(_0x55f589[_0x429b('0x23')]['message']);}else{logger[_0x429b('0x1f')](_0x429b('0x20'),_0x444816,_0x429b('0x21'));_0x189209(_0x55f589[_0x429b('0x26')][_0x429b('0x25')]);}})[_0x429b('0x27')](function(_0x4b0e53){logger[_0x429b('0x23')](_0x429b('0x20'),_0x444816,_0x4b0e53);_0x57afd2(_0x4b0e53);});});}function respondWithStatusCode(_0x9e679d,_0x11d2d4){_0x11d2d4=_0x11d2d4||0xcc;return function(_0x2623c3){if(_0x2623c3){return _0x9e679d['sendStatus'](_0x11d2d4);}return _0x9e679d['status'](_0x11d2d4)['end']();};}function respondWithResult(_0x3cb407,_0x506e25){_0x506e25=_0x506e25||0xc8;return function(_0x294b2b){if(_0x294b2b){return _0x3cb407[_0x429b('0x28')](_0x506e25)[_0x429b('0x29')](_0x294b2b);}};}function respondWithFilteredResult(_0x251d6f,_0x308a04){return function(_0x46d531){if(_0x46d531){var _0x402ca4=_0x46d531[_0x429b('0x2a')],_0x3a8bd7=_0x308a04[_0x429b('0x2b')],_0x3d0358=_0x308a04['offset']+_0x308a04[_0x429b('0x2c')],_0x229049;if(_0x3d0358>=_0x402ca4){_0x3d0358=_0x402ca4;_0x229049=0xc8;}else{_0x229049=0xce;}_0x251d6f[_0x429b('0x28')](_0x229049);return _0x251d6f['set'](_0x429b('0x2d'),_0x3a8bd7+'-'+_0x3d0358+'/'+_0x402ca4)[_0x429b('0x29')](_0x46d531);}return null;};}function patchUpdates(_0x242ee2){return function(_0x10287e){try{jsonpatch['apply'](_0x10287e,_0x242ee2,!![]);}catch(_0xd54aa1){return BPromise[_0x429b('0x2e')](_0xd54aa1);}return _0x10287e['save']();};}function saveUpdates(_0x55f023,_0x132591){return function(_0x347d3f){if(_0x347d3f){return _0x347d3f[_0x429b('0x2f')](_0x55f023)['then'](function(_0x28f862){return _0x28f862;});}return null;};}function removeEntity(_0x1b87d8,_0x257037){return function(_0x1bc3f5){if(_0x1bc3f5){return _0x1bc3f5[_0x429b('0x30')]()[_0x429b('0x1e')](function(){_0x1b87d8[_0x429b('0x28')](0xcc)[_0x429b('0x31')]();});}};}function handleEntityNotFound(_0x5af631,_0x9423a2){return function(_0x2cc8e3){if(!_0x2cc8e3){_0x5af631['sendStatus'](0x194);}return _0x2cc8e3;};}function handleError(_0x429bde,_0x1dce9f){_0x1dce9f=_0x1dce9f||0x1f4;return function(_0x2e93ef){logger[_0x429b('0x23')](_0x2e93ef[_0x429b('0x32')]);if(_0x2e93ef[_0x429b('0x33')]){delete _0x2e93ef[_0x429b('0x33')];}_0x429bde[_0x429b('0x28')](_0x1dce9f)[_0x429b('0x34')](_0x2e93ef);};}exports[_0x429b('0x35')]=function(_0x1c7bb2,_0x3eb3af){var _0x382be5={},_0x262c95={},_0x15aa18={'count':0x0,'rows':[]};var _0x23caab=_['map'](db['ZendeskAccount'][_0x429b('0x36')],function(_0x3407bc){return{'name':_0x3407bc[_0x429b('0x37')],'type':_0x3407bc['type']['key']};});_0x262c95[_0x429b('0x38')]=_[_0x429b('0x39')](_0x23caab,_0x429b('0x33'));_0x262c95[_0x429b('0x3a')]=_['keys'](_0x1c7bb2[_0x429b('0x3a')]);_0x262c95[_0x429b('0x3b')]=_[_0x429b('0x3c')](_0x262c95[_0x429b('0x38')],_0x262c95[_0x429b('0x3a')]);_0x382be5['attributes']=_[_0x429b('0x3c')](_0x262c95['model'],qs[_0x429b('0x3d')](_0x1c7bb2[_0x429b('0x3a')]['fields']));_0x382be5[_0x429b('0x3e')]=_0x382be5[_0x429b('0x3e')][_0x429b('0x3f')]?_0x382be5[_0x429b('0x3e')]:_0x262c95[_0x429b('0x38')];if(!_0x1c7bb2['query'][_0x429b('0x40')](_0x429b('0x41'))){_0x382be5[_0x429b('0x2c')]=qs[_0x429b('0x2c')](_0x1c7bb2[_0x429b('0x3a')][_0x429b('0x2c')]);_0x382be5['offset']=qs[_0x429b('0x2b')](_0x1c7bb2['query'][_0x429b('0x2b')]);}_0x382be5[_0x429b('0x42')]=qs[_0x429b('0x43')](_0x1c7bb2['query']['sort']);_0x382be5['where']=qs[_0x429b('0x3b')](_[_0x429b('0x44')](_0x1c7bb2['query'],_0x262c95['filters']));if(_0x1c7bb2[_0x429b('0x3a')][_0x429b('0x45')]){_0x382be5['where']=_[_0x429b('0x46')](_0x382be5[_0x429b('0x47')],{'$or':_[_0x429b('0x39')](_0x23caab,function(_0x12fc07){if(_0x12fc07[_0x429b('0x48')]!==_0x429b('0x49')){var _0x278411={};_0x278411[_0x12fc07[_0x429b('0x33')]]={'$like':'%'+_0x1c7bb2[_0x429b('0x3a')][_0x429b('0x45')]+'%'};return _0x278411;}})});}_0x382be5=_[_0x429b('0x46')]({},_0x382be5,_0x1c7bb2[_0x429b('0x4a')]);var _0x3278b7={'where':_0x382be5[_0x429b('0x47')]};return db[_0x429b('0x4b')][_0x429b('0x2a')](_0x3278b7)[_0x429b('0x1e')](function(_0x36017c){_0x15aa18[_0x429b('0x2a')]=_0x36017c;if(_0x1c7bb2['query'][_0x429b('0x4c')]){_0x382be5[_0x429b('0x4d')]=[{'all':!![]}];}return db[_0x429b('0x4b')]['findAll'](_0x382be5);})['then'](function(_0xc76430){_0x15aa18[_0x429b('0x4e')]=_0xc76430;return _0x15aa18;})[_0x429b('0x1e')](respondWithFilteredResult(_0x3eb3af,_0x382be5))[_0x429b('0x27')](handleError(_0x3eb3af,null));};exports[_0x429b('0x4f')]=function(_0x84987e,_0x2e3e1b){var _0x5db819={'raw':![],'where':{'id':_0x84987e[_0x429b('0x50')]['id']}},_0x422e97={};_0x422e97[_0x429b('0x38')]=_[_0x429b('0x51')](db['ZendeskAccount'][_0x429b('0x36')]);_0x422e97[_0x429b('0x3a')]=_[_0x429b('0x51')](_0x84987e[_0x429b('0x3a')]);_0x422e97[_0x429b('0x3b')]=_[_0x429b('0x3c')](_0x422e97[_0x429b('0x38')],_0x422e97[_0x429b('0x3a')]);_0x5db819[_0x429b('0x3e')]=_[_0x429b('0x3c')](_0x422e97[_0x429b('0x38')],qs[_0x429b('0x3d')](_0x84987e[_0x429b('0x3a')][_0x429b('0x3d')]));_0x5db819[_0x429b('0x3e')]=_0x5db819[_0x429b('0x3e')][_0x429b('0x3f')]?_0x5db819[_0x429b('0x3e')]:_0x422e97[_0x429b('0x38')];if(_0x84987e[_0x429b('0x3a')]['includeAll']){_0x5db819[_0x429b('0x4d')]=[{'all':!![]}];}_0x5db819=_[_0x429b('0x46')]({},_0x5db819,_0x84987e[_0x429b('0x4a')]);return db[_0x429b('0x4b')][_0x429b('0x52')](_0x5db819)[_0x429b('0x1e')](handleEntityNotFound(_0x2e3e1b,null))['then'](respondWithResult(_0x2e3e1b,null))[_0x429b('0x27')](handleError(_0x2e3e1b,null));};exports[_0x429b('0x53')]=function(_0x167c38,_0x56cc0a){return db[_0x429b('0x4b')][_0x429b('0x53')](_0x167c38[_0x429b('0x54')],{})[_0x429b('0x1e')](respondWithResult(_0x56cc0a,0xc9))[_0x429b('0x27')](handleError(_0x56cc0a,null));};exports[_0x429b('0x2f')]=function(_0x5ae03f,_0x57ceb7){if(_0x5ae03f['body']['id']){delete _0x5ae03f[_0x429b('0x54')]['id'];}return db[_0x429b('0x4b')][_0x429b('0x52')]({'where':{'id':_0x5ae03f[_0x429b('0x50')]['id']}})[_0x429b('0x1e')](handleEntityNotFound(_0x57ceb7,null))['then'](saveUpdates(_0x5ae03f[_0x429b('0x54')],null))[_0x429b('0x1e')](respondWithResult(_0x57ceb7,null))[_0x429b('0x27')](handleError(_0x57ceb7,null));};exports[_0x429b('0x30')]=function(_0x58949f,_0x296b6f){return db[_0x429b('0x4b')][_0x429b('0x52')]({'where':{'id':_0x58949f[_0x429b('0x50')]['id']}})[_0x429b('0x1e')](handleEntityNotFound(_0x296b6f,null))[_0x429b('0x1e')](removeEntity(_0x296b6f,null))[_0x429b('0x27')](handleError(_0x296b6f,null));};exports[_0x429b('0x55')]=function(_0x58dc14,_0xe20f6d,_0x47e7ea){var _0x40f9d2={};var _0x1e48e6={};var _0x31a52c;var _0x1dce00;return db[_0x429b('0x4b')][_0x429b('0x56')]({'where':{'id':_0x58dc14[_0x429b('0x50')]['id']}})['then'](handleEntityNotFound(_0xe20f6d,null))[_0x429b('0x1e')](function(_0x2f09a6){if(_0x2f09a6){_0x31a52c=_0x2f09a6;_0x1e48e6['model']=_[_0x429b('0x51')](db[_0x429b('0x57')][_0x429b('0x36')]);_0x1e48e6[_0x429b('0x3a')]=_[_0x429b('0x51')](_0x58dc14[_0x429b('0x3a')]);_0x1e48e6[_0x429b('0x3b')]=_['intersection'](_0x1e48e6[_0x429b('0x38')],_0x1e48e6[_0x429b('0x3a')]);_0x40f9d2[_0x429b('0x3e')]=_['intersection'](_0x1e48e6[_0x429b('0x38')],qs[_0x429b('0x3d')](_0x58dc14['query']['fields']));_0x40f9d2[_0x429b('0x3e')]=_0x40f9d2[_0x429b('0x3e')]['length']?_0x40f9d2[_0x429b('0x3e')]:_0x1e48e6[_0x429b('0x38')];_0x40f9d2[_0x429b('0x42')]=qs['sort'](_0x58dc14[_0x429b('0x3a')][_0x429b('0x43')]);_0x40f9d2[_0x429b('0x47')]=qs['filters'](_[_0x429b('0x44')](_0x58dc14[_0x429b('0x3a')],_0x1e48e6[_0x429b('0x3b')]));if(_0x58dc14[_0x429b('0x3a')][_0x429b('0x45')]){_0x40f9d2[_0x429b('0x47')]=_[_0x429b('0x46')](_0x40f9d2[_0x429b('0x47')],{'$or':_[_0x429b('0x39')](_0x40f9d2[_0x429b('0x3e')],function(_0x575cd0){var _0x14a462={};_0x14a462[_0x575cd0]={'$like':'%'+_0x58dc14[_0x429b('0x3a')][_0x429b('0x45')]+'%'};return _0x14a462;})});}_0x40f9d2=_[_0x429b('0x46')]({},_0x40f9d2,_0x58dc14[_0x429b('0x4a')]);return _0x31a52c[_0x429b('0x55')](_0x40f9d2);}})[_0x429b('0x1e')](function(_0x2b511d){if(_0x2b511d){_0x1dce00=_0x2b511d[_0x429b('0x3f')];if(!_0x58dc14[_0x429b('0x3a')][_0x429b('0x40')]('nolimit')){_0x40f9d2[_0x429b('0x2c')]=qs[_0x429b('0x2c')](_0x58dc14[_0x429b('0x3a')][_0x429b('0x2c')]);_0x40f9d2[_0x429b('0x2b')]=qs['offset'](_0x58dc14[_0x429b('0x3a')][_0x429b('0x2b')]);}return _0x31a52c[_0x429b('0x55')](_0x40f9d2);}})['then'](function(_0xdcfba0){if(_0xdcfba0){return _0xdcfba0?{'count':_0x1dce00,'rows':_0xdcfba0}:null;}})[_0x429b('0x1e')](respondWithResult(_0xe20f6d,null))[_0x429b('0x27')](handleError(_0xe20f6d,null));};exports[_0x429b('0x58')]=function(_0x3c68b9,_0x58d3b3,_0x216500){if(_0x3c68b9['body']['id']){delete _0x3c68b9['body']['id'];}return db[_0x429b('0x4b')][_0x429b('0x56')]({'where':{'id':_0x3c68b9[_0x429b('0x50')]['id']}})[_0x429b('0x1e')](handleEntityNotFound(_0x58d3b3,null))[_0x429b('0x1e')](function(_0x34fcb7){if(_0x34fcb7){_0x3c68b9[_0x429b('0x54')][_0x429b('0x59')]=_0x34fcb7['id'];_0x3c68b9[_0x429b('0x54')][_0x429b('0x5a')]=integrations['getSubjects'](_0x3c68b9[_0x429b('0x54')][_0x429b('0x5b')],_0x3c68b9[_0x429b('0x54')][_0x429b('0x48')]);_0x3c68b9[_0x429b('0x54')]['Descriptions']=integrations[_0x429b('0x5c')](_0x3c68b9[_0x429b('0x54')]['channel'],_0x3c68b9[_0x429b('0x54')][_0x429b('0x48')]);return db['ZendeskConfiguration']['create'](_0x3c68b9[_0x429b('0x54')],{'include':[{'model':db[_0x429b('0x5d')],'as':_0x429b('0x5a')},{'model':db[_0x429b('0x5d')],'as':'Descriptions'}]});}return null;})[_0x429b('0x1e')](respondWithResult(_0x58d3b3,null))[_0x429b('0x27')](handleError(_0x58d3b3,null));};exports[_0x429b('0x5e')]=function(_0x44a9b5,_0x3fc7a0,_0x1dccdf){var _0x1a1f68='';return db['ZendeskAccount'][_0x429b('0x56')]({'where':{'id':_0x44a9b5[_0x429b('0x50')]['id']},'attributes':['id',_0x429b('0x5f'),_0x429b('0x60'),'token','authType','remoteUri']})[_0x429b('0x1e')](handleEntityNotFound(_0x3fc7a0,null))['then'](function(_0x44eafb){if(_0x44eafb){_0x1a1f68=_0x44eafb['remoteUri'];var _0x5d271b=_0x1a1f68[_0x429b('0x61')](-0x1);if(_0x5d271b==='/'){_0x1a1f68=_0x1a1f68[_0x429b('0x62')](0x0,_0x1a1f68[_0x429b('0x63')](_0x5d271b));}var _0x3e2acd={'method':_0x429b('0x64'),'uri':util[_0x429b('0x65')](_0x429b('0x66'),_0x1a1f68,_0x429b('0x67')),'json':!![]};switch(_0x44eafb[_0x429b('0x68')]){case _0x429b('0x60'):_0x3e2acd[_0x429b('0x69')]={'Authorization':util['format'](_0x429b('0x6a'),new Buffer(util[_0x429b('0x65')]('%s:%s',_0x44eafb['username'],_0x44eafb[_0x429b('0x60')]))['toString'](_0x429b('0x6b')))};break;case _0x429b('0x6c'):_0x3e2acd[_0x429b('0x69')]={'Authorization':util[_0x429b('0x65')](_0x429b('0x6a'),new Buffer(util['format']('%s/token:%s',_0x44eafb[_0x429b('0x5f')],_0x44eafb[_0x429b('0x6c')]))['toString'](_0x429b('0x6b')))};break;default:throw new db[(_0x429b('0x1a'))][(_0x429b('0x1b'))]('Unknown\x20authentication\x20type');}return rp(_0x3e2acd);}})['then'](function(_0x1e3b44){if(_0x1e3b44){var _0x33b0e5=[_0x429b('0x6d'),_0x429b('0x6e'),'group',_0x429b('0x6f')];_[_0x429b('0x70')](_0x1e3b44['ticket_fields'],function(_0x4e154c){return _0x33b0e5[_0x429b('0x71')](_0x4e154c[_0x429b('0x48')]);});return{'count':_0x1e3b44[_0x429b('0x67')][_0x429b('0x3f')],'rows':_[_0x429b('0x39')](_0x1e3b44[_0x429b('0x67')],function(_0x1cfa5e){return{'id':_0x1cfa5e['id'],'name':_0x1cfa5e[_0x429b('0x72')]>0x7?_0x1cfa5e[_0x429b('0x73')]:_0x1cfa5e[_0x429b('0x48')],'custom':_0x1cfa5e[_0x429b('0x72')]>0x7?!![]:![],'options':_0x1cfa5e['system_field_options']?_0x1cfa5e[_0x429b('0x74')]:_0x1cfa5e['custom_field_options']?_0x1cfa5e[_0x429b('0x75')]:[]};})};}})['then'](respondWithResult(_0x3fc7a0,null))[_0x429b('0x27')](function(_0x4d033e){var _0x1841ea=_0x44a9b5[_0x429b('0x3a')]['test']?0x1f4:_0x4d033e[_0x429b('0x76')]||0x1f4;logger[_0x429b('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0x429b('0x5e'),_0x1841ea,JSON['stringify'](_0x4d033e));delete _0x4d033e[_0x429b('0x33')];if(_0x1841ea===0x191){_0x1841ea=0x190;}_0x3fc7a0[_0x429b('0x28')](_0x1841ea)[_0x429b('0x34')](_0x44a9b5['query'][_0x429b('0x19')]?{'message':'Wrong\x20credentials','statusCode':_0x4d033e[_0x429b('0x76')]}:_0x4d033e);});}; \ No newline at end of file +var _0x715e=['../../config/license/hardware','../../config/logger','api','../../mysqldb','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','end','status','json','count','offset','limit','set','apply','reject','update','then','destroy','name','index','map','ZendeskAccount','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','find','create','body','getConfigurations','findOne','ZendeskConfiguration','order','options','hasOwnProperty','addConfiguration','params','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','remoteUri','slice','substring','lastIndexOf','format','ticket_fields','authType','headers','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Unknown\x20authentication\x20type','subject','description','group','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','Wrong\x20credentials','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1183ca,_0xae1d27){var _0x1725fd=function(_0x23394c){while(--_0x23394c){_0x1183ca['push'](_0x1183ca['shift']());}};_0x1725fd(++_0xae1d27);}(_0x715e,0x68));var _0xe715=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x715e[_0xd0b415];return _0x2bdf2c;};'use strict';var pdf=require(_0xe715('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe715('0x1'));var jsonpatch=require(_0xe715('0x2'));var rp=require(_0xe715('0x3'));var moment=require(_0xe715('0x4'));var BPromise=require(_0xe715('0x5'));var Mustache=require(_0xe715('0x6'));var util=require(_0xe715('0x7'));var path=require(_0xe715('0x8'));var sox=require('sox');var csv=require(_0xe715('0x9'));var ejs=require(_0xe715('0xa'));var fs=require('fs');var _=require(_0xe715('0xb'));var squel=require(_0xe715('0xc'));var crypto=require(_0xe715('0xd'));var jsforce=require(_0xe715('0xe'));var deskjs=require(_0xe715('0xf'));var toCsv=require(_0xe715('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe715('0x10'));var authService=require(_0xe715('0x11'));var qs=require(_0xe715('0x12'));var as=require(_0xe715('0x13'));var hardwareService=require(_0xe715('0x14'));var logger=require(_0xe715('0x15'))(_0xe715('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xe715('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xe715('0x18'));var client=jayson[_0xe715('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x14b969,_0x3f7b14,_0x3dcd57){if(_0x3dcd57){var _0x3d127a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3d127a['test'](_0x3f7b14)){return _0x14b969;}else{throw new db[(_0xe715('0x1a'))][(_0xe715('0x1b'))](_0xe715('0x1c'));}}else{return _0x14b969;}}function respondWithRpcPromise(_0x2bc26,_0x26d723,_0x40b646,_0xf14844){return new BPromise(function(_0xc84268,_0x4f31c7){var _0x72eea8=_0xf14844||client;return _0x72eea8[_0xe715('0x1d')](_0x2bc26,_0x40b646)['then'](function(_0x8a4222){logger[_0xe715('0x1e')](_0xe715('0x1f'),_0x26d723,_0xe715('0x20'));logger[_0xe715('0x21')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x26d723,_0xe715('0x20'),JSON[_0xe715('0x22')](_0x8a4222));if(_0x8a4222[_0xe715('0x23')]){if(_0x8a4222[_0xe715('0x23')]['code']===0x1f4){logger[_0xe715('0x23')](_0xe715('0x1f'),_0x26d723,_0x8a4222[_0xe715('0x23')][_0xe715('0x24')]);return _0x4f31c7(_0x8a4222[_0xe715('0x23')][_0xe715('0x24')]);}logger[_0xe715('0x23')](_0xe715('0x1f'),_0x26d723,_0x8a4222['error'][_0xe715('0x24')]);return _0xc84268(_0x8a4222[_0xe715('0x23')][_0xe715('0x24')]);}else{logger[_0xe715('0x1e')](_0xe715('0x1f'),_0x26d723,_0xe715('0x20'));_0xc84268(_0x8a4222[_0xe715('0x25')][_0xe715('0x24')]);}})[_0xe715('0x26')](function(_0x1a2158){logger[_0xe715('0x23')]('ZendeskAccount,\x20%s,\x20%s',_0x26d723,_0x1a2158);_0x4f31c7(_0x1a2158);});});}function respondWithStatusCode(_0x410bc3,_0x1f9ada){_0x1f9ada=_0x1f9ada||0xcc;return function(_0x4f872d){if(_0x4f872d){return _0x410bc3['sendStatus'](_0x1f9ada);}return _0x410bc3['status'](_0x1f9ada)[_0xe715('0x27')]();};}function respondWithResult(_0x5c7b0a,_0x108827){_0x108827=_0x108827||0xc8;return function(_0x57fcf5){if(_0x57fcf5){return _0x5c7b0a[_0xe715('0x28')](_0x108827)[_0xe715('0x29')](_0x57fcf5);}};}function respondWithFilteredResult(_0x12af14,_0x58e815){return function(_0x4e2135){if(_0x4e2135){var _0xb90d05=_0x4e2135[_0xe715('0x2a')],_0x2e3544=_0x58e815[_0xe715('0x2b')],_0x4af702=_0x58e815[_0xe715('0x2b')]+_0x58e815[_0xe715('0x2c')],_0x222d2b;if(_0x4af702>=_0xb90d05){_0x4af702=_0xb90d05;_0x222d2b=0xc8;}else{_0x222d2b=0xce;}_0x12af14['status'](_0x222d2b);return _0x12af14[_0xe715('0x2d')]('Content-Range',_0x2e3544+'-'+_0x4af702+'/'+_0xb90d05)[_0xe715('0x29')](_0x4e2135);}return null;};}function patchUpdates(_0x3b1676){return function(_0x28a30d){try{jsonpatch[_0xe715('0x2e')](_0x28a30d,_0x3b1676,!![]);}catch(_0x488f0e){return BPromise[_0xe715('0x2f')](_0x488f0e);}return _0x28a30d['save']();};}function saveUpdates(_0x24982b,_0xeda122){return function(_0x5f09fe){if(_0x5f09fe){return _0x5f09fe[_0xe715('0x30')](_0x24982b)[_0xe715('0x31')](function(_0x5dea74){return _0x5dea74;});}return null;};}function removeEntity(_0x57e4d0,_0x431d08){return function(_0x473c9b){if(_0x473c9b){return _0x473c9b[_0xe715('0x32')]()['then'](function(){_0x57e4d0[_0xe715('0x28')](0xcc)[_0xe715('0x27')]();});}};}function handleEntityNotFound(_0x30dc19,_0x77c0f7){return function(_0x59e4f4){if(!_0x59e4f4){_0x30dc19['sendStatus'](0x194);}return _0x59e4f4;};}function handleError(_0x34f80b,_0x4ae620){_0x4ae620=_0x4ae620||0x1f4;return function(_0xa05d6d){logger[_0xe715('0x23')](_0xa05d6d['stack']);if(_0xa05d6d[_0xe715('0x33')]){delete _0xa05d6d['name'];}_0x34f80b[_0xe715('0x28')](_0x4ae620)['send'](_0xa05d6d);};}exports[_0xe715('0x34')]=function(_0x4036e9,_0x16df2c){var _0x183242={},_0x863c46={},_0x2e8a45={'count':0x0,'rows':[]};var _0x69bff2=_[_0xe715('0x35')](db[_0xe715('0x36')][_0xe715('0x37')],function(_0xa800df){return{'name':_0xa800df[_0xe715('0x38')],'type':_0xa800df['type']['key']};});_0x863c46[_0xe715('0x39')]=_[_0xe715('0x35')](_0x69bff2,_0xe715('0x33'));_0x863c46['query']=_[_0xe715('0x3a')](_0x4036e9[_0xe715('0x3b')]);_0x863c46[_0xe715('0x3c')]=_[_0xe715('0x3d')](_0x863c46[_0xe715('0x39')],_0x863c46['query']);_0x183242[_0xe715('0x3e')]=_[_0xe715('0x3d')](_0x863c46[_0xe715('0x39')],qs['fields'](_0x4036e9['query'][_0xe715('0x3f')]));_0x183242['attributes']=_0x183242[_0xe715('0x3e')][_0xe715('0x40')]?_0x183242['attributes']:_0x863c46['model'];if(!_0x4036e9['query']['hasOwnProperty'](_0xe715('0x41'))){_0x183242[_0xe715('0x2c')]=qs['limit'](_0x4036e9[_0xe715('0x3b')]['limit']);_0x183242[_0xe715('0x2b')]=qs[_0xe715('0x2b')](_0x4036e9['query'][_0xe715('0x2b')]);}_0x183242['order']=qs[_0xe715('0x42')](_0x4036e9['query'][_0xe715('0x42')]);_0x183242[_0xe715('0x43')]=qs[_0xe715('0x3c')](_['pick'](_0x4036e9[_0xe715('0x3b')],_0x863c46[_0xe715('0x3c')]));if(_0x4036e9['query'][_0xe715('0x44')]){_0x183242['where']=_[_0xe715('0x45')](_0x183242[_0xe715('0x43')],{'$or':_[_0xe715('0x35')](_0x69bff2,function(_0x499404){if(_0x499404['type']!==_0xe715('0x46')){var _0x2f87c0={};_0x2f87c0[_0x499404[_0xe715('0x33')]]={'$like':'%'+_0x4036e9[_0xe715('0x3b')][_0xe715('0x44')]+'%'};return _0x2f87c0;}})});}_0x183242=_[_0xe715('0x45')]({},_0x183242,_0x4036e9['options']);var _0x128e4c={'where':_0x183242[_0xe715('0x43')]};return db[_0xe715('0x36')]['count'](_0x128e4c)[_0xe715('0x31')](function(_0x49d4c7){_0x2e8a45[_0xe715('0x2a')]=_0x49d4c7;if(_0x4036e9['query'][_0xe715('0x47')]){_0x183242[_0xe715('0x48')]=[{'all':!![]}];}return db[_0xe715('0x36')][_0xe715('0x49')](_0x183242);})[_0xe715('0x31')](function(_0x1dd93a){_0x2e8a45[_0xe715('0x4a')]=_0x1dd93a;return _0x2e8a45;})[_0xe715('0x31')](respondWithFilteredResult(_0x16df2c,_0x183242))['catch'](handleError(_0x16df2c,null));};exports['show']=function(_0x5f5662,_0x53eea3){var _0x2e8ed6={'raw':![],'where':{'id':_0x5f5662['params']['id']}},_0x33733e={};_0x33733e[_0xe715('0x39')]=_[_0xe715('0x3a')](db[_0xe715('0x36')][_0xe715('0x37')]);_0x33733e[_0xe715('0x3b')]=_[_0xe715('0x3a')](_0x5f5662['query']);_0x33733e[_0xe715('0x3c')]=_[_0xe715('0x3d')](_0x33733e[_0xe715('0x39')],_0x33733e[_0xe715('0x3b')]);_0x2e8ed6['attributes']=_[_0xe715('0x3d')](_0x33733e[_0xe715('0x39')],qs['fields'](_0x5f5662[_0xe715('0x3b')][_0xe715('0x3f')]));_0x2e8ed6[_0xe715('0x3e')]=_0x2e8ed6[_0xe715('0x3e')][_0xe715('0x40')]?_0x2e8ed6[_0xe715('0x3e')]:_0x33733e['model'];if(_0x5f5662['query'][_0xe715('0x47')]){_0x2e8ed6[_0xe715('0x48')]=[{'all':!![]}];}_0x2e8ed6=_['merge']({},_0x2e8ed6,_0x5f5662['options']);return db['ZendeskAccount'][_0xe715('0x4b')](_0x2e8ed6)['then'](handleEntityNotFound(_0x53eea3,null))[_0xe715('0x31')](respondWithResult(_0x53eea3,null))[_0xe715('0x26')](handleError(_0x53eea3,null));};exports[_0xe715('0x4c')]=function(_0x56e38b,_0x4c3b7b){return db[_0xe715('0x36')][_0xe715('0x4c')](_0x56e38b[_0xe715('0x4d')],{})[_0xe715('0x31')](respondWithResult(_0x4c3b7b,0xc9))['catch'](handleError(_0x4c3b7b,null));};exports[_0xe715('0x30')]=function(_0x57eb5b,_0xa07571){if(_0x57eb5b[_0xe715('0x4d')]['id']){delete _0x57eb5b['body']['id'];}return db[_0xe715('0x36')][_0xe715('0x4b')]({'where':{'id':_0x57eb5b['params']['id']}})[_0xe715('0x31')](handleEntityNotFound(_0xa07571,null))[_0xe715('0x31')](saveUpdates(_0x57eb5b[_0xe715('0x4d')],null))[_0xe715('0x31')](respondWithResult(_0xa07571,null))[_0xe715('0x26')](handleError(_0xa07571,null));};exports[_0xe715('0x32')]=function(_0x25a6d3,_0xdd05b4){return db[_0xe715('0x36')][_0xe715('0x4b')]({'where':{'id':_0x25a6d3['params']['id']}})[_0xe715('0x31')](handleEntityNotFound(_0xdd05b4,null))[_0xe715('0x31')](removeEntity(_0xdd05b4,null))[_0xe715('0x26')](handleError(_0xdd05b4,null));};exports[_0xe715('0x4e')]=function(_0x49571c,_0x48e7ce,_0x2cca46){var _0x36d955={};var _0x4d0860={};var _0x563bca;var _0x42de6b;return db[_0xe715('0x36')][_0xe715('0x4f')]({'where':{'id':_0x49571c['params']['id']}})[_0xe715('0x31')](handleEntityNotFound(_0x48e7ce,null))[_0xe715('0x31')](function(_0x363858){if(_0x363858){_0x563bca=_0x363858;_0x4d0860['model']=_['keys'](db[_0xe715('0x50')][_0xe715('0x37')]);_0x4d0860[_0xe715('0x3b')]=_['keys'](_0x49571c[_0xe715('0x3b')]);_0x4d0860[_0xe715('0x3c')]=_[_0xe715('0x3d')](_0x4d0860[_0xe715('0x39')],_0x4d0860['query']);_0x36d955['attributes']=_['intersection'](_0x4d0860[_0xe715('0x39')],qs[_0xe715('0x3f')](_0x49571c['query']['fields']));_0x36d955[_0xe715('0x3e')]=_0x36d955['attributes'][_0xe715('0x40')]?_0x36d955[_0xe715('0x3e')]:_0x4d0860['model'];_0x36d955[_0xe715('0x51')]=qs[_0xe715('0x42')](_0x49571c['query']['sort']);_0x36d955[_0xe715('0x43')]=qs[_0xe715('0x3c')](_['pick'](_0x49571c[_0xe715('0x3b')],_0x4d0860[_0xe715('0x3c')]));if(_0x49571c[_0xe715('0x3b')][_0xe715('0x44')]){_0x36d955[_0xe715('0x43')]=_[_0xe715('0x45')](_0x36d955[_0xe715('0x43')],{'$or':_[_0xe715('0x35')](_0x36d955[_0xe715('0x3e')],function(_0x54d25b){var _0xa76d09={};_0xa76d09[_0x54d25b]={'$like':'%'+_0x49571c[_0xe715('0x3b')][_0xe715('0x44')]+'%'};return _0xa76d09;})});}_0x36d955=_['merge']({},_0x36d955,_0x49571c[_0xe715('0x52')]);return _0x563bca[_0xe715('0x4e')](_0x36d955);}})[_0xe715('0x31')](function(_0x533dad){if(_0x533dad){_0x42de6b=_0x533dad[_0xe715('0x40')];if(!_0x49571c[_0xe715('0x3b')][_0xe715('0x53')](_0xe715('0x41'))){_0x36d955['limit']=qs['limit'](_0x49571c[_0xe715('0x3b')][_0xe715('0x2c')]);_0x36d955['offset']=qs[_0xe715('0x2b')](_0x49571c['query'][_0xe715('0x2b')]);}return _0x563bca[_0xe715('0x4e')](_0x36d955);}})[_0xe715('0x31')](function(_0x63a36){if(_0x63a36){return _0x63a36?{'count':_0x42de6b,'rows':_0x63a36}:null;}})[_0xe715('0x31')](respondWithResult(_0x48e7ce,null))[_0xe715('0x26')](handleError(_0x48e7ce,null));};exports[_0xe715('0x54')]=function(_0x2fea59,_0x7cafdb,_0x1d2191){if(_0x2fea59[_0xe715('0x4d')]['id']){delete _0x2fea59['body']['id'];}return db['ZendeskAccount'][_0xe715('0x4f')]({'where':{'id':_0x2fea59[_0xe715('0x55')]['id']}})[_0xe715('0x31')](handleEntityNotFound(_0x7cafdb,null))[_0xe715('0x31')](function(_0x555a03){if(_0x555a03){_0x2fea59[_0xe715('0x4d')][_0xe715('0x56')]=_0x555a03['id'];_0x2fea59['body'][_0xe715('0x57')]=integrations[_0xe715('0x58')](_0x2fea59[_0xe715('0x4d')][_0xe715('0x59')],_0x2fea59[_0xe715('0x4d')][_0xe715('0x5a')]);_0x2fea59[_0xe715('0x4d')][_0xe715('0x5b')]=integrations[_0xe715('0x5c')](_0x2fea59[_0xe715('0x4d')][_0xe715('0x59')],_0x2fea59[_0xe715('0x4d')][_0xe715('0x5a')]);return db['ZendeskConfiguration'][_0xe715('0x4c')](_0x2fea59[_0xe715('0x4d')],{'include':[{'model':db[_0xe715('0x5d')],'as':'Subjects'},{'model':db[_0xe715('0x5d')],'as':_0xe715('0x5b')}]});}return null;})['then'](respondWithResult(_0x7cafdb,null))[_0xe715('0x26')](handleError(_0x7cafdb,null));};exports[_0xe715('0x5e')]=function(_0x2cc6b9,_0x1ba1fc,_0x2a1eb8){var _0x528fd6='';return db[_0xe715('0x36')][_0xe715('0x4f')]({'where':{'id':_0x2cc6b9[_0xe715('0x55')]['id']},'attributes':['id',_0xe715('0x5f'),_0xe715('0x60'),_0xe715('0x61'),'authType',_0xe715('0x62')]})[_0xe715('0x31')](handleEntityNotFound(_0x1ba1fc,null))[_0xe715('0x31')](function(_0x4464eb){if(_0x4464eb){_0x528fd6=_0x4464eb['remoteUri'];var _0x439dfc=_0x528fd6[_0xe715('0x63')](-0x1);if(_0x439dfc==='/'){_0x528fd6=_0x528fd6[_0xe715('0x64')](0x0,_0x528fd6[_0xe715('0x65')](_0x439dfc));}var _0x9069f1={'method':'GET','uri':util[_0xe715('0x66')]('%s/%s',_0x528fd6,_0xe715('0x67')),'json':!![]};switch(_0x4464eb[_0xe715('0x68')]){case'password':_0x9069f1[_0xe715('0x69')]={'Authorization':util[_0xe715('0x66')](_0xe715('0x6a'),new Buffer(util[_0xe715('0x66')](_0xe715('0x6b'),_0x4464eb['username'],_0x4464eb[_0xe715('0x60')]))[_0xe715('0x6c')](_0xe715('0x6d')))};break;case _0xe715('0x61'):_0x9069f1[_0xe715('0x69')]={'Authorization':util['format'](_0xe715('0x6a'),new Buffer(util['format'](_0xe715('0x6e'),_0x4464eb[_0xe715('0x5f')],_0x4464eb['token']))[_0xe715('0x6c')]('base64'))};break;default:throw new db['Sequelize'][(_0xe715('0x1b'))](_0xe715('0x6f'));}return rp(_0x9069f1);}})[_0xe715('0x31')](function(_0x24221b){if(_0x24221b){var _0xb3e558=[_0xe715('0x70'),_0xe715('0x71'),_0xe715('0x72'),'assignee'];_[_0xe715('0x73')](_0x24221b[_0xe715('0x67')],function(_0x29696e){return _0xb3e558[_0xe715('0x74')](_0x29696e[_0xe715('0x5a')]);});return{'count':_0x24221b[_0xe715('0x67')]['length'],'rows':_[_0xe715('0x35')](_0x24221b[_0xe715('0x67')],function(_0x5b7674){return{'id':_0x5b7674['id'],'name':_0x5b7674[_0xe715('0x75')]>0x7?_0x5b7674[_0xe715('0x76')]:_0x5b7674[_0xe715('0x5a')],'custom':_0x5b7674[_0xe715('0x75')]>0x7?!![]:![],'options':_0x5b7674[_0xe715('0x77')]?_0x5b7674[_0xe715('0x77')]:_0x5b7674[_0xe715('0x78')]?_0x5b7674[_0xe715('0x78')]:[]};})};}})[_0xe715('0x31')](respondWithResult(_0x1ba1fc,null))[_0xe715('0x26')](function(_0x250e00){var _0x23d284=_0x2cc6b9[_0xe715('0x3b')][_0xe715('0x79')]?0x1f4:_0x250e00[_0xe715('0x7a')]||0x1f4;logger[_0xe715('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0xe715('0x5e'),_0x23d284,JSON[_0xe715('0x22')](_0x250e00));delete _0x250e00[_0xe715('0x33')];if(_0x23d284===0x191){_0x23d284=0x190;}_0x1ba1fc[_0xe715('0x28')](_0x23d284)['send'](_0x2cc6b9[_0xe715('0x3b')][_0xe715('0x79')]?{'message':_0xe715('0x7b'),'statusCode':_0x250e00['statusCode']}:_0x250e00);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index ae0ecef..196d00b 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 _0x9b7f=['request-promise','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','lodash','moment'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0x9b7f,0x17a));var _0xf9b7=function(_0x3ca977,_0x3a3fd5){_0x3ca977=_0x3ca977-0x0;var _0x54dea7=_0x9b7f[_0x3ca977];return _0x54dea7;};'use strict';var _=require(_0xf9b7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xf9b7('0x1'));var BPromise=require('bluebird');var rp=require(_0xf9b7('0x2'));var fs=require('fs');var path=require(_0xf9b7('0x3'));var rimraf=require('rimraf');var config=require(_0xf9b7('0x4'));var attributes=require(_0xf9b7('0x5'));var integrations=require(_0xf9b7('0x6'));module[_0xf9b7('0x7')]=function(_0x2d7366,_0x3c78b4){return _0x2d7366[_0xf9b7('0x8')](_0xf9b7('0x9'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7dfd=['path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x16fa86,_0x3cddfc){var _0x429303=function(_0x530ccd){while(--_0x530ccd){_0x16fa86['push'](_0x16fa86['shift']());}};_0x429303(++_0x3cddfc);}(_0x7dfd,0x9e));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var logger=require(_0xd7df('0x2'))(_0xd7df('0x3'));var moment=require(_0xd7df('0x4'));var BPromise=require(_0xd7df('0x5'));var rp=require(_0xd7df('0x6'));var fs=require('fs');var path=require(_0xd7df('0x7'));var rimraf=require('rimraf');var config=require(_0xd7df('0x8'));var attributes=require(_0xd7df('0x9'));var integrations=require(_0xd7df('0xa'));module[_0xd7df('0xb')]=function(_0x5b1401,_0x119f7b){return _0x5b1401[_0xd7df('0xc')](_0xd7df('0xd'),attributes,{'tableName':_0xd7df('0xe'),'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 4a96ed7..f8086bd 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 _0xa9e0=['code','error','message','result','catch','ZendeskAccount','findAll','options','raw','where','attributes','include','map','model','GetZendeskAccount','stringify','ShowZendeskAccount','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x623e7,_0x1bef7d){var _0x121131=function(_0x59b734){while(--_0x59b734){_0x623e7['push'](_0x623e7['shift']());}};_0x121131(++_0x1bef7d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetZendeskAccount']=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')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowZendeskAccount',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xb7e7=['request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','attributes','limit','include','map','model','ShowZendeskAccount','find','where','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http'];(function(_0x4b6987,_0x25d199){var _0x5a753b=function(_0x23eb94){while(--_0x23eb94){_0x4b6987['push'](_0x4b6987['shift']());}};_0x5a753b(++_0x25d199);}(_0xb7e7,0x121));var _0x7b7e=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0xb7e7[_0x42f009];return _0x22a1e0;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});}exports[_0x7b7e('0x14')]=function(_0x242368){var _0x200ef7=this;return new Promise(function(_0x2acb8c,_0x429a0e){return db[_0x7b7e('0x15')][_0x7b7e('0x16')]({'raw':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x18')]===undefined?!![]:![]:!![],'where':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')]['where']||null:null,'attributes':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x19')]||null:null,'limit':_0x242368['options']?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x1a')]||null:null,'include':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x242368[_0x7b7e('0x17')][_0x7b7e('0x1b')],function(_0x53bbb3){return{'model':db[_0x53bbb3['model']],'as':_0x53bbb3['as'],'attributes':_0x53bbb3['attributes'],'include':_0x53bbb3[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x53bbb3[_0x7b7e('0x1b')],function(_0x483c6f){return{'model':db[_0x483c6f['model']],'as':_0x483c6f['as'],'attributes':_0x483c6f['attributes'],'include':_0x483c6f[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x483c6f[_0x7b7e('0x1b')],function(_0x7aa71){return{'model':db[_0x7aa71[_0x7b7e('0x1d')]],'as':_0x7aa71['as'],'attributes':_0x7aa71['attributes']};}):[]};}):[]};}):[]:[]})[_0x7b7e('0x9')](function(_0x21a15){logger['info']('GetZendeskAccount',_0x242368);logger['debug'](_0x7b7e('0x14'),_0x242368,JSON[_0x7b7e('0xf')](_0x21a15));_0x2acb8c(_0x21a15);})['catch'](function(_0x3db8c4){logger['error'](_0x7b7e('0x14'),_0x3db8c4[_0x7b7e('0x12')],_0x242368);_0x429a0e(_0x200ef7[_0x7b7e('0x10')](0x1f4,_0x3db8c4['message']));});});};exports[_0x7b7e('0x1e')]=function(_0xe31336){var _0x35602a=this;return new Promise(function(_0x326dd2,_0x33f9a1){return db['ZendeskAccount'][_0x7b7e('0x1f')]({'raw':_0xe31336['options']?_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x18')]===undefined?!![]:![]:!![],'where':_0xe31336[_0x7b7e('0x17')]?_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x20')]||null:null,'attributes':_0xe31336[_0x7b7e('0x17')]?_0xe31336[_0x7b7e('0x17')]['attributes']||null:null,'include':_0xe31336['options']?_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x1b')]?_['map'](_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x1b')],function(_0x2ca366){return{'model':db[_0x2ca366['model']],'as':_0x2ca366['as'],'attributes':_0x2ca366[_0x7b7e('0x19')],'include':_0x2ca366[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x2ca366[_0x7b7e('0x1b')],function(_0x31043a){return{'model':db[_0x31043a[_0x7b7e('0x1d')]],'as':_0x31043a['as'],'attributes':_0x31043a[_0x7b7e('0x19')],'include':_0x31043a[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x31043a[_0x7b7e('0x1b')],function(_0xd5a64d){return{'model':db[_0xd5a64d[_0x7b7e('0x1d')]],'as':_0xd5a64d['as'],'attributes':_0xd5a64d[_0x7b7e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7b7e('0x9')](function(_0x116563){logger[_0x7b7e('0xa')]('ShowZendeskAccount',_0xe31336);logger[_0x7b7e('0xc')](_0x7b7e('0x1e'),_0xe31336,JSON[_0x7b7e('0xf')](_0x116563));_0x326dd2(_0x116563);})[_0x7b7e('0x13')](function(_0x36abfc){logger[_0x7b7e('0x10')](_0x7b7e('0x1e'),_0x36abfc[_0x7b7e('0x12')],_0xe31336);_0x33f9a1(_0x35602a[_0x7b7e('0x10')](0x1f4,_0x36abfc[_0x7b7e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index faf0f5a..4bb9a4a 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 _0x84bd=['multer','util','path','express','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','setTags','update','delete','destroy','exports'];(function(_0x589cb3,_0x552581){var _0x247157=function(_0x4fbdde){while(--_0x4fbdde){_0x589cb3['push'](_0x589cb3['shift']());}};_0x247157(++_0x552581);}(_0x84bd,0x1d4));var _0xd84b=function(_0xdd82b4,_0x5cd8b8){_0xdd82b4=_0xdd82b4-0x0;var _0x549bb2=_0x84bd[_0xdd82b4];return _0x549bb2;};'use strict';var multer=require(_0xd84b('0x0'));var util=require(_0xd84b('0x1'));var path=require(_0xd84b('0x2'));var timeout=require('connect-timeout');var express=require(_0xd84b('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xd84b('0x4'));var config=require(_0xd84b('0x5'));var controller=require(_0xd84b('0x6'));router[_0xd84b('0x7')]('/',auth['isAuthenticated'](),controller[_0xd84b('0x8')]);router[_0xd84b('0x7')](_0xd84b('0x9'),auth[_0xd84b('0xa')](),controller[_0xd84b('0xb')]);router[_0xd84b('0x7')](_0xd84b('0xc'),auth[_0xd84b('0xa')](),controller[_0xd84b('0xd')]);router[_0xd84b('0x7')](_0xd84b('0xe'),auth[_0xd84b('0xa')](),controller[_0xd84b('0xf')]);router['get'](_0xd84b('0x10'),auth[_0xd84b('0xa')](),controller['getDescriptions']);router[_0xd84b('0x7')](_0xd84b('0x11'),auth[_0xd84b('0xa')](),controller[_0xd84b('0x12')]);router[_0xd84b('0x13')]('/',auth[_0xd84b('0xa')](),controller[_0xd84b('0x14')]);router[_0xd84b('0x13')](_0xd84b('0x11'),auth[_0xd84b('0xa')](),controller[_0xd84b('0x15')]);router['put'](_0xd84b('0x9'),auth[_0xd84b('0xa')](),controller[_0xd84b('0x16')]);router[_0xd84b('0x17')]('/:id',auth[_0xd84b('0xa')](),controller[_0xd84b('0x18')]);module[_0xd84b('0x19')]=router; \ No newline at end of file +var _0xbf44=['setTags','put','update','delete','destroy','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','getFields','/:id/subjects','post','create','/:id/tags'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xbf44,0x90));var _0x4bf4=function(_0x2bb6dd,_0x252667){_0x2bb6dd=_0x2bb6dd-0x0;var _0x2a07dc=_0xbf44[_0x2bb6dd];return _0x2a07dc;};'use strict';var multer=require(_0x4bf4('0x0'));var util=require('util');var path=require(_0x4bf4('0x1'));var timeout=require('connect-timeout');var express=require(_0x4bf4('0x2'));var router=express[_0x4bf4('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x4bf4('0x4'));var config=require(_0x4bf4('0x5'));var controller=require(_0x4bf4('0x6'));router[_0x4bf4('0x7')]('/',auth['isAuthenticated'](),controller[_0x4bf4('0x8')]);router['get'](_0x4bf4('0x9'),auth[_0x4bf4('0xa')](),controller[_0x4bf4('0xb')]);router[_0x4bf4('0x7')]('/:id/fields',auth[_0x4bf4('0xa')](),controller[_0x4bf4('0xc')]);router[_0x4bf4('0x7')](_0x4bf4('0xd'),auth[_0x4bf4('0xa')](),controller['getSubjects']);router[_0x4bf4('0x7')]('/:id/descriptions',auth[_0x4bf4('0xa')](),controller['getDescriptions']);router[_0x4bf4('0x7')]('/:id/tags',auth['isAuthenticated'](),controller['getTags']);router[_0x4bf4('0xe')]('/',auth[_0x4bf4('0xa')](),controller[_0x4bf4('0xf')]);router[_0x4bf4('0xe')](_0x4bf4('0x10'),auth['isAuthenticated'](),controller[_0x4bf4('0x11')]);router[_0x4bf4('0x12')]('/:id',auth[_0x4bf4('0xa')](),controller[_0x4bf4('0x13')]);router[_0x4bf4('0x14')](_0x4bf4('0x9'),auth['isAuthenticated'](),controller[_0x4bf4('0x15')]);module[_0x4bf4('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index d38a538..1195c0f 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 _0xcf18=['exports','STRING'];(function(_0x421a65,_0x15147a){var _0x5638a9=function(_0x33a53a){while(--_0x33a53a){_0x421a65['push'](_0x421a65['shift']());}};_0x5638a9(++_0x15147a);}(_0xcf18,0x66));var _0x8cf1=function(_0x10ad4e,_0x5003e3){_0x10ad4e=_0x10ad4e-0x0;var _0x181ec8=_0xcf18[_0x10ad4e];return _0x181ec8;};'use strict';var Sequelize=require('sequelize');module[_0x8cf1('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8cf1('0x1')]}}; \ No newline at end of file +var _0x8938=['sequelize','STRING'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x8938,0x102));var _0x8893=function(_0x138293,_0x197e7f){_0x138293=_0x138293-0x0;var _0x34c4a2=_0x8938[_0x138293];return _0x34c4a2;};'use strict';var Sequelize=require(_0x8893('0x0'));module['exports']={'name':{'type':Sequelize[_0x8893('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 7dcc18a..aaa0635 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 _0xc4aa=['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','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','update','destroy','stack','send','index','map','ZendeskConfiguration','fieldName','type','model','keys','query','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','name','options','count','includeAll','rows','show','rawAttributes','include','create','body','find','params','getFields','ZendeskField','getSubjects','hasOwnProperty','nolimit','getDescriptions','findOne','getTags','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','test','Sequelize'];(function(_0x539533,_0x59b89b){var _0x3942f3=function(_0x3b386c){while(--_0x3b386c){_0x539533['push'](_0x539533['shift']());}};_0x3942f3(++_0x59b89b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xc4aa[_0x45d55e];return _0x29812a;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x9'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var db=require(_0xac4a('0x15'))['db'];var jayson=require(_0xac4a('0x16'));var client=jayson[_0xac4a('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x21a79,_0x68424a,_0x247b78){if(_0x247b78){var _0x6e00d4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6e00d4[_0xac4a('0x18')](_0x68424a)){return _0x21a79;}else{throw new db[(_0xac4a('0x19'))][(_0xac4a('0x1a'))](_0xac4a('0x1b'));}}else{return _0x21a79;}}function respondWithRpcPromise(_0x190418,_0x42c7fc,_0x11e101,_0x26dbb8){return new BPromise(function(_0x4a2119,_0x402fff){var _0x34d797=_0x26dbb8||client;return _0x34d797[_0xac4a('0x1c')](_0x190418,_0x11e101)[_0xac4a('0x1d')](function(_0x3e88e3){logger[_0xac4a('0x1e')](_0xac4a('0x1f'),_0x42c7fc,_0xac4a('0x20'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x42c7fc,_0xac4a('0x20'),JSON[_0xac4a('0x21')](_0x3e88e3));if(_0x3e88e3[_0xac4a('0x22')]){if(_0x3e88e3['error'][_0xac4a('0x23')]===0x1f4){logger[_0xac4a('0x22')](_0xac4a('0x1f'),_0x42c7fc,_0x3e88e3[_0xac4a('0x22')][_0xac4a('0x24')]);return _0x402fff(_0x3e88e3[_0xac4a('0x22')][_0xac4a('0x24')]);}logger[_0xac4a('0x22')]('ZendeskConfiguration,\x20%s,\x20%s',_0x42c7fc,_0x3e88e3[_0xac4a('0x22')][_0xac4a('0x24')]);return _0x4a2119(_0x3e88e3['error'][_0xac4a('0x24')]);}else{logger[_0xac4a('0x1e')](_0xac4a('0x1f'),_0x42c7fc,_0xac4a('0x20'));_0x4a2119(_0x3e88e3['result'][_0xac4a('0x24')]);}})[_0xac4a('0x25')](function(_0x15435c){logger[_0xac4a('0x22')](_0xac4a('0x1f'),_0x42c7fc,_0x15435c);_0x402fff(_0x15435c);});});}function respondWithStatusCode(_0x2b0dc2,_0x222507){_0x222507=_0x222507||0xcc;return function(_0x36054a){if(_0x36054a){return _0x2b0dc2[_0xac4a('0x26')](_0x222507);}return _0x2b0dc2[_0xac4a('0x27')](_0x222507)[_0xac4a('0x28')]();};}function respondWithResult(_0x215a31,_0x14832b){_0x14832b=_0x14832b||0xc8;return function(_0x472c57){if(_0x472c57){return _0x215a31[_0xac4a('0x27')](_0x14832b)[_0xac4a('0x29')](_0x472c57);}};}function respondWithFilteredResult(_0x4e17ce,_0x23b061){return function(_0x267a22){if(_0x267a22){var _0x42a33c=_0x267a22['count'],_0x2772fe=_0x23b061[_0xac4a('0x2a')],_0x116700=_0x23b061[_0xac4a('0x2a')]+_0x23b061[_0xac4a('0x2b')],_0x4a5a9e;if(_0x116700>=_0x42a33c){_0x116700=_0x42a33c;_0x4a5a9e=0xc8;}else{_0x4a5a9e=0xce;}_0x4e17ce['status'](_0x4a5a9e);return _0x4e17ce['set'](_0xac4a('0x2c'),_0x2772fe+'-'+_0x116700+'/'+_0x42a33c)[_0xac4a('0x29')](_0x267a22);}return null;};}function patchUpdates(_0x228629){return function(_0x432066){try{jsonpatch[_0xac4a('0x2d')](_0x432066,_0x228629,!![]);}catch(_0x53d3a5){return BPromise[_0xac4a('0x2e')](_0x53d3a5);}return _0x432066['save']();};}function saveUpdates(_0x30364b,_0x57adcf){return function(_0x17e6de){if(_0x17e6de){return _0x17e6de[_0xac4a('0x2f')](_0x30364b)[_0xac4a('0x1d')](function(_0x228aa7){return _0x228aa7;});}return null;};}function removeEntity(_0x34577f,_0x61e552){return function(_0xbd4591){if(_0xbd4591){return _0xbd4591[_0xac4a('0x30')]()[_0xac4a('0x1d')](function(){_0x34577f[_0xac4a('0x27')](0xcc)[_0xac4a('0x28')]();});}};}function handleEntityNotFound(_0x1634df,_0x1a9be2){return function(_0x1a9d4e){if(!_0x1a9d4e){_0x1634df['sendStatus'](0x194);}return _0x1a9d4e;};}function handleError(_0x30442d,_0x1c41fb){_0x1c41fb=_0x1c41fb||0x1f4;return function(_0x5a4e2b){logger[_0xac4a('0x22')](_0x5a4e2b[_0xac4a('0x31')]);if(_0x5a4e2b['name']){delete _0x5a4e2b['name'];}_0x30442d[_0xac4a('0x27')](_0x1c41fb)[_0xac4a('0x32')](_0x5a4e2b);};}exports[_0xac4a('0x33')]=function(_0x3de9e2,_0x4f5986){var _0x453d02={},_0x2e56c6={},_0x4e7630={'count':0x0,'rows':[]};var _0x37f2ee=_[_0xac4a('0x34')](db[_0xac4a('0x35')]['rawAttributes'],function(_0x121328){return{'name':_0x121328[_0xac4a('0x36')],'type':_0x121328[_0xac4a('0x37')]['key']};});_0x2e56c6[_0xac4a('0x38')]=_[_0xac4a('0x34')](_0x37f2ee,'name');_0x2e56c6['query']=_[_0xac4a('0x39')](_0x3de9e2['query']);_0x2e56c6['filters']=_['intersection'](_0x2e56c6['model'],_0x2e56c6[_0xac4a('0x3a')]);_0x453d02[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x2e56c6[_0xac4a('0x38')],qs[_0xac4a('0x3d')](_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x3d')]));_0x453d02[_0xac4a('0x3b')]=_0x453d02[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x453d02[_0xac4a('0x3b')]:_0x2e56c6[_0xac4a('0x38')];if(!_0x3de9e2['query']['hasOwnProperty']('nolimit')){_0x453d02[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x2b')]);_0x453d02[_0xac4a('0x2a')]=qs[_0xac4a('0x2a')](_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x2a')]);}_0x453d02[_0xac4a('0x3f')]=qs[_0xac4a('0x40')](_0x3de9e2['query'][_0xac4a('0x40')]);_0x453d02[_0xac4a('0x41')]=qs[_0xac4a('0x42')](_[_0xac4a('0x43')](_0x3de9e2[_0xac4a('0x3a')],_0x2e56c6['filters']));if(_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x44')]){_0x453d02['where']=_[_0xac4a('0x45')](_0x453d02['where'],{'$or':_[_0xac4a('0x34')](_0x37f2ee,function(_0x65494e){if(_0x65494e[_0xac4a('0x37')]!==_0xac4a('0x46')){var _0x520e4a={};_0x520e4a[_0x65494e[_0xac4a('0x47')]]={'$like':'%'+_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x520e4a;}})});}_0x453d02=_[_0xac4a('0x45')]({},_0x453d02,_0x3de9e2[_0xac4a('0x48')]);var _0x4fa9eb={'where':_0x453d02[_0xac4a('0x41')]};return db['ZendeskConfiguration'][_0xac4a('0x49')](_0x4fa9eb)[_0xac4a('0x1d')](function(_0xeca4e9){_0x4e7630['count']=_0xeca4e9;if(_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x4a')]){_0x453d02['include']=[{'all':!![]}];}return db[_0xac4a('0x35')]['findAll'](_0x453d02);})[_0xac4a('0x1d')](function(_0xe620f6){_0x4e7630[_0xac4a('0x4b')]=_0xe620f6;return _0x4e7630;})['then'](respondWithFilteredResult(_0x4f5986,_0x453d02))['catch'](handleError(_0x4f5986,null));};exports[_0xac4a('0x4c')]=function(_0x4aaeff,_0x18ae96){var _0x566258={'raw':![],'where':{'id':_0x4aaeff['params']['id']}},_0x3d2aaf={};_0x3d2aaf[_0xac4a('0x38')]=_[_0xac4a('0x39')](db[_0xac4a('0x35')][_0xac4a('0x4d')]);_0x3d2aaf['query']=_[_0xac4a('0x39')](_0x4aaeff[_0xac4a('0x3a')]);_0x3d2aaf[_0xac4a('0x42')]=_[_0xac4a('0x3c')](_0x3d2aaf[_0xac4a('0x38')],_0x3d2aaf[_0xac4a('0x3a')]);_0x566258[_0xac4a('0x3b')]=_['intersection'](_0x3d2aaf[_0xac4a('0x38')],qs[_0xac4a('0x3d')](_0x4aaeff['query'][_0xac4a('0x3d')]));_0x566258[_0xac4a('0x3b')]=_0x566258[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x566258['attributes']:_0x3d2aaf[_0xac4a('0x38')];if(_0x4aaeff[_0xac4a('0x3a')][_0xac4a('0x4a')]){_0x566258[_0xac4a('0x4e')]=[{'all':!![]}];}_0x566258=_[_0xac4a('0x45')]({},_0x566258,_0x4aaeff['options']);return db[_0xac4a('0x35')]['find'](_0x566258)[_0xac4a('0x1d')](handleEntityNotFound(_0x18ae96,null))[_0xac4a('0x1d')](respondWithResult(_0x18ae96,null))['catch'](handleError(_0x18ae96,null));};exports['create']=function(_0x437466,_0x70fdc3){return db['ZendeskConfiguration'][_0xac4a('0x4f')](_0x437466[_0xac4a('0x50')],{})[_0xac4a('0x1d')](respondWithResult(_0x70fdc3,0xc9))[_0xac4a('0x25')](handleError(_0x70fdc3,null));};exports['update']=function(_0x3057d6,_0x108f7c){if(_0x3057d6[_0xac4a('0x50')]['id']){delete _0x3057d6[_0xac4a('0x50')]['id'];}return db[_0xac4a('0x35')][_0xac4a('0x51')]({'where':{'id':_0x3057d6[_0xac4a('0x52')]['id']}})['then'](handleEntityNotFound(_0x108f7c,null))[_0xac4a('0x1d')](saveUpdates(_0x3057d6[_0xac4a('0x50')],null))[_0xac4a('0x1d')](respondWithResult(_0x108f7c,null))[_0xac4a('0x25')](handleError(_0x108f7c,null));};exports[_0xac4a('0x30')]=function(_0x2ac1e9,_0x213df2){return db[_0xac4a('0x35')][_0xac4a('0x51')]({'where':{'id':_0x2ac1e9[_0xac4a('0x52')]['id']}})[_0xac4a('0x1d')](handleEntityNotFound(_0x213df2,null))[_0xac4a('0x1d')](removeEntity(_0x213df2,null))[_0xac4a('0x25')](handleError(_0x213df2,null));};exports[_0xac4a('0x53')]=function(_0x5222f3,_0x11c753,_0x492aae){var _0x13a577={};var _0x479ebc={};var _0x2d598e;var _0x4b7f79;return db[_0xac4a('0x35')]['findOne']({'where':{'id':_0x5222f3[_0xac4a('0x52')]['id']}})['then'](handleEntityNotFound(_0x11c753,null))['then'](function(_0x52c957){if(_0x52c957){_0x2d598e=_0x52c957;_0x479ebc[_0xac4a('0x38')]=_[_0xac4a('0x39')](db[_0xac4a('0x54')][_0xac4a('0x4d')]);_0x479ebc[_0xac4a('0x3a')]=_['keys'](_0x5222f3[_0xac4a('0x3a')]);_0x479ebc['filters']=_[_0xac4a('0x3c')](_0x479ebc['model'],_0x479ebc[_0xac4a('0x3a')]);_0x13a577[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x479ebc[_0xac4a('0x38')],qs[_0xac4a('0x3d')](_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x3d')]));_0x13a577[_0xac4a('0x3b')]=_0x13a577[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x13a577[_0xac4a('0x3b')]:_0x479ebc[_0xac4a('0x38')];_0x13a577[_0xac4a('0x3f')]=qs[_0xac4a('0x40')](_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x40')]);_0x13a577[_0xac4a('0x41')]=qs['filters'](_[_0xac4a('0x43')](_0x5222f3[_0xac4a('0x3a')],_0x479ebc['filters']));if(_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x44')]){_0x13a577[_0xac4a('0x41')]=_[_0xac4a('0x45')](_0x13a577[_0xac4a('0x41')],{'$or':_['map'](_0x13a577['attributes'],function(_0x45f3c3){var _0x11bb54={};_0x11bb54[_0x45f3c3]={'$like':'%'+_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x11bb54;})});}_0x13a577=_[_0xac4a('0x45')]({},_0x13a577,_0x5222f3[_0xac4a('0x48')]);return _0x2d598e[_0xac4a('0x53')](_0x13a577);}})[_0xac4a('0x1d')](function(_0x44c60b){if(_0x44c60b){_0x4b7f79=_0x44c60b[_0xac4a('0x3e')];if(!_0x5222f3[_0xac4a('0x3a')]['hasOwnProperty']('nolimit')){_0x13a577[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x2b')]);_0x13a577[_0xac4a('0x2a')]=qs[_0xac4a('0x2a')](_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x2a')]);}return _0x2d598e[_0xac4a('0x53')](_0x13a577);}})[_0xac4a('0x1d')](function(_0xb09b89){if(_0xb09b89){return _0xb09b89?{'count':_0x4b7f79,'rows':_0xb09b89}:null;}})[_0xac4a('0x1d')](respondWithResult(_0x11c753,null))['catch'](handleError(_0x11c753,null));};exports[_0xac4a('0x55')]=function(_0xc74ce8,_0x26bd31,_0x231932){var _0x513976={};var _0xc61e94={};var _0x5a30af;var _0xab4305;return db[_0xac4a('0x35')]['findOne']({'where':{'id':_0xc74ce8['params']['id']}})[_0xac4a('0x1d')](handleEntityNotFound(_0x26bd31,null))[_0xac4a('0x1d')](function(_0x13097f){if(_0x13097f){_0x5a30af=_0x13097f;_0xc61e94['model']=_[_0xac4a('0x39')](db['ZendeskField'][_0xac4a('0x4d')]);_0xc61e94['query']=_['keys'](_0xc74ce8[_0xac4a('0x3a')]);_0xc61e94['filters']=_[_0xac4a('0x3c')](_0xc61e94['model'],_0xc61e94[_0xac4a('0x3a')]);_0x513976[_0xac4a('0x3b')]=_['intersection'](_0xc61e94[_0xac4a('0x38')],qs['fields'](_0xc74ce8[_0xac4a('0x3a')][_0xac4a('0x3d')]));_0x513976['attributes']=_0x513976[_0xac4a('0x3b')]['length']?_0x513976['attributes']:_0xc61e94[_0xac4a('0x38')];_0x513976['order']=qs[_0xac4a('0x40')](_0xc74ce8['query']['sort']);_0x513976[_0xac4a('0x41')]=qs[_0xac4a('0x42')](_[_0xac4a('0x43')](_0xc74ce8['query'],_0xc61e94['filters']));if(_0xc74ce8[_0xac4a('0x3a')][_0xac4a('0x44')]){_0x513976['where']=_['merge'](_0x513976[_0xac4a('0x41')],{'$or':_[_0xac4a('0x34')](_0x513976[_0xac4a('0x3b')],function(_0x36df3d){var _0x1810f7={};_0x1810f7[_0x36df3d]={'$like':'%'+_0xc74ce8[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x1810f7;})});}_0x513976=_[_0xac4a('0x45')]({},_0x513976,_0xc74ce8[_0xac4a('0x48')]);return _0x5a30af['getSubjects'](_0x513976);}})[_0xac4a('0x1d')](function(_0x440dc4){if(_0x440dc4){_0xab4305=_0x440dc4[_0xac4a('0x3e')];if(!_0xc74ce8['query'][_0xac4a('0x56')](_0xac4a('0x57'))){_0x513976[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0xc74ce8[_0xac4a('0x3a')]['limit']);_0x513976[_0xac4a('0x2a')]=qs[_0xac4a('0x2a')](_0xc74ce8[_0xac4a('0x3a')][_0xac4a('0x2a')]);}return _0x5a30af[_0xac4a('0x55')](_0x513976);}})[_0xac4a('0x1d')](function(_0xd7bdd6){if(_0xd7bdd6){return _0xd7bdd6?{'count':_0xab4305,'rows':_0xd7bdd6}:null;}})['then'](respondWithResult(_0x26bd31,null))[_0xac4a('0x25')](handleError(_0x26bd31,null));};exports[_0xac4a('0x58')]=function(_0x19bd6f,_0x35a97c,_0x1bb24d){var _0x171c47={};var _0x547eec={};var _0x318bee;var _0x29c772;return db[_0xac4a('0x35')][_0xac4a('0x59')]({'where':{'id':_0x19bd6f['params']['id']}})[_0xac4a('0x1d')](handleEntityNotFound(_0x35a97c,null))['then'](function(_0x4447b5){if(_0x4447b5){_0x318bee=_0x4447b5;_0x547eec[_0xac4a('0x38')]=_['keys'](db['ZendeskField'][_0xac4a('0x4d')]);_0x547eec[_0xac4a('0x3a')]=_[_0xac4a('0x39')](_0x19bd6f['query']);_0x547eec[_0xac4a('0x42')]=_['intersection'](_0x547eec[_0xac4a('0x38')],_0x547eec[_0xac4a('0x3a')]);_0x171c47[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x547eec[_0xac4a('0x38')],qs['fields'](_0x19bd6f['query'][_0xac4a('0x3d')]));_0x171c47[_0xac4a('0x3b')]=_0x171c47[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x171c47[_0xac4a('0x3b')]:_0x547eec[_0xac4a('0x38')];_0x171c47[_0xac4a('0x3f')]=qs[_0xac4a('0x40')](_0x19bd6f['query']['sort']);_0x171c47[_0xac4a('0x41')]=qs[_0xac4a('0x42')](_[_0xac4a('0x43')](_0x19bd6f[_0xac4a('0x3a')],_0x547eec[_0xac4a('0x42')]));if(_0x19bd6f[_0xac4a('0x3a')][_0xac4a('0x44')]){_0x171c47[_0xac4a('0x41')]=_['merge'](_0x171c47['where'],{'$or':_[_0xac4a('0x34')](_0x171c47[_0xac4a('0x3b')],function(_0x22804e){var _0x371e06={};_0x371e06[_0x22804e]={'$like':'%'+_0x19bd6f[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x371e06;})});}_0x171c47=_[_0xac4a('0x45')]({},_0x171c47,_0x19bd6f['options']);return _0x318bee[_0xac4a('0x58')](_0x171c47);}})[_0xac4a('0x1d')](function(_0x3439f3){if(_0x3439f3){_0x29c772=_0x3439f3['length'];if(!_0x19bd6f[_0xac4a('0x3a')][_0xac4a('0x56')](_0xac4a('0x57'))){_0x171c47[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0x19bd6f[_0xac4a('0x3a')][_0xac4a('0x2b')]);_0x171c47[_0xac4a('0x2a')]=qs[_0xac4a('0x2a')](_0x19bd6f['query'][_0xac4a('0x2a')]);}return _0x318bee['getDescriptions'](_0x171c47);}})[_0xac4a('0x1d')](function(_0x1199f6){if(_0x1199f6){return _0x1199f6?{'count':_0x29c772,'rows':_0x1199f6}:null;}})[_0xac4a('0x1d')](respondWithResult(_0x35a97c,null))[_0xac4a('0x25')](handleError(_0x35a97c,null));};exports[_0xac4a('0x5a')]=function(_0x337da7,_0x19766a,_0x5266d3){var _0x2b883a={};var _0x42b3f7={};var _0x279f9b;var _0x3315e7;return db[_0xac4a('0x35')]['findOne']({'where':{'id':_0x337da7[_0xac4a('0x52')]['id']}})[_0xac4a('0x1d')](handleEntityNotFound(_0x19766a,null))['then'](function(_0x55af32){if(_0x55af32){_0x279f9b=_0x55af32;_0x42b3f7[_0xac4a('0x38')]=_[_0xac4a('0x39')](db['Tag'][_0xac4a('0x4d')]);_0x42b3f7[_0xac4a('0x3a')]=_[_0xac4a('0x39')](_0x337da7[_0xac4a('0x3a')]);_0x42b3f7[_0xac4a('0x42')]=_[_0xac4a('0x3c')](_0x42b3f7['model'],_0x42b3f7[_0xac4a('0x3a')]);_0x2b883a[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x42b3f7['model'],qs[_0xac4a('0x3d')](_0x337da7[_0xac4a('0x3a')][_0xac4a('0x3d')]));_0x2b883a[_0xac4a('0x3b')]=_0x2b883a[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x2b883a['attributes']:_0x42b3f7[_0xac4a('0x38')];_0x2b883a[_0xac4a('0x3f')]=qs['sort'](_0x337da7[_0xac4a('0x3a')]['sort']);_0x2b883a[_0xac4a('0x41')]=qs[_0xac4a('0x42')](_['pick'](_0x337da7[_0xac4a('0x3a')],_0x42b3f7['filters']));if(_0x337da7[_0xac4a('0x3a')]['filter']){_0x2b883a[_0xac4a('0x41')]=_[_0xac4a('0x45')](_0x2b883a[_0xac4a('0x41')],{'$or':_[_0xac4a('0x34')](_0x2b883a[_0xac4a('0x3b')],function(_0x36d8ff){var _0x7e403a={};_0x7e403a[_0x36d8ff]={'$like':'%'+_0x337da7[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x7e403a;})});}_0x2b883a=_[_0xac4a('0x45')]({},_0x2b883a,_0x337da7[_0xac4a('0x48')]);return _0x279f9b[_0xac4a('0x5a')](_0x2b883a);}})[_0xac4a('0x1d')](function(_0x4217df){if(_0x4217df){_0x3315e7=_0x4217df['length'];if(!_0x337da7[_0xac4a('0x3a')][_0xac4a('0x56')]('nolimit')){_0x2b883a[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0x337da7[_0xac4a('0x3a')][_0xac4a('0x2b')]);_0x2b883a[_0xac4a('0x2a')]=qs['offset'](_0x337da7[_0xac4a('0x3a')]['offset']);}return _0x279f9b[_0xac4a('0x5a')](_0x2b883a);}})[_0xac4a('0x1d')](function(_0x240ff1){if(_0x240ff1){return _0x240ff1?{'count':_0x3315e7,'rows':_0x240ff1}:null;}})[_0xac4a('0x1d')](respondWithResult(_0x19766a,null))['catch'](handleError(_0x19766a,null));};exports[_0xac4a('0x5b')]=function(_0x55866d,_0x277fd1,_0x40d363){if(_0x55866d[_0xac4a('0x50')]['id']){delete _0x55866d['body']['id'];}return db[_0xac4a('0x35')][_0xac4a('0x59')]({'where':{'id':_0x55866d[_0xac4a('0x52')]['id']}})['then'](handleEntityNotFound(_0x277fd1,null))[_0xac4a('0x1d')](function(_0x25639a){if(_0x25639a){return _0x25639a[_0xac4a('0x5b')](_0x55866d[_0xac4a('0x50')][_0xac4a('0x5c')]||[]);}return null;})[_0xac4a('0x1d')](respondWithResult(_0x277fd1,null))[_0xac4a('0x25')](handleError(_0x277fd1,null));}; \ No newline at end of file +var _0x326f=['VIRTUAL','filter','ZendeskConfiguration','count','includeAll','include','findAll','rows','show','params','options','find','create','body','destroy','getFields','findOne','hasOwnProperty','getSubjects','ZendeskField','getDescriptions','Tag','getTags','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','client','http','test','ValidationError','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','name','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge'];(function(_0x3e5ff3,_0x4aa0d2){var _0x2e6009=function(_0x1cd1fc){while(--_0x1cd1fc){_0x3e5ff3['push'](_0x3e5ff3['shift']());}};_0x2e6009(++_0x4aa0d2);}(_0x326f,0xd1));var _0xf326=function(_0x2eac27,_0xb18670){_0x2eac27=_0x2eac27-0x0;var _0x49ef4a=_0x326f[_0x2eac27];return _0x49ef4a;};'use strict';var pdf=require(_0xf326('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf326('0x1'));var jsonpatch=require(_0xf326('0x2'));var rp=require(_0xf326('0x3'));var moment=require(_0xf326('0x4'));var BPromise=require(_0xf326('0x5'));var Mustache=require(_0xf326('0x6'));var util=require(_0xf326('0x7'));var path=require(_0xf326('0x8'));var sox=require(_0xf326('0x9'));var csv=require(_0xf326('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var db=require(_0xf326('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xf326('0x17')][_0xf326('0x18')]({'port':0x232a});function checkPasswordPattern(_0x4b3966,_0x342fe5,_0x472632){if(_0x472632){var _0x3504eb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3504eb[_0xf326('0x19')](_0x342fe5)){return _0x4b3966;}else{throw new db['Sequelize'][(_0xf326('0x1a'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4b3966;}}function respondWithRpcPromise(_0x54bd1a,_0xdf21d9,_0x11f6d2,_0x1f2e5a){return new BPromise(function(_0xa63d1a,_0x292f4b){var _0x287a2a=_0x1f2e5a||client;return _0x287a2a[_0xf326('0x1b')](_0x54bd1a,_0x11f6d2)[_0xf326('0x1c')](function(_0x5a682a){logger[_0xf326('0x1d')](_0xf326('0x1e'),_0xdf21d9,_0xf326('0x1f'));logger[_0xf326('0x20')](_0xf326('0x21'),_0xdf21d9,_0xf326('0x1f'),JSON['stringify'](_0x5a682a));if(_0x5a682a['error']){if(_0x5a682a['error'][_0xf326('0x22')]===0x1f4){logger[_0xf326('0x23')]('ZendeskConfiguration,\x20%s,\x20%s',_0xdf21d9,_0x5a682a['error'][_0xf326('0x24')]);return _0x292f4b(_0x5a682a['error']['message']);}logger[_0xf326('0x23')](_0xf326('0x1e'),_0xdf21d9,_0x5a682a['error']['message']);return _0xa63d1a(_0x5a682a[_0xf326('0x23')][_0xf326('0x24')]);}else{logger['info'](_0xf326('0x1e'),_0xdf21d9,_0xf326('0x1f'));_0xa63d1a(_0x5a682a[_0xf326('0x25')][_0xf326('0x24')]);}})[_0xf326('0x26')](function(_0x2049ec){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0xdf21d9,_0x2049ec);_0x292f4b(_0x2049ec);});});}function respondWithStatusCode(_0x4f31f6,_0x520d85){_0x520d85=_0x520d85||0xcc;return function(_0x1a2c4e){if(_0x1a2c4e){return _0x4f31f6[_0xf326('0x27')](_0x520d85);}return _0x4f31f6[_0xf326('0x28')](_0x520d85)[_0xf326('0x29')]();};}function respondWithResult(_0x410237,_0x5217d4){_0x5217d4=_0x5217d4||0xc8;return function(_0x201d28){if(_0x201d28){return _0x410237[_0xf326('0x28')](_0x5217d4)[_0xf326('0x2a')](_0x201d28);}};}function respondWithFilteredResult(_0x581531,_0x1617d2){return function(_0x55ad0f){if(_0x55ad0f){var _0x4a9abf=_0x55ad0f['count'],_0x6a8e89=_0x1617d2[_0xf326('0x2b')],_0x1ae23a=_0x1617d2[_0xf326('0x2b')]+_0x1617d2['limit'],_0x2fa28e;if(_0x1ae23a>=_0x4a9abf){_0x1ae23a=_0x4a9abf;_0x2fa28e=0xc8;}else{_0x2fa28e=0xce;}_0x581531[_0xf326('0x28')](_0x2fa28e);return _0x581531[_0xf326('0x2c')](_0xf326('0x2d'),_0x6a8e89+'-'+_0x1ae23a+'/'+_0x4a9abf)[_0xf326('0x2a')](_0x55ad0f);}return null;};}function patchUpdates(_0xa80156){return function(_0x269be9){try{jsonpatch[_0xf326('0x2e')](_0x269be9,_0xa80156,!![]);}catch(_0x39a1e2){return BPromise[_0xf326('0x2f')](_0x39a1e2);}return _0x269be9[_0xf326('0x30')]();};}function saveUpdates(_0x4b52f2,_0x1035ed){return function(_0x424104){if(_0x424104){return _0x424104[_0xf326('0x31')](_0x4b52f2)['then'](function(_0x2c0cac){return _0x2c0cac;});}return null;};}function removeEntity(_0x1721fd,_0x303dc6){return function(_0x4df451){if(_0x4df451){return _0x4df451['destroy']()[_0xf326('0x1c')](function(){_0x1721fd[_0xf326('0x28')](0xcc)[_0xf326('0x29')]();});}};}function handleEntityNotFound(_0xf53cf3,_0x30694f){return function(_0x2e8a64){if(!_0x2e8a64){_0xf53cf3[_0xf326('0x27')](0x194);}return _0x2e8a64;};}function handleError(_0x2d5f20,_0x580374){_0x580374=_0x580374||0x1f4;return function(_0x461e93){logger[_0xf326('0x23')](_0x461e93['stack']);if(_0x461e93[_0xf326('0x32')]){delete _0x461e93['name'];}_0x2d5f20[_0xf326('0x28')](_0x580374)['send'](_0x461e93);};}exports['index']=function(_0xadb020,_0x4d8eac){var _0x40dcb4={},_0x57aa27={},_0x310dbb={'count':0x0,'rows':[]};var _0x409260=_[_0xf326('0x33')](db['ZendeskConfiguration'][_0xf326('0x34')],function(_0x4095e6){return{'name':_0x4095e6['fieldName'],'type':_0x4095e6[_0xf326('0x35')][_0xf326('0x36')]};});_0x57aa27[_0xf326('0x37')]=_[_0xf326('0x33')](_0x409260,'name');_0x57aa27[_0xf326('0x38')]=_[_0xf326('0x39')](_0xadb020[_0xf326('0x38')]);_0x57aa27[_0xf326('0x3a')]=_[_0xf326('0x3b')](_0x57aa27['model'],_0x57aa27[_0xf326('0x38')]);_0x40dcb4[_0xf326('0x3c')]=_['intersection'](_0x57aa27['model'],qs[_0xf326('0x3d')](_0xadb020['query']['fields']));_0x40dcb4[_0xf326('0x3c')]=_0x40dcb4['attributes'][_0xf326('0x3e')]?_0x40dcb4[_0xf326('0x3c')]:_0x57aa27[_0xf326('0x37')];if(!_0xadb020[_0xf326('0x38')]['hasOwnProperty'](_0xf326('0x3f'))){_0x40dcb4[_0xf326('0x40')]=qs[_0xf326('0x40')](_0xadb020[_0xf326('0x38')][_0xf326('0x40')]);_0x40dcb4[_0xf326('0x2b')]=qs[_0xf326('0x2b')](_0xadb020[_0xf326('0x38')][_0xf326('0x2b')]);}_0x40dcb4[_0xf326('0x41')]=qs[_0xf326('0x42')](_0xadb020[_0xf326('0x38')]['sort']);_0x40dcb4[_0xf326('0x43')]=qs[_0xf326('0x3a')](_[_0xf326('0x44')](_0xadb020[_0xf326('0x38')],_0x57aa27[_0xf326('0x3a')]));if(_0xadb020[_0xf326('0x38')]['filter']){_0x40dcb4[_0xf326('0x43')]=_[_0xf326('0x45')](_0x40dcb4['where'],{'$or':_[_0xf326('0x33')](_0x409260,function(_0x819bf6){if(_0x819bf6[_0xf326('0x35')]!==_0xf326('0x46')){var _0x427c34={};_0x427c34[_0x819bf6['name']]={'$like':'%'+_0xadb020['query'][_0xf326('0x47')]+'%'};return _0x427c34;}})});}_0x40dcb4=_[_0xf326('0x45')]({},_0x40dcb4,_0xadb020['options']);var _0x4bd865={'where':_0x40dcb4[_0xf326('0x43')]};return db[_0xf326('0x48')][_0xf326('0x49')](_0x4bd865)['then'](function(_0x301e65){_0x310dbb[_0xf326('0x49')]=_0x301e65;if(_0xadb020[_0xf326('0x38')][_0xf326('0x4a')]){_0x40dcb4[_0xf326('0x4b')]=[{'all':!![]}];}return db[_0xf326('0x48')][_0xf326('0x4c')](_0x40dcb4);})[_0xf326('0x1c')](function(_0x3df9a8){_0x310dbb[_0xf326('0x4d')]=_0x3df9a8;return _0x310dbb;})[_0xf326('0x1c')](respondWithFilteredResult(_0x4d8eac,_0x40dcb4))[_0xf326('0x26')](handleError(_0x4d8eac,null));};exports[_0xf326('0x4e')]=function(_0x395b1e,_0xeac1a1){var _0x59f9a7={'raw':![],'where':{'id':_0x395b1e[_0xf326('0x4f')]['id']}},_0x199f8b={};_0x199f8b[_0xf326('0x37')]=_[_0xf326('0x39')](db['ZendeskConfiguration'][_0xf326('0x34')]);_0x199f8b[_0xf326('0x38')]=_[_0xf326('0x39')](_0x395b1e[_0xf326('0x38')]);_0x199f8b['filters']=_[_0xf326('0x3b')](_0x199f8b[_0xf326('0x37')],_0x199f8b[_0xf326('0x38')]);_0x59f9a7[_0xf326('0x3c')]=_[_0xf326('0x3b')](_0x199f8b['model'],qs['fields'](_0x395b1e[_0xf326('0x38')][_0xf326('0x3d')]));_0x59f9a7[_0xf326('0x3c')]=_0x59f9a7['attributes'][_0xf326('0x3e')]?_0x59f9a7[_0xf326('0x3c')]:_0x199f8b[_0xf326('0x37')];if(_0x395b1e['query']['includeAll']){_0x59f9a7[_0xf326('0x4b')]=[{'all':!![]}];}_0x59f9a7=_['merge']({},_0x59f9a7,_0x395b1e[_0xf326('0x50')]);return db['ZendeskConfiguration'][_0xf326('0x51')](_0x59f9a7)[_0xf326('0x1c')](handleEntityNotFound(_0xeac1a1,null))[_0xf326('0x1c')](respondWithResult(_0xeac1a1,null))[_0xf326('0x26')](handleError(_0xeac1a1,null));};exports[_0xf326('0x52')]=function(_0x35d3c8,_0x7f7ece){return db['ZendeskConfiguration'][_0xf326('0x52')](_0x35d3c8[_0xf326('0x53')],{})[_0xf326('0x1c')](respondWithResult(_0x7f7ece,0xc9))['catch'](handleError(_0x7f7ece,null));};exports[_0xf326('0x31')]=function(_0x3a832f,_0x3b8635){if(_0x3a832f[_0xf326('0x53')]['id']){delete _0x3a832f[_0xf326('0x53')]['id'];}return db['ZendeskConfiguration'][_0xf326('0x51')]({'where':{'id':_0x3a832f[_0xf326('0x4f')]['id']}})[_0xf326('0x1c')](handleEntityNotFound(_0x3b8635,null))[_0xf326('0x1c')](saveUpdates(_0x3a832f['body'],null))[_0xf326('0x1c')](respondWithResult(_0x3b8635,null))[_0xf326('0x26')](handleError(_0x3b8635,null));};exports[_0xf326('0x54')]=function(_0x29e52e,_0x4d3b9e){return db['ZendeskConfiguration'][_0xf326('0x51')]({'where':{'id':_0x29e52e[_0xf326('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4d3b9e,null))[_0xf326('0x1c')](removeEntity(_0x4d3b9e,null))[_0xf326('0x26')](handleError(_0x4d3b9e,null));};exports[_0xf326('0x55')]=function(_0x1258d1,_0x5765b0,_0xb1c18c){var _0x5657b7={};var _0x5dbeb9={};var _0x9d84c3;var _0x51d466;return db[_0xf326('0x48')][_0xf326('0x56')]({'where':{'id':_0x1258d1[_0xf326('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5765b0,null))['then'](function(_0x1fd9c9){if(_0x1fd9c9){_0x9d84c3=_0x1fd9c9;_0x5dbeb9[_0xf326('0x37')]=_[_0xf326('0x39')](db['ZendeskField'][_0xf326('0x34')]);_0x5dbeb9['query']=_[_0xf326('0x39')](_0x1258d1[_0xf326('0x38')]);_0x5dbeb9[_0xf326('0x3a')]=_[_0xf326('0x3b')](_0x5dbeb9[_0xf326('0x37')],_0x5dbeb9[_0xf326('0x38')]);_0x5657b7[_0xf326('0x3c')]=_[_0xf326('0x3b')](_0x5dbeb9[_0xf326('0x37')],qs[_0xf326('0x3d')](_0x1258d1[_0xf326('0x38')][_0xf326('0x3d')]));_0x5657b7[_0xf326('0x3c')]=_0x5657b7['attributes'][_0xf326('0x3e')]?_0x5657b7['attributes']:_0x5dbeb9[_0xf326('0x37')];_0x5657b7[_0xf326('0x41')]=qs['sort'](_0x1258d1[_0xf326('0x38')]['sort']);_0x5657b7[_0xf326('0x43')]=qs[_0xf326('0x3a')](_[_0xf326('0x44')](_0x1258d1[_0xf326('0x38')],_0x5dbeb9[_0xf326('0x3a')]));if(_0x1258d1['query']['filter']){_0x5657b7[_0xf326('0x43')]=_[_0xf326('0x45')](_0x5657b7[_0xf326('0x43')],{'$or':_[_0xf326('0x33')](_0x5657b7[_0xf326('0x3c')],function(_0x579d2c){var _0x28c4f2={};_0x28c4f2[_0x579d2c]={'$like':'%'+_0x1258d1[_0xf326('0x38')]['filter']+'%'};return _0x28c4f2;})});}_0x5657b7=_['merge']({},_0x5657b7,_0x1258d1['options']);return _0x9d84c3[_0xf326('0x55')](_0x5657b7);}})[_0xf326('0x1c')](function(_0x4150fa){if(_0x4150fa){_0x51d466=_0x4150fa[_0xf326('0x3e')];if(!_0x1258d1[_0xf326('0x38')][_0xf326('0x57')](_0xf326('0x3f'))){_0x5657b7['limit']=qs[_0xf326('0x40')](_0x1258d1[_0xf326('0x38')][_0xf326('0x40')]);_0x5657b7[_0xf326('0x2b')]=qs['offset'](_0x1258d1[_0xf326('0x38')]['offset']);}return _0x9d84c3['getFields'](_0x5657b7);}})[_0xf326('0x1c')](function(_0x540fa0){if(_0x540fa0){return _0x540fa0?{'count':_0x51d466,'rows':_0x540fa0}:null;}})[_0xf326('0x1c')](respondWithResult(_0x5765b0,null))[_0xf326('0x26')](handleError(_0x5765b0,null));};exports[_0xf326('0x58')]=function(_0x2ea5a2,_0x17cd36,_0x541491){var _0x4a053c={};var _0x48d84a={};var _0xeeea57;var _0x307441;return db[_0xf326('0x48')][_0xf326('0x56')]({'where':{'id':_0x2ea5a2[_0xf326('0x4f')]['id']}})['then'](handleEntityNotFound(_0x17cd36,null))[_0xf326('0x1c')](function(_0x372dc8){if(_0x372dc8){_0xeeea57=_0x372dc8;_0x48d84a[_0xf326('0x37')]=_['keys'](db['ZendeskField'][_0xf326('0x34')]);_0x48d84a[_0xf326('0x38')]=_['keys'](_0x2ea5a2['query']);_0x48d84a[_0xf326('0x3a')]=_['intersection'](_0x48d84a[_0xf326('0x37')],_0x48d84a['query']);_0x4a053c['attributes']=_['intersection'](_0x48d84a[_0xf326('0x37')],qs[_0xf326('0x3d')](_0x2ea5a2[_0xf326('0x38')]['fields']));_0x4a053c[_0xf326('0x3c')]=_0x4a053c[_0xf326('0x3c')][_0xf326('0x3e')]?_0x4a053c[_0xf326('0x3c')]:_0x48d84a[_0xf326('0x37')];_0x4a053c[_0xf326('0x41')]=qs[_0xf326('0x42')](_0x2ea5a2[_0xf326('0x38')][_0xf326('0x42')]);_0x4a053c['where']=qs[_0xf326('0x3a')](_['pick'](_0x2ea5a2[_0xf326('0x38')],_0x48d84a[_0xf326('0x3a')]));if(_0x2ea5a2[_0xf326('0x38')]['filter']){_0x4a053c[_0xf326('0x43')]=_[_0xf326('0x45')](_0x4a053c[_0xf326('0x43')],{'$or':_['map'](_0x4a053c[_0xf326('0x3c')],function(_0x4057e1){var _0x3bbe4c={};_0x3bbe4c[_0x4057e1]={'$like':'%'+_0x2ea5a2[_0xf326('0x38')]['filter']+'%'};return _0x3bbe4c;})});}_0x4a053c=_[_0xf326('0x45')]({},_0x4a053c,_0x2ea5a2['options']);return _0xeeea57['getSubjects'](_0x4a053c);}})[_0xf326('0x1c')](function(_0x2c36d3){if(_0x2c36d3){_0x307441=_0x2c36d3['length'];if(!_0x2ea5a2['query']['hasOwnProperty'](_0xf326('0x3f'))){_0x4a053c['limit']=qs[_0xf326('0x40')](_0x2ea5a2[_0xf326('0x38')][_0xf326('0x40')]);_0x4a053c[_0xf326('0x2b')]=qs[_0xf326('0x2b')](_0x2ea5a2[_0xf326('0x38')]['offset']);}return _0xeeea57[_0xf326('0x58')](_0x4a053c);}})[_0xf326('0x1c')](function(_0x5f1724){if(_0x5f1724){return _0x5f1724?{'count':_0x307441,'rows':_0x5f1724}:null;}})['then'](respondWithResult(_0x17cd36,null))[_0xf326('0x26')](handleError(_0x17cd36,null));};exports['getDescriptions']=function(_0x35a7c9,_0x147d51,_0x153027){var _0x363e64={};var _0x19d676={};var _0x6e662;var _0x293600;return db[_0xf326('0x48')][_0xf326('0x56')]({'where':{'id':_0x35a7c9['params']['id']}})[_0xf326('0x1c')](handleEntityNotFound(_0x147d51,null))[_0xf326('0x1c')](function(_0x4ac90e){if(_0x4ac90e){_0x6e662=_0x4ac90e;_0x19d676[_0xf326('0x37')]=_['keys'](db[_0xf326('0x59')][_0xf326('0x34')]);_0x19d676[_0xf326('0x38')]=_['keys'](_0x35a7c9[_0xf326('0x38')]);_0x19d676[_0xf326('0x3a')]=_[_0xf326('0x3b')](_0x19d676[_0xf326('0x37')],_0x19d676[_0xf326('0x38')]);_0x363e64[_0xf326('0x3c')]=_[_0xf326('0x3b')](_0x19d676[_0xf326('0x37')],qs[_0xf326('0x3d')](_0x35a7c9[_0xf326('0x38')][_0xf326('0x3d')]));_0x363e64[_0xf326('0x3c')]=_0x363e64[_0xf326('0x3c')][_0xf326('0x3e')]?_0x363e64[_0xf326('0x3c')]:_0x19d676['model'];_0x363e64[_0xf326('0x41')]=qs[_0xf326('0x42')](_0x35a7c9['query'][_0xf326('0x42')]);_0x363e64[_0xf326('0x43')]=qs['filters'](_[_0xf326('0x44')](_0x35a7c9[_0xf326('0x38')],_0x19d676[_0xf326('0x3a')]));if(_0x35a7c9[_0xf326('0x38')][_0xf326('0x47')]){_0x363e64[_0xf326('0x43')]=_[_0xf326('0x45')](_0x363e64['where'],{'$or':_[_0xf326('0x33')](_0x363e64[_0xf326('0x3c')],function(_0x323fb1){var _0x3c33d1={};_0x3c33d1[_0x323fb1]={'$like':'%'+_0x35a7c9[_0xf326('0x38')][_0xf326('0x47')]+'%'};return _0x3c33d1;})});}_0x363e64=_[_0xf326('0x45')]({},_0x363e64,_0x35a7c9[_0xf326('0x50')]);return _0x6e662['getDescriptions'](_0x363e64);}})[_0xf326('0x1c')](function(_0x2e2103){if(_0x2e2103){_0x293600=_0x2e2103['length'];if(!_0x35a7c9[_0xf326('0x38')]['hasOwnProperty'](_0xf326('0x3f'))){_0x363e64[_0xf326('0x40')]=qs[_0xf326('0x40')](_0x35a7c9[_0xf326('0x38')][_0xf326('0x40')]);_0x363e64[_0xf326('0x2b')]=qs[_0xf326('0x2b')](_0x35a7c9[_0xf326('0x38')][_0xf326('0x2b')]);}return _0x6e662[_0xf326('0x5a')](_0x363e64);}})[_0xf326('0x1c')](function(_0x3face2){if(_0x3face2){return _0x3face2?{'count':_0x293600,'rows':_0x3face2}:null;}})[_0xf326('0x1c')](respondWithResult(_0x147d51,null))[_0xf326('0x26')](handleError(_0x147d51,null));};exports['getTags']=function(_0x2bb6f0,_0xdb6e40,_0x27c569){var _0x3d3bd4={};var _0xdb2ad8={};var _0x550f34;var _0x1ec128;return db[_0xf326('0x48')][_0xf326('0x56')]({'where':{'id':_0x2bb6f0[_0xf326('0x4f')]['id']}})[_0xf326('0x1c')](handleEntityNotFound(_0xdb6e40,null))['then'](function(_0x4b6ec0){if(_0x4b6ec0){_0x550f34=_0x4b6ec0;_0xdb2ad8[_0xf326('0x37')]=_['keys'](db[_0xf326('0x5b')][_0xf326('0x34')]);_0xdb2ad8[_0xf326('0x38')]=_['keys'](_0x2bb6f0['query']);_0xdb2ad8[_0xf326('0x3a')]=_[_0xf326('0x3b')](_0xdb2ad8[_0xf326('0x37')],_0xdb2ad8[_0xf326('0x38')]);_0x3d3bd4[_0xf326('0x3c')]=_['intersection'](_0xdb2ad8[_0xf326('0x37')],qs[_0xf326('0x3d')](_0x2bb6f0[_0xf326('0x38')]['fields']));_0x3d3bd4['attributes']=_0x3d3bd4['attributes'][_0xf326('0x3e')]?_0x3d3bd4[_0xf326('0x3c')]:_0xdb2ad8[_0xf326('0x37')];_0x3d3bd4[_0xf326('0x41')]=qs[_0xf326('0x42')](_0x2bb6f0[_0xf326('0x38')][_0xf326('0x42')]);_0x3d3bd4['where']=qs['filters'](_[_0xf326('0x44')](_0x2bb6f0[_0xf326('0x38')],_0xdb2ad8[_0xf326('0x3a')]));if(_0x2bb6f0['query'][_0xf326('0x47')]){_0x3d3bd4[_0xf326('0x43')]=_[_0xf326('0x45')](_0x3d3bd4['where'],{'$or':_[_0xf326('0x33')](_0x3d3bd4[_0xf326('0x3c')],function(_0x267bae){var _0x3d728a={};_0x3d728a[_0x267bae]={'$like':'%'+_0x2bb6f0['query']['filter']+'%'};return _0x3d728a;})});}_0x3d3bd4=_['merge']({},_0x3d3bd4,_0x2bb6f0[_0xf326('0x50')]);return _0x550f34[_0xf326('0x5c')](_0x3d3bd4);}})[_0xf326('0x1c')](function(_0x5f0b45){if(_0x5f0b45){_0x1ec128=_0x5f0b45[_0xf326('0x3e')];if(!_0x2bb6f0[_0xf326('0x38')][_0xf326('0x57')]('nolimit')){_0x3d3bd4[_0xf326('0x40')]=qs[_0xf326('0x40')](_0x2bb6f0[_0xf326('0x38')][_0xf326('0x40')]);_0x3d3bd4['offset']=qs[_0xf326('0x2b')](_0x2bb6f0['query'][_0xf326('0x2b')]);}return _0x550f34[_0xf326('0x5c')](_0x3d3bd4);}})[_0xf326('0x1c')](function(_0xd45708){if(_0xd45708){return _0xd45708?{'count':_0x1ec128,'rows':_0xd45708}:null;}})['then'](respondWithResult(_0xdb6e40,null))[_0xf326('0x26')](handleError(_0xdb6e40,null));};exports['setTags']=function(_0x499316,_0x1ec34d,_0x1d6962){if(_0x499316[_0xf326('0x53')]['id']){delete _0x499316[_0xf326('0x53')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x499316[_0xf326('0x4f')]['id']}})[_0xf326('0x1c')](handleEntityNotFound(_0x1ec34d,null))[_0xf326('0x1c')](function(_0xc67315){if(_0xc67315){return _0xc67315['setTags'](_0x499316[_0xf326('0x53')]['ids']||[]);}return null;})[_0xf326('0x1c')](respondWithResult(_0x1ec34d,null))[_0xf326('0x26')](handleError(_0x1ec34d,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 1f8e83f..e4deeab 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 _0xd561=['../../config/environment','exports','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','request-promise','rimraf'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xd561,0x176));var _0x1d56=function(_0x5c55f7,_0x5f045b){_0x5c55f7=_0x5c55f7-0x0;var _0x3db286=_0xd561[_0x5c55f7];return _0x3db286;};'use strict';var _=require(_0x1d56('0x0'));var util=require(_0x1d56('0x1'));var logger=require(_0x1d56('0x2'))(_0x1d56('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1d56('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1d56('0x5'));var config=require(_0x1d56('0x6'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x1d56('0x7')]=function(_0x482611,_0x360419){return _0x482611['define'](_0x1d56('0x8'),attributes,{'tableName':_0x1d56('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e1e=['util','api','moment','path','../../config/environment','./intZendeskConfiguration.attributes','exports','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x8e1e,0xa2));var _0xe8e1=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x8e1e[_0x12f688];return _0x59c3de;};'use strict';var _=require('lodash');var util=require(_0xe8e1('0x0'));var logger=require('../../config/logger')(_0xe8e1('0x1'));var moment=require(_0xe8e1('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe8e1('0x3'));var rimraf=require('rimraf');var config=require(_0xe8e1('0x4'));var attributes=require(_0xe8e1('0x5'));module[_0xe8e1('0x6')]=function(_0x2ea340,_0x22ce72){return _0x2ea340['define'](_0xe8e1('0x7'),attributes,{'tableName':_0xe8e1('0x8'),'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 4cd5d89..fc98cc1 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 _0x925b=['info','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message'];(function(_0x12432d,_0x48e284){var _0x759d76=function(_0x5c6a62){while(--_0x5c6a62){_0x12432d['push'](_0x12432d['shift']());}};_0x759d76(++_0x48e284);}(_0x925b,0xbc));var _0xb925=function(_0x30abff,_0x5f2c5f){_0x30abff=_0x30abff-0x0;var _0x4c571e=_0x925b[_0x30abff];return _0x4c571e;};'use strict';var _=require(_0xb925('0x0'));var util=require('util');var moment=require(_0xb925('0x1'));var BPromise=require(_0xb925('0x2'));var rs=require(_0xb925('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb925('0x4'));var logger=require(_0xb925('0x5'))(_0xb925('0x6'));var config=require('../../config/environment');var jayson=require(_0xb925('0x7'));var client=jayson[_0xb925('0x8')][_0xb925('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7b87ee,_0x56b511,_0x52b2a9){return new BPromise(function(_0xd3e6f7,_0x3d2fc5){return client[_0xb925('0xa')](_0x7b87ee,_0x52b2a9)[_0xb925('0xb')](function(_0x591c08){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x56b511,'request\x20sent');logger[_0xb925('0xc')](_0xb925('0xd'),_0x56b511,'request\x20sent',JSON[_0xb925('0xe')](_0x591c08));if(_0x591c08['error']){if(_0x591c08[_0xb925('0xf')][_0xb925('0x10')]===0x1f4){logger[_0xb925('0xf')](_0xb925('0x11'),_0x56b511,_0x591c08['error'][_0xb925('0x12')]);return _0x3d2fc5(_0x591c08['error'][_0xb925('0x12')]);}logger[_0xb925('0xf')](_0xb925('0x11'),_0x56b511,_0x591c08[_0xb925('0xf')][_0xb925('0x12')]);return _0xd3e6f7(_0x591c08[_0xb925('0xf')][_0xb925('0x12')]);}else{logger[_0xb925('0x13')](_0xb925('0x11'),_0x56b511,_0xb925('0x14'));_0xd3e6f7(_0x591c08[_0xb925('0x15')][_0xb925('0x12')]);}})[_0xb925('0x16')](function(_0x2f5e44){logger['error'](_0xb925('0x11'),_0x56b511,_0x2f5e44);_0x3d2fc5(_0x2f5e44);});});} \ No newline at end of file +var _0x0d45=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x26d36a,_0x3e84bb){var _0x425966=function(_0x3054f6){while(--_0x3054f6){_0x26d36a['push'](_0x26d36a['shift']());}};_0x425966(++_0x3e84bb);}(_0x0d45,0xa3));var _0x50d4=function(_0x27dd02,_0x504204){_0x27dd02=_0x27dd02-0x0;var _0x24a334=_0x0d45[_0x27dd02];return _0x24a334;};'use strict';var _=require(_0x50d4('0x0'));var util=require(_0x50d4('0x1'));var moment=require(_0x50d4('0x2'));var BPromise=require(_0x50d4('0x3'));var rs=require(_0x50d4('0x4'));var fs=require('fs');var Redis=require(_0x50d4('0x5'));var db=require(_0x50d4('0x6'))['db'];var utils=require(_0x50d4('0x7'));var logger=require('../../config/logger')(_0x50d4('0x8'));var config=require(_0x50d4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x50d4('0xa')][_0x50d4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38a207,_0x50939f,_0x576ef3){return new BPromise(function(_0x3957b4,_0x78e27a){return client[_0x50d4('0xc')](_0x38a207,_0x576ef3)[_0x50d4('0xd')](function(_0x165772){logger['info'](_0x50d4('0xe'),_0x50939f,'request\x20sent');logger[_0x50d4('0xf')](_0x50d4('0x10'),_0x50939f,'request\x20sent',JSON['stringify'](_0x165772));if(_0x165772['error']){if(_0x165772[_0x50d4('0x11')][_0x50d4('0x12')]===0x1f4){logger[_0x50d4('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x50939f,_0x165772[_0x50d4('0x11')]['message']);return _0x78e27a(_0x165772[_0x50d4('0x11')][_0x50d4('0x13')]);}logger['error'](_0x50d4('0xe'),_0x50939f,_0x165772['error'][_0x50d4('0x13')]);return _0x3957b4(_0x165772[_0x50d4('0x11')][_0x50d4('0x13')]);}else{logger[_0x50d4('0x14')](_0x50d4('0xe'),_0x50939f,_0x50d4('0x15'));_0x3957b4(_0x165772[_0x50d4('0x16')]['message']);}})[_0x50d4('0x17')](function(_0x41f678){logger[_0x50d4('0x11')](_0x50d4('0xe'),_0x50939f,_0x41f678);_0x78e27a(_0x41f678);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 24b3998..730e2de 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 _0xe9d5=['destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x4b006b,_0x3c1db3){var _0x362121=function(_0x3e7727){while(--_0x3e7727){_0x4b006b['push'](_0x4b006b['shift']());}};_0x362121(++_0x3c1db3);}(_0xe9d5,0x191));var _0x5e9d=function(_0x2624f7,_0x4175b9){_0x2624f7=_0x2624f7-0x0;var _0x3ea815=_0xe9d5[_0x2624f7];return _0x3ea815;};'use strict';var multer=require(_0x5e9d('0x0'));var util=require(_0x5e9d('0x1'));var path=require(_0x5e9d('0x2'));var timeout=require(_0x5e9d('0x3'));var express=require(_0x5e9d('0x4'));var router=express['Router']();var auth=require(_0x5e9d('0x5'));var interaction=require(_0x5e9d('0x6'));var config=require(_0x5e9d('0x7'));var controller=require(_0x5e9d('0x8'));router[_0x5e9d('0x9')]('/',auth[_0x5e9d('0xa')](),controller[_0x5e9d('0xb')]);router[_0x5e9d('0x9')](_0x5e9d('0xc'),auth[_0x5e9d('0xa')](),controller[_0x5e9d('0xd')]);router[_0x5e9d('0xe')]('/',auth['isAuthenticated'](),controller[_0x5e9d('0xf')]);router[_0x5e9d('0x10')](_0x5e9d('0xc'),auth[_0x5e9d('0xa')](),controller[_0x5e9d('0x11')]);router[_0x5e9d('0x12')](_0x5e9d('0xc'),auth['isAuthenticated'](),controller[_0x5e9d('0x13')]);module[_0x5e9d('0x14')]=router; \ No newline at end of file +var _0xe43c=['get','isAuthenticated','index','/:id','show','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./intZendeskField.controller'];(function(_0x11beb2,_0x46d79d){var _0x5b0a97=function(_0x1f84a7){while(--_0x1f84a7){_0x11beb2['push'](_0x11beb2['shift']());}};_0x5b0a97(++_0x46d79d);}(_0xe43c,0x180));var _0xce43=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xe43c[_0x16b9ed];return _0x66b1f8;};'use strict';var multer=require(_0xce43('0x0'));var util=require(_0xce43('0x1'));var path=require(_0xce43('0x2'));var timeout=require(_0xce43('0x3'));var express=require(_0xce43('0x4'));var router=express[_0xce43('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xce43('0x6'));var config=require('../../config/environment');var controller=require(_0xce43('0x7'));router[_0xce43('0x8')]('/',auth[_0xce43('0x9')](),controller[_0xce43('0xa')]);router['get'](_0xce43('0xb'),auth['isAuthenticated'](),controller[_0xce43('0xc')]);router['post']('/',auth[_0xce43('0x9')](),controller['create']);router['put'](_0xce43('0xb'),auth[_0xce43('0x9')](),controller['update']);router['delete']('/:id',auth[_0xce43('0x9')](),controller['destroy']);module[_0xce43('0xd')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 7a398a0..b54345d 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 _0xf29c=['customVariable','keyValue','STRING','exports','ENUM','string','variable'];(function(_0x323c59,_0x2fa7f5){var _0x4b2831=function(_0x11c3b3){while(--_0x11c3b3){_0x323c59['push'](_0x323c59['shift']());}};_0x4b2831(++_0x2fa7f5);}(_0xf29c,0xc7));var _0xcf29=function(_0xf0f250,_0xbbb683){_0xf0f250=_0xf0f250-0x0;var _0x174135=_0xf29c[_0xf0f250];return _0x174135;};'use strict';var Sequelize=require('sequelize');module[_0xcf29('0x0')]={'type':{'type':Sequelize[_0xcf29('0x1')](_0xcf29('0x2'),_0xcf29('0x3'),_0xcf29('0x4'),_0xcf29('0x5')),'defaultValue':_0xcf29('0x2')},'content':{'type':Sequelize[_0xcf29('0x6')]},'key':{'type':Sequelize[_0xcf29('0x6')]},'keyType':{'type':Sequelize[_0xcf29('0x1')](_0xcf29('0x2'),_0xcf29('0x3'),_0xcf29('0x4'))},'keyContent':{'type':Sequelize[_0xcf29('0x6')]},'idField':{'type':Sequelize[_0xcf29('0x6')]},'nameField':{'type':Sequelize[_0xcf29('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5bbd=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x21233f,_0x3df373){var _0x581d9c=function(_0x1bb740){while(--_0x1bb740){_0x21233f['push'](_0x21233f['shift']());}};_0x581d9c(++_0x3df373);}(_0x5bbd,0x12b));var _0xd5bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5bbd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd5bb('0x0'));module[_0xd5bb('0x1')]={'type':{'type':Sequelize[_0xd5bb('0x2')](_0xd5bb('0x3'),_0xd5bb('0x4'),_0xd5bb('0x5'),_0xd5bb('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd5bb('0x2')](_0xd5bb('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xd5bb('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xd5bb('0x7')]},'customField':{'type':Sequelize[_0xd5bb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd5bb('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 891cbe0..52a32eb 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 _0x4634=['options','find','catch','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','status','end','json','count','offset','set','Content-Range','save','then','destroy','sendStatus','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','model'];(function(_0x5da955,_0x32d5cd){var _0x5450d6=function(_0x540565){while(--_0x540565){_0x5da955['push'](_0x5da955['shift']());}};_0x5450d6(++_0x32d5cd);}(_0x4634,0x173));var _0x4463=function(_0x4238ca,_0x472580){_0x4238ca=_0x4238ca-0x0;var _0x421c3d=_0x4634[_0x4238ca];return _0x421c3d;};'use strict';var pdf=require(_0x4463('0x0'));var emlformat=require(_0x4463('0x1'));var rimraf=require(_0x4463('0x2'));var zipdir=require(_0x4463('0x3'));var jsonpatch=require(_0x4463('0x4'));var rp=require(_0x4463('0x5'));var moment=require(_0x4463('0x6'));var BPromise=require(_0x4463('0x7'));var Mustache=require(_0x4463('0x8'));var util=require(_0x4463('0x9'));var path=require(_0x4463('0xa'));var sox=require(_0x4463('0xb'));var csv=require(_0x4463('0xc'));var ejs=require(_0x4463('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4463('0xe'));var crypto=require(_0x4463('0xf'));var jsforce=require(_0x4463('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4463('0x11'));var Papa=require('papaparse');var Redis=require(_0x4463('0x12'));var authService=require(_0x4463('0x13'));var qs=require(_0x4463('0x14'));var as=require(_0x4463('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4463('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x4463('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b0bb9,_0x5aa22c){_0x5aa22c=_0x5aa22c||0xcc;return function(_0x1b16c2){if(_0x1b16c2){return _0x4b0bb9['sendStatus'](_0x5aa22c);}return _0x4b0bb9[_0x4463('0x18')](_0x5aa22c)[_0x4463('0x19')]();};}function respondWithResult(_0x5445a1,_0x1181af){_0x1181af=_0x1181af||0xc8;return function(_0x5d7464){if(_0x5d7464){return _0x5445a1[_0x4463('0x18')](_0x1181af)[_0x4463('0x1a')](_0x5d7464);}};}function respondWithFilteredResult(_0x308a79,_0x3602cf){return function(_0x3984db){if(_0x3984db){var _0x2e9eef=_0x3984db[_0x4463('0x1b')],_0x58f17d=_0x3602cf['offset'],_0x105b85=_0x3602cf[_0x4463('0x1c')]+_0x3602cf['limit'],_0x4b8801;if(_0x105b85>=_0x2e9eef){_0x105b85=_0x2e9eef;_0x4b8801=0xc8;}else{_0x4b8801=0xce;}_0x308a79[_0x4463('0x18')](_0x4b8801);return _0x308a79[_0x4463('0x1d')](_0x4463('0x1e'),_0x58f17d+'-'+_0x105b85+'/'+_0x2e9eef)[_0x4463('0x1a')](_0x3984db);}return null;};}function patchUpdates(_0x544384){return function(_0x248544){try{jsonpatch['apply'](_0x248544,_0x544384,!![]);}catch(_0xb19c6e){return BPromise['reject'](_0xb19c6e);}return _0x248544[_0x4463('0x1f')]();};}function saveUpdates(_0x50608e,_0x2ff7cd){return function(_0x5d9416){if(_0x5d9416){return _0x5d9416['update'](_0x50608e)[_0x4463('0x20')](function(_0x1dc267){return _0x1dc267;});}return null;};}function removeEntity(_0x4512bf,_0x2c01b7){return function(_0x371084){if(_0x371084){return _0x371084[_0x4463('0x21')]()[_0x4463('0x20')](function(){_0x4512bf[_0x4463('0x18')](0xcc)[_0x4463('0x19')]();});}};}function handleEntityNotFound(_0x41400b,_0x4fcadc){return function(_0xb0cbf){if(!_0xb0cbf){_0x41400b[_0x4463('0x22')](0x194);}return _0xb0cbf;};}function handleError(_0x2206ab,_0x5762a8){_0x5762a8=_0x5762a8||0x1f4;return function(_0x562e7c){logger[_0x4463('0x23')](_0x562e7c[_0x4463('0x24')]);if(_0x562e7c[_0x4463('0x25')]){delete _0x562e7c[_0x4463('0x25')];}_0x2206ab[_0x4463('0x18')](_0x5762a8)[_0x4463('0x26')](_0x562e7c);};}exports[_0x4463('0x27')]=function(_0x257ae1,_0x4d249d){var _0x4bf4c5={},_0x5a6902={},_0x436de3={'count':0x0,'rows':[]};var _0x26aed8=_[_0x4463('0x28')](db[_0x4463('0x29')][_0x4463('0x2a')],function(_0x2c6571){return{'name':_0x2c6571[_0x4463('0x2b')],'type':_0x2c6571['type'][_0x4463('0x2c')]};});_0x5a6902['model']=_[_0x4463('0x28')](_0x26aed8,_0x4463('0x25'));_0x5a6902[_0x4463('0x2d')]=_[_0x4463('0x2e')](_0x257ae1[_0x4463('0x2d')]);_0x5a6902[_0x4463('0x2f')]=_[_0x4463('0x30')](_0x5a6902['model'],_0x5a6902[_0x4463('0x2d')]);_0x4bf4c5[_0x4463('0x31')]=_[_0x4463('0x30')](_0x5a6902['model'],qs[_0x4463('0x32')](_0x257ae1[_0x4463('0x2d')][_0x4463('0x32')]));_0x4bf4c5[_0x4463('0x31')]=_0x4bf4c5['attributes'][_0x4463('0x33')]?_0x4bf4c5['attributes']:_0x5a6902['model'];if(!_0x257ae1[_0x4463('0x2d')][_0x4463('0x34')]('nolimit')){_0x4bf4c5[_0x4463('0x35')]=qs[_0x4463('0x35')](_0x257ae1[_0x4463('0x2d')]['limit']);_0x4bf4c5[_0x4463('0x1c')]=qs[_0x4463('0x1c')](_0x257ae1[_0x4463('0x2d')]['offset']);}_0x4bf4c5[_0x4463('0x36')]=qs[_0x4463('0x37')](_0x257ae1[_0x4463('0x2d')][_0x4463('0x37')]);_0x4bf4c5[_0x4463('0x38')]=qs[_0x4463('0x2f')](_[_0x4463('0x39')](_0x257ae1[_0x4463('0x2d')],_0x5a6902[_0x4463('0x2f')]));if(_0x257ae1[_0x4463('0x2d')][_0x4463('0x3a')]){_0x4bf4c5[_0x4463('0x38')]=_[_0x4463('0x3b')](_0x4bf4c5['where'],{'$or':_[_0x4463('0x28')](_0x26aed8,function(_0x3410b7){if(_0x3410b7[_0x4463('0x3c')]!==_0x4463('0x3d')){var _0x176e0d={};_0x176e0d[_0x3410b7[_0x4463('0x25')]]={'$like':'%'+_0x257ae1[_0x4463('0x2d')][_0x4463('0x3a')]+'%'};return _0x176e0d;}})});}_0x4bf4c5=_[_0x4463('0x3b')]({},_0x4bf4c5,_0x257ae1['options']);var _0x812536={'where':_0x4bf4c5['where']};return db[_0x4463('0x29')][_0x4463('0x1b')](_0x812536)[_0x4463('0x20')](function(_0x4ae3af){_0x436de3[_0x4463('0x1b')]=_0x4ae3af;if(_0x257ae1['query'][_0x4463('0x3e')]){_0x4bf4c5[_0x4463('0x3f')]=[{'all':!![]}];}return db[_0x4463('0x29')][_0x4463('0x40')](_0x4bf4c5);})[_0x4463('0x20')](function(_0x44edcb){_0x436de3[_0x4463('0x41')]=_0x44edcb;return _0x436de3;})[_0x4463('0x20')](respondWithFilteredResult(_0x4d249d,_0x4bf4c5))['catch'](handleError(_0x4d249d,null));};exports['show']=function(_0x129bd6,_0x4ad30f){var _0x1d5057={'raw':!![],'where':{'id':_0x129bd6['params']['id']}},_0x84c90a={};_0x84c90a[_0x4463('0x42')]=_[_0x4463('0x2e')](db[_0x4463('0x29')][_0x4463('0x2a')]);_0x84c90a[_0x4463('0x2d')]=_['keys'](_0x129bd6['query']);_0x84c90a[_0x4463('0x2f')]=_[_0x4463('0x30')](_0x84c90a[_0x4463('0x42')],_0x84c90a['query']);_0x1d5057[_0x4463('0x31')]=_['intersection'](_0x84c90a['model'],qs['fields'](_0x129bd6[_0x4463('0x2d')][_0x4463('0x32')]));_0x1d5057[_0x4463('0x31')]=_0x1d5057['attributes'][_0x4463('0x33')]?_0x1d5057[_0x4463('0x31')]:_0x84c90a[_0x4463('0x42')];if(_0x129bd6[_0x4463('0x2d')][_0x4463('0x3e')]){_0x1d5057['include']=[{'all':!![]}];}_0x1d5057=_[_0x4463('0x3b')]({},_0x1d5057,_0x129bd6[_0x4463('0x43')]);return db[_0x4463('0x29')][_0x4463('0x44')](_0x1d5057)[_0x4463('0x20')](handleEntityNotFound(_0x4ad30f,null))[_0x4463('0x20')](respondWithResult(_0x4ad30f,null))[_0x4463('0x45')](handleError(_0x4ad30f,null));};exports[_0x4463('0x46')]=function(_0x17ac66,_0x596dd8){return db['ZendeskField'][_0x4463('0x46')](_0x17ac66[_0x4463('0x47')],{})[_0x4463('0x20')](respondWithResult(_0x596dd8,0xc9))['catch'](handleError(_0x596dd8,null));};exports['update']=function(_0x512d8a,_0x2de7e7){if(_0x512d8a[_0x4463('0x47')]['id']){delete _0x512d8a[_0x4463('0x47')]['id'];}return db['ZendeskField'][_0x4463('0x44')]({'where':{'id':_0x512d8a[_0x4463('0x48')]['id']}})[_0x4463('0x20')](handleEntityNotFound(_0x2de7e7,null))['then'](saveUpdates(_0x512d8a[_0x4463('0x47')],null))[_0x4463('0x20')](respondWithResult(_0x2de7e7,null))[_0x4463('0x45')](handleError(_0x2de7e7,null));};exports[_0x4463('0x21')]=function(_0x414ea7,_0x363c6c){return db[_0x4463('0x29')]['find']({'where':{'id':_0x414ea7[_0x4463('0x48')]['id']}})[_0x4463('0x20')](handleEntityNotFound(_0x363c6c,null))['then'](removeEntity(_0x363c6c,null))[_0x4463('0x45')](handleError(_0x363c6c,null));}; \ No newline at end of file +var _0xce2b=['type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','rawAttributes','find','catch','create','update','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','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','count','offset','limit','set','Content-Range','reject','save','then','error','stack','name','send','index','map','ZendeskField','fieldName'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0xce2b,0x107));var _0xbce2=function(_0xc7a86b,_0x1fecea){_0xc7a86b=_0xc7a86b-0x0;var _0x15a15f=_0xce2b[_0xc7a86b];return _0x15a15f;};'use strict';var pdf=require(_0xbce2('0x0'));var emlformat=require(_0xbce2('0x1'));var rimraf=require(_0xbce2('0x2'));var zipdir=require(_0xbce2('0x3'));var jsonpatch=require(_0xbce2('0x4'));var rp=require('request-promise');var moment=require(_0xbce2('0x5'));var BPromise=require(_0xbce2('0x6'));var Mustache=require(_0xbce2('0x7'));var util=require(_0xbce2('0x8'));var path=require('path');var sox=require(_0xbce2('0x9'));var csv=require(_0xbce2('0xa'));var ejs=require(_0xbce2('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbce2('0xc'));var crypto=require(_0xbce2('0xd'));var jsforce=require(_0xbce2('0xe'));var deskjs=require(_0xbce2('0xf'));var toCsv=require(_0xbce2('0xa'));var querystring=require('querystring');var Papa=require(_0xbce2('0x10'));var Redis=require(_0xbce2('0x11'));var authService=require(_0xbce2('0x12'));var qs=require(_0xbce2('0x13'));var as=require(_0xbce2('0x14'));var hardwareService=require(_0xbce2('0x15'));var logger=require(_0xbce2('0x16'))(_0xbce2('0x17'));var utils=require('../../config/utils');var config=require(_0xbce2('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d52a2,_0x1b48e0){_0x1b48e0=_0x1b48e0||0xcc;return function(_0x11c6a0){if(_0x11c6a0){return _0x2d52a2[_0xbce2('0x19')](_0x1b48e0);}return _0x2d52a2[_0xbce2('0x1a')](_0x1b48e0)[_0xbce2('0x1b')]();};}function respondWithResult(_0x1a7aaa,_0x49a3e0){_0x49a3e0=_0x49a3e0||0xc8;return function(_0xeb77c7){if(_0xeb77c7){return _0x1a7aaa[_0xbce2('0x1a')](_0x49a3e0)[_0xbce2('0x1c')](_0xeb77c7);}};}function respondWithFilteredResult(_0x2bc83f,_0x104867){return function(_0x1c9d22){if(_0x1c9d22){var _0x5e87d6=_0x1c9d22[_0xbce2('0x1d')],_0x5f0041=_0x104867['offset'],_0x135eee=_0x104867[_0xbce2('0x1e')]+_0x104867[_0xbce2('0x1f')],_0x28eba9;if(_0x135eee>=_0x5e87d6){_0x135eee=_0x5e87d6;_0x28eba9=0xc8;}else{_0x28eba9=0xce;}_0x2bc83f['status'](_0x28eba9);return _0x2bc83f[_0xbce2('0x20')](_0xbce2('0x21'),_0x5f0041+'-'+_0x135eee+'/'+_0x5e87d6)[_0xbce2('0x1c')](_0x1c9d22);}return null;};}function patchUpdates(_0x3887e1){return function(_0x441414){try{jsonpatch['apply'](_0x441414,_0x3887e1,!![]);}catch(_0x1cbb85){return BPromise[_0xbce2('0x22')](_0x1cbb85);}return _0x441414[_0xbce2('0x23')]();};}function saveUpdates(_0x3403ba,_0x3be589){return function(_0x3cd9f3){if(_0x3cd9f3){return _0x3cd9f3['update'](_0x3403ba)[_0xbce2('0x24')](function(_0x5abfeb){return _0x5abfeb;});}return null;};}function removeEntity(_0x51595a,_0x19253d){return function(_0xb68079){if(_0xb68079){return _0xb68079['destroy']()[_0xbce2('0x24')](function(){_0x51595a[_0xbce2('0x1a')](0xcc)[_0xbce2('0x1b')]();});}};}function handleEntityNotFound(_0x25f737,_0x1faffa){return function(_0x293fed){if(!_0x293fed){_0x25f737[_0xbce2('0x19')](0x194);}return _0x293fed;};}function handleError(_0x3a0266,_0x474764){_0x474764=_0x474764||0x1f4;return function(_0x36fe36){logger[_0xbce2('0x25')](_0x36fe36[_0xbce2('0x26')]);if(_0x36fe36[_0xbce2('0x27')]){delete _0x36fe36['name'];}_0x3a0266[_0xbce2('0x1a')](_0x474764)[_0xbce2('0x28')](_0x36fe36);};}exports[_0xbce2('0x29')]=function(_0x1d119f,_0x502a2d){var _0x2927d3={},_0x36c786={},_0x3cf433={'count':0x0,'rows':[]};var _0xb198c4=_[_0xbce2('0x2a')](db[_0xbce2('0x2b')]['rawAttributes'],function(_0x2e642c){return{'name':_0x2e642c[_0xbce2('0x2c')],'type':_0x2e642c[_0xbce2('0x2d')][_0xbce2('0x2e')]};});_0x36c786[_0xbce2('0x2f')]=_['map'](_0xb198c4,_0xbce2('0x27'));_0x36c786[_0xbce2('0x30')]=_[_0xbce2('0x31')](_0x1d119f['query']);_0x36c786[_0xbce2('0x32')]=_['intersection'](_0x36c786['model'],_0x36c786[_0xbce2('0x30')]);_0x2927d3['attributes']=_[_0xbce2('0x33')](_0x36c786[_0xbce2('0x2f')],qs[_0xbce2('0x34')](_0x1d119f['query'][_0xbce2('0x34')]));_0x2927d3[_0xbce2('0x35')]=_0x2927d3[_0xbce2('0x35')][_0xbce2('0x36')]?_0x2927d3['attributes']:_0x36c786['model'];if(!_0x1d119f[_0xbce2('0x30')][_0xbce2('0x37')](_0xbce2('0x38'))){_0x2927d3[_0xbce2('0x1f')]=qs[_0xbce2('0x1f')](_0x1d119f[_0xbce2('0x30')][_0xbce2('0x1f')]);_0x2927d3[_0xbce2('0x1e')]=qs[_0xbce2('0x1e')](_0x1d119f['query'][_0xbce2('0x1e')]);}_0x2927d3[_0xbce2('0x39')]=qs[_0xbce2('0x3a')](_0x1d119f[_0xbce2('0x30')][_0xbce2('0x3a')]);_0x2927d3[_0xbce2('0x3b')]=qs[_0xbce2('0x32')](_[_0xbce2('0x3c')](_0x1d119f['query'],_0x36c786[_0xbce2('0x32')]));if(_0x1d119f[_0xbce2('0x30')]['filter']){_0x2927d3['where']=_[_0xbce2('0x3d')](_0x2927d3[_0xbce2('0x3b')],{'$or':_[_0xbce2('0x2a')](_0xb198c4,function(_0x42c256){if(_0x42c256['type']!==_0xbce2('0x3e')){var _0x2e59dd={};_0x2e59dd[_0x42c256[_0xbce2('0x27')]]={'$like':'%'+_0x1d119f['query'][_0xbce2('0x3f')]+'%'};return _0x2e59dd;}})});}_0x2927d3=_['merge']({},_0x2927d3,_0x1d119f[_0xbce2('0x40')]);var _0x2db4ae={'where':_0x2927d3[_0xbce2('0x3b')]};return db['ZendeskField'][_0xbce2('0x1d')](_0x2db4ae)[_0xbce2('0x24')](function(_0x5af625){_0x3cf433[_0xbce2('0x1d')]=_0x5af625;if(_0x1d119f[_0xbce2('0x30')][_0xbce2('0x41')]){_0x2927d3[_0xbce2('0x42')]=[{'all':!![]}];}return db[_0xbce2('0x2b')]['findAll'](_0x2927d3);})[_0xbce2('0x24')](function(_0x3676c2){_0x3cf433[_0xbce2('0x43')]=_0x3676c2;return _0x3cf433;})[_0xbce2('0x24')](respondWithFilteredResult(_0x502a2d,_0x2927d3))['catch'](handleError(_0x502a2d,null));};exports[_0xbce2('0x44')]=function(_0x47c658,_0x218c9f){var _0x35851d={'raw':!![],'where':{'id':_0x47c658[_0xbce2('0x45')]['id']}},_0x4ab32c={};_0x4ab32c[_0xbce2('0x2f')]=_['keys'](db[_0xbce2('0x2b')][_0xbce2('0x46')]);_0x4ab32c['query']=_[_0xbce2('0x31')](_0x47c658['query']);_0x4ab32c[_0xbce2('0x32')]=_[_0xbce2('0x33')](_0x4ab32c[_0xbce2('0x2f')],_0x4ab32c[_0xbce2('0x30')]);_0x35851d[_0xbce2('0x35')]=_['intersection'](_0x4ab32c[_0xbce2('0x2f')],qs[_0xbce2('0x34')](_0x47c658[_0xbce2('0x30')][_0xbce2('0x34')]));_0x35851d[_0xbce2('0x35')]=_0x35851d[_0xbce2('0x35')][_0xbce2('0x36')]?_0x35851d['attributes']:_0x4ab32c[_0xbce2('0x2f')];if(_0x47c658['query'][_0xbce2('0x41')]){_0x35851d[_0xbce2('0x42')]=[{'all':!![]}];}_0x35851d=_[_0xbce2('0x3d')]({},_0x35851d,_0x47c658['options']);return db['ZendeskField'][_0xbce2('0x47')](_0x35851d)['then'](handleEntityNotFound(_0x218c9f,null))['then'](respondWithResult(_0x218c9f,null))[_0xbce2('0x48')](handleError(_0x218c9f,null));};exports[_0xbce2('0x49')]=function(_0x31418b,_0x59be4d){return db[_0xbce2('0x2b')]['create'](_0x31418b['body'],{})['then'](respondWithResult(_0x59be4d,0xc9))[_0xbce2('0x48')](handleError(_0x59be4d,null));};exports[_0xbce2('0x4a')]=function(_0x52e778,_0x4c29f4){if(_0x52e778[_0xbce2('0x4b')]['id']){delete _0x52e778['body']['id'];}return db['ZendeskField'][_0xbce2('0x47')]({'where':{'id':_0x52e778[_0xbce2('0x45')]['id']}})[_0xbce2('0x24')](handleEntityNotFound(_0x4c29f4,null))[_0xbce2('0x24')](saveUpdates(_0x52e778[_0xbce2('0x4b')],null))[_0xbce2('0x24')](respondWithResult(_0x4c29f4,null))['catch'](handleError(_0x4c29f4,null));};exports[_0xbce2('0x4c')]=function(_0x514d80,_0x1a5f04){return db[_0xbce2('0x2b')][_0xbce2('0x47')]({'where':{'id':_0x514d80[_0xbce2('0x45')]['id']}})[_0xbce2('0x24')](handleEntityNotFound(_0x1a5f04,null))[_0xbce2('0x24')](removeEntity(_0x1a5f04,null))['catch'](handleError(_0x1a5f04,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index cbf9599..0cd7f9f 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 _0x6cb4=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash'];(function(_0x5a137e,_0x4cdec2){var _0x57eb7c=function(_0x19b84b){while(--_0x19b84b){_0x5a137e['push'](_0x5a137e['shift']());}};_0x57eb7c(++_0x4cdec2);}(_0x6cb4,0xff));var _0x46cb=function(_0xeafd45,_0x59325c){_0xeafd45=_0xeafd45-0x0;var _0x3a8252=_0x6cb4[_0xeafd45];return _0x3a8252;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var logger=require(_0x46cb('0x2'))(_0x46cb('0x3'));var moment=require(_0x46cb('0x4'));var BPromise=require(_0x46cb('0x5'));var rp=require(_0x46cb('0x6'));var fs=require('fs');var path=require(_0x46cb('0x7'));var rimraf=require(_0x46cb('0x8'));var config=require('../../config/environment');var attributes=require(_0x46cb('0x9'));module['exports']=function(_0x3d9d3c,_0x4d9f1d){return _0x3d9d3c[_0x46cb('0xa')](_0x46cb('0xb'),attributes,{'tableName':_0x46cb('0xc'),'paranoid':![],'indexes':[{'name':_0x46cb('0xd'),'fields':[_0x46cb('0xe'),_0x46cb('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcc8d=['define','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports'];(function(_0x27ca72,_0x30d58f){var _0x165dd8=function(_0x22fb49){while(--_0x22fb49){_0x27ca72['push'](_0x27ca72['shift']());}};_0x165dd8(++_0x30d58f);}(_0xcc8d,0xbb));var _0xdcc8=function(_0x261d9e,_0x4f0942){_0x261d9e=_0x261d9e-0x0;var _0x3f8a2c=_0xcc8d[_0x261d9e];return _0x3f8a2c;};'use strict';var _=require('lodash');var util=require(_0xdcc8('0x0'));var logger=require(_0xdcc8('0x1'))('api');var moment=require('moment');var BPromise=require(_0xdcc8('0x2'));var rp=require(_0xdcc8('0x3'));var fs=require('fs');var path=require(_0xdcc8('0x4'));var rimraf=require(_0xdcc8('0x5'));var config=require(_0xdcc8('0x6'));var attributes=require(_0xdcc8('0x7'));module[_0xdcc8('0x8')]=function(_0x47b30e,_0x44e0b0){return _0x47b30e[_0xdcc8('0x9')](_0xdcc8('0xa'),attributes,{'tableName':_0xdcc8('0xb'),'paranoid':![],'indexes':[{'name':_0xdcc8('0xc'),'fields':['idField',_0xdcc8('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index bdb0e3a..73c3ead 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 _0xf007=['then','info','request\x20sent','error','code','ZendeskField,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x83de16,_0x434b55){var _0x420904=function(_0x3d27ca){while(--_0x3d27ca){_0x83de16['push'](_0x83de16['shift']());}};_0x420904(++_0x434b55);}(_0xf007,0xda));var _0x7f00=function(_0x4c06ac,_0x568788){_0x4c06ac=_0x4c06ac-0x0;var _0x2333cb=_0xf007[_0x4c06ac];return _0x2333cb;};'use strict';var _=require(_0x7f00('0x0'));var util=require(_0x7f00('0x1'));var moment=require('moment');var BPromise=require(_0x7f00('0x2'));var rs=require(_0x7f00('0x3'));var fs=require('fs');var Redis=require(_0x7f00('0x4'));var db=require(_0x7f00('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f00('0x6'))(_0x7f00('0x7'));var config=require(_0x7f00('0x8'));var jayson=require(_0x7f00('0x9'));var client=jayson[_0x7f00('0xa')][_0x7f00('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c4359,_0x39d4d4,_0x39ef4b){return new BPromise(function(_0x4a50a2,_0x11e7bc){return client[_0x7f00('0xc')](_0x5c4359,_0x39ef4b)[_0x7f00('0xd')](function(_0x49c3c3){logger[_0x7f00('0xe')]('ZendeskField,\x20%s,\x20%s',_0x39d4d4,_0x7f00('0xf'));logger['debug']('ZendeskField,\x20%s,\x20%s,\x20%s',_0x39d4d4,_0x7f00('0xf'),JSON['stringify'](_0x49c3c3));if(_0x49c3c3['error']){if(_0x49c3c3[_0x7f00('0x10')][_0x7f00('0x11')]===0x1f4){logger[_0x7f00('0x10')](_0x7f00('0x12'),_0x39d4d4,_0x49c3c3[_0x7f00('0x10')][_0x7f00('0x13')]);return _0x11e7bc(_0x49c3c3[_0x7f00('0x10')][_0x7f00('0x13')]);}logger[_0x7f00('0x10')](_0x7f00('0x12'),_0x39d4d4,_0x49c3c3['error']['message']);return _0x4a50a2(_0x49c3c3[_0x7f00('0x10')][_0x7f00('0x13')]);}else{logger[_0x7f00('0xe')](_0x7f00('0x12'),_0x39d4d4,'request\x20sent');_0x4a50a2(_0x49c3c3['result'][_0x7f00('0x13')]);}})[_0x7f00('0x14')](function(_0x54f243){logger['error']('ZendeskField,\x20%s,\x20%s',_0x39d4d4,_0x54f243);_0x11e7bc(_0x54f243);});});} \ No newline at end of file +var _0xbe0c=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x5b68e5,_0x504c98){var _0x6145ca=function(_0x2b782d){while(--_0x2b782d){_0x5b68e5['push'](_0x5b68e5['shift']());}};_0x6145ca(++_0x504c98);}(_0xbe0c,0x6e));var _0xcbe0=function(_0x27ddf5,_0x5a3e18){_0x27ddf5=_0x27ddf5-0x0;var _0x26e74a=_0xbe0c[_0x27ddf5];return _0x26e74a;};'use strict';var _=require('lodash');var util=require(_0xcbe0('0x0'));var moment=require(_0xcbe0('0x1'));var BPromise=require(_0xcbe0('0x2'));var rs=require(_0xcbe0('0x3'));var fs=require('fs');var Redis=require(_0xcbe0('0x4'));var db=require(_0xcbe0('0x5'))['db'];var utils=require(_0xcbe0('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xcbe0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcbe0('0x8')][_0xcbe0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e3fdd,_0x1ca4c2,_0x347cc5){return new BPromise(function(_0x2a0e35,_0x299ea5){return client[_0xcbe0('0xa')](_0x1e3fdd,_0x347cc5)[_0xcbe0('0xb')](function(_0x460967){logger[_0xcbe0('0xc')](_0xcbe0('0xd'),_0x1ca4c2,'request\x20sent');logger[_0xcbe0('0xe')](_0xcbe0('0xf'),_0x1ca4c2,_0xcbe0('0x10'),JSON[_0xcbe0('0x11')](_0x460967));if(_0x460967[_0xcbe0('0x12')]){if(_0x460967[_0xcbe0('0x12')][_0xcbe0('0x13')]===0x1f4){logger['error'](_0xcbe0('0xd'),_0x1ca4c2,_0x460967[_0xcbe0('0x12')][_0xcbe0('0x14')]);return _0x299ea5(_0x460967[_0xcbe0('0x12')][_0xcbe0('0x14')]);}logger[_0xcbe0('0x12')](_0xcbe0('0xd'),_0x1ca4c2,_0x460967[_0xcbe0('0x12')]['message']);return _0x2a0e35(_0x460967[_0xcbe0('0x12')][_0xcbe0('0x14')]);}else{logger[_0xcbe0('0xc')](_0xcbe0('0xd'),_0x1ca4c2,_0xcbe0('0x10'));_0x2a0e35(_0x460967[_0xcbe0('0x15')][_0xcbe0('0x14')]);}})['catch'](function(_0xa39a99){logger['error']('ZendeskField,\x20%s,\x20%s',_0x1ca4c2,_0xa39a99);_0x299ea5(_0xa39a99);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index f42f9ab..86e7a0c 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 _0x28b3=['express','Router','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','/:id','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x28b3,0x16d));var _0x328b=function(_0x473c9c,_0x4252bd){_0x473c9c=_0x473c9c-0x0;var _0x514008=_0x28b3[_0x473c9c];return _0x514008;};'use strict';var multer=require(_0x328b('0x0'));var util=require('util');var path=require(_0x328b('0x1'));var timeout=require(_0x328b('0x2'));var express=require(_0x328b('0x3'));var router=express[_0x328b('0x4')]();var auth=require(_0x328b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x328b('0x6'));var controller=require(_0x328b('0x7'));router[_0x328b('0x8')]('/',auth[_0x328b('0x9')](),controller[_0x328b('0xa')]);router[_0x328b('0x8')]('/:id',auth[_0x328b('0x9')](),controller['show']);router[_0x328b('0x8')]('/:id/configurations',auth[_0x328b('0x9')](),controller[_0x328b('0xb')]);router['get'](_0x328b('0xc'),auth[_0x328b('0x9')](),controller[_0x328b('0xd')]);router[_0x328b('0xe')]('/',auth['isAuthenticated'](),controller[_0x328b('0xf')]);router[_0x328b('0xe')](_0x328b('0x10'),auth[_0x328b('0x9')](),controller[_0x328b('0x11')]);router[_0x328b('0x12')](_0x328b('0x13'),auth[_0x328b('0x9')](),controller['update']);router[_0x328b('0x14')]('/:id',auth[_0x328b('0x9')](),controller[_0x328b('0x15')]);module[_0x328b('0x16')]=router; \ No newline at end of file +var _0x22d0=['isAuthenticated','/:id','show','getConfigurations','post','create','addConfiguration','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x327cbf,_0x114362){var _0x409cb8=function(_0x34f0a1){while(--_0x34f0a1){_0x327cbf['push'](_0x327cbf['shift']());}};_0x409cb8(++_0x114362);}(_0x22d0,0x19a));var _0x022d=function(_0x139b63,_0x389ca8){_0x139b63=_0x139b63-0x0;var _0x2493f2=_0x22d0[_0x139b63];return _0x2493f2;};'use strict';var multer=require(_0x022d('0x0'));var util=require('util');var path=require(_0x022d('0x1'));var timeout=require(_0x022d('0x2'));var express=require(_0x022d('0x3'));var router=express['Router']();var auth=require(_0x022d('0x4'));var interaction=require(_0x022d('0x5'));var config=require(_0x022d('0x6'));var controller=require('./intZohoAccount.controller');router[_0x022d('0x7')]('/',auth[_0x022d('0x8')](),controller['index']);router['get'](_0x022d('0x9'),auth[_0x022d('0x8')](),controller[_0x022d('0xa')]);router[_0x022d('0x7')]('/:id/configurations',auth[_0x022d('0x8')](),controller[_0x022d('0xb')]);router[_0x022d('0x7')]('/:id/fields',auth[_0x022d('0x8')](),controller['getFields']);router[_0x022d('0xc')]('/',auth[_0x022d('0x8')](),controller[_0x022d('0xd')]);router[_0x022d('0xc')]('/:id/configurations',auth[_0x022d('0x8')](),controller[_0x022d('0xe')]);router['put'](_0x022d('0x9'),auth[_0x022d('0x8')](),controller[_0x022d('0xf')]);router[_0x022d('0x10')](_0x022d('0x9'),auth['isAuthenticated'](),controller[_0x022d('0x11')]);module[_0x022d('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 9c6ab49..4881a4a 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 _0xffc6=['exports','STRING'];(function(_0x24a88e,_0x22a0b8){var _0x232cbb=function(_0x50b7a4){while(--_0x50b7a4){_0x24a88e['push'](_0x24a88e['shift']());}};_0x232cbb(++_0x22a0b8);}(_0xffc6,0x78));var _0x6ffc=function(_0x3ce796,_0x621939){_0x3ce796=_0x3ce796-0x0;var _0x354e12=_0xffc6[_0x3ce796];return _0x354e12;};'use strict';var Sequelize=require('sequelize');module[_0x6ffc('0x0')]={'name':{'type':Sequelize[_0x6ffc('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x6ffc('0x1')]},'zone':{'type':Sequelize[_0x6ffc('0x1')]},'clientId':{'type':Sequelize[_0x6ffc('0x1')]},'clientSecret':{'type':Sequelize[_0x6ffc('0x1')]},'serverUrl':{'type':Sequelize[_0x6ffc('0x1')]},'code':{'type':Sequelize[_0x6ffc('0x1')]},'refreshToken':{'type':Sequelize[_0x6ffc('0x1')]}}; \ No newline at end of file +var _0x5aad=['exports','STRING'];(function(_0x3e0d74,_0x1433d9){var _0x59c042=function(_0xc4afde){while(--_0xc4afde){_0x3e0d74['push'](_0x3e0d74['shift']());}};_0x59c042(++_0x1433d9);}(_0x5aad,0x78));var _0xd5aa=function(_0x5e42ca,_0x1c168a){_0x5e42ca=_0x5e42ca-0x0;var _0x28d72f=_0x5aad[_0x5e42ca];return _0x28d72f;};'use strict';var Sequelize=require('sequelize');module[_0xd5aa('0x0')]={'name':{'type':Sequelize[_0xd5aa('0x1')]},'description':{'type':Sequelize[_0xd5aa('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xd5aa('0x1')]},'clientId':{'type':Sequelize[_0xd5aa('0x1')]},'clientSecret':{'type':Sequelize[_0xd5aa('0x1')]},'serverUrl':{'type':Sequelize[_0xd5aa('0x1')]},'code':{'type':Sequelize[_0xd5aa('0x1')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 606a1b3..726f1da 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 _0x5f79=['includes','push','display_label','custom_field','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','offset','set','Content-Range','save','update','destroy','end','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','count','includeAll','include','show','keys','options','find','create','params','getConfigurations','findOne','ZohoConfiguration','pick','addConfiguration','body','AccountId','Subjects','channel','Descriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','Owner','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','Call_Type'];(function(_0x213c63,_0x420de6){var _0x300bfb=function(_0x5d0b2e){while(--_0x5d0b2e){_0x213c63['push'](_0x213c63['shift']());}};_0x300bfb(++_0x420de6);}(_0x5f79,0x92));var _0x95f7=function(_0x4706a6,_0x5a1c63){_0x4706a6=_0x4706a6-0x0;var _0x1bb705=_0x5f79[_0x4706a6];return _0x1bb705;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x95f7('0x0'));var rimraf=require(_0x95f7('0x1'));var zipdir=require(_0x95f7('0x2'));var jsonpatch=require(_0x95f7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x95f7('0x4'));var Mustache=require(_0x95f7('0x5'));var util=require(_0x95f7('0x6'));var path=require('path');var sox=require(_0x95f7('0x7'));var csv=require('to-csv');var ejs=require(_0x95f7('0x8'));var fs=require('fs');var _=require(_0x95f7('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x95f7('0xa'));var deskjs=require(_0x95f7('0xb'));var toCsv=require(_0x95f7('0xc'));var querystring=require(_0x95f7('0xd'));var Papa=require(_0x95f7('0xe'));var Redis=require(_0x95f7('0xf'));var authService=require(_0x95f7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x95f7('0x11'));var hardwareService=require(_0x95f7('0x12'));var logger=require(_0x95f7('0x13'))(_0x95f7('0x14'));var utils=require(_0x95f7('0x15'));var config=require(_0x95f7('0x16'));var db=require(_0x95f7('0x17'))['db'];var integrations=require(_0x95f7('0x18'));var jayson=require(_0x95f7('0x19'));var client=jayson[_0x95f7('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x54b8d1,_0x3d8d1e,_0x4d0de1){if(_0x4d0de1){var _0x14bb8b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x14bb8b[_0x95f7('0x1b')](_0x3d8d1e)){return _0x54b8d1;}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 _0x54b8d1;}}function respondWithRpcPromise(_0x22f374,_0x4bb8e5,_0x1ccbf7,_0x22e66d){return new BPromise(function(_0x4747af,_0x2675d6){var _0x50998e=_0x22e66d||client;return _0x50998e[_0x95f7('0x1c')](_0x22f374,_0x1ccbf7)[_0x95f7('0x1d')](function(_0x22049f){logger[_0x95f7('0x1e')](_0x95f7('0x1f'),_0x4bb8e5,_0x95f7('0x20'));logger['debug'](_0x95f7('0x21'),_0x4bb8e5,_0x95f7('0x20'),JSON[_0x95f7('0x22')](_0x22049f));if(_0x22049f[_0x95f7('0x23')]){if(_0x22049f['error']['code']===0x1f4){logger['error'](_0x95f7('0x1f'),_0x4bb8e5,_0x22049f[_0x95f7('0x23')][_0x95f7('0x24')]);return _0x2675d6(_0x22049f['error'][_0x95f7('0x24')]);}logger[_0x95f7('0x23')](_0x95f7('0x1f'),_0x4bb8e5,_0x22049f['error']['message']);return _0x4747af(_0x22049f[_0x95f7('0x23')]['message']);}else{logger[_0x95f7('0x1e')](_0x95f7('0x1f'),_0x4bb8e5,'request\x20sent');_0x4747af(_0x22049f['result'][_0x95f7('0x24')]);}})[_0x95f7('0x25')](function(_0x16d248){logger[_0x95f7('0x23')](_0x95f7('0x1f'),_0x4bb8e5,_0x16d248);_0x2675d6(_0x16d248);});});}function respondWithStatusCode(_0xf554f4,_0xd58dc4){_0xd58dc4=_0xd58dc4||0xcc;return function(_0x4f78e6){if(_0x4f78e6){return _0xf554f4[_0x95f7('0x26')](_0xd58dc4);}return _0xf554f4[_0x95f7('0x27')](_0xd58dc4)['end']();};}function respondWithResult(_0x239e4a,_0x1ae3a8){_0x1ae3a8=_0x1ae3a8||0xc8;return function(_0x1a432e){if(_0x1a432e){return _0x239e4a[_0x95f7('0x27')](_0x1ae3a8)[_0x95f7('0x28')](_0x1a432e);}};}function respondWithFilteredResult(_0x3a5730,_0x1aaf12){return function(_0x397a39){if(_0x397a39){var _0x38aa10=_0x397a39['count'],_0xeedf86=_0x1aaf12[_0x95f7('0x29')],_0x414132=_0x1aaf12[_0x95f7('0x29')]+_0x1aaf12['limit'],_0x27e35c;if(_0x414132>=_0x38aa10){_0x414132=_0x38aa10;_0x27e35c=0xc8;}else{_0x27e35c=0xce;}_0x3a5730[_0x95f7('0x27')](_0x27e35c);return _0x3a5730[_0x95f7('0x2a')](_0x95f7('0x2b'),_0xeedf86+'-'+_0x414132+'/'+_0x38aa10)[_0x95f7('0x28')](_0x397a39);}return null;};}function patchUpdates(_0x375bfd){return function(_0x304a20){try{jsonpatch['apply'](_0x304a20,_0x375bfd,!![]);}catch(_0x2ff663){return BPromise['reject'](_0x2ff663);}return _0x304a20[_0x95f7('0x2c')]();};}function saveUpdates(_0x2e9371,_0x2bba8d){return function(_0x170c1d){if(_0x170c1d){return _0x170c1d[_0x95f7('0x2d')](_0x2e9371)[_0x95f7('0x1d')](function(_0x221c40){return _0x221c40;});}return null;};}function removeEntity(_0x5049a8,_0x48392d){return function(_0x573c52){if(_0x573c52){return _0x573c52[_0x95f7('0x2e')]()[_0x95f7('0x1d')](function(){_0x5049a8[_0x95f7('0x27')](0xcc)[_0x95f7('0x2f')]();});}};}function handleEntityNotFound(_0x4daf44,_0x34e90c){return function(_0x320600){if(!_0x320600){_0x4daf44[_0x95f7('0x26')](0x194);}return _0x320600;};}function handleError(_0x78f362,_0x4e8894){_0x4e8894=_0x4e8894||0x1f4;return function(_0x907360){logger[_0x95f7('0x23')](_0x907360['stack']);if(_0x907360[_0x95f7('0x30')]){delete _0x907360[_0x95f7('0x30')];}_0x78f362[_0x95f7('0x27')](_0x4e8894)[_0x95f7('0x31')](_0x907360);};}exports[_0x95f7('0x32')]=function(_0xbfca4b,_0x3062b2){var _0x461d40={},_0x4595a1={},_0x3b331f={'count':0x0,'rows':[]};var _0x3493dc=_[_0x95f7('0x33')](db[_0x95f7('0x34')][_0x95f7('0x35')],function(_0x42b445){return{'name':_0x42b445[_0x95f7('0x36')],'type':_0x42b445[_0x95f7('0x37')][_0x95f7('0x38')]};});_0x4595a1[_0x95f7('0x39')]=_[_0x95f7('0x33')](_0x3493dc,_0x95f7('0x30'));_0x4595a1[_0x95f7('0x3a')]=_['keys'](_0xbfca4b[_0x95f7('0x3a')]);_0x4595a1[_0x95f7('0x3b')]=_[_0x95f7('0x3c')](_0x4595a1['model'],_0x4595a1[_0x95f7('0x3a')]);_0x461d40[_0x95f7('0x3d')]=_[_0x95f7('0x3c')](_0x4595a1[_0x95f7('0x39')],qs[_0x95f7('0x3e')](_0xbfca4b[_0x95f7('0x3a')][_0x95f7('0x3e')]));_0x461d40[_0x95f7('0x3d')]=_0x461d40['attributes'][_0x95f7('0x3f')]?_0x461d40[_0x95f7('0x3d')]:_0x4595a1['model'];if(!_0xbfca4b[_0x95f7('0x3a')][_0x95f7('0x40')](_0x95f7('0x41'))){_0x461d40[_0x95f7('0x42')]=qs[_0x95f7('0x42')](_0xbfca4b[_0x95f7('0x3a')][_0x95f7('0x42')]);_0x461d40[_0x95f7('0x29')]=qs['offset'](_0xbfca4b[_0x95f7('0x3a')][_0x95f7('0x29')]);}_0x461d40[_0x95f7('0x43')]=qs[_0x95f7('0x44')](_0xbfca4b[_0x95f7('0x3a')]['sort']);_0x461d40[_0x95f7('0x45')]=qs[_0x95f7('0x3b')](_['pick'](_0xbfca4b[_0x95f7('0x3a')],_0x4595a1[_0x95f7('0x3b')]));if(_0xbfca4b[_0x95f7('0x3a')][_0x95f7('0x46')]){_0x461d40[_0x95f7('0x45')]=_[_0x95f7('0x47')](_0x461d40[_0x95f7('0x45')],{'$or':_[_0x95f7('0x33')](_0x3493dc,function(_0x2c05f2){if(_0x2c05f2[_0x95f7('0x37')]!==_0x95f7('0x48')){var _0x4f74e6={};_0x4f74e6[_0x2c05f2[_0x95f7('0x30')]]={'$like':'%'+_0xbfca4b[_0x95f7('0x3a')][_0x95f7('0x46')]+'%'};return _0x4f74e6;}})});}_0x461d40=_[_0x95f7('0x47')]({},_0x461d40,_0xbfca4b['options']);var _0x11c2ae={'where':_0x461d40[_0x95f7('0x45')]};return db['ZohoAccount'][_0x95f7('0x49')](_0x11c2ae)[_0x95f7('0x1d')](function(_0x363d62){_0x3b331f['count']=_0x363d62;if(_0xbfca4b[_0x95f7('0x3a')][_0x95f7('0x4a')]){_0x461d40[_0x95f7('0x4b')]=[{'all':!![]}];}return db[_0x95f7('0x34')]['findAll'](_0x461d40);})[_0x95f7('0x1d')](function(_0x8267){_0x3b331f['rows']=_0x8267;return _0x3b331f;})[_0x95f7('0x1d')](respondWithFilteredResult(_0x3062b2,_0x461d40))[_0x95f7('0x25')](handleError(_0x3062b2,null));};exports[_0x95f7('0x4c')]=function(_0xac227c,_0x2627bb){var _0x225157={'raw':![],'where':{'id':_0xac227c['params']['id']}},_0x33ad14={};_0x33ad14[_0x95f7('0x39')]=_[_0x95f7('0x4d')](db[_0x95f7('0x34')]['rawAttributes']);_0x33ad14[_0x95f7('0x3a')]=_[_0x95f7('0x4d')](_0xac227c['query']);_0x33ad14[_0x95f7('0x3b')]=_[_0x95f7('0x3c')](_0x33ad14[_0x95f7('0x39')],_0x33ad14[_0x95f7('0x3a')]);_0x225157[_0x95f7('0x3d')]=_['intersection'](_0x33ad14[_0x95f7('0x39')],qs[_0x95f7('0x3e')](_0xac227c[_0x95f7('0x3a')][_0x95f7('0x3e')]));_0x225157[_0x95f7('0x3d')]=_0x225157[_0x95f7('0x3d')]['length']?_0x225157[_0x95f7('0x3d')]:_0x33ad14[_0x95f7('0x39')];if(_0xac227c[_0x95f7('0x3a')][_0x95f7('0x4a')]){_0x225157['include']=[{'all':!![]}];}_0x225157=_[_0x95f7('0x47')]({},_0x225157,_0xac227c[_0x95f7('0x4e')]);return db['ZohoAccount'][_0x95f7('0x4f')](_0x225157)[_0x95f7('0x1d')](handleEntityNotFound(_0x2627bb,null))[_0x95f7('0x1d')](respondWithResult(_0x2627bb,null))[_0x95f7('0x25')](handleError(_0x2627bb,null));};exports[_0x95f7('0x50')]=function(_0x4ea286,_0x463be6){return db[_0x95f7('0x34')][_0x95f7('0x50')](_0x4ea286['body'],{})[_0x95f7('0x1d')](respondWithResult(_0x463be6,0xc9))[_0x95f7('0x25')](handleError(_0x463be6,null));};exports['update']=function(_0x14b30d,_0x39b04e){if(_0x14b30d['body']['id']){delete _0x14b30d['body']['id'];}return db[_0x95f7('0x34')][_0x95f7('0x4f')]({'where':{'id':_0x14b30d['params']['id']}})[_0x95f7('0x1d')](handleEntityNotFound(_0x39b04e,null))['then'](saveUpdates(_0x14b30d['body'],null))[_0x95f7('0x1d')](respondWithResult(_0x39b04e,null))['catch'](handleError(_0x39b04e,null));};exports[_0x95f7('0x2e')]=function(_0x5592c8,_0x3760e6){return db['ZohoAccount'][_0x95f7('0x4f')]({'where':{'id':_0x5592c8[_0x95f7('0x51')]['id']}})['then'](handleEntityNotFound(_0x3760e6,null))[_0x95f7('0x1d')](removeEntity(_0x3760e6,null))[_0x95f7('0x25')](handleError(_0x3760e6,null));};exports[_0x95f7('0x52')]=function(_0x33b6fe,_0x80b814,_0x14314a){var _0x1e1290={};var _0xd37af0={};var _0x36cb94;var _0x26b067;return db[_0x95f7('0x34')][_0x95f7('0x53')]({'where':{'id':_0x33b6fe[_0x95f7('0x51')]['id']}})[_0x95f7('0x1d')](handleEntityNotFound(_0x80b814,null))['then'](function(_0x3472e0){if(_0x3472e0){_0x36cb94=_0x3472e0;_0xd37af0[_0x95f7('0x39')]=_['keys'](db[_0x95f7('0x54')][_0x95f7('0x35')]);_0xd37af0[_0x95f7('0x3a')]=_[_0x95f7('0x4d')](_0x33b6fe['query']);_0xd37af0[_0x95f7('0x3b')]=_[_0x95f7('0x3c')](_0xd37af0[_0x95f7('0x39')],_0xd37af0[_0x95f7('0x3a')]);_0x1e1290[_0x95f7('0x3d')]=_[_0x95f7('0x3c')](_0xd37af0[_0x95f7('0x39')],qs[_0x95f7('0x3e')](_0x33b6fe[_0x95f7('0x3a')][_0x95f7('0x3e')]));_0x1e1290[_0x95f7('0x3d')]=_0x1e1290[_0x95f7('0x3d')][_0x95f7('0x3f')]?_0x1e1290[_0x95f7('0x3d')]:_0xd37af0[_0x95f7('0x39')];_0x1e1290['order']=qs[_0x95f7('0x44')](_0x33b6fe['query'][_0x95f7('0x44')]);_0x1e1290['where']=qs[_0x95f7('0x3b')](_[_0x95f7('0x55')](_0x33b6fe[_0x95f7('0x3a')],_0xd37af0[_0x95f7('0x3b')]));if(_0x33b6fe['query'][_0x95f7('0x46')]){_0x1e1290[_0x95f7('0x45')]=_[_0x95f7('0x47')](_0x1e1290[_0x95f7('0x45')],{'$or':_[_0x95f7('0x33')](_0x1e1290[_0x95f7('0x3d')],function(_0x31752d){var _0x3d7ba9={};_0x3d7ba9[_0x31752d]={'$like':'%'+_0x33b6fe['query']['filter']+'%'};return _0x3d7ba9;})});}_0x1e1290=_['merge']({},_0x1e1290,_0x33b6fe['options']);return _0x36cb94[_0x95f7('0x52')](_0x1e1290);}})[_0x95f7('0x1d')](function(_0x12c134){if(_0x12c134){_0x26b067=_0x12c134[_0x95f7('0x3f')];if(!_0x33b6fe['query']['hasOwnProperty']('nolimit')){_0x1e1290[_0x95f7('0x42')]=qs[_0x95f7('0x42')](_0x33b6fe[_0x95f7('0x3a')][_0x95f7('0x42')]);_0x1e1290[_0x95f7('0x29')]=qs['offset'](_0x33b6fe[_0x95f7('0x3a')][_0x95f7('0x29')]);}return _0x36cb94[_0x95f7('0x52')](_0x1e1290);}})['then'](function(_0x2a15e6){if(_0x2a15e6){return _0x2a15e6?{'count':_0x26b067,'rows':_0x2a15e6}:null;}})[_0x95f7('0x1d')](respondWithResult(_0x80b814,null))[_0x95f7('0x25')](handleError(_0x80b814,null));};exports[_0x95f7('0x56')]=function(_0x2aff63,_0x59cc55,_0x153821){if(_0x2aff63[_0x95f7('0x57')]['id']){delete _0x2aff63[_0x95f7('0x57')]['id'];}return db[_0x95f7('0x34')][_0x95f7('0x53')]({'where':{'id':_0x2aff63[_0x95f7('0x51')]['id']}})[_0x95f7('0x1d')](handleEntityNotFound(_0x59cc55,null))[_0x95f7('0x1d')](function(_0x355254){if(_0x355254){_0x2aff63[_0x95f7('0x57')][_0x95f7('0x58')]=_0x355254['id'];_0x2aff63[_0x95f7('0x57')][_0x95f7('0x59')]=integrations['getSubjects'](_0x2aff63['body'][_0x95f7('0x5a')],_0x2aff63[_0x95f7('0x57')]['type']);_0x2aff63[_0x95f7('0x57')][_0x95f7('0x5b')]=integrations['getDescriptions'](_0x2aff63['body'][_0x95f7('0x5a')],_0x2aff63['body'][_0x95f7('0x37')]);return db[_0x95f7('0x54')][_0x95f7('0x50')](_0x2aff63[_0x95f7('0x57')],{'include':[{'model':db[_0x95f7('0x5c')],'as':_0x95f7('0x59')},{'model':db[_0x95f7('0x5c')],'as':_0x95f7('0x5b')}]});}return null;})[_0x95f7('0x1d')](respondWithResult(_0x59cc55,null))[_0x95f7('0x25')](handleError(_0x59cc55,null));};function getAccessToken(_0x1db41f){return new Promise(function(_0x4b955b,_0x44305a){var _0x1da344;switch(_0x1db41f[_0x95f7('0x5d')]){case'US':_0x1da344=_0x95f7('0x5e');break;case'AU':_0x1da344=_0x95f7('0x5f');break;case'EU':_0x1da344=_0x95f7('0x60');break;case'IN':_0x1da344=_0x95f7('0x61');break;case'CN':_0x1da344='https://accounts.zoho.com.cn';break;default:_0x1da344=_0x95f7('0x60');break;}var _0x3776a1={'method':_0x95f7('0x62'),'uri':_0x1da344+_0x95f7('0x63'),'qs':{'refresh_token':_0x1db41f[_0x95f7('0x64')],'client_id':_0x1db41f[_0x95f7('0x65')],'client_secret':_0x1db41f[_0x95f7('0x66')],'grant_type':_0x95f7('0x67')},'json':!![]};return rp(_0x3776a1)[_0x95f7('0x1d')](function(_0x241d20){if(_0x241d20['access_token']){_0x4b955b(_0x241d20[_0x95f7('0x68')]);}else{_0x44305a(_0x95f7('0x69'));}})[_0x95f7('0x25')](function(_0x29a77e){_0x44305a(_0x29a77e);});});}exports[_0x95f7('0x6a')]=function(_0x43ddc2,_0x61f920,_0x183ac0){var _0x4fc0dd,_0x169388,_0x8a2fa9,_0x310eeb,_0x741111;return db[_0x95f7('0x34')][_0x95f7('0x53')]({'where':{'id':_0x43ddc2['params']['id']},'attributes':['id',_0x95f7('0x6b'),_0x95f7('0x5d'),_0x95f7('0x65'),_0x95f7('0x66'),_0x95f7('0x6c'),'code',_0x95f7('0x64')]})['then'](handleEntityNotFound(_0x61f920,null))[_0x95f7('0x1d')](function(_0x39a3f8){_0x741111=_0x39a3f8;_0x4fc0dd=_0x741111['host'];_0x169388=_0x4fc0dd==='zoho.eu'?'eu':_0x95f7('0x6d');_0x8a2fa9=_0x741111['serverUrl'];var _0x3a2c12=_0x8a2fa9[_0x95f7('0x6e')](-0x1);if(_0x3a2c12==='/'||_0x3a2c12==='\x5c'||_0x3a2c12===':'){_0x8a2fa9=_0x8a2fa9[_0x95f7('0x6f')](0x0,_0x8a2fa9[_0x95f7('0x70')](_0x3a2c12));}if(!_0x741111[_0x95f7('0x64')]){throw new Error(_0x95f7('0x71'));}return getAccessToken(_0x741111);})[_0x95f7('0x1d')](function(_0x58a96c){if(_0x58a96c){return rp({'method':_0x95f7('0x72'),'uri':util[_0x95f7('0x73')](_0x95f7('0x74'),_0x169388),'qs':{'module':'Calls'},'headers':{'Authorization':_0x95f7('0x75')+_0x58a96c},'json':!![]});}})[_0x95f7('0x1d')](function(_0x473ed1){if(_0x473ed1){if(_0x473ed1['response']&&_0x473ed1[_0x95f7('0x76')][_0x95f7('0x23')]){throw new Error(_0x473ed1[_0x95f7('0x76')][_0x95f7('0x23')][_0x95f7('0x24')]);}var _0x6cb280=[];var _0x1cc382=[];var _0x5bf429=[_0x95f7('0x77'),_0x95f7('0x78'),_0x95f7('0x79'),'WhoId',_0x95f7('0x7a'),_0x95f7('0x7b'),_0x95f7('0x7c'),_0x95f7('0x7d')];_0x1cc382=_['remove'](_0x473ed1[_0x95f7('0x3e')],function(_0x1873f7){return _0x5bf429[_0x95f7('0x7e')](_0x1873f7['api_name']);});for(var _0x5a9b28=0x0;_0x5a9b28<_0x1cc382[_0x95f7('0x3f')];_0x5a9b28++){if(_0x1cc382[_0x5a9b28]['system_mandatory']===![]){_0x6cb280[_0x95f7('0x7f')]({'id':_0x1cc382[_0x5a9b28]['id'],'name':_0x1cc382[_0x5a9b28][_0x95f7('0x80')],'custom':_0x1cc382[_0x5a9b28][_0x95f7('0x81')],'options':_0x1cc382[_0x5a9b28][_0x95f7('0x82')]===_0x95f7('0x83')&&_0x1cc382[_0x5a9b28][_0x95f7('0x84')][_0x95f7('0x3f')]>-0x1?_[_0x95f7('0x33')](_0x1cc382[_0x5a9b28][_0x95f7('0x84')],function(_0x2a10f8){return{'name':_0x2a10f8,'value':_0x2a10f8};}):[]});}}return{'count':_0x6cb280[_0x95f7('0x3f')],'rows':_0x6cb280};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x61f920,null))[_0x95f7('0x25')](function(_0x369729){var _0x105746=_0x43ddc2[_0x95f7('0x3a')][_0x95f7('0x1b')]?0x1f4:_0x369729[_0x95f7('0x85')]||0x1f4;logger[_0x95f7('0x23')](_0x95f7('0x86'),'getFields',_0x105746,JSON['stringify'](_0x369729));delete _0x369729['name'];if(_0x105746===0x191){_0x105746=0x190;}_0x61f920[_0x95f7('0x27')](_0x105746)[_0x95f7('0x31')](_0x43ddc2[_0x95f7('0x3a')]['test']?{'message':_0x95f7('0x87'),'statusCode':_0x369729[_0x95f7('0x85')]}:_0x369729);});}; \ No newline at end of file +var _0xf849=['crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','Sequelize','ValidationError','request','then','info','ZohoAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','end','status','count','offset','set','json','apply','reject','save','update','destroy','sendStatus','name','index','map','ZohoAccount','type','key','model','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','where','merge','VIRTUAL','filter','options','include','rows','catch','show','params','rawAttributes','includeAll','find','create','body','getConfigurations','ZohoConfiguration','pick','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','serverUrl','zoho.eu','com','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','custom_field','data_type','pick_list_values','test','send','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','path','ejs'];(function(_0x32dce6,_0x23f570){var _0x1191ba=function(_0x58efa8){while(--_0x58efa8){_0x32dce6['push'](_0x32dce6['shift']());}};_0x1191ba(++_0x23f570);}(_0xf849,0x193));var _0x9f84=function(_0x2ce6c4,_0x1493e0){_0x2ce6c4=_0x2ce6c4-0x0;var _0x3fa5ef=_0xf849[_0x2ce6c4];return _0x3fa5ef;};'use strict';var pdf=require(_0x9f84('0x0'));var emlformat=require(_0x9f84('0x1'));var rimraf=require(_0x9f84('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9f84('0x3'));var rp=require(_0x9f84('0x4'));var moment=require(_0x9f84('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x9f84('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9f84('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9f84('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x9f84('0x9'));var toCsv=require(_0x9f84('0xa'));var querystring=require(_0x9f84('0xb'));var Papa=require(_0x9f84('0xc'));var Redis=require(_0x9f84('0xd'));var authService=require(_0x9f84('0xe'));var qs=require(_0x9f84('0xf'));var as=require(_0x9f84('0x10'));var hardwareService=require(_0x9f84('0x11'));var logger=require(_0x9f84('0x12'))(_0x9f84('0x13'));var utils=require(_0x9f84('0x14'));var config=require(_0x9f84('0x15'));var db=require(_0x9f84('0x16'))['db'];var integrations=require(_0x9f84('0x17'));var jayson=require(_0x9f84('0x18'));var client=jayson['client'][_0x9f84('0x19')]({'port':0x232a});function checkPasswordPattern(_0x3fc0c7,_0x27e479,_0x38469f){if(_0x38469f){var _0x1b3eeb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1b3eeb['test'](_0x27e479)){return _0x3fc0c7;}else{throw new db[(_0x9f84('0x1a'))][(_0x9f84('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 _0x3fc0c7;}}function respondWithRpcPromise(_0x57c74c,_0xc359b5,_0x2c4e98,_0x3c543d){return new BPromise(function(_0x2b67d4,_0x331d8c){var _0x5b8cb6=_0x3c543d||client;return _0x5b8cb6[_0x9f84('0x1c')](_0x57c74c,_0x2c4e98)[_0x9f84('0x1d')](function(_0x557eaa){logger[_0x9f84('0x1e')](_0x9f84('0x1f'),_0xc359b5,'request\x20sent');logger[_0x9f84('0x20')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0xc359b5,'request\x20sent',JSON[_0x9f84('0x21')](_0x557eaa));if(_0x557eaa[_0x9f84('0x22')]){if(_0x557eaa[_0x9f84('0x22')][_0x9f84('0x23')]===0x1f4){logger[_0x9f84('0x22')]('ZohoAccount,\x20%s,\x20%s',_0xc359b5,_0x557eaa[_0x9f84('0x22')]['message']);return _0x331d8c(_0x557eaa[_0x9f84('0x22')][_0x9f84('0x24')]);}logger[_0x9f84('0x22')](_0x9f84('0x1f'),_0xc359b5,_0x557eaa[_0x9f84('0x22')]['message']);return _0x2b67d4(_0x557eaa[_0x9f84('0x22')]['message']);}else{logger[_0x9f84('0x1e')](_0x9f84('0x1f'),_0xc359b5,_0x9f84('0x25'));_0x2b67d4(_0x557eaa['result'][_0x9f84('0x24')]);}})['catch'](function(_0x430c66){logger[_0x9f84('0x22')](_0x9f84('0x1f'),_0xc359b5,_0x430c66);_0x331d8c(_0x430c66);});});}function respondWithStatusCode(_0x370ad9,_0x31baea){_0x31baea=_0x31baea||0xcc;return function(_0x4a908c){if(_0x4a908c){return _0x370ad9['sendStatus'](_0x31baea);}return _0x370ad9['status'](_0x31baea)[_0x9f84('0x26')]();};}function respondWithResult(_0x169525,_0x19216f){_0x19216f=_0x19216f||0xc8;return function(_0x1c9ba3){if(_0x1c9ba3){return _0x169525[_0x9f84('0x27')](_0x19216f)['json'](_0x1c9ba3);}};}function respondWithFilteredResult(_0x2bdd0f,_0x17dd4a){return function(_0x131d7d){if(_0x131d7d){var _0x155cb5=_0x131d7d[_0x9f84('0x28')],_0x576e1d=_0x17dd4a[_0x9f84('0x29')],_0x529e0b=_0x17dd4a['offset']+_0x17dd4a['limit'],_0xd2c673;if(_0x529e0b>=_0x155cb5){_0x529e0b=_0x155cb5;_0xd2c673=0xc8;}else{_0xd2c673=0xce;}_0x2bdd0f['status'](_0xd2c673);return _0x2bdd0f[_0x9f84('0x2a')]('Content-Range',_0x576e1d+'-'+_0x529e0b+'/'+_0x155cb5)[_0x9f84('0x2b')](_0x131d7d);}return null;};}function patchUpdates(_0x30426f){return function(_0x1ecc89){try{jsonpatch[_0x9f84('0x2c')](_0x1ecc89,_0x30426f,!![]);}catch(_0x17623d){return BPromise[_0x9f84('0x2d')](_0x17623d);}return _0x1ecc89[_0x9f84('0x2e')]();};}function saveUpdates(_0x5b96d5,_0x4ce796){return function(_0x449547){if(_0x449547){return _0x449547[_0x9f84('0x2f')](_0x5b96d5)[_0x9f84('0x1d')](function(_0x490f19){return _0x490f19;});}return null;};}function removeEntity(_0x5d8645,_0x15233c){return function(_0x382857){if(_0x382857){return _0x382857[_0x9f84('0x30')]()['then'](function(){_0x5d8645[_0x9f84('0x27')](0xcc)[_0x9f84('0x26')]();});}};}function handleEntityNotFound(_0x18756b,_0x29e026){return function(_0x42c709){if(!_0x42c709){_0x18756b[_0x9f84('0x31')](0x194);}return _0x42c709;};}function handleError(_0x24981c,_0x56a495){_0x56a495=_0x56a495||0x1f4;return function(_0xfee38e){logger[_0x9f84('0x22')](_0xfee38e['stack']);if(_0xfee38e[_0x9f84('0x32')]){delete _0xfee38e[_0x9f84('0x32')];}_0x24981c['status'](_0x56a495)['send'](_0xfee38e);};}exports[_0x9f84('0x33')]=function(_0x45aad0,_0x34416e){var _0x2d24ab={},_0x3def84={},_0x5735cc={'count':0x0,'rows':[]};var _0x552efb=_[_0x9f84('0x34')](db[_0x9f84('0x35')]['rawAttributes'],function(_0x96a87c){return{'name':_0x96a87c['fieldName'],'type':_0x96a87c[_0x9f84('0x36')][_0x9f84('0x37')]};});_0x3def84[_0x9f84('0x38')]=_[_0x9f84('0x34')](_0x552efb,_0x9f84('0x32'));_0x3def84[_0x9f84('0x39')]=_[_0x9f84('0x3a')](_0x45aad0[_0x9f84('0x39')]);_0x3def84[_0x9f84('0x3b')]=_[_0x9f84('0x3c')](_0x3def84[_0x9f84('0x38')],_0x3def84[_0x9f84('0x39')]);_0x2d24ab[_0x9f84('0x3d')]=_[_0x9f84('0x3c')](_0x3def84[_0x9f84('0x38')],qs['fields'](_0x45aad0[_0x9f84('0x39')][_0x9f84('0x3e')]));_0x2d24ab[_0x9f84('0x3d')]=_0x2d24ab[_0x9f84('0x3d')][_0x9f84('0x3f')]?_0x2d24ab[_0x9f84('0x3d')]:_0x3def84[_0x9f84('0x38')];if(!_0x45aad0[_0x9f84('0x39')]['hasOwnProperty']('nolimit')){_0x2d24ab['limit']=qs[_0x9f84('0x40')](_0x45aad0[_0x9f84('0x39')][_0x9f84('0x40')]);_0x2d24ab[_0x9f84('0x29')]=qs[_0x9f84('0x29')](_0x45aad0[_0x9f84('0x39')]['offset']);}_0x2d24ab[_0x9f84('0x41')]=qs[_0x9f84('0x42')](_0x45aad0[_0x9f84('0x39')][_0x9f84('0x42')]);_0x2d24ab[_0x9f84('0x43')]=qs['filters'](_['pick'](_0x45aad0['query'],_0x3def84[_0x9f84('0x3b')]));if(_0x45aad0['query']['filter']){_0x2d24ab[_0x9f84('0x43')]=_[_0x9f84('0x44')](_0x2d24ab[_0x9f84('0x43')],{'$or':_[_0x9f84('0x34')](_0x552efb,function(_0x409dd2){if(_0x409dd2[_0x9f84('0x36')]!==_0x9f84('0x45')){var _0x22d2dc={};_0x22d2dc[_0x409dd2[_0x9f84('0x32')]]={'$like':'%'+_0x45aad0[_0x9f84('0x39')][_0x9f84('0x46')]+'%'};return _0x22d2dc;}})});}_0x2d24ab=_[_0x9f84('0x44')]({},_0x2d24ab,_0x45aad0[_0x9f84('0x47')]);var _0x1555e2={'where':_0x2d24ab['where']};return db[_0x9f84('0x35')][_0x9f84('0x28')](_0x1555e2)[_0x9f84('0x1d')](function(_0x12e2cb){_0x5735cc[_0x9f84('0x28')]=_0x12e2cb;if(_0x45aad0[_0x9f84('0x39')]['includeAll']){_0x2d24ab[_0x9f84('0x48')]=[{'all':!![]}];}return db[_0x9f84('0x35')]['findAll'](_0x2d24ab);})[_0x9f84('0x1d')](function(_0x2c6500){_0x5735cc[_0x9f84('0x49')]=_0x2c6500;return _0x5735cc;})[_0x9f84('0x1d')](respondWithFilteredResult(_0x34416e,_0x2d24ab))[_0x9f84('0x4a')](handleError(_0x34416e,null));};exports[_0x9f84('0x4b')]=function(_0x3dd8b2,_0x4fbe64){var _0x4ddc04={'raw':![],'where':{'id':_0x3dd8b2[_0x9f84('0x4c')]['id']}},_0x3b81c5={};_0x3b81c5[_0x9f84('0x38')]=_[_0x9f84('0x3a')](db[_0x9f84('0x35')][_0x9f84('0x4d')]);_0x3b81c5[_0x9f84('0x39')]=_[_0x9f84('0x3a')](_0x3dd8b2['query']);_0x3b81c5[_0x9f84('0x3b')]=_[_0x9f84('0x3c')](_0x3b81c5[_0x9f84('0x38')],_0x3b81c5['query']);_0x4ddc04['attributes']=_[_0x9f84('0x3c')](_0x3b81c5[_0x9f84('0x38')],qs['fields'](_0x3dd8b2['query'][_0x9f84('0x3e')]));_0x4ddc04[_0x9f84('0x3d')]=_0x4ddc04[_0x9f84('0x3d')][_0x9f84('0x3f')]?_0x4ddc04[_0x9f84('0x3d')]:_0x3b81c5['model'];if(_0x3dd8b2['query'][_0x9f84('0x4e')]){_0x4ddc04[_0x9f84('0x48')]=[{'all':!![]}];}_0x4ddc04=_['merge']({},_0x4ddc04,_0x3dd8b2['options']);return db[_0x9f84('0x35')][_0x9f84('0x4f')](_0x4ddc04)[_0x9f84('0x1d')](handleEntityNotFound(_0x4fbe64,null))[_0x9f84('0x1d')](respondWithResult(_0x4fbe64,null))[_0x9f84('0x4a')](handleError(_0x4fbe64,null));};exports[_0x9f84('0x50')]=function(_0x4133cf,_0x581505){return db[_0x9f84('0x35')][_0x9f84('0x50')](_0x4133cf[_0x9f84('0x51')],{})['then'](respondWithResult(_0x581505,0xc9))['catch'](handleError(_0x581505,null));};exports['update']=function(_0x4bbeaa,_0x570dde){if(_0x4bbeaa['body']['id']){delete _0x4bbeaa['body']['id'];}return db[_0x9f84('0x35')][_0x9f84('0x4f')]({'where':{'id':_0x4bbeaa[_0x9f84('0x4c')]['id']}})[_0x9f84('0x1d')](handleEntityNotFound(_0x570dde,null))['then'](saveUpdates(_0x4bbeaa['body'],null))[_0x9f84('0x1d')](respondWithResult(_0x570dde,null))[_0x9f84('0x4a')](handleError(_0x570dde,null));};exports['destroy']=function(_0x3b8740,_0x57e281){return db[_0x9f84('0x35')][_0x9f84('0x4f')]({'where':{'id':_0x3b8740['params']['id']}})[_0x9f84('0x1d')](handleEntityNotFound(_0x57e281,null))['then'](removeEntity(_0x57e281,null))[_0x9f84('0x4a')](handleError(_0x57e281,null));};exports[_0x9f84('0x52')]=function(_0x5135ce,_0x18bc49,_0x5631d6){var _0x2350c4={};var _0x264748={};var _0x2aa269;var _0x510cbd;return db['ZohoAccount']['findOne']({'where':{'id':_0x5135ce[_0x9f84('0x4c')]['id']}})[_0x9f84('0x1d')](handleEntityNotFound(_0x18bc49,null))['then'](function(_0x4c1a32){if(_0x4c1a32){_0x2aa269=_0x4c1a32;_0x264748[_0x9f84('0x38')]=_[_0x9f84('0x3a')](db[_0x9f84('0x53')][_0x9f84('0x4d')]);_0x264748['query']=_[_0x9f84('0x3a')](_0x5135ce[_0x9f84('0x39')]);_0x264748[_0x9f84('0x3b')]=_[_0x9f84('0x3c')](_0x264748['model'],_0x264748[_0x9f84('0x39')]);_0x2350c4['attributes']=_[_0x9f84('0x3c')](_0x264748[_0x9f84('0x38')],qs[_0x9f84('0x3e')](_0x5135ce[_0x9f84('0x39')]['fields']));_0x2350c4[_0x9f84('0x3d')]=_0x2350c4[_0x9f84('0x3d')]['length']?_0x2350c4[_0x9f84('0x3d')]:_0x264748[_0x9f84('0x38')];_0x2350c4[_0x9f84('0x41')]=qs[_0x9f84('0x42')](_0x5135ce[_0x9f84('0x39')]['sort']);_0x2350c4[_0x9f84('0x43')]=qs[_0x9f84('0x3b')](_[_0x9f84('0x54')](_0x5135ce[_0x9f84('0x39')],_0x264748['filters']));if(_0x5135ce[_0x9f84('0x39')][_0x9f84('0x46')]){_0x2350c4['where']=_[_0x9f84('0x44')](_0x2350c4['where'],{'$or':_['map'](_0x2350c4[_0x9f84('0x3d')],function(_0x527c9c){var _0x1cba74={};_0x1cba74[_0x527c9c]={'$like':'%'+_0x5135ce['query'][_0x9f84('0x46')]+'%'};return _0x1cba74;})});}_0x2350c4=_[_0x9f84('0x44')]({},_0x2350c4,_0x5135ce[_0x9f84('0x47')]);return _0x2aa269[_0x9f84('0x52')](_0x2350c4);}})['then'](function(_0x13852b){if(_0x13852b){_0x510cbd=_0x13852b[_0x9f84('0x3f')];if(!_0x5135ce[_0x9f84('0x39')][_0x9f84('0x55')]('nolimit')){_0x2350c4[_0x9f84('0x40')]=qs['limit'](_0x5135ce[_0x9f84('0x39')][_0x9f84('0x40')]);_0x2350c4['offset']=qs[_0x9f84('0x29')](_0x5135ce[_0x9f84('0x39')][_0x9f84('0x29')]);}return _0x2aa269[_0x9f84('0x52')](_0x2350c4);}})[_0x9f84('0x1d')](function(_0x284102){if(_0x284102){return _0x284102?{'count':_0x510cbd,'rows':_0x284102}:null;}})['then'](respondWithResult(_0x18bc49,null))['catch'](handleError(_0x18bc49,null));};exports[_0x9f84('0x56')]=function(_0x857636,_0x1a8bfc,_0x4f40fc){if(_0x857636[_0x9f84('0x51')]['id']){delete _0x857636[_0x9f84('0x51')]['id'];}return db[_0x9f84('0x35')][_0x9f84('0x57')]({'where':{'id':_0x857636[_0x9f84('0x4c')]['id']}})[_0x9f84('0x1d')](handleEntityNotFound(_0x1a8bfc,null))[_0x9f84('0x1d')](function(_0x29d53e){if(_0x29d53e){_0x857636[_0x9f84('0x51')][_0x9f84('0x58')]=_0x29d53e['id'];_0x857636[_0x9f84('0x51')][_0x9f84('0x59')]=integrations[_0x9f84('0x5a')](_0x857636[_0x9f84('0x51')][_0x9f84('0x5b')],_0x857636[_0x9f84('0x51')][_0x9f84('0x36')]);_0x857636[_0x9f84('0x51')][_0x9f84('0x5c')]=integrations['getDescriptions'](_0x857636[_0x9f84('0x51')][_0x9f84('0x5b')],_0x857636[_0x9f84('0x51')]['type']);return db[_0x9f84('0x53')][_0x9f84('0x50')](_0x857636[_0x9f84('0x51')],{'include':[{'model':db[_0x9f84('0x5d')],'as':_0x9f84('0x59')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x1a8bfc,null))[_0x9f84('0x4a')](handleError(_0x1a8bfc,null));};function getAccessToken(_0x52a7b9){return new Promise(function(_0x5d67ff,_0x15e911){var _0x4c6869;switch(_0x52a7b9['zone']){case'US':_0x4c6869=_0x9f84('0x5e');break;case'AU':_0x4c6869='https://accounts.zoho.com.au';break;case'EU':_0x4c6869=_0x9f84('0x5f');break;case'IN':_0x4c6869=_0x9f84('0x60');break;case'CN':_0x4c6869=_0x9f84('0x61');break;default:_0x4c6869=_0x9f84('0x5f');break;}var _0x21ce5f={'method':'POST','uri':_0x4c6869+_0x9f84('0x62'),'qs':{'refresh_token':_0x52a7b9[_0x9f84('0x63')],'client_id':_0x52a7b9[_0x9f84('0x64')],'client_secret':_0x52a7b9[_0x9f84('0x65')],'grant_type':_0x9f84('0x66')},'json':!![]};return rp(_0x21ce5f)[_0x9f84('0x1d')](function(_0x399397){if(_0x399397[_0x9f84('0x67')]){_0x5d67ff(_0x399397['access_token']);}else{_0x15e911(_0x9f84('0x68'));}})['catch'](function(_0x48fafa){_0x15e911(_0x48fafa);});});}exports[_0x9f84('0x69')]=function(_0x4f145a,_0x584986,_0x284283){var _0x289c7c,_0x479792,_0x19a4bc,_0x16ad57,_0x904f03;return db[_0x9f84('0x35')]['findOne']({'where':{'id':_0x4f145a[_0x9f84('0x4c')]['id']},'attributes':['id',_0x9f84('0x6a'),_0x9f84('0x6b'),'clientId',_0x9f84('0x65'),_0x9f84('0x6c'),'code','refreshToken']})['then'](handleEntityNotFound(_0x584986,null))[_0x9f84('0x1d')](function(_0x36c28e){_0x904f03=_0x36c28e;_0x289c7c=_0x904f03[_0x9f84('0x6a')];_0x479792=_0x289c7c===_0x9f84('0x6d')?'eu':_0x9f84('0x6e');_0x19a4bc=_0x904f03[_0x9f84('0x6c')];var _0x354f62=_0x19a4bc['slice'](-0x1);if(_0x354f62==='/'||_0x354f62==='\x5c'||_0x354f62===':'){_0x19a4bc=_0x19a4bc['substring'](0x0,_0x19a4bc[_0x9f84('0x6f')](_0x354f62));}if(!_0x904f03[_0x9f84('0x63')]){throw new Error(_0x9f84('0x70'));}return getAccessToken(_0x904f03);})[_0x9f84('0x1d')](function(_0x1a6110){if(_0x1a6110){return rp({'method':'GET','uri':util[_0x9f84('0x71')](_0x9f84('0x72'),_0x479792),'qs':{'module':_0x9f84('0x73')},'headers':{'Authorization':_0x9f84('0x74')+_0x1a6110},'json':!![]});}})[_0x9f84('0x1d')](function(_0x33838e){if(_0x33838e){if(_0x33838e[_0x9f84('0x75')]&&_0x33838e[_0x9f84('0x75')][_0x9f84('0x22')]){throw new Error(_0x33838e[_0x9f84('0x75')][_0x9f84('0x22')][_0x9f84('0x24')]);}var _0x180374=[];var _0x294d7f=[];var _0x10cec7=[_0x9f84('0x76'),'Subject',_0x9f84('0x77'),_0x9f84('0x78'),_0x9f84('0x79'),_0x9f84('0x7a'),_0x9f84('0x7b'),_0x9f84('0x7c')];_0x294d7f=_[_0x9f84('0x7d')](_0x33838e[_0x9f84('0x3e')],function(_0x162345){return _0x10cec7[_0x9f84('0x7e')](_0x162345[_0x9f84('0x7f')]);});for(var _0x146f2d=0x0;_0x146f2d<_0x294d7f[_0x9f84('0x3f')];_0x146f2d++){if(_0x294d7f[_0x146f2d][_0x9f84('0x80')]===![]){_0x180374[_0x9f84('0x81')]({'id':_0x294d7f[_0x146f2d]['id'],'name':_0x294d7f[_0x146f2d]['display_label'],'custom':_0x294d7f[_0x146f2d][_0x9f84('0x82')],'options':_0x294d7f[_0x146f2d][_0x9f84('0x83')]==='picklist'&&_0x294d7f[_0x146f2d]['pick_list_values'][_0x9f84('0x3f')]>-0x1?_[_0x9f84('0x34')](_0x294d7f[_0x146f2d][_0x9f84('0x84')],function(_0x169175){return{'name':_0x169175,'value':_0x169175};}):[]});}}return{'count':_0x180374[_0x9f84('0x3f')],'rows':_0x180374};}else{return{'count':0x0,'rows':[]};}})[_0x9f84('0x1d')](respondWithResult(_0x584986,null))[_0x9f84('0x4a')](function(_0x5b591c){var _0x4b97fd=_0x4f145a[_0x9f84('0x39')][_0x9f84('0x85')]?0x1f4:_0x5b591c['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x9f84('0x69'),_0x4b97fd,JSON[_0x9f84('0x21')](_0x5b591c));delete _0x5b591c[_0x9f84('0x32')];if(_0x4b97fd===0x191){_0x4b97fd=0x190;}_0x584986[_0x9f84('0x27')](_0x4b97fd)[_0x9f84('0x86')](_0x4f145a['query'][_0x9f84('0x85')]?{'message':_0x9f84('0x87'),'statusCode':_0x5b591c[_0x9f84('0x88')]}:_0x5b591c);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 075a253..53dad24 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 _0x7c3e=['catch','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','host','slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','application/x-www-form-urlencoded','parse','refresh_token','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','inspect','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','substring','https://accounts.zoho.eu','/oauth/v2/token','then','refreshToken'];(function(_0x5982fd,_0x3ce959){var _0x238b15=function(_0x1203b7){while(--_0x1203b7){_0x5982fd['push'](_0x5982fd['shift']());}};_0x238b15(++_0x3ce959);}(_0x7c3e,0x1da));var _0xe7c3=function(_0x3480f2,_0x4947fa){_0x3480f2=_0x3480f2-0x0;var _0x1e4899=_0x7c3e[_0x3480f2];return _0x1e4899;};'use strict';var _=require(_0xe7c3('0x0'));var util=require('util');var logger=require(_0xe7c3('0x1'))(_0xe7c3('0x2'));var moment=require(_0xe7c3('0x3'));var BPromise=require(_0xe7c3('0x4'));var rp=require(_0xe7c3('0x5'));var fs=require('fs');var path=require(_0xe7c3('0x6'));var rimraf=require(_0xe7c3('0x7'));var config=require(_0xe7c3('0x8'));var attributes=require(_0xe7c3('0x9'));var integrations=require(_0xe7c3('0xa'));module[_0xe7c3('0xb')]=function(_0x50fbd3,_0x3045c4){return _0x50fbd3[_0xe7c3('0xc')]('ZohoAccount',attributes,{'tableName':_0xe7c3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x26daa5,_0x1c0f42,_0x291da2){if(_0x26daa5[_0xe7c3('0xe')](_0xe7c3('0xf'))||_0x26daa5[_0xe7c3('0xe')](_0xe7c3('0x10'))||_0x26daa5[_0xe7c3('0xe')](_0xe7c3('0x11'))||_0x26daa5[_0xe7c3('0xe')](_0xe7c3('0x12'))||_0x26daa5[_0xe7c3('0xe')](_0xe7c3('0x13'))||_0x26daa5[_0xe7c3('0xe')](_0xe7c3('0x14'))){var _0x584789,_0x3e3002;_0x584789=_0x26daa5[_0xe7c3('0x10')];var _0x1e66c2=_0x584789[_0xe7c3('0x15')](-0x1);if(_0x1e66c2==='/'||_0x1e66c2==='\x5c'||_0x1e66c2===':'){_0x584789=_0x584789['substring'](0x0,_0x584789[_0xe7c3('0x16')](_0x1e66c2));}switch(_0x26daa5[_0xe7c3('0xf')]){case'US':_0x3e3002=_0xe7c3('0x17');break;case'AU':_0x3e3002=_0xe7c3('0x18');break;case'IN':_0x3e3002=_0xe7c3('0x19');break;case'CN':_0x3e3002=_0xe7c3('0x1a');break;default:_0x3e3002='https://accounts.zoho.eu';break;}var _0x3c05e1={'method':_0xe7c3('0x1b'),'uri':_0x3e3002+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x26daa5[_0xe7c3('0x11')],'client_secret':_0x26daa5[_0xe7c3('0x12')],'redirect_uri':_0x26daa5[_0xe7c3('0x10')],'code':_0x26daa5[_0xe7c3('0x13')]},'headers':{'Content-Type':_0xe7c3('0x1c')}};return rp(_0x3c05e1)['then'](function(_0x8255b2){var _0x72a86f=JSON[_0xe7c3('0x1d')](_0x8255b2);if(_0x72a86f['refresh_token']){_0x26daa5['refreshToken']=_0x72a86f[_0xe7c3('0x1e')];logger['info'](util['format'](_0xe7c3('0x1f'),_0x26daa5[_0xe7c3('0x20')],_0x26daa5['id']));}else{logger[_0xe7c3('0x21')](util[_0xe7c3('0x22')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x26daa5[_0xe7c3('0x20')],_0x26daa5['id']),util[_0xe7c3('0x23')](_0x72a86f,{'showHidden':![],'depth':null}));}return _0x291da2(null,_0x1c0f42);})['catch'](function(_0x1479ba){logger[_0xe7c3('0x21')](util[_0xe7c3('0x22')](_0xe7c3('0x24'),_0x26daa5[_0xe7c3('0x20')],_0x26daa5['id']),util[_0xe7c3('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x291da2(_0x1479ba);});}else{return _0x291da2(null,_0x1c0f42);}},'beforeUpdate':function(_0x36f673,_0x4de769,_0x3ef592){if(_0x36f673[_0xe7c3('0xe')]('zone')||_0x36f673[_0xe7c3('0xe')](_0xe7c3('0x10'))||_0x36f673[_0xe7c3('0xe')](_0xe7c3('0x11'))||_0x36f673[_0xe7c3('0xe')]('clientSecret')||_0x36f673[_0xe7c3('0xe')]('code')||_0x36f673[_0xe7c3('0xe')](_0xe7c3('0x14'))){var _0x23c9fc,_0x16607b;_0x23c9fc=_0x36f673['serverUrl'];var _0x3d25df=_0x23c9fc[_0xe7c3('0x15')](-0x1);if(_0x3d25df==='/'||_0x3d25df==='\x5c'||_0x3d25df===':'){_0x23c9fc=_0x23c9fc[_0xe7c3('0x25')](0x0,_0x23c9fc[_0xe7c3('0x16')](_0x3d25df));}switch(_0x36f673[_0xe7c3('0xf')]){case'US':_0x16607b=_0xe7c3('0x17');break;case'AU':_0x16607b=_0xe7c3('0x18');break;case'IN':_0x16607b=_0xe7c3('0x19');break;case'CN':_0x16607b='https://accounts.zoho.com.cn';break;default:_0x16607b=_0xe7c3('0x26');break;}var _0x2c3459={'method':'POST','uri':_0x16607b+_0xe7c3('0x27'),'form':{'grant_type':'authorization_code','client_id':_0x36f673['clientId'],'client_secret':_0x36f673[_0xe7c3('0x12')],'redirect_uri':_0x36f673[_0xe7c3('0x10')],'code':_0x36f673[_0xe7c3('0x13')]},'headers':{'Content-Type':_0xe7c3('0x1c')}};return rp(_0x2c3459)[_0xe7c3('0x28')](function(_0x417c2c){var _0x121278=JSON[_0xe7c3('0x1d')](_0x417c2c);if(_0x121278[_0xe7c3('0x1e')]){_0x36f673[_0xe7c3('0x29')]=_0x121278[_0xe7c3('0x1e')];logger['info'](util['format'](_0xe7c3('0x1f'),_0x36f673[_0xe7c3('0x20')],_0x36f673['id']));}else{logger[_0xe7c3('0x21')](util['format'](_0xe7c3('0x24'),_0x36f673['name'],_0x36f673['id']),util[_0xe7c3('0x23')](_0x121278,{'showHidden':![],'depth':null}));}return _0x3ef592(null,_0x4de769);})[_0xe7c3('0x2a')](function(_0x48f4e0){logger[_0xe7c3('0x21')](util[_0xe7c3('0x22')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x36f673[_0xe7c3('0x20')],_0x36f673['id']),util[_0xe7c3('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x3ef592(_0x48f4e0);});}else{return _0x3ef592(null,_0x4de769);}}}});}; \ No newline at end of file +var _0x3af1=['int_zoho_accounts','changed','zone','clientId','clientSecret','code','serverUrl','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','inspect','catch','POST','parse','info','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','../../config/logger','api','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount'];(function(_0x4723d1,_0x515d2e){var _0x335b7f=function(_0x559134){while(--_0x559134){_0x4723d1['push'](_0x4723d1['shift']());}};_0x335b7f(++_0x515d2e);}(_0x3af1,0x1d5));var _0x13af=function(_0x24540a,_0x27195d){_0x24540a=_0x24540a-0x0;var _0xc7d00f=_0x3af1[_0x24540a];return _0xc7d00f;};'use strict';var _=require(_0x13af('0x0'));var util=require(_0x13af('0x1'));var logger=require(_0x13af('0x2'))(_0x13af('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(_0x13af('0x4'));var config=require(_0x13af('0x5'));var attributes=require(_0x13af('0x6'));var integrations=require(_0x13af('0x7'));module[_0x13af('0x8')]=function(_0x452216,_0x1b945e){return _0x452216[_0x13af('0x9')](_0x13af('0xa'),attributes,{'tableName':_0x13af('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x43bcde,_0x1cbc63,_0x50badf){if(_0x43bcde[_0x13af('0xc')](_0x13af('0xd'))||_0x43bcde[_0x13af('0xc')]('serverUrl')||_0x43bcde[_0x13af('0xc')](_0x13af('0xe'))||_0x43bcde[_0x13af('0xc')](_0x13af('0xf'))||_0x43bcde[_0x13af('0xc')](_0x13af('0x10'))||_0x43bcde[_0x13af('0xc')]('host')){var _0x1b40c1,_0x3ef5f3;_0x1b40c1=_0x43bcde[_0x13af('0x11')];var _0x1d536a=_0x1b40c1['slice'](-0x1);if(_0x1d536a==='/'||_0x1d536a==='\x5c'||_0x1d536a===':'){_0x1b40c1=_0x1b40c1[_0x13af('0x12')](0x0,_0x1b40c1[_0x13af('0x13')](_0x1d536a));}switch(_0x43bcde[_0x13af('0xd')]){case'US':_0x3ef5f3=_0x13af('0x14');break;case'AU':_0x3ef5f3='https://accounts.zoho.com.au';break;case'IN':_0x3ef5f3=_0x13af('0x15');break;case'CN':_0x3ef5f3=_0x13af('0x16');break;default:_0x3ef5f3=_0x13af('0x17');break;}var _0x603cf8={'method':'POST','uri':_0x3ef5f3+_0x13af('0x18'),'form':{'grant_type':_0x13af('0x19'),'client_id':_0x43bcde[_0x13af('0xe')],'client_secret':_0x43bcde[_0x13af('0xf')],'redirect_uri':_0x43bcde[_0x13af('0x11')],'code':_0x43bcde[_0x13af('0x10')]},'headers':{'Content-Type':_0x13af('0x1a')}};return rp(_0x603cf8)[_0x13af('0x1b')](function(_0x1871b6){var _0x23c200=JSON['parse'](_0x1871b6);if(_0x23c200[_0x13af('0x1c')]){_0x43bcde[_0x13af('0x1d')]=_0x23c200[_0x13af('0x1c')];logger['info'](util[_0x13af('0x1e')](_0x13af('0x1f'),_0x43bcde[_0x13af('0x20')],_0x43bcde['id']));}else{logger[_0x13af('0x21')](util[_0x13af('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x43bcde[_0x13af('0x20')],_0x43bcde['id']),util[_0x13af('0x22')](_0x23c200,{'showHidden':![],'depth':null}));}return _0x50badf(null,_0x1cbc63);})[_0x13af('0x23')](function(_0xb03d4e){logger[_0x13af('0x21')](util[_0x13af('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x43bcde[_0x13af('0x20')],_0x43bcde['id']),util[_0x13af('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x50badf(_0xb03d4e);});}else{return _0x50badf(null,_0x1cbc63);}},'beforeUpdate':function(_0x187e3d,_0x3dae02,_0xd26407){if(_0x187e3d[_0x13af('0xc')](_0x13af('0xd'))||_0x187e3d[_0x13af('0xc')](_0x13af('0x11'))||_0x187e3d[_0x13af('0xc')](_0x13af('0xe'))||_0x187e3d[_0x13af('0xc')]('clientSecret')||_0x187e3d[_0x13af('0xc')](_0x13af('0x10'))||_0x187e3d[_0x13af('0xc')]('host')){var _0x2bbc22,_0x3a5f85;_0x2bbc22=_0x187e3d[_0x13af('0x11')];var _0x39b9bf=_0x2bbc22['slice'](-0x1);if(_0x39b9bf==='/'||_0x39b9bf==='\x5c'||_0x39b9bf===':'){_0x2bbc22=_0x2bbc22['substring'](0x0,_0x2bbc22[_0x13af('0x13')](_0x39b9bf));}switch(_0x187e3d[_0x13af('0xd')]){case'US':_0x3a5f85=_0x13af('0x14');break;case'AU':_0x3a5f85='https://accounts.zoho.com.au';break;case'IN':_0x3a5f85=_0x13af('0x15');break;case'CN':_0x3a5f85='https://accounts.zoho.com.cn';break;default:_0x3a5f85='https://accounts.zoho.eu';break;}var _0x4186ea={'method':_0x13af('0x24'),'uri':_0x3a5f85+_0x13af('0x18'),'form':{'grant_type':_0x13af('0x19'),'client_id':_0x187e3d[_0x13af('0xe')],'client_secret':_0x187e3d[_0x13af('0xf')],'redirect_uri':_0x187e3d['serverUrl'],'code':_0x187e3d['code']},'headers':{'Content-Type':_0x13af('0x1a')}};return rp(_0x4186ea)['then'](function(_0x4a8855){var _0x3bb8c8=JSON[_0x13af('0x25')](_0x4a8855);if(_0x3bb8c8['refresh_token']){_0x187e3d[_0x13af('0x1d')]=_0x3bb8c8[_0x13af('0x1c')];logger[_0x13af('0x26')](util[_0x13af('0x1e')](_0x13af('0x1f'),_0x187e3d[_0x13af('0x20')],_0x187e3d['id']));}else{logger['error'](util[_0x13af('0x1e')](_0x13af('0x27'),_0x187e3d[_0x13af('0x20')],_0x187e3d['id']),util['inspect'](_0x3bb8c8,{'showHidden':![],'depth':null}));}return _0xd26407(null,_0x3dae02);})[_0x13af('0x23')](function(_0x11ee7e){logger['error'](util[_0x13af('0x1e')](_0x13af('0x27'),_0x187e3d[_0x13af('0x20')],_0x187e3d['id']),util[_0x13af('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0xd26407(_0x11ee7e);});}else{return _0xd26407(null,_0x3dae02);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index fb81399..f0cae36 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 _0xe565=['limit','include','model','map','attributes','debug','stringify','find','ShowZohoAccount','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where'];(function(_0x2fbf1a,_0x5b4456){var _0x2ef025=function(_0x59b55c){while(--_0x59b55c){_0x2fbf1a['push'](_0x2fbf1a['shift']());}};_0x2ef025(++_0x5b4456);}(_0xe565,0x195));var _0x5e56=function(_0x264b30,_0x5cad19){_0x264b30=_0x264b30-0x0;var _0x4545a3=_0xe565[_0x264b30];return _0x4545a3;};'use strict';var _=require(_0x5e56('0x0'));var util=require(_0x5e56('0x1'));var moment=require(_0x5e56('0x2'));var BPromise=require('bluebird');var rs=require(_0x5e56('0x3'));var fs=require('fs');var Redis=require(_0x5e56('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e56('0x5'));var logger=require(_0x5e56('0x6'))(_0x5e56('0x7'));var config=require('../../config/environment');var jayson=require(_0x5e56('0x8'));var client=jayson[_0x5e56('0x9')][_0x5e56('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd78abf,_0x73a280,_0x40efdd){return new BPromise(function(_0x291bfe,_0x1f8a83){return client['request'](_0xd78abf,_0x40efdd)[_0x5e56('0xb')](function(_0x1a94be){logger[_0x5e56('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x73a280,_0x5e56('0xd'));logger['debug'](_0x5e56('0xe'),_0x73a280,'request\x20sent',JSON['stringify'](_0x1a94be));if(_0x1a94be[_0x5e56('0xf')]){if(_0x1a94be[_0x5e56('0xf')][_0x5e56('0x10')]===0x1f4){logger[_0x5e56('0xf')](_0x5e56('0x11'),_0x73a280,_0x1a94be[_0x5e56('0xf')]['message']);return _0x1f8a83(_0x1a94be['error']['message']);}logger[_0x5e56('0xf')](_0x5e56('0x11'),_0x73a280,_0x1a94be[_0x5e56('0xf')][_0x5e56('0x12')]);return _0x291bfe(_0x1a94be['error']['message']);}else{logger[_0x5e56('0xc')](_0x5e56('0x11'),_0x73a280,_0x5e56('0xd'));_0x291bfe(_0x1a94be[_0x5e56('0x13')][_0x5e56('0x12')]);}})[_0x5e56('0x14')](function(_0x432567){logger[_0x5e56('0xf')](_0x5e56('0x11'),_0x73a280,_0x432567);_0x1f8a83(_0x432567);});});}exports[_0x5e56('0x15')]=function(_0x410783){var _0x134178=this;return new Promise(function(_0x9ad8d3,_0x4b8735){return db[_0x5e56('0x16')][_0x5e56('0x17')]({'raw':_0x410783[_0x5e56('0x18')]?_0x410783['options'][_0x5e56('0x19')]===undefined?!![]:![]:!![],'where':_0x410783[_0x5e56('0x18')]?_0x410783['options'][_0x5e56('0x1a')]||null:null,'attributes':_0x410783['options']?_0x410783[_0x5e56('0x18')]['attributes']||null:null,'limit':_0x410783[_0x5e56('0x18')]?_0x410783[_0x5e56('0x18')][_0x5e56('0x1b')]||null:null,'include':_0x410783['options']?_0x410783[_0x5e56('0x18')]['include']?_['map'](_0x410783['options'][_0x5e56('0x1c')],function(_0x151c25){return{'model':db[_0x151c25[_0x5e56('0x1d')]],'as':_0x151c25['as'],'attributes':_0x151c25['attributes'],'include':_0x151c25['include']?_[_0x5e56('0x1e')](_0x151c25[_0x5e56('0x1c')],function(_0x588ddd){return{'model':db[_0x588ddd[_0x5e56('0x1d')]],'as':_0x588ddd['as'],'attributes':_0x588ddd[_0x5e56('0x1f')],'include':_0x588ddd[_0x5e56('0x1c')]?_[_0x5e56('0x1e')](_0x588ddd[_0x5e56('0x1c')],function(_0x4b5944){return{'model':db[_0x4b5944[_0x5e56('0x1d')]],'as':_0x4b5944['as'],'attributes':_0x4b5944['attributes']};}):[]};}):[]};}):[]:[]})[_0x5e56('0xb')](function(_0x266b97){logger[_0x5e56('0xc')](_0x5e56('0x15'),_0x410783);logger[_0x5e56('0x20')](_0x5e56('0x15'),_0x410783,JSON[_0x5e56('0x21')](_0x266b97));_0x9ad8d3(_0x266b97);})[_0x5e56('0x14')](function(_0x261dd9){logger[_0x5e56('0xf')](_0x5e56('0x15'),_0x261dd9[_0x5e56('0x12')],_0x410783);_0x4b8735(_0x134178['error'](0x1f4,_0x261dd9['message']));});});};exports['ShowZohoAccount']=function(_0x231c0e){var _0xcac637=this;return new Promise(function(_0x512864,_0x13e976){return db[_0x5e56('0x16')][_0x5e56('0x22')]({'raw':_0x231c0e['options']?_0x231c0e[_0x5e56('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x231c0e[_0x5e56('0x18')]?_0x231c0e[_0x5e56('0x18')][_0x5e56('0x1a')]||null:null,'attributes':_0x231c0e['options']?_0x231c0e['options'][_0x5e56('0x1f')]||null:null,'include':_0x231c0e[_0x5e56('0x18')]?_0x231c0e[_0x5e56('0x18')][_0x5e56('0x1c')]?_[_0x5e56('0x1e')](_0x231c0e[_0x5e56('0x18')][_0x5e56('0x1c')],function(_0x4629ae){return{'model':db[_0x4629ae[_0x5e56('0x1d')]],'as':_0x4629ae['as'],'attributes':_0x4629ae[_0x5e56('0x1f')],'include':_0x4629ae[_0x5e56('0x1c')]?_[_0x5e56('0x1e')](_0x4629ae[_0x5e56('0x1c')],function(_0x15c257){return{'model':db[_0x15c257['model']],'as':_0x15c257['as'],'attributes':_0x15c257[_0x5e56('0x1f')],'include':_0x15c257['include']?_['map'](_0x15c257[_0x5e56('0x1c')],function(_0x48e40d){return{'model':db[_0x48e40d[_0x5e56('0x1d')]],'as':_0x48e40d['as'],'attributes':_0x48e40d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5acb2e){logger[_0x5e56('0xc')](_0x5e56('0x23'),_0x231c0e);logger['debug'](_0x5e56('0x23'),_0x231c0e,JSON[_0x5e56('0x21')](_0x5acb2e));_0x512864(_0x5acb2e);})[_0x5e56('0x14')](function(_0xa092b8){logger[_0x5e56('0xf')](_0x5e56('0x23'),_0xa092b8[_0x5e56('0x12')],_0x231c0e);_0x13e976(_0xcac637[_0x5e56('0xf')](0x1f4,_0xa092b8[_0x5e56('0x12')]));});});}; \ No newline at end of file +var _0x118c=['../../config/environment','client','http','request','info','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','ZohoAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','include','map','model','attributes','then','find','ShowZohoAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1c8b72,_0x1b85ec){var _0x4e0206=function(_0x41dcb9){while(--_0x41dcb9){_0x1c8b72['push'](_0x1c8b72['shift']());}};_0x4e0206(++_0x1b85ec);}(_0x118c,0x183));var _0xc118=function(_0x4bb1b3,_0x446a44){_0x4bb1b3=_0x4bb1b3-0x0;var _0x6b3651=_0x118c[_0x4bb1b3];return _0x6b3651;};'use strict';var _=require(_0xc118('0x0'));var util=require(_0xc118('0x1'));var moment=require(_0xc118('0x2'));var BPromise=require('bluebird');var rs=require(_0xc118('0x3'));var fs=require('fs');var Redis=require(_0xc118('0x4'));var db=require(_0xc118('0x5'))['db'];var utils=require(_0xc118('0x6'));var logger=require(_0xc118('0x7'))(_0xc118('0x8'));var config=require(_0xc118('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc118('0xa')][_0xc118('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b6c87,_0x4afdaa,_0x4e44e7){return new BPromise(function(_0x2e92ef,_0x56a611){return client[_0xc118('0xc')](_0x5b6c87,_0x4e44e7)['then'](function(_0x3f60d2){logger[_0xc118('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x4afdaa,'request\x20sent');logger[_0xc118('0xe')](_0xc118('0xf'),_0x4afdaa,'request\x20sent',JSON[_0xc118('0x10')](_0x3f60d2));if(_0x3f60d2[_0xc118('0x11')]){if(_0x3f60d2[_0xc118('0x11')]['code']===0x1f4){logger[_0xc118('0x11')](_0xc118('0x12'),_0x4afdaa,_0x3f60d2[_0xc118('0x11')][_0xc118('0x13')]);return _0x56a611(_0x3f60d2[_0xc118('0x11')]['message']);}logger[_0xc118('0x11')](_0xc118('0x12'),_0x4afdaa,_0x3f60d2[_0xc118('0x11')][_0xc118('0x13')]);return _0x2e92ef(_0x3f60d2[_0xc118('0x11')][_0xc118('0x13')]);}else{logger[_0xc118('0xd')](_0xc118('0x12'),_0x4afdaa,_0xc118('0x14'));_0x2e92ef(_0x3f60d2[_0xc118('0x15')]['message']);}})[_0xc118('0x16')](function(_0x60a773){logger['error'](_0xc118('0x12'),_0x4afdaa,_0x60a773);_0x56a611(_0x60a773);});});}exports[_0xc118('0x17')]=function(_0xe056d6){var _0x17fc6d=this;return new Promise(function(_0x151e7d,_0x4bf4b7){return db[_0xc118('0x18')][_0xc118('0x19')]({'raw':_0xe056d6[_0xc118('0x1a')]?_0xe056d6[_0xc118('0x1a')][_0xc118('0x1b')]===undefined?!![]:![]:!![],'where':_0xe056d6['options']?_0xe056d6[_0xc118('0x1a')][_0xc118('0x1c')]||null:null,'attributes':_0xe056d6[_0xc118('0x1a')]?_0xe056d6['options']['attributes']||null:null,'limit':_0xe056d6[_0xc118('0x1a')]?_0xe056d6[_0xc118('0x1a')]['limit']||null:null,'include':_0xe056d6['options']?_0xe056d6[_0xc118('0x1a')][_0xc118('0x1d')]?_[_0xc118('0x1e')](_0xe056d6[_0xc118('0x1a')][_0xc118('0x1d')],function(_0x7c950f){return{'model':db[_0x7c950f[_0xc118('0x1f')]],'as':_0x7c950f['as'],'attributes':_0x7c950f['attributes'],'include':_0x7c950f[_0xc118('0x1d')]?_[_0xc118('0x1e')](_0x7c950f[_0xc118('0x1d')],function(_0x5ce3f3){return{'model':db[_0x5ce3f3[_0xc118('0x1f')]],'as':_0x5ce3f3['as'],'attributes':_0x5ce3f3['attributes'],'include':_0x5ce3f3['include']?_['map'](_0x5ce3f3[_0xc118('0x1d')],function(_0x22abad){return{'model':db[_0x22abad[_0xc118('0x1f')]],'as':_0x22abad['as'],'attributes':_0x22abad[_0xc118('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc118('0x21')](function(_0x36a02a){logger[_0xc118('0xd')](_0xc118('0x17'),_0xe056d6);logger[_0xc118('0xe')]('GetZohoAccount',_0xe056d6,JSON[_0xc118('0x10')](_0x36a02a));_0x151e7d(_0x36a02a);})['catch'](function(_0x3d06de){logger[_0xc118('0x11')](_0xc118('0x17'),_0x3d06de[_0xc118('0x13')],_0xe056d6);_0x4bf4b7(_0x17fc6d[_0xc118('0x11')](0x1f4,_0x3d06de[_0xc118('0x13')]));});});};exports['ShowZohoAccount']=function(_0x210676){var _0x520740=this;return new Promise(function(_0x4ccf50,_0xea154d){return db[_0xc118('0x18')][_0xc118('0x22')]({'raw':_0x210676[_0xc118('0x1a')]?_0x210676[_0xc118('0x1a')][_0xc118('0x1b')]===undefined?!![]:![]:!![],'where':_0x210676[_0xc118('0x1a')]?_0x210676['options']['where']||null:null,'attributes':_0x210676[_0xc118('0x1a')]?_0x210676[_0xc118('0x1a')][_0xc118('0x20')]||null:null,'include':_0x210676[_0xc118('0x1a')]?_0x210676[_0xc118('0x1a')][_0xc118('0x1d')]?_[_0xc118('0x1e')](_0x210676['options'][_0xc118('0x1d')],function(_0x33eabc){return{'model':db[_0x33eabc['model']],'as':_0x33eabc['as'],'attributes':_0x33eabc[_0xc118('0x20')],'include':_0x33eabc[_0xc118('0x1d')]?_['map'](_0x33eabc[_0xc118('0x1d')],function(_0xb47b63){return{'model':db[_0xb47b63[_0xc118('0x1f')]],'as':_0xb47b63['as'],'attributes':_0xb47b63[_0xc118('0x20')],'include':_0xb47b63[_0xc118('0x1d')]?_['map'](_0xb47b63[_0xc118('0x1d')],function(_0x182b83){return{'model':db[_0x182b83[_0xc118('0x1f')]],'as':_0x182b83['as'],'attributes':_0x182b83[_0xc118('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc118('0x21')](function(_0x32fd3b){logger[_0xc118('0xd')](_0xc118('0x23'),_0x210676);logger[_0xc118('0xe')](_0xc118('0x23'),_0x210676,JSON[_0xc118('0x10')](_0x32fd3b));_0x4ccf50(_0x32fd3b);})[_0xc118('0x16')](function(_0x63fb44){logger[_0xc118('0x11')](_0xc118('0x23'),_0x63fb44[_0xc118('0x13')],_0x210676);_0xea154d(_0x520740[_0xc118('0x11')](0x1f4,_0x63fb44['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 81b02cd..ff49d49 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 _0xf151=['delete','/:id','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','show','get','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','update'];(function(_0xc2db17,_0xdbb459){var _0x540fc7=function(_0x17f842){while(--_0x17f842){_0xc2db17['push'](_0xc2db17['shift']());}};_0x540fc7(++_0xdbb459);}(_0xf151,0xab));var _0x1f15=function(_0x4aad21,_0x2f467b){_0x4aad21=_0x4aad21-0x0;var _0x545309=_0xf151[_0x4aad21];return _0x545309;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1f15('0x0'));var timeout=require(_0x1f15('0x1'));var express=require(_0x1f15('0x2'));var router=express[_0x1f15('0x3')]();var auth=require(_0x1f15('0x4'));var interaction=require(_0x1f15('0x5'));var config=require(_0x1f15('0x6'));var controller=require(_0x1f15('0x7'));router['get']('/',auth[_0x1f15('0x8')](),controller['index']);router['get']('/:id',auth[_0x1f15('0x8')](),controller[_0x1f15('0x9')]);router[_0x1f15('0xa')]('/:id/fields',auth[_0x1f15('0x8')](),controller[_0x1f15('0xb')]);router['get']('/:id/subjects',auth[_0x1f15('0x8')](),controller[_0x1f15('0xc')]);router[_0x1f15('0xa')](_0x1f15('0xd'),auth['isAuthenticated'](),controller[_0x1f15('0xe')]);router[_0x1f15('0xf')]('/',auth[_0x1f15('0x8')](),controller[_0x1f15('0x10')]);router['put']('/:id',auth[_0x1f15('0x8')](),controller[_0x1f15('0x11')]);router[_0x1f15('0x12')](_0x1f15('0x13'),auth[_0x1f15('0x8')](),controller[_0x1f15('0x14')]);module['exports']=router; \ No newline at end of file +var _0x7dc2=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/fields','getFields','/:id/descriptions','create','put','/:id','update','destroy','exports','path'];(function(_0x3cf2f5,_0x51f30d){var _0x4697eb=function(_0x3e9d52){while(--_0x3e9d52){_0x3cf2f5['push'](_0x3cf2f5['shift']());}};_0x4697eb(++_0x51f30d);}(_0x7dc2,0x19d));var _0x27dc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7dc2[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x27dc('0x0'));var timeout=require(_0x27dc('0x1'));var express=require(_0x27dc('0x2'));var router=express[_0x27dc('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x27dc('0x4'));var config=require(_0x27dc('0x5'));var controller=require('./intZohoConfiguration.controller');router[_0x27dc('0x6')]('/',auth[_0x27dc('0x7')](),controller['index']);router[_0x27dc('0x6')]('/:id',auth[_0x27dc('0x7')](),controller[_0x27dc('0x8')]);router['get'](_0x27dc('0x9'),auth[_0x27dc('0x7')](),controller[_0x27dc('0xa')]);router[_0x27dc('0x6')]('/:id/subjects',auth[_0x27dc('0x7')](),controller['getSubjects']);router[_0x27dc('0x6')](_0x27dc('0xb'),auth[_0x27dc('0x7')](),controller['getDescriptions']);router['post']('/',auth[_0x27dc('0x7')](),controller[_0x27dc('0xc')]);router[_0x27dc('0xd')](_0x27dc('0xe'),auth['isAuthenticated'](),controller[_0x27dc('0xf')]);router['delete'](_0x27dc('0xe'),auth['isAuthenticated'](),controller[_0x27dc('0x10')]);module[_0x27dc('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index bc4924d..2bc9242 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 _0xeba3=['contact_lead','contact','STRING','sequelize','exports','ENUM','lead','nothing'];(function(_0x5ee911,_0x55ac30){var _0x2b1004=function(_0x3e5651){while(--_0x3e5651){_0x5ee911['push'](_0x5ee911['shift']());}};_0x2b1004(++_0x55ac30);}(_0xeba3,0x13b));var _0x3eba=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xeba3[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x3eba('0x0'));module[_0x3eba('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x3eba('0x2')](_0x3eba('0x3'),'contact',_0x3eba('0x4')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x3eba('0x2')](_0x3eba('0x5'),_0x3eba('0x6'),'lead'),'defaultValue':_0x3eba('0x5')},'description':{'type':Sequelize[_0x3eba('0x7')]}}; \ No newline at end of file +var _0xebf8=['contact','nothing','contact_lead','sequelize','exports','STRING','ENUM','lead'];(function(_0x455dfd,_0x11e96d){var _0x301fce=function(_0x2a1360){while(--_0x2a1360){_0x455dfd['push'](_0x455dfd['shift']());}};_0x301fce(++_0x11e96d);}(_0xebf8,0x17b));var _0x8ebf=function(_0x5a49d3,_0x1964e3){_0x5a49d3=_0x5a49d3-0x0;var _0x582dd0=_0xebf8[_0x5a49d3];return _0x582dd0;};'use strict';var Sequelize=require(_0x8ebf('0x0'));module[_0x8ebf('0x1')]={'name':{'type':Sequelize[_0x8ebf('0x2')]},'moduleCreate':{'type':Sequelize[_0x8ebf('0x3')](_0x8ebf('0x4'),_0x8ebf('0x5'),_0x8ebf('0x6')),'defaultValue':_0x8ebf('0x4')},'moduleSearch':{'type':Sequelize[_0x8ebf('0x3')](_0x8ebf('0x7'),_0x8ebf('0x5'),_0x8ebf('0x4')),'defaultValue':_0x8ebf('0x7')},'description':{'type':Sequelize[_0x8ebf('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index cbfec34..b422d99 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(_0x39a757,_0x51e36d){var _0x3df2f=function(_0x1e5083){while(--_0x1e5083){_0x39a757['push'](_0x39a757['shift']());}};_0x3df2f(++_0x51e36d);}(_0xe14b,0x93));var _0xbe14=function(_0x1bf7de,_0x1c373a){_0x1bf7de=_0x1bf7de-0x0;var _0xf1a88=_0xe14b[_0x1bf7de];return _0xf1a88;};'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 _0x008c=['save','update','stack','name','send','index','ZohoConfiguration','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','type','merge','options','includeAll','include','findAll','rows','params','create','body','find','getFields','findOne','ZohoField','pick','filter','map','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','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','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','ZohoConfiguration,\x20%s,\x20%s','error','message','info','request\x20sent','catch','sendStatus','status','end','count','offset','limit','apply','reject'];(function(_0x15b84d,_0x372d86){var _0x353792=function(_0x149d07){while(--_0x149d07){_0x15b84d['push'](_0x15b84d['shift']());}};_0x353792(++_0x372d86);}(_0x008c,0x188));var _0xc008=function(_0x224436,_0x13088b){_0x224436=_0x224436-0x0;var _0x3c694a=_0x008c[_0x224436];return _0x3c694a;};'use strict';var pdf=require(_0xc008('0x0'));var emlformat=require(_0xc008('0x1'));var rimraf=require(_0xc008('0x2'));var zipdir=require(_0xc008('0x3'));var jsonpatch=require(_0xc008('0x4'));var rp=require('request-promise');var moment=require(_0xc008('0x5'));var BPromise=require(_0xc008('0x6'));var Mustache=require(_0xc008('0x7'));var util=require(_0xc008('0x8'));var path=require(_0xc008('0x9'));var sox=require(_0xc008('0xa'));var csv=require(_0xc008('0xb'));var ejs=require(_0xc008('0xc'));var fs=require('fs');var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var db=require(_0xc008('0x16'))['db'];var jayson=require(_0xc008('0x17'));var client=jayson[_0xc008('0x18')][_0xc008('0x19')]({'port':0x232a});function checkPasswordPattern(_0x69726e,_0x593f7a,_0x560e28){if(_0x560e28){var _0x33f44c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x33f44c['test'](_0x593f7a)){return _0x69726e;}else{throw new db[(_0xc008('0x1a'))][(_0xc008('0x1b'))](_0xc008('0x1c'));}}else{return _0x69726e;}}function respondWithRpcPromise(_0x339ffc,_0x3f0ecf,_0x5ee00b,_0x5e894e){return new BPromise(function(_0x4bd0f4,_0x11ef38){var _0x15a6ad=_0x5e894e||client;return _0x15a6ad[_0xc008('0x1d')](_0x339ffc,_0x5ee00b)[_0xc008('0x1e')](function(_0x4fe771){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x3f0ecf,'request\x20sent');logger[_0xc008('0x1f')](_0xc008('0x20'),_0x3f0ecf,'request\x20sent',JSON[_0xc008('0x21')](_0x4fe771));if(_0x4fe771['error']){if(_0x4fe771['error']['code']===0x1f4){logger['error'](_0xc008('0x22'),_0x3f0ecf,_0x4fe771['error']['message']);return _0x11ef38(_0x4fe771['error']['message']);}logger['error'](_0xc008('0x22'),_0x3f0ecf,_0x4fe771[_0xc008('0x23')][_0xc008('0x24')]);return _0x4bd0f4(_0x4fe771[_0xc008('0x23')][_0xc008('0x24')]);}else{logger[_0xc008('0x25')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f0ecf,_0xc008('0x26'));_0x4bd0f4(_0x4fe771['result']['message']);}})[_0xc008('0x27')](function(_0x36f358){logger[_0xc008('0x23')](_0xc008('0x22'),_0x3f0ecf,_0x36f358);_0x11ef38(_0x36f358);});});}function respondWithStatusCode(_0x5410f5,_0x48582b){_0x48582b=_0x48582b||0xcc;return function(_0x5de1e9){if(_0x5de1e9){return _0x5410f5[_0xc008('0x28')](_0x48582b);}return _0x5410f5[_0xc008('0x29')](_0x48582b)[_0xc008('0x2a')]();};}function respondWithResult(_0x2e31c2,_0x5bebd9){_0x5bebd9=_0x5bebd9||0xc8;return function(_0x5e2aca){if(_0x5e2aca){return _0x2e31c2['status'](_0x5bebd9)['json'](_0x5e2aca);}};}function respondWithFilteredResult(_0x4caaf4,_0x3865c0){return function(_0x29ba43){if(_0x29ba43){var _0x25eae4=_0x29ba43[_0xc008('0x2b')],_0x529961=_0x3865c0[_0xc008('0x2c')],_0x24c14c=_0x3865c0['offset']+_0x3865c0[_0xc008('0x2d')],_0x32390d;if(_0x24c14c>=_0x25eae4){_0x24c14c=_0x25eae4;_0x32390d=0xc8;}else{_0x32390d=0xce;}_0x4caaf4[_0xc008('0x29')](_0x32390d);return _0x4caaf4['set']('Content-Range',_0x529961+'-'+_0x24c14c+'/'+_0x25eae4)['json'](_0x29ba43);}return null;};}function patchUpdates(_0x1032b2){return function(_0x267abd){try{jsonpatch[_0xc008('0x2e')](_0x267abd,_0x1032b2,!![]);}catch(_0x10889f){return BPromise[_0xc008('0x2f')](_0x10889f);}return _0x267abd[_0xc008('0x30')]();};}function saveUpdates(_0x294f97,_0x22d8e8){return function(_0x1fe1e1){if(_0x1fe1e1){return _0x1fe1e1[_0xc008('0x31')](_0x294f97)[_0xc008('0x1e')](function(_0x1ac7c8){return _0x1ac7c8;});}return null;};}function removeEntity(_0x596ee8,_0x334a09){return function(_0x4b7fd4){if(_0x4b7fd4){return _0x4b7fd4['destroy']()[_0xc008('0x1e')](function(){_0x596ee8[_0xc008('0x29')](0xcc)[_0xc008('0x2a')]();});}};}function handleEntityNotFound(_0xca0520,_0xd0e05a){return function(_0x3cd878){if(!_0x3cd878){_0xca0520[_0xc008('0x28')](0x194);}return _0x3cd878;};}function handleError(_0x470e79,_0x29d4b3){_0x29d4b3=_0x29d4b3||0x1f4;return function(_0x4f14d2){logger[_0xc008('0x23')](_0x4f14d2[_0xc008('0x32')]);if(_0x4f14d2[_0xc008('0x33')]){delete _0x4f14d2[_0xc008('0x33')];}_0x470e79[_0xc008('0x29')](_0x29d4b3)[_0xc008('0x34')](_0x4f14d2);};}exports[_0xc008('0x35')]=function(_0x5d0e06,_0x35f360){var _0x21763f={},_0x50e1d4={},_0x399b64={'count':0x0,'rows':[]};var _0x15453c=_['map'](db[_0xc008('0x36')][_0xc008('0x37')],function(_0x280e9b){return{'name':_0x280e9b['fieldName'],'type':_0x280e9b['type']['key']};});_0x50e1d4[_0xc008('0x38')]=_['map'](_0x15453c,_0xc008('0x33'));_0x50e1d4[_0xc008('0x39')]=_[_0xc008('0x3a')](_0x5d0e06[_0xc008('0x39')]);_0x50e1d4[_0xc008('0x3b')]=_[_0xc008('0x3c')](_0x50e1d4[_0xc008('0x38')],_0x50e1d4[_0xc008('0x39')]);_0x21763f[_0xc008('0x3d')]=_[_0xc008('0x3c')](_0x50e1d4[_0xc008('0x38')],qs[_0xc008('0x3e')](_0x5d0e06[_0xc008('0x39')][_0xc008('0x3e')]));_0x21763f['attributes']=_0x21763f[_0xc008('0x3d')][_0xc008('0x3f')]?_0x21763f[_0xc008('0x3d')]:_0x50e1d4[_0xc008('0x38')];if(!_0x5d0e06['query'][_0xc008('0x40')](_0xc008('0x41'))){_0x21763f[_0xc008('0x2d')]=qs[_0xc008('0x2d')](_0x5d0e06[_0xc008('0x39')]['limit']);_0x21763f[_0xc008('0x2c')]=qs[_0xc008('0x2c')](_0x5d0e06[_0xc008('0x39')][_0xc008('0x2c')]);}_0x21763f[_0xc008('0x42')]=qs['sort'](_0x5d0e06[_0xc008('0x39')][_0xc008('0x43')]);_0x21763f[_0xc008('0x44')]=qs[_0xc008('0x3b')](_['pick'](_0x5d0e06[_0xc008('0x39')],_0x50e1d4[_0xc008('0x3b')]));if(_0x5d0e06[_0xc008('0x39')]['filter']){_0x21763f[_0xc008('0x44')]=_['merge'](_0x21763f[_0xc008('0x44')],{'$or':_['map'](_0x15453c,function(_0x46fa8f){if(_0x46fa8f[_0xc008('0x45')]!=='VIRTUAL'){var _0x31007c={};_0x31007c[_0x46fa8f[_0xc008('0x33')]]={'$like':'%'+_0x5d0e06[_0xc008('0x39')]['filter']+'%'};return _0x31007c;}})});}_0x21763f=_[_0xc008('0x46')]({},_0x21763f,_0x5d0e06[_0xc008('0x47')]);var _0x200469={'where':_0x21763f[_0xc008('0x44')]};return db[_0xc008('0x36')][_0xc008('0x2b')](_0x200469)['then'](function(_0x47cafa){_0x399b64['count']=_0x47cafa;if(_0x5d0e06[_0xc008('0x39')][_0xc008('0x48')]){_0x21763f[_0xc008('0x49')]=[{'all':!![]}];}return db[_0xc008('0x36')][_0xc008('0x4a')](_0x21763f);})[_0xc008('0x1e')](function(_0x2cf641){_0x399b64[_0xc008('0x4b')]=_0x2cf641;return _0x399b64;})['then'](respondWithFilteredResult(_0x35f360,_0x21763f))['catch'](handleError(_0x35f360,null));};exports['show']=function(_0x2d5a49,_0x2651cf){var _0x158eae={'raw':![],'where':{'id':_0x2d5a49[_0xc008('0x4c')]['id']}},_0x511383={};_0x511383[_0xc008('0x38')]=_[_0xc008('0x3a')](db[_0xc008('0x36')][_0xc008('0x37')]);_0x511383[_0xc008('0x39')]=_[_0xc008('0x3a')](_0x2d5a49[_0xc008('0x39')]);_0x511383[_0xc008('0x3b')]=_[_0xc008('0x3c')](_0x511383['model'],_0x511383['query']);_0x158eae[_0xc008('0x3d')]=_['intersection'](_0x511383[_0xc008('0x38')],qs[_0xc008('0x3e')](_0x2d5a49[_0xc008('0x39')]['fields']));_0x158eae[_0xc008('0x3d')]=_0x158eae[_0xc008('0x3d')][_0xc008('0x3f')]?_0x158eae[_0xc008('0x3d')]:_0x511383[_0xc008('0x38')];if(_0x2d5a49['query'][_0xc008('0x48')]){_0x158eae[_0xc008('0x49')]=[{'all':!![]}];}_0x158eae=_['merge']({},_0x158eae,_0x2d5a49[_0xc008('0x47')]);return db[_0xc008('0x36')]['find'](_0x158eae)['then'](handleEntityNotFound(_0x2651cf,null))[_0xc008('0x1e')](respondWithResult(_0x2651cf,null))[_0xc008('0x27')](handleError(_0x2651cf,null));};exports[_0xc008('0x4d')]=function(_0x30d0aa,_0x14b6a0){return db['ZohoConfiguration']['create'](_0x30d0aa[_0xc008('0x4e')],{})['then'](respondWithResult(_0x14b6a0,0xc9))[_0xc008('0x27')](handleError(_0x14b6a0,null));};exports[_0xc008('0x31')]=function(_0xf94fcb,_0x2f1105){if(_0xf94fcb[_0xc008('0x4e')]['id']){delete _0xf94fcb[_0xc008('0x4e')]['id'];}return db['ZohoConfiguration'][_0xc008('0x4f')]({'where':{'id':_0xf94fcb[_0xc008('0x4c')]['id']}})[_0xc008('0x1e')](handleEntityNotFound(_0x2f1105,null))[_0xc008('0x1e')](saveUpdates(_0xf94fcb[_0xc008('0x4e')],null))['then'](respondWithResult(_0x2f1105,null))[_0xc008('0x27')](handleError(_0x2f1105,null));};exports['destroy']=function(_0x535e6e,_0x5dbfca){return db[_0xc008('0x36')][_0xc008('0x4f')]({'where':{'id':_0x535e6e[_0xc008('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5dbfca,null))[_0xc008('0x1e')](removeEntity(_0x5dbfca,null))[_0xc008('0x27')](handleError(_0x5dbfca,null));};exports[_0xc008('0x50')]=function(_0x47a58b,_0x3587c3,_0x1092cb){var _0x12ba3f={};var _0x1b5a22={};var _0x5baff1;var _0x4022dd;return db['ZohoConfiguration'][_0xc008('0x51')]({'where':{'id':_0x47a58b[_0xc008('0x4c')]['id']}})[_0xc008('0x1e')](handleEntityNotFound(_0x3587c3,null))[_0xc008('0x1e')](function(_0x192c87){if(_0x192c87){_0x5baff1=_0x192c87;_0x1b5a22[_0xc008('0x38')]=_['keys'](db[_0xc008('0x52')]['rawAttributes']);_0x1b5a22['query']=_[_0xc008('0x3a')](_0x47a58b[_0xc008('0x39')]);_0x1b5a22['filters']=_[_0xc008('0x3c')](_0x1b5a22[_0xc008('0x38')],_0x1b5a22[_0xc008('0x39')]);_0x12ba3f[_0xc008('0x3d')]=_[_0xc008('0x3c')](_0x1b5a22[_0xc008('0x38')],qs[_0xc008('0x3e')](_0x47a58b['query'][_0xc008('0x3e')]));_0x12ba3f[_0xc008('0x3d')]=_0x12ba3f[_0xc008('0x3d')][_0xc008('0x3f')]?_0x12ba3f[_0xc008('0x3d')]:_0x1b5a22[_0xc008('0x38')];_0x12ba3f[_0xc008('0x42')]=qs[_0xc008('0x43')](_0x47a58b[_0xc008('0x39')][_0xc008('0x43')]);_0x12ba3f[_0xc008('0x44')]=qs[_0xc008('0x3b')](_[_0xc008('0x53')](_0x47a58b[_0xc008('0x39')],_0x1b5a22['filters']));if(_0x47a58b[_0xc008('0x39')][_0xc008('0x54')]){_0x12ba3f[_0xc008('0x44')]=_['merge'](_0x12ba3f[_0xc008('0x44')],{'$or':_[_0xc008('0x55')](_0x12ba3f['attributes'],function(_0x53765c){var _0x1a03fd={};_0x1a03fd[_0x53765c]={'$like':'%'+_0x47a58b[_0xc008('0x39')][_0xc008('0x54')]+'%'};return _0x1a03fd;})});}_0x12ba3f=_[_0xc008('0x46')]({},_0x12ba3f,_0x47a58b[_0xc008('0x47')]);return _0x5baff1[_0xc008('0x50')](_0x12ba3f);}})[_0xc008('0x1e')](function(_0x38191e){if(_0x38191e){_0x4022dd=_0x38191e[_0xc008('0x3f')];if(!_0x47a58b[_0xc008('0x39')][_0xc008('0x40')]('nolimit')){_0x12ba3f[_0xc008('0x2d')]=qs[_0xc008('0x2d')](_0x47a58b[_0xc008('0x39')][_0xc008('0x2d')]);_0x12ba3f['offset']=qs[_0xc008('0x2c')](_0x47a58b['query'][_0xc008('0x2c')]);}return _0x5baff1[_0xc008('0x50')](_0x12ba3f);}})[_0xc008('0x1e')](function(_0x4ccffe){if(_0x4ccffe){return _0x4ccffe?{'count':_0x4022dd,'rows':_0x4ccffe}:null;}})[_0xc008('0x1e')](respondWithResult(_0x3587c3,null))[_0xc008('0x27')](handleError(_0x3587c3,null));};exports[_0xc008('0x56')]=function(_0x553f5c,_0x35b28a,_0x539fc8){var _0x50ee03={};var _0xee7a85={};var _0x23012c;var _0x6fe732;return db[_0xc008('0x36')]['findOne']({'where':{'id':_0x553f5c[_0xc008('0x4c')]['id']}})[_0xc008('0x1e')](handleEntityNotFound(_0x35b28a,null))['then'](function(_0x3efb77){if(_0x3efb77){_0x23012c=_0x3efb77;_0xee7a85['model']=_[_0xc008('0x3a')](db['ZohoField'][_0xc008('0x37')]);_0xee7a85['query']=_[_0xc008('0x3a')](_0x553f5c[_0xc008('0x39')]);_0xee7a85[_0xc008('0x3b')]=_[_0xc008('0x3c')](_0xee7a85['model'],_0xee7a85[_0xc008('0x39')]);_0x50ee03[_0xc008('0x3d')]=_[_0xc008('0x3c')](_0xee7a85[_0xc008('0x38')],qs[_0xc008('0x3e')](_0x553f5c[_0xc008('0x39')][_0xc008('0x3e')]));_0x50ee03[_0xc008('0x3d')]=_0x50ee03['attributes'][_0xc008('0x3f')]?_0x50ee03['attributes']:_0xee7a85['model'];_0x50ee03['order']=qs[_0xc008('0x43')](_0x553f5c[_0xc008('0x39')][_0xc008('0x43')]);_0x50ee03[_0xc008('0x44')]=qs[_0xc008('0x3b')](_[_0xc008('0x53')](_0x553f5c[_0xc008('0x39')],_0xee7a85[_0xc008('0x3b')]));if(_0x553f5c[_0xc008('0x39')]['filter']){_0x50ee03[_0xc008('0x44')]=_[_0xc008('0x46')](_0x50ee03[_0xc008('0x44')],{'$or':_[_0xc008('0x55')](_0x50ee03[_0xc008('0x3d')],function(_0x3b2669){var _0x23d4ff={};_0x23d4ff[_0x3b2669]={'$like':'%'+_0x553f5c[_0xc008('0x39')][_0xc008('0x54')]+'%'};return _0x23d4ff;})});}_0x50ee03=_[_0xc008('0x46')]({},_0x50ee03,_0x553f5c[_0xc008('0x47')]);return _0x23012c[_0xc008('0x56')](_0x50ee03);}})['then'](function(_0x4e7af3){if(_0x4e7af3){_0x6fe732=_0x4e7af3[_0xc008('0x3f')];if(!_0x553f5c[_0xc008('0x39')][_0xc008('0x40')]('nolimit')){_0x50ee03[_0xc008('0x2d')]=qs[_0xc008('0x2d')](_0x553f5c['query']['limit']);_0x50ee03['offset']=qs[_0xc008('0x2c')](_0x553f5c[_0xc008('0x39')][_0xc008('0x2c')]);}return _0x23012c[_0xc008('0x56')](_0x50ee03);}})[_0xc008('0x1e')](function(_0x44f515){if(_0x44f515){return _0x44f515?{'count':_0x6fe732,'rows':_0x44f515}:null;}})[_0xc008('0x1e')](respondWithResult(_0x35b28a,null))[_0xc008('0x27')](handleError(_0x35b28a,null));};exports[_0xc008('0x57')]=function(_0x1e7a11,_0x52091b,_0x57b8ad){var _0xc644fe={};var _0x31ebde={};var _0x3f3dcf;var _0x3f1e41;return db[_0xc008('0x36')][_0xc008('0x51')]({'where':{'id':_0x1e7a11['params']['id']}})['then'](handleEntityNotFound(_0x52091b,null))[_0xc008('0x1e')](function(_0x391425){if(_0x391425){_0x3f3dcf=_0x391425;_0x31ebde[_0xc008('0x38')]=_['keys'](db['ZohoField']['rawAttributes']);_0x31ebde['query']=_['keys'](_0x1e7a11['query']);_0x31ebde[_0xc008('0x3b')]=_['intersection'](_0x31ebde[_0xc008('0x38')],_0x31ebde['query']);_0xc644fe[_0xc008('0x3d')]=_[_0xc008('0x3c')](_0x31ebde[_0xc008('0x38')],qs['fields'](_0x1e7a11['query'][_0xc008('0x3e')]));_0xc644fe['attributes']=_0xc644fe[_0xc008('0x3d')][_0xc008('0x3f')]?_0xc644fe['attributes']:_0x31ebde[_0xc008('0x38')];_0xc644fe['order']=qs['sort'](_0x1e7a11[_0xc008('0x39')][_0xc008('0x43')]);_0xc644fe['where']=qs[_0xc008('0x3b')](_[_0xc008('0x53')](_0x1e7a11[_0xc008('0x39')],_0x31ebde['filters']));if(_0x1e7a11[_0xc008('0x39')][_0xc008('0x54')]){_0xc644fe[_0xc008('0x44')]=_[_0xc008('0x46')](_0xc644fe[_0xc008('0x44')],{'$or':_[_0xc008('0x55')](_0xc644fe['attributes'],function(_0x6dfd99){var _0xdaff5b={};_0xdaff5b[_0x6dfd99]={'$like':'%'+_0x1e7a11[_0xc008('0x39')]['filter']+'%'};return _0xdaff5b;})});}_0xc644fe=_[_0xc008('0x46')]({},_0xc644fe,_0x1e7a11[_0xc008('0x47')]);return _0x3f3dcf[_0xc008('0x57')](_0xc644fe);}})['then'](function(_0x48c38b){if(_0x48c38b){_0x3f1e41=_0x48c38b['length'];if(!_0x1e7a11[_0xc008('0x39')][_0xc008('0x40')](_0xc008('0x41'))){_0xc644fe[_0xc008('0x2d')]=qs[_0xc008('0x2d')](_0x1e7a11[_0xc008('0x39')][_0xc008('0x2d')]);_0xc644fe[_0xc008('0x2c')]=qs['offset'](_0x1e7a11[_0xc008('0x39')][_0xc008('0x2c')]);}return _0x3f3dcf['getDescriptions'](_0xc644fe);}})['then'](function(_0x2257b0){if(_0x2257b0){return _0x2257b0?{'count':_0x3f1e41,'rows':_0x2257b0}:null;}})[_0xc008('0x1e')](respondWithResult(_0x52091b,null))[_0xc008('0x27')](handleError(_0x52091b,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index f0948b6..04fa31c 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 _0xae37=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','int_zoho_configurations','lodash','util','../../config/logger'];(function(_0x5ed5b7,_0x1354b5){var _0x54f9e6=function(_0x57f5e1){while(--_0x57f5e1){_0x5ed5b7['push'](_0x5ed5b7['shift']());}};_0x54f9e6(++_0x1354b5);}(_0xae37,0xcd));var _0x7ae3=function(_0x268b06,_0x446ed1){_0x268b06=_0x268b06-0x0;var _0x31d48b=_0xae37[_0x268b06];return _0x31d48b;};'use strict';var _=require(_0x7ae3('0x0'));var util=require(_0x7ae3('0x1'));var logger=require(_0x7ae3('0x2'))(_0x7ae3('0x3'));var moment=require(_0x7ae3('0x4'));var BPromise=require(_0x7ae3('0x5'));var rp=require(_0x7ae3('0x6'));var fs=require('fs');var path=require(_0x7ae3('0x7'));var rimraf=require(_0x7ae3('0x8'));var config=require(_0x7ae3('0x9'));var attributes=require('./intZohoConfiguration.attributes');module[_0x7ae3('0xa')]=function(_0x1df9ae,_0x3416f3){return _0x1df9ae[_0x7ae3('0xb')]('ZohoConfiguration',attributes,{'tableName':_0x7ae3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5380=['int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','ZohoConfiguration'];(function(_0x2d3c2d,_0x31aeda){var _0x4f38f4=function(_0x4f9703){while(--_0x4f9703){_0x2d3c2d['push'](_0x2d3c2d['shift']());}};_0x4f38f4(++_0x31aeda);}(_0x5380,0xde));var _0x0538=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5380[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x0538('0x0'));var util=require(_0x0538('0x1'));var logger=require(_0x0538('0x2'))(_0x0538('0x3'));var moment=require(_0x0538('0x4'));var BPromise=require(_0x0538('0x5'));var rp=require(_0x0538('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0538('0x7'));var config=require(_0x0538('0x8'));var attributes=require(_0x0538('0x9'));module[_0x0538('0xa')]=function(_0x39e25a,_0xbbb039){return _0x39e25a['define'](_0x0538('0xb'),attributes,{'tableName':_0x0538('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index a8da434..b490b9d 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 _0x1273=['debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x2f8e6e,_0x5cdafb){var _0x5ef9ad=function(_0x14f2b4){while(--_0x14f2b4){_0x2f8e6e['push'](_0x2f8e6e['shift']());}};_0x5ef9ad(++_0x5cdafb);}(_0x1273,0xf2));var _0x3127=function(_0x38884a,_0x3d68d6){_0x38884a=_0x38884a-0x0;var _0x22cf77=_0x1273[_0x38884a];return _0x22cf77;};'use strict';var _=require('lodash');var util=require(_0x3127('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3127('0x1'));var fs=require('fs');var Redis=require(_0x3127('0x2'));var db=require(_0x3127('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3127('0x4'));var config=require(_0x3127('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x75b7c3,_0x2d9564,_0x24eb81){return new BPromise(function(_0x4e3ae9,_0x382a42){return client[_0x3127('0x6')](_0x75b7c3,_0x24eb81)['then'](function(_0x396973){logger[_0x3127('0x7')](_0x3127('0x8'),_0x2d9564,_0x3127('0x9'));logger[_0x3127('0xa')](_0x3127('0xb'),_0x2d9564,'request\x20sent',JSON[_0x3127('0xc')](_0x396973));if(_0x396973['error']){if(_0x396973[_0x3127('0xd')][_0x3127('0xe')]===0x1f4){logger[_0x3127('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x2d9564,_0x396973[_0x3127('0xd')][_0x3127('0xf')]);return _0x382a42(_0x396973['error']['message']);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x2d9564,_0x396973[_0x3127('0xd')][_0x3127('0xf')]);return _0x4e3ae9(_0x396973[_0x3127('0xd')][_0x3127('0xf')]);}else{logger[_0x3127('0x7')](_0x3127('0x8'),_0x2d9564,_0x3127('0x9'));_0x4e3ae9(_0x396973[_0x3127('0x10')]['message']);}})[_0x3127('0x11')](function(_0x4959bb){logger['error'](_0x3127('0x8'),_0x2d9564,_0x4959bb);_0x382a42(_0x4959bb);});});} \ No newline at end of file +var _0x8856=['ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x4bf865,_0x2c68eb){var _0x3c96f7=function(_0x3bb091){while(--_0x3bb091){_0x4bf865['push'](_0x4bf865['shift']());}};_0x3c96f7(++_0x2c68eb);}(_0x8856,0xa3));var _0x6885=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8856[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x6885('0x0'));var moment=require(_0x6885('0x1'));var BPromise=require(_0x6885('0x2'));var rs=require(_0x6885('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6885('0x4'))['db'];var utils=require(_0x6885('0x5'));var logger=require(_0x6885('0x6'))(_0x6885('0x7'));var config=require(_0x6885('0x8'));var jayson=require(_0x6885('0x9'));var client=jayson[_0x6885('0xa')][_0x6885('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x56ecbf,_0x2b2413,_0x3b3b23){return new BPromise(function(_0x4b960a,_0x2bc0e4){return client['request'](_0x56ecbf,_0x3b3b23)[_0x6885('0xc')](function(_0x5723a5){logger['info'](_0x6885('0xd'),_0x2b2413,_0x6885('0xe'));logger['debug'](_0x6885('0xf'),_0x2b2413,_0x6885('0xe'),JSON[_0x6885('0x10')](_0x5723a5));if(_0x5723a5[_0x6885('0x11')]){if(_0x5723a5[_0x6885('0x11')][_0x6885('0x12')]===0x1f4){logger[_0x6885('0x11')](_0x6885('0xd'),_0x2b2413,_0x5723a5[_0x6885('0x11')][_0x6885('0x13')]);return _0x2bc0e4(_0x5723a5[_0x6885('0x11')][_0x6885('0x13')]);}logger[_0x6885('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x2b2413,_0x5723a5[_0x6885('0x11')][_0x6885('0x13')]);return _0x4b960a(_0x5723a5['error'][_0x6885('0x13')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x2b2413,'request\x20sent');_0x4b960a(_0x5723a5[_0x6885('0x14')][_0x6885('0x13')]);}})[_0x6885('0x15')](function(_0x43fc94){logger[_0x6885('0x11')](_0x6885('0xd'),_0x2b2413,_0x43fc94);_0x2bc0e4(_0x43fc94);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 0e68e7b..2a6a956 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 _0x4bd3=['isAuthenticated','index','/:id','post','create','put','delete','destroy','multer','path','connect-timeout','../../components/interaction/service','../../config/environment','./intZohoField.controller'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4bd3,0x174));var _0x34bd=function(_0x26e2a7,_0xb9a32e){_0x26e2a7=_0x26e2a7-0x0;var _0x40d6f3=_0x4bd3[_0x26e2a7];return _0x40d6f3;};'use strict';var multer=require(_0x34bd('0x0'));var util=require('util');var path=require(_0x34bd('0x1'));var timeout=require(_0x34bd('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x34bd('0x3'));var config=require(_0x34bd('0x4'));var controller=require(_0x34bd('0x5'));router['get']('/',auth[_0x34bd('0x6')](),controller[_0x34bd('0x7')]);router['get'](_0x34bd('0x8'),auth[_0x34bd('0x6')](),controller['show']);router[_0x34bd('0x9')]('/',auth[_0x34bd('0x6')](),controller[_0x34bd('0xa')]);router[_0x34bd('0xb')](_0x34bd('0x8'),auth[_0x34bd('0x6')](),controller['update']);router[_0x34bd('0xc')](_0x34bd('0x8'),auth[_0x34bd('0x6')](),controller[_0x34bd('0xd')]);module['exports']=router; \ No newline at end of file +var _0x7880=['Router','../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','util','path','connect-timeout','express'];(function(_0x35f4f6,_0x29131d){var _0x516d9f=function(_0x281f97){while(--_0x281f97){_0x35f4f6['push'](_0x35f4f6['shift']());}};_0x516d9f(++_0x29131d);}(_0x7880,0x1f4));var _0x0788=function(_0x5f2503,_0x4a3261){_0x5f2503=_0x5f2503-0x0;var _0x1def2d=_0x7880[_0x5f2503];return _0x1def2d;};'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/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 0086fda..005daae 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 _0x24ca=['sequelize','string','customVariable','keyValue','STRING','ENUM','BOOLEAN'];(function(_0x3ac3a6,_0x229a91){var _0x43af9f=function(_0x37ba17){while(--_0x37ba17){_0x3ac3a6['push'](_0x3ac3a6['shift']());}};_0x43af9f(++_0x229a91);}(_0x24ca,0x8c));var _0xa24c=function(_0x2a8860,_0x2da926){_0x2a8860=_0x2a8860-0x0;var _0x2f47a4=_0x24ca[_0x2a8860];return _0x2f47a4;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xa24c('0x1'),'variable',_0xa24c('0x2'),_0xa24c('0x3')),'defaultValue':_0xa24c('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa24c('0x4')]},'keyType':{'type':Sequelize[_0xa24c('0x5')](_0xa24c('0x1'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xa24c('0x4')]},'nameField':{'type':Sequelize[_0xa24c('0x4')]},'customField':{'type':Sequelize[_0xa24c('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa24c('0x4')]}}; \ No newline at end of file +var _0x48c6=['variable','keyValue','STRING','ENUM','BOOLEAN','sequelize','exports','string'];(function(_0x3678f9,_0x4bde37){var _0x112099=function(_0xef59e1){while(--_0xef59e1){_0x3678f9['push'](_0x3678f9['shift']());}};_0x112099(++_0x4bde37);}(_0x48c6,0x17d));var _0x648c=function(_0x23bcc5,_0x211517){_0x23bcc5=_0x23bcc5-0x0;var _0x22c034=_0x48c6[_0x23bcc5];return _0x22c034;};'use strict';var Sequelize=require(_0x648c('0x0'));module[_0x648c('0x1')]={'type':{'type':Sequelize['ENUM'](_0x648c('0x2'),_0x648c('0x3'),'customVariable',_0x648c('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x648c('0x5')]},'key':{'type':Sequelize[_0x648c('0x5')]},'keyType':{'type':Sequelize[_0x648c('0x6')](_0x648c('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x648c('0x5')]},'nameField':{'type':Sequelize[_0x648c('0x5')]},'customField':{'type':Sequelize[_0x648c('0x7')],'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 c05b270..6ff70d6 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 _0x5582=['filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','update','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','then','destroy','end','name','index','map','ZohoField','key','model','query','keys'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5582,0x67));var _0x2558=function(_0x936389,_0x21883d){_0x936389=_0x936389-0x0;var _0x1aeb3a=_0x5582[_0x936389];return _0x1aeb3a;};'use strict';var pdf=require(_0x2558('0x0'));var emlformat=require(_0x2558('0x1'));var rimraf=require(_0x2558('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2558('0x3'));var rp=require(_0x2558('0x4'));var moment=require(_0x2558('0x5'));var BPromise=require(_0x2558('0x6'));var Mustache=require('mustache');var util=require(_0x2558('0x7'));var path=require(_0x2558('0x8'));var sox=require(_0x2558('0x9'));var csv=require(_0x2558('0xa'));var ejs=require(_0x2558('0xb'));var fs=require('fs');var _=require(_0x2558('0xc'));var squel=require(_0x2558('0xd'));var crypto=require(_0x2558('0xe'));var jsforce=require(_0x2558('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2558('0x10'));var Papa=require(_0x2558('0x11'));var Redis=require('ioredis');var authService=require(_0x2558('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2558('0x13'));var hardwareService=require(_0x2558('0x14'));var logger=require(_0x2558('0x15'))('api');var utils=require(_0x2558('0x16'));var config=require(_0x2558('0x17'));var db=require(_0x2558('0x18'))['db'];function respondWithStatusCode(_0x9c12f8,_0x1b7aec){_0x1b7aec=_0x1b7aec||0xcc;return function(_0x4c88d2){if(_0x4c88d2){return _0x9c12f8[_0x2558('0x19')](_0x1b7aec);}return _0x9c12f8[_0x2558('0x1a')](_0x1b7aec)['end']();};}function respondWithResult(_0xad5073,_0x4f2481){_0x4f2481=_0x4f2481||0xc8;return function(_0x42b350){if(_0x42b350){return _0xad5073[_0x2558('0x1a')](_0x4f2481)[_0x2558('0x1b')](_0x42b350);}};}function respondWithFilteredResult(_0x3b176f,_0x3546e3){return function(_0x52c275){if(_0x52c275){var _0x158a47=_0x52c275['count'],_0x3cbeb1=_0x3546e3[_0x2558('0x1c')],_0x164683=_0x3546e3[_0x2558('0x1c')]+_0x3546e3[_0x2558('0x1d')],_0x569234;if(_0x164683>=_0x158a47){_0x164683=_0x158a47;_0x569234=0xc8;}else{_0x569234=0xce;}_0x3b176f[_0x2558('0x1a')](_0x569234);return _0x3b176f['set'](_0x2558('0x1e'),_0x3cbeb1+'-'+_0x164683+'/'+_0x158a47)[_0x2558('0x1b')](_0x52c275);}return null;};}function patchUpdates(_0x4fe218){return function(_0x5df1cd){try{jsonpatch[_0x2558('0x1f')](_0x5df1cd,_0x4fe218,!![]);}catch(_0x5399ee){return BPromise[_0x2558('0x20')](_0x5399ee);}return _0x5df1cd[_0x2558('0x21')]();};}function saveUpdates(_0x55b8f7,_0x1980a9){return function(_0x166f54){if(_0x166f54){return _0x166f54['update'](_0x55b8f7)[_0x2558('0x22')](function(_0x3c34a5){return _0x3c34a5;});}return null;};}function removeEntity(_0x2dd980,_0x5aad76){return function(_0x10579e){if(_0x10579e){return _0x10579e[_0x2558('0x23')]()[_0x2558('0x22')](function(){_0x2dd980[_0x2558('0x1a')](0xcc)[_0x2558('0x24')]();});}};}function handleEntityNotFound(_0x142aab,_0x149441){return function(_0x5e4560){if(!_0x5e4560){_0x142aab[_0x2558('0x19')](0x194);}return _0x5e4560;};}function handleError(_0x2620a6,_0x2ae5ac){_0x2ae5ac=_0x2ae5ac||0x1f4;return function(_0x54ab31){logger['error'](_0x54ab31['stack']);if(_0x54ab31[_0x2558('0x25')]){delete _0x54ab31[_0x2558('0x25')];}_0x2620a6[_0x2558('0x1a')](_0x2ae5ac)['send'](_0x54ab31);};}exports[_0x2558('0x26')]=function(_0x132006,_0x4bcce5){var _0x58f399={},_0x3367f6={},_0x367c32={'count':0x0,'rows':[]};var _0x2ddf03=_[_0x2558('0x27')](db[_0x2558('0x28')]['rawAttributes'],function(_0x53f93e){return{'name':_0x53f93e['fieldName'],'type':_0x53f93e['type'][_0x2558('0x29')]};});_0x3367f6[_0x2558('0x2a')]=_[_0x2558('0x27')](_0x2ddf03,_0x2558('0x25'));_0x3367f6[_0x2558('0x2b')]=_[_0x2558('0x2c')](_0x132006[_0x2558('0x2b')]);_0x3367f6[_0x2558('0x2d')]=_[_0x2558('0x2e')](_0x3367f6['model'],_0x3367f6['query']);_0x58f399[_0x2558('0x2f')]=_[_0x2558('0x2e')](_0x3367f6['model'],qs[_0x2558('0x30')](_0x132006['query'][_0x2558('0x30')]));_0x58f399[_0x2558('0x2f')]=_0x58f399['attributes']['length']?_0x58f399['attributes']:_0x3367f6[_0x2558('0x2a')];if(!_0x132006[_0x2558('0x2b')][_0x2558('0x31')](_0x2558('0x32'))){_0x58f399[_0x2558('0x1d')]=qs[_0x2558('0x1d')](_0x132006[_0x2558('0x2b')][_0x2558('0x1d')]);_0x58f399[_0x2558('0x1c')]=qs[_0x2558('0x1c')](_0x132006['query'][_0x2558('0x1c')]);}_0x58f399[_0x2558('0x33')]=qs[_0x2558('0x34')](_0x132006['query']['sort']);_0x58f399[_0x2558('0x35')]=qs['filters'](_[_0x2558('0x36')](_0x132006[_0x2558('0x2b')],_0x3367f6[_0x2558('0x2d')]));if(_0x132006[_0x2558('0x2b')][_0x2558('0x37')]){_0x58f399[_0x2558('0x35')]=_[_0x2558('0x38')](_0x58f399[_0x2558('0x35')],{'$or':_['map'](_0x2ddf03,function(_0x2586bb){if(_0x2586bb[_0x2558('0x39')]!==_0x2558('0x3a')){var _0x341bc1={};_0x341bc1[_0x2586bb[_0x2558('0x25')]]={'$like':'%'+_0x132006[_0x2558('0x2b')]['filter']+'%'};return _0x341bc1;}})});}_0x58f399=_[_0x2558('0x38')]({},_0x58f399,_0x132006[_0x2558('0x3b')]);var _0x2d95e2={'where':_0x58f399[_0x2558('0x35')]};return db[_0x2558('0x28')][_0x2558('0x3c')](_0x2d95e2)[_0x2558('0x22')](function(_0x7243a7){_0x367c32[_0x2558('0x3c')]=_0x7243a7;if(_0x132006[_0x2558('0x2b')][_0x2558('0x3d')]){_0x58f399[_0x2558('0x3e')]=[{'all':!![]}];}return db[_0x2558('0x28')][_0x2558('0x3f')](_0x58f399);})[_0x2558('0x22')](function(_0x3c013a){_0x367c32[_0x2558('0x40')]=_0x3c013a;return _0x367c32;})[_0x2558('0x22')](respondWithFilteredResult(_0x4bcce5,_0x58f399))[_0x2558('0x41')](handleError(_0x4bcce5,null));};exports[_0x2558('0x42')]=function(_0x23891c,_0x609cf5){var _0x3a13fd={'raw':!![],'where':{'id':_0x23891c[_0x2558('0x43')]['id']}},_0x31e274={};_0x31e274[_0x2558('0x2a')]=_['keys'](db[_0x2558('0x28')][_0x2558('0x44')]);_0x31e274[_0x2558('0x2b')]=_[_0x2558('0x2c')](_0x23891c[_0x2558('0x2b')]);_0x31e274[_0x2558('0x2d')]=_['intersection'](_0x31e274[_0x2558('0x2a')],_0x31e274[_0x2558('0x2b')]);_0x3a13fd[_0x2558('0x2f')]=_['intersection'](_0x31e274[_0x2558('0x2a')],qs[_0x2558('0x30')](_0x23891c['query']['fields']));_0x3a13fd['attributes']=_0x3a13fd[_0x2558('0x2f')][_0x2558('0x45')]?_0x3a13fd[_0x2558('0x2f')]:_0x31e274[_0x2558('0x2a')];if(_0x23891c['query'][_0x2558('0x3d')]){_0x3a13fd[_0x2558('0x3e')]=[{'all':!![]}];}_0x3a13fd=_[_0x2558('0x38')]({},_0x3a13fd,_0x23891c[_0x2558('0x3b')]);return db[_0x2558('0x28')][_0x2558('0x46')](_0x3a13fd)[_0x2558('0x22')](handleEntityNotFound(_0x609cf5,null))[_0x2558('0x22')](respondWithResult(_0x609cf5,null))[_0x2558('0x41')](handleError(_0x609cf5,null));};exports[_0x2558('0x47')]=function(_0x3d1668,_0x52f1d7){return db[_0x2558('0x28')][_0x2558('0x47')](_0x3d1668[_0x2558('0x48')],{})[_0x2558('0x22')](respondWithResult(_0x52f1d7,0xc9))[_0x2558('0x41')](handleError(_0x52f1d7,null));};exports[_0x2558('0x49')]=function(_0x4879f1,_0x589339){if(_0x4879f1[_0x2558('0x48')]['id']){delete _0x4879f1[_0x2558('0x48')]['id'];}return db['ZohoField'][_0x2558('0x46')]({'where':{'id':_0x4879f1[_0x2558('0x43')]['id']}})[_0x2558('0x22')](handleEntityNotFound(_0x589339,null))[_0x2558('0x22')](saveUpdates(_0x4879f1['body'],null))['then'](respondWithResult(_0x589339,null))[_0x2558('0x41')](handleError(_0x589339,null));};exports[_0x2558('0x23')]=function(_0x5732e4,_0x4c4aa6){return db[_0x2558('0x28')]['find']({'where':{'id':_0x5732e4[_0x2558('0x43')]['id']}})[_0x2558('0x22')](handleEntityNotFound(_0x4c4aa6,null))[_0x2558('0x22')](removeEntity(_0x4c4aa6,null))[_0x2558('0x41')](handleError(_0x4c4aa6,null));}; \ No newline at end of file +var _0x878c=['options','includeAll','include','findAll','rows','catch','rawAttributes','keys','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','ZohoField','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL'];(function(_0x1c41c8,_0x42ab53){var _0x4b368a=function(_0xbc0967){while(--_0xbc0967){_0x1c41c8['push'](_0x1c41c8['shift']());}};_0x4b368a(++_0x42ab53);}(_0x878c,0x138));var _0xc878=function(_0x5032e9,_0x8c67c9){_0x5032e9=_0x5032e9-0x0;var _0x4d2550=_0x878c[_0x5032e9];return _0x4d2550;};'use strict';var pdf=require(_0xc878('0x0'));var emlformat=require(_0xc878('0x1'));var rimraf=require(_0xc878('0x2'));var zipdir=require(_0xc878('0x3'));var jsonpatch=require(_0xc878('0x4'));var rp=require(_0xc878('0x5'));var moment=require('moment');var BPromise=require(_0xc878('0x6'));var Mustache=require(_0xc878('0x7'));var util=require(_0xc878('0x8'));var path=require(_0xc878('0x9'));var sox=require(_0xc878('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xc878('0xb'));var squel=require(_0xc878('0xc'));var crypto=require(_0xc878('0xd'));var jsforce=require(_0xc878('0xe'));var deskjs=require(_0xc878('0xf'));var toCsv=require(_0xc878('0x10'));var querystring=require(_0xc878('0x11'));var Papa=require(_0xc878('0x12'));var Redis=require(_0xc878('0x13'));var authService=require(_0xc878('0x14'));var qs=require(_0xc878('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc878('0x16'));var logger=require('../../config/logger')(_0xc878('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c9c56,_0x3560df){_0x3560df=_0x3560df||0xcc;return function(_0x4ada9e){if(_0x4ada9e){return _0x2c9c56[_0xc878('0x18')](_0x3560df);}return _0x2c9c56[_0xc878('0x19')](_0x3560df)[_0xc878('0x1a')]();};}function respondWithResult(_0x2d7382,_0x2c1b1a){_0x2c1b1a=_0x2c1b1a||0xc8;return function(_0x53dc26){if(_0x53dc26){return _0x2d7382['status'](_0x2c1b1a)[_0xc878('0x1b')](_0x53dc26);}};}function respondWithFilteredResult(_0x5491eb,_0x5714d4){return function(_0x1a27eb){if(_0x1a27eb){var _0x5f1253=_0x1a27eb[_0xc878('0x1c')],_0x1e1fbc=_0x5714d4['offset'],_0x149010=_0x5714d4[_0xc878('0x1d')]+_0x5714d4[_0xc878('0x1e')],_0x5bde43;if(_0x149010>=_0x5f1253){_0x149010=_0x5f1253;_0x5bde43=0xc8;}else{_0x5bde43=0xce;}_0x5491eb[_0xc878('0x19')](_0x5bde43);return _0x5491eb[_0xc878('0x1f')](_0xc878('0x20'),_0x1e1fbc+'-'+_0x149010+'/'+_0x5f1253)[_0xc878('0x1b')](_0x1a27eb);}return null;};}function patchUpdates(_0x4631dd){return function(_0x494d75){try{jsonpatch['apply'](_0x494d75,_0x4631dd,!![]);}catch(_0x3b22c4){return BPromise[_0xc878('0x21')](_0x3b22c4);}return _0x494d75['save']();};}function saveUpdates(_0x386f93,_0x144164){return function(_0x107c52){if(_0x107c52){return _0x107c52[_0xc878('0x22')](_0x386f93)[_0xc878('0x23')](function(_0x2684b3){return _0x2684b3;});}return null;};}function removeEntity(_0x11e2a9,_0x2339dd){return function(_0x29cd86){if(_0x29cd86){return _0x29cd86[_0xc878('0x24')]()[_0xc878('0x23')](function(){_0x11e2a9['status'](0xcc)[_0xc878('0x1a')]();});}};}function handleEntityNotFound(_0x10519b,_0x13e9f6){return function(_0x13ffb0){if(!_0x13ffb0){_0x10519b[_0xc878('0x18')](0x194);}return _0x13ffb0;};}function handleError(_0x1cb327,_0x39f13f){_0x39f13f=_0x39f13f||0x1f4;return function(_0x3af8e0){logger[_0xc878('0x25')](_0x3af8e0[_0xc878('0x26')]);if(_0x3af8e0[_0xc878('0x27')]){delete _0x3af8e0['name'];}_0x1cb327[_0xc878('0x19')](_0x39f13f)[_0xc878('0x28')](_0x3af8e0);};}exports[_0xc878('0x29')]=function(_0x2b8f57,_0xf411a1){var _0x2e6e73={},_0x476547={},_0x187232={'count':0x0,'rows':[]};var _0x3b0161=_[_0xc878('0x2a')](db[_0xc878('0x2b')]['rawAttributes'],function(_0x5af7f1){return{'name':_0x5af7f1[_0xc878('0x2c')],'type':_0x5af7f1['type'][_0xc878('0x2d')]};});_0x476547[_0xc878('0x2e')]=_[_0xc878('0x2a')](_0x3b0161,'name');_0x476547[_0xc878('0x2f')]=_['keys'](_0x2b8f57[_0xc878('0x2f')]);_0x476547['filters']=_[_0xc878('0x30')](_0x476547[_0xc878('0x2e')],_0x476547['query']);_0x2e6e73['attributes']=_['intersection'](_0x476547[_0xc878('0x2e')],qs['fields'](_0x2b8f57[_0xc878('0x2f')][_0xc878('0x31')]));_0x2e6e73[_0xc878('0x32')]=_0x2e6e73[_0xc878('0x32')][_0xc878('0x33')]?_0x2e6e73['attributes']:_0x476547[_0xc878('0x2e')];if(!_0x2b8f57['query'][_0xc878('0x34')](_0xc878('0x35'))){_0x2e6e73['limit']=qs[_0xc878('0x1e')](_0x2b8f57[_0xc878('0x2f')]['limit']);_0x2e6e73[_0xc878('0x1d')]=qs['offset'](_0x2b8f57[_0xc878('0x2f')]['offset']);}_0x2e6e73[_0xc878('0x36')]=qs[_0xc878('0x37')](_0x2b8f57[_0xc878('0x2f')][_0xc878('0x37')]);_0x2e6e73[_0xc878('0x38')]=qs[_0xc878('0x39')](_[_0xc878('0x3a')](_0x2b8f57[_0xc878('0x2f')],_0x476547[_0xc878('0x39')]));if(_0x2b8f57[_0xc878('0x2f')][_0xc878('0x3b')]){_0x2e6e73[_0xc878('0x38')]=_[_0xc878('0x3c')](_0x2e6e73[_0xc878('0x38')],{'$or':_[_0xc878('0x2a')](_0x3b0161,function(_0x588dc2){if(_0x588dc2[_0xc878('0x3d')]!==_0xc878('0x3e')){var _0x29271e={};_0x29271e[_0x588dc2[_0xc878('0x27')]]={'$like':'%'+_0x2b8f57['query']['filter']+'%'};return _0x29271e;}})});}_0x2e6e73=_[_0xc878('0x3c')]({},_0x2e6e73,_0x2b8f57[_0xc878('0x3f')]);var _0x1f6f03={'where':_0x2e6e73['where']};return db[_0xc878('0x2b')]['count'](_0x1f6f03)[_0xc878('0x23')](function(_0x13d991){_0x187232[_0xc878('0x1c')]=_0x13d991;if(_0x2b8f57[_0xc878('0x2f')][_0xc878('0x40')]){_0x2e6e73[_0xc878('0x41')]=[{'all':!![]}];}return db['ZohoField'][_0xc878('0x42')](_0x2e6e73);})[_0xc878('0x23')](function(_0x893d5a){_0x187232[_0xc878('0x43')]=_0x893d5a;return _0x187232;})[_0xc878('0x23')](respondWithFilteredResult(_0xf411a1,_0x2e6e73))[_0xc878('0x44')](handleError(_0xf411a1,null));};exports['show']=function(_0x5c87c9,_0x1d4a90){var _0x4378fb={'raw':!![],'where':{'id':_0x5c87c9['params']['id']}},_0x666840={};_0x666840['model']=_['keys'](db['ZohoField'][_0xc878('0x45')]);_0x666840[_0xc878('0x2f')]=_[_0xc878('0x46')](_0x5c87c9['query']);_0x666840['filters']=_[_0xc878('0x30')](_0x666840[_0xc878('0x2e')],_0x666840[_0xc878('0x2f')]);_0x4378fb[_0xc878('0x32')]=_[_0xc878('0x30')](_0x666840['model'],qs[_0xc878('0x31')](_0x5c87c9[_0xc878('0x2f')]['fields']));_0x4378fb[_0xc878('0x32')]=_0x4378fb[_0xc878('0x32')][_0xc878('0x33')]?_0x4378fb['attributes']:_0x666840[_0xc878('0x2e')];if(_0x5c87c9['query'][_0xc878('0x40')]){_0x4378fb[_0xc878('0x41')]=[{'all':!![]}];}_0x4378fb=_[_0xc878('0x3c')]({},_0x4378fb,_0x5c87c9[_0xc878('0x3f')]);return db[_0xc878('0x2b')][_0xc878('0x47')](_0x4378fb)[_0xc878('0x23')](handleEntityNotFound(_0x1d4a90,null))[_0xc878('0x23')](respondWithResult(_0x1d4a90,null))['catch'](handleError(_0x1d4a90,null));};exports[_0xc878('0x48')]=function(_0x8ccb86,_0x138dd0){return db['ZohoField'][_0xc878('0x48')](_0x8ccb86[_0xc878('0x49')],{})[_0xc878('0x23')](respondWithResult(_0x138dd0,0xc9))[_0xc878('0x44')](handleError(_0x138dd0,null));};exports[_0xc878('0x22')]=function(_0x297602,_0xf93a0c){if(_0x297602[_0xc878('0x49')]['id']){delete _0x297602[_0xc878('0x49')]['id'];}return db[_0xc878('0x2b')][_0xc878('0x47')]({'where':{'id':_0x297602[_0xc878('0x4a')]['id']}})[_0xc878('0x23')](handleEntityNotFound(_0xf93a0c,null))['then'](saveUpdates(_0x297602[_0xc878('0x49')],null))['then'](respondWithResult(_0xf93a0c,null))[_0xc878('0x44')](handleError(_0xf93a0c,null));};exports[_0xc878('0x24')]=function(_0x2a17f8,_0x40927f){return db['ZohoField'][_0xc878('0x47')]({'where':{'id':_0x2a17f8[_0xc878('0x4a')]['id']}})[_0xc878('0x23')](handleEntityNotFound(_0x40927f,null))[_0xc878('0x23')](removeEntity(_0x40927f,null))[_0xc878('0x44')](handleError(_0x40927f,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 65ce5b6..76e2804 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 _0x041d=['FieldId','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField'];(function(_0x50247d,_0x379935){var _0x2fd743=function(_0x1d0083){while(--_0x1d0083){_0x50247d['push'](_0x50247d['shift']());}};_0x2fd743(++_0x379935);}(_0x041d,0x141));var _0xd041=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x041d[_0x4b7895];return _0x264180;};'use strict';var _=require(_0xd041('0x0'));var util=require(_0xd041('0x1'));var logger=require('../../config/logger')(_0xd041('0x2'));var moment=require('moment');var BPromise=require(_0xd041('0x3'));var rp=require(_0xd041('0x4'));var fs=require('fs');var path=require(_0xd041('0x5'));var rimraf=require(_0xd041('0x6'));var config=require(_0xd041('0x7'));var attributes=require(_0xd041('0x8'));module[_0xd041('0x9')]=function(_0x473853,_0x364f08){return _0x473853[_0xd041('0xa')](_0xd041('0xb'),attributes,{'tableName':_0xd041('0xc'),'paranoid':![],'indexes':[{'name':_0xd041('0xd'),'fields':[_0xd041('0xe'),_0xd041('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe847=['exports','define','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./intZohoField.attributes'];(function(_0x15c815,_0x96b3a4){var _0x458757=function(_0x9373eb){while(--_0x9373eb){_0x15c815['push'](_0x15c815['shift']());}};_0x458757(++_0x96b3a4);}(_0xe847,0x13a));var _0x7e84=function(_0x9b578b,_0x4081c0){_0x9b578b=_0x9b578b-0x0;var _0x18f6ef=_0xe847[_0x9b578b];return _0x18f6ef;};'use strict';var _=require(_0x7e84('0x0'));var util=require('util');var logger=require(_0x7e84('0x1'))(_0x7e84('0x2'));var moment=require(_0x7e84('0x3'));var BPromise=require(_0x7e84('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7e84('0x5'));var rimraf=require(_0x7e84('0x6'));var config=require('../../config/environment');var attributes=require(_0x7e84('0x7'));module[_0x7e84('0x8')]=function(_0x3319f0,_0x515ecf){return _0x3319f0[_0x7e84('0x9')]('ZohoField',attributes,{'tableName':_0x7e84('0xa'),'paranoid':![],'indexes':[{'name':_0x7e84('0xb'),'fields':[_0x7e84('0xc'),_0x7e84('0xd')],'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 03066d9..a0b1efa 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 _0xee14=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','ZohoField,\x20%s,\x20%s','message','result','catch','moment'];(function(_0x526894,_0x12b7a1){var _0x4cba37=function(_0xb85cb6){while(--_0xb85cb6){_0x526894['push'](_0x526894['shift']());}};_0x4cba37(++_0x12b7a1);}(_0xee14,0x13a));var _0x4ee1=function(_0x5158f5,_0xcc31ac){_0x5158f5=_0x5158f5-0x0;var _0x2077e8=_0xee14[_0x5158f5];return _0x2077e8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4ee1('0x0'));var BPromise=require(_0x4ee1('0x1'));var rs=require(_0x4ee1('0x2'));var fs=require('fs');var Redis=require(_0x4ee1('0x3'));var db=require(_0x4ee1('0x4'))['db'];var utils=require(_0x4ee1('0x5'));var logger=require(_0x4ee1('0x6'))(_0x4ee1('0x7'));var config=require(_0x4ee1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4ee1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x327c18,_0x3a45a3,_0x187656){return new BPromise(function(_0x293d5f,_0xdfe9c1){return client[_0x4ee1('0xa')](_0x327c18,_0x187656)['then'](function(_0x33dbe6){logger[_0x4ee1('0xb')]('ZohoField,\x20%s,\x20%s',_0x3a45a3,_0x4ee1('0xc'));logger[_0x4ee1('0xd')](_0x4ee1('0xe'),_0x3a45a3,_0x4ee1('0xc'),JSON['stringify'](_0x33dbe6));if(_0x33dbe6[_0x4ee1('0xf')]){if(_0x33dbe6[_0x4ee1('0xf')][_0x4ee1('0x10')]===0x1f4){logger[_0x4ee1('0xf')](_0x4ee1('0x11'),_0x3a45a3,_0x33dbe6[_0x4ee1('0xf')]['message']);return _0xdfe9c1(_0x33dbe6[_0x4ee1('0xf')][_0x4ee1('0x12')]);}logger[_0x4ee1('0xf')](_0x4ee1('0x11'),_0x3a45a3,_0x33dbe6[_0x4ee1('0xf')][_0x4ee1('0x12')]);return _0x293d5f(_0x33dbe6[_0x4ee1('0xf')][_0x4ee1('0x12')]);}else{logger[_0x4ee1('0xb')]('ZohoField,\x20%s,\x20%s',_0x3a45a3,_0x4ee1('0xc'));_0x293d5f(_0x33dbe6[_0x4ee1('0x13')][_0x4ee1('0x12')]);}})[_0x4ee1('0x14')](function(_0x123c5e){logger[_0x4ee1('0xf')](_0x4ee1('0x11'),_0x3a45a3,_0x123c5e);_0xdfe9c1(_0x123c5e);});});} \ No newline at end of file +var _0xd0bb=['debug','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x3d7a63,_0x35a71e){var _0x1d5412=function(_0x5fdf47){while(--_0x5fdf47){_0x3d7a63['push'](_0x3d7a63['shift']());}};_0x1d5412(++_0x35a71e);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x38baac,_0x2772b3){_0x38baac=_0x38baac-0x0;var _0x47baf1=_0xd0bb[_0x38baac];return _0x47baf1;};'use strict';var _=require(_0xbd0b('0x0'));var util=require(_0xbd0b('0x1'));var moment=require(_0xbd0b('0x2'));var BPromise=require('bluebird');var rs=require(_0xbd0b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd0b('0x4'))['db'];var utils=require(_0xbd0b('0x5'));var logger=require('../../config/logger')(_0xbd0b('0x6'));var config=require('../../config/environment');var jayson=require(_0xbd0b('0x7'));var client=jayson[_0xbd0b('0x8')][_0xbd0b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37c205,_0x809599,_0x5eb975){return new BPromise(function(_0x2a4075,_0x4533ff){return client[_0xbd0b('0xa')](_0x37c205,_0x5eb975)[_0xbd0b('0xb')](function(_0x16e185){logger['info']('ZohoField,\x20%s,\x20%s',_0x809599,_0xbd0b('0xc'));logger[_0xbd0b('0xd')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x809599,_0xbd0b('0xc'),JSON[_0xbd0b('0xe')](_0x16e185));if(_0x16e185['error']){if(_0x16e185[_0xbd0b('0xf')][_0xbd0b('0x10')]===0x1f4){logger[_0xbd0b('0xf')](_0xbd0b('0x11'),_0x809599,_0x16e185[_0xbd0b('0xf')][_0xbd0b('0x12')]);return _0x4533ff(_0x16e185[_0xbd0b('0xf')][_0xbd0b('0x12')]);}logger[_0xbd0b('0xf')](_0xbd0b('0x11'),_0x809599,_0x16e185[_0xbd0b('0xf')]['message']);return _0x2a4075(_0x16e185[_0xbd0b('0xf')]['message']);}else{logger['info'](_0xbd0b('0x11'),_0x809599,_0xbd0b('0xc'));_0x2a4075(_0x16e185[_0xbd0b('0x13')][_0xbd0b('0x12')]);}})[_0xbd0b('0x14')](function(_0x546db3){logger['error'](_0xbd0b('0x11'),_0x809599,_0x546db3);_0x4533ff(_0x546db3);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index e9699d2..f235c77 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 _0xa166=['../../config/environment','multer','express','Router','../../components/auth/service'];(function(_0x51ab83,_0x2721b9){var _0x14b6de=function(_0x243483){while(--_0x243483){_0x51ab83['push'](_0x51ab83['shift']());}};_0x14b6de(++_0x2721b9);}(_0xa166,0x1be));var _0x6a16=function(_0x4a11fe,_0x4d4156){_0x4a11fe=_0x4a11fe-0x0;var _0x2c5bfd=_0xa166[_0x4a11fe];return _0x2c5bfd;};'use strict';var multer=require(_0x6a16('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6a16('0x1'));var router=express[_0x6a16('0x2')]();var auth=require(_0x6a16('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6a16('0x4'));module['exports']=router; \ No newline at end of file +var _0xbe1e=['exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x12c7e5,_0x4f82a7){var _0x266fe0=function(_0xe76c9){while(--_0xe76c9){_0x12c7e5['push'](_0x12c7e5['shift']());}};_0x266fe0(++_0x4f82a7);}(_0xbe1e,0x13c));var _0xebe1=function(_0xa40811,_0x4bd17f){_0xa40811=_0xa40811-0x0;var _0xd69c0c=_0xbe1e[_0xa40811];return _0xd69c0c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xebe1('0x0'));var timeout=require(_0xebe1('0x1'));var express=require(_0xebe1('0x2'));var router=express[_0xebe1('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xebe1('0x4'));var config=require(_0xebe1('0x5'));module[_0xebe1('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 4aa9ddd..125ac8b 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 _0xda02=['app.js','INTEGER','BOOLEAN','exports','STRING','unique_name_and_version'];(function(_0x74c15a,_0x45728f){var _0x267902=function(_0x531d1b){while(--_0x531d1b){_0x74c15a['push'](_0x74c15a['shift']());}};_0x267902(++_0x45728f);}(_0xda02,0x111));var _0x2da0=function(_0x43aee5,_0x11268b){_0x43aee5=_0x43aee5-0x0;var _0x76d1d0=_0xda02[_0x43aee5];return _0x76d1d0;};'use strict';var Sequelize=require('sequelize');module[_0x2da0('0x0')]={'name':{'type':Sequelize[_0x2da0('0x1')],'allowNull':![],'unique':_0x2da0('0x2')},'version':{'type':Sequelize[_0x2da0('0x1')],'allowNull':![],'unique':_0x2da0('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x2da0('0x3')},'filename':{'type':Sequelize[_0x2da0('0x1')]},'path':{'type':Sequelize[_0x2da0('0x1')]},'type':{'type':Sequelize[_0x2da0('0x1')]},'size':{'type':Sequelize[_0x2da0('0x4')]},'active':{'type':Sequelize[_0x2da0('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x2da0('0x1')]},'logo':{'type':Sequelize[_0x2da0('0x1')]},'state':{'type':Sequelize[_0x2da0('0x1')],'unique':'state'},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x2da0('0x1')]},'remoteUri':{'type':Sequelize[_0x2da0('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x045f=['state','sequelize','exports','STRING','app.js','INTEGER','BOOLEAN'];(function(_0x3296c3,_0xc96c4a){var _0x1fb66a=function(_0xa92688){while(--_0xa92688){_0x3296c3['push'](_0x3296c3['shift']());}};_0x1fb66a(++_0xc96c4a);}(_0x045f,0x166));var _0xf045=function(_0x4c2f30,_0xa91340){_0x4c2f30=_0x4c2f30-0x0;var _0xb8854d=_0x045f[_0x4c2f30];return _0xb8854d;};'use strict';var Sequelize=require(_0xf045('0x0'));module[_0xf045('0x1')]={'name':{'type':Sequelize[_0xf045('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xf045('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xf045('0x2')],'defaultValue':_0xf045('0x3')},'filename':{'type':Sequelize[_0xf045('0x2')]},'path':{'type':Sequelize[_0xf045('0x2')]},'type':{'type':Sequelize[_0xf045('0x2')]},'size':{'type':Sequelize[_0xf045('0x4')]},'active':{'type':Sequelize[_0xf045('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xf045('0x2')]},'logo':{'type':Sequelize[_0xf045('0x2')]},'state':{'type':Sequelize[_0xf045('0x2')],'unique':_0xf045('0x6')},'description':{'type':Sequelize[_0xf045('0x2')]},'title':{'type':Sequelize[_0xf045('0x2')]},'remoteUri':{'type':Sequelize[_0xf045('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index d3337bd..1adb016 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 _0x1b15=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','map','Integration','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','filter','findAll','rows','catch','show','keys','includeAll','include','create','body','find','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x1b15,0x1ae));var _0x51b1=function(_0x5cf661,_0x56b806){_0x5cf661=_0x5cf661-0x0;var _0x3adfa9=_0x1b15[_0x5cf661];return _0x3adfa9;};'use strict';var pdf=require(_0x51b1('0x0'));var emlformat=require(_0x51b1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x51b1('0x2'));var jsonpatch=require(_0x51b1('0x3'));var rp=require(_0x51b1('0x4'));var moment=require(_0x51b1('0x5'));var BPromise=require(_0x51b1('0x6'));var Mustache=require('mustache');var util=require(_0x51b1('0x7'));var path=require(_0x51b1('0x8'));var sox=require(_0x51b1('0x9'));var csv=require(_0x51b1('0xa'));var ejs=require(_0x51b1('0xb'));var fs=require('fs');var _=require(_0x51b1('0xc'));var squel=require(_0x51b1('0xd'));var crypto=require(_0x51b1('0xe'));var jsforce=require(_0x51b1('0xf'));var deskjs=require(_0x51b1('0x10'));var toCsv=require(_0x51b1('0xa'));var querystring=require('querystring');var Papa=require(_0x51b1('0x11'));var Redis=require(_0x51b1('0x12'));var authService=require(_0x51b1('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x51b1('0x14'));var hardwareService=require(_0x51b1('0x15'));var logger=require(_0x51b1('0x16'))(_0x51b1('0x17'));var utils=require(_0x51b1('0x18'));var config=require(_0x51b1('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23c37f,_0x3961f9){_0x3961f9=_0x3961f9||0xcc;return function(_0x4a8832){if(_0x4a8832){return _0x23c37f[_0x51b1('0x1a')](_0x3961f9);}return _0x23c37f[_0x51b1('0x1b')](_0x3961f9)[_0x51b1('0x1c')]();};}function respondWithResult(_0x8c6b45,_0x52f82d){_0x52f82d=_0x52f82d||0xc8;return function(_0x662fec){if(_0x662fec){return _0x8c6b45[_0x51b1('0x1b')](_0x52f82d)['json'](_0x662fec);}};}function respondWithFilteredResult(_0x13a0b8,_0x12b45f){return function(_0x4b4672){if(_0x4b4672){var _0x2663f2=_0x4b4672[_0x51b1('0x1d')],_0xb53d77=_0x12b45f['offset'],_0x30aa66=_0x12b45f[_0x51b1('0x1e')]+_0x12b45f[_0x51b1('0x1f')],_0x3a8c1e;if(_0x30aa66>=_0x2663f2){_0x30aa66=_0x2663f2;_0x3a8c1e=0xc8;}else{_0x3a8c1e=0xce;}_0x13a0b8[_0x51b1('0x1b')](_0x3a8c1e);return _0x13a0b8['set'](_0x51b1('0x20'),_0xb53d77+'-'+_0x30aa66+'/'+_0x2663f2)[_0x51b1('0x21')](_0x4b4672);}return null;};}function patchUpdates(_0x295eea){return function(_0x2f6bb6){try{jsonpatch[_0x51b1('0x22')](_0x2f6bb6,_0x295eea,!![]);}catch(_0x4cd90e){return BPromise[_0x51b1('0x23')](_0x4cd90e);}return _0x2f6bb6[_0x51b1('0x24')]();};}function saveUpdates(_0x1a2e42,_0x343a1e){return function(_0x336d87){if(_0x336d87){return _0x336d87[_0x51b1('0x25')](_0x1a2e42)['then'](function(_0x35478d){return _0x35478d;});}return null;};}function removeEntity(_0x550adf,_0x206a11){return function(_0x41bf5d){if(_0x41bf5d){return _0x41bf5d[_0x51b1('0x26')]()[_0x51b1('0x27')](function(){_0x550adf[_0x51b1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x271c91,_0x32a652){return function(_0x32af88){if(!_0x32af88){_0x271c91[_0x51b1('0x1a')](0x194);}return _0x32af88;};}function handleError(_0x145d9e,_0x305af0){_0x305af0=_0x305af0||0x1f4;return function(_0x126630){logger[_0x51b1('0x28')](_0x126630[_0x51b1('0x29')]);if(_0x126630[_0x51b1('0x2a')]){delete _0x126630[_0x51b1('0x2a')];}_0x145d9e[_0x51b1('0x1b')](_0x305af0)['send'](_0x126630);};}exports['index']=function(_0x3c6a6c,_0xca2cd8){var _0x1fa975={},_0x465b5e={},_0x294372={'count':0x0,'rows':[]};var _0x296f65=_[_0x51b1('0x2b')](db[_0x51b1('0x2c')][_0x51b1('0x2d')],function(_0x4f1aa2){return{'name':_0x4f1aa2[_0x51b1('0x2e')],'type':_0x4f1aa2['type']['key']};});_0x465b5e[_0x51b1('0x2f')]=_['map'](_0x296f65,_0x51b1('0x2a'));_0x465b5e[_0x51b1('0x30')]=_['keys'](_0x3c6a6c['query']);_0x465b5e['filters']=_[_0x51b1('0x31')](_0x465b5e[_0x51b1('0x2f')],_0x465b5e[_0x51b1('0x30')]);_0x1fa975[_0x51b1('0x32')]=_[_0x51b1('0x31')](_0x465b5e[_0x51b1('0x2f')],qs['fields'](_0x3c6a6c[_0x51b1('0x30')][_0x51b1('0x33')]));_0x1fa975[_0x51b1('0x32')]=_0x1fa975['attributes'][_0x51b1('0x34')]?_0x1fa975['attributes']:_0x465b5e[_0x51b1('0x2f')];if(!_0x3c6a6c[_0x51b1('0x30')][_0x51b1('0x35')](_0x51b1('0x36'))){_0x1fa975[_0x51b1('0x1f')]=qs[_0x51b1('0x1f')](_0x3c6a6c['query'][_0x51b1('0x1f')]);_0x1fa975['offset']=qs['offset'](_0x3c6a6c[_0x51b1('0x30')][_0x51b1('0x1e')]);}_0x1fa975[_0x51b1('0x37')]=qs[_0x51b1('0x38')](_0x3c6a6c[_0x51b1('0x30')]['sort']);_0x1fa975[_0x51b1('0x39')]=qs[_0x51b1('0x3a')](_[_0x51b1('0x3b')](_0x3c6a6c[_0x51b1('0x30')],_0x465b5e[_0x51b1('0x3a')]));if(_0x3c6a6c[_0x51b1('0x30')]['filter']){_0x1fa975[_0x51b1('0x39')]=_[_0x51b1('0x3c')](_0x1fa975[_0x51b1('0x39')],{'$or':_[_0x51b1('0x2b')](_0x296f65,function(_0x6e4174){if(_0x6e4174[_0x51b1('0x3d')]!=='VIRTUAL'){var _0x418a9b={};_0x418a9b[_0x6e4174[_0x51b1('0x2a')]]={'$like':'%'+_0x3c6a6c[_0x51b1('0x30')][_0x51b1('0x3e')]+'%'};return _0x418a9b;}})});}_0x1fa975=_[_0x51b1('0x3c')]({},_0x1fa975,_0x3c6a6c['options']);var _0x441b61={'where':_0x1fa975[_0x51b1('0x39')]};return db[_0x51b1('0x2c')][_0x51b1('0x1d')](_0x441b61)['then'](function(_0x3ea84a){_0x294372['count']=_0x3ea84a;if(_0x3c6a6c[_0x51b1('0x30')]['includeAll']){_0x1fa975['include']=[{'all':!![]}];}return db[_0x51b1('0x2c')][_0x51b1('0x3f')](_0x1fa975);})[_0x51b1('0x27')](function(_0x1a690c){_0x294372[_0x51b1('0x40')]=_0x1a690c;return _0x294372;})[_0x51b1('0x27')](respondWithFilteredResult(_0xca2cd8,_0x1fa975))[_0x51b1('0x41')](handleError(_0xca2cd8,null));};exports[_0x51b1('0x42')]=function(_0x535be8,_0x2777a4){var _0x574596={'raw':![],'where':{'id':_0x535be8['params']['id']}},_0x5a85c1={};_0x5a85c1['model']=_[_0x51b1('0x43')](db['Integration']['rawAttributes']);_0x5a85c1[_0x51b1('0x30')]=_[_0x51b1('0x43')](_0x535be8[_0x51b1('0x30')]);_0x5a85c1[_0x51b1('0x3a')]=_[_0x51b1('0x31')](_0x5a85c1[_0x51b1('0x2f')],_0x5a85c1['query']);_0x574596[_0x51b1('0x32')]=_[_0x51b1('0x31')](_0x5a85c1[_0x51b1('0x2f')],qs['fields'](_0x535be8[_0x51b1('0x30')][_0x51b1('0x33')]));_0x574596[_0x51b1('0x32')]=_0x574596[_0x51b1('0x32')][_0x51b1('0x34')]?_0x574596[_0x51b1('0x32')]:_0x5a85c1[_0x51b1('0x2f')];if(_0x535be8[_0x51b1('0x30')][_0x51b1('0x44')]){_0x574596[_0x51b1('0x45')]=[{'all':!![]}];}_0x574596=_[_0x51b1('0x3c')]({},_0x574596,_0x535be8['options']);return db['Integration']['find'](_0x574596)[_0x51b1('0x27')](handleEntityNotFound(_0x2777a4,null))[_0x51b1('0x27')](respondWithResult(_0x2777a4,null))[_0x51b1('0x41')](handleError(_0x2777a4,null));};exports[_0x51b1('0x46')]=function(_0x1250f7,_0x1a807f){return db[_0x51b1('0x2c')][_0x51b1('0x46')](_0x1250f7['body'],{})[_0x51b1('0x27')](respondWithResult(_0x1a807f,0xc9))[_0x51b1('0x41')](handleError(_0x1a807f,null));};exports[_0x51b1('0x25')]=function(_0x8d5e18,_0x45d445){if(_0x8d5e18[_0x51b1('0x47')]['id']){delete _0x8d5e18[_0x51b1('0x47')]['id'];}return db[_0x51b1('0x2c')][_0x51b1('0x48')]({'where':{'id':_0x8d5e18[_0x51b1('0x49')]['id']}})[_0x51b1('0x27')](handleEntityNotFound(_0x45d445,null))[_0x51b1('0x27')](saveUpdates(_0x8d5e18[_0x51b1('0x47')],null))['then'](respondWithResult(_0x45d445,null))[_0x51b1('0x41')](handleError(_0x45d445,null));};exports[_0x51b1('0x26')]=function(_0x3b5497,_0x41df38){return db['Integration'][_0x51b1('0x48')]({'where':{'id':_0x3b5497[_0x51b1('0x49')]['id']}})[_0x51b1('0x27')](handleEntityNotFound(_0x41df38,null))['then'](removeEntity(_0x41df38,null))[_0x51b1('0x41')](handleError(_0x41df38,null));}; \ No newline at end of file +var _0x05ea=['type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','options','includeAll','findAll','rows','catch','show','params','create','body','find','destroy','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','update','then','end','error','stack','name','send','index','map','Integration','rawAttributes'];(function(_0x526fb1,_0x1d0359){var _0x33582f=function(_0x2df327){while(--_0x2df327){_0x526fb1['push'](_0x526fb1['shift']());}};_0x33582f(++_0x1d0359);}(_0x05ea,0x140));var _0xa05e=function(_0x3902c1,_0x1c9eb2){_0x3902c1=_0x3902c1-0x0;var _0x1266cc=_0x05ea[_0x3902c1];return _0x1266cc;};'use strict';var pdf=require(_0xa05e('0x0'));var emlformat=require(_0xa05e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa05e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa05e('0x3'));var moment=require(_0xa05e('0x4'));var BPromise=require(_0xa05e('0x5'));var Mustache=require('mustache');var util=require(_0xa05e('0x6'));var path=require(_0xa05e('0x7'));var sox=require(_0xa05e('0x8'));var csv=require(_0xa05e('0x9'));var ejs=require(_0xa05e('0xa'));var fs=require('fs');var _=require(_0xa05e('0xb'));var squel=require(_0xa05e('0xc'));var crypto=require('crypto');var jsforce=require(_0xa05e('0xd'));var deskjs=require(_0xa05e('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa05e('0xf'));var Papa=require(_0xa05e('0x10'));var Redis=require(_0xa05e('0x11'));var authService=require(_0xa05e('0x12'));var qs=require(_0xa05e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa05e('0x14'));var logger=require(_0xa05e('0x15'))(_0xa05e('0x16'));var utils=require(_0xa05e('0x17'));var config=require('../../config/environment');var db=require(_0xa05e('0x18'))['db'];function respondWithStatusCode(_0x35a798,_0x57eac3){_0x57eac3=_0x57eac3||0xcc;return function(_0x90f69f){if(_0x90f69f){return _0x35a798[_0xa05e('0x19')](_0x57eac3);}return _0x35a798[_0xa05e('0x1a')](_0x57eac3)['end']();};}function respondWithResult(_0x4642e2,_0x10270e){_0x10270e=_0x10270e||0xc8;return function(_0x12e798){if(_0x12e798){return _0x4642e2[_0xa05e('0x1a')](_0x10270e)[_0xa05e('0x1b')](_0x12e798);}};}function respondWithFilteredResult(_0x463621,_0x1b8262){return function(_0x15b22a){if(_0x15b22a){var _0x4a82bb=_0x15b22a[_0xa05e('0x1c')],_0x29ad35=_0x1b8262['offset'],_0xd5b95=_0x1b8262[_0xa05e('0x1d')]+_0x1b8262[_0xa05e('0x1e')],_0x58d2d8;if(_0xd5b95>=_0x4a82bb){_0xd5b95=_0x4a82bb;_0x58d2d8=0xc8;}else{_0x58d2d8=0xce;}_0x463621[_0xa05e('0x1a')](_0x58d2d8);return _0x463621[_0xa05e('0x1f')]('Content-Range',_0x29ad35+'-'+_0xd5b95+'/'+_0x4a82bb)['json'](_0x15b22a);}return null;};}function patchUpdates(_0x34521d){return function(_0x41c1cd){try{jsonpatch[_0xa05e('0x20')](_0x41c1cd,_0x34521d,!![]);}catch(_0x2b383b){return BPromise[_0xa05e('0x21')](_0x2b383b);}return _0x41c1cd['save']();};}function saveUpdates(_0xf63ecc,_0x481a98){return function(_0x5f4010){if(_0x5f4010){return _0x5f4010[_0xa05e('0x22')](_0xf63ecc)[_0xa05e('0x23')](function(_0x2651e7){return _0x2651e7;});}return null;};}function removeEntity(_0x33570d,_0x36c915){return function(_0x2c8d82){if(_0x2c8d82){return _0x2c8d82['destroy']()[_0xa05e('0x23')](function(){_0x33570d[_0xa05e('0x1a')](0xcc)[_0xa05e('0x24')]();});}};}function handleEntityNotFound(_0x583ea3,_0x37211a){return function(_0xd290b){if(!_0xd290b){_0x583ea3['sendStatus'](0x194);}return _0xd290b;};}function handleError(_0x323695,_0x5b2879){_0x5b2879=_0x5b2879||0x1f4;return function(_0x2305d3){logger[_0xa05e('0x25')](_0x2305d3[_0xa05e('0x26')]);if(_0x2305d3[_0xa05e('0x27')]){delete _0x2305d3[_0xa05e('0x27')];}_0x323695[_0xa05e('0x1a')](_0x5b2879)[_0xa05e('0x28')](_0x2305d3);};}exports[_0xa05e('0x29')]=function(_0x1960c0,_0x4fecd2){var _0x1396c3={},_0x3a78fd={},_0x1549a4={'count':0x0,'rows':[]};var _0x13aaf0=_[_0xa05e('0x2a')](db[_0xa05e('0x2b')][_0xa05e('0x2c')],function(_0x31e7bd){return{'name':_0x31e7bd['fieldName'],'type':_0x31e7bd[_0xa05e('0x2d')][_0xa05e('0x2e')]};});_0x3a78fd[_0xa05e('0x2f')]=_[_0xa05e('0x2a')](_0x13aaf0,_0xa05e('0x27'));_0x3a78fd[_0xa05e('0x30')]=_[_0xa05e('0x31')](_0x1960c0['query']);_0x3a78fd['filters']=_[_0xa05e('0x32')](_0x3a78fd[_0xa05e('0x2f')],_0x3a78fd['query']);_0x1396c3[_0xa05e('0x33')]=_[_0xa05e('0x32')](_0x3a78fd[_0xa05e('0x2f')],qs[_0xa05e('0x34')](_0x1960c0[_0xa05e('0x30')][_0xa05e('0x34')]));_0x1396c3[_0xa05e('0x33')]=_0x1396c3['attributes'][_0xa05e('0x35')]?_0x1396c3['attributes']:_0x3a78fd['model'];if(!_0x1960c0[_0xa05e('0x30')][_0xa05e('0x36')](_0xa05e('0x37'))){_0x1396c3[_0xa05e('0x1e')]=qs['limit'](_0x1960c0[_0xa05e('0x30')][_0xa05e('0x1e')]);_0x1396c3[_0xa05e('0x1d')]=qs[_0xa05e('0x1d')](_0x1960c0[_0xa05e('0x30')][_0xa05e('0x1d')]);}_0x1396c3['order']=qs[_0xa05e('0x38')](_0x1960c0[_0xa05e('0x30')][_0xa05e('0x38')]);_0x1396c3[_0xa05e('0x39')]=qs['filters'](_[_0xa05e('0x3a')](_0x1960c0[_0xa05e('0x30')],_0x3a78fd[_0xa05e('0x3b')]));if(_0x1960c0['query'][_0xa05e('0x3c')]){_0x1396c3[_0xa05e('0x39')]=_[_0xa05e('0x3d')](_0x1396c3[_0xa05e('0x39')],{'$or':_[_0xa05e('0x2a')](_0x13aaf0,function(_0x2d89d6){if(_0x2d89d6[_0xa05e('0x2d')]!=='VIRTUAL'){var _0x3a9952={};_0x3a9952[_0x2d89d6[_0xa05e('0x27')]]={'$like':'%'+_0x1960c0['query']['filter']+'%'};return _0x3a9952;}})});}_0x1396c3=_[_0xa05e('0x3d')]({},_0x1396c3,_0x1960c0[_0xa05e('0x3e')]);var _0x12d9b2={'where':_0x1396c3['where']};return db[_0xa05e('0x2b')][_0xa05e('0x1c')](_0x12d9b2)[_0xa05e('0x23')](function(_0x367ff7){_0x1549a4[_0xa05e('0x1c')]=_0x367ff7;if(_0x1960c0[_0xa05e('0x30')][_0xa05e('0x3f')]){_0x1396c3['include']=[{'all':!![]}];}return db[_0xa05e('0x2b')][_0xa05e('0x40')](_0x1396c3);})['then'](function(_0x438d7e){_0x1549a4[_0xa05e('0x41')]=_0x438d7e;return _0x1549a4;})[_0xa05e('0x23')](respondWithFilteredResult(_0x4fecd2,_0x1396c3))[_0xa05e('0x42')](handleError(_0x4fecd2,null));};exports[_0xa05e('0x43')]=function(_0x378578,_0x55b47a){var _0x13b4e7={'raw':![],'where':{'id':_0x378578[_0xa05e('0x44')]['id']}},_0x4052c9={};_0x4052c9[_0xa05e('0x2f')]=_['keys'](db['Integration'][_0xa05e('0x2c')]);_0x4052c9[_0xa05e('0x30')]=_['keys'](_0x378578[_0xa05e('0x30')]);_0x4052c9[_0xa05e('0x3b')]=_[_0xa05e('0x32')](_0x4052c9[_0xa05e('0x2f')],_0x4052c9['query']);_0x13b4e7[_0xa05e('0x33')]=_[_0xa05e('0x32')](_0x4052c9[_0xa05e('0x2f')],qs[_0xa05e('0x34')](_0x378578['query'][_0xa05e('0x34')]));_0x13b4e7[_0xa05e('0x33')]=_0x13b4e7[_0xa05e('0x33')]['length']?_0x13b4e7[_0xa05e('0x33')]:_0x4052c9[_0xa05e('0x2f')];if(_0x378578[_0xa05e('0x30')]['includeAll']){_0x13b4e7['include']=[{'all':!![]}];}_0x13b4e7=_[_0xa05e('0x3d')]({},_0x13b4e7,_0x378578['options']);return db[_0xa05e('0x2b')]['find'](_0x13b4e7)['then'](handleEntityNotFound(_0x55b47a,null))[_0xa05e('0x23')](respondWithResult(_0x55b47a,null))[_0xa05e('0x42')](handleError(_0x55b47a,null));};exports[_0xa05e('0x45')]=function(_0x1a27da,_0x4c999d){return db[_0xa05e('0x2b')][_0xa05e('0x45')](_0x1a27da['body'],{})[_0xa05e('0x23')](respondWithResult(_0x4c999d,0xc9))['catch'](handleError(_0x4c999d,null));};exports[_0xa05e('0x22')]=function(_0x494fde,_0x87ddd5){if(_0x494fde[_0xa05e('0x46')]['id']){delete _0x494fde[_0xa05e('0x46')]['id'];}return db['Integration'][_0xa05e('0x47')]({'where':{'id':_0x494fde[_0xa05e('0x44')]['id']}})[_0xa05e('0x23')](handleEntityNotFound(_0x87ddd5,null))[_0xa05e('0x23')](saveUpdates(_0x494fde[_0xa05e('0x46')],null))[_0xa05e('0x23')](respondWithResult(_0x87ddd5,null))[_0xa05e('0x42')](handleError(_0x87ddd5,null));};exports[_0xa05e('0x48')]=function(_0x48ccf9,_0x4d2ef2){return db[_0xa05e('0x2b')][_0xa05e('0x47')]({'where':{'id':_0x48ccf9[_0xa05e('0x44')]['id']}})[_0xa05e('0x23')](handleEntityNotFound(_0x4d2ef2,null))[_0xa05e('0x23')](removeEntity(_0x4d2ef2,null))[_0xa05e('0x42')](handleError(_0x4d2ef2,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 8a567de..1edd4d7 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 _0xe5db=['request-promise','path','rimraf','./integration.attributes','exports','Integration','integrations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe5db,0x1e7));var _0xbe5d=function(_0x56d816,_0x424a26){_0x56d816=_0x56d816-0x0;var _0x23df96=_0xe5db[_0x56d816];return _0x23df96;};'use strict';var _=require(_0xbe5d('0x0'));var util=require(_0xbe5d('0x1'));var logger=require(_0xbe5d('0x2'))('api');var moment=require(_0xbe5d('0x3'));var BPromise=require(_0xbe5d('0x4'));var rp=require(_0xbe5d('0x5'));var fs=require('fs');var path=require(_0xbe5d('0x6'));var rimraf=require(_0xbe5d('0x7'));var config=require('../../config/environment');var attributes=require(_0xbe5d('0x8'));module[_0xbe5d('0x9')]=function(_0x47a1f9,_0x3d6f0a){return _0x47a1f9['define'](_0xbe5d('0xa'),attributes,{'tableName':_0xbe5d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8741=['moment','request-promise','path','rimraf','../../config/environment','exports','Integration','integrations','lodash','util','../../config/logger','api'];(function(_0x3ab0d0,_0x946c4e){var _0x3ee9a7=function(_0x24281b){while(--_0x24281b){_0x3ab0d0['push'](_0x3ab0d0['shift']());}};_0x3ee9a7(++_0x946c4e);}(_0x8741,0x194));var _0x1874=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8741[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1874('0x0'));var util=require(_0x1874('0x1'));var logger=require(_0x1874('0x2'))(_0x1874('0x3'));var moment=require(_0x1874('0x4'));var BPromise=require('bluebird');var rp=require(_0x1874('0x5'));var fs=require('fs');var path=require(_0x1874('0x6'));var rimraf=require(_0x1874('0x7'));var config=require(_0x1874('0x8'));var attributes=require('./integration.attributes');module[_0x1874('0x9')]=function(_0x2d5b0c,_0x2a24eb){return _0x2d5b0c['define'](_0x1874('0xa'),attributes,{'tableName':_0x1874('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 73a2532..8635391 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 _0x8f2d=['../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','Integration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x4535f0,_0x30cea5){var _0x41c597=function(_0x5d0b21){while(--_0x5d0b21){_0x4535f0['push'](_0x4535f0['shift']());}};_0x41c597(++_0x30cea5);}(_0x8f2d,0xd5));var _0xd8f2=function(_0x3888c0,_0x29c499){_0x3888c0=_0x3888c0-0x0;var _0x2c2785=_0x8f2d[_0x3888c0];return _0x2c2785;};'use strict';var _=require(_0xd8f2('0x0'));var util=require(_0xd8f2('0x1'));var moment=require('moment');var BPromise=require(_0xd8f2('0x2'));var rs=require(_0xd8f2('0x3'));var fs=require('fs');var Redis=require(_0xd8f2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd8f2('0x5'))(_0xd8f2('0x6'));var config=require(_0xd8f2('0x7'));var jayson=require(_0xd8f2('0x8'));var client=jayson[_0xd8f2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe5e289,_0x16e0b3,_0x42a12c){return new BPromise(function(_0x16a942,_0x1aeae7){return client[_0xd8f2('0xa')](_0xe5e289,_0x42a12c)['then'](function(_0x1383b6){logger[_0xd8f2('0xb')]('Integration,\x20%s,\x20%s',_0x16e0b3,_0xd8f2('0xc'));logger[_0xd8f2('0xd')](_0xd8f2('0xe'),_0x16e0b3,_0xd8f2('0xc'),JSON[_0xd8f2('0xf')](_0x1383b6));if(_0x1383b6[_0xd8f2('0x10')]){if(_0x1383b6['error'][_0xd8f2('0x11')]===0x1f4){logger[_0xd8f2('0x10')](_0xd8f2('0x12'),_0x16e0b3,_0x1383b6[_0xd8f2('0x10')][_0xd8f2('0x13')]);return _0x1aeae7(_0x1383b6[_0xd8f2('0x10')]['message']);}logger[_0xd8f2('0x10')](_0xd8f2('0x12'),_0x16e0b3,_0x1383b6[_0xd8f2('0x10')][_0xd8f2('0x13')]);return _0x16a942(_0x1383b6[_0xd8f2('0x10')]['message']);}else{logger[_0xd8f2('0xb')](_0xd8f2('0x12'),_0x16e0b3,'request\x20sent');_0x16a942(_0x1383b6[_0xd8f2('0x14')][_0xd8f2('0x13')]);}})[_0xd8f2('0x15')](function(_0x25b4e2){logger[_0xd8f2('0x10')](_0xd8f2('0x12'),_0x16e0b3,_0x25b4e2);_0x1aeae7(_0x25b4e2);});});} \ No newline at end of file +var _0xe4b8=['bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','Integration,\x20%s,\x20%s','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment'];(function(_0x49ae5b,_0x5b255b){var _0x33919c=function(_0x454ba9){while(--_0x454ba9){_0x49ae5b['push'](_0x49ae5b['shift']());}};_0x33919c(++_0x5b255b);}(_0xe4b8,0x179));var _0x8e4b=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xe4b8[_0x3070dc];return _0x431489;};'use strict';var _=require(_0x8e4b('0x0'));var util=require(_0x8e4b('0x1'));var moment=require(_0x8e4b('0x2'));var BPromise=require(_0x8e4b('0x3'));var rs=require(_0x8e4b('0x4'));var fs=require('fs');var Redis=require(_0x8e4b('0x5'));var db=require(_0x8e4b('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8e4b('0x7'));var config=require(_0x8e4b('0x8'));var jayson=require(_0x8e4b('0x9'));var client=jayson['client'][_0x8e4b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d0472,_0x2be426,_0x5642a3){return new BPromise(function(_0x4e0535,_0x5801c3){return client['request'](_0x4d0472,_0x5642a3)['then'](function(_0x2e048b){logger['info'](_0x8e4b('0xb'),_0x2be426,_0x8e4b('0xc'));logger['debug'](_0x8e4b('0xd'),_0x2be426,_0x8e4b('0xc'),JSON[_0x8e4b('0xe')](_0x2e048b));if(_0x2e048b['error']){if(_0x2e048b[_0x8e4b('0xf')][_0x8e4b('0x10')]===0x1f4){logger[_0x8e4b('0xf')](_0x8e4b('0xb'),_0x2be426,_0x2e048b[_0x8e4b('0xf')][_0x8e4b('0x11')]);return _0x5801c3(_0x2e048b[_0x8e4b('0xf')][_0x8e4b('0x11')]);}logger['error']('Integration,\x20%s,\x20%s',_0x2be426,_0x2e048b[_0x8e4b('0xf')][_0x8e4b('0x11')]);return _0x4e0535(_0x2e048b[_0x8e4b('0xf')][_0x8e4b('0x11')]);}else{logger[_0x8e4b('0x12')]('Integration,\x20%s,\x20%s',_0x2be426,'request\x20sent');_0x4e0535(_0x2e048b[_0x8e4b('0x13')]['message']);}})['catch'](function(_0x417e71){logger['error'](_0x8e4b('0xb'),_0x2be426,_0x417e71);_0x5801c3(_0x417e71);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 1585c3a..6a16730 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 _0xdb84=['get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0xdb84,0xa8));var _0x4db8=function(_0x5007ba,_0x54e45b){_0x5007ba=_0x5007ba-0x0;var _0x248e31=_0xdb84[_0x5007ba];return _0x248e31;};'use strict';var multer=require('multer');var util=require(_0x4db8('0x0'));var path=require(_0x4db8('0x1'));var timeout=require('connect-timeout');var express=require(_0x4db8('0x2'));var router=express[_0x4db8('0x3')]();var auth=require(_0x4db8('0x4'));var interaction=require(_0x4db8('0x5'));var config=require(_0x4db8('0x6'));var controller=require(_0x4db8('0x7'));router[_0x4db8('0x8')]('/',auth[_0x4db8('0x9')](),controller[_0x4db8('0xa')]);router[_0x4db8('0x8')](_0x4db8('0xb'),auth[_0x4db8('0x9')](),controller[_0x4db8('0xc')]);router[_0x4db8('0x8')](_0x4db8('0xd'),auth['isAuthenticated'](),controller[_0x4db8('0xe')]);router[_0x4db8('0xf')]('/',auth[_0x4db8('0x9')](),controller[_0x4db8('0x10')]);router[_0x4db8('0x11')](_0x4db8('0xd'),auth[_0x4db8('0x9')](),controller[_0x4db8('0x12')]);router[_0x4db8('0x13')]('/:id',auth[_0x4db8('0x9')](),controller[_0x4db8('0x14')]);module[_0x4db8('0x15')]=router; \ No newline at end of file +var _0x9960=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x9960,0x8e));var _0x0996=function(_0x3b036d,_0x318c2a){_0x3b036d=_0x3b036d-0x0;var _0x5f2bcb=_0x9960[_0x3b036d];return _0x5f2bcb;};'use strict';var multer=require(_0x0996('0x0'));var util=require('util');var path=require(_0x0996('0x1'));var timeout=require(_0x0996('0x2'));var express=require(_0x0996('0x3'));var router=express[_0x0996('0x4')]();var auth=require(_0x0996('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0996('0x6'));var controller=require(_0x0996('0x7'));router[_0x0996('0x8')]('/',auth[_0x0996('0x9')](),controller[_0x0996('0xa')]);router[_0x0996('0x8')](_0x0996('0xb'),auth['isAuthenticated'](),controller[_0x0996('0xc')]);router[_0x0996('0x8')](_0x0996('0xd'),auth[_0x0996('0x9')](),controller[_0x0996('0xe')]);router[_0x0996('0xf')]('/',auth[_0x0996('0x9')](),controller[_0x0996('0x10')]);router[_0x0996('0x11')](_0x0996('0xd'),auth[_0x0996('0x9')](),controller[_0x0996('0x12')]);router[_0x0996('0x13')](_0x0996('0xd'),auth[_0x0996('0x9')](),controller[_0x0996('0x14')]);module[_0x0996('0x15')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 2fcbff8..f5719ec 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 _0x7d5c=['STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','exports'];(function(_0x10bba8,_0x1b5f3e){var _0x2d4615=function(_0x3a1607){while(--_0x3a1607){_0x10bba8['push'](_0x10bba8['shift']());}};_0x2d4615(++_0x1b5f3e);}(_0x7d5c,0x121));var _0xc7d5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d5c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xc7d5('0x0')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xc7d5('0x1')]},'integrationId':{'type':Sequelize[_0xc7d5('0x2')]},'contacts':{'type':Sequelize[_0xc7d5('0x1')]},'uniqueid':{'type':Sequelize[_0xc7d5('0x1')]},'calleridnum':{'type':Sequelize[_0xc7d5('0x1')]},'calleridname':{'type':Sequelize[_0xc7d5('0x1')]},'queue':{'type':Sequelize[_0xc7d5('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xc7d5('0x1')]},'agentcalledAt':{'type':Sequelize[_0xc7d5('0x3')]},'agentconnectAt':{'type':Sequelize[_0xc7d5('0x3')]},'holdtime':{'type':Sequelize[_0xc7d5('0x2')]},'agentcomplete':{'type':Sequelize[_0xc7d5('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xc7d5('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc7d5('0x2')]},'reason':{'type':Sequelize[_0xc7d5('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xc7d5('0x3')]},'agentdump':{'type':Sequelize[_0xc7d5('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xc7d5('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xc7d5('0x2')]},'channelstatedesc':{'type':Sequelize[_0xc7d5('0x1')]},'connectedlinenum':{'type':Sequelize[_0xc7d5('0x1')]},'connectedlinename':{'type':Sequelize[_0xc7d5('0x1')]},'language':{'type':Sequelize[_0xc7d5('0x1')]},'accountcode':{'type':Sequelize[_0xc7d5('0x1')]},'context':{'type':Sequelize[_0xc7d5('0x1')]},'exten':{'type':Sequelize[_0xc7d5('0x1')]},'priority':{'type':Sequelize[_0xc7d5('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xc7d5('0x1')]},'destcalleridnum':{'type':Sequelize[_0xc7d5('0x1')]},'destcalleridname':{'type':Sequelize[_0xc7d5('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xc7d5('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xc7d5('0x1')]},'destlanguage':{'type':Sequelize[_0xc7d5('0x1')]},'destaccountcode':{'type':Sequelize[_0xc7d5('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xc7d5('0x1')]},'destpriority':{'type':Sequelize[_0xc7d5('0x1')]},'destuniqueid':{'type':Sequelize[_0xc7d5('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xc7d5('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xc7d5('0x1')]},'attachment':{'type':Sequelize[_0xc7d5('0x5')]},'html':{'type':Sequelize[_0xc7d5('0x5')]},'text':{'type':Sequelize[_0xc7d5('0x5')]},'status':{'type':Sequelize[_0xc7d5('0x6')](_0xc7d5('0x7'),_0xc7d5('0x8'),_0xc7d5('0x9'),'FAILED')},'url':{'type':Sequelize[_0xc7d5('0x1')]},'app':{'type':Sequelize[_0xc7d5('0x1')]},'appdata':{'type':Sequelize[_0xc7d5('0x1')]},'projectId':{'type':Sequelize[_0xc7d5('0x2')]}}; \ No newline at end of file +var _0x88c1=['ENUM','SENT','FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x42d903,_0xbc931d){var _0x7406c=function(_0x44052b){while(--_0x44052b){_0x42d903['push'](_0x42d903['shift']());}};_0x7406c(++_0xbc931d);}(_0x88c1,0xc9));var _0x188c=function(_0x8fa745,_0x1fec4a){_0x8fa745=_0x8fa745-0x0;var _0x219ad9=_0x88c1[_0x8fa745];return _0x219ad9;};'use strict';var Sequelize=require('sequelize');module[_0x188c('0x0')]={'integration':{'type':Sequelize[_0x188c('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x188c('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x188c('0x2')]},'contacts':{'type':Sequelize[_0x188c('0x1')]},'uniqueid':{'type':Sequelize[_0x188c('0x1')]},'calleridnum':{'type':Sequelize[_0x188c('0x1')]},'calleridname':{'type':Sequelize[_0x188c('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x188c('0x1')]},'membername':{'type':Sequelize[_0x188c('0x1')]},'agentcalledAt':{'type':Sequelize[_0x188c('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x188c('0x2')]},'agentcomplete':{'type':Sequelize[_0x188c('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x188c('0x3')]},'talktime':{'type':Sequelize[_0x188c('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x188c('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x188c('0x3')]},'lastevent':{'type':Sequelize[_0x188c('0x1')]},'channel':{'type':Sequelize[_0x188c('0x1')]},'channelstate':{'type':Sequelize[_0x188c('0x2')]},'channelstatedesc':{'type':Sequelize[_0x188c('0x1')]},'connectedlinenum':{'type':Sequelize[_0x188c('0x1')]},'connectedlinename':{'type':Sequelize[_0x188c('0x1')]},'language':{'type':Sequelize[_0x188c('0x1')]},'accountcode':{'type':Sequelize[_0x188c('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x188c('0x1')]},'priority':{'type':Sequelize[_0x188c('0x1')]},'destchannel':{'type':Sequelize[_0x188c('0x1')]},'destchannelstate':{'type':Sequelize[_0x188c('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x188c('0x1')]},'destcalleridname':{'type':Sequelize[_0x188c('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x188c('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x188c('0x1')]},'destexten':{'type':Sequelize[_0x188c('0x1')]},'destpriority':{'type':Sequelize[_0x188c('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x188c('0x1')]},'inReplyTo':{'type':Sequelize[_0x188c('0x1')]},'subject':{'type':Sequelize[_0x188c('0x1')]},'from':{'type':Sequelize[_0x188c('0x1')]},'to':{'type':Sequelize[_0x188c('0x1')]},'cc':{'type':Sequelize[_0x188c('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x188c('0x5')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x188c('0x6')](_0x188c('0x7'),'SENDING','RECEIVED',_0x188c('0x8'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x188c('0x1')]},'appdata':{'type':Sequelize[_0x188c('0x1')]},'projectId':{'type':Sequelize[_0x188c('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index c7aeedd..e910cef 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 _0x781d=['set','Content-Range','apply','save','update','then','error','name','send','map','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','VIRTUAL','filter','options','IntegrationReport','include','rows','show','rawAttributes','includeAll','find','create','body','params','catch','destroy','describe','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset'];(function(_0x11e400,_0x18c8e9){var _0x740902=function(_0x393c4a){while(--_0x393c4a){_0x11e400['push'](_0x11e400['shift']());}};_0x740902(++_0x18c8e9);}(_0x781d,0x14a));var _0xd781=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x781d[_0x618414];return _0x21c19a;};'use strict';var pdf=require(_0xd781('0x0'));var emlformat=require(_0xd781('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd781('0x2'));var rp=require(_0xd781('0x3'));var moment=require(_0xd781('0x4'));var BPromise=require(_0xd781('0x5'));var Mustache=require(_0xd781('0x6'));var util=require(_0xd781('0x7'));var path=require(_0xd781('0x8'));var sox=require(_0xd781('0x9'));var csv=require(_0xd781('0xa'));var ejs=require(_0xd781('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd781('0xc'));var crypto=require(_0xd781('0xd'));var jsforce=require(_0xd781('0xe'));var deskjs=require(_0xd781('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd781('0x10'));var Papa=require('papaparse');var Redis=require(_0xd781('0x11'));var authService=require(_0xd781('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd781('0x13'));var hardwareService=require(_0xd781('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd781('0x15'));var config=require(_0xd781('0x16'));var db=require(_0xd781('0x17'))['db'];function respondWithStatusCode(_0x17a929,_0xbea78b){_0xbea78b=_0xbea78b||0xcc;return function(_0x1f2f1e){if(_0x1f2f1e){return _0x17a929[_0xd781('0x18')](_0xbea78b);}return _0x17a929[_0xd781('0x19')](_0xbea78b)[_0xd781('0x1a')]();};}function respondWithResult(_0x12b1b2,_0xd454e7){_0xd454e7=_0xd454e7||0xc8;return function(_0x587953){if(_0x587953){return _0x12b1b2[_0xd781('0x19')](_0xd454e7)[_0xd781('0x1b')](_0x587953);}};}function respondWithFilteredResult(_0x498674,_0x3a1f48){return function(_0x48bffc){if(_0x48bffc){var _0x294e5a=_0x48bffc[_0xd781('0x1c')],_0x22d787=_0x3a1f48[_0xd781('0x1d')],_0x9f25f7=_0x3a1f48[_0xd781('0x1d')]+_0x3a1f48['limit'],_0x1409dd;if(_0x9f25f7>=_0x294e5a){_0x9f25f7=_0x294e5a;_0x1409dd=0xc8;}else{_0x1409dd=0xce;}_0x498674[_0xd781('0x19')](_0x1409dd);return _0x498674[_0xd781('0x1e')](_0xd781('0x1f'),_0x22d787+'-'+_0x9f25f7+'/'+_0x294e5a)[_0xd781('0x1b')](_0x48bffc);}return null;};}function patchUpdates(_0x3bf805){return function(_0x35e1bb){try{jsonpatch[_0xd781('0x20')](_0x35e1bb,_0x3bf805,!![]);}catch(_0x1d6fc7){return BPromise['reject'](_0x1d6fc7);}return _0x35e1bb[_0xd781('0x21')]();};}function saveUpdates(_0x3e8a37,_0x1036d3){return function(_0x103758){if(_0x103758){return _0x103758[_0xd781('0x22')](_0x3e8a37)[_0xd781('0x23')](function(_0x1adcbd){return _0x1adcbd;});}return null;};}function removeEntity(_0x5dd1f0,_0xe0c65f){return function(_0x4e2c56){if(_0x4e2c56){return _0x4e2c56['destroy']()[_0xd781('0x23')](function(){_0x5dd1f0['status'](0xcc)[_0xd781('0x1a')]();});}};}function handleEntityNotFound(_0x101480,_0x395087){return function(_0x31bf57){if(!_0x31bf57){_0x101480[_0xd781('0x18')](0x194);}return _0x31bf57;};}function handleError(_0x28f4fe,_0x221f14){_0x221f14=_0x221f14||0x1f4;return function(_0x316d43){logger[_0xd781('0x24')](_0x316d43['stack']);if(_0x316d43['name']){delete _0x316d43[_0xd781('0x25')];}_0x28f4fe[_0xd781('0x19')](_0x221f14)[_0xd781('0x26')](_0x316d43);};}exports['index']=function(_0xa1349e,_0x5a431b){var _0x47c609={},_0x1e29c8={},_0x54fe00={'count':0x0,'rows':[]};var _0x3e868=_[_0xd781('0x27')](db['IntegrationReport']['rawAttributes'],function(_0x43cc74){return{'name':_0x43cc74['fieldName'],'type':_0x43cc74[_0xd781('0x28')]['key']};});_0x1e29c8[_0xd781('0x29')]=_[_0xd781('0x27')](_0x3e868,'name');_0x1e29c8['query']=_[_0xd781('0x2a')](_0xa1349e[_0xd781('0x2b')]);_0x1e29c8[_0xd781('0x2c')]=_['intersection'](_0x1e29c8['model'],_0x1e29c8[_0xd781('0x2b')]);_0x47c609[_0xd781('0x2d')]=_[_0xd781('0x2e')](_0x1e29c8['model'],qs['fields'](_0xa1349e[_0xd781('0x2b')][_0xd781('0x2f')]));_0x47c609['attributes']=_0x47c609[_0xd781('0x2d')][_0xd781('0x30')]?_0x47c609['attributes']:_0x1e29c8[_0xd781('0x29')];if(!_0xa1349e[_0xd781('0x2b')][_0xd781('0x31')](_0xd781('0x32'))){_0x47c609['limit']=qs[_0xd781('0x33')](_0xa1349e[_0xd781('0x2b')][_0xd781('0x33')]);_0x47c609[_0xd781('0x1d')]=qs['offset'](_0xa1349e[_0xd781('0x2b')][_0xd781('0x1d')]);}_0x47c609['order']=qs[_0xd781('0x34')](_0xa1349e['query'][_0xd781('0x34')]);_0x47c609[_0xd781('0x35')]=qs['filters'](_[_0xd781('0x36')](_0xa1349e[_0xd781('0x2b')],_0x1e29c8['filters']));if(_0xa1349e[_0xd781('0x2b')]['filter']){_0x47c609[_0xd781('0x35')]=_[_0xd781('0x37')](_0x47c609['where'],{'$or':_[_0xd781('0x27')](_0x3e868,function(_0x1854c3){if(_0x1854c3['type']!==_0xd781('0x38')){var _0x34528f={};_0x34528f[_0x1854c3[_0xd781('0x25')]]={'$like':'%'+_0xa1349e['query'][_0xd781('0x39')]+'%'};return _0x34528f;}})});}_0x47c609=_[_0xd781('0x37')]({},_0x47c609,_0xa1349e[_0xd781('0x3a')]);var _0x6c67f3={'where':_0x47c609[_0xd781('0x35')]};return db[_0xd781('0x3b')][_0xd781('0x1c')](_0x6c67f3)[_0xd781('0x23')](function(_0x17a978){_0x54fe00['count']=_0x17a978;if(_0xa1349e[_0xd781('0x2b')]['includeAll']){_0x47c609[_0xd781('0x3c')]=[{'all':!![]}];}return db[_0xd781('0x3b')]['findAll'](_0x47c609);})[_0xd781('0x23')](function(_0x3d49f4){_0x54fe00[_0xd781('0x3d')]=_0x3d49f4;return _0x54fe00;})[_0xd781('0x23')](respondWithFilteredResult(_0x5a431b,_0x47c609))['catch'](handleError(_0x5a431b,null));};exports[_0xd781('0x3e')]=function(_0x515357,_0xb14b50){var _0xcdaacf={'raw':![],'where':{'id':_0x515357['params']['id']}},_0x5e3f9a={};_0x5e3f9a[_0xd781('0x29')]=_[_0xd781('0x2a')](db[_0xd781('0x3b')][_0xd781('0x3f')]);_0x5e3f9a['query']=_[_0xd781('0x2a')](_0x515357[_0xd781('0x2b')]);_0x5e3f9a['filters']=_['intersection'](_0x5e3f9a[_0xd781('0x29')],_0x5e3f9a[_0xd781('0x2b')]);_0xcdaacf[_0xd781('0x2d')]=_['intersection'](_0x5e3f9a['model'],qs[_0xd781('0x2f')](_0x515357[_0xd781('0x2b')][_0xd781('0x2f')]));_0xcdaacf[_0xd781('0x2d')]=_0xcdaacf[_0xd781('0x2d')][_0xd781('0x30')]?_0xcdaacf['attributes']:_0x5e3f9a['model'];if(_0x515357[_0xd781('0x2b')][_0xd781('0x40')]){_0xcdaacf[_0xd781('0x3c')]=[{'all':!![]}];}_0xcdaacf=_[_0xd781('0x37')]({},_0xcdaacf,_0x515357[_0xd781('0x3a')]);return db['IntegrationReport'][_0xd781('0x41')](_0xcdaacf)[_0xd781('0x23')](handleEntityNotFound(_0xb14b50,null))[_0xd781('0x23')](respondWithResult(_0xb14b50,null))['catch'](handleError(_0xb14b50,null));};exports[_0xd781('0x42')]=function(_0x14642a,_0x2f1f7a){return db['IntegrationReport'][_0xd781('0x42')](_0x14642a[_0xd781('0x43')],{})['then'](respondWithResult(_0x2f1f7a,0xc9))['catch'](handleError(_0x2f1f7a,null));};exports[_0xd781('0x22')]=function(_0x16d16e,_0x1efb2a){if(_0x16d16e['body']['id']){delete _0x16d16e[_0xd781('0x43')]['id'];}return db[_0xd781('0x3b')][_0xd781('0x41')]({'where':{'id':_0x16d16e[_0xd781('0x44')]['id']}})[_0xd781('0x23')](handleEntityNotFound(_0x1efb2a,null))[_0xd781('0x23')](saveUpdates(_0x16d16e[_0xd781('0x43')],null))['then'](respondWithResult(_0x1efb2a,null))[_0xd781('0x45')](handleError(_0x1efb2a,null));};exports[_0xd781('0x46')]=function(_0x1d54bd,_0x4c7cb6){return db[_0xd781('0x3b')][_0xd781('0x41')]({'where':{'id':_0x1d54bd['params']['id']}})[_0xd781('0x23')](handleEntityNotFound(_0x4c7cb6,null))[_0xd781('0x23')](removeEntity(_0x4c7cb6,null))[_0xd781('0x45')](handleError(_0x4c7cb6,null));};exports[_0xd781('0x47')]=function(_0x42a2f9,_0x599915){return db[_0xd781('0x3b')]['describe']()[_0xd781('0x23')](respondWithResult(_0x599915,null))['catch'](handleError(_0x599915,null));}; \ No newline at end of file +var _0x50a5=['util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','save','update','then','end','error','name','send','index','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','IntegrationReport','includeAll','findAll','catch','show','params','options','find','create','body','destroy','describe','html-pdf','eml-format','moment','mustache'];(function(_0x3f4782,_0x14afe5){var _0x59a36f=function(_0x273bc3){while(--_0x273bc3){_0x3f4782['push'](_0x3f4782['shift']());}};_0x59a36f(++_0x14afe5);}(_0x50a5,0xd1));var _0x550a=function(_0x35447d,_0xe81396){_0x35447d=_0x35447d-0x0;var _0xebaabe=_0x50a5[_0x35447d];return _0xebaabe;};'use strict';var pdf=require(_0x550a('0x0'));var emlformat=require(_0x550a('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x550a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x550a('0x3'));var util=require(_0x550a('0x4'));var path=require(_0x550a('0x5'));var sox=require(_0x550a('0x6'));var csv=require(_0x550a('0x7'));var ejs=require(_0x550a('0x8'));var fs=require('fs');var _=require(_0x550a('0x9'));var squel=require(_0x550a('0xa'));var crypto=require(_0x550a('0xb'));var jsforce=require(_0x550a('0xc'));var deskjs=require(_0x550a('0xd'));var toCsv=require(_0x550a('0x7'));var querystring=require(_0x550a('0xe'));var Papa=require('papaparse');var Redis=require(_0x550a('0xf'));var authService=require(_0x550a('0x10'));var qs=require(_0x550a('0x11'));var as=require(_0x550a('0x12'));var hardwareService=require(_0x550a('0x13'));var logger=require(_0x550a('0x14'))('api');var utils=require(_0x550a('0x15'));var config=require(_0x550a('0x16'));var db=require(_0x550a('0x17'))['db'];function respondWithStatusCode(_0x16b5ba,_0x2fb177){_0x2fb177=_0x2fb177||0xcc;return function(_0x38b9fe){if(_0x38b9fe){return _0x16b5ba[_0x550a('0x18')](_0x2fb177);}return _0x16b5ba[_0x550a('0x19')](_0x2fb177)['end']();};}function respondWithResult(_0x2b53bd,_0x4d22ea){_0x4d22ea=_0x4d22ea||0xc8;return function(_0x535eab){if(_0x535eab){return _0x2b53bd[_0x550a('0x19')](_0x4d22ea)[_0x550a('0x1a')](_0x535eab);}};}function respondWithFilteredResult(_0x4aee75,_0x23d2db){return function(_0x4d1cb8){if(_0x4d1cb8){var _0x388aaa=_0x4d1cb8[_0x550a('0x1b')],_0x4fa030=_0x23d2db[_0x550a('0x1c')],_0x2a9f66=_0x23d2db[_0x550a('0x1c')]+_0x23d2db[_0x550a('0x1d')],_0x390297;if(_0x2a9f66>=_0x388aaa){_0x2a9f66=_0x388aaa;_0x390297=0xc8;}else{_0x390297=0xce;}_0x4aee75['status'](_0x390297);return _0x4aee75[_0x550a('0x1e')]('Content-Range',_0x4fa030+'-'+_0x2a9f66+'/'+_0x388aaa)[_0x550a('0x1a')](_0x4d1cb8);}return null;};}function patchUpdates(_0x142a9f){return function(_0x3d01ae){try{jsonpatch[_0x550a('0x1f')](_0x3d01ae,_0x142a9f,!![]);}catch(_0x59d3f1){return BPromise['reject'](_0x59d3f1);}return _0x3d01ae[_0x550a('0x20')]();};}function saveUpdates(_0x154174,_0x252242){return function(_0x1556c3){if(_0x1556c3){return _0x1556c3[_0x550a('0x21')](_0x154174)[_0x550a('0x22')](function(_0x2b2ee8){return _0x2b2ee8;});}return null;};}function removeEntity(_0xb1b040,_0x3d1c2d){return function(_0x1fcf3b){if(_0x1fcf3b){return _0x1fcf3b['destroy']()[_0x550a('0x22')](function(){_0xb1b040[_0x550a('0x19')](0xcc)[_0x550a('0x23')]();});}};}function handleEntityNotFound(_0x512517,_0x2d03e5){return function(_0x18aa4b){if(!_0x18aa4b){_0x512517['sendStatus'](0x194);}return _0x18aa4b;};}function handleError(_0x1d9a2f,_0x5f2b67){_0x5f2b67=_0x5f2b67||0x1f4;return function(_0x592dd7){logger[_0x550a('0x24')](_0x592dd7['stack']);if(_0x592dd7[_0x550a('0x25')]){delete _0x592dd7['name'];}_0x1d9a2f['status'](_0x5f2b67)[_0x550a('0x26')](_0x592dd7);};}exports[_0x550a('0x27')]=function(_0x19cbca,_0x1eadba){var _0x288187={},_0x13b611={},_0x1996a4={'count':0x0,'rows':[]};var _0x2c6c76=_['map'](db['IntegrationReport'][_0x550a('0x28')],function(_0x1d0a05){return{'name':_0x1d0a05[_0x550a('0x29')],'type':_0x1d0a05['type'][_0x550a('0x2a')]};});_0x13b611['model']=_[_0x550a('0x2b')](_0x2c6c76,_0x550a('0x25'));_0x13b611[_0x550a('0x2c')]=_[_0x550a('0x2d')](_0x19cbca[_0x550a('0x2c')]);_0x13b611[_0x550a('0x2e')]=_[_0x550a('0x2f')](_0x13b611[_0x550a('0x30')],_0x13b611[_0x550a('0x2c')]);_0x288187[_0x550a('0x31')]=_[_0x550a('0x2f')](_0x13b611['model'],qs[_0x550a('0x32')](_0x19cbca[_0x550a('0x2c')]['fields']));_0x288187[_0x550a('0x31')]=_0x288187[_0x550a('0x31')]['length']?_0x288187[_0x550a('0x31')]:_0x13b611['model'];if(!_0x19cbca[_0x550a('0x2c')][_0x550a('0x33')](_0x550a('0x34'))){_0x288187['limit']=qs[_0x550a('0x1d')](_0x19cbca['query'][_0x550a('0x1d')]);_0x288187[_0x550a('0x1c')]=qs[_0x550a('0x1c')](_0x19cbca[_0x550a('0x2c')][_0x550a('0x1c')]);}_0x288187[_0x550a('0x35')]=qs[_0x550a('0x36')](_0x19cbca[_0x550a('0x2c')][_0x550a('0x36')]);_0x288187[_0x550a('0x37')]=qs[_0x550a('0x2e')](_[_0x550a('0x38')](_0x19cbca[_0x550a('0x2c')],_0x13b611[_0x550a('0x2e')]));if(_0x19cbca['query'][_0x550a('0x39')]){_0x288187['where']=_[_0x550a('0x3a')](_0x288187[_0x550a('0x37')],{'$or':_[_0x550a('0x2b')](_0x2c6c76,function(_0x5cd75d){if(_0x5cd75d['type']!=='VIRTUAL'){var _0x9f2828={};_0x9f2828[_0x5cd75d['name']]={'$like':'%'+_0x19cbca[_0x550a('0x2c')][_0x550a('0x39')]+'%'};return _0x9f2828;}})});}_0x288187=_[_0x550a('0x3a')]({},_0x288187,_0x19cbca['options']);var _0x1eb4f7={'where':_0x288187[_0x550a('0x37')]};return db[_0x550a('0x3b')][_0x550a('0x1b')](_0x1eb4f7)[_0x550a('0x22')](function(_0x43c59d){_0x1996a4[_0x550a('0x1b')]=_0x43c59d;if(_0x19cbca['query'][_0x550a('0x3c')]){_0x288187['include']=[{'all':!![]}];}return db['IntegrationReport'][_0x550a('0x3d')](_0x288187);})['then'](function(_0x1ea050){_0x1996a4['rows']=_0x1ea050;return _0x1996a4;})['then'](respondWithFilteredResult(_0x1eadba,_0x288187))[_0x550a('0x3e')](handleError(_0x1eadba,null));};exports[_0x550a('0x3f')]=function(_0xd38459,_0x14507e){var _0x44ee5f={'raw':![],'where':{'id':_0xd38459[_0x550a('0x40')]['id']}},_0x2a6b39={};_0x2a6b39[_0x550a('0x30')]=_[_0x550a('0x2d')](db[_0x550a('0x3b')]['rawAttributes']);_0x2a6b39['query']=_[_0x550a('0x2d')](_0xd38459[_0x550a('0x2c')]);_0x2a6b39['filters']=_[_0x550a('0x2f')](_0x2a6b39[_0x550a('0x30')],_0x2a6b39[_0x550a('0x2c')]);_0x44ee5f[_0x550a('0x31')]=_[_0x550a('0x2f')](_0x2a6b39[_0x550a('0x30')],qs[_0x550a('0x32')](_0xd38459[_0x550a('0x2c')]['fields']));_0x44ee5f['attributes']=_0x44ee5f[_0x550a('0x31')]['length']?_0x44ee5f[_0x550a('0x31')]:_0x2a6b39[_0x550a('0x30')];if(_0xd38459['query'][_0x550a('0x3c')]){_0x44ee5f['include']=[{'all':!![]}];}_0x44ee5f=_[_0x550a('0x3a')]({},_0x44ee5f,_0xd38459[_0x550a('0x41')]);return db['IntegrationReport'][_0x550a('0x42')](_0x44ee5f)[_0x550a('0x22')](handleEntityNotFound(_0x14507e,null))[_0x550a('0x22')](respondWithResult(_0x14507e,null))['catch'](handleError(_0x14507e,null));};exports[_0x550a('0x43')]=function(_0x1f5b90,_0x2e30b7){return db[_0x550a('0x3b')]['create'](_0x1f5b90[_0x550a('0x44')],{})[_0x550a('0x22')](respondWithResult(_0x2e30b7,0xc9))[_0x550a('0x3e')](handleError(_0x2e30b7,null));};exports['update']=function(_0x3f852b,_0x4d7561){if(_0x3f852b['body']['id']){delete _0x3f852b['body']['id'];}return db[_0x550a('0x3b')][_0x550a('0x42')]({'where':{'id':_0x3f852b[_0x550a('0x40')]['id']}})[_0x550a('0x22')](handleEntityNotFound(_0x4d7561,null))[_0x550a('0x22')](saveUpdates(_0x3f852b[_0x550a('0x44')],null))['then'](respondWithResult(_0x4d7561,null))[_0x550a('0x3e')](handleError(_0x4d7561,null));};exports[_0x550a('0x45')]=function(_0x4be114,_0x18a9b5){return db['IntegrationReport'][_0x550a('0x42')]({'where':{'id':_0x4be114[_0x550a('0x40')]['id']}})[_0x550a('0x22')](handleEntityNotFound(_0x18a9b5,null))[_0x550a('0x22')](removeEntity(_0x18a9b5,null))[_0x550a('0x3e')](handleError(_0x18a9b5,null));};exports[_0x550a('0x46')]=function(_0x4035d1,_0x5a31f1){return db[_0x550a('0x3b')]['describe']()[_0x550a('0x22')](respondWithResult(_0x5a31f1,null))['catch'](handleError(_0x5a31f1,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 2e7c10e..be9ffcd 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 _0xde76=['bluebird','request-promise','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','../../config/logger','moment'];(function(_0x984e97,_0x2c72e7){var _0x3630e5=function(_0x3ef0c9){while(--_0x3ef0c9){_0x984e97['push'](_0x984e97['shift']());}};_0x3630e5(++_0x2c72e7);}(_0xde76,0x1e8));var _0x6de7=function(_0x479400,_0x47e432){_0x479400=_0x479400-0x0;var _0x243341=_0xde76[_0x479400];return _0x243341;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6de7('0x0'))('api');var moment=require(_0x6de7('0x1'));var BPromise=require(_0x6de7('0x2'));var rp=require(_0x6de7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6de7('0x4'));var config=require(_0x6de7('0x5'));var attributes=require(_0x6de7('0x6'));module[_0x6de7('0x7')]=function(_0x1daa6e,_0x4e4c33){return _0x1daa6e[_0x6de7('0x8')](_0x6de7('0x9'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabe6=['bluebird','../../config/environment','./integrationReport.attributes','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment'];(function(_0x3ee5cd,_0x3023f6){var _0x593fa4=function(_0x266f68){while(--_0x266f68){_0x3ee5cd['push'](_0x3ee5cd['shift']());}};_0x593fa4(++_0x3023f6);}(_0xabe6,0xb6));var _0x6abe=function(_0x48eb56,_0x4bbc10){_0x48eb56=_0x48eb56-0x0;var _0xba9bfe=_0xabe6[_0x48eb56];return _0xba9bfe;};'use strict';var _=require(_0x6abe('0x0'));var util=require(_0x6abe('0x1'));var logger=require(_0x6abe('0x2'))(_0x6abe('0x3'));var moment=require(_0x6abe('0x4'));var BPromise=require(_0x6abe('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6abe('0x6'));var attributes=require(_0x6abe('0x7'));module['exports']=function(_0x3f75b2,_0x510425){return _0x3f75b2[_0x6abe('0x8')](_0x6abe('0x9'),attributes,{'tableName':_0x6abe('0xa'),'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 08c0984..b6783d1 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x296897,_0x4d23ea){var _0x2b44ab=function(_0xdf90d8){while(--_0xdf90d8){_0x296897['push'](_0x296897['shift']());}};_0x2b44ab(++_0x4d23ea);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ 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(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x8603,0x190));var _0x3860=function(_0x56e6e9,_0x291627){_0x56e6e9=_0x56e6e9-0x0;var _0x5e3a01=_0x8603[_0x56e6e9];return _0x5e3a01;};'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 37f15df..d55f402 100644 --- a/server/api/interval/index.js +++ b/server/api/interval/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['./interval.controller','get','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','/:id','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1d7acf,_0xb750d1){var _0x3d064d=function(_0x835f87){while(--_0x835f87){_0x1d7acf['push'](_0x1d7acf['shift']());}};_0x3d064d(++_0xb750d1);}(_0x34e8,0x12c));var _0x834e=function(_0x1a4cc6,_0x2a4420){_0x1a4cc6=_0x1a4cc6-0x0;var _0xebee5a=_0x34e8[_0x1a4cc6];return _0xebee5a;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/:id',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0x9')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0xe')]('/',auth[_0x834e('0xa')](),controller[_0x834e('0xf')]);router[_0x834e('0xe')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0x10')]);router[_0x834e('0xe')](_0x834e('0x11'),auth[_0x834e('0xa')](),controller[_0x834e('0x12')]);router['put'](_0x834e('0x13'),auth[_0x834e('0xa')](),controller['update']);router[_0x834e('0x14')](_0x834e('0x13'),auth[_0x834e('0xa')](),controller[_0x834e('0x15')]);module['exports']=router; \ No newline at end of file +var _0x9c44=['../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','addInterval','addIntervals','put','update','destroy','exports','path','connect-timeout','express','Router'];(function(_0x542e9f,_0x67b409){var _0x45230b=function(_0x3a6ae3){while(--_0x3a6ae3){_0x542e9f['push'](_0x542e9f['shift']());}};_0x45230b(++_0x67b409);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./interval.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x49c4('0xd')](_0x49c4('0xb'),auth['isAuthenticated'](),controller[_0x49c4('0xe')]);router[_0x49c4('0xd')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0x11')]);router['delete'](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x12')]);module[_0x49c4('0x13')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index c7acda7..cdb5f94 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 _0x9bab=['sequelize','STRING'];(function(_0x19bd8d,_0x1a4bb6){var _0x41a285=function(_0x2766db){while(--_0x2766db){_0x19bd8d['push'](_0x19bd8d['shift']());}};_0x41a285(++_0x1a4bb6);}(_0x9bab,0x1ae));var _0xb9ba=function(_0x1f19c7,_0x425b41){_0x1f19c7=_0x1f19c7-0x0;var _0x3580b4=_0x9bab[_0x1f19c7];return _0x3580b4;};'use strict';var Sequelize=require(_0xb9ba('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb9ba('0x1')]},'interval':{'type':Sequelize[_0xb9ba('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xb2fd=['exports','STRING','sequelize'];(function(_0x2a484c,_0x407cee){var _0x2b4eb5=function(_0x14870b){while(--_0x14870b){_0x2a484c['push'](_0x2a484c['shift']());}};_0x2b4eb5(++_0x407cee);}(_0xb2fd,0x122));var _0xdb2f=function(_0x406945,_0x528a28){_0x406945=_0x406945-0x0;var _0x27756e=_0xb2fd[_0x406945];return _0x27756e;};'use strict';var Sequelize=require(_0xdb2f('0x0'));module[_0xdb2f('0x1')]={'name':{'type':Sequelize[_0xdb2f('0x2')]},'description':{'type':Sequelize[_0xdb2f('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 7000e33..496e3d5 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 _0x9c44=['length','nolimit','limit','sort','where','pick','filter','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addInterval','IntervalId','order','getIntervals','hasOwnProperty','addIntervals','findOne','sequelize','bulkCreate','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','../../components/extensions/rewrite','status','end','json','offset','set','Content-Range','reject','save','update','then','destroy','get','Intervals','UserProfileResource','sendStatus','stack','name','index','map','Interval','rawAttributes','model','query','keys','filters','intersection','fields','attributes'];(function(_0x4fe596,_0x4da7ad){var _0x18071a=function(_0x45ed4d){while(--_0x45ed4d){_0x4fe596['push'](_0x4fe596['shift']());}};_0x18071a(++_0x4da7ad);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'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'];var extensions=require(_0x49c4('0x14'));function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x15')](_0x7df3a9)[_0x49c4('0x16')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x15')](_0x2decee)[_0x49c4('0x17')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=_0x3acd06['count'],_0x13a2db=_0x58d177[_0x49c4('0x18')],_0x81e831=_0x58d177[_0x49c4('0x18')]+_0x58d177['limit'],_0x2abc78;if(_0x81e831>=_0x141003){_0x81e831=_0x141003;_0x2abc78=0xc8;}else{_0x2abc78=0xce;}_0x3de397['status'](_0x2abc78);return _0x3de397[_0x49c4('0x19')](_0x49c4('0x1a'),_0x13a2db+'-'+_0x81e831+'/'+_0x141003)[_0x49c4('0x17')](_0x3acd06);}return null;};}function patchUpdates(_0x59f29b){return function(_0x24856d){try{jsonpatch['apply'](_0x24856d,_0x59f29b,!![]);}catch(_0x2cbd50){return BPromise[_0x49c4('0x1b')](_0x2cbd50);}return _0x24856d[_0x49c4('0x1c')]();};}function saveUpdates(_0x291526,_0x382040){return function(_0x41078c){if(_0x41078c){return _0x41078c[_0x49c4('0x1d')](_0x291526)[_0x49c4('0x1e')](function(_0x2197d2){return _0x2197d2;});}return null;};}function removeEntity(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x1f')]()['then'](function(){var _0x592bb8=_0x57f502[_0x49c4('0x20')]({'plain':!![]});var _0x15581b=_0x49c4('0x21');return db[_0x49c4('0x22')]['destroy']({'where':{'type':_0x15581b,'resourceId':_0x592bb8['id']}})['then'](function(){return _0x57f502;});})[_0x49c4('0x1e')](function(){_0x578447[_0x49c4('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x207358,_0x43e014){return function(_0x210159){if(!_0x210159){_0x207358[_0x49c4('0x23')](0x194);}return _0x210159;};}function handleError(_0x531d92,_0x543ea2){_0x543ea2=_0x543ea2||0x1f4;return function(_0x449960){logger['error'](_0x449960[_0x49c4('0x24')]);if(_0x449960[_0x49c4('0x25')]){delete _0x449960[_0x49c4('0x25')];}_0x531d92[_0x49c4('0x15')](_0x543ea2)['send'](_0x449960);};}exports[_0x49c4('0x26')]=function(_0x2b2793,_0x46e04d){var _0x4f28a2={},_0x6329b3={},_0x29f835={'count':0x0,'rows':[]};var _0x26ba17=_[_0x49c4('0x27')](db[_0x49c4('0x28')][_0x49c4('0x29')],function(_0x46f7ea){return{'name':_0x46f7ea['fieldName'],'type':_0x46f7ea['type']['key']};});_0x6329b3[_0x49c4('0x2a')]=_[_0x49c4('0x27')](_0x26ba17,_0x49c4('0x25'));_0x6329b3[_0x49c4('0x2b')]=_[_0x49c4('0x2c')](_0x2b2793['query']);_0x6329b3[_0x49c4('0x2d')]=_[_0x49c4('0x2e')](_0x6329b3[_0x49c4('0x2a')],_0x6329b3[_0x49c4('0x2b')]);_0x4f28a2['attributes']=_['intersection'](_0x6329b3[_0x49c4('0x2a')],qs[_0x49c4('0x2f')](_0x2b2793[_0x49c4('0x2b')][_0x49c4('0x2f')]));_0x4f28a2[_0x49c4('0x30')]=_0x4f28a2['attributes'][_0x49c4('0x31')]?_0x4f28a2[_0x49c4('0x30')]:_0x6329b3[_0x49c4('0x2a')];if(!_0x2b2793['query']['hasOwnProperty'](_0x49c4('0x32'))){_0x4f28a2[_0x49c4('0x33')]=qs[_0x49c4('0x33')](_0x2b2793[_0x49c4('0x2b')][_0x49c4('0x33')]);_0x4f28a2[_0x49c4('0x18')]=qs[_0x49c4('0x18')](_0x2b2793[_0x49c4('0x2b')][_0x49c4('0x18')]);}_0x4f28a2['order']=qs[_0x49c4('0x34')](_0x2b2793['query'][_0x49c4('0x34')]);_0x4f28a2[_0x49c4('0x35')]=qs[_0x49c4('0x2d')](_[_0x49c4('0x36')](_0x2b2793['query'],_0x6329b3[_0x49c4('0x2d')]));if(_0x2b2793[_0x49c4('0x2b')][_0x49c4('0x37')]){_0x4f28a2['where']=_[_0x49c4('0x38')](_0x4f28a2[_0x49c4('0x35')],{'$or':_[_0x49c4('0x27')](_0x26ba17,function(_0x5e5366){if(_0x5e5366[_0x49c4('0x39')]!==_0x49c4('0x3a')){var _0x143916={};_0x143916[_0x5e5366[_0x49c4('0x25')]]={'$like':'%'+_0x2b2793[_0x49c4('0x2b')][_0x49c4('0x37')]+'%'};return _0x143916;}})});}_0x4f28a2=_[_0x49c4('0x38')]({},_0x4f28a2,_0x2b2793['options']);var _0x2d2510={'where':_0x4f28a2[_0x49c4('0x35')]};return db[_0x49c4('0x28')][_0x49c4('0x3b')](_0x2d2510)[_0x49c4('0x1e')](function(_0x29dd5d){_0x29f835[_0x49c4('0x3b')]=_0x29dd5d;if(_0x2b2793[_0x49c4('0x2b')][_0x49c4('0x3c')]){_0x4f28a2[_0x49c4('0x3d')]=[{'all':!![]}];}return db[_0x49c4('0x28')][_0x49c4('0x3e')](_0x4f28a2);})[_0x49c4('0x1e')](function(_0x4e38bc){_0x29f835[_0x49c4('0x3f')]=_0x4e38bc;return _0x29f835;})['then'](respondWithFilteredResult(_0x46e04d,_0x4f28a2))[_0x49c4('0x40')](handleError(_0x46e04d,null));};exports[_0x49c4('0x41')]=function(_0x28d4fb,_0x1480da){var _0x239327={'raw':!![],'where':{'id':_0x28d4fb['params']['id']}},_0x281b83={};_0x281b83['model']=_[_0x49c4('0x2c')](db[_0x49c4('0x28')][_0x49c4('0x29')]);_0x281b83[_0x49c4('0x2b')]=_['keys'](_0x28d4fb[_0x49c4('0x2b')]);_0x281b83[_0x49c4('0x2d')]=_[_0x49c4('0x2e')](_0x281b83[_0x49c4('0x2a')],_0x281b83[_0x49c4('0x2b')]);_0x239327[_0x49c4('0x30')]=_[_0x49c4('0x2e')](_0x281b83[_0x49c4('0x2a')],qs[_0x49c4('0x2f')](_0x28d4fb['query'][_0x49c4('0x2f')]));_0x239327['attributes']=_0x239327[_0x49c4('0x30')][_0x49c4('0x31')]?_0x239327[_0x49c4('0x30')]:_0x281b83[_0x49c4('0x2a')];if(_0x28d4fb[_0x49c4('0x2b')]['includeAll']){_0x239327[_0x49c4('0x3d')]=[{'all':!![]}];}_0x239327=_[_0x49c4('0x38')]({},_0x239327,_0x28d4fb[_0x49c4('0x42')]);return db[_0x49c4('0x28')][_0x49c4('0x43')](_0x239327)[_0x49c4('0x1e')](handleEntityNotFound(_0x1480da,null))[_0x49c4('0x1e')](respondWithResult(_0x1480da,null))['catch'](handleError(_0x1480da,null));};exports[_0x49c4('0x44')]=function(_0x5cfff9,_0x3f7379){return db[_0x49c4('0x28')][_0x49c4('0x44')](_0x5cfff9[_0x49c4('0x45')],{})[_0x49c4('0x1e')](function(_0x30bea5){var _0x2c6be1=_0x5cfff9['user'][_0x49c4('0x20')]({'plain':!![]});if(!_0x2c6be1)throw new Error(_0x49c4('0x46'));if(_0x2c6be1['role']===_0x49c4('0x47')){var _0xaece5f=_0x30bea5[_0x49c4('0x20')]({'plain':!![]});var _0x242afc='Intervals';return db['UserProfileSection'][_0x49c4('0x43')]({'where':{'name':_0x242afc,'userProfileId':_0x2c6be1['userProfileId']},'raw':!![]})[_0x49c4('0x1e')](function(_0x1f941f){if(_0x1f941f&&_0x1f941f[_0x49c4('0x48')]===0x0){return db[_0x49c4('0x22')][_0x49c4('0x44')]({'name':_0xaece5f[_0x49c4('0x25')],'resourceId':_0xaece5f['id'],'type':_0x1f941f[_0x49c4('0x25')],'sectionId':_0x1f941f['id']},{})['then'](function(){return _0x30bea5;});}else{return _0x30bea5;}})[_0x49c4('0x40')](function(_0x1550ce){logger[_0x49c4('0x49')](_0x49c4('0x4a'),_0x1550ce);throw _0x1550ce;});}return _0x30bea5;})[_0x49c4('0x1e')](respondWithResult(_0x3f7379,0xc9))[_0x49c4('0x40')](handleError(_0x3f7379,null));};exports[_0x49c4('0x1d')]=function(_0x25d174,_0x1e0b4f){if(_0x25d174[_0x49c4('0x45')]['id']){delete _0x25d174['body']['id'];}return db['Interval'][_0x49c4('0x43')]({'where':{'id':_0x25d174[_0x49c4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1e0b4f,null))['then'](saveUpdates(_0x25d174[_0x49c4('0x45')],null))['then'](respondWithResult(_0x1e0b4f,null))['catch'](handleError(_0x1e0b4f,null));};exports[_0x49c4('0x1f')]=function(_0x4081a5,_0x4a0a93){return db[_0x49c4('0x28')][_0x49c4('0x43')]({'where':{'id':_0x4081a5[_0x49c4('0x4b')]['id']}})[_0x49c4('0x1e')](handleEntityNotFound(_0x4a0a93,null))['then'](removeEntity(_0x4a0a93,null))[_0x49c4('0x40')](handleError(_0x4a0a93,null));};exports[_0x49c4('0x4c')]=function(_0x207572,_0x208208,_0x73840f){if(_0x207572[_0x49c4('0x45')]['id']){delete _0x207572['body']['id'];}return db['Interval'][_0x49c4('0x43')]({'where':{'id':_0x207572[_0x49c4('0x4b')]['id']}})[_0x49c4('0x1e')](handleEntityNotFound(_0x208208,null))[_0x49c4('0x1e')](function(_0x23288e){if(_0x23288e){_0x207572[_0x49c4('0x45')][_0x49c4('0x4d')]=_0x23288e['id'];return db['Interval'][_0x49c4('0x44')](_0x207572[_0x49c4('0x45')]);}})['then'](respondWithResult(_0x208208,null))[_0x49c4('0x40')](handleError(_0x208208,null));};exports['getIntervals']=function(_0x2f966c,_0x147ebd,_0x9eaa84){var _0x2fe89a={};var _0x845f7e={};var _0x3e44d7;var _0x3eb66d;return db[_0x49c4('0x28')]['findOne']({'where':{'id':_0x2f966c[_0x49c4('0x4b')]['id']}})[_0x49c4('0x1e')](handleEntityNotFound(_0x147ebd,null))['then'](function(_0x10dec7){if(_0x10dec7){_0x3e44d7=_0x10dec7;_0x845f7e[_0x49c4('0x2a')]=_['keys'](db[_0x49c4('0x28')][_0x49c4('0x29')]);_0x845f7e['query']=_['keys'](_0x2f966c['query']);_0x845f7e['filters']=_[_0x49c4('0x2e')](_0x845f7e['model'],_0x845f7e[_0x49c4('0x2b')]);_0x2fe89a[_0x49c4('0x30')]=_['intersection'](_0x845f7e[_0x49c4('0x2a')],qs[_0x49c4('0x2f')](_0x2f966c['query'][_0x49c4('0x2f')]));_0x2fe89a[_0x49c4('0x30')]=_0x2fe89a[_0x49c4('0x30')][_0x49c4('0x31')]?_0x2fe89a['attributes']:_0x845f7e[_0x49c4('0x2a')];_0x2fe89a[_0x49c4('0x4e')]=qs[_0x49c4('0x34')](_0x2f966c[_0x49c4('0x2b')]['sort']);_0x2fe89a[_0x49c4('0x35')]=qs['filters'](_['pick'](_0x2f966c['query'],_0x845f7e['filters']));if(_0x2f966c[_0x49c4('0x2b')][_0x49c4('0x37')]){_0x2fe89a[_0x49c4('0x35')]=_[_0x49c4('0x38')](_0x2fe89a['where'],{'$or':_['map'](_0x2fe89a[_0x49c4('0x30')],function(_0x109b81){var _0x342326={};_0x342326[_0x109b81]={'$like':'%'+_0x2f966c[_0x49c4('0x2b')][_0x49c4('0x37')]+'%'};return _0x342326;})});}_0x2fe89a=_[_0x49c4('0x38')]({},_0x2fe89a,_0x2f966c[_0x49c4('0x42')]);return _0x3e44d7[_0x49c4('0x4f')](_0x2fe89a);}})['then'](function(_0x2276db){if(_0x2276db){_0x3eb66d=_0x2276db['length'];if(!_0x2f966c[_0x49c4('0x2b')][_0x49c4('0x50')](_0x49c4('0x32'))){_0x2fe89a[_0x49c4('0x33')]=qs[_0x49c4('0x33')](_0x2f966c[_0x49c4('0x2b')][_0x49c4('0x33')]);_0x2fe89a[_0x49c4('0x18')]=qs[_0x49c4('0x18')](_0x2f966c[_0x49c4('0x2b')][_0x49c4('0x18')]);}return _0x3e44d7[_0x49c4('0x4f')](_0x2fe89a);}})[_0x49c4('0x1e')](function(_0x14bd09){if(_0x14bd09){return _0x14bd09?{'count':_0x3eb66d,'rows':_0x14bd09}:null;}})[_0x49c4('0x1e')](respondWithResult(_0x147ebd,null))[_0x49c4('0x40')](handleError(_0x147ebd,null));};exports[_0x49c4('0x51')]=function(_0x3485c0,_0x4e1544,_0x5ec201){return db[_0x49c4('0x28')][_0x49c4('0x52')]({'where':{'id':_0x3485c0['params']['id']}})[_0x49c4('0x1e')](handleEntityNotFound(_0x4e1544,null))[_0x49c4('0x1e')](function(_0x2939fd){if(_0x2939fd){return db[_0x49c4('0x53')]['transaction'](function(_0x5a14a5){return db['Interval'][_0x49c4('0x1f')]({'where':{'IntervalId':_0x3485c0[_0x49c4('0x4b')]['id']},'transaction':_0x5a14a5})[_0x49c4('0x1e')](function(_0x2f4289){var _0x118fc4=_[_0x49c4('0x27')](_0x3485c0[_0x49c4('0x45')],function(_0x3692a4){delete _0x3692a4['id'];_0x3692a4[_0x49c4('0x4d')]=_0x3485c0['params']['id'];return _0x3692a4;});return db[_0x49c4('0x28')][_0x49c4('0x54')](_0x118fc4,{'transaction':_0x5a14a5});});})[_0x49c4('0x1e')](function(){return db['Interval'][_0x49c4('0x3e')]({'where':{'IntervalId':_0x3485c0[_0x49c4('0x4b')]['id']}});});}})[_0x49c4('0x1e')](respondWithResult(_0x4e1544,null))[_0x49c4('0x40')](handleError(_0x4e1544,null));}; \ No newline at end of file +var _0x55ca=['pick','filter','merge','where','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','user','role','Intervals','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','addInterval','IntervalId','getIntervals','findOne','order','options','addIntervals','sequelize','transaction','html-pdf','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','end','sendStatus','error','name','send','Interval','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x5cd577,_0x52484f){var _0x4803cb=function(_0x19b20b){while(--_0x19b20b){_0x5cd577['push'](_0x5cd577['shift']());}};_0x4803cb(++_0x52484f);}(_0x55ca,0x126));var _0xa55c=function(_0x15da5f,_0x3fce0e){_0x15da5f=_0x15da5f-0x0;var _0x1992f1=_0x55ca[_0x15da5f];return _0x1992f1;};'use strict';var pdf=require(_0xa55c('0x0'));var emlformat=require(_0xa55c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa55c('0x2'));var moment=require(_0xa55c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa55c('0x4'));var util=require(_0xa55c('0x5'));var path=require(_0xa55c('0x6'));var sox=require(_0xa55c('0x7'));var csv=require(_0xa55c('0x8'));var ejs=require(_0xa55c('0x9'));var fs=require('fs');var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x8'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var db=require(_0xa55c('0x16'))['db'];var extensions=require(_0xa55c('0x17'));function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=_0x3ccf65[_0xa55c('0x1a')],_0x25934f=_0x4e0b2f[_0xa55c('0x1b')],_0x31e10d=_0x4e0b2f[_0xa55c('0x1b')]+_0x4e0b2f[_0xa55c('0x1c')],_0x1c4cfd;if(_0x31e10d>=_0x3dcf4f){_0x31e10d=_0x3dcf4f;_0x1c4cfd=0xc8;}else{_0x1c4cfd=0xce;}_0x247e77['status'](_0x1c4cfd);return _0x247e77[_0xa55c('0x1d')](_0xa55c('0x1e'),_0x25934f+'-'+_0x31e10d+'/'+_0x3dcf4f)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x358b61){return function(_0x23a1ae){try{jsonpatch[_0xa55c('0x1f')](_0x23a1ae,_0x358b61,!![]);}catch(_0x4c0daf){return BPromise['reject'](_0x4c0daf);}return _0x23a1ae[_0xa55c('0x20')]();};}function saveUpdates(_0x3776ac,_0xade4c4){return function(_0x4cfe10){if(_0x4cfe10){return _0x4cfe10[_0xa55c('0x21')](_0x3776ac)[_0xa55c('0x22')](function(_0x54945a){return _0x54945a;});}return null;};}function removeEntity(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x23')]()[_0xa55c('0x22')](function(){var _0x49ed04=_0x940f28[_0xa55c('0x24')]({'plain':!![]});var _0x504c24='Intervals';return db['UserProfileResource'][_0xa55c('0x23')]({'where':{'type':_0x504c24,'resourceId':_0x49ed04['id']}})['then'](function(){return _0x940f28;});})[_0xa55c('0x22')](function(){_0x187a87[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0xf0e574,_0x2313a9){return function(_0x170ba4){if(!_0x170ba4){_0xf0e574[_0xa55c('0x26')](0x194);}return _0x170ba4;};}function handleError(_0x11e7f7,_0x192df2){_0x192df2=_0x192df2||0x1f4;return function(_0x3cd152){logger[_0xa55c('0x27')](_0x3cd152['stack']);if(_0x3cd152[_0xa55c('0x28')]){delete _0x3cd152[_0xa55c('0x28')];}_0x11e7f7[_0xa55c('0x18')](_0x192df2)[_0xa55c('0x29')](_0x3cd152);};}exports['index']=function(_0x1377b0,_0x22f6b6){var _0x1b8388={},_0x201941={},_0x45ee8d={'count':0x0,'rows':[]};var _0x3c3cb5=_['map'](db[_0xa55c('0x2a')]['rawAttributes'],function(_0x35c9c2){return{'name':_0x35c9c2[_0xa55c('0x2b')],'type':_0x35c9c2[_0xa55c('0x2c')][_0xa55c('0x2d')]};});_0x201941['model']=_[_0xa55c('0x2e')](_0x3c3cb5,_0xa55c('0x28'));_0x201941[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x1377b0[_0xa55c('0x2f')]);_0x201941[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x201941[_0xa55c('0x33')],_0x201941[_0xa55c('0x2f')]);_0x1b8388[_0xa55c('0x34')]=_[_0xa55c('0x32')](_0x201941['model'],qs['fields'](_0x1377b0[_0xa55c('0x2f')][_0xa55c('0x35')]));_0x1b8388['attributes']=_0x1b8388[_0xa55c('0x34')][_0xa55c('0x36')]?_0x1b8388[_0xa55c('0x34')]:_0x201941[_0xa55c('0x33')];if(!_0x1377b0[_0xa55c('0x2f')][_0xa55c('0x37')](_0xa55c('0x38'))){_0x1b8388[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x1377b0['query']['limit']);_0x1b8388['offset']=qs[_0xa55c('0x1b')](_0x1377b0[_0xa55c('0x2f')][_0xa55c('0x1b')]);}_0x1b8388['order']=qs[_0xa55c('0x39')](_0x1377b0['query'][_0xa55c('0x39')]);_0x1b8388['where']=qs[_0xa55c('0x31')](_[_0xa55c('0x3a')](_0x1377b0[_0xa55c('0x2f')],_0x201941['filters']));if(_0x1377b0[_0xa55c('0x2f')][_0xa55c('0x3b')]){_0x1b8388['where']=_[_0xa55c('0x3c')](_0x1b8388[_0xa55c('0x3d')],{'$or':_['map'](_0x3c3cb5,function(_0x529ff8){if(_0x529ff8[_0xa55c('0x2c')]!=='VIRTUAL'){var _0x1e75dc={};_0x1e75dc[_0x529ff8[_0xa55c('0x28')]]={'$like':'%'+_0x1377b0['query']['filter']+'%'};return _0x1e75dc;}})});}_0x1b8388=_['merge']({},_0x1b8388,_0x1377b0['options']);var _0x3b3308={'where':_0x1b8388[_0xa55c('0x3d')]};return db[_0xa55c('0x2a')][_0xa55c('0x1a')](_0x3b3308)[_0xa55c('0x22')](function(_0x56d17c){_0x45ee8d[_0xa55c('0x1a')]=_0x56d17c;if(_0x1377b0[_0xa55c('0x2f')][_0xa55c('0x3e')]){_0x1b8388[_0xa55c('0x3f')]=[{'all':!![]}];}return db[_0xa55c('0x2a')][_0xa55c('0x40')](_0x1b8388);})['then'](function(_0x386e34){_0x45ee8d['rows']=_0x386e34;return _0x45ee8d;})['then'](respondWithFilteredResult(_0x22f6b6,_0x1b8388))[_0xa55c('0x41')](handleError(_0x22f6b6,null));};exports[_0xa55c('0x42')]=function(_0x496920,_0x2bd98b){var _0x508bd3={'raw':!![],'where':{'id':_0x496920[_0xa55c('0x43')]['id']}},_0x5f25f7={};_0x5f25f7[_0xa55c('0x33')]=_[_0xa55c('0x30')](db['Interval'][_0xa55c('0x44')]);_0x5f25f7[_0xa55c('0x2f')]=_['keys'](_0x496920[_0xa55c('0x2f')]);_0x5f25f7['filters']=_[_0xa55c('0x32')](_0x5f25f7[_0xa55c('0x33')],_0x5f25f7['query']);_0x508bd3[_0xa55c('0x34')]=_[_0xa55c('0x32')](_0x5f25f7['model'],qs[_0xa55c('0x35')](_0x496920[_0xa55c('0x2f')][_0xa55c('0x35')]));_0x508bd3['attributes']=_0x508bd3[_0xa55c('0x34')]['length']?_0x508bd3[_0xa55c('0x34')]:_0x5f25f7[_0xa55c('0x33')];if(_0x496920[_0xa55c('0x2f')]['includeAll']){_0x508bd3[_0xa55c('0x3f')]=[{'all':!![]}];}_0x508bd3=_[_0xa55c('0x3c')]({},_0x508bd3,_0x496920['options']);return db[_0xa55c('0x2a')][_0xa55c('0x45')](_0x508bd3)['then'](handleEntityNotFound(_0x2bd98b,null))[_0xa55c('0x22')](respondWithResult(_0x2bd98b,null))[_0xa55c('0x41')](handleError(_0x2bd98b,null));};exports['create']=function(_0x46f839,_0x81cee8){return db[_0xa55c('0x2a')][_0xa55c('0x46')](_0x46f839['body'],{})[_0xa55c('0x22')](function(_0x58a7ea){var _0x2157d6=_0x46f839[_0xa55c('0x47')][_0xa55c('0x24')]({'plain':!![]});if(!_0x2157d6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2157d6[_0xa55c('0x48')]===_0xa55c('0x47')){var _0x574fe9=_0x58a7ea[_0xa55c('0x24')]({'plain':!![]});var _0x34de95=_0xa55c('0x49');return db[_0xa55c('0x4a')][_0xa55c('0x45')]({'where':{'name':_0x34de95,'userProfileId':_0x2157d6[_0xa55c('0x4b')]},'raw':!![]})[_0xa55c('0x22')](function(_0x129626){if(_0x129626&&_0x129626[_0xa55c('0x4c')]===0x0){return db[_0xa55c('0x4d')]['create']({'name':_0x574fe9[_0xa55c('0x28')],'resourceId':_0x574fe9['id'],'type':_0x129626[_0xa55c('0x28')],'sectionId':_0x129626['id']},{})[_0xa55c('0x22')](function(){return _0x58a7ea;});}else{return _0x58a7ea;}})['catch'](function(_0x4c3095){logger[_0xa55c('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c3095);throw _0x4c3095;});}return _0x58a7ea;})[_0xa55c('0x22')](respondWithResult(_0x81cee8,0xc9))['catch'](handleError(_0x81cee8,null));};exports[_0xa55c('0x21')]=function(_0x228df4,_0x181802){if(_0x228df4[_0xa55c('0x4e')]['id']){delete _0x228df4[_0xa55c('0x4e')]['id'];}return db['Interval'][_0xa55c('0x45')]({'where':{'id':_0x228df4[_0xa55c('0x43')]['id']}})['then'](handleEntityNotFound(_0x181802,null))[_0xa55c('0x22')](saveUpdates(_0x228df4[_0xa55c('0x4e')],null))[_0xa55c('0x22')](respondWithResult(_0x181802,null))[_0xa55c('0x41')](handleError(_0x181802,null));};exports['destroy']=function(_0x4def35,_0x267965){return db[_0xa55c('0x2a')][_0xa55c('0x45')]({'where':{'id':_0x4def35[_0xa55c('0x43')]['id']}})['then'](handleEntityNotFound(_0x267965,null))[_0xa55c('0x22')](removeEntity(_0x267965,null))['catch'](handleError(_0x267965,null));};exports[_0xa55c('0x4f')]=function(_0x437ced,_0x20593d,_0x2ccfb1){if(_0x437ced[_0xa55c('0x4e')]['id']){delete _0x437ced['body']['id'];}return db[_0xa55c('0x2a')]['find']({'where':{'id':_0x437ced[_0xa55c('0x43')]['id']}})[_0xa55c('0x22')](handleEntityNotFound(_0x20593d,null))[_0xa55c('0x22')](function(_0x1e1c5b){if(_0x1e1c5b){_0x437ced[_0xa55c('0x4e')][_0xa55c('0x50')]=_0x1e1c5b['id'];return db[_0xa55c('0x2a')]['create'](_0x437ced[_0xa55c('0x4e')]);}})[_0xa55c('0x22')](respondWithResult(_0x20593d,null))[_0xa55c('0x41')](handleError(_0x20593d,null));};exports[_0xa55c('0x51')]=function(_0x3fa00f,_0x5ba2b0,_0xa72718){var _0x3cd40d={};var _0x28bac4={};var _0x20e53c;var _0x3cbb63;return db['Interval'][_0xa55c('0x52')]({'where':{'id':_0x3fa00f[_0xa55c('0x43')]['id']}})[_0xa55c('0x22')](handleEntityNotFound(_0x5ba2b0,null))[_0xa55c('0x22')](function(_0x3ba56d){if(_0x3ba56d){_0x20e53c=_0x3ba56d;_0x28bac4['model']=_[_0xa55c('0x30')](db['Interval'][_0xa55c('0x44')]);_0x28bac4['query']=_[_0xa55c('0x30')](_0x3fa00f['query']);_0x28bac4[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x28bac4[_0xa55c('0x33')],_0x28bac4[_0xa55c('0x2f')]);_0x3cd40d[_0xa55c('0x34')]=_[_0xa55c('0x32')](_0x28bac4[_0xa55c('0x33')],qs[_0xa55c('0x35')](_0x3fa00f[_0xa55c('0x2f')][_0xa55c('0x35')]));_0x3cd40d['attributes']=_0x3cd40d[_0xa55c('0x34')][_0xa55c('0x36')]?_0x3cd40d['attributes']:_0x28bac4[_0xa55c('0x33')];_0x3cd40d[_0xa55c('0x53')]=qs[_0xa55c('0x39')](_0x3fa00f[_0xa55c('0x2f')][_0xa55c('0x39')]);_0x3cd40d[_0xa55c('0x3d')]=qs[_0xa55c('0x31')](_[_0xa55c('0x3a')](_0x3fa00f['query'],_0x28bac4[_0xa55c('0x31')]));if(_0x3fa00f[_0xa55c('0x2f')][_0xa55c('0x3b')]){_0x3cd40d[_0xa55c('0x3d')]=_[_0xa55c('0x3c')](_0x3cd40d[_0xa55c('0x3d')],{'$or':_[_0xa55c('0x2e')](_0x3cd40d[_0xa55c('0x34')],function(_0x25d5a1){var _0x4a08ca={};_0x4a08ca[_0x25d5a1]={'$like':'%'+_0x3fa00f[_0xa55c('0x2f')][_0xa55c('0x3b')]+'%'};return _0x4a08ca;})});}_0x3cd40d=_[_0xa55c('0x3c')]({},_0x3cd40d,_0x3fa00f[_0xa55c('0x54')]);return _0x20e53c[_0xa55c('0x51')](_0x3cd40d);}})[_0xa55c('0x22')](function(_0x3ea755){if(_0x3ea755){_0x3cbb63=_0x3ea755[_0xa55c('0x36')];if(!_0x3fa00f[_0xa55c('0x2f')][_0xa55c('0x37')](_0xa55c('0x38'))){_0x3cd40d['limit']=qs[_0xa55c('0x1c')](_0x3fa00f['query'][_0xa55c('0x1c')]);_0x3cd40d[_0xa55c('0x1b')]=qs[_0xa55c('0x1b')](_0x3fa00f['query']['offset']);}return _0x20e53c[_0xa55c('0x51')](_0x3cd40d);}})[_0xa55c('0x22')](function(_0x23c84c){if(_0x23c84c){return _0x23c84c?{'count':_0x3cbb63,'rows':_0x23c84c}:null;}})[_0xa55c('0x22')](respondWithResult(_0x5ba2b0,null))['catch'](handleError(_0x5ba2b0,null));};exports[_0xa55c('0x55')]=function(_0xd02251,_0x8ea1c6,_0x3a9910){return db[_0xa55c('0x2a')]['findOne']({'where':{'id':_0xd02251['params']['id']}})[_0xa55c('0x22')](handleEntityNotFound(_0x8ea1c6,null))[_0xa55c('0x22')](function(_0x3f9d0a){if(_0x3f9d0a){return db[_0xa55c('0x56')][_0xa55c('0x57')](function(_0x4b2032){return db[_0xa55c('0x2a')][_0xa55c('0x23')]({'where':{'IntervalId':_0xd02251['params']['id']},'transaction':_0x4b2032})[_0xa55c('0x22')](function(_0x1ab28b){var _0xa340fb=_['map'](_0xd02251[_0xa55c('0x4e')],function(_0x3ff604){delete _0x3ff604['id'];_0x3ff604[_0xa55c('0x50')]=_0xd02251[_0xa55c('0x43')]['id'];return _0x3ff604;});return db[_0xa55c('0x2a')]['bulkCreate'](_0xa340fb,{'transaction':_0x4b2032});});})[_0xa55c('0x22')](function(){return db[_0xa55c('0x2a')]['findAll']({'where':{'IntervalId':_0xd02251['params']['id']}});});}})[_0xa55c('0x22')](respondWithResult(_0x8ea1c6,null))['catch'](handleError(_0x8ea1c6,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index ec4b2f6..ac5f976 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 _0xaaa2=['exports','Interval','rewrite','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./interval.attributes','../../components/extensions/rewrite'];(function(_0x3b1fd1,_0x6b8d4d){var _0x4efdfb=function(_0x139111){while(--_0x139111){_0x3b1fd1['push'](_0x3b1fd1['shift']());}};_0x4efdfb(++_0x6b8d4d);}(_0xaaa2,0xac));var _0x2aaa=function(_0x5485eb,_0x460f9d){_0x5485eb=_0x5485eb-0x0;var _0x5446c5=_0xaaa2[_0x5485eb];return _0x5446c5;};'use strict';var _=require(_0x2aaa('0x0'));var util=require(_0x2aaa('0x1'));var logger=require(_0x2aaa('0x2'))(_0x2aaa('0x3'));var moment=require(_0x2aaa('0x4'));var BPromise=require(_0x2aaa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2aaa('0x6'));var rimraf=require('rimraf');var config=require(_0x2aaa('0x7'));var attributes=require(_0x2aaa('0x8'));var extensions=require(_0x2aaa('0x9'));module[_0x2aaa('0xa')]=function(_0x1ef101,_0x106af9){return _0x1ef101['define'](_0x2aaa('0xb'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x505fe8,_0x139ca7){extensions['rewrite'](_0x1ef101,_0x505fe8);},'afterBulkCreate':function(_0x1ad6e9,_0x491279,_0x4f1343){_0x4f1343();extensions[_0x2aaa('0xc')](_0x1ef101,_0x1ad6e9[0x0]);},'afterUpdate':function(_0x438f88,_0x5e1347){extensions[_0x2aaa('0xc')](_0x1ef101,_0x438f88);},'afterDestroy':function(_0xbfd0c9,_0x2e3bd2){extensions['rewrite'](_0x1ef101,_0xbfd0c9);}}});}; \ No newline at end of file +var _0x2182=['bluebird','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','rewrite','lodash','util','../../config/logger','api'];(function(_0x41a93b,_0x2fc19d){var _0x220a7e=function(_0x5ecb05){while(--_0x5ecb05){_0x41a93b['push'](_0x41a93b['shift']());}};_0x220a7e(++_0x2fc19d);}(_0x2182,0xea));var _0x2218=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2182[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x2218('0x0'));var util=require(_0x2218('0x1'));var logger=require(_0x2218('0x2'))(_0x2218('0x3'));var moment=require('moment');var BPromise=require(_0x2218('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2218('0x5'));var rimraf=require(_0x2218('0x6'));var config=require(_0x2218('0x7'));var attributes=require(_0x2218('0x8'));var extensions=require(_0x2218('0x9'));module[_0x2218('0xa')]=function(_0x199cb3,_0x22eab9){return _0x199cb3[_0x2218('0xb')](_0x2218('0xc'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1197d1,_0xed1f79){extensions[_0x2218('0xd')](_0x199cb3,_0x1197d1);},'afterBulkCreate':function(_0x5bd041,_0x49df16,_0x3dcc9){_0x3dcc9();extensions[_0x2218('0xd')](_0x199cb3,_0x5bd041[0x0]);},'afterUpdate':function(_0x168f11,_0x431908){extensions['rewrite'](_0x199cb3,_0x168f11);},'afterDestroy':function(_0x299c34,_0xa86fc2){extensions[_0x2218('0xd')](_0x199cb3,_0x299c34);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 4917754..095edcb 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 _0xd88d=['options','raw','attributes','include','map','model','debug','catch','find','where','ShowInterval','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','then','info','Interval,\x20%s,\x20%s','request\x20sent','Interval,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetInterval','Interval'];(function(_0x47b606,_0x13dff8){var _0x69e220=function(_0x5e0787){while(--_0x5e0787){_0x47b606['push'](_0x47b606['shift']());}};_0x69e220(++_0x13dff8);}(_0xd88d,0x1dc));var _0xdd88=function(_0x52eba2,_0x57c5b7){_0x52eba2=_0x52eba2-0x0;var _0x21afe5=_0xd88d[_0x52eba2];return _0x21afe5;};'use strict';var _=require('lodash');var util=require(_0xdd88('0x0'));var moment=require(_0xdd88('0x1'));var BPromise=require(_0xdd88('0x2'));var rs=require(_0xdd88('0x3'));var fs=require('fs');var Redis=require(_0xdd88('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xdd88('0x5'));var jayson=require(_0xdd88('0x6'));var client=jayson[_0xdd88('0x7')][_0xdd88('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xcf32bd,_0x23acc8,_0x393846){return new BPromise(function(_0xde630c,_0x248070){return client['request'](_0xcf32bd,_0x393846)[_0xdd88('0x9')](function(_0x125a22){logger[_0xdd88('0xa')](_0xdd88('0xb'),_0x23acc8,_0xdd88('0xc'));logger['debug'](_0xdd88('0xd'),_0x23acc8,_0xdd88('0xc'),JSON[_0xdd88('0xe')](_0x125a22));if(_0x125a22[_0xdd88('0xf')]){if(_0x125a22[_0xdd88('0xf')]['code']===0x1f4){logger['error']('Interval,\x20%s,\x20%s',_0x23acc8,_0x125a22[_0xdd88('0xf')][_0xdd88('0x10')]);return _0x248070(_0x125a22[_0xdd88('0xf')]['message']);}logger[_0xdd88('0xf')](_0xdd88('0xb'),_0x23acc8,_0x125a22[_0xdd88('0xf')][_0xdd88('0x10')]);return _0xde630c(_0x125a22[_0xdd88('0xf')]['message']);}else{logger[_0xdd88('0xa')](_0xdd88('0xb'),_0x23acc8,_0xdd88('0xc'));_0xde630c(_0x125a22[_0xdd88('0x11')][_0xdd88('0x10')]);}})['catch'](function(_0x16dda7){logger[_0xdd88('0xf')](_0xdd88('0xb'),_0x23acc8,_0x16dda7);_0x248070(_0x16dda7);});});}exports[_0xdd88('0x12')]=function(_0x248ad4){var _0x6a5abf=this;return new Promise(function(_0x5ee999,_0x30bd2c){return db[_0xdd88('0x13')]['findAll']({'raw':_0x248ad4[_0xdd88('0x14')]?_0x248ad4['options'][_0xdd88('0x15')]===undefined?!![]:![]:!![],'where':_0x248ad4[_0xdd88('0x14')]?_0x248ad4[_0xdd88('0x14')]['where']||null:null,'attributes':_0x248ad4['options']?_0x248ad4[_0xdd88('0x14')][_0xdd88('0x16')]||null:null,'limit':_0x248ad4[_0xdd88('0x14')]?_0x248ad4[_0xdd88('0x14')]['limit']||null:null,'include':_0x248ad4['options']?_0x248ad4[_0xdd88('0x14')][_0xdd88('0x17')]?_['map'](_0x248ad4['options'][_0xdd88('0x17')],function(_0x95e993){return{'model':db[_0x95e993['model']],'as':_0x95e993['as'],'attributes':_0x95e993['attributes'],'include':_0x95e993[_0xdd88('0x17')]?_['map'](_0x95e993['include'],function(_0x1b173c){return{'model':db[_0x1b173c['model']],'as':_0x1b173c['as'],'attributes':_0x1b173c[_0xdd88('0x16')],'include':_0x1b173c['include']?_[_0xdd88('0x18')](_0x1b173c[_0xdd88('0x17')],function(_0x194b45){return{'model':db[_0x194b45[_0xdd88('0x19')]],'as':_0x194b45['as'],'attributes':_0x194b45[_0xdd88('0x16')]};}):[]};}):[]};}):[]:[]})[_0xdd88('0x9')](function(_0x3eec94){logger[_0xdd88('0xa')]('GetInterval',_0x248ad4);logger[_0xdd88('0x1a')](_0xdd88('0x12'),_0x248ad4,JSON[_0xdd88('0xe')](_0x3eec94));_0x5ee999(_0x3eec94);})[_0xdd88('0x1b')](function(_0x494f04){logger['error'](_0xdd88('0x12'),_0x494f04['message'],_0x248ad4);_0x30bd2c(_0x6a5abf[_0xdd88('0xf')](0x1f4,_0x494f04[_0xdd88('0x10')]));});});};exports['ShowInterval']=function(_0x5222dd){var _0x3587ad=this;return new Promise(function(_0x517af3,_0x2f99a1){return db[_0xdd88('0x13')][_0xdd88('0x1c')]({'raw':_0x5222dd[_0xdd88('0x14')]?_0x5222dd[_0xdd88('0x14')][_0xdd88('0x15')]===undefined?!![]:![]:!![],'where':_0x5222dd[_0xdd88('0x14')]?_0x5222dd['options'][_0xdd88('0x1d')]||null:null,'attributes':_0x5222dd[_0xdd88('0x14')]?_0x5222dd[_0xdd88('0x14')]['attributes']||null:null,'include':_0x5222dd[_0xdd88('0x14')]?_0x5222dd['options'][_0xdd88('0x17')]?_[_0xdd88('0x18')](_0x5222dd[_0xdd88('0x14')][_0xdd88('0x17')],function(_0x17f1bd){return{'model':db[_0x17f1bd[_0xdd88('0x19')]],'as':_0x17f1bd['as'],'attributes':_0x17f1bd[_0xdd88('0x16')],'include':_0x17f1bd[_0xdd88('0x17')]?_[_0xdd88('0x18')](_0x17f1bd['include'],function(_0xaeee15){return{'model':db[_0xaeee15[_0xdd88('0x19')]],'as':_0xaeee15['as'],'attributes':_0xaeee15['attributes'],'include':_0xaeee15[_0xdd88('0x17')]?_['map'](_0xaeee15[_0xdd88('0x17')],function(_0x45ab33){return{'model':db[_0x45ab33[_0xdd88('0x19')]],'as':_0x45ab33['as'],'attributes':_0x45ab33[_0xdd88('0x16')]};}):[]};}):[]};}):[]:[]})[_0xdd88('0x9')](function(_0x18b284){logger['info'](_0xdd88('0x1e'),_0x5222dd);logger[_0xdd88('0x1a')](_0xdd88('0x1e'),_0x5222dd,JSON[_0xdd88('0xe')](_0x18b284));_0x517af3(_0x18b284);})[_0xdd88('0x1b')](function(_0x470bb3){logger['error']('ShowInterval',_0x470bb3[_0xdd88('0x10')],_0x5222dd);_0x2f99a1(_0x3587ad['error'](0x1f4,_0x470bb3[_0xdd88('0x10')]));});});}; \ No newline at end of file +var _0x61d4=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Interval,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetInterval','Interval','findAll','options','raw','limit','include','map','model','ShowInterval','find','where','attributes','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x61d4,0x1ce));var _0x461d=function(_0x447725,_0x49753b){_0x447725=_0x447725-0x0;var _0x399167=_0x61d4[_0x447725];return _0x399167;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x461d('0x0'));var BPromise=require(_0x461d('0x1'));var rs=require(_0x461d('0x2'));var fs=require('fs');var Redis=require(_0x461d('0x3'));var db=require(_0x461d('0x4'))['db'];var utils=require(_0x461d('0x5'));var logger=require(_0x461d('0x6'))('rpc');var config=require(_0x461d('0x7'));var jayson=require(_0x461d('0x8'));var client=jayson[_0x461d('0x9')][_0x461d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d72c4,_0x21d71a,_0x466d00){return new BPromise(function(_0x49bae3,_0x36547e){return client[_0x461d('0xb')](_0x4d72c4,_0x466d00)[_0x461d('0xc')](function(_0x9ade3d){logger[_0x461d('0xd')](_0x461d('0xe'),_0x21d71a,_0x461d('0xf'));logger[_0x461d('0x10')]('Interval,\x20%s,\x20%s,\x20%s',_0x21d71a,_0x461d('0xf'),JSON[_0x461d('0x11')](_0x9ade3d));if(_0x9ade3d[_0x461d('0x12')]){if(_0x9ade3d[_0x461d('0x12')][_0x461d('0x13')]===0x1f4){logger[_0x461d('0x12')](_0x461d('0xe'),_0x21d71a,_0x9ade3d[_0x461d('0x12')]['message']);return _0x36547e(_0x9ade3d[_0x461d('0x12')][_0x461d('0x14')]);}logger[_0x461d('0x12')](_0x461d('0xe'),_0x21d71a,_0x9ade3d[_0x461d('0x12')]['message']);return _0x49bae3(_0x9ade3d[_0x461d('0x12')][_0x461d('0x14')]);}else{logger[_0x461d('0xd')](_0x461d('0xe'),_0x21d71a,_0x461d('0xf'));_0x49bae3(_0x9ade3d[_0x461d('0x15')][_0x461d('0x14')]);}})[_0x461d('0x16')](function(_0xf53317){logger[_0x461d('0x12')](_0x461d('0xe'),_0x21d71a,_0xf53317);_0x36547e(_0xf53317);});});}exports[_0x461d('0x17')]=function(_0x431a4a){var _0x5c7440=this;return new Promise(function(_0x17fcf7,_0x14e20a){return db[_0x461d('0x18')][_0x461d('0x19')]({'raw':_0x431a4a[_0x461d('0x1a')]?_0x431a4a[_0x461d('0x1a')][_0x461d('0x1b')]===undefined?!![]:![]:!![],'where':_0x431a4a[_0x461d('0x1a')]?_0x431a4a[_0x461d('0x1a')]['where']||null:null,'attributes':_0x431a4a[_0x461d('0x1a')]?_0x431a4a[_0x461d('0x1a')]['attributes']||null:null,'limit':_0x431a4a[_0x461d('0x1a')]?_0x431a4a[_0x461d('0x1a')][_0x461d('0x1c')]||null:null,'include':_0x431a4a[_0x461d('0x1a')]?_0x431a4a[_0x461d('0x1a')][_0x461d('0x1d')]?_[_0x461d('0x1e')](_0x431a4a[_0x461d('0x1a')][_0x461d('0x1d')],function(_0xf37608){return{'model':db[_0xf37608[_0x461d('0x1f')]],'as':_0xf37608['as'],'attributes':_0xf37608['attributes'],'include':_0xf37608['include']?_[_0x461d('0x1e')](_0xf37608[_0x461d('0x1d')],function(_0x4bda14){return{'model':db[_0x4bda14[_0x461d('0x1f')]],'as':_0x4bda14['as'],'attributes':_0x4bda14['attributes'],'include':_0x4bda14['include']?_[_0x461d('0x1e')](_0x4bda14[_0x461d('0x1d')],function(_0x391898){return{'model':db[_0x391898[_0x461d('0x1f')]],'as':_0x391898['as'],'attributes':_0x391898['attributes']};}):[]};}):[]};}):[]:[]})[_0x461d('0xc')](function(_0x5d7064){logger[_0x461d('0xd')](_0x461d('0x17'),_0x431a4a);logger[_0x461d('0x10')]('GetInterval',_0x431a4a,JSON['stringify'](_0x5d7064));_0x17fcf7(_0x5d7064);})['catch'](function(_0x597fa5){logger['error']('GetInterval',_0x597fa5[_0x461d('0x14')],_0x431a4a);_0x14e20a(_0x5c7440['error'](0x1f4,_0x597fa5[_0x461d('0x14')]));});});};exports[_0x461d('0x20')]=function(_0x4e9d80){var _0x58a135=this;return new Promise(function(_0x534c53,_0x54d454){return db['Interval'][_0x461d('0x21')]({'raw':_0x4e9d80['options']?_0x4e9d80[_0x461d('0x1a')][_0x461d('0x1b')]===undefined?!![]:![]:!![],'where':_0x4e9d80['options']?_0x4e9d80['options'][_0x461d('0x22')]||null:null,'attributes':_0x4e9d80['options']?_0x4e9d80[_0x461d('0x1a')][_0x461d('0x23')]||null:null,'include':_0x4e9d80[_0x461d('0x1a')]?_0x4e9d80[_0x461d('0x1a')][_0x461d('0x1d')]?_[_0x461d('0x1e')](_0x4e9d80['options'][_0x461d('0x1d')],function(_0x379b41){return{'model':db[_0x379b41[_0x461d('0x1f')]],'as':_0x379b41['as'],'attributes':_0x379b41[_0x461d('0x23')],'include':_0x379b41['include']?_[_0x461d('0x1e')](_0x379b41['include'],function(_0x352447){return{'model':db[_0x352447[_0x461d('0x1f')]],'as':_0x352447['as'],'attributes':_0x352447['attributes'],'include':_0x352447[_0x461d('0x1d')]?_[_0x461d('0x1e')](_0x352447[_0x461d('0x1d')],function(_0x5e0600){return{'model':db[_0x5e0600[_0x461d('0x1f')]],'as':_0x5e0600['as'],'attributes':_0x5e0600[_0x461d('0x23')]};}):[]};}):[]};}):[]:[]})[_0x461d('0xc')](function(_0x22b9e2){logger['info'](_0x461d('0x20'),_0x4e9d80);logger[_0x461d('0x10')]('ShowInterval',_0x4e9d80,JSON[_0x461d('0x11')](_0x22b9e2));_0x534c53(_0x22b9e2);})[_0x461d('0x16')](function(_0x51d4f3){logger[_0x461d('0x12')]('ShowInterval',_0x51d4f3[_0x461d('0x14')],_0x4e9d80);_0x54d454(_0x58a135[_0x461d('0x12')](0x1f4,_0x51d4f3[_0x461d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index c2c0814..d01188b 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 _0xc919=['../../components/auth/service','./jira.controller','post','isAuthenticated','send','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc919,0x1c8));var _0x9c91=function(_0x19ccaa,_0x14c728){_0x19ccaa=_0x19ccaa-0x0;var _0x46884a=_0xc919[_0x19ccaa];return _0x46884a;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x9c91('0x0'));var controller=require(_0x9c91('0x1'));router[_0x9c91('0x2')]('/',auth[_0x9c91('0x3')](),controller[_0x9c91('0x4')]);module[_0x9c91('0x5')]=router; \ No newline at end of file +var _0x88b0=['isAuthenticated','send','exports','express','Router','post'];(function(_0x1b16a6,_0x586b75){var _0x4d0452=function(_0xda7136){while(--_0xda7136){_0x1b16a6['push'](_0x1b16a6['shift']());}};_0x4d0452(++_0x586b75);}(_0x88b0,0x1cb));var _0x088b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x88b0[_0x501510];return _0x1e6ee5;};'use strict';var express=require(_0x088b('0x0'));var router=express[_0x088b('0x1')]();var auth=require('../../components/auth/service');var controller=require('./jira.controller');router[_0x088b('0x2')]('/',auth[_0x088b('0x3')](),controller[_0x088b('0x4')]);module[_0x088b('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 732fe8e..7c4ce7a 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 _0x654e=['Bug','fields','customfield_11500','email','customfield_11501','oldToken','newToken','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','setEncoding','utf8','data','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','body','headers','x-forwarded-for','connection','socket','remoteAddress','bluebird','https','api','support','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','description','stringify'];(function(_0x5e48f8,_0x54ea70){var _0x15f1da=function(_0x2ae67f){while(--_0x2ae67f){_0x5e48f8['push'](_0x5e48f8['shift']());}};_0x15f1da(++_0x54ea70);}(_0x654e,0x137));var _0xe654=function(_0x55b037,_0x2d9392){_0x55b037=_0x55b037-0x0;var _0x5f1053=_0x654e[_0x55b037];return _0x5f1053;};'use strict';var BPromise=require(_0xe654('0x0'));var https=require(_0xe654('0x1'));var logger=require('../../config/logger')(_0xe654('0x2'));var USERNAME=_0xe654('0x3');var PASSWORD=_0xe654('0x4');function openIssue(_0x575e34,_0x4953ae){var _0x356324={'fields':{'project':{'key':_0x575e34[_0xe654('0x5')]||_0xe654('0x6')},'summary':(_0x575e34['summary']||_0xe654('0x7'))+_0xe654('0x8')+_0x575e34['ip'],'description':_0x575e34[_0xe654('0x9')]||JSON[_0xe654('0xa')](_0x575e34),'issuetype':{'name':_0x575e34['issuetype']||_0xe654('0xb')}}};_0x356324[_0xe654('0xc')][_0xe654('0xd')]=_0x575e34[_0xe654('0xe')];_0x356324['fields'][_0xe654('0xf')]=_0x575e34[_0xe654('0x10')];_0x356324['fields']['customfield_11502']=_0x575e34[_0xe654('0x11')];_0x356324[_0xe654('0xc')]['customfield_11503']=_0x575e34[_0xe654('0x12')];_0x356324['fields'][_0xe654('0x13')]=_0x575e34[_0xe654('0x14')];_0x356324[_0xe654('0xc')][_0xe654('0x15')]=_0x575e34['ip'];var _0x474124={'host':_0xe654('0x16'),'port':0x1bb,'path':_0xe654('0x17'),'method':_0xe654('0x18'),'timeout':0x4e20,'headers':{'Content-Type':_0xe654('0x19'),'Authorization':_0xe654('0x1a')+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x3878ee=JSON[_0xe654('0xa')](_0x356324);var _0x5f4b9f=https['request'](_0x474124,function(_0x145fb7){_0x145fb7[_0xe654('0x1b')](_0xe654('0x1c'));var _0x778810='';_0x145fb7['on'](_0xe654('0x1d'),function(_0x3d0084){_0x778810+=_0x3d0084;});_0x145fb7['on'](_0xe654('0x1e'),function(){if(_0x4953ae){return _0x4953ae[_0xe654('0x1f')](_0x145fb7[_0xe654('0x20')])[_0xe654('0x21')](JSON[_0xe654('0x22')](_0x778810));}});});_0x5f4b9f['on'](_0xe654('0x23'),function(_0x12e064){if(_0x4953ae){return _0x4953ae['status'](0x1f4)[_0xe654('0x21')]({'errors':[{'message':_0xe654('0x24'),'type':_0xe654('0x25')}]});}});_0x5f4b9f[_0xe654('0x26')](_0x3878ee);_0x5f4b9f[_0xe654('0x1e')]();}exports[_0xe654('0x27')]=openIssue;exports['send']=function(_0x3cb557,_0x47c45b){_0x3cb557[_0xe654('0x28')]['ip']=_0x3cb557[_0xe654('0x29')][_0xe654('0x2a')]||_0x3cb557[_0xe654('0x2b')]['remoteAddress']||_0x3cb557[_0xe654('0x2c')][_0xe654('0x2d')]||_0x3cb557[_0xe654('0x2b')][_0xe654('0x2c')]['remoteAddress'];return openIssue(_0x3cb557['body'],_0x47c45b);}; \ No newline at end of file +var _0xc9ed=['setEncoding','data','end','error','status','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','send','headers','x-forwarded-for','connection','socket','remoteAddress','body','bluebird','https','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','customfield_11503','name','customfield_11504','reason','track.xcallymotion.com','POST','Basic\x20','toString','stringify'];(function(_0x37e009,_0x3037dc){var _0x3637bc=function(_0x50855e){while(--_0x50855e){_0x37e009['push'](_0x37e009['shift']());}};_0x3637bc(++_0x3037dc);}(_0xc9ed,0x111));var _0xdc9e=function(_0x12e898,_0x1ef073){_0x12e898=_0x12e898-0x0;var _0x190631=_0xc9ed[_0x12e898];return _0x190631;};'use strict';var BPromise=require(_0xdc9e('0x0'));var https=require(_0xdc9e('0x1'));var logger=require('../../config/logger')(_0xdc9e('0x2'));var USERNAME=_0xdc9e('0x3');var PASSWORD=_0xdc9e('0x4');function openIssue(_0x5a341e,_0x3a3907){var _0x514a92={'fields':{'project':{'key':_0x5a341e[_0xdc9e('0x5')]||_0xdc9e('0x6')},'summary':(_0x5a341e[_0xdc9e('0x7')]||_0xdc9e('0x8'))+_0xdc9e('0x9')+_0x5a341e['ip'],'description':_0x5a341e[_0xdc9e('0xa')]||JSON['stringify'](_0x5a341e),'issuetype':{'name':_0x5a341e[_0xdc9e('0xb')]||_0xdc9e('0xc')}}};_0x514a92[_0xdc9e('0xd')][_0xdc9e('0xe')]=_0x5a341e[_0xdc9e('0xf')];_0x514a92[_0xdc9e('0xd')][_0xdc9e('0x10')]=_0x5a341e[_0xdc9e('0x11')];_0x514a92[_0xdc9e('0xd')][_0xdc9e('0x12')]=_0x5a341e['newToken'];_0x514a92[_0xdc9e('0xd')][_0xdc9e('0x13')]=_0x5a341e[_0xdc9e('0x14')];_0x514a92['fields'][_0xdc9e('0x15')]=_0x5a341e[_0xdc9e('0x16')];_0x514a92['fields']['customfield_10102']=_0x5a341e['ip'];var _0x4b5672={'host':_0xdc9e('0x17'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0xdc9e('0x18'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xdc9e('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0xdc9e('0x1a')]('base64')}};var _0xf1c4fa=JSON[_0xdc9e('0x1b')](_0x514a92);var _0xf2f953=https['request'](_0x4b5672,function(_0x20c69f){_0x20c69f[_0xdc9e('0x1c')]('utf8');var _0x476140='';_0x20c69f['on'](_0xdc9e('0x1d'),function(_0x4cda8d){_0x476140+=_0x4cda8d;});_0x20c69f['on'](_0xdc9e('0x1e'),function(){if(_0x3a3907){return _0x3a3907['status'](_0x20c69f['statusCode'])['json'](JSON['parse'](_0x476140));}});});_0xf2f953['on'](_0xdc9e('0x1f'),function(_0x1b9abb){if(_0x3a3907){return _0x3a3907[_0xdc9e('0x20')](0x1f4)[_0xdc9e('0x21')]({'errors':[{'message':_0xdc9e('0x22'),'type':'api.jira'}]});}});_0xf2f953[_0xdc9e('0x23')](_0xf1c4fa);_0xf2f953['end']();}exports['openIssue']=openIssue;exports[_0xdc9e('0x24')]=function(_0x220b9a,_0x5214c9){_0x220b9a['body']['ip']=_0x220b9a[_0xdc9e('0x25')][_0xdc9e('0x26')]||_0x220b9a[_0xdc9e('0x27')]['remoteAddress']||_0x220b9a[_0xdc9e('0x28')][_0xdc9e('0x29')]||_0x220b9a[_0xdc9e('0x27')]['socket'][_0xdc9e('0x29')];return openIssue(_0x220b9a[_0xdc9e('0x2a')],_0x5214c9);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 6162695..447fb8d 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 _0x3c1f=['../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','describe','show','create','put','update','delete','/:id','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x3c1f,0x82));var _0xf3c1=function(_0x463b47,_0x29a803){_0x463b47=_0x463b47-0x0;var _0x441f33=_0x3c1f[_0x463b47];return _0x441f33;};'use strict';var multer=require(_0xf3c1('0x0'));var util=require('util');var path=require(_0xf3c1('0x1'));var timeout=require(_0xf3c1('0x2'));var express=require('express');var router=express[_0xf3c1('0x3')]();var auth=require(_0xf3c1('0x4'));var interaction=require(_0xf3c1('0x5'));var config=require(_0xf3c1('0x6'));var controller=require(_0xf3c1('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf3c1('0x8')]('/describe',auth[_0xf3c1('0x9')](),controller[_0xf3c1('0xa')]);router[_0xf3c1('0x8')]('/:id',auth[_0xf3c1('0x9')](),controller[_0xf3c1('0xb')]);router['post']('/',auth[_0xf3c1('0x9')](),controller[_0xf3c1('0xc')]);router[_0xf3c1('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xf3c1('0xe')]);router[_0xf3c1('0xf')](_0xf3c1('0x10'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8c83=['put','update','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','create'];(function(_0x2458ae,_0x31cd1a){var _0x178399=function(_0x113cf4){while(--_0x113cf4){_0x2458ae['push'](_0x2458ae['shift']());}};_0x178399(++_0x31cd1a);}(_0x8c83,0x1f1));var _0x38c8=function(_0x2e8510,_0x253a5a){_0x2e8510=_0x2e8510-0x0;var _0x23a7a3=_0x8c83[_0x2e8510];return _0x23a7a3;};'use strict';var multer=require(_0x38c8('0x0'));var util=require(_0x38c8('0x1'));var path=require(_0x38c8('0x2'));var timeout=require(_0x38c8('0x3'));var express=require(_0x38c8('0x4'));var router=express['Router']();var auth=require(_0x38c8('0x5'));var interaction=require(_0x38c8('0x6'));var config=require(_0x38c8('0x7'));var controller=require('./jscriptyAnswerReport.controller');router[_0x38c8('0x8')]('/',auth[_0x38c8('0x9')](),controller[_0x38c8('0xa')]);router['get'](_0x38c8('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x38c8('0x8')](_0x38c8('0xc'),auth[_0x38c8('0x9')](),controller[_0x38c8('0xd')]);router[_0x38c8('0xe')]('/',auth[_0x38c8('0x9')](),controller[_0x38c8('0xf')]);router[_0x38c8('0x10')](_0x38c8('0xc'),auth[_0x38c8('0x9')](),controller[_0x38c8('0x11')]);router[_0x38c8('0x12')](_0x38c8('0xc'),auth['isAuthenticated'](),controller['destroy']);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 ee24631..8263ca9 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 _0x707e=['TEXT','long','STRING','sequelize'];(function(_0x456bd2,_0x156c79){var _0x2218c1=function(_0x44f2d4){while(--_0x44f2d4){_0x456bd2['push'](_0x456bd2['shift']());}};_0x2218c1(++_0x156c79);}(_0x707e,0x197));var _0xe707=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x707e[_0xa8883];return _0x479426;};'use strict';var Sequelize=require(_0xe707('0x0'));module['exports']={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0xe707('0x1')](_0xe707('0x2'))},'membername':{'type':Sequelize[_0xe707('0x3')]},'projectname':{'type':Sequelize[_0xe707('0x3')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe707('0x3')]},'questionId':{'type':Sequelize[_0xe707('0x3')]}}; \ No newline at end of file +var _0xd82f=['sequelize','exports','STRING','TEXT','long'];(function(_0x5e7395,_0x43e16c){var _0x1870d9=function(_0x44010b){while(--_0x44010b){_0x5e7395['push'](_0x5e7395['shift']());}};_0x1870d9(++_0x43e16c);}(_0xd82f,0x8c));var _0xfd82=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xd82f[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0xfd82('0x0'));module[_0xfd82('0x1')]={'question':{'type':Sequelize[_0xfd82('0x2')]},'answer':{'type':Sequelize[_0xfd82('0x3')](_0xfd82('0x4'))},'membername':{'type':Sequelize[_0xfd82('0x2')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xfd82('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xfd82('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'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 57f504a..aaf7f28 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 _0x68fd=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','intersection','create','body','find','destroy','describe','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','JscriptyAnswerReport','rawAttributes','type','model','query','keys','filters'];(function(_0x3c4828,_0x546d02){var _0x5149c2=function(_0x2a827a){while(--_0x2a827a){_0x3c4828['push'](_0x3c4828['shift']());}};_0x5149c2(++_0x546d02);}(_0x68fd,0x1e9));var _0xd68f=function(_0x17764b,_0x61931d){_0x17764b=_0x17764b-0x0;var _0x1a3b1b=_0x68fd[_0x17764b];return _0x1a3b1b;};'use strict';var pdf=require(_0xd68f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd68f('0x1'));var zipdir=require(_0xd68f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd68f('0x3'));var moment=require(_0xd68f('0x4'));var BPromise=require(_0xd68f('0x5'));var Mustache=require(_0xd68f('0x6'));var util=require(_0xd68f('0x7'));var path=require(_0xd68f('0x8'));var sox=require(_0xd68f('0x9'));var csv=require(_0xd68f('0xa'));var ejs=require(_0xd68f('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd68f('0xc'));var crypto=require(_0xd68f('0xd'));var jsforce=require(_0xd68f('0xe'));var deskjs=require(_0xd68f('0xf'));var toCsv=require(_0xd68f('0xa'));var querystring=require(_0xd68f('0x10'));var Papa=require(_0xd68f('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd68f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd68f('0x13'));var logger=require(_0xd68f('0x14'))(_0xd68f('0x15'));var utils=require(_0xd68f('0x16'));var config=require(_0xd68f('0x17'));var db=require(_0xd68f('0x18'))['db'];function respondWithStatusCode(_0x1943e8,_0x52601f){_0x52601f=_0x52601f||0xcc;return function(_0x518883){if(_0x518883){return _0x1943e8['sendStatus'](_0x52601f);}return _0x1943e8['status'](_0x52601f)[_0xd68f('0x19')]();};}function respondWithResult(_0x305c19,_0x48f357){_0x48f357=_0x48f357||0xc8;return function(_0x9dbc9b){if(_0x9dbc9b){return _0x305c19[_0xd68f('0x1a')](_0x48f357)[_0xd68f('0x1b')](_0x9dbc9b);}};}function respondWithFilteredResult(_0x36441f,_0x3a5bb2){return function(_0x9a7fc6){if(_0x9a7fc6){var _0x203b3c=_0x9a7fc6['count'],_0x53aed0=_0x3a5bb2[_0xd68f('0x1c')],_0x1ba1ce=_0x3a5bb2[_0xd68f('0x1c')]+_0x3a5bb2[_0xd68f('0x1d')],_0x4946bd;if(_0x1ba1ce>=_0x203b3c){_0x1ba1ce=_0x203b3c;_0x4946bd=0xc8;}else{_0x4946bd=0xce;}_0x36441f[_0xd68f('0x1a')](_0x4946bd);return _0x36441f[_0xd68f('0x1e')](_0xd68f('0x1f'),_0x53aed0+'-'+_0x1ba1ce+'/'+_0x203b3c)[_0xd68f('0x1b')](_0x9a7fc6);}return null;};}function patchUpdates(_0x47fdbc){return function(_0x59efc5){try{jsonpatch[_0xd68f('0x20')](_0x59efc5,_0x47fdbc,!![]);}catch(_0x22be19){return BPromise[_0xd68f('0x21')](_0x22be19);}return _0x59efc5[_0xd68f('0x22')]();};}function saveUpdates(_0x24065d,_0x4c192f){return function(_0x17d291){if(_0x17d291){return _0x17d291[_0xd68f('0x23')](_0x24065d)[_0xd68f('0x24')](function(_0x4e00c0){return _0x4e00c0;});}return null;};}function removeEntity(_0x464238,_0x1379e2){return function(_0xeba444){if(_0xeba444){return _0xeba444['destroy']()['then'](function(){_0x464238[_0xd68f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x563cd3,_0x3cf02f){return function(_0x1ef099){if(!_0x1ef099){_0x563cd3[_0xd68f('0x25')](0x194);}return _0x1ef099;};}function handleError(_0x3f11f9,_0x4595bf){_0x4595bf=_0x4595bf||0x1f4;return function(_0x434fde){logger[_0xd68f('0x26')](_0x434fde[_0xd68f('0x27')]);if(_0x434fde[_0xd68f('0x28')]){delete _0x434fde[_0xd68f('0x28')];}_0x3f11f9[_0xd68f('0x1a')](_0x4595bf)[_0xd68f('0x29')](_0x434fde);};}exports[_0xd68f('0x2a')]=function(_0x5042a3,_0x5f35b9){var _0x2c22bf={},_0x4b1515={},_0x39b64b={'count':0x0,'rows':[]};var _0x5412d7=_['map'](db[_0xd68f('0x2b')][_0xd68f('0x2c')],function(_0x1eaebc){return{'name':_0x1eaebc['fieldName'],'type':_0x1eaebc[_0xd68f('0x2d')]['key']};});_0x4b1515[_0xd68f('0x2e')]=_['map'](_0x5412d7,_0xd68f('0x28'));_0x4b1515[_0xd68f('0x2f')]=_[_0xd68f('0x30')](_0x5042a3[_0xd68f('0x2f')]);_0x4b1515[_0xd68f('0x31')]=_['intersection'](_0x4b1515[_0xd68f('0x2e')],_0x4b1515['query']);_0x2c22bf[_0xd68f('0x32')]=_['intersection'](_0x4b1515[_0xd68f('0x2e')],qs[_0xd68f('0x33')](_0x5042a3[_0xd68f('0x2f')][_0xd68f('0x33')]));_0x2c22bf['attributes']=_0x2c22bf[_0xd68f('0x32')][_0xd68f('0x34')]?_0x2c22bf[_0xd68f('0x32')]:_0x4b1515[_0xd68f('0x2e')];if(!_0x5042a3['query'][_0xd68f('0x35')](_0xd68f('0x36'))){_0x2c22bf[_0xd68f('0x1d')]=qs[_0xd68f('0x1d')](_0x5042a3[_0xd68f('0x2f')][_0xd68f('0x1d')]);_0x2c22bf[_0xd68f('0x1c')]=qs[_0xd68f('0x1c')](_0x5042a3['query'][_0xd68f('0x1c')]);}_0x2c22bf[_0xd68f('0x37')]=qs[_0xd68f('0x38')](_0x5042a3[_0xd68f('0x2f')][_0xd68f('0x38')]);_0x2c22bf[_0xd68f('0x39')]=qs[_0xd68f('0x31')](_[_0xd68f('0x3a')](_0x5042a3['query'],_0x4b1515[_0xd68f('0x31')]));if(_0x5042a3[_0xd68f('0x2f')][_0xd68f('0x3b')]){_0x2c22bf[_0xd68f('0x39')]=_[_0xd68f('0x3c')](_0x2c22bf['where'],{'$or':_[_0xd68f('0x3d')](_0x5412d7,function(_0x297102){if(_0x297102[_0xd68f('0x2d')]!==_0xd68f('0x3e')){var _0x6a987b={};_0x6a987b[_0x297102[_0xd68f('0x28')]]={'$like':'%'+_0x5042a3[_0xd68f('0x2f')][_0xd68f('0x3b')]+'%'};return _0x6a987b;}})});}_0x2c22bf=_['merge']({},_0x2c22bf,_0x5042a3[_0xd68f('0x3f')]);var _0x23216e={'where':_0x2c22bf[_0xd68f('0x39')]};return db[_0xd68f('0x2b')][_0xd68f('0x40')](_0x23216e)[_0xd68f('0x24')](function(_0x4fa7bd){_0x39b64b[_0xd68f('0x40')]=_0x4fa7bd;if(_0x5042a3[_0xd68f('0x2f')][_0xd68f('0x41')]){_0x2c22bf[_0xd68f('0x42')]=[{'all':!![]}];}return db[_0xd68f('0x2b')][_0xd68f('0x43')](_0x2c22bf);})['then'](function(_0x6c1d78){_0x39b64b[_0xd68f('0x44')]=_0x6c1d78;return _0x39b64b;})['then'](respondWithFilteredResult(_0x5f35b9,_0x2c22bf))[_0xd68f('0x45')](handleError(_0x5f35b9,null));};exports['show']=function(_0x5255f7,_0x226088){var _0x2016f1={'raw':!![],'where':{'id':_0x5255f7[_0xd68f('0x46')]['id']}},_0x586046={};_0x586046[_0xd68f('0x2e')]=_['keys'](db[_0xd68f('0x2b')][_0xd68f('0x2c')]);_0x586046[_0xd68f('0x2f')]=_[_0xd68f('0x30')](_0x5255f7['query']);_0x586046['filters']=_['intersection'](_0x586046[_0xd68f('0x2e')],_0x586046[_0xd68f('0x2f')]);_0x2016f1[_0xd68f('0x32')]=_[_0xd68f('0x47')](_0x586046[_0xd68f('0x2e')],qs[_0xd68f('0x33')](_0x5255f7[_0xd68f('0x2f')][_0xd68f('0x33')]));_0x2016f1[_0xd68f('0x32')]=_0x2016f1[_0xd68f('0x32')][_0xd68f('0x34')]?_0x2016f1['attributes']:_0x586046['model'];if(_0x5255f7[_0xd68f('0x2f')][_0xd68f('0x41')]){_0x2016f1[_0xd68f('0x42')]=[{'all':!![]}];}_0x2016f1=_[_0xd68f('0x3c')]({},_0x2016f1,_0x5255f7[_0xd68f('0x3f')]);return db[_0xd68f('0x2b')]['find'](_0x2016f1)[_0xd68f('0x24')](handleEntityNotFound(_0x226088,null))[_0xd68f('0x24')](respondWithResult(_0x226088,null))[_0xd68f('0x45')](handleError(_0x226088,null));};exports[_0xd68f('0x48')]=function(_0x3ae632,_0x309bfd){return db['JscriptyAnswerReport'][_0xd68f('0x48')](_0x3ae632[_0xd68f('0x49')],{})[_0xd68f('0x24')](respondWithResult(_0x309bfd,0xc9))[_0xd68f('0x45')](handleError(_0x309bfd,null));};exports[_0xd68f('0x23')]=function(_0x314c18,_0x34bdc6){if(_0x314c18[_0xd68f('0x49')]['id']){delete _0x314c18[_0xd68f('0x49')]['id'];}return db['JscriptyAnswerReport'][_0xd68f('0x4a')]({'where':{'id':_0x314c18[_0xd68f('0x46')]['id']}})[_0xd68f('0x24')](handleEntityNotFound(_0x34bdc6,null))['then'](saveUpdates(_0x314c18[_0xd68f('0x49')],null))[_0xd68f('0x24')](respondWithResult(_0x34bdc6,null))[_0xd68f('0x45')](handleError(_0x34bdc6,null));};exports[_0xd68f('0x4b')]=function(_0x2dc117,_0x479680){return db['JscriptyAnswerReport']['find']({'where':{'id':_0x2dc117[_0xd68f('0x46')]['id']}})[_0xd68f('0x24')](handleEntityNotFound(_0x479680,null))['then'](removeEntity(_0x479680,null))[_0xd68f('0x45')](handleError(_0x479680,null));};exports[_0xd68f('0x4c')]=function(_0x23a129,_0x25f66d){return db[_0xd68f('0x2b')][_0xd68f('0x4c')]()[_0xd68f('0x24')](respondWithResult(_0x25f66d,null))[_0xd68f('0x45')](handleError(_0x25f66d,null));}; \ No newline at end of file +var _0x9ac0=['to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','save','update','then','error','name','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','VIRTUAL','filter','merge','options','JscriptyAnswerReport','count','include','findAll','rows','catch','show','keys','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox'];(function(_0x5d386b,_0x352e3f){var _0xdfc622=function(_0xad5ee7){while(--_0xad5ee7){_0x5d386b['push'](_0x5d386b['shift']());}};_0xdfc622(++_0x352e3f);}(_0x9ac0,0x116));var _0x09ac=function(_0x5c91bc,_0xbdef05){_0x5c91bc=_0x5c91bc-0x0;var _0xa33a79=_0x9ac0[_0x5c91bc];return _0xa33a79;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x09ac('0x0'));var rimraf=require(_0x09ac('0x1'));var zipdir=require(_0x09ac('0x2'));var jsonpatch=require(_0x09ac('0x3'));var rp=require(_0x09ac('0x4'));var moment=require(_0x09ac('0x5'));var BPromise=require(_0x09ac('0x6'));var Mustache=require('mustache');var util=require(_0x09ac('0x7'));var path=require(_0x09ac('0x8'));var sox=require(_0x09ac('0x9'));var csv=require(_0x09ac('0xa'));var ejs=require(_0x09ac('0xb'));var fs=require('fs');var _=require(_0x09ac('0xc'));var squel=require(_0x09ac('0xd'));var crypto=require(_0x09ac('0xe'));var jsforce=require(_0x09ac('0xf'));var deskjs=require(_0x09ac('0x10'));var toCsv=require(_0x09ac('0xa'));var querystring=require(_0x09ac('0x11'));var Papa=require(_0x09ac('0x12'));var Redis=require(_0x09ac('0x13'));var authService=require(_0x09ac('0x14'));var qs=require(_0x09ac('0x15'));var as=require(_0x09ac('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x09ac('0x17'))(_0x09ac('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x09ac('0x19'))['db'];function respondWithStatusCode(_0xcb32b6,_0x25185f){_0x25185f=_0x25185f||0xcc;return function(_0x59cb59){if(_0x59cb59){return _0xcb32b6[_0x09ac('0x1a')](_0x25185f);}return _0xcb32b6[_0x09ac('0x1b')](_0x25185f)[_0x09ac('0x1c')]();};}function respondWithResult(_0x47171a,_0x22b216){_0x22b216=_0x22b216||0xc8;return function(_0x1aa58b){if(_0x1aa58b){return _0x47171a[_0x09ac('0x1b')](_0x22b216)[_0x09ac('0x1d')](_0x1aa58b);}};}function respondWithFilteredResult(_0x4ab7d6,_0x567735){return function(_0x51a919){if(_0x51a919){var _0x587650=_0x51a919['count'],_0x31efb8=_0x567735['offset'],_0x1ef053=_0x567735[_0x09ac('0x1e')]+_0x567735[_0x09ac('0x1f')],_0x32c170;if(_0x1ef053>=_0x587650){_0x1ef053=_0x587650;_0x32c170=0xc8;}else{_0x32c170=0xce;}_0x4ab7d6['status'](_0x32c170);return _0x4ab7d6[_0x09ac('0x20')](_0x09ac('0x21'),_0x31efb8+'-'+_0x1ef053+'/'+_0x587650)['json'](_0x51a919);}return null;};}function patchUpdates(_0x3a523b){return function(_0x47bce6){try{jsonpatch['apply'](_0x47bce6,_0x3a523b,!![]);}catch(_0x25343a){return BPromise['reject'](_0x25343a);}return _0x47bce6[_0x09ac('0x22')]();};}function saveUpdates(_0x5b0355,_0xef9fc4){return function(_0xe0bd86){if(_0xe0bd86){return _0xe0bd86[_0x09ac('0x23')](_0x5b0355)['then'](function(_0x1625da){return _0x1625da;});}return null;};}function removeEntity(_0x5a70c7,_0x42bac8){return function(_0x4f19a0){if(_0x4f19a0){return _0x4f19a0['destroy']()[_0x09ac('0x24')](function(){_0x5a70c7[_0x09ac('0x1b')](0xcc)[_0x09ac('0x1c')]();});}};}function handleEntityNotFound(_0x5570a5,_0x2fc994){return function(_0x3b3904){if(!_0x3b3904){_0x5570a5['sendStatus'](0x194);}return _0x3b3904;};}function handleError(_0x5ce2b2,_0x5f397a){_0x5f397a=_0x5f397a||0x1f4;return function(_0x16d8d5){logger[_0x09ac('0x25')](_0x16d8d5['stack']);if(_0x16d8d5[_0x09ac('0x26')]){delete _0x16d8d5[_0x09ac('0x26')];}_0x5ce2b2[_0x09ac('0x1b')](_0x5f397a)['send'](_0x16d8d5);};}exports[_0x09ac('0x27')]=function(_0x5e10ae,_0x34acdd){var _0x4f8a7d={},_0x3fb20f={},_0x37321b={'count':0x0,'rows':[]};var _0x406c62=_[_0x09ac('0x28')](db['JscriptyAnswerReport'][_0x09ac('0x29')],function(_0x33add2){return{'name':_0x33add2['fieldName'],'type':_0x33add2[_0x09ac('0x2a')][_0x09ac('0x2b')]};});_0x3fb20f[_0x09ac('0x2c')]=_['map'](_0x406c62,_0x09ac('0x26'));_0x3fb20f[_0x09ac('0x2d')]=_['keys'](_0x5e10ae[_0x09ac('0x2d')]);_0x3fb20f[_0x09ac('0x2e')]=_[_0x09ac('0x2f')](_0x3fb20f[_0x09ac('0x2c')],_0x3fb20f[_0x09ac('0x2d')]);_0x4f8a7d[_0x09ac('0x30')]=_['intersection'](_0x3fb20f[_0x09ac('0x2c')],qs[_0x09ac('0x31')](_0x5e10ae[_0x09ac('0x2d')][_0x09ac('0x31')]));_0x4f8a7d[_0x09ac('0x30')]=_0x4f8a7d[_0x09ac('0x30')][_0x09ac('0x32')]?_0x4f8a7d[_0x09ac('0x30')]:_0x3fb20f[_0x09ac('0x2c')];if(!_0x5e10ae[_0x09ac('0x2d')][_0x09ac('0x33')](_0x09ac('0x34'))){_0x4f8a7d[_0x09ac('0x1f')]=qs[_0x09ac('0x1f')](_0x5e10ae[_0x09ac('0x2d')][_0x09ac('0x1f')]);_0x4f8a7d['offset']=qs[_0x09ac('0x1e')](_0x5e10ae[_0x09ac('0x2d')][_0x09ac('0x1e')]);}_0x4f8a7d['order']=qs['sort'](_0x5e10ae[_0x09ac('0x2d')]['sort']);_0x4f8a7d[_0x09ac('0x35')]=qs['filters'](_['pick'](_0x5e10ae[_0x09ac('0x2d')],_0x3fb20f[_0x09ac('0x2e')]));if(_0x5e10ae['query']['filter']){_0x4f8a7d['where']=_['merge'](_0x4f8a7d[_0x09ac('0x35')],{'$or':_[_0x09ac('0x28')](_0x406c62,function(_0x4ed5f6){if(_0x4ed5f6[_0x09ac('0x2a')]!==_0x09ac('0x36')){var _0x3d3c76={};_0x3d3c76[_0x4ed5f6[_0x09ac('0x26')]]={'$like':'%'+_0x5e10ae[_0x09ac('0x2d')][_0x09ac('0x37')]+'%'};return _0x3d3c76;}})});}_0x4f8a7d=_[_0x09ac('0x38')]({},_0x4f8a7d,_0x5e10ae[_0x09ac('0x39')]);var _0x4f4a2f={'where':_0x4f8a7d[_0x09ac('0x35')]};return db[_0x09ac('0x3a')]['count'](_0x4f4a2f)[_0x09ac('0x24')](function(_0x21d384){_0x37321b[_0x09ac('0x3b')]=_0x21d384;if(_0x5e10ae[_0x09ac('0x2d')]['includeAll']){_0x4f8a7d[_0x09ac('0x3c')]=[{'all':!![]}];}return db[_0x09ac('0x3a')][_0x09ac('0x3d')](_0x4f8a7d);})[_0x09ac('0x24')](function(_0x308db7){_0x37321b[_0x09ac('0x3e')]=_0x308db7;return _0x37321b;})['then'](respondWithFilteredResult(_0x34acdd,_0x4f8a7d))[_0x09ac('0x3f')](handleError(_0x34acdd,null));};exports[_0x09ac('0x40')]=function(_0x1563e7,_0x610e63){var _0x32cfc0={'raw':!![],'where':{'id':_0x1563e7['params']['id']}},_0x582a7f={};_0x582a7f[_0x09ac('0x2c')]=_[_0x09ac('0x41')](db[_0x09ac('0x3a')][_0x09ac('0x29')]);_0x582a7f[_0x09ac('0x2d')]=_[_0x09ac('0x41')](_0x1563e7['query']);_0x582a7f['filters']=_[_0x09ac('0x2f')](_0x582a7f['model'],_0x582a7f[_0x09ac('0x2d')]);_0x32cfc0[_0x09ac('0x30')]=_[_0x09ac('0x2f')](_0x582a7f[_0x09ac('0x2c')],qs[_0x09ac('0x31')](_0x1563e7[_0x09ac('0x2d')][_0x09ac('0x31')]));_0x32cfc0['attributes']=_0x32cfc0[_0x09ac('0x30')][_0x09ac('0x32')]?_0x32cfc0[_0x09ac('0x30')]:_0x582a7f[_0x09ac('0x2c')];if(_0x1563e7[_0x09ac('0x2d')][_0x09ac('0x42')]){_0x32cfc0[_0x09ac('0x3c')]=[{'all':!![]}];}_0x32cfc0=_[_0x09ac('0x38')]({},_0x32cfc0,_0x1563e7[_0x09ac('0x39')]);return db['JscriptyAnswerReport'][_0x09ac('0x43')](_0x32cfc0)[_0x09ac('0x24')](handleEntityNotFound(_0x610e63,null))[_0x09ac('0x24')](respondWithResult(_0x610e63,null))[_0x09ac('0x3f')](handleError(_0x610e63,null));};exports[_0x09ac('0x44')]=function(_0x40cb57,_0x56de0b){return db[_0x09ac('0x3a')][_0x09ac('0x44')](_0x40cb57['body'],{})[_0x09ac('0x24')](respondWithResult(_0x56de0b,0xc9))['catch'](handleError(_0x56de0b,null));};exports[_0x09ac('0x23')]=function(_0x3dca6d,_0x8b862b){if(_0x3dca6d[_0x09ac('0x45')]['id']){delete _0x3dca6d['body']['id'];}return db[_0x09ac('0x3a')][_0x09ac('0x43')]({'where':{'id':_0x3dca6d['params']['id']}})[_0x09ac('0x24')](handleEntityNotFound(_0x8b862b,null))['then'](saveUpdates(_0x3dca6d[_0x09ac('0x45')],null))['then'](respondWithResult(_0x8b862b,null))[_0x09ac('0x3f')](handleError(_0x8b862b,null));};exports['destroy']=function(_0x34efde,_0x3bb5e1){return db[_0x09ac('0x3a')][_0x09ac('0x43')]({'where':{'id':_0x34efde[_0x09ac('0x46')]['id']}})['then'](handleEntityNotFound(_0x3bb5e1,null))['then'](removeEntity(_0x3bb5e1,null))['catch'](handleError(_0x3bb5e1,null));};exports[_0x09ac('0x47')]=function(_0x59e46f,_0x14927f){return db[_0x09ac('0x3a')][_0x09ac('0x47')]()['then'](respondWithResult(_0x14927f,null))[_0x09ac('0x3f')](handleError(_0x14927f,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 6c5876c..4eddfee 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 _0xd8f7=['../../config/environment','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x2aa48b,_0x5a4446){var _0x48caf8=function(_0x13230c){while(--_0x13230c){_0x2aa48b['push'](_0x2aa48b['shift']());}};_0x48caf8(++_0x5a4446);}(_0xd8f7,0x155));var _0x7d8f=function(_0x413699,_0x314776){_0x413699=_0x413699-0x0;var _0xc9b7d4=_0xd8f7[_0x413699];return _0xc9b7d4;};'use strict';var _=require(_0x7d8f('0x0'));var util=require(_0x7d8f('0x1'));var logger=require(_0x7d8f('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7d8f('0x3'));var rp=require(_0x7d8f('0x4'));var fs=require('fs');var path=require(_0x7d8f('0x5'));var rimraf=require(_0x7d8f('0x6'));var config=require(_0x7d8f('0x7'));var attributes=require(_0x7d8f('0x8'));module['exports']=function(_0x121885,_0x139551){return _0x121885[_0x7d8f('0x9')](_0x7d8f('0xa'),attributes,{'tableName':_0x7d8f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7249=['exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes'];(function(_0x4c8a8f,_0x997ef){var _0x404500=function(_0x1c6072){while(--_0x1c6072){_0x4c8a8f['push'](_0x4c8a8f['shift']());}};_0x404500(++_0x997ef);}(_0x7249,0x1b7));var _0x9724=function(_0x52b159,_0x1b97ef){_0x52b159=_0x52b159-0x0;var _0x4aca2e=_0x7249[_0x52b159];return _0x4aca2e;};'use strict';var _=require(_0x9724('0x0'));var util=require(_0x9724('0x1'));var logger=require(_0x9724('0x2'))(_0x9724('0x3'));var moment=require(_0x9724('0x4'));var BPromise=require(_0x9724('0x5'));var rp=require(_0x9724('0x6'));var fs=require('fs');var path=require(_0x9724('0x7'));var rimraf=require(_0x9724('0x8'));var config=require(_0x9724('0x9'));var attributes=require(_0x9724('0xa'));module[_0x9724('0xb')]=function(_0x98d5c9,_0x2bfce2){return _0x98d5c9[_0x9724('0xc')](_0x9724('0xd'),attributes,{'tableName':_0x9724('0xe'),'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 a3086d4..5fb63c9 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 _0x1340=['jayson/promise','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','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4ad9f4,_0x38cb56){var _0x2add44=function(_0x4e9f82){while(--_0x4e9f82){_0x4ad9f4['push'](_0x4ad9f4['shift']());}};_0x2add44(++_0x38cb56);}(_0x1340,0x10d));var _0x0134=function(_0x191f62,_0x3e1fa2){_0x191f62=_0x191f62-0x0;var _0x406a25=_0x1340[_0x191f62];return _0x406a25;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0134('0x0'));var BPromise=require('bluebird');var rs=require(_0x0134('0x1'));var fs=require('fs');var Redis=require(_0x0134('0x2'));var db=require(_0x0134('0x3'))['db'];var utils=require(_0x0134('0x4'));var logger=require(_0x0134('0x5'))('rpc');var config=require(_0x0134('0x6'));var jayson=require(_0x0134('0x7'));var client=jayson[_0x0134('0x8')][_0x0134('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9839b6,_0x37fbc6,_0x5f44fa){return new BPromise(function(_0x1639d5,_0x6c58b3){return client[_0x0134('0xa')](_0x9839b6,_0x5f44fa)[_0x0134('0xb')](function(_0x416764){logger[_0x0134('0xc')](_0x0134('0xd'),_0x37fbc6,'request\x20sent');logger[_0x0134('0xe')](_0x0134('0xf'),_0x37fbc6,_0x0134('0x10'),JSON[_0x0134('0x11')](_0x416764));if(_0x416764[_0x0134('0x12')]){if(_0x416764[_0x0134('0x12')][_0x0134('0x13')]===0x1f4){logger[_0x0134('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x37fbc6,_0x416764[_0x0134('0x12')][_0x0134('0x14')]);return _0x6c58b3(_0x416764[_0x0134('0x12')][_0x0134('0x14')]);}logger[_0x0134('0x12')](_0x0134('0xd'),_0x37fbc6,_0x416764[_0x0134('0x12')][_0x0134('0x14')]);return _0x1639d5(_0x416764[_0x0134('0x12')][_0x0134('0x14')]);}else{logger[_0x0134('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x37fbc6,_0x0134('0x10'));_0x1639d5(_0x416764[_0x0134('0x15')][_0x0134('0x14')]);}})[_0x0134('0x16')](function(_0x417809){logger[_0x0134('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x37fbc6,_0x417809);_0x6c58b3(_0x417809);});});} \ No newline at end of file +var _0xf7f5=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x2d1fcf,_0x625e07){var _0x388240=function(_0x16a91a){while(--_0x16a91a){_0x2d1fcf['push'](_0x2d1fcf['shift']());}};_0x388240(++_0x625e07);}(_0xf7f5,0x96));var _0x5f7f=function(_0x35fc90,_0x228089){_0x35fc90=_0x35fc90-0x0;var _0x44a578=_0xf7f5[_0x35fc90];return _0x44a578;};'use strict';var _=require(_0x5f7f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5f7f('0x1'));var rs=require(_0x5f7f('0x2'));var fs=require('fs');var Redis=require(_0x5f7f('0x3'));var db=require(_0x5f7f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f7f('0x5'))(_0x5f7f('0x6'));var config=require('../../config/environment');var jayson=require(_0x5f7f('0x7'));var client=jayson[_0x5f7f('0x8')][_0x5f7f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ea08b,_0x11b997,_0x2d8d38){return new BPromise(function(_0x2f36cc,_0x3bac61){return client[_0x5f7f('0xa')](_0x3ea08b,_0x2d8d38)[_0x5f7f('0xb')](function(_0x251b9a){logger[_0x5f7f('0xc')](_0x5f7f('0xd'),_0x11b997,'request\x20sent');logger[_0x5f7f('0xe')](_0x5f7f('0xf'),_0x11b997,_0x5f7f('0x10'),JSON[_0x5f7f('0x11')](_0x251b9a));if(_0x251b9a['error']){if(_0x251b9a[_0x5f7f('0x12')][_0x5f7f('0x13')]===0x1f4){logger['error'](_0x5f7f('0xd'),_0x11b997,_0x251b9a['error']['message']);return _0x3bac61(_0x251b9a[_0x5f7f('0x12')]['message']);}logger[_0x5f7f('0x12')](_0x5f7f('0xd'),_0x11b997,_0x251b9a[_0x5f7f('0x12')][_0x5f7f('0x14')]);return _0x2f36cc(_0x251b9a['error']['message']);}else{logger['info'](_0x5f7f('0xd'),_0x11b997,_0x5f7f('0x10'));_0x2f36cc(_0x251b9a['result'][_0x5f7f('0x14')]);}})[_0x5f7f('0x15')](function(_0x334ca9){logger[_0x5f7f('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x11b997,_0x334ca9);_0x3bac61(_0x334ca9);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index c2f7467..3b003db 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 _0xb107=['update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','/:id','/:id/sessions','getSessions','/:id/answers','/:id/summary','30s','getSummary','post','create'];(function(_0x504624,_0x5c80c9){var _0x5b34c0=function(_0x257d52){while(--_0x257d52){_0x504624['push'](_0x504624['shift']());}};_0x5b34c0(++_0x5c80c9);}(_0xb107,0x14e));var _0x7b10=function(_0x44c251,_0x513df9){_0x44c251=_0x44c251-0x0;var _0x12375d=_0xb107[_0x44c251];return _0x12375d;};'use strict';var multer=require(_0x7b10('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7b10('0x1'));var express=require(_0x7b10('0x2'));var router=express[_0x7b10('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x7b10('0x4'));var config=require(_0x7b10('0x5'));var controller=require(_0x7b10('0x6'));router[_0x7b10('0x7')]('/',auth[_0x7b10('0x8')](),controller['index']);router[_0x7b10('0x7')](_0x7b10('0x9'),auth[_0x7b10('0x8')](),controller['show']);router[_0x7b10('0x7')](_0x7b10('0xa'),auth[_0x7b10('0x8')](),controller[_0x7b10('0xb')]);router[_0x7b10('0x7')](_0x7b10('0xc'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x7b10('0xd'),auth[_0x7b10('0x8')](),timeout(_0x7b10('0xe')),controller[_0x7b10('0xf')]);router[_0x7b10('0x10')]('/',auth[_0x7b10('0x8')](),controller[_0x7b10('0x11')]);router['post']('/:id/clone',auth[_0x7b10('0x8')](),controller['clone']);router['put']('/:id',auth[_0x7b10('0x8')](),controller[_0x7b10('0x12')]);router[_0x7b10('0x13')](_0x7b10('0x9'),auth['isAuthenticated'](),controller[_0x7b10('0x14')]);module[_0x7b10('0x15')]=router; \ No newline at end of file +var _0x376c=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','post','create','/:id/clone','clone','/:id','delete','destroy','exports','multer','util'];(function(_0x363267,_0x4ed5bd){var _0x3959df=function(_0x49ff8b){while(--_0x49ff8b){_0x363267['push'](_0x363267['shift']());}};_0x3959df(++_0x4ed5bd);}(_0x376c,0xce));var _0xc376=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x376c[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xc376('0x0'));var util=require(_0xc376('0x1'));var path=require('path');var timeout=require(_0xc376('0x2'));var express=require(_0xc376('0x3'));var router=express[_0xc376('0x4')]();var auth=require(_0xc376('0x5'));var interaction=require(_0xc376('0x6'));var config=require(_0xc376('0x7'));var controller=require(_0xc376('0x8'));router[_0xc376('0x9')]('/',auth[_0xc376('0xa')](),controller['index']);router[_0xc376('0x9')]('/:id',auth[_0xc376('0xa')](),controller[_0xc376('0xb')]);router[_0xc376('0x9')](_0xc376('0xc'),auth[_0xc376('0xa')](),controller[_0xc376('0xd')]);router['get'](_0xc376('0xe'),auth['isAuthenticated'](),controller[_0xc376('0xf')]);router[_0xc376('0x9')](_0xc376('0x10'),auth[_0xc376('0xa')](),timeout(_0xc376('0x11')),controller['getSummary']);router[_0xc376('0x12')]('/',auth[_0xc376('0xa')](),controller[_0xc376('0x13')]);router[_0xc376('0x12')](_0xc376('0x14'),auth[_0xc376('0xa')](),controller[_0xc376('0x15')]);router['put'](_0xc376('0x16'),auth[_0xc376('0xa')](),controller['update']);router[_0xc376('0x17')](_0xc376('0x16'),auth['isAuthenticated'](),controller[_0xc376('0x18')]);module[_0xc376('0x19')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index b6f8cea..ad2061f 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 _0x3358=['util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash'];(function(_0x587f34,_0x2721b5){var _0x157d40=function(_0x14d676){while(--_0x14d676){_0x587f34['push'](_0x587f34['shift']());}};_0x157d40(++_0x2721b5);}(_0x3358,0x14e));var _0x8335=function(_0x276491,_0x4a196e){_0x276491=_0x276491-0x0;var _0x2904c6=_0x3358[_0x276491];return _0x2904c6;};'use strict';var Sequelize=require(_0x8335('0x0'));var _=require(_0x8335('0x1'));var util=require(_0x8335('0x2'));module[_0x8335('0x3')]={'name':{'type':Sequelize[_0x8335('0x4')],'unique':_0x8335('0x5')},'description':{'type':Sequelize[_0x8335('0x4')]},'formData':{'type':Sequelize[_0x8335('0x6')](_0x8335('0x7')),'set':function(_0x3ef378){if(_[_0x8335('0x8')](_0x3ef378)){this[_0x8335('0x9')](_0x8335('0xa'),JSON['stringify'](_0x3ef378));}else if(_['isString'](_0x3ef378)){this['setDataValue']('formData',_0x3ef378);}else{this[_0x8335('0x9')](_0x8335('0xa'),util[_0x8335('0xb')](_0x8335('0xc'),this[_0x8335('0xd')](_0x8335('0x5'))||'',this[_0x8335('0xd')](_0x8335('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x8335('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0xff31=['util','exports','STRING','name','long','isObjectLike','setDataValue','formData','stringify','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','lodash'];(function(_0x1cec84,_0x101ec2){var _0x12b7d3=function(_0x9679d8){while(--_0x9679d8){_0x1cec84['push'](_0x1cec84['shift']());}};_0x12b7d3(++_0x101ec2);}(_0xff31,0x1cd));var _0x1ff3=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xff31[_0x134c2e];return _0x2825db;};'use strict';var Sequelize=require('sequelize');var _=require(_0x1ff3('0x0'));var util=require(_0x1ff3('0x1'));module[_0x1ff3('0x2')]={'name':{'type':Sequelize[_0x1ff3('0x3')],'unique':_0x1ff3('0x4')},'description':{'type':Sequelize[_0x1ff3('0x3')]},'formData':{'type':Sequelize['TEXT'](_0x1ff3('0x5')),'set':function(_0x440089){if(_[_0x1ff3('0x6')](_0x440089)){this[_0x1ff3('0x7')](_0x1ff3('0x8'),JSON[_0x1ff3('0x9')](_0x440089));}else if(_['isString'](_0x440089)){this[_0x1ff3('0x7')](_0x1ff3('0x8'),_0x440089);}else{this[_0x1ff3('0x7')](_0x1ff3('0x8'),util[_0x1ff3('0xa')](_0x1ff3('0xb'),this[_0x1ff3('0xc')](_0x1ff3('0x4'))||'',this[_0x1ff3('0xc')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x1ff3('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x1ff3('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 8344a7d..0b0996b 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 _0xc9e0=['update','then','get','Projects','sendStatus','error','stack','name','send','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','params','keys','length','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','clone','omit','createdAt','updatedAt','body','UserProfileResource','destroy','getSessions','findOne','order','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','offset','limit','set','Content-Range','json','apply','reject','save'];(function(_0x1dc6fe,_0x5ef44e){var _0x557264=function(_0x4d8ef2){while(--_0x4d8ef2){_0x1dc6fe['push'](_0x1dc6fe['shift']());}};_0x557264(++_0x5ef44e);}(_0xc9e0,0x14d));var _0x0c9e=function(_0x4111c5,_0x1b2481){_0x4111c5=_0x4111c5-0x0;var _0x341819=_0xc9e0[_0x4111c5];return _0x341819;};'use strict';var pdf=require(_0x0c9e('0x0'));var emlformat=require(_0x0c9e('0x1'));var rimraf=require(_0x0c9e('0x2'));var zipdir=require(_0x0c9e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0c9e('0x4'));var BPromise=require(_0x0c9e('0x5'));var Mustache=require(_0x0c9e('0x6'));var util=require(_0x0c9e('0x7'));var path=require('path');var sox=require(_0x0c9e('0x8'));var csv=require(_0x0c9e('0x9'));var ejs=require(_0x0c9e('0xa'));var fs=require('fs');var _=require(_0x0c9e('0xb'));var squel=require(_0x0c9e('0xc'));var crypto=require('crypto');var jsforce=require(_0x0c9e('0xd'));var deskjs=require(_0x0c9e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0c9e('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0c9e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0c9e('0x11'));var hardwareService=require(_0x0c9e('0x12'));var logger=require(_0x0c9e('0x13'))(_0x0c9e('0x14'));var utils=require(_0x0c9e('0x15'));var config=require(_0x0c9e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27318b,_0x1f9e7b){_0x1f9e7b=_0x1f9e7b||0xcc;return function(_0x25a295){if(_0x25a295){return _0x27318b['sendStatus'](_0x1f9e7b);}return _0x27318b[_0x0c9e('0x17')](_0x1f9e7b)[_0x0c9e('0x18')]();};}function respondWithResult(_0x5728a6,_0x5687ad){_0x5687ad=_0x5687ad||0xc8;return function(_0x3a18af){if(_0x3a18af){return _0x5728a6[_0x0c9e('0x17')](_0x5687ad)['json'](_0x3a18af);}};}function respondWithFilteredResult(_0xfc8d45,_0x50c378){return function(_0x321bc6){if(_0x321bc6){var _0x3c16d9=_0x321bc6['count'],_0x177295=_0x50c378[_0x0c9e('0x19')],_0x3cae29=_0x50c378['offset']+_0x50c378[_0x0c9e('0x1a')],_0x1382aa;if(_0x3cae29>=_0x3c16d9){_0x3cae29=_0x3c16d9;_0x1382aa=0xc8;}else{_0x1382aa=0xce;}_0xfc8d45['status'](_0x1382aa);return _0xfc8d45[_0x0c9e('0x1b')](_0x0c9e('0x1c'),_0x177295+'-'+_0x3cae29+'/'+_0x3c16d9)[_0x0c9e('0x1d')](_0x321bc6);}return null;};}function patchUpdates(_0x47da59){return function(_0x1495e6){try{jsonpatch[_0x0c9e('0x1e')](_0x1495e6,_0x47da59,!![]);}catch(_0x24627e){return BPromise[_0x0c9e('0x1f')](_0x24627e);}return _0x1495e6[_0x0c9e('0x20')]();};}function saveUpdates(_0x30557b,_0x182422){return function(_0x32191b){if(_0x32191b){return _0x32191b[_0x0c9e('0x21')](_0x30557b)[_0x0c9e('0x22')](function(_0x3ae855){return _0x3ae855;});}return null;};}function removeEntity(_0x3bc978,_0x4d0c77){return function(_0x5ab241){if(_0x5ab241){return _0x5ab241['destroy']()[_0x0c9e('0x22')](function(){var _0x44dcd3=_0x5ab241[_0x0c9e('0x23')]({'plain':!![]});var _0x20d520=_0x0c9e('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x20d520,'resourceId':_0x44dcd3['id']}})[_0x0c9e('0x22')](function(){return _0x5ab241;});})[_0x0c9e('0x22')](function(){_0x3bc978[_0x0c9e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b8648,_0x2521b0){return function(_0x51ea80){if(!_0x51ea80){_0x4b8648[_0x0c9e('0x25')](0x194);}return _0x51ea80;};}function handleError(_0x297b5b,_0x399484){_0x399484=_0x399484||0x1f4;return function(_0x1e7937){logger[_0x0c9e('0x26')](_0x1e7937[_0x0c9e('0x27')]);if(_0x1e7937[_0x0c9e('0x28')]){delete _0x1e7937[_0x0c9e('0x28')];}_0x297b5b[_0x0c9e('0x17')](_0x399484)[_0x0c9e('0x29')](_0x1e7937);};}exports['index']=function(_0x313419,_0x51e1a8){var _0x12f37d={},_0x2a6118={},_0x105011={'count':0x0,'rows':[]};var _0x313310=_[_0x0c9e('0x2a')](db[_0x0c9e('0x2b')][_0x0c9e('0x2c')],function(_0x3bea2e){return{'name':_0x3bea2e[_0x0c9e('0x2d')],'type':_0x3bea2e[_0x0c9e('0x2e')][_0x0c9e('0x2f')]};});_0x2a6118[_0x0c9e('0x30')]=_['map'](_0x313310,_0x0c9e('0x28'));_0x2a6118[_0x0c9e('0x31')]=_['keys'](_0x313419['query']);_0x2a6118[_0x0c9e('0x32')]=_[_0x0c9e('0x33')](_0x2a6118[_0x0c9e('0x30')],_0x2a6118[_0x0c9e('0x31')]);_0x12f37d[_0x0c9e('0x34')]=_[_0x0c9e('0x33')](_0x2a6118[_0x0c9e('0x30')],qs[_0x0c9e('0x35')](_0x313419[_0x0c9e('0x31')][_0x0c9e('0x35')]));_0x12f37d[_0x0c9e('0x34')]=_0x12f37d[_0x0c9e('0x34')]['length']?_0x12f37d[_0x0c9e('0x34')]:_0x2a6118[_0x0c9e('0x30')];if(!_0x313419[_0x0c9e('0x31')][_0x0c9e('0x36')](_0x0c9e('0x37'))){_0x12f37d[_0x0c9e('0x1a')]=qs[_0x0c9e('0x1a')](_0x313419['query'][_0x0c9e('0x1a')]);_0x12f37d[_0x0c9e('0x19')]=qs[_0x0c9e('0x19')](_0x313419[_0x0c9e('0x31')][_0x0c9e('0x19')]);}_0x12f37d['order']=qs[_0x0c9e('0x38')](_0x313419[_0x0c9e('0x31')][_0x0c9e('0x38')]);_0x12f37d[_0x0c9e('0x39')]=qs['filters'](_[_0x0c9e('0x3a')](_0x313419[_0x0c9e('0x31')],_0x2a6118[_0x0c9e('0x32')]));if(_0x313419['query']['filter']){_0x12f37d[_0x0c9e('0x39')]=_['merge'](_0x12f37d[_0x0c9e('0x39')],{'$or':_[_0x0c9e('0x2a')](_0x313310,function(_0x3cad0c){if(_0x3cad0c[_0x0c9e('0x2e')]!==_0x0c9e('0x3b')){var _0x41ec0f={};_0x41ec0f[_0x3cad0c[_0x0c9e('0x28')]]={'$like':'%'+_0x313419[_0x0c9e('0x31')][_0x0c9e('0x3c')]+'%'};return _0x41ec0f;}})});}_0x12f37d=_['merge']({},_0x12f37d,_0x313419[_0x0c9e('0x3d')]);var _0xd5480c={'where':_0x12f37d[_0x0c9e('0x39')]};return db[_0x0c9e('0x2b')][_0x0c9e('0x3e')](_0xd5480c)[_0x0c9e('0x22')](function(_0x4394f8){_0x105011[_0x0c9e('0x3e')]=_0x4394f8;if(_0x313419[_0x0c9e('0x31')][_0x0c9e('0x3f')]){_0x12f37d[_0x0c9e('0x40')]=[{'all':!![]}];}return db['JscriptyProject'][_0x0c9e('0x41')](_0x12f37d);})['then'](function(_0x4d7450){_0x105011[_0x0c9e('0x42')]=_0x4d7450;return _0x105011;})[_0x0c9e('0x22')](respondWithFilteredResult(_0x51e1a8,_0x12f37d))['catch'](handleError(_0x51e1a8,null));};exports[_0x0c9e('0x43')]=function(_0xe96e48,_0x134939){var _0x5324a6={'raw':![],'where':{'id':_0xe96e48[_0x0c9e('0x44')]['id']}},_0x1efe26={};_0x1efe26[_0x0c9e('0x30')]=_[_0x0c9e('0x45')](db['JscriptyProject']['rawAttributes']);_0x1efe26['query']=_[_0x0c9e('0x45')](_0xe96e48[_0x0c9e('0x31')]);_0x1efe26[_0x0c9e('0x32')]=_['intersection'](_0x1efe26[_0x0c9e('0x30')],_0x1efe26[_0x0c9e('0x31')]);_0x5324a6['attributes']=_[_0x0c9e('0x33')](_0x1efe26[_0x0c9e('0x30')],qs[_0x0c9e('0x35')](_0xe96e48[_0x0c9e('0x31')][_0x0c9e('0x35')]));_0x5324a6[_0x0c9e('0x34')]=_0x5324a6[_0x0c9e('0x34')][_0x0c9e('0x46')]?_0x5324a6['attributes']:_0x1efe26[_0x0c9e('0x30')];if(_0xe96e48[_0x0c9e('0x31')][_0x0c9e('0x3f')]){_0x5324a6['include']=[{'all':!![]}];}_0x5324a6=_[_0x0c9e('0x47')]({},_0x5324a6,_0xe96e48[_0x0c9e('0x3d')]);return db[_0x0c9e('0x2b')][_0x0c9e('0x48')](_0x5324a6)['then'](handleEntityNotFound(_0x134939,null))['then'](respondWithResult(_0x134939,null))['catch'](handleError(_0x134939,null));};exports[_0x0c9e('0x49')]=function(_0x55e927,_0x1031ad){return db[_0x0c9e('0x2b')]['create'](_0x55e927['body'],{})[_0x0c9e('0x22')](function(_0x37fc3d){var _0x3157fb=_0x55e927[_0x0c9e('0x4a')][_0x0c9e('0x23')]({'plain':!![]});if(!_0x3157fb)throw new Error(_0x0c9e('0x4b'));if(_0x3157fb[_0x0c9e('0x4c')]===_0x0c9e('0x4a')){var _0x865aa2=_0x37fc3d[_0x0c9e('0x23')]({'plain':!![]});var _0x53b88b=_0x0c9e('0x24');return db[_0x0c9e('0x4d')][_0x0c9e('0x48')]({'where':{'name':_0x53b88b,'userProfileId':_0x3157fb[_0x0c9e('0x4e')]},'raw':!![]})[_0x0c9e('0x22')](function(_0x34a558){if(_0x34a558&&_0x34a558[_0x0c9e('0x4f')]===0x0){return db['UserProfileResource'][_0x0c9e('0x49')]({'name':_0x865aa2[_0x0c9e('0x28')],'resourceId':_0x865aa2['id'],'type':_0x34a558[_0x0c9e('0x28')],'sectionId':_0x34a558['id']},{})['then'](function(){return _0x37fc3d;});}else{return _0x37fc3d;}})['catch'](function(_0x2769ec){logger[_0x0c9e('0x26')](_0x0c9e('0x50'),_0x2769ec);throw _0x2769ec;});}return _0x37fc3d;})[_0x0c9e('0x22')](respondWithResult(_0x1031ad,0xc9))[_0x0c9e('0x51')](handleError(_0x1031ad,null));};exports[_0x0c9e('0x52')]=function(_0x24c6db,_0x565c54){var _0x2e7d0c={'where':{'id':_0x24c6db[_0x0c9e('0x44')]['id']}},_0x195260={};_0x195260[_0x0c9e('0x30')]=_['keys'](db[_0x0c9e('0x2b')][_0x0c9e('0x2c')]);_0x2e7d0c[_0x0c9e('0x34')]=_[_0x0c9e('0x33')](_0x195260[_0x0c9e('0x30')],qs[_0x0c9e('0x35')](_0x24c6db['query'][_0x0c9e('0x35')]));_0x2e7d0c[_0x0c9e('0x34')]=_0x2e7d0c[_0x0c9e('0x34')][_0x0c9e('0x46')]?_0x2e7d0c[_0x0c9e('0x34')]:_0x195260[_0x0c9e('0x30')];if(_0x24c6db['query']['includeAll']){_0x2e7d0c[_0x0c9e('0x40')]=[{'all':!![]}];}_0x2e7d0c=_['merge']({},_0x2e7d0c,_0x24c6db[_0x0c9e('0x3d')]);return db[_0x0c9e('0x2b')][_0x0c9e('0x48')](_0x2e7d0c)[_0x0c9e('0x22')](handleEntityNotFound(_0x565c54,null))['then'](function(_0x4c9bff){if(_0x4c9bff){var _0x125879=_0x4c9bff[_0x0c9e('0x23')]({'plain':!![]});_0x125879=qs[_0x0c9e('0x53')](_0x125879,['id',_0x0c9e('0x54'),_0x0c9e('0x55')]);_0x24c6db[_0x0c9e('0x56')]=_['omit'](_0x24c6db[_0x0c9e('0x56')],['id','createdAt',_0x0c9e('0x55')]);return db[_0x0c9e('0x2b')][_0x0c9e('0x49')](_[_0x0c9e('0x47')](_0x125879,_0x24c6db[_0x0c9e('0x56')]),{'include':_0x24c6db['query'][_0x0c9e('0x3f')]?[{'all':!![]}]:undefined})[_0x0c9e('0x22')](function(_0x34f60d){var _0x3042ef=_0x24c6db['user'][_0x0c9e('0x23')]({'plain':!![]});if(!_0x3042ef)throw new Error(_0x0c9e('0x4b'));if(_0x3042ef['role']==='user'){var _0x1fd867=_0x34f60d[_0x0c9e('0x23')]({'plain':!![]});var _0x5f0c62='Projects';return db['UserProfileSection'][_0x0c9e('0x48')]({'where':{'name':_0x5f0c62,'userProfileId':_0x3042ef[_0x0c9e('0x4e')]},'raw':!![]})[_0x0c9e('0x22')](function(_0x2c1926){if(_0x2c1926&&_0x2c1926['autoAssociation']===0x0){return db[_0x0c9e('0x57')][_0x0c9e('0x49')]({'name':_0x1fd867[_0x0c9e('0x28')],'resourceId':_0x1fd867['id'],'type':_0x2c1926[_0x0c9e('0x28')],'sectionId':_0x2c1926['id']},{})[_0x0c9e('0x22')](function(){return _0x34f60d;});}else{return _0x34f60d;}})[_0x0c9e('0x51')](function(_0x1015eb){logger[_0x0c9e('0x26')](_0x0c9e('0x50'),_0x1015eb);throw _0x1015eb;});}return _0x34f60d;});}})[_0x0c9e('0x22')](respondWithResult(_0x565c54,0xc9))['catch'](handleError(_0x565c54,null));};exports[_0x0c9e('0x21')]=function(_0x3c2b5c,_0x6bead5){if(_0x3c2b5c['body']['id']){delete _0x3c2b5c[_0x0c9e('0x56')]['id'];}return db['JscriptyProject'][_0x0c9e('0x48')]({'where':{'id':_0x3c2b5c[_0x0c9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x6bead5,null))[_0x0c9e('0x22')](saveUpdates(_0x3c2b5c[_0x0c9e('0x56')],null))['then'](respondWithResult(_0x6bead5,null))[_0x0c9e('0x51')](handleError(_0x6bead5,null));};exports[_0x0c9e('0x58')]=function(_0x20ff26,_0x108702){return db['JscriptyProject']['find']({'where':{'id':_0x20ff26[_0x0c9e('0x44')]['id']}})[_0x0c9e('0x22')](handleEntityNotFound(_0x108702,null))[_0x0c9e('0x22')](removeEntity(_0x108702,null))[_0x0c9e('0x51')](handleError(_0x108702,null));};exports[_0x0c9e('0x59')]=function(_0x3a54c2,_0x2cf26b,_0xb6c725){var _0x58fdd7={'raw':!![],'where':{}};var _0xa64250={};var _0xb877b2={'count':0x0,'rows':[]};return db[_0x0c9e('0x2b')][_0x0c9e('0x5a')]({'where':{'id':_0x3a54c2[_0x0c9e('0x44')]['id']}})[_0x0c9e('0x22')](handleEntityNotFound(_0x2cf26b,null))[_0x0c9e('0x22')](function(_0x5bc62b){if(_0x5bc62b){_0xa64250[_0x0c9e('0x30')]=_['keys'](db['JscriptySessionReport'][_0x0c9e('0x2c')]);_0xa64250[_0x0c9e('0x31')]=_['keys'](_0x3a54c2[_0x0c9e('0x31')]);_0xa64250[_0x0c9e('0x32')]=_['intersection'](_0xa64250[_0x0c9e('0x30')],_0xa64250[_0x0c9e('0x31')]);_0x58fdd7['attributes']=_[_0x0c9e('0x33')](_0xa64250[_0x0c9e('0x30')],qs[_0x0c9e('0x35')](_0x3a54c2[_0x0c9e('0x31')][_0x0c9e('0x35')]));_0x58fdd7[_0x0c9e('0x34')]=_0x58fdd7['attributes']['length']?_0x58fdd7[_0x0c9e('0x34')]:_0xa64250[_0x0c9e('0x30')];if(!_0x3a54c2[_0x0c9e('0x31')]['hasOwnProperty'](_0x0c9e('0x37'))){_0x58fdd7['limit']=qs['limit'](_0x3a54c2['query'][_0x0c9e('0x1a')]);_0x58fdd7['offset']=qs[_0x0c9e('0x19')](_0x3a54c2['query']['offset']);}_0x58fdd7[_0x0c9e('0x5b')]=qs[_0x0c9e('0x38')](_0x3a54c2[_0x0c9e('0x31')]['sort']);_0x58fdd7[_0x0c9e('0x39')]=qs['filters'](_[_0x0c9e('0x3a')](_0x3a54c2[_0x0c9e('0x31')],_0xa64250[_0x0c9e('0x32')]));_0x58fdd7[_0x0c9e('0x39')][_0x0c9e('0x5c')]=_0x5bc62b['id'];if(_0x3a54c2[_0x0c9e('0x31')][_0x0c9e('0x3c')]){_0x58fdd7[_0x0c9e('0x39')]=_['merge'](_0x58fdd7[_0x0c9e('0x39')],{'$or':_['map'](_0x58fdd7[_0x0c9e('0x34')],function(_0xe9e841){var _0x303727={};_0x303727[_0xe9e841]={'$like':'%'+_0x3a54c2[_0x0c9e('0x31')][_0x0c9e('0x3c')]+'%'};return _0x303727;})});}_0x58fdd7=_[_0x0c9e('0x47')]({},_0x58fdd7,_0x3a54c2[_0x0c9e('0x3d')]);return db[_0x0c9e('0x5d')][_0x0c9e('0x3e')]({'where':_0x58fdd7[_0x0c9e('0x39')]})[_0x0c9e('0x22')](function(_0x1a5049){_0xb877b2[_0x0c9e('0x3e')]=_0x1a5049;if(_0x3a54c2['query']['includeAll']){_0x58fdd7['include']=[{'all':!![]}];}return db[_0x0c9e('0x5d')][_0x0c9e('0x41')](_0x58fdd7);})[_0x0c9e('0x22')](function(_0x25bb09){_0xb877b2[_0x0c9e('0x42')]=_0x25bb09;return _0xb877b2;});}})[_0x0c9e('0x22')](respondWithFilteredResult(_0x2cf26b,_0x58fdd7))['catch'](handleError(_0x2cf26b,null));};exports[_0x0c9e('0x5e')]=function(_0x3d0323,_0xc0d69b,_0x42dff4){var _0xdc2b35={'raw':!![],'where':{}};var _0x54a650={};var _0x2ac6aa={'count':0x0,'rows':[]};return db[_0x0c9e('0x2b')][_0x0c9e('0x5a')]({'where':{'id':_0x3d0323[_0x0c9e('0x44')]['id']}})['then'](handleEntityNotFound(_0xc0d69b,null))[_0x0c9e('0x22')](function(_0x336150){if(_0x336150){_0x54a650['model']=_['keys'](db['JscriptyAnswerReport']['rawAttributes']);_0x54a650[_0x0c9e('0x31')]=_[_0x0c9e('0x45')](_0x3d0323[_0x0c9e('0x31')]);_0x54a650[_0x0c9e('0x32')]=_[_0x0c9e('0x33')](_0x54a650[_0x0c9e('0x30')],_0x54a650[_0x0c9e('0x31')]);_0xdc2b35[_0x0c9e('0x34')]=_[_0x0c9e('0x33')](_0x54a650[_0x0c9e('0x30')],qs[_0x0c9e('0x35')](_0x3d0323[_0x0c9e('0x31')][_0x0c9e('0x35')]));_0xdc2b35['attributes']=_0xdc2b35['attributes'][_0x0c9e('0x46')]?_0xdc2b35[_0x0c9e('0x34')]:_0x54a650[_0x0c9e('0x30')];if(!_0x3d0323[_0x0c9e('0x31')][_0x0c9e('0x36')](_0x0c9e('0x37'))){_0xdc2b35[_0x0c9e('0x1a')]=qs[_0x0c9e('0x1a')](_0x3d0323[_0x0c9e('0x31')]['limit']);_0xdc2b35['offset']=qs[_0x0c9e('0x19')](_0x3d0323[_0x0c9e('0x31')][_0x0c9e('0x19')]);}_0xdc2b35['order']=qs['sort'](_0x3d0323['query'][_0x0c9e('0x38')]);_0xdc2b35[_0x0c9e('0x39')]=qs[_0x0c9e('0x32')](_[_0x0c9e('0x3a')](_0x3d0323[_0x0c9e('0x31')],_0x54a650['filters']));_0xdc2b35[_0x0c9e('0x39')][_0x0c9e('0x5c')]=_0x336150['id'];if(_0x3d0323[_0x0c9e('0x31')][_0x0c9e('0x3c')]){_0xdc2b35[_0x0c9e('0x39')]=_[_0x0c9e('0x47')](_0xdc2b35[_0x0c9e('0x39')],{'$or':_[_0x0c9e('0x2a')](_0xdc2b35[_0x0c9e('0x34')],function(_0x3883f6){var _0x4255a8={};_0x4255a8[_0x3883f6]={'$like':'%'+_0x3d0323[_0x0c9e('0x31')][_0x0c9e('0x3c')]+'%'};return _0x4255a8;})});}_0xdc2b35=_['merge']({},_0xdc2b35,_0x3d0323['options']);return db[_0x0c9e('0x5f')][_0x0c9e('0x3e')]({'where':_0xdc2b35['where']})[_0x0c9e('0x22')](function(_0x580d05){_0x2ac6aa[_0x0c9e('0x3e')]=_0x580d05;if(_0x3d0323[_0x0c9e('0x31')][_0x0c9e('0x3f')]){_0xdc2b35['include']=[{'all':!![]}];}return db[_0x0c9e('0x5f')][_0x0c9e('0x41')](_0xdc2b35);})['then'](function(_0x19a34b){_0x2ac6aa[_0x0c9e('0x42')]=_0x19a34b;return _0x2ac6aa;});}})[_0x0c9e('0x22')](respondWithFilteredResult(_0xc0d69b,_0xdc2b35))[_0x0c9e('0x51')](handleError(_0xc0d69b,null));};function char(_0x265a0f){return _0x0c9e('0x60')===typeof _0x265a0f?String[_0x0c9e('0x61')][_0x0c9e('0x1e')](null,arguments):_0x265a0f;}function needsEncapsulation(_0x18fad4){return!!_0x18fad4&&(_0x18fad4[_0x0c9e('0x62')]()[_0x0c9e('0x63')](char(0xd))>=0x0||_0x18fad4[_0x0c9e('0x62')]()['indexOf'](char(0xa))>=0x0||_0x18fad4[_0x0c9e('0x62')]()['indexOf'](char(0x2c))>=0x0||_0x18fad4[_0x0c9e('0x62')]()[_0x0c9e('0x63')](char(0x22))>=0x0);}function encapsulate(_0x410c5e){var _0x5c2d9a=char(0x22),_0x3c0aa8='\x5c'+char(0x22),_0xb7d3fc=_0x410c5e[_0x0c9e('0x62')]()[_0x0c9e('0x64')](new RegExp(_0x5c2d9a,'g'),_0x3c0aa8);return _0x5c2d9a+_0xb7d3fc+_0x5c2d9a;}exports[_0x0c9e('0x65')]=function(_0xf367bc,_0x22cf50,_0x125ee8){var _0x5c0bd8,_0x15c6f2;var _0x48dc28={'where':{'ProjectId':_0xf367bc[_0x0c9e('0x44')]['id']}};if(_0xf367bc[_0x0c9e('0x31')][_0x0c9e('0x66')]){_0x48dc28[_0x0c9e('0x39')][_0x0c9e('0x67')]=JSON[_0x0c9e('0x68')](_0xf367bc[_0x0c9e('0x31')][_0x0c9e('0x66')]);}return db[_0x0c9e('0x5d')][_0x0c9e('0x41')](_0x48dc28)['then'](handleEntityNotFound(_0x22cf50,null))[_0x0c9e('0x22')](function(_0x2087f8){if(_0x2087f8){_0x5c0bd8=_0x2087f8;return db[_0x0c9e('0x69')][_0x0c9e('0x41')]({'where':{'SessionId':{'$in':_[_0x0c9e('0x2a')](_0x5c0bd8,'id')},'ProjectId':_0xf367bc[_0x0c9e('0x44')]['id']},'order':_0x0c9e('0x6a')});}})['then'](handleEntityNotFound(_0x22cf50,null))['then'](function(_0x49f572){if(_0x49f572){_0x15c6f2=_0x49f572;var _0x3fbcb5={};for(var _0x38e9a5=0x0,_0x2b4be2=_0x15c6f2[_0x0c9e('0x46')];_0x38e9a5<_0x2b4be2;_0x38e9a5++){if(!_0x3fbcb5[_0x0c9e('0x36')](_0x15c6f2[_0x38e9a5][_0x0c9e('0x6b')])){_0x3fbcb5[_0x15c6f2[_0x38e9a5][_0x0c9e('0x6b')]]=needsEncapsulation(_0x15c6f2[_0x38e9a5]['question'])?encapsulate(_0x15c6f2[_0x38e9a5][_0x0c9e('0x6c')]):_0x15c6f2[_0x38e9a5][_0x0c9e('0x6c')];}}var _0x44522c=[],_0x50faa7={};for(var _0x3eca00=0x0,_0x31aeeb=_0x5c0bd8['length'];_0x3eca00<_0x31aeeb;_0x3eca00++){_0x50faa7={'ProjectId':_0xf367bc[_0x0c9e('0x44')]['id'],'SessionId':_0x5c0bd8[_0x3eca00]['id'],'StartTime':moment(_0x5c0bd8[_0x3eca00][_0x0c9e('0x67')])[_0x0c9e('0x6d')](_0x0c9e('0x6e'))};for(var _0x1bcfdb=0x0,_0x40311a=_0x15c6f2['length'];_0x1bcfdb<_0x40311a;_0x1bcfdb++){if(_0x15c6f2[_0x1bcfdb]['SessionId']==_0x5c0bd8[_0x3eca00]['id']&&_0x3fbcb5[_0x0c9e('0x36')](_0x15c6f2[_0x1bcfdb][_0x0c9e('0x6b')])){_0x50faa7[_0x3fbcb5[_0x15c6f2[_0x1bcfdb]['questionId']]]=_0x15c6f2[_0x1bcfdb][_0x0c9e('0x6f')];}}for(var _0x4efd9c in _0x3fbcb5){if(!_0x50faa7['hasOwnProperty'](_0x3fbcb5[_0x4efd9c])){_0x50faa7[_0x3fbcb5[_0x4efd9c]]=null;}}_0x44522c[_0x0c9e('0x70')](_0x50faa7);}return _0x44522c;}})[_0x0c9e('0x22')](function(_0x3eac5c){if(!_[_0x0c9e('0x71')](_0x3eac5c)){var _0x4d1b63=toCsv(_0x3eac5c);var _0x187730=Date[_0x0c9e('0x72')]();fs[_0x0c9e('0x73')](util['format'](_0x0c9e('0x74'),_0xf367bc[_0x0c9e('0x44')]['id'],_0x187730),_0x4d1b63);_0x22cf50[_0x0c9e('0x75')]('Content-disposition','attachment;\x20filename='+util['format'](_0x0c9e('0x76'),_0xf367bc[_0x0c9e('0x44')]['id'],_0x187730));_0x22cf50[_0x0c9e('0x75')](_0x0c9e('0x77'),_0x0c9e('0x78'));return _0x22cf50[_0x0c9e('0x79')](util[_0x0c9e('0x6d')](_0x0c9e('0x74'),_0xf367bc[_0x0c9e('0x44')]['id'],_0x187730));}else{return _0x22cf50['sendStatus'](0xcc);}})[_0x0c9e('0x51')](handleError(_0x22cf50,null));}; \ No newline at end of file +var _0xbd53=['rows','catch','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','update','getSessions','findOne','JscriptySessionReport','nolimit','ProjectId','getAnswers','hasOwnProperty','pick','options','JscriptyAnswerReport','number','toString','indexOf','replace','getSummary','startTime','starttime','JscriptyQuestionReport','questionId','question','format','SessionId','answer','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','index','JscriptyProject','rawAttributes','key','model','map','keys','query','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','type','VIRTUAL','count','include','findAll'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xbd53,0x199));var _0x3bd5=function(_0x4dc4a0,_0x157565){_0x4dc4a0=_0x4dc4a0-0x0;var _0x3d4462=_0xbd53[_0x4dc4a0];return _0x3d4462;};'use strict';var pdf=require(_0x3bd5('0x0'));var emlformat=require(_0x3bd5('0x1'));var rimraf=require(_0x3bd5('0x2'));var zipdir=require(_0x3bd5('0x3'));var jsonpatch=require(_0x3bd5('0x4'));var rp=require(_0x3bd5('0x5'));var moment=require(_0x3bd5('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x3bd5('0x7'));var util=require('util');var path=require('path');var sox=require(_0x3bd5('0x8'));var csv=require(_0x3bd5('0x9'));var ejs=require(_0x3bd5('0xa'));var fs=require('fs');var _=require(_0x3bd5('0xb'));var squel=require(_0x3bd5('0xc'));var crypto=require(_0x3bd5('0xd'));var jsforce=require(_0x3bd5('0xe'));var deskjs=require(_0x3bd5('0xf'));var toCsv=require(_0x3bd5('0x9'));var querystring=require(_0x3bd5('0x10'));var Papa=require(_0x3bd5('0x11'));var Redis=require('ioredis');var authService=require(_0x3bd5('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3bd5('0x13'));var hardwareService=require(_0x3bd5('0x14'));var logger=require(_0x3bd5('0x15'))(_0x3bd5('0x16'));var utils=require('../../config/utils');var config=require(_0x3bd5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b5d62,_0x160a0e){_0x160a0e=_0x160a0e||0xcc;return function(_0x129471){if(_0x129471){return _0x2b5d62[_0x3bd5('0x18')](_0x160a0e);}return _0x2b5d62[_0x3bd5('0x19')](_0x160a0e)[_0x3bd5('0x1a')]();};}function respondWithResult(_0x4a13b3,_0x55a10c){_0x55a10c=_0x55a10c||0xc8;return function(_0x4a369d){if(_0x4a369d){return _0x4a13b3[_0x3bd5('0x19')](_0x55a10c)[_0x3bd5('0x1b')](_0x4a369d);}};}function respondWithFilteredResult(_0x35be00,_0x3f24ff){return function(_0x12092d){if(_0x12092d){var _0x2fd097=_0x12092d['count'],_0x2c4777=_0x3f24ff[_0x3bd5('0x1c')],_0x4af32b=_0x3f24ff['offset']+_0x3f24ff[_0x3bd5('0x1d')],_0x578222;if(_0x4af32b>=_0x2fd097){_0x4af32b=_0x2fd097;_0x578222=0xc8;}else{_0x578222=0xce;}_0x35be00[_0x3bd5('0x19')](_0x578222);return _0x35be00[_0x3bd5('0x1e')](_0x3bd5('0x1f'),_0x2c4777+'-'+_0x4af32b+'/'+_0x2fd097)[_0x3bd5('0x1b')](_0x12092d);}return null;};}function patchUpdates(_0x707fad){return function(_0x2c2bfd){try{jsonpatch[_0x3bd5('0x20')](_0x2c2bfd,_0x707fad,!![]);}catch(_0x371adb){return BPromise[_0x3bd5('0x21')](_0x371adb);}return _0x2c2bfd[_0x3bd5('0x22')]();};}function saveUpdates(_0x5c946f,_0x277951){return function(_0xc3e177){if(_0xc3e177){return _0xc3e177['update'](_0x5c946f)[_0x3bd5('0x23')](function(_0x17e05e){return _0x17e05e;});}return null;};}function removeEntity(_0x1e7090,_0x26c59e){return function(_0x5f2aff){if(_0x5f2aff){return _0x5f2aff[_0x3bd5('0x24')]()['then'](function(){var _0x5d9e2e=_0x5f2aff[_0x3bd5('0x25')]({'plain':!![]});var _0x15f963=_0x3bd5('0x26');return db[_0x3bd5('0x27')][_0x3bd5('0x24')]({'where':{'type':_0x15f963,'resourceId':_0x5d9e2e['id']}})[_0x3bd5('0x23')](function(){return _0x5f2aff;});})[_0x3bd5('0x23')](function(){_0x1e7090['status'](0xcc)[_0x3bd5('0x1a')]();});}};}function handleEntityNotFound(_0x595990,_0x35db25){return function(_0x217be8){if(!_0x217be8){_0x595990[_0x3bd5('0x18')](0x194);}return _0x217be8;};}function handleError(_0x288641,_0x1f9fd6){_0x1f9fd6=_0x1f9fd6||0x1f4;return function(_0x508649){logger[_0x3bd5('0x28')](_0x508649[_0x3bd5('0x29')]);if(_0x508649['name']){delete _0x508649[_0x3bd5('0x2a')];}_0x288641[_0x3bd5('0x19')](_0x1f9fd6)[_0x3bd5('0x2b')](_0x508649);};}exports[_0x3bd5('0x2c')]=function(_0x300959,_0x302b3a){var _0x339979={},_0x423139={},_0x1ea21b={'count':0x0,'rows':[]};var _0x2c6ada=_['map'](db[_0x3bd5('0x2d')][_0x3bd5('0x2e')],function(_0x1c2930){return{'name':_0x1c2930['fieldName'],'type':_0x1c2930['type'][_0x3bd5('0x2f')]};});_0x423139[_0x3bd5('0x30')]=_[_0x3bd5('0x31')](_0x2c6ada,_0x3bd5('0x2a'));_0x423139['query']=_[_0x3bd5('0x32')](_0x300959[_0x3bd5('0x33')]);_0x423139[_0x3bd5('0x34')]=_[_0x3bd5('0x35')](_0x423139[_0x3bd5('0x30')],_0x423139[_0x3bd5('0x33')]);_0x339979[_0x3bd5('0x36')]=_[_0x3bd5('0x35')](_0x423139[_0x3bd5('0x30')],qs[_0x3bd5('0x37')](_0x300959[_0x3bd5('0x33')][_0x3bd5('0x37')]));_0x339979['attributes']=_0x339979[_0x3bd5('0x36')][_0x3bd5('0x38')]?_0x339979[_0x3bd5('0x36')]:_0x423139['model'];if(!_0x300959[_0x3bd5('0x33')]['hasOwnProperty']('nolimit')){_0x339979['limit']=qs[_0x3bd5('0x1d')](_0x300959[_0x3bd5('0x33')][_0x3bd5('0x1d')]);_0x339979['offset']=qs['offset'](_0x300959[_0x3bd5('0x33')][_0x3bd5('0x1c')]);}_0x339979[_0x3bd5('0x39')]=qs[_0x3bd5('0x3a')](_0x300959[_0x3bd5('0x33')][_0x3bd5('0x3a')]);_0x339979[_0x3bd5('0x3b')]=qs[_0x3bd5('0x34')](_['pick'](_0x300959[_0x3bd5('0x33')],_0x423139[_0x3bd5('0x34')]));if(_0x300959[_0x3bd5('0x33')][_0x3bd5('0x3c')]){_0x339979[_0x3bd5('0x3b')]=_[_0x3bd5('0x3d')](_0x339979[_0x3bd5('0x3b')],{'$or':_['map'](_0x2c6ada,function(_0x579578){if(_0x579578[_0x3bd5('0x3e')]!==_0x3bd5('0x3f')){var _0x5c83a1={};_0x5c83a1[_0x579578['name']]={'$like':'%'+_0x300959[_0x3bd5('0x33')][_0x3bd5('0x3c')]+'%'};return _0x5c83a1;}})});}_0x339979=_[_0x3bd5('0x3d')]({},_0x339979,_0x300959['options']);var _0x5cc5db={'where':_0x339979[_0x3bd5('0x3b')]};return db[_0x3bd5('0x2d')][_0x3bd5('0x40')](_0x5cc5db)['then'](function(_0x21eb12){_0x1ea21b[_0x3bd5('0x40')]=_0x21eb12;if(_0x300959['query']['includeAll']){_0x339979[_0x3bd5('0x41')]=[{'all':!![]}];}return db[_0x3bd5('0x2d')][_0x3bd5('0x42')](_0x339979);})[_0x3bd5('0x23')](function(_0x1b37d8){_0x1ea21b[_0x3bd5('0x43')]=_0x1b37d8;return _0x1ea21b;})[_0x3bd5('0x23')](respondWithFilteredResult(_0x302b3a,_0x339979))[_0x3bd5('0x44')](handleError(_0x302b3a,null));};exports['show']=function(_0x304314,_0x5d8948){var _0x19a38d={'raw':![],'where':{'id':_0x304314[_0x3bd5('0x45')]['id']}},_0x378ee5={};_0x378ee5['model']=_[_0x3bd5('0x32')](db[_0x3bd5('0x2d')][_0x3bd5('0x2e')]);_0x378ee5[_0x3bd5('0x33')]=_[_0x3bd5('0x32')](_0x304314[_0x3bd5('0x33')]);_0x378ee5[_0x3bd5('0x34')]=_[_0x3bd5('0x35')](_0x378ee5['model'],_0x378ee5[_0x3bd5('0x33')]);_0x19a38d['attributes']=_[_0x3bd5('0x35')](_0x378ee5[_0x3bd5('0x30')],qs[_0x3bd5('0x37')](_0x304314[_0x3bd5('0x33')]['fields']));_0x19a38d['attributes']=_0x19a38d[_0x3bd5('0x36')]['length']?_0x19a38d['attributes']:_0x378ee5[_0x3bd5('0x30')];if(_0x304314[_0x3bd5('0x33')][_0x3bd5('0x46')]){_0x19a38d[_0x3bd5('0x41')]=[{'all':!![]}];}_0x19a38d=_['merge']({},_0x19a38d,_0x304314['options']);return db[_0x3bd5('0x2d')][_0x3bd5('0x47')](_0x19a38d)[_0x3bd5('0x23')](handleEntityNotFound(_0x5d8948,null))['then'](respondWithResult(_0x5d8948,null))[_0x3bd5('0x44')](handleError(_0x5d8948,null));};exports[_0x3bd5('0x48')]=function(_0x342877,_0x279e45){return db[_0x3bd5('0x2d')]['create'](_0x342877[_0x3bd5('0x49')],{})[_0x3bd5('0x23')](function(_0x7abd57){var _0x55180a=_0x342877[_0x3bd5('0x4a')][_0x3bd5('0x25')]({'plain':!![]});if(!_0x55180a)throw new Error(_0x3bd5('0x4b'));if(_0x55180a[_0x3bd5('0x4c')]===_0x3bd5('0x4a')){var _0x146f09=_0x7abd57[_0x3bd5('0x25')]({'plain':!![]});var _0x27a4a8=_0x3bd5('0x26');return db[_0x3bd5('0x4d')][_0x3bd5('0x47')]({'where':{'name':_0x27a4a8,'userProfileId':_0x55180a['userProfileId']},'raw':!![]})[_0x3bd5('0x23')](function(_0x46da26){if(_0x46da26&&_0x46da26[_0x3bd5('0x4e')]===0x0){return db[_0x3bd5('0x27')][_0x3bd5('0x48')]({'name':_0x146f09[_0x3bd5('0x2a')],'resourceId':_0x146f09['id'],'type':_0x46da26['name'],'sectionId':_0x46da26['id']},{})['then'](function(){return _0x7abd57;});}else{return _0x7abd57;}})[_0x3bd5('0x44')](function(_0x577611){logger['error'](_0x3bd5('0x4f'),_0x577611);throw _0x577611;});}return _0x7abd57;})[_0x3bd5('0x23')](respondWithResult(_0x279e45,0xc9))['catch'](handleError(_0x279e45,null));};exports[_0x3bd5('0x50')]=function(_0xa4eb57,_0x10650a){var _0x15e959={'where':{'id':_0xa4eb57[_0x3bd5('0x45')]['id']}},_0x1382bb={};_0x1382bb[_0x3bd5('0x30')]=_['keys'](db[_0x3bd5('0x2d')]['rawAttributes']);_0x15e959[_0x3bd5('0x36')]=_[_0x3bd5('0x35')](_0x1382bb[_0x3bd5('0x30')],qs['fields'](_0xa4eb57[_0x3bd5('0x33')][_0x3bd5('0x37')]));_0x15e959[_0x3bd5('0x36')]=_0x15e959[_0x3bd5('0x36')][_0x3bd5('0x38')]?_0x15e959['attributes']:_0x1382bb[_0x3bd5('0x30')];if(_0xa4eb57[_0x3bd5('0x33')][_0x3bd5('0x46')]){_0x15e959['include']=[{'all':!![]}];}_0x15e959=_[_0x3bd5('0x3d')]({},_0x15e959,_0xa4eb57['options']);return db['JscriptyProject'][_0x3bd5('0x47')](_0x15e959)[_0x3bd5('0x23')](handleEntityNotFound(_0x10650a,null))['then'](function(_0x58ae8f){if(_0x58ae8f){var _0x58e059=_0x58ae8f[_0x3bd5('0x25')]({'plain':!![]});_0x58e059=qs['omit'](_0x58e059,['id','createdAt','updatedAt']);_0xa4eb57['body']=_[_0x3bd5('0x51')](_0xa4eb57[_0x3bd5('0x49')],['id',_0x3bd5('0x52'),_0x3bd5('0x53')]);return db[_0x3bd5('0x2d')][_0x3bd5('0x48')](_['merge'](_0x58e059,_0xa4eb57[_0x3bd5('0x49')]),{'include':_0xa4eb57[_0x3bd5('0x33')][_0x3bd5('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x5d78f2){var _0xaa0553=_0xa4eb57[_0x3bd5('0x4a')][_0x3bd5('0x25')]({'plain':!![]});if(!_0xaa0553)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xaa0553[_0x3bd5('0x4c')]===_0x3bd5('0x4a')){var _0x37b2bd=_0x5d78f2[_0x3bd5('0x25')]({'plain':!![]});var _0x23f595=_0x3bd5('0x26');return db[_0x3bd5('0x4d')][_0x3bd5('0x47')]({'where':{'name':_0x23f595,'userProfileId':_0xaa0553[_0x3bd5('0x54')]},'raw':!![]})['then'](function(_0x490e9c){if(_0x490e9c&&_0x490e9c['autoAssociation']===0x0){return db[_0x3bd5('0x27')]['create']({'name':_0x37b2bd['name'],'resourceId':_0x37b2bd['id'],'type':_0x490e9c[_0x3bd5('0x2a')],'sectionId':_0x490e9c['id']},{})[_0x3bd5('0x23')](function(){return _0x5d78f2;});}else{return _0x5d78f2;}})[_0x3bd5('0x44')](function(_0x2ca0e4){logger[_0x3bd5('0x28')](_0x3bd5('0x4f'),_0x2ca0e4);throw _0x2ca0e4;});}return _0x5d78f2;});}})['then'](respondWithResult(_0x10650a,0xc9))['catch'](handleError(_0x10650a,null));};exports[_0x3bd5('0x55')]=function(_0x1260b8,_0x569bb9){if(_0x1260b8[_0x3bd5('0x49')]['id']){delete _0x1260b8['body']['id'];}return db[_0x3bd5('0x2d')][_0x3bd5('0x47')]({'where':{'id':_0x1260b8['params']['id']}})['then'](handleEntityNotFound(_0x569bb9,null))[_0x3bd5('0x23')](saveUpdates(_0x1260b8[_0x3bd5('0x49')],null))[_0x3bd5('0x23')](respondWithResult(_0x569bb9,null))['catch'](handleError(_0x569bb9,null));};exports[_0x3bd5('0x24')]=function(_0x48ee2d,_0x319978){return db['JscriptyProject'][_0x3bd5('0x47')]({'where':{'id':_0x48ee2d[_0x3bd5('0x45')]['id']}})[_0x3bd5('0x23')](handleEntityNotFound(_0x319978,null))[_0x3bd5('0x23')](removeEntity(_0x319978,null))[_0x3bd5('0x44')](handleError(_0x319978,null));};exports[_0x3bd5('0x56')]=function(_0x239aae,_0x45eb84,_0x2046e5){var _0x2d535a={'raw':!![],'where':{}};var _0x13eabd={};var _0x1d23ff={'count':0x0,'rows':[]};return db[_0x3bd5('0x2d')][_0x3bd5('0x57')]({'where':{'id':_0x239aae[_0x3bd5('0x45')]['id']}})['then'](handleEntityNotFound(_0x45eb84,null))[_0x3bd5('0x23')](function(_0x258d34){if(_0x258d34){_0x13eabd['model']=_[_0x3bd5('0x32')](db[_0x3bd5('0x58')][_0x3bd5('0x2e')]);_0x13eabd[_0x3bd5('0x33')]=_[_0x3bd5('0x32')](_0x239aae[_0x3bd5('0x33')]);_0x13eabd['filters']=_['intersection'](_0x13eabd[_0x3bd5('0x30')],_0x13eabd['query']);_0x2d535a['attributes']=_['intersection'](_0x13eabd[_0x3bd5('0x30')],qs[_0x3bd5('0x37')](_0x239aae['query'][_0x3bd5('0x37')]));_0x2d535a[_0x3bd5('0x36')]=_0x2d535a[_0x3bd5('0x36')][_0x3bd5('0x38')]?_0x2d535a[_0x3bd5('0x36')]:_0x13eabd['model'];if(!_0x239aae[_0x3bd5('0x33')]['hasOwnProperty'](_0x3bd5('0x59'))){_0x2d535a[_0x3bd5('0x1d')]=qs[_0x3bd5('0x1d')](_0x239aae['query'][_0x3bd5('0x1d')]);_0x2d535a[_0x3bd5('0x1c')]=qs['offset'](_0x239aae['query'][_0x3bd5('0x1c')]);}_0x2d535a['order']=qs[_0x3bd5('0x3a')](_0x239aae[_0x3bd5('0x33')][_0x3bd5('0x3a')]);_0x2d535a[_0x3bd5('0x3b')]=qs[_0x3bd5('0x34')](_['pick'](_0x239aae['query'],_0x13eabd[_0x3bd5('0x34')]));_0x2d535a[_0x3bd5('0x3b')][_0x3bd5('0x5a')]=_0x258d34['id'];if(_0x239aae[_0x3bd5('0x33')]['filter']){_0x2d535a[_0x3bd5('0x3b')]=_[_0x3bd5('0x3d')](_0x2d535a[_0x3bd5('0x3b')],{'$or':_[_0x3bd5('0x31')](_0x2d535a[_0x3bd5('0x36')],function(_0x52e23e){var _0x13fbf4={};_0x13fbf4[_0x52e23e]={'$like':'%'+_0x239aae['query'][_0x3bd5('0x3c')]+'%'};return _0x13fbf4;})});}_0x2d535a=_[_0x3bd5('0x3d')]({},_0x2d535a,_0x239aae['options']);return db[_0x3bd5('0x58')]['count']({'where':_0x2d535a[_0x3bd5('0x3b')]})[_0x3bd5('0x23')](function(_0x1bae22){_0x1d23ff['count']=_0x1bae22;if(_0x239aae[_0x3bd5('0x33')][_0x3bd5('0x46')]){_0x2d535a[_0x3bd5('0x41')]=[{'all':!![]}];}return db[_0x3bd5('0x58')]['findAll'](_0x2d535a);})['then'](function(_0x344ecc){_0x1d23ff[_0x3bd5('0x43')]=_0x344ecc;return _0x1d23ff;});}})['then'](respondWithFilteredResult(_0x45eb84,_0x2d535a))[_0x3bd5('0x44')](handleError(_0x45eb84,null));};exports[_0x3bd5('0x5b')]=function(_0x1cf436,_0x13dfaa,_0x2f7fa8){var _0x5efa7b={'raw':!![],'where':{}};var _0x452225={};var _0x58bb69={'count':0x0,'rows':[]};return db[_0x3bd5('0x2d')][_0x3bd5('0x57')]({'where':{'id':_0x1cf436['params']['id']}})[_0x3bd5('0x23')](handleEntityNotFound(_0x13dfaa,null))[_0x3bd5('0x23')](function(_0x28c753){if(_0x28c753){_0x452225[_0x3bd5('0x30')]=_[_0x3bd5('0x32')](db['JscriptyAnswerReport'][_0x3bd5('0x2e')]);_0x452225[_0x3bd5('0x33')]=_[_0x3bd5('0x32')](_0x1cf436['query']);_0x452225[_0x3bd5('0x34')]=_[_0x3bd5('0x35')](_0x452225[_0x3bd5('0x30')],_0x452225[_0x3bd5('0x33')]);_0x5efa7b[_0x3bd5('0x36')]=_[_0x3bd5('0x35')](_0x452225[_0x3bd5('0x30')],qs['fields'](_0x1cf436[_0x3bd5('0x33')]['fields']));_0x5efa7b[_0x3bd5('0x36')]=_0x5efa7b[_0x3bd5('0x36')][_0x3bd5('0x38')]?_0x5efa7b[_0x3bd5('0x36')]:_0x452225[_0x3bd5('0x30')];if(!_0x1cf436[_0x3bd5('0x33')][_0x3bd5('0x5c')](_0x3bd5('0x59'))){_0x5efa7b[_0x3bd5('0x1d')]=qs[_0x3bd5('0x1d')](_0x1cf436[_0x3bd5('0x33')][_0x3bd5('0x1d')]);_0x5efa7b[_0x3bd5('0x1c')]=qs[_0x3bd5('0x1c')](_0x1cf436[_0x3bd5('0x33')][_0x3bd5('0x1c')]);}_0x5efa7b[_0x3bd5('0x39')]=qs[_0x3bd5('0x3a')](_0x1cf436[_0x3bd5('0x33')][_0x3bd5('0x3a')]);_0x5efa7b['where']=qs[_0x3bd5('0x34')](_[_0x3bd5('0x5d')](_0x1cf436[_0x3bd5('0x33')],_0x452225[_0x3bd5('0x34')]));_0x5efa7b[_0x3bd5('0x3b')][_0x3bd5('0x5a')]=_0x28c753['id'];if(_0x1cf436[_0x3bd5('0x33')][_0x3bd5('0x3c')]){_0x5efa7b[_0x3bd5('0x3b')]=_[_0x3bd5('0x3d')](_0x5efa7b['where'],{'$or':_['map'](_0x5efa7b[_0x3bd5('0x36')],function(_0x5a3673){var _0x36681e={};_0x36681e[_0x5a3673]={'$like':'%'+_0x1cf436[_0x3bd5('0x33')][_0x3bd5('0x3c')]+'%'};return _0x36681e;})});}_0x5efa7b=_[_0x3bd5('0x3d')]({},_0x5efa7b,_0x1cf436[_0x3bd5('0x5e')]);return db['JscriptyAnswerReport'][_0x3bd5('0x40')]({'where':_0x5efa7b[_0x3bd5('0x3b')]})[_0x3bd5('0x23')](function(_0x5b2863){_0x58bb69['count']=_0x5b2863;if(_0x1cf436[_0x3bd5('0x33')][_0x3bd5('0x46')]){_0x5efa7b[_0x3bd5('0x41')]=[{'all':!![]}];}return db[_0x3bd5('0x5f')][_0x3bd5('0x42')](_0x5efa7b);})[_0x3bd5('0x23')](function(_0x223708){_0x58bb69[_0x3bd5('0x43')]=_0x223708;return _0x58bb69;});}})[_0x3bd5('0x23')](respondWithFilteredResult(_0x13dfaa,_0x5efa7b))[_0x3bd5('0x44')](handleError(_0x13dfaa,null));};function char(_0x4a9d61){return _0x3bd5('0x60')===typeof _0x4a9d61?String['fromCharCode']['apply'](null,arguments):_0x4a9d61;}function needsEncapsulation(_0x1c3a9f){return!!_0x1c3a9f&&(_0x1c3a9f[_0x3bd5('0x61')]()[_0x3bd5('0x62')](char(0xd))>=0x0||_0x1c3a9f['toString']()[_0x3bd5('0x62')](char(0xa))>=0x0||_0x1c3a9f[_0x3bd5('0x61')]()[_0x3bd5('0x62')](char(0x2c))>=0x0||_0x1c3a9f[_0x3bd5('0x61')]()[_0x3bd5('0x62')](char(0x22))>=0x0);}function encapsulate(_0x3be3ac){var _0x157d2a=char(0x22),_0x2e5271='\x5c'+char(0x22),_0x2f2a5c=_0x3be3ac[_0x3bd5('0x61')]()[_0x3bd5('0x63')](new RegExp(_0x157d2a,'g'),_0x2e5271);return _0x157d2a+_0x2f2a5c+_0x157d2a;}exports[_0x3bd5('0x64')]=function(_0x5d7227,_0x4c7925,_0x4077b7){var _0x3cdda2,_0x3a0e6b;var _0x50ac1d={'where':{'ProjectId':_0x5d7227[_0x3bd5('0x45')]['id']}};if(_0x5d7227[_0x3bd5('0x33')][_0x3bd5('0x65')]){_0x50ac1d['where'][_0x3bd5('0x66')]=JSON['parse'](_0x5d7227[_0x3bd5('0x33')][_0x3bd5('0x65')]);}return db['JscriptySessionReport'][_0x3bd5('0x42')](_0x50ac1d)[_0x3bd5('0x23')](handleEntityNotFound(_0x4c7925,null))[_0x3bd5('0x23')](function(_0x16c6ce){if(_0x16c6ce){_0x3cdda2=_0x16c6ce;return db[_0x3bd5('0x67')][_0x3bd5('0x42')]({'where':{'SessionId':{'$in':_[_0x3bd5('0x31')](_0x3cdda2,'id')},'ProjectId':_0x5d7227[_0x3bd5('0x45')]['id']},'order':'-createdAt'});}})[_0x3bd5('0x23')](handleEntityNotFound(_0x4c7925,null))[_0x3bd5('0x23')](function(_0x212b4f){if(_0x212b4f){_0x3a0e6b=_0x212b4f;var _0x318d11={};for(var _0x5c6e78=0x0,_0x385986=_0x3a0e6b[_0x3bd5('0x38')];_0x5c6e78<_0x385986;_0x5c6e78++){if(!_0x318d11['hasOwnProperty'](_0x3a0e6b[_0x5c6e78][_0x3bd5('0x68')])){_0x318d11[_0x3a0e6b[_0x5c6e78][_0x3bd5('0x68')]]=needsEncapsulation(_0x3a0e6b[_0x5c6e78][_0x3bd5('0x69')])?encapsulate(_0x3a0e6b[_0x5c6e78][_0x3bd5('0x69')]):_0x3a0e6b[_0x5c6e78]['question'];}}var _0x3522e0=[],_0x1e7b9e={};for(var _0x1c6562=0x0,_0x830f7c=_0x3cdda2[_0x3bd5('0x38')];_0x1c6562<_0x830f7c;_0x1c6562++){_0x1e7b9e={'ProjectId':_0x5d7227[_0x3bd5('0x45')]['id'],'SessionId':_0x3cdda2[_0x1c6562]['id'],'StartTime':moment(_0x3cdda2[_0x1c6562]['starttime'])[_0x3bd5('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x3ad7bd=0x0,_0x4e5c36=_0x3a0e6b[_0x3bd5('0x38')];_0x3ad7bd<_0x4e5c36;_0x3ad7bd++){if(_0x3a0e6b[_0x3ad7bd][_0x3bd5('0x6b')]==_0x3cdda2[_0x1c6562]['id']&&_0x318d11[_0x3bd5('0x5c')](_0x3a0e6b[_0x3ad7bd][_0x3bd5('0x68')])){_0x1e7b9e[_0x318d11[_0x3a0e6b[_0x3ad7bd]['questionId']]]=_0x3a0e6b[_0x3ad7bd][_0x3bd5('0x6c')];}}for(var _0x5449f3 in _0x318d11){if(!_0x1e7b9e['hasOwnProperty'](_0x318d11[_0x5449f3])){_0x1e7b9e[_0x318d11[_0x5449f3]]=null;}}_0x3522e0[_0x3bd5('0x6d')](_0x1e7b9e);}return _0x3522e0;}})[_0x3bd5('0x23')](function(_0x5f18ed){if(!_[_0x3bd5('0x6e')](_0x5f18ed)){var _0x12349a=toCsv(_0x5f18ed);var _0x44d6e2=Date[_0x3bd5('0x6f')]();fs['writeFileSync'](util[_0x3bd5('0x6a')](_0x3bd5('0x70'),_0x5d7227[_0x3bd5('0x45')]['id'],_0x44d6e2),_0x12349a);_0x4c7925[_0x3bd5('0x71')]('Content-disposition',_0x3bd5('0x72')+util[_0x3bd5('0x6a')](_0x3bd5('0x73'),_0x5d7227[_0x3bd5('0x45')]['id'],_0x44d6e2));_0x4c7925[_0x3bd5('0x71')](_0x3bd5('0x74'),_0x3bd5('0x75'));return _0x4c7925[_0x3bd5('0x76')](util[_0x3bd5('0x6a')](_0x3bd5('0x70'),_0x5d7227[_0x3bd5('0x45')]['id'],_0x44d6e2));}else{return _0x4c7925[_0x3bd5('0x18')](0xcc);}})[_0x3bd5('0x44')](handleError(_0x4c7925,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index b33a823..8789934 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 _0xc8a3=['rimraf','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash','moment','bluebird','request-promise'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc8a3,0x74));var _0x3c8a=function(_0x3f4750,_0x1a331e){_0x3f4750=_0x3f4750-0x0;var _0x4e605d=_0xc8a3[_0x3f4750];return _0x4e605d;};'use strict';var _=require(_0x3c8a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3c8a('0x1'));var BPromise=require(_0x3c8a('0x2'));var rp=require(_0x3c8a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c8a('0x4'));var config=require('../../config/environment');var attributes=require(_0x3c8a('0x5'));module[_0x3c8a('0x6')]=function(_0xc8c3d7,_0x5d440c){return _0xc8c3d7[_0x3c8a('0x7')](_0x3c8a('0x8'),attributes,{'tableName':_0x3c8a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0195=['define','JscriptyProject','jscripty_projects','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports'];(function(_0x13409a,_0x8f949e){var _0x12815b=function(_0x4ee9ab){while(--_0x4ee9ab){_0x13409a['push'](_0x13409a['shift']());}};_0x12815b(++_0x8f949e);}(_0x0195,0x13b));var _0x5019=function(_0x22ed93,_0x23e624){_0x22ed93=_0x22ed93-0x0;var _0x53c31f=_0x0195[_0x22ed93];return _0x53c31f;};'use strict';var _=require(_0x5019('0x0'));var util=require(_0x5019('0x1'));var logger=require('../../config/logger')(_0x5019('0x2'));var moment=require('moment');var BPromise=require(_0x5019('0x3'));var rp=require(_0x5019('0x4'));var fs=require('fs');var path=require(_0x5019('0x5'));var rimraf=require(_0x5019('0x6'));var config=require(_0x5019('0x7'));var attributes=require(_0x5019('0x8'));module[_0x5019('0x9')]=function(_0x4ea238,_0x3a25d3){return _0x4ea238[_0x5019('0xa')](_0x5019('0xb'),attributes,{'tableName':_0x5019('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 5a61269..f7f773f 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 _0x6ccf=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x137f06,_0x2a7b36){var _0x152b0c=function(_0x5655b1){while(--_0x5655b1){_0x137f06['push'](_0x137f06['shift']());}};_0x152b0c(++_0x2a7b36);}(_0x6ccf,0x159));var _0xf6cc=function(_0x4b7b69,_0x3ab075){_0x4b7b69=_0x4b7b69-0x0;var _0x173b4c=_0x6ccf[_0x4b7b69];return _0x173b4c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf6cc('0x0'));var BPromise=require(_0xf6cc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf6cc('0x2'));var db=require(_0xf6cc('0x3'))['db'];var utils=require(_0xf6cc('0x4'));var logger=require(_0xf6cc('0x5'))(_0xf6cc('0x6'));var config=require(_0xf6cc('0x7'));var jayson=require(_0xf6cc('0x8'));var client=jayson[_0xf6cc('0x9')][_0xf6cc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31d306,_0x19ebbe,_0x3dae8a){return new BPromise(function(_0xcaeeb2,_0x3103a7){return client[_0xf6cc('0xb')](_0x31d306,_0x3dae8a)[_0xf6cc('0xc')](function(_0x5880e0){logger[_0xf6cc('0xd')](_0xf6cc('0xe'),_0x19ebbe,_0xf6cc('0xf'));logger[_0xf6cc('0x10')](_0xf6cc('0x11'),_0x19ebbe,_0xf6cc('0xf'),JSON[_0xf6cc('0x12')](_0x5880e0));if(_0x5880e0['error']){if(_0x5880e0[_0xf6cc('0x13')]['code']===0x1f4){logger[_0xf6cc('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x19ebbe,_0x5880e0[_0xf6cc('0x13')][_0xf6cc('0x14')]);return _0x3103a7(_0x5880e0[_0xf6cc('0x13')][_0xf6cc('0x14')]);}logger[_0xf6cc('0x13')](_0xf6cc('0xe'),_0x19ebbe,_0x5880e0[_0xf6cc('0x13')][_0xf6cc('0x14')]);return _0xcaeeb2(_0x5880e0[_0xf6cc('0x13')]['message']);}else{logger[_0xf6cc('0xd')](_0xf6cc('0xe'),_0x19ebbe,_0xf6cc('0xf'));_0xcaeeb2(_0x5880e0[_0xf6cc('0x15')][_0xf6cc('0x14')]);}})[_0xf6cc('0x16')](function(_0x1c7892){logger[_0xf6cc('0x13')](_0xf6cc('0xe'),_0x19ebbe,_0x1c7892);_0x3103a7(_0x1c7892);});});} \ No newline at end of file +var _0xd5ea=['request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','JscriptyProject,\x20%s,\x20%s','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x24ff13,_0x27f278){var _0x4e2ea2=function(_0x4613fe){while(--_0x4613fe){_0x24ff13['push'](_0x24ff13['shift']());}};_0x4e2ea2(++_0x27f278);}(_0xd5ea,0x17d));var _0xad5e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd5ea[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xad5e('0x0'));var util=require(_0xad5e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xad5e('0x2'));var fs=require('fs');var Redis=require(_0xad5e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xad5e('0x4'));var logger=require(_0xad5e('0x5'))(_0xad5e('0x6'));var config=require(_0xad5e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xad5e('0x8')][_0xad5e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27f405,_0x424b14,_0xb8f691){return new BPromise(function(_0x5ea365,_0x5c0563){return client[_0xad5e('0xa')](_0x27f405,_0xb8f691)['then'](function(_0x5a8eec){logger['info'](_0xad5e('0xb'),_0x424b14,'request\x20sent');logger['debug'](_0xad5e('0xc'),_0x424b14,'request\x20sent',JSON[_0xad5e('0xd')](_0x5a8eec));if(_0x5a8eec[_0xad5e('0xe')]){if(_0x5a8eec[_0xad5e('0xe')][_0xad5e('0xf')]===0x1f4){logger['error'](_0xad5e('0xb'),_0x424b14,_0x5a8eec[_0xad5e('0xe')][_0xad5e('0x10')]);return _0x5c0563(_0x5a8eec[_0xad5e('0xe')][_0xad5e('0x10')]);}logger['error'](_0xad5e('0xb'),_0x424b14,_0x5a8eec[_0xad5e('0xe')][_0xad5e('0x10')]);return _0x5ea365(_0x5a8eec[_0xad5e('0xe')][_0xad5e('0x10')]);}else{logger[_0xad5e('0x11')]('JscriptyProject,\x20%s,\x20%s',_0x424b14,_0xad5e('0x12'));_0x5ea365(_0x5a8eec[_0xad5e('0x13')][_0xad5e('0x10')]);}})[_0xad5e('0x14')](function(_0x1dd3ed){logger[_0xad5e('0xe')](_0xad5e('0xb'),_0x424b14,_0x1dd3ed);_0x5c0563(_0x1dd3ed);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 6edb71c..90167ac 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 _0x834e=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x23b401,_0x250f26){var _0x95c219=function(_0x2c71f4){while(--_0x2c71f4){_0x23b401['push'](_0x23b401['shift']());}};_0x95c219(++_0x250f26);}(_0x834e,0x73));var _0xe834=function(_0x4bab9d,_0x57622b){_0x4bab9d=_0x4bab9d-0x0;var _0x592f45=_0x834e[_0x4bab9d];return _0x592f45;};'use strict';var multer=require(_0xe834('0x0'));var util=require(_0xe834('0x1'));var path=require(_0xe834('0x2'));var timeout=require(_0xe834('0x3'));var express=require(_0xe834('0x4'));var router=express[_0xe834('0x5')]();var auth=require(_0xe834('0x6'));var interaction=require(_0xe834('0x7'));var config=require(_0xe834('0x8'));var controller=require('./jscriptyQuestionReport.controller');router[_0xe834('0x9')]('/',auth['isAuthenticated'](),controller[_0xe834('0xa')]);router[_0xe834('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xe834('0x9')](_0xe834('0xb'),auth[_0xe834('0xc')](),controller[_0xe834('0xd')]);router[_0xe834('0xe')]('/',auth['isAuthenticated'](),controller[_0xe834('0xf')]);router[_0xe834('0x10')](_0xe834('0xb'),auth[_0xe834('0xc')](),controller[_0xe834('0x11')]);router['delete'](_0xe834('0xb'),auth[_0xe834('0xc')](),controller[_0xe834('0x12')]);module[_0xe834('0x13')]=router; \ No newline at end of file +var _0xcabb=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','describe','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0xd336fa,_0x39d1b2){var _0x3370b1=function(_0x41c5cc){while(--_0x41c5cc){_0xd336fa['push'](_0xd336fa['shift']());}};_0x3370b1(++_0x39d1b2);}(_0xcabb,0xe1));var _0xbcab=function(_0x3b0bb9,_0x55e7a7){_0x3b0bb9=_0x3b0bb9-0x0;var _0x29a72f=_0xcabb[_0x3b0bb9];return _0x29a72f;};'use strict';var multer=require(_0xbcab('0x0'));var util=require(_0xbcab('0x1'));var path=require(_0xbcab('0x2'));var timeout=require(_0xbcab('0x3'));var express=require(_0xbcab('0x4'));var router=express[_0xbcab('0x5')]();var auth=require(_0xbcab('0x6'));var interaction=require(_0xbcab('0x7'));var config=require(_0xbcab('0x8'));var controller=require(_0xbcab('0x9'));router['get']('/',auth[_0xbcab('0xa')](),controller[_0xbcab('0xb')]);router['get']('/describe',auth[_0xbcab('0xa')](),controller[_0xbcab('0xc')]);router[_0xbcab('0xd')](_0xbcab('0xe'),auth[_0xbcab('0xa')](),controller[_0xbcab('0xf')]);router[_0xbcab('0x10')]('/',auth['isAuthenticated'](),controller[_0xbcab('0x11')]);router[_0xbcab('0x12')]('/:id',auth[_0xbcab('0xa')](),controller[_0xbcab('0x13')]);router[_0xbcab('0x14')]('/:id',auth[_0xbcab('0xa')](),controller[_0xbcab('0x15')]);module[_0xbcab('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index c2cda04..2e737e7 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 _0x28c6=['TEXT','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x28c6,0x1dd));var _0x628c=function(_0x2125f0,_0x2f23b9){_0x2125f0=_0x2125f0-0x0;var _0x12d6eb=_0x28c6[_0x2125f0];return _0x12d6eb;};'use strict';var Sequelize=require(_0x628c('0x0'));module[_0x628c('0x1')]={'question':{'type':Sequelize[_0x628c('0x2')]},'answer':{'type':Sequelize[_0x628c('0x3')]('long')},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x628c('0x2')]},'queue':{'type':Sequelize[_0x628c('0x2')]},'uniqueid':{'type':Sequelize[_0x628c('0x2')]},'calleridname':{'type':Sequelize[_0x628c('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0x628c('0x2')]}}; \ No newline at end of file +var _0x7de6=['TEXT','long','STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7de6,0x175));var _0x67de=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0x7de6[_0xbb14db];return _0x36bed7;};'use strict';var Sequelize=require(_0x67de('0x0'));module[_0x67de('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0x67de('0x2')](_0x67de('0x3'))},'membername':{'type':Sequelize[_0x67de('0x4')]},'projectname':{'type':Sequelize[_0x67de('0x4')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x67de('0x4')]},'calleridnum':{'type':Sequelize[_0x67de('0x4')]},'questionId':{'type':Sequelize[_0x67de('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 1b17cb1..2c56552 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 _0x2f16=['stack','name','send','map','JscriptyQuestionReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','show','include','options','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','count','limit','status','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error'];(function(_0xb58f9,_0x13b3b5){var _0x14bf30=function(_0x3f7a4e){while(--_0x3f7a4e){_0xb58f9['push'](_0xb58f9['shift']());}};_0x14bf30(++_0x13b3b5);}(_0x2f16,0x14f));var _0x62f1=function(_0x1df088,_0x38c471){_0x1df088=_0x1df088-0x0;var _0x267951=_0x2f16[_0x1df088];return _0x267951;};'use strict';var pdf=require(_0x62f1('0x0'));var emlformat=require(_0x62f1('0x1'));var rimraf=require(_0x62f1('0x2'));var zipdir=require(_0x62f1('0x3'));var jsonpatch=require(_0x62f1('0x4'));var rp=require(_0x62f1('0x5'));var moment=require(_0x62f1('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x62f1('0x7'));var util=require(_0x62f1('0x8'));var path=require('path');var sox=require(_0x62f1('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x62f1('0xa'));var squel=require(_0x62f1('0xb'));var crypto=require(_0x62f1('0xc'));var jsforce=require(_0x62f1('0xd'));var deskjs=require(_0x62f1('0xe'));var toCsv=require(_0x62f1('0xf'));var querystring=require(_0x62f1('0x10'));var Papa=require('papaparse');var Redis=require(_0x62f1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x62f1('0x12'));var as=require(_0x62f1('0x13'));var hardwareService=require(_0x62f1('0x14'));var logger=require(_0x62f1('0x15'))(_0x62f1('0x16'));var utils=require(_0x62f1('0x17'));var config=require(_0x62f1('0x18'));var db=require(_0x62f1('0x19'))['db'];function respondWithStatusCode(_0x3c9018,_0x4e528f){_0x4e528f=_0x4e528f||0xcc;return function(_0x1b6682){if(_0x1b6682){return _0x3c9018['sendStatus'](_0x4e528f);}return _0x3c9018['status'](_0x4e528f)[_0x62f1('0x1a')]();};}function respondWithResult(_0x50cc99,_0x18cd54){_0x18cd54=_0x18cd54||0xc8;return function(_0x32ef8a){if(_0x32ef8a){return _0x50cc99['status'](_0x18cd54)[_0x62f1('0x1b')](_0x32ef8a);}};}function respondWithFilteredResult(_0x6decd6,_0x1711d2){return function(_0x1473fe){if(_0x1473fe){var _0x49c2a9=_0x1473fe[_0x62f1('0x1c')],_0xee2ef1=_0x1711d2['offset'],_0x47d963=_0x1711d2['offset']+_0x1711d2[_0x62f1('0x1d')],_0x1e7de5;if(_0x47d963>=_0x49c2a9){_0x47d963=_0x49c2a9;_0x1e7de5=0xc8;}else{_0x1e7de5=0xce;}_0x6decd6[_0x62f1('0x1e')](_0x1e7de5);return _0x6decd6['set'](_0x62f1('0x1f'),_0xee2ef1+'-'+_0x47d963+'/'+_0x49c2a9)[_0x62f1('0x1b')](_0x1473fe);}return null;};}function patchUpdates(_0x5d68de){return function(_0x56eab0){try{jsonpatch[_0x62f1('0x20')](_0x56eab0,_0x5d68de,!![]);}catch(_0x217cd1){return BPromise[_0x62f1('0x21')](_0x217cd1);}return _0x56eab0[_0x62f1('0x22')]();};}function saveUpdates(_0x2b1f72,_0x5f3541){return function(_0x1bdd2e){if(_0x1bdd2e){return _0x1bdd2e[_0x62f1('0x23')](_0x2b1f72)['then'](function(_0x5efdfb){return _0x5efdfb;});}return null;};}function removeEntity(_0x371a71,_0x27fa43){return function(_0x11dd2c){if(_0x11dd2c){return _0x11dd2c[_0x62f1('0x24')]()[_0x62f1('0x25')](function(){_0x371a71[_0x62f1('0x1e')](0xcc)[_0x62f1('0x1a')]();});}};}function handleEntityNotFound(_0x5e435b,_0x3f79ce){return function(_0x52ffa8){if(!_0x52ffa8){_0x5e435b[_0x62f1('0x26')](0x194);}return _0x52ffa8;};}function handleError(_0x2d7cb5,_0x214585){_0x214585=_0x214585||0x1f4;return function(_0x597335){logger[_0x62f1('0x27')](_0x597335[_0x62f1('0x28')]);if(_0x597335[_0x62f1('0x29')]){delete _0x597335[_0x62f1('0x29')];}_0x2d7cb5[_0x62f1('0x1e')](_0x214585)[_0x62f1('0x2a')](_0x597335);};}exports['index']=function(_0x4011e7,_0x5c54cc){var _0x5ced1e={},_0x2b253c={},_0x1acf7e={'count':0x0,'rows':[]};var _0x20e32b=_[_0x62f1('0x2b')](db[_0x62f1('0x2c')][_0x62f1('0x2d')],function(_0x381b9e){return{'name':_0x381b9e['fieldName'],'type':_0x381b9e['type']['key']};});_0x2b253c[_0x62f1('0x2e')]=_[_0x62f1('0x2b')](_0x20e32b,_0x62f1('0x29'));_0x2b253c[_0x62f1('0x2f')]=_[_0x62f1('0x30')](_0x4011e7[_0x62f1('0x2f')]);_0x2b253c[_0x62f1('0x31')]=_[_0x62f1('0x32')](_0x2b253c[_0x62f1('0x2e')],_0x2b253c[_0x62f1('0x2f')]);_0x5ced1e[_0x62f1('0x33')]=_['intersection'](_0x2b253c[_0x62f1('0x2e')],qs[_0x62f1('0x34')](_0x4011e7[_0x62f1('0x2f')][_0x62f1('0x34')]));_0x5ced1e['attributes']=_0x5ced1e[_0x62f1('0x33')][_0x62f1('0x35')]?_0x5ced1e[_0x62f1('0x33')]:_0x2b253c[_0x62f1('0x2e')];if(!_0x4011e7[_0x62f1('0x2f')][_0x62f1('0x36')](_0x62f1('0x37'))){_0x5ced1e[_0x62f1('0x1d')]=qs[_0x62f1('0x1d')](_0x4011e7['query'][_0x62f1('0x1d')]);_0x5ced1e['offset']=qs[_0x62f1('0x38')](_0x4011e7[_0x62f1('0x2f')][_0x62f1('0x38')]);}_0x5ced1e[_0x62f1('0x39')]=qs[_0x62f1('0x3a')](_0x4011e7[_0x62f1('0x2f')][_0x62f1('0x3a')]);_0x5ced1e[_0x62f1('0x3b')]=qs[_0x62f1('0x31')](_[_0x62f1('0x3c')](_0x4011e7[_0x62f1('0x2f')],_0x2b253c[_0x62f1('0x31')]));if(_0x4011e7[_0x62f1('0x2f')][_0x62f1('0x3d')]){_0x5ced1e[_0x62f1('0x3b')]=_[_0x62f1('0x3e')](_0x5ced1e['where'],{'$or':_[_0x62f1('0x2b')](_0x20e32b,function(_0x25e62f){if(_0x25e62f['type']!==_0x62f1('0x3f')){var _0xc0c1dc={};_0xc0c1dc[_0x25e62f['name']]={'$like':'%'+_0x4011e7['query'][_0x62f1('0x3d')]+'%'};return _0xc0c1dc;}})});}_0x5ced1e=_[_0x62f1('0x3e')]({},_0x5ced1e,_0x4011e7['options']);var _0x5ee6c0={'where':_0x5ced1e[_0x62f1('0x3b')]};return db['JscriptyQuestionReport'][_0x62f1('0x1c')](_0x5ee6c0)[_0x62f1('0x25')](function(_0x39b55e){_0x1acf7e[_0x62f1('0x1c')]=_0x39b55e;if(_0x4011e7['query'][_0x62f1('0x40')]){_0x5ced1e['include']=[{'all':!![]}];}return db[_0x62f1('0x2c')][_0x62f1('0x41')](_0x5ced1e);})[_0x62f1('0x25')](function(_0x77f16c){_0x1acf7e['rows']=_0x77f16c;return _0x1acf7e;})[_0x62f1('0x25')](respondWithFilteredResult(_0x5c54cc,_0x5ced1e))[_0x62f1('0x42')](handleError(_0x5c54cc,null));};exports[_0x62f1('0x43')]=function(_0x51f6c8,_0x8b1f4e){var _0x4ef0db={'raw':!![],'where':{'id':_0x51f6c8['params']['id']}},_0x1ed885={};_0x1ed885[_0x62f1('0x2e')]=_[_0x62f1('0x30')](db[_0x62f1('0x2c')][_0x62f1('0x2d')]);_0x1ed885[_0x62f1('0x2f')]=_[_0x62f1('0x30')](_0x51f6c8[_0x62f1('0x2f')]);_0x1ed885['filters']=_['intersection'](_0x1ed885[_0x62f1('0x2e')],_0x1ed885[_0x62f1('0x2f')]);_0x4ef0db[_0x62f1('0x33')]=_[_0x62f1('0x32')](_0x1ed885[_0x62f1('0x2e')],qs[_0x62f1('0x34')](_0x51f6c8[_0x62f1('0x2f')][_0x62f1('0x34')]));_0x4ef0db[_0x62f1('0x33')]=_0x4ef0db[_0x62f1('0x33')][_0x62f1('0x35')]?_0x4ef0db[_0x62f1('0x33')]:_0x1ed885[_0x62f1('0x2e')];if(_0x51f6c8[_0x62f1('0x2f')][_0x62f1('0x40')]){_0x4ef0db[_0x62f1('0x44')]=[{'all':!![]}];}_0x4ef0db=_[_0x62f1('0x3e')]({},_0x4ef0db,_0x51f6c8[_0x62f1('0x45')]);return db[_0x62f1('0x2c')][_0x62f1('0x46')](_0x4ef0db)[_0x62f1('0x25')](handleEntityNotFound(_0x8b1f4e,null))[_0x62f1('0x25')](respondWithResult(_0x8b1f4e,null))[_0x62f1('0x42')](handleError(_0x8b1f4e,null));};exports['create']=function(_0x38e072,_0x181d05){return db[_0x62f1('0x2c')][_0x62f1('0x47')](_0x38e072[_0x62f1('0x48')],{})['then'](respondWithResult(_0x181d05,0xc9))[_0x62f1('0x42')](handleError(_0x181d05,null));};exports['update']=function(_0x47f574,_0x265950){if(_0x47f574[_0x62f1('0x48')]['id']){delete _0x47f574['body']['id'];}return db[_0x62f1('0x2c')][_0x62f1('0x46')]({'where':{'id':_0x47f574['params']['id']}})[_0x62f1('0x25')](handleEntityNotFound(_0x265950,null))[_0x62f1('0x25')](saveUpdates(_0x47f574[_0x62f1('0x48')],null))[_0x62f1('0x25')](respondWithResult(_0x265950,null))[_0x62f1('0x42')](handleError(_0x265950,null));};exports['destroy']=function(_0x52ca1d,_0x4edeb4){return db[_0x62f1('0x2c')]['find']({'where':{'id':_0x52ca1d[_0x62f1('0x49')]['id']}})[_0x62f1('0x25')](handleEntityNotFound(_0x4edeb4,null))['then'](removeEntity(_0x4edeb4,null))[_0x62f1('0x42')](handleError(_0x4edeb4,null));};exports[_0x62f1('0x4a')]=function(_0x511c72,_0x396b2c){return db['JscriptyQuestionReport'][_0x62f1('0x4a')]()['then'](respondWithResult(_0x396b2c,null))[_0x62f1('0x42')](handleError(_0x396b2c,null));}; \ No newline at end of file +var _0x7d0f=['where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','lodash','squel','crypto','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','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','JscriptyQuestionReport','rawAttributes','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x7d0f,0xeb));var _0xf7d0=function(_0x420605,_0x1740b2){_0x420605=_0x420605-0x0;var _0x192aa1=_0x7d0f[_0x420605];return _0x192aa1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf7d0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf7d0('0x1'));var jsonpatch=require(_0xf7d0('0x2'));var rp=require(_0xf7d0('0x3'));var moment=require(_0xf7d0('0x4'));var BPromise=require(_0xf7d0('0x5'));var Mustache=require(_0xf7d0('0x6'));var util=require('util');var path=require(_0xf7d0('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xf7d0('0x8'));var squel=require(_0xf7d0('0x9'));var crypto=require(_0xf7d0('0xa'));var jsforce=require(_0xf7d0('0xb'));var deskjs=require(_0xf7d0('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf7d0('0xd'));var Papa=require('papaparse');var Redis=require(_0xf7d0('0xe'));var authService=require(_0xf7d0('0xf'));var qs=require(_0xf7d0('0x10'));var as=require(_0xf7d0('0x11'));var hardwareService=require(_0xf7d0('0x12'));var logger=require(_0xf7d0('0x13'))(_0xf7d0('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf7d0('0x15'))['db'];function respondWithStatusCode(_0x59a652,_0x1f1e9c){_0x1f1e9c=_0x1f1e9c||0xcc;return function(_0x3b5156){if(_0x3b5156){return _0x59a652[_0xf7d0('0x16')](_0x1f1e9c);}return _0x59a652[_0xf7d0('0x17')](_0x1f1e9c)[_0xf7d0('0x18')]();};}function respondWithResult(_0x4cc3e9,_0x16c48d){_0x16c48d=_0x16c48d||0xc8;return function(_0x54b202){if(_0x54b202){return _0x4cc3e9[_0xf7d0('0x17')](_0x16c48d)[_0xf7d0('0x19')](_0x54b202);}};}function respondWithFilteredResult(_0x353116,_0x38c7b6){return function(_0x239f3d){if(_0x239f3d){var _0x5c0891=_0x239f3d[_0xf7d0('0x1a')],_0x881717=_0x38c7b6[_0xf7d0('0x1b')],_0x15fb60=_0x38c7b6[_0xf7d0('0x1b')]+_0x38c7b6[_0xf7d0('0x1c')],_0x1b5b17;if(_0x15fb60>=_0x5c0891){_0x15fb60=_0x5c0891;_0x1b5b17=0xc8;}else{_0x1b5b17=0xce;}_0x353116[_0xf7d0('0x17')](_0x1b5b17);return _0x353116['set'](_0xf7d0('0x1d'),_0x881717+'-'+_0x15fb60+'/'+_0x5c0891)[_0xf7d0('0x19')](_0x239f3d);}return null;};}function patchUpdates(_0x50cdb4){return function(_0x124810){try{jsonpatch[_0xf7d0('0x1e')](_0x124810,_0x50cdb4,!![]);}catch(_0x2fb7b5){return BPromise[_0xf7d0('0x1f')](_0x2fb7b5);}return _0x124810[_0xf7d0('0x20')]();};}function saveUpdates(_0x1e993a,_0x3b3684){return function(_0x2ec8f4){if(_0x2ec8f4){return _0x2ec8f4[_0xf7d0('0x21')](_0x1e993a)[_0xf7d0('0x22')](function(_0x31cd2b){return _0x31cd2b;});}return null;};}function removeEntity(_0x4121ef,_0x357752){return function(_0x247b87){if(_0x247b87){return _0x247b87[_0xf7d0('0x23')]()[_0xf7d0('0x22')](function(){_0x4121ef[_0xf7d0('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x556462,_0x4e01ba){return function(_0x56257e){if(!_0x56257e){_0x556462[_0xf7d0('0x16')](0x194);}return _0x56257e;};}function handleError(_0x1f1e52,_0x320d37){_0x320d37=_0x320d37||0x1f4;return function(_0x4f56d5){logger[_0xf7d0('0x24')](_0x4f56d5[_0xf7d0('0x25')]);if(_0x4f56d5[_0xf7d0('0x26')]){delete _0x4f56d5[_0xf7d0('0x26')];}_0x1f1e52['status'](_0x320d37)['send'](_0x4f56d5);};}exports[_0xf7d0('0x27')]=function(_0x56b67e,_0x34c7a4){var _0x32b176={},_0x22daca={},_0x288754={'count':0x0,'rows':[]};var _0x25d1ca=_[_0xf7d0('0x28')](db[_0xf7d0('0x29')][_0xf7d0('0x2a')],function(_0x28e4ac){return{'name':_0x28e4ac['fieldName'],'type':_0x28e4ac[_0xf7d0('0x2b')][_0xf7d0('0x2c')]};});_0x22daca['model']=_['map'](_0x25d1ca,_0xf7d0('0x26'));_0x22daca[_0xf7d0('0x2d')]=_[_0xf7d0('0x2e')](_0x56b67e[_0xf7d0('0x2d')]);_0x22daca[_0xf7d0('0x2f')]=_[_0xf7d0('0x30')](_0x22daca['model'],_0x22daca[_0xf7d0('0x2d')]);_0x32b176[_0xf7d0('0x31')]=_['intersection'](_0x22daca[_0xf7d0('0x32')],qs[_0xf7d0('0x33')](_0x56b67e['query'][_0xf7d0('0x33')]));_0x32b176[_0xf7d0('0x31')]=_0x32b176[_0xf7d0('0x31')][_0xf7d0('0x34')]?_0x32b176[_0xf7d0('0x31')]:_0x22daca[_0xf7d0('0x32')];if(!_0x56b67e[_0xf7d0('0x2d')][_0xf7d0('0x35')](_0xf7d0('0x36'))){_0x32b176[_0xf7d0('0x1c')]=qs[_0xf7d0('0x1c')](_0x56b67e[_0xf7d0('0x2d')][_0xf7d0('0x1c')]);_0x32b176[_0xf7d0('0x1b')]=qs[_0xf7d0('0x1b')](_0x56b67e['query'][_0xf7d0('0x1b')]);}_0x32b176[_0xf7d0('0x37')]=qs[_0xf7d0('0x38')](_0x56b67e[_0xf7d0('0x2d')]['sort']);_0x32b176[_0xf7d0('0x39')]=qs['filters'](_[_0xf7d0('0x3a')](_0x56b67e[_0xf7d0('0x2d')],_0x22daca['filters']));if(_0x56b67e[_0xf7d0('0x2d')][_0xf7d0('0x3b')]){_0x32b176['where']=_['merge'](_0x32b176[_0xf7d0('0x39')],{'$or':_[_0xf7d0('0x28')](_0x25d1ca,function(_0x1ea89f){if(_0x1ea89f[_0xf7d0('0x2b')]!==_0xf7d0('0x3c')){var _0x353ab6={};_0x353ab6[_0x1ea89f[_0xf7d0('0x26')]]={'$like':'%'+_0x56b67e[_0xf7d0('0x2d')][_0xf7d0('0x3b')]+'%'};return _0x353ab6;}})});}_0x32b176=_[_0xf7d0('0x3d')]({},_0x32b176,_0x56b67e[_0xf7d0('0x3e')]);var _0x109da2={'where':_0x32b176[_0xf7d0('0x39')]};return db[_0xf7d0('0x29')][_0xf7d0('0x1a')](_0x109da2)[_0xf7d0('0x22')](function(_0x539dbe){_0x288754[_0xf7d0('0x1a')]=_0x539dbe;if(_0x56b67e[_0xf7d0('0x2d')]['includeAll']){_0x32b176[_0xf7d0('0x3f')]=[{'all':!![]}];}return db[_0xf7d0('0x29')][_0xf7d0('0x40')](_0x32b176);})['then'](function(_0xecd11f){_0x288754[_0xf7d0('0x41')]=_0xecd11f;return _0x288754;})['then'](respondWithFilteredResult(_0x34c7a4,_0x32b176))[_0xf7d0('0x42')](handleError(_0x34c7a4,null));};exports[_0xf7d0('0x43')]=function(_0x2043c8,_0x23bdab){var _0x2cd04c={'raw':!![],'where':{'id':_0x2043c8['params']['id']}},_0x17f304={};_0x17f304[_0xf7d0('0x32')]=_[_0xf7d0('0x2e')](db['JscriptyQuestionReport'][_0xf7d0('0x2a')]);_0x17f304[_0xf7d0('0x2d')]=_[_0xf7d0('0x2e')](_0x2043c8[_0xf7d0('0x2d')]);_0x17f304['filters']=_[_0xf7d0('0x30')](_0x17f304['model'],_0x17f304[_0xf7d0('0x2d')]);_0x2cd04c[_0xf7d0('0x31')]=_[_0xf7d0('0x30')](_0x17f304['model'],qs[_0xf7d0('0x33')](_0x2043c8[_0xf7d0('0x2d')]['fields']));_0x2cd04c['attributes']=_0x2cd04c[_0xf7d0('0x31')][_0xf7d0('0x34')]?_0x2cd04c[_0xf7d0('0x31')]:_0x17f304['model'];if(_0x2043c8[_0xf7d0('0x2d')]['includeAll']){_0x2cd04c[_0xf7d0('0x3f')]=[{'all':!![]}];}_0x2cd04c=_[_0xf7d0('0x3d')]({},_0x2cd04c,_0x2043c8[_0xf7d0('0x3e')]);return db[_0xf7d0('0x29')][_0xf7d0('0x44')](_0x2cd04c)[_0xf7d0('0x22')](handleEntityNotFound(_0x23bdab,null))[_0xf7d0('0x22')](respondWithResult(_0x23bdab,null))['catch'](handleError(_0x23bdab,null));};exports[_0xf7d0('0x45')]=function(_0x70d3dc,_0x3df1eb){return db['JscriptyQuestionReport'][_0xf7d0('0x45')](_0x70d3dc[_0xf7d0('0x46')],{})[_0xf7d0('0x22')](respondWithResult(_0x3df1eb,0xc9))['catch'](handleError(_0x3df1eb,null));};exports['update']=function(_0x362617,_0x2a6fc8){if(_0x362617['body']['id']){delete _0x362617[_0xf7d0('0x46')]['id'];}return db[_0xf7d0('0x29')]['find']({'where':{'id':_0x362617[_0xf7d0('0x47')]['id']}})[_0xf7d0('0x22')](handleEntityNotFound(_0x2a6fc8,null))[_0xf7d0('0x22')](saveUpdates(_0x362617[_0xf7d0('0x46')],null))['then'](respondWithResult(_0x2a6fc8,null))[_0xf7d0('0x42')](handleError(_0x2a6fc8,null));};exports[_0xf7d0('0x23')]=function(_0x19f337,_0x37c226){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x19f337[_0xf7d0('0x47')]['id']}})[_0xf7d0('0x22')](handleEntityNotFound(_0x37c226,null))[_0xf7d0('0x22')](removeEntity(_0x37c226,null))['catch'](handleError(_0x37c226,null));};exports['describe']=function(_0x436122,_0x5c8a81){return db[_0xf7d0('0x29')][_0xf7d0('0x48')]()[_0xf7d0('0x22')](respondWithResult(_0x5c8a81,null))[_0xf7d0('0x42')](handleError(_0x5c8a81,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 40c0067..3f2f2a1 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 _0xd61c=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','define','lodash'];(function(_0x4c5730,_0x2becbe){var _0x4b8a9d=function(_0x40f163){while(--_0x40f163){_0x4c5730['push'](_0x4c5730['shift']());}};_0x4b8a9d(++_0x2becbe);}(_0xd61c,0x143));var _0xcd61=function(_0x211f67,_0x47ecfc){_0x211f67=_0x211f67-0x0;var _0x320874=_0xd61c[_0x211f67];return _0x320874;};'use strict';var _=require(_0xcd61('0x0'));var util=require(_0xcd61('0x1'));var logger=require(_0xcd61('0x2'))(_0xcd61('0x3'));var moment=require(_0xcd61('0x4'));var BPromise=require(_0xcd61('0x5'));var rp=require(_0xcd61('0x6'));var fs=require('fs');var path=require(_0xcd61('0x7'));var rimraf=require(_0xcd61('0x8'));var config=require(_0xcd61('0x9'));var attributes=require(_0xcd61('0xa'));module['exports']=function(_0x574ddf,_0x4da203){return _0x574ddf[_0xcd61('0xb')]('JscriptyQuestionReport',attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x285f=['path','rimraf','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','lodash','api','moment','bluebird','request-promise'];(function(_0x1f3f77,_0x2119d4){var _0x5a3835=function(_0x4e100d){while(--_0x4e100d){_0x1f3f77['push'](_0x1f3f77['shift']());}};_0x5a3835(++_0x2119d4);}(_0x285f,0xf8));var _0xf285=function(_0x113ac9,_0x1ed8d0){_0x113ac9=_0x113ac9-0x0;var _0xe706f0=_0x285f[_0x113ac9];return _0xe706f0;};'use strict';var _=require(_0xf285('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf285('0x1'));var moment=require(_0xf285('0x2'));var BPromise=require(_0xf285('0x3'));var rp=require(_0xf285('0x4'));var fs=require('fs');var path=require(_0xf285('0x5'));var rimraf=require(_0xf285('0x6'));var config=require('../../config/environment');var attributes=require(_0xf285('0x7'));module[_0xf285('0x8')]=function(_0x4326f9,_0xb0363a){return _0x4326f9[_0xf285('0x9')]('JscriptyQuestionReport',attributes,{'tableName':_0xf285('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 6b5c21c..715c271 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 _0xa05d=['message','JscriptyQuestionReport,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2ad2a7,_0x2a3874){var _0x1d22e6=function(_0x1ca4e4){while(--_0x1ca4e4){_0x2ad2a7['push'](_0x2ad2a7['shift']());}};_0x1d22e6(++_0x2a3874);}(_0xa05d,0xac));var _0xda05=function(_0x12ce1d,_0x27dad7){_0x12ce1d=_0x12ce1d-0x0;var _0x3e987f=_0xa05d[_0x12ce1d];return _0x3e987f;};'use strict';var _=require(_0xda05('0x0'));var util=require(_0xda05('0x1'));var moment=require(_0xda05('0x2'));var BPromise=require('bluebird');var rs=require(_0xda05('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xda05('0x4'));var logger=require(_0xda05('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xda05('0x6'));var client=jayson[_0xda05('0x7')][_0xda05('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x184df2,_0x1ec1c2,_0x1eef9c){return new BPromise(function(_0x419a8c,_0x5a6428){return client[_0xda05('0x9')](_0x184df2,_0x1eef9c)[_0xda05('0xa')](function(_0x14823e){logger[_0xda05('0xb')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1ec1c2,_0xda05('0xc'));logger[_0xda05('0xd')](_0xda05('0xe'),_0x1ec1c2,_0xda05('0xc'),JSON[_0xda05('0xf')](_0x14823e));if(_0x14823e[_0xda05('0x10')]){if(_0x14823e['error']['code']===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x1ec1c2,_0x14823e[_0xda05('0x10')][_0xda05('0x11')]);return _0x5a6428(_0x14823e[_0xda05('0x10')][_0xda05('0x11')]);}logger[_0xda05('0x10')](_0xda05('0x12'),_0x1ec1c2,_0x14823e[_0xda05('0x10')][_0xda05('0x11')]);return _0x419a8c(_0x14823e[_0xda05('0x10')]['message']);}else{logger[_0xda05('0xb')](_0xda05('0x12'),_0x1ec1c2,_0xda05('0xc'));_0x419a8c(_0x14823e[_0xda05('0x13')][_0xda05('0x11')]);}})[_0xda05('0x14')](function(_0x139bbc){logger[_0xda05('0x10')](_0xda05('0x12'),_0x1ec1c2,_0x139bbc);_0x5a6428(_0x139bbc);});});} \ No newline at end of file +var _0x907b=['client','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4a93bb,_0x495404){var _0x208468=function(_0x1d82b7){while(--_0x1d82b7){_0x4a93bb['push'](_0x4a93bb['shift']());}};_0x208468(++_0x495404);}(_0x907b,0x116));var _0xb907=function(_0x2d982d,_0x121028){_0x2d982d=_0x2d982d-0x0;var _0x4f36b0=_0x907b[_0x2d982d];return _0x4f36b0;};'use strict';var _=require(_0xb907('0x0'));var util=require(_0xb907('0x1'));var moment=require(_0xb907('0x2'));var BPromise=require(_0xb907('0x3'));var rs=require(_0xb907('0x4'));var fs=require('fs');var Redis=require(_0xb907('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb907('0x6'))(_0xb907('0x7'));var config=require(_0xb907('0x8'));var jayson=require(_0xb907('0x9'));var client=jayson[_0xb907('0xa')][_0xb907('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2fd97f,_0x37b9be,_0x1ed67b){return new BPromise(function(_0x2d11ce,_0x5ccd9f){return client['request'](_0x2fd97f,_0x1ed67b)[_0xb907('0xc')](function(_0x4e45b6){logger[_0xb907('0xd')](_0xb907('0xe'),_0x37b9be,'request\x20sent');logger[_0xb907('0xf')](_0xb907('0x10'),_0x37b9be,_0xb907('0x11'),JSON[_0xb907('0x12')](_0x4e45b6));if(_0x4e45b6[_0xb907('0x13')]){if(_0x4e45b6['error'][_0xb907('0x14')]===0x1f4){logger[_0xb907('0x13')](_0xb907('0xe'),_0x37b9be,_0x4e45b6[_0xb907('0x13')][_0xb907('0x15')]);return _0x5ccd9f(_0x4e45b6[_0xb907('0x13')]['message']);}logger['error'](_0xb907('0xe'),_0x37b9be,_0x4e45b6[_0xb907('0x13')][_0xb907('0x15')]);return _0x2d11ce(_0x4e45b6[_0xb907('0x13')]['message']);}else{logger[_0xb907('0xd')](_0xb907('0xe'),_0x37b9be,'request\x20sent');_0x2d11ce(_0x4e45b6[_0xb907('0x16')][_0xb907('0x15')]);}})[_0xb907('0x17')](function(_0xa86545){logger[_0xb907('0x13')](_0xb907('0xe'),_0x37b9be,_0xa86545);_0x5ccd9f(_0xa86545);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 0f00a29..85a1798 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 _0x9d92=['describe','/:id','show','post','create','update','delete','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe'];(function(_0x4ae3be,_0x40b92d){var _0x52e919=function(_0x10a813){while(--_0x10a813){_0x4ae3be['push'](_0x4ae3be['shift']());}};_0x52e919(++_0x40b92d);}(_0x9d92,0xdf));var _0x29d9=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0x9d92[_0xbeb808];return _0x5d6909;};'use strict';var multer=require(_0x29d9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x29d9('0x1'));var express=require(_0x29d9('0x2'));var router=express['Router']();var auth=require(_0x29d9('0x3'));var interaction=require(_0x29d9('0x4'));var config=require(_0x29d9('0x5'));var controller=require(_0x29d9('0x6'));router[_0x29d9('0x7')]('/',auth[_0x29d9('0x8')](),controller[_0x29d9('0x9')]);router['get'](_0x29d9('0xa'),auth[_0x29d9('0x8')](),controller[_0x29d9('0xb')]);router['get'](_0x29d9('0xc'),auth[_0x29d9('0x8')](),controller[_0x29d9('0xd')]);router['get']('/:id/questions',auth['isAuthenticated'](),controller['getQuestions']);router[_0x29d9('0xe')]('/',auth[_0x29d9('0x8')](),controller[_0x29d9('0xf')]);router['put'](_0x29d9('0xc'),auth[_0x29d9('0x8')](),controller[_0x29d9('0x10')]);router[_0x29d9('0x11')]('/:id',auth[_0x29d9('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf874=['../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','show','/:id/questions','getQuestions','post','create','put','update','delete','/:id','exports','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xf874,0xed));var _0x4f87=function(_0x937a74,_0x14abd9){_0x937a74=_0x937a74-0x0;var _0x2da0f6=_0xf874[_0x937a74];return _0x2da0f6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4f87('0x0'));var timeout=require(_0x4f87('0x1'));var express=require(_0x4f87('0x2'));var router=express[_0x4f87('0x3')]();var auth=require(_0x4f87('0x4'));var interaction=require(_0x4f87('0x5'));var config=require('../../config/environment');var controller=require(_0x4f87('0x6'));router[_0x4f87('0x7')]('/',auth[_0x4f87('0x8')](),controller[_0x4f87('0x9')]);router[_0x4f87('0x7')](_0x4f87('0xa'),auth['isAuthenticated'](),controller[_0x4f87('0xb')]);router[_0x4f87('0x7')]('/:id',auth[_0x4f87('0x8')](),controller[_0x4f87('0xc')]);router['get'](_0x4f87('0xd'),auth[_0x4f87('0x8')](),controller[_0x4f87('0xe')]);router[_0x4f87('0xf')]('/',auth[_0x4f87('0x8')](),controller[_0x4f87('0x10')]);router[_0x4f87('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x4f87('0x12')]);router[_0x4f87('0x13')](_0x4f87('0x14'),auth['isAuthenticated'](),controller['destroy']);module[_0x4f87('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 7a904c5..d10c74b 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 _0x81e1=['setDataValue','endtime','format','STRING','BOOLEAN','moment','sequelize','DATE','starttime'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x81e1,0x1be));var _0x181e=function(_0x5d397e,_0x92b885){_0x5d397e=_0x5d397e-0x0;var _0x36fca8=_0x81e1[_0x5d397e];return _0x36fca8;};'use strict';var moment=require(_0x181e('0x0'));var Sequelize=require(_0x181e('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x181e('0x2')],'set':function(_0x55b3ea){this['setDataValue'](_0x181e('0x3'),_0x55b3ea);this[_0x181e('0x4')](_0x181e('0x5'),moment()[_0x181e('0x6')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x181e('0x2')]},'membername':{'type':Sequelize[_0x181e('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x181e('0x7')]},'calleridname':{'type':Sequelize[_0x181e('0x7')]},'calleridnum':{'type':Sequelize[_0x181e('0x7')]},'completed':{'type':Sequelize[_0x181e('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0xdbc9=['STRING','BOOLEAN','moment','sequelize','exports','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x49ab17,_0x3937ee){var _0x11334a=function(_0x172c32){while(--_0x172c32){_0x49ab17['push'](_0x49ab17['shift']());}};_0x11334a(++_0x3937ee);}(_0xdbc9,0x10a));var _0x9dbc=function(_0x262d56,_0x47dc7b){_0x262d56=_0x262d56-0x0;var _0x4363c9=_0xdbc9[_0x262d56];return _0x4363c9;};'use strict';var moment=require(_0x9dbc('0x0'));var Sequelize=require(_0x9dbc('0x1'));module[_0x9dbc('0x2')]={'starttime':{'type':Sequelize[_0x9dbc('0x3')],'set':function(_0x223000){this[_0x9dbc('0x4')](_0x9dbc('0x5'),_0x223000);this[_0x9dbc('0x4')](_0x9dbc('0x6'),moment()[_0x9dbc('0x7')](_0x9dbc('0x8')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x9dbc('0x9')]},'projectname':{'type':Sequelize[_0x9dbc('0x9')]},'queue':{'type':Sequelize[_0x9dbc('0x9')]},'uniqueid':{'type':Sequelize[_0x9dbc('0x9')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x9dbc('0x9')]},'completed':{'type':Sequelize[_0x9dbc('0xa')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index dd9809c..8927ed9 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 _0xd9cf=['key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','find','create','body','catch','describe','getQuestions','findOne','params','order','SessionId','JscriptyQuestionReport','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xd9cf,0x177));var _0xfd9c=function(_0x31553e,_0x43fc0d){_0x31553e=_0x31553e-0x0;var _0x265759=_0xd9cf[_0x31553e];return _0x265759;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xfd9c('0x0'));var zipdir=require(_0xfd9c('0x1'));var jsonpatch=require(_0xfd9c('0x2'));var rp=require(_0xfd9c('0x3'));var moment=require(_0xfd9c('0x4'));var BPromise=require(_0xfd9c('0x5'));var Mustache=require(_0xfd9c('0x6'));var util=require(_0xfd9c('0x7'));var path=require(_0xfd9c('0x8'));var sox=require(_0xfd9c('0x9'));var csv=require(_0xfd9c('0xa'));var ejs=require(_0xfd9c('0xb'));var fs=require('fs');var _=require(_0xfd9c('0xc'));var squel=require(_0xfd9c('0xd'));var crypto=require(_0xfd9c('0xe'));var jsforce=require(_0xfd9c('0xf'));var deskjs=require(_0xfd9c('0x10'));var toCsv=require(_0xfd9c('0xa'));var querystring=require(_0xfd9c('0x11'));var Papa=require(_0xfd9c('0x12'));var Redis=require(_0xfd9c('0x13'));var authService=require(_0xfd9c('0x14'));var qs=require(_0xfd9c('0x15'));var as=require(_0xfd9c('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfd9c('0x17'));var utils=require(_0xfd9c('0x18'));var config=require('../../config/environment');var db=require(_0xfd9c('0x19'))['db'];function respondWithStatusCode(_0x193dae,_0x2349df){_0x2349df=_0x2349df||0xcc;return function(_0x55743f){if(_0x55743f){return _0x193dae['sendStatus'](_0x2349df);}return _0x193dae['status'](_0x2349df)[_0xfd9c('0x1a')]();};}function respondWithResult(_0x49cc7b,_0x58b0c1){_0x58b0c1=_0x58b0c1||0xc8;return function(_0x3b3871){if(_0x3b3871){return _0x49cc7b[_0xfd9c('0x1b')](_0x58b0c1)[_0xfd9c('0x1c')](_0x3b3871);}};}function respondWithFilteredResult(_0x439925,_0x4fca91){return function(_0x53f032){if(_0x53f032){var _0x2ced03=_0x53f032[_0xfd9c('0x1d')],_0x11b846=_0x4fca91[_0xfd9c('0x1e')],_0xeba69b=_0x4fca91[_0xfd9c('0x1e')]+_0x4fca91[_0xfd9c('0x1f')],_0x64d8b2;if(_0xeba69b>=_0x2ced03){_0xeba69b=_0x2ced03;_0x64d8b2=0xc8;}else{_0x64d8b2=0xce;}_0x439925['status'](_0x64d8b2);return _0x439925[_0xfd9c('0x20')](_0xfd9c('0x21'),_0x11b846+'-'+_0xeba69b+'/'+_0x2ced03)[_0xfd9c('0x1c')](_0x53f032);}return null;};}function patchUpdates(_0x5558ec){return function(_0x3d043a){try{jsonpatch[_0xfd9c('0x22')](_0x3d043a,_0x5558ec,!![]);}catch(_0x21a5d5){return BPromise[_0xfd9c('0x23')](_0x21a5d5);}return _0x3d043a[_0xfd9c('0x24')]();};}function saveUpdates(_0x539fbe,_0x18d161){return function(_0x116b20){if(_0x116b20){return _0x116b20[_0xfd9c('0x25')](_0x539fbe)[_0xfd9c('0x26')](function(_0x458204){return _0x458204;});}return null;};}function removeEntity(_0x1e353c,_0x8a3df2){return function(_0x56552d){if(_0x56552d){return _0x56552d[_0xfd9c('0x27')]()[_0xfd9c('0x26')](function(){_0x1e353c[_0xfd9c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d625b,_0x21fcb6){return function(_0x4c7eb1){if(!_0x4c7eb1){_0x5d625b[_0xfd9c('0x28')](0x194);}return _0x4c7eb1;};}function handleError(_0x4ca16c,_0x5279d0){_0x5279d0=_0x5279d0||0x1f4;return function(_0x2809ff){logger[_0xfd9c('0x29')](_0x2809ff[_0xfd9c('0x2a')]);if(_0x2809ff[_0xfd9c('0x2b')]){delete _0x2809ff[_0xfd9c('0x2b')];}_0x4ca16c[_0xfd9c('0x1b')](_0x5279d0)[_0xfd9c('0x2c')](_0x2809ff);};}exports[_0xfd9c('0x2d')]=function(_0x74d99b,_0x11902f){var _0x58eddf={},_0x50795f={},_0x567e25={'count':0x0,'rows':[]};var _0x2e9542=_[_0xfd9c('0x2e')](db[_0xfd9c('0x2f')][_0xfd9c('0x30')],function(_0x127002){return{'name':_0x127002[_0xfd9c('0x31')],'type':_0x127002['type'][_0xfd9c('0x32')]};});_0x50795f[_0xfd9c('0x33')]=_[_0xfd9c('0x2e')](_0x2e9542,_0xfd9c('0x2b'));_0x50795f[_0xfd9c('0x34')]=_[_0xfd9c('0x35')](_0x74d99b[_0xfd9c('0x34')]);_0x50795f['filters']=_[_0xfd9c('0x36')](_0x50795f[_0xfd9c('0x33')],_0x50795f[_0xfd9c('0x34')]);_0x58eddf['attributes']=_['intersection'](_0x50795f[_0xfd9c('0x33')],qs[_0xfd9c('0x37')](_0x74d99b[_0xfd9c('0x34')][_0xfd9c('0x37')]));_0x58eddf[_0xfd9c('0x38')]=_0x58eddf[_0xfd9c('0x38')][_0xfd9c('0x39')]?_0x58eddf[_0xfd9c('0x38')]:_0x50795f[_0xfd9c('0x33')];if(!_0x74d99b[_0xfd9c('0x34')][_0xfd9c('0x3a')](_0xfd9c('0x3b'))){_0x58eddf[_0xfd9c('0x1f')]=qs[_0xfd9c('0x1f')](_0x74d99b['query'][_0xfd9c('0x1f')]);_0x58eddf[_0xfd9c('0x1e')]=qs[_0xfd9c('0x1e')](_0x74d99b[_0xfd9c('0x34')][_0xfd9c('0x1e')]);}_0x58eddf['order']=qs[_0xfd9c('0x3c')](_0x74d99b[_0xfd9c('0x34')][_0xfd9c('0x3c')]);_0x58eddf[_0xfd9c('0x3d')]=qs[_0xfd9c('0x3e')](_[_0xfd9c('0x3f')](_0x74d99b[_0xfd9c('0x34')],_0x50795f[_0xfd9c('0x3e')]));if(_0x74d99b[_0xfd9c('0x34')]['filter']){_0x58eddf[_0xfd9c('0x3d')]=_['merge'](_0x58eddf[_0xfd9c('0x3d')],{'$or':_[_0xfd9c('0x2e')](_0x2e9542,function(_0xa621ed){if(_0xa621ed[_0xfd9c('0x40')]!==_0xfd9c('0x41')){var _0x46bff1={};_0x46bff1[_0xa621ed[_0xfd9c('0x2b')]]={'$like':'%'+_0x74d99b[_0xfd9c('0x34')][_0xfd9c('0x42')]+'%'};return _0x46bff1;}})});}_0x58eddf=_[_0xfd9c('0x43')]({},_0x58eddf,_0x74d99b[_0xfd9c('0x44')]);var _0x5116f5={'where':_0x58eddf[_0xfd9c('0x3d')]};return db['JscriptySessionReport'][_0xfd9c('0x1d')](_0x5116f5)[_0xfd9c('0x26')](function(_0x2535c5){_0x567e25[_0xfd9c('0x1d')]=_0x2535c5;if(_0x74d99b[_0xfd9c('0x34')][_0xfd9c('0x45')]){_0x58eddf[_0xfd9c('0x46')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xfd9c('0x47')](_0x58eddf);})['then'](function(_0x274021){_0x567e25[_0xfd9c('0x48')]=_0x274021;return _0x567e25;})[_0xfd9c('0x26')](respondWithFilteredResult(_0x11902f,_0x58eddf))['catch'](handleError(_0x11902f,null));};exports[_0xfd9c('0x49')]=function(_0x47cc30,_0x891796){var _0x1cc1e4={'raw':!![],'where':{'id':_0x47cc30['params']['id']}},_0x40b237={};_0x40b237['model']=_[_0xfd9c('0x35')](db['JscriptySessionReport']['rawAttributes']);_0x40b237[_0xfd9c('0x34')]=_['keys'](_0x47cc30['query']);_0x40b237[_0xfd9c('0x3e')]=_[_0xfd9c('0x36')](_0x40b237[_0xfd9c('0x33')],_0x40b237[_0xfd9c('0x34')]);_0x1cc1e4[_0xfd9c('0x38')]=_[_0xfd9c('0x36')](_0x40b237[_0xfd9c('0x33')],qs[_0xfd9c('0x37')](_0x47cc30['query']['fields']));_0x1cc1e4['attributes']=_0x1cc1e4[_0xfd9c('0x38')][_0xfd9c('0x39')]?_0x1cc1e4[_0xfd9c('0x38')]:_0x40b237[_0xfd9c('0x33')];if(_0x47cc30['query'][_0xfd9c('0x45')]){_0x1cc1e4['include']=[{'all':!![]}];}_0x1cc1e4=_[_0xfd9c('0x43')]({},_0x1cc1e4,_0x47cc30['options']);return db[_0xfd9c('0x2f')][_0xfd9c('0x4a')](_0x1cc1e4)[_0xfd9c('0x26')](handleEntityNotFound(_0x891796,null))[_0xfd9c('0x26')](respondWithResult(_0x891796,null))['catch'](handleError(_0x891796,null));};exports['create']=function(_0x395da3,_0x1ff5df){return db[_0xfd9c('0x2f')][_0xfd9c('0x4b')](_0x395da3['body'],{})['then'](respondWithResult(_0x1ff5df,0xc9))['catch'](handleError(_0x1ff5df,null));};exports['update']=function(_0xba4768,_0x524ca8){if(_0xba4768[_0xfd9c('0x4c')]['id']){delete _0xba4768[_0xfd9c('0x4c')]['id'];}return db[_0xfd9c('0x2f')]['find']({'where':{'id':_0xba4768['params']['id']}})[_0xfd9c('0x26')](handleEntityNotFound(_0x524ca8,null))['then'](saveUpdates(_0xba4768[_0xfd9c('0x4c')],null))[_0xfd9c('0x26')](respondWithResult(_0x524ca8,null))[_0xfd9c('0x4d')](handleError(_0x524ca8,null));};exports[_0xfd9c('0x27')]=function(_0xce08d8,_0x5242b4){return db[_0xfd9c('0x2f')][_0xfd9c('0x4a')]({'where':{'id':_0xce08d8['params']['id']}})[_0xfd9c('0x26')](handleEntityNotFound(_0x5242b4,null))[_0xfd9c('0x26')](removeEntity(_0x5242b4,null))[_0xfd9c('0x4d')](handleError(_0x5242b4,null));};exports[_0xfd9c('0x4e')]=function(_0x193bd3,_0x3ac643){return db[_0xfd9c('0x2f')][_0xfd9c('0x4e')]()[_0xfd9c('0x26')](respondWithResult(_0x3ac643,null))[_0xfd9c('0x4d')](handleError(_0x3ac643,null));};exports[_0xfd9c('0x4f')]=function(_0x3df547,_0x473a63,_0x230456){var _0x1b5b7e={'raw':!![],'where':{}};var _0x5d137f={};var _0x1a8b2b={'count':0x0,'rows':[]};return db[_0xfd9c('0x2f')][_0xfd9c('0x50')]({'where':{'id':_0x3df547[_0xfd9c('0x51')]['id']}})[_0xfd9c('0x26')](handleEntityNotFound(_0x473a63,null))['then'](function(_0x333214){if(_0x333214){_0x5d137f['model']=_['keys'](db['JscriptyQuestionReport'][_0xfd9c('0x30')]);_0x5d137f[_0xfd9c('0x34')]=_[_0xfd9c('0x35')](_0x3df547[_0xfd9c('0x34')]);_0x5d137f[_0xfd9c('0x3e')]=_[_0xfd9c('0x36')](_0x5d137f[_0xfd9c('0x33')],_0x5d137f[_0xfd9c('0x34')]);_0x1b5b7e[_0xfd9c('0x38')]=_[_0xfd9c('0x36')](_0x5d137f[_0xfd9c('0x33')],qs[_0xfd9c('0x37')](_0x3df547[_0xfd9c('0x34')][_0xfd9c('0x37')]));_0x1b5b7e[_0xfd9c('0x38')]=_0x1b5b7e['attributes'][_0xfd9c('0x39')]?_0x1b5b7e[_0xfd9c('0x38')]:_0x5d137f[_0xfd9c('0x33')];if(!_0x3df547[_0xfd9c('0x34')][_0xfd9c('0x3a')](_0xfd9c('0x3b'))){_0x1b5b7e[_0xfd9c('0x1f')]=qs['limit'](_0x3df547[_0xfd9c('0x34')][_0xfd9c('0x1f')]);_0x1b5b7e['offset']=qs[_0xfd9c('0x1e')](_0x3df547[_0xfd9c('0x34')][_0xfd9c('0x1e')]);}_0x1b5b7e[_0xfd9c('0x52')]=qs['sort'](_0x3df547[_0xfd9c('0x34')][_0xfd9c('0x3c')]);_0x1b5b7e[_0xfd9c('0x3d')]=qs[_0xfd9c('0x3e')](_[_0xfd9c('0x3f')](_0x3df547['query'],_0x5d137f[_0xfd9c('0x3e')]));_0x1b5b7e[_0xfd9c('0x3d')][_0xfd9c('0x53')]=_0x333214['id'];if(_0x3df547[_0xfd9c('0x34')]['filter']){_0x1b5b7e['where']=_['merge'](_0x1b5b7e[_0xfd9c('0x3d')],{'$or':_[_0xfd9c('0x2e')](_0x1b5b7e[_0xfd9c('0x38')],function(_0x240a17){var _0x49f34d={};_0x49f34d[_0x240a17]={'$like':'%'+_0x3df547[_0xfd9c('0x34')][_0xfd9c('0x42')]+'%'};return _0x49f34d;})});}_0x1b5b7e=_[_0xfd9c('0x43')]({},_0x1b5b7e,_0x3df547[_0xfd9c('0x44')]);return db[_0xfd9c('0x54')]['count']({'where':_0x1b5b7e['where']})[_0xfd9c('0x26')](function(_0xfdaaf8){_0x1a8b2b[_0xfd9c('0x1d')]=_0xfdaaf8;if(_0x3df547[_0xfd9c('0x34')][_0xfd9c('0x45')]){_0x1b5b7e[_0xfd9c('0x46')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xfd9c('0x47')](_0x1b5b7e);})[_0xfd9c('0x26')](function(_0xb48c53){_0x1a8b2b[_0xfd9c('0x48')]=_0xb48c53;return _0x1a8b2b;});}})['then'](respondWithFilteredResult(_0x473a63,_0x1b5b7e))[_0xfd9c('0x4d')](handleError(_0x473a63,null));}; \ No newline at end of file +var _0x48df=['JscriptyQuestionReport','nolimit','options','rows','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','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','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','then','destroy','error','stack','name','fieldName','type','key','model','map','keys','filters','attributes','intersection','length','hasOwnProperty','query','order','sort','where','pick','filter','merge','VIRTUAL','JscriptySessionReport','count','includeAll','include','findAll','catch','params','rawAttributes','fields','find','body','update','describe','getQuestions','findOne'];(function(_0xd553ab,_0x788918){var _0x215442=function(_0x5b32f8){while(--_0x5b32f8){_0xd553ab['push'](_0xd553ab['shift']());}};_0x215442(++_0x788918);}(_0x48df,0x185));var _0xf48d=function(_0x35007a,_0x58a0d4){_0x35007a=_0x35007a-0x0;var _0x574f68=_0x48df[_0x35007a];return _0x574f68;};'use strict';var pdf=require(_0xf48d('0x0'));var emlformat=require(_0xf48d('0x1'));var rimraf=require(_0xf48d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf48d('0x3'));var rp=require(_0xf48d('0x4'));var moment=require('moment');var BPromise=require(_0xf48d('0x5'));var Mustache=require('mustache');var util=require(_0xf48d('0x6'));var path=require(_0xf48d('0x7'));var sox=require('sox');var csv=require(_0xf48d('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf48d('0x9'));var squel=require(_0xf48d('0xa'));var crypto=require(_0xf48d('0xb'));var jsforce=require(_0xf48d('0xc'));var deskjs=require(_0xf48d('0xd'));var toCsv=require(_0xf48d('0x8'));var querystring=require(_0xf48d('0xe'));var Papa=require(_0xf48d('0xf'));var Redis=require(_0xf48d('0x10'));var authService=require(_0xf48d('0x11'));var qs=require(_0xf48d('0x12'));var as=require(_0xf48d('0x13'));var hardwareService=require(_0xf48d('0x14'));var logger=require(_0xf48d('0x15'))(_0xf48d('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf48d('0x17'))['db'];function respondWithStatusCode(_0xf115b3,_0x584fad){_0x584fad=_0x584fad||0xcc;return function(_0x313adb){if(_0x313adb){return _0xf115b3[_0xf48d('0x18')](_0x584fad);}return _0xf115b3[_0xf48d('0x19')](_0x584fad)[_0xf48d('0x1a')]();};}function respondWithResult(_0xd9a0b4,_0x72a136){_0x72a136=_0x72a136||0xc8;return function(_0x4d299a){if(_0x4d299a){return _0xd9a0b4['status'](_0x72a136)['json'](_0x4d299a);}};}function respondWithFilteredResult(_0xba51cd,_0x5e40ca){return function(_0x5d71f2){if(_0x5d71f2){var _0x1b4883=_0x5d71f2['count'],_0x19e136=_0x5e40ca[_0xf48d('0x1b')],_0x50630f=_0x5e40ca[_0xf48d('0x1b')]+_0x5e40ca[_0xf48d('0x1c')],_0x374e26;if(_0x50630f>=_0x1b4883){_0x50630f=_0x1b4883;_0x374e26=0xc8;}else{_0x374e26=0xce;}_0xba51cd[_0xf48d('0x19')](_0x374e26);return _0xba51cd[_0xf48d('0x1d')](_0xf48d('0x1e'),_0x19e136+'-'+_0x50630f+'/'+_0x1b4883)[_0xf48d('0x1f')](_0x5d71f2);}return null;};}function patchUpdates(_0x59475f){return function(_0x2ac0c4){try{jsonpatch[_0xf48d('0x20')](_0x2ac0c4,_0x59475f,!![]);}catch(_0x1f376a){return BPromise[_0xf48d('0x21')](_0x1f376a);}return _0x2ac0c4['save']();};}function saveUpdates(_0x518021,_0x140c80){return function(_0x5f1a66){if(_0x5f1a66){return _0x5f1a66['update'](_0x518021)[_0xf48d('0x22')](function(_0x567210){return _0x567210;});}return null;};}function removeEntity(_0x11555f,_0x52ef90){return function(_0x2e10b1){if(_0x2e10b1){return _0x2e10b1[_0xf48d('0x23')]()[_0xf48d('0x22')](function(){_0x11555f['status'](0xcc)[_0xf48d('0x1a')]();});}};}function handleEntityNotFound(_0x7c7171,_0x3f4d34){return function(_0x4527b3){if(!_0x4527b3){_0x7c7171[_0xf48d('0x18')](0x194);}return _0x4527b3;};}function handleError(_0x3f9464,_0x292398){_0x292398=_0x292398||0x1f4;return function(_0x288e26){logger[_0xf48d('0x24')](_0x288e26[_0xf48d('0x25')]);if(_0x288e26[_0xf48d('0x26')]){delete _0x288e26['name'];}_0x3f9464[_0xf48d('0x19')](_0x292398)['send'](_0x288e26);};}exports['index']=function(_0x54ef7b,_0x10a10a){var _0x58f1d1={},_0x44a623={},_0x3b06bc={'count':0x0,'rows':[]};var _0x4a1bb7=_['map'](db['JscriptySessionReport']['rawAttributes'],function(_0x1212af){return{'name':_0x1212af[_0xf48d('0x27')],'type':_0x1212af[_0xf48d('0x28')][_0xf48d('0x29')]};});_0x44a623[_0xf48d('0x2a')]=_[_0xf48d('0x2b')](_0x4a1bb7,'name');_0x44a623['query']=_[_0xf48d('0x2c')](_0x54ef7b['query']);_0x44a623[_0xf48d('0x2d')]=_['intersection'](_0x44a623['model'],_0x44a623['query']);_0x58f1d1[_0xf48d('0x2e')]=_[_0xf48d('0x2f')](_0x44a623[_0xf48d('0x2a')],qs['fields'](_0x54ef7b['query']['fields']));_0x58f1d1[_0xf48d('0x2e')]=_0x58f1d1[_0xf48d('0x2e')][_0xf48d('0x30')]?_0x58f1d1['attributes']:_0x44a623[_0xf48d('0x2a')];if(!_0x54ef7b['query'][_0xf48d('0x31')]('nolimit')){_0x58f1d1['limit']=qs['limit'](_0x54ef7b['query'][_0xf48d('0x1c')]);_0x58f1d1['offset']=qs['offset'](_0x54ef7b[_0xf48d('0x32')][_0xf48d('0x1b')]);}_0x58f1d1[_0xf48d('0x33')]=qs[_0xf48d('0x34')](_0x54ef7b['query']['sort']);_0x58f1d1[_0xf48d('0x35')]=qs['filters'](_[_0xf48d('0x36')](_0x54ef7b[_0xf48d('0x32')],_0x44a623[_0xf48d('0x2d')]));if(_0x54ef7b[_0xf48d('0x32')][_0xf48d('0x37')]){_0x58f1d1['where']=_[_0xf48d('0x38')](_0x58f1d1[_0xf48d('0x35')],{'$or':_[_0xf48d('0x2b')](_0x4a1bb7,function(_0xd81952){if(_0xd81952[_0xf48d('0x28')]!==_0xf48d('0x39')){var _0x1bd93a={};_0x1bd93a[_0xd81952['name']]={'$like':'%'+_0x54ef7b[_0xf48d('0x32')][_0xf48d('0x37')]+'%'};return _0x1bd93a;}})});}_0x58f1d1=_['merge']({},_0x58f1d1,_0x54ef7b['options']);var _0x3e1a6f={'where':_0x58f1d1['where']};return db[_0xf48d('0x3a')][_0xf48d('0x3b')](_0x3e1a6f)[_0xf48d('0x22')](function(_0x35b230){_0x3b06bc['count']=_0x35b230;if(_0x54ef7b[_0xf48d('0x32')][_0xf48d('0x3c')]){_0x58f1d1[_0xf48d('0x3d')]=[{'all':!![]}];}return db[_0xf48d('0x3a')][_0xf48d('0x3e')](_0x58f1d1);})[_0xf48d('0x22')](function(_0x461e7b){_0x3b06bc['rows']=_0x461e7b;return _0x3b06bc;})['then'](respondWithFilteredResult(_0x10a10a,_0x58f1d1))[_0xf48d('0x3f')](handleError(_0x10a10a,null));};exports['show']=function(_0x2625be,_0x58f506){var _0x645255={'raw':!![],'where':{'id':_0x2625be[_0xf48d('0x40')]['id']}},_0x233157={};_0x233157['model']=_[_0xf48d('0x2c')](db['JscriptySessionReport'][_0xf48d('0x41')]);_0x233157[_0xf48d('0x32')]=_[_0xf48d('0x2c')](_0x2625be[_0xf48d('0x32')]);_0x233157[_0xf48d('0x2d')]=_['intersection'](_0x233157[_0xf48d('0x2a')],_0x233157['query']);_0x645255[_0xf48d('0x2e')]=_[_0xf48d('0x2f')](_0x233157['model'],qs[_0xf48d('0x42')](_0x2625be[_0xf48d('0x32')][_0xf48d('0x42')]));_0x645255[_0xf48d('0x2e')]=_0x645255[_0xf48d('0x2e')][_0xf48d('0x30')]?_0x645255[_0xf48d('0x2e')]:_0x233157[_0xf48d('0x2a')];if(_0x2625be[_0xf48d('0x32')][_0xf48d('0x3c')]){_0x645255[_0xf48d('0x3d')]=[{'all':!![]}];}_0x645255=_['merge']({},_0x645255,_0x2625be['options']);return db['JscriptySessionReport'][_0xf48d('0x43')](_0x645255)[_0xf48d('0x22')](handleEntityNotFound(_0x58f506,null))[_0xf48d('0x22')](respondWithResult(_0x58f506,null))[_0xf48d('0x3f')](handleError(_0x58f506,null));};exports['create']=function(_0x3687c2,_0x212c77){return db[_0xf48d('0x3a')]['create'](_0x3687c2[_0xf48d('0x44')],{})[_0xf48d('0x22')](respondWithResult(_0x212c77,0xc9))[_0xf48d('0x3f')](handleError(_0x212c77,null));};exports[_0xf48d('0x45')]=function(_0x255141,_0x506666){if(_0x255141[_0xf48d('0x44')]['id']){delete _0x255141['body']['id'];}return db['JscriptySessionReport'][_0xf48d('0x43')]({'where':{'id':_0x255141[_0xf48d('0x40')]['id']}})['then'](handleEntityNotFound(_0x506666,null))[_0xf48d('0x22')](saveUpdates(_0x255141[_0xf48d('0x44')],null))[_0xf48d('0x22')](respondWithResult(_0x506666,null))[_0xf48d('0x3f')](handleError(_0x506666,null));};exports['destroy']=function(_0x1209a3,_0x789a45){return db[_0xf48d('0x3a')]['find']({'where':{'id':_0x1209a3['params']['id']}})[_0xf48d('0x22')](handleEntityNotFound(_0x789a45,null))[_0xf48d('0x22')](removeEntity(_0x789a45,null))[_0xf48d('0x3f')](handleError(_0x789a45,null));};exports[_0xf48d('0x46')]=function(_0x2a96af,_0x4a3283){return db[_0xf48d('0x3a')]['describe']()[_0xf48d('0x22')](respondWithResult(_0x4a3283,null))[_0xf48d('0x3f')](handleError(_0x4a3283,null));};exports[_0xf48d('0x47')]=function(_0x5289b6,_0x216eee,_0x43c429){var _0x10e40a={'raw':!![],'where':{}};var _0x7c40f2={};var _0x18feba={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xf48d('0x48')]({'where':{'id':_0x5289b6[_0xf48d('0x40')]['id']}})[_0xf48d('0x22')](handleEntityNotFound(_0x216eee,null))[_0xf48d('0x22')](function(_0xf5e166){if(_0xf5e166){_0x7c40f2['model']=_['keys'](db[_0xf48d('0x49')][_0xf48d('0x41')]);_0x7c40f2[_0xf48d('0x32')]=_['keys'](_0x5289b6['query']);_0x7c40f2[_0xf48d('0x2d')]=_[_0xf48d('0x2f')](_0x7c40f2[_0xf48d('0x2a')],_0x7c40f2['query']);_0x10e40a[_0xf48d('0x2e')]=_[_0xf48d('0x2f')](_0x7c40f2['model'],qs[_0xf48d('0x42')](_0x5289b6[_0xf48d('0x32')][_0xf48d('0x42')]));_0x10e40a['attributes']=_0x10e40a[_0xf48d('0x2e')][_0xf48d('0x30')]?_0x10e40a[_0xf48d('0x2e')]:_0x7c40f2[_0xf48d('0x2a')];if(!_0x5289b6['query'][_0xf48d('0x31')](_0xf48d('0x4a'))){_0x10e40a[_0xf48d('0x1c')]=qs[_0xf48d('0x1c')](_0x5289b6[_0xf48d('0x32')][_0xf48d('0x1c')]);_0x10e40a[_0xf48d('0x1b')]=qs[_0xf48d('0x1b')](_0x5289b6[_0xf48d('0x32')][_0xf48d('0x1b')]);}_0x10e40a[_0xf48d('0x33')]=qs['sort'](_0x5289b6[_0xf48d('0x32')][_0xf48d('0x34')]);_0x10e40a[_0xf48d('0x35')]=qs[_0xf48d('0x2d')](_[_0xf48d('0x36')](_0x5289b6[_0xf48d('0x32')],_0x7c40f2[_0xf48d('0x2d')]));_0x10e40a[_0xf48d('0x35')]['SessionId']=_0xf5e166['id'];if(_0x5289b6[_0xf48d('0x32')][_0xf48d('0x37')]){_0x10e40a[_0xf48d('0x35')]=_[_0xf48d('0x38')](_0x10e40a[_0xf48d('0x35')],{'$or':_[_0xf48d('0x2b')](_0x10e40a[_0xf48d('0x2e')],function(_0x4b02c1){var _0x2862d7={};_0x2862d7[_0x4b02c1]={'$like':'%'+_0x5289b6[_0xf48d('0x32')]['filter']+'%'};return _0x2862d7;})});}_0x10e40a=_[_0xf48d('0x38')]({},_0x10e40a,_0x5289b6[_0xf48d('0x4b')]);return db['JscriptyQuestionReport']['count']({'where':_0x10e40a[_0xf48d('0x35')]})[_0xf48d('0x22')](function(_0x152d0e){_0x18feba['count']=_0x152d0e;if(_0x5289b6[_0xf48d('0x32')]['includeAll']){_0x10e40a[_0xf48d('0x3d')]=[{'all':!![]}];}return db[_0xf48d('0x49')][_0xf48d('0x3e')](_0x10e40a);})[_0xf48d('0x22')](function(_0x541e84){_0x18feba[_0xf48d('0x4c')]=_0x541e84;return _0x18feba;});}})[_0xf48d('0x22')](respondWithFilteredResult(_0x216eee,_0x10e40a))[_0xf48d('0x3f')](handleError(_0x216eee,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index b4a052c..adffbfe 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 _0x6a06=['exports','JscriptySessionReport','lodash','util','api','request-promise','../../config/environment','./jscriptySessionReport.attributes'];(function(_0x2808d9,_0x2dd004){var _0x47a0d6=function(_0x2af595){while(--_0x2af595){_0x2808d9['push'](_0x2808d9['shift']());}};_0x47a0d6(++_0x2dd004);}(_0x6a06,0x6a));var _0x66a0=function(_0x1b6563,_0x3bf0f1){_0x1b6563=_0x1b6563-0x0;var _0xdea7b8=_0x6a06[_0x1b6563];return _0xdea7b8;};'use strict';var _=require(_0x66a0('0x0'));var util=require(_0x66a0('0x1'));var logger=require('../../config/logger')(_0x66a0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x66a0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x66a0('0x4'));var attributes=require(_0x66a0('0x5'));module[_0x66a0('0x6')]=function(_0x11adf1,_0x8a87a9){return _0x11adf1['define'](_0x66a0('0x7'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea22=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','report_jscripty_sessions','lodash','util'];(function(_0x3e94a8,_0x3835dd){var _0x25e19b=function(_0x22b3bd){while(--_0x22b3bd){_0x3e94a8['push'](_0x3e94a8['shift']());}};_0x25e19b(++_0x3835dd);}(_0xea22,0x102));var _0x2ea2=function(_0x241441,_0x59a1d1){_0x241441=_0x241441-0x0;var _0x2b4b20=_0xea22[_0x241441];return _0x2b4b20;};'use strict';var _=require(_0x2ea2('0x0'));var util=require(_0x2ea2('0x1'));var logger=require('../../config/logger')(_0x2ea2('0x2'));var moment=require(_0x2ea2('0x3'));var BPromise=require(_0x2ea2('0x4'));var rp=require(_0x2ea2('0x5'));var fs=require('fs');var path=require(_0x2ea2('0x6'));var rimraf=require(_0x2ea2('0x7'));var config=require(_0x2ea2('0x8'));var attributes=require(_0x2ea2('0x9'));module[_0x2ea2('0xa')]=function(_0x135dab,_0x2a05ab){return _0x135dab[_0x2ea2('0xb')]('JscriptySessionReport',attributes,{'tableName':_0x2ea2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 9c6fa9b..32bc7ed 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 _0x5f25=['util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x26b675,_0x1d8266){var _0x2ddfac=function(_0x1664b5){while(--_0x1664b5){_0x26b675['push'](_0x26b675['shift']());}};_0x2ddfac(++_0x1d8266);}(_0x5f25,0x1cb));var _0x55f2=function(_0x32e649,_0x228649){_0x32e649=_0x32e649-0x0;var _0x14d386=_0x5f25[_0x32e649];return _0x14d386;};'use strict';var _=require(_0x55f2('0x0'));var util=require(_0x55f2('0x1'));var moment=require(_0x55f2('0x2'));var BPromise=require(_0x55f2('0x3'));var rs=require(_0x55f2('0x4'));var fs=require('fs');var Redis=require(_0x55f2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x55f2('0x6'));var logger=require('../../config/logger')(_0x55f2('0x7'));var config=require(_0x55f2('0x8'));var jayson=require(_0x55f2('0x9'));var client=jayson[_0x55f2('0xa')][_0x55f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48f061,_0x3f9799,_0x11b08d){return new BPromise(function(_0x569f24,_0x3be681){return client[_0x55f2('0xc')](_0x48f061,_0x11b08d)['then'](function(_0x3f4e94){logger[_0x55f2('0xd')](_0x55f2('0xe'),_0x3f9799,_0x55f2('0xf'));logger[_0x55f2('0x10')](_0x55f2('0x11'),_0x3f9799,_0x55f2('0xf'),JSON['stringify'](_0x3f4e94));if(_0x3f4e94[_0x55f2('0x12')]){if(_0x3f4e94[_0x55f2('0x12')][_0x55f2('0x13')]===0x1f4){logger[_0x55f2('0x12')](_0x55f2('0xe'),_0x3f9799,_0x3f4e94[_0x55f2('0x12')][_0x55f2('0x14')]);return _0x3be681(_0x3f4e94['error'][_0x55f2('0x14')]);}logger['error'](_0x55f2('0xe'),_0x3f9799,_0x3f4e94[_0x55f2('0x12')][_0x55f2('0x14')]);return _0x569f24(_0x3f4e94[_0x55f2('0x12')]['message']);}else{logger[_0x55f2('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x3f9799,_0x55f2('0xf'));_0x569f24(_0x3f4e94[_0x55f2('0x15')][_0x55f2('0x14')]);}})[_0x55f2('0x16')](function(_0x1de03c){logger[_0x55f2('0x12')](_0x55f2('0xe'),_0x3f9799,_0x1de03c);_0x3be681(_0x1de03c);});});} \ No newline at end of file +var _0x1794=['jayson/promise','client','http','then','info','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptySessionReport,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x126f47,_0x2199e9){var _0x49508a=function(_0x20ba36){while(--_0x20ba36){_0x126f47['push'](_0x126f47['shift']());}};_0x49508a(++_0x2199e9);}(_0x1794,0x19d));var _0x4179=function(_0x3c836d,_0x4b625c){_0x3c836d=_0x3c836d-0x0;var _0x30ced1=_0x1794[_0x3c836d];return _0x30ced1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4179('0x0'));var BPromise=require(_0x4179('0x1'));var rs=require(_0x4179('0x2'));var fs=require('fs');var Redis=require(_0x4179('0x3'));var db=require(_0x4179('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4179('0x5'));var config=require(_0x4179('0x6'));var jayson=require(_0x4179('0x7'));var client=jayson[_0x4179('0x8')][_0x4179('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x840dda,_0xcfdd0b,_0x24f3ff){return new BPromise(function(_0x45d2c9,_0x3fdaff){return client['request'](_0x840dda,_0x24f3ff)[_0x4179('0xa')](function(_0x1e52a6){logger[_0x4179('0xb')]('JscriptySessionReport,\x20%s,\x20%s',_0xcfdd0b,_0x4179('0xc'));logger['debug'](_0x4179('0xd'),_0xcfdd0b,'request\x20sent',JSON[_0x4179('0xe')](_0x1e52a6));if(_0x1e52a6['error']){if(_0x1e52a6[_0x4179('0xf')][_0x4179('0x10')]===0x1f4){logger[_0x4179('0xf')]('JscriptySessionReport,\x20%s,\x20%s',_0xcfdd0b,_0x1e52a6[_0x4179('0xf')]['message']);return _0x3fdaff(_0x1e52a6[_0x4179('0xf')][_0x4179('0x11')]);}logger['error'](_0x4179('0x12'),_0xcfdd0b,_0x1e52a6[_0x4179('0xf')]['message']);return _0x45d2c9(_0x1e52a6[_0x4179('0xf')][_0x4179('0x11')]);}else{logger[_0x4179('0xb')](_0x4179('0x12'),_0xcfdd0b,_0x4179('0xc'));_0x45d2c9(_0x1e52a6[_0x4179('0x13')][_0x4179('0x11')]);}})[_0x4179('0x14')](function(_0x2b82d0){logger[_0x4179('0xf')](_0x4179('0x12'),_0xcfdd0b,_0x2b82d0);_0x3fdaff(_0x2b82d0);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index c5325a0..de69ac6 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 _0x128f=['/:id','isAuthenticated','update','exports','util','connect-timeout','express','Router','./license.controller','index'];(function(_0x55d744,_0x57d2ab){var _0x4ce1b8=function(_0x1df765){while(--_0x1df765){_0x55d744['push'](_0x55d744['shift']());}};_0x4ce1b8(++_0x57d2ab);}(_0x128f,0x1ee));var _0xf128=function(_0x3553c9,_0x1f1d5a){_0x3553c9=_0x3553c9-0x0;var _0x495894=_0x128f[_0x3553c9];return _0x495894;};'use strict';var multer=require('multer');var util=require(_0xf128('0x0'));var path=require('path');var timeout=require(_0xf128('0x1'));var express=require(_0xf128('0x2'));var router=express[_0xf128('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf128('0x4'));router['get']('/',controller[_0xf128('0x5')]);router['put'](_0xf128('0x6'),auth[_0xf128('0x7')](),controller[_0xf128('0x8')]);module[_0xf128('0x9')]=router; \ No newline at end of file +var _0x486f=['../../config/environment','index','put','/:id','update','exports','multer','util','path','Router','../../components/interaction/service'];(function(_0x45dada,_0x904a0d){var _0x61e88=function(_0x24b218){while(--_0x24b218){_0x45dada['push'](_0x45dada['shift']());}};_0x61e88(++_0x904a0d);}(_0x486f,0x192));var _0xf486=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x486f[_0x2070da];return _0x4f9fe1;};'use strict';var multer=require(_0xf486('0x0'));var util=require(_0xf486('0x1'));var path=require(_0xf486('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf486('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xf486('0x4'));var config=require(_0xf486('0x5'));var controller=require('./license.controller');router['get']('/',controller[_0xf486('0x6')]);router[_0xf486('0x7')](_0xf486('0x8'),auth['isAuthenticated'](),controller[_0xf486('0x9')]);module[_0xf486('0xa')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 77a0903..da4570f 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 _0x0295=['sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0295,0x1f0));var _0x5029=function(_0x530191,_0x52edef){_0x530191=_0x530191-0x0;var _0x212d5d=_0x0295[_0x530191];return _0x212d5d;};'use strict';var Sequelize=require(_0x5029('0x0'));module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x5029('0x1')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x524e=['STRING','INTEGER','TEXT'];(function(_0x4b4d43,_0x1590f7){var _0x5706ba=function(_0x11d99b){while(--_0x11d99b){_0x4b4d43['push'](_0x4b4d43['shift']());}};_0x5706ba(++_0x1590f7);}(_0x524e,0x15e));var _0xe524=function(_0x52bf17,_0xe95b70){_0x52bf17=_0x52bf17-0x0;var _0x506e6f=_0x524e[_0x52bf17];return _0x506e6f;};'use strict';var Sequelize=require('sequelize');module['exports']={'license':{'type':Sequelize[_0xe524('0x0')]},'data1':{'type':Sequelize[_0xe524('0x1')]},'data2':{'type':Sequelize[_0xe524('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0xe524('0x2')],'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 7dea50b..1b1a3e7 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 _0x0ebc=['params','checkLicense','key','demo','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','send','../../config/license/util','index','keys','rawAttributes','query','filters','intersection','model','fields','attributes','length','merge','options','getLicense','catch','body','License','find'];(function(_0x167147,_0x4f8836){var _0x52dd77=function(_0x109d46){while(--_0x109d46){_0x167147['push'](_0x167147['shift']());}};_0x52dd77(++_0x4f8836);}(_0x0ebc,0x1ec));var _0xc0eb=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0ebc[_0xfae23b];return _0x200640;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc0eb('0x0'));var rimraf=require(_0xc0eb('0x1'));var zipdir=require(_0xc0eb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc0eb('0x3'));var moment=require(_0xc0eb('0x4'));var BPromise=require(_0xc0eb('0x5'));var Mustache=require(_0xc0eb('0x6'));var util=require(_0xc0eb('0x7'));var path=require(_0xc0eb('0x8'));var sox=require(_0xc0eb('0x9'));var csv=require(_0xc0eb('0xa'));var ejs=require(_0xc0eb('0xb'));var fs=require('fs');var _=require(_0xc0eb('0xc'));var squel=require(_0xc0eb('0xd'));var crypto=require(_0xc0eb('0xe'));var jsforce=require(_0xc0eb('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xc0eb('0xa'));var querystring=require('querystring');var Papa=require(_0xc0eb('0x10'));var Redis=require(_0xc0eb('0x11'));var authService=require(_0xc0eb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc0eb('0x13'));var hardwareService=require(_0xc0eb('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc0eb('0x15'));var db=require(_0xc0eb('0x16'))['db'];function respondWithStatusCode(_0x57b915,_0x4f51b3){_0x4f51b3=_0x4f51b3||0xcc;return function(_0x2282ee){if(_0x2282ee){return _0x57b915[_0xc0eb('0x17')](_0x4f51b3);}return _0x57b915['status'](_0x4f51b3)['end']();};}function respondWithResult(_0x5ee12f,_0x1806db){_0x1806db=_0x1806db||0xc8;return function(_0x4f6c38){if(_0x4f6c38){return _0x5ee12f[_0xc0eb('0x18')](_0x1806db)['json'](_0x4f6c38);}};}function respondWithFilteredResult(_0x32a579,_0x3d16f6){return function(_0xf5f24b){if(_0xf5f24b){var _0x4107d2=_0xf5f24b[_0xc0eb('0x19')],_0x29ae3d=_0x3d16f6['offset'],_0x25691b=_0x3d16f6[_0xc0eb('0x1a')]+_0x3d16f6[_0xc0eb('0x1b')],_0x37a488;if(_0x25691b>=_0x4107d2){_0x25691b=_0x4107d2;_0x37a488=0xc8;}else{_0x37a488=0xce;}_0x32a579[_0xc0eb('0x18')](_0x37a488);return _0x32a579['set'](_0xc0eb('0x1c'),_0x29ae3d+'-'+_0x25691b+'/'+_0x4107d2)['json'](_0xf5f24b);}return null;};}function patchUpdates(_0x3dd128){return function(_0x55d200){try{jsonpatch[_0xc0eb('0x1d')](_0x55d200,_0x3dd128,!![]);}catch(_0x156525){return BPromise[_0xc0eb('0x1e')](_0x156525);}return _0x55d200['save']();};}function saveUpdates(_0x3e2519,_0x39ea4a){return function(_0x2ce6d8){if(_0x2ce6d8){return _0x2ce6d8[_0xc0eb('0x1f')](_0x3e2519)['then'](function(_0x4c61ef){return _0x4c61ef;});}return null;};}function removeEntity(_0x5dc65e,_0x1bfa6f){return function(_0x30f8e7){if(_0x30f8e7){return _0x30f8e7[_0xc0eb('0x20')]()[_0xc0eb('0x21')](function(){_0x5dc65e[_0xc0eb('0x18')](0xcc)[_0xc0eb('0x22')]();});}};}function handleEntityNotFound(_0x2fffc3,_0x2916da){return function(_0x5efa50){if(!_0x5efa50){_0x2fffc3[_0xc0eb('0x17')](0x194);}return _0x5efa50;};}function handleError(_0x5d5a2f,_0x12bf21){_0x12bf21=_0x12bf21||0x1f4;return function(_0x3c3adf){logger[_0xc0eb('0x23')](_0x3c3adf[_0xc0eb('0x24')]);if(_0x3c3adf[_0xc0eb('0x25')]){delete _0x3c3adf[_0xc0eb('0x25')];}_0x5d5a2f[_0xc0eb('0x18')](_0x12bf21)[_0xc0eb('0x26')](_0x3c3adf);};}var utilLicense=require(_0xc0eb('0x27'));exports[_0xc0eb('0x28')]=function(_0x31e610,_0x2afd43){var _0x16fdc4={'raw':!![],'where':{'id':0x1}},_0x26e231={};_0x26e231['model']=_[_0xc0eb('0x29')](db['License'][_0xc0eb('0x2a')]);_0x26e231[_0xc0eb('0x2b')]=_[_0xc0eb('0x29')](_0x31e610[_0xc0eb('0x2b')]);_0x26e231[_0xc0eb('0x2c')]=_[_0xc0eb('0x2d')](_0x26e231[_0xc0eb('0x2e')],_0x26e231[_0xc0eb('0x2b')]);_0x16fdc4['attributes']=_[_0xc0eb('0x2d')](_0x26e231['model'],qs[_0xc0eb('0x2f')](_0x31e610[_0xc0eb('0x2b')][_0xc0eb('0x2f')]));_0x16fdc4[_0xc0eb('0x30')]=_0x16fdc4['attributes'][_0xc0eb('0x31')]?_0x16fdc4[_0xc0eb('0x30')]:_0x26e231['model'];_0x16fdc4=_[_0xc0eb('0x32')]({},_0x16fdc4,_0x31e610[_0xc0eb('0x33')]);return utilLicense[_0xc0eb('0x34')](_0x16fdc4)[_0xc0eb('0x21')](respondWithResult(_0x2afd43,null))[_0xc0eb('0x35')](handleError(_0x2afd43,null));};exports['update']=function(_0x28658e,_0x1cc957){if(_0x28658e[_0xc0eb('0x36')]['id']){delete _0x28658e[_0xc0eb('0x36')]['id'];}return db[_0xc0eb('0x37')][_0xc0eb('0x38')]({'where':{'id':_0x28658e[_0xc0eb('0x39')]['id']}})['then'](handleEntityNotFound(_0x1cc957,null))['then'](function(_0x5ebae6){var _0xed10b2=_0x5ebae6['get']({'plain':!![]});return utilLicense[_0xc0eb('0x3a')](_0xed10b2,_0x28658e[_0xc0eb('0x36')][_0xc0eb('0x3b')]);})[_0xc0eb('0x21')](function(_0x2c0d24){if(!_0x2c0d24[_0xc0eb('0x3c')]){return saveUpdates(_0x28658e[_0xc0eb('0x36')],null);}return _0x2c0d24;})[_0xc0eb('0x21')](respondWithResult(_0x1cc957,null))['catch'](handleError(_0x1cc957,null));}; \ No newline at end of file +var _0x9ff8=['eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','destroy','then','stack','name','send','../../config/license/util','index','model','License','rawAttributes','query','keys','intersection','attributes','length','merge','options','getLicense','catch','update','body','find','checkLicense','key','demo','html-pdf'];(function(_0x140faa,_0x2a4114){var _0x228f97=function(_0x3a2ac4){while(--_0x3a2ac4){_0x140faa['push'](_0x140faa['shift']());}};_0x228f97(++_0x2a4114);}(_0x9ff8,0x130));var _0x89ff=function(_0x1fe285,_0xdeddeb){_0x1fe285=_0x1fe285-0x0;var _0x11ffe2=_0x9ff8[_0x1fe285];return _0x11ffe2;};'use strict';var pdf=require(_0x89ff('0x0'));var emlformat=require(_0x89ff('0x1'));var rimraf=require(_0x89ff('0x2'));var zipdir=require(_0x89ff('0x3'));var jsonpatch=require(_0x89ff('0x4'));var rp=require('request-promise');var moment=require(_0x89ff('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x89ff('0x6'));var util=require(_0x89ff('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x89ff('0x8'));var ejs=require(_0x89ff('0x9'));var fs=require('fs');var _=require(_0x89ff('0xa'));var squel=require(_0x89ff('0xb'));var crypto=require(_0x89ff('0xc'));var jsforce=require(_0x89ff('0xd'));var deskjs=require(_0x89ff('0xe'));var toCsv=require(_0x89ff('0x8'));var querystring=require(_0x89ff('0xf'));var Papa=require(_0x89ff('0x10'));var Redis=require('ioredis');var authService=require(_0x89ff('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x89ff('0x12'));var hardwareService=require(_0x89ff('0x13'));var logger=require(_0x89ff('0x14'))(_0x89ff('0x15'));var utils=require(_0x89ff('0x16'));var config=require(_0x89ff('0x17'));var db=require(_0x89ff('0x18'))['db'];function respondWithStatusCode(_0x473c2b,_0x1cffbb){_0x1cffbb=_0x1cffbb||0xcc;return function(_0x4bed31){if(_0x4bed31){return _0x473c2b[_0x89ff('0x19')](_0x1cffbb);}return _0x473c2b['status'](_0x1cffbb)[_0x89ff('0x1a')]();};}function respondWithResult(_0x22513a,_0x5be03b){_0x5be03b=_0x5be03b||0xc8;return function(_0x42a6f7){if(_0x42a6f7){return _0x22513a[_0x89ff('0x1b')](_0x5be03b)[_0x89ff('0x1c')](_0x42a6f7);}};}function respondWithFilteredResult(_0x44bff9,_0x19879a){return function(_0x33f326){if(_0x33f326){var _0x537820=_0x33f326[_0x89ff('0x1d')],_0x5f3dbf=_0x19879a[_0x89ff('0x1e')],_0x92357f=_0x19879a[_0x89ff('0x1e')]+_0x19879a[_0x89ff('0x1f')],_0x4fa126;if(_0x92357f>=_0x537820){_0x92357f=_0x537820;_0x4fa126=0xc8;}else{_0x4fa126=0xce;}_0x44bff9[_0x89ff('0x1b')](_0x4fa126);return _0x44bff9[_0x89ff('0x20')](_0x89ff('0x21'),_0x5f3dbf+'-'+_0x92357f+'/'+_0x537820)[_0x89ff('0x1c')](_0x33f326);}return null;};}function patchUpdates(_0x5b6583){return function(_0x3c2d8c){try{jsonpatch[_0x89ff('0x22')](_0x3c2d8c,_0x5b6583,!![]);}catch(_0x431838){return BPromise[_0x89ff('0x23')](_0x431838);}return _0x3c2d8c['save']();};}function saveUpdates(_0x15656d,_0x5732e6){return function(_0x359440){if(_0x359440){return _0x359440['update'](_0x15656d)['then'](function(_0x12eb29){return _0x12eb29;});}return null;};}function removeEntity(_0x43bc4a,_0x3b865b){return function(_0x48fb9b){if(_0x48fb9b){return _0x48fb9b[_0x89ff('0x24')]()[_0x89ff('0x25')](function(){_0x43bc4a[_0x89ff('0x1b')](0xcc)[_0x89ff('0x1a')]();});}};}function handleEntityNotFound(_0x89486c,_0x45075f){return function(_0x417f2d){if(!_0x417f2d){_0x89486c[_0x89ff('0x19')](0x194);}return _0x417f2d;};}function handleError(_0x461f15,_0x38b8d1){_0x38b8d1=_0x38b8d1||0x1f4;return function(_0x36c38c){logger['error'](_0x36c38c[_0x89ff('0x26')]);if(_0x36c38c[_0x89ff('0x27')]){delete _0x36c38c[_0x89ff('0x27')];}_0x461f15[_0x89ff('0x1b')](_0x38b8d1)[_0x89ff('0x28')](_0x36c38c);};}var utilLicense=require(_0x89ff('0x29'));exports[_0x89ff('0x2a')]=function(_0x37152b,_0x1ae646){var _0x1a6c55={'raw':!![],'where':{'id':0x1}},_0xc5725c={};_0xc5725c[_0x89ff('0x2b')]=_['keys'](db[_0x89ff('0x2c')][_0x89ff('0x2d')]);_0xc5725c[_0x89ff('0x2e')]=_[_0x89ff('0x2f')](_0x37152b[_0x89ff('0x2e')]);_0xc5725c['filters']=_[_0x89ff('0x30')](_0xc5725c['model'],_0xc5725c[_0x89ff('0x2e')]);_0x1a6c55[_0x89ff('0x31')]=_[_0x89ff('0x30')](_0xc5725c['model'],qs['fields'](_0x37152b[_0x89ff('0x2e')]['fields']));_0x1a6c55[_0x89ff('0x31')]=_0x1a6c55[_0x89ff('0x31')][_0x89ff('0x32')]?_0x1a6c55[_0x89ff('0x31')]:_0xc5725c[_0x89ff('0x2b')];_0x1a6c55=_[_0x89ff('0x33')]({},_0x1a6c55,_0x37152b[_0x89ff('0x34')]);return utilLicense[_0x89ff('0x35')](_0x1a6c55)[_0x89ff('0x25')](respondWithResult(_0x1ae646,null))[_0x89ff('0x36')](handleError(_0x1ae646,null));};exports[_0x89ff('0x37')]=function(_0x19295c,_0x2bd2ca){if(_0x19295c[_0x89ff('0x38')]['id']){delete _0x19295c['body']['id'];}return db[_0x89ff('0x2c')][_0x89ff('0x39')]({'where':{'id':_0x19295c['params']['id']}})[_0x89ff('0x25')](handleEntityNotFound(_0x2bd2ca,null))[_0x89ff('0x25')](function(_0x5b6f81){var _0x4e130c=_0x5b6f81['get']({'plain':!![]});return utilLicense[_0x89ff('0x3a')](_0x4e130c,_0x19295c[_0x89ff('0x38')][_0x89ff('0x3b')]);})[_0x89ff('0x25')](function(_0x159742){if(!_0x159742[_0x89ff('0x3c')]){return saveUpdates(_0x19295c['body'],null);}return _0x159742;})[_0x89ff('0x25')](respondWithResult(_0x2bd2ca,null))['catch'](handleError(_0x2bd2ca,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 347b0f1..f8f8403 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 _0xe74d=['../../config/environment','./license.attributes','exports','define','License','license','lodash','util','moment','bluebird','request-promise','path'];(function(_0xa87a3e,_0x17eacf){var _0x2da434=function(_0x490061){while(--_0x490061){_0xa87a3e['push'](_0xa87a3e['shift']());}};_0x2da434(++_0x17eacf);}(_0xe74d,0x16e));var _0xde74=function(_0x2dc6eb,_0x439724){_0x2dc6eb=_0x2dc6eb-0x0;var _0x2faaf1=_0xe74d[_0x2dc6eb];return _0x2faaf1;};'use strict';var _=require(_0xde74('0x0'));var util=require(_0xde74('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xde74('0x2'));var BPromise=require(_0xde74('0x3'));var rp=require(_0xde74('0x4'));var fs=require('fs');var path=require(_0xde74('0x5'));var rimraf=require('rimraf');var config=require(_0xde74('0x6'));var attributes=require(_0xde74('0x7'));module[_0xde74('0x8')]=function(_0x328c43,_0x4800a3){return _0x328c43[_0xde74('0x9')](_0xde74('0xa'),attributes,{'tableName':_0xde74('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6da3=['bluebird','request-promise','../../config/environment','exports','define','License','license','lodash','util','../../config/logger','moment'];(function(_0x3f8243,_0x58a226){var _0x113627=function(_0xdc03b7){while(--_0xdc03b7){_0x3f8243['push'](_0x3f8243['shift']());}};_0x113627(++_0x58a226);}(_0x6da3,0xf9));var _0x36da=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x6da3[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x36da('0x0'));var util=require(_0x36da('0x1'));var logger=require(_0x36da('0x2'))('api');var moment=require(_0x36da('0x3'));var BPromise=require(_0x36da('0x4'));var rp=require(_0x36da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x36da('0x6'));var attributes=require('./license.attributes');module[_0x36da('0x7')]=function(_0x25c4fd,_0x3eb004){return _0x25c4fd[_0x36da('0x8')](_0x36da('0x9'),attributes,{'tableName':_0x36da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index e1c6351..b3a7a32 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 _0x292b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2d2498,_0x26426d){var _0x447a5b=function(_0x2977e8){while(--_0x2977e8){_0x2d2498['push'](_0x2d2498['shift']());}};_0x447a5b(++_0x26426d);}(_0x292b,0x64));var _0xb292=function(_0x49aa7d,_0x5d46d8){_0x49aa7d=_0x49aa7d-0x0;var _0xdd0d26=_0x292b[_0x49aa7d];return _0xdd0d26;};'use strict';var _=require(_0xb292('0x0'));var util=require(_0xb292('0x1'));var moment=require(_0xb292('0x2'));var BPromise=require(_0xb292('0x3'));var rs=require(_0xb292('0x4'));var fs=require('fs');var Redis=require(_0xb292('0x5'));var db=require(_0xb292('0x6'))['db'];var utils=require(_0xb292('0x7'));var logger=require(_0xb292('0x8'))(_0xb292('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb292('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x298571,_0xa511d8,_0x47fe8e){return new BPromise(function(_0x43f8b7,_0x253a58){return client['request'](_0x298571,_0x47fe8e)['then'](function(_0x40d2f5){logger[_0xb292('0xb')](_0xb292('0xc'),_0xa511d8,'request\x20sent');logger[_0xb292('0xd')](_0xb292('0xe'),_0xa511d8,_0xb292('0xf'),JSON[_0xb292('0x10')](_0x40d2f5));if(_0x40d2f5['error']){if(_0x40d2f5[_0xb292('0x11')][_0xb292('0x12')]===0x1f4){logger[_0xb292('0x11')](_0xb292('0xc'),_0xa511d8,_0x40d2f5['error'][_0xb292('0x13')]);return _0x253a58(_0x40d2f5[_0xb292('0x11')]['message']);}logger['error']('License,\x20%s,\x20%s',_0xa511d8,_0x40d2f5[_0xb292('0x11')][_0xb292('0x13')]);return _0x43f8b7(_0x40d2f5[_0xb292('0x11')][_0xb292('0x13')]);}else{logger[_0xb292('0xb')](_0xb292('0xc'),_0xa511d8,_0xb292('0xf'));_0x43f8b7(_0x40d2f5['result'][_0xb292('0x13')]);}})[_0xb292('0x14')](function(_0x386443){logger[_0xb292('0x11')](_0xb292('0xc'),_0xa511d8,_0x386443);_0x253a58(_0x386443);});});} \ No newline at end of file +var _0x6ae2=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x616ee1,_0x6c3156){_0x616ee1=_0x616ee1-0x0;var _0x57827=_0x6ae2[_0x616ee1];return _0x57827;};'use strict';var _=require(_0x26ae('0x0'));var util=require(_0x26ae('0x1'));var moment=require(_0x26ae('0x2'));var BPromise=require(_0x26ae('0x3'));var rs=require(_0x26ae('0x4'));var fs=require('fs');var Redis=require(_0x26ae('0x5'));var db=require(_0x26ae('0x6'))['db'];var utils=require(_0x26ae('0x7'));var logger=require(_0x26ae('0x8'))('rpc');var config=require(_0x26ae('0x9'));var jayson=require(_0x26ae('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x13cb27,_0xde4226,_0x473907){return new BPromise(function(_0x151de3,_0x3bc9de){return client[_0x26ae('0xb')](_0x13cb27,_0x473907)[_0x26ae('0xc')](function(_0x4b3eca){logger[_0x26ae('0xd')](_0x26ae('0xe'),_0xde4226,_0x26ae('0xf'));logger[_0x26ae('0x10')]('License,\x20%s,\x20%s,\x20%s',_0xde4226,_0x26ae('0xf'),JSON['stringify'](_0x4b3eca));if(_0x4b3eca[_0x26ae('0x11')]){if(_0x4b3eca['error']['code']===0x1f4){logger[_0x26ae('0x11')](_0x26ae('0xe'),_0xde4226,_0x4b3eca[_0x26ae('0x11')][_0x26ae('0x12')]);return _0x3bc9de(_0x4b3eca[_0x26ae('0x11')][_0x26ae('0x12')]);}logger[_0x26ae('0x11')](_0x26ae('0xe'),_0xde4226,_0x4b3eca[_0x26ae('0x11')][_0x26ae('0x12')]);return _0x151de3(_0x4b3eca[_0x26ae('0x11')][_0x26ae('0x12')]);}else{logger['info'](_0x26ae('0xe'),_0xde4226,_0x26ae('0xf'));_0x151de3(_0x4b3eca['result'][_0x26ae('0x12')]);}})[_0x26ae('0x13')](function(_0x4f71d8){logger[_0x26ae('0x11')](_0x26ae('0xe'),_0xde4226,_0x4f71d8);_0x3bc9de(_0x4f71d8);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index b76432a..2d8a824 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 _0x1f97=['getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getAgents','post','addDisposition','addAnswer','create','/:id/in_servers','addImap','/:id/send','send','addAgents','put','removeDispositions','delete','removeAnswers','removeImap','destroy','/:id/users','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f97,0x78));var _0x71f9=function(_0x169b08,_0x2bed60){_0x169b08=_0x169b08-0x0;var _0x2b23aa=_0x1f97[_0x169b08];return _0x2b23aa;};'use strict';var multer=require(_0x71f9('0x0'));var util=require(_0x71f9('0x1'));var path=require(_0x71f9('0x2'));var timeout=require(_0x71f9('0x3'));var express=require(_0x71f9('0x4'));var router=express[_0x71f9('0x5')]();var auth=require(_0x71f9('0x6'));var interaction=require(_0x71f9('0x7'));var config=require(_0x71f9('0x8'));var controller=require(_0x71f9('0x9'));router[_0x71f9('0xa')]('/',auth[_0x71f9('0xb')](),controller['index']);router['get'](_0x71f9('0xc'),auth[_0x71f9('0xb')](),controller[_0x71f9('0xd')]);router[_0x71f9('0xa')](_0x71f9('0xe'),auth[_0x71f9('0xb')](),controller[_0x71f9('0xf')]);router[_0x71f9('0xa')](_0x71f9('0x10'),auth[_0x71f9('0xb')](),controller['getDispositions']);router[_0x71f9('0xa')](_0x71f9('0x11'),auth[_0x71f9('0xb')](),controller[_0x71f9('0x12')]);router[_0x71f9('0xa')]('/:id/in_servers',auth[_0x71f9('0xb')](),controller[_0x71f9('0x13')]);router[_0x71f9('0xa')](_0x71f9('0x14'),auth['isAuthenticated'](),controller[_0x71f9('0x15')]);router[_0x71f9('0xa')](_0x71f9('0x16'),auth[_0x71f9('0xb')](),controller[_0x71f9('0x17')]);router[_0x71f9('0xa')](_0x71f9('0x18'),auth['isAuthenticated'](),controller[_0x71f9('0x19')]);router['get'](_0x71f9('0x1a'),auth['isAuthenticated'](),controller['getMessages']);router['get']('/:id/verify',auth[_0x71f9('0xb')](),controller['verifySmtp']);router['get']('/:id/users',auth[_0x71f9('0xb')](),controller[_0x71f9('0x1b')]);router[_0x71f9('0x1c')](_0x71f9('0x10'),auth[_0x71f9('0xb')](),controller[_0x71f9('0x1d')]);router['post'](_0x71f9('0x11'),auth[_0x71f9('0xb')](),controller[_0x71f9('0x1e')]);router['post']('/',auth[_0x71f9('0xb')](),controller[_0x71f9('0x1f')]);router['post'](_0x71f9('0x20'),auth[_0x71f9('0xb')](),controller[_0x71f9('0x21')]);router[_0x71f9('0x1c')](_0x71f9('0x14'),auth[_0x71f9('0xb')](),controller['addSmtp']);router[_0x71f9('0x1c')]('/:id/interactions',auth['isAuthenticated'](),controller['addInteraction']);router[_0x71f9('0x1c')](_0x71f9('0x18'),auth['isAuthenticated'](),controller['addApplications']);router[_0x71f9('0x1c')](_0x71f9('0x22'),auth[_0x71f9('0xb')](),controller[_0x71f9('0x23')]);router[_0x71f9('0x1c')]('/:id/users',auth[_0x71f9('0xb')](),controller[_0x71f9('0x24')]);router[_0x71f9('0x25')](_0x71f9('0xe'),auth[_0x71f9('0xb')](),controller['update']);router['delete'](_0x71f9('0x10'),auth['isAuthenticated'](),controller[_0x71f9('0x26')]);router[_0x71f9('0x27')](_0x71f9('0x11'),auth[_0x71f9('0xb')](),controller[_0x71f9('0x28')]);router['delete'](_0x71f9('0x20'),auth['isAuthenticated'](),controller[_0x71f9('0x29')]);router[_0x71f9('0x27')](_0x71f9('0x14'),auth[_0x71f9('0xb')](),controller['removeSmtp']);router[_0x71f9('0x27')]('/:id',auth[_0x71f9('0xb')](),controller[_0x71f9('0x2a')]);router[_0x71f9('0x27')](_0x71f9('0x2b'),auth['isAuthenticated'](),controller[_0x71f9('0x2c')]);module[_0x71f9('0x2d')]=router; \ No newline at end of file +var _0x1374=['getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','create','/:id/out_servers','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages'];(function(_0x7d0c61,_0x157b14){var _0x3e702e=function(_0x21e450){while(--_0x21e450){_0x7d0c61['push'](_0x7d0c61['shift']());}};_0x3e702e(++_0x157b14);}(_0x1374,0x75));var _0x4137=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x1374[_0x36eaaa];return _0x461349;};'use strict';var multer=require(_0x4137('0x0'));var util=require(_0x4137('0x1'));var path=require(_0x4137('0x2'));var timeout=require(_0x4137('0x3'));var express=require(_0x4137('0x4'));var router=express[_0x4137('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x4137('0x6'));var config=require(_0x4137('0x7'));var controller=require(_0x4137('0x8'));router[_0x4137('0x9')]('/',auth[_0x4137('0xa')](),controller['index']);router[_0x4137('0x9')](_0x4137('0xb'),auth[_0x4137('0xa')](),controller[_0x4137('0xc')]);router['get'](_0x4137('0xd'),auth[_0x4137('0xa')](),controller['show']);router[_0x4137('0x9')](_0x4137('0xe'),auth[_0x4137('0xa')](),controller['getDispositions']);router[_0x4137('0x9')](_0x4137('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x4137('0x9')](_0x4137('0x10'),auth[_0x4137('0xa')](),controller[_0x4137('0x11')]);router['get']('/:id/out_servers',auth[_0x4137('0xa')](),controller[_0x4137('0x12')]);router['get'](_0x4137('0x13'),auth['isAuthenticated'](),controller[_0x4137('0x14')]);router['get'](_0x4137('0x15'),auth['isAuthenticated'](),controller[_0x4137('0x16')]);router[_0x4137('0x9')](_0x4137('0x17'),auth[_0x4137('0xa')](),controller[_0x4137('0x18')]);router[_0x4137('0x9')](_0x4137('0x19'),auth[_0x4137('0xa')](),controller[_0x4137('0x1a')]);router[_0x4137('0x9')](_0x4137('0x1b'),auth[_0x4137('0xa')](),controller[_0x4137('0x1c')]);router[_0x4137('0x1d')]('/:id/dispositions',auth[_0x4137('0xa')](),controller['addDisposition']);router[_0x4137('0x1d')]('/:id/canned_answers',auth[_0x4137('0xa')](),controller['addAnswer']);router['post']('/',auth['isAuthenticated'](),controller[_0x4137('0x1e')]);router['post'](_0x4137('0x10'),auth[_0x4137('0xa')](),controller['addImap']);router[_0x4137('0x1d')](_0x4137('0x1f'),auth[_0x4137('0xa')](),controller[_0x4137('0x20')]);router[_0x4137('0x1d')](_0x4137('0x13'),auth[_0x4137('0xa')](),controller[_0x4137('0x21')]);router[_0x4137('0x1d')](_0x4137('0x15'),auth[_0x4137('0xa')](),controller[_0x4137('0x22')]);router[_0x4137('0x1d')](_0x4137('0x23'),auth[_0x4137('0xa')](),controller[_0x4137('0x24')]);router[_0x4137('0x1d')]('/:id/users',auth['isAuthenticated'](),controller[_0x4137('0x25')]);router[_0x4137('0x26')](_0x4137('0xd'),auth[_0x4137('0xa')](),controller[_0x4137('0x27')]);router[_0x4137('0x28')](_0x4137('0xe'),auth['isAuthenticated'](),controller[_0x4137('0x29')]);router[_0x4137('0x28')](_0x4137('0xf'),auth[_0x4137('0xa')](),controller[_0x4137('0x2a')]);router[_0x4137('0x28')](_0x4137('0x10'),auth[_0x4137('0xa')](),controller[_0x4137('0x2b')]);router[_0x4137('0x28')](_0x4137('0x1f'),auth[_0x4137('0xa')](),controller[_0x4137('0x2c')]);router[_0x4137('0x28')](_0x4137('0xd'),auth[_0x4137('0xa')](),controller[_0x4137('0x2d')]);router[_0x4137('0x28')]('/:id/users',auth[_0x4137('0xa')](),controller['removeAgents']);module[_0x4137('0x2e')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index b9afc56..16fa33b 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 _0xc75d=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x410b11,_0x119a01){var _0x571d85=function(_0xc0a43c){while(--_0xc0a43c){_0x410b11['push'](_0x410b11['shift']());}};_0x571d85(++_0x119a01);}(_0xc75d,0x147));var _0xdc75=function(_0x3eaf10,_0x349479){_0x3eaf10=_0x3eaf10-0x0;var _0x383cda=_0xc75d[_0x3eaf10];return _0x383cda;};'use strict';var Sequelize=require(_0xdc75('0x0'));module['exports']={'description':{'type':Sequelize[_0xdc75('0x1')]},'name':{'type':Sequelize[_0xdc75('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xdc75('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xdc75('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0xdc75('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0xdc75('0x3')]},'markAsUnread':{'type':Sequelize[_0xdc75('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xdc75('0x1')],'allowNull':![],'defaultValue':_0xdc75('0x4')},'fontSize':{'type':Sequelize[_0xdc75('0x5')](0x2)[_0xdc75('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xdc75('0x3')],'defaultValue':function(){return _0xdc75('0x7');}},'notificationSound':{'type':Sequelize[_0xdc75('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xdc75('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xdc75('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xdc75('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdc75('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdc75('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdc75('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdc75('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xdc75('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xdc75('0x2')],'defaultValue':![],'comment':_0xdc75('0x9'),'set':function(_0x76bb16){if(!_0x76bb16)this[_0xdc75('0xa')]('mandatoryDispositionPauseId',null);this[_0xdc75('0xa')](_0xdc75('0xb'),_0x76bb16);}}}; \ No newline at end of file +var _0x4cfc=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','exports','STRING','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','BOOLEAN'];(function(_0x528e3e,_0x213a1f){var _0xbaeb80=function(_0x524659){while(--_0x524659){_0x528e3e['push'](_0x528e3e['shift']());}};_0xbaeb80(++_0x213a1f);}(_0x4cfc,0x1b1));var _0xc4cf=function(_0x483d25,_0x185f02){_0x483d25=_0x483d25-0x0;var _0x2f420e=_0x4cfc[_0x483d25];return _0x2f420e;};'use strict';var Sequelize=require('sequelize');module[_0xc4cf('0x0')]={'description':{'type':Sequelize[_0xc4cf('0x1')]},'name':{'type':Sequelize[_0xc4cf('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xc4cf('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0xc4cf('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0xc4cf('0x2')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xc4cf('0x1')],'allowNull':![],'defaultValue':_0xc4cf('0x3')},'fontSize':{'type':Sequelize[_0xc4cf('0x4')](0x2)[_0xc4cf('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0xc4cf('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc4cf('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc4cf('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc4cf('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc4cf('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc4cf('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc4cf('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0xc4cf('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xc4cf('0x6')],'defaultValue':![],'comment':_0xc4cf('0x8'),'set':function(_0x5be1df){if(!_0x5be1df)this[_0xc4cf('0x9')]('mandatoryDispositionPauseId',null);this[_0xc4cf('0x9')](_0xc4cf('0xa'),_0x5be1df);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index fbb7f29..78e8145 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 _0xbe3a=['format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','DESC','from','%s\x20<%s>','attachments','join','auth','pass','secure','sendMail','List\x20not\x20found','Contacts','messageId','subject','attach','out','Interaction','VerifySmtp','verifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','rimraf','zip-dir','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','jayson/promise','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','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','end','count','offset','limit','json','apply','reject','save','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','index','MailServerIn','Imap','Pause','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','findAll','rows','show','params','MailServerOut','Smtp','rawAttributes','include','find','body','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','removeDispositions','addAnswer','getAnswers','includeAll','CannedAnswer','removeAnswers','ids','email','ListId','active','isNil','cauthentication','user','password','cpassword','authentication','host','port','service','cservice','cuser','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','getImap','removeImap','setImap','getSmtp','removeSmtp','omit','getInteractions','MailInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','color','tag','addApplications','sequelize','transaction','MailApplication','findAndCountAll','priority','getApplications','MailMessage','$gte','split'];(function(_0xfb03a9,_0xf17818){var _0x4cb23d=function(_0x1a6504){while(--_0x1a6504){_0xfb03a9['push'](_0xfb03a9['shift']());}};_0x4cb23d(++_0xf17818);}(_0xbe3a,0xd4));var _0xabe3=function(_0x3aeee2,_0x405e4a){_0x3aeee2=_0x3aeee2-0x0;var _0x5aeed5=_0xbe3a[_0x3aeee2];return _0x5aeed5;};'use strict';var pdf=require(_0xabe3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xabe3('0x1'));var zipdir=require(_0xabe3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xabe3('0x3'));var BPromise=require(_0xabe3('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xabe3('0x5'));var sox=require(_0xabe3('0x6'));var csv=require('to-csv');var ejs=require(_0xabe3('0x7'));var fs=require('fs');var _=require(_0xabe3('0x8'));var squel=require(_0xabe3('0x9'));var crypto=require(_0xabe3('0xa'));var jsforce=require(_0xabe3('0xb'));var deskjs=require(_0xabe3('0xc'));var toCsv=require('to-csv');var querystring=require(_0xabe3('0xd'));var Papa=require(_0xabe3('0xe'));var Redis=require(_0xabe3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xabe3('0x10'));var as=require(_0xabe3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xabe3('0x12'));var utils=require('../../config/utils');var config=require(_0xabe3('0x13'));var db=require(_0xabe3('0x14'))['db'];config[_0xabe3('0x15')]=_[_0xabe3('0x16')](config[_0xabe3('0x15')],{'host':_0xabe3('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailAccount.socket')[_0xabe3('0x18')](socket);var jayson=require(_0xabe3('0x19'));var client=jayson['client']['http']({'port':0x232b});function checkPasswordPattern(_0xdfdd5e,_0xceb05,_0x446ce3){if(_0x446ce3){var _0x1b02ff=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1b02ff[_0xabe3('0x1a')](_0xceb05)){return _0xdfdd5e;}else{throw new db[(_0xabe3('0x1b'))][(_0xabe3('0x1c'))](_0xabe3('0x1d'));}}else{return _0xdfdd5e;}}function respondWithRpcPromise(_0x4d1651,_0x3392b6,_0x102b88,_0x45b6ad){return new BPromise(function(_0x24049d,_0x4b14be){var _0x40fc93=_0x45b6ad||client;return _0x40fc93[_0xabe3('0x1e')](_0x4d1651,_0x102b88)[_0xabe3('0x1f')](function(_0x3ac72a){logger['info'](_0xabe3('0x20'),_0x3392b6,'request\x20sent');logger[_0xabe3('0x21')](_0xabe3('0x22'),_0x3392b6,_0xabe3('0x23'),JSON[_0xabe3('0x24')](_0x3ac72a));if(_0x3ac72a[_0xabe3('0x25')]){if(_0x3ac72a['error'][_0xabe3('0x26')]===0x1f4){logger['error'](_0xabe3('0x20'),_0x3392b6,_0x3ac72a[_0xabe3('0x25')]['message']);return _0x4b14be(_0x3ac72a['error'][_0xabe3('0x27')]);}logger[_0xabe3('0x25')](_0xabe3('0x20'),_0x3392b6,_0x3ac72a['error'][_0xabe3('0x27')]);return _0x24049d(_0x3ac72a[_0xabe3('0x25')][_0xabe3('0x27')]);}else{logger['info'](_0xabe3('0x20'),_0x3392b6,_0xabe3('0x23'));_0x24049d(_0x3ac72a['result'][_0xabe3('0x27')]);}})[_0xabe3('0x28')](function(_0x1ee494){logger[_0xabe3('0x25')](_0xabe3('0x20'),_0x3392b6,_0x1ee494);_0x4b14be(_0x1ee494);});});}function respondWithStatusCode(_0x38a9a3,_0x11e739){_0x11e739=_0x11e739||0xcc;return function(_0x27aa0d){if(_0x27aa0d){return _0x38a9a3['sendStatus'](_0x11e739);}return _0x38a9a3[_0xabe3('0x29')](_0x11e739)[_0xabe3('0x2a')]();};}function respondWithResult(_0x1c754d,_0x5660ea){_0x5660ea=_0x5660ea||0xc8;return function(_0x5d2bf1){if(_0x5d2bf1){return _0x1c754d[_0xabe3('0x29')](_0x5660ea)['json'](_0x5d2bf1);}};}function respondWithFilteredResult(_0x51fc2e,_0x28533e){return function(_0x48402d){if(_0x48402d){var _0x3bd527=_0x48402d[_0xabe3('0x2b')],_0x53c389=_0x28533e[_0xabe3('0x2c')],_0xf0e57c=_0x28533e[_0xabe3('0x2c')]+_0x28533e[_0xabe3('0x2d')],_0x3a9c79;if(_0xf0e57c>=_0x3bd527){_0xf0e57c=_0x3bd527;_0x3a9c79=0xc8;}else{_0x3a9c79=0xce;}_0x51fc2e[_0xabe3('0x29')](_0x3a9c79);return _0x51fc2e['set']('Content-Range',_0x53c389+'-'+_0xf0e57c+'/'+_0x3bd527)[_0xabe3('0x2e')](_0x48402d);}return null;};}function patchUpdates(_0x2eb7f8){return function(_0x13229d){try{jsonpatch[_0xabe3('0x2f')](_0x13229d,_0x2eb7f8,!![]);}catch(_0x3b7610){return BPromise[_0xabe3('0x30')](_0x3b7610);}return _0x13229d[_0xabe3('0x31')]();};}function saveUpdates(_0x239cff,_0x34b152){return function(_0x18e6d3){if(_0x18e6d3){return _0x18e6d3[_0xabe3('0x32')](_0x239cff)[_0xabe3('0x1f')](function(_0x562bba){return _0x562bba;});}return null;};}function removeEntity(_0x3d4d0a,_0x5ce402){return function(_0x25686b){if(_0x25686b){return _0x25686b[_0xabe3('0x33')]()[_0xabe3('0x1f')](function(){var _0x56ab68=_0x25686b[_0xabe3('0x34')]({'plain':!![]});var _0x52cc01=_0xabe3('0x35');return db[_0xabe3('0x36')][_0xabe3('0x33')]({'where':{'type':_0x52cc01,'resourceId':_0x56ab68['id']}})[_0xabe3('0x1f')](function(){return _0x25686b;});})[_0xabe3('0x1f')](function(){_0x3d4d0a[_0xabe3('0x29')](0xcc)[_0xabe3('0x2a')]();});}};}function handleEntityNotFound(_0x111a1d,_0x100500){return function(_0x43ca88){if(!_0x43ca88){_0x111a1d['sendStatus'](0x194);}return _0x43ca88;};}function handleError(_0x3f96a3,_0x5c932e){_0x5c932e=_0x5c932e||0x1f4;return function(_0x38ad98){logger[_0xabe3('0x25')](_0x38ad98[_0xabe3('0x37')]);if(_0x38ad98['name']){delete _0x38ad98[_0xabe3('0x38')];}_0x3f96a3[_0xabe3('0x29')](_0x5c932e)[_0xabe3('0x39')](_0x38ad98);};}exports[_0xabe3('0x3a')]=function(_0x22979d,_0x5a4be5){var _0x1d24df={'include':[{'model':db[_0xabe3('0x3b')],'as':_0xabe3('0x3c')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0xabe3('0x3d')],'as':_0xabe3('0x3e')}]},_0x28de32={},_0x31bb2d={'count':0x0,'rows':[]};var _0x585c69=_[_0xabe3('0x3f')](db[_0xabe3('0x40')]['rawAttributes'],function(_0x1d9c73){return{'name':_0x1d9c73[_0xabe3('0x41')],'type':_0x1d9c73[_0xabe3('0x42')][_0xabe3('0x43')]};});_0x28de32[_0xabe3('0x44')]=_['map'](_0x585c69,_0xabe3('0x38'));_0x28de32[_0xabe3('0x45')]=_[_0xabe3('0x46')](_0x22979d[_0xabe3('0x45')]);_0x28de32[_0xabe3('0x47')]=_[_0xabe3('0x48')](_0x28de32[_0xabe3('0x44')],_0x28de32['query']);_0x1d24df[_0xabe3('0x49')]=_[_0xabe3('0x48')](_0x28de32['model'],qs[_0xabe3('0x4a')](_0x22979d[_0xabe3('0x45')][_0xabe3('0x4a')]));_0x1d24df[_0xabe3('0x49')]=_0x1d24df[_0xabe3('0x49')][_0xabe3('0x4b')]?_0x1d24df[_0xabe3('0x49')]:_0x28de32[_0xabe3('0x44')];if(!_0x22979d[_0xabe3('0x45')][_0xabe3('0x4c')](_0xabe3('0x4d'))){_0x1d24df[_0xabe3('0x2d')]=qs[_0xabe3('0x2d')](_0x22979d['query']['limit']);_0x1d24df[_0xabe3('0x2c')]=qs[_0xabe3('0x2c')](_0x22979d[_0xabe3('0x45')][_0xabe3('0x2c')]);}_0x1d24df[_0xabe3('0x4e')]=qs[_0xabe3('0x4f')](_0x22979d[_0xabe3('0x45')]['sort']);_0x1d24df['where']=qs[_0xabe3('0x47')](_[_0xabe3('0x50')](_0x22979d[_0xabe3('0x45')],_0x28de32[_0xabe3('0x47')]));if(_0x22979d['query'][_0xabe3('0x51')]){_0x1d24df[_0xabe3('0x52')]=_['merge'](_0x1d24df[_0xabe3('0x52')],{'$or':_[_0xabe3('0x3f')](_0x585c69,function(_0xf70dcd){if(_0xf70dcd[_0xabe3('0x42')]!=='VIRTUAL'){var _0x10bd6a={};_0x10bd6a[_0xf70dcd[_0xabe3('0x38')]]={'$like':'%'+_0x22979d['query'][_0xabe3('0x51')]+'%'};return _0x10bd6a;}})});}_0x1d24df=_[_0xabe3('0x53')]({},_0x1d24df,_0x22979d[_0xabe3('0x54')]);var _0xfc43f6={'where':_0x1d24df['where']};return db['MailAccount'][_0xabe3('0x2b')](_0xfc43f6)[_0xabe3('0x1f')](function(_0xa588d1){_0x31bb2d[_0xabe3('0x2b')]=_0xa588d1;if(_0x22979d[_0xabe3('0x45')]['includeAll']){_0x1d24df['include']=[{'all':!![]}];}return db['MailAccount'][_0xabe3('0x55')](_0x1d24df);})[_0xabe3('0x1f')](function(_0x1ac0f2){_0x31bb2d[_0xabe3('0x56')]=_0x1ac0f2;return _0x31bb2d;})['then'](respondWithFilteredResult(_0x5a4be5,_0x1d24df))['catch'](handleError(_0x5a4be5,null));};exports[_0xabe3('0x57')]=function(_0x5a73c1,_0x2b2a9a){var _0x349840={'raw':![],'where':{'id':_0x5a73c1[_0xabe3('0x58')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0xabe3('0x59')],'as':_0xabe3('0x5a')},{'model':db[_0xabe3('0x3d')],'as':_0xabe3('0x3e')}]},_0x3b881a={};_0x3b881a[_0xabe3('0x44')]=_[_0xabe3('0x46')](db[_0xabe3('0x40')][_0xabe3('0x5b')]);_0x3b881a[_0xabe3('0x45')]=_[_0xabe3('0x46')](_0x5a73c1[_0xabe3('0x45')]);_0x3b881a['filters']=_[_0xabe3('0x48')](_0x3b881a[_0xabe3('0x44')],_0x3b881a[_0xabe3('0x45')]);_0x349840['attributes']=_[_0xabe3('0x48')](_0x3b881a['model'],qs[_0xabe3('0x4a')](_0x5a73c1[_0xabe3('0x45')][_0xabe3('0x4a')]));_0x349840['attributes']=_0x349840[_0xabe3('0x49')]['length']?_0x349840['attributes']:_0x3b881a['model'];if(_0x5a73c1[_0xabe3('0x45')]['includeAll']){_0x349840[_0xabe3('0x5c')]=[{'all':!![]}];}_0x349840=_[_0xabe3('0x53')]({},_0x349840,_0x5a73c1[_0xabe3('0x54')]);return db[_0xabe3('0x40')][_0xabe3('0x5d')](_0x349840)[_0xabe3('0x1f')](handleEntityNotFound(_0x2b2a9a,null))[_0xabe3('0x1f')](respondWithResult(_0x2b2a9a,null))[_0xabe3('0x28')](handleError(_0x2b2a9a,null));};exports['update']=function(_0x167730,_0x7af518){if(_0x167730[_0xabe3('0x5e')]['id']){delete _0x167730[_0xabe3('0x5e')]['id'];}return db[_0xabe3('0x40')]['find']({'where':{'id':_0x167730[_0xabe3('0x58')]['id']},'include':[{'model':db[_0xabe3('0x3b')],'as':_0xabe3('0x3c')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0xabe3('0x3d')],'as':_0xabe3('0x3e')}]})['then'](handleEntityNotFound(_0x7af518,null))[_0xabe3('0x1f')](saveUpdates(_0x167730[_0xabe3('0x5e')],null))['then'](function(_0x273398){if(_0x273398&&_0x167730[_0xabe3('0x5e')]['Imap']){return db['MailServerIn'][_0xabe3('0x32')](_0x167730[_0xabe3('0x5e')][_0xabe3('0x3c')],{'where':{'MailAccountId':_0x273398['id']}})[_0xabe3('0x1f')](function(){return _0x273398;});}return _0x273398;})[_0xabe3('0x1f')](function(_0x36b5bd){if(_0x36b5bd&&_0x167730['body'][_0xabe3('0x5a')]){return db[_0xabe3('0x59')][_0xabe3('0x32')](_0x167730[_0xabe3('0x5e')]['Smtp'],{'where':{'MailAccountId':_0x36b5bd['id']}})[_0xabe3('0x1f')](function(){return _0x36b5bd;});}return _0x36b5bd;})[_0xabe3('0x1f')](respondWithResult(_0x7af518,null))[_0xabe3('0x28')](handleError(_0x7af518,null));};exports[_0xabe3('0x5f')]=function(_0x349718,_0x5eade3){return db['MailAccount']['describe']()['then'](respondWithResult(_0x5eade3,null))['catch'](handleError(_0x5eade3,null));};exports[_0xabe3('0x60')]=function(_0x4c7153,_0x11e583,_0x483870){if(_0x4c7153[_0xabe3('0x5e')]['id']){delete _0x4c7153[_0xabe3('0x5e')]['id'];}return db[_0xabe3('0x40')][_0xabe3('0x5d')]({'where':{'id':_0x4c7153[_0xabe3('0x58')]['id']}})[_0xabe3('0x1f')](handleEntityNotFound(_0x11e583,null))[_0xabe3('0x1f')](function(_0x17b877){if(_0x17b877){_0x4c7153[_0xabe3('0x5e')][_0xabe3('0x61')]=_0x17b877['id'];return db[_0xabe3('0x62')][_0xabe3('0x63')](_0x4c7153[_0xabe3('0x5e')]);}})[_0xabe3('0x1f')](respondWithResult(_0x11e583,null))[_0xabe3('0x28')](handleError(_0x11e583,null));};exports[_0xabe3('0x64')]=function(_0x4a1c89,_0x4c9046,_0x45d832){var _0x3ee6e0={'raw':![],'where':{}};var _0xb49c75={};var _0x11c9b6={'count':0x0,'rows':[]};return db[_0xabe3('0x40')][_0xabe3('0x65')]({'where':{'id':_0x4a1c89[_0xabe3('0x58')]['id']}})[_0xabe3('0x1f')](handleEntityNotFound(_0x4c9046,null))[_0xabe3('0x1f')](function(_0x2c9454){if(_0x2c9454){_0xb49c75[_0xabe3('0x44')]=_[_0xabe3('0x46')](db[_0xabe3('0x62')][_0xabe3('0x5b')]);_0xb49c75[_0xabe3('0x45')]=_[_0xabe3('0x46')](_0x4a1c89[_0xabe3('0x45')]);_0xb49c75[_0xabe3('0x47')]=_[_0xabe3('0x48')](_0xb49c75[_0xabe3('0x44')],_0xb49c75[_0xabe3('0x45')]);_0x3ee6e0[_0xabe3('0x49')]=_[_0xabe3('0x48')](_0xb49c75[_0xabe3('0x44')],qs[_0xabe3('0x4a')](_0x4a1c89[_0xabe3('0x45')][_0xabe3('0x4a')]));_0x3ee6e0[_0xabe3('0x49')]=_0x3ee6e0[_0xabe3('0x49')]['length']?_0x3ee6e0['attributes']:_0xb49c75[_0xabe3('0x44')];if(!_0x4a1c89[_0xabe3('0x45')]['hasOwnProperty'](_0xabe3('0x4d'))){_0x3ee6e0[_0xabe3('0x2d')]=qs[_0xabe3('0x2d')](_0x4a1c89[_0xabe3('0x45')][_0xabe3('0x2d')]);_0x3ee6e0[_0xabe3('0x2c')]=qs[_0xabe3('0x2c')](_0x4a1c89[_0xabe3('0x45')][_0xabe3('0x2c')]);}_0x3ee6e0[_0xabe3('0x4e')]=qs['sort'](_0x4a1c89[_0xabe3('0x45')][_0xabe3('0x4f')]);_0x3ee6e0[_0xabe3('0x52')]=qs[_0xabe3('0x47')](_[_0xabe3('0x50')](_0x4a1c89['query'],_0xb49c75['filters']));_0x3ee6e0['where'][_0xabe3('0x61')]=_0x2c9454['id'];if(_0x4a1c89['query'][_0xabe3('0x51')]){_0x3ee6e0[_0xabe3('0x52')]=_[_0xabe3('0x53')](_0x3ee6e0[_0xabe3('0x52')],{'$or':_[_0xabe3('0x3f')](_0x3ee6e0['attributes'],function(_0x404c7a){var _0x40d2ef={};_0x40d2ef[_0x404c7a]={'$like':'%'+_0x4a1c89['query'][_0xabe3('0x51')]+'%'};return _0x40d2ef;})});}_0x3ee6e0=_['merge']({},_0x3ee6e0,_0x4a1c89['options']);return db['Disposition']['count']({'where':_0x3ee6e0[_0xabe3('0x52')]})[_0xabe3('0x1f')](function(_0x53e255){_0x11c9b6[_0xabe3('0x2b')]=_0x53e255;if(_0x4a1c89['query']['includeAll']){_0x3ee6e0['include']=[{'all':!![]}];}return db[_0xabe3('0x62')][_0xabe3('0x55')](_0x3ee6e0);})[_0xabe3('0x1f')](function(_0x51b9e7){_0x11c9b6[_0xabe3('0x56')]=_0x51b9e7;return _0x11c9b6;});}})[_0xabe3('0x1f')](respondWithFilteredResult(_0x4c9046,_0x3ee6e0))[_0xabe3('0x28')](handleError(_0x4c9046,null));};exports[_0xabe3('0x66')]=function(_0x2594ef,_0x28c047,_0x362d60){return db[_0xabe3('0x40')][_0xabe3('0x5d')]({'where':{'id':_0x2594ef[_0xabe3('0x58')]['id']}})[_0xabe3('0x1f')](handleEntityNotFound(_0x28c047,null))[_0xabe3('0x1f')](function(_0x4d1823){if(_0x4d1823){return _0x4d1823[_0xabe3('0x66')](_0x2594ef[_0xabe3('0x45')]['ids']);}})[_0xabe3('0x1f')](respondWithStatusCode(_0x28c047,null))['catch'](handleError(_0x28c047,null));};exports[_0xabe3('0x67')]=function(_0x1ec98a,_0x210942,_0x4d9edb){if(_0x1ec98a['body']['id']){delete _0x1ec98a[_0xabe3('0x5e')]['id'];}return db['MailAccount'][_0xabe3('0x5d')]({'where':{'id':_0x1ec98a[_0xabe3('0x58')]['id']}})['then'](handleEntityNotFound(_0x210942,null))[_0xabe3('0x1f')](function(_0x573276){if(_0x573276){_0x1ec98a[_0xabe3('0x5e')][_0xabe3('0x61')]=_0x573276['id'];return db['CannedAnswer'][_0xabe3('0x63')](_0x1ec98a[_0xabe3('0x5e')]);}})[_0xabe3('0x1f')](respondWithResult(_0x210942,null))[_0xabe3('0x28')](handleError(_0x210942,null));};exports[_0xabe3('0x68')]=function(_0x3f2d06,_0x372ba9,_0x48418d){var _0x425008={'raw':![],'where':{}};var _0x1ad66a={};var _0x4a0be6={'count':0x0,'rows':[]};return db[_0xabe3('0x40')]['findOne']({'where':{'id':_0x3f2d06[_0xabe3('0x58')]['id']}})[_0xabe3('0x1f')](handleEntityNotFound(_0x372ba9,null))[_0xabe3('0x1f')](function(_0x4745b9){if(_0x4745b9){_0x1ad66a[_0xabe3('0x44')]=_[_0xabe3('0x46')](db['CannedAnswer'][_0xabe3('0x5b')]);_0x1ad66a[_0xabe3('0x45')]=_['keys'](_0x3f2d06[_0xabe3('0x45')]);_0x1ad66a['filters']=_[_0xabe3('0x48')](_0x1ad66a['model'],_0x1ad66a[_0xabe3('0x45')]);_0x425008['attributes']=_['intersection'](_0x1ad66a[_0xabe3('0x44')],qs[_0xabe3('0x4a')](_0x3f2d06[_0xabe3('0x45')][_0xabe3('0x4a')]));_0x425008['attributes']=_0x425008['attributes'][_0xabe3('0x4b')]?_0x425008[_0xabe3('0x49')]:_0x1ad66a[_0xabe3('0x44')];if(!_0x3f2d06['query'][_0xabe3('0x4c')](_0xabe3('0x4d'))){_0x425008[_0xabe3('0x2d')]=qs[_0xabe3('0x2d')](_0x3f2d06[_0xabe3('0x45')]['limit']);_0x425008[_0xabe3('0x2c')]=qs[_0xabe3('0x2c')](_0x3f2d06[_0xabe3('0x45')][_0xabe3('0x2c')]);}_0x425008['order']=qs[_0xabe3('0x4f')](_0x3f2d06['query'][_0xabe3('0x4f')]);_0x425008[_0xabe3('0x52')]=qs['filters'](_[_0xabe3('0x50')](_0x3f2d06[_0xabe3('0x45')],_0x1ad66a[_0xabe3('0x47')]));_0x425008[_0xabe3('0x52')][_0xabe3('0x61')]=_0x4745b9['id'];if(_0x3f2d06['query'][_0xabe3('0x51')]){_0x425008[_0xabe3('0x52')]=_[_0xabe3('0x53')](_0x425008[_0xabe3('0x52')],{'$or':_[_0xabe3('0x3f')](_0x425008[_0xabe3('0x49')],function(_0x3c5279){var _0x1fc521={};_0x1fc521[_0x3c5279]={'$like':'%'+_0x3f2d06[_0xabe3('0x45')][_0xabe3('0x51')]+'%'};return _0x1fc521;})});}_0x425008=_[_0xabe3('0x53')]({},_0x425008,_0x3f2d06[_0xabe3('0x54')]);return db['CannedAnswer'][_0xabe3('0x2b')]({'where':_0x425008[_0xabe3('0x52')]})[_0xabe3('0x1f')](function(_0xa47119){_0x4a0be6['count']=_0xa47119;if(_0x3f2d06[_0xabe3('0x45')][_0xabe3('0x69')]){_0x425008[_0xabe3('0x5c')]=[{'all':!![]}];}return db[_0xabe3('0x6a')]['findAll'](_0x425008);})[_0xabe3('0x1f')](function(_0x5301cd){_0x4a0be6[_0xabe3('0x56')]=_0x5301cd;return _0x4a0be6;});}})['then'](respondWithFilteredResult(_0x372ba9,_0x425008))[_0xabe3('0x28')](handleError(_0x372ba9,null));};exports[_0xabe3('0x6b')]=function(_0x32091a,_0x410240,_0x28220b){return db[_0xabe3('0x40')][_0xabe3('0x5d')]({'where':{'id':_0x32091a['params']['id']}})['then'](handleEntityNotFound(_0x410240,null))[_0xabe3('0x1f')](function(_0x35d8e3){if(_0x35d8e3){return _0x35d8e3[_0xabe3('0x6b')](_0x32091a[_0xabe3('0x45')][_0xabe3('0x6c')]);}})['then'](respondWithStatusCode(_0x410240,null))[_0xabe3('0x28')](handleError(_0x410240,null));};exports[_0xabe3('0x63')]=function(_0x3d616d,_0x152d9a){var _0xb7e7ac={'name':_0x3d616d[_0xabe3('0x5e')][_0xabe3('0x38')],'key':_0x3d616d[_0xabe3('0x5e')][_0xabe3('0x43')],'email':_0x3d616d[_0xabe3('0x5e')][_0xabe3('0x6d')],'ListId':_0x3d616d['body'][_0xabe3('0x6e')],'active':!_['isNil'](_0x3d616d[_0xabe3('0x5e')][_0xabe3('0x6f')])?_0x3d616d[_0xabe3('0x5e')][_0xabe3('0x6f')]:!![],'description':_0x3d616d[_0xabe3('0x5e')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0xabe3('0x70')](_0x3d616d[_0xabe3('0x5e')]['cservice'])){if(_0x3d616d['body'][_0xabe3('0x71')]){_0xb7e7ac['Imap'][_0xabe3('0x72')]=_0xb7e7ac[_0xabe3('0x5a')][_0xabe3('0x72')]=_0x3d616d[_0xabe3('0x5e')]['cuser'];_0xb7e7ac[_0xabe3('0x3c')][_0xabe3('0x73')]=_0xb7e7ac[_0xabe3('0x5a')]['pass']=_0x3d616d[_0xabe3('0x5e')][_0xabe3('0x74')];}else{_0xb7e7ac['Imap'][_0xabe3('0x75')]=_0xb7e7ac[_0xabe3('0x5a')]['authentication']=![];}_0xb7e7ac[_0xabe3('0x3c')][_0xabe3('0x76')]=_0x3d616d[_0xabe3('0x5e')]['Imap'][_0xabe3('0x76')];_0xb7e7ac[_0xabe3('0x3c')][_0xabe3('0x77')]=_0x3d616d['body'][_0xabe3('0x3c')][_0xabe3('0x77')];_0xb7e7ac[_0xabe3('0x5a')][_0xabe3('0x76')]=_0x3d616d[_0xabe3('0x5e')]['Smtp']['host'];_0xb7e7ac['Smtp']['port']=_0x3d616d[_0xabe3('0x5e')][_0xabe3('0x5a')][_0xabe3('0x77')];}else{_0xb7e7ac[_0xabe3('0x3c')]['service']=_0xb7e7ac[_0xabe3('0x5a')][_0xabe3('0x78')]=_0x3d616d[_0xabe3('0x5e')][_0xabe3('0x79')];_0xb7e7ac[_0xabe3('0x3c')][_0xabe3('0x72')]=_0xb7e7ac[_0xabe3('0x5a')][_0xabe3('0x72')]=_0x3d616d[_0xabe3('0x5e')][_0xabe3('0x7a')];_0xb7e7ac[_0xabe3('0x3c')][_0xabe3('0x73')]=_0xb7e7ac[_0xabe3('0x5a')]['pass']=_0x3d616d[_0xabe3('0x5e')][_0xabe3('0x74')];}return db[_0xabe3('0x40')][_0xabe3('0x63')](_0xb7e7ac,{'include':[{'model':db[_0xabe3('0x59')],'as':_0xabe3('0x5a')},{'model':db[_0xabe3('0x3b')],'as':_0xabe3('0x3c')}]})[_0xabe3('0x1f')](function(_0xd60a1b){var _0x2ef793=_0x3d616d['user'][_0xabe3('0x34')]({'plain':!![]});if(!_0x2ef793)throw new Error(_0xabe3('0x7b'));if(_0x2ef793['role']===_0xabe3('0x72')){var _0x479fba=_0xd60a1b[_0xabe3('0x34')]({'plain':!![]});return db[_0xabe3('0x7c')][_0xabe3('0x5d')]({'where':{'name':_0xabe3('0x35'),'userProfileId':_0x2ef793[_0xabe3('0x7d')]},'raw':!![]})[_0xabe3('0x1f')](function(_0x4679ad){if(_0x4679ad&&_0x4679ad[_0xabe3('0x7e')]===0x0){return db[_0xabe3('0x36')][_0xabe3('0x63')]({'name':_0x479fba[_0xabe3('0x38')],'resourceId':_0x479fba['id'],'type':_0x4679ad['name'],'sectionId':_0x4679ad['id']},{})[_0xabe3('0x1f')](function(){return _0xd60a1b;});}else{return _0xd60a1b;}})[_0xabe3('0x28')](function(_0x43f79f){logger[_0xabe3('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43f79f);throw _0x43f79f;});}return _0xd60a1b;})[_0xabe3('0x1f')](respondWithResult(_0x152d9a,0xc9))[_0xabe3('0x28')](handleError(_0x152d9a,null));};exports[_0xabe3('0x7f')]=function(_0x48fe8e,_0x559372,_0x2032c5){return db[_0xabe3('0x40')][_0xabe3('0x65')]({'where':{'id':_0x48fe8e['params']['id']}})[_0xabe3('0x1f')](handleEntityNotFound(_0x559372,null))['then'](function(_0xdde1c0){if(_0xdde1c0){return _0xdde1c0[_0xabe3('0x7f')]();}return null;})['then'](respondWithResult(_0x559372,null))[_0xabe3('0x28')](handleError(_0x559372,null));};exports['addImap']=function(_0x4ad9d3,_0x55577b,_0x19eac2){if(_0x4ad9d3['body']['id']){delete _0x4ad9d3[_0xabe3('0x5e')]['id'];}return db[_0xabe3('0x40')][_0xabe3('0x5d')]({'where':{'id':_0x4ad9d3['params']['id']}})['then'](handleEntityNotFound(_0x55577b,null))[_0xabe3('0x1f')](function(_0x3e2f30){if(_0x3e2f30){_0x4ad9d3[_0xabe3('0x5e')][_0xabe3('0x61')]=_0x3e2f30['id'];return db['MailServerIn'][_0xabe3('0x63')](_0x4ad9d3['body']);}})[_0xabe3('0x1f')](respondWithResult(_0x55577b,null))[_0xabe3('0x28')](handleError(_0x55577b,null));};exports[_0xabe3('0x80')]=function(_0x3f5b91,_0x281b07,_0x19878d){return db[_0xabe3('0x40')][_0xabe3('0x65')]({'where':{'id':_0x3f5b91[_0xabe3('0x58')]['id']}})[_0xabe3('0x1f')](handleEntityNotFound(_0x281b07,null))[_0xabe3('0x1f')](function(_0x2cc081){if(_0x2cc081){return _0x2cc081[_0xabe3('0x81')](null);}return null;})[_0xabe3('0x1f')](respondWithStatusCode(_0x281b07,null))[_0xabe3('0x28')](handleError(_0x281b07,null));};exports[_0xabe3('0x82')]=function(_0x24695f,_0xd4fb8,_0x1704b2){return db[_0xabe3('0x40')][_0xabe3('0x65')]({'where':{'id':_0x24695f[_0xabe3('0x58')]['id']}})[_0xabe3('0x1f')](handleEntityNotFound(_0xd4fb8,null))['then'](function(_0x30d85a){if(_0x30d85a){return _0x30d85a[_0xabe3('0x82')]();}return null;})[_0xabe3('0x1f')](respondWithResult(_0xd4fb8,null))[_0xabe3('0x28')](handleError(_0xd4fb8,null));};exports['addSmtp']=function(_0x246d23,_0x468bfe,_0x29996b){if(_0x246d23['body']['id']){delete _0x246d23[_0xabe3('0x5e')]['id'];}return db['MailAccount'][_0xabe3('0x5d')]({'where':{'id':_0x246d23[_0xabe3('0x58')]['id']}})[_0xabe3('0x1f')](handleEntityNotFound(_0x468bfe,null))[_0xabe3('0x1f')](function(_0x522a04){if(_0x522a04){_0x246d23[_0xabe3('0x5e')][_0xabe3('0x61')]=_0x522a04['id'];return db[_0xabe3('0x59')][_0xabe3('0x63')](_0x246d23[_0xabe3('0x5e')]);}})[_0xabe3('0x1f')](respondWithResult(_0x468bfe,null))[_0xabe3('0x28')](handleError(_0x468bfe,null));};exports[_0xabe3('0x83')]=function(_0x156c6e,_0x56c1a3,_0x3ebcd6){return db[_0xabe3('0x40')][_0xabe3('0x65')]({'where':{'id':_0x156c6e[_0xabe3('0x58')]['id']}})[_0xabe3('0x1f')](handleEntityNotFound(_0x56c1a3,null))[_0xabe3('0x1f')](function(_0x507742){if(_0x507742){return _0x507742['setSmtp'](null);}return null;})[_0xabe3('0x1f')](respondWithStatusCode(_0x56c1a3,null))['catch'](handleError(_0x56c1a3,null));};exports['addInteraction']=function(_0x1a6779,_0x292523,_0x534b81){return db['MailInteraction'][_0xabe3('0x5d')]({'where':{'id':_0x1a6779[_0xabe3('0x58')]['id']}})[_0xabe3('0x1f')](handleEntityNotFound(_0x292523,null))['then'](function(_0x1cf414){if(_0x1cf414){return _0x1cf414['addInteraction'](_0x1a6779[_0xabe3('0x5e')][_0xabe3('0x6c')],_[_0xabe3('0x84')](_0x1a6779[_0xabe3('0x5e')],['ids','id'])||{});}})[_0xabe3('0x1f')](respondWithResult(_0x292523,null))[_0xabe3('0x28')](handleError(_0x292523,null));};exports[_0xabe3('0x85')]=function(_0x36dbec,_0x120dc4,_0x78608d){var _0x440be0={'raw':![],'where':{}};var _0x1844d1={};var _0x42902b={'count':0x0,'rows':[]};return db[_0xabe3('0x40')][_0xabe3('0x65')]({'where':{'id':_0x36dbec[_0xabe3('0x58')]['id']}})['then'](handleEntityNotFound(_0x120dc4,null))[_0xabe3('0x1f')](function(_0x15a872){if(_0x15a872){_0x1844d1[_0xabe3('0x44')]=_[_0xabe3('0x46')](db[_0xabe3('0x86')][_0xabe3('0x5b')]);_0x1844d1[_0xabe3('0x45')]=_[_0xabe3('0x46')](_0x36dbec[_0xabe3('0x45')]);_0x1844d1[_0xabe3('0x47')]=_[_0xabe3('0x48')](_0x1844d1[_0xabe3('0x44')],_0x1844d1[_0xabe3('0x45')]);_0x440be0[_0xabe3('0x49')]=_[_0xabe3('0x48')](_0x1844d1['model'],qs[_0xabe3('0x4a')](_0x36dbec[_0xabe3('0x45')][_0xabe3('0x4a')]));_0x440be0[_0xabe3('0x49')]=_0x440be0[_0xabe3('0x49')][_0xabe3('0x4b')]?_0x440be0['attributes']:_0x1844d1['model'];if(!_0x36dbec['query'][_0xabe3('0x4c')]('nolimit')){_0x440be0[_0xabe3('0x2d')]=qs[_0xabe3('0x2d')](_0x36dbec[_0xabe3('0x45')][_0xabe3('0x2d')]);_0x440be0[_0xabe3('0x2c')]=qs[_0xabe3('0x2c')](_0x36dbec[_0xabe3('0x45')][_0xabe3('0x2c')]);}_0x440be0[_0xabe3('0x4e')]=qs[_0xabe3('0x4f')](_0x36dbec['query'][_0xabe3('0x4f')]);_0x440be0[_0xabe3('0x52')]=qs['filters'](_[_0xabe3('0x50')](_0x36dbec[_0xabe3('0x45')],_0x1844d1['filters']));_0x440be0['where'][_0xabe3('0x61')]=_0x15a872['id'];if(_0x36dbec[_0xabe3('0x45')][_0xabe3('0x51')]){_0x440be0[_0xabe3('0x52')]=_['merge'](_0x440be0[_0xabe3('0x52')],{'$or':_[_0xabe3('0x3f')](_0x440be0[_0xabe3('0x49')],function(_0x34dead){var _0x5d8387={};_0x5d8387[_0x34dead]={'$like':'%'+_0x36dbec[_0xabe3('0x45')][_0xabe3('0x51')]+'%'};return _0x5d8387;})});}_0x440be0=_[_0xabe3('0x53')]({},_0x440be0,_0x36dbec[_0xabe3('0x54')]);return db[_0xabe3('0x86')][_0xabe3('0x2b')]({'where':_0x440be0[_0xabe3('0x52')]})[_0xabe3('0x1f')](function(_0x488c08){_0x42902b['count']=_0x488c08;if(_0x36dbec[_0xabe3('0x45')][_0xabe3('0x69')]){_0x440be0[_0xabe3('0x5c')]=[{'model':db[_0xabe3('0x87')],'as':_0xabe3('0x88'),'required':![]},{'model':db[_0xabe3('0x89')],'as':_0xabe3('0x8a'),'attributes':[_0xabe3('0x38'),_0xabe3('0x8b'),_0xabe3('0x8c')],'required':![]},{'model':db[_0xabe3('0x8d')],'as':'Tags','attributes':['id','name',_0xabe3('0x8e')],'where':_0x36dbec[_0xabe3('0x45')][_0xabe3('0x8f')]?{'id':_0x36dbec[_0xabe3('0x45')][_0xabe3('0x8f')]}:undefined,'required':_0x36dbec[_0xabe3('0x45')][_0xabe3('0x8f')]?!![]:![]}];}return db[_0xabe3('0x86')]['findAll'](_0x440be0);})[_0xabe3('0x1f')](function(_0x1a0be0){_0x42902b[_0xabe3('0x56')]=_0x1a0be0;return _0x42902b;});}})[_0xabe3('0x1f')](respondWithFilteredResult(_0x120dc4,_0x440be0))[_0xabe3('0x28')](handleError(_0x120dc4,null));};exports[_0xabe3('0x90')]=function(_0x15281f,_0x5c3542,_0x358f82){return db[_0xabe3('0x40')][_0xabe3('0x65')]({'where':{'id':_0x15281f[_0xabe3('0x58')]['id']}})[_0xabe3('0x1f')](handleEntityNotFound(_0x5c3542,null))['then'](function(_0x3c24a8){if(_0x3c24a8){return db[_0xabe3('0x91')][_0xabe3('0x92')](function(_0x2c364b){return db[_0xabe3('0x93')][_0xabe3('0x33')]({'where':{'MailAccountId':_0x15281f[_0xabe3('0x58')]['id']},'transaction':_0x2c364b})[_0xabe3('0x1f')](function(_0x63c723){var _0x224bb2=_['map'](_0x15281f[_0xabe3('0x5e')],function(_0x3a75a5){_0x3a75a5[_0xabe3('0x61')]=_0x15281f['params']['id'];return _0x3a75a5;});return db['MailApplication']['bulkCreate'](_0x224bb2,{'transaction':_0x2c364b});});})[_0xabe3('0x1f')](function(){return db['MailApplication'][_0xabe3('0x94')]({'where':{'MailAccountId':_0x15281f[_0xabe3('0x58')]['id']},'order':_0xabe3('0x95')});});}})['then'](respondWithResult(_0x5c3542,null))[_0xabe3('0x28')](handleError(_0x5c3542,null));};exports['getApplications']=function(_0x3a2d18,_0x296074,_0x505400){var _0x517ef6={};var _0x1574a5={};var _0x4d7d2c;var _0x3e9fc8;return db[_0xabe3('0x40')][_0xabe3('0x65')]({'where':{'id':_0x3a2d18[_0xabe3('0x58')]['id']}})['then'](handleEntityNotFound(_0x296074,null))[_0xabe3('0x1f')](function(_0x37bd4c){if(_0x37bd4c){_0x4d7d2c=_0x37bd4c;_0x1574a5[_0xabe3('0x44')]=_[_0xabe3('0x46')](db[_0xabe3('0x93')][_0xabe3('0x5b')]);_0x1574a5[_0xabe3('0x45')]=_[_0xabe3('0x46')](_0x3a2d18[_0xabe3('0x45')]);_0x1574a5[_0xabe3('0x47')]=_['intersection'](_0x1574a5[_0xabe3('0x44')],_0x1574a5[_0xabe3('0x45')]);_0x517ef6[_0xabe3('0x49')]=_[_0xabe3('0x48')](_0x1574a5[_0xabe3('0x44')],qs['fields'](_0x3a2d18[_0xabe3('0x45')][_0xabe3('0x4a')]));_0x517ef6[_0xabe3('0x49')]=_0x517ef6[_0xabe3('0x49')]['length']?_0x517ef6[_0xabe3('0x49')]:_0x1574a5[_0xabe3('0x44')];_0x517ef6[_0xabe3('0x4e')]=qs['sort'](_0x3a2d18[_0xabe3('0x45')][_0xabe3('0x4f')]);_0x517ef6[_0xabe3('0x52')]=qs['filters'](_[_0xabe3('0x50')](_0x3a2d18['query'],_0x1574a5[_0xabe3('0x47')]));if(_0x3a2d18[_0xabe3('0x45')][_0xabe3('0x51')]){_0x517ef6[_0xabe3('0x52')]=_[_0xabe3('0x53')](_0x517ef6[_0xabe3('0x52')],{'$or':_[_0xabe3('0x3f')](_0x517ef6[_0xabe3('0x49')],function(_0x15b3ec){var _0x23d525={};_0x23d525[_0x15b3ec]={'$like':'%'+_0x3a2d18[_0xabe3('0x45')][_0xabe3('0x51')]+'%'};return _0x23d525;})});}_0x517ef6=_['merge']({},_0x517ef6,_0x3a2d18[_0xabe3('0x54')]);return _0x4d7d2c[_0xabe3('0x96')](_0x517ef6);}})[_0xabe3('0x1f')](function(_0x2a27e1){if(_0x2a27e1){_0x3e9fc8=_0x2a27e1['length'];if(!_0x3a2d18[_0xabe3('0x45')]['hasOwnProperty'](_0xabe3('0x4d'))){_0x517ef6['limit']=qs[_0xabe3('0x2d')](_0x3a2d18[_0xabe3('0x45')][_0xabe3('0x2d')]);_0x517ef6[_0xabe3('0x2c')]=qs[_0xabe3('0x2c')](_0x3a2d18[_0xabe3('0x45')][_0xabe3('0x2c')]);}return _0x4d7d2c[_0xabe3('0x96')](_0x517ef6);}})[_0xabe3('0x1f')](function(_0x29e0ca){if(_0x29e0ca){return _0x29e0ca?{'count':_0x3e9fc8,'rows':_0x29e0ca}:null;}})[_0xabe3('0x1f')](respondWithResult(_0x296074,null))[_0xabe3('0x28')](handleError(_0x296074,null));};exports['getMessages']=function(_0x1b0c28,_0x546eec,_0x5145b4){var _0x3506af={'raw':!![],'where':{}};var _0x37d998={};var _0x2084f2={'count':0x0,'rows':[]};return db[_0xabe3('0x40')][_0xabe3('0x65')]({'where':{'id':_0x1b0c28['params']['id']}})['then'](handleEntityNotFound(_0x546eec,null))[_0xabe3('0x1f')](function(_0x3951e0){if(_0x3951e0){_0x37d998[_0xabe3('0x44')]=_[_0xabe3('0x46')](db[_0xabe3('0x97')][_0xabe3('0x5b')]);_0x37d998[_0xabe3('0x45')]=_[_0xabe3('0x46')](_0x1b0c28['query']);_0x37d998[_0xabe3('0x47')]=_[_0xabe3('0x48')](_0x37d998['model'],_0x37d998[_0xabe3('0x45')]);_0x3506af[_0xabe3('0x49')]=_[_0xabe3('0x48')](_0x37d998[_0xabe3('0x44')],qs[_0xabe3('0x4a')](_0x1b0c28[_0xabe3('0x45')][_0xabe3('0x4a')]));_0x3506af[_0xabe3('0x49')]=_0x3506af[_0xabe3('0x49')][_0xabe3('0x4b')]?_0x3506af[_0xabe3('0x49')]:_0x37d998['model'];if(!_0x1b0c28[_0xabe3('0x45')]['hasOwnProperty'](_0xabe3('0x4d'))){_0x3506af[_0xabe3('0x2d')]=qs['limit'](_0x1b0c28[_0xabe3('0x45')][_0xabe3('0x2d')]);_0x3506af[_0xabe3('0x2c')]=qs[_0xabe3('0x2c')](_0x1b0c28[_0xabe3('0x45')][_0xabe3('0x2c')]);}_0x3506af[_0xabe3('0x4e')]=qs[_0xabe3('0x4f')](_0x1b0c28[_0xabe3('0x45')][_0xabe3('0x4f')]);_0x3506af[_0xabe3('0x52')]=qs[_0xabe3('0x47')](_[_0xabe3('0x50')](_0x1b0c28[_0xabe3('0x45')],_0x37d998[_0xabe3('0x47')]));_0x3506af[_0xabe3('0x52')][_0xabe3('0x61')]=_0x3951e0['id'];if(_0x1b0c28[_0xabe3('0x45')][_0xabe3('0x51')]){_0x3506af[_0xabe3('0x52')]=_[_0xabe3('0x53')](_0x3506af[_0xabe3('0x52')],{'$or':_['map'](_0x3506af[_0xabe3('0x49')],function(_0x27626e){var _0x35a360={};_0x35a360[_0x27626e]={'$like':'%'+_0x1b0c28[_0xabe3('0x45')][_0xabe3('0x51')]+'%'};return _0x35a360;})});}if(_0x1b0c28[_0xabe3('0x45')]['$gte']){var _0x51b577=_0x1b0c28['query'][_0xabe3('0x98')][_0xabe3('0x99')](',');var _0x41ea9d={};_0x41ea9d[_0x51b577[0x0]]={'$gte':moment(_0x51b577[0x1])[_0xabe3('0x9a')](_0xabe3('0x9b'))};_0x3506af[_0xabe3('0x52')]=_[_0xabe3('0x53')](_0x3506af[_0xabe3('0x52')],_0x41ea9d);}_0x3506af=_[_0xabe3('0x53')]({},_0x3506af,_0x1b0c28['options']);return db['MailMessage']['count']({'where':_0x3506af[_0xabe3('0x52')]})['then'](function(_0x4c450c){_0x2084f2[_0xabe3('0x2b')]=_0x4c450c;if(_0x1b0c28[_0xabe3('0x45')][_0xabe3('0x69')]){_0x3506af[_0xabe3('0x5c')]=[{'all':!![]}];}return db[_0xabe3('0x97')][_0xabe3('0x55')](_0x3506af);})[_0xabe3('0x1f')](function(_0x2e07b3){_0x2084f2[_0xabe3('0x56')]=_0x2e07b3;return _0x2084f2;});}})['then'](respondWithFilteredResult(_0x546eec,_0x3506af))[_0xabe3('0x28')](handleError(_0x546eec,null));};exports[_0xabe3('0x39')]=function(_0xf8798f,_0x506385,_0x217492){var _0x42204c,_0x581eac={},_0x9bf18b;if(_0xf8798f['body']['to']){_0x9bf18b=_0xf8798f['body']['to'][_0xabe3('0x99')](',')[0x0];}return db[_0xabe3('0x40')]['find']({'where':{'id':_0xf8798f[_0xabe3('0x58')]['id']},'include':[{'model':db[_0xabe3('0x9c')],'as':_0xabe3('0x9d'),'include':[{'model':db[_0xabe3('0x87')],'as':'Contacts','where':{'email':_0x9bf18b},'limit':0x1,'order':[['updatedAt',_0xabe3('0x9e')]]}]},{'model':db[_0xabe3('0x59')],'as':_0xabe3('0x5a'),'raw':!![]}]})['then'](handleEntityNotFound(_0x506385,null))['then'](function(_0x405eb3){if(_0x405eb3){_0x42204c=_0x405eb3;if(_0x405eb3[_0xabe3('0x5a')]){if(_['isNil'](_0xf8798f['body'][_0xabe3('0x9f')])){_0xf8798f[_0xabe3('0x5e')]['from']=util[_0xabe3('0x9a')](_0xabe3('0xa0'),_0x405eb3[_0xabe3('0x38')],_0x405eb3[_0xabe3('0x6d')]||_0x405eb3[_0xabe3('0x5a')]['user']);}if(_0xf8798f[_0xabe3('0x5e')][_0xabe3('0xa1')]&&_0xf8798f[_0xabe3('0x5e')][_0xabe3('0xa1')][_0xabe3('0x4b')]){for(var _0x49b277=0x0;_0x49b277<_0xf8798f[_0xabe3('0x5e')]['attachments'][_0xabe3('0x4b')];_0x49b277+=0x1){_0xf8798f[_0xabe3('0x5e')][_0xabe3('0xa1')][_0x49b277]={'filename':_0xf8798f[_0xabe3('0x5e')][_0xabe3('0xa1')][_0x49b277][_0xabe3('0x38')],'path':path[_0xabe3('0xa2')](config['root'],'server/files/attachments',_0xf8798f[_0xabe3('0x5e')]['attachments'][_0x49b277]['basename'])};}}var _0x3e27e0={'tls':{'rejectUnauthorized':![]}};if(_[_0xabe3('0x70')](_0x405eb3[_0xabe3('0x5a')][_0xabe3('0x78')])){if(_0x405eb3[_0xabe3('0x5a')][_0xabe3('0x75')]){_0x3e27e0[_0xabe3('0xa3')]={'user':_0x405eb3[_0xabe3('0x5a')][_0xabe3('0x72')],'pass':_0x405eb3[_0xabe3('0x5a')][_0xabe3('0xa4')]};}_0x3e27e0[_0xabe3('0x76')]=_0x405eb3['Smtp'][_0xabe3('0x76')];_0x3e27e0[_0xabe3('0x77')]=_0x405eb3[_0xabe3('0x5a')][_0xabe3('0x77')];_0x3e27e0[_0xabe3('0xa5')]=_0x405eb3['Smtp']['secure'];}else{_0x3e27e0[_0xabe3('0x78')]=_0x405eb3[_0xabe3('0x5a')][_0xabe3('0x78')];_0x3e27e0['auth']={'user':_0x405eb3[_0xabe3('0x5a')][_0xabe3('0x72')],'pass':_0x405eb3[_0xabe3('0x5a')][_0xabe3('0xa4')]};}return respondWithRpcPromise('SendMail',_0xabe3('0xa6'),{'account':_0x3e27e0,'message':_0xf8798f['body']});}else{throw new Error(_0xabe3('0xa7'));}}})['then'](function(_0x55bbe9){if(_0x55bbe9){_0x581eac=_0x55bbe9;if(_0x42204c[_0xabe3('0x9d')]){if(_0x42204c[_0xabe3('0x9d')][_0xabe3('0xa8')][_0xabe3('0x4b')]){return _0x42204c['List'][_0xabe3('0xa8')][0x0];}else{return db['CmContact'][_0xabe3('0x63')](_[_0xabe3('0x16')](_0xf8798f['body'],{'firstName':_0xf8798f['body']['to'],'email':_0xf8798f[_0xabe3('0x5e')]['to'],'phone':_0xf8798f['body']['to'],'ListId':_0x42204c[_0xabe3('0x6e')]}));}}else{throw new Error(_0xabe3('0xa7'));}}})[_0xabe3('0x1f')](function(_0x598c10){if(_0x598c10){var _0x5c4dd6={'UserId':_0xf8798f[_0xabe3('0x72')]['id'],'ContactId':_0x598c10['id'],'MailAccountId':_0x42204c['id'],'inReplyTo':_0x581eac[_0xabe3('0xa9')],'to':_0xf8798f['body'][_0xabe3('0x9f')],'cc':_0xf8798f[_0xabe3('0x5e')]['cc'],'subject':_0xf8798f[_0xabe3('0x5e')][_0xabe3('0xaa')],'attach':_0xf8798f[_0xabe3('0x5e')][_0xabe3('0xab')],'firstMsgDirection':_0xabe3('0xac'),'lastMsgAt':moment()[_0xabe3('0x9a')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','lastMsgBody':_0xf8798f[_0xabe3('0x5e')][_0xabe3('0x5e')],'Messages':[_['merge'](_0xf8798f[_0xabe3('0x5e')],{'messageId':_0x581eac['messageId'],'sentAt':moment()[_0xabe3('0x9a')](_0xabe3('0x9b')),'read':!![],'MailAccountId':_0x42204c['id'],'UserId':_0xf8798f[_0xabe3('0x72')]['id'],'ContactId':_0x598c10['id']})]};if(_0xf8798f[_0xabe3('0x5e')]['Interaction']){_0x5c4dd6=_['merge'](_0x5c4dd6,_0xf8798f[_0xabe3('0x5e')][_0xabe3('0xad')]);}return db['MailInteraction'][_0xabe3('0x63')](_0x5c4dd6,{'include':[{'model':db[_0xabe3('0x97')],'as':'Messages'}]});}})[_0xabe3('0x1f')](respondWithResult(_0x506385,null))[_0xabe3('0x28')](handleError(_0x506385,null));};exports['verifySmtp']=function(_0x45e32f,_0x8991de,_0xbc3af0){return db[_0xabe3('0x40')][_0xabe3('0x5d')]({'where':{'id':_0x45e32f[_0xabe3('0x58')]['id']},'include':[{'model':db[_0xabe3('0x59')],'as':'Smtp','raw':!![]}]})[_0xabe3('0x1f')](handleEntityNotFound(_0x8991de,null))[_0xabe3('0x1f')](function(_0x22ffb9){if(_0x22ffb9&&_0x22ffb9['Smtp']){var _0x3df1cb={'id':_0x22ffb9['id'],'tls':{'rejectUnauthorized':![]}};if(_0x22ffb9[_0xabe3('0x5a')][_0xabe3('0x78')]){_0x3df1cb[_0xabe3('0x78')]=_0x22ffb9[_0xabe3('0x5a')][_0xabe3('0x78')];}else{_0x3df1cb[_0xabe3('0x76')]=_0x22ffb9['Smtp'][_0xabe3('0x76')];_0x3df1cb['port']=_0x22ffb9[_0xabe3('0x5a')]['port'];_0x3df1cb[_0xabe3('0xa5')]=_0x22ffb9[_0xabe3('0x5a')][_0xabe3('0xa5')];}if(_0x22ffb9[_0xabe3('0x5a')][_0xabe3('0x75')]){_0x3df1cb[_0xabe3('0xa3')]={'user':_0x22ffb9['Smtp'][_0xabe3('0x72')],'pass':_0x22ffb9[_0xabe3('0x5a')]['pass']};}return respondWithRpcPromise(_0xabe3('0xae'),_0xabe3('0xaf'),{'account':_0x3df1cb});}})['then'](respondWithResult(_0x8991de,null))[_0xabe3('0x28')](handleError(_0x8991de,null));};exports[_0xabe3('0x33')]=function(_0x1657fa,_0x4cbb40){return db[_0xabe3('0x40')][_0xabe3('0x5d')]({'where':{'id':_0x1657fa['params']['id']}})['then'](handleEntityNotFound(_0x4cbb40,null))['then'](function(_0x19dbf7){if(_0x19dbf7&&_0x19dbf7['service']){throw new db[(_0xabe3('0x1b'))]['ValidationError'](_0xabe3('0xb0'));}return _0x19dbf7;})[_0xabe3('0x1f')](removeEntity(_0x4cbb40,null))[_0xabe3('0x28')](handleError(_0x4cbb40,null));};exports[_0xabe3('0xb1')]=function(_0x16f65c,_0x9dcf5b,_0xdaf78b){return db[_0xabe3('0x40')][_0xabe3('0x5d')]({'where':{'id':_0x16f65c[_0xabe3('0x58')]['id']}})[_0xabe3('0x1f')](handleEntityNotFound(_0x9dcf5b,null))['then'](function(_0x3591e4){if(_0x3591e4){return _0x3591e4['addAgents'](_0x16f65c[_0xabe3('0x5e')][_0xabe3('0x6c')],_[_0xabe3('0x84')](_0x16f65c[_0xabe3('0x5e')],[_0xabe3('0x6c'),'id'])||{})['spread'](function(_0xfee4c0){for(var _0x245805=0x0;_0x245805<_0x16f65c[_0xabe3('0x5e')][_0xabe3('0x6c')][_0xabe3('0x4b')];_0x245805+=0x1){socket[_0xabe3('0xb2')]('userMailAccount:save',{'UserId':_0x16f65c[_0xabe3('0x5e')]['ids'][_0x245805],'MailAccountId':_0x16f65c[_0xabe3('0x58')]['id']});}return _0xfee4c0;});}})[_0xabe3('0x1f')](respondWithResult(_0x9dcf5b,null))[_0xabe3('0x28')](handleError(_0x9dcf5b,null));};exports[_0xabe3('0xb3')]=function(_0x3c7ccc,_0x5ecb50,_0x53af8d){return db[_0xabe3('0x40')][_0xabe3('0x5d')]({'where':{'id':_0x3c7ccc[_0xabe3('0x58')]['id']}})[_0xabe3('0x1f')](handleEntityNotFound(_0x5ecb50,null))[_0xabe3('0x1f')](function(_0x2fb26b){if(_0x2fb26b){return _0x2fb26b[_0xabe3('0xb3')](_0x3c7ccc[_0xabe3('0x45')][_0xabe3('0x6c')])[_0xabe3('0x1f')](function(){if(_[_0xabe3('0xb4')](_0x3c7ccc[_0xabe3('0x45')][_0xabe3('0x6c')])){for(var _0x563d65=0x0;_0x563d65<_0x3c7ccc['query'][_0xabe3('0x6c')]['length'];_0x563d65+=0x1){socket[_0xabe3('0xb2')]('userMailAccount:remove',{'UserId':Number(_0x3c7ccc[_0xabe3('0x45')][_0xabe3('0x6c')][_0x563d65]),'MailAccountId':Number(_0x3c7ccc[_0xabe3('0x58')]['id'])});}}else{socket[_0xabe3('0xb2')](_0xabe3('0xb5'),{'UserId':Number(_0x3c7ccc[_0xabe3('0x45')][_0xabe3('0x6c')]),'MailAccountId':Number(_0x3c7ccc[_0xabe3('0x58')]['id'])});}});}})[_0xabe3('0x1f')](respondWithStatusCode(_0x5ecb50,null))['catch'](handleError(_0x5ecb50,null));};exports[_0xabe3('0xb6')]=function(_0x3470f9,_0x19512e,_0x2675c8){var _0x5e21cd={};var _0x3f7992={};var _0x430b9f;var _0x4dc0e9;return db[_0xabe3('0x40')][_0xabe3('0x65')]({'where':{'id':_0x3470f9['params']['id']}})[_0xabe3('0x1f')](handleEntityNotFound(_0x19512e,null))[_0xabe3('0x1f')](function(_0x244da8){if(_0x244da8){_0x430b9f=_0x244da8;_0x3f7992[_0xabe3('0x44')]=_[_0xabe3('0x46')](db[_0xabe3('0x89')][_0xabe3('0x5b')]);_0x3f7992[_0xabe3('0x45')]=_['keys'](_0x3470f9[_0xabe3('0x45')]);_0x3f7992['filters']=_[_0xabe3('0x48')](_0x3f7992[_0xabe3('0x44')],_0x3f7992['query']);_0x5e21cd[_0xabe3('0x49')]=_[_0xabe3('0x48')](_0x3f7992[_0xabe3('0x44')],qs[_0xabe3('0x4a')](_0x3470f9[_0xabe3('0x45')][_0xabe3('0x4a')]));_0x5e21cd[_0xabe3('0x49')]=_0x5e21cd[_0xabe3('0x49')][_0xabe3('0x4b')]?_0x5e21cd[_0xabe3('0x49')]:_0x3f7992[_0xabe3('0x44')];_0x5e21cd[_0xabe3('0x4e')]=qs[_0xabe3('0x4f')](_0x3470f9[_0xabe3('0x45')][_0xabe3('0x4f')]);_0x5e21cd[_0xabe3('0x52')]=qs[_0xabe3('0x47')](_['pick'](_0x3470f9['query'],_0x3f7992[_0xabe3('0x47')]));if(_0x3470f9[_0xabe3('0x45')][_0xabe3('0x51')]){_0x5e21cd['where']=_[_0xabe3('0x53')](_0x5e21cd[_0xabe3('0x52')],{'$or':_[_0xabe3('0x3f')](_0x5e21cd[_0xabe3('0x49')],function(_0x4fc624){var _0x56df94={};_0x56df94[_0x4fc624]={'$like':'%'+_0x3470f9[_0xabe3('0x45')][_0xabe3('0x51')]+'%'};return _0x56df94;})});}_0x5e21cd=_[_0xabe3('0x53')]({},_0x5e21cd,_0x3470f9[_0xabe3('0x54')]);return _0x430b9f[_0xabe3('0xb6')](_0x5e21cd);}})[_0xabe3('0x1f')](function(_0x2be8ba){if(_0x2be8ba){_0x4dc0e9=_0x2be8ba['length'];if(!_0x3470f9['query'][_0xabe3('0x4c')](_0xabe3('0x4d'))){_0x5e21cd[_0xabe3('0x2d')]=qs[_0xabe3('0x2d')](_0x3470f9[_0xabe3('0x45')]['limit']);_0x5e21cd['offset']=qs['offset'](_0x3470f9['query'][_0xabe3('0x2c')]);}return _0x430b9f[_0xabe3('0xb6')](_0x5e21cd);}})[_0xabe3('0x1f')](function(_0x467597){if(_0x467597){return _0x467597?{'count':_0x4dc0e9,'rows':_0x467597}:null;}})[_0xabe3('0x1f')](respondWithResult(_0x19512e,null))[_0xabe3('0x28')](handleError(_0x19512e,null));}; \ No newline at end of file +var _0xbf95=['offset','limit','set','reject','update','destroy','UserProfileResource','sendStatus','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','rawAttributes','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','MailAccount','count','includeAll','include','findAll','rows','show','params','find','body','describe','addDisposition','Disposition','create','getDispositions','findOne','MailAccountId','removeDispositions','ids','addAnswer','getAnswers','pick','options','CannedAnswer','removeAnswers','key','isNil','active','description','cservice','cauthentication','user','cuser','password','pass','authentication','host','port','service','cpassword','get','UserProfileSection','MailAccounts','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','nolimit','CmContact','Owner','fullname','Tag','color','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','priority','getApplications','getMessages','MailMessage','split','format','CmList','Contacts','from','%s\x20<%s>','attachments','join','root','server/files/attachments','auth','secure','SendMail','sendMail','List\x20not\x20found','List','messageId','YYYY-MM-DD\x20HH:mm:ss','Interaction','verifySmtp','VerifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','User','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','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','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','json'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0xbf95,0x148));var _0x5bf9=function(_0x273237,_0xe5cc74){_0x273237=_0x273237-0x0;var _0x461bab=_0xbf95[_0x273237];return _0x461bab;};'use strict';var pdf=require(_0x5bf9('0x0'));var emlformat=require(_0x5bf9('0x1'));var rimraf=require(_0x5bf9('0x2'));var zipdir=require(_0x5bf9('0x3'));var jsonpatch=require(_0x5bf9('0x4'));var rp=require(_0x5bf9('0x5'));var moment=require(_0x5bf9('0x6'));var BPromise=require(_0x5bf9('0x7'));var Mustache=require(_0x5bf9('0x8'));var util=require(_0x5bf9('0x9'));var path=require(_0x5bf9('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5bf9('0xb'));var fs=require('fs');var _=require(_0x5bf9('0xc'));var squel=require(_0x5bf9('0xd'));var crypto=require(_0x5bf9('0xe'));var jsforce=require(_0x5bf9('0xf'));var deskjs=require(_0x5bf9('0x10'));var toCsv=require(_0x5bf9('0x11'));var querystring=require(_0x5bf9('0x12'));var Papa=require(_0x5bf9('0x13'));var Redis=require(_0x5bf9('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x5bf9('0x15'));var as=require(_0x5bf9('0x16'));var hardwareService=require(_0x5bf9('0x17'));var logger=require(_0x5bf9('0x18'))(_0x5bf9('0x19'));var utils=require(_0x5bf9('0x1a'));var config=require(_0x5bf9('0x1b'));var db=require(_0x5bf9('0x1c'))['db'];config[_0x5bf9('0x1d')]=_[_0x5bf9('0x1e')](config[_0x5bf9('0x1d')],{'host':_0x5bf9('0x1f'),'port':0x18eb});var socket=require(_0x5bf9('0x20'))(new Redis(config['redis']));require(_0x5bf9('0x21'))['register'](socket);var jayson=require(_0x5bf9('0x22'));var client=jayson['client']['http']({'port':0x232b});function checkPasswordPattern(_0x236aa0,_0x1abf5d,_0x50d810){if(_0x50d810){var _0x436db3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x436db3[_0x5bf9('0x23')](_0x1abf5d)){return _0x236aa0;}else{throw new db[(_0x5bf9('0x24'))][(_0x5bf9('0x25'))](_0x5bf9('0x26'));}}else{return _0x236aa0;}}function respondWithRpcPromise(_0x1b28bc,_0x146c32,_0x2b8d26,_0x2da7a4){return new BPromise(function(_0x21a60a,_0x109177){var _0x1b4cf0=_0x2da7a4||client;return _0x1b4cf0[_0x5bf9('0x27')](_0x1b28bc,_0x2b8d26)[_0x5bf9('0x28')](function(_0x5f1910){logger[_0x5bf9('0x29')](_0x5bf9('0x2a'),_0x146c32,_0x5bf9('0x2b'));logger[_0x5bf9('0x2c')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x146c32,_0x5bf9('0x2b'),JSON[_0x5bf9('0x2d')](_0x5f1910));if(_0x5f1910[_0x5bf9('0x2e')]){if(_0x5f1910[_0x5bf9('0x2e')][_0x5bf9('0x2f')]===0x1f4){logger[_0x5bf9('0x2e')](_0x5bf9('0x2a'),_0x146c32,_0x5f1910['error'][_0x5bf9('0x30')]);return _0x109177(_0x5f1910[_0x5bf9('0x2e')][_0x5bf9('0x30')]);}logger['error'](_0x5bf9('0x2a'),_0x146c32,_0x5f1910[_0x5bf9('0x2e')][_0x5bf9('0x30')]);return _0x21a60a(_0x5f1910[_0x5bf9('0x2e')][_0x5bf9('0x30')]);}else{logger[_0x5bf9('0x29')](_0x5bf9('0x2a'),_0x146c32,_0x5bf9('0x2b'));_0x21a60a(_0x5f1910[_0x5bf9('0x31')]['message']);}})[_0x5bf9('0x32')](function(_0x592971){logger[_0x5bf9('0x2e')](_0x5bf9('0x2a'),_0x146c32,_0x592971);_0x109177(_0x592971);});});}function respondWithStatusCode(_0x5282b9,_0x4f194c){_0x4f194c=_0x4f194c||0xcc;return function(_0x5c713f){if(_0x5c713f){return _0x5282b9['sendStatus'](_0x4f194c);}return _0x5282b9[_0x5bf9('0x33')](_0x4f194c)[_0x5bf9('0x34')]();};}function respondWithResult(_0x18554d,_0x462d05){_0x462d05=_0x462d05||0xc8;return function(_0x5b1329){if(_0x5b1329){return _0x18554d[_0x5bf9('0x33')](_0x462d05)[_0x5bf9('0x35')](_0x5b1329);}};}function respondWithFilteredResult(_0x35054c,_0xf39fef){return function(_0x359045){if(_0x359045){var _0x2b91c1=_0x359045['count'],_0x6b5f7c=_0xf39fef[_0x5bf9('0x36')],_0x4a4a84=_0xf39fef[_0x5bf9('0x36')]+_0xf39fef[_0x5bf9('0x37')],_0x1c1e63;if(_0x4a4a84>=_0x2b91c1){_0x4a4a84=_0x2b91c1;_0x1c1e63=0xc8;}else{_0x1c1e63=0xce;}_0x35054c[_0x5bf9('0x33')](_0x1c1e63);return _0x35054c[_0x5bf9('0x38')]('Content-Range',_0x6b5f7c+'-'+_0x4a4a84+'/'+_0x2b91c1)[_0x5bf9('0x35')](_0x359045);}return null;};}function patchUpdates(_0x36b023){return function(_0x2e5ee8){try{jsonpatch['apply'](_0x2e5ee8,_0x36b023,!![]);}catch(_0x4bdc43){return BPromise[_0x5bf9('0x39')](_0x4bdc43);}return _0x2e5ee8['save']();};}function saveUpdates(_0x518557,_0x1d054b){return function(_0xdf17c2){if(_0xdf17c2){return _0xdf17c2[_0x5bf9('0x3a')](_0x518557)[_0x5bf9('0x28')](function(_0x59e4bb){return _0x59e4bb;});}return null;};}function removeEntity(_0x58dfc7,_0x49c433){return function(_0x334e46){if(_0x334e46){return _0x334e46[_0x5bf9('0x3b')]()[_0x5bf9('0x28')](function(){var _0x22e5ed=_0x334e46['get']({'plain':!![]});var _0x4a68ad='MailAccounts';return db[_0x5bf9('0x3c')][_0x5bf9('0x3b')]({'where':{'type':_0x4a68ad,'resourceId':_0x22e5ed['id']}})['then'](function(){return _0x334e46;});})[_0x5bf9('0x28')](function(){_0x58dfc7[_0x5bf9('0x33')](0xcc)[_0x5bf9('0x34')]();});}};}function handleEntityNotFound(_0x2e012d,_0x128abf){return function(_0x247e75){if(!_0x247e75){_0x2e012d[_0x5bf9('0x3d')](0x194);}return _0x247e75;};}function handleError(_0x40778d,_0x145b94){_0x145b94=_0x145b94||0x1f4;return function(_0xe74a08){logger[_0x5bf9('0x2e')](_0xe74a08[_0x5bf9('0x3e')]);if(_0xe74a08['name']){delete _0xe74a08[_0x5bf9('0x3f')];}_0x40778d[_0x5bf9('0x33')](_0x145b94)[_0x5bf9('0x40')](_0xe74a08);};}exports[_0x5bf9('0x41')]=function(_0x242270,_0x119394){var _0xed2de={'include':[{'model':db[_0x5bf9('0x42')],'as':_0x5bf9('0x43')},{'model':db[_0x5bf9('0x44')],'as':_0x5bf9('0x45')},{'model':db[_0x5bf9('0x46')],'as':_0x5bf9('0x47')}]},_0x4922b8={},_0xb6fcfb={'count':0x0,'rows':[]};var _0x14d321=_[_0x5bf9('0x48')](db['MailAccount'][_0x5bf9('0x49')],function(_0x53a942){return{'name':_0x53a942['fieldName'],'type':_0x53a942[_0x5bf9('0x4a')]['key']};});_0x4922b8[_0x5bf9('0x4b')]=_[_0x5bf9('0x48')](_0x14d321,_0x5bf9('0x3f'));_0x4922b8['query']=_[_0x5bf9('0x4c')](_0x242270[_0x5bf9('0x4d')]);_0x4922b8[_0x5bf9('0x4e')]=_[_0x5bf9('0x4f')](_0x4922b8['model'],_0x4922b8[_0x5bf9('0x4d')]);_0xed2de['attributes']=_[_0x5bf9('0x4f')](_0x4922b8[_0x5bf9('0x4b')],qs['fields'](_0x242270['query'][_0x5bf9('0x50')]));_0xed2de[_0x5bf9('0x51')]=_0xed2de[_0x5bf9('0x51')][_0x5bf9('0x52')]?_0xed2de[_0x5bf9('0x51')]:_0x4922b8[_0x5bf9('0x4b')];if(!_0x242270[_0x5bf9('0x4d')][_0x5bf9('0x53')]('nolimit')){_0xed2de[_0x5bf9('0x37')]=qs[_0x5bf9('0x37')](_0x242270[_0x5bf9('0x4d')][_0x5bf9('0x37')]);_0xed2de[_0x5bf9('0x36')]=qs[_0x5bf9('0x36')](_0x242270[_0x5bf9('0x4d')][_0x5bf9('0x36')]);}_0xed2de[_0x5bf9('0x54')]=qs[_0x5bf9('0x55')](_0x242270[_0x5bf9('0x4d')][_0x5bf9('0x55')]);_0xed2de[_0x5bf9('0x56')]=qs[_0x5bf9('0x4e')](_['pick'](_0x242270['query'],_0x4922b8['filters']));if(_0x242270[_0x5bf9('0x4d')][_0x5bf9('0x57')]){_0xed2de[_0x5bf9('0x56')]=_[_0x5bf9('0x58')](_0xed2de[_0x5bf9('0x56')],{'$or':_[_0x5bf9('0x48')](_0x14d321,function(_0x28c832){if(_0x28c832[_0x5bf9('0x4a')]!==_0x5bf9('0x59')){var _0x464cef={};_0x464cef[_0x28c832[_0x5bf9('0x3f')]]={'$like':'%'+_0x242270[_0x5bf9('0x4d')][_0x5bf9('0x57')]+'%'};return _0x464cef;}})});}_0xed2de=_[_0x5bf9('0x58')]({},_0xed2de,_0x242270['options']);var _0x16e9cb={'where':_0xed2de[_0x5bf9('0x56')]};return db[_0x5bf9('0x5a')][_0x5bf9('0x5b')](_0x16e9cb)['then'](function(_0x3f5d28){_0xb6fcfb[_0x5bf9('0x5b')]=_0x3f5d28;if(_0x242270[_0x5bf9('0x4d')][_0x5bf9('0x5c')]){_0xed2de[_0x5bf9('0x5d')]=[{'all':!![]}];}return db[_0x5bf9('0x5a')][_0x5bf9('0x5e')](_0xed2de);})[_0x5bf9('0x28')](function(_0x536e85){_0xb6fcfb[_0x5bf9('0x5f')]=_0x536e85;return _0xb6fcfb;})['then'](respondWithFilteredResult(_0x119394,_0xed2de))[_0x5bf9('0x32')](handleError(_0x119394,null));};exports[_0x5bf9('0x60')]=function(_0x524b41,_0x46a360){var _0x892389={'raw':![],'where':{'id':_0x524b41[_0x5bf9('0x61')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x5bf9('0x43')},{'model':db[_0x5bf9('0x44')],'as':_0x5bf9('0x45')},{'model':db[_0x5bf9('0x46')],'as':'mandatoryDispositionPause'}]},_0x1adf43={};_0x1adf43[_0x5bf9('0x4b')]=_[_0x5bf9('0x4c')](db[_0x5bf9('0x5a')][_0x5bf9('0x49')]);_0x1adf43['query']=_['keys'](_0x524b41[_0x5bf9('0x4d')]);_0x1adf43[_0x5bf9('0x4e')]=_['intersection'](_0x1adf43[_0x5bf9('0x4b')],_0x1adf43['query']);_0x892389['attributes']=_[_0x5bf9('0x4f')](_0x1adf43[_0x5bf9('0x4b')],qs[_0x5bf9('0x50')](_0x524b41[_0x5bf9('0x4d')][_0x5bf9('0x50')]));_0x892389[_0x5bf9('0x51')]=_0x892389[_0x5bf9('0x51')][_0x5bf9('0x52')]?_0x892389['attributes']:_0x1adf43[_0x5bf9('0x4b')];if(_0x524b41[_0x5bf9('0x4d')][_0x5bf9('0x5c')]){_0x892389[_0x5bf9('0x5d')]=[{'all':!![]}];}_0x892389=_[_0x5bf9('0x58')]({},_0x892389,_0x524b41['options']);return db['MailAccount'][_0x5bf9('0x62')](_0x892389)[_0x5bf9('0x28')](handleEntityNotFound(_0x46a360,null))[_0x5bf9('0x28')](respondWithResult(_0x46a360,null))[_0x5bf9('0x32')](handleError(_0x46a360,null));};exports[_0x5bf9('0x3a')]=function(_0x4f5b8f,_0x5c547b){if(_0x4f5b8f[_0x5bf9('0x63')]['id']){delete _0x4f5b8f[_0x5bf9('0x63')]['id'];}return db[_0x5bf9('0x5a')][_0x5bf9('0x62')]({'where':{'id':_0x4f5b8f[_0x5bf9('0x61')]['id']},'include':[{'model':db[_0x5bf9('0x42')],'as':_0x5bf9('0x43')},{'model':db[_0x5bf9('0x44')],'as':_0x5bf9('0x45')},{'model':db[_0x5bf9('0x46')],'as':_0x5bf9('0x47')}]})['then'](handleEntityNotFound(_0x5c547b,null))['then'](saveUpdates(_0x4f5b8f[_0x5bf9('0x63')],null))[_0x5bf9('0x28')](function(_0x281734){if(_0x281734&&_0x4f5b8f['body'][_0x5bf9('0x43')]){return db[_0x5bf9('0x42')][_0x5bf9('0x3a')](_0x4f5b8f['body'][_0x5bf9('0x43')],{'where':{'MailAccountId':_0x281734['id']}})[_0x5bf9('0x28')](function(){return _0x281734;});}return _0x281734;})[_0x5bf9('0x28')](function(_0x5dc499){if(_0x5dc499&&_0x4f5b8f['body']['Smtp']){return db[_0x5bf9('0x44')][_0x5bf9('0x3a')](_0x4f5b8f[_0x5bf9('0x63')][_0x5bf9('0x45')],{'where':{'MailAccountId':_0x5dc499['id']}})[_0x5bf9('0x28')](function(){return _0x5dc499;});}return _0x5dc499;})[_0x5bf9('0x28')](respondWithResult(_0x5c547b,null))[_0x5bf9('0x32')](handleError(_0x5c547b,null));};exports[_0x5bf9('0x64')]=function(_0x750bdf,_0x5198bd){return db[_0x5bf9('0x5a')][_0x5bf9('0x64')]()[_0x5bf9('0x28')](respondWithResult(_0x5198bd,null))[_0x5bf9('0x32')](handleError(_0x5198bd,null));};exports[_0x5bf9('0x65')]=function(_0x208944,_0x3c1dc6,_0x1c71d7){if(_0x208944[_0x5bf9('0x63')]['id']){delete _0x208944[_0x5bf9('0x63')]['id'];}return db[_0x5bf9('0x5a')]['find']({'where':{'id':_0x208944[_0x5bf9('0x61')]['id']}})[_0x5bf9('0x28')](handleEntityNotFound(_0x3c1dc6,null))[_0x5bf9('0x28')](function(_0x272485){if(_0x272485){_0x208944[_0x5bf9('0x63')]['MailAccountId']=_0x272485['id'];return db[_0x5bf9('0x66')][_0x5bf9('0x67')](_0x208944[_0x5bf9('0x63')]);}})['then'](respondWithResult(_0x3c1dc6,null))[_0x5bf9('0x32')](handleError(_0x3c1dc6,null));};exports[_0x5bf9('0x68')]=function(_0x18819b,_0x32e30b,_0x405a39){var _0x1d8596={'raw':![],'where':{}};var _0xed3039={};var _0x456620={'count':0x0,'rows':[]};return db[_0x5bf9('0x5a')][_0x5bf9('0x69')]({'where':{'id':_0x18819b[_0x5bf9('0x61')]['id']}})[_0x5bf9('0x28')](handleEntityNotFound(_0x32e30b,null))['then'](function(_0x164440){if(_0x164440){_0xed3039['model']=_[_0x5bf9('0x4c')](db[_0x5bf9('0x66')]['rawAttributes']);_0xed3039[_0x5bf9('0x4d')]=_[_0x5bf9('0x4c')](_0x18819b['query']);_0xed3039[_0x5bf9('0x4e')]=_['intersection'](_0xed3039['model'],_0xed3039['query']);_0x1d8596['attributes']=_['intersection'](_0xed3039['model'],qs[_0x5bf9('0x50')](_0x18819b[_0x5bf9('0x4d')][_0x5bf9('0x50')]));_0x1d8596['attributes']=_0x1d8596[_0x5bf9('0x51')]['length']?_0x1d8596['attributes']:_0xed3039[_0x5bf9('0x4b')];if(!_0x18819b[_0x5bf9('0x4d')][_0x5bf9('0x53')]('nolimit')){_0x1d8596[_0x5bf9('0x37')]=qs[_0x5bf9('0x37')](_0x18819b[_0x5bf9('0x4d')][_0x5bf9('0x37')]);_0x1d8596['offset']=qs[_0x5bf9('0x36')](_0x18819b[_0x5bf9('0x4d')]['offset']);}_0x1d8596[_0x5bf9('0x54')]=qs['sort'](_0x18819b[_0x5bf9('0x4d')][_0x5bf9('0x55')]);_0x1d8596[_0x5bf9('0x56')]=qs['filters'](_['pick'](_0x18819b[_0x5bf9('0x4d')],_0xed3039[_0x5bf9('0x4e')]));_0x1d8596[_0x5bf9('0x56')][_0x5bf9('0x6a')]=_0x164440['id'];if(_0x18819b['query'][_0x5bf9('0x57')]){_0x1d8596['where']=_[_0x5bf9('0x58')](_0x1d8596[_0x5bf9('0x56')],{'$or':_[_0x5bf9('0x48')](_0x1d8596[_0x5bf9('0x51')],function(_0xd97d8b){var _0x56c3a8={};_0x56c3a8[_0xd97d8b]={'$like':'%'+_0x18819b['query'][_0x5bf9('0x57')]+'%'};return _0x56c3a8;})});}_0x1d8596=_[_0x5bf9('0x58')]({},_0x1d8596,_0x18819b['options']);return db['Disposition']['count']({'where':_0x1d8596[_0x5bf9('0x56')]})['then'](function(_0x5a386e){_0x456620[_0x5bf9('0x5b')]=_0x5a386e;if(_0x18819b[_0x5bf9('0x4d')][_0x5bf9('0x5c')]){_0x1d8596['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x1d8596);})[_0x5bf9('0x28')](function(_0x4c182a){_0x456620['rows']=_0x4c182a;return _0x456620;});}})[_0x5bf9('0x28')](respondWithFilteredResult(_0x32e30b,_0x1d8596))[_0x5bf9('0x32')](handleError(_0x32e30b,null));};exports['removeDispositions']=function(_0x5f5b21,_0x17397f,_0x1c71e1){return db[_0x5bf9('0x5a')][_0x5bf9('0x62')]({'where':{'id':_0x5f5b21['params']['id']}})[_0x5bf9('0x28')](handleEntityNotFound(_0x17397f,null))['then'](function(_0x36f23b){if(_0x36f23b){return _0x36f23b[_0x5bf9('0x6b')](_0x5f5b21['query'][_0x5bf9('0x6c')]);}})[_0x5bf9('0x28')](respondWithStatusCode(_0x17397f,null))[_0x5bf9('0x32')](handleError(_0x17397f,null));};exports[_0x5bf9('0x6d')]=function(_0x3ea350,_0x138f26,_0x41a8dd){if(_0x3ea350['body']['id']){delete _0x3ea350[_0x5bf9('0x63')]['id'];}return db[_0x5bf9('0x5a')]['find']({'where':{'id':_0x3ea350[_0x5bf9('0x61')]['id']}})['then'](handleEntityNotFound(_0x138f26,null))[_0x5bf9('0x28')](function(_0x2b5bed){if(_0x2b5bed){_0x3ea350[_0x5bf9('0x63')][_0x5bf9('0x6a')]=_0x2b5bed['id'];return db['CannedAnswer'][_0x5bf9('0x67')](_0x3ea350['body']);}})[_0x5bf9('0x28')](respondWithResult(_0x138f26,null))[_0x5bf9('0x32')](handleError(_0x138f26,null));};exports[_0x5bf9('0x6e')]=function(_0x58f78a,_0x33c6c7,_0x1e7f21){var _0x1a80db={'raw':![],'where':{}};var _0x463ea6={};var _0x56d5d3={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x58f78a[_0x5bf9('0x61')]['id']}})[_0x5bf9('0x28')](handleEntityNotFound(_0x33c6c7,null))['then'](function(_0x1206ce){if(_0x1206ce){_0x463ea6[_0x5bf9('0x4b')]=_[_0x5bf9('0x4c')](db['CannedAnswer'][_0x5bf9('0x49')]);_0x463ea6[_0x5bf9('0x4d')]=_[_0x5bf9('0x4c')](_0x58f78a[_0x5bf9('0x4d')]);_0x463ea6[_0x5bf9('0x4e')]=_[_0x5bf9('0x4f')](_0x463ea6[_0x5bf9('0x4b')],_0x463ea6[_0x5bf9('0x4d')]);_0x1a80db[_0x5bf9('0x51')]=_[_0x5bf9('0x4f')](_0x463ea6['model'],qs[_0x5bf9('0x50')](_0x58f78a['query'][_0x5bf9('0x50')]));_0x1a80db[_0x5bf9('0x51')]=_0x1a80db[_0x5bf9('0x51')]['length']?_0x1a80db['attributes']:_0x463ea6['model'];if(!_0x58f78a['query'][_0x5bf9('0x53')]('nolimit')){_0x1a80db[_0x5bf9('0x37')]=qs[_0x5bf9('0x37')](_0x58f78a[_0x5bf9('0x4d')][_0x5bf9('0x37')]);_0x1a80db[_0x5bf9('0x36')]=qs[_0x5bf9('0x36')](_0x58f78a['query'][_0x5bf9('0x36')]);}_0x1a80db['order']=qs[_0x5bf9('0x55')](_0x58f78a[_0x5bf9('0x4d')][_0x5bf9('0x55')]);_0x1a80db[_0x5bf9('0x56')]=qs['filters'](_[_0x5bf9('0x6f')](_0x58f78a['query'],_0x463ea6[_0x5bf9('0x4e')]));_0x1a80db[_0x5bf9('0x56')][_0x5bf9('0x6a')]=_0x1206ce['id'];if(_0x58f78a[_0x5bf9('0x4d')][_0x5bf9('0x57')]){_0x1a80db[_0x5bf9('0x56')]=_['merge'](_0x1a80db[_0x5bf9('0x56')],{'$or':_[_0x5bf9('0x48')](_0x1a80db['attributes'],function(_0x10b1e5){var _0x20012c={};_0x20012c[_0x10b1e5]={'$like':'%'+_0x58f78a[_0x5bf9('0x4d')][_0x5bf9('0x57')]+'%'};return _0x20012c;})});}_0x1a80db=_['merge']({},_0x1a80db,_0x58f78a[_0x5bf9('0x70')]);return db[_0x5bf9('0x71')][_0x5bf9('0x5b')]({'where':_0x1a80db[_0x5bf9('0x56')]})[_0x5bf9('0x28')](function(_0x16cb49){_0x56d5d3[_0x5bf9('0x5b')]=_0x16cb49;if(_0x58f78a['query'][_0x5bf9('0x5c')]){_0x1a80db[_0x5bf9('0x5d')]=[{'all':!![]}];}return db[_0x5bf9('0x71')][_0x5bf9('0x5e')](_0x1a80db);})[_0x5bf9('0x28')](function(_0x258719){_0x56d5d3['rows']=_0x258719;return _0x56d5d3;});}})['then'](respondWithFilteredResult(_0x33c6c7,_0x1a80db))[_0x5bf9('0x32')](handleError(_0x33c6c7,null));};exports['removeAnswers']=function(_0x44f7d3,_0x116258,_0x9e98b6){return db[_0x5bf9('0x5a')][_0x5bf9('0x62')]({'where':{'id':_0x44f7d3[_0x5bf9('0x61')]['id']}})[_0x5bf9('0x28')](handleEntityNotFound(_0x116258,null))[_0x5bf9('0x28')](function(_0x56212d){if(_0x56212d){return _0x56212d[_0x5bf9('0x72')](_0x44f7d3[_0x5bf9('0x4d')][_0x5bf9('0x6c')]);}})[_0x5bf9('0x28')](respondWithStatusCode(_0x116258,null))[_0x5bf9('0x32')](handleError(_0x116258,null));};exports[_0x5bf9('0x67')]=function(_0x4e395e,_0x30c4b6){var _0x165004={'name':_0x4e395e['body'][_0x5bf9('0x3f')],'key':_0x4e395e[_0x5bf9('0x63')][_0x5bf9('0x73')],'email':_0x4e395e[_0x5bf9('0x63')]['email'],'ListId':_0x4e395e['body']['ListId'],'active':!_[_0x5bf9('0x74')](_0x4e395e[_0x5bf9('0x63')]['active'])?_0x4e395e[_0x5bf9('0x63')][_0x5bf9('0x75')]:!![],'description':_0x4e395e[_0x5bf9('0x63')][_0x5bf9('0x76')]||null,'Imap':{},'Smtp':{}};if(_[_0x5bf9('0x74')](_0x4e395e[_0x5bf9('0x63')][_0x5bf9('0x77')])){if(_0x4e395e[_0x5bf9('0x63')][_0x5bf9('0x78')]){_0x165004['Imap'][_0x5bf9('0x79')]=_0x165004[_0x5bf9('0x45')][_0x5bf9('0x79')]=_0x4e395e['body'][_0x5bf9('0x7a')];_0x165004[_0x5bf9('0x43')][_0x5bf9('0x7b')]=_0x165004[_0x5bf9('0x45')][_0x5bf9('0x7c')]=_0x4e395e['body']['cpassword'];}else{_0x165004['Imap'][_0x5bf9('0x7d')]=_0x165004['Smtp'][_0x5bf9('0x7d')]=![];}_0x165004[_0x5bf9('0x43')][_0x5bf9('0x7e')]=_0x4e395e['body'][_0x5bf9('0x43')][_0x5bf9('0x7e')];_0x165004['Imap'][_0x5bf9('0x7f')]=_0x4e395e['body'][_0x5bf9('0x43')]['port'];_0x165004[_0x5bf9('0x45')]['host']=_0x4e395e[_0x5bf9('0x63')][_0x5bf9('0x45')][_0x5bf9('0x7e')];_0x165004['Smtp'][_0x5bf9('0x7f')]=_0x4e395e['body'][_0x5bf9('0x45')]['port'];}else{_0x165004[_0x5bf9('0x43')]['service']=_0x165004[_0x5bf9('0x45')][_0x5bf9('0x80')]=_0x4e395e[_0x5bf9('0x63')][_0x5bf9('0x77')];_0x165004[_0x5bf9('0x43')][_0x5bf9('0x79')]=_0x165004[_0x5bf9('0x45')][_0x5bf9('0x79')]=_0x4e395e[_0x5bf9('0x63')][_0x5bf9('0x7a')];_0x165004[_0x5bf9('0x43')][_0x5bf9('0x7b')]=_0x165004[_0x5bf9('0x45')][_0x5bf9('0x7c')]=_0x4e395e['body'][_0x5bf9('0x81')];}return db[_0x5bf9('0x5a')][_0x5bf9('0x67')](_0x165004,{'include':[{'model':db[_0x5bf9('0x44')],'as':_0x5bf9('0x45')},{'model':db['MailServerIn'],'as':_0x5bf9('0x43')}]})['then'](function(_0x148b96){var _0x325f6d=_0x4e395e['user']['get']({'plain':!![]});if(!_0x325f6d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x325f6d['role']==='user'){var _0x5f5ac2=_0x148b96[_0x5bf9('0x82')]({'plain':!![]});return db[_0x5bf9('0x83')][_0x5bf9('0x62')]({'where':{'name':_0x5bf9('0x84'),'userProfileId':_0x325f6d['userProfileId']},'raw':!![]})[_0x5bf9('0x28')](function(_0x2e19de){if(_0x2e19de&&_0x2e19de[_0x5bf9('0x85')]===0x0){return db[_0x5bf9('0x3c')][_0x5bf9('0x67')]({'name':_0x5f5ac2[_0x5bf9('0x3f')],'resourceId':_0x5f5ac2['id'],'type':_0x2e19de[_0x5bf9('0x3f')],'sectionId':_0x2e19de['id']},{})[_0x5bf9('0x28')](function(){return _0x148b96;});}else{return _0x148b96;}})[_0x5bf9('0x32')](function(_0x1a5686){logger[_0x5bf9('0x2e')](_0x5bf9('0x86'),_0x1a5686);throw _0x1a5686;});}return _0x148b96;})['then'](respondWithResult(_0x30c4b6,0xc9))[_0x5bf9('0x32')](handleError(_0x30c4b6,null));};exports[_0x5bf9('0x87')]=function(_0x3800f5,_0x221b7e,_0x530942){return db['MailAccount'][_0x5bf9('0x69')]({'where':{'id':_0x3800f5[_0x5bf9('0x61')]['id']}})[_0x5bf9('0x28')](handleEntityNotFound(_0x221b7e,null))[_0x5bf9('0x28')](function(_0x1c4980){if(_0x1c4980){return _0x1c4980[_0x5bf9('0x87')]();}return null;})[_0x5bf9('0x28')](respondWithResult(_0x221b7e,null))[_0x5bf9('0x32')](handleError(_0x221b7e,null));};exports[_0x5bf9('0x88')]=function(_0x27c367,_0x3e7a8d,_0x5138d1){if(_0x27c367[_0x5bf9('0x63')]['id']){delete _0x27c367['body']['id'];}return db['MailAccount'][_0x5bf9('0x62')]({'where':{'id':_0x27c367[_0x5bf9('0x61')]['id']}})[_0x5bf9('0x28')](handleEntityNotFound(_0x3e7a8d,null))[_0x5bf9('0x28')](function(_0x1768e9){if(_0x1768e9){_0x27c367[_0x5bf9('0x63')][_0x5bf9('0x6a')]=_0x1768e9['id'];return db[_0x5bf9('0x42')][_0x5bf9('0x67')](_0x27c367[_0x5bf9('0x63')]);}})[_0x5bf9('0x28')](respondWithResult(_0x3e7a8d,null))[_0x5bf9('0x32')](handleError(_0x3e7a8d,null));};exports[_0x5bf9('0x89')]=function(_0x301236,_0x7537cc,_0x433994){return db[_0x5bf9('0x5a')]['findOne']({'where':{'id':_0x301236[_0x5bf9('0x61')]['id']}})[_0x5bf9('0x28')](handleEntityNotFound(_0x7537cc,null))[_0x5bf9('0x28')](function(_0xf1fb16){if(_0xf1fb16){return _0xf1fb16['setImap'](null);}return null;})['then'](respondWithStatusCode(_0x7537cc,null))[_0x5bf9('0x32')](handleError(_0x7537cc,null));};exports[_0x5bf9('0x8a')]=function(_0x5420ff,_0x221f17,_0x4082bf){return db[_0x5bf9('0x5a')][_0x5bf9('0x69')]({'where':{'id':_0x5420ff[_0x5bf9('0x61')]['id']}})[_0x5bf9('0x28')](handleEntityNotFound(_0x221f17,null))[_0x5bf9('0x28')](function(_0x48416b){if(_0x48416b){return _0x48416b[_0x5bf9('0x8a')]();}return null;})['then'](respondWithResult(_0x221f17,null))[_0x5bf9('0x32')](handleError(_0x221f17,null));};exports['addSmtp']=function(_0x54376c,_0x57ff63,_0x9872fb){if(_0x54376c['body']['id']){delete _0x54376c['body']['id'];}return db[_0x5bf9('0x5a')][_0x5bf9('0x62')]({'where':{'id':_0x54376c[_0x5bf9('0x61')]['id']}})[_0x5bf9('0x28')](handleEntityNotFound(_0x57ff63,null))[_0x5bf9('0x28')](function(_0x29d535){if(_0x29d535){_0x54376c[_0x5bf9('0x63')][_0x5bf9('0x6a')]=_0x29d535['id'];return db['MailServerOut']['create'](_0x54376c[_0x5bf9('0x63')]);}})[_0x5bf9('0x28')](respondWithResult(_0x57ff63,null))['catch'](handleError(_0x57ff63,null));};exports[_0x5bf9('0x8b')]=function(_0x28dfd9,_0x56a50d,_0x1b23ac){return db[_0x5bf9('0x5a')][_0x5bf9('0x69')]({'where':{'id':_0x28dfd9[_0x5bf9('0x61')]['id']}})[_0x5bf9('0x28')](handleEntityNotFound(_0x56a50d,null))[_0x5bf9('0x28')](function(_0x1692f9){if(_0x1692f9){return _0x1692f9[_0x5bf9('0x8c')](null);}return null;})['then'](respondWithStatusCode(_0x56a50d,null))[_0x5bf9('0x32')](handleError(_0x56a50d,null));};exports[_0x5bf9('0x8d')]=function(_0x304f2f,_0x2b3366,_0x3e01f8){return db[_0x5bf9('0x8e')][_0x5bf9('0x62')]({'where':{'id':_0x304f2f[_0x5bf9('0x61')]['id']}})[_0x5bf9('0x28')](handleEntityNotFound(_0x2b3366,null))[_0x5bf9('0x28')](function(_0x16b14b){if(_0x16b14b){return _0x16b14b[_0x5bf9('0x8d')](_0x304f2f[_0x5bf9('0x63')]['ids'],_[_0x5bf9('0x8f')](_0x304f2f[_0x5bf9('0x63')],[_0x5bf9('0x6c'),'id'])||{});}})[_0x5bf9('0x28')](respondWithResult(_0x2b3366,null))['catch'](handleError(_0x2b3366,null));};exports[_0x5bf9('0x90')]=function(_0x221910,_0x4b91c0,_0x44a727){var _0x161676={'raw':![],'where':{}};var _0x5f5939={};var _0x2ec92d={'count':0x0,'rows':[]};return db[_0x5bf9('0x5a')][_0x5bf9('0x69')]({'where':{'id':_0x221910['params']['id']}})[_0x5bf9('0x28')](handleEntityNotFound(_0x4b91c0,null))[_0x5bf9('0x28')](function(_0xdb74c3){if(_0xdb74c3){_0x5f5939['model']=_[_0x5bf9('0x4c')](db[_0x5bf9('0x8e')][_0x5bf9('0x49')]);_0x5f5939[_0x5bf9('0x4d')]=_['keys'](_0x221910[_0x5bf9('0x4d')]);_0x5f5939['filters']=_[_0x5bf9('0x4f')](_0x5f5939[_0x5bf9('0x4b')],_0x5f5939[_0x5bf9('0x4d')]);_0x161676[_0x5bf9('0x51')]=_[_0x5bf9('0x4f')](_0x5f5939['model'],qs[_0x5bf9('0x50')](_0x221910[_0x5bf9('0x4d')][_0x5bf9('0x50')]));_0x161676[_0x5bf9('0x51')]=_0x161676[_0x5bf9('0x51')][_0x5bf9('0x52')]?_0x161676[_0x5bf9('0x51')]:_0x5f5939[_0x5bf9('0x4b')];if(!_0x221910['query']['hasOwnProperty'](_0x5bf9('0x91'))){_0x161676[_0x5bf9('0x37')]=qs[_0x5bf9('0x37')](_0x221910[_0x5bf9('0x4d')][_0x5bf9('0x37')]);_0x161676[_0x5bf9('0x36')]=qs['offset'](_0x221910[_0x5bf9('0x4d')][_0x5bf9('0x36')]);}_0x161676[_0x5bf9('0x54')]=qs[_0x5bf9('0x55')](_0x221910[_0x5bf9('0x4d')][_0x5bf9('0x55')]);_0x161676[_0x5bf9('0x56')]=qs[_0x5bf9('0x4e')](_[_0x5bf9('0x6f')](_0x221910[_0x5bf9('0x4d')],_0x5f5939[_0x5bf9('0x4e')]));_0x161676['where'][_0x5bf9('0x6a')]=_0xdb74c3['id'];if(_0x221910[_0x5bf9('0x4d')]['filter']){_0x161676[_0x5bf9('0x56')]=_['merge'](_0x161676[_0x5bf9('0x56')],{'$or':_['map'](_0x161676['attributes'],function(_0x1ab6a3){var _0x5178f6={};_0x5178f6[_0x1ab6a3]={'$like':'%'+_0x221910[_0x5bf9('0x4d')][_0x5bf9('0x57')]+'%'};return _0x5178f6;})});}_0x161676=_[_0x5bf9('0x58')]({},_0x161676,_0x221910[_0x5bf9('0x70')]);return db[_0x5bf9('0x8e')][_0x5bf9('0x5b')]({'where':_0x161676[_0x5bf9('0x56')]})[_0x5bf9('0x28')](function(_0xe658d6){_0x2ec92d[_0x5bf9('0x5b')]=_0xe658d6;if(_0x221910[_0x5bf9('0x4d')][_0x5bf9('0x5c')]){_0x161676[_0x5bf9('0x5d')]=[{'model':db[_0x5bf9('0x92')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x5bf9('0x93'),'attributes':[_0x5bf9('0x3f'),_0x5bf9('0x94'),'internal'],'required':![]},{'model':db[_0x5bf9('0x95')],'as':'Tags','attributes':['id',_0x5bf9('0x3f'),_0x5bf9('0x96')],'where':_0x221910[_0x5bf9('0x4d')]['tag']?{'id':_0x221910[_0x5bf9('0x4d')][_0x5bf9('0x97')]}:undefined,'required':_0x221910['query'][_0x5bf9('0x97')]?!![]:![]}];}return db[_0x5bf9('0x8e')][_0x5bf9('0x5e')](_0x161676);})['then'](function(_0x4e16b3){_0x2ec92d[_0x5bf9('0x5f')]=_0x4e16b3;return _0x2ec92d;});}})[_0x5bf9('0x28')](respondWithFilteredResult(_0x4b91c0,_0x161676))['catch'](handleError(_0x4b91c0,null));};exports[_0x5bf9('0x98')]=function(_0x4a70ce,_0x344ad4,_0x34b605){return db['MailAccount']['findOne']({'where':{'id':_0x4a70ce[_0x5bf9('0x61')]['id']}})[_0x5bf9('0x28')](handleEntityNotFound(_0x344ad4,null))['then'](function(_0x3083d1){if(_0x3083d1){return db[_0x5bf9('0x99')][_0x5bf9('0x9a')](function(_0x4edc53){return db['MailApplication'][_0x5bf9('0x3b')]({'where':{'MailAccountId':_0x4a70ce[_0x5bf9('0x61')]['id']},'transaction':_0x4edc53})[_0x5bf9('0x28')](function(_0x74ef29){var _0x86d2f=_['map'](_0x4a70ce['body'],function(_0x13ff0){_0x13ff0[_0x5bf9('0x6a')]=_0x4a70ce[_0x5bf9('0x61')]['id'];return _0x13ff0;});return db[_0x5bf9('0x9b')][_0x5bf9('0x9c')](_0x86d2f,{'transaction':_0x4edc53});});})[_0x5bf9('0x28')](function(){return db[_0x5bf9('0x9b')]['findAndCountAll']({'where':{'MailAccountId':_0x4a70ce['params']['id']},'order':_0x5bf9('0x9d')});});}})['then'](respondWithResult(_0x344ad4,null))[_0x5bf9('0x32')](handleError(_0x344ad4,null));};exports[_0x5bf9('0x9e')]=function(_0x1b6f69,_0x5e2640,_0xf42c12){var _0x5519c4={};var _0x3df994={};var _0x207669;var _0x2a7409;return db[_0x5bf9('0x5a')][_0x5bf9('0x69')]({'where':{'id':_0x1b6f69[_0x5bf9('0x61')]['id']}})['then'](handleEntityNotFound(_0x5e2640,null))['then'](function(_0x1f5575){if(_0x1f5575){_0x207669=_0x1f5575;_0x3df994[_0x5bf9('0x4b')]=_[_0x5bf9('0x4c')](db[_0x5bf9('0x9b')][_0x5bf9('0x49')]);_0x3df994[_0x5bf9('0x4d')]=_[_0x5bf9('0x4c')](_0x1b6f69[_0x5bf9('0x4d')]);_0x3df994[_0x5bf9('0x4e')]=_['intersection'](_0x3df994[_0x5bf9('0x4b')],_0x3df994[_0x5bf9('0x4d')]);_0x5519c4[_0x5bf9('0x51')]=_[_0x5bf9('0x4f')](_0x3df994['model'],qs[_0x5bf9('0x50')](_0x1b6f69[_0x5bf9('0x4d')]['fields']));_0x5519c4[_0x5bf9('0x51')]=_0x5519c4[_0x5bf9('0x51')][_0x5bf9('0x52')]?_0x5519c4['attributes']:_0x3df994[_0x5bf9('0x4b')];_0x5519c4[_0x5bf9('0x54')]=qs[_0x5bf9('0x55')](_0x1b6f69['query']['sort']);_0x5519c4[_0x5bf9('0x56')]=qs['filters'](_[_0x5bf9('0x6f')](_0x1b6f69[_0x5bf9('0x4d')],_0x3df994[_0x5bf9('0x4e')]));if(_0x1b6f69[_0x5bf9('0x4d')][_0x5bf9('0x57')]){_0x5519c4[_0x5bf9('0x56')]=_['merge'](_0x5519c4['where'],{'$or':_['map'](_0x5519c4['attributes'],function(_0x3808b0){var _0x316c3e={};_0x316c3e[_0x3808b0]={'$like':'%'+_0x1b6f69[_0x5bf9('0x4d')][_0x5bf9('0x57')]+'%'};return _0x316c3e;})});}_0x5519c4=_[_0x5bf9('0x58')]({},_0x5519c4,_0x1b6f69['options']);return _0x207669[_0x5bf9('0x9e')](_0x5519c4);}})['then'](function(_0x20096e){if(_0x20096e){_0x2a7409=_0x20096e[_0x5bf9('0x52')];if(!_0x1b6f69[_0x5bf9('0x4d')][_0x5bf9('0x53')](_0x5bf9('0x91'))){_0x5519c4[_0x5bf9('0x37')]=qs['limit'](_0x1b6f69['query'][_0x5bf9('0x37')]);_0x5519c4[_0x5bf9('0x36')]=qs[_0x5bf9('0x36')](_0x1b6f69[_0x5bf9('0x4d')][_0x5bf9('0x36')]);}return _0x207669[_0x5bf9('0x9e')](_0x5519c4);}})['then'](function(_0x17f730){if(_0x17f730){return _0x17f730?{'count':_0x2a7409,'rows':_0x17f730}:null;}})[_0x5bf9('0x28')](respondWithResult(_0x5e2640,null))[_0x5bf9('0x32')](handleError(_0x5e2640,null));};exports[_0x5bf9('0x9f')]=function(_0x213fcd,_0x2c79d0,_0x191d1e){var _0x5596d5={'raw':!![],'where':{}};var _0x176039={};var _0x246956={'count':0x0,'rows':[]};return db['MailAccount'][_0x5bf9('0x69')]({'where':{'id':_0x213fcd[_0x5bf9('0x61')]['id']}})[_0x5bf9('0x28')](handleEntityNotFound(_0x2c79d0,null))[_0x5bf9('0x28')](function(_0x454f2d){if(_0x454f2d){_0x176039[_0x5bf9('0x4b')]=_[_0x5bf9('0x4c')](db[_0x5bf9('0xa0')][_0x5bf9('0x49')]);_0x176039[_0x5bf9('0x4d')]=_[_0x5bf9('0x4c')](_0x213fcd[_0x5bf9('0x4d')]);_0x176039[_0x5bf9('0x4e')]=_[_0x5bf9('0x4f')](_0x176039[_0x5bf9('0x4b')],_0x176039['query']);_0x5596d5[_0x5bf9('0x51')]=_[_0x5bf9('0x4f')](_0x176039[_0x5bf9('0x4b')],qs[_0x5bf9('0x50')](_0x213fcd[_0x5bf9('0x4d')]['fields']));_0x5596d5['attributes']=_0x5596d5[_0x5bf9('0x51')]['length']?_0x5596d5['attributes']:_0x176039[_0x5bf9('0x4b')];if(!_0x213fcd[_0x5bf9('0x4d')][_0x5bf9('0x53')](_0x5bf9('0x91'))){_0x5596d5[_0x5bf9('0x37')]=qs[_0x5bf9('0x37')](_0x213fcd[_0x5bf9('0x4d')][_0x5bf9('0x37')]);_0x5596d5[_0x5bf9('0x36')]=qs[_0x5bf9('0x36')](_0x213fcd[_0x5bf9('0x4d')][_0x5bf9('0x36')]);}_0x5596d5[_0x5bf9('0x54')]=qs[_0x5bf9('0x55')](_0x213fcd[_0x5bf9('0x4d')][_0x5bf9('0x55')]);_0x5596d5[_0x5bf9('0x56')]=qs[_0x5bf9('0x4e')](_['pick'](_0x213fcd[_0x5bf9('0x4d')],_0x176039[_0x5bf9('0x4e')]));_0x5596d5['where'][_0x5bf9('0x6a')]=_0x454f2d['id'];if(_0x213fcd[_0x5bf9('0x4d')][_0x5bf9('0x57')]){_0x5596d5[_0x5bf9('0x56')]=_['merge'](_0x5596d5[_0x5bf9('0x56')],{'$or':_[_0x5bf9('0x48')](_0x5596d5[_0x5bf9('0x51')],function(_0x190aee){var _0x69e4fe={};_0x69e4fe[_0x190aee]={'$like':'%'+_0x213fcd['query'][_0x5bf9('0x57')]+'%'};return _0x69e4fe;})});}if(_0x213fcd[_0x5bf9('0x4d')]['$gte']){var _0x4c1bf3=_0x213fcd[_0x5bf9('0x4d')]['$gte'][_0x5bf9('0xa1')](',');var _0x5f465b={};_0x5f465b[_0x4c1bf3[0x0]]={'$gte':moment(_0x4c1bf3[0x1])[_0x5bf9('0xa2')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5596d5['where']=_[_0x5bf9('0x58')](_0x5596d5[_0x5bf9('0x56')],_0x5f465b);}_0x5596d5=_[_0x5bf9('0x58')]({},_0x5596d5,_0x213fcd['options']);return db[_0x5bf9('0xa0')][_0x5bf9('0x5b')]({'where':_0x5596d5['where']})[_0x5bf9('0x28')](function(_0x3c3138){_0x246956['count']=_0x3c3138;if(_0x213fcd[_0x5bf9('0x4d')][_0x5bf9('0x5c')]){_0x5596d5['include']=[{'all':!![]}];}return db['MailMessage'][_0x5bf9('0x5e')](_0x5596d5);})[_0x5bf9('0x28')](function(_0x1fd774){_0x246956[_0x5bf9('0x5f')]=_0x1fd774;return _0x246956;});}})[_0x5bf9('0x28')](respondWithFilteredResult(_0x2c79d0,_0x5596d5))['catch'](handleError(_0x2c79d0,null));};exports['send']=function(_0x3bf2d3,_0x111fd9,_0x2960b9){var _0x4aea02,_0x49be28={},_0x66458e;if(_0x3bf2d3[_0x5bf9('0x63')]['to']){_0x66458e=_0x3bf2d3[_0x5bf9('0x63')]['to'][_0x5bf9('0xa1')](',')[0x0];}return db[_0x5bf9('0x5a')][_0x5bf9('0x62')]({'where':{'id':_0x3bf2d3['params']['id']},'include':[{'model':db[_0x5bf9('0xa3')],'as':'List','include':[{'model':db[_0x5bf9('0x92')],'as':_0x5bf9('0xa4'),'where':{'email':_0x66458e},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x5bf9('0x44')],'as':_0x5bf9('0x45'),'raw':!![]}]})[_0x5bf9('0x28')](handleEntityNotFound(_0x111fd9,null))['then'](function(_0x129578){if(_0x129578){_0x4aea02=_0x129578;if(_0x129578[_0x5bf9('0x45')]){if(_[_0x5bf9('0x74')](_0x3bf2d3[_0x5bf9('0x63')][_0x5bf9('0xa5')])){_0x3bf2d3[_0x5bf9('0x63')][_0x5bf9('0xa5')]=util[_0x5bf9('0xa2')](_0x5bf9('0xa6'),_0x129578[_0x5bf9('0x3f')],_0x129578['email']||_0x129578['Smtp'][_0x5bf9('0x79')]);}if(_0x3bf2d3[_0x5bf9('0x63')][_0x5bf9('0xa7')]&&_0x3bf2d3['body']['attachments'][_0x5bf9('0x52')]){for(var _0x4dba8a=0x0;_0x4dba8a<_0x3bf2d3['body'][_0x5bf9('0xa7')]['length'];_0x4dba8a+=0x1){_0x3bf2d3[_0x5bf9('0x63')][_0x5bf9('0xa7')][_0x4dba8a]={'filename':_0x3bf2d3[_0x5bf9('0x63')][_0x5bf9('0xa7')][_0x4dba8a]['name'],'path':path[_0x5bf9('0xa8')](config[_0x5bf9('0xa9')],_0x5bf9('0xaa'),_0x3bf2d3[_0x5bf9('0x63')][_0x5bf9('0xa7')][_0x4dba8a]['basename'])};}}var _0x523c09={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x129578[_0x5bf9('0x45')][_0x5bf9('0x80')])){if(_0x129578[_0x5bf9('0x45')][_0x5bf9('0x7d')]){_0x523c09[_0x5bf9('0xab')]={'user':_0x129578[_0x5bf9('0x45')][_0x5bf9('0x79')],'pass':_0x129578['Smtp'][_0x5bf9('0x7c')]};}_0x523c09[_0x5bf9('0x7e')]=_0x129578[_0x5bf9('0x45')][_0x5bf9('0x7e')];_0x523c09['port']=_0x129578[_0x5bf9('0x45')][_0x5bf9('0x7f')];_0x523c09['secure']=_0x129578[_0x5bf9('0x45')][_0x5bf9('0xac')];}else{_0x523c09[_0x5bf9('0x80')]=_0x129578['Smtp'][_0x5bf9('0x80')];_0x523c09[_0x5bf9('0xab')]={'user':_0x129578['Smtp'][_0x5bf9('0x79')],'pass':_0x129578['Smtp'][_0x5bf9('0x7c')]};}return respondWithRpcPromise(_0x5bf9('0xad'),_0x5bf9('0xae'),{'account':_0x523c09,'message':_0x3bf2d3[_0x5bf9('0x63')]});}else{throw new Error(_0x5bf9('0xaf'));}}})['then'](function(_0x24ba3b){if(_0x24ba3b){_0x49be28=_0x24ba3b;if(_0x4aea02['List']){if(_0x4aea02[_0x5bf9('0xb0')][_0x5bf9('0xa4')][_0x5bf9('0x52')]){return _0x4aea02[_0x5bf9('0xb0')][_0x5bf9('0xa4')][0x0];}else{return db[_0x5bf9('0x92')][_0x5bf9('0x67')](_[_0x5bf9('0x1e')](_0x3bf2d3[_0x5bf9('0x63')],{'firstName':_0x3bf2d3[_0x5bf9('0x63')]['to'],'email':_0x3bf2d3[_0x5bf9('0x63')]['to'],'phone':_0x3bf2d3[_0x5bf9('0x63')]['to'],'ListId':_0x4aea02['ListId']}));}}else{throw new Error('List\x20not\x20found');}}})[_0x5bf9('0x28')](function(_0x2048ee){if(_0x2048ee){var _0x916aed={'UserId':_0x3bf2d3[_0x5bf9('0x79')]['id'],'ContactId':_0x2048ee['id'],'MailAccountId':_0x4aea02['id'],'inReplyTo':_0x49be28[_0x5bf9('0xb1')],'to':_0x3bf2d3['body'][_0x5bf9('0xa5')],'cc':_0x3bf2d3[_0x5bf9('0x63')]['cc'],'subject':_0x3bf2d3[_0x5bf9('0x63')]['subject'],'attach':_0x3bf2d3['body']['attach'],'firstMsgDirection':'out','lastMsgAt':moment()[_0x5bf9('0xa2')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','lastMsgBody':_0x3bf2d3['body'][_0x5bf9('0x63')],'Messages':[_[_0x5bf9('0x58')](_0x3bf2d3[_0x5bf9('0x63')],{'messageId':_0x49be28[_0x5bf9('0xb1')],'sentAt':moment()[_0x5bf9('0xa2')](_0x5bf9('0xb2')),'read':!![],'MailAccountId':_0x4aea02['id'],'UserId':_0x3bf2d3[_0x5bf9('0x79')]['id'],'ContactId':_0x2048ee['id']})]};if(_0x3bf2d3['body'][_0x5bf9('0xb3')]){_0x916aed=_[_0x5bf9('0x58')](_0x916aed,_0x3bf2d3['body'][_0x5bf9('0xb3')]);}return db[_0x5bf9('0x8e')]['create'](_0x916aed,{'include':[{'model':db[_0x5bf9('0xa0')],'as':'Messages'}]});}})[_0x5bf9('0x28')](respondWithResult(_0x111fd9,null))[_0x5bf9('0x32')](handleError(_0x111fd9,null));};exports[_0x5bf9('0xb4')]=function(_0x550ebe,_0x27b9bb,_0x2fcd4b){return db['MailAccount'][_0x5bf9('0x62')]({'where':{'id':_0x550ebe[_0x5bf9('0x61')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x5bf9('0x45'),'raw':!![]}]})['then'](handleEntityNotFound(_0x27b9bb,null))[_0x5bf9('0x28')](function(_0x8b4a8d){if(_0x8b4a8d&&_0x8b4a8d[_0x5bf9('0x45')]){var _0x397d99={'id':_0x8b4a8d['id'],'tls':{'rejectUnauthorized':![]}};if(_0x8b4a8d[_0x5bf9('0x45')][_0x5bf9('0x80')]){_0x397d99[_0x5bf9('0x80')]=_0x8b4a8d['Smtp'][_0x5bf9('0x80')];}else{_0x397d99[_0x5bf9('0x7e')]=_0x8b4a8d['Smtp']['host'];_0x397d99['port']=_0x8b4a8d[_0x5bf9('0x45')][_0x5bf9('0x7f')];_0x397d99[_0x5bf9('0xac')]=_0x8b4a8d[_0x5bf9('0x45')][_0x5bf9('0xac')];}if(_0x8b4a8d[_0x5bf9('0x45')]['authentication']){_0x397d99[_0x5bf9('0xab')]={'user':_0x8b4a8d[_0x5bf9('0x45')][_0x5bf9('0x79')],'pass':_0x8b4a8d[_0x5bf9('0x45')][_0x5bf9('0x7c')]};}return respondWithRpcPromise(_0x5bf9('0xb5'),_0x5bf9('0xb4'),{'account':_0x397d99});}})['then'](respondWithResult(_0x27b9bb,null))[_0x5bf9('0x32')](handleError(_0x27b9bb,null));};exports[_0x5bf9('0x3b')]=function(_0x3451ad,_0x31effb){return db[_0x5bf9('0x5a')][_0x5bf9('0x62')]({'where':{'id':_0x3451ad['params']['id']}})[_0x5bf9('0x28')](handleEntityNotFound(_0x31effb,null))['then'](function(_0x47e1eb){if(_0x47e1eb&&_0x47e1eb[_0x5bf9('0x80')]){throw new db['Sequelize'][(_0x5bf9('0x25'))](_0x5bf9('0xb6'));}return _0x47e1eb;})[_0x5bf9('0x28')](removeEntity(_0x31effb,null))[_0x5bf9('0x32')](handleError(_0x31effb,null));};exports[_0x5bf9('0xb7')]=function(_0x3b0ba0,_0x5baac6,_0x1557ea){return db[_0x5bf9('0x5a')][_0x5bf9('0x62')]({'where':{'id':_0x3b0ba0[_0x5bf9('0x61')]['id']}})[_0x5bf9('0x28')](handleEntityNotFound(_0x5baac6,null))[_0x5bf9('0x28')](function(_0x3ef710){if(_0x3ef710){return _0x3ef710[_0x5bf9('0xb7')](_0x3b0ba0[_0x5bf9('0x63')][_0x5bf9('0x6c')],_[_0x5bf9('0x8f')](_0x3b0ba0[_0x5bf9('0x63')],['ids','id'])||{})[_0x5bf9('0xb8')](function(_0x40d5d9){for(var _0x44e462=0x0;_0x44e462<_0x3b0ba0['body'][_0x5bf9('0x6c')]['length'];_0x44e462+=0x1){socket[_0x5bf9('0xb9')](_0x5bf9('0xba'),{'UserId':_0x3b0ba0['body'][_0x5bf9('0x6c')][_0x44e462],'MailAccountId':_0x3b0ba0[_0x5bf9('0x61')]['id']});}return _0x40d5d9;});}})[_0x5bf9('0x28')](respondWithResult(_0x5baac6,null))[_0x5bf9('0x32')](handleError(_0x5baac6,null));};exports['removeAgents']=function(_0x40e3d2,_0x52de8e,_0x5125f9){return db[_0x5bf9('0x5a')]['find']({'where':{'id':_0x40e3d2[_0x5bf9('0x61')]['id']}})[_0x5bf9('0x28')](handleEntityNotFound(_0x52de8e,null))['then'](function(_0x1d532b){if(_0x1d532b){return _0x1d532b[_0x5bf9('0xbb')](_0x40e3d2[_0x5bf9('0x4d')][_0x5bf9('0x6c')])[_0x5bf9('0x28')](function(){if(_['isArray'](_0x40e3d2['query'][_0x5bf9('0x6c')])){for(var _0x3cf87b=0x0;_0x3cf87b<_0x40e3d2[_0x5bf9('0x4d')][_0x5bf9('0x6c')][_0x5bf9('0x52')];_0x3cf87b+=0x1){socket[_0x5bf9('0xb9')](_0x5bf9('0xbc'),{'UserId':Number(_0x40e3d2[_0x5bf9('0x4d')]['ids'][_0x3cf87b]),'MailAccountId':Number(_0x40e3d2[_0x5bf9('0x61')]['id'])});}}else{socket[_0x5bf9('0xb9')](_0x5bf9('0xbc'),{'UserId':Number(_0x40e3d2['query'][_0x5bf9('0x6c')]),'MailAccountId':Number(_0x40e3d2[_0x5bf9('0x61')]['id'])});}});}})[_0x5bf9('0x28')](respondWithStatusCode(_0x52de8e,null))[_0x5bf9('0x32')](handleError(_0x52de8e,null));};exports['getAgents']=function(_0x515812,_0x2415de,_0x32fffe){var _0x22a691={};var _0x3f0d6b={};var _0x448550;var _0x3fd92f;return db[_0x5bf9('0x5a')][_0x5bf9('0x69')]({'where':{'id':_0x515812[_0x5bf9('0x61')]['id']}})[_0x5bf9('0x28')](handleEntityNotFound(_0x2415de,null))[_0x5bf9('0x28')](function(_0x53fc85){if(_0x53fc85){_0x448550=_0x53fc85;_0x3f0d6b['model']=_[_0x5bf9('0x4c')](db[_0x5bf9('0xbd')]['rawAttributes']);_0x3f0d6b[_0x5bf9('0x4d')]=_[_0x5bf9('0x4c')](_0x515812['query']);_0x3f0d6b[_0x5bf9('0x4e')]=_[_0x5bf9('0x4f')](_0x3f0d6b[_0x5bf9('0x4b')],_0x3f0d6b[_0x5bf9('0x4d')]);_0x22a691['attributes']=_['intersection'](_0x3f0d6b[_0x5bf9('0x4b')],qs[_0x5bf9('0x50')](_0x515812[_0x5bf9('0x4d')][_0x5bf9('0x50')]));_0x22a691[_0x5bf9('0x51')]=_0x22a691[_0x5bf9('0x51')][_0x5bf9('0x52')]?_0x22a691[_0x5bf9('0x51')]:_0x3f0d6b[_0x5bf9('0x4b')];_0x22a691[_0x5bf9('0x54')]=qs[_0x5bf9('0x55')](_0x515812[_0x5bf9('0x4d')]['sort']);_0x22a691[_0x5bf9('0x56')]=qs['filters'](_[_0x5bf9('0x6f')](_0x515812['query'],_0x3f0d6b[_0x5bf9('0x4e')]));if(_0x515812['query']['filter']){_0x22a691[_0x5bf9('0x56')]=_['merge'](_0x22a691['where'],{'$or':_[_0x5bf9('0x48')](_0x22a691['attributes'],function(_0x5c3a58){var _0x1844a7={};_0x1844a7[_0x5c3a58]={'$like':'%'+_0x515812[_0x5bf9('0x4d')][_0x5bf9('0x57')]+'%'};return _0x1844a7;})});}_0x22a691=_[_0x5bf9('0x58')]({},_0x22a691,_0x515812['options']);return _0x448550['getAgents'](_0x22a691);}})['then'](function(_0x196fad){if(_0x196fad){_0x3fd92f=_0x196fad[_0x5bf9('0x52')];if(!_0x515812[_0x5bf9('0x4d')]['hasOwnProperty']('nolimit')){_0x22a691[_0x5bf9('0x37')]=qs['limit'](_0x515812[_0x5bf9('0x4d')][_0x5bf9('0x37')]);_0x22a691['offset']=qs[_0x5bf9('0x36')](_0x515812[_0x5bf9('0x4d')][_0x5bf9('0x36')]);}return _0x448550[_0x5bf9('0xbe')](_0x22a691);}})[_0x5bf9('0x28')](function(_0x31012b){if(_0x31012b){return _0x31012b?{'count':_0x3fd92f,'rows':_0x31012b}:null;}})[_0x5bf9('0x28')](respondWithResult(_0x2415de,null))[_0x5bf9('0x32')](handleError(_0x2415de,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 1d720b7..7f11a37 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 _0x3426=['../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x3426,0x199));var _0x6342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3426[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x6342('0x0'));var MailAccount=require(_0x6342('0x1'))['db'][_0x6342('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x6342('0x3')](0x0);var events={'afterCreate':_0x6342('0x4'),'afterUpdate':_0x6342('0x5'),'afterDestroy':_0x6342('0x6')};function emitEvent(_0x2bc72e){return function(_0x305b4a,_0x52ffe7,_0x975713){MailAccountEvents[_0x6342('0x7')](_0x2bc72e+':'+_0x305b4a['id'],_0x305b4a);MailAccountEvents[_0x6342('0x7')](_0x2bc72e,_0x305b4a);_0x975713(null);};}for(var e in events){if(events[_0x6342('0x8')](e)){var event=events[e];MailAccount[_0x6342('0x9')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0x0e78=['remove','emit','hook','exports','MailAccount','setMaxListeners','save','update'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0e78,0x1f4));var _0x80e7=function(_0x471888,_0x34819d){_0x471888=_0x471888-0x0;var _0x446543=_0x0e78[_0x471888];return _0x446543;};'use strict';var EventEmitter=require('events');var MailAccount=require('../../mysqldb')['db'][_0x80e7('0x0')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x80e7('0x1')](0x0);var events={'afterCreate':_0x80e7('0x2'),'afterUpdate':_0x80e7('0x3'),'afterDestroy':_0x80e7('0x4')};function emitEvent(_0x2642b3){return function(_0x23ed2a,_0x124efe,_0x441ab9){MailAccountEvents[_0x80e7('0x5')](_0x2642b3+':'+_0x23ed2a['id'],_0x23ed2a);MailAccountEvents['emit'](_0x2642b3,_0x23ed2a);_0x441ab9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x80e7('0x6')](e,emitEvent(event));}}module[_0x80e7('0x7')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 2995048..67b45bf 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 _0x0630=['request-promise','path','rimraf','../../config/environment','exports','mail_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2bc49f,_0x112665){var _0x57ddb3=function(_0x1afa48){while(--_0x1afa48){_0x2bc49f['push'](_0x2bc49f['shift']());}};_0x57ddb3(++_0x112665);}(_0x0630,0xde));var _0x0063=function(_0x36994f,_0x53b85a){_0x36994f=_0x36994f-0x0;var _0x12310b=_0x0630[_0x36994f];return _0x12310b;};'use strict';var _=require(_0x0063('0x0'));var util=require(_0x0063('0x1'));var logger=require(_0x0063('0x2'))(_0x0063('0x3'));var moment=require(_0x0063('0x4'));var BPromise=require(_0x0063('0x5'));var rp=require(_0x0063('0x6'));var fs=require('fs');var path=require(_0x0063('0x7'));var rimraf=require(_0x0063('0x8'));var config=require(_0x0063('0x9'));var attributes=require('./mailAccount.attributes');module[_0x0063('0xa')]=function(_0x57a966,_0x14ff3d){return _0x57a966['define']('MailAccount',attributes,{'tableName':_0x0063('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9205=['api','moment','bluebird','MailAccount','mail_accounts','lodash','util','../../config/logger'];(function(_0x2fa8b5,_0x2b4ca8){var _0x3007c4=function(_0x486cff){while(--_0x486cff){_0x2fa8b5['push'](_0x2fa8b5['shift']());}};_0x3007c4(++_0x2b4ca8);}(_0x9205,0x14d));var _0x5920=function(_0x32e121,_0x109b42){_0x32e121=_0x32e121-0x0;var _0xc728e7=_0x9205[_0x32e121];return _0xc728e7;};'use strict';var _=require(_0x5920('0x0'));var util=require(_0x5920('0x1'));var logger=require(_0x5920('0x2'))(_0x5920('0x3'));var moment=require(_0x5920('0x4'));var BPromise=require(_0x5920('0x5'));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('./mailAccount.attributes');module['exports']=function(_0x4a372a,_0x904123){return _0x4a372a['define'](_0x5920('0x6'),attributes,{'tableName':_0x5920('0x7'),'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 1b33363..e4f8465 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 _0xd382=['defaults','CmContact','create','List\x20not\x20found','messageId','subject','attach','format','Messages','inReplyTo','MailInteraction','Contact\x20not\x20found','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','contact','attachments','originTo','originCc','bcc','Attachment','Attachments','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','localhost','socket.io-emitter','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetMailAccount','options','raw','where','attributes','limit','map','include','model','catch','MailAccount','find','ShowMailAccount','NotifyMailAccount','body','difference','rawAttributes','createdAt','updatedAt','ListId','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','Contacts','DESC','MailApplication','Smtp','List','get','account','omit','Applications','applications','list','orderBy','priority','asc','autoclose','push','close','*,*,*,*'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0xd382,0x1b6));var _0x2d38=function(_0x2e7557,_0x3d8801){_0x2e7557=_0x2e7557-0x0;var _0x2d25ae=_0xd382[_0x2e7557];return _0x2d25ae;};'use strict';var _=require(_0x2d38('0x0'));var util=require(_0x2d38('0x1'));var moment=require(_0x2d38('0x2'));var BPromise=require(_0x2d38('0x3'));var rs=require(_0x2d38('0x4'));var fs=require('fs');var Redis=require(_0x2d38('0x5'));var db=require(_0x2d38('0x6'))['db'];var utils=require(_0x2d38('0x7'));var logger=require(_0x2d38('0x8'))(_0x2d38('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2d38('0xa')]({'port':0x232c});config[_0x2d38('0xb')]=_['defaults'](config[_0x2d38('0xb')],{'host':_0x2d38('0xc'),'port':0x18eb});var socket=require(_0x2d38('0xd'))(new Redis(config['redis']));require('./mailAccount.socket')[_0x2d38('0xe')](socket);function respondWithRpcPromise(_0x25e9a7,_0x12a9bf,_0x495903){return new BPromise(function(_0x29a847,_0x59c2c3){return client[_0x2d38('0xf')](_0x25e9a7,_0x495903)[_0x2d38('0x10')](function(_0x35b37a){logger[_0x2d38('0x11')](_0x2d38('0x12'),_0x12a9bf,_0x2d38('0x13'));logger[_0x2d38('0x14')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x12a9bf,_0x2d38('0x13'),JSON[_0x2d38('0x15')](_0x35b37a));if(_0x35b37a[_0x2d38('0x16')]){if(_0x35b37a[_0x2d38('0x16')][_0x2d38('0x17')]===0x1f4){logger['error'](_0x2d38('0x12'),_0x12a9bf,_0x35b37a[_0x2d38('0x16')][_0x2d38('0x18')]);return _0x59c2c3(_0x35b37a[_0x2d38('0x16')][_0x2d38('0x18')]);}logger[_0x2d38('0x16')](_0x2d38('0x12'),_0x12a9bf,_0x35b37a[_0x2d38('0x16')][_0x2d38('0x18')]);return _0x29a847(_0x35b37a[_0x2d38('0x16')][_0x2d38('0x18')]);}else{logger[_0x2d38('0x11')](_0x2d38('0x12'),_0x12a9bf,_0x2d38('0x13'));_0x29a847(_0x35b37a[_0x2d38('0x19')][_0x2d38('0x18')]);}})['catch'](function(_0x1a7a8f){logger[_0x2d38('0x16')]('MailAccount,\x20%s,\x20%s',_0x12a9bf,_0x1a7a8f);_0x59c2c3(_0x1a7a8f);});});}exports[_0x2d38('0x1a')]=function(_0x353874){var _0x246658=this;return new Promise(function(_0x4f519a,_0x46f8be){return db['MailAccount']['findAll']({'raw':_0x353874[_0x2d38('0x1b')]?_0x353874[_0x2d38('0x1b')][_0x2d38('0x1c')]===undefined?!![]:![]:!![],'where':_0x353874[_0x2d38('0x1b')]?_0x353874[_0x2d38('0x1b')][_0x2d38('0x1d')]||null:null,'attributes':_0x353874[_0x2d38('0x1b')]?_0x353874[_0x2d38('0x1b')][_0x2d38('0x1e')]||null:null,'limit':_0x353874[_0x2d38('0x1b')]?_0x353874['options'][_0x2d38('0x1f')]||null:null,'include':_0x353874['options']?_0x353874[_0x2d38('0x1b')]['include']?_[_0x2d38('0x20')](_0x353874[_0x2d38('0x1b')][_0x2d38('0x21')],function(_0x10e283){return{'model':db[_0x10e283[_0x2d38('0x22')]],'as':_0x10e283['as'],'attributes':_0x10e283[_0x2d38('0x1e')],'include':_0x10e283[_0x2d38('0x21')]?_['map'](_0x10e283[_0x2d38('0x21')],function(_0x3f0f7a){return{'model':db[_0x3f0f7a[_0x2d38('0x22')]],'as':_0x3f0f7a['as'],'attributes':_0x3f0f7a[_0x2d38('0x1e')],'include':_0x3f0f7a[_0x2d38('0x21')]?_[_0x2d38('0x20')](_0x3f0f7a[_0x2d38('0x21')],function(_0x3a6437){return{'model':db[_0x3a6437['model']],'as':_0x3a6437['as'],'attributes':_0x3a6437['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x31d427){logger[_0x2d38('0x11')](_0x2d38('0x1a'),_0x353874);logger['debug'](_0x2d38('0x1a'),_0x353874,JSON['stringify'](_0x31d427));_0x4f519a(_0x31d427);})[_0x2d38('0x23')](function(_0x210283){logger[_0x2d38('0x16')]('GetMailAccount',_0x210283[_0x2d38('0x18')],_0x353874);_0x46f8be(_0x246658[_0x2d38('0x16')](0x1f4,_0x210283[_0x2d38('0x18')]));});});};exports['ShowMailAccount']=function(_0x1fa9c2){var _0x3ac678=this;return new Promise(function(_0x81fff7,_0x1b48a9){return db[_0x2d38('0x24')][_0x2d38('0x25')]({'raw':_0x1fa9c2['options']?_0x1fa9c2[_0x2d38('0x1b')][_0x2d38('0x1c')]===undefined?!![]:![]:!![],'where':_0x1fa9c2[_0x2d38('0x1b')]?_0x1fa9c2[_0x2d38('0x1b')]['where']||null:null,'attributes':_0x1fa9c2[_0x2d38('0x1b')]?_0x1fa9c2[_0x2d38('0x1b')][_0x2d38('0x1e')]||null:null,'include':_0x1fa9c2[_0x2d38('0x1b')]?_0x1fa9c2[_0x2d38('0x1b')][_0x2d38('0x21')]?_[_0x2d38('0x20')](_0x1fa9c2[_0x2d38('0x1b')][_0x2d38('0x21')],function(_0xab361d){return{'model':db[_0xab361d['model']],'as':_0xab361d['as'],'attributes':_0xab361d['attributes'],'include':_0xab361d[_0x2d38('0x21')]?_[_0x2d38('0x20')](_0xab361d[_0x2d38('0x21')],function(_0x42f9d0){return{'model':db[_0x42f9d0[_0x2d38('0x22')]],'as':_0x42f9d0['as'],'attributes':_0x42f9d0[_0x2d38('0x1e')],'include':_0x42f9d0[_0x2d38('0x21')]?_[_0x2d38('0x20')](_0x42f9d0[_0x2d38('0x21')],function(_0x145c42){return{'model':db[_0x145c42[_0x2d38('0x22')]],'as':_0x145c42['as'],'attributes':_0x145c42[_0x2d38('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2d38('0x10')](function(_0x48be91){logger[_0x2d38('0x11')](_0x2d38('0x26'),_0x1fa9c2);logger[_0x2d38('0x14')](_0x2d38('0x26'),_0x1fa9c2,JSON['stringify'](_0x48be91));_0x81fff7(_0x48be91);})[_0x2d38('0x23')](function(_0x41a211){logger[_0x2d38('0x16')](_0x2d38('0x26'),_0x41a211[_0x2d38('0x18')],_0x1fa9c2);_0x1b48a9(_0x3ac678[_0x2d38('0x16')](0x1f4,_0x41a211[_0x2d38('0x18')]));});});};exports[_0x2d38('0x27')]=function(_0x1194cf){var _0x2af2c3=this;return new Promise(function(_0x3cd072,_0x82bb9){var _0x1e1d70={'body':_0x1194cf[_0x2d38('0x28')],'channel':'mail'};var _0x234b9e=_[_0x2d38('0x29')](_['keys'](db['CmContact'][_0x2d38('0x2a')]),[_0x2d38('0x2b'),_0x2d38('0x2c'),'CompanyId',_0x2d38('0x2d')]);var _0x17cc8d=![];if(_0x1194cf[_0x2d38('0x28')]['id']){delete _0x1194cf['body']['id'];}if(_['isNil'](_0x1194cf[_0x2d38('0x28')]['from'])){return _0x82bb9(_0x2af2c3[_0x2d38('0x16')](0x1f4,_0x2d38('0x2e')));}if(_[_0x2d38('0x2f')](_0x1194cf['body']['body'])||_0x1194cf[_0x2d38('0x28')][_0x2d38('0x28')]===''){return _0x82bb9(_0x2af2c3[_0x2d38('0x16')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x2d38('0x2f')](_0x1194cf[_0x2d38('0x28')][_0x2d38('0x30')])){return _0x82bb9(_0x2af2c3['error'](0x1f4,_0x2d38('0x31')+_0x234b9e));}if(!_[_0x2d38('0x32')](_0x234b9e,_0x1194cf[_0x2d38('0x28')]['mapKey'])){return _0x82bb9(_0x2af2c3['error'](0x1f4,_0x2d38('0x33')+_0x234b9e));}var _0x18cc37={};_0x18cc37[_0x1194cf[_0x2d38('0x28')][_0x2d38('0x30')]]=_0x1194cf['body'][_0x2d38('0x34')];return db[_0x2d38('0x24')][_0x2d38('0x25')]({'where':{'id':_0x1194cf['account']['id']},'include':[{'model':db[_0x2d38('0x35')],'as':'List','include':[{'model':db['CmContact'],'as':_0x2d38('0x36'),'where':_0x18cc37,'limit':0x1,'order':[[_0x2d38('0x2c'),_0x2d38('0x37')]]}]},{'model':db[_0x2d38('0x38')],'as':'Applications'},{'model':db['MailServerOut'],'as':_0x2d38('0x39')}]})['then'](function(_0x9c67cb){if(_0x9c67cb&&_0x9c67cb[_0x2d38('0x3a')]){var _0x30c1b2=_0x9c67cb[_0x2d38('0x3b')]({'plain':!![]});_0x1e1d70[_0x2d38('0x3c')]=_[_0x2d38('0x3d')](_0x30c1b2,[_0x2d38('0x3e'),_0x2d38('0x3a')]);_0x1e1d70[_0x2d38('0x3f')]=_0x30c1b2['Applications'];_0x1e1d70[_0x2d38('0x40')]=_0x30c1b2['List'];_0x1e1d70[_0x2d38('0x3f')]=_[_0x2d38('0x41')](_0x1e1d70['applications'],[_0x2d38('0x42')],[_0x2d38('0x43')]);if(_0x1e1d70[_0x2d38('0x3c')]&&_0x1e1d70[_0x2d38('0x3c')][_0x2d38('0x44')]){_0x1e1d70[_0x2d38('0x3f')][_0x2d38('0x45')]({'id':0x0,'priority':_0x1e1d70[_0x2d38('0x3f')]['length']+0x1,'app':_0x2d38('0x46'),'appdata':_0x2d38('0x44'),'interval':_0x2d38('0x47')});}if(_0x1e1d70[_0x2d38('0x3c')][_0x2d38('0x3e')]){delete _0x1e1d70[_0x2d38('0x3c')][_0x2d38('0x3e')];}if(_0x1e1d70[_0x2d38('0x3c')][_0x2d38('0x3a')]){delete _0x1e1d70['account'][_0x2d38('0x3a')];}if(_0x30c1b2[_0x2d38('0x3a')]['Contacts']['length']){return _0x30c1b2[_0x2d38('0x3a')][_0x2d38('0x36')][0x0];}var _0x208ae0=_[_0x2d38('0x48')](_0x1194cf['body'],{'firstName':_0x1194cf['body'][_0x2d38('0x34')],'ListId':_0x30c1b2[_0x2d38('0x2d')]});_0x208ae0[_0x1194cf[_0x2d38('0x28')][_0x2d38('0x30')]]=_0x1194cf[_0x2d38('0x28')][_0x2d38('0x34')];return db[_0x2d38('0x49')][_0x2d38('0x4a')](_0x208ae0);}else{throw new Error(_0x2d38('0x4b'));}})[_0x2d38('0x10')](function(_0x1afa40){_0x1e1d70['contact']=_0x1afa40;if(_0x1afa40){if(!_0x1194cf[_0x2d38('0x28')]['message']['messageId']){_0x1194cf[_0x2d38('0x28')][_0x2d38('0x18')][_0x2d38('0x4c')]=rs['generate']()+'\x20'+_0x1194cf['body'][_0x2d38('0x18')][_0x2d38('0x34')];}var _0x5a8820={'ContactId':_0x1afa40['id'],'MailAccountId':_0x1194cf[_0x2d38('0x3c')]['id'],'inReplyTo':_0x1194cf[_0x2d38('0x28')][_0x2d38('0x18')][_0x2d38('0x4c')],'to':_0x1194cf[_0x2d38('0x28')]['message']['from'],'cc':_0x1194cf[_0x2d38('0x28')]['message']['cc'],'subject':_0x1194cf[_0x2d38('0x28')][_0x2d38('0x18')][_0x2d38('0x4d')],'attach':_0x1194cf[_0x2d38('0x28')]['message'][_0x2d38('0x4e')],'lastMsgAt':moment()[_0x2d38('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x1194cf[_0x2d38('0x28')][_0x2d38('0x28')]};return db['MailInteraction'][_0x2d38('0x25')]({'where':{'closed':![],'MailAccountId':_0x1194cf['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x2d38('0x50'),'attributes':[_0x2d38('0x4c')],'where':{'messageId':_0x1194cf['body']['message'][_0x2d38('0x51')]}}]})['then'](function(_0x1ad19e){if(_0x1ad19e){return[_0x1ad19e,![]];}return db[_0x2d38('0x52')][_0x2d38('0x4a')](_0x5a8820)['then'](function(_0x5f0a8a){return[_0x5f0a8a,!![]];});});}else{throw new Error(_0x2d38('0x53'));}})[_0x2d38('0x54')](function(_0x5c8a2e,_0x750ef1){if(_0x5c8a2e){_0x17cc8d=_0x750ef1;if(!_0x750ef1){return _0x5c8a2e[_0x2d38('0x55')]({'inReplyTo':_0x1194cf[_0x2d38('0x28')][_0x2d38('0x18')][_0x2d38('0x4c')],'to':_0x1194cf['body'][_0x2d38('0x18')]['from'],'cc':_0x1194cf[_0x2d38('0x28')][_0x2d38('0x18')]['cc'],'subject':_0x1194cf['body']['message'][_0x2d38('0x4d')],'attach':_0x5c8a2e[_0x2d38('0x4e')]?_0x5c8a2e[_0x2d38('0x4e')]:_0x1194cf[_0x2d38('0x28')]['message'][_0x2d38('0x4e')],'substatus':null,'substatusAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x2d38('0x4f')](_0x2d38('0x56')),'lastMsgDirection':'in','lastMsgBody':_0x1194cf[_0x2d38('0x28')][_0x2d38('0x28')]});}else{return _0x5c8a2e;}}})['then'](function(_0x453fff){_0x1e1d70[_0x2d38('0x57')]=_0x453fff[_0x2d38('0x3b')]({'plain':!![]});_0x1e1d70[_0x2d38('0x57')]['created']=_0x17cc8d;return db['MailMessage']['create']({'body':_0x1194cf['body']['body'],'MailAccountId':_0x1194cf['account']['id'],'MailInteractionId':_0x453fff['id'],'direction':'in','ContactId':_0x1e1d70[_0x2d38('0x58')]['id'],'messageId':_0x1194cf[_0x2d38('0x28')][_0x2d38('0x18')][_0x2d38('0x4c')],'from':_0x1194cf[_0x2d38('0x28')]['message'][_0x2d38('0x34')],'to':_0x1194cf[_0x2d38('0x28')][_0x2d38('0x18')]['to'],'cc':_0x1194cf[_0x2d38('0x28')]['message']['cc'],'subject':_0x1194cf[_0x2d38('0x28')][_0x2d38('0x18')][_0x2d38('0x4d')],'attach':_0x1194cf[_0x2d38('0x28')][_0x2d38('0x18')][_0x2d38('0x4e')],'Attachments':_0x1194cf[_0x2d38('0x28')][_0x2d38('0x18')][_0x2d38('0x59')],'originTo':_0x1194cf['body'][_0x2d38('0x18')][_0x2d38('0x5a')],'originCc':_0x1194cf[_0x2d38('0x28')]['message'][_0x2d38('0x5b')],'bcc':_0x1194cf[_0x2d38('0x28')][_0x2d38('0x18')][_0x2d38('0x5c')]},{'include':[{'model':db[_0x2d38('0x5d')],'as':_0x2d38('0x5e')}]});})['then'](function(_0x2f3e38){_0x1e1d70[_0x2d38('0x18')]=_0x2f3e38;if(_0x1e1d70[_0x2d38('0x57')][_0x2d38('0x5f')]){return db[_0x2d38('0x60')]['find']({'attributes':['id',_0x2d38('0x61')],'where':{'id':_0x1e1d70['interaction'][_0x2d38('0x5f')]}})['then'](function(_0xe77ef7){if(_0xe77ef7){_0x1e1d70[_0x2d38('0x3f')]['unshift']({'id':0x0,'priority':0x0,'app':_0x2d38('0x62'),'appdata':_0xe77ef7[_0x2d38('0x61')]+','+(_0x1e1d70[_0x2d38('0x3c')][_0x2d38('0x63')]||0xa),'interval':_0x2d38('0x47')});}return respondWithRpcPromise(_0x2d38('0x64'),_0x2d38('0x65'),_0x1e1d70);});}return respondWithRpcPromise(_0x2d38('0x64'),_0x2d38('0x65'),_0x1e1d70);})[_0x2d38('0x10')](function(_0x1e4eba){_0x3cd072(_0x1e4eba);})[_0x2d38('0x23')](function(_0x335e11){_0x82bb9(_0x2af2c3[_0x2d38('0x16')](0x1f4,_0x335e11[_0x2d38('0x18')]));});});}; \ No newline at end of file +var _0x345e=['request\x20sent','debug','stringify','error','MailAccount,\x20%s,\x20%s','message','result','catch','MailAccount','findAll','options','where','attributes','limit','include','model','GetMailAccount','ShowMailAccount','map','NotifyMailAccount','body','mail','keys','CmContact','rawAttributes','createdAt','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','find','account','CmList','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','get','omit','Applications','list','applications','orderBy','asc','autoclose','length','*,*,*,*','create','List\x20not\x20found','contact','messageId','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','update','subject','interaction','attachments','bcc','Attachment','Attachments','UserId','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info'];(function(_0x2c3a88,_0x48637e){var _0x4a7925=function(_0x15780f){while(--_0x15780f){_0x2c3a88['push'](_0x2c3a88['shift']());}};_0x4a7925(++_0x48637e);}(_0x345e,0x168));var _0xe345=function(_0x70504d,_0x34e810){_0x70504d=_0x70504d-0x0;var _0x47e29b=_0x345e[_0x70504d];return _0x47e29b;};'use strict';var _=require(_0xe345('0x0'));var util=require(_0xe345('0x1'));var moment=require('moment');var BPromise=require(_0xe345('0x2'));var rs=require(_0xe345('0x3'));var fs=require('fs');var Redis=require(_0xe345('0x4'));var db=require(_0xe345('0x5'))['db'];var utils=require(_0xe345('0x6'));var logger=require(_0xe345('0x7'))(_0xe345('0x8'));var config=require(_0xe345('0x9'));var jayson=require(_0xe345('0xa'));var client=jayson['client'][_0xe345('0xb')]({'port':0x232c});config[_0xe345('0xc')]=_[_0xe345('0xd')](config[_0xe345('0xc')],{'host':_0xe345('0xe'),'port':0x18eb});var socket=require(_0xe345('0xf'))(new Redis(config['redis']));require('./mailAccount.socket')[_0xe345('0x10')](socket);function respondWithRpcPromise(_0x47382b,_0x322dc6,_0x15aa5a){return new BPromise(function(_0x3d2b81,_0x30d4d2){return client[_0xe345('0x11')](_0x47382b,_0x15aa5a)[_0xe345('0x12')](function(_0x2cd68b){logger[_0xe345('0x13')]('MailAccount,\x20%s,\x20%s',_0x322dc6,_0xe345('0x14'));logger[_0xe345('0x15')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x322dc6,'request\x20sent',JSON[_0xe345('0x16')](_0x2cd68b));if(_0x2cd68b['error']){if(_0x2cd68b[_0xe345('0x17')]['code']===0x1f4){logger['error'](_0xe345('0x18'),_0x322dc6,_0x2cd68b[_0xe345('0x17')][_0xe345('0x19')]);return _0x30d4d2(_0x2cd68b[_0xe345('0x17')][_0xe345('0x19')]);}logger[_0xe345('0x17')](_0xe345('0x18'),_0x322dc6,_0x2cd68b[_0xe345('0x17')][_0xe345('0x19')]);return _0x3d2b81(_0x2cd68b[_0xe345('0x17')]['message']);}else{logger['info'](_0xe345('0x18'),_0x322dc6,_0xe345('0x14'));_0x3d2b81(_0x2cd68b[_0xe345('0x1a')][_0xe345('0x19')]);}})[_0xe345('0x1b')](function(_0x4bed9f){logger[_0xe345('0x17')](_0xe345('0x18'),_0x322dc6,_0x4bed9f);_0x30d4d2(_0x4bed9f);});});}exports['GetMailAccount']=function(_0xcc5f61){var _0x1bf973=this;return new Promise(function(_0x1c36f4,_0x6ea93d){return db[_0xe345('0x1c')][_0xe345('0x1d')]({'raw':_0xcc5f61['options']?_0xcc5f61[_0xe345('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0xcc5f61[_0xe345('0x1e')]?_0xcc5f61['options'][_0xe345('0x1f')]||null:null,'attributes':_0xcc5f61[_0xe345('0x1e')]?_0xcc5f61[_0xe345('0x1e')][_0xe345('0x20')]||null:null,'limit':_0xcc5f61['options']?_0xcc5f61['options'][_0xe345('0x21')]||null:null,'include':_0xcc5f61[_0xe345('0x1e')]?_0xcc5f61['options']['include']?_['map'](_0xcc5f61[_0xe345('0x1e')][_0xe345('0x22')],function(_0x305439){return{'model':db[_0x305439['model']],'as':_0x305439['as'],'attributes':_0x305439['attributes'],'include':_0x305439[_0xe345('0x22')]?_['map'](_0x305439[_0xe345('0x22')],function(_0x76b74c){return{'model':db[_0x76b74c[_0xe345('0x23')]],'as':_0x76b74c['as'],'attributes':_0x76b74c['attributes'],'include':_0x76b74c[_0xe345('0x22')]?_['map'](_0x76b74c[_0xe345('0x22')],function(_0x4aee1f){return{'model':db[_0x4aee1f[_0xe345('0x23')]],'as':_0x4aee1f['as'],'attributes':_0x4aee1f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a8cc7){logger[_0xe345('0x13')](_0xe345('0x24'),_0xcc5f61);logger[_0xe345('0x15')](_0xe345('0x24'),_0xcc5f61,JSON['stringify'](_0x2a8cc7));_0x1c36f4(_0x2a8cc7);})[_0xe345('0x1b')](function(_0x34ec29){logger[_0xe345('0x17')](_0xe345('0x24'),_0x34ec29[_0xe345('0x19')],_0xcc5f61);_0x6ea93d(_0x1bf973['error'](0x1f4,_0x34ec29[_0xe345('0x19')]));});});};exports[_0xe345('0x25')]=function(_0x5ded18){var _0x150df8=this;return new Promise(function(_0x43d4af,_0x2acfff){return db['MailAccount']['find']({'raw':_0x5ded18[_0xe345('0x1e')]?_0x5ded18[_0xe345('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x5ded18[_0xe345('0x1e')]?_0x5ded18[_0xe345('0x1e')][_0xe345('0x1f')]||null:null,'attributes':_0x5ded18[_0xe345('0x1e')]?_0x5ded18[_0xe345('0x1e')][_0xe345('0x20')]||null:null,'include':_0x5ded18[_0xe345('0x1e')]?_0x5ded18[_0xe345('0x1e')][_0xe345('0x22')]?_['map'](_0x5ded18[_0xe345('0x1e')][_0xe345('0x22')],function(_0x428e91){return{'model':db[_0x428e91[_0xe345('0x23')]],'as':_0x428e91['as'],'attributes':_0x428e91[_0xe345('0x20')],'include':_0x428e91[_0xe345('0x22')]?_['map'](_0x428e91['include'],function(_0x5b6413){return{'model':db[_0x5b6413[_0xe345('0x23')]],'as':_0x5b6413['as'],'attributes':_0x5b6413['attributes'],'include':_0x5b6413[_0xe345('0x22')]?_[_0xe345('0x26')](_0x5b6413[_0xe345('0x22')],function(_0x2b719c){return{'model':db[_0x2b719c['model']],'as':_0x2b719c['as'],'attributes':_0x2b719c[_0xe345('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe345('0x12')](function(_0x1661f1){logger['info'](_0xe345('0x25'),_0x5ded18);logger[_0xe345('0x15')](_0xe345('0x25'),_0x5ded18,JSON['stringify'](_0x1661f1));_0x43d4af(_0x1661f1);})['catch'](function(_0x440208){logger[_0xe345('0x17')](_0xe345('0x25'),_0x440208['message'],_0x5ded18);_0x2acfff(_0x150df8['error'](0x1f4,_0x440208[_0xe345('0x19')]));});});};exports[_0xe345('0x27')]=function(_0xa7229d){var _0x2948f9=this;return new Promise(function(_0x3452f9,_0xb4baba){var _0x7455ab={'body':_0xa7229d[_0xe345('0x28')],'channel':_0xe345('0x29')};var _0x3c8bb1=_['difference'](_[_0xe345('0x2a')](db[_0xe345('0x2b')][_0xe345('0x2c')]),[_0xe345('0x2d'),'updatedAt','CompanyId','ListId']);var _0x3d019c=![];if(_0xa7229d[_0xe345('0x28')]['id']){delete _0xa7229d[_0xe345('0x28')]['id'];}if(_[_0xe345('0x2e')](_0xa7229d[_0xe345('0x28')][_0xe345('0x2f')])){return _0xb4baba(_0x2948f9[_0xe345('0x17')](0x1f4,_0xe345('0x30')));}if(_['isNil'](_0xa7229d[_0xe345('0x28')][_0xe345('0x28')])||_0xa7229d['body']['body']===''){return _0xb4baba(_0x2948f9[_0xe345('0x17')](0x1f4,_0xe345('0x31')));}if(_[_0xe345('0x2e')](_0xa7229d['body'][_0xe345('0x32')])){return _0xb4baba(_0x2948f9[_0xe345('0x17')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3c8bb1));}if(!_['includes'](_0x3c8bb1,_0xa7229d[_0xe345('0x28')][_0xe345('0x32')])){return _0xb4baba(_0x2948f9['error'](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3c8bb1));}var _0x383117={};_0x383117[_0xa7229d['body'][_0xe345('0x32')]]=_0xa7229d['body']['from'];return db[_0xe345('0x1c')][_0xe345('0x33')]({'where':{'id':_0xa7229d[_0xe345('0x34')]['id']},'include':[{'model':db[_0xe345('0x35')],'as':_0xe345('0x36'),'include':[{'model':db[_0xe345('0x2b')],'as':_0xe345('0x37'),'where':_0x383117,'limit':0x1,'order':[[_0xe345('0x38'),_0xe345('0x39')]]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db[_0xe345('0x3a')],'as':_0xe345('0x3b')}]})[_0xe345('0x12')](function(_0x4a63b3){if(_0x4a63b3&&_0x4a63b3[_0xe345('0x36')]){var _0x4ef10=_0x4a63b3[_0xe345('0x3c')]({'plain':!![]});_0x7455ab[_0xe345('0x34')]=_[_0xe345('0x3d')](_0x4ef10,['Applications','List']);_0x7455ab['applications']=_0x4ef10[_0xe345('0x3e')];_0x7455ab[_0xe345('0x3f')]=_0x4ef10[_0xe345('0x36')];_0x7455ab[_0xe345('0x40')]=_[_0xe345('0x41')](_0x7455ab[_0xe345('0x40')],['priority'],[_0xe345('0x42')]);if(_0x7455ab['account']&&_0x7455ab[_0xe345('0x34')][_0xe345('0x43')]){_0x7455ab[_0xe345('0x40')]['push']({'id':0x0,'priority':_0x7455ab[_0xe345('0x40')][_0xe345('0x44')]+0x1,'app':'close','appdata':_0xe345('0x43'),'interval':_0xe345('0x45')});}if(_0x7455ab[_0xe345('0x34')]['Applications']){delete _0x7455ab[_0xe345('0x34')]['Applications'];}if(_0x7455ab[_0xe345('0x34')][_0xe345('0x36')]){delete _0x7455ab['account'][_0xe345('0x36')];}if(_0x4ef10['List']['Contacts'][_0xe345('0x44')]){return _0x4ef10[_0xe345('0x36')][_0xe345('0x37')][0x0];}var _0x5b8e1f=_['defaults'](_0xa7229d['body'],{'firstName':_0xa7229d[_0xe345('0x28')][_0xe345('0x2f')],'ListId':_0x4ef10['ListId']});_0x5b8e1f[_0xa7229d[_0xe345('0x28')][_0xe345('0x32')]]=_0xa7229d[_0xe345('0x28')][_0xe345('0x2f')];return db['CmContact'][_0xe345('0x46')](_0x5b8e1f);}else{throw new Error(_0xe345('0x47'));}})[_0xe345('0x12')](function(_0x56243a){_0x7455ab[_0xe345('0x48')]=_0x56243a;if(_0x56243a){if(!_0xa7229d[_0xe345('0x28')][_0xe345('0x19')][_0xe345('0x49')]){_0xa7229d[_0xe345('0x28')][_0xe345('0x19')][_0xe345('0x49')]=rs['generate']()+'\x20'+_0xa7229d[_0xe345('0x28')]['message'][_0xe345('0x2f')];}var _0x5b8e44={'ContactId':_0x56243a['id'],'MailAccountId':_0xa7229d['account']['id'],'inReplyTo':_0xa7229d['body'][_0xe345('0x19')][_0xe345('0x49')],'to':_0xa7229d[_0xe345('0x28')]['message'][_0xe345('0x2f')],'cc':_0xa7229d[_0xe345('0x28')][_0xe345('0x19')]['cc'],'subject':_0xa7229d[_0xe345('0x28')][_0xe345('0x19')]['subject'],'attach':_0xa7229d[_0xe345('0x28')][_0xe345('0x19')][_0xe345('0x4a')],'lastMsgAt':moment()[_0xe345('0x4b')](_0xe345('0x4c')),'lastMsgDirection':'in','lastMsgBody':_0xa7229d[_0xe345('0x28')][_0xe345('0x28')]};return db[_0xe345('0x4d')][_0xe345('0x33')]({'where':{'closed':![],'MailAccountId':_0xa7229d[_0xe345('0x34')]['id']},'include':[{'model':db[_0xe345('0x4e')],'as':_0xe345('0x4f'),'attributes':['messageId'],'where':{'messageId':_0xa7229d[_0xe345('0x28')][_0xe345('0x19')][_0xe345('0x50')]}}]})[_0xe345('0x12')](function(_0x1c21ea){if(_0x1c21ea){return[_0x1c21ea,![]];}return db[_0xe345('0x4d')][_0xe345('0x46')](_0x5b8e44)[_0xe345('0x12')](function(_0x12c627){return[_0x12c627,!![]];});});}else{throw new Error(_0xe345('0x51'));}})['spread'](function(_0x2c3b74,_0x15359c){if(_0x2c3b74){_0x3d019c=_0x15359c;if(!_0x15359c){return _0x2c3b74[_0xe345('0x52')]({'inReplyTo':_0xa7229d[_0xe345('0x28')]['message'][_0xe345('0x49')],'to':_0xa7229d[_0xe345('0x28')][_0xe345('0x19')][_0xe345('0x2f')],'cc':_0xa7229d['body'][_0xe345('0x19')]['cc'],'subject':_0xa7229d[_0xe345('0x28')][_0xe345('0x19')][_0xe345('0x53')],'attach':_0x2c3b74['attach']?_0x2c3b74['attach']:_0xa7229d['body'][_0xe345('0x19')][_0xe345('0x4a')],'substatus':null,'substatusAt':moment()[_0xe345('0x4b')](_0xe345('0x4c')),'lastMsgAt':moment()[_0xe345('0x4b')](_0xe345('0x4c')),'lastMsgDirection':'in','lastMsgBody':_0xa7229d['body'][_0xe345('0x28')]});}else{return _0x2c3b74;}}})[_0xe345('0x12')](function(_0x348356){_0x7455ab[_0xe345('0x54')]=_0x348356['get']({'plain':!![]});_0x7455ab[_0xe345('0x54')]['created']=_0x3d019c;return db[_0xe345('0x4e')][_0xe345('0x46')]({'body':_0xa7229d[_0xe345('0x28')][_0xe345('0x28')],'MailAccountId':_0xa7229d['account']['id'],'MailInteractionId':_0x348356['id'],'direction':'in','ContactId':_0x7455ab[_0xe345('0x48')]['id'],'messageId':_0xa7229d[_0xe345('0x28')][_0xe345('0x19')]['messageId'],'from':_0xa7229d['body']['message'][_0xe345('0x2f')],'to':_0xa7229d[_0xe345('0x28')][_0xe345('0x19')]['to'],'cc':_0xa7229d[_0xe345('0x28')]['message']['cc'],'subject':_0xa7229d[_0xe345('0x28')][_0xe345('0x19')][_0xe345('0x53')],'attach':_0xa7229d[_0xe345('0x28')][_0xe345('0x19')][_0xe345('0x4a')],'Attachments':_0xa7229d[_0xe345('0x28')]['message'][_0xe345('0x55')],'originTo':_0xa7229d[_0xe345('0x28')][_0xe345('0x19')]['originTo'],'originCc':_0xa7229d[_0xe345('0x28')][_0xe345('0x19')]['originCc'],'bcc':_0xa7229d[_0xe345('0x28')][_0xe345('0x19')][_0xe345('0x56')]},{'include':[{'model':db[_0xe345('0x57')],'as':_0xe345('0x58')}]});})[_0xe345('0x12')](function(_0x1ef455){_0x7455ab[_0xe345('0x19')]=_0x1ef455;if(_0x7455ab[_0xe345('0x54')][_0xe345('0x59')]){return db['User'][_0xe345('0x33')]({'attributes':['id','name'],'where':{'id':_0x7455ab['interaction'][_0xe345('0x59')]}})['then'](function(_0x559b68){if(_0x559b68){_0x7455ab[_0xe345('0x40')]['unshift']({'id':0x0,'priority':0x0,'app':_0xe345('0x5a'),'appdata':_0x559b68[_0xe345('0x5b')]+','+(_0x7455ab[_0xe345('0x34')][_0xe345('0x5c')]||0xa),'interval':_0xe345('0x45')});}return respondWithRpcPromise(_0xe345('0x5d'),_0xe345('0x5e'),_0x7455ab);});}return respondWithRpcPromise(_0xe345('0x5d'),_0xe345('0x5e'),_0x7455ab);})['then'](function(_0x409c58){_0x3452f9(_0x409c58);})[_0xe345('0x1b')](function(_0x2f75ff){_0xb4baba(_0x2948f9[_0xe345('0x17')](0x1f4,_0x2f75ff['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index fac6c78..3f9b58d 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 _0x6003=['remove','update','emit','removeListener','register','mailAccount:','./mailAccount.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6003,0xae));var _0x3600=function(_0x4767c2,_0x1128b8){_0x4767c2=_0x4767c2-0x0;var _0x483521=_0x6003[_0x4767c2];return _0x483521;};'use strict';var MailAccountEvents=require(_0x3600('0x0'));var events=[_0x3600('0x1'),_0x3600('0x2'),_0x3600('0x3')];function createListener(_0x4f423f,_0x484cf5){return function(_0x367da4){_0x484cf5[_0x3600('0x4')](_0x4f423f,_0x367da4);};}function removeListener(_0x29c0fd,_0x47b8b3){return function(){MailAccountEvents[_0x3600('0x5')](_0x29c0fd,_0x47b8b3);};}exports[_0x3600('0x6')]=function(_0x53a557){for(var _0x2953ac=0x0,_0x4f4130=events['length'];_0x2953ac<_0x4f4130;_0x2953ac++){var _0x177f11=events[_0x2953ac];var _0x4a5962=createListener(_0x3600('0x7')+_0x177f11,_0x53a557);MailAccountEvents['on'](_0x177f11,_0x4a5962);}}; \ No newline at end of file +var _0xae1c=['removeListener','register','length','emit'];(function(_0x48186d,_0x5d76d0){var _0x3c4cf1=function(_0xc0c7c6){while(--_0xc0c7c6){_0x48186d['push'](_0x48186d['shift']());}};_0x3c4cf1(++_0x5d76d0);}(_0xae1c,0xff));var _0xcae1=function(_0x52e805,_0x1438fc){_0x52e805=_0x52e805-0x0;var _0x41ffa8=_0xae1c[_0x52e805];return _0x41ffa8;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save','remove','update'];function createListener(_0x1ab262,_0x19e218){return function(_0x3e2e25){_0x19e218[_0xcae1('0x0')](_0x1ab262,_0x3e2e25);};}function removeListener(_0x1d37db,_0x2b6b57){return function(){MailAccountEvents[_0xcae1('0x1')](_0x1d37db,_0x2b6b57);};}exports[_0xcae1('0x2')]=function(_0x3513e5){for(var _0x40fcec=0x0,_0x3c35c7=events[_0xcae1('0x3')];_0x40fcec<_0x3c35c7;_0x40fcec++){var _0x7a27b8=events[_0x40fcec];var _0x50d451=createListener('mailAccount:'+_0x7a27b8,_0x3513e5);MailAccountEvents['on'](_0x7a27b8,_0x50d451);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 9039c2b..c51755d 100644 --- a/server/api/mailApplication/index.js +++ b/server/api/mailApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf45e=['put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show'];(function(_0x4edda2,_0x472bc0){var _0x1b3455=function(_0x2e8634){while(--_0x2e8634){_0x4edda2['push'](_0x4edda2['shift']());}};_0x1b3455(++_0x472bc0);}(_0xf45e,0x115));var _0xef45=function(_0x141578,_0x2b6abd){_0x141578=_0x141578-0x0;var _0x5f1d89=_0xf45e[_0x141578];return _0x5f1d89;};'use strict';var multer=require(_0xef45('0x0'));var util=require('util');var path=require(_0xef45('0x1'));var timeout=require('connect-timeout');var express=require(_0xef45('0x2'));var router=express[_0xef45('0x3')]();var auth=require(_0xef45('0x4'));var interaction=require(_0xef45('0x5'));var config=require(_0xef45('0x6'));var controller=require(_0xef45('0x7'));router[_0xef45('0x8')](_0xef45('0x9'),auth[_0xef45('0xa')](),controller[_0xef45('0xb')]);router[_0xef45('0xc')](_0xef45('0x9'),auth[_0xef45('0xa')](),controller[_0xef45('0xd')]);router[_0xef45('0xe')](_0xef45('0x9'),auth[_0xef45('0xa')](),controller[_0xef45('0xf')]);module[_0xef45('0x10')]=router; \ No newline at end of file +var _0xd87e=['util','connect-timeout','express','Router','../../components/interaction/service','./mailApplication.controller','get','isAuthenticated','/:id','update','delete','destroy','exports','multer'];(function(_0x16197c,_0x54f90a){var _0x3136f1=function(_0x25288){while(--_0x25288){_0x16197c['push'](_0x16197c['shift']());}};_0x3136f1(++_0x54f90a);}(_0xd87e,0x1bf));var _0xed87=function(_0x1fd437,_0x2c0b47){_0x1fd437=_0x1fd437-0x0;var _0x40d9e6=_0xd87e[_0x1fd437];return _0x40d9e6;};'use strict';var multer=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var path=require('path');var timeout=require(_0xed87('0x2'));var express=require(_0xed87('0x3'));var router=express[_0xed87('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xed87('0x5'));var config=require('../../config/environment');var controller=require(_0xed87('0x6'));router[_0xed87('0x7')]('/:id',auth[_0xed87('0x8')](),controller['show']);router['put'](_0xed87('0x9'),auth[_0xed87('0x8')](),controller[_0xed87('0xa')]);router[_0xed87('0xb')]('/:id',auth[_0xed87('0x8')](),controller[_0xed87('0xc')]);module[_0xed87('0xd')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 48051ee..2eaab43 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 _0xc72e=['INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x447ddf,_0x11d244){var _0xa82f9=function(_0x836edb){while(--_0x836edb){_0x447ddf['push'](_0x447ddf['shift']());}};_0xa82f9(++_0x11d244);}(_0xc72e,0x10e));var _0xec72=function(_0x2a3e77,_0x4397a9){_0x2a3e77=_0x2a3e77-0x0;var _0x4abb67=_0xc72e[_0x2a3e77];return _0x4abb67;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xec72('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xec72('0x1')],'allowNull':![],'defaultValue':_0xec72('0x2')},'appdata':{'type':Sequelize[_0xec72('0x3')]()},'description':{'type':Sequelize[_0xec72('0x1')]},'interval':{'type':Sequelize[_0xec72('0x1')],'defaultValue':_0xec72('0x4')}}; \ No newline at end of file +var _0x1ea0=['noop','sequelize','exports','STRING'];(function(_0xa042a2,_0x59f0b9){var _0x398132=function(_0x1b8032){while(--_0x1b8032){_0xa042a2['push'](_0xa042a2['shift']());}};_0x398132(++_0x59f0b9);}(_0x1ea0,0x175));var _0x01ea=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1ea0[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x01ea('0x0'));module[_0x01ea('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x01ea('0x2')],'allowNull':![],'defaultValue':_0x01ea('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x01ea('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 4b53b9a..1a02162 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 _0x94cf=['rawAttributes','query','keys','filters','intersection','attributes','fields','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','show','params','model','MailApplication'];(function(_0x10c8d0,_0xb1965a){var _0x2321ee=function(_0x449f3b){while(--_0x449f3b){_0x10c8d0['push'](_0x10c8d0['shift']());}};_0x2321ee(++_0xb1965a);}(_0x94cf,0xc2));var _0xf94c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x94cf[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf94c('0x0'));var rimraf=require(_0xf94c('0x1'));var zipdir=require(_0xf94c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf94c('0x3'));var moment=require(_0xf94c('0x4'));var BPromise=require(_0xf94c('0x5'));var Mustache=require(_0xf94c('0x6'));var util=require(_0xf94c('0x7'));var path=require(_0xf94c('0x8'));var sox=require(_0xf94c('0x9'));var csv=require(_0xf94c('0xa'));var ejs=require(_0xf94c('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf94c('0xc'));var crypto=require(_0xf94c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf94c('0xe'));var toCsv=require(_0xf94c('0xa'));var querystring=require(_0xf94c('0xf'));var Papa=require(_0xf94c('0x10'));var Redis=require('ioredis');var authService=require(_0xf94c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf94c('0x12'));var hardwareService=require(_0xf94c('0x13'));var logger=require(_0xf94c('0x14'))(_0xf94c('0x15'));var utils=require(_0xf94c('0x16'));var config=require(_0xf94c('0x17'));var db=require(_0xf94c('0x18'))['db'];function respondWithStatusCode(_0x54a340,_0x182478){_0x182478=_0x182478||0xcc;return function(_0x326038){if(_0x326038){return _0x54a340[_0xf94c('0x19')](_0x182478);}return _0x54a340['status'](_0x182478)['end']();};}function respondWithResult(_0x456cb9,_0x1d8359){_0x1d8359=_0x1d8359||0xc8;return function(_0x3d44a9){if(_0x3d44a9){return _0x456cb9[_0xf94c('0x1a')](_0x1d8359)[_0xf94c('0x1b')](_0x3d44a9);}};}function respondWithFilteredResult(_0x2d9e06,_0x326cca){return function(_0x892620){if(_0x892620){var _0x5cef8b=_0x892620[_0xf94c('0x1c')],_0x1d410d=_0x326cca[_0xf94c('0x1d')],_0x31829e=_0x326cca[_0xf94c('0x1d')]+_0x326cca[_0xf94c('0x1e')],_0x410036;if(_0x31829e>=_0x5cef8b){_0x31829e=_0x5cef8b;_0x410036=0xc8;}else{_0x410036=0xce;}_0x2d9e06[_0xf94c('0x1a')](_0x410036);return _0x2d9e06[_0xf94c('0x1f')](_0xf94c('0x20'),_0x1d410d+'-'+_0x31829e+'/'+_0x5cef8b)['json'](_0x892620);}return null;};}function patchUpdates(_0x19a958){return function(_0x1b0a68){try{jsonpatch['apply'](_0x1b0a68,_0x19a958,!![]);}catch(_0x4353fe){return BPromise[_0xf94c('0x21')](_0x4353fe);}return _0x1b0a68[_0xf94c('0x22')]();};}function saveUpdates(_0x1cdcbf,_0x17b0db){return function(_0x540122){if(_0x540122){return _0x540122[_0xf94c('0x23')](_0x1cdcbf)[_0xf94c('0x24')](function(_0x490cce){return _0x490cce;});}return null;};}function removeEntity(_0x2384f8,_0x17370d){return function(_0x28bdb0){if(_0x28bdb0){return _0x28bdb0[_0xf94c('0x25')]()['then'](function(){_0x2384f8[_0xf94c('0x1a')](0xcc)[_0xf94c('0x26')]();});}};}function handleEntityNotFound(_0x4de690,_0x4f8fd2){return function(_0x42c3f5){if(!_0x42c3f5){_0x4de690[_0xf94c('0x19')](0x194);}return _0x42c3f5;};}function handleError(_0x39d765,_0x41c890){_0x41c890=_0x41c890||0x1f4;return function(_0x1a49a5){logger[_0xf94c('0x27')](_0x1a49a5['stack']);if(_0x1a49a5['name']){delete _0x1a49a5[_0xf94c('0x28')];}_0x39d765[_0xf94c('0x1a')](_0x41c890)[_0xf94c('0x29')](_0x1a49a5);};}exports[_0xf94c('0x2a')]=function(_0x1fc75c,_0x449d76){var _0x4959b0={'raw':!![],'where':{'id':_0x1fc75c[_0xf94c('0x2b')]['id']}},_0x48fb09={};_0x48fb09[_0xf94c('0x2c')]=_['keys'](db[_0xf94c('0x2d')][_0xf94c('0x2e')]);_0x48fb09[_0xf94c('0x2f')]=_[_0xf94c('0x30')](_0x1fc75c[_0xf94c('0x2f')]);_0x48fb09[_0xf94c('0x31')]=_[_0xf94c('0x32')](_0x48fb09[_0xf94c('0x2c')],_0x48fb09['query']);_0x4959b0[_0xf94c('0x33')]=_[_0xf94c('0x32')](_0x48fb09[_0xf94c('0x2c')],qs[_0xf94c('0x34')](_0x1fc75c[_0xf94c('0x2f')][_0xf94c('0x34')]));_0x4959b0['attributes']=_0x4959b0[_0xf94c('0x33')]['length']?_0x4959b0[_0xf94c('0x33')]:_0x48fb09['model'];if(_0x1fc75c['query'][_0xf94c('0x35')]){_0x4959b0[_0xf94c('0x36')]=[{'all':!![]}];}_0x4959b0=_[_0xf94c('0x37')]({},_0x4959b0,_0x1fc75c[_0xf94c('0x38')]);return db[_0xf94c('0x2d')][_0xf94c('0x39')](_0x4959b0)[_0xf94c('0x24')](handleEntityNotFound(_0x449d76,null))[_0xf94c('0x24')](respondWithResult(_0x449d76,null))[_0xf94c('0x3a')](handleError(_0x449d76,null));};exports['update']=function(_0x1be309,_0x57af48){if(_0x1be309[_0xf94c('0x3b')]['id']){delete _0x1be309['body']['id'];}return db['MailApplication'][_0xf94c('0x39')]({'where':{'id':_0x1be309['params']['id']}})[_0xf94c('0x24')](handleEntityNotFound(_0x57af48,null))[_0xf94c('0x24')](saveUpdates(_0x1be309[_0xf94c('0x3b')],null))['then'](respondWithResult(_0x57af48,null))['catch'](handleError(_0x57af48,null));};exports[_0xf94c('0x25')]=function(_0x34fb0e,_0x2ee3b6){return db['MailApplication'][_0xf94c('0x39')]({'where':{'id':_0x34fb0e[_0xf94c('0x2b')]['id']}})['then'](handleEntityNotFound(_0x2ee3b6,null))[_0xf94c('0x24')](removeEntity(_0x2ee3b6,null))[_0xf94c('0x3a')](handleError(_0x2ee3b6,null));}; \ No newline at end of file +var _0xdfcf=['path','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','Content-Range','apply','update','destroy','end','error','stack','name','send','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','includeAll','include','merge','options','find','then','body','params','catch','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xdfcf,0x1df));var _0xfdfc=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0xdfcf[_0x31ced5];return _0x10d9e5;};'use strict';var pdf=require(_0xfdfc('0x0'));var emlformat=require(_0xfdfc('0x1'));var rimraf=require(_0xfdfc('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfdfc('0x3'));var rp=require('request-promise');var moment=require(_0xfdfc('0x4'));var BPromise=require(_0xfdfc('0x5'));var Mustache=require(_0xfdfc('0x6'));var util=require('util');var path=require(_0xfdfc('0x7'));var sox=require('sox');var csv=require(_0xfdfc('0x8'));var ejs=require(_0xfdfc('0x9'));var fs=require('fs');var _=require(_0xfdfc('0xa'));var squel=require(_0xfdfc('0xb'));var crypto=require(_0xfdfc('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfdfc('0x8'));var querystring=require('querystring');var Papa=require(_0xfdfc('0xd'));var Redis=require(_0xfdfc('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfdfc('0xf'));var hardwareService=require(_0xfdfc('0x10'));var logger=require(_0xfdfc('0x11'))(_0xfdfc('0x12'));var utils=require(_0xfdfc('0x13'));var config=require(_0xfdfc('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d342a,_0x578810){_0x578810=_0x578810||0xcc;return function(_0x585c83){if(_0x585c83){return _0x1d342a[_0xfdfc('0x15')](_0x578810);}return _0x1d342a[_0xfdfc('0x16')](_0x578810)['end']();};}function respondWithResult(_0x30c317,_0x1b7125){_0x1b7125=_0x1b7125||0xc8;return function(_0x2f1fa5){if(_0x2f1fa5){return _0x30c317[_0xfdfc('0x16')](_0x1b7125)[_0xfdfc('0x17')](_0x2f1fa5);}};}function respondWithFilteredResult(_0x3f07db,_0x93fb40){return function(_0x371656){if(_0x371656){var _0x15e73a=_0x371656[_0xfdfc('0x18')],_0x4c392c=_0x93fb40[_0xfdfc('0x19')],_0x59057d=_0x93fb40[_0xfdfc('0x19')]+_0x93fb40[_0xfdfc('0x1a')],_0x31b9b1;if(_0x59057d>=_0x15e73a){_0x59057d=_0x15e73a;_0x31b9b1=0xc8;}else{_0x31b9b1=0xce;}_0x3f07db[_0xfdfc('0x16')](_0x31b9b1);return _0x3f07db['set'](_0xfdfc('0x1b'),_0x4c392c+'-'+_0x59057d+'/'+_0x15e73a)['json'](_0x371656);}return null;};}function patchUpdates(_0x3aca67){return function(_0x2263dc){try{jsonpatch[_0xfdfc('0x1c')](_0x2263dc,_0x3aca67,!![]);}catch(_0x270e82){return BPromise['reject'](_0x270e82);}return _0x2263dc['save']();};}function saveUpdates(_0xad67fc,_0x5ac748){return function(_0x114fa2){if(_0x114fa2){return _0x114fa2[_0xfdfc('0x1d')](_0xad67fc)['then'](function(_0x3e14c4){return _0x3e14c4;});}return null;};}function removeEntity(_0x5dc332,_0x402ff9){return function(_0x4b26f1){if(_0x4b26f1){return _0x4b26f1[_0xfdfc('0x1e')]()['then'](function(){_0x5dc332[_0xfdfc('0x16')](0xcc)[_0xfdfc('0x1f')]();});}};}function handleEntityNotFound(_0x3491c6,_0x1a3e6f){return function(_0x15bd0f){if(!_0x15bd0f){_0x3491c6[_0xfdfc('0x15')](0x194);}return _0x15bd0f;};}function handleError(_0x58a57c,_0x4208da){_0x4208da=_0x4208da||0x1f4;return function(_0x554659){logger[_0xfdfc('0x20')](_0x554659[_0xfdfc('0x21')]);if(_0x554659['name']){delete _0x554659[_0xfdfc('0x22')];}_0x58a57c['status'](_0x4208da)[_0xfdfc('0x23')](_0x554659);};}exports['show']=function(_0x8a7b5f,_0x2a69ea){var _0x10a7dd={'raw':!![],'where':{'id':_0x8a7b5f['params']['id']}},_0x4206d5={};_0x4206d5[_0xfdfc('0x24')]=_['keys'](db[_0xfdfc('0x25')][_0xfdfc('0x26')]);_0x4206d5[_0xfdfc('0x27')]=_[_0xfdfc('0x28')](_0x8a7b5f['query']);_0x4206d5[_0xfdfc('0x29')]=_[_0xfdfc('0x2a')](_0x4206d5[_0xfdfc('0x24')],_0x4206d5['query']);_0x10a7dd[_0xfdfc('0x2b')]=_['intersection'](_0x4206d5[_0xfdfc('0x24')],qs[_0xfdfc('0x2c')](_0x8a7b5f[_0xfdfc('0x27')]['fields']));_0x10a7dd[_0xfdfc('0x2b')]=_0x10a7dd[_0xfdfc('0x2b')]['length']?_0x10a7dd[_0xfdfc('0x2b')]:_0x4206d5['model'];if(_0x8a7b5f[_0xfdfc('0x27')][_0xfdfc('0x2d')]){_0x10a7dd[_0xfdfc('0x2e')]=[{'all':!![]}];}_0x10a7dd=_[_0xfdfc('0x2f')]({},_0x10a7dd,_0x8a7b5f[_0xfdfc('0x30')]);return db[_0xfdfc('0x25')][_0xfdfc('0x31')](_0x10a7dd)['then'](handleEntityNotFound(_0x2a69ea,null))[_0xfdfc('0x32')](respondWithResult(_0x2a69ea,null))['catch'](handleError(_0x2a69ea,null));};exports[_0xfdfc('0x1d')]=function(_0x56be07,_0x5e39f6){if(_0x56be07[_0xfdfc('0x33')]['id']){delete _0x56be07['body']['id'];}return db['MailApplication']['find']({'where':{'id':_0x56be07[_0xfdfc('0x34')]['id']}})[_0xfdfc('0x32')](handleEntityNotFound(_0x5e39f6,null))[_0xfdfc('0x32')](saveUpdates(_0x56be07['body'],null))[_0xfdfc('0x32')](respondWithResult(_0x5e39f6,null))[_0xfdfc('0x35')](handleError(_0x5e39f6,null));};exports[_0xfdfc('0x1e')]=function(_0x59afc1,_0x2720a6){return db[_0xfdfc('0x25')][_0xfdfc('0x31')]({'where':{'id':_0x59afc1[_0xfdfc('0x34')]['id']}})[_0xfdfc('0x32')](handleEntityNotFound(_0x2720a6,null))[_0xfdfc('0x32')](removeEntity(_0x2720a6,null))[_0xfdfc('0x35')](handleError(_0x2720a6,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 5177476..618ab03 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 _0x253d=['../../config/environment','exports','define','MailApplication','utf8mb4','utf8mb4_unicode_ci','lodash','bluebird','request-promise','path','rimraf'];(function(_0xa60b9,_0x41ab8d){var _0xa3dc1a=function(_0x32928f){while(--_0x32928f){_0xa60b9['push'](_0xa60b9['shift']());}};_0xa3dc1a(++_0x41ab8d);}(_0x253d,0x1b3));var _0xd253=function(_0xf894e1,_0x1b7304){_0xf894e1=_0xf894e1-0x0;var _0x3b1e1b=_0x253d[_0xf894e1];return _0x3b1e1b;};'use strict';var _=require(_0xd253('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd253('0x1'));var rp=require(_0xd253('0x2'));var fs=require('fs');var path=require(_0xd253('0x3'));var rimraf=require(_0xd253('0x4'));var config=require(_0xd253('0x5'));var attributes=require('./mailApplication.attributes');module[_0xd253('0x6')]=function(_0x42d36c,_0x3dca3d){return _0x42d36c[_0xd253('0x7')](_0xd253('0x8'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd253('0x9'),'collate':_0xd253('0xa')});}; \ No newline at end of file +var _0xfbbb=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','MailApplication','utf8mb4'];(function(_0x1e381c,_0x47b5b9){var _0x9b5ea9=function(_0x6d2be5){while(--_0x6d2be5){_0x1e381c['push'](_0x1e381c['shift']());}};_0x9b5ea9(++_0x47b5b9);}(_0xfbbb,0x1b3));var _0xbfbb=function(_0x58df3e,_0x5af484){_0x58df3e=_0x58df3e-0x0;var _0x23c60a=_0xfbbb[_0x58df3e];return _0x23c60a;};'use strict';var _=require(_0xbfbb('0x0'));var util=require(_0xbfbb('0x1'));var logger=require(_0xbfbb('0x2'))(_0xbfbb('0x3'));var moment=require(_0xbfbb('0x4'));var BPromise=require(_0xbfbb('0x5'));var rp=require(_0xbfbb('0x6'));var fs=require('fs');var path=require(_0xbfbb('0x7'));var rimraf=require(_0xbfbb('0x8'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0xbfbb('0x9')]=function(_0x568492,_0x89ee36){return _0x568492[_0xbfbb('0xa')](_0xbfbb('0xb'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbfbb('0xc'),'collate':_0xbfbb('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index c349fca..2b5283c 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 _0x30f8=['request','then','info','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','MailApplication,\x20%s,\x20%s','result','catch','UpdateMailApplication','MailApplication','update','body','options','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x30f8,0x86));var _0x830f=function(_0x45cbc7,_0x1c0a78){_0x45cbc7=_0x45cbc7-0x0;var _0x5c539a=_0x30f8[_0x45cbc7];return _0x5c539a;};'use strict';var _=require('lodash');var util=require(_0x830f('0x0'));var moment=require(_0x830f('0x1'));var BPromise=require(_0x830f('0x2'));var rs=require(_0x830f('0x3'));var fs=require('fs');var Redis=require(_0x830f('0x4'));var db=require(_0x830f('0x5'))['db'];var utils=require(_0x830f('0x6'));var logger=require('../../config/logger')(_0x830f('0x7'));var config=require(_0x830f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x830f('0x9')][_0x830f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xee0059,_0xe3f5b0,_0x2f6454){return new BPromise(function(_0x22cf69,_0x22e472){return client[_0x830f('0xb')](_0xee0059,_0x2f6454)[_0x830f('0xc')](function(_0x225063){logger[_0x830f('0xd')]('MailApplication,\x20%s,\x20%s',_0xe3f5b0,_0x830f('0xe'));logger[_0x830f('0xf')](_0x830f('0x10'),_0xe3f5b0,'request\x20sent',JSON[_0x830f('0x11')](_0x225063));if(_0x225063[_0x830f('0x12')]){if(_0x225063['error']['code']===0x1f4){logger[_0x830f('0x12')]('MailApplication,\x20%s,\x20%s',_0xe3f5b0,_0x225063[_0x830f('0x12')][_0x830f('0x13')]);return _0x22e472(_0x225063['error'][_0x830f('0x13')]);}logger['error'](_0x830f('0x14'),_0xe3f5b0,_0x225063['error'][_0x830f('0x13')]);return _0x22cf69(_0x225063[_0x830f('0x12')][_0x830f('0x13')]);}else{logger[_0x830f('0xd')](_0x830f('0x14'),_0xe3f5b0,_0x830f('0xe'));_0x22cf69(_0x225063[_0x830f('0x15')][_0x830f('0x13')]);}})[_0x830f('0x16')](function(_0x24dc9e){logger[_0x830f('0x12')](_0x830f('0x14'),_0xe3f5b0,_0x24dc9e);_0x22e472(_0x24dc9e);});});}exports[_0x830f('0x17')]=function(_0x9ea67){var _0x3208eb=this;return new Promise(function(_0x28b5fc,_0x2bea56){return db[_0x830f('0x18')][_0x830f('0x19')](_0x9ea67[_0x830f('0x1a')],{'raw':_0x9ea67[_0x830f('0x1b')]?_0x9ea67[_0x830f('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9ea67[_0x830f('0x1b')]?_0x9ea67[_0x830f('0x1b')]['where']||null:null,'attributes':_0x9ea67['options']?_0x9ea67[_0x830f('0x1b')]['attributes']||null:null,'limit':_0x9ea67[_0x830f('0x1b')]?_0x9ea67[_0x830f('0x1b')][_0x830f('0x1c')]||null:null})[_0x830f('0xc')](function(_0x3a6d1f){logger[_0x830f('0xd')](_0x830f('0x17'),_0x9ea67);logger['debug'](_0x830f('0x17'),_0x9ea67,JSON[_0x830f('0x11')](_0x3a6d1f));_0x28b5fc(_0x3a6d1f);})[_0x830f('0x16')](function(_0x330531){logger['error'](_0x830f('0x17'),_0x330531[_0x830f('0x13')],_0x9ea67);_0x2bea56(_0x3208eb['error'](0x1f4,_0x330531['message']));});});}; \ No newline at end of file +var _0x1d2f=['ioredis','../../config/utils','rpc','jayson/promise','client','http','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','error','code','message','catch','UpdateMailApplication','body','options','raw','where','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring'];(function(_0x149083,_0x4047b6){var _0x4dc74e=function(_0x1211f9){while(--_0x1211f9){_0x149083['push'](_0x149083['shift']());}};_0x4dc74e(++_0x4047b6);}(_0x1d2f,0x1e1));var _0xf1d2=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1d2f[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xf1d2('0x0'));var util=require(_0xf1d2('0x1'));var moment=require(_0xf1d2('0x2'));var BPromise=require(_0xf1d2('0x3'));var rs=require(_0xf1d2('0x4'));var fs=require('fs');var Redis=require(_0xf1d2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf1d2('0x6'));var logger=require('../../config/logger')(_0xf1d2('0x7'));var config=require('../../config/environment');var jayson=require(_0xf1d2('0x8'));var client=jayson[_0xf1d2('0x9')][_0xf1d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x194775,_0x433dec,_0x4e4693){return new BPromise(function(_0x3e31e4,_0x474e9b){return client[_0xf1d2('0xb')](_0x194775,_0x4e4693)['then'](function(_0x190eaa){logger[_0xf1d2('0xc')](_0xf1d2('0xd'),_0x433dec,_0xf1d2('0xe'));logger['debug']('MailApplication,\x20%s,\x20%s,\x20%s',_0x433dec,_0xf1d2('0xe'),JSON['stringify'](_0x190eaa));if(_0x190eaa[_0xf1d2('0xf')]){if(_0x190eaa['error'][_0xf1d2('0x10')]===0x1f4){logger['error'](_0xf1d2('0xd'),_0x433dec,_0x190eaa[_0xf1d2('0xf')][_0xf1d2('0x11')]);return _0x474e9b(_0x190eaa['error']['message']);}logger[_0xf1d2('0xf')]('MailApplication,\x20%s,\x20%s',_0x433dec,_0x190eaa[_0xf1d2('0xf')][_0xf1d2('0x11')]);return _0x3e31e4(_0x190eaa['error'][_0xf1d2('0x11')]);}else{logger['info'](_0xf1d2('0xd'),_0x433dec,_0xf1d2('0xe'));_0x3e31e4(_0x190eaa['result'][_0xf1d2('0x11')]);}})[_0xf1d2('0x12')](function(_0x5e6646){logger[_0xf1d2('0xf')](_0xf1d2('0xd'),_0x433dec,_0x5e6646);_0x474e9b(_0x5e6646);});});}exports[_0xf1d2('0x13')]=function(_0xdd1cca){var _0x29beb1=this;return new Promise(function(_0x5727f5,_0x2aa9dc){return db['MailApplication']['update'](_0xdd1cca[_0xf1d2('0x14')],{'raw':_0xdd1cca['options']?_0xdd1cca[_0xf1d2('0x15')][_0xf1d2('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdd1cca[_0xf1d2('0x15')]?_0xdd1cca[_0xf1d2('0x15')][_0xf1d2('0x17')]||null:null,'attributes':_0xdd1cca[_0xf1d2('0x15')]?_0xdd1cca[_0xf1d2('0x15')][_0xf1d2('0x18')]||null:null,'limit':_0xdd1cca['options']?_0xdd1cca[_0xf1d2('0x15')][_0xf1d2('0x19')]||null:null})['then'](function(_0x42573b){logger[_0xf1d2('0xc')](_0xf1d2('0x13'),_0xdd1cca);logger['debug'](_0xf1d2('0x13'),_0xdd1cca,JSON[_0xf1d2('0x1a')](_0x42573b));_0x5727f5(_0x42573b);})[_0xf1d2('0x12')](function(_0x30804a){logger[_0xf1d2('0xf')](_0xf1d2('0x13'),_0x30804a[_0xf1d2('0x11')],_0xdd1cca);_0x2aa9dc(_0x29beb1['error'](0x1f4,_0x30804a[_0xf1d2('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index ceb8cc5..8f0b3f7 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 _0x0ae1=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','/describe','show','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','/:id','update','delete','mailinteraction:destroy','removeTags','exports','multer'];(function(_0x3c79bb,_0x5380b8){var _0x49d7d9=function(_0x4bfee7){while(--_0x4bfee7){_0x3c79bb['push'](_0x3c79bb['shift']());}};_0x49d7d9(++_0x5380b8);}(_0x0ae1,0x167));var _0x10ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0ae1[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x10ae('0x0'));var util=require(_0x10ae('0x1'));var path=require(_0x10ae('0x2'));var timeout=require(_0x10ae('0x3'));var express=require('express');var router=express[_0x10ae('0x4')]();var auth=require(_0x10ae('0x5'));var interaction=require(_0x10ae('0x6'));var config=require(_0x10ae('0x7'));var controller=require(_0x10ae('0x8'));router[_0x10ae('0x9')]('/',auth[_0x10ae('0xa')](),controller['index']);router[_0x10ae('0x9')](_0x10ae('0xb'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x10ae('0xc')]);router[_0x10ae('0x9')](_0x10ae('0xd'),auth[_0x10ae('0xa')](),controller[_0x10ae('0xe')]);router['get'](_0x10ae('0xf'),auth[_0x10ae('0xa')](),controller['download']);router[_0x10ae('0x10')]('/',auth[_0x10ae('0xa')](),controller['create']);router['post'](_0x10ae('0xd'),auth[_0x10ae('0xa')](),controller[_0x10ae('0x11')]);router[_0x10ae('0x10')](_0x10ae('0x12'),auth[_0x10ae('0xa')](),interaction[_0x10ae('0x13')](_0x10ae('0x14'),_0x10ae('0x15')),controller[_0x10ae('0x16')]);router[_0x10ae('0x17')](_0x10ae('0x18'),auth['isAuthenticated'](),interaction['tracked'](_0x10ae('0x14'),'mailinteraction:update'),controller[_0x10ae('0x19')]);router[_0x10ae('0x1a')](_0x10ae('0x18'),auth[_0x10ae('0xa')](),interaction[_0x10ae('0x13')](_0x10ae('0x14'),_0x10ae('0x1b')),controller['destroy']);router[_0x10ae('0x1a')](_0x10ae('0x12'),auth[_0x10ae('0xa')](),controller[_0x10ae('0x1c')]);module[_0x10ae('0x1d')]=router; \ No newline at end of file +var _0x854e=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','isAuthenticated','get','/describe','describe','show','/:id/messages','getMessages','post','create','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','/:id','mailinteraction:destroy','destroy','removeTags','multer','util','path'];(function(_0x398294,_0x5ceb9d){var _0x2a872d=function(_0x390883){while(--_0x390883){_0x398294['push'](_0x398294['shift']());}};_0x2a872d(++_0x5ceb9d);}(_0x854e,0xdd));var _0xe854=function(_0x1f5e33,_0x10f720){_0x1f5e33=_0x1f5e33-0x0;var _0x28aadf=_0x854e[_0x1f5e33];return _0x28aadf;};'use strict';var multer=require(_0xe854('0x0'));var util=require(_0xe854('0x1'));var path=require(_0xe854('0x2'));var timeout=require(_0xe854('0x3'));var express=require(_0xe854('0x4'));var router=express[_0xe854('0x5')]();var auth=require(_0xe854('0x6'));var interaction=require(_0xe854('0x7'));var config=require(_0xe854('0x8'));var controller=require(_0xe854('0x9'));router['get']('/',auth[_0xe854('0xa')](),controller['index']);router[_0xe854('0xb')](_0xe854('0xc'),auth['isAuthenticated'](),controller[_0xe854('0xd')]);router[_0xe854('0xb')]('/:id',auth[_0xe854('0xa')](),controller[_0xe854('0xe')]);router[_0xe854('0xb')](_0xe854('0xf'),auth[_0xe854('0xa')](),controller[_0xe854('0x10')]);router[_0xe854('0xb')]('/:id/download',auth[_0xe854('0xa')](),controller['download']);router[_0xe854('0x11')]('/',auth['isAuthenticated'](),controller[_0xe854('0x12')]);router[_0xe854('0x11')](_0xe854('0xf'),auth[_0xe854('0xa')](),controller['addMessage']);router['post'](_0xe854('0x13'),auth['isAuthenticated'](),interaction[_0xe854('0x14')](_0xe854('0x15'),_0xe854('0x16')),controller[_0xe854('0x17')]);router[_0xe854('0x18')]('/:id',auth[_0xe854('0xa')](),interaction[_0xe854('0x14')](_0xe854('0x15'),_0xe854('0x19')),controller[_0xe854('0x1a')]);router[_0xe854('0x1b')](_0xe854('0x1c'),auth['isAuthenticated'](),interaction[_0xe854('0x14')](_0xe854('0x15'),_0xe854('0x1d')),controller[_0xe854('0x1e')]);router[_0xe854('0x1b')](_0xe854('0x13'),auth[_0xe854('0xa')](),controller[_0xe854('0x1f')]);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 8df7dc4..fc54395 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 _0x43c5=['DATE','STRING','TEXT','long','ENUM','out','sequelize','iconv','exports','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x43c5,0xd8));var _0x543c=function(_0x483097,_0xd8ff26){_0x483097=_0x483097-0x0;var _0x5a5e58=_0x43c5[_0x483097];return _0x5a5e58;};'use strict';var Sequelize=require(_0x543c('0x0'));var iconv=require(_0x543c('0x1'));module[_0x543c('0x2')]={'closed':{'type':Sequelize[_0x543c('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x543c('0x4')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x543c('0x5')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x543c('0x5')]},'cc':{'type':Sequelize[_0x543c('0x6')](_0x543c('0x7'))},'subject':{'type':Sequelize[_0x543c('0x6')]()},'attach':{'type':Sequelize[_0x543c('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x543c('0x4')]},'substatus':{'type':Sequelize[_0x543c('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x543c('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x543c('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x543c('0x8')]('in',_0x543c('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x543c('0x6')](_0x543c('0x7'))},'lastMsgText':{'type':Sequelize[_0x543c('0x6')](_0x543c('0x7'))}}; \ No newline at end of file +var _0x2a4a=['out','long','sequelize','iconv','exports','DATE','STRING','TEXT'];(function(_0x477650,_0x457234){var _0x551c6e=function(_0x4dc505){while(--_0x4dc505){_0x477650['push'](_0x477650['shift']());}};_0x551c6e(++_0x457234);}(_0x2a4a,0x192));var _0xa2a4=function(_0x1e59f4,_0x318618){_0x1e59f4=_0x1e59f4-0x0;var _0x66c51b=_0x2a4a[_0x1e59f4];return _0x66c51b;};'use strict';var Sequelize=require(_0xa2a4('0x0'));var iconv=require(_0xa2a4('0x1'));module[_0xa2a4('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa2a4('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa2a4('0x4')]},'inReplyTo':{'type':Sequelize[_0xa2a4('0x4')](0x1fe)},'to':{'type':Sequelize[_0xa2a4('0x4')]},'cc':{'type':Sequelize[_0xa2a4('0x5')]('long')},'subject':{'type':Sequelize[_0xa2a4('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xa2a4('0x3')]},'substatus':{'type':Sequelize[_0xa2a4('0x4')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xa2a4('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa2a4('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa2a4('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize['TEXT']('long')},'lastMsgText':{'type':Sequelize['TEXT'](_0xa2a4('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 1ebe31e..7b90c73 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 _0xcb95=['spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','attachments','Attachment','Attachments','Messages','bcc','subject','mkdirSync','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','build','writeFileSync','message%d.eml','log','err','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','MailInteraction','findOne','lastMsgText','trimStart','fromString','lastMsgBody','catch','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','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','DESC','t.id\x20IN\x20?','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.ContactId','i.MailAccountId','i.UserId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','push','all','show','params','includeAll','include','options','create','body','describe','addMessage','MailMessage','ids','omit','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb95,0x109));var _0x5cb9=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xcb95[_0x126558];return _0x1f6d14;};'use strict';var pdf=require(_0x5cb9('0x0'));var emlformat=require(_0x5cb9('0x1'));var rimraf=require(_0x5cb9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5cb9('0x3'));var rp=require(_0x5cb9('0x4'));var moment=require('moment');var BPromise=require(_0x5cb9('0x5'));var Mustache=require(_0x5cb9('0x6'));var util=require(_0x5cb9('0x7'));var path=require('path');var sox=require(_0x5cb9('0x8'));var csv=require(_0x5cb9('0x9'));var ejs=require(_0x5cb9('0xa'));var fs=require('fs');var _=require(_0x5cb9('0xb'));var squel=require('squel');var crypto=require(_0x5cb9('0xc'));var jsforce=require(_0x5cb9('0xd'));var deskjs=require(_0x5cb9('0xe'));var toCsv=require(_0x5cb9('0x9'));var querystring=require('querystring');var Papa=require(_0x5cb9('0xf'));var htmlToText=require('html-to-text');var Redis=require(_0x5cb9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5cb9('0x11'));var as=require(_0x5cb9('0x12'));var hardwareService=require(_0x5cb9('0x13'));var logger=require(_0x5cb9('0x14'))(_0x5cb9('0x15'));var utils=require(_0x5cb9('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x5cb9('0x17')]=_[_0x5cb9('0x18')](config[_0x5cb9('0x17')],{'host':_0x5cb9('0x19'),'port':0x18eb});var socket=require(_0x5cb9('0x1a'))(new Redis(config[_0x5cb9('0x17')]));require('./mailInteraction.socket')[_0x5cb9('0x1b')](socket);function respondWithStatusCode(_0x45b724,_0x33f020){_0x33f020=_0x33f020||0xcc;return function(_0x5c7561){if(_0x5c7561){return _0x45b724[_0x5cb9('0x1c')](_0x33f020);}return _0x45b724[_0x5cb9('0x1d')](_0x33f020)[_0x5cb9('0x1e')]();};}function respondWithResult(_0x1c5f9b,_0x5d7722){_0x5d7722=_0x5d7722||0xc8;return function(_0x496f18){if(_0x496f18){return _0x1c5f9b[_0x5cb9('0x1d')](_0x5d7722)[_0x5cb9('0x1f')](_0x496f18);}};}function respondWithFilteredResult(_0x176de3,_0x57d2f0){return function(_0x248174){if(_0x248174){var _0x319969=_0x248174[_0x5cb9('0x20')],_0x5bc847=_0x57d2f0['offset'],_0x153bb0=_0x57d2f0[_0x5cb9('0x21')]+_0x57d2f0[_0x5cb9('0x22')],_0x56e7d9;if(_0x153bb0>=_0x319969){_0x153bb0=_0x319969;_0x56e7d9=0xc8;}else{_0x56e7d9=0xce;}_0x176de3[_0x5cb9('0x1d')](_0x56e7d9);return _0x176de3[_0x5cb9('0x23')](_0x5cb9('0x24'),_0x5bc847+'-'+_0x153bb0+'/'+_0x319969)['json'](_0x248174);}return null;};}function patchUpdates(_0x1bb3da){return function(_0x414f97){try{jsonpatch[_0x5cb9('0x25')](_0x414f97,_0x1bb3da,!![]);}catch(_0x537a2b){return BPromise[_0x5cb9('0x26')](_0x537a2b);}return _0x414f97['save']();};}function saveUpdates(_0x284f69,_0x4d63d5){return function(_0x3a784f){if(_0x3a784f){return _0x3a784f[_0x5cb9('0x27')](_0x284f69)[_0x5cb9('0x28')](function(_0x3dc542){return _0x3dc542;});}return null;};}function removeEntity(_0x51ef8f,_0x196336){return function(_0x32fd23){if(_0x32fd23){return _0x32fd23[_0x5cb9('0x29')]()[_0x5cb9('0x28')](function(){_0x51ef8f[_0x5cb9('0x1d')](0xcc)[_0x5cb9('0x1e')]();});}};}function handleEntityNotFound(_0x2d0c6b,_0x3fa7b9){return function(_0x21033e){if(!_0x21033e){_0x2d0c6b[_0x5cb9('0x1c')](0x194);}return _0x21033e;};}function handleError(_0x5e3a98,_0x5ba9e6){_0x5ba9e6=_0x5ba9e6||0x1f4;return function(_0x263c3c){logger[_0x5cb9('0x2a')](_0x263c3c[_0x5cb9('0x2b')]);if(_0x263c3c[_0x5cb9('0x2c')]){delete _0x263c3c[_0x5cb9('0x2c')];}_0x5e3a98[_0x5cb9('0x1d')](_0x5ba9e6)[_0x5cb9('0x2d')](_0x263c3c);};}function getInteractionUsers(_0x2ad4f1,_0x36bc94){return new BPromise(function(_0xf86d14,_0xa4bc92){try{if(_0x36bc94[_0x2ad4f1['id']]){_0x2ad4f1[_0x5cb9('0x2e')]=_[_0x5cb9('0x2f')](_0x36bc94[_0x2ad4f1['id']],function(_0x378dc8){return{'id':_0x378dc8['id'],'fullname':_0x378dc8[_0x5cb9('0x30')]};});}}catch(_0x4a6fef){_0xa4bc92(_0x4a6fef);}_0xf86d14(_0x2ad4f1);});}function getInteractionTags(_0x55b3b5,_0xa6cd38){return new BPromise(function(_0x59b6b5,_0x59fd43){try{if(_0x55b3b5[_0x5cb9('0x31')]){_0x55b3b5[_0x5cb9('0x32')]=[];_0x55b3b5[_0x5cb9('0x31')][_0x5cb9('0x33')](',')[_0x5cb9('0x34')](function(_0x45a2f3){_0x55b3b5[_0x5cb9('0x32')]['push'](_0xa6cd38[_0x45a2f3]);});}delete _0x55b3b5[_0x5cb9('0x31')];}catch(_0x5ce589){_0x59fd43(_0x5ce589);}_0x59b6b5(_0x55b3b5);});}function getLastMessageText(_0x28e344){return new BPromise(function(_0x4f831b,_0x907ac2){return db[_0x5cb9('0x35')][_0x5cb9('0x36')]({'where':{'id':_0x28e344['id']},'attributes':['lastMsgBody',_0x5cb9('0x37')],'raw':!![]})['then'](function(_0x1789a6){if(!_0x1789a6[_0x5cb9('0x37')]){_0x28e344[_0x5cb9('0x37')]=_[_0x5cb9('0x38')](htmlToText[_0x5cb9('0x39')](_0x1789a6[_0x5cb9('0x3a')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x28e344[_0x5cb9('0x37')]=_0x1789a6[_0x5cb9('0x37')];}_0x4f831b(_0x28e344);})[_0x5cb9('0x3b')](function(_0x42cfb3){_0x907ac2(_0x42cfb3);});});}function updateMailInteraction(_0x42774d,_0x154f39,_0x41988a,_0x345dc7){return new BPromise(function(_0x1e3abc,_0x4c16b2){return getInteractionUsers(_0x42774d,_0x41988a)['then'](function(_0x154fc0){return getInteractionTags(_0x154fc0,_0x154f39);})[_0x5cb9('0x28')](function(_0x4ea8ee){if(_0x345dc7){_0x1e3abc(getLastMessageText(_0x4ea8ee));}else{_0x1e3abc(_0x4ea8ee);}})['catch'](function(_0x449ddf){_0x4c16b2(_0x449ddf);});});}exports['index']=function(_0xfffc16,_0x5001b8){var _0x1c2743={},_0x333017={},_0x21c96e={'count':0x0,'rows':[]};var _0x61832a=_[_0x5cb9('0x2f')](db[_0x5cb9('0x35')][_0x5cb9('0x3c')],function(_0x47d49a){return{'name':_0x47d49a['fieldName'],'type':_0x47d49a[_0x5cb9('0x3d')][_0x5cb9('0x3e')]};});_0x333017[_0x5cb9('0x3f')]=_[_0x5cb9('0x2f')](_0x61832a,'name');_0x333017[_0x5cb9('0x40')]=_[_0x5cb9('0x41')](_0xfffc16['query']);_0x333017[_0x5cb9('0x42')]=_[_0x5cb9('0x43')](_0x333017[_0x5cb9('0x3f')],_0x333017[_0x5cb9('0x40')]);_0x1c2743[_0x5cb9('0x44')]=_[_0x5cb9('0x43')](_0x333017[_0x5cb9('0x3f')],qs[_0x5cb9('0x45')](_0xfffc16[_0x5cb9('0x40')][_0x5cb9('0x45')]));_0x1c2743[_0x5cb9('0x44')]=_0x1c2743[_0x5cb9('0x44')][_0x5cb9('0x46')]?_0x1c2743['attributes']:_0x333017[_0x5cb9('0x3f')];if(!_0xfffc16[_0x5cb9('0x40')][_0x5cb9('0x47')](_0x5cb9('0x48'))){_0x1c2743[_0x5cb9('0x22')]=qs[_0x5cb9('0x22')](_0xfffc16['query'][_0x5cb9('0x22')]);_0x1c2743[_0x5cb9('0x21')]=qs['offset'](_0xfffc16['query'][_0x5cb9('0x21')]);}_0x1c2743[_0x5cb9('0x49')]=qs['sort'](_0xfffc16[_0x5cb9('0x40')][_0x5cb9('0x4a')]);_0x1c2743[_0x5cb9('0x4b')]=qs['filters'](_[_0x5cb9('0x4c')](_0xfffc16['query'],_0x333017[_0x5cb9('0x42')]));var _0x2cb486=[];var _0x15265b=squel[_0x5cb9('0x4d')]()[_0x5cb9('0x4e')]('id')[_0x5cb9('0x4e')](_0x5cb9('0x2c'))['field'](_0x5cb9('0x4f'))[_0x5cb9('0x50')](_0x5cb9('0x51'));var _0x5ef76b=squel[_0x5cb9('0x4d')]()[_0x5cb9('0x4e')](_0x5cb9('0x52'))[_0x5cb9('0x4e')]('u.fullname')['field']('ui.MailInteractionId')[_0x5cb9('0x50')]('user_has_mail_interactions','ui')[_0x5cb9('0x53')](_0x5cb9('0x54'),'u',_0x5cb9('0x55'));var _0x309fc6=squel['select']()[_0x5cb9('0x50')](_0x5cb9('0x56'),'i')['left_join']('cm_contacts','c',_0x5cb9('0x57'))[_0x5cb9('0x53')]('users','o',_0x5cb9('0x58'))['left_join'](_0x5cb9('0x59'),'a',_0x5cb9('0x5a'))[_0x5cb9('0x53')]('mail_messages','me','me.MailInteractionId\x20=\x20i.id')[_0x5cb9('0x53')](_0x5cb9('0x5b'),'it','it.MailInteractionId\x20=\x20i.id')['left_join'](_0x5cb9('0x51'),'t','t.id\x20=\x20it.TagId');var _0x455d97=squel['expr']();var _0x224507=[];var _0x10e00c=squel[_0x5cb9('0x5c')]();var _0x29bbf4;if(_0xfffc16[_0x5cb9('0x40')][_0x5cb9('0x5d')]){_0x29bbf4=as[_0x5cb9('0x5e')](_0xfffc16['query'][_0x5cb9('0x5d')]);var _0x5749d7=_0x29bbf4[_0x5cb9('0x5f')];for(var _0xde35dd=0x0;_0xde35dd<_0x29bbf4[_0x5cb9('0x60')][_0x5cb9('0x46')];_0xde35dd++){var _0xcc3377=_0x29bbf4[_0x5cb9('0x60')][_0xde35dd];var _0x21bfbd='i';var _0x218fab=_[_0x5cb9('0x61')](_0x61832a,[_0x5cb9('0x2c'),_0xcc3377[_0x5cb9('0x4e')]]);if(!_0x218fab){switch(_0xcc3377['field']){case _0x5cb9('0x62'):if(_0xcc3377['value']==0x1){_0x309fc6[_0x5cb9('0x63')]('`'+_0xcc3377[_0x5cb9('0x4e')]+_0x5cb9('0x64'));}else{_0x309fc6[_0x5cb9('0x63')]('`'+_0xcc3377['field']+_0x5cb9('0x65'));}break;case'Contact':if(_0xcc3377['operator']==='$substring'){if(_0xcc3377[_0x5cb9('0x66')]['split']('\x20')[_0x5cb9('0x46')]>0x1){_0x455d97[_0x5749d7]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x5cb9('0x67')](_0xcc3377[_0x5cb9('0x66')]),null);}else{var _0x4c71de='%'+_0xcc3377['value']+'%';_0x455d97[_0x5749d7](_0x5cb9('0x68'),_0x4c71de,_0x4c71de,_0x4c71de);}}else{_0x218fab=_[_0x5cb9('0x61')](_0x61832a,[_0x5cb9('0x2c'),_0x5cb9('0x69')]);_0xcc3377[_0x5cb9('0x4e')]=_0x5cb9('0x69');_0x4ccce0=as[_0x5cb9('0x6a')](_0x21bfbd,_0x218fab[_0x5cb9('0x3d')],_0xcc3377);_0x455d97[_0x5749d7](_0x4ccce0[_0x5cb9('0x6b')],_0x4ccce0[_0x5cb9('0x66')][_0x5cb9('0x6c')],_0x4ccce0['value'][_0x5cb9('0x1e')]);}break;case _0x5cb9('0x6d'):var _0x554e78=_0xcc3377[_0x5cb9('0x66')][_0x5cb9('0x33')](',')[_0x5cb9('0x2f')](function(_0x5b7d0d){return Number(_0x5b7d0d);});_0x554e78[_0x5cb9('0x34')](function(_0x14c422){_0x10e00c['or'](_0x5cb9('0x6e'),'%,'+_0x14c422+',%');});_0x224507=_[_0x5cb9('0x6f')](_0x224507,_0x554e78);break;case'User':if(_0xcc3377[_0x5cb9('0x70')]===_0x5cb9('0x71')){_0x455d97[_0x5749d7](_0x5cb9('0x72'),'%'+_0xcc3377[_0x5cb9('0x66')]+'%',null);}else{_0x218fab=_[_0x5cb9('0x61')](_0x61832a,[_0x5cb9('0x2c'),_0x5cb9('0x73')]);_0xcc3377[_0x5cb9('0x4e')]='UserId';_0x4ccce0=as[_0x5cb9('0x6a')](_0x21bfbd,_0x218fab['type'],_0xcc3377);_0x455d97[_0x5749d7](_0x4ccce0['text'],_0x4ccce0[_0x5cb9('0x66')][_0x5cb9('0x6c')],_0x4ccce0['value'][_0x5cb9('0x1e')]);}break;case _0x5cb9('0x74'):_0x4ccce0=as[_0x5cb9('0x6a')]('me',null,_0xcc3377);_0x455d97[_0x5749d7](_0x4ccce0[_0x5cb9('0x6b')],_0x4ccce0['value']['start'],_0x4ccce0['value']['end']);break;}}else{var _0x4ccce0=as[_0x5cb9('0x6a')](_0x21bfbd,_0x218fab[_0x5cb9('0x3d')],_0xcc3377);_0x455d97[_0x5749d7](_0x4ccce0[_0x5cb9('0x6b')],_0x4ccce0[_0x5cb9('0x66')]['start'],_0x4ccce0[_0x5cb9('0x66')][_0x5cb9('0x1e')]);}}}else{var _0x47e136=_(_0xfffc16[_0x5cb9('0x40')])[_0x5cb9('0x41')]()['map'](function(_0xe6c92){return _[_0x5cb9('0x75')](_0x61832a,[_0x5cb9('0x2c'),_0xe6c92])?_0xe6c92:undefined;})[_0x5cb9('0x76')]()['value']();if(!_[_0x5cb9('0x77')](_0x47e136)){_0x47e136[_0x5cb9('0x34')](function(_0x5ca2dd){if(_0x5ca2dd===_0x5cb9('0x78')){_0x309fc6[_0x5cb9('0x4b')](_0x5cb9('0x79'),[][_0x5cb9('0x7a')](_0xfffc16[_0x5cb9('0x40')][_0x5ca2dd]));}else if(_0x5ca2dd===_0x5cb9('0x7b')){var _0xc5250d=JSON[_0x5cb9('0x7c')](_0xfffc16[_0x5cb9('0x40')][_0x5ca2dd])['$gte'];var _0x2ee20c=JSON[_0x5cb9('0x7c')](_0xfffc16[_0x5cb9('0x40')][_0x5ca2dd])[_0x5cb9('0x7d')];_0x309fc6[_0x5cb9('0x4b')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xc5250d,_0x2ee20c);}else{if(_0xfffc16[_0x5cb9('0x40')][_0x5ca2dd]===_0x5cb9('0x7e')){_0x309fc6[_0x5cb9('0x4b')]('i.'+_0x5ca2dd+_0x5cb9('0x7f'));}else{_0x309fc6['where']('i.'+_0x5ca2dd+'\x20=\x20?',_0xfffc16[_0x5cb9('0x40')][_0x5ca2dd]);}}});}if(_0xfffc16['query'][_0x5cb9('0x80')]){if(_0xfffc16['query'][_0x5cb9('0x80')]==0x1){_0x309fc6[_0x5cb9('0x63')]('`unreadMessages`\x20=\x200');}else{_0x309fc6[_0x5cb9('0x63')](_0x5cb9('0x81'));}}if(_0xfffc16[_0x5cb9('0x40')][_0x5cb9('0x82')]){_0x224507=_[_0x5cb9('0x83')](_0xfffc16[_0x5cb9('0x40')][_0x5cb9('0x82')])?_0xfffc16['query'][_0x5cb9('0x82')]:new Array(_0xfffc16[_0x5cb9('0x40')][_0x5cb9('0x82')]);_0x224507[_0x5cb9('0x34')](function(_0x3dbce3){_0x10e00c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3dbce3+',%');});}if(_0xfffc16[_0x5cb9('0x40')][_0x5cb9('0x84')]){var _0x4bd295=_0xfffc16['query'][_0x5cb9('0x84')][_0x5cb9('0x85')]('\x5c','\x5c\x5c')[_0x5cb9('0x85')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0x5cb9('0x86')](_0x4bd295)){_0x455d97['or'](_0x5cb9('0x87'),_0x4bd295+'%');}else if(qs['isEmail'](_0x4bd295)){_0x455d97['or'](_0x5cb9('0x88'),_0x4bd295+'%');}else{_0x455d97['or'](_0x5cb9('0x89'),qs[_0x5cb9('0x67')](_0x4bd295))['or'](_0x5cb9('0x8a'),qs['getFullTextValue'](_0x4bd295));}}}_0x309fc6['where'](_0x455d97);_0x309fc6[_0x5cb9('0x8b')](_0x5cb9('0x8c'));var _0x206abc={'type':db[_0x5cb9('0x8d')][_0x5cb9('0x8e')]['SELECT'],'raw':!![]};var _0x310fbe=_0x309fc6['clone']();_0x310fbe['field'](_0x5cb9('0x8c'));_0x310fbe[_0x5cb9('0x4e')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5cb9('0x62'));if(_0x1c2743[_0x5cb9('0x49')]){_0x1c2743[_0x5cb9('0x49')][_0x5cb9('0x34')](function(_0x56c444){_0x309fc6[_0x5cb9('0x49')]('i.'+_0x56c444[0x0],_0x56c444[0x1]===_0x5cb9('0x8f')?![]:!![]);});}if(!_[_0x5cb9('0x77')](_0x224507)){_0x309fc6[_0x5cb9('0x63')](_0x10e00c);_0x310fbe[_0x5cb9('0x4b')](_0x5cb9('0x90'),_0x224507);}BPromise['resolve']()[_0x5cb9('0x28')](function(){if(!_0x29bbf4){if(_0xfffc16['query']['MailAccountId']||_0xfffc16[_0x5cb9('0x40')][_0x5cb9('0x91')])return;_0x310fbe['where'](_0x5cb9('0x92'));_0x309fc6[_0x5cb9('0x4b')](_0x5cb9('0x92'));return;}return _0xfffc16[_0x5cb9('0x93')][_0x5cb9('0x94')]({'attributes':['id'],'raw':!![]})[_0x5cb9('0x28')](function(_0x2e4f95){if(_['isEmpty'](_0x2e4f95)){_0x310fbe[_0x5cb9('0x4b')](_0x5cb9('0x95'));_0x309fc6[_0x5cb9('0x4b')](_0x5cb9('0x95'));}else{_0x310fbe[_0x5cb9('0x4b')](_0x5cb9('0x79'),_[_0x5cb9('0x2f')](_0x2e4f95,'id'));_0x309fc6[_0x5cb9('0x4b')]('i.MailAccountId\x20IN\x20?',_[_0x5cb9('0x2f')](_0x2e4f95,'id'));}});})['then'](function(){db[_0x5cb9('0x96')]['query'](_0x310fbe[_0x5cb9('0x97')](),_0x206abc)[_0x5cb9('0x28')](function(_0x3733b5){_0x21c96e[_0x5cb9('0x20')]=_0x3733b5[_0x5cb9('0x46')];if(_0x21c96e['count']===0x0)return[];return db[_0x5cb9('0x96')]['query'](_0x15265b['toString'](),_0x206abc)[_0x5cb9('0x28')](function(_0x5d9870){_0x2cb486=_[_0x5cb9('0x98')](_0x5d9870,'id');_0x206abc=_[_0x5cb9('0x99')](_0x206abc,{'model':db[_0x5cb9('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xfffc16[_0x5cb9('0x40')]['fields']){_0x1c2743[_0x5cb9('0x44')][_0x5cb9('0x34')](function(_0x1122a6){_0x309fc6['field']('i.'+_0x1122a6);});}else{_0x309fc6[_0x5cb9('0x4e')](_0x5cb9('0x9a'),_0x5cb9('0x62'));_0x309fc6[_0x5cb9('0x4e')](_0x5cb9('0x9b'),_0x5cb9('0x9c'));_0x309fc6['field']('a.mandatoryDisposition',_0x5cb9('0x9d'));_0x309fc6['field'](_0x5cb9('0x8c'));_0x309fc6[_0x5cb9('0x4e')](_0x5cb9('0x9e'));_0x309fc6[_0x5cb9('0x4e')](_0x5cb9('0x9f'));_0x309fc6[_0x5cb9('0x4e')](_0x5cb9('0xa0'));_0x309fc6[_0x5cb9('0x4e')](_0x5cb9('0xa1'));_0x309fc6[_0x5cb9('0x4e')](_0x5cb9('0xa2'));_0x309fc6['field'](_0x5cb9('0xa3'));_0x309fc6[_0x5cb9('0x4e')](_0x5cb9('0xa4'));_0x309fc6[_0x5cb9('0x4e')](_0x5cb9('0xa5'));_0x309fc6[_0x5cb9('0x4e')](_0x5cb9('0xa6'));_0x309fc6['field']('i.substatus');_0x309fc6[_0x5cb9('0x4e')]('i.to');_0x309fc6[_0x5cb9('0x4e')](_0x5cb9('0xa7'));_0x309fc6[_0x5cb9('0x4e')](_0x5cb9('0xa8'));_0x309fc6[_0x5cb9('0x4e')](_0x5cb9('0xa9'));_0x309fc6[_0x5cb9('0x4e')]('c.firstName',_0x5cb9('0xaa'));_0x309fc6['field'](_0x5cb9('0xab'),_0x5cb9('0xac'));_0x309fc6[_0x5cb9('0x4e')](_0x5cb9('0xad'),_0x5cb9('0xae'));_0x309fc6['field'](_0x5cb9('0xaf'),_0x5cb9('0xb0'));_0x309fc6[_0x5cb9('0x4e')]('c.mobile',_0x5cb9('0xb1'));_0x309fc6[_0x5cb9('0x4e')](_0x5cb9('0xb2'),_0x5cb9('0xb3'));_0x309fc6[_0x5cb9('0x4e')](_0x5cb9('0xb4'),_0x5cb9('0xb5'));_0x309fc6[_0x5cb9('0x4e')](_0x5cb9('0xb6'),'Owner.internal');_0x309fc6['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x5cb9('0x31'));}_0x309fc6['limit'](_0x1c2743[_0x5cb9('0x22')]);_0x309fc6['offset'](_0x1c2743[_0x5cb9('0x21')]);return db['sequelize'][_0x5cb9('0x40')](_0x309fc6[_0x5cb9('0x97')](),_0x206abc);})[_0x5cb9('0x28')](function(_0x559fcf){_0x5ef76b['where'](_0x5cb9('0xb7'),_['map'](_0x559fcf,'id'));return db[_0x5cb9('0x96')][_0x5cb9('0x40')](_0x5ef76b[_0x5cb9('0x97')](),_0x206abc)[_0x5cb9('0x28')](function(_0x353b5d){var _0x230f74=_[_0x5cb9('0xb8')](_0x353b5d,_0x5cb9('0xb9'));var _0x21b205=[];return db[_0x5cb9('0xba')][_0x5cb9('0x36')]({'attributes':[_0x5cb9('0xbb')],'raw':!![]})['then'](function(_0x2b8294){var _0x180d70=_0x2b8294[_0x5cb9('0xbb')];_0x559fcf[_0x5cb9('0x34')](function(_0x2ec17b){_0x21b205[_0x5cb9('0xbc')](updateMailInteraction(_0x2ec17b,_0x2cb486,_0x230f74,_0x180d70));});return BPromise[_0x5cb9('0xbd')](_0x21b205);});});});})[_0x5cb9('0x28')](function(_0x4d48c3){_0x21c96e['rows']=_0x4d48c3;return _0x21c96e;})[_0x5cb9('0x28')](respondWithFilteredResult(_0x5001b8,_0x1c2743));})[_0x5cb9('0x3b')](handleError(_0x5001b8,null));};exports[_0x5cb9('0xbe')]=function(_0x116d49,_0x484ae5){var _0x230dac={'raw':![],'where':{'id':_0x116d49[_0x5cb9('0xbf')]['id']}},_0x54c658={};_0x54c658['model']=_[_0x5cb9('0x41')](db['MailInteraction']['rawAttributes']);_0x54c658['query']=_[_0x5cb9('0x41')](_0x116d49['query']);_0x54c658[_0x5cb9('0x42')]=_[_0x5cb9('0x43')](_0x54c658[_0x5cb9('0x3f')],_0x54c658[_0x5cb9('0x40')]);_0x230dac[_0x5cb9('0x44')]=_[_0x5cb9('0x43')](_0x54c658[_0x5cb9('0x3f')],qs[_0x5cb9('0x45')](_0x116d49[_0x5cb9('0x40')][_0x5cb9('0x45')]));_0x230dac[_0x5cb9('0x44')]=_0x230dac['attributes'][_0x5cb9('0x46')]?_0x230dac[_0x5cb9('0x44')]:_0x54c658[_0x5cb9('0x3f')];if(_0x116d49[_0x5cb9('0x40')][_0x5cb9('0xc0')]){_0x230dac[_0x5cb9('0xc1')]=[{'all':!![]}];}_0x230dac=_[_0x5cb9('0x99')]({},_0x230dac,_0x116d49[_0x5cb9('0xc2')]);return db[_0x5cb9('0x35')][_0x5cb9('0x61')](_0x230dac)[_0x5cb9('0x28')](handleEntityNotFound(_0x484ae5,null))[_0x5cb9('0x28')](respondWithResult(_0x484ae5,null))[_0x5cb9('0x3b')](handleError(_0x484ae5,null));};exports[_0x5cb9('0xc3')]=function(_0x414e58,_0x380554){return db[_0x5cb9('0x35')]['create'](_0x414e58[_0x5cb9('0xc4')],{})[_0x5cb9('0x28')](respondWithResult(_0x380554,0xc9))[_0x5cb9('0x3b')](handleError(_0x380554,null));};exports[_0x5cb9('0x27')]=function(_0x5c8845,_0x3bf84f){if(_0x5c8845[_0x5cb9('0xc4')]['id']){delete _0x5c8845[_0x5cb9('0xc4')]['id'];}return db[_0x5cb9('0x35')][_0x5cb9('0x61')]({'where':{'id':_0x5c8845[_0x5cb9('0xbf')]['id']}})[_0x5cb9('0x28')](handleEntityNotFound(_0x3bf84f,null))[_0x5cb9('0x28')](saveUpdates(_0x5c8845[_0x5cb9('0xc4')],null))[_0x5cb9('0x28')](respondWithResult(_0x3bf84f,null))[_0x5cb9('0x3b')](handleError(_0x3bf84f,null));};exports[_0x5cb9('0x29')]=function(_0x2e3d7f,_0x25058a){return db[_0x5cb9('0x35')][_0x5cb9('0x61')]({'where':{'id':_0x2e3d7f[_0x5cb9('0xbf')]['id']}})[_0x5cb9('0x28')](handleEntityNotFound(_0x25058a,null))[_0x5cb9('0x28')](removeEntity(_0x25058a,null))[_0x5cb9('0x3b')](handleError(_0x25058a,null));};exports[_0x5cb9('0xc5')]=function(_0x3614ab,_0x3a69a7){return db[_0x5cb9('0x35')][_0x5cb9('0xc5')]()['then'](respondWithResult(_0x3a69a7,null))['catch'](handleError(_0x3a69a7,null));};exports[_0x5cb9('0xc6')]=function(_0x546af0,_0x34396d,_0xbc103d){return db[_0x5cb9('0xc7')][_0x5cb9('0x61')]({'where':{'id':_0x546af0[_0x5cb9('0xbf')]['id']}})[_0x5cb9('0x28')](handleEntityNotFound(_0x34396d,null))[_0x5cb9('0x28')](function(_0x52bce4){if(_0x52bce4){return _0x52bce4['addMessage'](_0x546af0[_0x5cb9('0xc4')][_0x5cb9('0xc8')],_[_0x5cb9('0xc9')](_0x546af0[_0x5cb9('0xc4')],[_0x5cb9('0xc8'),'id'])||{});}})['then'](respondWithResult(_0x34396d,null))[_0x5cb9('0x3b')](handleError(_0x34396d,null));};exports[_0x5cb9('0xca')]=function(_0x41d720,_0x1a8953,_0x1d648b){var _0x5e7deb={'raw':![],'where':{}};var _0x578972={};var _0x587301={'count':0x0,'rows':[]};return db[_0x5cb9('0x35')]['findOne']({'where':{'id':_0x41d720[_0x5cb9('0xbf')]['id']}})[_0x5cb9('0x28')](handleEntityNotFound(_0x1a8953,null))[_0x5cb9('0x28')](function(_0x17d280){if(_0x17d280){_0x578972[_0x5cb9('0x3f')]=_['keys'](db['MailMessage'][_0x5cb9('0x3c')]);_0x578972[_0x5cb9('0x40')]=_[_0x5cb9('0x41')](_0x41d720[_0x5cb9('0x40')]);_0x578972[_0x5cb9('0x42')]=_[_0x5cb9('0x43')](_0x578972[_0x5cb9('0x3f')],_0x578972[_0x5cb9('0x40')]);_0x5e7deb['attributes']=_[_0x5cb9('0x43')](_0x578972[_0x5cb9('0x3f')],qs[_0x5cb9('0x45')](_0x41d720[_0x5cb9('0x40')][_0x5cb9('0x45')]));_0x5e7deb['attributes']=_0x5e7deb[_0x5cb9('0x44')]['length']?_0x5e7deb['attributes']:_0x578972[_0x5cb9('0x3f')];if(!_0x41d720['query'][_0x5cb9('0x47')](_0x5cb9('0x48'))){_0x5e7deb['limit']=qs[_0x5cb9('0x22')](_0x41d720[_0x5cb9('0x40')][_0x5cb9('0x22')]);_0x5e7deb[_0x5cb9('0x21')]=qs['offset'](_0x41d720[_0x5cb9('0x40')]['offset']);}_0x5e7deb[_0x5cb9('0x49')]=qs[_0x5cb9('0x4a')](_0x41d720[_0x5cb9('0x40')][_0x5cb9('0x4a')]);_0x5e7deb[_0x5cb9('0x4b')]=qs['filters'](_['pick'](_0x41d720[_0x5cb9('0x40')],_0x578972[_0x5cb9('0x42')]));_0x5e7deb['where'][_0x5cb9('0xb9')]=_0x17d280['id'];if(_0x41d720[_0x5cb9('0x40')]['filter']){_0x5e7deb[_0x5cb9('0x4b')]=_[_0x5cb9('0x99')](_0x5e7deb[_0x5cb9('0x4b')],{'$or':_[_0x5cb9('0x2f')](_0x5e7deb[_0x5cb9('0x44')],function(_0x300a7b){var _0x31ee0d={};_0x31ee0d[_0x300a7b]={'$like':'%'+_0x41d720['query'][_0x5cb9('0x84')]+'%'};return _0x31ee0d;})});}if(_0x41d720['query'][_0x5cb9('0xcb')]){var _0x103eb6=_0x41d720['query']['$gte'][_0x5cb9('0x33')](',');var _0x309388={};_0x309388[_0x103eb6[0x0]]={'$gte':moment(_0x103eb6[0x1])[_0x5cb9('0xcc')](_0x5cb9('0xcd'))};_0x5e7deb['where']=_['merge'](_0x5e7deb['where'],_0x309388);}_0x5e7deb=_['merge']({},_0x5e7deb,_0x41d720[_0x5cb9('0xc2')]);return db['MailMessage']['count']({'where':_0x5e7deb[_0x5cb9('0x4b')]})[_0x5cb9('0x28')](function(_0x3176a4){_0x587301[_0x5cb9('0x20')]=_0x3176a4;if(_0x41d720[_0x5cb9('0x40')][_0x5cb9('0xc0')]){_0x5e7deb[_0x5cb9('0xc1')]=[{'all':!![]}];}return db[_0x5cb9('0xc7')][_0x5cb9('0xce')](_0x5e7deb);})[_0x5cb9('0x28')](function(_0x2e75c2){_0x587301[_0x5cb9('0xcf')]=_0x2e75c2;return _0x587301;});}})[_0x5cb9('0x28')](respondWithFilteredResult(_0x1a8953,_0x5e7deb))[_0x5cb9('0x3b')](handleError(_0x1a8953,null));};exports[_0x5cb9('0xd0')]=function(_0x32aaa4,_0x2f3256,_0x2e5db6){return db[_0x5cb9('0x35')][_0x5cb9('0x61')]({'where':{'id':_0x32aaa4[_0x5cb9('0xbf')]['id']}})[_0x5cb9('0x28')](handleEntityNotFound(_0x2f3256,null))[_0x5cb9('0x28')](function(_0x5e74bc){if(_0x5e74bc){return _0x5e74bc['setTags'](_0x32aaa4[_0x5cb9('0xc4')][_0x5cb9('0xc8')],_[_0x5cb9('0xc9')](_0x32aaa4[_0x5cb9('0xc4')],[_0x5cb9('0xc8'),'id'])||{})[_0x5cb9('0xd1')](function(){return db[_0x5cb9('0x6d')][_0x5cb9('0xce')]({'attributes':['id',_0x5cb9('0x2c'),_0x5cb9('0x4f')],'where':{'id':_0x32aaa4[_0x5cb9('0xc4')][_0x5cb9('0xc8')]}});})[_0x5cb9('0x28')](function(_0x21f2ad){socket[_0x5cb9('0xd2')](_0x5cb9('0xd3'),{'id':Number(_0x32aaa4['params']['id']),'tags':_0x21f2ad||[]});return{'id':Number(_0x32aaa4['params']['id']),'tags':_0x21f2ad||[]};});}})[_0x5cb9('0x28')](respondWithResult(_0x2f3256,null))[_0x5cb9('0x3b')](handleError(_0x2f3256,null));};exports[_0x5cb9('0xd4')]=function(_0x30fcab,_0x32de47,_0x811505){return db[_0x5cb9('0x35')]['find']({'where':{'id':_0x30fcab[_0x5cb9('0xbf')]['id']}})[_0x5cb9('0x28')](handleEntityNotFound(_0x32de47,null))[_0x5cb9('0x28')](function(_0x2b8f44){if(_0x2b8f44){return _0x2b8f44[_0x5cb9('0xd4')](_0x30fcab[_0x5cb9('0x40')][_0x5cb9('0xc8')]);}})[_0x5cb9('0x28')](respondWithStatusCode(_0x32de47,null))[_0x5cb9('0x3b')](handleError(_0x32de47,null));};exports[_0x5cb9('0xd5')]=function(_0x3a0f67,_0x2ec1c8){var _0xd642f5=moment()[_0x5cb9('0xd6')]()[_0x5cb9('0x97')]();var _0x26e622=path[_0x5cb9('0xd7')](config['root'],_0x5cb9('0xd8'),_0x5cb9('0xd9'),_0x5cb9('0xda'));var _0x33e028=path[_0x5cb9('0xd7')](config[_0x5cb9('0xdb')],_0x5cb9('0xd8'),_0x5cb9('0xd9'),_0x5cb9('0xdc'));var _0x17b571=path[_0x5cb9('0xd7')](_0x26e622,_0xd642f5);var _0x43a15d=util[_0x5cb9('0xcc')]('transcript-%d-%s.zip',_0x3a0f67[_0x5cb9('0xbf')]['id'],_0xd642f5);var _0x2c569b=path[_0x5cb9('0xd7')](_0x26e622,_0x43a15d);var _0x216fa4=[];if(_0x3a0f67[_0x5cb9('0x40')][_0x5cb9('0xdc')]){_0x216fa4[_0x5cb9('0xbc')]({'model':db[_0x5cb9('0xdd')],'as':_0x5cb9('0xde'),'raw':!![]});}var _0x2adbc1=[{'model':db[_0x5cb9('0xc7')],'as':_0x5cb9('0xdf'),'attributes':['id','body',_0x5cb9('0x50'),'to','cc',_0x5cb9('0xe0'),_0x5cb9('0xe1'),_0x5cb9('0x7b')],'where':{'secret':![]},'order':qs[_0x5cb9('0x4a')]('id'),'include':_0x216fa4}];return db[_0x5cb9('0x35')][_0x5cb9('0x61')]({'where':{'id':_0x3a0f67['params']['id']},'include':_0x2adbc1})[_0x5cb9('0x28')](handleEntityNotFound(_0x2ec1c8,null))[_0x5cb9('0x28')](function(_0x121fee){if(_0x121fee&&_0x121fee[_0x5cb9('0xdf')]){var _0x2cfd46=_0x121fee['get']({'plain':!![]});fs[_0x5cb9('0xe2')](_0x17b571);return BPromise['each'](_0x2cfd46['Messages'],function(_0x4d9d99,_0x34cd84){var _0x151c1c={'from':_0x4d9d99[_0x5cb9('0x50')],'to':_0x4d9d99['to'],'subject':_0x4d9d99[_0x5cb9('0xe1')],'html':_0x4d9d99[_0x5cb9('0xc4')],'headers':{'Date':moment(_0x4d9d99['createdAt'])[_0x5cb9('0xcc')](_0x5cb9('0xe3'))},'attachments':[]};if(_0x4d9d99['cc']){_0x151c1c[_0x5cb9('0xe4')]['Cc']=_0x4d9d99['cc'];}if(_0x4d9d99['bcc']){_0x151c1c['headers']['Bcc']=_0x4d9d99['bcc'];}return new BPromise(function(_0x4c2c53,_0x22fabb){if(_0x4d9d99[_0x5cb9('0xde')]){for(var _0x38bc90=0x0;_0x38bc90<_0x4d9d99['Attachments'][_0x5cb9('0x46')];_0x38bc90++){var _0x334cff=_0x4d9d99['Attachments'][_0x38bc90];var _0x14b031=path['join'](_0x33e028,_0x334cff[_0x5cb9('0xe5')]);if(fs[_0x5cb9('0xe6')](_0x14b031)){_0x151c1c[_0x5cb9('0xdc')]['push']({'name':_0x334cff[_0x5cb9('0x2c')],'contentType':_0x334cff[_0x5cb9('0x3d')],'data':fs['readFileSync'](_0x14b031)});}}}emlformat[_0x5cb9('0xe7')](_0x151c1c,function(_0x1f79b0,_0x5f09f9){if(_0x1f79b0)return _0x22fabb(_0x1f79b0);fs[_0x5cb9('0xe8')](path[_0x5cb9('0xd7')](_0x17b571,util['format'](_0x5cb9('0xe9'),_0x34cd84)),_0x5f09f9);return _0x4c2c53(_0x5f09f9);});});})['then'](function(){return new BPromise(function(_0x2781be,_0x22189b){zipdir(_0x17b571,{'saveTo':_0x2c569b},function(_0x38c5db,_0x52c5c2){if(_0x38c5db)return _0x22189b(_0x38c5db);return _0x2781be(_0x52c5c2);});})['then'](function(){return new BPromise(function(_0x7444d9,_0x3849c2){rimraf(_0x17b571,function(_0x5c4b6d){if(_0x5c4b6d)_0x3849c2(_0x5c4b6d);return _0x7444d9();});});})['then'](function(){return _0x2ec1c8[_0x5cb9('0xd5')](_0x2c569b,_0x43a15d,function(_0x46989d){if(_0x46989d){console[_0x5cb9('0xea')](_0x5cb9('0xeb'),_0x46989d);}else{fs[_0x5cb9('0xec')](_0x2c569b);}});});});}else{return _0x2ec1c8[_0x5cb9('0x1c')](0xc8);}})['catch'](handleError(_0x2ec1c8,null));}; \ No newline at end of file +var _0xaa8b=['mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','type','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','keys','some','compact','isEmpty','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','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)','i.id','Sequelize','SELECT','clone','order','DESC','t.id\x20IN\x20?','resolve','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.subject','i.disposition','i.substatus','i.to','i.ContactId','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','MailInteractionId','Setting','enableEmailPreview','show','params','intersection','include','body','update','describe','addMessage','omit','ids','getMessages','nolimit','$gte','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','includeAll','findAll','rows','addTags','emit','mailInteractionTags:save','removeTags','download','unix','join','root','tmp','server','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','bcc','subject','Messages','get','mkdirSync','each','Bcc','existsSync','readFileSync','build','log','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','count','offset','limit','Content-Range','json','apply','save','destroy','then','end','error','stack','name','send','map','fullname','TagIds','split','Tags','push','MailInteraction','findOne','lastMsgBody','lastMsgText','trimStart','catch','index','rawAttributes','key','model','query','filters','attributes','fields','length','sort','where','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id'];(function(_0x1aa05a,_0x544784){var _0x52ec12=function(_0xb6370){while(--_0xb6370){_0x1aa05a['push'](_0x1aa05a['shift']());}};_0x52ec12(++_0x544784);}(_0xaa8b,0x178));var _0xbaa8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa8b[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbaa8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbaa8('0x1'));var jsonpatch=require(_0xbaa8('0x2'));var rp=require(_0xbaa8('0x3'));var moment=require(_0xbaa8('0x4'));var BPromise=require(_0xbaa8('0x5'));var Mustache=require(_0xbaa8('0x6'));var util=require(_0xbaa8('0x7'));var path=require('path');var sox=require(_0xbaa8('0x8'));var csv=require(_0xbaa8('0x9'));var ejs=require(_0xbaa8('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbaa8('0xb'));var crypto=require(_0xbaa8('0xc'));var jsforce=require(_0xbaa8('0xd'));var deskjs=require(_0xbaa8('0xe'));var toCsv=require(_0xbaa8('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var htmlToText=require('html-to-text');var Redis=require('ioredis');var authService=require(_0xbaa8('0xf'));var qs=require(_0xbaa8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbaa8('0x11'))(_0xbaa8('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xbaa8('0x13')]=_[_0xbaa8('0x14')](config['redis'],{'host':_0xbaa8('0x15'),'port':0x18eb});var socket=require(_0xbaa8('0x16'))(new Redis(config[_0xbaa8('0x13')]));require(_0xbaa8('0x17'))[_0xbaa8('0x18')](socket);function respondWithStatusCode(_0x2fd594,_0x4f3662){_0x4f3662=_0x4f3662||0xcc;return function(_0x58219e){if(_0x58219e){return _0x2fd594[_0xbaa8('0x19')](_0x4f3662);}return _0x2fd594[_0xbaa8('0x1a')](_0x4f3662)['end']();};}function respondWithResult(_0x3f4d70,_0x272877){_0x272877=_0x272877||0xc8;return function(_0x4d006c){if(_0x4d006c){return _0x3f4d70[_0xbaa8('0x1a')](_0x272877)['json'](_0x4d006c);}};}function respondWithFilteredResult(_0x467413,_0x57ad3a){return function(_0x9228c1){if(_0x9228c1){var _0x2bdf96=_0x9228c1[_0xbaa8('0x1b')],_0x419820=_0x57ad3a[_0xbaa8('0x1c')],_0x316725=_0x57ad3a[_0xbaa8('0x1c')]+_0x57ad3a[_0xbaa8('0x1d')],_0x25f6d2;if(_0x316725>=_0x2bdf96){_0x316725=_0x2bdf96;_0x25f6d2=0xc8;}else{_0x25f6d2=0xce;}_0x467413['status'](_0x25f6d2);return _0x467413['set'](_0xbaa8('0x1e'),_0x419820+'-'+_0x316725+'/'+_0x2bdf96)[_0xbaa8('0x1f')](_0x9228c1);}return null;};}function patchUpdates(_0x12c85d){return function(_0x20758f){try{jsonpatch[_0xbaa8('0x20')](_0x20758f,_0x12c85d,!![]);}catch(_0x5631e9){return BPromise['reject'](_0x5631e9);}return _0x20758f[_0xbaa8('0x21')]();};}function saveUpdates(_0x3f4d1a,_0x5cda6b){return function(_0x617163){if(_0x617163){return _0x617163['update'](_0x3f4d1a)['then'](function(_0x444da6){return _0x444da6;});}return null;};}function removeEntity(_0xcd6b1d,_0x10c3d1){return function(_0x19d44f){if(_0x19d44f){return _0x19d44f[_0xbaa8('0x22')]()[_0xbaa8('0x23')](function(){_0xcd6b1d['status'](0xcc)[_0xbaa8('0x24')]();});}};}function handleEntityNotFound(_0x4c9668,_0x47cafa){return function(_0x54a40a){if(!_0x54a40a){_0x4c9668[_0xbaa8('0x19')](0x194);}return _0x54a40a;};}function handleError(_0x30d6b3,_0x8362f2){_0x8362f2=_0x8362f2||0x1f4;return function(_0x4ba23b){logger[_0xbaa8('0x25')](_0x4ba23b[_0xbaa8('0x26')]);if(_0x4ba23b['name']){delete _0x4ba23b[_0xbaa8('0x27')];}_0x30d6b3[_0xbaa8('0x1a')](_0x8362f2)[_0xbaa8('0x28')](_0x4ba23b);};}function getInteractionUsers(_0x272600,_0x55d683){return new BPromise(function(_0x2f6f65,_0x542dad){try{if(_0x55d683[_0x272600['id']]){_0x272600['Users']=_[_0xbaa8('0x29')](_0x55d683[_0x272600['id']],function(_0x233f71){return{'id':_0x233f71['id'],'fullname':_0x233f71[_0xbaa8('0x2a')]};});}}catch(_0x101db0){_0x542dad(_0x101db0);}_0x2f6f65(_0x272600);});}function getInteractionTags(_0x449e2c,_0x41d4c8){return new BPromise(function(_0x277844,_0x39bbc3){try{if(_0x449e2c[_0xbaa8('0x2b')]){_0x449e2c['Tags']=[];_0x449e2c['TagIds'][_0xbaa8('0x2c')](',')['forEach'](function(_0x310205){_0x449e2c[_0xbaa8('0x2d')][_0xbaa8('0x2e')](_0x41d4c8[_0x310205]);});}delete _0x449e2c[_0xbaa8('0x2b')];}catch(_0x156520){_0x39bbc3(_0x156520);}_0x277844(_0x449e2c);});}function getLastMessageText(_0x3daf31){return new BPromise(function(_0x4aeece,_0x41b00a){return db[_0xbaa8('0x2f')][_0xbaa8('0x30')]({'where':{'id':_0x3daf31['id']},'attributes':[_0xbaa8('0x31'),'lastMsgText'],'raw':!![]})[_0xbaa8('0x23')](function(_0x5ce26a){if(!_0x5ce26a['lastMsgText']){_0x3daf31[_0xbaa8('0x32')]=_[_0xbaa8('0x33')](htmlToText['fromString'](_0x5ce26a[_0xbaa8('0x31')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x3daf31[_0xbaa8('0x32')]=_0x5ce26a[_0xbaa8('0x32')];}_0x4aeece(_0x3daf31);})['catch'](function(_0x1834f7){_0x41b00a(_0x1834f7);});});}function updateMailInteraction(_0x31fb4c,_0x159c67,_0x449feb,_0x894d6){return new BPromise(function(_0x10f71d,_0x42d84e){return getInteractionUsers(_0x31fb4c,_0x449feb)[_0xbaa8('0x23')](function(_0x245f5d){return getInteractionTags(_0x245f5d,_0x159c67);})[_0xbaa8('0x23')](function(_0x52f0cf){if(_0x894d6){_0x10f71d(getLastMessageText(_0x52f0cf));}else{_0x10f71d(_0x52f0cf);}})[_0xbaa8('0x34')](function(_0x3b1556){_0x42d84e(_0x3b1556);});});}exports[_0xbaa8('0x35')]=function(_0x521c5c,_0x53c9f8){var _0x20cd13={},_0x2b06b4={},_0x300029={'count':0x0,'rows':[]};var _0x366959=_['map'](db[_0xbaa8('0x2f')][_0xbaa8('0x36')],function(_0x15e1a8){return{'name':_0x15e1a8['fieldName'],'type':_0x15e1a8['type'][_0xbaa8('0x37')]};});_0x2b06b4[_0xbaa8('0x38')]=_[_0xbaa8('0x29')](_0x366959,_0xbaa8('0x27'));_0x2b06b4[_0xbaa8('0x39')]=_['keys'](_0x521c5c[_0xbaa8('0x39')]);_0x2b06b4[_0xbaa8('0x3a')]=_['intersection'](_0x2b06b4['model'],_0x2b06b4['query']);_0x20cd13[_0xbaa8('0x3b')]=_['intersection'](_0x2b06b4[_0xbaa8('0x38')],qs[_0xbaa8('0x3c')](_0x521c5c['query'][_0xbaa8('0x3c')]));_0x20cd13[_0xbaa8('0x3b')]=_0x20cd13['attributes'][_0xbaa8('0x3d')]?_0x20cd13[_0xbaa8('0x3b')]:_0x2b06b4[_0xbaa8('0x38')];if(!_0x521c5c[_0xbaa8('0x39')]['hasOwnProperty']('nolimit')){_0x20cd13[_0xbaa8('0x1d')]=qs['limit'](_0x521c5c[_0xbaa8('0x39')][_0xbaa8('0x1d')]);_0x20cd13[_0xbaa8('0x1c')]=qs[_0xbaa8('0x1c')](_0x521c5c[_0xbaa8('0x39')]['offset']);}_0x20cd13['order']=qs[_0xbaa8('0x3e')](_0x521c5c[_0xbaa8('0x39')][_0xbaa8('0x3e')]);_0x20cd13[_0xbaa8('0x3f')]=qs[_0xbaa8('0x3a')](_[_0xbaa8('0x40')](_0x521c5c['query'],_0x2b06b4[_0xbaa8('0x3a')]));var _0x311d9a=[];var _0x21f47b=squel['select']()[_0xbaa8('0x41')]('id')['field'](_0xbaa8('0x27'))[_0xbaa8('0x41')](_0xbaa8('0x42'))[_0xbaa8('0x43')](_0xbaa8('0x44'));var _0x442047=squel[_0xbaa8('0x45')]()['field'](_0xbaa8('0x46'))[_0xbaa8('0x41')](_0xbaa8('0x47'))['field'](_0xbaa8('0x48'))[_0xbaa8('0x43')](_0xbaa8('0x49'),'ui')[_0xbaa8('0x4a')](_0xbaa8('0x4b'),'u',_0xbaa8('0x4c'));var _0x434dc6=squel[_0xbaa8('0x45')]()[_0xbaa8('0x43')](_0xbaa8('0x4d'),'i')[_0xbaa8('0x4a')](_0xbaa8('0x4e'),'c',_0xbaa8('0x4f'))[_0xbaa8('0x4a')](_0xbaa8('0x4b'),'o','o.id\x20=\x20i.UserId')[_0xbaa8('0x4a')](_0xbaa8('0x50'),'a',_0xbaa8('0x51'))['left_join'](_0xbaa8('0x52'),'me',_0xbaa8('0x53'))['left_join'](_0xbaa8('0x54'),'it',_0xbaa8('0x55'))[_0xbaa8('0x4a')](_0xbaa8('0x44'),'t',_0xbaa8('0x56'));var _0x8135ee=squel[_0xbaa8('0x57')]();var _0x5b11c1=[];var _0x20ce90=squel[_0xbaa8('0x57')]();var _0x1c5f63;if(_0x521c5c['query'][_0xbaa8('0x58')]){_0x1c5f63=as[_0xbaa8('0x59')](_0x521c5c[_0xbaa8('0x39')][_0xbaa8('0x58')]);var _0x436171=_0x1c5f63['sqlOperator'];for(var _0x47d49c=0x0;_0x47d49c<_0x1c5f63[_0xbaa8('0x5a')]['length'];_0x47d49c++){var _0x3867f5=_0x1c5f63[_0xbaa8('0x5a')][_0x47d49c];var _0x557d3b='i';var _0x2415b1=_['find'](_0x366959,[_0xbaa8('0x27'),_0x3867f5['field']]);if(!_0x2415b1){switch(_0x3867f5[_0xbaa8('0x41')]){case _0xbaa8('0x5b'):if(_0x3867f5[_0xbaa8('0x5c')]==0x1){_0x434dc6['having']('`'+_0x3867f5[_0xbaa8('0x41')]+_0xbaa8('0x5d'));}else{_0x434dc6[_0xbaa8('0x5e')]('`'+_0x3867f5['field']+_0xbaa8('0x5f'));}break;case _0xbaa8('0x60'):if(_0x3867f5[_0xbaa8('0x61')]===_0xbaa8('0x62')){if(_0x3867f5[_0xbaa8('0x5c')][_0xbaa8('0x2c')]('\x20')[_0xbaa8('0x3d')]>0x1){_0x8135ee[_0x436171]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xbaa8('0x63')](_0x3867f5[_0xbaa8('0x5c')]),null);}else{var _0x29e604='%'+_0x3867f5[_0xbaa8('0x5c')]+'%';_0x8135ee[_0x436171](_0xbaa8('0x64'),_0x29e604,_0x29e604,_0x29e604);}}else{_0x2415b1=_[_0xbaa8('0x65')](_0x366959,[_0xbaa8('0x27'),'ContactId']);_0x3867f5[_0xbaa8('0x41')]=_0xbaa8('0x66');_0x3fe3db=as[_0xbaa8('0x67')](_0x557d3b,_0x2415b1[_0xbaa8('0x68')],_0x3867f5);_0x8135ee[_0x436171](_0x3fe3db[_0xbaa8('0x69')],_0x3fe3db[_0xbaa8('0x5c')][_0xbaa8('0x6a')],_0x3fe3db[_0xbaa8('0x5c')]['end']);}break;case _0xbaa8('0x6b'):var _0x1c8f07=_0x3867f5[_0xbaa8('0x5c')][_0xbaa8('0x2c')](',')[_0xbaa8('0x29')](function(_0x253aba){return Number(_0x253aba);});_0x1c8f07[_0xbaa8('0x6c')](function(_0xe0822){_0x20ce90['or'](_0xbaa8('0x6d'),'%,'+_0xe0822+',%');});_0x5b11c1=_[_0xbaa8('0x6e')](_0x5b11c1,_0x1c8f07);break;case _0xbaa8('0x6f'):if(_0x3867f5[_0xbaa8('0x61')]===_0xbaa8('0x62')){_0x8135ee[_0x436171](_0xbaa8('0x70'),'%'+_0x3867f5[_0xbaa8('0x5c')]+'%',null);}else{_0x2415b1=_[_0xbaa8('0x65')](_0x366959,[_0xbaa8('0x27'),_0xbaa8('0x71')]);_0x3867f5[_0xbaa8('0x41')]=_0xbaa8('0x71');_0x3fe3db=as[_0xbaa8('0x67')](_0x557d3b,_0x2415b1[_0xbaa8('0x68')],_0x3867f5);_0x8135ee[_0x436171](_0x3fe3db['text'],_0x3fe3db['value'][_0xbaa8('0x6a')],_0x3fe3db[_0xbaa8('0x5c')]['end']);}break;case _0xbaa8('0x72'):_0x3fe3db=as[_0xbaa8('0x67')]('me',null,_0x3867f5);_0x8135ee[_0x436171](_0x3fe3db[_0xbaa8('0x69')],_0x3fe3db[_0xbaa8('0x5c')][_0xbaa8('0x6a')],_0x3fe3db[_0xbaa8('0x5c')][_0xbaa8('0x24')]);break;}}else{var _0x3fe3db=as['buildExpression'](_0x557d3b,_0x2415b1[_0xbaa8('0x68')],_0x3867f5);_0x8135ee[_0x436171](_0x3fe3db[_0xbaa8('0x69')],_0x3fe3db[_0xbaa8('0x5c')]['start'],_0x3fe3db[_0xbaa8('0x5c')][_0xbaa8('0x24')]);}}}else{var _0x58af28=_(_0x521c5c['query'])[_0xbaa8('0x73')]()[_0xbaa8('0x29')](function(_0x42b98c){return _[_0xbaa8('0x74')](_0x366959,['name',_0x42b98c])?_0x42b98c:undefined;})[_0xbaa8('0x75')]()[_0xbaa8('0x5c')]();if(!_[_0xbaa8('0x76')](_0x58af28)){_0x58af28[_0xbaa8('0x6c')](function(_0x52a279){if(_0x52a279==='MailAccountId'){_0x434dc6[_0xbaa8('0x3f')]('i.MailAccountId\x20IN\x20?',[][_0xbaa8('0x77')](_0x521c5c[_0xbaa8('0x39')][_0x52a279]));}else if(_0x52a279===_0xbaa8('0x78')){var _0x11b56c=JSON[_0xbaa8('0x79')](_0x521c5c[_0xbaa8('0x39')][_0x52a279])['$gte'];var _0x2a1d64=JSON['parse'](_0x521c5c[_0xbaa8('0x39')][_0x52a279])[_0xbaa8('0x7a')];_0x434dc6[_0xbaa8('0x3f')](_0xbaa8('0x7b'),_0x11b56c,_0x2a1d64);}else{if(_0x521c5c[_0xbaa8('0x39')][_0x52a279]==='null'){_0x434dc6[_0xbaa8('0x3f')]('i.'+_0x52a279+_0xbaa8('0x7c'));}else{_0x434dc6[_0xbaa8('0x3f')]('i.'+_0x52a279+_0xbaa8('0x7d'),_0x521c5c[_0xbaa8('0x39')][_0x52a279]);}}});}if(_0x521c5c[_0xbaa8('0x39')][_0xbaa8('0x7e')]){if(_0x521c5c['query'][_0xbaa8('0x7e')]==0x1){_0x434dc6[_0xbaa8('0x5e')](_0xbaa8('0x7f'));}else{_0x434dc6['having']('`unreadMessages`\x20>\x200');}}if(_0x521c5c[_0xbaa8('0x39')][_0xbaa8('0x80')]){_0x5b11c1=_['isArray'](_0x521c5c['query'][_0xbaa8('0x80')])?_0x521c5c[_0xbaa8('0x39')][_0xbaa8('0x80')]:new Array(_0x521c5c[_0xbaa8('0x39')][_0xbaa8('0x80')]);_0x5b11c1['forEach'](function(_0x522a25){_0x20ce90['or'](_0xbaa8('0x6d'),'%,'+_0x522a25+',%');});}if(_0x521c5c[_0xbaa8('0x39')]['filter']){var _0x1a372f=_0x521c5c[_0xbaa8('0x39')][_0xbaa8('0x81')]['replace']('\x5c','\x5c\x5c')[_0xbaa8('0x82')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0xbaa8('0x83')](_0x1a372f)){_0x8135ee['or'](_0xbaa8('0x84'),_0x1a372f+'%');}else if(qs[_0xbaa8('0x85')](_0x1a372f)){_0x8135ee['or'](_0xbaa8('0x86'),_0x1a372f+'%');}else{_0x8135ee['or'](_0xbaa8('0x87'),qs[_0xbaa8('0x63')](_0x1a372f))['or'](_0xbaa8('0x88'),qs[_0xbaa8('0x63')](_0x1a372f));}}}_0x434dc6[_0xbaa8('0x3f')](_0x8135ee);_0x434dc6['group'](_0xbaa8('0x89'));var _0x31f004={'type':db[_0xbaa8('0x8a')]['QueryTypes'][_0xbaa8('0x8b')],'raw':!![]};var _0x3853a9=_0x434dc6[_0xbaa8('0x8c')]();_0x3853a9['field'](_0xbaa8('0x89'));_0x3853a9[_0xbaa8('0x41')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbaa8('0x5b'));if(_0x20cd13[_0xbaa8('0x8d')]){_0x20cd13[_0xbaa8('0x8d')][_0xbaa8('0x6c')](function(_0x411048){_0x434dc6[_0xbaa8('0x8d')]('i.'+_0x411048[0x0],_0x411048[0x1]===_0xbaa8('0x8e')?![]:!![]);});}if(!_[_0xbaa8('0x76')](_0x5b11c1)){_0x434dc6['having'](_0x20ce90);_0x3853a9[_0xbaa8('0x3f')](_0xbaa8('0x8f'),_0x5b11c1);}BPromise[_0xbaa8('0x90')]()[_0xbaa8('0x23')](function(){if(!_0x1c5f63){if(_0x521c5c['query']['MailAccountId']||_0x521c5c[_0xbaa8('0x39')][_0xbaa8('0x91')])return;_0x3853a9[_0xbaa8('0x3f')](_0xbaa8('0x92'));_0x434dc6[_0xbaa8('0x3f')](_0xbaa8('0x92'));return;}return _0x521c5c['user'][_0xbaa8('0x93')]({'attributes':['id'],'raw':!![]})[_0xbaa8('0x23')](function(_0x442405){if(_[_0xbaa8('0x76')](_0x442405)){_0x3853a9[_0xbaa8('0x3f')](_0xbaa8('0x94'));_0x434dc6[_0xbaa8('0x3f')](_0xbaa8('0x94'));}else{_0x3853a9[_0xbaa8('0x3f')](_0xbaa8('0x95'),_[_0xbaa8('0x29')](_0x442405,'id'));_0x434dc6[_0xbaa8('0x3f')](_0xbaa8('0x95'),_[_0xbaa8('0x29')](_0x442405,'id'));}});})[_0xbaa8('0x23')](function(){db[_0xbaa8('0x96')][_0xbaa8('0x39')](_0x3853a9[_0xbaa8('0x97')](),_0x31f004)[_0xbaa8('0x23')](function(_0x5b68e5){_0x300029[_0xbaa8('0x1b')]=_0x5b68e5['length'];if(_0x300029[_0xbaa8('0x1b')]===0x0)return[];return db[_0xbaa8('0x96')][_0xbaa8('0x39')](_0x21f47b['toString'](),_0x31f004)['then'](function(_0x54c89f){_0x311d9a=_['keyBy'](_0x54c89f,'id');_0x31f004=_[_0xbaa8('0x98')](_0x31f004,{'model':db[_0xbaa8('0x2f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x521c5c[_0xbaa8('0x39')][_0xbaa8('0x3c')]){_0x20cd13[_0xbaa8('0x3b')]['forEach'](function(_0xa4ea1d){_0x434dc6['field']('i.'+_0xa4ea1d);});}else{_0x434dc6[_0xbaa8('0x41')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbaa8('0x5b'));_0x434dc6['field'](_0xbaa8('0x99'),_0xbaa8('0x9a'));_0x434dc6['field'](_0xbaa8('0x9b'),_0xbaa8('0x9c'));_0x434dc6['field'](_0xbaa8('0x89'));_0x434dc6[_0xbaa8('0x41')]('i.createdAt');_0x434dc6[_0xbaa8('0x41')](_0xbaa8('0x9d'));_0x434dc6[_0xbaa8('0x41')](_0xbaa8('0x9e'));_0x434dc6[_0xbaa8('0x41')](_0xbaa8('0x9f'));_0x434dc6[_0xbaa8('0x41')](_0xbaa8('0xa0'));_0x434dc6[_0xbaa8('0x41')]('i.lastMsgAt');_0x434dc6[_0xbaa8('0x41')](_0xbaa8('0xa1'));_0x434dc6[_0xbaa8('0x41')](_0xbaa8('0xa2'));_0x434dc6[_0xbaa8('0x41')](_0xbaa8('0xa3'));_0x434dc6[_0xbaa8('0x41')](_0xbaa8('0xa4'));_0x434dc6[_0xbaa8('0x41')](_0xbaa8('0xa5'));_0x434dc6[_0xbaa8('0x41')](_0xbaa8('0xa6'));_0x434dc6[_0xbaa8('0x41')]('i.MailAccountId');_0x434dc6['field']('i.UserId');_0x434dc6[_0xbaa8('0x41')](_0xbaa8('0xa7'),'Contact.firstName');_0x434dc6[_0xbaa8('0x41')](_0xbaa8('0xa8'),_0xbaa8('0xa9'));_0x434dc6[_0xbaa8('0x41')](_0xbaa8('0xaa'),_0xbaa8('0xab'));_0x434dc6['field'](_0xbaa8('0xac'),_0xbaa8('0xad'));_0x434dc6[_0xbaa8('0x41')]('c.mobile','Contact.mobile');_0x434dc6[_0xbaa8('0x41')](_0xbaa8('0xae'),_0xbaa8('0xaf'));_0x434dc6['field'](_0xbaa8('0xb0'),_0xbaa8('0xb1'));_0x434dc6['field'](_0xbaa8('0xb2'),_0xbaa8('0xb3'));_0x434dc6[_0xbaa8('0x41')](_0xbaa8('0xb4'),_0xbaa8('0x2b'));}_0x434dc6[_0xbaa8('0x1d')](_0x20cd13[_0xbaa8('0x1d')]);_0x434dc6[_0xbaa8('0x1c')](_0x20cd13[_0xbaa8('0x1c')]);return db[_0xbaa8('0x96')]['query'](_0x434dc6[_0xbaa8('0x97')](),_0x31f004);})['then'](function(_0x4c6353){_0x442047[_0xbaa8('0x3f')](_0xbaa8('0xb5'),_[_0xbaa8('0x29')](_0x4c6353,'id'));return db[_0xbaa8('0x96')][_0xbaa8('0x39')](_0x442047[_0xbaa8('0x97')](),_0x31f004)[_0xbaa8('0x23')](function(_0x23f9a1){var _0x592bd7=_['groupBy'](_0x23f9a1,_0xbaa8('0xb6'));var _0x3b4c93=[];return db[_0xbaa8('0xb7')]['findOne']({'attributes':[_0xbaa8('0xb8')],'raw':!![]})[_0xbaa8('0x23')](function(_0x3e3d37){var _0x459ba6=_0x3e3d37[_0xbaa8('0xb8')];_0x4c6353[_0xbaa8('0x6c')](function(_0x1f113c){_0x3b4c93[_0xbaa8('0x2e')](updateMailInteraction(_0x1f113c,_0x311d9a,_0x592bd7,_0x459ba6));});return BPromise['all'](_0x3b4c93);});});});})[_0xbaa8('0x23')](function(_0x54ee91){_0x300029['rows']=_0x54ee91;return _0x300029;})['then'](respondWithFilteredResult(_0x53c9f8,_0x20cd13));})[_0xbaa8('0x34')](handleError(_0x53c9f8,null));};exports[_0xbaa8('0xb9')]=function(_0x78f861,_0x3f53db){var _0x3ee662={'raw':![],'where':{'id':_0x78f861[_0xbaa8('0xba')]['id']}},_0x3eda0d={};_0x3eda0d[_0xbaa8('0x38')]=_[_0xbaa8('0x73')](db[_0xbaa8('0x2f')]['rawAttributes']);_0x3eda0d[_0xbaa8('0x39')]=_[_0xbaa8('0x73')](_0x78f861[_0xbaa8('0x39')]);_0x3eda0d[_0xbaa8('0x3a')]=_[_0xbaa8('0xbb')](_0x3eda0d[_0xbaa8('0x38')],_0x3eda0d[_0xbaa8('0x39')]);_0x3ee662[_0xbaa8('0x3b')]=_['intersection'](_0x3eda0d[_0xbaa8('0x38')],qs['fields'](_0x78f861['query']['fields']));_0x3ee662['attributes']=_0x3ee662['attributes'][_0xbaa8('0x3d')]?_0x3ee662[_0xbaa8('0x3b')]:_0x3eda0d[_0xbaa8('0x38')];if(_0x78f861[_0xbaa8('0x39')]['includeAll']){_0x3ee662[_0xbaa8('0xbc')]=[{'all':!![]}];}_0x3ee662=_[_0xbaa8('0x98')]({},_0x3ee662,_0x78f861['options']);return db[_0xbaa8('0x2f')][_0xbaa8('0x65')](_0x3ee662)[_0xbaa8('0x23')](handleEntityNotFound(_0x3f53db,null))['then'](respondWithResult(_0x3f53db,null))[_0xbaa8('0x34')](handleError(_0x3f53db,null));};exports['create']=function(_0x1f223c,_0xf01888){return db[_0xbaa8('0x2f')]['create'](_0x1f223c[_0xbaa8('0xbd')],{})[_0xbaa8('0x23')](respondWithResult(_0xf01888,0xc9))[_0xbaa8('0x34')](handleError(_0xf01888,null));};exports[_0xbaa8('0xbe')]=function(_0x1998fe,_0x6943b2){if(_0x1998fe['body']['id']){delete _0x1998fe[_0xbaa8('0xbd')]['id'];}return db[_0xbaa8('0x2f')]['find']({'where':{'id':_0x1998fe[_0xbaa8('0xba')]['id']}})['then'](handleEntityNotFound(_0x6943b2,null))[_0xbaa8('0x23')](saveUpdates(_0x1998fe['body'],null))[_0xbaa8('0x23')](respondWithResult(_0x6943b2,null))[_0xbaa8('0x34')](handleError(_0x6943b2,null));};exports['destroy']=function(_0x134eb0,_0x57e4d6){return db[_0xbaa8('0x2f')][_0xbaa8('0x65')]({'where':{'id':_0x134eb0[_0xbaa8('0xba')]['id']}})['then'](handleEntityNotFound(_0x57e4d6,null))[_0xbaa8('0x23')](removeEntity(_0x57e4d6,null))[_0xbaa8('0x34')](handleError(_0x57e4d6,null));};exports[_0xbaa8('0xbf')]=function(_0x34ac8b,_0xcb5319){return db[_0xbaa8('0x2f')]['describe']()[_0xbaa8('0x23')](respondWithResult(_0xcb5319,null))[_0xbaa8('0x34')](handleError(_0xcb5319,null));};exports[_0xbaa8('0xc0')]=function(_0x31d129,_0x1f125c,_0x2a0a3a){return db['MailMessage']['find']({'where':{'id':_0x31d129['params']['id']}})['then'](handleEntityNotFound(_0x1f125c,null))[_0xbaa8('0x23')](function(_0x3995ca){if(_0x3995ca){return _0x3995ca[_0xbaa8('0xc0')](_0x31d129[_0xbaa8('0xbd')]['ids'],_[_0xbaa8('0xc1')](_0x31d129[_0xbaa8('0xbd')],[_0xbaa8('0xc2'),'id'])||{});}})[_0xbaa8('0x23')](respondWithResult(_0x1f125c,null))['catch'](handleError(_0x1f125c,null));};exports[_0xbaa8('0xc3')]=function(_0x1d5fd0,_0x32447a,_0x6c4374){var _0x10717e={'raw':![],'where':{}};var _0x360d3d={};var _0x2414ce={'count':0x0,'rows':[]};return db['MailInteraction'][_0xbaa8('0x30')]({'where':{'id':_0x1d5fd0[_0xbaa8('0xba')]['id']}})['then'](handleEntityNotFound(_0x32447a,null))[_0xbaa8('0x23')](function(_0x8e1416){if(_0x8e1416){_0x360d3d[_0xbaa8('0x38')]=_[_0xbaa8('0x73')](db['MailMessage'][_0xbaa8('0x36')]);_0x360d3d['query']=_[_0xbaa8('0x73')](_0x1d5fd0[_0xbaa8('0x39')]);_0x360d3d[_0xbaa8('0x3a')]=_[_0xbaa8('0xbb')](_0x360d3d[_0xbaa8('0x38')],_0x360d3d[_0xbaa8('0x39')]);_0x10717e[_0xbaa8('0x3b')]=_[_0xbaa8('0xbb')](_0x360d3d['model'],qs[_0xbaa8('0x3c')](_0x1d5fd0[_0xbaa8('0x39')]['fields']));_0x10717e[_0xbaa8('0x3b')]=_0x10717e['attributes'][_0xbaa8('0x3d')]?_0x10717e[_0xbaa8('0x3b')]:_0x360d3d[_0xbaa8('0x38')];if(!_0x1d5fd0[_0xbaa8('0x39')]['hasOwnProperty'](_0xbaa8('0xc4'))){_0x10717e[_0xbaa8('0x1d')]=qs['limit'](_0x1d5fd0[_0xbaa8('0x39')]['limit']);_0x10717e[_0xbaa8('0x1c')]=qs[_0xbaa8('0x1c')](_0x1d5fd0[_0xbaa8('0x39')][_0xbaa8('0x1c')]);}_0x10717e[_0xbaa8('0x8d')]=qs[_0xbaa8('0x3e')](_0x1d5fd0[_0xbaa8('0x39')][_0xbaa8('0x3e')]);_0x10717e[_0xbaa8('0x3f')]=qs[_0xbaa8('0x3a')](_[_0xbaa8('0x40')](_0x1d5fd0[_0xbaa8('0x39')],_0x360d3d[_0xbaa8('0x3a')]));_0x10717e['where']['MailInteractionId']=_0x8e1416['id'];if(_0x1d5fd0[_0xbaa8('0x39')][_0xbaa8('0x81')]){_0x10717e[_0xbaa8('0x3f')]=_[_0xbaa8('0x98')](_0x10717e[_0xbaa8('0x3f')],{'$or':_[_0xbaa8('0x29')](_0x10717e['attributes'],function(_0x150bae){var _0x3f87b9={};_0x3f87b9[_0x150bae]={'$like':'%'+_0x1d5fd0[_0xbaa8('0x39')][_0xbaa8('0x81')]+'%'};return _0x3f87b9;})});}if(_0x1d5fd0[_0xbaa8('0x39')][_0xbaa8('0xc5')]){var _0x386685=_0x1d5fd0[_0xbaa8('0x39')][_0xbaa8('0xc5')][_0xbaa8('0x2c')](',');var _0x301332={};_0x301332[_0x386685[0x0]]={'$gte':moment(_0x386685[0x1])[_0xbaa8('0xc6')](_0xbaa8('0xc7'))};_0x10717e['where']=_[_0xbaa8('0x98')](_0x10717e[_0xbaa8('0x3f')],_0x301332);}_0x10717e=_[_0xbaa8('0x98')]({},_0x10717e,_0x1d5fd0['options']);return db[_0xbaa8('0xc8')]['count']({'where':_0x10717e[_0xbaa8('0x3f')]})[_0xbaa8('0x23')](function(_0x43bfdb){_0x2414ce[_0xbaa8('0x1b')]=_0x43bfdb;if(_0x1d5fd0[_0xbaa8('0x39')][_0xbaa8('0xc9')]){_0x10717e[_0xbaa8('0xbc')]=[{'all':!![]}];}return db[_0xbaa8('0xc8')][_0xbaa8('0xca')](_0x10717e);})['then'](function(_0x3159d8){_0x2414ce[_0xbaa8('0xcb')]=_0x3159d8;return _0x2414ce;});}})['then'](respondWithFilteredResult(_0x32447a,_0x10717e))['catch'](handleError(_0x32447a,null));};exports[_0xbaa8('0xcc')]=function(_0x30fa1b,_0x1cc1e6,_0x1b6c26){return db[_0xbaa8('0x2f')]['find']({'where':{'id':_0x30fa1b[_0xbaa8('0xba')]['id']}})['then'](handleEntityNotFound(_0x1cc1e6,null))[_0xbaa8('0x23')](function(_0x14eb8f){if(_0x14eb8f){return _0x14eb8f['setTags'](_0x30fa1b[_0xbaa8('0xbd')][_0xbaa8('0xc2')],_[_0xbaa8('0xc1')](_0x30fa1b[_0xbaa8('0xbd')],[_0xbaa8('0xc2'),'id'])||{})['spread'](function(){return db['Tag'][_0xbaa8('0xca')]({'attributes':['id',_0xbaa8('0x27'),'color'],'where':{'id':_0x30fa1b[_0xbaa8('0xbd')][_0xbaa8('0xc2')]}});})[_0xbaa8('0x23')](function(_0x4406ce){socket[_0xbaa8('0xcd')](_0xbaa8('0xce'),{'id':Number(_0x30fa1b[_0xbaa8('0xba')]['id']),'tags':_0x4406ce||[]});return{'id':Number(_0x30fa1b[_0xbaa8('0xba')]['id']),'tags':_0x4406ce||[]};});}})['then'](respondWithResult(_0x1cc1e6,null))['catch'](handleError(_0x1cc1e6,null));};exports[_0xbaa8('0xcf')]=function(_0x213282,_0x1b291e,_0x25e434){return db[_0xbaa8('0x2f')][_0xbaa8('0x65')]({'where':{'id':_0x213282[_0xbaa8('0xba')]['id']}})['then'](handleEntityNotFound(_0x1b291e,null))['then'](function(_0x1d655a){if(_0x1d655a){return _0x1d655a[_0xbaa8('0xcf')](_0x213282[_0xbaa8('0x39')][_0xbaa8('0xc2')]);}})['then'](respondWithStatusCode(_0x1b291e,null))[_0xbaa8('0x34')](handleError(_0x1b291e,null));};exports[_0xbaa8('0xd0')]=function(_0xb36809,_0x4919ba){var _0x3604a6=moment()[_0xbaa8('0xd1')]()[_0xbaa8('0x97')]();var _0x11655a=path[_0xbaa8('0xd2')](config[_0xbaa8('0xd3')],'server','files',_0xbaa8('0xd4'));var _0x2dce08=path['join'](config[_0xbaa8('0xd3')],_0xbaa8('0xd5'),_0xbaa8('0xd6'),_0xbaa8('0xd7'));var _0x1c58fb=path[_0xbaa8('0xd2')](_0x11655a,_0x3604a6);var _0x1b2199=util[_0xbaa8('0xc6')](_0xbaa8('0xd8'),_0xb36809[_0xbaa8('0xba')]['id'],_0x3604a6);var _0x5e233b=path[_0xbaa8('0xd2')](_0x11655a,_0x1b2199);var _0xa2ec9c=[];if(_0xb36809['query'][_0xbaa8('0xd7')]){_0xa2ec9c['push']({'model':db[_0xbaa8('0xd9')],'as':_0xbaa8('0xda'),'raw':!![]});}var _0xba16d2=[{'model':db[_0xbaa8('0xc8')],'as':'Messages','attributes':['id',_0xbaa8('0xbd'),_0xbaa8('0x43'),'to','cc',_0xbaa8('0xdb'),_0xbaa8('0xdc'),_0xbaa8('0x78')],'where':{'secret':![]},'order':qs[_0xbaa8('0x3e')]('id'),'include':_0xa2ec9c}];return db['MailInteraction'][_0xbaa8('0x65')]({'where':{'id':_0xb36809[_0xbaa8('0xba')]['id']},'include':_0xba16d2})[_0xbaa8('0x23')](handleEntityNotFound(_0x4919ba,null))[_0xbaa8('0x23')](function(_0x4ebd4e){if(_0x4ebd4e&&_0x4ebd4e[_0xbaa8('0xdd')]){var _0xb6c244=_0x4ebd4e[_0xbaa8('0xde')]({'plain':!![]});fs[_0xbaa8('0xdf')](_0x1c58fb);return BPromise[_0xbaa8('0xe0')](_0xb6c244[_0xbaa8('0xdd')],function(_0x1af713,_0x2f907e){var _0x442cff={'from':_0x1af713[_0xbaa8('0x43')],'to':_0x1af713['to'],'subject':_0x1af713[_0xbaa8('0xdc')],'html':_0x1af713['body'],'headers':{'Date':moment(_0x1af713[_0xbaa8('0x78')])[_0xbaa8('0xc6')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1af713['cc']){_0x442cff['headers']['Cc']=_0x1af713['cc'];}if(_0x1af713[_0xbaa8('0xdb')]){_0x442cff['headers'][_0xbaa8('0xe1')]=_0x1af713[_0xbaa8('0xdb')];}return new BPromise(function(_0x51d142,_0x34e5d5){if(_0x1af713['Attachments']){for(var _0x17f1e5=0x0;_0x17f1e5<_0x1af713[_0xbaa8('0xda')]['length'];_0x17f1e5++){var _0x14d7ae=_0x1af713[_0xbaa8('0xda')][_0x17f1e5];var _0x5819c6=path[_0xbaa8('0xd2')](_0x2dce08,_0x14d7ae['basename']);if(fs[_0xbaa8('0xe2')](_0x5819c6)){_0x442cff[_0xbaa8('0xd7')][_0xbaa8('0x2e')]({'name':_0x14d7ae[_0xbaa8('0x27')],'contentType':_0x14d7ae[_0xbaa8('0x68')],'data':fs[_0xbaa8('0xe3')](_0x5819c6)});}}}emlformat[_0xbaa8('0xe4')](_0x442cff,function(_0x3865bd,_0x1fc809){if(_0x3865bd)return _0x34e5d5(_0x3865bd);fs['writeFileSync'](path[_0xbaa8('0xd2')](_0x1c58fb,util[_0xbaa8('0xc6')]('message%d.eml',_0x2f907e)),_0x1fc809);return _0x51d142(_0x1fc809);});});})['then'](function(){return new BPromise(function(_0x4c0dc8,_0x519585){zipdir(_0x1c58fb,{'saveTo':_0x5e233b},function(_0x10fb4c,_0x272f63){if(_0x10fb4c)return _0x519585(_0x10fb4c);return _0x4c0dc8(_0x272f63);});})[_0xbaa8('0x23')](function(){return new BPromise(function(_0x326c12,_0x58c65f){rimraf(_0x1c58fb,function(_0x1e2af7){if(_0x1e2af7)_0x58c65f(_0x1e2af7);return _0x326c12();});});})['then'](function(){return _0x4919ba[_0xbaa8('0xd0')](_0x5e233b,_0x1b2199,function(_0x396513){if(_0x396513){console[_0xbaa8('0xe5')]('err',_0x396513);}else{fs['unlinkSync'](_0x5e233b);}});});});}else{return _0x4919ba[_0xbaa8('0x19')](0xc8);}})['catch'](handleError(_0x4919ba,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 6e962b8..fba65b5 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 _0x35f5=['emit','catch','hasOwnProperty','exports','events','MailInteraction','MailMessage','save','remove','getUsers','then','setDataValue','Users','map','findAll','length'];(function(_0x169e5f,_0x21164e){var _0x45011f=function(_0x1067c3){while(--_0x1067c3){_0x169e5f['push'](_0x169e5f['shift']());}};_0x45011f(++_0x21164e);}(_0x35f5,0x124));var _0x535f=function(_0x471448,_0x1c0e9e){_0x471448=_0x471448-0x0;var _0x38190b=_0x35f5[_0x471448];return _0x38190b;};'use strict';var EventEmitter=require(_0x535f('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x535f('0x1')];var MailMessage=require('../../mysqldb')['db'][_0x535f('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x535f('0x3'),'afterUpdate':'update','afterDestroy':_0x535f('0x4')};function emitEvent(_0x140bde){return function(_0x4683fd,_0x4d442e,_0x17f8c5){_0x4683fd[_0x535f('0x5')]({'attributes':['id'],'raw':!![]})[_0x535f('0x6')](function(_0x1588f5){_0x4683fd[_0x535f('0x7')](_0x535f('0x8'),_0x1588f5[_0x535f('0x9')](function(_0x3ef1d1){return{'id':_0x3ef1d1['id']};}));return MailMessage[_0x535f('0xa')]({'where':{'MailInteractionId':_0x4683fd['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4fad4b){_0x4683fd[_0x535f('0x7')]('unreadMessages',_0x4fad4b[_0x535f('0xb')]);MailInteractionEvents['emit'](_0x140bde+':'+_0x4683fd['id'],_0x4683fd);MailInteractionEvents[_0x535f('0xc')](_0x140bde,_0x4683fd);_0x17f8c5(null);})[_0x535f('0xd')](_0x17f8c5(null));};}for(var e in events){if(events[_0x535f('0xe')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x535f('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0xda11=['setDataValue','unreadMessages','emit','hasOwnProperty','hook','exports','events','MailInteraction','../../mysqldb','MailMessage','setMaxListeners','update','remove','getUsers','then','Users','map'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xda11,0x149));var _0x1da1=function(_0x28ab80,_0x450514){_0x28ab80=_0x28ab80-0x0;var _0x3b4fef=_0xda11[_0x28ab80];return _0x3b4fef;};'use strict';var EventEmitter=require(_0x1da1('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x1da1('0x1')];var MailMessage=require(_0x1da1('0x2'))['db'][_0x1da1('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x1da1('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1da1('0x5'),'afterDestroy':_0x1da1('0x6')};function emitEvent(_0x4efdbc){return function(_0x3828e8,_0x176918,_0x782dfb){_0x3828e8[_0x1da1('0x7')]({'attributes':['id'],'raw':!![]})[_0x1da1('0x8')](function(_0x40c187){_0x3828e8['setDataValue'](_0x1da1('0x9'),_0x40c187[_0x1da1('0xa')](function(_0x3dde05){return{'id':_0x3dde05['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x3828e8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1da1('0x8')](function(_0x14d611){_0x3828e8[_0x1da1('0xb')](_0x1da1('0xc'),_0x14d611['length']);MailInteractionEvents[_0x1da1('0xd')](_0x4efdbc+':'+_0x3828e8['id'],_0x3828e8);MailInteractionEvents[_0x1da1('0xd')](_0x4efdbc,_0x3828e8);_0x782dfb(null);})['catch'](_0x782dfb(null));};}for(var e in events){if(events[_0x1da1('0xe')](e)){var event=events[e];MailInteraction[_0x1da1('0xf')](e,emitEvent(event));}}module[_0x1da1('0x10')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 03366f1..7083817 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 _0xe0af=['closedAt','format','changed','models','get','update','then','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed'];(function(_0x593cab,_0x48aa8b){var _0x12d0ee=function(_0x30c27b){while(--_0x30c27b){_0x593cab['push'](_0x593cab['shift']());}};_0x12d0ee(++_0x48aa8b);}(_0xe0af,0x1c9));var _0xfe0a=function(_0xd050c6,_0x58ffb4){_0xd050c6=_0xd050c6-0x0;var _0x7278a=_0xe0af[_0xd050c6];return _0x7278a;};'use strict';var _=require(_0xfe0a('0x0'));var util=require(_0xfe0a('0x1'));var logger=require(_0xfe0a('0x2'))('api');var moment=require(_0xfe0a('0x3'));var BPromise=require(_0xfe0a('0x4'));var rp=require(_0xfe0a('0x5'));var fs=require('fs');var path=require(_0xfe0a('0x6'));var rimraf=require(_0xfe0a('0x7'));var config=require(_0xfe0a('0x8'));var attributes=require(_0xfe0a('0x9'));module[_0xfe0a('0xa')]=function(_0x3ab18f,_0x5ba790){return _0x3ab18f['define'](_0xfe0a('0xb'),attributes,{'tableName':_0xfe0a('0xc'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0xfe0a('0xd'),'to'],'type':_0xfe0a('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5f4930,_0x39a2ac,_0x399b95){if(_0x5f4930[_0xfe0a('0xf')]){_0x5f4930[_0xfe0a('0x10')]=moment()['format'](_0xfe0a('0x11'));}if(_0x5f4930[_0xfe0a('0x12')]){_0x5f4930[_0xfe0a('0x13')]=moment()[_0xfe0a('0x14')](_0xfe0a('0x11'));}_0x399b95(null,_0x39a2ac);},'beforeUpdate':function(_0x289b2b,_0x585f7a,_0x5e983){if(_0x289b2b[_0xfe0a('0x15')]('substatus')){_0x289b2b[_0xfe0a('0x10')]=_0x289b2b[_0xfe0a('0xf')]?moment()[_0xfe0a('0x14')](_0xfe0a('0x11')):null;}if(_0x289b2b['changed'](_0xfe0a('0x12'))){_0x289b2b['closedAt']=moment()[_0xfe0a('0x14')](_0xfe0a('0x11'));_0x289b2b['substatus']=null;_0x289b2b['substatusAt']=null;}_0x5e983(null,_0x289b2b);},'afterUpdate':function(_0x3d695e,_0x28d7cd,_0x57ff67){var _0x414ef0=_0x3ab18f[_0xfe0a('0x16')];var _0x43168b=_0x3d695e[_0xfe0a('0x17')]({'plain':!![]});if(_0x43168b[_0xfe0a('0x12')]){return _0x414ef0['MailMessage'][_0xfe0a('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x43168b['id']}})[_0xfe0a('0x19')](function(){_0x57ff67();})['catch'](function(_0x308fcf){_0x57ff67(_0x308fcf);});}else{_0x57ff67();}}},'charset':_0xfe0a('0x1a'),'collate':_0xfe0a('0x1b')});}; \ No newline at end of file +var _0x47c0=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','substatus','closed','models','get','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x41382c,_0xc3ffd1){var _0x4da35b=function(_0x5d56b8){while(--_0x5d56b8){_0x41382c['push'](_0x41382c['shift']());}};_0x4da35b(++_0xc3ffd1);}(_0x47c0,0x1dc));var _0x047c=function(_0x2f9958,_0x5a3b4b){_0x2f9958=_0x2f9958-0x0;var _0x470330=_0x47c0[_0x2f9958];return _0x470330;};'use strict';var _=require(_0x047c('0x0'));var util=require(_0x047c('0x1'));var logger=require(_0x047c('0x2'))('api');var moment=require(_0x047c('0x3'));var BPromise=require(_0x047c('0x4'));var rp=require(_0x047c('0x5'));var fs=require('fs');var path=require(_0x047c('0x6'));var rimraf=require(_0x047c('0x7'));var config=require(_0x047c('0x8'));var attributes=require('./mailInteraction.attributes');module[_0x047c('0x9')]=function(_0x521b31,_0x11344f){return _0x521b31[_0x047c('0xa')]('MailInteraction',attributes,{'tableName':_0x047c('0xb'),'paranoid':![],'indexes':[{'name':_0x047c('0xc'),'fields':[_0x047c('0xd'),'to'],'type':_0x047c('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1d58ac,_0x586e8d,_0x224f2f){if(_0x1d58ac['substatus']){_0x1d58ac[_0x047c('0xf')]=moment()[_0x047c('0x10')](_0x047c('0x11'));}if(_0x1d58ac['closed']){_0x1d58ac[_0x047c('0x12')]=moment()[_0x047c('0x10')](_0x047c('0x11'));}_0x224f2f(null,_0x586e8d);},'beforeUpdate':function(_0x3f65f0,_0xb5af3,_0x473a46){if(_0x3f65f0[_0x047c('0x13')](_0x047c('0x14'))){_0x3f65f0[_0x047c('0xf')]=_0x3f65f0[_0x047c('0x14')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x3f65f0['changed'](_0x047c('0x15'))){_0x3f65f0[_0x047c('0x12')]=moment()[_0x047c('0x10')](_0x047c('0x11'));_0x3f65f0['substatus']=null;_0x3f65f0['substatusAt']=null;}_0x473a46(null,_0x3f65f0);},'afterUpdate':function(_0x598e4e,_0x5745c1,_0x219148){var _0x420796=_0x521b31[_0x047c('0x16')];var _0x4b6274=_0x598e4e[_0x047c('0x17')]({'plain':!![]});if(_0x4b6274[_0x047c('0x15')]){return _0x420796[_0x047c('0x18')][_0x047c('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x4b6274['id']}})[_0x047c('0x1a')](function(){_0x219148();})[_0x047c('0x1b')](function(_0x5afe78){_0x219148(_0x5afe78);});}else{_0x219148();}}},'charset':_0x047c('0x1c'),'collate':_0x047c('0x1d')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index b4133aa..c5261e0 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 _0x0efe=['socket.io-emitter','./mailInteraction.socket','register','then','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateMailInteraction','update','body','options','where','attributes','limit','info','MailInteraction','find','addTags','ids','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0efe,0x110));var _0xe0ef=function(_0x11ca5d,_0x388912){_0x11ca5d=_0x11ca5d-0x0;var _0x403237=_0x0efe[_0x11ca5d];return _0x403237;};'use strict';var _=require(_0xe0ef('0x0'));var util=require(_0xe0ef('0x1'));var moment=require('moment');var BPromise=require(_0xe0ef('0x2'));var rs=require(_0xe0ef('0x3'));var fs=require('fs');var Redis=require(_0xe0ef('0x4'));var db=require(_0xe0ef('0x5'))['db'];var utils=require(_0xe0ef('0x6'));var logger=require(_0xe0ef('0x7'))(_0xe0ef('0x8'));var config=require(_0xe0ef('0x9'));var jayson=require(_0xe0ef('0xa'));var client=jayson[_0xe0ef('0xb')]['http']({'port':0x232a});config['redis']=_[_0xe0ef('0xc')](config[_0xe0ef('0xd')],{'host':_0xe0ef('0xe'),'port':0x18eb});var socket=require(_0xe0ef('0xf'))(new Redis(config[_0xe0ef('0xd')]));require(_0xe0ef('0x10'))[_0xe0ef('0x11')](socket);function respondWithRpcPromise(_0x4ec5dd,_0x538d1f,_0x12e93a){return new BPromise(function(_0x62fd61,_0x1e000c){return client['request'](_0x4ec5dd,_0x12e93a)[_0xe0ef('0x12')](function(_0x14569f){logger['info'](_0xe0ef('0x13'),_0x538d1f,'request\x20sent');logger[_0xe0ef('0x14')](_0xe0ef('0x15'),_0x538d1f,_0xe0ef('0x16'),JSON['stringify'](_0x14569f));if(_0x14569f['error']){if(_0x14569f[_0xe0ef('0x17')][_0xe0ef('0x18')]===0x1f4){logger[_0xe0ef('0x17')](_0xe0ef('0x13'),_0x538d1f,_0x14569f[_0xe0ef('0x17')][_0xe0ef('0x19')]);return _0x1e000c(_0x14569f[_0xe0ef('0x17')][_0xe0ef('0x19')]);}logger['error'](_0xe0ef('0x13'),_0x538d1f,_0x14569f[_0xe0ef('0x17')][_0xe0ef('0x19')]);return _0x62fd61(_0x14569f[_0xe0ef('0x17')][_0xe0ef('0x19')]);}else{logger['info'](_0xe0ef('0x13'),_0x538d1f,_0xe0ef('0x16'));_0x62fd61(_0x14569f[_0xe0ef('0x1a')][_0xe0ef('0x19')]);}})[_0xe0ef('0x1b')](function(_0x214c7f){logger[_0xe0ef('0x17')](_0xe0ef('0x13'),_0x538d1f,_0x214c7f);_0x1e000c(_0x214c7f);});});}exports[_0xe0ef('0x1c')]=function(_0x270f57){var _0xae50eb=this;return new Promise(function(_0x1e0dd8,_0x450321){return db['MailInteraction'][_0xe0ef('0x1d')](_0x270f57[_0xe0ef('0x1e')],{'raw':_0x270f57[_0xe0ef('0x1f')]?_0x270f57[_0xe0ef('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x270f57[_0xe0ef('0x1f')]?_0x270f57[_0xe0ef('0x1f')][_0xe0ef('0x20')]||null:null,'attributes':_0x270f57[_0xe0ef('0x1f')]?_0x270f57[_0xe0ef('0x1f')][_0xe0ef('0x21')]||null:null,'limit':_0x270f57[_0xe0ef('0x1f')]?_0x270f57['options'][_0xe0ef('0x22')]||null:null})[_0xe0ef('0x12')](function(_0x5a44a9){logger[_0xe0ef('0x23')](_0xe0ef('0x1c'),_0x270f57);logger['debug']('UpdateMailInteraction',_0x270f57,JSON['stringify'](_0x5a44a9));_0x1e0dd8(_0x5a44a9);})[_0xe0ef('0x1b')](function(_0x4ee2c1){logger[_0xe0ef('0x17')](_0xe0ef('0x1c'),_0x4ee2c1[_0xe0ef('0x19')],_0x270f57);_0x450321(_0xae50eb['error'](0x1f4,_0x4ee2c1['message']));});});};exports['AddTagsToMailInteraction']=function(_0x2c4bfd){return new Promise(function(_0xa5839b,_0x3dd451){return db[_0xe0ef('0x24')][_0xe0ef('0x25')]({'where':_0x2c4bfd[_0xe0ef('0x1f')]?_0x2c4bfd['options']['where']||null:null})[_0xe0ef('0x12')](function(_0x5b840b){if(_0x5b840b){return _0x5b840b[_0xe0ef('0x26')](_0x2c4bfd[_0xe0ef('0x1e')]['ids'],_['omit'](_0x2c4bfd[_0xe0ef('0x1e')],[_0xe0ef('0x27'),'id'])||{});}})['spread'](function(_0x6c563d){logger[_0xe0ef('0x23')](_0xe0ef('0x28'),_0x2c4bfd);logger['debug']('AddTags',_0x2c4bfd,JSON['stringify'](_0x6c563d));_0xa5839b(_0x6c563d);})[_0xe0ef('0x1b')](function(_0x4987df){logger[_0xe0ef('0x17')](_0xe0ef('0x28'),_0x4987df['message'],_0x2c4bfd);_0x3dd451(_this[_0xe0ef('0x17')](0x1f4,_0x4987df[_0xe0ef('0x19')]));});});}; \ No newline at end of file +var _0xbca8=['addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','MailInteraction','update','body','options','raw','attributes','limit','then','UpdateMailInteraction','debug','AddTagsToMailInteraction','where'];(function(_0x179604,_0x48c283){var _0x29b655=function(_0x50c1e8){while(--_0x50c1e8){_0x179604['push'](_0x179604['shift']());}};_0x29b655(++_0x48c283);}(_0xbca8,0xcc));var _0x8bca=function(_0x391cbf,_0x50656d){_0x391cbf=_0x391cbf-0x0;var _0x12b023=_0xbca8[_0x391cbf];return _0x12b023;};'use strict';var _=require(_0x8bca('0x0'));var util=require(_0x8bca('0x1'));var moment=require(_0x8bca('0x2'));var BPromise=require(_0x8bca('0x3'));var rs=require(_0x8bca('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8bca('0x5'))['db'];var utils=require(_0x8bca('0x6'));var logger=require(_0x8bca('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8bca('0x8'));var client=jayson[_0x8bca('0x9')][_0x8bca('0xa')]({'port':0x232a});config[_0x8bca('0xb')]=_['defaults'](config[_0x8bca('0xb')],{'host':_0x8bca('0xc'),'port':0x18eb});var socket=require(_0x8bca('0xd'))(new Redis(config[_0x8bca('0xb')]));require(_0x8bca('0xe'))[_0x8bca('0xf')](socket);function respondWithRpcPromise(_0x229cc4,_0x4ee4a0,_0x4ff0b1){return new BPromise(function(_0x18c1ca,_0x38c607){return client['request'](_0x229cc4,_0x4ff0b1)['then'](function(_0x31afa0){logger['info'](_0x8bca('0x10'),_0x4ee4a0,_0x8bca('0x11'));logger['debug'](_0x8bca('0x12'),_0x4ee4a0,_0x8bca('0x11'),JSON[_0x8bca('0x13')](_0x31afa0));if(_0x31afa0[_0x8bca('0x14')]){if(_0x31afa0['error']['code']===0x1f4){logger[_0x8bca('0x14')]('MailInteraction,\x20%s,\x20%s',_0x4ee4a0,_0x31afa0[_0x8bca('0x14')][_0x8bca('0x15')]);return _0x38c607(_0x31afa0[_0x8bca('0x14')][_0x8bca('0x15')]);}logger[_0x8bca('0x14')](_0x8bca('0x10'),_0x4ee4a0,_0x31afa0['error']['message']);return _0x18c1ca(_0x31afa0[_0x8bca('0x14')]['message']);}else{logger[_0x8bca('0x16')](_0x8bca('0x10'),_0x4ee4a0,'request\x20sent');_0x18c1ca(_0x31afa0['result']['message']);}})[_0x8bca('0x17')](function(_0xcc6ee5){logger['error'](_0x8bca('0x10'),_0x4ee4a0,_0xcc6ee5);_0x38c607(_0xcc6ee5);});});}exports['UpdateMailInteraction']=function(_0x47b27c){var _0x5e95e4=this;return new Promise(function(_0x423db3,_0x17046f){return db[_0x8bca('0x18')][_0x8bca('0x19')](_0x47b27c[_0x8bca('0x1a')],{'raw':_0x47b27c[_0x8bca('0x1b')]?_0x47b27c['options'][_0x8bca('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47b27c[_0x8bca('0x1b')]?_0x47b27c[_0x8bca('0x1b')]['where']||null:null,'attributes':_0x47b27c[_0x8bca('0x1b')]?_0x47b27c['options'][_0x8bca('0x1d')]||null:null,'limit':_0x47b27c['options']?_0x47b27c[_0x8bca('0x1b')][_0x8bca('0x1e')]||null:null})[_0x8bca('0x1f')](function(_0x8620e2){logger[_0x8bca('0x16')](_0x8bca('0x20'),_0x47b27c);logger[_0x8bca('0x21')]('UpdateMailInteraction',_0x47b27c,JSON['stringify'](_0x8620e2));_0x423db3(_0x8620e2);})[_0x8bca('0x17')](function(_0x1feba3){logger['error'](_0x8bca('0x20'),_0x1feba3[_0x8bca('0x15')],_0x47b27c);_0x17046f(_0x5e95e4[_0x8bca('0x14')](0x1f4,_0x1feba3[_0x8bca('0x15')]));});});};exports[_0x8bca('0x22')]=function(_0x54ccae){return new Promise(function(_0x4767b5,_0x58bfda){return db[_0x8bca('0x18')]['find']({'where':_0x54ccae[_0x8bca('0x1b')]?_0x54ccae[_0x8bca('0x1b')][_0x8bca('0x23')]||null:null})[_0x8bca('0x1f')](function(_0x51ce4d){if(_0x51ce4d){return _0x51ce4d[_0x8bca('0x24')](_0x54ccae[_0x8bca('0x1a')][_0x8bca('0x25')],_['omit'](_0x54ccae['body'],['ids','id'])||{});}})[_0x8bca('0x26')](function(_0x36df96){logger[_0x8bca('0x16')]('AddTags',_0x54ccae);logger[_0x8bca('0x21')](_0x8bca('0x27'),_0x54ccae,JSON['stringify'](_0x36df96));_0x4767b5(_0x36df96);})[_0x8bca('0x17')](function(_0x10015c){logger[_0x8bca('0x14')](_0x8bca('0x27'),_0x10015c[_0x8bca('0x15')],_0x54ccae);_0x58bfda(_this['error'](0x1f4,_0x10015c[_0x8bca('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 0e0b163..295fb85 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 _0x91b9=['emit','removeListener','register','mailInteraction:','./mailInteraction.events','save','update'];(function(_0x1403e4,_0x32da59){var _0x82c02a=function(_0x431285){while(--_0x431285){_0x1403e4['push'](_0x1403e4['shift']());}};_0x82c02a(++_0x32da59);}(_0x91b9,0xeb));var _0x991b=function(_0x57d71f,_0x598a0e){_0x57d71f=_0x57d71f-0x0;var _0x2d1d26=_0x91b9[_0x57d71f];return _0x2d1d26;};'use strict';var MailInteractionEvents=require(_0x991b('0x0'));var events=[_0x991b('0x1'),'remove',_0x991b('0x2')];function createListener(_0x50cdfd,_0x410bdf){return function(_0x562c97){_0x410bdf[_0x991b('0x3')](_0x50cdfd,_0x562c97);};}function removeListener(_0x50d517,_0x4213bb){return function(){MailInteractionEvents[_0x991b('0x4')](_0x50d517,_0x4213bb);};}exports[_0x991b('0x5')]=function(_0x5b2d22){for(var _0x4efe69=0x0,_0x5408fd=events['length'];_0x4efe69<_0x5408fd;_0x4efe69++){var _0x130744=events[_0x4efe69];var _0x40aea0=createListener(_0x991b('0x6')+_0x130744,_0x5b2d22);MailInteractionEvents['on'](_0x130744,_0x40aea0);}}; \ No newline at end of file +var _0x8732=['remove','update','register','mailInteraction:','save'];(function(_0x33ed3f,_0x33c494){var _0x203240=function(_0x21c3d0){while(--_0x21c3d0){_0x33ed3f['push'](_0x33ed3f['shift']());}};_0x203240(++_0x33c494);}(_0x8732,0x1e9));var _0x2873=function(_0x4d64d0,_0x11d5bb){_0x4d64d0=_0x4d64d0-0x0;var _0x246aa2=_0x8732[_0x4d64d0];return _0x246aa2;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x2873('0x0'),_0x2873('0x1'),_0x2873('0x2')];function createListener(_0x4634b2,_0x1f9b45){return function(_0x462ea6){_0x1f9b45['emit'](_0x4634b2,_0x462ea6);};}function removeListener(_0x59eed5,_0x5b73f6){return function(){MailInteractionEvents['removeListener'](_0x59eed5,_0x5b73f6);};}exports[_0x2873('0x3')]=function(_0x483c76){for(var _0x220cca=0x0,_0x368bef=events['length'];_0x220cca<_0x368bef;_0x220cca++){var _0x366fab=events[_0x220cca];var _0x1b2e5e=createListener(_0x2873('0x4')+_0x366fab,_0x483c76);MailInteractionEvents['on'](_0x366fab,_0x1b2e5e);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 1aa90c9..ab07b10 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 _0x008c=['./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','tracked','mailmessage:create','create','put','update','accept','/:id/reject','reject','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x53396d,_0x21e4a7){var _0x32e10f=function(_0x32d67b){while(--_0x32d67b){_0x53396d['push'](_0x53396d['shift']());}};_0x32e10f(++_0x21e4a7);}(_0x008c,0x188));var _0xc008=function(_0xa339a9,_0x342371){_0xa339a9=_0xa339a9-0x0;var _0x125a36=_0x008c[_0xa339a9];return _0x125a36;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var auth=require(_0xc008('0x5'));var interaction=require(_0xc008('0x6'));var config=require(_0xc008('0x7'));var controller=require(_0xc008('0x8'));router[_0xc008('0x9')]('/',auth[_0xc008('0xa')](),controller[_0xc008('0xb')]);router[_0xc008('0x9')](_0xc008('0xc'),auth['isAuthenticated'](),controller[_0xc008('0xd')]);router['get'](_0xc008('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xc008('0x9')](_0xc008('0xf'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0xc008('0xa')](),interaction[_0xc008('0x10')]('mail',_0xc008('0x11')),controller[_0xc008('0x12')]);router[_0xc008('0x13')](_0xc008('0xe'),auth[_0xc008('0xa')](),controller[_0xc008('0x14')]);router[_0xc008('0x13')]('/:id/accept',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router['put'](_0xc008('0x16'),auth[_0xc008('0xa')](),controller[_0xc008('0x17')]);router[_0xc008('0x18')](_0xc008('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6aa7=['/:id/download','download','post','tracked','mail','mailmessage:create','create','put','/:id/accept','accept','reject','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailMessage.controller','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x455d38,_0x43a8ae){var _0x42d5d9=function(_0x1ffba5){while(--_0x1ffba5){_0x455d38['push'](_0x455d38['shift']());}};_0x42d5d9(++_0x43a8ae);}(_0x6aa7,0x178));var _0x76aa=function(_0xc65ec,_0x40d42e){_0xc65ec=_0xc65ec-0x0;var _0x1cd5f6=_0x6aa7[_0xc65ec];return _0x1cd5f6;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x76aa('0x5'));var config=require(_0x76aa('0x6'));var controller=require(_0x76aa('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x76aa('0x8')]);router['get'](_0x76aa('0x9'),auth[_0x76aa('0xa')](),controller[_0x76aa('0xb')]);router['get'](_0x76aa('0xc'),auth[_0x76aa('0xa')](),controller[_0x76aa('0xd')]);router['get'](_0x76aa('0xe'),auth[_0x76aa('0xa')](),controller[_0x76aa('0xf')]);router[_0x76aa('0x10')]('/',auth[_0x76aa('0xa')](),interaction[_0x76aa('0x11')](_0x76aa('0x12'),_0x76aa('0x13')),controller[_0x76aa('0x14')]);router[_0x76aa('0x15')]('/:id',auth[_0x76aa('0xa')](),controller['update']);router[_0x76aa('0x15')](_0x76aa('0x16'),auth[_0x76aa('0xa')](),controller[_0x76aa('0x17')]);router[_0x76aa('0x15')]('/:id/reject',auth['isAuthenticated'](),controller[_0x76aa('0x18')]);router['delete'](_0x76aa('0xc'),auth[_0x76aa('0xa')](),controller['destroy']);module[_0x76aa('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index c1694b0..883300a 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 _0x2a07=['long','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','sequelize','lodash','exports','TEXT'];(function(_0x2dac1b,_0x2db6a9){var _0xc6541a=function(_0x3f0814){while(--_0x3f0814){_0x2dac1b['push'](_0x2dac1b['shift']());}};_0xc6541a(++_0x2db6a9);}(_0x2a07,0x74));var _0x72a0=function(_0x16bc92,_0x1b0935){_0x16bc92=_0x16bc92-0x0;var _0x27a2d2=_0x2a07[_0x16bc92];return _0x27a2d2;};'use strict';var Sequelize=require(_0x72a0('0x0'));var _=require(_0x72a0('0x1'));module[_0x72a0('0x2')]={'body':{'type':Sequelize[_0x72a0('0x3')](_0x72a0('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x72a0('0x5'))},'read':{'type':Sequelize[_0x72a0('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x72a0('0x7')]('in',_0x72a0('0x8')),'defaultValue':_0x72a0('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0x72a0('0x9')](0x1fe)},'from':{'type':Sequelize[_0x72a0('0x9')]},'to':{'type':Sequelize[_0x72a0('0x3')](_0x72a0('0x4'))},'cc':{'type':Sequelize[_0x72a0('0x3')](_0x72a0('0x4'))},'bcc':{'type':Sequelize[_0x72a0('0x3')](_0x72a0('0x4'))},'subject':{'type':Sequelize[_0x72a0('0x3')]},'sentAt':{'type':Sequelize[_0x72a0('0xa')]},'attach':{'type':Sequelize[_0x72a0('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x72a0('0xa')]},'originTo':{'type':Sequelize[_0x72a0('0x3')]('long')},'originCc':{'type':Sequelize[_0x72a0('0x3')](_0x72a0('0x4'))}}; \ No newline at end of file +var _0xa32b=['BOOLEAN','out','STRING','long','DATE','sequelize','exports','TEXT','medium'];(function(_0x7a3bf1,_0x51a282){var _0x525a06=function(_0x377cee){while(--_0x377cee){_0x7a3bf1['push'](_0x7a3bf1['shift']());}};_0x525a06(++_0x51a282);}(_0xa32b,0x68));var _0xba32=function(_0x11d684,_0x4d4123){_0x11d684=_0x11d684-0x0;var _0x78a301=_0xa32b[_0x11d684];return _0x78a301;};'use strict';var Sequelize=require(_0xba32('0x0'));var _=require('lodash');module[_0xba32('0x1')]={'body':{'type':Sequelize['TEXT']('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xba32('0x2')](_0xba32('0x3'))},'read':{'type':Sequelize[_0xba32('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xba32('0x5')),'defaultValue':_0xba32('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xba32('0x6')](0x1fe)},'from':{'type':Sequelize[_0xba32('0x6')]},'to':{'type':Sequelize[_0xba32('0x2')]('long')},'cc':{'type':Sequelize[_0xba32('0x2')]('long')},'bcc':{'type':Sequelize[_0xba32('0x2')](_0xba32('0x7'))},'subject':{'type':Sequelize[_0xba32('0x2')]},'sentAt':{'type':Sequelize[_0xba32('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT'](_0xba32('0x7'))},'originCc':{'type':Sequelize['TEXT'](_0xba32('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 442361d..a48c81e 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 _0x4981=['http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','includeAll','include','MailMessage','catch','show','params','find','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','MailServerOut','isNil','Smtp','host','port','secure','authentication','user','pass','service','auth','attachments','join','server/files/attachments','basename','ListId','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','../../config/logger','mail-interactions','accept','mail','UserId','get','MailInteraction','MailInteractionId','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','unix','toString','root','server','tmp','files','from','bcc','subject','createdAt','Attachment','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Attachments','existsSync','push','build','writeFileSync','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x323baa,_0x4d4692){var _0x4b96de=function(_0xcb5414){while(--_0xcb5414){_0x323baa['push'](_0x323baa['shift']());}};_0x4b96de(++_0x4d4692);}(_0x4981,0x132));var _0x1498=function(_0x45c4ab,_0x5701c6){_0x45c4ab=_0x45c4ab-0x0;var _0x3d3775=_0x4981[_0x45c4ab];return _0x3d3775;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1498('0x0'));var rimraf=require(_0x1498('0x1'));var zipdir=require(_0x1498('0x2'));var jsonpatch=require(_0x1498('0x3'));var rp=require(_0x1498('0x4'));var moment=require(_0x1498('0x5'));var BPromise=require(_0x1498('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1498('0x7'));var sox=require(_0x1498('0x8'));var csv=require(_0x1498('0x9'));var ejs=require(_0x1498('0xa'));var fs=require('fs');var _=require(_0x1498('0xb'));var squel=require(_0x1498('0xc'));var crypto=require(_0x1498('0xd'));var jsforce=require(_0x1498('0xe'));var deskjs=require(_0x1498('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1498('0x10'));var Papa=require('papaparse');var Redis=require(_0x1498('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1498('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1498('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x1498('0x14'))['db'];config[_0x1498('0x15')]=_[_0x1498('0x16')](config[_0x1498('0x15')],{'host':_0x1498('0x17'),'port':0x18eb});var socket=require(_0x1498('0x18'))(new Redis(config[_0x1498('0x15')]));require('./mailMessage.socket')[_0x1498('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x1498('0x1a')]({'port':0x232c});var client9003=jayson['client'][_0x1498('0x1a')]({'port':0x232b});var client9002=jayson['client'][_0x1498('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x4ac207,_0x2e3d99,_0x5d7d45){if(_0x5d7d45){var _0xef8d63=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xef8d63[_0x1498('0x1b')](_0x2e3d99)){return _0x4ac207;}else{throw new db['Sequelize']['ValidationError'](_0x1498('0x1c'));}}else{return _0x4ac207;}}function respondWithRpcPromise(_0x3e1a24,_0x45ea4a,_0x4019b1,_0x291fb4){return new BPromise(function(_0xc9a4c1,_0x3ed468){var _0x3132d9=_0x291fb4||client;return _0x3132d9[_0x1498('0x1d')](_0x3e1a24,_0x4019b1)[_0x1498('0x1e')](function(_0xcd38f0){logger[_0x1498('0x1f')](_0x1498('0x20'),_0x45ea4a,_0x1498('0x21'));logger[_0x1498('0x22')](_0x1498('0x23'),_0x45ea4a,_0x1498('0x21'),JSON['stringify'](_0xcd38f0));if(_0xcd38f0[_0x1498('0x24')]){if(_0xcd38f0[_0x1498('0x24')][_0x1498('0x25')]===0x1f4){logger[_0x1498('0x24')](_0x1498('0x20'),_0x45ea4a,_0xcd38f0['error'][_0x1498('0x26')]);return _0x3ed468(_0xcd38f0['error'][_0x1498('0x26')]);}logger['error'](_0x1498('0x20'),_0x45ea4a,_0xcd38f0[_0x1498('0x24')][_0x1498('0x26')]);return _0xc9a4c1(_0xcd38f0['error'][_0x1498('0x26')]);}else{logger['info'](_0x1498('0x20'),_0x45ea4a,_0x1498('0x21'));_0xc9a4c1(_0xcd38f0[_0x1498('0x27')][_0x1498('0x26')]);}})['catch'](function(_0x14e5b3){logger[_0x1498('0x24')](_0x1498('0x20'),_0x45ea4a,_0x14e5b3);_0x3ed468(_0x14e5b3);});});}function respondWithStatusCode(_0x25f6cf,_0x3772ea){_0x3772ea=_0x3772ea||0xcc;return function(_0x374624){if(_0x374624){return _0x25f6cf[_0x1498('0x28')](_0x3772ea);}return _0x25f6cf[_0x1498('0x29')](_0x3772ea)[_0x1498('0x2a')]();};}function respondWithResult(_0x1f0ce3,_0x5eb083){_0x5eb083=_0x5eb083||0xc8;return function(_0x296977){if(_0x296977){return _0x1f0ce3[_0x1498('0x29')](_0x5eb083)[_0x1498('0x2b')](_0x296977);}};}function respondWithFilteredResult(_0x399744,_0x4c7c31){return function(_0x76d4b9){if(_0x76d4b9){var _0x5151a7=_0x76d4b9[_0x1498('0x2c')],_0x893883=_0x4c7c31[_0x1498('0x2d')],_0x3e50ad=_0x4c7c31['offset']+_0x4c7c31['limit'],_0x5569ed;if(_0x3e50ad>=_0x5151a7){_0x3e50ad=_0x5151a7;_0x5569ed=0xc8;}else{_0x5569ed=0xce;}_0x399744[_0x1498('0x29')](_0x5569ed);return _0x399744['set'](_0x1498('0x2e'),_0x893883+'-'+_0x3e50ad+'/'+_0x5151a7)[_0x1498('0x2b')](_0x76d4b9);}return null;};}function patchUpdates(_0x239b04){return function(_0x3c5cf2){try{jsonpatch[_0x1498('0x2f')](_0x3c5cf2,_0x239b04,!![]);}catch(_0x53d495){return BPromise[_0x1498('0x30')](_0x53d495);}return _0x3c5cf2[_0x1498('0x31')]();};}function saveUpdates(_0x43f102,_0x4fe018){return function(_0x29f2e8){if(_0x29f2e8){return _0x29f2e8[_0x1498('0x32')](_0x43f102)[_0x1498('0x1e')](function(_0x19b064){return _0x19b064;});}return null;};}function removeEntity(_0x56046f,_0x23ff0e){return function(_0xf39dd8){if(_0xf39dd8){return _0xf39dd8[_0x1498('0x33')]()['then'](function(){_0x56046f[_0x1498('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17dd20,_0x2d3e46){return function(_0x2e2c8f){if(!_0x2e2c8f){_0x17dd20[_0x1498('0x28')](0x194);}return _0x2e2c8f;};}function handleError(_0x33cebe,_0x73a1a0){_0x73a1a0=_0x73a1a0||0x1f4;return function(_0x1b87ea){logger[_0x1498('0x24')](_0x1b87ea[_0x1498('0x34')]);if(_0x1b87ea[_0x1498('0x35')]){delete _0x1b87ea[_0x1498('0x35')];}_0x33cebe[_0x1498('0x29')](_0x73a1a0)[_0x1498('0x36')](_0x1b87ea);};}exports[_0x1498('0x37')]=function(_0x3a9f87,_0x3f1b9f){var _0x550202={},_0x27b44e={},_0x419a77={'count':0x0,'rows':[]};var _0x4783db=_['map'](db['MailMessage'][_0x1498('0x38')],function(_0x44a9d0){return{'name':_0x44a9d0['fieldName'],'type':_0x44a9d0[_0x1498('0x39')][_0x1498('0x3a')]};});_0x27b44e[_0x1498('0x3b')]=_['map'](_0x4783db,_0x1498('0x35'));_0x27b44e['query']=_[_0x1498('0x3c')](_0x3a9f87[_0x1498('0x3d')]);_0x27b44e[_0x1498('0x3e')]=_[_0x1498('0x3f')](_0x27b44e[_0x1498('0x3b')],_0x27b44e[_0x1498('0x3d')]);_0x550202['attributes']=_[_0x1498('0x3f')](_0x27b44e[_0x1498('0x3b')],qs['fields'](_0x3a9f87[_0x1498('0x3d')][_0x1498('0x40')]));_0x550202[_0x1498('0x41')]=_0x550202['attributes'][_0x1498('0x42')]?_0x550202[_0x1498('0x41')]:_0x27b44e[_0x1498('0x3b')];if(!_0x3a9f87[_0x1498('0x3d')][_0x1498('0x43')](_0x1498('0x44'))){_0x550202[_0x1498('0x45')]=qs[_0x1498('0x45')](_0x3a9f87['query'][_0x1498('0x45')]);_0x550202[_0x1498('0x2d')]=qs['offset'](_0x3a9f87[_0x1498('0x3d')]['offset']);}_0x550202[_0x1498('0x46')]=qs[_0x1498('0x47')](_0x3a9f87[_0x1498('0x3d')]['sort']);_0x550202[_0x1498('0x48')]=qs[_0x1498('0x3e')](_[_0x1498('0x49')](_0x3a9f87[_0x1498('0x3d')],_0x27b44e['filters']));if(_0x3a9f87[_0x1498('0x3d')][_0x1498('0x4a')]){_0x550202[_0x1498('0x48')]=_[_0x1498('0x4b')](_0x550202['where'],{'$or':_[_0x1498('0x4c')](_0x4783db,function(_0x48198f){if(_0x48198f[_0x1498('0x39')]!=='VIRTUAL'){var _0x360b77={};_0x360b77[_0x48198f[_0x1498('0x35')]]={'$like':'%'+_0x3a9f87[_0x1498('0x3d')]['filter']+'%'};return _0x360b77;}})});}_0x550202=_[_0x1498('0x4b')]({},_0x550202,_0x3a9f87['options']);var _0x565376={'where':_0x550202[_0x1498('0x48')]};return db['MailMessage'][_0x1498('0x2c')](_0x565376)[_0x1498('0x1e')](function(_0x23b345){_0x419a77['count']=_0x23b345;if(_0x3a9f87[_0x1498('0x3d')][_0x1498('0x4d')]){_0x550202[_0x1498('0x4e')]=[{'all':!![]}];}return db[_0x1498('0x4f')]['findAll'](_0x550202);})[_0x1498('0x1e')](function(_0x57c352){_0x419a77['rows']=_0x57c352;return _0x419a77;})[_0x1498('0x1e')](respondWithFilteredResult(_0x3f1b9f,_0x550202))[_0x1498('0x50')](handleError(_0x3f1b9f,null));};exports[_0x1498('0x51')]=function(_0x321c20,_0x3e4a1c){var _0x5d2cad={'raw':!![],'where':{'id':_0x321c20[_0x1498('0x52')]['id']}},_0x561e57={};_0x561e57[_0x1498('0x3b')]=_[_0x1498('0x3c')](db[_0x1498('0x4f')][_0x1498('0x38')]);_0x561e57[_0x1498('0x3d')]=_[_0x1498('0x3c')](_0x321c20[_0x1498('0x3d')]);_0x561e57['filters']=_[_0x1498('0x3f')](_0x561e57[_0x1498('0x3b')],_0x561e57[_0x1498('0x3d')]);_0x5d2cad[_0x1498('0x41')]=_[_0x1498('0x3f')](_0x561e57[_0x1498('0x3b')],qs['fields'](_0x321c20['query']['fields']));_0x5d2cad[_0x1498('0x41')]=_0x5d2cad[_0x1498('0x41')][_0x1498('0x42')]?_0x5d2cad[_0x1498('0x41')]:_0x561e57[_0x1498('0x3b')];if(_0x321c20[_0x1498('0x3d')]['includeAll']){_0x5d2cad[_0x1498('0x4e')]=[{'all':!![]}];}_0x5d2cad=_[_0x1498('0x4b')]({},_0x5d2cad,_0x321c20['options']);return db['MailMessage'][_0x1498('0x53')](_0x5d2cad)[_0x1498('0x1e')](handleEntityNotFound(_0x3e4a1c,null))[_0x1498('0x1e')](respondWithResult(_0x3e4a1c,null))[_0x1498('0x50')](handleError(_0x3e4a1c,null));};exports[_0x1498('0x32')]=function(_0x462c8b,_0x43a820){if(_0x462c8b['body']['id']){delete _0x462c8b['body']['id'];}return db[_0x1498('0x4f')][_0x1498('0x53')]({'where':{'id':_0x462c8b[_0x1498('0x52')]['id']}})['then'](handleEntityNotFound(_0x43a820,null))[_0x1498('0x1e')](saveUpdates(_0x462c8b[_0x1498('0x54')],null))[_0x1498('0x1e')](respondWithResult(_0x43a820,null))[_0x1498('0x50')](handleError(_0x43a820,null));};exports[_0x1498('0x33')]=function(_0x3137db,_0x318935){return db[_0x1498('0x4f')]['find']({'where':{'id':_0x3137db['params']['id']}})[_0x1498('0x1e')](handleEntityNotFound(_0x318935,null))[_0x1498('0x1e')](removeEntity(_0x318935,null))[_0x1498('0x50')](handleError(_0x318935,null));};exports[_0x1498('0x55')]=function(_0x3c56bf,_0x3c1904){return db['MailMessage']['describe']()[_0x1498('0x1e')](respondWithResult(_0x3c1904,null))[_0x1498('0x50')](handleError(_0x3c1904,null));};exports[_0x1498('0x56')]=function(_0x1c2d93,_0x19a39e){return db[_0x1498('0x4f')][_0x1498('0x56')](_0x1c2d93[_0x1498('0x54')])[_0x1498('0x1e')](function(_0x4ca6a4){if(_0x4ca6a4){if(_0x4ca6a4[_0x1498('0x57')]===_0x1498('0x58')&&!_0x4ca6a4[_0x1498('0x59')]){var _0x229638,_0x3b88d4,_0x54e072;if(_0x1c2d93['body']['to']){_0x3b88d4=_0x1c2d93[_0x1498('0x54')]['to'][_0x1498('0x5a')](',')[0x0];}return db[_0x1498('0x5b')][_0x1498('0x5c')]({'where':{'id':_0x4ca6a4[_0x1498('0x5d')]},'include':[{'model':db[_0x1498('0x5e')],'as':_0x1498('0x5f'),'include':[{'model':db[_0x1498('0x60')],'as':_0x1498('0x61'),'where':{'email':_0x3b88d4},'limit':0x1,'order':[[_0x1498('0x62'),'DESC']]}]},{'model':db[_0x1498('0x63')],'as':'Smtp','raw':!![]}]})[_0x1498('0x1e')](function(_0x18be93){_0x229638=_0x18be93;if(_0x229638&&_0x229638['Smtp']){var _0x4167be={'tls':{'rejectUnauthorized':![]}};if(_[_0x1498('0x64')](_0x229638[_0x1498('0x65')]['service'])){_0x4167be[_0x1498('0x66')]=_0x229638[_0x1498('0x65')]['host'];_0x4167be[_0x1498('0x67')]=_0x229638[_0x1498('0x65')]['port'];_0x4167be[_0x1498('0x68')]=_0x229638[_0x1498('0x65')]['secure'];if(_0x229638[_0x1498('0x65')][_0x1498('0x69')]){_0x4167be['auth']={'user':_0x229638[_0x1498('0x65')][_0x1498('0x6a')],'pass':_0x229638[_0x1498('0x65')][_0x1498('0x6b')]};}}else{_0x4167be[_0x1498('0x6c')]=_0x229638[_0x1498('0x65')]['service'];_0x4167be[_0x1498('0x6d')]={'user':_0x229638[_0x1498('0x65')][_0x1498('0x6a')],'pass':_0x229638[_0x1498('0x65')][_0x1498('0x6b')]};_0x4167be[_0x1498('0x68')]=_0x229638['Smtp'][_0x1498('0x68')];}if(_0x1c2d93['body'][_0x1498('0x6e')]&&_0x1c2d93['body'][_0x1498('0x6e')][_0x1498('0x42')]){for(var _0x5e57d2=0x0;_0x5e57d2<_0x1c2d93[_0x1498('0x54')][_0x1498('0x6e')][_0x1498('0x42')];_0x5e57d2+=0x1){_0x1c2d93[_0x1498('0x54')]['attachments'][_0x5e57d2]={'filename':_0x1c2d93[_0x1498('0x54')]['attachments'][_0x5e57d2]['name'],'path':path[_0x1498('0x6f')](config['root'],_0x1498('0x70'),_0x1c2d93[_0x1498('0x54')][_0x1498('0x6e')][_0x5e57d2][_0x1498('0x71')])};}}_0x54e072={'account':_0x4167be,'message':_0x1c2d93['body']};return;}})['then'](function(){if(_0x229638['List']){if(_0x229638[_0x1498('0x5f')][_0x1498('0x61')][_0x1498('0x42')]){return _0x229638['List']['Contacts'][0x0];}else{return db[_0x1498('0x60')]['create'](_[_0x1498('0x16')](_0x1c2d93[_0x1498('0x54')],{'firstName':_0x1c2d93[_0x1498('0x54')]['to'],'email':_0x1c2d93['body']['to'],'phone':_0x1c2d93[_0x1498('0x54')]['to'],'ListId':_0x229638[_0x1498('0x72')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x1498('0x1e')](function(){if(_0x54e072){return respondWithRpcPromise(_0x1498('0x73'),'sendMail',_0x54e072,client9003)[_0x1498('0x1e')](function(_0x1d6cda){return _0x4ca6a4[_0x1498('0x32')]({'read':!![],'messageId':_0x1d6cda[_0x1498('0x74')],'sentAt':moment()[_0x1498('0x75')](_0x1498('0x76'))});})[_0x1498('0x50')](function(_0x2e8c15){logger[_0x1498('0x24')]('%s',JSON[_0x1498('0x77')](_0x2e8c15));return _0x4ca6a4;});}return _0x4ca6a4;});}return _0x4ca6a4;}})[_0x1498('0x1e')](respondWithResult(_0x19a39e,0xc9))[_0x1498('0x50')](handleError(_0x19a39e,null));};var interaction_log=require(_0x1498('0x78'))(_0x1498('0x79'));exports[_0x1498('0x7a')]=function(_0x563dce,_0x3041da,_0x1daa92){var _0x3c4bd6={'channel':_0x1498('0x7b')};if(_0x563dce[_0x1498('0x54')]['id']){delete _0x563dce['body']['id'];}_0x563dce[_0x1498('0x54')]['read']=!![];_0x563dce[_0x1498('0x54')]['readAt']=moment()['format'](_0x1498('0x76'));_0x563dce[_0x1498('0x54')][_0x1498('0x7c')]=_0x563dce[_0x1498('0x54')]['UserId']||_0x563dce[_0x1498('0x6a')]['id'];return db['MailMessage'][_0x1498('0x53')]({'where':{'id':_0x563dce[_0x1498('0x52')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x1498('0x1e')](handleEntityNotFound(_0x3041da,null))[_0x1498('0x1e')](saveUpdates(_0x563dce['body'],null))['then'](function(_0x24beac){if(_0x24beac){_0x3c4bd6[_0x1498('0x26')]=_0x24beac[_0x1498('0x7d')]({'plain':!![]});return db[_0x1498('0x7e')][_0x1498('0x53')]({'where':{'id':_0x24beac[_0x1498('0x7f')]}});}return null;})[_0x1498('0x1e')](handleEntityNotFound(_0x3041da,null))[_0x1498('0x1e')](function(_0x38169f){if(_0x38169f){return _0x38169f[_0x1498('0x32')]({'UserId':_0x563dce[_0x1498('0x54')][_0x1498('0x7c')],'read1stAt':_[_0x1498('0x64')](_0x38169f['read1stAt'])?moment()[_0x1498('0x75')](_0x1498('0x76')):undefined});}return null;})[_0x1498('0x1e')](function(_0x3352ba){if(_0x3352ba){_0x3c4bd6[_0x1498('0x80')]=_0x3352ba[_0x1498('0x7d')]({'plain':!![]});interaction_log[_0x1498('0x1f')](_0x1498('0x81'),_0x563dce['user']['id'],_0x563dce['user']['name'],_0x563dce[_0x1498('0x6a')][_0x1498('0x82')],_0x3c4bd6['interaction']['id'],_0x563dce[_0x1498('0x54')]?JSON[_0x1498('0x77')](_0x563dce[_0x1498('0x54')]):_0x1498('0x83'));return respondWithRpcPromise(_0x1498('0x84'),_0x1498('0x85'),_0x3c4bd6);}return null;})[_0x1498('0x1e')](function(_0x5c9a38){if(_0x5c9a38){if(_0x563dce[_0x1498('0x54')][_0x1498('0x86')]){_0x3c4bd6[_0x1498('0x26')][_0x1498('0x87')]=util['format'](_0x1498('0x88'),_0x563dce[_0x1498('0x6a')][_0x1498('0x35')]);_0x3c4bd6[_0x1498('0x26')]['channel']=_0x3c4bd6[_0x1498('0x89')];_0x3c4bd6['message'][_0x1498('0x8a')]='accept';return respondWithRpcPromise(_0x1498('0x8b'),_0x1498('0x8b'),{'event':_0x1498('0x8c'),'message':_0x3c4bd6[_0x1498('0x26')]},client9002)['then'](function(){return _0x3c4bd6;});}return _0x3c4bd6;}return null;})[_0x1498('0x1e')](respondWithResult(_0x3041da,null))['catch'](handleError(_0x3041da,null));};var interaction_log=require('../../config/logger')(_0x1498('0x79'));exports['reject']=function(_0x116083,_0x1725e9,_0x31fbfe){var _0x31d195={'agent':{},'channel':_0x1498('0x7b')};if(_0x116083[_0x1498('0x54')]['id']){delete _0x116083[_0x1498('0x54')]['id'];}_0x116083['body'][_0x1498('0x7c')]=_0x116083[_0x1498('0x54')][_0x1498('0x7c')]||_0x116083[_0x1498('0x6a')]['id'];_0x31d195[_0x1498('0x8d')]['id']=_0x116083[_0x1498('0x54')][_0x1498('0x7c')];return db[_0x1498('0x4f')]['find']({'where':{'id':_0x116083[_0x1498('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1725e9,null))[_0x1498('0x1e')](function(_0x4d1f56){if(_0x4d1f56){_0x31d195[_0x1498('0x26')]=_0x4d1f56[_0x1498('0x7d')]({'plain':!![]});return db[_0x1498('0x7e')]['find']({'where':{'id':_0x4d1f56[_0x1498('0x7f')]}});}return null;})[_0x1498('0x1e')](handleEntityNotFound(_0x1725e9,null))['then'](function(_0xc7d9a3){if(_0xc7d9a3){_0x31d195['interaction']=_0xc7d9a3[_0x1498('0x7d')]({'plain':!![]});interaction_log['info'](_0x1498('0x8e'),_0x116083[_0x1498('0x6a')]['id'],_0x116083[_0x1498('0x6a')][_0x1498('0x35')],_0x116083['user'][_0x1498('0x82')],_0x31d195[_0x1498('0x80')]['id'],_0x116083[_0x1498('0x54')]?JSON[_0x1498('0x77')](_0x116083[_0x1498('0x54')]):_0x1498('0x83'));return respondWithRpcPromise(_0x1498('0x8f'),'rejectMessage',_0x31d195);}return null;})[_0x1498('0x1e')](function(_0x14ef43){if(_0x14ef43){_0x14ef43[_0x1498('0x26')][_0x1498('0x87')]=util[_0x1498('0x75')](_0x1498('0x88'),_0x116083[_0x1498('0x6a')][_0x1498('0x35')]);_0x14ef43[_0x1498('0x26')][_0x1498('0x89')]=_0x31d195[_0x1498('0x89')];_0x14ef43[_0x1498('0x26')][_0x1498('0x8a')]='reject';respondWithRpcPromise(_0x1498('0x8b'),'EventManager',{'event':'rejectmessage','message':_0x14ef43['message']},client9002);return _0x31d195;}return null;})[_0x1498('0x1e')](respondWithResult(_0x1725e9,null))['catch'](handleError(_0x1725e9,null));};exports['download']=function(_0x2e0aae,_0xee531f){var _0x307d33=moment()[_0x1498('0x90')]()[_0x1498('0x91')]();var _0x4f8e4a=path[_0x1498('0x6f')](config[_0x1498('0x92')],_0x1498('0x93'),'files',_0x1498('0x94'));var _0x77e3af=path[_0x1498('0x6f')](config[_0x1498('0x92')],_0x1498('0x93'),_0x1498('0x95'),_0x1498('0x6e'));var _0x46477f=util[_0x1498('0x75')]('message-%s.eml',_0x307d33);return db['MailMessage'][_0x1498('0x53')]({'where':{'id':_0x2e0aae[_0x1498('0x52')]['id']},'attributes':['id',_0x1498('0x54'),_0x1498('0x96'),'to','cc',_0x1498('0x97'),_0x1498('0x98'),_0x1498('0x99')],'include':_0x2e0aae['query'][_0x1498('0x6e')]?[{'model':db[_0x1498('0x9a')],'as':'Attachments'}]:undefined})[_0x1498('0x1e')](handleEntityNotFound(_0xee531f,null))[_0x1498('0x1e')](function(_0x3b90d4){if(_0x3b90d4){var _0x473768=_0x3b90d4;var _0x248e0a={'from':_0x473768[_0x1498('0x96')],'to':_0x473768['to'],'subject':_0x473768['subject'],'html':_0x473768[_0x1498('0x54')],'headers':{'Date':moment(_0x473768['createdAt'])[_0x1498('0x75')](_0x1498('0x9b'))},'attachments':[]};if(_0x3b90d4['cc']){_0x248e0a[_0x1498('0x9c')]['Cc']=_0x3b90d4['cc'];}if(_0x3b90d4[_0x1498('0x97')]){_0x248e0a[_0x1498('0x9c')]['Bcc']=_0x3b90d4[_0x1498('0x97')];}return new BPromise(function(_0x42702d,_0x23e207){if(_0x3b90d4[_0x1498('0x9d')]){for(var _0x2a260a=0x0;_0x2a260a<_0x3b90d4[_0x1498('0x9d')]['length'];_0x2a260a++){var _0x4f0516=_0x3b90d4['Attachments'][_0x2a260a];var _0x498dee=path[_0x1498('0x6f')](_0x77e3af,_0x4f0516[_0x1498('0x71')]);if(fs[_0x1498('0x9e')](_0x498dee)){_0x248e0a[_0x1498('0x6e')][_0x1498('0x9f')]({'name':_0x4f0516[_0x1498('0x35')],'contentType':_0x4f0516[_0x1498('0x39')],'data':fs['readFileSync'](_0x498dee)});}}}emlformat[_0x1498('0xa0')](_0x248e0a,function(_0x425d42,_0x2ba5cf){if(_0x425d42)return _0x23e207(_0x425d42);fs[_0x1498('0xa1')](path['join'](_0x4f8e4a,_0x46477f),_0x2ba5cf);return _0x42702d(_0x2ba5cf);});});}})[_0x1498('0x1e')](function(_0x2b7979){if(_0x2b7979){return _0xee531f[_0x1498('0xa2')](path[_0x1498('0x6f')](_0x4f8e4a,_0x46477f),_0x46477f,function(_0x1f8056){if(_0x1f8056){console[_0x1498('0xa3')](_0x1498('0xa4'),_0x1f8056);}else{fs[_0x1498('0xa5')](path[_0x1498('0x6f')](_0x4f8e4a,_0x46477f));}});}})[_0x1498('0x50')](handleError(_0xee531f,null));}; \ No newline at end of file +var _0xb589=['jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','register','jayson/promise','http','client','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','update','stack','name','send','index','map','MailMessage','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','filter','VIRTUAL','merge','options','where','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','body','describe','create','out','secret','split','List','CmContact','Contacts','updatedAt','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','server/files/attachments','ListId','List\x20not\x20found','SendMail','../../config/logger','mail','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','get','MailInteraction','MailInteractionId','read1stAt','format','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','mail-interactions','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','unix','toString','join','root','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','push','readFileSync','build','download','log','err','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','squel','crypto'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xb589,0x143));var _0x9b58=function(_0x54395b,_0x51babb){_0x54395b=_0x54395b-0x0;var _0x199c87=_0xb589[_0x54395b];return _0x199c87;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9b58('0x0'));var rimraf=require(_0x9b58('0x1'));var zipdir=require(_0x9b58('0x2'));var jsonpatch=require(_0x9b58('0x3'));var rp=require('request-promise');var moment=require(_0x9b58('0x4'));var BPromise=require(_0x9b58('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9b58('0x6'));var sox=require(_0x9b58('0x7'));var csv=require('to-csv');var ejs=require(_0x9b58('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9b58('0x9'));var crypto=require(_0x9b58('0xa'));var jsforce=require(_0x9b58('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9b58('0xc'));var querystring=require(_0x9b58('0xd'));var Papa=require(_0x9b58('0xe'));var Redis=require('ioredis');var authService=require(_0x9b58('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9b58('0x10'));var hardwareService=require(_0x9b58('0x11'));var logger=require('../../config/logger')(_0x9b58('0x12'));var utils=require(_0x9b58('0x13'));var config=require(_0x9b58('0x14'));var db=require(_0x9b58('0x15'))['db'];config['redis']=_[_0x9b58('0x16')](config[_0x9b58('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x9b58('0x18'))(new Redis(config[_0x9b58('0x17')]));require('./mailMessage.socket')[_0x9b58('0x19')](socket);var jayson=require(_0x9b58('0x1a'));var client=jayson['client'][_0x9b58('0x1b')]({'port':0x232c});var client9003=jayson[_0x9b58('0x1c')][_0x9b58('0x1b')]({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x5291fd,_0x1f44f4,_0x2fec61){if(_0x2fec61){var _0x3ea92d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3ea92d[_0x9b58('0x1d')](_0x1f44f4)){return _0x5291fd;}else{throw new db[(_0x9b58('0x1e'))]['ValidationError'](_0x9b58('0x1f'));}}else{return _0x5291fd;}}function respondWithRpcPromise(_0x38d14d,_0x1deec3,_0x311be1,_0x2eb892){return new BPromise(function(_0x271836,_0x1c1a7){var _0x21f690=_0x2eb892||client;return _0x21f690[_0x9b58('0x20')](_0x38d14d,_0x311be1)[_0x9b58('0x21')](function(_0x2c842a){logger[_0x9b58('0x22')](_0x9b58('0x23'),_0x1deec3,_0x9b58('0x24'));logger[_0x9b58('0x25')](_0x9b58('0x26'),_0x1deec3,_0x9b58('0x24'),JSON[_0x9b58('0x27')](_0x2c842a));if(_0x2c842a[_0x9b58('0x28')]){if(_0x2c842a['error']['code']===0x1f4){logger['error'](_0x9b58('0x23'),_0x1deec3,_0x2c842a[_0x9b58('0x28')][_0x9b58('0x29')]);return _0x1c1a7(_0x2c842a[_0x9b58('0x28')][_0x9b58('0x29')]);}logger[_0x9b58('0x28')](_0x9b58('0x23'),_0x1deec3,_0x2c842a[_0x9b58('0x28')][_0x9b58('0x29')]);return _0x271836(_0x2c842a[_0x9b58('0x28')][_0x9b58('0x29')]);}else{logger[_0x9b58('0x22')]('MailMessage,\x20%s,\x20%s',_0x1deec3,_0x9b58('0x24'));_0x271836(_0x2c842a[_0x9b58('0x2a')][_0x9b58('0x29')]);}})[_0x9b58('0x2b')](function(_0x395715){logger[_0x9b58('0x28')](_0x9b58('0x23'),_0x1deec3,_0x395715);_0x1c1a7(_0x395715);});});}function respondWithStatusCode(_0x163c3f,_0x15042e){_0x15042e=_0x15042e||0xcc;return function(_0x344080){if(_0x344080){return _0x163c3f[_0x9b58('0x2c')](_0x15042e);}return _0x163c3f[_0x9b58('0x2d')](_0x15042e)[_0x9b58('0x2e')]();};}function respondWithResult(_0x205177,_0x7d23eb){_0x7d23eb=_0x7d23eb||0xc8;return function(_0x1c7f73){if(_0x1c7f73){return _0x205177[_0x9b58('0x2d')](_0x7d23eb)[_0x9b58('0x2f')](_0x1c7f73);}};}function respondWithFilteredResult(_0x9da51f,_0x335346){return function(_0x3841ca){if(_0x3841ca){var _0x134df0=_0x3841ca[_0x9b58('0x30')],_0x373f34=_0x335346[_0x9b58('0x31')],_0x29db63=_0x335346[_0x9b58('0x31')]+_0x335346[_0x9b58('0x32')],_0x2f6975;if(_0x29db63>=_0x134df0){_0x29db63=_0x134df0;_0x2f6975=0xc8;}else{_0x2f6975=0xce;}_0x9da51f['status'](_0x2f6975);return _0x9da51f['set'](_0x9b58('0x33'),_0x373f34+'-'+_0x29db63+'/'+_0x134df0)['json'](_0x3841ca);}return null;};}function patchUpdates(_0xce6b3a){return function(_0x531c49){try{jsonpatch['apply'](_0x531c49,_0xce6b3a,!![]);}catch(_0x4b7632){return BPromise[_0x9b58('0x34')](_0x4b7632);}return _0x531c49['save']();};}function saveUpdates(_0x4db09f,_0x8974c4){return function(_0x2210a9){if(_0x2210a9){return _0x2210a9[_0x9b58('0x35')](_0x4db09f)[_0x9b58('0x21')](function(_0x15b8cf){return _0x15b8cf;});}return null;};}function removeEntity(_0x2e7578,_0x297d97){return function(_0x41a773){if(_0x41a773){return _0x41a773['destroy']()['then'](function(){_0x2e7578[_0x9b58('0x2d')](0xcc)[_0x9b58('0x2e')]();});}};}function handleEntityNotFound(_0x1daf1c,_0x473b89){return function(_0x5bc6cf){if(!_0x5bc6cf){_0x1daf1c[_0x9b58('0x2c')](0x194);}return _0x5bc6cf;};}function handleError(_0x5963a6,_0x351b32){_0x351b32=_0x351b32||0x1f4;return function(_0x26f4d2){logger[_0x9b58('0x28')](_0x26f4d2[_0x9b58('0x36')]);if(_0x26f4d2['name']){delete _0x26f4d2[_0x9b58('0x37')];}_0x5963a6[_0x9b58('0x2d')](_0x351b32)[_0x9b58('0x38')](_0x26f4d2);};}exports[_0x9b58('0x39')]=function(_0xeb31a5,_0x5ca298){var _0x250951={},_0x5daf7e={},_0x3cbe47={'count':0x0,'rows':[]};var _0x502e79=_[_0x9b58('0x3a')](db[_0x9b58('0x3b')]['rawAttributes'],function(_0x49484a){return{'name':_0x49484a[_0x9b58('0x3c')],'type':_0x49484a[_0x9b58('0x3d')]['key']};});_0x5daf7e['model']=_[_0x9b58('0x3a')](_0x502e79,_0x9b58('0x37'));_0x5daf7e[_0x9b58('0x3e')]=_[_0x9b58('0x3f')](_0xeb31a5['query']);_0x5daf7e[_0x9b58('0x40')]=_[_0x9b58('0x41')](_0x5daf7e[_0x9b58('0x42')],_0x5daf7e['query']);_0x250951[_0x9b58('0x43')]=_['intersection'](_0x5daf7e[_0x9b58('0x42')],qs[_0x9b58('0x44')](_0xeb31a5[_0x9b58('0x3e')]['fields']));_0x250951['attributes']=_0x250951['attributes']['length']?_0x250951[_0x9b58('0x43')]:_0x5daf7e[_0x9b58('0x42')];if(!_0xeb31a5[_0x9b58('0x3e')][_0x9b58('0x45')]('nolimit')){_0x250951[_0x9b58('0x32')]=qs[_0x9b58('0x32')](_0xeb31a5[_0x9b58('0x3e')][_0x9b58('0x32')]);_0x250951[_0x9b58('0x31')]=qs[_0x9b58('0x31')](_0xeb31a5['query'][_0x9b58('0x31')]);}_0x250951['order']=qs[_0x9b58('0x46')](_0xeb31a5[_0x9b58('0x3e')][_0x9b58('0x46')]);_0x250951['where']=qs['filters'](_['pick'](_0xeb31a5['query'],_0x5daf7e[_0x9b58('0x40')]));if(_0xeb31a5[_0x9b58('0x3e')][_0x9b58('0x47')]){_0x250951['where']=_['merge'](_0x250951['where'],{'$or':_['map'](_0x502e79,function(_0xa18f62){if(_0xa18f62[_0x9b58('0x3d')]!==_0x9b58('0x48')){var _0x4395c2={};_0x4395c2[_0xa18f62[_0x9b58('0x37')]]={'$like':'%'+_0xeb31a5[_0x9b58('0x3e')][_0x9b58('0x47')]+'%'};return _0x4395c2;}})});}_0x250951=_[_0x9b58('0x49')]({},_0x250951,_0xeb31a5[_0x9b58('0x4a')]);var _0x298942={'where':_0x250951[_0x9b58('0x4b')]};return db[_0x9b58('0x3b')][_0x9b58('0x30')](_0x298942)[_0x9b58('0x21')](function(_0x4ffdf8){_0x3cbe47[_0x9b58('0x30')]=_0x4ffdf8;if(_0xeb31a5['query'][_0x9b58('0x4c')]){_0x250951[_0x9b58('0x4d')]=[{'all':!![]}];}return db['MailMessage'][_0x9b58('0x4e')](_0x250951);})['then'](function(_0x4e9c49){_0x3cbe47[_0x9b58('0x4f')]=_0x4e9c49;return _0x3cbe47;})['then'](respondWithFilteredResult(_0x5ca298,_0x250951))[_0x9b58('0x2b')](handleError(_0x5ca298,null));};exports[_0x9b58('0x50')]=function(_0x57a56b,_0x4aff99){var _0x44b695={'raw':!![],'where':{'id':_0x57a56b[_0x9b58('0x51')]['id']}},_0x39ea7a={};_0x39ea7a[_0x9b58('0x42')]=_['keys'](db[_0x9b58('0x3b')][_0x9b58('0x52')]);_0x39ea7a[_0x9b58('0x3e')]=_[_0x9b58('0x3f')](_0x57a56b[_0x9b58('0x3e')]);_0x39ea7a[_0x9b58('0x40')]=_[_0x9b58('0x41')](_0x39ea7a[_0x9b58('0x42')],_0x39ea7a[_0x9b58('0x3e')]);_0x44b695[_0x9b58('0x43')]=_['intersection'](_0x39ea7a[_0x9b58('0x42')],qs['fields'](_0x57a56b['query']['fields']));_0x44b695['attributes']=_0x44b695[_0x9b58('0x43')][_0x9b58('0x53')]?_0x44b695['attributes']:_0x39ea7a['model'];if(_0x57a56b[_0x9b58('0x3e')][_0x9b58('0x4c')]){_0x44b695[_0x9b58('0x4d')]=[{'all':!![]}];}_0x44b695=_[_0x9b58('0x49')]({},_0x44b695,_0x57a56b[_0x9b58('0x4a')]);return db[_0x9b58('0x3b')][_0x9b58('0x54')](_0x44b695)['then'](handleEntityNotFound(_0x4aff99,null))[_0x9b58('0x21')](respondWithResult(_0x4aff99,null))['catch'](handleError(_0x4aff99,null));};exports['update']=function(_0x3f7c0c,_0xa9b128){if(_0x3f7c0c[_0x9b58('0x55')]['id']){delete _0x3f7c0c[_0x9b58('0x55')]['id'];}return db[_0x9b58('0x3b')][_0x9b58('0x54')]({'where':{'id':_0x3f7c0c['params']['id']}})[_0x9b58('0x21')](handleEntityNotFound(_0xa9b128,null))['then'](saveUpdates(_0x3f7c0c[_0x9b58('0x55')],null))[_0x9b58('0x21')](respondWithResult(_0xa9b128,null))[_0x9b58('0x2b')](handleError(_0xa9b128,null));};exports['destroy']=function(_0x5632ca,_0x33f275){return db[_0x9b58('0x3b')][_0x9b58('0x54')]({'where':{'id':_0x5632ca[_0x9b58('0x51')]['id']}})[_0x9b58('0x21')](handleEntityNotFound(_0x33f275,null))['then'](removeEntity(_0x33f275,null))[_0x9b58('0x2b')](handleError(_0x33f275,null));};exports[_0x9b58('0x56')]=function(_0x4d309b,_0x5e01ae){return db['MailMessage'][_0x9b58('0x56')]()[_0x9b58('0x21')](respondWithResult(_0x5e01ae,null))[_0x9b58('0x2b')](handleError(_0x5e01ae,null));};exports[_0x9b58('0x57')]=function(_0x5e2646,_0x2a87e9){return db[_0x9b58('0x3b')]['create'](_0x5e2646[_0x9b58('0x55')])['then'](function(_0x5d727e){if(_0x5d727e){if(_0x5d727e['direction']===_0x9b58('0x58')&&!_0x5d727e[_0x9b58('0x59')]){var _0x34fb88,_0x4f3200,_0x2dd03a;if(_0x5e2646[_0x9b58('0x55')]['to']){_0x4f3200=_0x5e2646[_0x9b58('0x55')]['to'][_0x9b58('0x5a')](',')[0x0];}return db['MailAccount']['findOne']({'where':{'id':_0x5d727e['MailAccountId']},'include':[{'model':db['CmList'],'as':_0x9b58('0x5b'),'include':[{'model':db[_0x9b58('0x5c')],'as':_0x9b58('0x5d'),'where':{'email':_0x4f3200},'limit':0x1,'order':[[_0x9b58('0x5e'),'DESC']]}]},{'model':db[_0x9b58('0x5f')],'as':_0x9b58('0x60'),'raw':!![]}]})[_0x9b58('0x21')](function(_0x13bc4a){_0x34fb88=_0x13bc4a;if(_0x34fb88&&_0x34fb88[_0x9b58('0x60')]){var _0x580fc3={'tls':{'rejectUnauthorized':![]}};if(_[_0x9b58('0x61')](_0x34fb88[_0x9b58('0x60')][_0x9b58('0x62')])){_0x580fc3[_0x9b58('0x63')]=_0x34fb88[_0x9b58('0x60')][_0x9b58('0x63')];_0x580fc3[_0x9b58('0x64')]=_0x34fb88[_0x9b58('0x60')][_0x9b58('0x64')];_0x580fc3[_0x9b58('0x65')]=_0x34fb88[_0x9b58('0x60')]['secure'];if(_0x34fb88['Smtp'][_0x9b58('0x66')]){_0x580fc3[_0x9b58('0x67')]={'user':_0x34fb88[_0x9b58('0x60')][_0x9b58('0x68')],'pass':_0x34fb88[_0x9b58('0x60')][_0x9b58('0x69')]};}}else{_0x580fc3[_0x9b58('0x62')]=_0x34fb88['Smtp'][_0x9b58('0x62')];_0x580fc3[_0x9b58('0x67')]={'user':_0x34fb88['Smtp'][_0x9b58('0x68')],'pass':_0x34fb88[_0x9b58('0x60')][_0x9b58('0x69')]};_0x580fc3[_0x9b58('0x65')]=_0x34fb88[_0x9b58('0x60')][_0x9b58('0x65')];}if(_0x5e2646['body'][_0x9b58('0x6a')]&&_0x5e2646['body'][_0x9b58('0x6a')][_0x9b58('0x53')]){for(var _0x45dd99=0x0;_0x45dd99<_0x5e2646[_0x9b58('0x55')]['attachments']['length'];_0x45dd99+=0x1){_0x5e2646[_0x9b58('0x55')]['attachments'][_0x45dd99]={'filename':_0x5e2646['body'][_0x9b58('0x6a')][_0x45dd99][_0x9b58('0x37')],'path':path['join'](config['root'],_0x9b58('0x6b'),_0x5e2646['body'][_0x9b58('0x6a')][_0x45dd99]['basename'])};}}_0x2dd03a={'account':_0x580fc3,'message':_0x5e2646[_0x9b58('0x55')]};return;}})['then'](function(){if(_0x34fb88[_0x9b58('0x5b')]){if(_0x34fb88['List']['Contacts'][_0x9b58('0x53')]){return _0x34fb88['List'][_0x9b58('0x5d')][0x0];}else{return db[_0x9b58('0x5c')][_0x9b58('0x57')](_[_0x9b58('0x16')](_0x5e2646[_0x9b58('0x55')],{'firstName':_0x5e2646[_0x9b58('0x55')]['to'],'email':_0x5e2646[_0x9b58('0x55')]['to'],'phone':_0x5e2646[_0x9b58('0x55')]['to'],'ListId':_0x34fb88[_0x9b58('0x6c')]}));}}else{throw new Error(_0x9b58('0x6d'));}})[_0x9b58('0x21')](function(){if(_0x2dd03a){return respondWithRpcPromise(_0x9b58('0x6e'),'sendMail',_0x2dd03a,client9003)[_0x9b58('0x21')](function(_0x769a44){return _0x5d727e[_0x9b58('0x35')]({'read':!![],'messageId':_0x769a44['messageId'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x9b58('0x2b')](function(_0x5f2d37){logger[_0x9b58('0x28')]('%s',JSON[_0x9b58('0x27')](_0x5f2d37));return _0x5d727e;});}return _0x5d727e;});}return _0x5d727e;}})['then'](respondWithResult(_0x2a87e9,0xc9))[_0x9b58('0x2b')](handleError(_0x2a87e9,null));};var interaction_log=require(_0x9b58('0x6f'))('mail-interactions');exports['accept']=function(_0x1a3495,_0xa5c9db,_0x2a1246){var _0x43e42a={'channel':_0x9b58('0x70')};if(_0x1a3495[_0x9b58('0x55')]['id']){delete _0x1a3495['body']['id'];}_0x1a3495['body'][_0x9b58('0x71')]=!![];_0x1a3495[_0x9b58('0x55')][_0x9b58('0x72')]=moment()['format'](_0x9b58('0x73'));_0x1a3495[_0x9b58('0x55')][_0x9b58('0x74')]=_0x1a3495['body']['UserId']||_0x1a3495['user']['id'];return db[_0x9b58('0x3b')][_0x9b58('0x54')]({'where':{'id':_0x1a3495[_0x9b58('0x51')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x9b58('0x75')}]})['then'](handleEntityNotFound(_0xa5c9db,null))['then'](saveUpdates(_0x1a3495[_0x9b58('0x55')],null))['then'](function(_0x3a8b3e){if(_0x3a8b3e){_0x43e42a['message']=_0x3a8b3e[_0x9b58('0x76')]({'plain':!![]});return db[_0x9b58('0x77')][_0x9b58('0x54')]({'where':{'id':_0x3a8b3e[_0x9b58('0x78')]}});}return null;})[_0x9b58('0x21')](handleEntityNotFound(_0xa5c9db,null))[_0x9b58('0x21')](function(_0x46f1d7){if(_0x46f1d7){return _0x46f1d7[_0x9b58('0x35')]({'UserId':_0x1a3495[_0x9b58('0x55')][_0x9b58('0x74')],'read1stAt':_[_0x9b58('0x61')](_0x46f1d7[_0x9b58('0x79')])?moment()[_0x9b58('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x9b58('0x21')](function(_0x19d410){if(_0x19d410){_0x43e42a['interaction']=_0x19d410[_0x9b58('0x76')]({'plain':!![]});interaction_log['info'](_0x9b58('0x7b'),_0x1a3495['user']['id'],_0x1a3495[_0x9b58('0x68')][_0x9b58('0x37')],_0x1a3495[_0x9b58('0x68')][_0x9b58('0x7c')],_0x43e42a[_0x9b58('0x7d')]['id'],_0x1a3495[_0x9b58('0x55')]?JSON[_0x9b58('0x27')](_0x1a3495['body']):_0x9b58('0x7e'));return respondWithRpcPromise(_0x9b58('0x7f'),_0x9b58('0x80'),_0x43e42a);}return null;})[_0x9b58('0x21')](function(_0x222273){if(_0x222273){if(_0x1a3495[_0x9b58('0x55')][_0x9b58('0x81')]){_0x43e42a[_0x9b58('0x29')][_0x9b58('0x82')]=util[_0x9b58('0x7a')](_0x9b58('0x83'),_0x1a3495[_0x9b58('0x68')][_0x9b58('0x37')]);_0x43e42a[_0x9b58('0x29')][_0x9b58('0x84')]=_0x43e42a[_0x9b58('0x84')];_0x43e42a[_0x9b58('0x29')][_0x9b58('0x85')]=_0x9b58('0x86');return respondWithRpcPromise(_0x9b58('0x87'),_0x9b58('0x87'),{'event':_0x9b58('0x88'),'message':_0x43e42a[_0x9b58('0x29')]},client9002)[_0x9b58('0x21')](function(){return _0x43e42a;});}return _0x43e42a;}return null;})[_0x9b58('0x21')](respondWithResult(_0xa5c9db,null))[_0x9b58('0x2b')](handleError(_0xa5c9db,null));};var interaction_log=require(_0x9b58('0x6f'))(_0x9b58('0x89'));exports[_0x9b58('0x34')]=function(_0x56623a,_0x3e74ee,_0x465277){var _0x190a5e={'agent':{},'channel':_0x9b58('0x70')};if(_0x56623a['body']['id']){delete _0x56623a[_0x9b58('0x55')]['id'];}_0x56623a[_0x9b58('0x55')][_0x9b58('0x74')]=_0x56623a[_0x9b58('0x55')][_0x9b58('0x74')]||_0x56623a[_0x9b58('0x68')]['id'];_0x190a5e[_0x9b58('0x8a')]['id']=_0x56623a[_0x9b58('0x55')]['UserId'];return db[_0x9b58('0x3b')]['find']({'where':{'id':_0x56623a[_0x9b58('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3e74ee,null))[_0x9b58('0x21')](function(_0x8191ce){if(_0x8191ce){_0x190a5e[_0x9b58('0x29')]=_0x8191ce[_0x9b58('0x76')]({'plain':!![]});return db[_0x9b58('0x77')][_0x9b58('0x54')]({'where':{'id':_0x8191ce[_0x9b58('0x78')]}});}return null;})[_0x9b58('0x21')](handleEntityNotFound(_0x3e74ee,null))[_0x9b58('0x21')](function(_0x334a9b){if(_0x334a9b){_0x190a5e['interaction']=_0x334a9b[_0x9b58('0x76')]({'plain':!![]});interaction_log[_0x9b58('0x22')](_0x9b58('0x8b'),_0x56623a['user']['id'],_0x56623a[_0x9b58('0x68')]['name'],_0x56623a[_0x9b58('0x68')][_0x9b58('0x7c')],_0x190a5e[_0x9b58('0x7d')]['id'],_0x56623a['body']?JSON['stringify'](_0x56623a[_0x9b58('0x55')]):'null');return respondWithRpcPromise(_0x9b58('0x8c'),'rejectMessage',_0x190a5e);}return null;})['then'](function(_0x268d05){if(_0x268d05){_0x268d05[_0x9b58('0x29')]['interface']=util['format'](_0x9b58('0x83'),_0x56623a[_0x9b58('0x68')][_0x9b58('0x37')]);_0x268d05[_0x9b58('0x29')][_0x9b58('0x84')]=_0x190a5e[_0x9b58('0x84')];_0x268d05['message'][_0x9b58('0x85')]='reject';respondWithRpcPromise(_0x9b58('0x87'),_0x9b58('0x87'),{'event':_0x9b58('0x8d'),'message':_0x268d05[_0x9b58('0x29')]},client9002);return _0x190a5e;}return null;})[_0x9b58('0x21')](respondWithResult(_0x3e74ee,null))[_0x9b58('0x2b')](handleError(_0x3e74ee,null));};exports['download']=function(_0x575152,_0x446b28){var _0x325384=moment()[_0x9b58('0x8e')]()[_0x9b58('0x8f')]();var _0x409f1b=path[_0x9b58('0x90')](config[_0x9b58('0x91')],_0x9b58('0x92'),_0x9b58('0x93'),_0x9b58('0x94'));var _0x5af281=path[_0x9b58('0x90')](config[_0x9b58('0x91')],_0x9b58('0x92'),_0x9b58('0x93'),_0x9b58('0x6a'));var _0xe93fc=util[_0x9b58('0x7a')](_0x9b58('0x95'),_0x325384);return db['MailMessage'][_0x9b58('0x54')]({'where':{'id':_0x575152['params']['id']},'attributes':['id',_0x9b58('0x55'),_0x9b58('0x96'),'to','cc',_0x9b58('0x97'),_0x9b58('0x98'),_0x9b58('0x99')],'include':_0x575152[_0x9b58('0x3e')][_0x9b58('0x6a')]?[{'model':db[_0x9b58('0x9a')],'as':_0x9b58('0x9b')}]:undefined})[_0x9b58('0x21')](handleEntityNotFound(_0x446b28,null))[_0x9b58('0x21')](function(_0x2a3a1d){if(_0x2a3a1d){var _0x24a31d=_0x2a3a1d;var _0x23d412={'from':_0x24a31d[_0x9b58('0x96')],'to':_0x24a31d['to'],'subject':_0x24a31d[_0x9b58('0x98')],'html':_0x24a31d[_0x9b58('0x55')],'headers':{'Date':moment(_0x24a31d[_0x9b58('0x99')])[_0x9b58('0x7a')](_0x9b58('0x9c'))},'attachments':[]};if(_0x2a3a1d['cc']){_0x23d412[_0x9b58('0x9d')]['Cc']=_0x2a3a1d['cc'];}if(_0x2a3a1d[_0x9b58('0x97')]){_0x23d412[_0x9b58('0x9d')][_0x9b58('0x9e')]=_0x2a3a1d[_0x9b58('0x97')];}return new BPromise(function(_0x392289,_0xad921){if(_0x2a3a1d[_0x9b58('0x9b')]){for(var _0x45b563=0x0;_0x45b563<_0x2a3a1d[_0x9b58('0x9b')][_0x9b58('0x53')];_0x45b563++){var _0x532242=_0x2a3a1d[_0x9b58('0x9b')][_0x45b563];var _0x3efeec=path[_0x9b58('0x90')](_0x5af281,_0x532242[_0x9b58('0x9f')]);if(fs[_0x9b58('0xa0')](_0x3efeec)){_0x23d412[_0x9b58('0x6a')][_0x9b58('0xa1')]({'name':_0x532242['name'],'contentType':_0x532242[_0x9b58('0x3d')],'data':fs[_0x9b58('0xa2')](_0x3efeec)});}}}emlformat[_0x9b58('0xa3')](_0x23d412,function(_0x62d482,_0x50c307){if(_0x62d482)return _0xad921(_0x62d482);fs['writeFileSync'](path[_0x9b58('0x90')](_0x409f1b,_0xe93fc),_0x50c307);return _0x392289(_0x50c307);});});}})[_0x9b58('0x21')](function(_0x17b0c6){if(_0x17b0c6){return _0x446b28[_0x9b58('0xa4')](path[_0x9b58('0x90')](_0x409f1b,_0xe93fc),_0xe93fc,function(_0xdaef75){if(_0xdaef75){console[_0x9b58('0xa5')](_0x9b58('0xa6'),_0xdaef75);}else{fs['unlinkSync'](path[_0x9b58('0x90')](_0x409f1b,_0xe93fc));}});}})[_0x9b58('0x2b')](handleError(_0x446b28,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index d622a07..a9e69ec 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 _0x882e=['MailMessage','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x30ef3d,_0x4befff){var _0x4a3620=function(_0x3083a7){while(--_0x3083a7){_0x30ef3d['push'](_0x30ef3d['shift']());}};_0x4a3620(++_0x4befff);}(_0x882e,0x1db));var _0xe882=function(_0x5c210b,_0x45f3b9){_0x5c210b=_0x5c210b-0x0;var _0x1531fd=_0x882e[_0x5c210b];return _0x1531fd;};'use strict';var EventEmitter=require(_0xe882('0x0'));var MailMessage=require(_0xe882('0x1'))['db'][_0xe882('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xe882('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe882('0x4')};function emitEvent(_0x9ae77d){return function(_0x1e0ad3,_0x32aefa,_0x249cda){MailMessageEvents[_0xe882('0x5')](_0x9ae77d+':'+_0x1e0ad3['id'],_0x1e0ad3);MailMessageEvents[_0xe882('0x5')](_0x9ae77d,_0x1e0ad3);_0x249cda(null);};}for(var e in events){if(events[_0xe882('0x6')](e)){var event=events[e];MailMessage[_0xe882('0x7')](e,emitEvent(event));}}module[_0xe882('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x9acf=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners','save'];(function(_0x4d70a7,_0x3a34be){var _0x13e9a1=function(_0x4b8a5e){while(--_0x4b8a5e){_0x4d70a7['push'](_0x4d70a7['shift']());}};_0x13e9a1(++_0x3a34be);}(_0x9acf,0x1a3));var _0xf9ac=function(_0x52d538,_0x23b41f){_0x52d538=_0x52d538-0x0;var _0x257a2a=_0x9acf[_0x52d538];return _0x257a2a;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xf9ac('0x0'))['db'][_0xf9ac('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xf9ac('0x2')](0x0);var events={'afterCreate':_0xf9ac('0x3'),'afterUpdate':_0xf9ac('0x4'),'afterDestroy':'remove'};function emitEvent(_0x10bc53){return function(_0x27bd20,_0x213f82,_0x840b66){MailMessageEvents[_0xf9ac('0x5')](_0x10bc53+':'+_0x27bd20['id'],_0x27bd20);MailMessageEvents[_0xf9ac('0x5')](_0x10bc53,_0x27bd20);_0x840b66(null);};}for(var e in events){if(events[_0xf9ac('0x6')](e)){var event=events[e];MailMessage[_0xf9ac('0x7')](e,emitEvent(event));}}module[_0xf9ac('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 47e01d8..84be3d3 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 _0x574d=['messageId','plainBody','subject','body','fromString','get','direction','toLowerCase','out','secret','UserId','MailInteraction','findOne','createdAt','catch','error','utf8mb4','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','MailMessage','mail_messages'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x574d,0xdc));var _0xd574=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x574d[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xd574('0x0'));var util=require(_0xd574('0x1'));var logger=require('../../config/logger')(_0xd574('0x2'));var moment=require(_0xd574('0x3'));var BPromise=require(_0xd574('0x4'));var rp=require(_0xd574('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require('path');var rimraf=require(_0xd574('0x6'));var config=require(_0xd574('0x7'));var attributes=require('./mailMessage.attributes');module[_0xd574('0x8')]=function(_0x5145d0,_0x2b0821){return _0x5145d0[_0xd574('0x9')](_0xd574('0xa'),attributes,{'tableName':_0xd574('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xd574('0xc')]},{'name':'fti_mail_messages','fields':[_0xd574('0xd'),_0xd574('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x21a483,_0x6c128f,_0x494cb8){if(_0x21a483[_0xd574('0xf')]){_0x21a483[_0xd574('0xd')]=htmlToText[_0xd574('0x10')](_0x21a483[_0xd574('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x494cb8(null,_0x6c128f);},'afterCreate':function(_0x3b278f,_0x1b92d3,_0x33d4c1){var _0x5ddc00=_0x5145d0['models'];var _0x37020a=_0x3b278f[_0xd574('0x11')]({'plain':!![]});if(_0x37020a[_0xd574('0x12')][_0xd574('0x13')]()==='in'||_0x37020a['direction'][_0xd574('0x13')]()===_0xd574('0x14')&&!_0x37020a[_0xd574('0x15')]&&!_['isNil'](_0x37020a[_0xd574('0x16')])){_0x5ddc00[_0xd574('0x17')][_0xd574('0x18')]({'where':{'id':_0x37020a['MailInteractionId']}})['then'](function(_0x3fe03e){if(_0x3fe03e){_0x3fe03e['update']({'lastMsgAt':_0x37020a[_0xd574('0x19')],'lastMsgDirection':_0x37020a[_0xd574('0x12')][_0xd574('0x13')](),'lastMsgBody':_0x37020a[_0xd574('0xf')]});}})[_0xd574('0x1a')](function(_0x113c26){console[_0xd574('0x1b')](_0x113c26);});}_0x33d4c1();}},'charset':_0xd574('0x1c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0c46=['createdAt','direction','toLowerCase','catch','error','utf8mb4','lodash','../../config/logger','api','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','body','models','get','secret','UserId','MailInteraction','findOne','then','update'];(function(_0xcc90af,_0x43e743){var _0x4a2c15=function(_0x4f07ac){while(--_0x4f07ac){_0xcc90af['push'](_0xcc90af['shift']());}};_0x4a2c15(++_0x43e743);}(_0x0c46,0x171));var _0x60c4=function(_0x66f6c8,_0x30c270){_0x66f6c8=_0x66f6c8-0x0;var _0x142262=_0x0c46[_0x66f6c8];return _0x142262;};'use strict';var _=require(_0x60c4('0x0'));var util=require('util');var logger=require(_0x60c4('0x1'))(_0x60c4('0x2'));var moment=require('moment');var BPromise=require(_0x60c4('0x3'));var rp=require(_0x60c4('0x4'));var htmlToText=require(_0x60c4('0x5'));var fs=require('fs');var path=require(_0x60c4('0x6'));var rimraf=require(_0x60c4('0x7'));var config=require(_0x60c4('0x8'));var attributes=require(_0x60c4('0x9'));module[_0x60c4('0xa')]=function(_0x56cc3f,_0xbe39ff){return _0x56cc3f[_0x60c4('0xb')](_0x60c4('0xc'),attributes,{'tableName':_0x60c4('0xd'),'paranoid':![],'indexes':[{'name':_0x60c4('0xe'),'fields':['messageId']},{'name':_0x60c4('0xf'),'fields':[_0x60c4('0x10'),'subject'],'type':_0x60c4('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x189d68,_0x1f73ce,_0x454802){if(_0x189d68['body']){_0x189d68[_0x60c4('0x10')]=htmlToText['fromString'](_0x189d68[_0x60c4('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x454802(null,_0x1f73ce);},'afterCreate':function(_0x1a78ac,_0x4867fe,_0x245280){var _0x3c8225=_0x56cc3f[_0x60c4('0x13')];var _0x1d799b=_0x1a78ac[_0x60c4('0x14')]({'plain':!![]});if(_0x1d799b['direction']['toLowerCase']()==='in'||_0x1d799b['direction']['toLowerCase']()==='out'&&!_0x1d799b[_0x60c4('0x15')]&&!_['isNil'](_0x1d799b[_0x60c4('0x16')])){_0x3c8225[_0x60c4('0x17')][_0x60c4('0x18')]({'where':{'id':_0x1d799b['MailInteractionId']}})[_0x60c4('0x19')](function(_0x2be04e){if(_0x2be04e){_0x2be04e[_0x60c4('0x1a')]({'lastMsgAt':_0x1d799b[_0x60c4('0x1b')],'lastMsgDirection':_0x1d799b[_0x60c4('0x1c')][_0x60c4('0x1d')](),'lastMsgBody':_0x1d799b['body']});}})[_0x60c4('0x1e')](function(_0x7377f1){console[_0x60c4('0x1f')](_0x7377f1);});}_0x245280();}},'charset':_0x60c4('0x20'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 19b37b9..ec3eb8f 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 _0xfb15=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','create','body','options','raw','CreateMailMessage','stringify','lodash','util','moment'];(function(_0x10203f,_0x3eb373){var _0x14475f=function(_0x45f705){while(--_0x45f705){_0x10203f['push'](_0x10203f['shift']());}};_0x14475f(++_0x3eb373);}(_0xfb15,0x12f));var _0x5fb1=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xfb15[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x5fb1('0x0'));var util=require(_0x5fb1('0x1'));var moment=require(_0x5fb1('0x2'));var BPromise=require(_0x5fb1('0x3'));var rs=require(_0x5fb1('0x4'));var fs=require('fs');var Redis=require(_0x5fb1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5fb1('0x6'));var logger=require(_0x5fb1('0x7'))(_0x5fb1('0x8'));var config=require(_0x5fb1('0x9'));var jayson=require(_0x5fb1('0xa'));var client=jayson[_0x5fb1('0xb')]['http']({'port':0x232a});config[_0x5fb1('0xc')]=_['defaults'](config['redis'],{'host':_0x5fb1('0xd'),'port':0x18eb});var socket=require(_0x5fb1('0xe'))(new Redis(config[_0x5fb1('0xc')]));require(_0x5fb1('0xf'))[_0x5fb1('0x10')](socket);function respondWithRpcPromise(_0x226da1,_0xacf09e,_0x39c159){return new BPromise(function(_0x249e1a,_0x327e45){return client[_0x5fb1('0x11')](_0x226da1,_0x39c159)[_0x5fb1('0x12')](function(_0x150368){logger['info'](_0x5fb1('0x13'),_0xacf09e,_0x5fb1('0x14'));logger['debug'](_0x5fb1('0x15'),_0xacf09e,_0x5fb1('0x14'),JSON['stringify'](_0x150368));if(_0x150368[_0x5fb1('0x16')]){if(_0x150368[_0x5fb1('0x16')][_0x5fb1('0x17')]===0x1f4){logger[_0x5fb1('0x16')](_0x5fb1('0x13'),_0xacf09e,_0x150368[_0x5fb1('0x16')][_0x5fb1('0x18')]);return _0x327e45(_0x150368[_0x5fb1('0x16')]['message']);}logger['error']('MailMessage,\x20%s,\x20%s',_0xacf09e,_0x150368[_0x5fb1('0x16')][_0x5fb1('0x18')]);return _0x249e1a(_0x150368[_0x5fb1('0x16')][_0x5fb1('0x18')]);}else{logger[_0x5fb1('0x19')](_0x5fb1('0x13'),_0xacf09e,'request\x20sent');_0x249e1a(_0x150368[_0x5fb1('0x1a')][_0x5fb1('0x18')]);}})[_0x5fb1('0x1b')](function(_0x3548ff){logger[_0x5fb1('0x16')](_0x5fb1('0x13'),_0xacf09e,_0x3548ff);_0x327e45(_0x3548ff);});});}exports['CreateMailMessage']=function(_0x51189d){var _0x4f4c4c=this;return new Promise(function(_0x2174e5,_0x1fa373){return db['MailMessage'][_0x5fb1('0x1c')](_0x51189d[_0x5fb1('0x1d')],{'raw':_0x51189d[_0x5fb1('0x1e')]?_0x51189d[_0x5fb1('0x1e')][_0x5fb1('0x1f')]===undefined?!![]:![]:!![]})[_0x5fb1('0x12')](function(_0x549b56){logger[_0x5fb1('0x19')]('CreateMailMessage',_0x51189d);logger['debug'](_0x5fb1('0x20'),_0x51189d,JSON[_0x5fb1('0x21')](_0x549b56));_0x2174e5(_0x549b56);})[_0x5fb1('0x1b')](function(_0x3b1ac8){logger[_0x5fb1('0x16')]('CreateMailMessage',_0x3b1ac8[_0x5fb1('0x18')],_0x51189d);_0x1fa373(_0x4f4c4c[_0x5fb1('0x16')](0x1f4,_0x3b1ac8['message']));});});}; \ No newline at end of file +var _0xab36=['options','then','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','request','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateMailMessage','MailMessage','create'];(function(_0x31f972,_0x318753){var _0x479c63=function(_0x1d040a){while(--_0x1d040a){_0x31f972['push'](_0x31f972['shift']());}};_0x479c63(++_0x318753);}(_0xab36,0x1df));var _0x6ab3=function(_0x17fa7d,_0x51ad0c){_0x17fa7d=_0x17fa7d-0x0;var _0x4cd11d=_0xab36[_0x17fa7d];return _0x4cd11d;};'use strict';var _=require(_0x6ab3('0x0'));var util=require(_0x6ab3('0x1'));var moment=require(_0x6ab3('0x2'));var BPromise=require(_0x6ab3('0x3'));var rs=require(_0x6ab3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ab3('0x5'))['db'];var utils=require(_0x6ab3('0x6'));var logger=require(_0x6ab3('0x7'))('rpc');var config=require(_0x6ab3('0x8'));var jayson=require(_0x6ab3('0x9'));var client=jayson[_0x6ab3('0xa')][_0x6ab3('0xb')]({'port':0x232a});config[_0x6ab3('0xc')]=_[_0x6ab3('0xd')](config['redis'],{'host':_0x6ab3('0xe'),'port':0x18eb});var socket=require(_0x6ab3('0xf'))(new Redis(config['redis']));require(_0x6ab3('0x10'))['register'](socket);function respondWithRpcPromise(_0x3429f2,_0xecf064,_0x50c276){return new BPromise(function(_0x386ac9,_0x16f357){return client[_0x6ab3('0x11')](_0x3429f2,_0x50c276)['then'](function(_0x1dca3a){logger['info'](_0x6ab3('0x12'),_0xecf064,_0x6ab3('0x13'));logger[_0x6ab3('0x14')](_0x6ab3('0x15'),_0xecf064,_0x6ab3('0x13'),JSON['stringify'](_0x1dca3a));if(_0x1dca3a[_0x6ab3('0x16')]){if(_0x1dca3a[_0x6ab3('0x16')][_0x6ab3('0x17')]===0x1f4){logger[_0x6ab3('0x16')](_0x6ab3('0x12'),_0xecf064,_0x1dca3a['error'][_0x6ab3('0x18')]);return _0x16f357(_0x1dca3a['error'][_0x6ab3('0x18')]);}logger[_0x6ab3('0x16')](_0x6ab3('0x12'),_0xecf064,_0x1dca3a[_0x6ab3('0x16')][_0x6ab3('0x18')]);return _0x386ac9(_0x1dca3a[_0x6ab3('0x16')][_0x6ab3('0x18')]);}else{logger[_0x6ab3('0x19')](_0x6ab3('0x12'),_0xecf064,'request\x20sent');_0x386ac9(_0x1dca3a[_0x6ab3('0x1a')]['message']);}})[_0x6ab3('0x1b')](function(_0x11ec87){logger[_0x6ab3('0x16')](_0x6ab3('0x12'),_0xecf064,_0x11ec87);_0x16f357(_0x11ec87);});});}exports[_0x6ab3('0x1c')]=function(_0xa6850e){var _0x46ace6=this;return new Promise(function(_0x4ae822,_0x253bb2){return db[_0x6ab3('0x1d')][_0x6ab3('0x1e')](_0xa6850e['body'],{'raw':_0xa6850e[_0x6ab3('0x1f')]?_0xa6850e['options']['raw']===undefined?!![]:![]:!![]})[_0x6ab3('0x20')](function(_0x4e6680){logger[_0x6ab3('0x19')](_0x6ab3('0x1c'),_0xa6850e);logger[_0x6ab3('0x14')](_0x6ab3('0x1c'),_0xa6850e,JSON[_0x6ab3('0x21')](_0x4e6680));_0x4ae822(_0x4e6680);})[_0x6ab3('0x1b')](function(_0x466812){logger[_0x6ab3('0x16')](_0x6ab3('0x1c'),_0x466812[_0x6ab3('0x18')],_0xa6850e);_0x253bb2(_0x46ace6[_0x6ab3('0x16')](0x1f4,_0x466812[_0x6ab3('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index d4788ad..6d461f0 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 _0xe2f5=['remove','removeListener','register','length','./mailMessage.events','save'];(function(_0x453122,_0x103ec3){var _0x4c1d33=function(_0x67dfa3){while(--_0x67dfa3){_0x453122['push'](_0x453122['shift']());}};_0x4c1d33(++_0x103ec3);}(_0xe2f5,0x1ba));var _0x5e2f=function(_0x495c52,_0x177c06){_0x495c52=_0x495c52-0x0;var _0x473479=_0xe2f5[_0x495c52];return _0x473479;};'use strict';var MailMessageEvents=require(_0x5e2f('0x0'));var events=[_0x5e2f('0x1'),_0x5e2f('0x2'),'update'];function createListener(_0x27df0f,_0x359c4e){return function(_0x59b62b){_0x359c4e['emit'](_0x27df0f,_0x59b62b);};}function removeListener(_0x5e8885,_0x44646f){return function(){MailMessageEvents[_0x5e2f('0x3')](_0x5e8885,_0x44646f);};}exports[_0x5e2f('0x4')]=function(_0x18d8e7){for(var _0xd10bf0=0x0,_0x224dbb=events[_0x5e2f('0x5')];_0xd10bf0<_0x224dbb;_0xd10bf0++){var _0x1186b1=events[_0xd10bf0];var _0x12a67a=createListener('mailMessage:'+_0x1186b1,_0x18d8e7);MailMessageEvents['on'](_0x1186b1,_0x12a67a);}}; \ No newline at end of file +var _0xf874=['emit','removeListener','register','./mailMessage.events','remove','update'];(function(_0x5427c8,_0x18f384){var _0x33a129=function(_0x1940e8){while(--_0x1940e8){_0x5427c8['push'](_0x5427c8['shift']());}};_0x33a129(++_0x18f384);}(_0xf874,0x177));var _0x4f87=function(_0xdb8397,_0x2cd716){_0xdb8397=_0xdb8397-0x0;var _0x15d94d=_0xf874[_0xdb8397];return _0x15d94d;};'use strict';var MailMessageEvents=require(_0x4f87('0x0'));var events=['save',_0x4f87('0x1'),_0x4f87('0x2')];function createListener(_0xbfff85,_0xe07d73){return function(_0x18fe31){_0xe07d73[_0x4f87('0x3')](_0xbfff85,_0x18fe31);};}function removeListener(_0x87123d,_0x5edb17){return function(){MailMessageEvents[_0x4f87('0x4')](_0x87123d,_0x5edb17);};}exports[_0x4f87('0x5')]=function(_0x5d9a23){for(var _0x50bcb8=0x0,_0x497346=events['length'];_0x50bcb8<_0x497346;_0x50bcb8++){var _0x55a9b0=events[_0x50bcb8];var _0x2aeac4=createListener('mailMessage:'+_0x55a9b0,_0x5d9a23);MailMessageEvents['on'](_0x55a9b0,_0x2aeac4);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 0769dbb..a23cce1 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 _0x325c=['Router','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','post','create','addTeams','/:id/users','addAgents','put','update','destroy','delete','removeAgents','exports','util','path','connect-timeout','express'];(function(_0x2f3ecd,_0x57976b){var _0xffdc44=function(_0xf21bc6){while(--_0xf21bc6){_0x2f3ecd['push'](_0x2f3ecd['shift']());}};_0xffdc44(++_0x57976b);}(_0x325c,0x1d8));var _0xc325=function(_0x795e61,_0x4c80ca){_0x795e61=_0x795e61-0x0;var _0x1ab31e=_0x325c[_0x795e61];return _0x1ab31e;};'use strict';var multer=require('multer');var util=require(_0xc325('0x0'));var path=require(_0xc325('0x1'));var timeout=require(_0xc325('0x2'));var express=require(_0xc325('0x3'));var router=express[_0xc325('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc325('0x5'));var config=require('../../config/environment');var controller=require(_0xc325('0x6'));router[_0xc325('0x7')]('/',auth[_0xc325('0x8')](),controller[_0xc325('0x9')]);router['get'](_0xc325('0xa'),auth[_0xc325('0x8')](),controller[_0xc325('0xb')]);router[_0xc325('0x7')](_0xc325('0xc'),auth[_0xc325('0x8')](),controller[_0xc325('0xd')]);router[_0xc325('0x7')](_0xc325('0xe'),auth[_0xc325('0x8')](),controller[_0xc325('0xf')]);router[_0xc325('0x7')](_0xc325('0x10'),auth[_0xc325('0x8')](),controller['getTeams']);router[_0xc325('0x7')]('/:id/users',auth[_0xc325('0x8')](),controller['getAgents']);router[_0xc325('0x11')]('/',auth['isAuthenticated'](),controller[_0xc325('0x12')]);router[_0xc325('0x11')](_0xc325('0x10'),auth[_0xc325('0x8')](),controller[_0xc325('0x13')]);router[_0xc325('0x11')](_0xc325('0x14'),auth[_0xc325('0x8')](),controller[_0xc325('0x15')]);router[_0xc325('0x16')]('/:id',auth[_0xc325('0x8')](),controller[_0xc325('0x17')]);router['delete'](_0xc325('0xc'),auth[_0xc325('0x8')](),controller[_0xc325('0x18')]);router[_0xc325('0x19')](_0xc325('0x10'),auth[_0xc325('0x8')](),controller['removeTeams']);router[_0xc325('0x19')](_0xc325('0x14'),auth['isAuthenticated'](),controller[_0xc325('0x1a')]);module[_0xc325('0x1b')]=router; \ No newline at end of file +var _0x5265=['describe','/:id','show','/:id/members','getTeams','getAgents','post','/:id/teams','/:id/users','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe'];(function(_0x3b674f,_0x1f530c){var _0x2b46ae=function(_0x205fac){while(--_0x205fac){_0x3b674f['push'](_0x3b674f['shift']());}};_0x2b46ae(++_0x1f530c);}(_0x5265,0x6a));var _0x5526=function(_0x5a91fc,_0x1ca6b0){_0x5a91fc=_0x5a91fc-0x0;var _0x13dadb=_0x5265[_0x5a91fc];return _0x13dadb;};'use strict';var multer=require(_0x5526('0x0'));var util=require(_0x5526('0x1'));var path=require(_0x5526('0x2'));var timeout=require(_0x5526('0x3'));var express=require(_0x5526('0x4'));var router=express[_0x5526('0x5')]();var auth=require(_0x5526('0x6'));var interaction=require(_0x5526('0x7'));var config=require(_0x5526('0x8'));var controller=require(_0x5526('0x9'));router[_0x5526('0xa')]('/',auth[_0x5526('0xb')](),controller[_0x5526('0xc')]);router[_0x5526('0xa')](_0x5526('0xd'),auth[_0x5526('0xb')](),controller[_0x5526('0xe')]);router[_0x5526('0xa')](_0x5526('0xf'),auth[_0x5526('0xb')](),controller[_0x5526('0x10')]);router['get'](_0x5526('0x11'),auth['isAuthenticated'](),controller['getMembers']);router['get']('/:id/teams',auth[_0x5526('0xb')](),controller[_0x5526('0x12')]);router[_0x5526('0xa')]('/:id/users',auth[_0x5526('0xb')](),controller[_0x5526('0x13')]);router[_0x5526('0x14')]('/',auth[_0x5526('0xb')](),controller['create']);router[_0x5526('0x14')](_0x5526('0x15'),auth['isAuthenticated'](),controller['addTeams']);router[_0x5526('0x14')](_0x5526('0x16'),auth['isAuthenticated'](),controller[_0x5526('0x17')]);router[_0x5526('0x18')](_0x5526('0xf'),auth['isAuthenticated'](),controller[_0x5526('0x19')]);router[_0x5526('0x1a')](_0x5526('0xf'),auth[_0x5526('0xb')](),controller['destroy']);router[_0x5526('0x1a')](_0x5526('0x15'),auth['isAuthenticated'](),controller[_0x5526('0x1b')]);router[_0x5526('0x1a')]('/:id/users',auth[_0x5526('0xb')](),controller[_0x5526('0x1c')]);module[_0x5526('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index ba158c4..84018ec 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 _0x9080=['STRING','name','INTEGER','rrmemory','roundrobin'];(function(_0x114ef3,_0x2957c8){var _0x5266e2=function(_0x254efa){while(--_0x254efa){_0x114ef3['push'](_0x114ef3['shift']());}};_0x5266e2(++_0x2957c8);}(_0x9080,0xeb));var _0x0908=function(_0x5ecf94,_0x2ad6cd){_0x5ecf94=_0x5ecf94-0x0;var _0x1dec75=_0x9080[_0x5ecf94];return _0x1dec75;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0908('0x0')],'unique':_0x0908('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0908('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x0908('0x3'),'beepall',_0x0908('0x4'))}}; \ No newline at end of file +var _0xd9fb=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','beepall'];(function(_0x4a519f,_0x46a02c){var _0x206fa1=function(_0x12362c){while(--_0x12362c){_0x4a519f['push'](_0x4a519f['shift']());}};_0x206fa1(++_0x46a02c);}(_0xd9fb,0x189));var _0xbd9f=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xd9fb[_0x13ea00];return _0x1f7347;};'use strict';var Sequelize=require(_0xbd9f('0x0'));module[_0xbd9f('0x1')]={'name':{'type':Sequelize[_0xbd9f('0x2')],'unique':_0xbd9f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbd9f('0x2')]},'timeout':{'type':Sequelize[_0xbd9f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbd9f('0x5')]('rrmemory',_0xbd9f('0x6'),_0xbd9f('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 92d2286..3bbb16f 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 _0x5401=['findAndCountAll','UserId','agent','mailPause','rows','%s/%s','SIP','createdAt','updatedAt','getTeams','findOne','Team','nolimit','addTeams','ids','Agents','online','flatMap','sequelize','each','findOrCreate','forEach','emit','field','tq.TeamId','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','TeamId','includes','all','union','compact','transaction','isEmpty','removeAgents','addAgents','spread','userMailQueue:save','isArray','userMailQueue:remove','getAgents','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','sendStatus','status','json','count','limit','set','Content-Range','reject','update','destroy','get','MailQueues','UserProfileResource','then','end','stack','name','send','index','map','MailQueue','fieldName','type','model','query','keys','filters','attributes','fields','length','offset','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','params','rawAttributes','intersection','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','describe','getMembers','UserMailQueue','hasOwnProperty','MailQueueId','User'];(function(_0x5976f8,_0x1265b7){var _0x179715=function(_0x2b2c4b){while(--_0x2b2c4b){_0x5976f8['push'](_0x5976f8['shift']());}};_0x179715(++_0x1265b7);}(_0x5401,0xb8));var _0x1540=function(_0x58a4b5,_0x182439){_0x58a4b5=_0x58a4b5-0x0;var _0x51821d=_0x5401[_0x58a4b5];return _0x51821d;};'use strict';var pdf=require(_0x1540('0x0'));var emlformat=require(_0x1540('0x1'));var rimraf=require(_0x1540('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1540('0x3'));var moment=require(_0x1540('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1540('0x5'));var util=require(_0x1540('0x6'));var path=require(_0x1540('0x7'));var sox=require(_0x1540('0x8'));var csv=require(_0x1540('0x9'));var ejs=require(_0x1540('0xa'));var fs=require('fs');var _=require(_0x1540('0xb'));var squel=require('squel');var crypto=require(_0x1540('0xc'));var jsforce=require(_0x1540('0xd'));var deskjs=require(_0x1540('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1540('0xf'));var Redis=require(_0x1540('0x10'));var authService=require(_0x1540('0x11'));var qs=require(_0x1540('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1540('0x13'))('api');var utils=require(_0x1540('0x14'));var config=require(_0x1540('0x15'));var db=require(_0x1540('0x16'))['db'];config[_0x1540('0x17')]=_[_0x1540('0x18')](config[_0x1540('0x17')],{'host':_0x1540('0x19'),'port':0x18eb});var socket=require(_0x1540('0x1a'))(new Redis(config[_0x1540('0x17')]));require(_0x1540('0x1b'))['register'](socket);function respondWithStatusCode(_0x493ca1,_0x1479ba){_0x1479ba=_0x1479ba||0xcc;return function(_0xc5c36d){if(_0xc5c36d){return _0x493ca1[_0x1540('0x1c')](_0x1479ba);}return _0x493ca1[_0x1540('0x1d')](_0x1479ba)['end']();};}function respondWithResult(_0x24a3fe,_0x4557a2){_0x4557a2=_0x4557a2||0xc8;return function(_0x124865){if(_0x124865){return _0x24a3fe[_0x1540('0x1d')](_0x4557a2)[_0x1540('0x1e')](_0x124865);}};}function respondWithFilteredResult(_0x1df3cb,_0x4fe97a){return function(_0x480648){if(_0x480648){var _0x1e7dd6=_0x480648[_0x1540('0x1f')],_0x22756f=_0x4fe97a['offset'],_0x4950d0=_0x4fe97a['offset']+_0x4fe97a[_0x1540('0x20')],_0x472ae7;if(_0x4950d0>=_0x1e7dd6){_0x4950d0=_0x1e7dd6;_0x472ae7=0xc8;}else{_0x472ae7=0xce;}_0x1df3cb[_0x1540('0x1d')](_0x472ae7);return _0x1df3cb[_0x1540('0x21')](_0x1540('0x22'),_0x22756f+'-'+_0x4950d0+'/'+_0x1e7dd6)[_0x1540('0x1e')](_0x480648);}return null;};}function patchUpdates(_0x42845e){return function(_0xc46f76){try{jsonpatch['apply'](_0xc46f76,_0x42845e,!![]);}catch(_0x36dfe0){return BPromise[_0x1540('0x23')](_0x36dfe0);}return _0xc46f76['save']();};}function saveUpdates(_0x5016cf,_0x40a7ad){return function(_0x538f5a){if(_0x538f5a){return _0x538f5a[_0x1540('0x24')](_0x5016cf)['then'](function(_0xd1e43c){return _0xd1e43c;});}return null;};}function removeEntity(_0x22a813,_0x42b892){return function(_0x1e0584){if(_0x1e0584){return _0x1e0584[_0x1540('0x25')]()['then'](function(){var _0x17d066=_0x1e0584[_0x1540('0x26')]({'plain':!![]});var _0xc573b4=_0x1540('0x27');return db[_0x1540('0x28')][_0x1540('0x25')]({'where':{'type':_0xc573b4,'resourceId':_0x17d066['id']}})[_0x1540('0x29')](function(){return _0x1e0584;});})[_0x1540('0x29')](function(){_0x22a813['status'](0xcc)[_0x1540('0x2a')]();});}};}function handleEntityNotFound(_0x269b28,_0xf6583a){return function(_0x3edd74){if(!_0x3edd74){_0x269b28['sendStatus'](0x194);}return _0x3edd74;};}function handleError(_0x321b17,_0x11d83a){_0x11d83a=_0x11d83a||0x1f4;return function(_0x296a6a){logger['error'](_0x296a6a[_0x1540('0x2b')]);if(_0x296a6a[_0x1540('0x2c')]){delete _0x296a6a['name'];}_0x321b17['status'](_0x11d83a)[_0x1540('0x2d')](_0x296a6a);};}exports[_0x1540('0x2e')]=function(_0xc38358,_0x26bc40){var _0x34951d={},_0x27e70f={},_0x28c880={'count':0x0,'rows':[]};var _0x1e392a=_[_0x1540('0x2f')](db[_0x1540('0x30')]['rawAttributes'],function(_0x3cd40a){return{'name':_0x3cd40a[_0x1540('0x31')],'type':_0x3cd40a[_0x1540('0x32')]['key']};});_0x27e70f[_0x1540('0x33')]=_['map'](_0x1e392a,_0x1540('0x2c'));_0x27e70f[_0x1540('0x34')]=_[_0x1540('0x35')](_0xc38358[_0x1540('0x34')]);_0x27e70f[_0x1540('0x36')]=_['intersection'](_0x27e70f[_0x1540('0x33')],_0x27e70f[_0x1540('0x34')]);_0x34951d[_0x1540('0x37')]=_['intersection'](_0x27e70f[_0x1540('0x33')],qs[_0x1540('0x38')](_0xc38358[_0x1540('0x34')][_0x1540('0x38')]));_0x34951d['attributes']=_0x34951d[_0x1540('0x37')][_0x1540('0x39')]?_0x34951d[_0x1540('0x37')]:_0x27e70f[_0x1540('0x33')];if(!_0xc38358[_0x1540('0x34')]['hasOwnProperty']('nolimit')){_0x34951d[_0x1540('0x20')]=qs[_0x1540('0x20')](_0xc38358[_0x1540('0x34')][_0x1540('0x20')]);_0x34951d[_0x1540('0x3a')]=qs[_0x1540('0x3a')](_0xc38358['query'][_0x1540('0x3a')]);}_0x34951d[_0x1540('0x3b')]=qs[_0x1540('0x3c')](_0xc38358[_0x1540('0x34')][_0x1540('0x3c')]);_0x34951d[_0x1540('0x3d')]=qs[_0x1540('0x36')](_[_0x1540('0x3e')](_0xc38358[_0x1540('0x34')],_0x27e70f[_0x1540('0x36')]));if(_0xc38358['query'][_0x1540('0x3f')]){_0x34951d[_0x1540('0x3d')]=_[_0x1540('0x40')](_0x34951d[_0x1540('0x3d')],{'$or':_[_0x1540('0x2f')](_0x1e392a,function(_0x468e46){if(_0x468e46[_0x1540('0x32')]!==_0x1540('0x41')){var _0x386037={};_0x386037[_0x468e46[_0x1540('0x2c')]]={'$like':'%'+_0xc38358[_0x1540('0x34')][_0x1540('0x3f')]+'%'};return _0x386037;}})});}_0x34951d=_[_0x1540('0x40')]({},_0x34951d,_0xc38358['options']);var _0x357ed1={'where':_0x34951d[_0x1540('0x3d')]};return db[_0x1540('0x30')][_0x1540('0x1f')](_0x357ed1)[_0x1540('0x29')](function(_0x56b3a8){_0x28c880[_0x1540('0x1f')]=_0x56b3a8;if(_0xc38358[_0x1540('0x34')]['includeAll']){_0x34951d[_0x1540('0x42')]=[{'all':!![]}];}return db[_0x1540('0x30')][_0x1540('0x43')](_0x34951d);})[_0x1540('0x29')](function(_0x59be26){_0x28c880['rows']=_0x59be26;return _0x28c880;})[_0x1540('0x29')](respondWithFilteredResult(_0x26bc40,_0x34951d))[_0x1540('0x44')](handleError(_0x26bc40,null));};exports['show']=function(_0x18b297,_0xd7a5bb){var _0x53fc8d={'raw':!![],'where':{'id':_0x18b297[_0x1540('0x45')]['id']}},_0x13a387={};_0x13a387['model']=_[_0x1540('0x35')](db[_0x1540('0x30')][_0x1540('0x46')]);_0x13a387['query']=_['keys'](_0x18b297[_0x1540('0x34')]);_0x13a387[_0x1540('0x36')]=_['intersection'](_0x13a387['model'],_0x13a387[_0x1540('0x34')]);_0x53fc8d[_0x1540('0x37')]=_[_0x1540('0x47')](_0x13a387[_0x1540('0x33')],qs['fields'](_0x18b297[_0x1540('0x34')][_0x1540('0x38')]));_0x53fc8d[_0x1540('0x37')]=_0x53fc8d[_0x1540('0x37')]['length']?_0x53fc8d['attributes']:_0x13a387[_0x1540('0x33')];if(_0x18b297[_0x1540('0x34')]['includeAll']){_0x53fc8d[_0x1540('0x42')]=[{'all':!![]}];}_0x53fc8d=_[_0x1540('0x40')]({},_0x53fc8d,_0x18b297[_0x1540('0x48')]);return db['MailQueue'][_0x1540('0x49')](_0x53fc8d)[_0x1540('0x29')](handleEntityNotFound(_0xd7a5bb,null))[_0x1540('0x29')](respondWithResult(_0xd7a5bb,null))['catch'](handleError(_0xd7a5bb,null));};exports[_0x1540('0x4a')]=function(_0x235abd,_0x4f8697){return db['MailQueue'][_0x1540('0x4a')](_0x235abd[_0x1540('0x4b')],{})[_0x1540('0x29')](function(_0x4b09f2){var _0x49f437=_0x235abd[_0x1540('0x4c')][_0x1540('0x26')]({'plain':!![]});if(!_0x49f437)throw new Error(_0x1540('0x4d'));if(_0x49f437[_0x1540('0x4e')]===_0x1540('0x4c')){var _0x4c0f70=_0x4b09f2['get']({'plain':!![]});var _0x54b2f6='MailQueues';return db[_0x1540('0x4f')][_0x1540('0x49')]({'where':{'name':_0x54b2f6,'userProfileId':_0x49f437[_0x1540('0x50')]},'raw':!![]})['then'](function(_0x628146){if(_0x628146&&_0x628146['autoAssociation']===0x0){return db['UserProfileResource'][_0x1540('0x4a')]({'name':_0x4c0f70[_0x1540('0x2c')],'resourceId':_0x4c0f70['id'],'type':_0x628146[_0x1540('0x2c')],'sectionId':_0x628146['id']},{})['then'](function(){return _0x4b09f2;});}else{return _0x4b09f2;}})['catch'](function(_0x509673){logger[_0x1540('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x509673);throw _0x509673;});}return _0x4b09f2;})[_0x1540('0x29')](respondWithResult(_0x4f8697,0xc9))['catch'](handleError(_0x4f8697,null));};exports[_0x1540('0x24')]=function(_0x62fda9,_0x34e554){if(_0x62fda9[_0x1540('0x4b')]['id']){delete _0x62fda9[_0x1540('0x4b')]['id'];}return db[_0x1540('0x30')][_0x1540('0x49')]({'where':{'id':_0x62fda9[_0x1540('0x45')]['id']}})[_0x1540('0x29')](handleEntityNotFound(_0x34e554,null))[_0x1540('0x29')](saveUpdates(_0x62fda9[_0x1540('0x4b')],null))['then'](respondWithResult(_0x34e554,null))[_0x1540('0x44')](handleError(_0x34e554,null));};exports[_0x1540('0x25')]=function(_0x2b33c7,_0x201945){return db[_0x1540('0x30')][_0x1540('0x49')]({'where':{'id':_0x2b33c7[_0x1540('0x45')]['id']}})[_0x1540('0x29')](handleEntityNotFound(_0x201945,null))['then'](removeEntity(_0x201945,null))[_0x1540('0x44')](handleError(_0x201945,null));};exports['describe']=function(_0x36eddc,_0x3b5598){return db[_0x1540('0x30')][_0x1540('0x52')]()[_0x1540('0x29')](respondWithResult(_0x3b5598,null))[_0x1540('0x44')](handleError(_0x3b5598,null));};exports[_0x1540('0x53')]=function(_0x498df7,_0x13e355,_0x3b5ced){var _0x51a12a={'raw':!![],'where':{}},_0x31890c={},_0x12e3e4;return db[_0x1540('0x30')]['findOne']({'where':{'id':_0x498df7['params']['id']}})['then'](handleEntityNotFound(_0x13e355,null))['then'](function(_0x4fac03){if(_0x4fac03){_0x12e3e4=_0x4fac03[_0x1540('0x26')]({'plain':!![]});_0x31890c[_0x1540('0x33')]=_[_0x1540('0x35')](db[_0x1540('0x54')][_0x1540('0x46')]);_0x31890c['query']=_[_0x1540('0x35')](_0x498df7[_0x1540('0x34')]);_0x31890c['filters']=_['intersection'](_0x31890c[_0x1540('0x33')],_0x31890c[_0x1540('0x34')]);_0x51a12a[_0x1540('0x37')]=_['intersection'](_0x31890c[_0x1540('0x33')],qs[_0x1540('0x38')](_0x498df7[_0x1540('0x34')][_0x1540('0x38')]));_0x51a12a[_0x1540('0x37')]=_0x51a12a[_0x1540('0x37')][_0x1540('0x39')]?_0x51a12a[_0x1540('0x37')]:_0x31890c[_0x1540('0x33')];if(!_0x498df7['query'][_0x1540('0x55')]('nolimit')){_0x51a12a[_0x1540('0x20')]=qs[_0x1540('0x20')](_0x498df7[_0x1540('0x34')][_0x1540('0x20')]);_0x51a12a[_0x1540('0x3a')]=qs['offset'](_0x498df7[_0x1540('0x34')][_0x1540('0x3a')]);}_0x51a12a['order']=qs['sort'](_0x498df7[_0x1540('0x34')][_0x1540('0x3c')]);_0x51a12a[_0x1540('0x3d')]=qs[_0x1540('0x36')](_[_0x1540('0x3e')](_0x498df7[_0x1540('0x34')],_0x31890c[_0x1540('0x36')]));_0x51a12a['where'][_0x1540('0x56')]=_0x4fac03['id'];if(_0x498df7[_0x1540('0x34')]['filter']){_0x51a12a[_0x1540('0x3d')]=_[_0x1540('0x40')](_0x51a12a[_0x1540('0x3d')],{'$or':_[_0x1540('0x2f')](_0x51a12a[_0x1540('0x37')],function(_0x22c2ce){var _0x478356={};_0x478356[_0x22c2ce]={'$like':'%'+_0x498df7[_0x1540('0x34')][_0x1540('0x3f')]+'%'};return _0x478356;})});}_0x51a12a=_[_0x1540('0x40')]({},_0x51a12a,_0x498df7[_0x1540('0x48')]);return db['UserMailQueue'][_0x1540('0x43')](_0x51a12a);}})['then'](function(_0x4aee3a){if(_0x4aee3a){return db[_0x1540('0x57')][_0x1540('0x58')]({'where':{'id':_[_0x1540('0x2f')](_0x4aee3a,_0x1540('0x59')),'role':_0x1540('0x5a')},'attributes':['id','name',_0x1540('0x5b'),'updatedAt','createdAt']});}})[_0x1540('0x29')](function(_0x1140d7){if(_0x1140d7){return{'count':_0x1140d7[_0x1540('0x1f')],'rows':_[_0x1540('0x2f')](_0x1140d7[_0x1540('0x5c')],function(_0x516382){return{'membername':_0x516382[_0x1540('0x2c')],'UserId':_0x516382['id'],'queue_name':_0x12e3e4[_0x1540('0x2c')],'MailQueueId':_0x12e3e4['id'],'interface':util['format'](_0x1540('0x5d'),_0x1540('0x5e'),_0x516382[_0x1540('0x2c')]),'penalty':0x0,'paused':_0x516382[_0x1540('0x5b')],'createdAt':_0x516382[_0x1540('0x5f')],'updatedAt':_0x516382[_0x1540('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x13e355,_0x51a12a))['catch'](handleError(_0x13e355,null));};exports[_0x1540('0x61')]=function(_0x4c9166,_0x28f6a1,_0x132130){var _0x41126d={};var _0x52571e={};var _0x23e1bf;var _0x4ed000;return db[_0x1540('0x30')][_0x1540('0x62')]({'where':{'id':_0x4c9166['params']['id']}})['then'](handleEntityNotFound(_0x28f6a1,null))[_0x1540('0x29')](function(_0xee25cf){if(_0xee25cf){_0x23e1bf=_0xee25cf;_0x52571e[_0x1540('0x33')]=_[_0x1540('0x35')](db[_0x1540('0x63')]['rawAttributes']);_0x52571e['query']=_[_0x1540('0x35')](_0x4c9166[_0x1540('0x34')]);_0x52571e[_0x1540('0x36')]=_['intersection'](_0x52571e[_0x1540('0x33')],_0x52571e[_0x1540('0x34')]);_0x41126d[_0x1540('0x37')]=_[_0x1540('0x47')](_0x52571e[_0x1540('0x33')],qs['fields'](_0x4c9166[_0x1540('0x34')][_0x1540('0x38')]));_0x41126d[_0x1540('0x37')]=_0x41126d[_0x1540('0x37')][_0x1540('0x39')]?_0x41126d['attributes']:_0x52571e[_0x1540('0x33')];_0x41126d[_0x1540('0x3b')]=qs[_0x1540('0x3c')](_0x4c9166[_0x1540('0x34')]['sort']);_0x41126d[_0x1540('0x3d')]=qs[_0x1540('0x36')](_[_0x1540('0x3e')](_0x4c9166[_0x1540('0x34')],_0x52571e[_0x1540('0x36')]));if(_0x4c9166[_0x1540('0x34')]['filter']){_0x41126d[_0x1540('0x3d')]=_[_0x1540('0x40')](_0x41126d[_0x1540('0x3d')],{'$or':_[_0x1540('0x2f')](_0x41126d[_0x1540('0x37')],function(_0x5b0b2c){var _0x350358={};_0x350358[_0x5b0b2c]={'$like':'%'+_0x4c9166[_0x1540('0x34')]['filter']+'%'};return _0x350358;})});}_0x41126d=_[_0x1540('0x40')]({},_0x41126d,_0x4c9166[_0x1540('0x48')]);return _0x23e1bf[_0x1540('0x61')](_0x41126d);}})['then'](function(_0x921a33){if(_0x921a33){_0x4ed000=_0x921a33['length'];if(!_0x4c9166['query'][_0x1540('0x55')](_0x1540('0x64'))){_0x41126d[_0x1540('0x20')]=qs[_0x1540('0x20')](_0x4c9166[_0x1540('0x34')]['limit']);_0x41126d[_0x1540('0x3a')]=qs['offset'](_0x4c9166['query'][_0x1540('0x3a')]);}return _0x23e1bf[_0x1540('0x61')](_0x41126d);}})['then'](function(_0x17a132){if(_0x17a132){return _0x17a132?{'count':_0x4ed000,'rows':_0x17a132}:null;}})[_0x1540('0x29')](respondWithResult(_0x28f6a1,null))[_0x1540('0x44')](handleError(_0x28f6a1,null));};exports[_0x1540('0x65')]=function(_0x5a4f8f,_0x4a3381,_0x1ead43){var _0x192e90=_0x5a4f8f[_0x1540('0x4b')][_0x1540('0x66')];return db[_0x1540('0x63')][_0x1540('0x43')]({'where':{'id':_0x192e90},'attributes':['id'],'include':[{'model':db[_0x1540('0x57')],'as':_0x1540('0x67'),'attributes':['id',_0x1540('0x2c'),_0x1540('0x68'),'voicePause','interface'],'raw':!![]}]})[_0x1540('0x29')](function(_0x53b737){if(_0x53b737){var _0x246413=_[_0x1540('0x69')](_0x53b737,function(_0x31482c){var _0x23a7f1=_0x31482c[_0x1540('0x26')]({'plain':!![]});return _0x23a7f1[_0x1540('0x67')];});return db['MailQueue'][_0x1540('0x49')]({'where':{'id':_0x5a4f8f[_0x1540('0x45')]['id']}})[_0x1540('0x29')](function(_0x56596a){return db[_0x1540('0x6a')]['transaction'](function(_0x31987d){return _0x56596a[_0x1540('0x65')](_0x192e90,{'transaction':_0x31987d})['then'](function(){return BPromise[_0x1540('0x6b')](_0x246413,function(_0x4a3364){return db['UserMailQueue'][_0x1540('0x6c')]({'where':{'UserId':_0x4a3364['id'],'MailQueueId':_0x5a4f8f[_0x1540('0x45')]['id']},'transaction':_0x31987d});});})[_0x1540('0x29')](function(){_0x246413[_0x1540('0x6d')](function(_0x9d0067){socket[_0x1540('0x6e')]('userMailQueue:save',{'UserId':_0x9d0067['id'],'MailQueueId':_0x56596a['id']});});});});});}})['then'](respondWithStatusCode(_0x4a3381,null))['catch'](handleError(_0x4a3381,null));};exports['removeTeams']=function(_0xbb452d,_0x499167,_0xfb89ee){return db[_0x1540('0x63')][_0x1540('0x43')]({'where':{'id':_0xbb452d['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x1540('0x57')],'as':_0x1540('0x67'),'attributes':['id'],'raw':!![]}]})[_0x1540('0x29')](handleEntityNotFound(_0x499167,null))[_0x1540('0x29')](function(_0x530593){var _0x3de67a=_[_0x1540('0x2f')](_0x530593,'id');var _0x485e4f=[];var _0x390840=[];var _0x25ebcb=squel['select']();_0x25ebcb[_0x1540('0x6f')](_0x1540('0x70'))[_0x1540('0x71')](_0x1540('0x72'),'tq')[_0x1540('0x73')]('user_has_teams','ut',_0x1540('0x74'))[_0x1540('0x3d')](_0x1540('0x75'),_0xbb452d[_0x1540('0x45')]['id']);for(var _0x570bae=0x0;_0x570bae<_0x530593['length'];_0x570bae+=0x1){let _0x34d89f=_0x530593[_0x570bae];for(var _0x2c00e0=0x0;_0x2c00e0<_0x34d89f['Agents'][_0x1540('0x39')];_0x2c00e0+=0x1){let _0x4b904c=_0x34d89f[_0x1540('0x67')][_0x2c00e0];var _0xd4ed22=_0x25ebcb[_0x1540('0x76')]();_0xd4ed22[_0x1540('0x3d')](_0x1540('0x77'),_0x4b904c['id']);_0x390840['push'](db[_0x1540('0x6a')][_0x1540('0x34')](_0xd4ed22['toString'](),{'type':db['sequelize'][_0x1540('0x78')][_0x1540('0x79')]})['then'](function(_0x156ba5){if(_0x156ba5['length']===0x1){return _0x4b904c['id'];}else{var _0x50286b=_['every'](_[_0x1540('0x2f')](_0x156ba5,_0x1540('0x7a')),function(_0xf8891c){return _[_0x1540('0x7b')](_0x3de67a,_0xf8891c);});if(_0x50286b){return _0x4b904c['id'];}}}));}}return BPromise[_0x1540('0x7c')](_0x390840)[_0x1540('0x29')](function(_0x2cad5d){_0x485e4f=_(_0x485e4f)[_0x1540('0x7d')](_0x2cad5d)[_0x1540('0x7e')]()['value']();return db[_0x1540('0x30')][_0x1540('0x49')]({'where':{'id':_0xbb452d[_0x1540('0x45')]['id']}})[_0x1540('0x29')](function(_0x428209){return db[_0x1540('0x6a')][_0x1540('0x7f')](function(_0x265a5f){return _0x428209['removeTeams'](_0xbb452d['query']['ids'],{'transaction':_0x265a5f})[_0x1540('0x29')](function(){if(!_[_0x1540('0x80')](_0x485e4f)){return _0x428209[_0x1540('0x81')](_0x485e4f,{'transaction':_0x265a5f});}})['then'](function(){_0x485e4f[_0x1540('0x6d')](function(_0x22ad82){socket[_0x1540('0x6e')]('userMailQueue:remove',{'UserId':_0x22ad82,'MailQueueId':_0x428209['id']});});});});});});})[_0x1540('0x29')](respondWithStatusCode(_0x499167,null))[_0x1540('0x44')](handleError(_0x499167,null));};exports[_0x1540('0x82')]=function(_0x2452de,_0x130bea,_0x1390ef){return db['MailQueue'][_0x1540('0x49')]({'where':{'id':_0x2452de[_0x1540('0x45')]['id']}})[_0x1540('0x29')](handleEntityNotFound(_0x130bea,null))['then'](function(_0x2b202c){if(_0x2b202c){return _0x2b202c[_0x1540('0x82')](_0x2452de['body'][_0x1540('0x66')],_['omit'](_0x2452de[_0x1540('0x4b')],['ids','id'])||{})[_0x1540('0x83')](function(_0x570b4e){for(var _0x10ac45=0x0;_0x10ac45<_0x2452de[_0x1540('0x4b')]['ids'][_0x1540('0x39')];_0x10ac45+=0x1){socket[_0x1540('0x6e')](_0x1540('0x84'),{'UserId':_0x2452de[_0x1540('0x4b')][_0x1540('0x66')][_0x10ac45],'MailQueueId':_0x2452de[_0x1540('0x45')]['id']});}return _0x570b4e;});}})[_0x1540('0x29')](respondWithResult(_0x130bea,null))[_0x1540('0x44')](handleError(_0x130bea,null));};exports[_0x1540('0x81')]=function(_0x1f01ae,_0x5f8359,_0xedaaae){return db[_0x1540('0x30')][_0x1540('0x49')]({'where':{'id':_0x1f01ae[_0x1540('0x45')]['id']}})[_0x1540('0x29')](handleEntityNotFound(_0x5f8359,null))[_0x1540('0x29')](function(_0x10edfb){if(_0x10edfb){return _0x10edfb[_0x1540('0x81')](_0x1f01ae[_0x1540('0x34')][_0x1540('0x66')])[_0x1540('0x29')](function(){if(_[_0x1540('0x85')](_0x1f01ae[_0x1540('0x34')]['ids'])){for(var _0x12dab7=0x0;_0x12dab7<_0x1f01ae[_0x1540('0x34')]['ids'][_0x1540('0x39')];_0x12dab7+=0x1){socket['emit'](_0x1540('0x86'),{'UserId':Number(_0x1f01ae[_0x1540('0x34')][_0x1540('0x66')][_0x12dab7]),'MailQueueId':Number(_0x1f01ae[_0x1540('0x45')]['id'])});}}else{socket[_0x1540('0x6e')](_0x1540('0x86'),{'UserId':Number(_0x1f01ae[_0x1540('0x34')][_0x1540('0x66')]),'MailQueueId':Number(_0x1f01ae['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5f8359,null))[_0x1540('0x44')](handleError(_0x5f8359,null));};exports[_0x1540('0x87')]=function(_0x58f6b5,_0x44879e,_0x3d8d59){var _0x1dce57={};var _0x406ad8={};var _0x5b3a21;var _0x39b135;return db[_0x1540('0x30')][_0x1540('0x62')]({'where':{'id':_0x58f6b5[_0x1540('0x45')]['id']}})[_0x1540('0x29')](handleEntityNotFound(_0x44879e,null))['then'](function(_0x5ed2a2){if(_0x5ed2a2){_0x5b3a21=_0x5ed2a2;_0x406ad8['model']=_['keys'](db[_0x1540('0x57')]['rawAttributes']);_0x406ad8[_0x1540('0x34')]=_['keys'](_0x58f6b5['query']);_0x406ad8[_0x1540('0x36')]=_[_0x1540('0x47')](_0x406ad8[_0x1540('0x33')],_0x406ad8['query']);_0x1dce57[_0x1540('0x37')]=_['intersection'](_0x406ad8[_0x1540('0x33')],qs[_0x1540('0x38')](_0x58f6b5['query']['fields']));_0x1dce57[_0x1540('0x37')]=_0x1dce57[_0x1540('0x37')][_0x1540('0x39')]?_0x1dce57[_0x1540('0x37')]:_0x406ad8[_0x1540('0x33')];_0x1dce57['order']=qs[_0x1540('0x3c')](_0x58f6b5[_0x1540('0x34')]['sort']);_0x1dce57[_0x1540('0x3d')]=qs['filters'](_[_0x1540('0x3e')](_0x58f6b5[_0x1540('0x34')],_0x406ad8[_0x1540('0x36')]));if(_0x58f6b5[_0x1540('0x34')][_0x1540('0x3f')]){_0x1dce57[_0x1540('0x3d')]=_[_0x1540('0x40')](_0x1dce57[_0x1540('0x3d')],{'$or':_[_0x1540('0x2f')](_0x1dce57[_0x1540('0x37')],function(_0x3f8c2e){var _0x49f5c1={};_0x49f5c1[_0x3f8c2e]={'$like':'%'+_0x58f6b5['query'][_0x1540('0x3f')]+'%'};return _0x49f5c1;})});}_0x1dce57=_[_0x1540('0x40')]({},_0x1dce57,_0x58f6b5['options']);return _0x5b3a21['getAgents'](_0x1dce57);}})[_0x1540('0x29')](function(_0x1bf1a9){if(_0x1bf1a9){_0x39b135=_0x1bf1a9[_0x1540('0x39')];if(!_0x58f6b5[_0x1540('0x34')][_0x1540('0x55')](_0x1540('0x64'))){_0x1dce57['limit']=qs[_0x1540('0x20')](_0x58f6b5[_0x1540('0x34')][_0x1540('0x20')]);_0x1dce57[_0x1540('0x3a')]=qs[_0x1540('0x3a')](_0x58f6b5['query'][_0x1540('0x3a')]);}return _0x5b3a21[_0x1540('0x87')](_0x1dce57);}})[_0x1540('0x29')](function(_0x5767da){if(_0x5767da){return _0x5767da?{'count':_0x39b135,'rows':_0x5767da}:null;}})[_0x1540('0x29')](respondWithResult(_0x44879e,null))[_0x1540('0x44')](handleError(_0x44879e,null));}; \ No newline at end of file +var _0x7c59=['end','status','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','UserProfileResource','stack','send','map','MailQueue','rawAttributes','type','key','model','name','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','fields','create','body','user','get','MailQueues','UserProfileSection','find','userProfileId','error','describe','getMembers','findOne','UserMailQueue','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','includes','union','compact','value','isEmpty','removeAgents','forEach','emit','userMailQueue:remove','omit','spread','userMailQueue:save','isArray','getAgents','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','sendStatus'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x7c59,0xf5));var _0x97c5=function(_0x420411,_0x3ad213){_0x420411=_0x420411-0x0;var _0x2561c0=_0x7c59[_0x420411];return _0x2561c0;};'use strict';var pdf=require(_0x97c5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x97c5('0x1'));var zipdir=require(_0x97c5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x97c5('0x3'));var moment=require(_0x97c5('0x4'));var BPromise=require(_0x97c5('0x5'));var Mustache=require(_0x97c5('0x6'));var util=require(_0x97c5('0x7'));var path=require(_0x97c5('0x8'));var sox=require(_0x97c5('0x9'));var csv=require(_0x97c5('0xa'));var ejs=require(_0x97c5('0xb'));var fs=require('fs');var _=require(_0x97c5('0xc'));var squel=require(_0x97c5('0xd'));var crypto=require(_0x97c5('0xe'));var jsforce=require(_0x97c5('0xf'));var deskjs=require(_0x97c5('0x10'));var toCsv=require('to-csv');var querystring=require(_0x97c5('0x11'));var Papa=require(_0x97c5('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x97c5('0x13'));var hardwareService=require(_0x97c5('0x14'));var logger=require(_0x97c5('0x15'))(_0x97c5('0x16'));var utils=require(_0x97c5('0x17'));var config=require(_0x97c5('0x18'));var db=require('../../mysqldb')['db'];config[_0x97c5('0x19')]=_[_0x97c5('0x1a')](config['redis'],{'host':_0x97c5('0x1b'),'port':0x18eb});var socket=require(_0x97c5('0x1c'))(new Redis(config['redis']));require(_0x97c5('0x1d'))['register'](socket);function respondWithStatusCode(_0x217cb1,_0x585a37){_0x585a37=_0x585a37||0xcc;return function(_0x153ca7){if(_0x153ca7){return _0x217cb1[_0x97c5('0x1e')](_0x585a37);}return _0x217cb1['status'](_0x585a37)[_0x97c5('0x1f')]();};}function respondWithResult(_0x559568,_0x29c11c){_0x29c11c=_0x29c11c||0xc8;return function(_0x1f9775){if(_0x1f9775){return _0x559568[_0x97c5('0x20')](_0x29c11c)[_0x97c5('0x21')](_0x1f9775);}};}function respondWithFilteredResult(_0x2bd43d,_0x3f295c){return function(_0x3d7068){if(_0x3d7068){var _0xa31e07=_0x3d7068[_0x97c5('0x22')],_0x11baa9=_0x3f295c[_0x97c5('0x23')],_0x35aa14=_0x3f295c['offset']+_0x3f295c[_0x97c5('0x24')],_0x2507ae;if(_0x35aa14>=_0xa31e07){_0x35aa14=_0xa31e07;_0x2507ae=0xc8;}else{_0x2507ae=0xce;}_0x2bd43d[_0x97c5('0x20')](_0x2507ae);return _0x2bd43d['set'](_0x97c5('0x25'),_0x11baa9+'-'+_0x35aa14+'/'+_0xa31e07)['json'](_0x3d7068);}return null;};}function patchUpdates(_0x50b17b){return function(_0x30bd76){try{jsonpatch[_0x97c5('0x26')](_0x30bd76,_0x50b17b,!![]);}catch(_0x385af5){return BPromise[_0x97c5('0x27')](_0x385af5);}return _0x30bd76[_0x97c5('0x28')]();};}function saveUpdates(_0x21e13f,_0x1e7010){return function(_0x52d95b){if(_0x52d95b){return _0x52d95b['update'](_0x21e13f)[_0x97c5('0x29')](function(_0x54c905){return _0x54c905;});}return null;};}function removeEntity(_0x5d1ceb,_0x15cea9){return function(_0x1bbf5e){if(_0x1bbf5e){return _0x1bbf5e[_0x97c5('0x2a')]()[_0x97c5('0x29')](function(){var _0x353db3=_0x1bbf5e['get']({'plain':!![]});var _0xf4bf82='MailQueues';return db[_0x97c5('0x2b')][_0x97c5('0x2a')]({'where':{'type':_0xf4bf82,'resourceId':_0x353db3['id']}})[_0x97c5('0x29')](function(){return _0x1bbf5e;});})['then'](function(){_0x5d1ceb[_0x97c5('0x20')](0xcc)[_0x97c5('0x1f')]();});}};}function handleEntityNotFound(_0x2c8fc6,_0x5a0f33){return function(_0x10eab9){if(!_0x10eab9){_0x2c8fc6[_0x97c5('0x1e')](0x194);}return _0x10eab9;};}function handleError(_0xed973a,_0x4625d7){_0x4625d7=_0x4625d7||0x1f4;return function(_0x2fd949){logger['error'](_0x2fd949[_0x97c5('0x2c')]);if(_0x2fd949['name']){delete _0x2fd949['name'];}_0xed973a[_0x97c5('0x20')](_0x4625d7)[_0x97c5('0x2d')](_0x2fd949);};}exports['index']=function(_0x5f5384,_0x2565b2){var _0x45246d={},_0x5dc3e0={},_0x59bde4={'count':0x0,'rows':[]};var _0x5ca1ac=_[_0x97c5('0x2e')](db[_0x97c5('0x2f')][_0x97c5('0x30')],function(_0x33558c){return{'name':_0x33558c['fieldName'],'type':_0x33558c[_0x97c5('0x31')][_0x97c5('0x32')]};});_0x5dc3e0[_0x97c5('0x33')]=_[_0x97c5('0x2e')](_0x5ca1ac,_0x97c5('0x34'));_0x5dc3e0[_0x97c5('0x35')]=_['keys'](_0x5f5384[_0x97c5('0x35')]);_0x5dc3e0[_0x97c5('0x36')]=_['intersection'](_0x5dc3e0[_0x97c5('0x33')],_0x5dc3e0[_0x97c5('0x35')]);_0x45246d[_0x97c5('0x37')]=_[_0x97c5('0x38')](_0x5dc3e0[_0x97c5('0x33')],qs['fields'](_0x5f5384[_0x97c5('0x35')]['fields']));_0x45246d[_0x97c5('0x37')]=_0x45246d[_0x97c5('0x37')][_0x97c5('0x39')]?_0x45246d[_0x97c5('0x37')]:_0x5dc3e0['model'];if(!_0x5f5384[_0x97c5('0x35')][_0x97c5('0x3a')](_0x97c5('0x3b'))){_0x45246d[_0x97c5('0x24')]=qs['limit'](_0x5f5384[_0x97c5('0x35')][_0x97c5('0x24')]);_0x45246d[_0x97c5('0x23')]=qs['offset'](_0x5f5384['query'][_0x97c5('0x23')]);}_0x45246d[_0x97c5('0x3c')]=qs[_0x97c5('0x3d')](_0x5f5384[_0x97c5('0x35')][_0x97c5('0x3d')]);_0x45246d[_0x97c5('0x3e')]=qs[_0x97c5('0x36')](_[_0x97c5('0x3f')](_0x5f5384[_0x97c5('0x35')],_0x5dc3e0['filters']));if(_0x5f5384[_0x97c5('0x35')][_0x97c5('0x40')]){_0x45246d['where']=_[_0x97c5('0x41')](_0x45246d[_0x97c5('0x3e')],{'$or':_[_0x97c5('0x2e')](_0x5ca1ac,function(_0x43285a){if(_0x43285a['type']!==_0x97c5('0x42')){var _0x5f4266={};_0x5f4266[_0x43285a['name']]={'$like':'%'+_0x5f5384[_0x97c5('0x35')]['filter']+'%'};return _0x5f4266;}})});}_0x45246d=_['merge']({},_0x45246d,_0x5f5384[_0x97c5('0x43')]);var _0x311c84={'where':_0x45246d[_0x97c5('0x3e')]};return db['MailQueue'][_0x97c5('0x22')](_0x311c84)['then'](function(_0x20ba86){_0x59bde4['count']=_0x20ba86;if(_0x5f5384[_0x97c5('0x35')][_0x97c5('0x44')]){_0x45246d['include']=[{'all':!![]}];}return db[_0x97c5('0x2f')][_0x97c5('0x45')](_0x45246d);})[_0x97c5('0x29')](function(_0x21a858){_0x59bde4[_0x97c5('0x46')]=_0x21a858;return _0x59bde4;})[_0x97c5('0x29')](respondWithFilteredResult(_0x2565b2,_0x45246d))[_0x97c5('0x47')](handleError(_0x2565b2,null));};exports['show']=function(_0x2c69f4,_0x1864d3){var _0x100015={'raw':!![],'where':{'id':_0x2c69f4[_0x97c5('0x48')]['id']}},_0x41fbf4={};_0x41fbf4[_0x97c5('0x33')]=_[_0x97c5('0x49')](db[_0x97c5('0x2f')][_0x97c5('0x30')]);_0x41fbf4[_0x97c5('0x35')]=_[_0x97c5('0x49')](_0x2c69f4['query']);_0x41fbf4[_0x97c5('0x36')]=_[_0x97c5('0x38')](_0x41fbf4['model'],_0x41fbf4[_0x97c5('0x35')]);_0x100015[_0x97c5('0x37')]=_['intersection'](_0x41fbf4[_0x97c5('0x33')],qs[_0x97c5('0x4a')](_0x2c69f4[_0x97c5('0x35')][_0x97c5('0x4a')]));_0x100015[_0x97c5('0x37')]=_0x100015[_0x97c5('0x37')][_0x97c5('0x39')]?_0x100015['attributes']:_0x41fbf4[_0x97c5('0x33')];if(_0x2c69f4[_0x97c5('0x35')]['includeAll']){_0x100015['include']=[{'all':!![]}];}_0x100015=_['merge']({},_0x100015,_0x2c69f4[_0x97c5('0x43')]);return db[_0x97c5('0x2f')]['find'](_0x100015)[_0x97c5('0x29')](handleEntityNotFound(_0x1864d3,null))[_0x97c5('0x29')](respondWithResult(_0x1864d3,null))[_0x97c5('0x47')](handleError(_0x1864d3,null));};exports[_0x97c5('0x4b')]=function(_0x4ab212,_0x5c20f0){return db['MailQueue'][_0x97c5('0x4b')](_0x4ab212[_0x97c5('0x4c')],{})['then'](function(_0x5eb75d){var _0x58b89a=_0x4ab212[_0x97c5('0x4d')]['get']({'plain':!![]});if(!_0x58b89a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58b89a['role']==='user'){var _0x3a3f36=_0x5eb75d[_0x97c5('0x4e')]({'plain':!![]});var _0x458eec=_0x97c5('0x4f');return db[_0x97c5('0x50')][_0x97c5('0x51')]({'where':{'name':_0x458eec,'userProfileId':_0x58b89a[_0x97c5('0x52')]},'raw':!![]})[_0x97c5('0x29')](function(_0x10000e){if(_0x10000e&&_0x10000e['autoAssociation']===0x0){return db['UserProfileResource'][_0x97c5('0x4b')]({'name':_0x3a3f36[_0x97c5('0x34')],'resourceId':_0x3a3f36['id'],'type':_0x10000e['name'],'sectionId':_0x10000e['id']},{})['then'](function(){return _0x5eb75d;});}else{return _0x5eb75d;}})[_0x97c5('0x47')](function(_0x1c008a){logger[_0x97c5('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c008a);throw _0x1c008a;});}return _0x5eb75d;})[_0x97c5('0x29')](respondWithResult(_0x5c20f0,0xc9))[_0x97c5('0x47')](handleError(_0x5c20f0,null));};exports['update']=function(_0x383229,_0xaab313){if(_0x383229[_0x97c5('0x4c')]['id']){delete _0x383229['body']['id'];}return db['MailQueue']['find']({'where':{'id':_0x383229[_0x97c5('0x48')]['id']}})[_0x97c5('0x29')](handleEntityNotFound(_0xaab313,null))[_0x97c5('0x29')](saveUpdates(_0x383229[_0x97c5('0x4c')],null))['then'](respondWithResult(_0xaab313,null))['catch'](handleError(_0xaab313,null));};exports[_0x97c5('0x2a')]=function(_0x1e86be,_0x9c5576){return db[_0x97c5('0x2f')][_0x97c5('0x51')]({'where':{'id':_0x1e86be[_0x97c5('0x48')]['id']}})[_0x97c5('0x29')](handleEntityNotFound(_0x9c5576,null))[_0x97c5('0x29')](removeEntity(_0x9c5576,null))[_0x97c5('0x47')](handleError(_0x9c5576,null));};exports[_0x97c5('0x54')]=function(_0x41fea0,_0x4744a3){return db[_0x97c5('0x2f')][_0x97c5('0x54')]()['then'](respondWithResult(_0x4744a3,null))[_0x97c5('0x47')](handleError(_0x4744a3,null));};exports[_0x97c5('0x55')]=function(_0x51644b,_0x5551af,_0x432e71){var _0x280d38={'raw':!![],'where':{}},_0x2808cc={},_0x190bc0;return db[_0x97c5('0x2f')][_0x97c5('0x56')]({'where':{'id':_0x51644b[_0x97c5('0x48')]['id']}})[_0x97c5('0x29')](handleEntityNotFound(_0x5551af,null))['then'](function(_0x52bac8){if(_0x52bac8){_0x190bc0=_0x52bac8[_0x97c5('0x4e')]({'plain':!![]});_0x2808cc[_0x97c5('0x33')]=_[_0x97c5('0x49')](db[_0x97c5('0x57')][_0x97c5('0x30')]);_0x2808cc['query']=_[_0x97c5('0x49')](_0x51644b[_0x97c5('0x35')]);_0x2808cc[_0x97c5('0x36')]=_[_0x97c5('0x38')](_0x2808cc[_0x97c5('0x33')],_0x2808cc[_0x97c5('0x35')]);_0x280d38['attributes']=_[_0x97c5('0x38')](_0x2808cc[_0x97c5('0x33')],qs['fields'](_0x51644b['query'][_0x97c5('0x4a')]));_0x280d38['attributes']=_0x280d38['attributes'][_0x97c5('0x39')]?_0x280d38[_0x97c5('0x37')]:_0x2808cc[_0x97c5('0x33')];if(!_0x51644b['query'][_0x97c5('0x3a')]('nolimit')){_0x280d38[_0x97c5('0x24')]=qs['limit'](_0x51644b['query'][_0x97c5('0x24')]);_0x280d38['offset']=qs[_0x97c5('0x23')](_0x51644b[_0x97c5('0x35')][_0x97c5('0x23')]);}_0x280d38['order']=qs[_0x97c5('0x3d')](_0x51644b[_0x97c5('0x35')][_0x97c5('0x3d')]);_0x280d38[_0x97c5('0x3e')]=qs[_0x97c5('0x36')](_['pick'](_0x51644b['query'],_0x2808cc[_0x97c5('0x36')]));_0x280d38[_0x97c5('0x3e')]['MailQueueId']=_0x52bac8['id'];if(_0x51644b[_0x97c5('0x35')][_0x97c5('0x40')]){_0x280d38[_0x97c5('0x3e')]=_[_0x97c5('0x41')](_0x280d38[_0x97c5('0x3e')],{'$or':_[_0x97c5('0x2e')](_0x280d38['attributes'],function(_0x535706){var _0x53611a={};_0x53611a[_0x535706]={'$like':'%'+_0x51644b[_0x97c5('0x35')]['filter']+'%'};return _0x53611a;})});}_0x280d38=_[_0x97c5('0x41')]({},_0x280d38,_0x51644b['options']);return db[_0x97c5('0x57')]['findAll'](_0x280d38);}})['then'](function(_0x308695){if(_0x308695){return db[_0x97c5('0x58')][_0x97c5('0x59')]({'where':{'id':_[_0x97c5('0x2e')](_0x308695,_0x97c5('0x5a')),'role':_0x97c5('0x5b')},'attributes':['id',_0x97c5('0x34'),_0x97c5('0x5c'),_0x97c5('0x5d'),_0x97c5('0x5e')]});}})['then'](function(_0x8d2bb5){if(_0x8d2bb5){return{'count':_0x8d2bb5[_0x97c5('0x22')],'rows':_[_0x97c5('0x2e')](_0x8d2bb5[_0x97c5('0x46')],function(_0x1e86bf){return{'membername':_0x1e86bf[_0x97c5('0x34')],'UserId':_0x1e86bf['id'],'queue_name':_0x190bc0[_0x97c5('0x34')],'MailQueueId':_0x190bc0['id'],'interface':util[_0x97c5('0x5f')]('%s/%s',_0x97c5('0x60'),_0x1e86bf[_0x97c5('0x34')]),'penalty':0x0,'paused':_0x1e86bf['mailPause'],'createdAt':_0x1e86bf['createdAt'],'updatedAt':_0x1e86bf[_0x97c5('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x97c5('0x29')](respondWithFilteredResult(_0x5551af,_0x280d38))[_0x97c5('0x47')](handleError(_0x5551af,null));};exports[_0x97c5('0x61')]=function(_0x2ca0bc,_0x858f13,_0xae366c){var _0x564f0c={};var _0x51f4c1={};var _0x403664;var _0x4e03c8;return db[_0x97c5('0x2f')][_0x97c5('0x56')]({'where':{'id':_0x2ca0bc[_0x97c5('0x48')]['id']}})[_0x97c5('0x29')](handleEntityNotFound(_0x858f13,null))[_0x97c5('0x29')](function(_0x4a2523){if(_0x4a2523){_0x403664=_0x4a2523;_0x51f4c1[_0x97c5('0x33')]=_[_0x97c5('0x49')](db[_0x97c5('0x62')][_0x97c5('0x30')]);_0x51f4c1[_0x97c5('0x35')]=_[_0x97c5('0x49')](_0x2ca0bc[_0x97c5('0x35')]);_0x51f4c1[_0x97c5('0x36')]=_[_0x97c5('0x38')](_0x51f4c1[_0x97c5('0x33')],_0x51f4c1[_0x97c5('0x35')]);_0x564f0c[_0x97c5('0x37')]=_[_0x97c5('0x38')](_0x51f4c1[_0x97c5('0x33')],qs[_0x97c5('0x4a')](_0x2ca0bc[_0x97c5('0x35')][_0x97c5('0x4a')]));_0x564f0c[_0x97c5('0x37')]=_0x564f0c[_0x97c5('0x37')][_0x97c5('0x39')]?_0x564f0c['attributes']:_0x51f4c1[_0x97c5('0x33')];_0x564f0c[_0x97c5('0x3c')]=qs[_0x97c5('0x3d')](_0x2ca0bc[_0x97c5('0x35')][_0x97c5('0x3d')]);_0x564f0c[_0x97c5('0x3e')]=qs[_0x97c5('0x36')](_[_0x97c5('0x3f')](_0x2ca0bc[_0x97c5('0x35')],_0x51f4c1[_0x97c5('0x36')]));if(_0x2ca0bc['query'][_0x97c5('0x40')]){_0x564f0c['where']=_[_0x97c5('0x41')](_0x564f0c[_0x97c5('0x3e')],{'$or':_[_0x97c5('0x2e')](_0x564f0c[_0x97c5('0x37')],function(_0x4cc4d8){var _0x598bd9={};_0x598bd9[_0x4cc4d8]={'$like':'%'+_0x2ca0bc[_0x97c5('0x35')][_0x97c5('0x40')]+'%'};return _0x598bd9;})});}_0x564f0c=_[_0x97c5('0x41')]({},_0x564f0c,_0x2ca0bc[_0x97c5('0x43')]);return _0x403664['getTeams'](_0x564f0c);}})[_0x97c5('0x29')](function(_0x44855d){if(_0x44855d){_0x4e03c8=_0x44855d[_0x97c5('0x39')];if(!_0x2ca0bc[_0x97c5('0x35')][_0x97c5('0x3a')](_0x97c5('0x3b'))){_0x564f0c[_0x97c5('0x24')]=qs['limit'](_0x2ca0bc[_0x97c5('0x35')]['limit']);_0x564f0c['offset']=qs['offset'](_0x2ca0bc[_0x97c5('0x35')][_0x97c5('0x23')]);}return _0x403664[_0x97c5('0x61')](_0x564f0c);}})[_0x97c5('0x29')](function(_0x16a601){if(_0x16a601){return _0x16a601?{'count':_0x4e03c8,'rows':_0x16a601}:null;}})['then'](respondWithResult(_0x858f13,null))[_0x97c5('0x47')](handleError(_0x858f13,null));};exports[_0x97c5('0x63')]=function(_0x1c73f3,_0x34e96b,_0x572e56){var _0x272550=_0x1c73f3[_0x97c5('0x4c')][_0x97c5('0x64')];return db[_0x97c5('0x62')][_0x97c5('0x45')]({'where':{'id':_0x272550},'attributes':['id'],'include':[{'model':db[_0x97c5('0x58')],'as':'Agents','attributes':['id','name',_0x97c5('0x65'),_0x97c5('0x66'),_0x97c5('0x67')],'raw':!![]}]})[_0x97c5('0x29')](function(_0x56ce84){if(_0x56ce84){var _0x1ee34b=_[_0x97c5('0x68')](_0x56ce84,function(_0x53b6db){var _0x47d577=_0x53b6db[_0x97c5('0x4e')]({'plain':!![]});return _0x47d577[_0x97c5('0x69')];});return db[_0x97c5('0x2f')][_0x97c5('0x51')]({'where':{'id':_0x1c73f3[_0x97c5('0x48')]['id']}})[_0x97c5('0x29')](function(_0x257352){return db[_0x97c5('0x6a')][_0x97c5('0x6b')](function(_0x1d5265){return _0x257352['addTeams'](_0x272550,{'transaction':_0x1d5265})[_0x97c5('0x29')](function(){return BPromise[_0x97c5('0x6c')](_0x1ee34b,function(_0x3615a7){return db[_0x97c5('0x57')][_0x97c5('0x6d')]({'where':{'UserId':_0x3615a7['id'],'MailQueueId':_0x1c73f3[_0x97c5('0x48')]['id']},'transaction':_0x1d5265});});})['then'](function(){_0x1ee34b['forEach'](function(_0x1b94d2){socket['emit']('userMailQueue:save',{'UserId':_0x1b94d2['id'],'MailQueueId':_0x257352['id']});});});});});}})[_0x97c5('0x29')](respondWithStatusCode(_0x34e96b,null))['catch'](handleError(_0x34e96b,null));};exports[_0x97c5('0x6e')]=function(_0x10eb61,_0x211b1e,_0x3105ef){return db[_0x97c5('0x62')][_0x97c5('0x45')]({'where':{'id':_0x10eb61[_0x97c5('0x35')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x97c5('0x29')](handleEntityNotFound(_0x211b1e,null))[_0x97c5('0x29')](function(_0x35579b){var _0x391991=_[_0x97c5('0x2e')](_0x35579b,'id');var _0x47f34a=[];var _0x36b7de=[];var _0x203e16=squel[_0x97c5('0x6f')]();_0x203e16[_0x97c5('0x70')](_0x97c5('0x71'))[_0x97c5('0x72')](_0x97c5('0x73'),'tq')['join'](_0x97c5('0x74'),'ut',_0x97c5('0x75'))[_0x97c5('0x3e')]('MailQueueId\x20=\x20?',_0x10eb61[_0x97c5('0x48')]['id']);for(var _0xf08da4=0x0;_0xf08da4<_0x35579b[_0x97c5('0x39')];_0xf08da4+=0x1){let _0xe78902=_0x35579b[_0xf08da4];for(var _0x223ff3=0x0;_0x223ff3<_0xe78902[_0x97c5('0x69')][_0x97c5('0x39')];_0x223ff3+=0x1){let _0xcbfc06=_0xe78902[_0x97c5('0x69')][_0x223ff3];var _0x4881f9=_0x203e16[_0x97c5('0x76')]();_0x4881f9[_0x97c5('0x3e')](_0x97c5('0x77'),_0xcbfc06['id']);_0x36b7de[_0x97c5('0x78')](db[_0x97c5('0x6a')][_0x97c5('0x35')](_0x4881f9['toString'](),{'type':db['sequelize'][_0x97c5('0x79')][_0x97c5('0x7a')]})['then'](function(_0x509713){if(_0x509713[_0x97c5('0x39')]===0x1){return _0xcbfc06['id'];}else{var _0x175604=_['every'](_[_0x97c5('0x2e')](_0x509713,_0x97c5('0x7b')),function(_0xf7a802){return _[_0x97c5('0x7c')](_0x391991,_0xf7a802);});if(_0x175604){return _0xcbfc06['id'];}}}));}}return BPromise['all'](_0x36b7de)[_0x97c5('0x29')](function(_0x539f26){_0x47f34a=_(_0x47f34a)[_0x97c5('0x7d')](_0x539f26)[_0x97c5('0x7e')]()[_0x97c5('0x7f')]();return db[_0x97c5('0x2f')][_0x97c5('0x51')]({'where':{'id':_0x10eb61[_0x97c5('0x48')]['id']}})[_0x97c5('0x29')](function(_0x35cd90){return db[_0x97c5('0x6a')]['transaction'](function(_0x443e23){return _0x35cd90[_0x97c5('0x6e')](_0x10eb61[_0x97c5('0x35')]['ids'],{'transaction':_0x443e23})['then'](function(){if(!_[_0x97c5('0x80')](_0x47f34a)){return _0x35cd90[_0x97c5('0x81')](_0x47f34a,{'transaction':_0x443e23});}})['then'](function(){_0x47f34a[_0x97c5('0x82')](function(_0x7fc451){socket[_0x97c5('0x83')](_0x97c5('0x84'),{'UserId':_0x7fc451,'MailQueueId':_0x35cd90['id']});});});});});});})['then'](respondWithStatusCode(_0x211b1e,null))['catch'](handleError(_0x211b1e,null));};exports['addAgents']=function(_0x4ac1e7,_0x20b865,_0xc32ff0){return db[_0x97c5('0x2f')][_0x97c5('0x51')]({'where':{'id':_0x4ac1e7['params']['id']}})[_0x97c5('0x29')](handleEntityNotFound(_0x20b865,null))[_0x97c5('0x29')](function(_0x2624f0){if(_0x2624f0){return _0x2624f0['addAgents'](_0x4ac1e7[_0x97c5('0x4c')][_0x97c5('0x64')],_[_0x97c5('0x85')](_0x4ac1e7[_0x97c5('0x4c')],[_0x97c5('0x64'),'id'])||{})[_0x97c5('0x86')](function(_0x1d0f15){for(var _0x94d3c=0x0;_0x94d3c<_0x4ac1e7[_0x97c5('0x4c')]['ids'][_0x97c5('0x39')];_0x94d3c+=0x1){socket[_0x97c5('0x83')](_0x97c5('0x87'),{'UserId':_0x4ac1e7[_0x97c5('0x4c')]['ids'][_0x94d3c],'MailQueueId':_0x4ac1e7[_0x97c5('0x48')]['id']});}return _0x1d0f15;});}})[_0x97c5('0x29')](respondWithResult(_0x20b865,null))['catch'](handleError(_0x20b865,null));};exports['removeAgents']=function(_0x2575b4,_0x5017d8,_0x306924){return db['MailQueue'][_0x97c5('0x51')]({'where':{'id':_0x2575b4[_0x97c5('0x48')]['id']}})[_0x97c5('0x29')](handleEntityNotFound(_0x5017d8,null))[_0x97c5('0x29')](function(_0x24e7af){if(_0x24e7af){return _0x24e7af[_0x97c5('0x81')](_0x2575b4['query'][_0x97c5('0x64')])[_0x97c5('0x29')](function(){if(_[_0x97c5('0x88')](_0x2575b4['query']['ids'])){for(var _0x30d210=0x0;_0x30d210<_0x2575b4[_0x97c5('0x35')][_0x97c5('0x64')]['length'];_0x30d210+=0x1){socket[_0x97c5('0x83')](_0x97c5('0x84'),{'UserId':Number(_0x2575b4[_0x97c5('0x35')]['ids'][_0x30d210]),'MailQueueId':Number(_0x2575b4[_0x97c5('0x48')]['id'])});}}else{socket['emit'](_0x97c5('0x84'),{'UserId':Number(_0x2575b4[_0x97c5('0x35')]['ids']),'MailQueueId':Number(_0x2575b4[_0x97c5('0x48')]['id'])});}});}})[_0x97c5('0x29')](respondWithStatusCode(_0x5017d8,null))[_0x97c5('0x47')](handleError(_0x5017d8,null));};exports[_0x97c5('0x89')]=function(_0x23a4f4,_0x2aaf82,_0x54f91a){var _0x2e05ee={};var _0x21c484={};var _0x4f22f9;var _0x128f37;return db[_0x97c5('0x2f')]['findOne']({'where':{'id':_0x23a4f4[_0x97c5('0x48')]['id']}})['then'](handleEntityNotFound(_0x2aaf82,null))[_0x97c5('0x29')](function(_0x30e331){if(_0x30e331){_0x4f22f9=_0x30e331;_0x21c484[_0x97c5('0x33')]=_[_0x97c5('0x49')](db['User'][_0x97c5('0x30')]);_0x21c484[_0x97c5('0x35')]=_[_0x97c5('0x49')](_0x23a4f4[_0x97c5('0x35')]);_0x21c484['filters']=_['intersection'](_0x21c484[_0x97c5('0x33')],_0x21c484[_0x97c5('0x35')]);_0x2e05ee['attributes']=_[_0x97c5('0x38')](_0x21c484[_0x97c5('0x33')],qs[_0x97c5('0x4a')](_0x23a4f4[_0x97c5('0x35')][_0x97c5('0x4a')]));_0x2e05ee[_0x97c5('0x37')]=_0x2e05ee['attributes'][_0x97c5('0x39')]?_0x2e05ee['attributes']:_0x21c484['model'];_0x2e05ee[_0x97c5('0x3c')]=qs[_0x97c5('0x3d')](_0x23a4f4[_0x97c5('0x35')][_0x97c5('0x3d')]);_0x2e05ee[_0x97c5('0x3e')]=qs[_0x97c5('0x36')](_['pick'](_0x23a4f4[_0x97c5('0x35')],_0x21c484[_0x97c5('0x36')]));if(_0x23a4f4[_0x97c5('0x35')]['filter']){_0x2e05ee[_0x97c5('0x3e')]=_[_0x97c5('0x41')](_0x2e05ee['where'],{'$or':_[_0x97c5('0x2e')](_0x2e05ee[_0x97c5('0x37')],function(_0x4e5632){var _0x574b52={};_0x574b52[_0x4e5632]={'$like':'%'+_0x23a4f4[_0x97c5('0x35')][_0x97c5('0x40')]+'%'};return _0x574b52;})});}_0x2e05ee=_[_0x97c5('0x41')]({},_0x2e05ee,_0x23a4f4[_0x97c5('0x43')]);return _0x4f22f9[_0x97c5('0x89')](_0x2e05ee);}})['then'](function(_0x3bc59d){if(_0x3bc59d){_0x128f37=_0x3bc59d[_0x97c5('0x39')];if(!_0x23a4f4[_0x97c5('0x35')][_0x97c5('0x3a')](_0x97c5('0x3b'))){_0x2e05ee[_0x97c5('0x24')]=qs[_0x97c5('0x24')](_0x23a4f4['query'][_0x97c5('0x24')]);_0x2e05ee[_0x97c5('0x23')]=qs[_0x97c5('0x23')](_0x23a4f4[_0x97c5('0x35')][_0x97c5('0x23')]);}return _0x4f22f9[_0x97c5('0x89')](_0x2e05ee);}})[_0x97c5('0x29')](function(_0x5a0494){if(_0x5a0494){return _0x5a0494?{'count':_0x128f37,'rows':_0x5a0494}:null;}})[_0x97c5('0x29')](respondWithResult(_0x2aaf82,null))[_0x97c5('0x47')](handleError(_0x2aaf82,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 48d094e..1d31da1 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 _0x56f5=['update','remove','emit','hook','events','../../mysqldb','MailQueue','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x56f5,0xa6));var _0x556f=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x56f5[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0x556f('0x0'));var MailQueue=require(_0x556f('0x1'))['db'][_0x556f('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x556f('0x3')](0x0);var events={'afterCreate':_0x556f('0x4'),'afterUpdate':_0x556f('0x5'),'afterDestroy':_0x556f('0x6')};function emitEvent(_0x10c448){return function(_0x3c934f,_0x78a311,_0x8af396){MailQueueEvents[_0x556f('0x7')](_0x10c448+':'+_0x3c934f['id'],_0x3c934f);MailQueueEvents['emit'](_0x10c448,_0x3c934f);_0x8af396(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x556f('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x37e3=['hook','exports','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x37e3,0x14c));var _0x337e=function(_0x5bb7d0,_0x22e83c){_0x5bb7d0=_0x5bb7d0-0x0;var _0x156763=_0x37e3[_0x5bb7d0];return _0x156763;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x337e('0x0'))['db'][_0x337e('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x337e('0x2')](0x0);var events={'afterCreate':_0x337e('0x3'),'afterUpdate':_0x337e('0x4'),'afterDestroy':_0x337e('0x5')};function emitEvent(_0x5729c0){return function(_0x537269,_0x121630,_0x33692f){MailQueueEvents[_0x337e('0x6')](_0x5729c0+':'+_0x537269['id'],_0x537269);MailQueueEvents['emit'](_0x5729c0,_0x537269);_0x33692f(null);};}for(var e in events){if(events[_0x337e('0x7')](e)){var event=events[e];MailQueue[_0x337e('0x8')](e,emitEvent(event));}}module[_0x337e('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 79d85f7..e2067ed 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 _0x9e26=['mail_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','define','MailQueue'];(function(_0x29de33,_0x3c8ffd){var _0x437555=function(_0x511ff4){while(--_0x511ff4){_0x29de33['push'](_0x29de33['shift']());}};_0x437555(++_0x3c8ffd);}(_0x9e26,0x91));var _0x69e2=function(_0x41c57b,_0x2f4118){_0x41c57b=_0x41c57b-0x0;var _0x3dbdfd=_0x9e26[_0x41c57b];return _0x3dbdfd;};'use strict';var _=require(_0x69e2('0x0'));var util=require(_0x69e2('0x1'));var logger=require(_0x69e2('0x2'))('api');var moment=require('moment');var BPromise=require(_0x69e2('0x3'));var rp=require(_0x69e2('0x4'));var fs=require('fs');var path=require(_0x69e2('0x5'));var rimraf=require(_0x69e2('0x6'));var config=require(_0x69e2('0x7'));var attributes=require(_0x69e2('0x8'));module['exports']=function(_0x6963a6,_0x49e0e3){return _0x6963a6[_0x69e2('0x9')](_0x69e2('0xa'),attributes,{'tableName':_0x69e2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e57=['./mailQueue.attributes','exports','define','MailQueue','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x234ae1,_0x42bdd6){var _0x227ba0=function(_0x1f6531){while(--_0x1f6531){_0x234ae1['push'](_0x234ae1['shift']());}};_0x227ba0(++_0x42bdd6);}(_0x3e57,0x122));var _0x73e5=function(_0x586fa2,_0x1a45bc){_0x586fa2=_0x586fa2-0x0;var _0x515be9=_0x3e57[_0x586fa2];return _0x515be9;};'use strict';var _=require(_0x73e5('0x0'));var util=require(_0x73e5('0x1'));var logger=require(_0x73e5('0x2'))(_0x73e5('0x3'));var moment=require('moment');var BPromise=require(_0x73e5('0x4'));var rp=require(_0x73e5('0x5'));var fs=require('fs');var path=require(_0x73e5('0x6'));var rimraf=require(_0x73e5('0x7'));var config=require(_0x73e5('0x8'));var attributes=require(_0x73e5('0x9'));module[_0x73e5('0xa')]=function(_0x25db46,_0x489c29){return _0x25db46[_0x73e5('0xb')](_0x73e5('0xc'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 4ad3c4e..4da5ee1 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 _0xc86a=['defaults','localhost','socket.io-emitter','./mailQueue.socket','register','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetMailQueue','MailQueue','options','where','attributes','include','map','model','stringify','catch','ShowMailQueue','find','raw','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x364c53,_0x4ecabb){var _0x76c76c=function(_0x3db7f7){while(--_0x3db7f7){_0x364c53['push'](_0x364c53['shift']());}};_0x76c76c(++_0x4ecabb);}(_0xc86a,0x1f0));var _0xac86=function(_0x5a636f,_0x3fec2b){_0x5a636f=_0x5a636f-0x0;var _0x6a8cfb=_0xc86a[_0x5a636f];return _0x6a8cfb;};'use strict';var _=require(_0xac86('0x0'));var util=require(_0xac86('0x1'));var moment=require('moment');var BPromise=require(_0xac86('0x2'));var rs=require(_0xac86('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac86('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xac86('0x5'))(_0xac86('0x6'));var config=require(_0xac86('0x7'));var jayson=require(_0xac86('0x8'));var client=jayson['client'][_0xac86('0x9')]({'port':0x232a});config[_0xac86('0xa')]=_[_0xac86('0xb')](config[_0xac86('0xa')],{'host':_0xac86('0xc'),'port':0x18eb});var socket=require(_0xac86('0xd'))(new Redis(config['redis']));require(_0xac86('0xe'))[_0xac86('0xf')](socket);function respondWithRpcPromise(_0x210826,_0xcaff75,_0x10b33f){return new BPromise(function(_0x42d57b,_0x5c966a){return client['request'](_0x210826,_0x10b33f)[_0xac86('0x10')](function(_0x158daf){logger[_0xac86('0x11')](_0xac86('0x12'),_0xcaff75,'request\x20sent');logger[_0xac86('0x13')](_0xac86('0x14'),_0xcaff75,_0xac86('0x15'),JSON['stringify'](_0x158daf));if(_0x158daf[_0xac86('0x16')]){if(_0x158daf['error'][_0xac86('0x17')]===0x1f4){logger[_0xac86('0x16')](_0xac86('0x12'),_0xcaff75,_0x158daf[_0xac86('0x16')][_0xac86('0x18')]);return _0x5c966a(_0x158daf['error']['message']);}logger[_0xac86('0x16')](_0xac86('0x12'),_0xcaff75,_0x158daf[_0xac86('0x16')]['message']);return _0x42d57b(_0x158daf[_0xac86('0x16')]['message']);}else{logger[_0xac86('0x11')](_0xac86('0x12'),_0xcaff75,_0xac86('0x15'));_0x42d57b(_0x158daf[_0xac86('0x19')][_0xac86('0x18')]);}})['catch'](function(_0x55ab9d){logger[_0xac86('0x16')](_0xac86('0x12'),_0xcaff75,_0x55ab9d);_0x5c966a(_0x55ab9d);});});}exports[_0xac86('0x1a')]=function(_0x1411b0){var _0xdb4e61=this;return new Promise(function(_0x4bf1ba,_0x447101){return db[_0xac86('0x1b')]['findAll']({'raw':_0x1411b0[_0xac86('0x1c')]?_0x1411b0[_0xac86('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1411b0[_0xac86('0x1c')]?_0x1411b0[_0xac86('0x1c')][_0xac86('0x1d')]||null:null,'attributes':_0x1411b0[_0xac86('0x1c')]?_0x1411b0[_0xac86('0x1c')][_0xac86('0x1e')]||null:null,'limit':_0x1411b0[_0xac86('0x1c')]?_0x1411b0['options']['limit']||null:null,'include':_0x1411b0[_0xac86('0x1c')]?_0x1411b0[_0xac86('0x1c')][_0xac86('0x1f')]?_[_0xac86('0x20')](_0x1411b0[_0xac86('0x1c')]['include'],function(_0x40034c){return{'model':db[_0x40034c['model']],'as':_0x40034c['as'],'attributes':_0x40034c[_0xac86('0x1e')],'include':_0x40034c['include']?_[_0xac86('0x20')](_0x40034c[_0xac86('0x1f')],function(_0x1b1634){return{'model':db[_0x1b1634[_0xac86('0x21')]],'as':_0x1b1634['as'],'attributes':_0x1b1634[_0xac86('0x1e')],'include':_0x1b1634['include']?_[_0xac86('0x20')](_0x1b1634[_0xac86('0x1f')],function(_0x380585){return{'model':db[_0x380585['model']],'as':_0x380585['as'],'attributes':_0x380585[_0xac86('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xac86('0x10')](function(_0x5931ea){logger[_0xac86('0x11')](_0xac86('0x1a'),_0x1411b0);logger['debug']('GetMailQueue',_0x1411b0,JSON[_0xac86('0x22')](_0x5931ea));_0x4bf1ba(_0x5931ea);})[_0xac86('0x23')](function(_0x58db33){logger[_0xac86('0x16')](_0xac86('0x1a'),_0x58db33[_0xac86('0x18')],_0x1411b0);_0x447101(_0xdb4e61[_0xac86('0x16')](0x1f4,_0x58db33[_0xac86('0x18')]));});});};exports[_0xac86('0x24')]=function(_0xa535de){var _0x26580e=this;return new Promise(function(_0x5da088,_0x364f02){return db[_0xac86('0x1b')][_0xac86('0x25')]({'raw':_0xa535de['options']?_0xa535de['options'][_0xac86('0x26')]===undefined?!![]:![]:!![],'where':_0xa535de[_0xac86('0x1c')]?_0xa535de[_0xac86('0x1c')]['where']||null:null,'attributes':_0xa535de[_0xac86('0x1c')]?_0xa535de['options'][_0xac86('0x1e')]||null:null,'include':_0xa535de[_0xac86('0x1c')]?_0xa535de[_0xac86('0x1c')]['include']?_['map'](_0xa535de['options'][_0xac86('0x1f')],function(_0x3f820f){return{'model':db[_0x3f820f[_0xac86('0x21')]],'as':_0x3f820f['as'],'attributes':_0x3f820f[_0xac86('0x1e')],'include':_0x3f820f[_0xac86('0x1f')]?_['map'](_0x3f820f[_0xac86('0x1f')],function(_0x49001b){return{'model':db[_0x49001b['model']],'as':_0x49001b['as'],'attributes':_0x49001b[_0xac86('0x1e')],'include':_0x49001b[_0xac86('0x1f')]?_[_0xac86('0x20')](_0x49001b[_0xac86('0x1f')],function(_0x4212fd){return{'model':db[_0x4212fd[_0xac86('0x21')]],'as':_0x4212fd['as'],'attributes':_0x4212fd[_0xac86('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xac86('0x10')](function(_0xe6f381){logger[_0xac86('0x11')](_0xac86('0x24'),_0xa535de);logger['debug']('ShowMailQueue',_0xa535de,JSON[_0xac86('0x22')](_0xe6f381));_0x5da088(_0xe6f381);})[_0xac86('0x23')](function(_0xb8c1b6){logger[_0xac86('0x16')](_0xac86('0x24'),_0xb8c1b6['message'],_0xa535de);_0x364f02(_0x26580e['error'](0x1f4,_0xb8c1b6[_0xac86('0x18')]));});});}; \ No newline at end of file +var _0x0153=['debug','ShowMailQueue','MailQueue','find','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','raw','where','limit','include','map','model','attributes','GetMailQueue'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x0153,0x1f2));var _0x3015=function(_0x5a75e7,_0x3ad506){_0x5a75e7=_0x5a75e7-0x0;var _0x15c695=_0x0153[_0x5a75e7];return _0x15c695;};'use strict';var _=require(_0x3015('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3015('0x1'));var rs=require(_0x3015('0x2'));var fs=require('fs');var Redis=require(_0x3015('0x3'));var db=require(_0x3015('0x4'))['db'];var utils=require(_0x3015('0x5'));var logger=require(_0x3015('0x6'))(_0x3015('0x7'));var config=require('../../config/environment');var jayson=require(_0x3015('0x8'));var client=jayson['client'][_0x3015('0x9')]({'port':0x232a});config[_0x3015('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3015('0xa')]));require(_0x3015('0xb'))[_0x3015('0xc')](socket);function respondWithRpcPromise(_0x355c76,_0x2cc2da,_0x13d113){return new BPromise(function(_0x45f899,_0x55caed){return client[_0x3015('0xd')](_0x355c76,_0x13d113)[_0x3015('0xe')](function(_0x465ed0){logger[_0x3015('0xf')](_0x3015('0x10'),_0x2cc2da,_0x3015('0x11'));logger['debug'](_0x3015('0x12'),_0x2cc2da,_0x3015('0x11'),JSON[_0x3015('0x13')](_0x465ed0));if(_0x465ed0[_0x3015('0x14')]){if(_0x465ed0[_0x3015('0x14')]['code']===0x1f4){logger[_0x3015('0x14')](_0x3015('0x10'),_0x2cc2da,_0x465ed0[_0x3015('0x14')][_0x3015('0x15')]);return _0x55caed(_0x465ed0['error'][_0x3015('0x15')]);}logger[_0x3015('0x14')](_0x3015('0x10'),_0x2cc2da,_0x465ed0[_0x3015('0x14')][_0x3015('0x15')]);return _0x45f899(_0x465ed0[_0x3015('0x14')][_0x3015('0x15')]);}else{logger[_0x3015('0xf')](_0x3015('0x10'),_0x2cc2da,_0x3015('0x11'));_0x45f899(_0x465ed0[_0x3015('0x16')][_0x3015('0x15')]);}})[_0x3015('0x17')](function(_0x59932e){logger['error'](_0x3015('0x10'),_0x2cc2da,_0x59932e);_0x55caed(_0x59932e);});});}exports['GetMailQueue']=function(_0x49536d){var _0x56ea97=this;return new Promise(function(_0x1cbef8,_0xc484e1){return db['MailQueue'][_0x3015('0x18')]({'raw':_0x49536d[_0x3015('0x19')]?_0x49536d[_0x3015('0x19')][_0x3015('0x1a')]===undefined?!![]:![]:!![],'where':_0x49536d[_0x3015('0x19')]?_0x49536d[_0x3015('0x19')][_0x3015('0x1b')]||null:null,'attributes':_0x49536d[_0x3015('0x19')]?_0x49536d[_0x3015('0x19')]['attributes']||null:null,'limit':_0x49536d[_0x3015('0x19')]?_0x49536d[_0x3015('0x19')][_0x3015('0x1c')]||null:null,'include':_0x49536d[_0x3015('0x19')]?_0x49536d[_0x3015('0x19')][_0x3015('0x1d')]?_[_0x3015('0x1e')](_0x49536d[_0x3015('0x19')][_0x3015('0x1d')],function(_0x5b682f){return{'model':db[_0x5b682f[_0x3015('0x1f')]],'as':_0x5b682f['as'],'attributes':_0x5b682f['attributes'],'include':_0x5b682f[_0x3015('0x1d')]?_['map'](_0x5b682f[_0x3015('0x1d')],function(_0x29e62b){return{'model':db[_0x29e62b[_0x3015('0x1f')]],'as':_0x29e62b['as'],'attributes':_0x29e62b[_0x3015('0x20')],'include':_0x29e62b[_0x3015('0x1d')]?_['map'](_0x29e62b[_0x3015('0x1d')],function(_0x4686ee){return{'model':db[_0x4686ee[_0x3015('0x1f')]],'as':_0x4686ee['as'],'attributes':_0x4686ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x3015('0xe')](function(_0x276b4b){logger[_0x3015('0xf')](_0x3015('0x21'),_0x49536d);logger[_0x3015('0x22')]('GetMailQueue',_0x49536d,JSON['stringify'](_0x276b4b));_0x1cbef8(_0x276b4b);})[_0x3015('0x17')](function(_0x5f24fa){logger[_0x3015('0x14')](_0x3015('0x21'),_0x5f24fa[_0x3015('0x15')],_0x49536d);_0xc484e1(_0x56ea97[_0x3015('0x14')](0x1f4,_0x5f24fa[_0x3015('0x15')]));});});};exports[_0x3015('0x23')]=function(_0x668776){var _0x22b57a=this;return new Promise(function(_0x31971b,_0x3b186e){return db[_0x3015('0x24')][_0x3015('0x25')]({'raw':_0x668776[_0x3015('0x19')]?_0x668776['options']['raw']===undefined?!![]:![]:!![],'where':_0x668776[_0x3015('0x19')]?_0x668776[_0x3015('0x19')][_0x3015('0x1b')]||null:null,'attributes':_0x668776[_0x3015('0x19')]?_0x668776[_0x3015('0x19')][_0x3015('0x20')]||null:null,'include':_0x668776[_0x3015('0x19')]?_0x668776[_0x3015('0x19')][_0x3015('0x1d')]?_[_0x3015('0x1e')](_0x668776[_0x3015('0x19')][_0x3015('0x1d')],function(_0x2bbfdd){return{'model':db[_0x2bbfdd['model']],'as':_0x2bbfdd['as'],'attributes':_0x2bbfdd[_0x3015('0x20')],'include':_0x2bbfdd[_0x3015('0x1d')]?_[_0x3015('0x1e')](_0x2bbfdd[_0x3015('0x1d')],function(_0x5ba891){return{'model':db[_0x5ba891['model']],'as':_0x5ba891['as'],'attributes':_0x5ba891['attributes'],'include':_0x5ba891['include']?_[_0x3015('0x1e')](_0x5ba891['include'],function(_0x2adb95){return{'model':db[_0x2adb95[_0x3015('0x1f')]],'as':_0x2adb95['as'],'attributes':_0x2adb95[_0x3015('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3015('0xe')](function(_0x17bf03){logger[_0x3015('0xf')](_0x3015('0x23'),_0x668776);logger[_0x3015('0x22')](_0x3015('0x23'),_0x668776,JSON[_0x3015('0x13')](_0x17bf03));_0x31971b(_0x17bf03);})[_0x3015('0x17')](function(_0x279e02){logger[_0x3015('0x14')](_0x3015('0x23'),_0x279e02['message'],_0x668776);_0x3b186e(_0x22b57a[_0x3015('0x14')](0x1f4,_0x279e02[_0x3015('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 1563bd6..06f9ff7 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 _0xd0ea=['save','update','removeListener','register','mailQueue:','./mailQueue.events'];(function(_0x454165,_0x1f3e74){var _0x56db53=function(_0x23388c){while(--_0x23388c){_0x454165['push'](_0x454165['shift']());}};_0x56db53(++_0x1f3e74);}(_0xd0ea,0x71));var _0xad0e=function(_0xcc69c5,_0x5b35b2){_0xcc69c5=_0xcc69c5-0x0;var _0x14ec59=_0xd0ea[_0xcc69c5];return _0x14ec59;};'use strict';var MailQueueEvents=require(_0xad0e('0x0'));var events=[_0xad0e('0x1'),'remove',_0xad0e('0x2')];function createListener(_0x14efcf,_0x4612d7){return function(_0x3abaec){_0x4612d7['emit'](_0x14efcf,_0x3abaec);};}function removeListener(_0x4675c0,_0x2010c8){return function(){MailQueueEvents[_0xad0e('0x3')](_0x4675c0,_0x2010c8);};}exports[_0xad0e('0x4')]=function(_0x572352){for(var _0x350c24=0x0,_0x1ee60c=events['length'];_0x350c24<_0x1ee60c;_0x350c24++){var _0x5d79fa=events[_0x350c24];var _0x23f79d=createListener(_0xad0e('0x5')+_0x5d79fa,_0x572352);MailQueueEvents['on'](_0x5d79fa,_0x23f79d);}}; \ No newline at end of file +var _0x04e4=['removeListener','register','length','mailQueue:','./mailQueue.events','save','remove','update'];(function(_0x11a962,_0x3cc338){var _0x55d423=function(_0xf4b236){while(--_0xf4b236){_0x11a962['push'](_0x11a962['shift']());}};_0x55d423(++_0x3cc338);}(_0x04e4,0x1b4));var _0x404e=function(_0x1b53d0,_0xc3d4d7){_0x1b53d0=_0x1b53d0-0x0;var _0x4f641e=_0x04e4[_0x1b53d0];return _0x4f641e;};'use strict';var MailQueueEvents=require(_0x404e('0x0'));var events=[_0x404e('0x1'),_0x404e('0x2'),_0x404e('0x3')];function createListener(_0x462eb1,_0x5baa0f){return function(_0x234764){_0x5baa0f['emit'](_0x462eb1,_0x234764);};}function removeListener(_0x3cfdc4,_0x2b5842){return function(){MailQueueEvents[_0x404e('0x4')](_0x3cfdc4,_0x2b5842);};}exports[_0x404e('0x5')]=function(_0x371e53){for(var _0x5d3c59=0x0,_0x5e941b=events[_0x404e('0x6')];_0x5d3c59<_0x5e941b;_0x5d3c59++){var _0x3d8a31=events[_0x5d3c59];var _0xdfe9d1=createListener(_0x404e('0x7')+_0x3d8a31,_0x371e53);MailQueueEvents['on'](_0x3d8a31,_0xdfe9d1);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index c7697ab..585b2b9 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 _0x9418=['/:id','show','post','create','put','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated','/describe','describe'];(function(_0x2b3a40,_0x386ecd){var _0x2ad588=function(_0x4c5829){while(--_0x4c5829){_0x2b3a40['push'](_0x2b3a40['shift']());}};_0x2ad588(++_0x386ecd);}(_0x9418,0x14c));var _0x8941=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x9418[_0x25e7cb];return _0x375d92;};'use strict';var multer=require('multer');var util=require(_0x8941('0x0'));var path=require('path');var timeout=require(_0x8941('0x1'));var express=require('express');var router=express[_0x8941('0x2')]();var auth=require(_0x8941('0x3'));var interaction=require(_0x8941('0x4'));var config=require('../../config/environment');var controller=require(_0x8941('0x5'));router[_0x8941('0x6')]('/',auth[_0x8941('0x7')](),controller['index']);router[_0x8941('0x6')](_0x8941('0x8'),auth[_0x8941('0x7')](),controller[_0x8941('0x9')]);router[_0x8941('0x6')](_0x8941('0xa'),auth[_0x8941('0x7')](),controller[_0x8941('0xb')]);router[_0x8941('0xc')]('/',auth[_0x8941('0x7')](),controller[_0x8941('0xd')]);router[_0x8941('0xe')](_0x8941('0xa'),auth[_0x8941('0x7')](),controller['update']);router[_0x8941('0xf')]('/:id',auth[_0x8941('0x7')](),controller[_0x8941('0x10')]);module[_0x8941('0x11')]=router; \ No newline at end of file +var _0xc294=['update','delete','destroy','exports','util','path','connect-timeout','Router','./mailQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put'];(function(_0x40c79e,_0x22fe40){var _0x1d2d42=function(_0x4d69da){while(--_0x4d69da){_0x40c79e['push'](_0x40c79e['shift']());}};_0x1d2d42(++_0x22fe40);}(_0xc294,0x136));var _0x4c29=function(_0x486f1d,_0x90c2b5){_0x486f1d=_0x486f1d-0x0;var _0x5a2c2d=_0xc294[_0x486f1d];return _0x5a2c2d;};'use strict';var multer=require('multer');var util=require(_0x4c29('0x0'));var path=require(_0x4c29('0x1'));var timeout=require(_0x4c29('0x2'));var express=require('express');var router=express[_0x4c29('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4c29('0x4'));router['get']('/',auth[_0x4c29('0x5')](),controller[_0x4c29('0x6')]);router[_0x4c29('0x7')](_0x4c29('0x8'),auth[_0x4c29('0x5')](),controller[_0x4c29('0x9')]);router[_0x4c29('0x7')](_0x4c29('0xa'),auth[_0x4c29('0x5')](),controller['show']);router[_0x4c29('0xb')]('/',auth[_0x4c29('0x5')](),controller[_0x4c29('0xc')]);router[_0x4c29('0xd')](_0x4c29('0xa'),auth['isAuthenticated'](),controller[_0x4c29('0xe')]);router[_0x4c29('0xf')](_0x4c29('0xa'),auth[_0x4c29('0x5')](),controller[_0x4c29('0x10')]);module[_0x4c29('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 0143d90..e612ec1 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 _0x29f2=['moment','STRING','DATE'];(function(_0x297a40,_0x24cbe0){var _0x4f2752=function(_0x21ed5a){while(--_0x21ed5a){_0x297a40['push'](_0x297a40['shift']());}};_0x4f2752(++_0x24cbe0);}(_0x29f2,0x7e));var _0x229f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29f2[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x229f('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x229f('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x229f('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x229f('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x229f('0x2')]},'reason':{'type':Sequelize[_0x229f('0x1')]}}; \ No newline at end of file +var _0x70c7=['DATE','moment','sequelize','STRING'];(function(_0x4c7ee1,_0xdd33ba){var _0x3576fb=function(_0xc96c4b){while(--_0xc96c4b){_0x4c7ee1['push'](_0x4c7ee1['shift']());}};_0x3576fb(++_0xdd33ba);}(_0x70c7,0x161));var _0x770c=function(_0x1c198e,_0x5e118c){_0x1c198e=_0x1c198e-0x0;var _0x15c7bd=_0x70c7[_0x1c198e];return _0x15c7bd;};'use strict';var moment=require(_0x770c('0x0'));var Sequelize=require(_0x770c('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x770c('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x770c('0x2')]},'joinAt':{'type':Sequelize[_0x770c('0x3')]},'leaveAt':{'type':Sequelize[_0x770c('0x3')]},'acceptAt':{'type':Sequelize[_0x770c('0x3')]},'exitAt':{'type':Sequelize[_0x770c('0x3')]},'reason':{'type':Sequelize[_0x770c('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 717a1d3..b7d7b0c 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 _0x0cd9=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json','apply','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','filter','where','merge','VIRTUAL','options','MailQueueReport','include','findAll','rows','catch','show','params','includeAll','create','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0xaba68f,_0x976c94){var _0x52be9c=function(_0xb9e944){while(--_0xb9e944){_0xaba68f['push'](_0xaba68f['shift']());}};_0x52be9c(++_0x976c94);}(_0x0cd9,0x164));var _0x90cd=function(_0xadefad,_0x5ed2e8){_0xadefad=_0xadefad-0x0;var _0x2bf3ba=_0x0cd9[_0xadefad];return _0x2bf3ba;};'use strict';var pdf=require(_0x90cd('0x0'));var emlformat=require(_0x90cd('0x1'));var rimraf=require(_0x90cd('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x90cd('0x3'));var rp=require(_0x90cd('0x4'));var moment=require(_0x90cd('0x5'));var BPromise=require(_0x90cd('0x6'));var Mustache=require('mustache');var util=require(_0x90cd('0x7'));var path=require(_0x90cd('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x90cd('0x9'));var fs=require('fs');var _=require(_0x90cd('0xa'));var squel=require(_0x90cd('0xb'));var crypto=require(_0x90cd('0xc'));var jsforce=require(_0x90cd('0xd'));var deskjs=require(_0x90cd('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x90cd('0xf'));var Redis=require(_0x90cd('0x10'));var authService=require(_0x90cd('0x11'));var qs=require(_0x90cd('0x12'));var as=require(_0x90cd('0x13'));var hardwareService=require(_0x90cd('0x14'));var logger=require(_0x90cd('0x15'))(_0x90cd('0x16'));var utils=require(_0x90cd('0x17'));var config=require(_0x90cd('0x18'));var db=require(_0x90cd('0x19'))['db'];function respondWithStatusCode(_0x425d56,_0x24c677){_0x24c677=_0x24c677||0xcc;return function(_0x16b648){if(_0x16b648){return _0x425d56[_0x90cd('0x1a')](_0x24c677);}return _0x425d56[_0x90cd('0x1b')](_0x24c677)['end']();};}function respondWithResult(_0x24602f,_0x43f291){_0x43f291=_0x43f291||0xc8;return function(_0x24215a){if(_0x24215a){return _0x24602f[_0x90cd('0x1b')](_0x43f291)['json'](_0x24215a);}};}function respondWithFilteredResult(_0x5212ab,_0x2940d2){return function(_0x2c2114){if(_0x2c2114){var _0x2e7ad8=_0x2c2114[_0x90cd('0x1c')],_0x133c53=_0x2940d2[_0x90cd('0x1d')],_0x5b0958=_0x2940d2['offset']+_0x2940d2['limit'],_0x5718c2;if(_0x5b0958>=_0x2e7ad8){_0x5b0958=_0x2e7ad8;_0x5718c2=0xc8;}else{_0x5718c2=0xce;}_0x5212ab[_0x90cd('0x1b')](_0x5718c2);return _0x5212ab[_0x90cd('0x1e')](_0x90cd('0x1f'),_0x133c53+'-'+_0x5b0958+'/'+_0x2e7ad8)[_0x90cd('0x20')](_0x2c2114);}return null;};}function patchUpdates(_0x5688f1){return function(_0x4de2b9){try{jsonpatch[_0x90cd('0x21')](_0x4de2b9,_0x5688f1,!![]);}catch(_0x43c97b){return BPromise['reject'](_0x43c97b);}return _0x4de2b9[_0x90cd('0x22')]();};}function saveUpdates(_0x4da429,_0x449dbf){return function(_0x55ac88){if(_0x55ac88){return _0x55ac88[_0x90cd('0x23')](_0x4da429)['then'](function(_0x123d4d){return _0x123d4d;});}return null;};}function removeEntity(_0x3ab5c2,_0x423b3e){return function(_0x540b31){if(_0x540b31){return _0x540b31[_0x90cd('0x24')]()[_0x90cd('0x25')](function(){_0x3ab5c2[_0x90cd('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2edb8e,_0x3694c3){return function(_0x33e2ee){if(!_0x33e2ee){_0x2edb8e[_0x90cd('0x1a')](0x194);}return _0x33e2ee;};}function handleError(_0x28533b,_0x46cc20){_0x46cc20=_0x46cc20||0x1f4;return function(_0x5a83f2){logger[_0x90cd('0x26')](_0x5a83f2[_0x90cd('0x27')]);if(_0x5a83f2['name']){delete _0x5a83f2[_0x90cd('0x28')];}_0x28533b[_0x90cd('0x1b')](_0x46cc20)[_0x90cd('0x29')](_0x5a83f2);};}exports[_0x90cd('0x2a')]=function(_0x4b0c0b,_0x1b627d){var _0x3ccea5={},_0x555c56={},_0x58a870={'count':0x0,'rows':[]};var _0x282456=_[_0x90cd('0x2b')](db['MailQueueReport'][_0x90cd('0x2c')],function(_0x4e750a){return{'name':_0x4e750a['fieldName'],'type':_0x4e750a['type'][_0x90cd('0x2d')]};});_0x555c56['model']=_['map'](_0x282456,'name');_0x555c56[_0x90cd('0x2e')]=_[_0x90cd('0x2f')](_0x4b0c0b[_0x90cd('0x2e')]);_0x555c56[_0x90cd('0x30')]=_[_0x90cd('0x31')](_0x555c56[_0x90cd('0x32')],_0x555c56['query']);_0x3ccea5[_0x90cd('0x33')]=_[_0x90cd('0x31')](_0x555c56[_0x90cd('0x32')],qs['fields'](_0x4b0c0b[_0x90cd('0x2e')][_0x90cd('0x34')]));_0x3ccea5['attributes']=_0x3ccea5[_0x90cd('0x33')][_0x90cd('0x35')]?_0x3ccea5[_0x90cd('0x33')]:_0x555c56[_0x90cd('0x32')];if(!_0x4b0c0b['query'][_0x90cd('0x36')]('nolimit')){_0x3ccea5[_0x90cd('0x37')]=qs['limit'](_0x4b0c0b[_0x90cd('0x2e')]['limit']);_0x3ccea5[_0x90cd('0x1d')]=qs[_0x90cd('0x1d')](_0x4b0c0b[_0x90cd('0x2e')][_0x90cd('0x1d')]);}_0x3ccea5[_0x90cd('0x38')]=qs[_0x90cd('0x39')](_0x4b0c0b['query'][_0x90cd('0x39')]);_0x3ccea5['where']=qs[_0x90cd('0x30')](_['pick'](_0x4b0c0b[_0x90cd('0x2e')],_0x555c56['filters']));if(_0x4b0c0b[_0x90cd('0x2e')][_0x90cd('0x3a')]){_0x3ccea5[_0x90cd('0x3b')]=_[_0x90cd('0x3c')](_0x3ccea5['where'],{'$or':_[_0x90cd('0x2b')](_0x282456,function(_0x56172b){if(_0x56172b['type']!==_0x90cd('0x3d')){var _0x5e1839={};_0x5e1839[_0x56172b[_0x90cd('0x28')]]={'$like':'%'+_0x4b0c0b['query'][_0x90cd('0x3a')]+'%'};return _0x5e1839;}})});}_0x3ccea5=_[_0x90cd('0x3c')]({},_0x3ccea5,_0x4b0c0b[_0x90cd('0x3e')]);var _0x713548={'where':_0x3ccea5[_0x90cd('0x3b')]};return db[_0x90cd('0x3f')][_0x90cd('0x1c')](_0x713548)[_0x90cd('0x25')](function(_0x3f2b7e){_0x58a870[_0x90cd('0x1c')]=_0x3f2b7e;if(_0x4b0c0b[_0x90cd('0x2e')]['includeAll']){_0x3ccea5[_0x90cd('0x40')]=[{'all':!![]}];}return db[_0x90cd('0x3f')][_0x90cd('0x41')](_0x3ccea5);})[_0x90cd('0x25')](function(_0x508387){_0x58a870[_0x90cd('0x42')]=_0x508387;return _0x58a870;})['then'](respondWithFilteredResult(_0x1b627d,_0x3ccea5))[_0x90cd('0x43')](handleError(_0x1b627d,null));};exports[_0x90cd('0x44')]=function(_0x221763,_0x183f62){var _0x5855c7={'raw':!![],'where':{'id':_0x221763[_0x90cd('0x45')]['id']}},_0xad229b={};_0xad229b['model']=_['keys'](db[_0x90cd('0x3f')][_0x90cd('0x2c')]);_0xad229b['query']=_[_0x90cd('0x2f')](_0x221763[_0x90cd('0x2e')]);_0xad229b['filters']=_[_0x90cd('0x31')](_0xad229b['model'],_0xad229b['query']);_0x5855c7[_0x90cd('0x33')]=_[_0x90cd('0x31')](_0xad229b[_0x90cd('0x32')],qs['fields'](_0x221763[_0x90cd('0x2e')]['fields']));_0x5855c7[_0x90cd('0x33')]=_0x5855c7['attributes'][_0x90cd('0x35')]?_0x5855c7['attributes']:_0xad229b['model'];if(_0x221763[_0x90cd('0x2e')][_0x90cd('0x46')]){_0x5855c7['include']=[{'all':!![]}];}_0x5855c7=_['merge']({},_0x5855c7,_0x221763['options']);return db[_0x90cd('0x3f')]['find'](_0x5855c7)['then'](handleEntityNotFound(_0x183f62,null))[_0x90cd('0x25')](respondWithResult(_0x183f62,null))[_0x90cd('0x43')](handleError(_0x183f62,null));};exports[_0x90cd('0x47')]=function(_0x435fed,_0x214ab1){return db[_0x90cd('0x3f')][_0x90cd('0x47')](_0x435fed[_0x90cd('0x48')],{})['then'](respondWithResult(_0x214ab1,0xc9))['catch'](handleError(_0x214ab1,null));};exports[_0x90cd('0x23')]=function(_0x2d551f,_0x11e09c){if(_0x2d551f[_0x90cd('0x48')]['id']){delete _0x2d551f['body']['id'];}return db[_0x90cd('0x3f')][_0x90cd('0x49')]({'where':{'id':_0x2d551f[_0x90cd('0x45')]['id']}})[_0x90cd('0x25')](handleEntityNotFound(_0x11e09c,null))['then'](saveUpdates(_0x2d551f[_0x90cd('0x48')],null))[_0x90cd('0x25')](respondWithResult(_0x11e09c,null))[_0x90cd('0x43')](handleError(_0x11e09c,null));};exports[_0x90cd('0x24')]=function(_0x3e63fd,_0x48fd63){return db[_0x90cd('0x3f')][_0x90cd('0x49')]({'where':{'id':_0x3e63fd['params']['id']}})[_0x90cd('0x25')](handleEntityNotFound(_0x48fd63,null))[_0x90cd('0x25')](removeEntity(_0x48fd63,null))['catch'](handleError(_0x48fd63,null));};exports['describe']=function(_0x5610b5,_0x8f5d01){return db[_0x90cd('0x3f')][_0x90cd('0x4a')]()[_0x90cd('0x25')](respondWithResult(_0x8f5d01,null))['catch'](handleError(_0x8f5d01,null));}; \ No newline at end of file +var _0xbc35=['update','then','destroy','error','stack','name','send','MailQueueReport','rawAttributes','fieldName','key','map','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','include','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','desk.js','to-csv','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','set','Content-Range','reject','save'];(function(_0x136bf5,_0x3e04f1){var _0x5327ca=function(_0x247631){while(--_0x247631){_0x136bf5['push'](_0x136bf5['shift']());}};_0x5327ca(++_0x3e04f1);}(_0xbc35,0xfb));var _0x5bc3=function(_0x59fcb4,_0x4cba54){_0x59fcb4=_0x59fcb4-0x0;var _0x25505b=_0xbc35[_0x59fcb4];return _0x25505b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x5bc3('0x0'));var zipdir=require(_0x5bc3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5bc3('0x2'));var moment=require(_0x5bc3('0x3'));var BPromise=require(_0x5bc3('0x4'));var Mustache=require(_0x5bc3('0x5'));var util=require(_0x5bc3('0x6'));var path=require('path');var sox=require(_0x5bc3('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x5bc3('0x8'));var squel=require(_0x5bc3('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5bc3('0xa'));var toCsv=require(_0x5bc3('0xb'));var querystring=require(_0x5bc3('0xc'));var Papa=require(_0x5bc3('0xd'));var Redis=require('ioredis');var authService=require(_0x5bc3('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x5bc3('0xf'));var hardwareService=require(_0x5bc3('0x10'));var logger=require(_0x5bc3('0x11'))(_0x5bc3('0x12'));var utils=require(_0x5bc3('0x13'));var config=require(_0x5bc3('0x14'));var db=require(_0x5bc3('0x15'))['db'];function respondWithStatusCode(_0x315279,_0x3d2491){_0x3d2491=_0x3d2491||0xcc;return function(_0x2488bc){if(_0x2488bc){return _0x315279[_0x5bc3('0x16')](_0x3d2491);}return _0x315279[_0x5bc3('0x17')](_0x3d2491)[_0x5bc3('0x18')]();};}function respondWithResult(_0x154185,_0x211d0c){_0x211d0c=_0x211d0c||0xc8;return function(_0x353069){if(_0x353069){return _0x154185[_0x5bc3('0x17')](_0x211d0c)[_0x5bc3('0x19')](_0x353069);}};}function respondWithFilteredResult(_0x21ebe5,_0x55a78f){return function(_0x1e1acc){if(_0x1e1acc){var _0x193315=_0x1e1acc[_0x5bc3('0x1a')],_0xd3fec7=_0x55a78f[_0x5bc3('0x1b')],_0x2144b4=_0x55a78f[_0x5bc3('0x1b')]+_0x55a78f[_0x5bc3('0x1c')],_0x58d7bc;if(_0x2144b4>=_0x193315){_0x2144b4=_0x193315;_0x58d7bc=0xc8;}else{_0x58d7bc=0xce;}_0x21ebe5['status'](_0x58d7bc);return _0x21ebe5[_0x5bc3('0x1d')](_0x5bc3('0x1e'),_0xd3fec7+'-'+_0x2144b4+'/'+_0x193315)[_0x5bc3('0x19')](_0x1e1acc);}return null;};}function patchUpdates(_0x549a54){return function(_0x28e07b){try{jsonpatch['apply'](_0x28e07b,_0x549a54,!![]);}catch(_0x9ade){return BPromise[_0x5bc3('0x1f')](_0x9ade);}return _0x28e07b[_0x5bc3('0x20')]();};}function saveUpdates(_0x50e458,_0x3d9d51){return function(_0x13932b){if(_0x13932b){return _0x13932b[_0x5bc3('0x21')](_0x50e458)[_0x5bc3('0x22')](function(_0xaf7b4b){return _0xaf7b4b;});}return null;};}function removeEntity(_0x3ce083,_0x547d21){return function(_0x34080b){if(_0x34080b){return _0x34080b[_0x5bc3('0x23')]()[_0x5bc3('0x22')](function(){_0x3ce083[_0x5bc3('0x17')](0xcc)[_0x5bc3('0x18')]();});}};}function handleEntityNotFound(_0x5cf627,_0x64ed82){return function(_0x5ba412){if(!_0x5ba412){_0x5cf627['sendStatus'](0x194);}return _0x5ba412;};}function handleError(_0x59bad0,_0x5c129a){_0x5c129a=_0x5c129a||0x1f4;return function(_0x2d7d2c){logger[_0x5bc3('0x24')](_0x2d7d2c[_0x5bc3('0x25')]);if(_0x2d7d2c['name']){delete _0x2d7d2c[_0x5bc3('0x26')];}_0x59bad0[_0x5bc3('0x17')](_0x5c129a)[_0x5bc3('0x27')](_0x2d7d2c);};}exports['index']=function(_0x501c5e,_0xeb678a){var _0x5b1e64={},_0x487638={},_0x3c9ad7={'count':0x0,'rows':[]};var _0x23b6f8=_['map'](db[_0x5bc3('0x28')][_0x5bc3('0x29')],function(_0x4e8926){return{'name':_0x4e8926[_0x5bc3('0x2a')],'type':_0x4e8926['type'][_0x5bc3('0x2b')]};});_0x487638['model']=_[_0x5bc3('0x2c')](_0x23b6f8,_0x5bc3('0x26'));_0x487638[_0x5bc3('0x2d')]=_[_0x5bc3('0x2e')](_0x501c5e['query']);_0x487638[_0x5bc3('0x2f')]=_['intersection'](_0x487638[_0x5bc3('0x30')],_0x487638[_0x5bc3('0x2d')]);_0x5b1e64['attributes']=_[_0x5bc3('0x31')](_0x487638[_0x5bc3('0x30')],qs[_0x5bc3('0x32')](_0x501c5e[_0x5bc3('0x2d')][_0x5bc3('0x32')]));_0x5b1e64['attributes']=_0x5b1e64[_0x5bc3('0x33')][_0x5bc3('0x34')]?_0x5b1e64['attributes']:_0x487638[_0x5bc3('0x30')];if(!_0x501c5e['query'][_0x5bc3('0x35')]('nolimit')){_0x5b1e64[_0x5bc3('0x1c')]=qs[_0x5bc3('0x1c')](_0x501c5e[_0x5bc3('0x2d')]['limit']);_0x5b1e64[_0x5bc3('0x1b')]=qs[_0x5bc3('0x1b')](_0x501c5e['query'][_0x5bc3('0x1b')]);}_0x5b1e64['order']=qs[_0x5bc3('0x36')](_0x501c5e[_0x5bc3('0x2d')][_0x5bc3('0x36')]);_0x5b1e64[_0x5bc3('0x37')]=qs[_0x5bc3('0x2f')](_[_0x5bc3('0x38')](_0x501c5e[_0x5bc3('0x2d')],_0x487638[_0x5bc3('0x2f')]));if(_0x501c5e[_0x5bc3('0x2d')][_0x5bc3('0x39')]){_0x5b1e64['where']=_['merge'](_0x5b1e64[_0x5bc3('0x37')],{'$or':_[_0x5bc3('0x2c')](_0x23b6f8,function(_0xd4e23c){if(_0xd4e23c['type']!==_0x5bc3('0x3a')){var _0x2d0060={};_0x2d0060[_0xd4e23c[_0x5bc3('0x26')]]={'$like':'%'+_0x501c5e[_0x5bc3('0x2d')]['filter']+'%'};return _0x2d0060;}})});}_0x5b1e64=_[_0x5bc3('0x3b')]({},_0x5b1e64,_0x501c5e[_0x5bc3('0x3c')]);var _0x2213ad={'where':_0x5b1e64['where']};return db[_0x5bc3('0x28')][_0x5bc3('0x1a')](_0x2213ad)[_0x5bc3('0x22')](function(_0x3c9e7e){_0x3c9ad7['count']=_0x3c9e7e;if(_0x501c5e['query'][_0x5bc3('0x3d')]){_0x5b1e64['include']=[{'all':!![]}];}return db['MailQueueReport'][_0x5bc3('0x3e')](_0x5b1e64);})[_0x5bc3('0x22')](function(_0x328ffe){_0x3c9ad7[_0x5bc3('0x3f')]=_0x328ffe;return _0x3c9ad7;})[_0x5bc3('0x22')](respondWithFilteredResult(_0xeb678a,_0x5b1e64))[_0x5bc3('0x40')](handleError(_0xeb678a,null));};exports['show']=function(_0x2a7fa2,_0x558fc9){var _0x212ddd={'raw':!![],'where':{'id':_0x2a7fa2[_0x5bc3('0x41')]['id']}},_0x5d939c={};_0x5d939c[_0x5bc3('0x30')]=_['keys'](db[_0x5bc3('0x28')][_0x5bc3('0x29')]);_0x5d939c[_0x5bc3('0x2d')]=_[_0x5bc3('0x2e')](_0x2a7fa2['query']);_0x5d939c[_0x5bc3('0x2f')]=_[_0x5bc3('0x31')](_0x5d939c['model'],_0x5d939c['query']);_0x212ddd[_0x5bc3('0x33')]=_['intersection'](_0x5d939c[_0x5bc3('0x30')],qs[_0x5bc3('0x32')](_0x2a7fa2['query'][_0x5bc3('0x32')]));_0x212ddd['attributes']=_0x212ddd[_0x5bc3('0x33')][_0x5bc3('0x34')]?_0x212ddd[_0x5bc3('0x33')]:_0x5d939c[_0x5bc3('0x30')];if(_0x2a7fa2['query'][_0x5bc3('0x3d')]){_0x212ddd[_0x5bc3('0x42')]=[{'all':!![]}];}_0x212ddd=_[_0x5bc3('0x3b')]({},_0x212ddd,_0x2a7fa2[_0x5bc3('0x3c')]);return db[_0x5bc3('0x28')][_0x5bc3('0x43')](_0x212ddd)[_0x5bc3('0x22')](handleEntityNotFound(_0x558fc9,null))['then'](respondWithResult(_0x558fc9,null))['catch'](handleError(_0x558fc9,null));};exports[_0x5bc3('0x44')]=function(_0x3d651c,_0x92e47b){return db[_0x5bc3('0x28')][_0x5bc3('0x44')](_0x3d651c['body'],{})['then'](respondWithResult(_0x92e47b,0xc9))[_0x5bc3('0x40')](handleError(_0x92e47b,null));};exports['update']=function(_0x988367,_0x500e22){if(_0x988367[_0x5bc3('0x45')]['id']){delete _0x988367['body']['id'];}return db[_0x5bc3('0x28')][_0x5bc3('0x43')]({'where':{'id':_0x988367[_0x5bc3('0x41')]['id']}})[_0x5bc3('0x22')](handleEntityNotFound(_0x500e22,null))['then'](saveUpdates(_0x988367['body'],null))[_0x5bc3('0x22')](respondWithResult(_0x500e22,null))['catch'](handleError(_0x500e22,null));};exports[_0x5bc3('0x23')]=function(_0x12799e,_0x166973){return db[_0x5bc3('0x28')][_0x5bc3('0x43')]({'where':{'id':_0x12799e[_0x5bc3('0x41')]['id']}})[_0x5bc3('0x22')](handleEntityNotFound(_0x166973,null))[_0x5bc3('0x22')](removeEntity(_0x166973,null))[_0x5bc3('0x40')](handleError(_0x166973,null));};exports['describe']=function(_0x1ef02b,_0x3f7932){return db['MailQueueReport'][_0x5bc3('0x46')]()[_0x5bc3('0x22')](respondWithResult(_0x3f7932,null))[_0x5bc3('0x40')](handleError(_0x3f7932,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 6073434..02fa307 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 _0x31e7=['request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','MailQueueReport','report_mail_queue','uniqueid','util','api','moment','bluebird'];(function(_0x35a7e1,_0x346a12){var _0x4b771e=function(_0x24b0fc){while(--_0x24b0fc){_0x35a7e1['push'](_0x35a7e1['shift']());}};_0x4b771e(++_0x346a12);}(_0x31e7,0x74));var _0x731e=function(_0x12f54f,_0x28b55f){_0x12f54f=_0x12f54f-0x0;var _0x45b7a7=_0x31e7[_0x12f54f];return _0x45b7a7;};'use strict';var _=require('lodash');var util=require(_0x731e('0x0'));var logger=require('../../config/logger')(_0x731e('0x1'));var moment=require(_0x731e('0x2'));var BPromise=require(_0x731e('0x3'));var rp=require(_0x731e('0x4'));var fs=require('fs');var path=require(_0x731e('0x5'));var rimraf=require(_0x731e('0x6'));var config=require(_0x731e('0x7'));var attributes=require(_0x731e('0x8'));module['exports']=function(_0x1a2461,_0x5e12ce){return _0x1a2461['define'](_0x731e('0x9'),attributes,{'tableName':_0x731e('0xa'),'paranoid':![],'indexes':[{'name':_0x731e('0xb'),'fields':[_0x731e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x054c=['exports','define','MailQueueReport','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./mailQueueReport.attributes'];(function(_0x54a7f4,_0x443aca){var _0x200d60=function(_0x2be3ec){while(--_0x2be3ec){_0x54a7f4['push'](_0x54a7f4['shift']());}};_0x200d60(++_0x443aca);}(_0x054c,0x18a));var _0xc054=function(_0x333479,_0x311b7e){_0x333479=_0x333479-0x0;var _0x39d069=_0x054c[_0x333479];return _0x39d069;};'use strict';var _=require(_0xc054('0x0'));var util=require(_0xc054('0x1'));var logger=require(_0xc054('0x2'))(_0xc054('0x3'));var moment=require('moment');var BPromise=require(_0xc054('0x4'));var rp=require(_0xc054('0x5'));var fs=require('fs');var path=require(_0xc054('0x6'));var rimraf=require('rimraf');var config=require(_0xc054('0x7'));var attributes=require(_0xc054('0x8'));module[_0xc054('0x9')]=function(_0x597fb9,_0xec24f3){return _0x597fb9[_0xc054('0xa')](_0xc054('0xb'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xc054('0xc'),'fields':[_0xc054('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index ac71e41..f8c263b 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 _0x4c60=['message','info','catch','CreateMailQueueReport','MailQueueReport','create','raw','update','options','where','attributes','limit','UpdateMailQueueReport','lodash','util','moment','bluebird','ioredis','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code','MailQueueReport,\x20%s,\x20%s'];(function(_0x4c2b29,_0x45bfca){var _0x2bc61c=function(_0x1b3520){while(--_0x1b3520){_0x4c2b29['push'](_0x4c2b29['shift']());}};_0x2bc61c(++_0x45bfca);}(_0x4c60,0xc1));var _0x04c6=function(_0xec0798,_0x44708b){_0xec0798=_0xec0798-0x0;var _0x3048d2=_0x4c60[_0xec0798];return _0x3048d2;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var moment=require(_0x04c6('0x2'));var BPromise=require(_0x04c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04c6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x04c6('0x5'));var jayson=require(_0x04c6('0x6'));var client=jayson[_0x04c6('0x7')][_0x04c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b9041,_0x39be2d,_0x8f9b13){return new BPromise(function(_0x530a48,_0x2a4b51){return client[_0x04c6('0x9')](_0x2b9041,_0x8f9b13)[_0x04c6('0xa')](function(_0x30b901){logger['info']('MailQueueReport,\x20%s,\x20%s',_0x39be2d,'request\x20sent');logger[_0x04c6('0xb')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x39be2d,_0x04c6('0xc'),JSON[_0x04c6('0xd')](_0x30b901));if(_0x30b901['error']){if(_0x30b901[_0x04c6('0xe')][_0x04c6('0xf')]===0x1f4){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x30b901['error'][_0x04c6('0x11')]);return _0x2a4b51(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}logger['error'](_0x04c6('0x10'),_0x39be2d,_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);return _0x530a48(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}else{logger[_0x04c6('0x12')](_0x04c6('0x10'),_0x39be2d,_0x04c6('0xc'));_0x530a48(_0x30b901['result'][_0x04c6('0x11')]);}})[_0x04c6('0x13')](function(_0x382e58){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x382e58);_0x2a4b51(_0x382e58);});});}exports[_0x04c6('0x14')]=function(_0x21674a){var _0x423ea9=this;return new Promise(function(_0x47f400,_0x142065){return db[_0x04c6('0x15')][_0x04c6('0x16')](_0x21674a['body'],{'raw':_0x21674a['options']?_0x21674a['options'][_0x04c6('0x17')]===undefined?!![]:![]:!![]})[_0x04c6('0xa')](function(_0x50dd61){logger['info'](_0x04c6('0x14'),_0x21674a);logger[_0x04c6('0xb')](_0x04c6('0x14'),_0x21674a,JSON['stringify'](_0x50dd61));_0x47f400(_0x50dd61);})[_0x04c6('0x13')](function(_0x13f2dc){logger[_0x04c6('0xe')]('CreateMailQueueReport',_0x13f2dc[_0x04c6('0x11')],_0x21674a);_0x142065(_0x423ea9[_0x04c6('0xe')](0x1f4,_0x13f2dc['message']));});});};exports['UpdateMailQueueReport']=function(_0x4c8d72){var _0x348ea3=this;return new Promise(function(_0x3a2014,_0xd5828d){return db[_0x04c6('0x15')][_0x04c6('0x18')](_0x4c8d72['body'],{'raw':_0x4c8d72['options']?_0x4c8d72[_0x04c6('0x19')][_0x04c6('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c8d72[_0x04c6('0x19')]?_0x4c8d72[_0x04c6('0x19')][_0x04c6('0x1a')]||null:null,'attributes':_0x4c8d72[_0x04c6('0x19')]?_0x4c8d72['options'][_0x04c6('0x1b')]||null:null,'limit':_0x4c8d72[_0x04c6('0x19')]?_0x4c8d72['options'][_0x04c6('0x1c')]||null:null})[_0x04c6('0xa')](function(_0x5f1331){logger['info'](_0x04c6('0x1d'),_0x4c8d72);logger[_0x04c6('0xb')](_0x04c6('0x1d'),_0x4c8d72,JSON[_0x04c6('0xd')](_0x5f1331));_0x3a2014(_0x5f1331);})[_0x04c6('0x13')](function(_0x43884e){logger['error']('UpdateMailQueueReport',_0x43884e['message'],_0x4c8d72);_0xd5828d(_0x348ea3[_0x04c6('0xe')](0x1f4,_0x43884e['message']));});});}; \ No newline at end of file +var _0xd117=['request\x20sent','catch','MailQueueReport','body','options','raw','then','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','code','error','message'];(function(_0x488bfb,_0x22adc7){var _0x5f25cd=function(_0x151e8c){while(--_0x151e8c){_0x488bfb['push'](_0x488bfb['shift']());}};_0x5f25cd(++_0x22adc7);}(_0xd117,0x182));var _0x7d11=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0xd117[_0x4b73a2];return _0x383c66;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var moment=require(_0x7d11('0x2'));var BPromise=require(_0x7d11('0x3'));var rs=require(_0x7d11('0x4'));var fs=require('fs');var Redis=require(_0x7d11('0x5'));var db=require(_0x7d11('0x6'))['db'];var utils=require(_0x7d11('0x7'));var logger=require(_0x7d11('0x8'))(_0x7d11('0x9'));var config=require(_0x7d11('0xa'));var jayson=require(_0x7d11('0xb'));var client=jayson[_0x7d11('0xc')][_0x7d11('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x345602,_0x3c8d66,_0x47b5e6){return new BPromise(function(_0x3803b5,_0xffd020){return client[_0x7d11('0xe')](_0x345602,_0x47b5e6)['then'](function(_0x305eef){logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,'request\x20sent');logger[_0x7d11('0x11')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3c8d66,'request\x20sent',JSON[_0x7d11('0x12')](_0x305eef));if(_0x305eef['error']){if(_0x305eef['error'][_0x7d11('0x13')]===0x1f4){logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')]['message']);return _0xffd020(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);return _0x3803b5(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}else{logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,_0x7d11('0x16'));_0x3803b5(_0x305eef['result'][_0x7d11('0x15')]);}})[_0x7d11('0x17')](function(_0x169733){logger[_0x7d11('0x14')](_0x7d11('0x10'),_0x3c8d66,_0x169733);_0xffd020(_0x169733);});});}exports['CreateMailQueueReport']=function(_0x456cb9){var _0x49a34b=this;return new Promise(function(_0x4d1306,_0x5459df){return db[_0x7d11('0x18')]['create'](_0x456cb9[_0x7d11('0x19')],{'raw':_0x456cb9['options']?_0x456cb9[_0x7d11('0x1a')][_0x7d11('0x1b')]===undefined?!![]:![]:!![]})[_0x7d11('0x1c')](function(_0x46f662){logger[_0x7d11('0xf')](_0x7d11('0x1d'),_0x456cb9);logger[_0x7d11('0x11')](_0x7d11('0x1d'),_0x456cb9,JSON['stringify'](_0x46f662));_0x4d1306(_0x46f662);})[_0x7d11('0x17')](function(_0x4a34f4){logger['error']('CreateMailQueueReport',_0x4a34f4[_0x7d11('0x15')],_0x456cb9);_0x5459df(_0x49a34b[_0x7d11('0x14')](0x1f4,_0x4a34f4[_0x7d11('0x15')]));});});};exports[_0x7d11('0x1e')]=function(_0x355d14){var _0xd938df=this;return new Promise(function(_0x282e5c,_0x1c1edd){return db['MailQueueReport'][_0x7d11('0x1f')](_0x355d14['body'],{'raw':_0x355d14['options']?_0x355d14['options'][_0x7d11('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x355d14['options']?_0x355d14[_0x7d11('0x1a')][_0x7d11('0x20')]||null:null,'attributes':_0x355d14[_0x7d11('0x1a')]?_0x355d14['options'][_0x7d11('0x21')]||null:null,'limit':_0x355d14[_0x7d11('0x1a')]?_0x355d14[_0x7d11('0x1a')]['limit']||null:null})[_0x7d11('0x1c')](function(_0x35a789){logger[_0x7d11('0xf')](_0x7d11('0x1e'),_0x355d14);logger['debug'](_0x7d11('0x1e'),_0x355d14,JSON['stringify'](_0x35a789));_0x282e5c(_0x35a789);})[_0x7d11('0x17')](function(_0x509164){logger[_0x7d11('0x14')](_0x7d11('0x1e'),_0x509164[_0x7d11('0x15')],_0x355d14);_0x1c1edd(_0xd938df['error'](0x1f4,_0x509164['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index cd2b0d2..3c39c87 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 _0xdd4a=['exports','multer','path','express','../../components/auth/service','../../components/interaction/service'];(function(_0x490ed7,_0x58fcf8){var _0x4b6ac0=function(_0x1eb830){while(--_0x1eb830){_0x490ed7['push'](_0x490ed7['shift']());}};_0x4b6ac0(++_0x58fcf8);}(_0xdd4a,0x73));var _0xadd4=function(_0x5fd828,_0xa7ede9){_0x5fd828=_0x5fd828-0x0;var _0x3c1eaa=_0xdd4a[_0x5fd828];return _0x3c1eaa;};'use strict';var multer=require(_0xadd4('0x0'));var util=require('util');var path=require(_0xadd4('0x1'));var timeout=require('connect-timeout');var express=require(_0xadd4('0x2'));var router=express['Router']();var auth=require(_0xadd4('0x3'));var interaction=require(_0xadd4('0x4'));var config=require('../../config/environment');module[_0xadd4('0x5')]=router; \ No newline at end of file +var _0x041b=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','exports'];(function(_0x1d47be,_0xd0b5f8){var _0x4035c2=function(_0x57bc1c){while(--_0x57bc1c){_0x1d47be['push'](_0x1d47be['shift']());}};_0x4035c2(++_0xd0b5f8);}(_0x041b,0x130));var _0xb041=function(_0xbb368c,_0x3e9e88){_0xbb368c=_0xbb368c-0x0;var _0x2df814=_0x041b[_0xbb368c];return _0x2df814;};'use strict';var multer=require(_0xb041('0x0'));var util=require(_0xb041('0x1'));var path=require('path');var timeout=require(_0xb041('0x2'));var express=require(_0xb041('0x3'));var router=express[_0xb041('0x4')]();var auth=require(_0xb041('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb041('0x6'));module[_0xb041('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 a4e9759..dc24aaf 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 _0x5c30=['sequelize','exports','STRING','BOOLEAN','username','INTEGER'];(function(_0x529cc1,_0x4a89a1){var _0x141710=function(_0x154cf8){while(--_0x154cf8){_0x529cc1['push'](_0x529cc1['shift']());}};_0x141710(++_0x4a89a1);}(_0x5c30,0x180));var _0x05c3=function(_0x3a1e85,_0x4921df){_0x3a1e85=_0x3a1e85-0x0;var _0x4f7568=_0x5c30[_0x3a1e85];return _0x4f7568;};'use strict';var Sequelize=require(_0x05c3('0x0'));module[_0x05c3('0x1')]={'description':{'type':Sequelize[_0x05c3('0x2')]},'host':{'type':Sequelize[_0x05c3('0x2')]},'authentication':{'type':Sequelize[_0x05c3('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x05c3('0x2')],'unique':_0x05c3('0x4')},'password':{'type':Sequelize[_0x05c3('0x2')]},'port':{'type':Sequelize[_0x05c3('0x5')]},'tls':{'type':Sequelize[_0x05c3('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x05c3('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x05c3('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x05c3('0x2')]}}; \ No newline at end of file +var _0x22f2=['STRING','BOOLEAN','INTEGER','INBOX','sequelize','exports'];(function(_0x59142f,_0x1334fc){var _0x51c56c=function(_0x4ef205){while(--_0x4ef205){_0x59142f['push'](_0x59142f['shift']());}};_0x51c56c(++_0x1334fc);}(_0x22f2,0xf4));var _0x222f=function(_0x306ed9,_0x5da160){_0x306ed9=_0x306ed9-0x0;var _0x2902f8=_0x22f2[_0x306ed9];return _0x2902f8;};'use strict';var Sequelize=require(_0x222f('0x0'));module[_0x222f('0x1')]={'description':{'type':Sequelize[_0x222f('0x2')]},'host':{'type':Sequelize[_0x222f('0x2')]},'authentication':{'type':Sequelize[_0x222f('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x222f('0x2')],'unique':'username'},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x222f('0x4')]},'tls':{'type':Sequelize[_0x222f('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x222f('0x2')],'defaultValue':_0x222f('0x5')},'connTimeout':{'type':Sequelize[_0x222f('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x222f('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x222f('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 77a010e..c9db966 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 _0xa30a=['path','rimraf','../../config/environment','./mailServerIn.attributes','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var logger=require(_0xaa30('0x2'))('api');var moment=require(_0xaa30('0x3'));var BPromise=require(_0xaa30('0x4'));var rp=require(_0xaa30('0x5'));var fs=require('fs');var path=require(_0xaa30('0x6'));var rimraf=require(_0xaa30('0x7'));var config=require(_0xaa30('0x8'));var attributes=require(_0xaa30('0x9'));module['exports']=function(_0x347cd5,_0x4efe89){return _0x347cd5[_0xaa30('0xa')](_0xaa30('0xb'),attributes,{'tableName':_0xaa30('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ae2=['define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailServerIn.attributes','exports'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x18dbc9,_0x130ca4){_0x18dbc9=_0x18dbc9-0x0;var _0x415a5f=_0x6ae2[_0x18dbc9];return _0x415a5f;};'use strict';var _=require(_0x26ae('0x0'));var util=require(_0x26ae('0x1'));var logger=require(_0x26ae('0x2'))(_0x26ae('0x3'));var moment=require(_0x26ae('0x4'));var BPromise=require(_0x26ae('0x5'));var rp=require(_0x26ae('0x6'));var fs=require('fs');var path=require(_0x26ae('0x7'));var rimraf=require(_0x26ae('0x8'));var config=require('../../config/environment');var attributes=require(_0x26ae('0x9'));module[_0x26ae('0xa')]=function(_0x595da8,_0x5609b0){return _0x595da8[_0x26ae('0xb')](_0x26ae('0xc'),attributes,{'tableName':_0x26ae('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 8e23053..2737252 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 _0x0112=['info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','code','error','MailServerIn,\x20%s,\x20%s','message','result','GetMailServerIn','MailServerIn','raw','options','where','attributes','limit','include','model','map','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x1f73e6,_0x3e8e99){var _0x33b417=function(_0x880cf3){while(--_0x880cf3){_0x1f73e6['push'](_0x1f73e6['shift']());}};_0x33b417(++_0x3e8e99);}(_0x0112,0x1f1));var _0x2011=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x0112[_0x5f09c5];return _0x426ad9;};'use strict';var _=require('lodash');var util=require(_0x2011('0x0'));var moment=require(_0x2011('0x1'));var BPromise=require(_0x2011('0x2'));var rs=require(_0x2011('0x3'));var fs=require('fs');var Redis=require(_0x2011('0x4'));var db=require(_0x2011('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2011('0x6'))(_0x2011('0x7'));var config=require(_0x2011('0x8'));var jayson=require(_0x2011('0x9'));var client=jayson[_0x2011('0xa')][_0x2011('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17a6ea,_0x1a4f56,_0x24dbac){return new BPromise(function(_0x2fd39a,_0x5abd15){return client['request'](_0x17a6ea,_0x24dbac)[_0x2011('0xc')](function(_0xadca22){logger[_0x2011('0xd')]('MailServerIn,\x20%s,\x20%s',_0x1a4f56,_0x2011('0xe'));logger[_0x2011('0xf')](_0x2011('0x10'),_0x1a4f56,'request\x20sent',JSON[_0x2011('0x11')](_0xadca22));if(_0xadca22['error']){if(_0xadca22['error'][_0x2011('0x12')]===0x1f4){logger[_0x2011('0x13')](_0x2011('0x14'),_0x1a4f56,_0xadca22[_0x2011('0x13')][_0x2011('0x15')]);return _0x5abd15(_0xadca22[_0x2011('0x13')][_0x2011('0x15')]);}logger[_0x2011('0x13')](_0x2011('0x14'),_0x1a4f56,_0xadca22['error'][_0x2011('0x15')]);return _0x2fd39a(_0xadca22['error'][_0x2011('0x15')]);}else{logger[_0x2011('0xd')](_0x2011('0x14'),_0x1a4f56,_0x2011('0xe'));_0x2fd39a(_0xadca22[_0x2011('0x16')][_0x2011('0x15')]);}})['catch'](function(_0x53314b){logger[_0x2011('0x13')](_0x2011('0x14'),_0x1a4f56,_0x53314b);_0x5abd15(_0x53314b);});});}exports[_0x2011('0x17')]=function(_0x477236){var _0x38a534=this;return new Promise(function(_0x3593bc,_0x237628){return db[_0x2011('0x18')]['findAll']({'raw':_0x477236['options']?_0x477236['options'][_0x2011('0x19')]===undefined?!![]:![]:!![],'where':_0x477236[_0x2011('0x1a')]?_0x477236[_0x2011('0x1a')][_0x2011('0x1b')]||null:null,'attributes':_0x477236['options']?_0x477236[_0x2011('0x1a')][_0x2011('0x1c')]||null:null,'limit':_0x477236[_0x2011('0x1a')]?_0x477236[_0x2011('0x1a')][_0x2011('0x1d')]||null:null,'include':_0x477236[_0x2011('0x1a')]?_0x477236[_0x2011('0x1a')][_0x2011('0x1e')]?_['map'](_0x477236[_0x2011('0x1a')]['include'],function(_0x30fb40){return{'model':db[_0x30fb40[_0x2011('0x1f')]],'as':_0x30fb40['as'],'attributes':_0x30fb40['attributes'],'include':_0x30fb40[_0x2011('0x1e')]?_[_0x2011('0x20')](_0x30fb40[_0x2011('0x1e')],function(_0x3baf0f){return{'model':db[_0x3baf0f['model']],'as':_0x3baf0f['as'],'attributes':_0x3baf0f[_0x2011('0x1c')],'include':_0x3baf0f['include']?_['map'](_0x3baf0f['include'],function(_0x45c0af){return{'model':db[_0x45c0af['model']],'as':_0x45c0af['as'],'attributes':_0x45c0af[_0x2011('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2011('0xc')](function(_0x52b6c9){logger['info'](_0x2011('0x17'),_0x477236);logger['debug']('GetMailServerIn',_0x477236,JSON[_0x2011('0x11')](_0x52b6c9));_0x3593bc(_0x52b6c9);})[_0x2011('0x21')](function(_0x121077){logger[_0x2011('0x13')](_0x2011('0x17'),_0x121077[_0x2011('0x15')],_0x477236);_0x237628(_0x38a534[_0x2011('0x13')](0x1f4,_0x121077[_0x2011('0x15')]));});});}; \ No newline at end of file +var _0x3466=['jayson/promise','client','http','request','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','MailServerIn,\x20%s,\x20%s','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','where','limit','include','model','attributes','map','then','stringify','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x39cbe4,_0x4a7958){var _0xe76ba7=function(_0x332a08){while(--_0x332a08){_0x39cbe4['push'](_0x39cbe4['shift']());}};_0xe76ba7(++_0x4a7958);}(_0x3466,0xa2));var _0x6346=function(_0x5a92b8,_0x2c2b4d){_0x5a92b8=_0x5a92b8-0x0;var _0x1439a3=_0x3466[_0x5a92b8];return _0x1439a3;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x6346('0x0'));var rs=require(_0x6346('0x1'));var fs=require('fs');var Redis=require(_0x6346('0x2'));var db=require(_0x6346('0x3'))['db'];var utils=require(_0x6346('0x4'));var logger=require(_0x6346('0x5'))(_0x6346('0x6'));var config=require(_0x6346('0x7'));var jayson=require(_0x6346('0x8'));var client=jayson[_0x6346('0x9')][_0x6346('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a321f,_0x1cd931,_0x18f0f0){return new BPromise(function(_0x5aeeee,_0x1396c7){return client[_0x6346('0xb')](_0x2a321f,_0x18f0f0)['then'](function(_0x56a834){logger[_0x6346('0xc')]('MailServerIn,\x20%s,\x20%s',_0x1cd931,_0x6346('0xd'));logger[_0x6346('0xe')](_0x6346('0xf'),_0x1cd931,_0x6346('0xd'),JSON['stringify'](_0x56a834));if(_0x56a834[_0x6346('0x10')]){if(_0x56a834[_0x6346('0x10')][_0x6346('0x11')]===0x1f4){logger[_0x6346('0x10')](_0x6346('0x12'),_0x1cd931,_0x56a834[_0x6346('0x10')]['message']);return _0x1396c7(_0x56a834[_0x6346('0x10')][_0x6346('0x13')]);}logger['error'](_0x6346('0x12'),_0x1cd931,_0x56a834[_0x6346('0x10')][_0x6346('0x13')]);return _0x5aeeee(_0x56a834[_0x6346('0x10')][_0x6346('0x13')]);}else{logger['info'](_0x6346('0x12'),_0x1cd931,_0x6346('0xd'));_0x5aeeee(_0x56a834[_0x6346('0x14')][_0x6346('0x13')]);}})[_0x6346('0x15')](function(_0x497fea){logger[_0x6346('0x10')](_0x6346('0x12'),_0x1cd931,_0x497fea);_0x1396c7(_0x497fea);});});}exports[_0x6346('0x16')]=function(_0x377e4b){var _0x135251=this;return new Promise(function(_0x1e4de3,_0x270e3d){return db[_0x6346('0x17')][_0x6346('0x18')]({'raw':_0x377e4b[_0x6346('0x19')]?_0x377e4b[_0x6346('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x377e4b[_0x6346('0x19')]?_0x377e4b[_0x6346('0x19')][_0x6346('0x1a')]||null:null,'attributes':_0x377e4b[_0x6346('0x19')]?_0x377e4b[_0x6346('0x19')]['attributes']||null:null,'limit':_0x377e4b[_0x6346('0x19')]?_0x377e4b[_0x6346('0x19')][_0x6346('0x1b')]||null:null,'include':_0x377e4b['options']?_0x377e4b['options'][_0x6346('0x1c')]?_['map'](_0x377e4b[_0x6346('0x19')]['include'],function(_0x334d3b){return{'model':db[_0x334d3b[_0x6346('0x1d')]],'as':_0x334d3b['as'],'attributes':_0x334d3b[_0x6346('0x1e')],'include':_0x334d3b[_0x6346('0x1c')]?_[_0x6346('0x1f')](_0x334d3b[_0x6346('0x1c')],function(_0x297b21){return{'model':db[_0x297b21[_0x6346('0x1d')]],'as':_0x297b21['as'],'attributes':_0x297b21[_0x6346('0x1e')],'include':_0x297b21[_0x6346('0x1c')]?_[_0x6346('0x1f')](_0x297b21[_0x6346('0x1c')],function(_0x56e6c0){return{'model':db[_0x56e6c0[_0x6346('0x1d')]],'as':_0x56e6c0['as'],'attributes':_0x56e6c0[_0x6346('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6346('0x20')](function(_0x1a0752){logger[_0x6346('0xc')]('GetMailServerIn',_0x377e4b);logger['debug']('GetMailServerIn',_0x377e4b,JSON[_0x6346('0x21')](_0x1a0752));_0x1e4de3(_0x1a0752);})['catch'](function(_0x4e7fd8){logger['error'](_0x6346('0x16'),_0x4e7fd8[_0x6346('0x13')],_0x377e4b);_0x270e3d(_0x135251[_0x6346('0x10')](0x1f4,_0x4e7fd8[_0x6346('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 8cf6392..4e62749 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 _0xb1a1=['destroy','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get','index','/:id','show','post','isAuthenticated','create','put','update','delete'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb1a1,0x1c9));var _0x1b1a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb1a1[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x1b1a('0x0'));var path=require(_0x1b1a('0x1'));var timeout=require(_0x1b1a('0x2'));var express=require('express');var router=express[_0x1b1a('0x3')]();var auth=require(_0x1b1a('0x4'));var interaction=require(_0x1b1a('0x5'));var config=require(_0x1b1a('0x6'));var controller=require(_0x1b1a('0x7'));router[_0x1b1a('0x8')]('/',auth['isAuthenticated'](),controller[_0x1b1a('0x9')]);router['get'](_0x1b1a('0xa'),auth['isAuthenticated'](),controller[_0x1b1a('0xb')]);router[_0x1b1a('0xc')]('/',auth[_0x1b1a('0xd')](),controller[_0x1b1a('0xe')]);router[_0x1b1a('0xf')](_0x1b1a('0xa'),auth['isAuthenticated'](),controller[_0x1b1a('0x10')]);router[_0x1b1a('0x11')](_0x1b1a('0xa'),auth[_0x1b1a('0xd')](),controller[_0x1b1a('0x12')]);module['exports']=router; \ No newline at end of file +var _0x2bb1=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','index','/:id','create','update','destroy','exports','path','connect-timeout','express','Router'];(function(_0x323e2f,_0x22bdd1){var _0x549c86=function(_0x3169e3){while(--_0x3169e3){_0x323e2f['push'](_0x323e2f['shift']());}};_0x549c86(++_0x22bdd1);}(_0x2bb1,0x18c));var _0x12bb=function(_0x8890cb,_0x1b2c70){_0x8890cb=_0x8890cb-0x0;var _0x325ba9=_0x2bb1[_0x8890cb];return _0x325ba9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x12bb('0x0'));var timeout=require(_0x12bb('0x1'));var express=require(_0x12bb('0x2'));var router=express[_0x12bb('0x3')]();var auth=require(_0x12bb('0x4'));var interaction=require(_0x12bb('0x5'));var config=require(_0x12bb('0x6'));var controller=require(_0x12bb('0x7'));router[_0x12bb('0x8')]('/',auth[_0x12bb('0x9')](),controller[_0x12bb('0xa')]);router[_0x12bb('0x8')](_0x12bb('0xb'),auth[_0x12bb('0x9')](),controller['show']);router['post']('/',auth[_0x12bb('0x9')](),controller[_0x12bb('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x12bb('0xd')]);router['delete'](_0x12bb('0xb'),auth[_0x12bb('0x9')](),controller[_0x12bb('0xe')]);module[_0x12bb('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 362262a..e8941e7 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 _0x63d4=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x58ee29,_0x2f32b5){var _0x3e67cd=function(_0x507a0f){while(--_0x507a0f){_0x58ee29['push'](_0x58ee29['shift']());}};_0x3e67cd(++_0x2f32b5);}(_0x63d4,0x117));var _0x463d=function(_0x37951d,_0x21b6bb){_0x37951d=_0x37951d-0x0;var _0x423b3b=_0x63d4[_0x37951d];return _0x423b3b;};'use strict';var Sequelize=require(_0x463d('0x0'));module[_0x463d('0x1')]={'description':{'type':Sequelize[_0x463d('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x463d('0x2')]},'pass':{'type':Sequelize[_0x463d('0x2')]},'port':{'type':Sequelize[_0x463d('0x3')]},'secure':{'type':Sequelize[_0x463d('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x463d('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xed20=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x2d9c6a,_0x59393d){var _0xf3c918=function(_0x4f3f26){while(--_0x4f3f26){_0x2d9c6a['push'](_0x2d9c6a['shift']());}};_0xf3c918(++_0x59393d);}(_0xed20,0xce));var _0x0ed2=function(_0x1aaed3,_0x5c0045){_0x1aaed3=_0x1aaed3-0x0;var _0x715814=_0xed20[_0x1aaed3];return _0x715814;};'use strict';var Sequelize=require(_0x0ed2('0x0'));module[_0x0ed2('0x1')]={'description':{'type':Sequelize[_0x0ed2('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x0ed2('0x2')]},'pass':{'type':Sequelize[_0x0ed2('0x2')]},'port':{'type':Sequelize[_0x0ed2('0x3')]},'secure':{'type':Sequelize[_0x0ed2('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x0ed2('0x2')]},'authentication':{'type':Sequelize[_0x0ed2('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 e637a11..f253769 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 _0x3815=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','count','status','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','index','map','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','limit','offset','pick','filters','filter','where','merge','VIRTUAL','options','MailServerOut','includeAll','include','findAll','catch','show','params','rawAttributes','create','body','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3815,0x1ea));var _0x5381=function(_0x27a2e8,_0x38dabb){_0x27a2e8=_0x27a2e8-0x0;var _0x5e1af4=_0x3815[_0x27a2e8];return _0x5e1af4;};'use strict';var pdf=require(_0x5381('0x0'));var emlformat=require(_0x5381('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5381('0x2'));var jsonpatch=require(_0x5381('0x3'));var rp=require(_0x5381('0x4'));var moment=require(_0x5381('0x5'));var BPromise=require(_0x5381('0x6'));var Mustache=require(_0x5381('0x7'));var util=require(_0x5381('0x8'));var path=require(_0x5381('0x9'));var sox=require(_0x5381('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x5381('0xb'));var squel=require(_0x5381('0xc'));var crypto=require(_0x5381('0xd'));var jsforce=require(_0x5381('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5381('0xf'));var Redis=require(_0x5381('0x10'));var authService=require(_0x5381('0x11'));var qs=require(_0x5381('0x12'));var as=require(_0x5381('0x13'));var hardwareService=require(_0x5381('0x14'));var logger=require(_0x5381('0x15'))(_0x5381('0x16'));var utils=require(_0x5381('0x17'));var config=require(_0x5381('0x18'));var db=require(_0x5381('0x19'))['db'];function respondWithStatusCode(_0x973ea2,_0x3dee8c){_0x3dee8c=_0x3dee8c||0xcc;return function(_0x30bbd4){if(_0x30bbd4){return _0x973ea2[_0x5381('0x1a')](_0x3dee8c);}return _0x973ea2['status'](_0x3dee8c)['end']();};}function respondWithResult(_0x3cb412,_0x171ba7){_0x171ba7=_0x171ba7||0xc8;return function(_0x3a8cbb){if(_0x3a8cbb){return _0x3cb412['status'](_0x171ba7)[_0x5381('0x1b')](_0x3a8cbb);}};}function respondWithFilteredResult(_0x1dcab9,_0x2fc418){return function(_0x356300){if(_0x356300){var _0x3ffc0c=_0x356300[_0x5381('0x1c')],_0x2adeac=_0x2fc418['offset'],_0x4c44d2=_0x2fc418['offset']+_0x2fc418['limit'],_0x2f44bb;if(_0x4c44d2>=_0x3ffc0c){_0x4c44d2=_0x3ffc0c;_0x2f44bb=0xc8;}else{_0x2f44bb=0xce;}_0x1dcab9[_0x5381('0x1d')](_0x2f44bb);return _0x1dcab9[_0x5381('0x1e')](_0x5381('0x1f'),_0x2adeac+'-'+_0x4c44d2+'/'+_0x3ffc0c)[_0x5381('0x1b')](_0x356300);}return null;};}function patchUpdates(_0x415d03){return function(_0xff8804){try{jsonpatch[_0x5381('0x20')](_0xff8804,_0x415d03,!![]);}catch(_0x26ea1d){return BPromise[_0x5381('0x21')](_0x26ea1d);}return _0xff8804[_0x5381('0x22')]();};}function saveUpdates(_0x440330,_0x5456c1){return function(_0x5e1327){if(_0x5e1327){return _0x5e1327[_0x5381('0x23')](_0x440330)[_0x5381('0x24')](function(_0x55a994){return _0x55a994;});}return null;};}function removeEntity(_0x3741bd,_0x320673){return function(_0x4d9d58){if(_0x4d9d58){return _0x4d9d58[_0x5381('0x25')]()[_0x5381('0x24')](function(){_0x3741bd[_0x5381('0x1d')](0xcc)[_0x5381('0x26')]();});}};}function handleEntityNotFound(_0x3f717d,_0x266218){return function(_0x41694e){if(!_0x41694e){_0x3f717d[_0x5381('0x1a')](0x194);}return _0x41694e;};}function handleError(_0x38540d,_0x3151f6){_0x3151f6=_0x3151f6||0x1f4;return function(_0x494958){logger['error'](_0x494958[_0x5381('0x27')]);if(_0x494958[_0x5381('0x28')]){delete _0x494958['name'];}_0x38540d['status'](_0x3151f6)['send'](_0x494958);};}exports[_0x5381('0x29')]=function(_0x448cec,_0x30c800){var _0xf137da={},_0x8ca0e1={},_0x2a542c={'count':0x0,'rows':[]};var _0x4abab9=_[_0x5381('0x2a')](db['MailServerOut']['rawAttributes'],function(_0x299734){return{'name':_0x299734[_0x5381('0x2b')],'type':_0x299734[_0x5381('0x2c')][_0x5381('0x2d')]};});_0x8ca0e1['model']=_[_0x5381('0x2a')](_0x4abab9,_0x5381('0x28'));_0x8ca0e1[_0x5381('0x2e')]=_[_0x5381('0x2f')](_0x448cec[_0x5381('0x2e')]);_0x8ca0e1['filters']=_[_0x5381('0x30')](_0x8ca0e1['model'],_0x8ca0e1['query']);_0xf137da['attributes']=_[_0x5381('0x30')](_0x8ca0e1[_0x5381('0x31')],qs[_0x5381('0x32')](_0x448cec[_0x5381('0x2e')][_0x5381('0x32')]));_0xf137da[_0x5381('0x33')]=_0xf137da['attributes'][_0x5381('0x34')]?_0xf137da['attributes']:_0x8ca0e1['model'];if(!_0x448cec[_0x5381('0x2e')]['hasOwnProperty']('nolimit')){_0xf137da['limit']=qs[_0x5381('0x35')](_0x448cec['query'][_0x5381('0x35')]);_0xf137da['offset']=qs[_0x5381('0x36')](_0x448cec[_0x5381('0x2e')][_0x5381('0x36')]);}_0xf137da['order']=qs['sort'](_0x448cec[_0x5381('0x2e')]['sort']);_0xf137da['where']=qs['filters'](_[_0x5381('0x37')](_0x448cec['query'],_0x8ca0e1[_0x5381('0x38')]));if(_0x448cec[_0x5381('0x2e')][_0x5381('0x39')]){_0xf137da[_0x5381('0x3a')]=_[_0x5381('0x3b')](_0xf137da[_0x5381('0x3a')],{'$or':_[_0x5381('0x2a')](_0x4abab9,function(_0x2e260f){if(_0x2e260f[_0x5381('0x2c')]!==_0x5381('0x3c')){var _0x15f0f3={};_0x15f0f3[_0x2e260f[_0x5381('0x28')]]={'$like':'%'+_0x448cec[_0x5381('0x2e')][_0x5381('0x39')]+'%'};return _0x15f0f3;}})});}_0xf137da=_['merge']({},_0xf137da,_0x448cec[_0x5381('0x3d')]);var _0x52058e={'where':_0xf137da['where']};return db[_0x5381('0x3e')][_0x5381('0x1c')](_0x52058e)['then'](function(_0x208e37){_0x2a542c[_0x5381('0x1c')]=_0x208e37;if(_0x448cec[_0x5381('0x2e')][_0x5381('0x3f')]){_0xf137da[_0x5381('0x40')]=[{'all':!![]}];}return db['MailServerOut'][_0x5381('0x41')](_0xf137da);})[_0x5381('0x24')](function(_0x5b0bb3){_0x2a542c['rows']=_0x5b0bb3;return _0x2a542c;})[_0x5381('0x24')](respondWithFilteredResult(_0x30c800,_0xf137da))[_0x5381('0x42')](handleError(_0x30c800,null));};exports[_0x5381('0x43')]=function(_0xdabf69,_0x174a20){var _0x5aad1d={'raw':!![],'where':{'id':_0xdabf69[_0x5381('0x44')]['id']}},_0x9c1189={};_0x9c1189[_0x5381('0x31')]=_['keys'](db['MailServerOut'][_0x5381('0x45')]);_0x9c1189[_0x5381('0x2e')]=_[_0x5381('0x2f')](_0xdabf69['query']);_0x9c1189[_0x5381('0x38')]=_[_0x5381('0x30')](_0x9c1189[_0x5381('0x31')],_0x9c1189[_0x5381('0x2e')]);_0x5aad1d[_0x5381('0x33')]=_[_0x5381('0x30')](_0x9c1189[_0x5381('0x31')],qs[_0x5381('0x32')](_0xdabf69[_0x5381('0x2e')][_0x5381('0x32')]));_0x5aad1d[_0x5381('0x33')]=_0x5aad1d['attributes'][_0x5381('0x34')]?_0x5aad1d[_0x5381('0x33')]:_0x9c1189['model'];if(_0xdabf69[_0x5381('0x2e')]['includeAll']){_0x5aad1d[_0x5381('0x40')]=[{'all':!![]}];}_0x5aad1d=_[_0x5381('0x3b')]({},_0x5aad1d,_0xdabf69[_0x5381('0x3d')]);return db[_0x5381('0x3e')]['find'](_0x5aad1d)[_0x5381('0x24')](handleEntityNotFound(_0x174a20,null))[_0x5381('0x24')](respondWithResult(_0x174a20,null))[_0x5381('0x42')](handleError(_0x174a20,null));};exports[_0x5381('0x46')]=function(_0x16e559,_0x5dbbbc){return db[_0x5381('0x3e')][_0x5381('0x46')](_0x16e559[_0x5381('0x47')],{})[_0x5381('0x24')](respondWithResult(_0x5dbbbc,0xc9))[_0x5381('0x42')](handleError(_0x5dbbbc,null));};exports[_0x5381('0x23')]=function(_0x2f74ea,_0x272aad){if(_0x2f74ea[_0x5381('0x47')]['id']){delete _0x2f74ea[_0x5381('0x47')]['id'];}return db[_0x5381('0x3e')][_0x5381('0x48')]({'where':{'id':_0x2f74ea['params']['id']}})[_0x5381('0x24')](handleEntityNotFound(_0x272aad,null))['then'](saveUpdates(_0x2f74ea['body'],null))[_0x5381('0x24')](respondWithResult(_0x272aad,null))[_0x5381('0x42')](handleError(_0x272aad,null));};exports[_0x5381('0x25')]=function(_0x56c268,_0x3bcffc){return db[_0x5381('0x3e')][_0x5381('0x48')]({'where':{'id':_0x56c268[_0x5381('0x44')]['id']}})['then'](handleEntityNotFound(_0x3bcffc,null))[_0x5381('0x24')](removeEntity(_0x3bcffc,null))[_0x5381('0x42')](handleError(_0x3bcffc,null));}; \ No newline at end of file +var _0x5278=['MailServerOut','intersection','merge','create','body','find','eml-format','rimraf','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','catch','params'];(function(_0x24502f,_0x134350){var _0x402fd9=function(_0x5e90b2){while(--_0x5e90b2){_0x24502f['push'](_0x24502f['shift']());}};_0x402fd9(++_0x134350);}(_0x5278,0x1b0));var _0x8527=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x5278[_0x18ab2a];return _0x16dcee;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8527('0x0'));var rimraf=require(_0x8527('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8527('0x2'));var moment=require(_0x8527('0x3'));var BPromise=require(_0x8527('0x4'));var Mustache=require('mustache');var util=require(_0x8527('0x5'));var path=require(_0x8527('0x6'));var sox=require('sox');var csv=require(_0x8527('0x7'));var ejs=require(_0x8527('0x8'));var fs=require('fs');var _=require(_0x8527('0x9'));var squel=require(_0x8527('0xa'));var crypto=require(_0x8527('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8527('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8527('0xd'));var Papa=require(_0x8527('0xe'));var Redis=require(_0x8527('0xf'));var authService=require(_0x8527('0x10'));var qs=require(_0x8527('0x11'));var as=require(_0x8527('0x12'));var hardwareService=require(_0x8527('0x13'));var logger=require(_0x8527('0x14'))('api');var utils=require(_0x8527('0x15'));var config=require(_0x8527('0x16'));var db=require(_0x8527('0x17'))['db'];function respondWithStatusCode(_0x400c5a,_0x1b2bac){_0x1b2bac=_0x1b2bac||0xcc;return function(_0x48ca05){if(_0x48ca05){return _0x400c5a[_0x8527('0x18')](_0x1b2bac);}return _0x400c5a[_0x8527('0x19')](_0x1b2bac)['end']();};}function respondWithResult(_0x36431b,_0x29a651){_0x29a651=_0x29a651||0xc8;return function(_0xce9a01){if(_0xce9a01){return _0x36431b['status'](_0x29a651)['json'](_0xce9a01);}};}function respondWithFilteredResult(_0x4ac6ee,_0x2a656c){return function(_0x151399){if(_0x151399){var _0x4e709c=_0x151399[_0x8527('0x1a')],_0x5acf58=_0x2a656c['offset'],_0x162903=_0x2a656c[_0x8527('0x1b')]+_0x2a656c[_0x8527('0x1c')],_0x251aa5;if(_0x162903>=_0x4e709c){_0x162903=_0x4e709c;_0x251aa5=0xc8;}else{_0x251aa5=0xce;}_0x4ac6ee[_0x8527('0x19')](_0x251aa5);return _0x4ac6ee['set'](_0x8527('0x1d'),_0x5acf58+'-'+_0x162903+'/'+_0x4e709c)['json'](_0x151399);}return null;};}function patchUpdates(_0x1a5969){return function(_0x36e84b){try{jsonpatch[_0x8527('0x1e')](_0x36e84b,_0x1a5969,!![]);}catch(_0x32d6d3){return BPromise[_0x8527('0x1f')](_0x32d6d3);}return _0x36e84b[_0x8527('0x20')]();};}function saveUpdates(_0x2e2d56,_0x3fcc07){return function(_0x5371b1){if(_0x5371b1){return _0x5371b1[_0x8527('0x21')](_0x2e2d56)[_0x8527('0x22')](function(_0x35c6a3){return _0x35c6a3;});}return null;};}function removeEntity(_0x40a0ea,_0x220b26){return function(_0x503e2d){if(_0x503e2d){return _0x503e2d['destroy']()[_0x8527('0x22')](function(){_0x40a0ea[_0x8527('0x19')](0xcc)[_0x8527('0x23')]();});}};}function handleEntityNotFound(_0x53f11d,_0x46f221){return function(_0x306ad0){if(!_0x306ad0){_0x53f11d[_0x8527('0x18')](0x194);}return _0x306ad0;};}function handleError(_0x2b89ec,_0x544a60){_0x544a60=_0x544a60||0x1f4;return function(_0x27c996){logger['error'](_0x27c996[_0x8527('0x24')]);if(_0x27c996[_0x8527('0x25')]){delete _0x27c996[_0x8527('0x25')];}_0x2b89ec[_0x8527('0x19')](_0x544a60)[_0x8527('0x26')](_0x27c996);};}exports[_0x8527('0x27')]=function(_0x46811c,_0x1d4ebe){var _0x58f1f9={},_0x31ea1f={},_0x23be85={'count':0x0,'rows':[]};var _0x17498a=_['map'](db['MailServerOut'][_0x8527('0x28')],function(_0x3d272f){return{'name':_0x3d272f[_0x8527('0x29')],'type':_0x3d272f[_0x8527('0x2a')]['key']};});_0x31ea1f[_0x8527('0x2b')]=_[_0x8527('0x2c')](_0x17498a,_0x8527('0x25'));_0x31ea1f[_0x8527('0x2d')]=_[_0x8527('0x2e')](_0x46811c[_0x8527('0x2d')]);_0x31ea1f[_0x8527('0x2f')]=_['intersection'](_0x31ea1f[_0x8527('0x2b')],_0x31ea1f[_0x8527('0x2d')]);_0x58f1f9['attributes']=_['intersection'](_0x31ea1f[_0x8527('0x2b')],qs[_0x8527('0x30')](_0x46811c[_0x8527('0x2d')][_0x8527('0x30')]));_0x58f1f9['attributes']=_0x58f1f9[_0x8527('0x31')][_0x8527('0x32')]?_0x58f1f9[_0x8527('0x31')]:_0x31ea1f[_0x8527('0x2b')];if(!_0x46811c[_0x8527('0x2d')][_0x8527('0x33')](_0x8527('0x34'))){_0x58f1f9[_0x8527('0x1c')]=qs[_0x8527('0x1c')](_0x46811c[_0x8527('0x2d')]['limit']);_0x58f1f9['offset']=qs['offset'](_0x46811c[_0x8527('0x2d')][_0x8527('0x1b')]);}_0x58f1f9[_0x8527('0x35')]=qs[_0x8527('0x36')](_0x46811c['query'][_0x8527('0x36')]);_0x58f1f9[_0x8527('0x37')]=qs[_0x8527('0x2f')](_[_0x8527('0x38')](_0x46811c[_0x8527('0x2d')],_0x31ea1f[_0x8527('0x2f')]));if(_0x46811c['query']['filter']){_0x58f1f9['where']=_['merge'](_0x58f1f9['where'],{'$or':_[_0x8527('0x2c')](_0x17498a,function(_0x13d8d4){if(_0x13d8d4[_0x8527('0x2a')]!==_0x8527('0x39')){var _0x12c732={};_0x12c732[_0x13d8d4[_0x8527('0x25')]]={'$like':'%'+_0x46811c[_0x8527('0x2d')][_0x8527('0x3a')]+'%'};return _0x12c732;}})});}_0x58f1f9=_['merge']({},_0x58f1f9,_0x46811c[_0x8527('0x3b')]);var _0x4ca4d1={'where':_0x58f1f9[_0x8527('0x37')]};return db['MailServerOut'][_0x8527('0x1a')](_0x4ca4d1)[_0x8527('0x22')](function(_0x2d53a5){_0x23be85['count']=_0x2d53a5;if(_0x46811c['query'][_0x8527('0x3c')]){_0x58f1f9[_0x8527('0x3d')]=[{'all':!![]}];}return db['MailServerOut'][_0x8527('0x3e')](_0x58f1f9);})['then'](function(_0x214a62){_0x23be85['rows']=_0x214a62;return _0x23be85;})[_0x8527('0x22')](respondWithFilteredResult(_0x1d4ebe,_0x58f1f9))[_0x8527('0x3f')](handleError(_0x1d4ebe,null));};exports['show']=function(_0x2883e0,_0x18ef15){var _0x1f717d={'raw':!![],'where':{'id':_0x2883e0[_0x8527('0x40')]['id']}},_0x1d2667={};_0x1d2667[_0x8527('0x2b')]=_[_0x8527('0x2e')](db[_0x8527('0x41')][_0x8527('0x28')]);_0x1d2667[_0x8527('0x2d')]=_['keys'](_0x2883e0['query']);_0x1d2667['filters']=_[_0x8527('0x42')](_0x1d2667[_0x8527('0x2b')],_0x1d2667[_0x8527('0x2d')]);_0x1f717d[_0x8527('0x31')]=_[_0x8527('0x42')](_0x1d2667[_0x8527('0x2b')],qs[_0x8527('0x30')](_0x2883e0[_0x8527('0x2d')][_0x8527('0x30')]));_0x1f717d[_0x8527('0x31')]=_0x1f717d[_0x8527('0x31')][_0x8527('0x32')]?_0x1f717d[_0x8527('0x31')]:_0x1d2667['model'];if(_0x2883e0[_0x8527('0x2d')][_0x8527('0x3c')]){_0x1f717d['include']=[{'all':!![]}];}_0x1f717d=_[_0x8527('0x43')]({},_0x1f717d,_0x2883e0[_0x8527('0x3b')]);return db[_0x8527('0x41')]['find'](_0x1f717d)[_0x8527('0x22')](handleEntityNotFound(_0x18ef15,null))['then'](respondWithResult(_0x18ef15,null))[_0x8527('0x3f')](handleError(_0x18ef15,null));};exports[_0x8527('0x44')]=function(_0x5b0740,_0x4a50b7){return db['MailServerOut'][_0x8527('0x44')](_0x5b0740['body'],{})['then'](respondWithResult(_0x4a50b7,0xc9))[_0x8527('0x3f')](handleError(_0x4a50b7,null));};exports[_0x8527('0x21')]=function(_0x22119d,_0xf3fb8){if(_0x22119d[_0x8527('0x45')]['id']){delete _0x22119d['body']['id'];}return db[_0x8527('0x41')][_0x8527('0x46')]({'where':{'id':_0x22119d[_0x8527('0x40')]['id']}})[_0x8527('0x22')](handleEntityNotFound(_0xf3fb8,null))[_0x8527('0x22')](saveUpdates(_0x22119d[_0x8527('0x45')],null))[_0x8527('0x22')](respondWithResult(_0xf3fb8,null))[_0x8527('0x3f')](handleError(_0xf3fb8,null));};exports['destroy']=function(_0x4e3ccc,_0x16829b){return db['MailServerOut']['find']({'where':{'id':_0x4e3ccc['params']['id']}})[_0x8527('0x22')](handleEntityNotFound(_0x16829b,null))[_0x8527('0x22')](removeEntity(_0x16829b,null))[_0x8527('0x3f')](handleError(_0x16829b,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 5899732..ba4c428 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 _0xdc97=['path','../../config/environment','./mailServerOut.attributes','exports','define','lodash','util','../../config/logger','moment','request-promise'];(function(_0x4492af,_0x47e25d){var _0x216729=function(_0x4964c8){while(--_0x4964c8){_0x4492af['push'](_0x4492af['shift']());}};_0x216729(++_0x47e25d);}(_0xdc97,0x13b));var _0x7dc9=function(_0x32d316,_0x4d8c98){_0x32d316=_0x32d316-0x0;var _0x2abe04=_0xdc97[_0x32d316];return _0x2abe04;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var logger=require(_0x7dc9('0x2'))('api');var moment=require(_0x7dc9('0x3'));var BPromise=require('bluebird');var rp=require(_0x7dc9('0x4'));var fs=require('fs');var path=require(_0x7dc9('0x5'));var rimraf=require('rimraf');var config=require(_0x7dc9('0x6'));var attributes=require(_0x7dc9('0x7'));module[_0x7dc9('0x8')]=function(_0x3ba3ca,_0x589f02){return _0x3ba3ca[_0x7dc9('0x9')]('MailServerOut',attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x31f0=['./mailServerOut.attributes','define','mail_servers_out','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x556a3a,_0x1d64fd){var _0x1df5cb=function(_0x49b633){while(--_0x49b633){_0x556a3a['push'](_0x556a3a['shift']());}};_0x1df5cb(++_0x1d64fd);}(_0x31f0,0xb7));var _0x031f=function(_0x5d1416,_0x24857a){_0x5d1416=_0x5d1416-0x0;var _0x43e711=_0x31f0[_0x5d1416];return _0x43e711;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var logger=require(_0x031f('0x1'))('api');var moment=require(_0x031f('0x2'));var BPromise=require(_0x031f('0x3'));var rp=require(_0x031f('0x4'));var fs=require('fs');var path=require(_0x031f('0x5'));var rimraf=require('rimraf');var config=require(_0x031f('0x6'));var attributes=require(_0x031f('0x7'));module['exports']=function(_0x4c0f94,_0x56328c){return _0x4c0f94[_0x031f('0x8')]('MailServerOut',attributes,{'tableName':_0x031f('0x9'),'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 567dfd3..f36fbb6 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 _0xa855=['MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x48db98,_0x2a40e4){var _0x11363f=function(_0x44bf99){while(--_0x44bf99){_0x48db98['push'](_0x48db98['shift']());}};_0x11363f(++_0x2a40e4);}(_0xa855,0x137));var _0x5a85=function(_0x1a05d8,_0x188aba){_0x1a05d8=_0x1a05d8-0x0;var _0x1f16bf=_0xa855[_0x1a05d8];return _0x1f16bf;};'use strict';var _=require(_0x5a85('0x0'));var util=require(_0x5a85('0x1'));var moment=require(_0x5a85('0x2'));var BPromise=require(_0x5a85('0x3'));var rs=require(_0x5a85('0x4'));var fs=require('fs');var Redis=require(_0x5a85('0x5'));var db=require(_0x5a85('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5a85('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5a85('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x29f8a2,_0x469396,_0x468888){return new BPromise(function(_0x201a6c,_0xd082be){return client['request'](_0x29f8a2,_0x468888)[_0x5a85('0x9')](function(_0x415b9d){logger['info'](_0x5a85('0xa'),_0x469396,_0x5a85('0xb'));logger[_0x5a85('0xc')](_0x5a85('0xd'),_0x469396,'request\x20sent',JSON[_0x5a85('0xe')](_0x415b9d));if(_0x415b9d[_0x5a85('0xf')]){if(_0x415b9d['error']['code']===0x1f4){logger[_0x5a85('0xf')](_0x5a85('0xa'),_0x469396,_0x415b9d[_0x5a85('0xf')][_0x5a85('0x10')]);return _0xd082be(_0x415b9d['error'][_0x5a85('0x10')]);}logger[_0x5a85('0xf')]('MailServerOut,\x20%s,\x20%s',_0x469396,_0x415b9d[_0x5a85('0xf')][_0x5a85('0x10')]);return _0x201a6c(_0x415b9d[_0x5a85('0xf')][_0x5a85('0x10')]);}else{logger['info']('MailServerOut,\x20%s,\x20%s',_0x469396,_0x5a85('0xb'));_0x201a6c(_0x415b9d['result']['message']);}})[_0x5a85('0x11')](function(_0x455003){logger['error'](_0x5a85('0xa'),_0x469396,_0x455003);_0xd082be(_0x455003);});});} \ No newline at end of file +var _0xa014=['request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailServerOut,\x20%s,\x20%s'];(function(_0x3a687c,_0xd77325){var _0x43e58d=function(_0x248791){while(--_0x248791){_0x3a687c['push'](_0x3a687c['shift']());}};_0x43e58d(++_0xd77325);}(_0xa014,0xcf));var _0x4a01=function(_0x74f381,_0x4a5990){_0x74f381=_0x74f381-0x0;var _0x40962c=_0xa014[_0x74f381];return _0x40962c;};'use strict';var _=require('lodash');var util=require(_0x4a01('0x0'));var moment=require(_0x4a01('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4a01('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4a01('0x3'));var logger=require(_0x4a01('0x4'))(_0x4a01('0x5'));var config=require(_0x4a01('0x6'));var jayson=require(_0x4a01('0x7'));var client=jayson[_0x4a01('0x8')][_0x4a01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f4c06,_0x434669,_0x55ee78){return new BPromise(function(_0x4059e1,_0x3463b7){return client['request'](_0x5f4c06,_0x55ee78)[_0x4a01('0xa')](function(_0x3ee7be){logger[_0x4a01('0xb')](_0x4a01('0xc'),_0x434669,_0x4a01('0xd'));logger[_0x4a01('0xe')](_0x4a01('0xf'),_0x434669,'request\x20sent',JSON[_0x4a01('0x10')](_0x3ee7be));if(_0x3ee7be[_0x4a01('0x11')]){if(_0x3ee7be[_0x4a01('0x11')]['code']===0x1f4){logger['error']('MailServerOut,\x20%s,\x20%s',_0x434669,_0x3ee7be[_0x4a01('0x11')]['message']);return _0x3463b7(_0x3ee7be[_0x4a01('0x11')][_0x4a01('0x12')]);}logger[_0x4a01('0x11')](_0x4a01('0xc'),_0x434669,_0x3ee7be[_0x4a01('0x11')][_0x4a01('0x12')]);return _0x4059e1(_0x3ee7be[_0x4a01('0x11')][_0x4a01('0x12')]);}else{logger[_0x4a01('0xb')]('MailServerOut,\x20%s,\x20%s',_0x434669,_0x4a01('0xd'));_0x4059e1(_0x3ee7be[_0x4a01('0x13')][_0x4a01('0x12')]);}})['catch'](function(_0x4c65ba){logger['error']('MailServerOut,\x20%s,\x20%s',_0x434669,_0x4c65ba);_0x3463b7(_0x4c65ba);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 26c5c72..eb44fc0 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 _0xbfd3=['../../components/auth/service','../../config/environment','./mailSubstatus.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0xa409ae,_0x1fb79c){var _0x4b2b0b=function(_0x5c56a6){while(--_0x5c56a6){_0xa409ae['push'](_0xa409ae['shift']());}};_0x4b2b0b(++_0x1fb79c);}(_0xbfd3,0x14b));var _0x3bfd=function(_0x390982,_0x3c172c){_0x390982=_0x390982-0x0;var _0x35a0f7=_0xbfd3[_0x390982];return _0x35a0f7;};'use strict';var multer=require(_0x3bfd('0x0'));var util=require(_0x3bfd('0x1'));var path=require(_0x3bfd('0x2'));var timeout=require(_0x3bfd('0x3'));var express=require('express');var router=express[_0x3bfd('0x4')]();var auth=require(_0x3bfd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3bfd('0x6'));var controller=require(_0x3bfd('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3bfd('0x8')]);router[_0x3bfd('0x9')](_0x3bfd('0xa'),auth[_0x3bfd('0xb')](),controller[_0x3bfd('0xc')]);router[_0x3bfd('0x9')](_0x3bfd('0xd'),auth[_0x3bfd('0xb')](),controller[_0x3bfd('0xe')]);router[_0x3bfd('0xf')]('/',auth[_0x3bfd('0xb')](),controller[_0x3bfd('0x10')]);router[_0x3bfd('0x11')](_0x3bfd('0xd'),auth[_0x3bfd('0xb')](),controller[_0x3bfd('0x12')]);router['delete'](_0x3bfd('0xd'),auth[_0x3bfd('0xb')](),controller[_0x3bfd('0x13')]);module[_0x3bfd('0x14')]=router; \ No newline at end of file +var _0xfb70=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x23a85f,_0x57673e){var _0x1bd2ab=function(_0x220c13){while(--_0x220c13){_0x23a85f['push'](_0x23a85f['shift']());}};_0x1bd2ab(++_0x57673e);}(_0xfb70,0x9b));var _0x0fb7=function(_0x25aef5,_0x2458e0){_0x25aef5=_0x25aef5-0x0;var _0x563204=_0xfb70[_0x25aef5];return _0x563204;};'use strict';var multer=require(_0x0fb7('0x0'));var util=require('util');var path=require(_0x0fb7('0x1'));var timeout=require(_0x0fb7('0x2'));var express=require('express');var router=express[_0x0fb7('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0fb7('0x4'));var config=require(_0x0fb7('0x5'));var controller=require('./mailSubstatus.controller');router[_0x0fb7('0x6')]('/',auth[_0x0fb7('0x7')](),controller[_0x0fb7('0x8')]);router[_0x0fb7('0x6')](_0x0fb7('0x9'),auth['isAuthenticated'](),controller[_0x0fb7('0xa')]);router['get'](_0x0fb7('0xb'),auth['isAuthenticated'](),controller[_0x0fb7('0xc')]);router[_0x0fb7('0xd')]('/',auth[_0x0fb7('0x7')](),controller[_0x0fb7('0xe')]);router[_0x0fb7('0xf')](_0x0fb7('0xb'),auth[_0x0fb7('0x7')](),controller[_0x0fb7('0x10')]);router[_0x0fb7('0x11')]('/:id',auth[_0x0fb7('0x7')](),controller[_0x0fb7('0x12')]);module[_0x0fb7('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 43a7832..8db49a5 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 _0xa064=['STRING','name','sequelize','exports'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0xa064,0x192));var _0x4a06=function(_0x214642,_0xc9fac6){_0x214642=_0x214642-0x0;var _0x4ec937=_0xa064[_0x214642];return _0x4ec937;};'use strict';var Sequelize=require(_0x4a06('0x0'));module[_0x4a06('0x1')]={'name':{'type':Sequelize[_0x4a06('0x2')],'unique':_0x4a06('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4a06('0x2')]}}; \ No newline at end of file +var _0x8e3f=['STRING','sequelize','exports'];(function(_0x25ae3c,_0x2dc5ff){var _0x5aad9e=function(_0x4e6124){while(--_0x4e6124){_0x25ae3c['push'](_0x25ae3c['shift']());}};_0x5aad9e(++_0x2dc5ff);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8e3f[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xf8e3('0x0'));module[_0xf8e3('0x1')]={'name':{'type':Sequelize[_0xf8e3('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf8e3('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 106c210..98bdac7 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 _0x5fc3=['sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','then','sendStatus','error','stack','name','send','index','MailSubstatus','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x5fc3,0xa8));var _0x35fc=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0x5fc3[_0xb833b1];return _0x1ab87a;};'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'];function respondWithStatusCode(_0x5469f5,_0x4cbe74){_0x4cbe74=_0x4cbe74||0xcc;return function(_0x409357){if(_0x409357){return _0x5469f5['sendStatus'](_0x4cbe74);}return _0x5469f5[_0x35fc('0x18')](_0x4cbe74)[_0x35fc('0x19')]();};}function respondWithResult(_0x2a6ad2,_0x29730f){_0x29730f=_0x29730f||0xc8;return function(_0x38d9f2){if(_0x38d9f2){return _0x2a6ad2['status'](_0x29730f)['json'](_0x38d9f2);}};}function respondWithFilteredResult(_0x5eac0f,_0x558364){return function(_0x398b67){if(_0x398b67){var _0x229d56=_0x398b67[_0x35fc('0x1a')],_0x53b898=_0x558364['offset'],_0x154958=_0x558364[_0x35fc('0x1b')]+_0x558364[_0x35fc('0x1c')],_0x227a49;if(_0x154958>=_0x229d56){_0x154958=_0x229d56;_0x227a49=0xc8;}else{_0x227a49=0xce;}_0x5eac0f['status'](_0x227a49);return _0x5eac0f[_0x35fc('0x1d')](_0x35fc('0x1e'),_0x53b898+'-'+_0x154958+'/'+_0x229d56)[_0x35fc('0x1f')](_0x398b67);}return null;};}function patchUpdates(_0x5f56c6){return function(_0x1a86e9){try{jsonpatch[_0x35fc('0x20')](_0x1a86e9,_0x5f56c6,!![]);}catch(_0x465eb3){return BPromise['reject'](_0x465eb3);}return _0x1a86e9[_0x35fc('0x21')]();};}function saveUpdates(_0x350a27,_0x3229d1){return function(_0x251a1f){if(_0x251a1f){return _0x251a1f[_0x35fc('0x22')](_0x350a27)[_0x35fc('0x23')](function(_0x155016){return _0x155016;});}return null;};}function removeEntity(_0x3b05b0,_0x2405e8){return function(_0x427eae){if(_0x427eae){return _0x427eae['destroy']()[_0x35fc('0x23')](function(){_0x3b05b0[_0x35fc('0x18')](0xcc)[_0x35fc('0x19')]();});}};}function handleEntityNotFound(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(!_0x55e9e7){_0x2d8183[_0x35fc('0x24')](0x194);}return _0x55e9e7;};}function handleError(_0x4c587a,_0x561bf8){_0x561bf8=_0x561bf8||0x1f4;return function(_0x265324){logger[_0x35fc('0x25')](_0x265324[_0x35fc('0x26')]);if(_0x265324['name']){delete _0x265324[_0x35fc('0x27')];}_0x4c587a['status'](_0x561bf8)[_0x35fc('0x28')](_0x265324);};}exports[_0x35fc('0x29')]=function(_0x5cb986,_0x519264){var _0x47774c={},_0x58edb6={},_0x274208={'count':0x0,'rows':[]};var _0x1a5d92=_['map'](db[_0x35fc('0x2a')][_0x35fc('0x2b')],function(_0x383837){return{'name':_0x383837[_0x35fc('0x2c')],'type':_0x383837[_0x35fc('0x2d')][_0x35fc('0x2e')]};});_0x58edb6[_0x35fc('0x2f')]=_[_0x35fc('0x30')](_0x1a5d92,'name');_0x58edb6[_0x35fc('0x31')]=_[_0x35fc('0x32')](_0x5cb986[_0x35fc('0x31')]);_0x58edb6['filters']=_[_0x35fc('0x33')](_0x58edb6[_0x35fc('0x2f')],_0x58edb6[_0x35fc('0x31')]);_0x47774c[_0x35fc('0x34')]=_[_0x35fc('0x33')](_0x58edb6[_0x35fc('0x2f')],qs[_0x35fc('0x35')](_0x5cb986[_0x35fc('0x31')][_0x35fc('0x35')]));_0x47774c[_0x35fc('0x34')]=_0x47774c['attributes']['length']?_0x47774c[_0x35fc('0x34')]:_0x58edb6['model'];if(!_0x5cb986[_0x35fc('0x31')][_0x35fc('0x36')](_0x35fc('0x37'))){_0x47774c[_0x35fc('0x1c')]=qs[_0x35fc('0x1c')](_0x5cb986[_0x35fc('0x31')]['limit']);_0x47774c[_0x35fc('0x1b')]=qs[_0x35fc('0x1b')](_0x5cb986[_0x35fc('0x31')][_0x35fc('0x1b')]);}_0x47774c[_0x35fc('0x38')]=qs[_0x35fc('0x39')](_0x5cb986['query'][_0x35fc('0x39')]);_0x47774c[_0x35fc('0x3a')]=qs[_0x35fc('0x3b')](_['pick'](_0x5cb986[_0x35fc('0x31')],_0x58edb6['filters']));if(_0x5cb986[_0x35fc('0x31')][_0x35fc('0x3c')]){_0x47774c[_0x35fc('0x3a')]=_[_0x35fc('0x3d')](_0x47774c['where'],{'$or':_['map'](_0x1a5d92,function(_0x59e4fb){if(_0x59e4fb[_0x35fc('0x2d')]!=='VIRTUAL'){var _0x20f8bb={};_0x20f8bb[_0x59e4fb['name']]={'$like':'%'+_0x5cb986[_0x35fc('0x31')][_0x35fc('0x3c')]+'%'};return _0x20f8bb;}})});}_0x47774c=_[_0x35fc('0x3d')]({},_0x47774c,_0x5cb986[_0x35fc('0x3e')]);var _0x1c10e0={'where':_0x47774c[_0x35fc('0x3a')]};return db[_0x35fc('0x2a')]['count'](_0x1c10e0)[_0x35fc('0x23')](function(_0x16087d){_0x274208['count']=_0x16087d;if(_0x5cb986[_0x35fc('0x31')][_0x35fc('0x3f')]){_0x47774c[_0x35fc('0x40')]=[{'all':!![]}];}return db[_0x35fc('0x2a')][_0x35fc('0x41')](_0x47774c);})[_0x35fc('0x23')](function(_0x58f25c){_0x274208[_0x35fc('0x42')]=_0x58f25c;return _0x274208;})[_0x35fc('0x23')](respondWithFilteredResult(_0x519264,_0x47774c))[_0x35fc('0x43')](handleError(_0x519264,null));};exports['show']=function(_0x17821e,_0x350a96){var _0x596919={'raw':!![],'where':{'id':_0x17821e[_0x35fc('0x44')]['id']}},_0x237548={};_0x237548[_0x35fc('0x2f')]=_[_0x35fc('0x32')](db[_0x35fc('0x2a')][_0x35fc('0x2b')]);_0x237548[_0x35fc('0x31')]=_[_0x35fc('0x32')](_0x17821e['query']);_0x237548['filters']=_[_0x35fc('0x33')](_0x237548[_0x35fc('0x2f')],_0x237548['query']);_0x596919['attributes']=_['intersection'](_0x237548[_0x35fc('0x2f')],qs[_0x35fc('0x35')](_0x17821e['query'][_0x35fc('0x35')]));_0x596919[_0x35fc('0x34')]=_0x596919[_0x35fc('0x34')][_0x35fc('0x45')]?_0x596919['attributes']:_0x237548['model'];if(_0x17821e['query']['includeAll']){_0x596919['include']=[{'all':!![]}];}_0x596919=_[_0x35fc('0x3d')]({},_0x596919,_0x17821e[_0x35fc('0x3e')]);return db['MailSubstatus'][_0x35fc('0x46')](_0x596919)['then'](handleEntityNotFound(_0x350a96,null))[_0x35fc('0x23')](respondWithResult(_0x350a96,null))[_0x35fc('0x43')](handleError(_0x350a96,null));};exports[_0x35fc('0x47')]=function(_0x2de5d1,_0x16f7c8){return db['MailSubstatus'][_0x35fc('0x47')](_0x2de5d1[_0x35fc('0x48')],{})['then'](respondWithResult(_0x16f7c8,0xc9))[_0x35fc('0x43')](handleError(_0x16f7c8,null));};exports[_0x35fc('0x22')]=function(_0x2a8a09,_0x211746){if(_0x2a8a09['body']['id']){delete _0x2a8a09[_0x35fc('0x48')]['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x2a8a09[_0x35fc('0x44')]['id']}})[_0x35fc('0x23')](handleEntityNotFound(_0x211746,null))[_0x35fc('0x23')](saveUpdates(_0x2a8a09[_0x35fc('0x48')],null))[_0x35fc('0x23')](respondWithResult(_0x211746,null))[_0x35fc('0x43')](handleError(_0x211746,null));};exports[_0x35fc('0x49')]=function(_0x16afa6,_0x4f555f){return db[_0x35fc('0x2a')][_0x35fc('0x46')]({'where':{'id':_0x16afa6[_0x35fc('0x44')]['id']}})[_0x35fc('0x23')](handleEntityNotFound(_0x4f555f,null))[_0x35fc('0x23')](removeEntity(_0x4f555f,null))[_0x35fc('0x43')](handleError(_0x4f555f,null));};exports[_0x35fc('0x4a')]=function(_0x347a4a,_0x35fb53){return db[_0x35fc('0x2a')][_0x35fc('0x4a')]()[_0x35fc('0x23')](respondWithResult(_0x35fb53,null))[_0x35fc('0x43')](handleError(_0x35fb53,null));}; \ No newline at end of file +var _0xb138=['index','map','MailSubstatus','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','include','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','count','offset','limit','status','set','apply','reject','save','update','destroy','then','sendStatus','error','stack','name'];(function(_0x1e1068,_0x2b63e8){var _0x36d56b=function(_0x4fd8e4){while(--_0x4fd8e4){_0x1e1068['push'](_0x1e1068['shift']());}};_0x36d56b(++_0x2b63e8);}(_0xb138,0x1dd));var _0x8b13=function(_0x1a70a6,_0x1806c5){_0x1a70a6=_0x1a70a6-0x0;var _0x123194=_0xb138[_0x1a70a6];return _0x123194;};'use strict';var pdf=require(_0x8b13('0x0'));var emlformat=require(_0x8b13('0x1'));var rimraf=require(_0x8b13('0x2'));var zipdir=require(_0x8b13('0x3'));var jsonpatch=require(_0x8b13('0x4'));var rp=require(_0x8b13('0x5'));var moment=require(_0x8b13('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x8b13('0x7'));var util=require(_0x8b13('0x8'));var path=require(_0x8b13('0x9'));var sox=require('sox');var csv=require(_0x8b13('0xa'));var ejs=require(_0x8b13('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8b13('0xc'));var crypto=require(_0x8b13('0xd'));var jsforce=require(_0x8b13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b13('0xa'));var querystring=require(_0x8b13('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b13('0x10'));var qs=require(_0x8b13('0x11'));var as=require(_0x8b13('0x12'));var hardwareService=require(_0x8b13('0x13'));var logger=require(_0x8b13('0x14'))('api');var utils=require(_0x8b13('0x15'));var config=require(_0x8b13('0x16'));var db=require(_0x8b13('0x17'))['db'];function respondWithStatusCode(_0x3f79d5,_0xb227e0){_0xb227e0=_0xb227e0||0xcc;return function(_0x1893b1){if(_0x1893b1){return _0x3f79d5['sendStatus'](_0xb227e0);}return _0x3f79d5['status'](_0xb227e0)[_0x8b13('0x18')]();};}function respondWithResult(_0x130a6f,_0x5f12b5){_0x5f12b5=_0x5f12b5||0xc8;return function(_0x51a935){if(_0x51a935){return _0x130a6f['status'](_0x5f12b5)[_0x8b13('0x19')](_0x51a935);}};}function respondWithFilteredResult(_0x407ef4,_0xf29086){return function(_0x2c615a){if(_0x2c615a){var _0x13f956=_0x2c615a[_0x8b13('0x1a')],_0x542357=_0xf29086[_0x8b13('0x1b')],_0x1c6c99=_0xf29086[_0x8b13('0x1b')]+_0xf29086[_0x8b13('0x1c')],_0xea7881;if(_0x1c6c99>=_0x13f956){_0x1c6c99=_0x13f956;_0xea7881=0xc8;}else{_0xea7881=0xce;}_0x407ef4[_0x8b13('0x1d')](_0xea7881);return _0x407ef4[_0x8b13('0x1e')]('Content-Range',_0x542357+'-'+_0x1c6c99+'/'+_0x13f956)['json'](_0x2c615a);}return null;};}function patchUpdates(_0xae4966){return function(_0x335709){try{jsonpatch[_0x8b13('0x1f')](_0x335709,_0xae4966,!![]);}catch(_0x9c03b4){return BPromise[_0x8b13('0x20')](_0x9c03b4);}return _0x335709[_0x8b13('0x21')]();};}function saveUpdates(_0x559442,_0x1e8a48){return function(_0x3c4d4f){if(_0x3c4d4f){return _0x3c4d4f[_0x8b13('0x22')](_0x559442)['then'](function(_0x51dd1d){return _0x51dd1d;});}return null;};}function removeEntity(_0xe73329,_0xcb7621){return function(_0x4f9902){if(_0x4f9902){return _0x4f9902[_0x8b13('0x23')]()[_0x8b13('0x24')](function(){_0xe73329[_0x8b13('0x1d')](0xcc)[_0x8b13('0x18')]();});}};}function handleEntityNotFound(_0xc05d5c,_0x583639){return function(_0x339271){if(!_0x339271){_0xc05d5c[_0x8b13('0x25')](0x194);}return _0x339271;};}function handleError(_0x5f15f0,_0x33422f){_0x33422f=_0x33422f||0x1f4;return function(_0x4fdd1c){logger[_0x8b13('0x26')](_0x4fdd1c[_0x8b13('0x27')]);if(_0x4fdd1c['name']){delete _0x4fdd1c[_0x8b13('0x28')];}_0x5f15f0[_0x8b13('0x1d')](_0x33422f)['send'](_0x4fdd1c);};}exports[_0x8b13('0x29')]=function(_0x14a739,_0x410122){var _0x4048e4={},_0x27fef3={},_0x54cdfc={'count':0x0,'rows':[]};var _0x6023f5=_[_0x8b13('0x2a')](db[_0x8b13('0x2b')][_0x8b13('0x2c')],function(_0x114b01){return{'name':_0x114b01[_0x8b13('0x2d')],'type':_0x114b01['type'][_0x8b13('0x2e')]};});_0x27fef3[_0x8b13('0x2f')]=_[_0x8b13('0x2a')](_0x6023f5,_0x8b13('0x28'));_0x27fef3[_0x8b13('0x30')]=_[_0x8b13('0x31')](_0x14a739[_0x8b13('0x30')]);_0x27fef3[_0x8b13('0x32')]=_[_0x8b13('0x33')](_0x27fef3['model'],_0x27fef3[_0x8b13('0x30')]);_0x4048e4[_0x8b13('0x34')]=_[_0x8b13('0x33')](_0x27fef3[_0x8b13('0x2f')],qs['fields'](_0x14a739['query'][_0x8b13('0x35')]));_0x4048e4['attributes']=_0x4048e4['attributes'][_0x8b13('0x36')]?_0x4048e4['attributes']:_0x27fef3[_0x8b13('0x2f')];if(!_0x14a739[_0x8b13('0x30')][_0x8b13('0x37')](_0x8b13('0x38'))){_0x4048e4[_0x8b13('0x1c')]=qs[_0x8b13('0x1c')](_0x14a739[_0x8b13('0x30')][_0x8b13('0x1c')]);_0x4048e4[_0x8b13('0x1b')]=qs[_0x8b13('0x1b')](_0x14a739['query'][_0x8b13('0x1b')]);}_0x4048e4[_0x8b13('0x39')]=qs[_0x8b13('0x3a')](_0x14a739[_0x8b13('0x30')][_0x8b13('0x3a')]);_0x4048e4[_0x8b13('0x3b')]=qs[_0x8b13('0x32')](_[_0x8b13('0x3c')](_0x14a739['query'],_0x27fef3[_0x8b13('0x32')]));if(_0x14a739['query'][_0x8b13('0x3d')]){_0x4048e4[_0x8b13('0x3b')]=_[_0x8b13('0x3e')](_0x4048e4[_0x8b13('0x3b')],{'$or':_[_0x8b13('0x2a')](_0x6023f5,function(_0x327eb1){if(_0x327eb1['type']!=='VIRTUAL'){var _0xe6963d={};_0xe6963d[_0x327eb1['name']]={'$like':'%'+_0x14a739[_0x8b13('0x30')]['filter']+'%'};return _0xe6963d;}})});}_0x4048e4=_[_0x8b13('0x3e')]({},_0x4048e4,_0x14a739[_0x8b13('0x3f')]);var _0x29a359={'where':_0x4048e4[_0x8b13('0x3b')]};return db[_0x8b13('0x2b')]['count'](_0x29a359)['then'](function(_0x230a8c){_0x54cdfc['count']=_0x230a8c;if(_0x14a739[_0x8b13('0x30')][_0x8b13('0x40')]){_0x4048e4['include']=[{'all':!![]}];}return db[_0x8b13('0x2b')][_0x8b13('0x41')](_0x4048e4);})[_0x8b13('0x24')](function(_0x81b931){_0x54cdfc[_0x8b13('0x42')]=_0x81b931;return _0x54cdfc;})[_0x8b13('0x24')](respondWithFilteredResult(_0x410122,_0x4048e4))[_0x8b13('0x43')](handleError(_0x410122,null));};exports['show']=function(_0x5a3f5c,_0x56a3d1){var _0x3eb3c5={'raw':!![],'where':{'id':_0x5a3f5c[_0x8b13('0x44')]['id']}},_0x16ec3={};_0x16ec3[_0x8b13('0x2f')]=_[_0x8b13('0x31')](db[_0x8b13('0x2b')]['rawAttributes']);_0x16ec3[_0x8b13('0x30')]=_['keys'](_0x5a3f5c[_0x8b13('0x30')]);_0x16ec3['filters']=_[_0x8b13('0x33')](_0x16ec3[_0x8b13('0x2f')],_0x16ec3[_0x8b13('0x30')]);_0x3eb3c5[_0x8b13('0x34')]=_[_0x8b13('0x33')](_0x16ec3[_0x8b13('0x2f')],qs[_0x8b13('0x35')](_0x5a3f5c['query']['fields']));_0x3eb3c5['attributes']=_0x3eb3c5[_0x8b13('0x34')][_0x8b13('0x36')]?_0x3eb3c5[_0x8b13('0x34')]:_0x16ec3[_0x8b13('0x2f')];if(_0x5a3f5c['query']['includeAll']){_0x3eb3c5[_0x8b13('0x45')]=[{'all':!![]}];}_0x3eb3c5=_['merge']({},_0x3eb3c5,_0x5a3f5c[_0x8b13('0x3f')]);return db[_0x8b13('0x2b')][_0x8b13('0x46')](_0x3eb3c5)[_0x8b13('0x24')](handleEntityNotFound(_0x56a3d1,null))[_0x8b13('0x24')](respondWithResult(_0x56a3d1,null))['catch'](handleError(_0x56a3d1,null));};exports[_0x8b13('0x47')]=function(_0x2044fc,_0x302db5){return db[_0x8b13('0x2b')][_0x8b13('0x47')](_0x2044fc[_0x8b13('0x48')],{})[_0x8b13('0x24')](respondWithResult(_0x302db5,0xc9))[_0x8b13('0x43')](handleError(_0x302db5,null));};exports[_0x8b13('0x22')]=function(_0x518298,_0x46d096){if(_0x518298['body']['id']){delete _0x518298[_0x8b13('0x48')]['id'];}return db[_0x8b13('0x2b')][_0x8b13('0x46')]({'where':{'id':_0x518298['params']['id']}})[_0x8b13('0x24')](handleEntityNotFound(_0x46d096,null))[_0x8b13('0x24')](saveUpdates(_0x518298[_0x8b13('0x48')],null))[_0x8b13('0x24')](respondWithResult(_0x46d096,null))[_0x8b13('0x43')](handleError(_0x46d096,null));};exports[_0x8b13('0x23')]=function(_0x453cd4,_0x534636){return db[_0x8b13('0x2b')]['find']({'where':{'id':_0x453cd4[_0x8b13('0x44')]['id']}})[_0x8b13('0x24')](handleEntityNotFound(_0x534636,null))[_0x8b13('0x24')](removeEntity(_0x534636,null))[_0x8b13('0x43')](handleError(_0x534636,null));};exports[_0x8b13('0x49')]=function(_0x22e613,_0x411ad2){return db[_0x8b13('0x2b')][_0x8b13('0x49')]()[_0x8b13('0x24')](respondWithResult(_0x411ad2,null))[_0x8b13('0x43')](handleError(_0x411ad2,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 95aa408..1b34e1f 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 _0x896e=['request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1acdb3,_0x243849){var _0x2d3e77=function(_0x84de77){while(--_0x84de77){_0x1acdb3['push'](_0x1acdb3['shift']());}};_0x2d3e77(++_0x243849);}(_0x896e,0x1e9));var _0xe896=function(_0x38290a,_0x528943){_0x38290a=_0x38290a-0x0;var _0x35f9c9=_0x896e[_0x38290a];return _0x35f9c9;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var logger=require(_0xe896('0x2'))(_0xe896('0x3'));var moment=require(_0xe896('0x4'));var BPromise=require(_0xe896('0x5'));var rp=require(_0xe896('0x6'));var fs=require('fs');var path=require(_0xe896('0x7'));var rimraf=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var attributes=require(_0xe896('0xa'));module[_0xe896('0xb')]=function(_0x52ac80,_0x24c430){return _0x52ac80[_0xe896('0xc')](_0xe896('0xd'),attributes,{'tableName':_0xe896('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x50a5=['util','request-promise','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','lodash'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x50a5,0xd1));var _0x550a=function(_0x13f4c4,_0x215a7d){_0x13f4c4=_0x13f4c4-0x0;var _0x10a950=_0x50a5[_0x13f4c4];return _0x10a950;};'use strict';var _=require(_0x550a('0x0'));var util=require(_0x550a('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x550a('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x550a('0x3'));var config=require(_0x550a('0x4'));var attributes=require(_0x550a('0x5'));module[_0x550a('0x6')]=function(_0x402f66,_0x3b3c29){return _0x402f66[_0x550a('0x7')](_0x550a('0x8'),attributes,{'tableName':_0x550a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 18027b7..1968cce 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 _0x153f=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x4d3f3e,_0x4ef8a8){var _0x3cacd4=function(_0x3da68e){while(--_0x3da68e){_0x4d3f3e['push'](_0x4d3f3e['shift']());}};_0x3cacd4(++_0x4ef8a8);}(_0x153f,0x15b));var _0xf153=function(_0x4f8cca,_0x3de0f1){_0x4f8cca=_0x4f8cca-0x0;var _0x211368=_0x153f[_0x4f8cca];return _0x211368;};'use strict';var _=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var moment=require(_0xf153('0x2'));var BPromise=require(_0xf153('0x3'));var rs=require(_0xf153('0x4'));var fs=require('fs');var Redis=require(_0xf153('0x5'));var db=require(_0xf153('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf153('0x7'))('rpc');var config=require(_0xf153('0x8'));var jayson=require(_0xf153('0x9'));var client=jayson[_0xf153('0xa')][_0xf153('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21f432,_0x4c8ae5,_0x17ba96){return new BPromise(function(_0x143497,_0x224f88){return client[_0xf153('0xc')](_0x21f432,_0x17ba96)[_0xf153('0xd')](function(_0x3e7a82){logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));logger[_0xf153('0x11')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x4c8ae5,_0xf153('0x10'),JSON[_0xf153('0x12')](_0x3e7a82));if(_0x3e7a82[_0xf153('0x13')]){if(_0x3e7a82['error'][_0xf153('0x14')]===0x1f4){logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);return _0x224f88(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82['error'][_0xf153('0x15')]);return _0x143497(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}else{logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));_0x143497(_0x3e7a82[_0xf153('0x16')][_0xf153('0x15')]);}})['catch'](function(_0x35f4e8){logger['error'](_0xf153('0xf'),_0x4c8ae5,_0x35f4e8);_0x224f88(_0x35f4e8);});});} \ No newline at end of file +var _0x41bb=['MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x1662fa,_0x5909cf){var _0x179ac3=function(_0x370d46){while(--_0x370d46){_0x1662fa['push'](_0x1662fa['shift']());}};_0x179ac3(++_0x5909cf);}(_0x41bb,0xc5));var _0xb41b=function(_0x5c7374,_0x41a29e){_0x5c7374=_0x5c7374-0x0;var _0x509b24=_0x41bb[_0x5c7374];return _0x509b24;};'use strict';var _=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var moment=require('moment');var BPromise=require(_0xb41b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb41b('0x3'));var db=require(_0xb41b('0x4'))['db'];var utils=require(_0xb41b('0x5'));var logger=require(_0xb41b('0x6'))('rpc');var config=require(_0xb41b('0x7'));var jayson=require(_0xb41b('0x8'));var client=jayson[_0xb41b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5455ce,_0x497242,_0x2704f0){return new BPromise(function(_0x29c30d,_0x53722a){return client[_0xb41b('0xa')](_0x5455ce,_0x2704f0)[_0xb41b('0xb')](function(_0x11b8b2){logger[_0xb41b('0xc')](_0xb41b('0xd'),_0x497242,_0xb41b('0xe'));logger[_0xb41b('0xf')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x497242,_0xb41b('0xe'),JSON['stringify'](_0x11b8b2));if(_0x11b8b2[_0xb41b('0x10')]){if(_0x11b8b2[_0xb41b('0x10')][_0xb41b('0x11')]===0x1f4){logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0x11b8b2['error'][_0xb41b('0x12')]);return _0x53722a(_0x11b8b2[_0xb41b('0x10')][_0xb41b('0x12')]);}logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0x11b8b2['error']['message']);return _0x29c30d(_0x11b8b2['error'][_0xb41b('0x12')]);}else{logger[_0xb41b('0xc')](_0xb41b('0xd'),_0x497242,_0xb41b('0xe'));_0x29c30d(_0x11b8b2[_0xb41b('0x13')]['message']);}})[_0xb41b('0x14')](function(_0xd0b6b5){logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0xd0b6b5);_0x53722a(_0xd0b6b5);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 57740f1..cd0f72d 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 _0xb973=['isAuthenticated','index','/:id','show','put','update','delete','multer','util','path','connect-timeout','express','../../components/interaction/service','./mailTransferReport.controller','get'];(function(_0x4ec613,_0x4db894){var _0x4100f6=function(_0x4e9810){while(--_0x4e9810){_0x4ec613['push'](_0x4ec613['shift']());}};_0x4100f6(++_0x4db894);}(_0xb973,0x9d));var _0x3b97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb973[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3b97('0x0'));var util=require(_0x3b97('0x1'));var path=require(_0x3b97('0x2'));var timeout=require(_0x3b97('0x3'));var express=require(_0x3b97('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x3b97('0x5'));var config=require('../../config/environment');var controller=require(_0x3b97('0x6'));router[_0x3b97('0x7')]('/',auth[_0x3b97('0x8')](),controller[_0x3b97('0x9')]);router[_0x3b97('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x3b97('0x7')](_0x3b97('0xa'),auth['isAuthenticated'](),controller[_0x3b97('0xb')]);router['post']('/',auth[_0x3b97('0x8')](),controller['create']);router[_0x3b97('0xc')](_0x3b97('0xa'),auth[_0x3b97('0x8')](),controller[_0x3b97('0xd')]);router[_0x3b97('0xe')](_0x3b97('0xa'),auth[_0x3b97('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x48f8=['show','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x48f8,0x1be));var _0x848f=function(_0x294f4d,_0x374007){_0x294f4d=_0x294f4d-0x0;var _0x21f1be=_0x48f8[_0x294f4d];return _0x21f1be;};'use strict';var multer=require(_0x848f('0x0'));var util=require(_0x848f('0x1'));var path=require(_0x848f('0x2'));var timeout=require(_0x848f('0x3'));var express=require(_0x848f('0x4'));var router=express[_0x848f('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x848f('0x6'));var config=require(_0x848f('0x7'));var controller=require(_0x848f('0x8'));router[_0x848f('0x9')]('/',auth[_0x848f('0xa')](),controller[_0x848f('0xb')]);router[_0x848f('0x9')](_0x848f('0xc'),auth[_0x848f('0xa')](),controller[_0x848f('0xd')]);router[_0x848f('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x848f('0xe')]);router['post']('/',auth[_0x848f('0xa')](),controller['create']);router[_0x848f('0xf')](_0x848f('0x10'),auth[_0x848f('0xa')](),controller[_0x848f('0x11')]);router[_0x848f('0x12')](_0x848f('0x10'),auth[_0x848f('0xa')](),controller['destroy']);module[_0x848f('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 366b1f0..0a8bd01 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 _0x8604=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5d88c0,_0x5d7d83){var _0x1b40f0=function(_0x3fde10){while(--_0x3fde10){_0x5d88c0['push'](_0x5d88c0['shift']());}};_0x1b40f0(++_0x5d7d83);}(_0x8604,0x1be));var _0x4860=function(_0x3407be,_0x3ad78b){_0x3407be=_0x3407be-0x0;var _0x1743e2=_0x8604[_0x3407be];return _0x1743e2;};'use strict';var moment=require(_0x4860('0x0'));var Sequelize=require(_0x4860('0x1'));module[_0x4860('0x2')]={'uniqueid':{'type':Sequelize[_0x4860('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x4860('0x4'),_0x4860('0x5'),_0x4860('0x6')),'allowNull':![],'defaultValue':_0x4860('0x6')},'transferredAt':{'type':Sequelize[_0x4860('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x4860('0x8')]}}; \ No newline at end of file +var _0xd434=['DATE','NOW','moment','STRING','ENUM','account','agent','queue'];(function(_0x40b3f2,_0x2c4f5f){var _0x4ce90c=function(_0x516f31){while(--_0x516f31){_0x40b3f2['push'](_0x40b3f2['shift']());}};_0x4ce90c(++_0x2c4f5f);}(_0xd434,0x1c2));var _0x4d43=function(_0x4922d3,_0x2732f0){_0x4922d3=_0x4922d3-0x0;var _0x239861=_0xd434[_0x4922d3];return _0x239861;};'use strict';var moment=require(_0x4d43('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x4d43('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4d43('0x2')](_0x4d43('0x3'),_0x4d43('0x4'),_0x4d43('0x5')),'allowNull':![],'defaultValue':_0x4d43('0x5')},'transferredAt':{'type':Sequelize[_0x4d43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x4d43('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 05d07a9..e5c98fc 100644 --- a/server/api/mailTransferReport/mailTransferReport.controller.js +++ b/server/api/mailTransferReport/mailTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','update','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set'];(function(_0x2560ba,_0x348654){var _0x11b7e6=function(_0x3c1e56){while(--_0x3c1e56){_0x2560ba['push'](_0x2560ba['shift']());}};_0x11b7e6(++_0x348654);}(_0x7a54,0x106));var _0x47a5=function(_0xc8011a,_0x2a6792){_0xc8011a=_0xc8011a-0x0;var _0x7db7f6=_0x7a54[_0xc8011a];return _0x7db7f6;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type']!==_0x47a5('0x39')){var _0x10f136={};_0x10f136[_0x1a0d23['name']]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x10f136;}})});}_0x36ad34=_[_0x47a5('0x38')]({},_0x36ad34,_0x23cb77['options']);var _0x101f70={'where':_0x36ad34[_0x47a5('0x37')]};return db['MailTransferReport'][_0x47a5('0x3a')](_0x101f70)[_0x47a5('0x1e')](function(_0x54ae35){_0x21f296['count']=_0x54ae35;if(_0x23cb77['query'][_0x47a5('0x3b')]){_0x36ad34['include']=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x111f0d){_0x21f296[_0x47a5('0x3d')]=_0x111f0d;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3e')](handleError(_0x378208,null));};exports[_0x47a5('0x3f')]=function(_0x3fa2a8,_0x36a24e){var _0x280500={'raw':!![],'where':{'id':_0x3fa2a8[_0x47a5('0x40')]['id']}},_0x1658e8={};_0x1658e8['model']=_[_0x47a5('0x2b')](db[_0x47a5('0x25')][_0x47a5('0x26')]);_0x1658e8[_0x47a5('0x2a')]=_['keys'](_0x3fa2a8[_0x47a5('0x2a')]);_0x1658e8['filters']=_['intersection'](_0x1658e8['model'],_0x1658e8['query']);_0x280500[_0x47a5('0x2e')]=_['intersection'](_0x1658e8[_0x47a5('0x2d')],qs[_0x47a5('0x2f')](_0x3fa2a8[_0x47a5('0x2a')]['fields']));_0x280500[_0x47a5('0x2e')]=_0x280500[_0x47a5('0x2e')]['length']?_0x280500['attributes']:_0x1658e8[_0x47a5('0x2d')];if(_0x3fa2a8['query'][_0x47a5('0x3b')]){_0x280500[_0x47a5('0x41')]=[{'all':!![]}];}_0x280500=_[_0x47a5('0x38')]({},_0x280500,_0x3fa2a8[_0x47a5('0x42')]);return db[_0x47a5('0x25')][_0x47a5('0x43')](_0x280500)[_0x47a5('0x1e')](handleEntityNotFound(_0x36a24e,null))[_0x47a5('0x1e')](respondWithResult(_0x36a24e,null))[_0x47a5('0x3e')](handleError(_0x36a24e,null));};exports[_0x47a5('0x44')]=function(_0x24ecb1,_0x3c3ebf){return db[_0x47a5('0x25')][_0x47a5('0x44')](_0x24ecb1[_0x47a5('0x45')],{})[_0x47a5('0x1e')](respondWithResult(_0x3c3ebf,0xc9))['catch'](handleError(_0x3c3ebf,null));};exports[_0x47a5('0x46')]=function(_0x23bb04,_0x49eab1){if(_0x23bb04['body']['id']){delete _0x23bb04[_0x47a5('0x45')]['id'];}return db['MailTransferReport'][_0x47a5('0x43')]({'where':{'id':_0x23bb04[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x49eab1,null))['then'](saveUpdates(_0x23bb04[_0x47a5('0x45')],null))['then'](respondWithResult(_0x49eab1,null))[_0x47a5('0x3e')](handleError(_0x49eab1,null));};exports[_0x47a5('0x1f')]=function(_0x3548bc,_0x3e12a7){return db[_0x47a5('0x25')][_0x47a5('0x43')]({'where':{'id':_0x3548bc[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x3e12a7,null))['then'](removeEntity(_0x3e12a7,null))[_0x47a5('0x3e')](handleError(_0x3e12a7,null));};exports[_0x47a5('0x47')]=function(_0x1163e3,_0x9ea93e){return db[_0x47a5('0x25')][_0x47a5('0x47')]()[_0x47a5('0x1e')](respondWithResult(_0x9ea93e,null))['catch'](handleError(_0x9ea93e,null));}; \ No newline at end of file +var _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(_0x1c207b,_0x27c1d8){var _0x1f9acf=function(_0x3931c2){while(--_0x3931c2){_0x1c207b['push'](_0x1c207b['shift']());}};_0x1f9acf(++_0x27c1d8);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 159251a..62ea824 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 _0xf629=['path','./mailTransferReport.attributes','MailTransferReport','report_mail_transfer','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0xe37f58,_0x1a167b){var _0x4dfcef=function(_0x3395b8){while(--_0x3395b8){_0xe37f58['push'](_0xe37f58['shift']());}};_0x4dfcef(++_0x1a167b);}(_0xf629,0xd7));var _0x9f62=function(_0x405db0,_0x17639e){_0x405db0=_0x405db0-0x0;var _0x5a278c=_0xf629[_0x405db0];return _0x5a278c;};'use strict';var _=require(_0x9f62('0x0'));var util=require('util');var logger=require(_0x9f62('0x1'))('api');var moment=require(_0x9f62('0x2'));var BPromise=require(_0x9f62('0x3'));var rp=require(_0x9f62('0x4'));var fs=require('fs');var path=require(_0x9f62('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9f62('0x6'));module['exports']=function(_0x50c6f0,_0x1f2980){return _0x50c6f0['define'](_0x9f62('0x7'),attributes,{'tableName':_0x9f62('0x8'),'paranoid':![],'indexes':[{'name':_0x9f62('0x9'),'fields':[_0x9f62('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5eac=['uniqueid','lodash','util','../../config/logger','moment','request-promise','rimraf','exports','define','MailTransferReport','report_mail_transfer'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x5eac,0x85));var _0xc5ea=function(_0x1853c1,_0xe8608b){_0x1853c1=_0x1853c1-0x0;var _0x248bb6=_0x5eac[_0x1853c1];return _0x248bb6;};'use strict';var _=require(_0xc5ea('0x0'));var util=require(_0xc5ea('0x1'));var logger=require(_0xc5ea('0x2'))('api');var moment=require(_0xc5ea('0x3'));var BPromise=require('bluebird');var rp=require(_0xc5ea('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc5ea('0x5'));var config=require('../../config/environment');var attributes=require('./mailTransferReport.attributes');module[_0xc5ea('0x6')]=function(_0x54d514,_0x49c94e){return _0x54d514[_0xc5ea('0x7')](_0xc5ea('0x8'),attributes,{'tableName':_0xc5ea('0x9'),'paranoid':![],'indexes':[{'name':_0xc5ea('0xa'),'fields':[_0xc5ea('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 eb97497..11cd38c 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 _0xf323=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','util','moment'];(function(_0xa330fd,_0x13e83d){var _0x133ca3=function(_0x5ed3af){while(--_0x5ed3af){_0xa330fd['push'](_0xa330fd['shift']());}};_0x133ca3(++_0x13e83d);}(_0xf323,0xef));var _0x3f32=function(_0x4fb1e6,_0x4dd6e5){_0x4fb1e6=_0x4fb1e6-0x0;var _0x5e0030=_0xf323[_0x4fb1e6];return _0x5e0030;};'use strict';var _=require(_0x3f32('0x0'));var util=require(_0x3f32('0x1'));var moment=require(_0x3f32('0x2'));var BPromise=require('bluebird');var rs=require(_0x3f32('0x3'));var fs=require('fs');var Redis=require(_0x3f32('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3f32('0x5'));var logger=require(_0x3f32('0x6'))(_0x3f32('0x7'));var config=require(_0x3f32('0x8'));var jayson=require(_0x3f32('0x9'));var client=jayson[_0x3f32('0xa')][_0x3f32('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x594bed,_0x2ff84f,_0x84fae){return new BPromise(function(_0x79c5e7,_0x91264b){return client[_0x3f32('0xc')](_0x594bed,_0x84fae)[_0x3f32('0xd')](function(_0x383d09){logger[_0x3f32('0xe')](_0x3f32('0xf'),_0x2ff84f,'request\x20sent');logger[_0x3f32('0x10')](_0x3f32('0x11'),_0x2ff84f,_0x3f32('0x12'),JSON['stringify'](_0x383d09));if(_0x383d09[_0x3f32('0x13')]){if(_0x383d09[_0x3f32('0x13')]['code']===0x1f4){logger[_0x3f32('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x2ff84f,_0x383d09[_0x3f32('0x13')]['message']);return _0x91264b(_0x383d09[_0x3f32('0x13')]['message']);}logger[_0x3f32('0x13')](_0x3f32('0xf'),_0x2ff84f,_0x383d09[_0x3f32('0x13')][_0x3f32('0x14')]);return _0x79c5e7(_0x383d09[_0x3f32('0x13')]['message']);}else{logger[_0x3f32('0xe')](_0x3f32('0xf'),_0x2ff84f,'request\x20sent');_0x79c5e7(_0x383d09[_0x3f32('0x15')]['message']);}})['catch'](function(_0x11622d){logger[_0x3f32('0x13')](_0x3f32('0xf'),_0x2ff84f,_0x11622d);_0x91264b(_0x11622d);});});} \ No newline at end of file +var _0xf635=['moment','bluebird','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util'];(function(_0x59edda,_0x53cb2f){var _0x5c023c=function(_0x14ce02){while(--_0x14ce02){_0x59edda['push'](_0x59edda['shift']());}};_0x5c023c(++_0x53cb2f);}(_0xf635,0xe2));var _0x5f63=function(_0x770c67,_0x1ea22b){_0x770c67=_0x770c67-0x0;var _0x2bdbbe=_0xf635[_0x770c67];return _0x2bdbbe;};'use strict';var _=require(_0x5f63('0x0'));var util=require(_0x5f63('0x1'));var moment=require(_0x5f63('0x2'));var BPromise=require(_0x5f63('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5f63('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x5f63('0x5'));var jayson=require(_0x5f63('0x6'));var client=jayson[_0x5f63('0x7')][_0x5f63('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xaf1bf7,_0x2209a1,_0x134581){return new BPromise(function(_0x22af69,_0x4d0b88){return client[_0x5f63('0x9')](_0xaf1bf7,_0x134581)[_0x5f63('0xa')](function(_0x4b018b){logger[_0x5f63('0xb')](_0x5f63('0xc'),_0x2209a1,_0x5f63('0xd'));logger['debug'](_0x5f63('0xe'),_0x2209a1,_0x5f63('0xd'),JSON['stringify'](_0x4b018b));if(_0x4b018b[_0x5f63('0xf')]){if(_0x4b018b[_0x5f63('0xf')][_0x5f63('0x10')]===0x1f4){logger['error'](_0x5f63('0xc'),_0x2209a1,_0x4b018b[_0x5f63('0xf')][_0x5f63('0x11')]);return _0x4d0b88(_0x4b018b[_0x5f63('0xf')][_0x5f63('0x11')]);}logger[_0x5f63('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x2209a1,_0x4b018b[_0x5f63('0xf')]['message']);return _0x22af69(_0x4b018b[_0x5f63('0xf')][_0x5f63('0x11')]);}else{logger[_0x5f63('0xb')](_0x5f63('0xc'),_0x2209a1,_0x5f63('0xd'));_0x22af69(_0x4b018b[_0x5f63('0x12')]['message']);}})['catch'](function(_0x265c40){logger[_0x5f63('0xf')](_0x5f63('0xc'),_0x2209a1,_0x265c40);_0x4d0b88(_0x265c40);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index b07e82c..dbd21aa 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 _0x1e0e=['isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service','./memberReport.controller','get'];(function(_0x37d80a,_0x591a57){var _0x422741=function(_0x2651bc){while(--_0x2651bc){_0x37d80a['push'](_0x37d80a['shift']());}};_0x422741(++_0x591a57);}(_0x1e0e,0x128));var _0xe1e0=function(_0x5433bc,_0xcfa0e7){_0x5433bc=_0x5433bc-0x0;var _0x50a029=_0x1e0e[_0x5433bc];return _0x50a029;};'use strict';var multer=require(_0xe1e0('0x0'));var util=require(_0xe1e0('0x1'));var path=require(_0xe1e0('0x2'));var timeout=require(_0xe1e0('0x3'));var express=require(_0xe1e0('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xe1e0('0x5'));var config=require('../../config/environment');var controller=require(_0xe1e0('0x6'));router[_0xe1e0('0x7')]('/',auth[_0xe1e0('0x8')](),controller['index']);router[_0xe1e0('0x7')](_0xe1e0('0x9'),auth[_0xe1e0('0x8')](),controller[_0xe1e0('0xa')]);router[_0xe1e0('0x7')](_0xe1e0('0xb'),auth[_0xe1e0('0x8')](),controller[_0xe1e0('0xc')]);router[_0xe1e0('0xd')]('/',auth[_0xe1e0('0x8')](),controller[_0xe1e0('0xe')]);router[_0xe1e0('0xf')](_0xe1e0('0xb'),auth[_0xe1e0('0x8')](),controller[_0xe1e0('0x10')]);router[_0xe1e0('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xe1e0('0x12')]);module['exports']=router; \ No newline at end of file +var _0xc175=['get','index','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller'];(function(_0x49485e,_0x1d41f9){var _0x15dbdc=function(_0x16d4e6){while(--_0x16d4e6){_0x49485e['push'](_0x49485e['shift']());}};_0x15dbdc(++_0x1d41f9);}(_0xc175,0x174));var _0x5c17=function(_0x3072bc,_0x323d10){_0x3072bc=_0x3072bc-0x0;var _0x48af54=_0xc175[_0x3072bc];return _0x48af54;};'use strict';var multer=require('multer');var util=require(_0x5c17('0x0'));var path=require(_0x5c17('0x1'));var timeout=require('connect-timeout');var express=require(_0x5c17('0x2'));var router=express[_0x5c17('0x3')]();var auth=require(_0x5c17('0x4'));var interaction=require(_0x5c17('0x5'));var config=require(_0x5c17('0x6'));var controller=require(_0x5c17('0x7'));router[_0x5c17('0x8')]('/',auth['isAuthenticated'](),controller[_0x5c17('0x9')]);router[_0x5c17('0x8')](_0x5c17('0xa'),auth[_0x5c17('0xb')](),controller[_0x5c17('0xc')]);router[_0x5c17('0x8')](_0x5c17('0xd'),auth['isAuthenticated'](),controller[_0x5c17('0xe')]);router['post']('/',auth[_0x5c17('0xb')](),controller[_0x5c17('0xf')]);router[_0x5c17('0x10')](_0x5c17('0xd'),auth[_0x5c17('0xb')](),controller[_0x5c17('0x11')]);router[_0x5c17('0x12')](_0x5c17('0xd'),auth[_0x5c17('0xb')](),controller['destroy']);module[_0x5c17('0x13')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index ff4bd8b..a1fdfa4 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 _0xa06c=['diff','seconds','setDataValue','duration','talk:[destination]','talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','enterAt'];(function(_0x51f1b2,_0x4cb0af){var _0x104b67=function(_0x412411){while(--_0x412411){_0x51f1b2['push'](_0x51f1b2['shift']());}};_0x104b67(++_0x4cb0af);}(_0xa06c,0x1e2));var _0xca06=function(_0x1779a4,_0x1f8946){_0x1779a4=_0x1779a4-0x0;var _0x448a8b=_0xa06c[_0x1779a4];return _0x448a8b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xca06('0x0'));module[_0xca06('0x1')]={'channel':{'type':Sequelize[_0xca06('0x2')]},'membername':{'type':Sequelize[_0xca06('0x2')]},'interface':{'type':Sequelize[_0xca06('0x2')]},'type':{'type':Sequelize[_0xca06('0x2')],'defaultValue':_0xca06('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0xca06('0x4')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xca06('0x5')],'set':function(_0x8b1907){var _0x2a9580=moment(_0x8b1907);var _0x165d1c=moment(this[_0xca06('0x6')](_0xca06('0x7')));var _0x5a80f6=_0x2a9580[_0xca06('0x8')](_0x165d1c,_0xca06('0x9'));this[_0xca06('0xa')]('exitAt',_0x8b1907);this[_0xca06('0xa')](_0xca06('0xb'),_0x5a80f6||null);}},'data1':{'type':Sequelize[_0xca06('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':_0xca06('0xc')},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xca06('0x2')],'comment':_0xca06('0xd')},'role':{'type':Sequelize[_0xca06('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xedf3=['exitAt','duration','talk:[start]','talk:[dial\x20string]','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue'];(function(_0x40f470,_0x3a5975){var _0x46ce5f=function(_0x5a0d12){while(--_0x5a0d12){_0x40f470['push'](_0x40f470['shift']());}};_0x46ce5f(++_0x3a5975);}(_0xedf3,0x130));var _0x3edf=function(_0xb66df,_0x4fb5ce){_0xb66df=_0xb66df-0x0;var _0x42a702=_0xedf3[_0xb66df];return _0x42a702;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x3edf('0x0')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x3edf('0x1')]},'type':{'type':Sequelize[_0x3edf('0x1')],'defaultValue':_0x3edf('0x2'),'comment':_0x3edf('0x3')},'duration':{'type':Sequelize[_0x3edf('0x4')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x3edf('0x5')],'set':function(_0x450a27){var _0x568668=moment(_0x450a27);var _0x4368c9=moment(this[_0x3edf('0x6')](_0x3edf('0x7')));var _0x5ac306=_0x568668[_0x3edf('0x8')](_0x4368c9,_0x3edf('0x9'));this[_0x3edf('0xa')](_0x3edf('0xb'),_0x450a27);this[_0x3edf('0xa')](_0x3edf('0xc'),_0x5ac306||null);}},'data1':{'type':Sequelize[_0x3edf('0x1')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x3edf('0x1')],'comment':_0x3edf('0xd')},'data3':{'type':Sequelize[_0x3edf('0x1')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x3edf('0x1')],'comment':_0x3edf('0xe')},'data5':{'type':Sequelize['STRING'],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x3edf('0x1')]},'internal':{'type':Sequelize[_0x3edf('0x4')]},'uniqueid':{'type':Sequelize[_0x3edf('0x1')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 8c2526d..2556e53 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 _0xfac4=['filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','body','find','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','apply','reject','update','then','destroy','sendStatus','stack','name','index','map','MemberReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick'];(function(_0x221ca3,_0xb25dd3){var _0x5974e4=function(_0x4c1607){while(--_0x4c1607){_0x221ca3['push'](_0x221ca3['shift']());}};_0x5974e4(++_0xb25dd3);}(_0xfac4,0x137));var _0x4fac=function(_0x5e3b3b,_0x60628f){_0x5e3b3b=_0x5e3b3b-0x0;var _0x4c3ae4=_0xfac4[_0x5e3b3b];return _0x4c3ae4;};'use strict';var pdf=require(_0x4fac('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4fac('0x1'));var zipdir=require(_0x4fac('0x2'));var jsonpatch=require(_0x4fac('0x3'));var rp=require(_0x4fac('0x4'));var moment=require(_0x4fac('0x5'));var BPromise=require(_0x4fac('0x6'));var Mustache=require('mustache');var util=require(_0x4fac('0x7'));var path=require(_0x4fac('0x8'));var sox=require(_0x4fac('0x9'));var csv=require(_0x4fac('0xa'));var ejs=require(_0x4fac('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4fac('0xc'));var crypto=require(_0x4fac('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4fac('0xe'));var toCsv=require(_0x4fac('0xa'));var querystring=require(_0x4fac('0xf'));var Papa=require(_0x4fac('0x10'));var Redis=require(_0x4fac('0x11'));var authService=require(_0x4fac('0x12'));var qs=require(_0x4fac('0x13'));var as=require(_0x4fac('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4fac('0x15'))(_0x4fac('0x16'));var utils=require(_0x4fac('0x17'));var config=require(_0x4fac('0x18'));var db=require(_0x4fac('0x19'))['db'];function respondWithStatusCode(_0x4332e6,_0x16313b){_0x16313b=_0x16313b||0xcc;return function(_0x493d59){if(_0x493d59){return _0x4332e6['sendStatus'](_0x16313b);}return _0x4332e6[_0x4fac('0x1a')](_0x16313b)[_0x4fac('0x1b')]();};}function respondWithResult(_0x47254e,_0x259206){_0x259206=_0x259206||0xc8;return function(_0x5410d8){if(_0x5410d8){return _0x47254e[_0x4fac('0x1a')](_0x259206)[_0x4fac('0x1c')](_0x5410d8);}};}function respondWithFilteredResult(_0x288741,_0x40e26e){return function(_0x505d46){if(_0x505d46){var _0x197665=_0x505d46[_0x4fac('0x1d')],_0x549e17=_0x40e26e[_0x4fac('0x1e')],_0x2e3fe1=_0x40e26e[_0x4fac('0x1e')]+_0x40e26e['limit'],_0x500447;if(_0x2e3fe1>=_0x197665){_0x2e3fe1=_0x197665;_0x500447=0xc8;}else{_0x500447=0xce;}_0x288741[_0x4fac('0x1a')](_0x500447);return _0x288741['set']('Content-Range',_0x549e17+'-'+_0x2e3fe1+'/'+_0x197665)[_0x4fac('0x1c')](_0x505d46);}return null;};}function patchUpdates(_0x53f01e){return function(_0x59bc45){try{jsonpatch[_0x4fac('0x1f')](_0x59bc45,_0x53f01e,!![]);}catch(_0x44706a){return BPromise[_0x4fac('0x20')](_0x44706a);}return _0x59bc45['save']();};}function saveUpdates(_0x5c9f0e,_0x455d03){return function(_0x396381){if(_0x396381){return _0x396381[_0x4fac('0x21')](_0x5c9f0e)[_0x4fac('0x22')](function(_0x30b524){return _0x30b524;});}return null;};}function removeEntity(_0x14fa66,_0x16dde4){return function(_0x542bb0){if(_0x542bb0){return _0x542bb0[_0x4fac('0x23')]()[_0x4fac('0x22')](function(){_0x14fa66[_0x4fac('0x1a')](0xcc)[_0x4fac('0x1b')]();});}};}function handleEntityNotFound(_0x273e4c,_0x51e3ab){return function(_0x30bfa3){if(!_0x30bfa3){_0x273e4c[_0x4fac('0x24')](0x194);}return _0x30bfa3;};}function handleError(_0x3351c8,_0x13a6be){_0x13a6be=_0x13a6be||0x1f4;return function(_0x1ca1c7){logger['error'](_0x1ca1c7[_0x4fac('0x25')]);if(_0x1ca1c7[_0x4fac('0x26')]){delete _0x1ca1c7[_0x4fac('0x26')];}_0x3351c8['status'](_0x13a6be)['send'](_0x1ca1c7);};}exports[_0x4fac('0x27')]=function(_0x6423,_0x1765e8){var _0xd24500={},_0x462067={},_0x4694d2={'count':0x0,'rows':[]};var _0x1ae3d1=_[_0x4fac('0x28')](db[_0x4fac('0x29')][_0x4fac('0x2a')],function(_0x4e502b){return{'name':_0x4e502b[_0x4fac('0x2b')],'type':_0x4e502b[_0x4fac('0x2c')][_0x4fac('0x2d')]};});_0x462067['model']=_['map'](_0x1ae3d1,_0x4fac('0x26'));_0x462067[_0x4fac('0x2e')]=_[_0x4fac('0x2f')](_0x6423[_0x4fac('0x2e')]);_0x462067[_0x4fac('0x30')]=_[_0x4fac('0x31')](_0x462067[_0x4fac('0x32')],_0x462067[_0x4fac('0x2e')]);_0xd24500[_0x4fac('0x33')]=_[_0x4fac('0x31')](_0x462067[_0x4fac('0x32')],qs['fields'](_0x6423[_0x4fac('0x2e')][_0x4fac('0x34')]));_0xd24500['attributes']=_0xd24500[_0x4fac('0x33')]['length']?_0xd24500['attributes']:_0x462067[_0x4fac('0x32')];if(!_0x6423['query'][_0x4fac('0x35')](_0x4fac('0x36'))){_0xd24500[_0x4fac('0x37')]=qs[_0x4fac('0x37')](_0x6423[_0x4fac('0x2e')][_0x4fac('0x37')]);_0xd24500[_0x4fac('0x1e')]=qs[_0x4fac('0x1e')](_0x6423[_0x4fac('0x2e')][_0x4fac('0x1e')]);}_0xd24500[_0x4fac('0x38')]=qs[_0x4fac('0x39')](_0x6423['query'][_0x4fac('0x39')]);_0xd24500['where']=qs[_0x4fac('0x30')](_[_0x4fac('0x3a')](_0x6423[_0x4fac('0x2e')],_0x462067[_0x4fac('0x30')]));if(_0x6423['query'][_0x4fac('0x3b')]){_0xd24500[_0x4fac('0x3c')]=_[_0x4fac('0x3d')](_0xd24500[_0x4fac('0x3c')],{'$or':_[_0x4fac('0x28')](_0x1ae3d1,function(_0x728ed2){if(_0x728ed2[_0x4fac('0x2c')]!==_0x4fac('0x3e')){var _0x245608={};_0x245608[_0x728ed2[_0x4fac('0x26')]]={'$like':'%'+_0x6423[_0x4fac('0x2e')][_0x4fac('0x3b')]+'%'};return _0x245608;}})});}_0xd24500=_[_0x4fac('0x3d')]({},_0xd24500,_0x6423['options']);var _0x4a44d0={'where':_0xd24500[_0x4fac('0x3c')]};return db[_0x4fac('0x29')][_0x4fac('0x1d')](_0x4a44d0)[_0x4fac('0x22')](function(_0x2fa858){_0x4694d2['count']=_0x2fa858;if(_0x6423['query'][_0x4fac('0x3f')]){_0xd24500[_0x4fac('0x40')]=[{'all':!![]}];}return db['MemberReport'][_0x4fac('0x41')](_0xd24500);})[_0x4fac('0x22')](function(_0xfe2415){_0x4694d2[_0x4fac('0x42')]=_0xfe2415;return _0x4694d2;})[_0x4fac('0x22')](respondWithFilteredResult(_0x1765e8,_0xd24500))[_0x4fac('0x43')](handleError(_0x1765e8,null));};exports[_0x4fac('0x44')]=function(_0x533ca9,_0xb1df57){var _0x26ea1d={'raw':!![],'where':{'id':_0x533ca9[_0x4fac('0x45')]['id']}},_0x3e71cc={};_0x3e71cc[_0x4fac('0x32')]=_['keys'](db['MemberReport'][_0x4fac('0x2a')]);_0x3e71cc['query']=_[_0x4fac('0x2f')](_0x533ca9['query']);_0x3e71cc[_0x4fac('0x30')]=_[_0x4fac('0x31')](_0x3e71cc[_0x4fac('0x32')],_0x3e71cc[_0x4fac('0x2e')]);_0x26ea1d[_0x4fac('0x33')]=_[_0x4fac('0x31')](_0x3e71cc[_0x4fac('0x32')],qs[_0x4fac('0x34')](_0x533ca9[_0x4fac('0x2e')][_0x4fac('0x34')]));_0x26ea1d['attributes']=_0x26ea1d[_0x4fac('0x33')][_0x4fac('0x46')]?_0x26ea1d['attributes']:_0x3e71cc[_0x4fac('0x32')];if(_0x533ca9['query'][_0x4fac('0x3f')]){_0x26ea1d['include']=[{'all':!![]}];}_0x26ea1d=_[_0x4fac('0x3d')]({},_0x26ea1d,_0x533ca9['options']);return db[_0x4fac('0x29')]['find'](_0x26ea1d)['then'](handleEntityNotFound(_0xb1df57,null))['then'](respondWithResult(_0xb1df57,null))[_0x4fac('0x43')](handleError(_0xb1df57,null));};exports['create']=function(_0x210b89,_0xd343a4){return db[_0x4fac('0x29')]['create'](_0x210b89['body'],{})[_0x4fac('0x22')](respondWithResult(_0xd343a4,0xc9))[_0x4fac('0x43')](handleError(_0xd343a4,null));};exports['update']=function(_0x49904b,_0x254738){if(_0x49904b[_0x4fac('0x47')]['id']){delete _0x49904b[_0x4fac('0x47')]['id'];}return db[_0x4fac('0x29')][_0x4fac('0x48')]({'where':{'id':_0x49904b[_0x4fac('0x45')]['id']}})[_0x4fac('0x22')](handleEntityNotFound(_0x254738,null))['then'](saveUpdates(_0x49904b['body'],null))[_0x4fac('0x22')](respondWithResult(_0x254738,null))[_0x4fac('0x43')](handleError(_0x254738,null));};exports[_0x4fac('0x23')]=function(_0x13c678,_0x184a40){return db[_0x4fac('0x29')][_0x4fac('0x48')]({'where':{'id':_0x13c678[_0x4fac('0x45')]['id']}})[_0x4fac('0x22')](handleEntityNotFound(_0x184a40,null))['then'](removeEntity(_0x184a40,null))[_0x4fac('0x43')](handleError(_0x184a40,null));};exports['describe']=function(_0x3b3844,_0x2dafb2){return db[_0x4fac('0x29')][_0x4fac('0x49')]()['then'](respondWithResult(_0x2dafb2,null))[_0x4fac('0x43')](handleError(_0x2dafb2,null));}; \ No newline at end of file +var _0x46b6=['moment','bluebird','path','sox','ejs','lodash','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','offset','limit','set','reject','save','update','then','error','send','index','MemberReport','fieldName','type','key','model','map','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','show','params','keys','rawAttributes','options','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3318ca,_0x1effaf){var _0x38c595=function(_0x252c58){while(--_0x252c58){_0x3318ca['push'](_0x3318ca['shift']());}};_0x38c595(++_0x1effaf);}(_0x46b6,0x1bd));var _0x646b=function(_0x15f283,_0x266d85){_0x15f283=_0x15f283-0x0;var _0x500176=_0x46b6[_0x15f283];return _0x500176;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x646b('0x0'));var rimraf=require(_0x646b('0x1'));var zipdir=require(_0x646b('0x2'));var jsonpatch=require(_0x646b('0x3'));var rp=require(_0x646b('0x4'));var moment=require(_0x646b('0x5'));var BPromise=require(_0x646b('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x646b('0x7'));var sox=require(_0x646b('0x8'));var csv=require('to-csv');var ejs=require(_0x646b('0x9'));var fs=require('fs');var _=require(_0x646b('0xa'));var squel=require(_0x646b('0xb'));var crypto=require(_0x646b('0xc'));var jsforce=require(_0x646b('0xd'));var deskjs=require(_0x646b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x646b('0xf'));var Papa=require('papaparse');var Redis=require(_0x646b('0x10'));var authService=require(_0x646b('0x11'));var qs=require(_0x646b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x646b('0x13'));var logger=require(_0x646b('0x14'))(_0x646b('0x15'));var utils=require(_0x646b('0x16'));var config=require(_0x646b('0x17'));var db=require(_0x646b('0x18'))['db'];function respondWithStatusCode(_0x475fef,_0x133384){_0x133384=_0x133384||0xcc;return function(_0x53b547){if(_0x53b547){return _0x475fef[_0x646b('0x19')](_0x133384);}return _0x475fef[_0x646b('0x1a')](_0x133384)[_0x646b('0x1b')]();};}function respondWithResult(_0x2a6a75,_0x8bf3da){_0x8bf3da=_0x8bf3da||0xc8;return function(_0x2e4a72){if(_0x2e4a72){return _0x2a6a75['status'](_0x8bf3da)[_0x646b('0x1c')](_0x2e4a72);}};}function respondWithFilteredResult(_0xfa51e8,_0x4e656b){return function(_0x255fb4){if(_0x255fb4){var _0x2b16c1=_0x255fb4['count'],_0x303d32=_0x4e656b['offset'],_0x7a2cfd=_0x4e656b[_0x646b('0x1d')]+_0x4e656b[_0x646b('0x1e')],_0x4bf271;if(_0x7a2cfd>=_0x2b16c1){_0x7a2cfd=_0x2b16c1;_0x4bf271=0xc8;}else{_0x4bf271=0xce;}_0xfa51e8['status'](_0x4bf271);return _0xfa51e8[_0x646b('0x1f')]('Content-Range',_0x303d32+'-'+_0x7a2cfd+'/'+_0x2b16c1)[_0x646b('0x1c')](_0x255fb4);}return null;};}function patchUpdates(_0x33a892){return function(_0x4535b7){try{jsonpatch['apply'](_0x4535b7,_0x33a892,!![]);}catch(_0x246f90){return BPromise[_0x646b('0x20')](_0x246f90);}return _0x4535b7[_0x646b('0x21')]();};}function saveUpdates(_0x1521d5,_0x156422){return function(_0x1448db){if(_0x1448db){return _0x1448db[_0x646b('0x22')](_0x1521d5)[_0x646b('0x23')](function(_0x59bd3a){return _0x59bd3a;});}return null;};}function removeEntity(_0x35cb4a,_0x2eef9e){return function(_0x4b857f){if(_0x4b857f){return _0x4b857f['destroy']()[_0x646b('0x23')](function(){_0x35cb4a[_0x646b('0x1a')](0xcc)[_0x646b('0x1b')]();});}};}function handleEntityNotFound(_0x31a647,_0x29ea7a){return function(_0x37683e){if(!_0x37683e){_0x31a647[_0x646b('0x19')](0x194);}return _0x37683e;};}function handleError(_0xbecc9b,_0x1a50cd){_0x1a50cd=_0x1a50cd||0x1f4;return function(_0x451fbd){logger[_0x646b('0x24')](_0x451fbd['stack']);if(_0x451fbd['name']){delete _0x451fbd['name'];}_0xbecc9b[_0x646b('0x1a')](_0x1a50cd)[_0x646b('0x25')](_0x451fbd);};}exports[_0x646b('0x26')]=function(_0x3b4c53,_0x24c553){var _0x1b5d84={},_0x31826e={},_0x4a471e={'count':0x0,'rows':[]};var _0x2ffdd6=_['map'](db[_0x646b('0x27')]['rawAttributes'],function(_0x38d3a6){return{'name':_0x38d3a6[_0x646b('0x28')],'type':_0x38d3a6[_0x646b('0x29')][_0x646b('0x2a')]};});_0x31826e[_0x646b('0x2b')]=_[_0x646b('0x2c')](_0x2ffdd6,_0x646b('0x2d'));_0x31826e[_0x646b('0x2e')]=_['keys'](_0x3b4c53[_0x646b('0x2e')]);_0x31826e[_0x646b('0x2f')]=_['intersection'](_0x31826e['model'],_0x31826e[_0x646b('0x2e')]);_0x1b5d84[_0x646b('0x30')]=_[_0x646b('0x31')](_0x31826e[_0x646b('0x2b')],qs[_0x646b('0x32')](_0x3b4c53[_0x646b('0x2e')][_0x646b('0x32')]));_0x1b5d84[_0x646b('0x30')]=_0x1b5d84[_0x646b('0x30')][_0x646b('0x33')]?_0x1b5d84['attributes']:_0x31826e[_0x646b('0x2b')];if(!_0x3b4c53[_0x646b('0x2e')][_0x646b('0x34')]('nolimit')){_0x1b5d84[_0x646b('0x1e')]=qs[_0x646b('0x1e')](_0x3b4c53[_0x646b('0x2e')][_0x646b('0x1e')]);_0x1b5d84['offset']=qs[_0x646b('0x1d')](_0x3b4c53[_0x646b('0x2e')][_0x646b('0x1d')]);}_0x1b5d84[_0x646b('0x35')]=qs[_0x646b('0x36')](_0x3b4c53[_0x646b('0x2e')]['sort']);_0x1b5d84[_0x646b('0x37')]=qs[_0x646b('0x2f')](_[_0x646b('0x38')](_0x3b4c53[_0x646b('0x2e')],_0x31826e[_0x646b('0x2f')]));if(_0x3b4c53[_0x646b('0x2e')][_0x646b('0x39')]){_0x1b5d84['where']=_[_0x646b('0x3a')](_0x1b5d84['where'],{'$or':_['map'](_0x2ffdd6,function(_0x544db0){if(_0x544db0['type']!==_0x646b('0x3b')){var _0x4266ef={};_0x4266ef[_0x544db0[_0x646b('0x2d')]]={'$like':'%'+_0x3b4c53['query'][_0x646b('0x39')]+'%'};return _0x4266ef;}})});}_0x1b5d84=_['merge']({},_0x1b5d84,_0x3b4c53['options']);var _0x13018d={'where':_0x1b5d84[_0x646b('0x37')]};return db[_0x646b('0x27')][_0x646b('0x3c')](_0x13018d)[_0x646b('0x23')](function(_0x1f0f37){_0x4a471e[_0x646b('0x3c')]=_0x1f0f37;if(_0x3b4c53[_0x646b('0x2e')][_0x646b('0x3d')]){_0x1b5d84[_0x646b('0x3e')]=[{'all':!![]}];}return db[_0x646b('0x27')][_0x646b('0x3f')](_0x1b5d84);})['then'](function(_0x1a20c7){_0x4a471e['rows']=_0x1a20c7;return _0x4a471e;})[_0x646b('0x23')](respondWithFilteredResult(_0x24c553,_0x1b5d84))['catch'](handleError(_0x24c553,null));};exports[_0x646b('0x40')]=function(_0x3d43dd,_0x168e3c){var _0x34314e={'raw':!![],'where':{'id':_0x3d43dd[_0x646b('0x41')]['id']}},_0x3c2961={};_0x3c2961[_0x646b('0x2b')]=_[_0x646b('0x42')](db['MemberReport'][_0x646b('0x43')]);_0x3c2961['query']=_[_0x646b('0x42')](_0x3d43dd[_0x646b('0x2e')]);_0x3c2961[_0x646b('0x2f')]=_[_0x646b('0x31')](_0x3c2961[_0x646b('0x2b')],_0x3c2961[_0x646b('0x2e')]);_0x34314e[_0x646b('0x30')]=_['intersection'](_0x3c2961[_0x646b('0x2b')],qs['fields'](_0x3d43dd['query'][_0x646b('0x32')]));_0x34314e[_0x646b('0x30')]=_0x34314e[_0x646b('0x30')][_0x646b('0x33')]?_0x34314e[_0x646b('0x30')]:_0x3c2961[_0x646b('0x2b')];if(_0x3d43dd[_0x646b('0x2e')][_0x646b('0x3d')]){_0x34314e[_0x646b('0x3e')]=[{'all':!![]}];}_0x34314e=_['merge']({},_0x34314e,_0x3d43dd[_0x646b('0x44')]);return db['MemberReport'][_0x646b('0x45')](_0x34314e)['then'](handleEntityNotFound(_0x168e3c,null))[_0x646b('0x23')](respondWithResult(_0x168e3c,null))[_0x646b('0x46')](handleError(_0x168e3c,null));};exports['create']=function(_0x410644,_0x67ee83){return db[_0x646b('0x27')][_0x646b('0x47')](_0x410644[_0x646b('0x48')],{})[_0x646b('0x23')](respondWithResult(_0x67ee83,0xc9))['catch'](handleError(_0x67ee83,null));};exports[_0x646b('0x22')]=function(_0x3ce4f4,_0x2881f6){if(_0x3ce4f4[_0x646b('0x48')]['id']){delete _0x3ce4f4[_0x646b('0x48')]['id'];}return db['MemberReport'][_0x646b('0x45')]({'where':{'id':_0x3ce4f4[_0x646b('0x41')]['id']}})[_0x646b('0x23')](handleEntityNotFound(_0x2881f6,null))['then'](saveUpdates(_0x3ce4f4[_0x646b('0x48')],null))['then'](respondWithResult(_0x2881f6,null))['catch'](handleError(_0x2881f6,null));};exports[_0x646b('0x49')]=function(_0x270642,_0x4f7419){return db[_0x646b('0x27')][_0x646b('0x45')]({'where':{'id':_0x270642[_0x646b('0x41')]['id']}})[_0x646b('0x23')](handleEntityNotFound(_0x4f7419,null))[_0x646b('0x23')](removeEntity(_0x4f7419,null))[_0x646b('0x46')](handleError(_0x4f7419,null));};exports['describe']=function(_0x33fc9e,_0x53b5a6){return db[_0x646b('0x27')][_0x646b('0x4a')]()[_0x646b('0x23')](respondWithResult(_0x53b5a6,null))['catch'](handleError(_0x53b5a6,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 6eeb1df..cbed998 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 _0xaebf=['interface','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./memberReport.attributes','report_member','membername_interface','membername'];(function(_0x5e4563,_0x3ff918){var _0x8d1bf5=function(_0x3bf7a9){while(--_0x3bf7a9){_0x5e4563['push'](_0x5e4563['shift']());}};_0x8d1bf5(++_0x3ff918);}(_0xaebf,0x18d));var _0xfaeb=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xaebf[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xfaeb('0x0'));var util=require(_0xfaeb('0x1'));var logger=require(_0xfaeb('0x2'))('api');var moment=require(_0xfaeb('0x3'));var BPromise=require(_0xfaeb('0x4'));var rp=require(_0xfaeb('0x5'));var fs=require('fs');var path=require(_0xfaeb('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfaeb('0x7'));module['exports']=function(_0x28718f,_0x47c326){return _0x28718f['define']('MemberReport',attributes,{'tableName':_0xfaeb('0x8'),'paranoid':![],'indexes':[{'name':_0xfaeb('0x9'),'fields':[_0xfaeb('0xa'),_0xfaeb('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd185=['report_member','membername_interface','membername','interface','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','define','MemberReport'];(function(_0x1b748d,_0x1fb2d1){var _0x398d64=function(_0x2a75fc){while(--_0x2a75fc){_0x1b748d['push'](_0x1b748d['shift']());}};_0x398d64(++_0x1fb2d1);}(_0xd185,0x6d));var _0x5d18=function(_0x10f9ed,_0x1c206c){_0x10f9ed=_0x10f9ed-0x0;var _0xe58e2=_0xd185[_0x10f9ed];return _0xe58e2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5d18('0x0'))(_0x5d18('0x1'));var moment=require(_0x5d18('0x2'));var BPromise=require(_0x5d18('0x3'));var rp=require(_0x5d18('0x4'));var fs=require('fs');var path=require(_0x5d18('0x5'));var rimraf=require(_0x5d18('0x6'));var config=require(_0x5d18('0x7'));var attributes=require(_0x5d18('0x8'));module['exports']=function(_0xe203de,_0x644fb1){return _0xe203de[_0x5d18('0x9')](_0x5d18('0xa'),attributes,{'tableName':_0x5d18('0xb'),'paranoid':![],'indexes':[{'name':_0x5d18('0xc'),'fields':[_0x5d18('0xd'),_0x5d18('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index d1a9853..2cc6141 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 _0xf935=['message','result','catch','findAll','options','raw','where','limit','include','map','attributes','model','GetMemberReport','debug','CreateMemberReport','MemberReport','update','body','UpdateMemberReport','util','ioredis','../../mysqldb','../../config/logger','client','request','then','info','MemberReport,\x20%s,\x20%s','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3f4927,_0x497b49){var _0x4831eb=function(_0x441bf5){while(--_0x441bf5){_0x3f4927['push'](_0x3f4927['shift']());}};_0x4831eb(++_0x497b49);}(_0xf935,0xfa));var _0x5f93=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf935[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x5f93('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f93('0x1'));var db=require(_0x5f93('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f93('0x3'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5f93('0x4')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24884f,_0x35705d,_0x4eba89){return new BPromise(function(_0x2276f6,_0x239e2c){return client[_0x5f93('0x5')](_0x24884f,_0x4eba89)[_0x5f93('0x6')](function(_0x29f1c7){logger[_0x5f93('0x7')](_0x5f93('0x8'),_0x35705d,'request\x20sent');logger['debug'](_0x5f93('0x9'),_0x35705d,_0x5f93('0xa'),JSON[_0x5f93('0xb')](_0x29f1c7));if(_0x29f1c7[_0x5f93('0xc')]){if(_0x29f1c7['error'][_0x5f93('0xd')]===0x1f4){logger[_0x5f93('0xc')]('MemberReport,\x20%s,\x20%s',_0x35705d,_0x29f1c7[_0x5f93('0xc')]['message']);return _0x239e2c(_0x29f1c7[_0x5f93('0xc')][_0x5f93('0xe')]);}logger[_0x5f93('0xc')](_0x5f93('0x8'),_0x35705d,_0x29f1c7[_0x5f93('0xc')][_0x5f93('0xe')]);return _0x2276f6(_0x29f1c7[_0x5f93('0xc')][_0x5f93('0xe')]);}else{logger[_0x5f93('0x7')](_0x5f93('0x8'),_0x35705d,'request\x20sent');_0x2276f6(_0x29f1c7[_0x5f93('0xf')][_0x5f93('0xe')]);}})[_0x5f93('0x10')](function(_0x4aa805){logger[_0x5f93('0xc')](_0x5f93('0x8'),_0x35705d,_0x4aa805);_0x239e2c(_0x4aa805);});});}exports['GetMemberReport']=function(_0x4fd7fa){var _0xee1fbc=this;return new Promise(function(_0x2e5e2e,_0x507a7a){return db['MemberReport'][_0x5f93('0x11')]({'raw':_0x4fd7fa[_0x5f93('0x12')]?_0x4fd7fa[_0x5f93('0x12')][_0x5f93('0x13')]===undefined?!![]:![]:!![],'where':_0x4fd7fa[_0x5f93('0x12')]?_0x4fd7fa[_0x5f93('0x12')][_0x5f93('0x14')]||null:null,'attributes':_0x4fd7fa[_0x5f93('0x12')]?_0x4fd7fa['options']['attributes']||null:null,'limit':_0x4fd7fa['options']?_0x4fd7fa[_0x5f93('0x12')][_0x5f93('0x15')]||null:null,'include':_0x4fd7fa[_0x5f93('0x12')]?_0x4fd7fa[_0x5f93('0x12')][_0x5f93('0x16')]?_[_0x5f93('0x17')](_0x4fd7fa[_0x5f93('0x12')]['include'],function(_0x2c1aea){return{'model':db[_0x2c1aea['model']],'as':_0x2c1aea['as'],'attributes':_0x2c1aea[_0x5f93('0x18')],'include':_0x2c1aea[_0x5f93('0x16')]?_[_0x5f93('0x17')](_0x2c1aea[_0x5f93('0x16')],function(_0x5bd37c){return{'model':db[_0x5bd37c[_0x5f93('0x19')]],'as':_0x5bd37c['as'],'attributes':_0x5bd37c[_0x5f93('0x18')],'include':_0x5bd37c['include']?_[_0x5f93('0x17')](_0x5bd37c[_0x5f93('0x16')],function(_0x40cc64){return{'model':db[_0x40cc64[_0x5f93('0x19')]],'as':_0x40cc64['as'],'attributes':_0x40cc64[_0x5f93('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5f93('0x6')](function(_0x618922){logger[_0x5f93('0x7')](_0x5f93('0x1a'),_0x4fd7fa);logger[_0x5f93('0x1b')](_0x5f93('0x1a'),_0x4fd7fa,JSON[_0x5f93('0xb')](_0x618922));_0x2e5e2e(_0x618922);})['catch'](function(_0x524399){logger[_0x5f93('0xc')](_0x5f93('0x1a'),_0x524399[_0x5f93('0xe')],_0x4fd7fa);_0x507a7a(_0xee1fbc[_0x5f93('0xc')](0x1f4,_0x524399['message']));});});};exports[_0x5f93('0x1c')]=function(_0x41dbb2){var _0xd7f920=this;return new Promise(function(_0x2b834d,_0x475cc6){return db[_0x5f93('0x1d')]['create'](_0x41dbb2['body'],{'raw':_0x41dbb2[_0x5f93('0x12')]?_0x41dbb2[_0x5f93('0x12')][_0x5f93('0x13')]===undefined?!![]:![]:!![]})['then'](function(_0x263f83){logger['info'](_0x5f93('0x1c'),_0x41dbb2);logger['debug'](_0x5f93('0x1c'),_0x41dbb2,JSON[_0x5f93('0xb')](_0x263f83));_0x2b834d(_0x263f83);})[_0x5f93('0x10')](function(_0x536d3a){logger[_0x5f93('0xc')]('CreateMemberReport',_0x536d3a[_0x5f93('0xe')],_0x41dbb2);_0x475cc6(_0xd7f920[_0x5f93('0xc')](0x1f4,_0x536d3a[_0x5f93('0xe')]));});});};exports['UpdateMemberReport']=function(_0xd9bcc2){var _0x32027d=this;return new Promise(function(_0x23dbc6,_0x855e6d){return db['MemberReport'][_0x5f93('0x1e')](_0xd9bcc2[_0x5f93('0x1f')],{'raw':_0xd9bcc2[_0x5f93('0x12')]?_0xd9bcc2[_0x5f93('0x12')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd9bcc2['options']?_0xd9bcc2['options'][_0x5f93('0x14')]||null:null,'attributes':_0xd9bcc2[_0x5f93('0x12')]?_0xd9bcc2[_0x5f93('0x12')][_0x5f93('0x18')]||null:null,'limit':_0xd9bcc2[_0x5f93('0x12')]?_0xd9bcc2['options'][_0x5f93('0x15')]||null:null})[_0x5f93('0x6')](function(_0x862bbf){logger['info']('UpdateMemberReport',_0xd9bcc2);logger[_0x5f93('0x1b')](_0x5f93('0x20'),_0xd9bcc2,JSON['stringify'](_0x862bbf));_0x23dbc6(_0x862bbf);})[_0x5f93('0x10')](function(_0x583cf4){logger[_0x5f93('0xc')](_0x5f93('0x20'),_0x583cf4['message'],_0xd9bcc2);_0x855e6d(_0x32027d['error'](0x1f4,_0x583cf4[_0x5f93('0xe')]));});});}; \ No newline at end of file +var _0x0aa1=['MemberReport,\x20%s,\x20%s','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','limit','include','map','model','attributes','create','body','CreateMemberReport','update','UpdateMemberReport','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error'];(function(_0x2b402d,_0x1e713a){var _0x544c5d=function(_0x50d9bc){while(--_0x50d9bc){_0x2b402d['push'](_0x2b402d['shift']());}};_0x544c5d(++_0x1e713a);}(_0x0aa1,0xdd));var _0x10aa=function(_0x49cf23,_0x2a922e){_0x49cf23=_0x49cf23-0x0;var _0x5ac684=_0x0aa1[_0x49cf23];return _0x5ac684;};'use strict';var _=require(_0x10aa('0x0'));var util=require(_0x10aa('0x1'));var moment=require(_0x10aa('0x2'));var BPromise=require(_0x10aa('0x3'));var rs=require(_0x10aa('0x4'));var fs=require('fs');var Redis=require(_0x10aa('0x5'));var db=require(_0x10aa('0x6'))['db'];var utils=require(_0x10aa('0x7'));var logger=require('../../config/logger')(_0x10aa('0x8'));var config=require(_0x10aa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x10aa('0xa')][_0x10aa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x572174,_0x3c19b1,_0xe0664a){return new BPromise(function(_0x58839f,_0x59eba3){return client['request'](_0x572174,_0xe0664a)[_0x10aa('0xc')](function(_0x161ad0){logger[_0x10aa('0xd')]('MemberReport,\x20%s,\x20%s',_0x3c19b1,'request\x20sent');logger['debug'](_0x10aa('0xe'),_0x3c19b1,_0x10aa('0xf'),JSON[_0x10aa('0x10')](_0x161ad0));if(_0x161ad0['error']){if(_0x161ad0['error'][_0x10aa('0x11')]===0x1f4){logger[_0x10aa('0x12')](_0x10aa('0x13'),_0x3c19b1,_0x161ad0[_0x10aa('0x12')][_0x10aa('0x14')]);return _0x59eba3(_0x161ad0['error'][_0x10aa('0x14')]);}logger[_0x10aa('0x12')](_0x10aa('0x13'),_0x3c19b1,_0x161ad0[_0x10aa('0x12')][_0x10aa('0x14')]);return _0x58839f(_0x161ad0[_0x10aa('0x12')][_0x10aa('0x14')]);}else{logger['info'](_0x10aa('0x13'),_0x3c19b1,_0x10aa('0xf'));_0x58839f(_0x161ad0[_0x10aa('0x15')]['message']);}})[_0x10aa('0x16')](function(_0x5b18d2){logger[_0x10aa('0x12')]('MemberReport,\x20%s,\x20%s',_0x3c19b1,_0x5b18d2);_0x59eba3(_0x5b18d2);});});}exports[_0x10aa('0x17')]=function(_0x15bc93){var _0x21311e=this;return new Promise(function(_0x235436,_0x3df44b){return db[_0x10aa('0x18')][_0x10aa('0x19')]({'raw':_0x15bc93['options']?_0x15bc93[_0x10aa('0x1a')][_0x10aa('0x1b')]===undefined?!![]:![]:!![],'where':_0x15bc93['options']?_0x15bc93[_0x10aa('0x1a')][_0x10aa('0x1c')]||null:null,'attributes':_0x15bc93['options']?_0x15bc93[_0x10aa('0x1a')]['attributes']||null:null,'limit':_0x15bc93[_0x10aa('0x1a')]?_0x15bc93[_0x10aa('0x1a')][_0x10aa('0x1d')]||null:null,'include':_0x15bc93[_0x10aa('0x1a')]?_0x15bc93[_0x10aa('0x1a')][_0x10aa('0x1e')]?_[_0x10aa('0x1f')](_0x15bc93[_0x10aa('0x1a')][_0x10aa('0x1e')],function(_0x21517b){return{'model':db[_0x21517b[_0x10aa('0x20')]],'as':_0x21517b['as'],'attributes':_0x21517b['attributes'],'include':_0x21517b[_0x10aa('0x1e')]?_[_0x10aa('0x1f')](_0x21517b[_0x10aa('0x1e')],function(_0xa638d){return{'model':db[_0xa638d['model']],'as':_0xa638d['as'],'attributes':_0xa638d[_0x10aa('0x21')],'include':_0xa638d['include']?_[_0x10aa('0x1f')](_0xa638d[_0x10aa('0x1e')],function(_0x30863a){return{'model':db[_0x30863a[_0x10aa('0x20')]],'as':_0x30863a['as'],'attributes':_0x30863a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x208aa3){logger[_0x10aa('0xd')](_0x10aa('0x17'),_0x15bc93);logger['debug']('GetMemberReport',_0x15bc93,JSON[_0x10aa('0x10')](_0x208aa3));_0x235436(_0x208aa3);})[_0x10aa('0x16')](function(_0x442728){logger[_0x10aa('0x12')](_0x10aa('0x17'),_0x442728[_0x10aa('0x14')],_0x15bc93);_0x3df44b(_0x21311e[_0x10aa('0x12')](0x1f4,_0x442728[_0x10aa('0x14')]));});});};exports['CreateMemberReport']=function(_0x39c652){var _0x37bf10=this;return new Promise(function(_0x210642,_0x2a2517){return db[_0x10aa('0x18')][_0x10aa('0x22')](_0x39c652[_0x10aa('0x23')],{'raw':_0x39c652[_0x10aa('0x1a')]?_0x39c652[_0x10aa('0x1a')][_0x10aa('0x1b')]===undefined?!![]:![]:!![]})[_0x10aa('0xc')](function(_0x37d4ca){logger[_0x10aa('0xd')]('CreateMemberReport',_0x39c652);logger['debug'](_0x10aa('0x24'),_0x39c652,JSON[_0x10aa('0x10')](_0x37d4ca));_0x210642(_0x37d4ca);})[_0x10aa('0x16')](function(_0x434f71){logger['error']('CreateMemberReport',_0x434f71['message'],_0x39c652);_0x2a2517(_0x37bf10['error'](0x1f4,_0x434f71['message']));});});};exports['UpdateMemberReport']=function(_0x5576d7){var _0x377542=this;return new Promise(function(_0x4aea33,_0x3020fa){return db[_0x10aa('0x18')][_0x10aa('0x25')](_0x5576d7[_0x10aa('0x23')],{'raw':_0x5576d7[_0x10aa('0x1a')]?_0x5576d7[_0x10aa('0x1a')][_0x10aa('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5576d7[_0x10aa('0x1a')]?_0x5576d7['options']['where']||null:null,'attributes':_0x5576d7[_0x10aa('0x1a')]?_0x5576d7['options'][_0x10aa('0x21')]||null:null,'limit':_0x5576d7[_0x10aa('0x1a')]?_0x5576d7[_0x10aa('0x1a')][_0x10aa('0x1d')]||null:null})[_0x10aa('0xc')](function(_0x2fac13){logger['info'](_0x10aa('0x26'),_0x5576d7);logger[_0x10aa('0x27')](_0x10aa('0x26'),_0x5576d7,JSON[_0x10aa('0x10')](_0x2fac13));_0x4aea33(_0x2fac13);})[_0x10aa('0x16')](function(_0x1e0fc0){logger[_0x10aa('0x12')](_0x10aa('0x26'),_0x1e0fc0[_0x10aa('0x14')],_0x5576d7);_0x3020fa(_0x377542[_0x10aa('0x12')](0x1f4,_0x1e0fc0[_0x10aa('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 2b635c9..5218304 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 _0x4ded=['get','index','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller'];(function(_0x72d206,_0x49459b){var _0x5bab43=function(_0x127b27){while(--_0x127b27){_0x72d206['push'](_0x72d206['shift']());}};_0x5bab43(++_0x49459b);}(_0x4ded,0x116));var _0xd4de=function(_0x574e3f,_0x39fa94){_0x574e3f=_0x574e3f-0x0;var _0x953319=_0x4ded[_0x574e3f];return _0x953319;};'use strict';var multer=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var path=require(_0xd4de('0x2'));var timeout=require(_0xd4de('0x3'));var express=require(_0xd4de('0x4'));var router=express[_0xd4de('0x5')]();var auth=require(_0xd4de('0x6'));var interaction=require(_0xd4de('0x7'));var config=require(_0xd4de('0x8'));var controller=require(_0xd4de('0x9'));router[_0xd4de('0xa')]('/',controller[_0xd4de('0xb')]);module['exports']=router; \ No newline at end of file +var _0x80ed=['../../config/environment','./migration.controller','index','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x4be79b,_0x21e987){var _0x14d71e=function(_0x25ea7a){while(--_0x25ea7a){_0x4be79b['push'](_0x4be79b['shift']());}};_0x14d71e(++_0x21e987);}(_0x80ed,0x11c));var _0xd80e=function(_0x253562,_0x26d80b){_0x253562=_0x253562-0x0;var _0x464558=_0x80ed[_0x253562];return _0x464558;};'use strict';var multer=require(_0xd80e('0x0'));var util=require('util');var path=require(_0xd80e('0x1'));var timeout=require(_0xd80e('0x2'));var express=require(_0xd80e('0x3'));var router=express['Router']();var auth=require(_0xd80e('0x4'));var interaction=require(_0xd80e('0x5'));var config=require(_0xd80e('0x6'));var controller=require(_0xd80e('0x7'));router['get']('/',controller[_0xd80e('0x8')]);module[_0xd80e('0x9')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index c99b397..6994788 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 _0x9d5c=['exports','STRING','version','sequelize'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9d5c,0xd7));var _0xc9d5=function(_0x2c711b,_0x99bf88){_0x2c711b=_0x2c711b-0x0;var _0x1f2bed=_0x9d5c[_0x2c711b];return _0x1f2bed;};'use strict';var Sequelize=require(_0xc9d5('0x0'));module[_0xc9d5('0x1')]={'version':{'type':Sequelize[_0xc9d5('0x2')],'unique':_0xc9d5('0x3')}}; \ No newline at end of file +var _0x4c47=['sequelize','exports','STRING','version'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4c47,0xe4));var _0x74c4=function(_0x49d64d,_0x1aeabb){_0x49d64d=_0x49d64d-0x0;var _0x4c4800=_0x4c47[_0x49d64d];return _0x4c4800;};'use strict';var Sequelize=require(_0x74c4('0x0'));module[_0x74c4('0x1')]={'version':{'type':Sequelize[_0x74c4('0x2')],'unique':_0x74c4('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index ea506fd..31573ab 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 _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(_0x5d0919,_0x1b8e12){var _0x2506a8=function(_0x2ee7ab){while(--_0x2ee7ab){_0x5d0919['push'](_0x5d0919['shift']());}};_0x2506a8(++_0x1b8e12);}(_0xb10b,0x12a));var _0xbb10=function(_0x3a27fd,_0x5357ea){_0x3a27fd=_0x3a27fd-0x0;var _0x2e519=_0xb10b[_0x3a27fd];return _0x2e519;};'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 +var _0x5f2f=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','map','fieldName','type','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','Migration','then','include','rows','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce'];(function(_0x4dce1b,_0x596e5f){var _0x3b6ede=function(_0x275bde){while(--_0x275bde){_0x4dce1b['push'](_0x4dce1b['shift']());}};_0x3b6ede(++_0x596e5f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x35eabd,_0x72891c){_0x35eabd=_0x35eabd-0x0;var _0x54538c=_0x5f2f[_0x35eabd];return _0x54538c;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var db=require(_0xf5f2('0x16'))['db'];function respondWithStatusCode(_0x14b51f,_0x331482){_0x331482=_0x331482||0xcc;return function(_0x3f2997){if(_0x3f2997){return _0x14b51f[_0xf5f2('0x17')](_0x331482);}return _0x14b51f[_0xf5f2('0x18')](_0x331482)['end']();};}function respondWithResult(_0x5850f4,_0xea612c){_0xea612c=_0xea612c||0xc8;return function(_0x269909){if(_0x269909){return _0x5850f4[_0xf5f2('0x18')](_0xea612c)[_0xf5f2('0x19')](_0x269909);}};}function respondWithFilteredResult(_0x4d97fc,_0xafe430){return function(_0x286197){if(_0x286197){var _0x17d656=_0x286197[_0xf5f2('0x1a')],_0x1b6dd2=_0xafe430[_0xf5f2('0x1b')],_0x23e23a=_0xafe430[_0xf5f2('0x1b')]+_0xafe430[_0xf5f2('0x1c')],_0x3a9dbb;if(_0x23e23a>=_0x17d656){_0x23e23a=_0x17d656;_0x3a9dbb=0xc8;}else{_0x3a9dbb=0xce;}_0x4d97fc[_0xf5f2('0x18')](_0x3a9dbb);return _0x4d97fc[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x1b6dd2+'-'+_0x23e23a+'/'+_0x17d656)[_0xf5f2('0x19')](_0x286197);}return null;};}function patchUpdates(_0x3cf5ea){return function(_0x626999){try{jsonpatch[_0xf5f2('0x1f')](_0x626999,_0x3cf5ea,!![]);}catch(_0x56acc5){return BPromise[_0xf5f2('0x20')](_0x56acc5);}return _0x626999[_0xf5f2('0x21')]();};}function saveUpdates(_0x49dac2,_0x47acfc){return function(_0x2d2805){if(_0x2d2805){return _0x2d2805[_0xf5f2('0x22')](_0x49dac2)['then'](function(_0x45b74f){return _0x45b74f;});}return null;};}function removeEntity(_0x170042,_0x39e44a){return function(_0x39c024){if(_0x39c024){return _0x39c024[_0xf5f2('0x23')]()['then'](function(){_0x170042[_0xf5f2('0x18')](0xcc)[_0xf5f2('0x24')]();});}};}function handleEntityNotFound(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(!_0x287ad5){_0x4e8bda['sendStatus'](0x194);}return _0x287ad5;};}function handleError(_0x529f07,_0x5f1124){_0x5f1124=_0x5f1124||0x1f4;return function(_0x3f79d5){logger[_0xf5f2('0x25')](_0x3f79d5[_0xf5f2('0x26')]);if(_0x3f79d5[_0xf5f2('0x27')]){delete _0x3f79d5[_0xf5f2('0x27')];}_0x529f07[_0xf5f2('0x18')](_0x5f1124)[_0xf5f2('0x28')](_0x3f79d5);};}exports[_0xf5f2('0x29')]=function(_0x4ab014,_0xaa2602){var _0x102449={},_0x375ca8={},_0x31bfcb={'count':0x0,'rows':[]};var _0x198c73=_[_0xf5f2('0x2a')](db['Migration']['rawAttributes'],function(_0x22c826){return{'name':_0x22c826[_0xf5f2('0x2b')],'type':_0x22c826[_0xf5f2('0x2c')]['key']};});_0x375ca8['model']=_[_0xf5f2('0x2a')](_0x198c73,_0xf5f2('0x27'));_0x375ca8[_0xf5f2('0x2d')]=_[_0xf5f2('0x2e')](_0x4ab014[_0xf5f2('0x2d')]);_0x375ca8['filters']=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],_0x375ca8['query']);_0x102449[_0xf5f2('0x30')]=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],qs[_0xf5f2('0x31')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x31')]));_0x102449[_0xf5f2('0x30')]=_0x102449[_0xf5f2('0x30')][_0xf5f2('0x32')]?_0x102449[_0xf5f2('0x30')]:_0x375ca8['model'];if(!_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x33')](_0xf5f2('0x34'))){_0x102449[_0xf5f2('0x1c')]=qs[_0xf5f2('0x1c')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x1c')]);_0x102449['offset']=qs[_0xf5f2('0x1b')](_0x4ab014[_0xf5f2('0x2d')]['offset']);}_0x102449[_0xf5f2('0x35')]=qs['sort'](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x36')]);_0x102449[_0xf5f2('0x37')]=qs[_0xf5f2('0x38')](_['pick'](_0x4ab014['query'],_0x375ca8[_0xf5f2('0x38')]));if(_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]){_0x102449['where']=_[_0xf5f2('0x3a')](_0x102449['where'],{'$or':_[_0xf5f2('0x2a')](_0x198c73,function(_0x566c47){if(_0x566c47[_0xf5f2('0x2c')]!==_0xf5f2('0x3b')){var _0x5337a6={};_0x5337a6[_0x566c47[_0xf5f2('0x27')]]={'$like':'%'+_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]+'%'};return _0x5337a6;}})});}_0x102449=_[_0xf5f2('0x3a')]({},_0x102449,_0x4ab014['options']);var _0x5d2d82={'where':_0x102449[_0xf5f2('0x37')]};return db[_0xf5f2('0x3c')][_0xf5f2('0x1a')](_0x5d2d82)[_0xf5f2('0x3d')](function(_0x2c7f65){_0x31bfcb[_0xf5f2('0x1a')]=_0x2c7f65;if(_0x4ab014[_0xf5f2('0x2d')]['includeAll']){_0x102449[_0xf5f2('0x3e')]=[{'all':!![]}];}return db[_0xf5f2('0x3c')]['findAll'](_0x102449);})[_0xf5f2('0x3d')](function(_0x3f3895){_0x31bfcb[_0xf5f2('0x3f')]=_0x3f3895;return _0x31bfcb;})[_0xf5f2('0x3d')](respondWithFilteredResult(_0xaa2602,_0x102449))[_0xf5f2('0x40')](handleError(_0xaa2602,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index d58ede6..5ec4354 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 _0x66c5=['define','Migration','migrations','lodash','util','api','bluebird','request-promise','../../config/environment','./migration.attributes','exports'];(function(_0x8587a,_0xb54945){var _0x4584e9=function(_0x26109f){while(--_0x26109f){_0x8587a['push'](_0x8587a['shift']());}};_0x4584e9(++_0xb54945);}(_0x66c5,0x142));var _0x566c=function(_0x317c62,_0x26e37e){_0x317c62=_0x317c62-0x0;var _0x3bd6ce=_0x66c5[_0x317c62];return _0x3bd6ce;};'use strict';var _=require(_0x566c('0x0'));var util=require(_0x566c('0x1'));var logger=require('../../config/logger')(_0x566c('0x2'));var moment=require('moment');var BPromise=require(_0x566c('0x3'));var rp=require(_0x566c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x566c('0x5'));var attributes=require(_0x566c('0x6'));module[_0x566c('0x7')]=function(_0x22fc8d,_0x2a3536){return _0x22fc8d[_0x566c('0x8')](_0x566c('0x9'),attributes,{'tableName':_0x566c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf8d9=['./migration.attributes','exports','Migration','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x41255d,_0x40d54c){var _0x2de287=function(_0x1eddec){while(--_0x1eddec){_0x41255d['push'](_0x41255d['shift']());}};_0x2de287(++_0x40d54c);}(_0xf8d9,0x175));var _0x9f8d=function(_0x12d013,_0x286e4c){_0x12d013=_0x12d013-0x0;var _0x54220c=_0xf8d9[_0x12d013];return _0x54220c;};'use strict';var _=require('lodash');var util=require(_0x9f8d('0x0'));var logger=require(_0x9f8d('0x1'))(_0x9f8d('0x2'));var moment=require('moment');var BPromise=require(_0x9f8d('0x3'));var rp=require(_0x9f8d('0x4'));var fs=require('fs');var path=require(_0x9f8d('0x5'));var rimraf=require('rimraf');var config=require(_0x9f8d('0x6'));var attributes=require(_0x9f8d('0x7'));module[_0x9f8d('0x8')]=function(_0x18eae3,_0x58af42){return _0x18eae3['define'](_0x9f8d('0x9'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 20429f1..db1ab19 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 _0xb886=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Migration,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x491b60,_0x4dcc2c){var _0x461a23=function(_0x292283){while(--_0x292283){_0x491b60['push'](_0x491b60['shift']());}};_0x461a23(++_0x4dcc2c);}(_0xb886,0xf5));var _0x6b88=function(_0x2d2f82,_0x28eb77){_0x2d2f82=_0x2d2f82-0x0;var _0x37a882=_0xb886[_0x2d2f82];return _0x37a882;};'use strict';var _=require(_0x6b88('0x0'));var util=require(_0x6b88('0x1'));var moment=require(_0x6b88('0x2'));var BPromise=require(_0x6b88('0x3'));var rs=require(_0x6b88('0x4'));var fs=require('fs');var Redis=require(_0x6b88('0x5'));var db=require(_0x6b88('0x6'))['db'];var utils=require(_0x6b88('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x6b88('0x8'));var jayson=require(_0x6b88('0x9'));var client=jayson[_0x6b88('0xa')][_0x6b88('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e0afb,_0x44813c,_0x4e15f1){return new BPromise(function(_0x154466,_0x554eb5){return client['request'](_0x2e0afb,_0x4e15f1)[_0x6b88('0xc')](function(_0x256109){logger[_0x6b88('0xd')](_0x6b88('0xe'),_0x44813c,_0x6b88('0xf'));logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x44813c,_0x6b88('0xf'),JSON[_0x6b88('0x10')](_0x256109));if(_0x256109[_0x6b88('0x11')]){if(_0x256109['error'][_0x6b88('0x12')]===0x1f4){logger[_0x6b88('0x11')](_0x6b88('0xe'),_0x44813c,_0x256109[_0x6b88('0x11')][_0x6b88('0x13')]);return _0x554eb5(_0x256109[_0x6b88('0x11')][_0x6b88('0x13')]);}logger[_0x6b88('0x11')](_0x6b88('0xe'),_0x44813c,_0x256109[_0x6b88('0x11')][_0x6b88('0x13')]);return _0x154466(_0x256109['error']['message']);}else{logger['info'](_0x6b88('0xe'),_0x44813c,'request\x20sent');_0x154466(_0x256109[_0x6b88('0x14')]['message']);}})[_0x6b88('0x15')](function(_0x4139ab){logger[_0x6b88('0x11')]('Migration,\x20%s,\x20%s',_0x44813c,_0x4139ab);_0x554eb5(_0x4139ab);});});} \ No newline at end of file +var _0xeaf3=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment'];(function(_0x48600b,_0x867081){var _0x4e6e60=function(_0x2321d3){while(--_0x2321d3){_0x48600b['push'](_0x48600b['shift']());}};_0x4e6e60(++_0x867081);}(_0xeaf3,0x1cd));var _0x3eaf=function(_0x28c554,_0x1a12b8){_0x28c554=_0x28c554-0x0;var _0x23c09c=_0xeaf3[_0x28c554];return _0x23c09c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3eaf('0x0'));var BPromise=require(_0x3eaf('0x1'));var rs=require(_0x3eaf('0x2'));var fs=require('fs');var Redis=require(_0x3eaf('0x3'));var db=require(_0x3eaf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3eaf('0x5'))(_0x3eaf('0x6'));var config=require(_0x3eaf('0x7'));var jayson=require(_0x3eaf('0x8'));var client=jayson[_0x3eaf('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c2540,_0x4a29d3,_0x5f4fdf){return new BPromise(function(_0x9f3a2d,_0x357cb0){return client[_0x3eaf('0xa')](_0x5c2540,_0x5f4fdf)[_0x3eaf('0xb')](function(_0x355059){logger[_0x3eaf('0xc')](_0x3eaf('0xd'),_0x4a29d3,_0x3eaf('0xe'));logger[_0x3eaf('0xf')](_0x3eaf('0x10'),_0x4a29d3,_0x3eaf('0xe'),JSON[_0x3eaf('0x11')](_0x355059));if(_0x355059['error']){if(_0x355059[_0x3eaf('0x12')][_0x3eaf('0x13')]===0x1f4){logger[_0x3eaf('0x12')](_0x3eaf('0xd'),_0x4a29d3,_0x355059[_0x3eaf('0x12')]['message']);return _0x357cb0(_0x355059[_0x3eaf('0x12')]['message']);}logger['error'](_0x3eaf('0xd'),_0x4a29d3,_0x355059[_0x3eaf('0x12')]['message']);return _0x9f3a2d(_0x355059[_0x3eaf('0x12')]['message']);}else{logger[_0x3eaf('0xc')]('Migration,\x20%s,\x20%s',_0x4a29d3,_0x3eaf('0xe'));_0x9f3a2d(_0x355059['result'][_0x3eaf('0x14')]);}})[_0x3eaf('0x15')](function(_0x1f47ef){logger[_0x3eaf('0x12')](_0x3eaf('0xd'),_0x4a29d3,_0x1f47ef);_0x357cb0(_0x1f47ef);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 48f38d6..e1fc7ee 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 _0x69a2=['exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./network.controller','get','/:id','isAuthenticated','post','create','update','delete','destroy'];(function(_0xe719ec,_0x5a280e){var _0x4842a1=function(_0x59b968){while(--_0x59b968){_0xe719ec['push'](_0xe719ec['shift']());}};_0x4842a1(++_0x5a280e);}(_0x69a2,0x181));var _0x269a=function(_0x31a07b,_0x49ffc9){_0x31a07b=_0x31a07b-0x0;var _0x8d4c23=_0x69a2[_0x31a07b];return _0x8d4c23;};'use strict';var multer=require('multer');var util=require(_0x269a('0x0'));var path=require('path');var timeout=require(_0x269a('0x1'));var express=require(_0x269a('0x2'));var router=express[_0x269a('0x3')]();var auth=require(_0x269a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x269a('0x5'));var controller=require(_0x269a('0x6'));router[_0x269a('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x269a('0x7')](_0x269a('0x8'),auth[_0x269a('0x9')](),controller['show']);router[_0x269a('0xa')]('/',auth[_0x269a('0x9')](),controller[_0x269a('0xb')]);router['put'](_0x269a('0x8'),auth[_0x269a('0x9')](),controller[_0x269a('0xc')]);router[_0x269a('0xd')](_0x269a('0x8'),auth['isAuthenticated'](),controller[_0x269a('0xe')]);module[_0x269a('0xf')]=router; \ No newline at end of file +var _0xf8fa=['connect-timeout','express','../../components/auth/service','../../config/environment','./network.controller','get','index','/:id','isAuthenticated','show','put','update','delete','destroy','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf8fa,0x13e));var _0xaf8f=function(_0x47b7c4,_0x41d72b){_0x47b7c4=_0x47b7c4-0x0;var _0x544129=_0xf8fa[_0x47b7c4];return _0x544129;};'use strict';var multer=require('multer');var util=require(_0xaf8f('0x0'));var path=require(_0xaf8f('0x1'));var timeout=require(_0xaf8f('0x2'));var express=require(_0xaf8f('0x3'));var router=express['Router']();var auth=require(_0xaf8f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xaf8f('0x5'));var controller=require(_0xaf8f('0x6'));router[_0xaf8f('0x7')]('/',auth['isAuthenticated'](),controller[_0xaf8f('0x8')]);router[_0xaf8f('0x7')](_0xaf8f('0x9'),auth[_0xaf8f('0xa')](),controller[_0xaf8f('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xaf8f('0xc')](_0xaf8f('0x9'),auth[_0xaf8f('0xa')](),controller[_0xaf8f('0xd')]);router[_0xaf8f('0xe')](_0xaf8f('0x9'),auth[_0xaf8f('0xa')](),controller[_0xaf8f('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 52f9312..88a5f92 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(_0x2254bd,_0xe71dde){var _0x1b2b97=function(_0x5f20b6){while(--_0x5f20b6){_0x2254bd['push'](_0x2254bd['shift']());}};_0x1b2b97(++_0xe71dde);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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(_0x4a3284,_0x5cb99b){var _0x7b9e39=function(_0x57219f){while(--_0x57219f){_0x4a3284['push'](_0x4a3284['shift']());}};_0x7b9e39(++_0x5cb99b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 bb71c04..12d51de 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 _0x19d7=['show','params','keys','find','create','sequelize','transaction','body','type','toUpperCase','join','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','readFileSync','root','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','STUN','chan_sip.so','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Network,\x20%s,\x20%s','message','result','catch','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','Network','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include'];(function(_0x15be41,_0x52fed4){var _0x3de39a=function(_0x46fbb6){while(--_0x46fbb6){_0x15be41['push'](_0x15be41['shift']());}};_0x3de39a(++_0x52fed4);}(_0x19d7,0xf3));var _0x719d=function(_0x16ef64,_0x4f2805){_0x16ef64=_0x16ef64-0x0;var _0x15bf1e=_0x19d7[_0x16ef64];return _0x15bf1e;};'use strict';var pdf=require(_0x719d('0x0'));var emlformat=require(_0x719d('0x1'));var rimraf=require(_0x719d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x719d('0x3'));var rp=require(_0x719d('0x4'));var moment=require(_0x719d('0x5'));var BPromise=require(_0x719d('0x6'));var Mustache=require(_0x719d('0x7'));var util=require(_0x719d('0x8'));var path=require(_0x719d('0x9'));var sox=require(_0x719d('0xa'));var csv=require(_0x719d('0xb'));var ejs=require(_0x719d('0xc'));var fs=require('fs');var _=require(_0x719d('0xd'));var squel=require(_0x719d('0xe'));var crypto=require('crypto');var jsforce=require(_0x719d('0xf'));var deskjs=require(_0x719d('0x10'));var toCsv=require(_0x719d('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x719d('0x11'));var authService=require(_0x719d('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x719d('0x13'))(_0x719d('0x14'));var utils=require(_0x719d('0x15'));var config=require(_0x719d('0x16'));var db=require(_0x719d('0x17'))['db'];var jayson=require(_0x719d('0x18'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x3122e7,_0x2ed347,_0x42a591){if(_0x42a591){var _0x32546f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x32546f['test'](_0x2ed347)){return _0x3122e7;}else{throw new db[(_0x719d('0x19'))][(_0x719d('0x1a'))](_0x719d('0x1b'));}}else{return _0x3122e7;}}function respondWithRpcPromise(_0x2fe116,_0x29511c,_0x3802cf,_0x225184){return new BPromise(function(_0x5316c5,_0x1ccbdf){var _0x1439fb=_0x225184||client;return _0x1439fb['request'](_0x2fe116,_0x3802cf)[_0x719d('0x1c')](function(_0x262466){logger[_0x719d('0x1d')]('Network,\x20%s,\x20%s',_0x29511c,'request\x20sent');logger[_0x719d('0x1e')](_0x719d('0x1f'),_0x29511c,_0x719d('0x20'),JSON['stringify'](_0x262466));if(_0x262466[_0x719d('0x21')]){if(_0x262466[_0x719d('0x21')][_0x719d('0x22')]===0x1f4){logger[_0x719d('0x21')](_0x719d('0x23'),_0x29511c,_0x262466['error'][_0x719d('0x24')]);return _0x1ccbdf(_0x262466[_0x719d('0x21')]['message']);}logger[_0x719d('0x21')]('Network,\x20%s,\x20%s',_0x29511c,_0x262466[_0x719d('0x21')][_0x719d('0x24')]);return _0x5316c5(_0x262466[_0x719d('0x21')]['message']);}else{logger['info'](_0x719d('0x23'),_0x29511c,_0x719d('0x20'));_0x5316c5(_0x262466[_0x719d('0x25')][_0x719d('0x24')]);}})[_0x719d('0x26')](function(_0x1a2009){logger[_0x719d('0x21')](_0x719d('0x23'),_0x29511c,_0x1a2009);_0x1ccbdf(_0x1a2009);});});}function respondWithStatusCode(_0x3c73f3,_0x83e2a6){_0x83e2a6=_0x83e2a6||0xcc;return function(_0x135729){if(_0x135729){return _0x3c73f3['sendStatus'](_0x83e2a6);}return _0x3c73f3[_0x719d('0x27')](_0x83e2a6)['end']();};}function respondWithResult(_0x2821a7,_0xec2f23){_0xec2f23=_0xec2f23||0xc8;return function(_0x1747b3){if(_0x1747b3){return _0x2821a7['status'](_0xec2f23)[_0x719d('0x28')](_0x1747b3);}};}function respondWithFilteredResult(_0x18991c,_0x52d331){return function(_0x2f28a8){if(_0x2f28a8){var _0x3ebc6a=_0x2f28a8[_0x719d('0x29')],_0x167f23=_0x52d331[_0x719d('0x2a')],_0x15d189=_0x52d331[_0x719d('0x2a')]+_0x52d331[_0x719d('0x2b')],_0x18df38;if(_0x15d189>=_0x3ebc6a){_0x15d189=_0x3ebc6a;_0x18df38=0xc8;}else{_0x18df38=0xce;}_0x18991c[_0x719d('0x27')](_0x18df38);return _0x18991c[_0x719d('0x2c')](_0x719d('0x2d'),_0x167f23+'-'+_0x15d189+'/'+_0x3ebc6a)[_0x719d('0x28')](_0x2f28a8);}return null;};}function patchUpdates(_0x4704e1){return function(_0x582e8d){try{jsonpatch[_0x719d('0x2e')](_0x582e8d,_0x4704e1,!![]);}catch(_0xb41217){return BPromise[_0x719d('0x2f')](_0xb41217);}return _0x582e8d[_0x719d('0x30')]();};}function saveUpdates(_0x15a8d5,_0x1ac221){return function(_0x5dcbcf){if(_0x5dcbcf){return _0x5dcbcf[_0x719d('0x31')](_0x15a8d5)['then'](function(_0x32e726){return _0x32e726;});}return null;};}function removeEntity(_0x48c906,_0x4dd7c1){return function(_0x251fed){if(_0x251fed){return _0x251fed[_0x719d('0x32')]()[_0x719d('0x1c')](function(){_0x48c906[_0x719d('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf1ee52,_0x26ef41){return function(_0x4ef523){if(!_0x4ef523){_0xf1ee52[_0x719d('0x33')](0x194);}return _0x4ef523;};}function handleError(_0x4d2174,_0x4bdb0a){_0x4bdb0a=_0x4bdb0a||0x1f4;return function(_0x34806f){logger[_0x719d('0x21')](_0x34806f[_0x719d('0x34')]);if(_0x34806f[_0x719d('0x35')]){delete _0x34806f[_0x719d('0x35')];}_0x4d2174['status'](_0x4bdb0a)[_0x719d('0x36')](_0x34806f);};}exports[_0x719d('0x37')]=function(_0x51652e,_0x3741d8){var _0xe1e461={},_0x3cd198={},_0x197f0a={'count':0x0,'rows':[]};var _0x2edaf0=_[_0x719d('0x38')](db[_0x719d('0x39')][_0x719d('0x3a')],function(_0xb34d02){return{'name':_0xb34d02[_0x719d('0x3b')],'type':_0xb34d02['type']['key']};});_0x3cd198[_0x719d('0x3c')]=_[_0x719d('0x38')](_0x2edaf0,_0x719d('0x35'));_0x3cd198[_0x719d('0x3d')]=_['keys'](_0x51652e[_0x719d('0x3d')]);_0x3cd198[_0x719d('0x3e')]=_[_0x719d('0x3f')](_0x3cd198[_0x719d('0x3c')],_0x3cd198['query']);_0xe1e461['attributes']=_[_0x719d('0x3f')](_0x3cd198[_0x719d('0x3c')],qs['fields'](_0x51652e['query'][_0x719d('0x40')]));_0xe1e461[_0x719d('0x41')]=_0xe1e461[_0x719d('0x41')][_0x719d('0x42')]?_0xe1e461['attributes']:_0x3cd198[_0x719d('0x3c')];if(!_0x51652e[_0x719d('0x3d')][_0x719d('0x43')](_0x719d('0x44'))){_0xe1e461[_0x719d('0x2b')]=qs['limit'](_0x51652e[_0x719d('0x3d')][_0x719d('0x2b')]);_0xe1e461[_0x719d('0x2a')]=qs['offset'](_0x51652e['query'][_0x719d('0x2a')]);}_0xe1e461[_0x719d('0x45')]=qs[_0x719d('0x46')](_0x51652e[_0x719d('0x3d')]['sort']);_0xe1e461[_0x719d('0x47')]=qs[_0x719d('0x3e')](_['pick'](_0x51652e[_0x719d('0x3d')],_0x3cd198[_0x719d('0x3e')]));if(_0x51652e[_0x719d('0x3d')]['filter']){_0xe1e461['where']=_[_0x719d('0x48')](_0xe1e461[_0x719d('0x47')],{'$or':_[_0x719d('0x38')](_0x2edaf0,function(_0x337771){if(_0x337771['type']!==_0x719d('0x49')){var _0x18cd46={};_0x18cd46[_0x337771[_0x719d('0x35')]]={'$like':'%'+_0x51652e['query'][_0x719d('0x4a')]+'%'};return _0x18cd46;}})});}_0xe1e461=_[_0x719d('0x48')]({},_0xe1e461,_0x51652e[_0x719d('0x4b')]);var _0x4344bb={'where':_0xe1e461[_0x719d('0x47')]};return db['Network'][_0x719d('0x29')](_0x4344bb)[_0x719d('0x1c')](function(_0x47a8e7){_0x197f0a[_0x719d('0x29')]=_0x47a8e7;if(_0x51652e[_0x719d('0x3d')][_0x719d('0x4c')]){_0xe1e461[_0x719d('0x4d')]=[{'all':!![]}];}return db[_0x719d('0x39')]['findAll'](_0xe1e461);})[_0x719d('0x1c')](function(_0x37abad){_0x197f0a['rows']=_0x37abad;return _0x197f0a;})[_0x719d('0x1c')](respondWithFilteredResult(_0x3741d8,_0xe1e461))[_0x719d('0x26')](handleError(_0x3741d8,null));};exports[_0x719d('0x4e')]=function(_0x5442d3,_0x4960bc){var _0x170bfa={'raw':!![],'where':{'id':_0x5442d3[_0x719d('0x4f')]['id']}},_0x262f35={};_0x262f35[_0x719d('0x3c')]=_[_0x719d('0x50')](db[_0x719d('0x39')][_0x719d('0x3a')]);_0x262f35[_0x719d('0x3d')]=_[_0x719d('0x50')](_0x5442d3[_0x719d('0x3d')]);_0x262f35[_0x719d('0x3e')]=_[_0x719d('0x3f')](_0x262f35['model'],_0x262f35[_0x719d('0x3d')]);_0x170bfa['attributes']=_[_0x719d('0x3f')](_0x262f35[_0x719d('0x3c')],qs[_0x719d('0x40')](_0x5442d3['query'][_0x719d('0x40')]));_0x170bfa[_0x719d('0x41')]=_0x170bfa[_0x719d('0x41')][_0x719d('0x42')]?_0x170bfa['attributes']:_0x262f35[_0x719d('0x3c')];if(_0x5442d3['query'][_0x719d('0x4c')]){_0x170bfa[_0x719d('0x4d')]=[{'all':!![]}];}_0x170bfa=_[_0x719d('0x48')]({},_0x170bfa,_0x5442d3[_0x719d('0x4b')]);return db[_0x719d('0x39')][_0x719d('0x51')](_0x170bfa)[_0x719d('0x1c')](handleEntityNotFound(_0x4960bc,null))[_0x719d('0x1c')](respondWithResult(_0x4960bc,null))['catch'](handleError(_0x4960bc,null));};exports[_0x719d('0x52')]=function(_0x1c9e7c,_0x582570,_0x2232be){var _0x598119;return db[_0x719d('0x53')][_0x719d('0x54')](function(_0x612d96){return db['Network'][_0x719d('0x52')](_0x1c9e7c[_0x719d('0x55')],{'raw':!![]})['then'](function(_0x19fd76){_0x598119=_0x19fd76;return db[_0x719d('0x39')]['findAll']({'where':{'type':_0x1c9e7c[_0x719d('0x55')][_0x719d('0x56')]},'raw':!![]});})[_0x719d('0x1c')](function(_0x152bdd){if(_0x598119['type'][_0x719d('0x57')]()=='STUN'){var _0x42d957=fs['readFileSync'](path[_0x719d('0x58')](config['root'],_0x719d('0x59')),_0x719d('0x5a'));var _0x3ec2fa=ejs[_0x719d('0x5b')](_0x42d957,{'networks':_0x152bdd||[]});fs[_0x719d('0x5c')](_0x719d('0x5d'),_0x3ec2fa);return respondWithRpcPromise('Reload',_0x719d('0x52'),{'module':_0x719d('0x5e')});}else if(_0x598119['type']['toUpperCase']()==_0x719d('0x5f')){var _0x2566b8=fs[_0x719d('0x60')](path[_0x719d('0x58')](config[_0x719d('0x61')],_0x719d('0x62')),_0x719d('0x5a'));var _0x3af4a2=ejs['render'](_0x2566b8,{'networks':_0x152bdd||[]});fs[_0x719d('0x5c')](_0x719d('0x63'),_0x3af4a2);return respondWithRpcPromise(_0x719d('0x64'),'create',{'module':_0x719d('0x5e')});}else{var _0x555668=fs[_0x719d('0x60')](path[_0x719d('0x58')](config[_0x719d('0x61')],_0x719d('0x65')),_0x719d('0x5a'));var _0x4b6c73=ejs[_0x719d('0x5b')](_0x555668,{'networks':_0x152bdd||[]});fs[_0x719d('0x5c')](util[_0x719d('0x66')](_0x719d('0x67'),_0x1c9e7c[_0x719d('0x55')][_0x719d('0x56')][_0x719d('0x68')]()),_0x4b6c73);return respondWithRpcPromise(_0x719d('0x64'),_0x719d('0x52'),{'module':'chan_sip.so'});}return null;})[_0x719d('0x1c')](function(){return _0x598119;});})[_0x719d('0x1c')](respondWithResult(_0x582570,0xc9))[_0x719d('0x26')](handleError(_0x582570,null));};exports[_0x719d('0x31')]=function(_0x1e8080,_0x9bd740,_0x38ebd9){var _0x5adf49;return db['sequelize'][_0x719d('0x54')](function(_0x1bde3e){return db[_0x719d('0x39')]['find']({'where':{'id':_0x1e8080['params']['id']}})[_0x719d('0x1c')](handleEntityNotFound(_0x9bd740,null))['then'](saveUpdates(_0x1e8080[_0x719d('0x55')],null))['then'](function(_0x52184c){if(_0x52184c){_0x5adf49=_0x52184c;return db['Network']['findAll']({'where':{'type':_0x5adf49[_0x719d('0x56')]},'raw':!![]});}return null;})[_0x719d('0x1c')](function(_0x6339dd){if(_0x5adf49[_0x719d('0x56')][_0x719d('0x57')]()==_0x719d('0x69')){var _0x121749=fs['readFileSync'](path[_0x719d('0x58')](config[_0x719d('0x61')],_0x719d('0x59')),_0x719d('0x5a'));var _0x29900a=ejs[_0x719d('0x5b')](_0x121749,{'networks':_0x6339dd||[]});fs[_0x719d('0x5c')]('/etc/asterisk/stun_xcally.conf',_0x29900a);return respondWithRpcPromise(_0x719d('0x64'),'update',{'module':_0x719d('0x5e')});}else if(_0x5adf49['type']['toUpperCase']()=='TURN'){var _0x548699=fs[_0x719d('0x60')](path[_0x719d('0x58')](config[_0x719d('0x61')],'server/files/templates/turn_multiple.ejs'),_0x719d('0x5a'));var _0x4514eb=ejs[_0x719d('0x5b')](_0x548699,{'networks':_0x6339dd||[]});fs['writeFileSync'](_0x719d('0x63'),_0x4514eb);return respondWithRpcPromise(_0x719d('0x64'),'update',{'module':_0x719d('0x5e')});}else{var _0x2b5d5f=fs[_0x719d('0x60')](path['join'](config[_0x719d('0x61')],_0x719d('0x65')),_0x719d('0x5a'));var _0x451045=ejs['render'](_0x2b5d5f,{'networks':_0x6339dd||[]});fs['writeFileSync'](util[_0x719d('0x66')](_0x719d('0x67'),_0x1e8080[_0x719d('0x55')][_0x719d('0x56')]['toLowerCase']()),_0x451045);return respondWithRpcPromise('Reload',_0x719d('0x31'),{'module':_0x719d('0x6a')});}return null;})[_0x719d('0x1c')](function(_0x32383c){if(_0x32383c){return _0x5adf49;}return null;});})[_0x719d('0x1c')](respondWithResult(_0x9bd740,null))['catch'](handleError(_0x9bd740,null));};exports[_0x719d('0x32')]=function(_0xcde7ee,_0x592a36,_0x930e20){var _0x7a277f;return db[_0x719d('0x39')][_0x719d('0x51')]({'where':{'id':_0xcde7ee['params']['id']}})['then'](function(_0x298175){_0x7a277f=_0x298175;return _0x298175;})[_0x719d('0x1c')](handleEntityNotFound(_0x592a36,null))[_0x719d('0x1c')](removeEntity(_0x592a36,null))['then'](function(){if(_0x7a277f){return db['Network']['findAll']({'where':{'type':_0x7a277f[_0x719d('0x56')]},'raw':!![]});}})[_0x719d('0x1c')](function(_0x2c2186){if(_0x7a277f['type'][_0x719d('0x57')]()==_0x719d('0x69')){var _0x364194=fs[_0x719d('0x60')](path['join'](config['root'],_0x719d('0x59')),'utf8');var _0x15aba4=ejs[_0x719d('0x5b')](_0x364194,{'networks':_0x2c2186||[]});fs[_0x719d('0x5c')](_0x719d('0x5d'),_0x15aba4);return respondWithRpcPromise('Reload',_0x719d('0x32'),{'module':'res_stun_monitor.so'});}else if(_0x7a277f[_0x719d('0x56')][_0x719d('0x57')]()==_0x719d('0x5f')){var _0x189499=fs['readFileSync'](path['join'](config[_0x719d('0x61')],'server/files/templates/turn_multiple.ejs'),_0x719d('0x5a'));var _0x352176=ejs[_0x719d('0x5b')](_0x189499,{'networks':_0x2c2186||[]});fs[_0x719d('0x5c')](_0x719d('0x63'),_0x352176);return respondWithRpcPromise(_0x719d('0x64'),_0x719d('0x32'),{'module':_0x719d('0x5e')});}else{var _0xd6e0a9=fs[_0x719d('0x60')](path[_0x719d('0x58')](config[_0x719d('0x61')],_0x719d('0x65')),_0x719d('0x5a'));var _0x5e38de=ejs[_0x719d('0x5b')](_0xd6e0a9,{'networks':_0x2c2186||[]});fs[_0x719d('0x5c')](util['format'](_0x719d('0x67'),_0xcde7ee[_0x719d('0x55')][_0x719d('0x56')][_0x719d('0x68')]()),_0x5e38de);return respondWithRpcPromise(_0x719d('0x64'),'destroy',{'module':_0x719d('0x6a')});}return null;})[_0x719d('0x26')](handleError(_0x592a36,null));}; \ No newline at end of file +var _0x460b=['update','sendStatus','name','send','map','Network','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','params','rawAttributes','includeAll','find','create','sequelize','transaction','body','toUpperCase','STUN','join','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','readFileSync','root','server/files/templates/turn_multiple.ejs','Reload','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','catch','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','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/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','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','status','end','json','count','offset','limit','set','reject','save'];(function(_0x1f93b5,_0x3dea36){var _0x53ec4e=function(_0x3b82be){while(--_0x3b82be){_0x1f93b5['push'](_0x1f93b5['shift']());}};_0x53ec4e(++_0x3dea36);}(_0x460b,0x112));var _0xb460=function(_0x34ca5a,_0x2f14b1){_0x34ca5a=_0x34ca5a-0x0;var _0x38c2be=_0x460b[_0x34ca5a];return _0x38c2be;};'use strict';var pdf=require(_0xb460('0x0'));var emlformat=require(_0xb460('0x1'));var rimraf=require(_0xb460('0x2'));var zipdir=require(_0xb460('0x3'));var jsonpatch=require(_0xb460('0x4'));var rp=require(_0xb460('0x5'));var moment=require(_0xb460('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xb460('0x7'));var util=require('util');var path=require('path');var sox=require(_0xb460('0x8'));var csv=require(_0xb460('0x9'));var ejs=require(_0xb460('0xa'));var fs=require('fs');var _=require(_0xb460('0xb'));var squel=require(_0xb460('0xc'));var crypto=require(_0xb460('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb460('0xe'));var toCsv=require(_0xb460('0x9'));var querystring=require(_0xb460('0xf'));var Papa=require('papaparse');var Redis=require(_0xb460('0x10'));var authService=require(_0xb460('0x11'));var qs=require(_0xb460('0x12'));var as=require(_0xb460('0x13'));var hardwareService=require(_0xb460('0x14'));var logger=require(_0xb460('0x15'))(_0xb460('0x16'));var utils=require('../../config/utils');var config=require(_0xb460('0x17'));var db=require(_0xb460('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xb460('0x19')][_0xb460('0x1a')]({'port':0x232a});function checkPasswordPattern(_0xb2e3ef,_0x1a8c66,_0x576abc){if(_0x576abc){var _0x3bcbd3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3bcbd3[_0xb460('0x1b')](_0x1a8c66)){return _0xb2e3ef;}else{throw new db[(_0xb460('0x1c'))][(_0xb460('0x1d'))](_0xb460('0x1e'));}}else{return _0xb2e3ef;}}function respondWithRpcPromise(_0x1c00ac,_0x1d9887,_0x5011ed,_0x53bc9c){return new BPromise(function(_0x182b87,_0x52149f){var _0x470fee=_0x53bc9c||client;return _0x470fee['request'](_0x1c00ac,_0x5011ed)[_0xb460('0x1f')](function(_0x8db667){logger['info'](_0xb460('0x20'),_0x1d9887,_0xb460('0x21'));logger[_0xb460('0x22')](_0xb460('0x23'),_0x1d9887,_0xb460('0x21'),JSON[_0xb460('0x24')](_0x8db667));if(_0x8db667[_0xb460('0x25')]){if(_0x8db667[_0xb460('0x25')]['code']===0x1f4){logger[_0xb460('0x25')](_0xb460('0x20'),_0x1d9887,_0x8db667[_0xb460('0x25')][_0xb460('0x26')]);return _0x52149f(_0x8db667[_0xb460('0x25')]['message']);}logger[_0xb460('0x25')]('Network,\x20%s,\x20%s',_0x1d9887,_0x8db667[_0xb460('0x25')][_0xb460('0x26')]);return _0x182b87(_0x8db667['error'][_0xb460('0x26')]);}else{logger[_0xb460('0x27')](_0xb460('0x20'),_0x1d9887,_0xb460('0x21'));_0x182b87(_0x8db667[_0xb460('0x28')][_0xb460('0x26')]);}})['catch'](function(_0x5dc69b){logger[_0xb460('0x25')](_0xb460('0x20'),_0x1d9887,_0x5dc69b);_0x52149f(_0x5dc69b);});});}function respondWithStatusCode(_0x208a56,_0x6343c7){_0x6343c7=_0x6343c7||0xcc;return function(_0x2c526e){if(_0x2c526e){return _0x208a56['sendStatus'](_0x6343c7);}return _0x208a56[_0xb460('0x29')](_0x6343c7)[_0xb460('0x2a')]();};}function respondWithResult(_0xda3f12,_0x3c8f31){_0x3c8f31=_0x3c8f31||0xc8;return function(_0x41cb21){if(_0x41cb21){return _0xda3f12['status'](_0x3c8f31)[_0xb460('0x2b')](_0x41cb21);}};}function respondWithFilteredResult(_0x37bb0a,_0x58f037){return function(_0x4f890e){if(_0x4f890e){var _0x472ddc=_0x4f890e[_0xb460('0x2c')],_0x626fae=_0x58f037[_0xb460('0x2d')],_0x312395=_0x58f037[_0xb460('0x2d')]+_0x58f037[_0xb460('0x2e')],_0x11d9d6;if(_0x312395>=_0x472ddc){_0x312395=_0x472ddc;_0x11d9d6=0xc8;}else{_0x11d9d6=0xce;}_0x37bb0a[_0xb460('0x29')](_0x11d9d6);return _0x37bb0a[_0xb460('0x2f')]('Content-Range',_0x626fae+'-'+_0x312395+'/'+_0x472ddc)[_0xb460('0x2b')](_0x4f890e);}return null;};}function patchUpdates(_0x5b4d29){return function(_0x50d5b1){try{jsonpatch['apply'](_0x50d5b1,_0x5b4d29,!![]);}catch(_0x397fb3){return BPromise[_0xb460('0x30')](_0x397fb3);}return _0x50d5b1[_0xb460('0x31')]();};}function saveUpdates(_0x203a96,_0x4c1830){return function(_0x519f59){if(_0x519f59){return _0x519f59[_0xb460('0x32')](_0x203a96)['then'](function(_0x21a084){return _0x21a084;});}return null;};}function removeEntity(_0x2e59b3,_0x2191c6){return function(_0xf9d07){if(_0xf9d07){return _0xf9d07['destroy']()[_0xb460('0x1f')](function(){_0x2e59b3[_0xb460('0x29')](0xcc)[_0xb460('0x2a')]();});}};}function handleEntityNotFound(_0x3380ca,_0xcd906e){return function(_0x27e52){if(!_0x27e52){_0x3380ca[_0xb460('0x33')](0x194);}return _0x27e52;};}function handleError(_0x1391d5,_0x15a779){_0x15a779=_0x15a779||0x1f4;return function(_0x2a24cd){logger[_0xb460('0x25')](_0x2a24cd['stack']);if(_0x2a24cd[_0xb460('0x34')]){delete _0x2a24cd[_0xb460('0x34')];}_0x1391d5[_0xb460('0x29')](_0x15a779)[_0xb460('0x35')](_0x2a24cd);};}exports['index']=function(_0x12c3e2,_0x1af58f){var _0x4d15fd={},_0x37aef2={},_0x3402b9={'count':0x0,'rows':[]};var _0x256a4a=_[_0xb460('0x36')](db[_0xb460('0x37')]['rawAttributes'],function(_0x309339){return{'name':_0x309339[_0xb460('0x38')],'type':_0x309339[_0xb460('0x39')][_0xb460('0x3a')]};});_0x37aef2[_0xb460('0x3b')]=_[_0xb460('0x36')](_0x256a4a,_0xb460('0x34'));_0x37aef2[_0xb460('0x3c')]=_[_0xb460('0x3d')](_0x12c3e2[_0xb460('0x3c')]);_0x37aef2[_0xb460('0x3e')]=_[_0xb460('0x3f')](_0x37aef2['model'],_0x37aef2[_0xb460('0x3c')]);_0x4d15fd[_0xb460('0x40')]=_[_0xb460('0x3f')](_0x37aef2[_0xb460('0x3b')],qs[_0xb460('0x41')](_0x12c3e2[_0xb460('0x3c')][_0xb460('0x41')]));_0x4d15fd[_0xb460('0x40')]=_0x4d15fd[_0xb460('0x40')][_0xb460('0x42')]?_0x4d15fd[_0xb460('0x40')]:_0x37aef2[_0xb460('0x3b')];if(!_0x12c3e2[_0xb460('0x3c')]['hasOwnProperty'](_0xb460('0x43'))){_0x4d15fd[_0xb460('0x2e')]=qs['limit'](_0x12c3e2[_0xb460('0x3c')][_0xb460('0x2e')]);_0x4d15fd[_0xb460('0x2d')]=qs[_0xb460('0x2d')](_0x12c3e2[_0xb460('0x3c')]['offset']);}_0x4d15fd[_0xb460('0x44')]=qs[_0xb460('0x45')](_0x12c3e2['query'][_0xb460('0x45')]);_0x4d15fd['where']=qs[_0xb460('0x3e')](_[_0xb460('0x46')](_0x12c3e2[_0xb460('0x3c')],_0x37aef2[_0xb460('0x3e')]));if(_0x12c3e2[_0xb460('0x3c')]['filter']){_0x4d15fd[_0xb460('0x47')]=_[_0xb460('0x48')](_0x4d15fd[_0xb460('0x47')],{'$or':_[_0xb460('0x36')](_0x256a4a,function(_0x11144e){if(_0x11144e['type']!==_0xb460('0x49')){var _0x2ceafc={};_0x2ceafc[_0x11144e[_0xb460('0x34')]]={'$like':'%'+_0x12c3e2[_0xb460('0x3c')][_0xb460('0x4a')]+'%'};return _0x2ceafc;}})});}_0x4d15fd=_[_0xb460('0x48')]({},_0x4d15fd,_0x12c3e2[_0xb460('0x4b')]);var _0x211a6b={'where':_0x4d15fd[_0xb460('0x47')]};return db['Network'][_0xb460('0x2c')](_0x211a6b)['then'](function(_0x5d42a7){_0x3402b9[_0xb460('0x2c')]=_0x5d42a7;if(_0x12c3e2[_0xb460('0x3c')]['includeAll']){_0x4d15fd[_0xb460('0x4c')]=[{'all':!![]}];}return db['Network'][_0xb460('0x4d')](_0x4d15fd);})['then'](function(_0x3bef18){_0x3402b9['rows']=_0x3bef18;return _0x3402b9;})[_0xb460('0x1f')](respondWithFilteredResult(_0x1af58f,_0x4d15fd))['catch'](handleError(_0x1af58f,null));};exports['show']=function(_0x68a45,_0x153dfa){var _0xacc8={'raw':!![],'where':{'id':_0x68a45[_0xb460('0x4e')]['id']}},_0x555a3d={};_0x555a3d[_0xb460('0x3b')]=_['keys'](db[_0xb460('0x37')][_0xb460('0x4f')]);_0x555a3d[_0xb460('0x3c')]=_[_0xb460('0x3d')](_0x68a45[_0xb460('0x3c')]);_0x555a3d['filters']=_[_0xb460('0x3f')](_0x555a3d[_0xb460('0x3b')],_0x555a3d[_0xb460('0x3c')]);_0xacc8['attributes']=_[_0xb460('0x3f')](_0x555a3d[_0xb460('0x3b')],qs[_0xb460('0x41')](_0x68a45['query'][_0xb460('0x41')]));_0xacc8[_0xb460('0x40')]=_0xacc8[_0xb460('0x40')][_0xb460('0x42')]?_0xacc8[_0xb460('0x40')]:_0x555a3d[_0xb460('0x3b')];if(_0x68a45['query'][_0xb460('0x50')]){_0xacc8[_0xb460('0x4c')]=[{'all':!![]}];}_0xacc8=_[_0xb460('0x48')]({},_0xacc8,_0x68a45[_0xb460('0x4b')]);return db[_0xb460('0x37')][_0xb460('0x51')](_0xacc8)[_0xb460('0x1f')](handleEntityNotFound(_0x153dfa,null))['then'](respondWithResult(_0x153dfa,null))['catch'](handleError(_0x153dfa,null));};exports[_0xb460('0x52')]=function(_0x3aee6d,_0x408486,_0x422731){var _0xd7023c;return db[_0xb460('0x53')][_0xb460('0x54')](function(_0x5d7f01){return db[_0xb460('0x37')][_0xb460('0x52')](_0x3aee6d[_0xb460('0x55')],{'raw':!![]})[_0xb460('0x1f')](function(_0x384d43){_0xd7023c=_0x384d43;return db['Network'][_0xb460('0x4d')]({'where':{'type':_0x3aee6d[_0xb460('0x55')][_0xb460('0x39')]},'raw':!![]});})[_0xb460('0x1f')](function(_0x4d3e57){if(_0xd7023c[_0xb460('0x39')][_0xb460('0x56')]()==_0xb460('0x57')){var _0x38951f=fs['readFileSync'](path[_0xb460('0x58')](config['root'],_0xb460('0x59')),_0xb460('0x5a'));var _0x5bd45e=ejs[_0xb460('0x5b')](_0x38951f,{'networks':_0x4d3e57||[]});fs[_0xb460('0x5c')](_0xb460('0x5d'),_0x5bd45e);return respondWithRpcPromise('Reload','create',{'module':_0xb460('0x5e')});}else if(_0xd7023c[_0xb460('0x39')][_0xb460('0x56')]()==_0xb460('0x5f')){var _0xdb830c=fs[_0xb460('0x60')](path['join'](config[_0xb460('0x61')],_0xb460('0x62')),_0xb460('0x5a'));var _0x5da07d=ejs[_0xb460('0x5b')](_0xdb830c,{'networks':_0x4d3e57||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x5da07d);return respondWithRpcPromise(_0xb460('0x63'),_0xb460('0x52'),{'module':_0xb460('0x5e')});}else{var _0x3d784d=fs['readFileSync'](path[_0xb460('0x58')](config[_0xb460('0x61')],'server/files/templates/network.ejs'),_0xb460('0x5a'));var _0x249040=ejs['render'](_0x3d784d,{'networks':_0x4d3e57||[]});fs['writeFileSync'](util[_0xb460('0x64')](_0xb460('0x65'),_0x3aee6d['body']['type'][_0xb460('0x66')]()),_0x249040);return respondWithRpcPromise(_0xb460('0x63'),'create',{'module':_0xb460('0x67')});}return null;})[_0xb460('0x1f')](function(){return _0xd7023c;});})['then'](respondWithResult(_0x408486,0xc9))[_0xb460('0x68')](handleError(_0x408486,null));};exports['update']=function(_0x52df6b,_0x1bf6a4,_0x40396b){var _0x3b4103;return db['sequelize'][_0xb460('0x54')](function(_0x12699e){return db['Network'][_0xb460('0x51')]({'where':{'id':_0x52df6b[_0xb460('0x4e')]['id']}})[_0xb460('0x1f')](handleEntityNotFound(_0x1bf6a4,null))[_0xb460('0x1f')](saveUpdates(_0x52df6b[_0xb460('0x55')],null))[_0xb460('0x1f')](function(_0x25114d){if(_0x25114d){_0x3b4103=_0x25114d;return db['Network'][_0xb460('0x4d')]({'where':{'type':_0x3b4103[_0xb460('0x39')]},'raw':!![]});}return null;})['then'](function(_0x3f055b){if(_0x3b4103[_0xb460('0x39')][_0xb460('0x56')]()==_0xb460('0x57')){var _0x454745=fs['readFileSync'](path[_0xb460('0x58')](config[_0xb460('0x61')],_0xb460('0x59')),_0xb460('0x5a'));var _0x18926a=ejs[_0xb460('0x5b')](_0x454745,{'networks':_0x3f055b||[]});fs[_0xb460('0x5c')](_0xb460('0x5d'),_0x18926a);return respondWithRpcPromise(_0xb460('0x63'),_0xb460('0x32'),{'module':_0xb460('0x5e')});}else if(_0x3b4103[_0xb460('0x39')][_0xb460('0x56')]()==_0xb460('0x5f')){var _0xdc334d=fs['readFileSync'](path[_0xb460('0x58')](config[_0xb460('0x61')],'server/files/templates/turn_multiple.ejs'),_0xb460('0x5a'));var _0x47a40e=ejs['render'](_0xdc334d,{'networks':_0x3f055b||[]});fs[_0xb460('0x5c')](_0xb460('0x69'),_0x47a40e);return respondWithRpcPromise(_0xb460('0x63'),_0xb460('0x32'),{'module':_0xb460('0x5e')});}else{var _0x482c35=fs[_0xb460('0x60')](path['join'](config['root'],_0xb460('0x6a')),_0xb460('0x5a'));var _0x273a47=ejs[_0xb460('0x5b')](_0x482c35,{'networks':_0x3f055b||[]});fs[_0xb460('0x5c')](util[_0xb460('0x64')]('/etc/asterisk/sip_xcally_%s.conf',_0x52df6b[_0xb460('0x55')][_0xb460('0x39')][_0xb460('0x66')]()),_0x273a47);return respondWithRpcPromise(_0xb460('0x63'),_0xb460('0x32'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x425bbf){if(_0x425bbf){return _0x3b4103;}return null;});})[_0xb460('0x1f')](respondWithResult(_0x1bf6a4,null))[_0xb460('0x68')](handleError(_0x1bf6a4,null));};exports['destroy']=function(_0x242477,_0x1b772c,_0x882d19){var _0x2eab81;return db[_0xb460('0x37')][_0xb460('0x51')]({'where':{'id':_0x242477[_0xb460('0x4e')]['id']}})[_0xb460('0x1f')](function(_0x19a8e8){_0x2eab81=_0x19a8e8;return _0x19a8e8;})['then'](handleEntityNotFound(_0x1b772c,null))[_0xb460('0x1f')](removeEntity(_0x1b772c,null))[_0xb460('0x1f')](function(){if(_0x2eab81){return db['Network'][_0xb460('0x4d')]({'where':{'type':_0x2eab81[_0xb460('0x39')]},'raw':!![]});}})[_0xb460('0x1f')](function(_0x5ea304){if(_0x2eab81[_0xb460('0x39')]['toUpperCase']()==_0xb460('0x57')){var _0x2a893f=fs[_0xb460('0x60')](path[_0xb460('0x58')](config[_0xb460('0x61')],_0xb460('0x59')),_0xb460('0x5a'));var _0x3affb0=ejs['render'](_0x2a893f,{'networks':_0x5ea304||[]});fs[_0xb460('0x5c')]('/etc/asterisk/stun_xcally.conf',_0x3affb0);return respondWithRpcPromise(_0xb460('0x63'),_0xb460('0x6b'),{'module':_0xb460('0x5e')});}else if(_0x2eab81['type'][_0xb460('0x56')]()==_0xb460('0x5f')){var _0x3b5cbb=fs[_0xb460('0x60')](path[_0xb460('0x58')](config['root'],_0xb460('0x62')),_0xb460('0x5a'));var _0x3efb83=ejs[_0xb460('0x5b')](_0x3b5cbb,{'networks':_0x5ea304||[]});fs['writeFileSync'](_0xb460('0x69'),_0x3efb83);return respondWithRpcPromise('Reload','destroy',{'module':_0xb460('0x5e')});}else{var _0x5a942e=fs['readFileSync'](path['join'](config[_0xb460('0x61')],_0xb460('0x6a')),'utf8');var _0x299a28=ejs[_0xb460('0x5b')](_0x5a942e,{'networks':_0x5ea304||[]});fs[_0xb460('0x5c')](util[_0xb460('0x64')](_0xb460('0x65'),_0x242477[_0xb460('0x55')]['type'][_0xb460('0x66')]()),_0x299a28);return respondWithRpcPromise('Reload',_0xb460('0x6b'),{'module':_0xb460('0x67')});}return null;})[_0xb460('0x68')](handleError(_0x1b772c,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 5b1fa29..70d6c7e 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 _0xf052=['Network','network','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define'];(function(_0x5460aa,_0x48b3c3){var _0x66394d=function(_0x133e60){while(--_0x133e60){_0x5460aa['push'](_0x5460aa['shift']());}};_0x66394d(++_0x48b3c3);}(_0xf052,0xf0));var _0x2f05=function(_0x45ce08,_0x59dcc7){_0x45ce08=_0x45ce08-0x0;var _0x23dff2=_0xf052[_0x45ce08];return _0x23dff2;};'use strict';var _=require(_0x2f05('0x0'));var util=require(_0x2f05('0x1'));var logger=require(_0x2f05('0x2'))(_0x2f05('0x3'));var moment=require(_0x2f05('0x4'));var BPromise=require('bluebird');var rp=require(_0x2f05('0x5'));var fs=require('fs');var path=require(_0x2f05('0x6'));var rimraf=require(_0x2f05('0x7'));var config=require(_0x2f05('0x8'));var attributes=require(_0x2f05('0x9'));module[_0x2f05('0xa')]=function(_0x206a23,_0x4fe2bb){return _0x206a23[_0x2f05('0xb')](_0x2f05('0xc'),attributes,{'tableName':_0x2f05('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x832e=['request-promise','path','rimraf','../../config/environment','./network.attributes','define','Network','lodash','../../config/logger','api','moment','bluebird'];(function(_0xbabd7a,_0x516e77){var _0x3836b8=function(_0xbd11ea){while(--_0xbd11ea){_0xbabd7a['push'](_0xbabd7a['shift']());}};_0x3836b8(++_0x516e77);}(_0x832e,0x16f));var _0xe832=function(_0x1e3207,_0x559a4b){_0x1e3207=_0x1e3207-0x0;var _0x5319b8=_0x832e[_0x1e3207];return _0x5319b8;};'use strict';var _=require(_0xe832('0x0'));var util=require('util');var logger=require(_0xe832('0x1'))(_0xe832('0x2'));var moment=require(_0xe832('0x3'));var BPromise=require(_0xe832('0x4'));var rp=require(_0xe832('0x5'));var fs=require('fs');var path=require(_0xe832('0x6'));var rimraf=require(_0xe832('0x7'));var config=require(_0xe832('0x8'));var attributes=require(_0xe832('0x9'));module['exports']=function(_0x541072,_0x4cbefc){return _0x541072[_0xe832('0xa')](_0xe832('0xb'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 7bac594..98135f8 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 _0x143a=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x143a,0x1c9));var _0xa143=function(_0xe47de1,_0x5401c3){_0xe47de1=_0xe47de1-0x0;var _0x5ac686=_0x143a[_0xe47de1];return _0x5ac686;};'use strict';var _=require('lodash');var util=require(_0xa143('0x0'));var moment=require(_0xa143('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(_0xa143('0x2'));var logger=require(_0xa143('0x3'))(_0xa143('0x4'));var config=require(_0xa143('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xa143('0x6')][_0xa143('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x25f29e,_0x319668,_0x37e16b){return new BPromise(function(_0x4ae53d,_0x47438d){return client['request'](_0x25f29e,_0x37e16b)[_0xa143('0x8')](function(_0x1321f8){logger[_0xa143('0x9')](_0xa143('0xa'),_0x319668,_0xa143('0xb'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x319668,_0xa143('0xb'),JSON[_0xa143('0xc')](_0x1321f8));if(_0x1321f8[_0xa143('0xd')]){if(_0x1321f8[_0xa143('0xd')][_0xa143('0xe')]===0x1f4){logger[_0xa143('0xd')](_0xa143('0xa'),_0x319668,_0x1321f8[_0xa143('0xd')]['message']);return _0x47438d(_0x1321f8[_0xa143('0xd')]['message']);}logger[_0xa143('0xd')](_0xa143('0xa'),_0x319668,_0x1321f8['error'][_0xa143('0xf')]);return _0x4ae53d(_0x1321f8[_0xa143('0xd')][_0xa143('0xf')]);}else{logger[_0xa143('0x9')](_0xa143('0xa'),_0x319668,_0xa143('0xb'));_0x4ae53d(_0x1321f8[_0xa143('0x10')]['message']);}})['catch'](function(_0x5b3081){logger[_0xa143('0xd')]('Network,\x20%s,\x20%s',_0x319668,_0x5b3081);_0x47438d(_0x5b3081);});});} \ No newline at end of file +var _0xdc11=['catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x4bcff6,_0x2e9c1b){var _0x2739bd=function(_0x322a6c){while(--_0x322a6c){_0x4bcff6['push'](_0x4bcff6['shift']());}};_0x2739bd(++_0x2e9c1b);}(_0xdc11,0xb1));var _0x1dc1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc11[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1dc1('0x0'));var util=require('util');var moment=require(_0x1dc1('0x1'));var BPromise=require('bluebird');var rs=require(_0x1dc1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1dc1('0x3'))['db'];var utils=require(_0x1dc1('0x4'));var logger=require(_0x1dc1('0x5'))(_0x1dc1('0x6'));var config=require(_0x1dc1('0x7'));var jayson=require(_0x1dc1('0x8'));var client=jayson[_0x1dc1('0x9')][_0x1dc1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b8f6e,_0x20761b,_0x4099c1){return new BPromise(function(_0x4ed880,_0xc29399){return client[_0x1dc1('0xb')](_0x2b8f6e,_0x4099c1)['then'](function(_0x4f235b){logger['info'](_0x1dc1('0xc'),_0x20761b,_0x1dc1('0xd'));logger[_0x1dc1('0xe')](_0x1dc1('0xf'),_0x20761b,'request\x20sent',JSON[_0x1dc1('0x10')](_0x4f235b));if(_0x4f235b['error']){if(_0x4f235b[_0x1dc1('0x11')][_0x1dc1('0x12')]===0x1f4){logger['error'](_0x1dc1('0xc'),_0x20761b,_0x4f235b[_0x1dc1('0x11')][_0x1dc1('0x13')]);return _0xc29399(_0x4f235b[_0x1dc1('0x11')][_0x1dc1('0x13')]);}logger[_0x1dc1('0x11')](_0x1dc1('0xc'),_0x20761b,_0x4f235b[_0x1dc1('0x11')][_0x1dc1('0x13')]);return _0x4ed880(_0x4f235b[_0x1dc1('0x11')][_0x1dc1('0x13')]);}else{logger[_0x1dc1('0x14')](_0x1dc1('0xc'),_0x20761b,_0x1dc1('0xd'));_0x4ed880(_0x4f235b['result'][_0x1dc1('0x13')]);}})[_0x1dc1('0x15')](function(_0x588eb4){logger[_0x1dc1('0x11')](_0x1dc1('0xc'),_0x20761b,_0x588eb4);_0xc29399(_0x588eb4);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index d6caf6a..2d75478 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 _0xd2a6=['./openchannelAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','create','post','addDisposition','/:id/notify','addApplications','addAgents','/:id/send','send','put','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','exports','util','path','express','Router','../../components/interaction/service'];(function(_0x131c9b,_0x154062){var _0x367605=function(_0x2b0285){while(--_0x2b0285){_0x131c9b['push'](_0x131c9b['shift']());}};_0x367605(++_0x154062);}(_0xd2a6,0xfe));var _0x6d2a=function(_0x36b400,_0x277ec5){_0x36b400=_0x36b400-0x0;var _0x4d47bf=_0xd2a6[_0x36b400];return _0x4d47bf;};'use strict';var multer=require('multer');var util=require(_0x6d2a('0x0'));var path=require(_0x6d2a('0x1'));var timeout=require('connect-timeout');var express=require(_0x6d2a('0x2'));var router=express[_0x6d2a('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x6d2a('0x4'));var config=require('../../config/environment');var controller=require(_0x6d2a('0x5'));router['get']('/',auth[_0x6d2a('0x6')](),controller[_0x6d2a('0x7')]);router[_0x6d2a('0x8')](_0x6d2a('0x9'),auth['isAuthenticated'](),controller[_0x6d2a('0xa')]);router[_0x6d2a('0x8')](_0x6d2a('0xb'),auth[_0x6d2a('0x6')](),controller['show']);router[_0x6d2a('0x8')](_0x6d2a('0xc'),auth['isAuthenticated'](),controller[_0x6d2a('0xd')]);router[_0x6d2a('0x8')]('/:id/canned_answers',auth[_0x6d2a('0x6')](),controller[_0x6d2a('0xe')]);router[_0x6d2a('0x8')](_0x6d2a('0xf'),auth[_0x6d2a('0x6')](),controller[_0x6d2a('0x10')]);router[_0x6d2a('0x8')](_0x6d2a('0x11'),auth['isAuthenticated'](),controller[_0x6d2a('0x12')]);router['get'](_0x6d2a('0x13'),auth[_0x6d2a('0x6')](),controller['getAgents']);router['post']('/',auth[_0x6d2a('0x6')](),controller[_0x6d2a('0x14')]);router[_0x6d2a('0x15')](_0x6d2a('0xc'),auth[_0x6d2a('0x6')](),controller[_0x6d2a('0x16')]);router[_0x6d2a('0x15')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);router[_0x6d2a('0x15')](_0x6d2a('0x17'),controller['notify']);router[_0x6d2a('0x15')](_0x6d2a('0xf'),auth['isAuthenticated'](),controller[_0x6d2a('0x18')]);router[_0x6d2a('0x15')]('/:id/users',auth['isAuthenticated'](),controller[_0x6d2a('0x19')]);router['post'](_0x6d2a('0x1a'),auth[_0x6d2a('0x6')](),controller[_0x6d2a('0x1b')]);router[_0x6d2a('0x1c')](_0x6d2a('0xb'),auth[_0x6d2a('0x6')](),controller[_0x6d2a('0x1d')]);router[_0x6d2a('0x1e')](_0x6d2a('0xb'),auth[_0x6d2a('0x6')](),controller[_0x6d2a('0x1f')]);router[_0x6d2a('0x1e')](_0x6d2a('0xc'),auth[_0x6d2a('0x6')](),controller[_0x6d2a('0x20')]);router[_0x6d2a('0x1e')](_0x6d2a('0x21'),auth[_0x6d2a('0x6')](),controller[_0x6d2a('0x22')]);router[_0x6d2a('0x1e')](_0x6d2a('0x13'),auth[_0x6d2a('0x6')](),controller[_0x6d2a('0x23')]);module[_0x6d2a('0x24')]=router; \ No newline at end of file +var _0x6c8a=['../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','/describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/users','getAgents','create','addDisposition','addAnswer','notify','post','addAgents','/:id/send','send','put','delete','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3f8743,_0x33973f){var _0x1f844c=function(_0x568841){while(--_0x568841){_0x3f8743['push'](_0x3f8743['shift']());}};_0x1f844c(++_0x33973f);}(_0x6c8a,0xae));var _0xa6c8=function(_0x189720,_0x2e5082){_0x189720=_0x189720-0x0;var _0x277f25=_0x6c8a[_0x189720];return _0x277f25;};'use strict';var multer=require('multer');var util=require(_0xa6c8('0x0'));var path=require(_0xa6c8('0x1'));var timeout=require(_0xa6c8('0x2'));var express=require(_0xa6c8('0x3'));var router=express[_0xa6c8('0x4')]();var auth=require(_0xa6c8('0x5'));var interaction=require(_0xa6c8('0x6'));var config=require(_0xa6c8('0x7'));var controller=require(_0xa6c8('0x8'));router[_0xa6c8('0x9')]('/',auth[_0xa6c8('0xa')](),controller['index']);router[_0xa6c8('0x9')](_0xa6c8('0xb'),auth[_0xa6c8('0xa')](),controller['describe']);router['get'](_0xa6c8('0xc'),auth[_0xa6c8('0xa')](),controller[_0xa6c8('0xd')]);router['get'](_0xa6c8('0xe'),auth['isAuthenticated'](),controller['getDispositions']);router['get'](_0xa6c8('0xf'),auth[_0xa6c8('0xa')](),controller[_0xa6c8('0x10')]);router[_0xa6c8('0x9')](_0xa6c8('0x11'),auth[_0xa6c8('0xa')](),controller[_0xa6c8('0x12')]);router[_0xa6c8('0x9')](_0xa6c8('0x13'),auth[_0xa6c8('0xa')](),controller['getInteractions']);router[_0xa6c8('0x9')](_0xa6c8('0x14'),auth['isAuthenticated'](),controller[_0xa6c8('0x15')]);router['post']('/',auth[_0xa6c8('0xa')](),controller[_0xa6c8('0x16')]);router['post'](_0xa6c8('0xe'),auth[_0xa6c8('0xa')](),controller[_0xa6c8('0x17')]);router['post'](_0xa6c8('0xf'),auth[_0xa6c8('0xa')](),controller[_0xa6c8('0x18')]);router['post']('/:id/notify',controller[_0xa6c8('0x19')]);router[_0xa6c8('0x1a')]('/:id/applications',auth[_0xa6c8('0xa')](),controller['addApplications']);router[_0xa6c8('0x1a')](_0xa6c8('0x14'),auth[_0xa6c8('0xa')](),controller[_0xa6c8('0x1b')]);router[_0xa6c8('0x1a')](_0xa6c8('0x1c'),auth['isAuthenticated'](),controller[_0xa6c8('0x1d')]);router[_0xa6c8('0x1e')](_0xa6c8('0xc'),auth[_0xa6c8('0xa')](),controller['update']);router[_0xa6c8('0x1f')](_0xa6c8('0xc'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xa6c8('0xe'),auth[_0xa6c8('0xa')](),controller[_0xa6c8('0x20')]);router[_0xa6c8('0x1f')](_0xa6c8('0xf'),auth['isAuthenticated'](),controller[_0xa6c8('0x21')]);router['delete']('/:id/users',auth[_0xa6c8('0xa')](),controller[_0xa6c8('0x22')]);module[_0xa6c8('0x23')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 65009a5..b20f451 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 _0xcac6=['generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING'];(function(_0x246525,_0x58e76d){var _0x42a780=function(_0x35e645){while(--_0x35e645){_0x246525['push'](_0x246525['shift']());}};_0x42a780(++_0x58e76d);}(_0xcac6,0x169));var _0x6cac=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcac6[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x6cac('0x0'));var rs=require('randomstring');module[_0x6cac('0x1')]={'name':{'type':Sequelize[_0x6cac('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x6cac('0x3')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x6cac('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x6cac('0x4')],'defaultValue':function(){return _0x6cac('0x5');}},'notificationSound':{'type':Sequelize[_0x6cac('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6cac('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6cac('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x6cac('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6cac('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6cac('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6cac('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x6cac('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x6cac('0x6')],'defaultValue':![],'comment':_0x6cac('0x9'),'set':function(_0x745865){if(!_0x745865)this[_0x6cac('0xa')](_0x6cac('0xb'),null);this['setDataValue'](_0x6cac('0xc'),_0x745865);}}}; \ No newline at end of file +var _0xfa8c=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x114a7b,_0x4e366f){var _0x229c92=function(_0x35032a){while(--_0x35032a){_0x114a7b['push'](_0x114a7b['shift']());}};_0x229c92(++_0x4e366f);}(_0xfa8c,0x147));var _0xcfa8=function(_0x234a35,_0x4afdb0){_0x234a35=_0x234a35-0x0;var _0x432bfc=_0xfa8c[_0x234a35];return _0x432bfc;};'use strict';var Sequelize=require(_0xcfa8('0x0'));var rs=require('randomstring');module[_0xcfa8('0x1')]={'name':{'type':Sequelize[_0xcfa8('0x2')],'unique':_0xcfa8('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xcfa8('0x2')]},'token':{'type':Sequelize[_0xcfa8('0x2')],'defaultValue':function(){return rs[_0xcfa8('0x4')]();}},'replyUri':{'type':Sequelize[_0xcfa8('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xcfa8('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xcfa8('0x5');}},'notificationSound':{'type':Sequelize[_0xcfa8('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcfa8('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcfa8('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xcfa8('0x2')]},'queueTransfer':{'type':Sequelize[_0xcfa8('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcfa8('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcfa8('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcfa8('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xcfa8('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xcfa8('0x6')],'defaultValue':![],'comment':_0xcfa8('0x9'),'set':function(_0x480af4){if(!_0x480af4)this[_0xcfa8('0xa')](_0xcfa8('0xb'),null);this[_0xcfa8('0xa')](_0xcfa8('0xc'),_0x480af4);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 4383cab..c573d5d 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 _0x1774=['socket.io-emitter','register','client','http','test','Sequelize','ValidationError','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','count','offset','Content-Range','json','save','update','get','UserProfileResource','destroy','name','send','index','Pause','map','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelAccount','includeAll','include','rows','params','fields','find','create','body','user','OpenchannelAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','Disposition','getDispositions','findOne','rawAttributes','OpenchannelAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','notify','openchannel','CmContact','describe','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','CmList','List','Contacts','Applications','applications','list','priority','asc','account','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','OpenchannelApplication','bulkCreate','findAndCountAll','getApplications','Contact','User','fullname','internal','Tags','color','tag','findAll','addAgents','userOpenchannelAccount:save','removeAgents','emit','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','Messages','dataValues','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost'];(function(_0x3eecd9,_0x12a4bb){var _0x4b010d=function(_0x1fbb70){while(--_0x1fbb70){_0x3eecd9['push'](_0x3eecd9['shift']());}};_0x4b010d(++_0x12a4bb);}(_0x1774,0x99));var _0x4177=function(_0x548cfe,_0x500e40){_0x548cfe=_0x548cfe-0x0;var _0x21c30c=_0x1774[_0x548cfe];return _0x21c30c;};'use strict';var pdf=require(_0x4177('0x0'));var emlformat=require(_0x4177('0x1'));var rimraf=require(_0x4177('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4177('0x3'));var rp=require(_0x4177('0x4'));var moment=require(_0x4177('0x5'));var BPromise=require(_0x4177('0x6'));var Mustache=require(_0x4177('0x7'));var util=require(_0x4177('0x8'));var path=require(_0x4177('0x9'));var sox=require(_0x4177('0xa'));var csv=require(_0x4177('0xb'));var ejs=require(_0x4177('0xc'));var fs=require('fs');var _=require(_0x4177('0xd'));var squel=require(_0x4177('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4177('0xf'));var toCsv=require(_0x4177('0xb'));var querystring=require(_0x4177('0x10'));var Papa=require(_0x4177('0x11'));var Redis=require(_0x4177('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4177('0x13'));var as=require(_0x4177('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4177('0x15'))(_0x4177('0x16'));var utils=require(_0x4177('0x17'));var config=require(_0x4177('0x18'));var db=require('../../mysqldb')['db'];config[_0x4177('0x19')]=_[_0x4177('0x1a')](config[_0x4177('0x19')],{'host':_0x4177('0x1b'),'port':0x18eb});var socket=require(_0x4177('0x1c'))(new Redis(config[_0x4177('0x19')]));require('./openchannelAccount.socket')[_0x4177('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4177('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x4177('0x1e')][_0x4177('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x11acf3,_0x307992,_0x40461d){if(_0x40461d){var _0x137f8b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x137f8b[_0x4177('0x20')](_0x307992)){return _0x11acf3;}else{throw new db[(_0x4177('0x21'))][(_0x4177('0x22'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x11acf3;}}function respondWithRpcPromise(_0x3a01eb,_0x5aa771,_0x1517a8,_0x2f4e08){return new BPromise(function(_0x1f1400,_0x5a3e5a){var _0x4c81bb=_0x2f4e08||client;return _0x4c81bb[_0x4177('0x23')](_0x3a01eb,_0x1517a8)[_0x4177('0x24')](function(_0x4e6309){logger[_0x4177('0x25')](_0x4177('0x26'),_0x5aa771,_0x4177('0x27'));logger[_0x4177('0x28')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5aa771,_0x4177('0x27'),JSON[_0x4177('0x29')](_0x4e6309));if(_0x4e6309[_0x4177('0x2a')]){if(_0x4e6309[_0x4177('0x2a')]['code']===0x1f4){logger[_0x4177('0x2a')]('OpenchannelAccount,\x20%s,\x20%s',_0x5aa771,_0x4e6309[_0x4177('0x2a')]['message']);return _0x5a3e5a(_0x4e6309[_0x4177('0x2a')][_0x4177('0x2b')]);}logger[_0x4177('0x2a')](_0x4177('0x26'),_0x5aa771,_0x4e6309[_0x4177('0x2a')]['message']);return _0x1f1400(_0x4e6309[_0x4177('0x2a')][_0x4177('0x2b')]);}else{logger[_0x4177('0x25')](_0x4177('0x26'),_0x5aa771,'request\x20sent');_0x1f1400(_0x4e6309[_0x4177('0x2c')][_0x4177('0x2b')]);}})[_0x4177('0x2d')](function(_0x4a6b4c){logger['error'](_0x4177('0x26'),_0x5aa771,_0x4a6b4c);_0x5a3e5a(_0x4a6b4c);});});}function respondWithStatusCode(_0x4275bd,_0x1ceed8){_0x1ceed8=_0x1ceed8||0xcc;return function(_0x1c8403){if(_0x1c8403){return _0x4275bd[_0x4177('0x2e')](_0x1ceed8);}return _0x4275bd[_0x4177('0x2f')](_0x1ceed8)[_0x4177('0x30')]();};}function respondWithResult(_0x547433,_0x41a80e){_0x41a80e=_0x41a80e||0xc8;return function(_0x5a4d87){if(_0x5a4d87){return _0x547433['status'](_0x41a80e)['json'](_0x5a4d87);}};}function respondWithFilteredResult(_0x30f3ef,_0x48f48e){return function(_0x4cf962){if(_0x4cf962){var _0x2f5841=_0x4cf962[_0x4177('0x31')],_0x51739b=_0x48f48e[_0x4177('0x32')],_0xd37ebd=_0x48f48e['offset']+_0x48f48e['limit'],_0x18de51;if(_0xd37ebd>=_0x2f5841){_0xd37ebd=_0x2f5841;_0x18de51=0xc8;}else{_0x18de51=0xce;}_0x30f3ef[_0x4177('0x2f')](_0x18de51);return _0x30f3ef['set'](_0x4177('0x33'),_0x51739b+'-'+_0xd37ebd+'/'+_0x2f5841)[_0x4177('0x34')](_0x4cf962);}return null;};}function patchUpdates(_0x2e4190){return function(_0x307460){try{jsonpatch['apply'](_0x307460,_0x2e4190,!![]);}catch(_0x4688a5){return BPromise['reject'](_0x4688a5);}return _0x307460[_0x4177('0x35')]();};}function saveUpdates(_0x24f7e4,_0x3e6187){return function(_0x441133){if(_0x441133){return _0x441133[_0x4177('0x36')](_0x24f7e4)['then'](function(_0x15995c){return _0x15995c;});}return null;};}function removeEntity(_0x2e3f4a,_0x38d66b){return function(_0x28b0fe){if(_0x28b0fe){return _0x28b0fe['destroy']()[_0x4177('0x24')](function(){var _0x7810d7=_0x28b0fe[_0x4177('0x37')]({'plain':!![]});var _0x3336ec='OpenchannelAccounts';return db[_0x4177('0x38')][_0x4177('0x39')]({'where':{'type':_0x3336ec,'resourceId':_0x7810d7['id']}})[_0x4177('0x24')](function(){return _0x28b0fe;});})['then'](function(){_0x2e3f4a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e6e33,_0x45883d){return function(_0x4b2de0){if(!_0x4b2de0){_0x4e6e33[_0x4177('0x2e')](0x194);}return _0x4b2de0;};}function handleError(_0x5c107b,_0x2688a5){_0x2688a5=_0x2688a5||0x1f4;return function(_0x543dad){logger[_0x4177('0x2a')](_0x543dad['stack']);if(_0x543dad[_0x4177('0x3a')]){delete _0x543dad[_0x4177('0x3a')];}_0x5c107b[_0x4177('0x2f')](_0x2688a5)[_0x4177('0x3b')](_0x543dad);};}exports[_0x4177('0x3c')]=function(_0x359b04,_0x1fef2c){var _0x1c2d5f={'include':[{'model':db[_0x4177('0x3d')],'as':'mandatoryDispositionPause'}]},_0x2fe62d={},_0x4bf18c={'count':0x0,'rows':[]};var _0x59a020=_[_0x4177('0x3e')](db['OpenchannelAccount']['rawAttributes'],function(_0x4162fb){return{'name':_0x4162fb['fieldName'],'type':_0x4162fb[_0x4177('0x3f')][_0x4177('0x40')]};});_0x2fe62d[_0x4177('0x41')]=_['map'](_0x59a020,_0x4177('0x3a'));_0x2fe62d[_0x4177('0x42')]=_[_0x4177('0x43')](_0x359b04['query']);_0x2fe62d[_0x4177('0x44')]=_[_0x4177('0x45')](_0x2fe62d[_0x4177('0x41')],_0x2fe62d[_0x4177('0x42')]);_0x1c2d5f['attributes']=_[_0x4177('0x45')](_0x2fe62d[_0x4177('0x41')],qs['fields'](_0x359b04['query']['fields']));_0x1c2d5f[_0x4177('0x46')]=_0x1c2d5f[_0x4177('0x46')][_0x4177('0x47')]?_0x1c2d5f[_0x4177('0x46')]:_0x2fe62d[_0x4177('0x41')];if(!_0x359b04[_0x4177('0x42')]['hasOwnProperty'](_0x4177('0x48'))){_0x1c2d5f[_0x4177('0x49')]=qs['limit'](_0x359b04['query'][_0x4177('0x49')]);_0x1c2d5f['offset']=qs['offset'](_0x359b04[_0x4177('0x42')][_0x4177('0x32')]);}_0x1c2d5f[_0x4177('0x4a')]=qs[_0x4177('0x4b')](_0x359b04[_0x4177('0x42')][_0x4177('0x4b')]);_0x1c2d5f[_0x4177('0x4c')]=qs[_0x4177('0x44')](_[_0x4177('0x4d')](_0x359b04[_0x4177('0x42')],_0x2fe62d[_0x4177('0x44')]));if(_0x359b04[_0x4177('0x42')][_0x4177('0x4e')]){_0x1c2d5f[_0x4177('0x4c')]=_[_0x4177('0x4f')](_0x1c2d5f[_0x4177('0x4c')],{'$or':_['map'](_0x59a020,function(_0x1e0ccd){if(_0x1e0ccd[_0x4177('0x3f')]!==_0x4177('0x50')){var _0x24523e={};_0x24523e[_0x1e0ccd[_0x4177('0x3a')]]={'$like':'%'+_0x359b04[_0x4177('0x42')][_0x4177('0x4e')]+'%'};return _0x24523e;}})});}_0x1c2d5f=_['merge']({},_0x1c2d5f,_0x359b04[_0x4177('0x51')]);var _0x42f7f3={'where':_0x1c2d5f[_0x4177('0x4c')]};return db[_0x4177('0x52')][_0x4177('0x31')](_0x42f7f3)[_0x4177('0x24')](function(_0x2deb39){_0x4bf18c[_0x4177('0x31')]=_0x2deb39;if(_0x359b04[_0x4177('0x42')][_0x4177('0x53')]){_0x1c2d5f[_0x4177('0x54')]=[{'all':!![]}];}return db[_0x4177('0x52')]['findAll'](_0x1c2d5f);})[_0x4177('0x24')](function(_0x1c5909){_0x4bf18c[_0x4177('0x55')]=_0x1c5909;return _0x4bf18c;})[_0x4177('0x24')](respondWithFilteredResult(_0x1fef2c,_0x1c2d5f))[_0x4177('0x2d')](handleError(_0x1fef2c,null));};exports['show']=function(_0x3e8f9d,_0x5c2ec0){var _0x591f65={'raw':![],'where':{'id':_0x3e8f9d[_0x4177('0x56')]['id']},'include':[{'model':db[_0x4177('0x3d')],'as':'mandatoryDispositionPause'}]},_0x3c0b45={};_0x3c0b45[_0x4177('0x41')]=_[_0x4177('0x43')](db[_0x4177('0x52')]['rawAttributes']);_0x3c0b45[_0x4177('0x42')]=_[_0x4177('0x43')](_0x3e8f9d[_0x4177('0x42')]);_0x3c0b45[_0x4177('0x44')]=_[_0x4177('0x45')](_0x3c0b45['model'],_0x3c0b45[_0x4177('0x42')]);_0x591f65['attributes']=_[_0x4177('0x45')](_0x3c0b45[_0x4177('0x41')],qs['fields'](_0x3e8f9d['query'][_0x4177('0x57')]));_0x591f65['attributes']=_0x591f65['attributes'][_0x4177('0x47')]?_0x591f65[_0x4177('0x46')]:_0x3c0b45['model'];if(_0x3e8f9d['query'][_0x4177('0x53')]){_0x591f65[_0x4177('0x54')]=[{'all':!![]}];}_0x591f65=_[_0x4177('0x4f')]({},_0x591f65,_0x3e8f9d[_0x4177('0x51')]);return db[_0x4177('0x52')][_0x4177('0x58')](_0x591f65)[_0x4177('0x24')](handleEntityNotFound(_0x5c2ec0,null))[_0x4177('0x24')](respondWithResult(_0x5c2ec0,null))[_0x4177('0x2d')](handleError(_0x5c2ec0,null));};exports[_0x4177('0x59')]=function(_0x5a5302,_0x1bfa04){return db['OpenchannelAccount'][_0x4177('0x59')](_0x5a5302[_0x4177('0x5a')],{})[_0x4177('0x24')](function(_0x19a250){var _0x6c435b=_0x5a5302[_0x4177('0x5b')][_0x4177('0x37')]({'plain':!![]});if(!_0x6c435b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6c435b['role']==='user'){var _0x44c824=_0x19a250[_0x4177('0x37')]({'plain':!![]});var _0x49e751=_0x4177('0x5c');return db[_0x4177('0x5d')][_0x4177('0x58')]({'where':{'name':_0x49e751,'userProfileId':_0x6c435b['userProfileId']},'raw':!![]})[_0x4177('0x24')](function(_0x1de457){if(_0x1de457&&_0x1de457[_0x4177('0x5e')]===0x0){return db['UserProfileResource'][_0x4177('0x59')]({'name':_0x44c824[_0x4177('0x3a')],'resourceId':_0x44c824['id'],'type':_0x1de457[_0x4177('0x3a')],'sectionId':_0x1de457['id']},{})['then'](function(){return _0x19a250;});}else{return _0x19a250;}})[_0x4177('0x2d')](function(_0x2208dd){logger[_0x4177('0x2a')](_0x4177('0x5f'),_0x2208dd);throw _0x2208dd;});}return _0x19a250;})['then'](respondWithResult(_0x1bfa04,0xc9))['catch'](handleError(_0x1bfa04,null));};exports[_0x4177('0x36')]=function(_0x1052a5,_0x51edd7){if(_0x1052a5[_0x4177('0x5a')]['id']){delete _0x1052a5[_0x4177('0x5a')]['id'];}return db[_0x4177('0x52')][_0x4177('0x58')]({'where':{'id':_0x1052a5[_0x4177('0x56')]['id']},'include':[{'model':db[_0x4177('0x3d')],'as':_0x4177('0x60')}]})[_0x4177('0x24')](handleEntityNotFound(_0x51edd7,null))['then'](saveUpdates(_0x1052a5[_0x4177('0x5a')],null))[_0x4177('0x24')](respondWithResult(_0x51edd7,null))[_0x4177('0x2d')](handleError(_0x51edd7,null));};exports['destroy']=function(_0x1e4137,_0x39c726){return db[_0x4177('0x52')][_0x4177('0x58')]({'where':{'id':_0x1e4137[_0x4177('0x56')]['id']}})[_0x4177('0x24')](handleEntityNotFound(_0x39c726,null))['then'](removeEntity(_0x39c726,null))[_0x4177('0x2d')](handleError(_0x39c726,null));};exports['describe']=function(_0x3f5098,_0x334795){return db['OpenchannelAccount']['describe']()[_0x4177('0x24')](respondWithResult(_0x334795,null))[_0x4177('0x2d')](handleError(_0x334795,null));};exports['addDisposition']=function(_0x3b55dc,_0xf6ebbf,_0x41f47f){if(_0x3b55dc['body']['id']){delete _0x3b55dc[_0x4177('0x5a')]['id'];}return db[_0x4177('0x52')][_0x4177('0x58')]({'where':{'id':_0x3b55dc['params']['id']}})['then'](handleEntityNotFound(_0xf6ebbf,null))[_0x4177('0x24')](function(_0x12f2db){if(_0x12f2db){_0x3b55dc[_0x4177('0x5a')]['OpnechannelAccountId']=_0x12f2db['id'];return db[_0x4177('0x61')]['create'](_0x3b55dc['body']);}})[_0x4177('0x24')](respondWithResult(_0xf6ebbf,null))[_0x4177('0x2d')](handleError(_0xf6ebbf,null));};exports[_0x4177('0x62')]=function(_0x2f1c59,_0x27415e,_0x421944){var _0x235dba={'raw':![],'where':{}};var _0x4cac0d={};var _0x490c2d={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x4177('0x63')]({'where':{'id':_0x2f1c59[_0x4177('0x56')]['id']}})[_0x4177('0x24')](handleEntityNotFound(_0x27415e,null))['then'](function(_0x1eaa04){if(_0x1eaa04){_0x4cac0d[_0x4177('0x41')]=_['keys'](db[_0x4177('0x61')][_0x4177('0x64')]);_0x4cac0d[_0x4177('0x42')]=_[_0x4177('0x43')](_0x2f1c59[_0x4177('0x42')]);_0x4cac0d[_0x4177('0x44')]=_['intersection'](_0x4cac0d[_0x4177('0x41')],_0x4cac0d['query']);_0x235dba[_0x4177('0x46')]=_[_0x4177('0x45')](_0x4cac0d[_0x4177('0x41')],qs[_0x4177('0x57')](_0x2f1c59[_0x4177('0x42')][_0x4177('0x57')]));_0x235dba[_0x4177('0x46')]=_0x235dba[_0x4177('0x46')][_0x4177('0x47')]?_0x235dba[_0x4177('0x46')]:_0x4cac0d[_0x4177('0x41')];if(!_0x2f1c59[_0x4177('0x42')]['hasOwnProperty'](_0x4177('0x48'))){_0x235dba[_0x4177('0x49')]=qs[_0x4177('0x49')](_0x2f1c59[_0x4177('0x42')][_0x4177('0x49')]);_0x235dba[_0x4177('0x32')]=qs[_0x4177('0x32')](_0x2f1c59[_0x4177('0x42')][_0x4177('0x32')]);}_0x235dba[_0x4177('0x4a')]=qs[_0x4177('0x4b')](_0x2f1c59[_0x4177('0x42')][_0x4177('0x4b')]);_0x235dba[_0x4177('0x4c')]=qs[_0x4177('0x44')](_[_0x4177('0x4d')](_0x2f1c59[_0x4177('0x42')],_0x4cac0d[_0x4177('0x44')]));_0x235dba[_0x4177('0x4c')][_0x4177('0x65')]=_0x1eaa04['id'];if(_0x2f1c59[_0x4177('0x42')]['filter']){_0x235dba['where']=_[_0x4177('0x4f')](_0x235dba[_0x4177('0x4c')],{'$or':_['map'](_0x235dba[_0x4177('0x46')],function(_0x161e1c){var _0x40bee1={};_0x40bee1[_0x161e1c]={'$like':'%'+_0x2f1c59[_0x4177('0x42')][_0x4177('0x4e')]+'%'};return _0x40bee1;})});}_0x235dba=_[_0x4177('0x4f')]({},_0x235dba,_0x2f1c59[_0x4177('0x51')]);return db['Disposition'][_0x4177('0x31')]({'where':_0x235dba[_0x4177('0x4c')]})['then'](function(_0x54ed66){_0x490c2d[_0x4177('0x31')]=_0x54ed66;if(_0x2f1c59[_0x4177('0x42')][_0x4177('0x53')]){_0x235dba[_0x4177('0x54')]=[{'all':!![]}];}return db[_0x4177('0x61')]['findAll'](_0x235dba);})[_0x4177('0x24')](function(_0x3f304c){_0x490c2d[_0x4177('0x55')]=_0x3f304c;return _0x490c2d;});}})[_0x4177('0x24')](respondWithFilteredResult(_0x27415e,_0x235dba))[_0x4177('0x2d')](handleError(_0x27415e,null));};exports[_0x4177('0x66')]=function(_0x3e555a,_0x5753e9,_0x5a3ca7){return db[_0x4177('0x52')]['find']({'where':{'id':_0x3e555a[_0x4177('0x56')]['id']}})[_0x4177('0x24')](handleEntityNotFound(_0x5753e9,null))['then'](function(_0x42d93f){if(_0x42d93f){return _0x42d93f[_0x4177('0x66')](_0x3e555a['query'][_0x4177('0x67')]);}})[_0x4177('0x24')](respondWithStatusCode(_0x5753e9,null))['catch'](handleError(_0x5753e9,null));};exports[_0x4177('0x68')]=function(_0x18237d,_0x321f15,_0x50e653){if(_0x18237d[_0x4177('0x5a')]['id']){delete _0x18237d[_0x4177('0x5a')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x18237d[_0x4177('0x56')]['id']}})[_0x4177('0x24')](handleEntityNotFound(_0x321f15,null))['then'](function(_0x8d1070){if(_0x8d1070){_0x18237d[_0x4177('0x5a')][_0x4177('0x65')]=_0x8d1070['id'];return db[_0x4177('0x69')][_0x4177('0x59')](_0x18237d[_0x4177('0x5a')]);}})['then'](respondWithResult(_0x321f15,null))[_0x4177('0x2d')](handleError(_0x321f15,null));};exports[_0x4177('0x6a')]=function(_0x44cb14,_0x546bf1,_0x33f96f){var _0x4ca5ec={'raw':![],'where':{}};var _0x31d71b={};var _0x4c6fc3={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x4177('0x63')]({'where':{'id':_0x44cb14[_0x4177('0x56')]['id']}})[_0x4177('0x24')](handleEntityNotFound(_0x546bf1,null))[_0x4177('0x24')](function(_0x58874b){if(_0x58874b){_0x31d71b['model']=_[_0x4177('0x43')](db[_0x4177('0x69')][_0x4177('0x64')]);_0x31d71b[_0x4177('0x42')]=_[_0x4177('0x43')](_0x44cb14[_0x4177('0x42')]);_0x31d71b['filters']=_[_0x4177('0x45')](_0x31d71b[_0x4177('0x41')],_0x31d71b[_0x4177('0x42')]);_0x4ca5ec[_0x4177('0x46')]=_[_0x4177('0x45')](_0x31d71b['model'],qs['fields'](_0x44cb14['query'][_0x4177('0x57')]));_0x4ca5ec[_0x4177('0x46')]=_0x4ca5ec[_0x4177('0x46')][_0x4177('0x47')]?_0x4ca5ec['attributes']:_0x31d71b[_0x4177('0x41')];if(!_0x44cb14[_0x4177('0x42')][_0x4177('0x6b')](_0x4177('0x48'))){_0x4ca5ec[_0x4177('0x49')]=qs[_0x4177('0x49')](_0x44cb14[_0x4177('0x42')][_0x4177('0x49')]);_0x4ca5ec[_0x4177('0x32')]=qs['offset'](_0x44cb14[_0x4177('0x42')]['offset']);}_0x4ca5ec[_0x4177('0x4a')]=qs[_0x4177('0x4b')](_0x44cb14[_0x4177('0x42')][_0x4177('0x4b')]);_0x4ca5ec['where']=qs[_0x4177('0x44')](_[_0x4177('0x4d')](_0x44cb14[_0x4177('0x42')],_0x31d71b['filters']));_0x4ca5ec['where'][_0x4177('0x65')]=_0x58874b['id'];if(_0x44cb14[_0x4177('0x42')][_0x4177('0x4e')]){_0x4ca5ec['where']=_[_0x4177('0x4f')](_0x4ca5ec[_0x4177('0x4c')],{'$or':_[_0x4177('0x3e')](_0x4ca5ec[_0x4177('0x46')],function(_0x112e8a){var _0x91853c={};_0x91853c[_0x112e8a]={'$like':'%'+_0x44cb14[_0x4177('0x42')][_0x4177('0x4e')]+'%'};return _0x91853c;})});}_0x4ca5ec=_[_0x4177('0x4f')]({},_0x4ca5ec,_0x44cb14['options']);return db['CannedAnswer'][_0x4177('0x31')]({'where':_0x4ca5ec['where']})[_0x4177('0x24')](function(_0x4aed2c){_0x4c6fc3[_0x4177('0x31')]=_0x4aed2c;if(_0x44cb14[_0x4177('0x42')]['includeAll']){_0x4ca5ec['include']=[{'all':!![]}];}return db[_0x4177('0x69')]['findAll'](_0x4ca5ec);})[_0x4177('0x24')](function(_0x5b8d67){_0x4c6fc3['rows']=_0x5b8d67;return _0x4c6fc3;});}})[_0x4177('0x24')](respondWithFilteredResult(_0x546bf1,_0x4ca5ec))[_0x4177('0x2d')](handleError(_0x546bf1,null));};exports['removeAnswers']=function(_0x30a57d,_0x4af88d,_0x5dbbfd){return db['OpenchannelAccount']['find']({'where':{'id':_0x30a57d['params']['id']}})['then'](handleEntityNotFound(_0x4af88d,null))[_0x4177('0x24')](function(_0x770987){if(_0x770987){return _0x770987['removeAnswers'](_0x30a57d[_0x4177('0x42')][_0x4177('0x67')]);}})[_0x4177('0x24')](respondWithStatusCode(_0x4af88d,null))['catch'](handleError(_0x4af88d,null));};exports[_0x4177('0x6c')]=function(_0x4fc7cd,_0x3d96cf,_0x30b10e){var _0x40e009={'body':_0x4fc7cd[_0x4177('0x5a')],'channel':_0x4177('0x6d')};var _0x581e40=[];var _0x4ee077=[];var _0x1b05f4={};var _0xede209=![];return db[_0x4177('0x6e')][_0x4177('0x6f')]()[_0x4177('0x24')](function(_0x22df3d){if(!_0x22df3d){throw new db[(_0x4177('0x21'))][(_0x4177('0x22'))]('no\x20available\x20attributes');}_0x581e40=_[_0x4177('0x70')](_['keys'](_0x22df3d),[_0x4177('0x71'),_0x4177('0x72')]);_0x4ee077=_[_0x4177('0x70')](_[_0x4177('0x43')](_0x22df3d),[_0x4177('0x71'),_0x4177('0x72'),_0x4177('0x73'),_0x4177('0x74')]);if(_0x4fc7cd['body']['id']){delete _0x4fc7cd[_0x4177('0x5a')]['id'];}if(_[_0x4177('0x75')](_0x4fc7cd[_0x4177('0x5a')]['from'])){throw new db[(_0x4177('0x21'))][(_0x4177('0x22'))](_0x4177('0x76'));}if(_[_0x4177('0x75')](_0x4fc7cd[_0x4177('0x5a')][_0x4177('0x5a')])||_0x4fc7cd[_0x4177('0x5a')][_0x4177('0x5a')]===''){throw new db[(_0x4177('0x21'))][(_0x4177('0x22'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4177('0x75')](_0x4fc7cd[_0x4177('0x5a')][_0x4177('0x77')])){throw new db[(_0x4177('0x21'))][(_0x4177('0x22'))](_0x4177('0x78')+_0x4ee077);}if(!_[_0x4177('0x79')](_0x4ee077,_0x4fc7cd[_0x4177('0x5a')][_0x4177('0x77')])){throw new db[(_0x4177('0x21'))][(_0x4177('0x22'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4ee077);}_0x1b05f4[_0x4fc7cd['body'][_0x4177('0x77')]]=_0x4fc7cd['body'][_0x4177('0x7a')];})[_0x4177('0x24')](function(){return db[_0x4177('0x52')][_0x4177('0x58')]({'where':{'id':_0x4fc7cd[_0x4177('0x56')]['id']},'include':[{'model':db[_0x4177('0x7b')],'as':_0x4177('0x7c'),'include':[{'model':db[_0x4177('0x6e')],'as':_0x4177('0x7d'),'where':_0x1b05f4,'limit':0x1,'order':[[_0x4177('0x72'),'DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0x4177('0x7e')}]});})[_0x4177('0x24')](handleEntityNotFound(_0x3d96cf,null))[_0x4177('0x24')](function(_0x554855){if(_0x554855&&_0x554855['List']){_0x40e009['account']=_0x554855;_0x40e009[_0x4177('0x7f')]=_0x554855[_0x4177('0x7e')];_0x40e009[_0x4177('0x80')]=_0x554855[_0x4177('0x7c')];_0x40e009[_0x4177('0x7f')]=_['orderBy'](_0x40e009['applications'],[_0x4177('0x81')],[_0x4177('0x82')]);if(_0x40e009[_0x4177('0x83')]['Applications']){delete _0x40e009[_0x4177('0x83')][_0x4177('0x7e')];}if(_0x40e009[_0x4177('0x83')][_0x4177('0x7c')]&&_0x40e009['account'][_0x4177('0x7c')][_0x4177('0x7d')][_0x4177('0x47')]){return _0x40e009['account'][_0x4177('0x7c')][_0x4177('0x7d')][0x0];}var _0x37b0dd=_[_0x4177('0x1a')](_0x4fc7cd[_0x4177('0x5a')],{'firstName':_0x4fc7cd[_0x4177('0x5a')][_0x4177('0x7a')],'ListId':_0x554855[_0x4177('0x74')]});_0x37b0dd[_0x4fc7cd[_0x4177('0x5a')][_0x4177('0x77')]]=_0x4fc7cd[_0x4177('0x5a')][_0x4177('0x7a')];return db[_0x4177('0x6e')]['create'](_0x37b0dd,{'fields':_0x581e40,'raw':!![]});}})[_0x4177('0x24')](handleEntityNotFound(_0x3d96cf,null))['then'](function(_0x39ca43){_0x40e009[_0x4177('0x84')]=_0x39ca43;if(_0x39ca43){var _0x4c3348={'ContactId':_0x39ca43['id'],'OpenchannelAccountId':_0x4fc7cd[_0x4177('0x56')]['id'],'from':(_0x39ca43[_0x4177('0x85')]||'')+'\x20'+(_0x39ca43[_0x4177('0x86')]||'')};var _0x25e5e1={'OpenchannelAccountId':_0x4fc7cd[_0x4177('0x56')]['id'],'closed':![]};if(_0x4fc7cd[_0x4177('0x5a')][_0x4177('0x87')]){_0x25e5e1[_0x4177('0x87')]=_0x4fc7cd[_0x4177('0x5a')][_0x4177('0x87')];return db['OpenchannelInteraction'][_0x4177('0x58')]({'where':_0x25e5e1})[_0x4177('0x24')](function(_0x5a8e4e){if(_0x5a8e4e){return[_0x5a8e4e,![]];}_0x4c3348[_0x4177('0x87')]=_0x4fc7cd[_0x4177('0x5a')]['threadId'];_0x4c3348[_0x4177('0x88')]=_0x4fc7cd[_0x4177('0x5a')][_0x4177('0x88')];return db[_0x4177('0x89')]['create'](_0x4c3348)[_0x4177('0x24')](function(_0x3439fa){return[_0x3439fa,!![]];});});}else{_0x25e5e1['threadId']=null;}_0x25e5e1[_0x4177('0x8a')]=_0x39ca43['id'];return db['OpenchannelInteraction']['find']({'where':_0x25e5e1})['then'](function(_0x52ec50){if(_0x52ec50){return[_0x52ec50,![]];}return db[_0x4177('0x89')]['create'](_0x4c3348)[_0x4177('0x24')](function(_0xb4bccb){return[_0xb4bccb,!![]];});});}})[_0x4177('0x8b')](function(_0x7d7139,_0x2f5fbe){if(_0x7d7139){_0xede209=_0x2f5fbe;if(!_0x2f5fbe){var _0xf4a872={'from':(_0x40e009[_0x4177('0x84')][_0x4177('0x85')]||'')+'\x20'+(_0x40e009[_0x4177('0x84')][_0x4177('0x86')]||'')};if(_0x4fc7cd['body']['threadId']&&_0x4fc7cd[_0x4177('0x5a')][_0x4177('0x8c')]&&_0x4fc7cd[_0x4177('0x5a')]['threadId']!=_0x4fc7cd[_0x4177('0x5a')][_0x4177('0x8c')]){_0xf4a872['threadId']=_0x4fc7cd[_0x4177('0x5a')]['messageId'];}return _0x7d7139['update'](_0xf4a872);}else{return _0x7d7139;}}})[_0x4177('0x24')](function(_0x238755){_0x40e009['interaction']=_0x238755[_0x4177('0x37')]({'plain':!![]});_0x40e009[_0x4177('0x8d')][_0x4177('0x8e')]=_0xede209;if(_0x40e009['interaction'][_0x4177('0x8e')]){if(_0x40e009[_0x4177('0x83')][_0x4177('0x8f')]){_0x40e009[_0x4177('0x7f')][_0x4177('0x90')]({'id':0x0,'priority':_0x40e009[_0x4177('0x7f')][_0x4177('0x47')]+0x1,'app':_0x4177('0x91'),'appdata':_0x4177('0x92'),'interval':_0x4177('0x93')});}}return db[_0x4177('0x94')][_0x4177('0x59')]({'body':_0x4fc7cd[_0x4177('0x5a')][_0x4177('0x5a')],'OpenchannelAccountId':_0x4fc7cd[_0x4177('0x56')]['id'],'OpenchannelInteractionId':_0x238755['id'],'direction':'in','ContactId':_0x40e009['contact']['id'],'AttachmentId':_0x4fc7cd[_0x4177('0x5a')][_0x4177('0x95')]});})[_0x4177('0x24')](function(_0x137fb9){_0x40e009[_0x4177('0x2b')]=_0x137fb9;if(_0x40e009[_0x4177('0x8d')]['UserId']){return db['User'][_0x4177('0x58')]({'attributes':['id',_0x4177('0x3a')],'where':{'id':_0x40e009[_0x4177('0x8d')]['UserId']}})[_0x4177('0x24')](function(_0x14871c){if(_0x14871c){_0x40e009[_0x4177('0x7f')][_0x4177('0x96')]({'id':0x0,'priority':0x0,'app':_0x4177('0x97'),'appdata':_0x14871c[_0x4177('0x3a')]+','+(_0x40e009[_0x4177('0x83')][_0x4177('0x98')]||0xa),'interval':'*,*,*,*'});_0x40e009[_0x4177('0x99')]=![];}return respondWithRpcPromise(_0x4177('0x9a'),_0x4177('0x9b'),_0x40e009);});}return respondWithRpcPromise('Start',_0x4177('0x9b'),_0x40e009);})[_0x4177('0x24')](function(_0x3a18ee){respondWithRpcPromise(_0x4177('0x9c'),_0x4177('0x9c'),{'event':_0x4177('0x6c'),'message':_0x3a18ee},client9002);return _0x3a18ee;})[_0x4177('0x24')](respondWithResult(_0x3d96cf,null))[_0x4177('0x2d')](handleError(_0x3d96cf,null));};exports[_0x4177('0x9d')]=function(_0x4588ea,_0x5c0083,_0x3f60fb){return db[_0x4177('0x52')]['findOne']({'where':{'id':_0x4588ea['params']['id']}})[_0x4177('0x24')](handleEntityNotFound(_0x5c0083,null))[_0x4177('0x24')](function(_0x35fe15){if(_0x35fe15){return db[_0x4177('0x9e')]['transaction'](function(_0x11c5d6){return db[_0x4177('0x9f')][_0x4177('0x39')]({'where':{'OpenchannelAccountId':_0x4588ea[_0x4177('0x56')]['id']},'transaction':_0x11c5d6})[_0x4177('0x24')](function(_0x20e62c){var _0x38bddc=_[_0x4177('0x3e')](_0x4588ea['body'],function(_0x353430){_0x353430[_0x4177('0x65')]=_0x4588ea[_0x4177('0x56')]['id'];return _0x353430;});return db[_0x4177('0x9f')][_0x4177('0xa0')](_0x38bddc,{'transaction':_0x11c5d6});});})[_0x4177('0x24')](function(){return db[_0x4177('0x9f')][_0x4177('0xa1')]({'where':{'OpenchannelAccountId':_0x4588ea['params']['id']},'order':'priority'});});}})['then'](respondWithResult(_0x5c0083,null))['catch'](handleError(_0x5c0083,null));};exports[_0x4177('0xa2')]=function(_0x2606c5,_0x3e130c,_0x139f3b){var _0x2582e7={};var _0x2ad74e={};var _0x362c7f;var _0x492e68;return db['OpenchannelAccount'][_0x4177('0x63')]({'where':{'id':_0x2606c5['params']['id']}})['then'](handleEntityNotFound(_0x3e130c,null))['then'](function(_0x137eac){if(_0x137eac){_0x362c7f=_0x137eac;_0x2ad74e[_0x4177('0x41')]=_[_0x4177('0x43')](db['OpenchannelApplication'][_0x4177('0x64')]);_0x2ad74e[_0x4177('0x42')]=_[_0x4177('0x43')](_0x2606c5['query']);_0x2ad74e[_0x4177('0x44')]=_[_0x4177('0x45')](_0x2ad74e['model'],_0x2ad74e['query']);_0x2582e7[_0x4177('0x46')]=_[_0x4177('0x45')](_0x2ad74e[_0x4177('0x41')],qs['fields'](_0x2606c5[_0x4177('0x42')][_0x4177('0x57')]));_0x2582e7[_0x4177('0x46')]=_0x2582e7['attributes'][_0x4177('0x47')]?_0x2582e7[_0x4177('0x46')]:_0x2ad74e['model'];_0x2582e7[_0x4177('0x4a')]=qs['sort'](_0x2606c5[_0x4177('0x42')]['sort']);_0x2582e7[_0x4177('0x4c')]=qs[_0x4177('0x44')](_['pick'](_0x2606c5[_0x4177('0x42')],_0x2ad74e['filters']));if(_0x2606c5[_0x4177('0x42')][_0x4177('0x4e')]){_0x2582e7['where']=_[_0x4177('0x4f')](_0x2582e7[_0x4177('0x4c')],{'$or':_[_0x4177('0x3e')](_0x2582e7['attributes'],function(_0x29bf2b){var _0x387628={};_0x387628[_0x29bf2b]={'$like':'%'+_0x2606c5[_0x4177('0x42')][_0x4177('0x4e')]+'%'};return _0x387628;})});}_0x2582e7=_[_0x4177('0x4f')]({},_0x2582e7,_0x2606c5[_0x4177('0x51')]);return _0x362c7f[_0x4177('0xa2')](_0x2582e7);}})[_0x4177('0x24')](function(_0x4cf6aa){if(_0x4cf6aa){_0x492e68=_0x4cf6aa[_0x4177('0x47')];if(!_0x2606c5['query']['hasOwnProperty'](_0x4177('0x48'))){_0x2582e7[_0x4177('0x49')]=qs[_0x4177('0x49')](_0x2606c5[_0x4177('0x42')][_0x4177('0x49')]);_0x2582e7[_0x4177('0x32')]=qs[_0x4177('0x32')](_0x2606c5[_0x4177('0x42')][_0x4177('0x32')]);}return _0x362c7f[_0x4177('0xa2')](_0x2582e7);}})[_0x4177('0x24')](function(_0x40374d){if(_0x40374d){return _0x40374d?{'count':_0x492e68,'rows':_0x40374d}:null;}})['then'](respondWithResult(_0x3e130c,null))[_0x4177('0x2d')](handleError(_0x3e130c,null));};exports['getInteractions']=function(_0x4d79ee,_0x4d2ffa,_0x30f039){var _0x1cda4b={'raw':![],'where':{}};var _0x14b927={};var _0x53b11a={'count':0x0,'rows':[]};return db[_0x4177('0x52')][_0x4177('0x63')]({'where':{'id':_0x4d79ee[_0x4177('0x56')]['id']}})[_0x4177('0x24')](handleEntityNotFound(_0x4d2ffa,null))[_0x4177('0x24')](function(_0x5f0a5d){if(_0x5f0a5d){_0x14b927[_0x4177('0x41')]=_[_0x4177('0x43')](db[_0x4177('0x89')]['rawAttributes']);_0x14b927[_0x4177('0x42')]=_[_0x4177('0x43')](_0x4d79ee[_0x4177('0x42')]);_0x14b927[_0x4177('0x44')]=_['intersection'](_0x14b927['model'],_0x14b927[_0x4177('0x42')]);_0x1cda4b[_0x4177('0x46')]=_[_0x4177('0x45')](_0x14b927['model'],qs[_0x4177('0x57')](_0x4d79ee[_0x4177('0x42')]['fields']));_0x1cda4b[_0x4177('0x46')]=_0x1cda4b['attributes']['length']?_0x1cda4b[_0x4177('0x46')]:_0x14b927[_0x4177('0x41')];if(!_0x4d79ee[_0x4177('0x42')][_0x4177('0x6b')](_0x4177('0x48'))){_0x1cda4b[_0x4177('0x49')]=qs['limit'](_0x4d79ee[_0x4177('0x42')][_0x4177('0x49')]);_0x1cda4b['offset']=qs[_0x4177('0x32')](_0x4d79ee[_0x4177('0x42')][_0x4177('0x32')]);}_0x1cda4b['order']=qs[_0x4177('0x4b')](_0x4d79ee[_0x4177('0x42')][_0x4177('0x4b')]);_0x1cda4b[_0x4177('0x4c')]=qs['filters'](_[_0x4177('0x4d')](_0x4d79ee['query'],_0x14b927[_0x4177('0x44')]));_0x1cda4b['where'][_0x4177('0x65')]=_0x5f0a5d['id'];if(_0x4d79ee[_0x4177('0x42')]['filter']){_0x1cda4b[_0x4177('0x4c')]=_[_0x4177('0x4f')](_0x1cda4b[_0x4177('0x4c')],{'$or':_[_0x4177('0x3e')](_0x1cda4b[_0x4177('0x46')],function(_0x56de12){var _0x3723ba={};_0x3723ba[_0x56de12]={'$like':'%'+_0x4d79ee[_0x4177('0x42')]['filter']+'%'};return _0x3723ba;})});}_0x1cda4b=_[_0x4177('0x4f')]({},_0x1cda4b,_0x4d79ee['options']);return db['OpenchannelInteraction']['count']({'where':_0x1cda4b[_0x4177('0x4c')]})['then'](function(_0x377467){_0x53b11a[_0x4177('0x31')]=_0x377467;if(_0x4d79ee[_0x4177('0x42')][_0x4177('0x53')]){_0x1cda4b[_0x4177('0x54')]=[{'model':db[_0x4177('0x6e')],'as':_0x4177('0xa3'),'required':![]},{'model':db[_0x4177('0xa4')],'as':'Owner','attributes':[_0x4177('0x3a'),_0x4177('0xa5'),_0x4177('0xa6')],'required':![]},{'model':db['Tag'],'as':_0x4177('0xa7'),'attributes':['id',_0x4177('0x3a'),_0x4177('0xa8')],'where':_0x4d79ee[_0x4177('0x42')]['tag']?{'id':_0x4d79ee[_0x4177('0x42')][_0x4177('0xa9')]}:undefined,'required':_0x4d79ee[_0x4177('0x42')]['tag']?!![]:![]}];}return db[_0x4177('0x89')][_0x4177('0xaa')](_0x1cda4b);})[_0x4177('0x24')](function(_0x995b03){_0x53b11a[_0x4177('0x55')]=_0x995b03;return _0x53b11a;});}})[_0x4177('0x24')](respondWithFilteredResult(_0x4d2ffa,_0x1cda4b))[_0x4177('0x2d')](handleError(_0x4d2ffa,null));};exports[_0x4177('0xab')]=function(_0x3cc0a0,_0x420593,_0x1a23f8){return db['OpenchannelAccount']['find']({'where':{'id':_0x3cc0a0[_0x4177('0x56')]['id']}})[_0x4177('0x24')](handleEntityNotFound(_0x420593,null))[_0x4177('0x24')](function(_0x38cab8){if(_0x38cab8){return _0x38cab8['addAgents'](_0x3cc0a0[_0x4177('0x5a')][_0x4177('0x67')],_['omit'](_0x3cc0a0['body'],['ids','id'])||{})[_0x4177('0x8b')](function(_0x5ba51c){for(var _0x53eb93=0x0;_0x53eb93<_0x3cc0a0[_0x4177('0x5a')][_0x4177('0x67')]['length'];_0x53eb93+=0x1){socket['emit'](_0x4177('0xac'),{'UserId':_0x3cc0a0[_0x4177('0x5a')]['ids'][_0x53eb93],'OpenchannelAccountId':_0x3cc0a0['params']['id']});}return _0x5ba51c;});}})[_0x4177('0x24')](respondWithResult(_0x420593,null))['catch'](handleError(_0x420593,null));};exports[_0x4177('0xad')]=function(_0x2489ee,_0x2f8dcc,_0x28b184){return db[_0x4177('0x52')][_0x4177('0x58')]({'where':{'id':_0x2489ee[_0x4177('0x56')]['id']}})[_0x4177('0x24')](handleEntityNotFound(_0x2f8dcc,null))[_0x4177('0x24')](function(_0x21f09b){if(_0x21f09b){return _0x21f09b[_0x4177('0xad')](_0x2489ee['query'][_0x4177('0x67')])['then'](function(){if(_['isArray'](_0x2489ee[_0x4177('0x42')]['ids'])){for(var _0x32a022=0x0;_0x32a022<_0x2489ee['query'][_0x4177('0x67')][_0x4177('0x47')];_0x32a022+=0x1){socket[_0x4177('0xae')](_0x4177('0xaf'),{'UserId':Number(_0x2489ee[_0x4177('0x42')][_0x4177('0x67')][_0x32a022]),'OpenchannelAccountId':Number(_0x2489ee[_0x4177('0x56')]['id'])});}}else{socket[_0x4177('0xae')](_0x4177('0xaf'),{'UserId':Number(_0x2489ee[_0x4177('0x42')][_0x4177('0x67')]),'OpenchannelAccountId':Number(_0x2489ee[_0x4177('0x56')]['id'])});}});}})[_0x4177('0x24')](respondWithStatusCode(_0x2f8dcc,null))['catch'](handleError(_0x2f8dcc,null));};exports['getAgents']=function(_0x3aa329,_0x1559f4,_0x457740){var _0x193146={};var _0x44efb1={};var _0x16d522;var _0x243c96;return db[_0x4177('0x52')][_0x4177('0x63')]({'where':{'id':_0x3aa329[_0x4177('0x56')]['id']}})[_0x4177('0x24')](handleEntityNotFound(_0x1559f4,null))[_0x4177('0x24')](function(_0x45ce19){if(_0x45ce19){_0x16d522=_0x45ce19;_0x44efb1[_0x4177('0x41')]=_[_0x4177('0x43')](db[_0x4177('0xa4')][_0x4177('0x64')]);_0x44efb1[_0x4177('0x42')]=_[_0x4177('0x43')](_0x3aa329[_0x4177('0x42')]);_0x44efb1['filters']=_['intersection'](_0x44efb1[_0x4177('0x41')],_0x44efb1[_0x4177('0x42')]);_0x193146['attributes']=_[_0x4177('0x45')](_0x44efb1['model'],qs[_0x4177('0x57')](_0x3aa329[_0x4177('0x42')][_0x4177('0x57')]));_0x193146['attributes']=_0x193146['attributes']['length']?_0x193146[_0x4177('0x46')]:_0x44efb1[_0x4177('0x41')];_0x193146['order']=qs[_0x4177('0x4b')](_0x3aa329[_0x4177('0x42')][_0x4177('0x4b')]);_0x193146[_0x4177('0x4c')]=qs[_0x4177('0x44')](_[_0x4177('0x4d')](_0x3aa329['query'],_0x44efb1[_0x4177('0x44')]));if(_0x3aa329[_0x4177('0x42')][_0x4177('0x4e')]){_0x193146[_0x4177('0x4c')]=_[_0x4177('0x4f')](_0x193146[_0x4177('0x4c')],{'$or':_[_0x4177('0x3e')](_0x193146[_0x4177('0x46')],function(_0x2034c4){var _0x1368ed={};_0x1368ed[_0x2034c4]={'$like':'%'+_0x3aa329[_0x4177('0x42')][_0x4177('0x4e')]+'%'};return _0x1368ed;})});}_0x193146=_[_0x4177('0x4f')]({},_0x193146,_0x3aa329['options']);return _0x16d522[_0x4177('0xb0')](_0x193146);}})['then'](function(_0x3f55ae){if(_0x3f55ae){_0x243c96=_0x3f55ae[_0x4177('0x47')];if(!_0x3aa329[_0x4177('0x42')][_0x4177('0x6b')]('nolimit')){_0x193146[_0x4177('0x49')]=qs[_0x4177('0x49')](_0x3aa329[_0x4177('0x42')][_0x4177('0x49')]);_0x193146['offset']=qs[_0x4177('0x32')](_0x3aa329[_0x4177('0x42')][_0x4177('0x32')]);}return _0x16d522[_0x4177('0xb0')](_0x193146);}})['then'](function(_0x2d58d7){if(_0x2d58d7){return _0x2d58d7?{'count':_0x243c96,'rows':_0x2d58d7}:null;}})['then'](respondWithResult(_0x1559f4,null))[_0x4177('0x2d')](handleError(_0x1559f4,null));};exports[_0x4177('0x3b')]=function(_0x283ea0,_0x1fbf9f,_0x1e005a){var _0x411405,_0x4091d9,_0x453a99;if(_[_0x4177('0x75')](_0x283ea0['body']['body'])||_0x283ea0[_0x4177('0x5a')][_0x4177('0x5a')]===''){throw new db[(_0x4177('0x21'))]['ValidationError'](_0x4177('0xb1'));}if(_[_0x4177('0x75')](_0x283ea0[_0x4177('0x5a')]['to'])){}_0x411405=_0x283ea0['body']['to'];return db[_0x4177('0x52')][_0x4177('0x63')]({'where':{'id':_0x283ea0[_0x4177('0x56')]['id']}})[_0x4177('0x24')](handleEntityNotFound(_0x1fbf9f,null))[_0x4177('0x24')](function(_0x23ebab){if(_0x23ebab){return db['OpenchannelAccount'][_0x4177('0x58')]({'where':{'id':_0x23ebab['id']},'include':[{'model':db['CmList'],'as':_0x4177('0x7c'),'include':[{'model':db[_0x4177('0x6e')],'as':_0x4177('0x7d'),'where':{[_0x23ebab[_0x4177('0x77')]]:_0x411405},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x4177('0x24')](handleEntityNotFound(_0x1fbf9f,null))[_0x4177('0x24')](function(_0x16caec){if(_0x16caec&&_0x16caec[_0x4177('0x7c')]){_0x4091d9=_0x16caec['get']({'plain':!![]});if(_0x4091d9[_0x4177('0x7c')]&&_0x4091d9[_0x4177('0x7c')][_0x4177('0x7d')][_0x4177('0x47')]){return _0x4091d9[_0x4177('0x7c')][_0x4177('0x7d')][0x0];}return db[_0x4177('0x6e')][_0x4177('0x59')](_[_0x4177('0x1a')](_0x283ea0[_0x4177('0x5a')],{'firstName':_0x411405,[_0x16caec[_0x4177('0x77')]]:_0x411405,'phone':_0x411405,'ListId':_0x4091d9[_0x4177('0x74')]}));}})['then'](handleEntityNotFound(_0x1fbf9f,null))[_0x4177('0x24')](function(_0x46e937){if(_0x46e937){_0x453a99=_0x46e937;return db[_0x4177('0x89')][_0x4177('0x58')]({'where':{'ContactId':_0x453a99['id'],'closed':![],'OpenchannelAccountId':_0x4091d9['id']}})[_0x4177('0x24')](function(_0x2aa35b){if(_0x2aa35b){return[_0x2aa35b,![]];}return db[_0x4177('0x89')][_0x4177('0x59')]({'UserId':_0x283ea0[_0x4177('0x5b')]['id'],'ContactId':_0x453a99['id'],'OpenchannelAccountId':_0x4091d9['id'],'lastMsgDirection':_0x4177('0xb2'),'Messages':[_[_0x4177('0x4f')](_0x283ea0[_0x4177('0x5a')],{'read':![],'body':_0x283ea0[_0x4177('0x5a')][_0x4177('0x5a')],'OpenchannelAccountId':_0x4091d9['id'],'UserId':_0x283ea0[_0x4177('0x5b')]['id'],'ContactId':_0x453a99['id']})]},{'include':[{'model':db[_0x4177('0x94')],'as':_0x4177('0xb3')}]})[_0x4177('0x24')](function(_0x5bc4a6){return[_0x5bc4a6,!![]];});});}})['spread'](function(_0x4031f7,_0xdf7934){if(_0xdf7934){return _0x4031f7;}return db[_0x4177('0x94')][_0x4177('0x59')](_[_0x4177('0x4f')](_0x283ea0[_0x4177('0x5a')],{'read':![],'body':_0x283ea0[_0x4177('0x5a')][_0x4177('0x5a')],'OpenchannelAccountId':_0x4091d9['id'],'OpenchannelInteractionId':_0x4031f7['id'],'UserId':_0x283ea0[_0x4177('0x5b')]['id'],'ContactId':_0x453a99['id']}))[_0x4177('0x24')](function(_0x3273d8){_0x4031f7[_0x4177('0xb4')][_0x4177('0xb3')]=[];_0x4031f7[_0x4177('0xb4')][_0x4177('0xb3')][_0x4177('0x90')](_0x3273d8[_0x4177('0xb4')]);return _0x4031f7;});});}})['then'](respondWithResult(_0x1fbf9f,null))[_0x4177('0x2d')](handleError(_0x1fbf9f,null));}; \ No newline at end of file +var _0xc09e=['show','params','include','find','catch','create','body','user','role','UserProfileSection','userProfileId','update','describe','addDisposition','OpnechannelAccountId','getDispositions','Disposition','OpenchannelAccountId','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','CmContact','Contacts','DESC','OpenchannelApplication','Applications','account','applications','orderBy','priority','asc','firstName','threadId','OpenchannelInteraction','externalUrl','spread','contact','messageId','created','interaction','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','User','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','findOne','transaction','findAndCountAll','getApplications','Owner','fullname','internal','Tags','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','emit','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','defaults','out','Messages','dataValues','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./openchannelAccount.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~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','get','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','type','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','findAll','rows'];(function(_0x299784,_0xb0918f){var _0x5ab008=function(_0x49c1f5){while(--_0x49c1f5){_0x299784['push'](_0x299784['shift']());}};_0x5ab008(++_0xb0918f);}(_0xc09e,0x11b));var _0xec09=function(_0x603c99,_0x9d04f3){_0x603c99=_0x603c99-0x0;var _0x5e935a=_0xc09e[_0x603c99];return _0x5e935a;};'use strict';var pdf=require(_0xec09('0x0'));var emlformat=require(_0xec09('0x1'));var rimraf=require(_0xec09('0x2'));var zipdir=require(_0xec09('0x3'));var jsonpatch=require(_0xec09('0x4'));var rp=require(_0xec09('0x5'));var moment=require(_0xec09('0x6'));var BPromise=require(_0xec09('0x7'));var Mustache=require(_0xec09('0x8'));var util=require('util');var path=require(_0xec09('0x9'));var sox=require(_0xec09('0xa'));var csv=require(_0xec09('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xec09('0xc'));var crypto=require('crypto');var jsforce=require(_0xec09('0xd'));var deskjs=require(_0xec09('0xe'));var toCsv=require(_0xec09('0xb'));var querystring=require(_0xec09('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xec09('0x10'));var qs=require(_0xec09('0x11'));var as=require(_0xec09('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xec09('0x13'))('api');var utils=require(_0xec09('0x14'));var config=require(_0xec09('0x15'));var db=require(_0xec09('0x16'))['db'];config[_0xec09('0x17')]=_['defaults'](config[_0xec09('0x17')],{'host':_0xec09('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xec09('0x17')]));require(_0xec09('0x19'))[_0xec09('0x1a')](socket);var jayson=require(_0xec09('0x1b'));var client=jayson['client'][_0xec09('0x1c')]({'port':0x232c});var client9002=jayson[_0xec09('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x39e3ad,_0x5bc3ed,_0x2f63dc){if(_0x2f63dc){var _0x10c55c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x10c55c[_0xec09('0x1e')](_0x5bc3ed)){return _0x39e3ad;}else{throw new db[(_0xec09('0x1f'))][(_0xec09('0x20'))](_0xec09('0x21'));}}else{return _0x39e3ad;}}function respondWithRpcPromise(_0x59b5ac,_0x196a6f,_0x5c3d71,_0x51ad08){return new BPromise(function(_0x37232f,_0x245920){var _0xdaa4e8=_0x51ad08||client;return _0xdaa4e8[_0xec09('0x22')](_0x59b5ac,_0x5c3d71)[_0xec09('0x23')](function(_0x122692){logger[_0xec09('0x24')](_0xec09('0x25'),_0x196a6f,_0xec09('0x26'));logger[_0xec09('0x27')](_0xec09('0x28'),_0x196a6f,_0xec09('0x26'),JSON[_0xec09('0x29')](_0x122692));if(_0x122692[_0xec09('0x2a')]){if(_0x122692[_0xec09('0x2a')][_0xec09('0x2b')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x196a6f,_0x122692[_0xec09('0x2a')][_0xec09('0x2c')]);return _0x245920(_0x122692[_0xec09('0x2a')]['message']);}logger[_0xec09('0x2a')](_0xec09('0x25'),_0x196a6f,_0x122692['error'][_0xec09('0x2c')]);return _0x37232f(_0x122692[_0xec09('0x2a')][_0xec09('0x2c')]);}else{logger[_0xec09('0x24')](_0xec09('0x25'),_0x196a6f,_0xec09('0x26'));_0x37232f(_0x122692[_0xec09('0x2d')][_0xec09('0x2c')]);}})['catch'](function(_0x14713d){logger['error'](_0xec09('0x25'),_0x196a6f,_0x14713d);_0x245920(_0x14713d);});});}function respondWithStatusCode(_0x2bc91e,_0x20b092){_0x20b092=_0x20b092||0xcc;return function(_0x552600){if(_0x552600){return _0x2bc91e[_0xec09('0x2e')](_0x20b092);}return _0x2bc91e[_0xec09('0x2f')](_0x20b092)['end']();};}function respondWithResult(_0x103407,_0x1addeb){_0x1addeb=_0x1addeb||0xc8;return function(_0x49e54c){if(_0x49e54c){return _0x103407[_0xec09('0x2f')](_0x1addeb)[_0xec09('0x30')](_0x49e54c);}};}function respondWithFilteredResult(_0x203fe2,_0x13d833){return function(_0x33c7aa){if(_0x33c7aa){var _0x34e9a3=_0x33c7aa[_0xec09('0x31')],_0x367d77=_0x13d833[_0xec09('0x32')],_0x2a0ada=_0x13d833['offset']+_0x13d833[_0xec09('0x33')],_0x397786;if(_0x2a0ada>=_0x34e9a3){_0x2a0ada=_0x34e9a3;_0x397786=0xc8;}else{_0x397786=0xce;}_0x203fe2[_0xec09('0x2f')](_0x397786);return _0x203fe2['set'](_0xec09('0x34'),_0x367d77+'-'+_0x2a0ada+'/'+_0x34e9a3)[_0xec09('0x30')](_0x33c7aa);}return null;};}function patchUpdates(_0x5c41ce){return function(_0x57b0ee){try{jsonpatch[_0xec09('0x35')](_0x57b0ee,_0x5c41ce,!![]);}catch(_0x291cb7){return BPromise[_0xec09('0x36')](_0x291cb7);}return _0x57b0ee[_0xec09('0x37')]();};}function saveUpdates(_0xf5ce3d,_0x38d01c){return function(_0x5a8349){if(_0x5a8349){return _0x5a8349['update'](_0xf5ce3d)['then'](function(_0x7d0e9d){return _0x7d0e9d;});}return null;};}function removeEntity(_0x502b72,_0x5c70fc){return function(_0x3e501e){if(_0x3e501e){return _0x3e501e['destroy']()[_0xec09('0x23')](function(){var _0x51c281=_0x3e501e[_0xec09('0x38')]({'plain':!![]});var _0x3da05e='OpenchannelAccounts';return db[_0xec09('0x39')][_0xec09('0x3a')]({'where':{'type':_0x3da05e,'resourceId':_0x51c281['id']}})[_0xec09('0x23')](function(){return _0x3e501e;});})[_0xec09('0x23')](function(){_0x502b72[_0xec09('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33edaa,_0x57f365){return function(_0x4a6b78){if(!_0x4a6b78){_0x33edaa[_0xec09('0x2e')](0x194);}return _0x4a6b78;};}function handleError(_0x1bf5e2,_0x355f2e){_0x355f2e=_0x355f2e||0x1f4;return function(_0x57e441){logger[_0xec09('0x2a')](_0x57e441[_0xec09('0x3b')]);if(_0x57e441[_0xec09('0x3c')]){delete _0x57e441[_0xec09('0x3c')];}_0x1bf5e2[_0xec09('0x2f')](_0x355f2e)[_0xec09('0x3d')](_0x57e441);};}exports[_0xec09('0x3e')]=function(_0x2a0b04,_0x36ad68){var _0x143942={'include':[{'model':db[_0xec09('0x3f')],'as':_0xec09('0x40')}]},_0x387887={},_0x422c14={'count':0x0,'rows':[]};var _0x4d37d4=_['map'](db[_0xec09('0x41')][_0xec09('0x42')],function(_0xec5528){return{'name':_0xec5528['fieldName'],'type':_0xec5528[_0xec09('0x43')]['key']};});_0x387887[_0xec09('0x44')]=_[_0xec09('0x45')](_0x4d37d4,_0xec09('0x3c'));_0x387887[_0xec09('0x46')]=_[_0xec09('0x47')](_0x2a0b04[_0xec09('0x46')]);_0x387887['filters']=_['intersection'](_0x387887[_0xec09('0x44')],_0x387887[_0xec09('0x46')]);_0x143942['attributes']=_[_0xec09('0x48')](_0x387887[_0xec09('0x44')],qs['fields'](_0x2a0b04[_0xec09('0x46')][_0xec09('0x49')]));_0x143942[_0xec09('0x4a')]=_0x143942[_0xec09('0x4a')][_0xec09('0x4b')]?_0x143942[_0xec09('0x4a')]:_0x387887[_0xec09('0x44')];if(!_0x2a0b04[_0xec09('0x46')][_0xec09('0x4c')](_0xec09('0x4d'))){_0x143942[_0xec09('0x33')]=qs[_0xec09('0x33')](_0x2a0b04[_0xec09('0x46')][_0xec09('0x33')]);_0x143942['offset']=qs[_0xec09('0x32')](_0x2a0b04[_0xec09('0x46')][_0xec09('0x32')]);}_0x143942[_0xec09('0x4e')]=qs[_0xec09('0x4f')](_0x2a0b04[_0xec09('0x46')][_0xec09('0x4f')]);_0x143942[_0xec09('0x50')]=qs['filters'](_[_0xec09('0x51')](_0x2a0b04['query'],_0x387887[_0xec09('0x52')]));if(_0x2a0b04['query'][_0xec09('0x53')]){_0x143942[_0xec09('0x50')]=_[_0xec09('0x54')](_0x143942[_0xec09('0x50')],{'$or':_[_0xec09('0x45')](_0x4d37d4,function(_0x5b40ee){if(_0x5b40ee[_0xec09('0x43')]!==_0xec09('0x55')){var _0x1279a3={};_0x1279a3[_0x5b40ee[_0xec09('0x3c')]]={'$like':'%'+_0x2a0b04['query']['filter']+'%'};return _0x1279a3;}})});}_0x143942=_[_0xec09('0x54')]({},_0x143942,_0x2a0b04[_0xec09('0x56')]);var _0x1e3ac2={'where':_0x143942[_0xec09('0x50')]};return db[_0xec09('0x41')]['count'](_0x1e3ac2)[_0xec09('0x23')](function(_0x4435c1){_0x422c14['count']=_0x4435c1;if(_0x2a0b04[_0xec09('0x46')]['includeAll']){_0x143942['include']=[{'all':!![]}];}return db[_0xec09('0x41')][_0xec09('0x57')](_0x143942);})['then'](function(_0x13dc09){_0x422c14[_0xec09('0x58')]=_0x13dc09;return _0x422c14;})[_0xec09('0x23')](respondWithFilteredResult(_0x36ad68,_0x143942))['catch'](handleError(_0x36ad68,null));};exports[_0xec09('0x59')]=function(_0x267bb9,_0x268f7b){var _0x4b174f={'raw':![],'where':{'id':_0x267bb9[_0xec09('0x5a')]['id']},'include':[{'model':db[_0xec09('0x3f')],'as':_0xec09('0x40')}]},_0xbe8d04={};_0xbe8d04['model']=_[_0xec09('0x47')](db[_0xec09('0x41')][_0xec09('0x42')]);_0xbe8d04[_0xec09('0x46')]=_[_0xec09('0x47')](_0x267bb9[_0xec09('0x46')]);_0xbe8d04[_0xec09('0x52')]=_[_0xec09('0x48')](_0xbe8d04['model'],_0xbe8d04['query']);_0x4b174f['attributes']=_[_0xec09('0x48')](_0xbe8d04[_0xec09('0x44')],qs['fields'](_0x267bb9['query'][_0xec09('0x49')]));_0x4b174f['attributes']=_0x4b174f['attributes']['length']?_0x4b174f[_0xec09('0x4a')]:_0xbe8d04[_0xec09('0x44')];if(_0x267bb9[_0xec09('0x46')]['includeAll']){_0x4b174f[_0xec09('0x5b')]=[{'all':!![]}];}_0x4b174f=_['merge']({},_0x4b174f,_0x267bb9[_0xec09('0x56')]);return db['OpenchannelAccount'][_0xec09('0x5c')](_0x4b174f)[_0xec09('0x23')](handleEntityNotFound(_0x268f7b,null))[_0xec09('0x23')](respondWithResult(_0x268f7b,null))[_0xec09('0x5d')](handleError(_0x268f7b,null));};exports[_0xec09('0x5e')]=function(_0xda1d2a,_0x5a6ff0){return db[_0xec09('0x41')]['create'](_0xda1d2a[_0xec09('0x5f')],{})['then'](function(_0x52cf07){var _0x12fd68=_0xda1d2a[_0xec09('0x60')][_0xec09('0x38')]({'plain':!![]});if(!_0x12fd68)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12fd68[_0xec09('0x61')]===_0xec09('0x60')){var _0x14d762=_0x52cf07[_0xec09('0x38')]({'plain':!![]});var _0x2d8dcc='OpenchannelAccounts';return db[_0xec09('0x62')][_0xec09('0x5c')]({'where':{'name':_0x2d8dcc,'userProfileId':_0x12fd68[_0xec09('0x63')]},'raw':!![]})['then'](function(_0x2baec2){if(_0x2baec2&&_0x2baec2['autoAssociation']===0x0){return db['UserProfileResource'][_0xec09('0x5e')]({'name':_0x14d762[_0xec09('0x3c')],'resourceId':_0x14d762['id'],'type':_0x2baec2['name'],'sectionId':_0x2baec2['id']},{})['then'](function(){return _0x52cf07;});}else{return _0x52cf07;}})[_0xec09('0x5d')](function(_0x1bb4f6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1bb4f6);throw _0x1bb4f6;});}return _0x52cf07;})[_0xec09('0x23')](respondWithResult(_0x5a6ff0,0xc9))['catch'](handleError(_0x5a6ff0,null));};exports[_0xec09('0x64')]=function(_0x39c3e3,_0x57c84f){if(_0x39c3e3[_0xec09('0x5f')]['id']){delete _0x39c3e3['body']['id'];}return db[_0xec09('0x41')][_0xec09('0x5c')]({'where':{'id':_0x39c3e3[_0xec09('0x5a')]['id']},'include':[{'model':db[_0xec09('0x3f')],'as':'mandatoryDispositionPause'}]})[_0xec09('0x23')](handleEntityNotFound(_0x57c84f,null))[_0xec09('0x23')](saveUpdates(_0x39c3e3[_0xec09('0x5f')],null))[_0xec09('0x23')](respondWithResult(_0x57c84f,null))['catch'](handleError(_0x57c84f,null));};exports[_0xec09('0x3a')]=function(_0x30d902,_0x50fab3){return db[_0xec09('0x41')][_0xec09('0x5c')]({'where':{'id':_0x30d902[_0xec09('0x5a')]['id']}})[_0xec09('0x23')](handleEntityNotFound(_0x50fab3,null))[_0xec09('0x23')](removeEntity(_0x50fab3,null))[_0xec09('0x5d')](handleError(_0x50fab3,null));};exports[_0xec09('0x65')]=function(_0x96614,_0xc3e46f){return db[_0xec09('0x41')][_0xec09('0x65')]()[_0xec09('0x23')](respondWithResult(_0xc3e46f,null))[_0xec09('0x5d')](handleError(_0xc3e46f,null));};exports[_0xec09('0x66')]=function(_0x24db60,_0x567fd8,_0xe5aaf1){if(_0x24db60[_0xec09('0x5f')]['id']){delete _0x24db60['body']['id'];}return db[_0xec09('0x41')]['find']({'where':{'id':_0x24db60[_0xec09('0x5a')]['id']}})['then'](handleEntityNotFound(_0x567fd8,null))[_0xec09('0x23')](function(_0x542f9e){if(_0x542f9e){_0x24db60[_0xec09('0x5f')][_0xec09('0x67')]=_0x542f9e['id'];return db['Disposition'][_0xec09('0x5e')](_0x24db60[_0xec09('0x5f')]);}})['then'](respondWithResult(_0x567fd8,null))[_0xec09('0x5d')](handleError(_0x567fd8,null));};exports[_0xec09('0x68')]=function(_0x3098c5,_0x5d91be,_0x17260c){var _0x8b161d={'raw':![],'where':{}};var _0x130119={};var _0x18d473={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x3098c5['params']['id']}})[_0xec09('0x23')](handleEntityNotFound(_0x5d91be,null))[_0xec09('0x23')](function(_0xb9ba69){if(_0xb9ba69){_0x130119['model']=_[_0xec09('0x47')](db[_0xec09('0x69')][_0xec09('0x42')]);_0x130119[_0xec09('0x46')]=_[_0xec09('0x47')](_0x3098c5['query']);_0x130119[_0xec09('0x52')]=_[_0xec09('0x48')](_0x130119[_0xec09('0x44')],_0x130119[_0xec09('0x46')]);_0x8b161d[_0xec09('0x4a')]=_[_0xec09('0x48')](_0x130119[_0xec09('0x44')],qs[_0xec09('0x49')](_0x3098c5['query'][_0xec09('0x49')]));_0x8b161d[_0xec09('0x4a')]=_0x8b161d[_0xec09('0x4a')][_0xec09('0x4b')]?_0x8b161d[_0xec09('0x4a')]:_0x130119['model'];if(!_0x3098c5[_0xec09('0x46')][_0xec09('0x4c')](_0xec09('0x4d'))){_0x8b161d[_0xec09('0x33')]=qs[_0xec09('0x33')](_0x3098c5[_0xec09('0x46')]['limit']);_0x8b161d[_0xec09('0x32')]=qs[_0xec09('0x32')](_0x3098c5[_0xec09('0x46')][_0xec09('0x32')]);}_0x8b161d[_0xec09('0x4e')]=qs[_0xec09('0x4f')](_0x3098c5[_0xec09('0x46')][_0xec09('0x4f')]);_0x8b161d[_0xec09('0x50')]=qs[_0xec09('0x52')](_[_0xec09('0x51')](_0x3098c5[_0xec09('0x46')],_0x130119[_0xec09('0x52')]));_0x8b161d['where'][_0xec09('0x6a')]=_0xb9ba69['id'];if(_0x3098c5['query']['filter']){_0x8b161d[_0xec09('0x50')]=_[_0xec09('0x54')](_0x8b161d[_0xec09('0x50')],{'$or':_[_0xec09('0x45')](_0x8b161d[_0xec09('0x4a')],function(_0x4973c0){var _0x207763={};_0x207763[_0x4973c0]={'$like':'%'+_0x3098c5[_0xec09('0x46')]['filter']+'%'};return _0x207763;})});}_0x8b161d=_['merge']({},_0x8b161d,_0x3098c5[_0xec09('0x56')]);return db[_0xec09('0x69')][_0xec09('0x31')]({'where':_0x8b161d[_0xec09('0x50')]})[_0xec09('0x23')](function(_0x2a4f17){_0x18d473[_0xec09('0x31')]=_0x2a4f17;if(_0x3098c5['query'][_0xec09('0x6b')]){_0x8b161d[_0xec09('0x5b')]=[{'all':!![]}];}return db['Disposition'][_0xec09('0x57')](_0x8b161d);})[_0xec09('0x23')](function(_0x1b9ff0){_0x18d473[_0xec09('0x58')]=_0x1b9ff0;return _0x18d473;});}})[_0xec09('0x23')](respondWithFilteredResult(_0x5d91be,_0x8b161d))[_0xec09('0x5d')](handleError(_0x5d91be,null));};exports[_0xec09('0x6c')]=function(_0x5315c6,_0x56ccf5,_0x39cdfc){return db[_0xec09('0x41')][_0xec09('0x5c')]({'where':{'id':_0x5315c6[_0xec09('0x5a')]['id']}})[_0xec09('0x23')](handleEntityNotFound(_0x56ccf5,null))[_0xec09('0x23')](function(_0xcbbf8a){if(_0xcbbf8a){return _0xcbbf8a['removeDispositions'](_0x5315c6[_0xec09('0x46')][_0xec09('0x6d')]);}})[_0xec09('0x23')](respondWithStatusCode(_0x56ccf5,null))[_0xec09('0x5d')](handleError(_0x56ccf5,null));};exports[_0xec09('0x6e')]=function(_0x1996ed,_0xd8b158,_0x28ba4c){if(_0x1996ed[_0xec09('0x5f')]['id']){delete _0x1996ed[_0xec09('0x5f')]['id'];}return db[_0xec09('0x41')][_0xec09('0x5c')]({'where':{'id':_0x1996ed[_0xec09('0x5a')]['id']}})[_0xec09('0x23')](handleEntityNotFound(_0xd8b158,null))['then'](function(_0xc9da8f){if(_0xc9da8f){_0x1996ed[_0xec09('0x5f')][_0xec09('0x6a')]=_0xc9da8f['id'];return db[_0xec09('0x6f')][_0xec09('0x5e')](_0x1996ed[_0xec09('0x5f')]);}})[_0xec09('0x23')](respondWithResult(_0xd8b158,null))['catch'](handleError(_0xd8b158,null));};exports[_0xec09('0x70')]=function(_0x549e9f,_0x2bb79a,_0x5dfddc){var _0x4ba697={'raw':![],'where':{}};var _0x20c21e={};var _0x41fa51={'count':0x0,'rows':[]};return db[_0xec09('0x41')]['findOne']({'where':{'id':_0x549e9f[_0xec09('0x5a')]['id']}})[_0xec09('0x23')](handleEntityNotFound(_0x2bb79a,null))[_0xec09('0x23')](function(_0x32c7b8){if(_0x32c7b8){_0x20c21e[_0xec09('0x44')]=_[_0xec09('0x47')](db['CannedAnswer'][_0xec09('0x42')]);_0x20c21e[_0xec09('0x46')]=_[_0xec09('0x47')](_0x549e9f[_0xec09('0x46')]);_0x20c21e['filters']=_['intersection'](_0x20c21e[_0xec09('0x44')],_0x20c21e[_0xec09('0x46')]);_0x4ba697['attributes']=_[_0xec09('0x48')](_0x20c21e[_0xec09('0x44')],qs['fields'](_0x549e9f[_0xec09('0x46')]['fields']));_0x4ba697['attributes']=_0x4ba697['attributes'][_0xec09('0x4b')]?_0x4ba697[_0xec09('0x4a')]:_0x20c21e[_0xec09('0x44')];if(!_0x549e9f[_0xec09('0x46')][_0xec09('0x4c')]('nolimit')){_0x4ba697[_0xec09('0x33')]=qs['limit'](_0x549e9f[_0xec09('0x46')]['limit']);_0x4ba697[_0xec09('0x32')]=qs[_0xec09('0x32')](_0x549e9f[_0xec09('0x46')][_0xec09('0x32')]);}_0x4ba697['order']=qs[_0xec09('0x4f')](_0x549e9f[_0xec09('0x46')]['sort']);_0x4ba697[_0xec09('0x50')]=qs[_0xec09('0x52')](_[_0xec09('0x51')](_0x549e9f['query'],_0x20c21e[_0xec09('0x52')]));_0x4ba697['where'][_0xec09('0x6a')]=_0x32c7b8['id'];if(_0x549e9f[_0xec09('0x46')][_0xec09('0x53')]){_0x4ba697[_0xec09('0x50')]=_[_0xec09('0x54')](_0x4ba697[_0xec09('0x50')],{'$or':_[_0xec09('0x45')](_0x4ba697[_0xec09('0x4a')],function(_0x3a6b07){var _0x1cfca9={};_0x1cfca9[_0x3a6b07]={'$like':'%'+_0x549e9f['query'][_0xec09('0x53')]+'%'};return _0x1cfca9;})});}_0x4ba697=_[_0xec09('0x54')]({},_0x4ba697,_0x549e9f['options']);return db[_0xec09('0x6f')][_0xec09('0x31')]({'where':_0x4ba697[_0xec09('0x50')]})[_0xec09('0x23')](function(_0x4e68e3){_0x41fa51[_0xec09('0x31')]=_0x4e68e3;if(_0x549e9f[_0xec09('0x46')]['includeAll']){_0x4ba697[_0xec09('0x5b')]=[{'all':!![]}];}return db[_0xec09('0x6f')][_0xec09('0x57')](_0x4ba697);})[_0xec09('0x23')](function(_0x19ccfb){_0x41fa51['rows']=_0x19ccfb;return _0x41fa51;});}})['then'](respondWithFilteredResult(_0x2bb79a,_0x4ba697))[_0xec09('0x5d')](handleError(_0x2bb79a,null));};exports['removeAnswers']=function(_0x3c21ad,_0xca15,_0x4b9e7b){return db[_0xec09('0x41')][_0xec09('0x5c')]({'where':{'id':_0x3c21ad[_0xec09('0x5a')]['id']}})['then'](handleEntityNotFound(_0xca15,null))[_0xec09('0x23')](function(_0x362edc){if(_0x362edc){return _0x362edc[_0xec09('0x71')](_0x3c21ad[_0xec09('0x46')][_0xec09('0x6d')]);}})[_0xec09('0x23')](respondWithStatusCode(_0xca15,null))['catch'](handleError(_0xca15,null));};exports[_0xec09('0x72')]=function(_0xe891c,_0x1162ef,_0x44a35a){var _0x563d36={'body':_0xe891c[_0xec09('0x5f')],'channel':_0xec09('0x73')};var _0x2fa996=[];var _0x204bc3=[];var _0x37f7f1={};var _0x270ecb=![];return db['CmContact'][_0xec09('0x65')]()[_0xec09('0x23')](function(_0x32db7d){if(!_0x32db7d){throw new db['Sequelize']['ValidationError'](_0xec09('0x74'));}_0x2fa996=_[_0xec09('0x75')](_[_0xec09('0x47')](_0x32db7d),[_0xec09('0x76'),_0xec09('0x77')]);_0x204bc3=_[_0xec09('0x75')](_[_0xec09('0x47')](_0x32db7d),[_0xec09('0x76'),'updatedAt',_0xec09('0x78'),_0xec09('0x79')]);if(_0xe891c[_0xec09('0x5f')]['id']){delete _0xe891c[_0xec09('0x5f')]['id'];}if(_[_0xec09('0x7a')](_0xe891c[_0xec09('0x5f')][_0xec09('0x7b')])){throw new db[(_0xec09('0x1f'))][(_0xec09('0x20'))](_0xec09('0x7c'));}if(_[_0xec09('0x7a')](_0xe891c['body'][_0xec09('0x5f')])||_0xe891c[_0xec09('0x5f')][_0xec09('0x5f')]===''){throw new db['Sequelize'][(_0xec09('0x20'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xec09('0x7a')](_0xe891c[_0xec09('0x5f')][_0xec09('0x7d')])){throw new db['Sequelize'][(_0xec09('0x20'))](_0xec09('0x7e')+_0x204bc3);}if(!_['includes'](_0x204bc3,_0xe891c[_0xec09('0x5f')]['mapKey'])){throw new db[(_0xec09('0x1f'))][(_0xec09('0x20'))](_0xec09('0x7f')+_0x204bc3);}_0x37f7f1[_0xe891c[_0xec09('0x5f')][_0xec09('0x7d')]]=_0xe891c['body'][_0xec09('0x7b')];})['then'](function(){return db[_0xec09('0x41')][_0xec09('0x5c')]({'where':{'id':_0xe891c[_0xec09('0x5a')]['id']},'include':[{'model':db['CmList'],'as':_0xec09('0x80'),'include':[{'model':db[_0xec09('0x81')],'as':_0xec09('0x82'),'where':_0x37f7f1,'limit':0x1,'order':[['updatedAt',_0xec09('0x83')]]}]},{'model':db[_0xec09('0x84')],'as':_0xec09('0x85')}]});})['then'](handleEntityNotFound(_0x1162ef,null))[_0xec09('0x23')](function(_0x52bd3a){if(_0x52bd3a&&_0x52bd3a[_0xec09('0x80')]){_0x563d36[_0xec09('0x86')]=_0x52bd3a;_0x563d36[_0xec09('0x87')]=_0x52bd3a['Applications'];_0x563d36['list']=_0x52bd3a['List'];_0x563d36[_0xec09('0x87')]=_[_0xec09('0x88')](_0x563d36['applications'],[_0xec09('0x89')],[_0xec09('0x8a')]);if(_0x563d36['account'][_0xec09('0x85')]){delete _0x563d36[_0xec09('0x86')][_0xec09('0x85')];}if(_0x563d36[_0xec09('0x86')][_0xec09('0x80')]&&_0x563d36['account'][_0xec09('0x80')]['Contacts']['length']){return _0x563d36[_0xec09('0x86')][_0xec09('0x80')][_0xec09('0x82')][0x0];}var _0x36f20d=_['defaults'](_0xe891c[_0xec09('0x5f')],{'firstName':_0xe891c[_0xec09('0x5f')][_0xec09('0x7b')],'ListId':_0x52bd3a[_0xec09('0x79')]});_0x36f20d[_0xe891c[_0xec09('0x5f')]['mapKey']]=_0xe891c['body'][_0xec09('0x7b')];return db[_0xec09('0x81')]['create'](_0x36f20d,{'fields':_0x2fa996,'raw':!![]});}})['then'](handleEntityNotFound(_0x1162ef,null))[_0xec09('0x23')](function(_0x364c64){_0x563d36['contact']=_0x364c64;if(_0x364c64){var _0x490452={'ContactId':_0x364c64['id'],'OpenchannelAccountId':_0xe891c[_0xec09('0x5a')]['id'],'from':(_0x364c64[_0xec09('0x8b')]||'')+'\x20'+(_0x364c64['lastName']||'')};var _0x19f1bc={'OpenchannelAccountId':_0xe891c[_0xec09('0x5a')]['id'],'closed':![]};if(_0xe891c[_0xec09('0x5f')][_0xec09('0x8c')]){_0x19f1bc[_0xec09('0x8c')]=_0xe891c[_0xec09('0x5f')][_0xec09('0x8c')];return db[_0xec09('0x8d')][_0xec09('0x5c')]({'where':_0x19f1bc})[_0xec09('0x23')](function(_0x31c992){if(_0x31c992){return[_0x31c992,![]];}_0x490452[_0xec09('0x8c')]=_0xe891c[_0xec09('0x5f')][_0xec09('0x8c')];_0x490452[_0xec09('0x8e')]=_0xe891c[_0xec09('0x5f')]['externalUrl'];return db[_0xec09('0x8d')][_0xec09('0x5e')](_0x490452)[_0xec09('0x23')](function(_0x48b980){return[_0x48b980,!![]];});});}else{_0x19f1bc[_0xec09('0x8c')]=null;}_0x19f1bc['ContactId']=_0x364c64['id'];return db['OpenchannelInteraction'][_0xec09('0x5c')]({'where':_0x19f1bc})[_0xec09('0x23')](function(_0x351dfd){if(_0x351dfd){return[_0x351dfd,![]];}return db['OpenchannelInteraction'][_0xec09('0x5e')](_0x490452)['then'](function(_0x1d2348){return[_0x1d2348,!![]];});});}})[_0xec09('0x8f')](function(_0x13cfef,_0xf111be){if(_0x13cfef){_0x270ecb=_0xf111be;if(!_0xf111be){var _0x4554b2={'from':(_0x563d36['contact'][_0xec09('0x8b')]||'')+'\x20'+(_0x563d36[_0xec09('0x90')]['lastName']||'')};if(_0xe891c[_0xec09('0x5f')][_0xec09('0x8c')]&&_0xe891c[_0xec09('0x5f')][_0xec09('0x91')]&&_0xe891c[_0xec09('0x5f')][_0xec09('0x8c')]!=_0xe891c['body'][_0xec09('0x91')]){_0x4554b2[_0xec09('0x8c')]=_0xe891c[_0xec09('0x5f')][_0xec09('0x91')];}return _0x13cfef['update'](_0x4554b2);}else{return _0x13cfef;}}})['then'](function(_0x212b34){_0x563d36['interaction']=_0x212b34[_0xec09('0x38')]({'plain':!![]});_0x563d36['interaction'][_0xec09('0x92')]=_0x270ecb;if(_0x563d36[_0xec09('0x93')]['created']){if(_0x563d36[_0xec09('0x86')][_0xec09('0x94')]){_0x563d36[_0xec09('0x87')][_0xec09('0x95')]({'id':0x0,'priority':_0x563d36[_0xec09('0x87')]['length']+0x1,'app':_0xec09('0x96'),'appdata':_0xec09('0x97'),'interval':_0xec09('0x98')});}}return db[_0xec09('0x99')]['create']({'body':_0xe891c[_0xec09('0x5f')][_0xec09('0x5f')],'OpenchannelAccountId':_0xe891c[_0xec09('0x5a')]['id'],'OpenchannelInteractionId':_0x212b34['id'],'direction':'in','ContactId':_0x563d36[_0xec09('0x90')]['id'],'AttachmentId':_0xe891c[_0xec09('0x5f')]['AttachmentId']});})[_0xec09('0x23')](function(_0x213a1d){_0x563d36['message']=_0x213a1d;if(_0x563d36[_0xec09('0x93')]['UserId']){return db[_0xec09('0x9a')][_0xec09('0x5c')]({'attributes':['id','name'],'where':{'id':_0x563d36[_0xec09('0x93')][_0xec09('0x9b')]}})['then'](function(_0x2be2a1){if(_0x2be2a1){_0x563d36[_0xec09('0x87')][_0xec09('0x9c')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2be2a1['name']+','+(_0x563d36['account'][_0xec09('0x9d')]||0xa),'interval':_0xec09('0x98')});_0x563d36[_0xec09('0x9e')]=![];}return respondWithRpcPromise('Start','startRouting',_0x563d36);});}return respondWithRpcPromise(_0xec09('0x9f'),_0xec09('0xa0'),_0x563d36);})[_0xec09('0x23')](function(_0xa32f0f){respondWithRpcPromise('EventManager',_0xec09('0xa1'),{'event':_0xec09('0x72'),'message':_0xa32f0f},client9002);return _0xa32f0f;})[_0xec09('0x23')](respondWithResult(_0x1162ef,null))['catch'](handleError(_0x1162ef,null));};exports[_0xec09('0xa2')]=function(_0x1c9841,_0x595338,_0x405701){return db[_0xec09('0x41')][_0xec09('0xa3')]({'where':{'id':_0x1c9841[_0xec09('0x5a')]['id']}})[_0xec09('0x23')](handleEntityNotFound(_0x595338,null))[_0xec09('0x23')](function(_0xc46781){if(_0xc46781){return db['sequelize'][_0xec09('0xa4')](function(_0x1732e9){return db[_0xec09('0x84')][_0xec09('0x3a')]({'where':{'OpenchannelAccountId':_0x1c9841[_0xec09('0x5a')]['id']},'transaction':_0x1732e9})['then'](function(_0x59933f){var _0x43331e=_[_0xec09('0x45')](_0x1c9841[_0xec09('0x5f')],function(_0x213e92){_0x213e92[_0xec09('0x6a')]=_0x1c9841[_0xec09('0x5a')]['id'];return _0x213e92;});return db[_0xec09('0x84')]['bulkCreate'](_0x43331e,{'transaction':_0x1732e9});});})[_0xec09('0x23')](function(){return db['OpenchannelApplication'][_0xec09('0xa5')]({'where':{'OpenchannelAccountId':_0x1c9841['params']['id']},'order':'priority'});});}})[_0xec09('0x23')](respondWithResult(_0x595338,null))[_0xec09('0x5d')](handleError(_0x595338,null));};exports[_0xec09('0xa6')]=function(_0x193e57,_0x5dc49e,_0x3b3a72){var _0x151947={};var _0x4c5119={};var _0x15b1ad;var _0x2f3898;return db[_0xec09('0x41')][_0xec09('0xa3')]({'where':{'id':_0x193e57[_0xec09('0x5a')]['id']}})[_0xec09('0x23')](handleEntityNotFound(_0x5dc49e,null))['then'](function(_0x30efdc){if(_0x30efdc){_0x15b1ad=_0x30efdc;_0x4c5119['model']=_['keys'](db[_0xec09('0x84')][_0xec09('0x42')]);_0x4c5119[_0xec09('0x46')]=_['keys'](_0x193e57[_0xec09('0x46')]);_0x4c5119[_0xec09('0x52')]=_[_0xec09('0x48')](_0x4c5119[_0xec09('0x44')],_0x4c5119['query']);_0x151947[_0xec09('0x4a')]=_[_0xec09('0x48')](_0x4c5119[_0xec09('0x44')],qs[_0xec09('0x49')](_0x193e57[_0xec09('0x46')][_0xec09('0x49')]));_0x151947['attributes']=_0x151947[_0xec09('0x4a')]['length']?_0x151947[_0xec09('0x4a')]:_0x4c5119[_0xec09('0x44')];_0x151947[_0xec09('0x4e')]=qs[_0xec09('0x4f')](_0x193e57[_0xec09('0x46')][_0xec09('0x4f')]);_0x151947['where']=qs[_0xec09('0x52')](_['pick'](_0x193e57['query'],_0x4c5119['filters']));if(_0x193e57[_0xec09('0x46')][_0xec09('0x53')]){_0x151947[_0xec09('0x50')]=_[_0xec09('0x54')](_0x151947[_0xec09('0x50')],{'$or':_[_0xec09('0x45')](_0x151947[_0xec09('0x4a')],function(_0x2f5ff1){var _0x229f25={};_0x229f25[_0x2f5ff1]={'$like':'%'+_0x193e57[_0xec09('0x46')][_0xec09('0x53')]+'%'};return _0x229f25;})});}_0x151947=_['merge']({},_0x151947,_0x193e57[_0xec09('0x56')]);return _0x15b1ad[_0xec09('0xa6')](_0x151947);}})[_0xec09('0x23')](function(_0x5082a3){if(_0x5082a3){_0x2f3898=_0x5082a3[_0xec09('0x4b')];if(!_0x193e57['query'][_0xec09('0x4c')](_0xec09('0x4d'))){_0x151947['limit']=qs[_0xec09('0x33')](_0x193e57[_0xec09('0x46')][_0xec09('0x33')]);_0x151947[_0xec09('0x32')]=qs['offset'](_0x193e57[_0xec09('0x46')]['offset']);}return _0x15b1ad[_0xec09('0xa6')](_0x151947);}})[_0xec09('0x23')](function(_0xb1c375){if(_0xb1c375){return _0xb1c375?{'count':_0x2f3898,'rows':_0xb1c375}:null;}})['then'](respondWithResult(_0x5dc49e,null))[_0xec09('0x5d')](handleError(_0x5dc49e,null));};exports['getInteractions']=function(_0x96d42,_0x13b47e,_0x377bb6){var _0x5ae2be={'raw':![],'where':{}};var _0x5e3848={};var _0x568b02={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xec09('0xa3')]({'where':{'id':_0x96d42[_0xec09('0x5a')]['id']}})[_0xec09('0x23')](handleEntityNotFound(_0x13b47e,null))[_0xec09('0x23')](function(_0x3efe5b){if(_0x3efe5b){_0x5e3848[_0xec09('0x44')]=_['keys'](db[_0xec09('0x8d')][_0xec09('0x42')]);_0x5e3848[_0xec09('0x46')]=_['keys'](_0x96d42[_0xec09('0x46')]);_0x5e3848['filters']=_[_0xec09('0x48')](_0x5e3848['model'],_0x5e3848['query']);_0x5ae2be[_0xec09('0x4a')]=_['intersection'](_0x5e3848[_0xec09('0x44')],qs[_0xec09('0x49')](_0x96d42['query'][_0xec09('0x49')]));_0x5ae2be['attributes']=_0x5ae2be['attributes'][_0xec09('0x4b')]?_0x5ae2be[_0xec09('0x4a')]:_0x5e3848[_0xec09('0x44')];if(!_0x96d42[_0xec09('0x46')][_0xec09('0x4c')]('nolimit')){_0x5ae2be['limit']=qs[_0xec09('0x33')](_0x96d42[_0xec09('0x46')][_0xec09('0x33')]);_0x5ae2be[_0xec09('0x32')]=qs[_0xec09('0x32')](_0x96d42['query']['offset']);}_0x5ae2be['order']=qs[_0xec09('0x4f')](_0x96d42[_0xec09('0x46')][_0xec09('0x4f')]);_0x5ae2be[_0xec09('0x50')]=qs[_0xec09('0x52')](_[_0xec09('0x51')](_0x96d42[_0xec09('0x46')],_0x5e3848['filters']));_0x5ae2be[_0xec09('0x50')][_0xec09('0x6a')]=_0x3efe5b['id'];if(_0x96d42[_0xec09('0x46')][_0xec09('0x53')]){_0x5ae2be[_0xec09('0x50')]=_[_0xec09('0x54')](_0x5ae2be[_0xec09('0x50')],{'$or':_['map'](_0x5ae2be[_0xec09('0x4a')],function(_0x10871e){var _0x3e888d={};_0x3e888d[_0x10871e]={'$like':'%'+_0x96d42[_0xec09('0x46')]['filter']+'%'};return _0x3e888d;})});}_0x5ae2be=_['merge']({},_0x5ae2be,_0x96d42[_0xec09('0x56')]);return db[_0xec09('0x8d')][_0xec09('0x31')]({'where':_0x5ae2be[_0xec09('0x50')]})[_0xec09('0x23')](function(_0x5527f4){_0x568b02[_0xec09('0x31')]=_0x5527f4;if(_0x96d42[_0xec09('0x46')]['includeAll']){_0x5ae2be['include']=[{'model':db[_0xec09('0x81')],'as':'Contact','required':![]},{'model':db[_0xec09('0x9a')],'as':_0xec09('0xa7'),'attributes':[_0xec09('0x3c'),_0xec09('0xa8'),_0xec09('0xa9')],'required':![]},{'model':db['Tag'],'as':_0xec09('0xaa'),'attributes':['id',_0xec09('0x3c'),'color'],'where':_0x96d42[_0xec09('0x46')][_0xec09('0xab')]?{'id':_0x96d42[_0xec09('0x46')][_0xec09('0xab')]}:undefined,'required':_0x96d42['query']['tag']?!![]:![]}];}return db[_0xec09('0x8d')][_0xec09('0x57')](_0x5ae2be);})['then'](function(_0x18d1cb){_0x568b02[_0xec09('0x58')]=_0x18d1cb;return _0x568b02;});}})[_0xec09('0x23')](respondWithFilteredResult(_0x13b47e,_0x5ae2be))[_0xec09('0x5d')](handleError(_0x13b47e,null));};exports[_0xec09('0xac')]=function(_0x333c08,_0x1aa5b1,_0x551dfc){return db[_0xec09('0x41')][_0xec09('0x5c')]({'where':{'id':_0x333c08['params']['id']}})[_0xec09('0x23')](handleEntityNotFound(_0x1aa5b1,null))['then'](function(_0x303941){if(_0x303941){return _0x303941['addAgents'](_0x333c08[_0xec09('0x5f')][_0xec09('0x6d')],_[_0xec09('0xad')](_0x333c08[_0xec09('0x5f')],[_0xec09('0x6d'),'id'])||{})['spread'](function(_0x5a1764){for(var _0x2d0b66=0x0;_0x2d0b66<_0x333c08[_0xec09('0x5f')]['ids'][_0xec09('0x4b')];_0x2d0b66+=0x1){socket['emit'](_0xec09('0xae'),{'UserId':_0x333c08['body']['ids'][_0x2d0b66],'OpenchannelAccountId':_0x333c08[_0xec09('0x5a')]['id']});}return _0x5a1764;});}})[_0xec09('0x23')](respondWithResult(_0x1aa5b1,null))[_0xec09('0x5d')](handleError(_0x1aa5b1,null));};exports['removeAgents']=function(_0x26230f,_0x5606aa,_0x22eb1a){return db[_0xec09('0x41')][_0xec09('0x5c')]({'where':{'id':_0x26230f[_0xec09('0x5a')]['id']}})[_0xec09('0x23')](handleEntityNotFound(_0x5606aa,null))[_0xec09('0x23')](function(_0xfa6318){if(_0xfa6318){return _0xfa6318[_0xec09('0xaf')](_0x26230f[_0xec09('0x46')][_0xec09('0x6d')])[_0xec09('0x23')](function(){if(_[_0xec09('0xb0')](_0x26230f[_0xec09('0x46')][_0xec09('0x6d')])){for(var _0xc38a07=0x0;_0xc38a07<_0x26230f[_0xec09('0x46')]['ids'][_0xec09('0x4b')];_0xc38a07+=0x1){socket['emit'](_0xec09('0xb1'),{'UserId':Number(_0x26230f[_0xec09('0x46')][_0xec09('0x6d')][_0xc38a07]),'OpenchannelAccountId':Number(_0x26230f[_0xec09('0x5a')]['id'])});}}else{socket[_0xec09('0xb2')](_0xec09('0xb1'),{'UserId':Number(_0x26230f[_0xec09('0x46')][_0xec09('0x6d')]),'OpenchannelAccountId':Number(_0x26230f['params']['id'])});}});}})[_0xec09('0x23')](respondWithStatusCode(_0x5606aa,null))['catch'](handleError(_0x5606aa,null));};exports[_0xec09('0xb3')]=function(_0x55a1f6,_0x423ed5,_0x32b6aa){var _0x361f7b={};var _0x2bfb08={};var _0x5e78f3;var _0x41f95f;return db[_0xec09('0x41')]['findOne']({'where':{'id':_0x55a1f6[_0xec09('0x5a')]['id']}})['then'](handleEntityNotFound(_0x423ed5,null))[_0xec09('0x23')](function(_0x48aaf5){if(_0x48aaf5){_0x5e78f3=_0x48aaf5;_0x2bfb08[_0xec09('0x44')]=_[_0xec09('0x47')](db[_0xec09('0x9a')][_0xec09('0x42')]);_0x2bfb08[_0xec09('0x46')]=_[_0xec09('0x47')](_0x55a1f6[_0xec09('0x46')]);_0x2bfb08[_0xec09('0x52')]=_[_0xec09('0x48')](_0x2bfb08[_0xec09('0x44')],_0x2bfb08[_0xec09('0x46')]);_0x361f7b[_0xec09('0x4a')]=_[_0xec09('0x48')](_0x2bfb08['model'],qs['fields'](_0x55a1f6[_0xec09('0x46')][_0xec09('0x49')]));_0x361f7b[_0xec09('0x4a')]=_0x361f7b['attributes'][_0xec09('0x4b')]?_0x361f7b['attributes']:_0x2bfb08[_0xec09('0x44')];_0x361f7b[_0xec09('0x4e')]=qs['sort'](_0x55a1f6[_0xec09('0x46')][_0xec09('0x4f')]);_0x361f7b[_0xec09('0x50')]=qs['filters'](_[_0xec09('0x51')](_0x55a1f6['query'],_0x2bfb08[_0xec09('0x52')]));if(_0x55a1f6[_0xec09('0x46')][_0xec09('0x53')]){_0x361f7b[_0xec09('0x50')]=_['merge'](_0x361f7b['where'],{'$or':_['map'](_0x361f7b[_0xec09('0x4a')],function(_0x3745e3){var _0x2b3c5f={};_0x2b3c5f[_0x3745e3]={'$like':'%'+_0x55a1f6[_0xec09('0x46')][_0xec09('0x53')]+'%'};return _0x2b3c5f;})});}_0x361f7b=_[_0xec09('0x54')]({},_0x361f7b,_0x55a1f6[_0xec09('0x56')]);return _0x5e78f3['getAgents'](_0x361f7b);}})[_0xec09('0x23')](function(_0x4a5ea2){if(_0x4a5ea2){_0x41f95f=_0x4a5ea2['length'];if(!_0x55a1f6[_0xec09('0x46')][_0xec09('0x4c')](_0xec09('0x4d'))){_0x361f7b[_0xec09('0x33')]=qs[_0xec09('0x33')](_0x55a1f6[_0xec09('0x46')][_0xec09('0x33')]);_0x361f7b[_0xec09('0x32')]=qs['offset'](_0x55a1f6[_0xec09('0x46')]['offset']);}return _0x5e78f3[_0xec09('0xb3')](_0x361f7b);}})[_0xec09('0x23')](function(_0x4fbbf5){if(_0x4fbbf5){return _0x4fbbf5?{'count':_0x41f95f,'rows':_0x4fbbf5}:null;}})[_0xec09('0x23')](respondWithResult(_0x423ed5,null))[_0xec09('0x5d')](handleError(_0x423ed5,null));};exports['send']=function(_0x3ff1ac,_0x338344,_0x12a2db){var _0x47fe09,_0x853ff9,_0x46ea46;if(_[_0xec09('0x7a')](_0x3ff1ac[_0xec09('0x5f')][_0xec09('0x5f')])||_0x3ff1ac[_0xec09('0x5f')][_0xec09('0x5f')]===''){throw new db[(_0xec09('0x1f'))]['ValidationError'](_0xec09('0xb4'));}if(_[_0xec09('0x7a')](_0x3ff1ac[_0xec09('0x5f')]['to'])){}_0x47fe09=_0x3ff1ac[_0xec09('0x5f')]['to'];return db[_0xec09('0x41')]['findOne']({'where':{'id':_0x3ff1ac['params']['id']}})['then'](handleEntityNotFound(_0x338344,null))[_0xec09('0x23')](function(_0x1419b0){if(_0x1419b0){return db['OpenchannelAccount']['find']({'where':{'id':_0x1419b0['id']},'include':[{'model':db[_0xec09('0xb5')],'as':_0xec09('0x80'),'include':[{'model':db[_0xec09('0x81')],'as':'Contacts','where':{[_0x1419b0['mapKey']]:_0x47fe09},'limit':0x1,'order':[['updatedAt',_0xec09('0x83')]]}]}]})['then'](handleEntityNotFound(_0x338344,null))[_0xec09('0x23')](function(_0x572523){if(_0x572523&&_0x572523[_0xec09('0x80')]){_0x853ff9=_0x572523[_0xec09('0x38')]({'plain':!![]});if(_0x853ff9['List']&&_0x853ff9[_0xec09('0x80')][_0xec09('0x82')][_0xec09('0x4b')]){return _0x853ff9['List'][_0xec09('0x82')][0x0];}return db[_0xec09('0x81')][_0xec09('0x5e')](_[_0xec09('0xb6')](_0x3ff1ac[_0xec09('0x5f')],{'firstName':_0x47fe09,[_0x572523[_0xec09('0x7d')]]:_0x47fe09,'phone':_0x47fe09,'ListId':_0x853ff9[_0xec09('0x79')]}));}})['then'](handleEntityNotFound(_0x338344,null))[_0xec09('0x23')](function(_0x434008){if(_0x434008){_0x46ea46=_0x434008;return db[_0xec09('0x8d')][_0xec09('0x5c')]({'where':{'ContactId':_0x46ea46['id'],'closed':![],'OpenchannelAccountId':_0x853ff9['id']}})[_0xec09('0x23')](function(_0x24f858){if(_0x24f858){return[_0x24f858,![]];}return db['OpenchannelInteraction'][_0xec09('0x5e')]({'UserId':_0x3ff1ac[_0xec09('0x60')]['id'],'ContactId':_0x46ea46['id'],'OpenchannelAccountId':_0x853ff9['id'],'lastMsgDirection':_0xec09('0xb7'),'Messages':[_[_0xec09('0x54')](_0x3ff1ac[_0xec09('0x5f')],{'read':![],'body':_0x3ff1ac[_0xec09('0x5f')][_0xec09('0x5f')],'OpenchannelAccountId':_0x853ff9['id'],'UserId':_0x3ff1ac[_0xec09('0x60')]['id'],'ContactId':_0x46ea46['id']})]},{'include':[{'model':db[_0xec09('0x99')],'as':_0xec09('0xb8')}]})[_0xec09('0x23')](function(_0x2e82a8){return[_0x2e82a8,!![]];});});}})['spread'](function(_0x2f83f3,_0x32a7fa){if(_0x32a7fa){return _0x2f83f3;}return db['OpenchannelMessage'][_0xec09('0x5e')](_[_0xec09('0x54')](_0x3ff1ac[_0xec09('0x5f')],{'read':![],'body':_0x3ff1ac[_0xec09('0x5f')]['body'],'OpenchannelAccountId':_0x853ff9['id'],'OpenchannelInteractionId':_0x2f83f3['id'],'UserId':_0x3ff1ac['user']['id'],'ContactId':_0x46ea46['id']}))[_0xec09('0x23')](function(_0x106acb){_0x2f83f3[_0xec09('0xb9')][_0xec09('0xb8')]=[];_0x2f83f3['dataValues'][_0xec09('0xb8')]['push'](_0x106acb[_0xec09('0xb9')]);return _0x2f83f3;});});}})['then'](respondWithResult(_0x338344,null))[_0xec09('0x5d')](handleError(_0x338344,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 56a2e8c..ba7a3a2 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 _0x2381=['events','../../mysqldb','OpenchannelAccount','setMaxListeners','save','emit','hasOwnProperty','hook','exports'];(function(_0x52b261,_0x25c300){var _0x3fc6d7=function(_0xc6763c){while(--_0xc6763c){_0x52b261['push'](_0x52b261['shift']());}};_0x3fc6d7(++_0x25c300);}(_0x2381,0x120));var _0x1238=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x2381[_0x13b02f];return _0x12e9a6;};'use strict';var EventEmitter=require(_0x1238('0x0'));var OpenchannelAccount=require(_0x1238('0x1'))['db'][_0x1238('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x1238('0x3')](0x0);var events={'afterCreate':_0x1238('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x450c97){return function(_0x1cb759,_0x15d5ef,_0x5c53a3){OpenchannelAccountEvents[_0x1238('0x5')](_0x450c97+':'+_0x1cb759['id'],_0x1cb759);OpenchannelAccountEvents[_0x1238('0x5')](_0x450c97,_0x1cb759);_0x5c53a3(null);};}for(var e in events){if(events[_0x1238('0x6')](e)){var event=events[e];OpenchannelAccount[_0x1238('0x7')](e,emitEvent(event));}}module[_0x1238('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xee3a=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners'];(function(_0x20b1a7,_0x2f2ece){var _0x4d3a1a=function(_0x8c7c46){while(--_0x8c7c46){_0x20b1a7['push'](_0x20b1a7['shift']());}};_0x4d3a1a(++_0x2f2ece);}(_0xee3a,0x1bf));var _0xaee3=function(_0x3d4678,_0x527eb0){_0x3d4678=_0x3d4678-0x0;var _0x1bcdae=_0xee3a[_0x3d4678];return _0x1bcdae;};'use strict';var EventEmitter=require(_0xaee3('0x0'));var OpenchannelAccount=require(_0xaee3('0x1'))['db'][_0xaee3('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xaee3('0x3')](0x0);var events={'afterCreate':_0xaee3('0x4'),'afterUpdate':_0xaee3('0x5'),'afterDestroy':_0xaee3('0x6')};function emitEvent(_0x145acd){return function(_0x918532,_0x521c02,_0x2bce91){OpenchannelAccountEvents[_0xaee3('0x7')](_0x145acd+':'+_0x918532['id'],_0x918532);OpenchannelAccountEvents[_0xaee3('0x7')](_0x145acd,_0x918532);_0x2bce91(null);};}for(var e in events){if(events[_0xaee3('0x8')](e)){var event=events[e];OpenchannelAccount[_0xaee3('0x9')](e,emitEvent(event));}}module[_0xaee3('0xa')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 47a5bb7..33ae6d2 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 _0xfd03=['../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','OpenchannelAccount'];(function(_0x2efd1d,_0x44f696){var _0x1ef3f6=function(_0x25da5f){while(--_0x25da5f){_0x2efd1d['push'](_0x2efd1d['shift']());}};_0x1ef3f6(++_0x44f696);}(_0xfd03,0xa2));var _0x3fd0=function(_0x20845e,_0x211e78){_0x20845e=_0x20845e-0x0;var _0x28cf2b=_0xfd03[_0x20845e];return _0x28cf2b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3fd0('0x0'))(_0x3fd0('0x1'));var moment=require(_0x3fd0('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fd0('0x3'));var rimraf=require(_0x3fd0('0x4'));var config=require(_0x3fd0('0x5'));var attributes=require('./openchannelAccount.attributes');module[_0x3fd0('0x6')]=function(_0x59d2f4,_0x35c9ba){return _0x59d2f4[_0x3fd0('0x7')](_0x3fd0('0x8'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcbc7=['openchannel_accounts','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./openchannelAccount.attributes','OpenchannelAccount'];(function(_0x2f821c,_0x30849b){var _0x2922c5=function(_0x3c88e2){while(--_0x3c88e2){_0x2f821c['push'](_0x2f821c['shift']());}};_0x2922c5(++_0x30849b);}(_0xcbc7,0xf1));var _0x7cbc=function(_0x389a03,_0x380e6c){_0x389a03=_0x389a03-0x0;var _0xaf19ea=_0xcbc7[_0x389a03];return _0xaf19ea;};'use strict';var _=require(_0x7cbc('0x0'));var util=require(_0x7cbc('0x1'));var logger=require(_0x7cbc('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7cbc('0x3'));var rp=require(_0x7cbc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7cbc('0x5'));var config=require(_0x7cbc('0x6'));var attributes=require(_0x7cbc('0x7'));module['exports']=function(_0x1a05fa,_0x5a4f86){return _0x1a05fa['define'](_0x7cbc('0x8'),attributes,{'tableName':_0x7cbc('0x9'),'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 25fe0ab..05dab8e 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 _0x6d35=['message','OpenchannelAccount,\x20%s,\x20%s','result','catch','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error'];(function(_0x79c97d,_0x204205){var _0x3dfdbb=function(_0x5c3024){while(--_0x5c3024){_0x79c97d['push'](_0x79c97d['shift']());}};_0x3dfdbb(++_0x204205);}(_0x6d35,0x13c));var _0x56d3=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x6d35[_0x4e1d03];return _0x362d4b;};'use strict';var _=require('lodash');var util=require(_0x56d3('0x0'));var moment=require(_0x56d3('0x1'));var BPromise=require(_0x56d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x56d3('0x3'));var logger=require(_0x56d3('0x4'))(_0x56d3('0x5'));var config=require(_0x56d3('0x6'));var jayson=require(_0x56d3('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x56d3('0x8')]=_['defaults'](config['redis'],{'host':_0x56d3('0x9'),'port':0x18eb});var socket=require(_0x56d3('0xa'))(new Redis(config[_0x56d3('0x8')]));require(_0x56d3('0xb'))[_0x56d3('0xc')](socket);function respondWithRpcPromise(_0x4e5fed,_0x4abcb6,_0x436ab0){return new BPromise(function(_0x2b0895,_0x59c4c1){return client[_0x56d3('0xd')](_0x4e5fed,_0x436ab0)[_0x56d3('0xe')](function(_0x91dd74){logger[_0x56d3('0xf')]('OpenchannelAccount,\x20%s,\x20%s',_0x4abcb6,_0x56d3('0x10'));logger[_0x56d3('0x11')](_0x56d3('0x12'),_0x4abcb6,_0x56d3('0x10'),JSON['stringify'](_0x91dd74));if(_0x91dd74[_0x56d3('0x13')]){if(_0x91dd74[_0x56d3('0x13')]['code']===0x1f4){logger[_0x56d3('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x4abcb6,_0x91dd74[_0x56d3('0x13')][_0x56d3('0x14')]);return _0x59c4c1(_0x91dd74['error'][_0x56d3('0x14')]);}logger[_0x56d3('0x13')](_0x56d3('0x15'),_0x4abcb6,_0x91dd74[_0x56d3('0x13')][_0x56d3('0x14')]);return _0x2b0895(_0x91dd74[_0x56d3('0x13')][_0x56d3('0x14')]);}else{logger['info'](_0x56d3('0x15'),_0x4abcb6,_0x56d3('0x10'));_0x2b0895(_0x91dd74[_0x56d3('0x16')][_0x56d3('0x14')]);}})[_0x56d3('0x17')](function(_0x2a7153){logger[_0x56d3('0x13')](_0x56d3('0x15'),_0x4abcb6,_0x2a7153);_0x59c4c1(_0x2a7153);});});} \ No newline at end of file +var _0xac90=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','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','bluebird','randomstring'];(function(_0x592f2c,_0x458bff){var _0x4669af=function(_0x1338c7){while(--_0x1338c7){_0x592f2c['push'](_0x592f2c['shift']());}};_0x4669af(++_0x458bff);}(_0xac90,0x11d));var _0x0ac9=function(_0x532bad,_0x1645d8){_0x532bad=_0x532bad-0x0;var _0x23e631=_0xac90[_0x532bad];return _0x23e631;};'use strict';var _=require(_0x0ac9('0x0'));var util=require(_0x0ac9('0x1'));var moment=require(_0x0ac9('0x2'));var BPromise=require(_0x0ac9('0x3'));var rs=require(_0x0ac9('0x4'));var fs=require('fs');var Redis=require(_0x0ac9('0x5'));var db=require(_0x0ac9('0x6'))['db'];var utils=require(_0x0ac9('0x7'));var logger=require(_0x0ac9('0x8'))(_0x0ac9('0x9'));var config=require(_0x0ac9('0xa'));var jayson=require(_0x0ac9('0xb'));var client=jayson['client'][_0x0ac9('0xc')]({'port':0x232a});config['redis']=_[_0x0ac9('0xd')](config[_0x0ac9('0xe')],{'host':_0x0ac9('0xf'),'port':0x18eb});var socket=require(_0x0ac9('0x10'))(new Redis(config[_0x0ac9('0xe')]));require(_0x0ac9('0x11'))['register'](socket);function respondWithRpcPromise(_0x38c61b,_0x234f7e,_0x1614fa){return new BPromise(function(_0x18f747,_0x41d17f){return client[_0x0ac9('0x12')](_0x38c61b,_0x1614fa)[_0x0ac9('0x13')](function(_0x555fd2){logger[_0x0ac9('0x14')](_0x0ac9('0x15'),_0x234f7e,_0x0ac9('0x16'));logger[_0x0ac9('0x17')](_0x0ac9('0x18'),_0x234f7e,_0x0ac9('0x16'),JSON[_0x0ac9('0x19')](_0x555fd2));if(_0x555fd2[_0x0ac9('0x1a')]){if(_0x555fd2[_0x0ac9('0x1a')]['code']===0x1f4){logger[_0x0ac9('0x1a')]('OpenchannelAccount,\x20%s,\x20%s',_0x234f7e,_0x555fd2[_0x0ac9('0x1a')][_0x0ac9('0x1b')]);return _0x41d17f(_0x555fd2[_0x0ac9('0x1a')][_0x0ac9('0x1b')]);}logger['error'](_0x0ac9('0x15'),_0x234f7e,_0x555fd2[_0x0ac9('0x1a')][_0x0ac9('0x1b')]);return _0x18f747(_0x555fd2['error']['message']);}else{logger[_0x0ac9('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x234f7e,_0x0ac9('0x16'));_0x18f747(_0x555fd2[_0x0ac9('0x1c')][_0x0ac9('0x1b')]);}})['catch'](function(_0x413351){logger[_0x0ac9('0x1a')](_0x0ac9('0x15'),_0x234f7e,_0x413351);_0x41d17f(_0x413351);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index a016641..b981f19 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 _0xa172=['emit','removeListener','length','openchannelAccount:','save','remove','update'];(function(_0x379f22,_0xa35b4a){var _0x1c5680=function(_0x268a5b){while(--_0x268a5b){_0x379f22['push'](_0x379f22['shift']());}};_0x1c5680(++_0xa35b4a);}(_0xa172,0x1d9));var _0x2a17=function(_0x1afb79,_0x57d1e5){_0x1afb79=_0x1afb79-0x0;var _0x4fb720=_0xa172[_0x1afb79];return _0x4fb720;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x2a17('0x0'),_0x2a17('0x1'),_0x2a17('0x2')];function createListener(_0x14ef20,_0x305306){return function(_0x407000){_0x305306[_0x2a17('0x3')](_0x14ef20,_0x407000);};}function removeListener(_0x2b9e10,_0x1dbc01){return function(){OpenchannelAccountEvents[_0x2a17('0x4')](_0x2b9e10,_0x1dbc01);};}exports['register']=function(_0x4862d3){for(var _0x1f28db=0x0,_0x3ddd24=events[_0x2a17('0x5')];_0x1f28db<_0x3ddd24;_0x1f28db++){var _0x1a4746=events[_0x1f28db];var _0x41b4da=createListener(_0x2a17('0x6')+_0x1a4746,_0x4862d3);OpenchannelAccountEvents['on'](_0x1a4746,_0x41b4da);}}; \ No newline at end of file +var _0xaf30=['remove','emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x1476ba,_0x446421){var _0x5e7bc1=function(_0x4aa99c){while(--_0x4aa99c){_0x1476ba['push'](_0x1476ba['shift']());}};_0x5e7bc1(++_0x446421);}(_0xaf30,0xde));var _0x0af3=function(_0x214a25,_0x15071d){_0x214a25=_0x214a25-0x0;var _0x405988=_0xaf30[_0x214a25];return _0x405988;};'use strict';var OpenchannelAccountEvents=require(_0x0af3('0x0'));var events=[_0x0af3('0x1'),_0x0af3('0x2'),'update'];function createListener(_0x5d9d25,_0x19c91a){return function(_0x204a92){_0x19c91a[_0x0af3('0x3')](_0x5d9d25,_0x204a92);};}function removeListener(_0x104334,_0x1afb81){return function(){OpenchannelAccountEvents[_0x0af3('0x4')](_0x104334,_0x1afb81);};}exports[_0x0af3('0x5')]=function(_0x20c76a){for(var _0x529b24=0x0,_0x5c3b89=events[_0x0af3('0x6')];_0x529b24<_0x5c3b89;_0x529b24++){var _0x1e3ba2=events[_0x529b24];var _0x1fe4ed=createListener(_0x0af3('0x7')+_0x1e3ba2,_0x20c76a);OpenchannelAccountEvents['on'](_0x1e3ba2,_0x1fe4ed);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 4b7329b..a50880c 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 _0x54a3=['./openchannelApplication.controller','get','isAuthenticated','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x524518,_0x336dba){var _0x4e237b=function(_0x1ead59){while(--_0x1ead59){_0x524518['push'](_0x524518['shift']());}};_0x4e237b(++_0x336dba);}(_0x54a3,0x1ac));var _0x354a=function(_0x233843,_0x24e4be){_0x233843=_0x233843-0x0;var _0x58f461=_0x54a3[_0x233843];return _0x58f461;};'use strict';var multer=require(_0x354a('0x0'));var util=require(_0x354a('0x1'));var path=require(_0x354a('0x2'));var timeout=require(_0x354a('0x3'));var express=require(_0x354a('0x4'));var router=express['Router']();var auth=require(_0x354a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x354a('0x6'));var controller=require(_0x354a('0x7'));router[_0x354a('0x8')]('/',auth[_0x354a('0x9')](),controller['index']);router[_0x354a('0x8')](_0x354a('0xa'),auth[_0x354a('0x9')](),controller['show']);router['post']('/',auth[_0x354a('0x9')](),controller['create']);router['put'](_0x354a('0xa'),auth[_0x354a('0x9')](),controller[_0x354a('0xb')]);router[_0x354a('0xc')](_0x354a('0xa'),auth['isAuthenticated'](),controller[_0x354a('0xd')]);module[_0x354a('0xe')]=router; \ No newline at end of file +var _0x19dd=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','put','update','delete','/:id','exports','multer','util','connect-timeout','express','../../components/auth/service'];(function(_0x4e8a3f,_0x30e6d7){var _0x4cf0d9=function(_0x3849ee){while(--_0x3849ee){_0x4e8a3f['push'](_0x4e8a3f['shift']());}};_0x4cf0d9(++_0x30e6d7);}(_0x19dd,0xfa));var _0xd19d=function(_0x48cfa7,_0x52b668){_0x48cfa7=_0x48cfa7-0x0;var _0x673239=_0x19dd[_0x48cfa7];return _0x673239;};'use strict';var multer=require(_0xd19d('0x0'));var util=require(_0xd19d('0x1'));var path=require('path');var timeout=require(_0xd19d('0x2'));var express=require(_0xd19d('0x3'));var router=express['Router']();var auth=require(_0xd19d('0x4'));var interaction=require(_0xd19d('0x5'));var config=require(_0xd19d('0x6'));var controller=require('./openchannelApplication.controller');router[_0xd19d('0x7')]('/',auth[_0xd19d('0x8')](),controller[_0xd19d('0x9')]);router[_0xd19d('0x7')]('/:id',auth[_0xd19d('0x8')](),controller[_0xd19d('0xa')]);router[_0xd19d('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd19d('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xd19d('0xd')]);router[_0xd19d('0xe')](_0xd19d('0xf'),auth[_0xd19d('0x8')](),controller['destroy']);module[_0xd19d('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 91767ef..efbdde8 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 _0x0738=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x435c6d,_0x1be256){var _0x235029=function(_0x36a770){while(--_0x36a770){_0x435c6d['push'](_0x435c6d['shift']());}};_0x235029(++_0x1be256);}(_0x0738,0xe9));var _0x8073=function(_0x29df9a,_0x42aff3){_0x29df9a=_0x29df9a-0x0;var _0x3a8e96=_0x0738[_0x29df9a];return _0x3a8e96;};'use strict';var Sequelize=require(_0x8073('0x0'));module['exports']={'priority':{'type':Sequelize[_0x8073('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x8073('0x2')],'allowNull':![],'defaultValue':_0x8073('0x3')},'appdata':{'type':Sequelize[_0x8073('0x4')]()},'description':{'type':Sequelize[_0x8073('0x2')]},'interval':{'type':Sequelize[_0x8073('0x2')],'defaultValue':_0x8073('0x5')}}; \ No newline at end of file +var _0x7b14=['STRING','noop','*,*,*,*','exports','INTEGER'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7b14,0x143));var _0x47b1=function(_0x59dcca,_0x408e96){_0x59dcca=_0x59dcca-0x0;var _0x54615e=_0x7b14[_0x59dcca];return _0x54615e;};'use strict';var Sequelize=require('sequelize');module[_0x47b1('0x0')]={'priority':{'type':Sequelize[_0x47b1('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x47b1('0x2')],'allowNull':![],'defaultValue':_0x47b1('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x47b1('0x2')],'defaultValue':_0x47b1('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 621e416..7daf615 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 _0x350f=['keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','show','params','catch','create','body','destroy','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','limit','set','Content-Range','apply','save','update','then','end','error','stack','name','index','map','OpenchannelApplication','rawAttributes','key','model'];(function(_0x31a8d4,_0x1dd2a7){var _0x3058ec=function(_0xd03c37){while(--_0xd03c37){_0x31a8d4['push'](_0x31a8d4['shift']());}};_0x3058ec(++_0x1dd2a7);}(_0x350f,0xa2));var _0xf350=function(_0x11a55c,_0x4eced9){_0x11a55c=_0x11a55c-0x0;var _0x26c390=_0x350f[_0x11a55c];return _0x26c390;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf350('0x0'));var rimraf=require(_0xf350('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf350('0x2'));var rp=require(_0xf350('0x3'));var moment=require(_0xf350('0x4'));var BPromise=require(_0xf350('0x5'));var Mustache=require(_0xf350('0x6'));var util=require('util');var path=require(_0xf350('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xf350('0x8'));var squel=require(_0xf350('0x9'));var crypto=require(_0xf350('0xa'));var jsforce=require(_0xf350('0xb'));var deskjs=require(_0xf350('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf350('0xd'));var Redis=require(_0xf350('0xe'));var authService=require(_0xf350('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf350('0x10'));var hardwareService=require(_0xf350('0x11'));var logger=require(_0xf350('0x12'))(_0xf350('0x13'));var utils=require(_0xf350('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e1fe7,_0x1ca7e4){_0x1ca7e4=_0x1ca7e4||0xcc;return function(_0x3f5494){if(_0x3f5494){return _0x2e1fe7[_0xf350('0x15')](_0x1ca7e4);}return _0x2e1fe7[_0xf350('0x16')](_0x1ca7e4)['end']();};}function respondWithResult(_0x4f66c2,_0x59c564){_0x59c564=_0x59c564||0xc8;return function(_0x5062b9){if(_0x5062b9){return _0x4f66c2[_0xf350('0x16')](_0x59c564)[_0xf350('0x17')](_0x5062b9);}};}function respondWithFilteredResult(_0x3d49c8,_0x3e04e3){return function(_0x1bb35e){if(_0x1bb35e){var _0x1e8bf1=_0x1bb35e['count'],_0x474a4f=_0x3e04e3[_0xf350('0x18')],_0x5421ea=_0x3e04e3[_0xf350('0x18')]+_0x3e04e3[_0xf350('0x19')],_0x1d38b7;if(_0x5421ea>=_0x1e8bf1){_0x5421ea=_0x1e8bf1;_0x1d38b7=0xc8;}else{_0x1d38b7=0xce;}_0x3d49c8['status'](_0x1d38b7);return _0x3d49c8[_0xf350('0x1a')](_0xf350('0x1b'),_0x474a4f+'-'+_0x5421ea+'/'+_0x1e8bf1)[_0xf350('0x17')](_0x1bb35e);}return null;};}function patchUpdates(_0x3f4aaf){return function(_0xb2c28a){try{jsonpatch[_0xf350('0x1c')](_0xb2c28a,_0x3f4aaf,!![]);}catch(_0x335f5f){return BPromise['reject'](_0x335f5f);}return _0xb2c28a[_0xf350('0x1d')]();};}function saveUpdates(_0x4b8cf7,_0x2b7064){return function(_0x32ab6d){if(_0x32ab6d){return _0x32ab6d[_0xf350('0x1e')](_0x4b8cf7)[_0xf350('0x1f')](function(_0x27544c){return _0x27544c;});}return null;};}function removeEntity(_0x5495cc,_0x555c50){return function(_0x558df7){if(_0x558df7){return _0x558df7['destroy']()['then'](function(){_0x5495cc[_0xf350('0x16')](0xcc)[_0xf350('0x20')]();});}};}function handleEntityNotFound(_0x4c6ac9,_0x3ed7bf){return function(_0x365de8){if(!_0x365de8){_0x4c6ac9['sendStatus'](0x194);}return _0x365de8;};}function handleError(_0x37c922,_0x41c4c6){_0x41c4c6=_0x41c4c6||0x1f4;return function(_0xc50290){logger[_0xf350('0x21')](_0xc50290[_0xf350('0x22')]);if(_0xc50290[_0xf350('0x23')]){delete _0xc50290[_0xf350('0x23')];}_0x37c922[_0xf350('0x16')](_0x41c4c6)['send'](_0xc50290);};}exports[_0xf350('0x24')]=function(_0x2b7228,_0x472311){var _0x146350={},_0x1770e7={},_0x2a01a2={'count':0x0,'rows':[]};var _0x57ca3e=_[_0xf350('0x25')](db[_0xf350('0x26')][_0xf350('0x27')],function(_0x2b582b){return{'name':_0x2b582b['fieldName'],'type':_0x2b582b['type'][_0xf350('0x28')]};});_0x1770e7[_0xf350('0x29')]=_['map'](_0x57ca3e,_0xf350('0x23'));_0x1770e7['query']=_[_0xf350('0x2a')](_0x2b7228[_0xf350('0x2b')]);_0x1770e7[_0xf350('0x2c')]=_[_0xf350('0x2d')](_0x1770e7[_0xf350('0x29')],_0x1770e7['query']);_0x146350[_0xf350('0x2e')]=_['intersection'](_0x1770e7[_0xf350('0x29')],qs[_0xf350('0x2f')](_0x2b7228['query']['fields']));_0x146350['attributes']=_0x146350[_0xf350('0x2e')]['length']?_0x146350[_0xf350('0x2e')]:_0x1770e7[_0xf350('0x29')];if(!_0x2b7228[_0xf350('0x2b')][_0xf350('0x30')](_0xf350('0x31'))){_0x146350[_0xf350('0x19')]=qs[_0xf350('0x19')](_0x2b7228[_0xf350('0x2b')][_0xf350('0x19')]);_0x146350[_0xf350('0x18')]=qs[_0xf350('0x18')](_0x2b7228[_0xf350('0x2b')][_0xf350('0x18')]);}_0x146350[_0xf350('0x32')]=qs['sort'](_0x2b7228[_0xf350('0x2b')]['sort']);_0x146350[_0xf350('0x33')]=qs[_0xf350('0x2c')](_[_0xf350('0x34')](_0x2b7228['query'],_0x1770e7[_0xf350('0x2c')]));if(_0x2b7228[_0xf350('0x2b')][_0xf350('0x35')]){_0x146350[_0xf350('0x33')]=_[_0xf350('0x36')](_0x146350[_0xf350('0x33')],{'$or':_['map'](_0x57ca3e,function(_0x35d25a){if(_0x35d25a['type']!=='VIRTUAL'){var _0x5c5ef0={};_0x5c5ef0[_0x35d25a[_0xf350('0x23')]]={'$like':'%'+_0x2b7228[_0xf350('0x2b')][_0xf350('0x35')]+'%'};return _0x5c5ef0;}})});}_0x146350=_[_0xf350('0x36')]({},_0x146350,_0x2b7228[_0xf350('0x37')]);var _0x148951={'where':_0x146350['where']};return db['OpenchannelApplication'][_0xf350('0x38')](_0x148951)['then'](function(_0xd8538b){_0x2a01a2[_0xf350('0x38')]=_0xd8538b;if(_0x2b7228[_0xf350('0x2b')][_0xf350('0x39')]){_0x146350[_0xf350('0x3a')]=[{'all':!![]}];}return db[_0xf350('0x26')][_0xf350('0x3b')](_0x146350);})[_0xf350('0x1f')](function(_0x57441d){_0x2a01a2[_0xf350('0x3c')]=_0x57441d;return _0x2a01a2;})['then'](respondWithFilteredResult(_0x472311,_0x146350))['catch'](handleError(_0x472311,null));};exports[_0xf350('0x3d')]=function(_0x5a409d,_0x2d9c41){var _0x14107d={'raw':!![],'where':{'id':_0x5a409d[_0xf350('0x3e')]['id']}},_0xb9b3a5={};_0xb9b3a5[_0xf350('0x29')]=_[_0xf350('0x2a')](db[_0xf350('0x26')]['rawAttributes']);_0xb9b3a5[_0xf350('0x2b')]=_[_0xf350('0x2a')](_0x5a409d[_0xf350('0x2b')]);_0xb9b3a5['filters']=_[_0xf350('0x2d')](_0xb9b3a5[_0xf350('0x29')],_0xb9b3a5['query']);_0x14107d[_0xf350('0x2e')]=_[_0xf350('0x2d')](_0xb9b3a5[_0xf350('0x29')],qs[_0xf350('0x2f')](_0x5a409d[_0xf350('0x2b')][_0xf350('0x2f')]));_0x14107d[_0xf350('0x2e')]=_0x14107d[_0xf350('0x2e')]['length']?_0x14107d[_0xf350('0x2e')]:_0xb9b3a5[_0xf350('0x29')];if(_0x5a409d[_0xf350('0x2b')][_0xf350('0x39')]){_0x14107d['include']=[{'all':!![]}];}_0x14107d=_[_0xf350('0x36')]({},_0x14107d,_0x5a409d[_0xf350('0x37')]);return db[_0xf350('0x26')]['find'](_0x14107d)[_0xf350('0x1f')](handleEntityNotFound(_0x2d9c41,null))['then'](respondWithResult(_0x2d9c41,null))[_0xf350('0x3f')](handleError(_0x2d9c41,null));};exports[_0xf350('0x40')]=function(_0x489b70,_0x4667e0){return db[_0xf350('0x26')][_0xf350('0x40')](_0x489b70[_0xf350('0x41')],{})[_0xf350('0x1f')](respondWithResult(_0x4667e0,0xc9))[_0xf350('0x3f')](handleError(_0x4667e0,null));};exports[_0xf350('0x1e')]=function(_0x421eee,_0x3deddd){if(_0x421eee[_0xf350('0x41')]['id']){delete _0x421eee['body']['id'];}return db[_0xf350('0x26')]['find']({'where':{'id':_0x421eee['params']['id']}})[_0xf350('0x1f')](handleEntityNotFound(_0x3deddd,null))[_0xf350('0x1f')](saveUpdates(_0x421eee[_0xf350('0x41')],null))[_0xf350('0x1f')](respondWithResult(_0x3deddd,null))[_0xf350('0x3f')](handleError(_0x3deddd,null));};exports[_0xf350('0x42')]=function(_0x91e83c,_0x446d83){return db[_0xf350('0x26')][_0xf350('0x43')]({'where':{'id':_0x91e83c['params']['id']}})[_0xf350('0x1f')](handleEntityNotFound(_0x446d83,null))[_0xf350('0x1f')](removeEntity(_0x446d83,null))[_0xf350('0x3f')](handleError(_0x446d83,null));}; \ No newline at end of file +var _0x027c=['status','count','offset','apply','reject','update','then','destroy','end','stack','name','index','map','OpenchannelApplication','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x027c,0x74));var _0xc027=function(_0x1be13e,_0x4bc8b1){_0x1be13e=_0x1be13e-0x0;var _0x46fff8=_0x027c[_0x1be13e];return _0x46fff8;};'use strict';var pdf=require(_0xc027('0x0'));var emlformat=require(_0xc027('0x1'));var rimraf=require(_0xc027('0x2'));var zipdir=require(_0xc027('0x3'));var jsonpatch=require(_0xc027('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc027('0x5'));var Mustache=require(_0xc027('0x6'));var util=require(_0xc027('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc027('0x8'));var fs=require('fs');var _=require(_0xc027('0x9'));var squel=require(_0xc027('0xa'));var crypto=require(_0xc027('0xb'));var jsforce=require(_0xc027('0xc'));var deskjs=require(_0xc027('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc027('0xe'));var Papa=require(_0xc027('0xf'));var Redis=require(_0xc027('0x10'));var authService=require(_0xc027('0x11'));var qs=require(_0xc027('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc027('0x13'));var logger=require(_0xc027('0x14'))(_0xc027('0x15'));var utils=require(_0xc027('0x16'));var config=require(_0xc027('0x17'));var db=require(_0xc027('0x18'))['db'];function respondWithStatusCode(_0x35e7eb,_0x21354a){_0x21354a=_0x21354a||0xcc;return function(_0x47c2fd){if(_0x47c2fd){return _0x35e7eb[_0xc027('0x19')](_0x21354a);}return _0x35e7eb[_0xc027('0x1a')](_0x21354a)['end']();};}function respondWithResult(_0x2d56f6,_0x318ef4){_0x318ef4=_0x318ef4||0xc8;return function(_0x50826e){if(_0x50826e){return _0x2d56f6[_0xc027('0x1a')](_0x318ef4)['json'](_0x50826e);}};}function respondWithFilteredResult(_0x3f1d45,_0x464f7b){return function(_0x342cae){if(_0x342cae){var _0x15894f=_0x342cae[_0xc027('0x1b')],_0x4f5849=_0x464f7b[_0xc027('0x1c')],_0x4be8cd=_0x464f7b[_0xc027('0x1c')]+_0x464f7b['limit'],_0x312de0;if(_0x4be8cd>=_0x15894f){_0x4be8cd=_0x15894f;_0x312de0=0xc8;}else{_0x312de0=0xce;}_0x3f1d45[_0xc027('0x1a')](_0x312de0);return _0x3f1d45['set']('Content-Range',_0x4f5849+'-'+_0x4be8cd+'/'+_0x15894f)['json'](_0x342cae);}return null;};}function patchUpdates(_0x146560){return function(_0x5cc1f7){try{jsonpatch[_0xc027('0x1d')](_0x5cc1f7,_0x146560,!![]);}catch(_0x555cf0){return BPromise[_0xc027('0x1e')](_0x555cf0);}return _0x5cc1f7['save']();};}function saveUpdates(_0x3b0e4b,_0x58eb90){return function(_0x22a56b){if(_0x22a56b){return _0x22a56b[_0xc027('0x1f')](_0x3b0e4b)[_0xc027('0x20')](function(_0x47ebc9){return _0x47ebc9;});}return null;};}function removeEntity(_0x118e56,_0x403cb3){return function(_0xaf2985){if(_0xaf2985){return _0xaf2985[_0xc027('0x21')]()[_0xc027('0x20')](function(){_0x118e56['status'](0xcc)[_0xc027('0x22')]();});}};}function handleEntityNotFound(_0x4be2ac,_0x479562){return function(_0x14bf3a){if(!_0x14bf3a){_0x4be2ac[_0xc027('0x19')](0x194);}return _0x14bf3a;};}function handleError(_0x56fd30,_0x2cc971){_0x2cc971=_0x2cc971||0x1f4;return function(_0x5d82d2){logger['error'](_0x5d82d2[_0xc027('0x23')]);if(_0x5d82d2[_0xc027('0x24')]){delete _0x5d82d2[_0xc027('0x24')];}_0x56fd30[_0xc027('0x1a')](_0x2cc971)['send'](_0x5d82d2);};}exports[_0xc027('0x25')]=function(_0xfa316a,_0x137ef5){var _0x5b1712={},_0x4ca2a9={},_0x427350={'count':0x0,'rows':[]};var _0x21c91a=_[_0xc027('0x26')](db[_0xc027('0x27')][_0xc027('0x28')],function(_0x54427a){return{'name':_0x54427a[_0xc027('0x29')],'type':_0x54427a[_0xc027('0x2a')]['key']};});_0x4ca2a9[_0xc027('0x2b')]=_['map'](_0x21c91a,_0xc027('0x24'));_0x4ca2a9[_0xc027('0x2c')]=_['keys'](_0xfa316a[_0xc027('0x2c')]);_0x4ca2a9[_0xc027('0x2d')]=_[_0xc027('0x2e')](_0x4ca2a9[_0xc027('0x2b')],_0x4ca2a9[_0xc027('0x2c')]);_0x5b1712[_0xc027('0x2f')]=_[_0xc027('0x2e')](_0x4ca2a9[_0xc027('0x2b')],qs[_0xc027('0x30')](_0xfa316a[_0xc027('0x2c')][_0xc027('0x30')]));_0x5b1712['attributes']=_0x5b1712['attributes'][_0xc027('0x31')]?_0x5b1712[_0xc027('0x2f')]:_0x4ca2a9[_0xc027('0x2b')];if(!_0xfa316a[_0xc027('0x2c')][_0xc027('0x32')](_0xc027('0x33'))){_0x5b1712[_0xc027('0x34')]=qs['limit'](_0xfa316a[_0xc027('0x2c')][_0xc027('0x34')]);_0x5b1712[_0xc027('0x1c')]=qs[_0xc027('0x1c')](_0xfa316a[_0xc027('0x2c')][_0xc027('0x1c')]);}_0x5b1712['order']=qs['sort'](_0xfa316a[_0xc027('0x2c')][_0xc027('0x35')]);_0x5b1712[_0xc027('0x36')]=qs[_0xc027('0x2d')](_[_0xc027('0x37')](_0xfa316a[_0xc027('0x2c')],_0x4ca2a9['filters']));if(_0xfa316a[_0xc027('0x2c')][_0xc027('0x38')]){_0x5b1712[_0xc027('0x36')]=_[_0xc027('0x39')](_0x5b1712[_0xc027('0x36')],{'$or':_['map'](_0x21c91a,function(_0x3e90f8){if(_0x3e90f8[_0xc027('0x2a')]!==_0xc027('0x3a')){var _0x1c3f8f={};_0x1c3f8f[_0x3e90f8[_0xc027('0x24')]]={'$like':'%'+_0xfa316a[_0xc027('0x2c')][_0xc027('0x38')]+'%'};return _0x1c3f8f;}})});}_0x5b1712=_[_0xc027('0x39')]({},_0x5b1712,_0xfa316a[_0xc027('0x3b')]);var _0x9b47fa={'where':_0x5b1712[_0xc027('0x36')]};return db[_0xc027('0x27')][_0xc027('0x1b')](_0x9b47fa)['then'](function(_0x2e09cf){_0x427350[_0xc027('0x1b')]=_0x2e09cf;if(_0xfa316a[_0xc027('0x2c')][_0xc027('0x3c')]){_0x5b1712[_0xc027('0x3d')]=[{'all':!![]}];}return db[_0xc027('0x27')][_0xc027('0x3e')](_0x5b1712);})[_0xc027('0x20')](function(_0x2fc82a){_0x427350[_0xc027('0x3f')]=_0x2fc82a;return _0x427350;})['then'](respondWithFilteredResult(_0x137ef5,_0x5b1712))[_0xc027('0x40')](handleError(_0x137ef5,null));};exports[_0xc027('0x41')]=function(_0xff7c79,_0x2fccf6){var _0x139a1e={'raw':!![],'where':{'id':_0xff7c79[_0xc027('0x42')]['id']}},_0x5d79c9={};_0x5d79c9[_0xc027('0x2b')]=_[_0xc027('0x43')](db[_0xc027('0x27')]['rawAttributes']);_0x5d79c9[_0xc027('0x2c')]=_['keys'](_0xff7c79[_0xc027('0x2c')]);_0x5d79c9[_0xc027('0x2d')]=_[_0xc027('0x2e')](_0x5d79c9[_0xc027('0x2b')],_0x5d79c9[_0xc027('0x2c')]);_0x139a1e[_0xc027('0x2f')]=_['intersection'](_0x5d79c9['model'],qs[_0xc027('0x30')](_0xff7c79['query']['fields']));_0x139a1e[_0xc027('0x2f')]=_0x139a1e['attributes']['length']?_0x139a1e[_0xc027('0x2f')]:_0x5d79c9['model'];if(_0xff7c79[_0xc027('0x2c')][_0xc027('0x3c')]){_0x139a1e[_0xc027('0x3d')]=[{'all':!![]}];}_0x139a1e=_[_0xc027('0x39')]({},_0x139a1e,_0xff7c79[_0xc027('0x3b')]);return db[_0xc027('0x27')][_0xc027('0x44')](_0x139a1e)[_0xc027('0x20')](handleEntityNotFound(_0x2fccf6,null))[_0xc027('0x20')](respondWithResult(_0x2fccf6,null))[_0xc027('0x40')](handleError(_0x2fccf6,null));};exports['create']=function(_0x50de6a,_0x230449){return db['OpenchannelApplication'][_0xc027('0x45')](_0x50de6a[_0xc027('0x46')],{})[_0xc027('0x20')](respondWithResult(_0x230449,0xc9))[_0xc027('0x40')](handleError(_0x230449,null));};exports['update']=function(_0xcb345,_0x56829b){if(_0xcb345[_0xc027('0x46')]['id']){delete _0xcb345[_0xc027('0x46')]['id'];}return db['OpenchannelApplication'][_0xc027('0x44')]({'where':{'id':_0xcb345['params']['id']}})[_0xc027('0x20')](handleEntityNotFound(_0x56829b,null))[_0xc027('0x20')](saveUpdates(_0xcb345['body'],null))['then'](respondWithResult(_0x56829b,null))[_0xc027('0x40')](handleError(_0x56829b,null));};exports[_0xc027('0x21')]=function(_0x2dcf18,_0x5f1399){return db[_0xc027('0x27')][_0xc027('0x44')]({'where':{'id':_0x2dcf18[_0xc027('0x42')]['id']}})['then'](handleEntityNotFound(_0x5f1399,null))[_0xc027('0x20')](removeEntity(_0x5f1399,null))[_0xc027('0x40')](handleError(_0x5f1399,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 3771135..756a4fc 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 _0xd420=['rimraf','./openchannelApplication.attributes','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','request-promise','path'];(function(_0x212bdd,_0x1003ec){var _0x45b639=function(_0xf2c2ff){while(--_0xf2c2ff){_0x212bdd['push'](_0x212bdd['shift']());}};_0x45b639(++_0x1003ec);}(_0xd420,0x1db));var _0x0d42=function(_0x4ae954,_0x4dcda3){_0x4ae954=_0x4ae954-0x0;var _0x175b48=_0xd420[_0x4ae954];return _0x175b48;};'use strict';var _=require(_0x0d42('0x0'));var util=require('util');var logger=require(_0x0d42('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0d42('0x2'));var rp=require(_0x0d42('0x3'));var fs=require('fs');var path=require(_0x0d42('0x4'));var rimraf=require(_0x0d42('0x5'));var config=require('../../config/environment');var attributes=require(_0x0d42('0x6'));module['exports']=function(_0x43b772,_0x2baa7d){return _0x43b772['define']('OpenchannelApplication',attributes,{'tableName':_0x0d42('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0d42('0x8'),'collate':_0x0d42('0x9')});}; \ No newline at end of file +var _0x55e1=['../../config/logger','api','path','../../config/environment','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash','util'];(function(_0xeaf9e4,_0x344e29){var _0x930005=function(_0x14ebb7){while(--_0x14ebb7){_0xeaf9e4['push'](_0xeaf9e4['shift']());}};_0x930005(++_0x344e29);}(_0x55e1,0xa3));var _0x155e=function(_0x93ed48,_0x34877e){_0x93ed48=_0x93ed48-0x0;var _0x34ab46=_0x55e1[_0x93ed48];return _0x34ab46;};'use strict';var _=require(_0x155e('0x0'));var util=require(_0x155e('0x1'));var logger=require(_0x155e('0x2'))(_0x155e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x155e('0x4'));var rimraf=require('rimraf');var config=require(_0x155e('0x5'));var attributes=require('./openchannelApplication.attributes');module[_0x155e('0x6')]=function(_0x2d1840,_0x1002c6){return _0x2d1840[_0x155e('0x7')](_0x155e('0x8'),attributes,{'tableName':_0x155e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x155e('0xa')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 78e62a6..20502e0 100644 --- a/server/api/openchannelApplication/openchannelApplication.rpc.js +++ b/server/api/openchannelApplication/openchannelApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x485ec0,_0x4c1c93){var _0x12cb19=function(_0x2b4941){while(--_0x2b4941){_0x485ec0['push'](_0x485ec0['shift']());}};_0x12cb19(++_0x4c1c93);}(_0xb10b,0x12a));var _0xbb10=function(_0x565de9,_0x114287){_0x565de9=_0x565de9-0x0;var _0x5f5dab=_0xb10b[_0x565de9];return _0x5f5dab;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});}; \ No newline at end of file +var _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x292434,_0x9a1d0e){var _0x3cce65=function(_0x393f00){while(--_0x393f00){_0x292434['push'](_0x292434['shift']());}};_0x3cce65(++_0x9a1d0e);}(_0xb10b,0x12a));var _0xbb10=function(_0x19a2eb,_0x2df439){_0x19a2eb=_0x19a2eb-0x0;var _0x3c8514=_0xb10b[_0x19a2eb];return _0x3c8514;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 51d9671..c5c8fe8 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 _0x652b=['/describe','isAuthenticated','/:id','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','removeTags','exports','multer','path','connect-timeout','Router','../../config/environment','get','index'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x652b,0x149));var _0xb652=function(_0xa388a2,_0x40bde6){_0xa388a2=_0xa388a2-0x0;var _0x7ce7f6=_0x652b[_0xa388a2];return _0x7ce7f6;};'use strict';var multer=require(_0xb652('0x0'));var util=require('util');var path=require(_0xb652('0x1'));var timeout=require(_0xb652('0x2'));var express=require('express');var router=express[_0xb652('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb652('0x4'));var controller=require('./openchannelInteraction.controller');router[_0xb652('0x5')]('/',auth['isAuthenticated'](),controller[_0xb652('0x6')]);router['get'](_0xb652('0x7'),auth[_0xb652('0x8')](),controller['describe']);router[_0xb652('0x5')](_0xb652('0x9'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router['get'](_0xb652('0xa'),auth[_0xb652('0x8')](),controller[_0xb652('0xb')]);router[_0xb652('0xc')]('/',auth[_0xb652('0x8')](),controller[_0xb652('0xd')]);router['post'](_0xb652('0xe'),auth[_0xb652('0x8')](),controller[_0xb652('0xf')]);router[_0xb652('0xc')](_0xb652('0x10'),auth[_0xb652('0x8')](),interaction[_0xb652('0x11')](_0xb652('0x12'),_0xb652('0x13')),controller[_0xb652('0x14')]);router[_0xb652('0x15')](_0xb652('0x9'),auth[_0xb652('0x8')](),interaction[_0xb652('0x11')](_0xb652('0x12'),_0xb652('0x16')),controller[_0xb652('0x17')]);router[_0xb652('0x18')](_0xb652('0x9'),auth[_0xb652('0x8')](),interaction[_0xb652('0x11')](_0xb652('0x12'),_0xb652('0x19')),controller['destroy']);router[_0xb652('0x18')](_0xb652('0x10'),auth['isAuthenticated'](),controller[_0xb652('0x1a')]);module[_0xb652('0x1b')]=router; \ No newline at end of file +var _0x73dc=['post','create','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','get','describe','/:id','/:id/messages','getMessages','/:id/download'];(function(_0x94dec5,_0x2f29f9){var _0x1c19d8=function(_0x225635){while(--_0x225635){_0x94dec5['push'](_0x94dec5['shift']());}};_0x1c19d8(++_0x2f29f9);}(_0x73dc,0xdf));var _0xc73d=function(_0x33314d,_0x499628){_0x33314d=_0x33314d-0x0;var _0x4ffe8e=_0x73dc[_0x33314d];return _0x4ffe8e;};'use strict';var multer=require(_0xc73d('0x0'));var util=require(_0xc73d('0x1'));var path=require(_0xc73d('0x2'));var timeout=require(_0xc73d('0x3'));var express=require('express');var router=express[_0xc73d('0x4')]();var auth=require(_0xc73d('0x5'));var interaction=require(_0xc73d('0x6'));var config=require(_0xc73d('0x7'));var controller=require(_0xc73d('0x8'));router['get']('/',auth[_0xc73d('0x9')](),controller[_0xc73d('0xa')]);router[_0xc73d('0xb')]('/describe',auth['isAuthenticated'](),controller[_0xc73d('0xc')]);router['get'](_0xc73d('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0xc73d('0xe'),auth[_0xc73d('0x9')](),controller[_0xc73d('0xf')]);router[_0xc73d('0xb')](_0xc73d('0x10'),auth[_0xc73d('0x9')](),controller['download']);router[_0xc73d('0x11')]('/',auth[_0xc73d('0x9')](),controller[_0xc73d('0x12')]);router[_0xc73d('0x11')](_0xc73d('0xe'),auth[_0xc73d('0x9')](),controller['addMessage']);router[_0xc73d('0x11')](_0xc73d('0x13'),auth[_0xc73d('0x9')](),interaction[_0xc73d('0x14')](_0xc73d('0x15'),_0xc73d('0x16')),controller['addTags']);router['put'](_0xc73d('0xd'),auth[_0xc73d('0x9')](),interaction[_0xc73d('0x14')]('openchannel',_0xc73d('0x17')),controller[_0xc73d('0x18')]);router[_0xc73d('0x19')]('/:id',auth[_0xc73d('0x9')](),interaction[_0xc73d('0x14')](_0xc73d('0x15'),_0xc73d('0x1a')),controller[_0xc73d('0x1b')]);router['delete'](_0xc73d('0x13'),auth[_0xc73d('0x9')](),controller[_0xc73d('0x1c')]);module[_0xc73d('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index dbeb7d0..d5523ce 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 _0x4709=['DATE','STRING','sequelize'];(function(_0x11d460,_0x54a609){var _0x4f22aa=function(_0x28e891){while(--_0x28e891){_0x11d460['push'](_0x11d460['shift']());}};_0x4f22aa(++_0x54a609);}(_0x4709,0x155));var _0x9470=function(_0x4dec17,_0x1b81f2){_0x4dec17=_0x4dec17-0x0;var _0x344c7f=_0x4709[_0x4dec17];return _0x344c7f;};'use strict';var Sequelize=require(_0x9470('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9470('0x1')]},'disposition':{'type':Sequelize[_0x9470('0x2')]},'note':{'type':Sequelize[_0x9470('0x2')]},'read1stAt':{'type':Sequelize[_0x9470('0x1')]},'threadId':{'type':Sequelize[_0x9470('0x2')]},'externalUrl':{'type':Sequelize[_0x9470('0x2')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x9470('0x2')]}}; \ No newline at end of file +var _0xf76c=['ENUM','out','sequelize','BOOLEAN','STRING'];(function(_0x349ca6,_0x53c8cc){var _0x33f815=function(_0x3f46f2){while(--_0x3f46f2){_0x349ca6['push'](_0x349ca6['shift']());}};_0x33f815(++_0x53c8cc);}(_0xf76c,0x165));var _0xcf76=function(_0x27cb3f,_0x115c87){_0x27cb3f=_0x27cb3f-0x0;var _0x2ff90c=_0xf76c[_0x27cb3f];return _0x2ff90c;};'use strict';var Sequelize=require(_0xcf76('0x0'));module['exports']={'closed':{'type':Sequelize[_0xcf76('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xcf76('0x2')]},'note':{'type':Sequelize[_0xcf76('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xcf76('0x2')]},'externalUrl':{'type':Sequelize[_0xcf76('0x2')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xcf76('0x3')]('in',_0xcf76('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 4f24e98..085afbf 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 _0x5f1a=['key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','field','name','tools_tags','u.fullname','from','user_has_openchannel_interactions','users','u.id\x20=\x20ui.UserId','select','openchannel_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','start','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','keys','some','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','t.id\x20IN\x20?','journey','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','count','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','push','all','rows','show','params','include','merge','create','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','pick','format','options','includeAll','addTags','setTags','Tag','findAll','color','openchannelInteractionTags:save','removeTags','unix','join','root','files','tmp','attachments','CmContact','firstName','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','get','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
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','Openchannel','YYYY-MM-DD','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','threadId','Public','Private','basename','existsSync','createWriteStream','out','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','json','offset','set','Content-Range','apply','save','destroy','then','end','error','stack','send','Users','fullname','TagIds','Tags','split','catch','index','OpenchannelInteraction','rawAttributes','fieldName'];(function(_0x4008f0,_0x17f1b2){var _0xb42e88=function(_0xd8382b){while(--_0xd8382b){_0x4008f0['push'](_0x4008f0['shift']());}};_0xb42e88(++_0x17f1b2);}(_0x5f1a,0xbc));var _0xa5f1=function(_0x280f55,_0x5066b4){_0x280f55=_0x280f55-0x0;var _0x30dc1f=_0x5f1a[_0x280f55];return _0x30dc1f;};'use strict';var pdf=require(_0xa5f1('0x0'));var emlformat=require(_0xa5f1('0x1'));var rimraf=require(_0xa5f1('0x2'));var zipdir=require(_0xa5f1('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa5f1('0x4'));var BPromise=require(_0xa5f1('0x5'));var Mustache=require(_0xa5f1('0x6'));var util=require(_0xa5f1('0x7'));var path=require(_0xa5f1('0x8'));var sox=require(_0xa5f1('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xa5f1('0xa'));var squel=require(_0xa5f1('0xb'));var crypto=require(_0xa5f1('0xc'));var jsforce=require(_0xa5f1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa5f1('0xe'));var querystring=require(_0xa5f1('0xf'));var Papa=require(_0xa5f1('0x10'));var Redis=require(_0xa5f1('0x11'));var authService=require(_0xa5f1('0x12'));var qs=require(_0xa5f1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa5f1('0x14'));var logger=require(_0xa5f1('0x15'))('api');var utils=require(_0xa5f1('0x16'));var config=require('../../config/environment');var db=require(_0xa5f1('0x17'))['db'];config[_0xa5f1('0x18')]=_['defaults'](config[_0xa5f1('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xa5f1('0x19'))(new Redis(config[_0xa5f1('0x18')]));require('./openchannelInteraction.socket')[_0xa5f1('0x1a')](socket);function respondWithStatusCode(_0x4517e2,_0x55b40e){_0x55b40e=_0x55b40e||0xcc;return function(_0x2f9a20){if(_0x2f9a20){return _0x4517e2[_0xa5f1('0x1b')](_0x55b40e);}return _0x4517e2[_0xa5f1('0x1c')](_0x55b40e)['end']();};}function respondWithResult(_0x1c2ff3,_0x260b7a){_0x260b7a=_0x260b7a||0xc8;return function(_0x40565e){if(_0x40565e){return _0x1c2ff3[_0xa5f1('0x1c')](_0x260b7a)[_0xa5f1('0x1d')](_0x40565e);}};}function respondWithFilteredResult(_0x434826,_0x459c56){return function(_0x31e586){if(_0x31e586){var _0x3ed87a=_0x31e586['count'],_0x4cf88a=_0x459c56[_0xa5f1('0x1e')],_0x458208=_0x459c56[_0xa5f1('0x1e')]+_0x459c56['limit'],_0x58de8e;if(_0x458208>=_0x3ed87a){_0x458208=_0x3ed87a;_0x58de8e=0xc8;}else{_0x58de8e=0xce;}_0x434826[_0xa5f1('0x1c')](_0x58de8e);return _0x434826[_0xa5f1('0x1f')](_0xa5f1('0x20'),_0x4cf88a+'-'+_0x458208+'/'+_0x3ed87a)[_0xa5f1('0x1d')](_0x31e586);}return null;};}function patchUpdates(_0x4fdc1b){return function(_0x4153dc){try{jsonpatch[_0xa5f1('0x21')](_0x4153dc,_0x4fdc1b,!![]);}catch(_0x376cdf){return BPromise['reject'](_0x376cdf);}return _0x4153dc[_0xa5f1('0x22')]();};}function saveUpdates(_0x20f2b2,_0x4d76bf){return function(_0x32c47d){if(_0x32c47d){return _0x32c47d['update'](_0x20f2b2)['then'](function(_0x1233d1){return _0x1233d1;});}return null;};}function removeEntity(_0x198f45,_0x39fc91){return function(_0x13dff1){if(_0x13dff1){return _0x13dff1[_0xa5f1('0x23')]()[_0xa5f1('0x24')](function(){_0x198f45[_0xa5f1('0x1c')](0xcc)[_0xa5f1('0x25')]();});}};}function handleEntityNotFound(_0x10205c,_0x25aad0){return function(_0x57a9ae){if(!_0x57a9ae){_0x10205c['sendStatus'](0x194);}return _0x57a9ae;};}function handleError(_0x243dc3,_0x4e708e){_0x4e708e=_0x4e708e||0x1f4;return function(_0x280df9){logger[_0xa5f1('0x26')](_0x280df9[_0xa5f1('0x27')]);if(_0x280df9['name']){delete _0x280df9['name'];}_0x243dc3['status'](_0x4e708e)[_0xa5f1('0x28')](_0x280df9);};}function getInteractionUsers(_0x10e2f1,_0x4d594e){return new BPromise(function(_0x5ca14d,_0x17d776){try{if(_0x4d594e[_0x10e2f1['id']]){_0x10e2f1[_0xa5f1('0x29')]=_['map'](_0x4d594e[_0x10e2f1['id']],function(_0x5aec7d){return{'id':_0x5aec7d['id'],'fullname':_0x5aec7d[_0xa5f1('0x2a')]};});}}catch(_0x3c1bc5){_0x17d776(_0x3c1bc5);}_0x5ca14d(_0x10e2f1);});}function getInteractionTags(_0x519e3c,_0x56ebf7){return new BPromise(function(_0x302d6b,_0x5c801a){try{if(_0x519e3c[_0xa5f1('0x2b')]){_0x519e3c[_0xa5f1('0x2c')]=[];_0x519e3c['TagIds'][_0xa5f1('0x2d')](',')['forEach'](function(_0x58d924){_0x519e3c[_0xa5f1('0x2c')]['push'](_0x56ebf7[_0x58d924]);});}delete _0x519e3c['TagIds'];}catch(_0x52f104){_0x5c801a(_0x52f104);}_0x302d6b(_0x519e3c);});}function updateOpenchannelInteraction(_0xa980ba,_0x48f3f5,_0x5eb92f){return new BPromise(function(_0x246814,_0x1c01f9){return getInteractionUsers(_0xa980ba,_0x5eb92f)[_0xa5f1('0x24')](function(_0x273557){return getInteractionTags(_0x273557,_0x48f3f5);})['then'](function(_0xa56803){_0x246814(_0xa56803);})[_0xa5f1('0x2e')](function(_0x387825){_0x1c01f9(_0x387825);});});}exports[_0xa5f1('0x2f')]=function(_0x2f0549,_0x5dd402){var _0x1c3dc9={},_0x198c9b={},_0x417750={'count':0x0,'rows':[]};var _0x59d6ef=_['map'](db[_0xa5f1('0x30')][_0xa5f1('0x31')],function(_0x9708c8){return{'name':_0x9708c8[_0xa5f1('0x32')],'type':_0x9708c8['type'][_0xa5f1('0x33')]};});_0x198c9b[_0xa5f1('0x34')]=_[_0xa5f1('0x35')](_0x59d6ef,'name');_0x198c9b[_0xa5f1('0x36')]=_['keys'](_0x2f0549[_0xa5f1('0x36')]);_0x198c9b[_0xa5f1('0x37')]=_[_0xa5f1('0x38')](_0x198c9b['model'],_0x198c9b['query']);_0x1c3dc9[_0xa5f1('0x39')]=_[_0xa5f1('0x38')](_0x198c9b[_0xa5f1('0x34')],qs[_0xa5f1('0x3a')](_0x2f0549['query'][_0xa5f1('0x3a')]));_0x1c3dc9[_0xa5f1('0x39')]=_0x1c3dc9[_0xa5f1('0x39')][_0xa5f1('0x3b')]?_0x1c3dc9['attributes']:_0x198c9b[_0xa5f1('0x34')];if(!_0x2f0549[_0xa5f1('0x36')][_0xa5f1('0x3c')](_0xa5f1('0x3d'))){_0x1c3dc9[_0xa5f1('0x3e')]=qs[_0xa5f1('0x3e')](_0x2f0549[_0xa5f1('0x36')][_0xa5f1('0x3e')]);_0x1c3dc9[_0xa5f1('0x1e')]=qs[_0xa5f1('0x1e')](_0x2f0549[_0xa5f1('0x36')][_0xa5f1('0x1e')]);}_0x1c3dc9[_0xa5f1('0x3f')]=qs[_0xa5f1('0x40')](_0x2f0549[_0xa5f1('0x36')]['sort']);_0x1c3dc9[_0xa5f1('0x41')]=qs[_0xa5f1('0x37')](_['pick'](_0x2f0549[_0xa5f1('0x36')],_0x198c9b['filters']));var _0xa28248=[];var _0x2de375=squel['select']()[_0xa5f1('0x42')]('id')['field'](_0xa5f1('0x43'))[_0xa5f1('0x42')]('color')['from'](_0xa5f1('0x44'));var _0x191319=squel['select']()['field']('u.id')[_0xa5f1('0x42')](_0xa5f1('0x45'))[_0xa5f1('0x42')]('ui.OpenchannelInteractionId')[_0xa5f1('0x46')](_0xa5f1('0x47'),'ui')['left_join'](_0xa5f1('0x48'),'u',_0xa5f1('0x49'));var _0xc32f35=squel[_0xa5f1('0x4a')]()[_0xa5f1('0x46')](_0xa5f1('0x4b'),'i')[_0xa5f1('0x4c')]('cm_contacts','c',_0xa5f1('0x4d'))[_0xa5f1('0x4c')]('users','o','o.id\x20=\x20i.UserId')[_0xa5f1('0x4c')](_0xa5f1('0x4e'),'a',_0xa5f1('0x4f'))[_0xa5f1('0x4c')](_0xa5f1('0x50'),'me',_0xa5f1('0x51'))[_0xa5f1('0x4c')](_0xa5f1('0x52'),'it','it.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0xa5f1('0x44'),'t',_0xa5f1('0x53'));var _0x594fc3=squel[_0xa5f1('0x54')]();var _0x62ac38=[];var _0x49220a=squel[_0xa5f1('0x54')]();var _0x4e9c9e;if(_0x2f0549[_0xa5f1('0x36')][_0xa5f1('0x55')]){_0x4e9c9e=as[_0xa5f1('0x56')](_0x2f0549[_0xa5f1('0x36')][_0xa5f1('0x55')]);var _0x95dded=_0x4e9c9e[_0xa5f1('0x57')];for(var _0x5a52d3=0x0;_0x5a52d3<_0x4e9c9e['conditions'][_0xa5f1('0x3b')];_0x5a52d3++){var _0x8bde2d=_0x4e9c9e[_0xa5f1('0x58')][_0x5a52d3];var _0x254369='i';var _0x5e13b2=_[_0xa5f1('0x59')](_0x59d6ef,[_0xa5f1('0x43'),_0x8bde2d[_0xa5f1('0x42')]]);if(!_0x5e13b2){switch(_0x8bde2d['field']){case'unreadMessages':if(_0x8bde2d[_0xa5f1('0x5a')]==0x1){_0xc32f35[_0xa5f1('0x5b')]('`'+_0x8bde2d[_0xa5f1('0x42')]+'`\x20=\x200');}else{_0xc32f35[_0xa5f1('0x5b')]('`'+_0x8bde2d[_0xa5f1('0x42')]+_0xa5f1('0x5c'));}break;case _0xa5f1('0x5d'):if(_0x8bde2d[_0xa5f1('0x5e')]==='$substring'){if(_0x8bde2d[_0xa5f1('0x5a')]['split']('\x20')[_0xa5f1('0x3b')]>0x1){_0x594fc3[_0x95dded](_0xa5f1('0x5f'),qs['getFullTextValue'](_0x8bde2d['value']),null);}else{var _0x29c83c='%'+_0x8bde2d[_0xa5f1('0x5a')]+'%';_0x594fc3[_0x95dded](_0xa5f1('0x60'),_0x29c83c,_0x29c83c,_0x29c83c);}}else{_0x5e13b2=_['find'](_0x59d6ef,['name',_0xa5f1('0x61')]);_0x8bde2d[_0xa5f1('0x42')]=_0xa5f1('0x61');_0x36315b=as[_0xa5f1('0x62')](_0x254369,_0x5e13b2[_0xa5f1('0x63')],_0x8bde2d);_0x594fc3[_0x95dded](_0x36315b['text'],_0x36315b[_0xa5f1('0x5a')][_0xa5f1('0x64')],_0x36315b['value'][_0xa5f1('0x25')]);}break;case'Tag':var _0x500261=_0x8bde2d['value'][_0xa5f1('0x2d')](',')[_0xa5f1('0x35')](function(_0x53033c){return Number(_0x53033c);});_0x500261[_0xa5f1('0x65')](function(_0x32bb84){_0x49220a['or'](_0xa5f1('0x66'),'%,'+_0x32bb84+',%');});_0x62ac38=_['union'](_0x62ac38,_0x500261);break;case _0xa5f1('0x67'):if(_0x8bde2d[_0xa5f1('0x5e')]===_0xa5f1('0x68')){_0x594fc3[_0x95dded](_0xa5f1('0x69'),'%'+_0x8bde2d[_0xa5f1('0x5a')]+'%',null);}else{_0x5e13b2=_[_0xa5f1('0x59')](_0x59d6ef,[_0xa5f1('0x43'),'UserId']);_0x8bde2d['field']=_0xa5f1('0x6a');_0x36315b=as[_0xa5f1('0x62')](_0x254369,_0x5e13b2[_0xa5f1('0x63')],_0x8bde2d);_0x594fc3[_0x95dded](_0x36315b[_0xa5f1('0x6b')],_0x36315b[_0xa5f1('0x5a')][_0xa5f1('0x64')],_0x36315b[_0xa5f1('0x5a')][_0xa5f1('0x25')]);}break;case _0xa5f1('0x6c'):_0x36315b=as[_0xa5f1('0x62')]('me',null,_0x8bde2d);_0x594fc3[_0x95dded](_0x36315b[_0xa5f1('0x6b')],_0x36315b[_0xa5f1('0x5a')]['start'],_0x36315b['value'][_0xa5f1('0x25')]);break;}}else{var _0x36315b=as[_0xa5f1('0x62')](_0x254369,_0x5e13b2[_0xa5f1('0x63')],_0x8bde2d);_0x594fc3[_0x95dded](_0x36315b['text'],_0x36315b['value']['start'],_0x36315b['value'][_0xa5f1('0x25')]);}}}else{var _0x428f22=_(_0x2f0549[_0xa5f1('0x36')])[_0xa5f1('0x6d')]()[_0xa5f1('0x35')](function(_0xf39846){return _[_0xa5f1('0x6e')](_0x59d6ef,[_0xa5f1('0x43'),_0xf39846])?_0xf39846:undefined;})['compact']()[_0xa5f1('0x5a')]();if(!_[_0xa5f1('0x6f')](_0x428f22)){_0x428f22[_0xa5f1('0x65')](function(_0x2bebaa){if(_0x2bebaa===_0xa5f1('0x70')){_0xc32f35[_0xa5f1('0x41')](_0xa5f1('0x71'),[]['concat'](_0x2f0549[_0xa5f1('0x36')][_0x2bebaa]));}else if(_0x2bebaa===_0xa5f1('0x72')){var _0x4ec535=JSON[_0xa5f1('0x73')](_0x2f0549[_0xa5f1('0x36')][_0x2bebaa])[_0xa5f1('0x74')];var _0x48f390=JSON[_0xa5f1('0x73')](_0x2f0549[_0xa5f1('0x36')][_0x2bebaa])[_0xa5f1('0x75')];_0xc32f35[_0xa5f1('0x41')](_0xa5f1('0x76'),_0x4ec535,_0x48f390);}else{if(_0x2f0549['query'][_0x2bebaa]==='null'){_0xc32f35[_0xa5f1('0x41')]('i.'+_0x2bebaa+_0xa5f1('0x77'));}else{_0xc32f35[_0xa5f1('0x41')]('i.'+_0x2bebaa+_0xa5f1('0x78'),_0x2f0549['query'][_0x2bebaa]);}}});}if(_0x2f0549['query']['read']){if(_0x2f0549[_0xa5f1('0x36')][_0xa5f1('0x79')]==0x1){_0xc32f35[_0xa5f1('0x5b')](_0xa5f1('0x7a'));}else{_0xc32f35[_0xa5f1('0x5b')](_0xa5f1('0x7b'));}}if(_0x2f0549['query']['tag']){_0x62ac38=_[_0xa5f1('0x7c')](_0x2f0549[_0xa5f1('0x36')]['tag'])?_0x2f0549[_0xa5f1('0x36')][_0xa5f1('0x7d')]:new Array(_0x2f0549[_0xa5f1('0x36')][_0xa5f1('0x7d')]);_0x62ac38['forEach'](function(_0x115cac){_0x49220a['or'](_0xa5f1('0x66'),'%,'+_0x115cac+',%');});}if(_0x2f0549['query'][_0xa5f1('0x7e')]){var _0xc5e51f=_0x2f0549[_0xa5f1('0x36')]['filter'][_0xa5f1('0x7f')]('\x5c','\x5c\x5c')[_0xa5f1('0x7f')]('\x27\x27',_0xa5f1('0x80'));if(qs['isNumeric'](_0xc5e51f)){_0x594fc3['or'](_0xa5f1('0x81'),_0xc5e51f+'%');}else{_0x594fc3['or'](_0xa5f1('0x82'),qs[_0xa5f1('0x83')](_0xc5e51f))['or'](_0xa5f1('0x84'),_0xc5e51f+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0xc5e51f+'%');}}}_0xc32f35[_0xa5f1('0x41')](_0x594fc3);_0xc32f35[_0xa5f1('0x85')]('i.id');var _0x1020cc={'type':db[_0xa5f1('0x86')][_0xa5f1('0x87')][_0xa5f1('0x88')],'raw':!![]};var _0x123c2f=_0xc32f35[_0xa5f1('0x89')]();_0x123c2f[_0xa5f1('0x42')](_0xa5f1('0x8a'));_0x123c2f[_0xa5f1('0x42')](_0xa5f1('0x8b'),_0xa5f1('0x8c'));if(_0x1c3dc9[_0xa5f1('0x3f')]){_0x1c3dc9[_0xa5f1('0x3f')][_0xa5f1('0x65')](function(_0x26fd71){_0xc32f35[_0xa5f1('0x3f')]('i.'+_0x26fd71[0x0],_0x26fd71[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x62ac38)){_0xc32f35['having'](_0x49220a);_0x123c2f[_0xa5f1('0x41')](_0xa5f1('0x8d'),_0x62ac38);}BPromise['resolve']()[_0xa5f1('0x24')](function(){if(!_0x4e9c9e){if(_0x2f0549[_0xa5f1('0x36')][_0xa5f1('0x70')]||_0x2f0549[_0xa5f1('0x36')][_0xa5f1('0x8e')])return;_0x123c2f[_0xa5f1('0x41')](_0xa5f1('0x8f'));_0xc32f35[_0xa5f1('0x41')](_0xa5f1('0x8f'));return;}return _0x2f0549[_0xa5f1('0x90')][_0xa5f1('0x91')]({'attributes':['id'],'raw':!![]})[_0xa5f1('0x24')](function(_0x440d74){if(_[_0xa5f1('0x6f')](_0x440d74)){_0x123c2f['where'](_0xa5f1('0x92'));_0xc32f35[_0xa5f1('0x41')](_0xa5f1('0x92'));}else{_0x123c2f['where']('i.OpenchannelAccountId\x20IN\x20?',_[_0xa5f1('0x35')](_0x440d74,'id'));_0xc32f35[_0xa5f1('0x41')](_0xa5f1('0x71'),_[_0xa5f1('0x35')](_0x440d74,'id'));}});})['then'](function(){db[_0xa5f1('0x93')][_0xa5f1('0x36')](_0x123c2f['toString'](),_0x1020cc)[_0xa5f1('0x24')](function(_0x3ce83b){_0x417750[_0xa5f1('0x94')]=_0x3ce83b[_0xa5f1('0x3b')];if(_0x417750[_0xa5f1('0x94')]===0x0)return[];return db[_0xa5f1('0x93')][_0xa5f1('0x36')](_0x2de375[_0xa5f1('0x95')](),_0x1020cc)[_0xa5f1('0x24')](function(_0x20f4c7){_0xa28248=_[_0xa5f1('0x96')](_0x20f4c7,'id');_0x1020cc=_['merge'](_0x1020cc,{'model':db[_0xa5f1('0x30')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2f0549[_0xa5f1('0x36')][_0xa5f1('0x3a')]){_0x1c3dc9[_0xa5f1('0x39')][_0xa5f1('0x65')](function(_0x5c2f09){_0xc32f35['field']('i.'+_0x5c2f09);});}else{_0xc32f35[_0xa5f1('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa5f1('0x8c'));_0xc32f35[_0xa5f1('0x42')](_0xa5f1('0x97'),_0xa5f1('0x98'));_0xc32f35['field'](_0xa5f1('0x99'),_0xa5f1('0x9a'));_0xc32f35[_0xa5f1('0x42')]('i.*');_0xc32f35[_0xa5f1('0x42')](_0xa5f1('0x9b'),'Contact.firstName');_0xc32f35[_0xa5f1('0x42')]('c.lastName','Contact.lastName');_0xc32f35[_0xa5f1('0x42')]('c.email','Contact.email');_0xc32f35[_0xa5f1('0x42')](_0xa5f1('0x9c'),_0xa5f1('0x9d'));_0xc32f35[_0xa5f1('0x42')]('c.mobile',_0xa5f1('0x9e'));_0xc32f35['field'](_0xa5f1('0x9f'),_0xa5f1('0xa0'));_0xc32f35[_0xa5f1('0x42')](_0xa5f1('0xa1'),_0xa5f1('0xa2'));_0xc32f35[_0xa5f1('0x42')](_0xa5f1('0xa3'),_0xa5f1('0xa4'));_0xc32f35[_0xa5f1('0x42')](_0xa5f1('0xa5'),_0xa5f1('0x2b'));}_0xc32f35[_0xa5f1('0x3e')](_0x1c3dc9[_0xa5f1('0x3e')]);_0xc32f35[_0xa5f1('0x1e')](_0x1c3dc9[_0xa5f1('0x1e')]);return db[_0xa5f1('0x93')][_0xa5f1('0x36')](_0xc32f35[_0xa5f1('0x95')](),_0x1020cc);})[_0xa5f1('0x24')](function(_0x39e73a){_0x191319[_0xa5f1('0x41')](_0xa5f1('0xa6'),_['map'](_0x39e73a,'id'));return db[_0xa5f1('0x93')]['query'](_0x191319[_0xa5f1('0x95')](),_0x1020cc)[_0xa5f1('0x24')](function(_0x4092a0){var _0x436a54=_[_0xa5f1('0xa7')](_0x4092a0,_0xa5f1('0xa8'));var _0x5bb2e0=[];_0x39e73a['forEach'](function(_0x598571){_0x5bb2e0[_0xa5f1('0xa9')](updateOpenchannelInteraction(_0x598571,_0xa28248,_0x436a54));});return BPromise[_0xa5f1('0xaa')](_0x5bb2e0);});});})['then'](function(_0x198dd8){_0x417750[_0xa5f1('0xab')]=_0x198dd8;return _0x417750;})[_0xa5f1('0x24')](respondWithFilteredResult(_0x5dd402,_0x1c3dc9));})[_0xa5f1('0x2e')](handleError(_0x5dd402,null));};exports[_0xa5f1('0xac')]=function(_0x3673f0,_0x41fc8f){var _0x5e2645={'raw':![],'where':{'id':_0x3673f0[_0xa5f1('0xad')]['id']}},_0x3dffff={};_0x3dffff[_0xa5f1('0x34')]=_[_0xa5f1('0x6d')](db[_0xa5f1('0x30')][_0xa5f1('0x31')]);_0x3dffff[_0xa5f1('0x36')]=_['keys'](_0x3673f0[_0xa5f1('0x36')]);_0x3dffff['filters']=_[_0xa5f1('0x38')](_0x3dffff[_0xa5f1('0x34')],_0x3dffff['query']);_0x5e2645[_0xa5f1('0x39')]=_[_0xa5f1('0x38')](_0x3dffff[_0xa5f1('0x34')],qs[_0xa5f1('0x3a')](_0x3673f0['query'][_0xa5f1('0x3a')]));_0x5e2645[_0xa5f1('0x39')]=_0x5e2645[_0xa5f1('0x39')]['length']?_0x5e2645[_0xa5f1('0x39')]:_0x3dffff[_0xa5f1('0x34')];if(_0x3673f0[_0xa5f1('0x36')]['includeAll']){_0x5e2645[_0xa5f1('0xae')]=[{'all':!![]}];}_0x5e2645=_[_0xa5f1('0xaf')]({},_0x5e2645,_0x3673f0['options']);return db['OpenchannelInteraction'][_0xa5f1('0x59')](_0x5e2645)[_0xa5f1('0x24')](handleEntityNotFound(_0x41fc8f,null))[_0xa5f1('0x24')](respondWithResult(_0x41fc8f,null))[_0xa5f1('0x2e')](handleError(_0x41fc8f,null));};exports['create']=function(_0xf77d3,_0x3f5234){return db[_0xa5f1('0x30')][_0xa5f1('0xb0')](_0xf77d3['body'],{})[_0xa5f1('0x24')](respondWithResult(_0x3f5234,0xc9))[_0xa5f1('0x2e')](handleError(_0x3f5234,null));};exports['update']=function(_0x31abf1,_0x59769b){if(_0x31abf1['body']['id']){delete _0x31abf1[_0xa5f1('0x6c')]['id'];}return db[_0xa5f1('0x30')]['find']({'where':{'id':_0x31abf1[_0xa5f1('0xad')]['id']}})['then'](handleEntityNotFound(_0x59769b,null))[_0xa5f1('0x24')](saveUpdates(_0x31abf1['body'],null))[_0xa5f1('0x24')](respondWithResult(_0x59769b,null))[_0xa5f1('0x2e')](handleError(_0x59769b,null));};exports[_0xa5f1('0x23')]=function(_0x40a91a,_0x5efc81){return db['OpenchannelInteraction']['find']({'where':{'id':_0x40a91a[_0xa5f1('0xad')]['id']}})['then'](handleEntityNotFound(_0x5efc81,null))[_0xa5f1('0x24')](removeEntity(_0x5efc81,null))[_0xa5f1('0x2e')](handleError(_0x5efc81,null));};exports['describe']=function(_0x4300ad,_0x2af1f6){return db[_0xa5f1('0x30')][_0xa5f1('0xb1')]()[_0xa5f1('0x24')](respondWithResult(_0x2af1f6,null))[_0xa5f1('0x2e')](handleError(_0x2af1f6,null));};exports[_0xa5f1('0xb2')]=function(_0x5e52b3,_0x4626c3,_0x3644ad){return db[_0xa5f1('0xb3')]['find']({'where':{'id':_0x5e52b3[_0xa5f1('0xad')]['id']}})['then'](handleEntityNotFound(_0x4626c3,null))['then'](function(_0x3c3ca7){if(_0x3c3ca7){return _0x3c3ca7[_0xa5f1('0xb2')](_0x5e52b3[_0xa5f1('0x6c')][_0xa5f1('0xb4')],_[_0xa5f1('0xb5')](_0x5e52b3[_0xa5f1('0x6c')],[_0xa5f1('0xb4'),'id'])||{});}})['then'](respondWithResult(_0x4626c3,null))[_0xa5f1('0x2e')](handleError(_0x4626c3,null));};exports[_0xa5f1('0xb6')]=function(_0x25b582,_0x3fb76d,_0x3c6e29){var _0x1bed09={'raw':![],'where':{}};var _0x22bf43={};var _0x1a66ce={'count':0x0,'rows':[]};return db[_0xa5f1('0x30')][_0xa5f1('0xb7')]({'where':{'id':_0x25b582[_0xa5f1('0xad')]['id']}})[_0xa5f1('0x24')](handleEntityNotFound(_0x3fb76d,null))[_0xa5f1('0x24')](function(_0x21f5ae){if(_0x21f5ae){_0x22bf43[_0xa5f1('0x34')]=_['keys'](db[_0xa5f1('0xb3')][_0xa5f1('0x31')]);_0x22bf43[_0xa5f1('0x36')]=_['keys'](_0x25b582[_0xa5f1('0x36')]);_0x22bf43['filters']=_['intersection'](_0x22bf43[_0xa5f1('0x34')],_0x22bf43[_0xa5f1('0x36')]);_0x1bed09['attributes']=_['intersection'](_0x22bf43[_0xa5f1('0x34')],qs[_0xa5f1('0x3a')](_0x25b582[_0xa5f1('0x36')]['fields']));_0x1bed09[_0xa5f1('0x39')]=_0x1bed09['attributes']['length']?_0x1bed09[_0xa5f1('0x39')]:_0x22bf43[_0xa5f1('0x34')];if(!_0x25b582['query']['hasOwnProperty'](_0xa5f1('0x3d'))){_0x1bed09[_0xa5f1('0x3e')]=qs[_0xa5f1('0x3e')](_0x25b582[_0xa5f1('0x36')][_0xa5f1('0x3e')]);_0x1bed09[_0xa5f1('0x1e')]=qs['offset'](_0x25b582[_0xa5f1('0x36')]['offset']);}_0x1bed09['order']=qs['sort'](_0x25b582[_0xa5f1('0x36')][_0xa5f1('0x40')]);_0x1bed09[_0xa5f1('0x41')]=qs['filters'](_[_0xa5f1('0xb8')](_0x25b582[_0xa5f1('0x36')],_0x22bf43[_0xa5f1('0x37')]));_0x1bed09['where'][_0xa5f1('0xa8')]=_0x21f5ae['id'];if(_0x25b582[_0xa5f1('0x36')][_0xa5f1('0x7e')]){_0x1bed09[_0xa5f1('0x41')]=_['merge'](_0x1bed09[_0xa5f1('0x41')],{'$or':_[_0xa5f1('0x35')](_0x1bed09[_0xa5f1('0x39')],function(_0x17253b){var _0x57b1f7={};_0x57b1f7[_0x17253b]={'$like':'%'+_0x25b582['query'][_0xa5f1('0x7e')]+'%'};return _0x57b1f7;})});}if(_0x25b582['query'][_0xa5f1('0x74')]){var _0x55af98=_0x25b582[_0xa5f1('0x36')][_0xa5f1('0x74')][_0xa5f1('0x2d')](',');var _0x4c4ca0={};_0x4c4ca0[_0x55af98[0x0]]={'$gte':moment(_0x55af98[0x1])[_0xa5f1('0xb9')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1bed09[_0xa5f1('0x41')]=_[_0xa5f1('0xaf')](_0x1bed09[_0xa5f1('0x41')],_0x4c4ca0);}_0x1bed09=_['merge']({},_0x1bed09,_0x25b582[_0xa5f1('0xba')]);return db[_0xa5f1('0xb3')]['count']({'where':_0x1bed09[_0xa5f1('0x41')]})['then'](function(_0x4f2bbd){_0x1a66ce[_0xa5f1('0x94')]=_0x4f2bbd;if(_0x25b582[_0xa5f1('0x36')][_0xa5f1('0xbb')]){_0x1bed09[_0xa5f1('0xae')]=[{'all':!![]}];}return db[_0xa5f1('0xb3')]['findAll'](_0x1bed09);})['then'](function(_0x9d134c){_0x1a66ce[_0xa5f1('0xab')]=_0x9d134c;return _0x1a66ce;});}})[_0xa5f1('0x24')](respondWithFilteredResult(_0x3fb76d,_0x1bed09))[_0xa5f1('0x2e')](handleError(_0x3fb76d,null));};exports[_0xa5f1('0xbc')]=function(_0x1ee749,_0x3bf757,_0x50921c){return db[_0xa5f1('0x30')][_0xa5f1('0x59')]({'where':{'id':_0x1ee749[_0xa5f1('0xad')]['id']}})[_0xa5f1('0x24')](handleEntityNotFound(_0x3bf757,null))[_0xa5f1('0x24')](function(_0x4bcae2){if(_0x4bcae2){return _0x4bcae2[_0xa5f1('0xbd')](_0x1ee749[_0xa5f1('0x6c')][_0xa5f1('0xb4')],_[_0xa5f1('0xb5')](_0x1ee749[_0xa5f1('0x6c')],[_0xa5f1('0xb4'),'id'])||{})['spread'](function(){return db[_0xa5f1('0xbe')][_0xa5f1('0xbf')]({'attributes':['id',_0xa5f1('0x43'),_0xa5f1('0xc0')],'where':{'id':_0x1ee749[_0xa5f1('0x6c')][_0xa5f1('0xb4')]}});})[_0xa5f1('0x24')](function(_0x535612){socket['emit'](_0xa5f1('0xc1'),{'id':Number(_0x1ee749[_0xa5f1('0xad')]['id']),'tags':_0x535612||[]});return{'id':Number(_0x1ee749['params']['id']),'tags':_0x535612||[]};});}})[_0xa5f1('0x24')](respondWithResult(_0x3bf757,null))[_0xa5f1('0x2e')](handleError(_0x3bf757,null));};exports[_0xa5f1('0xc2')]=function(_0x1e8dff,_0x5c6628,_0x1e0f5d){return db[_0xa5f1('0x30')][_0xa5f1('0x59')]({'where':{'id':_0x1e8dff[_0xa5f1('0xad')]['id']}})[_0xa5f1('0x24')](handleEntityNotFound(_0x5c6628,null))[_0xa5f1('0x24')](function(_0x594156){if(_0x594156){return _0x594156[_0xa5f1('0xc2')](_0x1e8dff[_0xa5f1('0x36')]['ids']);}})[_0xa5f1('0x24')](respondWithStatusCode(_0x5c6628,null))[_0xa5f1('0x2e')](handleError(_0x5c6628,null));};exports['download']=function(_0x8b6410,_0x3532e0){var _0x1a67d3=moment()[_0xa5f1('0xc3')]()[_0xa5f1('0x95')]();var _0x4799e5=path[_0xa5f1('0xc4')](config[_0xa5f1('0xc5')],'server',_0xa5f1('0xc6'),_0xa5f1('0xc7'));var _0x438d75=path[_0xa5f1('0xc4')](config['root'],'server',_0xa5f1('0xc6'),_0xa5f1('0xc8'));var _0x2dc4e2=path[_0xa5f1('0xc4')](_0x4799e5,_0x1a67d3);var _0x46a53b=util['format']('transcript-%d-%s.zip',_0x8b6410[_0xa5f1('0xad')]['id'],_0x1a67d3);var _0x5b701e=path['join'](_0x4799e5,_0x46a53b);var _0x5d9e21=[];_0x5d9e21[_0xa5f1('0xa9')]({'model':db['User'],'as':_0xa5f1('0x67'),'attributes':['id',_0xa5f1('0x2a')],'raw':!![]});_0x5d9e21[_0xa5f1('0xa9')]({'model':db[_0xa5f1('0xc9')],'as':_0xa5f1('0x5d'),'attributes':['id',_0xa5f1('0xca'),_0xa5f1('0xcb')],'raw':!![]});if(_0x8b6410[_0xa5f1('0x36')][_0xa5f1('0xc8')]){_0x5d9e21['push']({'model':db[_0xa5f1('0xcc')],'as':_0xa5f1('0xcc'),'raw':!![]});}var _0x282717=[{'model':db[_0xa5f1('0xb3')],'as':_0xa5f1('0xcd'),'attributes':['id',_0xa5f1('0x6c'),_0xa5f1('0x72'),_0xa5f1('0xce'),_0xa5f1('0xcf'),_0xa5f1('0x79')],'include':_0x5d9e21}];_0x282717[_0xa5f1('0xa9')]({'model':db[_0xa5f1('0xd0')],'as':_0xa5f1('0xd1'),'attributes':['id',_0xa5f1('0x43')]});_0x282717['push']({'model':db[_0xa5f1('0x67')],'as':_0xa5f1('0xd2'),'attributes':['id',_0xa5f1('0x2a')]});return db[_0xa5f1('0x30')][_0xa5f1('0x59')]({'where':{'id':_0x8b6410[_0xa5f1('0xad')]['id']},'include':_0x282717})[_0xa5f1('0x24')](handleEntityNotFound(_0x3532e0,null))[_0xa5f1('0x24')](function(_0x59cdf1){if(_0x59cdf1){var _0x30b45b=_0x59cdf1[_0xa5f1('0xd3')]({'plain':!![]});fs['mkdirSync'](_0x2dc4e2);var _0x22327b={'format':'A4','border':'10px','header':{'height':_0xa5f1('0xd4'),'contents':{'first':_0xa5f1('0xd5')}},'footer':{'height':_0xa5f1('0xd6'),'contents':{'default':util[_0xa5f1('0xb9')](_0xa5f1('0xd7'),util[_0xa5f1('0xb9')]('%s\x20#%d',_0xa5f1('0xd8'),_0x30b45b['id']),moment()[_0xa5f1('0xb9')](_0xa5f1('0xd9'))[_0xa5f1('0x95')]())}}};var _0x25105f={'channel':_0xa5f1('0xd8'),'account':_0x30b45b[_0xa5f1('0xd1')][_0xa5f1('0x43')],'agent':_0x30b45b['Owner']?_0x30b45b[_0xa5f1('0xd2')][_0xa5f1('0x2a')]:_0xa5f1('0xda'),'createdAt':moment(_0x30b45b[_0xa5f1('0x72')])[_0xa5f1('0xb9')](_0xa5f1('0xdb'))[_0xa5f1('0x95')](),'closedAt':_0x30b45b[_0xa5f1('0xdc')]?moment(_0x30b45b['closedAt'])[_0xa5f1('0xb9')](_0xa5f1('0xdb'))[_0xa5f1('0x95')]():'','disposition':_0x30b45b[_0xa5f1('0xdd')],'visibility':_0x30b45b[_0xa5f1('0xde')]?_0xa5f1('0xdf'):_0xa5f1('0xe0'),'messages':_(_0x30b45b[_0xa5f1('0xcd')])[_0xa5f1('0x7e')]({'secret':![]})[_0xa5f1('0x35')](function(_0x2293ce){if(_0x2293ce['Attachment']){var _0x5f11f6=path['join'](_0x438d75,_0x2293ce['Attachment'][_0xa5f1('0xe1')]);if(fs[_0xa5f1('0xe2')](_0x5f11f6)){fs['createReadStream'](_0x5f11f6)['pipe'](fs[_0xa5f1('0xe3')](path[_0xa5f1('0xc4')](_0x2dc4e2,_0x2293ce[_0xa5f1('0xcc')]['basename'])));}}return{'date':moment(_0x2293ce[_0xa5f1('0x72')])['format'](_0xa5f1('0xdb'))['toString'](),'sender':_0x2293ce[_0xa5f1('0xce')]==='out'?_0x2293ce[_0xa5f1('0x67')]?_0x2293ce['User'][_0xa5f1('0x2a')]:'System':_0x2293ce[_0xa5f1('0x5d')][_0xa5f1('0xca')]+(_0x2293ce[_0xa5f1('0x5d')][_0xa5f1('0xcb')]?'\x20'+_0x2293ce[_0xa5f1('0x5d')]['lastName']:''),'body':_0x2293ce[_0xa5f1('0xcc')]?_0x2293ce['Attachment']['basename']:_0x2293ce[_0xa5f1('0x6c')],'direction':_0x2293ce[_0xa5f1('0xce')]===_0xa5f1('0xe4')?'A':'C','secret':_0x2293ce[_0xa5f1('0xcf')],'read':_0x2293ce['read'],'attachment':_0x2293ce['Attachment']};})['value']()};return ejs[_0xa5f1('0xe5')](path[_0xa5f1('0xc4')](config[_0xa5f1('0xc5')],'server',_0xa5f1('0xe6'),_0xa5f1('0xe7')),{'interaction':_0x25105f})[_0xa5f1('0x24')](function(_0x5b300e){return new BPromise(function(_0x2ded71,_0x5173c2){pdf[_0xa5f1('0xb0')](_0x5b300e,_0x22327b)[_0xa5f1('0xe8')](path['join'](_0x2dc4e2,_0xa5f1('0xe9')+_0x30b45b['id']+'-'+_0x1a67d3+_0xa5f1('0xea')),function(_0x4314f0,_0x39e9cc){if(_0x4314f0)return _0x5173c2(_0x4314f0);_0x2ded71(_0x39e9cc);});});})[_0xa5f1('0x24')](function(){return new BPromise(function(_0x1bbdcc,_0x2ca2ed){zipdir(_0x2dc4e2,{'saveTo':_0x5b701e},function(_0x5d6ca0,_0x2739e6){if(_0x5d6ca0)return _0x2ca2ed(_0x5d6ca0);return _0x1bbdcc(_0x2739e6);});})['then'](function(){return new BPromise(function(_0x2dc801,_0x242680){rimraf(_0x2dc4e2,function(_0xccd6d7){if(_0xccd6d7)_0x242680(_0xccd6d7);return _0x2dc801();});});})[_0xa5f1('0x24')](function(){return _0x3532e0[_0xa5f1('0xeb')](_0x5b701e,_0x46a53b,function(_0x792d85){if(_0x792d85){console[_0xa5f1('0xec')](_0xa5f1('0xed'),_0x792d85);}else{fs[_0xa5f1('0xee')](_0x5b701e);}});});});}else{return _0x3532e0[_0xa5f1('0x1b')](0xc8);}})['catch'](handleError(_0x3532e0,null));}; \ No newline at end of file +var _0xf2d8=['OpenchannelAccount','Account','Owner','get','mkdirSync','10px','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\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','Openchannel','YYYY-MM-DD','N.A.','closed','closedAt','disposition','threadId','Attachment','basename','createReadStream','pipe','createWriteStream','System','out','renderFile','views','downloadInteraction.html','toFile','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','stack','name','send','Users','map','fullname','TagIds','Tags','forEach','catch','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','u.id','ui.OpenchannelInteractionId','left_join','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','sqlOperator','conditions','`\x20=\x200','`\x20>\x200','Contact','$substring','value','split','getFullTextValue','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','end','body','some','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$lte','read','having','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','unreadMessages','isEmpty','t.id\x20IN\x20?','resolve','journey','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','push','all','rows','show','params','include','options','find','create','destroy','describe','addMessage','OpenchannelMessage','ids','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','omit','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','server','files','join','root','attachments','transcript-%d-%s.zip','CmContact','lastName','Messages','direction','secret'];(function(_0x4a4ec9,_0x5cdd99){var _0x3933f0=function(_0x11bbc4){while(--_0x11bbc4){_0x4a4ec9['push'](_0x4a4ec9['shift']());}};_0x3933f0(++_0x5cdd99);}(_0xf2d8,0x10f));var _0x8f2d=function(_0x58e39a,_0x474e33){_0x58e39a=_0x58e39a-0x0;var _0x5233f4=_0xf2d8[_0x58e39a];return _0x5233f4;};'use strict';var pdf=require(_0x8f2d('0x0'));var emlformat=require(_0x8f2d('0x1'));var rimraf=require(_0x8f2d('0x2'));var zipdir=require(_0x8f2d('0x3'));var jsonpatch=require(_0x8f2d('0x4'));var rp=require(_0x8f2d('0x5'));var moment=require(_0x8f2d('0x6'));var BPromise=require(_0x8f2d('0x7'));var Mustache=require(_0x8f2d('0x8'));var util=require(_0x8f2d('0x9'));var path=require(_0x8f2d('0xa'));var sox=require(_0x8f2d('0xb'));var csv=require(_0x8f2d('0xc'));var ejs=require(_0x8f2d('0xd'));var fs=require('fs');var _=require(_0x8f2d('0xe'));var squel=require('squel');var crypto=require(_0x8f2d('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8f2d('0xc'));var querystring=require(_0x8f2d('0x10'));var Papa=require('papaparse');var Redis=require(_0x8f2d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8f2d('0x12'));var as=require(_0x8f2d('0x13'));var hardwareService=require(_0x8f2d('0x14'));var logger=require(_0x8f2d('0x15'))(_0x8f2d('0x16'));var utils=require('../../config/utils');var config=require(_0x8f2d('0x17'));var db=require('../../mysqldb')['db'];config[_0x8f2d('0x18')]=_[_0x8f2d('0x19')](config[_0x8f2d('0x18')],{'host':_0x8f2d('0x1a'),'port':0x18eb});var socket=require(_0x8f2d('0x1b'))(new Redis(config['redis']));require(_0x8f2d('0x1c'))[_0x8f2d('0x1d')](socket);function respondWithStatusCode(_0x38eb30,_0x2a288a){_0x2a288a=_0x2a288a||0xcc;return function(_0x167e2a){if(_0x167e2a){return _0x38eb30[_0x8f2d('0x1e')](_0x2a288a);}return _0x38eb30[_0x8f2d('0x1f')](_0x2a288a)['end']();};}function respondWithResult(_0x3da669,_0x249f0a){_0x249f0a=_0x249f0a||0xc8;return function(_0x529b9c){if(_0x529b9c){return _0x3da669['status'](_0x249f0a)[_0x8f2d('0x20')](_0x529b9c);}};}function respondWithFilteredResult(_0x380195,_0x578183){return function(_0x54b3a9){if(_0x54b3a9){var _0x5de17e=_0x54b3a9[_0x8f2d('0x21')],_0x40c5e3=_0x578183[_0x8f2d('0x22')],_0x43421c=_0x578183[_0x8f2d('0x22')]+_0x578183[_0x8f2d('0x23')],_0x306c0f;if(_0x43421c>=_0x5de17e){_0x43421c=_0x5de17e;_0x306c0f=0xc8;}else{_0x306c0f=0xce;}_0x380195['status'](_0x306c0f);return _0x380195[_0x8f2d('0x24')](_0x8f2d('0x25'),_0x40c5e3+'-'+_0x43421c+'/'+_0x5de17e)[_0x8f2d('0x20')](_0x54b3a9);}return null;};}function patchUpdates(_0x45942c){return function(_0x1c47a9){try{jsonpatch['apply'](_0x1c47a9,_0x45942c,!![]);}catch(_0x405fc2){return BPromise[_0x8f2d('0x26')](_0x405fc2);}return _0x1c47a9[_0x8f2d('0x27')]();};}function saveUpdates(_0xd0f114,_0x5ee04b){return function(_0x324f29){if(_0x324f29){return _0x324f29[_0x8f2d('0x28')](_0xd0f114)[_0x8f2d('0x29')](function(_0x35d959){return _0x35d959;});}return null;};}function removeEntity(_0x35a231,_0x20680a){return function(_0x1fc260){if(_0x1fc260){return _0x1fc260['destroy']()[_0x8f2d('0x29')](function(){_0x35a231[_0x8f2d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f5d82,_0x5065f9){return function(_0x17550f){if(!_0x17550f){_0x1f5d82['sendStatus'](0x194);}return _0x17550f;};}function handleError(_0x4dbd92,_0x5a32fd){_0x5a32fd=_0x5a32fd||0x1f4;return function(_0x8e5417){logger['error'](_0x8e5417[_0x8f2d('0x2a')]);if(_0x8e5417['name']){delete _0x8e5417[_0x8f2d('0x2b')];}_0x4dbd92[_0x8f2d('0x1f')](_0x5a32fd)[_0x8f2d('0x2c')](_0x8e5417);};}function getInteractionUsers(_0x3cc535,_0x1c9e9c){return new BPromise(function(_0xc1dafa,_0x10ba9e){try{if(_0x1c9e9c[_0x3cc535['id']]){_0x3cc535[_0x8f2d('0x2d')]=_[_0x8f2d('0x2e')](_0x1c9e9c[_0x3cc535['id']],function(_0x235575){return{'id':_0x235575['id'],'fullname':_0x235575[_0x8f2d('0x2f')]};});}}catch(_0x1017b7){_0x10ba9e(_0x1017b7);}_0xc1dafa(_0x3cc535);});}function getInteractionTags(_0x166599,_0x260c5b){return new BPromise(function(_0x4b7884,_0x3613cd){try{if(_0x166599[_0x8f2d('0x30')]){_0x166599[_0x8f2d('0x31')]=[];_0x166599['TagIds']['split'](',')[_0x8f2d('0x32')](function(_0xc6e341){_0x166599[_0x8f2d('0x31')]['push'](_0x260c5b[_0xc6e341]);});}delete _0x166599[_0x8f2d('0x30')];}catch(_0x2d6ef7){_0x3613cd(_0x2d6ef7);}_0x4b7884(_0x166599);});}function updateOpenchannelInteraction(_0x4d34f3,_0x3361ce,_0x1acb2d){return new BPromise(function(_0x57c3b0,_0x41400b){return getInteractionUsers(_0x4d34f3,_0x1acb2d)[_0x8f2d('0x29')](function(_0xc919ef){return getInteractionTags(_0xc919ef,_0x3361ce);})[_0x8f2d('0x29')](function(_0xd7f892){_0x57c3b0(_0xd7f892);})[_0x8f2d('0x33')](function(_0x168cd0){_0x41400b(_0x168cd0);});});}exports[_0x8f2d('0x34')]=function(_0x57c7a3,_0x150ab2){var _0x54b08c={},_0x5e8102={},_0x17d528={'count':0x0,'rows':[]};var _0x39d3bf=_[_0x8f2d('0x2e')](db[_0x8f2d('0x35')][_0x8f2d('0x36')],function(_0xf56c65){return{'name':_0xf56c65[_0x8f2d('0x37')],'type':_0xf56c65[_0x8f2d('0x38')][_0x8f2d('0x39')]};});_0x5e8102[_0x8f2d('0x3a')]=_['map'](_0x39d3bf,_0x8f2d('0x2b'));_0x5e8102[_0x8f2d('0x3b')]=_[_0x8f2d('0x3c')](_0x57c7a3['query']);_0x5e8102[_0x8f2d('0x3d')]=_[_0x8f2d('0x3e')](_0x5e8102['model'],_0x5e8102[_0x8f2d('0x3b')]);_0x54b08c['attributes']=_[_0x8f2d('0x3e')](_0x5e8102[_0x8f2d('0x3a')],qs[_0x8f2d('0x3f')](_0x57c7a3[_0x8f2d('0x3b')][_0x8f2d('0x3f')]));_0x54b08c[_0x8f2d('0x40')]=_0x54b08c['attributes'][_0x8f2d('0x41')]?_0x54b08c[_0x8f2d('0x40')]:_0x5e8102[_0x8f2d('0x3a')];if(!_0x57c7a3['query'][_0x8f2d('0x42')](_0x8f2d('0x43'))){_0x54b08c['limit']=qs['limit'](_0x57c7a3['query']['limit']);_0x54b08c[_0x8f2d('0x22')]=qs['offset'](_0x57c7a3['query'][_0x8f2d('0x22')]);}_0x54b08c[_0x8f2d('0x44')]=qs['sort'](_0x57c7a3['query'][_0x8f2d('0x45')]);_0x54b08c[_0x8f2d('0x46')]=qs['filters'](_[_0x8f2d('0x47')](_0x57c7a3[_0x8f2d('0x3b')],_0x5e8102[_0x8f2d('0x3d')]));var _0x532d0f=[];var _0x230361=squel[_0x8f2d('0x48')]()[_0x8f2d('0x49')]('id')[_0x8f2d('0x49')](_0x8f2d('0x2b'))[_0x8f2d('0x49')]('color')[_0x8f2d('0x4a')]('tools_tags');var _0x3f88ed=squel[_0x8f2d('0x48')]()[_0x8f2d('0x49')](_0x8f2d('0x4b'))[_0x8f2d('0x49')]('u.fullname')[_0x8f2d('0x49')](_0x8f2d('0x4c'))[_0x8f2d('0x4a')]('user_has_openchannel_interactions','ui')[_0x8f2d('0x4d')]('users','u',_0x8f2d('0x4e'));var _0x4a4e12=squel['select']()[_0x8f2d('0x4a')]('openchannel_interactions','i')[_0x8f2d('0x4d')](_0x8f2d('0x4f'),'c',_0x8f2d('0x50'))[_0x8f2d('0x4d')](_0x8f2d('0x51'),'o',_0x8f2d('0x52'))[_0x8f2d('0x4d')](_0x8f2d('0x53'),'a',_0x8f2d('0x54'))[_0x8f2d('0x4d')]('openchannel_messages','me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x8f2d('0x4d')](_0x8f2d('0x55'),'it',_0x8f2d('0x56'))['left_join'](_0x8f2d('0x57'),'t','t.id\x20=\x20it.TagId');var _0x3628c7=squel['expr']();var _0x1867c4=[];var _0x2fa427=squel[_0x8f2d('0x58')]();var _0x4cfd65;if(_0x57c7a3[_0x8f2d('0x3b')][_0x8f2d('0x59')]){_0x4cfd65=as[_0x8f2d('0x5a')](_0x57c7a3[_0x8f2d('0x3b')][_0x8f2d('0x59')]);var _0x202e9e=_0x4cfd65[_0x8f2d('0x5b')];for(var _0x189cb9=0x0;_0x189cb9<_0x4cfd65['conditions'][_0x8f2d('0x41')];_0x189cb9++){var _0x4dce96=_0x4cfd65[_0x8f2d('0x5c')][_0x189cb9];var _0x38b85b='i';var _0x2489ab=_['find'](_0x39d3bf,['name',_0x4dce96['field']]);if(!_0x2489ab){switch(_0x4dce96[_0x8f2d('0x49')]){case'unreadMessages':if(_0x4dce96['value']==0x1){_0x4a4e12['having']('`'+_0x4dce96['field']+_0x8f2d('0x5d'));}else{_0x4a4e12['having']('`'+_0x4dce96[_0x8f2d('0x49')]+_0x8f2d('0x5e'));}break;case _0x8f2d('0x5f'):if(_0x4dce96['operator']===_0x8f2d('0x60')){if(_0x4dce96[_0x8f2d('0x61')][_0x8f2d('0x62')]('\x20')['length']>0x1){_0x3628c7[_0x202e9e]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8f2d('0x63')](_0x4dce96[_0x8f2d('0x61')]),null);}else{var _0x4cd00a='%'+_0x4dce96['value']+'%';_0x3628c7[_0x202e9e]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4cd00a,_0x4cd00a,_0x4cd00a);}}else{_0x2489ab=_['find'](_0x39d3bf,['name','ContactId']);_0x4dce96[_0x8f2d('0x49')]='ContactId';_0x23938d=as[_0x8f2d('0x64')](_0x38b85b,_0x2489ab[_0x8f2d('0x38')],_0x4dce96);_0x3628c7[_0x202e9e](_0x23938d[_0x8f2d('0x65')],_0x23938d['value'][_0x8f2d('0x66')],_0x23938d['value']['end']);}break;case _0x8f2d('0x67'):var _0x2d11e6=_0x4dce96[_0x8f2d('0x61')]['split'](',')[_0x8f2d('0x2e')](function(_0x334cee){return Number(_0x334cee);});_0x2d11e6['forEach'](function(_0x183a1b){_0x2fa427['or'](_0x8f2d('0x68'),'%,'+_0x183a1b+',%');});_0x1867c4=_[_0x8f2d('0x69')](_0x1867c4,_0x2d11e6);break;case _0x8f2d('0x6a'):if(_0x4dce96[_0x8f2d('0x6b')]===_0x8f2d('0x60')){_0x3628c7[_0x202e9e](_0x8f2d('0x6c'),'%'+_0x4dce96['value']+'%',null);}else{_0x2489ab=_['find'](_0x39d3bf,[_0x8f2d('0x2b'),'UserId']);_0x4dce96[_0x8f2d('0x49')]=_0x8f2d('0x6d');_0x23938d=as[_0x8f2d('0x64')](_0x38b85b,_0x2489ab[_0x8f2d('0x38')],_0x4dce96);_0x3628c7[_0x202e9e](_0x23938d[_0x8f2d('0x65')],_0x23938d['value'][_0x8f2d('0x66')],_0x23938d[_0x8f2d('0x61')][_0x8f2d('0x6e')]);}break;case _0x8f2d('0x6f'):_0x23938d=as['buildExpression']('me',null,_0x4dce96);_0x3628c7[_0x202e9e](_0x23938d[_0x8f2d('0x65')],_0x23938d[_0x8f2d('0x61')][_0x8f2d('0x66')],_0x23938d[_0x8f2d('0x61')][_0x8f2d('0x6e')]);break;}}else{var _0x23938d=as[_0x8f2d('0x64')](_0x38b85b,_0x2489ab['type'],_0x4dce96);_0x3628c7[_0x202e9e](_0x23938d[_0x8f2d('0x65')],_0x23938d[_0x8f2d('0x61')][_0x8f2d('0x66')],_0x23938d[_0x8f2d('0x61')][_0x8f2d('0x6e')]);}}}else{var _0x4320a0=_(_0x57c7a3['query'])[_0x8f2d('0x3c')]()[_0x8f2d('0x2e')](function(_0x1d0071){return _[_0x8f2d('0x70')](_0x39d3bf,[_0x8f2d('0x2b'),_0x1d0071])?_0x1d0071:undefined;})[_0x8f2d('0x71')]()[_0x8f2d('0x61')]();if(!_['isEmpty'](_0x4320a0)){_0x4320a0[_0x8f2d('0x32')](function(_0x1e9cf9){if(_0x1e9cf9===_0x8f2d('0x72')){_0x4a4e12['where'](_0x8f2d('0x73'),[][_0x8f2d('0x74')](_0x57c7a3[_0x8f2d('0x3b')][_0x1e9cf9]));}else if(_0x1e9cf9===_0x8f2d('0x75')){var _0x3c0d7c=JSON[_0x8f2d('0x76')](_0x57c7a3[_0x8f2d('0x3b')][_0x1e9cf9])['$gte'];var _0x24b72e=JSON[_0x8f2d('0x76')](_0x57c7a3[_0x8f2d('0x3b')][_0x1e9cf9])[_0x8f2d('0x77')];_0x4a4e12[_0x8f2d('0x46')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3c0d7c,_0x24b72e);}else{if(_0x57c7a3[_0x8f2d('0x3b')][_0x1e9cf9]==='null'){_0x4a4e12[_0x8f2d('0x46')]('i.'+_0x1e9cf9+'\x20IS\x20NULL');}else{_0x4a4e12[_0x8f2d('0x46')]('i.'+_0x1e9cf9+'\x20=\x20?',_0x57c7a3[_0x8f2d('0x3b')][_0x1e9cf9]);}}});}if(_0x57c7a3[_0x8f2d('0x3b')][_0x8f2d('0x78')]){if(_0x57c7a3[_0x8f2d('0x3b')][_0x8f2d('0x78')]==0x1){_0x4a4e12[_0x8f2d('0x79')]('`unreadMessages`\x20=\x200');}else{_0x4a4e12['having'](_0x8f2d('0x7a'));}}if(_0x57c7a3[_0x8f2d('0x3b')]['tag']){_0x1867c4=_[_0x8f2d('0x7b')](_0x57c7a3[_0x8f2d('0x3b')][_0x8f2d('0x7c')])?_0x57c7a3[_0x8f2d('0x3b')][_0x8f2d('0x7c')]:new Array(_0x57c7a3[_0x8f2d('0x3b')][_0x8f2d('0x7c')]);_0x1867c4[_0x8f2d('0x32')](function(_0x55be1a){_0x2fa427['or'](_0x8f2d('0x68'),'%,'+_0x55be1a+',%');});}if(_0x57c7a3[_0x8f2d('0x3b')][_0x8f2d('0x7d')]){var _0x3ef79a=_0x57c7a3[_0x8f2d('0x3b')]['filter'][_0x8f2d('0x7e')]('\x5c','\x5c\x5c')[_0x8f2d('0x7e')]('\x27\x27',_0x8f2d('0x7f'));if(qs['isNumeric'](_0x3ef79a)){_0x3628c7['or'](_0x8f2d('0x80'),_0x3ef79a+'%');}else{_0x3628c7['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8f2d('0x63')](_0x3ef79a))['or'](_0x8f2d('0x81'),_0x3ef79a+'%')['or'](_0x8f2d('0x82'),_0x3ef79a+'%');}}}_0x4a4e12[_0x8f2d('0x46')](_0x3628c7);_0x4a4e12['group'](_0x8f2d('0x83'));var _0x52a7b9={'type':db[_0x8f2d('0x84')][_0x8f2d('0x85')][_0x8f2d('0x86')],'raw':!![]};var _0x76cd79=_0x4a4e12[_0x8f2d('0x87')]();_0x76cd79['field'](_0x8f2d('0x83'));_0x76cd79['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8f2d('0x88'));if(_0x54b08c[_0x8f2d('0x44')]){_0x54b08c[_0x8f2d('0x44')][_0x8f2d('0x32')](function(_0x16e02a){_0x4a4e12['order']('i.'+_0x16e02a[0x0],_0x16e02a[0x1]==='DESC'?![]:!![]);});}if(!_[_0x8f2d('0x89')](_0x1867c4)){_0x4a4e12[_0x8f2d('0x79')](_0x2fa427);_0x76cd79['where'](_0x8f2d('0x8a'),_0x1867c4);}BPromise[_0x8f2d('0x8b')]()[_0x8f2d('0x29')](function(){if(!_0x4cfd65){if(_0x57c7a3['query'][_0x8f2d('0x72')]||_0x57c7a3['query'][_0x8f2d('0x8c')])return;_0x76cd79[_0x8f2d('0x46')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x4a4e12['where'](_0x8f2d('0x8d'));return;}return _0x57c7a3['user'][_0x8f2d('0x8e')]({'attributes':['id'],'raw':!![]})[_0x8f2d('0x29')](function(_0x5b6f60){if(_[_0x8f2d('0x89')](_0x5b6f60)){_0x76cd79[_0x8f2d('0x46')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x4a4e12['where'](_0x8f2d('0x8f'));}else{_0x76cd79[_0x8f2d('0x46')](_0x8f2d('0x73'),_[_0x8f2d('0x2e')](_0x5b6f60,'id'));_0x4a4e12[_0x8f2d('0x46')](_0x8f2d('0x73'),_[_0x8f2d('0x2e')](_0x5b6f60,'id'));}});})[_0x8f2d('0x29')](function(){db[_0x8f2d('0x90')]['query'](_0x76cd79['toString'](),_0x52a7b9)[_0x8f2d('0x29')](function(_0x5e071d){_0x17d528[_0x8f2d('0x21')]=_0x5e071d[_0x8f2d('0x41')];if(_0x17d528[_0x8f2d('0x21')]===0x0)return[];return db[_0x8f2d('0x90')][_0x8f2d('0x3b')](_0x230361[_0x8f2d('0x91')](),_0x52a7b9)[_0x8f2d('0x29')](function(_0x57661a){_0x532d0f=_[_0x8f2d('0x92')](_0x57661a,'id');_0x52a7b9=_[_0x8f2d('0x93')](_0x52a7b9,{'model':db[_0x8f2d('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x57c7a3[_0x8f2d('0x3b')][_0x8f2d('0x3f')]){_0x54b08c['attributes'][_0x8f2d('0x32')](function(_0x417ec7){_0x4a4e12[_0x8f2d('0x49')]('i.'+_0x417ec7);});}else{_0x4a4e12['field'](_0x8f2d('0x94'),_0x8f2d('0x88'));_0x4a4e12[_0x8f2d('0x49')](_0x8f2d('0x95'),_0x8f2d('0x96'));_0x4a4e12['field'](_0x8f2d('0x97'),_0x8f2d('0x98'));_0x4a4e12['field'](_0x8f2d('0x99'));_0x4a4e12[_0x8f2d('0x49')](_0x8f2d('0x9a'),_0x8f2d('0x9b'));_0x4a4e12['field']('c.lastName',_0x8f2d('0x9c'));_0x4a4e12[_0x8f2d('0x49')](_0x8f2d('0x9d'),_0x8f2d('0x9e'));_0x4a4e12['field'](_0x8f2d('0x9f'),_0x8f2d('0xa0'));_0x4a4e12[_0x8f2d('0x49')]('c.mobile',_0x8f2d('0xa1'));_0x4a4e12['field'](_0x8f2d('0xa2'),_0x8f2d('0xa3'));_0x4a4e12[_0x8f2d('0x49')](_0x8f2d('0xa4'),_0x8f2d('0xa5'));_0x4a4e12[_0x8f2d('0x49')]('o.internal',_0x8f2d('0xa6'));_0x4a4e12[_0x8f2d('0x49')](_0x8f2d('0xa7'),_0x8f2d('0x30'));}_0x4a4e12[_0x8f2d('0x23')](_0x54b08c[_0x8f2d('0x23')]);_0x4a4e12['offset'](_0x54b08c['offset']);return db[_0x8f2d('0x90')][_0x8f2d('0x3b')](_0x4a4e12['toString'](),_0x52a7b9);})['then'](function(_0x41f5b5){_0x3f88ed[_0x8f2d('0x46')](_0x8f2d('0xa8'),_[_0x8f2d('0x2e')](_0x41f5b5,'id'));return db['sequelize'][_0x8f2d('0x3b')](_0x3f88ed[_0x8f2d('0x91')](),_0x52a7b9)[_0x8f2d('0x29')](function(_0x3122ec){var _0xc3212f=_['groupBy'](_0x3122ec,_0x8f2d('0xa9'));var _0xf607cb=[];_0x41f5b5[_0x8f2d('0x32')](function(_0x2e363d){_0xf607cb[_0x8f2d('0xaa')](updateOpenchannelInteraction(_0x2e363d,_0x532d0f,_0xc3212f));});return BPromise[_0x8f2d('0xab')](_0xf607cb);});});})[_0x8f2d('0x29')](function(_0x6eb215){_0x17d528[_0x8f2d('0xac')]=_0x6eb215;return _0x17d528;})[_0x8f2d('0x29')](respondWithFilteredResult(_0x150ab2,_0x54b08c));})[_0x8f2d('0x33')](handleError(_0x150ab2,null));};exports[_0x8f2d('0xad')]=function(_0x37288f,_0xdf2cdd){var _0x3e49a3={'raw':![],'where':{'id':_0x37288f[_0x8f2d('0xae')]['id']}},_0x1f44b3={};_0x1f44b3[_0x8f2d('0x3a')]=_[_0x8f2d('0x3c')](db[_0x8f2d('0x35')][_0x8f2d('0x36')]);_0x1f44b3['query']=_['keys'](_0x37288f[_0x8f2d('0x3b')]);_0x1f44b3['filters']=_['intersection'](_0x1f44b3[_0x8f2d('0x3a')],_0x1f44b3[_0x8f2d('0x3b')]);_0x3e49a3[_0x8f2d('0x40')]=_[_0x8f2d('0x3e')](_0x1f44b3['model'],qs[_0x8f2d('0x3f')](_0x37288f[_0x8f2d('0x3b')]['fields']));_0x3e49a3[_0x8f2d('0x40')]=_0x3e49a3[_0x8f2d('0x40')][_0x8f2d('0x41')]?_0x3e49a3[_0x8f2d('0x40')]:_0x1f44b3[_0x8f2d('0x3a')];if(_0x37288f[_0x8f2d('0x3b')]['includeAll']){_0x3e49a3[_0x8f2d('0xaf')]=[{'all':!![]}];}_0x3e49a3=_['merge']({},_0x3e49a3,_0x37288f[_0x8f2d('0xb0')]);return db[_0x8f2d('0x35')][_0x8f2d('0xb1')](_0x3e49a3)[_0x8f2d('0x29')](handleEntityNotFound(_0xdf2cdd,null))[_0x8f2d('0x29')](respondWithResult(_0xdf2cdd,null))['catch'](handleError(_0xdf2cdd,null));};exports[_0x8f2d('0xb2')]=function(_0x503bd5,_0x36bbee){return db['OpenchannelInteraction'][_0x8f2d('0xb2')](_0x503bd5[_0x8f2d('0x6f')],{})[_0x8f2d('0x29')](respondWithResult(_0x36bbee,0xc9))[_0x8f2d('0x33')](handleError(_0x36bbee,null));};exports[_0x8f2d('0x28')]=function(_0x1e614,_0x5be6ac){if(_0x1e614['body']['id']){delete _0x1e614[_0x8f2d('0x6f')]['id'];}return db[_0x8f2d('0x35')][_0x8f2d('0xb1')]({'where':{'id':_0x1e614[_0x8f2d('0xae')]['id']}})[_0x8f2d('0x29')](handleEntityNotFound(_0x5be6ac,null))['then'](saveUpdates(_0x1e614['body'],null))['then'](respondWithResult(_0x5be6ac,null))['catch'](handleError(_0x5be6ac,null));};exports[_0x8f2d('0xb3')]=function(_0x471be9,_0x26db03){return db[_0x8f2d('0x35')][_0x8f2d('0xb1')]({'where':{'id':_0x471be9[_0x8f2d('0xae')]['id']}})[_0x8f2d('0x29')](handleEntityNotFound(_0x26db03,null))[_0x8f2d('0x29')](removeEntity(_0x26db03,null))['catch'](handleError(_0x26db03,null));};exports[_0x8f2d('0xb4')]=function(_0x1867e9,_0x2cda4c){return db[_0x8f2d('0x35')][_0x8f2d('0xb4')]()[_0x8f2d('0x29')](respondWithResult(_0x2cda4c,null))[_0x8f2d('0x33')](handleError(_0x2cda4c,null));};exports[_0x8f2d('0xb5')]=function(_0x286145,_0xf4655a,_0x4d7893){return db[_0x8f2d('0xb6')][_0x8f2d('0xb1')]({'where':{'id':_0x286145['params']['id']}})[_0x8f2d('0x29')](handleEntityNotFound(_0xf4655a,null))[_0x8f2d('0x29')](function(_0x34d7ad){if(_0x34d7ad){return _0x34d7ad[_0x8f2d('0xb5')](_0x286145[_0x8f2d('0x6f')]['ids'],_['omit'](_0x286145[_0x8f2d('0x6f')],[_0x8f2d('0xb7'),'id'])||{});}})[_0x8f2d('0x29')](respondWithResult(_0xf4655a,null))[_0x8f2d('0x33')](handleError(_0xf4655a,null));};exports[_0x8f2d('0xb8')]=function(_0x1bcbc7,_0x7588ae,_0x5d122a){var _0x57ab6a={'raw':![],'where':{}};var _0x877a97={};var _0xb7ac28={'count':0x0,'rows':[]};return db[_0x8f2d('0x35')][_0x8f2d('0xb9')]({'where':{'id':_0x1bcbc7['params']['id']}})[_0x8f2d('0x29')](handleEntityNotFound(_0x7588ae,null))['then'](function(_0x20e650){if(_0x20e650){_0x877a97['model']=_[_0x8f2d('0x3c')](db[_0x8f2d('0xb6')][_0x8f2d('0x36')]);_0x877a97['query']=_['keys'](_0x1bcbc7['query']);_0x877a97[_0x8f2d('0x3d')]=_['intersection'](_0x877a97[_0x8f2d('0x3a')],_0x877a97[_0x8f2d('0x3b')]);_0x57ab6a[_0x8f2d('0x40')]=_['intersection'](_0x877a97[_0x8f2d('0x3a')],qs[_0x8f2d('0x3f')](_0x1bcbc7[_0x8f2d('0x3b')]['fields']));_0x57ab6a['attributes']=_0x57ab6a[_0x8f2d('0x40')][_0x8f2d('0x41')]?_0x57ab6a['attributes']:_0x877a97['model'];if(!_0x1bcbc7['query'][_0x8f2d('0x42')](_0x8f2d('0x43'))){_0x57ab6a['limit']=qs[_0x8f2d('0x23')](_0x1bcbc7[_0x8f2d('0x3b')]['limit']);_0x57ab6a[_0x8f2d('0x22')]=qs['offset'](_0x1bcbc7[_0x8f2d('0x3b')][_0x8f2d('0x22')]);}_0x57ab6a['order']=qs[_0x8f2d('0x45')](_0x1bcbc7[_0x8f2d('0x3b')]['sort']);_0x57ab6a[_0x8f2d('0x46')]=qs[_0x8f2d('0x3d')](_[_0x8f2d('0x47')](_0x1bcbc7[_0x8f2d('0x3b')],_0x877a97[_0x8f2d('0x3d')]));_0x57ab6a[_0x8f2d('0x46')][_0x8f2d('0xa9')]=_0x20e650['id'];if(_0x1bcbc7[_0x8f2d('0x3b')][_0x8f2d('0x7d')]){_0x57ab6a[_0x8f2d('0x46')]=_[_0x8f2d('0x93')](_0x57ab6a['where'],{'$or':_[_0x8f2d('0x2e')](_0x57ab6a['attributes'],function(_0x2d0166){var _0x3b56f8={};_0x3b56f8[_0x2d0166]={'$like':'%'+_0x1bcbc7[_0x8f2d('0x3b')][_0x8f2d('0x7d')]+'%'};return _0x3b56f8;})});}if(_0x1bcbc7['query'][_0x8f2d('0xba')]){var _0x95390e=_0x1bcbc7[_0x8f2d('0x3b')]['$gte']['split'](',');var _0x45d705={};_0x45d705[_0x95390e[0x0]]={'$gte':moment(_0x95390e[0x1])[_0x8f2d('0xbb')](_0x8f2d('0xbc'))};_0x57ab6a[_0x8f2d('0x46')]=_[_0x8f2d('0x93')](_0x57ab6a['where'],_0x45d705);}_0x57ab6a=_['merge']({},_0x57ab6a,_0x1bcbc7[_0x8f2d('0xb0')]);return db['OpenchannelMessage'][_0x8f2d('0x21')]({'where':_0x57ab6a[_0x8f2d('0x46')]})[_0x8f2d('0x29')](function(_0x6326cd){_0xb7ac28['count']=_0x6326cd;if(_0x1bcbc7[_0x8f2d('0x3b')][_0x8f2d('0xbd')]){_0x57ab6a['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x8f2d('0xbe')](_0x57ab6a);})[_0x8f2d('0x29')](function(_0x3458a8){_0xb7ac28[_0x8f2d('0xac')]=_0x3458a8;return _0xb7ac28;});}})['then'](respondWithFilteredResult(_0x7588ae,_0x57ab6a))[_0x8f2d('0x33')](handleError(_0x7588ae,null));};exports[_0x8f2d('0xbf')]=function(_0x57379f,_0x4c2c6e,_0x16d32c){return db[_0x8f2d('0x35')]['find']({'where':{'id':_0x57379f[_0x8f2d('0xae')]['id']}})[_0x8f2d('0x29')](handleEntityNotFound(_0x4c2c6e,null))['then'](function(_0x19e470){if(_0x19e470){return _0x19e470[_0x8f2d('0xc0')](_0x57379f[_0x8f2d('0x6f')][_0x8f2d('0xb7')],_[_0x8f2d('0xc1')](_0x57379f[_0x8f2d('0x6f')],[_0x8f2d('0xb7'),'id'])||{})[_0x8f2d('0xc2')](function(){return db[_0x8f2d('0x67')][_0x8f2d('0xbe')]({'attributes':['id',_0x8f2d('0x2b'),'color'],'where':{'id':_0x57379f[_0x8f2d('0x6f')][_0x8f2d('0xb7')]}});})[_0x8f2d('0x29')](function(_0x14c61f){socket[_0x8f2d('0xc3')](_0x8f2d('0xc4'),{'id':Number(_0x57379f[_0x8f2d('0xae')]['id']),'tags':_0x14c61f||[]});return{'id':Number(_0x57379f[_0x8f2d('0xae')]['id']),'tags':_0x14c61f||[]};});}})[_0x8f2d('0x29')](respondWithResult(_0x4c2c6e,null))[_0x8f2d('0x33')](handleError(_0x4c2c6e,null));};exports[_0x8f2d('0xc5')]=function(_0x199fad,_0x248bd9,_0x7e4cf6){return db[_0x8f2d('0x35')]['find']({'where':{'id':_0x199fad[_0x8f2d('0xae')]['id']}})[_0x8f2d('0x29')](handleEntityNotFound(_0x248bd9,null))[_0x8f2d('0x29')](function(_0x2d5ab2){if(_0x2d5ab2){return _0x2d5ab2[_0x8f2d('0xc5')](_0x199fad[_0x8f2d('0x3b')][_0x8f2d('0xb7')]);}})[_0x8f2d('0x29')](respondWithStatusCode(_0x248bd9,null))[_0x8f2d('0x33')](handleError(_0x248bd9,null));};exports[_0x8f2d('0xc6')]=function(_0x2919a8,_0x4e62e8){var _0x2e78f2=moment()[_0x8f2d('0xc7')]()[_0x8f2d('0x91')]();var _0x5063b3=path['join'](config['root'],_0x8f2d('0xc8'),_0x8f2d('0xc9'),'tmp');var _0x1e2154=path[_0x8f2d('0xca')](config[_0x8f2d('0xcb')],_0x8f2d('0xc8'),'files',_0x8f2d('0xcc'));var _0x23c8cd=path[_0x8f2d('0xca')](_0x5063b3,_0x2e78f2);var _0x687d35=util[_0x8f2d('0xbb')](_0x8f2d('0xcd'),_0x2919a8[_0x8f2d('0xae')]['id'],_0x2e78f2);var _0x5cba6e=path[_0x8f2d('0xca')](_0x5063b3,_0x687d35);var _0x4da1be=[];_0x4da1be[_0x8f2d('0xaa')]({'model':db[_0x8f2d('0x6a')],'as':'User','attributes':['id',_0x8f2d('0x2f')],'raw':!![]});_0x4da1be['push']({'model':db[_0x8f2d('0xce')],'as':_0x8f2d('0x5f'),'attributes':['id','firstName',_0x8f2d('0xcf')],'raw':!![]});if(_0x2919a8[_0x8f2d('0x3b')]['attachments']){_0x4da1be[_0x8f2d('0xaa')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x445f9d=[{'model':db[_0x8f2d('0xb6')],'as':_0x8f2d('0xd0'),'attributes':['id','body',_0x8f2d('0x75'),_0x8f2d('0xd1'),_0x8f2d('0xd2'),_0x8f2d('0x78')],'include':_0x4da1be}];_0x445f9d['push']({'model':db[_0x8f2d('0xd3')],'as':_0x8f2d('0xd4'),'attributes':['id','name']});_0x445f9d['push']({'model':db[_0x8f2d('0x6a')],'as':_0x8f2d('0xd5'),'attributes':['id',_0x8f2d('0x2f')]});return db[_0x8f2d('0x35')][_0x8f2d('0xb1')]({'where':{'id':_0x2919a8[_0x8f2d('0xae')]['id']},'include':_0x445f9d})[_0x8f2d('0x29')](handleEntityNotFound(_0x4e62e8,null))[_0x8f2d('0x29')](function(_0x4f6675){if(_0x4f6675){var _0x1e800b=_0x4f6675[_0x8f2d('0xd6')]({'plain':!![]});fs[_0x8f2d('0xd7')](_0x23c8cd);var _0x5114d6={'format':'A4','border':_0x8f2d('0xd8'),'header':{'height':'40px','contents':{'first':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
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':_0x8f2d('0xd9'),'contents':{'default':util[_0x8f2d('0xbb')](_0x8f2d('0xda'),util[_0x8f2d('0xbb')](_0x8f2d('0xdb'),_0x8f2d('0xdc'),_0x1e800b['id']),moment()[_0x8f2d('0xbb')](_0x8f2d('0xdd'))[_0x8f2d('0x91')]())}}};var _0x485fe8={'channel':'Openchannel','account':_0x1e800b[_0x8f2d('0xd4')]['name'],'agent':_0x1e800b['Owner']?_0x1e800b['Owner'][_0x8f2d('0x2f')]:_0x8f2d('0xde'),'createdAt':moment(_0x1e800b[_0x8f2d('0x75')])[_0x8f2d('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8f2d('0x91')](),'closedAt':_0x1e800b[_0x8f2d('0xdf')]?moment(_0x1e800b[_0x8f2d('0xe0')])[_0x8f2d('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x1e800b[_0x8f2d('0xe1')],'visibility':_0x1e800b[_0x8f2d('0xe2')]?'Public':'Private','messages':_(_0x1e800b[_0x8f2d('0xd0')])[_0x8f2d('0x7d')]({'secret':![]})[_0x8f2d('0x2e')](function(_0x366f1b){if(_0x366f1b[_0x8f2d('0xe3')]){var _0x17e187=path['join'](_0x1e2154,_0x366f1b[_0x8f2d('0xe3')][_0x8f2d('0xe4')]);if(fs['existsSync'](_0x17e187)){fs[_0x8f2d('0xe5')](_0x17e187)[_0x8f2d('0xe6')](fs[_0x8f2d('0xe7')](path[_0x8f2d('0xca')](_0x23c8cd,_0x366f1b[_0x8f2d('0xe3')]['basename'])));}}return{'date':moment(_0x366f1b[_0x8f2d('0x75')])[_0x8f2d('0xbb')](_0x8f2d('0xbc'))['toString'](),'sender':_0x366f1b[_0x8f2d('0xd1')]==='out'?_0x366f1b['User']?_0x366f1b['User'][_0x8f2d('0x2f')]:_0x8f2d('0xe8'):_0x366f1b[_0x8f2d('0x5f')]['firstName']+(_0x366f1b[_0x8f2d('0x5f')][_0x8f2d('0xcf')]?'\x20'+_0x366f1b['Contact'][_0x8f2d('0xcf')]:''),'body':_0x366f1b[_0x8f2d('0xe3')]?_0x366f1b[_0x8f2d('0xe3')]['basename']:_0x366f1b[_0x8f2d('0x6f')],'direction':_0x366f1b[_0x8f2d('0xd1')]===_0x8f2d('0xe9')?'A':'C','secret':_0x366f1b[_0x8f2d('0xd2')],'read':_0x366f1b[_0x8f2d('0x78')],'attachment':_0x366f1b[_0x8f2d('0xe3')]};})[_0x8f2d('0x61')]()};return ejs[_0x8f2d('0xea')](path['join'](config['root'],'server',_0x8f2d('0xeb'),_0x8f2d('0xec')),{'interaction':_0x485fe8})['then'](function(_0x50f40a){return new BPromise(function(_0x3854c3,_0x110cd8){pdf[_0x8f2d('0xb2')](_0x50f40a,_0x5114d6)[_0x8f2d('0xed')](path['join'](_0x23c8cd,'transcript-'+_0x1e800b['id']+'-'+_0x2e78f2+'.pdf'),function(_0x4acce1,_0x45ede9){if(_0x4acce1)return _0x110cd8(_0x4acce1);_0x3854c3(_0x45ede9);});});})[_0x8f2d('0x29')](function(){return new BPromise(function(_0x2241e3,_0x12c507){zipdir(_0x23c8cd,{'saveTo':_0x5cba6e},function(_0x507027,_0x6889bb){if(_0x507027)return _0x12c507(_0x507027);return _0x2241e3(_0x6889bb);});})[_0x8f2d('0x29')](function(){return new BPromise(function(_0x47e24c,_0x168dae){rimraf(_0x23c8cd,function(_0x177451){if(_0x177451)_0x168dae(_0x177451);return _0x47e24c();});});})[_0x8f2d('0x29')](function(){return _0x4e62e8[_0x8f2d('0xc6')](_0x5cba6e,_0x687d35,function(_0x3a12c5){if(_0x3a12c5){console[_0x8f2d('0xee')](_0x8f2d('0xef'),_0x3a12c5);}else{fs[_0x8f2d('0xf0')](_0x5cba6e);}});});});}else{return _0x4e62e8['sendStatus'](0xc8);}})[_0x8f2d('0x33')](handleError(_0x4e62e8,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index dc27a7f..31b70a7 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 _0x51af=['hook','exports','events','OpenchannelInteraction','OpenchannelMessage','save','update','remove','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x32a6f4,_0x5db2c4){var _0x3909e5=function(_0x1ac6f9){while(--_0x1ac6f9){_0x32a6f4['push'](_0x32a6f4['shift']());}};_0x3909e5(++_0x5db2c4);}(_0x51af,0x68));var _0xf51a=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x51af[_0x1589dd];return _0x1bddd1;};'use strict';var EventEmitter=require(_0xf51a('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0xf51a('0x1')];var OpenchannelMessage=require('../../mysqldb')['db'][_0xf51a('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf51a('0x3'),'afterUpdate':_0xf51a('0x4'),'afterDestroy':_0xf51a('0x5')};function emitEvent(_0x295038){return function(_0x5e9659,_0x56e44d,_0x5d94ca){_0x5e9659['getUsers']({'attributes':['id'],'raw':!![]})[_0xf51a('0x6')](function(_0x20f610){_0x5e9659[_0xf51a('0x7')](_0xf51a('0x8'),_0x20f610['map'](function(_0xdbb961){return{'id':_0xdbb961['id']};}));return OpenchannelMessage[_0xf51a('0x9')]({'where':{'OpenchannelInteractionId':_0x5e9659['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf51a('0x6')](function(_0x4319b3){_0x5e9659['setDataValue'](_0xf51a('0xa'),_0x4319b3[_0xf51a('0xb')]);OpenchannelInteractionEvents[_0xf51a('0xc')](_0x295038+':'+_0x5e9659['id'],_0x5e9659);OpenchannelInteractionEvents[_0xf51a('0xc')](_0x295038,_0x5e9659);_0x5d94ca(null);})[_0xf51a('0xd')](_0x5d94ca(null));};}for(var e in events){if(events[_0xf51a('0xe')](e)){var event=events[e];OpenchannelInteraction[_0xf51a('0xf')](e,emitEvent(event));}}module[_0xf51a('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x462a=['map','findAll','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','update','remove','getUsers','then','setDataValue','Users'];(function(_0x366dbd,_0x5b3ca3){var _0x265dca=function(_0x31bbed){while(--_0x31bbed){_0x366dbd['push'](_0x366dbd['shift']());}};_0x265dca(++_0x5b3ca3);}(_0x462a,0x1c1));var _0xa462=function(_0x2b60e7,_0x590a96){_0x2b60e7=_0x2b60e7-0x0;var _0x51bf5a=_0x462a[_0x2b60e7];return _0x51bf5a;};'use strict';var EventEmitter=require(_0xa462('0x0'));var OpenchannelInteraction=require(_0xa462('0x1'))['db'][_0xa462('0x2')];var OpenchannelMessage=require(_0xa462('0x1'))['db'][_0xa462('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa462('0x4'),'afterDestroy':_0xa462('0x5')};function emitEvent(_0x159d99){return function(_0x4ddc14,_0x519fbb,_0x5bfd44){_0x4ddc14[_0xa462('0x6')]({'attributes':['id'],'raw':!![]})[_0xa462('0x7')](function(_0x3f6337){_0x4ddc14[_0xa462('0x8')](_0xa462('0x9'),_0x3f6337[_0xa462('0xa')](function(_0x10d7fc){return{'id':_0x10d7fc['id']};}));return OpenchannelMessage[_0xa462('0xb')]({'where':{'OpenchannelInteractionId':_0x4ddc14['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa462('0x7')](function(_0x3b3090){_0x4ddc14['setDataValue']('unreadMessages',_0x3b3090[_0xa462('0xc')]);OpenchannelInteractionEvents[_0xa462('0xd')](_0x159d99+':'+_0x4ddc14['id'],_0x4ddc14);OpenchannelInteractionEvents['emit'](_0x159d99,_0x4ddc14);_0x5bfd44(null);})['catch'](_0x5bfd44(null));};}for(var e in events){if(events[_0xa462('0xe')](e)){var event=events[e];OpenchannelInteraction[_0xa462('0xf')](e,emitEvent(event));}}module[_0xa462('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 e1e6d0f..dbc6483 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 _0xb46f=['OpenchannelInteraction','format','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xb46f,0xb6));var _0xfb46=function(_0x1314bc,_0x2b71a5){_0x1314bc=_0x1314bc-0x0;var _0x1a3e9d=_0xb46f[_0x1314bc];return _0x1a3e9d;};'use strict';var _=require(_0xfb46('0x0'));var util=require(_0xfb46('0x1'));var logger=require('../../config/logger')(_0xfb46('0x2'));var moment=require(_0xfb46('0x3'));var BPromise=require(_0xfb46('0x4'));var rp=require(_0xfb46('0x5'));var fs=require('fs');var path=require(_0xfb46('0x6'));var rimraf=require('rimraf');var config=require(_0xfb46('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0xfb46('0x8')]=function(_0x3a5255,_0x186da6){return _0x3a5255[_0xfb46('0x9')](_0xfb46('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x9871f5,_0x298a84,_0x4b1a94){if(_0x9871f5['changed']('closed')){_0x9871f5['closedAt']=moment()[_0xfb46('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4b1a94(null,_0x9871f5);}}});}; \ No newline at end of file +var _0xca9e=['changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','openchannel_interactions'];(function(_0x1505e5,_0x5cc291){var _0x5b1dcd=function(_0x18bfe5){while(--_0x18bfe5){_0x1505e5['push'](_0x1505e5['shift']());}};_0x5b1dcd(++_0x5cc291);}(_0xca9e,0x136));var _0xeca9=function(_0x44cc23,_0x31556f){_0x44cc23=_0x44cc23-0x0;var _0x3dbc55=_0xca9e[_0x44cc23];return _0x3dbc55;};'use strict';var _=require(_0xeca9('0x0'));var util=require(_0xeca9('0x1'));var logger=require(_0xeca9('0x2'))(_0xeca9('0x3'));var moment=require(_0xeca9('0x4'));var BPromise=require(_0xeca9('0x5'));var rp=require(_0xeca9('0x6'));var fs=require('fs');var path=require(_0xeca9('0x7'));var rimraf=require(_0xeca9('0x8'));var config=require(_0xeca9('0x9'));var attributes=require(_0xeca9('0xa'));module[_0xeca9('0xb')]=function(_0x186a47,_0x305dc5){return _0x186a47['define'](_0xeca9('0xc'),attributes,{'tableName':_0xeca9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d57ee,_0x4eaf49,_0x1ef0f3){if(_0x4d57ee[_0xeca9('0xe')](_0xeca9('0xf'))){_0x4d57ee['closedAt']=moment()[_0xeca9('0x10')](_0xeca9('0x11'));}_0x1ef0f3(null,_0x4d57ee);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index e7ddacf..3bda540 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 _0x0199=['../../config/environment','client','http','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','UpdateOpenchannelInteraction','update','body','options','raw','where','attributes','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x13b28a,_0x4d3f80){var _0x28b767=function(_0x1f3022){while(--_0x1f3022){_0x13b28a['push'](_0x13b28a['shift']());}};_0x28b767(++_0x4d3f80);}(_0x0199,0x140));var _0x9019=function(_0x516b3a,_0x5fbbeb){_0x516b3a=_0x516b3a-0x0;var _0x567c68=_0x0199[_0x516b3a];return _0x567c68;};'use strict';var _=require(_0x9019('0x0'));var util=require(_0x9019('0x1'));var moment=require(_0x9019('0x2'));var BPromise=require(_0x9019('0x3'));var rs=require(_0x9019('0x4'));var fs=require('fs');var Redis=require(_0x9019('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9019('0x6'));var logger=require(_0x9019('0x7'))('rpc');var config=require(_0x9019('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9019('0x9')][_0x9019('0xa')]({'port':0x232a});config[_0x9019('0xb')]=_[_0x9019('0xc')](config[_0x9019('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x9019('0xd'))(new Redis(config[_0x9019('0xb')]));require(_0x9019('0xe'))[_0x9019('0xf')](socket);function respondWithRpcPromise(_0x28d769,_0x2b9f45,_0x334699){return new BPromise(function(_0x1442b9,_0x5d16cb){return client['request'](_0x28d769,_0x334699)[_0x9019('0x10')](function(_0x17da6b){logger[_0x9019('0x11')](_0x9019('0x12'),_0x2b9f45,'request\x20sent');logger[_0x9019('0x13')](_0x9019('0x14'),_0x2b9f45,_0x9019('0x15'),JSON['stringify'](_0x17da6b));if(_0x17da6b[_0x9019('0x16')]){if(_0x17da6b[_0x9019('0x16')]['code']===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x2b9f45,_0x17da6b[_0x9019('0x16')][_0x9019('0x17')]);return _0x5d16cb(_0x17da6b[_0x9019('0x16')][_0x9019('0x17')]);}logger[_0x9019('0x16')](_0x9019('0x12'),_0x2b9f45,_0x17da6b[_0x9019('0x16')][_0x9019('0x17')]);return _0x1442b9(_0x17da6b[_0x9019('0x16')][_0x9019('0x17')]);}else{logger[_0x9019('0x11')](_0x9019('0x12'),_0x2b9f45,'request\x20sent');_0x1442b9(_0x17da6b[_0x9019('0x18')][_0x9019('0x17')]);}})[_0x9019('0x19')](function(_0x32d058){logger[_0x9019('0x16')](_0x9019('0x12'),_0x2b9f45,_0x32d058);_0x5d16cb(_0x32d058);});});}exports[_0x9019('0x1a')]=function(_0x43d920){var _0x42b267=this;return new Promise(function(_0x23b103,_0x3e5a00){return db['OpenchannelInteraction'][_0x9019('0x1b')](_0x43d920[_0x9019('0x1c')],{'raw':_0x43d920[_0x9019('0x1d')]?_0x43d920[_0x9019('0x1d')][_0x9019('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43d920['options']?_0x43d920[_0x9019('0x1d')][_0x9019('0x1f')]||null:null,'attributes':_0x43d920['options']?_0x43d920[_0x9019('0x1d')][_0x9019('0x20')]||null:null,'limit':_0x43d920[_0x9019('0x1d')]?_0x43d920[_0x9019('0x1d')]['limit']||null:null})['then'](function(_0x2ad508){logger[_0x9019('0x11')]('UpdateOpenchannelInteraction',_0x43d920);logger[_0x9019('0x13')](_0x9019('0x1a'),_0x43d920,JSON['stringify'](_0x2ad508));_0x23b103(_0x2ad508);})['catch'](function(_0x4b0583){logger[_0x9019('0x16')](_0x9019('0x1a'),_0x4b0583[_0x9019('0x17')],_0x43d920);_0x3e5a00(_0x42b267[_0x9019('0x16')](0x1f4,_0x4b0583['message']));});});};exports[_0x9019('0x21')]=function(_0x5d4e3f){return new Promise(function(_0x4ca83a,_0x4d4ff4){return db[_0x9019('0x22')][_0x9019('0x23')]({'where':_0x5d4e3f['options']?_0x5d4e3f[_0x9019('0x1d')]['where']||null:null})['then'](function(_0x35af4e){if(_0x35af4e){return _0x35af4e[_0x9019('0x24')](_0x5d4e3f[_0x9019('0x1c')][_0x9019('0x25')],_[_0x9019('0x26')](_0x5d4e3f[_0x9019('0x1c')],[_0x9019('0x25'),'id'])||{});}})[_0x9019('0x27')](function(_0x379195){logger['info']('AddTags',_0x5d4e3f);logger[_0x9019('0x13')](_0x9019('0x28'),_0x5d4e3f,JSON['stringify'](_0x379195));_0x4ca83a(_0x379195);})[_0x9019('0x19')](function(_0x10c2ad){logger['error'](_0x9019('0x28'),_0x10c2ad['message'],_0x5d4e3f);_0x4d4ff4(_this[_0x9019('0x16')](0x1f4,_0x10c2ad[_0x9019('0x17')]));});});}; \ No newline at end of file +var _0x4ab5=['stringify','error','message','OpenchannelInteraction,\x20%s,\x20%s','result','catch','UpdateOpenchannelInteraction','update','body','options','raw','where','attributes','OpenchannelInteraction','find','then','addTags','ids','spread','debug','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','info','request\x20sent'];(function(_0x5e50d6,_0x1d6a9e){var _0x3bd94a=function(_0x5d760d){while(--_0x5d760d){_0x5e50d6['push'](_0x5e50d6['shift']());}};_0x3bd94a(++_0x1d6a9e);}(_0x4ab5,0x186));var _0x54ab=function(_0x1ad9b4,_0x5df9ed){_0x1ad9b4=_0x1ad9b4-0x0;var _0xbbee74=_0x4ab5[_0x1ad9b4];return _0xbbee74;};'use strict';var _=require(_0x54ab('0x0'));var util=require(_0x54ab('0x1'));var moment=require(_0x54ab('0x2'));var BPromise=require('bluebird');var rs=require(_0x54ab('0x3'));var fs=require('fs');var Redis=require(_0x54ab('0x4'));var db=require(_0x54ab('0x5'))['db'];var utils=require(_0x54ab('0x6'));var logger=require(_0x54ab('0x7'))(_0x54ab('0x8'));var config=require(_0x54ab('0x9'));var jayson=require(_0x54ab('0xa'));var client=jayson['client'][_0x54ab('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x54ab('0xc')],{'host':_0x54ab('0xd'),'port':0x18eb});var socket=require(_0x54ab('0xe'))(new Redis(config[_0x54ab('0xc')]));require(_0x54ab('0xf'))[_0x54ab('0x10')](socket);function respondWithRpcPromise(_0x28781b,_0x1e3945,_0x28237b){return new BPromise(function(_0x5cf544,_0x15e4b3){return client[_0x54ab('0x11')](_0x28781b,_0x28237b)['then'](function(_0x2a3af7){logger[_0x54ab('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1e3945,_0x54ab('0x13'));logger['debug']('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x1e3945,_0x54ab('0x13'),JSON[_0x54ab('0x14')](_0x2a3af7));if(_0x2a3af7[_0x54ab('0x15')]){if(_0x2a3af7[_0x54ab('0x15')]['code']===0x1f4){logger[_0x54ab('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1e3945,_0x2a3af7[_0x54ab('0x15')]['message']);return _0x15e4b3(_0x2a3af7[_0x54ab('0x15')][_0x54ab('0x16')]);}logger[_0x54ab('0x15')](_0x54ab('0x17'),_0x1e3945,_0x2a3af7[_0x54ab('0x15')][_0x54ab('0x16')]);return _0x5cf544(_0x2a3af7[_0x54ab('0x15')]['message']);}else{logger[_0x54ab('0x12')](_0x54ab('0x17'),_0x1e3945,_0x54ab('0x13'));_0x5cf544(_0x2a3af7[_0x54ab('0x18')][_0x54ab('0x16')]);}})[_0x54ab('0x19')](function(_0x52ed4f){logger[_0x54ab('0x15')](_0x54ab('0x17'),_0x1e3945,_0x52ed4f);_0x15e4b3(_0x52ed4f);});});}exports[_0x54ab('0x1a')]=function(_0x1d0134){var _0x3d4ee8=this;return new Promise(function(_0x247f4a,_0x590c7c){return db['OpenchannelInteraction'][_0x54ab('0x1b')](_0x1d0134[_0x54ab('0x1c')],{'raw':_0x1d0134[_0x54ab('0x1d')]?_0x1d0134[_0x54ab('0x1d')][_0x54ab('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d0134[_0x54ab('0x1d')]?_0x1d0134['options'][_0x54ab('0x1f')]||null:null,'attributes':_0x1d0134[_0x54ab('0x1d')]?_0x1d0134[_0x54ab('0x1d')][_0x54ab('0x20')]||null:null,'limit':_0x1d0134[_0x54ab('0x1d')]?_0x1d0134['options']['limit']||null:null})['then'](function(_0x40b622){logger[_0x54ab('0x12')](_0x54ab('0x1a'),_0x1d0134);logger['debug'](_0x54ab('0x1a'),_0x1d0134,JSON['stringify'](_0x40b622));_0x247f4a(_0x40b622);})[_0x54ab('0x19')](function(_0x14c786){logger[_0x54ab('0x15')](_0x54ab('0x1a'),_0x14c786['message'],_0x1d0134);_0x590c7c(_0x3d4ee8['error'](0x1f4,_0x14c786[_0x54ab('0x16')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0xdb95c4){return new Promise(function(_0x1b2b02,_0x155e7d){return db[_0x54ab('0x21')][_0x54ab('0x22')]({'where':_0xdb95c4[_0x54ab('0x1d')]?_0xdb95c4['options']['where']||null:null})[_0x54ab('0x23')](function(_0x23a55a){if(_0x23a55a){return _0x23a55a[_0x54ab('0x24')](_0xdb95c4[_0x54ab('0x1c')]['ids'],_['omit'](_0xdb95c4[_0x54ab('0x1c')],[_0x54ab('0x25'),'id'])||{});}})[_0x54ab('0x26')](function(_0xd9aa03){logger['info']('AddTags',_0xdb95c4);logger[_0x54ab('0x27')](_0x54ab('0x28'),_0xdb95c4,JSON[_0x54ab('0x14')](_0xd9aa03));_0x1b2b02(_0xd9aa03);})[_0x54ab('0x19')](function(_0x4a30eb){logger[_0x54ab('0x15')](_0x54ab('0x28'),_0x4a30eb['message'],_0xdb95c4);_0x155e7d(_this['error'](0x1f4,_0x4a30eb[_0x54ab('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 6c75f56..b16563a 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 _0x8c13=['update','removeListener','length','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x2a1584,_0x542881){var _0x4e22b3=function(_0x1298e0){while(--_0x1298e0){_0x2a1584['push'](_0x2a1584['shift']());}};_0x4e22b3(++_0x542881);}(_0x8c13,0x9e));var _0x38c1=function(_0x55db93,_0xae2f22){_0x55db93=_0x55db93-0x0;var _0x22530c=_0x8c13[_0x55db93];return _0x22530c;};'use strict';var OpenchannelInteractionEvents=require(_0x38c1('0x0'));var events=[_0x38c1('0x1'),_0x38c1('0x2'),_0x38c1('0x3')];function createListener(_0x392b25,_0x4732fe){return function(_0x31714f){_0x4732fe['emit'](_0x392b25,_0x31714f);};}function removeListener(_0x43d9e5,_0x33f8be){return function(){OpenchannelInteractionEvents[_0x38c1('0x4')](_0x43d9e5,_0x33f8be);};}exports['register']=function(_0x5d8236){for(var _0x4959ee=0x0,_0x4849f1=events[_0x38c1('0x5')];_0x4959ee<_0x4849f1;_0x4959ee++){var _0x34d51c=events[_0x4959ee];var _0x4e71c4=createListener(_0x38c1('0x6')+_0x34d51c,_0x5d8236);OpenchannelInteractionEvents['on'](_0x34d51c,_0x4e71c4);}}; \ No newline at end of file +var _0x739b=['openchannelInteraction:','save','remove','emit','register','length'];(function(_0x431569,_0x54aa77){var _0x13d95d=function(_0x52468a){while(--_0x52468a){_0x431569['push'](_0x431569['shift']());}};_0x13d95d(++_0x54aa77);}(_0x739b,0x18d));var _0xb739=function(_0x6b0d32,_0x2cafff){_0x6b0d32=_0x6b0d32-0x0;var _0x539a76=_0x739b[_0x6b0d32];return _0x539a76;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0xb739('0x0'),_0xb739('0x1'),'update'];function createListener(_0x25046e,_0x23b317){return function(_0x1c81ae){_0x23b317[_0xb739('0x2')](_0x25046e,_0x1c81ae);};}function removeListener(_0x14584c,_0x50f8cd){return function(){OpenchannelInteractionEvents['removeListener'](_0x14584c,_0x50f8cd);};}exports[_0xb739('0x3')]=function(_0x5f1cb8){for(var _0x4e3543=0x0,_0x718255=events[_0xb739('0x4')];_0x4e3543<_0x718255;_0x4e3543++){var _0x4ae180=events[_0x4e3543];var _0x41d9b0=createListener(_0xb739('0x5')+_0x4ae180,_0x5f1cb8);OpenchannelInteractionEvents['on'](_0x4ae180,_0x41d9b0);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index a055161..93f4781 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 _0x9b54=['/:id/reject','reject','destroy','exports','util','path','Router','../../components/auth/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked','openchannelmessage:create','put','update','accept'];(function(_0x954b3a,_0x10a7c1){var _0x3a313e=function(_0x1070ad){while(--_0x1070ad){_0x954b3a['push'](_0x954b3a['shift']());}};_0x3a313e(++_0x10a7c1);}(_0x9b54,0x88));var _0x49b5=function(_0x4536a6,_0x5ae218){_0x4536a6=_0x4536a6-0x0;var _0x479c5f=_0x9b54[_0x4536a6];return _0x479c5f;};'use strict';var multer=require('multer');var util=require(_0x49b5('0x0'));var path=require(_0x49b5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x49b5('0x2')]();var auth=require(_0x49b5('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x49b5('0x4'));var controller=require(_0x49b5('0x5'));router[_0x49b5('0x6')]('/',auth[_0x49b5('0x7')](),controller[_0x49b5('0x8')]);router['get'](_0x49b5('0x9'),auth[_0x49b5('0x7')](),controller['describe']);router[_0x49b5('0x6')](_0x49b5('0xa'),auth[_0x49b5('0x7')](),controller[_0x49b5('0xb')]);router[_0x49b5('0xc')]('/',auth[_0x49b5('0x7')](),interaction[_0x49b5('0xd')]('openchannel',_0x49b5('0xe')),controller['create']);router[_0x49b5('0xf')](_0x49b5('0xa'),auth[_0x49b5('0x7')](),controller[_0x49b5('0x10')]);router[_0x49b5('0xf')]('/:id/accept',auth[_0x49b5('0x7')](),controller[_0x49b5('0x11')]);router[_0x49b5('0xf')](_0x49b5('0x12'),auth['isAuthenticated'](),controller[_0x49b5('0x13')]);router['delete']('/:id',auth[_0x49b5('0x7')](),controller[_0x49b5('0x14')]);module[_0x49b5('0x15')]=router; \ No newline at end of file +var _0x197f=['post','openchannel','openchannelmessage:create','create','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','util','express','Router','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','index','/describe','isAuthenticated','describe','show'];(function(_0x55da5e,_0x55ba7d){var _0x2e0d28=function(_0x4fb36a){while(--_0x4fb36a){_0x55da5e['push'](_0x55da5e['shift']());}};_0x2e0d28(++_0x55ba7d);}(_0x197f,0xcc));var _0xf197=function(_0x1fb4ff,_0x51a7df){_0x1fb4ff=_0x1fb4ff-0x0;var _0x2c2353=_0x197f[_0x1fb4ff];return _0x2c2353;};'use strict';var multer=require('multer');var util=require(_0xf197('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf197('0x1'));var router=express[_0xf197('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xf197('0x3'));var config=require(_0xf197('0x4'));var controller=require(_0xf197('0x5'));router[_0xf197('0x6')]('/',auth['isAuthenticated'](),controller[_0xf197('0x7')]);router[_0xf197('0x6')](_0xf197('0x8'),auth[_0xf197('0x9')](),controller[_0xf197('0xa')]);router[_0xf197('0x6')]('/:id',auth[_0xf197('0x9')](),controller[_0xf197('0xb')]);router[_0xf197('0xc')]('/',auth[_0xf197('0x9')](),interaction['tracked'](_0xf197('0xd'),_0xf197('0xe')),controller[_0xf197('0xf')]);router[_0xf197('0x10')](_0xf197('0x11'),auth['isAuthenticated'](),controller[_0xf197('0x12')]);router['put'](_0xf197('0x13'),auth['isAuthenticated'](),controller[_0xf197('0x14')]);router['put'](_0xf197('0x15'),auth[_0xf197('0x9')](),controller[_0xf197('0x16')]);router[_0xf197('0x17')](_0xf197('0x11'),auth[_0xf197('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 191b340..55e4be5 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 _0x24be=['DATE','TEXT','BOOLEAN','ENUM','out'];(function(_0x2601b4,_0x315e78){var _0x3e3661=function(_0x13b45b){while(--_0x13b45b){_0x2601b4['push'](_0x2601b4['shift']());}};_0x3e3661(++_0x315e78);}(_0x24be,0x10a));var _0xe24b=function(_0x26a225,_0x1d61f5){_0x26a225=_0x26a225-0x0;var _0x1cb4eb=_0x24be[_0x26a225];return _0x1cb4eb;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xe24b('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe24b('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe24b('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe24b('0x2')]('in',_0xe24b('0x3')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xe24b('0x4')]}}; \ No newline at end of file +var _0x4008=['TEXT','medium','BOOLEAN','out','sequelize','exports'];(function(_0x4dd15b,_0x1d880a){var _0x2445f2=function(_0x236d63){while(--_0x236d63){_0x4dd15b['push'](_0x4dd15b['shift']());}};_0x2445f2(++_0x1d880a);}(_0x4008,0xa6));var _0x8400=function(_0x21679b,_0x574c82){_0x21679b=_0x21679b-0x0;var _0x4b05ba=_0x4008[_0x21679b];return _0x4b05ba;};'use strict';var Sequelize=require(_0x8400('0x0'));module[_0x8400('0x1')]={'body':{'type':Sequelize[_0x8400('0x2')](_0x8400('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8400('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x8400('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x8400('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index ec9ae41..8e1fd61 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 _0x27f1=['agent','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','SIP/%s','rejectmessage','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.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','OpenchannelMessage,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','destroy','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','count','findAll','rows','show','params','includeAll','include','find','create','body','describe','openchannel','read','readAt','format','UserId','user','CmContact','get','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','manual','interface','channel','event','accept','EventManager','acceptmessage'];(function(_0x4b92b9,_0x1bd47d){var _0x157b9d=function(_0x41d8e4){while(--_0x41d8e4){_0x4b92b9['push'](_0x4b92b9['shift']());}};_0x157b9d(++_0x1bd47d);}(_0x27f1,0x7f));var _0x127f=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x27f1[_0x2b4411];return _0x8e41ef;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x127f('0x0'));var jsonpatch=require(_0x127f('0x1'));var rp=require(_0x127f('0x2'));var moment=require(_0x127f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x127f('0x4'));var path=require(_0x127f('0x5'));var sox=require(_0x127f('0x6'));var csv=require(_0x127f('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x127f('0x8'));var crypto=require(_0x127f('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x127f('0xa'));var toCsv=require(_0x127f('0x7'));var querystring=require(_0x127f('0xb'));var Papa=require(_0x127f('0xc'));var Redis=require(_0x127f('0xd'));var authService=require(_0x127f('0xe'));var qs=require(_0x127f('0xf'));var as=require(_0x127f('0x10'));var hardwareService=require(_0x127f('0x11'));var logger=require(_0x127f('0x12'))(_0x127f('0x13'));var utils=require(_0x127f('0x14'));var config=require(_0x127f('0x15'));var db=require(_0x127f('0x16'))['db'];config[_0x127f('0x17')]=_[_0x127f('0x18')](config[_0x127f('0x17')],{'host':_0x127f('0x19'),'port':0x18eb});var socket=require(_0x127f('0x1a'))(new Redis(config['redis']));require(_0x127f('0x1b'))[_0x127f('0x1c')](socket);var jayson=require(_0x127f('0x1d'));var client=jayson[_0x127f('0x1e')][_0x127f('0x1f')]({'port':0x232c});var client9002=jayson[_0x127f('0x1e')]['http']({'port':0x232a});function checkPasswordPattern(_0x1f7f09,_0x347899,_0x3a0046){if(_0x3a0046){var _0xe65aad=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xe65aad[_0x127f('0x20')](_0x347899)){return _0x1f7f09;}else{throw new db[(_0x127f('0x21'))][(_0x127f('0x22'))](_0x127f('0x23'));}}else{return _0x1f7f09;}}function respondWithRpcPromise(_0x7b24df,_0x3f13c2,_0x282bc2,_0x26380e){return new BPromise(function(_0x33d9c7,_0x343c01){var _0x31bc07=_0x26380e||client;return _0x31bc07['request'](_0x7b24df,_0x282bc2)[_0x127f('0x24')](function(_0x5f0c9f){logger[_0x127f('0x25')](_0x127f('0x26'),_0x3f13c2,'request\x20sent');logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x3f13c2,'request\x20sent',JSON['stringify'](_0x5f0c9f));if(_0x5f0c9f['error']){if(_0x5f0c9f[_0x127f('0x27')][_0x127f('0x28')]===0x1f4){logger[_0x127f('0x27')](_0x127f('0x26'),_0x3f13c2,_0x5f0c9f[_0x127f('0x27')][_0x127f('0x29')]);return _0x343c01(_0x5f0c9f[_0x127f('0x27')][_0x127f('0x29')]);}logger[_0x127f('0x27')](_0x127f('0x26'),_0x3f13c2,_0x5f0c9f['error']['message']);return _0x33d9c7(_0x5f0c9f[_0x127f('0x27')]['message']);}else{logger[_0x127f('0x25')](_0x127f('0x26'),_0x3f13c2,_0x127f('0x2a'));_0x33d9c7(_0x5f0c9f[_0x127f('0x2b')][_0x127f('0x29')]);}})[_0x127f('0x2c')](function(_0x24e5b6){logger[_0x127f('0x27')](_0x127f('0x26'),_0x3f13c2,_0x24e5b6);_0x343c01(_0x24e5b6);});});}function respondWithStatusCode(_0x34c021,_0x91fbd2){_0x91fbd2=_0x91fbd2||0xcc;return function(_0x541a32){if(_0x541a32){return _0x34c021[_0x127f('0x2d')](_0x91fbd2);}return _0x34c021[_0x127f('0x2e')](_0x91fbd2)[_0x127f('0x2f')]();};}function respondWithResult(_0xa6c31a,_0x5d6849){_0x5d6849=_0x5d6849||0xc8;return function(_0x419f40){if(_0x419f40){return _0xa6c31a[_0x127f('0x2e')](_0x5d6849)[_0x127f('0x30')](_0x419f40);}};}function respondWithFilteredResult(_0x56d91f,_0x4b00a2){return function(_0x12db1c){if(_0x12db1c){var _0x3120be=_0x12db1c['count'],_0x1e5b32=_0x4b00a2['offset'],_0x2eb52d=_0x4b00a2[_0x127f('0x31')]+_0x4b00a2[_0x127f('0x32')],_0x50ca9b;if(_0x2eb52d>=_0x3120be){_0x2eb52d=_0x3120be;_0x50ca9b=0xc8;}else{_0x50ca9b=0xce;}_0x56d91f[_0x127f('0x2e')](_0x50ca9b);return _0x56d91f[_0x127f('0x33')]('Content-Range',_0x1e5b32+'-'+_0x2eb52d+'/'+_0x3120be)[_0x127f('0x30')](_0x12db1c);}return null;};}function patchUpdates(_0x540e79){return function(_0x13274f){try{jsonpatch[_0x127f('0x34')](_0x13274f,_0x540e79,!![]);}catch(_0x31f317){return BPromise[_0x127f('0x35')](_0x31f317);}return _0x13274f[_0x127f('0x36')]();};}function saveUpdates(_0x1fd5ac,_0x170a91){return function(_0x565fa1){if(_0x565fa1){return _0x565fa1[_0x127f('0x37')](_0x1fd5ac)['then'](function(_0x187a02){return _0x187a02;});}return null;};}function removeEntity(_0xc4cc7f,_0x4df0bb){return function(_0x80e083){if(_0x80e083){return _0x80e083[_0x127f('0x38')]()['then'](function(){_0xc4cc7f['status'](0xcc)[_0x127f('0x2f')]();});}};}function handleEntityNotFound(_0xa5f94,_0x3bf2b3){return function(_0x20ac50){if(!_0x20ac50){_0xa5f94[_0x127f('0x2d')](0x194);}return _0x20ac50;};}function handleError(_0x129544,_0x4c09ad){_0x4c09ad=_0x4c09ad||0x1f4;return function(_0x2f0ad){logger[_0x127f('0x27')](_0x2f0ad['stack']);if(_0x2f0ad[_0x127f('0x39')]){delete _0x2f0ad[_0x127f('0x39')];}_0x129544[_0x127f('0x2e')](_0x4c09ad)[_0x127f('0x3a')](_0x2f0ad);};}exports[_0x127f('0x3b')]=function(_0x4fc547,_0x5b03e5){var _0x16a76c={},_0x47faaf={},_0x5457f5={'count':0x0,'rows':[]};var _0x151ace=_[_0x127f('0x3c')](db[_0x127f('0x3d')][_0x127f('0x3e')],function(_0x47f9b8){return{'name':_0x47f9b8[_0x127f('0x3f')],'type':_0x47f9b8[_0x127f('0x40')]['key']};});_0x47faaf[_0x127f('0x41')]=_[_0x127f('0x3c')](_0x151ace,_0x127f('0x39'));_0x47faaf[_0x127f('0x42')]=_[_0x127f('0x43')](_0x4fc547['query']);_0x47faaf[_0x127f('0x44')]=_[_0x127f('0x45')](_0x47faaf[_0x127f('0x41')],_0x47faaf[_0x127f('0x42')]);_0x16a76c['attributes']=_[_0x127f('0x45')](_0x47faaf[_0x127f('0x41')],qs[_0x127f('0x46')](_0x4fc547[_0x127f('0x42')][_0x127f('0x46')]));_0x16a76c[_0x127f('0x47')]=_0x16a76c[_0x127f('0x47')][_0x127f('0x48')]?_0x16a76c[_0x127f('0x47')]:_0x47faaf[_0x127f('0x41')];if(!_0x4fc547[_0x127f('0x42')][_0x127f('0x49')](_0x127f('0x4a'))){_0x16a76c[_0x127f('0x32')]=qs[_0x127f('0x32')](_0x4fc547[_0x127f('0x42')][_0x127f('0x32')]);_0x16a76c[_0x127f('0x31')]=qs[_0x127f('0x31')](_0x4fc547[_0x127f('0x42')][_0x127f('0x31')]);}_0x16a76c['order']=qs[_0x127f('0x4b')](_0x4fc547[_0x127f('0x42')]['sort']);_0x16a76c[_0x127f('0x4c')]=qs[_0x127f('0x44')](_['pick'](_0x4fc547[_0x127f('0x42')],_0x47faaf['filters']));if(_0x4fc547[_0x127f('0x42')][_0x127f('0x4d')]){_0x16a76c['where']=_['merge'](_0x16a76c['where'],{'$or':_['map'](_0x151ace,function(_0x4df8d8){if(_0x4df8d8[_0x127f('0x40')]!==_0x127f('0x4e')){var _0x2db7b9={};_0x2db7b9[_0x4df8d8[_0x127f('0x39')]]={'$like':'%'+_0x4fc547[_0x127f('0x42')][_0x127f('0x4d')]+'%'};return _0x2db7b9;}})});}_0x16a76c=_[_0x127f('0x4f')]({},_0x16a76c,_0x4fc547[_0x127f('0x50')]);var _0x4a7109={'where':_0x16a76c[_0x127f('0x4c')]};return db['OpenchannelMessage'][_0x127f('0x51')](_0x4a7109)[_0x127f('0x24')](function(_0x5b86e8){_0x5457f5[_0x127f('0x51')]=_0x5b86e8;if(_0x4fc547[_0x127f('0x42')]['includeAll']){_0x16a76c['include']=[{'all':!![]}];}return db[_0x127f('0x3d')][_0x127f('0x52')](_0x16a76c);})[_0x127f('0x24')](function(_0x358c20){_0x5457f5[_0x127f('0x53')]=_0x358c20;return _0x5457f5;})['then'](respondWithFilteredResult(_0x5b03e5,_0x16a76c))[_0x127f('0x2c')](handleError(_0x5b03e5,null));};exports[_0x127f('0x54')]=function(_0x234cdc,_0x1b6770){var _0x17cfec={'raw':!![],'where':{'id':_0x234cdc[_0x127f('0x55')]['id']}},_0x32dd71={};_0x32dd71['model']=_[_0x127f('0x43')](db[_0x127f('0x3d')][_0x127f('0x3e')]);_0x32dd71[_0x127f('0x42')]=_[_0x127f('0x43')](_0x234cdc['query']);_0x32dd71['filters']=_[_0x127f('0x45')](_0x32dd71['model'],_0x32dd71[_0x127f('0x42')]);_0x17cfec[_0x127f('0x47')]=_[_0x127f('0x45')](_0x32dd71[_0x127f('0x41')],qs['fields'](_0x234cdc[_0x127f('0x42')][_0x127f('0x46')]));_0x17cfec['attributes']=_0x17cfec['attributes'][_0x127f('0x48')]?_0x17cfec['attributes']:_0x32dd71[_0x127f('0x41')];if(_0x234cdc[_0x127f('0x42')][_0x127f('0x56')]){_0x17cfec[_0x127f('0x57')]=[{'all':!![]}];}_0x17cfec=_[_0x127f('0x4f')]({},_0x17cfec,_0x234cdc[_0x127f('0x50')]);return db[_0x127f('0x3d')][_0x127f('0x58')](_0x17cfec)[_0x127f('0x24')](handleEntityNotFound(_0x1b6770,null))['then'](respondWithResult(_0x1b6770,null))[_0x127f('0x2c')](handleError(_0x1b6770,null));};exports[_0x127f('0x59')]=function(_0x4f3bb4,_0x3a3ec9){return db['OpenchannelMessage']['create'](_0x4f3bb4['body'],{})[_0x127f('0x24')](respondWithResult(_0x3a3ec9,0xc9))[_0x127f('0x2c')](handleError(_0x3a3ec9,null));};exports[_0x127f('0x37')]=function(_0x261151,_0x43d696){if(_0x261151[_0x127f('0x5a')]['id']){delete _0x261151[_0x127f('0x5a')]['id'];}return db[_0x127f('0x3d')][_0x127f('0x58')]({'where':{'id':_0x261151[_0x127f('0x55')]['id']}})['then'](handleEntityNotFound(_0x43d696,null))[_0x127f('0x24')](saveUpdates(_0x261151[_0x127f('0x5a')],null))[_0x127f('0x24')](respondWithResult(_0x43d696,null))[_0x127f('0x2c')](handleError(_0x43d696,null));};exports[_0x127f('0x38')]=function(_0x13c1a4,_0x4e0d2e){return db['OpenchannelMessage'][_0x127f('0x58')]({'where':{'id':_0x13c1a4['params']['id']}})['then'](handleEntityNotFound(_0x4e0d2e,null))[_0x127f('0x24')](removeEntity(_0x4e0d2e,null))[_0x127f('0x2c')](handleError(_0x4e0d2e,null));};exports['describe']=function(_0x5bf9e2,_0x53ed32){return db['OpenchannelMessage'][_0x127f('0x5b')]()['then'](respondWithResult(_0x53ed32,null))['catch'](handleError(_0x53ed32,null));};var interaction_log=require(_0x127f('0x12'))('openchannel-interactions');exports['accept']=function(_0x295e40,_0x2fa24e,_0x431b24){var _0x56e3a3={'channel':_0x127f('0x5c')};if(_0x295e40['body']['id']){delete _0x295e40[_0x127f('0x5a')]['id'];}_0x295e40['body'][_0x127f('0x5d')]=!![];_0x295e40[_0x127f('0x5a')][_0x127f('0x5e')]=moment()[_0x127f('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x295e40[_0x127f('0x5a')]['UserId']=_0x295e40[_0x127f('0x5a')][_0x127f('0x60')]||_0x295e40[_0x127f('0x61')]['id'];return db[_0x127f('0x3d')][_0x127f('0x58')]({'where':{'id':_0x295e40[_0x127f('0x55')]['id'],'UserId':null},'include':[{'model':db[_0x127f('0x62')],'as':'Contact'}]})[_0x127f('0x24')](handleEntityNotFound(_0x2fa24e,null))[_0x127f('0x24')](saveUpdates(_0x295e40['body'],null))[_0x127f('0x24')](function(_0x4f627b){if(_0x4f627b){_0x56e3a3['message']=_0x4f627b[_0x127f('0x63')]({'plain':!![]});return db['OpenchannelInteraction'][_0x127f('0x58')]({'where':{'id':_0x4f627b['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2fa24e,null))['then'](function(_0x486bbd){if(_0x486bbd){return _0x486bbd[_0x127f('0x37')]({'UserId':_0x295e40[_0x127f('0x5a')][_0x127f('0x60')],'read1stAt':_[_0x127f('0x64')](_0x486bbd['read1stAt'])?moment()[_0x127f('0x5f')](_0x127f('0x65')):undefined});}return null;})[_0x127f('0x24')](function(_0x26010f){if(_0x26010f){_0x56e3a3[_0x127f('0x66')]=_0x26010f[_0x127f('0x63')]({'plain':!![]});interaction_log['info'](_0x127f('0x67'),_0x295e40['user']['id'],_0x295e40[_0x127f('0x61')][_0x127f('0x39')],_0x295e40[_0x127f('0x61')]['role'],_0x56e3a3[_0x127f('0x66')]['id'],_0x295e40[_0x127f('0x5a')]?JSON[_0x127f('0x68')](_0x295e40[_0x127f('0x5a')]):_0x127f('0x69'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x56e3a3);}return null;})['then'](function(_0x446399){if(_0x446399){if(_0x295e40['body'][_0x127f('0x6a')]){_0x56e3a3['message'][_0x127f('0x6b')]=util[_0x127f('0x5f')]('SIP/%s',_0x295e40[_0x127f('0x61')][_0x127f('0x39')]);_0x56e3a3['message'][_0x127f('0x6c')]=_0x56e3a3[_0x127f('0x6c')];_0x56e3a3[_0x127f('0x29')][_0x127f('0x6d')]=_0x127f('0x6e');return respondWithRpcPromise('EventManager',_0x127f('0x6f'),{'event':_0x127f('0x70'),'message':_0x56e3a3[_0x127f('0x29')]},client9002)[_0x127f('0x24')](function(){return _0x56e3a3;});}return _0x56e3a3;}return null;})['then'](respondWithResult(_0x2fa24e,null))[_0x127f('0x2c')](handleError(_0x2fa24e,null));};var interaction_log=require(_0x127f('0x12'))('openchannel-interactions');exports['reject']=function(_0x4dec0b,_0x42a524,_0x27c547){var _0xbdd4ab={'agent':{},'channel':_0x127f('0x5c')};if(_0x4dec0b['body']['id']){delete _0x4dec0b['body']['id'];}_0x4dec0b[_0x127f('0x5a')][_0x127f('0x60')]=_0x4dec0b[_0x127f('0x5a')][_0x127f('0x60')]||_0x4dec0b['user']['id'];_0xbdd4ab[_0x127f('0x71')]['id']=_0x4dec0b[_0x127f('0x5a')][_0x127f('0x60')];return db['OpenchannelMessage']['find']({'where':{'id':_0x4dec0b[_0x127f('0x55')]['id'],'UserId':null}})[_0x127f('0x24')](handleEntityNotFound(_0x42a524,null))[_0x127f('0x24')](function(_0x3c3053){if(_0x3c3053){_0xbdd4ab['message']=_0x3c3053['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x127f('0x58')]({'where':{'id':_0x3c3053[_0x127f('0x72')]}});}return null;})['then'](handleEntityNotFound(_0x42a524,null))[_0x127f('0x24')](function(_0x2807f4){if(_0x2807f4){_0xbdd4ab[_0x127f('0x66')]=_0x2807f4[_0x127f('0x63')]({'plain':!![]});interaction_log[_0x127f('0x25')](_0x127f('0x73'),_0x4dec0b[_0x127f('0x61')]['id'],_0x4dec0b[_0x127f('0x61')][_0x127f('0x39')],_0x4dec0b['user'][_0x127f('0x74')],_0xbdd4ab[_0x127f('0x66')]['id'],_0x4dec0b[_0x127f('0x5a')]?JSON[_0x127f('0x68')](_0x4dec0b[_0x127f('0x5a')]):_0x127f('0x69'));return respondWithRpcPromise(_0x127f('0x75'),'rejectMessage',_0xbdd4ab);}return null;})['then'](function(_0x272d0f){if(_0x272d0f){_0x272d0f['message']['interface']=util[_0x127f('0x5f')](_0x127f('0x76'),_0x4dec0b[_0x127f('0x61')]['name']);_0x272d0f[_0x127f('0x29')]['channel']=_0xbdd4ab[_0x127f('0x6c')];_0x272d0f[_0x127f('0x29')][_0x127f('0x6d')]='reject';respondWithRpcPromise(_0x127f('0x6f'),_0x127f('0x6f'),{'event':_0x127f('0x77'),'message':_0x272d0f[_0x127f('0x29')]},client9002);return _0xbdd4ab;}return null;})['then'](respondWithResult(_0x42a524,null))['catch'](handleError(_0x42a524,null));}; \ No newline at end of file +var _0x6267=['to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','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','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','status','end','json','count','offset','limit','Content-Range','apply','save','update','destroy','sendStatus','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','params','include','find','catch','body','describe','openchannel-interactions','accept','openchannel','read','format','UserId','user','CmContact','Contact','OpenchannelInteractionId','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','manual','SIP/%s','channel','EventManager','acceptmessage','agent','get','OpenchannelInteraction','interaction','RejectMessage','rejectMessage','event','reject','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x6267,0x6e));var _0x7626=function(_0x3bf0db,_0x1a5e07){_0x3bf0db=_0x3bf0db-0x0;var _0x388192=_0x6267[_0x3bf0db];return _0x388192;};'use strict';var pdf=require(_0x7626('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7626('0x1'));var jsonpatch=require(_0x7626('0x2'));var rp=require(_0x7626('0x3'));var moment=require(_0x7626('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7626('0x5'));var util=require(_0x7626('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x7626('0x7'));var ejs=require(_0x7626('0x8'));var fs=require('fs');var _=require(_0x7626('0x9'));var squel=require(_0x7626('0xa'));var crypto=require(_0x7626('0xb'));var jsforce=require(_0x7626('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7626('0x7'));var querystring=require('querystring');var Papa=require(_0x7626('0xd'));var Redis=require(_0x7626('0xe'));var authService=require(_0x7626('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7626('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7626('0x11'))('api');var utils=require(_0x7626('0x12'));var config=require('../../config/environment');var db=require(_0x7626('0x13'))['db'];config[_0x7626('0x14')]=_[_0x7626('0x15')](config['redis'],{'host':_0x7626('0x16'),'port':0x18eb});var socket=require(_0x7626('0x17'))(new Redis(config['redis']));require(_0x7626('0x18'))['register'](socket);var jayson=require(_0x7626('0x19'));var client=jayson['client'][_0x7626('0x1a')]({'port':0x232c});var client9002=jayson[_0x7626('0x1b')][_0x7626('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x2dbf64,_0x5cabf8,_0x5add93){if(_0x5add93){var _0x597038=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x597038[_0x7626('0x1c')](_0x5cabf8)){return _0x2dbf64;}else{throw new db[(_0x7626('0x1d'))][(_0x7626('0x1e'))](_0x7626('0x1f'));}}else{return _0x2dbf64;}}function respondWithRpcPromise(_0x1a38c8,_0x2689c1,_0x314bc8,_0x31aeff){return new BPromise(function(_0x4c0c2c,_0x584c8a){var _0x5b01ce=_0x31aeff||client;return _0x5b01ce['request'](_0x1a38c8,_0x314bc8)[_0x7626('0x20')](function(_0x451eb8){logger[_0x7626('0x21')](_0x7626('0x22'),_0x2689c1,'request\x20sent');logger[_0x7626('0x23')](_0x7626('0x24'),_0x2689c1,_0x7626('0x25'),JSON[_0x7626('0x26')](_0x451eb8));if(_0x451eb8[_0x7626('0x27')]){if(_0x451eb8[_0x7626('0x27')][_0x7626('0x28')]===0x1f4){logger[_0x7626('0x27')](_0x7626('0x22'),_0x2689c1,_0x451eb8['error']['message']);return _0x584c8a(_0x451eb8[_0x7626('0x27')]['message']);}logger[_0x7626('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x2689c1,_0x451eb8[_0x7626('0x27')][_0x7626('0x29')]);return _0x4c0c2c(_0x451eb8[_0x7626('0x27')][_0x7626('0x29')]);}else{logger[_0x7626('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x2689c1,_0x7626('0x25'));_0x4c0c2c(_0x451eb8['result'][_0x7626('0x29')]);}})['catch'](function(_0x4ecbba){logger[_0x7626('0x27')](_0x7626('0x22'),_0x2689c1,_0x4ecbba);_0x584c8a(_0x4ecbba);});});}function respondWithStatusCode(_0x524eeb,_0x191c64){_0x191c64=_0x191c64||0xcc;return function(_0x470706){if(_0x470706){return _0x524eeb['sendStatus'](_0x191c64);}return _0x524eeb[_0x7626('0x2a')](_0x191c64)[_0x7626('0x2b')]();};}function respondWithResult(_0x1b4cd2,_0x582a98){_0x582a98=_0x582a98||0xc8;return function(_0x4b0ce5){if(_0x4b0ce5){return _0x1b4cd2['status'](_0x582a98)[_0x7626('0x2c')](_0x4b0ce5);}};}function respondWithFilteredResult(_0x1a6151,_0x195d7c){return function(_0x2beaf9){if(_0x2beaf9){var _0x83b79a=_0x2beaf9[_0x7626('0x2d')],_0x5d0407=_0x195d7c['offset'],_0x58c746=_0x195d7c[_0x7626('0x2e')]+_0x195d7c[_0x7626('0x2f')],_0x14c63b;if(_0x58c746>=_0x83b79a){_0x58c746=_0x83b79a;_0x14c63b=0xc8;}else{_0x14c63b=0xce;}_0x1a6151[_0x7626('0x2a')](_0x14c63b);return _0x1a6151['set'](_0x7626('0x30'),_0x5d0407+'-'+_0x58c746+'/'+_0x83b79a)[_0x7626('0x2c')](_0x2beaf9);}return null;};}function patchUpdates(_0x33879b){return function(_0x49312c){try{jsonpatch[_0x7626('0x31')](_0x49312c,_0x33879b,!![]);}catch(_0x446c04){return BPromise['reject'](_0x446c04);}return _0x49312c[_0x7626('0x32')]();};}function saveUpdates(_0xad3776,_0x47617d){return function(_0x4826b7){if(_0x4826b7){return _0x4826b7[_0x7626('0x33')](_0xad3776)[_0x7626('0x20')](function(_0x5673bd){return _0x5673bd;});}return null;};}function removeEntity(_0x264ce3,_0x46e705){return function(_0x4ad89f){if(_0x4ad89f){return _0x4ad89f[_0x7626('0x34')]()[_0x7626('0x20')](function(){_0x264ce3['status'](0xcc)[_0x7626('0x2b')]();});}};}function handleEntityNotFound(_0x1055e8,_0x631748){return function(_0x1a94c1){if(!_0x1a94c1){_0x1055e8[_0x7626('0x35')](0x194);}return _0x1a94c1;};}function handleError(_0x314c7d,_0x8c620b){_0x8c620b=_0x8c620b||0x1f4;return function(_0xc32778){logger[_0x7626('0x27')](_0xc32778[_0x7626('0x36')]);if(_0xc32778[_0x7626('0x37')]){delete _0xc32778[_0x7626('0x37')];}_0x314c7d[_0x7626('0x2a')](_0x8c620b)[_0x7626('0x38')](_0xc32778);};}exports[_0x7626('0x39')]=function(_0x268844,_0x4f58c7){var _0x3cf686={},_0x126f84={},_0x377d05={'count':0x0,'rows':[]};var _0x4b33eb=_[_0x7626('0x3a')](db[_0x7626('0x3b')][_0x7626('0x3c')],function(_0x2997fa){return{'name':_0x2997fa[_0x7626('0x3d')],'type':_0x2997fa['type']['key']};});_0x126f84['model']=_[_0x7626('0x3a')](_0x4b33eb,_0x7626('0x37'));_0x126f84[_0x7626('0x3e')]=_[_0x7626('0x3f')](_0x268844[_0x7626('0x3e')]);_0x126f84[_0x7626('0x40')]=_['intersection'](_0x126f84[_0x7626('0x41')],_0x126f84[_0x7626('0x3e')]);_0x3cf686['attributes']=_[_0x7626('0x42')](_0x126f84['model'],qs[_0x7626('0x43')](_0x268844[_0x7626('0x3e')][_0x7626('0x43')]));_0x3cf686[_0x7626('0x44')]=_0x3cf686['attributes']['length']?_0x3cf686[_0x7626('0x44')]:_0x126f84['model'];if(!_0x268844[_0x7626('0x3e')][_0x7626('0x45')](_0x7626('0x46'))){_0x3cf686[_0x7626('0x2f')]=qs[_0x7626('0x2f')](_0x268844[_0x7626('0x3e')][_0x7626('0x2f')]);_0x3cf686[_0x7626('0x2e')]=qs[_0x7626('0x2e')](_0x268844['query']['offset']);}_0x3cf686[_0x7626('0x47')]=qs['sort'](_0x268844[_0x7626('0x3e')][_0x7626('0x48')]);_0x3cf686[_0x7626('0x49')]=qs['filters'](_[_0x7626('0x4a')](_0x268844[_0x7626('0x3e')],_0x126f84['filters']));if(_0x268844[_0x7626('0x3e')][_0x7626('0x4b')]){_0x3cf686[_0x7626('0x49')]=_[_0x7626('0x4c')](_0x3cf686[_0x7626('0x49')],{'$or':_[_0x7626('0x3a')](_0x4b33eb,function(_0x28930b){if(_0x28930b[_0x7626('0x4d')]!==_0x7626('0x4e')){var _0x383c56={};_0x383c56[_0x28930b[_0x7626('0x37')]]={'$like':'%'+_0x268844[_0x7626('0x3e')]['filter']+'%'};return _0x383c56;}})});}_0x3cf686=_[_0x7626('0x4c')]({},_0x3cf686,_0x268844[_0x7626('0x4f')]);var _0xcb7aea={'where':_0x3cf686['where']};return db[_0x7626('0x3b')][_0x7626('0x2d')](_0xcb7aea)[_0x7626('0x20')](function(_0x1274bf){_0x377d05[_0x7626('0x2d')]=_0x1274bf;if(_0x268844[_0x7626('0x3e')][_0x7626('0x50')]){_0x3cf686['include']=[{'all':!![]}];}return db[_0x7626('0x3b')]['findAll'](_0x3cf686);})['then'](function(_0x3905fe){_0x377d05[_0x7626('0x51')]=_0x3905fe;return _0x377d05;})['then'](respondWithFilteredResult(_0x4f58c7,_0x3cf686))['catch'](handleError(_0x4f58c7,null));};exports['show']=function(_0x558e31,_0x2439aa){var _0x1c5beb={'raw':!![],'where':{'id':_0x558e31[_0x7626('0x52')]['id']}},_0x4ed9c6={};_0x4ed9c6[_0x7626('0x41')]=_[_0x7626('0x3f')](db[_0x7626('0x3b')]['rawAttributes']);_0x4ed9c6[_0x7626('0x3e')]=_[_0x7626('0x3f')](_0x558e31['query']);_0x4ed9c6['filters']=_['intersection'](_0x4ed9c6[_0x7626('0x41')],_0x4ed9c6[_0x7626('0x3e')]);_0x1c5beb[_0x7626('0x44')]=_['intersection'](_0x4ed9c6['model'],qs['fields'](_0x558e31['query'][_0x7626('0x43')]));_0x1c5beb['attributes']=_0x1c5beb[_0x7626('0x44')]['length']?_0x1c5beb[_0x7626('0x44')]:_0x4ed9c6['model'];if(_0x558e31[_0x7626('0x3e')]['includeAll']){_0x1c5beb[_0x7626('0x53')]=[{'all':!![]}];}_0x1c5beb=_[_0x7626('0x4c')]({},_0x1c5beb,_0x558e31['options']);return db[_0x7626('0x3b')][_0x7626('0x54')](_0x1c5beb)[_0x7626('0x20')](handleEntityNotFound(_0x2439aa,null))['then'](respondWithResult(_0x2439aa,null))[_0x7626('0x55')](handleError(_0x2439aa,null));};exports['create']=function(_0x168b14,_0x1a1962){return db[_0x7626('0x3b')]['create'](_0x168b14[_0x7626('0x56')],{})[_0x7626('0x20')](respondWithResult(_0x1a1962,0xc9))[_0x7626('0x55')](handleError(_0x1a1962,null));};exports[_0x7626('0x33')]=function(_0x5ecdc3,_0xfd369b){if(_0x5ecdc3[_0x7626('0x56')]['id']){delete _0x5ecdc3[_0x7626('0x56')]['id'];}return db[_0x7626('0x3b')]['find']({'where':{'id':_0x5ecdc3[_0x7626('0x52')]['id']}})[_0x7626('0x20')](handleEntityNotFound(_0xfd369b,null))[_0x7626('0x20')](saveUpdates(_0x5ecdc3['body'],null))[_0x7626('0x20')](respondWithResult(_0xfd369b,null))[_0x7626('0x55')](handleError(_0xfd369b,null));};exports[_0x7626('0x34')]=function(_0x35f41c,_0x1834a4){return db['OpenchannelMessage']['find']({'where':{'id':_0x35f41c[_0x7626('0x52')]['id']}})[_0x7626('0x20')](handleEntityNotFound(_0x1834a4,null))['then'](removeEntity(_0x1834a4,null))[_0x7626('0x55')](handleError(_0x1834a4,null));};exports[_0x7626('0x57')]=function(_0x495984,_0x1eec2b){return db['OpenchannelMessage'][_0x7626('0x57')]()[_0x7626('0x20')](respondWithResult(_0x1eec2b,null))[_0x7626('0x55')](handleError(_0x1eec2b,null));};var interaction_log=require(_0x7626('0x11'))(_0x7626('0x58'));exports[_0x7626('0x59')]=function(_0xe92c8,_0x41e0ec,_0x203ed5){var _0x246702={'channel':_0x7626('0x5a')};if(_0xe92c8[_0x7626('0x56')]['id']){delete _0xe92c8[_0x7626('0x56')]['id'];}_0xe92c8['body'][_0x7626('0x5b')]=!![];_0xe92c8[_0x7626('0x56')]['readAt']=moment()[_0x7626('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0xe92c8[_0x7626('0x56')][_0x7626('0x5d')]=_0xe92c8['body'][_0x7626('0x5d')]||_0xe92c8[_0x7626('0x5e')]['id'];return db[_0x7626('0x3b')][_0x7626('0x54')]({'where':{'id':_0xe92c8[_0x7626('0x52')]['id'],'UserId':null},'include':[{'model':db[_0x7626('0x5f')],'as':_0x7626('0x60')}]})[_0x7626('0x20')](handleEntityNotFound(_0x41e0ec,null))[_0x7626('0x20')](saveUpdates(_0xe92c8[_0x7626('0x56')],null))['then'](function(_0x23b527){if(_0x23b527){_0x246702[_0x7626('0x29')]=_0x23b527['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x7626('0x54')]({'where':{'id':_0x23b527[_0x7626('0x61')]}});}return null;})[_0x7626('0x20')](handleEntityNotFound(_0x41e0ec,null))[_0x7626('0x20')](function(_0x5d4548){if(_0x5d4548){return _0x5d4548[_0x7626('0x33')]({'UserId':_0xe92c8[_0x7626('0x56')][_0x7626('0x5d')],'read1stAt':_[_0x7626('0x62')](_0x5d4548[_0x7626('0x63')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x7626('0x20')](function(_0x51cf56){if(_0x51cf56){_0x246702['interaction']=_0x51cf56['get']({'plain':!![]});interaction_log[_0x7626('0x21')](_0x7626('0x64'),_0xe92c8[_0x7626('0x5e')]['id'],_0xe92c8['user'][_0x7626('0x37')],_0xe92c8[_0x7626('0x5e')][_0x7626('0x65')],_0x246702['interaction']['id'],_0xe92c8[_0x7626('0x56')]?JSON[_0x7626('0x26')](_0xe92c8[_0x7626('0x56')]):'null');return respondWithRpcPromise(_0x7626('0x66'),_0x7626('0x67'),_0x246702);}return null;})[_0x7626('0x20')](function(_0x3bd860){if(_0x3bd860){if(_0xe92c8['body'][_0x7626('0x68')]){_0x246702[_0x7626('0x29')]['interface']=util[_0x7626('0x5c')](_0x7626('0x69'),_0xe92c8[_0x7626('0x5e')][_0x7626('0x37')]);_0x246702[_0x7626('0x29')][_0x7626('0x6a')]=_0x246702[_0x7626('0x6a')];_0x246702[_0x7626('0x29')]['event']=_0x7626('0x59');return respondWithRpcPromise(_0x7626('0x6b'),_0x7626('0x6b'),{'event':_0x7626('0x6c'),'message':_0x246702[_0x7626('0x29')]},client9002)['then'](function(){return _0x246702;});}return _0x246702;}return null;})[_0x7626('0x20')](respondWithResult(_0x41e0ec,null))[_0x7626('0x55')](handleError(_0x41e0ec,null));};var interaction_log=require(_0x7626('0x11'))(_0x7626('0x58'));exports['reject']=function(_0x47b0e5,_0x54d91a,_0x20f7d8){var _0x3e97f5={'agent':{},'channel':_0x7626('0x5a')};if(_0x47b0e5[_0x7626('0x56')]['id']){delete _0x47b0e5['body']['id'];}_0x47b0e5[_0x7626('0x56')][_0x7626('0x5d')]=_0x47b0e5[_0x7626('0x56')]['UserId']||_0x47b0e5[_0x7626('0x5e')]['id'];_0x3e97f5[_0x7626('0x6d')]['id']=_0x47b0e5['body'][_0x7626('0x5d')];return db[_0x7626('0x3b')][_0x7626('0x54')]({'where':{'id':_0x47b0e5[_0x7626('0x52')]['id'],'UserId':null}})[_0x7626('0x20')](handleEntityNotFound(_0x54d91a,null))[_0x7626('0x20')](function(_0xd38f09){if(_0xd38f09){_0x3e97f5[_0x7626('0x29')]=_0xd38f09[_0x7626('0x6e')]({'plain':!![]});return db[_0x7626('0x6f')][_0x7626('0x54')]({'where':{'id':_0xd38f09[_0x7626('0x61')]}});}return null;})[_0x7626('0x20')](handleEntityNotFound(_0x54d91a,null))['then'](function(_0x619a4e){if(_0x619a4e){_0x3e97f5[_0x7626('0x70')]=_0x619a4e[_0x7626('0x6e')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x47b0e5[_0x7626('0x5e')]['id'],_0x47b0e5[_0x7626('0x5e')]['name'],_0x47b0e5[_0x7626('0x5e')]['role'],_0x3e97f5[_0x7626('0x70')]['id'],_0x47b0e5[_0x7626('0x56')]?JSON[_0x7626('0x26')](_0x47b0e5[_0x7626('0x56')]):'null');return respondWithRpcPromise(_0x7626('0x71'),_0x7626('0x72'),_0x3e97f5);}return null;})['then'](function(_0x51f5d7){if(_0x51f5d7){_0x51f5d7[_0x7626('0x29')]['interface']=util[_0x7626('0x5c')](_0x7626('0x69'),_0x47b0e5['user']['name']);_0x51f5d7[_0x7626('0x29')][_0x7626('0x6a')]=_0x3e97f5[_0x7626('0x6a')];_0x51f5d7['message'][_0x7626('0x73')]=_0x7626('0x74');respondWithRpcPromise(_0x7626('0x6b'),_0x7626('0x6b'),{'event':'rejectmessage','message':_0x51f5d7[_0x7626('0x29')]},client9002);return _0x3e97f5;}return null;})[_0x7626('0x20')](respondWithResult(_0x54d91a,null))[_0x7626('0x55')](handleError(_0x54d91a,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 6ca68fb..d992578 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 _0x0035=['remove','emit','hasOwnProperty','hook','exports','events','OpenchannelMessage','setMaxListeners','update'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x0035,0x176));var _0x5003=function(_0x39551a,_0x116007){_0x39551a=_0x39551a-0x0;var _0x4b0b62=_0x0035[_0x39551a];return _0x4b0b62;};'use strict';var EventEmitter=require(_0x5003('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x5003('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x5003('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5003('0x3'),'afterDestroy':_0x5003('0x4')};function emitEvent(_0x7e9b03){return function(_0x17b88c,_0x38db5a,_0x314eb5){OpenchannelMessageEvents['emit'](_0x7e9b03+':'+_0x17b88c['id'],_0x17b88c);OpenchannelMessageEvents[_0x5003('0x5')](_0x7e9b03,_0x17b88c);_0x314eb5(null);};}for(var e in events){if(events[_0x5003('0x6')](e)){var event=events[e];OpenchannelMessage[_0x5003('0x7')](e,emitEvent(event));}}module[_0x5003('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x5e5a=['emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove'];(function(_0x599aaf,_0x3d3622){var _0xd995f3=function(_0x19825e){while(--_0x19825e){_0x599aaf['push'](_0x599aaf['shift']());}};_0xd995f3(++_0x3d3622);}(_0x5e5a,0x12c));var _0xa5e5=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x5e5a[_0x166742];return _0xb7814a;};'use strict';var EventEmitter=require(_0xa5e5('0x0'));var OpenchannelMessage=require(_0xa5e5('0x1'))['db'][_0xa5e5('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xa5e5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa5e5('0x4'),'afterDestroy':_0xa5e5('0x5')};function emitEvent(_0x2a4d56){return function(_0x820585,_0xdacaf6,_0x88fd46){OpenchannelMessageEvents[_0xa5e5('0x6')](_0x2a4d56+':'+_0x820585['id'],_0x820585);OpenchannelMessageEvents[_0xa5e5('0x6')](_0x2a4d56,_0x820585);_0x88fd46(null);};}for(var e in events){if(events[_0xa5e5('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0xa5e5('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 9bc20f8..b497c77 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 _0x9691=['error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./openchannelMessage.attributes','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','toLowerCase','direction','out','secret','UserId','OpenchannelInteraction','then','update','createdAt','catch'];(function(_0x2d714c,_0x33176f){var _0x4a8bd0=function(_0x16ef70){while(--_0x16ef70){_0x2d714c['push'](_0x2d714c['shift']());}};_0x4a8bd0(++_0x33176f);}(_0x9691,0x1e5));var _0x1969=function(_0x23373f,_0x5414f0){_0x23373f=_0x23373f-0x0;var _0x684e08=_0x9691[_0x23373f];return _0x684e08;};'use strict';var _=require('lodash');var util=require(_0x1969('0x0'));var logger=require(_0x1969('0x1'))(_0x1969('0x2'));var moment=require(_0x1969('0x3'));var BPromise=require('bluebird');var rp=require(_0x1969('0x4'));var fs=require('fs');var path=require(_0x1969('0x5'));var rimraf=require('rimraf');var config=require(_0x1969('0x6'));var attributes=require(_0x1969('0x7'));module['exports']=function(_0x1d89b7,_0x45ba26){return _0x1d89b7[_0x1969('0x8')](_0x1969('0x9'),attributes,{'tableName':_0x1969('0xa'),'paranoid':![],'indexes':[{'name':_0x1969('0xb'),'fields':[_0x1969('0xc')],'type':_0x1969('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3e858d,_0x517816,_0x3a88dc){var _0x2156f3=_0x1d89b7['models'];var _0xf05c2a=_0x3e858d[_0x1969('0xe')]({'plain':!![]});if(_0xf05c2a['direction'][_0x1969('0xf')]()==='in'||_0xf05c2a[_0x1969('0x10')][_0x1969('0xf')]()===_0x1969('0x11')&&!_0xf05c2a[_0x1969('0x12')]&&!_['isNil'](_0xf05c2a[_0x1969('0x13')])){_0x2156f3[_0x1969('0x14')]['findOne']({'where':{'id':_0xf05c2a['OpenchannelInteractionId']}})[_0x1969('0x15')](function(_0x550d38){if(_0x550d38){_0x550d38[_0x1969('0x16')]({'lastMsgAt':_0xf05c2a[_0x1969('0x17')],'lastMsgDirection':_0xf05c2a[_0x1969('0x10')][_0x1969('0xf')]()});}})[_0x1969('0x18')](function(_0x458fda){console[_0x1969('0x19')](_0x458fda);});}if(_0xf05c2a['direction']===_0x1969('0x11')&&!_0xf05c2a[_0x1969('0x12')]){var _0x5360d6;_0x2156f3[_0x1969('0x1a')][_0x1969('0x1b')]()[_0x1969('0x15')](function(_0xadc0d7){return _0x2156f3[_0x1969('0x1c')][_0x1969('0x1d')]({'where':{'id':_0xf05c2a[_0x1969('0x1e')]},'include':[{'model':_0x2156f3[_0x1969('0x14')],'as':_0x1969('0x1f'),'where':{'id':_0xf05c2a[_0x1969('0x20')]},'limit':0x1,'include':[{'model':_0x2156f3[_0x1969('0x1a')],'as':_0x1969('0x21'),'attributes':_[_0x1969('0x22')](_0xadc0d7)}]}]});})[_0x1969('0x15')](function(_0x5767bb){_0x5360d6=_0x5767bb['get']({'plain':!![]});if(_0x5360d6&&_0x5360d6['replyUri']){logger[_0x1969('0x23')](_0x1969('0x24'),_0x1969('0x25'),util[_0x1969('0x26')](_0x1969('0x27'),_0xf05c2a['id'],_0x5360d6[_0x1969('0x28')]));if(_0x5360d6[_0x1969('0x1f')]&&_0x5360d6[_0x1969('0x1f')][_0x1969('0x29')]){_0xf05c2a['Interaction']=_['omit'](_0x5360d6['Interactions'][0x0],'Contact');_0xf05c2a[_0x1969('0x21')]=_0x5360d6[_0x1969('0x1f')][0x0][_0x1969('0x21')];}var _0x517816={'method':_0x1969('0x2a'),'uri':encodeURI(_0x5360d6[_0x1969('0x28')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x517816[_0x1969('0x2b')]){case _0x1969('0x2c'):_0x517816['qs']=_0xf05c2a;break;case _0x1969('0x2a'):_0x517816[_0x1969('0xc')]=_0xf05c2a;break;}return rp(_0x517816)[_0x1969('0x15')](function(_0x15741b){logger[_0x1969('0x23')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x1969('0x26')](_0x1969('0x2d'),_0xf05c2a['id'],_0x5360d6['replyUri']));if(_0x15741b[_0x1969('0xc')][_0x1969('0x2e')]&&_0x15741b[_0x1969('0xc')]['threadId']!=_0xf05c2a[_0x1969('0x2f')][_0x1969('0x2e')]){return _0x2156f3[_0x1969('0x14')][_0x1969('0x16')]({'threadId':_0x15741b[_0x1969('0xc')][_0x1969('0x2e')]},{'logging':!![],'where':{'id':_0xf05c2a[_0x1969('0x2f')]['id']}});}else{return;}})[_0x1969('0x15')](function(){return _0x3e858d[_0x1969('0x16')]({'read':!![]});})[_0x1969('0x18')](function(_0x51215e){logger[_0x1969('0x19')](_0x1969('0x24'),'afterCreate',util['inspect'](_0x51215e,{'showHidden':![],'depth':null}));_0x3a88dc();});}else{_0x3a88dc();}})[_0x1969('0x30')](function(){_0x3a88dc();});}else{_0x3a88dc();}}},'charset':_0x1969('0x31'),'collate':_0x1969('0x32')});}; \ No newline at end of file +var _0xe5e0=['define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','UserId','OpenchannelInteraction','findOne','createdAt','secret','CmContact','describe','then','OpenchannelAccount','OpenchannelAccountId','Interactions','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','Contact','POST','method','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','error','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes'];(function(_0x1dbbe0,_0xfe7e0c){var _0x2bb1af=function(_0x1e34f3){while(--_0x1e34f3){_0x1dbbe0['push'](_0x1dbbe0['shift']());}};_0x2bb1af(++_0xfe7e0c);}(_0xe5e0,0x18f));var _0x0e5e=function(_0x1e4a42,_0x9a15d3){_0x1e4a42=_0x1e4a42-0x0;var _0x51e74f=_0xe5e0[_0x1e4a42];return _0x51e74f;};'use strict';var _=require(_0x0e5e('0x0'));var util=require(_0x0e5e('0x1'));var logger=require('../../config/logger')(_0x0e5e('0x2'));var moment=require(_0x0e5e('0x3'));var BPromise=require(_0x0e5e('0x4'));var rp=require(_0x0e5e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0e5e('0x6'));var config=require(_0x0e5e('0x7'));var attributes=require(_0x0e5e('0x8'));module['exports']=function(_0x5194f9,_0x21e1d1){return _0x5194f9[_0x0e5e('0x9')](_0x0e5e('0xa'),attributes,{'tableName':_0x0e5e('0xb'),'paranoid':![],'indexes':[{'name':_0x0e5e('0xc'),'fields':[_0x0e5e('0xd')],'type':_0x0e5e('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d8145,_0x4c73d2,_0x33c84a){var _0x3ef6ed=_0x5194f9[_0x0e5e('0xf')];var _0x183214=_0x4d8145[_0x0e5e('0x10')]({'plain':!![]});if(_0x183214[_0x0e5e('0x11')][_0x0e5e('0x12')]()==='in'||_0x183214[_0x0e5e('0x11')][_0x0e5e('0x12')]()===_0x0e5e('0x13')&&!_0x183214['secret']&&!_['isNil'](_0x183214[_0x0e5e('0x14')])){_0x3ef6ed[_0x0e5e('0x15')][_0x0e5e('0x16')]({'where':{'id':_0x183214['OpenchannelInteractionId']}})['then'](function(_0x3d5248){if(_0x3d5248){_0x3d5248['update']({'lastMsgAt':_0x183214[_0x0e5e('0x17')],'lastMsgDirection':_0x183214[_0x0e5e('0x11')]['toLowerCase']()});}})['catch'](function(_0x3294fb){console['error'](_0x3294fb);});}if(_0x183214['direction']==='out'&&!_0x183214[_0x0e5e('0x18')]){var _0x489f1c;_0x3ef6ed[_0x0e5e('0x19')][_0x0e5e('0x1a')]()[_0x0e5e('0x1b')](function(_0xde417){return _0x3ef6ed[_0x0e5e('0x1c')]['find']({'where':{'id':_0x183214[_0x0e5e('0x1d')]},'include':[{'model':_0x3ef6ed[_0x0e5e('0x15')],'as':_0x0e5e('0x1e'),'where':{'id':_0x183214['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x3ef6ed[_0x0e5e('0x19')],'as':'Contact','attributes':_[_0x0e5e('0x1f')](_0xde417)}]}]});})[_0x0e5e('0x1b')](function(_0x5cba81){_0x489f1c=_0x5cba81[_0x0e5e('0x10')]({'plain':!![]});if(_0x489f1c&&_0x489f1c[_0x0e5e('0x20')]){logger[_0x0e5e('0x21')](_0x0e5e('0x22'),_0x0e5e('0x23'),util[_0x0e5e('0x24')](_0x0e5e('0x25'),_0x183214['id'],_0x489f1c[_0x0e5e('0x20')]));if(_0x489f1c['Interactions']&&_0x489f1c[_0x0e5e('0x1e')][_0x0e5e('0x26')]){_0x183214[_0x0e5e('0x27')]=_[_0x0e5e('0x28')](_0x489f1c[_0x0e5e('0x1e')][0x0],_0x0e5e('0x29'));_0x183214['Contact']=_0x489f1c[_0x0e5e('0x1e')][0x0][_0x0e5e('0x29')];}var _0x4c73d2={'method':_0x0e5e('0x2a'),'uri':encodeURI(_0x489f1c['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4c73d2[_0x0e5e('0x2b')]){case'GET':_0x4c73d2['qs']=_0x183214;break;case _0x0e5e('0x2a'):_0x4c73d2[_0x0e5e('0xd')]=_0x183214;break;}return rp(_0x4c73d2)[_0x0e5e('0x1b')](function(_0x5340c6){logger[_0x0e5e('0x21')](_0x0e5e('0x22'),_0x0e5e('0x23'),util[_0x0e5e('0x24')](_0x0e5e('0x2c'),_0x183214['id'],_0x489f1c[_0x0e5e('0x20')]));if(_0x5340c6[_0x0e5e('0xd')][_0x0e5e('0x2d')]&&_0x5340c6[_0x0e5e('0xd')]['threadId']!=_0x183214[_0x0e5e('0x27')][_0x0e5e('0x2d')]){return _0x3ef6ed[_0x0e5e('0x15')][_0x0e5e('0x2e')]({'threadId':_0x5340c6['body'][_0x0e5e('0x2d')]},{'logging':!![],'where':{'id':_0x183214[_0x0e5e('0x27')]['id']}});}else{return;}})[_0x0e5e('0x1b')](function(){return _0x4d8145[_0x0e5e('0x2e')]({'read':!![]});})['catch'](function(_0x1de92a){logger[_0x0e5e('0x2f')](_0x0e5e('0x22'),_0x0e5e('0x23'),util[_0x0e5e('0x30')](_0x1de92a,{'showHidden':![],'depth':null}));_0x33c84a();});}else{_0x33c84a();}})['finally'](function(){_0x33c84a();});}else{_0x33c84a();}}},'charset':_0x0e5e('0x31'),'collate':_0x0e5e('0x32')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index facd6c2..7f0f508 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 _0x762e=['error','code','message','catch','CreateOpenchannelMessage','create','body','options','raw','stringify','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','info','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x762e,0xea));var _0xe762=function(_0x1d7ac3,_0x538ad6){_0x1d7ac3=_0x1d7ac3-0x0;var _0x1b552e=_0x762e[_0x1d7ac3];return _0x1b552e;};'use strict';var _=require(_0xe762('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe762('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe762('0x2'))['db'];var utils=require(_0xe762('0x3'));var logger=require(_0xe762('0x4'))('rpc');var config=require(_0xe762('0x5'));var jayson=require(_0xe762('0x6'));var client=jayson[_0xe762('0x7')]['http']({'port':0x232a});config[_0xe762('0x8')]=_[_0xe762('0x9')](config[_0xe762('0x8')],{'host':_0xe762('0xa'),'port':0x18eb});var socket=require(_0xe762('0xb'))(new Redis(config[_0xe762('0x8')]));require('./openchannelMessage.socket')[_0xe762('0xc')](socket);function respondWithRpcPromise(_0x2c0793,_0x177ad9,_0x337e91){return new BPromise(function(_0x131d67,_0x3735d5){return client[_0xe762('0xd')](_0x2c0793,_0x337e91)['then'](function(_0xd978f3){logger[_0xe762('0xe')](_0xe762('0xf'),_0x177ad9,'request\x20sent');logger[_0xe762('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x177ad9,_0xe762('0x11'),JSON['stringify'](_0xd978f3));if(_0xd978f3[_0xe762('0x12')]){if(_0xd978f3[_0xe762('0x12')][_0xe762('0x13')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x177ad9,_0xd978f3[_0xe762('0x12')][_0xe762('0x14')]);return _0x3735d5(_0xd978f3[_0xe762('0x12')][_0xe762('0x14')]);}logger[_0xe762('0x12')](_0xe762('0xf'),_0x177ad9,_0xd978f3[_0xe762('0x12')][_0xe762('0x14')]);return _0x131d67(_0xd978f3['error'][_0xe762('0x14')]);}else{logger[_0xe762('0xe')](_0xe762('0xf'),_0x177ad9,_0xe762('0x11'));_0x131d67(_0xd978f3['result'][_0xe762('0x14')]);}})[_0xe762('0x15')](function(_0x4ba564){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x177ad9,_0x4ba564);_0x3735d5(_0x4ba564);});});}exports[_0xe762('0x16')]=function(_0x5505b1){var _0x428a59=this;return new Promise(function(_0x5bd84e,_0x8775aa){return db['OpenchannelMessage'][_0xe762('0x17')](_0x5505b1[_0xe762('0x18')],{'raw':_0x5505b1[_0xe762('0x19')]?_0x5505b1[_0xe762('0x19')][_0xe762('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x58a906){logger['info']('CreateOpenchannelMessage',_0x5505b1);logger[_0xe762('0x10')](_0xe762('0x16'),_0x5505b1,JSON[_0xe762('0x1b')](_0x58a906));_0x5bd84e(_0x58a906);})[_0xe762('0x15')](function(_0x278064){logger['error'](_0xe762('0x16'),_0x278064[_0xe762('0x14')],_0x5505b1);_0x8775aa(_0x428a59[_0xe762('0x12')](0x1f4,_0x278064[_0xe762('0x14')]));});});}; \ No newline at end of file +var _0x9300=['message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','create','body','raw','info','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','./openchannelMessage.socket','then','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x52c820,_0x81c4e2){var _0x1e9d87=function(_0x225934){while(--_0x225934){_0x52c820['push'](_0x52c820['shift']());}};_0x1e9d87(++_0x81c4e2);}(_0x9300,0x153));var _0x0930=function(_0x50e7e0,_0x5affce){_0x50e7e0=_0x50e7e0-0x0;var _0x1a0307=_0x9300[_0x50e7e0];return _0x1a0307;};'use strict';var _=require(_0x0930('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0930('0x1'));var rs=require(_0x0930('0x2'));var fs=require('fs');var Redis=require(_0x0930('0x3'));var db=require(_0x0930('0x4'))['db'];var utils=require(_0x0930('0x5'));var logger=require('../../config/logger')(_0x0930('0x6'));var config=require(_0x0930('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0930('0x8')][_0x0930('0x9')]({'port':0x232a});config[_0x0930('0xa')]=_[_0x0930('0xb')](config[_0x0930('0xa')],{'host':_0x0930('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0930('0xd'))['register'](socket);function respondWithRpcPromise(_0x1abf42,_0x1cc192,_0x5055c7){return new BPromise(function(_0x6db8ef,_0x5ba778){return client['request'](_0x1abf42,_0x5055c7)[_0x0930('0xe')](function(_0x20ab2e){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x1cc192,_0x0930('0xf'));logger[_0x0930('0x10')](_0x0930('0x11'),_0x1cc192,_0x0930('0xf'),JSON[_0x0930('0x12')](_0x20ab2e));if(_0x20ab2e[_0x0930('0x13')]){if(_0x20ab2e['error']['code']===0x1f4){logger['error'](_0x0930('0x14'),_0x1cc192,_0x20ab2e['error'][_0x0930('0x15')]);return _0x5ba778(_0x20ab2e[_0x0930('0x13')][_0x0930('0x15')]);}logger[_0x0930('0x13')](_0x0930('0x14'),_0x1cc192,_0x20ab2e[_0x0930('0x13')]['message']);return _0x6db8ef(_0x20ab2e[_0x0930('0x13')][_0x0930('0x15')]);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x1cc192,_0x0930('0xf'));_0x6db8ef(_0x20ab2e[_0x0930('0x16')][_0x0930('0x15')]);}})[_0x0930('0x17')](function(_0x2fd170){logger['error'](_0x0930('0x14'),_0x1cc192,_0x2fd170);_0x5ba778(_0x2fd170);});});}exports[_0x0930('0x18')]=function(_0x4cf8ad){var _0x1aa8bb=this;return new Promise(function(_0xe5b40f,_0xfc9eaf){return db[_0x0930('0x19')][_0x0930('0x1a')](_0x4cf8ad[_0x0930('0x1b')],{'raw':_0x4cf8ad['options']?_0x4cf8ad['options'][_0x0930('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0xd9a9df){logger[_0x0930('0x1d')](_0x0930('0x18'),_0x4cf8ad);logger[_0x0930('0x10')](_0x0930('0x18'),_0x4cf8ad,JSON['stringify'](_0xd9a9df));_0xe5b40f(_0xd9a9df);})[_0x0930('0x17')](function(_0x1514d0){logger['error']('CreateOpenchannelMessage',_0x1514d0[_0x0930('0x15')],_0x4cf8ad);_0xfc9eaf(_0x1aa8bb[_0x0930('0x13')](0x1f4,_0x1514d0[_0x0930('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 18f1163..df5eb82 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 _0xe706=['register','length','openchannelMessage:','./openchannelMessage.events','save','remove','emit','removeListener'];(function(_0x23a042,_0x169361){var _0x57543a=function(_0x1fccec){while(--_0x1fccec){_0x23a042['push'](_0x23a042['shift']());}};_0x57543a(++_0x169361);}(_0xe706,0xa3));var _0x6e70=function(_0x2d0fff,_0x128adc){_0x2d0fff=_0x2d0fff-0x0;var _0x40c5b1=_0xe706[_0x2d0fff];return _0x40c5b1;};'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 +var _0xda3f=['openchannelMessage:','save','remove','register','length'];(function(_0x362a9d,_0x340349){var _0x5a214b=function(_0x1e113e){while(--_0x1e113e){_0x362a9d['push'](_0x362a9d['shift']());}};_0x5a214b(++_0x340349);}(_0xda3f,0xec));var _0xfda3=function(_0x21691b,_0x36b12e){_0x21691b=_0x21691b-0x0;var _0x22a53d=_0xda3f[_0x21691b];return _0x22a53d;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xfda3('0x0'),_0xfda3('0x1'),'update'];function createListener(_0x5299b0,_0x5d7071){return function(_0x3859fe){_0x5d7071['emit'](_0x5299b0,_0x3859fe);};}function removeListener(_0x36dc71,_0x22187d){return function(){OpenchannelMessageEvents['removeListener'](_0x36dc71,_0x22187d);};}exports[_0xfda3('0x2')]=function(_0x43a010){for(var _0x47e7e2=0x0,_0x4e72d1=events[_0xfda3('0x3')];_0x47e7e2<_0x4e72d1;_0x47e7e2++){var _0x42476a=events[_0x47e7e2];var _0x125e2a=createListener(_0xfda3('0x4')+_0x42476a,_0x43a010);OpenchannelMessageEvents['on'](_0x42476a,_0x125e2a);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index b5e183f..89f0109 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 _0x07d7=['getMembers','/:id/teams','getTeams','/:id/users','create','post','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members'];(function(_0x15d870,_0x5aa4e9){var _0x58d670=function(_0x2e6e43){while(--_0x2e6e43){_0x15d870['push'](_0x15d870['shift']());}};_0x58d670(++_0x5aa4e9);}(_0x07d7,0x85));var _0x707d=function(_0x53a7a8,_0xed2bff){_0x53a7a8=_0x53a7a8-0x0;var _0x555f71=_0x07d7[_0x53a7a8];return _0x555f71;};'use strict';var multer=require(_0x707d('0x0'));var util=require(_0x707d('0x1'));var path=require(_0x707d('0x2'));var timeout=require(_0x707d('0x3'));var express=require(_0x707d('0x4'));var router=express[_0x707d('0x5')]();var auth=require(_0x707d('0x6'));var interaction=require(_0x707d('0x7'));var config=require(_0x707d('0x8'));var controller=require(_0x707d('0x9'));router[_0x707d('0xa')]('/',auth[_0x707d('0xb')](),controller[_0x707d('0xc')]);router[_0x707d('0xa')](_0x707d('0xd'),auth[_0x707d('0xb')](),controller['describe']);router['get'](_0x707d('0xe'),auth[_0x707d('0xb')](),controller[_0x707d('0xf')]);router[_0x707d('0xa')](_0x707d('0x10'),auth['isAuthenticated'](),controller[_0x707d('0x11')]);router[_0x707d('0xa')](_0x707d('0x12'),auth['isAuthenticated'](),controller[_0x707d('0x13')]);router[_0x707d('0xa')](_0x707d('0x14'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x707d('0xb')](),controller[_0x707d('0x15')]);router[_0x707d('0x16')]('/:id/teams',auth[_0x707d('0xb')](),controller['addTeams']);router[_0x707d('0x16')](_0x707d('0x14'),auth['isAuthenticated'](),controller['addAgents']);router[_0x707d('0x17')]('/:id',auth[_0x707d('0xb')](),controller[_0x707d('0x18')]);router[_0x707d('0x19')](_0x707d('0xe'),auth[_0x707d('0xb')](),controller[_0x707d('0x1a')]);router[_0x707d('0x19')]('/:id/teams',auth[_0x707d('0xb')](),controller[_0x707d('0x1b')]);router[_0x707d('0x19')]('/:id/users',auth[_0x707d('0xb')](),controller[_0x707d('0x1c')]);module[_0x707d('0x1d')]=router; \ No newline at end of file +var _0xf569=['getTeams','post','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','getMembers','/:id/teams'];(function(_0x4aa7ac,_0x14397f){var _0x23b23e=function(_0x3d3959){while(--_0x3d3959){_0x4aa7ac['push'](_0x4aa7ac['shift']());}};_0x23b23e(++_0x14397f);}(_0xf569,0xd0));var _0x9f56=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xf569[_0x1caf6a];return _0x1bf493;};'use strict';var multer=require('multer');var util=require(_0x9f56('0x0'));var path=require(_0x9f56('0x1'));var timeout=require(_0x9f56('0x2'));var express=require(_0x9f56('0x3'));var router=express[_0x9f56('0x4')]();var auth=require(_0x9f56('0x5'));var interaction=require(_0x9f56('0x6'));var config=require(_0x9f56('0x7'));var controller=require('./openchannelQueue.controller');router[_0x9f56('0x8')]('/',auth['isAuthenticated'](),controller[_0x9f56('0x9')]);router[_0x9f56('0x8')]('/describe',auth[_0x9f56('0xa')](),controller[_0x9f56('0xb')]);router['get'](_0x9f56('0xc'),auth[_0x9f56('0xa')](),controller[_0x9f56('0xd')]);router['get']('/:id/members',auth[_0x9f56('0xa')](),controller[_0x9f56('0xe')]);router['get'](_0x9f56('0xf'),auth[_0x9f56('0xa')](),controller[_0x9f56('0x10')]);router['get']('/:id/users',auth[_0x9f56('0xa')](),controller['getAgents']);router[_0x9f56('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9f56('0x11')](_0x9f56('0xf'),auth['isAuthenticated'](),controller[_0x9f56('0x12')]);router[_0x9f56('0x11')](_0x9f56('0x13'),auth[_0x9f56('0xa')](),controller[_0x9f56('0x14')]);router[_0x9f56('0x15')](_0x9f56('0xc'),auth[_0x9f56('0xa')](),controller[_0x9f56('0x16')]);router[_0x9f56('0x17')](_0x9f56('0xc'),auth[_0x9f56('0xa')](),controller[_0x9f56('0x18')]);router[_0x9f56('0x17')](_0x9f56('0xf'),auth[_0x9f56('0xa')](),controller[_0x9f56('0x19')]);router[_0x9f56('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0x9f56('0x1a')]);module[_0x9f56('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 6a5e760..f007a63 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 _0xce08=['INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name'];(function(_0x448c53,_0x26dd23){var _0x456ac3=function(_0x5b1084){while(--_0x5b1084){_0x448c53['push'](_0x448c53['shift']());}};_0x456ac3(++_0x26dd23);}(_0xce08,0xb4));var _0x8ce0=function(_0x588a79,_0x2023ed){_0x588a79=_0x588a79-0x0;var _0x4d0fca=_0xce08[_0x588a79];return _0x4d0fca;};'use strict';var Sequelize=require(_0x8ce0('0x0'));module[_0x8ce0('0x1')]={'name':{'type':Sequelize[_0x8ce0('0x2')],'unique':_0x8ce0('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8ce0('0x2')]},'timeout':{'type':Sequelize[_0x8ce0('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8ce0('0x5')](_0x8ce0('0x6'),'beepall',_0x8ce0('0x7'))}}; \ No newline at end of file +var _0x6d5e=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x4ffa0b,_0x222f05){var _0xc22b29=function(_0x356891){while(--_0x356891){_0x4ffa0b['push'](_0x4ffa0b['shift']());}};_0xc22b29(++_0x222f05);}(_0x6d5e,0x103));var _0xe6d5=function(_0x472941,_0x32d2f5){_0x472941=_0x472941-0x0;var _0x328f74=_0x6d5e[_0x472941];return _0x328f74;};'use strict';var Sequelize=require(_0xe6d5('0x0'));module[_0xe6d5('0x1')]={'name':{'type':Sequelize[_0xe6d5('0x2')],'unique':_0xe6d5('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xe6d5('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe6d5('0x5')](_0xe6d5('0x6'),_0xe6d5('0x7'),_0xe6d5('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index c9adec8..82b1a7f 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 _0xe6ff=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelQueue.socket','register','status','end','json','count','offset','set','Content-Range','apply','save','then','destroy','get','OpenchannelQueues','UserProfileResource','sendStatus','error','stack','name','index','map','OpenchannelQueue','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','params','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','pick','OpenchannelQueueId','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','openchannelPause','createdAt','format','SIP','updatedAt','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','each','findOrCreate','forEach','userOpenchannelQueue:save','select','field','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','SELECT','every','includes','union','compact','value','removeTeams','isEmpty','emit','userOpenchannelQueue:remove','addAgents','omit','spread','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x136189,_0x5376bc){var _0x41d71d=function(_0x2c1fb1){while(--_0x2c1fb1){_0x136189['push'](_0x136189['shift']());}};_0x41d71d(++_0x5376bc);}(_0xe6ff,0x18d));var _0xfe6f=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe6ff[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require(_0xfe6f('0x0'));var emlformat=require(_0xfe6f('0x1'));var rimraf=require(_0xfe6f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe6f('0x3'));var rp=require(_0xfe6f('0x4'));var moment=require(_0xfe6f('0x5'));var BPromise=require(_0xfe6f('0x6'));var Mustache=require(_0xfe6f('0x7'));var util=require(_0xfe6f('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xfe6f('0x9'));var ejs=require(_0xfe6f('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xfe6f('0xb'));var crypto=require(_0xfe6f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xfe6f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xfe6f('0xe'));var Papa=require(_0xfe6f('0xf'));var Redis=require(_0xfe6f('0x10'));var authService=require(_0xfe6f('0x11'));var qs=require(_0xfe6f('0x12'));var as=require(_0xfe6f('0x13'));var hardwareService=require(_0xfe6f('0x14'));var logger=require(_0xfe6f('0x15'))('api');var utils=require(_0xfe6f('0x16'));var config=require(_0xfe6f('0x17'));var db=require(_0xfe6f('0x18'))['db'];config[_0xfe6f('0x19')]=_[_0xfe6f('0x1a')](config[_0xfe6f('0x19')],{'host':_0xfe6f('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfe6f('0x1c'))[_0xfe6f('0x1d')](socket);function respondWithStatusCode(_0x46a1b9,_0x6c189a){_0x6c189a=_0x6c189a||0xcc;return function(_0x50c869){if(_0x50c869){return _0x46a1b9['sendStatus'](_0x6c189a);}return _0x46a1b9[_0xfe6f('0x1e')](_0x6c189a)[_0xfe6f('0x1f')]();};}function respondWithResult(_0x509042,_0x4be08a){_0x4be08a=_0x4be08a||0xc8;return function(_0x291482){if(_0x291482){return _0x509042['status'](_0x4be08a)[_0xfe6f('0x20')](_0x291482);}};}function respondWithFilteredResult(_0x4a830a,_0x2f290d){return function(_0x19918b){if(_0x19918b){var _0x11762b=_0x19918b[_0xfe6f('0x21')],_0x2f9a2a=_0x2f290d[_0xfe6f('0x22')],_0xdaaee=_0x2f290d['offset']+_0x2f290d['limit'],_0x6bb941;if(_0xdaaee>=_0x11762b){_0xdaaee=_0x11762b;_0x6bb941=0xc8;}else{_0x6bb941=0xce;}_0x4a830a[_0xfe6f('0x1e')](_0x6bb941);return _0x4a830a[_0xfe6f('0x23')](_0xfe6f('0x24'),_0x2f9a2a+'-'+_0xdaaee+'/'+_0x11762b)[_0xfe6f('0x20')](_0x19918b);}return null;};}function patchUpdates(_0x294f09){return function(_0x3399f8){try{jsonpatch[_0xfe6f('0x25')](_0x3399f8,_0x294f09,!![]);}catch(_0x4b0582){return BPromise['reject'](_0x4b0582);}return _0x3399f8[_0xfe6f('0x26')]();};}function saveUpdates(_0x2c8965,_0x122e9b){return function(_0x1e94ff){if(_0x1e94ff){return _0x1e94ff['update'](_0x2c8965)[_0xfe6f('0x27')](function(_0x2a25dd){return _0x2a25dd;});}return null;};}function removeEntity(_0x21072e,_0x44fe9c){return function(_0x4cfa9c){if(_0x4cfa9c){return _0x4cfa9c[_0xfe6f('0x28')]()[_0xfe6f('0x27')](function(){var _0x4ad184=_0x4cfa9c[_0xfe6f('0x29')]({'plain':!![]});var _0x2b2aec=_0xfe6f('0x2a');return db[_0xfe6f('0x2b')]['destroy']({'where':{'type':_0x2b2aec,'resourceId':_0x4ad184['id']}})[_0xfe6f('0x27')](function(){return _0x4cfa9c;});})['then'](function(){_0x21072e[_0xfe6f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e889f,_0x2b0aee){return function(_0x51b0ec){if(!_0x51b0ec){_0x3e889f[_0xfe6f('0x2c')](0x194);}return _0x51b0ec;};}function handleError(_0x413f81,_0x5d309c){_0x5d309c=_0x5d309c||0x1f4;return function(_0x43d4ea){logger[_0xfe6f('0x2d')](_0x43d4ea[_0xfe6f('0x2e')]);if(_0x43d4ea[_0xfe6f('0x2f')]){delete _0x43d4ea['name'];}_0x413f81[_0xfe6f('0x1e')](_0x5d309c)['send'](_0x43d4ea);};}exports[_0xfe6f('0x30')]=function(_0x249c27,_0xbceb76){var _0x1eff5d={},_0x43bc86={},_0x2dbbce={'count':0x0,'rows':[]};var _0x47478c=_[_0xfe6f('0x31')](db[_0xfe6f('0x32')]['rawAttributes'],function(_0x34fa66){return{'name':_0x34fa66[_0xfe6f('0x33')],'type':_0x34fa66[_0xfe6f('0x34')]['key']};});_0x43bc86['model']=_[_0xfe6f('0x31')](_0x47478c,_0xfe6f('0x2f'));_0x43bc86[_0xfe6f('0x35')]=_[_0xfe6f('0x36')](_0x249c27[_0xfe6f('0x35')]);_0x43bc86[_0xfe6f('0x37')]=_[_0xfe6f('0x38')](_0x43bc86[_0xfe6f('0x39')],_0x43bc86[_0xfe6f('0x35')]);_0x1eff5d[_0xfe6f('0x3a')]=_['intersection'](_0x43bc86[_0xfe6f('0x39')],qs[_0xfe6f('0x3b')](_0x249c27['query'][_0xfe6f('0x3b')]));_0x1eff5d[_0xfe6f('0x3a')]=_0x1eff5d['attributes'][_0xfe6f('0x3c')]?_0x1eff5d[_0xfe6f('0x3a')]:_0x43bc86[_0xfe6f('0x39')];if(!_0x249c27[_0xfe6f('0x35')][_0xfe6f('0x3d')](_0xfe6f('0x3e'))){_0x1eff5d['limit']=qs[_0xfe6f('0x3f')](_0x249c27[_0xfe6f('0x35')][_0xfe6f('0x3f')]);_0x1eff5d[_0xfe6f('0x22')]=qs['offset'](_0x249c27[_0xfe6f('0x35')][_0xfe6f('0x22')]);}_0x1eff5d[_0xfe6f('0x40')]=qs[_0xfe6f('0x41')](_0x249c27[_0xfe6f('0x35')][_0xfe6f('0x41')]);_0x1eff5d[_0xfe6f('0x42')]=qs[_0xfe6f('0x37')](_['pick'](_0x249c27[_0xfe6f('0x35')],_0x43bc86[_0xfe6f('0x37')]));if(_0x249c27[_0xfe6f('0x35')][_0xfe6f('0x43')]){_0x1eff5d[_0xfe6f('0x42')]=_['merge'](_0x1eff5d['where'],{'$or':_[_0xfe6f('0x31')](_0x47478c,function(_0x47df1c){if(_0x47df1c[_0xfe6f('0x34')]!==_0xfe6f('0x44')){var _0x3b682c={};_0x3b682c[_0x47df1c[_0xfe6f('0x2f')]]={'$like':'%'+_0x249c27[_0xfe6f('0x35')][_0xfe6f('0x43')]+'%'};return _0x3b682c;}})});}_0x1eff5d=_[_0xfe6f('0x45')]({},_0x1eff5d,_0x249c27[_0xfe6f('0x46')]);var _0xb00864={'where':_0x1eff5d[_0xfe6f('0x42')]};return db[_0xfe6f('0x32')][_0xfe6f('0x21')](_0xb00864)[_0xfe6f('0x27')](function(_0x328424){_0x2dbbce['count']=_0x328424;if(_0x249c27[_0xfe6f('0x35')][_0xfe6f('0x47')]){_0x1eff5d['include']=[{'all':!![]}];}return db[_0xfe6f('0x32')][_0xfe6f('0x48')](_0x1eff5d);})['then'](function(_0x4ed4fd){_0x2dbbce[_0xfe6f('0x49')]=_0x4ed4fd;return _0x2dbbce;})['then'](respondWithFilteredResult(_0xbceb76,_0x1eff5d))['catch'](handleError(_0xbceb76,null));};exports['show']=function(_0x446cdd,_0x39b2b8){var _0x2e1558={'raw':!![],'where':{'id':_0x446cdd[_0xfe6f('0x4a')]['id']}},_0x515183={};_0x515183[_0xfe6f('0x39')]=_[_0xfe6f('0x36')](db['OpenchannelQueue'][_0xfe6f('0x4b')]);_0x515183[_0xfe6f('0x35')]=_[_0xfe6f('0x36')](_0x446cdd[_0xfe6f('0x35')]);_0x515183[_0xfe6f('0x37')]=_[_0xfe6f('0x38')](_0x515183[_0xfe6f('0x39')],_0x515183[_0xfe6f('0x35')]);_0x2e1558['attributes']=_[_0xfe6f('0x38')](_0x515183[_0xfe6f('0x39')],qs[_0xfe6f('0x3b')](_0x446cdd[_0xfe6f('0x35')]['fields']));_0x2e1558[_0xfe6f('0x3a')]=_0x2e1558[_0xfe6f('0x3a')][_0xfe6f('0x3c')]?_0x2e1558['attributes']:_0x515183['model'];if(_0x446cdd[_0xfe6f('0x35')][_0xfe6f('0x47')]){_0x2e1558['include']=[{'all':!![]}];}_0x2e1558=_[_0xfe6f('0x45')]({},_0x2e1558,_0x446cdd[_0xfe6f('0x46')]);return db[_0xfe6f('0x32')][_0xfe6f('0x4c')](_0x2e1558)['then'](handleEntityNotFound(_0x39b2b8,null))['then'](respondWithResult(_0x39b2b8,null))[_0xfe6f('0x4d')](handleError(_0x39b2b8,null));};exports[_0xfe6f('0x4e')]=function(_0x1f39de,_0x28b7d3){return db[_0xfe6f('0x32')]['create'](_0x1f39de[_0xfe6f('0x4f')],{})[_0xfe6f('0x27')](function(_0x46cf4b){var _0x1b7164=_0x1f39de[_0xfe6f('0x50')][_0xfe6f('0x29')]({'plain':!![]});if(!_0x1b7164)throw new Error(_0xfe6f('0x51'));if(_0x1b7164[_0xfe6f('0x52')]===_0xfe6f('0x50')){var _0x96e01f=_0x46cf4b[_0xfe6f('0x29')]({'plain':!![]});var _0x219d66=_0xfe6f('0x2a');return db['UserProfileSection'][_0xfe6f('0x4c')]({'where':{'name':_0x219d66,'userProfileId':_0x1b7164[_0xfe6f('0x53')]},'raw':!![]})[_0xfe6f('0x27')](function(_0x1cb450){if(_0x1cb450&&_0x1cb450['autoAssociation']===0x0){return db[_0xfe6f('0x2b')][_0xfe6f('0x4e')]({'name':_0x96e01f[_0xfe6f('0x2f')],'resourceId':_0x96e01f['id'],'type':_0x1cb450[_0xfe6f('0x2f')],'sectionId':_0x1cb450['id']},{})[_0xfe6f('0x27')](function(){return _0x46cf4b;});}else{return _0x46cf4b;}})[_0xfe6f('0x4d')](function(_0x18c46b){logger[_0xfe6f('0x2d')](_0xfe6f('0x54'),_0x18c46b);throw _0x18c46b;});}return _0x46cf4b;})[_0xfe6f('0x27')](respondWithResult(_0x28b7d3,0xc9))[_0xfe6f('0x4d')](handleError(_0x28b7d3,null));};exports[_0xfe6f('0x55')]=function(_0x1ad420,_0xfe9670){if(_0x1ad420[_0xfe6f('0x4f')]['id']){delete _0x1ad420[_0xfe6f('0x4f')]['id'];}return db[_0xfe6f('0x32')][_0xfe6f('0x4c')]({'where':{'id':_0x1ad420[_0xfe6f('0x4a')]['id']}})['then'](handleEntityNotFound(_0xfe9670,null))[_0xfe6f('0x27')](saveUpdates(_0x1ad420[_0xfe6f('0x4f')],null))[_0xfe6f('0x27')](respondWithResult(_0xfe9670,null))['catch'](handleError(_0xfe9670,null));};exports['destroy']=function(_0x32e93b,_0x5e5943){return db[_0xfe6f('0x32')]['find']({'where':{'id':_0x32e93b[_0xfe6f('0x4a')]['id']}})[_0xfe6f('0x27')](handleEntityNotFound(_0x5e5943,null))[_0xfe6f('0x27')](removeEntity(_0x5e5943,null))[_0xfe6f('0x4d')](handleError(_0x5e5943,null));};exports[_0xfe6f('0x56')]=function(_0x357d4f,_0x552711){return db['OpenchannelQueue']['describe']()['then'](respondWithResult(_0x552711,null))[_0xfe6f('0x4d')](handleError(_0x552711,null));};exports[_0xfe6f('0x57')]=function(_0x34fb42,_0x2303d7,_0x31678f){var _0xc1e5ae={'raw':!![],'where':{}},_0x12f7e9={},_0x2170a3;return db['OpenchannelQueue'][_0xfe6f('0x58')]({'where':{'id':_0x34fb42[_0xfe6f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2303d7,null))[_0xfe6f('0x27')](function(_0x4ea83f){if(_0x4ea83f){_0x2170a3=_0x4ea83f[_0xfe6f('0x29')]({'plain':!![]});_0x12f7e9[_0xfe6f('0x39')]=_['keys'](db['UserOpenchannelQueue']['rawAttributes']);_0x12f7e9[_0xfe6f('0x35')]=_['keys'](_0x34fb42[_0xfe6f('0x35')]);_0x12f7e9[_0xfe6f('0x37')]=_[_0xfe6f('0x38')](_0x12f7e9[_0xfe6f('0x39')],_0x12f7e9[_0xfe6f('0x35')]);_0xc1e5ae[_0xfe6f('0x3a')]=_[_0xfe6f('0x38')](_0x12f7e9['model'],qs[_0xfe6f('0x3b')](_0x34fb42['query']['fields']));_0xc1e5ae[_0xfe6f('0x3a')]=_0xc1e5ae[_0xfe6f('0x3a')][_0xfe6f('0x3c')]?_0xc1e5ae[_0xfe6f('0x3a')]:_0x12f7e9[_0xfe6f('0x39')];if(!_0x34fb42[_0xfe6f('0x35')][_0xfe6f('0x3d')](_0xfe6f('0x3e'))){_0xc1e5ae['limit']=qs[_0xfe6f('0x3f')](_0x34fb42[_0xfe6f('0x35')][_0xfe6f('0x3f')]);_0xc1e5ae[_0xfe6f('0x22')]=qs[_0xfe6f('0x22')](_0x34fb42[_0xfe6f('0x35')][_0xfe6f('0x22')]);}_0xc1e5ae[_0xfe6f('0x40')]=qs[_0xfe6f('0x41')](_0x34fb42['query'][_0xfe6f('0x41')]);_0xc1e5ae[_0xfe6f('0x42')]=qs[_0xfe6f('0x37')](_[_0xfe6f('0x59')](_0x34fb42[_0xfe6f('0x35')],_0x12f7e9['filters']));_0xc1e5ae[_0xfe6f('0x42')][_0xfe6f('0x5a')]=_0x4ea83f['id'];if(_0x34fb42[_0xfe6f('0x35')][_0xfe6f('0x43')]){_0xc1e5ae['where']=_[_0xfe6f('0x45')](_0xc1e5ae[_0xfe6f('0x42')],{'$or':_[_0xfe6f('0x31')](_0xc1e5ae[_0xfe6f('0x3a')],function(_0x3f15e5){var _0x3cd25b={};_0x3cd25b[_0x3f15e5]={'$like':'%'+_0x34fb42[_0xfe6f('0x35')]['filter']+'%'};return _0x3cd25b;})});}_0xc1e5ae=_['merge']({},_0xc1e5ae,_0x34fb42['options']);return db[_0xfe6f('0x5b')][_0xfe6f('0x48')](_0xc1e5ae);}})[_0xfe6f('0x27')](function(_0xdbf2f5){if(_0xdbf2f5){return db[_0xfe6f('0x5c')][_0xfe6f('0x5d')]({'where':{'id':_[_0xfe6f('0x31')](_0xdbf2f5,_0xfe6f('0x5e')),'role':_0xfe6f('0x5f')},'attributes':['id','name',_0xfe6f('0x60'),'updatedAt',_0xfe6f('0x61')]});}})[_0xfe6f('0x27')](function(_0x835f82){if(_0x835f82){return{'count':_0x835f82[_0xfe6f('0x21')],'rows':_['map'](_0x835f82[_0xfe6f('0x49')],function(_0x5db97a){return{'membername':_0x5db97a[_0xfe6f('0x2f')],'UserId':_0x5db97a['id'],'queue_name':_0x2170a3[_0xfe6f('0x2f')],'OpenchannelQueueId':_0x2170a3['id'],'interface':util[_0xfe6f('0x62')]('%s/%s',_0xfe6f('0x63'),_0x5db97a[_0xfe6f('0x2f')]),'penalty':0x0,'paused':_0x5db97a[_0xfe6f('0x60')],'createdAt':_0x5db97a[_0xfe6f('0x61')],'updatedAt':_0x5db97a[_0xfe6f('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfe6f('0x27')](respondWithFilteredResult(_0x2303d7,_0xc1e5ae))[_0xfe6f('0x4d')](handleError(_0x2303d7,null));};exports[_0xfe6f('0x65')]=function(_0x4efe2e,_0x3f9836,_0x5721bb){var _0x23bc58={};var _0xc8c9c0={};var _0x43ce21;var _0x556a52;return db[_0xfe6f('0x32')][_0xfe6f('0x58')]({'where':{'id':_0x4efe2e[_0xfe6f('0x4a')]['id']}})[_0xfe6f('0x27')](handleEntityNotFound(_0x3f9836,null))[_0xfe6f('0x27')](function(_0x164b78){if(_0x164b78){_0x43ce21=_0x164b78;_0xc8c9c0[_0xfe6f('0x39')]=_['keys'](db[_0xfe6f('0x66')][_0xfe6f('0x4b')]);_0xc8c9c0[_0xfe6f('0x35')]=_['keys'](_0x4efe2e[_0xfe6f('0x35')]);_0xc8c9c0[_0xfe6f('0x37')]=_['intersection'](_0xc8c9c0[_0xfe6f('0x39')],_0xc8c9c0[_0xfe6f('0x35')]);_0x23bc58[_0xfe6f('0x3a')]=_[_0xfe6f('0x38')](_0xc8c9c0[_0xfe6f('0x39')],qs[_0xfe6f('0x3b')](_0x4efe2e[_0xfe6f('0x35')][_0xfe6f('0x3b')]));_0x23bc58[_0xfe6f('0x3a')]=_0x23bc58[_0xfe6f('0x3a')][_0xfe6f('0x3c')]?_0x23bc58[_0xfe6f('0x3a')]:_0xc8c9c0[_0xfe6f('0x39')];_0x23bc58[_0xfe6f('0x40')]=qs[_0xfe6f('0x41')](_0x4efe2e['query'][_0xfe6f('0x41')]);_0x23bc58['where']=qs[_0xfe6f('0x37')](_[_0xfe6f('0x59')](_0x4efe2e[_0xfe6f('0x35')],_0xc8c9c0[_0xfe6f('0x37')]));if(_0x4efe2e['query'][_0xfe6f('0x43')]){_0x23bc58['where']=_[_0xfe6f('0x45')](_0x23bc58[_0xfe6f('0x42')],{'$or':_['map'](_0x23bc58[_0xfe6f('0x3a')],function(_0x16ed7c){var _0x3fce59={};_0x3fce59[_0x16ed7c]={'$like':'%'+_0x4efe2e[_0xfe6f('0x35')][_0xfe6f('0x43')]+'%'};return _0x3fce59;})});}_0x23bc58=_[_0xfe6f('0x45')]({},_0x23bc58,_0x4efe2e[_0xfe6f('0x46')]);return _0x43ce21[_0xfe6f('0x65')](_0x23bc58);}})[_0xfe6f('0x27')](function(_0x5490ce){if(_0x5490ce){_0x556a52=_0x5490ce[_0xfe6f('0x3c')];if(!_0x4efe2e['query'][_0xfe6f('0x3d')](_0xfe6f('0x3e'))){_0x23bc58[_0xfe6f('0x3f')]=qs[_0xfe6f('0x3f')](_0x4efe2e['query'][_0xfe6f('0x3f')]);_0x23bc58[_0xfe6f('0x22')]=qs[_0xfe6f('0x22')](_0x4efe2e['query']['offset']);}return _0x43ce21['getTeams'](_0x23bc58);}})[_0xfe6f('0x27')](function(_0x373287){if(_0x373287){return _0x373287?{'count':_0x556a52,'rows':_0x373287}:null;}})[_0xfe6f('0x27')](respondWithResult(_0x3f9836,null))[_0xfe6f('0x4d')](handleError(_0x3f9836,null));};exports[_0xfe6f('0x67')]=function(_0x55c43b,_0x27f98b,_0x3eec0a){var _0x4ffd3d=_0x55c43b[_0xfe6f('0x4f')][_0xfe6f('0x68')];return db[_0xfe6f('0x66')][_0xfe6f('0x48')]({'where':{'id':_0x4ffd3d},'attributes':['id'],'include':[{'model':db[_0xfe6f('0x5c')],'as':'Agents','attributes':['id',_0xfe6f('0x2f'),_0xfe6f('0x69'),_0xfe6f('0x6a'),_0xfe6f('0x6b')],'raw':!![]}]})['then'](function(_0x5d01f9){if(_0x5d01f9){var _0x209d06=_[_0xfe6f('0x6c')](_0x5d01f9,function(_0x576b9a){var _0x234d50=_0x576b9a['get']({'plain':!![]});return _0x234d50[_0xfe6f('0x6d')];});return db['OpenchannelQueue'][_0xfe6f('0x4c')]({'where':{'id':_0x55c43b[_0xfe6f('0x4a')]['id']}})[_0xfe6f('0x27')](function(_0x22014a){return db[_0xfe6f('0x6e')]['transaction'](function(_0x6aa047){return _0x22014a[_0xfe6f('0x67')](_0x4ffd3d,{'transaction':_0x6aa047})[_0xfe6f('0x27')](function(){return BPromise[_0xfe6f('0x6f')](_0x209d06,function(_0x25ab99){return db[_0xfe6f('0x5b')][_0xfe6f('0x70')]({'where':{'UserId':_0x25ab99['id'],'OpenchannelQueueId':_0x55c43b['params']['id']},'transaction':_0x6aa047});});})['then'](function(){_0x209d06[_0xfe6f('0x71')](function(_0x1265c6){socket['emit'](_0xfe6f('0x72'),{'UserId':_0x1265c6['id'],'OpenchannelQueueId':_0x22014a['id']});});});});});}})[_0xfe6f('0x27')](respondWithStatusCode(_0x27f98b,null))[_0xfe6f('0x4d')](handleError(_0x27f98b,null));};exports['removeTeams']=function(_0x9cb602,_0x276c67,_0x4ac052){return db['Team'][_0xfe6f('0x48')]({'where':{'id':_0x9cb602[_0xfe6f('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0xfe6f('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xfe6f('0x27')](handleEntityNotFound(_0x276c67,null))[_0xfe6f('0x27')](function(_0x43804f){var _0x4d3230=_['map'](_0x43804f,'id');var _0x32f484=[];var _0x33f66a=[];var _0x445928=squel[_0xfe6f('0x73')]();_0x445928[_0xfe6f('0x74')]('tq.TeamId')['from'](_0xfe6f('0x75'),'tq')[_0xfe6f('0x76')](_0xfe6f('0x77'),'ut',_0xfe6f('0x78'))[_0xfe6f('0x42')]('OpenchannelQueueId\x20=\x20?',_0x9cb602['params']['id']);for(var _0x3f3e31=0x0;_0x3f3e31<_0x43804f[_0xfe6f('0x3c')];_0x3f3e31+=0x1){let _0x113a36=_0x43804f[_0x3f3e31];for(var _0xa7784c=0x0;_0xa7784c<_0x113a36[_0xfe6f('0x6d')][_0xfe6f('0x3c')];_0xa7784c+=0x1){let _0x4038cc=_0x113a36[_0xfe6f('0x6d')][_0xa7784c];var _0x47876a=_0x445928[_0xfe6f('0x79')]();_0x47876a[_0xfe6f('0x42')]('ut.UserId\x20=\x20?',_0x4038cc['id']);_0x33f66a[_0xfe6f('0x7a')](db['sequelize'][_0xfe6f('0x35')](_0x47876a[_0xfe6f('0x7b')](),{'type':db[_0xfe6f('0x6e')]['QueryTypes'][_0xfe6f('0x7c')]})[_0xfe6f('0x27')](function(_0x2923a7){if(_0x2923a7[_0xfe6f('0x3c')]===0x1){return _0x4038cc['id'];}else{var _0x1fb4d7=_[_0xfe6f('0x7d')](_['map'](_0x2923a7,'TeamId'),function(_0x4a32b8){return _[_0xfe6f('0x7e')](_0x4d3230,_0x4a32b8);});if(_0x1fb4d7){return _0x4038cc['id'];}}}));}}return BPromise['all'](_0x33f66a)['then'](function(_0x46b9f6){_0x32f484=_(_0x32f484)[_0xfe6f('0x7f')](_0x46b9f6)[_0xfe6f('0x80')]()[_0xfe6f('0x81')]();return db['OpenchannelQueue']['find']({'where':{'id':_0x9cb602[_0xfe6f('0x4a')]['id']}})[_0xfe6f('0x27')](function(_0x14aa0c){return db[_0xfe6f('0x6e')]['transaction'](function(_0x19420d){return _0x14aa0c[_0xfe6f('0x82')](_0x9cb602['query'][_0xfe6f('0x68')],{'transaction':_0x19420d})[_0xfe6f('0x27')](function(){if(!_[_0xfe6f('0x83')](_0x32f484)){return _0x14aa0c['removeAgents'](_0x32f484,{'transaction':_0x19420d});}})[_0xfe6f('0x27')](function(){_0x32f484[_0xfe6f('0x71')](function(_0x351ef3){socket[_0xfe6f('0x84')](_0xfe6f('0x85'),{'UserId':_0x351ef3,'OpenchannelQueueId':_0x14aa0c['id']});});});});});});})[_0xfe6f('0x27')](respondWithStatusCode(_0x276c67,null))['catch'](handleError(_0x276c67,null));};exports[_0xfe6f('0x86')]=function(_0x3aa28f,_0x1ef8d6,_0x439399){return db[_0xfe6f('0x32')][_0xfe6f('0x4c')]({'where':{'id':_0x3aa28f[_0xfe6f('0x4a')]['id']}})[_0xfe6f('0x27')](handleEntityNotFound(_0x1ef8d6,null))['then'](function(_0x51d4e7){if(_0x51d4e7){return _0x51d4e7[_0xfe6f('0x86')](_0x3aa28f[_0xfe6f('0x4f')]['ids'],_[_0xfe6f('0x87')](_0x3aa28f['body'],[_0xfe6f('0x68'),'id'])||{})[_0xfe6f('0x88')](function(_0x1f3f63){for(var _0x561e73=0x0;_0x561e73<_0x3aa28f[_0xfe6f('0x4f')][_0xfe6f('0x68')][_0xfe6f('0x3c')];_0x561e73+=0x1){socket['emit'](_0xfe6f('0x72'),{'UserId':_0x3aa28f[_0xfe6f('0x4f')][_0xfe6f('0x68')][_0x561e73],'OpenchannelQueueId':_0x3aa28f['params']['id']});}return _0x1f3f63;});}})['then'](respondWithResult(_0x1ef8d6,null))['catch'](handleError(_0x1ef8d6,null));};exports['removeAgents']=function(_0x336852,_0x3e3ca8,_0x43b23c){return db[_0xfe6f('0x32')][_0xfe6f('0x4c')]({'where':{'id':_0x336852['params']['id']}})['then'](handleEntityNotFound(_0x3e3ca8,null))[_0xfe6f('0x27')](function(_0x5bd6eb){if(_0x5bd6eb){return _0x5bd6eb['removeAgents'](_0x336852['query'][_0xfe6f('0x68')])[_0xfe6f('0x27')](function(){if(_['isArray'](_0x336852['query'][_0xfe6f('0x68')])){for(var _0x4e451f=0x0;_0x4e451f<_0x336852[_0xfe6f('0x35')]['ids']['length'];_0x4e451f+=0x1){socket['emit'](_0xfe6f('0x85'),{'UserId':Number(_0x336852[_0xfe6f('0x35')]['ids'][_0x4e451f]),'OpenchannelQueueId':Number(_0x336852[_0xfe6f('0x4a')]['id'])});}}else{socket['emit'](_0xfe6f('0x85'),{'UserId':Number(_0x336852[_0xfe6f('0x35')][_0xfe6f('0x68')]),'OpenchannelQueueId':Number(_0x336852['params']['id'])});}});}})[_0xfe6f('0x27')](respondWithStatusCode(_0x3e3ca8,null))[_0xfe6f('0x4d')](handleError(_0x3e3ca8,null));};exports[_0xfe6f('0x89')]=function(_0x7e5fa5,_0x31215b,_0x1ddbd7){var _0x1c773d={};var _0x19228c={};var _0x5e405b;var _0x531c7b;return db['OpenchannelQueue'][_0xfe6f('0x58')]({'where':{'id':_0x7e5fa5[_0xfe6f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x31215b,null))[_0xfe6f('0x27')](function(_0x347bd5){if(_0x347bd5){_0x5e405b=_0x347bd5;_0x19228c[_0xfe6f('0x39')]=_[_0xfe6f('0x36')](db[_0xfe6f('0x5c')][_0xfe6f('0x4b')]);_0x19228c[_0xfe6f('0x35')]=_[_0xfe6f('0x36')](_0x7e5fa5[_0xfe6f('0x35')]);_0x19228c[_0xfe6f('0x37')]=_[_0xfe6f('0x38')](_0x19228c[_0xfe6f('0x39')],_0x19228c[_0xfe6f('0x35')]);_0x1c773d[_0xfe6f('0x3a')]=_[_0xfe6f('0x38')](_0x19228c[_0xfe6f('0x39')],qs[_0xfe6f('0x3b')](_0x7e5fa5[_0xfe6f('0x35')][_0xfe6f('0x3b')]));_0x1c773d[_0xfe6f('0x3a')]=_0x1c773d['attributes'][_0xfe6f('0x3c')]?_0x1c773d[_0xfe6f('0x3a')]:_0x19228c['model'];_0x1c773d[_0xfe6f('0x40')]=qs[_0xfe6f('0x41')](_0x7e5fa5['query'][_0xfe6f('0x41')]);_0x1c773d[_0xfe6f('0x42')]=qs['filters'](_[_0xfe6f('0x59')](_0x7e5fa5[_0xfe6f('0x35')],_0x19228c[_0xfe6f('0x37')]));if(_0x7e5fa5['query'][_0xfe6f('0x43')]){_0x1c773d[_0xfe6f('0x42')]=_[_0xfe6f('0x45')](_0x1c773d[_0xfe6f('0x42')],{'$or':_[_0xfe6f('0x31')](_0x1c773d['attributes'],function(_0x1327d7){var _0x55d3ab={};_0x55d3ab[_0x1327d7]={'$like':'%'+_0x7e5fa5[_0xfe6f('0x35')][_0xfe6f('0x43')]+'%'};return _0x55d3ab;})});}_0x1c773d=_['merge']({},_0x1c773d,_0x7e5fa5['options']);return _0x5e405b[_0xfe6f('0x89')](_0x1c773d);}})['then'](function(_0xbf476b){if(_0xbf476b){_0x531c7b=_0xbf476b[_0xfe6f('0x3c')];if(!_0x7e5fa5[_0xfe6f('0x35')]['hasOwnProperty']('nolimit')){_0x1c773d[_0xfe6f('0x3f')]=qs['limit'](_0x7e5fa5[_0xfe6f('0x35')][_0xfe6f('0x3f')]);_0x1c773d[_0xfe6f('0x22')]=qs[_0xfe6f('0x22')](_0x7e5fa5['query'][_0xfe6f('0x22')]);}return _0x5e405b['getAgents'](_0x1c773d);}})[_0xfe6f('0x27')](function(_0x24debc){if(_0x24debc){return _0x24debc?{'count':_0x531c7b,'rows':_0x24debc}:null;}})['then'](respondWithResult(_0x31215b,null))[_0xfe6f('0x4d')](handleError(_0x31215b,null));}; \ No newline at end of file +var _0x052e=['moment','util','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','save','update','destroy','get','OpenchannelQueues','UserProfileResource','then','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelQueue','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','describe','getMembers','hasOwnProperty','order','OpenchannelQueueId','UserOpenchannelQueue','User','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','format','SIP','getTeams','findOne','Team','nolimit','addTeams','Agents','online','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','ids','select','tq.TeamId','from','team_has_openchannel_queues','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','includes','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','isArray','getAgents','rimraf','zip-dir','request-promise'];(function(_0x47dd46,_0x4d47eb){var _0x56759b=function(_0xdeb3bc){while(--_0xdeb3bc){_0x47dd46['push'](_0x47dd46['shift']());}};_0x56759b(++_0x4d47eb);}(_0x052e,0x101));var _0xe052=function(_0x30fec9,_0x2b7b8d){_0x30fec9=_0x30fec9-0x0;var _0x415934=_0x052e[_0x30fec9];return _0x415934;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe052('0x0'));var zipdir=require(_0xe052('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe052('0x2'));var moment=require(_0xe052('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe052('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xe052('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe052('0x6'));var jsforce=require(_0xe052('0x7'));var deskjs=require(_0xe052('0x8'));var toCsv=require(_0xe052('0x5'));var querystring=require(_0xe052('0x9'));var Papa=require(_0xe052('0xa'));var Redis=require(_0xe052('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xe052('0xc'));var as=require(_0xe052('0xd'));var hardwareService=require(_0xe052('0xe'));var logger=require(_0xe052('0xf'))('api');var utils=require(_0xe052('0x10'));var config=require('../../config/environment');var db=require(_0xe052('0x11'))['db'];config[_0xe052('0x12')]=_['defaults'](config[_0xe052('0x12')],{'host':_0xe052('0x13'),'port':0x18eb});var socket=require(_0xe052('0x14'))(new Redis(config[_0xe052('0x12')]));require(_0xe052('0x15'))[_0xe052('0x16')](socket);function respondWithStatusCode(_0x5a4fd4,_0x549476){_0x549476=_0x549476||0xcc;return function(_0x5ea5d3){if(_0x5ea5d3){return _0x5a4fd4[_0xe052('0x17')](_0x549476);}return _0x5a4fd4[_0xe052('0x18')](_0x549476)['end']();};}function respondWithResult(_0x23cae8,_0x27a1df){_0x27a1df=_0x27a1df||0xc8;return function(_0x49e371){if(_0x49e371){return _0x23cae8[_0xe052('0x18')](_0x27a1df)[_0xe052('0x19')](_0x49e371);}};}function respondWithFilteredResult(_0x3d7226,_0x69403e){return function(_0x593a4a){if(_0x593a4a){var _0x4c1480=_0x593a4a[_0xe052('0x1a')],_0x4b7000=_0x69403e['offset'],_0x54e18c=_0x69403e[_0xe052('0x1b')]+_0x69403e[_0xe052('0x1c')],_0x185393;if(_0x54e18c>=_0x4c1480){_0x54e18c=_0x4c1480;_0x185393=0xc8;}else{_0x185393=0xce;}_0x3d7226['status'](_0x185393);return _0x3d7226[_0xe052('0x1d')](_0xe052('0x1e'),_0x4b7000+'-'+_0x54e18c+'/'+_0x4c1480)[_0xe052('0x19')](_0x593a4a);}return null;};}function patchUpdates(_0x3d2010){return function(_0x40f507){try{jsonpatch['apply'](_0x40f507,_0x3d2010,!![]);}catch(_0x42f507){return BPromise['reject'](_0x42f507);}return _0x40f507[_0xe052('0x1f')]();};}function saveUpdates(_0x1df0df,_0x5dde17){return function(_0x575e5a){if(_0x575e5a){return _0x575e5a[_0xe052('0x20')](_0x1df0df)['then'](function(_0x35a7bd){return _0x35a7bd;});}return null;};}function removeEntity(_0x3ccde4,_0x4c499e){return function(_0x59dd1c){if(_0x59dd1c){return _0x59dd1c[_0xe052('0x21')]()['then'](function(){var _0x2362f0=_0x59dd1c[_0xe052('0x22')]({'plain':!![]});var _0x1f7246=_0xe052('0x23');return db[_0xe052('0x24')][_0xe052('0x21')]({'where':{'type':_0x1f7246,'resourceId':_0x2362f0['id']}})[_0xe052('0x25')](function(){return _0x59dd1c;});})[_0xe052('0x25')](function(){_0x3ccde4[_0xe052('0x18')](0xcc)[_0xe052('0x26')]();});}};}function handleEntityNotFound(_0x5c5565,_0x329354){return function(_0x10c332){if(!_0x10c332){_0x5c5565[_0xe052('0x17')](0x194);}return _0x10c332;};}function handleError(_0x2a9126,_0xe43bb){_0xe43bb=_0xe43bb||0x1f4;return function(_0x151711){logger['error'](_0x151711[_0xe052('0x27')]);if(_0x151711[_0xe052('0x28')]){delete _0x151711[_0xe052('0x28')];}_0x2a9126[_0xe052('0x18')](_0xe43bb)[_0xe052('0x29')](_0x151711);};}exports[_0xe052('0x2a')]=function(_0x22e42c,_0x261cec){var _0x32d72e={},_0x5ef7a6={},_0x9c1276={'count':0x0,'rows':[]};var _0x20f9da=_[_0xe052('0x2b')](db['OpenchannelQueue'][_0xe052('0x2c')],function(_0x4862fd){return{'name':_0x4862fd[_0xe052('0x2d')],'type':_0x4862fd[_0xe052('0x2e')][_0xe052('0x2f')]};});_0x5ef7a6[_0xe052('0x30')]=_['map'](_0x20f9da,'name');_0x5ef7a6[_0xe052('0x31')]=_[_0xe052('0x32')](_0x22e42c['query']);_0x5ef7a6[_0xe052('0x33')]=_[_0xe052('0x34')](_0x5ef7a6[_0xe052('0x30')],_0x5ef7a6[_0xe052('0x31')]);_0x32d72e[_0xe052('0x35')]=_[_0xe052('0x34')](_0x5ef7a6[_0xe052('0x30')],qs[_0xe052('0x36')](_0x22e42c[_0xe052('0x31')][_0xe052('0x36')]));_0x32d72e[_0xe052('0x35')]=_0x32d72e[_0xe052('0x35')][_0xe052('0x37')]?_0x32d72e['attributes']:_0x5ef7a6['model'];if(!_0x22e42c[_0xe052('0x31')]['hasOwnProperty']('nolimit')){_0x32d72e['limit']=qs[_0xe052('0x1c')](_0x22e42c['query']['limit']);_0x32d72e[_0xe052('0x1b')]=qs['offset'](_0x22e42c[_0xe052('0x31')][_0xe052('0x1b')]);}_0x32d72e['order']=qs[_0xe052('0x38')](_0x22e42c[_0xe052('0x31')][_0xe052('0x38')]);_0x32d72e[_0xe052('0x39')]=qs[_0xe052('0x33')](_[_0xe052('0x3a')](_0x22e42c[_0xe052('0x31')],_0x5ef7a6[_0xe052('0x33')]));if(_0x22e42c[_0xe052('0x31')][_0xe052('0x3b')]){_0x32d72e[_0xe052('0x39')]=_[_0xe052('0x3c')](_0x32d72e[_0xe052('0x39')],{'$or':_[_0xe052('0x2b')](_0x20f9da,function(_0x18ecd5){if(_0x18ecd5['type']!==_0xe052('0x3d')){var _0x420099={};_0x420099[_0x18ecd5[_0xe052('0x28')]]={'$like':'%'+_0x22e42c[_0xe052('0x31')][_0xe052('0x3b')]+'%'};return _0x420099;}})});}_0x32d72e=_[_0xe052('0x3c')]({},_0x32d72e,_0x22e42c[_0xe052('0x3e')]);var _0x5391d5={'where':_0x32d72e[_0xe052('0x39')]};return db[_0xe052('0x3f')][_0xe052('0x1a')](_0x5391d5)[_0xe052('0x25')](function(_0x348c91){_0x9c1276[_0xe052('0x1a')]=_0x348c91;if(_0x22e42c[_0xe052('0x31')][_0xe052('0x40')]){_0x32d72e[_0xe052('0x41')]=[{'all':!![]}];}return db[_0xe052('0x3f')][_0xe052('0x42')](_0x32d72e);})[_0xe052('0x25')](function(_0x346402){_0x9c1276[_0xe052('0x43')]=_0x346402;return _0x9c1276;})[_0xe052('0x25')](respondWithFilteredResult(_0x261cec,_0x32d72e))[_0xe052('0x44')](handleError(_0x261cec,null));};exports[_0xe052('0x45')]=function(_0x33b37b,_0x3287b7){var _0x483bfc={'raw':!![],'where':{'id':_0x33b37b[_0xe052('0x46')]['id']}},_0x2d33a4={};_0x2d33a4[_0xe052('0x30')]=_[_0xe052('0x32')](db['OpenchannelQueue'][_0xe052('0x2c')]);_0x2d33a4[_0xe052('0x31')]=_[_0xe052('0x32')](_0x33b37b['query']);_0x2d33a4[_0xe052('0x33')]=_[_0xe052('0x34')](_0x2d33a4[_0xe052('0x30')],_0x2d33a4[_0xe052('0x31')]);_0x483bfc[_0xe052('0x35')]=_['intersection'](_0x2d33a4[_0xe052('0x30')],qs['fields'](_0x33b37b[_0xe052('0x31')][_0xe052('0x36')]));_0x483bfc[_0xe052('0x35')]=_0x483bfc[_0xe052('0x35')][_0xe052('0x37')]?_0x483bfc['attributes']:_0x2d33a4[_0xe052('0x30')];if(_0x33b37b[_0xe052('0x31')][_0xe052('0x40')]){_0x483bfc[_0xe052('0x41')]=[{'all':!![]}];}_0x483bfc=_[_0xe052('0x3c')]({},_0x483bfc,_0x33b37b[_0xe052('0x3e')]);return db[_0xe052('0x3f')][_0xe052('0x47')](_0x483bfc)[_0xe052('0x25')](handleEntityNotFound(_0x3287b7,null))[_0xe052('0x25')](respondWithResult(_0x3287b7,null))[_0xe052('0x44')](handleError(_0x3287b7,null));};exports[_0xe052('0x48')]=function(_0x3ca1ae,_0x1d04a2){return db[_0xe052('0x3f')][_0xe052('0x48')](_0x3ca1ae[_0xe052('0x49')],{})[_0xe052('0x25')](function(_0x562068){var _0x391295=_0x3ca1ae[_0xe052('0x4a')][_0xe052('0x22')]({'plain':!![]});if(!_0x391295)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x391295[_0xe052('0x4b')]===_0xe052('0x4a')){var _0x1e2652=_0x562068[_0xe052('0x22')]({'plain':!![]});var _0x34401b=_0xe052('0x23');return db[_0xe052('0x4c')][_0xe052('0x47')]({'where':{'name':_0x34401b,'userProfileId':_0x391295[_0xe052('0x4d')]},'raw':!![]})['then'](function(_0x278ff2){if(_0x278ff2&&_0x278ff2[_0xe052('0x4e')]===0x0){return db[_0xe052('0x24')][_0xe052('0x48')]({'name':_0x1e2652[_0xe052('0x28')],'resourceId':_0x1e2652['id'],'type':_0x278ff2['name'],'sectionId':_0x278ff2['id']},{})[_0xe052('0x25')](function(){return _0x562068;});}else{return _0x562068;}})[_0xe052('0x44')](function(_0x52620a){logger[_0xe052('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52620a);throw _0x52620a;});}return _0x562068;})[_0xe052('0x25')](respondWithResult(_0x1d04a2,0xc9))['catch'](handleError(_0x1d04a2,null));};exports['update']=function(_0xfd015a,_0x55205f){if(_0xfd015a[_0xe052('0x49')]['id']){delete _0xfd015a[_0xe052('0x49')]['id'];}return db['OpenchannelQueue'][_0xe052('0x47')]({'where':{'id':_0xfd015a['params']['id']}})['then'](handleEntityNotFound(_0x55205f,null))[_0xe052('0x25')](saveUpdates(_0xfd015a[_0xe052('0x49')],null))[_0xe052('0x25')](respondWithResult(_0x55205f,null))[_0xe052('0x44')](handleError(_0x55205f,null));};exports['destroy']=function(_0x1483ea,_0x4be476){return db[_0xe052('0x3f')][_0xe052('0x47')]({'where':{'id':_0x1483ea[_0xe052('0x46')]['id']}})['then'](handleEntityNotFound(_0x4be476,null))['then'](removeEntity(_0x4be476,null))[_0xe052('0x44')](handleError(_0x4be476,null));};exports[_0xe052('0x50')]=function(_0x33eced,_0x116179){return db[_0xe052('0x3f')]['describe']()['then'](respondWithResult(_0x116179,null))['catch'](handleError(_0x116179,null));};exports[_0xe052('0x51')]=function(_0x5e33a3,_0x583a00,_0x99dbf2){var _0x4e9905={'raw':!![],'where':{}},_0x536d43={},_0x4215cf;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x5e33a3[_0xe052('0x46')]['id']}})['then'](handleEntityNotFound(_0x583a00,null))[_0xe052('0x25')](function(_0x11ed21){if(_0x11ed21){_0x4215cf=_0x11ed21[_0xe052('0x22')]({'plain':!![]});_0x536d43[_0xe052('0x30')]=_['keys'](db['UserOpenchannelQueue'][_0xe052('0x2c')]);_0x536d43[_0xe052('0x31')]=_[_0xe052('0x32')](_0x5e33a3['query']);_0x536d43['filters']=_[_0xe052('0x34')](_0x536d43[_0xe052('0x30')],_0x536d43['query']);_0x4e9905[_0xe052('0x35')]=_[_0xe052('0x34')](_0x536d43[_0xe052('0x30')],qs['fields'](_0x5e33a3[_0xe052('0x31')][_0xe052('0x36')]));_0x4e9905[_0xe052('0x35')]=_0x4e9905[_0xe052('0x35')][_0xe052('0x37')]?_0x4e9905[_0xe052('0x35')]:_0x536d43['model'];if(!_0x5e33a3[_0xe052('0x31')][_0xe052('0x52')]('nolimit')){_0x4e9905['limit']=qs['limit'](_0x5e33a3['query'][_0xe052('0x1c')]);_0x4e9905['offset']=qs[_0xe052('0x1b')](_0x5e33a3[_0xe052('0x31')][_0xe052('0x1b')]);}_0x4e9905[_0xe052('0x53')]=qs['sort'](_0x5e33a3['query']['sort']);_0x4e9905[_0xe052('0x39')]=qs['filters'](_[_0xe052('0x3a')](_0x5e33a3['query'],_0x536d43[_0xe052('0x33')]));_0x4e9905[_0xe052('0x39')][_0xe052('0x54')]=_0x11ed21['id'];if(_0x5e33a3[_0xe052('0x31')][_0xe052('0x3b')]){_0x4e9905['where']=_[_0xe052('0x3c')](_0x4e9905[_0xe052('0x39')],{'$or':_[_0xe052('0x2b')](_0x4e9905['attributes'],function(_0x18db25){var _0x2b6f88={};_0x2b6f88[_0x18db25]={'$like':'%'+_0x5e33a3[_0xe052('0x31')][_0xe052('0x3b')]+'%'};return _0x2b6f88;})});}_0x4e9905=_['merge']({},_0x4e9905,_0x5e33a3[_0xe052('0x3e')]);return db[_0xe052('0x55')]['findAll'](_0x4e9905);}})['then'](function(_0x32f302){if(_0x32f302){return db[_0xe052('0x56')][_0xe052('0x57')]({'where':{'id':_['map'](_0x32f302,'UserId'),'role':_0xe052('0x58')},'attributes':['id',_0xe052('0x28'),_0xe052('0x59'),_0xe052('0x5a'),_0xe052('0x5b')]});}})[_0xe052('0x25')](function(_0x1b6b94){if(_0x1b6b94){return{'count':_0x1b6b94[_0xe052('0x1a')],'rows':_[_0xe052('0x2b')](_0x1b6b94[_0xe052('0x43')],function(_0xccb08c){return{'membername':_0xccb08c[_0xe052('0x28')],'UserId':_0xccb08c['id'],'queue_name':_0x4215cf[_0xe052('0x28')],'OpenchannelQueueId':_0x4215cf['id'],'interface':util[_0xe052('0x5c')]('%s/%s',_0xe052('0x5d'),_0xccb08c[_0xe052('0x28')]),'penalty':0x0,'paused':_0xccb08c[_0xe052('0x59')],'createdAt':_0xccb08c[_0xe052('0x5b')],'updatedAt':_0xccb08c['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x583a00,_0x4e9905))['catch'](handleError(_0x583a00,null));};exports[_0xe052('0x5e')]=function(_0x545bda,_0x3ef3ce,_0x5f2ddc){var _0x3bcbb4={};var _0x5bc80f={};var _0x418295;var _0x31b4c6;return db[_0xe052('0x3f')][_0xe052('0x5f')]({'where':{'id':_0x545bda[_0xe052('0x46')]['id']}})[_0xe052('0x25')](handleEntityNotFound(_0x3ef3ce,null))[_0xe052('0x25')](function(_0x274401){if(_0x274401){_0x418295=_0x274401;_0x5bc80f[_0xe052('0x30')]=_['keys'](db[_0xe052('0x60')][_0xe052('0x2c')]);_0x5bc80f[_0xe052('0x31')]=_[_0xe052('0x32')](_0x545bda['query']);_0x5bc80f['filters']=_['intersection'](_0x5bc80f[_0xe052('0x30')],_0x5bc80f[_0xe052('0x31')]);_0x3bcbb4[_0xe052('0x35')]=_[_0xe052('0x34')](_0x5bc80f[_0xe052('0x30')],qs[_0xe052('0x36')](_0x545bda[_0xe052('0x31')]['fields']));_0x3bcbb4[_0xe052('0x35')]=_0x3bcbb4['attributes'][_0xe052('0x37')]?_0x3bcbb4[_0xe052('0x35')]:_0x5bc80f[_0xe052('0x30')];_0x3bcbb4[_0xe052('0x53')]=qs[_0xe052('0x38')](_0x545bda[_0xe052('0x31')][_0xe052('0x38')]);_0x3bcbb4[_0xe052('0x39')]=qs['filters'](_[_0xe052('0x3a')](_0x545bda[_0xe052('0x31')],_0x5bc80f[_0xe052('0x33')]));if(_0x545bda[_0xe052('0x31')][_0xe052('0x3b')]){_0x3bcbb4[_0xe052('0x39')]=_[_0xe052('0x3c')](_0x3bcbb4['where'],{'$or':_[_0xe052('0x2b')](_0x3bcbb4[_0xe052('0x35')],function(_0x4d25fd){var _0x177635={};_0x177635[_0x4d25fd]={'$like':'%'+_0x545bda[_0xe052('0x31')]['filter']+'%'};return _0x177635;})});}_0x3bcbb4=_[_0xe052('0x3c')]({},_0x3bcbb4,_0x545bda[_0xe052('0x3e')]);return _0x418295['getTeams'](_0x3bcbb4);}})[_0xe052('0x25')](function(_0x4dc8c5){if(_0x4dc8c5){_0x31b4c6=_0x4dc8c5[_0xe052('0x37')];if(!_0x545bda[_0xe052('0x31')][_0xe052('0x52')](_0xe052('0x61'))){_0x3bcbb4[_0xe052('0x1c')]=qs[_0xe052('0x1c')](_0x545bda['query']['limit']);_0x3bcbb4[_0xe052('0x1b')]=qs[_0xe052('0x1b')](_0x545bda['query']['offset']);}return _0x418295[_0xe052('0x5e')](_0x3bcbb4);}})['then'](function(_0x56c75f){if(_0x56c75f){return _0x56c75f?{'count':_0x31b4c6,'rows':_0x56c75f}:null;}})[_0xe052('0x25')](respondWithResult(_0x3ef3ce,null))['catch'](handleError(_0x3ef3ce,null));};exports[_0xe052('0x62')]=function(_0x149095,_0x265e4c,_0x443457){var _0x1b4e99=_0x149095['body']['ids'];return db[_0xe052('0x60')][_0xe052('0x42')]({'where':{'id':_0x1b4e99},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe052('0x63'),'attributes':['id',_0xe052('0x28'),_0xe052('0x64'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x1f5804){if(_0x1f5804){var _0x257521=_['flatMap'](_0x1f5804,function(_0x56146e){var _0x318ab0=_0x56146e[_0xe052('0x22')]({'plain':!![]});return _0x318ab0[_0xe052('0x63')];});return db[_0xe052('0x3f')]['find']({'where':{'id':_0x149095[_0xe052('0x46')]['id']}})[_0xe052('0x25')](function(_0x5044be){return db[_0xe052('0x65')][_0xe052('0x66')](function(_0x4557bd){return _0x5044be[_0xe052('0x62')](_0x1b4e99,{'transaction':_0x4557bd})[_0xe052('0x25')](function(){return BPromise[_0xe052('0x67')](_0x257521,function(_0x5433d8){return db[_0xe052('0x55')][_0xe052('0x68')]({'where':{'UserId':_0x5433d8['id'],'OpenchannelQueueId':_0x149095['params']['id']},'transaction':_0x4557bd});});})[_0xe052('0x25')](function(){_0x257521[_0xe052('0x69')](function(_0x75e591){socket[_0xe052('0x6a')]('userOpenchannelQueue:save',{'UserId':_0x75e591['id'],'OpenchannelQueueId':_0x5044be['id']});});});});});}})[_0xe052('0x25')](respondWithStatusCode(_0x265e4c,null))[_0xe052('0x44')](handleError(_0x265e4c,null));};exports[_0xe052('0x6b')]=function(_0x1a98d4,_0x4f5ff4,_0x3290ec){return db[_0xe052('0x60')]['findAll']({'where':{'id':_0x1a98d4[_0xe052('0x31')][_0xe052('0x6c')]},'attributes':['id'],'include':[{'model':db[_0xe052('0x56')],'as':_0xe052('0x63'),'attributes':['id'],'raw':!![]}]})[_0xe052('0x25')](handleEntityNotFound(_0x4f5ff4,null))['then'](function(_0xdb2b8b){var _0x36fd0b=_[_0xe052('0x2b')](_0xdb2b8b,'id');var _0x11ea32=[];var _0x57ed17=[];var _0x2fe298=squel[_0xe052('0x6d')]();_0x2fe298['field'](_0xe052('0x6e'))[_0xe052('0x6f')](_0xe052('0x70'),'tq')['join']('user_has_teams','ut',_0xe052('0x71'))[_0xe052('0x39')](_0xe052('0x72'),_0x1a98d4['params']['id']);for(var _0x259310=0x0;_0x259310<_0xdb2b8b[_0xe052('0x37')];_0x259310+=0x1){let _0x5daee6=_0xdb2b8b[_0x259310];for(var _0x58d306=0x0;_0x58d306<_0x5daee6[_0xe052('0x63')]['length'];_0x58d306+=0x1){let _0x4c176c=_0x5daee6[_0xe052('0x63')][_0x58d306];var _0x2205e5=_0x2fe298[_0xe052('0x73')]();_0x2205e5[_0xe052('0x39')](_0xe052('0x74'),_0x4c176c['id']);_0x57ed17['push'](db[_0xe052('0x65')][_0xe052('0x31')](_0x2205e5[_0xe052('0x75')](),{'type':db[_0xe052('0x65')]['QueryTypes'][_0xe052('0x76')]})[_0xe052('0x25')](function(_0x51fb66){if(_0x51fb66['length']===0x1){return _0x4c176c['id'];}else{var _0x1dc941=_[_0xe052('0x77')](_['map'](_0x51fb66,'TeamId'),function(_0x43b5fe){return _[_0xe052('0x78')](_0x36fd0b,_0x43b5fe);});if(_0x1dc941){return _0x4c176c['id'];}}}));}}return BPromise['all'](_0x57ed17)[_0xe052('0x25')](function(_0x57ee8){_0x11ea32=_(_0x11ea32)['union'](_0x57ee8)[_0xe052('0x79')]()[_0xe052('0x7a')]();return db[_0xe052('0x3f')]['find']({'where':{'id':_0x1a98d4[_0xe052('0x46')]['id']}})[_0xe052('0x25')](function(_0x13b15c){return db[_0xe052('0x65')][_0xe052('0x66')](function(_0x3d1868){return _0x13b15c[_0xe052('0x6b')](_0x1a98d4['query'][_0xe052('0x6c')],{'transaction':_0x3d1868})[_0xe052('0x25')](function(){if(!_[_0xe052('0x7b')](_0x11ea32)){return _0x13b15c[_0xe052('0x7c')](_0x11ea32,{'transaction':_0x3d1868});}})['then'](function(){_0x11ea32['forEach'](function(_0xf278b8){socket['emit'](_0xe052('0x7d'),{'UserId':_0xf278b8,'OpenchannelQueueId':_0x13b15c['id']});});});});});});})[_0xe052('0x25')](respondWithStatusCode(_0x4f5ff4,null))['catch'](handleError(_0x4f5ff4,null));};exports['addAgents']=function(_0x17802b,_0x1ab86e,_0x20e609){return db[_0xe052('0x3f')][_0xe052('0x47')]({'where':{'id':_0x17802b[_0xe052('0x46')]['id']}})[_0xe052('0x25')](handleEntityNotFound(_0x1ab86e,null))[_0xe052('0x25')](function(_0x4dd6b9){if(_0x4dd6b9){return _0x4dd6b9[_0xe052('0x7e')](_0x17802b[_0xe052('0x49')][_0xe052('0x6c')],_[_0xe052('0x7f')](_0x17802b[_0xe052('0x49')],['ids','id'])||{})['spread'](function(_0x3c09a6){for(var _0x5c589a=0x0;_0x5c589a<_0x17802b['body']['ids'][_0xe052('0x37')];_0x5c589a+=0x1){socket[_0xe052('0x6a')]('userOpenchannelQueue:save',{'UserId':_0x17802b[_0xe052('0x49')][_0xe052('0x6c')][_0x5c589a],'OpenchannelQueueId':_0x17802b[_0xe052('0x46')]['id']});}return _0x3c09a6;});}})[_0xe052('0x25')](respondWithResult(_0x1ab86e,null))[_0xe052('0x44')](handleError(_0x1ab86e,null));};exports[_0xe052('0x7c')]=function(_0x4ea84a,_0x14f05f,_0x1eedbf){return db[_0xe052('0x3f')][_0xe052('0x47')]({'where':{'id':_0x4ea84a[_0xe052('0x46')]['id']}})[_0xe052('0x25')](handleEntityNotFound(_0x14f05f,null))['then'](function(_0x443bda){if(_0x443bda){return _0x443bda[_0xe052('0x7c')](_0x4ea84a['query'][_0xe052('0x6c')])[_0xe052('0x25')](function(){if(_[_0xe052('0x80')](_0x4ea84a['query'][_0xe052('0x6c')])){for(var _0x54f479=0x0;_0x54f479<_0x4ea84a[_0xe052('0x31')][_0xe052('0x6c')][_0xe052('0x37')];_0x54f479+=0x1){socket[_0xe052('0x6a')](_0xe052('0x7d'),{'UserId':Number(_0x4ea84a[_0xe052('0x31')][_0xe052('0x6c')][_0x54f479]),'OpenchannelQueueId':Number(_0x4ea84a['params']['id'])});}}else{socket['emit'](_0xe052('0x7d'),{'UserId':Number(_0x4ea84a['query'][_0xe052('0x6c')]),'OpenchannelQueueId':Number(_0x4ea84a[_0xe052('0x46')]['id'])});}});}})[_0xe052('0x25')](respondWithStatusCode(_0x14f05f,null))['catch'](handleError(_0x14f05f,null));};exports[_0xe052('0x81')]=function(_0xfb1d99,_0x2e8770,_0x50a45d){var _0x400a5d={};var _0x2e0a09={};var _0x26df0a;var _0x4c3743;return db['OpenchannelQueue'][_0xe052('0x5f')]({'where':{'id':_0xfb1d99['params']['id']}})[_0xe052('0x25')](handleEntityNotFound(_0x2e8770,null))[_0xe052('0x25')](function(_0x12b509){if(_0x12b509){_0x26df0a=_0x12b509;_0x2e0a09[_0xe052('0x30')]=_[_0xe052('0x32')](db['User']['rawAttributes']);_0x2e0a09['query']=_[_0xe052('0x32')](_0xfb1d99['query']);_0x2e0a09[_0xe052('0x33')]=_[_0xe052('0x34')](_0x2e0a09['model'],_0x2e0a09[_0xe052('0x31')]);_0x400a5d[_0xe052('0x35')]=_[_0xe052('0x34')](_0x2e0a09['model'],qs['fields'](_0xfb1d99[_0xe052('0x31')][_0xe052('0x36')]));_0x400a5d[_0xe052('0x35')]=_0x400a5d['attributes']['length']?_0x400a5d[_0xe052('0x35')]:_0x2e0a09[_0xe052('0x30')];_0x400a5d[_0xe052('0x53')]=qs['sort'](_0xfb1d99[_0xe052('0x31')][_0xe052('0x38')]);_0x400a5d[_0xe052('0x39')]=qs[_0xe052('0x33')](_[_0xe052('0x3a')](_0xfb1d99[_0xe052('0x31')],_0x2e0a09[_0xe052('0x33')]));if(_0xfb1d99[_0xe052('0x31')]['filter']){_0x400a5d[_0xe052('0x39')]=_[_0xe052('0x3c')](_0x400a5d[_0xe052('0x39')],{'$or':_[_0xe052('0x2b')](_0x400a5d[_0xe052('0x35')],function(_0xc5cff){var _0x3dc739={};_0x3dc739[_0xc5cff]={'$like':'%'+_0xfb1d99['query'][_0xe052('0x3b')]+'%'};return _0x3dc739;})});}_0x400a5d=_[_0xe052('0x3c')]({},_0x400a5d,_0xfb1d99[_0xe052('0x3e')]);return _0x26df0a[_0xe052('0x81')](_0x400a5d);}})[_0xe052('0x25')](function(_0x410db2){if(_0x410db2){_0x4c3743=_0x410db2['length'];if(!_0xfb1d99[_0xe052('0x31')]['hasOwnProperty'](_0xe052('0x61'))){_0x400a5d[_0xe052('0x1c')]=qs['limit'](_0xfb1d99['query'][_0xe052('0x1c')]);_0x400a5d[_0xe052('0x1b')]=qs[_0xe052('0x1b')](_0xfb1d99[_0xe052('0x31')][_0xe052('0x1b')]);}return _0x26df0a[_0xe052('0x81')](_0x400a5d);}})[_0xe052('0x25')](function(_0x118b8e){if(_0x118b8e){return _0x118b8e?{'count':_0x4c3743,'rows':_0x118b8e}:null;}})[_0xe052('0x25')](respondWithResult(_0x2e8770,null))[_0xe052('0x44')](handleError(_0x2e8770,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index fe12ed3..cf1d081 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 _0x3e5c=['../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','hasOwnProperty','exports','events'];(function(_0x3d9ee0,_0x3e106a){var _0x126719=function(_0x56d03f){while(--_0x56d03f){_0x3d9ee0['push'](_0x3d9ee0['shift']());}};_0x126719(++_0x3e106a);}(_0x3e5c,0xe9));var _0xc3e5=function(_0x60fbcf,_0x8bf696){_0x60fbcf=_0x60fbcf-0x0;var _0x4dd1a5=_0x3e5c[_0x60fbcf];return _0x4dd1a5;};'use strict';var EventEmitter=require(_0xc3e5('0x0'));var OpenchannelQueue=require(_0xc3e5('0x1'))['db'][_0xc3e5('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xc3e5('0x3')](0x0);var events={'afterCreate':_0xc3e5('0x4'),'afterUpdate':_0xc3e5('0x5'),'afterDestroy':_0xc3e5('0x6')};function emitEvent(_0x530d89){return function(_0xaaf10d,_0x28afb8,_0x983c68){OpenchannelQueueEvents['emit'](_0x530d89+':'+_0xaaf10d['id'],_0xaaf10d);OpenchannelQueueEvents['emit'](_0x530d89,_0xaaf10d);_0x983c68(null);};}for(var e in events){if(events[_0xc3e5('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0xc3e5('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x450e=['hook','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x1d1c96,_0x2db0a9){var _0x3ed593=function(_0x1c6cee){while(--_0x1c6cee){_0x1d1c96['push'](_0x1d1c96['shift']());}};_0x3ed593(++_0x2db0a9);}(_0x450e,0xf9));var _0xe450=function(_0x137b99,_0x45daa4){_0x137b99=_0x137b99-0x0;var _0x2659ce=_0x450e[_0x137b99];return _0x2659ce;};'use strict';var EventEmitter=require(_0xe450('0x0'));var OpenchannelQueue=require(_0xe450('0x1'))['db'][_0xe450('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xe450('0x3')](0x0);var events={'afterCreate':_0xe450('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x349434){return function(_0x152ac6,_0x186958,_0x377600){OpenchannelQueueEvents['emit'](_0x349434+':'+_0x152ac6['id'],_0x152ac6);OpenchannelQueueEvents[_0xe450('0x5')](_0x349434,_0x152ac6);_0x377600(null);};}for(var e in events){if(events[_0xe450('0x6')](e)){var event=events[e];OpenchannelQueue[_0xe450('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index dce9260..30381ef 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 _0xf186=['../../config/environment','./openchannelQueue.attributes','exports','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xf186,0x161));var _0x6f18=function(_0x221087,_0x111b2b){_0x221087=_0x221087-0x0;var _0x251247=_0xf186[_0x221087];return _0x251247;};'use strict';var _=require(_0x6f18('0x0'));var util=require(_0x6f18('0x1'));var logger=require(_0x6f18('0x2'))(_0x6f18('0x3'));var moment=require('moment');var BPromise=require(_0x6f18('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f18('0x5'));var rimraf=require(_0x6f18('0x6'));var config=require(_0x6f18('0x7'));var attributes=require(_0x6f18('0x8'));module[_0x6f18('0x9')]=function(_0x1d2ada,_0x2b4300){return _0x1d2ada['define'](_0x6f18('0xa'),attributes,{'tableName':_0x6f18('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeea3=['request-promise','path','./openchannelQueue.attributes','exports','define','OpenchannelQueue','lodash','util','api','moment','bluebird'];(function(_0x415ac5,_0x663a59){var _0x2fb770=function(_0x2286c4){while(--_0x2286c4){_0x415ac5['push'](_0x415ac5['shift']());}};_0x2fb770(++_0x663a59);}(_0xeea3,0xd7));var _0x3eea=function(_0x1a9fd9,_0x409c94){_0x1a9fd9=_0x1a9fd9-0x0;var _0x262df1=_0xeea3[_0x1a9fd9];return _0x262df1;};'use strict';var _=require(_0x3eea('0x0'));var util=require(_0x3eea('0x1'));var logger=require('../../config/logger')(_0x3eea('0x2'));var moment=require(_0x3eea('0x3'));var BPromise=require(_0x3eea('0x4'));var rp=require(_0x3eea('0x5'));var fs=require('fs');var path=require(_0x3eea('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3eea('0x7'));module[_0x3eea('0x8')]=function(_0x539c2f,_0x1e46d1){return _0x539c2f[_0x3eea('0x9')](_0x3eea('0xa'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index cb276ac..6c7c852 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 _0x4867=['ShowOpenchannelQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','./openchannelQueue.socket','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetOpenchannelQueue','OpenchannelQueue','options','raw','where','attributes','limit','include','map','model'];(function(_0x4074f9,_0x316618){var _0x2b369c=function(_0x51a266){while(--_0x51a266){_0x4074f9['push'](_0x4074f9['shift']());}};_0x2b369c(++_0x316618);}(_0x4867,0x1ca));var _0x7486=function(_0x517586,_0xc97d01){_0x517586=_0x517586-0x0;var _0x4d7494=_0x4867[_0x517586];return _0x4d7494;};'use strict';var _=require(_0x7486('0x0'));var util=require(_0x7486('0x1'));var moment=require(_0x7486('0x2'));var BPromise=require(_0x7486('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7486('0x4'));var db=require(_0x7486('0x5'))['db'];var utils=require(_0x7486('0x6'));var logger=require(_0x7486('0x7'))('rpc');var config=require(_0x7486('0x8'));var jayson=require(_0x7486('0x9'));var client=jayson[_0x7486('0xa')]['http']({'port':0x232a});config['redis']=_[_0x7486('0xb')](config[_0x7486('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7486('0xc')]));require(_0x7486('0xd'))['register'](socket);function respondWithRpcPromise(_0x5ae167,_0x3bb1eb,_0x36377f){return new BPromise(function(_0x173585,_0x3ea495){return client[_0x7486('0xe')](_0x5ae167,_0x36377f)[_0x7486('0xf')](function(_0x310474){logger['info'](_0x7486('0x10'),_0x3bb1eb,_0x7486('0x11'));logger[_0x7486('0x12')](_0x7486('0x13'),_0x3bb1eb,'request\x20sent',JSON[_0x7486('0x14')](_0x310474));if(_0x310474[_0x7486('0x15')]){if(_0x310474['error'][_0x7486('0x16')]===0x1f4){logger['error'](_0x7486('0x10'),_0x3bb1eb,_0x310474['error'][_0x7486('0x17')]);return _0x3ea495(_0x310474[_0x7486('0x15')]['message']);}logger['error'](_0x7486('0x10'),_0x3bb1eb,_0x310474[_0x7486('0x15')][_0x7486('0x17')]);return _0x173585(_0x310474['error'][_0x7486('0x17')]);}else{logger[_0x7486('0x18')](_0x7486('0x10'),_0x3bb1eb,_0x7486('0x11'));_0x173585(_0x310474['result']['message']);}})[_0x7486('0x19')](function(_0x5bf027){logger[_0x7486('0x15')](_0x7486('0x10'),_0x3bb1eb,_0x5bf027);_0x3ea495(_0x5bf027);});});}exports[_0x7486('0x1a')]=function(_0x559087){var _0x249b98=this;return new Promise(function(_0x2c3184,_0x2c0ab9){return db[_0x7486('0x1b')]['findAll']({'raw':_0x559087['options']?_0x559087[_0x7486('0x1c')][_0x7486('0x1d')]===undefined?!![]:![]:!![],'where':_0x559087[_0x7486('0x1c')]?_0x559087[_0x7486('0x1c')][_0x7486('0x1e')]||null:null,'attributes':_0x559087[_0x7486('0x1c')]?_0x559087['options'][_0x7486('0x1f')]||null:null,'limit':_0x559087[_0x7486('0x1c')]?_0x559087[_0x7486('0x1c')][_0x7486('0x20')]||null:null,'include':_0x559087['options']?_0x559087[_0x7486('0x1c')][_0x7486('0x21')]?_[_0x7486('0x22')](_0x559087[_0x7486('0x1c')][_0x7486('0x21')],function(_0x40be00){return{'model':db[_0x40be00[_0x7486('0x23')]],'as':_0x40be00['as'],'attributes':_0x40be00[_0x7486('0x1f')],'include':_0x40be00['include']?_[_0x7486('0x22')](_0x40be00['include'],function(_0x4c6857){return{'model':db[_0x4c6857['model']],'as':_0x4c6857['as'],'attributes':_0x4c6857[_0x7486('0x1f')],'include':_0x4c6857[_0x7486('0x21')]?_[_0x7486('0x22')](_0x4c6857[_0x7486('0x21')],function(_0x16cdcb){return{'model':db[_0x16cdcb[_0x7486('0x23')]],'as':_0x16cdcb['as'],'attributes':_0x16cdcb[_0x7486('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7486('0xf')](function(_0x498227){logger[_0x7486('0x18')]('GetOpenchannelQueue',_0x559087);logger[_0x7486('0x12')](_0x7486('0x1a'),_0x559087,JSON[_0x7486('0x14')](_0x498227));_0x2c3184(_0x498227);})[_0x7486('0x19')](function(_0x6aa420){logger['error'](_0x7486('0x1a'),_0x6aa420['message'],_0x559087);_0x2c0ab9(_0x249b98['error'](0x1f4,_0x6aa420[_0x7486('0x17')]));});});};exports[_0x7486('0x24')]=function(_0x3febbd){var _0x59a07d=this;return new Promise(function(_0x1324fa,_0x574956){return db['OpenchannelQueue'][_0x7486('0x25')]({'raw':_0x3febbd['options']?_0x3febbd[_0x7486('0x1c')][_0x7486('0x1d')]===undefined?!![]:![]:!![],'where':_0x3febbd[_0x7486('0x1c')]?_0x3febbd[_0x7486('0x1c')][_0x7486('0x1e')]||null:null,'attributes':_0x3febbd['options']?_0x3febbd['options'][_0x7486('0x1f')]||null:null,'include':_0x3febbd[_0x7486('0x1c')]?_0x3febbd[_0x7486('0x1c')][_0x7486('0x21')]?_['map'](_0x3febbd[_0x7486('0x1c')][_0x7486('0x21')],function(_0x11e35d){return{'model':db[_0x11e35d[_0x7486('0x23')]],'as':_0x11e35d['as'],'attributes':_0x11e35d[_0x7486('0x1f')],'include':_0x11e35d['include']?_[_0x7486('0x22')](_0x11e35d[_0x7486('0x21')],function(_0x52817c){return{'model':db[_0x52817c[_0x7486('0x23')]],'as':_0x52817c['as'],'attributes':_0x52817c[_0x7486('0x1f')],'include':_0x52817c[_0x7486('0x21')]?_['map'](_0x52817c['include'],function(_0x23fcbf){return{'model':db[_0x23fcbf[_0x7486('0x23')]],'as':_0x23fcbf['as'],'attributes':_0x23fcbf[_0x7486('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7486('0xf')](function(_0x5f117c){logger[_0x7486('0x18')](_0x7486('0x24'),_0x3febbd);logger[_0x7486('0x12')](_0x7486('0x24'),_0x3febbd,JSON[_0x7486('0x14')](_0x5f117c));_0x1324fa(_0x5f117c);})[_0x7486('0x19')](function(_0x20dc21){logger[_0x7486('0x15')]('ShowOpenchannelQueue',_0x20dc21[_0x7486('0x17')],_0x3febbd);_0x574956(_0x59a07d[_0x7486('0x15')](0x1f4,_0x20dc21['message']));});});}; \ No newline at end of file +var _0xaea8=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','limit','include','map','model','attributes','catch','ShowOpenchannelQueue','find','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaea8,0x1d3));var _0x8aea=function(_0x55353e,_0x493779){_0x55353e=_0x55353e-0x0;var _0x44d2e4=_0xaea8[_0x55353e];return _0x44d2e4;};'use strict';var _=require('lodash');var util=require(_0x8aea('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8aea('0x1'));var fs=require('fs');var Redis=require(_0x8aea('0x2'));var db=require(_0x8aea('0x3'))['db'];var utils=require(_0x8aea('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x8aea('0x5'));var jayson=require(_0x8aea('0x6'));var client=jayson[_0x8aea('0x7')][_0x8aea('0x8')]({'port':0x232a});config[_0x8aea('0x9')]=_[_0x8aea('0xa')](config['redis'],{'host':_0x8aea('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8aea('0x9')]));require(_0x8aea('0xc'))[_0x8aea('0xd')](socket);function respondWithRpcPromise(_0x106c5e,_0x2b283c,_0x5e1665){return new BPromise(function(_0xa79dd7,_0x25cd11){return client[_0x8aea('0xe')](_0x106c5e,_0x5e1665)[_0x8aea('0xf')](function(_0x5069f1){logger[_0x8aea('0x10')](_0x8aea('0x11'),_0x2b283c,'request\x20sent');logger[_0x8aea('0x12')](_0x8aea('0x13'),_0x2b283c,_0x8aea('0x14'),JSON[_0x8aea('0x15')](_0x5069f1));if(_0x5069f1[_0x8aea('0x16')]){if(_0x5069f1[_0x8aea('0x16')]['code']===0x1f4){logger[_0x8aea('0x16')](_0x8aea('0x11'),_0x2b283c,_0x5069f1[_0x8aea('0x16')][_0x8aea('0x17')]);return _0x25cd11(_0x5069f1[_0x8aea('0x16')][_0x8aea('0x17')]);}logger[_0x8aea('0x16')](_0x8aea('0x11'),_0x2b283c,_0x5069f1[_0x8aea('0x16')][_0x8aea('0x17')]);return _0xa79dd7(_0x5069f1[_0x8aea('0x16')][_0x8aea('0x17')]);}else{logger[_0x8aea('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x2b283c,_0x8aea('0x14'));_0xa79dd7(_0x5069f1[_0x8aea('0x18')][_0x8aea('0x17')]);}})['catch'](function(_0x462324){logger['error'](_0x8aea('0x11'),_0x2b283c,_0x462324);_0x25cd11(_0x462324);});});}exports[_0x8aea('0x19')]=function(_0x425e0c){var _0x19a8eb=this;return new Promise(function(_0x42524e,_0x25845f){return db[_0x8aea('0x1a')][_0x8aea('0x1b')]({'raw':_0x425e0c['options']?_0x425e0c[_0x8aea('0x1c')][_0x8aea('0x1d')]===undefined?!![]:![]:!![],'where':_0x425e0c[_0x8aea('0x1c')]?_0x425e0c[_0x8aea('0x1c')][_0x8aea('0x1e')]||null:null,'attributes':_0x425e0c[_0x8aea('0x1c')]?_0x425e0c[_0x8aea('0x1c')]['attributes']||null:null,'limit':_0x425e0c[_0x8aea('0x1c')]?_0x425e0c[_0x8aea('0x1c')][_0x8aea('0x1f')]||null:null,'include':_0x425e0c[_0x8aea('0x1c')]?_0x425e0c[_0x8aea('0x1c')][_0x8aea('0x20')]?_[_0x8aea('0x21')](_0x425e0c['options'][_0x8aea('0x20')],function(_0x379884){return{'model':db[_0x379884[_0x8aea('0x22')]],'as':_0x379884['as'],'attributes':_0x379884[_0x8aea('0x23')],'include':_0x379884['include']?_[_0x8aea('0x21')](_0x379884[_0x8aea('0x20')],function(_0x2d615){return{'model':db[_0x2d615[_0x8aea('0x22')]],'as':_0x2d615['as'],'attributes':_0x2d615[_0x8aea('0x23')],'include':_0x2d615[_0x8aea('0x20')]?_[_0x8aea('0x21')](_0x2d615[_0x8aea('0x20')],function(_0x55851d){return{'model':db[_0x55851d[_0x8aea('0x22')]],'as':_0x55851d['as'],'attributes':_0x55851d[_0x8aea('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x295d09){logger['info']('GetOpenchannelQueue',_0x425e0c);logger[_0x8aea('0x12')](_0x8aea('0x19'),_0x425e0c,JSON[_0x8aea('0x15')](_0x295d09));_0x42524e(_0x295d09);})[_0x8aea('0x24')](function(_0x5c4ca7){logger['error'](_0x8aea('0x19'),_0x5c4ca7['message'],_0x425e0c);_0x25845f(_0x19a8eb[_0x8aea('0x16')](0x1f4,_0x5c4ca7['message']));});});};exports[_0x8aea('0x25')]=function(_0x3ef1e2){var _0x30f7a0=this;return new Promise(function(_0x30c136,_0x3e88fb){return db[_0x8aea('0x1a')][_0x8aea('0x26')]({'raw':_0x3ef1e2['options']?_0x3ef1e2[_0x8aea('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3ef1e2['options']?_0x3ef1e2[_0x8aea('0x1c')][_0x8aea('0x1e')]||null:null,'attributes':_0x3ef1e2[_0x8aea('0x1c')]?_0x3ef1e2['options'][_0x8aea('0x23')]||null:null,'include':_0x3ef1e2['options']?_0x3ef1e2[_0x8aea('0x1c')][_0x8aea('0x20')]?_[_0x8aea('0x21')](_0x3ef1e2[_0x8aea('0x1c')]['include'],function(_0x181553){return{'model':db[_0x181553[_0x8aea('0x22')]],'as':_0x181553['as'],'attributes':_0x181553[_0x8aea('0x23')],'include':_0x181553[_0x8aea('0x20')]?_[_0x8aea('0x21')](_0x181553['include'],function(_0x477768){return{'model':db[_0x477768[_0x8aea('0x22')]],'as':_0x477768['as'],'attributes':_0x477768['attributes'],'include':_0x477768[_0x8aea('0x20')]?_[_0x8aea('0x21')](_0x477768[_0x8aea('0x20')],function(_0x4f139b){return{'model':db[_0x4f139b['model']],'as':_0x4f139b['as'],'attributes':_0x4f139b[_0x8aea('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa6420){logger[_0x8aea('0x10')](_0x8aea('0x25'),_0x3ef1e2);logger[_0x8aea('0x12')](_0x8aea('0x25'),_0x3ef1e2,JSON[_0x8aea('0x15')](_0xa6420));_0x30c136(_0xa6420);})[_0x8aea('0x24')](function(_0x10fdc4){logger[_0x8aea('0x16')](_0x8aea('0x25'),_0x10fdc4[_0x8aea('0x17')],_0x3ef1e2);_0x3e88fb(_0x30f7a0[_0x8aea('0x16')](0x1f4,_0x10fdc4[_0x8aea('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index b263a07..11277ab 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 _0x8c04=['openchannelQueue:','./openchannelQueue.events','save','remove','removeListener','register','length'];(function(_0xcad750,_0x105acb){var _0x1f8c59=function(_0x2429fd){while(--_0x2429fd){_0xcad750['push'](_0xcad750['shift']());}};_0x1f8c59(++_0x105acb);}(_0x8c04,0x151));var _0x48c0=function(_0x388d50,_0x56a03a){_0x388d50=_0x388d50-0x0;var _0x2a5868=_0x8c04[_0x388d50];return _0x2a5868;};'use strict';var OpenchannelQueueEvents=require(_0x48c0('0x0'));var events=[_0x48c0('0x1'),_0x48c0('0x2'),'update'];function createListener(_0x532325,_0x27d05b){return function(_0x4590ef){_0x27d05b['emit'](_0x532325,_0x4590ef);};}function removeListener(_0x3f6539,_0x3da217){return function(){OpenchannelQueueEvents[_0x48c0('0x3')](_0x3f6539,_0x3da217);};}exports[_0x48c0('0x4')]=function(_0x82aa32){for(var _0x4560fd=0x0,_0x472607=events[_0x48c0('0x5')];_0x4560fd<_0x472607;_0x4560fd++){var _0x3607ee=events[_0x4560fd];var _0x5d9d97=createListener(_0x48c0('0x6')+_0x3607ee,_0x82aa32);OpenchannelQueueEvents['on'](_0x3607ee,_0x5d9d97);}}; \ No newline at end of file +var _0xaae7=['update','emit','removeListener','register','length','./openchannelQueue.events','remove'];(function(_0x28d225,_0x43be18){var _0x1f79e1=function(_0x362c23){while(--_0x362c23){_0x28d225['push'](_0x28d225['shift']());}};_0x1f79e1(++_0x43be18);}(_0xaae7,0x194));var _0x7aae=function(_0x35ddf1,_0x2fe4b2){_0x35ddf1=_0x35ddf1-0x0;var _0x4368a3=_0xaae7[_0x35ddf1];return _0x4368a3;};'use strict';var OpenchannelQueueEvents=require(_0x7aae('0x0'));var events=['save',_0x7aae('0x1'),_0x7aae('0x2')];function createListener(_0x3d95ba,_0x47938a){return function(_0x1cfaa6){_0x47938a[_0x7aae('0x3')](_0x3d95ba,_0x1cfaa6);};}function removeListener(_0x515c4f,_0x516768){return function(){OpenchannelQueueEvents[_0x7aae('0x4')](_0x515c4f,_0x516768);};}exports[_0x7aae('0x5')]=function(_0x212fe8){for(var _0xb2555a=0x0,_0x2a3cb7=events[_0x7aae('0x6')];_0xb2555a<_0x2a3cb7;_0xb2555a++){var _0x17e655=events[_0xb2555a];var _0x3c9ffa=createListener('openchannelQueue:'+_0x17e655,_0x212fe8);OpenchannelQueueEvents['on'](_0x17e655,_0x3c9ffa);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index ce93309..4fcad18 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 _0x2073=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','show','create','put','/:id','delete'];(function(_0x2398ed,_0x4176c3){var _0x31b1ae=function(_0x56d634){while(--_0x56d634){_0x2398ed['push'](_0x2398ed['shift']());}};_0x31b1ae(++_0x4176c3);}(_0x2073,0x19f));var _0x3207=function(_0x12dd11,_0x52b882){_0x12dd11=_0x12dd11-0x0;var _0x3a502b=_0x2073[_0x12dd11];return _0x3a502b;};'use strict';var multer=require(_0x3207('0x0'));var util=require(_0x3207('0x1'));var path=require(_0x3207('0x2'));var timeout=require(_0x3207('0x3'));var express=require(_0x3207('0x4'));var router=express[_0x3207('0x5')]();var auth=require(_0x3207('0x6'));var interaction=require(_0x3207('0x7'));var config=require(_0x3207('0x8'));var controller=require(_0x3207('0x9'));router[_0x3207('0xa')]('/',auth[_0x3207('0xb')](),controller['index']);router['get']('/describe',auth[_0x3207('0xb')](),controller['describe']);router[_0x3207('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x3207('0xc')]);router['post']('/',auth[_0x3207('0xb')](),controller[_0x3207('0xd')]);router[_0x3207('0xe')](_0x3207('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x3207('0x10')](_0x3207('0xf'),auth[_0x3207('0xb')](),controller['destroy']);module[_0x3207('0x11')]=router; \ No newline at end of file +var _0x80e5=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','put','/:id','delete','destroy','exports','util'];(function(_0x486cc6,_0x139d87){var _0x34d606=function(_0x5e9194){while(--_0x5e9194){_0x486cc6['push'](_0x486cc6['shift']());}};_0x34d606(++_0x139d87);}(_0x80e5,0xd1));var _0x580e=function(_0x794207,_0x54a989){_0x794207=_0x794207-0x0;var _0x4ee1c9=_0x80e5[_0x794207];return _0x4ee1c9;};'use strict';var multer=require('multer');var util=require(_0x580e('0x0'));var path=require('path');var timeout=require(_0x580e('0x1'));var express=require(_0x580e('0x2'));var router=express[_0x580e('0x3')]();var auth=require(_0x580e('0x4'));var interaction=require(_0x580e('0x5'));var config=require(_0x580e('0x6'));var controller=require('./openchannelQueueReport.controller');router[_0x580e('0x7')]('/',auth[_0x580e('0x8')](),controller['index']);router[_0x580e('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x580e('0x9')]);router[_0x580e('0x7')]('/:id',auth[_0x580e('0x8')](),controller['show']);router['post']('/',auth[_0x580e('0x8')](),controller['create']);router[_0x580e('0xa')](_0x580e('0xb'),auth[_0x580e('0x8')](),controller['update']);router[_0x580e('0xc')](_0x580e('0xb'),auth[_0x580e('0x8')](),controller[_0x580e('0xd')]);module[_0x580e('0xe')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index a84e9e2..766ec06 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 _0x6b23=['moment','sequelize','STRING','DATE'];(function(_0x8c4af0,_0x1253a6){var _0x84701e=function(_0x17bca0){while(--_0x17bca0){_0x8c4af0['push'](_0x8c4af0['shift']());}};_0x84701e(++_0x1253a6);}(_0x6b23,0x178));var _0x36b2=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x6b23[_0x266618];return _0x54dbf5;};'use strict';var moment=require(_0x36b2('0x0'));var Sequelize=require(_0x36b2('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x36b2('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x36b2('0x3')]},'leaveAt':{'type':Sequelize[_0x36b2('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x36b2('0x3')]},'reason':{'type':Sequelize[_0x36b2('0x2')]}}; \ No newline at end of file +var _0x3530=['sequelize','exports','STRING','DATE','moment'];(function(_0x2a49ee,_0x455cea){var _0x4add3a=function(_0x58a59f){while(--_0x58a59f){_0x2a49ee['push'](_0x2a49ee['shift']());}};_0x4add3a(++_0x455cea);}(_0x3530,0xb8));var _0x0353=function(_0x37561d,_0x24cddc){_0x37561d=_0x37561d-0x0;var _0x52e013=_0x3530[_0x37561d];return _0x52e013;};'use strict';var moment=require(_0x0353('0x0'));var Sequelize=require(_0x0353('0x1'));module[_0x0353('0x2')]={'uniqueid':{'type':Sequelize[_0x0353('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0353('0x3')]},'joinAt':{'type':Sequelize[_0x0353('0x4')]},'leaveAt':{'type':Sequelize[_0x0353('0x4')]},'acceptAt':{'type':Sequelize[_0x0353('0x4')]},'exitAt':{'type':Sequelize[_0x0353('0x4')]},'reason':{'type':Sequelize[_0x0353('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 04c21c9..2ef924c 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 _0x1867=['key','query','keys','intersection','model','fields','length','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','options','OpenchannelQueueReport','then','includeAll','include','findAll','rows','catch','show','params','attributes','create','body','update','find','destroy','describe','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','stack','name','send','index','map','rawAttributes','fieldName','type'];(function(_0x12b83d,_0x4bcec7){var _0x1fd39d=function(_0x449185){while(--_0x449185){_0x12b83d['push'](_0x12b83d['shift']());}};_0x1fd39d(++_0x4bcec7);}(_0x1867,0xb5));var _0x7186=function(_0x3c03ff,_0x266c7b){_0x3c03ff=_0x3c03ff-0x0;var _0x414bd1=_0x1867[_0x3c03ff];return _0x414bd1;};'use strict';var pdf=require(_0x7186('0x0'));var emlformat=require(_0x7186('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7186('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7186('0x3'));var moment=require(_0x7186('0x4'));var BPromise=require(_0x7186('0x5'));var Mustache=require(_0x7186('0x6'));var util=require(_0x7186('0x7'));var path=require(_0x7186('0x8'));var sox=require(_0x7186('0x9'));var csv=require(_0x7186('0xa'));var ejs=require(_0x7186('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7186('0xc'));var crypto=require(_0x7186('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7186('0xe'));var toCsv=require(_0x7186('0xa'));var querystring=require(_0x7186('0xf'));var Papa=require(_0x7186('0x10'));var Redis=require('ioredis');var authService=require(_0x7186('0x11'));var qs=require(_0x7186('0x12'));var as=require(_0x7186('0x13'));var hardwareService=require(_0x7186('0x14'));var logger=require(_0x7186('0x15'))('api');var utils=require(_0x7186('0x16'));var config=require(_0x7186('0x17'));var db=require(_0x7186('0x18'))['db'];function respondWithStatusCode(_0x19f803,_0x4a20df){_0x4a20df=_0x4a20df||0xcc;return function(_0x3493a6){if(_0x3493a6){return _0x19f803[_0x7186('0x19')](_0x4a20df);}return _0x19f803[_0x7186('0x1a')](_0x4a20df)[_0x7186('0x1b')]();};}function respondWithResult(_0x489e35,_0x58bbb8){_0x58bbb8=_0x58bbb8||0xc8;return function(_0x58d522){if(_0x58d522){return _0x489e35[_0x7186('0x1a')](_0x58bbb8)[_0x7186('0x1c')](_0x58d522);}};}function respondWithFilteredResult(_0x1e78f9,_0x1d392a){return function(_0x51d8d1){if(_0x51d8d1){var _0x2a8de4=_0x51d8d1[_0x7186('0x1d')],_0x1cc347=_0x1d392a[_0x7186('0x1e')],_0x915126=_0x1d392a[_0x7186('0x1e')]+_0x1d392a[_0x7186('0x1f')],_0x396e13;if(_0x915126>=_0x2a8de4){_0x915126=_0x2a8de4;_0x396e13=0xc8;}else{_0x396e13=0xce;}_0x1e78f9['status'](_0x396e13);return _0x1e78f9[_0x7186('0x20')](_0x7186('0x21'),_0x1cc347+'-'+_0x915126+'/'+_0x2a8de4)['json'](_0x51d8d1);}return null;};}function patchUpdates(_0x1394b7){return function(_0x40b42f){try{jsonpatch[_0x7186('0x22')](_0x40b42f,_0x1394b7,!![]);}catch(_0x4bdfad){return BPromise['reject'](_0x4bdfad);}return _0x40b42f[_0x7186('0x23')]();};}function saveUpdates(_0x584149,_0x3fc1f0){return function(_0x544341){if(_0x544341){return _0x544341['update'](_0x584149)['then'](function(_0x3f932b){return _0x3f932b;});}return null;};}function removeEntity(_0xb0ac28,_0x48bfaf){return function(_0x4af3f3){if(_0x4af3f3){return _0x4af3f3['destroy']()['then'](function(){_0xb0ac28[_0x7186('0x1a')](0xcc)[_0x7186('0x1b')]();});}};}function handleEntityNotFound(_0x116c93,_0x4b8176){return function(_0x25d760){if(!_0x25d760){_0x116c93[_0x7186('0x19')](0x194);}return _0x25d760;};}function handleError(_0xb5bb54,_0xa6be2b){_0xa6be2b=_0xa6be2b||0x1f4;return function(_0x1baf5b){logger['error'](_0x1baf5b[_0x7186('0x24')]);if(_0x1baf5b[_0x7186('0x25')]){delete _0x1baf5b[_0x7186('0x25')];}_0xb5bb54[_0x7186('0x1a')](_0xa6be2b)[_0x7186('0x26')](_0x1baf5b);};}exports[_0x7186('0x27')]=function(_0x156466,_0xf2db43){var _0x53c3fe={},_0x29d231={},_0x463f1e={'count':0x0,'rows':[]};var _0x49c1d5=_[_0x7186('0x28')](db['OpenchannelQueueReport'][_0x7186('0x29')],function(_0xa909b0){return{'name':_0xa909b0[_0x7186('0x2a')],'type':_0xa909b0[_0x7186('0x2b')][_0x7186('0x2c')]};});_0x29d231['model']=_[_0x7186('0x28')](_0x49c1d5,_0x7186('0x25'));_0x29d231[_0x7186('0x2d')]=_[_0x7186('0x2e')](_0x156466[_0x7186('0x2d')]);_0x29d231['filters']=_[_0x7186('0x2f')](_0x29d231[_0x7186('0x30')],_0x29d231[_0x7186('0x2d')]);_0x53c3fe['attributes']=_[_0x7186('0x2f')](_0x29d231[_0x7186('0x30')],qs[_0x7186('0x31')](_0x156466[_0x7186('0x2d')][_0x7186('0x31')]));_0x53c3fe['attributes']=_0x53c3fe['attributes'][_0x7186('0x32')]?_0x53c3fe['attributes']:_0x29d231[_0x7186('0x30')];if(!_0x156466[_0x7186('0x2d')][_0x7186('0x33')]('nolimit')){_0x53c3fe[_0x7186('0x1f')]=qs[_0x7186('0x1f')](_0x156466[_0x7186('0x2d')][_0x7186('0x1f')]);_0x53c3fe['offset']=qs['offset'](_0x156466['query'][_0x7186('0x1e')]);}_0x53c3fe['order']=qs['sort'](_0x156466['query'][_0x7186('0x34')]);_0x53c3fe[_0x7186('0x35')]=qs[_0x7186('0x36')](_[_0x7186('0x37')](_0x156466[_0x7186('0x2d')],_0x29d231[_0x7186('0x36')]));if(_0x156466[_0x7186('0x2d')]['filter']){_0x53c3fe['where']=_[_0x7186('0x38')](_0x53c3fe[_0x7186('0x35')],{'$or':_['map'](_0x49c1d5,function(_0x23fe6a){if(_0x23fe6a[_0x7186('0x2b')]!==_0x7186('0x39')){var _0x1e32b5={};_0x1e32b5[_0x23fe6a['name']]={'$like':'%'+_0x156466[_0x7186('0x2d')]['filter']+'%'};return _0x1e32b5;}})});}_0x53c3fe=_['merge']({},_0x53c3fe,_0x156466[_0x7186('0x3a')]);var _0x34b26c={'where':_0x53c3fe[_0x7186('0x35')]};return db[_0x7186('0x3b')]['count'](_0x34b26c)[_0x7186('0x3c')](function(_0x356407){_0x463f1e[_0x7186('0x1d')]=_0x356407;if(_0x156466['query'][_0x7186('0x3d')]){_0x53c3fe[_0x7186('0x3e')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x7186('0x3f')](_0x53c3fe);})[_0x7186('0x3c')](function(_0x4f4d40){_0x463f1e[_0x7186('0x40')]=_0x4f4d40;return _0x463f1e;})[_0x7186('0x3c')](respondWithFilteredResult(_0xf2db43,_0x53c3fe))[_0x7186('0x41')](handleError(_0xf2db43,null));};exports[_0x7186('0x42')]=function(_0x3c63c1,_0x41473a){var _0x1ec409={'raw':!![],'where':{'id':_0x3c63c1[_0x7186('0x43')]['id']}},_0x41081e={};_0x41081e[_0x7186('0x30')]=_['keys'](db[_0x7186('0x3b')][_0x7186('0x29')]);_0x41081e['query']=_[_0x7186('0x2e')](_0x3c63c1[_0x7186('0x2d')]);_0x41081e['filters']=_[_0x7186('0x2f')](_0x41081e[_0x7186('0x30')],_0x41081e[_0x7186('0x2d')]);_0x1ec409[_0x7186('0x44')]=_['intersection'](_0x41081e[_0x7186('0x30')],qs[_0x7186('0x31')](_0x3c63c1[_0x7186('0x2d')][_0x7186('0x31')]));_0x1ec409[_0x7186('0x44')]=_0x1ec409[_0x7186('0x44')][_0x7186('0x32')]?_0x1ec409[_0x7186('0x44')]:_0x41081e[_0x7186('0x30')];if(_0x3c63c1[_0x7186('0x2d')][_0x7186('0x3d')]){_0x1ec409[_0x7186('0x3e')]=[{'all':!![]}];}_0x1ec409=_[_0x7186('0x38')]({},_0x1ec409,_0x3c63c1[_0x7186('0x3a')]);return db['OpenchannelQueueReport']['find'](_0x1ec409)[_0x7186('0x3c')](handleEntityNotFound(_0x41473a,null))[_0x7186('0x3c')](respondWithResult(_0x41473a,null))['catch'](handleError(_0x41473a,null));};exports[_0x7186('0x45')]=function(_0x4e22b0,_0x18a8aa){return db[_0x7186('0x3b')]['create'](_0x4e22b0[_0x7186('0x46')],{})['then'](respondWithResult(_0x18a8aa,0xc9))['catch'](handleError(_0x18a8aa,null));};exports[_0x7186('0x47')]=function(_0x214686,_0x55e70c){if(_0x214686[_0x7186('0x46')]['id']){delete _0x214686[_0x7186('0x46')]['id'];}return db[_0x7186('0x3b')][_0x7186('0x48')]({'where':{'id':_0x214686[_0x7186('0x43')]['id']}})[_0x7186('0x3c')](handleEntityNotFound(_0x55e70c,null))['then'](saveUpdates(_0x214686[_0x7186('0x46')],null))[_0x7186('0x3c')](respondWithResult(_0x55e70c,null))[_0x7186('0x41')](handleError(_0x55e70c,null));};exports[_0x7186('0x49')]=function(_0x392ebc,_0x5ab66a){return db[_0x7186('0x3b')][_0x7186('0x48')]({'where':{'id':_0x392ebc['params']['id']}})[_0x7186('0x3c')](handleEntityNotFound(_0x5ab66a,null))['then'](removeEntity(_0x5ab66a,null))[_0x7186('0x41')](handleError(_0x5ab66a,null));};exports[_0x7186('0x4a')]=function(_0x41241f,_0x2008d5){return db[_0x7186('0x3b')]['describe']()[_0x7186('0x3c')](respondWithResult(_0x2008d5,null))[_0x7186('0x41')](handleError(_0x2008d5,null));}; \ No newline at end of file +var _0x97e6=['../../config/utils','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x5379f2,_0x3baf6d){var _0x447e6b=function(_0xca3497){while(--_0xca3497){_0x5379f2['push'](_0x5379f2['shift']());}};_0x447e6b(++_0x3baf6d);}(_0x97e6,0x159));var _0x697e=function(_0x33ea9e,_0x2f0d10){_0x33ea9e=_0x33ea9e-0x0;var _0x3ac557=_0x97e6[_0x33ea9e];return _0x3ac557;};'use strict';var pdf=require(_0x697e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x697e('0x1'));var zipdir=require(_0x697e('0x2'));var jsonpatch=require(_0x697e('0x3'));var rp=require('request-promise');var moment=require(_0x697e('0x4'));var BPromise=require(_0x697e('0x5'));var Mustache=require('mustache');var util=require(_0x697e('0x6'));var path=require('path');var sox=require(_0x697e('0x7'));var csv=require(_0x697e('0x8'));var ejs=require(_0x697e('0x9'));var fs=require('fs');var _=require(_0x697e('0xa'));var squel=require(_0x697e('0xb'));var crypto=require(_0x697e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x697e('0x8'));var querystring=require(_0x697e('0xd'));var Papa=require(_0x697e('0xe'));var Redis=require('ioredis');var authService=require(_0x697e('0xf'));var qs=require(_0x697e('0x10'));var as=require(_0x697e('0x11'));var hardwareService=require(_0x697e('0x12'));var logger=require(_0x697e('0x13'))('api');var utils=require(_0x697e('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11d502,_0x381c9d){_0x381c9d=_0x381c9d||0xcc;return function(_0x1aa4bb){if(_0x1aa4bb){return _0x11d502['sendStatus'](_0x381c9d);}return _0x11d502[_0x697e('0x15')](_0x381c9d)[_0x697e('0x16')]();};}function respondWithResult(_0x53f190,_0x504b68){_0x504b68=_0x504b68||0xc8;return function(_0x27a5f1){if(_0x27a5f1){return _0x53f190[_0x697e('0x15')](_0x504b68)[_0x697e('0x17')](_0x27a5f1);}};}function respondWithFilteredResult(_0x2254c1,_0x357b6a){return function(_0x698b6d){if(_0x698b6d){var _0x1f0f4f=_0x698b6d[_0x697e('0x18')],_0x32ff03=_0x357b6a[_0x697e('0x19')],_0x3931a5=_0x357b6a['offset']+_0x357b6a[_0x697e('0x1a')],_0x5bc624;if(_0x3931a5>=_0x1f0f4f){_0x3931a5=_0x1f0f4f;_0x5bc624=0xc8;}else{_0x5bc624=0xce;}_0x2254c1['status'](_0x5bc624);return _0x2254c1[_0x697e('0x1b')](_0x697e('0x1c'),_0x32ff03+'-'+_0x3931a5+'/'+_0x1f0f4f)['json'](_0x698b6d);}return null;};}function patchUpdates(_0xa000e4){return function(_0x282dad){try{jsonpatch[_0x697e('0x1d')](_0x282dad,_0xa000e4,!![]);}catch(_0x3fb075){return BPromise[_0x697e('0x1e')](_0x3fb075);}return _0x282dad[_0x697e('0x1f')]();};}function saveUpdates(_0x475392,_0x26e3cd){return function(_0x504727){if(_0x504727){return _0x504727[_0x697e('0x20')](_0x475392)[_0x697e('0x21')](function(_0x495283){return _0x495283;});}return null;};}function removeEntity(_0x39b868,_0x5949e5){return function(_0x179fab){if(_0x179fab){return _0x179fab[_0x697e('0x22')]()['then'](function(){_0x39b868[_0x697e('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa5f268,_0x1afb71){return function(_0x1d37ae){if(!_0x1d37ae){_0xa5f268[_0x697e('0x23')](0x194);}return _0x1d37ae;};}function handleError(_0x11122b,_0x4b4514){_0x4b4514=_0x4b4514||0x1f4;return function(_0x4b5222){logger[_0x697e('0x24')](_0x4b5222[_0x697e('0x25')]);if(_0x4b5222[_0x697e('0x26')]){delete _0x4b5222[_0x697e('0x26')];}_0x11122b[_0x697e('0x15')](_0x4b4514)[_0x697e('0x27')](_0x4b5222);};}exports[_0x697e('0x28')]=function(_0x534c71,_0x487aaf){var _0x1e3803={},_0x2cc855={},_0xfa2388={'count':0x0,'rows':[]};var _0x41684a=_[_0x697e('0x29')](db[_0x697e('0x2a')][_0x697e('0x2b')],function(_0x55833e){return{'name':_0x55833e['fieldName'],'type':_0x55833e['type'][_0x697e('0x2c')]};});_0x2cc855['model']=_['map'](_0x41684a,'name');_0x2cc855['query']=_[_0x697e('0x2d')](_0x534c71[_0x697e('0x2e')]);_0x2cc855[_0x697e('0x2f')]=_[_0x697e('0x30')](_0x2cc855['model'],_0x2cc855[_0x697e('0x2e')]);_0x1e3803[_0x697e('0x31')]=_[_0x697e('0x30')](_0x2cc855[_0x697e('0x32')],qs[_0x697e('0x33')](_0x534c71[_0x697e('0x2e')]['fields']));_0x1e3803['attributes']=_0x1e3803[_0x697e('0x31')][_0x697e('0x34')]?_0x1e3803['attributes']:_0x2cc855[_0x697e('0x32')];if(!_0x534c71[_0x697e('0x2e')]['hasOwnProperty'](_0x697e('0x35'))){_0x1e3803[_0x697e('0x1a')]=qs[_0x697e('0x1a')](_0x534c71[_0x697e('0x2e')][_0x697e('0x1a')]);_0x1e3803[_0x697e('0x19')]=qs['offset'](_0x534c71[_0x697e('0x2e')]['offset']);}_0x1e3803['order']=qs[_0x697e('0x36')](_0x534c71[_0x697e('0x2e')][_0x697e('0x36')]);_0x1e3803['where']=qs[_0x697e('0x2f')](_[_0x697e('0x37')](_0x534c71[_0x697e('0x2e')],_0x2cc855['filters']));if(_0x534c71[_0x697e('0x2e')][_0x697e('0x38')]){_0x1e3803[_0x697e('0x39')]=_[_0x697e('0x3a')](_0x1e3803[_0x697e('0x39')],{'$or':_['map'](_0x41684a,function(_0x5718f1){if(_0x5718f1[_0x697e('0x3b')]!==_0x697e('0x3c')){var _0x28ed6e={};_0x28ed6e[_0x5718f1[_0x697e('0x26')]]={'$like':'%'+_0x534c71[_0x697e('0x2e')][_0x697e('0x38')]+'%'};return _0x28ed6e;}})});}_0x1e3803=_['merge']({},_0x1e3803,_0x534c71[_0x697e('0x3d')]);var _0x4f9ae8={'where':_0x1e3803[_0x697e('0x39')]};return db['OpenchannelQueueReport'][_0x697e('0x18')](_0x4f9ae8)[_0x697e('0x21')](function(_0x5327a5){_0xfa2388[_0x697e('0x18')]=_0x5327a5;if(_0x534c71[_0x697e('0x2e')][_0x697e('0x3e')]){_0x1e3803[_0x697e('0x3f')]=[{'all':!![]}];}return db[_0x697e('0x2a')][_0x697e('0x40')](_0x1e3803);})['then'](function(_0x19cc42){_0xfa2388[_0x697e('0x41')]=_0x19cc42;return _0xfa2388;})[_0x697e('0x21')](respondWithFilteredResult(_0x487aaf,_0x1e3803))['catch'](handleError(_0x487aaf,null));};exports[_0x697e('0x42')]=function(_0x49db43,_0x1b0e30){var _0x2c3bdc={'raw':!![],'where':{'id':_0x49db43['params']['id']}},_0x2f0c21={};_0x2f0c21[_0x697e('0x32')]=_[_0x697e('0x2d')](db[_0x697e('0x2a')][_0x697e('0x2b')]);_0x2f0c21[_0x697e('0x2e')]=_[_0x697e('0x2d')](_0x49db43['query']);_0x2f0c21[_0x697e('0x2f')]=_[_0x697e('0x30')](_0x2f0c21[_0x697e('0x32')],_0x2f0c21['query']);_0x2c3bdc[_0x697e('0x31')]=_['intersection'](_0x2f0c21['model'],qs[_0x697e('0x33')](_0x49db43[_0x697e('0x2e')]['fields']));_0x2c3bdc[_0x697e('0x31')]=_0x2c3bdc['attributes'][_0x697e('0x34')]?_0x2c3bdc[_0x697e('0x31')]:_0x2f0c21[_0x697e('0x32')];if(_0x49db43['query'][_0x697e('0x3e')]){_0x2c3bdc[_0x697e('0x3f')]=[{'all':!![]}];}_0x2c3bdc=_[_0x697e('0x3a')]({},_0x2c3bdc,_0x49db43['options']);return db['OpenchannelQueueReport'][_0x697e('0x43')](_0x2c3bdc)[_0x697e('0x21')](handleEntityNotFound(_0x1b0e30,null))[_0x697e('0x21')](respondWithResult(_0x1b0e30,null))[_0x697e('0x44')](handleError(_0x1b0e30,null));};exports[_0x697e('0x45')]=function(_0x31b991,_0x324cd2){return db[_0x697e('0x2a')][_0x697e('0x45')](_0x31b991[_0x697e('0x46')],{})[_0x697e('0x21')](respondWithResult(_0x324cd2,0xc9))[_0x697e('0x44')](handleError(_0x324cd2,null));};exports[_0x697e('0x20')]=function(_0x4a938d,_0x338bd7){if(_0x4a938d[_0x697e('0x46')]['id']){delete _0x4a938d[_0x697e('0x46')]['id'];}return db[_0x697e('0x2a')][_0x697e('0x43')]({'where':{'id':_0x4a938d[_0x697e('0x47')]['id']}})[_0x697e('0x21')](handleEntityNotFound(_0x338bd7,null))['then'](saveUpdates(_0x4a938d[_0x697e('0x46')],null))[_0x697e('0x21')](respondWithResult(_0x338bd7,null))['catch'](handleError(_0x338bd7,null));};exports[_0x697e('0x22')]=function(_0xcc78a,_0x3210e6){return db[_0x697e('0x2a')][_0x697e('0x43')]({'where':{'id':_0xcc78a[_0x697e('0x47')]['id']}})['then'](handleEntityNotFound(_0x3210e6,null))[_0x697e('0x21')](removeEntity(_0x3210e6,null))[_0x697e('0x44')](handleError(_0x3210e6,null));};exports[_0x697e('0x48')]=function(_0x130e35,_0x15c604){return db['OpenchannelQueueReport'][_0x697e('0x48')]()['then'](respondWithResult(_0x15c604,null))[_0x697e('0x44')](handleError(_0x15c604,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index c3447af..c0279bb 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 _0x9b67=['util','../../config/logger','api','moment','request-promise','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x12cea1,_0x55b095){var _0xce9b7b=function(_0x32c5ef){while(--_0x32c5ef){_0x12cea1['push'](_0x12cea1['shift']());}};_0xce9b7b(++_0x55b095);}(_0x9b67,0xf6));var _0x79b6=function(_0x11f0d5,_0x1bf0d4){_0x11f0d5=_0x11f0d5-0x0;var _0x1ddf7c=_0x9b67[_0x11f0d5];return _0x1ddf7c;};'use strict';var _=require(_0x79b6('0x0'));var util=require(_0x79b6('0x1'));var logger=require(_0x79b6('0x2'))(_0x79b6('0x3'));var moment=require(_0x79b6('0x4'));var BPromise=require('bluebird');var rp=require(_0x79b6('0x5'));var fs=require('fs');var path=require(_0x79b6('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x79b6('0x7'));module[_0x79b6('0x8')]=function(_0x258103,_0xec367e){return _0x258103[_0x79b6('0x9')](_0x79b6('0xa'),attributes,{'tableName':_0x79b6('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x79b6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf961=['request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xf961,0x1cf));var _0x1f96=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xf961[_0xaa0309];return _0x5de7ce;};'use strict';var _=require(_0x1f96('0x0'));var util=require(_0x1f96('0x1'));var logger=require(_0x1f96('0x2'))(_0x1f96('0x3'));var moment=require('moment');var BPromise=require(_0x1f96('0x4'));var rp=require(_0x1f96('0x5'));var fs=require('fs');var path=require(_0x1f96('0x6'));var rimraf=require('rimraf');var config=require(_0x1f96('0x7'));var attributes=require(_0x1f96('0x8'));module[_0x1f96('0x9')]=function(_0x518062,_0x40caad){return _0x518062['define'](_0x1f96('0xa'),attributes,{'tableName':_0x1f96('0xb'),'paranoid':![],'indexes':[{'name':_0x1f96('0xc'),'fields':[_0x1f96('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 84f933c..06d1c3d 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 _0xcaf2=['options','raw','CreateOpenchannelQueueReport','stringify','catch','UpdateOpenchannelQueueReport','update','where','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','OpenchannelQueueReport','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcaf2,0x8a));var _0x2caf=function(_0x47327a,_0xa744ab){_0x47327a=_0x47327a-0x0;var _0x258c4c=_0xcaf2[_0x47327a];return _0x258c4c;};'use strict';var _=require(_0x2caf('0x0'));var util=require('util');var moment=require(_0x2caf('0x1'));var BPromise=require(_0x2caf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2caf('0x3'));var db=require(_0x2caf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2caf('0x5'))('rpc');var config=require(_0x2caf('0x6'));var jayson=require(_0x2caf('0x7'));var client=jayson[_0x2caf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc44e4e,_0x314486,_0x4667c6){return new BPromise(function(_0x34e792,_0x5611aa){return client[_0x2caf('0x9')](_0xc44e4e,_0x4667c6)[_0x2caf('0xa')](function(_0x45e520){logger[_0x2caf('0xb')](_0x2caf('0xc'),_0x314486,_0x2caf('0xd'));logger[_0x2caf('0xe')](_0x2caf('0xf'),_0x314486,_0x2caf('0xd'),JSON['stringify'](_0x45e520));if(_0x45e520[_0x2caf('0x10')]){if(_0x45e520[_0x2caf('0x10')][_0x2caf('0x11')]===0x1f4){logger[_0x2caf('0x10')](_0x2caf('0xc'),_0x314486,_0x45e520[_0x2caf('0x10')][_0x2caf('0x12')]);return _0x5611aa(_0x45e520[_0x2caf('0x10')]['message']);}logger[_0x2caf('0x10')](_0x2caf('0xc'),_0x314486,_0x45e520['error']['message']);return _0x34e792(_0x45e520['error'][_0x2caf('0x12')]);}else{logger['info'](_0x2caf('0xc'),_0x314486,_0x2caf('0xd'));_0x34e792(_0x45e520[_0x2caf('0x13')][_0x2caf('0x12')]);}})['catch'](function(_0x184355){logger['error'](_0x2caf('0xc'),_0x314486,_0x184355);_0x5611aa(_0x184355);});});}exports['CreateOpenchannelQueueReport']=function(_0x4a33fc){var _0x3e975f=this;return new Promise(function(_0x58047b,_0xe72440){return db[_0x2caf('0x14')]['create'](_0x4a33fc[_0x2caf('0x15')],{'raw':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc[_0x2caf('0x16')][_0x2caf('0x17')]===undefined?!![]:![]:!![]})[_0x2caf('0xa')](function(_0x595f2f){logger[_0x2caf('0xb')](_0x2caf('0x18'),_0x4a33fc);logger[_0x2caf('0xe')](_0x2caf('0x18'),_0x4a33fc,JSON[_0x2caf('0x19')](_0x595f2f));_0x58047b(_0x595f2f);})[_0x2caf('0x1a')](function(_0x4092ba){logger[_0x2caf('0x10')](_0x2caf('0x18'),_0x4092ba[_0x2caf('0x12')],_0x4a33fc);_0xe72440(_0x3e975f[_0x2caf('0x10')](0x1f4,_0x4092ba['message']));});});};exports[_0x2caf('0x1b')]=function(_0x14bfd2){var _0x1f29b0=this;return new Promise(function(_0x401ea2,_0x3efa4e){return db[_0x2caf('0x14')][_0x2caf('0x1c')](_0x14bfd2[_0x2caf('0x15')],{'raw':_0x14bfd2[_0x2caf('0x16')]?_0x14bfd2[_0x2caf('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14bfd2[_0x2caf('0x16')]?_0x14bfd2[_0x2caf('0x16')][_0x2caf('0x1d')]||null:null,'attributes':_0x14bfd2[_0x2caf('0x16')]?_0x14bfd2[_0x2caf('0x16')][_0x2caf('0x1e')]||null:null,'limit':_0x14bfd2[_0x2caf('0x16')]?_0x14bfd2[_0x2caf('0x16')][_0x2caf('0x1f')]||null:null})[_0x2caf('0xa')](function(_0x30da75){logger[_0x2caf('0xb')](_0x2caf('0x1b'),_0x14bfd2);logger['debug'](_0x2caf('0x1b'),_0x14bfd2,JSON[_0x2caf('0x19')](_0x30da75));_0x401ea2(_0x30da75);})[_0x2caf('0x1a')](function(_0x25bbfc){logger[_0x2caf('0x10')](_0x2caf('0x1b'),_0x25bbfc[_0x2caf('0x12')],_0x14bfd2);_0x3efa4e(_0x1f29b0['error'](0x1f4,_0x25bbfc[_0x2caf('0x12')]));});});}; \ No newline at end of file +var _0x8cda=['catch','create','body','options','raw','then','CreateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes','limit','UpdateOpenchannelQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent'];(function(_0x150322,_0x2199fb){var _0x606a08=function(_0x22cace){while(--_0x22cace){_0x150322['push'](_0x150322['shift']());}};_0x606a08(++_0x2199fb);}(_0x8cda,0x1db));var _0xa8cd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8cda[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xa8cd('0x0'));var moment=require(_0xa8cd('0x1'));var BPromise=require(_0xa8cd('0x2'));var rs=require(_0xa8cd('0x3'));var fs=require('fs');var Redis=require(_0xa8cd('0x4'));var db=require(_0xa8cd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa8cd('0x6'))(_0xa8cd('0x7'));var config=require(_0xa8cd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa8cd('0x9')][_0xa8cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1362c3,_0x273d2f,_0x2b9b51){return new BPromise(function(_0x2481ba,_0x13f394){return client[_0xa8cd('0xb')](_0x1362c3,_0x2b9b51)['then'](function(_0x50b8ee){logger['info'](_0xa8cd('0xc'),_0x273d2f,'request\x20sent');logger[_0xa8cd('0xd')](_0xa8cd('0xe'),_0x273d2f,'request\x20sent',JSON[_0xa8cd('0xf')](_0x50b8ee));if(_0x50b8ee[_0xa8cd('0x10')]){if(_0x50b8ee['error']['code']===0x1f4){logger[_0xa8cd('0x10')](_0xa8cd('0xc'),_0x273d2f,_0x50b8ee[_0xa8cd('0x10')][_0xa8cd('0x11')]);return _0x13f394(_0x50b8ee[_0xa8cd('0x10')]['message']);}logger[_0xa8cd('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x273d2f,_0x50b8ee[_0xa8cd('0x10')]['message']);return _0x2481ba(_0x50b8ee[_0xa8cd('0x10')]['message']);}else{logger[_0xa8cd('0x12')](_0xa8cd('0xc'),_0x273d2f,_0xa8cd('0x13'));_0x2481ba(_0x50b8ee['result']['message']);}})[_0xa8cd('0x14')](function(_0x6d5f40){logger[_0xa8cd('0x10')](_0xa8cd('0xc'),_0x273d2f,_0x6d5f40);_0x13f394(_0x6d5f40);});});}exports['CreateOpenchannelQueueReport']=function(_0x128a90){var _0x52252b=this;return new Promise(function(_0x1cacd5,_0x2ef224){return db['OpenchannelQueueReport'][_0xa8cd('0x15')](_0x128a90[_0xa8cd('0x16')],{'raw':_0x128a90['options']?_0x128a90[_0xa8cd('0x17')][_0xa8cd('0x18')]===undefined?!![]:![]:!![]})[_0xa8cd('0x19')](function(_0x289cb6){logger[_0xa8cd('0x12')]('CreateOpenchannelQueueReport',_0x128a90);logger[_0xa8cd('0xd')](_0xa8cd('0x1a'),_0x128a90,JSON[_0xa8cd('0xf')](_0x289cb6));_0x1cacd5(_0x289cb6);})[_0xa8cd('0x14')](function(_0x4f4093){logger[_0xa8cd('0x10')]('CreateOpenchannelQueueReport',_0x4f4093['message'],_0x128a90);_0x2ef224(_0x52252b[_0xa8cd('0x10')](0x1f4,_0x4f4093[_0xa8cd('0x11')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x1c7b31){var _0x26d35a=this;return new Promise(function(_0xfd170,_0x43462d){return db[_0xa8cd('0x1b')][_0xa8cd('0x1c')](_0x1c7b31[_0xa8cd('0x16')],{'raw':_0x1c7b31['options']?_0x1c7b31[_0xa8cd('0x17')][_0xa8cd('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c7b31[_0xa8cd('0x17')]?_0x1c7b31[_0xa8cd('0x17')][_0xa8cd('0x1d')]||null:null,'attributes':_0x1c7b31[_0xa8cd('0x17')]?_0x1c7b31['options'][_0xa8cd('0x1e')]||null:null,'limit':_0x1c7b31[_0xa8cd('0x17')]?_0x1c7b31[_0xa8cd('0x17')][_0xa8cd('0x1f')]||null:null})[_0xa8cd('0x19')](function(_0x2241f8){logger[_0xa8cd('0x12')](_0xa8cd('0x20'),_0x1c7b31);logger[_0xa8cd('0xd')](_0xa8cd('0x20'),_0x1c7b31,JSON[_0xa8cd('0xf')](_0x2241f8));_0xfd170(_0x2241f8);})[_0xa8cd('0x14')](function(_0x471052){logger[_0xa8cd('0x10')](_0xa8cd('0x20'),_0x471052[_0xa8cd('0x11')],_0x1c7b31);_0x43462d(_0x26d35a['error'](0x1f4,_0x471052['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index dc90b0e..1481389 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(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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(_0x3b3210,_0x25e8ed){var _0x5b5484=function(_0x417858){while(--_0x417858){_0x3b3210['push'](_0x3b3210['shift']());}};_0x5b5484(++_0x25e8ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 7e0145f..9f17fbb 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 _0x324c=['NOW','moment','sequelize','exports','STRING','ENUM','account','agent','queue'];(function(_0x2189d1,_0x4e67a0){var _0xc909eb=function(_0xf7894b){while(--_0xf7894b){_0x2189d1['push'](_0x2189d1['shift']());}};_0xc909eb(++_0x4e67a0);}(_0x324c,0xd9));var _0xc324=function(_0x1ea040,_0x21ca6e){_0x1ea040=_0x1ea040-0x0;var _0x5c5737=_0x324c[_0x1ea040];return _0x5c5737;};'use strict';var moment=require(_0xc324('0x0'));var Sequelize=require(_0xc324('0x1'));module[_0xc324('0x2')]={'uniqueid':{'type':Sequelize[_0xc324('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc324('0x4')](_0xc324('0x5'),_0xc324('0x6'),_0xc324('0x7')),'allowNull':![],'defaultValue':_0xc324('0x7')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xc324('0x8')]}}; \ No newline at end of file +var _0x39e4=['moment','sequelize','STRING','ENUM','account','agent','queue','DATE','NOW'];(function(_0x62a31b,_0x4c7701){var _0x53f5bb=function(_0x379edc){while(--_0x379edc){_0x62a31b['push'](_0x62a31b['shift']());}};_0x53f5bb(++_0x4c7701);}(_0x39e4,0x168));var _0x439e=function(_0x14e51e,_0xed289b){_0x14e51e=_0x14e51e-0x0;var _0xf93e94=_0x39e4[_0x14e51e];return _0xf93e94;};'use strict';var moment=require(_0x439e('0x0'));var Sequelize=require(_0x439e('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x439e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x439e('0x3')](_0x439e('0x4'),_0x439e('0x5'),'queue'),'allowNull':![],'defaultValue':_0x439e('0x6')},'transferredAt':{'type':Sequelize[_0x439e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x439e('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 9039a05..0d91a28 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 _0xf8a6=['params','options','create','body','find','destroy','describe','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','stack','name','send','map','OpenchannelTransferReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','count','includeAll','include','findAll','catch'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xf8a6,0x113));var _0x6f8a=function(_0xbffba9,_0x2556df){_0xbffba9=_0xbffba9-0x0;var _0xd8c2c7=_0xf8a6[_0xbffba9];return _0xd8c2c7;};'use strict';var pdf=require(_0x6f8a('0x0'));var emlformat=require(_0x6f8a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6f8a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6f8a('0x3'));var moment=require(_0x6f8a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6f8a('0x5'));var util=require(_0x6f8a('0x6'));var path=require(_0x6f8a('0x7'));var sox=require('sox');var csv=require(_0x6f8a('0x8'));var ejs=require(_0x6f8a('0x9'));var fs=require('fs');var _=require(_0x6f8a('0xa'));var squel=require(_0x6f8a('0xb'));var crypto=require('crypto');var jsforce=require(_0x6f8a('0xc'));var deskjs=require(_0x6f8a('0xd'));var toCsv=require(_0x6f8a('0x8'));var querystring=require(_0x6f8a('0xe'));var Papa=require('papaparse');var Redis=require(_0x6f8a('0xf'));var authService=require(_0x6f8a('0x10'));var qs=require(_0x6f8a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f8a('0x12'));var logger=require('../../config/logger')(_0x6f8a('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6f8a('0x14'))['db'];function respondWithStatusCode(_0x26a036,_0x277ac6){_0x277ac6=_0x277ac6||0xcc;return function(_0xcb731d){if(_0xcb731d){return _0x26a036[_0x6f8a('0x15')](_0x277ac6);}return _0x26a036[_0x6f8a('0x16')](_0x277ac6)[_0x6f8a('0x17')]();};}function respondWithResult(_0x34e6d9,_0x297af7){_0x297af7=_0x297af7||0xc8;return function(_0xd70a97){if(_0xd70a97){return _0x34e6d9[_0x6f8a('0x16')](_0x297af7)[_0x6f8a('0x18')](_0xd70a97);}};}function respondWithFilteredResult(_0x19a420,_0x1e5194){return function(_0x2deffe){if(_0x2deffe){var _0x186fbb=_0x2deffe['count'],_0x3750cf=_0x1e5194[_0x6f8a('0x19')],_0x3a4396=_0x1e5194[_0x6f8a('0x19')]+_0x1e5194[_0x6f8a('0x1a')],_0x1c0617;if(_0x3a4396>=_0x186fbb){_0x3a4396=_0x186fbb;_0x1c0617=0xc8;}else{_0x1c0617=0xce;}_0x19a420[_0x6f8a('0x16')](_0x1c0617);return _0x19a420[_0x6f8a('0x1b')](_0x6f8a('0x1c'),_0x3750cf+'-'+_0x3a4396+'/'+_0x186fbb)[_0x6f8a('0x18')](_0x2deffe);}return null;};}function patchUpdates(_0xc52a4e){return function(_0x2e5296){try{jsonpatch[_0x6f8a('0x1d')](_0x2e5296,_0xc52a4e,!![]);}catch(_0x182aaa){return BPromise[_0x6f8a('0x1e')](_0x182aaa);}return _0x2e5296['save']();};}function saveUpdates(_0x2fbd29,_0x235286){return function(_0xa3be7){if(_0xa3be7){return _0xa3be7[_0x6f8a('0x1f')](_0x2fbd29)[_0x6f8a('0x20')](function(_0x1fbf27){return _0x1fbf27;});}return null;};}function removeEntity(_0x3eb54b,_0x2a764e){return function(_0x153b36){if(_0x153b36){return _0x153b36['destroy']()[_0x6f8a('0x20')](function(){_0x3eb54b[_0x6f8a('0x16')](0xcc)[_0x6f8a('0x17')]();});}};}function handleEntityNotFound(_0x15ef26,_0x3048b9){return function(_0x2368b7){if(!_0x2368b7){_0x15ef26[_0x6f8a('0x15')](0x194);}return _0x2368b7;};}function handleError(_0x3a3599,_0x58f248){_0x58f248=_0x58f248||0x1f4;return function(_0x48eafd){logger['error'](_0x48eafd[_0x6f8a('0x21')]);if(_0x48eafd['name']){delete _0x48eafd[_0x6f8a('0x22')];}_0x3a3599['status'](_0x58f248)[_0x6f8a('0x23')](_0x48eafd);};}exports['index']=function(_0x4c4e4e,_0x58ffb4){var _0x2249dd={},_0x204755={},_0x2adcf7={'count':0x0,'rows':[]};var _0x5e271c=_[_0x6f8a('0x24')](db[_0x6f8a('0x25')][_0x6f8a('0x26')],function(_0x2f8416){return{'name':_0x2f8416['fieldName'],'type':_0x2f8416[_0x6f8a('0x27')][_0x6f8a('0x28')]};});_0x204755[_0x6f8a('0x29')]=_[_0x6f8a('0x24')](_0x5e271c,_0x6f8a('0x22'));_0x204755[_0x6f8a('0x2a')]=_[_0x6f8a('0x2b')](_0x4c4e4e['query']);_0x204755['filters']=_[_0x6f8a('0x2c')](_0x204755[_0x6f8a('0x29')],_0x204755[_0x6f8a('0x2a')]);_0x2249dd[_0x6f8a('0x2d')]=_[_0x6f8a('0x2c')](_0x204755[_0x6f8a('0x29')],qs['fields'](_0x4c4e4e[_0x6f8a('0x2a')][_0x6f8a('0x2e')]));_0x2249dd['attributes']=_0x2249dd[_0x6f8a('0x2d')][_0x6f8a('0x2f')]?_0x2249dd[_0x6f8a('0x2d')]:_0x204755[_0x6f8a('0x29')];if(!_0x4c4e4e[_0x6f8a('0x2a')]['hasOwnProperty']('nolimit')){_0x2249dd[_0x6f8a('0x1a')]=qs[_0x6f8a('0x1a')](_0x4c4e4e['query']['limit']);_0x2249dd[_0x6f8a('0x19')]=qs['offset'](_0x4c4e4e['query']['offset']);}_0x2249dd[_0x6f8a('0x30')]=qs['sort'](_0x4c4e4e['query'][_0x6f8a('0x31')]);_0x2249dd[_0x6f8a('0x32')]=qs[_0x6f8a('0x33')](_[_0x6f8a('0x34')](_0x4c4e4e[_0x6f8a('0x2a')],_0x204755[_0x6f8a('0x33')]));if(_0x4c4e4e['query'][_0x6f8a('0x35')]){_0x2249dd[_0x6f8a('0x32')]=_['merge'](_0x2249dd[_0x6f8a('0x32')],{'$or':_[_0x6f8a('0x24')](_0x5e271c,function(_0x558c9b){if(_0x558c9b[_0x6f8a('0x27')]!=='VIRTUAL'){var _0xa71f66={};_0xa71f66[_0x558c9b[_0x6f8a('0x22')]]={'$like':'%'+_0x4c4e4e[_0x6f8a('0x2a')][_0x6f8a('0x35')]+'%'};return _0xa71f66;}})});}_0x2249dd=_[_0x6f8a('0x36')]({},_0x2249dd,_0x4c4e4e['options']);var _0x51cd48={'where':_0x2249dd['where']};return db[_0x6f8a('0x25')]['count'](_0x51cd48)[_0x6f8a('0x20')](function(_0xeea817){_0x2adcf7[_0x6f8a('0x37')]=_0xeea817;if(_0x4c4e4e[_0x6f8a('0x2a')][_0x6f8a('0x38')]){_0x2249dd[_0x6f8a('0x39')]=[{'all':!![]}];}return db[_0x6f8a('0x25')][_0x6f8a('0x3a')](_0x2249dd);})[_0x6f8a('0x20')](function(_0x46d0fd){_0x2adcf7['rows']=_0x46d0fd;return _0x2adcf7;})['then'](respondWithFilteredResult(_0x58ffb4,_0x2249dd))[_0x6f8a('0x3b')](handleError(_0x58ffb4,null));};exports['show']=function(_0x50d5d6,_0x1b1b91){var _0x36d117={'raw':!![],'where':{'id':_0x50d5d6[_0x6f8a('0x3c')]['id']}},_0x5016be={};_0x5016be['model']=_['keys'](db[_0x6f8a('0x25')][_0x6f8a('0x26')]);_0x5016be[_0x6f8a('0x2a')]=_[_0x6f8a('0x2b')](_0x50d5d6[_0x6f8a('0x2a')]);_0x5016be['filters']=_[_0x6f8a('0x2c')](_0x5016be[_0x6f8a('0x29')],_0x5016be[_0x6f8a('0x2a')]);_0x36d117['attributes']=_[_0x6f8a('0x2c')](_0x5016be[_0x6f8a('0x29')],qs[_0x6f8a('0x2e')](_0x50d5d6[_0x6f8a('0x2a')][_0x6f8a('0x2e')]));_0x36d117[_0x6f8a('0x2d')]=_0x36d117['attributes'][_0x6f8a('0x2f')]?_0x36d117[_0x6f8a('0x2d')]:_0x5016be[_0x6f8a('0x29')];if(_0x50d5d6[_0x6f8a('0x2a')][_0x6f8a('0x38')]){_0x36d117[_0x6f8a('0x39')]=[{'all':!![]}];}_0x36d117=_['merge']({},_0x36d117,_0x50d5d6[_0x6f8a('0x3d')]);return db[_0x6f8a('0x25')]['find'](_0x36d117)[_0x6f8a('0x20')](handleEntityNotFound(_0x1b1b91,null))[_0x6f8a('0x20')](respondWithResult(_0x1b1b91,null))[_0x6f8a('0x3b')](handleError(_0x1b1b91,null));};exports[_0x6f8a('0x3e')]=function(_0x12698f,_0x4e9da0){return db[_0x6f8a('0x25')][_0x6f8a('0x3e')](_0x12698f[_0x6f8a('0x3f')],{})[_0x6f8a('0x20')](respondWithResult(_0x4e9da0,0xc9))['catch'](handleError(_0x4e9da0,null));};exports[_0x6f8a('0x1f')]=function(_0x62423a,_0x2004a5){if(_0x62423a['body']['id']){delete _0x62423a['body']['id'];}return db[_0x6f8a('0x25')][_0x6f8a('0x40')]({'where':{'id':_0x62423a[_0x6f8a('0x3c')]['id']}})[_0x6f8a('0x20')](handleEntityNotFound(_0x2004a5,null))[_0x6f8a('0x20')](saveUpdates(_0x62423a[_0x6f8a('0x3f')],null))[_0x6f8a('0x20')](respondWithResult(_0x2004a5,null))['catch'](handleError(_0x2004a5,null));};exports[_0x6f8a('0x41')]=function(_0x2ab24d,_0x19a8bc){return db[_0x6f8a('0x25')]['find']({'where':{'id':_0x2ab24d[_0x6f8a('0x3c')]['id']}})[_0x6f8a('0x20')](handleEntityNotFound(_0x19a8bc,null))['then'](removeEntity(_0x19a8bc,null))[_0x6f8a('0x3b')](handleError(_0x19a8bc,null));};exports[_0x6f8a('0x42')]=function(_0x35b25c,_0x3f29a3){return db[_0x6f8a('0x25')][_0x6f8a('0x42')]()[_0x6f8a('0x20')](respondWithResult(_0x3f29a3,null))[_0x6f8a('0x3b')](handleError(_0x3f29a3,null));}; \ No newline at end of file +var _0x9664=['catch','show','params','keys','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','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/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelTransferReport','includeAll','include','findAll'];(function(_0x39fd7e,_0x17607d){var _0x1d5746=function(_0x11791a){while(--_0x11791a){_0x39fd7e['push'](_0x39fd7e['shift']());}};_0x1d5746(++_0x17607d);}(_0x9664,0xa4));var _0x4966=function(_0x551805,_0x5e0874){_0x551805=_0x551805-0x0;var _0x1a99e5=_0x9664[_0x551805];return _0x1a99e5;};'use strict';var pdf=require(_0x4966('0x0'));var emlformat=require(_0x4966('0x1'));var rimraf=require(_0x4966('0x2'));var zipdir=require(_0x4966('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4966('0x4'));var BPromise=require(_0x4966('0x5'));var Mustache=require(_0x4966('0x6'));var util=require(_0x4966('0x7'));var path=require(_0x4966('0x8'));var sox=require(_0x4966('0x9'));var csv=require(_0x4966('0xa'));var ejs=require(_0x4966('0xb'));var fs=require('fs');var _=require(_0x4966('0xc'));var squel=require('squel');var crypto=require(_0x4966('0xd'));var jsforce=require(_0x4966('0xe'));var deskjs=require(_0x4966('0xf'));var toCsv=require(_0x4966('0xa'));var querystring=require(_0x4966('0x10'));var Papa=require(_0x4966('0x11'));var Redis=require('ioredis');var authService=require(_0x4966('0x12'));var qs=require(_0x4966('0x13'));var as=require(_0x4966('0x14'));var hardwareService=require(_0x4966('0x15'));var logger=require(_0x4966('0x16'))(_0x4966('0x17'));var utils=require('../../config/utils');var config=require(_0x4966('0x18'));var db=require(_0x4966('0x19'))['db'];function respondWithStatusCode(_0x295a5d,_0x116d2e){_0x116d2e=_0x116d2e||0xcc;return function(_0x4465b7){if(_0x4465b7){return _0x295a5d['sendStatus'](_0x116d2e);}return _0x295a5d[_0x4966('0x1a')](_0x116d2e)[_0x4966('0x1b')]();};}function respondWithResult(_0x507dcd,_0x3e1256){_0x3e1256=_0x3e1256||0xc8;return function(_0x511fec){if(_0x511fec){return _0x507dcd[_0x4966('0x1a')](_0x3e1256)[_0x4966('0x1c')](_0x511fec);}};}function respondWithFilteredResult(_0x86927,_0x2d1d25){return function(_0x816d27){if(_0x816d27){var _0x3b61a4=_0x816d27[_0x4966('0x1d')],_0x6c6975=_0x2d1d25[_0x4966('0x1e')],_0x45c36d=_0x2d1d25[_0x4966('0x1e')]+_0x2d1d25[_0x4966('0x1f')],_0x4c8705;if(_0x45c36d>=_0x3b61a4){_0x45c36d=_0x3b61a4;_0x4c8705=0xc8;}else{_0x4c8705=0xce;}_0x86927[_0x4966('0x1a')](_0x4c8705);return _0x86927[_0x4966('0x20')](_0x4966('0x21'),_0x6c6975+'-'+_0x45c36d+'/'+_0x3b61a4)[_0x4966('0x1c')](_0x816d27);}return null;};}function patchUpdates(_0x3d953e){return function(_0x326481){try{jsonpatch[_0x4966('0x22')](_0x326481,_0x3d953e,!![]);}catch(_0x190378){return BPromise[_0x4966('0x23')](_0x190378);}return _0x326481[_0x4966('0x24')]();};}function saveUpdates(_0x120722,_0x58d21a){return function(_0x2bdb84){if(_0x2bdb84){return _0x2bdb84[_0x4966('0x25')](_0x120722)[_0x4966('0x26')](function(_0x5d3911){return _0x5d3911;});}return null;};}function removeEntity(_0x35e5fe,_0x2f64c7){return function(_0x2f9439){if(_0x2f9439){return _0x2f9439[_0x4966('0x27')]()[_0x4966('0x26')](function(){_0x35e5fe[_0x4966('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cb906,_0x210bef){return function(_0x3ce0cc){if(!_0x3ce0cc){_0x4cb906[_0x4966('0x28')](0x194);}return _0x3ce0cc;};}function handleError(_0x4fe6ee,_0x13927a){_0x13927a=_0x13927a||0x1f4;return function(_0x354229){logger[_0x4966('0x29')](_0x354229[_0x4966('0x2a')]);if(_0x354229[_0x4966('0x2b')]){delete _0x354229[_0x4966('0x2b')];}_0x4fe6ee['status'](_0x13927a)[_0x4966('0x2c')](_0x354229);};}exports[_0x4966('0x2d')]=function(_0x1aa7af,_0x23d15e){var _0x4d0c48={},_0x234a3b={},_0x3d04e6={'count':0x0,'rows':[]};var _0x233166=_[_0x4966('0x2e')](db['OpenchannelTransferReport'][_0x4966('0x2f')],function(_0x58dcee){return{'name':_0x58dcee[_0x4966('0x30')],'type':_0x58dcee['type'][_0x4966('0x31')]};});_0x234a3b['model']=_[_0x4966('0x2e')](_0x233166,'name');_0x234a3b[_0x4966('0x32')]=_['keys'](_0x1aa7af[_0x4966('0x32')]);_0x234a3b[_0x4966('0x33')]=_[_0x4966('0x34')](_0x234a3b['model'],_0x234a3b['query']);_0x4d0c48[_0x4966('0x35')]=_[_0x4966('0x34')](_0x234a3b[_0x4966('0x36')],qs[_0x4966('0x37')](_0x1aa7af[_0x4966('0x32')][_0x4966('0x37')]));_0x4d0c48[_0x4966('0x35')]=_0x4d0c48['attributes'][_0x4966('0x38')]?_0x4d0c48[_0x4966('0x35')]:_0x234a3b['model'];if(!_0x1aa7af[_0x4966('0x32')][_0x4966('0x39')]('nolimit')){_0x4d0c48[_0x4966('0x1f')]=qs['limit'](_0x1aa7af['query'][_0x4966('0x1f')]);_0x4d0c48[_0x4966('0x1e')]=qs[_0x4966('0x1e')](_0x1aa7af[_0x4966('0x32')]['offset']);}_0x4d0c48[_0x4966('0x3a')]=qs[_0x4966('0x3b')](_0x1aa7af[_0x4966('0x32')][_0x4966('0x3b')]);_0x4d0c48[_0x4966('0x3c')]=qs[_0x4966('0x33')](_[_0x4966('0x3d')](_0x1aa7af[_0x4966('0x32')],_0x234a3b[_0x4966('0x33')]));if(_0x1aa7af['query'][_0x4966('0x3e')]){_0x4d0c48[_0x4966('0x3c')]=_[_0x4966('0x3f')](_0x4d0c48[_0x4966('0x3c')],{'$or':_['map'](_0x233166,function(_0x30cd1e){if(_0x30cd1e['type']!==_0x4966('0x40')){var _0x2cc424={};_0x2cc424[_0x30cd1e[_0x4966('0x2b')]]={'$like':'%'+_0x1aa7af['query']['filter']+'%'};return _0x2cc424;}})});}_0x4d0c48=_[_0x4966('0x3f')]({},_0x4d0c48,_0x1aa7af[_0x4966('0x41')]);var _0x136431={'where':_0x4d0c48[_0x4966('0x3c')]};return db[_0x4966('0x42')][_0x4966('0x1d')](_0x136431)[_0x4966('0x26')](function(_0x34c02b){_0x3d04e6[_0x4966('0x1d')]=_0x34c02b;if(_0x1aa7af['query'][_0x4966('0x43')]){_0x4d0c48[_0x4966('0x44')]=[{'all':!![]}];}return db[_0x4966('0x42')][_0x4966('0x45')](_0x4d0c48);})['then'](function(_0x1ca35b){_0x3d04e6['rows']=_0x1ca35b;return _0x3d04e6;})[_0x4966('0x26')](respondWithFilteredResult(_0x23d15e,_0x4d0c48))[_0x4966('0x46')](handleError(_0x23d15e,null));};exports[_0x4966('0x47')]=function(_0x45a90f,_0x86ec66){var _0x28144d={'raw':!![],'where':{'id':_0x45a90f[_0x4966('0x48')]['id']}},_0x3cd5b0={};_0x3cd5b0[_0x4966('0x36')]=_[_0x4966('0x49')](db[_0x4966('0x42')][_0x4966('0x2f')]);_0x3cd5b0['query']=_[_0x4966('0x49')](_0x45a90f[_0x4966('0x32')]);_0x3cd5b0['filters']=_[_0x4966('0x34')](_0x3cd5b0[_0x4966('0x36')],_0x3cd5b0[_0x4966('0x32')]);_0x28144d[_0x4966('0x35')]=_[_0x4966('0x34')](_0x3cd5b0[_0x4966('0x36')],qs[_0x4966('0x37')](_0x45a90f[_0x4966('0x32')][_0x4966('0x37')]));_0x28144d[_0x4966('0x35')]=_0x28144d['attributes'][_0x4966('0x38')]?_0x28144d[_0x4966('0x35')]:_0x3cd5b0[_0x4966('0x36')];if(_0x45a90f['query'][_0x4966('0x43')]){_0x28144d[_0x4966('0x44')]=[{'all':!![]}];}_0x28144d=_[_0x4966('0x3f')]({},_0x28144d,_0x45a90f[_0x4966('0x41')]);return db['OpenchannelTransferReport'][_0x4966('0x4a')](_0x28144d)[_0x4966('0x26')](handleEntityNotFound(_0x86ec66,null))['then'](respondWithResult(_0x86ec66,null))[_0x4966('0x46')](handleError(_0x86ec66,null));};exports['create']=function(_0x3bcc1e,_0xf44c97){return db[_0x4966('0x42')][_0x4966('0x4b')](_0x3bcc1e['body'],{})['then'](respondWithResult(_0xf44c97,0xc9))[_0x4966('0x46')](handleError(_0xf44c97,null));};exports['update']=function(_0x180a74,_0x14ed42){if(_0x180a74['body']['id']){delete _0x180a74[_0x4966('0x4c')]['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x180a74[_0x4966('0x48')]['id']}})[_0x4966('0x26')](handleEntityNotFound(_0x14ed42,null))[_0x4966('0x26')](saveUpdates(_0x180a74[_0x4966('0x4c')],null))['then'](respondWithResult(_0x14ed42,null))[_0x4966('0x46')](handleError(_0x14ed42,null));};exports[_0x4966('0x27')]=function(_0x50a5af,_0x22ace0){return db['OpenchannelTransferReport'][_0x4966('0x4a')]({'where':{'id':_0x50a5af['params']['id']}})[_0x4966('0x26')](handleEntityNotFound(_0x22ace0,null))[_0x4966('0x26')](removeEntity(_0x22ace0,null))['catch'](handleError(_0x22ace0,null));};exports[_0x4966('0x4d')]=function(_0x2f0932,_0x550b90){return db[_0x4966('0x42')]['describe']()[_0x4966('0x26')](respondWithResult(_0x550b90,null))[_0x4966('0x46')](handleError(_0x550b90,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index a830513..2d8135e 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 _0x3055=['api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','define','uniqueid','lodash','util','../../config/logger'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x3055,0xd5));var _0x5305=function(_0x28be25,_0x174e44){_0x28be25=_0x28be25-0x0;var _0x1ce45a=_0x3055[_0x28be25];return _0x1ce45a;};'use strict';var _=require(_0x5305('0x0'));var util=require(_0x5305('0x1'));var logger=require(_0x5305('0x2'))(_0x5305('0x3'));var moment=require('moment');var BPromise=require(_0x5305('0x4'));var rp=require(_0x5305('0x5'));var fs=require('fs');var path=require(_0x5305('0x6'));var rimraf=require(_0x5305('0x7'));var config=require(_0x5305('0x8'));var attributes=require(_0x5305('0x9'));module['exports']=function(_0x3a8784,_0x27450e){return _0x3a8784[_0x5305('0xa')]('OpenchannelTransferReport',attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x5305('0xb'),'fields':[_0x5305('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x918f=['path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','util','api','moment','request-promise'];(function(_0x224aff,_0x54cc57){var _0x19bd05=function(_0x2337fe){while(--_0x2337fe){_0x224aff['push'](_0x224aff['shift']());}};_0x19bd05(++_0x54cc57);}(_0x918f,0x128));var _0xf918=function(_0x1c7b4c,_0x5b85b2){_0x1c7b4c=_0x1c7b4c-0x0;var _0x18daf6=_0x918f[_0x1c7b4c];return _0x18daf6;};'use strict';var _=require('lodash');var util=require(_0xf918('0x0'));var logger=require('../../config/logger')(_0xf918('0x1'));var moment=require(_0xf918('0x2'));var BPromise=require('bluebird');var rp=require(_0xf918('0x3'));var fs=require('fs');var path=require(_0xf918('0x4'));var rimraf=require(_0xf918('0x5'));var config=require(_0xf918('0x6'));var attributes=require(_0xf918('0x7'));module[_0xf918('0x8')]=function(_0x719f32,_0x1e052d){return _0x719f32[_0xf918('0x9')](_0xf918('0xa'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf918('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 c37245a..9ede1dc 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 _0xb209=['../../config/logger','../../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','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x9d53fb,_0x4b898b){var _0x12f955=function(_0x5b03f9){while(--_0x5b03f9){_0x9d53fb['push'](_0x9d53fb['shift']());}};_0x12f955(++_0x4b898b);}(_0xb209,0x6d));var _0x9b20=function(_0x270371,_0x333fc8){_0x270371=_0x270371-0x0;var _0x3aa4bb=_0xb209[_0x270371];return _0x3aa4bb;};'use strict';var _=require(_0x9b20('0x0'));var util=require(_0x9b20('0x1'));var moment=require(_0x9b20('0x2'));var BPromise=require(_0x9b20('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b20('0x4'));var db=require(_0x9b20('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b20('0x6'))('rpc');var config=require(_0x9b20('0x7'));var jayson=require(_0x9b20('0x8'));var client=jayson[_0x9b20('0x9')][_0x9b20('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a5039,_0xf80424,_0x46f19b){return new BPromise(function(_0xd8aba3,_0x1a7678){return client[_0x9b20('0xb')](_0x2a5039,_0x46f19b)[_0x9b20('0xc')](function(_0x485e01){logger[_0x9b20('0xd')](_0x9b20('0xe'),_0xf80424,_0x9b20('0xf'));logger[_0x9b20('0x10')](_0x9b20('0x11'),_0xf80424,_0x9b20('0xf'),JSON[_0x9b20('0x12')](_0x485e01));if(_0x485e01[_0x9b20('0x13')]){if(_0x485e01[_0x9b20('0x13')][_0x9b20('0x14')]===0x1f4){logger['error'](_0x9b20('0xe'),_0xf80424,_0x485e01[_0x9b20('0x13')][_0x9b20('0x15')]);return _0x1a7678(_0x485e01[_0x9b20('0x13')][_0x9b20('0x15')]);}logger['error'](_0x9b20('0xe'),_0xf80424,_0x485e01[_0x9b20('0x13')][_0x9b20('0x15')]);return _0xd8aba3(_0x485e01[_0x9b20('0x13')][_0x9b20('0x15')]);}else{logger[_0x9b20('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0xf80424,_0x9b20('0xf'));_0xd8aba3(_0x485e01['result'][_0x9b20('0x15')]);}})[_0x9b20('0x16')](function(_0x45403f){logger[_0x9b20('0x13')](_0x9b20('0xe'),_0xf80424,_0x45403f);_0x1a7678(_0x45403f);});});} \ No newline at end of file +var _0xb51e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x3a48be,_0x58f6dd){var _0x483eb4=function(_0x18e2c7){while(--_0x18e2c7){_0x3a48be['push'](_0x3a48be['shift']());}};_0x483eb4(++_0x58f6dd);}(_0xb51e,0x12f));var _0xeb51=function(_0x3a198b,_0x7a324c){_0x3a198b=_0x3a198b-0x0;var _0x106852=_0xb51e[_0x3a198b];return _0x106852;};'use strict';var _=require(_0xeb51('0x0'));var util=require(_0xeb51('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xeb51('0x2'));var fs=require('fs');var Redis=require(_0xeb51('0x3'));var db=require(_0xeb51('0x4'))['db'];var utils=require(_0xeb51('0x5'));var logger=require(_0xeb51('0x6'))(_0xeb51('0x7'));var config=require(_0xeb51('0x8'));var jayson=require(_0xeb51('0x9'));var client=jayson[_0xeb51('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x331936,_0x4e20c2,_0x3a6fac){return new BPromise(function(_0x440112,_0x1470f2){return client[_0xeb51('0xb')](_0x331936,_0x3a6fac)[_0xeb51('0xc')](function(_0x56f454){logger[_0xeb51('0xd')](_0xeb51('0xe'),_0x4e20c2,_0xeb51('0xf'));logger['debug'](_0xeb51('0x10'),_0x4e20c2,_0xeb51('0xf'),JSON[_0xeb51('0x11')](_0x56f454));if(_0x56f454[_0xeb51('0x12')]){if(_0x56f454[_0xeb51('0x12')]['code']===0x1f4){logger['error'](_0xeb51('0xe'),_0x4e20c2,_0x56f454[_0xeb51('0x12')][_0xeb51('0x13')]);return _0x1470f2(_0x56f454[_0xeb51('0x12')][_0xeb51('0x13')]);}logger[_0xeb51('0x12')](_0xeb51('0xe'),_0x4e20c2,_0x56f454[_0xeb51('0x12')][_0xeb51('0x13')]);return _0x440112(_0x56f454[_0xeb51('0x12')]['message']);}else{logger[_0xeb51('0xd')](_0xeb51('0xe'),_0x4e20c2,_0xeb51('0xf'));_0x440112(_0x56f454[_0xeb51('0x14')][_0xeb51('0x13')]);}})[_0xeb51('0x15')](function(_0xa19fea){logger[_0xeb51('0x12')](_0xeb51('0xe'),_0x4e20c2,_0xa19fea);_0x1470f2(_0xa19fea);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 66be73d..ece8fef 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 _0x3ba1=['create','put','update','delete','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3ba1,0xe1));var _0x13ba=function(_0x1a3fa7,_0x3d2038){_0x1a3fa7=_0x1a3fa7-0x0;var _0x1fb704=_0x3ba1[_0x1a3fa7];return _0x1fb704;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x13ba('0x0'));var timeout=require(_0x13ba('0x1'));var express=require(_0x13ba('0x2'));var router=express['Router']();var auth=require(_0x13ba('0x3'));var interaction=require(_0x13ba('0x4'));var config=require(_0x13ba('0x5'));var controller=require(_0x13ba('0x6'));router['get']('/',auth[_0x13ba('0x7')](),controller[_0x13ba('0x8')]);router[_0x13ba('0x9')](_0x13ba('0xa'),auth['isAuthenticated'](),controller[_0x13ba('0xb')]);router[_0x13ba('0xc')]('/',auth[_0x13ba('0x7')](),controller[_0x13ba('0xd')]);router[_0x13ba('0xe')]('/:id',auth[_0x13ba('0x7')](),controller[_0x13ba('0xf')]);router[_0x13ba('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1b57=['connect-timeout','../../components/auth/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path'];(function(_0x16ea87,_0x378d8b){var _0x6e7b1c=function(_0x26306e){while(--_0x26306e){_0x16ea87['push'](_0x16ea87['shift']());}};_0x6e7b1c(++_0x378d8b);}(_0x1b57,0x1bf));var _0x71b5=function(_0x44be3d,_0x584530){_0x44be3d=_0x44be3d-0x0;var _0x11247a=_0x1b57[_0x44be3d];return _0x11247a;};'use strict';var multer=require(_0x71b5('0x0'));var util=require(_0x71b5('0x1'));var path=require(_0x71b5('0x2'));var timeout=require(_0x71b5('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x71b5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x71b5('0x5'));var controller=require(_0x71b5('0x6'));router[_0x71b5('0x7')]('/',auth[_0x71b5('0x8')](),controller[_0x71b5('0x9')]);router['get'](_0x71b5('0xa'),auth[_0x71b5('0x8')](),controller[_0x71b5('0xb')]);router[_0x71b5('0xc')]('/',auth[_0x71b5('0x8')](),controller[_0x71b5('0xd')]);router[_0x71b5('0xe')](_0x71b5('0xa'),auth['isAuthenticated'](),controller[_0x71b5('0xf')]);router[_0x71b5('0x10')](_0x71b5('0xa'),auth['isAuthenticated'](),controller[_0x71b5('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index db86301..abd1e93 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 _0x77e8=['sequelize','name','STRING'];(function(_0x204ec9,_0x5b927b){var _0x3b567a=function(_0x4a7f35){while(--_0x4a7f35){_0x204ec9['push'](_0x204ec9['shift']());}};_0x3b567a(++_0x5b927b);}(_0x77e8,0x1b9));var _0x877e=function(_0x4a53e2,_0x13321e){_0x4a53e2=_0x4a53e2-0x0;var _0x3f2d76=_0x77e8[_0x4a53e2];return _0x3f2d76;};'use strict';var Sequelize=require(_0x877e('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x877e('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x877e('0x2')]}}; \ No newline at end of file +var _0x87b5=['name','sequelize','STRING'];(function(_0x3b6fb2,_0x44b79b){var _0x3c8e68=function(_0x13735a){while(--_0x13735a){_0x3b6fb2['push'](_0x3b6fb2['shift']());}};_0x3c8e68(++_0x44b79b);}(_0x87b5,0x1de));var _0x587b=function(_0x167872,_0x1c86dc){_0x167872=_0x167872-0x0;var _0x277b24=_0x87b5[_0x167872];return _0x277b24;};'use strict';var Sequelize=require(_0x587b('0x0'));module['exports']={'name':{'type':Sequelize[_0x587b('0x1')],'unique':_0x587b('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 4951f8e..ced5edd 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 _0xa24b=['../../config/logger','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','reject','destroy','get','Pauses','UserProfileResource','then','stack','name','send','index','Pause','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','update','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1cc961,_0x2c42ee){var _0x471d86=function(_0x44e422){while(--_0x44e422){_0x1cc961['push'](_0x1cc961['shift']());}};_0x471d86(++_0x2c42ee);}(_0xa24b,0x1cb));var _0xba24=function(_0x215e19,_0x3203e3){_0x215e19=_0x215e19-0x0;var _0xc16cab=_0xa24b[_0x215e19];return _0xc16cab;};'use strict';var pdf=require(_0xba24('0x0'));var emlformat=require(_0xba24('0x1'));var rimraf=require(_0xba24('0x2'));var zipdir=require(_0xba24('0x3'));var jsonpatch=require(_0xba24('0x4'));var rp=require(_0xba24('0x5'));var moment=require(_0xba24('0x6'));var BPromise=require(_0xba24('0x7'));var Mustache=require('mustache');var util=require(_0xba24('0x8'));var path=require(_0xba24('0x9'));var sox=require(_0xba24('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xba24('0xb'));var squel=require(_0xba24('0xc'));var crypto=require(_0xba24('0xd'));var jsforce=require(_0xba24('0xe'));var deskjs=require(_0xba24('0xf'));var toCsv=require(_0xba24('0x10'));var querystring=require('querystring');var Papa=require(_0xba24('0x11'));var Redis=require(_0xba24('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xba24('0x13'));var as=require(_0xba24('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xba24('0x15'))('api');var utils=require(_0xba24('0x16'));var config=require(_0xba24('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2859fd,_0x57bab7){_0x57bab7=_0x57bab7||0xcc;return function(_0x1f2f47){if(_0x1f2f47){return _0x2859fd['sendStatus'](_0x57bab7);}return _0x2859fd[_0xba24('0x18')](_0x57bab7)[_0xba24('0x19')]();};}function respondWithResult(_0x572559,_0x22f71c){_0x22f71c=_0x22f71c||0xc8;return function(_0x199794){if(_0x199794){return _0x572559[_0xba24('0x18')](_0x22f71c)[_0xba24('0x1a')](_0x199794);}};}function respondWithFilteredResult(_0x302d92,_0x27e321){return function(_0x1de0dd){if(_0x1de0dd){var _0x558a02=_0x1de0dd[_0xba24('0x1b')],_0xf2918a=_0x27e321[_0xba24('0x1c')],_0x2b8227=_0x27e321[_0xba24('0x1c')]+_0x27e321[_0xba24('0x1d')],_0x185330;if(_0x2b8227>=_0x558a02){_0x2b8227=_0x558a02;_0x185330=0xc8;}else{_0x185330=0xce;}_0x302d92[_0xba24('0x18')](_0x185330);return _0x302d92[_0xba24('0x1e')](_0xba24('0x1f'),_0xf2918a+'-'+_0x2b8227+'/'+_0x558a02)[_0xba24('0x1a')](_0x1de0dd);}return null;};}function patchUpdates(_0x522d97){return function(_0x36df66){try{jsonpatch[_0xba24('0x20')](_0x36df66,_0x522d97,!![]);}catch(_0x29ea64){return BPromise[_0xba24('0x21')](_0x29ea64);}return _0x36df66['save']();};}function saveUpdates(_0x3ddd04,_0x4693fb){return function(_0x495f54){if(_0x495f54){return _0x495f54['update'](_0x3ddd04)['then'](function(_0x3061f6){return _0x3061f6;});}return null;};}function removeEntity(_0x31cf16,_0x57f31f){return function(_0x298e98){if(_0x298e98){return _0x298e98[_0xba24('0x22')]()['then'](function(){var _0x450dfe=_0x298e98[_0xba24('0x23')]({'plain':!![]});var _0x500776=_0xba24('0x24');return db[_0xba24('0x25')]['destroy']({'where':{'type':_0x500776,'resourceId':_0x450dfe['id']}})[_0xba24('0x26')](function(){return _0x298e98;});})[_0xba24('0x26')](function(){_0x31cf16['status'](0xcc)[_0xba24('0x19')]();});}};}function handleEntityNotFound(_0x2dd168,_0x1a1b64){return function(_0x16903e){if(!_0x16903e){_0x2dd168['sendStatus'](0x194);}return _0x16903e;};}function handleError(_0x4bd1f9,_0x5c01bc){_0x5c01bc=_0x5c01bc||0x1f4;return function(_0x5ec44c){logger['error'](_0x5ec44c[_0xba24('0x27')]);if(_0x5ec44c[_0xba24('0x28')]){delete _0x5ec44c[_0xba24('0x28')];}_0x4bd1f9[_0xba24('0x18')](_0x5c01bc)[_0xba24('0x29')](_0x5ec44c);};}exports[_0xba24('0x2a')]=function(_0x491623,_0x1e1784){var _0x559ae4={},_0x503be6={},_0x37b394={'count':0x0,'rows':[]};var _0x361b90=_['map'](db[_0xba24('0x2b')]['rawAttributes'],function(_0x2c0379){return{'name':_0x2c0379['fieldName'],'type':_0x2c0379[_0xba24('0x2c')]['key']};});_0x503be6[_0xba24('0x2d')]=_[_0xba24('0x2e')](_0x361b90,_0xba24('0x28'));_0x503be6['query']=_[_0xba24('0x2f')](_0x491623[_0xba24('0x30')]);_0x503be6[_0xba24('0x31')]=_[_0xba24('0x32')](_0x503be6['model'],_0x503be6[_0xba24('0x30')]);_0x559ae4[_0xba24('0x33')]=_['intersection'](_0x503be6[_0xba24('0x2d')],qs['fields'](_0x491623[_0xba24('0x30')][_0xba24('0x34')]));_0x559ae4['attributes']=_0x559ae4[_0xba24('0x33')][_0xba24('0x35')]?_0x559ae4[_0xba24('0x33')]:_0x503be6[_0xba24('0x2d')];if(!_0x491623[_0xba24('0x30')][_0xba24('0x36')](_0xba24('0x37'))){_0x559ae4[_0xba24('0x1d')]=qs['limit'](_0x491623[_0xba24('0x30')][_0xba24('0x1d')]);_0x559ae4[_0xba24('0x1c')]=qs[_0xba24('0x1c')](_0x491623[_0xba24('0x30')][_0xba24('0x1c')]);}_0x559ae4[_0xba24('0x38')]=qs[_0xba24('0x39')](_0x491623[_0xba24('0x30')][_0xba24('0x39')]);_0x559ae4[_0xba24('0x3a')]=qs[_0xba24('0x31')](_[_0xba24('0x3b')](_0x491623['query'],_0x503be6[_0xba24('0x31')]));if(_0x491623[_0xba24('0x30')][_0xba24('0x3c')]){_0x559ae4[_0xba24('0x3a')]=_['merge'](_0x559ae4['where'],{'$or':_['map'](_0x361b90,function(_0x5ce7ee){if(_0x5ce7ee[_0xba24('0x2c')]!=='VIRTUAL'){var _0x446659={};_0x446659[_0x5ce7ee[_0xba24('0x28')]]={'$like':'%'+_0x491623['query']['filter']+'%'};return _0x446659;}})});}_0x559ae4=_[_0xba24('0x3d')]({},_0x559ae4,_0x491623[_0xba24('0x3e')]);var _0x3fa1c3={'where':_0x559ae4[_0xba24('0x3a')]};return db['Pause'][_0xba24('0x1b')](_0x3fa1c3)['then'](function(_0x541d1c){_0x37b394[_0xba24('0x1b')]=_0x541d1c;if(_0x491623[_0xba24('0x30')][_0xba24('0x3f')]){_0x559ae4[_0xba24('0x40')]=[{'all':!![]}];}return db['Pause'][_0xba24('0x41')](_0x559ae4);})['then'](function(_0x4866b3){_0x37b394[_0xba24('0x42')]=_0x4866b3;return _0x37b394;})[_0xba24('0x26')](respondWithFilteredResult(_0x1e1784,_0x559ae4))[_0xba24('0x43')](handleError(_0x1e1784,null));};exports[_0xba24('0x44')]=function(_0x1f32e5,_0xaa8dd4){var _0xe3a598={'raw':!![],'where':{'id':_0x1f32e5['params']['id']}},_0x20f8de={};_0x20f8de[_0xba24('0x2d')]=_[_0xba24('0x2f')](db[_0xba24('0x2b')][_0xba24('0x45')]);_0x20f8de[_0xba24('0x30')]=_[_0xba24('0x2f')](_0x1f32e5[_0xba24('0x30')]);_0x20f8de[_0xba24('0x31')]=_[_0xba24('0x32')](_0x20f8de[_0xba24('0x2d')],_0x20f8de['query']);_0xe3a598[_0xba24('0x33')]=_[_0xba24('0x32')](_0x20f8de[_0xba24('0x2d')],qs[_0xba24('0x34')](_0x1f32e5[_0xba24('0x30')]['fields']));_0xe3a598[_0xba24('0x33')]=_0xe3a598['attributes'][_0xba24('0x35')]?_0xe3a598[_0xba24('0x33')]:_0x20f8de[_0xba24('0x2d')];if(_0x1f32e5[_0xba24('0x30')]['includeAll']){_0xe3a598[_0xba24('0x40')]=[{'all':!![]}];}_0xe3a598=_[_0xba24('0x3d')]({},_0xe3a598,_0x1f32e5[_0xba24('0x3e')]);return db[_0xba24('0x2b')][_0xba24('0x46')](_0xe3a598)[_0xba24('0x26')](handleEntityNotFound(_0xaa8dd4,null))[_0xba24('0x26')](respondWithResult(_0xaa8dd4,null))['catch'](handleError(_0xaa8dd4,null));};exports[_0xba24('0x47')]=function(_0x82fdf6,_0x191c70){return db[_0xba24('0x2b')][_0xba24('0x47')](_0x82fdf6[_0xba24('0x48')],{})[_0xba24('0x26')](function(_0x490480){var _0x2beed3=_0x82fdf6[_0xba24('0x49')][_0xba24('0x23')]({'plain':!![]});if(!_0x2beed3)throw new Error(_0xba24('0x4a'));if(_0x2beed3['role']===_0xba24('0x49')){var _0x218af1=_0x490480[_0xba24('0x23')]({'plain':!![]});var _0x2c0a2a=_0xba24('0x24');return db[_0xba24('0x4b')][_0xba24('0x46')]({'where':{'name':_0x2c0a2a,'userProfileId':_0x2beed3[_0xba24('0x4c')]},'raw':!![]})['then'](function(_0x230790){if(_0x230790&&_0x230790[_0xba24('0x4d')]===0x0){return db[_0xba24('0x25')][_0xba24('0x47')]({'name':_0x218af1[_0xba24('0x28')],'resourceId':_0x218af1['id'],'type':_0x230790['name'],'sectionId':_0x230790['id']},{})[_0xba24('0x26')](function(){return _0x490480;});}else{return _0x490480;}})[_0xba24('0x43')](function(_0x454f45){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x454f45);throw _0x454f45;});}return _0x490480;})[_0xba24('0x26')](respondWithResult(_0x191c70,0xc9))[_0xba24('0x43')](handleError(_0x191c70,null));};exports[_0xba24('0x4e')]=function(_0x4e2dbb,_0x34da30){if(_0x4e2dbb[_0xba24('0x48')]['id']){delete _0x4e2dbb['body']['id'];}return db[_0xba24('0x2b')][_0xba24('0x46')]({'where':{'id':_0x4e2dbb[_0xba24('0x4f')]['id']}})[_0xba24('0x26')](handleEntityNotFound(_0x34da30,null))[_0xba24('0x26')](saveUpdates(_0x4e2dbb[_0xba24('0x48')],null))[_0xba24('0x26')](respondWithResult(_0x34da30,null))[_0xba24('0x43')](handleError(_0x34da30,null));};exports['destroy']=function(_0x1304b7,_0x55649c){return db['Pause']['find']({'where':{'id':_0x1304b7[_0xba24('0x4f')]['id']}})[_0xba24('0x26')](handleEntityNotFound(_0x55649c,null))[_0xba24('0x26')](removeEntity(_0x55649c,null))[_0xba24('0x43')](handleError(_0x55649c,null));}; \ No newline at end of file +var _0x1bc1=['where','pick','filter','merge','VIRTUAL','options','includeAll','Pause','findAll','rows','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','Pauses','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1bc1,0x1b6));var _0x11bc=function(_0x3f477c,_0x52b7ff){_0x3f477c=_0x3f477c-0x0;var _0x4c36b3=_0x1bc1[_0x3f477c];return _0x4c36b3;};'use strict';var pdf=require(_0x11bc('0x0'));var emlformat=require(_0x11bc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x11bc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x11bc('0x3'));var moment=require(_0x11bc('0x4'));var BPromise=require(_0x11bc('0x5'));var Mustache=require(_0x11bc('0x6'));var util=require(_0x11bc('0x7'));var path=require('path');var sox=require(_0x11bc('0x8'));var csv=require(_0x11bc('0x9'));var ejs=require(_0x11bc('0xa'));var fs=require('fs');var _=require(_0x11bc('0xb'));var squel=require('squel');var crypto=require(_0x11bc('0xc'));var jsforce=require(_0x11bc('0xd'));var deskjs=require(_0x11bc('0xe'));var toCsv=require(_0x11bc('0x9'));var querystring=require(_0x11bc('0xf'));var Papa=require(_0x11bc('0x10'));var Redis=require(_0x11bc('0x11'));var authService=require(_0x11bc('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x11bc('0x13'));var hardwareService=require(_0x11bc('0x14'));var logger=require(_0x11bc('0x15'))(_0x11bc('0x16'));var utils=require(_0x11bc('0x17'));var config=require(_0x11bc('0x18'));var db=require(_0x11bc('0x19'))['db'];function respondWithStatusCode(_0x527684,_0x129287){_0x129287=_0x129287||0xcc;return function(_0x2953c7){if(_0x2953c7){return _0x527684['sendStatus'](_0x129287);}return _0x527684[_0x11bc('0x1a')](_0x129287)['end']();};}function respondWithResult(_0x372981,_0x3efb78){_0x3efb78=_0x3efb78||0xc8;return function(_0x4df54d){if(_0x4df54d){return _0x372981['status'](_0x3efb78)[_0x11bc('0x1b')](_0x4df54d);}};}function respondWithFilteredResult(_0x15727e,_0x4fa1c8){return function(_0x24e45c){if(_0x24e45c){var _0x297a21=_0x24e45c[_0x11bc('0x1c')],_0x55cfc8=_0x4fa1c8[_0x11bc('0x1d')],_0x2aeb8e=_0x4fa1c8['offset']+_0x4fa1c8[_0x11bc('0x1e')],_0x193e50;if(_0x2aeb8e>=_0x297a21){_0x2aeb8e=_0x297a21;_0x193e50=0xc8;}else{_0x193e50=0xce;}_0x15727e[_0x11bc('0x1a')](_0x193e50);return _0x15727e[_0x11bc('0x1f')](_0x11bc('0x20'),_0x55cfc8+'-'+_0x2aeb8e+'/'+_0x297a21)['json'](_0x24e45c);}return null;};}function patchUpdates(_0x3c1f07){return function(_0x48d1f2){try{jsonpatch[_0x11bc('0x21')](_0x48d1f2,_0x3c1f07,!![]);}catch(_0xd8e917){return BPromise[_0x11bc('0x22')](_0xd8e917);}return _0x48d1f2['save']();};}function saveUpdates(_0x13a270,_0x395ff1){return function(_0x274ac2){if(_0x274ac2){return _0x274ac2['update'](_0x13a270)[_0x11bc('0x23')](function(_0x1a7e65){return _0x1a7e65;});}return null;};}function removeEntity(_0x4b4f65,_0x403261){return function(_0x24e782){if(_0x24e782){return _0x24e782[_0x11bc('0x24')]()[_0x11bc('0x23')](function(){var _0x2c7913=_0x24e782['get']({'plain':!![]});var _0x2bd85d=_0x11bc('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x2bd85d,'resourceId':_0x2c7913['id']}})[_0x11bc('0x23')](function(){return _0x24e782;});})[_0x11bc('0x23')](function(){_0x4b4f65[_0x11bc('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bfc2a,_0x32440d){return function(_0x1bd6dc){if(!_0x1bd6dc){_0x2bfc2a[_0x11bc('0x26')](0x194);}return _0x1bd6dc;};}function handleError(_0x68f66e,_0xec777){_0xec777=_0xec777||0x1f4;return function(_0x66309a){logger[_0x11bc('0x27')](_0x66309a[_0x11bc('0x28')]);if(_0x66309a[_0x11bc('0x29')]){delete _0x66309a[_0x11bc('0x29')];}_0x68f66e['status'](_0xec777)[_0x11bc('0x2a')](_0x66309a);};}exports['index']=function(_0x17e277,_0x18cf83){var _0x5932af={},_0x4c79ce={},_0xa42fbf={'count':0x0,'rows':[]};var _0x1c3ac2=_[_0x11bc('0x2b')](db['Pause'][_0x11bc('0x2c')],function(_0x4afc6e){return{'name':_0x4afc6e[_0x11bc('0x2d')],'type':_0x4afc6e[_0x11bc('0x2e')][_0x11bc('0x2f')]};});_0x4c79ce[_0x11bc('0x30')]=_[_0x11bc('0x2b')](_0x1c3ac2,_0x11bc('0x29'));_0x4c79ce['query']=_[_0x11bc('0x31')](_0x17e277[_0x11bc('0x32')]);_0x4c79ce[_0x11bc('0x33')]=_[_0x11bc('0x34')](_0x4c79ce[_0x11bc('0x30')],_0x4c79ce[_0x11bc('0x32')]);_0x5932af[_0x11bc('0x35')]=_[_0x11bc('0x34')](_0x4c79ce[_0x11bc('0x30')],qs[_0x11bc('0x36')](_0x17e277['query'][_0x11bc('0x36')]));_0x5932af[_0x11bc('0x35')]=_0x5932af[_0x11bc('0x35')][_0x11bc('0x37')]?_0x5932af[_0x11bc('0x35')]:_0x4c79ce['model'];if(!_0x17e277[_0x11bc('0x32')][_0x11bc('0x38')](_0x11bc('0x39'))){_0x5932af[_0x11bc('0x1e')]=qs[_0x11bc('0x1e')](_0x17e277[_0x11bc('0x32')][_0x11bc('0x1e')]);_0x5932af[_0x11bc('0x1d')]=qs[_0x11bc('0x1d')](_0x17e277[_0x11bc('0x32')][_0x11bc('0x1d')]);}_0x5932af[_0x11bc('0x3a')]=qs[_0x11bc('0x3b')](_0x17e277[_0x11bc('0x32')]['sort']);_0x5932af[_0x11bc('0x3c')]=qs['filters'](_[_0x11bc('0x3d')](_0x17e277[_0x11bc('0x32')],_0x4c79ce[_0x11bc('0x33')]));if(_0x17e277[_0x11bc('0x32')][_0x11bc('0x3e')]){_0x5932af[_0x11bc('0x3c')]=_[_0x11bc('0x3f')](_0x5932af[_0x11bc('0x3c')],{'$or':_['map'](_0x1c3ac2,function(_0x4d7cde){if(_0x4d7cde[_0x11bc('0x2e')]!==_0x11bc('0x40')){var _0x411126={};_0x411126[_0x4d7cde['name']]={'$like':'%'+_0x17e277[_0x11bc('0x32')][_0x11bc('0x3e')]+'%'};return _0x411126;}})});}_0x5932af=_[_0x11bc('0x3f')]({},_0x5932af,_0x17e277[_0x11bc('0x41')]);var _0x47218c={'where':_0x5932af[_0x11bc('0x3c')]};return db['Pause'][_0x11bc('0x1c')](_0x47218c)['then'](function(_0x4813f6){_0xa42fbf[_0x11bc('0x1c')]=_0x4813f6;if(_0x17e277[_0x11bc('0x32')][_0x11bc('0x42')]){_0x5932af['include']=[{'all':!![]}];}return db[_0x11bc('0x43')][_0x11bc('0x44')](_0x5932af);})[_0x11bc('0x23')](function(_0x58025e){_0xa42fbf[_0x11bc('0x45')]=_0x58025e;return _0xa42fbf;})[_0x11bc('0x23')](respondWithFilteredResult(_0x18cf83,_0x5932af))[_0x11bc('0x46')](handleError(_0x18cf83,null));};exports['show']=function(_0x9b9ea5,_0x577fb6){var _0x192c16={'raw':!![],'where':{'id':_0x9b9ea5[_0x11bc('0x47')]['id']}},_0x25cfd4={};_0x25cfd4['model']=_[_0x11bc('0x31')](db[_0x11bc('0x43')][_0x11bc('0x2c')]);_0x25cfd4['query']=_[_0x11bc('0x31')](_0x9b9ea5[_0x11bc('0x32')]);_0x25cfd4[_0x11bc('0x33')]=_[_0x11bc('0x34')](_0x25cfd4[_0x11bc('0x30')],_0x25cfd4[_0x11bc('0x32')]);_0x192c16[_0x11bc('0x35')]=_[_0x11bc('0x34')](_0x25cfd4[_0x11bc('0x30')],qs[_0x11bc('0x36')](_0x9b9ea5[_0x11bc('0x32')]['fields']));_0x192c16[_0x11bc('0x35')]=_0x192c16[_0x11bc('0x35')][_0x11bc('0x37')]?_0x192c16[_0x11bc('0x35')]:_0x25cfd4['model'];if(_0x9b9ea5[_0x11bc('0x32')]['includeAll']){_0x192c16['include']=[{'all':!![]}];}_0x192c16=_[_0x11bc('0x3f')]({},_0x192c16,_0x9b9ea5[_0x11bc('0x41')]);return db[_0x11bc('0x43')][_0x11bc('0x48')](_0x192c16)[_0x11bc('0x23')](handleEntityNotFound(_0x577fb6,null))[_0x11bc('0x23')](respondWithResult(_0x577fb6,null))[_0x11bc('0x46')](handleError(_0x577fb6,null));};exports[_0x11bc('0x49')]=function(_0x2a86ce,_0x41e9c2){return db[_0x11bc('0x43')][_0x11bc('0x49')](_0x2a86ce[_0x11bc('0x4a')],{})['then'](function(_0x2fb1cf){var _0x24be67=_0x2a86ce[_0x11bc('0x4b')][_0x11bc('0x4c')]({'plain':!![]});if(!_0x24be67)throw new Error(_0x11bc('0x4d'));if(_0x24be67[_0x11bc('0x4e')]===_0x11bc('0x4b')){var _0x52a15a=_0x2fb1cf['get']({'plain':!![]});var _0xa5a26d=_0x11bc('0x25');return db['UserProfileSection'][_0x11bc('0x48')]({'where':{'name':_0xa5a26d,'userProfileId':_0x24be67[_0x11bc('0x4f')]},'raw':!![]})[_0x11bc('0x23')](function(_0x46f343){if(_0x46f343&&_0x46f343['autoAssociation']===0x0){return db[_0x11bc('0x50')][_0x11bc('0x49')]({'name':_0x52a15a['name'],'resourceId':_0x52a15a['id'],'type':_0x46f343[_0x11bc('0x29')],'sectionId':_0x46f343['id']},{})[_0x11bc('0x23')](function(){return _0x2fb1cf;});}else{return _0x2fb1cf;}})[_0x11bc('0x46')](function(_0x4ae8ff){logger[_0x11bc('0x27')](_0x11bc('0x51'),_0x4ae8ff);throw _0x4ae8ff;});}return _0x2fb1cf;})[_0x11bc('0x23')](respondWithResult(_0x41e9c2,0xc9))[_0x11bc('0x46')](handleError(_0x41e9c2,null));};exports[_0x11bc('0x52')]=function(_0x1a4faf,_0x19913e){if(_0x1a4faf[_0x11bc('0x4a')]['id']){delete _0x1a4faf[_0x11bc('0x4a')]['id'];}return db['Pause'][_0x11bc('0x48')]({'where':{'id':_0x1a4faf['params']['id']}})['then'](handleEntityNotFound(_0x19913e,null))['then'](saveUpdates(_0x1a4faf[_0x11bc('0x4a')],null))['then'](respondWithResult(_0x19913e,null))[_0x11bc('0x46')](handleError(_0x19913e,null));};exports[_0x11bc('0x24')]=function(_0x25c4c9,_0x373fb0){return db[_0x11bc('0x43')][_0x11bc('0x48')]({'where':{'id':_0x25c4c9[_0x11bc('0x47')]['id']}})[_0x11bc('0x23')](handleEntityNotFound(_0x373fb0,null))[_0x11bc('0x23')](removeEntity(_0x373fb0,null))[_0x11bc('0x46')](handleError(_0x373fb0,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index d0bd771..cc38c1f 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 _0x117c=['../../config/environment','./pause.attributes','exports','define','tools_pauses','api','request-promise','path','rimraf'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x117c,0x71));var _0xc117=function(_0x3bb859,_0x589816){_0x3bb859=_0x3bb859-0x0;var _0x3bf534=_0x117c[_0x3bb859];return _0x3bf534;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc117('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc117('0x1'));var fs=require('fs');var path=require(_0xc117('0x2'));var rimraf=require(_0xc117('0x3'));var config=require(_0xc117('0x4'));var attributes=require(_0xc117('0x5'));module[_0xc117('0x6')]=function(_0x52d09e,_0x3bb859){return _0x52d09e[_0xc117('0x7')]('Pause',attributes,{'tableName':_0xc117('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x39d0=['lodash','api','moment','bluebird','request-promise','path','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses'];(function(_0x34bf63,_0x5c239c){var _0x129143=function(_0x48c881){while(--_0x48c881){_0x34bf63['push'](_0x34bf63['shift']());}};_0x129143(++_0x5c239c);}(_0x39d0,0x144));var _0x039d=function(_0x540027,_0x492d03){_0x540027=_0x540027-0x0;var _0x226eea=_0x39d0[_0x540027];return _0x226eea;};'use strict';var _=require(_0x039d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x039d('0x1'));var moment=require(_0x039d('0x2'));var BPromise=require(_0x039d('0x3'));var rp=require(_0x039d('0x4'));var fs=require('fs');var path=require(_0x039d('0x5'));var rimraf=require('rimraf');var config=require(_0x039d('0x6'));var attributes=require(_0x039d('0x7'));module[_0x039d('0x8')]=function(_0x1e5075,_0x1ab56f){return _0x1e5075[_0x039d('0x9')](_0x039d('0xa'),attributes,{'tableName':_0x039d('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 e737568..4dd08ba 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 _0x9434=['Pause,\x20%s,\x20%s','message','result','catch','ShowPause','Pause','options','raw','where','attributes','include','map','model','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x7e1f88,_0x2a3ea5){var _0x15ab33=function(_0x5a9a4c){while(--_0x5a9a4c){_0x7e1f88['push'](_0x7e1f88['shift']());}};_0x15ab33(++_0x2a3ea5);}(_0x9434,0x74));var _0x4943=function(_0x261a22,_0x1091d4){_0x261a22=_0x261a22-0x0;var _0x5767f9=_0x9434[_0x261a22];return _0x5767f9;};'use strict';var _=require(_0x4943('0x0'));var util=require('util');var moment=require(_0x4943('0x1'));var BPromise=require('bluebird');var rs=require(_0x4943('0x2'));var fs=require('fs');var Redis=require(_0x4943('0x3'));var db=require(_0x4943('0x4'))['db'];var utils=require(_0x4943('0x5'));var logger=require(_0x4943('0x6'))(_0x4943('0x7'));var config=require(_0x4943('0x8'));var jayson=require(_0x4943('0x9'));var client=jayson[_0x4943('0xa')][_0x4943('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f29b9,_0x4ef6fc,_0x14c927){return new BPromise(function(_0x1a85c0,_0x2f09a4){return client[_0x4943('0xc')](_0x4f29b9,_0x14c927)[_0x4943('0xd')](function(_0xdc078c){logger[_0x4943('0xe')]('Pause,\x20%s,\x20%s',_0x4ef6fc,_0x4943('0xf'));logger[_0x4943('0x10')](_0x4943('0x11'),_0x4ef6fc,_0x4943('0xf'),JSON['stringify'](_0xdc078c));if(_0xdc078c[_0x4943('0x12')]){if(_0xdc078c[_0x4943('0x12')][_0x4943('0x13')]===0x1f4){logger[_0x4943('0x12')](_0x4943('0x14'),_0x4ef6fc,_0xdc078c['error'][_0x4943('0x15')]);return _0x2f09a4(_0xdc078c[_0x4943('0x12')][_0x4943('0x15')]);}logger['error']('Pause,\x20%s,\x20%s',_0x4ef6fc,_0xdc078c[_0x4943('0x12')]['message']);return _0x1a85c0(_0xdc078c[_0x4943('0x12')]['message']);}else{logger[_0x4943('0xe')](_0x4943('0x14'),_0x4ef6fc,_0x4943('0xf'));_0x1a85c0(_0xdc078c[_0x4943('0x16')][_0x4943('0x15')]);}})[_0x4943('0x17')](function(_0x1ba009){logger[_0x4943('0x12')](_0x4943('0x14'),_0x4ef6fc,_0x1ba009);_0x2f09a4(_0x1ba009);});});}exports[_0x4943('0x18')]=function(_0x157c6e){var _0x59edd5=this;return new Promise(function(_0x16d520,_0x24e33e){return db[_0x4943('0x19')]['find']({'raw':_0x157c6e[_0x4943('0x1a')]?_0x157c6e['options'][_0x4943('0x1b')]===undefined?!![]:![]:!![],'where':_0x157c6e['options']?_0x157c6e[_0x4943('0x1a')][_0x4943('0x1c')]||null:null,'attributes':_0x157c6e['options']?_0x157c6e[_0x4943('0x1a')][_0x4943('0x1d')]||null:null,'include':_0x157c6e[_0x4943('0x1a')]?_0x157c6e[_0x4943('0x1a')][_0x4943('0x1e')]?_[_0x4943('0x1f')](_0x157c6e[_0x4943('0x1a')]['include'],function(_0x343af3){return{'model':db[_0x343af3[_0x4943('0x20')]],'as':_0x343af3['as'],'attributes':_0x343af3['attributes'],'include':_0x343af3[_0x4943('0x1e')]?_[_0x4943('0x1f')](_0x343af3[_0x4943('0x1e')],function(_0x10542c){return{'model':db[_0x10542c[_0x4943('0x20')]],'as':_0x10542c['as'],'attributes':_0x10542c[_0x4943('0x1d')],'include':_0x10542c[_0x4943('0x1e')]?_[_0x4943('0x1f')](_0x10542c[_0x4943('0x1e')],function(_0x1e0859){return{'model':db[_0x1e0859['model']],'as':_0x1e0859['as'],'attributes':_0x1e0859[_0x4943('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4943('0xd')](function(_0x2c68f6){logger['info']('ShowPause',_0x157c6e);logger['debug'](_0x4943('0x18'),_0x157c6e,JSON[_0x4943('0x21')](_0x2c68f6));_0x16d520(_0x2c68f6);})['catch'](function(_0x2e4b1a){logger[_0x4943('0x12')](_0x4943('0x18'),_0x2e4b1a[_0x4943('0x15')],_0x157c6e);_0x24e33e(_0x59edd5[_0x4943('0x12')](0x1f4,_0x2e4b1a['message']));});});}; \ No newline at end of file +var _0x05dd=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Pause,\x20%s,\x20%s','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowPause','Pause','find','options','raw','where','include','model','attributes','map','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x20b014,_0x202958){var _0x5d9099=function(_0x28f1ed){while(--_0x28f1ed){_0x20b014['push'](_0x20b014['shift']());}};_0x5d9099(++_0x202958);}(_0x05dd,0x134));var _0xd05d=function(_0x3c1fd5,_0x772797){_0x3c1fd5=_0x3c1fd5-0x0;var _0x42cdae=_0x05dd[_0x3c1fd5];return _0x42cdae;};'use strict';var _=require(_0xd05d('0x0'));var util=require(_0xd05d('0x1'));var moment=require(_0xd05d('0x2'));var BPromise=require(_0xd05d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd05d('0x4'));var db=require(_0xd05d('0x5'))['db'];var utils=require(_0xd05d('0x6'));var logger=require(_0xd05d('0x7'))(_0xd05d('0x8'));var config=require(_0xd05d('0x9'));var jayson=require(_0xd05d('0xa'));var client=jayson[_0xd05d('0xb')][_0xd05d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x880bce,_0xc67641,_0x51e1cb){return new BPromise(function(_0x576e04,_0x173974){return client[_0xd05d('0xd')](_0x880bce,_0x51e1cb)[_0xd05d('0xe')](function(_0x4f6d2e){logger[_0xd05d('0xf')](_0xd05d('0x10'),_0xc67641,_0xd05d('0x11'));logger[_0xd05d('0x12')](_0xd05d('0x13'),_0xc67641,'request\x20sent',JSON[_0xd05d('0x14')](_0x4f6d2e));if(_0x4f6d2e[_0xd05d('0x15')]){if(_0x4f6d2e[_0xd05d('0x15')][_0xd05d('0x16')]===0x1f4){logger[_0xd05d('0x15')](_0xd05d('0x10'),_0xc67641,_0x4f6d2e[_0xd05d('0x15')][_0xd05d('0x17')]);return _0x173974(_0x4f6d2e[_0xd05d('0x15')][_0xd05d('0x17')]);}logger['error'](_0xd05d('0x10'),_0xc67641,_0x4f6d2e[_0xd05d('0x15')][_0xd05d('0x17')]);return _0x576e04(_0x4f6d2e[_0xd05d('0x15')][_0xd05d('0x17')]);}else{logger['info'](_0xd05d('0x10'),_0xc67641,'request\x20sent');_0x576e04(_0x4f6d2e['result'][_0xd05d('0x17')]);}})[_0xd05d('0x18')](function(_0x318c64){logger[_0xd05d('0x15')](_0xd05d('0x10'),_0xc67641,_0x318c64);_0x173974(_0x318c64);});});}exports[_0xd05d('0x19')]=function(_0x2969ed){var _0x4e5ca6=this;return new Promise(function(_0x5b99bd,_0x391601){return db[_0xd05d('0x1a')][_0xd05d('0x1b')]({'raw':_0x2969ed[_0xd05d('0x1c')]?_0x2969ed[_0xd05d('0x1c')][_0xd05d('0x1d')]===undefined?!![]:![]:!![],'where':_0x2969ed[_0xd05d('0x1c')]?_0x2969ed['options'][_0xd05d('0x1e')]||null:null,'attributes':_0x2969ed[_0xd05d('0x1c')]?_0x2969ed[_0xd05d('0x1c')]['attributes']||null:null,'include':_0x2969ed[_0xd05d('0x1c')]?_0x2969ed[_0xd05d('0x1c')]['include']?_['map'](_0x2969ed['options'][_0xd05d('0x1f')],function(_0x3739ce){return{'model':db[_0x3739ce[_0xd05d('0x20')]],'as':_0x3739ce['as'],'attributes':_0x3739ce[_0xd05d('0x21')],'include':_0x3739ce[_0xd05d('0x1f')]?_[_0xd05d('0x22')](_0x3739ce[_0xd05d('0x1f')],function(_0x10b4d8){return{'model':db[_0x10b4d8['model']],'as':_0x10b4d8['as'],'attributes':_0x10b4d8['attributes'],'include':_0x10b4d8[_0xd05d('0x1f')]?_[_0xd05d('0x22')](_0x10b4d8['include'],function(_0x20ccbc){return{'model':db[_0x20ccbc[_0xd05d('0x20')]],'as':_0x20ccbc['as'],'attributes':_0x20ccbc[_0xd05d('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd05d('0xe')](function(_0x52eff8){logger['info'](_0xd05d('0x19'),_0x2969ed);logger[_0xd05d('0x12')]('ShowPause',_0x2969ed,JSON[_0xd05d('0x14')](_0x52eff8));_0x5b99bd(_0x52eff8);})[_0xd05d('0x18')](function(_0x128e90){logger[_0xd05d('0x15')](_0xd05d('0x19'),_0x128e90['message'],_0x2969ed);_0x391601(_0x4e5ca6[_0xd05d('0x15')](0x1f4,_0x128e90[_0xd05d('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index a2da394..f8a9922 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 _0x5427=['isAuthenticated','show','/:id/download','diskStorage','originalname','replace','format','basename','extname','now','post','single','upload','webhookPost','update','delete','/:id','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','get','index','/webhook','webhookGet'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x5427,0x19a));var _0x7542=function(_0x2dd59a,_0x1d7030){_0x2dd59a=_0x2dd59a-0x0;var _0x4235fb=_0x5427[_0x2dd59a];return _0x4235fb;};'use strict';var multer=require(_0x7542('0x0'));var util=require(_0x7542('0x1'));var path=require(_0x7542('0x2'));var timeout=require(_0x7542('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x7542('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7542('0x5'));var controller=require('./plugin.controller');router[_0x7542('0x6')]('/',auth['isAuthenticated'](),controller[_0x7542('0x7')]);router[_0x7542('0x6')](_0x7542('0x8'),controller[_0x7542('0x9')]);router[_0x7542('0x6')]('/:id',auth[_0x7542('0xa')](),controller[_0x7542('0xb')]);router['get'](_0x7542('0xc'),auth[_0x7542('0xa')](),controller['download']);var upload=multer({'storage':multer[_0x7542('0xd')]({'destination':function(_0x1d2c03,_0x3190f6,_0xd88bc8){_0xd88bc8(null,path['join'](config['root'],'server/files/plugins'));},'filename':function(_0x699886,_0x20a879,_0x6c571e){_0x20a879['originalname']=_0x20a879[_0x7542('0xe')][_0x7542('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x6c571e(null,util[_0x7542('0x10')]('%s-%s%s',path[_0x7542('0x11')](_0x20a879[_0x7542('0xe')],path[_0x7542('0x12')](_0x20a879[_0x7542('0xe')])),Date[_0x7542('0x13')](),path['extname'](_0x20a879[_0x7542('0xe')])));}})});router[_0x7542('0x14')]('/',upload[_0x7542('0x15')]('file'),controller[_0x7542('0x16')]);router['post']('/webhook',controller[_0x7542('0x17')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x7542('0x18')]);router[_0x7542('0x19')](_0x7542('0x1a'),auth[_0x7542('0xa')](),controller[_0x7542('0x19')]);module[_0x7542('0x1b')]=router; \ No newline at end of file +var _0xc7a2=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','server/files/plugins','originalname','replace','basename','extname','now','post','single','file','upload','webhookPost','put','update','delete','exports','multer','path','connect-timeout','express','Router'];(function(_0x52a9f2,_0x2e0e2f){var _0x4ee924=function(_0x16444a){while(--_0x16444a){_0x52a9f2['push'](_0x52a9f2['shift']());}};_0x4ee924(++_0x2e0e2f);}(_0xc7a2,0x166));var _0x2c7a=function(_0x335d63,_0x5d8378){_0x335d63=_0x335d63-0x0;var _0x49bcda=_0xc7a2[_0x335d63];return _0x49bcda;};'use strict';var multer=require(_0x2c7a('0x0'));var util=require('util');var path=require(_0x2c7a('0x1'));var timeout=require(_0x2c7a('0x2'));var express=require(_0x2c7a('0x3'));var router=express[_0x2c7a('0x4')]();var auth=require(_0x2c7a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2c7a('0x6'));var controller=require('./plugin.controller');router[_0x2c7a('0x7')]('/',auth[_0x2c7a('0x8')](),controller[_0x2c7a('0x9')]);router[_0x2c7a('0x7')](_0x2c7a('0xa'),controller[_0x2c7a('0xb')]);router[_0x2c7a('0x7')](_0x2c7a('0xc'),auth['isAuthenticated'](),controller[_0x2c7a('0xd')]);router[_0x2c7a('0x7')](_0x2c7a('0xe'),auth[_0x2c7a('0x8')](),controller[_0x2c7a('0xf')]);var upload=multer({'storage':multer[_0x2c7a('0x10')]({'destination':function(_0x2bf863,_0x137bf6,_0x1050c1){_0x1050c1(null,path[_0x2c7a('0x11')](config['root'],_0x2c7a('0x12')));},'filename':function(_0x2c8c9b,_0x1249c5,_0x23fa7e){_0x1249c5[_0x2c7a('0x13')]=_0x1249c5[_0x2c7a('0x13')][_0x2c7a('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x23fa7e(null,util['format']('%s-%s%s',path[_0x2c7a('0x15')](_0x1249c5[_0x2c7a('0x13')],path[_0x2c7a('0x16')](_0x1249c5[_0x2c7a('0x13')])),Date[_0x2c7a('0x17')](),path[_0x2c7a('0x16')](_0x1249c5['originalname'])));}})});router[_0x2c7a('0x18')]('/',upload[_0x2c7a('0x19')](_0x2c7a('0x1a')),controller[_0x2c7a('0x1b')]);router[_0x2c7a('0x18')](_0x2c7a('0xa'),controller[_0x2c7a('0x1c')]);router[_0x2c7a('0x1d')](_0x2c7a('0xc'),auth[_0x2c7a('0x8')](),controller[_0x2c7a('0x1e')]);router[_0x2c7a('0x1f')](_0x2c7a('0xc'),auth['isAuthenticated'](),controller[_0x2c7a('0x1f')]);module[_0x2c7a('0x20')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 40f6a35..29ec50b 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 _0x4faa=['adminOnly','always','sequelize','exports','STRING','ENUM','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0xd0afc9,_0x56e8c9){var _0xfd8ba2=function(_0xfcf805){while(--_0xfcf805){_0xd0afc9['push'](_0xd0afc9['shift']());}};_0xfd8ba2(++_0x56e8c9);}(_0x4faa,0x18e));var _0xa4fa=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x4faa[_0x4bb66f];return _0xf2772f;};'use strict';var Sequelize=require(_0xa4fa('0x0'));module[_0xa4fa('0x1')]={'name':{'type':Sequelize[_0xa4fa('0x2')]},'type':{'type':Sequelize[_0xa4fa('0x3')](_0xa4fa('0x4'),'script')},'description':{'type':Sequelize[_0xa4fa('0x5')]},'version':{'type':Sequelize[_0xa4fa('0x5')]},'path':{'type':Sequelize[_0xa4fa('0x2')],'comment':_0xa4fa('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize['ENUM'](_0xa4fa('0x7'),'agentOnly','always','never'),'defaultValue':_0xa4fa('0x8'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xa4fa('0x2')]},'agentUrl':{'type':Sequelize[_0xa4fa('0x2')]},'scriptName':{'type':Sequelize[_0xa4fa('0x2')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc5a5=['TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','exports','STRING','ENUM','html','script'];(function(_0x2d243a,_0xc712b0){var _0x545317=function(_0x41c1f0){while(--_0x41c1f0){_0x2d243a['push'](_0x2d243a['shift']());}};_0x545317(++_0xc712b0);}(_0xc5a5,0x192));var _0x5c5a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc5a5[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x5c5a('0x0')]={'name':{'type':Sequelize[_0x5c5a('0x1')]},'type':{'type':Sequelize[_0x5c5a('0x2')](_0x5c5a('0x3'),_0x5c5a('0x4'))},'description':{'type':Sequelize[_0x5c5a('0x5')]},'version':{'type':Sequelize[_0x5c5a('0x5')]},'path':{'type':Sequelize[_0x5c5a('0x1')],'comment':_0x5c5a('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5c5a('0x7')},'sidebar':{'type':Sequelize[_0x5c5a('0x2')](_0x5c5a('0x8'),_0x5c5a('0x9'),_0x5c5a('0xa'),'never'),'defaultValue':_0x5c5a('0xa'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x5c5a('0x1')]},'scriptName':{'type':Sequelize[_0x5c5a('0x1')]},'scriptPath':{'type':Sequelize[_0x5c5a('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 2c2217f..e4c76d8 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 _0x4861=['pick','merge','filter','options','count','includeAll','findAll','params','include','find','catch','join','root','format','basename','zip','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','server/files/plugins','dirname','close','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','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','always','icon','icon-apps','admin','plugins','test','Warning:\x20agent\x20view\x20not\x20specified','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','method','%s%s','headers','content-length','content-type','set','endsWith','statusCode','\x27PATH\x27\x20parameter\x20not\x20specified','encoding','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','offset','json','reject','save','update','then','destroy','get','Plugins','UserProfileResource','end','error','stack','name','send','index','map','Plugin','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where'];(function(_0x1f591d,_0x20ef59){var _0x22a578=function(_0x34fd3c){while(--_0x34fd3c){_0x1f591d['push'](_0x1f591d['shift']());}};_0x22a578(++_0x20ef59);}(_0x4861,0x108));var _0x1486=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4861[_0x167cc1];return _0x10bc4b;};'use strict';var pdf=require(_0x1486('0x0'));var emlformat=require(_0x1486('0x1'));var rimraf=require(_0x1486('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1486('0x3'));var rp=require(_0x1486('0x4'));var moment=require(_0x1486('0x5'));var BPromise=require(_0x1486('0x6'));var Mustache=require(_0x1486('0x7'));var util=require(_0x1486('0x8'));var path=require(_0x1486('0x9'));var sox=require(_0x1486('0xa'));var csv=require(_0x1486('0xb'));var ejs=require(_0x1486('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1486('0xd'));var jsforce=require(_0x1486('0xe'));var deskjs=require(_0x1486('0xf'));var toCsv=require(_0x1486('0xb'));var querystring=require(_0x1486('0x10'));var Papa=require(_0x1486('0x11'));var extract=require(_0x1486('0x12'));var rimraf=require('rimraf');var archiver=require(_0x1486('0x13'));var Redis=require(_0x1486('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x1486('0x15'));var as=require(_0x1486('0x16'));var hardwareService=require(_0x1486('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x1486('0x18'));var config=require(_0x1486('0x19'));var db=require(_0x1486('0x1a'))['db'];config['redis']=_[_0x1486('0x1b')](config[_0x1486('0x1c')],{'host':_0x1486('0x1d'),'port':0x18eb});var socket=require(_0x1486('0x1e'))(new Redis(config[_0x1486('0x1c')]));require(_0x1486('0x1f'))['register'](socket);function respondWithStatusCode(_0x9d2bf,_0x1ad134){_0x1ad134=_0x1ad134||0xcc;return function(_0x4415ff){if(_0x4415ff){return _0x9d2bf[_0x1486('0x20')](_0x1ad134);}return _0x9d2bf[_0x1486('0x21')](_0x1ad134)['end']();};}function respondWithResult(_0x2b29cd,_0x1caf5c){_0x1caf5c=_0x1caf5c||0xc8;return function(_0x2c991e){if(_0x2c991e){return _0x2b29cd[_0x1486('0x21')](_0x1caf5c)['json'](_0x2c991e);}};}function respondWithFilteredResult(_0x22a9c9,_0xe77b17){return function(_0x4df12e){if(_0x4df12e){var _0x55f8e4=_0x4df12e['count'],_0x3c2da9=_0xe77b17[_0x1486('0x22')],_0x57f558=_0xe77b17[_0x1486('0x22')]+_0xe77b17['limit'],_0x12e09f;if(_0x57f558>=_0x55f8e4){_0x57f558=_0x55f8e4;_0x12e09f=0xc8;}else{_0x12e09f=0xce;}_0x22a9c9['status'](_0x12e09f);return _0x22a9c9['set']('Content-Range',_0x3c2da9+'-'+_0x57f558+'/'+_0x55f8e4)[_0x1486('0x23')](_0x4df12e);}return null;};}function patchUpdates(_0x3fdc31){return function(_0x1d271f){try{jsonpatch['apply'](_0x1d271f,_0x3fdc31,!![]);}catch(_0x445587){return BPromise[_0x1486('0x24')](_0x445587);}return _0x1d271f[_0x1486('0x25')]();};}function saveUpdates(_0xb6a51,_0x452d63){return function(_0x3e8a79){if(_0x3e8a79){return _0x3e8a79[_0x1486('0x26')](_0xb6a51)[_0x1486('0x27')](function(_0x4e5d42){return _0x4e5d42;});}return null;};}function removeEntity(_0x2b3ad4,_0x238084){return function(_0x511670){if(_0x511670){return _0x511670[_0x1486('0x28')]()[_0x1486('0x27')](function(){var _0x38919a=_0x511670[_0x1486('0x29')]({'plain':!![]});var _0x47fc40=_0x1486('0x2a');return db[_0x1486('0x2b')][_0x1486('0x28')]({'where':{'type':_0x47fc40,'resourceId':_0x38919a['id']}})[_0x1486('0x27')](function(){return _0x511670;});})[_0x1486('0x27')](function(){_0x2b3ad4[_0x1486('0x21')](0xcc)[_0x1486('0x2c')]();});}};}function handleEntityNotFound(_0x5e4891,_0x289a70){return function(_0x34335f){if(!_0x34335f){_0x5e4891[_0x1486('0x20')](0x194);}return _0x34335f;};}function handleError(_0x4257e8,_0x355819){_0x355819=_0x355819||0x1f4;return function(_0x1de450){logger[_0x1486('0x2d')](_0x1de450[_0x1486('0x2e')]);if(_0x1de450[_0x1486('0x2f')]){delete _0x1de450[_0x1486('0x2f')];}_0x4257e8[_0x1486('0x21')](_0x355819)[_0x1486('0x30')](_0x1de450);};}exports[_0x1486('0x31')]=function(_0x5f52f6,_0xe9ce69){var _0x52e634={},_0x19ca7c={},_0x5e6a13={'count':0x0,'rows':[]};var _0x3621af=_[_0x1486('0x32')](db[_0x1486('0x33')][_0x1486('0x34')],function(_0x66b02c){return{'name':_0x66b02c['fieldName'],'type':_0x66b02c[_0x1486('0x35')][_0x1486('0x36')]};});_0x19ca7c['model']=_[_0x1486('0x32')](_0x3621af,_0x1486('0x2f'));_0x19ca7c[_0x1486('0x37')]=_[_0x1486('0x38')](_0x5f52f6['query']);_0x19ca7c[_0x1486('0x39')]=_[_0x1486('0x3a')](_0x19ca7c[_0x1486('0x3b')],_0x19ca7c[_0x1486('0x37')]);_0x52e634['attributes']=_[_0x1486('0x3a')](_0x19ca7c[_0x1486('0x3b')],qs[_0x1486('0x3c')](_0x5f52f6[_0x1486('0x37')][_0x1486('0x3c')]));_0x52e634[_0x1486('0x3d')]=_0x52e634[_0x1486('0x3d')][_0x1486('0x3e')]?_0x52e634[_0x1486('0x3d')]:_0x19ca7c[_0x1486('0x3b')];if(!_0x5f52f6['query'][_0x1486('0x3f')](_0x1486('0x40'))){_0x52e634[_0x1486('0x41')]=qs[_0x1486('0x41')](_0x5f52f6[_0x1486('0x37')][_0x1486('0x41')]);_0x52e634[_0x1486('0x22')]=qs[_0x1486('0x22')](_0x5f52f6[_0x1486('0x37')][_0x1486('0x22')]);}_0x52e634['order']=qs[_0x1486('0x42')](_0x5f52f6[_0x1486('0x37')][_0x1486('0x42')]);_0x52e634[_0x1486('0x43')]=qs['filters'](_[_0x1486('0x44')](_0x5f52f6[_0x1486('0x37')],_0x19ca7c[_0x1486('0x39')]));if(_0x5f52f6['query']['filter']){_0x52e634[_0x1486('0x43')]=_[_0x1486('0x45')](_0x52e634[_0x1486('0x43')],{'$or':_[_0x1486('0x32')](_0x3621af,function(_0x337ef8){if(_0x337ef8['type']!=='VIRTUAL'){var _0x4a7b3e={};_0x4a7b3e[_0x337ef8[_0x1486('0x2f')]]={'$like':'%'+_0x5f52f6[_0x1486('0x37')][_0x1486('0x46')]+'%'};return _0x4a7b3e;}})});}_0x52e634=_['merge']({},_0x52e634,_0x5f52f6[_0x1486('0x47')]);var _0x208f85={'where':_0x52e634[_0x1486('0x43')]};return db['Plugin'][_0x1486('0x48')](_0x208f85)[_0x1486('0x27')](function(_0x44f70b){_0x5e6a13['count']=_0x44f70b;if(_0x5f52f6[_0x1486('0x37')][_0x1486('0x49')]){_0x52e634['include']=[{'all':!![]}];}return db[_0x1486('0x33')][_0x1486('0x4a')](_0x52e634);})[_0x1486('0x27')](function(_0x450517){_0x5e6a13['rows']=_0x450517;return _0x5e6a13;})[_0x1486('0x27')](respondWithFilteredResult(_0xe9ce69,_0x52e634))['catch'](handleError(_0xe9ce69,null));};exports['show']=function(_0x22af2a,_0xbef025){var _0x39eba5={'raw':!![],'where':{'id':_0x22af2a[_0x1486('0x4b')]['id']}},_0x47839a={};_0x47839a[_0x1486('0x3b')]=_[_0x1486('0x38')](db['Plugin'][_0x1486('0x34')]);_0x47839a['query']=_[_0x1486('0x38')](_0x22af2a[_0x1486('0x37')]);_0x47839a[_0x1486('0x39')]=_[_0x1486('0x3a')](_0x47839a[_0x1486('0x3b')],_0x47839a['query']);_0x39eba5[_0x1486('0x3d')]=_[_0x1486('0x3a')](_0x47839a[_0x1486('0x3b')],qs['fields'](_0x22af2a[_0x1486('0x37')][_0x1486('0x3c')]));_0x39eba5[_0x1486('0x3d')]=_0x39eba5['attributes']['length']?_0x39eba5[_0x1486('0x3d')]:_0x47839a[_0x1486('0x3b')];if(_0x22af2a['query'][_0x1486('0x49')]){_0x39eba5[_0x1486('0x4c')]=[{'all':!![]}];}_0x39eba5=_[_0x1486('0x45')]({},_0x39eba5,_0x22af2a[_0x1486('0x47')]);return db[_0x1486('0x33')][_0x1486('0x4d')](_0x39eba5)[_0x1486('0x27')](handleEntityNotFound(_0xbef025,null))[_0x1486('0x27')](respondWithResult(_0xbef025,null))[_0x1486('0x4e')](handleError(_0xbef025,null));};exports['download']=function(_0x5d4605,_0x1cec24,_0x285a27){return db[_0x1486('0x33')][_0x1486('0x4d')]({'where':{'id':_0x5d4605[_0x1486('0x4b')]['id']},'attributes':[_0x1486('0x2f'),'path'],'raw':!![]})['then'](handleEntityNotFound(_0x1cec24,null))[_0x1486('0x27')](function(_0x46ef66){if(_0x46ef66){var _0xe4e54c=path[_0x1486('0x4f')](config[_0x1486('0x50')],'server/files/plugins',util[_0x1486('0x51')]('%s.zip',path[_0x1486('0x52')](_0x46ef66[_0x1486('0x9')])));var _0x273e95=fs['createWriteStream'](_0xe4e54c);var _0x2650f2=archiver(_0x1486('0x53'),{'zlib':{'level':0x9}});_0x2650f2['on']('warning',function(_0x36c744){if(_0x36c744['code']==='ENOENT'){logger['error'](_0x36c744);}else{throw new db[(_0x1486('0x54'))][(_0x1486('0x55'))](_0x1486('0x56'));}});_0x2650f2['on'](_0x1486('0x2d'),function(_0x4bad3e){throw new db[(_0x1486('0x54'))][(_0x1486('0x55'))](_0x1486('0x56'));});_0x2650f2[_0x1486('0x57')](_0x273e95);_0x2650f2[_0x1486('0x58')](_0x1486('0x59'),{'cwd':path[_0x1486('0x4f')](config[_0x1486('0x50')],_0x1486('0x5a'),path[_0x1486('0x5b')](_0x46ef66[_0x1486('0x9')])),'ignore':[path[_0x1486('0x4f')](path[_0x1486('0x52')](_0x46ef66['path']),'node_modules/**/*'),path[_0x1486('0x4f')](path['basename'](_0x46ef66['path']),'attachments/**/*')],'nodir':!![]})['finalize']();_0x273e95['on'](_0x1486('0x5c'),function(){if(!fs['existsSync'](_0xe4e54c)){throw new db[(_0x1486('0x54'))][(_0x1486('0x55'))]('Plugin\x20not\x20found');}return _0x1cec24[_0x1486('0x5d')](_0xe4e54c,util[_0x1486('0x51')]('%s.zip',path[_0x1486('0x52')](_0x46ef66[_0x1486('0x9')])),function(_0x3b0bf9){if(_0x3b0bf9){throw new db[(_0x1486('0x54'))]['Error'](_0x1486('0x5e'));}fs[_0x1486('0x5f')](_0xe4e54c);logger[_0x1486('0x60')](_0x1486('0x61'));logger[_0x1486('0x60')](_0x1486('0x62'));});});}return null;})['catch'](handleError(_0x1cec24,null));};exports[_0x1486('0x63')]=function(_0x1aa0a3,_0x3df384,_0x5eeaba){var _0x3dbf13=path[_0x1486('0x52')](_0x1aa0a3[_0x1486('0x64')]['filename'],path['extname'](_0x1aa0a3[_0x1486('0x64')][_0x1486('0x65')]));var _0x512f7e=path['join'](config[_0x1486('0x50')],_0x1486('0x5a'),_0x1aa0a3[_0x1486('0x64')][_0x1486('0x65')]);var _0x43ecb7=path[_0x1486('0x4f')](config[_0x1486('0x50')],_0x1486('0x5a'),_0x3dbf13);logger[_0x1486('0x60')]('Plugin\x20upload\x20filepath:\x20%s',_0x512f7e);logger[_0x1486('0x60')]('Plugin\x20upload\x20destination:\x20%s',_0x43ecb7);try{fs[_0x1486('0x66')](_0x512f7e,parseInt(_0x1486('0x67'),0x8));extract(_0x512f7e,{'dir':_0x43ecb7},function(_0x3e608f){if(_0x3e608f){logger[_0x1486('0x2d')](_0x3e608f);handleError(_0x3e608f,!![]);};var _0x1dfde0=fs[_0x1486('0x68')](_0x43ecb7);if(_0x1dfde0[_0x1486('0x3e')]>0x1){removeReferences(_0x512f7e,_0x43ecb7);logger[_0x1486('0x2d')](_0x1486('0x69'));return _0x5eeaba(new Error(_0x1486('0x69')));}var _0x5447d=fs[_0x1486('0x6a')](path['join'](_0x43ecb7,_0x1dfde0[0x0]));if(_0x5447d['isFile']()){removeReferences(_0x512f7e,_0x43ecb7);logger[_0x1486('0x2d')](_0x1486('0x69'));return _0x5eeaba(new Error(_0x1486('0x69')));}if(_0x5447d[_0x1486('0x6b')]()){var _0x12d19b=fs[_0x1486('0x68')](path[_0x1486('0x4f')](_0x43ecb7,_0x1dfde0[0x0]));if(_0x12d19b[_0x1486('0x3e')]===0x0){removeReferences(_0x512f7e,_0x43ecb7);logger[_0x1486('0x2d')](_0x1486('0x69'));return _0x5eeaba(new Error(_0x1486('0x69')));}var _0x34619a=_0x12d19b[_0x1486('0x6c')](function(_0x5c3c77){return _0x5c3c77===_0x1486('0x6d');});if(!_0x34619a){return _0x5eeaba(new Error(_0x1486('0x6e')));}var _0x45e038=fs[_0x1486('0x6f')](path[_0x1486('0x4f')](_0x43ecb7,_0x1dfde0[0x0],_0x1486('0x6d')));var _0x4f2add=JSON[_0x1486('0x70')](_0x45e038);if(_0x1486('0x71')==typeof _0x4f2add['name']){return _0x5eeaba(new Error(_0x1486('0x72')));}if(_0x1486('0x71')==typeof _0x4f2add[_0x1486('0x35')]){return _0x5eeaba(new Error(_0x1486('0x73')));}if(_0x1486('0x71')==typeof _0x4f2add[_0x1486('0x74')]){return _0x5eeaba(new Error(_0x1486('0x75')));}if(_0x1486('0x71')==typeof _0x4f2add[_0x1486('0x76')]){return _0x5eeaba(new Error(_0x1486('0x77')));}if(_0x4f2add[_0x1486('0x35')]===_0x1486('0x78')){if('undefined'==typeof _0x4f2add['parameters'][_0x1486('0x79')]){return _0x5eeaba(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x1486('0x71')==typeof _0x4f2add[_0x1486('0x76')][_0x1486('0x79')]['admin']&&_0x1486('0x71')==typeof _0x4f2add[_0x1486('0x76')][_0x1486('0x79')][_0x1486('0x7a')]){return _0x5eeaba(new Error(_0x1486('0x7b')));}}else if(_0x4f2add[_0x1486('0x35')]===_0x1486('0x7c')){if(_0x1486('0x71')==typeof _0x4f2add[_0x1486('0x76')][_0x1486('0x7d')]){return _0x5eeaba(new Error(_0x1486('0x7e')));}if(_0x1486('0x71')==typeof _0x4f2add[_0x1486('0x76')][_0x1486('0x7f')]){return _0x5eeaba(new Error(_0x1486('0x80')));}}else{return _0x5eeaba(new Error(_0x1486('0x81')));}var _0x1d69f8=_0x4f2add[_0x1486('0x2f')];var _0x33f208=_0x4f2add[_0x1486('0x82')];var _0x2f50e7=_0x4f2add[_0x1486('0x35')];var _0x143acd=_0x4f2add[_0x1486('0x83')]?_0x4f2add[_0x1486('0x83')]:_0x1486('0x84');var _0x25fa0b=_0x4f2add[_0x1486('0x85')]?_0x4f2add[_0x1486('0x85')]:_0x1486('0x86');var _0x423062='';var _0x399341='';var _0x44c1d7='';var _0x3f9ae5='';var _0x8f05c9=_0x4f2add['version'];if(_0x2f50e7===_0x1486('0x78')){if('undefined'!=typeof _0x4f2add[_0x1486('0x76')]['views']['admin']){var _0x2aa1ff=_0x4f2add['parameters'][_0x1486('0x79')][_0x1486('0x87')];if(!/^(f|ht)tps?:\/\//i['test'](_0x2aa1ff)){_0x423062=path[_0x1486('0x4f')](_0x1486('0x88'),_0x3dbf13,_0x1dfde0[0x0],_0x2aa1ff);}else{_0x423062=_0x2aa1ff;}}else{logger[_0x1486('0x60')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x1486('0x71')!=typeof _0x4f2add[_0x1486('0x76')][_0x1486('0x79')]['agent']){var _0x3f4420=_0x4f2add[_0x1486('0x76')][_0x1486('0x79')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x1486('0x89')](_0x3f4420)){_0x399341=path[_0x1486('0x4f')](_0x1486('0x88'),_0x3dbf13,_0x1dfde0[0x0],_0x3f4420);}else{_0x399341=_0x3f4420;}}else{logger[_0x1486('0x60')](_0x1486('0x8a'));}}else if(_0x2f50e7===_0x1486('0x7c')){_0x44c1d7=_0x4f2add[_0x1486('0x76')][_0x1486('0x7d')];_0x3f9ae5=_0x4f2add[_0x1486('0x76')][_0x1486('0x7f')];if(_0x1486('0x71')!=typeof _0x4f2add[_0x1486('0x76')]['views']){if('undefined'!=typeof _0x4f2add[_0x1486('0x76')]['views']['admin']){var _0x2aa1ff=_0x4f2add[_0x1486('0x76')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x2aa1ff)){_0x423062=path[_0x1486('0x4f')](_0x1486('0x88'),_0x3dbf13,_0x1dfde0[0x0],_0x2aa1ff);}else{_0x423062=_0x2aa1ff;}}if(_0x1486('0x71')!=typeof _0x4f2add['parameters'][_0x1486('0x79')][_0x1486('0x7a')]){var _0x3f4420=_0x4f2add[_0x1486('0x76')][_0x1486('0x79')][_0x1486('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0x1486('0x89')](_0x3f4420)){_0x399341=path['join']('plugins',_0x3dbf13,_0x1dfde0[0x0],_0x3f4420);}else{_0x399341=_0x3f4420;}}}}var _0x5185f3={'name':_0x1d69f8,'description':_0x33f208,'path':path[_0x1486('0x4f')](_0x3dbf13,_0x1dfde0[0x0]),'type':_0x2f50e7,'sidebar':_0x143acd,'icon':_0x25fa0b,'adminUrl':_0x423062,'agentUrl':_0x399341,'scriptName':_0x44c1d7,'scriptPath':_0x3f9ae5,'version':_0x8f05c9};removeReferences(_0x512f7e,null);return db['Plugin'][_0x1486('0x8b')](_0x5185f3)['then'](function(_0x38af8c){var _0x1ba1f6={'role':_0x1aa0a3[_0x1486('0x8c')]['role'],'userProfileId':_0x1aa0a3['body'][_0x1486('0x8d')]};if(!_0x1ba1f6)throw new Error(_0x1486('0x8e'));if(_0x1ba1f6[_0x1486('0x8f')]===_0x1486('0x90')){var _0x4c8406=_0x38af8c[_0x1486('0x29')]({'plain':!![]});return db[_0x1486('0x91')]['find']({'where':{'name':_0x1486('0x2a'),'userProfileId':_0x1ba1f6[_0x1486('0x8d')]},'raw':!![]})[_0x1486('0x27')](function(_0x3695d0){if(_0x3695d0&&_0x3695d0[_0x1486('0x92')]===0x0){return db[_0x1486('0x2b')][_0x1486('0x8b')]({'name':_0x4c8406[_0x1486('0x2f')],'resourceId':_0x4c8406['id'],'type':_0x3695d0['name'],'sectionId':_0x3695d0['id']},{})[_0x1486('0x27')](function(){return _0x38af8c;});}else{return _0x38af8c;}})[_0x1486('0x4e')](function(_0x172268){logger[_0x1486('0x2d')](_0x1486('0x93'),_0x172268);throw _0x172268;});}return _0x38af8c;})[_0x1486('0x27')](respondWithResult(_0x3df384,null))[_0x1486('0x4e')](handleError(_0x3df384,null));}});}catch(_0x25c554){_0x3df384[_0x1486('0x21')](0x1f4)[_0x1486('0x30')](_0x25c554);}};function removeReferences(_0x77f3f,_0x26a117){try{if(_0x77f3f){fs[_0x1486('0x5f')](_0x77f3f);logger['info'](_0x1486('0x94'));}if(_0x26a117){rimraf(_0x26a117,function(){});logger['info'](_0x1486('0x95'));}}catch(_0x1de6e0){logger[_0x1486('0x2d')](_0x1de6e0);}}exports[_0x1486('0x26')]=function(_0x255e15,_0x2de016,_0x2c8b71){return db[_0x1486('0x33')][_0x1486('0x4d')]({'where':{'id':_0x255e15[_0x1486('0x4b')]['id']}})[_0x1486('0x27')](handleEntityNotFound(_0x2de016,null))['then'](saveUpdates(_0x255e15[_0x1486('0x8c')],null))[_0x1486('0x27')](respondWithResult(_0x2de016,null))[_0x1486('0x4e')](handleError(_0x2de016,null));};exports['delete']=function(_0x91ad70,_0x3061e9,_0x46ef30){return db['Plugin'][_0x1486('0x4d')]({'where':{'id':_0x91ad70[_0x1486('0x4b')]['id']}})['then'](function(_0x2bd185){if(_0x2bd185){return _0x2bd185[_0x1486('0x28')]();}})[_0x1486('0x27')](function(_0x49d322){rimraf(path['join'](config[_0x1486('0x50')],_0x1486('0x5a'),path[_0x1486('0x5b')](_0x49d322[_0x1486('0x9')])),function(){});return _0x49d322;})[_0x1486('0x27')](handleEntityNotFound(_0x3061e9,null))[_0x1486('0x27')](respondWithStatusCode(_0x3061e9,null))[_0x1486('0x4e')](handleError(_0x3061e9,null));};exports[_0x1486('0x96')]=function(_0x2462b9,_0x29186e,_0x552ac2){return BPromise[_0x1486('0x97')]()[_0x1486('0x27')](function(){if(!_0x2462b9[_0x1486('0x37')][_0x1486('0x9')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2462b9['query'][_0x1486('0x98')]){throw new Error(_0x1486('0x99'));}var _0x57bd76=_0x2462b9['query'][_0x1486('0x9a')]?_0x2462b9[_0x1486('0x37')][_0x1486('0x9a')]+':'+_0x2462b9[_0x1486('0x37')][_0x1486('0x98')]:_0x1486('0x9b')+_0x2462b9[_0x1486('0x37')][_0x1486('0x98')];var _0x1052e8=_0x2462b9['query'][_0x1486('0x23')]?_0x2462b9[_0x1486('0x37')][_0x1486('0x23')]:!![];var _0x4da5fb=_0x2462b9[_0x1486('0x37')]['encoding']?_0x2462b9['query']['encoding']:null;var _0x3102db={'method':_0x2462b9[_0x1486('0x9c')],'uri':util[_0x1486('0x51')](_0x1486('0x9d'),_0x57bd76,_0x2462b9['query'][_0x1486('0x9')]),'json':_0x1052e8,'resolveWithFullResponse':!![],'encoding':_0x4da5fb,'qs':_0x2462b9[_0x1486('0x37')]};if(_0x2462b9[_0x1486('0x9e')]){_0x3102db[_0x1486('0x9e')]=_0x2462b9['headers'];if(_0x3102db[_0x1486('0x9e')][_0x1486('0x9f')]){delete _0x3102db[_0x1486('0x9e')]['content-length'];}}if(_0x3102db[_0x1486('0x9e')]['content-type']){delete _0x3102db['headers'][_0x1486('0xa0')];}return rp(_0x3102db);})[_0x1486('0x27')](function(_0x43faff){if(_0x43faff){_0x29186e[_0x1486('0xa1')](_0x43faff[_0x1486('0x9e')]);logger['info'](_0x43faff['body']);if(_[_0x1486('0xa2')](_0x2462b9[_0x1486('0x37')]['path'],_0x1486('0x5d'))&&_0x43faff[_0x1486('0xa3')]==0x1f4){return _0x29186e[_0x1486('0x20')](_0x43faff[_0x1486('0xa3')]);}else{return _0x29186e['status'](_0x43faff[_0x1486('0xa3')])[_0x1486('0x30')](_0x43faff[_0x1486('0x8c')]);}}else{return _0x29186e[_0x1486('0x20')](0xc8);}})['catch'](handleError(_0x29186e,null));};exports['webhookPost']=function(_0x1de981,_0x531430,_0x44b7fa){return BPromise[_0x1486('0x97')]()[_0x1486('0x27')](function(){if(!_0x1de981['query'][_0x1486('0x9')]){throw new Error(_0x1486('0xa4'));}if(!_0x1de981[_0x1486('0x37')]['port']){throw new Error(_0x1486('0x99'));}var _0x3fccfa=_0x1de981['query'][_0x1486('0x9a')]?_0x1de981[_0x1486('0x37')][_0x1486('0x9a')]+':'+_0x1de981[_0x1486('0x37')][_0x1486('0x98')]:'http://localhost:'+_0x1de981['query'][_0x1486('0x98')];var _0x556511=_0x1de981[_0x1486('0x37')][_0x1486('0x23')]?_0x1de981['query'][_0x1486('0x23')]:!![];var _0x488315=_0x1de981[_0x1486('0x37')][_0x1486('0xa5')]?_0x1de981[_0x1486('0x37')][_0x1486('0xa5')]:null;var _0x3e5ded={'method':_0x1de981['method'],'uri':util[_0x1486('0x51')]('%s%s',_0x3fccfa,_0x1de981['query'][_0x1486('0x9')]),'json':_0x556511,'resolveWithFullResponse':!![],'encoding':_0x488315,'body':_0x1de981[_0x1486('0x8c')]};if(_0x1de981[_0x1486('0x9e')]){_0x3e5ded['headers']=_0x1de981[_0x1486('0x9e')];if(_0x3e5ded[_0x1486('0x9e')][_0x1486('0x9f')]){delete _0x3e5ded[_0x1486('0x9e')][_0x1486('0x9f')];}}if(_0x3e5ded[_0x1486('0x9e')]['content-type']){delete _0x3e5ded[_0x1486('0x9e')][_0x1486('0xa0')];}return rp(_0x3e5ded);})[_0x1486('0x27')](function(_0x463a7a){if(_0x463a7a){_0x531430[_0x1486('0xa1')](_0x463a7a[_0x1486('0x9e')]);logger[_0x1486('0x60')](_0x463a7a[_0x1486('0x8c')]);return _0x531430[_0x1486('0x21')](_0x463a7a[_0x1486('0xa3')])[_0x1486('0x30')](_0x463a7a[_0x1486('0x8c')]);}else{return _0x531430[_0x1486('0x20')](0xc8);}})[_0x1486('0x4e')](handleError(_0x531430,null));}; \ No newline at end of file +var _0x3317=['Zip\x20archive\x20removed','delete','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','\x27PATH\x27\x20parameter\x20not\x20specified','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','./plugin.socket','register','status','end','json','limit','set','Content-Range','update','then','destroy','Plugins','UserProfileResource','sendStatus','error','stack','name','send','index','map','Plugin','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','offset','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','show','params','find','catch','path','server/files/plugins','format','%s.zip','createWriteStream','warning','code','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','join','root','dirname','node_modules/**/*','basename','attachments/**/*','finalize','close','existsSync','Error','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','info','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','sidebar','always','icon','icon-apps','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create'];(function(_0x4a9beb,_0x159482){var _0x2d4c58=function(_0x28dabf){while(--_0x28dabf){_0x4a9beb['push'](_0x4a9beb['shift']());}};_0x2d4c58(++_0x159482);}(_0x3317,0xb5));var _0x7331=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x3317[_0x1969a7];return _0x3d665f;};'use strict';var pdf=require(_0x7331('0x0'));var emlformat=require(_0x7331('0x1'));var rimraf=require(_0x7331('0x2'));var zipdir=require(_0x7331('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7331('0x4'));var moment=require(_0x7331('0x5'));var BPromise=require(_0x7331('0x6'));var Mustache=require(_0x7331('0x7'));var util=require('util');var path=require('path');var sox=require(_0x7331('0x8'));var csv=require(_0x7331('0x9'));var ejs=require(_0x7331('0xa'));var fs=require('fs');var _=require(_0x7331('0xb'));var squel=require(_0x7331('0xc'));var crypto=require(_0x7331('0xd'));var jsforce=require(_0x7331('0xe'));var deskjs=require(_0x7331('0xf'));var toCsv=require(_0x7331('0x9'));var querystring=require(_0x7331('0x10'));var Papa=require(_0x7331('0x11'));var extract=require(_0x7331('0x12'));var rimraf=require(_0x7331('0x2'));var archiver=require(_0x7331('0x13'));var Redis=require(_0x7331('0x14'));var authService=require(_0x7331('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x7331('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7331('0x17'))(_0x7331('0x18'));var utils=require(_0x7331('0x19'));var config=require('../../config/environment');var db=require(_0x7331('0x1a'))['db'];config[_0x7331('0x1b')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7331('0x1b')]));require(_0x7331('0x1c'))[_0x7331('0x1d')](socket);function respondWithStatusCode(_0x55730d,_0x1258d0){_0x1258d0=_0x1258d0||0xcc;return function(_0x1f41cd){if(_0x1f41cd){return _0x55730d['sendStatus'](_0x1258d0);}return _0x55730d[_0x7331('0x1e')](_0x1258d0)[_0x7331('0x1f')]();};}function respondWithResult(_0x33af86,_0x4ded14){_0x4ded14=_0x4ded14||0xc8;return function(_0x3c38ff){if(_0x3c38ff){return _0x33af86[_0x7331('0x1e')](_0x4ded14)[_0x7331('0x20')](_0x3c38ff);}};}function respondWithFilteredResult(_0x3264ef,_0x27782b){return function(_0x320294){if(_0x320294){var _0xacce5f=_0x320294['count'],_0x1f7da8=_0x27782b['offset'],_0x42fd35=_0x27782b['offset']+_0x27782b[_0x7331('0x21')],_0x21ae20;if(_0x42fd35>=_0xacce5f){_0x42fd35=_0xacce5f;_0x21ae20=0xc8;}else{_0x21ae20=0xce;}_0x3264ef['status'](_0x21ae20);return _0x3264ef[_0x7331('0x22')](_0x7331('0x23'),_0x1f7da8+'-'+_0x42fd35+'/'+_0xacce5f)[_0x7331('0x20')](_0x320294);}return null;};}function patchUpdates(_0x552013){return function(_0x553f45){try{jsonpatch['apply'](_0x553f45,_0x552013,!![]);}catch(_0x2db2f1){return BPromise['reject'](_0x2db2f1);}return _0x553f45['save']();};}function saveUpdates(_0x4b350f,_0x4db88){return function(_0x30bb92){if(_0x30bb92){return _0x30bb92[_0x7331('0x24')](_0x4b350f)[_0x7331('0x25')](function(_0x37d123){return _0x37d123;});}return null;};}function removeEntity(_0x34ed4b,_0x5a90de){return function(_0x185f78){if(_0x185f78){return _0x185f78[_0x7331('0x26')]()[_0x7331('0x25')](function(){var _0x476e1e=_0x185f78['get']({'plain':!![]});var _0x57004f=_0x7331('0x27');return db[_0x7331('0x28')][_0x7331('0x26')]({'where':{'type':_0x57004f,'resourceId':_0x476e1e['id']}})[_0x7331('0x25')](function(){return _0x185f78;});})[_0x7331('0x25')](function(){_0x34ed4b[_0x7331('0x1e')](0xcc)[_0x7331('0x1f')]();});}};}function handleEntityNotFound(_0xa8adec,_0x34c22d){return function(_0x54c17d){if(!_0x54c17d){_0xa8adec[_0x7331('0x29')](0x194);}return _0x54c17d;};}function handleError(_0x4d0282,_0x1c37bc){_0x1c37bc=_0x1c37bc||0x1f4;return function(_0x39c07f){logger[_0x7331('0x2a')](_0x39c07f[_0x7331('0x2b')]);if(_0x39c07f[_0x7331('0x2c')]){delete _0x39c07f['name'];}_0x4d0282[_0x7331('0x1e')](_0x1c37bc)[_0x7331('0x2d')](_0x39c07f);};}exports[_0x7331('0x2e')]=function(_0x64f3d2,_0x4042e1){var _0x4b6059={},_0xc9acbc={},_0x514a36={'count':0x0,'rows':[]};var _0x49f690=_[_0x7331('0x2f')](db[_0x7331('0x30')][_0x7331('0x31')],function(_0x1cb3d9){return{'name':_0x1cb3d9['fieldName'],'type':_0x1cb3d9[_0x7331('0x32')][_0x7331('0x33')]};});_0xc9acbc[_0x7331('0x34')]=_[_0x7331('0x2f')](_0x49f690,_0x7331('0x2c'));_0xc9acbc[_0x7331('0x35')]=_[_0x7331('0x36')](_0x64f3d2[_0x7331('0x35')]);_0xc9acbc[_0x7331('0x37')]=_[_0x7331('0x38')](_0xc9acbc[_0x7331('0x34')],_0xc9acbc['query']);_0x4b6059['attributes']=_[_0x7331('0x38')](_0xc9acbc[_0x7331('0x34')],qs[_0x7331('0x39')](_0x64f3d2['query']['fields']));_0x4b6059[_0x7331('0x3a')]=_0x4b6059[_0x7331('0x3a')][_0x7331('0x3b')]?_0x4b6059[_0x7331('0x3a')]:_0xc9acbc[_0x7331('0x34')];if(!_0x64f3d2[_0x7331('0x35')][_0x7331('0x3c')]('nolimit')){_0x4b6059[_0x7331('0x21')]=qs[_0x7331('0x21')](_0x64f3d2[_0x7331('0x35')][_0x7331('0x21')]);_0x4b6059[_0x7331('0x3d')]=qs[_0x7331('0x3d')](_0x64f3d2[_0x7331('0x35')][_0x7331('0x3d')]);}_0x4b6059['order']=qs[_0x7331('0x3e')](_0x64f3d2[_0x7331('0x35')][_0x7331('0x3e')]);_0x4b6059[_0x7331('0x3f')]=qs[_0x7331('0x37')](_[_0x7331('0x40')](_0x64f3d2[_0x7331('0x35')],_0xc9acbc['filters']));if(_0x64f3d2[_0x7331('0x35')][_0x7331('0x41')]){_0x4b6059[_0x7331('0x3f')]=_['merge'](_0x4b6059[_0x7331('0x3f')],{'$or':_[_0x7331('0x2f')](_0x49f690,function(_0x3ee93f){if(_0x3ee93f[_0x7331('0x32')]!==_0x7331('0x42')){var _0x22f92e={};_0x22f92e[_0x3ee93f[_0x7331('0x2c')]]={'$like':'%'+_0x64f3d2[_0x7331('0x35')][_0x7331('0x41')]+'%'};return _0x22f92e;}})});}_0x4b6059=_[_0x7331('0x43')]({},_0x4b6059,_0x64f3d2[_0x7331('0x44')]);var _0x49bd93={'where':_0x4b6059[_0x7331('0x3f')]};return db[_0x7331('0x30')][_0x7331('0x45')](_0x49bd93)[_0x7331('0x25')](function(_0x13555c){_0x514a36[_0x7331('0x45')]=_0x13555c;if(_0x64f3d2[_0x7331('0x35')][_0x7331('0x46')]){_0x4b6059[_0x7331('0x47')]=[{'all':!![]}];}return db[_0x7331('0x30')][_0x7331('0x48')](_0x4b6059);})[_0x7331('0x25')](function(_0xac490d){_0x514a36[_0x7331('0x49')]=_0xac490d;return _0x514a36;})[_0x7331('0x25')](respondWithFilteredResult(_0x4042e1,_0x4b6059))['catch'](handleError(_0x4042e1,null));};exports[_0x7331('0x4a')]=function(_0x1247c0,_0x596a34){var _0x4a4843={'raw':!![],'where':{'id':_0x1247c0[_0x7331('0x4b')]['id']}},_0x50814b={};_0x50814b['model']=_[_0x7331('0x36')](db['Plugin']['rawAttributes']);_0x50814b[_0x7331('0x35')]=_[_0x7331('0x36')](_0x1247c0[_0x7331('0x35')]);_0x50814b[_0x7331('0x37')]=_[_0x7331('0x38')](_0x50814b[_0x7331('0x34')],_0x50814b[_0x7331('0x35')]);_0x4a4843[_0x7331('0x3a')]=_[_0x7331('0x38')](_0x50814b['model'],qs[_0x7331('0x39')](_0x1247c0[_0x7331('0x35')][_0x7331('0x39')]));_0x4a4843[_0x7331('0x3a')]=_0x4a4843[_0x7331('0x3a')][_0x7331('0x3b')]?_0x4a4843['attributes']:_0x50814b[_0x7331('0x34')];if(_0x1247c0[_0x7331('0x35')][_0x7331('0x46')]){_0x4a4843[_0x7331('0x47')]=[{'all':!![]}];}_0x4a4843=_[_0x7331('0x43')]({},_0x4a4843,_0x1247c0[_0x7331('0x44')]);return db[_0x7331('0x30')][_0x7331('0x4c')](_0x4a4843)[_0x7331('0x25')](handleEntityNotFound(_0x596a34,null))['then'](respondWithResult(_0x596a34,null))[_0x7331('0x4d')](handleError(_0x596a34,null));};exports['download']=function(_0x32e8e5,_0x374890,_0x4f8e71){return db['Plugin']['find']({'where':{'id':_0x32e8e5[_0x7331('0x4b')]['id']},'attributes':[_0x7331('0x2c'),_0x7331('0x4e')],'raw':!![]})[_0x7331('0x25')](handleEntityNotFound(_0x374890,null))[_0x7331('0x25')](function(_0x1d1243){if(_0x1d1243){var _0x4c90cb=path['join'](config['root'],_0x7331('0x4f'),util[_0x7331('0x50')](_0x7331('0x51'),path['basename'](_0x1d1243[_0x7331('0x4e')])));var _0x5750e1=fs[_0x7331('0x52')](_0x4c90cb);var _0x1b8a56=archiver('zip',{'zlib':{'level':0x9}});_0x1b8a56['on'](_0x7331('0x53'),function(_0x36a047){if(_0x36a047[_0x7331('0x54')]==='ENOENT'){logger[_0x7331('0x2a')](_0x36a047);}else{throw new db[(_0x7331('0x55'))]['Error'](_0x7331('0x56'));}});_0x1b8a56['on'](_0x7331('0x2a'),function(_0x2a04c7){throw new db[(_0x7331('0x55'))]['Error'](_0x7331('0x56'));});_0x1b8a56[_0x7331('0x57')](_0x5750e1);_0x1b8a56[_0x7331('0x58')](_0x7331('0x59'),{'cwd':path[_0x7331('0x5a')](config[_0x7331('0x5b')],_0x7331('0x4f'),path[_0x7331('0x5c')](_0x1d1243[_0x7331('0x4e')])),'ignore':[path[_0x7331('0x5a')](path['basename'](_0x1d1243[_0x7331('0x4e')]),_0x7331('0x5d')),path[_0x7331('0x5a')](path[_0x7331('0x5e')](_0x1d1243[_0x7331('0x4e')]),_0x7331('0x5f'))],'nodir':!![]})[_0x7331('0x60')]();_0x5750e1['on'](_0x7331('0x61'),function(){if(!fs[_0x7331('0x62')](_0x4c90cb)){throw new db[(_0x7331('0x55'))][(_0x7331('0x63'))](_0x7331('0x64'));}return _0x374890[_0x7331('0x65')](_0x4c90cb,util[_0x7331('0x50')]('%s.zip',path[_0x7331('0x5e')](_0x1d1243[_0x7331('0x4e')])),function(_0x4932b0){if(_0x4932b0){throw new db[(_0x7331('0x55'))]['Error'](_0x7331('0x66'));}fs[_0x7331('0x67')](_0x4c90cb);logger['info'](_0x7331('0x68'));logger['info'](_0x7331('0x69'));});});}return null;})['catch'](handleError(_0x374890,null));};exports[_0x7331('0x6a')]=function(_0x3f7eec,_0x225b51,_0x565a5b){var _0x6db135=path[_0x7331('0x5e')](_0x3f7eec[_0x7331('0x6b')][_0x7331('0x6c')],path[_0x7331('0x6d')](_0x3f7eec[_0x7331('0x6b')]['filename']));var _0x2ec596=path['join'](config['root'],_0x7331('0x4f'),_0x3f7eec[_0x7331('0x6b')][_0x7331('0x6c')]);var _0x216ca9=path[_0x7331('0x5a')](config[_0x7331('0x5b')],_0x7331('0x4f'),_0x6db135);logger['info'](_0x7331('0x6e'),_0x2ec596);logger[_0x7331('0x6f')]('Plugin\x20upload\x20destination:\x20%s',_0x216ca9);try{fs[_0x7331('0x70')](_0x2ec596,parseInt(_0x7331('0x71'),0x8));extract(_0x2ec596,{'dir':_0x216ca9},function(_0xc5303f){if(_0xc5303f){logger['error'](_0xc5303f);handleError(_0xc5303f,!![]);};var _0x6b33bb=fs[_0x7331('0x72')](_0x216ca9);if(_0x6b33bb[_0x7331('0x3b')]>0x1){removeReferences(_0x2ec596,_0x216ca9);logger[_0x7331('0x2a')](_0x7331('0x73'));return _0x565a5b(new Error(_0x7331('0x73')));}var _0x18daa4=fs['lstatSync'](path[_0x7331('0x5a')](_0x216ca9,_0x6b33bb[0x0]));if(_0x18daa4[_0x7331('0x74')]()){removeReferences(_0x2ec596,_0x216ca9);logger[_0x7331('0x2a')]('Invalid\x20plugin\x20structure');return _0x565a5b(new Error(_0x7331('0x73')));}if(_0x18daa4['isDirectory']()){var _0x4ee575=fs['readdirSync'](path['join'](_0x216ca9,_0x6b33bb[0x0]));if(_0x4ee575[_0x7331('0x3b')]===0x0){removeReferences(_0x2ec596,_0x216ca9);logger[_0x7331('0x2a')](_0x7331('0x73'));return _0x565a5b(new Error(_0x7331('0x73')));}var _0x13a848=_0x4ee575[_0x7331('0x75')](function(_0x388871){return _0x388871===_0x7331('0x76');});if(!_0x13a848){return _0x565a5b(new Error(_0x7331('0x77')));}var _0x3a179c=fs[_0x7331('0x78')](path['join'](_0x216ca9,_0x6b33bb[0x0],_0x7331('0x76')));var _0x1820a0=JSON[_0x7331('0x79')](_0x3a179c);if(_0x7331('0x7a')==typeof _0x1820a0[_0x7331('0x2c')]){return _0x565a5b(new Error(_0x7331('0x7b')));}if('undefined'==typeof _0x1820a0[_0x7331('0x32')]){return _0x565a5b(new Error(_0x7331('0x7c')));}if('undefined'==typeof _0x1820a0[_0x7331('0x7d')]){return _0x565a5b(new Error(_0x7331('0x7e')));}if(_0x7331('0x7a')==typeof _0x1820a0[_0x7331('0x7f')]){return _0x565a5b(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x1820a0[_0x7331('0x32')]===_0x7331('0x80')){if(_0x7331('0x7a')==typeof _0x1820a0[_0x7331('0x7f')][_0x7331('0x81')]){return _0x565a5b(new Error(_0x7331('0x82')));}if(_0x7331('0x7a')==typeof _0x1820a0[_0x7331('0x7f')][_0x7331('0x81')]['admin']&&_0x7331('0x7a')==typeof _0x1820a0[_0x7331('0x7f')][_0x7331('0x81')]['agent']){return _0x565a5b(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x1820a0['type']===_0x7331('0x83')){if(_0x7331('0x7a')==typeof _0x1820a0[_0x7331('0x7f')][_0x7331('0x84')]){return _0x565a5b(new Error(_0x7331('0x85')));}if(_0x7331('0x7a')==typeof _0x1820a0['parameters'][_0x7331('0x86')]){return _0x565a5b(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x565a5b(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0xc9f5ad=_0x1820a0[_0x7331('0x2c')];var _0x1c09cc=_0x1820a0['description'];var _0x33ad03=_0x1820a0[_0x7331('0x32')];var _0x1cb611=_0x1820a0['sidebar']?_0x1820a0[_0x7331('0x87')]:_0x7331('0x88');var _0x561b85=_0x1820a0[_0x7331('0x89')]?_0x1820a0[_0x7331('0x89')]:_0x7331('0x8a');var _0x237ed6='';var _0x776c5d='';var _0x47675c='';var _0x5ab9f2='';var _0x5d9f88=_0x1820a0[_0x7331('0x7d')];if(_0x33ad03===_0x7331('0x80')){if(_0x7331('0x7a')!=typeof _0x1820a0['parameters'][_0x7331('0x81')]['admin']){var _0x5aac15=_0x1820a0[_0x7331('0x7f')][_0x7331('0x81')][_0x7331('0x8b')];if(!/^(f|ht)tps?:\/\//i[_0x7331('0x8c')](_0x5aac15)){_0x237ed6=path[_0x7331('0x5a')](_0x7331('0x8d'),_0x6db135,_0x6b33bb[0x0],_0x5aac15);}else{_0x237ed6=_0x5aac15;}}else{logger[_0x7331('0x6f')](_0x7331('0x8e'));}if(_0x7331('0x7a')!=typeof _0x1820a0['parameters'][_0x7331('0x81')][_0x7331('0x8f')]){var _0x500f7e=_0x1820a0[_0x7331('0x7f')][_0x7331('0x81')][_0x7331('0x8f')];if(!/^(f|ht)tps?:\/\//i['test'](_0x500f7e)){_0x776c5d=path['join']('plugins',_0x6db135,_0x6b33bb[0x0],_0x500f7e);}else{_0x776c5d=_0x500f7e;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x33ad03===_0x7331('0x83')){_0x47675c=_0x1820a0['parameters'][_0x7331('0x84')];_0x5ab9f2=_0x1820a0['parameters']['scriptPath'];if(_0x7331('0x7a')!=typeof _0x1820a0[_0x7331('0x7f')][_0x7331('0x81')]){if('undefined'!=typeof _0x1820a0[_0x7331('0x7f')][_0x7331('0x81')]['admin']){var _0x5aac15=_0x1820a0[_0x7331('0x7f')][_0x7331('0x81')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x7331('0x8c')](_0x5aac15)){_0x237ed6=path[_0x7331('0x5a')](_0x7331('0x8d'),_0x6db135,_0x6b33bb[0x0],_0x5aac15);}else{_0x237ed6=_0x5aac15;}}if(_0x7331('0x7a')!=typeof _0x1820a0['parameters'][_0x7331('0x81')][_0x7331('0x8f')]){var _0x500f7e=_0x1820a0[_0x7331('0x7f')][_0x7331('0x81')][_0x7331('0x8f')];if(!/^(f|ht)tps?:\/\//i['test'](_0x500f7e)){_0x776c5d=path['join'](_0x7331('0x8d'),_0x6db135,_0x6b33bb[0x0],_0x500f7e);}else{_0x776c5d=_0x500f7e;}}}}var _0x36729a={'name':_0xc9f5ad,'description':_0x1c09cc,'path':path[_0x7331('0x5a')](_0x6db135,_0x6b33bb[0x0]),'type':_0x33ad03,'sidebar':_0x1cb611,'icon':_0x561b85,'adminUrl':_0x237ed6,'agentUrl':_0x776c5d,'scriptName':_0x47675c,'scriptPath':_0x5ab9f2,'version':_0x5d9f88};removeReferences(_0x2ec596,null);return db[_0x7331('0x30')]['create'](_0x36729a)[_0x7331('0x25')](function(_0x11e921){var _0x152d94={'role':_0x3f7eec['body']['role'],'userProfileId':_0x3f7eec[_0x7331('0x90')][_0x7331('0x91')]};if(!_0x152d94)throw new Error(_0x7331('0x92'));if(_0x152d94[_0x7331('0x93')]==='user'){var _0x222039=_0x11e921['get']({'plain':!![]});return db[_0x7331('0x94')]['find']({'where':{'name':_0x7331('0x27'),'userProfileId':_0x152d94[_0x7331('0x91')]},'raw':!![]})[_0x7331('0x25')](function(_0x3bda26){if(_0x3bda26&&_0x3bda26[_0x7331('0x95')]===0x0){return db[_0x7331('0x28')][_0x7331('0x96')]({'name':_0x222039[_0x7331('0x2c')],'resourceId':_0x222039['id'],'type':_0x3bda26[_0x7331('0x2c')],'sectionId':_0x3bda26['id']},{})['then'](function(){return _0x11e921;});}else{return _0x11e921;}})[_0x7331('0x4d')](function(_0xb33dc9){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb33dc9);throw _0xb33dc9;});}return _0x11e921;})[_0x7331('0x25')](respondWithResult(_0x225b51,null))['catch'](handleError(_0x225b51,null));}});}catch(_0xd9df9c){_0x225b51[_0x7331('0x1e')](0x1f4)[_0x7331('0x2d')](_0xd9df9c);}};function removeReferences(_0x64208,_0xccfa70){try{if(_0x64208){fs[_0x7331('0x67')](_0x64208);logger[_0x7331('0x6f')](_0x7331('0x97'));}if(_0xccfa70){rimraf(_0xccfa70,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0x3d9476){logger[_0x7331('0x2a')](_0x3d9476);}}exports[_0x7331('0x24')]=function(_0x5753a0,_0x2fe1bb,_0x18c3fa){return db[_0x7331('0x30')]['find']({'where':{'id':_0x5753a0['params']['id']}})['then'](handleEntityNotFound(_0x2fe1bb,null))[_0x7331('0x25')](saveUpdates(_0x5753a0[_0x7331('0x90')],null))[_0x7331('0x25')](respondWithResult(_0x2fe1bb,null))[_0x7331('0x4d')](handleError(_0x2fe1bb,null));};exports[_0x7331('0x98')]=function(_0x1286c1,_0x18460c,_0xe4647a){return db['Plugin']['find']({'where':{'id':_0x1286c1[_0x7331('0x4b')]['id']}})[_0x7331('0x25')](function(_0x232f28){if(_0x232f28){return _0x232f28[_0x7331('0x26')]();}})['then'](function(_0x1de1f7){rimraf(path[_0x7331('0x5a')](config[_0x7331('0x5b')],_0x7331('0x4f'),path[_0x7331('0x5c')](_0x1de1f7[_0x7331('0x4e')])),function(){});return _0x1de1f7;})[_0x7331('0x25')](handleEntityNotFound(_0x18460c,null))['then'](respondWithStatusCode(_0x18460c,null))[_0x7331('0x4d')](handleError(_0x18460c,null));};exports['webhookGet']=function(_0x20198f,_0x2461ec,_0x1ca03e){return BPromise['resolve']()['then'](function(){if(!_0x20198f[_0x7331('0x35')][_0x7331('0x4e')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x20198f[_0x7331('0x35')][_0x7331('0x99')]){throw new Error(_0x7331('0x9a'));}var _0x4ce96d=_0x20198f['query'][_0x7331('0x9b')]?_0x20198f[_0x7331('0x35')][_0x7331('0x9b')]+':'+_0x20198f[_0x7331('0x35')][_0x7331('0x99')]:_0x7331('0x9c')+_0x20198f[_0x7331('0x35')][_0x7331('0x99')];var _0x400096=_0x20198f[_0x7331('0x35')][_0x7331('0x20')]?_0x20198f[_0x7331('0x35')][_0x7331('0x20')]:!![];var _0x8c8a30=_0x20198f[_0x7331('0x35')]['encoding']?_0x20198f['query'][_0x7331('0x9d')]:null;var _0x2c1faa={'method':_0x20198f[_0x7331('0x9e')],'uri':util[_0x7331('0x50')](_0x7331('0x9f'),_0x4ce96d,_0x20198f[_0x7331('0x35')][_0x7331('0x4e')]),'json':_0x400096,'resolveWithFullResponse':!![],'encoding':_0x8c8a30,'qs':_0x20198f['query']};if(_0x20198f[_0x7331('0xa0')]){_0x2c1faa[_0x7331('0xa0')]=_0x20198f[_0x7331('0xa0')];if(_0x2c1faa['headers'][_0x7331('0xa1')]){delete _0x2c1faa[_0x7331('0xa0')]['content-length'];}}if(_0x2c1faa['headers']['content-type']){delete _0x2c1faa[_0x7331('0xa0')][_0x7331('0xa2')];}return rp(_0x2c1faa);})[_0x7331('0x25')](function(_0x58405d){if(_0x58405d){_0x2461ec[_0x7331('0x22')](_0x58405d[_0x7331('0xa0')]);logger[_0x7331('0x6f')](_0x58405d[_0x7331('0x90')]);if(_[_0x7331('0xa3')](_0x20198f[_0x7331('0x35')][_0x7331('0x4e')],_0x7331('0x65'))&&_0x58405d['statusCode']==0x1f4){return _0x2461ec[_0x7331('0x29')](_0x58405d['statusCode']);}else{return _0x2461ec[_0x7331('0x1e')](_0x58405d[_0x7331('0xa4')])[_0x7331('0x2d')](_0x58405d[_0x7331('0x90')]);}}else{return _0x2461ec['sendStatus'](0xc8);}})['catch'](handleError(_0x2461ec,null));};exports['webhookPost']=function(_0x3ff5dd,_0x4e30aa,_0x5875da){return BPromise['resolve']()[_0x7331('0x25')](function(){if(!_0x3ff5dd[_0x7331('0x35')][_0x7331('0x4e')]){throw new Error(_0x7331('0xa5'));}if(!_0x3ff5dd[_0x7331('0x35')][_0x7331('0x99')]){throw new Error(_0x7331('0x9a'));}var _0x3f31bc=_0x3ff5dd[_0x7331('0x35')][_0x7331('0x9b')]?_0x3ff5dd[_0x7331('0x35')][_0x7331('0x9b')]+':'+_0x3ff5dd[_0x7331('0x35')][_0x7331('0x99')]:'http://localhost:'+_0x3ff5dd[_0x7331('0x35')][_0x7331('0x99')];var _0x3adf00=_0x3ff5dd[_0x7331('0x35')][_0x7331('0x20')]?_0x3ff5dd[_0x7331('0x35')][_0x7331('0x20')]:!![];var _0x29046b=_0x3ff5dd[_0x7331('0x35')][_0x7331('0x9d')]?_0x3ff5dd[_0x7331('0x35')][_0x7331('0x9d')]:null;var _0x497c95={'method':_0x3ff5dd[_0x7331('0x9e')],'uri':util[_0x7331('0x50')](_0x7331('0x9f'),_0x3f31bc,_0x3ff5dd[_0x7331('0x35')][_0x7331('0x4e')]),'json':_0x3adf00,'resolveWithFullResponse':!![],'encoding':_0x29046b,'body':_0x3ff5dd[_0x7331('0x90')]};if(_0x3ff5dd[_0x7331('0xa0')]){_0x497c95[_0x7331('0xa0')]=_0x3ff5dd['headers'];if(_0x497c95['headers']['content-length']){delete _0x497c95['headers'][_0x7331('0xa1')];}}if(_0x497c95[_0x7331('0xa0')][_0x7331('0xa2')]){delete _0x497c95[_0x7331('0xa0')][_0x7331('0xa2')];}return rp(_0x497c95);})[_0x7331('0x25')](function(_0x265283){if(_0x265283){_0x4e30aa[_0x7331('0x22')](_0x265283[_0x7331('0xa0')]);logger[_0x7331('0x6f')](_0x265283['body']);return _0x4e30aa['status'](_0x265283[_0x7331('0xa4')])[_0x7331('0x2d')](_0x265283[_0x7331('0x90')]);}else{return _0x4e30aa['sendStatus'](0xc8);}})['catch'](handleError(_0x4e30aa,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 0c44776..756f81f 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 _0x955f=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','Plugin','setMaxListeners'];(function(_0x3f81f8,_0x2bf739){var _0x22b24a=function(_0x331859){while(--_0x331859){_0x3f81f8['push'](_0x3f81f8['shift']());}};_0x22b24a(++_0x2bf739);}(_0x955f,0x1eb));var _0xf955=function(_0x123061,_0x482851){_0x123061=_0x123061-0x0;var _0x51804c=_0x955f[_0x123061];return _0x51804c;};'use strict';var EventEmitter=require(_0xf955('0x0'));var Plugin=require(_0xf955('0x1'))['db'][_0xf955('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xf955('0x3')](0x0);var events={'afterCreate':_0xf955('0x4'),'afterUpdate':'update','afterDestroy':_0xf955('0x5')};function emitEvent(_0x5655ef){return function(_0x5d0c95,_0x1db0dd,_0x5a20bc){PluginEvents[_0xf955('0x6')](_0x5655ef+':'+_0x5d0c95['id'],_0x5d0c95);PluginEvents[_0xf955('0x6')](_0x5655ef,_0x5d0c95);_0x5a20bc(null);};}for(var e in events){if(events[_0xf955('0x7')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xf955('0x8')]=PluginEvents; \ No newline at end of file +var _0x4325=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4325,0x1da));var _0x5432=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4325[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0x5432('0x0'));var Plugin=require(_0x5432('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x5432('0x2')](0x0);var events={'afterCreate':_0x5432('0x3'),'afterUpdate':_0x5432('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4fc4e9){return function(_0x20f704,_0x36ce53,_0xad26e9){PluginEvents['emit'](_0x4fc4e9+':'+_0x20f704['id'],_0x20f704);PluginEvents[_0x5432('0x5')](_0x4fc4e9,_0x20f704);_0xad26e9(null);};}for(var e in events){if(events[_0x5432('0x6')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x5432('0x7')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 1bab031..54a7291 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 _0x8958=['define','Plugin','plugins','util','request-promise','rimraf','../../config/environment','./plugin.attributes'];(function(_0x49018d,_0x158e6b){var _0x3276b9=function(_0xa01d6e){while(--_0xa01d6e){_0x49018d['push'](_0x49018d['shift']());}};_0x3276b9(++_0x158e6b);}(_0x8958,0x93));var _0x8895=function(_0x15de03,_0xa8db94){_0x15de03=_0x15de03-0x0;var _0x348286=_0x8958[_0x15de03];return _0x348286;};'use strict';var _=require('lodash');var util=require(_0x8895('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8895('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8895('0x2'));var config=require(_0x8895('0x3'));var attributes=require(_0x8895('0x4'));module['exports']=function(_0x22fa52,_0x2f03ad){return _0x22fa52[_0x8895('0x5')](_0x8895('0x6'),attributes,{'tableName':_0x8895('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c5a=['define','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x1393cc,_0x1cfaf6){var _0x20da00=function(_0x4ea302){while(--_0x4ea302){_0x1393cc['push'](_0x1393cc['shift']());}};_0x20da00(++_0x1cfaf6);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x5cc828,_0x276eaa){_0x5cc828=_0x5cc828-0x0;var _0x5021f9=_0x9c5a[_0x5cc828];return _0x5021f9;};'use strict';var _=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var logger=require('../../config/logger')(_0xa9c5('0x2'));var moment=require(_0xa9c5('0x3'));var BPromise=require(_0xa9c5('0x4'));var rp=require(_0xa9c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var attributes=require('./plugin.attributes');module[_0xa9c5('0x8')]=function(_0x4d9c7a,_0x394d84){return _0x4d9c7a[_0xa9c5('0x9')]('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index dd239cf..2c1c016 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 _0xc3da=['info','result','catch','Plugin','create','body','options','raw','CreatePlugin','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','register','request','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc3da,0xf9));var _0xac3d=function(_0x8aec06,_0x3d5724){_0x8aec06=_0x8aec06-0x0;var _0x4c3613=_0xc3da[_0x8aec06];return _0x4c3613;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xac3d('0x0'));var BPromise=require(_0xac3d('0x1'));var rs=require(_0xac3d('0x2'));var fs=require('fs');var Redis=require(_0xac3d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xac3d('0x4'));var logger=require('../../config/logger')(_0xac3d('0x5'));var config=require('../../config/environment');var jayson=require(_0xac3d('0x6'));var client=jayson[_0xac3d('0x7')]['http']({'port':0x232a});config['redis']=_[_0xac3d('0x8')](config['redis'],{'host':_0xac3d('0x9'),'port':0x18eb});var socket=require(_0xac3d('0xa'))(new Redis(config[_0xac3d('0xb')]));require('./plugin.socket')[_0xac3d('0xc')](socket);function respondWithRpcPromise(_0x429ba3,_0x2d8dd4,_0x294858){return new BPromise(function(_0x253630,_0x4fb5fd){return client[_0xac3d('0xd')](_0x429ba3,_0x294858)['then'](function(_0x3f19fb){logger['info'](_0xac3d('0xe'),_0x2d8dd4,_0xac3d('0xf'));logger[_0xac3d('0x10')](_0xac3d('0x11'),_0x2d8dd4,_0xac3d('0xf'),JSON[_0xac3d('0x12')](_0x3f19fb));if(_0x3f19fb[_0xac3d('0x13')]){if(_0x3f19fb[_0xac3d('0x13')]['code']===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x2d8dd4,_0x3f19fb[_0xac3d('0x13')][_0xac3d('0x14')]);return _0x4fb5fd(_0x3f19fb[_0xac3d('0x13')][_0xac3d('0x14')]);}logger[_0xac3d('0x13')]('Plugin,\x20%s,\x20%s',_0x2d8dd4,_0x3f19fb[_0xac3d('0x13')][_0xac3d('0x14')]);return _0x253630(_0x3f19fb['error'][_0xac3d('0x14')]);}else{logger[_0xac3d('0x15')](_0xac3d('0xe'),_0x2d8dd4,_0xac3d('0xf'));_0x253630(_0x3f19fb[_0xac3d('0x16')]['message']);}})[_0xac3d('0x17')](function(_0x2164b0){logger[_0xac3d('0x13')](_0xac3d('0xe'),_0x2d8dd4,_0x2164b0);_0x4fb5fd(_0x2164b0);});});}exports['CreatePlugin']=function(_0x5ea1a0){var _0x570c2e=this;return new Promise(function(_0x4f0b8d,_0x43fe82){return db[_0xac3d('0x18')][_0xac3d('0x19')](_0x5ea1a0[_0xac3d('0x1a')],{'raw':_0x5ea1a0[_0xac3d('0x1b')]?_0x5ea1a0[_0xac3d('0x1b')][_0xac3d('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x9b36f0){logger[_0xac3d('0x15')](_0xac3d('0x1d'),_0x5ea1a0);logger['debug'](_0xac3d('0x1d'),_0x5ea1a0,JSON[_0xac3d('0x12')](_0x9b36f0));_0x4f0b8d(_0x9b36f0);})['catch'](function(_0x29043b){logger[_0xac3d('0x13')](_0xac3d('0x1d'),_0x29043b['message'],_0x5ea1a0);_0x43fe82(_0x570c2e[_0xac3d('0x13')](0x1f4,_0x29043b[_0xac3d('0x14')]));});});}; \ No newline at end of file +var _0xe43c=['request','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','redis','defaults','socket.io-emitter','register'];(function(_0xbd54b6,_0x3b922b){var _0x55e419=function(_0x4d0365){while(--_0x4d0365){_0xbd54b6['push'](_0xbd54b6['shift']());}};_0x55e419(++_0x3b922b);}(_0xe43c,0x72));var _0xce43=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xe43c[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xce43('0x0'));var util=require(_0xce43('0x1'));var moment=require(_0xce43('0x2'));var BPromise=require(_0xce43('0x3'));var rs=require(_0xce43('0x4'));var fs=require('fs');var Redis=require(_0xce43('0x5'));var db=require(_0xce43('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xce43('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xce43('0x8'));var client=jayson['client'][_0xce43('0x9')]({'port':0x232a});config[_0xce43('0xa')]=_[_0xce43('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xce43('0xc'))(new Redis(config[_0xce43('0xa')]));require('./plugin.socket')[_0xce43('0xd')](socket);function respondWithRpcPromise(_0x394799,_0x261337,_0x32f580){return new BPromise(function(_0x5ea297,_0x5d31c3){return client[_0xce43('0xe')](_0x394799,_0x32f580)['then'](function(_0x32ab83){logger[_0xce43('0xf')](_0xce43('0x10'),_0x261337,_0xce43('0x11'));logger[_0xce43('0x12')](_0xce43('0x13'),_0x261337,_0xce43('0x11'),JSON[_0xce43('0x14')](_0x32ab83));if(_0x32ab83[_0xce43('0x15')]){if(_0x32ab83[_0xce43('0x15')][_0xce43('0x16')]===0x1f4){logger[_0xce43('0x15')](_0xce43('0x10'),_0x261337,_0x32ab83[_0xce43('0x15')][_0xce43('0x17')]);return _0x5d31c3(_0x32ab83[_0xce43('0x15')][_0xce43('0x17')]);}logger[_0xce43('0x15')](_0xce43('0x10'),_0x261337,_0x32ab83[_0xce43('0x15')]['message']);return _0x5ea297(_0x32ab83['error']['message']);}else{logger[_0xce43('0xf')](_0xce43('0x10'),_0x261337,_0xce43('0x11'));_0x5ea297(_0x32ab83[_0xce43('0x18')]['message']);}})[_0xce43('0x19')](function(_0x202e76){logger[_0xce43('0x15')]('Plugin,\x20%s,\x20%s',_0x261337,_0x202e76);_0x5d31c3(_0x202e76);});});}exports[_0xce43('0x1a')]=function(_0x4b53fa){var _0x445d22=this;return new Promise(function(_0x294dd4,_0x3bf253){return db['Plugin'][_0xce43('0x1b')](_0x4b53fa[_0xce43('0x1c')],{'raw':_0x4b53fa['options']?_0x4b53fa[_0xce43('0x1d')][_0xce43('0x1e')]===undefined?!![]:![]:!![]})[_0xce43('0x1f')](function(_0x3a6bc7){logger[_0xce43('0xf')](_0xce43('0x1a'),_0x4b53fa);logger[_0xce43('0x12')](_0xce43('0x1a'),_0x4b53fa,JSON[_0xce43('0x14')](_0x3a6bc7));_0x294dd4(_0x3a6bc7);})['catch'](function(_0x5e9b7e){logger[_0xce43('0x15')](_0xce43('0x1a'),_0x5e9b7e[_0xce43('0x17')],_0x4b53fa);_0x3bf253(_0x445d22['error'](0x1f4,_0x5e9b7e['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 19367d4..6c3d7d0 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 _0x4729=['plugin:','./plugin.events','remove','removeListener','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4729,0x123));var _0x9472=function(_0x3c6a0c,_0x4c47ee){_0x3c6a0c=_0x3c6a0c-0x0;var _0x1d8cb1=_0x4729[_0x3c6a0c];return _0x1d8cb1;};'use strict';var PluginEvents=require(_0x9472('0x0'));var events=['save',_0x9472('0x1'),'update'];function createListener(_0x5eb6d4,_0x8ffdaa){return function(_0x358dd3){_0x8ffdaa['emit'](_0x5eb6d4,_0x358dd3);};}function removeListener(_0x13eb7,_0x377179){return function(){PluginEvents[_0x9472('0x2')](_0x13eb7,_0x377179);};}exports['register']=function(_0x53d523){for(var _0x1058f4=0x0,_0x23b16a=events[_0x9472('0x3')];_0x1058f4<_0x23b16a;_0x1058f4++){var _0x43c61c=events[_0x1058f4];var _0xe2f384=createListener(_0x9472('0x4')+_0x43c61c,_0x53d523);PluginEvents['on'](_0x43c61c,_0xe2f384);}}; \ No newline at end of file +var _0x92ac=['length','./plugin.events','save','remove','emit','removeListener'];(function(_0x3739b2,_0x292ebb){var _0x5db0de=function(_0x2d43d6){while(--_0x2d43d6){_0x3739b2['push'](_0x3739b2['shift']());}};_0x5db0de(++_0x292ebb);}(_0x92ac,0x151));var _0xc92a=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x92ac[_0x4baae2];return _0x1a2285;};'use strict';var PluginEvents=require(_0xc92a('0x0'));var events=[_0xc92a('0x1'),_0xc92a('0x2'),'update'];function createListener(_0x4cc5b3,_0x2d2db5){return function(_0x3f1301){_0x2d2db5[_0xc92a('0x3')](_0x4cc5b3,_0x3f1301);};}function removeListener(_0x4d3ce8,_0xd28bb9){return function(){PluginEvents[_0xc92a('0x4')](_0x4d3ce8,_0xd28bb9);};}exports['register']=function(_0x11407d){for(var _0xc01dc2=0x0,_0x30f693=events[_0xc92a('0x5')];_0xc01dc2<_0x30f693;_0xc01dc2++){var _0x22e746=events[_0xc01dc2];var _0x58370f=createListener('plugin:'+_0x22e746,_0x11407d);PluginEvents['on'](_0x22e746,_0x58370f);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index c2b724d..60d7deb 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 _0x46e4=['index','show','post','/:id','update','exports','express','../../components/auth/service','./pm2.controller','get','isAuthenticated'];(function(_0x432aae,_0x3f06d1){var _0x391e81=function(_0x4d61dd){while(--_0x4d61dd){_0x432aae['push'](_0x432aae['shift']());}};_0x391e81(++_0x3f06d1);}(_0x46e4,0x7f));var _0x446e=function(_0x4a3acd,_0x4bf641){_0x4a3acd=_0x4a3acd-0x0;var _0x3efdaa=_0x46e4[_0x4a3acd];return _0x3efdaa;};'use strict';var express=require(_0x446e('0x0'));var router=express['Router']();var auth=require(_0x446e('0x1'));var controller=require(_0x446e('0x2'));router[_0x446e('0x3')]('/',auth[_0x446e('0x4')](),controller[_0x446e('0x5')]);router[_0x446e('0x3')]('/:id',auth[_0x446e('0x4')](),controller[_0x446e('0x6')]);router[_0x446e('0x7')]('/',auth[_0x446e('0x4')](),controller['create']);router['put'](_0x446e('0x8'),auth[_0x446e('0x4')](),controller[_0x446e('0x9')]);router['delete'](_0x446e('0x8'),auth[_0x446e('0x4')](),controller['destroy']);module[_0x446e('0xa')]=router; \ No newline at end of file +var _0x5328=['show','put','update','destroy','exports','express','Router','../../components/auth/service','./pm2.controller','get','isAuthenticated','index','/:id'];(function(_0x53491d,_0x39ccdc){var _0x534657=function(_0x1ef4db){while(--_0x1ef4db){_0x53491d['push'](_0x53491d['shift']());}};_0x534657(++_0x39ccdc);}(_0x5328,0x13d));var _0x8532=function(_0x5df78c,_0x46ad94){_0x5df78c=_0x5df78c-0x0;var _0x195fc8=_0x5328[_0x5df78c];return _0x195fc8;};'use strict';var express=require(_0x8532('0x0'));var router=express[_0x8532('0x1')]();var auth=require(_0x8532('0x2'));var controller=require(_0x8532('0x3'));router[_0x8532('0x4')]('/',auth[_0x8532('0x5')](),controller[_0x8532('0x6')]);router[_0x8532('0x4')](_0x8532('0x7'),auth[_0x8532('0x5')](),controller[_0x8532('0x8')]);router['post']('/',auth[_0x8532('0x5')](),controller['create']);router[_0x8532('0x9')](_0x8532('0x7'),auth[_0x8532('0x5')](),controller[_0x8532('0xa')]);router['delete'](_0x8532('0x7'),auth[_0x8532('0x5')](),controller[_0x8532('0xb')]);module[_0x8532('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index bba4ae5..bc3bd12 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 _0xccb6=['../../files/plugins','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','exec','bluebird','sendStatus','status','json','error','stack','name','send','info','index','list','reject','motion2','then','catch','describe','params','body','script'];(function(_0x525cb3,_0x39925){var _0x3efed6=function(_0x131edc){while(--_0x131edc){_0x525cb3['push'](_0x525cb3['shift']());}};_0x3efed6(++_0x39925);}(_0xccb6,0x12b));var _0x6ccb=function(_0x2a3b3e,_0x415238){_0x2a3b3e=_0x2a3b3e-0x0;var _0x3bb5f6=_0xccb6[_0x2a3b3e];return _0x3bb5f6;};'use strict';var _=require(_0x6ccb('0x0'));var pm2=require(_0x6ccb('0x1'));var logger=require(_0x6ccb('0x2'))(_0x6ccb('0x3'));var path=require(_0x6ccb('0x4'));var exec=require('child_process')[_0x6ccb('0x5')];var BPromise=require(_0x6ccb('0x6'));function handleEntityNotFound(_0x2db9cd,_0x1b8808){return function(_0x525c29){if(!_0x525c29){_0x2db9cd[_0x6ccb('0x7')](0x194);;}return _0x525c29;};}function respondWithResult(_0x11b9c7,_0x3edcc1){_0x3edcc1=_0x3edcc1||0xc8;return function(_0x240c01){if(_0x240c01){return _0x11b9c7[_0x6ccb('0x8')](_0x3edcc1)[_0x6ccb('0x9')](_0x240c01);}return null;};}function handleError(_0x193c82,_0x2de6ca){_0x2de6ca=_0x2de6ca||0x1f4;return function(_0x148e41){logger[_0x6ccb('0xa')](_0x148e41[_0x6ccb('0xb')]);if(_0x148e41['name']){delete _0x148e41[_0x6ccb('0xc')];}_0x193c82[_0x6ccb('0x8')](_0x2de6ca)[_0x6ccb('0xd')](_0x148e41);};}function execChildProcess(){return new BPromise(function(_0x45cdde,_0x3e8f4f){exec('npm\x20install',function(_0x28e969,_0x3b38fc,_0x5a7e0a){logger[_0x6ccb('0xe')](_0x3b38fc);logger[_0x6ccb('0xe')](_0x5a7e0a);if(_0x28e969){logger[_0x6ccb('0xa')](_0x28e969);return _0x3e8f4f(_0x28e969);}return _0x45cdde(_0x3b38fc);});});}exports[_0x6ccb('0xf')]=function(_0x5015c4,_0x873e82){return pm2[_0x6ccb('0x10')]()['then'](function(_0xf7bc55){if(_0xf7bc55){var _0x9d02be=_[_0x6ccb('0x11')](_0xf7bc55,function(_0x521d8b){return _0x521d8b[_0x6ccb('0xc')]==='express'||_0x521d8b[_0x6ccb('0xc')]===_0x6ccb('0x12');});return{'rows':_0x9d02be,'count':_0x9d02be['length']};}return null;})[_0x6ccb('0x13')](respondWithResult(_0x873e82,null))[_0x6ccb('0x14')](handleError(_0x873e82,null));};exports['show']=function(_0x1e7ba2,_0x140ace){return pm2[_0x6ccb('0x15')](_0x1e7ba2[_0x6ccb('0x16')]['id'])[_0x6ccb('0x13')](respondWithResult(_0x140ace,null))[_0x6ccb('0x13')](handleEntityNotFound(_0x140ace,null))[_0x6ccb('0x14')](handleError(_0x140ace,null));};exports['create']=function(_0x407b46,_0x56c209){if(_0x407b46['body']['name']&&_0x407b46[_0x6ccb('0x17')][_0x6ccb('0x18')]){var _0x4d3c7c=path['join'](__dirname,_0x6ccb('0x19'),_0x407b46[_0x6ccb('0x17')][_0x6ccb('0x18')]);var _0x1bebac=process['cwd']();process[_0x6ccb('0x1a')](path[_0x6ccb('0x1b')](_0x4d3c7c));return execChildProcess()[_0x6ccb('0x13')](function(_0xc6f0c1){process[_0x6ccb('0x1a')](_0x1bebac);return pm2[_0x6ccb('0x1c')]({'name':_0x407b46[_0x6ccb('0x17')][_0x6ccb('0xc')],'script':_0x4d3c7c});})[_0x6ccb('0x13')](function(_0x5bacaf){pm2[_0x6ccb('0x1d')]();return _0x5bacaf[0x0];})[_0x6ccb('0x13')](respondWithResult(_0x56c209,0xc9))[_0x6ccb('0x14')](handleError(_0x56c209,null));}else{return _0x56c209[_0x6ccb('0x8')](0x1f4)[_0x6ccb('0xd')]({'message':_0x6ccb('0x1e')});}};exports[_0x6ccb('0x1f')]=function(_0x265790,_0x5b466c){if(_0x265790[_0x6ccb('0x17')]['id']){delete _0x265790[_0x6ccb('0x17')]['id'];}var _0x2aa1eb={'online':'restart','stopped':'stop'};if(_0x2aa1eb['hasOwnProperty'](_0x265790[_0x6ccb('0x17')][_0x6ccb('0x8')])){return pm2[_0x2aa1eb[_0x265790[_0x6ccb('0x17')][_0x6ccb('0x8')]]](_0x265790['params']['id'])[_0x6ccb('0x13')](respondWithResult(_0x5b466c,0xc8))[_0x6ccb('0x14')](handleError(_0x5b466c,null));}else{return _0x5b466c[_0x6ccb('0x8')](0x1f4)[_0x6ccb('0xd')]({'message':_0x6ccb('0x20')});}};exports[_0x6ccb('0x21')]=function(_0x9ad164,_0x1de985){if(_0x9ad164[_0x6ccb('0x17')]['id']){delete _0x9ad164[_0x6ccb('0x17')]['id'];}if(_0x9ad164['params']['id']){return pm2[_0x6ccb('0x22')](_0x9ad164['params']['id'])[_0x6ccb('0x13')](function(_0x45907a){pm2['dump']();return _0x45907a[0x0];})[_0x6ccb('0x13')](respondWithResult(_0x1de985,null))[_0x6ccb('0x14')](handleError(_0x1de985,null));}else{return _0x1de985[_0x6ccb('0x8')](0x1f4)[_0x6ccb('0xd')]({'message':_0x6ccb('0x23')});}}; \ No newline at end of file +var _0xf0d4=['send','npm\x20install','info','list','then','reject','express','motion2','catch','show','describe','params','body','script','join','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','delete','Unknown\x20id','../../config/logger','api','path','child_process','exec','bluebird','json','error','stack','name','status'];(function(_0x54b7e6,_0x164894){var _0x3173af=function(_0x16f863){while(--_0x16f863){_0x54b7e6['push'](_0x54b7e6['shift']());}};_0x3173af(++_0x164894);}(_0xf0d4,0x85));var _0x4f0d=function(_0x5011f5,_0x92181b){_0x5011f5=_0x5011f5-0x0;var _0x2b0e3f=_0xf0d4[_0x5011f5];return _0x2b0e3f;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require(_0x4f0d('0x0'))(_0x4f0d('0x1'));var path=require(_0x4f0d('0x2'));var exec=require(_0x4f0d('0x3'))[_0x4f0d('0x4')];var BPromise=require(_0x4f0d('0x5'));function handleEntityNotFound(_0x57acfb,_0x5a714a){return function(_0x511352){if(!_0x511352){_0x57acfb['sendStatus'](0x194);;}return _0x511352;};}function respondWithResult(_0x1da9f6,_0x34d62c){_0x34d62c=_0x34d62c||0xc8;return function(_0x23123a){if(_0x23123a){return _0x1da9f6['status'](_0x34d62c)[_0x4f0d('0x6')](_0x23123a);}return null;};}function handleError(_0x3273f5,_0x379af0){_0x379af0=_0x379af0||0x1f4;return function(_0x1a0a46){logger[_0x4f0d('0x7')](_0x1a0a46[_0x4f0d('0x8')]);if(_0x1a0a46[_0x4f0d('0x9')]){delete _0x1a0a46[_0x4f0d('0x9')];}_0x3273f5[_0x4f0d('0xa')](_0x379af0)[_0x4f0d('0xb')](_0x1a0a46);};}function execChildProcess(){return new BPromise(function(_0x3b6b4d,_0x5bf3f8){exec(_0x4f0d('0xc'),function(_0x2019f0,_0x4554f7,_0x5c703c){logger[_0x4f0d('0xd')](_0x4554f7);logger[_0x4f0d('0xd')](_0x5c703c);if(_0x2019f0){logger['error'](_0x2019f0);return _0x5bf3f8(_0x2019f0);}return _0x3b6b4d(_0x4554f7);});});}exports['index']=function(_0x52507b,_0x23a1a0){return pm2[_0x4f0d('0xe')]()[_0x4f0d('0xf')](function(_0x57a2e7){if(_0x57a2e7){var _0x5aada2=_[_0x4f0d('0x10')](_0x57a2e7,function(_0x15ec7a){return _0x15ec7a['name']===_0x4f0d('0x11')||_0x15ec7a[_0x4f0d('0x9')]===_0x4f0d('0x12');});return{'rows':_0x5aada2,'count':_0x5aada2['length']};}return null;})[_0x4f0d('0xf')](respondWithResult(_0x23a1a0,null))[_0x4f0d('0x13')](handleError(_0x23a1a0,null));};exports[_0x4f0d('0x14')]=function(_0x2aa742,_0x30cf8f){return pm2[_0x4f0d('0x15')](_0x2aa742[_0x4f0d('0x16')]['id'])[_0x4f0d('0xf')](respondWithResult(_0x30cf8f,null))['then'](handleEntityNotFound(_0x30cf8f,null))[_0x4f0d('0x13')](handleError(_0x30cf8f,null));};exports['create']=function(_0x2a3970,_0x4939e6){if(_0x2a3970[_0x4f0d('0x17')][_0x4f0d('0x9')]&&_0x2a3970[_0x4f0d('0x17')][_0x4f0d('0x18')]){var _0x556014=path[_0x4f0d('0x19')](__dirname,'../../files/plugins',_0x2a3970[_0x4f0d('0x17')]['script']);var _0x5a34f4=process['cwd']();process[_0x4f0d('0x1a')](path[_0x4f0d('0x1b')](_0x556014));return execChildProcess()['then'](function(_0xc54247){process[_0x4f0d('0x1a')](_0x5a34f4);return pm2['start']({'name':_0x2a3970[_0x4f0d('0x17')][_0x4f0d('0x9')],'script':_0x556014});})[_0x4f0d('0xf')](function(_0x3c5351){pm2[_0x4f0d('0x1c')]();return _0x3c5351[0x0];})[_0x4f0d('0xf')](respondWithResult(_0x4939e6,0xc9))[_0x4f0d('0x13')](handleError(_0x4939e6,null));}else{return _0x4939e6[_0x4f0d('0xa')](0x1f4)['send']({'message':_0x4f0d('0x1d')});}};exports[_0x4f0d('0x1e')]=function(_0x3ef60b,_0x4c5311){if(_0x3ef60b[_0x4f0d('0x17')]['id']){delete _0x3ef60b[_0x4f0d('0x17')]['id'];}var _0x52722a={'online':_0x4f0d('0x1f'),'stopped':'stop'};if(_0x52722a[_0x4f0d('0x20')](_0x3ef60b['body']['status'])){return pm2[_0x52722a[_0x3ef60b[_0x4f0d('0x17')][_0x4f0d('0xa')]]](_0x3ef60b[_0x4f0d('0x16')]['id'])[_0x4f0d('0xf')](respondWithResult(_0x4c5311,0xc8))[_0x4f0d('0x13')](handleError(_0x4c5311,null));}else{return _0x4c5311[_0x4f0d('0xa')](0x1f4)[_0x4f0d('0xb')]({'message':_0x4f0d('0x21')});}};exports['destroy']=function(_0x25b4ae,_0x1438f1){if(_0x25b4ae[_0x4f0d('0x17')]['id']){delete _0x25b4ae[_0x4f0d('0x17')]['id'];}if(_0x25b4ae[_0x4f0d('0x16')]['id']){return pm2[_0x4f0d('0x22')](_0x25b4ae[_0x4f0d('0x16')]['id'])[_0x4f0d('0xf')](function(_0x1a78d7){pm2['dump']();return _0x1a78d7[0x0];})[_0x4f0d('0xf')](respondWithResult(_0x1438f1,null))[_0x4f0d('0x13')](handleError(_0x1438f1,null));}else{return _0x1438f1[_0x4f0d('0xa')](0x1f4)[_0x4f0d('0xb')]({'message':_0x4f0d('0x23')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 6e27c94..3d8f40c 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 _0x71f1=['util','connect-timeout','express','exports','multer'];(function(_0x59d69a,_0x44bb02){var _0x25b076=function(_0x598ff3){while(--_0x598ff3){_0x59d69a['push'](_0x59d69a['shift']());}};_0x25b076(++_0x44bb02);}(_0x71f1,0xea));var _0x171f=function(_0xbb6da2,_0x24614b){_0xbb6da2=_0xbb6da2-0x0;var _0x2a84f5=_0x71f1[_0xbb6da2];return _0x2a84f5;};'use strict';var multer=require(_0x171f('0x0'));var util=require(_0x171f('0x1'));var path=require('path');var timeout=require(_0x171f('0x2'));var express=require(_0x171f('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x171f('0x4')]=router; \ No newline at end of file +var _0x91a4=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','path'];(function(_0x6e72af,_0x9791cc){var _0x3e9ab7=function(_0x447edc){while(--_0x447edc){_0x6e72af['push'](_0x6e72af['shift']());}};_0x3e9ab7(++_0x9791cc);}(_0x91a4,0x10f));var _0x491a=function(_0x124082,_0x3ba608){_0x124082=_0x124082-0x0;var _0xde8748=_0x91a4[_0x124082];return _0xde8748;};'use strict';var multer=require(_0x491a('0x0'));var util=require('util');var path=require(_0x491a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x491a('0x2')]();var auth=require(_0x491a('0x3'));var interaction=require(_0x491a('0x4'));var config=require(_0x491a('0x5'));module[_0x491a('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 366804a..7a3ebae 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 _0xecef=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x3fc441,_0x1f9e83){var _0x32cdd2=function(_0x5f1879){while(--_0x5f1879){_0x3fc441['push'](_0x3fc441['shift']());}};_0x32cdd2(++_0x1f9e83);}(_0xecef,0xfc));var _0xfece=function(_0x10793a,_0x36ac51){_0x10793a=_0x10793a-0x0;var _0xe5563d=_0xecef[_0x10793a];return _0xe5563d;};'use strict';var Sequelize=require(_0xfece('0x0'));module[_0xfece('0x1')]={'state':{'type':Sequelize[_0xfece('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xfece('0x3')]},'scheduledat':{'type':Sequelize[_0xfece('0x4')]},'uniqueid':{'type':Sequelize[_0xfece('0x3')]},'starttime':{'type':Sequelize[_0xfece('0x4')]},'responsetime':{'type':Sequelize[_0xfece('0x4')]},'ringtime':{'type':Sequelize[_0xfece('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xfece('0x3')]},'campaigntype':{'type':Sequelize[_0xfece('0x3')]},'membername':{'type':Sequelize[_0xfece('0x3')]}}; \ No newline at end of file +var _0x5adc=['sequelize','exports','INTEGER','STRING','DATE'];(function(_0x4fe19c,_0x45d0fe){var _0x952ac7=function(_0x274a16){while(--_0x274a16){_0x4fe19c['push'](_0x4fe19c['shift']());}};_0x952ac7(++_0x45d0fe);}(_0x5adc,0xd2));var _0xc5ad=function(_0x4645f7,_0x1c6be4){_0x4645f7=_0x4645f7-0x0;var _0x19b9aa=_0x5adc[_0x4645f7];return _0x19b9aa;};'use strict';var Sequelize=require(_0xc5ad('0x0'));module[_0xc5ad('0x1')]={'state':{'type':Sequelize[_0xc5ad('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xc5ad('0x3')]},'scheduledat':{'type':Sequelize[_0xc5ad('0x4')]},'uniqueid':{'type':Sequelize[_0xc5ad('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xc5ad('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xc5ad('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xc5ad('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 3e3b552..d8300bd 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 _0x7f3d=['../../config/environment','./reportAgentPreview.attributes','exports','define','report_agent_preview','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x176393,_0x406e62){var _0x485487=function(_0x512609){while(--_0x512609){_0x176393['push'](_0x176393['shift']());}};_0x485487(++_0x406e62);}(_0x7f3d,0x179));var _0xd7f3=function(_0x4ac60a,_0x503a99){_0x4ac60a=_0x4ac60a-0x0;var _0x4b22e8=_0x7f3d[_0x4ac60a];return _0x4b22e8;};'use strict';var _=require(_0xd7f3('0x0'));var util=require(_0xd7f3('0x1'));var logger=require('../../config/logger')(_0xd7f3('0x2'));var moment=require(_0xd7f3('0x3'));var BPromise=require('bluebird');var rp=require(_0xd7f3('0x4'));var fs=require('fs');var path=require(_0xd7f3('0x5'));var rimraf=require(_0xd7f3('0x6'));var config=require(_0xd7f3('0x7'));var attributes=require(_0xd7f3('0x8'));module[_0xd7f3('0x9')]=function(_0x252c24,_0x29812f){return _0x252c24[_0xd7f3('0xa')]('ReportAgentPreview',attributes,{'tableName':_0xd7f3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x04af=['lodash','util','../../config/logger','api','bluebird','request-promise','path','./reportAgentPreview.attributes','define','ReportAgentPreview','report_agent_preview'];(function(_0x258feb,_0x59e01f){var _0x40fc52=function(_0x1304dc){while(--_0x1304dc){_0x258feb['push'](_0x258feb['shift']());}};_0x40fc52(++_0x59e01f);}(_0x04af,0xf2));var _0xf04a=function(_0x255c93,_0xa4b483){_0x255c93=_0x255c93-0x0;var _0x18766c=_0x04af[_0x255c93];return _0x18766c;};'use strict';var _=require(_0xf04a('0x0'));var util=require(_0xf04a('0x1'));var logger=require(_0xf04a('0x2'))(_0xf04a('0x3'));var moment=require('moment');var BPromise=require(_0xf04a('0x4'));var rp=require(_0xf04a('0x5'));var fs=require('fs');var path=require(_0xf04a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf04a('0x7'));module['exports']=function(_0x4367a5,_0x473e8b){return _0x4367a5[_0xf04a('0x8')](_0xf04a('0x9'),attributes,{'tableName':_0xf04a('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 105f188..ba9ca3b 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 _0x1cc9=['http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','debug','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x1d1094,_0x37a655){var _0x4e5b2e=function(_0x3b7f9c){while(--_0x3b7f9c){_0x1d1094['push'](_0x1d1094['shift']());}};_0x4e5b2e(++_0x37a655);}(_0x1cc9,0x1c6));var _0x91cc=function(_0x2975cf,_0x4266c5){_0x2975cf=_0x2975cf-0x0;var _0x4c5b82=_0x1cc9[_0x2975cf];return _0x4c5b82;};'use strict';var _=require('lodash');var util=require(_0x91cc('0x0'));var moment=require(_0x91cc('0x1'));var BPromise=require(_0x91cc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x91cc('0x3'));var db=require(_0x91cc('0x4'))['db'];var utils=require(_0x91cc('0x5'));var logger=require(_0x91cc('0x6'))(_0x91cc('0x7'));var config=require(_0x91cc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x91cc('0x9')][_0x91cc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf9b40b,_0x267d27,_0x369588){return new BPromise(function(_0x3ac1bf,_0x5f9840){return client[_0x91cc('0xb')](_0xf9b40b,_0x369588)[_0x91cc('0xc')](function(_0x507d32){logger['info'](_0x91cc('0xd'),_0x267d27,_0x91cc('0xe'));logger['debug'](_0x91cc('0xf'),_0x267d27,_0x91cc('0xe'),JSON[_0x91cc('0x10')](_0x507d32));if(_0x507d32[_0x91cc('0x11')]){if(_0x507d32[_0x91cc('0x11')][_0x91cc('0x12')]===0x1f4){logger[_0x91cc('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x267d27,_0x507d32[_0x91cc('0x11')][_0x91cc('0x13')]);return _0x5f9840(_0x507d32['error'][_0x91cc('0x13')]);}logger['error'](_0x91cc('0xd'),_0x267d27,_0x507d32[_0x91cc('0x11')]['message']);return _0x3ac1bf(_0x507d32[_0x91cc('0x11')][_0x91cc('0x13')]);}else{logger['info'](_0x91cc('0xd'),_0x267d27,_0x91cc('0xe'));_0x3ac1bf(_0x507d32[_0x91cc('0x14')][_0x91cc('0x13')]);}})[_0x91cc('0x15')](function(_0x3cb83a){logger[_0x91cc('0x11')](_0x91cc('0xd'),_0x267d27,_0x3cb83a);_0x5f9840(_0x3cb83a);});});}exports[_0x91cc('0x16')]=function(_0x7d216e){var _0x3fdb89=this;return new Promise(function(_0x464baf,_0x5523fa){return db[_0x91cc('0x17')][_0x91cc('0x18')](_0x7d216e[_0x91cc('0x19')],{'raw':_0x7d216e['options']?_0x7d216e[_0x91cc('0x1a')][_0x91cc('0x1b')]===undefined?!![]:![]:!![]})[_0x91cc('0xc')](function(_0x40f1e2){logger['info']('CreateReportAgentPreview',_0x7d216e);logger[_0x91cc('0x1c')](_0x91cc('0x16'),_0x7d216e,JSON[_0x91cc('0x10')](_0x40f1e2));_0x464baf(_0x40f1e2);})[_0x91cc('0x15')](function(_0x3b2f3f){logger['error'](_0x91cc('0x16'),_0x3b2f3f[_0x91cc('0x13')],_0x7d216e);_0x5523fa(_0x3fdb89[_0x91cc('0x11')](0x1f4,_0x3b2f3f[_0x91cc('0x13')]));});});}; \ No newline at end of file +var _0x6c50=['../../config/logger','rpc','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x6c50,0x158));var _0x06c5=function(_0x371c51,_0x360947){_0x371c51=_0x371c51-0x0;var _0x3f9e29=_0x6c50[_0x371c51];return _0x3f9e29;};'use strict';var _=require(_0x06c5('0x0'));var util=require(_0x06c5('0x1'));var moment=require(_0x06c5('0x2'));var BPromise=require(_0x06c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06c5('0x4'));var db=require(_0x06c5('0x5'))['db'];var utils=require(_0x06c5('0x6'));var logger=require(_0x06c5('0x7'))(_0x06c5('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x06c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x232964,_0x33b1a3,_0x2a2846){return new BPromise(function(_0x555c06,_0x1551d8){return client[_0x06c5('0xa')](_0x232964,_0x2a2846)[_0x06c5('0xb')](function(_0x50260e){logger[_0x06c5('0xc')](_0x06c5('0xd'),_0x33b1a3,_0x06c5('0xe'));logger[_0x06c5('0xf')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x33b1a3,'request\x20sent',JSON[_0x06c5('0x10')](_0x50260e));if(_0x50260e[_0x06c5('0x11')]){if(_0x50260e[_0x06c5('0x11')][_0x06c5('0x12')]===0x1f4){logger[_0x06c5('0x11')](_0x06c5('0xd'),_0x33b1a3,_0x50260e['error'][_0x06c5('0x13')]);return _0x1551d8(_0x50260e[_0x06c5('0x11')][_0x06c5('0x13')]);}logger['error'](_0x06c5('0xd'),_0x33b1a3,_0x50260e[_0x06c5('0x11')][_0x06c5('0x13')]);return _0x555c06(_0x50260e[_0x06c5('0x11')][_0x06c5('0x13')]);}else{logger[_0x06c5('0xc')](_0x06c5('0xd'),_0x33b1a3,_0x06c5('0xe'));_0x555c06(_0x50260e['result'][_0x06c5('0x13')]);}})[_0x06c5('0x14')](function(_0x25177d){logger[_0x06c5('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x33b1a3,_0x25177d);_0x1551d8(_0x25177d);});});}exports[_0x06c5('0x15')]=function(_0x5cd567){var _0x32cd96=this;return new Promise(function(_0xc70655,_0x54fcaa){return db[_0x06c5('0x16')][_0x06c5('0x17')](_0x5cd567[_0x06c5('0x18')],{'raw':_0x5cd567[_0x06c5('0x19')]?_0x5cd567['options'][_0x06c5('0x1a')]===undefined?!![]:![]:!![]})[_0x06c5('0xb')](function(_0x12a382){logger[_0x06c5('0xc')](_0x06c5('0x15'),_0x5cd567);logger[_0x06c5('0xf')](_0x06c5('0x15'),_0x5cd567,JSON[_0x06c5('0x10')](_0x12a382));_0xc70655(_0x12a382);})[_0x06c5('0x14')](function(_0x3acb91){logger[_0x06c5('0x11')]('CreateReportAgentPreview',_0x3acb91[_0x06c5('0x13')],_0x5cd567);_0x54fcaa(_0x32cd96['error'](0x1f4,_0x3acb91[_0x06c5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 550a223..b4bec80 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 _0x1ae6=['/telephones','/trunks','trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/sms/queues/:id','showSmsQueues','/agents/:id/notify','agentNotify','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','/openchannel/queues','openchannelQueues','/sms/queues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','/outbound','outbound','/agents','/agents/:id/capacity','agentCapacity'];(function(_0x372693,_0x4e68d3){var _0x23b142=function(_0x27ad8b){while(--_0x27ad8b){_0x372693['push'](_0x372693['shift']());}};_0x23b142(++_0x4e68d3);}(_0x1ae6,0x65));var _0x61ae=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x1ae6[_0x5c351c];return _0x26f3b3;};'use strict';var multer=require(_0x61ae('0x0'));var util=require(_0x61ae('0x1'));var path=require(_0x61ae('0x2'));var express=require(_0x61ae('0x3'));var router=express[_0x61ae('0x4')]();var auth=require(_0x61ae('0x5'));var controller=require(_0x61ae('0x6'));router[_0x61ae('0x7')](_0x61ae('0x8'),auth[_0x61ae('0x9')](),controller[_0x61ae('0xa')]);router[_0x61ae('0x7')](_0x61ae('0xb'),auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router['get'](_0x61ae('0xc'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0x61ae('0x7')](_0x61ae('0xd'),auth['isAuthenticated'](),controller['voiceQueues']);router['get'](_0x61ae('0xe'),auth['isAuthenticated'](),controller[_0x61ae('0xf')]);router[_0x61ae('0x7')](_0x61ae('0x10'),auth[_0x61ae('0x9')](),controller[_0x61ae('0x11')]);router[_0x61ae('0x7')]('/mail/accounts',auth[_0x61ae('0x9')](),controller['mailAccounts']);router[_0x61ae('0x7')](_0x61ae('0x12'),auth[_0x61ae('0x9')](),controller[_0x61ae('0x13')]);router[_0x61ae('0x7')](_0x61ae('0x14'),auth[_0x61ae('0x9')](),controller['smsQueues']);router['get'](_0x61ae('0x15'),auth[_0x61ae('0x9')](),controller['faxQueues']);router[_0x61ae('0x7')](_0x61ae('0x16'),auth['isAuthenticated'](),controller[_0x61ae('0x17')]);router[_0x61ae('0x7')](_0x61ae('0x18'),auth[_0x61ae('0x9')](),controller[_0x61ae('0x19')]);router[_0x61ae('0x7')](_0x61ae('0x1a'),auth[_0x61ae('0x9')](),controller['voiceQueuesChannel']);router[_0x61ae('0x7')](_0x61ae('0x1b'),auth['isAuthenticated'](),controller[_0x61ae('0x1c')]);router['get'](_0x61ae('0x1d'),auth['isAuthenticated'](),controller[_0x61ae('0x1e')]);router[_0x61ae('0x7')](_0x61ae('0x1f'),auth[_0x61ae('0x9')](),controller['showVoiceQueues']);router[_0x61ae('0x7')](_0x61ae('0x20'),auth['isAuthenticated'](),controller[_0x61ae('0x21')]);router[_0x61ae('0x7')]('/outbound/channels',auth[_0x61ae('0x9')](),controller['outboundChannels']);router[_0x61ae('0x7')](_0x61ae('0x22'),auth[_0x61ae('0x9')](),controller['agents']);router['put'](_0x61ae('0x23'),auth[_0x61ae('0x9')](),controller[_0x61ae('0x24')]);router[_0x61ae('0x7')](_0x61ae('0x25'),auth[_0x61ae('0x9')](),controller['telephones']);router[_0x61ae('0x7')](_0x61ae('0x26'),auth[_0x61ae('0x9')](),controller[_0x61ae('0x27')]);router[_0x61ae('0x7')](_0x61ae('0x28'),auth[_0x61ae('0x9')](),controller[_0x61ae('0x29')]);router[_0x61ae('0x7')]('/fax/accounts',auth['isAuthenticated'](),controller[_0x61ae('0x2a')]);router[_0x61ae('0x7')](_0x61ae('0x2b'),auth['isAuthenticated'](),controller['chatQueuesWaitingInteractions']);router[_0x61ae('0x7')]('/mail/queues/waitinginteractions',auth[_0x61ae('0x9')](),controller[_0x61ae('0x2c')]);router[_0x61ae('0x7')]('/openchannel/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x61ae('0x2d')]);router[_0x61ae('0x7')](_0x61ae('0x2e'),auth[_0x61ae('0x9')](),controller['smsQueuesWaitingInteractions']);router[_0x61ae('0x7')](_0x61ae('0x2f'),auth['isAuthenticated'](),controller[_0x61ae('0x30')]);router[_0x61ae('0x31')](_0x61ae('0x32'),auth[_0x61ae('0x9')](),controller[_0x61ae('0x33')](_0x61ae('0x34')));router[_0x61ae('0x7')](_0x61ae('0x35'),auth[_0x61ae('0x9')](),controller[_0x61ae('0x36')]);router[_0x61ae('0x31')](_0x61ae('0x37'),auth['isAuthenticated'](),controller['queueNotify']('chat'));router['get'](_0x61ae('0x38'),auth[_0x61ae('0x9')](),controller[_0x61ae('0x39')]);router['post'](_0x61ae('0x3a'),auth['isAuthenticated'](),controller['queueNotify'](_0x61ae('0x3b')));router['get'](_0x61ae('0x3c'),auth['isAuthenticated'](),controller[_0x61ae('0x3d')]);router[_0x61ae('0x31')]('/openchannel/queues/:id/notify',auth[_0x61ae('0x9')](),controller['queueNotify']('openchannel'));router[_0x61ae('0x7')](_0x61ae('0x3e'),auth[_0x61ae('0x9')](),controller[_0x61ae('0x3f')]);router[_0x61ae('0x31')](_0x61ae('0x40'),auth[_0x61ae('0x9')](),controller['queueNotify']('sms'));router[_0x61ae('0x7')](_0x61ae('0x41'),auth[_0x61ae('0x9')](),controller[_0x61ae('0x42')]);router[_0x61ae('0x31')](_0x61ae('0x43'),auth['isAuthenticated'](),controller[_0x61ae('0x44')]);module['exports']=router; \ No newline at end of file +var _0x8603=['/outbound','outbound','outboundChannels','/agents','put','agentCapacity','/trunks','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/sms/queues/:id','/agents/:id/notify','agentNotify','exports','util','path','express','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues'];(function(_0x5828d0,_0x2c3e93){var _0x239b02=function(_0x702fe4){while(--_0x702fe4){_0x5828d0['push'](_0x5828d0['shift']());}};_0x239b02(++_0x2c3e93);}(_0x8603,0x190));var _0x3860=function(_0x22ea30,_0x5851e7){_0x22ea30=_0x22ea30-0x0;var _0x13fdee=_0x8603[_0x22ea30];return _0x13fdee;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var express=require(_0x3860('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x3860('0x3'));router[_0x3860('0x4')](_0x3860('0x5'),auth['isAuthenticated'](),controller[_0x3860('0x6')]);router['get'](_0x3860('0x7'),auth[_0x3860('0x8')](),controller[_0x3860('0x9')]);router[_0x3860('0x4')](_0x3860('0xa'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router['get'](_0x3860('0xb'),auth[_0x3860('0x8')](),controller['voiceQueues']);router[_0x3860('0x4')](_0x3860('0xc'),auth['isAuthenticated'](),controller[_0x3860('0xd')]);router[_0x3860('0x4')]('/mail/queues',auth[_0x3860('0x8')](),controller[_0x3860('0xe')]);router['get'](_0x3860('0xf'),auth[_0x3860('0x8')](),controller[_0x3860('0x10')]);router[_0x3860('0x4')](_0x3860('0x11'),auth[_0x3860('0x8')](),controller[_0x3860('0x12')]);router[_0x3860('0x4')](_0x3860('0x13'),auth[_0x3860('0x8')](),controller['smsQueues']);router[_0x3860('0x4')](_0x3860('0x14'),auth[_0x3860('0x8')](),controller[_0x3860('0x15')]);router[_0x3860('0x4')](_0x3860('0x16'),auth[_0x3860('0x8')](),controller[_0x3860('0x17')]);router[_0x3860('0x4')](_0x3860('0x18'),auth[_0x3860('0x8')](),controller[_0x3860('0x19')]);router['get']('/voice/queues/channels/:uniqueid',auth[_0x3860('0x8')](),controller[_0x3860('0x1a')]);router[_0x3860('0x4')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x3860('0x8')](),controller[_0x3860('0x1b')]);router[_0x3860('0x4')](_0x3860('0x1c'),auth[_0x3860('0x8')](),controller[_0x3860('0x1d')]);router[_0x3860('0x4')](_0x3860('0x1e'),auth[_0x3860('0x8')](),controller[_0x3860('0x1f')]);router[_0x3860('0x4')](_0x3860('0x20'),auth[_0x3860('0x8')](),controller[_0x3860('0x21')]);router[_0x3860('0x4')]('/outbound/channels',auth[_0x3860('0x8')](),controller[_0x3860('0x22')]);router[_0x3860('0x4')](_0x3860('0x23'),auth[_0x3860('0x8')](),controller['agents']);router[_0x3860('0x24')]('/agents/:id/capacity',auth['isAuthenticated'](),controller[_0x3860('0x25')]);router[_0x3860('0x4')]('/telephones',auth['isAuthenticated'](),controller['telephones']);router[_0x3860('0x4')](_0x3860('0x26'),auth[_0x3860('0x8')](),controller[_0x3860('0x27')]);router[_0x3860('0x4')](_0x3860('0x28'),auth['isAuthenticated'](),controller['campaigns']);router[_0x3860('0x4')](_0x3860('0x29'),auth['isAuthenticated'](),controller[_0x3860('0x2a')]);router[_0x3860('0x4')](_0x3860('0x2b'),auth[_0x3860('0x8')](),controller[_0x3860('0x2c')]);router['get'](_0x3860('0x2d'),auth[_0x3860('0x8')](),controller[_0x3860('0x2e')]);router['get'](_0x3860('0x2f'),auth['isAuthenticated'](),controller[_0x3860('0x30')]);router['get'](_0x3860('0x31'),auth[_0x3860('0x8')](),controller[_0x3860('0x32')]);router['get'](_0x3860('0x33'),auth[_0x3860('0x8')](),controller['faxQueuesWaitingInteractions']);router[_0x3860('0x34')]('/mail/queues/:id/notify',auth[_0x3860('0x8')](),controller[_0x3860('0x35')](_0x3860('0x36')));router[_0x3860('0x4')](_0x3860('0x37'),auth[_0x3860('0x8')](),controller[_0x3860('0x38')]);router['post'](_0x3860('0x39'),auth[_0x3860('0x8')](),controller['queueNotify'](_0x3860('0x3a')));router[_0x3860('0x4')](_0x3860('0x3b'),auth['isAuthenticated'](),controller['showChatQueues']);router[_0x3860('0x34')](_0x3860('0x3c'),auth[_0x3860('0x8')](),controller[_0x3860('0x35')]('fax'));router['get'](_0x3860('0x3d'),auth[_0x3860('0x8')](),controller[_0x3860('0x3e')]);router[_0x3860('0x34')](_0x3860('0x3f'),auth['isAuthenticated'](),controller[_0x3860('0x35')](_0x3860('0x40')));router['get']('/openchannel/queues/:id',auth[_0x3860('0x8')](),controller[_0x3860('0x41')]);router[_0x3860('0x34')](_0x3860('0x42'),auth[_0x3860('0x8')](),controller['queueNotify'](_0x3860('0x43')));router['get'](_0x3860('0x44'),auth[_0x3860('0x8')](),controller['showSmsQueues']);router[_0x3860('0x34')](_0x3860('0x45'),auth['isAuthenticated'](),controller[_0x3860('0x46')]);module[_0x3860('0x47')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 4a0e21c..35d2864 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 _0x376f=['smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','Start','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','Website','create','bluebird','moment','../../mysqldb','../../config/logger','client','http','request','error','code','message','result','catch','status','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','query','then','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','outboundChannels','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','updateAttributes','findOrCreate','INTERACTION','interface','YYYY-MM-DD\x20HH:mm:ss','agent','AgentCapacity','telephones','Telephones','Trunks','campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions'];(function(_0x16b156,_0x50304a){var _0x4e65ef=function(_0x5e740c){while(--_0x5e740c){_0x16b156['push'](_0x16b156['shift']());}};_0x4e65ef(++_0x50304a);}(_0x376f,0x1d1));var _0xf376=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x376f[_0x29d915];return _0x160f86;};'use strict';var BPromise=require(_0xf376('0x0'));var moment=require(_0xf376('0x1'));var _=require('lodash');var util=require('util');var db=require(_0xf376('0x2'))['db'];var logger=require(_0xf376('0x3'))('api');var jayson=require('jayson/promise');var amiClient=jayson[_0xf376('0x4')]['http']({'port':0x232a});var mailClient=jayson['client'][_0xf376('0x5')]({'port':0x232b});var routingClient=jayson[_0xf376('0x4')]['http']({'port':0x232c});function respondWithRpcPromise(_0x301c22,_0x59142b,_0x8460ed){return new BPromise(function(_0x3227dd,_0x498b31){var _0x55a3be=_0x8460ed?_0x8460ed:amiClient;return _0x55a3be[_0xf376('0x6')](_0x301c22,_0x59142b)['then'](function(_0x36ea1b){if(_0x36ea1b[_0xf376('0x7')]){if(_0x36ea1b[_0xf376('0x7')][_0xf376('0x8')]===0x1f4){return _0x498b31(_0x36ea1b['error'][_0xf376('0x9')]);}return _0x3227dd(_0x36ea1b[_0xf376('0x7')][_0xf376('0x9')]);}else{_0x3227dd(_0x36ea1b[_0xf376('0xa')]);}})[_0xf376('0xb')](function(_0x3b8b5d){_0x498b31(_0x3b8b5d);});});}function respondWithResult(_0x2e9bfb,_0x57d586){_0x57d586=_0x57d586||0xc8;return function(_0x46012d){if(_0x46012d){return _0x2e9bfb[_0xf376('0xc')](_0x57d586)['json'](_0x46012d);}return _0x2e9bfb[_0xf376('0xd')](0x194);};}function handleError(_0x44a2b2,_0x4782b0){_0x4782b0=_0x4782b0||0x1f4;return function(_0x4f6cb3){logger['error'](_0x4f6cb3[_0xf376('0xe')]);if(_0x4f6cb3[_0xf376('0xf')]){delete _0x4f6cb3['name'];}_0x44a2b2[_0xf376('0xc')](_0x4782b0)[_0xf376('0x10')](_0x4f6cb3);};}function findById(_0x4a9277){return function(_0x599e33){if(!_[_0xf376('0x11')](_0x4a9277)&&!_['isNil'](_0x599e33)&&!_[_0xf376('0x11')](_0x599e33[_0xf376('0x12')])){return _[_0xf376('0x13')](_0x599e33['rows'],function(_0x2b68d3){return _0x2b68d3['id']==_0x4a9277;});}return null;};}exports[_0xf376('0x14')]=function(_0x7f414b,_0x2d92ec){return respondWithRpcPromise('VoiceChannels',_0x7f414b[_0xf376('0x15')])[_0xf376('0x16')](respondWithResult(_0x2d92ec,null))[_0xf376('0xb')](handleError(_0x2d92ec,null));};exports[_0xf376('0x17')]=function(_0x3b4f38,_0x59ef7e){return respondWithRpcPromise(_0xf376('0x18'),_[_0xf376('0x19')](_0x3b4f38[_0xf376('0x15')],_0x3b4f38['params']))['then'](respondWithResult(_0x59ef7e,null))['catch'](handleError(_0x59ef7e,null));};exports[_0xf376('0x1a')]=function(_0x1564de,_0x566102){return respondWithRpcPromise(_0xf376('0x1b'),_[_0xf376('0x19')](_0x1564de[_0xf376('0x15')],_0x1564de[_0xf376('0x1c')]))['then'](respondWithResult(_0x566102,null))['catch'](handleError(_0x566102,null));};exports[_0xf376('0x1d')]=function(_0x26124a,_0x3eed29){return respondWithRpcPromise(_0xf376('0x1e'),_0x26124a[_0xf376('0x15')])[_0xf376('0x16')](respondWithResult(_0x3eed29,null))[_0xf376('0xb')](handleError(_0x3eed29,null));};exports[_0xf376('0x1f')]=function(_0x5ca13e,_0x33efa7){return respondWithRpcPromise('VoiceQueues',_0x5ca13e[_0xf376('0x15')])[_0xf376('0x16')](findById(_0x5ca13e[_0xf376('0x1c')]['id']))[_0xf376('0x16')](respondWithResult(_0x33efa7,null))[_0xf376('0xb')](handleError(_0x33efa7,null));};exports[_0xf376('0x20')]=function(_0x2929a0,_0x2894cb){return respondWithRpcPromise('VoiceQueuesPreview',_[_0xf376('0x19')](_0x2929a0[_0xf376('0x15')],_0x2929a0[_0xf376('0x1c')]))[_0xf376('0x16')](respondWithResult(_0x2894cb,null))[_0xf376('0xb')](handleError(_0x2894cb,null));};exports[_0xf376('0x21')]=function(_0x1abdd4,_0x5583b5){return respondWithRpcPromise(_0xf376('0x22'),_0x1abdd4[_0xf376('0x15')])[_0xf376('0x16')](respondWithResult(_0x5583b5,null))[_0xf376('0xb')](handleError(_0x5583b5,null));};exports[_0xf376('0x23')]=function(_0x47ac97,_0x4de8dc){return respondWithRpcPromise(_0xf376('0x24'),_[_0xf376('0x19')](_0x47ac97[_0xf376('0x15')],_0x47ac97[_0xf376('0x1c')]))[_0xf376('0x16')](respondWithResult(_0x4de8dc,null))['catch'](handleError(_0x4de8dc,null));};exports[_0xf376('0x25')]=function(_0x5eb967,_0x3f6a98){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0xf376('0x19')](_0x5eb967[_0xf376('0x15')],_0x5eb967[_0xf376('0x1c')]))['then'](respondWithResult(_0x3f6a98,null))[_0xf376('0xb')](handleError(_0x3f6a98,null));};exports['voiceQueuesChannelRedirect']=function(_0x15892a,_0x21ceda){return respondWithRpcPromise(_0xf376('0x26'),_['merge'](_0x15892a[_0xf376('0x15')],_0x15892a[_0xf376('0x1c')]))[_0xf376('0x16')](respondWithResult(_0x21ceda,null))[_0xf376('0xb')](handleError(_0x21ceda,null));};exports[_0xf376('0x27')]=function(_0x1bae6e,_0x463ca4){return respondWithRpcPromise('Outbound',_0x1bae6e['query'])[_0xf376('0x16')](respondWithResult(_0x463ca4,null))['catch'](handleError(_0x463ca4,null));};exports[_0xf376('0x28')]=function(_0x37ba70,_0x5d9ca4){return respondWithRpcPromise('OutboundChannels',_0x37ba70[_0xf376('0x15')])[_0xf376('0x16')](respondWithResult(_0x5d9ca4,null))[_0xf376('0xb')](handleError(_0x5d9ca4,null));};exports['agents']=function(_0x2dbd0b,_0x3eba22){var _0x2f262b;return respondWithRpcPromise(_0xf376('0x29'),_0x2dbd0b[_0xf376('0x15')])[_0xf376('0x16')](function(_0x7aad72){_0x2f262b=_0x7aad72;return respondWithRpcPromise(_0xf376('0x29'),_0x2dbd0b[_0xf376('0x15')],routingClient);})[_0xf376('0x16')](function(_0x99abc4){return _[_0xf376('0x19')]({},_0x99abc4,_0x2f262b);})[_0xf376('0x16')](respondWithResult(_0x3eba22,null))[_0xf376('0xb')](handleError(_0x3eba22,null));};exports[_0xf376('0x2a')]=function(_0x3a73b3,_0x4dc223){if(_0x3a73b3[_0xf376('0x2b')]&&_0x3a73b3['body'][_0xf376('0x2c')]&&_0x3a73b3[_0xf376('0x2d')]&&_0x3a73b3['user'][_0xf376('0xf')]){for(var _0x505500 in _0x3a73b3[_0xf376('0x2b')][_0xf376('0x2c')]){if(_0x3a73b3[_0xf376('0x2b')][_0xf376('0x2c')][_0xf376('0x2e')](_0x505500)){db[_0xf376('0x2f')][_0xf376('0x30')]({'where':{'channel':_0x505500,'membername':_0x3a73b3['user'][_0xf376('0xf')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3a73b3[_0xf376('0x2b')][_0xf376('0x2c')][_0x505500]&&_0x3a73b3[_0xf376('0x2b')][_0xf376('0x2c')][_0x505500][_0xf376('0x31')]?{'$notIn':_0x3a73b3[_0xf376('0x2b')]['interaction'][_0x505500]}:{'$ne':null}}})[_0xf376('0x16')](function(_0x490792){var _0x3ca743=moment()[_0xf376('0x32')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0xde3bd8=0x0,_0xdb70ab=_0x490792[_0xf376('0x31')];_0xde3bd8<_0xdb70ab;_0xde3bd8+=0x1){_0x490792[_0xde3bd8][_0xf376('0x33')]({'exitAt':_0x3ca743});}});for(var _0x35341a=0x0;_0x35341a<_0x3a73b3[_0xf376('0x2b')][_0xf376('0x2c')][_0x505500][_0xf376('0x31')];_0x35341a+=0x1){db['MemberReport'][_0xf376('0x34')]({'where':{'channel':_0x505500,'membername':_0x3a73b3['user'][_0xf376('0xf')],'type':_0xf376('0x35'),'uniqueid':_0x3a73b3[_0xf376('0x2b')][_0xf376('0x2c')][_0x505500][_0x35341a],'exitAt':null},'defaults':{'channel':_0x505500,'membername':_0x3a73b3['user'][_0xf376('0xf')],'interface':_['isNil'](_0x3a73b3[_0xf376('0x2d')][_0xf376('0x36')])?util[_0xf376('0x32')]('SIP/%s',_0x3a73b3[_0xf376('0x2d')][_0xf376('0xf')]):_0x3a73b3[_0xf376('0x2d')]['interface'],'type':_0xf376('0x35'),'enterAt':moment()[_0xf376('0x32')](_0xf376('0x37')),'role':_0xf376('0x38'),'internal':_0x3a73b3[_0xf376('0x2d')]['internal'],'uniqueid':_0x3a73b3[_0xf376('0x2b')][_0xf376('0x2c')][_0x505500][_0x35341a]}});}}}}return respondWithRpcPromise(_0xf376('0x39'),{'id':_0x3a73b3[_0xf376('0x1c')]['id'],'capacity':_0x3a73b3['body']['capacity']},routingClient)[_0xf376('0x16')](respondWithResult(_0x4dc223,null))['catch'](handleError(_0x4dc223,null));};exports[_0xf376('0x3a')]=function(_0x14995e,_0xfe9f72){return respondWithRpcPromise(_0xf376('0x3b'),_0x14995e[_0xf376('0x15')])[_0xf376('0x16')](respondWithResult(_0xfe9f72,null))[_0xf376('0xb')](handleError(_0xfe9f72,null));};exports['trunks']=function(_0x3c3ef5,_0x176b10){return respondWithRpcPromise(_0xf376('0x3c'),_0x3c3ef5[_0xf376('0x15')])[_0xf376('0x16')](respondWithResult(_0x176b10,null))[_0xf376('0xb')](handleError(_0x176b10,null));};exports[_0xf376('0x3d')]=function(_0x1dc2d6,_0x5be494){return respondWithRpcPromise('Campaigns',_0x1dc2d6['query'])['then'](respondWithResult(_0x5be494,null))['catch'](handleError(_0x5be494,null));};exports[_0xf376('0x3e')]=function(_0x3841dc,_0x327051){return respondWithRpcPromise(_0xf376('0x3f'),_0x3841dc[_0xf376('0x15')],routingClient)[_0xf376('0x16')](respondWithResult(_0x327051,null))[_0xf376('0xb')](handleError(_0x327051,null));};exports[_0xf376('0x40')]=function(_0x434e10,_0x5439aa){return respondWithRpcPromise('ChatQueues',_0x434e10[_0xf376('0x15')],routingClient)[_0xf376('0x16')](findById(_0x434e10[_0xf376('0x1c')]['id']))[_0xf376('0x16')](respondWithResult(_0x5439aa,null))[_0xf376('0xb')](handleError(_0x5439aa,null));};exports['mailQueues']=function(_0x32695c,_0x3285a6){return respondWithRpcPromise(_0xf376('0x41'),_0x32695c['query'],routingClient)[_0xf376('0x16')](respondWithResult(_0x3285a6,null))[_0xf376('0xb')](handleError(_0x3285a6,null));};exports['showMailQueues']=function(_0x28e7b5,_0x36aa2d){return respondWithRpcPromise('MailQueues',_0x28e7b5[_0xf376('0x15')],routingClient)[_0xf376('0x16')](findById(_0x28e7b5[_0xf376('0x1c')]['id']))[_0xf376('0x16')](respondWithResult(_0x36aa2d,null))[_0xf376('0xb')](handleError(_0x36aa2d,null));};exports['mailAccounts']=function(_0x3956a8,_0x45cc72){return respondWithRpcPromise(_0xf376('0x42'),_0x3956a8[_0xf376('0x15')],mailClient)[_0xf376('0x16')](respondWithResult(_0x45cc72,null))['catch'](handleError(_0x45cc72,null));};exports[_0xf376('0x43')]=function(_0x2cf1ac,_0x202031){return respondWithRpcPromise(_0xf376('0x44'),_0x2cf1ac[_0xf376('0x15')],routingClient)[_0xf376('0x16')](respondWithResult(_0x202031,null))['catch'](handleError(_0x202031,null));};exports[_0xf376('0x45')]=function(_0x30ad70,_0x3cf19a){return respondWithRpcPromise(_0xf376('0x44'),_0x30ad70['query'],routingClient)[_0xf376('0x16')](findById(_0x30ad70[_0xf376('0x1c')]['id']))[_0xf376('0x16')](respondWithResult(_0x3cf19a,null))[_0xf376('0xb')](handleError(_0x3cf19a,null));};exports[_0xf376('0x46')]=function(_0x51d481,_0x3043a3){return respondWithRpcPromise(_0xf376('0x47'),_0x51d481[_0xf376('0x15')],routingClient)[_0xf376('0x16')](respondWithResult(_0x3043a3,null))[_0xf376('0xb')](handleError(_0x3043a3,null));};exports[_0xf376('0x48')]=function(_0x5a2142,_0x506c6d){return respondWithRpcPromise(_0xf376('0x47'),_0x5a2142[_0xf376('0x15')],routingClient)['then'](findById(_0x5a2142['params']['id']))['then'](respondWithResult(_0x506c6d,null))['catch'](handleError(_0x506c6d,null));};exports[_0xf376('0x49')]=function(_0x24a411,_0x17a437){return respondWithRpcPromise(_0xf376('0x4a'),_0x24a411[_0xf376('0x15')],routingClient)['then'](respondWithResult(_0x17a437,null))[_0xf376('0xb')](handleError(_0x17a437,null));};exports[_0xf376('0x4b')]=function(_0x459b72,_0x58f3cd){return respondWithRpcPromise(_0xf376('0x4a'),_0x459b72['query'],routingClient)[_0xf376('0x16')](findById(_0x459b72[_0xf376('0x1c')]['id']))[_0xf376('0x16')](respondWithResult(_0x58f3cd,null))[_0xf376('0xb')](handleError(_0x58f3cd,null));};exports[_0xf376('0x4c')]=function(_0x2ac836,_0x27d745){return respondWithRpcPromise('FaxAccounts',_0x2ac836[_0xf376('0x15')])[_0xf376('0x16')](respondWithResult(_0x27d745,null))['catch'](handleError(_0x27d745,null));};exports['chatQueuesWaitingInteractions']=function(_0x59e2f0,_0x510653){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x59e2f0['query'],routingClient)[_0xf376('0x16')](respondWithResult(_0x510653,null))['catch'](handleError(_0x510653,null));};exports[_0xf376('0x4d')]=function(_0x774fa,_0x3e7696){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x774fa['query'],routingClient)[_0xf376('0x16')](respondWithResult(_0x3e7696,null))[_0xf376('0xb')](handleError(_0x3e7696,null));};exports[_0xf376('0x4e')]=function(_0x3dd204,_0x1e0662){return respondWithRpcPromise(_0xf376('0x4f'),_0x3dd204[_0xf376('0x15')],routingClient)['then'](respondWithResult(_0x1e0662,null))[_0xf376('0xb')](handleError(_0x1e0662,null));};exports[_0xf376('0x50')]=function(_0x5730df,_0x1ae2e0){return respondWithRpcPromise(_0xf376('0x51'),_0x5730df[_0xf376('0x15')],routingClient)[_0xf376('0x16')](respondWithResult(_0x1ae2e0,null))['catch'](handleError(_0x1ae2e0,null));};exports[_0xf376('0x52')]=function(_0xa3c418,_0x2eb715){return respondWithRpcPromise(_0xf376('0x53'),_0xa3c418[_0xf376('0x15')],routingClient)['then'](respondWithResult(_0x2eb715,null))[_0xf376('0xb')](handleError(_0x2eb715,null));};exports[_0xf376('0x54')]=function(_0x56776d){return function(_0x324f0d,_0x2469d5){var _0x4716a9,_0x74499c;var _0x233fc6=_[_0xf376('0x55')](_0x56776d);var _0x118248=_0x56776d===_0xf376('0x56')?'Website':'Account';return db[_0x233fc6+_0xf376('0x57')][_0xf376('0x58')]({'raw':!![],'where':{'id':_0x324f0d[_0xf376('0x1c')]['id']}})[_0xf376('0x16')](function(_0x2f6d75){if(_[_0xf376('0x11')](_0x2f6d75)){throw new Error(_0x233fc6+_0xf376('0x59'));}_0x4716a9=_0x2f6d75;return db[_0x233fc6+_0xf376('0x5a')][_0xf376('0x58')]({'where':{'id':_0x324f0d[_0xf376('0x2b')][_0xf376('0x5b')]},'include':[{'model':db[_0x233fc6+_0xf376('0x5c')],'as':_0xf376('0x5c')},{'model':db[_0x233fc6+_0x118248],'as':_0xf376('0x5d')}]});})['then'](function(_0x5dd8b8){if(_['isNil'](_0x5dd8b8)){throw new Error(_0x233fc6+_0xf376('0x5e'));}_0x74499c=_0x5dd8b8;return _0x5dd8b8[_0xf376('0x5f')]({'read':0x0,'readAt':null,'UserId':null});})[_0xf376('0x16')](function(){var _0x319b9f={'uniqueid':_0x56776d+'.'+_0x74499c['id']+'.'+_0x74499c['Interaction']['id'],'FromUserId':_0x324f0d['user']['id'],'type':_0xf376('0x60')};_0x319b9f[_0x233fc6+_0xf376('0x61')]=_0x74499c['id'];_0x319b9f[_0x233fc6+_0xf376('0x62')]=_0x74499c['Interaction']['id'];_0x319b9f[_0xf376('0x63')+_0x233fc6+_0x118248+'Id']=_0x74499c['Account']['id'];_0x319b9f['To'+_0x233fc6+_0xf376('0x64')]=_0x4716a9['id'];return db[_0x233fc6+_0xf376('0x65')]['create'](_0x319b9f);})[_0xf376('0x16')](function(){return respondWithRpcPromise(_0xf376('0x66'),{'channel':_0x56776d,'interaction':_0x74499c[_0xf376('0x5c')],'message':_0x74499c,'account':_0x74499c[_0xf376('0x5d')],'applications':[{'id':0x0,'priority':0x1,'app':_0xf376('0x60'),'appdata':_0x4716a9[_0xf376('0xf')]+','+(_0x74499c[_0xf376('0x5d')][_0xf376('0x67')]||0x12c),'interval':_0xf376('0x68')}]},routingClient);})[_0xf376('0x16')](respondWithResult(_0x2469d5,null))[_0xf376('0xb')](handleError(_0x2469d5,null));};};exports['agentNotify']=function(_0x5c4aac,_0x1908f9){var _0x32e4fd,_0x557398;if(_['isNil'](_0x5c4aac[_0xf376('0x2b')][_0xf376('0x69')])){throw new Error(_0xf376('0x6a'));}var _0x45c0c9=_0x5c4aac['body'][_0xf376('0x69')];var _0x59165d=_[_0xf376('0x55')](_0x45c0c9);var _0x4a057e=_0x45c0c9==='chat'?_0xf376('0x6b'):'Account';return db['User']['findOne']({'raw':!![],'where':{'id':_0x5c4aac[_0xf376('0x1c')]['id'],'role':_0xf376('0x38')}})[_0xf376('0x16')](function(_0x512c42){if(_[_0xf376('0x11')](_0x512c42)){throw new Error('Agent\x20not\x20found');}_0x32e4fd=_0x512c42;return db[_0x59165d+'Message'][_0xf376('0x58')]({'where':{'id':_0x5c4aac['body'][_0xf376('0x5b')]},'include':[{'model':db[_0x59165d+'Interaction'],'as':'Interaction'},{'model':db[_0x59165d+_0x4a057e],'as':_0xf376('0x5d')}]});})[_0xf376('0x16')](function(_0x5ec5ba){if(_['isNil'](_0x5ec5ba)){throw new Error(_0x59165d+_0xf376('0x5e'));}_0x557398=_0x5ec5ba;return _0x5ec5ba['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xf376('0x16')](function(){var _0xa2505d={'uniqueid':_0x45c0c9+'.'+_0x557398['id']+'.'+_0x557398[_0xf376('0x5c')]['id'],'FromUserId':_0x5c4aac[_0xf376('0x2d')]['id'],'type':_0xf376('0x60'),'ToUserId':_0x32e4fd['id']};_0xa2505d[_0x59165d+_0xf376('0x61')]=_0x557398['id'];_0xa2505d[_0x59165d+_0xf376('0x62')]=_0x557398[_0xf376('0x5c')]['id'];_0xa2505d[_0xf376('0x63')+_0x59165d+_0x4a057e+'Id']=_0x557398[_0xf376('0x5d')]['id'];return db[_0x59165d+_0xf376('0x65')][_0xf376('0x6c')](_0xa2505d);})['then'](function(){return respondWithRpcPromise(_0xf376('0x66'),{'channel':_0x45c0c9,'interaction':_0x557398[_0xf376('0x5c')],'message':_0x557398,'account':_0x557398[_0xf376('0x5d')],'applications':[{'id':0x0,'priority':0x1,'app':_0xf376('0x38'),'appdata':_0x32e4fd[_0xf376('0xf')]+','+(_0x557398[_0xf376('0x5d')]['agentTransferTimeout']||0x12c),'interval':_0xf376('0x68')}]},routingClient);})['then'](respondWithResult(_0x1908f9,null))['catch'](handleError(_0x1908f9,null));}; \ No newline at end of file +var _0x9559=['FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','messageId','Interaction','\x20Message\x20not\x20found','MessageId','InteractionId','From','Start','queueTransferTimeout','agentNotify','Channel\x20field\x20is\x20mandatory','channel','User','Agent\x20not\x20found','Message','update','queue','TransferReport','create','agentTransferTimeout','*,*,*,*','bluebird','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','catch','status','json','sendStatus','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','OutboundChannels','agents','Agents','body','interaction','user','name','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','updateAttributes','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','Telephones','trunks','Trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','showOpenchannelQueues','smsQueues','SmsQueues','faxQueues'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9559,0x184));var _0x9955=function(_0x5e2751,_0x518a55){_0x5e2751=_0x5e2751-0x0;var _0x139a39=_0x9559[_0x5e2751];return _0x139a39;};'use strict';var BPromise=require(_0x9955('0x0'));var moment=require('moment');var _=require(_0x9955('0x1'));var util=require(_0x9955('0x2'));var db=require(_0x9955('0x3'))['db'];var logger=require(_0x9955('0x4'))(_0x9955('0x5'));var jayson=require(_0x9955('0x6'));var amiClient=jayson[_0x9955('0x7')][_0x9955('0x8')]({'port':0x232a});var mailClient=jayson[_0x9955('0x7')][_0x9955('0x8')]({'port':0x232b});var routingClient=jayson[_0x9955('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x311d0f,_0xbc1f10,_0x70dc49){return new BPromise(function(_0x241333,_0xa8a244){var _0x39a2c8=_0x70dc49?_0x70dc49:amiClient;return _0x39a2c8[_0x9955('0x9')](_0x311d0f,_0xbc1f10)[_0x9955('0xa')](function(_0x332fd9){if(_0x332fd9[_0x9955('0xb')]){if(_0x332fd9[_0x9955('0xb')][_0x9955('0xc')]===0x1f4){return _0xa8a244(_0x332fd9['error'][_0x9955('0xd')]);}return _0x241333(_0x332fd9[_0x9955('0xb')][_0x9955('0xd')]);}else{_0x241333(_0x332fd9['result']);}})[_0x9955('0xe')](function(_0x49d899){_0xa8a244(_0x49d899);});});}function respondWithResult(_0x53fcc0,_0x34b587){_0x34b587=_0x34b587||0xc8;return function(_0x3a373b){if(_0x3a373b){return _0x53fcc0[_0x9955('0xf')](_0x34b587)[_0x9955('0x10')](_0x3a373b);}return _0x53fcc0[_0x9955('0x11')](0x194);};}function handleError(_0x24e1b8,_0x2a39b4){_0x2a39b4=_0x2a39b4||0x1f4;return function(_0x32a262){logger['error'](_0x32a262['stack']);if(_0x32a262['name']){delete _0x32a262['name'];}_0x24e1b8[_0x9955('0xf')](_0x2a39b4)[_0x9955('0x12')](_0x32a262);};}function findById(_0x5cb3ab){return function(_0x2ca80e){if(!_['isNil'](_0x5cb3ab)&&!_['isNil'](_0x2ca80e)&&!_[_0x9955('0x13')](_0x2ca80e[_0x9955('0x14')])){return _[_0x9955('0x15')](_0x2ca80e[_0x9955('0x14')],function(_0x4aed3f){return _0x4aed3f['id']==_0x5cb3ab;});}return null;};}exports[_0x9955('0x16')]=function(_0x29223c,_0x26ee30){return respondWithRpcPromise(_0x9955('0x17'),_0x29223c[_0x9955('0x18')])[_0x9955('0xa')](respondWithResult(_0x26ee30,null))[_0x9955('0xe')](handleError(_0x26ee30,null));};exports[_0x9955('0x19')]=function(_0x260889,_0x58fcf2){return respondWithRpcPromise(_0x9955('0x1a'),_[_0x9955('0x1b')](_0x260889['query'],_0x260889[_0x9955('0x1c')]))[_0x9955('0xa')](respondWithResult(_0x58fcf2,null))[_0x9955('0xe')](handleError(_0x58fcf2,null));};exports[_0x9955('0x1d')]=function(_0x3fbe04,_0xdf4836){return respondWithRpcPromise(_0x9955('0x1e'),_[_0x9955('0x1b')](_0x3fbe04[_0x9955('0x18')],_0x3fbe04['params']))[_0x9955('0xa')](respondWithResult(_0xdf4836,null))[_0x9955('0xe')](handleError(_0xdf4836,null));};exports[_0x9955('0x1f')]=function(_0x5a20fa,_0x5f36a5){return respondWithRpcPromise(_0x9955('0x20'),_0x5a20fa[_0x9955('0x18')])[_0x9955('0xa')](respondWithResult(_0x5f36a5,null))['catch'](handleError(_0x5f36a5,null));};exports['showVoiceQueues']=function(_0x38d0ea,_0xffb7f7){return respondWithRpcPromise('VoiceQueues',_0x38d0ea['query'])['then'](findById(_0x38d0ea['params']['id']))['then'](respondWithResult(_0xffb7f7,null))[_0x9955('0xe')](handleError(_0xffb7f7,null));};exports[_0x9955('0x21')]=function(_0x22c006,_0x37de82){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x9955('0x1b')](_0x22c006[_0x9955('0x18')],_0x22c006[_0x9955('0x1c')]))[_0x9955('0xa')](respondWithResult(_0x37de82,null))[_0x9955('0xe')](handleError(_0x37de82,null));};exports[_0x9955('0x22')]=function(_0x21dc6d,_0x1b90a8){return respondWithRpcPromise(_0x9955('0x23'),_0x21dc6d[_0x9955('0x18')])[_0x9955('0xa')](respondWithResult(_0x1b90a8,null))[_0x9955('0xe')](handleError(_0x1b90a8,null));};exports['voiceQueuesChannel']=function(_0x2b6f48,_0x278916){return respondWithRpcPromise(_0x9955('0x24'),_['merge'](_0x2b6f48['query'],_0x2b6f48[_0x9955('0x1c')]))[_0x9955('0xa')](respondWithResult(_0x278916,null))[_0x9955('0xe')](handleError(_0x278916,null));};exports[_0x9955('0x25')]=function(_0x264737,_0xf7edf4){return respondWithRpcPromise(_0x9955('0x26'),_[_0x9955('0x1b')](_0x264737[_0x9955('0x18')],_0x264737[_0x9955('0x1c')]))['then'](respondWithResult(_0xf7edf4,null))[_0x9955('0xe')](handleError(_0xf7edf4,null));};exports[_0x9955('0x27')]=function(_0x4cb68e,_0x43a47a){return respondWithRpcPromise(_0x9955('0x28'),_['merge'](_0x4cb68e[_0x9955('0x18')],_0x4cb68e[_0x9955('0x1c')]))[_0x9955('0xa')](respondWithResult(_0x43a47a,null))[_0x9955('0xe')](handleError(_0x43a47a,null));};exports[_0x9955('0x29')]=function(_0x3d83eb,_0x5c1502){return respondWithRpcPromise(_0x9955('0x2a'),_0x3d83eb[_0x9955('0x18')])[_0x9955('0xa')](respondWithResult(_0x5c1502,null))[_0x9955('0xe')](handleError(_0x5c1502,null));};exports['outboundChannels']=function(_0x12aabd,_0x229888){return respondWithRpcPromise(_0x9955('0x2b'),_0x12aabd[_0x9955('0x18')])['then'](respondWithResult(_0x229888,null))[_0x9955('0xe')](handleError(_0x229888,null));};exports[_0x9955('0x2c')]=function(_0x441b14,_0x40d622){var _0x9d140b;return respondWithRpcPromise(_0x9955('0x2d'),_0x441b14[_0x9955('0x18')])[_0x9955('0xa')](function(_0x1dffbc){_0x9d140b=_0x1dffbc;return respondWithRpcPromise(_0x9955('0x2d'),_0x441b14[_0x9955('0x18')],routingClient);})[_0x9955('0xa')](function(_0x4757bc){return _[_0x9955('0x1b')]({},_0x4757bc,_0x9d140b);})[_0x9955('0xa')](respondWithResult(_0x40d622,null))[_0x9955('0xe')](handleError(_0x40d622,null));};exports['agentCapacity']=function(_0x1aaaa4,_0x474f2d){if(_0x1aaaa4[_0x9955('0x2e')]&&_0x1aaaa4[_0x9955('0x2e')][_0x9955('0x2f')]&&_0x1aaaa4[_0x9955('0x30')]&&_0x1aaaa4[_0x9955('0x30')][_0x9955('0x31')]){for(var _0x3018dc in _0x1aaaa4[_0x9955('0x2e')][_0x9955('0x2f')]){if(_0x1aaaa4['body'][_0x9955('0x2f')][_0x9955('0x32')](_0x3018dc)){db[_0x9955('0x33')][_0x9955('0x34')]({'where':{'channel':_0x3018dc,'membername':_0x1aaaa4[_0x9955('0x30')]['name'],'type':_0x9955('0x35'),'exitAt':null,'uniqueid':_0x1aaaa4[_0x9955('0x2e')][_0x9955('0x2f')][_0x3018dc]&&_0x1aaaa4[_0x9955('0x2e')][_0x9955('0x2f')][_0x3018dc][_0x9955('0x36')]?{'$notIn':_0x1aaaa4[_0x9955('0x2e')][_0x9955('0x2f')][_0x3018dc]}:{'$ne':null}}})['then'](function(_0x2ac78d){var _0x23a52f=moment()[_0x9955('0x37')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x1d1fea=0x0,_0x166391=_0x2ac78d['length'];_0x1d1fea<_0x166391;_0x1d1fea+=0x1){_0x2ac78d[_0x1d1fea][_0x9955('0x38')]({'exitAt':_0x23a52f});}});for(var _0x7ef16d=0x0;_0x7ef16d<_0x1aaaa4[_0x9955('0x2e')][_0x9955('0x2f')][_0x3018dc]['length'];_0x7ef16d+=0x1){db['MemberReport']['findOrCreate']({'where':{'channel':_0x3018dc,'membername':_0x1aaaa4[_0x9955('0x30')][_0x9955('0x31')],'type':'INTERACTION','uniqueid':_0x1aaaa4[_0x9955('0x2e')][_0x9955('0x2f')][_0x3018dc][_0x7ef16d],'exitAt':null},'defaults':{'channel':_0x3018dc,'membername':_0x1aaaa4['user'][_0x9955('0x31')],'interface':_[_0x9955('0x13')](_0x1aaaa4[_0x9955('0x30')][_0x9955('0x39')])?util[_0x9955('0x37')](_0x9955('0x3a'),_0x1aaaa4[_0x9955('0x30')][_0x9955('0x31')]):_0x1aaaa4[_0x9955('0x30')][_0x9955('0x39')],'type':_0x9955('0x35'),'enterAt':moment()[_0x9955('0x37')](_0x9955('0x3b')),'role':_0x9955('0x3c'),'internal':_0x1aaaa4[_0x9955('0x30')][_0x9955('0x3d')],'uniqueid':_0x1aaaa4[_0x9955('0x2e')][_0x9955('0x2f')][_0x3018dc][_0x7ef16d]}});}}}}return respondWithRpcPromise(_0x9955('0x3e'),{'id':_0x1aaaa4[_0x9955('0x1c')]['id'],'capacity':_0x1aaaa4[_0x9955('0x2e')][_0x9955('0x3f')]},routingClient)[_0x9955('0xa')](respondWithResult(_0x474f2d,null))[_0x9955('0xe')](handleError(_0x474f2d,null));};exports['telephones']=function(_0x4faab0,_0x2bb6f0){return respondWithRpcPromise(_0x9955('0x40'),_0x4faab0[_0x9955('0x18')])[_0x9955('0xa')](respondWithResult(_0x2bb6f0,null))[_0x9955('0xe')](handleError(_0x2bb6f0,null));};exports[_0x9955('0x41')]=function(_0x1f3267,_0xb2c483){return respondWithRpcPromise(_0x9955('0x42'),_0x1f3267[_0x9955('0x18')])[_0x9955('0xa')](respondWithResult(_0xb2c483,null))[_0x9955('0xe')](handleError(_0xb2c483,null));};exports['campaigns']=function(_0x31e8d7,_0xe8059c){return respondWithRpcPromise(_0x9955('0x43'),_0x31e8d7[_0x9955('0x18')])['then'](respondWithResult(_0xe8059c,null))[_0x9955('0xe')](handleError(_0xe8059c,null));};exports[_0x9955('0x44')]=function(_0x49bd8e,_0x9599e2){return respondWithRpcPromise(_0x9955('0x45'),_0x49bd8e[_0x9955('0x18')],routingClient)[_0x9955('0xa')](respondWithResult(_0x9599e2,null))[_0x9955('0xe')](handleError(_0x9599e2,null));};exports[_0x9955('0x46')]=function(_0x525cca,_0x2ec661){return respondWithRpcPromise(_0x9955('0x45'),_0x525cca[_0x9955('0x18')],routingClient)[_0x9955('0xa')](findById(_0x525cca['params']['id']))[_0x9955('0xa')](respondWithResult(_0x2ec661,null))[_0x9955('0xe')](handleError(_0x2ec661,null));};exports[_0x9955('0x47')]=function(_0x4f02ea,_0x12d46a){return respondWithRpcPromise('MailQueues',_0x4f02ea[_0x9955('0x18')],routingClient)[_0x9955('0xa')](respondWithResult(_0x12d46a,null))[_0x9955('0xe')](handleError(_0x12d46a,null));};exports[_0x9955('0x48')]=function(_0x239e49,_0x294df2){return respondWithRpcPromise(_0x9955('0x49'),_0x239e49[_0x9955('0x18')],routingClient)['then'](findById(_0x239e49[_0x9955('0x1c')]['id']))[_0x9955('0xa')](respondWithResult(_0x294df2,null))['catch'](handleError(_0x294df2,null));};exports[_0x9955('0x4a')]=function(_0x8a55c5,_0x109367){return respondWithRpcPromise(_0x9955('0x4b'),_0x8a55c5[_0x9955('0x18')],mailClient)[_0x9955('0xa')](respondWithResult(_0x109367,null))['catch'](handleError(_0x109367,null));};exports['openchannelQueues']=function(_0x5ac2c5,_0x122f37){return respondWithRpcPromise('OpenchannelQueues',_0x5ac2c5[_0x9955('0x18')],routingClient)[_0x9955('0xa')](respondWithResult(_0x122f37,null))[_0x9955('0xe')](handleError(_0x122f37,null));};exports[_0x9955('0x4c')]=function(_0x14bfe2,_0x444031){return respondWithRpcPromise('OpenchannelQueues',_0x14bfe2[_0x9955('0x18')],routingClient)[_0x9955('0xa')](findById(_0x14bfe2['params']['id']))['then'](respondWithResult(_0x444031,null))[_0x9955('0xe')](handleError(_0x444031,null));};exports[_0x9955('0x4d')]=function(_0x4cb74c,_0x4de980){return respondWithRpcPromise('SmsQueues',_0x4cb74c[_0x9955('0x18')],routingClient)[_0x9955('0xa')](respondWithResult(_0x4de980,null))['catch'](handleError(_0x4de980,null));};exports['showSmsQueues']=function(_0x122908,_0x36b21a){return respondWithRpcPromise(_0x9955('0x4e'),_0x122908[_0x9955('0x18')],routingClient)['then'](findById(_0x122908[_0x9955('0x1c')]['id']))[_0x9955('0xa')](respondWithResult(_0x36b21a,null))[_0x9955('0xe')](handleError(_0x36b21a,null));};exports[_0x9955('0x4f')]=function(_0x55ec0c,_0x49e6b8){return respondWithRpcPromise(_0x9955('0x50'),_0x55ec0c[_0x9955('0x18')],routingClient)[_0x9955('0xa')](respondWithResult(_0x49e6b8,null))[_0x9955('0xe')](handleError(_0x49e6b8,null));};exports[_0x9955('0x51')]=function(_0x4e5e2c,_0x5bda4e){return respondWithRpcPromise(_0x9955('0x50'),_0x4e5e2c[_0x9955('0x18')],routingClient)[_0x9955('0xa')](findById(_0x4e5e2c[_0x9955('0x1c')]['id']))[_0x9955('0xa')](respondWithResult(_0x5bda4e,null))[_0x9955('0xe')](handleError(_0x5bda4e,null));};exports[_0x9955('0x52')]=function(_0x5d5970,_0xe082d5){return respondWithRpcPromise(_0x9955('0x53'),_0x5d5970[_0x9955('0x18')])[_0x9955('0xa')](respondWithResult(_0xe082d5,null))['catch'](handleError(_0xe082d5,null));};exports['chatQueuesWaitingInteractions']=function(_0x32eea4,_0x3d31d7){return respondWithRpcPromise(_0x9955('0x54'),_0x32eea4['query'],routingClient)[_0x9955('0xa')](respondWithResult(_0x3d31d7,null))['catch'](handleError(_0x3d31d7,null));};exports[_0x9955('0x55')]=function(_0x10616d,_0x58b941){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x10616d[_0x9955('0x18')],routingClient)['then'](respondWithResult(_0x58b941,null))[_0x9955('0xe')](handleError(_0x58b941,null));};exports[_0x9955('0x56')]=function(_0x4a6e93,_0x126623){return respondWithRpcPromise(_0x9955('0x57'),_0x4a6e93[_0x9955('0x18')],routingClient)['then'](respondWithResult(_0x126623,null))[_0x9955('0xe')](handleError(_0x126623,null));};exports['smsQueuesWaitingInteractions']=function(_0x17186e,_0x55ac0c){return respondWithRpcPromise(_0x9955('0x58'),_0x17186e[_0x9955('0x18')],routingClient)[_0x9955('0xa')](respondWithResult(_0x55ac0c,null))[_0x9955('0xe')](handleError(_0x55ac0c,null));};exports[_0x9955('0x59')]=function(_0x5931c2,_0x33c686){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x5931c2['query'],routingClient)[_0x9955('0xa')](respondWithResult(_0x33c686,null))[_0x9955('0xe')](handleError(_0x33c686,null));};exports[_0x9955('0x5a')]=function(_0xd8b2d4){return function(_0x11da09,_0x1ff566){var _0x326db4,_0x5a91b2;var _0x37d344=_[_0x9955('0x5b')](_0xd8b2d4);var _0xd63bea=_0xd8b2d4===_0x9955('0x5c')?_0x9955('0x5d'):_0x9955('0x5e');return db[_0x37d344+_0x9955('0x5f')][_0x9955('0x60')]({'raw':!![],'where':{'id':_0x11da09['params']['id']}})['then'](function(_0x1fdd62){if(_[_0x9955('0x13')](_0x1fdd62)){throw new Error(_0x37d344+'\x20Queue\x20not\x20found');}_0x326db4=_0x1fdd62;return db[_0x37d344+'Message'][_0x9955('0x60')]({'where':{'id':_0x11da09[_0x9955('0x2e')][_0x9955('0x61')]},'include':[{'model':db[_0x37d344+_0x9955('0x62')],'as':'Interaction'},{'model':db[_0x37d344+_0xd63bea],'as':_0x9955('0x5e')}]});})['then'](function(_0x55942b){if(_[_0x9955('0x13')](_0x55942b)){throw new Error(_0x37d344+_0x9955('0x63'));}_0x5a91b2=_0x55942b;return _0x55942b['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x9955('0xa')](function(){var _0x10705b={'uniqueid':_0xd8b2d4+'.'+_0x5a91b2['id']+'.'+_0x5a91b2[_0x9955('0x62')]['id'],'FromUserId':_0x11da09[_0x9955('0x30')]['id'],'type':'queue'};_0x10705b[_0x37d344+_0x9955('0x64')]=_0x5a91b2['id'];_0x10705b[_0x37d344+_0x9955('0x65')]=_0x5a91b2[_0x9955('0x62')]['id'];_0x10705b[_0x9955('0x66')+_0x37d344+_0xd63bea+'Id']=_0x5a91b2[_0x9955('0x5e')]['id'];_0x10705b['To'+_0x37d344+'QueueId']=_0x326db4['id'];return db[_0x37d344+'TransferReport']['create'](_0x10705b);})[_0x9955('0xa')](function(){return respondWithRpcPromise(_0x9955('0x67'),{'channel':_0xd8b2d4,'interaction':_0x5a91b2['Interaction'],'message':_0x5a91b2,'account':_0x5a91b2['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x326db4['name']+','+(_0x5a91b2[_0x9955('0x5e')][_0x9955('0x68')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x9955('0xa')](respondWithResult(_0x1ff566,null))[_0x9955('0xe')](handleError(_0x1ff566,null));};};exports[_0x9955('0x69')]=function(_0x40fdcc,_0x53e26a){var _0x39d93f,_0x3f4955;if(_[_0x9955('0x13')](_0x40fdcc[_0x9955('0x2e')]['channel'])){throw new Error(_0x9955('0x6a'));}var _0x58d0cc=_0x40fdcc[_0x9955('0x2e')][_0x9955('0x6b')];var _0x172ccc=_['capitalize'](_0x58d0cc);var _0x43f089=_0x58d0cc===_0x9955('0x5c')?'Website':'Account';return db[_0x9955('0x6c')][_0x9955('0x60')]({'raw':!![],'where':{'id':_0x40fdcc[_0x9955('0x1c')]['id'],'role':'agent'}})[_0x9955('0xa')](function(_0x243f2e){if(_[_0x9955('0x13')](_0x243f2e)){throw new Error(_0x9955('0x6d'));}_0x39d93f=_0x243f2e;return db[_0x172ccc+_0x9955('0x6e')]['findOne']({'where':{'id':_0x40fdcc[_0x9955('0x2e')][_0x9955('0x61')]},'include':[{'model':db[_0x172ccc+'Interaction'],'as':_0x9955('0x62')},{'model':db[_0x172ccc+_0x43f089],'as':_0x9955('0x5e')}]});})[_0x9955('0xa')](function(_0x18f512){if(_[_0x9955('0x13')](_0x18f512)){throw new Error(_0x172ccc+'\x20Message\x20not\x20found');}_0x3f4955=_0x18f512;return _0x18f512[_0x9955('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0x9955('0xa')](function(){var _0x5a4b7b={'uniqueid':_0x58d0cc+'.'+_0x3f4955['id']+'.'+_0x3f4955[_0x9955('0x62')]['id'],'FromUserId':_0x40fdcc[_0x9955('0x30')]['id'],'type':_0x9955('0x70'),'ToUserId':_0x39d93f['id']};_0x5a4b7b[_0x172ccc+_0x9955('0x64')]=_0x3f4955['id'];_0x5a4b7b[_0x172ccc+'InteractionId']=_0x3f4955[_0x9955('0x62')]['id'];_0x5a4b7b[_0x9955('0x66')+_0x172ccc+_0x43f089+'Id']=_0x3f4955['Account']['id'];return db[_0x172ccc+_0x9955('0x71')][_0x9955('0x72')](_0x5a4b7b);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x58d0cc,'interaction':_0x3f4955[_0x9955('0x62')],'message':_0x3f4955,'account':_0x3f4955['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x39d93f[_0x9955('0x31')]+','+(_0x3f4955[_0x9955('0x5e')][_0x9955('0x73')]||0x12c),'interval':_0x9955('0x74')}]},routingClient);})['then'](respondWithResult(_0x53e26a,null))['catch'](handleError(_0x53e26a,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 1c6d4d1..05405a8 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 _0x819b=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','show','/:id/run','run','post','create','put','update','/:id','destroy','exports','multer','util','connect-timeout'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x819b,0x14d));var _0xb819=function(_0x1c6d4f,_0x37e880){_0x1c6d4f=_0x1c6d4f-0x0;var _0x2598af=_0x819b[_0x1c6d4f];return _0x2598af;};'use strict';var multer=require(_0xb819('0x0'));var util=require(_0xb819('0x1'));var path=require('path');var timeout=require(_0xb819('0x2'));var express=require('express');var router=express[_0xb819('0x3')]();var auth=require(_0xb819('0x4'));var interaction=require(_0xb819('0x5'));var config=require(_0xb819('0x6'));var controller=require(_0xb819('0x7'));router[_0xb819('0x8')]('/',auth[_0xb819('0x9')](),controller[_0xb819('0xa')]);router['get']('/:id',auth[_0xb819('0x9')](),controller[_0xb819('0xb')]);router[_0xb819('0x8')](_0xb819('0xc'),auth[_0xb819('0x9')](),controller[_0xb819('0xd')]);router[_0xb819('0xe')]('/',auth[_0xb819('0x9')](),controller[_0xb819('0xf')]);router[_0xb819('0x10')]('/:id',auth[_0xb819('0x9')](),controller[_0xb819('0x11')]);router['delete'](_0xb819('0x12'),auth[_0xb819('0x9')](),controller[_0xb819('0x13')]);module[_0xb819('0x14')]=router; \ No newline at end of file +var _0xccad=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/:id','/:id/run','run'];(function(_0x5a049b,_0x1cb3cc){var _0x1548bd=function(_0x5a626e){while(--_0x5a626e){_0x5a049b['push'](_0x5a049b['shift']());}};_0x1548bd(++_0x1cb3cc);}(_0xccad,0xbb));var _0xdcca=function(_0x912d27,_0x28e0e3){_0x912d27=_0x912d27-0x0;var _0x31b918=_0xccad[_0x912d27];return _0x31b918;};'use strict';var multer=require(_0xdcca('0x0'));var util=require(_0xdcca('0x1'));var path=require(_0xdcca('0x2'));var timeout=require(_0xdcca('0x3'));var express=require(_0xdcca('0x4'));var router=express[_0xdcca('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdcca('0x6'));var controller=require('./schedule.controller');router[_0xdcca('0x7')]('/',auth[_0xdcca('0x8')](),controller[_0xdcca('0x9')]);router[_0xdcca('0x7')](_0xdcca('0xa'),auth[_0xdcca('0x8')](),controller['show']);router[_0xdcca('0x7')](_0xdcca('0xb'),auth['isAuthenticated'](),controller[_0xdcca('0xc')]);router[_0xdcca('0xd')]('/',auth['isAuthenticated'](),controller[_0xdcca('0xe')]);router[_0xdcca('0xf')](_0xdcca('0xa'),auth['isAuthenticated'](),controller[_0xdcca('0x10')]);router[_0xdcca('0x11')](_0xdcca('0xa'),auth[_0xdcca('0x8')](),controller[_0xdcca('0x12')]);module[_0xdcca('0x13')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 1d6e324..e74a156 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 _0xf006=['pdf','xlsx','custom','default','BOOLEAN','TEXT','STRING','DATE','ENUM','years','quarters','weeks','hours','minutes','days','csv'];(function(_0x275f22,_0x18d95c){var _0x5993ed=function(_0x2a1ff0){while(--_0x2a1ff0){_0x275f22['push'](_0x275f22['shift']());}};_0x5993ed(++_0x18d95c);}(_0xf006,0x146));var _0x6f00=function(_0x422068,_0x319ac3){_0x422068=_0x422068-0x0;var _0x32fc80=_0xf006[_0x422068];return _0x32fc80;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6f00('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x6f00('0x0')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x6f00('0x0')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x6f00('0x1')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x6f00('0x2')](_0x6f00('0x3'),_0x6f00('0x4'),'months',_0x6f00('0x5'),'days',_0x6f00('0x6'),_0x6f00('0x7')),'allowNull':![],'defaultValue':_0x6f00('0x8')},'output':{'type':Sequelize[_0x6f00('0x2')](_0x6f00('0x9'),_0x6f00('0xa'),_0x6f00('0xb')),'allowNull':![],'defaultValue':_0x6f00('0x9')},'type':{'type':Sequelize[_0x6f00('0x2')](_0x6f00('0xc'),_0x6f00('0xd')),'allowNull':![],'defaultValue':_0x6f00('0xc')},'sendMail':{'type':Sequelize[_0x6f00('0xe')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x6f00('0xf')]},'bcc':{'type':Sequelize[_0x6f00('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x6f00('0xe')],'defaultValue':!![]}}; \ No newline at end of file +var _0x8daf=['ENUM','years','quarters','months','weeks','days','minutes','xlsx','csv','custom','default','TEXT','BOOLEAN','STRING','DATE','INTEGER'];(function(_0x42a04c,_0x10114e){var _0x44e49c=function(_0x32547d){while(--_0x32547d){_0x42a04c['push'](_0x42a04c['shift']());}};_0x44e49c(++_0x10114e);}(_0x8daf,0x15c));var _0xf8da=function(_0x17fcfe,_0x5adb02){_0x17fcfe=_0x17fcfe-0x0;var _0x3e3fc5=_0x8daf[_0x17fcfe];return _0x3e3fc5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xf8da('0x0')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xf8da('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xf8da('0x2')],'allowNull':![]},'endAt':{'type':Sequelize[_0xf8da('0x2')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xf8da('0x3')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xf8da('0x4')](_0xf8da('0x5'),_0xf8da('0x6'),_0xf8da('0x7'),_0xf8da('0x8'),_0xf8da('0x9'),'hours',_0xf8da('0xa')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xf8da('0x4')]('csv','pdf',_0xf8da('0xb')),'allowNull':![],'defaultValue':_0xf8da('0xc')},'type':{'type':Sequelize[_0xf8da('0x4')](_0xf8da('0xd'),_0xf8da('0xe')),'allowNull':![],'defaultValue':_0xf8da('0xd')},'sendMail':{'type':Sequelize[_0xf8da('0x0')],'defaultValue':![]},'email':{'type':Sequelize[_0xf8da('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xf8da('0xf')]},'sendIfEmpty':{'type':Sequelize[_0xf8da('0x0')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 0261224..63a8e39 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 _0x5d96=['stack','name','send','rawAttributes','fieldName','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','filters','create','Schedule','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','update','run','../../config/schedule','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','get','Scheduler','UserProfileResource','error'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x5d96,0x1cf));var _0x65d9=function(_0xd90039,_0x37c137){_0xd90039=_0xd90039-0x0;var _0x486dd9=_0x5d96[_0xd90039];return _0x486dd9;};'use strict';var pdf=require(_0x65d9('0x0'));var emlformat=require(_0x65d9('0x1'));var rimraf=require(_0x65d9('0x2'));var zipdir=require(_0x65d9('0x3'));var jsonpatch=require(_0x65d9('0x4'));var rp=require('request-promise');var moment=require(_0x65d9('0x5'));var BPromise=require(_0x65d9('0x6'));var Mustache=require('mustache');var util=require(_0x65d9('0x7'));var path=require(_0x65d9('0x8'));var sox=require(_0x65d9('0x9'));var csv=require(_0x65d9('0xa'));var ejs=require(_0x65d9('0xb'));var fs=require('fs');var _=require(_0x65d9('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x65d9('0xd'));var deskjs=require(_0x65d9('0xe'));var toCsv=require(_0x65d9('0xa'));var querystring=require(_0x65d9('0xf'));var Papa=require(_0x65d9('0x10'));var Redis=require('ioredis');var authService=require(_0x65d9('0x11'));var qs=require(_0x65d9('0x12'));var as=require(_0x65d9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x65d9('0x14'));var utils=require(_0x65d9('0x15'));var config=require(_0x65d9('0x16'));var db=require(_0x65d9('0x17'))['db'];function respondWithStatusCode(_0x56a825,_0x87fef8){_0x87fef8=_0x87fef8||0xcc;return function(_0x50975c){if(_0x50975c){return _0x56a825[_0x65d9('0x18')](_0x87fef8);}return _0x56a825[_0x65d9('0x19')](_0x87fef8)[_0x65d9('0x1a')]();};}function respondWithResult(_0x30ea26,_0x1553e1){_0x1553e1=_0x1553e1||0xc8;return function(_0xb29362){if(_0xb29362){return _0x30ea26[_0x65d9('0x19')](_0x1553e1)[_0x65d9('0x1b')](_0xb29362);}};}function respondWithFilteredResult(_0x15e3af,_0x5155e7){return function(_0x54e438){if(_0x54e438){var _0x19cf6b=_0x54e438[_0x65d9('0x1c')],_0x1619ca=_0x5155e7[_0x65d9('0x1d')],_0x158715=_0x5155e7['offset']+_0x5155e7[_0x65d9('0x1e')],_0x3ce161;if(_0x158715>=_0x19cf6b){_0x158715=_0x19cf6b;_0x3ce161=0xc8;}else{_0x3ce161=0xce;}_0x15e3af[_0x65d9('0x19')](_0x3ce161);return _0x15e3af[_0x65d9('0x1f')](_0x65d9('0x20'),_0x1619ca+'-'+_0x158715+'/'+_0x19cf6b)[_0x65d9('0x1b')](_0x54e438);}return null;};}function patchUpdates(_0x4b3af6){return function(_0x4a9f05){try{jsonpatch[_0x65d9('0x21')](_0x4a9f05,_0x4b3af6,!![]);}catch(_0x2644bb){return BPromise['reject'](_0x2644bb);}return _0x4a9f05[_0x65d9('0x22')]();};}function saveUpdates(_0x2a380c,_0x5110fa){return function(_0x5a33bb){if(_0x5a33bb){return _0x5a33bb['update'](_0x2a380c)[_0x65d9('0x23')](function(_0x162a79){return _0x162a79;});}return null;};}function removeEntity(_0x52a155,_0x383b0a){return function(_0x513206){if(_0x513206){return _0x513206[_0x65d9('0x24')]()['then'](function(){var _0x3fd54c=_0x513206[_0x65d9('0x25')]({'plain':!![]});var _0x5a207e=_0x65d9('0x26');return db[_0x65d9('0x27')][_0x65d9('0x24')]({'where':{'type':_0x5a207e,'resourceId':_0x3fd54c['id']}})[_0x65d9('0x23')](function(){return _0x513206;});})[_0x65d9('0x23')](function(){_0x52a155[_0x65d9('0x19')](0xcc)[_0x65d9('0x1a')]();});}};}function handleEntityNotFound(_0x217ed2,_0x4c16ae){return function(_0x3ef76e){if(!_0x3ef76e){_0x217ed2[_0x65d9('0x18')](0x194);}return _0x3ef76e;};}function handleError(_0x453888,_0x4b0d07){_0x4b0d07=_0x4b0d07||0x1f4;return function(_0x290063){logger[_0x65d9('0x28')](_0x290063[_0x65d9('0x29')]);if(_0x290063['name']){delete _0x290063[_0x65d9('0x2a')];}_0x453888[_0x65d9('0x19')](_0x4b0d07)[_0x65d9('0x2b')](_0x290063);};}exports['index']=function(_0x569256,_0x388c5f){var _0x50e091={},_0x51f037={},_0x55ffb5={'count':0x0,'rows':[]};var _0x79b5d6=_['map'](db['Schedule'][_0x65d9('0x2c')],function(_0x2fcbd2){return{'name':_0x2fcbd2[_0x65d9('0x2d')],'type':_0x2fcbd2['type'][_0x65d9('0x2e')]};});_0x51f037[_0x65d9('0x2f')]=_[_0x65d9('0x30')](_0x79b5d6,'name');_0x51f037[_0x65d9('0x31')]=_[_0x65d9('0x32')](_0x569256[_0x65d9('0x31')]);_0x51f037['filters']=_['intersection'](_0x51f037[_0x65d9('0x2f')],_0x51f037['query']);_0x50e091[_0x65d9('0x33')]=_[_0x65d9('0x34')](_0x51f037[_0x65d9('0x2f')],qs[_0x65d9('0x35')](_0x569256['query']['fields']));_0x50e091[_0x65d9('0x33')]=_0x50e091[_0x65d9('0x33')][_0x65d9('0x36')]?_0x50e091['attributes']:_0x51f037[_0x65d9('0x2f')];if(!_0x569256[_0x65d9('0x31')][_0x65d9('0x37')](_0x65d9('0x38'))){_0x50e091[_0x65d9('0x1e')]=qs['limit'](_0x569256['query'][_0x65d9('0x1e')]);_0x50e091['offset']=qs[_0x65d9('0x1d')](_0x569256[_0x65d9('0x31')]['offset']);}_0x50e091['order']=qs[_0x65d9('0x39')](_0x569256['query'][_0x65d9('0x39')]);_0x50e091[_0x65d9('0x3a')]=qs['filters'](_[_0x65d9('0x3b')](_0x569256['query'],_0x51f037['filters']));if(_0x569256[_0x65d9('0x31')][_0x65d9('0x3c')]){_0x50e091[_0x65d9('0x3a')]=_[_0x65d9('0x3d')](_0x50e091['where'],{'$or':_[_0x65d9('0x30')](_0x79b5d6,function(_0x1dfa16){if(_0x1dfa16[_0x65d9('0x3e')]!==_0x65d9('0x3f')){var _0xd9959f={};_0xd9959f[_0x1dfa16[_0x65d9('0x2a')]]={'$like':'%'+_0x569256[_0x65d9('0x31')][_0x65d9('0x3c')]+'%'};return _0xd9959f;}})});}_0x50e091=_[_0x65d9('0x3d')]({},_0x50e091,_0x569256[_0x65d9('0x40')]);var _0x185101={'where':_0x50e091[_0x65d9('0x3a')]};return db['Schedule'][_0x65d9('0x1c')](_0x185101)[_0x65d9('0x23')](function(_0x28ef80){_0x55ffb5[_0x65d9('0x1c')]=_0x28ef80;if(_0x569256[_0x65d9('0x31')][_0x65d9('0x41')]){_0x50e091[_0x65d9('0x42')]=[{'all':!![]}];}return db['Schedule']['findAll'](_0x50e091);})[_0x65d9('0x23')](function(_0x2c77db){_0x55ffb5[_0x65d9('0x43')]=_0x2c77db;return _0x55ffb5;})[_0x65d9('0x23')](respondWithFilteredResult(_0x388c5f,_0x50e091))[_0x65d9('0x44')](handleError(_0x388c5f,null));};exports[_0x65d9('0x45')]=function(_0xf62323,_0x567d39){var _0x3182b3={'raw':![],'where':{'id':_0xf62323[_0x65d9('0x46')]['id']}},_0x2d56d4={};_0x2d56d4[_0x65d9('0x2f')]=_[_0x65d9('0x32')](db['Schedule']['rawAttributes']);_0x2d56d4[_0x65d9('0x31')]=_['keys'](_0xf62323[_0x65d9('0x31')]);_0x2d56d4[_0x65d9('0x47')]=_['intersection'](_0x2d56d4['model'],_0x2d56d4[_0x65d9('0x31')]);_0x3182b3[_0x65d9('0x33')]=_[_0x65d9('0x34')](_0x2d56d4[_0x65d9('0x2f')],qs[_0x65d9('0x35')](_0xf62323[_0x65d9('0x31')][_0x65d9('0x35')]));_0x3182b3[_0x65d9('0x33')]=_0x3182b3[_0x65d9('0x33')]['length']?_0x3182b3['attributes']:_0x2d56d4[_0x65d9('0x2f')];if(_0xf62323[_0x65d9('0x31')][_0x65d9('0x41')]){_0x3182b3[_0x65d9('0x42')]=[{'all':!![]}];}_0x3182b3=_[_0x65d9('0x3d')]({},_0x3182b3,_0xf62323[_0x65d9('0x40')]);return db['Schedule']['find'](_0x3182b3)[_0x65d9('0x23')](handleEntityNotFound(_0x567d39,null))[_0x65d9('0x23')](respondWithResult(_0x567d39,null))[_0x65d9('0x44')](handleError(_0x567d39,null));};exports[_0x65d9('0x48')]=function(_0x4c5a7f,_0x2cdbed){return db[_0x65d9('0x49')]['create'](_0x4c5a7f[_0x65d9('0x4a')],{})['then'](function(_0x532fa4){var _0x5cff5c=_0x4c5a7f[_0x65d9('0x4b')][_0x65d9('0x25')]({'plain':!![]});if(!_0x5cff5c)throw new Error(_0x65d9('0x4c'));if(_0x5cff5c[_0x65d9('0x4d')]===_0x65d9('0x4b')){var _0x4ebaed=_0x532fa4['get']({'plain':!![]});var _0x795919=_0x65d9('0x26');return db[_0x65d9('0x4e')][_0x65d9('0x4f')]({'where':{'name':_0x795919,'userProfileId':_0x5cff5c[_0x65d9('0x50')]},'raw':!![]})[_0x65d9('0x23')](function(_0x178c0c){if(_0x178c0c&&_0x178c0c['autoAssociation']===0x0){return db[_0x65d9('0x27')][_0x65d9('0x48')]({'name':_0x4ebaed[_0x65d9('0x2a')],'resourceId':_0x4ebaed['id'],'type':_0x178c0c[_0x65d9('0x2a')],'sectionId':_0x178c0c['id']},{})['then'](function(){return _0x532fa4;});}else{return _0x532fa4;}})[_0x65d9('0x44')](function(_0x48d503){logger[_0x65d9('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x48d503);throw _0x48d503;});}return _0x532fa4;})[_0x65d9('0x23')](respondWithResult(_0x2cdbed,0xc9))[_0x65d9('0x44')](handleError(_0x2cdbed,null));};exports[_0x65d9('0x51')]=function(_0x546d54,_0xf100e2){if(_0x546d54[_0x65d9('0x4a')]['id']){delete _0x546d54[_0x65d9('0x4a')]['id'];}return db[_0x65d9('0x49')]['find']({'where':{'id':_0x546d54[_0x65d9('0x46')]['id']}})['then'](handleEntityNotFound(_0xf100e2,null))[_0x65d9('0x23')](saveUpdates(_0x546d54[_0x65d9('0x4a')],null))['then'](respondWithResult(_0xf100e2,null))['catch'](handleError(_0xf100e2,null));};exports['destroy']=function(_0x2ef1c7,_0x2743b6){return db[_0x65d9('0x49')][_0x65d9('0x4f')]({'where':{'id':_0x2ef1c7['params']['id']}})[_0x65d9('0x23')](handleEntityNotFound(_0x2743b6,null))[_0x65d9('0x23')](removeEntity(_0x2743b6,null))[_0x65d9('0x44')](handleError(_0x2743b6,null));};exports[_0x65d9('0x52')]=function(_0x2f8374,_0x2d5540,_0x570e4f){var _0x11b18b=require(_0x65d9('0x53'));return db['Schedule'][_0x65d9('0x4f')]({'where':{'id':_0x2f8374[_0x65d9('0x46')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2d5540,null))[_0x65d9('0x23')](function(){_0x11b18b[_0x65d9('0x52')](_0x2f8374['params']['id']);})[_0x65d9('0x23')](respondWithStatusCode(_0x2d5540,null))['catch'](handleError(_0x2d5540,null));}; \ No newline at end of file +var _0x484f=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','Scheduler','UserProfileResource','destroy','stack','name','send','index','map','Schedule','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','includeAll','include','findAll','catch','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','params','run','../../config/schedule','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x3065bf,_0x29c51e){var _0x3a8ff=function(_0x5ea996){while(--_0x5ea996){_0x3065bf['push'](_0x3065bf['shift']());}};_0x3a8ff(++_0x29c51e);}(_0x484f,0x1e1));var _0xf484=function(_0x1cbcf1,_0x3f9fd9){_0x1cbcf1=_0x1cbcf1-0x0;var _0x3a06f0=_0x484f[_0x1cbcf1];return _0x3a06f0;};'use strict';var pdf=require(_0xf484('0x0'));var emlformat=require(_0xf484('0x1'));var rimraf=require(_0xf484('0x2'));var zipdir=require(_0xf484('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf484('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf484('0x5'));var util=require(_0xf484('0x6'));var path=require('path');var sox=require(_0xf484('0x7'));var csv=require(_0xf484('0x8'));var ejs=require(_0xf484('0x9'));var fs=require('fs');var _=require(_0xf484('0xa'));var squel=require(_0xf484('0xb'));var crypto=require(_0xf484('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf484('0xd'));var toCsv=require(_0xf484('0x8'));var querystring=require(_0xf484('0xe'));var Papa=require(_0xf484('0xf'));var Redis=require(_0xf484('0x10'));var authService=require(_0xf484('0x11'));var qs=require(_0xf484('0x12'));var as=require(_0xf484('0x13'));var hardwareService=require(_0xf484('0x14'));var logger=require(_0xf484('0x15'))(_0xf484('0x16'));var utils=require(_0xf484('0x17'));var config=require(_0xf484('0x18'));var db=require(_0xf484('0x19'))['db'];function respondWithStatusCode(_0x1289a3,_0x328a25){_0x328a25=_0x328a25||0xcc;return function(_0xa43170){if(_0xa43170){return _0x1289a3[_0xf484('0x1a')](_0x328a25);}return _0x1289a3[_0xf484('0x1b')](_0x328a25)[_0xf484('0x1c')]();};}function respondWithResult(_0x2e2d1,_0x4fbba0){_0x4fbba0=_0x4fbba0||0xc8;return function(_0x3045f5){if(_0x3045f5){return _0x2e2d1['status'](_0x4fbba0)[_0xf484('0x1d')](_0x3045f5);}};}function respondWithFilteredResult(_0x18de1d,_0x8e5338){return function(_0x5bd57b){if(_0x5bd57b){var _0x45af4d=_0x5bd57b[_0xf484('0x1e')],_0x7373c2=_0x8e5338['offset'],_0x47ddc0=_0x8e5338[_0xf484('0x1f')]+_0x8e5338[_0xf484('0x20')],_0x67ce5e;if(_0x47ddc0>=_0x45af4d){_0x47ddc0=_0x45af4d;_0x67ce5e=0xc8;}else{_0x67ce5e=0xce;}_0x18de1d['status'](_0x67ce5e);return _0x18de1d[_0xf484('0x21')](_0xf484('0x22'),_0x7373c2+'-'+_0x47ddc0+'/'+_0x45af4d)['json'](_0x5bd57b);}return null;};}function patchUpdates(_0x459bbc){return function(_0x5620db){try{jsonpatch[_0xf484('0x23')](_0x5620db,_0x459bbc,!![]);}catch(_0x3bc315){return BPromise['reject'](_0x3bc315);}return _0x5620db[_0xf484('0x24')]();};}function saveUpdates(_0x1c83bc,_0x23a33c){return function(_0x42635d){if(_0x42635d){return _0x42635d[_0xf484('0x25')](_0x1c83bc)[_0xf484('0x26')](function(_0x63ab9){return _0x63ab9;});}return null;};}function removeEntity(_0x4cec49,_0x4700ac){return function(_0x4e0061){if(_0x4e0061){return _0x4e0061['destroy']()['then'](function(){var _0xf18067=_0x4e0061['get']({'plain':!![]});var _0x4ed67e=_0xf484('0x27');return db[_0xf484('0x28')][_0xf484('0x29')]({'where':{'type':_0x4ed67e,'resourceId':_0xf18067['id']}})['then'](function(){return _0x4e0061;});})['then'](function(){_0x4cec49[_0xf484('0x1b')](0xcc)[_0xf484('0x1c')]();});}};}function handleEntityNotFound(_0x111ed5,_0xcf26e7){return function(_0x5e96ab){if(!_0x5e96ab){_0x111ed5[_0xf484('0x1a')](0x194);}return _0x5e96ab;};}function handleError(_0x460731,_0x437f74){_0x437f74=_0x437f74||0x1f4;return function(_0x20aac4){logger['error'](_0x20aac4[_0xf484('0x2a')]);if(_0x20aac4[_0xf484('0x2b')]){delete _0x20aac4[_0xf484('0x2b')];}_0x460731[_0xf484('0x1b')](_0x437f74)[_0xf484('0x2c')](_0x20aac4);};}exports[_0xf484('0x2d')]=function(_0x1d9d06,_0x3c22d3){var _0x3a2e85={},_0x59417f={},_0x36b6fc={'count':0x0,'rows':[]};var _0x2bb53a=_[_0xf484('0x2e')](db[_0xf484('0x2f')][_0xf484('0x30')],function(_0x236f8a){return{'name':_0x236f8a[_0xf484('0x31')],'type':_0x236f8a['type'][_0xf484('0x32')]};});_0x59417f['model']=_[_0xf484('0x2e')](_0x2bb53a,_0xf484('0x2b'));_0x59417f[_0xf484('0x33')]=_[_0xf484('0x34')](_0x1d9d06['query']);_0x59417f[_0xf484('0x35')]=_[_0xf484('0x36')](_0x59417f[_0xf484('0x37')],_0x59417f[_0xf484('0x33')]);_0x3a2e85['attributes']=_[_0xf484('0x36')](_0x59417f['model'],qs['fields'](_0x1d9d06[_0xf484('0x33')][_0xf484('0x38')]));_0x3a2e85[_0xf484('0x39')]=_0x3a2e85[_0xf484('0x39')]['length']?_0x3a2e85[_0xf484('0x39')]:_0x59417f[_0xf484('0x37')];if(!_0x1d9d06[_0xf484('0x33')][_0xf484('0x3a')](_0xf484('0x3b'))){_0x3a2e85[_0xf484('0x20')]=qs[_0xf484('0x20')](_0x1d9d06[_0xf484('0x33')][_0xf484('0x20')]);_0x3a2e85[_0xf484('0x1f')]=qs[_0xf484('0x1f')](_0x1d9d06['query'][_0xf484('0x1f')]);}_0x3a2e85[_0xf484('0x3c')]=qs[_0xf484('0x3d')](_0x1d9d06[_0xf484('0x33')][_0xf484('0x3d')]);_0x3a2e85[_0xf484('0x3e')]=qs[_0xf484('0x35')](_['pick'](_0x1d9d06[_0xf484('0x33')],_0x59417f[_0xf484('0x35')]));if(_0x1d9d06[_0xf484('0x33')]['filter']){_0x3a2e85[_0xf484('0x3e')]=_[_0xf484('0x3f')](_0x3a2e85['where'],{'$or':_[_0xf484('0x2e')](_0x2bb53a,function(_0x551e49){if(_0x551e49[_0xf484('0x40')]!==_0xf484('0x41')){var _0x1067aa={};_0x1067aa[_0x551e49[_0xf484('0x2b')]]={'$like':'%'+_0x1d9d06[_0xf484('0x33')]['filter']+'%'};return _0x1067aa;}})});}_0x3a2e85=_[_0xf484('0x3f')]({},_0x3a2e85,_0x1d9d06['options']);var _0x3a5207={'where':_0x3a2e85['where']};return db[_0xf484('0x2f')]['count'](_0x3a5207)[_0xf484('0x26')](function(_0x5a8396){_0x36b6fc[_0xf484('0x1e')]=_0x5a8396;if(_0x1d9d06['query'][_0xf484('0x42')]){_0x3a2e85[_0xf484('0x43')]=[{'all':!![]}];}return db[_0xf484('0x2f')][_0xf484('0x44')](_0x3a2e85);})['then'](function(_0x344f91){_0x36b6fc['rows']=_0x344f91;return _0x36b6fc;})['then'](respondWithFilteredResult(_0x3c22d3,_0x3a2e85))[_0xf484('0x45')](handleError(_0x3c22d3,null));};exports['show']=function(_0x3d0e72,_0x297cec){var _0xec3e9f={'raw':![],'where':{'id':_0x3d0e72['params']['id']}},_0x5817db={};_0x5817db['model']=_[_0xf484('0x34')](db['Schedule'][_0xf484('0x30')]);_0x5817db[_0xf484('0x33')]=_[_0xf484('0x34')](_0x3d0e72[_0xf484('0x33')]);_0x5817db[_0xf484('0x35')]=_[_0xf484('0x36')](_0x5817db['model'],_0x5817db[_0xf484('0x33')]);_0xec3e9f[_0xf484('0x39')]=_[_0xf484('0x36')](_0x5817db[_0xf484('0x37')],qs['fields'](_0x3d0e72[_0xf484('0x33')]['fields']));_0xec3e9f['attributes']=_0xec3e9f[_0xf484('0x39')][_0xf484('0x46')]?_0xec3e9f[_0xf484('0x39')]:_0x5817db[_0xf484('0x37')];if(_0x3d0e72['query']['includeAll']){_0xec3e9f['include']=[{'all':!![]}];}_0xec3e9f=_[_0xf484('0x3f')]({},_0xec3e9f,_0x3d0e72['options']);return db[_0xf484('0x2f')]['find'](_0xec3e9f)[_0xf484('0x26')](handleEntityNotFound(_0x297cec,null))[_0xf484('0x26')](respondWithResult(_0x297cec,null))[_0xf484('0x45')](handleError(_0x297cec,null));};exports[_0xf484('0x47')]=function(_0x5d427f,_0x1fbee0){return db[_0xf484('0x2f')]['create'](_0x5d427f[_0xf484('0x48')],{})[_0xf484('0x26')](function(_0x3bae8d){var _0x260558=_0x5d427f[_0xf484('0x49')][_0xf484('0x4a')]({'plain':!![]});if(!_0x260558)throw new Error(_0xf484('0x4b'));if(_0x260558[_0xf484('0x4c')]===_0xf484('0x49')){var _0x40dcc2=_0x3bae8d[_0xf484('0x4a')]({'plain':!![]});var _0x36e0c1='Scheduler';return db[_0xf484('0x4d')][_0xf484('0x4e')]({'where':{'name':_0x36e0c1,'userProfileId':_0x260558[_0xf484('0x4f')]},'raw':!![]})[_0xf484('0x26')](function(_0x58504e){if(_0x58504e&&_0x58504e[_0xf484('0x50')]===0x0){return db[_0xf484('0x28')][_0xf484('0x47')]({'name':_0x40dcc2['name'],'resourceId':_0x40dcc2['id'],'type':_0x58504e[_0xf484('0x2b')],'sectionId':_0x58504e['id']},{})[_0xf484('0x26')](function(){return _0x3bae8d;});}else{return _0x3bae8d;}})[_0xf484('0x45')](function(_0x297176){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x297176);throw _0x297176;});}return _0x3bae8d;})[_0xf484('0x26')](respondWithResult(_0x1fbee0,0xc9))[_0xf484('0x45')](handleError(_0x1fbee0,null));};exports[_0xf484('0x25')]=function(_0x4624fd,_0x2a4038){if(_0x4624fd[_0xf484('0x48')]['id']){delete _0x4624fd['body']['id'];}return db[_0xf484('0x2f')][_0xf484('0x4e')]({'where':{'id':_0x4624fd[_0xf484('0x51')]['id']}})[_0xf484('0x26')](handleEntityNotFound(_0x2a4038,null))[_0xf484('0x26')](saveUpdates(_0x4624fd[_0xf484('0x48')],null))['then'](respondWithResult(_0x2a4038,null))[_0xf484('0x45')](handleError(_0x2a4038,null));};exports[_0xf484('0x29')]=function(_0x3396dd,_0x46bf95){return db[_0xf484('0x2f')]['find']({'where':{'id':_0x3396dd[_0xf484('0x51')]['id']}})[_0xf484('0x26')](handleEntityNotFound(_0x46bf95,null))[_0xf484('0x26')](removeEntity(_0x46bf95,null))['catch'](handleError(_0x46bf95,null));};exports[_0xf484('0x52')]=function(_0x1cb5e0,_0x558dfd,_0x253690){var _0x50d408=require(_0xf484('0x53'));return db[_0xf484('0x2f')][_0xf484('0x4e')]({'where':{'id':_0x1cb5e0[_0xf484('0x51')]['id']},'raw':!![]})[_0xf484('0x26')](handleEntityNotFound(_0x558dfd,null))[_0xf484('0x26')](function(){_0x50d408[_0xf484('0x52')](_0x1cb5e0[_0xf484('0x51')]['id']);})[_0xf484('0x26')](respondWithStatusCode(_0x558dfd,null))[_0xf484('0x45')](handleError(_0x558dfd,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 5f902da..ed7485a 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 _0x7ee1=['rimraf','../../config/environment','exports','Schedule','tools_schedules','lodash','../../config/logger','moment','path'];(function(_0x333940,_0x2c6afe){var _0x1c6fe0=function(_0x346275){while(--_0x346275){_0x333940['push'](_0x333940['shift']());}};_0x1c6fe0(++_0x2c6afe);}(_0x7ee1,0xc2));var _0x17ee=function(_0x37ab40,_0xc6ce26){_0x37ab40=_0x37ab40-0x0;var _0x59d8f2=_0x7ee1[_0x37ab40];return _0x59d8f2;};'use strict';var _=require(_0x17ee('0x0'));var util=require('util');var logger=require(_0x17ee('0x1'))('api');var moment=require(_0x17ee('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x17ee('0x3'));var rimraf=require(_0x17ee('0x4'));var config=require(_0x17ee('0x5'));var attributes=require('./schedule.attributes');module[_0x17ee('0x6')]=function(_0x51ee9b,_0x398e0f){return _0x51ee9b['define'](_0x17ee('0x7'),attributes,{'tableName':_0x17ee('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbce5=['../../config/environment','exports','define','Schedule','tools_schedules','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x207d4e,_0x5158dc){var _0x24b6f4=function(_0x96ce36){while(--_0x96ce36){_0x207d4e['push'](_0x207d4e['shift']());}};_0x24b6f4(++_0x5158dc);}(_0xbce5,0x95));var _0x5bce=function(_0x20714a,_0x7de591){_0x20714a=_0x20714a-0x0;var _0x15e877=_0xbce5[_0x20714a];return _0x15e877;};'use strict';var _=require(_0x5bce('0x0'));var util=require('util');var logger=require(_0x5bce('0x1'))('api');var moment=require(_0x5bce('0x2'));var BPromise=require(_0x5bce('0x3'));var rp=require(_0x5bce('0x4'));var fs=require('fs');var path=require(_0x5bce('0x5'));var rimraf=require(_0x5bce('0x6'));var config=require(_0x5bce('0x7'));var attributes=require('./schedule.attributes');module[_0x5bce('0x8')]=function(_0x322b6d,_0xc0e8c0){return _0x322b6d[_0x5bce('0x9')](_0x5bce('0xa'),attributes,{'tableName':_0x5bce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index d936fe0..26e92e0 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 _0xb443=['../../config/environment','jayson/promise','client','http','request','then','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','Schedule,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2f5447,_0x2fc81e){var _0x9dd0f0=function(_0xdddc85){while(--_0xdddc85){_0x2f5447['push'](_0x2f5447['shift']());}};_0x9dd0f0(++_0x2fc81e);}(_0xb443,0x188));var _0x3b44=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xb443[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0x3b44('0x0'));var util=require('util');var moment=require(_0x3b44('0x1'));var BPromise=require(_0x3b44('0x2'));var rs=require(_0x3b44('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3b44('0x4'))['db'];var utils=require(_0x3b44('0x5'));var logger=require(_0x3b44('0x6'))(_0x3b44('0x7'));var config=require(_0x3b44('0x8'));var jayson=require(_0x3b44('0x9'));var client=jayson[_0x3b44('0xa')][_0x3b44('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d4762,_0xa3068e,_0xec6452){return new BPromise(function(_0x215d7b,_0x9703f){return client[_0x3b44('0xc')](_0x5d4762,_0xec6452)[_0x3b44('0xd')](function(_0x5686fe){logger['info']('Schedule,\x20%s,\x20%s',_0xa3068e,'request\x20sent');logger['debug'](_0x3b44('0xe'),_0xa3068e,_0x3b44('0xf'),JSON['stringify'](_0x5686fe));if(_0x5686fe['error']){if(_0x5686fe[_0x3b44('0x10')]['code']===0x1f4){logger[_0x3b44('0x10')]('Schedule,\x20%s,\x20%s',_0xa3068e,_0x5686fe[_0x3b44('0x10')][_0x3b44('0x11')]);return _0x9703f(_0x5686fe[_0x3b44('0x10')]['message']);}logger['error'](_0x3b44('0x12'),_0xa3068e,_0x5686fe['error'][_0x3b44('0x11')]);return _0x215d7b(_0x5686fe[_0x3b44('0x10')][_0x3b44('0x11')]);}else{logger['info'](_0x3b44('0x12'),_0xa3068e,_0x3b44('0xf'));_0x215d7b(_0x5686fe[_0x3b44('0x13')][_0x3b44('0x11')]);}})['catch'](function(_0x2df16d){logger[_0x3b44('0x10')](_0x3b44('0x12'),_0xa3068e,_0x2df16d);_0x9703f(_0x2df16d);});});} \ No newline at end of file +var _0xdeb4=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x4571b2,_0x42e4b7){var _0x30d346=function(_0x36e150){while(--_0x36e150){_0x4571b2['push'](_0x4571b2['shift']());}};_0x30d346(++_0x42e4b7);}(_0xdeb4,0x104));var _0x4deb=function(_0x26f972,_0x8afe6e){_0x26f972=_0x26f972-0x0;var _0x2ddaab=_0xdeb4[_0x26f972];return _0x2ddaab;};'use strict';var _=require(_0x4deb('0x0'));var util=require(_0x4deb('0x1'));var moment=require(_0x4deb('0x2'));var BPromise=require(_0x4deb('0x3'));var rs=require(_0x4deb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4deb('0x5'))['db'];var utils=require(_0x4deb('0x6'));var logger=require(_0x4deb('0x7'))('rpc');var config=require(_0x4deb('0x8'));var jayson=require(_0x4deb('0x9'));var client=jayson['client'][_0x4deb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37dfe8,_0x4d1ebd,_0x95e1d2){return new BPromise(function(_0x18c4a4,_0x306ebd){return client[_0x4deb('0xb')](_0x37dfe8,_0x95e1d2)[_0x4deb('0xc')](function(_0x100875){logger[_0x4deb('0xd')](_0x4deb('0xe'),_0x4d1ebd,_0x4deb('0xf'));logger[_0x4deb('0x10')]('Schedule,\x20%s,\x20%s,\x20%s',_0x4d1ebd,_0x4deb('0xf'),JSON[_0x4deb('0x11')](_0x100875));if(_0x100875['error']){if(_0x100875[_0x4deb('0x12')][_0x4deb('0x13')]===0x1f4){logger['error'](_0x4deb('0xe'),_0x4d1ebd,_0x100875[_0x4deb('0x12')]['message']);return _0x306ebd(_0x100875[_0x4deb('0x12')][_0x4deb('0x14')]);}logger['error'](_0x4deb('0xe'),_0x4d1ebd,_0x100875[_0x4deb('0x12')][_0x4deb('0x14')]);return _0x18c4a4(_0x100875[_0x4deb('0x12')][_0x4deb('0x14')]);}else{logger[_0x4deb('0xd')](_0x4deb('0xe'),_0x4d1ebd,_0x4deb('0xf'));_0x18c4a4(_0x100875[_0x4deb('0x15')][_0x4deb('0x14')]);}})['catch'](function(_0x21ccba){logger['error'](_0x4deb('0xe'),_0x4d1ebd,_0x21ccba);_0x306ebd(_0x21ccba);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 42c1808..02f487a 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 _0x5551=['download','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','/describe','describe','show','/:id/download'];(function(_0x44e18b,_0x14b41f){var _0x363f72=function(_0x4591ba){while(--_0x4591ba){_0x44e18b['push'](_0x44e18b['shift']());}};_0x363f72(++_0x14b41f);}(_0x5551,0x179));var _0x1555=function(_0x3ad46e,_0x35db29){_0x3ad46e=_0x3ad46e-0x0;var _0x6665d1=_0x5551[_0x3ad46e];return _0x6665d1;};'use strict';var multer=require(_0x1555('0x0'));var util=require('util');var path=require(_0x1555('0x1'));var timeout=require(_0x1555('0x2'));var express=require(_0x1555('0x3'));var router=express[_0x1555('0x4')]();var auth=require(_0x1555('0x5'));var interaction=require(_0x1555('0x6'));var config=require('../../config/environment');var controller=require(_0x1555('0x7'));router[_0x1555('0x8')]('/',auth[_0x1555('0x9')](),controller['index']);router[_0x1555('0x8')](_0x1555('0xa'),auth[_0x1555('0x9')](),controller[_0x1555('0xb')]);router['get']('/:id',auth[_0x1555('0x9')](),controller[_0x1555('0xc')]);router['get'](_0x1555('0xd'),auth[_0x1555('0x9')](),controller[_0x1555('0xe')]);router[_0x1555('0xf')]('/',auth[_0x1555('0x9')](),controller[_0x1555('0x10')]);router[_0x1555('0x11')](_0x1555('0x12'),auth[_0x1555('0x9')](),controller[_0x1555('0x13')]);router[_0x1555('0x14')](_0x1555('0x12'),auth[_0x1555('0x9')](),controller[_0x1555('0x15')]);module[_0x1555('0x16')]=router; \ No newline at end of file +var _0xfec7=['/:id/download','download','post','create','update','delete','destroy','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','describe','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfec7,0xec));var _0x7fec=function(_0x5a07c5,_0x237e9f){_0x5a07c5=_0x5a07c5-0x0;var _0x2cac99=_0xfec7[_0x5a07c5];return _0x2cac99;};'use strict';var multer=require(_0x7fec('0x0'));var util=require('util');var path=require(_0x7fec('0x1'));var timeout=require('connect-timeout');var express=require(_0x7fec('0x2'));var router=express[_0x7fec('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x7fec('0x4'));var config=require(_0x7fec('0x5'));var controller=require(_0x7fec('0x6'));router[_0x7fec('0x7')]('/',auth[_0x7fec('0x8')](),controller['index']);router[_0x7fec('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x7fec('0x9')]);router['get'](_0x7fec('0xa'),auth[_0x7fec('0x8')](),controller['show']);router['get'](_0x7fec('0xb'),auth[_0x7fec('0x8')](),controller[_0x7fec('0xc')]);router[_0x7fec('0xd')]('/',auth[_0x7fec('0x8')](),controller[_0x7fec('0xe')]);router['put'](_0x7fec('0xa'),auth[_0x7fec('0x8')](),controller[_0x7fec('0xf')]);router[_0x7fec('0x10')](_0x7fec('0xa'),auth[_0x7fec('0x8')](),controller[_0x7fec('0x11')]);module[_0x7fec('0x12')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 7018f26..07241bc 100644 --- a/server/api/screenRecording/screenRecording.attributes.js +++ b/server/api/screenRecording/screenRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['duration','startedAt','toString','closedAt','format','MM-DD-YYYY\x20HH:mm','DATE','updatedAt','sequelize','moment','../../config/environment','exports','VIRTUAL','getDataValue','value','STRING','replace','setDataValue','INTEGER','subtract'];(function(_0xd0238b,_0x1b6a7c){var _0x41a111=function(_0x15860a){while(--_0x15860a){_0xd0238b['push'](_0xd0238b['shift']());}};_0x41a111(++_0x1b6a7c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x16337a,_0x4789a1){_0x16337a=_0x16337a-0x0;var _0x422365=_0x5fc3[_0x16337a];return _0x422365;};'use strict';var Sequelize=require(_0x35fc('0x0'));var moment=require(_0x35fc('0x1'));var path=require('path');var config=require(_0x35fc('0x2'));module[_0x35fc('0x3')]={'format':{'type':Sequelize[_0x35fc('0x4')],'get':function(){return this[_0x35fc('0x5')](_0x35fc('0x6'))?path['extname'](this[_0x35fc('0x5')](_0x35fc('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x35fc('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x19a0d1){var _0x508b32=_0x19a0d1[_0x35fc('0x8')](/\\/g,'/');this[_0x35fc('0x9')](_0x35fc('0x6'),_0x508b32);}},'rating':{'type':Sequelize[_0x35fc('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x35fc('0xa')],'set':function(_0xf9d3a6){this[_0x35fc('0x9')]('startedAt',moment()[_0x35fc('0xb')](_0xf9d3a6,'ms'));this[_0x35fc('0x9')]('closedAt',moment());this[_0x35fc('0x9')](_0x35fc('0xc'),_0xf9d3a6);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x35fc('0x5')](_0x35fc('0xd')))['format']('MM-DD-YYYY\x20HH:mm')[_0x35fc('0xe')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x35fc('0x5')](_0x35fc('0xf')))[_0x35fc('0x10')](_0x35fc('0x11'))[_0x35fc('0xe')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('createdAt'))['format'](_0x35fc('0x11'))[_0x35fc('0xe')]();}},'updatedAt':{'type':Sequelize[_0x35fc('0x12')],'get':function(){return moment(this[_0x35fc('0x5')](_0x35fc('0x13')))[_0x35fc('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x35fc('0xe')]();}}}; \ No newline at end of file +var _0xd0bb=['MM-DD-YYYY\x20HH:mm','toString','DATE','closedAt','updatedAt','sequelize','moment','path','exports','getDataValue','value','STRING','setDataValue','INTEGER','subtract','duration','startedAt','format'];(function(_0x49a1a0,_0x48f776){var _0x518a4f=function(_0x313633){while(--_0x313633){_0x49a1a0['push'](_0x49a1a0['shift']());}};_0x518a4f(++_0x48f776);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x1d3ece,_0x3fb359){_0x1d3ece=_0x1d3ece-0x0;var _0x1ba5d2=_0xd0bb[_0x1d3ece];return _0x1ba5d2;};'use strict';var Sequelize=require(_0xbd0b('0x0'));var moment=require(_0xbd0b('0x1'));var path=require(_0xbd0b('0x2'));var config=require('../../config/environment');module[_0xbd0b('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xbd0b('0x4')](_0xbd0b('0x5'))?path['extname'](this[_0xbd0b('0x4')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xbd0b('0x6')]},'channel':{'type':Sequelize[_0xbd0b('0x6')]},'value':{'type':Sequelize[_0xbd0b('0x6')],'set':function(_0x37c205){var _0x809599=_0x37c205['replace'](/\\/g,'/');this[_0xbd0b('0x7')](_0xbd0b('0x5'),_0x809599);}},'rating':{'type':Sequelize[_0xbd0b('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xbd0b('0x8')],'set':function(_0x16e185){this['setDataValue']('startedAt',moment()[_0xbd0b('0x9')](_0x16e185,'ms'));this[_0xbd0b('0x7')]('closedAt',moment());this[_0xbd0b('0x7')](_0xbd0b('0xa'),_0x16e185);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xbd0b('0x4')](_0xbd0b('0xb')))[_0xbd0b('0xc')](_0xbd0b('0xd'))[_0xbd0b('0xe')]();}},'closedAt':{'type':Sequelize[_0xbd0b('0xf')],'get':function(){return moment(this[_0xbd0b('0x4')](_0xbd0b('0x10')))[_0xbd0b('0xc')](_0xbd0b('0xd'))[_0xbd0b('0xe')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xbd0b('0x4')]('createdAt'))['format'](_0xbd0b('0xd'))[_0xbd0b('0xe')]();}},'updatedAt':{'type':Sequelize[_0xbd0b('0xf')],'get':function(){return moment(this[_0xbd0b('0x4')](_0xbd0b('0x11')))['format']('MM-DD-YYYY\x20HH:mm')[_0xbd0b('0xe')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index ae3a609..c8c4f93 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 _0x7866=['closedAt','value','describe','download','../../components/encryptor','type','uniqueid','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','join','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','sendStatus','json','count','offset','limit','set','update','then','destroy','status','end','error','send','index','map','ScreenRecording','rawAttributes','model','differenceBy','name','format','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body'];(function(_0x32e01e,_0x5cdf41){var _0x1743ef=function(_0x211c03){while(--_0x211c03){_0x32e01e['push'](_0x32e01e['shift']());}};_0x1743ef(++_0x5cdf41);}(_0x7866,0x85));var _0x6786=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x7866[_0x12fc8d];return _0x3f9d04;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6786('0x0'));var rimraf=require(_0x6786('0x1'));var zipdir=require(_0x6786('0x2'));var jsonpatch=require(_0x6786('0x3'));var rp=require(_0x6786('0x4'));var moment=require(_0x6786('0x5'));var BPromise=require(_0x6786('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6786('0x7'));var sox=require(_0x6786('0x8'));var csv=require(_0x6786('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6786('0xa'));var squel=require(_0x6786('0xb'));var crypto=require(_0x6786('0xc'));var jsforce=require(_0x6786('0xd'));var deskjs=require(_0x6786('0xe'));var toCsv=require(_0x6786('0x9'));var querystring=require(_0x6786('0xf'));var Papa=require(_0x6786('0x10'));var Redis=require(_0x6786('0x11'));var authService=require(_0x6786('0x12'));var qs=require(_0x6786('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6786('0x14'));var utils=require('../../config/utils');var config=require(_0x6786('0x15'));var db=require(_0x6786('0x16'))['db'];function respondWithStatusCode(_0x1c9c90,_0x1e5ca9){_0x1e5ca9=_0x1e5ca9||0xcc;return function(_0xab4765){if(_0xab4765){return _0x1c9c90[_0x6786('0x17')](_0x1e5ca9);}return _0x1c9c90['status'](_0x1e5ca9)['end']();};}function respondWithResult(_0x757454,_0x3a6524){_0x3a6524=_0x3a6524||0xc8;return function(_0x3d4e34){if(_0x3d4e34){return _0x757454['status'](_0x3a6524)[_0x6786('0x18')](_0x3d4e34);}};}function respondWithFilteredResult(_0x53b3c7,_0x36dc7c){return function(_0x592af8){if(_0x592af8){var _0x300a09=_0x592af8[_0x6786('0x19')],_0x3296f3=_0x36dc7c[_0x6786('0x1a')],_0x4ee3d1=_0x36dc7c['offset']+_0x36dc7c[_0x6786('0x1b')],_0x4fea3b;if(_0x4ee3d1>=_0x300a09){_0x4ee3d1=_0x300a09;_0x4fea3b=0xc8;}else{_0x4fea3b=0xce;}_0x53b3c7['status'](_0x4fea3b);return _0x53b3c7[_0x6786('0x1c')]('Content-Range',_0x3296f3+'-'+_0x4ee3d1+'/'+_0x300a09)[_0x6786('0x18')](_0x592af8);}return null;};}function patchUpdates(_0x3d569b){return function(_0x285f59){try{jsonpatch['apply'](_0x285f59,_0x3d569b,!![]);}catch(_0x12a17c){return BPromise['reject'](_0x12a17c);}return _0x285f59['save']();};}function saveUpdates(_0x22517c,_0x2e1cf6){return function(_0x398b8c){if(_0x398b8c){return _0x398b8c[_0x6786('0x1d')](_0x22517c)[_0x6786('0x1e')](function(_0xa36327){return _0xa36327;});}return null;};}function removeEntity(_0x4e091c,_0x39cab0){return function(_0x5b1ff8){if(_0x5b1ff8){return _0x5b1ff8[_0x6786('0x1f')]()[_0x6786('0x1e')](function(){_0x4e091c[_0x6786('0x20')](0xcc)[_0x6786('0x21')]();});}};}function handleEntityNotFound(_0x3539cd,_0x483abb){return function(_0x41aefb){if(!_0x41aefb){_0x3539cd['sendStatus'](0x194);}return _0x41aefb;};}function handleError(_0x343c4f,_0x1129be){_0x1129be=_0x1129be||0x1f4;return function(_0x2333d5){logger[_0x6786('0x22')](_0x2333d5['stack']);if(_0x2333d5['name']){delete _0x2333d5['name'];}_0x343c4f[_0x6786('0x20')](_0x1129be)[_0x6786('0x23')](_0x2333d5);};}exports[_0x6786('0x24')]=function(_0x396db1,_0x435787){var _0x869c2b={},_0x1e9ee2={},_0x1eddb3={'count':0x0,'rows':[]};var _0x2b3227=_[_0x6786('0x25')](db[_0x6786('0x26')][_0x6786('0x27')],function(_0x239fb0){return{'name':_0x239fb0['fieldName'],'type':_0x239fb0['type']['key']};});_0x1e9ee2[_0x6786('0x28')]=_[_0x6786('0x29')](_['map'](_0x2b3227,_0x6786('0x2a')),[_0x6786('0x2b')]);_0x1e9ee2[_0x6786('0x2c')]=_[_0x6786('0x2d')](_0x396db1[_0x6786('0x2c')]);_0x1e9ee2[_0x6786('0x2e')]=_[_0x6786('0x2f')](_0x1e9ee2['model'],_0x1e9ee2[_0x6786('0x2c')]);_0x869c2b[_0x6786('0x30')]=_[_0x6786('0x2f')](_0x1e9ee2['model'],qs['fields'](_0x396db1[_0x6786('0x2c')][_0x6786('0x31')]));_0x869c2b['attributes']=_0x869c2b['attributes']['length']?_0x869c2b[_0x6786('0x30')]:_0x1e9ee2[_0x6786('0x28')];if(!_0x396db1[_0x6786('0x2c')][_0x6786('0x32')](_0x6786('0x33'))){_0x869c2b[_0x6786('0x1b')]=qs[_0x6786('0x1b')](_0x396db1[_0x6786('0x2c')][_0x6786('0x1b')]);_0x869c2b[_0x6786('0x1a')]=qs[_0x6786('0x1a')](_0x396db1[_0x6786('0x2c')][_0x6786('0x1a')]);}_0x869c2b[_0x6786('0x34')]=qs[_0x6786('0x35')](_0x396db1[_0x6786('0x2c')][_0x6786('0x35')]);_0x869c2b[_0x6786('0x36')]=qs[_0x6786('0x2e')](_[_0x6786('0x37')](_0x396db1['query'],_0x1e9ee2[_0x6786('0x2e')]));if(_0x396db1[_0x6786('0x2c')][_0x6786('0x38')]){_0x869c2b[_0x6786('0x36')]=_[_0x6786('0x39')](_0x869c2b[_0x6786('0x36')],{'$or':_['map'](_0x2b3227,function(_0x181963){if(_0x181963['type']!==_0x6786('0x3a')){var _0x111b4c={};_0x111b4c[_0x181963[_0x6786('0x2a')]]={'$like':'%'+_0x396db1[_0x6786('0x2c')][_0x6786('0x38')]+'%'};return _0x111b4c;}})});}_0x869c2b=_['merge']({},_0x869c2b,_0x396db1[_0x6786('0x3b')]);var _0x26097a={'where':_0x869c2b[_0x6786('0x36')]};return db[_0x6786('0x26')]['count'](_0x26097a)[_0x6786('0x1e')](function(_0xc4809d){_0x1eddb3['count']=_0xc4809d;if(_0x396db1[_0x6786('0x2c')][_0x6786('0x3c')]){_0x869c2b[_0x6786('0x3d')]=[{'all':!![]}];}return db[_0x6786('0x26')][_0x6786('0x3e')](_0x869c2b);})[_0x6786('0x1e')](function(_0x31b503){_0x1eddb3[_0x6786('0x3f')]=_0x31b503;return _0x1eddb3;})[_0x6786('0x1e')](respondWithFilteredResult(_0x435787,_0x869c2b))[_0x6786('0x40')](handleError(_0x435787,null));};exports[_0x6786('0x41')]=function(_0x412f35,_0x3ea630){var _0x2bae39={'raw':![],'where':{'id':_0x412f35[_0x6786('0x42')]['id']}},_0x18899c={};_0x18899c[_0x6786('0x28')]=_[_0x6786('0x2d')](db[_0x6786('0x26')][_0x6786('0x27')]);_0x18899c['query']=_['keys'](_0x412f35['query']);_0x18899c[_0x6786('0x2e')]=_[_0x6786('0x2f')](_0x18899c[_0x6786('0x28')],_0x18899c[_0x6786('0x2c')]);_0x2bae39[_0x6786('0x30')]=_[_0x6786('0x2f')](_0x18899c['model'],qs['fields'](_0x412f35[_0x6786('0x2c')][_0x6786('0x31')]));_0x2bae39[_0x6786('0x30')]=_0x2bae39[_0x6786('0x30')][_0x6786('0x43')]?_0x2bae39[_0x6786('0x30')]:_0x18899c[_0x6786('0x28')];if(_0x412f35[_0x6786('0x2c')][_0x6786('0x3c')]){_0x2bae39['include']=[{'all':!![]}];}_0x2bae39=_['merge']({},_0x2bae39,_0x412f35[_0x6786('0x3b')]);return db[_0x6786('0x26')][_0x6786('0x44')](_0x2bae39)[_0x6786('0x1e')](handleEntityNotFound(_0x3ea630,null))[_0x6786('0x1e')](respondWithResult(_0x3ea630,null))[_0x6786('0x40')](handleError(_0x3ea630,null));};exports['create']=function(_0x46a2e7,_0x44901e){return db[_0x6786('0x26')][_0x6786('0x45')](_0x46a2e7[_0x6786('0x46')],{})['then'](respondWithResult(_0x44901e,0xc9))[_0x6786('0x40')](handleError(_0x44901e,null));};exports[_0x6786('0x1d')]=function(_0x2c322b,_0x26a643){if(_0x2c322b['body']['id']){delete _0x2c322b[_0x6786('0x46')]['id'];}delete _0x2c322b[_0x6786('0x46')]['duration'];delete _0x2c322b[_0x6786('0x46')]['createdAt'];delete _0x2c322b[_0x6786('0x46')][_0x6786('0x47')];delete _0x2c322b[_0x6786('0x46')][_0x6786('0x48')];return db[_0x6786('0x26')][_0x6786('0x44')]({'where':{'id':_0x2c322b[_0x6786('0x42')]['id']}})['then'](handleEntityNotFound(_0x26a643,null))[_0x6786('0x1e')](saveUpdates(_0x2c322b['body'],null))[_0x6786('0x1e')](respondWithResult(_0x26a643,null))[_0x6786('0x40')](handleError(_0x26a643,null));};exports[_0x6786('0x49')]=function(_0xe51a5b,_0x5d55b1){return db[_0x6786('0x26')]['describe']()['then'](respondWithResult(_0x5d55b1,null))[_0x6786('0x40')](handleError(_0x5d55b1,null));};exports[_0x6786('0x4a')]=function(_0x20819b,_0x7f64f2,_0x3d0960){var _0x576407=require(_0x6786('0x4b'));var _0x291381=![];var _0x416047={};if(_0x20819b[_0x6786('0x2c')]['type']&&_0x20819b[_0x6786('0x2c')][_0x6786('0x4c')]===_0x6786('0x4d')){_0x416047[_0x6786('0x4d')]=_0x20819b[_0x6786('0x42')]['id'];}else{_0x416047['id']=_0x20819b[_0x6786('0x42')]['id'];}return db['ScreenRecording'][_0x6786('0x44')]({'where':_0x416047,'attributes':['id',_0x6786('0x48')],'raw':!![]})[_0x6786('0x1e')](handleEntityNotFound(_0x7f64f2,null))[_0x6786('0x1e')](function(_0x513865){if(_0x513865){var _0x41496e=path['join'](config['root'],_0x6786('0x4e'),_0x513865[_0x6786('0x48')]);var _0x5c57d8=util[_0x6786('0x2b')](_0x6786('0x4f'),_0x41496e);if(fs[_0x6786('0x50')](_0x5c57d8)){_0x291381=!![];return _0x576407[_0x6786('0x51')](_0x5c57d8,_0x41496e,config[_0x6786('0x52')][_0x6786('0x53')])['then'](function(){return _0x513865;});}return _0x513865;}})['then'](function(_0x18c4b1){if(_0x18c4b1){var _0x564e11=path['join'](config[_0x6786('0x54')],'server/files/screen_recordings',_0x18c4b1['value']);if(!fs[_0x6786('0x50')](_0x564e11)){throw new db[(_0x6786('0x55'))][(_0x6786('0x56'))](_0x6786('0x57'));}if(_0x18c4b1[_0x6786('0x58')]){return _0x7f64f2[_0x6786('0x4a')](_0x564e11,_0x18c4b1[_0x6786('0x58')]+path[_0x6786('0x59')](_0x564e11),function(){if(_0x291381){fs[_0x6786('0x5a')](_0x564e11);}});}else{return _0x7f64f2[_0x6786('0x4a')](_0x564e11,function(_0x5a17ba){if(_0x291381){fs['unlink'](_0x564e11);}});}}})[_0x6786('0x40')](function(_0x17abc4){if(_0x17abc4[_0x6786('0x5b')]===_0x6786('0x57')){_0x7f64f2[_0x6786('0x20')](0x194)[_0x6786('0x23')](_0x6786('0x5c'));}else{return handleError(_0x7f64f2,null);}});};exports[_0x6786('0x1f')]=function(_0x25746d,_0x3bc2f0){return db[_0x6786('0x26')][_0x6786('0x44')]({'where':{'id':_0x25746d[_0x6786('0x42')]['id']}})[_0x6786('0x1e')](function(_0x4a5ea4){if(!_0x4a5ea4)throw new ReferenceError(_0x6786('0x5d'));return _0x4a5ea4;})[_0x6786('0x1e')](function(_0x2bce64){var _0x501bd5=path[_0x6786('0x5e')](config['root'],_0x6786('0x4e'),_0x2bce64[_0x6786('0x48')]);logger[_0x6786('0x5f')](_0x6786('0x60'),_0x501bd5);if(!_[_0x6786('0x61')](_0x2bce64[_0x6786('0x48')])&&fs['existsSync'](_0x501bd5)){logger[_0x6786('0x5f')](_0x6786('0x62')+_0x501bd5+_0x6786('0x63'));fs['unlinkSync'](_0x501bd5);}_0x501bd5=_0x501bd5+_0x6786('0x64');if(!_[_0x6786('0x61')](_0x2bce64[_0x6786('0x48')])&&fs[_0x6786('0x50')](_0x501bd5)){logger[_0x6786('0x5f')](_0x6786('0x62')+_0x501bd5+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x6786('0x65')](_0x501bd5);}return _0x2bce64;})[_0x6786('0x1e')](function(_0x15e415){if(!_0x15e415)throw new InternalError();return _0x15e415[_0x6786('0x1f')]();})[_0x6786('0x1e')](function(){_0x3bc2f0[_0x6786('0x20')](0xcc)[_0x6786('0x21')]();})[_0x6786('0x40')](handleError(_0x3bc2f0,null));}; \ No newline at end of file +var _0x904b=['map','ScreenRecording','rawAttributes','key','model','differenceBy','format','keys','query','intersection','attributes','fields','length','nolimit','limit','order','where','filters','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','create','body','duration','createdAt','describe','download','../../components/encryptor','uniqueid','find','value','join','server/files/screen_recordings','%s.cypher','decryptFile','root','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','Not\x20found','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','unlinkSync','.cypher','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x904b,0xa3));var _0xb904=function(_0xf227ab,_0x3121c0){_0xf227ab=_0xf227ab-0x0;var _0x17c8b7=_0x904b[_0xf227ab];return _0x17c8b7;};'use strict';var pdf=require(_0xb904('0x0'));var emlformat=require(_0xb904('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb904('0x2'));var jsonpatch=require(_0xb904('0x3'));var rp=require(_0xb904('0x4'));var moment=require(_0xb904('0x5'));var BPromise=require(_0xb904('0x6'));var Mustache=require(_0xb904('0x7'));var util=require(_0xb904('0x8'));var path=require(_0xb904('0x9'));var sox=require(_0xb904('0xa'));var csv=require(_0xb904('0xb'));var ejs=require(_0xb904('0xc'));var fs=require('fs');var _=require(_0xb904('0xd'));var squel=require(_0xb904('0xe'));var crypto=require(_0xb904('0xf'));var jsforce=require(_0xb904('0x10'));var deskjs=require(_0xb904('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb904('0x12'));var Redis=require('ioredis');var authService=require(_0xb904('0x13'));var qs=require(_0xb904('0x14'));var as=require(_0xb904('0x15'));var hardwareService=require(_0xb904('0x16'));var logger=require(_0xb904('0x17'))(_0xb904('0x18'));var utils=require(_0xb904('0x19'));var config=require(_0xb904('0x1a'));var db=require(_0xb904('0x1b'))['db'];function respondWithStatusCode(_0x1a707f,_0x25f8f5){_0x25f8f5=_0x25f8f5||0xcc;return function(_0x4a0a09){if(_0x4a0a09){return _0x1a707f[_0xb904('0x1c')](_0x25f8f5);}return _0x1a707f[_0xb904('0x1d')](_0x25f8f5)['end']();};}function respondWithResult(_0x5836c3,_0x176098){_0x176098=_0x176098||0xc8;return function(_0x239f2d){if(_0x239f2d){return _0x5836c3[_0xb904('0x1d')](_0x176098)[_0xb904('0x1e')](_0x239f2d);}};}function respondWithFilteredResult(_0x541103,_0x5bb4f7){return function(_0x206df5){if(_0x206df5){var _0x424cce=_0x206df5[_0xb904('0x1f')],_0xf5247d=_0x5bb4f7[_0xb904('0x20')],_0x2a44d9=_0x5bb4f7[_0xb904('0x20')]+_0x5bb4f7['limit'],_0xcda11c;if(_0x2a44d9>=_0x424cce){_0x2a44d9=_0x424cce;_0xcda11c=0xc8;}else{_0xcda11c=0xce;}_0x541103[_0xb904('0x1d')](_0xcda11c);return _0x541103[_0xb904('0x21')](_0xb904('0x22'),_0xf5247d+'-'+_0x2a44d9+'/'+_0x424cce)[_0xb904('0x1e')](_0x206df5);}return null;};}function patchUpdates(_0x244d33){return function(_0x47293c){try{jsonpatch[_0xb904('0x23')](_0x47293c,_0x244d33,!![]);}catch(_0x2c3f8e){return BPromise['reject'](_0x2c3f8e);}return _0x47293c[_0xb904('0x24')]();};}function saveUpdates(_0x2b948d,_0x1fc1a9){return function(_0x52755a){if(_0x52755a){return _0x52755a[_0xb904('0x25')](_0x2b948d)[_0xb904('0x26')](function(_0x2f5055){return _0x2f5055;});}return null;};}function removeEntity(_0xe6e94d,_0x38e8e4){return function(_0x592085){if(_0x592085){return _0x592085[_0xb904('0x27')]()[_0xb904('0x26')](function(){_0xe6e94d[_0xb904('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52f736,_0x101cf1){return function(_0x5cd88e){if(!_0x5cd88e){_0x52f736['sendStatus'](0x194);}return _0x5cd88e;};}function handleError(_0x3fb6e0,_0x22cbde){_0x22cbde=_0x22cbde||0x1f4;return function(_0xe01b73){logger[_0xb904('0x28')](_0xe01b73[_0xb904('0x29')]);if(_0xe01b73[_0xb904('0x2a')]){delete _0xe01b73[_0xb904('0x2a')];}_0x3fb6e0['status'](_0x22cbde)[_0xb904('0x2b')](_0xe01b73);};}exports[_0xb904('0x2c')]=function(_0x8f1983,_0x4002ee){var _0x263e3a={},_0x43e1b5={},_0x5a9412={'count':0x0,'rows':[]};var _0x559add=_[_0xb904('0x2d')](db[_0xb904('0x2e')][_0xb904('0x2f')],function(_0x58f1da){return{'name':_0x58f1da['fieldName'],'type':_0x58f1da['type'][_0xb904('0x30')]};});_0x43e1b5[_0xb904('0x31')]=_[_0xb904('0x32')](_[_0xb904('0x2d')](_0x559add,_0xb904('0x2a')),[_0xb904('0x33')]);_0x43e1b5['query']=_[_0xb904('0x34')](_0x8f1983[_0xb904('0x35')]);_0x43e1b5['filters']=_[_0xb904('0x36')](_0x43e1b5[_0xb904('0x31')],_0x43e1b5[_0xb904('0x35')]);_0x263e3a[_0xb904('0x37')]=_[_0xb904('0x36')](_0x43e1b5['model'],qs[_0xb904('0x38')](_0x8f1983[_0xb904('0x35')][_0xb904('0x38')]));_0x263e3a[_0xb904('0x37')]=_0x263e3a[_0xb904('0x37')][_0xb904('0x39')]?_0x263e3a[_0xb904('0x37')]:_0x43e1b5[_0xb904('0x31')];if(!_0x8f1983['query']['hasOwnProperty'](_0xb904('0x3a'))){_0x263e3a['limit']=qs[_0xb904('0x3b')](_0x8f1983[_0xb904('0x35')][_0xb904('0x3b')]);_0x263e3a['offset']=qs['offset'](_0x8f1983['query']['offset']);}_0x263e3a[_0xb904('0x3c')]=qs['sort'](_0x8f1983[_0xb904('0x35')]['sort']);_0x263e3a[_0xb904('0x3d')]=qs[_0xb904('0x3e')](_[_0xb904('0x3f')](_0x8f1983['query'],_0x43e1b5['filters']));if(_0x8f1983[_0xb904('0x35')][_0xb904('0x40')]){_0x263e3a[_0xb904('0x3d')]=_['merge'](_0x263e3a['where'],{'$or':_['map'](_0x559add,function(_0x492523){if(_0x492523[_0xb904('0x41')]!==_0xb904('0x42')){var _0x56c4a9={};_0x56c4a9[_0x492523[_0xb904('0x2a')]]={'$like':'%'+_0x8f1983[_0xb904('0x35')][_0xb904('0x40')]+'%'};return _0x56c4a9;}})});}_0x263e3a=_[_0xb904('0x43')]({},_0x263e3a,_0x8f1983['options']);var _0xe03ef0={'where':_0x263e3a[_0xb904('0x3d')]};return db[_0xb904('0x2e')]['count'](_0xe03ef0)[_0xb904('0x26')](function(_0x30641f){_0x5a9412[_0xb904('0x1f')]=_0x30641f;if(_0x8f1983[_0xb904('0x35')][_0xb904('0x44')]){_0x263e3a[_0xb904('0x45')]=[{'all':!![]}];}return db[_0xb904('0x2e')][_0xb904('0x46')](_0x263e3a);})[_0xb904('0x26')](function(_0x17dfa9){_0x5a9412['rows']=_0x17dfa9;return _0x5a9412;})[_0xb904('0x26')](respondWithFilteredResult(_0x4002ee,_0x263e3a))[_0xb904('0x47')](handleError(_0x4002ee,null));};exports[_0xb904('0x48')]=function(_0x564243,_0x2300ed){var _0x436526={'raw':![],'where':{'id':_0x564243[_0xb904('0x49')]['id']}},_0x21d7ab={};_0x21d7ab[_0xb904('0x31')]=_['keys'](db[_0xb904('0x2e')][_0xb904('0x2f')]);_0x21d7ab[_0xb904('0x35')]=_[_0xb904('0x34')](_0x564243[_0xb904('0x35')]);_0x21d7ab[_0xb904('0x3e')]=_[_0xb904('0x36')](_0x21d7ab['model'],_0x21d7ab[_0xb904('0x35')]);_0x436526[_0xb904('0x37')]=_['intersection'](_0x21d7ab[_0xb904('0x31')],qs[_0xb904('0x38')](_0x564243['query'][_0xb904('0x38')]));_0x436526['attributes']=_0x436526['attributes'][_0xb904('0x39')]?_0x436526[_0xb904('0x37')]:_0x21d7ab['model'];if(_0x564243[_0xb904('0x35')][_0xb904('0x44')]){_0x436526[_0xb904('0x45')]=[{'all':!![]}];}_0x436526=_[_0xb904('0x43')]({},_0x436526,_0x564243['options']);return db[_0xb904('0x2e')]['find'](_0x436526)[_0xb904('0x26')](handleEntityNotFound(_0x2300ed,null))['then'](respondWithResult(_0x2300ed,null))[_0xb904('0x47')](handleError(_0x2300ed,null));};exports[_0xb904('0x4a')]=function(_0x507828,_0x3f20f9){return db[_0xb904('0x2e')]['create'](_0x507828[_0xb904('0x4b')],{})[_0xb904('0x26')](respondWithResult(_0x3f20f9,0xc9))[_0xb904('0x47')](handleError(_0x3f20f9,null));};exports[_0xb904('0x25')]=function(_0x3fc9f3,_0x5aeaa1){if(_0x3fc9f3[_0xb904('0x4b')]['id']){delete _0x3fc9f3[_0xb904('0x4b')]['id'];}delete _0x3fc9f3[_0xb904('0x4b')][_0xb904('0x4c')];delete _0x3fc9f3[_0xb904('0x4b')][_0xb904('0x4d')];delete _0x3fc9f3[_0xb904('0x4b')]['closedAt'];delete _0x3fc9f3['body']['value'];return db[_0xb904('0x2e')]['find']({'where':{'id':_0x3fc9f3[_0xb904('0x49')]['id']}})[_0xb904('0x26')](handleEntityNotFound(_0x5aeaa1,null))[_0xb904('0x26')](saveUpdates(_0x3fc9f3[_0xb904('0x4b')],null))[_0xb904('0x26')](respondWithResult(_0x5aeaa1,null))[_0xb904('0x47')](handleError(_0x5aeaa1,null));};exports[_0xb904('0x4e')]=function(_0x1f4a9e,_0x108435){return db[_0xb904('0x2e')]['describe']()[_0xb904('0x26')](respondWithResult(_0x108435,null))['catch'](handleError(_0x108435,null));};exports[_0xb904('0x4f')]=function(_0x49e2a4,_0x2fed32,_0x4bc918){var _0x35f1c1=require(_0xb904('0x50'));var _0x56c3ad=![];var _0x210693={};if(_0x49e2a4[_0xb904('0x35')]['type']&&_0x49e2a4['query'][_0xb904('0x41')]===_0xb904('0x51')){_0x210693['uniqueid']=_0x49e2a4[_0xb904('0x49')]['id'];}else{_0x210693['id']=_0x49e2a4[_0xb904('0x49')]['id'];}return db[_0xb904('0x2e')][_0xb904('0x52')]({'where':_0x210693,'attributes':['id',_0xb904('0x53')],'raw':!![]})['then'](handleEntityNotFound(_0x2fed32,null))[_0xb904('0x26')](function(_0x5cae8e){if(_0x5cae8e){var _0xded14d=path[_0xb904('0x54')](config['root'],_0xb904('0x55'),_0x5cae8e[_0xb904('0x53')]);var _0x52a9c1=util[_0xb904('0x33')](_0xb904('0x56'),_0xded14d);if(fs['existsSync'](_0x52a9c1)){_0x56c3ad=!![];return _0x35f1c1[_0xb904('0x57')](_0x52a9c1,_0xded14d,config['secrets']['recording'])[_0xb904('0x26')](function(){return _0x5cae8e;});}return _0x5cae8e;}})[_0xb904('0x26')](function(_0x40f0a8){if(_0x40f0a8){var _0x2d246a=path['join'](config[_0xb904('0x58')],'server/files/screen_recordings',_0x40f0a8['value']);if(!fs[_0xb904('0x59')](_0x2d246a)){throw new db[(_0xb904('0x5a'))][(_0xb904('0x5b'))](_0xb904('0x5c'));}if(_0x40f0a8[_0xb904('0x5d')]){return _0x2fed32[_0xb904('0x4f')](_0x2d246a,_0x40f0a8[_0xb904('0x5d')]+path['extname'](_0x2d246a),function(){if(_0x56c3ad){fs[_0xb904('0x5e')](_0x2d246a);}});}else{return _0x2fed32[_0xb904('0x4f')](_0x2d246a,function(_0x376c26){if(_0x56c3ad){fs[_0xb904('0x5e')](_0x2d246a);}});}}})['catch'](function(_0x5db5ea){if(_0x5db5ea['message']==='ScreenRecording\x20not\x20found'){_0x2fed32[_0xb904('0x1d')](0x194)[_0xb904('0x2b')](_0xb904('0x5f'));}else{return handleError(_0x2fed32,null);}});};exports[_0xb904('0x27')]=function(_0x503143,_0x3b7a51){return db['ScreenRecording']['find']({'where':{'id':_0x503143[_0xb904('0x49')]['id']}})[_0xb904('0x26')](function(_0x3af631){if(!_0x3af631)throw new ReferenceError(_0xb904('0x60'));return _0x3af631;})[_0xb904('0x26')](function(_0x595fcd){var _0x4dce6e=path[_0xb904('0x54')](config[_0xb904('0x58')],_0xb904('0x55'),_0x595fcd['value']);logger['info'](_0xb904('0x61'),_0x4dce6e);if(!_['isNil'](_0x595fcd[_0xb904('0x53')])&&fs[_0xb904('0x59')](_0x4dce6e)){logger[_0xb904('0x62')](_0xb904('0x63')+_0x4dce6e+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xb904('0x64')](_0x4dce6e);}_0x4dce6e=_0x4dce6e+_0xb904('0x65');if(!_[_0xb904('0x66')](_0x595fcd['value'])&&fs['existsSync'](_0x4dce6e)){logger[_0xb904('0x62')]('File:\x20\x22'+_0x4dce6e+_0xb904('0x67'));fs['unlinkSync'](_0x4dce6e);}return _0x595fcd;})[_0xb904('0x26')](function(_0x574352){if(!_0x574352)throw new InternalError();return _0x574352[_0xb904('0x27')]();})[_0xb904('0x26')](function(){_0x3b7a51[_0xb904('0x1d')](0xcc)['end']();})[_0xb904('0x47')](handleError(_0x3b7a51,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 55a0dc3..541255d 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 _0xfb29=['../../config/logger','../../config/environment','./screenRecording.attributes','exports','define','screen_recordings','interactionid','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb29,0x166));var _0x9fb2=function(_0x2e21dc,_0x4a317e){_0x2e21dc=_0x2e21dc-0x0;var _0x1c9a46=_0xfb29[_0x2e21dc];return _0x1c9a46;};'use strict';var _=require(_0x9fb2('0x0'));var util=require(_0x9fb2('0x1'));var logger=require(_0x9fb2('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('rimraf');var config=require(_0x9fb2('0x3'));var attributes=require(_0x9fb2('0x4'));module[_0x9fb2('0x5')]=function(_0x451617,_0x275a4f){return _0x451617[_0x9fb2('0x6')]('ScreenRecording',attributes,{'tableName':_0x9fb2('0x7'),'paranoid':![],'indexes':[{'name':_0x9fb2('0x8'),'fields':[_0x9fb2('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe489=['screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./screenRecording.attributes','exports','ScreenRecording'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xe489,0x188));var _0x9e48=function(_0x2eea31,_0xf39fec){_0x2eea31=_0x2eea31-0x0;var _0x4d1c23=_0xe489[_0x2eea31];return _0x4d1c23;};'use strict';var _=require(_0x9e48('0x0'));var util=require(_0x9e48('0x1'));var logger=require(_0x9e48('0x2'))(_0x9e48('0x3'));var moment=require(_0x9e48('0x4'));var BPromise=require(_0x9e48('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e48('0x6'));var rimraf=require(_0x9e48('0x7'));var config=require('../../config/environment');var attributes=require(_0x9e48('0x8'));module[_0x9e48('0x9')]=function(_0x33b39a,_0x5911b6){return _0x33b39a['define'](_0x9e48('0xa'),attributes,{'tableName':_0x9e48('0xb'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x9e48('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 9ec601e..48d5c24 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(_0x2b9fb9,_0x1b19d3){var _0x19669a=function(_0x449cc1){while(--_0x449cc1){_0x2b9fb9['push'](_0x2b9fb9['shift']());}};_0x19669a(++_0x1b19d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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(_0x290007,_0x34b36f){var _0x4faef2=function(_0x58f693){while(--_0x58f693){_0x290007['push'](_0x290007['shift']());}};_0x4faef2(++_0x34b36f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 5a436d6..5ee1133 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 _0xd191=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./setting.controller','isAuthenticated','get','/:id','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','extname','originalname','post','single','file','addLogo','logologin','addLogoLogin','preferred','addPreferred','/:id/favicon','put','multer'];(function(_0x473079,_0x4aa14b){var _0x138470=function(_0x4b68af){while(--_0x4b68af){_0x473079['push'](_0x473079['shift']());}};_0x138470(++_0x4aa14b);}(_0xd191,0x1ac));var _0x1d19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd191[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1d19('0x0'));var util=require(_0x1d19('0x1'));var path=require(_0x1d19('0x2'));var timeout=require(_0x1d19('0x3'));var express=require(_0x1d19('0x4'));var router=express[_0x1d19('0x5')]();var auth=require(_0x1d19('0x6'));var interaction=require(_0x1d19('0x7'));var config=require('../../config/environment');var controller=require(_0x1d19('0x8'));router['get']('/',auth[_0x1d19('0x9')](),controller['index']);router[_0x1d19('0xa')](_0x1d19('0xb'),controller[_0x1d19('0xc')]);router[_0x1d19('0xa')](_0x1d19('0xd'),controller[_0x1d19('0xe')]);router['get'](_0x1d19('0xf'),controller['getLogoLogin']);router[_0x1d19('0xa')](_0x1d19('0x10'),controller[_0x1d19('0x11')]);router[_0x1d19('0xa')](_0x1d19('0x12'),controller[_0x1d19('0x13')]);router[_0x1d19('0xa')]('/:id/favicon',controller[_0x1d19('0x14')]);var upload=multer({'storage':multer[_0x1d19('0x15')]({'destination':function(_0x38c4c8,_0x5c4c6d,_0x1d3c23){_0x1d3c23(null,path[_0x1d19('0x16')](config[_0x1d19('0x17')],_0x1d19('0x18')));},'filename':function(_0x52eba8,_0x411681,_0x4e547a){_0x4e547a(null,util[_0x1d19('0x19')](_0x1d19('0x1a'),'logo',path[_0x1d19('0x1b')](_0x411681[_0x1d19('0x1c')])));}})});router[_0x1d19('0x1d')](_0x1d19('0xd'),upload[_0x1d19('0x1e')](_0x1d19('0x1f')),controller[_0x1d19('0x20')]);var upload=multer({'storage':multer[_0x1d19('0x15')]({'destination':function(_0x3844c0,_0x7332c5,_0x4c682c){_0x4c682c(null,path[_0x1d19('0x16')](config['root'],'server/files/images/logos/'));},'filename':function(_0x28a6c8,_0x47b013,_0x3f7127){_0x3f7127(null,util[_0x1d19('0x19')](_0x1d19('0x1a'),_0x1d19('0x21'),path[_0x1d19('0x1b')](_0x47b013[_0x1d19('0x1c')])));}})});router[_0x1d19('0x1d')](_0x1d19('0xf'),upload['single'](_0x1d19('0x1f')),controller[_0x1d19('0x22')]);var upload=multer({'storage':multer[_0x1d19('0x15')]({'destination':function(_0x2b6357,_0x57c989,_0x1ac588){_0x1ac588(null,path[_0x1d19('0x16')](config['root'],_0x1d19('0x18')));},'filename':function(_0x19ba58,_0x3ad7d8,_0x306e3d){_0x306e3d(null,util[_0x1d19('0x19')]('%s%s',_0x1d19('0x23'),path[_0x1d19('0x1b')](_0x3ad7d8[_0x1d19('0x1c')])));}})});router[_0x1d19('0x1d')]('/:id/preferred',upload['single'](_0x1d19('0x1f')),controller[_0x1d19('0x24')]);var upload=multer({'storage':multer[_0x1d19('0x15')]({'destination':function(_0x1024db,_0x46d705,_0x29c5a2){_0x29c5a2(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x1b6f36,_0x4bf7c7,_0xdd872b){_0xdd872b(null,util[_0x1d19('0x19')](_0x1d19('0x1a'),'favicon',path['extname'](_0x4bf7c7['originalname'])));}})});router['post'](_0x1d19('0x25'),upload[_0x1d19('0x1e')](_0x1d19('0x1f')),controller['addFavicon']);router[_0x1d19('0x26')]('/:id',auth[_0x1d19('0x9')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x4be4=['root','/:id/logo_login','single','file','addLogoLogin','preferred','addPreferred','favicon','/:id/favicon','addFavicon','put','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','/:id/logo','getLogo','get','getLogoLogin','/:id/gdpr','/:id/preferred','diskStorage','join','server/files/images/logos/','format','%s%s','logo','extname','originalname','post'];(function(_0x5c0950,_0x166e08){var _0xc5665a=function(_0x5f2b61){while(--_0x5f2b61){_0x5c0950['push'](_0x5c0950['shift']());}};_0xc5665a(++_0x166e08);}(_0x4be4,0x1b9));var _0x44be=function(_0x2b18e9,_0x18e52f){_0x2b18e9=_0x2b18e9-0x0;var _0x9d0c32=_0x4be4[_0x2b18e9];return _0x9d0c32;};'use strict';var multer=require(_0x44be('0x0'));var util=require('util');var path=require(_0x44be('0x1'));var timeout=require(_0x44be('0x2'));var express=require(_0x44be('0x3'));var router=express[_0x44be('0x4')]();var auth=require(_0x44be('0x5'));var interaction=require(_0x44be('0x6'));var config=require(_0x44be('0x7'));var controller=require('./setting.controller');router['get']('/',auth[_0x44be('0x8')](),controller[_0x44be('0x9')]);router['get'](_0x44be('0xa'),controller[_0x44be('0xb')]);router['get'](_0x44be('0xc'),controller[_0x44be('0xd')]);router[_0x44be('0xe')]('/:id/logo_login',controller[_0x44be('0xf')]);router[_0x44be('0xe')](_0x44be('0x10'),controller['gdpr']);router[_0x44be('0xe')](_0x44be('0x11'),controller['getPreferred']);router['get']('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer[_0x44be('0x12')]({'destination':function(_0x18fa95,_0x2d0cda,_0x415709){_0x415709(null,path[_0x44be('0x13')](config['root'],_0x44be('0x14')));},'filename':function(_0x33969e,_0x3d04a7,_0x53e4e9){_0x53e4e9(null,util[_0x44be('0x15')](_0x44be('0x16'),_0x44be('0x17'),path[_0x44be('0x18')](_0x3d04a7[_0x44be('0x19')])));}})});router[_0x44be('0x1a')](_0x44be('0xc'),upload['single']('file'),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x350e31,_0x1da68f,_0x13d416){_0x13d416(null,path[_0x44be('0x13')](config[_0x44be('0x1b')],'server/files/images/logos/'));},'filename':function(_0x5c8423,_0x420245,_0x4a18a7){_0x4a18a7(null,util[_0x44be('0x15')](_0x44be('0x16'),'logologin',path[_0x44be('0x18')](_0x420245[_0x44be('0x19')])));}})});router['post'](_0x44be('0x1c'),upload[_0x44be('0x1d')](_0x44be('0x1e')),controller[_0x44be('0x1f')]);var upload=multer({'storage':multer[_0x44be('0x12')]({'destination':function(_0x22679f,_0x10eb7e,_0x32d0e5){_0x32d0e5(null,path[_0x44be('0x13')](config[_0x44be('0x1b')],'server/files/images/logos/'));},'filename':function(_0x310043,_0x31bb7a,_0x2ad976){_0x2ad976(null,util['format'](_0x44be('0x16'),_0x44be('0x20'),path[_0x44be('0x18')](_0x31bb7a['originalname'])));}})});router[_0x44be('0x1a')]('/:id/preferred',upload[_0x44be('0x1d')](_0x44be('0x1e')),controller[_0x44be('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x371705,_0x5a59be,_0xfb0999){_0xfb0999(null,path[_0x44be('0x13')](config['root'],_0x44be('0x14')));},'filename':function(_0x5b13dc,_0x65d32e,_0x3fb3df){_0x3fb3df(null,util[_0x44be('0x15')](_0x44be('0x16'),_0x44be('0x22'),path[_0x44be('0x18')](_0x65d32e[_0x44be('0x19')])));}})});router['post'](_0x44be('0x23'),upload[_0x44be('0x1d')](_0x44be('0x1e')),controller[_0x44be('0x24')]);router[_0x44be('0x25')](_0x44be('0xa'),auth[_0x44be('0x8')](),controller['update']);module[_0x44be('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 95d9c15..e2b3fa5 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 _0x2dc5=['STRING','https://www.xcally.com/bar/phonebar/autoupdater.xml','sequelize','exports','INTEGER','min_internal','BOOLEAN'];(function(_0x4f7d74,_0x20eeec){var _0x5047d=function(_0x308629){while(--_0x308629){_0x4f7d74['push'](_0x4f7d74['shift']());}};_0x5047d(++_0x20eeec);}(_0x2dc5,0x16e));var _0x52dc=function(_0x1de339,_0x166cef){_0x1de339=_0x1de339-0x0;var _0x3cd633=_0x2dc5[_0x1de339];return _0x3cd633;};'use strict';var Sequelize=require(_0x52dc('0x0'));module[_0x52dc('0x1')]={'min_internal':{'type':Sequelize[_0x52dc('0x2')](0xb),'unique':_0x52dc('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x52dc('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x52dc('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x52dc('0x4')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x52dc('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x52dc('0x4')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x52dc('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x52dc('0x4')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x52dc('0x4')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x52dc('0x5')]},'turnaddr':{'type':Sequelize[_0x52dc('0x5')]},'turnusername':{'type':Sequelize[_0x52dc('0x5')]},'turnpassword':{'type':Sequelize[_0x52dc('0x5')]},'pageTitle':{'type':Sequelize[_0x52dc('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x52dc('0x4')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x52dc('0x4')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x52dc('0x4')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x52dc('0x5')],'defaultValue':_0x52dc('0x6')},'enableEmailPreview':{'type':Sequelize[_0x52dc('0x4')],'defaultValue':![]},'split':{'type':Sequelize[_0x52dc('0x4')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x52dc('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x52dc('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x52dc('0x5')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x52dc('0x4')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x52dc('0x4')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x52dc('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x52dc('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x52dc('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x52dc('0x5')]},'defaultFavicon':{'type':Sequelize[_0x52dc('0x4')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'googleSsoEnabled':{'type':Sequelize[_0x52dc('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x9529=['STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x2316c4,_0x943509){var _0x127359=function(_0x3e52de){while(--_0x3e52de){_0x2316c4['push'](_0x2316c4['shift']());}};_0x127359(++_0x943509);}(_0x9529,0x12f));var _0x9952=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9529[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x9952('0x0'));module[_0x9952('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x9952('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x9952('0x3')],'defaultValue':_0x9952('0x4')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x9952('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x9952('0x3')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x9952('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x9952('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x9952('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x9952('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x9952('0x3')]},'turnaddr':{'type':Sequelize[_0x9952('0x3')]},'turnusername':{'type':Sequelize[_0x9952('0x3')]},'turnpassword':{'type':Sequelize[_0x9952('0x3')]},'pageTitle':{'type':Sequelize[_0x9952('0x3')]},'defaultPageTitle':{'type':Sequelize[_0x9952('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x9952('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x9952('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x9952('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x9952('0x3')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x9952('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0x9952('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x9952('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x9952('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x9952('0x3')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x9952('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x9952('0x3')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x9952('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x9952('0x3')]},'defaultFavicon':{'type':Sequelize[_0x9952('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 5efc1ec..8266441 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 _0x3780=['lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','update','stack','name','index','map','Setting','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','include','findAll','rows','body','find','params','addLogo','file','filename','addLogoLogin','getLogo','server/files/images/logos','getLicense','logo','preferred','favicon','defaultLogo','defaultPreferred','existsSync','join','root','toLower','default_logo.png','custom','upperFirst','\x20not\x20found','download','../../config/license/util','getLogoLogin','loginLogo','default_loginLogo.png','gdpr','securePassword','addPreferred','defaultLoginLogo','default_preferred.png','default','addFavicon','getFavicon','defaultFavicon','default_favicon.ico','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3780,0xe0));var _0x0378=function(_0xd02d0a,_0x141287){_0xd02d0a=_0xd02d0a-0x0;var _0x2114f2=_0x3780[_0xd02d0a];return _0x2114f2;};'use strict';var pdf=require(_0x0378('0x0'));var emlformat=require(_0x0378('0x1'));var rimraf=require(_0x0378('0x2'));var zipdir=require(_0x0378('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0378('0x4'));var BPromise=require(_0x0378('0x5'));var Mustache=require(_0x0378('0x6'));var util=require(_0x0378('0x7'));var path=require(_0x0378('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0378('0x9'));var fs=require('fs');var _=require(_0x0378('0xa'));var squel=require('squel');var crypto=require(_0x0378('0xb'));var jsforce=require(_0x0378('0xc'));var deskjs=require(_0x0378('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0378('0xe'));var Papa=require(_0x0378('0xf'));var Redis=require('ioredis');var authService=require(_0x0378('0x10'));var qs=require(_0x0378('0x11'));var as=require(_0x0378('0x12'));var hardwareService=require(_0x0378('0x13'));var logger=require(_0x0378('0x14'))(_0x0378('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0378('0x16'))['db'];var jayson=require(_0x0378('0x17'));var client=jayson[_0x0378('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x12a867,_0x559f44,_0x301c5a){if(_0x301c5a){var _0x5d8251=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5d8251['test'](_0x559f44)){return _0x12a867;}else{throw new db[(_0x0378('0x19'))][(_0x0378('0x1a'))](_0x0378('0x1b'));}}else{return _0x12a867;}}function respondWithRpcPromise(_0x56a2f2,_0x2e8754,_0x69ed52,_0x7b2d07){return new BPromise(function(_0x35873d,_0xf9361){var _0x100ca4=_0x7b2d07||client;return _0x100ca4['request'](_0x56a2f2,_0x69ed52)[_0x0378('0x1c')](function(_0x1426ad){logger[_0x0378('0x1d')](_0x0378('0x1e'),_0x2e8754,_0x0378('0x1f'));logger[_0x0378('0x20')]('Setting,\x20%s,\x20%s,\x20%s',_0x2e8754,_0x0378('0x1f'),JSON[_0x0378('0x21')](_0x1426ad));if(_0x1426ad[_0x0378('0x22')]){if(_0x1426ad[_0x0378('0x22')][_0x0378('0x23')]===0x1f4){logger[_0x0378('0x22')](_0x0378('0x1e'),_0x2e8754,_0x1426ad['error']['message']);return _0xf9361(_0x1426ad['error'][_0x0378('0x24')]);}logger[_0x0378('0x22')](_0x0378('0x1e'),_0x2e8754,_0x1426ad[_0x0378('0x22')][_0x0378('0x24')]);return _0x35873d(_0x1426ad[_0x0378('0x22')][_0x0378('0x24')]);}else{logger[_0x0378('0x1d')](_0x0378('0x1e'),_0x2e8754,_0x0378('0x1f'));_0x35873d(_0x1426ad['result'][_0x0378('0x24')]);}})[_0x0378('0x25')](function(_0x3f183c){logger[_0x0378('0x22')](_0x0378('0x1e'),_0x2e8754,_0x3f183c);_0xf9361(_0x3f183c);});});}function respondWithStatusCode(_0xae3387,_0x2dac77){_0x2dac77=_0x2dac77||0xcc;return function(_0x3f1228){if(_0x3f1228){return _0xae3387[_0x0378('0x26')](_0x2dac77);}return _0xae3387[_0x0378('0x27')](_0x2dac77)[_0x0378('0x28')]();};}function respondWithResult(_0x3f38d7,_0x45ce69){_0x45ce69=_0x45ce69||0xc8;return function(_0x21a148){if(_0x21a148){return _0x3f38d7[_0x0378('0x27')](_0x45ce69)[_0x0378('0x29')](_0x21a148);}};}function respondWithFilteredResult(_0x53c6f9,_0x33a421){return function(_0x2ef845){if(_0x2ef845){var _0x3b4550=_0x2ef845['count'],_0x388d96=_0x33a421[_0x0378('0x2a')],_0xb24a14=_0x33a421[_0x0378('0x2a')]+_0x33a421['limit'],_0x322f4a;if(_0xb24a14>=_0x3b4550){_0xb24a14=_0x3b4550;_0x322f4a=0xc8;}else{_0x322f4a=0xce;}_0x53c6f9[_0x0378('0x27')](_0x322f4a);return _0x53c6f9[_0x0378('0x2b')](_0x0378('0x2c'),_0x388d96+'-'+_0xb24a14+'/'+_0x3b4550)[_0x0378('0x29')](_0x2ef845);}return null;};}function patchUpdates(_0x3acb65){return function(_0x1e384d){try{jsonpatch[_0x0378('0x2d')](_0x1e384d,_0x3acb65,!![]);}catch(_0x2a0ad2){return BPromise[_0x0378('0x2e')](_0x2a0ad2);}return _0x1e384d['save']();};}function saveUpdates(_0x4c9f22,_0x225616){return function(_0x165c1d){if(_0x165c1d){return _0x165c1d[_0x0378('0x2f')](_0x4c9f22)['then'](function(_0x50c373){return _0x50c373;});}return null;};}function removeEntity(_0x1c401e,_0x2a3f31){return function(_0x477dba){if(_0x477dba){return _0x477dba['destroy']()[_0x0378('0x1c')](function(){_0x1c401e[_0x0378('0x27')](0xcc)[_0x0378('0x28')]();});}};}function handleEntityNotFound(_0x457414,_0x25ecf9){return function(_0x137a7c){if(!_0x137a7c){_0x457414[_0x0378('0x26')](0x194);}return _0x137a7c;};}function handleError(_0x23d725,_0x4d7d4a){_0x4d7d4a=_0x4d7d4a||0x1f4;return function(_0x3d4c02){logger[_0x0378('0x22')](_0x3d4c02[_0x0378('0x30')]);if(_0x3d4c02['name']){delete _0x3d4c02[_0x0378('0x31')];}_0x23d725[_0x0378('0x27')](_0x4d7d4a)['send'](_0x3d4c02);};}exports[_0x0378('0x32')]=function(_0x42f33a,_0x49a9e9){var _0x192b9b={},_0x401eb9={},_0x58a204={'count':0x0,'rows':[]};var _0x3f83be=_[_0x0378('0x33')](db[_0x0378('0x34')][_0x0378('0x35')],function(_0x8c0695){return{'name':_0x8c0695[_0x0378('0x36')],'type':_0x8c0695['type'][_0x0378('0x37')]};});_0x401eb9['model']=_[_0x0378('0x33')](_0x3f83be,_0x0378('0x31'));_0x401eb9[_0x0378('0x38')]=_[_0x0378('0x39')](_0x42f33a[_0x0378('0x38')]);_0x401eb9[_0x0378('0x3a')]=_[_0x0378('0x3b')](_0x401eb9['model'],_0x401eb9[_0x0378('0x38')]);_0x192b9b[_0x0378('0x3c')]=_[_0x0378('0x3b')](_0x401eb9[_0x0378('0x3d')],qs['fields'](_0x42f33a['query'][_0x0378('0x3e')]));_0x192b9b[_0x0378('0x3c')]=_0x192b9b['attributes'][_0x0378('0x3f')]?_0x192b9b[_0x0378('0x3c')]:_0x401eb9[_0x0378('0x3d')];if(!_0x42f33a[_0x0378('0x38')][_0x0378('0x40')]('nolimit')){_0x192b9b[_0x0378('0x41')]=qs[_0x0378('0x41')](_0x42f33a[_0x0378('0x38')][_0x0378('0x41')]);_0x192b9b[_0x0378('0x2a')]=qs['offset'](_0x42f33a[_0x0378('0x38')][_0x0378('0x2a')]);}_0x192b9b[_0x0378('0x42')]=qs['sort'](_0x42f33a['query'][_0x0378('0x43')]);_0x192b9b[_0x0378('0x44')]=qs[_0x0378('0x3a')](_[_0x0378('0x45')](_0x42f33a[_0x0378('0x38')],_0x401eb9['filters']));if(_0x42f33a['query'][_0x0378('0x46')]){_0x192b9b['where']=_[_0x0378('0x47')](_0x192b9b[_0x0378('0x44')],{'$or':_[_0x0378('0x33')](_0x3f83be,function(_0x2f7aa7){if(_0x2f7aa7[_0x0378('0x48')]!==_0x0378('0x49')){var _0x392638={};_0x392638[_0x2f7aa7[_0x0378('0x31')]]={'$like':'%'+_0x42f33a[_0x0378('0x38')][_0x0378('0x46')]+'%'};return _0x392638;}})});}_0x192b9b=_[_0x0378('0x47')]({},_0x192b9b,_0x42f33a[_0x0378('0x4a')]);var _0x39afdb={'where':_0x192b9b[_0x0378('0x44')]};return db[_0x0378('0x34')][_0x0378('0x4b')](_0x39afdb)[_0x0378('0x1c')](function(_0x3ca03e){_0x58a204[_0x0378('0x4b')]=_0x3ca03e;if(_0x42f33a[_0x0378('0x38')]['includeAll']){_0x192b9b[_0x0378('0x4c')]=[{'all':!![]}];}return db[_0x0378('0x34')][_0x0378('0x4d')](_0x192b9b);})[_0x0378('0x1c')](function(_0x22d049){_0x58a204[_0x0378('0x4e')]=_0x22d049;return _0x58a204;})[_0x0378('0x1c')](respondWithFilteredResult(_0x49a9e9,_0x192b9b))[_0x0378('0x25')](handleError(_0x49a9e9,null));};exports['show']=function(_0x377a4a,_0x319803){var _0x278245={'raw':![],'where':{'id':_0x377a4a['params']['id']}},_0x47137d={};_0x47137d[_0x0378('0x3d')]=_[_0x0378('0x39')](db[_0x0378('0x34')]['rawAttributes']);_0x47137d['query']=_['keys'](_0x377a4a[_0x0378('0x38')]);_0x47137d[_0x0378('0x3a')]=_[_0x0378('0x3b')](_0x47137d['model'],_0x47137d[_0x0378('0x38')]);_0x278245[_0x0378('0x3c')]=_[_0x0378('0x3b')](_0x47137d['model'],qs[_0x0378('0x3e')](_0x377a4a[_0x0378('0x38')][_0x0378('0x3e')]));_0x278245[_0x0378('0x3c')]=_0x278245['attributes'][_0x0378('0x3f')]?_0x278245[_0x0378('0x3c')]:_0x47137d[_0x0378('0x3d')];if(_0x377a4a[_0x0378('0x38')]['includeAll']){_0x278245[_0x0378('0x4c')]=[{'all':!![]}];}_0x278245=_[_0x0378('0x47')]({},_0x278245,_0x377a4a[_0x0378('0x4a')]);return db['Setting']['find'](_0x278245)['then'](handleEntityNotFound(_0x319803,null))['then'](respondWithResult(_0x319803,null))[_0x0378('0x25')](handleError(_0x319803,null));};exports[_0x0378('0x2f')]=function(_0x27dcad,_0x16c5fa){if(_0x27dcad[_0x0378('0x4f')]['id']){delete _0x27dcad['body']['id'];}return db[_0x0378('0x34')][_0x0378('0x50')]({'where':{'id':_0x27dcad[_0x0378('0x51')]['id']}})[_0x0378('0x1c')](handleEntityNotFound(_0x16c5fa,null))[_0x0378('0x1c')](saveUpdates(_0x27dcad[_0x0378('0x4f')],null))[_0x0378('0x1c')](respondWithResult(_0x16c5fa,null))[_0x0378('0x25')](handleError(_0x16c5fa,null));};exports[_0x0378('0x52')]=function(_0x31b838,_0x4e55da,_0x3cd259){if(_0x31b838[_0x0378('0x53')]&&_0x31b838[_0x0378('0x53')][_0x0378('0x54')]){_0x31b838[_0x0378('0x4f')]['logo']=_0x31b838[_0x0378('0x53')][_0x0378('0x54')];}return db[_0x0378('0x34')][_0x0378('0x50')]({'where':{'id':_0x31b838[_0x0378('0x51')]['id']}})[_0x0378('0x1c')](handleEntityNotFound(_0x4e55da,null))[_0x0378('0x1c')](saveUpdates(_0x31b838[_0x0378('0x4f')],null))[_0x0378('0x1c')](respondWithResult(_0x4e55da,null))['catch'](handleError(_0x4e55da,null));};exports[_0x0378('0x55')]=function(_0x442c8d,_0x1d0302,_0xa784bd){if(_0x442c8d[_0x0378('0x53')]&&_0x442c8d[_0x0378('0x53')][_0x0378('0x54')]){_0x442c8d[_0x0378('0x4f')]['loginLogo']=_0x442c8d[_0x0378('0x53')][_0x0378('0x54')];}return db[_0x0378('0x34')][_0x0378('0x50')]({'where':{'id':_0x442c8d[_0x0378('0x51')]['id']}})[_0x0378('0x1c')](handleEntityNotFound(_0x1d0302,null))[_0x0378('0x1c')](saveUpdates(_0x442c8d['body'],null))[_0x0378('0x1c')](respondWithResult(_0x1d0302,null))[_0x0378('0x25')](handleError(_0x1d0302,null));};var utilLicense=require('../../config/license/util');exports[_0x0378('0x56')]=function(_0x749063,_0x2dad7d,_0x25477d){var _0x17e913=_0x0378('0x57');var _0x1a3bae={'custom':![]};return utilLicense[_0x0378('0x58')]()[_0x0378('0x1c')](function(_0x436ce1){if(_0x436ce1){_0x1a3bae=_0x436ce1;}return db[_0x0378('0x34')][_0x0378('0x50')]({'where':{'id':_0x749063[_0x0378('0x51')]['id']},'attributes':[_0x0378('0x59'),'loginLogo',_0x0378('0x5a'),_0x0378('0x5b'),_0x0378('0x5c'),'defaultLoginLogo',_0x0378('0x5d'),'defaultFavicon'],'raw':!![]});})[_0x0378('0x1c')](handleEntityNotFound(_0x2dad7d,null))[_0x0378('0x1c')](function(_0x24b19a){if(_0x24b19a){var _0x4ec236=_0x24b19a['logo']&&fs[_0x0378('0x5e')](path[_0x0378('0x5f')](config[_0x0378('0x60')],_0x17e913,_[_0x0378('0x61')](_0x24b19a[_0x0378('0x59')])))?path[_0x0378('0x5f')](config[_0x0378('0x60')],_0x17e913,_[_0x0378('0x61')](_0x24b19a['logo'])):path[_0x0378('0x5f')](config[_0x0378('0x60')],_0x17e913,_[_0x0378('0x61')](_0x0378('0x62')));var _0x2d0a43='default'+_['upperFirst'](_0x0378('0x59'));if(_0x24b19a[_0x2d0a43]||!_0x1a3bae[_0x0378('0x63')]){_0x4ec236=path[_0x0378('0x5f')](config[_0x0378('0x60')],_0x17e913,_[_0x0378('0x61')](_0x0378('0x62')));}if(!fs['existsSync'](_0x4ec236)){throw new db['Sequelize'][(_0x0378('0x1a'))](_[_0x0378('0x64')]('logo')+_0x0378('0x65'));}return _0x2dad7d[_0x0378('0x66')](_0x4ec236);}})[_0x0378('0x25')](handleError(_0x2dad7d,null));};var utilLicense=require(_0x0378('0x67'));exports[_0x0378('0x68')]=function(_0x54671c,_0x590d9a,_0x87910b){var _0x5cdca3='server/files/images/logos';var _0x3fabbc={'custom':![]};return utilLicense[_0x0378('0x58')]()['then'](function(_0x11c2b6){if(_0x11c2b6){_0x3fabbc=_0x11c2b6;}return db['Setting'][_0x0378('0x50')]({'where':{'id':_0x54671c['params']['id']},'attributes':[_0x0378('0x59'),_0x0378('0x69'),'preferred',_0x0378('0x5b'),'defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x0378('0x1c')](handleEntityNotFound(_0x590d9a,null))[_0x0378('0x1c')](function(_0x2b69c7){if(_0x2b69c7){var _0x4105c0=_0x2b69c7[_0x0378('0x69')]&&fs[_0x0378('0x5e')](path['join'](config[_0x0378('0x60')],_0x5cdca3,_['toLower'](_0x2b69c7[_0x0378('0x69')])))?path[_0x0378('0x5f')](config[_0x0378('0x60')],_0x5cdca3,_['toLower'](_0x2b69c7['loginLogo'])):path[_0x0378('0x5f')](config[_0x0378('0x60')],_0x5cdca3,_[_0x0378('0x61')](_0x0378('0x6a')));var _0x35f596='default'+_[_0x0378('0x64')](_0x0378('0x69'));if(_0x2b69c7[_0x35f596]||!_0x3fabbc[_0x0378('0x63')]){_0x4105c0=path[_0x0378('0x5f')](config[_0x0378('0x60')],_0x5cdca3,_[_0x0378('0x61')](_0x0378('0x6a')));}if(!fs['existsSync'](_0x4105c0)){throw new db[(_0x0378('0x19'))][(_0x0378('0x1a'))](_[_0x0378('0x64')](_0x0378('0x69'))+_0x0378('0x65'));}return _0x590d9a['download'](_0x4105c0);}})[_0x0378('0x25')](handleError(_0x590d9a,null));};exports[_0x0378('0x6b')]=function(_0x4f29b4,_0x3357f8){return db[_0x0378('0x34')][_0x0378('0x50')]({'where':{'id':_0x4f29b4[_0x0378('0x51')]['id']},'attributes':[_0x0378('0x6c')]})['then'](respondWithResult(_0x3357f8,null))['catch'](handleError(_0x3357f8,null));};exports[_0x0378('0x6d')]=function(_0x4f8b69,_0x4a6f57,_0x3be499){if(_0x4f8b69[_0x0378('0x53')]&&_0x4f8b69[_0x0378('0x53')]['filename']){_0x4f8b69[_0x0378('0x4f')]['preferred']=_0x4f8b69['file'][_0x0378('0x54')];}return db[_0x0378('0x34')]['find']({'where':{'id':_0x4f8b69[_0x0378('0x51')]['id']}})[_0x0378('0x1c')](handleEntityNotFound(_0x4a6f57,null))[_0x0378('0x1c')](saveUpdates(_0x4f8b69[_0x0378('0x4f')],null))[_0x0378('0x1c')](respondWithResult(_0x4a6f57,null))[_0x0378('0x25')](handleError(_0x4a6f57,null));};var utilLicense=require(_0x0378('0x67'));exports['getPreferred']=function(_0x12223f,_0xb02239,_0x2d6fd){var _0x350020='server/files/images/logos';var _0x2b3142={'custom':![]};return utilLicense[_0x0378('0x58')]()[_0x0378('0x1c')](function(_0x46af82){if(_0x46af82){_0x2b3142=_0x46af82;}return db[_0x0378('0x34')][_0x0378('0x50')]({'where':{'id':_0x12223f['params']['id']},'attributes':[_0x0378('0x59'),_0x0378('0x69'),_0x0378('0x5a'),_0x0378('0x5b'),'defaultLogo',_0x0378('0x6e'),_0x0378('0x5d'),'defaultFavicon'],'raw':!![]});})[_0x0378('0x1c')](handleEntityNotFound(_0xb02239,null))[_0x0378('0x1c')](function(_0x4e398c){if(_0x4e398c){var _0x18e1d2=_0x4e398c[_0x0378('0x5a')]&&fs[_0x0378('0x5e')](path[_0x0378('0x5f')](config['root'],_0x350020,_[_0x0378('0x61')](_0x4e398c[_0x0378('0x5a')])))?path[_0x0378('0x5f')](config['root'],_0x350020,_[_0x0378('0x61')](_0x4e398c['preferred'])):path[_0x0378('0x5f')](config[_0x0378('0x60')],_0x350020,_[_0x0378('0x61')](_0x0378('0x6f')));var _0x1ea287=_0x0378('0x70')+_[_0x0378('0x64')](_0x0378('0x5a'));if(_0x4e398c[_0x1ea287]||!_0x2b3142[_0x0378('0x63')]||!_0x2b3142[_0x0378('0x5a')]){_0x18e1d2=path[_0x0378('0x5f')](config[_0x0378('0x60')],_0x350020,_['toLower'](_0x0378('0x6f')));}if(!fs[_0x0378('0x5e')](_0x18e1d2)){throw new db[(_0x0378('0x19'))][(_0x0378('0x1a'))](_[_0x0378('0x64')](_0x0378('0x5a'))+'\x20not\x20found');}return _0xb02239['download'](_0x18e1d2);}})[_0x0378('0x25')](handleError(_0xb02239,null));};exports[_0x0378('0x71')]=function(_0x59ec51,_0x46d905,_0xb53361){if(_0x59ec51[_0x0378('0x53')]&&_0x59ec51['file'][_0x0378('0x54')]){_0x59ec51[_0x0378('0x4f')]['favicon']=_0x59ec51['file'][_0x0378('0x54')];}return db[_0x0378('0x34')][_0x0378('0x50')]({'where':{'id':_0x59ec51['params']['id']}})['then'](handleEntityNotFound(_0x46d905,null))['then'](saveUpdates(_0x59ec51[_0x0378('0x4f')],null))[_0x0378('0x1c')](respondWithResult(_0x46d905,null))[_0x0378('0x25')](handleError(_0x46d905,null));};var utilLicense=require('../../config/license/util');exports[_0x0378('0x72')]=function(_0x3daad1,_0x7a63dc,_0x39484f){var _0x282f74=_0x0378('0x57');var _0x24b46a={'custom':![]};return utilLicense[_0x0378('0x58')]()['then'](function(_0x16bb3b){if(_0x16bb3b){_0x24b46a=_0x16bb3b;}return db[_0x0378('0x34')]['find']({'where':{'id':_0x3daad1['params']['id']},'attributes':['logo','loginLogo',_0x0378('0x5a'),_0x0378('0x5b'),'defaultLogo',_0x0378('0x6e'),_0x0378('0x5d'),_0x0378('0x73')],'raw':!![]});})[_0x0378('0x1c')](handleEntityNotFound(_0x7a63dc,null))['then'](function(_0x163412){if(_0x163412){var _0x4c9314=_0x163412['favicon']&&fs[_0x0378('0x5e')](path[_0x0378('0x5f')](config[_0x0378('0x60')],_0x282f74,_['toLower'](_0x163412['favicon'])))?path[_0x0378('0x5f')](config[_0x0378('0x60')],_0x282f74,_[_0x0378('0x61')](_0x163412['favicon'])):path['join'](config[_0x0378('0x60')],_0x282f74,_['toLower']('default_favicon.ico'));var _0x273213='default'+_[_0x0378('0x64')](_0x0378('0x5b'));if(_0x163412[_0x273213]||!_0x24b46a[_0x0378('0x63')]){_0x4c9314=path[_0x0378('0x5f')](config[_0x0378('0x60')],_0x282f74,_[_0x0378('0x61')](_0x0378('0x74')));}if(!fs['existsSync'](_0x4c9314)){throw new db[(_0x0378('0x19'))][(_0x0378('0x1a'))](_['upperFirst'](_0x0378('0x5b'))+_0x0378('0x65'));}return _0x7a63dc[_0x0378('0x66')](_0x4c9314);}})[_0x0378('0x25')](handleError(_0x7a63dc,null));}; \ No newline at end of file +var _0x2c13=['map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','include','show','includeAll','options','find','body','params','addLogo','file','filename','logo','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.png','upperFirst','custom','ValidationError','\x20not\x20found','download','getLicense','default_loginLogo.png','default','securePassword','addPreferred','preferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','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','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','Setting','rawAttributes','fieldName','type','key'];(function(_0x41b84a,_0x1de97e){var _0x2f2129=function(_0x47f3e5){while(--_0x47f3e5){_0x41b84a['push'](_0x41b84a['shift']());}};_0x2f2129(++_0x1de97e);}(_0x2c13,0xb4));var _0x32c1=function(_0x5dbc6d,_0x251c08){_0x5dbc6d=_0x5dbc6d-0x0;var _0x2618ab=_0x2c13[_0x5dbc6d];return _0x2618ab;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x32c1('0x0'));var rimraf=require(_0x32c1('0x1'));var zipdir=require(_0x32c1('0x2'));var jsonpatch=require(_0x32c1('0x3'));var rp=require(_0x32c1('0x4'));var moment=require(_0x32c1('0x5'));var BPromise=require(_0x32c1('0x6'));var Mustache=require(_0x32c1('0x7'));var util=require(_0x32c1('0x8'));var path=require(_0x32c1('0x9'));var sox=require(_0x32c1('0xa'));var csv=require(_0x32c1('0xb'));var ejs=require(_0x32c1('0xc'));var fs=require('fs');var _=require(_0x32c1('0xd'));var squel=require('squel');var crypto=require(_0x32c1('0xe'));var jsforce=require(_0x32c1('0xf'));var deskjs=require(_0x32c1('0x10'));var toCsv=require(_0x32c1('0xb'));var querystring=require(_0x32c1('0x11'));var Papa=require(_0x32c1('0x12'));var Redis=require(_0x32c1('0x13'));var authService=require(_0x32c1('0x14'));var qs=require(_0x32c1('0x15'));var as=require(_0x32c1('0x16'));var hardwareService=require(_0x32c1('0x17'));var logger=require(_0x32c1('0x18'))('api');var utils=require(_0x32c1('0x19'));var config=require(_0x32c1('0x1a'));var db=require(_0x32c1('0x1b'))['db'];var jayson=require(_0x32c1('0x1c'));var client=jayson[_0x32c1('0x1d')][_0x32c1('0x1e')]({'port':0x232a});function checkPasswordPattern(_0xb43ccf,_0x1c0c56,_0x3afb47){if(_0x3afb47){var _0x211900=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x211900['test'](_0x1c0c56)){return _0xb43ccf;}else{throw new db[(_0x32c1('0x1f'))]['ValidationError'](_0x32c1('0x20'));}}else{return _0xb43ccf;}}function respondWithRpcPromise(_0x575f7d,_0x3cc983,_0x75f1e,_0x1ddd58){return new BPromise(function(_0x13c1a8,_0x163bdc){var _0xeb2346=_0x1ddd58||client;return _0xeb2346[_0x32c1('0x21')](_0x575f7d,_0x75f1e)[_0x32c1('0x22')](function(_0x4b8fe2){logger[_0x32c1('0x23')](_0x32c1('0x24'),_0x3cc983,_0x32c1('0x25'));logger[_0x32c1('0x26')]('Setting,\x20%s,\x20%s,\x20%s',_0x3cc983,'request\x20sent',JSON[_0x32c1('0x27')](_0x4b8fe2));if(_0x4b8fe2[_0x32c1('0x28')]){if(_0x4b8fe2['error']['code']===0x1f4){logger[_0x32c1('0x28')](_0x32c1('0x24'),_0x3cc983,_0x4b8fe2['error']['message']);return _0x163bdc(_0x4b8fe2[_0x32c1('0x28')][_0x32c1('0x29')]);}logger[_0x32c1('0x28')]('Setting,\x20%s,\x20%s',_0x3cc983,_0x4b8fe2[_0x32c1('0x28')]['message']);return _0x13c1a8(_0x4b8fe2['error'][_0x32c1('0x29')]);}else{logger['info'](_0x32c1('0x24'),_0x3cc983,_0x32c1('0x25'));_0x13c1a8(_0x4b8fe2['result'][_0x32c1('0x29')]);}})[_0x32c1('0x2a')](function(_0x390a31){logger[_0x32c1('0x28')](_0x32c1('0x24'),_0x3cc983,_0x390a31);_0x163bdc(_0x390a31);});});}function respondWithStatusCode(_0x1407fa,_0x5967f4){_0x5967f4=_0x5967f4||0xcc;return function(_0x56632c){if(_0x56632c){return _0x1407fa['sendStatus'](_0x5967f4);}return _0x1407fa[_0x32c1('0x2b')](_0x5967f4)['end']();};}function respondWithResult(_0x50332f,_0x3e9780){_0x3e9780=_0x3e9780||0xc8;return function(_0xd7214c){if(_0xd7214c){return _0x50332f[_0x32c1('0x2b')](_0x3e9780)[_0x32c1('0x2c')](_0xd7214c);}};}function respondWithFilteredResult(_0x10b81b,_0x3ad56d){return function(_0xcb5c50){if(_0xcb5c50){var _0x554d67=_0xcb5c50[_0x32c1('0x2d')],_0x5f227a=_0x3ad56d['offset'],_0x21f81f=_0x3ad56d[_0x32c1('0x2e')]+_0x3ad56d[_0x32c1('0x2f')],_0x1dc0aa;if(_0x21f81f>=_0x554d67){_0x21f81f=_0x554d67;_0x1dc0aa=0xc8;}else{_0x1dc0aa=0xce;}_0x10b81b[_0x32c1('0x2b')](_0x1dc0aa);return _0x10b81b[_0x32c1('0x30')](_0x32c1('0x31'),_0x5f227a+'-'+_0x21f81f+'/'+_0x554d67)['json'](_0xcb5c50);}return null;};}function patchUpdates(_0x1ab640){return function(_0x99939a){try{jsonpatch[_0x32c1('0x32')](_0x99939a,_0x1ab640,!![]);}catch(_0x395295){return BPromise[_0x32c1('0x33')](_0x395295);}return _0x99939a[_0x32c1('0x34')]();};}function saveUpdates(_0x131247,_0x5d57de){return function(_0x2506a4){if(_0x2506a4){return _0x2506a4[_0x32c1('0x35')](_0x131247)[_0x32c1('0x22')](function(_0x35e708){return _0x35e708;});}return null;};}function removeEntity(_0x37a3fe,_0x5b23b4){return function(_0x49d820){if(_0x49d820){return _0x49d820[_0x32c1('0x36')]()['then'](function(){_0x37a3fe[_0x32c1('0x2b')](0xcc)[_0x32c1('0x37')]();});}};}function handleEntityNotFound(_0x2e859e,_0x339ab7){return function(_0xd44b71){if(!_0xd44b71){_0x2e859e['sendStatus'](0x194);}return _0xd44b71;};}function handleError(_0x5c7c40,_0x3886ae){_0x3886ae=_0x3886ae||0x1f4;return function(_0x2127d7){logger[_0x32c1('0x28')](_0x2127d7[_0x32c1('0x38')]);if(_0x2127d7['name']){delete _0x2127d7[_0x32c1('0x39')];}_0x5c7c40[_0x32c1('0x2b')](_0x3886ae)[_0x32c1('0x3a')](_0x2127d7);};}exports['index']=function(_0xf3e6b9,_0x4700b7){var _0x9f15f3={},_0x4e2dab={},_0x58dd1d={'count':0x0,'rows':[]};var _0x464c91=_['map'](db[_0x32c1('0x3b')][_0x32c1('0x3c')],function(_0x5b6bf7){return{'name':_0x5b6bf7[_0x32c1('0x3d')],'type':_0x5b6bf7[_0x32c1('0x3e')][_0x32c1('0x3f')]};});_0x4e2dab['model']=_[_0x32c1('0x40')](_0x464c91,_0x32c1('0x39'));_0x4e2dab[_0x32c1('0x41')]=_[_0x32c1('0x42')](_0xf3e6b9[_0x32c1('0x41')]);_0x4e2dab[_0x32c1('0x43')]=_[_0x32c1('0x44')](_0x4e2dab[_0x32c1('0x45')],_0x4e2dab[_0x32c1('0x41')]);_0x9f15f3[_0x32c1('0x46')]=_[_0x32c1('0x44')](_0x4e2dab[_0x32c1('0x45')],qs[_0x32c1('0x47')](_0xf3e6b9[_0x32c1('0x41')][_0x32c1('0x47')]));_0x9f15f3[_0x32c1('0x46')]=_0x9f15f3[_0x32c1('0x46')][_0x32c1('0x48')]?_0x9f15f3[_0x32c1('0x46')]:_0x4e2dab[_0x32c1('0x45')];if(!_0xf3e6b9[_0x32c1('0x41')][_0x32c1('0x49')]('nolimit')){_0x9f15f3[_0x32c1('0x2f')]=qs['limit'](_0xf3e6b9[_0x32c1('0x41')][_0x32c1('0x2f')]);_0x9f15f3[_0x32c1('0x2e')]=qs[_0x32c1('0x2e')](_0xf3e6b9[_0x32c1('0x41')][_0x32c1('0x2e')]);}_0x9f15f3[_0x32c1('0x4a')]=qs['sort'](_0xf3e6b9[_0x32c1('0x41')][_0x32c1('0x4b')]);_0x9f15f3[_0x32c1('0x4c')]=qs[_0x32c1('0x43')](_[_0x32c1('0x4d')](_0xf3e6b9['query'],_0x4e2dab[_0x32c1('0x43')]));if(_0xf3e6b9[_0x32c1('0x41')]['filter']){_0x9f15f3[_0x32c1('0x4c')]=_[_0x32c1('0x4e')](_0x9f15f3[_0x32c1('0x4c')],{'$or':_[_0x32c1('0x40')](_0x464c91,function(_0x33694b){if(_0x33694b[_0x32c1('0x3e')]!=='VIRTUAL'){var _0x46cd4a={};_0x46cd4a[_0x33694b[_0x32c1('0x39')]]={'$like':'%'+_0xf3e6b9[_0x32c1('0x41')][_0x32c1('0x4f')]+'%'};return _0x46cd4a;}})});}_0x9f15f3=_['merge']({},_0x9f15f3,_0xf3e6b9['options']);var _0x4d4be5={'where':_0x9f15f3[_0x32c1('0x4c')]};return db[_0x32c1('0x3b')][_0x32c1('0x2d')](_0x4d4be5)[_0x32c1('0x22')](function(_0x24df92){_0x58dd1d[_0x32c1('0x2d')]=_0x24df92;if(_0xf3e6b9['query']['includeAll']){_0x9f15f3[_0x32c1('0x50')]=[{'all':!![]}];}return db[_0x32c1('0x3b')]['findAll'](_0x9f15f3);})[_0x32c1('0x22')](function(_0x1fc4d5){_0x58dd1d['rows']=_0x1fc4d5;return _0x58dd1d;})[_0x32c1('0x22')](respondWithFilteredResult(_0x4700b7,_0x9f15f3))['catch'](handleError(_0x4700b7,null));};exports[_0x32c1('0x51')]=function(_0x322828,_0x1cb3e2){var _0x4c6712={'raw':![],'where':{'id':_0x322828['params']['id']}},_0x343fb7={};_0x343fb7[_0x32c1('0x45')]=_[_0x32c1('0x42')](db[_0x32c1('0x3b')]['rawAttributes']);_0x343fb7[_0x32c1('0x41')]=_[_0x32c1('0x42')](_0x322828[_0x32c1('0x41')]);_0x343fb7[_0x32c1('0x43')]=_[_0x32c1('0x44')](_0x343fb7['model'],_0x343fb7[_0x32c1('0x41')]);_0x4c6712['attributes']=_[_0x32c1('0x44')](_0x343fb7[_0x32c1('0x45')],qs[_0x32c1('0x47')](_0x322828[_0x32c1('0x41')][_0x32c1('0x47')]));_0x4c6712[_0x32c1('0x46')]=_0x4c6712[_0x32c1('0x46')][_0x32c1('0x48')]?_0x4c6712[_0x32c1('0x46')]:_0x343fb7[_0x32c1('0x45')];if(_0x322828[_0x32c1('0x41')][_0x32c1('0x52')]){_0x4c6712['include']=[{'all':!![]}];}_0x4c6712=_['merge']({},_0x4c6712,_0x322828[_0x32c1('0x53')]);return db[_0x32c1('0x3b')][_0x32c1('0x54')](_0x4c6712)[_0x32c1('0x22')](handleEntityNotFound(_0x1cb3e2,null))['then'](respondWithResult(_0x1cb3e2,null))[_0x32c1('0x2a')](handleError(_0x1cb3e2,null));};exports[_0x32c1('0x35')]=function(_0x41824d,_0x4065be){if(_0x41824d['body']['id']){delete _0x41824d[_0x32c1('0x55')]['id'];}return db[_0x32c1('0x3b')][_0x32c1('0x54')]({'where':{'id':_0x41824d[_0x32c1('0x56')]['id']}})[_0x32c1('0x22')](handleEntityNotFound(_0x4065be,null))[_0x32c1('0x22')](saveUpdates(_0x41824d[_0x32c1('0x55')],null))[_0x32c1('0x22')](respondWithResult(_0x4065be,null))[_0x32c1('0x2a')](handleError(_0x4065be,null));};exports[_0x32c1('0x57')]=function(_0x4c9714,_0xe8eac5,_0x48e013){if(_0x4c9714[_0x32c1('0x58')]&&_0x4c9714['file'][_0x32c1('0x59')]){_0x4c9714[_0x32c1('0x55')][_0x32c1('0x5a')]=_0x4c9714[_0x32c1('0x58')][_0x32c1('0x59')];}return db['Setting'][_0x32c1('0x54')]({'where':{'id':_0x4c9714['params']['id']}})[_0x32c1('0x22')](handleEntityNotFound(_0xe8eac5,null))[_0x32c1('0x22')](saveUpdates(_0x4c9714[_0x32c1('0x55')],null))[_0x32c1('0x22')](respondWithResult(_0xe8eac5,null))[_0x32c1('0x2a')](handleError(_0xe8eac5,null));};exports[_0x32c1('0x5b')]=function(_0x4ec0ec,_0x18f479,_0x3f7326){if(_0x4ec0ec[_0x32c1('0x58')]&&_0x4ec0ec[_0x32c1('0x58')]['filename']){_0x4ec0ec['body'][_0x32c1('0x5c')]=_0x4ec0ec['file'][_0x32c1('0x59')];}return db[_0x32c1('0x3b')][_0x32c1('0x54')]({'where':{'id':_0x4ec0ec[_0x32c1('0x56')]['id']}})[_0x32c1('0x22')](handleEntityNotFound(_0x18f479,null))[_0x32c1('0x22')](saveUpdates(_0x4ec0ec[_0x32c1('0x55')],null))[_0x32c1('0x22')](respondWithResult(_0x18f479,null))[_0x32c1('0x2a')](handleError(_0x18f479,null));};var utilLicense=require(_0x32c1('0x5d'));exports[_0x32c1('0x5e')]=function(_0xaf10ef,_0x4e3134,_0x218590){var _0x19fd8f=_0x32c1('0x5f');var _0x34b95e={'custom':![]};return utilLicense['getLicense']()[_0x32c1('0x22')](function(_0x12ecdd){if(_0x12ecdd){_0x34b95e=_0x12ecdd;}return db[_0x32c1('0x3b')]['find']({'where':{'id':_0xaf10ef[_0x32c1('0x56')]['id']},'attributes':['logo',_0x32c1('0x5c'),'preferred',_0x32c1('0x60'),_0x32c1('0x61'),_0x32c1('0x62'),_0x32c1('0x63'),_0x32c1('0x64')],'raw':!![]});})[_0x32c1('0x22')](handleEntityNotFound(_0x4e3134,null))[_0x32c1('0x22')](function(_0x3084a9){if(_0x3084a9){var _0x265a6d=_0x3084a9['logo']&&fs[_0x32c1('0x65')](path[_0x32c1('0x66')](config[_0x32c1('0x67')],_0x19fd8f,_[_0x32c1('0x68')](_0x3084a9[_0x32c1('0x5a')])))?path[_0x32c1('0x66')](config[_0x32c1('0x67')],_0x19fd8f,_[_0x32c1('0x68')](_0x3084a9[_0x32c1('0x5a')])):path[_0x32c1('0x66')](config[_0x32c1('0x67')],_0x19fd8f,_[_0x32c1('0x68')](_0x32c1('0x69')));var _0x59fce5='default'+_[_0x32c1('0x6a')](_0x32c1('0x5a'));if(_0x3084a9[_0x59fce5]||!_0x34b95e[_0x32c1('0x6b')]){_0x265a6d=path[_0x32c1('0x66')](config[_0x32c1('0x67')],_0x19fd8f,_['toLower'](_0x32c1('0x69')));}if(!fs[_0x32c1('0x65')](_0x265a6d)){throw new db[(_0x32c1('0x1f'))][(_0x32c1('0x6c'))](_[_0x32c1('0x6a')]('logo')+_0x32c1('0x6d'));}return _0x4e3134[_0x32c1('0x6e')](_0x265a6d);}})[_0x32c1('0x2a')](handleError(_0x4e3134,null));};var utilLicense=require('../../config/license/util');exports['getLogoLogin']=function(_0x3dce64,_0x317477,_0x243600){var _0x41b08b=_0x32c1('0x5f');var _0x40390c={'custom':![]};return utilLicense[_0x32c1('0x6f')]()['then'](function(_0xd836c1){if(_0xd836c1){_0x40390c=_0xd836c1;}return db[_0x32c1('0x3b')][_0x32c1('0x54')]({'where':{'id':_0x3dce64[_0x32c1('0x56')]['id']},'attributes':[_0x32c1('0x5a'),_0x32c1('0x5c'),'preferred',_0x32c1('0x60'),_0x32c1('0x61'),'defaultLoginLogo',_0x32c1('0x63'),_0x32c1('0x64')],'raw':!![]});})['then'](handleEntityNotFound(_0x317477,null))[_0x32c1('0x22')](function(_0x57cb97){if(_0x57cb97){var _0x3a4167=_0x57cb97['loginLogo']&&fs[_0x32c1('0x65')](path[_0x32c1('0x66')](config[_0x32c1('0x67')],_0x41b08b,_[_0x32c1('0x68')](_0x57cb97[_0x32c1('0x5c')])))?path[_0x32c1('0x66')](config[_0x32c1('0x67')],_0x41b08b,_[_0x32c1('0x68')](_0x57cb97[_0x32c1('0x5c')])):path[_0x32c1('0x66')](config[_0x32c1('0x67')],_0x41b08b,_[_0x32c1('0x68')](_0x32c1('0x70')));var _0xa7f41a=_0x32c1('0x71')+_[_0x32c1('0x6a')]('loginLogo');if(_0x57cb97[_0xa7f41a]||!_0x40390c[_0x32c1('0x6b')]){_0x3a4167=path[_0x32c1('0x66')](config[_0x32c1('0x67')],_0x41b08b,_[_0x32c1('0x68')](_0x32c1('0x70')));}if(!fs['existsSync'](_0x3a4167)){throw new db[(_0x32c1('0x1f'))]['ValidationError'](_[_0x32c1('0x6a')](_0x32c1('0x5c'))+_0x32c1('0x6d'));}return _0x317477[_0x32c1('0x6e')](_0x3a4167);}})[_0x32c1('0x2a')](handleError(_0x317477,null));};exports['gdpr']=function(_0x52a9c7,_0x5e09e7){return db['Setting'][_0x32c1('0x54')]({'where':{'id':_0x52a9c7[_0x32c1('0x56')]['id']},'attributes':[_0x32c1('0x72')]})[_0x32c1('0x22')](respondWithResult(_0x5e09e7,null))['catch'](handleError(_0x5e09e7,null));};exports[_0x32c1('0x73')]=function(_0x3ec79f,_0x131b16,_0xde5d37){if(_0x3ec79f['file']&&_0x3ec79f[_0x32c1('0x58')][_0x32c1('0x59')]){_0x3ec79f[_0x32c1('0x55')][_0x32c1('0x74')]=_0x3ec79f[_0x32c1('0x58')]['filename'];}return db[_0x32c1('0x3b')][_0x32c1('0x54')]({'where':{'id':_0x3ec79f[_0x32c1('0x56')]['id']}})[_0x32c1('0x22')](handleEntityNotFound(_0x131b16,null))['then'](saveUpdates(_0x3ec79f[_0x32c1('0x55')],null))[_0x32c1('0x22')](respondWithResult(_0x131b16,null))['catch'](handleError(_0x131b16,null));};var utilLicense=require(_0x32c1('0x5d'));exports[_0x32c1('0x75')]=function(_0x180f10,_0x192c5d,_0x429295){var _0x327e52='server/files/images/logos';var _0xefb7be={'custom':![]};return utilLicense[_0x32c1('0x6f')]()[_0x32c1('0x22')](function(_0x460a8a){if(_0x460a8a){_0xefb7be=_0x460a8a;}return db[_0x32c1('0x3b')][_0x32c1('0x54')]({'where':{'id':_0x180f10[_0x32c1('0x56')]['id']},'attributes':['logo',_0x32c1('0x5c'),_0x32c1('0x74'),'favicon',_0x32c1('0x61'),_0x32c1('0x62'),_0x32c1('0x63'),_0x32c1('0x64')],'raw':!![]});})[_0x32c1('0x22')](handleEntityNotFound(_0x192c5d,null))[_0x32c1('0x22')](function(_0x516ad7){if(_0x516ad7){var _0x44437e=_0x516ad7[_0x32c1('0x74')]&&fs[_0x32c1('0x65')](path[_0x32c1('0x66')](config[_0x32c1('0x67')],_0x327e52,_[_0x32c1('0x68')](_0x516ad7[_0x32c1('0x74')])))?path['join'](config[_0x32c1('0x67')],_0x327e52,_[_0x32c1('0x68')](_0x516ad7['preferred'])):path[_0x32c1('0x66')](config[_0x32c1('0x67')],_0x327e52,_[_0x32c1('0x68')](_0x32c1('0x76')));var _0x4bda7a=_0x32c1('0x71')+_[_0x32c1('0x6a')](_0x32c1('0x74'));if(_0x516ad7[_0x4bda7a]||!_0xefb7be['custom']||!_0xefb7be[_0x32c1('0x74')]){_0x44437e=path[_0x32c1('0x66')](config['root'],_0x327e52,_[_0x32c1('0x68')](_0x32c1('0x76')));}if(!fs[_0x32c1('0x65')](_0x44437e)){throw new db[(_0x32c1('0x1f'))][(_0x32c1('0x6c'))](_[_0x32c1('0x6a')](_0x32c1('0x74'))+_0x32c1('0x6d'));}return _0x192c5d[_0x32c1('0x6e')](_0x44437e);}})[_0x32c1('0x2a')](handleError(_0x192c5d,null));};exports[_0x32c1('0x77')]=function(_0x18adf0,_0x2e6593,_0x106330){if(_0x18adf0['file']&&_0x18adf0[_0x32c1('0x58')][_0x32c1('0x59')]){_0x18adf0[_0x32c1('0x55')]['favicon']=_0x18adf0[_0x32c1('0x58')][_0x32c1('0x59')];}return db[_0x32c1('0x3b')][_0x32c1('0x54')]({'where':{'id':_0x18adf0['params']['id']}})[_0x32c1('0x22')](handleEntityNotFound(_0x2e6593,null))[_0x32c1('0x22')](saveUpdates(_0x18adf0[_0x32c1('0x55')],null))[_0x32c1('0x22')](respondWithResult(_0x2e6593,null))['catch'](handleError(_0x2e6593,null));};var utilLicense=require(_0x32c1('0x5d'));exports[_0x32c1('0x78')]=function(_0x389e46,_0x1b89c6,_0x29b5c1){var _0x235ffa='server/files/images/logos';var _0x3cb508={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x1f3de6){if(_0x1f3de6){_0x3cb508=_0x1f3de6;}return db['Setting']['find']({'where':{'id':_0x389e46[_0x32c1('0x56')]['id']},'attributes':[_0x32c1('0x5a'),_0x32c1('0x5c'),_0x32c1('0x74'),'favicon',_0x32c1('0x61'),_0x32c1('0x62'),_0x32c1('0x63'),_0x32c1('0x64')],'raw':!![]});})[_0x32c1('0x22')](handleEntityNotFound(_0x1b89c6,null))[_0x32c1('0x22')](function(_0x5b5269){if(_0x5b5269){var _0x2ddd0a=_0x5b5269['favicon']&&fs['existsSync'](path[_0x32c1('0x66')](config[_0x32c1('0x67')],_0x235ffa,_[_0x32c1('0x68')](_0x5b5269[_0x32c1('0x60')])))?path[_0x32c1('0x66')](config[_0x32c1('0x67')],_0x235ffa,_['toLower'](_0x5b5269['favicon'])):path[_0x32c1('0x66')](config[_0x32c1('0x67')],_0x235ffa,_[_0x32c1('0x68')](_0x32c1('0x79')));var _0xea7a3d=_0x32c1('0x71')+_[_0x32c1('0x6a')]('favicon');if(_0x5b5269[_0xea7a3d]||!_0x3cb508[_0x32c1('0x6b')]){_0x2ddd0a=path[_0x32c1('0x66')](config[_0x32c1('0x67')],_0x235ffa,_[_0x32c1('0x68')](_0x32c1('0x79')));}if(!fs['existsSync'](_0x2ddd0a)){throw new db['Sequelize'][(_0x32c1('0x6c'))](_[_0x32c1('0x6a')](_0x32c1('0x60'))+_0x32c1('0x6d'));}return _0x1b89c6[_0x32c1('0x6e')](_0x2ddd0a);}})['catch'](handleError(_0x1b89c6,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index b3c3327..b4b411a 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 _0x102c=['./setting.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x537f13,_0x24ffe1){var _0x204d4a=function(_0x38293c){while(--_0x38293c){_0x537f13['push'](_0x537f13['shift']());}};_0x204d4a(++_0x24ffe1);}(_0x102c,0x16b));var _0xc102=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x102c[_0x5608a3];return _0x1ed50a;};'use strict';var _=require(_0xc102('0x0'));var util=require(_0xc102('0x1'));var logger=require(_0xc102('0x2'))(_0xc102('0x3'));var moment=require(_0xc102('0x4'));var BPromise=require(_0xc102('0x5'));var rp=require(_0xc102('0x6'));var fs=require('fs');var path=require(_0xc102('0x7'));var rimraf=require(_0xc102('0x8'));var config=require('../../config/environment');var attributes=require(_0xc102('0x9'));module[_0xc102('0xa')]=function(_0x463a6d,_0x37ca91){return _0x463a6d[_0xc102('0xb')]('Setting',attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc18=['moment','bluebird','request-promise','rimraf','../../config/environment','./setting.attributes','define','Setting','settings','util'];(function(_0x1d669e,_0x4921c9){var _0x1d1ec7=function(_0x332a50){while(--_0x332a50){_0x1d669e['push'](_0x1d669e['shift']());}};_0x1d1ec7(++_0x4921c9);}(_0xbc18,0x149));var _0x8bc1=function(_0x119e7a,_0x3949d3){_0x119e7a=_0x119e7a-0x0;var _0x1fb90a=_0xbc18[_0x119e7a];return _0x1fb90a;};'use strict';var _=require('lodash');var util=require(_0x8bc1('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x8bc1('0x1'));var BPromise=require(_0x8bc1('0x2'));var rp=require(_0x8bc1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8bc1('0x4'));var config=require(_0x8bc1('0x5'));var attributes=require(_0x8bc1('0x6'));module['exports']=function(_0x40c4e8,_0x322185){return _0x40c4e8[_0x8bc1('0x7')](_0x8bc1('0x8'),attributes,{'tableName':_0x8bc1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 11ba20c..4e3c9c9 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 _0x4083=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','info','result','util','moment'];(function(_0x2bdb53,_0x3f1b2b){var _0x3ee68d=function(_0x396950){while(--_0x396950){_0x2bdb53['push'](_0x2bdb53['shift']());}};_0x3ee68d(++_0x3f1b2b);}(_0x4083,0x8e));var _0x3408=function(_0x1a625d,_0x1b1b97){_0x1a625d=_0x1a625d-0x0;var _0x597a23=_0x4083[_0x1a625d];return _0x597a23;};'use strict';var _=require('lodash');var util=require(_0x3408('0x0'));var moment=require(_0x3408('0x1'));var BPromise=require(_0x3408('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3408('0x3'));var db=require(_0x3408('0x4'))['db'];var utils=require(_0x3408('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3408('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3408('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35e499,_0xba6841,_0x1c33e7){return new BPromise(function(_0x5d172d,_0x9de83f){return client[_0x3408('0x8')](_0x35e499,_0x1c33e7)['then'](function(_0x34c93d){logger['info'](_0x3408('0x9'),_0xba6841,_0x3408('0xa'));logger[_0x3408('0xb')](_0x3408('0xc'),_0xba6841,_0x3408('0xa'),JSON['stringify'](_0x34c93d));if(_0x34c93d[_0x3408('0xd')]){if(_0x34c93d[_0x3408('0xd')][_0x3408('0xe')]===0x1f4){logger[_0x3408('0xd')](_0x3408('0x9'),_0xba6841,_0x34c93d[_0x3408('0xd')][_0x3408('0xf')]);return _0x9de83f(_0x34c93d[_0x3408('0xd')][_0x3408('0xf')]);}logger[_0x3408('0xd')](_0x3408('0x9'),_0xba6841,_0x34c93d[_0x3408('0xd')][_0x3408('0xf')]);return _0x5d172d(_0x34c93d['error'][_0x3408('0xf')]);}else{logger[_0x3408('0x10')](_0x3408('0x9'),_0xba6841,_0x3408('0xa'));_0x5d172d(_0x34c93d[_0x3408('0x11')][_0x3408('0xf')]);}})['catch'](function(_0x3a9b1f){logger[_0x3408('0xd')](_0x3408('0x9'),_0xba6841,_0x3a9b1f);_0x9de83f(_0x3a9b1f);});});} \ No newline at end of file +var _0xb9e8=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x18c2ef,_0x40e4c6){var _0x1b6f9a=function(_0x5f254d){while(--_0x5f254d){_0x18c2ef['push'](_0x18c2ef['shift']());}};_0x1b6f9a(++_0x40e4c6);}(_0xb9e8,0x71));var _0x8b9e=function(_0x4eab61,_0x1a6e6d){_0x4eab61=_0x4eab61-0x0;var _0x342426=_0xb9e8[_0x4eab61];return _0x342426;};'use strict';var _=require(_0x8b9e('0x0'));var util=require(_0x8b9e('0x1'));var moment=require(_0x8b9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b9e('0x3'));var db=require(_0x8b9e('0x4'))['db'];var utils=require(_0x8b9e('0x5'));var logger=require(_0x8b9e('0x6'))(_0x8b9e('0x7'));var config=require(_0x8b9e('0x8'));var jayson=require(_0x8b9e('0x9'));var client=jayson['client'][_0x8b9e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x505c5f,_0x5e9eab,_0x16bce4){return new BPromise(function(_0x5b9fee,_0x4e699c){return client[_0x8b9e('0xb')](_0x505c5f,_0x16bce4)[_0x8b9e('0xc')](function(_0x34f38a){logger[_0x8b9e('0xd')](_0x8b9e('0xe'),_0x5e9eab,_0x8b9e('0xf'));logger[_0x8b9e('0x10')]('Setting,\x20%s,\x20%s,\x20%s',_0x5e9eab,_0x8b9e('0xf'),JSON[_0x8b9e('0x11')](_0x34f38a));if(_0x34f38a[_0x8b9e('0x12')]){if(_0x34f38a[_0x8b9e('0x12')][_0x8b9e('0x13')]===0x1f4){logger['error'](_0x8b9e('0xe'),_0x5e9eab,_0x34f38a[_0x8b9e('0x12')][_0x8b9e('0x14')]);return _0x4e699c(_0x34f38a[_0x8b9e('0x12')]['message']);}logger[_0x8b9e('0x12')](_0x8b9e('0xe'),_0x5e9eab,_0x34f38a[_0x8b9e('0x12')]['message']);return _0x5b9fee(_0x34f38a[_0x8b9e('0x12')][_0x8b9e('0x14')]);}else{logger[_0x8b9e('0xd')](_0x8b9e('0xe'),_0x5e9eab,_0x8b9e('0xf'));_0x5b9fee(_0x34f38a[_0x8b9e('0x15')][_0x8b9e('0x14')]);}})[_0x8b9e('0x16')](function(_0x57322a){logger['error'](_0x8b9e('0xe'),_0x5e9eab,_0x57322a);_0x4e699c(_0x57322a);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 60f3b88..3950136 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 _0x9b3b=['removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','statusGet','getAgents','post','create','/:id/dispositions','addAnswer','/:id/notify','notify','/:id/send','/:id/status','/:id/users','update','delete','destroy','/:id/canned_answers','removeAnswers'];(function(_0x4dd9dc,_0x38722f){var _0x9e067e=function(_0x50bf5b){while(--_0x50bf5b){_0x4dd9dc['push'](_0x4dd9dc['shift']());}};_0x9e067e(++_0x38722f);}(_0x9b3b,0x17e));var _0xb9b3=function(_0x46cb35,_0x2b92ab){_0x46cb35=_0x46cb35-0x0;var _0x847507=_0x9b3b[_0x46cb35];return _0x847507;};'use strict';var multer=require(_0xb9b3('0x0'));var util=require(_0xb9b3('0x1'));var path=require(_0xb9b3('0x2'));var timeout=require(_0xb9b3('0x3'));var express=require(_0xb9b3('0x4'));var router=express[_0xb9b3('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb9b3('0x6'));var config=require(_0xb9b3('0x7'));var controller=require('./smsAccount.controller');router[_0xb9b3('0x8')]('/',auth[_0xb9b3('0x9')](),controller[_0xb9b3('0xa')]);router['get'](_0xb9b3('0xb'),auth[_0xb9b3('0x9')](),controller[_0xb9b3('0xc')]);router[_0xb9b3('0x8')](_0xb9b3('0xd'),auth[_0xb9b3('0x9')](),controller['show']);router['get']('/:id/dispositions',auth[_0xb9b3('0x9')](),controller[_0xb9b3('0xe')]);router[_0xb9b3('0x8')]('/:id/canned_answers',auth[_0xb9b3('0x9')](),controller[_0xb9b3('0xf')]);router[_0xb9b3('0x8')](_0xb9b3('0x10'),auth[_0xb9b3('0x9')](),controller[_0xb9b3('0x11')]);router[_0xb9b3('0x8')](_0xb9b3('0x12'),auth[_0xb9b3('0x9')](),controller[_0xb9b3('0x13')]);router[_0xb9b3('0x8')]('/:id/status',controller[_0xb9b3('0x14')]);router[_0xb9b3('0x8')]('/:id/users',auth[_0xb9b3('0x9')](),controller[_0xb9b3('0x15')]);router[_0xb9b3('0x16')]('/',auth[_0xb9b3('0x9')](),controller[_0xb9b3('0x17')]);router[_0xb9b3('0x16')](_0xb9b3('0x18'),auth[_0xb9b3('0x9')](),controller['addDisposition']);router[_0xb9b3('0x16')]('/:id/canned_answers',auth[_0xb9b3('0x9')](),controller[_0xb9b3('0x19')]);router[_0xb9b3('0x16')](_0xb9b3('0x1a'),controller[_0xb9b3('0x1b')]);router[_0xb9b3('0x16')](_0xb9b3('0x10'),auth[_0xb9b3('0x9')](),controller['addApplications']);router[_0xb9b3('0x16')](_0xb9b3('0x1c'),auth[_0xb9b3('0x9')](),controller['send']);router['post'](_0xb9b3('0x1d'),controller['status']);router['post'](_0xb9b3('0x1e'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xb9b3('0xd'),auth[_0xb9b3('0x9')](),controller[_0xb9b3('0x1f')]);router[_0xb9b3('0x20')](_0xb9b3('0xd'),auth[_0xb9b3('0x9')](),controller[_0xb9b3('0x21')]);router['delete'](_0xb9b3('0x18'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xb9b3('0x20')](_0xb9b3('0x22'),auth[_0xb9b3('0x9')](),controller[_0xb9b3('0x23')]);router[_0xb9b3('0x20')]('/:id/users',auth['isAuthenticated'](),controller[_0xb9b3('0x24')]);module[_0xb9b3('0x25')]=router; \ No newline at end of file +var _0xd49a=['removeDispositions','removeAnswers','/:id/users','removeAgents','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','/describe','isAuthenticated','describe','/:id','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','post','create','addDisposition','/:id/canned_answers','/:id/notify','notify','/:id/send','send','status','addAgents','put','update','delete','destroy','/:id/dispositions'];(function(_0x540ab4,_0x1f2371){var _0x52dff1=function(_0x4c6e41){while(--_0x4c6e41){_0x540ab4['push'](_0x540ab4['shift']());}};_0x52dff1(++_0x1f2371);}(_0xd49a,0x181));var _0xad49=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd49a[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xad49('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xad49('0x1'));var router=express[_0xad49('0x2')]();var auth=require(_0xad49('0x3'));var interaction=require(_0xad49('0x4'));var config=require(_0xad49('0x5'));var controller=require(_0xad49('0x6'));router[_0xad49('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xad49('0x7')](_0xad49('0x8'),auth[_0xad49('0x9')](),controller[_0xad49('0xa')]);router[_0xad49('0x7')](_0xad49('0xb'),auth[_0xad49('0x9')](),controller['show']);router[_0xad49('0x7')]('/:id/dispositions',auth[_0xad49('0x9')](),controller['getDispositions']);router[_0xad49('0x7')]('/:id/canned_answers',auth[_0xad49('0x9')](),controller[_0xad49('0xc')]);router['get'](_0xad49('0xd'),auth['isAuthenticated'](),controller['getApplications']);router[_0xad49('0x7')](_0xad49('0xe'),auth[_0xad49('0x9')](),controller[_0xad49('0xf')]);router[_0xad49('0x7')](_0xad49('0x10'),controller[_0xad49('0x11')]);router['get']('/:id/users',auth[_0xad49('0x9')](),controller['getAgents']);router[_0xad49('0x12')]('/',auth['isAuthenticated'](),controller[_0xad49('0x13')]);router[_0xad49('0x12')]('/:id/dispositions',auth[_0xad49('0x9')](),controller[_0xad49('0x14')]);router['post'](_0xad49('0x15'),auth['isAuthenticated'](),controller['addAnswer']);router[_0xad49('0x12')](_0xad49('0x16'),controller[_0xad49('0x17')]);router[_0xad49('0x12')](_0xad49('0xd'),auth[_0xad49('0x9')](),controller['addApplications']);router[_0xad49('0x12')](_0xad49('0x18'),auth[_0xad49('0x9')](),controller[_0xad49('0x19')]);router['post'](_0xad49('0x10'),controller[_0xad49('0x1a')]);router[_0xad49('0x12')]('/:id/users',auth[_0xad49('0x9')](),controller[_0xad49('0x1b')]);router[_0xad49('0x1c')](_0xad49('0xb'),auth[_0xad49('0x9')](),controller[_0xad49('0x1d')]);router[_0xad49('0x1e')](_0xad49('0xb'),auth[_0xad49('0x9')](),controller[_0xad49('0x1f')]);router[_0xad49('0x1e')](_0xad49('0x20'),auth[_0xad49('0x9')](),controller[_0xad49('0x21')]);router['delete'](_0xad49('0x15'),auth['isAuthenticated'](),controller[_0xad49('0x22')]);router[_0xad49('0x1e')](_0xad49('0x23'),auth[_0xad49('0x9')](),controller[_0xad49('0x24')]);module[_0xad49('0x25')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 8f6d313..709090a 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 _0xec0c=['infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','csc'];(function(_0x3b3490,_0x28d020){var _0x48ec37=function(_0x247212){while(--_0x247212){_0x3b3490['push'](_0x3b3490['shift']());}};_0x48ec37(++_0x28d020);}(_0xec0c,0xc2));var _0xcec0=function(_0x3c3c9c,_0x2006e4){_0x3c3c9c=_0x3c3c9c-0x0;var _0x430ef5=_0xec0c[_0x3c3c9c];return _0x430ef5;};'use strict';var Sequelize=require(_0xcec0('0x0'));var rs=require(_0xcec0('0x1'));module[_0xcec0('0x2')]={'name':{'type':Sequelize[_0xcec0('0x3')],'unique':_0xcec0('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xcec0('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xcec0('0x5')]();}},'phone':{'type':Sequelize[_0xcec0('0x3')]},'type':{'type':Sequelize[_0xcec0('0x6')](_0xcec0('0x7'),_0xcec0('0x8'),_0xcec0('0x9'),_0xcec0('0xa'),_0xcec0('0xb'),'clickatell',_0xcec0('0xc'),_0xcec0('0xd'),_0xcec0('0xe'))},'accountSid':{'type':Sequelize[_0xcec0('0x3')]},'authId':{'type':Sequelize[_0xcec0('0x3')]},'authToken':{'type':Sequelize[_0xcec0('0x3')]},'smsMethod':{'type':Sequelize[_0xcec0('0x6')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xcec0('0x3')]},'apiKey':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xcec0('0x3')]},'deliveryReport':{'type':Sequelize[_0xcec0('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0xcec0('0x3')]},'notificationTemplate':{'type':Sequelize[_0xcec0('0x10')],'defaultValue':function(){return _0xcec0('0x11');}},'notificationSound':{'type':Sequelize[_0xcec0('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcec0('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcec0('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xcec0('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcec0('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcec0('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcec0('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xcec0('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xcec0('0xf')],'defaultValue':![],'comment':_0xcec0('0x13'),'set':function(_0xb84fef){if(!_0xb84fef)this[_0xcec0('0x14')](_0xcec0('0x15'),null);this[_0xcec0('0x14')](_0xcec0('0x16'),_0xb84fef);}}}; \ No newline at end of file +var _0x6a7e=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','randomstring','exports','name','STRING','generate','twilio','skebby','connectel','clicksend','clickatell','csc','infobip','ENUM','BOOLEAN','TEXT'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x6a7e,0xf4));var _0xe6a7=function(_0xc4d188,_0x2b2ec1){_0xc4d188=_0xc4d188-0x0;var _0x31ec0d=_0x6a7e[_0xc4d188];return _0x31ec0d;};'use strict';var Sequelize=require(_0xe6a7('0x0'));var rs=require(_0xe6a7('0x1'));module[_0xe6a7('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xe6a7('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xe6a7('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0xe6a7('0x4')],'defaultValue':function(){return rs[_0xe6a7('0x5')]();}},'phone':{'type':Sequelize[_0xe6a7('0x4')]},'type':{'type':Sequelize['ENUM'](_0xe6a7('0x6'),_0xe6a7('0x7'),_0xe6a7('0x8'),_0xe6a7('0x9'),'plivo',_0xe6a7('0xa'),_0xe6a7('0xb'),_0xe6a7('0xc'),'intelepeer')},'accountSid':{'type':Sequelize[_0xe6a7('0x4')]},'authId':{'type':Sequelize[_0xe6a7('0x4')]},'authToken':{'type':Sequelize[_0xe6a7('0x4')]},'smsMethod':{'type':Sequelize[_0xe6a7('0xd')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xe6a7('0x4')]},'apiKey':{'type':Sequelize[_0xe6a7('0x4')]},'senderString':{'type':Sequelize[_0xe6a7('0x4')]},'deliveryReport':{'type':Sequelize[_0xe6a7('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0xe6a7('0x4')]},'notificationTemplate':{'type':Sequelize[_0xe6a7('0xf')],'defaultValue':function(){return _0xe6a7('0x10');}},'notificationSound':{'type':Sequelize[_0xe6a7('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe6a7('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe6a7('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe6a7('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe6a7('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xe6a7('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe6a7('0x11')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xe6a7('0x12'),'set':function(_0x3fc93d){if(!_0x3fc93d)this[_0xe6a7('0x13')]('mandatoryDispositionPauseId',null);this[_0xe6a7('0x13')]('mandatoryDisposition',_0x3fc93d);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index ea0e6c9..35d4052 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 _0x9158=['rows','show','params','length','includeAll','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','describe','SmsAccountId','Disposition','getDispositions','findOne','nolimit','pick','removeDispositions','ids','addAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','updatedAt','difference','createdAt','CompanyId','mobile','From','Body','messageId','MessageSid','from','sender','text','connectel','clicksend','plivo','Text','MessageUUID','infobip','results','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','ListId','Contacts','DESC','omit','defaults','contact','SmsInteraction','spread','interaction','created','push','close','unmanaged','*,*,*,*','ContactId','UserId','User','waitForTheAssignedAgent','startRouting','Start','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','\x0a','sequelize','transaction','findAndCountAll','getApplications','getInteractions','CmContact','fullname','Tag','Tags','color','tag','to\x20is\x20mandatory','CmList','List','out','SmsMessage','Messages','dataValues','log','received\x20delivery\x20report\x20from','inspect','skebby','requestid','message_id','status_code','groupName','DELIVERED','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','csc','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','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','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit','apply','reject','save','update','destroy','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','rawAttributes','fieldName','type','map','keys','query','model','intersection','fields','attributes','hasOwnProperty','order','sort','filters','filter','where','merge','VIRTUAL','options','SmsAccount','include','findAll'];(function(_0x4f2473,_0x37e8b8){var _0x12d48c=function(_0x571ea1){while(--_0x571ea1){_0x4f2473['push'](_0x4f2473['shift']());}};_0x12d48c(++_0x37e8b8);}(_0x9158,0x16e));var _0x8915=function(_0x59cbb5,_0x456513){_0x59cbb5=_0x59cbb5-0x0;var _0x3a8975=_0x9158[_0x59cbb5];return _0x3a8975;};'use strict';var pdf=require(_0x8915('0x0'));var emlformat=require(_0x8915('0x1'));var rimraf=require(_0x8915('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8915('0x3'));var rp=require('request-promise');var moment=require(_0x8915('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8915('0x5'));var path=require(_0x8915('0x6'));var sox=require(_0x8915('0x7'));var csv=require(_0x8915('0x8'));var ejs=require(_0x8915('0x9'));var fs=require('fs');var _=require(_0x8915('0xa'));var squel=require(_0x8915('0xb'));var crypto=require(_0x8915('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8915('0xd'));var toCsv=require(_0x8915('0x8'));var querystring=require(_0x8915('0xe'));var Papa=require(_0x8915('0xf'));var Redis=require(_0x8915('0x10'));var authService=require(_0x8915('0x11'));var qs=require(_0x8915('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8915('0x13'))(_0x8915('0x14'));var utils=require(_0x8915('0x15'));var config=require(_0x8915('0x16'));var db=require(_0x8915('0x17'))['db'];config[_0x8915('0x18')]=_['defaults'](config[_0x8915('0x18')],{'host':_0x8915('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8915('0x18')]));require('./smsAccount.socket')[_0x8915('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8915('0x1b')][_0x8915('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x2bc051,_0x430741,_0x8dff4d){if(_0x8dff4d){var _0x57c012=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x57c012[_0x8915('0x1d')](_0x430741)){return _0x2bc051;}else{throw new db[(_0x8915('0x1e'))][(_0x8915('0x1f'))](_0x8915('0x20'));}}else{return _0x2bc051;}}function respondWithRpcPromise(_0x2a0514,_0x57e453,_0x1a0e04,_0x913dc){return new BPromise(function(_0x5ccd36,_0x5987d4){var _0x17bb6c=_0x913dc||client;return _0x17bb6c[_0x8915('0x21')](_0x2a0514,_0x1a0e04)[_0x8915('0x22')](function(_0x19d295){logger[_0x8915('0x23')](_0x8915('0x24'),_0x57e453,_0x8915('0x25'));logger[_0x8915('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x57e453,'request\x20sent',JSON[_0x8915('0x27')](_0x19d295));if(_0x19d295[_0x8915('0x28')]){if(_0x19d295[_0x8915('0x28')][_0x8915('0x29')]===0x1f4){logger['error'](_0x8915('0x24'),_0x57e453,_0x19d295[_0x8915('0x28')][_0x8915('0x2a')]);return _0x5987d4(_0x19d295[_0x8915('0x28')][_0x8915('0x2a')]);}logger[_0x8915('0x28')](_0x8915('0x24'),_0x57e453,_0x19d295[_0x8915('0x28')]['message']);return _0x5ccd36(_0x19d295[_0x8915('0x28')]['message']);}else{logger[_0x8915('0x23')](_0x8915('0x24'),_0x57e453,'request\x20sent');_0x5ccd36(_0x19d295[_0x8915('0x2b')][_0x8915('0x2a')]);}})[_0x8915('0x2c')](function(_0x404266){logger[_0x8915('0x28')](_0x8915('0x24'),_0x57e453,_0x404266);_0x5987d4(_0x404266);});});}function respondWithStatusCode(_0x49373f,_0x5ea00f){_0x5ea00f=_0x5ea00f||0xcc;return function(_0x12e91f){if(_0x12e91f){return _0x49373f[_0x8915('0x2d')](_0x5ea00f);}return _0x49373f['status'](_0x5ea00f)[_0x8915('0x2e')]();};}function respondWithResult(_0x54d3c7,_0x3b133c){_0x3b133c=_0x3b133c||0xc8;return function(_0x5d0447){if(_0x5d0447){return _0x54d3c7[_0x8915('0x2f')](_0x3b133c)[_0x8915('0x30')](_0x5d0447);}};}function respondWithFilteredResult(_0x4f50df,_0x33c87f){return function(_0x2ebc38){if(_0x2ebc38){var _0x18296c=_0x2ebc38[_0x8915('0x31')],_0xff80f5=_0x33c87f['offset'],_0xd3eccb=_0x33c87f[_0x8915('0x32')]+_0x33c87f[_0x8915('0x33')],_0x492fa7;if(_0xd3eccb>=_0x18296c){_0xd3eccb=_0x18296c;_0x492fa7=0xc8;}else{_0x492fa7=0xce;}_0x4f50df[_0x8915('0x2f')](_0x492fa7);return _0x4f50df['set']('Content-Range',_0xff80f5+'-'+_0xd3eccb+'/'+_0x18296c)[_0x8915('0x30')](_0x2ebc38);}return null;};}function patchUpdates(_0x42d20c){return function(_0x55775d){try{jsonpatch[_0x8915('0x34')](_0x55775d,_0x42d20c,!![]);}catch(_0x4e6868){return BPromise[_0x8915('0x35')](_0x4e6868);}return _0x55775d[_0x8915('0x36')]();};}function saveUpdates(_0x404c9c,_0xca39df){return function(_0x1b0025){if(_0x1b0025){return _0x1b0025[_0x8915('0x37')](_0x404c9c)[_0x8915('0x22')](function(_0x158151){return _0x158151;});}return null;};}function removeEntity(_0x28f0d0,_0x1bc7e7){return function(_0x4e8426){if(_0x4e8426){return _0x4e8426[_0x8915('0x38')]()[_0x8915('0x22')](function(){var _0x13c810=_0x4e8426['get']({'plain':!![]});var _0x58ecf4=_0x8915('0x39');return db[_0x8915('0x3a')][_0x8915('0x38')]({'where':{'type':_0x58ecf4,'resourceId':_0x13c810['id']}})[_0x8915('0x22')](function(){return _0x4e8426;});})[_0x8915('0x22')](function(){_0x28f0d0[_0x8915('0x2f')](0xcc)[_0x8915('0x2e')]();});}};}function handleEntityNotFound(_0x50d9c0,_0x388843){return function(_0x444c42){if(!_0x444c42){_0x50d9c0[_0x8915('0x2d')](0x194);}return _0x444c42;};}function handleError(_0x15f1d4,_0x2e55c0){_0x2e55c0=_0x2e55c0||0x1f4;return function(_0x1e8ccb){logger[_0x8915('0x28')](_0x1e8ccb[_0x8915('0x3b')]);if(_0x1e8ccb[_0x8915('0x3c')]){delete _0x1e8ccb[_0x8915('0x3c')];}_0x15f1d4[_0x8915('0x2f')](_0x2e55c0)[_0x8915('0x3d')](_0x1e8ccb);};}exports[_0x8915('0x3e')]=function(_0x5e7a61,_0x1cb7da){var _0x4caed3={'include':[{'model':db[_0x8915('0x3f')],'as':'mandatoryDispositionPause'}]},_0x764d8a={},_0x2e075e={'count':0x0,'rows':[]};var _0x245343=_['map'](db['SmsAccount'][_0x8915('0x40')],function(_0x1c7a10){return{'name':_0x1c7a10[_0x8915('0x41')],'type':_0x1c7a10[_0x8915('0x42')]['key']};});_0x764d8a['model']=_[_0x8915('0x43')](_0x245343,_0x8915('0x3c'));_0x764d8a['query']=_[_0x8915('0x44')](_0x5e7a61[_0x8915('0x45')]);_0x764d8a['filters']=_['intersection'](_0x764d8a[_0x8915('0x46')],_0x764d8a[_0x8915('0x45')]);_0x4caed3['attributes']=_[_0x8915('0x47')](_0x764d8a['model'],qs[_0x8915('0x48')](_0x5e7a61[_0x8915('0x45')][_0x8915('0x48')]));_0x4caed3[_0x8915('0x49')]=_0x4caed3[_0x8915('0x49')]['length']?_0x4caed3[_0x8915('0x49')]:_0x764d8a[_0x8915('0x46')];if(!_0x5e7a61[_0x8915('0x45')][_0x8915('0x4a')]('nolimit')){_0x4caed3[_0x8915('0x33')]=qs[_0x8915('0x33')](_0x5e7a61['query'][_0x8915('0x33')]);_0x4caed3[_0x8915('0x32')]=qs['offset'](_0x5e7a61['query'][_0x8915('0x32')]);}_0x4caed3[_0x8915('0x4b')]=qs[_0x8915('0x4c')](_0x5e7a61[_0x8915('0x45')][_0x8915('0x4c')]);_0x4caed3['where']=qs[_0x8915('0x4d')](_['pick'](_0x5e7a61[_0x8915('0x45')],_0x764d8a[_0x8915('0x4d')]));if(_0x5e7a61[_0x8915('0x45')][_0x8915('0x4e')]){_0x4caed3[_0x8915('0x4f')]=_[_0x8915('0x50')](_0x4caed3[_0x8915('0x4f')],{'$or':_['map'](_0x245343,function(_0xdb24e){if(_0xdb24e[_0x8915('0x42')]!==_0x8915('0x51')){var _0xed24a9={};_0xed24a9[_0xdb24e[_0x8915('0x3c')]]={'$like':'%'+_0x5e7a61[_0x8915('0x45')][_0x8915('0x4e')]+'%'};return _0xed24a9;}})});}_0x4caed3=_['merge']({},_0x4caed3,_0x5e7a61[_0x8915('0x52')]);var _0x2d2ea4={'where':_0x4caed3[_0x8915('0x4f')]};return db[_0x8915('0x53')][_0x8915('0x31')](_0x2d2ea4)['then'](function(_0x4ccb94){_0x2e075e[_0x8915('0x31')]=_0x4ccb94;if(_0x5e7a61[_0x8915('0x45')]['includeAll']){_0x4caed3[_0x8915('0x54')]=[{'all':!![]}];}return db[_0x8915('0x53')][_0x8915('0x55')](_0x4caed3);})['then'](function(_0x3763d6){_0x2e075e[_0x8915('0x56')]=_0x3763d6;return _0x2e075e;})['then'](respondWithFilteredResult(_0x1cb7da,_0x4caed3))[_0x8915('0x2c')](handleError(_0x1cb7da,null));};exports[_0x8915('0x57')]=function(_0x20c198,_0x33e91e){var _0x5a2822={'raw':![],'where':{'id':_0x20c198[_0x8915('0x58')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x47ce7c={};_0x47ce7c[_0x8915('0x46')]=_[_0x8915('0x44')](db[_0x8915('0x53')][_0x8915('0x40')]);_0x47ce7c[_0x8915('0x45')]=_[_0x8915('0x44')](_0x20c198[_0x8915('0x45')]);_0x47ce7c[_0x8915('0x4d')]=_['intersection'](_0x47ce7c[_0x8915('0x46')],_0x47ce7c[_0x8915('0x45')]);_0x5a2822[_0x8915('0x49')]=_[_0x8915('0x47')](_0x47ce7c[_0x8915('0x46')],qs[_0x8915('0x48')](_0x20c198[_0x8915('0x45')][_0x8915('0x48')]));_0x5a2822[_0x8915('0x49')]=_0x5a2822[_0x8915('0x49')][_0x8915('0x59')]?_0x5a2822['attributes']:_0x47ce7c['model'];if(_0x20c198[_0x8915('0x45')][_0x8915('0x5a')]){_0x5a2822[_0x8915('0x54')]=[{'all':!![]}];}_0x5a2822=_[_0x8915('0x50')]({},_0x5a2822,_0x20c198[_0x8915('0x52')]);return db[_0x8915('0x53')][_0x8915('0x5b')](_0x5a2822)[_0x8915('0x22')](handleEntityNotFound(_0x33e91e,null))[_0x8915('0x22')](respondWithResult(_0x33e91e,null))[_0x8915('0x2c')](handleError(_0x33e91e,null));};exports['create']=function(_0x26d035,_0x5f2df2){return db['SmsAccount']['create'](_0x26d035[_0x8915('0x5c')],{})[_0x8915('0x22')](function(_0x3b5ef6){var _0x4d4f85=_0x26d035[_0x8915('0x5d')]['get']({'plain':!![]});if(!_0x4d4f85)throw new Error(_0x8915('0x5e'));if(_0x4d4f85[_0x8915('0x5f')]==='user'){var _0x309faa=_0x3b5ef6[_0x8915('0x60')]({'plain':!![]});var _0x375c75=_0x8915('0x39');return db[_0x8915('0x61')]['find']({'where':{'name':_0x375c75,'userProfileId':_0x4d4f85[_0x8915('0x62')]},'raw':!![]})[_0x8915('0x22')](function(_0x38ad88){if(_0x38ad88&&_0x38ad88[_0x8915('0x63')]===0x0){return db[_0x8915('0x3a')][_0x8915('0x64')]({'name':_0x309faa[_0x8915('0x3c')],'resourceId':_0x309faa['id'],'type':_0x38ad88[_0x8915('0x3c')],'sectionId':_0x38ad88['id']},{})['then'](function(){return _0x3b5ef6;});}else{return _0x3b5ef6;}})[_0x8915('0x2c')](function(_0x5adb88){logger[_0x8915('0x28')](_0x8915('0x65'),_0x5adb88);throw _0x5adb88;});}return _0x3b5ef6;})['then'](respondWithResult(_0x5f2df2,0xc9))[_0x8915('0x2c')](handleError(_0x5f2df2,null));};exports[_0x8915('0x37')]=function(_0x2d1694,_0xb9a64d){if(_0x2d1694[_0x8915('0x5c')]['id']){delete _0x2d1694[_0x8915('0x5c')]['id'];}return db[_0x8915('0x53')][_0x8915('0x5b')]({'where':{'id':_0x2d1694[_0x8915('0x58')]['id']},'include':[{'model':db[_0x8915('0x3f')],'as':_0x8915('0x66')}]})['then'](handleEntityNotFound(_0xb9a64d,null))[_0x8915('0x22')](saveUpdates(_0x2d1694[_0x8915('0x5c')],null))[_0x8915('0x22')](respondWithResult(_0xb9a64d,null))['catch'](handleError(_0xb9a64d,null));};exports[_0x8915('0x38')]=function(_0x6c8883,_0x1b19fc){return db['SmsAccount'][_0x8915('0x5b')]({'where':{'id':_0x6c8883[_0x8915('0x58')]['id']}})[_0x8915('0x22')](handleEntityNotFound(_0x1b19fc,null))[_0x8915('0x22')](removeEntity(_0x1b19fc,null))[_0x8915('0x2c')](handleError(_0x1b19fc,null));};exports[_0x8915('0x67')]=function(_0x3bf252,_0x4a1611){return db[_0x8915('0x53')][_0x8915('0x67')]()[_0x8915('0x22')](respondWithResult(_0x4a1611,null))[_0x8915('0x2c')](handleError(_0x4a1611,null));};exports['addDisposition']=function(_0x4912c1,_0x6fdd9e,_0xdd709c){if(_0x4912c1['body']['id']){delete _0x4912c1[_0x8915('0x5c')]['id'];}return db[_0x8915('0x53')]['find']({'where':{'id':_0x4912c1[_0x8915('0x58')]['id']}})[_0x8915('0x22')](handleEntityNotFound(_0x6fdd9e,null))[_0x8915('0x22')](function(_0xd25c52){if(_0xd25c52){_0x4912c1[_0x8915('0x5c')][_0x8915('0x68')]=_0xd25c52['id'];return db[_0x8915('0x69')][_0x8915('0x64')](_0x4912c1[_0x8915('0x5c')]);}})[_0x8915('0x22')](respondWithResult(_0x6fdd9e,null))[_0x8915('0x2c')](handleError(_0x6fdd9e,null));};exports[_0x8915('0x6a')]=function(_0x305fdf,_0x1fd4cc,_0x2f1fc8){var _0x830289={'raw':![],'where':{}};var _0x73aec5={};var _0x556082={'count':0x0,'rows':[]};return db['SmsAccount'][_0x8915('0x6b')]({'where':{'id':_0x305fdf[_0x8915('0x58')]['id']}})['then'](handleEntityNotFound(_0x1fd4cc,null))[_0x8915('0x22')](function(_0x4b61a0){if(_0x4b61a0){_0x73aec5[_0x8915('0x46')]=_['keys'](db[_0x8915('0x69')][_0x8915('0x40')]);_0x73aec5[_0x8915('0x45')]=_[_0x8915('0x44')](_0x305fdf['query']);_0x73aec5['filters']=_[_0x8915('0x47')](_0x73aec5[_0x8915('0x46')],_0x73aec5[_0x8915('0x45')]);_0x830289['attributes']=_['intersection'](_0x73aec5[_0x8915('0x46')],qs['fields'](_0x305fdf[_0x8915('0x45')][_0x8915('0x48')]));_0x830289[_0x8915('0x49')]=_0x830289[_0x8915('0x49')][_0x8915('0x59')]?_0x830289[_0x8915('0x49')]:_0x73aec5['model'];if(!_0x305fdf['query'][_0x8915('0x4a')](_0x8915('0x6c'))){_0x830289[_0x8915('0x33')]=qs[_0x8915('0x33')](_0x305fdf[_0x8915('0x45')][_0x8915('0x33')]);_0x830289[_0x8915('0x32')]=qs['offset'](_0x305fdf[_0x8915('0x45')][_0x8915('0x32')]);}_0x830289[_0x8915('0x4b')]=qs[_0x8915('0x4c')](_0x305fdf[_0x8915('0x45')][_0x8915('0x4c')]);_0x830289[_0x8915('0x4f')]=qs[_0x8915('0x4d')](_[_0x8915('0x6d')](_0x305fdf[_0x8915('0x45')],_0x73aec5['filters']));_0x830289[_0x8915('0x4f')][_0x8915('0x68')]=_0x4b61a0['id'];if(_0x305fdf[_0x8915('0x45')][_0x8915('0x4e')]){_0x830289[_0x8915('0x4f')]=_[_0x8915('0x50')](_0x830289[_0x8915('0x4f')],{'$or':_[_0x8915('0x43')](_0x830289[_0x8915('0x49')],function(_0x2a6d83){var _0x455ad1={};_0x455ad1[_0x2a6d83]={'$like':'%'+_0x305fdf['query']['filter']+'%'};return _0x455ad1;})});}_0x830289=_['merge']({},_0x830289,_0x305fdf[_0x8915('0x52')]);return db[_0x8915('0x69')]['count']({'where':_0x830289['where']})[_0x8915('0x22')](function(_0x636cac){_0x556082[_0x8915('0x31')]=_0x636cac;if(_0x305fdf[_0x8915('0x45')][_0x8915('0x5a')]){_0x830289[_0x8915('0x54')]=[{'all':!![]}];}return db[_0x8915('0x69')]['findAll'](_0x830289);})[_0x8915('0x22')](function(_0x44d65f){_0x556082[_0x8915('0x56')]=_0x44d65f;return _0x556082;});}})[_0x8915('0x22')](respondWithFilteredResult(_0x1fd4cc,_0x830289))[_0x8915('0x2c')](handleError(_0x1fd4cc,null));};exports[_0x8915('0x6e')]=function(_0x2ea13e,_0x425ca6,_0x1795cb){return db['SmsAccount'][_0x8915('0x5b')]({'where':{'id':_0x2ea13e['params']['id']}})[_0x8915('0x22')](handleEntityNotFound(_0x425ca6,null))[_0x8915('0x22')](function(_0x2c8db8){if(_0x2c8db8){return _0x2c8db8[_0x8915('0x6e')](_0x2ea13e[_0x8915('0x45')][_0x8915('0x6f')]);}})[_0x8915('0x22')](respondWithStatusCode(_0x425ca6,null))[_0x8915('0x2c')](handleError(_0x425ca6,null));};exports[_0x8915('0x70')]=function(_0x3450dd,_0x9b7cfa,_0x1a51c0){if(_0x3450dd[_0x8915('0x5c')]['id']){delete _0x3450dd[_0x8915('0x5c')]['id'];}return db['SmsAccount'][_0x8915('0x5b')]({'where':{'id':_0x3450dd[_0x8915('0x58')]['id']}})[_0x8915('0x22')](handleEntityNotFound(_0x9b7cfa,null))[_0x8915('0x22')](function(_0x1c85d5){if(_0x1c85d5){_0x3450dd[_0x8915('0x5c')][_0x8915('0x68')]=_0x1c85d5['id'];return db['CannedAnswer'][_0x8915('0x64')](_0x3450dd[_0x8915('0x5c')]);}})[_0x8915('0x22')](respondWithResult(_0x9b7cfa,null))['catch'](handleError(_0x9b7cfa,null));};exports[_0x8915('0x71')]=function(_0x202075,_0x4cbd38,_0xdc805d){var _0x48a068={'raw':![],'where':{}};var _0x4f4f50={};var _0x5de639={'count':0x0,'rows':[]};return db[_0x8915('0x53')][_0x8915('0x6b')]({'where':{'id':_0x202075[_0x8915('0x58')]['id']}})['then'](handleEntityNotFound(_0x4cbd38,null))[_0x8915('0x22')](function(_0x345d17){if(_0x345d17){_0x4f4f50[_0x8915('0x46')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x4f4f50[_0x8915('0x45')]=_[_0x8915('0x44')](_0x202075[_0x8915('0x45')]);_0x4f4f50['filters']=_[_0x8915('0x47')](_0x4f4f50[_0x8915('0x46')],_0x4f4f50['query']);_0x48a068['attributes']=_[_0x8915('0x47')](_0x4f4f50[_0x8915('0x46')],qs[_0x8915('0x48')](_0x202075[_0x8915('0x45')][_0x8915('0x48')]));_0x48a068[_0x8915('0x49')]=_0x48a068[_0x8915('0x49')][_0x8915('0x59')]?_0x48a068[_0x8915('0x49')]:_0x4f4f50[_0x8915('0x46')];if(!_0x202075['query'][_0x8915('0x4a')](_0x8915('0x6c'))){_0x48a068[_0x8915('0x33')]=qs[_0x8915('0x33')](_0x202075[_0x8915('0x45')][_0x8915('0x33')]);_0x48a068[_0x8915('0x32')]=qs['offset'](_0x202075['query'][_0x8915('0x32')]);}_0x48a068[_0x8915('0x4b')]=qs['sort'](_0x202075[_0x8915('0x45')][_0x8915('0x4c')]);_0x48a068[_0x8915('0x4f')]=qs[_0x8915('0x4d')](_[_0x8915('0x6d')](_0x202075[_0x8915('0x45')],_0x4f4f50[_0x8915('0x4d')]));_0x48a068['where']['SmsAccountId']=_0x345d17['id'];if(_0x202075[_0x8915('0x45')][_0x8915('0x4e')]){_0x48a068[_0x8915('0x4f')]=_[_0x8915('0x50')](_0x48a068['where'],{'$or':_[_0x8915('0x43')](_0x48a068[_0x8915('0x49')],function(_0x38fa7f){var _0x209799={};_0x209799[_0x38fa7f]={'$like':'%'+_0x202075['query'][_0x8915('0x4e')]+'%'};return _0x209799;})});}_0x48a068=_[_0x8915('0x50')]({},_0x48a068,_0x202075[_0x8915('0x52')]);return db['CannedAnswer'][_0x8915('0x31')]({'where':_0x48a068[_0x8915('0x4f')]})[_0x8915('0x22')](function(_0xf8d778){_0x5de639[_0x8915('0x31')]=_0xf8d778;if(_0x202075[_0x8915('0x45')][_0x8915('0x5a')]){_0x48a068[_0x8915('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0x8915('0x55')](_0x48a068);})[_0x8915('0x22')](function(_0x30018c){_0x5de639['rows']=_0x30018c;return _0x5de639;});}})['then'](respondWithFilteredResult(_0x4cbd38,_0x48a068))['catch'](handleError(_0x4cbd38,null));};exports[_0x8915('0x72')]=function(_0x23dfad,_0x2a1828,_0x3573ed){return db[_0x8915('0x53')][_0x8915('0x5b')]({'where':{'id':_0x23dfad[_0x8915('0x58')]['id']}})['then'](handleEntityNotFound(_0x2a1828,null))[_0x8915('0x22')](function(_0x3d2d89){if(_0x3d2d89){return _0x3d2d89[_0x8915('0x72')](_0x23dfad[_0x8915('0x45')][_0x8915('0x6f')]);}})[_0x8915('0x22')](respondWithStatusCode(_0x2a1828,null))['catch'](handleError(_0x2a1828,null));};exports[_0x8915('0x73')]=function(_0x5194f2,_0x2d3e5e,_0x15d523){var _0xbcaeb9={'channel':_0x8915('0x74')};var _0x352c39=[];var _0x4520a5=[];var _0x25056f={};return db['SmsAccount'][_0x8915('0x5b')]({'where':{'id':_0x5194f2['params']['id']},'include':[{'model':db[_0x8915('0x75')],'as':_0x8915('0x76')}]})[_0x8915('0x22')](handleEntityNotFound(_0x2d3e5e,null))[_0x8915('0x22')](function(_0x3ba5e8){_0xbcaeb9[_0x8915('0x77')]=_0x3ba5e8;_0xbcaeb9[_0x8915('0x78')]=_[_0x8915('0x79')](_0x3ba5e8[_0x8915('0x76')],[_0x8915('0x7a')],[_0x8915('0x7b')]);if(_0xbcaeb9[_0x8915('0x77')][_0x8915('0x76')]){delete _0xbcaeb9[_0x8915('0x77')][_0x8915('0x76')];}return db['CmContact'][_0x8915('0x67')]();})['then'](function(_0x1fe13e){if(!_0x1fe13e){throw new db[(_0x8915('0x1e'))][(_0x8915('0x1f'))]('no\x20available\x20attributes');}_0x352c39=_['difference'](_[_0x8915('0x44')](_0x1fe13e),['createdAt',_0x8915('0x7c')]);_0x4520a5=_[_0x8915('0x7d')](_['keys'](_0x1fe13e),[_0x8915('0x7e'),_0x8915('0x7c'),_0x8915('0x7f'),'ListId']);_0xbcaeb9[_0x8915('0x5c')]={'mapKey':_0x8915('0x80')};if(_0xbcaeb9[_0x8915('0x77')][_0x8915('0x42')]){switch(_0xbcaeb9[_0x8915('0x77')]['type']){case'twilio':_0xbcaeb9['body']['from']=_0x5194f2[_0x8915('0x5c')][_0x8915('0x81')];_0xbcaeb9[_0x8915('0x5c')][_0x8915('0x5c')]=_0x5194f2[_0x8915('0x5c')][_0x8915('0x82')];_0xbcaeb9[_0x8915('0x5c')][_0x8915('0x83')]=_0x5194f2[_0x8915('0x5c')][_0x8915('0x84')];break;case'skebby':_0xbcaeb9['body'][_0x8915('0x85')]='+'+_0x5194f2[_0x8915('0x5c')][_0x8915('0x86')];_0xbcaeb9['body'][_0x8915('0x5c')]=_0x5194f2[_0x8915('0x5c')][_0x8915('0x87')];break;case _0x8915('0x88'):_0xbcaeb9[_0x8915('0x5c')][_0x8915('0x85')]=_0x5194f2[_0x8915('0x5c')]['from'];_0xbcaeb9[_0x8915('0x5c')][_0x8915('0x5c')]=_0x5194f2[_0x8915('0x5c')][_0x8915('0x2a')];break;case _0x8915('0x89'):_0xbcaeb9[_0x8915('0x5c')][_0x8915('0x85')]=_0x5194f2['body'][_0x8915('0x85')];_0xbcaeb9[_0x8915('0x5c')]['body']=_0x5194f2[_0x8915('0x5c')]['body'];_0xbcaeb9[_0x8915('0x5c')][_0x8915('0x83')]=_0x5194f2[_0x8915('0x5c')]['message_id'];break;case _0x8915('0x8a'):_0xbcaeb9[_0x8915('0x5c')]['from']=_0x5194f2[_0x8915('0x5c')][_0x8915('0x81')];_0xbcaeb9[_0x8915('0x5c')][_0x8915('0x5c')]=_0x5194f2[_0x8915('0x5c')][_0x8915('0x8b')];_0xbcaeb9[_0x8915('0x5c')][_0x8915('0x83')]=_0x5194f2['body'][_0x8915('0x8c')];break;case _0x8915('0x8d'):_0xbcaeb9[_0x8915('0x5c')][_0x8915('0x85')]='+'+_0x5194f2['body'][_0x8915('0x8e')][0x0][_0x8915('0x85')];_0xbcaeb9[_0x8915('0x5c')][_0x8915('0x5c')]=_0x5194f2[_0x8915('0x5c')][_0x8915('0x8e')][0x0]['text'];_0xbcaeb9['body'][_0x8915('0x83')]=_0x5194f2[_0x8915('0x5c')][_0x8915('0x8e')][0x0][_0x8915('0x83')];break;case'csc':_0xbcaeb9[_0x8915('0x5c')][_0x8915('0x85')]=_0x5194f2[_0x8915('0x5c')][_0x8915('0x8f')];_0xbcaeb9[_0x8915('0x5c')][_0x8915('0x5c')]=_0x5194f2[_0x8915('0x5c')][_0x8915('0x90')][_0x8915('0x2a')];break;case _0x8915('0x91'):_0xbcaeb9[_0x8915('0x5c')][_0x8915('0x85')]=_0x5194f2[_0x8915('0x5c')][_0x8915('0x92')];_0xbcaeb9[_0x8915('0x5c')][_0x8915('0x5c')]=_0x5194f2[_0x8915('0x5c')][_0x8915('0x87')];_0xbcaeb9['body'][_0x8915('0x83')]=_0x5194f2[_0x8915('0x5c')][_0x8915('0x93')];break;case _0x8915('0x94'):_0xbcaeb9[_0x8915('0x5c')]['from']=_0x5194f2[_0x8915('0x5c')][_0x8915('0x85')];_0xbcaeb9[_0x8915('0x5c')][_0x8915('0x5c')]=_0x5194f2[_0x8915('0x5c')][_0x8915('0x2a')];_0xbcaeb9[_0x8915('0x5c')][_0x8915('0x83')]=_0x5194f2[_0x8915('0x5c')][_0x8915('0x95')];break;}}if(_0xbcaeb9[_0x8915('0x5c')]['id']){delete _0xbcaeb9[_0x8915('0x5c')]['id'];}if(_[_0x8915('0x96')](_0xbcaeb9['body'][_0x8915('0x85')])){throw new db['Sequelize']['ValidationError'](_0x8915('0x97'));}if(_['isNil'](_0xbcaeb9[_0x8915('0x5c')]['body'])||_0xbcaeb9[_0x8915('0x5c')][_0x8915('0x5c')]===''){throw new db['Sequelize']['ValidationError'](_0x8915('0x98'));}if(_['isNil'](_0xbcaeb9['body'][_0x8915('0x99')])){throw new db['Sequelize'][(_0x8915('0x1f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4520a5);}if(!_[_0x8915('0x9a')](_0x4520a5,_0xbcaeb9[_0x8915('0x5c')][_0x8915('0x99')])){throw new db['Sequelize'][(_0x8915('0x1f'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4520a5);}_0x25056f[_0xbcaeb9[_0x8915('0x5c')][_0x8915('0x99')]]=_0xbcaeb9[_0x8915('0x5c')]['from'];return db['CmList'][_0x8915('0x5b')]({'where':{'id':_0xbcaeb9['account'][_0x8915('0x9b')]},'include':[{'model':db['CmContact'],'as':_0x8915('0x9c'),'where':_0x25056f,'limit':0x1,'order':[['updatedAt',_0x8915('0x9d')]]}]});})[_0x8915('0x22')](handleEntityNotFound(_0x2d3e5e,null))[_0x8915('0x22')](function(_0x4b4d76){if(_0x4b4d76){_0xbcaeb9['list']=_[_0x8915('0x9e')](_0x4b4d76,[_0x8915('0x9c')]);if(_0x4b4d76[_0x8915('0x9c')][_0x8915('0x59')]){return _0x4b4d76['Contacts'][0x0];}var _0x389f05=_[_0x8915('0x9f')](_0xbcaeb9[_0x8915('0x5c')],{'firstName':_0xbcaeb9[_0x8915('0x5c')][_0x8915('0x85')],'ListId':_0x4b4d76['id']});_0x389f05[_0xbcaeb9['body'][_0x8915('0x99')]]=_0xbcaeb9['body']['from'];return db['CmContact'][_0x8915('0x64')](_0x389f05,{'fields':_0x352c39,'raw':!![]});}})[_0x8915('0x22')](handleEntityNotFound(_0x2d3e5e,null))[_0x8915('0x22')](function(_0x324f1c){if(_0x324f1c){_0xbcaeb9[_0x8915('0xa0')]=_0x324f1c;var _0x333a4d={'ContactId':_0x324f1c['id'],'phone':_0xbcaeb9[_0x8915('0x5c')][_0x8915('0x85')],'SmsAccountId':_0x5194f2[_0x8915('0x58')]['id']};var _0x175268={'ContactId':_0x324f1c['id'],'SmsAccountId':_0x5194f2[_0x8915('0x58')]['id'],'closed':![]};return db[_0x8915('0xa1')][_0x8915('0x5b')]({'where':_0x175268})[_0x8915('0x22')](function(_0x5c8002){if(_0x5c8002){return[_0x5c8002,![]];}return db[_0x8915('0xa1')]['create'](_0x333a4d)[_0x8915('0x22')](function(_0x1a9d98){return[_0x1a9d98,!![]];});});}})[_0x8915('0xa2')](function(_0x7916c7,_0x4a7687){_0xbcaeb9[_0x8915('0xa3')]=_0x7916c7[_0x8915('0x60')]({'plain':!![]});_0xbcaeb9['interaction'][_0x8915('0xa4')]=![];if(_0x4a7687){if(_0xbcaeb9['account']['autoclose']){_0xbcaeb9[_0x8915('0x78')][_0x8915('0xa5')]({'id':0x0,'priority':_0xbcaeb9['applications'][_0x8915('0x59')]+0x1,'app':_0x8915('0xa6'),'appdata':_0x8915('0xa7'),'interval':_0x8915('0xa8')});}_0xbcaeb9[_0x8915('0xa3')]['created']=!![];}return db['SmsMessage'][_0x8915('0x64')]({'phone':_0xbcaeb9[_0x8915('0x5c')]['from'],'messageId':_0xbcaeb9['body'][_0x8915('0x83')],'body':_0xbcaeb9['body']['body'],'SmsAccountId':_0x5194f2[_0x8915('0x58')]['id'],'SmsInteractionId':_0x7916c7['id'],'direction':'in','ContactId':_0x7916c7[_0x8915('0xa9')],'AttachmentId':_0xbcaeb9[_0x8915('0x5c')]['AttachmentId']});})[_0x8915('0x22')](function(_0x212458){_0xbcaeb9[_0x8915('0x2a')]=_0x212458;if(_0xbcaeb9['interaction'][_0x8915('0xaa')]){return db[_0x8915('0xab')]['find']({'attributes':['id',_0x8915('0x3c')],'where':{'id':_0xbcaeb9[_0x8915('0xa3')][_0x8915('0xaa')]}})[_0x8915('0x22')](function(_0x23c9fb){if(_0x23c9fb){_0xbcaeb9[_0x8915('0x78')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x23c9fb[_0x8915('0x3c')]+','+(_0xbcaeb9[_0x8915('0x77')][_0x8915('0xac')]||0xa),'interval':_0x8915('0xa8')});}return respondWithRpcPromise('Start',_0x8915('0xad'),_0xbcaeb9);});}return respondWithRpcPromise(_0x8915('0xae'),_0x8915('0xad'),_0xbcaeb9);})[_0x8915('0x22')](function(_0xaadd4e){if(_0xaadd4e){var _0x6bac88=0xc8;var _0x6217c4=_0x8915('0xaf');logger[_0x8915('0x23')](_0x8915('0xb0'),_0x6217c4,_0x6bac88,_0x8915('0xb1'));logger['debug'](_0x8915('0xb2'),_0x6217c4,_0x6bac88,_0x8915('0xb1'),JSON[_0x8915('0x27')](_0xaadd4e));if(_0xbcaeb9['account']['type']==='twilio'){return _0x2d3e5e[_0x8915('0x2f')](_0x6bac88)[_0x8915('0xb3')](_0x8915('0xb4'),'text/xml')[_0x8915('0x3d')](_0x8915('0xb5'));}else{return _0x2d3e5e[_0x8915('0x2f')](_0x6bac88)[_0x8915('0x30')](_0xaadd4e);}}})[_0x8915('0x2c')](handleError(_0x2d3e5e,null));};exports['addApplications']=function(_0x1eec15,_0x53ca6f,_0x493627){return db[_0x8915('0x53')][_0x8915('0x6b')]({'where':{'id':_0x1eec15[_0x8915('0x58')]['id']}})[_0x8915('0x22')](handleEntityNotFound(_0x53ca6f,null))[_0x8915('0x22')](function(_0x5cafd5){if(_0x5cafd5){return db[_0x8915('0xb6')][_0x8915('0xb7')](function(_0x32f55d){return db[_0x8915('0x75')][_0x8915('0x38')]({'where':{'SmsAccountId':_0x1eec15['params']['id']},'transaction':_0x32f55d})['then'](function(_0x53c20c){var _0x2f58d8=_[_0x8915('0x43')](_0x1eec15[_0x8915('0x5c')],function(_0x32a63c){_0x32a63c['SmsAccountId']=_0x1eec15[_0x8915('0x58')]['id'];return _0x32a63c;});return db[_0x8915('0x75')]['bulkCreate'](_0x2f58d8,{'transaction':_0x32f55d});});})[_0x8915('0x22')](function(){return db[_0x8915('0x75')][_0x8915('0xb8')]({'where':{'SmsAccountId':_0x1eec15['params']['id']},'order':_0x8915('0x7a')});});}})['then'](respondWithResult(_0x53ca6f,null))[_0x8915('0x2c')](handleError(_0x53ca6f,null));};exports[_0x8915('0xb9')]=function(_0x5d9fee,_0x52a8b6,_0x1bbd82){var _0x32517f={};var _0x416328={};var _0x7c45fb;var _0x32d4c1;return db[_0x8915('0x53')]['findOne']({'where':{'id':_0x5d9fee[_0x8915('0x58')]['id']}})['then'](handleEntityNotFound(_0x52a8b6,null))[_0x8915('0x22')](function(_0x4e51a5){if(_0x4e51a5){_0x7c45fb=_0x4e51a5;_0x416328[_0x8915('0x46')]=_['keys'](db['SmsApplication'][_0x8915('0x40')]);_0x416328[_0x8915('0x45')]=_[_0x8915('0x44')](_0x5d9fee[_0x8915('0x45')]);_0x416328['filters']=_[_0x8915('0x47')](_0x416328[_0x8915('0x46')],_0x416328[_0x8915('0x45')]);_0x32517f[_0x8915('0x49')]=_['intersection'](_0x416328[_0x8915('0x46')],qs[_0x8915('0x48')](_0x5d9fee[_0x8915('0x45')][_0x8915('0x48')]));_0x32517f[_0x8915('0x49')]=_0x32517f[_0x8915('0x49')][_0x8915('0x59')]?_0x32517f[_0x8915('0x49')]:_0x416328[_0x8915('0x46')];_0x32517f[_0x8915('0x4b')]=qs['sort'](_0x5d9fee[_0x8915('0x45')][_0x8915('0x4c')]);_0x32517f[_0x8915('0x4f')]=qs[_0x8915('0x4d')](_[_0x8915('0x6d')](_0x5d9fee[_0x8915('0x45')],_0x416328[_0x8915('0x4d')]));if(_0x5d9fee[_0x8915('0x45')][_0x8915('0x4e')]){_0x32517f[_0x8915('0x4f')]=_['merge'](_0x32517f[_0x8915('0x4f')],{'$or':_[_0x8915('0x43')](_0x32517f[_0x8915('0x49')],function(_0x36423b){var _0x26ba09={};_0x26ba09[_0x36423b]={'$like':'%'+_0x5d9fee[_0x8915('0x45')][_0x8915('0x4e')]+'%'};return _0x26ba09;})});}_0x32517f=_['merge']({},_0x32517f,_0x5d9fee[_0x8915('0x52')]);return _0x7c45fb[_0x8915('0xb9')](_0x32517f);}})[_0x8915('0x22')](function(_0x2e27d1){if(_0x2e27d1){_0x32d4c1=_0x2e27d1[_0x8915('0x59')];if(!_0x5d9fee[_0x8915('0x45')][_0x8915('0x4a')](_0x8915('0x6c'))){_0x32517f[_0x8915('0x33')]=qs[_0x8915('0x33')](_0x5d9fee['query'][_0x8915('0x33')]);_0x32517f[_0x8915('0x32')]=qs['offset'](_0x5d9fee[_0x8915('0x45')][_0x8915('0x32')]);}return _0x7c45fb[_0x8915('0xb9')](_0x32517f);}})[_0x8915('0x22')](function(_0x4d56c9){if(_0x4d56c9){return _0x4d56c9?{'count':_0x32d4c1,'rows':_0x4d56c9}:null;}})[_0x8915('0x22')](respondWithResult(_0x52a8b6,null))[_0x8915('0x2c')](handleError(_0x52a8b6,null));};exports[_0x8915('0xba')]=function(_0x550462,_0x40c4ad,_0x2a6610){var _0x287dad={'raw':![],'where':{}};var _0x5c5786={};var _0x5b3204={'count':0x0,'rows':[]};return db[_0x8915('0x53')][_0x8915('0x6b')]({'where':{'id':_0x550462[_0x8915('0x58')]['id']}})['then'](handleEntityNotFound(_0x40c4ad,null))[_0x8915('0x22')](function(_0x4e3fe0){if(_0x4e3fe0){_0x5c5786[_0x8915('0x46')]=_[_0x8915('0x44')](db['SmsInteraction'][_0x8915('0x40')]);_0x5c5786['query']=_[_0x8915('0x44')](_0x550462[_0x8915('0x45')]);_0x5c5786[_0x8915('0x4d')]=_['intersection'](_0x5c5786[_0x8915('0x46')],_0x5c5786[_0x8915('0x45')]);_0x287dad[_0x8915('0x49')]=_[_0x8915('0x47')](_0x5c5786[_0x8915('0x46')],qs[_0x8915('0x48')](_0x550462[_0x8915('0x45')][_0x8915('0x48')]));_0x287dad[_0x8915('0x49')]=_0x287dad['attributes'][_0x8915('0x59')]?_0x287dad[_0x8915('0x49')]:_0x5c5786['model'];if(!_0x550462[_0x8915('0x45')][_0x8915('0x4a')](_0x8915('0x6c'))){_0x287dad['limit']=qs[_0x8915('0x33')](_0x550462[_0x8915('0x45')][_0x8915('0x33')]);_0x287dad['offset']=qs['offset'](_0x550462['query'][_0x8915('0x32')]);}_0x287dad[_0x8915('0x4b')]=qs['sort'](_0x550462[_0x8915('0x45')][_0x8915('0x4c')]);_0x287dad[_0x8915('0x4f')]=qs['filters'](_['pick'](_0x550462['query'],_0x5c5786[_0x8915('0x4d')]));_0x287dad[_0x8915('0x4f')][_0x8915('0x68')]=_0x4e3fe0['id'];if(_0x550462[_0x8915('0x45')][_0x8915('0x4e')]){_0x287dad[_0x8915('0x4f')]=_[_0x8915('0x50')](_0x287dad['where'],{'$or':_[_0x8915('0x43')](_0x287dad[_0x8915('0x49')],function(_0x172098){var _0x2bbb4b={};_0x2bbb4b[_0x172098]={'$like':'%'+_0x550462[_0x8915('0x45')][_0x8915('0x4e')]+'%'};return _0x2bbb4b;})});}_0x287dad=_[_0x8915('0x50')]({},_0x287dad,_0x550462[_0x8915('0x52')]);return db[_0x8915('0xa1')][_0x8915('0x31')]({'where':_0x287dad[_0x8915('0x4f')]})[_0x8915('0x22')](function(_0x2c2a80){_0x5b3204[_0x8915('0x31')]=_0x2c2a80;if(_0x550462[_0x8915('0x45')][_0x8915('0x5a')]){_0x287dad['include']=[{'model':db[_0x8915('0xbb')],'as':'Contact','required':![]},{'model':db[_0x8915('0xab')],'as':'Owner','attributes':[_0x8915('0x3c'),_0x8915('0xbc'),'internal'],'required':![]},{'model':db[_0x8915('0xbd')],'as':_0x8915('0xbe'),'attributes':['id','name',_0x8915('0xbf')],'where':_0x550462[_0x8915('0x45')][_0x8915('0xc0')]?{'id':_0x550462[_0x8915('0x45')]['tag']}:undefined,'required':_0x550462[_0x8915('0x45')][_0x8915('0xc0')]?!![]:![]}];}return db['SmsInteraction'][_0x8915('0x55')](_0x287dad);})['then'](function(_0x3fd707){_0x5b3204['rows']=_0x3fd707;return _0x5b3204;});}})[_0x8915('0x22')](respondWithFilteredResult(_0x40c4ad,_0x287dad))[_0x8915('0x2c')](handleError(_0x40c4ad,null));};exports['send']=function(_0x293233,_0x2ae593,_0x386810){var _0x14e88,_0x2320f6,_0x3dae87;if(_[_0x8915('0x96')](_0x293233[_0x8915('0x5c')][_0x8915('0x5c')])||_0x293233[_0x8915('0x5c')][_0x8915('0x5c')]===''){throw new db[(_0x8915('0x1e'))]['ValidationError'](_0x8915('0x98'));}if(_['isNil'](_0x293233[_0x8915('0x5c')]['to'])){throw new db[(_0x8915('0x1e'))]['ValidationError'](_0x8915('0xc1'));}_0x14e88=_0x293233['body']['to'];return db[_0x8915('0x53')][_0x8915('0x5b')]({'where':{'id':_0x293233[_0x8915('0x58')]['id']},'include':[{'model':db[_0x8915('0xc2')],'as':'List','include':[{'model':db['CmContact'],'as':_0x8915('0x9c'),'where':{'mobile':_0x14e88},'limit':0x1,'order':[[_0x8915('0x7c'),'DESC']]}]}]})[_0x8915('0x22')](handleEntityNotFound(_0x2ae593,null))[_0x8915('0x22')](function(_0x4cd6a9){if(_0x4cd6a9&&_0x4cd6a9[_0x8915('0xc3')]){_0x2320f6=_0x4cd6a9[_0x8915('0x60')]({'plain':!![]});if(_0x2320f6[_0x8915('0xc3')]&&_0x2320f6[_0x8915('0xc3')][_0x8915('0x9c')]['length']){return _0x2320f6[_0x8915('0xc3')][_0x8915('0x9c')][0x0];}return db['CmContact'][_0x8915('0x64')](_['defaults'](_0x293233[_0x8915('0x5c')],{'firstName':_0x14e88,'mobile':_0x14e88,'phone':_0x14e88,'ListId':_0x2320f6['ListId']}));}})[_0x8915('0x22')](handleEntityNotFound(_0x2ae593,null))[_0x8915('0x22')](function(_0x5edfab){if(_0x5edfab){_0x3dae87=_0x5edfab;return db[_0x8915('0xa1')]['find']({'where':{'ContactId':_0x3dae87['id'],'closed':![],'SmsAccountId':_0x2320f6['id']}})[_0x8915('0x22')](function(_0x4a5bcc){if(_0x4a5bcc){return[_0x4a5bcc,![]];}return db['SmsInteraction'][_0x8915('0x64')]({'UserId':_0x293233[_0x8915('0x5d')]['id'],'ContactId':_0x3dae87['id'],'SmsAccountId':_0x2320f6['id'],'phone':_0x14e88,'firstMsgDirection':_0x8915('0xc4'),'Messages':[_[_0x8915('0x50')](_0x293233['body'],{'read':![],'body':_0x293233[_0x8915('0x5c')][_0x8915('0x5c')],'phone':_0x14e88,'SmsAccountId':_0x2320f6['id'],'UserId':_0x293233[_0x8915('0x5d')]['id'],'ContactId':_0x3dae87['id']})]},{'include':[{'model':db[_0x8915('0xc5')],'as':_0x8915('0xc6')}]})[_0x8915('0x22')](function(_0xd53f1b){return[_0xd53f1b,!![]];});});}})[_0x8915('0xa2')](function(_0x714d7c,_0x22c80e){if(_0x22c80e){return _0x714d7c;}return db[_0x8915('0xc5')][_0x8915('0x64')](_[_0x8915('0x50')](_0x293233['body'],{'read':![],'body':_0x293233[_0x8915('0x5c')][_0x8915('0x5c')],'phone':_0x14e88,'SmsAccountId':_0x2320f6['id'],'SmsInteractionId':_0x714d7c['id'],'UserId':_0x293233[_0x8915('0x5d')]['id'],'ContactId':_0x3dae87['id']}))[_0x8915('0x22')](function(_0x5e8a84){_0x714d7c[_0x8915('0xc7')]['Messages']=[];_0x714d7c['dataValues'][_0x8915('0xc6')][_0x8915('0xa5')](_0x5e8a84[_0x8915('0xc7')]);return _0x714d7c;});})['then'](respondWithResult(_0x2ae593,null))[_0x8915('0x2c')](handleError(_0x2ae593,null));};exports['status']=function(_0x5cec46,_0x5eb4da,_0x117211){if(_0x5cec46[_0x8915('0x5c')]['id']){delete _0x5cec46[_0x8915('0x5c')]['id'];}console[_0x8915('0xc8')]('endpoint\x20/status\x20POST\x20/',_0x5cec46['body']);var _0x161632,_0x34cfea,_0x501671;return db[_0x8915('0x53')][_0x8915('0x5b')]({'where':{'id':_0x5cec46[_0x8915('0x58')]['id']}})[_0x8915('0x22')](handleEntityNotFound(_0x5eb4da,null))[_0x8915('0x22')](function(_0x3243be){if(_0x3243be){_0x501671=_0x3243be;logger['debug'](_0x8915('0xb0'),'status',_0x8915('0xc9'),_0x3243be[_0x8915('0x42')],util[_0x8915('0xca')](_0x5cec46[_0x8915('0x5c')],{'showHidden':![],'depth':null}));switch(_0x3243be[_0x8915('0x42')]){case _0x8915('0xcb'):if(_0x5cec46[_0x8915('0x5c')]['skebby_dispatch_id']&&_0x5cec46['body'][_0x8915('0x2f')]){_0x34cfea=_0x5cec46[_0x8915('0x5c')][_0x8915('0x2f')];return db[_0x8915('0xc5')]['find']({'where':{'messageId':_0x5cec46['body']['skebby_dispatch_id']}});}break;case _0x8915('0x88'):if(_0x5cec46[_0x8915('0x5c')][_0x8915('0xcc')]&&_0x5cec46[_0x8915('0x5c')]['statusInt']){_0x34cfea=_0x5cec46[_0x8915('0x5c')]['statusInt'];return db[_0x8915('0xc5')][_0x8915('0x5b')]({'where':{'messageId':_0x5cec46[_0x8915('0x5c')][_0x8915('0xcc')]}});}break;case _0x8915('0x89'):if(_0x5cec46['body'][_0x8915('0xcd')]&&_0x5cec46['body']['status_code']){_0x34cfea=_0x5cec46[_0x8915('0x5c')][_0x8915('0xce')];return db[_0x8915('0xc5')][_0x8915('0x5b')]({'where':{'messageId':_0x5cec46[_0x8915('0x5c')]['message_id']}});}break;case _0x8915('0x8d'):var _0x39061f=_0x5cec46[_0x8915('0x5c')]['results'][0x0];if(_0x39061f['messageId']&&_0x39061f[_0x8915('0x2f')][_0x8915('0xcf')]===_0x8915('0xd0')){_0x34cfea=_0x39061f[_0x8915('0x2f')][_0x8915('0xcf')];return db['SmsMessage'][_0x8915('0x5b')]({'where':{'messageId':_0x39061f[_0x8915('0x83')]}});}break;case _0x8915('0x91'):if(_0x5cec46[_0x8915('0x5c')][_0x8915('0x83')]&&_0x5cec46[_0x8915('0x5c')][_0x8915('0x2f')]){_0x34cfea=_0x5cec46[_0x8915('0x5c')][_0x8915('0x2f')];return db['SmsMessage']['find']({'where':{'messageId':_0x5cec46[_0x8915('0x5c')][_0x8915('0x83')]}});}break;case _0x8915('0x94'):if(_0x5cec46[_0x8915('0x5c')][_0x8915('0xd1')]&&_0x5cec46[_0x8915('0x5c')]['status']){_0x34cfea=_0x5cec46[_0x8915('0x5c')]['status'];return db[_0x8915('0xc5')]['find']({'where':{'messageId':_0x5cec46['body']['redif']}});}break;}}})[_0x8915('0x22')](handleEntityNotFound(_0x5eb4da,null))['then'](function(_0x477c69){if(_0x477c69){_0x161632=_0x477c69;switch(_0x501671[_0x8915('0x42')]){case _0x8915('0xcb'):if(_0x34cfea===_0x8915('0xd0')){return _0x161632[_0x8915('0x37')]({'read':!![]});}else{logger['error'](_0x8915('0xb0'),_0x8915('0x2f'),_0x8915('0xcb'),util[_0x8915('0xca')](_0x5cec46['body'],{'showHidden':![],'depth':null}));}break;case _0x8915('0x88'):if(_0x34cfea==='1'){return _0x161632[_0x8915('0x37')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8915('0x2f'),_0x8915('0xcb'),util[_0x8915('0xca')](_0x5cec46[_0x8915('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x8915('0x89'):if(!_0x5cec46[_0x8915('0x5c')][_0x8915('0xd2')]&&_0x34cfea>=0xc8&&_0x34cfea<=0xce){return _0x161632[_0x8915('0x37')]({'read':!![]});}else{logger[_0x8915('0x28')](_0x8915('0xb0'),_0x8915('0x2f'),_0x8915('0x89'),util[_0x8915('0xca')](_0x5cec46[_0x8915('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x8915('0x8d'):var _0x2af3c7=_0x5cec46['body'][_0x8915('0x8e')][0x0];if(_0x2af3c7[_0x8915('0x2f')][_0x8915('0xcf')]===_0x8915('0xd0')){return _0x161632[_0x8915('0x37')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8915('0x2f'),'infobip',util[_0x8915('0xca')](_0x5cec46[_0x8915('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x8915('0x91'):if(_0x34cfea==_0x8915('0xd3')||_0x34cfea==_0x8915('0xd4')){return _0x161632['update']({'read':!![]});}else{logger[_0x8915('0x28')](_0x8915('0xb0'),_0x8915('0x2f'),'clickatell',util['inspect'](_0x5cec46['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x34cfea===_0x8915('0xd5')||_0x34cfea===_0x8915('0xd6')){return _0x161632[_0x8915('0x37')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8915('0x2f'),_0x8915('0x94'),util[_0x8915('0xca')](_0x5cec46[_0x8915('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x161632;}})[_0x8915('0x22')](respondWithResult(_0x5eb4da,null))[_0x8915('0x2c')](handleError(_0x5eb4da,null));};exports[_0x8915('0xd7')]=function(_0x124838,_0x304262,_0x59a92b){var _0xe45af3,_0x1636f1,_0x31ea9f;return db[_0x8915('0x53')][_0x8915('0x5b')]({'where':{'id':_0x124838[_0x8915('0x58')]['id']}})[_0x8915('0x22')](handleEntityNotFound(_0x304262,null))[_0x8915('0x22')](function(_0x3da1da){if(_0x3da1da){_0x31ea9f=_0x3da1da;logger[_0x8915('0x26')](_0x8915('0xb0'),_0x8915('0x2f'),_0x8915('0xc9'),_0x3da1da[_0x8915('0x42')],util[_0x8915('0xca')](_0x124838[_0x8915('0x45')],{'showHidden':![],'depth':null}));switch(_0x3da1da['type']){case _0x8915('0xd8'):if(_0x124838[_0x8915('0x45')][_0x8915('0xd9')]&&_0x124838['query'][_0x8915('0xda')]){_0x1636f1=_0x124838['query'][_0x8915('0xda')];return db[_0x8915('0xc5')][_0x8915('0x5b')]({'where':{'messageId':_0x124838[_0x8915('0x45')][_0x8915('0xd9')]}});}break;}}})[_0x8915('0x22')](handleEntityNotFound(_0x304262,null))[_0x8915('0x22')](function(_0x2fb62a){if(_0x2fb62a){_0xe45af3=_0x2fb62a;switch(_0x31ea9f[_0x8915('0x42')]){case _0x8915('0xd8'):if(_0x1636f1==='2'||_0x1636f1==='6'){return _0xe45af3[_0x8915('0x37')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x8915('0xd8'),util['inspect'](_0x124838[_0x8915('0x45')],{'showHidden':![],'depth':null}));};break;}return _0xe45af3;}})['then'](respondWithResult(_0x304262,null))['catch'](handleError(_0x304262,null));};exports[_0x8915('0xdb')]=function(_0x31aa55,_0xb248bd,_0x139bcc){return db[_0x8915('0x53')][_0x8915('0x5b')]({'where':{'id':_0x31aa55['params']['id']}})[_0x8915('0x22')](handleEntityNotFound(_0xb248bd,null))['then'](function(_0x69b1c0){if(_0x69b1c0){return _0x69b1c0['addAgents'](_0x31aa55[_0x8915('0x5c')]['ids'],_[_0x8915('0x9e')](_0x31aa55[_0x8915('0x5c')],[_0x8915('0x6f'),'id'])||{})[_0x8915('0xa2')](function(_0x1fce0d){for(var _0x39a040=0x0;_0x39a040<_0x31aa55[_0x8915('0x5c')]['ids'][_0x8915('0x59')];_0x39a040+=0x1){socket[_0x8915('0xdc')](_0x8915('0xdd'),{'UserId':_0x31aa55[_0x8915('0x5c')][_0x8915('0x6f')][_0x39a040],'SmsAccountId':_0x31aa55[_0x8915('0x58')]['id']});}return _0x1fce0d;});}})[_0x8915('0x22')](respondWithResult(_0xb248bd,null))['catch'](handleError(_0xb248bd,null));};exports[_0x8915('0xde')]=function(_0x77de65,_0xf563ca,_0x175038){return db[_0x8915('0x53')][_0x8915('0x5b')]({'where':{'id':_0x77de65[_0x8915('0x58')]['id']}})[_0x8915('0x22')](handleEntityNotFound(_0xf563ca,null))[_0x8915('0x22')](function(_0x2224b7){if(_0x2224b7){return _0x2224b7[_0x8915('0xde')](_0x77de65[_0x8915('0x45')]['ids'])['then'](function(){if(_[_0x8915('0xdf')](_0x77de65[_0x8915('0x45')][_0x8915('0x6f')])){for(var _0x4fad11=0x0;_0x4fad11<_0x77de65[_0x8915('0x45')][_0x8915('0x6f')][_0x8915('0x59')];_0x4fad11+=0x1){socket[_0x8915('0xdc')](_0x8915('0xe0'),{'UserId':Number(_0x77de65[_0x8915('0x45')][_0x8915('0x6f')][_0x4fad11]),'SmsAccountId':Number(_0x77de65['params']['id'])});}}else{socket[_0x8915('0xdc')](_0x8915('0xe0'),{'UserId':Number(_0x77de65[_0x8915('0x45')]['ids']),'SmsAccountId':Number(_0x77de65[_0x8915('0x58')]['id'])});}});}})[_0x8915('0x22')](respondWithStatusCode(_0xf563ca,null))[_0x8915('0x2c')](handleError(_0xf563ca,null));};exports['getAgents']=function(_0x202b44,_0x788b51,_0x21d9ac){var _0x3715c8={};var _0x7bcf94={};var _0x13a8f2;var _0x1de7a1;return db[_0x8915('0x53')][_0x8915('0x6b')]({'where':{'id':_0x202b44['params']['id']}})['then'](handleEntityNotFound(_0x788b51,null))[_0x8915('0x22')](function(_0x154e18){if(_0x154e18){_0x13a8f2=_0x154e18;_0x7bcf94[_0x8915('0x46')]=_[_0x8915('0x44')](db[_0x8915('0xab')][_0x8915('0x40')]);_0x7bcf94[_0x8915('0x45')]=_[_0x8915('0x44')](_0x202b44[_0x8915('0x45')]);_0x7bcf94[_0x8915('0x4d')]=_['intersection'](_0x7bcf94[_0x8915('0x46')],_0x7bcf94['query']);_0x3715c8['attributes']=_['intersection'](_0x7bcf94[_0x8915('0x46')],qs[_0x8915('0x48')](_0x202b44[_0x8915('0x45')]['fields']));_0x3715c8['attributes']=_0x3715c8[_0x8915('0x49')]['length']?_0x3715c8[_0x8915('0x49')]:_0x7bcf94[_0x8915('0x46')];_0x3715c8[_0x8915('0x4b')]=qs[_0x8915('0x4c')](_0x202b44[_0x8915('0x45')][_0x8915('0x4c')]);_0x3715c8[_0x8915('0x4f')]=qs['filters'](_[_0x8915('0x6d')](_0x202b44[_0x8915('0x45')],_0x7bcf94[_0x8915('0x4d')]));if(_0x202b44[_0x8915('0x45')][_0x8915('0x4e')]){_0x3715c8['where']=_[_0x8915('0x50')](_0x3715c8[_0x8915('0x4f')],{'$or':_[_0x8915('0x43')](_0x3715c8['attributes'],function(_0x286c68){var _0x114d0d={};_0x114d0d[_0x286c68]={'$like':'%'+_0x202b44[_0x8915('0x45')][_0x8915('0x4e')]+'%'};return _0x114d0d;})});}_0x3715c8=_['merge']({},_0x3715c8,_0x202b44[_0x8915('0x52')]);return _0x13a8f2['getAgents'](_0x3715c8);}})['then'](function(_0x584856){if(_0x584856){_0x1de7a1=_0x584856[_0x8915('0x59')];if(!_0x202b44[_0x8915('0x45')][_0x8915('0x4a')](_0x8915('0x6c'))){_0x3715c8[_0x8915('0x33')]=qs[_0x8915('0x33')](_0x202b44['query'][_0x8915('0x33')]);_0x3715c8[_0x8915('0x32')]=qs[_0x8915('0x32')](_0x202b44[_0x8915('0x45')][_0x8915('0x32')]);}return _0x13a8f2[_0x8915('0xe1')](_0x3715c8);}})[_0x8915('0x22')](function(_0x1d3c4d){if(_0x1d3c4d){return _0x1d3c4d?{'count':_0x1de7a1,'rows':_0x1d3c4d}:null;}})[_0x8915('0x22')](respondWithResult(_0x788b51,null))[_0x8915('0x2c')](handleError(_0x788b51,null));}; \ No newline at end of file +var _0xe5af=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','show','params','intersection','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SmsAccounts','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','findAll','removeAnswers','notify','sms','SmsApplication','account','applications','Applications','priority','asc','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','Body','MessageSid','skebby','sender','text','connectel','from','clicksend','messageId','message_id','plivo','Text','MessageUUID','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','omit','SmsInteraction','interaction','created','autoclose','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','send','\x0a','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','Tag','Tags','tag','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','push','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','infobip','DELIVERED','groupName','intelepeer','redif','error_code','DELIVERED_TO_GATEWAY','DELIVRD','ACCEPTD','message-id','state','addAgents','ids','spread','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','User','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','get','UserProfileResource','destroy','end','stack','name','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','model','query','keys','filters','fields','attributes'];(function(_0x1a49d7,_0xedaa76){var _0x8ebcc8=function(_0xb5018){while(--_0xb5018){_0x1a49d7['push'](_0x1a49d7['shift']());}};_0x8ebcc8(++_0xedaa76);}(_0xe5af,0x9c));var _0xfe5a=function(_0x10c3bc,_0xe5e9c8){_0x10c3bc=_0x10c3bc-0x0;var _0x886f86=_0xe5af[_0x10c3bc];return _0x886f86;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfe5a('0x0'));var rimraf=require(_0xfe5a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe5a('0x2'));var rp=require(_0xfe5a('0x3'));var moment=require(_0xfe5a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfe5a('0x5'));var util=require('util');var path=require('path');var sox=require(_0xfe5a('0x6'));var csv=require(_0xfe5a('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xfe5a('0x8'));var crypto=require(_0xfe5a('0x9'));var jsforce=require(_0xfe5a('0xa'));var deskjs=require(_0xfe5a('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfe5a('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfe5a('0xd'));var qs=require(_0xfe5a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe5a('0xf'));var logger=require(_0xfe5a('0x10'))(_0xfe5a('0x11'));var utils=require(_0xfe5a('0x12'));var config=require(_0xfe5a('0x13'));var db=require('../../mysqldb')['db'];config[_0xfe5a('0x14')]=_[_0xfe5a('0x15')](config[_0xfe5a('0x14')],{'host':_0xfe5a('0x16'),'port':0x18eb});var socket=require(_0xfe5a('0x17'))(new Redis(config['redis']));require(_0xfe5a('0x18'))[_0xfe5a('0x19')](socket);var jayson=require(_0xfe5a('0x1a'));var client=jayson[_0xfe5a('0x1b')][_0xfe5a('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x217976,_0x375380,_0xeb454){if(_0xeb454){var _0x111d4d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x111d4d[_0xfe5a('0x1d')](_0x375380)){return _0x217976;}else{throw new db[(_0xfe5a('0x1e'))][(_0xfe5a('0x1f'))](_0xfe5a('0x20'));}}else{return _0x217976;}}function respondWithRpcPromise(_0x290600,_0x3edcab,_0x3ffbbb,_0x5bf597){return new BPromise(function(_0x20620b,_0x456707){var _0x54d5fb=_0x5bf597||client;return _0x54d5fb[_0xfe5a('0x21')](_0x290600,_0x3ffbbb)[_0xfe5a('0x22')](function(_0x39d905){logger['info']('SmsAccount,\x20%s,\x20%s',_0x3edcab,_0xfe5a('0x23'));logger[_0xfe5a('0x24')](_0xfe5a('0x25'),_0x3edcab,_0xfe5a('0x23'),JSON[_0xfe5a('0x26')](_0x39d905));if(_0x39d905[_0xfe5a('0x27')]){if(_0x39d905['error'][_0xfe5a('0x28')]===0x1f4){logger['error'](_0xfe5a('0x29'),_0x3edcab,_0x39d905[_0xfe5a('0x27')][_0xfe5a('0x2a')]);return _0x456707(_0x39d905['error']['message']);}logger[_0xfe5a('0x27')](_0xfe5a('0x29'),_0x3edcab,_0x39d905['error'][_0xfe5a('0x2a')]);return _0x20620b(_0x39d905[_0xfe5a('0x27')]['message']);}else{logger[_0xfe5a('0x2b')](_0xfe5a('0x29'),_0x3edcab,_0xfe5a('0x23'));_0x20620b(_0x39d905[_0xfe5a('0x2c')]['message']);}})[_0xfe5a('0x2d')](function(_0x2f5d04){logger[_0xfe5a('0x27')](_0xfe5a('0x29'),_0x3edcab,_0x2f5d04);_0x456707(_0x2f5d04);});});}function respondWithStatusCode(_0x36bf20,_0x222490){_0x222490=_0x222490||0xcc;return function(_0xdbf1e0){if(_0xdbf1e0){return _0x36bf20[_0xfe5a('0x2e')](_0x222490);}return _0x36bf20['status'](_0x222490)['end']();};}function respondWithResult(_0x712b44,_0x485f9d){_0x485f9d=_0x485f9d||0xc8;return function(_0xc53869){if(_0xc53869){return _0x712b44[_0xfe5a('0x2f')](_0x485f9d)[_0xfe5a('0x30')](_0xc53869);}};}function respondWithFilteredResult(_0x482a35,_0x48a061){return function(_0x50ee41){if(_0x50ee41){var _0x32d31e=_0x50ee41[_0xfe5a('0x31')],_0x582f2d=_0x48a061[_0xfe5a('0x32')],_0x51d1f4=_0x48a061[_0xfe5a('0x32')]+_0x48a061[_0xfe5a('0x33')],_0x498b64;if(_0x51d1f4>=_0x32d31e){_0x51d1f4=_0x32d31e;_0x498b64=0xc8;}else{_0x498b64=0xce;}_0x482a35[_0xfe5a('0x2f')](_0x498b64);return _0x482a35[_0xfe5a('0x34')](_0xfe5a('0x35'),_0x582f2d+'-'+_0x51d1f4+'/'+_0x32d31e)[_0xfe5a('0x30')](_0x50ee41);}return null;};}function patchUpdates(_0x414ab8){return function(_0x2ae57c){try{jsonpatch[_0xfe5a('0x36')](_0x2ae57c,_0x414ab8,!![]);}catch(_0x517969){return BPromise[_0xfe5a('0x37')](_0x517969);}return _0x2ae57c[_0xfe5a('0x38')]();};}function saveUpdates(_0x584de3,_0x354eb9){return function(_0x16ba7a){if(_0x16ba7a){return _0x16ba7a[_0xfe5a('0x39')](_0x584de3)[_0xfe5a('0x22')](function(_0xe5a992){return _0xe5a992;});}return null;};}function removeEntity(_0x5ed29a,_0x4fefad){return function(_0x30529d){if(_0x30529d){return _0x30529d['destroy']()[_0xfe5a('0x22')](function(){var _0xb31d0=_0x30529d[_0xfe5a('0x3a')]({'plain':!![]});var _0x42c29e='SmsAccounts';return db[_0xfe5a('0x3b')][_0xfe5a('0x3c')]({'where':{'type':_0x42c29e,'resourceId':_0xb31d0['id']}})[_0xfe5a('0x22')](function(){return _0x30529d;});})['then'](function(){_0x5ed29a[_0xfe5a('0x2f')](0xcc)[_0xfe5a('0x3d')]();});}};}function handleEntityNotFound(_0x4617f0,_0x2876db){return function(_0x498807){if(!_0x498807){_0x4617f0[_0xfe5a('0x2e')](0x194);}return _0x498807;};}function handleError(_0x48bd13,_0x302b5c){_0x302b5c=_0x302b5c||0x1f4;return function(_0x6145a6){logger['error'](_0x6145a6[_0xfe5a('0x3e')]);if(_0x6145a6[_0xfe5a('0x3f')]){delete _0x6145a6[_0xfe5a('0x3f')];}_0x48bd13[_0xfe5a('0x2f')](_0x302b5c)['send'](_0x6145a6);};}exports[_0xfe5a('0x40')]=function(_0xd6edc4,_0x188470){var _0x560088={'include':[{'model':db[_0xfe5a('0x41')],'as':_0xfe5a('0x42')}]},_0x1f97f8={},_0x2d0be6={'count':0x0,'rows':[]};var _0xec56ad=_[_0xfe5a('0x43')](db[_0xfe5a('0x44')][_0xfe5a('0x45')],function(_0x461703){return{'name':_0x461703[_0xfe5a('0x46')],'type':_0x461703[_0xfe5a('0x47')]['key']};});_0x1f97f8[_0xfe5a('0x48')]=_[_0xfe5a('0x43')](_0xec56ad,_0xfe5a('0x3f'));_0x1f97f8[_0xfe5a('0x49')]=_[_0xfe5a('0x4a')](_0xd6edc4[_0xfe5a('0x49')]);_0x1f97f8[_0xfe5a('0x4b')]=_['intersection'](_0x1f97f8[_0xfe5a('0x48')],_0x1f97f8[_0xfe5a('0x49')]);_0x560088['attributes']=_['intersection'](_0x1f97f8[_0xfe5a('0x48')],qs['fields'](_0xd6edc4['query'][_0xfe5a('0x4c')]));_0x560088[_0xfe5a('0x4d')]=_0x560088['attributes'][_0xfe5a('0x4e')]?_0x560088['attributes']:_0x1f97f8[_0xfe5a('0x48')];if(!_0xd6edc4[_0xfe5a('0x49')][_0xfe5a('0x4f')](_0xfe5a('0x50'))){_0x560088[_0xfe5a('0x33')]=qs[_0xfe5a('0x33')](_0xd6edc4['query'][_0xfe5a('0x33')]);_0x560088[_0xfe5a('0x32')]=qs[_0xfe5a('0x32')](_0xd6edc4[_0xfe5a('0x49')][_0xfe5a('0x32')]);}_0x560088[_0xfe5a('0x51')]=qs[_0xfe5a('0x52')](_0xd6edc4[_0xfe5a('0x49')][_0xfe5a('0x52')]);_0x560088[_0xfe5a('0x53')]=qs[_0xfe5a('0x4b')](_[_0xfe5a('0x54')](_0xd6edc4[_0xfe5a('0x49')],_0x1f97f8[_0xfe5a('0x4b')]));if(_0xd6edc4['query'][_0xfe5a('0x55')]){_0x560088[_0xfe5a('0x53')]=_['merge'](_0x560088['where'],{'$or':_[_0xfe5a('0x43')](_0xec56ad,function(_0x772137){if(_0x772137[_0xfe5a('0x47')]!==_0xfe5a('0x56')){var _0x3cf1b5={};_0x3cf1b5[_0x772137[_0xfe5a('0x3f')]]={'$like':'%'+_0xd6edc4[_0xfe5a('0x49')]['filter']+'%'};return _0x3cf1b5;}})});}_0x560088=_[_0xfe5a('0x57')]({},_0x560088,_0xd6edc4['options']);var _0x35e251={'where':_0x560088['where']};return db[_0xfe5a('0x44')][_0xfe5a('0x31')](_0x35e251)[_0xfe5a('0x22')](function(_0x133b3a){_0x2d0be6['count']=_0x133b3a;if(_0xd6edc4[_0xfe5a('0x49')][_0xfe5a('0x58')]){_0x560088['include']=[{'all':!![]}];}return db[_0xfe5a('0x44')]['findAll'](_0x560088);})['then'](function(_0x24ba13){_0x2d0be6['rows']=_0x24ba13;return _0x2d0be6;})[_0xfe5a('0x22')](respondWithFilteredResult(_0x188470,_0x560088))[_0xfe5a('0x2d')](handleError(_0x188470,null));};exports[_0xfe5a('0x59')]=function(_0x646b4d,_0x522e8b){var _0x1deb31={'raw':![],'where':{'id':_0x646b4d[_0xfe5a('0x5a')]['id']},'include':[{'model':db[_0xfe5a('0x41')],'as':_0xfe5a('0x42')}]},_0x4ce929={};_0x4ce929['model']=_[_0xfe5a('0x4a')](db[_0xfe5a('0x44')]['rawAttributes']);_0x4ce929[_0xfe5a('0x49')]=_[_0xfe5a('0x4a')](_0x646b4d[_0xfe5a('0x49')]);_0x4ce929['filters']=_[_0xfe5a('0x5b')](_0x4ce929[_0xfe5a('0x48')],_0x4ce929[_0xfe5a('0x49')]);_0x1deb31['attributes']=_[_0xfe5a('0x5b')](_0x4ce929[_0xfe5a('0x48')],qs['fields'](_0x646b4d[_0xfe5a('0x49')]['fields']));_0x1deb31[_0xfe5a('0x4d')]=_0x1deb31[_0xfe5a('0x4d')][_0xfe5a('0x4e')]?_0x1deb31[_0xfe5a('0x4d')]:_0x4ce929[_0xfe5a('0x48')];if(_0x646b4d[_0xfe5a('0x49')][_0xfe5a('0x58')]){_0x1deb31[_0xfe5a('0x5c')]=[{'all':!![]}];}_0x1deb31=_[_0xfe5a('0x57')]({},_0x1deb31,_0x646b4d[_0xfe5a('0x5d')]);return db[_0xfe5a('0x44')][_0xfe5a('0x5e')](_0x1deb31)[_0xfe5a('0x22')](handleEntityNotFound(_0x522e8b,null))[_0xfe5a('0x22')](respondWithResult(_0x522e8b,null))[_0xfe5a('0x2d')](handleError(_0x522e8b,null));};exports[_0xfe5a('0x5f')]=function(_0x590c04,_0x450390){return db[_0xfe5a('0x44')][_0xfe5a('0x5f')](_0x590c04[_0xfe5a('0x60')],{})[_0xfe5a('0x22')](function(_0x2e061e){var _0x1895fd=_0x590c04[_0xfe5a('0x61')][_0xfe5a('0x3a')]({'plain':!![]});if(!_0x1895fd)throw new Error(_0xfe5a('0x62'));if(_0x1895fd['role']===_0xfe5a('0x61')){var _0x1c459e=_0x2e061e[_0xfe5a('0x3a')]({'plain':!![]});var _0x5817ee=_0xfe5a('0x63');return db[_0xfe5a('0x64')]['find']({'where':{'name':_0x5817ee,'userProfileId':_0x1895fd[_0xfe5a('0x65')]},'raw':!![]})['then'](function(_0x445c17){if(_0x445c17&&_0x445c17['autoAssociation']===0x0){return db[_0xfe5a('0x3b')]['create']({'name':_0x1c459e['name'],'resourceId':_0x1c459e['id'],'type':_0x445c17['name'],'sectionId':_0x445c17['id']},{})[_0xfe5a('0x22')](function(){return _0x2e061e;});}else{return _0x2e061e;}})[_0xfe5a('0x2d')](function(_0x2f9c77){logger[_0xfe5a('0x27')](_0xfe5a('0x66'),_0x2f9c77);throw _0x2f9c77;});}return _0x2e061e;})['then'](respondWithResult(_0x450390,0xc9))['catch'](handleError(_0x450390,null));};exports[_0xfe5a('0x39')]=function(_0x52df22,_0xb7366a){if(_0x52df22[_0xfe5a('0x60')]['id']){delete _0x52df22['body']['id'];}return db[_0xfe5a('0x44')][_0xfe5a('0x5e')]({'where':{'id':_0x52df22[_0xfe5a('0x5a')]['id']},'include':[{'model':db[_0xfe5a('0x41')],'as':_0xfe5a('0x42')}]})[_0xfe5a('0x22')](handleEntityNotFound(_0xb7366a,null))['then'](saveUpdates(_0x52df22[_0xfe5a('0x60')],null))[_0xfe5a('0x22')](respondWithResult(_0xb7366a,null))[_0xfe5a('0x2d')](handleError(_0xb7366a,null));};exports[_0xfe5a('0x3c')]=function(_0x2afcbc,_0x1a9839){return db[_0xfe5a('0x44')]['find']({'where':{'id':_0x2afcbc['params']['id']}})['then'](handleEntityNotFound(_0x1a9839,null))[_0xfe5a('0x22')](removeEntity(_0x1a9839,null))['catch'](handleError(_0x1a9839,null));};exports[_0xfe5a('0x67')]=function(_0x1af84d,_0x5aea07){return db[_0xfe5a('0x44')][_0xfe5a('0x67')]()[_0xfe5a('0x22')](respondWithResult(_0x5aea07,null))[_0xfe5a('0x2d')](handleError(_0x5aea07,null));};exports[_0xfe5a('0x68')]=function(_0x5c140e,_0x29b905,_0x1cad8a){if(_0x5c140e['body']['id']){delete _0x5c140e['body']['id'];}return db[_0xfe5a('0x44')]['find']({'where':{'id':_0x5c140e[_0xfe5a('0x5a')]['id']}})[_0xfe5a('0x22')](handleEntityNotFound(_0x29b905,null))[_0xfe5a('0x22')](function(_0x41c342){if(_0x41c342){_0x5c140e[_0xfe5a('0x60')][_0xfe5a('0x69')]=_0x41c342['id'];return db[_0xfe5a('0x6a')]['create'](_0x5c140e[_0xfe5a('0x60')]);}})[_0xfe5a('0x22')](respondWithResult(_0x29b905,null))[_0xfe5a('0x2d')](handleError(_0x29b905,null));};exports[_0xfe5a('0x6b')]=function(_0x41b3cf,_0x5dcdca,_0x10a0bf){var _0x3ca5d7={'raw':![],'where':{}};var _0x4bce8c={};var _0x284929={'count':0x0,'rows':[]};return db[_0xfe5a('0x44')][_0xfe5a('0x6c')]({'where':{'id':_0x41b3cf['params']['id']}})[_0xfe5a('0x22')](handleEntityNotFound(_0x5dcdca,null))[_0xfe5a('0x22')](function(_0x543bbd){if(_0x543bbd){_0x4bce8c[_0xfe5a('0x48')]=_[_0xfe5a('0x4a')](db['Disposition'][_0xfe5a('0x45')]);_0x4bce8c['query']=_[_0xfe5a('0x4a')](_0x41b3cf[_0xfe5a('0x49')]);_0x4bce8c[_0xfe5a('0x4b')]=_[_0xfe5a('0x5b')](_0x4bce8c['model'],_0x4bce8c[_0xfe5a('0x49')]);_0x3ca5d7['attributes']=_['intersection'](_0x4bce8c[_0xfe5a('0x48')],qs[_0xfe5a('0x4c')](_0x41b3cf[_0xfe5a('0x49')]['fields']));_0x3ca5d7[_0xfe5a('0x4d')]=_0x3ca5d7['attributes'][_0xfe5a('0x4e')]?_0x3ca5d7[_0xfe5a('0x4d')]:_0x4bce8c[_0xfe5a('0x48')];if(!_0x41b3cf[_0xfe5a('0x49')]['hasOwnProperty'](_0xfe5a('0x50'))){_0x3ca5d7[_0xfe5a('0x33')]=qs['limit'](_0x41b3cf[_0xfe5a('0x49')]['limit']);_0x3ca5d7['offset']=qs[_0xfe5a('0x32')](_0x41b3cf['query'][_0xfe5a('0x32')]);}_0x3ca5d7['order']=qs[_0xfe5a('0x52')](_0x41b3cf[_0xfe5a('0x49')][_0xfe5a('0x52')]);_0x3ca5d7[_0xfe5a('0x53')]=qs[_0xfe5a('0x4b')](_[_0xfe5a('0x54')](_0x41b3cf[_0xfe5a('0x49')],_0x4bce8c[_0xfe5a('0x4b')]));_0x3ca5d7[_0xfe5a('0x53')][_0xfe5a('0x69')]=_0x543bbd['id'];if(_0x41b3cf[_0xfe5a('0x49')][_0xfe5a('0x55')]){_0x3ca5d7[_0xfe5a('0x53')]=_[_0xfe5a('0x57')](_0x3ca5d7['where'],{'$or':_[_0xfe5a('0x43')](_0x3ca5d7[_0xfe5a('0x4d')],function(_0x595c08){var _0x256e43={};_0x256e43[_0x595c08]={'$like':'%'+_0x41b3cf['query'][_0xfe5a('0x55')]+'%'};return _0x256e43;})});}_0x3ca5d7=_['merge']({},_0x3ca5d7,_0x41b3cf[_0xfe5a('0x5d')]);return db['Disposition'][_0xfe5a('0x31')]({'where':_0x3ca5d7[_0xfe5a('0x53')]})[_0xfe5a('0x22')](function(_0x2e75b7){_0x284929[_0xfe5a('0x31')]=_0x2e75b7;if(_0x41b3cf[_0xfe5a('0x49')][_0xfe5a('0x58')]){_0x3ca5d7[_0xfe5a('0x5c')]=[{'all':!![]}];}return db[_0xfe5a('0x6a')]['findAll'](_0x3ca5d7);})['then'](function(_0xf4368f){_0x284929[_0xfe5a('0x6d')]=_0xf4368f;return _0x284929;});}})[_0xfe5a('0x22')](respondWithFilteredResult(_0x5dcdca,_0x3ca5d7))[_0xfe5a('0x2d')](handleError(_0x5dcdca,null));};exports[_0xfe5a('0x6e')]=function(_0xbbdd44,_0x1c96c8,_0x57fd97){return db[_0xfe5a('0x44')][_0xfe5a('0x5e')]({'where':{'id':_0xbbdd44[_0xfe5a('0x5a')]['id']}})[_0xfe5a('0x22')](handleEntityNotFound(_0x1c96c8,null))[_0xfe5a('0x22')](function(_0x50d891){if(_0x50d891){return _0x50d891[_0xfe5a('0x6e')](_0xbbdd44[_0xfe5a('0x49')]['ids']);}})[_0xfe5a('0x22')](respondWithStatusCode(_0x1c96c8,null))[_0xfe5a('0x2d')](handleError(_0x1c96c8,null));};exports[_0xfe5a('0x6f')]=function(_0x9b0a26,_0xa9cdf9,_0x59834f){if(_0x9b0a26[_0xfe5a('0x60')]['id']){delete _0x9b0a26[_0xfe5a('0x60')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x9b0a26['params']['id']}})['then'](handleEntityNotFound(_0xa9cdf9,null))[_0xfe5a('0x22')](function(_0x94b24){if(_0x94b24){_0x9b0a26['body']['SmsAccountId']=_0x94b24['id'];return db[_0xfe5a('0x70')][_0xfe5a('0x5f')](_0x9b0a26[_0xfe5a('0x60')]);}})[_0xfe5a('0x22')](respondWithResult(_0xa9cdf9,null))[_0xfe5a('0x2d')](handleError(_0xa9cdf9,null));};exports[_0xfe5a('0x71')]=function(_0x510fe1,_0x1c1d81,_0x5c8f28){var _0x506157={'raw':![],'where':{}};var _0x1b23a4={};var _0x36de1e={'count':0x0,'rows':[]};return db['SmsAccount'][_0xfe5a('0x6c')]({'where':{'id':_0x510fe1[_0xfe5a('0x5a')]['id']}})[_0xfe5a('0x22')](handleEntityNotFound(_0x1c1d81,null))[_0xfe5a('0x22')](function(_0x23d51b){if(_0x23d51b){_0x1b23a4[_0xfe5a('0x48')]=_['keys'](db[_0xfe5a('0x70')][_0xfe5a('0x45')]);_0x1b23a4[_0xfe5a('0x49')]=_['keys'](_0x510fe1[_0xfe5a('0x49')]);_0x1b23a4[_0xfe5a('0x4b')]=_[_0xfe5a('0x5b')](_0x1b23a4[_0xfe5a('0x48')],_0x1b23a4['query']);_0x506157[_0xfe5a('0x4d')]=_['intersection'](_0x1b23a4[_0xfe5a('0x48')],qs[_0xfe5a('0x4c')](_0x510fe1[_0xfe5a('0x49')][_0xfe5a('0x4c')]));_0x506157[_0xfe5a('0x4d')]=_0x506157['attributes'][_0xfe5a('0x4e')]?_0x506157[_0xfe5a('0x4d')]:_0x1b23a4[_0xfe5a('0x48')];if(!_0x510fe1[_0xfe5a('0x49')][_0xfe5a('0x4f')](_0xfe5a('0x50'))){_0x506157[_0xfe5a('0x33')]=qs['limit'](_0x510fe1[_0xfe5a('0x49')][_0xfe5a('0x33')]);_0x506157[_0xfe5a('0x32')]=qs[_0xfe5a('0x32')](_0x510fe1[_0xfe5a('0x49')][_0xfe5a('0x32')]);}_0x506157[_0xfe5a('0x51')]=qs[_0xfe5a('0x52')](_0x510fe1[_0xfe5a('0x49')][_0xfe5a('0x52')]);_0x506157[_0xfe5a('0x53')]=qs[_0xfe5a('0x4b')](_[_0xfe5a('0x54')](_0x510fe1[_0xfe5a('0x49')],_0x1b23a4[_0xfe5a('0x4b')]));_0x506157[_0xfe5a('0x53')][_0xfe5a('0x69')]=_0x23d51b['id'];if(_0x510fe1['query']['filter']){_0x506157[_0xfe5a('0x53')]=_[_0xfe5a('0x57')](_0x506157[_0xfe5a('0x53')],{'$or':_[_0xfe5a('0x43')](_0x506157[_0xfe5a('0x4d')],function(_0xcfcfb2){var _0x3bebe6={};_0x3bebe6[_0xcfcfb2]={'$like':'%'+_0x510fe1[_0xfe5a('0x49')][_0xfe5a('0x55')]+'%'};return _0x3bebe6;})});}_0x506157=_[_0xfe5a('0x57')]({},_0x506157,_0x510fe1['options']);return db['CannedAnswer'][_0xfe5a('0x31')]({'where':_0x506157[_0xfe5a('0x53')]})[_0xfe5a('0x22')](function(_0xdcf619){_0x36de1e['count']=_0xdcf619;if(_0x510fe1['query']['includeAll']){_0x506157[_0xfe5a('0x5c')]=[{'all':!![]}];}return db[_0xfe5a('0x70')][_0xfe5a('0x72')](_0x506157);})['then'](function(_0x2a2cb9){_0x36de1e['rows']=_0x2a2cb9;return _0x36de1e;});}})['then'](respondWithFilteredResult(_0x1c1d81,_0x506157))['catch'](handleError(_0x1c1d81,null));};exports['removeAnswers']=function(_0x17900e,_0x2c461e,_0x52bf0b){return db[_0xfe5a('0x44')][_0xfe5a('0x5e')]({'where':{'id':_0x17900e[_0xfe5a('0x5a')]['id']}})[_0xfe5a('0x22')](handleEntityNotFound(_0x2c461e,null))[_0xfe5a('0x22')](function(_0x373965){if(_0x373965){return _0x373965[_0xfe5a('0x73')](_0x17900e['query']['ids']);}})['then'](respondWithStatusCode(_0x2c461e,null))['catch'](handleError(_0x2c461e,null));};exports[_0xfe5a('0x74')]=function(_0x4aff1d,_0x1569a3,_0x13fab1){var _0x42d953={'channel':_0xfe5a('0x75')};var _0x1dddfc=[];var _0x44fc5f=[];var _0x1dfebd={};return db[_0xfe5a('0x44')][_0xfe5a('0x5e')]({'where':{'id':_0x4aff1d[_0xfe5a('0x5a')]['id']},'include':[{'model':db[_0xfe5a('0x76')],'as':'Applications'}]})[_0xfe5a('0x22')](handleEntityNotFound(_0x1569a3,null))[_0xfe5a('0x22')](function(_0x1859d2){_0x42d953[_0xfe5a('0x77')]=_0x1859d2;_0x42d953[_0xfe5a('0x78')]=_['orderBy'](_0x1859d2[_0xfe5a('0x79')],[_0xfe5a('0x7a')],[_0xfe5a('0x7b')]);if(_0x42d953[_0xfe5a('0x77')][_0xfe5a('0x79')]){delete _0x42d953['account'][_0xfe5a('0x79')];}return db[_0xfe5a('0x7c')][_0xfe5a('0x67')]();})[_0xfe5a('0x22')](function(_0xf9c8c5){if(!_0xf9c8c5){throw new db['Sequelize'][(_0xfe5a('0x1f'))](_0xfe5a('0x7d'));}_0x1dddfc=_[_0xfe5a('0x7e')](_[_0xfe5a('0x4a')](_0xf9c8c5),[_0xfe5a('0x7f'),_0xfe5a('0x80')]);_0x44fc5f=_['difference'](_[_0xfe5a('0x4a')](_0xf9c8c5),[_0xfe5a('0x7f'),_0xfe5a('0x80'),_0xfe5a('0x81'),_0xfe5a('0x82')]);_0x42d953[_0xfe5a('0x60')]={'mapKey':_0xfe5a('0x83')};if(_0x42d953[_0xfe5a('0x77')][_0xfe5a('0x47')]){switch(_0x42d953[_0xfe5a('0x77')][_0xfe5a('0x47')]){case _0xfe5a('0x84'):_0x42d953[_0xfe5a('0x60')]['from']=_0x4aff1d[_0xfe5a('0x60')][_0xfe5a('0x85')];_0x42d953[_0xfe5a('0x60')][_0xfe5a('0x60')]=_0x4aff1d[_0xfe5a('0x60')][_0xfe5a('0x86')];_0x42d953[_0xfe5a('0x60')]['messageId']=_0x4aff1d[_0xfe5a('0x60')][_0xfe5a('0x87')];break;case _0xfe5a('0x88'):_0x42d953[_0xfe5a('0x60')]['from']='+'+_0x4aff1d[_0xfe5a('0x60')][_0xfe5a('0x89')];_0x42d953[_0xfe5a('0x60')][_0xfe5a('0x60')]=_0x4aff1d[_0xfe5a('0x60')][_0xfe5a('0x8a')];break;case _0xfe5a('0x8b'):_0x42d953[_0xfe5a('0x60')][_0xfe5a('0x8c')]=_0x4aff1d[_0xfe5a('0x60')][_0xfe5a('0x8c')];_0x42d953[_0xfe5a('0x60')]['body']=_0x4aff1d['body'][_0xfe5a('0x2a')];break;case _0xfe5a('0x8d'):_0x42d953['body'][_0xfe5a('0x8c')]=_0x4aff1d[_0xfe5a('0x60')]['from'];_0x42d953['body'][_0xfe5a('0x60')]=_0x4aff1d[_0xfe5a('0x60')]['body'];_0x42d953[_0xfe5a('0x60')][_0xfe5a('0x8e')]=_0x4aff1d[_0xfe5a('0x60')][_0xfe5a('0x8f')];break;case _0xfe5a('0x90'):_0x42d953[_0xfe5a('0x60')][_0xfe5a('0x8c')]=_0x4aff1d['body']['From'];_0x42d953['body'][_0xfe5a('0x60')]=_0x4aff1d[_0xfe5a('0x60')][_0xfe5a('0x91')];_0x42d953[_0xfe5a('0x60')][_0xfe5a('0x8e')]=_0x4aff1d[_0xfe5a('0x60')][_0xfe5a('0x92')];break;case'infobip':_0x42d953['body'][_0xfe5a('0x8c')]='+'+_0x4aff1d[_0xfe5a('0x60')][_0xfe5a('0x93')][0x0]['from'];_0x42d953[_0xfe5a('0x60')]['body']=_0x4aff1d['body'][_0xfe5a('0x93')][0x0]['text'];_0x42d953[_0xfe5a('0x60')][_0xfe5a('0x8e')]=_0x4aff1d['body'][_0xfe5a('0x93')][0x0][_0xfe5a('0x8e')];break;case _0xfe5a('0x94'):_0x42d953[_0xfe5a('0x60')][_0xfe5a('0x8c')]=_0x4aff1d[_0xfe5a('0x60')][_0xfe5a('0x95')];_0x42d953[_0xfe5a('0x60')][_0xfe5a('0x60')]=_0x4aff1d[_0xfe5a('0x60')][_0xfe5a('0x96')]['message'];break;case _0xfe5a('0x97'):_0x42d953[_0xfe5a('0x60')][_0xfe5a('0x8c')]=_0x4aff1d[_0xfe5a('0x60')][_0xfe5a('0x98')];_0x42d953[_0xfe5a('0x60')][_0xfe5a('0x60')]=_0x4aff1d[_0xfe5a('0x60')]['text'];_0x42d953[_0xfe5a('0x60')][_0xfe5a('0x8e')]=_0x4aff1d['body'][_0xfe5a('0x99')];break;case'intelepeer':_0x42d953[_0xfe5a('0x60')][_0xfe5a('0x8c')]=_0x4aff1d[_0xfe5a('0x60')]['from'];_0x42d953[_0xfe5a('0x60')][_0xfe5a('0x60')]=_0x4aff1d[_0xfe5a('0x60')]['message'];_0x42d953['body']['messageId']=_0x4aff1d[_0xfe5a('0x60')][_0xfe5a('0x9a')];break;}}if(_0x42d953['body']['id']){delete _0x42d953[_0xfe5a('0x60')]['id'];}if(_[_0xfe5a('0x9b')](_0x42d953[_0xfe5a('0x60')]['from'])){throw new db[(_0xfe5a('0x1e'))][(_0xfe5a('0x1f'))](_0xfe5a('0x9c'));}if(_['isNil'](_0x42d953[_0xfe5a('0x60')][_0xfe5a('0x60')])||_0x42d953[_0xfe5a('0x60')][_0xfe5a('0x60')]===''){throw new db[(_0xfe5a('0x1e'))][(_0xfe5a('0x1f'))](_0xfe5a('0x9d'));}if(_[_0xfe5a('0x9b')](_0x42d953[_0xfe5a('0x60')][_0xfe5a('0x9e')])){throw new db['Sequelize'][(_0xfe5a('0x1f'))](_0xfe5a('0x9f')+_0x44fc5f);}if(!_[_0xfe5a('0xa0')](_0x44fc5f,_0x42d953['body']['mapKey'])){throw new db['Sequelize'][(_0xfe5a('0x1f'))](_0xfe5a('0xa1')+_0x44fc5f);}_0x1dfebd[_0x42d953[_0xfe5a('0x60')]['mapKey']]=_0x42d953[_0xfe5a('0x60')][_0xfe5a('0x8c')];return db[_0xfe5a('0xa2')][_0xfe5a('0x5e')]({'where':{'id':_0x42d953[_0xfe5a('0x77')]['ListId']},'include':[{'model':db[_0xfe5a('0x7c')],'as':_0xfe5a('0xa3'),'where':_0x1dfebd,'limit':0x1,'order':[[_0xfe5a('0x80'),'DESC']]}]});})[_0xfe5a('0x22')](handleEntityNotFound(_0x1569a3,null))[_0xfe5a('0x22')](function(_0x2fe105){if(_0x2fe105){_0x42d953[_0xfe5a('0xa4')]=_[_0xfe5a('0xa5')](_0x2fe105,['Contacts']);if(_0x2fe105[_0xfe5a('0xa3')][_0xfe5a('0x4e')]){return _0x2fe105['Contacts'][0x0];}var _0x437917=_['defaults'](_0x42d953[_0xfe5a('0x60')],{'firstName':_0x42d953['body']['from'],'ListId':_0x2fe105['id']});_0x437917[_0x42d953[_0xfe5a('0x60')][_0xfe5a('0x9e')]]=_0x42d953[_0xfe5a('0x60')][_0xfe5a('0x8c')];return db[_0xfe5a('0x7c')][_0xfe5a('0x5f')](_0x437917,{'fields':_0x1dddfc,'raw':!![]});}})[_0xfe5a('0x22')](handleEntityNotFound(_0x1569a3,null))[_0xfe5a('0x22')](function(_0x23f4ed){if(_0x23f4ed){_0x42d953['contact']=_0x23f4ed;var _0x43f944={'ContactId':_0x23f4ed['id'],'phone':_0x42d953[_0xfe5a('0x60')][_0xfe5a('0x8c')],'SmsAccountId':_0x4aff1d['params']['id']};var _0x23a344={'ContactId':_0x23f4ed['id'],'SmsAccountId':_0x4aff1d[_0xfe5a('0x5a')]['id'],'closed':![]};return db[_0xfe5a('0xa6')]['find']({'where':_0x23a344})['then'](function(_0x4f367a){if(_0x4f367a){return[_0x4f367a,![]];}return db[_0xfe5a('0xa6')]['create'](_0x43f944)[_0xfe5a('0x22')](function(_0x1b2cf3){return[_0x1b2cf3,!![]];});});}})['spread'](function(_0x2e5516,_0x352552){_0x42d953[_0xfe5a('0xa7')]=_0x2e5516['get']({'plain':!![]});_0x42d953['interaction'][_0xfe5a('0xa8')]=![];if(_0x352552){if(_0x42d953[_0xfe5a('0x77')][_0xfe5a('0xa9')]){_0x42d953[_0xfe5a('0x78')]['push']({'id':0x0,'priority':_0x42d953[_0xfe5a('0x78')][_0xfe5a('0x4e')]+0x1,'app':'close','appdata':_0xfe5a('0xaa'),'interval':_0xfe5a('0xab')});}_0x42d953[_0xfe5a('0xa7')][_0xfe5a('0xa8')]=!![];}return db[_0xfe5a('0xac')][_0xfe5a('0x5f')]({'phone':_0x42d953[_0xfe5a('0x60')]['from'],'messageId':_0x42d953[_0xfe5a('0x60')]['messageId'],'body':_0x42d953[_0xfe5a('0x60')][_0xfe5a('0x60')],'SmsAccountId':_0x4aff1d[_0xfe5a('0x5a')]['id'],'SmsInteractionId':_0x2e5516['id'],'direction':'in','ContactId':_0x2e5516[_0xfe5a('0xad')],'AttachmentId':_0x42d953[_0xfe5a('0x60')][_0xfe5a('0xae')]});})[_0xfe5a('0x22')](function(_0x176064){_0x42d953[_0xfe5a('0x2a')]=_0x176064;if(_0x42d953[_0xfe5a('0xa7')]['UserId']){return db['User'][_0xfe5a('0x5e')]({'attributes':['id',_0xfe5a('0x3f')],'where':{'id':_0x42d953[_0xfe5a('0xa7')][_0xfe5a('0xaf')]}})[_0xfe5a('0x22')](function(_0x422e29){if(_0x422e29){_0x42d953[_0xfe5a('0x78')][_0xfe5a('0xb0')]({'id':0x0,'priority':0x0,'app':_0xfe5a('0xb1'),'appdata':_0x422e29[_0xfe5a('0x3f')]+','+(_0x42d953[_0xfe5a('0x77')]['waitForTheAssignedAgent']||0xa),'interval':_0xfe5a('0xab')});}return respondWithRpcPromise(_0xfe5a('0xb2'),'startRouting',_0x42d953);});}return respondWithRpcPromise('Start',_0xfe5a('0xb3'),_0x42d953);})[_0xfe5a('0x22')](function(_0x1159b2){if(_0x1159b2){var _0x4e1194=0xc8;var _0x155598=_0xfe5a('0xb4');logger['info'](_0xfe5a('0x25'),_0x155598,_0x4e1194,'entity\x20found');logger[_0xfe5a('0x24')](_0xfe5a('0xb5'),_0x155598,_0x4e1194,'entity\x20found',JSON['stringify'](_0x1159b2));if(_0x42d953[_0xfe5a('0x77')][_0xfe5a('0x47')]===_0xfe5a('0x84')){return _0x1569a3['status'](_0x4e1194)[_0xfe5a('0x34')](_0xfe5a('0xb6'),_0xfe5a('0xb7'))[_0xfe5a('0xb8')](_0xfe5a('0xb9'));}else{return _0x1569a3[_0xfe5a('0x2f')](_0x4e1194)[_0xfe5a('0x30')](_0x1159b2);}}})[_0xfe5a('0x2d')](handleError(_0x1569a3,null));};exports['addApplications']=function(_0x470135,_0x3c9319,_0x52fe77){return db[_0xfe5a('0x44')][_0xfe5a('0x6c')]({'where':{'id':_0x470135[_0xfe5a('0x5a')]['id']}})[_0xfe5a('0x22')](handleEntityNotFound(_0x3c9319,null))[_0xfe5a('0x22')](function(_0x2e41e7){if(_0x2e41e7){return db[_0xfe5a('0xba')][_0xfe5a('0xbb')](function(_0x345d30){return db['SmsApplication']['destroy']({'where':{'SmsAccountId':_0x470135[_0xfe5a('0x5a')]['id']},'transaction':_0x345d30})[_0xfe5a('0x22')](function(_0x524df8){var _0x3490b2=_[_0xfe5a('0x43')](_0x470135[_0xfe5a('0x60')],function(_0x1e654f){_0x1e654f[_0xfe5a('0x69')]=_0x470135[_0xfe5a('0x5a')]['id'];return _0x1e654f;});return db[_0xfe5a('0x76')][_0xfe5a('0xbc')](_0x3490b2,{'transaction':_0x345d30});});})[_0xfe5a('0x22')](function(){return db[_0xfe5a('0x76')][_0xfe5a('0xbd')]({'where':{'SmsAccountId':_0x470135[_0xfe5a('0x5a')]['id']},'order':_0xfe5a('0x7a')});});}})[_0xfe5a('0x22')](respondWithResult(_0x3c9319,null))['catch'](handleError(_0x3c9319,null));};exports[_0xfe5a('0xbe')]=function(_0x466185,_0x5642f8,_0x38488f){var _0x53e0d2={};var _0x5a6e30={};var _0x2a30d1;var _0x7c7148;return db['SmsAccount']['findOne']({'where':{'id':_0x466185[_0xfe5a('0x5a')]['id']}})[_0xfe5a('0x22')](handleEntityNotFound(_0x5642f8,null))['then'](function(_0x3b7bea){if(_0x3b7bea){_0x2a30d1=_0x3b7bea;_0x5a6e30[_0xfe5a('0x48')]=_[_0xfe5a('0x4a')](db[_0xfe5a('0x76')]['rawAttributes']);_0x5a6e30[_0xfe5a('0x49')]=_[_0xfe5a('0x4a')](_0x466185['query']);_0x5a6e30[_0xfe5a('0x4b')]=_[_0xfe5a('0x5b')](_0x5a6e30[_0xfe5a('0x48')],_0x5a6e30[_0xfe5a('0x49')]);_0x53e0d2[_0xfe5a('0x4d')]=_['intersection'](_0x5a6e30['model'],qs[_0xfe5a('0x4c')](_0x466185['query']['fields']));_0x53e0d2[_0xfe5a('0x4d')]=_0x53e0d2[_0xfe5a('0x4d')][_0xfe5a('0x4e')]?_0x53e0d2[_0xfe5a('0x4d')]:_0x5a6e30[_0xfe5a('0x48')];_0x53e0d2[_0xfe5a('0x51')]=qs[_0xfe5a('0x52')](_0x466185[_0xfe5a('0x49')][_0xfe5a('0x52')]);_0x53e0d2['where']=qs[_0xfe5a('0x4b')](_[_0xfe5a('0x54')](_0x466185['query'],_0x5a6e30[_0xfe5a('0x4b')]));if(_0x466185['query'][_0xfe5a('0x55')]){_0x53e0d2[_0xfe5a('0x53')]=_[_0xfe5a('0x57')](_0x53e0d2[_0xfe5a('0x53')],{'$or':_[_0xfe5a('0x43')](_0x53e0d2[_0xfe5a('0x4d')],function(_0x4fe2be){var _0x6bc8bc={};_0x6bc8bc[_0x4fe2be]={'$like':'%'+_0x466185[_0xfe5a('0x49')][_0xfe5a('0x55')]+'%'};return _0x6bc8bc;})});}_0x53e0d2=_[_0xfe5a('0x57')]({},_0x53e0d2,_0x466185['options']);return _0x2a30d1[_0xfe5a('0xbe')](_0x53e0d2);}})[_0xfe5a('0x22')](function(_0x4d3ca8){if(_0x4d3ca8){_0x7c7148=_0x4d3ca8[_0xfe5a('0x4e')];if(!_0x466185['query'][_0xfe5a('0x4f')](_0xfe5a('0x50'))){_0x53e0d2[_0xfe5a('0x33')]=qs[_0xfe5a('0x33')](_0x466185['query'][_0xfe5a('0x33')]);_0x53e0d2[_0xfe5a('0x32')]=qs[_0xfe5a('0x32')](_0x466185['query']['offset']);}return _0x2a30d1[_0xfe5a('0xbe')](_0x53e0d2);}})[_0xfe5a('0x22')](function(_0xcf25cd){if(_0xcf25cd){return _0xcf25cd?{'count':_0x7c7148,'rows':_0xcf25cd}:null;}})[_0xfe5a('0x22')](respondWithResult(_0x5642f8,null))['catch'](handleError(_0x5642f8,null));};exports[_0xfe5a('0xbf')]=function(_0x426bb2,_0xec9269,_0x2a0910){var _0x4109c2={'raw':![],'where':{}};var _0x500b71={};var _0x4336d5={'count':0x0,'rows':[]};return db[_0xfe5a('0x44')][_0xfe5a('0x6c')]({'where':{'id':_0x426bb2[_0xfe5a('0x5a')]['id']}})[_0xfe5a('0x22')](handleEntityNotFound(_0xec9269,null))['then'](function(_0x16af60){if(_0x16af60){_0x500b71[_0xfe5a('0x48')]=_['keys'](db[_0xfe5a('0xa6')][_0xfe5a('0x45')]);_0x500b71[_0xfe5a('0x49')]=_[_0xfe5a('0x4a')](_0x426bb2[_0xfe5a('0x49')]);_0x500b71[_0xfe5a('0x4b')]=_[_0xfe5a('0x5b')](_0x500b71[_0xfe5a('0x48')],_0x500b71['query']);_0x4109c2[_0xfe5a('0x4d')]=_[_0xfe5a('0x5b')](_0x500b71[_0xfe5a('0x48')],qs[_0xfe5a('0x4c')](_0x426bb2['query']['fields']));_0x4109c2[_0xfe5a('0x4d')]=_0x4109c2[_0xfe5a('0x4d')]['length']?_0x4109c2[_0xfe5a('0x4d')]:_0x500b71[_0xfe5a('0x48')];if(!_0x426bb2[_0xfe5a('0x49')][_0xfe5a('0x4f')]('nolimit')){_0x4109c2['limit']=qs[_0xfe5a('0x33')](_0x426bb2[_0xfe5a('0x49')][_0xfe5a('0x33')]);_0x4109c2[_0xfe5a('0x32')]=qs['offset'](_0x426bb2[_0xfe5a('0x49')]['offset']);}_0x4109c2[_0xfe5a('0x51')]=qs[_0xfe5a('0x52')](_0x426bb2['query']['sort']);_0x4109c2[_0xfe5a('0x53')]=qs[_0xfe5a('0x4b')](_[_0xfe5a('0x54')](_0x426bb2[_0xfe5a('0x49')],_0x500b71[_0xfe5a('0x4b')]));_0x4109c2[_0xfe5a('0x53')]['SmsAccountId']=_0x16af60['id'];if(_0x426bb2[_0xfe5a('0x49')][_0xfe5a('0x55')]){_0x4109c2['where']=_['merge'](_0x4109c2[_0xfe5a('0x53')],{'$or':_['map'](_0x4109c2[_0xfe5a('0x4d')],function(_0x164e79){var _0xf559a5={};_0xf559a5[_0x164e79]={'$like':'%'+_0x426bb2[_0xfe5a('0x49')][_0xfe5a('0x55')]+'%'};return _0xf559a5;})});}_0x4109c2=_[_0xfe5a('0x57')]({},_0x4109c2,_0x426bb2[_0xfe5a('0x5d')]);return db['SmsInteraction'][_0xfe5a('0x31')]({'where':_0x4109c2[_0xfe5a('0x53')]})['then'](function(_0xc7f888){_0x4336d5[_0xfe5a('0x31')]=_0xc7f888;if(_0x426bb2['query']['includeAll']){_0x4109c2['include']=[{'model':db[_0xfe5a('0x7c')],'as':_0xfe5a('0xc0'),'required':![]},{'model':db['User'],'as':_0xfe5a('0xc1'),'attributes':['name',_0xfe5a('0xc2'),'internal'],'required':![]},{'model':db[_0xfe5a('0xc3')],'as':_0xfe5a('0xc4'),'attributes':['id',_0xfe5a('0x3f'),'color'],'where':_0x426bb2[_0xfe5a('0x49')]['tag']?{'id':_0x426bb2[_0xfe5a('0x49')][_0xfe5a('0xc5')]}:undefined,'required':_0x426bb2['query'][_0xfe5a('0xc5')]?!![]:![]}];}return db[_0xfe5a('0xa6')][_0xfe5a('0x72')](_0x4109c2);})[_0xfe5a('0x22')](function(_0x2036d5){_0x4336d5[_0xfe5a('0x6d')]=_0x2036d5;return _0x4336d5;});}})[_0xfe5a('0x22')](respondWithFilteredResult(_0xec9269,_0x4109c2))['catch'](handleError(_0xec9269,null));};exports[_0xfe5a('0xb8')]=function(_0xad6c01,_0x597704,_0x48dc71){var _0x243e6d,_0x4ae9dc,_0x187681;if(_[_0xfe5a('0x9b')](_0xad6c01[_0xfe5a('0x60')][_0xfe5a('0x60')])||_0xad6c01[_0xfe5a('0x60')]['body']===''){throw new db[(_0xfe5a('0x1e'))][(_0xfe5a('0x1f'))](_0xfe5a('0x9d'));}if(_[_0xfe5a('0x9b')](_0xad6c01[_0xfe5a('0x60')]['to'])){throw new db[(_0xfe5a('0x1e'))][(_0xfe5a('0x1f'))](_0xfe5a('0xc6'));}_0x243e6d=_0xad6c01[_0xfe5a('0x60')]['to'];return db[_0xfe5a('0x44')][_0xfe5a('0x5e')]({'where':{'id':_0xad6c01[_0xfe5a('0x5a')]['id']},'include':[{'model':db['CmList'],'as':_0xfe5a('0xc7'),'include':[{'model':db['CmContact'],'as':_0xfe5a('0xa3'),'where':{'mobile':_0x243e6d},'limit':0x1,'order':[[_0xfe5a('0x80'),_0xfe5a('0xc8')]]}]}]})[_0xfe5a('0x22')](handleEntityNotFound(_0x597704,null))[_0xfe5a('0x22')](function(_0x5c9e6e){if(_0x5c9e6e&&_0x5c9e6e[_0xfe5a('0xc7')]){_0x4ae9dc=_0x5c9e6e[_0xfe5a('0x3a')]({'plain':!![]});if(_0x4ae9dc[_0xfe5a('0xc7')]&&_0x4ae9dc[_0xfe5a('0xc7')]['Contacts']['length']){return _0x4ae9dc['List'][_0xfe5a('0xa3')][0x0];}return db['CmContact'][_0xfe5a('0x5f')](_[_0xfe5a('0x15')](_0xad6c01[_0xfe5a('0x60')],{'firstName':_0x243e6d,'mobile':_0x243e6d,'phone':_0x243e6d,'ListId':_0x4ae9dc['ListId']}));}})[_0xfe5a('0x22')](handleEntityNotFound(_0x597704,null))[_0xfe5a('0x22')](function(_0x556aae){if(_0x556aae){_0x187681=_0x556aae;return db[_0xfe5a('0xa6')]['find']({'where':{'ContactId':_0x187681['id'],'closed':![],'SmsAccountId':_0x4ae9dc['id']}})['then'](function(_0x340e57){if(_0x340e57){return[_0x340e57,![]];}return db[_0xfe5a('0xa6')][_0xfe5a('0x5f')]({'UserId':_0xad6c01['user']['id'],'ContactId':_0x187681['id'],'SmsAccountId':_0x4ae9dc['id'],'phone':_0x243e6d,'firstMsgDirection':_0xfe5a('0xc9'),'Messages':[_['merge'](_0xad6c01[_0xfe5a('0x60')],{'read':![],'body':_0xad6c01['body'][_0xfe5a('0x60')],'phone':_0x243e6d,'SmsAccountId':_0x4ae9dc['id'],'UserId':_0xad6c01[_0xfe5a('0x61')]['id'],'ContactId':_0x187681['id']})]},{'include':[{'model':db[_0xfe5a('0xac')],'as':_0xfe5a('0xca')}]})[_0xfe5a('0x22')](function(_0x380f3c){return[_0x380f3c,!![]];});});}})['spread'](function(_0x1cbb6d,_0x136e9f){if(_0x136e9f){return _0x1cbb6d;}return db[_0xfe5a('0xac')][_0xfe5a('0x5f')](_[_0xfe5a('0x57')](_0xad6c01[_0xfe5a('0x60')],{'read':![],'body':_0xad6c01['body']['body'],'phone':_0x243e6d,'SmsAccountId':_0x4ae9dc['id'],'SmsInteractionId':_0x1cbb6d['id'],'UserId':_0xad6c01['user']['id'],'ContactId':_0x187681['id']}))['then'](function(_0x2e0a2e){_0x1cbb6d[_0xfe5a('0xcb')][_0xfe5a('0xca')]=[];_0x1cbb6d[_0xfe5a('0xcb')][_0xfe5a('0xca')][_0xfe5a('0xcc')](_0x2e0a2e[_0xfe5a('0xcb')]);return _0x1cbb6d;});})[_0xfe5a('0x22')](respondWithResult(_0x597704,null))[_0xfe5a('0x2d')](handleError(_0x597704,null));};exports[_0xfe5a('0x2f')]=function(_0x587f09,_0x40752a,_0x1d7a5b){if(_0x587f09['body']['id']){delete _0x587f09[_0xfe5a('0x60')]['id'];}console[_0xfe5a('0xcd')](_0xfe5a('0xce'),_0x587f09[_0xfe5a('0x60')]);var _0x4e3b85,_0x4f9ab6,_0x159fa6;return db[_0xfe5a('0x44')][_0xfe5a('0x5e')]({'where':{'id':_0x587f09[_0xfe5a('0x5a')]['id']}})[_0xfe5a('0x22')](handleEntityNotFound(_0x40752a,null))['then'](function(_0x25b87c){if(_0x25b87c){_0x159fa6=_0x25b87c;logger['debug'](_0xfe5a('0x25'),_0xfe5a('0x2f'),_0xfe5a('0xcf'),_0x25b87c[_0xfe5a('0x47')],util[_0xfe5a('0xd0')](_0x587f09[_0xfe5a('0x60')],{'showHidden':![],'depth':null}));switch(_0x25b87c['type']){case _0xfe5a('0x88'):if(_0x587f09[_0xfe5a('0x60')][_0xfe5a('0xd1')]&&_0x587f09['body']['status']){_0x4f9ab6=_0x587f09[_0xfe5a('0x60')][_0xfe5a('0x2f')];return db['SmsMessage']['find']({'where':{'messageId':_0x587f09[_0xfe5a('0x60')]['skebby_dispatch_id']}});}break;case'connectel':if(_0x587f09[_0xfe5a('0x60')][_0xfe5a('0xd2')]&&_0x587f09[_0xfe5a('0x60')][_0xfe5a('0xd3')]){_0x4f9ab6=_0x587f09['body']['statusInt'];return db[_0xfe5a('0xac')][_0xfe5a('0x5e')]({'where':{'messageId':_0x587f09[_0xfe5a('0x60')][_0xfe5a('0xd2')]}});}break;case _0xfe5a('0x8d'):if(_0x587f09[_0xfe5a('0x60')][_0xfe5a('0x8f')]&&_0x587f09[_0xfe5a('0x60')][_0xfe5a('0xd4')]){_0x4f9ab6=_0x587f09['body'][_0xfe5a('0xd4')];return db[_0xfe5a('0xac')][_0xfe5a('0x5e')]({'where':{'messageId':_0x587f09['body'][_0xfe5a('0x8f')]}});}break;case _0xfe5a('0xd5'):var _0x1e6852=_0x587f09[_0xfe5a('0x60')]['results'][0x0];if(_0x1e6852[_0xfe5a('0x8e')]&&_0x1e6852[_0xfe5a('0x2f')]['groupName']===_0xfe5a('0xd6')){_0x4f9ab6=_0x1e6852[_0xfe5a('0x2f')][_0xfe5a('0xd7')];return db[_0xfe5a('0xac')][_0xfe5a('0x5e')]({'where':{'messageId':_0x1e6852[_0xfe5a('0x8e')]}});}break;case _0xfe5a('0x97'):if(_0x587f09[_0xfe5a('0x60')][_0xfe5a('0x8e')]&&_0x587f09[_0xfe5a('0x60')][_0xfe5a('0x2f')]){_0x4f9ab6=_0x587f09[_0xfe5a('0x60')][_0xfe5a('0x2f')];return db[_0xfe5a('0xac')][_0xfe5a('0x5e')]({'where':{'messageId':_0x587f09[_0xfe5a('0x60')]['messageId']}});}break;case _0xfe5a('0xd8'):if(_0x587f09['body'][_0xfe5a('0xd9')]&&_0x587f09['body'][_0xfe5a('0x2f')]){_0x4f9ab6=_0x587f09[_0xfe5a('0x60')][_0xfe5a('0x2f')];return db[_0xfe5a('0xac')][_0xfe5a('0x5e')]({'where':{'messageId':_0x587f09[_0xfe5a('0x60')][_0xfe5a('0xd9')]}});}break;}}})['then'](handleEntityNotFound(_0x40752a,null))[_0xfe5a('0x22')](function(_0x539b7e){if(_0x539b7e){_0x4e3b85=_0x539b7e;switch(_0x159fa6[_0xfe5a('0x47')]){case _0xfe5a('0x88'):if(_0x4f9ab6===_0xfe5a('0xd6')){return _0x4e3b85[_0xfe5a('0x39')]({'read':!![]});}else{logger[_0xfe5a('0x27')](_0xfe5a('0x25'),_0xfe5a('0x2f'),_0xfe5a('0x88'),util['inspect'](_0x587f09[_0xfe5a('0x60')],{'showHidden':![],'depth':null}));}break;case _0xfe5a('0x8b'):if(_0x4f9ab6==='1'){return _0x4e3b85['update']({'read':!![]});}else{logger[_0xfe5a('0x27')](_0xfe5a('0x25'),'status',_0xfe5a('0x88'),util[_0xfe5a('0xd0')](_0x587f09[_0xfe5a('0x60')],{'showHidden':![],'depth':null}));}break;case _0xfe5a('0x8d'):if(!_0x587f09['body'][_0xfe5a('0xda')]&&_0x4f9ab6>=0xc8&&_0x4f9ab6<=0xce){return _0x4e3b85['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfe5a('0x2f'),_0xfe5a('0x8d'),util[_0xfe5a('0xd0')](_0x587f09[_0xfe5a('0x60')],{'showHidden':![],'depth':null}));}break;case _0xfe5a('0xd5'):var _0x33d39b=_0x587f09[_0xfe5a('0x60')][_0xfe5a('0x93')][0x0];if(_0x33d39b[_0xfe5a('0x2f')]['groupName']===_0xfe5a('0xd6')){return _0x4e3b85[_0xfe5a('0x39')]({'read':!![]});}else{logger['error'](_0xfe5a('0x25'),_0xfe5a('0x2f'),_0xfe5a('0xd5'),util[_0xfe5a('0xd0')](_0x587f09['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x4f9ab6==_0xfe5a('0xdb')||_0x4f9ab6=='RECEIVED_BY_RECIPIENT'){return _0x4e3b85[_0xfe5a('0x39')]({'read':!![]});}else{logger[_0xfe5a('0x27')](_0xfe5a('0x25'),_0xfe5a('0x2f'),_0xfe5a('0x97'),util[_0xfe5a('0xd0')](_0x587f09[_0xfe5a('0x60')],{'showHidden':![],'depth':null}));}break;case _0xfe5a('0xd8'):if(_0x4f9ab6===_0xfe5a('0xdc')||_0x4f9ab6===_0xfe5a('0xdd')){return _0x4e3b85[_0xfe5a('0x39')]({'read':!![]});}else{logger[_0xfe5a('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfe5a('0x2f'),_0xfe5a('0xd8'),util[_0xfe5a('0xd0')](_0x587f09['body'],{'showHidden':![],'depth':null}));}break;}return _0x4e3b85;}})[_0xfe5a('0x22')](respondWithResult(_0x40752a,null))[_0xfe5a('0x2d')](handleError(_0x40752a,null));};exports['statusGet']=function(_0x5cd027,_0x56b334,_0x4be0b0){var _0x1b0743,_0x5911bf,_0x15a8b1;return db['SmsAccount'][_0xfe5a('0x5e')]({'where':{'id':_0x5cd027[_0xfe5a('0x5a')]['id']}})[_0xfe5a('0x22')](handleEntityNotFound(_0x56b334,null))[_0xfe5a('0x22')](function(_0x262ab8){if(_0x262ab8){_0x15a8b1=_0x262ab8;logger[_0xfe5a('0x24')](_0xfe5a('0x25'),_0xfe5a('0x2f'),_0xfe5a('0xcf'),_0x262ab8[_0xfe5a('0x47')],util[_0xfe5a('0xd0')](_0x5cd027[_0xfe5a('0x49')],{'showHidden':![],'depth':null}));switch(_0x262ab8[_0xfe5a('0x47')]){case _0xfe5a('0x94'):if(_0x5cd027[_0xfe5a('0x49')][_0xfe5a('0xde')]&&_0x5cd027[_0xfe5a('0x49')][_0xfe5a('0xdf')]){_0x5911bf=_0x5cd027['query'][_0xfe5a('0xdf')];return db[_0xfe5a('0xac')]['find']({'where':{'messageId':_0x5cd027[_0xfe5a('0x49')][_0xfe5a('0xde')]}});}break;}}})[_0xfe5a('0x22')](handleEntityNotFound(_0x56b334,null))[_0xfe5a('0x22')](function(_0x3df5f0){if(_0x3df5f0){_0x1b0743=_0x3df5f0;switch(_0x15a8b1['type']){case _0xfe5a('0x94'):if(_0x5911bf==='2'||_0x5911bf==='6'){return _0x1b0743[_0xfe5a('0x39')]({'read':!![]});}else{logger[_0xfe5a('0x27')](_0xfe5a('0x25'),_0xfe5a('0x2f'),'csc',util['inspect'](_0x5cd027['query'],{'showHidden':![],'depth':null}));};break;}return _0x1b0743;}})[_0xfe5a('0x22')](respondWithResult(_0x56b334,null))['catch'](handleError(_0x56b334,null));};exports[_0xfe5a('0xe0')]=function(_0x1cb24a,_0xc6c181,_0xa287a2){return db['SmsAccount']['find']({'where':{'id':_0x1cb24a[_0xfe5a('0x5a')]['id']}})[_0xfe5a('0x22')](handleEntityNotFound(_0xc6c181,null))[_0xfe5a('0x22')](function(_0x475ca1){if(_0x475ca1){return _0x475ca1[_0xfe5a('0xe0')](_0x1cb24a['body'][_0xfe5a('0xe1')],_[_0xfe5a('0xa5')](_0x1cb24a[_0xfe5a('0x60')],[_0xfe5a('0xe1'),'id'])||{})[_0xfe5a('0xe2')](function(_0x282e20){for(var _0x22f02e=0x0;_0x22f02e<_0x1cb24a[_0xfe5a('0x60')][_0xfe5a('0xe1')][_0xfe5a('0x4e')];_0x22f02e+=0x1){socket[_0xfe5a('0xe3')](_0xfe5a('0xe4'),{'UserId':_0x1cb24a[_0xfe5a('0x60')][_0xfe5a('0xe1')][_0x22f02e],'SmsAccountId':_0x1cb24a[_0xfe5a('0x5a')]['id']});}return _0x282e20;});}})[_0xfe5a('0x22')](respondWithResult(_0xc6c181,null))[_0xfe5a('0x2d')](handleError(_0xc6c181,null));};exports[_0xfe5a('0xe5')]=function(_0x5ebb3f,_0x1e17cd,_0x31e363){return db[_0xfe5a('0x44')]['find']({'where':{'id':_0x5ebb3f['params']['id']}})[_0xfe5a('0x22')](handleEntityNotFound(_0x1e17cd,null))['then'](function(_0x13ea42){if(_0x13ea42){return _0x13ea42[_0xfe5a('0xe5')](_0x5ebb3f['query']['ids'])['then'](function(){if(_[_0xfe5a('0xe6')](_0x5ebb3f[_0xfe5a('0x49')][_0xfe5a('0xe1')])){for(var _0x3a5c17=0x0;_0x3a5c17<_0x5ebb3f[_0xfe5a('0x49')]['ids'][_0xfe5a('0x4e')];_0x3a5c17+=0x1){socket[_0xfe5a('0xe3')](_0xfe5a('0xe7'),{'UserId':Number(_0x5ebb3f[_0xfe5a('0x49')][_0xfe5a('0xe1')][_0x3a5c17]),'SmsAccountId':Number(_0x5ebb3f[_0xfe5a('0x5a')]['id'])});}}else{socket['emit'](_0xfe5a('0xe7'),{'UserId':Number(_0x5ebb3f[_0xfe5a('0x49')][_0xfe5a('0xe1')]),'SmsAccountId':Number(_0x5ebb3f['params']['id'])});}});}})[_0xfe5a('0x22')](respondWithStatusCode(_0x1e17cd,null))['catch'](handleError(_0x1e17cd,null));};exports['getAgents']=function(_0x51cb77,_0x4618e9,_0x14b1a6){var _0x4351e6={};var _0x1023c7={};var _0x17dd13;var _0x5ee0db;return db[_0xfe5a('0x44')]['findOne']({'where':{'id':_0x51cb77[_0xfe5a('0x5a')]['id']}})[_0xfe5a('0x22')](handleEntityNotFound(_0x4618e9,null))[_0xfe5a('0x22')](function(_0x47f27a){if(_0x47f27a){_0x17dd13=_0x47f27a;_0x1023c7['model']=_[_0xfe5a('0x4a')](db[_0xfe5a('0xe8')][_0xfe5a('0x45')]);_0x1023c7['query']=_[_0xfe5a('0x4a')](_0x51cb77[_0xfe5a('0x49')]);_0x1023c7[_0xfe5a('0x4b')]=_[_0xfe5a('0x5b')](_0x1023c7[_0xfe5a('0x48')],_0x1023c7[_0xfe5a('0x49')]);_0x4351e6['attributes']=_[_0xfe5a('0x5b')](_0x1023c7['model'],qs[_0xfe5a('0x4c')](_0x51cb77[_0xfe5a('0x49')][_0xfe5a('0x4c')]));_0x4351e6[_0xfe5a('0x4d')]=_0x4351e6[_0xfe5a('0x4d')][_0xfe5a('0x4e')]?_0x4351e6[_0xfe5a('0x4d')]:_0x1023c7['model'];_0x4351e6[_0xfe5a('0x51')]=qs[_0xfe5a('0x52')](_0x51cb77[_0xfe5a('0x49')][_0xfe5a('0x52')]);_0x4351e6['where']=qs['filters'](_['pick'](_0x51cb77['query'],_0x1023c7[_0xfe5a('0x4b')]));if(_0x51cb77[_0xfe5a('0x49')][_0xfe5a('0x55')]){_0x4351e6['where']=_[_0xfe5a('0x57')](_0x4351e6[_0xfe5a('0x53')],{'$or':_[_0xfe5a('0x43')](_0x4351e6[_0xfe5a('0x4d')],function(_0x556ff0){var _0x2a423c={};_0x2a423c[_0x556ff0]={'$like':'%'+_0x51cb77[_0xfe5a('0x49')][_0xfe5a('0x55')]+'%'};return _0x2a423c;})});}_0x4351e6=_[_0xfe5a('0x57')]({},_0x4351e6,_0x51cb77[_0xfe5a('0x5d')]);return _0x17dd13[_0xfe5a('0xe9')](_0x4351e6);}})[_0xfe5a('0x22')](function(_0x1c9ef0){if(_0x1c9ef0){_0x5ee0db=_0x1c9ef0['length'];if(!_0x51cb77[_0xfe5a('0x49')][_0xfe5a('0x4f')](_0xfe5a('0x50'))){_0x4351e6[_0xfe5a('0x33')]=qs[_0xfe5a('0x33')](_0x51cb77['query'][_0xfe5a('0x33')]);_0x4351e6['offset']=qs['offset'](_0x51cb77[_0xfe5a('0x49')]['offset']);}return _0x17dd13[_0xfe5a('0xe9')](_0x4351e6);}})['then'](function(_0x2da87e){if(_0x2da87e){return _0x2da87e?{'count':_0x5ee0db,'rows':_0x2da87e}:null;}})[_0xfe5a('0x22')](respondWithResult(_0x4618e9,null))[_0xfe5a('0x2d')](handleError(_0x4618e9,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 4011f84..acee217 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 _0x89e8=['remove','emit','hasOwnProperty','exports','../../mysqldb','SmsAccount','setMaxListeners','save'];(function(_0x58fa23,_0x5b7274){var _0x350932=function(_0x993740){while(--_0x993740){_0x58fa23['push'](_0x58fa23['shift']());}};_0x350932(++_0x5b7274);}(_0x89e8,0xf4));var _0x889e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x89e8[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x889e('0x0'))['db'][_0x889e('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x889e('0x2')](0x0);var events={'afterCreate':_0x889e('0x3'),'afterUpdate':'update','afterDestroy':_0x889e('0x4')};function emitEvent(_0xe41763){return function(_0x3accd2,_0x36e860,_0xcff662){SmsAccountEvents[_0x889e('0x5')](_0xe41763+':'+_0x3accd2['id'],_0x3accd2);SmsAccountEvents[_0x889e('0x5')](_0xe41763,_0x3accd2);_0xcff662(null);};}for(var e in events){if(events[_0x889e('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x889e('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0xfc27=['../../mysqldb','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x5d9ff2,_0x3278e9){var _0x1c565e=function(_0x278d7c){while(--_0x278d7c){_0x5d9ff2['push'](_0x5d9ff2['shift']());}};_0x1c565e(++_0x3278e9);}(_0xfc27,0xe9));var _0x7fc2=function(_0x3b7582,_0x1bba92){_0x3b7582=_0x3b7582-0x0;var _0x6ba795=_0xfc27[_0x3b7582];return _0x6ba795;};'use strict';var EventEmitter=require(_0x7fc2('0x0'));var SmsAccount=require(_0x7fc2('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x7fc2('0x2')](0x0);var events={'afterCreate':_0x7fc2('0x3'),'afterUpdate':_0x7fc2('0x4'),'afterDestroy':_0x7fc2('0x5')};function emitEvent(_0x85a2cb){return function(_0x2d1462,_0x553166,_0x1f26c4){SmsAccountEvents['emit'](_0x85a2cb+':'+_0x2d1462['id'],_0x2d1462);SmsAccountEvents[_0x7fc2('0x6')](_0x85a2cb,_0x2d1462);_0x1f26c4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x7fc2('0x7')](e,emitEvent(event));}}module[_0x7fc2('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 7b86464..39e34c2 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 _0xabba=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','SmsAccount','sms_accounts','util','../../config/logger','api'];(function(_0x213045,_0x4e2fc4){var _0x40c657=function(_0x5a3737){while(--_0x5a3737){_0x213045['push'](_0x213045['shift']());}};_0x40c657(++_0x4e2fc4);}(_0xabba,0x195));var _0xaabb=function(_0x2e5c2d,_0x48d0ff){_0x2e5c2d=_0x2e5c2d-0x0;var _0x4fd92=_0xabba[_0x2e5c2d];return _0x4fd92;};'use strict';var _=require('lodash');var util=require(_0xaabb('0x0'));var logger=require(_0xaabb('0x1'))(_0xaabb('0x2'));var moment=require(_0xaabb('0x3'));var BPromise=require(_0xaabb('0x4'));var rp=require(_0xaabb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaabb('0x6'));var config=require(_0xaabb('0x7'));var attributes=require('./smsAccount.attributes');module[_0xaabb('0x8')]=function(_0x44b755,_0x2dcb4d){return _0x44b755[_0xaabb('0x9')](_0xaabb('0xa'),attributes,{'tableName':_0xaabb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b12=['bluebird','request-promise','rimraf','../../config/environment','./smsAccount.attributes','exports','SmsAccount','sms_accounts','lodash','util','../../config/logger','moment'];(function(_0x2dd06d,_0x130845){var _0x4d6836=function(_0x4187a8){while(--_0x4187a8){_0x2dd06d['push'](_0x2dd06d['shift']());}};_0x4d6836(++_0x130845);}(_0x0b12,0xf8));var _0x20b1=function(_0x2eea83,_0xd3b5d7){_0x2eea83=_0x2eea83-0x0;var _0x4f1dcd=_0x0b12[_0x2eea83];return _0x4f1dcd;};'use strict';var _=require(_0x20b1('0x0'));var util=require(_0x20b1('0x1'));var logger=require(_0x20b1('0x2'))('api');var moment=require(_0x20b1('0x3'));var BPromise=require(_0x20b1('0x4'));var rp=require(_0x20b1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x20b1('0x6'));var config=require(_0x20b1('0x7'));var attributes=require(_0x20b1('0x8'));module[_0x20b1('0x9')]=function(_0x1ab87a,_0x55045b){return _0x1ab87a['define'](_0x20b1('0xa'),attributes,{'tableName':_0x20b1('0xb'),'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 da2b1b9..c29efa6 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 _0x71c3=['model','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','socket.io-emitter','redis','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','error','message','result','catch','ShowSmsAccount','SmsAccount','options','raw','where','attributes','map','include'];(function(_0x39bda0,_0x232687){var _0x3f769a=function(_0x12a31b){while(--_0x12a31b){_0x39bda0['push'](_0x39bda0['shift']());}};_0x3f769a(++_0x232687);}(_0x71c3,0x16a));var _0x371c=function(_0x222e71,_0x2d827c){_0x222e71=_0x222e71-0x0;var _0x2ea69a=_0x71c3[_0x222e71];return _0x2ea69a;};'use strict';var _=require(_0x371c('0x0'));var util=require(_0x371c('0x1'));var moment=require(_0x371c('0x2'));var BPromise=require(_0x371c('0x3'));var rs=require(_0x371c('0x4'));var fs=require('fs');var Redis=require(_0x371c('0x5'));var db=require(_0x371c('0x6'))['db'];var utils=require(_0x371c('0x7'));var logger=require(_0x371c('0x8'))('rpc');var config=require(_0x371c('0x9'));var jayson=require(_0x371c('0xa'));var client=jayson[_0x371c('0xb')]['http']({'port':0x232a});config['redis']=_[_0x371c('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x371c('0xd'))(new Redis(config[_0x371c('0xe')]));require(_0x371c('0xf'))[_0x371c('0x10')](socket);function respondWithRpcPromise(_0x41c231,_0x2a72dd,_0x4c92f9){return new BPromise(function(_0x2b96c3,_0x1469b1){return client[_0x371c('0x11')](_0x41c231,_0x4c92f9)[_0x371c('0x12')](function(_0x36ccbd){logger[_0x371c('0x13')](_0x371c('0x14'),_0x2a72dd,_0x371c('0x15'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2a72dd,'request\x20sent',JSON['stringify'](_0x36ccbd));if(_0x36ccbd[_0x371c('0x16')]){if(_0x36ccbd['error']['code']===0x1f4){logger[_0x371c('0x16')]('SmsAccount,\x20%s,\x20%s',_0x2a72dd,_0x36ccbd[_0x371c('0x16')]['message']);return _0x1469b1(_0x36ccbd[_0x371c('0x16')][_0x371c('0x17')]);}logger[_0x371c('0x16')]('SmsAccount,\x20%s,\x20%s',_0x2a72dd,_0x36ccbd['error'][_0x371c('0x17')]);return _0x2b96c3(_0x36ccbd['error'][_0x371c('0x17')]);}else{logger[_0x371c('0x13')](_0x371c('0x14'),_0x2a72dd,'request\x20sent');_0x2b96c3(_0x36ccbd[_0x371c('0x18')][_0x371c('0x17')]);}})[_0x371c('0x19')](function(_0x59c8b4){logger[_0x371c('0x16')](_0x371c('0x14'),_0x2a72dd,_0x59c8b4);_0x1469b1(_0x59c8b4);});});}exports[_0x371c('0x1a')]=function(_0x4dda6e){var _0x2f00b3=this;return new Promise(function(_0x54aabe,_0x3b497){return db[_0x371c('0x1b')]['find']({'raw':_0x4dda6e[_0x371c('0x1c')]?_0x4dda6e[_0x371c('0x1c')][_0x371c('0x1d')]===undefined?!![]:![]:!![],'where':_0x4dda6e[_0x371c('0x1c')]?_0x4dda6e[_0x371c('0x1c')][_0x371c('0x1e')]||null:null,'attributes':_0x4dda6e[_0x371c('0x1c')]?_0x4dda6e[_0x371c('0x1c')][_0x371c('0x1f')]||null:null,'include':_0x4dda6e[_0x371c('0x1c')]?_0x4dda6e[_0x371c('0x1c')]['include']?_[_0x371c('0x20')](_0x4dda6e[_0x371c('0x1c')][_0x371c('0x21')],function(_0x14b8c8){return{'model':db[_0x14b8c8[_0x371c('0x22')]],'as':_0x14b8c8['as'],'attributes':_0x14b8c8[_0x371c('0x1f')],'include':_0x14b8c8['include']?_[_0x371c('0x20')](_0x14b8c8[_0x371c('0x21')],function(_0x48b5e3){return{'model':db[_0x48b5e3['model']],'as':_0x48b5e3['as'],'attributes':_0x48b5e3[_0x371c('0x1f')],'include':_0x48b5e3[_0x371c('0x21')]?_[_0x371c('0x20')](_0x48b5e3[_0x371c('0x21')],function(_0xea9d61){return{'model':db[_0xea9d61['model']],'as':_0xea9d61['as'],'attributes':_0xea9d61['attributes']};}):[]};}):[]};}):[]:[]})[_0x371c('0x12')](function(_0x3d291a){logger['info'](_0x371c('0x1a'),_0x4dda6e);logger[_0x371c('0x23')](_0x371c('0x1a'),_0x4dda6e,JSON['stringify'](_0x3d291a));_0x54aabe(_0x3d291a);})[_0x371c('0x19')](function(_0x568dc6){logger[_0x371c('0x16')](_0x371c('0x1a'),_0x568dc6['message'],_0x4dda6e);_0x3b497(_0x2f00b3['error'](0x1f4,_0x568dc6['message']));});});}; \ No newline at end of file +var _0x493c=['SmsAccount','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','ShowSmsAccount'];(function(_0xb9a2b2,_0x69eef2){var _0x5c0e85=function(_0x349387){while(--_0x349387){_0xb9a2b2['push'](_0xb9a2b2['shift']());}};_0x5c0e85(++_0x69eef2);}(_0x493c,0xd1));var _0xc493=function(_0x7cc8f3,_0x11cfb7){_0x7cc8f3=_0x7cc8f3-0x0;var _0xd65b5e=_0x493c[_0x7cc8f3];return _0xd65b5e;};'use strict';var _=require(_0xc493('0x0'));var util=require(_0xc493('0x1'));var moment=require(_0xc493('0x2'));var BPromise=require(_0xc493('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc493('0x4'));var db=require(_0xc493('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc493('0x6'))(_0xc493('0x7'));var config=require(_0xc493('0x8'));var jayson=require(_0xc493('0x9'));var client=jayson[_0xc493('0xa')][_0xc493('0xb')]({'port':0x232a});config[_0xc493('0xc')]=_[_0xc493('0xd')](config['redis'],{'host':_0xc493('0xe'),'port':0x18eb});var socket=require(_0xc493('0xf'))(new Redis(config[_0xc493('0xc')]));require(_0xc493('0x10'))[_0xc493('0x11')](socket);function respondWithRpcPromise(_0x1fed2b,_0x26eefd,_0x418f73){return new BPromise(function(_0x550ea6,_0x3809de){return client[_0xc493('0x12')](_0x1fed2b,_0x418f73)[_0xc493('0x13')](function(_0x8e4569){logger['info'](_0xc493('0x14'),_0x26eefd,_0xc493('0x15'));logger[_0xc493('0x16')](_0xc493('0x17'),_0x26eefd,_0xc493('0x15'),JSON[_0xc493('0x18')](_0x8e4569));if(_0x8e4569[_0xc493('0x19')]){if(_0x8e4569[_0xc493('0x19')]['code']===0x1f4){logger['error'](_0xc493('0x14'),_0x26eefd,_0x8e4569[_0xc493('0x19')][_0xc493('0x1a')]);return _0x3809de(_0x8e4569[_0xc493('0x19')]['message']);}logger[_0xc493('0x19')](_0xc493('0x14'),_0x26eefd,_0x8e4569['error'][_0xc493('0x1a')]);return _0x550ea6(_0x8e4569[_0xc493('0x19')][_0xc493('0x1a')]);}else{logger[_0xc493('0x1b')]('SmsAccount,\x20%s,\x20%s',_0x26eefd,_0xc493('0x15'));_0x550ea6(_0x8e4569[_0xc493('0x1c')]['message']);}})[_0xc493('0x1d')](function(_0x4fc60f){logger[_0xc493('0x19')]('SmsAccount,\x20%s,\x20%s',_0x26eefd,_0x4fc60f);_0x3809de(_0x4fc60f);});});}exports[_0xc493('0x1e')]=function(_0x303154){var _0x1042ad=this;return new Promise(function(_0x5cded2,_0x3c644d){return db[_0xc493('0x1f')][_0xc493('0x20')]({'raw':_0x303154[_0xc493('0x21')]?_0x303154[_0xc493('0x21')][_0xc493('0x22')]===undefined?!![]:![]:!![],'where':_0x303154[_0xc493('0x21')]?_0x303154['options'][_0xc493('0x23')]||null:null,'attributes':_0x303154[_0xc493('0x21')]?_0x303154[_0xc493('0x21')][_0xc493('0x24')]||null:null,'include':_0x303154[_0xc493('0x21')]?_0x303154['options'][_0xc493('0x25')]?_[_0xc493('0x26')](_0x303154[_0xc493('0x21')][_0xc493('0x25')],function(_0x31bb2d){return{'model':db[_0x31bb2d[_0xc493('0x27')]],'as':_0x31bb2d['as'],'attributes':_0x31bb2d['attributes'],'include':_0x31bb2d['include']?_[_0xc493('0x26')](_0x31bb2d[_0xc493('0x25')],function(_0x268786){return{'model':db[_0x268786[_0xc493('0x27')]],'as':_0x268786['as'],'attributes':_0x268786[_0xc493('0x24')],'include':_0x268786['include']?_[_0xc493('0x26')](_0x268786[_0xc493('0x25')],function(_0x171e36){return{'model':db[_0x171e36[_0xc493('0x27')]],'as':_0x171e36['as'],'attributes':_0x171e36[_0xc493('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x557b14){logger['info'](_0xc493('0x1e'),_0x303154);logger[_0xc493('0x16')](_0xc493('0x1e'),_0x303154,JSON[_0xc493('0x18')](_0x557b14));_0x5cded2(_0x557b14);})[_0xc493('0x1d')](function(_0x302d5d){logger[_0xc493('0x19')](_0xc493('0x1e'),_0x302d5d[_0xc493('0x1a')],_0x303154);_0x3c644d(_0x1042ad['error'](0x1f4,_0x302d5d[_0xc493('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 1a81e64..79fa4a6 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 _0xbd49=['length','smsAccount:','remove','update','emit','register'];(function(_0x1c5dfc,_0x170bc7){var _0x1faadd=function(_0x61bdd0){while(--_0x61bdd0){_0x1c5dfc['push'](_0x1c5dfc['shift']());}};_0x1faadd(++_0x170bc7);}(_0xbd49,0x86));var _0x9bd4=function(_0x317543,_0x594617){_0x317543=_0x317543-0x0;var _0x14bb9b=_0xbd49[_0x317543];return _0x14bb9b;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=['save',_0x9bd4('0x0'),_0x9bd4('0x1')];function createListener(_0x35e147,_0x5871af){return function(_0x51972b){_0x5871af[_0x9bd4('0x2')](_0x35e147,_0x51972b);};}function removeListener(_0x23166b,_0x11224e){return function(){SmsAccountEvents['removeListener'](_0x23166b,_0x11224e);};}exports[_0x9bd4('0x3')]=function(_0xb3ab11){for(var _0x25567a=0x0,_0x37d2e5=events[_0x9bd4('0x4')];_0x25567a<_0x37d2e5;_0x25567a++){var _0x52b2cc=events[_0x25567a];var _0x1fcc9b=createListener(_0x9bd4('0x5')+_0x52b2cc,_0xb3ab11);SmsAccountEvents['on'](_0x52b2cc,_0x1fcc9b);}}; \ No newline at end of file +var _0xfefc=['remove','update','emit','register','./smsAccount.events','save'];(function(_0x2381fc,_0x44f3ab){var _0x136e24=function(_0x77b763){while(--_0x77b763){_0x2381fc['push'](_0x2381fc['shift']());}};_0x136e24(++_0x44f3ab);}(_0xfefc,0xfa));var _0xcfef=function(_0x5100d9,_0x4059ab){_0x5100d9=_0x5100d9-0x0;var _0x2f643d=_0xfefc[_0x5100d9];return _0x2f643d;};'use strict';var SmsAccountEvents=require(_0xcfef('0x0'));var events=[_0xcfef('0x1'),_0xcfef('0x2'),_0xcfef('0x3')];function createListener(_0x1138ed,_0x4895df){return function(_0x121015){_0x4895df[_0xcfef('0x4')](_0x1138ed,_0x121015);};}function removeListener(_0x32161d,_0x721ee8){return function(){SmsAccountEvents['removeListener'](_0x32161d,_0x721ee8);};}exports[_0xcfef('0x5')]=function(_0x501c29){for(var _0x3a4d33=0x0,_0x3f825b=events['length'];_0x3a4d33<_0x3f825b;_0x3a4d33++){var _0x1075c8=events[_0x3a4d33];var _0x5ab970=createListener('smsAccount:'+_0x1075c8,_0x501c29);SmsAccountEvents['on'](_0x1075c8,_0x5ab970);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index b224316..7c71d8c 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 _0x38fb=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put'];(function(_0x1d4449,_0x495153){var _0x4dcde3=function(_0x36d549){while(--_0x36d549){_0x1d4449['push'](_0x1d4449['shift']());}};_0x4dcde3(++_0x495153);}(_0x38fb,0xf4));var _0xb38f=function(_0x3bcf9e,_0x148a5d){_0x3bcf9e=_0x3bcf9e-0x0;var _0x1bb37c=_0x38fb[_0x3bcf9e];return _0x1bb37c;};'use strict';var multer=require(_0xb38f('0x0'));var util=require(_0xb38f('0x1'));var path=require('path');var timeout=require(_0xb38f('0x2'));var express=require(_0xb38f('0x3'));var router=express[_0xb38f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xb38f('0x5'));var config=require(_0xb38f('0x6'));var controller=require(_0xb38f('0x7'));router[_0xb38f('0x8')]('/',auth['isAuthenticated'](),controller[_0xb38f('0x9')]);router['get'](_0xb38f('0xa'),auth[_0xb38f('0xb')](),controller[_0xb38f('0xc')]);router[_0xb38f('0xd')]('/',auth[_0xb38f('0xb')](),controller[_0xb38f('0xe')]);router[_0xb38f('0xf')](_0xb38f('0xa'),auth['isAuthenticated'](),controller[_0xb38f('0x10')]);router[_0xb38f('0x11')](_0xb38f('0xa'),auth['isAuthenticated'](),controller[_0xb38f('0x12')]);module[_0xb38f('0x13')]=router; \ No newline at end of file +var _0x065e=['update','destroy','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','/:id','show','create'];(function(_0x40971c,_0x41e1c7){var _0x46c23e=function(_0x339f52){while(--_0x339f52){_0x40971c['push'](_0x40971c['shift']());}};_0x46c23e(++_0x41e1c7);}(_0x065e,0xb8));var _0xe065=function(_0x4c34a1,_0x36d67f){_0x4c34a1=_0x4c34a1-0x0;var _0x40d8ae=_0x065e[_0x4c34a1];return _0x40d8ae;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe065('0x0'));var timeout=require(_0xe065('0x1'));var express=require(_0xe065('0x2'));var router=express[_0xe065('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xe065('0x4'));var config=require(_0xe065('0x5'));var controller=require(_0xe065('0x6'));router[_0xe065('0x7')]('/',auth[_0xe065('0x8')](),controller['index']);router['get'](_0xe065('0x9'),auth[_0xe065('0x8')](),controller[_0xe065('0xa')]);router['post']('/',auth[_0xe065('0x8')](),controller[_0xe065('0xb')]);router['put'](_0xe065('0x9'),auth['isAuthenticated'](),controller[_0xe065('0xc')]);router['delete']('/:id',auth[_0xe065('0x8')](),controller[_0xe065('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 9d9ed9a..b52aca6 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 _0xe7b1=['sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x480290,_0x4974cf){var _0x18261c=function(_0x4d810e){while(--_0x4d810e){_0x480290['push'](_0x480290['shift']());}};_0x18261c(++_0x4974cf);}(_0xe7b1,0x138));var _0x1e7b=function(_0x28a072,_0x4f0f8d){_0x28a072=_0x28a072-0x0;var _0x1522cc=_0xe7b1[_0x28a072];return _0x1522cc;};'use strict';var Sequelize=require(_0x1e7b('0x0'));module[_0x1e7b('0x1')]={'priority':{'type':Sequelize[_0x1e7b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1e7b('0x3')],'allowNull':![],'defaultValue':_0x1e7b('0x4')},'appdata':{'type':Sequelize[_0x1e7b('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xb664=['STRING','*,*,*,*','sequelize','INTEGER'];(function(_0x59cd38,_0x4bfe40){var _0x51fcd6=function(_0x3886ef){while(--_0x3886ef){_0x59cd38['push'](_0x59cd38['shift']());}};_0x51fcd6(++_0x4bfe40);}(_0xb664,0xe2));var _0x4b66=function(_0x4e6747,_0x415712){_0x4e6747=_0x4e6747-0x0;var _0x15dda9=_0xb664[_0x4e6747];return _0x15dda9;};'use strict';var Sequelize=require(_0x4b66('0x0'));module['exports']={'priority':{'type':Sequelize[_0x4b66('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x4b66('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x4b66('0x2')],'defaultValue':_0x4b66('0x3')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 625e342..bdfeb51 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 _0x2025=['hasOwnProperty','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','catch','create','update','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','map','SmsApplication','fieldName','type','key','model','query','filters','intersection','attributes','fields','length'];(function(_0x413c62,_0x3cf222){var _0x204d36=function(_0x5a4259){while(--_0x5a4259){_0x413c62['push'](_0x413c62['shift']());}};_0x204d36(++_0x3cf222);}(_0x2025,0x182));var _0x5202=function(_0xe3bede,_0x409320){_0xe3bede=_0xe3bede-0x0;var _0x4b62d9=_0x2025[_0xe3bede];return _0x4b62d9;};'use strict';var pdf=require(_0x5202('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5202('0x1'));var zipdir=require(_0x5202('0x2'));var jsonpatch=require(_0x5202('0x3'));var rp=require(_0x5202('0x4'));var moment=require(_0x5202('0x5'));var BPromise=require(_0x5202('0x6'));var Mustache=require(_0x5202('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5202('0x8'));var fs=require('fs');var _=require(_0x5202('0x9'));var squel=require(_0x5202('0xa'));var crypto=require(_0x5202('0xb'));var jsforce=require(_0x5202('0xc'));var deskjs=require(_0x5202('0xd'));var toCsv=require(_0x5202('0xe'));var querystring=require('querystring');var Papa=require(_0x5202('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5202('0x10'));var as=require(_0x5202('0x11'));var hardwareService=require(_0x5202('0x12'));var logger=require(_0x5202('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x5202('0x14'));var db=require(_0x5202('0x15'))['db'];function respondWithStatusCode(_0x116ed2,_0x489f0f){_0x489f0f=_0x489f0f||0xcc;return function(_0x3144d9){if(_0x3144d9){return _0x116ed2['sendStatus'](_0x489f0f);}return _0x116ed2[_0x5202('0x16')](_0x489f0f)[_0x5202('0x17')]();};}function respondWithResult(_0x4423bf,_0x8ef67c){_0x8ef67c=_0x8ef67c||0xc8;return function(_0x4a3ad2){if(_0x4a3ad2){return _0x4423bf[_0x5202('0x16')](_0x8ef67c)[_0x5202('0x18')](_0x4a3ad2);}};}function respondWithFilteredResult(_0x2a0078,_0x58453c){return function(_0x2fe0a1){if(_0x2fe0a1){var _0x34bedd=_0x2fe0a1[_0x5202('0x19')],_0x775f02=_0x58453c[_0x5202('0x1a')],_0x592729=_0x58453c['offset']+_0x58453c[_0x5202('0x1b')],_0x53592d;if(_0x592729>=_0x34bedd){_0x592729=_0x34bedd;_0x53592d=0xc8;}else{_0x53592d=0xce;}_0x2a0078[_0x5202('0x16')](_0x53592d);return _0x2a0078[_0x5202('0x1c')](_0x5202('0x1d'),_0x775f02+'-'+_0x592729+'/'+_0x34bedd)[_0x5202('0x18')](_0x2fe0a1);}return null;};}function patchUpdates(_0x517361){return function(_0x1107d){try{jsonpatch[_0x5202('0x1e')](_0x1107d,_0x517361,!![]);}catch(_0xfaee94){return BPromise[_0x5202('0x1f')](_0xfaee94);}return _0x1107d[_0x5202('0x20')]();};}function saveUpdates(_0xfce4a1,_0x9b479b){return function(_0x2415b4){if(_0x2415b4){return _0x2415b4['update'](_0xfce4a1)['then'](function(_0x5b672e){return _0x5b672e;});}return null;};}function removeEntity(_0x47245a,_0x469ef3){return function(_0x56acba){if(_0x56acba){return _0x56acba[_0x5202('0x21')]()[_0x5202('0x22')](function(){_0x47245a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16d6f5,_0x588c20){return function(_0x56e5b3){if(!_0x56e5b3){_0x16d6f5[_0x5202('0x23')](0x194);}return _0x56e5b3;};}function handleError(_0x3331d9,_0x45485e){_0x45485e=_0x45485e||0x1f4;return function(_0x236ebb){logger[_0x5202('0x24')](_0x236ebb[_0x5202('0x25')]);if(_0x236ebb[_0x5202('0x26')]){delete _0x236ebb[_0x5202('0x26')];}_0x3331d9['status'](_0x45485e)[_0x5202('0x27')](_0x236ebb);};}exports['index']=function(_0x4cef7c,_0x44a630){var _0x245493={},_0x5d3657={},_0x2737b6={'count':0x0,'rows':[]};var _0x1d2e07=_[_0x5202('0x28')](db[_0x5202('0x29')]['rawAttributes'],function(_0x53a187){return{'name':_0x53a187[_0x5202('0x2a')],'type':_0x53a187[_0x5202('0x2b')][_0x5202('0x2c')]};});_0x5d3657[_0x5202('0x2d')]=_['map'](_0x1d2e07,_0x5202('0x26'));_0x5d3657['query']=_['keys'](_0x4cef7c[_0x5202('0x2e')]);_0x5d3657[_0x5202('0x2f')]=_[_0x5202('0x30')](_0x5d3657[_0x5202('0x2d')],_0x5d3657[_0x5202('0x2e')]);_0x245493[_0x5202('0x31')]=_[_0x5202('0x30')](_0x5d3657[_0x5202('0x2d')],qs[_0x5202('0x32')](_0x4cef7c[_0x5202('0x2e')]['fields']));_0x245493[_0x5202('0x31')]=_0x245493[_0x5202('0x31')][_0x5202('0x33')]?_0x245493[_0x5202('0x31')]:_0x5d3657['model'];if(!_0x4cef7c[_0x5202('0x2e')][_0x5202('0x34')]('nolimit')){_0x245493[_0x5202('0x1b')]=qs['limit'](_0x4cef7c[_0x5202('0x2e')]['limit']);_0x245493[_0x5202('0x1a')]=qs[_0x5202('0x1a')](_0x4cef7c[_0x5202('0x2e')]['offset']);}_0x245493[_0x5202('0x35')]=qs[_0x5202('0x36')](_0x4cef7c[_0x5202('0x2e')][_0x5202('0x36')]);_0x245493['where']=qs[_0x5202('0x2f')](_['pick'](_0x4cef7c[_0x5202('0x2e')],_0x5d3657[_0x5202('0x2f')]));if(_0x4cef7c[_0x5202('0x2e')][_0x5202('0x37')]){_0x245493['where']=_['merge'](_0x245493[_0x5202('0x38')],{'$or':_[_0x5202('0x28')](_0x1d2e07,function(_0x2e9877){if(_0x2e9877[_0x5202('0x2b')]!==_0x5202('0x39')){var _0x42bb60={};_0x42bb60[_0x2e9877[_0x5202('0x26')]]={'$like':'%'+_0x4cef7c[_0x5202('0x2e')]['filter']+'%'};return _0x42bb60;}})});}_0x245493=_[_0x5202('0x3a')]({},_0x245493,_0x4cef7c[_0x5202('0x3b')]);var _0x443e41={'where':_0x245493[_0x5202('0x38')]};return db[_0x5202('0x29')][_0x5202('0x19')](_0x443e41)['then'](function(_0x504348){_0x2737b6[_0x5202('0x19')]=_0x504348;if(_0x4cef7c[_0x5202('0x2e')][_0x5202('0x3c')]){_0x245493[_0x5202('0x3d')]=[{'all':!![]}];}return db[_0x5202('0x29')][_0x5202('0x3e')](_0x245493);})['then'](function(_0x3dc747){_0x2737b6[_0x5202('0x3f')]=_0x3dc747;return _0x2737b6;})[_0x5202('0x22')](respondWithFilteredResult(_0x44a630,_0x245493))['catch'](handleError(_0x44a630,null));};exports[_0x5202('0x40')]=function(_0xb51a87,_0x348e37){var _0x3abd3c={'raw':!![],'where':{'id':_0xb51a87[_0x5202('0x41')]['id']}},_0x3d311d={};_0x3d311d[_0x5202('0x2d')]=_[_0x5202('0x42')](db[_0x5202('0x29')][_0x5202('0x43')]);_0x3d311d['query']=_['keys'](_0xb51a87[_0x5202('0x2e')]);_0x3d311d[_0x5202('0x2f')]=_['intersection'](_0x3d311d[_0x5202('0x2d')],_0x3d311d['query']);_0x3abd3c[_0x5202('0x31')]=_[_0x5202('0x30')](_0x3d311d['model'],qs[_0x5202('0x32')](_0xb51a87[_0x5202('0x2e')][_0x5202('0x32')]));_0x3abd3c['attributes']=_0x3abd3c['attributes'][_0x5202('0x33')]?_0x3abd3c[_0x5202('0x31')]:_0x3d311d[_0x5202('0x2d')];if(_0xb51a87[_0x5202('0x2e')][_0x5202('0x3c')]){_0x3abd3c[_0x5202('0x3d')]=[{'all':!![]}];}_0x3abd3c=_['merge']({},_0x3abd3c,_0xb51a87[_0x5202('0x3b')]);return db[_0x5202('0x29')][_0x5202('0x44')](_0x3abd3c)['then'](handleEntityNotFound(_0x348e37,null))[_0x5202('0x22')](respondWithResult(_0x348e37,null))[_0x5202('0x45')](handleError(_0x348e37,null));};exports[_0x5202('0x46')]=function(_0x3aa8db,_0x55b189){return db['SmsApplication'][_0x5202('0x46')](_0x3aa8db['body'],{})[_0x5202('0x22')](respondWithResult(_0x55b189,0xc9))[_0x5202('0x45')](handleError(_0x55b189,null));};exports[_0x5202('0x47')]=function(_0x3cc28c,_0x2526c1){if(_0x3cc28c[_0x5202('0x48')]['id']){delete _0x3cc28c['body']['id'];}return db[_0x5202('0x29')][_0x5202('0x44')]({'where':{'id':_0x3cc28c[_0x5202('0x41')]['id']}})[_0x5202('0x22')](handleEntityNotFound(_0x2526c1,null))[_0x5202('0x22')](saveUpdates(_0x3cc28c[_0x5202('0x48')],null))['then'](respondWithResult(_0x2526c1,null))[_0x5202('0x45')](handleError(_0x2526c1,null));};exports[_0x5202('0x21')]=function(_0x2b8296,_0x1b1bac){return db['SmsApplication'][_0x5202('0x44')]({'where':{'id':_0x2b8296['params']['id']}})[_0x5202('0x22')](handleEntityNotFound(_0x1b1bac,null))[_0x5202('0x22')](removeEntity(_0x1b1bac,null))['catch'](handleError(_0x1b1bac,null));}; \ No newline at end of file +var _0x82aa=['then','destroy','stack','name','index','map','SmsApplication','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','show','params','rawAttributes','keys','include','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update'];(function(_0x12bce7,_0x48f9e7){var _0x4ad611=function(_0x3cefd4){while(--_0x3cefd4){_0x12bce7['push'](_0x12bce7['shift']());}};_0x4ad611(++_0x48f9e7);}(_0x82aa,0xff));var _0xa82a=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x82aa[_0x502c7d];return _0x30b7ed;};'use strict';var pdf=require(_0xa82a('0x0'));var emlformat=require(_0xa82a('0x1'));var rimraf=require(_0xa82a('0x2'));var zipdir=require(_0xa82a('0x3'));var jsonpatch=require(_0xa82a('0x4'));var rp=require(_0xa82a('0x5'));var moment=require(_0xa82a('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xa82a('0x7'));var util=require(_0xa82a('0x8'));var path=require(_0xa82a('0x9'));var sox=require(_0xa82a('0xa'));var csv=require('to-csv');var ejs=require(_0xa82a('0xb'));var fs=require('fs');var _=require(_0xa82a('0xc'));var squel=require(_0xa82a('0xd'));var crypto=require(_0xa82a('0xe'));var jsforce=require(_0xa82a('0xf'));var deskjs=require(_0xa82a('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa82a('0x11'));var Redis=require(_0xa82a('0x12'));var authService=require(_0xa82a('0x13'));var qs=require(_0xa82a('0x14'));var as=require(_0xa82a('0x15'));var hardwareService=require(_0xa82a('0x16'));var logger=require(_0xa82a('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xa82a('0x18'))['db'];function respondWithStatusCode(_0x36ef0e,_0x30ad15){_0x30ad15=_0x30ad15||0xcc;return function(_0xa5e7d8){if(_0xa5e7d8){return _0x36ef0e[_0xa82a('0x19')](_0x30ad15);}return _0x36ef0e[_0xa82a('0x1a')](_0x30ad15)[_0xa82a('0x1b')]();};}function respondWithResult(_0x2ba0ee,_0x3fa8ad){_0x3fa8ad=_0x3fa8ad||0xc8;return function(_0x261597){if(_0x261597){return _0x2ba0ee['status'](_0x3fa8ad)[_0xa82a('0x1c')](_0x261597);}};}function respondWithFilteredResult(_0x2c80f1,_0x2e9829){return function(_0x36e124){if(_0x36e124){var _0x33297b=_0x36e124[_0xa82a('0x1d')],_0x3a4980=_0x2e9829[_0xa82a('0x1e')],_0x14b6ce=_0x2e9829['offset']+_0x2e9829[_0xa82a('0x1f')],_0x261c24;if(_0x14b6ce>=_0x33297b){_0x14b6ce=_0x33297b;_0x261c24=0xc8;}else{_0x261c24=0xce;}_0x2c80f1[_0xa82a('0x1a')](_0x261c24);return _0x2c80f1['set'](_0xa82a('0x20'),_0x3a4980+'-'+_0x14b6ce+'/'+_0x33297b)[_0xa82a('0x1c')](_0x36e124);}return null;};}function patchUpdates(_0x1a570a){return function(_0xa8ddcc){try{jsonpatch[_0xa82a('0x21')](_0xa8ddcc,_0x1a570a,!![]);}catch(_0x37def1){return BPromise[_0xa82a('0x22')](_0x37def1);}return _0xa8ddcc[_0xa82a('0x23')]();};}function saveUpdates(_0x547f3d,_0x4fd103){return function(_0x35b57e){if(_0x35b57e){return _0x35b57e[_0xa82a('0x24')](_0x547f3d)[_0xa82a('0x25')](function(_0x580ee2){return _0x580ee2;});}return null;};}function removeEntity(_0x5b5ed4,_0x24361b){return function(_0x17255c){if(_0x17255c){return _0x17255c[_0xa82a('0x26')]()['then'](function(){_0x5b5ed4['status'](0xcc)[_0xa82a('0x1b')]();});}};}function handleEntityNotFound(_0x2c9503,_0x26d377){return function(_0x55f6d6){if(!_0x55f6d6){_0x2c9503[_0xa82a('0x19')](0x194);}return _0x55f6d6;};}function handleError(_0x56c8b0,_0x236310){_0x236310=_0x236310||0x1f4;return function(_0x23e03f){logger['error'](_0x23e03f[_0xa82a('0x27')]);if(_0x23e03f[_0xa82a('0x28')]){delete _0x23e03f[_0xa82a('0x28')];}_0x56c8b0[_0xa82a('0x1a')](_0x236310)['send'](_0x23e03f);};}exports[_0xa82a('0x29')]=function(_0x4f112c,_0x37243f){var _0x118983={},_0x1d6934={},_0x511237={'count':0x0,'rows':[]};var _0x5f5290=_[_0xa82a('0x2a')](db[_0xa82a('0x2b')]['rawAttributes'],function(_0x18d518){return{'name':_0x18d518[_0xa82a('0x2c')],'type':_0x18d518['type']['key']};});_0x1d6934[_0xa82a('0x2d')]=_[_0xa82a('0x2a')](_0x5f5290,'name');_0x1d6934[_0xa82a('0x2e')]=_['keys'](_0x4f112c[_0xa82a('0x2e')]);_0x1d6934[_0xa82a('0x2f')]=_[_0xa82a('0x30')](_0x1d6934[_0xa82a('0x2d')],_0x1d6934[_0xa82a('0x2e')]);_0x118983['attributes']=_[_0xa82a('0x30')](_0x1d6934['model'],qs[_0xa82a('0x31')](_0x4f112c[_0xa82a('0x2e')][_0xa82a('0x31')]));_0x118983[_0xa82a('0x32')]=_0x118983[_0xa82a('0x32')][_0xa82a('0x33')]?_0x118983['attributes']:_0x1d6934[_0xa82a('0x2d')];if(!_0x4f112c[_0xa82a('0x2e')][_0xa82a('0x34')](_0xa82a('0x35'))){_0x118983[_0xa82a('0x1f')]=qs[_0xa82a('0x1f')](_0x4f112c[_0xa82a('0x2e')]['limit']);_0x118983[_0xa82a('0x1e')]=qs[_0xa82a('0x1e')](_0x4f112c[_0xa82a('0x2e')][_0xa82a('0x1e')]);}_0x118983[_0xa82a('0x36')]=qs[_0xa82a('0x37')](_0x4f112c[_0xa82a('0x2e')][_0xa82a('0x37')]);_0x118983[_0xa82a('0x38')]=qs[_0xa82a('0x2f')](_[_0xa82a('0x39')](_0x4f112c[_0xa82a('0x2e')],_0x1d6934[_0xa82a('0x2f')]));if(_0x4f112c[_0xa82a('0x2e')][_0xa82a('0x3a')]){_0x118983['where']=_[_0xa82a('0x3b')](_0x118983['where'],{'$or':_[_0xa82a('0x2a')](_0x5f5290,function(_0x3e8509){if(_0x3e8509[_0xa82a('0x3c')]!==_0xa82a('0x3d')){var _0xba1d15={};_0xba1d15[_0x3e8509[_0xa82a('0x28')]]={'$like':'%'+_0x4f112c[_0xa82a('0x2e')][_0xa82a('0x3a')]+'%'};return _0xba1d15;}})});}_0x118983=_[_0xa82a('0x3b')]({},_0x118983,_0x4f112c[_0xa82a('0x3e')]);var _0x2e51ba={'where':_0x118983[_0xa82a('0x38')]};return db[_0xa82a('0x2b')]['count'](_0x2e51ba)[_0xa82a('0x25')](function(_0x585f12){_0x511237[_0xa82a('0x1d')]=_0x585f12;if(_0x4f112c[_0xa82a('0x2e')][_0xa82a('0x3f')]){_0x118983['include']=[{'all':!![]}];}return db['SmsApplication']['findAll'](_0x118983);})[_0xa82a('0x25')](function(_0x4a35bb){_0x511237['rows']=_0x4a35bb;return _0x511237;})[_0xa82a('0x25')](respondWithFilteredResult(_0x37243f,_0x118983))['catch'](handleError(_0x37243f,null));};exports[_0xa82a('0x40')]=function(_0x7ab2dd,_0x33b27a){var _0x4f6545={'raw':!![],'where':{'id':_0x7ab2dd[_0xa82a('0x41')]['id']}},_0x53f1d6={};_0x53f1d6['model']=_['keys'](db[_0xa82a('0x2b')][_0xa82a('0x42')]);_0x53f1d6[_0xa82a('0x2e')]=_[_0xa82a('0x43')](_0x7ab2dd['query']);_0x53f1d6[_0xa82a('0x2f')]=_[_0xa82a('0x30')](_0x53f1d6[_0xa82a('0x2d')],_0x53f1d6['query']);_0x4f6545[_0xa82a('0x32')]=_[_0xa82a('0x30')](_0x53f1d6[_0xa82a('0x2d')],qs['fields'](_0x7ab2dd[_0xa82a('0x2e')][_0xa82a('0x31')]));_0x4f6545[_0xa82a('0x32')]=_0x4f6545[_0xa82a('0x32')][_0xa82a('0x33')]?_0x4f6545[_0xa82a('0x32')]:_0x53f1d6['model'];if(_0x7ab2dd[_0xa82a('0x2e')][_0xa82a('0x3f')]){_0x4f6545[_0xa82a('0x44')]=[{'all':!![]}];}_0x4f6545=_[_0xa82a('0x3b')]({},_0x4f6545,_0x7ab2dd['options']);return db[_0xa82a('0x2b')][_0xa82a('0x45')](_0x4f6545)['then'](handleEntityNotFound(_0x33b27a,null))[_0xa82a('0x25')](respondWithResult(_0x33b27a,null))[_0xa82a('0x46')](handleError(_0x33b27a,null));};exports[_0xa82a('0x47')]=function(_0x2d86d7,_0x111f9d){return db['SmsApplication'][_0xa82a('0x47')](_0x2d86d7[_0xa82a('0x48')],{})[_0xa82a('0x25')](respondWithResult(_0x111f9d,0xc9))[_0xa82a('0x46')](handleError(_0x111f9d,null));};exports[_0xa82a('0x24')]=function(_0x521537,_0x8d5f5a){if(_0x521537[_0xa82a('0x48')]['id']){delete _0x521537['body']['id'];}return db[_0xa82a('0x2b')][_0xa82a('0x45')]({'where':{'id':_0x521537['params']['id']}})['then'](handleEntityNotFound(_0x8d5f5a,null))[_0xa82a('0x25')](saveUpdates(_0x521537['body'],null))[_0xa82a('0x25')](respondWithResult(_0x8d5f5a,null))[_0xa82a('0x46')](handleError(_0x8d5f5a,null));};exports[_0xa82a('0x26')]=function(_0x5d1100,_0x2ea697){return db[_0xa82a('0x2b')]['find']({'where':{'id':_0x5d1100['params']['id']}})[_0xa82a('0x25')](handleEntityNotFound(_0x2ea697,null))['then'](removeEntity(_0x2ea697,null))['catch'](handleError(_0x2ea697,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 008ca41..b67a4d9 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 _0xac58=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util'];(function(_0x297df8,_0x14a1b3){var _0x384d86=function(_0x54cc99){while(--_0x54cc99){_0x297df8['push'](_0x297df8['shift']());}};_0x384d86(++_0x14a1b3);}(_0xac58,0x16a));var _0x8ac5=function(_0x37e4b7,_0x5aaa78){_0x37e4b7=_0x37e4b7-0x0;var _0x3af170=_0xac58[_0x37e4b7];return _0x3af170;};'use strict';var _=require(_0x8ac5('0x0'));var util=require(_0x8ac5('0x1'));var logger=require(_0x8ac5('0x2'))(_0x8ac5('0x3'));var moment=require(_0x8ac5('0x4'));var BPromise=require(_0x8ac5('0x5'));var rp=require(_0x8ac5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8ac5('0x7'));var attributes=require(_0x8ac5('0x8'));module[_0x8ac5('0x9')]=function(_0x107b16,_0x57ee7d){return _0x107b16[_0x8ac5('0xa')](_0x8ac5('0xb'),attributes,{'tableName':_0x8ac5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8ac5('0xd')});}; \ No newline at end of file +var _0x9b60=['request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9b60,0x1eb));var _0x09b6=function(_0x6980ca,_0x18ebee){_0x6980ca=_0x6980ca-0x0;var _0x507e9f=_0x9b60[_0x6980ca];return _0x507e9f;};'use strict';var _=require(_0x09b6('0x0'));var util=require(_0x09b6('0x1'));var logger=require('../../config/logger')(_0x09b6('0x2'));var moment=require(_0x09b6('0x3'));var BPromise=require(_0x09b6('0x4'));var rp=require(_0x09b6('0x5'));var fs=require('fs');var path=require(_0x09b6('0x6'));var rimraf=require(_0x09b6('0x7'));var config=require(_0x09b6('0x8'));var attributes=require(_0x09b6('0x9'));module[_0x09b6('0xa')]=function(_0x25478d,_0x5d065b){return _0x25478d[_0x09b6('0xb')](_0x09b6('0xc'),attributes,{'tableName':_0x09b6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x09b6('0xe'),'collate':_0x09b6('0xf')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 1ff4d3a..4627178 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 _0x0d4d=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','lodash','util'];(function(_0x302887,_0x573caf){var _0x3141bd=function(_0x48b5e2){while(--_0x48b5e2){_0x302887['push'](_0x302887['shift']());}};_0x3141bd(++_0x573caf);}(_0x0d4d,0x132));var _0xd0d4=function(_0x42aa52,_0x5b2cbd){_0x42aa52=_0x42aa52-0x0;var _0x4c499a=_0x0d4d[_0x42aa52];return _0x4c499a;};'use strict';var _=require(_0xd0d4('0x0'));var util=require(_0xd0d4('0x1'));var moment=require(_0xd0d4('0x2'));var BPromise=require(_0xd0d4('0x3'));var rs=require(_0xd0d4('0x4'));var fs=require('fs');var Redis=require(_0xd0d4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd0d4('0x6'));var logger=require('../../config/logger')(_0xd0d4('0x7'));var config=require(_0xd0d4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd0d4('0x9')][_0xd0d4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c5d01,_0x5c8c7b,_0x5bfae8){return new BPromise(function(_0x5403c0,_0x3fdd50){return client['request'](_0x1c5d01,_0x5bfae8)[_0xd0d4('0xb')](function(_0x314cd5){logger[_0xd0d4('0xc')]('SmsApplication,\x20%s,\x20%s',_0x5c8c7b,_0xd0d4('0xd'));logger[_0xd0d4('0xe')](_0xd0d4('0xf'),_0x5c8c7b,_0xd0d4('0xd'),JSON[_0xd0d4('0x10')](_0x314cd5));if(_0x314cd5[_0xd0d4('0x11')]){if(_0x314cd5['error'][_0xd0d4('0x12')]===0x1f4){logger[_0xd0d4('0x11')](_0xd0d4('0x13'),_0x5c8c7b,_0x314cd5[_0xd0d4('0x11')][_0xd0d4('0x14')]);return _0x3fdd50(_0x314cd5[_0xd0d4('0x11')]['message']);}logger[_0xd0d4('0x11')](_0xd0d4('0x13'),_0x5c8c7b,_0x314cd5[_0xd0d4('0x11')]['message']);return _0x5403c0(_0x314cd5['error'][_0xd0d4('0x14')]);}else{logger[_0xd0d4('0xc')]('SmsApplication,\x20%s,\x20%s',_0x5c8c7b,_0xd0d4('0xd'));_0x5403c0(_0x314cd5[_0xd0d4('0x15')]['message']);}})['catch'](function(_0x1b64f){logger[_0xd0d4('0x11')](_0xd0d4('0x13'),_0x5c8c7b,_0x1b64f);_0x3fdd50(_0x1b64f);});});} \ No newline at end of file +var _0x5e17=['message','SmsApplication,\x20%s,\x20%s','result','catch','lodash','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x1ea83e,_0x1cee11){var _0x4242d3=function(_0x5a1c17){while(--_0x5a1c17){_0x1ea83e['push'](_0x1ea83e['shift']());}};_0x4242d3(++_0x1cee11);}(_0x5e17,0x17a));var _0x75e1=function(_0x482f03,_0x54d3a3){_0x482f03=_0x482f03-0x0;var _0x1b681c=_0x5e17[_0x482f03];return _0x1b681c;};'use strict';var _=require(_0x75e1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x75e1('0x1'))['db'];var utils=require(_0x75e1('0x2'));var logger=require(_0x75e1('0x3'))(_0x75e1('0x4'));var config=require(_0x75e1('0x5'));var jayson=require(_0x75e1('0x6'));var client=jayson[_0x75e1('0x7')][_0x75e1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb1af59,_0x36e724,_0x689ac3){return new BPromise(function(_0x1eecde,_0x23fab8){return client[_0x75e1('0x9')](_0xb1af59,_0x689ac3)[_0x75e1('0xa')](function(_0x57e230){logger[_0x75e1('0xb')]('SmsApplication,\x20%s,\x20%s',_0x36e724,'request\x20sent');logger[_0x75e1('0xc')](_0x75e1('0xd'),_0x36e724,_0x75e1('0xe'),JSON[_0x75e1('0xf')](_0x57e230));if(_0x57e230[_0x75e1('0x10')]){if(_0x57e230[_0x75e1('0x10')][_0x75e1('0x11')]===0x1f4){logger[_0x75e1('0x10')]('SmsApplication,\x20%s,\x20%s',_0x36e724,_0x57e230[_0x75e1('0x10')][_0x75e1('0x12')]);return _0x23fab8(_0x57e230[_0x75e1('0x10')]['message']);}logger[_0x75e1('0x10')](_0x75e1('0x13'),_0x36e724,_0x57e230[_0x75e1('0x10')][_0x75e1('0x12')]);return _0x1eecde(_0x57e230['error'][_0x75e1('0x12')]);}else{logger[_0x75e1('0xb')](_0x75e1('0x13'),_0x36e724,_0x75e1('0xe'));_0x1eecde(_0x57e230[_0x75e1('0x14')][_0x75e1('0x12')]);}})[_0x75e1('0x15')](function(_0x56c741){logger[_0x75e1('0x10')](_0x75e1('0x13'),_0x36e724,_0x56c741);_0x23fab8(_0x56c741);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index ed23830..c75cb78 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 _0xafcb=['/:id/tags','tracked','put','smsinteraction:update','delete','smsinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','/describe','isAuthenticated','/:id','getMessages','/:id/download','download','post','create','/:id/messages','addMessage'];(function(_0x35dfe6,_0x4244fa){var _0x59651c=function(_0x3ff137){while(--_0x3ff137){_0x35dfe6['push'](_0x35dfe6['shift']());}};_0x59651c(++_0x4244fa);}(_0xafcb,0xb6));var _0xbafc=function(_0x780193,_0x29399d){_0x780193=_0x780193-0x0;var _0x5f51a4=_0xafcb[_0x780193];return _0x5f51a4;};'use strict';var multer=require(_0xbafc('0x0'));var util=require(_0xbafc('0x1'));var path=require(_0xbafc('0x2'));var timeout=require(_0xbafc('0x3'));var express=require(_0xbafc('0x4'));var router=express[_0xbafc('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xbafc('0x6'));var config=require(_0xbafc('0x7'));var controller=require(_0xbafc('0x8'));router[_0xbafc('0x9')]('/',auth['isAuthenticated'](),controller[_0xbafc('0xa')]);router[_0xbafc('0x9')](_0xbafc('0xb'),auth[_0xbafc('0xc')](),controller['describe']);router[_0xbafc('0x9')](_0xbafc('0xd'),auth[_0xbafc('0xc')](),controller['show']);router[_0xbafc('0x9')]('/:id/messages',auth[_0xbafc('0xc')](),controller[_0xbafc('0xe')]);router[_0xbafc('0x9')](_0xbafc('0xf'),auth[_0xbafc('0xc')](),controller[_0xbafc('0x10')]);router[_0xbafc('0x11')]('/',auth['isAuthenticated'](),controller[_0xbafc('0x12')]);router[_0xbafc('0x11')](_0xbafc('0x13'),auth[_0xbafc('0xc')](),controller[_0xbafc('0x14')]);router['post'](_0xbafc('0x15'),auth['isAuthenticated'](),interaction[_0xbafc('0x16')]('sms','smsinteraction:addtags'),controller['addTags']);router[_0xbafc('0x17')](_0xbafc('0xd'),auth['isAuthenticated'](),interaction[_0xbafc('0x16')]('sms',_0xbafc('0x18')),controller['update']);router[_0xbafc('0x19')]('/:id',auth[_0xbafc('0xc')](),interaction[_0xbafc('0x16')]('sms',_0xbafc('0x1a')),controller['destroy']);router[_0xbafc('0x19')](_0xbafc('0x15'),auth[_0xbafc('0xc')](),controller[_0xbafc('0x1b')]);module[_0xbafc('0x1c')]=router; \ No newline at end of file +var _0x639a=['get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','download','create','addMessage','post','/:id/tags','tracked','smsinteraction:addtags','addTags','put','sms','smsinteraction:update','update','smsinteraction:destroy','destroy','delete','removeTags','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./smsInteraction.controller'];(function(_0x3cc115,_0xabbcb7){var _0x4e93eb=function(_0x5e54f4){while(--_0x5e54f4){_0x3cc115['push'](_0x3cc115['shift']());}};_0x4e93eb(++_0xabbcb7);}(_0x639a,0x1e8));var _0xa639=function(_0x233e98,_0x12c402){_0x233e98=_0x233e98-0x0;var _0xd2200f=_0x639a[_0x233e98];return _0xd2200f;};'use strict';var multer=require(_0xa639('0x0'));var util=require(_0xa639('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa639('0x2'));var router=express[_0xa639('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xa639('0x4'));var config=require(_0xa639('0x5'));var controller=require(_0xa639('0x6'));router[_0xa639('0x7')]('/',auth['isAuthenticated'](),controller[_0xa639('0x8')]);router['get'](_0xa639('0x9'),auth[_0xa639('0xa')](),controller[_0xa639('0xb')]);router[_0xa639('0x7')](_0xa639('0xc'),auth['isAuthenticated'](),controller[_0xa639('0xd')]);router[_0xa639('0x7')](_0xa639('0xe'),auth['isAuthenticated'](),controller[_0xa639('0xf')]);router[_0xa639('0x7')]('/:id/download',auth[_0xa639('0xa')](),controller[_0xa639('0x10')]);router['post']('/',auth[_0xa639('0xa')](),controller[_0xa639('0x11')]);router['post'](_0xa639('0xe'),auth[_0xa639('0xa')](),controller[_0xa639('0x12')]);router[_0xa639('0x13')](_0xa639('0x14'),auth[_0xa639('0xa')](),interaction[_0xa639('0x15')]('sms',_0xa639('0x16')),controller[_0xa639('0x17')]);router[_0xa639('0x18')](_0xa639('0xc'),auth[_0xa639('0xa')](),interaction[_0xa639('0x15')](_0xa639('0x19'),_0xa639('0x1a')),controller[_0xa639('0x1b')]);router['delete'](_0xa639('0xc'),auth[_0xa639('0xa')](),interaction['tracked'](_0xa639('0x19'),_0xa639('0x1c')),controller[_0xa639('0x1d')]);router[_0xa639('0x1e')]('/:id/tags',auth[_0xa639('0xa')](),controller[_0xa639('0x1f')]);module[_0xa639('0x20')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 3412822..09cd60a 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 _0xcb91=['exports','BOOLEAN','DATE','STRING','out'];(function(_0x568e3a,_0x2026b0){var _0x40a13d=function(_0x125fb7){while(--_0x125fb7){_0x568e3a['push'](_0x568e3a['shift']());}};_0x40a13d(++_0x2026b0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1acc2d,_0x597696){_0x1acc2d=_0x1acc2d-0x0;var _0xabfa6d=_0xcb91[_0x1acc2d];return _0xabfa6d;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x1cb9('0x0')]={'closed':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1cb9('0x2')]},'disposition':{'type':Sequelize[_0x1cb9('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x1cb9('0x3')]},'read1stAt':{'type':Sequelize[_0x1cb9('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x1cb9('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1cb9('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x1cb9('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xb10b=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x3ceff5,_0x2bfbc6){var _0x5828b6=function(_0x3a9b3a){while(--_0x3a9b3a){_0x3ceff5['push'](_0x3ceff5['shift']());}};_0x5828b6(++_0x2bfbc6);}(_0xb10b,0x12a));var _0xbb10=function(_0x2606e7,_0xcbe32c){_0x2606e7=_0x2606e7-0x0;var _0x56d2b6=_0xb10b[_0x2606e7];return _0x56d2b6;};'use strict';var Sequelize=require(_0xbb10('0x0'));var moment=require('moment');module[_0xbb10('0x1')]={'closed':{'type':Sequelize[_0xbb10('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbb10('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xbb10('0x4')]},'phone':{'type':Sequelize[_0xbb10('0x4')]},'read1stAt':{'type':Sequelize[_0xbb10('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xbb10('0x5')]('in',_0xbb10('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbb10('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xbb10('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 6c8c75b..641922c 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 _0x82c4=['closedAt','disposition','direction','out','secret','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','stack','name','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','rawAttributes','fieldName','key','model','keys','filters','attributes','intersection','fields','query','hasOwnProperty','nolimit','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','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20=\x200','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','SmsAccountId','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','order','isEmpty','resolve','journey','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','count','merge','SmsInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','o.internal','Owner.internal','groupBy','all','rows','show','include','options','params','describe','addMessage','ids','omit','findOne','SmsMessage','SmsInteractionId','YYYY-MM-DD\x20HH:mm:ss','includeAll','addTags','setTags','spread','smsInteractionTags:save','removeTags','download','join','files','root','server','format','transcript-%d-%s.zip','User','CmContact','Contact','firstName','lastName','Messages','Owner','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
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','Account','N.A.'];(function(_0x1acc01,_0x5cb80c){var _0x5603f1=function(_0x5e7558){while(--_0x5e7558){_0x1acc01['push'](_0x1acc01['shift']());}};_0x5603f1(++_0x5cb80c);}(_0x82c4,0x1ca));var _0x482c=function(_0x25c934,_0x1531e6){_0x25c934=_0x25c934-0x0;var _0x22806e=_0x82c4[_0x25c934];return _0x22806e;};'use strict';var pdf=require(_0x482c('0x0'));var emlformat=require(_0x482c('0x1'));var rimraf=require(_0x482c('0x2'));var zipdir=require(_0x482c('0x3'));var jsonpatch=require(_0x482c('0x4'));var rp=require(_0x482c('0x5'));var moment=require(_0x482c('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x482c('0x7'));var util=require('util');var path=require(_0x482c('0x8'));var sox=require('sox');var csv=require(_0x482c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x482c('0xa'));var squel=require(_0x482c('0xb'));var crypto=require(_0x482c('0xc'));var jsforce=require(_0x482c('0xd'));var deskjs=require(_0x482c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x482c('0xf'));var Papa=require(_0x482c('0x10'));var Redis=require(_0x482c('0x11'));var authService=require(_0x482c('0x12'));var qs=require(_0x482c('0x13'));var as=require(_0x482c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x482c('0x15'))(_0x482c('0x16'));var utils=require(_0x482c('0x17'));var config=require('../../config/environment');var db=require(_0x482c('0x18'))['db'];config[_0x482c('0x19')]=_[_0x482c('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x482c('0x1b'))(new Redis(config[_0x482c('0x19')]));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x14452b,_0xe3f853){_0xe3f853=_0xe3f853||0xcc;return function(_0x46016e){if(_0x46016e){return _0x14452b[_0x482c('0x1c')](_0xe3f853);}return _0x14452b[_0x482c('0x1d')](_0xe3f853)[_0x482c('0x1e')]();};}function respondWithResult(_0x3beedb,_0xf65563){_0xf65563=_0xf65563||0xc8;return function(_0x3fc79c){if(_0x3fc79c){return _0x3beedb[_0x482c('0x1d')](_0xf65563)[_0x482c('0x1f')](_0x3fc79c);}};}function respondWithFilteredResult(_0xedaee0,_0x4bdf15){return function(_0x244bb9){if(_0x244bb9){var _0x5b6f7e=_0x244bb9['count'],_0x3aed45=_0x4bdf15[_0x482c('0x20')],_0x258148=_0x4bdf15['offset']+_0x4bdf15[_0x482c('0x21')],_0x4af05a;if(_0x258148>=_0x5b6f7e){_0x258148=_0x5b6f7e;_0x4af05a=0xc8;}else{_0x4af05a=0xce;}_0xedaee0[_0x482c('0x1d')](_0x4af05a);return _0xedaee0[_0x482c('0x22')](_0x482c('0x23'),_0x3aed45+'-'+_0x258148+'/'+_0x5b6f7e)['json'](_0x244bb9);}return null;};}function patchUpdates(_0x1c9a7b){return function(_0x22eec6){try{jsonpatch[_0x482c('0x24')](_0x22eec6,_0x1c9a7b,!![]);}catch(_0xd18658){return BPromise[_0x482c('0x25')](_0xd18658);}return _0x22eec6['save']();};}function saveUpdates(_0x4afcd9,_0x238503){return function(_0x147d05){if(_0x147d05){return _0x147d05[_0x482c('0x26')](_0x4afcd9)['then'](function(_0x3d5490){return _0x3d5490;});}return null;};}function removeEntity(_0x579d2f,_0x2f3f96){return function(_0xc2df7){if(_0xc2df7){return _0xc2df7['destroy']()[_0x482c('0x27')](function(){_0x579d2f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2165af,_0x27f1b5){return function(_0x36b25c){if(!_0x36b25c){_0x2165af[_0x482c('0x1c')](0x194);}return _0x36b25c;};}function handleError(_0x3bd5bb,_0x215826){_0x215826=_0x215826||0x1f4;return function(_0x2981d2){logger['error'](_0x2981d2[_0x482c('0x28')]);if(_0x2981d2[_0x482c('0x29')]){delete _0x2981d2['name'];}_0x3bd5bb[_0x482c('0x1d')](_0x215826)['send'](_0x2981d2);};}function getInteractionUsers(_0x54782d,_0x207441){return new BPromise(function(_0x5af04c,_0x1ac1c4){try{if(_0x207441[_0x54782d['id']]){_0x54782d[_0x482c('0x2a')]=_[_0x482c('0x2b')](_0x207441[_0x54782d['id']],function(_0x11fa65){return{'id':_0x11fa65['id'],'fullname':_0x11fa65[_0x482c('0x2c')]};});}}catch(_0x11950f){_0x1ac1c4(_0x11950f);}_0x5af04c(_0x54782d);});}function getInteractionTags(_0x36b00d,_0x3e9b22){return new BPromise(function(_0x24b4df,_0x2d3800){try{if(_0x36b00d[_0x482c('0x2d')]){_0x36b00d[_0x482c('0x2e')]=[];_0x36b00d[_0x482c('0x2d')][_0x482c('0x2f')](',')[_0x482c('0x30')](function(_0x164417){_0x36b00d[_0x482c('0x2e')][_0x482c('0x31')](_0x3e9b22[_0x164417]);});}delete _0x36b00d['TagIds'];}catch(_0x4bc837){_0x2d3800(_0x4bc837);}_0x24b4df(_0x36b00d);});}function updateSmsInteraction(_0x520b6b,_0x2fd9d0,_0x22e759){return new BPromise(function(_0x46d06a,_0x38d3e2){return getInteractionUsers(_0x520b6b,_0x22e759)['then'](function(_0x12ad47){return getInteractionTags(_0x12ad47,_0x2fd9d0);})['then'](function(_0x31428c){_0x46d06a(_0x31428c);})[_0x482c('0x32')](function(_0xdb7f5a){_0x38d3e2(_0xdb7f5a);});});}exports[_0x482c('0x33')]=function(_0x15223b,_0x19cfc8){var _0x129a31={},_0x34e80c={},_0x5377ce={'count':0x0,'rows':[]};var _0x5783a7=_[_0x482c('0x2b')](db['SmsInteraction'][_0x482c('0x34')],function(_0x1974ad){return{'name':_0x1974ad[_0x482c('0x35')],'type':_0x1974ad['type'][_0x482c('0x36')]};});_0x34e80c[_0x482c('0x37')]=_[_0x482c('0x2b')](_0x5783a7,_0x482c('0x29'));_0x34e80c['query']=_[_0x482c('0x38')](_0x15223b['query']);_0x34e80c[_0x482c('0x39')]=_['intersection'](_0x34e80c[_0x482c('0x37')],_0x34e80c['query']);_0x129a31[_0x482c('0x3a')]=_[_0x482c('0x3b')](_0x34e80c['model'],qs[_0x482c('0x3c')](_0x15223b['query']['fields']));_0x129a31[_0x482c('0x3a')]=_0x129a31['attributes']['length']?_0x129a31['attributes']:_0x34e80c['model'];if(!_0x15223b[_0x482c('0x3d')][_0x482c('0x3e')](_0x482c('0x3f'))){_0x129a31[_0x482c('0x21')]=qs[_0x482c('0x21')](_0x15223b['query'][_0x482c('0x21')]);_0x129a31[_0x482c('0x20')]=qs[_0x482c('0x20')](_0x15223b[_0x482c('0x3d')]['offset']);}_0x129a31['order']=qs[_0x482c('0x40')](_0x15223b[_0x482c('0x3d')][_0x482c('0x40')]);_0x129a31[_0x482c('0x41')]=qs[_0x482c('0x39')](_[_0x482c('0x42')](_0x15223b[_0x482c('0x3d')],_0x34e80c[_0x482c('0x39')]));var _0x1bc15a=[];var _0x15fc22=squel[_0x482c('0x43')]()['field']('id')[_0x482c('0x44')](_0x482c('0x29'))[_0x482c('0x44')](_0x482c('0x45'))[_0x482c('0x46')](_0x482c('0x47'));var _0x1adccc=squel['select']()['field'](_0x482c('0x48'))[_0x482c('0x44')](_0x482c('0x49'))['field'](_0x482c('0x4a'))['from'](_0x482c('0x4b'),'ui')[_0x482c('0x4c')](_0x482c('0x4d'),'u',_0x482c('0x4e'));var _0x5f4e0a=squel[_0x482c('0x43')]()[_0x482c('0x46')](_0x482c('0x4f'),'i')['left_join'](_0x482c('0x50'),'c',_0x482c('0x51'))[_0x482c('0x4c')]('users','o','o.id\x20=\x20i.UserId')['left_join']('sms_accounts','a','a.id\x20=\x20i.SmsAccountId')['left_join'](_0x482c('0x52'),'me','me.SmsInteractionId\x20=\x20i.id')[_0x482c('0x4c')](_0x482c('0x53'),'it',_0x482c('0x54'))[_0x482c('0x4c')](_0x482c('0x47'),'t',_0x482c('0x55'));var _0x37be4f=squel[_0x482c('0x56')]();var _0x240592=[];var _0x35eac3=squel[_0x482c('0x56')]();var _0x3f7ff7;if(_0x15223b[_0x482c('0x3d')][_0x482c('0x57')]){_0x3f7ff7=as[_0x482c('0x58')](_0x15223b[_0x482c('0x3d')][_0x482c('0x57')]);var _0x31ac21=_0x3f7ff7[_0x482c('0x59')];for(var _0x495aaa=0x0;_0x495aaa<_0x3f7ff7[_0x482c('0x5a')][_0x482c('0x5b')];_0x495aaa++){var _0x57e049=_0x3f7ff7[_0x482c('0x5a')][_0x495aaa];var _0x29cdb6='i';var _0x1f5e5b=_[_0x482c('0x5c')](_0x5783a7,[_0x482c('0x29'),_0x57e049['field']]);if(!_0x1f5e5b){switch(_0x57e049['field']){case _0x482c('0x5d'):if(_0x57e049[_0x482c('0x5e')]==0x1){_0x5f4e0a[_0x482c('0x5f')]('`'+_0x57e049[_0x482c('0x44')]+_0x482c('0x60'));}else{_0x5f4e0a[_0x482c('0x5f')]('`'+_0x57e049[_0x482c('0x44')]+'`\x20>\x200');}break;case'Contact':if(_0x57e049['operator']===_0x482c('0x61')){if(_0x57e049[_0x482c('0x5e')][_0x482c('0x2f')]('\x20')[_0x482c('0x5b')]>0x1){_0x37be4f[_0x31ac21](_0x482c('0x62'),qs[_0x482c('0x63')](_0x57e049[_0x482c('0x5e')]),null);}else{var _0x43fa40='%'+_0x57e049[_0x482c('0x5e')]+'%';_0x37be4f[_0x31ac21](_0x482c('0x64'),_0x43fa40,_0x43fa40,_0x43fa40);}}else{_0x1f5e5b=_[_0x482c('0x5c')](_0x5783a7,['name',_0x482c('0x65')]);_0x57e049[_0x482c('0x44')]=_0x482c('0x65');_0x337a09=as[_0x482c('0x66')](_0x29cdb6,_0x1f5e5b[_0x482c('0x67')],_0x57e049);_0x37be4f[_0x31ac21](_0x337a09[_0x482c('0x68')],_0x337a09[_0x482c('0x5e')][_0x482c('0x69')],_0x337a09[_0x482c('0x5e')][_0x482c('0x1e')]);}break;case _0x482c('0x6a'):var _0x1ff536=_0x57e049['value']['split'](',')[_0x482c('0x2b')](function(_0xe52d69){return Number(_0xe52d69);});_0x1ff536[_0x482c('0x30')](function(_0x5a75c1){_0x35eac3['or'](_0x482c('0x6b'),'%,'+_0x5a75c1+',%');});_0x240592=_[_0x482c('0x6c')](_0x240592,_0x1ff536);break;case'User':if(_0x57e049[_0x482c('0x6d')]===_0x482c('0x61')){_0x37be4f[_0x31ac21](_0x482c('0x6e'),'%'+_0x57e049[_0x482c('0x5e')]+'%',null);}else{_0x1f5e5b=_[_0x482c('0x5c')](_0x5783a7,[_0x482c('0x29'),_0x482c('0x6f')]);_0x57e049[_0x482c('0x44')]=_0x482c('0x6f');_0x337a09=as[_0x482c('0x66')](_0x29cdb6,_0x1f5e5b[_0x482c('0x67')],_0x57e049);_0x37be4f[_0x31ac21](_0x337a09[_0x482c('0x68')],_0x337a09['value'][_0x482c('0x69')],_0x337a09['value'][_0x482c('0x1e')]);}break;case _0x482c('0x70'):_0x337a09=as[_0x482c('0x66')]('me',null,_0x57e049);_0x37be4f[_0x31ac21](_0x337a09[_0x482c('0x68')],_0x337a09[_0x482c('0x5e')][_0x482c('0x69')],_0x337a09['value'][_0x482c('0x1e')]);break;}}else{var _0x337a09=as['buildExpression'](_0x29cdb6,_0x1f5e5b['type'],_0x57e049);_0x37be4f[_0x31ac21](_0x337a09[_0x482c('0x68')],_0x337a09[_0x482c('0x5e')]['start'],_0x337a09[_0x482c('0x5e')][_0x482c('0x1e')]);}}}else{var _0x1ca687=_(_0x15223b[_0x482c('0x3d')])['keys']()[_0x482c('0x2b')](function(_0x387fca){return _[_0x482c('0x71')](_0x5783a7,[_0x482c('0x29'),_0x387fca])?_0x387fca:undefined;})[_0x482c('0x72')]()[_0x482c('0x5e')]();if(!_['isEmpty'](_0x1ca687)){_0x1ca687['forEach'](function(_0x2cace1){if(_0x2cace1===_0x482c('0x73')){_0x5f4e0a[_0x482c('0x41')]('i.SmsAccountId\x20IN\x20?',[][_0x482c('0x74')](_0x15223b[_0x482c('0x3d')][_0x2cace1]));}else if(_0x2cace1===_0x482c('0x75')){var _0x3b7951=JSON[_0x482c('0x76')](_0x15223b[_0x482c('0x3d')][_0x2cace1])[_0x482c('0x77')];var _0x37e456=JSON[_0x482c('0x76')](_0x15223b['query'][_0x2cace1])['$lte'];_0x5f4e0a[_0x482c('0x41')](_0x482c('0x78'),_0x3b7951,_0x37e456);}else{if(_0x15223b['query'][_0x2cace1]==='null'){_0x5f4e0a[_0x482c('0x41')]('i.'+_0x2cace1+_0x482c('0x79'));}else{_0x5f4e0a[_0x482c('0x41')]('i.'+_0x2cace1+'\x20=\x20?',_0x15223b['query'][_0x2cace1]);}}});}if(_0x15223b['query'][_0x482c('0x7a')]){if(_0x15223b[_0x482c('0x3d')][_0x482c('0x7a')]==0x1){_0x5f4e0a[_0x482c('0x5f')](_0x482c('0x7b'));}else{_0x5f4e0a[_0x482c('0x5f')]('`unreadMessages`\x20>\x200');}}if(_0x15223b['query'][_0x482c('0x7c')]){_0x240592=_[_0x482c('0x7d')](_0x15223b[_0x482c('0x3d')][_0x482c('0x7c')])?_0x15223b[_0x482c('0x3d')][_0x482c('0x7c')]:new Array(_0x15223b[_0x482c('0x3d')][_0x482c('0x7c')]);_0x240592[_0x482c('0x30')](function(_0x142809){_0x35eac3['or'](_0x482c('0x6b'),'%,'+_0x142809+',%');});}if(_0x15223b[_0x482c('0x3d')]['filter']){var _0x20f5cb=_0x15223b[_0x482c('0x3d')][_0x482c('0x7e')]['replace']('\x5c','\x5c\x5c')[_0x482c('0x7f')]('\x27\x27',_0x482c('0x80'));if(qs[_0x482c('0x81')](_0x20f5cb)){_0x37be4f['or']('i.id\x20LIKE\x20?',_0x20f5cb+'%')['or'](_0x482c('0x82'),_0x20f5cb+'%');}else{_0x37be4f['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x20f5cb))['or'](_0x482c('0x83'),_0x20f5cb+'%');}}}_0x5f4e0a[_0x482c('0x41')](_0x37be4f);_0x5f4e0a[_0x482c('0x84')](_0x482c('0x85'));var _0xcc3fe7={'type':db[_0x482c('0x86')][_0x482c('0x87')]['SELECT'],'raw':!![]};var _0x1d497b=_0x5f4e0a[_0x482c('0x88')]();_0x1d497b['field'](_0x482c('0x85'));_0x1d497b['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x129a31[_0x482c('0x89')]){_0x129a31['order']['forEach'](function(_0xc7bebc){_0x5f4e0a[_0x482c('0x89')]('i.'+_0xc7bebc[0x0],_0xc7bebc[0x1]==='DESC'?![]:!![]);});}if(!_[_0x482c('0x8a')](_0x240592)){_0x5f4e0a['having'](_0x35eac3);_0x1d497b['where']('t.id\x20IN\x20?',_0x240592);}BPromise[_0x482c('0x8b')]()[_0x482c('0x27')](function(){if(!_0x3f7ff7){if(_0x15223b['query']['SmsAccountId']||_0x15223b['query'][_0x482c('0x8c')])return;_0x1d497b[_0x482c('0x41')](_0x482c('0x8d'));_0x5f4e0a['where']('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}return _0x15223b[_0x482c('0x8e')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x482c('0x27')](function(_0x2c3702){if(_['isEmpty'](_0x2c3702)){_0x1d497b[_0x482c('0x41')]('i.SmsAccountId\x20IS\x20NULL');_0x5f4e0a['where'](_0x482c('0x8f'));}else{_0x1d497b['where'](_0x482c('0x90'),_['map'](_0x2c3702,'id'));_0x5f4e0a[_0x482c('0x41')]('i.SmsAccountId\x20IN\x20?',_[_0x482c('0x2b')](_0x2c3702,'id'));}});})[_0x482c('0x27')](function(){db[_0x482c('0x91')]['query'](_0x1d497b[_0x482c('0x92')](),_0xcc3fe7)[_0x482c('0x27')](function(_0x1b2aed){_0x5377ce['count']=_0x1b2aed[_0x482c('0x5b')];if(_0x5377ce[_0x482c('0x93')]===0x0)return[];return db[_0x482c('0x91')][_0x482c('0x3d')](_0x15fc22[_0x482c('0x92')](),_0xcc3fe7)[_0x482c('0x27')](function(_0x426e81){_0x1bc15a=_['keyBy'](_0x426e81,'id');_0xcc3fe7=_[_0x482c('0x94')](_0xcc3fe7,{'model':db[_0x482c('0x95')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x15223b[_0x482c('0x3d')]['fields']){_0x129a31['attributes']['forEach'](function(_0x2b6e16){_0x5f4e0a['field']('i.'+_0x2b6e16);});}else{_0x5f4e0a['field'](_0x482c('0x96'),'unreadMessages');_0x5f4e0a[_0x482c('0x44')](_0x482c('0x97'),_0x482c('0x98'));_0x5f4e0a[_0x482c('0x44')]('a.mandatoryDisposition',_0x482c('0x99'));_0x5f4e0a['field'](_0x482c('0x9a'));_0x5f4e0a[_0x482c('0x44')](_0x482c('0x9b'),'Contact.firstName');_0x5f4e0a['field'](_0x482c('0x9c'),_0x482c('0x9d'));_0x5f4e0a['field'](_0x482c('0x9e'),'Contact.email');_0x5f4e0a[_0x482c('0x44')](_0x482c('0x9f'),_0x482c('0xa0'));_0x5f4e0a['field'](_0x482c('0xa1'),_0x482c('0xa2'));_0x5f4e0a[_0x482c('0x44')]('c.fax',_0x482c('0xa3'));_0x5f4e0a[_0x482c('0x44')](_0x482c('0xa4'),'Owner.fullname');_0x5f4e0a['field'](_0x482c('0xa5'),_0x482c('0xa6'));_0x5f4e0a[_0x482c('0x44')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x482c('0x2d'));}_0x5f4e0a[_0x482c('0x21')](_0x129a31['limit']);_0x5f4e0a[_0x482c('0x20')](_0x129a31['offset']);return db[_0x482c('0x91')][_0x482c('0x3d')](_0x5f4e0a[_0x482c('0x92')](),_0xcc3fe7);})[_0x482c('0x27')](function(_0x2db600){_0x1adccc[_0x482c('0x41')]('ui.SmsInteractionId\x20IN\x20?',_['map'](_0x2db600,'id'));return db[_0x482c('0x91')][_0x482c('0x3d')](_0x1adccc[_0x482c('0x92')](),_0xcc3fe7)[_0x482c('0x27')](function(_0x7d0afa){var _0x13df33=_[_0x482c('0xa7')](_0x7d0afa,'SmsInteractionId');var _0x3f5eac=[];_0x2db600[_0x482c('0x30')](function(_0x330d0f){_0x3f5eac['push'](updateSmsInteraction(_0x330d0f,_0x1bc15a,_0x13df33));});return BPromise[_0x482c('0xa8')](_0x3f5eac);});});})[_0x482c('0x27')](function(_0x2eca83){_0x5377ce[_0x482c('0xa9')]=_0x2eca83;return _0x5377ce;})[_0x482c('0x27')](respondWithFilteredResult(_0x19cfc8,_0x129a31));})[_0x482c('0x32')](handleError(_0x19cfc8,null));};exports[_0x482c('0xaa')]=function(_0x52c53a,_0x3b4e27){var _0x1184a3={'raw':![],'where':{'id':_0x52c53a['params']['id']}},_0x1f42df={};_0x1f42df[_0x482c('0x37')]=_['keys'](db[_0x482c('0x95')][_0x482c('0x34')]);_0x1f42df[_0x482c('0x3d')]=_[_0x482c('0x38')](_0x52c53a['query']);_0x1f42df[_0x482c('0x39')]=_[_0x482c('0x3b')](_0x1f42df[_0x482c('0x37')],_0x1f42df[_0x482c('0x3d')]);_0x1184a3['attributes']=_[_0x482c('0x3b')](_0x1f42df[_0x482c('0x37')],qs[_0x482c('0x3c')](_0x52c53a[_0x482c('0x3d')][_0x482c('0x3c')]));_0x1184a3['attributes']=_0x1184a3[_0x482c('0x3a')][_0x482c('0x5b')]?_0x1184a3[_0x482c('0x3a')]:_0x1f42df[_0x482c('0x37')];if(_0x52c53a[_0x482c('0x3d')]['includeAll']){_0x1184a3[_0x482c('0xab')]=[{'all':!![]}];}_0x1184a3=_[_0x482c('0x94')]({},_0x1184a3,_0x52c53a[_0x482c('0xac')]);return db['SmsInteraction'][_0x482c('0x5c')](_0x1184a3)[_0x482c('0x27')](handleEntityNotFound(_0x3b4e27,null))[_0x482c('0x27')](respondWithResult(_0x3b4e27,null))[_0x482c('0x32')](handleError(_0x3b4e27,null));};exports['create']=function(_0x73c25f,_0x2da8de){return db[_0x482c('0x95')]['create'](_0x73c25f[_0x482c('0x70')],{})[_0x482c('0x27')](respondWithResult(_0x2da8de,0xc9))[_0x482c('0x32')](handleError(_0x2da8de,null));};exports[_0x482c('0x26')]=function(_0x561d86,_0x5529d0){if(_0x561d86['body']['id']){delete _0x561d86[_0x482c('0x70')]['id'];}return db[_0x482c('0x95')][_0x482c('0x5c')]({'where':{'id':_0x561d86[_0x482c('0xad')]['id']}})[_0x482c('0x27')](handleEntityNotFound(_0x5529d0,null))[_0x482c('0x27')](saveUpdates(_0x561d86[_0x482c('0x70')],null))['then'](respondWithResult(_0x5529d0,null))['catch'](handleError(_0x5529d0,null));};exports['destroy']=function(_0xf19f95,_0x3008de){return db[_0x482c('0x95')][_0x482c('0x5c')]({'where':{'id':_0xf19f95[_0x482c('0xad')]['id']}})[_0x482c('0x27')](handleEntityNotFound(_0x3008de,null))[_0x482c('0x27')](removeEntity(_0x3008de,null))[_0x482c('0x32')](handleError(_0x3008de,null));};exports[_0x482c('0xae')]=function(_0x522d2a,_0x1a84b){return db[_0x482c('0x95')][_0x482c('0xae')]()[_0x482c('0x27')](respondWithResult(_0x1a84b,null))[_0x482c('0x32')](handleError(_0x1a84b,null));};exports[_0x482c('0xaf')]=function(_0x3a8d3d,_0x4aa8f5,_0x48d158){return db['SmsMessage'][_0x482c('0x5c')]({'where':{'id':_0x3a8d3d['params']['id']}})[_0x482c('0x27')](handleEntityNotFound(_0x4aa8f5,null))[_0x482c('0x27')](function(_0x5d8f2d){if(_0x5d8f2d){return _0x5d8f2d[_0x482c('0xaf')](_0x3a8d3d[_0x482c('0x70')][_0x482c('0xb0')],_[_0x482c('0xb1')](_0x3a8d3d['body'],[_0x482c('0xb0'),'id'])||{});}})[_0x482c('0x27')](respondWithResult(_0x4aa8f5,null))[_0x482c('0x32')](handleError(_0x4aa8f5,null));};exports['getMessages']=function(_0x80e00d,_0x1d1d4e,_0x10331a){var _0x337096={'raw':![],'where':{}};var _0x28a24e={};var _0x47da5e={'count':0x0,'rows':[]};return db[_0x482c('0x95')][_0x482c('0xb2')]({'where':{'id':_0x80e00d['params']['id']}})['then'](handleEntityNotFound(_0x1d1d4e,null))['then'](function(_0x4e0516){if(_0x4e0516){_0x28a24e[_0x482c('0x37')]=_['keys'](db[_0x482c('0xb3')][_0x482c('0x34')]);_0x28a24e[_0x482c('0x3d')]=_[_0x482c('0x38')](_0x80e00d[_0x482c('0x3d')]);_0x28a24e[_0x482c('0x39')]=_[_0x482c('0x3b')](_0x28a24e[_0x482c('0x37')],_0x28a24e[_0x482c('0x3d')]);_0x337096[_0x482c('0x3a')]=_[_0x482c('0x3b')](_0x28a24e[_0x482c('0x37')],qs[_0x482c('0x3c')](_0x80e00d[_0x482c('0x3d')][_0x482c('0x3c')]));_0x337096[_0x482c('0x3a')]=_0x337096[_0x482c('0x3a')]['length']?_0x337096['attributes']:_0x28a24e[_0x482c('0x37')];if(!_0x80e00d[_0x482c('0x3d')][_0x482c('0x3e')](_0x482c('0x3f'))){_0x337096[_0x482c('0x21')]=qs[_0x482c('0x21')](_0x80e00d[_0x482c('0x3d')][_0x482c('0x21')]);_0x337096['offset']=qs['offset'](_0x80e00d[_0x482c('0x3d')]['offset']);}_0x337096[_0x482c('0x89')]=qs[_0x482c('0x40')](_0x80e00d[_0x482c('0x3d')][_0x482c('0x40')]);_0x337096[_0x482c('0x41')]=qs[_0x482c('0x39')](_[_0x482c('0x42')](_0x80e00d['query'],_0x28a24e[_0x482c('0x39')]));_0x337096[_0x482c('0x41')][_0x482c('0xb4')]=_0x4e0516['id'];if(_0x80e00d[_0x482c('0x3d')][_0x482c('0x7e')]){_0x337096['where']=_[_0x482c('0x94')](_0x337096[_0x482c('0x41')],{'$or':_[_0x482c('0x2b')](_0x337096['attributes'],function(_0x13bcab){var _0x155841={};_0x155841[_0x13bcab]={'$like':'%'+_0x80e00d[_0x482c('0x3d')][_0x482c('0x7e')]+'%'};return _0x155841;})});}if(_0x80e00d[_0x482c('0x3d')]['$gte']){var _0x34fd49=_0x80e00d[_0x482c('0x3d')]['$gte']['split'](',');var _0x555abd={};_0x555abd[_0x34fd49[0x0]]={'$gte':moment(_0x34fd49[0x1])['format'](_0x482c('0xb5'))};_0x337096[_0x482c('0x41')]=_[_0x482c('0x94')](_0x337096[_0x482c('0x41')],_0x555abd);}_0x337096=_[_0x482c('0x94')]({},_0x337096,_0x80e00d[_0x482c('0xac')]);return db['SmsMessage'][_0x482c('0x93')]({'where':_0x337096[_0x482c('0x41')]})['then'](function(_0x35f986){_0x47da5e[_0x482c('0x93')]=_0x35f986;if(_0x80e00d[_0x482c('0x3d')][_0x482c('0xb6')]){_0x337096['include']=[{'all':!![]}];}return db[_0x482c('0xb3')]['findAll'](_0x337096);})[_0x482c('0x27')](function(_0x7bf21e){_0x47da5e[_0x482c('0xa9')]=_0x7bf21e;return _0x47da5e;});}})['then'](respondWithFilteredResult(_0x1d1d4e,_0x337096))[_0x482c('0x32')](handleError(_0x1d1d4e,null));};exports[_0x482c('0xb7')]=function(_0x5766d6,_0x31481e,_0xf559eb){return db['SmsInteraction'][_0x482c('0x5c')]({'where':{'id':_0x5766d6[_0x482c('0xad')]['id']}})[_0x482c('0x27')](handleEntityNotFound(_0x31481e,null))[_0x482c('0x27')](function(_0x53f3f6){if(_0x53f3f6){return _0x53f3f6[_0x482c('0xb8')](_0x5766d6['body'][_0x482c('0xb0')],_[_0x482c('0xb1')](_0x5766d6[_0x482c('0x70')],[_0x482c('0xb0'),'id'])||{})[_0x482c('0xb9')](function(){return db['Tag']['findAll']({'attributes':['id',_0x482c('0x29'),_0x482c('0x45')],'where':{'id':_0x5766d6['body'][_0x482c('0xb0')]}});})[_0x482c('0x27')](function(_0x5b6932){socket['emit'](_0x482c('0xba'),{'id':Number(_0x5766d6['params']['id']),'tags':_0x5b6932||[]});return{'id':Number(_0x5766d6[_0x482c('0xad')]['id']),'tags':_0x5b6932||[]};});}})[_0x482c('0x27')](respondWithResult(_0x31481e,null))[_0x482c('0x32')](handleError(_0x31481e,null));};exports[_0x482c('0xbb')]=function(_0x2c49e0,_0x2a2b67,_0x454822){return db[_0x482c('0x95')][_0x482c('0x5c')]({'where':{'id':_0x2c49e0['params']['id']}})[_0x482c('0x27')](handleEntityNotFound(_0x2a2b67,null))['then'](function(_0x5a8f78){if(_0x5a8f78){return _0x5a8f78[_0x482c('0xbb')](_0x2c49e0[_0x482c('0x3d')]['ids']);}})[_0x482c('0x27')](respondWithStatusCode(_0x2a2b67,null))[_0x482c('0x32')](handleError(_0x2a2b67,null));};exports[_0x482c('0xbc')]=function(_0x5afa29,_0xd33eaa){var _0x4fc2bf=moment()['unix']()['toString']();var _0x3b827a=path[_0x482c('0xbd')](config['root'],'server',_0x482c('0xbe'),'tmp');var _0x5e0de9=path[_0x482c('0xbd')](config[_0x482c('0xbf')],_0x482c('0xc0'),_0x482c('0xbe'),'attachments');var _0x304ec8=path['join'](_0x3b827a,_0x4fc2bf);var _0x462894=util[_0x482c('0xc1')](_0x482c('0xc2'),_0x5afa29[_0x482c('0xad')]['id'],_0x4fc2bf);var _0x55ce96=path[_0x482c('0xbd')](_0x3b827a,_0x462894);var _0x5908d7=[];_0x5908d7[_0x482c('0x31')]({'model':db[_0x482c('0xc3')],'as':_0x482c('0xc3'),'attributes':['id','fullname'],'raw':!![]});_0x5908d7[_0x482c('0x31')]({'model':db[_0x482c('0xc4')],'as':_0x482c('0xc5'),'attributes':['id',_0x482c('0xc6'),_0x482c('0xc7')],'raw':!![]});var _0x4fdad6=[{'model':db[_0x482c('0xb3')],'as':_0x482c('0xc8'),'attributes':['id',_0x482c('0x70'),'createdAt','direction','secret',_0x482c('0x7a')],'include':_0x5908d7}];_0x4fdad6[_0x482c('0x31')]({'model':db['SmsAccount'],'as':'Account','attributes':['id',_0x482c('0x29')]});_0x4fdad6[_0x482c('0x31')]({'model':db[_0x482c('0xc3')],'as':_0x482c('0xc9'),'attributes':['id',_0x482c('0x2c')]});return db[_0x482c('0x95')]['find']({'where':{'id':_0x5afa29['params']['id']},'include':_0x4fdad6})[_0x482c('0x27')](handleEntityNotFound(_0xd33eaa,null))[_0x482c('0x27')](function(_0x5817c6){if(_0x5817c6){var _0x5e5edc=_0x5817c6['get']({'plain':!![]});fs['mkdirSync'](_0x304ec8);var _0x29f89c={'format':'A4','border':'10px','header':{'height':_0x482c('0xca'),'contents':{'first':_0x482c('0xcb')}},'footer':{'height':_0x482c('0xcc'),'contents':{'default':util[_0x482c('0xc1')](_0x482c('0xcd'),util['format']('%s\x20#%d','Sms',_0x5e5edc['id']),moment()['format']('YYYY-MM-DD')['toString']())}}};var _0x14e93a={'channel':'Sms','account':_0x5e5edc[_0x482c('0xce')][_0x482c('0x29')],'agent':_0x5e5edc[_0x482c('0xc9')]?_0x5e5edc[_0x482c('0xc9')]['fullname']:_0x482c('0xcf'),'createdAt':moment(_0x5e5edc[_0x482c('0x75')])[_0x482c('0xc1')](_0x482c('0xb5'))[_0x482c('0x92')](),'closedAt':_0x5e5edc['closed']?moment(_0x5e5edc[_0x482c('0xd0')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x5e5edc[_0x482c('0xd1')],'messages':_(_0x5e5edc[_0x482c('0xc8')])[_0x482c('0x7e')]({'secret':![]})[_0x482c('0x2b')](function(_0x59125c){return{'date':moment(_0x59125c['createdAt'])['format'](_0x482c('0xb5'))[_0x482c('0x92')](),'sender':_0x59125c[_0x482c('0xd2')]===_0x482c('0xd3')?_0x59125c[_0x482c('0xc3')]?_0x59125c[_0x482c('0xc3')][_0x482c('0x2c')]:'System':_0x59125c[_0x482c('0xc5')]['firstName']+(_0x59125c[_0x482c('0xc5')][_0x482c('0xc7')]?'\x20'+_0x59125c[_0x482c('0xc5')][_0x482c('0xc7')]:''),'body':_0x59125c[_0x482c('0x70')],'direction':_0x59125c[_0x482c('0xd2')]===_0x482c('0xd3')?'A':'C','secret':_0x59125c[_0x482c('0xd4')],'read':_0x59125c['read']};})['value']()};return ejs[_0x482c('0xd5')](path[_0x482c('0xbd')](config[_0x482c('0xbf')],_0x482c('0xc0'),_0x482c('0xd6'),_0x482c('0xd7')),{'interaction':_0x14e93a})[_0x482c('0x27')](function(_0x2507ae){return new BPromise(function(_0x47370d,_0x1d035f){pdf['create'](_0x2507ae,_0x29f89c)[_0x482c('0xd8')](path[_0x482c('0xbd')](_0x304ec8,_0x482c('0xd9')+_0x5e5edc['id']+'-'+_0x4fc2bf+_0x482c('0xda')),function(_0x1f5507,_0x36954b){if(_0x1f5507)return _0x1d035f(_0x1f5507);_0x47370d(_0x36954b);});});})[_0x482c('0x27')](function(){return new BPromise(function(_0x236ec2,_0x1880e7){zipdir(_0x304ec8,{'saveTo':_0x55ce96},function(_0x4be0d8,_0x41f9fe){if(_0x4be0d8)return _0x1880e7(_0x4be0d8);return _0x236ec2(_0x41f9fe);});})[_0x482c('0x27')](function(){return new BPromise(function(_0x428d83,_0x35656a){rimraf(_0x304ec8,function(_0x206ae8){if(_0x206ae8)_0x35656a(_0x206ae8);return _0x428d83();});});})['then'](function(){return _0xd33eaa[_0x482c('0xbc')](_0x55ce96,_0x462894,function(_0x24fb4e){if(_0x24fb4e){console[_0x482c('0xdb')](_0x482c('0xdc'),_0x24fb4e);}else{fs[_0x482c('0xdd')](_0x55ce96);}});});});}else{return _0xd33eaa[_0x482c('0x1c')](0xc8);}})[_0x482c('0x32')](handleError(_0xd33eaa,null));}; \ No newline at end of file +var _0x4bd3=['t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','having','`\x20>\x200','Contact','$substring','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?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','some','compact','isEmpty','concat','createdAt','$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','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy','SmsInteraction','attributes','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','SmsInteractionId','all','rows','catch','params','includeAll','include','merge','options','create','body','describe','addMessage','SmsMessage','ids','omit','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','Messages','secret','SmsAccount','Account','Owner','get','mkdirSync','10px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
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.','closed','disposition','direction','out','lastName','renderFile','views','downloadInteraction.html','toFile','transcript-','log','err','unlinkSync','html-pdf','rimraf','zip-dir','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','end','stack','name','send','Users','fullname','TagIds','split','forEach','push','then','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','select','field','color','from','tools_tags','u.id','u.fullname','users','sms_interactions','left_join','o.id\x20=\x20i.UserId','sms_accounts','it.SmsInteractionId\x20=\x20i.id'];(function(_0x4240f0,_0x2ccabe){var _0xa45a32=function(_0x4acdd9){while(--_0x4acdd9){_0x4240f0['push'](_0x4240f0['shift']());}};_0xa45a32(++_0x2ccabe);}(_0x4bd3,0x174));var _0x34bd=function(_0x557145,_0x300ce5){_0x557145=_0x557145-0x0;var _0x3c6016=_0x4bd3[_0x557145];return _0x3c6016;};'use strict';var pdf=require(_0x34bd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x34bd('0x1'));var zipdir=require(_0x34bd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x34bd('0x3'));var Mustache=require(_0x34bd('0x4'));var util=require(_0x34bd('0x5'));var path=require('path');var sox=require(_0x34bd('0x6'));var csv=require(_0x34bd('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x34bd('0x8'));var squel=require(_0x34bd('0x9'));var crypto=require('crypto');var jsforce=require(_0x34bd('0xa'));var deskjs=require(_0x34bd('0xb'));var toCsv=require(_0x34bd('0x7'));var querystring=require(_0x34bd('0xc'));var Papa=require(_0x34bd('0xd'));var Redis=require(_0x34bd('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x34bd('0xf'));var as=require(_0x34bd('0x10'));var hardwareService=require(_0x34bd('0x11'));var logger=require(_0x34bd('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x34bd('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x34bd('0x14')](config[_0x34bd('0x15')],{'host':_0x34bd('0x16'),'port':0x18eb});var socket=require(_0x34bd('0x17'))(new Redis(config[_0x34bd('0x15')]));require(_0x34bd('0x18'))[_0x34bd('0x19')](socket);function respondWithStatusCode(_0x236f6b,_0xf6d2f2){_0xf6d2f2=_0xf6d2f2||0xcc;return function(_0x59ed5d){if(_0x59ed5d){return _0x236f6b[_0x34bd('0x1a')](_0xf6d2f2);}return _0x236f6b['status'](_0xf6d2f2)['end']();};}function respondWithResult(_0x6638ed,_0x30b3f2){_0x30b3f2=_0x30b3f2||0xc8;return function(_0x280c1a){if(_0x280c1a){return _0x6638ed[_0x34bd('0x1b')](_0x30b3f2)[_0x34bd('0x1c')](_0x280c1a);}};}function respondWithFilteredResult(_0x1643af,_0xd39d72){return function(_0x1c12e8){if(_0x1c12e8){var _0x3b4bf8=_0x1c12e8[_0x34bd('0x1d')],_0x72b197=_0xd39d72[_0x34bd('0x1e')],_0x4b5ebb=_0xd39d72[_0x34bd('0x1e')]+_0xd39d72[_0x34bd('0x1f')],_0x48d2ba;if(_0x4b5ebb>=_0x3b4bf8){_0x4b5ebb=_0x3b4bf8;_0x48d2ba=0xc8;}else{_0x48d2ba=0xce;}_0x1643af[_0x34bd('0x1b')](_0x48d2ba);return _0x1643af[_0x34bd('0x20')](_0x34bd('0x21'),_0x72b197+'-'+_0x4b5ebb+'/'+_0x3b4bf8)[_0x34bd('0x1c')](_0x1c12e8);}return null;};}function patchUpdates(_0x130bd0){return function(_0x55538e){try{jsonpatch[_0x34bd('0x22')](_0x55538e,_0x130bd0,!![]);}catch(_0xe02cc5){return BPromise[_0x34bd('0x23')](_0xe02cc5);}return _0x55538e[_0x34bd('0x24')]();};}function saveUpdates(_0x463224,_0x5e0c06){return function(_0x582772){if(_0x582772){return _0x582772['update'](_0x463224)['then'](function(_0x3dafe8){return _0x3dafe8;});}return null;};}function removeEntity(_0x503a60,_0x10fc4b){return function(_0x1c2282){if(_0x1c2282){return _0x1c2282[_0x34bd('0x25')]()['then'](function(){_0x503a60[_0x34bd('0x1b')](0xcc)[_0x34bd('0x26')]();});}};}function handleEntityNotFound(_0x4f0dff,_0x457006){return function(_0x5be702){if(!_0x5be702){_0x4f0dff[_0x34bd('0x1a')](0x194);}return _0x5be702;};}function handleError(_0xb256e8,_0x264c94){_0x264c94=_0x264c94||0x1f4;return function(_0x3e4dc3){logger['error'](_0x3e4dc3[_0x34bd('0x27')]);if(_0x3e4dc3[_0x34bd('0x28')]){delete _0x3e4dc3['name'];}_0xb256e8[_0x34bd('0x1b')](_0x264c94)[_0x34bd('0x29')](_0x3e4dc3);};}function getInteractionUsers(_0x16581f,_0x3f675c){return new BPromise(function(_0x26b8e7,_0x4500c8){try{if(_0x3f675c[_0x16581f['id']]){_0x16581f[_0x34bd('0x2a')]=_['map'](_0x3f675c[_0x16581f['id']],function(_0x43b92d){return{'id':_0x43b92d['id'],'fullname':_0x43b92d[_0x34bd('0x2b')]};});}}catch(_0x56d3b9){_0x4500c8(_0x56d3b9);}_0x26b8e7(_0x16581f);});}function getInteractionTags(_0x5d1662,_0x38bdba){return new BPromise(function(_0xca9897,_0xd176f7){try{if(_0x5d1662['TagIds']){_0x5d1662['Tags']=[];_0x5d1662[_0x34bd('0x2c')][_0x34bd('0x2d')](',')[_0x34bd('0x2e')](function(_0x19eb5d){_0x5d1662['Tags'][_0x34bd('0x2f')](_0x38bdba[_0x19eb5d]);});}delete _0x5d1662[_0x34bd('0x2c')];}catch(_0x41ca58){_0xd176f7(_0x41ca58);}_0xca9897(_0x5d1662);});}function updateSmsInteraction(_0x17296b,_0x2ef58f,_0x375cc7){return new BPromise(function(_0x4ae886,_0x72bb10){return getInteractionUsers(_0x17296b,_0x375cc7)['then'](function(_0xadfa97){return getInteractionTags(_0xadfa97,_0x2ef58f);})[_0x34bd('0x30')](function(_0xf12ee6){_0x4ae886(_0xf12ee6);})['catch'](function(_0x2ff72e){_0x72bb10(_0x2ff72e);});});}exports[_0x34bd('0x31')]=function(_0x497774,_0x3c5e1d){var _0x21c7d6={},_0x2b81ca={},_0x4d0a02={'count':0x0,'rows':[]};var _0x1574c8=_[_0x34bd('0x32')](db['SmsInteraction'][_0x34bd('0x33')],function(_0x41c377){return{'name':_0x41c377[_0x34bd('0x34')],'type':_0x41c377[_0x34bd('0x35')][_0x34bd('0x36')]};});_0x2b81ca[_0x34bd('0x37')]=_['map'](_0x1574c8,'name');_0x2b81ca['query']=_[_0x34bd('0x38')](_0x497774[_0x34bd('0x39')]);_0x2b81ca['filters']=_['intersection'](_0x2b81ca[_0x34bd('0x37')],_0x2b81ca['query']);_0x21c7d6['attributes']=_[_0x34bd('0x3a')](_0x2b81ca[_0x34bd('0x37')],qs[_0x34bd('0x3b')](_0x497774[_0x34bd('0x39')][_0x34bd('0x3b')]));_0x21c7d6['attributes']=_0x21c7d6['attributes'][_0x34bd('0x3c')]?_0x21c7d6['attributes']:_0x2b81ca[_0x34bd('0x37')];if(!_0x497774[_0x34bd('0x39')][_0x34bd('0x3d')](_0x34bd('0x3e'))){_0x21c7d6[_0x34bd('0x1f')]=qs['limit'](_0x497774[_0x34bd('0x39')][_0x34bd('0x1f')]);_0x21c7d6[_0x34bd('0x1e')]=qs[_0x34bd('0x1e')](_0x497774['query'][_0x34bd('0x1e')]);}_0x21c7d6['order']=qs[_0x34bd('0x3f')](_0x497774[_0x34bd('0x39')]['sort']);_0x21c7d6[_0x34bd('0x40')]=qs['filters'](_[_0x34bd('0x41')](_0x497774[_0x34bd('0x39')],_0x2b81ca[_0x34bd('0x42')]));var _0x42a424=[];var _0x26d73e=squel[_0x34bd('0x43')]()[_0x34bd('0x44')]('id')['field']('name')['field'](_0x34bd('0x45'))[_0x34bd('0x46')](_0x34bd('0x47'));var _0x787f74=squel['select']()[_0x34bd('0x44')](_0x34bd('0x48'))[_0x34bd('0x44')](_0x34bd('0x49'))[_0x34bd('0x44')]('ui.SmsInteractionId')[_0x34bd('0x46')]('user_has_sms_interactions','ui')['left_join'](_0x34bd('0x4a'),'u','u.id\x20=\x20ui.UserId');var _0x8474fb=squel[_0x34bd('0x43')]()[_0x34bd('0x46')](_0x34bd('0x4b'),'i')[_0x34bd('0x4c')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x34bd('0x4c')]('users','o',_0x34bd('0x4d'))[_0x34bd('0x4c')](_0x34bd('0x4e'),'a','a.id\x20=\x20i.SmsAccountId')['left_join']('sms_messages','me','me.SmsInteractionId\x20=\x20i.id')[_0x34bd('0x4c')]('sms_interaction_has_tags','it',_0x34bd('0x4f'))['left_join'](_0x34bd('0x47'),'t',_0x34bd('0x50'));var _0x1fa341=squel[_0x34bd('0x51')]();var _0x2da5c5=[];var _0x5273b1=squel[_0x34bd('0x51')]();var _0x162229;if(_0x497774[_0x34bd('0x39')][_0x34bd('0x52')]){_0x162229=as[_0x34bd('0x53')](_0x497774['query'][_0x34bd('0x52')]);var _0x3bfd9d=_0x162229['sqlOperator'];for(var _0x1fc735=0x0;_0x1fc735<_0x162229[_0x34bd('0x54')]['length'];_0x1fc735++){var _0x561d77=_0x162229[_0x34bd('0x54')][_0x1fc735];var _0x4e9d52='i';var _0x499642=_[_0x34bd('0x55')](_0x1574c8,[_0x34bd('0x28'),_0x561d77['field']]);if(!_0x499642){switch(_0x561d77['field']){case'unreadMessages':if(_0x561d77['value']==0x1){_0x8474fb[_0x34bd('0x56')]('`'+_0x561d77[_0x34bd('0x44')]+'`\x20=\x200');}else{_0x8474fb['having']('`'+_0x561d77['field']+_0x34bd('0x57'));}break;case _0x34bd('0x58'):if(_0x561d77['operator']===_0x34bd('0x59')){if(_0x561d77[_0x34bd('0x5a')][_0x34bd('0x2d')]('\x20')[_0x34bd('0x3c')]>0x1){_0x1fa341[_0x3bfd9d](_0x34bd('0x5b'),qs[_0x34bd('0x5c')](_0x561d77['value']),null);}else{var _0x3241e1='%'+_0x561d77[_0x34bd('0x5a')]+'%';_0x1fa341[_0x3bfd9d](_0x34bd('0x5d'),_0x3241e1,_0x3241e1,_0x3241e1);}}else{_0x499642=_[_0x34bd('0x55')](_0x1574c8,['name',_0x34bd('0x5e')]);_0x561d77['field']=_0x34bd('0x5e');_0x5d4833=as['buildExpression'](_0x4e9d52,_0x499642[_0x34bd('0x35')],_0x561d77);_0x1fa341[_0x3bfd9d](_0x5d4833[_0x34bd('0x5f')],_0x5d4833[_0x34bd('0x5a')][_0x34bd('0x60')],_0x5d4833[_0x34bd('0x5a')][_0x34bd('0x26')]);}break;case _0x34bd('0x61'):var _0x28394c=_0x561d77[_0x34bd('0x5a')][_0x34bd('0x2d')](',')[_0x34bd('0x32')](function(_0x5ddb03){return Number(_0x5ddb03);});_0x28394c[_0x34bd('0x2e')](function(_0x55f72e){_0x5273b1['or'](_0x34bd('0x62'),'%,'+_0x55f72e+',%');});_0x2da5c5=_['union'](_0x2da5c5,_0x28394c);break;case _0x34bd('0x63'):if(_0x561d77['operator']===_0x34bd('0x59')){_0x1fa341[_0x3bfd9d](_0x34bd('0x64'),'%'+_0x561d77[_0x34bd('0x5a')]+'%',null);}else{_0x499642=_[_0x34bd('0x55')](_0x1574c8,[_0x34bd('0x28'),_0x34bd('0x65')]);_0x561d77[_0x34bd('0x44')]=_0x34bd('0x65');_0x5d4833=as[_0x34bd('0x66')](_0x4e9d52,_0x499642[_0x34bd('0x35')],_0x561d77);_0x1fa341[_0x3bfd9d](_0x5d4833[_0x34bd('0x5f')],_0x5d4833[_0x34bd('0x5a')][_0x34bd('0x60')],_0x5d4833[_0x34bd('0x5a')][_0x34bd('0x26')]);}break;case'body':_0x5d4833=as['buildExpression']('me',null,_0x561d77);_0x1fa341[_0x3bfd9d](_0x5d4833[_0x34bd('0x5f')],_0x5d4833[_0x34bd('0x5a')][_0x34bd('0x60')],_0x5d4833[_0x34bd('0x5a')][_0x34bd('0x26')]);break;}}else{var _0x5d4833=as['buildExpression'](_0x4e9d52,_0x499642['type'],_0x561d77);_0x1fa341[_0x3bfd9d](_0x5d4833['text'],_0x5d4833[_0x34bd('0x5a')][_0x34bd('0x60')],_0x5d4833['value'][_0x34bd('0x26')]);}}}else{var _0xfa0814=_(_0x497774[_0x34bd('0x39')])['keys']()[_0x34bd('0x32')](function(_0x341273){return _[_0x34bd('0x67')](_0x1574c8,[_0x34bd('0x28'),_0x341273])?_0x341273:undefined;})[_0x34bd('0x68')]()[_0x34bd('0x5a')]();if(!_[_0x34bd('0x69')](_0xfa0814)){_0xfa0814[_0x34bd('0x2e')](function(_0x57fc2b){if(_0x57fc2b==='SmsAccountId'){_0x8474fb[_0x34bd('0x40')]('i.SmsAccountId\x20IN\x20?',[][_0x34bd('0x6a')](_0x497774[_0x34bd('0x39')][_0x57fc2b]));}else if(_0x57fc2b===_0x34bd('0x6b')){var _0x58a6eb=JSON['parse'](_0x497774[_0x34bd('0x39')][_0x57fc2b])[_0x34bd('0x6c')];var _0x3c2e61=JSON['parse'](_0x497774['query'][_0x57fc2b])[_0x34bd('0x6d')];_0x8474fb[_0x34bd('0x40')](_0x34bd('0x6e'),_0x58a6eb,_0x3c2e61);}else{if(_0x497774[_0x34bd('0x39')][_0x57fc2b]===_0x34bd('0x6f')){_0x8474fb[_0x34bd('0x40')]('i.'+_0x57fc2b+_0x34bd('0x70'));}else{_0x8474fb[_0x34bd('0x40')]('i.'+_0x57fc2b+_0x34bd('0x71'),_0x497774['query'][_0x57fc2b]);}}});}if(_0x497774['query'][_0x34bd('0x72')]){if(_0x497774['query'][_0x34bd('0x72')]==0x1){_0x8474fb[_0x34bd('0x56')](_0x34bd('0x73'));}else{_0x8474fb[_0x34bd('0x56')]('`unreadMessages`\x20>\x200');}}if(_0x497774['query'][_0x34bd('0x74')]){_0x2da5c5=_[_0x34bd('0x75')](_0x497774[_0x34bd('0x39')]['tag'])?_0x497774[_0x34bd('0x39')]['tag']:new Array(_0x497774[_0x34bd('0x39')][_0x34bd('0x74')]);_0x2da5c5[_0x34bd('0x2e')](function(_0x55876d){_0x5273b1['or'](_0x34bd('0x62'),'%,'+_0x55876d+',%');});}if(_0x497774['query']['filter']){var _0x3cf4c3=_0x497774[_0x34bd('0x39')][_0x34bd('0x76')]['replace']('\x5c','\x5c\x5c')[_0x34bd('0x77')]('\x27\x27',_0x34bd('0x78'));if(qs[_0x34bd('0x79')](_0x3cf4c3)){_0x1fa341['or']('i.id\x20LIKE\x20?',_0x3cf4c3+'%')['or'](_0x34bd('0x7a'),_0x3cf4c3+'%');}else{_0x1fa341['or'](_0x34bd('0x7b'),qs[_0x34bd('0x5c')](_0x3cf4c3))['or'](_0x34bd('0x7c'),_0x3cf4c3+'%');}}}_0x8474fb[_0x34bd('0x40')](_0x1fa341);_0x8474fb[_0x34bd('0x7d')](_0x34bd('0x7e'));var _0x2297f6={'type':db[_0x34bd('0x7f')][_0x34bd('0x80')][_0x34bd('0x81')],'raw':!![]};var _0x59e377=_0x8474fb[_0x34bd('0x82')]();_0x59e377['field'](_0x34bd('0x7e'));_0x59e377['field'](_0x34bd('0x83'),_0x34bd('0x84'));if(_0x21c7d6[_0x34bd('0x85')]){_0x21c7d6[_0x34bd('0x85')][_0x34bd('0x2e')](function(_0x4556ce){_0x8474fb[_0x34bd('0x85')]('i.'+_0x4556ce[0x0],_0x4556ce[0x1]===_0x34bd('0x86')?![]:!![]);});}if(!_[_0x34bd('0x69')](_0x2da5c5)){_0x8474fb[_0x34bd('0x56')](_0x5273b1);_0x59e377['where']('t.id\x20IN\x20?',_0x2da5c5);}BPromise[_0x34bd('0x87')]()[_0x34bd('0x30')](function(){if(!_0x162229){if(_0x497774[_0x34bd('0x39')]['SmsAccountId']||_0x497774['query']['journey'])return;_0x59e377[_0x34bd('0x40')](_0x34bd('0x88'));_0x8474fb[_0x34bd('0x40')](_0x34bd('0x88'));return;}return _0x497774[_0x34bd('0x89')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x34bd('0x30')](function(_0x4d94d0){if(_[_0x34bd('0x69')](_0x4d94d0)){_0x59e377[_0x34bd('0x40')]('i.SmsAccountId\x20IS\x20NULL');_0x8474fb[_0x34bd('0x40')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x59e377[_0x34bd('0x40')]('i.SmsAccountId\x20IN\x20?',_[_0x34bd('0x32')](_0x4d94d0,'id'));_0x8474fb['where'](_0x34bd('0x8a'),_[_0x34bd('0x32')](_0x4d94d0,'id'));}});})[_0x34bd('0x30')](function(){db[_0x34bd('0x8b')][_0x34bd('0x39')](_0x59e377[_0x34bd('0x8c')](),_0x2297f6)[_0x34bd('0x30')](function(_0x24a745){_0x4d0a02['count']=_0x24a745[_0x34bd('0x3c')];if(_0x4d0a02[_0x34bd('0x1d')]===0x0)return[];return db[_0x34bd('0x8b')]['query'](_0x26d73e['toString'](),_0x2297f6)['then'](function(_0x2f1299){_0x42a424=_[_0x34bd('0x8d')](_0x2f1299,'id');_0x2297f6=_['merge'](_0x2297f6,{'model':db[_0x34bd('0x8e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x497774['query'][_0x34bd('0x3b')]){_0x21c7d6[_0x34bd('0x8f')][_0x34bd('0x2e')](function(_0x4c6508){_0x8474fb[_0x34bd('0x44')]('i.'+_0x4c6508);});}else{_0x8474fb['field'](_0x34bd('0x83'),_0x34bd('0x84'));_0x8474fb[_0x34bd('0x44')](_0x34bd('0x90'),_0x34bd('0x91'));_0x8474fb[_0x34bd('0x44')](_0x34bd('0x92'),_0x34bd('0x93'));_0x8474fb[_0x34bd('0x44')](_0x34bd('0x94'));_0x8474fb[_0x34bd('0x44')](_0x34bd('0x95'),_0x34bd('0x96'));_0x8474fb[_0x34bd('0x44')]('c.lastName',_0x34bd('0x97'));_0x8474fb[_0x34bd('0x44')](_0x34bd('0x98'),_0x34bd('0x99'));_0x8474fb[_0x34bd('0x44')]('c.phone',_0x34bd('0x9a'));_0x8474fb[_0x34bd('0x44')](_0x34bd('0x9b'),_0x34bd('0x9c'));_0x8474fb['field'](_0x34bd('0x9d'),'Contact.fax');_0x8474fb['field']('o.fullname','Owner.fullname');_0x8474fb[_0x34bd('0x44')](_0x34bd('0x9e'),_0x34bd('0x9f'));_0x8474fb['field'](_0x34bd('0xa0'),_0x34bd('0x2c'));}_0x8474fb[_0x34bd('0x1f')](_0x21c7d6[_0x34bd('0x1f')]);_0x8474fb[_0x34bd('0x1e')](_0x21c7d6[_0x34bd('0x1e')]);return db[_0x34bd('0x8b')][_0x34bd('0x39')](_0x8474fb[_0x34bd('0x8c')](),_0x2297f6);})[_0x34bd('0x30')](function(_0x4451ef){_0x787f74['where']('ui.SmsInteractionId\x20IN\x20?',_[_0x34bd('0x32')](_0x4451ef,'id'));return db['sequelize'][_0x34bd('0x39')](_0x787f74[_0x34bd('0x8c')](),_0x2297f6)[_0x34bd('0x30')](function(_0x9f4df7){var _0x22aa49=_[_0x34bd('0xa1')](_0x9f4df7,_0x34bd('0xa2'));var _0xf45fee=[];_0x4451ef['forEach'](function(_0x8d35a9){_0xf45fee[_0x34bd('0x2f')](updateSmsInteraction(_0x8d35a9,_0x42a424,_0x22aa49));});return BPromise[_0x34bd('0xa3')](_0xf45fee);});});})['then'](function(_0x2b56eb){_0x4d0a02[_0x34bd('0xa4')]=_0x2b56eb;return _0x4d0a02;})[_0x34bd('0x30')](respondWithFilteredResult(_0x3c5e1d,_0x21c7d6));})[_0x34bd('0xa5')](handleError(_0x3c5e1d,null));};exports['show']=function(_0x429609,_0x3fe460){var _0x246fb3={'raw':![],'where':{'id':_0x429609[_0x34bd('0xa6')]['id']}},_0x5f2e77={};_0x5f2e77[_0x34bd('0x37')]=_[_0x34bd('0x38')](db[_0x34bd('0x8e')][_0x34bd('0x33')]);_0x5f2e77[_0x34bd('0x39')]=_['keys'](_0x429609[_0x34bd('0x39')]);_0x5f2e77[_0x34bd('0x42')]=_[_0x34bd('0x3a')](_0x5f2e77[_0x34bd('0x37')],_0x5f2e77[_0x34bd('0x39')]);_0x246fb3[_0x34bd('0x8f')]=_[_0x34bd('0x3a')](_0x5f2e77[_0x34bd('0x37')],qs[_0x34bd('0x3b')](_0x429609[_0x34bd('0x39')][_0x34bd('0x3b')]));_0x246fb3[_0x34bd('0x8f')]=_0x246fb3[_0x34bd('0x8f')][_0x34bd('0x3c')]?_0x246fb3['attributes']:_0x5f2e77[_0x34bd('0x37')];if(_0x429609['query'][_0x34bd('0xa7')]){_0x246fb3[_0x34bd('0xa8')]=[{'all':!![]}];}_0x246fb3=_[_0x34bd('0xa9')]({},_0x246fb3,_0x429609[_0x34bd('0xaa')]);return db[_0x34bd('0x8e')][_0x34bd('0x55')](_0x246fb3)[_0x34bd('0x30')](handleEntityNotFound(_0x3fe460,null))[_0x34bd('0x30')](respondWithResult(_0x3fe460,null))['catch'](handleError(_0x3fe460,null));};exports[_0x34bd('0xab')]=function(_0x10463f,_0x3efd93){return db['SmsInteraction'][_0x34bd('0xab')](_0x10463f[_0x34bd('0xac')],{})[_0x34bd('0x30')](respondWithResult(_0x3efd93,0xc9))[_0x34bd('0xa5')](handleError(_0x3efd93,null));};exports['update']=function(_0xa2e88f,_0x48acaa){if(_0xa2e88f[_0x34bd('0xac')]['id']){delete _0xa2e88f[_0x34bd('0xac')]['id'];}return db[_0x34bd('0x8e')]['find']({'where':{'id':_0xa2e88f[_0x34bd('0xa6')]['id']}})['then'](handleEntityNotFound(_0x48acaa,null))['then'](saveUpdates(_0xa2e88f[_0x34bd('0xac')],null))[_0x34bd('0x30')](respondWithResult(_0x48acaa,null))[_0x34bd('0xa5')](handleError(_0x48acaa,null));};exports['destroy']=function(_0x20cc16,_0x5cea3e){return db[_0x34bd('0x8e')][_0x34bd('0x55')]({'where':{'id':_0x20cc16['params']['id']}})['then'](handleEntityNotFound(_0x5cea3e,null))['then'](removeEntity(_0x5cea3e,null))[_0x34bd('0xa5')](handleError(_0x5cea3e,null));};exports[_0x34bd('0xad')]=function(_0x563e11,_0x476c1f){return db['SmsInteraction'][_0x34bd('0xad')]()[_0x34bd('0x30')](respondWithResult(_0x476c1f,null))[_0x34bd('0xa5')](handleError(_0x476c1f,null));};exports[_0x34bd('0xae')]=function(_0x3045c7,_0x459be1,_0x239e74){return db[_0x34bd('0xaf')]['find']({'where':{'id':_0x3045c7[_0x34bd('0xa6')]['id']}})[_0x34bd('0x30')](handleEntityNotFound(_0x459be1,null))[_0x34bd('0x30')](function(_0x2e9d66){if(_0x2e9d66){return _0x2e9d66[_0x34bd('0xae')](_0x3045c7[_0x34bd('0xac')][_0x34bd('0xb0')],_[_0x34bd('0xb1')](_0x3045c7[_0x34bd('0xac')],[_0x34bd('0xb0'),'id'])||{});}})['then'](respondWithResult(_0x459be1,null))[_0x34bd('0xa5')](handleError(_0x459be1,null));};exports['getMessages']=function(_0x53deea,_0x36eb45,_0x4490b3){var _0x1b8318={'raw':![],'where':{}};var _0x19671c={};var _0x49c4e6={'count':0x0,'rows':[]};return db[_0x34bd('0x8e')][_0x34bd('0xb2')]({'where':{'id':_0x53deea[_0x34bd('0xa6')]['id']}})[_0x34bd('0x30')](handleEntityNotFound(_0x36eb45,null))['then'](function(_0x5d0e56){if(_0x5d0e56){_0x19671c[_0x34bd('0x37')]=_[_0x34bd('0x38')](db['SmsMessage'][_0x34bd('0x33')]);_0x19671c[_0x34bd('0x39')]=_['keys'](_0x53deea[_0x34bd('0x39')]);_0x19671c[_0x34bd('0x42')]=_[_0x34bd('0x3a')](_0x19671c[_0x34bd('0x37')],_0x19671c[_0x34bd('0x39')]);_0x1b8318[_0x34bd('0x8f')]=_[_0x34bd('0x3a')](_0x19671c[_0x34bd('0x37')],qs['fields'](_0x53deea['query'][_0x34bd('0x3b')]));_0x1b8318[_0x34bd('0x8f')]=_0x1b8318[_0x34bd('0x8f')][_0x34bd('0x3c')]?_0x1b8318[_0x34bd('0x8f')]:_0x19671c['model'];if(!_0x53deea[_0x34bd('0x39')]['hasOwnProperty'](_0x34bd('0x3e'))){_0x1b8318[_0x34bd('0x1f')]=qs[_0x34bd('0x1f')](_0x53deea[_0x34bd('0x39')][_0x34bd('0x1f')]);_0x1b8318[_0x34bd('0x1e')]=qs['offset'](_0x53deea['query'][_0x34bd('0x1e')]);}_0x1b8318[_0x34bd('0x85')]=qs[_0x34bd('0x3f')](_0x53deea[_0x34bd('0x39')]['sort']);_0x1b8318[_0x34bd('0x40')]=qs[_0x34bd('0x42')](_[_0x34bd('0x41')](_0x53deea[_0x34bd('0x39')],_0x19671c[_0x34bd('0x42')]));_0x1b8318[_0x34bd('0x40')][_0x34bd('0xa2')]=_0x5d0e56['id'];if(_0x53deea['query']['filter']){_0x1b8318[_0x34bd('0x40')]=_['merge'](_0x1b8318[_0x34bd('0x40')],{'$or':_[_0x34bd('0x32')](_0x1b8318['attributes'],function(_0x25e21d){var _0xf55e5f={};_0xf55e5f[_0x25e21d]={'$like':'%'+_0x53deea['query'][_0x34bd('0x76')]+'%'};return _0xf55e5f;})});}if(_0x53deea[_0x34bd('0x39')]['$gte']){var _0x5b76a8=_0x53deea[_0x34bd('0x39')]['$gte'][_0x34bd('0x2d')](',');var _0x7a7cc7={};_0x7a7cc7[_0x5b76a8[0x0]]={'$gte':moment(_0x5b76a8[0x1])[_0x34bd('0xb3')](_0x34bd('0xb4'))};_0x1b8318[_0x34bd('0x40')]=_[_0x34bd('0xa9')](_0x1b8318[_0x34bd('0x40')],_0x7a7cc7);}_0x1b8318=_[_0x34bd('0xa9')]({},_0x1b8318,_0x53deea[_0x34bd('0xaa')]);return db[_0x34bd('0xaf')]['count']({'where':_0x1b8318[_0x34bd('0x40')]})[_0x34bd('0x30')](function(_0x47d136){_0x49c4e6[_0x34bd('0x1d')]=_0x47d136;if(_0x53deea[_0x34bd('0x39')][_0x34bd('0xa7')]){_0x1b8318['include']=[{'all':!![]}];}return db[_0x34bd('0xaf')][_0x34bd('0xb5')](_0x1b8318);})['then'](function(_0x5dedd4){_0x49c4e6[_0x34bd('0xa4')]=_0x5dedd4;return _0x49c4e6;});}})[_0x34bd('0x30')](respondWithFilteredResult(_0x36eb45,_0x1b8318))[_0x34bd('0xa5')](handleError(_0x36eb45,null));};exports['addTags']=function(_0x3d0ade,_0x43cf22,_0x1d7da8){return db[_0x34bd('0x8e')][_0x34bd('0x55')]({'where':{'id':_0x3d0ade['params']['id']}})['then'](handleEntityNotFound(_0x43cf22,null))[_0x34bd('0x30')](function(_0x2ac369){if(_0x2ac369){return _0x2ac369[_0x34bd('0xb6')](_0x3d0ade[_0x34bd('0xac')][_0x34bd('0xb0')],_['omit'](_0x3d0ade['body'],[_0x34bd('0xb0'),'id'])||{})[_0x34bd('0xb7')](function(){return db[_0x34bd('0x61')][_0x34bd('0xb5')]({'attributes':['id',_0x34bd('0x28'),_0x34bd('0x45')],'where':{'id':_0x3d0ade[_0x34bd('0xac')][_0x34bd('0xb0')]}});})[_0x34bd('0x30')](function(_0x5eec5b){socket[_0x34bd('0xb8')](_0x34bd('0xb9'),{'id':Number(_0x3d0ade['params']['id']),'tags':_0x5eec5b||[]});return{'id':Number(_0x3d0ade[_0x34bd('0xa6')]['id']),'tags':_0x5eec5b||[]};});}})[_0x34bd('0x30')](respondWithResult(_0x43cf22,null))[_0x34bd('0xa5')](handleError(_0x43cf22,null));};exports[_0x34bd('0xba')]=function(_0x4f9b3e,_0x3c40f2,_0x223165){return db['SmsInteraction'][_0x34bd('0x55')]({'where':{'id':_0x4f9b3e['params']['id']}})[_0x34bd('0x30')](handleEntityNotFound(_0x3c40f2,null))[_0x34bd('0x30')](function(_0x571612){if(_0x571612){return _0x571612[_0x34bd('0xba')](_0x4f9b3e[_0x34bd('0x39')]['ids']);}})[_0x34bd('0x30')](respondWithStatusCode(_0x3c40f2,null))[_0x34bd('0xa5')](handleError(_0x3c40f2,null));};exports[_0x34bd('0xbb')]=function(_0x57b59c,_0x415980){var _0x285c64=moment()[_0x34bd('0xbc')]()[_0x34bd('0x8c')]();var _0x24e21c=path[_0x34bd('0xbd')](config[_0x34bd('0xbe')],_0x34bd('0xbf'),_0x34bd('0xc0'),_0x34bd('0xc1'));var _0x4df088=path['join'](config[_0x34bd('0xbe')],_0x34bd('0xbf'),_0x34bd('0xc0'),_0x34bd('0xc2'));var _0x321218=path[_0x34bd('0xbd')](_0x24e21c,_0x285c64);var _0x51245a=util[_0x34bd('0xb3')](_0x34bd('0xc3'),_0x57b59c['params']['id'],_0x285c64);var _0x1d71a9=path[_0x34bd('0xbd')](_0x24e21c,_0x51245a);var _0x2caf8d=[];_0x2caf8d[_0x34bd('0x2f')]({'model':db[_0x34bd('0x63')],'as':_0x34bd('0x63'),'attributes':['id',_0x34bd('0x2b')],'raw':!![]});_0x2caf8d[_0x34bd('0x2f')]({'model':db[_0x34bd('0xc4')],'as':_0x34bd('0x58'),'attributes':['id',_0x34bd('0xc5'),'lastName'],'raw':!![]});var _0x1804cc=[{'model':db[_0x34bd('0xaf')],'as':_0x34bd('0xc6'),'attributes':['id',_0x34bd('0xac'),_0x34bd('0x6b'),'direction',_0x34bd('0xc7'),'read'],'include':_0x2caf8d}];_0x1804cc[_0x34bd('0x2f')]({'model':db[_0x34bd('0xc8')],'as':_0x34bd('0xc9'),'attributes':['id',_0x34bd('0x28')]});_0x1804cc[_0x34bd('0x2f')]({'model':db[_0x34bd('0x63')],'as':_0x34bd('0xca'),'attributes':['id',_0x34bd('0x2b')]});return db[_0x34bd('0x8e')]['find']({'where':{'id':_0x57b59c[_0x34bd('0xa6')]['id']},'include':_0x1804cc})[_0x34bd('0x30')](handleEntityNotFound(_0x415980,null))['then'](function(_0xcdc6a8){if(_0xcdc6a8){var _0x421b39=_0xcdc6a8[_0x34bd('0xcb')]({'plain':!![]});fs[_0x34bd('0xcc')](_0x321218);var _0x1cc454={'format':'A4','border':_0x34bd('0xcd'),'header':{'height':'40px','contents':{'first':_0x34bd('0xce')}},'footer':{'height':_0x34bd('0xcf'),'contents':{'default':util[_0x34bd('0xb3')](_0x34bd('0xd0'),util[_0x34bd('0xb3')](_0x34bd('0xd1'),_0x34bd('0xd2'),_0x421b39['id']),moment()[_0x34bd('0xb3')](_0x34bd('0xd3'))[_0x34bd('0x8c')]())}}};var _0x2ee173={'channel':_0x34bd('0xd2'),'account':_0x421b39[_0x34bd('0xc9')]['name'],'agent':_0x421b39[_0x34bd('0xca')]?_0x421b39[_0x34bd('0xca')][_0x34bd('0x2b')]:_0x34bd('0xd4'),'createdAt':moment(_0x421b39['createdAt'])[_0x34bd('0xb3')](_0x34bd('0xb4'))[_0x34bd('0x8c')](),'closedAt':_0x421b39[_0x34bd('0xd5')]?moment(_0x421b39['closedAt'])[_0x34bd('0xb3')](_0x34bd('0xb4'))[_0x34bd('0x8c')]():'','disposition':_0x421b39[_0x34bd('0xd6')],'messages':_(_0x421b39[_0x34bd('0xc6')])[_0x34bd('0x76')]({'secret':![]})[_0x34bd('0x32')](function(_0x12ef1c){return{'date':moment(_0x12ef1c[_0x34bd('0x6b')])[_0x34bd('0xb3')]('YYYY-MM-DD\x20HH:mm:ss')[_0x34bd('0x8c')](),'sender':_0x12ef1c[_0x34bd('0xd7')]===_0x34bd('0xd8')?_0x12ef1c['User']?_0x12ef1c[_0x34bd('0x63')][_0x34bd('0x2b')]:'System':_0x12ef1c[_0x34bd('0x58')][_0x34bd('0xc5')]+(_0x12ef1c[_0x34bd('0x58')][_0x34bd('0xd9')]?'\x20'+_0x12ef1c[_0x34bd('0x58')][_0x34bd('0xd9')]:''),'body':_0x12ef1c[_0x34bd('0xac')],'direction':_0x12ef1c[_0x34bd('0xd7')]===_0x34bd('0xd8')?'A':'C','secret':_0x12ef1c['secret'],'read':_0x12ef1c[_0x34bd('0x72')]};})['value']()};return ejs[_0x34bd('0xda')](path[_0x34bd('0xbd')](config[_0x34bd('0xbe')],_0x34bd('0xbf'),_0x34bd('0xdb'),_0x34bd('0xdc')),{'interaction':_0x2ee173})[_0x34bd('0x30')](function(_0x5c0f31){return new BPromise(function(_0x58415b,_0x5ba1f4){pdf[_0x34bd('0xab')](_0x5c0f31,_0x1cc454)[_0x34bd('0xdd')](path[_0x34bd('0xbd')](_0x321218,_0x34bd('0xde')+_0x421b39['id']+'-'+_0x285c64+'.pdf'),function(_0x26a737,_0x4307ae){if(_0x26a737)return _0x5ba1f4(_0x26a737);_0x58415b(_0x4307ae);});});})[_0x34bd('0x30')](function(){return new BPromise(function(_0x3bea8f,_0x1d2dac){zipdir(_0x321218,{'saveTo':_0x1d71a9},function(_0xebc491,_0x314c92){if(_0xebc491)return _0x1d2dac(_0xebc491);return _0x3bea8f(_0x314c92);});})[_0x34bd('0x30')](function(){return new BPromise(function(_0x4c34a4,_0x57bd6c){rimraf(_0x321218,function(_0x84b401){if(_0x84b401)_0x57bd6c(_0x84b401);return _0x4c34a4();});});})[_0x34bd('0x30')](function(){return _0x415980[_0x34bd('0xbb')](_0x1d71a9,_0x51245a,function(_0x195ed6){if(_0x195ed6){console[_0x34bd('0xdf')](_0x34bd('0xe0'),_0x195ed6);}else{fs[_0x34bd('0xe1')](_0x1d71a9);}});});});}else{return _0x415980[_0x34bd('0x1a')](0xc8);}})[_0x34bd('0xa5')](handleError(_0x415980,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index b3cb441..2d24706 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 _0x303a=['setMaxListeners','update','remove','getUsers','then','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','events','SmsInteraction','../../mysqldb','SmsMessage'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x303a,0x1a0));var _0xa303=function(_0x40f31d,_0x166318){_0x40f31d=_0x40f31d-0x0;var _0x10d4e4=_0x303a[_0x40f31d];return _0x10d4e4;};'use strict';var EventEmitter=require(_0xa303('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0xa303('0x1')];var SmsMessage=require(_0xa303('0x2'))['db'][_0xa303('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xa303('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa303('0x5'),'afterDestroy':_0xa303('0x6')};function emitEvent(_0x38a354){return function(_0x217275,_0x1c7fa3,_0x1c7ee9){_0x217275[_0xa303('0x7')]({'attributes':['id'],'raw':!![]})[_0xa303('0x8')](function(_0x69b173){_0x217275['setDataValue']('Users',_0x69b173['map'](function(_0x9142e7){return{'id':_0x9142e7['id']};}));return SmsMessage[_0xa303('0x9')]({'where':{'SmsInteractionId':_0x217275['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3313d0){_0x217275['setDataValue'](_0xa303('0xa'),_0x3313d0['length']);SmsInteractionEvents[_0xa303('0xb')](_0x38a354+':'+_0x217275['id'],_0x217275);SmsInteractionEvents[_0xa303('0xb')](_0x38a354,_0x217275);_0x1c7ee9(null);})[_0xa303('0xc')](_0x1c7ee9(null));};}for(var e in events){if(events[_0xa303('0xd')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xa303('0xe')]=SmsInteractionEvents; \ No newline at end of file +var _0xb138=['exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','remove','getUsers','setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty','hook'];(function(_0x244c4a,_0x2a3db6){var _0x591ab9=function(_0x35da82){while(--_0x35da82){_0x244c4a['push'](_0x244c4a['shift']());}};_0x591ab9(++_0x2a3db6);}(_0xb138,0x1dd));var _0x8b13=function(_0x2b01ac,_0x150444){_0x2b01ac=_0x2b01ac-0x0;var _0x3620c2=_0xb138[_0x2b01ac];return _0x3620c2;};'use strict';var EventEmitter=require(_0x8b13('0x0'));var SmsInteraction=require(_0x8b13('0x1'))['db'][_0x8b13('0x2')];var SmsMessage=require(_0x8b13('0x1'))['db'][_0x8b13('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x8b13('0x4')](0x0);var events={'afterCreate':_0x8b13('0x5'),'afterUpdate':'update','afterDestroy':_0x8b13('0x6')};function emitEvent(_0x241acb){return function(_0x3af81a,_0x5ae5b2,_0xd19a0f){_0x3af81a[_0x8b13('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3fdf4d){_0x3af81a[_0x8b13('0x8')](_0x8b13('0x9'),_0x3fdf4d['map'](function(_0x8570b0){return{'id':_0x8570b0['id']};}));return SmsMessage[_0x8b13('0xa')]({'where':{'SmsInteractionId':_0x3af81a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x53ae50){_0x3af81a[_0x8b13('0x8')](_0x8b13('0xb'),_0x53ae50[_0x8b13('0xc')]);SmsInteractionEvents[_0x8b13('0xd')](_0x241acb+':'+_0x3af81a['id'],_0x3af81a);SmsInteractionEvents[_0x8b13('0xd')](_0x241acb,_0x3af81a);_0xd19a0f(null);})['catch'](_0xd19a0f(null));};}for(var e in events){if(events[_0x8b13('0xe')](e)){var event=events[e];SmsInteraction[_0x8b13('0xf')](e,emitEvent(event));}}module[_0x8b13('0x10')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 66613d6..3364bbf 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 _0x32d8=['rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x541785,_0x5e8e81){var _0x1c33b0=function(_0x251d18){while(--_0x251d18){_0x541785['push'](_0x541785['shift']());}};_0x1c33b0(++_0x5e8e81);}(_0x32d8,0x1e6));var _0x832d=function(_0x4ae6e9,_0x4a8468){_0x4ae6e9=_0x4ae6e9-0x0;var _0x2906ec=_0x32d8[_0x4ae6e9];return _0x2906ec;};'use strict';var _=require(_0x832d('0x0'));var util=require(_0x832d('0x1'));var logger=require(_0x832d('0x2'))(_0x832d('0x3'));var moment=require(_0x832d('0x4'));var BPromise=require('bluebird');var rp=require(_0x832d('0x5'));var fs=require('fs');var path=require(_0x832d('0x6'));var rimraf=require(_0x832d('0x7'));var config=require('../../config/environment');var attributes=require(_0x832d('0x8'));module[_0x832d('0x9')]=function(_0xed37c9,_0x2b813c){return _0xed37c9[_0x832d('0xa')](_0x832d('0xb'),attributes,{'tableName':_0x832d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2c1d2e,_0x1ab510,_0x48af1e){if(_0x2c1d2e[_0x832d('0xd')](_0x832d('0xe'))){_0x2c1d2e['closedAt']=moment()[_0x832d('0xf')](_0x832d('0x10'));}_0x48af1e(null,_0x2c1d2e);}}});}; \ No newline at end of file +var _0x1a03=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','SmsInteraction','sms_interactions','changed'];(function(_0x5ca096,_0x3dce96){var _0x418a5d=function(_0x41c0f9){while(--_0x41c0f9){_0x5ca096['push'](_0x5ca096['shift']());}};_0x418a5d(++_0x3dce96);}(_0x1a03,0x1f4));var _0x31a0=function(_0x304b67,_0x31cb39){_0x304b67=_0x304b67-0x0;var _0x493afb=_0x1a03[_0x304b67];return _0x493afb;};'use strict';var _=require(_0x31a0('0x0'));var util=require('util');var logger=require(_0x31a0('0x1'))(_0x31a0('0x2'));var moment=require(_0x31a0('0x3'));var BPromise=require(_0x31a0('0x4'));var rp=require(_0x31a0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x31a0('0x6'));var config=require(_0x31a0('0x7'));var attributes=require('./smsInteraction.attributes');module[_0x31a0('0x8')]=function(_0x57e22e,_0xce9df3){return _0x57e22e['define'](_0x31a0('0x9'),attributes,{'tableName':_0x31a0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x481979,_0x36e179,_0x50be37){if(_0x481979[_0x31a0('0xb')](_0x31a0('0xc'))){_0x481979[_0x31a0('0xd')]=moment()[_0x31a0('0xe')](_0x31a0('0xf'));}_0x50be37(null,_0x481979);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index d5e6ccf..1542fac 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 _0x7db2=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./smsInteraction.socket','register','request','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','attributes','limit','then','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','stringify','lodash','util'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x7db2,0x181));var _0x27db=function(_0x5250b2,_0x3a4ac9){_0x5250b2=_0x5250b2-0x0;var _0x24a392=_0x7db2[_0x5250b2];return _0x24a392;};'use strict';var _=require(_0x27db('0x0'));var util=require(_0x27db('0x1'));var moment=require(_0x27db('0x2'));var BPromise=require(_0x27db('0x3'));var rs=require(_0x27db('0x4'));var fs=require('fs');var Redis=require(_0x27db('0x5'));var db=require(_0x27db('0x6'))['db'];var utils=require(_0x27db('0x7'));var logger=require('../../config/logger')(_0x27db('0x8'));var config=require(_0x27db('0x9'));var jayson=require(_0x27db('0xa'));var client=jayson[_0x27db('0xb')]['http']({'port':0x232a});config[_0x27db('0xc')]=_['defaults'](config[_0x27db('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x27db('0xd'))(new Redis(config[_0x27db('0xc')]));require(_0x27db('0xe'))[_0x27db('0xf')](socket);function respondWithRpcPromise(_0x5c4b98,_0xf03b23,_0x302edb){return new BPromise(function(_0x18d6ac,_0x402544){return client[_0x27db('0x10')](_0x5c4b98,_0x302edb)['then'](function(_0x1e529d){logger[_0x27db('0x11')]('SmsInteraction,\x20%s,\x20%s',_0xf03b23,_0x27db('0x12'));logger[_0x27db('0x13')](_0x27db('0x14'),_0xf03b23,'request\x20sent',JSON['stringify'](_0x1e529d));if(_0x1e529d[_0x27db('0x15')]){if(_0x1e529d[_0x27db('0x15')]['code']===0x1f4){logger[_0x27db('0x15')](_0x27db('0x16'),_0xf03b23,_0x1e529d[_0x27db('0x15')][_0x27db('0x17')]);return _0x402544(_0x1e529d[_0x27db('0x15')]['message']);}logger[_0x27db('0x15')](_0x27db('0x16'),_0xf03b23,_0x1e529d[_0x27db('0x15')][_0x27db('0x17')]);return _0x18d6ac(_0x1e529d[_0x27db('0x15')][_0x27db('0x17')]);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0xf03b23,'request\x20sent');_0x18d6ac(_0x1e529d[_0x27db('0x18')][_0x27db('0x17')]);}})[_0x27db('0x19')](function(_0x39ce7c){logger[_0x27db('0x15')]('SmsInteraction,\x20%s,\x20%s',_0xf03b23,_0x39ce7c);_0x402544(_0x39ce7c);});});}exports[_0x27db('0x1a')]=function(_0x231f91){var _0x43279a=this;return new Promise(function(_0x44b7ad,_0x351c88){return db[_0x27db('0x1b')]['update'](_0x231f91[_0x27db('0x1c')],{'raw':_0x231f91[_0x27db('0x1d')]?_0x231f91['options'][_0x27db('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x231f91[_0x27db('0x1d')]?_0x231f91[_0x27db('0x1d')][_0x27db('0x1f')]||null:null,'attributes':_0x231f91['options']?_0x231f91[_0x27db('0x1d')][_0x27db('0x20')]||null:null,'limit':_0x231f91['options']?_0x231f91['options'][_0x27db('0x21')]||null:null})[_0x27db('0x22')](function(_0x466d1f){logger[_0x27db('0x11')](_0x27db('0x1a'),_0x231f91);logger['debug'](_0x27db('0x1a'),_0x231f91,JSON['stringify'](_0x466d1f));_0x44b7ad(_0x466d1f);})['catch'](function(_0x1e2f12){logger[_0x27db('0x15')](_0x27db('0x1a'),_0x1e2f12[_0x27db('0x17')],_0x231f91);_0x351c88(_0x43279a[_0x27db('0x15')](0x1f4,_0x1e2f12[_0x27db('0x17')]));});});};exports[_0x27db('0x23')]=function(_0xec5f2){return new Promise(function(_0xd49431,_0x341377){return db[_0x27db('0x1b')][_0x27db('0x24')]({'where':_0xec5f2[_0x27db('0x1d')]?_0xec5f2['options'][_0x27db('0x1f')]||null:null})[_0x27db('0x22')](function(_0x4a1231){if(_0x4a1231){return _0x4a1231[_0x27db('0x25')](_0xec5f2[_0x27db('0x1c')][_0x27db('0x26')],_[_0x27db('0x27')](_0xec5f2['body'],[_0x27db('0x26'),'id'])||{});}})[_0x27db('0x28')](function(_0x10bc61){logger[_0x27db('0x11')](_0x27db('0x29'),_0xec5f2);logger[_0x27db('0x13')](_0x27db('0x29'),_0xec5f2,JSON[_0x27db('0x2a')](_0x10bc61));_0xd49431(_0x10bc61);})['catch'](function(_0x29098b){logger[_0x27db('0x15')](_0x27db('0x29'),_0x29098b['message'],_0xec5f2);_0x341377(_this['error'](0x1f4,_0x29098b[_0x27db('0x17')]));});});}; \ No newline at end of file +var _0x789f=['limit','stringify','catch','SmsInteraction','find','where','then','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','request','info','request\x20sent','debug','error','code','SmsInteraction,\x20%s,\x20%s','message','result','UpdateSmsInteraction','update','body','options','raw','attributes'];(function(_0x22a430,_0x517d48){var _0xe8361d=function(_0x15b9dc){while(--_0x15b9dc){_0x22a430['push'](_0x22a430['shift']());}};_0xe8361d(++_0x517d48);}(_0x789f,0x1ba));var _0xf789=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x789f[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0xf789('0x0'));var util=require(_0xf789('0x1'));var moment=require(_0xf789('0x2'));var BPromise=require(_0xf789('0x3'));var rs=require(_0xf789('0x4'));var fs=require('fs');var Redis=require(_0xf789('0x5'));var db=require(_0xf789('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf789('0x7'));var config=require(_0xf789('0x8'));var jayson=require(_0xf789('0x9'));var client=jayson['client'][_0xf789('0xa')]({'port':0x232a});config[_0xf789('0xb')]=_[_0xf789('0xc')](config[_0xf789('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xf789('0xd'))(new Redis(config['redis']));require(_0xf789('0xe'))[_0xf789('0xf')](socket);function respondWithRpcPromise(_0x5af09d,_0x11d139,_0x5678b9){return new BPromise(function(_0xdc2ac1,_0x5c991d){return client[_0xf789('0x10')](_0x5af09d,_0x5678b9)['then'](function(_0x2c0157){logger[_0xf789('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x11d139,_0xf789('0x12'));logger[_0xf789('0x13')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x11d139,_0xf789('0x12'),JSON['stringify'](_0x2c0157));if(_0x2c0157[_0xf789('0x14')]){if(_0x2c0157['error'][_0xf789('0x15')]===0x1f4){logger['error'](_0xf789('0x16'),_0x11d139,_0x2c0157[_0xf789('0x14')]['message']);return _0x5c991d(_0x2c0157[_0xf789('0x14')][_0xf789('0x17')]);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x11d139,_0x2c0157[_0xf789('0x14')][_0xf789('0x17')]);return _0xdc2ac1(_0x2c0157['error'][_0xf789('0x17')]);}else{logger[_0xf789('0x11')](_0xf789('0x16'),_0x11d139,_0xf789('0x12'));_0xdc2ac1(_0x2c0157[_0xf789('0x18')][_0xf789('0x17')]);}})['catch'](function(_0x302ea5){logger[_0xf789('0x14')](_0xf789('0x16'),_0x11d139,_0x302ea5);_0x5c991d(_0x302ea5);});});}exports[_0xf789('0x19')]=function(_0x3bca97){var _0x2831b9=this;return new Promise(function(_0x4f6382,_0x11a341){return db['SmsInteraction'][_0xf789('0x1a')](_0x3bca97[_0xf789('0x1b')],{'raw':_0x3bca97[_0xf789('0x1c')]?_0x3bca97[_0xf789('0x1c')][_0xf789('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bca97['options']?_0x3bca97[_0xf789('0x1c')]['where']||null:null,'attributes':_0x3bca97[_0xf789('0x1c')]?_0x3bca97[_0xf789('0x1c')][_0xf789('0x1e')]||null:null,'limit':_0x3bca97['options']?_0x3bca97[_0xf789('0x1c')][_0xf789('0x1f')]||null:null})['then'](function(_0x448868){logger[_0xf789('0x11')](_0xf789('0x19'),_0x3bca97);logger[_0xf789('0x13')](_0xf789('0x19'),_0x3bca97,JSON[_0xf789('0x20')](_0x448868));_0x4f6382(_0x448868);})[_0xf789('0x21')](function(_0x42ef52){logger[_0xf789('0x14')](_0xf789('0x19'),_0x42ef52[_0xf789('0x17')],_0x3bca97);_0x11a341(_0x2831b9[_0xf789('0x14')](0x1f4,_0x42ef52[_0xf789('0x17')]));});});};exports['AddTagsToSmsInteraction']=function(_0x133730){return new Promise(function(_0x17ab98,_0x405915){return db[_0xf789('0x22')][_0xf789('0x23')]({'where':_0x133730[_0xf789('0x1c')]?_0x133730[_0xf789('0x1c')][_0xf789('0x24')]||null:null})[_0xf789('0x25')](function(_0x3c8ce5){if(_0x3c8ce5){return _0x3c8ce5[_0xf789('0x26')](_0x133730[_0xf789('0x1b')][_0xf789('0x27')],_[_0xf789('0x28')](_0x133730[_0xf789('0x1b')],[_0xf789('0x27'),'id'])||{});}})[_0xf789('0x29')](function(_0x2ce485){logger[_0xf789('0x11')]('AddTags',_0x133730);logger[_0xf789('0x13')](_0xf789('0x2a'),_0x133730,JSON[_0xf789('0x20')](_0x2ce485));_0x17ab98(_0x2ce485);})[_0xf789('0x21')](function(_0x20ef37){logger[_0xf789('0x14')](_0xf789('0x2a'),_0x20ef37['message'],_0x133730);_0x405915(_this[_0xf789('0x14')](0x1f4,_0x20ef37[_0xf789('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index b011615..b1abdbe 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 _0xb7e7=['remove','removeListener','length','smsInteraction:','./smsInteraction.events'];(function(_0x34bfc6,_0x133854){var _0x1f90eb=function(_0x25c37f){while(--_0x25c37f){_0x34bfc6['push'](_0x34bfc6['shift']());}};_0x1f90eb(++_0x133854);}(_0xb7e7,0x121));var _0x7b7e=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0xb7e7[_0x710815];return _0x5b3b89;};'use strict';var SmsInteractionEvents=require(_0x7b7e('0x0'));var events=['save',_0x7b7e('0x1'),'update'];function createListener(_0x1b7cc7,_0x54a37f){return function(_0x3f5804){_0x54a37f['emit'](_0x1b7cc7,_0x3f5804);};}function removeListener(_0x31d0ed,_0x118577){return function(){SmsInteractionEvents[_0x7b7e('0x2')](_0x31d0ed,_0x118577);};}exports['register']=function(_0x53ed64){for(var _0x333fa4=0x0,_0x372bde=events[_0x7b7e('0x3')];_0x333fa4<_0x372bde;_0x333fa4++){var _0x55ce81=events[_0x333fa4];var _0x42b871=createListener(_0x7b7e('0x4')+_0x55ce81,_0x53ed64);SmsInteractionEvents['on'](_0x55ce81,_0x42b871);}}; \ No newline at end of file +var _0x2032=['save','remove','update','removeListener','register','length','smsInteraction:'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0x2032,0xd9));var _0x2203=function(_0x9c5817,_0x581c9f){_0x9c5817=_0x9c5817-0x0;var _0x2ccc87=_0x2032[_0x9c5817];return _0x2ccc87;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x2203('0x0'),_0x2203('0x1'),_0x2203('0x2')];function createListener(_0x4c28da,_0x486390){return function(_0x228a29){_0x486390['emit'](_0x4c28da,_0x228a29);};}function removeListener(_0x46c49a,_0x880dcd){return function(){SmsInteractionEvents[_0x2203('0x3')](_0x46c49a,_0x880dcd);};}exports[_0x2203('0x4')]=function(_0x3f7ba1){for(var _0x13367a=0x0,_0x2e0f63=events[_0x2203('0x5')];_0x13367a<_0x2e0f63;_0x13367a++){var _0x18c4d6=events[_0x13367a];var _0x2049ff=createListener(_0x2203('0x6')+_0x18c4d6,_0x3f7ba1);SmsInteractionEvents['on'](_0x18c4d6,_0x2049ff);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 311b38c..47ff81b 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 _0xb2ee=['get','/describe','describe','/:id','show','post','sms','smsmessage:create','create','/:id/status','status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','isAuthenticated','index'];(function(_0x3d5d9a,_0x23b92a){var _0x20c208=function(_0x107684){while(--_0x107684){_0x3d5d9a['push'](_0x3d5d9a['shift']());}};_0x20c208(++_0x23b92a);}(_0xb2ee,0xe3));var _0xeb2e=function(_0x2a3f2b,_0x339199){_0x2a3f2b=_0x2a3f2b-0x0;var _0x162230=_0xb2ee[_0x2a3f2b];return _0x162230;};'use strict';var multer=require('multer');var util=require(_0xeb2e('0x0'));var path=require(_0xeb2e('0x1'));var timeout=require(_0xeb2e('0x2'));var express=require(_0xeb2e('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xeb2e('0x4'));var config=require('../../config/environment');var controller=require('./smsMessage.controller');router['get']('/',auth[_0xeb2e('0x5')](),controller[_0xeb2e('0x6')]);router[_0xeb2e('0x7')](_0xeb2e('0x8'),auth[_0xeb2e('0x5')](),controller[_0xeb2e('0x9')]);router['get'](_0xeb2e('0xa'),auth[_0xeb2e('0x5')](),controller[_0xeb2e('0xb')]);router[_0xeb2e('0xc')]('/',auth[_0xeb2e('0x5')](),interaction['tracked'](_0xeb2e('0xd'),_0xeb2e('0xe')),controller[_0xeb2e('0xf')]);router[_0xeb2e('0xc')](_0xeb2e('0x10'),controller[_0xeb2e('0x11')]);router[_0xeb2e('0x12')](_0xeb2e('0xa'),auth[_0xeb2e('0x5')](),controller['update']);router[_0xeb2e('0x12')](_0xeb2e('0x13'),auth[_0xeb2e('0x5')](),controller[_0xeb2e('0x14')]);router['put'](_0xeb2e('0x15'),auth[_0xeb2e('0x5')](),controller[_0xeb2e('0x16')]);router[_0xeb2e('0x17')](_0xeb2e('0xa'),auth[_0xeb2e('0x5')](),controller[_0xeb2e('0x18')]);module[_0xeb2e('0x19')]=router; \ No newline at end of file +var _0x1b60=['create','post','/:id/status','status','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','tracked','sms','smsmessage:create'];(function(_0x1a096e,_0x5da4e7){var _0x3dabaf=function(_0xdcb6a){while(--_0xdcb6a){_0x1a096e['push'](_0x1a096e['shift']());}};_0x3dabaf(++_0x5da4e7);}(_0x1b60,0x66));var _0x01b6=function(_0x24f3d3,_0xb13780){_0x24f3d3=_0x24f3d3-0x0;var _0x2b9655=_0x1b60[_0x24f3d3];return _0x2b9655;};'use strict';var multer=require(_0x01b6('0x0'));var util=require(_0x01b6('0x1'));var path=require(_0x01b6('0x2'));var timeout=require('connect-timeout');var express=require(_0x01b6('0x3'));var router=express[_0x01b6('0x4')]();var auth=require(_0x01b6('0x5'));var interaction=require(_0x01b6('0x6'));var config=require(_0x01b6('0x7'));var controller=require(_0x01b6('0x8'));router['get']('/',auth[_0x01b6('0x9')](),controller[_0x01b6('0xa')]);router[_0x01b6('0xb')](_0x01b6('0xc'),auth[_0x01b6('0x9')](),controller[_0x01b6('0xd')]);router[_0x01b6('0xb')](_0x01b6('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),interaction[_0x01b6('0xf')](_0x01b6('0x10'),_0x01b6('0x11')),controller[_0x01b6('0x12')]);router[_0x01b6('0x13')](_0x01b6('0x14'),controller[_0x01b6('0x15')]);router[_0x01b6('0x16')](_0x01b6('0xe'),auth[_0x01b6('0x9')](),controller[_0x01b6('0x17')]);router[_0x01b6('0x16')](_0x01b6('0x18'),auth[_0x01b6('0x9')](),controller[_0x01b6('0x19')]);router[_0x01b6('0x16')]('/:id/reject',auth[_0x01b6('0x9')](),controller[_0x01b6('0x1a')]);router[_0x01b6('0x1b')]('/:id',auth[_0x01b6('0x9')](),controller[_0x01b6('0x1c')]);module[_0x01b6('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 4ecd330..6e40ef0 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 _0x3d38=['BOOLEAN','STRING','DATE','sequelize','medium'];(function(_0x27c9ef,_0x241a3d){var _0xe1b241=function(_0x51306e){while(--_0x51306e){_0x27c9ef['push'](_0x27c9ef['shift']());}};_0xe1b241(++_0x241a3d);}(_0x3d38,0xc1));var _0x83d3=function(_0x3c68ac,_0x38b406){_0x3c68ac=_0x3c68ac-0x0;var _0x35d849=_0x3d38[_0x3c68ac];return _0x35d849;};'use strict';var Sequelize=require(_0x83d3('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x83d3('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x83d3('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x83d3('0x3')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x83d3('0x4')]},'secret':{'type':Sequelize[_0x83d3('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xbfa0=['DATE','exports','TEXT','BOOLEAN','ENUM','out','STRING'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0xbfa0,0x86));var _0x0bfa=function(_0x450671,_0x492847){_0x450671=_0x450671-0x0;var _0x4df880=_0xbfa0[_0x450671];return _0x4df880;};'use strict';var Sequelize=require('sequelize');module[_0x0bfa('0x0')]={'body':{'type':Sequelize[_0x0bfa('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x0bfa('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0bfa('0x3')]('in','out'),'defaultValue':_0x0bfa('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0bfa('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x0bfa('0x6')]},'secret':{'type':Sequelize[_0x0bfa('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 6f09950..5742ca8 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 _0x0946=['register','jayson/promise','client','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','SmsMessage,\x20%s,\x20%s','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','end','stack','name','send','index','map','SmsMessage','rawAttributes','type','key','filters','intersection','model','fields','query','attributes','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','rows','show','params','keys','find','create','body','describe','sms-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','manual','interface','channel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','RejectMessage','rejectMessage','SIP/%s','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','sent','delivered','Status','results','groupName','DELIVERED','infobip','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0946,0xf5));var _0x6094=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x0946[_0x5f3f88];return _0xd08119;};'use strict';var pdf=require(_0x6094('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6094('0x1'));var jsonpatch=require(_0x6094('0x2'));var rp=require(_0x6094('0x3'));var moment=require(_0x6094('0x4'));var BPromise=require(_0x6094('0x5'));var Mustache=require(_0x6094('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6094('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6094('0x8'));var squel=require('squel');var crypto=require(_0x6094('0x9'));var jsforce=require(_0x6094('0xa'));var deskjs=require(_0x6094('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6094('0xc'));var Papa=require(_0x6094('0xd'));var Redis=require(_0x6094('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6094('0xf'));var as=require(_0x6094('0x10'));var hardwareService=require(_0x6094('0x11'));var logger=require(_0x6094('0x12'))(_0x6094('0x13'));var utils=require('../../config/utils');var config=require(_0x6094('0x14'));var db=require(_0x6094('0x15'))['db'];config[_0x6094('0x16')]=_[_0x6094('0x17')](config[_0x6094('0x16')],{'host':_0x6094('0x18'),'port':0x18eb});var socket=require(_0x6094('0x19'))(new Redis(config[_0x6094('0x16')]));require(_0x6094('0x1a'))[_0x6094('0x1b')](socket);var jayson=require(_0x6094('0x1c'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x6094('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x22a83e,_0x46a095,_0x34661f){if(_0x34661f){var _0x1ba4d0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ba4d0['test'](_0x46a095)){return _0x22a83e;}else{throw new db['Sequelize'][(_0x6094('0x1e'))](_0x6094('0x1f'));}}else{return _0x22a83e;}}function respondWithRpcPromise(_0x2cc5b6,_0x448dd8,_0x13e266,_0x3ed5af){return new BPromise(function(_0x15bc0b,_0x4e046a){var _0x4dcb68=_0x3ed5af||client;return _0x4dcb68[_0x6094('0x20')](_0x2cc5b6,_0x13e266)[_0x6094('0x21')](function(_0x385e29){logger[_0x6094('0x22')]('SmsMessage,\x20%s,\x20%s',_0x448dd8,_0x6094('0x23'));logger[_0x6094('0x24')](_0x6094('0x25'),_0x448dd8,'request\x20sent',JSON['stringify'](_0x385e29));if(_0x385e29[_0x6094('0x26')]){if(_0x385e29[_0x6094('0x26')][_0x6094('0x27')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x448dd8,_0x385e29[_0x6094('0x26')]['message']);return _0x4e046a(_0x385e29[_0x6094('0x26')][_0x6094('0x28')]);}logger['error'](_0x6094('0x29'),_0x448dd8,_0x385e29['error']['message']);return _0x15bc0b(_0x385e29[_0x6094('0x26')][_0x6094('0x28')]);}else{logger[_0x6094('0x22')](_0x6094('0x29'),_0x448dd8,_0x6094('0x23'));_0x15bc0b(_0x385e29['result']['message']);}})[_0x6094('0x2a')](function(_0x564e4f){logger[_0x6094('0x26')](_0x6094('0x29'),_0x448dd8,_0x564e4f);_0x4e046a(_0x564e4f);});});}function respondWithStatusCode(_0x1352df,_0x32debd){_0x32debd=_0x32debd||0xcc;return function(_0x3b95a2){if(_0x3b95a2){return _0x1352df[_0x6094('0x2b')](_0x32debd);}return _0x1352df['status'](_0x32debd)['end']();};}function respondWithResult(_0x258c51,_0x1bcfa1){_0x1bcfa1=_0x1bcfa1||0xc8;return function(_0x3a206f){if(_0x3a206f){return _0x258c51[_0x6094('0x2c')](_0x1bcfa1)[_0x6094('0x2d')](_0x3a206f);}};}function respondWithFilteredResult(_0x4a6057,_0x3dbda3){return function(_0x5afee5){if(_0x5afee5){var _0x45938d=_0x5afee5[_0x6094('0x2e')],_0x12962f=_0x3dbda3[_0x6094('0x2f')],_0x421fc5=_0x3dbda3[_0x6094('0x2f')]+_0x3dbda3[_0x6094('0x30')],_0x105c6f;if(_0x421fc5>=_0x45938d){_0x421fc5=_0x45938d;_0x105c6f=0xc8;}else{_0x105c6f=0xce;}_0x4a6057[_0x6094('0x2c')](_0x105c6f);return _0x4a6057[_0x6094('0x31')](_0x6094('0x32'),_0x12962f+'-'+_0x421fc5+'/'+_0x45938d)[_0x6094('0x2d')](_0x5afee5);}return null;};}function patchUpdates(_0x1477e4){return function(_0x7a70a9){try{jsonpatch['apply'](_0x7a70a9,_0x1477e4,!![]);}catch(_0x8191ac){return BPromise[_0x6094('0x33')](_0x8191ac);}return _0x7a70a9[_0x6094('0x34')]();};}function saveUpdates(_0x42e0de,_0x613013){return function(_0x29a8f2){if(_0x29a8f2){return _0x29a8f2[_0x6094('0x35')](_0x42e0de)[_0x6094('0x21')](function(_0x522924){return _0x522924;});}return null;};}function removeEntity(_0x4946c9,_0x4757d0){return function(_0x249a6b){if(_0x249a6b){return _0x249a6b[_0x6094('0x36')]()[_0x6094('0x21')](function(){_0x4946c9[_0x6094('0x2c')](0xcc)[_0x6094('0x37')]();});}};}function handleEntityNotFound(_0x446e56,_0x23e221){return function(_0x9fecfc){if(!_0x9fecfc){_0x446e56[_0x6094('0x2b')](0x194);}return _0x9fecfc;};}function handleError(_0x58a27d,_0x325f6a){_0x325f6a=_0x325f6a||0x1f4;return function(_0x2864d5){logger[_0x6094('0x26')](_0x2864d5[_0x6094('0x38')]);if(_0x2864d5['name']){delete _0x2864d5[_0x6094('0x39')];}_0x58a27d[_0x6094('0x2c')](_0x325f6a)[_0x6094('0x3a')](_0x2864d5);};}exports[_0x6094('0x3b')]=function(_0x215e1e,_0x10133d){var _0x1a04ca={},_0x3b93d2={},_0x47af7d={'count':0x0,'rows':[]};var _0x1e1334=_[_0x6094('0x3c')](db[_0x6094('0x3d')][_0x6094('0x3e')],function(_0x860b4b){return{'name':_0x860b4b['fieldName'],'type':_0x860b4b[_0x6094('0x3f')][_0x6094('0x40')]};});_0x3b93d2['model']=_['map'](_0x1e1334,_0x6094('0x39'));_0x3b93d2['query']=_['keys'](_0x215e1e['query']);_0x3b93d2[_0x6094('0x41')]=_[_0x6094('0x42')](_0x3b93d2['model'],_0x3b93d2['query']);_0x1a04ca['attributes']=_[_0x6094('0x42')](_0x3b93d2[_0x6094('0x43')],qs[_0x6094('0x44')](_0x215e1e[_0x6094('0x45')][_0x6094('0x44')]));_0x1a04ca['attributes']=_0x1a04ca[_0x6094('0x46')][_0x6094('0x47')]?_0x1a04ca[_0x6094('0x46')]:_0x3b93d2['model'];if(!_0x215e1e['query']['hasOwnProperty'](_0x6094('0x48'))){_0x1a04ca[_0x6094('0x30')]=qs['limit'](_0x215e1e[_0x6094('0x45')][_0x6094('0x30')]);_0x1a04ca['offset']=qs['offset'](_0x215e1e[_0x6094('0x45')][_0x6094('0x2f')]);}_0x1a04ca[_0x6094('0x49')]=qs[_0x6094('0x4a')](_0x215e1e[_0x6094('0x45')][_0x6094('0x4a')]);_0x1a04ca['where']=qs[_0x6094('0x41')](_[_0x6094('0x4b')](_0x215e1e[_0x6094('0x45')],_0x3b93d2[_0x6094('0x41')]));if(_0x215e1e['query'][_0x6094('0x4c')]){_0x1a04ca[_0x6094('0x4d')]=_['merge'](_0x1a04ca['where'],{'$or':_[_0x6094('0x3c')](_0x1e1334,function(_0xb9a834){if(_0xb9a834['type']!==_0x6094('0x4e')){var _0x7c0065={};_0x7c0065[_0xb9a834['name']]={'$like':'%'+_0x215e1e[_0x6094('0x45')][_0x6094('0x4c')]+'%'};return _0x7c0065;}})});}_0x1a04ca=_[_0x6094('0x4f')]({},_0x1a04ca,_0x215e1e[_0x6094('0x50')]);var _0x5e660f={'where':_0x1a04ca[_0x6094('0x4d')]};return db[_0x6094('0x3d')][_0x6094('0x2e')](_0x5e660f)[_0x6094('0x21')](function(_0x4e46cb){_0x47af7d[_0x6094('0x2e')]=_0x4e46cb;if(_0x215e1e[_0x6094('0x45')][_0x6094('0x51')]){_0x1a04ca['include']=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x1a04ca);})[_0x6094('0x21')](function(_0x194804){_0x47af7d[_0x6094('0x52')]=_0x194804;return _0x47af7d;})[_0x6094('0x21')](respondWithFilteredResult(_0x10133d,_0x1a04ca))['catch'](handleError(_0x10133d,null));};exports[_0x6094('0x53')]=function(_0x509677,_0x417b23){var _0x6e36e3={'raw':!![],'where':{'id':_0x509677[_0x6094('0x54')]['id']}},_0x297536={};_0x297536[_0x6094('0x43')]=_[_0x6094('0x55')](db[_0x6094('0x3d')][_0x6094('0x3e')]);_0x297536['query']=_['keys'](_0x509677[_0x6094('0x45')]);_0x297536[_0x6094('0x41')]=_['intersection'](_0x297536['model'],_0x297536[_0x6094('0x45')]);_0x6e36e3['attributes']=_[_0x6094('0x42')](_0x297536[_0x6094('0x43')],qs[_0x6094('0x44')](_0x509677[_0x6094('0x45')]['fields']));_0x6e36e3['attributes']=_0x6e36e3[_0x6094('0x46')][_0x6094('0x47')]?_0x6e36e3[_0x6094('0x46')]:_0x297536['model'];if(_0x509677[_0x6094('0x45')][_0x6094('0x51')]){_0x6e36e3['include']=[{'all':!![]}];}_0x6e36e3=_[_0x6094('0x4f')]({},_0x6e36e3,_0x509677[_0x6094('0x50')]);return db[_0x6094('0x3d')][_0x6094('0x56')](_0x6e36e3)[_0x6094('0x21')](handleEntityNotFound(_0x417b23,null))['then'](respondWithResult(_0x417b23,null))[_0x6094('0x2a')](handleError(_0x417b23,null));};exports['create']=function(_0xbcb32f,_0x582333){return db[_0x6094('0x3d')][_0x6094('0x57')](_0xbcb32f[_0x6094('0x58')],{})['then'](respondWithResult(_0x582333,0xc9))[_0x6094('0x2a')](handleError(_0x582333,null));};exports['update']=function(_0x30ec5c,_0xbebb94){if(_0x30ec5c[_0x6094('0x58')]['id']){delete _0x30ec5c[_0x6094('0x58')]['id'];}return db[_0x6094('0x3d')][_0x6094('0x56')]({'where':{'id':_0x30ec5c['params']['id']}})[_0x6094('0x21')](handleEntityNotFound(_0xbebb94,null))[_0x6094('0x21')](saveUpdates(_0x30ec5c['body'],null))[_0x6094('0x21')](respondWithResult(_0xbebb94,null))['catch'](handleError(_0xbebb94,null));};exports[_0x6094('0x36')]=function(_0x5d8bf5,_0xb96d21){return db[_0x6094('0x3d')][_0x6094('0x56')]({'where':{'id':_0x5d8bf5[_0x6094('0x54')]['id']}})[_0x6094('0x21')](handleEntityNotFound(_0xb96d21,null))[_0x6094('0x21')](removeEntity(_0xb96d21,null))['catch'](handleError(_0xb96d21,null));};exports[_0x6094('0x59')]=function(_0xa28de2,_0xe8699c){return db[_0x6094('0x3d')][_0x6094('0x59')]()[_0x6094('0x21')](respondWithResult(_0xe8699c,null))['catch'](handleError(_0xe8699c,null));};var interaction_log=require(_0x6094('0x12'))(_0x6094('0x5a'));exports[_0x6094('0x5b')]=function(_0x2e005c,_0x326026,_0x4c583b){var _0x232d1f={'channel':'sms'};if(_0x2e005c['body']['id']){delete _0x2e005c[_0x6094('0x58')]['id'];}_0x2e005c[_0x6094('0x58')][_0x6094('0x5c')]=!![];_0x2e005c[_0x6094('0x58')]['readAt']=moment()[_0x6094('0x5d')](_0x6094('0x5e'));_0x2e005c['body'][_0x6094('0x5f')]=_0x2e005c['body'][_0x6094('0x5f')]||_0x2e005c[_0x6094('0x60')]['id'];return db[_0x6094('0x3d')][_0x6094('0x56')]({'where':{'id':_0x2e005c[_0x6094('0x54')]['id'],'UserId':null},'include':[{'model':db[_0x6094('0x61')],'as':_0x6094('0x62')}]})[_0x6094('0x21')](handleEntityNotFound(_0x326026,null))[_0x6094('0x21')](saveUpdates(_0x2e005c['body'],null))[_0x6094('0x21')](function(_0x9307b5){if(_0x9307b5){_0x232d1f[_0x6094('0x28')]=_0x9307b5[_0x6094('0x63')]({'plain':!![]});return db[_0x6094('0x64')]['find']({'where':{'id':_0x9307b5[_0x6094('0x65')]}});}return null;})[_0x6094('0x21')](handleEntityNotFound(_0x326026,null))[_0x6094('0x21')](function(_0x480f53){if(_0x480f53){return _0x480f53[_0x6094('0x35')]({'UserId':_0x2e005c[_0x6094('0x58')][_0x6094('0x5f')],'read1stAt':_[_0x6094('0x66')](_0x480f53[_0x6094('0x67')])?moment()['format'](_0x6094('0x5e')):undefined});}return null;})['then'](function(_0x9b4e3e){if(_0x9b4e3e){_0x232d1f[_0x6094('0x68')]=_0x9b4e3e['get']({'plain':!![]});interaction_log['info'](_0x6094('0x69'),_0x2e005c[_0x6094('0x60')]['id'],_0x2e005c[_0x6094('0x60')][_0x6094('0x39')],_0x2e005c[_0x6094('0x60')][_0x6094('0x6a')],_0x232d1f[_0x6094('0x68')]['id'],_0x2e005c['body']?JSON['stringify'](_0x2e005c['body']):'null');return respondWithRpcPromise('AcceptMessage',_0x6094('0x6b'),_0x232d1f);}return null;})[_0x6094('0x21')](function(_0x45203a){if(_0x45203a){if(_0x2e005c[_0x6094('0x58')][_0x6094('0x6c')]){_0x232d1f[_0x6094('0x28')][_0x6094('0x6d')]=util[_0x6094('0x5d')]('SIP/%s',_0x2e005c[_0x6094('0x60')][_0x6094('0x39')]);_0x232d1f[_0x6094('0x28')][_0x6094('0x6e')]=_0x232d1f[_0x6094('0x6e')];_0x232d1f['message'][_0x6094('0x6f')]=_0x6094('0x5b');return respondWithRpcPromise(_0x6094('0x70'),_0x6094('0x70'),{'event':_0x6094('0x71'),'message':_0x232d1f[_0x6094('0x28')]},client9002)[_0x6094('0x21')](function(){return _0x232d1f;});}return _0x232d1f;}return null;})[_0x6094('0x21')](respondWithResult(_0x326026,null))['catch'](handleError(_0x326026,null));};var interaction_log=require(_0x6094('0x12'))(_0x6094('0x5a'));exports[_0x6094('0x33')]=function(_0x3852f7,_0x5223a3,_0x256b66){var _0x459394={'agent':{},'channel':'sms'};if(_0x3852f7[_0x6094('0x58')]['id']){delete _0x3852f7[_0x6094('0x58')]['id'];}_0x3852f7['body'][_0x6094('0x5f')]=_0x3852f7[_0x6094('0x58')]['UserId']||_0x3852f7[_0x6094('0x60')]['id'];_0x459394['agent']['id']=_0x3852f7[_0x6094('0x58')]['UserId'];return db['SmsMessage']['find']({'where':{'id':_0x3852f7[_0x6094('0x54')]['id'],'UserId':null}})[_0x6094('0x21')](handleEntityNotFound(_0x5223a3,null))[_0x6094('0x21')](function(_0x15e586){if(_0x15e586){_0x459394[_0x6094('0x28')]=_0x15e586[_0x6094('0x63')]({'plain':!![]});return db['SmsInteraction'][_0x6094('0x56')]({'where':{'id':_0x15e586[_0x6094('0x65')]}});}return null;})[_0x6094('0x21')](handleEntityNotFound(_0x5223a3,null))[_0x6094('0x21')](function(_0x3f7e0c){if(_0x3f7e0c){_0x459394[_0x6094('0x68')]=_0x3f7e0c['get']({'plain':!![]});interaction_log[_0x6094('0x22')](_0x6094('0x72'),_0x3852f7[_0x6094('0x60')]['id'],_0x3852f7['user'][_0x6094('0x39')],_0x3852f7[_0x6094('0x60')]['role'],_0x459394[_0x6094('0x68')]['id'],_0x3852f7[_0x6094('0x58')]?JSON[_0x6094('0x73')](_0x3852f7['body']):_0x6094('0x74'));return respondWithRpcPromise(_0x6094('0x75'),_0x6094('0x76'),_0x459394);}return null;})[_0x6094('0x21')](function(_0x37178a){if(_0x37178a){_0x37178a[_0x6094('0x28')]['interface']=util[_0x6094('0x5d')](_0x6094('0x77'),_0x3852f7[_0x6094('0x60')]['name']);_0x37178a[_0x6094('0x28')][_0x6094('0x6e')]=_0x459394[_0x6094('0x6e')];_0x37178a[_0x6094('0x28')][_0x6094('0x6f')]=_0x6094('0x33');respondWithRpcPromise(_0x6094('0x70'),_0x6094('0x70'),{'event':_0x6094('0x78'),'message':_0x37178a[_0x6094('0x28')]},client9002);return _0x459394;}return null;})[_0x6094('0x21')](respondWithResult(_0x5223a3,null))[_0x6094('0x2a')](handleError(_0x5223a3,null));};exports[_0x6094('0x2c')]=function(_0x83980b,_0xa66d97,_0x237600){if(_0x83980b[_0x6094('0x58')]['id']){delete _0x83980b[_0x6094('0x58')]['id'];}var _0x4afaca;return db['SmsMessage'][_0x6094('0x56')]({'where':{'id':_0x83980b[_0x6094('0x54')]['id']}})[_0x6094('0x21')](handleEntityNotFound(_0xa66d97,null))[_0x6094('0x21')](function(_0x8c8114){if(_0x8c8114){_0x4afaca=_0x8c8114;return db['SmsAccount']['find']({'where':{'id':_0x8c8114[_0x6094('0x79')]}});}})[_0x6094('0x21')](handleEntityNotFound(_0xa66d97,null))[_0x6094('0x21')](function(_0x11a751){if(_0x11a751){logger[_0x6094('0x24')](_0x6094('0x25'),_0x6094('0x2c'),_0x6094('0x7a'),_0x11a751[_0x6094('0x3f')],util[_0x6094('0x7b')](_0x83980b[_0x6094('0x58')],{'showHidden':![],'depth':null}));switch(_0x11a751[_0x6094('0x3f')]){case'twilio':if(_0x83980b[_0x6094('0x58')]['MessageSid']&&_0x83980b['body'][_0x6094('0x7c')]===_0x4afaca[_0x6094('0x7d')]){return _0x4afaca[_0x6094('0x35')]({'read':!![]});}else{logger[_0x6094('0x26')](_0x6094('0x7e'),_0x6094('0x2c'),'twilio',util[_0x6094('0x7b')](_0x83980b[_0x6094('0x58')],{'showHidden':![],'depth':null}));}break;case _0x6094('0x7f'):if(_0x83980b[_0x6094('0x58')][_0x6094('0x80')]&&_0x83980b[_0x6094('0x58')]['MessageUUID']===_0x4afaca[_0x6094('0x7d')]&&_['indexOf']([_0x6094('0x81'),_0x6094('0x82')],_0x83980b[_0x6094('0x58')][_0x6094('0x83')])>=0x0){return _0x4afaca[_0x6094('0x35')]({'read':!![]});}else{logger[_0x6094('0x26')](_0x6094('0x7e'),_0x6094('0x2c'),'plivio',util[_0x6094('0x7b')](_0x83980b[_0x6094('0x58')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x5ea1bf=_0x83980b[_0x6094('0x58')][_0x6094('0x84')][0x0];if(_0x5ea1bf[_0x6094('0x2c')][_0x6094('0x85')]===_0x6094('0x86')){return _0x4afaca[_0x6094('0x35')]({'read':!![]});}else{logger[_0x6094('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6094('0x2c'),_0x6094('0x87'),util['inspect'](_0x83980b[_0x6094('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x4afaca;}})['then'](respondWithResult(_0xa66d97,null))['catch'](handleError(_0xa66d97,null));}; \ No newline at end of file +var _0x41f6=['plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','defaults','redis','localhost','./smsMessage.socket','register','jayson/promise','http','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','offset','Content-Range','apply','reject','save','update','destroy','stack','map','rawAttributes','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','name','options','count','includeAll','include','SmsMessage','findAll','show','params','create','body','find','describe','accept','sms','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','event','EventManager','acceptmessage','sms-interactions','agent','SmsInteraction','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','rejectmessage','SmsAccount','received\x20delivery\x20report\x20from','inspect','twilio','messageId','SmsAccount,\x20%s,\x20%s,\x20%s'];(function(_0x2980d9,_0xef7ff){var _0x37994e=function(_0x555936){while(--_0x555936){_0x2980d9['push'](_0x2980d9['shift']());}};_0x37994e(++_0xef7ff);}(_0x41f6,0x94));var _0x641f=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x41f6[_0x422905];return _0x33dc6c;};'use strict';var pdf=require(_0x641f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x641f('0x1'));var zipdir=require(_0x641f('0x2'));var jsonpatch=require(_0x641f('0x3'));var rp=require(_0x641f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x641f('0x5'));var util=require(_0x641f('0x6'));var path=require(_0x641f('0x7'));var sox=require(_0x641f('0x8'));var csv=require(_0x641f('0x9'));var ejs=require(_0x641f('0xa'));var fs=require('fs');var _=require(_0x641f('0xb'));var squel=require(_0x641f('0xc'));var crypto=require(_0x641f('0xd'));var jsforce=require(_0x641f('0xe'));var deskjs=require(_0x641f('0xf'));var toCsv=require(_0x641f('0x9'));var querystring=require(_0x641f('0x10'));var Papa=require('papaparse');var Redis=require(_0x641f('0x11'));var authService=require(_0x641f('0x12'));var qs=require(_0x641f('0x13'));var as=require(_0x641f('0x14'));var hardwareService=require(_0x641f('0x15'));var logger=require(_0x641f('0x16'))(_0x641f('0x17'));var utils=require(_0x641f('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x641f('0x19')](config[_0x641f('0x1a')],{'host':_0x641f('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x641f('0x1a')]));require(_0x641f('0x1c'))[_0x641f('0x1d')](socket);var jayson=require(_0x641f('0x1e'));var client=jayson['client'][_0x641f('0x1f')]({'port':0x232c});var client9002=jayson[_0x641f('0x20')][_0x641f('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x3bca76,_0x51fafb,_0x4dd053){if(_0x4dd053){var _0x570d09=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x570d09[_0x641f('0x21')](_0x51fafb)){return _0x3bca76;}else{throw new db['Sequelize']['ValidationError'](_0x641f('0x22'));}}else{return _0x3bca76;}}function respondWithRpcPromise(_0x1a0fa8,_0x396cfd,_0x4f39e5,_0x4ee396){return new BPromise(function(_0x42f181,_0x4b8ee1){var _0x28a299=_0x4ee396||client;return _0x28a299['request'](_0x1a0fa8,_0x4f39e5)[_0x641f('0x23')](function(_0x12d575){logger[_0x641f('0x24')](_0x641f('0x25'),_0x396cfd,_0x641f('0x26'));logger[_0x641f('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x396cfd,_0x641f('0x26'),JSON[_0x641f('0x28')](_0x12d575));if(_0x12d575[_0x641f('0x29')]){if(_0x12d575[_0x641f('0x29')][_0x641f('0x2a')]===0x1f4){logger[_0x641f('0x29')](_0x641f('0x25'),_0x396cfd,_0x12d575[_0x641f('0x29')][_0x641f('0x2b')]);return _0x4b8ee1(_0x12d575['error'][_0x641f('0x2b')]);}logger[_0x641f('0x29')](_0x641f('0x25'),_0x396cfd,_0x12d575[_0x641f('0x29')][_0x641f('0x2b')]);return _0x42f181(_0x12d575[_0x641f('0x29')][_0x641f('0x2b')]);}else{logger[_0x641f('0x24')](_0x641f('0x25'),_0x396cfd,_0x641f('0x26'));_0x42f181(_0x12d575[_0x641f('0x2c')][_0x641f('0x2b')]);}})[_0x641f('0x2d')](function(_0x37bbff){logger[_0x641f('0x29')](_0x641f('0x25'),_0x396cfd,_0x37bbff);_0x4b8ee1(_0x37bbff);});});}function respondWithStatusCode(_0x3ad04c,_0x1db271){_0x1db271=_0x1db271||0xcc;return function(_0x53da0e){if(_0x53da0e){return _0x3ad04c[_0x641f('0x2e')](_0x1db271);}return _0x3ad04c[_0x641f('0x2f')](_0x1db271)[_0x641f('0x30')]();};}function respondWithResult(_0x4c83d8,_0x297b38){_0x297b38=_0x297b38||0xc8;return function(_0x21371b){if(_0x21371b){return _0x4c83d8[_0x641f('0x2f')](_0x297b38)['json'](_0x21371b);}};}function respondWithFilteredResult(_0x2e0139,_0x406a22){return function(_0x521bae){if(_0x521bae){var _0x246228=_0x521bae['count'],_0x59f189=_0x406a22[_0x641f('0x31')],_0x403625=_0x406a22[_0x641f('0x31')]+_0x406a22['limit'],_0x3b7f08;if(_0x403625>=_0x246228){_0x403625=_0x246228;_0x3b7f08=0xc8;}else{_0x3b7f08=0xce;}_0x2e0139[_0x641f('0x2f')](_0x3b7f08);return _0x2e0139['set'](_0x641f('0x32'),_0x59f189+'-'+_0x403625+'/'+_0x246228)['json'](_0x521bae);}return null;};}function patchUpdates(_0x4482cb){return function(_0x94ed4e){try{jsonpatch[_0x641f('0x33')](_0x94ed4e,_0x4482cb,!![]);}catch(_0x51e736){return BPromise[_0x641f('0x34')](_0x51e736);}return _0x94ed4e[_0x641f('0x35')]();};}function saveUpdates(_0x7769a8,_0x1ee2ce){return function(_0x7d42bd){if(_0x7d42bd){return _0x7d42bd[_0x641f('0x36')](_0x7769a8)[_0x641f('0x23')](function(_0x3215c7){return _0x3215c7;});}return null;};}function removeEntity(_0x52692f,_0x27134f){return function(_0x3e6ae9){if(_0x3e6ae9){return _0x3e6ae9[_0x641f('0x37')]()[_0x641f('0x23')](function(){_0x52692f[_0x641f('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3d2d,_0x498df1){return function(_0x4f3d7b){if(!_0x4f3d7b){_0x2d3d2d[_0x641f('0x2e')](0x194);}return _0x4f3d7b;};}function handleError(_0x413de6,_0x338a65){_0x338a65=_0x338a65||0x1f4;return function(_0x415025){logger['error'](_0x415025[_0x641f('0x38')]);if(_0x415025['name']){delete _0x415025['name'];}_0x413de6['status'](_0x338a65)['send'](_0x415025);};}exports['index']=function(_0x19e058,_0x39d44c){var _0x5165fd={},_0x189376={},_0xb8d1ed={'count':0x0,'rows':[]};var _0x270b53=_[_0x641f('0x39')](db['SmsMessage'][_0x641f('0x3a')],function(_0x2f5b59){return{'name':_0x2f5b59['fieldName'],'type':_0x2f5b59['type'][_0x641f('0x3b')]};});_0x189376['model']=_[_0x641f('0x39')](_0x270b53,'name');_0x189376[_0x641f('0x3c')]=_[_0x641f('0x3d')](_0x19e058[_0x641f('0x3c')]);_0x189376['filters']=_[_0x641f('0x3e')](_0x189376[_0x641f('0x3f')],_0x189376[_0x641f('0x3c')]);_0x5165fd[_0x641f('0x40')]=_[_0x641f('0x3e')](_0x189376['model'],qs[_0x641f('0x41')](_0x19e058[_0x641f('0x3c')][_0x641f('0x41')]));_0x5165fd['attributes']=_0x5165fd[_0x641f('0x40')][_0x641f('0x42')]?_0x5165fd[_0x641f('0x40')]:_0x189376[_0x641f('0x3f')];if(!_0x19e058[_0x641f('0x3c')][_0x641f('0x43')](_0x641f('0x44'))){_0x5165fd[_0x641f('0x45')]=qs[_0x641f('0x45')](_0x19e058[_0x641f('0x3c')]['limit']);_0x5165fd[_0x641f('0x31')]=qs[_0x641f('0x31')](_0x19e058[_0x641f('0x3c')][_0x641f('0x31')]);}_0x5165fd[_0x641f('0x46')]=qs['sort'](_0x19e058['query'][_0x641f('0x47')]);_0x5165fd[_0x641f('0x48')]=qs[_0x641f('0x49')](_[_0x641f('0x4a')](_0x19e058['query'],_0x189376[_0x641f('0x49')]));if(_0x19e058[_0x641f('0x3c')][_0x641f('0x4b')]){_0x5165fd[_0x641f('0x48')]=_[_0x641f('0x4c')](_0x5165fd[_0x641f('0x48')],{'$or':_[_0x641f('0x39')](_0x270b53,function(_0x56cc02){if(_0x56cc02[_0x641f('0x4d')]!==_0x641f('0x4e')){var _0xa6ce0={};_0xa6ce0[_0x56cc02[_0x641f('0x4f')]]={'$like':'%'+_0x19e058[_0x641f('0x3c')]['filter']+'%'};return _0xa6ce0;}})});}_0x5165fd=_[_0x641f('0x4c')]({},_0x5165fd,_0x19e058[_0x641f('0x50')]);var _0x10d45e={'where':_0x5165fd['where']};return db['SmsMessage']['count'](_0x10d45e)['then'](function(_0x3539b5){_0xb8d1ed[_0x641f('0x51')]=_0x3539b5;if(_0x19e058['query'][_0x641f('0x52')]){_0x5165fd[_0x641f('0x53')]=[{'all':!![]}];}return db[_0x641f('0x54')][_0x641f('0x55')](_0x5165fd);})['then'](function(_0x444942){_0xb8d1ed['rows']=_0x444942;return _0xb8d1ed;})[_0x641f('0x23')](respondWithFilteredResult(_0x39d44c,_0x5165fd))[_0x641f('0x2d')](handleError(_0x39d44c,null));};exports[_0x641f('0x56')]=function(_0x1f1ed9,_0x3358c6){var _0x503a10={'raw':!![],'where':{'id':_0x1f1ed9[_0x641f('0x57')]['id']}},_0x1fb692={};_0x1fb692[_0x641f('0x3f')]=_[_0x641f('0x3d')](db['SmsMessage']['rawAttributes']);_0x1fb692[_0x641f('0x3c')]=_[_0x641f('0x3d')](_0x1f1ed9[_0x641f('0x3c')]);_0x1fb692[_0x641f('0x49')]=_[_0x641f('0x3e')](_0x1fb692[_0x641f('0x3f')],_0x1fb692[_0x641f('0x3c')]);_0x503a10['attributes']=_['intersection'](_0x1fb692['model'],qs['fields'](_0x1f1ed9[_0x641f('0x3c')][_0x641f('0x41')]));_0x503a10['attributes']=_0x503a10['attributes'][_0x641f('0x42')]?_0x503a10['attributes']:_0x1fb692['model'];if(_0x1f1ed9[_0x641f('0x3c')][_0x641f('0x52')]){_0x503a10['include']=[{'all':!![]}];}_0x503a10=_[_0x641f('0x4c')]({},_0x503a10,_0x1f1ed9[_0x641f('0x50')]);return db[_0x641f('0x54')]['find'](_0x503a10)[_0x641f('0x23')](handleEntityNotFound(_0x3358c6,null))[_0x641f('0x23')](respondWithResult(_0x3358c6,null))[_0x641f('0x2d')](handleError(_0x3358c6,null));};exports[_0x641f('0x58')]=function(_0x19313d,_0x4d9f0a){return db[_0x641f('0x54')][_0x641f('0x58')](_0x19313d['body'],{})[_0x641f('0x23')](respondWithResult(_0x4d9f0a,0xc9))[_0x641f('0x2d')](handleError(_0x4d9f0a,null));};exports[_0x641f('0x36')]=function(_0x1e6860,_0x56101f){if(_0x1e6860[_0x641f('0x59')]['id']){delete _0x1e6860[_0x641f('0x59')]['id'];}return db[_0x641f('0x54')][_0x641f('0x5a')]({'where':{'id':_0x1e6860[_0x641f('0x57')]['id']}})[_0x641f('0x23')](handleEntityNotFound(_0x56101f,null))[_0x641f('0x23')](saveUpdates(_0x1e6860[_0x641f('0x59')],null))['then'](respondWithResult(_0x56101f,null))[_0x641f('0x2d')](handleError(_0x56101f,null));};exports[_0x641f('0x37')]=function(_0x242c8c,_0xe6fde4){return db[_0x641f('0x54')]['find']({'where':{'id':_0x242c8c['params']['id']}})[_0x641f('0x23')](handleEntityNotFound(_0xe6fde4,null))[_0x641f('0x23')](removeEntity(_0xe6fde4,null))[_0x641f('0x2d')](handleError(_0xe6fde4,null));};exports[_0x641f('0x5b')]=function(_0x5d0c40,_0x25655e){return db['SmsMessage'][_0x641f('0x5b')]()['then'](respondWithResult(_0x25655e,null))[_0x641f('0x2d')](handleError(_0x25655e,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0x641f('0x5c')]=function(_0x25260d,_0x56d540,_0x5d9495){var _0x910a53={'channel':_0x641f('0x5d')};if(_0x25260d['body']['id']){delete _0x25260d['body']['id'];}_0x25260d[_0x641f('0x59')]['read']=!![];_0x25260d[_0x641f('0x59')]['readAt']=moment()[_0x641f('0x5e')](_0x641f('0x5f'));_0x25260d[_0x641f('0x59')][_0x641f('0x60')]=_0x25260d[_0x641f('0x59')]['UserId']||_0x25260d[_0x641f('0x61')]['id'];return db['SmsMessage']['find']({'where':{'id':_0x25260d['params']['id'],'UserId':null},'include':[{'model':db[_0x641f('0x62')],'as':_0x641f('0x63')}]})['then'](handleEntityNotFound(_0x56d540,null))[_0x641f('0x23')](saveUpdates(_0x25260d[_0x641f('0x59')],null))['then'](function(_0x4b5dae){if(_0x4b5dae){_0x910a53[_0x641f('0x2b')]=_0x4b5dae[_0x641f('0x64')]({'plain':!![]});return db['SmsInteraction'][_0x641f('0x5a')]({'where':{'id':_0x4b5dae['SmsInteractionId']}});}return null;})[_0x641f('0x23')](handleEntityNotFound(_0x56d540,null))['then'](function(_0x51e664){if(_0x51e664){return _0x51e664[_0x641f('0x36')]({'UserId':_0x25260d[_0x641f('0x59')][_0x641f('0x60')],'read1stAt':_[_0x641f('0x65')](_0x51e664[_0x641f('0x66')])?moment()[_0x641f('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x641f('0x23')](function(_0x3528f2){if(_0x3528f2){_0x910a53[_0x641f('0x67')]=_0x3528f2[_0x641f('0x64')]({'plain':!![]});interaction_log[_0x641f('0x24')](_0x641f('0x68'),_0x25260d['user']['id'],_0x25260d[_0x641f('0x61')][_0x641f('0x4f')],_0x25260d[_0x641f('0x61')]['role'],_0x910a53[_0x641f('0x67')]['id'],_0x25260d[_0x641f('0x59')]?JSON[_0x641f('0x28')](_0x25260d[_0x641f('0x59')]):_0x641f('0x69'));return respondWithRpcPromise(_0x641f('0x6a'),_0x641f('0x6b'),_0x910a53);}return null;})[_0x641f('0x23')](function(_0x28418c){if(_0x28418c){if(_0x25260d['body']['manual']){_0x910a53[_0x641f('0x2b')][_0x641f('0x6c')]=util[_0x641f('0x5e')](_0x641f('0x6d'),_0x25260d[_0x641f('0x61')][_0x641f('0x4f')]);_0x910a53['message']['channel']=_0x910a53[_0x641f('0x6e')];_0x910a53[_0x641f('0x2b')][_0x641f('0x6f')]=_0x641f('0x5c');return respondWithRpcPromise(_0x641f('0x70'),_0x641f('0x70'),{'event':_0x641f('0x71'),'message':_0x910a53[_0x641f('0x2b')]},client9002)['then'](function(){return _0x910a53;});}return _0x910a53;}return null;})[_0x641f('0x23')](respondWithResult(_0x56d540,null))[_0x641f('0x2d')](handleError(_0x56d540,null));};var interaction_log=require('../../config/logger')(_0x641f('0x72'));exports[_0x641f('0x34')]=function(_0x4a6025,_0x461209,_0x4cdbe9){var _0x4c2e92={'agent':{},'channel':_0x641f('0x5d')};if(_0x4a6025[_0x641f('0x59')]['id']){delete _0x4a6025['body']['id'];}_0x4a6025[_0x641f('0x59')][_0x641f('0x60')]=_0x4a6025[_0x641f('0x59')][_0x641f('0x60')]||_0x4a6025['user']['id'];_0x4c2e92[_0x641f('0x73')]['id']=_0x4a6025[_0x641f('0x59')]['UserId'];return db[_0x641f('0x54')][_0x641f('0x5a')]({'where':{'id':_0x4a6025['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x461209,null))['then'](function(_0x20583f){if(_0x20583f){_0x4c2e92[_0x641f('0x2b')]=_0x20583f[_0x641f('0x64')]({'plain':!![]});return db[_0x641f('0x74')]['find']({'where':{'id':_0x20583f[_0x641f('0x75')]}});}return null;})[_0x641f('0x23')](handleEntityNotFound(_0x461209,null))[_0x641f('0x23')](function(_0x56ebc3){if(_0x56ebc3){_0x4c2e92[_0x641f('0x67')]=_0x56ebc3[_0x641f('0x64')]({'plain':!![]});interaction_log[_0x641f('0x24')](_0x641f('0x76'),_0x4a6025[_0x641f('0x61')]['id'],_0x4a6025['user']['name'],_0x4a6025[_0x641f('0x61')][_0x641f('0x77')],_0x4c2e92[_0x641f('0x67')]['id'],_0x4a6025[_0x641f('0x59')]?JSON[_0x641f('0x28')](_0x4a6025[_0x641f('0x59')]):_0x641f('0x69'));return respondWithRpcPromise('RejectMessage',_0x641f('0x78'),_0x4c2e92);}return null;})[_0x641f('0x23')](function(_0x192d49){if(_0x192d49){_0x192d49[_0x641f('0x2b')][_0x641f('0x6c')]=util[_0x641f('0x5e')]('SIP/%s',_0x4a6025[_0x641f('0x61')][_0x641f('0x4f')]);_0x192d49[_0x641f('0x2b')][_0x641f('0x6e')]=_0x4c2e92[_0x641f('0x6e')];_0x192d49['message'][_0x641f('0x6f')]='reject';respondWithRpcPromise(_0x641f('0x70'),_0x641f('0x70'),{'event':_0x641f('0x79'),'message':_0x192d49[_0x641f('0x2b')]},client9002);return _0x4c2e92;}return null;})[_0x641f('0x23')](respondWithResult(_0x461209,null))[_0x641f('0x2d')](handleError(_0x461209,null));};exports[_0x641f('0x2f')]=function(_0x43637f,_0x12159b,_0x56324b){if(_0x43637f['body']['id']){delete _0x43637f['body']['id'];}var _0x35a3c1;return db[_0x641f('0x54')]['find']({'where':{'id':_0x43637f['params']['id']}})[_0x641f('0x23')](handleEntityNotFound(_0x12159b,null))[_0x641f('0x23')](function(_0x30195a){if(_0x30195a){_0x35a3c1=_0x30195a;return db[_0x641f('0x7a')][_0x641f('0x5a')]({'where':{'id':_0x30195a['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x12159b,null))[_0x641f('0x23')](function(_0x19335b){if(_0x19335b){logger[_0x641f('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x641f('0x2f'),_0x641f('0x7b'),_0x19335b[_0x641f('0x4d')],util[_0x641f('0x7c')](_0x43637f[_0x641f('0x59')],{'showHidden':![],'depth':null}));switch(_0x19335b[_0x641f('0x4d')]){case _0x641f('0x7d'):if(_0x43637f[_0x641f('0x59')]['MessageSid']&&_0x43637f[_0x641f('0x59')]['MessageSid']===_0x35a3c1[_0x641f('0x7e')]){return _0x35a3c1[_0x641f('0x36')]({'read':!![]});}else{logger[_0x641f('0x29')](_0x641f('0x7f'),_0x641f('0x2f'),_0x641f('0x7d'),util[_0x641f('0x7c')](_0x43637f['body'],{'showHidden':![],'depth':null}));}break;case _0x641f('0x80'):if(_0x43637f[_0x641f('0x59')][_0x641f('0x81')]&&_0x43637f[_0x641f('0x59')][_0x641f('0x81')]===_0x35a3c1[_0x641f('0x7e')]&&_[_0x641f('0x82')]([_0x641f('0x83'),_0x641f('0x84')],_0x43637f[_0x641f('0x59')][_0x641f('0x85')])>=0x0){return _0x35a3c1[_0x641f('0x36')]({'read':!![]});}else{logger[_0x641f('0x29')](_0x641f('0x7f'),'status',_0x641f('0x86'),util[_0x641f('0x7c')](_0x43637f['body'],{'showHidden':![],'depth':null}));}break;case _0x641f('0x87'):var _0x4da1b7=_0x43637f[_0x641f('0x59')][_0x641f('0x88')][0x0];if(_0x4da1b7[_0x641f('0x2f')][_0x641f('0x89')]==='DELIVERED'){return _0x35a3c1['update']({'read':!![]});}else{logger[_0x641f('0x29')](_0x641f('0x7f'),_0x641f('0x2f'),'infobip',util[_0x641f('0x7c')](_0x43637f[_0x641f('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x35a3c1;}})[_0x641f('0x23')](respondWithResult(_0x12159b,null))[_0x641f('0x2d')](handleError(_0x12159b,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index f8e94ca..46325b7 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 _0x0d17=['remove','hook','exports','../../mysqldb','SmsMessage','save','update'];(function(_0x217501,_0x13e5cf){var _0x504e20=function(_0x150011){while(--_0x150011){_0x217501['push'](_0x217501['shift']());}};_0x504e20(++_0x13e5cf);}(_0x0d17,0x73));var _0x70d1=function(_0x222235,_0x38059c){_0x222235=_0x222235-0x0;var _0x5c4d76=_0x0d17[_0x222235];return _0x5c4d76;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x70d1('0x0'))['db'][_0x70d1('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x70d1('0x2'),'afterUpdate':_0x70d1('0x3'),'afterDestroy':_0x70d1('0x4')};function emitEvent(_0x51ff88){return function(_0x12c001,_0x42eb04,_0xff3b93){SmsMessageEvents['emit'](_0x51ff88+':'+_0x12c001['id'],_0x12c001);SmsMessageEvents['emit'](_0x51ff88,_0x12c001);_0xff3b93(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x70d1('0x5')](e,emitEvent(event));}}module[_0x70d1('0x6')]=SmsMessageEvents; \ No newline at end of file +var _0x0569=['hasOwnProperty','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x42a79f,_0x1020c5){var _0x2f4f36=function(_0x6d478e){while(--_0x6d478e){_0x42a79f['push'](_0x42a79f['shift']());}};_0x2f4f36(++_0x1020c5);}(_0x0569,0x172));var _0x9056=function(_0x188d31,_0x576e87){_0x188d31=_0x188d31-0x0;var _0x30ed33=_0x0569[_0x188d31];return _0x30ed33;};'use strict';var EventEmitter=require(_0x9056('0x0'));var SmsMessage=require(_0x9056('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9056('0x2'),'afterUpdate':_0x9056('0x3'),'afterDestroy':_0x9056('0x4')};function emitEvent(_0x462b59){return function(_0x4ab737,_0x5a178b,_0x382c6b){SmsMessageEvents['emit'](_0x462b59+':'+_0x4ab737['id'],_0x4ab737);SmsMessageEvents[_0x9056('0x5')](_0x462b59,_0x4ab737);_0x382c6b(null);};}for(var e in events){if(events[_0x9056('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x9056('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 100c273..0c233ea 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 _0xeb92=['models','get','direction','out','secret','UserId','SmsInteraction','SmsInteractionId','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','afterCreate','twilio','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','https://api.skebby.it/API/v1.0/REST/','password','body','smsMethod','login?username=','username','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','Missing\x20parameters:\x20username,\x20password','senderString','requestid','deliveryReport','read','connectel','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','apiKey','login','sender','text','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','messageId','fti_sms_messages','FULLTEXT'];(function(_0x20f4fb,_0xd72db5){var _0x51e9b2=function(_0x4cf0d8){while(--_0x4cf0d8){_0x20f4fb['push'](_0x20f4fb['shift']());}};_0x51e9b2(++_0xd72db5);}(_0xeb92,0x166));var _0x2eb9=function(_0x4dc747,_0x35333b){_0x4dc747=_0x4dc747-0x0;var _0x3a6b83=_0xeb92[_0x4dc747];return _0x3a6b83;};'use strict';var _=require(_0x2eb9('0x0'));var util=require(_0x2eb9('0x1'));var logger=require(_0x2eb9('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2eb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2eb9('0x4'));var rimraf=require(_0x2eb9('0x5'));var config=require(_0x2eb9('0x6'));var attributes=require(_0x2eb9('0x7'));module[_0x2eb9('0x8')]=function(_0x367bc2,_0x4584b6){return _0x367bc2[_0x2eb9('0x9')](_0x2eb9('0xa'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x2eb9('0xb'),'fields':['messageId']},{'name':_0x2eb9('0xc'),'fields':['body'],'type':_0x2eb9('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xfa1a3c,_0x1d8215,_0x3fd592){var _0x4df402=_0x367bc2[_0x2eb9('0xe')];var _0x379b8b=_0xfa1a3c[_0x2eb9('0xf')]({'plain':!![]});if(_0x379b8b['direction']['toLowerCase']()==='in'||_0x379b8b[_0x2eb9('0x10')]['toLowerCase']()===_0x2eb9('0x11')&&!_0x379b8b[_0x2eb9('0x12')]&&!_['isNil'](_0x379b8b[_0x2eb9('0x13')])){_0x4df402[_0x2eb9('0x14')]['findOne']({'where':{'id':_0x379b8b[_0x2eb9('0x15')]}})[_0x2eb9('0x16')](function(_0x2a6a64){if(_0x2a6a64){_0x2a6a64[_0x2eb9('0x17')]({'lastMsgAt':_0x379b8b[_0x2eb9('0x18')],'lastMsgDirection':_0x379b8b[_0x2eb9('0x10')]['toLowerCase']()});}})[_0x2eb9('0x19')](function(_0x561a25){console[_0x2eb9('0x1a')](_0x561a25);});}if(_0x379b8b[_0x2eb9('0x10')]==='out'&&!_0x379b8b[_0x2eb9('0x12')]){var _0x35e454;_0x4df402[_0x2eb9('0x1b')][_0x2eb9('0x1c')]({'where':{'id':_0x379b8b[_0x2eb9('0x1d')]},'raw':!![]})['then'](function(_0x738dca){_0x35e454=_0x738dca;if(_0x35e454&&_0x35e454['type']){switch(_0x35e454[_0x2eb9('0x1e')]){case'twilio':var _0x37f6d7=require('twilio');if(_0x35e454[_0x2eb9('0x1f')]&&_0x35e454[_0x2eb9('0x20')]&&_0x35e454[_0x2eb9('0x21')]){var _0x19fa74=new _0x37f6d7(_0x35e454[_0x2eb9('0x1f')],_0x35e454['authToken']);_0x19fa74[_0x2eb9('0x22')][_0x2eb9('0x23')]({'body':_0x379b8b['body'],'to':_0x379b8b[_0x2eb9('0x21')],'from':_0x35e454[_0x2eb9('0x21')],'statusCallback':_0x35e454[_0x2eb9('0x24')]+_0x2eb9('0x25')+_0x379b8b['id']+_0x2eb9('0x26')+_0x35e454[_0x2eb9('0x27')]})['then'](function(_0x4f704e){if(_0x4f704e['sid']){return _0xfa1a3c['update']({'messageId':_0x4f704e[_0x2eb9('0x28')]});}})[_0x2eb9('0x19')](function(_0x276047){logger[_0x2eb9('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2eb9('0x29'),_0x2eb9('0x2a'),util[_0x2eb9('0x2b')](_0x276047,{'showHidden':![],'depth':null}));});}else{logger[_0x2eb9('0x1a')](_0x2eb9('0x2c'),'afterCreate',_0x2eb9('0x2a'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x2eb9('0x2d'):var _0x5e35a6=_0x2eb9('0x2e');if(_0x35e454['username']&&_0x35e454[_0x2eb9('0x2f')]){var _0x5b4e88={'recipient':[_0x379b8b['phone']],'message':_0x379b8b[_0x2eb9('0x30')],'message_type':_0x35e454[_0x2eb9('0x31')]};if(_0x35e454['smsMethod']&&_0x35e454[_0x2eb9('0x31')]!=='SI'){_0x5b4e88['sender']=_0x35e454['phone'];}var _0x25db82={'url':_0x5e35a6+_0x2eb9('0x32')+_0x35e454[_0x2eb9('0x33')]+'&password='+_0x35e454[_0x2eb9('0x2f')],'method':_0x2eb9('0x34')};rp(_0x25db82)[_0x2eb9('0x16')](function(_0x4f4c2d){var _0x3b2b04=_0x4f4c2d[_0x2eb9('0x35')](';');var _0x3df2a2={'user_key':_0x3b2b04[0x0],'session_key':_0x3b2b04[0x1]};_0x25db82={'url':_0x5e35a6+_0x2eb9('0x36'),'method':_0x2eb9('0x37'),'headers':{'user_key':_0x3df2a2[_0x2eb9('0x38')],'Session_key':_0x3df2a2[_0x2eb9('0x39')]},'json':!![],'body':_0x5b4e88};return rp(_0x25db82);})['then'](function(_0x2c366d){if(_0x2c366d[_0x2eb9('0x3a')]>=0x1){var _0x204ae4={'messageId':_0x2c366d[_0x2eb9('0x3b')]};if(_0x35e454[_0x2eb9('0x31')]!=='GP'||!_0x35e454['deliveryReport']){_0x204ae4['read']=!![];}return _0xfa1a3c[_0x2eb9('0x17')](_0x204ae4);}else{return logger[_0x2eb9('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby',util[_0x2eb9('0x2b')](_0x2c366d,{'showHidden':![],'depth':null}));}})[_0x2eb9('0x19')](function(_0x28932b){return logger['error'](_0x2eb9('0x2c'),_0x2eb9('0x29'),_0x2eb9('0x2d'),util[_0x2eb9('0x2b')](_0x28932b,{'showHidden':![],'depth':null}));});}else{logger[_0x2eb9('0x1a')](_0x2eb9('0x2c'),_0x2eb9('0x29'),'skebby',_0x2eb9('0x3c'));}break;case'connectel':if(_0x35e454[_0x2eb9('0x20')]){var _0x323d8e={'recipient':_0x379b8b[_0x2eb9('0x21')],'message':_0x379b8b['body'],'sender':_0x35e454[_0x2eb9('0x3d')]||_0x35e454[_0x2eb9('0x21')],'authorization':_0x35e454[_0x2eb9('0x20')]};var _0x1d8215={'method':_0x2eb9('0x37'),'uri':'https://smsapi.connectel.se/api/send/','body':_0x323d8e,'json':!![]};rp(_0x1d8215)['then'](function(_0x279598){var _0x6c603c={'messageId':_0x279598[_0x2eb9('0x3e')]};if(!_0x35e454[_0x2eb9('0x3f')]){_0x6c603c[_0x2eb9('0x40')]=!![];}return _0xfa1a3c[_0x2eb9('0x17')](_0x6c603c);})[_0x2eb9('0x19')](function(_0x137916){logger[_0x2eb9('0x1a')](_0x2eb9('0x2c'),_0x2eb9('0x29'),'connectel',util[_0x2eb9('0x2b')](_0x137916,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2eb9('0x2c'),_0x2eb9('0x29'),_0x2eb9('0x41'),_0x2eb9('0x42'));}break;case'clicksend':if(_0x35e454[_0x2eb9('0x33')]&&_0x35e454[_0x2eb9('0x2f')]){var _0x323d8e={'messages':[{'source':_0x2eb9('0x43'),'to':_0x379b8b[_0x2eb9('0x21')],'body':_0x379b8b[_0x2eb9('0x30')],'from':_0x35e454[_0x2eb9('0x3d')]||_0x35e454[_0x2eb9('0x21')]}]};var _0x5fe2e5=util['format'](_0x2eb9('0x44'),_0x35e454[_0x2eb9('0x33')],_0x35e454[_0x2eb9('0x2f')]);var _0x1d8215={'method':_0x2eb9('0x37'),'uri':_0x2eb9('0x45'),'body':_0x323d8e,'headers':{'Authorization':util[_0x2eb9('0x46')](_0x2eb9('0x47'),new Buffer(_0x5fe2e5)[_0x2eb9('0x48')](_0x2eb9('0x49')))},'json':!![]};rp(_0x1d8215)['then'](function(_0x5b2779){if(_0x5b2779[_0x2eb9('0x4a')]>=0xc8&&_0x5b2779[_0x2eb9('0x4a')]<=0xce){if(_0x5b2779['data']&&_0x5b2779[_0x2eb9('0x4b')][_0x2eb9('0x4c')]>0x0){var _0x1f3dbd=_[_0x2eb9('0x4d')](_0x5b2779[_0x2eb9('0x4b')][_0x2eb9('0x22')]);var _0x1c4d55={'messageId':_0x1f3dbd[_0x2eb9('0x4e')]};if(!_0x35e454['deliveryReport']){_0x1c4d55[_0x2eb9('0x40')]=!![];}return _0xfa1a3c[_0x2eb9('0x17')](_0x1c4d55);}else{logger['error'](_0x2eb9('0x2c'),'afterCreate',_0x2eb9('0x4f'),util['inspect'](_0x5b2779,{'showHidden':![],'depth':null}));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2eb9('0x29'),'clickSend',util[_0x2eb9('0x2b')](_0x5b2779,{'showHidden':![],'depth':null}));}})[_0x2eb9('0x19')](function(_0x35dc7b){logger[_0x2eb9('0x1a')](_0x2eb9('0x2c'),_0x2eb9('0x29'),_0x2eb9('0x4f'),util['inspect'](_0x35dc7b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2eb9('0x2c'),_0x2eb9('0x29'),_0x2eb9('0x4f'),_0x2eb9('0x3c'));}break;case _0x2eb9('0x50'):if(_0x35e454['authId']&&_0x35e454[_0x2eb9('0x20')]){var _0x323d8e={'dst':_0x379b8b['phone'],'text':_0x379b8b['body'],'src':_0x35e454[_0x2eb9('0x3d')]||_0x35e454[_0x2eb9('0x21')],'url':_0x35e454[_0x2eb9('0x24')]+_0x2eb9('0x25')+_0x379b8b['id']+_0x2eb9('0x26')+_0x35e454[_0x2eb9('0x27')]};var _0x5fe2e5=util[_0x2eb9('0x46')](_0x2eb9('0x44'),_0x35e454[_0x2eb9('0x51')],_0x35e454[_0x2eb9('0x20')]);var _0x1d8215={'method':_0x2eb9('0x37'),'uri':util[_0x2eb9('0x46')](_0x2eb9('0x52'),_0x35e454['authId']),'body':_0x323d8e,'headers':{'Authorization':util['format'](_0x2eb9('0x47'),new Buffer(_0x5fe2e5)[_0x2eb9('0x48')](_0x2eb9('0x49')))},'json':!![]};rp(_0x1d8215)[_0x2eb9('0x16')](function(_0x136bfc){var _0x36f03c={'messageId':_0x136bfc[_0x2eb9('0x53')][0x0]};return _0xfa1a3c['update'](_0x36f03c);})[_0x2eb9('0x19')](function(_0x37c380){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2eb9('0x29'),'plivo',util[_0x2eb9('0x2b')](_0x37c380,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x2eb9('0x50'),_0x2eb9('0x54'));}break;case'infobip':if(_0x35e454[_0x2eb9('0x33')]&&_0x35e454[_0x2eb9('0x2f')]){if(_0x35e454[_0x2eb9('0x55')]){var _0x3908b2={'method':'POST','uri':_0x35e454['baseUrl']+_0x2eb9('0x56'),'body':{'username':_0x35e454['username'],'password':_0x35e454[_0x2eb9('0x2f')]},'json':!![]};return rp(_0x3908b2)['then'](function(_0x36a9f7){var _0x3989d2={'method':_0x2eb9('0x37'),'uri':_0x35e454['baseUrl']+_0x2eb9('0x57'),'body':{'messages':[{'from':_0x35e454[_0x2eb9('0x21')],'destinations':[{'to':_0x379b8b[_0x2eb9('0x21')]}],'text':_0x379b8b[_0x2eb9('0x30')],'notifyUrl':_0x35e454[_0x2eb9('0x24')]+'/api/sms/messages/'+_0x379b8b['id']+_0x2eb9('0x26')+_0x35e454[_0x2eb9('0x27')],'notifyContentType':_0x2eb9('0x58'),'callbackData':_0x35e454[_0x2eb9('0x21')]+';'+_0x379b8b[_0x2eb9('0x30')]}]},'headers':{'Authorization':_0x2eb9('0x59')+_0x36a9f7['token']},'json':!![]};return rp(_0x3989d2)['then'](function(_0x591be9){if(_0x591be9[_0x2eb9('0x22')]){var _0x78f828={'messageId':_0x591be9[_0x2eb9('0x22')][0x0][_0x2eb9('0xb')]};if(!_0x35e454[_0x2eb9('0x3f')]){_0x78f828[_0x2eb9('0x40')]=!![];}return _0xfa1a3c[_0x2eb9('0x17')](_0x78f828);}else{return logger[_0x2eb9('0x1a')](_0x2eb9('0x2c'),_0x2eb9('0x29'),_0x2eb9('0x5a'),util[_0x2eb9('0x2b')](_0x591be9,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x1c9066){return logger[_0x2eb9('0x1a')](_0x2eb9('0x2c'),_0x2eb9('0x29'),_0x2eb9('0x5a'),util[_0x2eb9('0x2b')](_0x1c9066,{'showHidden':![],'depth':null}));});}else{logger[_0x2eb9('0x1a')](_0x2eb9('0x2c'),'afterCreate',_0x2eb9('0x5a'),_0x2eb9('0x5b'));}}else{logger[_0x2eb9('0x1a')](_0x2eb9('0x2c'),'afterCreate',_0x2eb9('0x5a'),_0x2eb9('0x3c'));}break;case _0x2eb9('0x5c'):var _0x12a4f4=require('crypto');if(_0x35e454[_0x2eb9('0x5d')]){var _0xfdbfe9={};_0xfdbfe9[_0x2eb9('0x5e')]=_0x35e454[_0x2eb9('0x33')];_0xfdbfe9[_0x2eb9('0x21')]=_0x379b8b[_0x2eb9('0x21')];_0xfdbfe9[_0x2eb9('0x5f')]=_0x35e454[_0x2eb9('0x21')];_0xfdbfe9[_0x2eb9('0x60')]=_0x379b8b[_0x2eb9('0x30')];_0xfdbfe9[_0x2eb9('0x61')]=+new Date();var _0x5440e7='';var _0x473b94='';var _0x5a034f=Object[_0x2eb9('0x62')](_0xfdbfe9);_0x5a034f[_0x2eb9('0x63')]();for(var _0x3e9fd4=0x0;_0x3e9fd4<_0x5a034f[_0x2eb9('0x64')];_0x3e9fd4++){if(_0x5440e7!=''){_0x5440e7+='&';}_0x5440e7+=_0x5a034f[_0x3e9fd4]+'='+encodeURIComponent(_0xfdbfe9[_0x5a034f[_0x3e9fd4]]);_0x473b94+=_0xfdbfe9[_0x5a034f[_0x3e9fd4]];}_0x473b94+=_0x35e454['apiKey'];_0x473b94=_0x12a4f4[_0x2eb9('0x65')](_0x2eb9('0x66'))[_0x2eb9('0x17')](_0x473b94)[_0x2eb9('0x67')](_0x2eb9('0x68'));if(_0x5440e7!==''){_0x5440e7+='&';}_0x5440e7+=_0x2eb9('0x69')+_0x473b94;var _0x25db82={'method':'GET','uri':_0x35e454[_0x2eb9('0x55')]+_0x2eb9('0x6a')+_0x5440e7,'json':!![]};return rp(_0x25db82)[_0x2eb9('0x16')](function(_0x5ab104){var _0x23d115=Object['keys'](_0x5ab104);if(_0x5ab104[_0x23d115[0x0]]['error']&&parseInt(_0x5ab104[_0x23d115[0x0]][_0x2eb9('0x1a')])===0x0){var _0x3c9b28={'messageId':_0x5ab104[_0x23d115[0x0]]['id_sms']};if(!_0x35e454[_0x2eb9('0x3f')]){_0x3c9b28[_0x2eb9('0x40')]=!![];}return _0xfa1a3c[_0x2eb9('0x17')](_0x3c9b28);}else{return logger['error'](_0x2eb9('0x2c'),_0x2eb9('0x29'),_0x2eb9('0x5c'),util[_0x2eb9('0x2b')](_0x5ab104['error'],{'showHidden':![],'depth':null}));}})[_0x2eb9('0x19')](function(_0x4fd82c){return logger[_0x2eb9('0x1a')](_0x2eb9('0x2c'),_0x2eb9('0x29'),_0x2eb9('0x5c'),util[_0x2eb9('0x2b')](_0x4fd82c,{'showHidden':![],'depth':null}));});}else{logger[_0x2eb9('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2eb9('0x29'),'csc',_0x2eb9('0x6b'));}break;case'clickatell':if(_0x35e454[_0x2eb9('0x5d')]){var _0x14a30b={'method':_0x2eb9('0x37'),'uri':_0x2eb9('0x6c'),'headers':{'Authorization':_0x35e454[_0x2eb9('0x5d')]},'body':{'content':_0x379b8b[_0x2eb9('0x30')],'to':[_0x379b8b[_0x2eb9('0x21')]],'from':_0x35e454[_0x2eb9('0x21')],'binary':![],'clientMessageId':_0x2eb9('0x6d'),'charset':_0x2eb9('0x6e')},'json':!![]};rp(_0x14a30b)[_0x2eb9('0x16')](function(_0x4391da){if(!_0x4391da['error']){var _0x338d21={'messageId':_0x4391da[_0x2eb9('0x22')][0x0][_0x2eb9('0x6f')]};if(!_0x35e454['deliveryReport']){_0x338d21[_0x2eb9('0x40')]=!![];}return _0xfa1a3c[_0x2eb9('0x17')](_0x338d21);}else{return logger[_0x2eb9('0x1a')](_0x2eb9('0x2c'),_0x2eb9('0x29'),_0x2eb9('0x70'),util[_0x2eb9('0x2b')](_0x4391da[_0x2eb9('0x1a')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x3562e6){return logger[_0x2eb9('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2eb9('0x29'),'clickatell',util['inspect'](_0x3562e6,{'showHidden':![],'depth':null}));});}else{logger[_0x2eb9('0x1a')](_0x2eb9('0x2c'),_0x2eb9('0x29'),_0x2eb9('0x70'),_0x2eb9('0x6b'));}break;case'intelepeer':if(_0x35e454[_0x2eb9('0x5d')]){var _0xd5d893={};var _0x25db82={'method':_0x2eb9('0x37'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x2eb9('0x71')+_0x35e454[_0x2eb9('0x5d')],'Content-Type':'application/json'},'body':{'from':_0x35e454[_0x2eb9('0x21')],'to':_0x379b8b['phone'],'text':_0x379b8b['body']},'json':!![]};return rp(_0x25db82)[_0x2eb9('0x16')](function(_0x2ef52d){if(_0x2ef52d[_0x2eb9('0x72')]==0xca){_0xd5d893[_0x2eb9('0x73')]=_0x2ef52d;var _0x4adc21={'method':'POST','uri':_0x2eb9('0x74'),'headers':{'Authorization':_0x2eb9('0x71')+_0x35e454[_0x2eb9('0x5d')],'Content-Type':'application/json'},'body':{'refid':_0xd5d893[_0x2eb9('0x73')][_0x2eb9('0x75')]},'json':!![]};return rp(_0x4adc21)[_0x2eb9('0x16')](function(_0x304e4f){_0xd5d893[_0x2eb9('0x76')]=_0x304e4f;var _0x1b98c0={'messageId':_0xd5d893['message']['refid'],'read':!![]};return _0xfa1a3c[_0x2eb9('0x17')](_0x1b98c0);});}else{return logger[_0x2eb9('0x1a')](_0x2eb9('0x2c'),'afterCreate','intelepeer',util[_0x2eb9('0x2b')](_0x2ef52d,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2c5cb5){return logger[_0x2eb9('0x1a')](_0x2eb9('0x2c'),_0x2eb9('0x29'),_0x2eb9('0x77'),util[_0x2eb9('0x2b')](_0x2c5cb5,{'showHidden':![],'depth':null}));});}else{return logger[_0x2eb9('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2eb9('0x29'),_0x2eb9('0x77'),_0x2eb9('0x78'));}break;}}})[_0x2eb9('0x79')](function(){_0x3fd592();});}else{_0x3fd592();}}},'charset':_0x2eb9('0x7a'),'collate':_0x2eb9('0x7b')});}; \ No newline at end of file +var _0x69f8=['FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','SmsInteractionId','then','update','createdAt','catch','error','SmsAccount','SmsAccountId','type','accountSid','authToken','phone','messages','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','internal_order_id','deliveryReport','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/send/','requestid','read','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','Basic\x20%s','base64','http_code','data','queued_count','head','message_id','clickSend','authId','remote','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','apiKey','text','timestamp','keys','length','createHash','md5','digest','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid','apiMessageId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','intelepeer','Token\x20not\x20received','finally','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body'];(function(_0x142d30,_0x21a70e){var _0x2f6a1e=function(_0x27049b){while(--_0x27049b){_0x142d30['push'](_0x142d30['shift']());}};_0x2f6a1e(++_0x21a70e);}(_0x69f8,0x68));var _0x869f=function(_0x5bd8c4,_0x4b7f1c){_0x5bd8c4=_0x5bd8c4-0x0;var _0x443837=_0x69f8[_0x5bd8c4];return _0x443837;};'use strict';var _=require('lodash');var util=require(_0x869f('0x0'));var logger=require(_0x869f('0x1'))('api');var moment=require(_0x869f('0x2'));var BPromise=require('bluebird');var rp=require(_0x869f('0x3'));var fs=require('fs');var path=require(_0x869f('0x4'));var rimraf=require(_0x869f('0x5'));var config=require(_0x869f('0x6'));var attributes=require('./smsMessage.attributes');module['exports']=function(_0x401f97,_0x2fc68a){return _0x401f97[_0x869f('0x7')](_0x869f('0x8'),attributes,{'tableName':_0x869f('0x9'),'paranoid':![],'indexes':[{'name':_0x869f('0xa'),'fields':[_0x869f('0xa')]},{'name':_0x869f('0xb'),'fields':[_0x869f('0xc')],'type':_0x869f('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x276375,_0x5aadcf,_0x18df42){var _0x39e0f0=_0x401f97[_0x869f('0xe')];var _0xdfc98a=_0x276375[_0x869f('0xf')]({'plain':!![]});if(_0xdfc98a[_0x869f('0x10')][_0x869f('0x11')]()==='in'||_0xdfc98a[_0x869f('0x10')]['toLowerCase']()===_0x869f('0x12')&&!_0xdfc98a[_0x869f('0x13')]&&!_[_0x869f('0x14')](_0xdfc98a[_0x869f('0x15')])){_0x39e0f0[_0x869f('0x16')]['findOne']({'where':{'id':_0xdfc98a[_0x869f('0x17')]}})[_0x869f('0x18')](function(_0x56cf5b){if(_0x56cf5b){_0x56cf5b[_0x869f('0x19')]({'lastMsgAt':_0xdfc98a[_0x869f('0x1a')],'lastMsgDirection':_0xdfc98a[_0x869f('0x10')]['toLowerCase']()});}})[_0x869f('0x1b')](function(_0x20388f){console[_0x869f('0x1c')](_0x20388f);});}if(_0xdfc98a['direction']===_0x869f('0x12')&&!_0xdfc98a['secret']){var _0x461657;_0x39e0f0[_0x869f('0x1d')]['find']({'where':{'id':_0xdfc98a[_0x869f('0x1e')]},'raw':!![]})[_0x869f('0x18')](function(_0x351da5){_0x461657=_0x351da5;if(_0x461657&&_0x461657[_0x869f('0x1f')]){switch(_0x461657[_0x869f('0x1f')]){case'twilio':var _0x5f4544=require('twilio');if(_0x461657[_0x869f('0x20')]&&_0x461657[_0x869f('0x21')]&&_0x461657[_0x869f('0x22')]){var _0x4b2592=new _0x5f4544(_0x461657[_0x869f('0x20')],_0x461657[_0x869f('0x21')]);_0x4b2592[_0x869f('0x23')]['create']({'body':_0xdfc98a[_0x869f('0xc')],'to':_0xdfc98a[_0x869f('0x22')],'from':_0x461657[_0x869f('0x22')],'statusCallback':_0x461657['remote']+_0x869f('0x24')+_0xdfc98a['id']+_0x869f('0x25')+_0x461657[_0x869f('0x26')]})[_0x869f('0x18')](function(_0x6ff489){if(_0x6ff489[_0x869f('0x27')]){return _0x276375[_0x869f('0x19')]({'messageId':_0x6ff489[_0x869f('0x27')]});}})['catch'](function(_0x1c6625){logger['error'](_0x869f('0x28'),_0x869f('0x29'),_0x869f('0x2a'),util[_0x869f('0x2b')](_0x1c6625,{'showHidden':![],'depth':null}));});}else{logger[_0x869f('0x1c')](_0x869f('0x28'),_0x869f('0x29'),'twilio',_0x869f('0x2c'));}break;case _0x869f('0x2d'):var _0x568df3=_0x869f('0x2e');if(_0x461657[_0x869f('0x2f')]&&_0x461657[_0x869f('0x30')]){var _0x26780a={'recipient':[_0xdfc98a['phone']],'message':_0xdfc98a[_0x869f('0xc')],'message_type':_0x461657[_0x869f('0x31')]};if(_0x461657[_0x869f('0x31')]&&_0x461657[_0x869f('0x31')]!=='SI'){_0x26780a[_0x869f('0x32')]=_0x461657[_0x869f('0x22')];}var _0x29cd3f={'url':_0x568df3+_0x869f('0x33')+_0x461657[_0x869f('0x2f')]+_0x869f('0x34')+_0x461657[_0x869f('0x30')],'method':_0x869f('0x35')};rp(_0x29cd3f)[_0x869f('0x18')](function(_0x5dac26){var _0x2c798f=_0x5dac26[_0x869f('0x36')](';');var _0x41c8b0={'user_key':_0x2c798f[0x0],'session_key':_0x2c798f[0x1]};_0x29cd3f={'url':_0x568df3+_0x869f('0x37'),'method':_0x869f('0x38'),'headers':{'user_key':_0x41c8b0[_0x869f('0x39')],'Session_key':_0x41c8b0[_0x869f('0x3a')]},'json':!![],'body':_0x26780a};return rp(_0x29cd3f);})['then'](function(_0x598d6c){if(_0x598d6c['total_sent']>=0x1){var _0x53d74f={'messageId':_0x598d6c[_0x869f('0x3b')]};if(_0x461657[_0x869f('0x31')]!=='GP'||!_0x461657[_0x869f('0x3c')]){_0x53d74f['read']=!![];}return _0x276375[_0x869f('0x19')](_0x53d74f);}else{return logger['error'](_0x869f('0x28'),_0x869f('0x29'),'skebby',util[_0x869f('0x2b')](_0x598d6c,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3a0c3b){return logger[_0x869f('0x1c')](_0x869f('0x28'),_0x869f('0x29'),_0x869f('0x2d'),util[_0x869f('0x2b')](_0x3a0c3b,{'showHidden':![],'depth':null}));});}else{logger[_0x869f('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x869f('0x2d'),_0x869f('0x3d'));}break;case _0x869f('0x3e'):if(_0x461657[_0x869f('0x21')]){var _0x35b86d={'recipient':_0xdfc98a['phone'],'message':_0xdfc98a[_0x869f('0xc')],'sender':_0x461657[_0x869f('0x3f')]||_0x461657[_0x869f('0x22')],'authorization':_0x461657[_0x869f('0x21')]};var _0x5aadcf={'method':'POST','uri':_0x869f('0x40'),'body':_0x35b86d,'json':!![]};rp(_0x5aadcf)['then'](function(_0x57cf06){var _0x38b02f={'messageId':_0x57cf06[_0x869f('0x41')]};if(!_0x461657[_0x869f('0x3c')]){_0x38b02f[_0x869f('0x42')]=!![];}return _0x276375['update'](_0x38b02f);})[_0x869f('0x1b')](function(_0x201928){logger[_0x869f('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x869f('0x29'),'connectel',util['inspect'](_0x201928,{'showHidden':![],'depth':null}));});}else{logger[_0x869f('0x1c')](_0x869f('0x28'),_0x869f('0x29'),_0x869f('0x3e'),_0x869f('0x43'));}break;case _0x869f('0x44'):if(_0x461657[_0x869f('0x2f')]&&_0x461657[_0x869f('0x30')]){var _0x35b86d={'messages':[{'source':'xCALLY\x20Motion','to':_0xdfc98a[_0x869f('0x22')],'body':_0xdfc98a[_0x869f('0xc')],'from':_0x461657[_0x869f('0x3f')]||_0x461657[_0x869f('0x22')]}]};var _0x12d756=util[_0x869f('0x45')](_0x869f('0x46'),_0x461657[_0x869f('0x2f')],_0x461657[_0x869f('0x30')]);var _0x5aadcf={'method':_0x869f('0x38'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x35b86d,'headers':{'Authorization':util[_0x869f('0x45')](_0x869f('0x47'),new Buffer(_0x12d756)['toString'](_0x869f('0x48')))},'json':!![]};rp(_0x5aadcf)['then'](function(_0xc770ad){if(_0xc770ad[_0x869f('0x49')]>=0xc8&&_0xc770ad[_0x869f('0x49')]<=0xce){if(_0xc770ad[_0x869f('0x4a')]&&_0xc770ad[_0x869f('0x4a')][_0x869f('0x4b')]>0x0){var _0x85ba72=_[_0x869f('0x4c')](_0xc770ad[_0x869f('0x4a')]['messages']);var _0x50feb8={'messageId':_0x85ba72[_0x869f('0x4d')]};if(!_0x461657['deliveryReport']){_0x50feb8[_0x869f('0x42')]=!![];}return _0x276375[_0x869f('0x19')](_0x50feb8);}else{logger[_0x869f('0x1c')](_0x869f('0x28'),'afterCreate','clickSend',util[_0x869f('0x2b')](_0xc770ad,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x869f('0x28'),_0x869f('0x29'),_0x869f('0x4e'),util[_0x869f('0x2b')](_0xc770ad,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1a5acd){logger['error'](_0x869f('0x28'),_0x869f('0x29'),_0x869f('0x4e'),util[_0x869f('0x2b')](_0x1a5acd,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x869f('0x28'),_0x869f('0x29'),_0x869f('0x4e'),_0x869f('0x3d'));}break;case'plivo':if(_0x461657[_0x869f('0x4f')]&&_0x461657[_0x869f('0x21')]){var _0x35b86d={'dst':_0xdfc98a[_0x869f('0x22')],'text':_0xdfc98a['body'],'src':_0x461657[_0x869f('0x3f')]||_0x461657['phone'],'url':_0x461657[_0x869f('0x50')]+_0x869f('0x24')+_0xdfc98a['id']+_0x869f('0x25')+_0x461657[_0x869f('0x26')]};var _0x12d756=util[_0x869f('0x45')](_0x869f('0x46'),_0x461657[_0x869f('0x4f')],_0x461657[_0x869f('0x21')]);var _0x5aadcf={'method':_0x869f('0x38'),'uri':util[_0x869f('0x45')](_0x869f('0x51'),_0x461657[_0x869f('0x4f')]),'body':_0x35b86d,'headers':{'Authorization':util[_0x869f('0x45')]('Basic\x20%s',new Buffer(_0x12d756)[_0x869f('0x52')]('base64'))},'json':!![]};rp(_0x5aadcf)[_0x869f('0x18')](function(_0x22695a){var _0x86c62b={'messageId':_0x22695a[_0x869f('0x53')][0x0]};return _0x276375[_0x869f('0x19')](_0x86c62b);})[_0x869f('0x1b')](function(_0x2975a3){logger[_0x869f('0x1c')](_0x869f('0x28'),_0x869f('0x29'),_0x869f('0x54'),util[_0x869f('0x2b')](_0x2975a3,{'showHidden':![],'depth':null}));});}else{logger[_0x869f('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x869f('0x54'),_0x869f('0x55'));}break;case _0x869f('0x56'):if(_0x461657[_0x869f('0x2f')]&&_0x461657[_0x869f('0x30')]){if(_0x461657[_0x869f('0x57')]){var _0x5ede0c={'method':_0x869f('0x38'),'uri':_0x461657[_0x869f('0x57')]+_0x869f('0x58'),'body':{'username':_0x461657[_0x869f('0x2f')],'password':_0x461657[_0x869f('0x30')]},'json':!![]};return rp(_0x5ede0c)[_0x869f('0x18')](function(_0x585787){var _0x2c1255={'method':_0x869f('0x38'),'uri':_0x461657['baseUrl']+_0x869f('0x59'),'body':{'messages':[{'from':_0x461657[_0x869f('0x22')],'destinations':[{'to':_0xdfc98a['phone']}],'text':_0xdfc98a[_0x869f('0xc')],'notifyUrl':_0x461657[_0x869f('0x50')]+_0x869f('0x24')+_0xdfc98a['id']+_0x869f('0x25')+_0x461657['token'],'notifyContentType':_0x869f('0x5a'),'callbackData':_0x461657['phone']+';'+_0xdfc98a['body']}]},'headers':{'Authorization':_0x869f('0x5b')+_0x585787[_0x869f('0x26')]},'json':!![]};return rp(_0x2c1255)['then'](function(_0x43e022){if(_0x43e022[_0x869f('0x23')]){var _0x1f61ac={'messageId':_0x43e022[_0x869f('0x23')][0x0]['messageId']};if(!_0x461657[_0x869f('0x3c')]){_0x1f61ac[_0x869f('0x42')]=!![];}return _0x276375[_0x869f('0x19')](_0x1f61ac);}else{return logger[_0x869f('0x1c')](_0x869f('0x28'),_0x869f('0x29'),'infobip',util[_0x869f('0x2b')](_0x43e022,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x4cc14f){return logger['error'](_0x869f('0x28'),_0x869f('0x29'),_0x869f('0x56'),util[_0x869f('0x2b')](_0x4cc14f,{'showHidden':![],'depth':null}));});}else{logger[_0x869f('0x1c')](_0x869f('0x28'),_0x869f('0x29'),_0x869f('0x56'),_0x869f('0x5c'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x869f('0x29'),_0x869f('0x56'),_0x869f('0x3d'));}break;case _0x869f('0x5d'):var _0x3d5d16=require('crypto');if(_0x461657[_0x869f('0x5e')]){var _0xf55cf1={};_0xf55cf1['login']=_0x461657[_0x869f('0x2f')];_0xf55cf1[_0x869f('0x22')]=_0xdfc98a[_0x869f('0x22')];_0xf55cf1[_0x869f('0x32')]=_0x461657[_0x869f('0x22')];_0xf55cf1[_0x869f('0x5f')]=_0xdfc98a[_0x869f('0xc')];_0xf55cf1[_0x869f('0x60')]=+new Date();var _0x1d62b5='';var _0x919cd7='';var _0xcec2c2=Object[_0x869f('0x61')](_0xf55cf1);_0xcec2c2['sort']();for(var _0x876e55=0x0;_0x876e55<_0xcec2c2[_0x869f('0x62')];_0x876e55++){if(_0x1d62b5!=''){_0x1d62b5+='&';}_0x1d62b5+=_0xcec2c2[_0x876e55]+'='+encodeURIComponent(_0xf55cf1[_0xcec2c2[_0x876e55]]);_0x919cd7+=_0xf55cf1[_0xcec2c2[_0x876e55]];}_0x919cd7+=_0x461657['apiKey'];_0x919cd7=_0x3d5d16[_0x869f('0x63')](_0x869f('0x64'))[_0x869f('0x19')](_0x919cd7)[_0x869f('0x65')]('hex');if(_0x1d62b5!==''){_0x1d62b5+='&';}_0x1d62b5+='signature='+_0x919cd7;var _0x29cd3f={'method':'GET','uri':_0x461657[_0x869f('0x57')]+_0x869f('0x66')+_0x1d62b5,'json':!![]};return rp(_0x29cd3f)[_0x869f('0x18')](function(_0x3343f8){var _0x12148e=Object['keys'](_0x3343f8);if(_0x3343f8[_0x12148e[0x0]][_0x869f('0x1c')]&&parseInt(_0x3343f8[_0x12148e[0x0]][_0x869f('0x1c')])===0x0){var _0x353ef9={'messageId':_0x3343f8[_0x12148e[0x0]][_0x869f('0x67')]};if(!_0x461657[_0x869f('0x3c')]){_0x353ef9[_0x869f('0x42')]=!![];}return _0x276375[_0x869f('0x19')](_0x353ef9);}else{return logger[_0x869f('0x1c')](_0x869f('0x28'),'afterCreate','csc',util[_0x869f('0x2b')](_0x3343f8['error'],{'showHidden':![],'depth':null}));}})[_0x869f('0x1b')](function(_0x3601b4){return logger[_0x869f('0x1c')](_0x869f('0x28'),_0x869f('0x29'),_0x869f('0x5d'),util[_0x869f('0x2b')](_0x3601b4,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x869f('0x29'),_0x869f('0x5d'),_0x869f('0x68'));}break;case _0x869f('0x69'):if(_0x461657[_0x869f('0x5e')]){var _0x59259f={'method':_0x869f('0x38'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x461657[_0x869f('0x5e')]},'body':{'content':_0xdfc98a['body'],'to':[_0xdfc98a['phone']],'from':_0x461657[_0x869f('0x22')],'binary':![],'clientMessageId':_0x869f('0x6a'),'charset':'UTF-8'},'json':!![]};rp(_0x59259f)[_0x869f('0x18')](function(_0xdd3fc8){if(!_0xdd3fc8[_0x869f('0x1c')]){var _0x1bb373={'messageId':_0xdd3fc8[_0x869f('0x23')][0x0][_0x869f('0x6b')]};if(!_0x461657[_0x869f('0x3c')]){_0x1bb373[_0x869f('0x42')]=!![];}return _0x276375[_0x869f('0x19')](_0x1bb373);}else{return logger['error'](_0x869f('0x28'),_0x869f('0x29'),_0x869f('0x69'),util['inspect'](_0xdd3fc8[_0x869f('0x1c')],{'showHidden':![],'depth':null}));}})['catch'](function(_0xb6c219){return logger[_0x869f('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x869f('0x29'),'clickatell',util[_0x869f('0x2b')](_0xb6c219,{'showHidden':![],'depth':null}));});}else{logger[_0x869f('0x1c')](_0x869f('0x28'),_0x869f('0x29'),_0x869f('0x69'),_0x869f('0x68'));}break;case'intelepeer':if(_0x461657[_0x869f('0x5e')]){var _0x55a4cd={};var _0x29cd3f={'method':_0x869f('0x38'),'uri':_0x869f('0x6c'),'headers':{'Authorization':_0x869f('0x6d')+_0x461657[_0x869f('0x5e')],'Content-Type':_0x869f('0x5a')},'body':{'from':_0x461657[_0x869f('0x22')],'to':_0xdfc98a[_0x869f('0x22')],'text':_0xdfc98a['body']},'json':!![]};return rp(_0x29cd3f)[_0x869f('0x18')](function(_0x3c8ef9){if(_0x3c8ef9[_0x869f('0x6e')]==0xca){_0x55a4cd[_0x869f('0x6f')]=_0x3c8ef9;var _0x2dc825={'method':_0x869f('0x38'),'uri':_0x869f('0x70'),'headers':{'Authorization':'Bearer\x20'+_0x461657[_0x869f('0x5e')],'Content-Type':_0x869f('0x5a')},'body':{'refid':_0x55a4cd['message']['refid']},'json':!![]};return rp(_0x2dc825)[_0x869f('0x18')](function(_0x46594d){_0x55a4cd['status']=_0x46594d;var _0x1d8c70={'messageId':_0x55a4cd[_0x869f('0x6f')][_0x869f('0x71')],'read':!![]};return _0x276375[_0x869f('0x19')](_0x1d8c70);});}else{return logger[_0x869f('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x869f('0x29'),_0x869f('0x72'),util['inspect'](_0x3c8ef9,{'showHidden':![],'depth':null}));}})[_0x869f('0x1b')](function(_0x5c5277){return logger[_0x869f('0x1c')](_0x869f('0x28'),'afterCreate',_0x869f('0x72'),util[_0x869f('0x2b')](_0x5c5277,{'showHidden':![],'depth':null}));});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x869f('0x72'),_0x869f('0x73'));}break;}}})[_0x869f('0x74')](function(){_0x18df42();});}else{_0x18df42();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 3fbcf3f..6d24fac 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 _0x57ca=['jayson/promise','client','http','redis','defaults','localhost','register','request','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SmsMessage','create','body','options','raw','then','info','CreateSmsMessage','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x57ca,0x108));var _0xa57c=function(_0x5d2b8e,_0x3664af){_0x5d2b8e=_0x5d2b8e-0x0;var _0x1f715c=_0x57ca[_0x5d2b8e];return _0x1f715c;};'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});config[_0xa57c('0xb')]=_[_0xa57c('0xc')](config[_0xa57c('0xb')],{'host':_0xa57c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa57c('0xb')]));require('./smsMessage.socket')[_0xa57c('0xe')](socket);function respondWithRpcPromise(_0x932dcc,_0x4fa5ed,_0x156bca){return new BPromise(function(_0x51f287,_0x554101){return client[_0xa57c('0xf')](_0x932dcc,_0x156bca)['then'](function(_0x2ed4c6){logger['info'](_0xa57c('0x10'),_0x4fa5ed,_0xa57c('0x11'));logger[_0xa57c('0x12')](_0xa57c('0x13'),_0x4fa5ed,_0xa57c('0x11'),JSON['stringify'](_0x2ed4c6));if(_0x2ed4c6[_0xa57c('0x14')]){if(_0x2ed4c6['error'][_0xa57c('0x15')]===0x1f4){logger[_0xa57c('0x14')](_0xa57c('0x10'),_0x4fa5ed,_0x2ed4c6[_0xa57c('0x14')][_0xa57c('0x16')]);return _0x554101(_0x2ed4c6[_0xa57c('0x14')][_0xa57c('0x16')]);}logger['error'](_0xa57c('0x10'),_0x4fa5ed,_0x2ed4c6[_0xa57c('0x14')][_0xa57c('0x16')]);return _0x51f287(_0x2ed4c6['error'][_0xa57c('0x16')]);}else{logger['info'](_0xa57c('0x10'),_0x4fa5ed,_0xa57c('0x11'));_0x51f287(_0x2ed4c6[_0xa57c('0x17')][_0xa57c('0x16')]);}})[_0xa57c('0x18')](function(_0x4728f9){logger[_0xa57c('0x14')](_0xa57c('0x10'),_0x4fa5ed,_0x4728f9);_0x554101(_0x4728f9);});});}exports['CreateSmsMessage']=function(_0x8a8856){var _0x4a53ab=this;return new Promise(function(_0x4a35bb,_0x418415){return db[_0xa57c('0x19')][_0xa57c('0x1a')](_0x8a8856[_0xa57c('0x1b')],{'raw':_0x8a8856['options']?_0x8a8856[_0xa57c('0x1c')][_0xa57c('0x1d')]===undefined?!![]:![]:!![]})[_0xa57c('0x1e')](function(_0x2213b2){logger[_0xa57c('0x1f')](_0xa57c('0x20'),_0x8a8856);logger[_0xa57c('0x12')](_0xa57c('0x20'),_0x8a8856,JSON[_0xa57c('0x21')](_0x2213b2));_0x4a35bb(_0x2213b2);})[_0xa57c('0x18')](function(_0x382a26){logger[_0xa57c('0x14')](_0xa57c('0x20'),_0x382a26[_0xa57c('0x16')],_0x8a8856);_0x418415(_0x4a53ab[_0xa57c('0x14')](0x1f4,_0x382a26['message']));});});}; \ No newline at end of file +var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','SmsMessage','body','raw','CreateSmsMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','SmsMessage,\x20%s,\x20%s'];(function(_0x14d9ac,_0x31a37f){var _0x290ed4=function(_0x20906d){while(--_0x20906d){_0x14d9ac['push'](_0x14d9ac['shift']());}};_0x290ed4(++_0x31a37f);}(_0xadb5,0xad));var _0x5adb=function(_0x3a9eec,_0x547f1c){_0x3a9eec=_0x3a9eec-0x0;var _0x5ec3b6=_0xadb5[_0x3a9eec];return _0x5ec3b6;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('SmsMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateSmsMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 84a570a..003d21a 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 _0xf34d=['emit','removeListener','save','remove','update'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf34d,0x11a));var _0xdf34=function(_0x4f45dd,_0x4b40ef){_0x4f45dd=_0x4f45dd-0x0;var _0xa6b731=_0xf34d[_0x4f45dd];return _0xa6b731;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xdf34('0x0'),_0xdf34('0x1'),_0xdf34('0x2')];function createListener(_0x5c4627,_0x826566){return function(_0x53c566){_0x826566[_0xdf34('0x3')](_0x5c4627,_0x53c566);};}function removeListener(_0x3e6c91,_0x521a05){return function(){SmsMessageEvents[_0xdf34('0x4')](_0x3e6c91,_0x521a05);};}exports['register']=function(_0x1fb357){for(var _0x3ba4c4=0x0,_0x26e564=events['length'];_0x3ba4c4<_0x26e564;_0x3ba4c4++){var _0x190a6d=events[_0x3ba4c4];var _0x25f2b3=createListener('smsMessage:'+_0x190a6d,_0x1fb357);SmsMessageEvents['on'](_0x190a6d,_0x25f2b3);}}; \ No newline at end of file +var _0x423a=['length','smsMessage:','./smsMessage.events','save','emit','removeListener','register'];(function(_0x255ab7,_0x78dde7){var _0x249a0f=function(_0x8d7f7e){while(--_0x8d7f7e){_0x255ab7['push'](_0x255ab7['shift']());}};_0x249a0f(++_0x78dde7);}(_0x423a,0x6b));var _0xa423=function(_0x168ff4,_0x28071f){_0x168ff4=_0x168ff4-0x0;var _0x47de3f=_0x423a[_0x168ff4];return _0x47de3f;};'use strict';var SmsMessageEvents=require(_0xa423('0x0'));var events=[_0xa423('0x1'),'remove','update'];function createListener(_0x2795b8,_0x5b8c84){return function(_0xfdeab9){_0x5b8c84[_0xa423('0x2')](_0x2795b8,_0xfdeab9);};}function removeListener(_0x4eedea,_0x437096){return function(){SmsMessageEvents[_0xa423('0x3')](_0x4eedea,_0x437096);};}exports[_0xa423('0x4')]=function(_0x6ed3b){for(var _0x4acf4b=0x0,_0x417ed9=events[_0xa423('0x5')];_0x4acf4b<_0x417ed9;_0x4acf4b++){var _0x5b0463=events[_0x4acf4b];var _0x1c192b=createListener(_0xa423('0x6')+_0x5b0463,_0x6ed3b);SmsMessageEvents['on'](_0x5b0463,_0x1c192b);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index dfb530b..44e8823 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 _0x6011=['getAgents','post','create','addAgents','/:id','update','destroy','delete','/:id/teams','removeTeams','Router','../../components/auth/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','/:id/users'];(function(_0x57727e,_0x419629){var _0xf59f36=function(_0x294ebf){while(--_0x294ebf){_0x57727e['push'](_0x57727e['shift']());}};_0xf59f36(++_0x419629);}(_0x6011,0x196));var _0x1601=function(_0x3a9f54,_0x3d26d0){_0x3a9f54=_0x3a9f54-0x0;var _0x3f7f92=_0x6011[_0x3a9f54];return _0x3f7f92;};'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[_0x1601('0x0')]();var auth=require(_0x1601('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0x1601('0x2'));var controller=require(_0x1601('0x3'));router[_0x1601('0x4')]('/',auth[_0x1601('0x5')](),controller[_0x1601('0x6')]);router[_0x1601('0x4')](_0x1601('0x7'),auth[_0x1601('0x5')](),controller[_0x1601('0x8')]);router[_0x1601('0x4')]('/:id',auth[_0x1601('0x5')](),controller[_0x1601('0x9')]);router[_0x1601('0x4')](_0x1601('0xa'),auth[_0x1601('0x5')](),controller['getMembers']);router['get']('/:id/teams',auth[_0x1601('0x5')](),controller['getTeams']);router[_0x1601('0x4')](_0x1601('0xb'),auth[_0x1601('0x5')](),controller[_0x1601('0xc')]);router[_0x1601('0xd')]('/',auth[_0x1601('0x5')](),controller[_0x1601('0xe')]);router[_0x1601('0xd')]('/:id/teams',auth[_0x1601('0x5')](),controller['addTeams']);router[_0x1601('0xd')]('/:id/users',auth[_0x1601('0x5')](),controller[_0x1601('0xf')]);router['put'](_0x1601('0x10'),auth[_0x1601('0x5')](),controller[_0x1601('0x11')]);router['delete']('/:id',auth[_0x1601('0x5')](),controller[_0x1601('0x12')]);router[_0x1601('0x13')](_0x1601('0x14'),auth[_0x1601('0x5')](),controller[_0x1601('0x15')]);router[_0x1601('0x13')](_0x1601('0xb'),auth[_0x1601('0x5')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xff01=['describe','show','/:id/members','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','isAuthenticated','get'];(function(_0x3e1e1b,_0x560c1e){var _0x3f78a4=function(_0x52669e){while(--_0x52669e){_0x3e1e1b['push'](_0x3e1e1b['shift']());}};_0x3f78a4(++_0x560c1e);}(_0xff01,0xb7));var _0x1ff0=function(_0x5cf438,_0x21643b){_0x5cf438=_0x5cf438-0x0;var _0x15db10=_0xff01[_0x5cf438];return _0x15db10;};'use strict';var multer=require(_0x1ff0('0x0'));var util=require(_0x1ff0('0x1'));var path=require('path');var timeout=require(_0x1ff0('0x2'));var express=require('express');var router=express[_0x1ff0('0x3')]();var auth=require(_0x1ff0('0x4'));var interaction=require(_0x1ff0('0x5'));var config=require('../../config/environment');var controller=require(_0x1ff0('0x6'));router['get']('/',auth[_0x1ff0('0x7')](),controller['index']);router[_0x1ff0('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x1ff0('0x9')]);router[_0x1ff0('0x8')]('/:id',auth[_0x1ff0('0x7')](),controller[_0x1ff0('0xa')]);router[_0x1ff0('0x8')](_0x1ff0('0xb'),auth[_0x1ff0('0x7')](),controller['getMembers']);router[_0x1ff0('0x8')]('/:id/teams',auth[_0x1ff0('0x7')](),controller[_0x1ff0('0xc')]);router[_0x1ff0('0x8')](_0x1ff0('0xd'),auth[_0x1ff0('0x7')](),controller[_0x1ff0('0xe')]);router[_0x1ff0('0xf')]('/',auth[_0x1ff0('0x7')](),controller[_0x1ff0('0x10')]);router[_0x1ff0('0xf')]('/:id/teams',auth[_0x1ff0('0x7')](),controller[_0x1ff0('0x11')]);router[_0x1ff0('0xf')](_0x1ff0('0xd'),auth['isAuthenticated'](),controller[_0x1ff0('0x12')]);router[_0x1ff0('0x13')]('/:id',auth[_0x1ff0('0x7')](),controller[_0x1ff0('0x14')]);router[_0x1ff0('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x1ff0('0x16')]);router[_0x1ff0('0x15')]('/:id/teams',auth[_0x1ff0('0x7')](),controller[_0x1ff0('0x17')]);router[_0x1ff0('0x15')](_0x1ff0('0xd'),auth['isAuthenticated'](),controller['removeAgents']);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 53dba69..e845935 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 _0x9516=['rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9516,0xbd));var _0x6951=function(_0x333fc8,_0x2b292c){_0x333fc8=_0x333fc8-0x0;var _0x432439=_0x9516[_0x333fc8];return _0x432439;};'use strict';var Sequelize=require(_0x6951('0x0'));module[_0x6951('0x1')]={'name':{'type':Sequelize[_0x6951('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6951('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x6951('0x3'),_0x6951('0x4'),_0x6951('0x5'))}}; \ No newline at end of file +var _0x8118=['INTEGER','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x5ce25,_0x352a7d){var _0x324046=function(_0x4b60ef){while(--_0x4b60ef){_0x5ce25['push'](_0x5ce25['shift']());}};_0x324046(++_0x352a7d);}(_0x8118,0x148));var _0x8811=function(_0x2c74e2,_0x78daf1){_0x2c74e2=_0x2c74e2-0x0;var _0x14e004=_0x8118[_0x2c74e2];return _0x14e004;};'use strict';var Sequelize=require(_0x8811('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8811('0x1')]},'timeout':{'type':Sequelize[_0x8811('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8811('0x3'),_0x8811('0x4'),_0x8811('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 53c487e..076bc05 100644 --- a/server/api/smsQueue/smsQueue.controller.js +++ b/server/api/smsQueue/smsQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66fa=['omit','spread','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','localhost','./smsQueue.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','index','map','SmsQueue','rawAttributes','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','include','rows','show','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','SmsQueueId','UserSmsQueue','findAll','User','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','select','field','tq.TeamId','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','removeAgents','emit','userSmsQueue:remove','addAgents'];(function(_0x4a2183,_0x53e74d){var _0xc7c01d=function(_0x526d67){while(--_0x526d67){_0x4a2183['push'](_0x4a2183['shift']());}};_0xc7c01d(++_0x53e74d);}(_0x66fa,0x117));var _0xa66f=function(_0x4d545c,_0x4feef1){_0x4d545c=_0x4d545c-0x0;var _0x3b0bd7=_0x66fa[_0x4d545c];return _0x3b0bd7;};'use strict';var pdf=require(_0xa66f('0x0'));var emlformat=require(_0xa66f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa66f('0x2'));var jsonpatch=require(_0xa66f('0x3'));var rp=require(_0xa66f('0x4'));var moment=require(_0xa66f('0x5'));var BPromise=require(_0xa66f('0x6'));var Mustache=require(_0xa66f('0x7'));var util=require(_0xa66f('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xa66f('0x9'));var ejs=require(_0xa66f('0xa'));var fs=require('fs');var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa66f('0x11'));var logger=require(_0xa66f('0x12'))('api');var utils=require(_0xa66f('0x13'));var config=require('../../config/environment');var db=require(_0xa66f('0x14'))['db'];config['redis']=_[_0xa66f('0x15')](config[_0xa66f('0x16')],{'host':_0xa66f('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa66f('0x18'))['register'](socket);function respondWithStatusCode(_0x528427,_0x5a7b16){_0x5a7b16=_0x5a7b16||0xcc;return function(_0x3ac0ac){if(_0x3ac0ac){return _0x528427[_0xa66f('0x19')](_0x5a7b16);}return _0x528427[_0xa66f('0x1a')](_0x5a7b16)[_0xa66f('0x1b')]();};}function respondWithResult(_0xd348f9,_0x567d4f){_0x567d4f=_0x567d4f||0xc8;return function(_0x5510dc){if(_0x5510dc){return _0xd348f9[_0xa66f('0x1a')](_0x567d4f)[_0xa66f('0x1c')](_0x5510dc);}};}function respondWithFilteredResult(_0x295acf,_0x403f4d){return function(_0x5c67f5){if(_0x5c67f5){var _0x1cbe64=_0x5c67f5[_0xa66f('0x1d')],_0x55b59d=_0x403f4d[_0xa66f('0x1e')],_0x4a28d4=_0x403f4d[_0xa66f('0x1e')]+_0x403f4d[_0xa66f('0x1f')],_0x2f9da2;if(_0x4a28d4>=_0x1cbe64){_0x4a28d4=_0x1cbe64;_0x2f9da2=0xc8;}else{_0x2f9da2=0xce;}_0x295acf[_0xa66f('0x1a')](_0x2f9da2);return _0x295acf[_0xa66f('0x20')](_0xa66f('0x21'),_0x55b59d+'-'+_0x4a28d4+'/'+_0x1cbe64)[_0xa66f('0x1c')](_0x5c67f5);}return null;};}function patchUpdates(_0x2d9602){return function(_0x235b61){try{jsonpatch[_0xa66f('0x22')](_0x235b61,_0x2d9602,!![]);}catch(_0x3c4eb1){return BPromise[_0xa66f('0x23')](_0x3c4eb1);}return _0x235b61[_0xa66f('0x24')]();};}function saveUpdates(_0x5cd613,_0x27f570){return function(_0xc5c82e){if(_0xc5c82e){return _0xc5c82e[_0xa66f('0x25')](_0x5cd613)[_0xa66f('0x26')](function(_0x5cbd82){return _0x5cbd82;});}return null;};}function removeEntity(_0x337602,_0x473822){return function(_0x209f4d){if(_0x209f4d){return _0x209f4d[_0xa66f('0x27')]()['then'](function(){var _0x5e9639=_0x209f4d[_0xa66f('0x28')]({'plain':!![]});var _0x598942=_0xa66f('0x29');return db[_0xa66f('0x2a')][_0xa66f('0x27')]({'where':{'type':_0x598942,'resourceId':_0x5e9639['id']}})['then'](function(){return _0x209f4d;});})[_0xa66f('0x26')](function(){_0x337602[_0xa66f('0x1a')](0xcc)[_0xa66f('0x1b')]();});}};}function handleEntityNotFound(_0x238eb2,_0x17c103){return function(_0x236046){if(!_0x236046){_0x238eb2[_0xa66f('0x19')](0x194);}return _0x236046;};}function handleError(_0xea2c89,_0x20ee67){_0x20ee67=_0x20ee67||0x1f4;return function(_0x117d03){logger[_0xa66f('0x2b')](_0x117d03[_0xa66f('0x2c')]);if(_0x117d03[_0xa66f('0x2d')]){delete _0x117d03[_0xa66f('0x2d')];}_0xea2c89['status'](_0x20ee67)['send'](_0x117d03);};}exports[_0xa66f('0x2e')]=function(_0x27ceae,_0x55f309){var _0x44c79a={},_0x2de5f3={},_0x4cd7f2={'count':0x0,'rows':[]};var _0x332e86=_[_0xa66f('0x2f')](db[_0xa66f('0x30')][_0xa66f('0x31')],function(_0x395623){return{'name':_0x395623['fieldName'],'type':_0x395623[_0xa66f('0x32')]['key']};});_0x2de5f3[_0xa66f('0x33')]=_[_0xa66f('0x2f')](_0x332e86,_0xa66f('0x2d'));_0x2de5f3['query']=_[_0xa66f('0x34')](_0x27ceae[_0xa66f('0x35')]);_0x2de5f3['filters']=_[_0xa66f('0x36')](_0x2de5f3[_0xa66f('0x33')],_0x2de5f3[_0xa66f('0x35')]);_0x44c79a[_0xa66f('0x37')]=_[_0xa66f('0x36')](_0x2de5f3[_0xa66f('0x33')],qs[_0xa66f('0x38')](_0x27ceae[_0xa66f('0x35')][_0xa66f('0x38')]));_0x44c79a[_0xa66f('0x37')]=_0x44c79a['attributes'][_0xa66f('0x39')]?_0x44c79a['attributes']:_0x2de5f3[_0xa66f('0x33')];if(!_0x27ceae[_0xa66f('0x35')][_0xa66f('0x3a')](_0xa66f('0x3b'))){_0x44c79a[_0xa66f('0x1f')]=qs[_0xa66f('0x1f')](_0x27ceae[_0xa66f('0x35')][_0xa66f('0x1f')]);_0x44c79a['offset']=qs[_0xa66f('0x1e')](_0x27ceae['query'][_0xa66f('0x1e')]);}_0x44c79a[_0xa66f('0x3c')]=qs[_0xa66f('0x3d')](_0x27ceae['query']['sort']);_0x44c79a[_0xa66f('0x3e')]=qs[_0xa66f('0x3f')](_[_0xa66f('0x40')](_0x27ceae[_0xa66f('0x35')],_0x2de5f3[_0xa66f('0x3f')]));if(_0x27ceae['query']['filter']){_0x44c79a['where']=_[_0xa66f('0x41')](_0x44c79a['where'],{'$or':_['map'](_0x332e86,function(_0x5bf856){if(_0x5bf856[_0xa66f('0x32')]!=='VIRTUAL'){var _0x8965d3={};_0x8965d3[_0x5bf856[_0xa66f('0x2d')]]={'$like':'%'+_0x27ceae[_0xa66f('0x35')][_0xa66f('0x42')]+'%'};return _0x8965d3;}})});}_0x44c79a=_[_0xa66f('0x41')]({},_0x44c79a,_0x27ceae[_0xa66f('0x43')]);var _0x192033={'where':_0x44c79a[_0xa66f('0x3e')]};return db[_0xa66f('0x30')][_0xa66f('0x1d')](_0x192033)[_0xa66f('0x26')](function(_0x93f6ff){_0x4cd7f2[_0xa66f('0x1d')]=_0x93f6ff;if(_0x27ceae[_0xa66f('0x35')]['includeAll']){_0x44c79a[_0xa66f('0x44')]=[{'all':!![]}];}return db[_0xa66f('0x30')]['findAll'](_0x44c79a);})[_0xa66f('0x26')](function(_0x4b6e6b){_0x4cd7f2[_0xa66f('0x45')]=_0x4b6e6b;return _0x4cd7f2;})[_0xa66f('0x26')](respondWithFilteredResult(_0x55f309,_0x44c79a))['catch'](handleError(_0x55f309,null));};exports[_0xa66f('0x46')]=function(_0xa42041,_0x2126e8){var _0x5276ea={'raw':!![],'where':{'id':_0xa42041['params']['id']}},_0x394b1e={};_0x394b1e[_0xa66f('0x33')]=_[_0xa66f('0x34')](db[_0xa66f('0x30')][_0xa66f('0x31')]);_0x394b1e[_0xa66f('0x35')]=_[_0xa66f('0x34')](_0xa42041[_0xa66f('0x35')]);_0x394b1e['filters']=_[_0xa66f('0x36')](_0x394b1e[_0xa66f('0x33')],_0x394b1e[_0xa66f('0x35')]);_0x5276ea[_0xa66f('0x37')]=_[_0xa66f('0x36')](_0x394b1e['model'],qs['fields'](_0xa42041[_0xa66f('0x35')][_0xa66f('0x38')]));_0x5276ea[_0xa66f('0x37')]=_0x5276ea[_0xa66f('0x37')][_0xa66f('0x39')]?_0x5276ea[_0xa66f('0x37')]:_0x394b1e['model'];if(_0xa42041[_0xa66f('0x35')][_0xa66f('0x47')]){_0x5276ea[_0xa66f('0x44')]=[{'all':!![]}];}_0x5276ea=_['merge']({},_0x5276ea,_0xa42041['options']);return db[_0xa66f('0x30')][_0xa66f('0x48')](_0x5276ea)[_0xa66f('0x26')](handleEntityNotFound(_0x2126e8,null))['then'](respondWithResult(_0x2126e8,null))['catch'](handleError(_0x2126e8,null));};exports['create']=function(_0x19e7ce,_0x35e477){return db[_0xa66f('0x30')][_0xa66f('0x49')](_0x19e7ce[_0xa66f('0x4a')],{})[_0xa66f('0x26')](function(_0x164242){var _0x15de06=_0x19e7ce['user'][_0xa66f('0x28')]({'plain':!![]});if(!_0x15de06)throw new Error(_0xa66f('0x4b'));if(_0x15de06[_0xa66f('0x4c')]===_0xa66f('0x4d')){var _0x11597b=_0x164242[_0xa66f('0x28')]({'plain':!![]});var _0x56379e=_0xa66f('0x29');return db[_0xa66f('0x4e')][_0xa66f('0x48')]({'where':{'name':_0x56379e,'userProfileId':_0x15de06[_0xa66f('0x4f')]},'raw':!![]})[_0xa66f('0x26')](function(_0x5d77d1){if(_0x5d77d1&&_0x5d77d1[_0xa66f('0x50')]===0x0){return db['UserProfileResource'][_0xa66f('0x49')]({'name':_0x11597b['name'],'resourceId':_0x11597b['id'],'type':_0x5d77d1['name'],'sectionId':_0x5d77d1['id']},{})[_0xa66f('0x26')](function(){return _0x164242;});}else{return _0x164242;}})[_0xa66f('0x51')](function(_0x12271d){logger[_0xa66f('0x2b')](_0xa66f('0x52'),_0x12271d);throw _0x12271d;});}return _0x164242;})[_0xa66f('0x26')](respondWithResult(_0x35e477,0xc9))['catch'](handleError(_0x35e477,null));};exports[_0xa66f('0x25')]=function(_0x13822b,_0x1da406){if(_0x13822b[_0xa66f('0x4a')]['id']){delete _0x13822b['body']['id'];}return db[_0xa66f('0x30')]['find']({'where':{'id':_0x13822b[_0xa66f('0x53')]['id']}})[_0xa66f('0x26')](handleEntityNotFound(_0x1da406,null))[_0xa66f('0x26')](saveUpdates(_0x13822b[_0xa66f('0x4a')],null))[_0xa66f('0x26')](respondWithResult(_0x1da406,null))[_0xa66f('0x51')](handleError(_0x1da406,null));};exports[_0xa66f('0x27')]=function(_0x56b860,_0x2ab3c8){return db[_0xa66f('0x30')][_0xa66f('0x48')]({'where':{'id':_0x56b860[_0xa66f('0x53')]['id']}})[_0xa66f('0x26')](handleEntityNotFound(_0x2ab3c8,null))[_0xa66f('0x26')](removeEntity(_0x2ab3c8,null))[_0xa66f('0x51')](handleError(_0x2ab3c8,null));};exports[_0xa66f('0x54')]=function(_0x350fce,_0x4dfede){return db['SmsQueue'][_0xa66f('0x54')]()[_0xa66f('0x26')](respondWithResult(_0x4dfede,null))[_0xa66f('0x51')](handleError(_0x4dfede,null));};exports[_0xa66f('0x55')]=function(_0x2f1f1e,_0x1fd3f0,_0x8bea2b){var _0x4b10cf={'raw':!![],'where':{}},_0x1709eb={},_0x11c89e;return db[_0xa66f('0x30')][_0xa66f('0x56')]({'where':{'id':_0x2f1f1e['params']['id']}})[_0xa66f('0x26')](handleEntityNotFound(_0x1fd3f0,null))[_0xa66f('0x26')](function(_0x19ff30){if(_0x19ff30){_0x11c89e=_0x19ff30[_0xa66f('0x28')]({'plain':!![]});_0x1709eb[_0xa66f('0x33')]=_[_0xa66f('0x34')](db['UserSmsQueue']['rawAttributes']);_0x1709eb[_0xa66f('0x35')]=_[_0xa66f('0x34')](_0x2f1f1e[_0xa66f('0x35')]);_0x1709eb['filters']=_[_0xa66f('0x36')](_0x1709eb[_0xa66f('0x33')],_0x1709eb[_0xa66f('0x35')]);_0x4b10cf[_0xa66f('0x37')]=_[_0xa66f('0x36')](_0x1709eb[_0xa66f('0x33')],qs[_0xa66f('0x38')](_0x2f1f1e[_0xa66f('0x35')][_0xa66f('0x38')]));_0x4b10cf['attributes']=_0x4b10cf[_0xa66f('0x37')][_0xa66f('0x39')]?_0x4b10cf[_0xa66f('0x37')]:_0x1709eb[_0xa66f('0x33')];if(!_0x2f1f1e[_0xa66f('0x35')][_0xa66f('0x3a')](_0xa66f('0x3b'))){_0x4b10cf[_0xa66f('0x1f')]=qs['limit'](_0x2f1f1e['query'][_0xa66f('0x1f')]);_0x4b10cf[_0xa66f('0x1e')]=qs[_0xa66f('0x1e')](_0x2f1f1e[_0xa66f('0x35')][_0xa66f('0x1e')]);}_0x4b10cf['order']=qs[_0xa66f('0x3d')](_0x2f1f1e['query'][_0xa66f('0x3d')]);_0x4b10cf[_0xa66f('0x3e')]=qs[_0xa66f('0x3f')](_[_0xa66f('0x40')](_0x2f1f1e['query'],_0x1709eb[_0xa66f('0x3f')]));_0x4b10cf[_0xa66f('0x3e')][_0xa66f('0x57')]=_0x19ff30['id'];if(_0x2f1f1e[_0xa66f('0x35')][_0xa66f('0x42')]){_0x4b10cf[_0xa66f('0x3e')]=_[_0xa66f('0x41')](_0x4b10cf[_0xa66f('0x3e')],{'$or':_[_0xa66f('0x2f')](_0x4b10cf[_0xa66f('0x37')],function(_0x290323){var _0x3eb1f5={};_0x3eb1f5[_0x290323]={'$like':'%'+_0x2f1f1e['query'][_0xa66f('0x42')]+'%'};return _0x3eb1f5;})});}_0x4b10cf=_[_0xa66f('0x41')]({},_0x4b10cf,_0x2f1f1e[_0xa66f('0x43')]);return db[_0xa66f('0x58')][_0xa66f('0x59')](_0x4b10cf);}})[_0xa66f('0x26')](function(_0x324780){if(_0x324780){return db[_0xa66f('0x5a')]['findAndCountAll']({'where':{'id':_[_0xa66f('0x2f')](_0x324780,_0xa66f('0x5b')),'role':_0xa66f('0x5c')},'attributes':['id',_0xa66f('0x2d'),_0xa66f('0x5d'),_0xa66f('0x5e'),_0xa66f('0x5f')]});}})[_0xa66f('0x26')](function(_0x4b5785){if(_0x4b5785){return{'count':_0x4b5785['count'],'rows':_[_0xa66f('0x2f')](_0x4b5785[_0xa66f('0x45')],function(_0x34a590){return{'membername':_0x34a590['name'],'UserId':_0x34a590['id'],'queue_name':_0x11c89e['name'],'SmsQueueId':_0x11c89e['id'],'interface':util[_0xa66f('0x60')](_0xa66f('0x61'),_0xa66f('0x62'),_0x34a590[_0xa66f('0x2d')]),'penalty':0x0,'paused':_0x34a590['smsPause'],'createdAt':_0x34a590[_0xa66f('0x5f')],'updatedAt':_0x34a590[_0xa66f('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa66f('0x26')](respondWithFilteredResult(_0x1fd3f0,_0x4b10cf))[_0xa66f('0x51')](handleError(_0x1fd3f0,null));};exports[_0xa66f('0x63')]=function(_0x306129,_0x218128,_0x1396ae){var _0x534820={};var _0x231106={};var _0xbf4084;var _0x5c6c40;return db['SmsQueue'][_0xa66f('0x56')]({'where':{'id':_0x306129[_0xa66f('0x53')]['id']}})['then'](handleEntityNotFound(_0x218128,null))[_0xa66f('0x26')](function(_0x5ef2a3){if(_0x5ef2a3){_0xbf4084=_0x5ef2a3;_0x231106[_0xa66f('0x33')]=_['keys'](db['Team']['rawAttributes']);_0x231106[_0xa66f('0x35')]=_[_0xa66f('0x34')](_0x306129[_0xa66f('0x35')]);_0x231106[_0xa66f('0x3f')]=_[_0xa66f('0x36')](_0x231106[_0xa66f('0x33')],_0x231106[_0xa66f('0x35')]);_0x534820[_0xa66f('0x37')]=_[_0xa66f('0x36')](_0x231106[_0xa66f('0x33')],qs[_0xa66f('0x38')](_0x306129[_0xa66f('0x35')][_0xa66f('0x38')]));_0x534820[_0xa66f('0x37')]=_0x534820[_0xa66f('0x37')][_0xa66f('0x39')]?_0x534820['attributes']:_0x231106[_0xa66f('0x33')];_0x534820['order']=qs[_0xa66f('0x3d')](_0x306129['query'][_0xa66f('0x3d')]);_0x534820[_0xa66f('0x3e')]=qs[_0xa66f('0x3f')](_['pick'](_0x306129['query'],_0x231106[_0xa66f('0x3f')]));if(_0x306129[_0xa66f('0x35')][_0xa66f('0x42')]){_0x534820[_0xa66f('0x3e')]=_[_0xa66f('0x41')](_0x534820[_0xa66f('0x3e')],{'$or':_[_0xa66f('0x2f')](_0x534820['attributes'],function(_0x4013b9){var _0x85de12={};_0x85de12[_0x4013b9]={'$like':'%'+_0x306129[_0xa66f('0x35')][_0xa66f('0x42')]+'%'};return _0x85de12;})});}_0x534820=_[_0xa66f('0x41')]({},_0x534820,_0x306129[_0xa66f('0x43')]);return _0xbf4084[_0xa66f('0x63')](_0x534820);}})[_0xa66f('0x26')](function(_0x15bff2){if(_0x15bff2){_0x5c6c40=_0x15bff2[_0xa66f('0x39')];if(!_0x306129[_0xa66f('0x35')][_0xa66f('0x3a')](_0xa66f('0x3b'))){_0x534820['limit']=qs[_0xa66f('0x1f')](_0x306129[_0xa66f('0x35')][_0xa66f('0x1f')]);_0x534820[_0xa66f('0x1e')]=qs[_0xa66f('0x1e')](_0x306129[_0xa66f('0x35')][_0xa66f('0x1e')]);}return _0xbf4084[_0xa66f('0x63')](_0x534820);}})[_0xa66f('0x26')](function(_0x4bb74f){if(_0x4bb74f){return _0x4bb74f?{'count':_0x5c6c40,'rows':_0x4bb74f}:null;}})[_0xa66f('0x26')](respondWithResult(_0x218128,null))['catch'](handleError(_0x218128,null));};exports[_0xa66f('0x64')]=function(_0x5e19c5,_0x25d203,_0x5dbe8a){var _0x298bd8=_0x5e19c5['body'][_0xa66f('0x65')];return db[_0xa66f('0x66')][_0xa66f('0x59')]({'where':{'id':_0x298bd8},'attributes':['id'],'include':[{'model':db[_0xa66f('0x5a')],'as':_0xa66f('0x67'),'attributes':['id',_0xa66f('0x2d'),'online',_0xa66f('0x68'),_0xa66f('0x69')],'raw':!![]}]})[_0xa66f('0x26')](function(_0x49419c){if(_0x49419c){var _0x458275=_[_0xa66f('0x6a')](_0x49419c,function(_0x4e5f0d){var _0x1e8510=_0x4e5f0d[_0xa66f('0x28')]({'plain':!![]});return _0x1e8510['Agents'];});return db['SmsQueue'][_0xa66f('0x48')]({'where':{'id':_0x5e19c5[_0xa66f('0x53')]['id']}})[_0xa66f('0x26')](function(_0x2929fe){return db[_0xa66f('0x6b')]['transaction'](function(_0x3aaf96){return _0x2929fe[_0xa66f('0x64')](_0x298bd8,{'transaction':_0x3aaf96})['then'](function(){return BPromise[_0xa66f('0x6c')](_0x458275,function(_0x173409){return db['UserSmsQueue'][_0xa66f('0x6d')]({'where':{'UserId':_0x173409['id'],'SmsQueueId':_0x5e19c5[_0xa66f('0x53')]['id']},'transaction':_0x3aaf96});});})[_0xa66f('0x26')](function(){_0x458275[_0xa66f('0x6e')](function(_0x1f28e8){socket['emit'](_0xa66f('0x6f'),{'UserId':_0x1f28e8['id'],'SmsQueueId':_0x2929fe['id']});});});});});}})[_0xa66f('0x26')](respondWithStatusCode(_0x25d203,null))[_0xa66f('0x51')](handleError(_0x25d203,null));};exports[_0xa66f('0x70')]=function(_0x40fb75,_0x3224a5,_0x4e318d){return db[_0xa66f('0x66')][_0xa66f('0x59')]({'where':{'id':_0x40fb75[_0xa66f('0x35')][_0xa66f('0x65')]},'attributes':['id'],'include':[{'model':db[_0xa66f('0x5a')],'as':_0xa66f('0x67'),'attributes':['id'],'raw':!![]}]})[_0xa66f('0x26')](handleEntityNotFound(_0x3224a5,null))['then'](function(_0x5ec355){var _0x50192d=_['map'](_0x5ec355,'id');var _0x26cc07=[];var _0x148a8d=[];var _0x5a957c=squel[_0xa66f('0x71')]();_0x5a957c[_0xa66f('0x72')](_0xa66f('0x73'))['from']('team_has_sms_queues','tq')[_0xa66f('0x74')]('user_has_teams','ut',_0xa66f('0x75'))[_0xa66f('0x3e')](_0xa66f('0x76'),_0x40fb75['params']['id']);for(var _0x283ca2=0x0;_0x283ca2<_0x5ec355['length'];_0x283ca2+=0x1){let _0x3dd1a3=_0x5ec355[_0x283ca2];for(var _0xfdb067=0x0;_0xfdb067<_0x3dd1a3[_0xa66f('0x67')][_0xa66f('0x39')];_0xfdb067+=0x1){let _0x5a1838=_0x3dd1a3[_0xa66f('0x67')][_0xfdb067];var _0x3ac90f=_0x5a957c[_0xa66f('0x77')]();_0x3ac90f[_0xa66f('0x3e')](_0xa66f('0x78'),_0x5a1838['id']);_0x148a8d[_0xa66f('0x79')](db['sequelize'][_0xa66f('0x35')](_0x3ac90f[_0xa66f('0x7a')](),{'type':db[_0xa66f('0x6b')][_0xa66f('0x7b')][_0xa66f('0x7c')]})['then'](function(_0x520dbb){if(_0x520dbb[_0xa66f('0x39')]===0x1){return _0x5a1838['id'];}else{var _0x30468d=_[_0xa66f('0x7d')](_[_0xa66f('0x2f')](_0x520dbb,_0xa66f('0x7e')),function(_0x3285c6){return _[_0xa66f('0x7f')](_0x50192d,_0x3285c6);});if(_0x30468d){return _0x5a1838['id'];}}}));}}return BPromise[_0xa66f('0x80')](_0x148a8d)[_0xa66f('0x26')](function(_0x1704e3){_0x26cc07=_(_0x26cc07)[_0xa66f('0x81')](_0x1704e3)[_0xa66f('0x82')]()['value']();return db[_0xa66f('0x30')][_0xa66f('0x48')]({'where':{'id':_0x40fb75['params']['id']}})[_0xa66f('0x26')](function(_0x5c5445){return db[_0xa66f('0x6b')]['transaction'](function(_0x4fe5e1){return _0x5c5445[_0xa66f('0x70')](_0x40fb75['query'][_0xa66f('0x65')],{'transaction':_0x4fe5e1})[_0xa66f('0x26')](function(){if(!_['isEmpty'](_0x26cc07)){return _0x5c5445[_0xa66f('0x83')](_0x26cc07,{'transaction':_0x4fe5e1});}})[_0xa66f('0x26')](function(){_0x26cc07['forEach'](function(_0xa568ed){socket[_0xa66f('0x84')](_0xa66f('0x85'),{'UserId':_0xa568ed,'SmsQueueId':_0x5c5445['id']});});});});});});})[_0xa66f('0x26')](respondWithStatusCode(_0x3224a5,null))['catch'](handleError(_0x3224a5,null));};exports['addAgents']=function(_0x34daef,_0xdd2d09,_0x41f6a2){return db[_0xa66f('0x30')][_0xa66f('0x48')]({'where':{'id':_0x34daef[_0xa66f('0x53')]['id']}})[_0xa66f('0x26')](handleEntityNotFound(_0xdd2d09,null))[_0xa66f('0x26')](function(_0x51f11a){if(_0x51f11a){return _0x51f11a[_0xa66f('0x86')](_0x34daef['body']['ids'],_[_0xa66f('0x87')](_0x34daef[_0xa66f('0x4a')],[_0xa66f('0x65'),'id'])||{})[_0xa66f('0x88')](function(_0x22ea68){for(var _0x59d4a5=0x0;_0x59d4a5<_0x34daef[_0xa66f('0x4a')][_0xa66f('0x65')][_0xa66f('0x39')];_0x59d4a5+=0x1){socket['emit']('userSmsQueue:save',{'UserId':_0x34daef['body'][_0xa66f('0x65')][_0x59d4a5],'SmsQueueId':_0x34daef['params']['id']});}return _0x22ea68;});}})[_0xa66f('0x26')](respondWithResult(_0xdd2d09,null))[_0xa66f('0x51')](handleError(_0xdd2d09,null));};exports[_0xa66f('0x83')]=function(_0x90b7f1,_0x4bf3f6,_0xbf5668){return db[_0xa66f('0x30')]['find']({'where':{'id':_0x90b7f1[_0xa66f('0x53')]['id']}})[_0xa66f('0x26')](handleEntityNotFound(_0x4bf3f6,null))['then'](function(_0x4fa27c){if(_0x4fa27c){return _0x4fa27c[_0xa66f('0x83')](_0x90b7f1[_0xa66f('0x35')][_0xa66f('0x65')])['then'](function(){if(_['isArray'](_0x90b7f1['query']['ids'])){for(var _0xb6b51b=0x0;_0xb6b51b<_0x90b7f1[_0xa66f('0x35')][_0xa66f('0x65')][_0xa66f('0x39')];_0xb6b51b+=0x1){socket[_0xa66f('0x84')](_0xa66f('0x85'),{'UserId':Number(_0x90b7f1['query'][_0xa66f('0x65')][_0xb6b51b]),'SmsQueueId':Number(_0x90b7f1[_0xa66f('0x53')]['id'])});}}else{socket[_0xa66f('0x84')](_0xa66f('0x85'),{'UserId':Number(_0x90b7f1['query']['ids']),'SmsQueueId':Number(_0x90b7f1[_0xa66f('0x53')]['id'])});}});}})[_0xa66f('0x26')](respondWithStatusCode(_0x4bf3f6,null))[_0xa66f('0x51')](handleError(_0x4bf3f6,null));};exports[_0xa66f('0x89')]=function(_0x10e0fd,_0x21a2d7,_0x1f4f4b){var _0xb01698={};var _0x7a57e9={};var _0x179eb7;var _0x5e0b36;return db['SmsQueue'][_0xa66f('0x56')]({'where':{'id':_0x10e0fd['params']['id']}})[_0xa66f('0x26')](handleEntityNotFound(_0x21a2d7,null))[_0xa66f('0x26')](function(_0x13f006){if(_0x13f006){_0x179eb7=_0x13f006;_0x7a57e9[_0xa66f('0x33')]=_[_0xa66f('0x34')](db['User']['rawAttributes']);_0x7a57e9['query']=_['keys'](_0x10e0fd[_0xa66f('0x35')]);_0x7a57e9[_0xa66f('0x3f')]=_[_0xa66f('0x36')](_0x7a57e9[_0xa66f('0x33')],_0x7a57e9['query']);_0xb01698[_0xa66f('0x37')]=_[_0xa66f('0x36')](_0x7a57e9['model'],qs[_0xa66f('0x38')](_0x10e0fd[_0xa66f('0x35')]['fields']));_0xb01698[_0xa66f('0x37')]=_0xb01698[_0xa66f('0x37')]['length']?_0xb01698[_0xa66f('0x37')]:_0x7a57e9[_0xa66f('0x33')];_0xb01698[_0xa66f('0x3c')]=qs[_0xa66f('0x3d')](_0x10e0fd[_0xa66f('0x35')][_0xa66f('0x3d')]);_0xb01698[_0xa66f('0x3e')]=qs[_0xa66f('0x3f')](_[_0xa66f('0x40')](_0x10e0fd[_0xa66f('0x35')],_0x7a57e9[_0xa66f('0x3f')]));if(_0x10e0fd['query']['filter']){_0xb01698[_0xa66f('0x3e')]=_[_0xa66f('0x41')](_0xb01698[_0xa66f('0x3e')],{'$or':_['map'](_0xb01698['attributes'],function(_0x2a6992){var _0x1d5f20={};_0x1d5f20[_0x2a6992]={'$like':'%'+_0x10e0fd[_0xa66f('0x35')][_0xa66f('0x42')]+'%'};return _0x1d5f20;})});}_0xb01698=_[_0xa66f('0x41')]({},_0xb01698,_0x10e0fd['options']);return _0x179eb7[_0xa66f('0x89')](_0xb01698);}})[_0xa66f('0x26')](function(_0x287f9e){if(_0x287f9e){_0x5e0b36=_0x287f9e[_0xa66f('0x39')];if(!_0x10e0fd['query'][_0xa66f('0x3a')](_0xa66f('0x3b'))){_0xb01698['limit']=qs[_0xa66f('0x1f')](_0x10e0fd[_0xa66f('0x35')]['limit']);_0xb01698[_0xa66f('0x1e')]=qs[_0xa66f('0x1e')](_0x10e0fd[_0xa66f('0x35')][_0xa66f('0x1e')]);}return _0x179eb7[_0xa66f('0x89')](_0xb01698);}})[_0xa66f('0x26')](function(_0x2aca23){if(_0x2aca23){return _0x2aca23?{'count':_0x5e0b36,'rows':_0x2aca23}:null;}})['then'](respondWithResult(_0x21a2d7,null))['catch'](handleError(_0x21a2d7,null));}; \ No newline at end of file +var _0x5f2f=['json','count','offset','set','reject','save','update','then','get','SmsQueues','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','SmsQueue','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','hasOwnProperty','nolimit','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','all','union','compact','value','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','body','omit','userSmsQueue:save','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','status','end'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x5f2f,0x73));var _0xf5f2=function(_0x190c89,_0xd26593){_0x190c89=_0x190c89-0x0;var _0x5b6367=_0x5f2f[_0x190c89];return _0x5b6367;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var db=require(_0xf5f2('0x16'))['db'];config[_0xf5f2('0x17')]=_[_0xf5f2('0x18')](config[_0xf5f2('0x17')],{'host':_0xf5f2('0x19'),'port':0x18eb});var socket=require(_0xf5f2('0x1a'))(new Redis(config['redis']));require(_0xf5f2('0x1b'))[_0xf5f2('0x1c')](socket);function respondWithStatusCode(_0x269909,_0x1c1a5c){_0x1c1a5c=_0x1c1a5c||0xcc;return function(_0x422b55){if(_0x422b55){return _0x269909['sendStatus'](_0x1c1a5c);}return _0x269909[_0xf5f2('0x1d')](_0x1c1a5c)[_0xf5f2('0x1e')]();};}function respondWithResult(_0x17d656,_0x1b6dd2){_0x1b6dd2=_0x1b6dd2||0xc8;return function(_0x23e23a){if(_0x23e23a){return _0x17d656[_0xf5f2('0x1d')](_0x1b6dd2)[_0xf5f2('0x1f')](_0x23e23a);}};}function respondWithFilteredResult(_0x395a5a,_0x11f702){return function(_0x228ace){if(_0x228ace){var _0x20fccd=_0x228ace[_0xf5f2('0x20')],_0x28e097=_0x11f702[_0xf5f2('0x21')],_0x4ff59b=_0x11f702[_0xf5f2('0x21')]+_0x11f702['limit'],_0x3ee69;if(_0x4ff59b>=_0x20fccd){_0x4ff59b=_0x20fccd;_0x3ee69=0xc8;}else{_0x3ee69=0xce;}_0x395a5a[_0xf5f2('0x1d')](_0x3ee69);return _0x395a5a[_0xf5f2('0x22')]('Content-Range',_0x28e097+'-'+_0x4ff59b+'/'+_0x20fccd)['json'](_0x228ace);}return null;};}function patchUpdates(_0x2d2805){return function(_0x388e6c){try{jsonpatch['apply'](_0x388e6c,_0x2d2805,!![]);}catch(_0x45b74f){return BPromise[_0xf5f2('0x23')](_0x45b74f);}return _0x388e6c[_0xf5f2('0x24')]();};}function saveUpdates(_0x39c024,_0x36f1cb){return function(_0x4c691a){if(_0x4c691a){return _0x4c691a[_0xf5f2('0x25')](_0x39c024)[_0xf5f2('0x26')](function(_0x4e8bda){return _0x4e8bda;});}return null;};}function removeEntity(_0x2833fe,_0x287ad5){return function(_0x5bdf4a){if(_0x5bdf4a){return _0x5bdf4a['destroy']()[_0xf5f2('0x26')](function(){var _0x3f79d5=_0x5bdf4a[_0xf5f2('0x27')]({'plain':!![]});var _0x1a5bb3=_0xf5f2('0x28');return db[_0xf5f2('0x29')][_0xf5f2('0x2a')]({'where':{'type':_0x1a5bb3,'resourceId':_0x3f79d5['id']}})[_0xf5f2('0x26')](function(){return _0x5bdf4a;});})[_0xf5f2('0x26')](function(){_0x2833fe['status'](0xcc)[_0xf5f2('0x1e')]();});}};}function handleEntityNotFound(_0x102449,_0x375ca8){return function(_0x31bfcb){if(!_0x31bfcb){_0x102449[_0xf5f2('0x2b')](0x194);}return _0x31bfcb;};}function handleError(_0x477604,_0x5b6672){_0x5b6672=_0x5b6672||0x1f4;return function(_0x53cb96){logger[_0xf5f2('0x2c')](_0x53cb96[_0xf5f2('0x2d')]);if(_0x53cb96[_0xf5f2('0x2e')]){delete _0x53cb96['name'];}_0x477604['status'](_0x5b6672)[_0xf5f2('0x2f')](_0x53cb96);};}exports[_0xf5f2('0x30')]=function(_0x17394a,_0x153924){var _0x1b381e={},_0x54c0c8={},_0x52e959={'count':0x0,'rows':[]};var _0x2f4778=_['map'](db[_0xf5f2('0x31')]['rawAttributes'],function(_0x45b643){return{'name':_0x45b643[_0xf5f2('0x32')],'type':_0x45b643[_0xf5f2('0x33')][_0xf5f2('0x34')]};});_0x54c0c8[_0xf5f2('0x35')]=_[_0xf5f2('0x36')](_0x2f4778,_0xf5f2('0x2e'));_0x54c0c8[_0xf5f2('0x37')]=_['keys'](_0x17394a[_0xf5f2('0x37')]);_0x54c0c8[_0xf5f2('0x38')]=_[_0xf5f2('0x39')](_0x54c0c8[_0xf5f2('0x35')],_0x54c0c8[_0xf5f2('0x37')]);_0x1b381e[_0xf5f2('0x3a')]=_[_0xf5f2('0x39')](_0x54c0c8['model'],qs[_0xf5f2('0x3b')](_0x17394a[_0xf5f2('0x37')]['fields']));_0x1b381e[_0xf5f2('0x3a')]=_0x1b381e['attributes'][_0xf5f2('0x3c')]?_0x1b381e[_0xf5f2('0x3a')]:_0x54c0c8[_0xf5f2('0x35')];if(!_0x17394a[_0xf5f2('0x37')]['hasOwnProperty']('nolimit')){_0x1b381e[_0xf5f2('0x3d')]=qs[_0xf5f2('0x3d')](_0x17394a[_0xf5f2('0x37')]['limit']);_0x1b381e[_0xf5f2('0x21')]=qs['offset'](_0x17394a[_0xf5f2('0x37')]['offset']);}_0x1b381e[_0xf5f2('0x3e')]=qs[_0xf5f2('0x3f')](_0x17394a['query'][_0xf5f2('0x3f')]);_0x1b381e[_0xf5f2('0x40')]=qs[_0xf5f2('0x38')](_[_0xf5f2('0x41')](_0x17394a['query'],_0x54c0c8['filters']));if(_0x17394a[_0xf5f2('0x37')][_0xf5f2('0x42')]){_0x1b381e[_0xf5f2('0x40')]=_[_0xf5f2('0x43')](_0x1b381e[_0xf5f2('0x40')],{'$or':_[_0xf5f2('0x36')](_0x2f4778,function(_0x2bc20e){if(_0x2bc20e['type']!==_0xf5f2('0x44')){var _0x3b4ea6={};_0x3b4ea6[_0x2bc20e['name']]={'$like':'%'+_0x17394a[_0xf5f2('0x37')][_0xf5f2('0x42')]+'%'};return _0x3b4ea6;}})});}_0x1b381e=_[_0xf5f2('0x43')]({},_0x1b381e,_0x17394a[_0xf5f2('0x45')]);var _0xd10701={'where':_0x1b381e[_0xf5f2('0x40')]};return db[_0xf5f2('0x31')][_0xf5f2('0x20')](_0xd10701)['then'](function(_0x31c3c){_0x52e959[_0xf5f2('0x20')]=_0x31c3c;if(_0x17394a[_0xf5f2('0x37')]['includeAll']){_0x1b381e['include']=[{'all':!![]}];}return db['SmsQueue'][_0xf5f2('0x46')](_0x1b381e);})[_0xf5f2('0x26')](function(_0x4c8d8e){_0x52e959[_0xf5f2('0x47')]=_0x4c8d8e;return _0x52e959;})[_0xf5f2('0x26')](respondWithFilteredResult(_0x153924,_0x1b381e))[_0xf5f2('0x48')](handleError(_0x153924,null));};exports[_0xf5f2('0x49')]=function(_0x354c34,_0x2b3b1c){var _0x1a6ec1={'raw':!![],'where':{'id':_0x354c34[_0xf5f2('0x4a')]['id']}},_0x212e90={};_0x212e90[_0xf5f2('0x35')]=_[_0xf5f2('0x4b')](db[_0xf5f2('0x31')][_0xf5f2('0x4c')]);_0x212e90[_0xf5f2('0x37')]=_['keys'](_0x354c34[_0xf5f2('0x37')]);_0x212e90['filters']=_[_0xf5f2('0x39')](_0x212e90[_0xf5f2('0x35')],_0x212e90[_0xf5f2('0x37')]);_0x1a6ec1[_0xf5f2('0x3a')]=_[_0xf5f2('0x39')](_0x212e90[_0xf5f2('0x35')],qs['fields'](_0x354c34[_0xf5f2('0x37')][_0xf5f2('0x3b')]));_0x1a6ec1[_0xf5f2('0x3a')]=_0x1a6ec1[_0xf5f2('0x3a')][_0xf5f2('0x3c')]?_0x1a6ec1[_0xf5f2('0x3a')]:_0x212e90[_0xf5f2('0x35')];if(_0x354c34[_0xf5f2('0x37')]['includeAll']){_0x1a6ec1[_0xf5f2('0x4d')]=[{'all':!![]}];}_0x1a6ec1=_[_0xf5f2('0x43')]({},_0x1a6ec1,_0x354c34[_0xf5f2('0x45')]);return db['SmsQueue'][_0xf5f2('0x4e')](_0x1a6ec1)[_0xf5f2('0x26')](handleEntityNotFound(_0x2b3b1c,null))[_0xf5f2('0x26')](respondWithResult(_0x2b3b1c,null))['catch'](handleError(_0x2b3b1c,null));};exports['create']=function(_0x7bb942,_0x27c472){return db['SmsQueue'][_0xf5f2('0x4f')](_0x7bb942['body'],{})[_0xf5f2('0x26')](function(_0x497eb8){var _0x2cbd9d=_0x7bb942['user'][_0xf5f2('0x27')]({'plain':!![]});if(!_0x2cbd9d)throw new Error(_0xf5f2('0x50'));if(_0x2cbd9d[_0xf5f2('0x51')]===_0xf5f2('0x52')){var _0x4fa738=_0x497eb8[_0xf5f2('0x27')]({'plain':!![]});var _0x2b782f='SmsQueues';return db['UserProfileSection'][_0xf5f2('0x4e')]({'where':{'name':_0x2b782f,'userProfileId':_0x2cbd9d[_0xf5f2('0x53')]},'raw':!![]})['then'](function(_0x22b645){if(_0x22b645&&_0x22b645[_0xf5f2('0x54')]===0x0){return db[_0xf5f2('0x29')][_0xf5f2('0x4f')]({'name':_0x4fa738['name'],'resourceId':_0x4fa738['id'],'type':_0x22b645['name'],'sectionId':_0x22b645['id']},{})[_0xf5f2('0x26')](function(){return _0x497eb8;});}else{return _0x497eb8;}})[_0xf5f2('0x48')](function(_0x4b62fc){logger[_0xf5f2('0x2c')](_0xf5f2('0x55'),_0x4b62fc);throw _0x4b62fc;});}return _0x497eb8;})[_0xf5f2('0x26')](respondWithResult(_0x27c472,0xc9))[_0xf5f2('0x48')](handleError(_0x27c472,null));};exports[_0xf5f2('0x25')]=function(_0x73c9f1,_0x14ee10){if(_0x73c9f1['body']['id']){delete _0x73c9f1['body']['id'];}return db[_0xf5f2('0x31')][_0xf5f2('0x4e')]({'where':{'id':_0x73c9f1[_0xf5f2('0x4a')]['id']}})[_0xf5f2('0x26')](handleEntityNotFound(_0x14ee10,null))[_0xf5f2('0x26')](saveUpdates(_0x73c9f1['body'],null))[_0xf5f2('0x26')](respondWithResult(_0x14ee10,null))[_0xf5f2('0x48')](handleError(_0x14ee10,null));};exports[_0xf5f2('0x2a')]=function(_0x519c24,_0x1aa34b){return db['SmsQueue'][_0xf5f2('0x4e')]({'where':{'id':_0x519c24[_0xf5f2('0x4a')]['id']}})[_0xf5f2('0x26')](handleEntityNotFound(_0x1aa34b,null))[_0xf5f2('0x26')](removeEntity(_0x1aa34b,null))['catch'](handleError(_0x1aa34b,null));};exports['describe']=function(_0x756f1f,_0x4de303){return db[_0xf5f2('0x31')][_0xf5f2('0x56')]()['then'](respondWithResult(_0x4de303,null))[_0xf5f2('0x48')](handleError(_0x4de303,null));};exports[_0xf5f2('0x57')]=function(_0x2a8f6d,_0x51ef09,_0x397b99){var _0xcf7a50={'raw':!![],'where':{}},_0x42cc27={},_0x4579f4;return db['SmsQueue'][_0xf5f2('0x58')]({'where':{'id':_0x2a8f6d['params']['id']}})[_0xf5f2('0x26')](handleEntityNotFound(_0x51ef09,null))[_0xf5f2('0x26')](function(_0x2e6f5d){if(_0x2e6f5d){_0x4579f4=_0x2e6f5d[_0xf5f2('0x27')]({'plain':!![]});_0x42cc27[_0xf5f2('0x35')]=_['keys'](db[_0xf5f2('0x59')][_0xf5f2('0x4c')]);_0x42cc27[_0xf5f2('0x37')]=_[_0xf5f2('0x4b')](_0x2a8f6d[_0xf5f2('0x37')]);_0x42cc27['filters']=_[_0xf5f2('0x39')](_0x42cc27['model'],_0x42cc27['query']);_0xcf7a50[_0xf5f2('0x3a')]=_['intersection'](_0x42cc27[_0xf5f2('0x35')],qs[_0xf5f2('0x3b')](_0x2a8f6d[_0xf5f2('0x37')][_0xf5f2('0x3b')]));_0xcf7a50['attributes']=_0xcf7a50[_0xf5f2('0x3a')][_0xf5f2('0x3c')]?_0xcf7a50[_0xf5f2('0x3a')]:_0x42cc27[_0xf5f2('0x35')];if(!_0x2a8f6d[_0xf5f2('0x37')][_0xf5f2('0x5a')](_0xf5f2('0x5b'))){_0xcf7a50['limit']=qs[_0xf5f2('0x3d')](_0x2a8f6d[_0xf5f2('0x37')][_0xf5f2('0x3d')]);_0xcf7a50[_0xf5f2('0x21')]=qs['offset'](_0x2a8f6d[_0xf5f2('0x37')]['offset']);}_0xcf7a50[_0xf5f2('0x3e')]=qs[_0xf5f2('0x3f')](_0x2a8f6d['query'][_0xf5f2('0x3f')]);_0xcf7a50[_0xf5f2('0x40')]=qs[_0xf5f2('0x38')](_[_0xf5f2('0x41')](_0x2a8f6d[_0xf5f2('0x37')],_0x42cc27['filters']));_0xcf7a50[_0xf5f2('0x40')][_0xf5f2('0x5c')]=_0x2e6f5d['id'];if(_0x2a8f6d[_0xf5f2('0x37')][_0xf5f2('0x42')]){_0xcf7a50[_0xf5f2('0x40')]=_[_0xf5f2('0x43')](_0xcf7a50['where'],{'$or':_[_0xf5f2('0x36')](_0xcf7a50[_0xf5f2('0x3a')],function(_0x4800fe){var _0x3f677e={};_0x3f677e[_0x4800fe]={'$like':'%'+_0x2a8f6d[_0xf5f2('0x37')][_0xf5f2('0x42')]+'%'};return _0x3f677e;})});}_0xcf7a50=_['merge']({},_0xcf7a50,_0x2a8f6d['options']);return db['UserSmsQueue'][_0xf5f2('0x46')](_0xcf7a50);}})[_0xf5f2('0x26')](function(_0x35f6a2){if(_0x35f6a2){return db[_0xf5f2('0x5d')][_0xf5f2('0x5e')]({'where':{'id':_['map'](_0x35f6a2,_0xf5f2('0x5f')),'role':_0xf5f2('0x60')},'attributes':['id',_0xf5f2('0x2e'),_0xf5f2('0x61'),_0xf5f2('0x62'),_0xf5f2('0x63')]});}})[_0xf5f2('0x26')](function(_0x3cce11){if(_0x3cce11){return{'count':_0x3cce11[_0xf5f2('0x20')],'rows':_[_0xf5f2('0x36')](_0x3cce11[_0xf5f2('0x47')],function(_0x5679bc){return{'membername':_0x5679bc['name'],'UserId':_0x5679bc['id'],'queue_name':_0x4579f4['name'],'SmsQueueId':_0x4579f4['id'],'interface':util[_0xf5f2('0x64')](_0xf5f2('0x65'),_0xf5f2('0x66'),_0x5679bc[_0xf5f2('0x2e')]),'penalty':0x0,'paused':_0x5679bc[_0xf5f2('0x61')],'createdAt':_0x5679bc['createdAt'],'updatedAt':_0x5679bc[_0xf5f2('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf5f2('0x26')](respondWithFilteredResult(_0x51ef09,_0xcf7a50))[_0xf5f2('0x48')](handleError(_0x51ef09,null));};exports[_0xf5f2('0x67')]=function(_0x44d119,_0x55748d,_0x2986ed){var _0x1409b9={};var _0x517c15={};var _0x777098;var _0x2b0b30;return db[_0xf5f2('0x31')][_0xf5f2('0x58')]({'where':{'id':_0x44d119['params']['id']}})[_0xf5f2('0x26')](handleEntityNotFound(_0x55748d,null))[_0xf5f2('0x26')](function(_0x19602d){if(_0x19602d){_0x777098=_0x19602d;_0x517c15[_0xf5f2('0x35')]=_[_0xf5f2('0x4b')](db['Team']['rawAttributes']);_0x517c15[_0xf5f2('0x37')]=_[_0xf5f2('0x4b')](_0x44d119[_0xf5f2('0x37')]);_0x517c15[_0xf5f2('0x38')]=_['intersection'](_0x517c15['model'],_0x517c15[_0xf5f2('0x37')]);_0x1409b9['attributes']=_['intersection'](_0x517c15['model'],qs['fields'](_0x44d119[_0xf5f2('0x37')][_0xf5f2('0x3b')]));_0x1409b9[_0xf5f2('0x3a')]=_0x1409b9[_0xf5f2('0x3a')][_0xf5f2('0x3c')]?_0x1409b9[_0xf5f2('0x3a')]:_0x517c15[_0xf5f2('0x35')];_0x1409b9[_0xf5f2('0x3e')]=qs[_0xf5f2('0x3f')](_0x44d119[_0xf5f2('0x37')][_0xf5f2('0x3f')]);_0x1409b9[_0xf5f2('0x40')]=qs[_0xf5f2('0x38')](_[_0xf5f2('0x41')](_0x44d119[_0xf5f2('0x37')],_0x517c15[_0xf5f2('0x38')]));if(_0x44d119[_0xf5f2('0x37')][_0xf5f2('0x42')]){_0x1409b9['where']=_[_0xf5f2('0x43')](_0x1409b9[_0xf5f2('0x40')],{'$or':_[_0xf5f2('0x36')](_0x1409b9[_0xf5f2('0x3a')],function(_0x18c353){var _0x308220={};_0x308220[_0x18c353]={'$like':'%'+_0x44d119[_0xf5f2('0x37')][_0xf5f2('0x42')]+'%'};return _0x308220;})});}_0x1409b9=_['merge']({},_0x1409b9,_0x44d119[_0xf5f2('0x45')]);return _0x777098['getTeams'](_0x1409b9);}})['then'](function(_0x5bf3b9){if(_0x5bf3b9){_0x2b0b30=_0x5bf3b9['length'];if(!_0x44d119['query']['hasOwnProperty'](_0xf5f2('0x5b'))){_0x1409b9[_0xf5f2('0x3d')]=qs[_0xf5f2('0x3d')](_0x44d119[_0xf5f2('0x37')][_0xf5f2('0x3d')]);_0x1409b9[_0xf5f2('0x21')]=qs['offset'](_0x44d119['query'][_0xf5f2('0x21')]);}return _0x777098['getTeams'](_0x1409b9);}})[_0xf5f2('0x26')](function(_0x186fdd){if(_0x186fdd){return _0x186fdd?{'count':_0x2b0b30,'rows':_0x186fdd}:null;}})['then'](respondWithResult(_0x55748d,null))['catch'](handleError(_0x55748d,null));};exports[_0xf5f2('0x68')]=function(_0x274aa3,_0x5a23c7,_0x1c624f){var _0x388b32=_0x274aa3['body'][_0xf5f2('0x69')];return db[_0xf5f2('0x6a')][_0xf5f2('0x46')]({'where':{'id':_0x388b32},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf5f2('0x6b'),'attributes':['id',_0xf5f2('0x2e'),_0xf5f2('0x6c'),_0xf5f2('0x6d'),_0xf5f2('0x6e')],'raw':!![]}]})[_0xf5f2('0x26')](function(_0x25974b){if(_0x25974b){var _0x379053=_[_0xf5f2('0x6f')](_0x25974b,function(_0x3a6f60){var _0x191af3=_0x3a6f60[_0xf5f2('0x27')]({'plain':!![]});return _0x191af3[_0xf5f2('0x6b')];});return db[_0xf5f2('0x31')][_0xf5f2('0x4e')]({'where':{'id':_0x274aa3[_0xf5f2('0x4a')]['id']}})[_0xf5f2('0x26')](function(_0x29a9d4){return db[_0xf5f2('0x70')][_0xf5f2('0x71')](function(_0x800f42){return _0x29a9d4['addTeams'](_0x388b32,{'transaction':_0x800f42})[_0xf5f2('0x26')](function(){return BPromise[_0xf5f2('0x72')](_0x379053,function(_0x5d6c6e){return db[_0xf5f2('0x59')][_0xf5f2('0x73')]({'where':{'UserId':_0x5d6c6e['id'],'SmsQueueId':_0x274aa3['params']['id']},'transaction':_0x800f42});});})[_0xf5f2('0x26')](function(){_0x379053[_0xf5f2('0x74')](function(_0x335d9b){socket['emit']('userSmsQueue:save',{'UserId':_0x335d9b['id'],'SmsQueueId':_0x29a9d4['id']});});});});});}})[_0xf5f2('0x26')](respondWithStatusCode(_0x5a23c7,null))[_0xf5f2('0x48')](handleError(_0x5a23c7,null));};exports[_0xf5f2('0x75')]=function(_0x5ba275,_0x596958,_0x2572c0){return db[_0xf5f2('0x6a')][_0xf5f2('0x46')]({'where':{'id':_0x5ba275['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x596958,null))[_0xf5f2('0x26')](function(_0x561bab){var _0x1acb72=_[_0xf5f2('0x36')](_0x561bab,'id');var _0xec3c35=[];var _0x43a167=[];var _0x29ab74=squel[_0xf5f2('0x76')]();_0x29ab74[_0xf5f2('0x77')](_0xf5f2('0x78'))[_0xf5f2('0x79')](_0xf5f2('0x7a'),'tq')[_0xf5f2('0x7b')](_0xf5f2('0x7c'),'ut',_0xf5f2('0x7d'))['where'](_0xf5f2('0x7e'),_0x5ba275[_0xf5f2('0x4a')]['id']);for(var _0x5783e2=0x0;_0x5783e2<_0x561bab[_0xf5f2('0x3c')];_0x5783e2+=0x1){let _0x3395d3=_0x561bab[_0x5783e2];for(var _0x537a7d=0x0;_0x537a7d<_0x3395d3[_0xf5f2('0x6b')][_0xf5f2('0x3c')];_0x537a7d+=0x1){let _0x281f61=_0x3395d3['Agents'][_0x537a7d];var _0x21c5fc=_0x29ab74[_0xf5f2('0x7f')]();_0x21c5fc['where'](_0xf5f2('0x80'),_0x281f61['id']);_0x43a167[_0xf5f2('0x81')](db[_0xf5f2('0x70')]['query'](_0x21c5fc[_0xf5f2('0x82')](),{'type':db['sequelize'][_0xf5f2('0x83')]['SELECT']})[_0xf5f2('0x26')](function(_0x3cbc58){if(_0x3cbc58[_0xf5f2('0x3c')]===0x1){return _0x281f61['id'];}else{var _0x42c915=_['every'](_[_0xf5f2('0x36')](_0x3cbc58,'TeamId'),function(_0x52e037){return _['includes'](_0x1acb72,_0x52e037);});if(_0x42c915){return _0x281f61['id'];}}}));}}return BPromise[_0xf5f2('0x84')](_0x43a167)[_0xf5f2('0x26')](function(_0x5ece9e){_0xec3c35=_(_0xec3c35)[_0xf5f2('0x85')](_0x5ece9e)[_0xf5f2('0x86')]()[_0xf5f2('0x87')]();return db[_0xf5f2('0x31')][_0xf5f2('0x4e')]({'where':{'id':_0x5ba275[_0xf5f2('0x4a')]['id']}})['then'](function(_0x415b97){return db[_0xf5f2('0x70')]['transaction'](function(_0x22865e){return _0x415b97[_0xf5f2('0x75')](_0x5ba275['query'][_0xf5f2('0x69')],{'transaction':_0x22865e})[_0xf5f2('0x26')](function(){if(!_[_0xf5f2('0x88')](_0xec3c35)){return _0x415b97[_0xf5f2('0x89')](_0xec3c35,{'transaction':_0x22865e});}})[_0xf5f2('0x26')](function(){_0xec3c35[_0xf5f2('0x74')](function(_0x4df05c){socket[_0xf5f2('0x8a')](_0xf5f2('0x8b'),{'UserId':_0x4df05c,'SmsQueueId':_0x415b97['id']});});});});});});})[_0xf5f2('0x26')](respondWithStatusCode(_0x596958,null))[_0xf5f2('0x48')](handleError(_0x596958,null));};exports[_0xf5f2('0x8c')]=function(_0x24ca50,_0x162c13,_0x258920){return db[_0xf5f2('0x31')]['find']({'where':{'id':_0x24ca50[_0xf5f2('0x4a')]['id']}})[_0xf5f2('0x26')](handleEntityNotFound(_0x162c13,null))[_0xf5f2('0x26')](function(_0x934a7d){if(_0x934a7d){return _0x934a7d[_0xf5f2('0x8c')](_0x24ca50[_0xf5f2('0x8d')][_0xf5f2('0x69')],_[_0xf5f2('0x8e')](_0x24ca50[_0xf5f2('0x8d')],[_0xf5f2('0x69'),'id'])||{})['spread'](function(_0x52e419){for(var _0x2076c7=0x0;_0x2076c7<_0x24ca50[_0xf5f2('0x8d')][_0xf5f2('0x69')][_0xf5f2('0x3c')];_0x2076c7+=0x1){socket['emit'](_0xf5f2('0x8f'),{'UserId':_0x24ca50[_0xf5f2('0x8d')][_0xf5f2('0x69')][_0x2076c7],'SmsQueueId':_0x24ca50[_0xf5f2('0x4a')]['id']});}return _0x52e419;});}})[_0xf5f2('0x26')](respondWithResult(_0x162c13,null))['catch'](handleError(_0x162c13,null));};exports[_0xf5f2('0x89')]=function(_0x18d727,_0x4bdb72,_0x4511f4){return db[_0xf5f2('0x31')][_0xf5f2('0x4e')]({'where':{'id':_0x18d727[_0xf5f2('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4bdb72,null))[_0xf5f2('0x26')](function(_0xfc76d9){if(_0xfc76d9){return _0xfc76d9[_0xf5f2('0x89')](_0x18d727['query']['ids'])[_0xf5f2('0x26')](function(){if(_[_0xf5f2('0x90')](_0x18d727[_0xf5f2('0x37')][_0xf5f2('0x69')])){for(var _0xbe2fb6=0x0;_0xbe2fb6<_0x18d727[_0xf5f2('0x37')]['ids'][_0xf5f2('0x3c')];_0xbe2fb6+=0x1){socket['emit'](_0xf5f2('0x8b'),{'UserId':Number(_0x18d727[_0xf5f2('0x37')][_0xf5f2('0x69')][_0xbe2fb6]),'SmsQueueId':Number(_0x18d727[_0xf5f2('0x4a')]['id'])});}}else{socket[_0xf5f2('0x8a')](_0xf5f2('0x8b'),{'UserId':Number(_0x18d727['query'][_0xf5f2('0x69')]),'SmsQueueId':Number(_0x18d727[_0xf5f2('0x4a')]['id'])});}});}})[_0xf5f2('0x26')](respondWithStatusCode(_0x4bdb72,null))[_0xf5f2('0x48')](handleError(_0x4bdb72,null));};exports[_0xf5f2('0x91')]=function(_0x1348e8,_0x12d215,_0x54b095){var _0x1ee541={};var _0x4a6b83={};var _0x5857d1;var _0x505056;return db[_0xf5f2('0x31')][_0xf5f2('0x58')]({'where':{'id':_0x1348e8['params']['id']}})[_0xf5f2('0x26')](handleEntityNotFound(_0x12d215,null))[_0xf5f2('0x26')](function(_0x2a2791){if(_0x2a2791){_0x5857d1=_0x2a2791;_0x4a6b83[_0xf5f2('0x35')]=_['keys'](db[_0xf5f2('0x5d')][_0xf5f2('0x4c')]);_0x4a6b83[_0xf5f2('0x37')]=_['keys'](_0x1348e8[_0xf5f2('0x37')]);_0x4a6b83[_0xf5f2('0x38')]=_['intersection'](_0x4a6b83[_0xf5f2('0x35')],_0x4a6b83[_0xf5f2('0x37')]);_0x1ee541[_0xf5f2('0x3a')]=_[_0xf5f2('0x39')](_0x4a6b83[_0xf5f2('0x35')],qs[_0xf5f2('0x3b')](_0x1348e8[_0xf5f2('0x37')][_0xf5f2('0x3b')]));_0x1ee541[_0xf5f2('0x3a')]=_0x1ee541[_0xf5f2('0x3a')][_0xf5f2('0x3c')]?_0x1ee541['attributes']:_0x4a6b83[_0xf5f2('0x35')];_0x1ee541[_0xf5f2('0x3e')]=qs['sort'](_0x1348e8[_0xf5f2('0x37')]['sort']);_0x1ee541[_0xf5f2('0x40')]=qs[_0xf5f2('0x38')](_[_0xf5f2('0x41')](_0x1348e8[_0xf5f2('0x37')],_0x4a6b83['filters']));if(_0x1348e8[_0xf5f2('0x37')]['filter']){_0x1ee541[_0xf5f2('0x40')]=_['merge'](_0x1ee541[_0xf5f2('0x40')],{'$or':_[_0xf5f2('0x36')](_0x1ee541['attributes'],function(_0x2bfc53){var _0x4525c9={};_0x4525c9[_0x2bfc53]={'$like':'%'+_0x1348e8[_0xf5f2('0x37')][_0xf5f2('0x42')]+'%'};return _0x4525c9;})});}_0x1ee541=_[_0xf5f2('0x43')]({},_0x1ee541,_0x1348e8[_0xf5f2('0x45')]);return _0x5857d1['getAgents'](_0x1ee541);}})['then'](function(_0x16a189){if(_0x16a189){_0x505056=_0x16a189[_0xf5f2('0x3c')];if(!_0x1348e8['query'][_0xf5f2('0x5a')](_0xf5f2('0x5b'))){_0x1ee541[_0xf5f2('0x3d')]=qs[_0xf5f2('0x3d')](_0x1348e8[_0xf5f2('0x37')][_0xf5f2('0x3d')]);_0x1ee541[_0xf5f2('0x21')]=qs['offset'](_0x1348e8[_0xf5f2('0x37')]['offset']);}return _0x5857d1[_0xf5f2('0x91')](_0x1ee541);}})['then'](function(_0x3ff273){if(_0x3ff273){return _0x3ff273?{'count':_0x505056,'rows':_0x3ff273}:null;}})['then'](respondWithResult(_0x12d215,null))[_0xf5f2('0x48')](handleError(_0x12d215,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index b4821e0..3ae7a37 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 _0x5a3c=['remove','emit','hook','exports','../../mysqldb','SmsQueue','setMaxListeners','save','update'];(function(_0x3f811b,_0x49ea3b){var _0x2f8360=function(_0x160d5d){while(--_0x160d5d){_0x3f811b['push'](_0x3f811b['shift']());}};_0x2f8360(++_0x49ea3b);}(_0x5a3c,0x1b4));var _0xc5a3=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x5a3c[_0x2a6809];return _0x11c371;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xc5a3('0x0'))['db'][_0xc5a3('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xc5a3('0x2')](0x0);var events={'afterCreate':_0xc5a3('0x3'),'afterUpdate':_0xc5a3('0x4'),'afterDestroy':_0xc5a3('0x5')};function emitEvent(_0x21dcf6){return function(_0x120cdd,_0x4004e7,_0x3207b8){SmsQueueEvents[_0xc5a3('0x6')](_0x21dcf6+':'+_0x120cdd['id'],_0x120cdd);SmsQueueEvents[_0xc5a3('0x6')](_0x21dcf6,_0x120cdd);_0x3207b8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xc5a3('0x7')](e,emitEvent(event));}}module[_0xc5a3('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0xe267=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe267,0x13c));var _0x7e26=function(_0x104b35,_0x13f218){_0x104b35=_0x104b35-0x0;var _0x55584d=_0xe267[_0x104b35];return _0x55584d;};'use strict';var EventEmitter=require(_0x7e26('0x0'));var SmsQueue=require(_0x7e26('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x7e26('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7e26('0x3')};function emitEvent(_0x50f2b1){return function(_0x3591d3,_0xf024c7,_0xdadb52){SmsQueueEvents[_0x7e26('0x4')](_0x50f2b1+':'+_0x3591d3['id'],_0x3591d3);SmsQueueEvents[_0x7e26('0x4')](_0x50f2b1,_0x3591d3);_0xdadb52(null);};}for(var e in events){if(events[_0x7e26('0x5')](e)){var event=events[e];SmsQueue[_0x7e26('0x6')](e,emitEvent(event));}}module[_0x7e26('0x7')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index b11cc89..f7a2691 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 _0x061c=['util','api','moment','request-promise','path','rimraf','./smsQueue.attributes','SmsQueue'];(function(_0x1e05c1,_0x3cffa3){var _0x15f1ca=function(_0x3a9594){while(--_0x3a9594){_0x1e05c1['push'](_0x1e05c1['shift']());}};_0x15f1ca(++_0x3cffa3);}(_0x061c,0x1d0));var _0xc061=function(_0x5aca51,_0xe18cb3){_0x5aca51=_0x5aca51-0x0;var _0x208d79=_0x061c[_0x5aca51];return _0x208d79;};'use strict';var _=require('lodash');var util=require(_0xc061('0x0'));var logger=require('../../config/logger')(_0xc061('0x1'));var moment=require(_0xc061('0x2'));var BPromise=require('bluebird');var rp=require(_0xc061('0x3'));var fs=require('fs');var path=require(_0xc061('0x4'));var rimraf=require(_0xc061('0x5'));var config=require('../../config/environment');var attributes=require(_0xc061('0x6'));module['exports']=function(_0x40da6c,_0x49cef7){return _0x40da6c['define'](_0xc061('0x7'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x510c=['path','../../config/environment','./smsQueue.attributes','define','SmsQueue','sms_queues','util','../../config/logger','bluebird','request-promise'];(function(_0x129c27,_0x333c44){var _0x5a8017=function(_0x5c5083){while(--_0x5c5083){_0x129c27['push'](_0x129c27['shift']());}};_0x5a8017(++_0x333c44);}(_0x510c,0x88));var _0xc510=function(_0x52c5ec,_0x416bec){_0x52c5ec=_0x52c5ec-0x0;var _0x2743a8=_0x510c[_0x52c5ec];return _0x2743a8;};'use strict';var _=require('lodash');var util=require(_0xc510('0x0'));var logger=require(_0xc510('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc510('0x2'));var rp=require(_0xc510('0x3'));var fs=require('fs');var path=require(_0xc510('0x4'));var rimraf=require('rimraf');var config=require(_0xc510('0x5'));var attributes=require(_0xc510('0x6'));module['exports']=function(_0x58ccec,_0x10a220){return _0x58ccec[_0xc510('0x7')](_0xc510('0x8'),attributes,{'tableName':_0xc510('0x9'),'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 1ceac6f..64d1ad8 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 _0x7214=['findAll','options','where','limit','include','map','model','attributes','GetSmsQueue','debug','ShowSmsQueue','SmsQueue','raw','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7214,0x146));var _0x4721=function(_0x4c4545,_0x44f6b7){_0x4c4545=_0x4c4545-0x0;var _0x2b5f4c=_0x7214[_0x4c4545];return _0x2b5f4c;};'use strict';var _=require('lodash');var util=require(_0x4721('0x0'));var moment=require(_0x4721('0x1'));var BPromise=require(_0x4721('0x2'));var rs=require(_0x4721('0x3'));var fs=require('fs');var Redis=require(_0x4721('0x4'));var db=require(_0x4721('0x5'))['db'];var utils=require(_0x4721('0x6'));var logger=require(_0x4721('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4721('0x8'));var client=jayson[_0x4721('0x9')][_0x4721('0xa')]({'port':0x232a});config[_0x4721('0xb')]=_[_0x4721('0xc')](config[_0x4721('0xb')],{'host':_0x4721('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4721('0xb')]));require(_0x4721('0xe'))[_0x4721('0xf')](socket);function respondWithRpcPromise(_0x9788be,_0x263e24,_0x488908){return new BPromise(function(_0x2a5dd8,_0x29b38b){return client[_0x4721('0x10')](_0x9788be,_0x488908)['then'](function(_0x3e1a8c){logger[_0x4721('0x11')](_0x4721('0x12'),_0x263e24,_0x4721('0x13'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x263e24,_0x4721('0x13'),JSON[_0x4721('0x14')](_0x3e1a8c));if(_0x3e1a8c['error']){if(_0x3e1a8c[_0x4721('0x15')][_0x4721('0x16')]===0x1f4){logger['error'](_0x4721('0x12'),_0x263e24,_0x3e1a8c[_0x4721('0x15')][_0x4721('0x17')]);return _0x29b38b(_0x3e1a8c['error'][_0x4721('0x17')]);}logger[_0x4721('0x15')](_0x4721('0x12'),_0x263e24,_0x3e1a8c[_0x4721('0x15')][_0x4721('0x17')]);return _0x2a5dd8(_0x3e1a8c[_0x4721('0x15')][_0x4721('0x17')]);}else{logger['info'](_0x4721('0x12'),_0x263e24,_0x4721('0x13'));_0x2a5dd8(_0x3e1a8c['result']['message']);}})[_0x4721('0x18')](function(_0x2cb771){logger[_0x4721('0x15')](_0x4721('0x12'),_0x263e24,_0x2cb771);_0x29b38b(_0x2cb771);});});}exports['GetSmsQueue']=function(_0x67bb4a){var _0x36e5f7=this;return new Promise(function(_0x30f69d,_0x50ed4e){return db['SmsQueue'][_0x4721('0x19')]({'raw':_0x67bb4a[_0x4721('0x1a')]?_0x67bb4a[_0x4721('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x67bb4a[_0x4721('0x1a')]?_0x67bb4a['options'][_0x4721('0x1b')]||null:null,'attributes':_0x67bb4a['options']?_0x67bb4a[_0x4721('0x1a')]['attributes']||null:null,'limit':_0x67bb4a[_0x4721('0x1a')]?_0x67bb4a[_0x4721('0x1a')][_0x4721('0x1c')]||null:null,'include':_0x67bb4a[_0x4721('0x1a')]?_0x67bb4a[_0x4721('0x1a')][_0x4721('0x1d')]?_[_0x4721('0x1e')](_0x67bb4a['options'][_0x4721('0x1d')],function(_0x12197e){return{'model':db[_0x12197e[_0x4721('0x1f')]],'as':_0x12197e['as'],'attributes':_0x12197e[_0x4721('0x20')],'include':_0x12197e[_0x4721('0x1d')]?_['map'](_0x12197e[_0x4721('0x1d')],function(_0x2d43b8){return{'model':db[_0x2d43b8[_0x4721('0x1f')]],'as':_0x2d43b8['as'],'attributes':_0x2d43b8['attributes'],'include':_0x2d43b8['include']?_['map'](_0x2d43b8[_0x4721('0x1d')],function(_0x22065e){return{'model':db[_0x22065e[_0x4721('0x1f')]],'as':_0x22065e['as'],'attributes':_0x22065e[_0x4721('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe9288c){logger[_0x4721('0x11')](_0x4721('0x21'),_0x67bb4a);logger[_0x4721('0x22')](_0x4721('0x21'),_0x67bb4a,JSON[_0x4721('0x14')](_0xe9288c));_0x30f69d(_0xe9288c);})[_0x4721('0x18')](function(_0x3b35ac){logger[_0x4721('0x15')](_0x4721('0x21'),_0x3b35ac[_0x4721('0x17')],_0x67bb4a);_0x50ed4e(_0x36e5f7['error'](0x1f4,_0x3b35ac[_0x4721('0x17')]));});});};exports[_0x4721('0x23')]=function(_0x32f2c2){var _0x39af7e=this;return new Promise(function(_0x34dbd3,_0x212860){return db[_0x4721('0x24')]['find']({'raw':_0x32f2c2['options']?_0x32f2c2[_0x4721('0x1a')][_0x4721('0x25')]===undefined?!![]:![]:!![],'where':_0x32f2c2[_0x4721('0x1a')]?_0x32f2c2['options']['where']||null:null,'attributes':_0x32f2c2[_0x4721('0x1a')]?_0x32f2c2[_0x4721('0x1a')]['attributes']||null:null,'include':_0x32f2c2[_0x4721('0x1a')]?_0x32f2c2[_0x4721('0x1a')][_0x4721('0x1d')]?_[_0x4721('0x1e')](_0x32f2c2[_0x4721('0x1a')][_0x4721('0x1d')],function(_0x500f59){return{'model':db[_0x500f59[_0x4721('0x1f')]],'as':_0x500f59['as'],'attributes':_0x500f59[_0x4721('0x20')],'include':_0x500f59[_0x4721('0x1d')]?_[_0x4721('0x1e')](_0x500f59[_0x4721('0x1d')],function(_0x29053e){return{'model':db[_0x29053e[_0x4721('0x1f')]],'as':_0x29053e['as'],'attributes':_0x29053e[_0x4721('0x20')],'include':_0x29053e['include']?_[_0x4721('0x1e')](_0x29053e[_0x4721('0x1d')],function(_0x35977c){return{'model':db[_0x35977c['model']],'as':_0x35977c['as'],'attributes':_0x35977c[_0x4721('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4721('0x26')](function(_0x3521ef){logger[_0x4721('0x11')](_0x4721('0x23'),_0x32f2c2);logger[_0x4721('0x22')](_0x4721('0x23'),_0x32f2c2,JSON['stringify'](_0x3521ef));_0x34dbd3(_0x3521ef);})['catch'](function(_0x27df07){logger[_0x4721('0x15')](_0x4721('0x23'),_0x27df07[_0x4721('0x17')],_0x32f2c2);_0x212860(_0x39af7e['error'](0x1f4,_0x27df07[_0x4721('0x17')]));});});}; \ No newline at end of file +var _0xab63=['catch','GetSmsQueue','findAll','options','attributes','include','map','model','ShowSmsQueue','SmsQueue','find','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x47d060,_0x4a2b1d){var _0xb2d051=function(_0x3434e7){while(--_0x3434e7){_0x47d060['push'](_0x47d060['shift']());}};_0xb2d051(++_0x4a2b1d);}(_0xab63,0xf7));var _0x3ab6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab63[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3ab6('0x0'));var util=require(_0x3ab6('0x1'));var moment=require(_0x3ab6('0x2'));var BPromise=require(_0x3ab6('0x3'));var rs=require(_0x3ab6('0x4'));var fs=require('fs');var Redis=require(_0x3ab6('0x5'));var db=require(_0x3ab6('0x6'))['db'];var utils=require(_0x3ab6('0x7'));var logger=require('../../config/logger')(_0x3ab6('0x8'));var config=require(_0x3ab6('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3ab6('0xa')]({'port':0x232a});config[_0x3ab6('0xb')]=_[_0x3ab6('0xc')](config[_0x3ab6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x3ab6('0xd'))(new Redis(config['redis']));require('./smsQueue.socket')[_0x3ab6('0xe')](socket);function respondWithRpcPromise(_0x34e6b7,_0x108f56,_0x8e440a){return new BPromise(function(_0x5df363,_0x1aa54c){return client[_0x3ab6('0xf')](_0x34e6b7,_0x8e440a)[_0x3ab6('0x10')](function(_0x209360){logger[_0x3ab6('0x11')](_0x3ab6('0x12'),_0x108f56,_0x3ab6('0x13'));logger[_0x3ab6('0x14')](_0x3ab6('0x15'),_0x108f56,_0x3ab6('0x13'),JSON[_0x3ab6('0x16')](_0x209360));if(_0x209360['error']){if(_0x209360[_0x3ab6('0x17')]['code']===0x1f4){logger[_0x3ab6('0x17')](_0x3ab6('0x12'),_0x108f56,_0x209360[_0x3ab6('0x17')]['message']);return _0x1aa54c(_0x209360['error'][_0x3ab6('0x18')]);}logger[_0x3ab6('0x17')]('SmsQueue,\x20%s,\x20%s',_0x108f56,_0x209360[_0x3ab6('0x17')][_0x3ab6('0x18')]);return _0x5df363(_0x209360[_0x3ab6('0x17')][_0x3ab6('0x18')]);}else{logger[_0x3ab6('0x11')](_0x3ab6('0x12'),_0x108f56,_0x3ab6('0x13'));_0x5df363(_0x209360[_0x3ab6('0x19')]['message']);}})[_0x3ab6('0x1a')](function(_0x481aed){logger[_0x3ab6('0x17')]('SmsQueue,\x20%s,\x20%s',_0x108f56,_0x481aed);_0x1aa54c(_0x481aed);});});}exports[_0x3ab6('0x1b')]=function(_0x9b2671){var _0x2f1707=this;return new Promise(function(_0x3d0895,_0x29efdb){return db['SmsQueue'][_0x3ab6('0x1c')]({'raw':_0x9b2671[_0x3ab6('0x1d')]?_0x9b2671[_0x3ab6('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x9b2671[_0x3ab6('0x1d')]?_0x9b2671[_0x3ab6('0x1d')]['where']||null:null,'attributes':_0x9b2671['options']?_0x9b2671[_0x3ab6('0x1d')][_0x3ab6('0x1e')]||null:null,'limit':_0x9b2671[_0x3ab6('0x1d')]?_0x9b2671['options']['limit']||null:null,'include':_0x9b2671[_0x3ab6('0x1d')]?_0x9b2671[_0x3ab6('0x1d')][_0x3ab6('0x1f')]?_[_0x3ab6('0x20')](_0x9b2671[_0x3ab6('0x1d')][_0x3ab6('0x1f')],function(_0x166640){return{'model':db[_0x166640[_0x3ab6('0x21')]],'as':_0x166640['as'],'attributes':_0x166640[_0x3ab6('0x1e')],'include':_0x166640[_0x3ab6('0x1f')]?_[_0x3ab6('0x20')](_0x166640[_0x3ab6('0x1f')],function(_0x2880ab){return{'model':db[_0x2880ab[_0x3ab6('0x21')]],'as':_0x2880ab['as'],'attributes':_0x2880ab['attributes'],'include':_0x2880ab['include']?_[_0x3ab6('0x20')](_0x2880ab[_0x3ab6('0x1f')],function(_0x582819){return{'model':db[_0x582819[_0x3ab6('0x21')]],'as':_0x582819['as'],'attributes':_0x582819['attributes']};}):[]};}):[]};}):[]:[]})[_0x3ab6('0x10')](function(_0x3c91c4){logger[_0x3ab6('0x11')](_0x3ab6('0x1b'),_0x9b2671);logger['debug'](_0x3ab6('0x1b'),_0x9b2671,JSON['stringify'](_0x3c91c4));_0x3d0895(_0x3c91c4);})['catch'](function(_0xe9b2b4){logger[_0x3ab6('0x17')](_0x3ab6('0x1b'),_0xe9b2b4[_0x3ab6('0x18')],_0x9b2671);_0x29efdb(_0x2f1707[_0x3ab6('0x17')](0x1f4,_0xe9b2b4[_0x3ab6('0x18')]));});});};exports[_0x3ab6('0x22')]=function(_0x2c3962){var _0x423e4c=this;return new Promise(function(_0x1251fe,_0x263c26){return db[_0x3ab6('0x23')][_0x3ab6('0x24')]({'raw':_0x2c3962[_0x3ab6('0x1d')]?_0x2c3962[_0x3ab6('0x1d')][_0x3ab6('0x25')]===undefined?!![]:![]:!![],'where':_0x2c3962[_0x3ab6('0x1d')]?_0x2c3962[_0x3ab6('0x1d')][_0x3ab6('0x26')]||null:null,'attributes':_0x2c3962[_0x3ab6('0x1d')]?_0x2c3962['options'][_0x3ab6('0x1e')]||null:null,'include':_0x2c3962[_0x3ab6('0x1d')]?_0x2c3962['options'][_0x3ab6('0x1f')]?_[_0x3ab6('0x20')](_0x2c3962[_0x3ab6('0x1d')]['include'],function(_0x2fb5dd){return{'model':db[_0x2fb5dd[_0x3ab6('0x21')]],'as':_0x2fb5dd['as'],'attributes':_0x2fb5dd[_0x3ab6('0x1e')],'include':_0x2fb5dd[_0x3ab6('0x1f')]?_['map'](_0x2fb5dd['include'],function(_0x5a8211){return{'model':db[_0x5a8211['model']],'as':_0x5a8211['as'],'attributes':_0x5a8211[_0x3ab6('0x1e')],'include':_0x5a8211[_0x3ab6('0x1f')]?_[_0x3ab6('0x20')](_0x5a8211[_0x3ab6('0x1f')],function(_0x3d9063){return{'model':db[_0x3d9063['model']],'as':_0x3d9063['as'],'attributes':_0x3d9063['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x215720){logger[_0x3ab6('0x11')](_0x3ab6('0x22'),_0x2c3962);logger[_0x3ab6('0x14')](_0x3ab6('0x22'),_0x2c3962,JSON[_0x3ab6('0x16')](_0x215720));_0x1251fe(_0x215720);})['catch'](function(_0x384eca){logger[_0x3ab6('0x17')]('ShowSmsQueue',_0x384eca[_0x3ab6('0x18')],_0x2c3962);_0x263c26(_0x423e4c[_0x3ab6('0x17')](0x1f4,_0x384eca[_0x3ab6('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 25787e1..1022f20 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 _0xe4aa=['smsQueue:','remove','removeListener','register'];(function(_0x1ad4c6,_0x1c6e4b){var _0x2a81c0=function(_0x2582b7){while(--_0x2582b7){_0x1ad4c6['push'](_0x1ad4c6['shift']());}};_0x2a81c0(++_0x1c6e4b);}(_0xe4aa,0x17d));var _0xae4a=function(_0x14b953,_0x3f6100){_0x14b953=_0x14b953-0x0;var _0x31555d=_0xe4aa[_0x14b953];return _0x31555d;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=['save',_0xae4a('0x0'),'update'];function createListener(_0x2cfc27,_0x17e83e){return function(_0x54a5f2){_0x17e83e['emit'](_0x2cfc27,_0x54a5f2);};}function removeListener(_0x205a26,_0x5b1bcf){return function(){SmsQueueEvents[_0xae4a('0x1')](_0x205a26,_0x5b1bcf);};}exports[_0xae4a('0x2')]=function(_0x480c46){for(var _0x404e41=0x0,_0x17c972=events['length'];_0x404e41<_0x17c972;_0x404e41++){var _0x11835c=events[_0x404e41];var _0x39a75a=createListener(_0xae4a('0x3')+_0x11835c,_0x480c46);SmsQueueEvents['on'](_0x11835c,_0x39a75a);}}; \ No newline at end of file +var _0x8c18=['length','smsQueue:','remove','update','emit','removeListener','register'];(function(_0x49ec29,_0xddb12){var _0x4cc1c4=function(_0x27ffcc){while(--_0x27ffcc){_0x49ec29['push'](_0x49ec29['shift']());}};_0x4cc1c4(++_0xddb12);}(_0x8c18,0x87));var _0x88c1=function(_0x3686d0,_0x54c78c){_0x3686d0=_0x3686d0-0x0;var _0x3834ea=_0x8c18[_0x3686d0];return _0x3834ea;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=['save',_0x88c1('0x0'),_0x88c1('0x1')];function createListener(_0x30917d,_0x3eeabc){return function(_0x37b071){_0x3eeabc[_0x88c1('0x2')](_0x30917d,_0x37b071);};}function removeListener(_0x4d021a,_0x4fe442){return function(){SmsQueueEvents[_0x88c1('0x3')](_0x4d021a,_0x4fe442);};}exports[_0x88c1('0x4')]=function(_0x35b6bd){for(var _0x260bd0=0x0,_0x1b13fc=events[_0x88c1('0x5')];_0x260bd0<_0x1b13fc;_0x260bd0++){var _0x22ddf2=events[_0x260bd0];var _0x361301=createListener(_0x88c1('0x6')+_0x22ddf2,_0x35b6bd);SmsQueueEvents['on'](_0x22ddf2,_0x361301);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 69b7c6e..8d5e3ce 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 _0x85d1=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','create','update','destroy','exports','multer','util'];(function(_0x5b9cbc,_0x1d75a0){var _0x254af0=function(_0x46b668){while(--_0x46b668){_0x5b9cbc['push'](_0x5b9cbc['shift']());}};_0x254af0(++_0x1d75a0);}(_0x85d1,0x17a));var _0x185d=function(_0x754ab4,_0x56daa7){_0x754ab4=_0x754ab4-0x0;var _0x34079a=_0x85d1[_0x754ab4];return _0x34079a;};'use strict';var multer=require(_0x185d('0x0'));var util=require(_0x185d('0x1'));var path=require(_0x185d('0x2'));var timeout=require(_0x185d('0x3'));var express=require(_0x185d('0x4'));var router=express['Router']();var auth=require(_0x185d('0x5'));var interaction=require(_0x185d('0x6'));var config=require(_0x185d('0x7'));var controller=require(_0x185d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x185d('0x9')]);router[_0x185d('0xa')](_0x185d('0xb'),auth[_0x185d('0xc')](),controller[_0x185d('0xd')]);router[_0x185d('0xa')](_0x185d('0xe'),auth['isAuthenticated'](),controller[_0x185d('0xf')]);router['post']('/',auth[_0x185d('0xc')](),controller[_0x185d('0x10')]);router['put'](_0x185d('0xe'),auth[_0x185d('0xc')](),controller[_0x185d('0x11')]);router['delete'](_0x185d('0xe'),auth[_0x185d('0xc')](),controller[_0x185d('0x12')]);module[_0x185d('0x13')]=router; \ No newline at end of file +var _0xc36a=['index','get','/describe','show','create','put','update','delete','/:id','exports','multer','util','connect-timeout','Router','../../components/auth/service','./smsQueueReport.controller','isAuthenticated'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xc36a,0x180));var _0xac36=function(_0x4a7274,_0x3e5df0){_0x4a7274=_0x4a7274-0x0;var _0x286317=_0xc36a[_0x4a7274];return _0x286317;};'use strict';var multer=require(_0xac36('0x0'));var util=require(_0xac36('0x1'));var path=require('path');var timeout=require(_0xac36('0x2'));var express=require('express');var router=express[_0xac36('0x3')]();var auth=require(_0xac36('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xac36('0x5'));router['get']('/',auth[_0xac36('0x6')](),controller[_0xac36('0x7')]);router[_0xac36('0x8')](_0xac36('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xac36('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xac36('0xa')]);router['post']('/',auth[_0xac36('0x6')](),controller[_0xac36('0xb')]);router[_0xac36('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xac36('0xd')]);router[_0xac36('0xe')](_0xac36('0xf'),auth[_0xac36('0x6')](),controller['destroy']);module[_0xac36('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index ecdd723..a3f48bd 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 _0x23b1=['DATE','exports','STRING'];(function(_0x1a89df,_0x55a137){var _0x282029=function(_0x51d509){while(--_0x51d509){_0x1a89df['push'](_0x1a89df['shift']());}};_0x282029(++_0x55a137);}(_0x23b1,0x178));var _0x123b=function(_0x3bdfee,_0x4e9cf1){_0x3bdfee=_0x3bdfee-0x0;var _0x460001=_0x23b1[_0x3bdfee];return _0x460001;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x123b('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x123b('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x123b('0x2')]},'acceptAt':{'type':Sequelize[_0x123b('0x2')]},'exitAt':{'type':Sequelize[_0x123b('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfdcf=['STRING','DATE','moment','sequelize','exports'];(function(_0x29d849,_0x209ceb){var _0x30b104=function(_0x2a1669){while(--_0x2a1669){_0x29d849['push'](_0x29d849['shift']());}};_0x30b104(++_0x209ceb);}(_0xfdcf,0x89));var _0xffdc=function(_0x3e640a,_0x15f91c){_0x3e640a=_0x3e640a-0x0;var _0xba2a2a=_0xfdcf[_0x3e640a];return _0xba2a2a;};'use strict';var moment=require(_0xffdc('0x0'));var Sequelize=require(_0xffdc('0x1'));module[_0xffdc('0x2')]={'uniqueid':{'type':Sequelize[_0xffdc('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xffdc('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xffdc('0x4')]},'acceptAt':{'type':Sequelize[_0xffdc('0x4')]},'exitAt':{'type':Sequelize[_0xffdc('0x4')]},'reason':{'type':Sequelize[_0xffdc('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index fe47c03..85dc914 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 _0x7183=['then','destroy','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','type','key','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','options','include','findAll','rows','catch','params','keys','includeAll','merge','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update'];(function(_0x5bc55b,_0x31eb26){var _0x506a93=function(_0x343dc7){while(--_0x343dc7){_0x5bc55b['push'](_0x5bc55b['shift']());}};_0x506a93(++_0x31eb26);}(_0x7183,0xc0));var _0x3718=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x7183[_0x565ed7];return _0x183ad7;};'use strict';var pdf=require(_0x3718('0x0'));var emlformat=require(_0x3718('0x1'));var rimraf=require(_0x3718('0x2'));var zipdir=require(_0x3718('0x3'));var jsonpatch=require(_0x3718('0x4'));var rp=require(_0x3718('0x5'));var moment=require(_0x3718('0x6'));var BPromise=require(_0x3718('0x7'));var Mustache=require(_0x3718('0x8'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3718('0x9'));var ejs=require(_0x3718('0xa'));var fs=require('fs');var _=require(_0x3718('0xb'));var squel=require(_0x3718('0xc'));var crypto=require(_0x3718('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3718('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3718('0xf'));var Papa=require('papaparse');var Redis=require(_0x3718('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3718('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3718('0x12'));var logger=require(_0x3718('0x13'))(_0x3718('0x14'));var utils=require(_0x3718('0x15'));var config=require(_0x3718('0x16'));var db=require(_0x3718('0x17'))['db'];function respondWithStatusCode(_0x3f8a9e,_0x4713a4){_0x4713a4=_0x4713a4||0xcc;return function(_0x51fd88){if(_0x51fd88){return _0x3f8a9e[_0x3718('0x18')](_0x4713a4);}return _0x3f8a9e[_0x3718('0x19')](_0x4713a4)[_0x3718('0x1a')]();};}function respondWithResult(_0x4a2f56,_0x3d9215){_0x3d9215=_0x3d9215||0xc8;return function(_0x3d697e){if(_0x3d697e){return _0x4a2f56[_0x3718('0x19')](_0x3d9215)['json'](_0x3d697e);}};}function respondWithFilteredResult(_0x1442e7,_0x3ad5f7){return function(_0x426485){if(_0x426485){var _0x4a3049=_0x426485[_0x3718('0x1b')],_0x385820=_0x3ad5f7['offset'],_0x32e369=_0x3ad5f7[_0x3718('0x1c')]+_0x3ad5f7[_0x3718('0x1d')],_0x2e0899;if(_0x32e369>=_0x4a3049){_0x32e369=_0x4a3049;_0x2e0899=0xc8;}else{_0x2e0899=0xce;}_0x1442e7[_0x3718('0x19')](_0x2e0899);return _0x1442e7['set'](_0x3718('0x1e'),_0x385820+'-'+_0x32e369+'/'+_0x4a3049)[_0x3718('0x1f')](_0x426485);}return null;};}function patchUpdates(_0x188ddf){return function(_0x2556c3){try{jsonpatch[_0x3718('0x20')](_0x2556c3,_0x188ddf,!![]);}catch(_0x5287e6){return BPromise[_0x3718('0x21')](_0x5287e6);}return _0x2556c3[_0x3718('0x22')]();};}function saveUpdates(_0x200c5e,_0x2a4947){return function(_0x2d6ee5){if(_0x2d6ee5){return _0x2d6ee5[_0x3718('0x23')](_0x200c5e)[_0x3718('0x24')](function(_0x4cb72b){return _0x4cb72b;});}return null;};}function removeEntity(_0x61167d,_0x19ada3){return function(_0x4c73da){if(_0x4c73da){return _0x4c73da[_0x3718('0x25')]()[_0x3718('0x24')](function(){_0x61167d[_0x3718('0x19')](0xcc)[_0x3718('0x1a')]();});}};}function handleEntityNotFound(_0x4a26e0,_0x569212){return function(_0x274791){if(!_0x274791){_0x4a26e0['sendStatus'](0x194);}return _0x274791;};}function handleError(_0x22ceb7,_0xa8fc7d){_0xa8fc7d=_0xa8fc7d||0x1f4;return function(_0x14a57e){logger[_0x3718('0x26')](_0x14a57e[_0x3718('0x27')]);if(_0x14a57e[_0x3718('0x28')]){delete _0x14a57e['name'];}_0x22ceb7[_0x3718('0x19')](_0xa8fc7d)[_0x3718('0x29')](_0x14a57e);};}exports[_0x3718('0x2a')]=function(_0x36fcb6,_0x41ee02){var _0x4abfd7={},_0x1208b8={},_0xe1c4d1={'count':0x0,'rows':[]};var _0x3bba85=_[_0x3718('0x2b')](db[_0x3718('0x2c')][_0x3718('0x2d')],function(_0x3d1f39){return{'name':_0x3d1f39['fieldName'],'type':_0x3d1f39[_0x3718('0x2e')][_0x3718('0x2f')]};});_0x1208b8['model']=_['map'](_0x3bba85,'name');_0x1208b8[_0x3718('0x30')]=_['keys'](_0x36fcb6['query']);_0x1208b8['filters']=_[_0x3718('0x31')](_0x1208b8['model'],_0x1208b8[_0x3718('0x30')]);_0x4abfd7[_0x3718('0x32')]=_['intersection'](_0x1208b8[_0x3718('0x33')],qs[_0x3718('0x34')](_0x36fcb6['query'][_0x3718('0x34')]));_0x4abfd7[_0x3718('0x32')]=_0x4abfd7[_0x3718('0x32')][_0x3718('0x35')]?_0x4abfd7[_0x3718('0x32')]:_0x1208b8[_0x3718('0x33')];if(!_0x36fcb6[_0x3718('0x30')][_0x3718('0x36')](_0x3718('0x37'))){_0x4abfd7[_0x3718('0x1d')]=qs[_0x3718('0x1d')](_0x36fcb6[_0x3718('0x30')][_0x3718('0x1d')]);_0x4abfd7['offset']=qs[_0x3718('0x1c')](_0x36fcb6[_0x3718('0x30')][_0x3718('0x1c')]);}_0x4abfd7[_0x3718('0x38')]=qs['sort'](_0x36fcb6[_0x3718('0x30')][_0x3718('0x39')]);_0x4abfd7[_0x3718('0x3a')]=qs[_0x3718('0x3b')](_[_0x3718('0x3c')](_0x36fcb6[_0x3718('0x30')],_0x1208b8['filters']));if(_0x36fcb6[_0x3718('0x30')]['filter']){_0x4abfd7['where']=_['merge'](_0x4abfd7[_0x3718('0x3a')],{'$or':_[_0x3718('0x2b')](_0x3bba85,function(_0x3a567e){if(_0x3a567e[_0x3718('0x2e')]!==_0x3718('0x3d')){var _0x26fbd2={};_0x26fbd2[_0x3a567e[_0x3718('0x28')]]={'$like':'%'+_0x36fcb6[_0x3718('0x30')][_0x3718('0x3e')]+'%'};return _0x26fbd2;}})});}_0x4abfd7=_['merge']({},_0x4abfd7,_0x36fcb6[_0x3718('0x3f')]);var _0x3da354={'where':_0x4abfd7['where']};return db[_0x3718('0x2c')][_0x3718('0x1b')](_0x3da354)['then'](function(_0x50a5fc){_0xe1c4d1[_0x3718('0x1b')]=_0x50a5fc;if(_0x36fcb6[_0x3718('0x30')]['includeAll']){_0x4abfd7[_0x3718('0x40')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x3718('0x41')](_0x4abfd7);})[_0x3718('0x24')](function(_0x591e1f){_0xe1c4d1[_0x3718('0x42')]=_0x591e1f;return _0xe1c4d1;})['then'](respondWithFilteredResult(_0x41ee02,_0x4abfd7))[_0x3718('0x43')](handleError(_0x41ee02,null));};exports['show']=function(_0x282c3f,_0x441f48){var _0x29b246={'raw':!![],'where':{'id':_0x282c3f[_0x3718('0x44')]['id']}},_0x2354bd={};_0x2354bd[_0x3718('0x33')]=_[_0x3718('0x45')](db[_0x3718('0x2c')][_0x3718('0x2d')]);_0x2354bd['query']=_[_0x3718('0x45')](_0x282c3f[_0x3718('0x30')]);_0x2354bd['filters']=_[_0x3718('0x31')](_0x2354bd[_0x3718('0x33')],_0x2354bd[_0x3718('0x30')]);_0x29b246[_0x3718('0x32')]=_[_0x3718('0x31')](_0x2354bd[_0x3718('0x33')],qs['fields'](_0x282c3f[_0x3718('0x30')][_0x3718('0x34')]));_0x29b246[_0x3718('0x32')]=_0x29b246[_0x3718('0x32')]['length']?_0x29b246[_0x3718('0x32')]:_0x2354bd['model'];if(_0x282c3f[_0x3718('0x30')][_0x3718('0x46')]){_0x29b246['include']=[{'all':!![]}];}_0x29b246=_[_0x3718('0x47')]({},_0x29b246,_0x282c3f[_0x3718('0x3f')]);return db['SmsQueueReport'][_0x3718('0x48')](_0x29b246)[_0x3718('0x24')](handleEntityNotFound(_0x441f48,null))[_0x3718('0x24')](respondWithResult(_0x441f48,null))[_0x3718('0x43')](handleError(_0x441f48,null));};exports['create']=function(_0x22e251,_0x3734b1){return db['SmsQueueReport'][_0x3718('0x49')](_0x22e251[_0x3718('0x4a')],{})[_0x3718('0x24')](respondWithResult(_0x3734b1,0xc9))[_0x3718('0x43')](handleError(_0x3734b1,null));};exports[_0x3718('0x23')]=function(_0x15d343,_0x3cae69){if(_0x15d343[_0x3718('0x4a')]['id']){delete _0x15d343[_0x3718('0x4a')]['id'];}return db[_0x3718('0x2c')][_0x3718('0x48')]({'where':{'id':_0x15d343[_0x3718('0x44')]['id']}})[_0x3718('0x24')](handleEntityNotFound(_0x3cae69,null))[_0x3718('0x24')](saveUpdates(_0x15d343[_0x3718('0x4a')],null))[_0x3718('0x24')](respondWithResult(_0x3cae69,null))['catch'](handleError(_0x3cae69,null));};exports[_0x3718('0x25')]=function(_0x3ee9ae,_0x149a7a){return db[_0x3718('0x2c')][_0x3718('0x48')]({'where':{'id':_0x3ee9ae[_0x3718('0x44')]['id']}})[_0x3718('0x24')](handleEntityNotFound(_0x149a7a,null))[_0x3718('0x24')](removeEntity(_0x149a7a,null))[_0x3718('0x43')](handleError(_0x149a7a,null));};exports[_0x3718('0x4b')]=function(_0x4d450d,_0x334471){return db[_0x3718('0x2c')]['describe']()[_0x3718('0x24')](respondWithResult(_0x334471,null))[_0x3718('0x43')](handleError(_0x334471,null));}; \ No newline at end of file +var _0x63aa=['filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','length','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack','send','index','map','SmsQueueReport','rawAttributes','fieldName','key','model','name','query','keys'];(function(_0x3674a8,_0x34e90b){var _0x4f77a7=function(_0x1c6e29){while(--_0x1c6e29){_0x3674a8['push'](_0x3674a8['shift']());}};_0x4f77a7(++_0x34e90b);}(_0x63aa,0x1f4));var _0xa63a=function(_0x409919,_0x411fc0){_0x409919=_0x409919-0x0;var _0x1f3595=_0x63aa[_0x409919];return _0x1f3595;};'use strict';var pdf=require(_0xa63a('0x0'));var emlformat=require(_0xa63a('0x1'));var rimraf=require(_0xa63a('0x2'));var zipdir=require(_0xa63a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa63a('0x4'));var moment=require('moment');var BPromise=require(_0xa63a('0x5'));var Mustache=require(_0xa63a('0x6'));var util=require(_0xa63a('0x7'));var path=require(_0xa63a('0x8'));var sox=require(_0xa63a('0x9'));var csv=require(_0xa63a('0xa'));var ejs=require(_0xa63a('0xb'));var fs=require('fs');var _=require(_0xa63a('0xc'));var squel=require(_0xa63a('0xd'));var crypto=require(_0xa63a('0xe'));var jsforce=require(_0xa63a('0xf'));var deskjs=require(_0xa63a('0x10'));var toCsv=require(_0xa63a('0xa'));var querystring=require(_0xa63a('0x11'));var Papa=require(_0xa63a('0x12'));var Redis=require('ioredis');var authService=require(_0xa63a('0x13'));var qs=require(_0xa63a('0x14'));var as=require(_0xa63a('0x15'));var hardwareService=require(_0xa63a('0x16'));var logger=require('../../config/logger')(_0xa63a('0x17'));var utils=require(_0xa63a('0x18'));var config=require(_0xa63a('0x19'));var db=require(_0xa63a('0x1a'))['db'];function respondWithStatusCode(_0x5c1ad1,_0x3d9b36){_0x3d9b36=_0x3d9b36||0xcc;return function(_0xceb1b2){if(_0xceb1b2){return _0x5c1ad1[_0xa63a('0x1b')](_0x3d9b36);}return _0x5c1ad1[_0xa63a('0x1c')](_0x3d9b36)[_0xa63a('0x1d')]();};}function respondWithResult(_0x2ab347,_0x33d130){_0x33d130=_0x33d130||0xc8;return function(_0x1a11a1){if(_0x1a11a1){return _0x2ab347[_0xa63a('0x1c')](_0x33d130)['json'](_0x1a11a1);}};}function respondWithFilteredResult(_0x210b41,_0x3daa04){return function(_0x58ab72){if(_0x58ab72){var _0x14c424=_0x58ab72[_0xa63a('0x1e')],_0x533b16=_0x3daa04['offset'],_0x316fc4=_0x3daa04['offset']+_0x3daa04[_0xa63a('0x1f')],_0x15aa8c;if(_0x316fc4>=_0x14c424){_0x316fc4=_0x14c424;_0x15aa8c=0xc8;}else{_0x15aa8c=0xce;}_0x210b41['status'](_0x15aa8c);return _0x210b41[_0xa63a('0x20')](_0xa63a('0x21'),_0x533b16+'-'+_0x316fc4+'/'+_0x14c424)[_0xa63a('0x22')](_0x58ab72);}return null;};}function patchUpdates(_0x162fdb){return function(_0x20f5c8){try{jsonpatch[_0xa63a('0x23')](_0x20f5c8,_0x162fdb,!![]);}catch(_0xb81cd8){return BPromise['reject'](_0xb81cd8);}return _0x20f5c8[_0xa63a('0x24')]();};}function saveUpdates(_0x55ef02,_0x26e29e){return function(_0x59d1b5){if(_0x59d1b5){return _0x59d1b5[_0xa63a('0x25')](_0x55ef02)[_0xa63a('0x26')](function(_0x239b01){return _0x239b01;});}return null;};}function removeEntity(_0x1857ce,_0x1464b2){return function(_0x4676ac){if(_0x4676ac){return _0x4676ac[_0xa63a('0x27')]()['then'](function(){_0x1857ce['status'](0xcc)[_0xa63a('0x1d')]();});}};}function handleEntityNotFound(_0x182a9,_0x10db50){return function(_0x54e946){if(!_0x54e946){_0x182a9['sendStatus'](0x194);}return _0x54e946;};}function handleError(_0x1ba567,_0x3b27c1){_0x3b27c1=_0x3b27c1||0x1f4;return function(_0xec498b){logger[_0xa63a('0x28')](_0xec498b[_0xa63a('0x29')]);if(_0xec498b['name']){delete _0xec498b['name'];}_0x1ba567[_0xa63a('0x1c')](_0x3b27c1)[_0xa63a('0x2a')](_0xec498b);};}exports[_0xa63a('0x2b')]=function(_0x190977,_0xe44ea0){var _0x55de03={},_0x1da151={},_0x142ab9={'count':0x0,'rows':[]};var _0x4daeaf=_[_0xa63a('0x2c')](db[_0xa63a('0x2d')][_0xa63a('0x2e')],function(_0x4d3263){return{'name':_0x4d3263[_0xa63a('0x2f')],'type':_0x4d3263['type'][_0xa63a('0x30')]};});_0x1da151[_0xa63a('0x31')]=_['map'](_0x4daeaf,_0xa63a('0x32'));_0x1da151[_0xa63a('0x33')]=_[_0xa63a('0x34')](_0x190977[_0xa63a('0x33')]);_0x1da151[_0xa63a('0x35')]=_[_0xa63a('0x36')](_0x1da151[_0xa63a('0x31')],_0x1da151[_0xa63a('0x33')]);_0x55de03[_0xa63a('0x37')]=_[_0xa63a('0x36')](_0x1da151[_0xa63a('0x31')],qs[_0xa63a('0x38')](_0x190977[_0xa63a('0x33')]['fields']));_0x55de03['attributes']=_0x55de03[_0xa63a('0x37')]['length']?_0x55de03['attributes']:_0x1da151[_0xa63a('0x31')];if(!_0x190977[_0xa63a('0x33')][_0xa63a('0x39')](_0xa63a('0x3a'))){_0x55de03[_0xa63a('0x1f')]=qs[_0xa63a('0x1f')](_0x190977[_0xa63a('0x33')][_0xa63a('0x1f')]);_0x55de03[_0xa63a('0x3b')]=qs[_0xa63a('0x3b')](_0x190977[_0xa63a('0x33')]['offset']);}_0x55de03[_0xa63a('0x3c')]=qs['sort'](_0x190977[_0xa63a('0x33')]['sort']);_0x55de03[_0xa63a('0x3d')]=qs[_0xa63a('0x35')](_[_0xa63a('0x3e')](_0x190977[_0xa63a('0x33')],_0x1da151[_0xa63a('0x35')]));if(_0x190977[_0xa63a('0x33')][_0xa63a('0x3f')]){_0x55de03[_0xa63a('0x3d')]=_[_0xa63a('0x40')](_0x55de03[_0xa63a('0x3d')],{'$or':_[_0xa63a('0x2c')](_0x4daeaf,function(_0x206ef0){if(_0x206ef0[_0xa63a('0x41')]!==_0xa63a('0x42')){var _0x57d6e0={};_0x57d6e0[_0x206ef0[_0xa63a('0x32')]]={'$like':'%'+_0x190977['query'][_0xa63a('0x3f')]+'%'};return _0x57d6e0;}})});}_0x55de03=_['merge']({},_0x55de03,_0x190977[_0xa63a('0x43')]);var _0x1f3b5c={'where':_0x55de03[_0xa63a('0x3d')]};return db[_0xa63a('0x2d')][_0xa63a('0x1e')](_0x1f3b5c)[_0xa63a('0x26')](function(_0x325113){_0x142ab9[_0xa63a('0x1e')]=_0x325113;if(_0x190977[_0xa63a('0x33')][_0xa63a('0x44')]){_0x55de03[_0xa63a('0x45')]=[{'all':!![]}];}return db[_0xa63a('0x2d')][_0xa63a('0x46')](_0x55de03);})[_0xa63a('0x26')](function(_0x1259f0){_0x142ab9[_0xa63a('0x47')]=_0x1259f0;return _0x142ab9;})['then'](respondWithFilteredResult(_0xe44ea0,_0x55de03))[_0xa63a('0x48')](handleError(_0xe44ea0,null));};exports['show']=function(_0x11eb38,_0x35001d){var _0x33783f={'raw':!![],'where':{'id':_0x11eb38['params']['id']}},_0x52a7fb={};_0x52a7fb[_0xa63a('0x31')]=_[_0xa63a('0x34')](db['SmsQueueReport'][_0xa63a('0x2e')]);_0x52a7fb[_0xa63a('0x33')]=_[_0xa63a('0x34')](_0x11eb38[_0xa63a('0x33')]);_0x52a7fb[_0xa63a('0x35')]=_['intersection'](_0x52a7fb['model'],_0x52a7fb[_0xa63a('0x33')]);_0x33783f['attributes']=_[_0xa63a('0x36')](_0x52a7fb[_0xa63a('0x31')],qs[_0xa63a('0x38')](_0x11eb38[_0xa63a('0x33')][_0xa63a('0x38')]));_0x33783f[_0xa63a('0x37')]=_0x33783f[_0xa63a('0x37')][_0xa63a('0x49')]?_0x33783f['attributes']:_0x52a7fb[_0xa63a('0x31')];if(_0x11eb38[_0xa63a('0x33')][_0xa63a('0x44')]){_0x33783f[_0xa63a('0x45')]=[{'all':!![]}];}_0x33783f=_[_0xa63a('0x40')]({},_0x33783f,_0x11eb38[_0xa63a('0x43')]);return db[_0xa63a('0x2d')][_0xa63a('0x4a')](_0x33783f)[_0xa63a('0x26')](handleEntityNotFound(_0x35001d,null))[_0xa63a('0x26')](respondWithResult(_0x35001d,null))['catch'](handleError(_0x35001d,null));};exports[_0xa63a('0x4b')]=function(_0xd85561,_0x462e52){return db[_0xa63a('0x2d')][_0xa63a('0x4b')](_0xd85561[_0xa63a('0x4c')],{})['then'](respondWithResult(_0x462e52,0xc9))['catch'](handleError(_0x462e52,null));};exports[_0xa63a('0x25')]=function(_0x44c6e6,_0x4e587a){if(_0x44c6e6[_0xa63a('0x4c')]['id']){delete _0x44c6e6[_0xa63a('0x4c')]['id'];}return db[_0xa63a('0x2d')][_0xa63a('0x4a')]({'where':{'id':_0x44c6e6[_0xa63a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4e587a,null))[_0xa63a('0x26')](saveUpdates(_0x44c6e6[_0xa63a('0x4c')],null))[_0xa63a('0x26')](respondWithResult(_0x4e587a,null))[_0xa63a('0x48')](handleError(_0x4e587a,null));};exports['destroy']=function(_0x21f824,_0x5d9900){return db[_0xa63a('0x2d')][_0xa63a('0x4a')]({'where':{'id':_0x21f824[_0xa63a('0x4d')]['id']}})[_0xa63a('0x26')](handleEntityNotFound(_0x5d9900,null))[_0xa63a('0x26')](removeEntity(_0x5d9900,null))[_0xa63a('0x48')](handleError(_0x5d9900,null));};exports[_0xa63a('0x4e')]=function(_0xaded21,_0x2d7965){return db[_0xa63a('0x2d')][_0xa63a('0x4e')]()[_0xa63a('0x26')](respondWithResult(_0x2d7965,null))[_0xa63a('0x48')](handleError(_0x2d7965,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 4b4a028..45b2849 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 _0x24cb=['bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','report_sms_queue','lodash','util','../../config/logger','api','moment'];(function(_0x115d9a,_0x32b07e){var _0x8cde88=function(_0x2f2b6b){while(--_0x2f2b6b){_0x115d9a['push'](_0x115d9a['shift']());}};_0x8cde88(++_0x32b07e);}(_0x24cb,0x11b));var _0xb24c=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x24cb[_0xbe200f];return _0x192597;};'use strict';var _=require(_0xb24c('0x0'));var util=require(_0xb24c('0x1'));var logger=require(_0xb24c('0x2'))(_0xb24c('0x3'));var moment=require(_0xb24c('0x4'));var BPromise=require(_0xb24c('0x5'));var rp=require(_0xb24c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb24c('0x7'));var config=require(_0xb24c('0x8'));var attributes=require(_0xb24c('0x9'));module['exports']=function(_0xc3ad5c,_0xe11821){return _0xc3ad5c[_0xb24c('0xa')]('SmsQueueReport',attributes,{'tableName':_0xb24c('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xffdc=['moment','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util','api'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0xffdc,0x7f));var _0xcffd=function(_0x2d2c6c,_0x4aa7c2){_0x2d2c6c=_0x2d2c6c-0x0;var _0x4f1e2e=_0xffdc[_0x2d2c6c];return _0x4f1e2e;};'use strict';var _=require(_0xcffd('0x0'));var util=require(_0xcffd('0x1'));var logger=require('../../config/logger')(_0xcffd('0x2'));var moment=require(_0xcffd('0x3'));var BPromise=require('bluebird');var rp=require(_0xcffd('0x4'));var fs=require('fs');var path=require(_0xcffd('0x5'));var rimraf=require(_0xcffd('0x6'));var config=require(_0xcffd('0x7'));var attributes=require(_0xcffd('0x8'));module['exports']=function(_0x1a1bce,_0x963fad){return _0x1a1bce[_0xcffd('0x9')](_0xcffd('0xa'),attributes,{'tableName':_0xcffd('0xb'),'paranoid':![],'indexes':[{'name':_0xcffd('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 19f2368..e8e7d03 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 _0x895d=['SmsQueueReport','create','body','options','raw','debug','UpdateSmsQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSmsQueueReport'];(function(_0x41a429,_0x300df5){var _0x2b5b1f=function(_0x3d1916){while(--_0x3d1916){_0x41a429['push'](_0x41a429['shift']());}};_0x2b5b1f(++_0x300df5);}(_0x895d,0x146));var _0xd895=function(_0x35023d,_0x54f45f){_0x35023d=_0x35023d-0x0;var _0x4838bc=_0x895d[_0x35023d];return _0x4838bc;};'use strict';var _=require(_0xd895('0x0'));var util=require(_0xd895('0x1'));var moment=require(_0xd895('0x2'));var BPromise=require(_0xd895('0x3'));var rs=require(_0xd895('0x4'));var fs=require('fs');var Redis=require(_0xd895('0x5'));var db=require(_0xd895('0x6'))['db'];var utils=require(_0xd895('0x7'));var logger=require('../../config/logger')(_0xd895('0x8'));var config=require(_0xd895('0x9'));var jayson=require(_0xd895('0xa'));var client=jayson['client'][_0xd895('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c4173,_0x1ec9f7,_0x4206f2){return new BPromise(function(_0x510dc6,_0x1ddb98){return client[_0xd895('0xc')](_0x3c4173,_0x4206f2)[_0xd895('0xd')](function(_0x4e4884){logger[_0xd895('0xe')](_0xd895('0xf'),_0x1ec9f7,_0xd895('0x10'));logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x1ec9f7,_0xd895('0x10'),JSON[_0xd895('0x11')](_0x4e4884));if(_0x4e4884[_0xd895('0x12')]){if(_0x4e4884[_0xd895('0x12')][_0xd895('0x13')]===0x1f4){logger[_0xd895('0x12')](_0xd895('0xf'),_0x1ec9f7,_0x4e4884[_0xd895('0x12')][_0xd895('0x14')]);return _0x1ddb98(_0x4e4884['error'][_0xd895('0x14')]);}logger['error'](_0xd895('0xf'),_0x1ec9f7,_0x4e4884['error'][_0xd895('0x14')]);return _0x510dc6(_0x4e4884[_0xd895('0x12')][_0xd895('0x14')]);}else{logger[_0xd895('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x1ec9f7,'request\x20sent');_0x510dc6(_0x4e4884[_0xd895('0x15')]['message']);}})[_0xd895('0x16')](function(_0x2d9511){logger[_0xd895('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x1ec9f7,_0x2d9511);_0x1ddb98(_0x2d9511);});});}exports[_0xd895('0x17')]=function(_0x564615){var _0x26333a=this;return new Promise(function(_0x5b380e,_0x327d04){return db[_0xd895('0x18')][_0xd895('0x19')](_0x564615[_0xd895('0x1a')],{'raw':_0x564615[_0xd895('0x1b')]?_0x564615[_0xd895('0x1b')][_0xd895('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x23329e){logger[_0xd895('0xe')](_0xd895('0x17'),_0x564615);logger[_0xd895('0x1d')](_0xd895('0x17'),_0x564615,JSON[_0xd895('0x11')](_0x23329e));_0x5b380e(_0x23329e);})[_0xd895('0x16')](function(_0xa27828){logger[_0xd895('0x12')](_0xd895('0x17'),_0xa27828[_0xd895('0x14')],_0x564615);_0x327d04(_0x26333a[_0xd895('0x12')](0x1f4,_0xa27828[_0xd895('0x14')]));});});};exports[_0xd895('0x1e')]=function(_0x25480f){var _0x50fd13=this;return new Promise(function(_0x7c5bfb,_0x11f518){return db[_0xd895('0x18')][_0xd895('0x1f')](_0x25480f[_0xd895('0x1a')],{'raw':_0x25480f[_0xd895('0x1b')]?_0x25480f['options'][_0xd895('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25480f[_0xd895('0x1b')]?_0x25480f[_0xd895('0x1b')][_0xd895('0x20')]||null:null,'attributes':_0x25480f[_0xd895('0x1b')]?_0x25480f['options'][_0xd895('0x21')]||null:null,'limit':_0x25480f[_0xd895('0x1b')]?_0x25480f[_0xd895('0x1b')][_0xd895('0x22')]||null:null})['then'](function(_0x2fbcc7){logger[_0xd895('0xe')](_0xd895('0x1e'),_0x25480f);logger[_0xd895('0x1d')](_0xd895('0x1e'),_0x25480f,JSON[_0xd895('0x11')](_0x2fbcc7));_0x7c5bfb(_0x2fbcc7);})[_0xd895('0x16')](function(_0x1eada0){logger['error']('UpdateSmsQueueReport',_0x1eada0[_0xd895('0x14')],_0x25480f);_0x11f518(_0x50fd13['error'](0x1f4,_0x1eada0[_0xd895('0x14')]));});});}; \ No newline at end of file +var _0x9b75=['result','catch','create','body','options','raw','then','CreateSmsQueueReport','UpdateSmsQueueReport','SmsQueueReport','update','where','attributes','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x31d75b,_0x2a2488){var _0x54b69c=function(_0x4c7a82){while(--_0x4c7a82){_0x31d75b['push'](_0x31d75b['shift']());}};_0x54b69c(++_0x2a2488);}(_0x9b75,0x181));var _0x59b7=function(_0x22c0bf,_0x2e05ff){_0x22c0bf=_0x22c0bf-0x0;var _0x59e6b8=_0x9b75[_0x22c0bf];return _0x59e6b8;};'use strict';var _=require('lodash');var util=require(_0x59b7('0x0'));var moment=require('moment');var BPromise=require(_0x59b7('0x1'));var rs=require(_0x59b7('0x2'));var fs=require('fs');var Redis=require(_0x59b7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x59b7('0x4'));var logger=require(_0x59b7('0x5'))(_0x59b7('0x6'));var config=require(_0x59b7('0x7'));var jayson=require(_0x59b7('0x8'));var client=jayson['client'][_0x59b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4595e2,_0x6d1b78,_0x2e9ef2){return new BPromise(function(_0x102129,_0x30d832){return client[_0x59b7('0xa')](_0x4595e2,_0x2e9ef2)['then'](function(_0x34e6c4){logger[_0x59b7('0xb')](_0x59b7('0xc'),_0x6d1b78,'request\x20sent');logger[_0x59b7('0xd')](_0x59b7('0xe'),_0x6d1b78,'request\x20sent',JSON[_0x59b7('0xf')](_0x34e6c4));if(_0x34e6c4[_0x59b7('0x10')]){if(_0x34e6c4['error']['code']===0x1f4){logger['error'](_0x59b7('0xc'),_0x6d1b78,_0x34e6c4['error']['message']);return _0x30d832(_0x34e6c4[_0x59b7('0x10')][_0x59b7('0x11')]);}logger[_0x59b7('0x10')](_0x59b7('0xc'),_0x6d1b78,_0x34e6c4['error'][_0x59b7('0x11')]);return _0x102129(_0x34e6c4['error'][_0x59b7('0x11')]);}else{logger[_0x59b7('0xb')](_0x59b7('0xc'),_0x6d1b78,'request\x20sent');_0x102129(_0x34e6c4[_0x59b7('0x12')][_0x59b7('0x11')]);}})[_0x59b7('0x13')](function(_0x403a3a){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x6d1b78,_0x403a3a);_0x30d832(_0x403a3a);});});}exports['CreateSmsQueueReport']=function(_0x51258b){var _0x5e6be6=this;return new Promise(function(_0x57af2f,_0x344332){return db['SmsQueueReport'][_0x59b7('0x14')](_0x51258b[_0x59b7('0x15')],{'raw':_0x51258b[_0x59b7('0x16')]?_0x51258b[_0x59b7('0x16')][_0x59b7('0x17')]===undefined?!![]:![]:!![]})[_0x59b7('0x18')](function(_0x32ff80){logger[_0x59b7('0xb')](_0x59b7('0x19'),_0x51258b);logger['debug'](_0x59b7('0x19'),_0x51258b,JSON[_0x59b7('0xf')](_0x32ff80));_0x57af2f(_0x32ff80);})[_0x59b7('0x13')](function(_0x2f0a3){logger[_0x59b7('0x10')](_0x59b7('0x19'),_0x2f0a3[_0x59b7('0x11')],_0x51258b);_0x344332(_0x5e6be6['error'](0x1f4,_0x2f0a3[_0x59b7('0x11')]));});});};exports[_0x59b7('0x1a')]=function(_0x3e207a){var _0x5345db=this;return new Promise(function(_0x21ba0b,_0x6b4a77){return db[_0x59b7('0x1b')][_0x59b7('0x1c')](_0x3e207a[_0x59b7('0x15')],{'raw':_0x3e207a[_0x59b7('0x16')]?_0x3e207a[_0x59b7('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e207a[_0x59b7('0x16')]?_0x3e207a[_0x59b7('0x16')][_0x59b7('0x1d')]||null:null,'attributes':_0x3e207a[_0x59b7('0x16')]?_0x3e207a[_0x59b7('0x16')][_0x59b7('0x1e')]||null:null,'limit':_0x3e207a['options']?_0x3e207a[_0x59b7('0x16')]['limit']||null:null})['then'](function(_0x9b48eb){logger[_0x59b7('0xb')]('UpdateSmsQueueReport',_0x3e207a);logger[_0x59b7('0xd')]('UpdateSmsQueueReport',_0x3e207a,JSON[_0x59b7('0xf')](_0x9b48eb));_0x21ba0b(_0x9b48eb);})[_0x59b7('0x13')](function(_0x216beb){logger['error'](_0x59b7('0x1a'),_0x216beb[_0x59b7('0x11')],_0x3e207a);_0x6b4a77(_0x5345db[_0x59b7('0x10')](0x1f4,_0x216beb[_0x59b7('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 7522a92..7c96288 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 _0x4fc2=['./smsTransferReport.controller','get','index','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x537458,_0x36a629){var _0x89ab6=function(_0x1c18ab){while(--_0x1c18ab){_0x537458['push'](_0x537458['shift']());}};_0x89ab6(++_0x36a629);}(_0x4fc2,0x111));var _0x24fc=function(_0x2d92cf,_0x434a92){_0x2d92cf=_0x2d92cf-0x0;var _0x592841=_0x4fc2[_0x2d92cf];return _0x592841;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var auth=require(_0x24fc('0x5'));var interaction=require(_0x24fc('0x6'));var config=require('../../config/environment');var controller=require(_0x24fc('0x7'));router[_0x24fc('0x8')]('/',auth['isAuthenticated'](),controller[_0x24fc('0x9')]);router[_0x24fc('0x8')]('/describe',auth[_0x24fc('0xa')](),controller[_0x24fc('0xb')]);router[_0x24fc('0x8')](_0x24fc('0xc'),auth[_0x24fc('0xa')](),controller[_0x24fc('0xd')]);router['post']('/',auth[_0x24fc('0xa')](),controller[_0x24fc('0xe')]);router[_0x24fc('0xf')](_0x24fc('0xc'),auth[_0x24fc('0xa')](),controller[_0x24fc('0x10')]);router[_0x24fc('0x11')](_0x24fc('0xc'),auth['isAuthenticated'](),controller[_0x24fc('0x12')]);module[_0x24fc('0x13')]=router; \ No newline at end of file +var _0xdd4f=['isAuthenticated','index','get','/describe','show','post','create','/:id','update','delete','destroy','exports','multer','express','Router','../../components/interaction/service','../../config/environment','./smsTransferReport.controller'];(function(_0x12c88d,_0x7cfe16){var _0x5ac1cf=function(_0x318624){while(--_0x318624){_0x12c88d['push'](_0x12c88d['shift']());}};_0x5ac1cf(++_0x7cfe16);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x48a0ef,_0x15f9ae){_0x48a0ef=_0x48a0ef-0x0;var _0x2ee71e=_0xdd4f[_0x48a0ef];return _0x2ee71e;};'use strict';var multer=require(_0xfdd4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfdd4('0x1'));var router=express[_0xfdd4('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xfdd4('0x3'));var config=require(_0xfdd4('0x4'));var controller=require(_0xfdd4('0x5'));router['get']('/',auth[_0xfdd4('0x6')](),controller[_0xfdd4('0x7')]);router[_0xfdd4('0x8')](_0xfdd4('0x9'),auth[_0xfdd4('0x6')](),controller['describe']);router[_0xfdd4('0x8')]('/:id',auth[_0xfdd4('0x6')](),controller[_0xfdd4('0xa')]);router[_0xfdd4('0xb')]('/',auth['isAuthenticated'](),controller[_0xfdd4('0xc')]);router['put'](_0xfdd4('0xd'),auth[_0xfdd4('0x6')](),controller[_0xfdd4('0xe')]);router[_0xfdd4('0xf')](_0xfdd4('0xd'),auth[_0xfdd4('0x6')](),controller[_0xfdd4('0x10')]);module[_0xfdd4('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 55d9794..138b2b5 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 _0xde85=['agent','queue','DATE','moment','exports'];(function(_0x19c1c2,_0x17c0f9){var _0x5a4395=function(_0x4a6cf2){while(--_0x4a6cf2){_0x19c1c2['push'](_0x19c1c2['shift']());}};_0x5a4395(++_0x17c0f9);}(_0xde85,0xa3));var _0x5de8=function(_0x21bff1,_0x4bf605){_0x21bff1=_0x21bff1-0x0;var _0xdf6556=_0xde85[_0x21bff1];return _0xdf6556;};'use strict';var moment=require(_0x5de8('0x0'));var Sequelize=require('sequelize');module[_0x5de8('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0x5de8('0x2'),'queue'),'allowNull':![],'defaultValue':_0x5de8('0x3')},'transferredAt':{'type':Sequelize[_0x5de8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xca2b=['NOW','moment','sequelize','exports','STRING','ENUM','agent','queue','DATE'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xca2b,0x1d5));var _0xbca2=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xca2b[_0x502c7d];return _0x30b7ed;};'use strict';var moment=require(_0xbca2('0x0'));var Sequelize=require(_0xbca2('0x1'));module[_0xbca2('0x2')]={'uniqueid':{'type':Sequelize[_0xbca2('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xbca2('0x4')]('account',_0xbca2('0x5'),_0xbca2('0x6')),'allowNull':![],'defaultValue':_0xbca2('0x6')},'transferredAt':{'type':Sequelize[_0xbca2('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xbca2('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 1c9b31b..7ee84f0 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 _0xdea5=['eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','set','apply','reject','then','destroy','stack','name','map','SmsTransferReport','type','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','filter','VIRTUAL','merge','count','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','update','describe','html-pdf'];(function(_0x1bc013,_0x7771c6){var _0x55df36=function(_0x1c02e0){while(--_0x1c02e0){_0x1bc013['push'](_0x1bc013['shift']());}};_0x55df36(++_0x7771c6);}(_0xdea5,0x11b));var _0x5dea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdea5[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x5dea('0x0'));var emlformat=require(_0x5dea('0x1'));var rimraf=require(_0x5dea('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5dea('0x3'));var rp=require(_0x5dea('0x4'));var moment=require(_0x5dea('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5dea('0x6'));var util=require(_0x5dea('0x7'));var path=require(_0x5dea('0x8'));var sox=require(_0x5dea('0x9'));var csv=require(_0x5dea('0xa'));var ejs=require(_0x5dea('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5dea('0xc'));var crypto=require(_0x5dea('0xd'));var jsforce=require(_0x5dea('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5dea('0xa'));var querystring=require(_0x5dea('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5dea('0x10'));var qs=require(_0x5dea('0x11'));var as=require(_0x5dea('0x12'));var hardwareService=require(_0x5dea('0x13'));var logger=require(_0x5dea('0x14'))(_0x5dea('0x15'));var utils=require(_0x5dea('0x16'));var config=require(_0x5dea('0x17'));var db=require(_0x5dea('0x18'))['db'];function respondWithStatusCode(_0x33eb67,_0x4bd515){_0x4bd515=_0x4bd515||0xcc;return function(_0x32bdea){if(_0x32bdea){return _0x33eb67[_0x5dea('0x19')](_0x4bd515);}return _0x33eb67['status'](_0x4bd515)[_0x5dea('0x1a')]();};}function respondWithResult(_0x27dd93,_0x453451){_0x453451=_0x453451||0xc8;return function(_0x281f86){if(_0x281f86){return _0x27dd93[_0x5dea('0x1b')](_0x453451)[_0x5dea('0x1c')](_0x281f86);}};}function respondWithFilteredResult(_0x17c1d4,_0x1c6cea){return function(_0x261e26){if(_0x261e26){var _0x149bcd=_0x261e26['count'],_0x379d08=_0x1c6cea['offset'],_0x1eea5a=_0x1c6cea[_0x5dea('0x1d')]+_0x1c6cea['limit'],_0x346488;if(_0x1eea5a>=_0x149bcd){_0x1eea5a=_0x149bcd;_0x346488=0xc8;}else{_0x346488=0xce;}_0x17c1d4['status'](_0x346488);return _0x17c1d4[_0x5dea('0x1e')]('Content-Range',_0x379d08+'-'+_0x1eea5a+'/'+_0x149bcd)[_0x5dea('0x1c')](_0x261e26);}return null;};}function patchUpdates(_0x11e645){return function(_0x4a270f){try{jsonpatch[_0x5dea('0x1f')](_0x4a270f,_0x11e645,!![]);}catch(_0x3c56cb){return BPromise[_0x5dea('0x20')](_0x3c56cb);}return _0x4a270f['save']();};}function saveUpdates(_0x588823,_0x356cd8){return function(_0x36f656){if(_0x36f656){return _0x36f656['update'](_0x588823)[_0x5dea('0x21')](function(_0x5222cb){return _0x5222cb;});}return null;};}function removeEntity(_0x528d68,_0x21f9a3){return function(_0x488440){if(_0x488440){return _0x488440[_0x5dea('0x22')]()[_0x5dea('0x21')](function(){_0x528d68['status'](0xcc)[_0x5dea('0x1a')]();});}};}function handleEntityNotFound(_0x1ea717,_0x7f46f6){return function(_0x13df5d){if(!_0x13df5d){_0x1ea717['sendStatus'](0x194);}return _0x13df5d;};}function handleError(_0x15f562,_0x18c985){_0x18c985=_0x18c985||0x1f4;return function(_0x3ec3a7){logger['error'](_0x3ec3a7[_0x5dea('0x23')]);if(_0x3ec3a7[_0x5dea('0x24')]){delete _0x3ec3a7['name'];}_0x15f562[_0x5dea('0x1b')](_0x18c985)['send'](_0x3ec3a7);};}exports['index']=function(_0x420781,_0x57fdfa){var _0x253f2d={},_0x23718b={},_0x1502ec={'count':0x0,'rows':[]};var _0x3e8f65=_[_0x5dea('0x25')](db[_0x5dea('0x26')]['rawAttributes'],function(_0x2bddce){return{'name':_0x2bddce['fieldName'],'type':_0x2bddce[_0x5dea('0x27')]['key']};});_0x23718b[_0x5dea('0x28')]=_[_0x5dea('0x25')](_0x3e8f65,'name');_0x23718b[_0x5dea('0x29')]=_[_0x5dea('0x2a')](_0x420781['query']);_0x23718b['filters']=_[_0x5dea('0x2b')](_0x23718b[_0x5dea('0x28')],_0x23718b[_0x5dea('0x29')]);_0x253f2d[_0x5dea('0x2c')]=_[_0x5dea('0x2b')](_0x23718b['model'],qs['fields'](_0x420781['query'][_0x5dea('0x2d')]));_0x253f2d['attributes']=_0x253f2d[_0x5dea('0x2c')][_0x5dea('0x2e')]?_0x253f2d[_0x5dea('0x2c')]:_0x23718b[_0x5dea('0x28')];if(!_0x420781['query']['hasOwnProperty'](_0x5dea('0x2f'))){_0x253f2d[_0x5dea('0x30')]=qs[_0x5dea('0x30')](_0x420781[_0x5dea('0x29')]['limit']);_0x253f2d['offset']=qs['offset'](_0x420781[_0x5dea('0x29')][_0x5dea('0x1d')]);}_0x253f2d[_0x5dea('0x31')]=qs[_0x5dea('0x32')](_0x420781[_0x5dea('0x29')][_0x5dea('0x32')]);_0x253f2d[_0x5dea('0x33')]=qs[_0x5dea('0x34')](_['pick'](_0x420781[_0x5dea('0x29')],_0x23718b[_0x5dea('0x34')]));if(_0x420781[_0x5dea('0x29')][_0x5dea('0x35')]){_0x253f2d['where']=_['merge'](_0x253f2d[_0x5dea('0x33')],{'$or':_[_0x5dea('0x25')](_0x3e8f65,function(_0x182a8d){if(_0x182a8d[_0x5dea('0x27')]!==_0x5dea('0x36')){var _0x381991={};_0x381991[_0x182a8d[_0x5dea('0x24')]]={'$like':'%'+_0x420781['query']['filter']+'%'};return _0x381991;}})});}_0x253f2d=_[_0x5dea('0x37')]({},_0x253f2d,_0x420781['options']);var _0x4b43b5={'where':_0x253f2d[_0x5dea('0x33')]};return db[_0x5dea('0x26')]['count'](_0x4b43b5)['then'](function(_0x3dba83){_0x1502ec[_0x5dea('0x38')]=_0x3dba83;if(_0x420781['query']['includeAll']){_0x253f2d[_0x5dea('0x39')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x5dea('0x3a')](_0x253f2d);})[_0x5dea('0x21')](function(_0x3aa846){_0x1502ec[_0x5dea('0x3b')]=_0x3aa846;return _0x1502ec;})[_0x5dea('0x21')](respondWithFilteredResult(_0x57fdfa,_0x253f2d))[_0x5dea('0x3c')](handleError(_0x57fdfa,null));};exports[_0x5dea('0x3d')]=function(_0x42b4f9,_0x2965d9){var _0x19c3ce={'raw':!![],'where':{'id':_0x42b4f9[_0x5dea('0x3e')]['id']}},_0x3e7aee={};_0x3e7aee[_0x5dea('0x28')]=_['keys'](db[_0x5dea('0x26')][_0x5dea('0x3f')]);_0x3e7aee[_0x5dea('0x29')]=_[_0x5dea('0x2a')](_0x42b4f9[_0x5dea('0x29')]);_0x3e7aee['filters']=_['intersection'](_0x3e7aee[_0x5dea('0x28')],_0x3e7aee['query']);_0x19c3ce['attributes']=_[_0x5dea('0x2b')](_0x3e7aee['model'],qs[_0x5dea('0x2d')](_0x42b4f9[_0x5dea('0x29')]['fields']));_0x19c3ce[_0x5dea('0x2c')]=_0x19c3ce[_0x5dea('0x2c')][_0x5dea('0x2e')]?_0x19c3ce[_0x5dea('0x2c')]:_0x3e7aee[_0x5dea('0x28')];if(_0x42b4f9[_0x5dea('0x29')][_0x5dea('0x40')]){_0x19c3ce[_0x5dea('0x39')]=[{'all':!![]}];}_0x19c3ce=_[_0x5dea('0x37')]({},_0x19c3ce,_0x42b4f9[_0x5dea('0x41')]);return db['SmsTransferReport'][_0x5dea('0x42')](_0x19c3ce)['then'](handleEntityNotFound(_0x2965d9,null))['then'](respondWithResult(_0x2965d9,null))[_0x5dea('0x3c')](handleError(_0x2965d9,null));};exports[_0x5dea('0x43')]=function(_0x5bf997,_0x3b8bf5){return db['SmsTransferReport'][_0x5dea('0x43')](_0x5bf997[_0x5dea('0x44')],{})[_0x5dea('0x21')](respondWithResult(_0x3b8bf5,0xc9))[_0x5dea('0x3c')](handleError(_0x3b8bf5,null));};exports[_0x5dea('0x45')]=function(_0x50f918,_0x73b849){if(_0x50f918[_0x5dea('0x44')]['id']){delete _0x50f918[_0x5dea('0x44')]['id'];}return db[_0x5dea('0x26')][_0x5dea('0x42')]({'where':{'id':_0x50f918['params']['id']}})['then'](handleEntityNotFound(_0x73b849,null))[_0x5dea('0x21')](saveUpdates(_0x50f918['body'],null))[_0x5dea('0x21')](respondWithResult(_0x73b849,null))[_0x5dea('0x3c')](handleError(_0x73b849,null));};exports[_0x5dea('0x22')]=function(_0x11dc7d,_0x53251b){return db['SmsTransferReport'][_0x5dea('0x42')]({'where':{'id':_0x11dc7d[_0x5dea('0x3e')]['id']}})[_0x5dea('0x21')](handleEntityNotFound(_0x53251b,null))[_0x5dea('0x21')](removeEntity(_0x53251b,null))['catch'](handleError(_0x53251b,null));};exports[_0x5dea('0x46')]=function(_0x2897c9,_0x2207ec){return db[_0x5dea('0x26')][_0x5dea('0x46')]()[_0x5dea('0x21')](respondWithResult(_0x2207ec,null))[_0x5dea('0x3c')](handleError(_0x2207ec,null));}; \ No newline at end of file +var _0xf0ce=['fast-json-patch','request-promise','bluebird','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','../../mysqldb','sendStatus','end','json','offset','limit','status','set','Content-Range','apply','reject','save','update','then','stack','index','SmsTransferReport','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x607cb4,_0x591275){var _0x108643=function(_0x2b91f8){while(--_0x2b91f8){_0x607cb4['push'](_0x607cb4['shift']());}};_0x108643(++_0x591275);}(_0xf0ce,0xe3));var _0xef0c=function(_0x2c8c1a,_0x5cff30){_0x2c8c1a=_0x2c8c1a-0x0;var _0x2f7ce6=_0xf0ce[_0x2c8c1a];return _0x2f7ce6;};'use strict';var pdf=require(_0xef0c('0x0'));var emlformat=require(_0xef0c('0x1'));var rimraf=require(_0xef0c('0x2'));var zipdir=require(_0xef0c('0x3'));var jsonpatch=require(_0xef0c('0x4'));var rp=require(_0xef0c('0x5'));var moment=require('moment');var BPromise=require(_0xef0c('0x6'));var Mustache=require('mustache');var util=require(_0xef0c('0x7'));var path=require(_0xef0c('0x8'));var sox=require(_0xef0c('0x9'));var csv=require(_0xef0c('0xa'));var ejs=require(_0xef0c('0xb'));var fs=require('fs');var _=require(_0xef0c('0xc'));var squel=require(_0xef0c('0xd'));var crypto=require(_0xef0c('0xe'));var jsforce=require(_0xef0c('0xf'));var deskjs=require(_0xef0c('0x10'));var toCsv=require(_0xef0c('0xa'));var querystring=require(_0xef0c('0x11'));var Papa=require(_0xef0c('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xef0c('0x13'));var as=require(_0xef0c('0x14'));var hardwareService=require(_0xef0c('0x15'));var logger=require(_0xef0c('0x16'))(_0xef0c('0x17'));var utils=require(_0xef0c('0x18'));var config=require('../../config/environment');var db=require(_0xef0c('0x19'))['db'];function respondWithStatusCode(_0x4bbb33,_0x46e4e0){_0x46e4e0=_0x46e4e0||0xcc;return function(_0x5df05d){if(_0x5df05d){return _0x4bbb33[_0xef0c('0x1a')](_0x46e4e0);}return _0x4bbb33['status'](_0x46e4e0)[_0xef0c('0x1b')]();};}function respondWithResult(_0xab17ee,_0x3a96cf){_0x3a96cf=_0x3a96cf||0xc8;return function(_0x480441){if(_0x480441){return _0xab17ee['status'](_0x3a96cf)[_0xef0c('0x1c')](_0x480441);}};}function respondWithFilteredResult(_0x110ec1,_0x2cf844){return function(_0xc85772){if(_0xc85772){var _0x2e5068=_0xc85772['count'],_0xa7da91=_0x2cf844[_0xef0c('0x1d')],_0x23be41=_0x2cf844[_0xef0c('0x1d')]+_0x2cf844[_0xef0c('0x1e')],_0x464590;if(_0x23be41>=_0x2e5068){_0x23be41=_0x2e5068;_0x464590=0xc8;}else{_0x464590=0xce;}_0x110ec1[_0xef0c('0x1f')](_0x464590);return _0x110ec1[_0xef0c('0x20')](_0xef0c('0x21'),_0xa7da91+'-'+_0x23be41+'/'+_0x2e5068)[_0xef0c('0x1c')](_0xc85772);}return null;};}function patchUpdates(_0x389df7){return function(_0x58a57f){try{jsonpatch[_0xef0c('0x22')](_0x58a57f,_0x389df7,!![]);}catch(_0x6b174b){return BPromise[_0xef0c('0x23')](_0x6b174b);}return _0x58a57f[_0xef0c('0x24')]();};}function saveUpdates(_0x1f06d8,_0x3fe497){return function(_0x15282d){if(_0x15282d){return _0x15282d[_0xef0c('0x25')](_0x1f06d8)[_0xef0c('0x26')](function(_0x11fef5){return _0x11fef5;});}return null;};}function removeEntity(_0x5ca1cc,_0x32a10e){return function(_0x301918){if(_0x301918){return _0x301918['destroy']()[_0xef0c('0x26')](function(){_0x5ca1cc[_0xef0c('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x980b69,_0x17609b){return function(_0x58d30c){if(!_0x58d30c){_0x980b69['sendStatus'](0x194);}return _0x58d30c;};}function handleError(_0x1981c2,_0x1f4c3e){_0x1f4c3e=_0x1f4c3e||0x1f4;return function(_0xc7166f){logger['error'](_0xc7166f[_0xef0c('0x27')]);if(_0xc7166f['name']){delete _0xc7166f['name'];}_0x1981c2[_0xef0c('0x1f')](_0x1f4c3e)['send'](_0xc7166f);};}exports[_0xef0c('0x28')]=function(_0x26fb3c,_0x503d38){var _0x3af429={},_0xb69ac6={},_0x4e403a={'count':0x0,'rows':[]};var _0x234819=_['map'](db[_0xef0c('0x29')][_0xef0c('0x2a')],function(_0x4ba1f7){return{'name':_0x4ba1f7['fieldName'],'type':_0x4ba1f7[_0xef0c('0x2b')][_0xef0c('0x2c')]};});_0xb69ac6[_0xef0c('0x2d')]=_[_0xef0c('0x2e')](_0x234819,'name');_0xb69ac6[_0xef0c('0x2f')]=_['keys'](_0x26fb3c[_0xef0c('0x2f')]);_0xb69ac6[_0xef0c('0x30')]=_[_0xef0c('0x31')](_0xb69ac6[_0xef0c('0x2d')],_0xb69ac6[_0xef0c('0x2f')]);_0x3af429[_0xef0c('0x32')]=_[_0xef0c('0x31')](_0xb69ac6[_0xef0c('0x2d')],qs[_0xef0c('0x33')](_0x26fb3c[_0xef0c('0x2f')][_0xef0c('0x33')]));_0x3af429['attributes']=_0x3af429['attributes'][_0xef0c('0x34')]?_0x3af429[_0xef0c('0x32')]:_0xb69ac6['model'];if(!_0x26fb3c[_0xef0c('0x2f')][_0xef0c('0x35')](_0xef0c('0x36'))){_0x3af429[_0xef0c('0x1e')]=qs[_0xef0c('0x1e')](_0x26fb3c[_0xef0c('0x2f')][_0xef0c('0x1e')]);_0x3af429[_0xef0c('0x1d')]=qs[_0xef0c('0x1d')](_0x26fb3c[_0xef0c('0x2f')][_0xef0c('0x1d')]);}_0x3af429[_0xef0c('0x37')]=qs[_0xef0c('0x38')](_0x26fb3c[_0xef0c('0x2f')]['sort']);_0x3af429[_0xef0c('0x39')]=qs['filters'](_[_0xef0c('0x3a')](_0x26fb3c[_0xef0c('0x2f')],_0xb69ac6[_0xef0c('0x30')]));if(_0x26fb3c[_0xef0c('0x2f')]['filter']){_0x3af429[_0xef0c('0x39')]=_[_0xef0c('0x3b')](_0x3af429[_0xef0c('0x39')],{'$or':_[_0xef0c('0x2e')](_0x234819,function(_0x30777c){if(_0x30777c['type']!==_0xef0c('0x3c')){var _0x21c172={};_0x21c172[_0x30777c['name']]={'$like':'%'+_0x26fb3c['query'][_0xef0c('0x3d')]+'%'};return _0x21c172;}})});}_0x3af429=_[_0xef0c('0x3b')]({},_0x3af429,_0x26fb3c[_0xef0c('0x3e')]);var _0x3b596e={'where':_0x3af429[_0xef0c('0x39')]};return db[_0xef0c('0x29')][_0xef0c('0x3f')](_0x3b596e)[_0xef0c('0x26')](function(_0x2501d2){_0x4e403a['count']=_0x2501d2;if(_0x26fb3c[_0xef0c('0x2f')][_0xef0c('0x40')]){_0x3af429[_0xef0c('0x41')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xef0c('0x42')](_0x3af429);})['then'](function(_0x843139){_0x4e403a[_0xef0c('0x43')]=_0x843139;return _0x4e403a;})[_0xef0c('0x26')](respondWithFilteredResult(_0x503d38,_0x3af429))[_0xef0c('0x44')](handleError(_0x503d38,null));};exports[_0xef0c('0x45')]=function(_0x529fdc,_0x950880){var _0x29fbfd={'raw':!![],'where':{'id':_0x529fdc[_0xef0c('0x46')]['id']}},_0x48695d={};_0x48695d[_0xef0c('0x2d')]=_[_0xef0c('0x47')](db[_0xef0c('0x29')][_0xef0c('0x2a')]);_0x48695d[_0xef0c('0x2f')]=_[_0xef0c('0x47')](_0x529fdc[_0xef0c('0x2f')]);_0x48695d['filters']=_[_0xef0c('0x31')](_0x48695d['model'],_0x48695d[_0xef0c('0x2f')]);_0x29fbfd[_0xef0c('0x32')]=_['intersection'](_0x48695d['model'],qs[_0xef0c('0x33')](_0x529fdc['query'][_0xef0c('0x33')]));_0x29fbfd['attributes']=_0x29fbfd['attributes'][_0xef0c('0x34')]?_0x29fbfd[_0xef0c('0x32')]:_0x48695d[_0xef0c('0x2d')];if(_0x529fdc[_0xef0c('0x2f')][_0xef0c('0x40')]){_0x29fbfd[_0xef0c('0x41')]=[{'all':!![]}];}_0x29fbfd=_[_0xef0c('0x3b')]({},_0x29fbfd,_0x529fdc['options']);return db[_0xef0c('0x29')][_0xef0c('0x48')](_0x29fbfd)[_0xef0c('0x26')](handleEntityNotFound(_0x950880,null))[_0xef0c('0x26')](respondWithResult(_0x950880,null))[_0xef0c('0x44')](handleError(_0x950880,null));};exports[_0xef0c('0x49')]=function(_0x202165,_0x4e209f){return db[_0xef0c('0x29')][_0xef0c('0x49')](_0x202165[_0xef0c('0x4a')],{})['then'](respondWithResult(_0x4e209f,0xc9))[_0xef0c('0x44')](handleError(_0x4e209f,null));};exports[_0xef0c('0x25')]=function(_0x1a7618,_0x1820e8){if(_0x1a7618[_0xef0c('0x4a')]['id']){delete _0x1a7618[_0xef0c('0x4a')]['id'];}return db[_0xef0c('0x29')]['find']({'where':{'id':_0x1a7618['params']['id']}})[_0xef0c('0x26')](handleEntityNotFound(_0x1820e8,null))[_0xef0c('0x26')](saveUpdates(_0x1a7618[_0xef0c('0x4a')],null))[_0xef0c('0x26')](respondWithResult(_0x1820e8,null))[_0xef0c('0x44')](handleError(_0x1820e8,null));};exports[_0xef0c('0x4b')]=function(_0xe6df7e,_0x260990){return db[_0xef0c('0x29')][_0xef0c('0x48')]({'where':{'id':_0xe6df7e[_0xef0c('0x46')]['id']}})[_0xef0c('0x26')](handleEntityNotFound(_0x260990,null))[_0xef0c('0x26')](removeEntity(_0x260990,null))[_0xef0c('0x44')](handleError(_0x260990,null));};exports['describe']=function(_0x28bc68,_0x1366f7){return db[_0xef0c('0x29')][_0xef0c('0x4c')]()[_0xef0c('0x26')](respondWithResult(_0x1366f7,null))[_0xef0c('0x44')](handleError(_0x1366f7,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 1a9a75c..fb90e31 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 _0x01d9=['SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define'];(function(_0xc24832,_0x2e9083){var _0x583cbc=function(_0x297597){while(--_0x297597){_0xc24832['push'](_0xc24832['shift']());}};_0x583cbc(++_0x2e9083);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var logger=require(_0x901d('0x2'))(_0x901d('0x3'));var moment=require('moment');var BPromise=require(_0x901d('0x4'));var rp=require(_0x901d('0x5'));var fs=require('fs');var path=require(_0x901d('0x6'));var rimraf=require(_0x901d('0x7'));var config=require(_0x901d('0x8'));var attributes=require(_0x901d('0x9'));module[_0x901d('0xa')]=function(_0x4e7842,_0x1e5d7d){return _0x4e7842[_0x901d('0xb')](_0x901d('0xc'),attributes,{'tableName':_0x901d('0xd'),'paranoid':![],'indexes':[{'name':_0x901d('0xe'),'fields':[_0x901d('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4819=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','SmsTransferReport','report_sms_transfer','uniqueid','util','../../config/logger','api'];(function(_0x1923f7,_0x2a0a09){var _0x32b220=function(_0x23a6d3){while(--_0x23a6d3){_0x1923f7['push'](_0x1923f7['shift']());}};_0x32b220(++_0x2a0a09);}(_0x4819,0xcd));var _0x9481=function(_0xb31b62,_0x309405){_0xb31b62=_0xb31b62-0x0;var _0x3928ed=_0x4819[_0xb31b62];return _0x3928ed;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));module['exports']=function(_0x4d9e3a,_0x5def07){return _0x4d9e3a['define'](_0x9481('0xa'),attributes,{'tableName':_0x9481('0xb'),'paranoid':![],'indexes':[{'name':_0x9481('0xc'),'fields':[_0x9481('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index d973a9a..1a22460 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 _0x4186=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4186,0x160));var _0x6418=function(_0x2b305c,_0x5ae303){_0x2b305c=_0x2b305c-0x0;var _0x5d8c85=_0x4186[_0x2b305c];return _0x5d8c85;};'use strict';var _=require(_0x6418('0x0'));var util=require(_0x6418('0x1'));var moment=require(_0x6418('0x2'));var BPromise=require(_0x6418('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6418('0x4'));var db=require(_0x6418('0x5'))['db'];var utils=require(_0x6418('0x6'));var logger=require(_0x6418('0x7'))(_0x6418('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6418('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x473c12,_0x40383d,_0x38e92){return new BPromise(function(_0x40272,_0x53c89b){return client[_0x6418('0xa')](_0x473c12,_0x38e92)['then'](function(_0x4ab1b2){logger[_0x6418('0xb')]('SmsTransferReport,\x20%s,\x20%s',_0x40383d,_0x6418('0xc'));logger[_0x6418('0xd')](_0x6418('0xe'),_0x40383d,_0x6418('0xc'),JSON[_0x6418('0xf')](_0x4ab1b2));if(_0x4ab1b2['error']){if(_0x4ab1b2[_0x6418('0x10')][_0x6418('0x11')]===0x1f4){logger['error'](_0x6418('0x12'),_0x40383d,_0x4ab1b2['error']['message']);return _0x53c89b(_0x4ab1b2[_0x6418('0x10')][_0x6418('0x13')]);}logger['error'](_0x6418('0x12'),_0x40383d,_0x4ab1b2['error'][_0x6418('0x13')]);return _0x40272(_0x4ab1b2[_0x6418('0x10')][_0x6418('0x13')]);}else{logger[_0x6418('0xb')](_0x6418('0x12'),_0x40383d,_0x6418('0xc'));_0x40272(_0x4ab1b2[_0x6418('0x14')]['message']);}})[_0x6418('0x15')](function(_0x527708){logger[_0x6418('0x10')](_0x6418('0x12'),_0x40383d,_0x527708);_0x53c89b(_0x527708);});});} \ No newline at end of file +var _0x2066=['../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis'];(function(_0xc838b8,_0x2f4309){var _0x18c0be=function(_0x2d81cd){while(--_0x2d81cd){_0xc838b8['push'](_0xc838b8['shift']());}};_0x18c0be(++_0x2f4309);}(_0x2066,0x164));var _0x6206=function(_0xcb9b57,_0x3d9add){_0xcb9b57=_0xcb9b57-0x0;var _0x4a183c=_0x2066[_0xcb9b57];return _0x4a183c;};'use strict';var _=require(_0x6206('0x0'));var util=require(_0x6206('0x1'));var moment=require(_0x6206('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6206('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6206('0x4'))(_0x6206('0x5'));var config=require(_0x6206('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6206('0x7')][_0x6206('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x56b57b,_0x23beee,_0x421c05){return new BPromise(function(_0x29b71,_0x532c95){return client['request'](_0x56b57b,_0x421c05)[_0x6206('0x9')](function(_0x59c483){logger[_0x6206('0xa')]('SmsTransferReport,\x20%s,\x20%s',_0x23beee,_0x6206('0xb'));logger[_0x6206('0xc')](_0x6206('0xd'),_0x23beee,_0x6206('0xb'),JSON[_0x6206('0xe')](_0x59c483));if(_0x59c483[_0x6206('0xf')]){if(_0x59c483[_0x6206('0xf')]['code']===0x1f4){logger[_0x6206('0xf')](_0x6206('0x10'),_0x23beee,_0x59c483['error'][_0x6206('0x11')]);return _0x532c95(_0x59c483[_0x6206('0xf')]['message']);}logger['error'](_0x6206('0x10'),_0x23beee,_0x59c483[_0x6206('0xf')][_0x6206('0x11')]);return _0x29b71(_0x59c483[_0x6206('0xf')][_0x6206('0x11')]);}else{logger[_0x6206('0xa')]('SmsTransferReport,\x20%s,\x20%s',_0x23beee,_0x6206('0xb'));_0x29b71(_0x59c483[_0x6206('0x12')]['message']);}})[_0x6206('0x13')](function(_0x22935b){logger[_0x6206('0xf')]('SmsTransferReport,\x20%s,\x20%s',_0x23beee,_0x22935b);_0x532c95(_0x22935b);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 1b669e0..5b27636 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 _0xff65=['originalname','replace','basename','extname','now','single','file','create','put','update','delete','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','join'];(function(_0x19ffb9,_0x5a8bab){var _0xf155a2=function(_0x1d6a79){while(--_0x1d6a79){_0x19ffb9['push'](_0x19ffb9['shift']());}};_0xf155a2(++_0x5a8bab);}(_0xff65,0xcb));var _0x5ff6=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0xff65[_0x20a558];return _0x53d3f7;};'use strict';var multer=require(_0x5ff6('0x0'));var util=require(_0x5ff6('0x1'));var path=require(_0x5ff6('0x2'));var timeout=require(_0x5ff6('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x5ff6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5ff6('0x5'));var controller=require(_0x5ff6('0x6'));router[_0x5ff6('0x7')]('/',auth[_0x5ff6('0x8')](),controller[_0x5ff6('0x9')]);router[_0x5ff6('0x7')](_0x5ff6('0xa'),auth[_0x5ff6('0x8')](),controller[_0x5ff6('0xb')]);router[_0x5ff6('0x7')]('/:id/download',auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4af87e,_0x4d193e,_0x3d334a){_0x3d334a(null,path[_0x5ff6('0xc')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x37a92a,_0x37995f,_0x478423){_0x37995f['originalname']=_0x37995f[_0x5ff6('0xd')][_0x5ff6('0xe')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x478423(null,util['format']('%s-%s%s',path[_0x5ff6('0xf')](_0x37995f[_0x5ff6('0xd')],path[_0x5ff6('0x10')](_0x37995f[_0x5ff6('0xd')])),Date[_0x5ff6('0x11')](),path['extname'](_0x37995f[_0x5ff6('0xd')])));}})});router['post']('/',upload[_0x5ff6('0x12')](_0x5ff6('0x13')),controller[_0x5ff6('0x14')]);router[_0x5ff6('0x15')](_0x5ff6('0xa'),auth[_0x5ff6('0x8')](),controller[_0x5ff6('0x16')]);router[_0x5ff6('0x17')](_0x5ff6('0xa'),auth[_0x5ff6('0x8')](),controller[_0x5ff6('0x17')]);module['exports']=router; \ No newline at end of file +var _0x71ca=['express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id/download','diskStorage','join','server/files/sounds/original/','originalname','%s-%s%s','basename','extname','now','post','single','create','put','/:id','update','delete','exports','multer'];(function(_0x2e7ab0,_0x21731a){var _0x416a51=function(_0x20e863){while(--_0x20e863){_0x2e7ab0['push'](_0x2e7ab0['shift']());}};_0x416a51(++_0x21731a);}(_0x71ca,0x95));var _0xa71c=function(_0x4277ea,_0x462b01){_0x4277ea=_0x4277ea-0x0;var _0x19b200=_0x71ca[_0x4277ea];return _0x19b200;};'use strict';var multer=require(_0xa71c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa71c('0x1'));var router=express[_0xa71c('0x2')]();var auth=require(_0xa71c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xa71c('0x4'));var controller=require('./sound.controller');router[_0xa71c('0x5')]('/',auth[_0xa71c('0x6')](),controller[_0xa71c('0x7')]);router[_0xa71c('0x5')]('/:id',auth[_0xa71c('0x6')](),controller['show']);router[_0xa71c('0x5')](_0xa71c('0x8'),auth[_0xa71c('0x6')](),controller['download']);var upload=multer({'storage':multer[_0xa71c('0x9')]({'destination':function(_0x3ee7f4,_0x4f49c0,_0x2ee677){_0x2ee677(null,path[_0xa71c('0xa')](config['root'],_0xa71c('0xb')));},'filename':function(_0xaaa992,_0x385d75,_0x5766fd){_0x385d75[_0xa71c('0xc')]=_0x385d75[_0xa71c('0xc')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5766fd(null,util['format'](_0xa71c('0xd'),path[_0xa71c('0xe')](_0x385d75['originalname'],path[_0xa71c('0xf')](_0x385d75['originalname'])),Date[_0xa71c('0x10')](),path[_0xa71c('0xf')](_0x385d75[_0xa71c('0xc')])));}})});router[_0xa71c('0x11')]('/',upload[_0xa71c('0x12')]('file'),controller[_0xa71c('0x13')]);router[_0xa71c('0x14')](_0xa71c('0x15'),auth[_0xa71c('0x6')](),controller[_0xa71c('0x16')]);router['delete']('/:id',auth[_0xa71c('0x6')](),controller[_0xa71c('0x17')]);module[_0xa71c('0x18')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index bc949af..6d92505 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 _0x88d3=['BIGINT','INTEGER','exports','STRING','FLOAT'];(function(_0x2c2066,_0x586e30){var _0x6e5812=function(_0x3fe32d){while(--_0x3fe32d){_0x2c2066['push'](_0x2c2066['shift']());}};_0x6e5812(++_0x586e30);}(_0x88d3,0x156));var _0x388d=function(_0x112285,_0x52c6cc){_0x112285=_0x112285-0x0;var _0x5b7555=_0x88d3[_0x112285];return _0x5b7555;};'use strict';var Sequelize=require('sequelize');module[_0x388d('0x0')]={'name':{'type':Sequelize[_0x388d('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x388d('0x1')]},'display_name':{'type':Sequelize[_0x388d('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x388d('0x1')]},'original_format':{'type':Sequelize[_0x388d('0x1')]},'original_duration':{'type':Sequelize[_0x388d('0x2')]},'original_sampleCount':{'type':Sequelize[_0x388d('0x3')]},'original_channelCount':{'type':Sequelize[_0x388d('0x4')]},'original_bitRate':{'type':Sequelize[_0x388d('0x3')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x388d('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x388d('0x3')]},'converted_channelCount':{'type':Sequelize[_0x388d('0x4')]},'converted_bitRate':{'type':Sequelize[_0x388d('0x3')]},'converted_sampleRate':{'type':Sequelize[_0x388d('0x4')]}}; \ No newline at end of file +var _0x8ac8=['name','FLOAT','INTEGER','BIGINT','sequelize','STRING'];(function(_0x2b60cd,_0x12e0e2){var _0xccc9ff=function(_0x36b90c){while(--_0x36b90c){_0x2b60cd['push'](_0x2b60cd['shift']());}};_0xccc9ff(++_0x12e0e2);}(_0x8ac8,0x16c));var _0x88ac=function(_0x43bd21,_0x4beaaa){_0x43bd21=_0x43bd21-0x0;var _0x22d292=_0x8ac8[_0x43bd21];return _0x22d292;};'use strict';var Sequelize=require(_0x88ac('0x0'));module['exports']={'name':{'type':Sequelize[_0x88ac('0x1')],'unique':_0x88ac('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x88ac('0x1')]},'display_name':{'type':Sequelize[_0x88ac('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x88ac('0x1')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x88ac('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x88ac('0x4')]},'original_bitRate':{'type':Sequelize[_0x88ac('0x5')]},'original_sampleRate':{'type':Sequelize[_0x88ac('0x4')]},'converted_format':{'type':Sequelize[_0x88ac('0x1')]},'converted_duration':{'type':Sequelize[_0x88ac('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x88ac('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x88ac('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index af00da0..cb193d4 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 _0xcaef=['server/files/sounds/converted','Sound\x20not\x20found','download','format','%s.%s','converted_format','create','file','originalname','extname','basename','filename','substring','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','unlinkSync','original_duration','duration','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','server/files/sounds/original','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','error','stack','name','send','index','Sound','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','include','findAll','rows','show','params','rawAttributes','find','catch','save_name','existsSync','join','root'];(function(_0x1283ad,_0x33c0e0){var _0x12afe0=function(_0x231e75){while(--_0x231e75){_0x1283ad['push'](_0x1283ad['shift']());}};_0x12afe0(++_0x33c0e0);}(_0xcaef,0x11f));var _0xfcae=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xcaef[_0x273c39];return _0x46d6b5;};'use strict';var pdf=require(_0xfcae('0x0'));var emlformat=require(_0xfcae('0x1'));var rimraf=require(_0xfcae('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfcae('0x3'));var rp=require(_0xfcae('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfcae('0x5'));var util=require(_0xfcae('0x6'));var path=require(_0xfcae('0x7'));var sox=require(_0xfcae('0x8'));var csv=require(_0xfcae('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfcae('0xa'));var squel=require(_0xfcae('0xb'));var crypto=require(_0xfcae('0xc'));var jsforce=require(_0xfcae('0xd'));var deskjs=require(_0xfcae('0xe'));var toCsv=require(_0xfcae('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfcae('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfcae('0x10'));var hardwareService=require(_0xfcae('0x11'));var logger=require(_0xfcae('0x12'))(_0xfcae('0x13'));var utils=require(_0xfcae('0x14'));var config=require(_0xfcae('0x15'));var db=require(_0xfcae('0x16'))['db'];function respondWithStatusCode(_0xbf3782,_0x26106c){_0x26106c=_0x26106c||0xcc;return function(_0xb9c9bf){if(_0xb9c9bf){return _0xbf3782[_0xfcae('0x17')](_0x26106c);}return _0xbf3782[_0xfcae('0x18')](_0x26106c)[_0xfcae('0x19')]();};}function respondWithResult(_0x510f22,_0x34754f){_0x34754f=_0x34754f||0xc8;return function(_0x1b5604){if(_0x1b5604){return _0x510f22[_0xfcae('0x18')](_0x34754f)['json'](_0x1b5604);}};}function respondWithFilteredResult(_0x3974ce,_0x529613){return function(_0x27a4d3){if(_0x27a4d3){var _0x5cb102=_0x27a4d3[_0xfcae('0x1a')],_0xfff88c=_0x529613[_0xfcae('0x1b')],_0x241529=_0x529613[_0xfcae('0x1b')]+_0x529613[_0xfcae('0x1c')],_0xca5403;if(_0x241529>=_0x5cb102){_0x241529=_0x5cb102;_0xca5403=0xc8;}else{_0xca5403=0xce;}_0x3974ce[_0xfcae('0x18')](_0xca5403);return _0x3974ce['set'](_0xfcae('0x1d'),_0xfff88c+'-'+_0x241529+'/'+_0x5cb102)[_0xfcae('0x1e')](_0x27a4d3);}return null;};}function patchUpdates(_0x42bcaf){return function(_0x235ad2){try{jsonpatch[_0xfcae('0x1f')](_0x235ad2,_0x42bcaf,!![]);}catch(_0x37454c){return BPromise[_0xfcae('0x20')](_0x37454c);}return _0x235ad2[_0xfcae('0x21')]();};}function saveUpdates(_0x5b8f4a,_0x173c74){return function(_0x3ea510){if(_0x3ea510){return _0x3ea510[_0xfcae('0x22')](_0x5b8f4a)[_0xfcae('0x23')](function(_0x51c660){return _0x51c660;});}return null;};}function removeEntity(_0x5090d2,_0x2e4118){return function(_0x50d8e6){if(_0x50d8e6){return _0x50d8e6[_0xfcae('0x24')]()[_0xfcae('0x23')](function(){var _0x3eca9a=_0x50d8e6[_0xfcae('0x25')]({'plain':!![]});var _0x393def=_0xfcae('0x26');return db[_0xfcae('0x27')][_0xfcae('0x24')]({'where':{'type':_0x393def,'resourceId':_0x3eca9a['id']}})[_0xfcae('0x23')](function(){return _0x50d8e6;});})[_0xfcae('0x23')](function(){_0x5090d2[_0xfcae('0x18')](0xcc)[_0xfcae('0x19')]();});}};}function handleEntityNotFound(_0x38f2bf,_0x118686){return function(_0x452f84){if(!_0x452f84){_0x38f2bf[_0xfcae('0x17')](0x194);}return _0x452f84;};}function handleError(_0x4c0606,_0x8d4723){_0x8d4723=_0x8d4723||0x1f4;return function(_0x158c83){logger[_0xfcae('0x28')](_0x158c83[_0xfcae('0x29')]);if(_0x158c83[_0xfcae('0x2a')]){delete _0x158c83['name'];}_0x4c0606[_0xfcae('0x18')](_0x8d4723)[_0xfcae('0x2b')](_0x158c83);};}exports[_0xfcae('0x2c')]=function(_0x2c8693,_0x971739){var _0x315c04={},_0x4a356f={},_0x5ce472={'count':0x0,'rows':[]};var _0x4384e7=_['map'](db[_0xfcae('0x2d')]['rawAttributes'],function(_0x3dabcc){return{'name':_0x3dabcc[_0xfcae('0x2e')],'type':_0x3dabcc[_0xfcae('0x2f')][_0xfcae('0x30')]};});_0x4a356f['model']=_[_0xfcae('0x31')](_0x4384e7,_0xfcae('0x2a'));_0x4a356f['query']=_[_0xfcae('0x32')](_0x2c8693[_0xfcae('0x33')]);_0x4a356f[_0xfcae('0x34')]=_[_0xfcae('0x35')](_0x4a356f[_0xfcae('0x36')],_0x4a356f['query']);_0x315c04[_0xfcae('0x37')]=_[_0xfcae('0x35')](_0x4a356f[_0xfcae('0x36')],qs[_0xfcae('0x38')](_0x2c8693[_0xfcae('0x33')][_0xfcae('0x38')]));_0x315c04[_0xfcae('0x37')]=_0x315c04[_0xfcae('0x37')][_0xfcae('0x39')]?_0x315c04[_0xfcae('0x37')]:_0x4a356f[_0xfcae('0x36')];if(!_0x2c8693[_0xfcae('0x33')][_0xfcae('0x3a')](_0xfcae('0x3b'))){_0x315c04[_0xfcae('0x1c')]=qs[_0xfcae('0x1c')](_0x2c8693[_0xfcae('0x33')]['limit']);_0x315c04['offset']=qs['offset'](_0x2c8693[_0xfcae('0x33')][_0xfcae('0x1b')]);}_0x315c04[_0xfcae('0x3c')]=qs[_0xfcae('0x3d')](_0x2c8693[_0xfcae('0x33')]['sort']);_0x315c04[_0xfcae('0x3e')]=qs[_0xfcae('0x34')](_[_0xfcae('0x3f')](_0x2c8693[_0xfcae('0x33')],_0x4a356f[_0xfcae('0x34')]));if(_0x2c8693[_0xfcae('0x33')]['filter']){_0x315c04[_0xfcae('0x3e')]=_[_0xfcae('0x40')](_0x315c04[_0xfcae('0x3e')],{'$or':_[_0xfcae('0x31')](_0x4384e7,function(_0x13dae6){if(_0x13dae6[_0xfcae('0x2f')]!=='VIRTUAL'){var _0x2fc78b={};_0x2fc78b[_0x13dae6[_0xfcae('0x2a')]]={'$like':'%'+_0x2c8693[_0xfcae('0x33')][_0xfcae('0x41')]+'%'};return _0x2fc78b;}})});}_0x315c04=_[_0xfcae('0x40')]({},_0x315c04,_0x2c8693[_0xfcae('0x42')]);var _0x20a509={'where':_0x315c04[_0xfcae('0x3e')]};return db['Sound']['count'](_0x20a509)[_0xfcae('0x23')](function(_0x1857ef){_0x5ce472[_0xfcae('0x1a')]=_0x1857ef;if(_0x2c8693[_0xfcae('0x33')]['includeAll']){_0x315c04[_0xfcae('0x43')]=[{'all':!![]}];}return db[_0xfcae('0x2d')][_0xfcae('0x44')](_0x315c04);})[_0xfcae('0x23')](function(_0x1f891d){_0x5ce472[_0xfcae('0x45')]=_0x1f891d;return _0x5ce472;})['then'](respondWithFilteredResult(_0x971739,_0x315c04))['catch'](handleError(_0x971739,null));};exports[_0xfcae('0x46')]=function(_0x25d566,_0x56bb3e){var _0x1f059a={'raw':!![],'where':{'id':_0x25d566[_0xfcae('0x47')]['id']}},_0x7ffd92={};_0x7ffd92[_0xfcae('0x36')]=_['keys'](db['Sound'][_0xfcae('0x48')]);_0x7ffd92['query']=_[_0xfcae('0x32')](_0x25d566[_0xfcae('0x33')]);_0x7ffd92[_0xfcae('0x34')]=_[_0xfcae('0x35')](_0x7ffd92['model'],_0x7ffd92[_0xfcae('0x33')]);_0x1f059a[_0xfcae('0x37')]=_[_0xfcae('0x35')](_0x7ffd92['model'],qs[_0xfcae('0x38')](_0x25d566[_0xfcae('0x33')]['fields']));_0x1f059a[_0xfcae('0x37')]=_0x1f059a['attributes']['length']?_0x1f059a[_0xfcae('0x37')]:_0x7ffd92[_0xfcae('0x36')];if(_0x25d566['query']['includeAll']){_0x1f059a[_0xfcae('0x43')]=[{'all':!![]}];}_0x1f059a=_[_0xfcae('0x40')]({},_0x1f059a,_0x25d566[_0xfcae('0x42')]);return db[_0xfcae('0x2d')][_0xfcae('0x49')](_0x1f059a)[_0xfcae('0x23')](handleEntityNotFound(_0x56bb3e,null))['then'](respondWithResult(_0x56bb3e,null))[_0xfcae('0x4a')](handleError(_0x56bb3e,null));};exports['download']=function(_0x320a22,_0x5b5cba,_0x3212c4){return db[_0xfcae('0x2d')][_0xfcae('0x49')]({'where':{'id':_0x320a22['params']['id']},'attributes':[_0xfcae('0x2a'),_0xfcae('0x4b'),'converted_format'],'raw':!![]})[_0xfcae('0x23')](handleEntityNotFound(_0x5b5cba,null))['then'](function(_0x21e35f){if(_0x21e35f){if(!fs[_0xfcae('0x4c')](path[_0xfcae('0x4d')](config[_0xfcae('0x4e')],_0xfcae('0x4f'),_0x21e35f[_0xfcae('0x4b')]+'.'+_0x21e35f['converted_format']))){throw new db['Sequelize']['ValidationError'](_0xfcae('0x50'));}return _0x5b5cba[_0xfcae('0x51')](path['join'](config[_0xfcae('0x4e')],_0xfcae('0x4f'),util[_0xfcae('0x52')](_0xfcae('0x53'),_0x21e35f[_0xfcae('0x4b')],_0x21e35f[_0xfcae('0x54')])),util[_0xfcae('0x52')](_0xfcae('0x53'),_0x21e35f[_0xfcae('0x2a')],_0x21e35f[_0xfcae('0x54')]));}return null;})[_0xfcae('0x4a')](handleError(_0x5b5cba,null));};exports[_0xfcae('0x55')]=function(_0x1bc2c3,_0x6d6e5f,_0xbc24cd){var _0x10c673={'name':path['basename'](_0x1bc2c3[_0xfcae('0x56')][_0xfcae('0x57')],path[_0xfcae('0x58')](_0x1bc2c3['file'][_0xfcae('0x57')])),'save_name':path[_0xfcae('0x59')](_0x1bc2c3[_0xfcae('0x56')][_0xfcae('0x5a')],path['extname'](_0x1bc2c3[_0xfcae('0x56')]['filename'])),'original_format':path[_0xfcae('0x58')](_0x1bc2c3[_0xfcae('0x56')]['originalname'])[_0xfcae('0x5b')](0x1),'converted_format':_0xfcae('0x5c')};var _0x4aebe5=path[_0xfcae('0x4d')](config[_0xfcae('0x4e')],'server/files/sounds/original',_0x1bc2c3[_0xfcae('0x56')][_0xfcae('0x5a')]);var _0x6b900d=path[_0xfcae('0x4d')](config[_0xfcae('0x4e')],_0xfcae('0x4f'),util[_0xfcae('0x52')]('%s.%s',path['basename'](_0x1bc2c3[_0xfcae('0x56')][_0xfcae('0x5a')],path['extname'](_0x1bc2c3[_0xfcae('0x56')][_0xfcae('0x5a')])),_0x10c673['converted_format']));logger[_0xfcae('0x5d')](_0xfcae('0x5e'),_0x4aebe5);logger[_0xfcae('0x5d')](_0xfcae('0x5f'),_0x6b900d);try{fs[_0xfcae('0x60')](_0x4aebe5,parseInt(_0xfcae('0x61'),0x8));var _0x26e1d8=sox['transcode'](_0x4aebe5,_0x6b900d,{'sampleRate':0x1f40,'format':_0xfcae('0x5c'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x26e1d8['on'](_0xfcae('0x28'),function(_0x2da4dd){fs[_0xfcae('0x62')](_0x4aebe5);_0x6d6e5f['status'](0x1f4)[_0xfcae('0x2b')](_0x2da4dd);});_0x26e1d8['on']('src',function(_0x5112d0){_0x10c673[_0xfcae('0x63')]=isNaN(_0x5112d0[_0xfcae('0x64')])?null:_0x5112d0[_0xfcae('0x64')]*0x3e8;_0x10c673['original_sampleCount']=isNaN(_0x5112d0['sampleCount'])?null:_0x5112d0[_0xfcae('0x65')];_0x10c673['original_channelCount']=isNaN(_0x5112d0[_0xfcae('0x66')])?null:_0x5112d0[_0xfcae('0x66')];_0x10c673[_0xfcae('0x67')]=isNaN(_0x5112d0['bitRate'])?null:_0x5112d0[_0xfcae('0x68')];_0x10c673[_0xfcae('0x69')]=isNaN(_0x5112d0[_0xfcae('0x6a')])?null:_0x5112d0['sampleRate'];});_0x26e1d8['on'](_0xfcae('0x6b'),function(_0x13e45c){_0x10c673[_0xfcae('0x6c')]=isNaN(_0x13e45c['duration'])?null:_0x13e45c['duration']*0x3e8;_0x10c673[_0xfcae('0x6d')]=isNaN(_0x13e45c[_0xfcae('0x65')])?null:_0x13e45c[_0xfcae('0x65')];_0x10c673[_0xfcae('0x6e')]=isNaN(_0x13e45c[_0xfcae('0x66')])?null:_0x13e45c[_0xfcae('0x66')];_0x10c673['converted_bitRate']=isNaN(_0x13e45c[_0xfcae('0x68')])?null:_0x13e45c['bitRate'];_0x10c673['converted_sampleRate']=isNaN(_0x13e45c[_0xfcae('0x6a')])?null:_0x13e45c[_0xfcae('0x6a')];});_0x26e1d8['on'](_0xfcae('0x19'),function(){fs['chmodSync'](_0x6b900d,parseInt(_0xfcae('0x61'),0x8));return db[_0xfcae('0x2d')][_0xfcae('0x55')](_0x10c673)[_0xfcae('0x23')](function(_0x1d6d2d){var _0x16898c={'role':_0x1bc2c3['body'][_0xfcae('0x6f')],'userProfileId':_0x1bc2c3[_0xfcae('0x70')][_0xfcae('0x71')]};if(!_0x16898c)throw new Error(_0xfcae('0x72'));if(_0x16898c[_0xfcae('0x6f')]===_0xfcae('0x73')){var _0x3d6485=_0x1d6d2d['get']({'plain':!![]});return db[_0xfcae('0x74')][_0xfcae('0x49')]({'where':{'name':_0xfcae('0x26'),'userProfileId':_0x16898c[_0xfcae('0x71')]},'raw':!![]})[_0xfcae('0x23')](function(_0x236563){if(_0x236563&&_0x236563[_0xfcae('0x75')]===0x0){return db['UserProfileResource'][_0xfcae('0x55')]({'name':_0x3d6485[_0xfcae('0x2a')],'resourceId':_0x3d6485['id'],'type':_0x236563[_0xfcae('0x2a')],'sectionId':_0x236563['id']},{})['then'](function(){return _0x1d6d2d;});}else{return _0x1d6d2d;}})['catch'](function(_0x46bcbf){logger[_0xfcae('0x28')](_0xfcae('0x76'),_0x46bcbf);throw _0x46bcbf;});}return _0x1d6d2d;})[_0xfcae('0x23')](respondWithResult(_0x6d6e5f,null))[_0xfcae('0x4a')](handleError(_0x6d6e5f,null));});_0x26e1d8['start']();}catch(_0x43f872){_0x6d6e5f['status'](0x1f4)[_0xfcae('0x2b')](_0x43f872);}};exports['update']=function(_0xdd8946,_0x178426,_0xcdd64c){return db['Sound']['find']({'where':{'id':_0xdd8946[_0xfcae('0x47')]['id']}})[_0xfcae('0x23')](handleEntityNotFound(_0x178426,null))[_0xfcae('0x23')](saveUpdates(_[_0xfcae('0x3f')](_0xdd8946[_0xfcae('0x70')],[_0xfcae('0x2a'),_0xfcae('0x77')]),null))[_0xfcae('0x23')](respondWithResult(_0x178426,null))[_0xfcae('0x4a')](handleError(_0x178426,null));};exports[_0xfcae('0x78')]=function(_0x26da7a,_0x28fff3,_0xdf88c){return db[_0xfcae('0x2d')]['find']({'where':{'id':_0x26da7a[_0xfcae('0x47')]['id']}})['then'](function(_0x4217e8){if(_0x4217e8){return _0x4217e8[_0xfcae('0x24')]();}})[_0xfcae('0x23')](function(_0x902ed1){var _0xd68a68=path[_0xfcae('0x4d')](config[_0xfcae('0x4e')],_0xfcae('0x79'),util[_0xfcae('0x52')](_0xfcae('0x53'),_0x902ed1[_0xfcae('0x4b')],_0x902ed1['original_format']));var _0x3f9d0c=path['join'](config[_0xfcae('0x4e')],_0xfcae('0x4f'),util[_0xfcae('0x52')](_0xfcae('0x53'),_0x902ed1[_0xfcae('0x4b')],_0x902ed1[_0xfcae('0x54')]));fs[_0xfcae('0x62')](_0xd68a68);fs['unlinkSync'](_0x3f9d0c);return _0x902ed1;})['then'](function(_0x25cf9d){if(_0x25cf9d){return _0x28fff3[_0xfcae('0x18')](0xcc)[_0xfcae('0x19')]();}})[_0xfcae('0x23')](handleEntityNotFound(_0x28fff3,null))['catch'](handleError(_0x28fff3,null));}; \ No newline at end of file +var _0xed63=['moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','get','Sounds','sendStatus','error','stack','name','index','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','length','options','find','existsSync','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','download','join','root','%s.%s','format','create','basename','file','originalname','filename','server/files/sounds/original','extname','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','transcode','wav','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','chmodSync','0777','role','body','userProfileId','user','UserProfileSection','autoAssociation','UserProfileResource','start','pick','description','original_format','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x1d3bb9,_0x53e071){var _0xe2227=function(_0x2b6b4d){while(--_0x2b6b4d){_0x1d3bb9['push'](_0x1d3bb9['shift']());}};_0xe2227(++_0x53e071);}(_0xed63,0xf8));var _0x3ed6=function(_0x544a0d,_0x4a7b16){_0x544a0d=_0x544a0d-0x0;var _0x26a631=_0xed63[_0x544a0d];return _0x26a631;};'use strict';var pdf=require(_0x3ed6('0x0'));var emlformat=require(_0x3ed6('0x1'));var rimraf=require(_0x3ed6('0x2'));var zipdir=require(_0x3ed6('0x3'));var jsonpatch=require(_0x3ed6('0x4'));var rp=require(_0x3ed6('0x5'));var moment=require(_0x3ed6('0x6'));var BPromise=require(_0x3ed6('0x7'));var Mustache=require(_0x3ed6('0x8'));var util=require(_0x3ed6('0x9'));var path=require('path');var sox=require(_0x3ed6('0xa'));var csv=require(_0x3ed6('0xb'));var ejs=require(_0x3ed6('0xc'));var fs=require('fs');var _=require(_0x3ed6('0xd'));var squel=require(_0x3ed6('0xe'));var crypto=require(_0x3ed6('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x3ed6('0x10'));var toCsv=require(_0x3ed6('0xb'));var querystring=require(_0x3ed6('0x11'));var Papa=require(_0x3ed6('0x12'));var Redis=require(_0x3ed6('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x3ed6('0x14'));var as=require(_0x3ed6('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3ed6('0x16'))(_0x3ed6('0x17'));var utils=require(_0x3ed6('0x18'));var config=require(_0x3ed6('0x19'));var db=require(_0x3ed6('0x1a'))['db'];function respondWithStatusCode(_0x41f146,_0x4e6c4a){_0x4e6c4a=_0x4e6c4a||0xcc;return function(_0x29a193){if(_0x29a193){return _0x41f146['sendStatus'](_0x4e6c4a);}return _0x41f146[_0x3ed6('0x1b')](_0x4e6c4a)[_0x3ed6('0x1c')]();};}function respondWithResult(_0x780e5e,_0x8dd9d5){_0x8dd9d5=_0x8dd9d5||0xc8;return function(_0x46d58e){if(_0x46d58e){return _0x780e5e[_0x3ed6('0x1b')](_0x8dd9d5)[_0x3ed6('0x1d')](_0x46d58e);}};}function respondWithFilteredResult(_0x36001d,_0x11caeb){return function(_0x1a9167){if(_0x1a9167){var _0x3fa68c=_0x1a9167[_0x3ed6('0x1e')],_0x5a15cd=_0x11caeb['offset'],_0x3ef43c=_0x11caeb[_0x3ed6('0x1f')]+_0x11caeb[_0x3ed6('0x20')],_0xdf3dfc;if(_0x3ef43c>=_0x3fa68c){_0x3ef43c=_0x3fa68c;_0xdf3dfc=0xc8;}else{_0xdf3dfc=0xce;}_0x36001d['status'](_0xdf3dfc);return _0x36001d[_0x3ed6('0x21')]('Content-Range',_0x5a15cd+'-'+_0x3ef43c+'/'+_0x3fa68c)['json'](_0x1a9167);}return null;};}function patchUpdates(_0x53077f){return function(_0x4eb5c2){try{jsonpatch[_0x3ed6('0x22')](_0x4eb5c2,_0x53077f,!![]);}catch(_0x5bfc02){return BPromise[_0x3ed6('0x23')](_0x5bfc02);}return _0x4eb5c2['save']();};}function saveUpdates(_0xd3b81c,_0x5cfcea){return function(_0x261f29){if(_0x261f29){return _0x261f29[_0x3ed6('0x24')](_0xd3b81c)[_0x3ed6('0x25')](function(_0x5cb92a){return _0x5cb92a;});}return null;};}function removeEntity(_0x53ae9c,_0x450a9c){return function(_0x2b4403){if(_0x2b4403){return _0x2b4403[_0x3ed6('0x26')]()[_0x3ed6('0x25')](function(){var _0x5f4142=_0x2b4403[_0x3ed6('0x27')]({'plain':!![]});var _0x322763=_0x3ed6('0x28');return db['UserProfileResource'][_0x3ed6('0x26')]({'where':{'type':_0x322763,'resourceId':_0x5f4142['id']}})[_0x3ed6('0x25')](function(){return _0x2b4403;});})[_0x3ed6('0x25')](function(){_0x53ae9c[_0x3ed6('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c04d1,_0x11c086){return function(_0x7075c5){if(!_0x7075c5){_0x4c04d1[_0x3ed6('0x29')](0x194);}return _0x7075c5;};}function handleError(_0x212349,_0x518d80){_0x518d80=_0x518d80||0x1f4;return function(_0x466578){logger[_0x3ed6('0x2a')](_0x466578[_0x3ed6('0x2b')]);if(_0x466578[_0x3ed6('0x2c')]){delete _0x466578['name'];}_0x212349[_0x3ed6('0x1b')](_0x518d80)['send'](_0x466578);};}exports[_0x3ed6('0x2d')]=function(_0x174f46,_0x1618a1){var _0x5c7401={},_0x114afc={},_0x1fc065={'count':0x0,'rows':[]};var _0x190cf8=_[_0x3ed6('0x2e')](db[_0x3ed6('0x2f')][_0x3ed6('0x30')],function(_0x1d4dea){return{'name':_0x1d4dea[_0x3ed6('0x31')],'type':_0x1d4dea[_0x3ed6('0x32')][_0x3ed6('0x33')]};});_0x114afc[_0x3ed6('0x34')]=_[_0x3ed6('0x2e')](_0x190cf8,'name');_0x114afc[_0x3ed6('0x35')]=_[_0x3ed6('0x36')](_0x174f46['query']);_0x114afc['filters']=_[_0x3ed6('0x37')](_0x114afc['model'],_0x114afc[_0x3ed6('0x35')]);_0x5c7401[_0x3ed6('0x38')]=_[_0x3ed6('0x37')](_0x114afc[_0x3ed6('0x34')],qs[_0x3ed6('0x39')](_0x174f46[_0x3ed6('0x35')]['fields']));_0x5c7401[_0x3ed6('0x38')]=_0x5c7401['attributes']['length']?_0x5c7401[_0x3ed6('0x38')]:_0x114afc['model'];if(!_0x174f46[_0x3ed6('0x35')][_0x3ed6('0x3a')](_0x3ed6('0x3b'))){_0x5c7401[_0x3ed6('0x20')]=qs[_0x3ed6('0x20')](_0x174f46[_0x3ed6('0x35')][_0x3ed6('0x20')]);_0x5c7401[_0x3ed6('0x1f')]=qs[_0x3ed6('0x1f')](_0x174f46['query']['offset']);}_0x5c7401[_0x3ed6('0x3c')]=qs[_0x3ed6('0x3d')](_0x174f46['query'][_0x3ed6('0x3d')]);_0x5c7401[_0x3ed6('0x3e')]=qs['filters'](_['pick'](_0x174f46['query'],_0x114afc[_0x3ed6('0x3f')]));if(_0x174f46[_0x3ed6('0x35')]['filter']){_0x5c7401['where']=_[_0x3ed6('0x40')](_0x5c7401[_0x3ed6('0x3e')],{'$or':_['map'](_0x190cf8,function(_0x23eae4){if(_0x23eae4[_0x3ed6('0x32')]!==_0x3ed6('0x41')){var _0x3444b1={};_0x3444b1[_0x23eae4['name']]={'$like':'%'+_0x174f46[_0x3ed6('0x35')][_0x3ed6('0x42')]+'%'};return _0x3444b1;}})});}_0x5c7401=_[_0x3ed6('0x40')]({},_0x5c7401,_0x174f46['options']);var _0x4d55e2={'where':_0x5c7401[_0x3ed6('0x3e')]};return db[_0x3ed6('0x2f')][_0x3ed6('0x1e')](_0x4d55e2)[_0x3ed6('0x25')](function(_0x283b2d){_0x1fc065[_0x3ed6('0x1e')]=_0x283b2d;if(_0x174f46[_0x3ed6('0x35')][_0x3ed6('0x43')]){_0x5c7401[_0x3ed6('0x44')]=[{'all':!![]}];}return db[_0x3ed6('0x2f')][_0x3ed6('0x45')](_0x5c7401);})[_0x3ed6('0x25')](function(_0x15f6c7){_0x1fc065[_0x3ed6('0x46')]=_0x15f6c7;return _0x1fc065;})['then'](respondWithFilteredResult(_0x1618a1,_0x5c7401))[_0x3ed6('0x47')](handleError(_0x1618a1,null));};exports[_0x3ed6('0x48')]=function(_0xbd5921,_0x334344){var _0x4bb636={'raw':!![],'where':{'id':_0xbd5921[_0x3ed6('0x49')]['id']}},_0x4de28e={};_0x4de28e[_0x3ed6('0x34')]=_[_0x3ed6('0x36')](db['Sound']['rawAttributes']);_0x4de28e['query']=_[_0x3ed6('0x36')](_0xbd5921['query']);_0x4de28e['filters']=_[_0x3ed6('0x37')](_0x4de28e[_0x3ed6('0x34')],_0x4de28e[_0x3ed6('0x35')]);_0x4bb636[_0x3ed6('0x38')]=_[_0x3ed6('0x37')](_0x4de28e[_0x3ed6('0x34')],qs[_0x3ed6('0x39')](_0xbd5921['query'][_0x3ed6('0x39')]));_0x4bb636['attributes']=_0x4bb636[_0x3ed6('0x38')][_0x3ed6('0x4a')]?_0x4bb636['attributes']:_0x4de28e['model'];if(_0xbd5921[_0x3ed6('0x35')][_0x3ed6('0x43')]){_0x4bb636[_0x3ed6('0x44')]=[{'all':!![]}];}_0x4bb636=_['merge']({},_0x4bb636,_0xbd5921[_0x3ed6('0x4b')]);return db[_0x3ed6('0x2f')][_0x3ed6('0x4c')](_0x4bb636)[_0x3ed6('0x25')](handleEntityNotFound(_0x334344,null))['then'](respondWithResult(_0x334344,null))['catch'](handleError(_0x334344,null));};exports['download']=function(_0x53142e,_0x23db00,_0x1bf13f){return db[_0x3ed6('0x2f')][_0x3ed6('0x4c')]({'where':{'id':_0x53142e[_0x3ed6('0x49')]['id']},'attributes':[_0x3ed6('0x2c'),'save_name','converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x23db00,null))[_0x3ed6('0x25')](function(_0x1c0a82){if(_0x1c0a82){if(!fs[_0x3ed6('0x4d')](path['join'](config['root'],_0x3ed6('0x4e'),_0x1c0a82['save_name']+'.'+_0x1c0a82[_0x3ed6('0x4f')]))){throw new db[(_0x3ed6('0x50'))][(_0x3ed6('0x51'))](_0x3ed6('0x52'));}return _0x23db00[_0x3ed6('0x53')](path[_0x3ed6('0x54')](config[_0x3ed6('0x55')],'server/files/sounds/converted',util['format'](_0x3ed6('0x56'),_0x1c0a82['save_name'],_0x1c0a82['converted_format'])),util[_0x3ed6('0x57')](_0x3ed6('0x56'),_0x1c0a82[_0x3ed6('0x2c')],_0x1c0a82[_0x3ed6('0x4f')]));}return null;})[_0x3ed6('0x47')](handleError(_0x23db00,null));};exports[_0x3ed6('0x58')]=function(_0x4d7131,_0x95f54e,_0x1cf56e){var _0x234ff6={'name':path[_0x3ed6('0x59')](_0x4d7131[_0x3ed6('0x5a')][_0x3ed6('0x5b')],path['extname'](_0x4d7131[_0x3ed6('0x5a')]['originalname'])),'save_name':path[_0x3ed6('0x59')](_0x4d7131[_0x3ed6('0x5a')][_0x3ed6('0x5c')],path['extname'](_0x4d7131[_0x3ed6('0x5a')][_0x3ed6('0x5c')])),'original_format':path['extname'](_0x4d7131['file'][_0x3ed6('0x5b')])['substring'](0x1),'converted_format':'wav'};var _0x53e3f6=path[_0x3ed6('0x54')](config[_0x3ed6('0x55')],_0x3ed6('0x5d'),_0x4d7131[_0x3ed6('0x5a')][_0x3ed6('0x5c')]);var _0x352c16=path['join'](config[_0x3ed6('0x55')],'server/files/sounds/converted',util['format']('%s.%s',path[_0x3ed6('0x59')](_0x4d7131['file'][_0x3ed6('0x5c')],path[_0x3ed6('0x5e')](_0x4d7131[_0x3ed6('0x5a')][_0x3ed6('0x5c')])),_0x234ff6[_0x3ed6('0x4f')]));logger[_0x3ed6('0x5f')](_0x3ed6('0x60'),_0x53e3f6);logger[_0x3ed6('0x5f')](_0x3ed6('0x61'),_0x352c16);try{fs['chmodSync'](_0x53e3f6,parseInt('0777',0x8));var _0x2d322a=sox[_0x3ed6('0x62')](_0x53e3f6,_0x352c16,{'sampleRate':0x1f40,'format':_0x3ed6('0x63'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2d322a['on'](_0x3ed6('0x2a'),function(_0x45a93f){fs[_0x3ed6('0x64')](_0x53e3f6);_0x95f54e[_0x3ed6('0x1b')](0x1f4)['send'](_0x45a93f);});_0x2d322a['on']('src',function(_0x5ff82d){_0x234ff6[_0x3ed6('0x65')]=isNaN(_0x5ff82d[_0x3ed6('0x66')])?null:_0x5ff82d[_0x3ed6('0x66')]*0x3e8;_0x234ff6[_0x3ed6('0x67')]=isNaN(_0x5ff82d['sampleCount'])?null:_0x5ff82d[_0x3ed6('0x68')];_0x234ff6[_0x3ed6('0x69')]=isNaN(_0x5ff82d[_0x3ed6('0x6a')])?null:_0x5ff82d[_0x3ed6('0x6a')];_0x234ff6['original_bitRate']=isNaN(_0x5ff82d[_0x3ed6('0x6b')])?null:_0x5ff82d['bitRate'];_0x234ff6['original_sampleRate']=isNaN(_0x5ff82d[_0x3ed6('0x6c')])?null:_0x5ff82d['sampleRate'];});_0x2d322a['on']('dest',function(_0x38df43){_0x234ff6[_0x3ed6('0x6d')]=isNaN(_0x38df43[_0x3ed6('0x66')])?null:_0x38df43[_0x3ed6('0x66')]*0x3e8;_0x234ff6[_0x3ed6('0x6e')]=isNaN(_0x38df43[_0x3ed6('0x68')])?null:_0x38df43['sampleCount'];_0x234ff6[_0x3ed6('0x6f')]=isNaN(_0x38df43['channelCount'])?null:_0x38df43[_0x3ed6('0x6a')];_0x234ff6[_0x3ed6('0x70')]=isNaN(_0x38df43[_0x3ed6('0x6b')])?null:_0x38df43[_0x3ed6('0x6b')];_0x234ff6[_0x3ed6('0x71')]=isNaN(_0x38df43['sampleRate'])?null:_0x38df43[_0x3ed6('0x6c')];});_0x2d322a['on'](_0x3ed6('0x1c'),function(){fs[_0x3ed6('0x72')](_0x352c16,parseInt(_0x3ed6('0x73'),0x8));return db[_0x3ed6('0x2f')][_0x3ed6('0x58')](_0x234ff6)[_0x3ed6('0x25')](function(_0x55d3cf){var _0x5276f6={'role':_0x4d7131['body'][_0x3ed6('0x74')],'userProfileId':_0x4d7131[_0x3ed6('0x75')][_0x3ed6('0x76')]};if(!_0x5276f6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5276f6['role']===_0x3ed6('0x77')){var _0x11f9f1=_0x55d3cf[_0x3ed6('0x27')]({'plain':!![]});return db[_0x3ed6('0x78')][_0x3ed6('0x4c')]({'where':{'name':_0x3ed6('0x28'),'userProfileId':_0x5276f6['userProfileId']},'raw':!![]})[_0x3ed6('0x25')](function(_0x6fbb21){if(_0x6fbb21&&_0x6fbb21[_0x3ed6('0x79')]===0x0){return db[_0x3ed6('0x7a')]['create']({'name':_0x11f9f1[_0x3ed6('0x2c')],'resourceId':_0x11f9f1['id'],'type':_0x6fbb21['name'],'sectionId':_0x6fbb21['id']},{})[_0x3ed6('0x25')](function(){return _0x55d3cf;});}else{return _0x55d3cf;}})[_0x3ed6('0x47')](function(_0x1b3809){logger[_0x3ed6('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b3809);throw _0x1b3809;});}return _0x55d3cf;})['then'](respondWithResult(_0x95f54e,null))[_0x3ed6('0x47')](handleError(_0x95f54e,null));});_0x2d322a[_0x3ed6('0x7b')]();}catch(_0x2534ad){_0x95f54e[_0x3ed6('0x1b')](0x1f4)['send'](_0x2534ad);}};exports[_0x3ed6('0x24')]=function(_0x315fc7,_0x2afbc4,_0x34a9df){return db[_0x3ed6('0x2f')][_0x3ed6('0x4c')]({'where':{'id':_0x315fc7[_0x3ed6('0x49')]['id']}})[_0x3ed6('0x25')](handleEntityNotFound(_0x2afbc4,null))[_0x3ed6('0x25')](saveUpdates(_[_0x3ed6('0x7c')](_0x315fc7[_0x3ed6('0x75')],[_0x3ed6('0x2c'),_0x3ed6('0x7d')]),null))['then'](respondWithResult(_0x2afbc4,null))['catch'](handleError(_0x2afbc4,null));};exports['delete']=function(_0x3ebe64,_0x22997f,_0x55b47d){return db[_0x3ed6('0x2f')][_0x3ed6('0x4c')]({'where':{'id':_0x3ebe64[_0x3ed6('0x49')]['id']}})[_0x3ed6('0x25')](function(_0x510986){if(_0x510986){return _0x510986[_0x3ed6('0x26')]();}})[_0x3ed6('0x25')](function(_0x4a2b84){var _0x2d6568=path['join'](config[_0x3ed6('0x55')],_0x3ed6('0x5d'),util[_0x3ed6('0x57')](_0x3ed6('0x56'),_0x4a2b84['save_name'],_0x4a2b84[_0x3ed6('0x7e')]));var _0x5ed9b7=path[_0x3ed6('0x54')](config[_0x3ed6('0x55')],'server/files/sounds/converted',util[_0x3ed6('0x57')](_0x3ed6('0x56'),_0x4a2b84['save_name'],_0x4a2b84[_0x3ed6('0x4f')]));fs[_0x3ed6('0x64')](_0x2d6568);fs[_0x3ed6('0x64')](_0x5ed9b7);return _0x4a2b84;})[_0x3ed6('0x25')](function(_0x594a81){if(_0x594a81){return _0x22997f[_0x3ed6('0x1b')](0xcc)[_0x3ed6('0x1c')]();}})[_0x3ed6('0x25')](handleEntityNotFound(_0x22997f,null))[_0x3ed6('0x47')](handleError(_0x22997f,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 462d6c3..e8e2e24 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 _0x6c83=['rimraf','../../config/environment','./sound.attributes','define','Sound','tools_sounds','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x5d219d,_0x1b1e9c){var _0xd22c88=function(_0x4ab87e){while(--_0x4ab87e){_0x5d219d['push'](_0x5d219d['shift']());}};_0xd22c88(++_0x1b1e9c);}(_0x6c83,0x1f2));var _0x36c8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6c83[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x36c8('0x0'));var util=require('util');var logger=require(_0x36c8('0x1'))(_0x36c8('0x2'));var moment=require(_0x36c8('0x3'));var BPromise=require(_0x36c8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x36c8('0x5'));var rimraf=require(_0x36c8('0x6'));var config=require(_0x36c8('0x7'));var attributes=require(_0x36c8('0x8'));module['exports']=function(_0x4aaa62,_0x2d3014){return _0x4aaa62[_0x36c8('0x9')](_0x36c8('0xa'),attributes,{'tableName':_0x36c8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa857=['./sound.attributes','exports','Sound','lodash','util','api','moment','request-promise'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0xa857,0x1bb));var _0x7a85=function(_0x472354,_0x42d41b){_0x472354=_0x472354-0x0;var _0xd4b37e=_0xa857[_0x472354];return _0xd4b37e;};'use strict';var _=require(_0x7a85('0x0'));var util=require(_0x7a85('0x1'));var logger=require('../../config/logger')(_0x7a85('0x2'));var moment=require(_0x7a85('0x3'));var BPromise=require('bluebird');var rp=require(_0x7a85('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7a85('0x5'));module[_0x7a85('0x6')]=function(_0x4cba2a,_0x2b52b9){return _0x4cba2a['define'](_0x7a85('0x7'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 183705e..0dbc82f 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 _0xc5b8=['Sound,\x20%s,\x20%s,\x20%s','error','message','result','ShowSound','find','options','raw','where','attributes','include','map','model','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc5b8,0x1bc));var _0x8c5b=function(_0x4aac5a,_0x15b04c){_0x4aac5a=_0x4aac5a-0x0;var _0x42e7bc=_0xc5b8[_0x4aac5a];return _0x42e7bc;};'use strict';var _=require(_0x8c5b('0x0'));var util=require(_0x8c5b('0x1'));var moment=require(_0x8c5b('0x2'));var BPromise=require(_0x8c5b('0x3'));var rs=require(_0x8c5b('0x4'));var fs=require('fs');var Redis=require(_0x8c5b('0x5'));var db=require(_0x8c5b('0x6'))['db'];var utils=require(_0x8c5b('0x7'));var logger=require(_0x8c5b('0x8'))(_0x8c5b('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8c5b('0xa')][_0x8c5b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32b155,_0x203bbe,_0x29c740){return new BPromise(function(_0x41cf92,_0x22bd3b){return client[_0x8c5b('0xc')](_0x32b155,_0x29c740)[_0x8c5b('0xd')](function(_0x4acfa4){logger[_0x8c5b('0xe')](_0x8c5b('0xf'),_0x203bbe,_0x8c5b('0x10'));logger[_0x8c5b('0x11')](_0x8c5b('0x12'),_0x203bbe,_0x8c5b('0x10'),JSON['stringify'](_0x4acfa4));if(_0x4acfa4[_0x8c5b('0x13')]){if(_0x4acfa4[_0x8c5b('0x13')]['code']===0x1f4){logger[_0x8c5b('0x13')](_0x8c5b('0xf'),_0x203bbe,_0x4acfa4[_0x8c5b('0x13')][_0x8c5b('0x14')]);return _0x22bd3b(_0x4acfa4[_0x8c5b('0x13')][_0x8c5b('0x14')]);}logger[_0x8c5b('0x13')](_0x8c5b('0xf'),_0x203bbe,_0x4acfa4[_0x8c5b('0x13')][_0x8c5b('0x14')]);return _0x41cf92(_0x4acfa4['error'][_0x8c5b('0x14')]);}else{logger[_0x8c5b('0xe')]('Sound,\x20%s,\x20%s',_0x203bbe,_0x8c5b('0x10'));_0x41cf92(_0x4acfa4[_0x8c5b('0x15')]['message']);}})['catch'](function(_0x446cd4){logger[_0x8c5b('0x13')](_0x8c5b('0xf'),_0x203bbe,_0x446cd4);_0x22bd3b(_0x446cd4);});});}exports[_0x8c5b('0x16')]=function(_0x13c90b){var _0x241553=this;return new Promise(function(_0x3bc136,_0x9d209){return db['Sound'][_0x8c5b('0x17')]({'raw':_0x13c90b[_0x8c5b('0x18')]?_0x13c90b[_0x8c5b('0x18')][_0x8c5b('0x19')]===undefined?!![]:![]:!![],'where':_0x13c90b[_0x8c5b('0x18')]?_0x13c90b[_0x8c5b('0x18')][_0x8c5b('0x1a')]||null:null,'attributes':_0x13c90b[_0x8c5b('0x18')]?_0x13c90b[_0x8c5b('0x18')][_0x8c5b('0x1b')]||null:null,'include':_0x13c90b[_0x8c5b('0x18')]?_0x13c90b[_0x8c5b('0x18')][_0x8c5b('0x1c')]?_[_0x8c5b('0x1d')](_0x13c90b[_0x8c5b('0x18')][_0x8c5b('0x1c')],function(_0x353ef6){return{'model':db[_0x353ef6[_0x8c5b('0x1e')]],'as':_0x353ef6['as'],'attributes':_0x353ef6[_0x8c5b('0x1b')],'include':_0x353ef6[_0x8c5b('0x1c')]?_[_0x8c5b('0x1d')](_0x353ef6[_0x8c5b('0x1c')],function(_0x4c30e3){return{'model':db[_0x4c30e3[_0x8c5b('0x1e')]],'as':_0x4c30e3['as'],'attributes':_0x4c30e3[_0x8c5b('0x1b')],'include':_0x4c30e3[_0x8c5b('0x1c')]?_[_0x8c5b('0x1d')](_0x4c30e3[_0x8c5b('0x1c')],function(_0x36fbd4){return{'model':db[_0x36fbd4[_0x8c5b('0x1e')]],'as':_0x36fbd4['as'],'attributes':_0x36fbd4[_0x8c5b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8c5b('0xd')](function(_0x529563){logger[_0x8c5b('0xe')](_0x8c5b('0x16'),_0x13c90b);logger[_0x8c5b('0x11')](_0x8c5b('0x16'),_0x13c90b,JSON[_0x8c5b('0x1f')](_0x529563));_0x3bc136(_0x529563);})[_0x8c5b('0x20')](function(_0x2e62ae){logger[_0x8c5b('0x13')](_0x8c5b('0x16'),_0x2e62ae[_0x8c5b('0x14')],_0x13c90b);_0x9d209(_0x241553[_0x8c5b('0x13')](0x1f4,_0x2e62ae[_0x8c5b('0x14')]));});});}; \ No newline at end of file +var _0x9639=['model','attributes','catch','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSound','Sound','options','raw','include','map'];(function(_0x547e38,_0x58a4e6){var _0x4d5ece=function(_0x5bc03e){while(--_0x5bc03e){_0x547e38['push'](_0x547e38['shift']());}};_0x4d5ece(++_0x58a4e6);}(_0x9639,0x15f));var _0x9963=function(_0x2ff81a,_0x5695a7){_0x2ff81a=_0x2ff81a-0x0;var _0x434407=_0x9639[_0x2ff81a];return _0x434407;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9963('0x0'));var BPromise=require('bluebird');var rs=require(_0x9963('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9963('0x2'));var logger=require(_0x9963('0x3'))(_0x9963('0x4'));var config=require(_0x9963('0x5'));var jayson=require(_0x9963('0x6'));var client=jayson['client'][_0x9963('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xb58e32,_0x2c3655,_0x2c6659){return new BPromise(function(_0x1d14aa,_0x4e8128){return client[_0x9963('0x8')](_0xb58e32,_0x2c6659)[_0x9963('0x9')](function(_0x44dac4){logger[_0x9963('0xa')](_0x9963('0xb'),_0x2c3655,_0x9963('0xc'));logger[_0x9963('0xd')](_0x9963('0xe'),_0x2c3655,_0x9963('0xc'),JSON[_0x9963('0xf')](_0x44dac4));if(_0x44dac4[_0x9963('0x10')]){if(_0x44dac4[_0x9963('0x10')][_0x9963('0x11')]===0x1f4){logger[_0x9963('0x10')](_0x9963('0xb'),_0x2c3655,_0x44dac4[_0x9963('0x10')]['message']);return _0x4e8128(_0x44dac4[_0x9963('0x10')][_0x9963('0x12')]);}logger[_0x9963('0x10')](_0x9963('0xb'),_0x2c3655,_0x44dac4[_0x9963('0x10')][_0x9963('0x12')]);return _0x1d14aa(_0x44dac4[_0x9963('0x10')][_0x9963('0x12')]);}else{logger[_0x9963('0xa')]('Sound,\x20%s,\x20%s',_0x2c3655,_0x9963('0xc'));_0x1d14aa(_0x44dac4[_0x9963('0x13')][_0x9963('0x12')]);}})['catch'](function(_0x5a0f86){logger['error']('Sound,\x20%s,\x20%s',_0x2c3655,_0x5a0f86);_0x4e8128(_0x5a0f86);});});}exports[_0x9963('0x14')]=function(_0x464b02){var _0x21bc33=this;return new Promise(function(_0x361586,_0x38a231){return db[_0x9963('0x15')]['find']({'raw':_0x464b02[_0x9963('0x16')]?_0x464b02['options'][_0x9963('0x17')]===undefined?!![]:![]:!![],'where':_0x464b02[_0x9963('0x16')]?_0x464b02[_0x9963('0x16')]['where']||null:null,'attributes':_0x464b02[_0x9963('0x16')]?_0x464b02[_0x9963('0x16')]['attributes']||null:null,'include':_0x464b02[_0x9963('0x16')]?_0x464b02[_0x9963('0x16')][_0x9963('0x18')]?_[_0x9963('0x19')](_0x464b02[_0x9963('0x16')][_0x9963('0x18')],function(_0x23933e){return{'model':db[_0x23933e[_0x9963('0x1a')]],'as':_0x23933e['as'],'attributes':_0x23933e[_0x9963('0x1b')],'include':_0x23933e['include']?_[_0x9963('0x19')](_0x23933e[_0x9963('0x18')],function(_0x2e39f6){return{'model':db[_0x2e39f6['model']],'as':_0x2e39f6['as'],'attributes':_0x2e39f6['attributes'],'include':_0x2e39f6[_0x9963('0x18')]?_[_0x9963('0x19')](_0x2e39f6[_0x9963('0x18')],function(_0x157569){return{'model':db[_0x157569['model']],'as':_0x157569['as'],'attributes':_0x157569['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x382fae){logger['info'](_0x9963('0x14'),_0x464b02);logger[_0x9963('0xd')](_0x9963('0x14'),_0x464b02,JSON[_0x9963('0xf')](_0x382fae));_0x361586(_0x382fae);})[_0x9963('0x1c')](function(_0x3bca35){logger['error'](_0x9963('0x14'),_0x3bca35['message'],_0x464b02);_0x38a231(_0x21bc33[_0x9963('0x10')](0x1f4,_0x3bca35[_0x9963('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 1d38c9d..594f34b 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 _0x1982=['/:id','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','index','isAuthenticated','show','post','create','put'];(function(_0x59aad5,_0x7350b3){var _0x3e30f9=function(_0x33a693){while(--_0x33a693){_0x59aad5['push'](_0x59aad5['shift']());}};_0x3e30f9(++_0x7350b3);}(_0x1982,0xd5));var _0x2198=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1982[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2198('0x0'));var util=require('util');var path=require(_0x2198('0x1'));var timeout=require(_0x2198('0x2'));var express=require(_0x2198('0x3'));var router=express[_0x2198('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2198('0x5'));var config=require(_0x2198('0x6'));var controller=require(_0x2198('0x7'));router[_0x2198('0x8')]('/',auth['isAuthenticated'](),controller[_0x2198('0x9')]);router[_0x2198('0x8')]('/:id',auth[_0x2198('0xa')](),controller[_0x2198('0xb')]);router[_0x2198('0xc')]('/',auth[_0x2198('0xa')](),controller[_0x2198('0xd')]);router[_0x2198('0xe')](_0x2198('0xf'),auth[_0x2198('0xa')](),controller[_0x2198('0x10')]);router[_0x2198('0x11')](_0x2198('0xf'),auth[_0x2198('0xa')](),controller['destroy']);module[_0x2198('0x12')]=router; \ No newline at end of file +var _0xc52e=['index','get','show','post','create','put','update','delete','/:id','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xc52e,0x196));var _0xec52=function(_0x23a82e,_0x2d8bb9){_0x23a82e=_0x23a82e-0x0;var _0x3e8d19=_0xc52e[_0x23a82e];return _0x3e8d19;};'use strict';var multer=require(_0xec52('0x0'));var util=require(_0xec52('0x1'));var path=require('path');var timeout=require(_0xec52('0x2'));var express=require(_0xec52('0x3'));var router=express[_0xec52('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xec52('0x5'));var config=require(_0xec52('0x6'));var controller=require('./squareMessage.controller');router['get']('/',auth[_0xec52('0x7')](),controller[_0xec52('0x8')]);router[_0xec52('0x9')]('/:id',auth[_0xec52('0x7')](),controller[_0xec52('0xa')]);router[_0xec52('0xb')]('/',auth['isAuthenticated'](),controller[_0xec52('0xc')]);router[_0xec52('0xd')]('/:id',auth[_0xec52('0x7')](),controller[_0xec52('0xe')]);router[_0xec52('0xf')](_0xec52('0x10'),auth[_0xec52('0x7')](),controller[_0xec52('0x11')]);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 4a8b86a..4ca4931 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 _0xe088=['medium','out','sequelize','TEXT'];(function(_0x2ec695,_0x3ff6e9){var _0x3b4614=function(_0x2601f3){while(--_0x2601f3){_0x2ec695['push'](_0x2ec695['shift']());}};_0x3b4614(++_0x3ff6e9);}(_0xe088,0x152));var _0x8e08=function(_0x184759,_0x1cc38a){_0x184759=_0x184759-0x0;var _0xf26d5f=_0xe088[_0x184759];return _0xf26d5f;};'use strict';var Sequelize=require(_0x8e08('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x8e08('0x1')](_0x8e08('0x2')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x8e08('0x3')),'defaultValue':_0x8e08('0x3'),'allowNull':![]}}; \ No newline at end of file +var _0xb743=['ENUM','out','exports','TEXT','medium'];(function(_0xf5dbed,_0x28884b){var _0x1b102f=function(_0x198396){while(--_0x198396){_0xf5dbed['push'](_0xf5dbed['shift']());}};_0x1b102f(++_0x28884b);}(_0xb743,0xa7));var _0x3b74=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xb743[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require('sequelize');module[_0x3b74('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x3b74('0x1')](_0x3b74('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x3b74('0x3')]('in',_0x3b74('0x4')),'defaultValue':_0x3b74('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 bd7784d..74a0301 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 _0x9ed4=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','SquareMessage','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','offset','sort','where','pick','merge','filter','options','includeAll','include','rows','catch','find','create','body','html-pdf','eml-format','rimraf'];(function(_0x18f0bd,_0x2675c3){var _0x314678=function(_0x558bff){while(--_0x558bff){_0x18f0bd['push'](_0x18f0bd['shift']());}};_0x314678(++_0x2675c3);}(_0x9ed4,0x1a7));var _0x49ed=function(_0x2ce794,_0x32c04c){_0x2ce794=_0x2ce794-0x0;var _0x1c3067=_0x9ed4[_0x2ce794];return _0x1c3067;};'use strict';var pdf=require(_0x49ed('0x0'));var emlformat=require(_0x49ed('0x1'));var rimraf=require(_0x49ed('0x2'));var zipdir=require(_0x49ed('0x3'));var jsonpatch=require(_0x49ed('0x4'));var rp=require(_0x49ed('0x5'));var moment=require(_0x49ed('0x6'));var BPromise=require(_0x49ed('0x7'));var Mustache=require(_0x49ed('0x8'));var util=require(_0x49ed('0x9'));var path=require(_0x49ed('0xa'));var sox=require('sox');var csv=require(_0x49ed('0xb'));var ejs=require(_0x49ed('0xc'));var fs=require('fs');var _=require(_0x49ed('0xd'));var squel=require(_0x49ed('0xe'));var crypto=require(_0x49ed('0xf'));var jsforce=require(_0x49ed('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x49ed('0x11'));var Redis=require('ioredis');var authService=require(_0x49ed('0x12'));var qs=require(_0x49ed('0x13'));var as=require(_0x49ed('0x14'));var hardwareService=require(_0x49ed('0x15'));var logger=require(_0x49ed('0x16'))(_0x49ed('0x17'));var utils=require(_0x49ed('0x18'));var config=require(_0x49ed('0x19'));var db=require(_0x49ed('0x1a'))['db'];function respondWithStatusCode(_0x318263,_0x45701a){_0x45701a=_0x45701a||0xcc;return function(_0xfa7166){if(_0xfa7166){return _0x318263[_0x49ed('0x1b')](_0x45701a);}return _0x318263[_0x49ed('0x1c')](_0x45701a)['end']();};}function respondWithResult(_0x34bd88,_0x243361){_0x243361=_0x243361||0xc8;return function(_0x1f187b){if(_0x1f187b){return _0x34bd88[_0x49ed('0x1c')](_0x243361)['json'](_0x1f187b);}};}function respondWithFilteredResult(_0x5c1897,_0xb263e1){return function(_0x511674){if(_0x511674){var _0x5b8e91=_0x511674[_0x49ed('0x1d')],_0x3b50aa=_0xb263e1['offset'],_0xed3cc1=_0xb263e1['offset']+_0xb263e1[_0x49ed('0x1e')],_0x3e78a5;if(_0xed3cc1>=_0x5b8e91){_0xed3cc1=_0x5b8e91;_0x3e78a5=0xc8;}else{_0x3e78a5=0xce;}_0x5c1897[_0x49ed('0x1c')](_0x3e78a5);return _0x5c1897[_0x49ed('0x1f')](_0x49ed('0x20'),_0x3b50aa+'-'+_0xed3cc1+'/'+_0x5b8e91)[_0x49ed('0x21')](_0x511674);}return null;};}function patchUpdates(_0x2e72a8){return function(_0x438e88){try{jsonpatch[_0x49ed('0x22')](_0x438e88,_0x2e72a8,!![]);}catch(_0x42cbbf){return BPromise[_0x49ed('0x23')](_0x42cbbf);}return _0x438e88[_0x49ed('0x24')]();};}function saveUpdates(_0x2e5b87,_0x496661){return function(_0xd30fb1){if(_0xd30fb1){return _0xd30fb1[_0x49ed('0x25')](_0x2e5b87)[_0x49ed('0x26')](function(_0x578555){return _0x578555;});}return null;};}function removeEntity(_0x313e3b,_0x4c1268){return function(_0x26809c){if(_0x26809c){return _0x26809c[_0x49ed('0x27')]()[_0x49ed('0x26')](function(){_0x313e3b[_0x49ed('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cb36f,_0x577c0a){return function(_0x42420f){if(!_0x42420f){_0x1cb36f[_0x49ed('0x1b')](0x194);}return _0x42420f;};}function handleError(_0x4c9e84,_0x34c176){_0x34c176=_0x34c176||0x1f4;return function(_0xd731b3){logger['error'](_0xd731b3[_0x49ed('0x28')]);if(_0xd731b3[_0x49ed('0x29')]){delete _0xd731b3[_0x49ed('0x29')];}_0x4c9e84[_0x49ed('0x1c')](_0x34c176)[_0x49ed('0x2a')](_0xd731b3);};}exports[_0x49ed('0x2b')]=function(_0x4eb822,_0x44c3f0){var _0x2cf518={},_0x1ed088={},_0x30c8e2={'count':0x0,'rows':[]};var _0x5467fa=_[_0x49ed('0x2c')](db[_0x49ed('0x2d')][_0x49ed('0x2e')],function(_0x2b1ba4){return{'name':_0x2b1ba4['fieldName'],'type':_0x2b1ba4[_0x49ed('0x2f')][_0x49ed('0x30')]};});_0x1ed088[_0x49ed('0x31')]=_[_0x49ed('0x2c')](_0x5467fa,_0x49ed('0x29'));_0x1ed088['query']=_[_0x49ed('0x32')](_0x4eb822[_0x49ed('0x33')]);_0x1ed088[_0x49ed('0x34')]=_[_0x49ed('0x35')](_0x1ed088[_0x49ed('0x31')],_0x1ed088['query']);_0x2cf518[_0x49ed('0x36')]=_[_0x49ed('0x35')](_0x1ed088[_0x49ed('0x31')],qs[_0x49ed('0x37')](_0x4eb822['query'][_0x49ed('0x37')]));_0x2cf518[_0x49ed('0x36')]=_0x2cf518[_0x49ed('0x36')][_0x49ed('0x38')]?_0x2cf518[_0x49ed('0x36')]:_0x1ed088[_0x49ed('0x31')];if(!_0x4eb822[_0x49ed('0x33')]['hasOwnProperty']('nolimit')){_0x2cf518[_0x49ed('0x1e')]=qs[_0x49ed('0x1e')](_0x4eb822[_0x49ed('0x33')][_0x49ed('0x1e')]);_0x2cf518[_0x49ed('0x39')]=qs[_0x49ed('0x39')](_0x4eb822[_0x49ed('0x33')][_0x49ed('0x39')]);}_0x2cf518['order']=qs['sort'](_0x4eb822['query'][_0x49ed('0x3a')]);_0x2cf518[_0x49ed('0x3b')]=qs['filters'](_[_0x49ed('0x3c')](_0x4eb822[_0x49ed('0x33')],_0x1ed088[_0x49ed('0x34')]));if(_0x4eb822['query']['filter']){_0x2cf518[_0x49ed('0x3b')]=_[_0x49ed('0x3d')](_0x2cf518[_0x49ed('0x3b')],{'$or':_['map'](_0x5467fa,function(_0xa87505){if(_0xa87505[_0x49ed('0x2f')]!=='VIRTUAL'){var _0x210140={};_0x210140[_0xa87505['name']]={'$like':'%'+_0x4eb822[_0x49ed('0x33')][_0x49ed('0x3e')]+'%'};return _0x210140;}})});}_0x2cf518=_[_0x49ed('0x3d')]({},_0x2cf518,_0x4eb822[_0x49ed('0x3f')]);var _0x3fc7e6={'where':_0x2cf518[_0x49ed('0x3b')]};return db[_0x49ed('0x2d')][_0x49ed('0x1d')](_0x3fc7e6)[_0x49ed('0x26')](function(_0x152873){_0x30c8e2[_0x49ed('0x1d')]=_0x152873;if(_0x4eb822[_0x49ed('0x33')][_0x49ed('0x40')]){_0x2cf518[_0x49ed('0x41')]=[{'all':!![]}];}return db[_0x49ed('0x2d')]['findAll'](_0x2cf518);})[_0x49ed('0x26')](function(_0x54e783){_0x30c8e2[_0x49ed('0x42')]=_0x54e783;return _0x30c8e2;})[_0x49ed('0x26')](respondWithFilteredResult(_0x44c3f0,_0x2cf518))[_0x49ed('0x43')](handleError(_0x44c3f0,null));};exports['show']=function(_0x1cd80e,_0x1c5505){var _0xb020aa={'raw':!![],'where':{'id':_0x1cd80e['params']['id']}},_0x591242={};_0x591242[_0x49ed('0x31')]=_['keys'](db[_0x49ed('0x2d')][_0x49ed('0x2e')]);_0x591242[_0x49ed('0x33')]=_[_0x49ed('0x32')](_0x1cd80e[_0x49ed('0x33')]);_0x591242[_0x49ed('0x34')]=_['intersection'](_0x591242[_0x49ed('0x31')],_0x591242[_0x49ed('0x33')]);_0xb020aa['attributes']=_[_0x49ed('0x35')](_0x591242[_0x49ed('0x31')],qs['fields'](_0x1cd80e['query'][_0x49ed('0x37')]));_0xb020aa[_0x49ed('0x36')]=_0xb020aa[_0x49ed('0x36')][_0x49ed('0x38')]?_0xb020aa['attributes']:_0x591242[_0x49ed('0x31')];if(_0x1cd80e[_0x49ed('0x33')]['includeAll']){_0xb020aa[_0x49ed('0x41')]=[{'all':!![]}];}_0xb020aa=_[_0x49ed('0x3d')]({},_0xb020aa,_0x1cd80e['options']);return db[_0x49ed('0x2d')][_0x49ed('0x44')](_0xb020aa)[_0x49ed('0x26')](handleEntityNotFound(_0x1c5505,null))[_0x49ed('0x26')](respondWithResult(_0x1c5505,null))[_0x49ed('0x43')](handleError(_0x1c5505,null));};exports[_0x49ed('0x45')]=function(_0x437513,_0x40ee79){return db[_0x49ed('0x2d')]['create'](_0x437513[_0x49ed('0x46')],{})[_0x49ed('0x26')](respondWithResult(_0x40ee79,0xc9))[_0x49ed('0x43')](handleError(_0x40ee79,null));};exports[_0x49ed('0x25')]=function(_0x81fdcd,_0x37ce98){if(_0x81fdcd[_0x49ed('0x46')]['id']){delete _0x81fdcd['body']['id'];}return db[_0x49ed('0x2d')]['find']({'where':{'id':_0x81fdcd['params']['id']}})[_0x49ed('0x26')](handleEntityNotFound(_0x37ce98,null))[_0x49ed('0x26')](saveUpdates(_0x81fdcd[_0x49ed('0x46')],null))[_0x49ed('0x26')](respondWithResult(_0x37ce98,null))['catch'](handleError(_0x37ce98,null));};exports[_0x49ed('0x27')]=function(_0x51086d,_0x43ef2a){return db['SquareMessage'][_0x49ed('0x44')]({'where':{'id':_0x51086d['params']['id']}})[_0x49ed('0x26')](handleEntityNotFound(_0x43ef2a,null))[_0x49ed('0x26')](removeEntity(_0x43ef2a,null))[_0x49ed('0x43')](handleError(_0x43ef2a,null));}; \ No newline at end of file +var _0x0a48=['merge','VIRTUAL','includeAll','include','rows','catch','options','find','create','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter'];(function(_0x4b64f9,_0x34a402){var _0x1589cb=function(_0x4793e7){while(--_0x4793e7){_0x4b64f9['push'](_0x4b64f9['shift']());}};_0x1589cb(++_0x34a402);}(_0x0a48,0x95));var _0x80a4=function(_0x4a5570,_0x103d7b){_0x4a5570=_0x4a5570-0x0;var _0x338d1d=_0x0a48[_0x4a5570];return _0x338d1d;};'use strict';var pdf=require(_0x80a4('0x0'));var emlformat=require(_0x80a4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x80a4('0x2'));var jsonpatch=require(_0x80a4('0x3'));var rp=require(_0x80a4('0x4'));var moment=require(_0x80a4('0x5'));var BPromise=require(_0x80a4('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x80a4('0x7'));var sox=require(_0x80a4('0x8'));var csv=require(_0x80a4('0x9'));var ejs=require(_0x80a4('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x80a4('0xb'));var crypto=require('crypto');var jsforce=require(_0x80a4('0xc'));var deskjs=require(_0x80a4('0xd'));var toCsv=require(_0x80a4('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x80a4('0xe'));var authService=require(_0x80a4('0xf'));var qs=require(_0x80a4('0x10'));var as=require(_0x80a4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x80a4('0x12'))('api');var utils=require(_0x80a4('0x13'));var config=require('../../config/environment');var db=require(_0x80a4('0x14'))['db'];function respondWithStatusCode(_0x23feb6,_0x5228f6){_0x5228f6=_0x5228f6||0xcc;return function(_0x3a967e){if(_0x3a967e){return _0x23feb6[_0x80a4('0x15')](_0x5228f6);}return _0x23feb6[_0x80a4('0x16')](_0x5228f6)[_0x80a4('0x17')]();};}function respondWithResult(_0x17768b,_0x3d6d38){_0x3d6d38=_0x3d6d38||0xc8;return function(_0x35ce60){if(_0x35ce60){return _0x17768b['status'](_0x3d6d38)['json'](_0x35ce60);}};}function respondWithFilteredResult(_0x580887,_0x322b84){return function(_0x2dcc83){if(_0x2dcc83){var _0x24485a=_0x2dcc83[_0x80a4('0x18')],_0x55923c=_0x322b84[_0x80a4('0x19')],_0x125654=_0x322b84[_0x80a4('0x19')]+_0x322b84[_0x80a4('0x1a')],_0x46aeab;if(_0x125654>=_0x24485a){_0x125654=_0x24485a;_0x46aeab=0xc8;}else{_0x46aeab=0xce;}_0x580887[_0x80a4('0x16')](_0x46aeab);return _0x580887[_0x80a4('0x1b')](_0x80a4('0x1c'),_0x55923c+'-'+_0x125654+'/'+_0x24485a)[_0x80a4('0x1d')](_0x2dcc83);}return null;};}function patchUpdates(_0x3ac186){return function(_0x23ac8b){try{jsonpatch[_0x80a4('0x1e')](_0x23ac8b,_0x3ac186,!![]);}catch(_0x2ddfd2){return BPromise[_0x80a4('0x1f')](_0x2ddfd2);}return _0x23ac8b['save']();};}function saveUpdates(_0x1ceaec,_0x26c3d3){return function(_0x512a5f){if(_0x512a5f){return _0x512a5f[_0x80a4('0x20')](_0x1ceaec)[_0x80a4('0x21')](function(_0x4a0513){return _0x4a0513;});}return null;};}function removeEntity(_0x3e5b08,_0x5b110c){return function(_0x17ec99){if(_0x17ec99){return _0x17ec99[_0x80a4('0x22')]()[_0x80a4('0x21')](function(){_0x3e5b08[_0x80a4('0x16')](0xcc)[_0x80a4('0x17')]();});}};}function handleEntityNotFound(_0x88de42,_0xd08602){return function(_0x6e715a){if(!_0x6e715a){_0x88de42['sendStatus'](0x194);}return _0x6e715a;};}function handleError(_0x14f0aa,_0x411bfb){_0x411bfb=_0x411bfb||0x1f4;return function(_0x239ef6){logger['error'](_0x239ef6['stack']);if(_0x239ef6[_0x80a4('0x23')]){delete _0x239ef6[_0x80a4('0x23')];}_0x14f0aa['status'](_0x411bfb)[_0x80a4('0x24')](_0x239ef6);};}exports[_0x80a4('0x25')]=function(_0x2b68c1,_0x441a87){var _0x3954f0={},_0x472668={},_0x1b0834={'count':0x0,'rows':[]};var _0x57822c=_[_0x80a4('0x26')](db[_0x80a4('0x27')][_0x80a4('0x28')],function(_0xe2c292){return{'name':_0xe2c292[_0x80a4('0x29')],'type':_0xe2c292[_0x80a4('0x2a')][_0x80a4('0x2b')]};});_0x472668[_0x80a4('0x2c')]=_[_0x80a4('0x26')](_0x57822c,_0x80a4('0x23'));_0x472668[_0x80a4('0x2d')]=_[_0x80a4('0x2e')](_0x2b68c1[_0x80a4('0x2d')]);_0x472668['filters']=_['intersection'](_0x472668['model'],_0x472668[_0x80a4('0x2d')]);_0x3954f0[_0x80a4('0x2f')]=_[_0x80a4('0x30')](_0x472668[_0x80a4('0x2c')],qs[_0x80a4('0x31')](_0x2b68c1[_0x80a4('0x2d')][_0x80a4('0x31')]));_0x3954f0[_0x80a4('0x2f')]=_0x3954f0[_0x80a4('0x2f')][_0x80a4('0x32')]?_0x3954f0['attributes']:_0x472668[_0x80a4('0x2c')];if(!_0x2b68c1['query'][_0x80a4('0x33')]('nolimit')){_0x3954f0[_0x80a4('0x1a')]=qs[_0x80a4('0x1a')](_0x2b68c1[_0x80a4('0x2d')][_0x80a4('0x1a')]);_0x3954f0[_0x80a4('0x19')]=qs[_0x80a4('0x19')](_0x2b68c1[_0x80a4('0x2d')]['offset']);}_0x3954f0[_0x80a4('0x34')]=qs[_0x80a4('0x35')](_0x2b68c1[_0x80a4('0x2d')][_0x80a4('0x35')]);_0x3954f0[_0x80a4('0x36')]=qs[_0x80a4('0x37')](_[_0x80a4('0x38')](_0x2b68c1[_0x80a4('0x2d')],_0x472668[_0x80a4('0x37')]));if(_0x2b68c1[_0x80a4('0x2d')][_0x80a4('0x39')]){_0x3954f0[_0x80a4('0x36')]=_[_0x80a4('0x3a')](_0x3954f0['where'],{'$or':_['map'](_0x57822c,function(_0x48ac82){if(_0x48ac82[_0x80a4('0x2a')]!==_0x80a4('0x3b')){var _0x7c34c3={};_0x7c34c3[_0x48ac82[_0x80a4('0x23')]]={'$like':'%'+_0x2b68c1['query'][_0x80a4('0x39')]+'%'};return _0x7c34c3;}})});}_0x3954f0=_[_0x80a4('0x3a')]({},_0x3954f0,_0x2b68c1['options']);var _0x572fa1={'where':_0x3954f0[_0x80a4('0x36')]};return db['SquareMessage'][_0x80a4('0x18')](_0x572fa1)[_0x80a4('0x21')](function(_0x21b5a7){_0x1b0834[_0x80a4('0x18')]=_0x21b5a7;if(_0x2b68c1[_0x80a4('0x2d')][_0x80a4('0x3c')]){_0x3954f0[_0x80a4('0x3d')]=[{'all':!![]}];}return db[_0x80a4('0x27')]['findAll'](_0x3954f0);})['then'](function(_0x5acd8a){_0x1b0834[_0x80a4('0x3e')]=_0x5acd8a;return _0x1b0834;})['then'](respondWithFilteredResult(_0x441a87,_0x3954f0))[_0x80a4('0x3f')](handleError(_0x441a87,null));};exports['show']=function(_0x56bc8a,_0x218dfe){var _0x3a68f8={'raw':!![],'where':{'id':_0x56bc8a['params']['id']}},_0x508d7e={};_0x508d7e[_0x80a4('0x2c')]=_[_0x80a4('0x2e')](db['SquareMessage'][_0x80a4('0x28')]);_0x508d7e['query']=_[_0x80a4('0x2e')](_0x56bc8a[_0x80a4('0x2d')]);_0x508d7e[_0x80a4('0x37')]=_[_0x80a4('0x30')](_0x508d7e[_0x80a4('0x2c')],_0x508d7e[_0x80a4('0x2d')]);_0x3a68f8[_0x80a4('0x2f')]=_[_0x80a4('0x30')](_0x508d7e[_0x80a4('0x2c')],qs['fields'](_0x56bc8a[_0x80a4('0x2d')][_0x80a4('0x31')]));_0x3a68f8[_0x80a4('0x2f')]=_0x3a68f8[_0x80a4('0x2f')][_0x80a4('0x32')]?_0x3a68f8[_0x80a4('0x2f')]:_0x508d7e['model'];if(_0x56bc8a['query'][_0x80a4('0x3c')]){_0x3a68f8[_0x80a4('0x3d')]=[{'all':!![]}];}_0x3a68f8=_[_0x80a4('0x3a')]({},_0x3a68f8,_0x56bc8a[_0x80a4('0x40')]);return db[_0x80a4('0x27')][_0x80a4('0x41')](_0x3a68f8)['then'](handleEntityNotFound(_0x218dfe,null))[_0x80a4('0x21')](respondWithResult(_0x218dfe,null))[_0x80a4('0x3f')](handleError(_0x218dfe,null));};exports[_0x80a4('0x42')]=function(_0x464bb6,_0x54921e){return db[_0x80a4('0x27')]['create'](_0x464bb6[_0x80a4('0x43')],{})[_0x80a4('0x21')](respondWithResult(_0x54921e,0xc9))[_0x80a4('0x3f')](handleError(_0x54921e,null));};exports[_0x80a4('0x20')]=function(_0xe2835a,_0x3bc718){if(_0xe2835a[_0x80a4('0x43')]['id']){delete _0xe2835a[_0x80a4('0x43')]['id'];}return db[_0x80a4('0x27')][_0x80a4('0x41')]({'where':{'id':_0xe2835a[_0x80a4('0x44')]['id']}})[_0x80a4('0x21')](handleEntityNotFound(_0x3bc718,null))[_0x80a4('0x21')](saveUpdates(_0xe2835a[_0x80a4('0x43')],null))['then'](respondWithResult(_0x3bc718,null))[_0x80a4('0x3f')](handleError(_0x3bc718,null));};exports[_0x80a4('0x22')]=function(_0x35c960,_0x3d20e2){return db[_0x80a4('0x27')][_0x80a4('0x41')]({'where':{'id':_0x35c960[_0x80a4('0x44')]['id']}})[_0x80a4('0x21')](handleEntityNotFound(_0x3d20e2,null))['then'](removeEntity(_0x3d20e2,null))[_0x80a4('0x3f')](handleError(_0x3d20e2,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index f3829ca..cf44345 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 _0x9cb0=['./squareMessage.attributes','exports','define','SquareMessage','util','api','bluebird','request-promise','path'];(function(_0x257fbc,_0x4b3d45){var _0x31e0ce=function(_0x4cf79d){while(--_0x4cf79d){_0x257fbc['push'](_0x257fbc['shift']());}};_0x31e0ce(++_0x4b3d45);}(_0x9cb0,0xf7));var _0x09cb=function(_0x3027b1,_0x282484){_0x3027b1=_0x3027b1-0x0;var _0x59447f=_0x9cb0[_0x3027b1];return _0x59447f;};'use strict';var _=require('lodash');var util=require(_0x09cb('0x0'));var logger=require('../../config/logger')(_0x09cb('0x1'));var moment=require('moment');var BPromise=require(_0x09cb('0x2'));var rp=require(_0x09cb('0x3'));var fs=require('fs');var path=require(_0x09cb('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x09cb('0x5'));module[_0x09cb('0x6')]=function(_0x37a8f7,_0x3a4a5e){return _0x37a8f7[_0x09cb('0x7')](_0x09cb('0x8'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb25=['./squareMessage.attributes','exports','square_messages','lodash','util','../../config/logger','bluebird','path','../../config/environment'];(function(_0xc4b1f0,_0x29a294){var _0x5c8eef=function(_0x59df7a){while(--_0x59df7a){_0xc4b1f0['push'](_0xc4b1f0['shift']());}};_0x5c8eef(++_0x29a294);}(_0xdb25,0x1e0));var _0x5db2=function(_0x301f0b,_0x82b52){_0x301f0b=_0x301f0b-0x0;var _0x21bcfa=_0xdb25[_0x301f0b];return _0x21bcfa;};'use strict';var _=require(_0x5db2('0x0'));var util=require(_0x5db2('0x1'));var logger=require(_0x5db2('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5db2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5db2('0x4'));var rimraf=require('rimraf');var config=require(_0x5db2('0x5'));var attributes=require(_0x5db2('0x6'));module[_0x5db2('0x7')]=function(_0x3556d4,_0x20acd0){return _0x3556d4['define']('SquareMessage',attributes,{'tableName':_0x5db2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 56b60fb..c57a029 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 _0x02a7=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','result','CreateSquareMessage','SquareMessage','options','raw','util','randomstring','ioredis'];(function(_0x1472c1,_0x402717){var _0x1e3719=function(_0x2acebe){while(--_0x2acebe){_0x1472c1['push'](_0x1472c1['shift']());}};_0x1e3719(++_0x402717);}(_0x02a7,0x7a));var _0x702a=function(_0x1750f3,_0x1acd7c){_0x1750f3=_0x1750f3-0x0;var _0x248034=_0x02a7[_0x1750f3];return _0x248034;};'use strict';var _=require('lodash');var util=require(_0x702a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x702a('0x1'));var fs=require('fs');var Redis=require(_0x702a('0x2'));var db=require(_0x702a('0x3'))['db'];var utils=require(_0x702a('0x4'));var logger=require(_0x702a('0x5'))(_0x702a('0x6'));var config=require(_0x702a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x702a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26b25e,_0x1aa2c2,_0x3f2954){return new BPromise(function(_0x161dee,_0x430cf3){return client[_0x702a('0x9')](_0x26b25e,_0x3f2954)[_0x702a('0xa')](function(_0x48469e){logger[_0x702a('0xb')]('SquareMessage,\x20%s,\x20%s',_0x1aa2c2,'request\x20sent');logger[_0x702a('0xc')](_0x702a('0xd'),_0x1aa2c2,_0x702a('0xe'),JSON[_0x702a('0xf')](_0x48469e));if(_0x48469e['error']){if(_0x48469e[_0x702a('0x10')][_0x702a('0x11')]===0x1f4){logger[_0x702a('0x10')](_0x702a('0x12'),_0x1aa2c2,_0x48469e[_0x702a('0x10')][_0x702a('0x13')]);return _0x430cf3(_0x48469e[_0x702a('0x10')]['message']);}logger['error'](_0x702a('0x12'),_0x1aa2c2,_0x48469e['error']['message']);return _0x161dee(_0x48469e['error']['message']);}else{logger['info'](_0x702a('0x12'),_0x1aa2c2,_0x702a('0xe'));_0x161dee(_0x48469e[_0x702a('0x14')]['message']);}})['catch'](function(_0x506772){logger[_0x702a('0x10')](_0x702a('0x12'),_0x1aa2c2,_0x506772);_0x430cf3(_0x506772);});});}exports[_0x702a('0x15')]=function(_0x492cfb){var _0x290591=this;return new Promise(function(_0x5ec1b3,_0x823794){return db[_0x702a('0x16')]['create'](_0x492cfb['body'],{'raw':_0x492cfb[_0x702a('0x17')]?_0x492cfb[_0x702a('0x17')][_0x702a('0x18')]===undefined?!![]:![]:!![]})[_0x702a('0xa')](function(_0x332254){logger[_0x702a('0xb')](_0x702a('0x15'),_0x492cfb);logger[_0x702a('0xc')](_0x702a('0x15'),_0x492cfb,JSON[_0x702a('0xf')](_0x332254));_0x5ec1b3(_0x332254);})['catch'](function(_0x1ecd28){logger[_0x702a('0x10')](_0x702a('0x15'),_0x1ecd28[_0x702a('0x13')],_0x492cfb);_0x823794(_0x290591[_0x702a('0x10')](0x1f4,_0x1ecd28[_0x702a('0x13')]));});});}; \ No newline at end of file +var _0xafb9=['CreateSquareMessage','SquareMessage','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x13a646,_0x443a2f){var _0x3fc36d=function(_0x25580f){while(--_0x25580f){_0x13a646['push'](_0x13a646['shift']());}};_0x3fc36d(++_0x443a2f);}(_0xafb9,0x68));var _0x9afb=function(_0x308d20,_0x7ef759){_0x308d20=_0x308d20-0x0;var _0x1f8e85=_0xafb9[_0x308d20];return _0x1f8e85;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var moment=require(_0x9afb('0x2'));var BPromise=require(_0x9afb('0x3'));var rs=require(_0x9afb('0x4'));var fs=require('fs');var Redis=require(_0x9afb('0x5'));var db=require(_0x9afb('0x6'))['db'];var utils=require(_0x9afb('0x7'));var logger=require(_0x9afb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9afb('0x9'));var client=jayson['client'][_0x9afb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x548b24,_0x556880,_0x4c0e9d){return new BPromise(function(_0x1edf77,_0x20b8c1){return client['request'](_0x548b24,_0x4c0e9d)[_0x9afb('0xb')](function(_0x3e0264){logger[_0x9afb('0xc')](_0x9afb('0xd'),_0x556880,_0x9afb('0xe'));logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x556880,_0x9afb('0xe'),JSON[_0x9afb('0xf')](_0x3e0264));if(_0x3e0264[_0x9afb('0x10')]){if(_0x3e0264[_0x9afb('0x10')][_0x9afb('0x11')]===0x1f4){logger[_0x9afb('0x10')](_0x9afb('0xd'),_0x556880,_0x3e0264[_0x9afb('0x10')][_0x9afb('0x12')]);return _0x20b8c1(_0x3e0264[_0x9afb('0x10')]['message']);}logger[_0x9afb('0x10')]('SquareMessage,\x20%s,\x20%s',_0x556880,_0x3e0264['error'][_0x9afb('0x12')]);return _0x1edf77(_0x3e0264[_0x9afb('0x10')][_0x9afb('0x12')]);}else{logger[_0x9afb('0xc')](_0x9afb('0xd'),_0x556880,_0x9afb('0xe'));_0x1edf77(_0x3e0264[_0x9afb('0x13')]['message']);}})[_0x9afb('0x14')](function(_0x2145c2){logger[_0x9afb('0x10')](_0x9afb('0xd'),_0x556880,_0x2145c2);_0x20b8c1(_0x2145c2);});});}exports[_0x9afb('0x15')]=function(_0x508433){var _0x201ff4=this;return new Promise(function(_0x50a7e4,_0x3fdb34){return db[_0x9afb('0x16')]['create'](_0x508433['body'],{'raw':_0x508433[_0x9afb('0x17')]?_0x508433[_0x9afb('0x17')][_0x9afb('0x18')]===undefined?!![]:![]:!![]})[_0x9afb('0xb')](function(_0x3bd256){logger['info'](_0x9afb('0x15'),_0x508433);logger['debug']('CreateSquareMessage',_0x508433,JSON[_0x9afb('0xf')](_0x3bd256));_0x50a7e4(_0x3bd256);})[_0x9afb('0x14')](function(_0x3d67bb){logger[_0x9afb('0x10')]('CreateSquareMessage',_0x3d67bb[_0x9afb('0x12')],_0x508433);_0x3fdb34(_0x201ff4[_0x9afb('0x10')](0x1f4,_0x3d67bb['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index af92c26..e1f2833 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 _0x0df9=['/:id/test','15s','test','post','create','put','delete','destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id'];(function(_0x3a4574,_0x388c28){var _0x333078=function(_0x997bba){while(--_0x997bba){_0x3a4574['push'](_0x3a4574['shift']());}};_0x333078(++_0x388c28);}(_0x0df9,0x170));var _0x90df=function(_0x3a8aa8,_0x5a2ce1){_0x3a8aa8=_0x3a8aa8-0x0;var _0x6fe9e=_0x0df9[_0x3a8aa8];return _0x6fe9e;};'use strict';var multer=require(_0x90df('0x0'));var util=require('util');var path=require(_0x90df('0x1'));var timeout=require(_0x90df('0x2'));var express=require('express');var router=express[_0x90df('0x3')]();var auth=require(_0x90df('0x4'));var interaction=require(_0x90df('0x5'));var config=require(_0x90df('0x6'));var controller=require(_0x90df('0x7'));router[_0x90df('0x8')]('/',auth[_0x90df('0x9')](),controller[_0x90df('0xa')]);router[_0x90df('0x8')](_0x90df('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x90df('0x8')](_0x90df('0xc'),auth['isAuthenticated'](),timeout(_0x90df('0xd')),controller[_0x90df('0xe')]);router[_0x90df('0xf')]('/',auth[_0x90df('0x9')](),controller[_0x90df('0x10')]);router[_0x90df('0x11')](_0x90df('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x90df('0x12')](_0x90df('0xb'),auth[_0x90df('0x9')](),controller[_0x90df('0x13')]);module['exports']=router; \ No newline at end of file +var _0x99cd=['put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','./squareOdbc.controller','get','isAuthenticated','index','/:id/test','15s','test','create'];(function(_0x5d3733,_0x48cade){var _0x237bae=function(_0x3c9793){while(--_0x3c9793){_0x5d3733['push'](_0x5d3733['shift']());}};_0x237bae(++_0x48cade);}(_0x99cd,0x194));var _0xd99c=function(_0x269e5a,_0x47c072){_0x269e5a=_0x269e5a-0x0;var _0x368f51=_0x99cd[_0x269e5a];return _0x368f51;};'use strict';var multer=require(_0xd99c('0x0'));var util=require(_0xd99c('0x1'));var path=require(_0xd99c('0x2'));var timeout=require(_0xd99c('0x3'));var express=require(_0xd99c('0x4'));var router=express['Router']();var auth=require(_0xd99c('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd99c('0x6'));router[_0xd99c('0x7')]('/',auth[_0xd99c('0x8')](),controller[_0xd99c('0x9')]);router[_0xd99c('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0xd99c('0xa'),auth[_0xd99c('0x8')](),timeout(_0xd99c('0xb')),controller[_0xd99c('0xc')]);router['post']('/',auth[_0xd99c('0x8')](),controller[_0xd99c('0xd')]);router[_0xd99c('0xe')](_0xd99c('0xf'),auth[_0xd99c('0x8')](),controller[_0xd99c('0x10')]);router[_0xd99c('0x11')](_0xd99c('0xf'),auth['isAuthenticated'](),controller[_0xd99c('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 11b0484..83d3529 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 _0xedef=['name','sequelize','STRING'];(function(_0x1ba825,_0x57bd4d){var _0x2fe97e=function(_0x5038e8){while(--_0x5038e8){_0x1ba825['push'](_0x1ba825['shift']());}};_0x2fe97e(++_0x57bd4d);}(_0xedef,0x7c));var _0xfede=function(_0x3d5076,_0x106513){_0x3d5076=_0x3d5076-0x0;var _0x54afa0=_0xedef[_0x3d5076];return _0x54afa0;};'use strict';var Sequelize=require(_0xfede('0x0'));module['exports']={'name':{'type':Sequelize[_0xfede('0x1')],'unique':_0xfede('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xfede('0x1')]},'description':{'type':Sequelize[_0xfede('0x1')]}}; \ No newline at end of file +var _0x915c=['STRING','sequelize'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x915c,0x145));var _0xc915=function(_0x186446,_0x1cfd07){_0x186446=_0x186446-0x0;var _0x402627=_0x915c[_0x186446];return _0x402627;};'use strict';var Sequelize=require(_0xc915('0x0'));module['exports']={'name':{'type':Sequelize[_0xc915('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xc915('0x1')]},'description':{'type':Sequelize[_0xc915('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 191d8a4..9dffc4d 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 _0x2487=['fields','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','test','dsn','odbc','openSync','closeSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','util','path','to-csv','ejs','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','stack','name','send','map','SquareOdbc','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x2487,0x6f));var _0x7248=function(_0x439835,_0x2e3867){_0x439835=_0x439835-0x0;var _0x5a6e48=_0x2487[_0x439835];return _0x5a6e48;};'use strict';var pdf=require(_0x7248('0x0'));var emlformat=require(_0x7248('0x1'));var rimraf=require(_0x7248('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7248('0x3'));var rp=require(_0x7248('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7248('0x5'));var path=require(_0x7248('0x6'));var sox=require('sox');var csv=require(_0x7248('0x7'));var ejs=require(_0x7248('0x8'));var fs=require('fs');var _=require(_0x7248('0x9'));var squel=require('squel');var crypto=require(_0x7248('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7248('0x7'));var querystring=require(_0x7248('0xb'));var Papa=require(_0x7248('0xc'));var Redis=require('ioredis');var authService=require(_0x7248('0xd'));var qs=require(_0x7248('0xe'));var as=require(_0x7248('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7248('0x10'))(_0x7248('0x11'));var utils=require(_0x7248('0x12'));var config=require('../../config/environment');var db=require(_0x7248('0x13'))['db'];function respondWithStatusCode(_0xfbcef3,_0x48efc2){_0x48efc2=_0x48efc2||0xcc;return function(_0x479efa){if(_0x479efa){return _0xfbcef3[_0x7248('0x14')](_0x48efc2);}return _0xfbcef3['status'](_0x48efc2)[_0x7248('0x15')]();};}function respondWithResult(_0x32375f,_0x3a5630){_0x3a5630=_0x3a5630||0xc8;return function(_0x587e2b){if(_0x587e2b){return _0x32375f[_0x7248('0x16')](_0x3a5630)[_0x7248('0x17')](_0x587e2b);}};}function respondWithFilteredResult(_0x248f5f,_0x433995){return function(_0x321e83){if(_0x321e83){var _0x438c5b=_0x321e83[_0x7248('0x18')],_0x167666=_0x433995[_0x7248('0x19')],_0xb3fe4=_0x433995['offset']+_0x433995[_0x7248('0x1a')],_0x33e624;if(_0xb3fe4>=_0x438c5b){_0xb3fe4=_0x438c5b;_0x33e624=0xc8;}else{_0x33e624=0xce;}_0x248f5f[_0x7248('0x16')](_0x33e624);return _0x248f5f[_0x7248('0x1b')](_0x7248('0x1c'),_0x167666+'-'+_0xb3fe4+'/'+_0x438c5b)[_0x7248('0x17')](_0x321e83);}return null;};}function patchUpdates(_0x203f73){return function(_0x2e6e33){try{jsonpatch[_0x7248('0x1d')](_0x2e6e33,_0x203f73,!![]);}catch(_0x4b0620){return BPromise[_0x7248('0x1e')](_0x4b0620);}return _0x2e6e33[_0x7248('0x1f')]();};}function saveUpdates(_0x5d268e,_0x1a3e1f){return function(_0x517ba2){if(_0x517ba2){return _0x517ba2['update'](_0x5d268e)[_0x7248('0x20')](function(_0x2ea119){return _0x2ea119;});}return null;};}function removeEntity(_0x4f9bf5,_0x4aac0e){return function(_0x23aae9){if(_0x23aae9){return _0x23aae9[_0x7248('0x21')]()[_0x7248('0x20')](function(){var _0x457a77=_0x23aae9[_0x7248('0x22')]({'plain':!![]});var _0x1b5228='ODBC';return db[_0x7248('0x23')][_0x7248('0x21')]({'where':{'type':_0x1b5228,'resourceId':_0x457a77['id']}})[_0x7248('0x20')](function(){return _0x23aae9;});})['then'](function(){_0x4f9bf5[_0x7248('0x16')](0xcc)[_0x7248('0x15')]();});}};}function handleEntityNotFound(_0x3dad47,_0x2aada2){return function(_0x5c1838){if(!_0x5c1838){_0x3dad47[_0x7248('0x14')](0x194);}return _0x5c1838;};}function handleError(_0x32240d,_0x2c3c3f){_0x2c3c3f=_0x2c3c3f||0x1f4;return function(_0x3bbc22){logger['error'](_0x3bbc22[_0x7248('0x24')]);if(_0x3bbc22['name']){delete _0x3bbc22[_0x7248('0x25')];}_0x32240d[_0x7248('0x16')](_0x2c3c3f)[_0x7248('0x26')](_0x3bbc22);};}exports['index']=function(_0x203d5f,_0x1aa02d){var _0x2fc0f0={},_0x1b35d5={},_0x78b911={'count':0x0,'rows':[]};var _0x57f125=_[_0x7248('0x27')](db[_0x7248('0x28')][_0x7248('0x29')],function(_0x466a5a){return{'name':_0x466a5a[_0x7248('0x2a')],'type':_0x466a5a[_0x7248('0x2b')][_0x7248('0x2c')]};});_0x1b35d5[_0x7248('0x2d')]=_[_0x7248('0x27')](_0x57f125,_0x7248('0x25'));_0x1b35d5['query']=_[_0x7248('0x2e')](_0x203d5f[_0x7248('0x2f')]);_0x1b35d5[_0x7248('0x30')]=_[_0x7248('0x31')](_0x1b35d5['model'],_0x1b35d5[_0x7248('0x2f')]);_0x2fc0f0[_0x7248('0x32')]=_[_0x7248('0x31')](_0x1b35d5[_0x7248('0x2d')],qs[_0x7248('0x33')](_0x203d5f['query']['fields']));_0x2fc0f0[_0x7248('0x32')]=_0x2fc0f0[_0x7248('0x32')][_0x7248('0x34')]?_0x2fc0f0['attributes']:_0x1b35d5['model'];if(!_0x203d5f['query']['hasOwnProperty']('nolimit')){_0x2fc0f0['limit']=qs[_0x7248('0x1a')](_0x203d5f[_0x7248('0x2f')][_0x7248('0x1a')]);_0x2fc0f0[_0x7248('0x19')]=qs[_0x7248('0x19')](_0x203d5f['query'][_0x7248('0x19')]);}_0x2fc0f0['order']=qs[_0x7248('0x35')](_0x203d5f[_0x7248('0x2f')][_0x7248('0x35')]);_0x2fc0f0[_0x7248('0x36')]=qs[_0x7248('0x30')](_[_0x7248('0x37')](_0x203d5f['query'],_0x1b35d5[_0x7248('0x30')]));if(_0x203d5f[_0x7248('0x2f')][_0x7248('0x38')]){_0x2fc0f0[_0x7248('0x36')]=_[_0x7248('0x39')](_0x2fc0f0['where'],{'$or':_[_0x7248('0x27')](_0x57f125,function(_0x40f68a){if(_0x40f68a[_0x7248('0x2b')]!==_0x7248('0x3a')){var _0x2bee90={};_0x2bee90[_0x40f68a[_0x7248('0x25')]]={'$like':'%'+_0x203d5f[_0x7248('0x2f')][_0x7248('0x38')]+'%'};return _0x2bee90;}})});}_0x2fc0f0=_[_0x7248('0x39')]({},_0x2fc0f0,_0x203d5f[_0x7248('0x3b')]);var _0x545e9d={'where':_0x2fc0f0['where']};return db[_0x7248('0x28')][_0x7248('0x18')](_0x545e9d)[_0x7248('0x20')](function(_0x281633){_0x78b911[_0x7248('0x18')]=_0x281633;if(_0x203d5f[_0x7248('0x2f')][_0x7248('0x3c')]){_0x2fc0f0[_0x7248('0x3d')]=[{'all':!![]}];}return db[_0x7248('0x28')][_0x7248('0x3e')](_0x2fc0f0);})[_0x7248('0x20')](function(_0xef417f){_0x78b911[_0x7248('0x3f')]=_0xef417f;return _0x78b911;})['then'](respondWithFilteredResult(_0x1aa02d,_0x2fc0f0))[_0x7248('0x40')](handleError(_0x1aa02d,null));};exports[_0x7248('0x41')]=function(_0x530ceb,_0xb45b1e){var _0x11bd26={'raw':!![],'where':{'id':_0x530ceb['params']['id']}},_0xdbceab={};_0xdbceab[_0x7248('0x2d')]=_[_0x7248('0x2e')](db[_0x7248('0x28')]['rawAttributes']);_0xdbceab[_0x7248('0x2f')]=_[_0x7248('0x2e')](_0x530ceb[_0x7248('0x2f')]);_0xdbceab['filters']=_['intersection'](_0xdbceab['model'],_0xdbceab[_0x7248('0x2f')]);_0x11bd26[_0x7248('0x32')]=_[_0x7248('0x31')](_0xdbceab[_0x7248('0x2d')],qs['fields'](_0x530ceb[_0x7248('0x2f')][_0x7248('0x33')]));_0x11bd26['attributes']=_0x11bd26['attributes'][_0x7248('0x34')]?_0x11bd26[_0x7248('0x32')]:_0xdbceab[_0x7248('0x2d')];if(_0x530ceb[_0x7248('0x2f')][_0x7248('0x3c')]){_0x11bd26[_0x7248('0x3d')]=[{'all':!![]}];}_0x11bd26=_['merge']({},_0x11bd26,_0x530ceb['options']);return db[_0x7248('0x28')][_0x7248('0x42')](_0x11bd26)[_0x7248('0x20')](handleEntityNotFound(_0xb45b1e,null))['then'](respondWithResult(_0xb45b1e,null))[_0x7248('0x40')](handleError(_0xb45b1e,null));};exports[_0x7248('0x43')]=function(_0x484c4a,_0x58b17b){return db[_0x7248('0x28')][_0x7248('0x43')](_0x484c4a['body'],{})[_0x7248('0x20')](function(_0x3315ae){var _0x2b7d38=_0x484c4a[_0x7248('0x44')][_0x7248('0x22')]({'plain':!![]});if(!_0x2b7d38)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b7d38[_0x7248('0x45')]==='user'){var _0x8e5b2f=_0x3315ae[_0x7248('0x22')]({'plain':!![]});var _0x2afaba='ODBC';return db[_0x7248('0x46')]['find']({'where':{'name':_0x2afaba,'userProfileId':_0x2b7d38['userProfileId']},'raw':!![]})[_0x7248('0x20')](function(_0x12e953){if(_0x12e953&&_0x12e953['autoAssociation']===0x0){return db[_0x7248('0x23')][_0x7248('0x43')]({'name':_0x8e5b2f[_0x7248('0x25')],'resourceId':_0x8e5b2f['id'],'type':_0x12e953['name'],'sectionId':_0x12e953['id']},{})['then'](function(){return _0x3315ae;});}else{return _0x3315ae;}})[_0x7248('0x40')](function(_0x1aee7b){logger[_0x7248('0x47')](_0x7248('0x48'),_0x1aee7b);throw _0x1aee7b;});}return _0x3315ae;})[_0x7248('0x20')](respondWithResult(_0x58b17b,0xc9))[_0x7248('0x40')](handleError(_0x58b17b,null));};exports[_0x7248('0x49')]=function(_0x42eeff,_0x416622){if(_0x42eeff[_0x7248('0x4a')]['id']){delete _0x42eeff[_0x7248('0x4a')]['id'];}return db[_0x7248('0x28')][_0x7248('0x42')]({'where':{'id':_0x42eeff['params']['id']}})[_0x7248('0x20')](handleEntityNotFound(_0x416622,null))[_0x7248('0x20')](saveUpdates(_0x42eeff['body'],null))[_0x7248('0x20')](respondWithResult(_0x416622,null))[_0x7248('0x40')](handleError(_0x416622,null));};exports[_0x7248('0x21')]=function(_0x365c93,_0x4f8cc4){return db[_0x7248('0x28')][_0x7248('0x42')]({'where':{'id':_0x365c93[_0x7248('0x4b')]['id']}})[_0x7248('0x20')](handleEntityNotFound(_0x4f8cc4,null))['then'](removeEntity(_0x4f8cc4,null))[_0x7248('0x40')](handleError(_0x4f8cc4,null));};exports[_0x7248('0x4c')]=function(_0x3189d6,_0x12a805,_0x5d2b15){var _0x23a8ca;return db[_0x7248('0x28')][_0x7248('0x42')]({'where':{'id':_0x3189d6['params']['id']},'attributes':['id',_0x7248('0x4d')]})[_0x7248('0x20')](handleEntityNotFound(_0x12a805,null))[_0x7248('0x20')](function(_0x50b3d9){if(_0x50b3d9){var _0x43da3b=require(_0x7248('0x4e'))();_0x43da3b[_0x7248('0x4f')](_0x50b3d9['dsn']);_0x43da3b[_0x7248('0x50')]();return _0x50b3d9;}})[_0x7248('0x20')](respondWithResult(_0x12a805,null))[_0x7248('0x40')](handleError(_0x12a805,null));}; \ No newline at end of file +var _0x4b5f=['type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','test','dsn','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','get','ODBC','error','name','map','SquareOdbc','fieldName'];(function(_0x14d8b5,_0x2b7d63){var _0x40369a=function(_0x1b52ea){while(--_0x1b52ea){_0x14d8b5['push'](_0x14d8b5['shift']());}};_0x40369a(++_0x2b7d63);}(_0x4b5f,0x7a));var _0xf4b5=function(_0x4b2cc6,_0x29ef43){_0x4b2cc6=_0x4b2cc6-0x0;var _0x3e0b08=_0x4b5f[_0x4b2cc6];return _0x3e0b08;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf4b5('0x0'));var rimraf=require(_0xf4b5('0x1'));var zipdir=require(_0xf4b5('0x2'));var jsonpatch=require(_0xf4b5('0x3'));var rp=require(_0xf4b5('0x4'));var moment=require('moment');var BPromise=require(_0xf4b5('0x5'));var Mustache=require(_0xf4b5('0x6'));var util=require('util');var path=require(_0xf4b5('0x7'));var sox=require(_0xf4b5('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf4b5('0x9'));var jsforce=require(_0xf4b5('0xa'));var deskjs=require(_0xf4b5('0xb'));var toCsv=require(_0xf4b5('0xc'));var querystring=require('querystring');var Papa=require(_0xf4b5('0xd'));var Redis=require(_0xf4b5('0xe'));var authService=require(_0xf4b5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf4b5('0x10'));var hardwareService=require(_0xf4b5('0x11'));var logger=require(_0xf4b5('0x12'))('api');var utils=require(_0xf4b5('0x13'));var config=require('../../config/environment');var db=require(_0xf4b5('0x14'))['db'];function respondWithStatusCode(_0x1ab2eb,_0xd8ba7b){_0xd8ba7b=_0xd8ba7b||0xcc;return function(_0x250b1c){if(_0x250b1c){return _0x1ab2eb[_0xf4b5('0x15')](_0xd8ba7b);}return _0x1ab2eb['status'](_0xd8ba7b)[_0xf4b5('0x16')]();};}function respondWithResult(_0x31eff8,_0x1a3475){_0x1a3475=_0x1a3475||0xc8;return function(_0x3aceaf){if(_0x3aceaf){return _0x31eff8['status'](_0x1a3475)[_0xf4b5('0x17')](_0x3aceaf);}};}function respondWithFilteredResult(_0x2693bf,_0x435d0f){return function(_0x3884c8){if(_0x3884c8){var _0x57a7ef=_0x3884c8[_0xf4b5('0x18')],_0x1e7150=_0x435d0f[_0xf4b5('0x19')],_0x425af1=_0x435d0f[_0xf4b5('0x19')]+_0x435d0f[_0xf4b5('0x1a')],_0x497133;if(_0x425af1>=_0x57a7ef){_0x425af1=_0x57a7ef;_0x497133=0xc8;}else{_0x497133=0xce;}_0x2693bf[_0xf4b5('0x1b')](_0x497133);return _0x2693bf[_0xf4b5('0x1c')](_0xf4b5('0x1d'),_0x1e7150+'-'+_0x425af1+'/'+_0x57a7ef)[_0xf4b5('0x17')](_0x3884c8);}return null;};}function patchUpdates(_0x2af04e){return function(_0x3f6090){try{jsonpatch[_0xf4b5('0x1e')](_0x3f6090,_0x2af04e,!![]);}catch(_0x26ffab){return BPromise[_0xf4b5('0x1f')](_0x26ffab);}return _0x3f6090[_0xf4b5('0x20')]();};}function saveUpdates(_0x18c29d,_0x2e7300){return function(_0x2c3f74){if(_0x2c3f74){return _0x2c3f74['update'](_0x18c29d)[_0xf4b5('0x21')](function(_0x1b6862){return _0x1b6862;});}return null;};}function removeEntity(_0x1baac1,_0x536061){return function(_0x22a7d0){if(_0x22a7d0){return _0x22a7d0[_0xf4b5('0x22')]()[_0xf4b5('0x21')](function(){var _0x66d96c=_0x22a7d0[_0xf4b5('0x23')]({'plain':!![]});var _0x30952d=_0xf4b5('0x24');return db['UserProfileResource'][_0xf4b5('0x22')]({'where':{'type':_0x30952d,'resourceId':_0x66d96c['id']}})[_0xf4b5('0x21')](function(){return _0x22a7d0;});})['then'](function(){_0x1baac1[_0xf4b5('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46e966,_0x538272){return function(_0x54b428){if(!_0x54b428){_0x46e966[_0xf4b5('0x15')](0x194);}return _0x54b428;};}function handleError(_0x302840,_0x17804e){_0x17804e=_0x17804e||0x1f4;return function(_0x2fb39e){logger[_0xf4b5('0x25')](_0x2fb39e['stack']);if(_0x2fb39e[_0xf4b5('0x26')]){delete _0x2fb39e['name'];}_0x302840[_0xf4b5('0x1b')](_0x17804e)['send'](_0x2fb39e);};}exports['index']=function(_0x3231bc,_0x543204){var _0x7a7833={},_0x5cd77d={},_0x475a1a={'count':0x0,'rows':[]};var _0x494b3e=_[_0xf4b5('0x27')](db[_0xf4b5('0x28')]['rawAttributes'],function(_0x10e12a){return{'name':_0x10e12a[_0xf4b5('0x29')],'type':_0x10e12a[_0xf4b5('0x2a')][_0xf4b5('0x2b')]};});_0x5cd77d[_0xf4b5('0x2c')]=_[_0xf4b5('0x27')](_0x494b3e,_0xf4b5('0x26'));_0x5cd77d[_0xf4b5('0x2d')]=_['keys'](_0x3231bc[_0xf4b5('0x2d')]);_0x5cd77d[_0xf4b5('0x2e')]=_[_0xf4b5('0x2f')](_0x5cd77d[_0xf4b5('0x2c')],_0x5cd77d[_0xf4b5('0x2d')]);_0x7a7833[_0xf4b5('0x30')]=_[_0xf4b5('0x2f')](_0x5cd77d[_0xf4b5('0x2c')],qs[_0xf4b5('0x31')](_0x3231bc[_0xf4b5('0x2d')][_0xf4b5('0x31')]));_0x7a7833[_0xf4b5('0x30')]=_0x7a7833[_0xf4b5('0x30')][_0xf4b5('0x32')]?_0x7a7833[_0xf4b5('0x30')]:_0x5cd77d['model'];if(!_0x3231bc['query']['hasOwnProperty'](_0xf4b5('0x33'))){_0x7a7833[_0xf4b5('0x1a')]=qs[_0xf4b5('0x1a')](_0x3231bc[_0xf4b5('0x2d')][_0xf4b5('0x1a')]);_0x7a7833[_0xf4b5('0x19')]=qs[_0xf4b5('0x19')](_0x3231bc[_0xf4b5('0x2d')][_0xf4b5('0x19')]);}_0x7a7833[_0xf4b5('0x34')]=qs[_0xf4b5('0x35')](_0x3231bc[_0xf4b5('0x2d')]['sort']);_0x7a7833[_0xf4b5('0x36')]=qs[_0xf4b5('0x2e')](_[_0xf4b5('0x37')](_0x3231bc[_0xf4b5('0x2d')],_0x5cd77d['filters']));if(_0x3231bc[_0xf4b5('0x2d')][_0xf4b5('0x38')]){_0x7a7833[_0xf4b5('0x36')]=_[_0xf4b5('0x39')](_0x7a7833[_0xf4b5('0x36')],{'$or':_[_0xf4b5('0x27')](_0x494b3e,function(_0x2f16f3){if(_0x2f16f3[_0xf4b5('0x2a')]!=='VIRTUAL'){var _0x39e72b={};_0x39e72b[_0x2f16f3[_0xf4b5('0x26')]]={'$like':'%'+_0x3231bc['query'][_0xf4b5('0x38')]+'%'};return _0x39e72b;}})});}_0x7a7833=_['merge']({},_0x7a7833,_0x3231bc[_0xf4b5('0x3a')]);var _0x52b3f4={'where':_0x7a7833[_0xf4b5('0x36')]};return db['SquareOdbc'][_0xf4b5('0x18')](_0x52b3f4)[_0xf4b5('0x21')](function(_0x3805fe){_0x475a1a['count']=_0x3805fe;if(_0x3231bc[_0xf4b5('0x2d')][_0xf4b5('0x3b')]){_0x7a7833[_0xf4b5('0x3c')]=[{'all':!![]}];}return db[_0xf4b5('0x28')]['findAll'](_0x7a7833);})[_0xf4b5('0x21')](function(_0x78d57){_0x475a1a[_0xf4b5('0x3d')]=_0x78d57;return _0x475a1a;})[_0xf4b5('0x21')](respondWithFilteredResult(_0x543204,_0x7a7833))[_0xf4b5('0x3e')](handleError(_0x543204,null));};exports[_0xf4b5('0x3f')]=function(_0x5ad018,_0x4ec9a2){var _0x278d00={'raw':!![],'where':{'id':_0x5ad018[_0xf4b5('0x40')]['id']}},_0x526a35={};_0x526a35[_0xf4b5('0x2c')]=_[_0xf4b5('0x41')](db[_0xf4b5('0x28')][_0xf4b5('0x42')]);_0x526a35[_0xf4b5('0x2d')]=_[_0xf4b5('0x41')](_0x5ad018[_0xf4b5('0x2d')]);_0x526a35[_0xf4b5('0x2e')]=_['intersection'](_0x526a35[_0xf4b5('0x2c')],_0x526a35[_0xf4b5('0x2d')]);_0x278d00[_0xf4b5('0x30')]=_[_0xf4b5('0x2f')](_0x526a35['model'],qs[_0xf4b5('0x31')](_0x5ad018[_0xf4b5('0x2d')][_0xf4b5('0x31')]));_0x278d00[_0xf4b5('0x30')]=_0x278d00['attributes'][_0xf4b5('0x32')]?_0x278d00['attributes']:_0x526a35['model'];if(_0x5ad018[_0xf4b5('0x2d')][_0xf4b5('0x3b')]){_0x278d00[_0xf4b5('0x3c')]=[{'all':!![]}];}_0x278d00=_[_0xf4b5('0x39')]({},_0x278d00,_0x5ad018['options']);return db[_0xf4b5('0x28')][_0xf4b5('0x43')](_0x278d00)[_0xf4b5('0x21')](handleEntityNotFound(_0x4ec9a2,null))[_0xf4b5('0x21')](respondWithResult(_0x4ec9a2,null))[_0xf4b5('0x3e')](handleError(_0x4ec9a2,null));};exports[_0xf4b5('0x44')]=function(_0x4e96d7,_0x5db4bc){return db[_0xf4b5('0x28')]['create'](_0x4e96d7['body'],{})['then'](function(_0x195891){var _0x4bdd21=_0x4e96d7[_0xf4b5('0x45')][_0xf4b5('0x23')]({'plain':!![]});if(!_0x4bdd21)throw new Error(_0xf4b5('0x46'));if(_0x4bdd21[_0xf4b5('0x47')]===_0xf4b5('0x45')){var _0x1ea206=_0x195891[_0xf4b5('0x23')]({'plain':!![]});var _0xc47194='ODBC';return db[_0xf4b5('0x48')][_0xf4b5('0x43')]({'where':{'name':_0xc47194,'userProfileId':_0x4bdd21[_0xf4b5('0x49')]},'raw':!![]})[_0xf4b5('0x21')](function(_0x1d55c0){if(_0x1d55c0&&_0x1d55c0['autoAssociation']===0x0){return db[_0xf4b5('0x4a')][_0xf4b5('0x44')]({'name':_0x1ea206[_0xf4b5('0x26')],'resourceId':_0x1ea206['id'],'type':_0x1d55c0['name'],'sectionId':_0x1d55c0['id']},{})[_0xf4b5('0x21')](function(){return _0x195891;});}else{return _0x195891;}})[_0xf4b5('0x3e')](function(_0x486b64){logger[_0xf4b5('0x25')](_0xf4b5('0x4b'),_0x486b64);throw _0x486b64;});}return _0x195891;})[_0xf4b5('0x21')](respondWithResult(_0x5db4bc,0xc9))[_0xf4b5('0x3e')](handleError(_0x5db4bc,null));};exports[_0xf4b5('0x4c')]=function(_0x4e47a5,_0xda376f){if(_0x4e47a5[_0xf4b5('0x4d')]['id']){delete _0x4e47a5['body']['id'];}return db[_0xf4b5('0x28')][_0xf4b5('0x43')]({'where':{'id':_0x4e47a5[_0xf4b5('0x40')]['id']}})['then'](handleEntityNotFound(_0xda376f,null))[_0xf4b5('0x21')](saveUpdates(_0x4e47a5[_0xf4b5('0x4d')],null))['then'](respondWithResult(_0xda376f,null))['catch'](handleError(_0xda376f,null));};exports[_0xf4b5('0x22')]=function(_0x557931,_0x189f42){return db['SquareOdbc'][_0xf4b5('0x43')]({'where':{'id':_0x557931[_0xf4b5('0x40')]['id']}})[_0xf4b5('0x21')](handleEntityNotFound(_0x189f42,null))['then'](removeEntity(_0x189f42,null))[_0xf4b5('0x3e')](handleError(_0x189f42,null));};exports[_0xf4b5('0x4e')]=function(_0x529018,_0x32ef3c,_0x39c1d1){var _0x99d129;return db[_0xf4b5('0x28')]['find']({'where':{'id':_0x529018['params']['id']},'attributes':['id',_0xf4b5('0x4f')]})[_0xf4b5('0x21')](handleEntityNotFound(_0x32ef3c,null))[_0xf4b5('0x21')](function(_0xd0d29f){if(_0xd0d29f){var _0x1ffb29=require('odbc')();_0x1ffb29[_0xf4b5('0x50')](_0xd0d29f['dsn']);_0x1ffb29[_0xf4b5('0x51')]();return _0xd0d29f;}})[_0xf4b5('0x21')](respondWithResult(_0x32ef3c,null))[_0xf4b5('0x3e')](handleError(_0x32ef3c,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index ac9038e..6a79d5a 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 _0x5607=['path','rimraf','./squareOdbc.attributes','define','SquareOdbc','lodash','util','../../config/logger','moment','request-promise'];(function(_0x52c4e9,_0x5412d0){var _0x252a03=function(_0x57857c){while(--_0x57857c){_0x52c4e9['push'](_0x52c4e9['shift']());}};_0x252a03(++_0x5412d0);}(_0x5607,0xc3));var _0x7560=function(_0x258a41,_0x586263){_0x258a41=_0x258a41-0x0;var _0x5188f3=_0x5607[_0x258a41];return _0x5188f3;};'use strict';var _=require(_0x7560('0x0'));var util=require(_0x7560('0x1'));var logger=require(_0x7560('0x2'))('api');var moment=require(_0x7560('0x3'));var BPromise=require('bluebird');var rp=require(_0x7560('0x4'));var fs=require('fs');var path=require(_0x7560('0x5'));var rimraf=require(_0x7560('0x6'));var config=require('../../config/environment');var attributes=require(_0x7560('0x7'));module['exports']=function(_0x17f7b8,_0x119848){return _0x17f7b8[_0x7560('0x8')](_0x7560('0x9'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5add=['path','rimraf','exports','define','SquareOdbc','square_odbc','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4c6d6f,_0x291557){var _0x2d4478=function(_0x106946){while(--_0x106946){_0x4c6d6f['push'](_0x4c6d6f['shift']());}};_0x2d4478(++_0x291557);}(_0x5add,0x11a));var _0xd5ad=function(_0x4471cd,_0x3a97f9){_0x4471cd=_0x4471cd-0x0;var _0x5d4632=_0x5add[_0x4471cd];return _0x5d4632;};'use strict';var _=require(_0xd5ad('0x0'));var util=require('util');var logger=require(_0xd5ad('0x1'))(_0xd5ad('0x2'));var moment=require(_0xd5ad('0x3'));var BPromise=require(_0xd5ad('0x4'));var rp=require(_0xd5ad('0x5'));var fs=require('fs');var path=require(_0xd5ad('0x6'));var rimraf=require(_0xd5ad('0x7'));var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module[_0xd5ad('0x8')]=function(_0x2ec8f7,_0x228078){return _0x2ec8f7[_0xd5ad('0x9')](_0xd5ad('0xa'),attributes,{'tableName':_0xd5ad('0xb'),'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 9ff86e6..5677ea7 100644 --- a/server/api/squareOdbc/squareOdbc.rpc.js +++ b/server/api/squareOdbc/squareOdbc.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['stringify','ShowSquareOdbc','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SquareOdbc,\x20%s,\x20%s','message','catch','find','options','include','map','attributes','model','then'];(function(_0x29e98f,_0x356d0d){var _0x55ca39=function(_0x49871b){while(--_0x49871b){_0x29e98f['push'](_0x29e98f['shift']());}};_0x55ca39(++_0x356d0d);}(_0x008c,0x188));var _0xc008=function(_0xdc4996,_0x15bedc){_0xdc4996=_0xdc4996-0x0;var _0x20fbb9=_0x008c[_0xdc4996];return _0x20fbb9;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});}exports['ShowSquareOdbc']=function(_0x540e45){var _0x5c2668=this;return new Promise(function(_0x46042b,_0x462af5){return db['SquareOdbc'][_0xc008('0x15')]({'raw':_0x540e45['options']?_0x540e45['options']['raw']===undefined?!![]:![]:!![],'where':_0x540e45['options']?_0x540e45[_0xc008('0x16')]['where']||null:null,'attributes':_0x540e45['options']?_0x540e45['options']['attributes']||null:null,'include':_0x540e45['options']?_0x540e45[_0xc008('0x16')][_0xc008('0x17')]?_[_0xc008('0x18')](_0x540e45[_0xc008('0x16')][_0xc008('0x17')],function(_0x110128){return{'model':db[_0x110128['model']],'as':_0x110128['as'],'attributes':_0x110128[_0xc008('0x19')],'include':_0x110128['include']?_['map'](_0x110128[_0xc008('0x17')],function(_0x36f358){return{'model':db[_0x36f358[_0xc008('0x1a')]],'as':_0x36f358['as'],'attributes':_0x36f358[_0xc008('0x19')],'include':_0x36f358['include']?_['map'](_0x36f358['include'],function(_0x3f7b07){return{'model':db[_0x3f7b07[_0xc008('0x1a')]],'as':_0x3f7b07['as'],'attributes':_0x3f7b07[_0xc008('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc008('0x1b')](function(_0x5bebd9){logger['info']('ShowSquareOdbc',_0x540e45);logger['debug']('ShowSquareOdbc',_0x540e45,JSON[_0xc008('0x1c')](_0x5bebd9));_0x46042b(_0x5bebd9);})[_0xc008('0x14')](function(_0x25eae4){logger['error'](_0xc008('0x1d'),_0x25eae4[_0xc008('0x13')],_0x540e45);_0x462af5(_0x5c2668[_0xc008('0x10')](0x1f4,_0x25eae4[_0xc008('0x13')]));});});}; \ No newline at end of file +var _0x3e74=['catch','SquareOdbc','find','options','raw','where','attributes','include','map','model','then','ShowSquareOdbc','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','SquareOdbc,\x20%s,\x20%s','message','info'];(function(_0x1f2f86,_0x57341c){var _0x43a6b3=function(_0x30430b){while(--_0x30430b){_0x1f2f86['push'](_0x1f2f86['shift']());}};_0x43a6b3(++_0x57341c);}(_0x3e74,0x175));var _0x43e7=function(_0x54abb4,_0x5ae10e){_0x54abb4=_0x54abb4-0x0;var _0xc9901e=_0x3e74[_0x54abb4];return _0xc9901e;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowSquareOdbc']=function(_0x446986){var _0x1ca758=this;return new Promise(function(_0x9037d3,_0x140657){return db[_0x43e7('0x12')][_0x43e7('0x13')]({'raw':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x15')]===undefined?!![]:![]:!![],'where':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x16')]||null:null,'attributes':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x17')]||null:null,'include':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x18')]?_[_0x43e7('0x19')](_0x446986[_0x43e7('0x14')][_0x43e7('0x18')],function(_0x2f4cb4){return{'model':db[_0x2f4cb4['model']],'as':_0x2f4cb4['as'],'attributes':_0x2f4cb4[_0x43e7('0x17')],'include':_0x2f4cb4['include']?_['map'](_0x2f4cb4[_0x43e7('0x18')],function(_0x43f4ff){return{'model':db[_0x43f4ff['model']],'as':_0x43f4ff['as'],'attributes':_0x43f4ff[_0x43e7('0x17')],'include':_0x43f4ff['include']?_[_0x43e7('0x19')](_0x43f4ff['include'],function(_0x1af208){return{'model':db[_0x1af208[_0x43e7('0x1a')]],'as':_0x1af208['as'],'attributes':_0x1af208[_0x43e7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43e7('0x1b')](function(_0x51f4d7){logger['info'](_0x43e7('0x1c'),_0x446986);logger['debug'](_0x43e7('0x1c'),_0x446986,JSON[_0x43e7('0x1d')](_0x51f4d7));_0x9037d3(_0x51f4d7);})[_0x43e7('0x11')](function(_0xb1fc63){logger['error'](_0x43e7('0x1c'),_0xb1fc63[_0x43e7('0xf')],_0x446986);_0x140657(_0x1ca758[_0x43e7('0xd')](0x1f4,_0xb1fc63[_0x43e7('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 9705c9c..16c494c 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 _0x1eba=['isAuthenticated','index','/:id','show','/:id/users','getUsers','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./squareProject.controller','get'];(function(_0x3564e9,_0xc0548e){var _0x2827b3=function(_0x444f7e){while(--_0x444f7e){_0x3564e9['push'](_0x3564e9['shift']());}};_0x2827b3(++_0xc0548e);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x39bc44,_0x1d4373){_0x39bc44=_0x39bc44-0x0;var _0x2916d8=_0x1eba[_0x39bc44];return _0x2916d8;};'use strict';var multer=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var path=require(_0xa1eb('0x2'));var timeout=require(_0xa1eb('0x3'));var express=require(_0xa1eb('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xa1eb('0x5'));var config=require(_0xa1eb('0x6'));var controller=require(_0xa1eb('0x7'));router[_0xa1eb('0x8')]('/',auth[_0xa1eb('0x9')](),controller[_0xa1eb('0xa')]);router[_0xa1eb('0x8')](_0xa1eb('0xb'),auth[_0xa1eb('0x9')](),controller[_0xa1eb('0xc')]);router[_0xa1eb('0x8')](_0xa1eb('0xd'),auth['isAuthenticated'](),controller[_0xa1eb('0xe')]);router['post']('/',auth[_0xa1eb('0x9')](),controller['create']);router[_0xa1eb('0xf')]('/:id/users',auth[_0xa1eb('0x9')](),controller['addUsers']);router[_0xa1eb('0x10')](_0xa1eb('0xb'),auth[_0xa1eb('0x9')](),controller['update']);router[_0xa1eb('0x11')](_0xa1eb('0xb'),auth['isAuthenticated'](),controller[_0xa1eb('0x12')]);router['delete']('/:id/users',auth[_0xa1eb('0x9')](),controller['removeUsers']);module[_0xa1eb('0x13')]=router; \ No newline at end of file +var _0x1eba=['isAuthenticated','index','/:id','show','/:id/users','getUsers','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./squareProject.controller','get'];(function(_0x52e1db,_0x5835f2){var _0x3bad22=function(_0x1ad7d4){while(--_0x1ad7d4){_0x52e1db['push'](_0x52e1db['shift']());}};_0x3bad22(++_0x5835f2);}(_0x1eba,0x1d7));var _0xa1eb=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x1eba[_0xefd519];return _0x4bb882;};'use strict';var multer=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var path=require(_0xa1eb('0x2'));var timeout=require(_0xa1eb('0x3'));var express=require(_0xa1eb('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xa1eb('0x5'));var config=require(_0xa1eb('0x6'));var controller=require(_0xa1eb('0x7'));router[_0xa1eb('0x8')]('/',auth[_0xa1eb('0x9')](),controller[_0xa1eb('0xa')]);router[_0xa1eb('0x8')](_0xa1eb('0xb'),auth[_0xa1eb('0x9')](),controller[_0xa1eb('0xc')]);router[_0xa1eb('0x8')](_0xa1eb('0xd'),auth['isAuthenticated'](),controller[_0xa1eb('0xe')]);router['post']('/',auth[_0xa1eb('0x9')](),controller['create']);router[_0xa1eb('0xf')]('/:id/users',auth[_0xa1eb('0x9')](),controller['addUsers']);router[_0xa1eb('0x10')](_0xa1eb('0xb'),auth[_0xa1eb('0x9')](),controller['update']);router[_0xa1eb('0x11')](_0xa1eb('0xb'),auth['isAuthenticated'](),controller[_0xa1eb('0x12')]);router['delete']('/:id/users',auth[_0xa1eb('0x9')](),controller['removeUsers']);module[_0xa1eb('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index cc26405..bb3a406 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 _0xe59c=['getDataValue','preproduction','toString','utf8','production','sequelize','exports','name','STRING','TEXT','BLOB','long'];(function(_0xa75b0a,_0x443f77){var _0x2301f8=function(_0x155d31){while(--_0x155d31){_0xa75b0a['push'](_0xa75b0a['shift']());}};_0x2301f8(++_0x443f77);}(_0xe59c,0x19d));var _0xce59=function(_0x2d7bb3,_0x324bcb){_0x2d7bb3=_0x2d7bb3-0x0;var _0x20e4f9=_0xe59c[_0x2d7bb3];return _0x20e4f9;};'use strict';var Sequelize=require(_0xce59('0x0'));module[_0xce59('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xce59('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xce59('0x3')]},'notes':{'type':Sequelize[_0xce59('0x4')]},'preproduction':{'type':Sequelize[_0xce59('0x5')](_0xce59('0x6')),'get':function(){if(this[_0xce59('0x7')](_0xce59('0x8'))){return this[_0xce59('0x7')](_0xce59('0x8'))[_0xce59('0x9')](_0xce59('0xa'));}}},'production':{'type':Sequelize['BLOB'](_0xce59('0x6')),'get':function(){if(this['getDataValue'](_0xce59('0xb'))){return this[_0xce59('0x7')](_0xce59('0xb'))[_0xce59('0x9')](_0xce59('0xa'));}}}}; \ No newline at end of file +var _0xc110=['long','getDataValue','preproduction','utf8','production','STRING','name','TEXT','BLOB'];(function(_0x2b271b,_0x47ab63){var _0x464860=function(_0x367fad){while(--_0x367fad){_0x2b271b['push'](_0x2b271b['shift']());}};_0x464860(++_0x47ab63);}(_0xc110,0x8c));var _0x0c11=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc110[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0c11('0x0')],'unique':_0x0c11('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x0c11('0x0')]},'notes':{'type':Sequelize[_0x0c11('0x2')]},'preproduction':{'type':Sequelize[_0x0c11('0x3')](_0x0c11('0x4')),'get':function(){if(this[_0x0c11('0x5')](_0x0c11('0x6'))){return this['getDataValue'](_0x0c11('0x6'))['toString'](_0x0c11('0x7'));}}},'production':{'type':Sequelize[_0x0c11('0x3')]('long'),'get':function(){if(this[_0x0c11('0x5')](_0x0c11('0x8'))){return this[_0x0c11('0x5')](_0x0c11('0x8'))['toString'](_0x0c11('0x7'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 9adc3a5..96546fa 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 _0xda55=['body','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','order','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','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','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','destroy','then','get','error','stack','name','send','index','map','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','SquareProject','findAll','rows','catch','show','params','rawAttributes','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation'];(function(_0x2ac4af,_0x288c53){var _0x3a36df=function(_0x271b11){while(--_0x271b11){_0x2ac4af['push'](_0x2ac4af['shift']());}};_0x3a36df(++_0x288c53);}(_0xda55,0x6d));var _0x5da5=function(_0x97acee,_0x202957){_0x97acee=_0x97acee-0x0;var _0x16cc43=_0xda55[_0x97acee];return _0x16cc43;};'use strict';var pdf=require(_0x5da5('0x0'));var emlformat=require(_0x5da5('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5da5('0x2'));var rp=require(_0x5da5('0x3'));var moment=require(_0x5da5('0x4'));var BPromise=require(_0x5da5('0x5'));var Mustache=require(_0x5da5('0x6'));var util=require('util');var path=require(_0x5da5('0x7'));var sox=require('sox');var csv=require(_0x5da5('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5da5('0x9'));var squel=require(_0x5da5('0xa'));var crypto=require(_0x5da5('0xb'));var jsforce=require(_0x5da5('0xc'));var deskjs=require(_0x5da5('0xd'));var toCsv=require(_0x5da5('0x8'));var querystring=require(_0x5da5('0xe'));var Papa=require(_0x5da5('0xf'));var Redis=require('ioredis');var authService=require(_0x5da5('0x10'));var qs=require(_0x5da5('0x11'));var as=require(_0x5da5('0x12'));var hardwareService=require(_0x5da5('0x13'));var logger=require(_0x5da5('0x14'))(_0x5da5('0x15'));var utils=require(_0x5da5('0x16'));var config=require('../../config/environment');var db=require(_0x5da5('0x17'))['db'];config[_0x5da5('0x18')]=_['defaults'](config[_0x5da5('0x18')],{'host':_0x5da5('0x19'),'port':0x18eb});var socket=require(_0x5da5('0x1a'))(new Redis(config[_0x5da5('0x18')]));require(_0x5da5('0x1b'))[_0x5da5('0x1c')](socket);function respondWithStatusCode(_0x481562,_0x489b60){_0x489b60=_0x489b60||0xcc;return function(_0x4fa4b5){if(_0x4fa4b5){return _0x481562[_0x5da5('0x1d')](_0x489b60);}return _0x481562[_0x5da5('0x1e')](_0x489b60)[_0x5da5('0x1f')]();};}function respondWithResult(_0x665ce8,_0x11bd3){_0x11bd3=_0x11bd3||0xc8;return function(_0x134afa){if(_0x134afa){return _0x665ce8[_0x5da5('0x1e')](_0x11bd3)['json'](_0x134afa);}};}function respondWithFilteredResult(_0x124dc5,_0x290136){return function(_0x1a4849){if(_0x1a4849){var _0x16b11f=_0x1a4849[_0x5da5('0x20')],_0x3f7e98=_0x290136[_0x5da5('0x21')],_0x428b07=_0x290136[_0x5da5('0x21')]+_0x290136[_0x5da5('0x22')],_0x547c58;if(_0x428b07>=_0x16b11f){_0x428b07=_0x16b11f;_0x547c58=0xc8;}else{_0x547c58=0xce;}_0x124dc5[_0x5da5('0x1e')](_0x547c58);return _0x124dc5['set'](_0x5da5('0x23'),_0x3f7e98+'-'+_0x428b07+'/'+_0x16b11f)[_0x5da5('0x24')](_0x1a4849);}return null;};}function patchUpdates(_0x42a3cb){return function(_0x560ea7){try{jsonpatch[_0x5da5('0x25')](_0x560ea7,_0x42a3cb,!![]);}catch(_0x15aa62){return BPromise[_0x5da5('0x26')](_0x15aa62);}return _0x560ea7[_0x5da5('0x27')]();};}function saveUpdates(_0xec69f2,_0x436960){return function(_0x47d4e8){if(_0x47d4e8){return _0x47d4e8[_0x5da5('0x28')](_0xec69f2)['then'](function(_0x1b67c4){return _0x1b67c4;});}return null;};}function removeEntity(_0x716ab7,_0x2dd138){return function(_0x5d983c){if(_0x5d983c){return _0x5d983c[_0x5da5('0x29')]()[_0x5da5('0x2a')](function(){var _0x39dd93=_0x5d983c[_0x5da5('0x2b')]({'plain':!![]});var _0x55d517='SquareProjects';return db['UserProfileResource'][_0x5da5('0x29')]({'where':{'type':_0x55d517,'resourceId':_0x39dd93['id']}})['then'](function(){return _0x5d983c;});})['then'](function(){_0x716ab7[_0x5da5('0x1e')](0xcc)[_0x5da5('0x1f')]();});}};}function handleEntityNotFound(_0x5740a7,_0x1798ae){return function(_0x1ab83e){if(!_0x1ab83e){_0x5740a7['sendStatus'](0x194);}return _0x1ab83e;};}function handleError(_0x3b815e,_0x27de55){_0x27de55=_0x27de55||0x1f4;return function(_0x38bb86){logger[_0x5da5('0x2c')](_0x38bb86[_0x5da5('0x2d')]);if(_0x38bb86['name']){delete _0x38bb86[_0x5da5('0x2e')];}_0x3b815e[_0x5da5('0x1e')](_0x27de55)[_0x5da5('0x2f')](_0x38bb86);};}exports[_0x5da5('0x30')]=function(_0x55e2bf,_0x5ee7f2){var _0x4cb022={},_0x245273={},_0x27ed41={'count':0x0,'rows':[]};var _0x15344b=_[_0x5da5('0x31')](db['SquareProject']['rawAttributes'],function(_0x24e115){return{'name':_0x24e115['fieldName'],'type':_0x24e115['type'][_0x5da5('0x32')]};});_0x245273['model']=_[_0x5da5('0x31')](_0x15344b,_0x5da5('0x2e'));_0x245273[_0x5da5('0x33')]=_[_0x5da5('0x34')](_0x55e2bf[_0x5da5('0x33')]);_0x245273[_0x5da5('0x35')]=_[_0x5da5('0x36')](_0x245273[_0x5da5('0x37')],_0x245273['query']);_0x4cb022[_0x5da5('0x38')]=_['intersection'](_0x245273[_0x5da5('0x37')],qs[_0x5da5('0x39')](_0x55e2bf[_0x5da5('0x33')][_0x5da5('0x39')]));_0x4cb022[_0x5da5('0x38')]=_0x4cb022[_0x5da5('0x38')][_0x5da5('0x3a')]?_0x4cb022[_0x5da5('0x38')]:_0x245273[_0x5da5('0x37')];if(!_0x55e2bf[_0x5da5('0x33')][_0x5da5('0x3b')](_0x5da5('0x3c'))){_0x4cb022[_0x5da5('0x22')]=qs['limit'](_0x55e2bf[_0x5da5('0x33')]['limit']);_0x4cb022[_0x5da5('0x21')]=qs[_0x5da5('0x21')](_0x55e2bf[_0x5da5('0x33')][_0x5da5('0x21')]);}_0x4cb022['order']=qs[_0x5da5('0x3d')](_0x55e2bf[_0x5da5('0x33')][_0x5da5('0x3d')]);_0x4cb022['where']=qs[_0x5da5('0x35')](_[_0x5da5('0x3e')](_0x55e2bf['query'],_0x245273[_0x5da5('0x35')]));if(_0x55e2bf[_0x5da5('0x33')][_0x5da5('0x3f')]){_0x4cb022[_0x5da5('0x40')]=_[_0x5da5('0x41')](_0x4cb022[_0x5da5('0x40')],{'$or':_['map'](_0x15344b,function(_0x1ab02){if(_0x1ab02[_0x5da5('0x42')]!==_0x5da5('0x43')){var _0x7d456f={};_0x7d456f[_0x1ab02[_0x5da5('0x2e')]]={'$like':'%'+_0x55e2bf['query'][_0x5da5('0x3f')]+'%'};return _0x7d456f;}})});}_0x4cb022=_[_0x5da5('0x41')]({},_0x4cb022,_0x55e2bf['options']);var _0x38caed={'where':_0x4cb022['where']};return db['SquareProject'][_0x5da5('0x20')](_0x38caed)[_0x5da5('0x2a')](function(_0x2f6026){_0x27ed41[_0x5da5('0x20')]=_0x2f6026;if(_0x55e2bf[_0x5da5('0x33')][_0x5da5('0x44')]){_0x4cb022[_0x5da5('0x45')]=[{'all':!![]}];}return db[_0x5da5('0x46')][_0x5da5('0x47')](_0x4cb022);})[_0x5da5('0x2a')](function(_0x22d47e){_0x27ed41[_0x5da5('0x48')]=_0x22d47e;return _0x27ed41;})[_0x5da5('0x2a')](respondWithFilteredResult(_0x5ee7f2,_0x4cb022))[_0x5da5('0x49')](handleError(_0x5ee7f2,null));};exports[_0x5da5('0x4a')]=function(_0x30be40,_0x1fc965){var _0x4464a7={'raw':![],'where':{'id':_0x30be40[_0x5da5('0x4b')]['id']}},_0x62183f={};_0x62183f['model']=_['keys'](db[_0x5da5('0x46')][_0x5da5('0x4c')]);_0x62183f['query']=_[_0x5da5('0x34')](_0x30be40[_0x5da5('0x33')]);_0x62183f[_0x5da5('0x35')]=_[_0x5da5('0x36')](_0x62183f[_0x5da5('0x37')],_0x62183f[_0x5da5('0x33')]);_0x4464a7[_0x5da5('0x38')]=_[_0x5da5('0x36')](_0x62183f[_0x5da5('0x37')],qs[_0x5da5('0x39')](_0x30be40['query'][_0x5da5('0x39')]));_0x4464a7['attributes']=_0x4464a7['attributes'][_0x5da5('0x3a')]?_0x4464a7[_0x5da5('0x38')]:_0x62183f[_0x5da5('0x37')];if(_0x30be40[_0x5da5('0x33')][_0x5da5('0x44')]){_0x4464a7[_0x5da5('0x45')]=[{'all':!![]}];}_0x4464a7=_['merge']({},_0x4464a7,_0x30be40[_0x5da5('0x4d')]);return db['SquareProject']['find'](_0x4464a7)[_0x5da5('0x2a')](handleEntityNotFound(_0x1fc965,null))[_0x5da5('0x2a')](respondWithResult(_0x1fc965,null))['catch'](handleError(_0x1fc965,null));};exports[_0x5da5('0x4e')]=function(_0x322b08,_0x783735){return db[_0x5da5('0x46')][_0x5da5('0x4e')](_0x322b08['body'],{})[_0x5da5('0x2a')](function(_0x5277bc){var _0x535b22=_0x322b08[_0x5da5('0x4f')]['get']({'plain':!![]});if(!_0x535b22)throw new Error(_0x5da5('0x50'));if(_0x535b22[_0x5da5('0x51')]===_0x5da5('0x4f')){var _0x1ec725=_0x5277bc[_0x5da5('0x2b')]({'plain':!![]});var _0xceea44='SquareProjects';return db['UserProfileSection'][_0x5da5('0x52')]({'where':{'name':_0xceea44,'userProfileId':_0x535b22[_0x5da5('0x53')]},'raw':!![]})['then'](function(_0x4fca4c){if(_0x4fca4c&&_0x4fca4c[_0x5da5('0x54')]===0x0){return db['UserProfileResource'][_0x5da5('0x4e')]({'name':_0x1ec725['name'],'resourceId':_0x1ec725['id'],'type':_0x4fca4c['name'],'sectionId':_0x4fca4c['id']},{})[_0x5da5('0x2a')](function(){return _0x5277bc;});}else{return _0x5277bc;}})[_0x5da5('0x49')](function(_0xc2b9a5){logger[_0x5da5('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc2b9a5);throw _0xc2b9a5;});}return _0x5277bc;})[_0x5da5('0x2a')](respondWithResult(_0x783735,0xc9))[_0x5da5('0x49')](handleError(_0x783735,null));};exports[_0x5da5('0x28')]=function(_0x56523b,_0x2c316e){if(_0x56523b[_0x5da5('0x55')]['id']){delete _0x56523b[_0x5da5('0x55')]['id'];}return db[_0x5da5('0x46')][_0x5da5('0x52')]({'where':{'id':_0x56523b[_0x5da5('0x4b')]['id']}})[_0x5da5('0x2a')](handleEntityNotFound(_0x2c316e,null))[_0x5da5('0x2a')](saveUpdates(_0x56523b[_0x5da5('0x55')],null))[_0x5da5('0x2a')](respondWithResult(_0x2c316e,null))[_0x5da5('0x49')](handleError(_0x2c316e,null));};exports[_0x5da5('0x29')]=function(_0x211b80,_0x197497){return db[_0x5da5('0x46')][_0x5da5('0x52')]({'where':{'id':_0x211b80[_0x5da5('0x4b')]['id']}})[_0x5da5('0x2a')](handleEntityNotFound(_0x197497,null))[_0x5da5('0x2a')](removeEntity(_0x197497,null))[_0x5da5('0x49')](handleError(_0x197497,null));};exports[_0x5da5('0x56')]=function(_0x4cc539,_0x1d3625,_0x35939b){return db['SquareProject']['find']({'where':{'id':_0x4cc539['params']['id']}})[_0x5da5('0x2a')](handleEntityNotFound(_0x1d3625,null))[_0x5da5('0x2a')](function(_0x20c269){if(_0x20c269){return _0x20c269['addUsers'](_0x4cc539['body'][_0x5da5('0x57')],_[_0x5da5('0x58')](_0x4cc539[_0x5da5('0x55')],[_0x5da5('0x57'),'id'])||{});}})['then'](respondWithResult(_0x1d3625,null))[_0x5da5('0x49')](handleError(_0x1d3625,null));};exports[_0x5da5('0x59')]=function(_0x34b4b0,_0x4e4ffa,_0x2d6e0f){return db['SquareProject'][_0x5da5('0x52')]({'where':{'id':_0x34b4b0[_0x5da5('0x4b')]['id']}})[_0x5da5('0x2a')](handleEntityNotFound(_0x4e4ffa,null))[_0x5da5('0x2a')](function(_0x12c983){if(_0x12c983){return _0x12c983[_0x5da5('0x59')](_0x34b4b0[_0x5da5('0x33')][_0x5da5('0x57')])[_0x5da5('0x2a')](function(){if(_[_0x5da5('0x5a')](_0x34b4b0[_0x5da5('0x33')][_0x5da5('0x57')])){for(var _0x34697a=0x0;_0x34697a<_0x34b4b0[_0x5da5('0x33')][_0x5da5('0x57')][_0x5da5('0x3a')];_0x34697a+=0x1){socket[_0x5da5('0x5b')](_0x5da5('0x5c'),{'UserId':Number(_0x34b4b0[_0x5da5('0x33')][_0x5da5('0x57')][_0x34697a]),'SquareProjectId':Number(_0x34b4b0[_0x5da5('0x4b')]['id'])});}}else{socket['emit']('userSquareProject:remove',{'UserId':Number(_0x34b4b0[_0x5da5('0x33')][_0x5da5('0x57')]),'SquareProjectId':Number(_0x34b4b0[_0x5da5('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x4e4ffa,null))[_0x5da5('0x49')](handleError(_0x4e4ffa,null));};exports[_0x5da5('0x5d')]=function(_0x43b55e,_0x23af39,_0x50331b){var _0x2c6689={};var _0x5f3753={};var _0x228f9e;var _0x5f862f;return db[_0x5da5('0x46')][_0x5da5('0x5e')]({'where':{'id':_0x43b55e[_0x5da5('0x4b')]['id']}})[_0x5da5('0x2a')](handleEntityNotFound(_0x23af39,null))[_0x5da5('0x2a')](function(_0x512f01){if(_0x512f01){_0x228f9e=_0x512f01;_0x5f3753['model']=_['keys'](db[_0x5da5('0x5f')][_0x5da5('0x4c')]);_0x5f3753[_0x5da5('0x33')]=_[_0x5da5('0x34')](_0x43b55e[_0x5da5('0x33')]);_0x5f3753[_0x5da5('0x35')]=_[_0x5da5('0x36')](_0x5f3753[_0x5da5('0x37')],_0x5f3753['query']);_0x2c6689[_0x5da5('0x38')]=_[_0x5da5('0x36')](_0x5f3753['model'],qs['fields'](_0x43b55e[_0x5da5('0x33')]['fields']));_0x2c6689[_0x5da5('0x38')]=_0x2c6689['attributes'][_0x5da5('0x3a')]?_0x2c6689[_0x5da5('0x38')]:_0x5f3753[_0x5da5('0x37')];_0x2c6689[_0x5da5('0x60')]=qs[_0x5da5('0x3d')](_0x43b55e[_0x5da5('0x33')][_0x5da5('0x3d')]);_0x2c6689[_0x5da5('0x40')]=qs[_0x5da5('0x35')](_[_0x5da5('0x3e')](_0x43b55e[_0x5da5('0x33')],_0x5f3753[_0x5da5('0x35')]));if(_0x43b55e['query']['filter']){_0x2c6689[_0x5da5('0x40')]=_[_0x5da5('0x41')](_0x2c6689[_0x5da5('0x40')],{'$or':_[_0x5da5('0x31')](_0x2c6689['attributes'],function(_0x487282){var _0x52b71b={};_0x52b71b[_0x487282]={'$like':'%'+_0x43b55e[_0x5da5('0x33')][_0x5da5('0x3f')]+'%'};return _0x52b71b;})});}_0x2c6689=_[_0x5da5('0x41')]({},_0x2c6689,_0x43b55e[_0x5da5('0x4d')]);return _0x228f9e[_0x5da5('0x5d')](_0x2c6689);}})[_0x5da5('0x2a')](function(_0x245a85){if(_0x245a85){_0x5f862f=_0x245a85[_0x5da5('0x3a')];if(!_0x43b55e[_0x5da5('0x33')][_0x5da5('0x3b')](_0x5da5('0x3c'))){_0x2c6689[_0x5da5('0x22')]=qs[_0x5da5('0x22')](_0x43b55e[_0x5da5('0x33')][_0x5da5('0x22')]);_0x2c6689[_0x5da5('0x21')]=qs[_0x5da5('0x21')](_0x43b55e[_0x5da5('0x33')][_0x5da5('0x21')]);}return _0x228f9e[_0x5da5('0x5d')](_0x2c6689);}})[_0x5da5('0x2a')](function(_0x5a7f21){if(_0x5a7f21){return _0x5a7f21?{'count':_0x5f862f,'rows':_0x5a7f21}:null;}})[_0x5da5('0x2a')](respondWithResult(_0x23af39,null))[_0x5da5('0x49')](handleError(_0x23af39,null));}; \ No newline at end of file +var _0x4522=['keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','SquareProjects','UserProfileSection','autoAssociation','UserProfileResource','params','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','User','filters','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./squareProject.socket','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','error','stack','name','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query'];(function(_0x25979f,_0x32a3eb){var _0x4de4e7=function(_0x32bbdd){while(--_0x32bbdd){_0x25979f['push'](_0x25979f['shift']());}};_0x4de4e7(++_0x32a3eb);}(_0x4522,0x1a0));var _0x2452=function(_0x16c7fc,_0x36450b){_0x16c7fc=_0x16c7fc-0x0;var _0x1bf4a1=_0x4522[_0x16c7fc];return _0x1bf4a1;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2452('0x0'));var zipdir=require(_0x2452('0x1'));var jsonpatch=require(_0x2452('0x2'));var rp=require('request-promise');var moment=require(_0x2452('0x3'));var BPromise=require(_0x2452('0x4'));var Mustache=require(_0x2452('0x5'));var util=require(_0x2452('0x6'));var path=require(_0x2452('0x7'));var sox=require(_0x2452('0x8'));var csv=require(_0x2452('0x9'));var ejs=require(_0x2452('0xa'));var fs=require('fs');var _=require(_0x2452('0xb'));var squel=require(_0x2452('0xc'));var crypto=require(_0x2452('0xd'));var jsforce=require(_0x2452('0xe'));var deskjs=require(_0x2452('0xf'));var toCsv=require(_0x2452('0x9'));var querystring=require(_0x2452('0x10'));var Papa=require(_0x2452('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2452('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2452('0x13'))(_0x2452('0x14'));var utils=require(_0x2452('0x15'));var config=require(_0x2452('0x16'));var db=require(_0x2452('0x17'))['db'];config[_0x2452('0x18')]=_[_0x2452('0x19')](config[_0x2452('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2452('0x1a'))['register'](socket);function respondWithStatusCode(_0x33e592,_0x506cd4){_0x506cd4=_0x506cd4||0xcc;return function(_0x209a43){if(_0x209a43){return _0x33e592[_0x2452('0x1b')](_0x506cd4);}return _0x33e592['status'](_0x506cd4)[_0x2452('0x1c')]();};}function respondWithResult(_0x47930c,_0x3dd8cc){_0x3dd8cc=_0x3dd8cc||0xc8;return function(_0x734b88){if(_0x734b88){return _0x47930c[_0x2452('0x1d')](_0x3dd8cc)[_0x2452('0x1e')](_0x734b88);}};}function respondWithFilteredResult(_0x4e1d20,_0x2108e4){return function(_0x16e33a){if(_0x16e33a){var _0x59d89a=_0x16e33a[_0x2452('0x1f')],_0x4802ad=_0x2108e4['offset'],_0x1bfb44=_0x2108e4[_0x2452('0x20')]+_0x2108e4[_0x2452('0x21')],_0x37c6a6;if(_0x1bfb44>=_0x59d89a){_0x1bfb44=_0x59d89a;_0x37c6a6=0xc8;}else{_0x37c6a6=0xce;}_0x4e1d20[_0x2452('0x1d')](_0x37c6a6);return _0x4e1d20[_0x2452('0x22')](_0x2452('0x23'),_0x4802ad+'-'+_0x1bfb44+'/'+_0x59d89a)[_0x2452('0x1e')](_0x16e33a);}return null;};}function patchUpdates(_0x3f48c2){return function(_0xea452e){try{jsonpatch['apply'](_0xea452e,_0x3f48c2,!![]);}catch(_0x48f356){return BPromise[_0x2452('0x24')](_0x48f356);}return _0xea452e[_0x2452('0x25')]();};}function saveUpdates(_0x4bb3ff,_0x17d0a0){return function(_0x395cf1){if(_0x395cf1){return _0x395cf1[_0x2452('0x26')](_0x4bb3ff)[_0x2452('0x27')](function(_0x285281){return _0x285281;});}return null;};}function removeEntity(_0x397f21,_0x155caa){return function(_0x543b06){if(_0x543b06){return _0x543b06[_0x2452('0x28')]()[_0x2452('0x27')](function(){var _0x1561e5=_0x543b06[_0x2452('0x29')]({'plain':!![]});var _0x3a4326='SquareProjects';return db['UserProfileResource'][_0x2452('0x28')]({'where':{'type':_0x3a4326,'resourceId':_0x1561e5['id']}})[_0x2452('0x27')](function(){return _0x543b06;});})[_0x2452('0x27')](function(){_0x397f21[_0x2452('0x1d')](0xcc)[_0x2452('0x1c')]();});}};}function handleEntityNotFound(_0x48b313,_0x3fba00){return function(_0x118db1){if(!_0x118db1){_0x48b313['sendStatus'](0x194);}return _0x118db1;};}function handleError(_0x4a25aa,_0x332878){_0x332878=_0x332878||0x1f4;return function(_0xe8d39b){logger[_0x2452('0x2a')](_0xe8d39b[_0x2452('0x2b')]);if(_0xe8d39b[_0x2452('0x2c')]){delete _0xe8d39b[_0x2452('0x2c')];}_0x4a25aa['status'](_0x332878)['send'](_0xe8d39b);};}exports[_0x2452('0x2d')]=function(_0x454e0a,_0x130565){var _0x5c36aa={},_0x2fb2ae={},_0x586a20={'count':0x0,'rows':[]};var _0x4efbff=_[_0x2452('0x2e')](db[_0x2452('0x2f')][_0x2452('0x30')],function(_0xe97b1c){return{'name':_0xe97b1c[_0x2452('0x31')],'type':_0xe97b1c[_0x2452('0x32')][_0x2452('0x33')]};});_0x2fb2ae[_0x2452('0x34')]=_[_0x2452('0x2e')](_0x4efbff,_0x2452('0x2c'));_0x2fb2ae[_0x2452('0x35')]=_[_0x2452('0x36')](_0x454e0a[_0x2452('0x35')]);_0x2fb2ae['filters']=_[_0x2452('0x37')](_0x2fb2ae[_0x2452('0x34')],_0x2fb2ae['query']);_0x5c36aa[_0x2452('0x38')]=_['intersection'](_0x2fb2ae[_0x2452('0x34')],qs[_0x2452('0x39')](_0x454e0a['query'][_0x2452('0x39')]));_0x5c36aa[_0x2452('0x38')]=_0x5c36aa[_0x2452('0x38')]['length']?_0x5c36aa[_0x2452('0x38')]:_0x2fb2ae[_0x2452('0x34')];if(!_0x454e0a['query'][_0x2452('0x3a')](_0x2452('0x3b'))){_0x5c36aa[_0x2452('0x21')]=qs[_0x2452('0x21')](_0x454e0a[_0x2452('0x35')]['limit']);_0x5c36aa['offset']=qs['offset'](_0x454e0a[_0x2452('0x35')][_0x2452('0x20')]);}_0x5c36aa[_0x2452('0x3c')]=qs[_0x2452('0x3d')](_0x454e0a[_0x2452('0x35')]['sort']);_0x5c36aa[_0x2452('0x3e')]=qs['filters'](_['pick'](_0x454e0a[_0x2452('0x35')],_0x2fb2ae['filters']));if(_0x454e0a[_0x2452('0x35')][_0x2452('0x3f')]){_0x5c36aa['where']=_[_0x2452('0x40')](_0x5c36aa[_0x2452('0x3e')],{'$or':_[_0x2452('0x2e')](_0x4efbff,function(_0x34d7f9){if(_0x34d7f9[_0x2452('0x32')]!==_0x2452('0x41')){var _0x1a1af5={};_0x1a1af5[_0x34d7f9[_0x2452('0x2c')]]={'$like':'%'+_0x454e0a['query'][_0x2452('0x3f')]+'%'};return _0x1a1af5;}})});}_0x5c36aa=_['merge']({},_0x5c36aa,_0x454e0a[_0x2452('0x42')]);var _0x2172dc={'where':_0x5c36aa['where']};return db[_0x2452('0x2f')][_0x2452('0x1f')](_0x2172dc)[_0x2452('0x27')](function(_0x13c6ac){_0x586a20[_0x2452('0x1f')]=_0x13c6ac;if(_0x454e0a['query'][_0x2452('0x43')]){_0x5c36aa[_0x2452('0x44')]=[{'all':!![]}];}return db['SquareProject'][_0x2452('0x45')](_0x5c36aa);})[_0x2452('0x27')](function(_0xf21655){_0x586a20[_0x2452('0x46')]=_0xf21655;return _0x586a20;})['then'](respondWithFilteredResult(_0x130565,_0x5c36aa))[_0x2452('0x47')](handleError(_0x130565,null));};exports[_0x2452('0x48')]=function(_0x1e0d1f,_0x2da77c){var _0x40a413={'raw':![],'where':{'id':_0x1e0d1f['params']['id']}},_0x3cafde={};_0x3cafde[_0x2452('0x34')]=_['keys'](db[_0x2452('0x2f')][_0x2452('0x30')]);_0x3cafde['query']=_['keys'](_0x1e0d1f['query']);_0x3cafde['filters']=_[_0x2452('0x37')](_0x3cafde['model'],_0x3cafde[_0x2452('0x35')]);_0x40a413['attributes']=_[_0x2452('0x37')](_0x3cafde[_0x2452('0x34')],qs['fields'](_0x1e0d1f['query'][_0x2452('0x39')]));_0x40a413['attributes']=_0x40a413[_0x2452('0x38')][_0x2452('0x49')]?_0x40a413[_0x2452('0x38')]:_0x3cafde[_0x2452('0x34')];if(_0x1e0d1f['query']['includeAll']){_0x40a413[_0x2452('0x44')]=[{'all':!![]}];}_0x40a413=_[_0x2452('0x40')]({},_0x40a413,_0x1e0d1f[_0x2452('0x42')]);return db[_0x2452('0x2f')][_0x2452('0x4a')](_0x40a413)['then'](handleEntityNotFound(_0x2da77c,null))[_0x2452('0x27')](respondWithResult(_0x2da77c,null))['catch'](handleError(_0x2da77c,null));};exports[_0x2452('0x4b')]=function(_0x53fd05,_0x454666){return db[_0x2452('0x2f')]['create'](_0x53fd05[_0x2452('0x4c')],{})['then'](function(_0x252d09){var _0x4ae614=_0x53fd05['user']['get']({'plain':!![]});if(!_0x4ae614)throw new Error(_0x2452('0x4d'));if(_0x4ae614[_0x2452('0x4e')]===_0x2452('0x4f')){var _0x4b705f=_0x252d09[_0x2452('0x29')]({'plain':!![]});var _0x39ceba=_0x2452('0x50');return db[_0x2452('0x51')][_0x2452('0x4a')]({'where':{'name':_0x39ceba,'userProfileId':_0x4ae614['userProfileId']},'raw':!![]})[_0x2452('0x27')](function(_0x52d286){if(_0x52d286&&_0x52d286[_0x2452('0x52')]===0x0){return db[_0x2452('0x53')][_0x2452('0x4b')]({'name':_0x4b705f[_0x2452('0x2c')],'resourceId':_0x4b705f['id'],'type':_0x52d286[_0x2452('0x2c')],'sectionId':_0x52d286['id']},{})[_0x2452('0x27')](function(){return _0x252d09;});}else{return _0x252d09;}})[_0x2452('0x47')](function(_0x24b552){logger[_0x2452('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24b552);throw _0x24b552;});}return _0x252d09;})[_0x2452('0x27')](respondWithResult(_0x454666,0xc9))['catch'](handleError(_0x454666,null));};exports[_0x2452('0x26')]=function(_0x594845,_0x3c339c){if(_0x594845[_0x2452('0x4c')]['id']){delete _0x594845['body']['id'];}return db[_0x2452('0x2f')][_0x2452('0x4a')]({'where':{'id':_0x594845[_0x2452('0x54')]['id']}})[_0x2452('0x27')](handleEntityNotFound(_0x3c339c,null))[_0x2452('0x27')](saveUpdates(_0x594845[_0x2452('0x4c')],null))[_0x2452('0x27')](respondWithResult(_0x3c339c,null))[_0x2452('0x47')](handleError(_0x3c339c,null));};exports[_0x2452('0x28')]=function(_0x207df7,_0x44ae1f){return db['SquareProject'][_0x2452('0x4a')]({'where':{'id':_0x207df7['params']['id']}})[_0x2452('0x27')](handleEntityNotFound(_0x44ae1f,null))['then'](removeEntity(_0x44ae1f,null))[_0x2452('0x47')](handleError(_0x44ae1f,null));};exports[_0x2452('0x55')]=function(_0x34966b,_0x1cc61,_0x321092){return db[_0x2452('0x2f')][_0x2452('0x4a')]({'where':{'id':_0x34966b[_0x2452('0x54')]['id']}})[_0x2452('0x27')](handleEntityNotFound(_0x1cc61,null))[_0x2452('0x27')](function(_0x1def15){if(_0x1def15){return _0x1def15['addUsers'](_0x34966b[_0x2452('0x4c')][_0x2452('0x56')],_[_0x2452('0x57')](_0x34966b[_0x2452('0x4c')],[_0x2452('0x56'),'id'])||{});}})[_0x2452('0x27')](respondWithResult(_0x1cc61,null))['catch'](handleError(_0x1cc61,null));};exports[_0x2452('0x58')]=function(_0x41aba2,_0x4bce9e,_0x2c8480){return db[_0x2452('0x2f')][_0x2452('0x4a')]({'where':{'id':_0x41aba2[_0x2452('0x54')]['id']}})[_0x2452('0x27')](handleEntityNotFound(_0x4bce9e,null))[_0x2452('0x27')](function(_0x2aa471){if(_0x2aa471){return _0x2aa471[_0x2452('0x58')](_0x41aba2[_0x2452('0x35')][_0x2452('0x56')])[_0x2452('0x27')](function(){if(_['isArray'](_0x41aba2['query'][_0x2452('0x56')])){for(var _0x4c41f9=0x0;_0x4c41f9<_0x41aba2[_0x2452('0x35')][_0x2452('0x56')][_0x2452('0x49')];_0x4c41f9+=0x1){socket[_0x2452('0x59')](_0x2452('0x5a'),{'UserId':Number(_0x41aba2[_0x2452('0x35')]['ids'][_0x4c41f9]),'SquareProjectId':Number(_0x41aba2['params']['id'])});}}else{socket[_0x2452('0x59')]('userSquareProject:remove',{'UserId':Number(_0x41aba2[_0x2452('0x35')]['ids']),'SquareProjectId':Number(_0x41aba2[_0x2452('0x54')]['id'])});}});}})[_0x2452('0x27')](respondWithStatusCode(_0x4bce9e,null))[_0x2452('0x47')](handleError(_0x4bce9e,null));};exports[_0x2452('0x5b')]=function(_0x4b9f76,_0x501d15,_0x505d5a){var _0x9ef864={};var _0x19fb42={};var _0x5a1f23;var _0x4f1891;return db['SquareProject']['findOne']({'where':{'id':_0x4b9f76['params']['id']}})[_0x2452('0x27')](handleEntityNotFound(_0x501d15,null))['then'](function(_0x513815){if(_0x513815){_0x5a1f23=_0x513815;_0x19fb42[_0x2452('0x34')]=_[_0x2452('0x36')](db[_0x2452('0x5c')][_0x2452('0x30')]);_0x19fb42[_0x2452('0x35')]=_[_0x2452('0x36')](_0x4b9f76['query']);_0x19fb42[_0x2452('0x5d')]=_[_0x2452('0x37')](_0x19fb42[_0x2452('0x34')],_0x19fb42['query']);_0x9ef864['attributes']=_[_0x2452('0x37')](_0x19fb42[_0x2452('0x34')],qs[_0x2452('0x39')](_0x4b9f76[_0x2452('0x35')][_0x2452('0x39')]));_0x9ef864[_0x2452('0x38')]=_0x9ef864[_0x2452('0x38')][_0x2452('0x49')]?_0x9ef864['attributes']:_0x19fb42[_0x2452('0x34')];_0x9ef864[_0x2452('0x3c')]=qs[_0x2452('0x3d')](_0x4b9f76[_0x2452('0x35')]['sort']);_0x9ef864[_0x2452('0x3e')]=qs[_0x2452('0x5d')](_['pick'](_0x4b9f76[_0x2452('0x35')],_0x19fb42[_0x2452('0x5d')]));if(_0x4b9f76[_0x2452('0x35')][_0x2452('0x3f')]){_0x9ef864[_0x2452('0x3e')]=_[_0x2452('0x40')](_0x9ef864[_0x2452('0x3e')],{'$or':_[_0x2452('0x2e')](_0x9ef864['attributes'],function(_0x4f21e7){var _0x2d4bad={};_0x2d4bad[_0x4f21e7]={'$like':'%'+_0x4b9f76[_0x2452('0x35')][_0x2452('0x3f')]+'%'};return _0x2d4bad;})});}_0x9ef864=_[_0x2452('0x40')]({},_0x9ef864,_0x4b9f76['options']);return _0x5a1f23[_0x2452('0x5b')](_0x9ef864);}})[_0x2452('0x27')](function(_0x2101f3){if(_0x2101f3){_0x4f1891=_0x2101f3[_0x2452('0x49')];if(!_0x4b9f76['query'][_0x2452('0x3a')](_0x2452('0x3b'))){_0x9ef864[_0x2452('0x21')]=qs[_0x2452('0x21')](_0x4b9f76['query']['limit']);_0x9ef864[_0x2452('0x20')]=qs[_0x2452('0x20')](_0x4b9f76['query'][_0x2452('0x20')]);}return _0x5a1f23[_0x2452('0x5b')](_0x9ef864);}})[_0x2452('0x27')](function(_0x19b52b){if(_0x19b52b){return _0x19b52b?{'count':_0x4f1891,'rows':_0x19b52b}:null;}})[_0x2452('0x27')](respondWithResult(_0x501d15,null))[_0x2452('0x47')](handleError(_0x501d15,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 00efff7..88d0d41 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 _0x88f2=['SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1d1d34,_0x49c0ec){var _0x4d8023=function(_0x36ee56){while(--_0x36ee56){_0x1d1d34['push'](_0x1d1d34['shift']());}};_0x4d8023(++_0x49c0ec);}(_0x88f2,0x1c1));var _0x288f=function(_0x1d04c8,_0x43e69b){_0x1d04c8=_0x1d04c8-0x0;var _0x30ba8f=_0x88f2[_0x1d04c8];return _0x30ba8f;};'use strict';var EventEmitter=require(_0x288f('0x0'));var SquareProject=require(_0x288f('0x1'))['db'][_0x288f('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x288f('0x3')](0x0);var events={'afterCreate':_0x288f('0x4'),'afterUpdate':_0x288f('0x5'),'afterDestroy':_0x288f('0x6')};function emitEvent(_0x23248a){return function(_0x2750b7,_0x174387,_0x265aa9){SquareProjectEvents[_0x288f('0x7')](_0x23248a+':'+_0x2750b7['id'],_0x2750b7);SquareProjectEvents[_0x288f('0x7')](_0x23248a,_0x2750b7);_0x265aa9(null);};}for(var e in events){if(events[_0x288f('0x8')](e)){var event=events[e];SquareProject[_0x288f('0x9')](e,emitEvent(event));}}module[_0x288f('0xa')]=SquareProjectEvents; \ No newline at end of file +var _0x7b47=['exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3b1095,_0x315f33){var _0x1e328c=function(_0x1f51b8){while(--_0x1f51b8){_0x3b1095['push'](_0x3b1095['shift']());}};_0x1e328c(++_0x315f33);}(_0x7b47,0x118));var _0x77b4=function(_0x4b2901,_0x387881){_0x4b2901=_0x4b2901-0x0;var _0x3ccea6=_0x7b47[_0x4b2901];return _0x3ccea6;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x77b4('0x0'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x77b4('0x1')](0x0);var events={'afterCreate':_0x77b4('0x2'),'afterUpdate':_0x77b4('0x3'),'afterDestroy':_0x77b4('0x4')};function emitEvent(_0x5257c1){return function(_0x3dd6f5,_0x55c9b4,_0x23f1f6){SquareProjectEvents[_0x77b4('0x5')](_0x5257c1+':'+_0x3dd6f5['id'],_0x3dd6f5);SquareProjectEvents[_0x77b4('0x5')](_0x5257c1,_0x3dd6f5);_0x23f1f6(null);};}for(var e in events){if(events[_0x77b4('0x6')](e)){var event=events[e];SquareProject[_0x77b4('0x7')](e,emitEvent(event));}}module[_0x77b4('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index cdadd16..e54398e 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 _0x2f76=['path','rimraf','../../config/environment','exports','define','lodash','../../config/logger','api','moment','bluebird'];(function(_0x344357,_0x484651){var _0x1aaa49=function(_0x8392f0){while(--_0x8392f0){_0x344357['push'](_0x344357['shift']());}};_0x1aaa49(++_0x484651);}(_0x2f76,0x11d));var _0x62f7=function(_0x506f99,_0x24448f){_0x506f99=_0x506f99-0x0;var _0x5ac530=_0x2f76[_0x506f99];return _0x5ac530;};'use strict';var _=require(_0x62f7('0x0'));var util=require('util');var logger=require(_0x62f7('0x1'))(_0x62f7('0x2'));var moment=require(_0x62f7('0x3'));var BPromise=require(_0x62f7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x62f7('0x5'));var rimraf=require(_0x62f7('0x6'));var config=require(_0x62f7('0x7'));var attributes=require('./squareProject.attributes');module[_0x62f7('0x8')]=function(_0xd9362e,_0x3fb199){return _0xd9362e[_0x62f7('0x9')]('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb6b4=['square_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./squareProject.attributes','exports','define','SquareProject'];(function(_0x3616bb,_0x86fe00){var _0x1c0994=function(_0x46a1d4){while(--_0x46a1d4){_0x3616bb['push'](_0x3616bb['shift']());}};_0x1c0994(++_0x86fe00);}(_0xb6b4,0xe1));var _0x4b6b=function(_0x52e387,_0x418976){_0x52e387=_0x52e387-0x0;var _0x223d3f=_0xb6b4[_0x52e387];return _0x223d3f;};'use strict';var _=require(_0x4b6b('0x0'));var util=require(_0x4b6b('0x1'));var logger=require(_0x4b6b('0x2'))(_0x4b6b('0x3'));var moment=require(_0x4b6b('0x4'));var BPromise=require(_0x4b6b('0x5'));var rp=require(_0x4b6b('0x6'));var fs=require('fs');var path=require(_0x4b6b('0x7'));var rimraf=require(_0x4b6b('0x8'));var config=require('../../config/environment');var attributes=require(_0x4b6b('0x9'));module[_0x4b6b('0xa')]=function(_0x3a6f4f,_0x19a180){return _0x3a6f4f[_0x4b6b('0xb')](_0x4b6b('0xc'),attributes,{'tableName':_0x4b6b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index f5a8aba..c91adb7 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 _0x9faa=['code','SquareProject,\x20%s,\x20%s','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','model','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','then','info','debug','SquareProject,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x2991ea,_0x4a0231){var _0x4e1c51=function(_0x59ed64){while(--_0x59ed64){_0x2991ea['push'](_0x2991ea['shift']());}};_0x4e1c51(++_0x4a0231);}(_0x9faa,0x120));var _0xa9fa=function(_0x12b2ba,_0x2591fa){_0x12b2ba=_0x12b2ba-0x0;var _0x521d7f=_0x9faa[_0x12b2ba];return _0x521d7f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa9fa('0x0'));var BPromise=require(_0xa9fa('0x1'));var rs=require(_0xa9fa('0x2'));var fs=require('fs');var Redis=require(_0xa9fa('0x3'));var db=require(_0xa9fa('0x4'))['db'];var utils=require(_0xa9fa('0x5'));var logger=require(_0xa9fa('0x6'))(_0xa9fa('0x7'));var config=require(_0xa9fa('0x8'));var jayson=require(_0xa9fa('0x9'));var client=jayson['client'][_0xa9fa('0xa')]({'port':0x232a});config[_0xa9fa('0xb')]=_[_0xa9fa('0xc')](config[_0xa9fa('0xb')],{'host':_0xa9fa('0xd'),'port':0x18eb});var socket=require(_0xa9fa('0xe'))(new Redis(config[_0xa9fa('0xb')]));require(_0xa9fa('0xf'))[_0xa9fa('0x10')](socket);function respondWithRpcPromise(_0x1b1c5e,_0x1b920f,_0x234e47){return new BPromise(function(_0x3363fb,_0x4b91f2){return client[_0xa9fa('0x11')](_0x1b1c5e,_0x234e47)[_0xa9fa('0x12')](function(_0x57661a){logger[_0xa9fa('0x13')]('SquareProject,\x20%s,\x20%s',_0x1b920f,'request\x20sent');logger[_0xa9fa('0x14')](_0xa9fa('0x15'),_0x1b920f,_0xa9fa('0x16'),JSON['stringify'](_0x57661a));if(_0x57661a[_0xa9fa('0x17')]){if(_0x57661a['error'][_0xa9fa('0x18')]===0x1f4){logger['error'](_0xa9fa('0x19'),_0x1b920f,_0x57661a[_0xa9fa('0x17')][_0xa9fa('0x1a')]);return _0x4b91f2(_0x57661a['error']['message']);}logger[_0xa9fa('0x17')]('SquareProject,\x20%s,\x20%s',_0x1b920f,_0x57661a[_0xa9fa('0x17')][_0xa9fa('0x1a')]);return _0x3363fb(_0x57661a[_0xa9fa('0x17')][_0xa9fa('0x1a')]);}else{logger['info'](_0xa9fa('0x19'),_0x1b920f,'request\x20sent');_0x3363fb(_0x57661a[_0xa9fa('0x1b')]['message']);}})[_0xa9fa('0x1c')](function(_0x4513a4){logger[_0xa9fa('0x17')](_0xa9fa('0x19'),_0x1b920f,_0x4513a4);_0x4b91f2(_0x4513a4);});});}exports[_0xa9fa('0x1d')]=function(_0x95c8aa){var _0x2e994b=this;return new Promise(function(_0x315fe8,_0x2413db){return db[_0xa9fa('0x1e')][_0xa9fa('0x1f')]({'raw':_0x95c8aa[_0xa9fa('0x20')]?_0x95c8aa['options'][_0xa9fa('0x21')]===undefined?!![]:![]:!![],'where':_0x95c8aa[_0xa9fa('0x20')]?_0x95c8aa[_0xa9fa('0x20')][_0xa9fa('0x22')]||null:null,'attributes':_0x95c8aa[_0xa9fa('0x20')]?_0x95c8aa[_0xa9fa('0x20')][_0xa9fa('0x23')]||null:null,'include':_0x95c8aa['options']?_0x95c8aa[_0xa9fa('0x20')][_0xa9fa('0x24')]?_[_0xa9fa('0x25')](_0x95c8aa[_0xa9fa('0x20')][_0xa9fa('0x24')],function(_0x2f6ad1){return{'model':db[_0x2f6ad1[_0xa9fa('0x26')]],'as':_0x2f6ad1['as'],'attributes':_0x2f6ad1[_0xa9fa('0x23')],'include':_0x2f6ad1['include']?_['map'](_0x2f6ad1[_0xa9fa('0x24')],function(_0x2f377f){return{'model':db[_0x2f377f[_0xa9fa('0x26')]],'as':_0x2f377f['as'],'attributes':_0x2f377f[_0xa9fa('0x23')],'include':_0x2f377f[_0xa9fa('0x24')]?_[_0xa9fa('0x25')](_0x2f377f[_0xa9fa('0x24')],function(_0x1bdf4a){return{'model':db[_0x1bdf4a[_0xa9fa('0x26')]],'as':_0x1bdf4a['as'],'attributes':_0x1bdf4a['attributes']};}):[]};}):[]};}):[]:[]})[_0xa9fa('0x12')](function(_0xe3a536){logger[_0xa9fa('0x13')]('ShowSquareProject',_0x95c8aa);logger[_0xa9fa('0x14')](_0xa9fa('0x1d'),_0x95c8aa,JSON['stringify'](_0xe3a536));_0x315fe8(_0xe3a536);})[_0xa9fa('0x1c')](function(_0x5e75a9){logger[_0xa9fa('0x17')](_0xa9fa('0x1d'),_0x5e75a9[_0xa9fa('0x1a')],_0x95c8aa);_0x2413db(_0x2e994b['error'](0x1f4,_0x5e75a9[_0xa9fa('0x1a')]));});});}; \ No newline at end of file +var _0xaafa=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','./squareProject.socket','register','info','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareProject,\x20%s,\x20%s','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','util'];(function(_0x58b94a,_0x4d8d46){var _0x12dd8b=function(_0x176a3f){while(--_0x176a3f){_0x58b94a['push'](_0x58b94a['shift']());}};_0x12dd8b(++_0x4d8d46);}(_0xaafa,0x108));var _0xaaaf=function(_0x3b4eaa,_0x43d92c){_0x3b4eaa=_0x3b4eaa-0x0;var _0x2f92fd=_0xaafa[_0x3b4eaa];return _0x2f92fd;};'use strict';var _=require(_0xaaaf('0x0'));var util=require(_0xaaaf('0x1'));var moment=require(_0xaaaf('0x2'));var BPromise=require('bluebird');var rs=require(_0xaaaf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaaaf('0x4'))['db'];var utils=require(_0xaaaf('0x5'));var logger=require(_0xaaaf('0x6'))(_0xaaaf('0x7'));var config=require(_0xaaaf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaaaf('0x9')][_0xaaaf('0xa')]({'port':0x232a});config['redis']=_[_0xaaaf('0xb')](config[_0xaaaf('0xc')],{'host':_0xaaaf('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaaaf('0xc')]));require(_0xaaaf('0xe'))[_0xaaaf('0xf')](socket);function respondWithRpcPromise(_0x180e80,_0x4ca396,_0x36e614){return new BPromise(function(_0x22181c,_0x43826b){return client['request'](_0x180e80,_0x36e614)['then'](function(_0x2b2d83){logger[_0xaaaf('0x10')]('SquareProject,\x20%s,\x20%s',_0x4ca396,_0xaaaf('0x11'));logger[_0xaaaf('0x12')](_0xaaaf('0x13'),_0x4ca396,_0xaaaf('0x11'),JSON[_0xaaaf('0x14')](_0x2b2d83));if(_0x2b2d83['error']){if(_0x2b2d83[_0xaaaf('0x15')][_0xaaaf('0x16')]===0x1f4){logger[_0xaaaf('0x15')](_0xaaaf('0x17'),_0x4ca396,_0x2b2d83[_0xaaaf('0x15')][_0xaaaf('0x18')]);return _0x43826b(_0x2b2d83['error'][_0xaaaf('0x18')]);}logger[_0xaaaf('0x15')](_0xaaaf('0x17'),_0x4ca396,_0x2b2d83['error'][_0xaaaf('0x18')]);return _0x22181c(_0x2b2d83[_0xaaaf('0x15')][_0xaaaf('0x18')]);}else{logger[_0xaaaf('0x10')](_0xaaaf('0x17'),_0x4ca396,_0xaaaf('0x11'));_0x22181c(_0x2b2d83[_0xaaaf('0x19')]['message']);}})[_0xaaaf('0x1a')](function(_0x3376b2){logger[_0xaaaf('0x15')](_0xaaaf('0x17'),_0x4ca396,_0x3376b2);_0x43826b(_0x3376b2);});});}exports[_0xaaaf('0x1b')]=function(_0x1372ad){var _0x162e8d=this;return new Promise(function(_0x173bfd,_0x12b7ed){return db[_0xaaaf('0x1c')][_0xaaaf('0x1d')]({'raw':_0x1372ad['options']?_0x1372ad[_0xaaaf('0x1e')][_0xaaaf('0x1f')]===undefined?!![]:![]:!![],'where':_0x1372ad[_0xaaaf('0x1e')]?_0x1372ad[_0xaaaf('0x1e')][_0xaaaf('0x20')]||null:null,'attributes':_0x1372ad[_0xaaaf('0x1e')]?_0x1372ad[_0xaaaf('0x1e')][_0xaaaf('0x21')]||null:null,'include':_0x1372ad['options']?_0x1372ad[_0xaaaf('0x1e')][_0xaaaf('0x22')]?_['map'](_0x1372ad[_0xaaaf('0x1e')]['include'],function(_0x349777){return{'model':db[_0x349777['model']],'as':_0x349777['as'],'attributes':_0x349777[_0xaaaf('0x21')],'include':_0x349777['include']?_[_0xaaaf('0x23')](_0x349777[_0xaaaf('0x22')],function(_0x49c25f){return{'model':db[_0x49c25f[_0xaaaf('0x24')]],'as':_0x49c25f['as'],'attributes':_0x49c25f[_0xaaaf('0x21')],'include':_0x49c25f[_0xaaaf('0x22')]?_[_0xaaaf('0x23')](_0x49c25f[_0xaaaf('0x22')],function(_0x32fad2){return{'model':db[_0x32fad2['model']],'as':_0x32fad2['as'],'attributes':_0x32fad2[_0xaaaf('0x21')]};}):[]};}):[]};}):[]:[]})[_0xaaaf('0x25')](function(_0x4d2078){logger[_0xaaaf('0x10')](_0xaaaf('0x1b'),_0x1372ad);logger['debug']('ShowSquareProject',_0x1372ad,JSON[_0xaaaf('0x14')](_0x4d2078));_0x173bfd(_0x4d2078);})[_0xaaaf('0x1a')](function(_0x1b731b){logger[_0xaaaf('0x15')](_0xaaaf('0x1b'),_0x1b731b[_0xaaaf('0x18')],_0x1372ad);_0x12b7ed(_0x162e8d['error'](0x1f4,_0x1b731b['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 5e14d27..21be2bf 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 _0x33af=['emit','removeListener','register','length','squareProject:','save','update'];(function(_0x3792d0,_0x14e951){var _0x3b2877=function(_0x343ed5){while(--_0x343ed5){_0x3792d0['push'](_0x3792d0['shift']());}};_0x3b2877(++_0x14e951);}(_0x33af,0xec));var _0xf33a=function(_0x11e239,_0x3cfa93){_0x11e239=_0x11e239-0x0;var _0x4b1ee8=_0x33af[_0x11e239];return _0x4b1ee8;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0xf33a('0x0'),'remove',_0xf33a('0x1')];function createListener(_0x1111c6,_0x267057){return function(_0x4303f1){_0x267057[_0xf33a('0x2')](_0x1111c6,_0x4303f1);};}function removeListener(_0x25f156,_0x4c734e){return function(){SquareProjectEvents[_0xf33a('0x3')](_0x25f156,_0x4c734e);};}exports[_0xf33a('0x4')]=function(_0x583e54){for(var _0xc0dd13=0x0,_0x384b14=events[_0xf33a('0x5')];_0xc0dd13<_0x384b14;_0xc0dd13++){var _0x2f3730=events[_0xc0dd13];var _0x2baabb=createListener(_0xf33a('0x6')+_0x2f3730,_0x583e54);SquareProjectEvents['on'](_0x2f3730,_0x2baabb);}}; \ No newline at end of file +var _0xe3da=['length','squareProject:','./squareProject.events','save','remove','update','emit','removeListener','register'];(function(_0x5c64ab,_0x42ddc0){var _0x8a08e6=function(_0x260cdc){while(--_0x260cdc){_0x5c64ab['push'](_0x5c64ab['shift']());}};_0x8a08e6(++_0x42ddc0);}(_0xe3da,0x1cd));var _0xae3d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe3da[_0x19950b];return _0x3c6b41;};'use strict';var SquareProjectEvents=require(_0xae3d('0x0'));var events=[_0xae3d('0x1'),_0xae3d('0x2'),_0xae3d('0x3')];function createListener(_0x2bba92,_0x190f0d){return function(_0x109dca){_0x190f0d[_0xae3d('0x4')](_0x2bba92,_0x109dca);};}function removeListener(_0xb2dfd3,_0x22bacf){return function(){SquareProjectEvents[_0xae3d('0x5')](_0xb2dfd3,_0x22bacf);};}exports[_0xae3d('0x6')]=function(_0xa9a1a){for(var _0xa54808=0x0,_0x476579=events[_0xae3d('0x7')];_0xa54808<_0x476579;_0xa54808++){var _0x583b98=events[_0xa54808];var _0x2a5c45=createListener(_0xae3d('0x8')+_0x583b98,_0xa9a1a);SquareProjectEvents['on'](_0x583b98,_0x2a5c45);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 48d47e2..ae18945 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 _0x0dd1=['/:id/delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete'];(function(_0x214596,_0x436156){var _0x39169b=function(_0x291d7a){while(--_0x291d7a){_0x214596['push'](_0x214596['shift']());}};_0x39169b(++_0x436156);}(_0x0dd1,0x80));var _0x10dd=function(_0x6ff3a9,_0x13b9c2){_0x6ff3a9=_0x6ff3a9-0x0;var _0x249066=_0x0dd1[_0x6ff3a9];return _0x249066;};'use strict';var multer=require(_0x10dd('0x0'));var util=require('util');var path=require(_0x10dd('0x1'));var timeout=require(_0x10dd('0x2'));var express=require(_0x10dd('0x3'));var router=express[_0x10dd('0x4')]();var auth=require(_0x10dd('0x5'));var interaction=require(_0x10dd('0x6'));var config=require(_0x10dd('0x7'));var controller=require(_0x10dd('0x8'));router[_0x10dd('0x9')]('/',auth[_0x10dd('0xa')](),controller[_0x10dd('0xb')]);router[_0x10dd('0x9')]('/:id',auth[_0x10dd('0xa')](),controller[_0x10dd('0xc')]);router[_0x10dd('0x9')]('/:id/download',auth[_0x10dd('0xa')](),controller['download']);router[_0x10dd('0xd')]('/',auth[_0x10dd('0xa')](),controller[_0x10dd('0xe')]);router[_0x10dd('0xf')](_0x10dd('0x10'),auth[_0x10dd('0xa')](),controller[_0x10dd('0x11')]);router[_0x10dd('0x12')](_0x10dd('0x13'),auth[_0x10dd('0xa')](),controller[_0x10dd('0x14')]);module['exports']=router; \ No newline at end of file +var _0x10e6=['./squareRecording.controller','isAuthenticated','get','show','/:id/download','download','put','/:id','update','/:id/delete','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4832cc,_0x21f5cb){var _0x5d621a=function(_0x5b1310){while(--_0x5b1310){_0x4832cc['push'](_0x4832cc['shift']());}};_0x5d621a(++_0x21f5cb);}(_0x10e6,0xbf));var _0x610e=function(_0x445101,_0x2414bf){_0x445101=_0x445101-0x0;var _0x3c3d04=_0x10e6[_0x445101];return _0x3c3d04;};'use strict';var multer=require(_0x610e('0x0'));var util=require('util');var path=require(_0x610e('0x1'));var timeout=require('connect-timeout');var express=require(_0x610e('0x2'));var router=express[_0x610e('0x3')]();var auth=require(_0x610e('0x4'));var interaction=require(_0x610e('0x5'));var config=require(_0x610e('0x6'));var controller=require(_0x610e('0x7'));router['get']('/',auth[_0x610e('0x8')](),controller['index']);router[_0x610e('0x9')]('/:id',auth[_0x610e('0x8')](),controller[_0x610e('0xa')]);router[_0x610e('0x9')](_0x610e('0xb'),auth[_0x610e('0x8')](),controller[_0x610e('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x610e('0xd')](_0x610e('0xe'),auth[_0x610e('0x8')](),controller[_0x610e('0xf')]);router['delete'](_0x610e('0x10'),auth[_0x610e('0x8')](),controller['destroy']);module[_0x610e('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 15a57d8..6d2385f 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 _0x6197=['sequelize','STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf'];(function(_0x4abf13,_0x11696f){var _0x126df9=function(_0x222d82){while(--_0x222d82){_0x4abf13['push'](_0x4abf13['shift']());}};_0x126df9(++_0x11696f);}(_0x6197,0x142));var _0x7619=function(_0x14e7f7,_0x4e1e53){_0x14e7f7=_0x14e7f7-0x0;var _0x1cd6a7=_0x6197[_0x14e7f7];return _0x1cd6a7;};'use strict';var Sequelize=require(_0x7619('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x7619('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7619('0x1')]},'context':{'type':Sequelize[_0x7619('0x1')]},'extension':{'type':Sequelize[_0x7619('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x7619('0x1')]},'dnid':{'type':Sequelize[_0x7619('0x1')]},'projectName':{'type':Sequelize[_0x7619('0x1')]},'saveName':{'type':Sequelize[_0x7619('0x1')]},'filename':{'type':Sequelize[_0x7619('0x1')]},'savePath':{'type':Sequelize[_0x7619('0x1')]},'format':{'type':Sequelize[_0x7619('0x2')],'get':function(){var _0x42b027='';var _0x34f8e4=this[_0x7619('0x3')](_0x7619('0x4'));if(_0x34f8e4){_0x42b027=_0x34f8e4[_0x7619('0x5')](_0x34f8e4[_0x7619('0x6')]('.'));}return _0x42b027;}}}; \ No newline at end of file +var _0x0227=['STRING','getDataValue','savePath','substring','sequelize','exports'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x0227,0xa0));var _0x7022=function(_0x1d9685,_0x402b19){_0x1d9685=_0x1d9685-0x0;var _0x58aee9=_0x0227[_0x1d9685];return _0x58aee9;};'use strict';var Sequelize=require(_0x7022('0x0'));module[_0x7022('0x1')]={'uniqueid':{'type':Sequelize[_0x7022('0x2')]},'callerid':{'type':Sequelize[_0x7022('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x7022('0x2')]},'extension':{'type':Sequelize[_0x7022('0x2')]},'priority':{'type':Sequelize[_0x7022('0x2')]},'accountcode':{'type':Sequelize[_0x7022('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x7022('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x7022('0x2')]},'savePath':{'type':Sequelize[_0x7022('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x4fff3c='';var _0x4443d9=this[_0x7022('0x3')](_0x7022('0x4'));if(_0x4443d9){_0x4fff3c=_0x4443d9[_0x7022('0x5')](_0x4443d9['lastIndexOf']('.'));}return _0x4fff3c;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 6f568e4..a92bb47 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 _0x6abd=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','SquareRecording','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','offset','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','catch','show','params','rawAttributes','length','include','options','create','body','find','download','uniqueid','savePath','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','html-pdf','eml-format','rimraf'];(function(_0xd54d1e,_0x9d67ec){var _0x51a6ee=function(_0x52be36){while(--_0x52be36){_0xd54d1e['push'](_0xd54d1e['shift']());}};_0x51a6ee(++_0x9d67ec);}(_0x6abd,0x185));var _0xd6ab=function(_0x24f306,_0x99ef58){_0x24f306=_0x24f306-0x0;var _0x4a77b0=_0x6abd[_0x24f306];return _0x4a77b0;};'use strict';var pdf=require(_0xd6ab('0x0'));var emlformat=require(_0xd6ab('0x1'));var rimraf=require(_0xd6ab('0x2'));var zipdir=require(_0xd6ab('0x3'));var jsonpatch=require(_0xd6ab('0x4'));var rp=require(_0xd6ab('0x5'));var moment=require(_0xd6ab('0x6'));var BPromise=require(_0xd6ab('0x7'));var Mustache=require(_0xd6ab('0x8'));var util=require(_0xd6ab('0x9'));var path=require(_0xd6ab('0xa'));var sox=require(_0xd6ab('0xb'));var csv=require(_0xd6ab('0xc'));var ejs=require(_0xd6ab('0xd'));var fs=require('fs');var _=require(_0xd6ab('0xe'));var squel=require(_0xd6ab('0xf'));var crypto=require(_0xd6ab('0x10'));var jsforce=require(_0xd6ab('0x11'));var deskjs=require(_0xd6ab('0x12'));var toCsv=require(_0xd6ab('0xc'));var querystring=require(_0xd6ab('0x13'));var Papa=require('papaparse');var Redis=require(_0xd6ab('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xd6ab('0x15'));var as=require(_0xd6ab('0x16'));var hardwareService=require(_0xd6ab('0x17'));var logger=require(_0xd6ab('0x18'))(_0xd6ab('0x19'));var utils=require('../../config/utils');var config=require(_0xd6ab('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cef1c,_0x499e75){_0x499e75=_0x499e75||0xcc;return function(_0x205215){if(_0x205215){return _0x3cef1c[_0xd6ab('0x1b')](_0x499e75);}return _0x3cef1c[_0xd6ab('0x1c')](_0x499e75)[_0xd6ab('0x1d')]();};}function respondWithResult(_0x4b9345,_0x47e7af){_0x47e7af=_0x47e7af||0xc8;return function(_0x1bab79){if(_0x1bab79){return _0x4b9345[_0xd6ab('0x1c')](_0x47e7af)[_0xd6ab('0x1e')](_0x1bab79);}};}function respondWithFilteredResult(_0x12751f,_0x519ab7){return function(_0x417af8){if(_0x417af8){var _0x140f9b=_0x417af8[_0xd6ab('0x1f')],_0x1ed251=_0x519ab7['offset'],_0x42f099=_0x519ab7['offset']+_0x519ab7[_0xd6ab('0x20')],_0x45c5a8;if(_0x42f099>=_0x140f9b){_0x42f099=_0x140f9b;_0x45c5a8=0xc8;}else{_0x45c5a8=0xce;}_0x12751f['status'](_0x45c5a8);return _0x12751f[_0xd6ab('0x21')](_0xd6ab('0x22'),_0x1ed251+'-'+_0x42f099+'/'+_0x140f9b)[_0xd6ab('0x1e')](_0x417af8);}return null;};}function patchUpdates(_0x55fbde){return function(_0x5d787a){try{jsonpatch['apply'](_0x5d787a,_0x55fbde,!![]);}catch(_0x546d12){return BPromise[_0xd6ab('0x23')](_0x546d12);}return _0x5d787a[_0xd6ab('0x24')]();};}function saveUpdates(_0x16ae33,_0x4e0963){return function(_0x134f00){if(_0x134f00){return _0x134f00[_0xd6ab('0x25')](_0x16ae33)[_0xd6ab('0x26')](function(_0x54cf04){return _0x54cf04;});}return null;};}function removeEntity(_0x58cc7b,_0x12d2af){return function(_0x9fea6d){if(_0x9fea6d){return _0x9fea6d[_0xd6ab('0x27')]()[_0xd6ab('0x26')](function(){_0x58cc7b[_0xd6ab('0x1c')](0xcc)[_0xd6ab('0x1d')]();});}};}function handleEntityNotFound(_0x3153a9,_0x809747){return function(_0x318afb){if(!_0x318afb){_0x3153a9[_0xd6ab('0x1b')](0x194);}return _0x318afb;};}function handleError(_0x2cab6d,_0x1e6143){_0x1e6143=_0x1e6143||0x1f4;return function(_0x32a89a){logger['error'](_0x32a89a[_0xd6ab('0x28')]);if(_0x32a89a[_0xd6ab('0x29')]){delete _0x32a89a[_0xd6ab('0x29')];}_0x2cab6d['status'](_0x1e6143)[_0xd6ab('0x2a')](_0x32a89a);};}exports[_0xd6ab('0x2b')]=function(_0x38db5f,_0x3e7b8c){var _0x3860ae={},_0x4cafc5={},_0x7de794={'count':0x0,'rows':[]};var _0x47840d=_[_0xd6ab('0x2c')](db[_0xd6ab('0x2d')]['rawAttributes'],function(_0x2f5675){return{'name':_0x2f5675['fieldName'],'type':_0x2f5675[_0xd6ab('0x2e')][_0xd6ab('0x2f')]};});_0x4cafc5[_0xd6ab('0x30')]=_['map'](_0x47840d,_0xd6ab('0x29'));_0x4cafc5['query']=_[_0xd6ab('0x31')](_0x38db5f[_0xd6ab('0x32')]);_0x4cafc5[_0xd6ab('0x33')]=_[_0xd6ab('0x34')](_0x4cafc5[_0xd6ab('0x30')],_0x4cafc5[_0xd6ab('0x32')]);_0x3860ae['attributes']=_[_0xd6ab('0x34')](_0x4cafc5[_0xd6ab('0x30')],qs['fields'](_0x38db5f[_0xd6ab('0x32')][_0xd6ab('0x35')]));_0x3860ae['attributes']=_0x3860ae[_0xd6ab('0x36')]['length']?_0x3860ae['attributes']:_0x4cafc5[_0xd6ab('0x30')];if(!_0x38db5f[_0xd6ab('0x32')][_0xd6ab('0x37')]('nolimit')){_0x3860ae['limit']=qs[_0xd6ab('0x20')](_0x38db5f[_0xd6ab('0x32')][_0xd6ab('0x20')]);_0x3860ae['offset']=qs[_0xd6ab('0x38')](_0x38db5f[_0xd6ab('0x32')]['offset']);}_0x3860ae[_0xd6ab('0x39')]=qs[_0xd6ab('0x3a')](_0x38db5f[_0xd6ab('0x32')]['sort']);_0x3860ae['where']=qs['filters'](_[_0xd6ab('0x3b')](_0x38db5f[_0xd6ab('0x32')],_0x4cafc5[_0xd6ab('0x33')]));if(_0x38db5f['query'][_0xd6ab('0x3c')]){_0x3860ae[_0xd6ab('0x3d')]=_[_0xd6ab('0x3e')](_0x3860ae['where'],{'$or':_['map'](_0x47840d,function(_0x7e4ee4){if(_0x7e4ee4[_0xd6ab('0x2e')]!==_0xd6ab('0x3f')){var _0x1b8b16={};_0x1b8b16[_0x7e4ee4[_0xd6ab('0x29')]]={'$like':'%'+_0x38db5f[_0xd6ab('0x32')][_0xd6ab('0x3c')]+'%'};return _0x1b8b16;}})});}_0x3860ae=_[_0xd6ab('0x3e')]({},_0x3860ae,_0x38db5f['options']);var _0x1434dd={'where':_0x3860ae[_0xd6ab('0x3d')]};return db[_0xd6ab('0x2d')][_0xd6ab('0x1f')](_0x1434dd)[_0xd6ab('0x26')](function(_0x23f9d7){_0x7de794[_0xd6ab('0x1f')]=_0x23f9d7;if(_0x38db5f[_0xd6ab('0x32')][_0xd6ab('0x40')]){_0x3860ae['include']=[{'all':!![]}];}return db['SquareRecording'][_0xd6ab('0x41')](_0x3860ae);})[_0xd6ab('0x26')](function(_0x4b6cc7){_0x7de794['rows']=_0x4b6cc7;return _0x7de794;})[_0xd6ab('0x26')](respondWithFilteredResult(_0x3e7b8c,_0x3860ae))[_0xd6ab('0x42')](handleError(_0x3e7b8c,null));};exports[_0xd6ab('0x43')]=function(_0x4a8879,_0x5be23c){var _0x4165e9={'raw':!![],'where':{'id':_0x4a8879[_0xd6ab('0x44')]['id']}},_0x49e791={};_0x49e791[_0xd6ab('0x30')]=_[_0xd6ab('0x31')](db[_0xd6ab('0x2d')][_0xd6ab('0x45')]);_0x49e791['query']=_['keys'](_0x4a8879[_0xd6ab('0x32')]);_0x49e791[_0xd6ab('0x33')]=_[_0xd6ab('0x34')](_0x49e791[_0xd6ab('0x30')],_0x49e791[_0xd6ab('0x32')]);_0x4165e9[_0xd6ab('0x36')]=_[_0xd6ab('0x34')](_0x49e791[_0xd6ab('0x30')],qs['fields'](_0x4a8879[_0xd6ab('0x32')][_0xd6ab('0x35')]));_0x4165e9[_0xd6ab('0x36')]=_0x4165e9[_0xd6ab('0x36')][_0xd6ab('0x46')]?_0x4165e9[_0xd6ab('0x36')]:_0x49e791[_0xd6ab('0x30')];if(_0x4a8879['query'][_0xd6ab('0x40')]){_0x4165e9[_0xd6ab('0x47')]=[{'all':!![]}];}_0x4165e9=_[_0xd6ab('0x3e')]({},_0x4165e9,_0x4a8879[_0xd6ab('0x48')]);return db[_0xd6ab('0x2d')]['find'](_0x4165e9)['then'](handleEntityNotFound(_0x5be23c,null))[_0xd6ab('0x26')](respondWithResult(_0x5be23c,null))[_0xd6ab('0x42')](handleError(_0x5be23c,null));};exports[_0xd6ab('0x49')]=function(_0x4dcaff,_0x2d971e){return db['SquareRecording'][_0xd6ab('0x49')](_0x4dcaff[_0xd6ab('0x4a')],{})[_0xd6ab('0x26')](respondWithResult(_0x2d971e,0xc9))[_0xd6ab('0x42')](handleError(_0x2d971e,null));};exports[_0xd6ab('0x25')]=function(_0x5e04e9,_0x1b2853){if(_0x5e04e9[_0xd6ab('0x4a')]['id']){delete _0x5e04e9[_0xd6ab('0x4a')]['id'];}return db[_0xd6ab('0x2d')][_0xd6ab('0x4b')]({'where':{'id':_0x5e04e9[_0xd6ab('0x44')]['id']}})[_0xd6ab('0x26')](handleEntityNotFound(_0x1b2853,null))[_0xd6ab('0x26')](saveUpdates(_0x5e04e9[_0xd6ab('0x4a')],null))['then'](respondWithResult(_0x1b2853,null))[_0xd6ab('0x42')](handleError(_0x1b2853,null));};exports[_0xd6ab('0x4c')]=function(_0x182b47,_0x44170c,_0x1a72f6){var _0x5de1b0=require('../../components/encryptor');var _0xc4e576=![];var _0x203277={};if(_0x182b47[_0xd6ab('0x32')]['type']&&_0x182b47[_0xd6ab('0x32')][_0xd6ab('0x2e')]===_0xd6ab('0x4d')){_0x203277[_0xd6ab('0x4d')]=_0x182b47[_0xd6ab('0x44')]['id'];}else{_0x203277['id']=_0x182b47[_0xd6ab('0x44')]['id'];}return db[_0xd6ab('0x2d')][_0xd6ab('0x4b')]({'where':_0x203277,'attributes':['id','savePath','filename'],'raw':!![]})[_0xd6ab('0x26')](handleEntityNotFound(_0x44170c,null))[_0xd6ab('0x26')](function(_0x3c6514){if(_0x3c6514){var _0x59493f=_0x3c6514[_0xd6ab('0x4e')];var _0x340ec4=util['format']('%s.cypher',_0x59493f);if(fs[_0xd6ab('0x4f')](_0x340ec4)){_0xc4e576=!![];return _0x5de1b0[_0xd6ab('0x50')](_0x340ec4,_0x59493f,config[_0xd6ab('0x51')][_0xd6ab('0x52')])[_0xd6ab('0x26')](function(){return _0x3c6514;});}return _0x3c6514;}})[_0xd6ab('0x26')](function(_0x1894f4){if(_0x1894f4){var _0x3af422=_0x1894f4[_0xd6ab('0x4e')];if(!fs[_0xd6ab('0x4f')](_0x3af422)){throw new db[(_0xd6ab('0x53'))][(_0xd6ab('0x54'))](_0xd6ab('0x55'));}if(_0x1894f4[_0xd6ab('0x56')]){return _0x44170c[_0xd6ab('0x4c')](_0x3af422,_0x1894f4[_0xd6ab('0x56')]+path[_0xd6ab('0x57')](_0x3af422),function(){if(_0xc4e576){fs[_0xd6ab('0x58')](_0x3af422);}});}else{return _0x44170c[_0xd6ab('0x4c')](_0x3af422,function(_0x35cc6d){if(_0xc4e576){fs[_0xd6ab('0x58')](_0x3af422);}});}}})['catch'](function(_0x236a43){if(_0x236a43[_0xd6ab('0x59')]==='SquareRecording\x20not\x20found'){_0x44170c[_0xd6ab('0x1c')](0x194)[_0xd6ab('0x2a')](_0xd6ab('0x5a'));}else{return handleError(_0x44170c,null);}});};exports[_0xd6ab('0x27')]=function(_0x3295e1,_0x5eed5e){return db['SquareRecording'][_0xd6ab('0x4b')]({'where':{'id':_0x3295e1['params']['id']}})[_0xd6ab('0x26')](function(_0x142046){if(!_0x142046)throw new ReferenceError('Entity\x20not\x20found');return _0x142046;})[_0xd6ab('0x26')](function(_0x47082a){var _0x5555af=_0x47082a[_0xd6ab('0x4e')];logger[_0xd6ab('0x5b')](_0xd6ab('0x5c'),_0x5555af);if(!_[_0xd6ab('0x5d')](_0x47082a['savePath'])&&fs[_0xd6ab('0x4f')](_0x5555af)){logger[_0xd6ab('0x5b')](_0xd6ab('0x5e')+_0x5555af+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x5555af);}_0x5555af=_0x5555af+_0xd6ab('0x5f');if(!_[_0xd6ab('0x5d')](_0x47082a[_0xd6ab('0x4e')])&&fs[_0xd6ab('0x4f')](_0x5555af)){logger[_0xd6ab('0x5b')]('File:\x20\x22'+_0x5555af+_0xd6ab('0x60'));fs[_0xd6ab('0x61')](_0x5555af);}return _0x47082a;})[_0xd6ab('0x26')](function(_0x5caef3){if(!_0x5caef3)throw new InternalError();return _0x5caef3[_0xd6ab('0x27')]();})[_0xd6ab('0x26')](function(){_0x5eed5e[_0xd6ab('0x1c')](0xcc)[_0xd6ab('0x1d')]();})[_0xd6ab('0x42')](handleError(_0x5eed5e,null));}; \ No newline at end of file +var _0xc35b=['../../components/encryptor','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','SquareRecording\x20not\x20found','extname','Not\x20found','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','count','offset','limit','status','set','Content-Range','json','apply','reject','save','update','then','end','stack','name','send','index','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','findAll','catch','show','params','includeAll','include','find','create','body','download'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xc35b,0x79));var _0xbc35=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xc35b[_0x1e7b16];return _0x37fadc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbc35('0x0'));var rimraf=require(_0xbc35('0x1'));var zipdir=require(_0xbc35('0x2'));var jsonpatch=require(_0xbc35('0x3'));var rp=require(_0xbc35('0x4'));var moment=require(_0xbc35('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbc35('0x6'));var util=require(_0xbc35('0x7'));var path=require('path');var sox=require(_0xbc35('0x8'));var csv=require(_0xbc35('0x9'));var ejs=require(_0xbc35('0xa'));var fs=require('fs');var _=require(_0xbc35('0xb'));var squel=require(_0xbc35('0xc'));var crypto=require(_0xbc35('0xd'));var jsforce=require(_0xbc35('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbc35('0x9'));var querystring=require(_0xbc35('0xf'));var Papa=require(_0xbc35('0x10'));var Redis=require(_0xbc35('0x11'));var authService=require(_0xbc35('0x12'));var qs=require(_0xbc35('0x13'));var as=require(_0xbc35('0x14'));var hardwareService=require(_0xbc35('0x15'));var logger=require('../../config/logger')(_0xbc35('0x16'));var utils=require(_0xbc35('0x17'));var config=require(_0xbc35('0x18'));var db=require(_0xbc35('0x19'))['db'];function respondWithStatusCode(_0x350b00,_0x36847b){_0x36847b=_0x36847b||0xcc;return function(_0x53ead8){if(_0x53ead8){return _0x350b00[_0xbc35('0x1a')](_0x36847b);}return _0x350b00['status'](_0x36847b)['end']();};}function respondWithResult(_0xb7939,_0x4ab886){_0x4ab886=_0x4ab886||0xc8;return function(_0x119bef){if(_0x119bef){return _0xb7939['status'](_0x4ab886)['json'](_0x119bef);}};}function respondWithFilteredResult(_0x54e953,_0x4af659){return function(_0x4e517b){if(_0x4e517b){var _0x25e2cf=_0x4e517b[_0xbc35('0x1b')],_0x29a907=_0x4af659['offset'],_0x1104b5=_0x4af659[_0xbc35('0x1c')]+_0x4af659[_0xbc35('0x1d')],_0x88709b;if(_0x1104b5>=_0x25e2cf){_0x1104b5=_0x25e2cf;_0x88709b=0xc8;}else{_0x88709b=0xce;}_0x54e953[_0xbc35('0x1e')](_0x88709b);return _0x54e953[_0xbc35('0x1f')](_0xbc35('0x20'),_0x29a907+'-'+_0x1104b5+'/'+_0x25e2cf)[_0xbc35('0x21')](_0x4e517b);}return null;};}function patchUpdates(_0x4fddc9){return function(_0x3cbba0){try{jsonpatch[_0xbc35('0x22')](_0x3cbba0,_0x4fddc9,!![]);}catch(_0x81700){return BPromise[_0xbc35('0x23')](_0x81700);}return _0x3cbba0[_0xbc35('0x24')]();};}function saveUpdates(_0xb15cf6,_0x5b2a49){return function(_0x61b80){if(_0x61b80){return _0x61b80[_0xbc35('0x25')](_0xb15cf6)[_0xbc35('0x26')](function(_0x4110d2){return _0x4110d2;});}return null;};}function removeEntity(_0x24a2c6,_0x1aea95){return function(_0x4a12c2){if(_0x4a12c2){return _0x4a12c2['destroy']()[_0xbc35('0x26')](function(){_0x24a2c6[_0xbc35('0x1e')](0xcc)[_0xbc35('0x27')]();});}};}function handleEntityNotFound(_0x2ed029,_0x54f95d){return function(_0x1aba68){if(!_0x1aba68){_0x2ed029[_0xbc35('0x1a')](0x194);}return _0x1aba68;};}function handleError(_0x3166a3,_0x95c7c){_0x95c7c=_0x95c7c||0x1f4;return function(_0x3b2d52){logger['error'](_0x3b2d52[_0xbc35('0x28')]);if(_0x3b2d52[_0xbc35('0x29')]){delete _0x3b2d52[_0xbc35('0x29')];}_0x3166a3[_0xbc35('0x1e')](_0x95c7c)[_0xbc35('0x2a')](_0x3b2d52);};}exports[_0xbc35('0x2b')]=function(_0x21c4df,_0x5e8300){var _0x2e4ca6={},_0x2c2d7d={},_0x44b7ac={'count':0x0,'rows':[]};var _0x3d210b=_['map'](db[_0xbc35('0x2c')][_0xbc35('0x2d')],function(_0x4e132e){return{'name':_0x4e132e[_0xbc35('0x2e')],'type':_0x4e132e[_0xbc35('0x2f')][_0xbc35('0x30')]};});_0x2c2d7d[_0xbc35('0x31')]=_['map'](_0x3d210b,_0xbc35('0x29'));_0x2c2d7d[_0xbc35('0x32')]=_[_0xbc35('0x33')](_0x21c4df['query']);_0x2c2d7d[_0xbc35('0x34')]=_[_0xbc35('0x35')](_0x2c2d7d[_0xbc35('0x31')],_0x2c2d7d[_0xbc35('0x32')]);_0x2e4ca6[_0xbc35('0x36')]=_[_0xbc35('0x35')](_0x2c2d7d[_0xbc35('0x31')],qs[_0xbc35('0x37')](_0x21c4df['query']['fields']));_0x2e4ca6[_0xbc35('0x36')]=_0x2e4ca6[_0xbc35('0x36')][_0xbc35('0x38')]?_0x2e4ca6[_0xbc35('0x36')]:_0x2c2d7d['model'];if(!_0x21c4df[_0xbc35('0x32')][_0xbc35('0x39')](_0xbc35('0x3a'))){_0x2e4ca6[_0xbc35('0x1d')]=qs[_0xbc35('0x1d')](_0x21c4df['query'][_0xbc35('0x1d')]);_0x2e4ca6[_0xbc35('0x1c')]=qs[_0xbc35('0x1c')](_0x21c4df[_0xbc35('0x32')][_0xbc35('0x1c')]);}_0x2e4ca6[_0xbc35('0x3b')]=qs[_0xbc35('0x3c')](_0x21c4df['query'][_0xbc35('0x3c')]);_0x2e4ca6['where']=qs[_0xbc35('0x34')](_[_0xbc35('0x3d')](_0x21c4df['query'],_0x2c2d7d[_0xbc35('0x34')]));if(_0x21c4df[_0xbc35('0x32')][_0xbc35('0x3e')]){_0x2e4ca6['where']=_[_0xbc35('0x3f')](_0x2e4ca6[_0xbc35('0x40')],{'$or':_['map'](_0x3d210b,function(_0xa29002){if(_0xa29002[_0xbc35('0x2f')]!==_0xbc35('0x41')){var _0x3953ca={};_0x3953ca[_0xa29002[_0xbc35('0x29')]]={'$like':'%'+_0x21c4df[_0xbc35('0x32')]['filter']+'%'};return _0x3953ca;}})});}_0x2e4ca6=_['merge']({},_0x2e4ca6,_0x21c4df[_0xbc35('0x42')]);var _0x5da841={'where':_0x2e4ca6['where']};return db['SquareRecording'][_0xbc35('0x1b')](_0x5da841)[_0xbc35('0x26')](function(_0x1b9c7d){_0x44b7ac[_0xbc35('0x1b')]=_0x1b9c7d;if(_0x21c4df[_0xbc35('0x32')]['includeAll']){_0x2e4ca6['include']=[{'all':!![]}];}return db[_0xbc35('0x2c')][_0xbc35('0x43')](_0x2e4ca6);})[_0xbc35('0x26')](function(_0x56b5dc){_0x44b7ac['rows']=_0x56b5dc;return _0x44b7ac;})['then'](respondWithFilteredResult(_0x5e8300,_0x2e4ca6))[_0xbc35('0x44')](handleError(_0x5e8300,null));};exports[_0xbc35('0x45')]=function(_0x3ecbcf,_0x40a9dd){var _0x253afb={'raw':!![],'where':{'id':_0x3ecbcf[_0xbc35('0x46')]['id']}},_0x4c7313={};_0x4c7313[_0xbc35('0x31')]=_[_0xbc35('0x33')](db[_0xbc35('0x2c')][_0xbc35('0x2d')]);_0x4c7313['query']=_[_0xbc35('0x33')](_0x3ecbcf['query']);_0x4c7313['filters']=_[_0xbc35('0x35')](_0x4c7313[_0xbc35('0x31')],_0x4c7313[_0xbc35('0x32')]);_0x253afb[_0xbc35('0x36')]=_[_0xbc35('0x35')](_0x4c7313[_0xbc35('0x31')],qs[_0xbc35('0x37')](_0x3ecbcf[_0xbc35('0x32')]['fields']));_0x253afb['attributes']=_0x253afb[_0xbc35('0x36')][_0xbc35('0x38')]?_0x253afb[_0xbc35('0x36')]:_0x4c7313['model'];if(_0x3ecbcf[_0xbc35('0x32')][_0xbc35('0x47')]){_0x253afb[_0xbc35('0x48')]=[{'all':!![]}];}_0x253afb=_['merge']({},_0x253afb,_0x3ecbcf[_0xbc35('0x42')]);return db[_0xbc35('0x2c')][_0xbc35('0x49')](_0x253afb)['then'](handleEntityNotFound(_0x40a9dd,null))[_0xbc35('0x26')](respondWithResult(_0x40a9dd,null))[_0xbc35('0x44')](handleError(_0x40a9dd,null));};exports[_0xbc35('0x4a')]=function(_0x4aa713,_0x516b6b){return db['SquareRecording'][_0xbc35('0x4a')](_0x4aa713[_0xbc35('0x4b')],{})[_0xbc35('0x26')](respondWithResult(_0x516b6b,0xc9))[_0xbc35('0x44')](handleError(_0x516b6b,null));};exports[_0xbc35('0x25')]=function(_0x4104b7,_0x2bab51){if(_0x4104b7[_0xbc35('0x4b')]['id']){delete _0x4104b7[_0xbc35('0x4b')]['id'];}return db[_0xbc35('0x2c')][_0xbc35('0x49')]({'where':{'id':_0x4104b7[_0xbc35('0x46')]['id']}})[_0xbc35('0x26')](handleEntityNotFound(_0x2bab51,null))[_0xbc35('0x26')](saveUpdates(_0x4104b7[_0xbc35('0x4b')],null))[_0xbc35('0x26')](respondWithResult(_0x2bab51,null))[_0xbc35('0x44')](handleError(_0x2bab51,null));};exports[_0xbc35('0x4c')]=function(_0x5e00b1,_0x7bb48,_0x3c8daf){var _0x471477=require(_0xbc35('0x4d'));var _0x4bfc70=![];var _0x1fd356={};if(_0x5e00b1[_0xbc35('0x32')][_0xbc35('0x2f')]&&_0x5e00b1[_0xbc35('0x32')]['type']==='uniqueid'){_0x1fd356['uniqueid']=_0x5e00b1[_0xbc35('0x46')]['id'];}else{_0x1fd356['id']=_0x5e00b1[_0xbc35('0x46')]['id'];}return db[_0xbc35('0x2c')][_0xbc35('0x49')]({'where':_0x1fd356,'attributes':['id',_0xbc35('0x4e'),_0xbc35('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x7bb48,null))['then'](function(_0x3d4045){if(_0x3d4045){var _0x14e9d0=_0x3d4045[_0xbc35('0x4e')];var _0x2d54ac=util[_0xbc35('0x50')](_0xbc35('0x51'),_0x14e9d0);if(fs[_0xbc35('0x52')](_0x2d54ac)){_0x4bfc70=!![];return _0x471477[_0xbc35('0x53')](_0x2d54ac,_0x14e9d0,config[_0xbc35('0x54')][_0xbc35('0x55')])[_0xbc35('0x26')](function(){return _0x3d4045;});}return _0x3d4045;}})[_0xbc35('0x26')](function(_0x294e0c){if(_0x294e0c){var _0xa1fd0e=_0x294e0c[_0xbc35('0x4e')];if(!fs[_0xbc35('0x52')](_0xa1fd0e)){throw new db['Sequelize'][(_0xbc35('0x56'))](_0xbc35('0x57'));}if(_0x294e0c[_0xbc35('0x4f')]){return _0x7bb48[_0xbc35('0x4c')](_0xa1fd0e,_0x294e0c[_0xbc35('0x4f')]+path[_0xbc35('0x58')](_0xa1fd0e),function(){if(_0x4bfc70){fs['unlink'](_0xa1fd0e);}});}else{return _0x7bb48['download'](_0xa1fd0e,function(_0x488e3c){if(_0x4bfc70){fs['unlink'](_0xa1fd0e);}});}}})['catch'](function(_0x439d14){if(_0x439d14['message']===_0xbc35('0x57')){_0x7bb48[_0xbc35('0x1e')](0x194)[_0xbc35('0x2a')](_0xbc35('0x59'));}else{return handleError(_0x7bb48,null);}});};exports[_0xbc35('0x5a')]=function(_0x6fd5a6,_0x278e57){return db[_0xbc35('0x2c')][_0xbc35('0x49')]({'where':{'id':_0x6fd5a6['params']['id']}})[_0xbc35('0x26')](function(_0x2600a6){if(!_0x2600a6)throw new ReferenceError(_0xbc35('0x5b'));return _0x2600a6;})[_0xbc35('0x26')](function(_0x30a0fb){var _0x1c766a=_0x30a0fb['savePath'];logger[_0xbc35('0x5c')](_0xbc35('0x5d'),_0x1c766a);if(!_['isNil'](_0x30a0fb[_0xbc35('0x4e')])&&fs[_0xbc35('0x52')](_0x1c766a)){logger[_0xbc35('0x5c')](_0xbc35('0x5e')+_0x1c766a+_0xbc35('0x5f'));fs[_0xbc35('0x60')](_0x1c766a);}_0x1c766a=_0x1c766a+_0xbc35('0x61');if(!_[_0xbc35('0x62')](_0x30a0fb[_0xbc35('0x4e')])&&fs['existsSync'](_0x1c766a)){logger['info'](_0xbc35('0x5e')+_0x1c766a+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xbc35('0x60')](_0x1c766a);}return _0x30a0fb;})[_0xbc35('0x26')](function(_0x2f9949){if(!_0x2f9949)throw new InternalError();return _0x2f9949[_0xbc35('0x5a')]();})['then'](function(){_0x278e57[_0xbc35('0x1e')](0xcc)[_0xbc35('0x27')]();})[_0xbc35('0x44')](handleError(_0x278e57,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 28f0a59..921e09c 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 _0x1a37=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareRecording','square_recordings','lodash','util'];(function(_0x33de57,_0xc22bb0){var _0x88f5a5=function(_0x2a3f89){while(--_0x2a3f89){_0x33de57['push'](_0x33de57['shift']());}};_0x88f5a5(++_0xc22bb0);}(_0x1a37,0xb4));var _0x71a3=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x1a37[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var logger=require(_0x71a3('0x2'))(_0x71a3('0x3'));var moment=require(_0x71a3('0x4'));var BPromise=require(_0x71a3('0x5'));var rp=require(_0x71a3('0x6'));var fs=require('fs');var path=require(_0x71a3('0x7'));var rimraf=require(_0x71a3('0x8'));var config=require(_0x71a3('0x9'));var attributes=require('./squareRecording.attributes');module[_0x71a3('0xa')]=function(_0x4f6b7a,_0xd09f7){return _0x4f6b7a[_0x71a3('0xb')](_0x71a3('0xc'),attributes,{'tableName':_0x71a3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11f3=['util','../../config/logger','moment','request-promise','path','rimraf','exports','define','SquareRecording','square_recordings','lodash'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x11f3,0x149));var _0x311f=function(_0x8afdd0,_0x548ad1){_0x8afdd0=_0x8afdd0-0x0;var _0x3de7ac=_0x11f3[_0x8afdd0];return _0x3de7ac;};'use strict';var _=require(_0x311f('0x0'));var util=require(_0x311f('0x1'));var logger=require(_0x311f('0x2'))('api');var moment=require(_0x311f('0x3'));var BPromise=require('bluebird');var rp=require(_0x311f('0x4'));var fs=require('fs');var path=require(_0x311f('0x5'));var rimraf=require(_0x311f('0x6'));var config=require('../../config/environment');var attributes=require('./squareRecording.attributes');module[_0x311f('0x7')]=function(_0x57ee36,_0x30d05f){return _0x57ee36[_0x311f('0x8')](_0x311f('0x9'),attributes,{'tableName':_0x311f('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 d3bb337..7db3a33 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 _0x493e=['message','info','result','catch','CreateSquareRecording','options','raw','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4ce978,_0x23923){var _0x2db47d=function(_0x42141f){while(--_0x42141f){_0x4ce978['push'](_0x4ce978['shift']());}};_0x2db47d(++_0x23923);}(_0x493e,0x10b));var _0xe493=function(_0x3f8ec2,_0x5a6c61){_0x3f8ec2=_0x3f8ec2-0x0;var _0x145630=_0x493e[_0x3f8ec2];return _0x145630;};'use strict';var _=require(_0xe493('0x0'));var util=require(_0xe493('0x1'));var moment=require('moment');var BPromise=require(_0xe493('0x2'));var rs=require(_0xe493('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe493('0x4'))['db'];var utils=require(_0xe493('0x5'));var logger=require(_0xe493('0x6'))(_0xe493('0x7'));var config=require('../../config/environment');var jayson=require(_0xe493('0x8'));var client=jayson['client'][_0xe493('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10fbcf,_0x2538ec,_0x2e15fb){return new BPromise(function(_0x1df8eb,_0x124dee){return client[_0xe493('0xa')](_0x10fbcf,_0x2e15fb)[_0xe493('0xb')](function(_0x643432){logger['info'](_0xe493('0xc'),_0x2538ec,_0xe493('0xd'));logger[_0xe493('0xe')](_0xe493('0xf'),_0x2538ec,'request\x20sent',JSON[_0xe493('0x10')](_0x643432));if(_0x643432[_0xe493('0x11')]){if(_0x643432[_0xe493('0x11')][_0xe493('0x12')]===0x1f4){logger[_0xe493('0x11')](_0xe493('0xc'),_0x2538ec,_0x643432[_0xe493('0x11')][_0xe493('0x13')]);return _0x124dee(_0x643432[_0xe493('0x11')]['message']);}logger[_0xe493('0x11')]('SquareRecording,\x20%s,\x20%s',_0x2538ec,_0x643432[_0xe493('0x11')]['message']);return _0x1df8eb(_0x643432[_0xe493('0x11')][_0xe493('0x13')]);}else{logger[_0xe493('0x14')](_0xe493('0xc'),_0x2538ec,_0xe493('0xd'));_0x1df8eb(_0x643432[_0xe493('0x15')]['message']);}})[_0xe493('0x16')](function(_0x6f5bb9){logger[_0xe493('0x11')]('SquareRecording,\x20%s,\x20%s',_0x2538ec,_0x6f5bb9);_0x124dee(_0x6f5bb9);});});}exports[_0xe493('0x17')]=function(_0x41be4e){var _0x345bae=this;return new Promise(function(_0x58f5d8,_0x3143f1){return db['SquareRecording']['create'](_0x41be4e['body'],{'raw':_0x41be4e[_0xe493('0x18')]?_0x41be4e[_0xe493('0x18')][_0xe493('0x19')]===undefined?!![]:![]:!![]})[_0xe493('0xb')](function(_0x5b58e8){logger['info'](_0xe493('0x17'),_0x41be4e);logger[_0xe493('0xe')](_0xe493('0x17'),_0x41be4e,JSON[_0xe493('0x10')](_0x5b58e8));_0x58f5d8(_0x5b58e8);})['catch'](function(_0x5805bc){logger[_0xe493('0x11')](_0xe493('0x17'),_0x5805bc[_0xe493('0x13')],_0x41be4e);_0x3143f1(_0x345bae['error'](0x1f4,_0x5805bc[_0xe493('0x13')]));});});}; \ No newline at end of file +var _0x051b=['SquareRecording','body','options','raw','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording'];(function(_0x421b37,_0x444068){var _0x43369c=function(_0x1dc67f){while(--_0x1dc67f){_0x421b37['push'](_0x421b37['shift']());}};_0x43369c(++_0x444068);}(_0x051b,0x6c));var _0xb051=function(_0x3c7375,_0x1da210){_0x3c7375=_0x3c7375-0x0;var _0x249bfb=_0x051b[_0x3c7375];return _0x249bfb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb051('0x0'));var BPromise=require('bluebird');var rs=require(_0xb051('0x1'));var fs=require('fs');var Redis=require(_0xb051('0x2'));var db=require(_0xb051('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xb051('0x4'));var jayson=require(_0xb051('0x5'));var client=jayson[_0xb051('0x6')][_0xb051('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x50ca8f,_0x4f34af,_0x56e90e){return new BPromise(function(_0x5ce213,_0x1a0e1a){return client[_0xb051('0x8')](_0x50ca8f,_0x56e90e)[_0xb051('0x9')](function(_0x818a05){logger[_0xb051('0xa')](_0xb051('0xb'),_0x4f34af,_0xb051('0xc'));logger[_0xb051('0xd')](_0xb051('0xe'),_0x4f34af,_0xb051('0xc'),JSON[_0xb051('0xf')](_0x818a05));if(_0x818a05['error']){if(_0x818a05[_0xb051('0x10')][_0xb051('0x11')]===0x1f4){logger[_0xb051('0x10')]('SquareRecording,\x20%s,\x20%s',_0x4f34af,_0x818a05[_0xb051('0x10')][_0xb051('0x12')]);return _0x1a0e1a(_0x818a05['error']['message']);}logger[_0xb051('0x10')](_0xb051('0xb'),_0x4f34af,_0x818a05[_0xb051('0x10')]['message']);return _0x5ce213(_0x818a05['error']['message']);}else{logger[_0xb051('0xa')]('SquareRecording,\x20%s,\x20%s',_0x4f34af,'request\x20sent');_0x5ce213(_0x818a05[_0xb051('0x13')][_0xb051('0x12')]);}})[_0xb051('0x14')](function(_0x31c1da){logger[_0xb051('0x10')]('SquareRecording,\x20%s,\x20%s',_0x4f34af,_0x31c1da);_0x1a0e1a(_0x31c1da);});});}exports[_0xb051('0x15')]=function(_0x14b653){var _0x16847c=this;return new Promise(function(_0x1cbeca,_0x1261b5){return db[_0xb051('0x16')]['create'](_0x14b653[_0xb051('0x17')],{'raw':_0x14b653[_0xb051('0x18')]?_0x14b653[_0xb051('0x18')][_0xb051('0x19')]===undefined?!![]:![]:!![]})[_0xb051('0x9')](function(_0x38d982){logger[_0xb051('0xa')](_0xb051('0x15'),_0x14b653);logger[_0xb051('0xd')](_0xb051('0x15'),_0x14b653,JSON[_0xb051('0xf')](_0x38d982));_0x1cbeca(_0x38d982);})['catch'](function(_0x794837){logger[_0xb051('0x10')](_0xb051('0x15'),_0x794837['message'],_0x14b653);_0x1261b5(_0x16847c['error'](0x1f4,_0x794837['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 6a2cf2b..2c557c9 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 _0xf71c=['index','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated'];(function(_0x3c92bb,_0x2a9c8a){var _0x3f373e=function(_0x2c6191){while(--_0x2c6191){_0x3c92bb['push'](_0x3c92bb['shift']());}};_0x3f373e(++_0x2a9c8a);}(_0xf71c,0xfa));var _0xcf71=function(_0x2256d9,_0x54357e){_0x2256d9=_0x2256d9-0x0;var _0x28fb50=_0xf71c[_0x2256d9];return _0x28fb50;};'use strict';var multer=require(_0xcf71('0x0'));var util=require(_0xcf71('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcf71('0x2'));var router=express[_0xcf71('0x3')]();var auth=require(_0xcf71('0x4'));var interaction=require(_0xcf71('0x5'));var config=require(_0xcf71('0x6'));var controller=require(_0xcf71('0x7'));router[_0xcf71('0x8')]('/',auth[_0xcf71('0x9')](),controller[_0xcf71('0xa')]);router[_0xcf71('0x8')]('/describe',auth[_0xcf71('0x9')](),controller[_0xcf71('0xb')]);router['get'](_0xcf71('0xc'),auth[_0xcf71('0x9')](),controller[_0xcf71('0xd')]);router[_0xcf71('0xe')]('/',auth['isAuthenticated'](),controller[_0xcf71('0xf')]);router['put'](_0xcf71('0xc'),auth['isAuthenticated'](),controller[_0xcf71('0x10')]);router[_0xcf71('0x11')]('/:id',auth[_0xcf71('0x9')](),controller[_0xcf71('0x12')]);module[_0xcf71('0x13')]=router; \ No newline at end of file +var _0x4be2=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe'];(function(_0x48590d,_0x6fc66){var _0x1d000d=function(_0x32be0e){while(--_0x32be0e){_0x48590d['push'](_0x48590d['shift']());}};_0x1d000d(++_0x6fc66);}(_0x4be2,0xfc));var _0x24be=function(_0x59547f,_0x1fe1da){_0x59547f=_0x59547f-0x0;var _0x2448d4=_0x4be2[_0x59547f];return _0x2448d4;};'use strict';var multer=require(_0x24be('0x0'));var util=require(_0x24be('0x1'));var path=require(_0x24be('0x2'));var timeout=require(_0x24be('0x3'));var express=require(_0x24be('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x24be('0x5'));var config=require(_0x24be('0x6'));var controller=require(_0x24be('0x7'));router[_0x24be('0x8')]('/',auth[_0x24be('0x9')](),controller[_0x24be('0xa')]);router[_0x24be('0x8')](_0x24be('0xb'),auth[_0x24be('0x9')](),controller[_0x24be('0xc')]);router[_0x24be('0x8')](_0x24be('0xd'),auth['isAuthenticated'](),controller[_0x24be('0xe')]);router[_0x24be('0xf')]('/',auth[_0x24be('0x9')](),controller[_0x24be('0x10')]);router[_0x24be('0x11')]('/:id',auth[_0x24be('0x9')](),controller[_0x24be('0x12')]);router[_0x24be('0x13')](_0x24be('0xd'),auth[_0x24be('0x9')](),controller[_0x24be('0x14')]);module[_0x24be('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 3c0459e..5a802d3 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 _0x7393=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0xf432ab,_0x2aeafc){var _0x4c4079=function(_0x458026){while(--_0x458026){_0xf432ab['push'](_0xf432ab['shift']());}};_0x4c4079(++_0x2aeafc);}(_0x7393,0xb6));var _0x3739=function(_0x1a6a8b,_0x18e227){_0x1a6a8b=_0x1a6a8b-0x0;var _0x2d1a0e=_0x7393[_0x1a6a8b];return _0x2d1a0e;};'use strict';var Sequelize=require(_0x3739('0x0'));module[_0x3739('0x1')]={'network':{'type':Sequelize[_0x3739('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x3739('0x2')]},'channel':{'type':Sequelize[_0x3739('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x3739('0x2')]},'version':{'type':Sequelize[_0x3739('0x2')]},'callerid':{'type':Sequelize[_0x3739('0x2')]},'calleridname':{'type':Sequelize[_0x3739('0x2')]},'callingpres':{'type':Sequelize[_0x3739('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x3739('0x2')]},'callingtns':{'type':Sequelize[_0x3739('0x2')]},'dnid':{'type':Sequelize[_0x3739('0x2')]},'rdnis':{'type':Sequelize[_0x3739('0x2')]},'context':{'type':Sequelize[_0x3739('0x2')]},'extension':{'type':Sequelize[_0x3739('0x2')]},'priority':{'type':Sequelize[_0x3739('0x2')]},'enhanced':{'type':Sequelize[_0x3739('0x2')]},'accountcode':{'type':Sequelize[_0x3739('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x3739('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x3739('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x8519=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0xdf3db6,_0x2a1952){var _0x4b7a65=function(_0x2953be){while(--_0x2953be){_0xdf3db6['push'](_0xdf3db6['shift']());}};_0x4b7a65(++_0x2a1952);}(_0x8519,0x189));var _0x9851=function(_0x925102,_0x2d9f9b){_0x925102=_0x925102-0x0;var _0xdc7531=_0x8519[_0x925102];return _0xdc7531;};'use strict';var Sequelize=require(_0x9851('0x0'));module[_0x9851('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x9851('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9851('0x2')]},'uniqueid':{'type':Sequelize[_0x9851('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x9851('0x2')]},'calleridname':{'type':Sequelize[_0x9851('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x9851('0x2')]},'callingtns':{'type':Sequelize[_0x9851('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x9851('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x9851('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x9851('0x2')]},'accountcode':{'type':Sequelize[_0x9851('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x9851('0x3')]},'leaveAt':{'type':Sequelize[_0x9851('0x3')]},'bot':{'type':Sequelize[_0x9851('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index f6eb5cf..1908ac6 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 _0x5fab=['includeAll','rows','catch','show','params','include','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','SquareReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','merge','filter','options','count'];(function(_0x3fb5f9,_0xa4c2d9){var _0x541745=function(_0x4faa48){while(--_0x4faa48){_0x3fb5f9['push'](_0x3fb5f9['shift']());}};_0x541745(++_0xa4c2d9);}(_0x5fab,0x177));var _0xb5fa=function(_0x5f49bc,_0x548555){_0x5f49bc=_0x5f49bc-0x0;var _0x44bbb9=_0x5fab[_0x5f49bc];return _0x44bbb9;};'use strict';var pdf=require(_0xb5fa('0x0'));var emlformat=require(_0xb5fa('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb5fa('0x2'));var jsonpatch=require(_0xb5fa('0x3'));var rp=require(_0xb5fa('0x4'));var moment=require(_0xb5fa('0x5'));var BPromise=require(_0xb5fa('0x6'));var Mustache=require(_0xb5fa('0x7'));var util=require(_0xb5fa('0x8'));var path=require(_0xb5fa('0x9'));var sox=require(_0xb5fa('0xa'));var csv=require(_0xb5fa('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xb'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var db=require(_0xb5fa('0x18'))['db'];function respondWithStatusCode(_0x309740,_0x4d3576){_0x4d3576=_0x4d3576||0xcc;return function(_0x2ad830){if(_0x2ad830){return _0x309740[_0xb5fa('0x19')](_0x4d3576);}return _0x309740['status'](_0x4d3576)[_0xb5fa('0x1a')]();};}function respondWithResult(_0x577af0,_0x265992){_0x265992=_0x265992||0xc8;return function(_0x3fc372){if(_0x3fc372){return _0x577af0[_0xb5fa('0x1b')](_0x265992)[_0xb5fa('0x1c')](_0x3fc372);}};}function respondWithFilteredResult(_0x8e9d1c,_0x5371cf){return function(_0x567f31){if(_0x567f31){var _0x38e964=_0x567f31['count'],_0x587043=_0x5371cf['offset'],_0x31f252=_0x5371cf[_0xb5fa('0x1d')]+_0x5371cf[_0xb5fa('0x1e')],_0x27c8f7;if(_0x31f252>=_0x38e964){_0x31f252=_0x38e964;_0x27c8f7=0xc8;}else{_0x27c8f7=0xce;}_0x8e9d1c[_0xb5fa('0x1b')](_0x27c8f7);return _0x8e9d1c[_0xb5fa('0x1f')](_0xb5fa('0x20'),_0x587043+'-'+_0x31f252+'/'+_0x38e964)[_0xb5fa('0x1c')](_0x567f31);}return null;};}function patchUpdates(_0x3b0f69){return function(_0x21f4f4){try{jsonpatch[_0xb5fa('0x21')](_0x21f4f4,_0x3b0f69,!![]);}catch(_0x368cb1){return BPromise[_0xb5fa('0x22')](_0x368cb1);}return _0x21f4f4[_0xb5fa('0x23')]();};}function saveUpdates(_0x5cd822,_0x432bfa){return function(_0x519e20){if(_0x519e20){return _0x519e20[_0xb5fa('0x24')](_0x5cd822)['then'](function(_0xd0fe2b){return _0xd0fe2b;});}return null;};}function removeEntity(_0x43c09f,_0x4e05c0){return function(_0x40dfdf){if(_0x40dfdf){return _0x40dfdf[_0xb5fa('0x25')]()[_0xb5fa('0x26')](function(){_0x43c09f['status'](0xcc)[_0xb5fa('0x1a')]();});}};}function handleEntityNotFound(_0xec108f,_0x444237){return function(_0x542348){if(!_0x542348){_0xec108f[_0xb5fa('0x19')](0x194);}return _0x542348;};}function handleError(_0x5d55f7,_0x106c4b){_0x106c4b=_0x106c4b||0x1f4;return function(_0x264591){logger[_0xb5fa('0x27')](_0x264591[_0xb5fa('0x28')]);if(_0x264591[_0xb5fa('0x29')]){delete _0x264591[_0xb5fa('0x29')];}_0x5d55f7[_0xb5fa('0x1b')](_0x106c4b)[_0xb5fa('0x2a')](_0x264591);};}exports['index']=function(_0x4ec294,_0x5bdf11){var _0x5a1c39={},_0x28a350={},_0x460b54={'count':0x0,'rows':[]};var _0x12c0d4=_[_0xb5fa('0x2b')](db[_0xb5fa('0x2c')][_0xb5fa('0x2d')],function(_0x358549){return{'name':_0x358549[_0xb5fa('0x2e')],'type':_0x358549[_0xb5fa('0x2f')][_0xb5fa('0x30')]};});_0x28a350[_0xb5fa('0x31')]=_[_0xb5fa('0x2b')](_0x12c0d4,_0xb5fa('0x29'));_0x28a350[_0xb5fa('0x32')]=_[_0xb5fa('0x33')](_0x4ec294[_0xb5fa('0x32')]);_0x28a350[_0xb5fa('0x34')]=_[_0xb5fa('0x35')](_0x28a350[_0xb5fa('0x31')],_0x28a350[_0xb5fa('0x32')]);_0x5a1c39[_0xb5fa('0x36')]=_[_0xb5fa('0x35')](_0x28a350[_0xb5fa('0x31')],qs[_0xb5fa('0x37')](_0x4ec294['query'][_0xb5fa('0x37')]));_0x5a1c39['attributes']=_0x5a1c39['attributes']['length']?_0x5a1c39[_0xb5fa('0x36')]:_0x28a350['model'];if(!_0x4ec294[_0xb5fa('0x32')]['hasOwnProperty']('nolimit')){_0x5a1c39[_0xb5fa('0x1e')]=qs[_0xb5fa('0x1e')](_0x4ec294['query']['limit']);_0x5a1c39[_0xb5fa('0x1d')]=qs[_0xb5fa('0x1d')](_0x4ec294[_0xb5fa('0x32')]['offset']);}_0x5a1c39[_0xb5fa('0x38')]=qs[_0xb5fa('0x39')](_0x4ec294['query'][_0xb5fa('0x39')]);_0x5a1c39[_0xb5fa('0x3a')]=qs[_0xb5fa('0x34')](_['pick'](_0x4ec294[_0xb5fa('0x32')],_0x28a350[_0xb5fa('0x34')]));if(_0x4ec294[_0xb5fa('0x32')]['filter']){_0x5a1c39[_0xb5fa('0x3a')]=_[_0xb5fa('0x3b')](_0x5a1c39[_0xb5fa('0x3a')],{'$or':_[_0xb5fa('0x2b')](_0x12c0d4,function(_0x5e7770){if(_0x5e7770['type']!=='VIRTUAL'){var _0x49e786={};_0x49e786[_0x5e7770['name']]={'$like':'%'+_0x4ec294['query'][_0xb5fa('0x3c')]+'%'};return _0x49e786;}})});}_0x5a1c39=_['merge']({},_0x5a1c39,_0x4ec294[_0xb5fa('0x3d')]);var _0x3ae696={'where':_0x5a1c39[_0xb5fa('0x3a')]};return db[_0xb5fa('0x2c')][_0xb5fa('0x3e')](_0x3ae696)[_0xb5fa('0x26')](function(_0x4b4c4c){_0x460b54['count']=_0x4b4c4c;if(_0x4ec294['query'][_0xb5fa('0x3f')]){_0x5a1c39['include']=[{'all':!![]}];}return db[_0xb5fa('0x2c')]['findAll'](_0x5a1c39);})['then'](function(_0x3cdf63){_0x460b54[_0xb5fa('0x40')]=_0x3cdf63;return _0x460b54;})[_0xb5fa('0x26')](respondWithFilteredResult(_0x5bdf11,_0x5a1c39))[_0xb5fa('0x41')](handleError(_0x5bdf11,null));};exports[_0xb5fa('0x42')]=function(_0x26ef1b,_0x337c53){var _0x83df0b={'raw':!![],'where':{'id':_0x26ef1b[_0xb5fa('0x43')]['id']}},_0x19e370={};_0x19e370['model']=_[_0xb5fa('0x33')](db['SquareReport'][_0xb5fa('0x2d')]);_0x19e370[_0xb5fa('0x32')]=_[_0xb5fa('0x33')](_0x26ef1b[_0xb5fa('0x32')]);_0x19e370[_0xb5fa('0x34')]=_[_0xb5fa('0x35')](_0x19e370[_0xb5fa('0x31')],_0x19e370[_0xb5fa('0x32')]);_0x83df0b['attributes']=_[_0xb5fa('0x35')](_0x19e370[_0xb5fa('0x31')],qs['fields'](_0x26ef1b[_0xb5fa('0x32')]['fields']));_0x83df0b[_0xb5fa('0x36')]=_0x83df0b[_0xb5fa('0x36')]['length']?_0x83df0b['attributes']:_0x19e370[_0xb5fa('0x31')];if(_0x26ef1b[_0xb5fa('0x32')][_0xb5fa('0x3f')]){_0x83df0b[_0xb5fa('0x44')]=[{'all':!![]}];}_0x83df0b=_[_0xb5fa('0x3b')]({},_0x83df0b,_0x26ef1b[_0xb5fa('0x3d')]);return db[_0xb5fa('0x2c')][_0xb5fa('0x45')](_0x83df0b)['then'](handleEntityNotFound(_0x337c53,null))[_0xb5fa('0x26')](respondWithResult(_0x337c53,null))[_0xb5fa('0x41')](handleError(_0x337c53,null));};exports['create']=function(_0xee6baa,_0x2c378a){return db[_0xb5fa('0x2c')][_0xb5fa('0x46')](_0xee6baa[_0xb5fa('0x47')],{})[_0xb5fa('0x26')](respondWithResult(_0x2c378a,0xc9))[_0xb5fa('0x41')](handleError(_0x2c378a,null));};exports[_0xb5fa('0x24')]=function(_0x20f5f5,_0x464e36){if(_0x20f5f5[_0xb5fa('0x47')]['id']){delete _0x20f5f5[_0xb5fa('0x47')]['id'];}return db[_0xb5fa('0x2c')][_0xb5fa('0x45')]({'where':{'id':_0x20f5f5[_0xb5fa('0x43')]['id']}})[_0xb5fa('0x26')](handleEntityNotFound(_0x464e36,null))['then'](saveUpdates(_0x20f5f5['body'],null))[_0xb5fa('0x26')](respondWithResult(_0x464e36,null))['catch'](handleError(_0x464e36,null));};exports[_0xb5fa('0x25')]=function(_0x1049d9,_0x5404f6){return db[_0xb5fa('0x2c')][_0xb5fa('0x45')]({'where':{'id':_0x1049d9[_0xb5fa('0x43')]['id']}})[_0xb5fa('0x26')](handleEntityNotFound(_0x5404f6,null))[_0xb5fa('0x26')](removeEntity(_0x5404f6,null))[_0xb5fa('0x41')](handleError(_0x5404f6,null));};exports['describe']=function(_0x27a651,_0x4fd5bf){return db[_0xb5fa('0x2c')][_0xb5fa('0x48')]()[_0xb5fa('0x26')](respondWithResult(_0x4fd5bf,null))['catch'](handleError(_0x4fd5bf,null));}; \ No newline at end of file +var _0x1cb9=['end','json','count','offset','limit','set','apply','save','then','destroy','error','stack','index','map','SquareReport','rawAttributes','type','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','rows','catch','show','params','includeAll','options','find','create','body','update','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status'];(function(_0x519b7f,_0x3efcfd){var _0x787212=function(_0x4c93fe){while(--_0x4c93fe){_0x519b7f['push'](_0x519b7f['shift']());}};_0x787212(++_0x3efcfd);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1e9a34,_0x4bb75d){_0x1e9a34=_0x1e9a34-0x0;var _0x32e1d2=_0x1cb9[_0x1e9a34];return _0x32e1d2;};'use strict';var pdf=require(_0x91cb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x91cb('0x1'));var zipdir=require(_0x91cb('0x2'));var jsonpatch=require(_0x91cb('0x3'));var rp=require(_0x91cb('0x4'));var moment=require('moment');var BPromise=require(_0x91cb('0x5'));var Mustache=require(_0x91cb('0x6'));var util=require('util');var path=require(_0x91cb('0x7'));var sox=require(_0x91cb('0x8'));var csv=require(_0x91cb('0x9'));var ejs=require(_0x91cb('0xa'));var fs=require('fs');var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x9'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c1f56,_0x366f09){_0x366f09=_0x366f09||0xcc;return function(_0x4ba2f2){if(_0x4ba2f2){return _0x3c1f56[_0x91cb('0x18')](_0x366f09);}return _0x3c1f56[_0x91cb('0x19')](_0x366f09)[_0x91cb('0x1a')]();};}function respondWithResult(_0x2c7d40,_0x4a7d45){_0x4a7d45=_0x4a7d45||0xc8;return function(_0x4cc6ef){if(_0x4cc6ef){return _0x2c7d40[_0x91cb('0x19')](_0x4a7d45)[_0x91cb('0x1b')](_0x4cc6ef);}};}function respondWithFilteredResult(_0x585470,_0x528f73){return function(_0x576369){if(_0x576369){var _0xc3629e=_0x576369[_0x91cb('0x1c')],_0x347980=_0x528f73['offset'],_0x5ea796=_0x528f73[_0x91cb('0x1d')]+_0x528f73[_0x91cb('0x1e')],_0x238f11;if(_0x5ea796>=_0xc3629e){_0x5ea796=_0xc3629e;_0x238f11=0xc8;}else{_0x238f11=0xce;}_0x585470[_0x91cb('0x19')](_0x238f11);return _0x585470[_0x91cb('0x1f')]('Content-Range',_0x347980+'-'+_0x5ea796+'/'+_0xc3629e)[_0x91cb('0x1b')](_0x576369);}return null;};}function patchUpdates(_0x7dcf60){return function(_0x4ca8e8){try{jsonpatch[_0x91cb('0x20')](_0x4ca8e8,_0x7dcf60,!![]);}catch(_0x4c9fb2){return BPromise['reject'](_0x4c9fb2);}return _0x4ca8e8[_0x91cb('0x21')]();};}function saveUpdates(_0x160ded,_0x56e409){return function(_0x51a1d5){if(_0x51a1d5){return _0x51a1d5['update'](_0x160ded)[_0x91cb('0x22')](function(_0x18827b){return _0x18827b;});}return null;};}function removeEntity(_0x20aff5,_0x1dbee2){return function(_0x5c6a15){if(_0x5c6a15){return _0x5c6a15[_0x91cb('0x23')]()[_0x91cb('0x22')](function(){_0x20aff5[_0x91cb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(!_0x2447e7){_0x26f18f[_0x91cb('0x18')](0x194);}return _0x2447e7;};}function handleError(_0x3ca500,_0x7ad361){_0x7ad361=_0x7ad361||0x1f4;return function(_0x414e60){logger[_0x91cb('0x24')](_0x414e60[_0x91cb('0x25')]);if(_0x414e60['name']){delete _0x414e60['name'];}_0x3ca500[_0x91cb('0x19')](_0x7ad361)['send'](_0x414e60);};}exports[_0x91cb('0x26')]=function(_0x34d372,_0x318031){var _0x5595c5={},_0x9b26a6={},_0x4f5a7b={'count':0x0,'rows':[]};var _0x4572f6=_[_0x91cb('0x27')](db[_0x91cb('0x28')][_0x91cb('0x29')],function(_0x468908){return{'name':_0x468908['fieldName'],'type':_0x468908[_0x91cb('0x2a')]['key']};});_0x9b26a6[_0x91cb('0x2b')]=_[_0x91cb('0x27')](_0x4572f6,_0x91cb('0x2c'));_0x9b26a6['query']=_[_0x91cb('0x2d')](_0x34d372[_0x91cb('0x2e')]);_0x9b26a6[_0x91cb('0x2f')]=_[_0x91cb('0x30')](_0x9b26a6[_0x91cb('0x2b')],_0x9b26a6[_0x91cb('0x2e')]);_0x5595c5[_0x91cb('0x31')]=_[_0x91cb('0x30')](_0x9b26a6[_0x91cb('0x2b')],qs['fields'](_0x34d372[_0x91cb('0x2e')][_0x91cb('0x32')]));_0x5595c5[_0x91cb('0x31')]=_0x5595c5[_0x91cb('0x31')][_0x91cb('0x33')]?_0x5595c5['attributes']:_0x9b26a6[_0x91cb('0x2b')];if(!_0x34d372[_0x91cb('0x2e')][_0x91cb('0x34')](_0x91cb('0x35'))){_0x5595c5[_0x91cb('0x1e')]=qs['limit'](_0x34d372[_0x91cb('0x2e')]['limit']);_0x5595c5['offset']=qs['offset'](_0x34d372[_0x91cb('0x2e')]['offset']);}_0x5595c5[_0x91cb('0x36')]=qs['sort'](_0x34d372['query'][_0x91cb('0x37')]);_0x5595c5[_0x91cb('0x38')]=qs[_0x91cb('0x2f')](_[_0x91cb('0x39')](_0x34d372[_0x91cb('0x2e')],_0x9b26a6['filters']));if(_0x34d372[_0x91cb('0x2e')][_0x91cb('0x3a')]){_0x5595c5[_0x91cb('0x38')]=_[_0x91cb('0x3b')](_0x5595c5['where'],{'$or':_['map'](_0x4572f6,function(_0x1eed21){if(_0x1eed21[_0x91cb('0x2a')]!=='VIRTUAL'){var _0x39bd64={};_0x39bd64[_0x1eed21[_0x91cb('0x2c')]]={'$like':'%'+_0x34d372['query'][_0x91cb('0x3a')]+'%'};return _0x39bd64;}})});}_0x5595c5=_[_0x91cb('0x3b')]({},_0x5595c5,_0x34d372['options']);var _0x43d4fe={'where':_0x5595c5['where']};return db[_0x91cb('0x28')][_0x91cb('0x1c')](_0x43d4fe)[_0x91cb('0x22')](function(_0x279ad5){_0x4f5a7b[_0x91cb('0x1c')]=_0x279ad5;if(_0x34d372[_0x91cb('0x2e')]['includeAll']){_0x5595c5[_0x91cb('0x3c')]=[{'all':!![]}];}return db[_0x91cb('0x28')]['findAll'](_0x5595c5);})[_0x91cb('0x22')](function(_0x4ecbd7){_0x4f5a7b[_0x91cb('0x3d')]=_0x4ecbd7;return _0x4f5a7b;})[_0x91cb('0x22')](respondWithFilteredResult(_0x318031,_0x5595c5))[_0x91cb('0x3e')](handleError(_0x318031,null));};exports[_0x91cb('0x3f')]=function(_0x5e98c4,_0x435fff){var _0x5af0e6={'raw':!![],'where':{'id':_0x5e98c4[_0x91cb('0x40')]['id']}},_0x2cf27e={};_0x2cf27e[_0x91cb('0x2b')]=_[_0x91cb('0x2d')](db[_0x91cb('0x28')][_0x91cb('0x29')]);_0x2cf27e[_0x91cb('0x2e')]=_[_0x91cb('0x2d')](_0x5e98c4['query']);_0x2cf27e[_0x91cb('0x2f')]=_['intersection'](_0x2cf27e[_0x91cb('0x2b')],_0x2cf27e['query']);_0x5af0e6[_0x91cb('0x31')]=_['intersection'](_0x2cf27e[_0x91cb('0x2b')],qs[_0x91cb('0x32')](_0x5e98c4[_0x91cb('0x2e')][_0x91cb('0x32')]));_0x5af0e6['attributes']=_0x5af0e6[_0x91cb('0x31')][_0x91cb('0x33')]?_0x5af0e6['attributes']:_0x2cf27e[_0x91cb('0x2b')];if(_0x5e98c4[_0x91cb('0x2e')][_0x91cb('0x41')]){_0x5af0e6[_0x91cb('0x3c')]=[{'all':!![]}];}_0x5af0e6=_[_0x91cb('0x3b')]({},_0x5af0e6,_0x5e98c4[_0x91cb('0x42')]);return db[_0x91cb('0x28')][_0x91cb('0x43')](_0x5af0e6)[_0x91cb('0x22')](handleEntityNotFound(_0x435fff,null))['then'](respondWithResult(_0x435fff,null))[_0x91cb('0x3e')](handleError(_0x435fff,null));};exports[_0x91cb('0x44')]=function(_0x2b7323,_0x470996){return db[_0x91cb('0x28')][_0x91cb('0x44')](_0x2b7323[_0x91cb('0x45')],{})[_0x91cb('0x22')](respondWithResult(_0x470996,0xc9))['catch'](handleError(_0x470996,null));};exports[_0x91cb('0x46')]=function(_0x46caf1,_0x2b8b7f){if(_0x46caf1[_0x91cb('0x45')]['id']){delete _0x46caf1['body']['id'];}return db[_0x91cb('0x28')][_0x91cb('0x43')]({'where':{'id':_0x46caf1['params']['id']}})[_0x91cb('0x22')](handleEntityNotFound(_0x2b8b7f,null))['then'](saveUpdates(_0x46caf1[_0x91cb('0x45')],null))['then'](respondWithResult(_0x2b8b7f,null))['catch'](handleError(_0x2b8b7f,null));};exports['destroy']=function(_0x98245b,_0xff3d11){return db[_0x91cb('0x28')][_0x91cb('0x43')]({'where':{'id':_0x98245b[_0x91cb('0x40')]['id']}})['then'](handleEntityNotFound(_0xff3d11,null))['then'](removeEntity(_0xff3d11,null))[_0x91cb('0x3e')](handleError(_0xff3d11,null));};exports[_0x91cb('0x47')]=function(_0x140994,_0x14eaab){return db['SquareReport']['describe']()['then'](respondWithResult(_0x14eaab,null))[_0x91cb('0x3e')](handleError(_0x14eaab,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index c910a9b..28514b4 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 _0xb103=['project_name','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareReport.attributes','define','SquareReport','report_square','uid_pname','uniqueid'];(function(_0x3d904e,_0x2d819f){var _0x656fb2=function(_0x28fec1){while(--_0x28fec1){_0x3d904e['push'](_0x3d904e['shift']());}};_0x656fb2(++_0x2d819f);}(_0xb103,0xd1));var _0x3b10=function(_0x20e7e3,_0x1529be){_0x20e7e3=_0x20e7e3-0x0;var _0x14b9de=_0xb103[_0x20e7e3];return _0x14b9de;};'use strict';var _=require(_0x3b10('0x0'));var util=require(_0x3b10('0x1'));var logger=require(_0x3b10('0x2'))(_0x3b10('0x3'));var moment=require(_0x3b10('0x4'));var BPromise=require(_0x3b10('0x5'));var rp=require(_0x3b10('0x6'));var fs=require('fs');var path=require(_0x3b10('0x7'));var rimraf=require('rimraf');var config=require(_0x3b10('0x8'));var attributes=require(_0x3b10('0x9'));module['exports']=function(_0x285570,_0x5d5bf8){return _0x285570[_0x3b10('0xa')](_0x3b10('0xb'),attributes,{'tableName':_0x3b10('0xc'),'paranoid':![],'indexes':[{'name':_0x3b10('0xd'),'fields':[_0x3b10('0xe'),_0x3b10('0xf')]},{'name':'leaveAt','fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc118=['uniqueid','project_name','leaveAt','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname'];(function(_0x2773e4,_0x35bbb6){var _0xa92238=function(_0x24440e){while(--_0x24440e){_0x2773e4['push'](_0x2773e4['shift']());}};_0xa92238(++_0x35bbb6);}(_0xc118,0xdb));var _0x8c11=function(_0x56bc49,_0x2bafdb){_0x56bc49=_0x56bc49-0x0;var _0x108217=_0xc118[_0x56bc49];return _0x108217;};'use strict';var _=require(_0x8c11('0x0'));var util=require(_0x8c11('0x1'));var logger=require('../../config/logger')(_0x8c11('0x2'));var moment=require(_0x8c11('0x3'));var BPromise=require(_0x8c11('0x4'));var rp=require(_0x8c11('0x5'));var fs=require('fs');var path=require(_0x8c11('0x6'));var rimraf=require(_0x8c11('0x7'));var config=require(_0x8c11('0x8'));var attributes=require(_0x8c11('0x9'));module[_0x8c11('0xa')]=function(_0x5b580a,_0x4097f0){return _0x5b580a[_0x8c11('0xb')](_0x8c11('0xc'),attributes,{'tableName':_0x8c11('0xd'),'paranoid':![],'indexes':[{'name':_0x8c11('0xe'),'fields':[_0x8c11('0xf'),_0x8c11('0x10')]},{'name':_0x8c11('0x11'),'fields':[_0x8c11('0x11')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 811d73f..1326e91 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 _0xf2b1=['error','code','message','result','catch','SquareReport','create','body','options','raw','then','CreateSquareReport','stringify','UpdateSquareReport','update','where','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0xf2b1,0xf8));var _0x1f2b=function(_0x44b0de,_0x213afa){_0x44b0de=_0x44b0de-0x0;var _0x21da2a=_0xf2b1[_0x44b0de];return _0x21da2a;};'use strict';var _=require(_0x1f2b('0x0'));var util=require('util');var moment=require(_0x1f2b('0x1'));var BPromise=require(_0x1f2b('0x2'));var rs=require(_0x1f2b('0x3'));var fs=require('fs');var Redis=require(_0x1f2b('0x4'));var db=require(_0x1f2b('0x5'))['db'];var utils=require(_0x1f2b('0x6'));var logger=require(_0x1f2b('0x7'))('rpc');var config=require(_0x1f2b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1f2b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f1dc9,_0x470d13,_0x4dea0d){return new BPromise(function(_0x2e43f4,_0x4da66b){return client[_0x1f2b('0xa')](_0x5f1dc9,_0x4dea0d)['then'](function(_0x52a5c0){logger[_0x1f2b('0xb')](_0x1f2b('0xc'),_0x470d13,_0x1f2b('0xd'));logger[_0x1f2b('0xe')](_0x1f2b('0xf'),_0x470d13,_0x1f2b('0xd'),JSON['stringify'](_0x52a5c0));if(_0x52a5c0[_0x1f2b('0x10')]){if(_0x52a5c0[_0x1f2b('0x10')][_0x1f2b('0x11')]===0x1f4){logger[_0x1f2b('0x10')](_0x1f2b('0xc'),_0x470d13,_0x52a5c0[_0x1f2b('0x10')][_0x1f2b('0x12')]);return _0x4da66b(_0x52a5c0[_0x1f2b('0x10')]['message']);}logger[_0x1f2b('0x10')](_0x1f2b('0xc'),_0x470d13,_0x52a5c0[_0x1f2b('0x10')][_0x1f2b('0x12')]);return _0x2e43f4(_0x52a5c0[_0x1f2b('0x10')][_0x1f2b('0x12')]);}else{logger[_0x1f2b('0xb')](_0x1f2b('0xc'),_0x470d13,'request\x20sent');_0x2e43f4(_0x52a5c0[_0x1f2b('0x13')][_0x1f2b('0x12')]);}})[_0x1f2b('0x14')](function(_0x575dcc){logger[_0x1f2b('0x10')](_0x1f2b('0xc'),_0x470d13,_0x575dcc);_0x4da66b(_0x575dcc);});});}exports['CreateSquareReport']=function(_0x235b4e){var _0x5d0cf9=this;return new Promise(function(_0x197da4,_0x26ecc7){return db[_0x1f2b('0x15')][_0x1f2b('0x16')](_0x235b4e[_0x1f2b('0x17')],{'raw':_0x235b4e[_0x1f2b('0x18')]?_0x235b4e[_0x1f2b('0x18')][_0x1f2b('0x19')]===undefined?!![]:![]:!![]})[_0x1f2b('0x1a')](function(_0x4b3147){logger[_0x1f2b('0xb')](_0x1f2b('0x1b'),_0x235b4e);logger[_0x1f2b('0xe')](_0x1f2b('0x1b'),_0x235b4e,JSON[_0x1f2b('0x1c')](_0x4b3147));_0x197da4(_0x4b3147);})['catch'](function(_0x35345d){logger['error']('CreateSquareReport',_0x35345d['message'],_0x235b4e);_0x26ecc7(_0x5d0cf9['error'](0x1f4,_0x35345d[_0x1f2b('0x12')]));});});};exports[_0x1f2b('0x1d')]=function(_0x4941cd){var _0x2c497e=this;return new Promise(function(_0xa5bcf1,_0x3c6860){return db[_0x1f2b('0x15')][_0x1f2b('0x1e')](_0x4941cd[_0x1f2b('0x17')],{'raw':_0x4941cd[_0x1f2b('0x18')]?_0x4941cd[_0x1f2b('0x18')][_0x1f2b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4941cd['options']?_0x4941cd[_0x1f2b('0x18')][_0x1f2b('0x1f')]||null:null,'attributes':_0x4941cd[_0x1f2b('0x18')]?_0x4941cd['options']['attributes']||null:null,'limit':_0x4941cd['options']?_0x4941cd[_0x1f2b('0x18')][_0x1f2b('0x20')]||null:null})[_0x1f2b('0x1a')](function(_0x4543eb){logger[_0x1f2b('0xb')](_0x1f2b('0x1d'),_0x4941cd);logger['debug'](_0x1f2b('0x1d'),_0x4941cd,JSON['stringify'](_0x4543eb));_0xa5bcf1(_0x4543eb);})[_0x1f2b('0x14')](function(_0x574d89){logger['error']('UpdateSquareReport',_0x574d89[_0x1f2b('0x12')],_0x4941cd);_0x3c6860(_0x2c497e[_0x1f2b('0x10')](0x1f4,_0x574d89[_0x1f2b('0x12')]));});});}; \ No newline at end of file +var _0xf643=['SquareReport,\x20%s,\x20%s','message','result','catch','SquareReport','create','body','options','raw','CreateSquareReport','update','where','attributes','limit','UpdateSquareReport','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5816ea,_0x4dd025){var _0x57f8e0=function(_0x1f37db){while(--_0x1f37db){_0x5816ea['push'](_0x5816ea['shift']());}};_0x57f8e0(++_0x4dd025);}(_0xf643,0x105));var _0x3f64=function(_0x41e94c,_0x386a89){_0x41e94c=_0x41e94c-0x0;var _0x325eae=_0xf643[_0x41e94c];return _0x325eae;};'use strict';var _=require(_0x3f64('0x0'));var util=require(_0x3f64('0x1'));var moment=require(_0x3f64('0x2'));var BPromise=require(_0x3f64('0x3'));var rs=require(_0x3f64('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f64('0x5'))['db'];var utils=require(_0x3f64('0x6'));var logger=require(_0x3f64('0x7'))('rpc');var config=require(_0x3f64('0x8'));var jayson=require(_0x3f64('0x9'));var client=jayson[_0x3f64('0xa')][_0x3f64('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37aa71,_0x65af72,_0x388202){return new BPromise(function(_0x460a0e,_0x5af045){return client['request'](_0x37aa71,_0x388202)[_0x3f64('0xc')](function(_0x231fb0){logger[_0x3f64('0xd')]('SquareReport,\x20%s,\x20%s',_0x65af72,_0x3f64('0xe'));logger['debug'](_0x3f64('0xf'),_0x65af72,_0x3f64('0xe'),JSON[_0x3f64('0x10')](_0x231fb0));if(_0x231fb0[_0x3f64('0x11')]){if(_0x231fb0[_0x3f64('0x11')][_0x3f64('0x12')]===0x1f4){logger[_0x3f64('0x11')](_0x3f64('0x13'),_0x65af72,_0x231fb0[_0x3f64('0x11')][_0x3f64('0x14')]);return _0x5af045(_0x231fb0[_0x3f64('0x11')][_0x3f64('0x14')]);}logger[_0x3f64('0x11')]('SquareReport,\x20%s,\x20%s',_0x65af72,_0x231fb0['error'][_0x3f64('0x14')]);return _0x460a0e(_0x231fb0[_0x3f64('0x11')][_0x3f64('0x14')]);}else{logger[_0x3f64('0xd')](_0x3f64('0x13'),_0x65af72,_0x3f64('0xe'));_0x460a0e(_0x231fb0[_0x3f64('0x15')][_0x3f64('0x14')]);}})[_0x3f64('0x16')](function(_0x15f476){logger[_0x3f64('0x11')]('SquareReport,\x20%s,\x20%s',_0x65af72,_0x15f476);_0x5af045(_0x15f476);});});}exports['CreateSquareReport']=function(_0x35ad06){var _0x3787bb=this;return new Promise(function(_0x5660e4,_0x12b127){return db[_0x3f64('0x17')][_0x3f64('0x18')](_0x35ad06[_0x3f64('0x19')],{'raw':_0x35ad06[_0x3f64('0x1a')]?_0x35ad06['options'][_0x3f64('0x1b')]===undefined?!![]:![]:!![]})[_0x3f64('0xc')](function(_0xa608b3){logger['info'](_0x3f64('0x1c'),_0x35ad06);logger['debug'](_0x3f64('0x1c'),_0x35ad06,JSON[_0x3f64('0x10')](_0xa608b3));_0x5660e4(_0xa608b3);})[_0x3f64('0x16')](function(_0x5411c1){logger[_0x3f64('0x11')]('CreateSquareReport',_0x5411c1[_0x3f64('0x14')],_0x35ad06);_0x12b127(_0x3787bb['error'](0x1f4,_0x5411c1[_0x3f64('0x14')]));});});};exports['UpdateSquareReport']=function(_0x45b780){var _0x50ebf9=this;return new Promise(function(_0x44e2a1,_0x274bf2){return db['SquareReport'][_0x3f64('0x1d')](_0x45b780[_0x3f64('0x19')],{'raw':_0x45b780[_0x3f64('0x1a')]?_0x45b780[_0x3f64('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45b780['options']?_0x45b780[_0x3f64('0x1a')][_0x3f64('0x1e')]||null:null,'attributes':_0x45b780[_0x3f64('0x1a')]?_0x45b780[_0x3f64('0x1a')][_0x3f64('0x1f')]||null:null,'limit':_0x45b780['options']?_0x45b780[_0x3f64('0x1a')][_0x3f64('0x20')]||null:null})[_0x3f64('0xc')](function(_0x4e6082){logger['info'](_0x3f64('0x21'),_0x45b780);logger[_0x3f64('0x22')](_0x3f64('0x21'),_0x45b780,JSON['stringify'](_0x4e6082));_0x44e2a1(_0x4e6082);})[_0x3f64('0x16')](function(_0x322a94){logger[_0x3f64('0x11')](_0x3f64('0x21'),_0x322a94[_0x3f64('0x14')],_0x45b780);_0x274bf2(_0x50ebf9['error'](0x1f4,_0x322a94[_0x3f64('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index a93ab7d..4e82361 100644 --- a/server/api/squareReportDetail/index.js +++ b/server/api/squareReportDetail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['/describe','/:id','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x28108f,_0x395a0d){var _0x22ad22=function(_0x1c8fc9){while(--_0x1c8fc9){_0x28108f['push'](_0x28108f['shift']());}};_0x22ad22(++_0x395a0d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x13d9c5,_0x2c090c){_0x13d9c5=_0x13d9c5-0x0;var _0x53abc1=_0x5f2f[_0x13d9c5];return _0x53abc1;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['describe']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0xd')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xe')]);router['put'](_0xf5f2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf5f2('0xf')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);module[_0xf5f2('0x11')]=router; \ No newline at end of file +var _0x5f2f=['/describe','/:id','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x3e3329,_0x2a56d8){var _0x5d1c0c=function(_0x15f363){while(--_0x15f363){_0x3e3329['push'](_0x3e3329['shift']());}};_0x5d1c0c(++_0x2a56d8);}(_0x5f2f,0x73));var _0xf5f2=function(_0x32b374,_0x3031a6){_0x32b374=_0x32b374-0x0;var _0x309f0a=_0x5f2f[_0x32b374];return _0x309f0a;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['describe']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0xd')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xe')]);router['put'](_0xf5f2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf5f2('0xf')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);module[_0xf5f2('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 3e30373..02071ac 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 _0xd5ac=['exports','STRING','TEXT','sequelize'];(function(_0x490e36,_0x5c9bf8){var _0x18ef5a=function(_0x54453e){while(--_0x54453e){_0x490e36['push'](_0x490e36['shift']());}};_0x18ef5a(++_0x5c9bf8);}(_0xd5ac,0x1df));var _0xcd5a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd5ac[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xcd5a('0x0'));module[_0xcd5a('0x1')]={'uniqueid':{'type':Sequelize[_0xcd5a('0x2')]},'node':{'type':Sequelize[_0xcd5a('0x2')]},'application':{'type':Sequelize[_0xcd5a('0x2')]},'data':{'type':Sequelize[_0xcd5a('0x3')]},'project_name':{'type':Sequelize[_0xcd5a('0x2')]},'callerid':{'type':Sequelize[_0xcd5a('0x2')]}}; \ No newline at end of file +var _0x1413=['TEXT','sequelize','STRING'];(function(_0xbe30c2,_0xe7f176){var _0x2e8be8=function(_0x3780eb){while(--_0x3780eb){_0xbe30c2['push'](_0xbe30c2['shift']());}};_0x2e8be8(++_0xe7f176);}(_0x1413,0x14b));var _0x3141=function(_0x1534ba,_0x38110a){_0x1534ba=_0x1534ba-0x0;var _0x58311d=_0x1413[_0x1534ba];return _0x58311d;};'use strict';var Sequelize=require(_0x3141('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x3141('0x1')]},'node':{'type':Sequelize[_0x3141('0x1')]},'application':{'type':Sequelize[_0x3141('0x1')]},'data':{'type':Sequelize[_0x3141('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index d40b278..00d08e0 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 _0x93f9=['key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','length','find','create','update','body','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','destroy','stack','name','index','map','SquareDetailsReport','rawAttributes'];(function(_0x409dbf,_0x14966c){var _0x49591b=function(_0x23f2bc){while(--_0x23f2bc){_0x409dbf['push'](_0x409dbf['shift']());}};_0x49591b(++_0x14966c);}(_0x93f9,0x136));var _0x993f=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x93f9[_0x33032e];return _0x13316b;};'use strict';var pdf=require(_0x993f('0x0'));var emlformat=require(_0x993f('0x1'));var rimraf=require(_0x993f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x993f('0x3'));var moment=require('moment');var BPromise=require(_0x993f('0x4'));var Mustache=require('mustache');var util=require(_0x993f('0x5'));var path=require(_0x993f('0x6'));var sox=require(_0x993f('0x7'));var csv=require(_0x993f('0x8'));var ejs=require(_0x993f('0x9'));var fs=require('fs');var _=require(_0x993f('0xa'));var squel=require(_0x993f('0xb'));var crypto=require(_0x993f('0xc'));var jsforce=require(_0x993f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x993f('0x8'));var querystring=require(_0x993f('0xe'));var Papa=require(_0x993f('0xf'));var Redis=require(_0x993f('0x10'));var authService=require(_0x993f('0x11'));var qs=require(_0x993f('0x12'));var as=require(_0x993f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x993f('0x14'));var utils=require('../../config/utils');var config=require(_0x993f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31cc83,_0xb65fa3){_0xb65fa3=_0xb65fa3||0xcc;return function(_0x2a2d67){if(_0x2a2d67){return _0x31cc83[_0x993f('0x16')](_0xb65fa3);}return _0x31cc83[_0x993f('0x17')](_0xb65fa3)[_0x993f('0x18')]();};}function respondWithResult(_0x546f04,_0x3497e1){_0x3497e1=_0x3497e1||0xc8;return function(_0x837c57){if(_0x837c57){return _0x546f04[_0x993f('0x17')](_0x3497e1)[_0x993f('0x19')](_0x837c57);}};}function respondWithFilteredResult(_0x3dde18,_0xf32d32){return function(_0x56a4cc){if(_0x56a4cc){var _0x16309b=_0x56a4cc[_0x993f('0x1a')],_0x102027=_0xf32d32[_0x993f('0x1b')],_0xa9dcf7=_0xf32d32['offset']+_0xf32d32[_0x993f('0x1c')],_0x24c9ca;if(_0xa9dcf7>=_0x16309b){_0xa9dcf7=_0x16309b;_0x24c9ca=0xc8;}else{_0x24c9ca=0xce;}_0x3dde18[_0x993f('0x17')](_0x24c9ca);return _0x3dde18[_0x993f('0x1d')]('Content-Range',_0x102027+'-'+_0xa9dcf7+'/'+_0x16309b)['json'](_0x56a4cc);}return null;};}function patchUpdates(_0x3c6bce){return function(_0x128e02){try{jsonpatch[_0x993f('0x1e')](_0x128e02,_0x3c6bce,!![]);}catch(_0x3b0bd0){return BPromise[_0x993f('0x1f')](_0x3b0bd0);}return _0x128e02[_0x993f('0x20')]();};}function saveUpdates(_0x4db7be,_0x5518cf){return function(_0x4dcec3){if(_0x4dcec3){return _0x4dcec3['update'](_0x4db7be)['then'](function(_0x584ca2){return _0x584ca2;});}return null;};}function removeEntity(_0xd21f9d,_0x44d8a8){return function(_0x12bddf){if(_0x12bddf){return _0x12bddf[_0x993f('0x21')]()['then'](function(){_0xd21f9d[_0x993f('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fe0a7,_0x1f53b7){return function(_0x3b300e){if(!_0x3b300e){_0x2fe0a7[_0x993f('0x16')](0x194);}return _0x3b300e;};}function handleError(_0x366fda,_0x4edf22){_0x4edf22=_0x4edf22||0x1f4;return function(_0x20b0fd){logger['error'](_0x20b0fd[_0x993f('0x22')]);if(_0x20b0fd['name']){delete _0x20b0fd[_0x993f('0x23')];}_0x366fda[_0x993f('0x17')](_0x4edf22)['send'](_0x20b0fd);};}exports[_0x993f('0x24')]=function(_0x14d973,_0x2c8c98){var _0x4037fa={},_0xce6795={},_0x146013={'count':0x0,'rows':[]};var _0x577a71=_[_0x993f('0x25')](db[_0x993f('0x26')][_0x993f('0x27')],function(_0xd0168e){return{'name':_0xd0168e['fieldName'],'type':_0xd0168e['type'][_0x993f('0x28')]};});_0xce6795[_0x993f('0x29')]=_[_0x993f('0x25')](_0x577a71,_0x993f('0x23'));_0xce6795[_0x993f('0x2a')]=_[_0x993f('0x2b')](_0x14d973['query']);_0xce6795[_0x993f('0x2c')]=_['intersection'](_0xce6795[_0x993f('0x29')],_0xce6795[_0x993f('0x2a')]);_0x4037fa['attributes']=_[_0x993f('0x2d')](_0xce6795[_0x993f('0x29')],qs[_0x993f('0x2e')](_0x14d973['query']['fields']));_0x4037fa['attributes']=_0x4037fa['attributes']['length']?_0x4037fa[_0x993f('0x2f')]:_0xce6795['model'];if(!_0x14d973['query']['hasOwnProperty'](_0x993f('0x30'))){_0x4037fa[_0x993f('0x1c')]=qs['limit'](_0x14d973['query'][_0x993f('0x1c')]);_0x4037fa[_0x993f('0x1b')]=qs[_0x993f('0x1b')](_0x14d973[_0x993f('0x2a')][_0x993f('0x1b')]);}_0x4037fa[_0x993f('0x31')]=qs[_0x993f('0x32')](_0x14d973[_0x993f('0x2a')]['sort']);_0x4037fa[_0x993f('0x33')]=qs[_0x993f('0x2c')](_['pick'](_0x14d973[_0x993f('0x2a')],_0xce6795['filters']));if(_0x14d973[_0x993f('0x2a')][_0x993f('0x34')]){_0x4037fa[_0x993f('0x33')]=_[_0x993f('0x35')](_0x4037fa[_0x993f('0x33')],{'$or':_[_0x993f('0x25')](_0x577a71,function(_0xa0649e){if(_0xa0649e['type']!==_0x993f('0x36')){var _0x56f1fb={};_0x56f1fb[_0xa0649e['name']]={'$like':'%'+_0x14d973[_0x993f('0x2a')][_0x993f('0x34')]+'%'};return _0x56f1fb;}})});}_0x4037fa=_[_0x993f('0x35')]({},_0x4037fa,_0x14d973[_0x993f('0x37')]);var _0x3ce9d5={'where':_0x4037fa[_0x993f('0x33')]};return db[_0x993f('0x26')][_0x993f('0x1a')](_0x3ce9d5)[_0x993f('0x38')](function(_0x1cc055){_0x146013['count']=_0x1cc055;if(_0x14d973[_0x993f('0x2a')][_0x993f('0x39')]){_0x4037fa[_0x993f('0x3a')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x993f('0x3b')](_0x4037fa);})['then'](function(_0x318305){_0x146013[_0x993f('0x3c')]=_0x318305;return _0x146013;})[_0x993f('0x38')](respondWithFilteredResult(_0x2c8c98,_0x4037fa))[_0x993f('0x3d')](handleError(_0x2c8c98,null));};exports[_0x993f('0x3e')]=function(_0x1193a6,_0x36a767){var _0x16c8d6={'raw':!![],'where':{'id':_0x1193a6[_0x993f('0x3f')]['id']}},_0x4eb3fe={};_0x4eb3fe['model']=_['keys'](db['SquareDetailsReport']['rawAttributes']);_0x4eb3fe[_0x993f('0x2a')]=_[_0x993f('0x2b')](_0x1193a6['query']);_0x4eb3fe[_0x993f('0x2c')]=_[_0x993f('0x2d')](_0x4eb3fe[_0x993f('0x29')],_0x4eb3fe[_0x993f('0x2a')]);_0x16c8d6[_0x993f('0x2f')]=_[_0x993f('0x2d')](_0x4eb3fe[_0x993f('0x29')],qs[_0x993f('0x2e')](_0x1193a6['query'][_0x993f('0x2e')]));_0x16c8d6[_0x993f('0x2f')]=_0x16c8d6[_0x993f('0x2f')][_0x993f('0x40')]?_0x16c8d6['attributes']:_0x4eb3fe[_0x993f('0x29')];if(_0x1193a6['query']['includeAll']){_0x16c8d6[_0x993f('0x3a')]=[{'all':!![]}];}_0x16c8d6=_[_0x993f('0x35')]({},_0x16c8d6,_0x1193a6['options']);return db[_0x993f('0x26')][_0x993f('0x41')](_0x16c8d6)[_0x993f('0x38')](handleEntityNotFound(_0x36a767,null))['then'](respondWithResult(_0x36a767,null))[_0x993f('0x3d')](handleError(_0x36a767,null));};exports[_0x993f('0x42')]=function(_0x271756,_0x4bd074){return db[_0x993f('0x26')][_0x993f('0x42')](_0x271756['body'],{})[_0x993f('0x38')](respondWithResult(_0x4bd074,0xc9))[_0x993f('0x3d')](handleError(_0x4bd074,null));};exports[_0x993f('0x43')]=function(_0x196c6b,_0x315aad){if(_0x196c6b['body']['id']){delete _0x196c6b[_0x993f('0x44')]['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x196c6b[_0x993f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x315aad,null))[_0x993f('0x38')](saveUpdates(_0x196c6b[_0x993f('0x44')],null))[_0x993f('0x38')](respondWithResult(_0x315aad,null))[_0x993f('0x3d')](handleError(_0x315aad,null));};exports[_0x993f('0x21')]=function(_0x2879ed,_0x53bc54){return db['SquareDetailsReport']['find']({'where':{'id':_0x2879ed[_0x993f('0x3f')]['id']}})[_0x993f('0x38')](handleEntityNotFound(_0x53bc54,null))[_0x993f('0x38')](removeEntity(_0x53bc54,null))[_0x993f('0x3d')](handleError(_0x53bc54,null));};exports['describe']=function(_0x502d0b,_0x437341){return db[_0x993f('0x26')][_0x993f('0x45')]()[_0x993f('0x38')](respondWithResult(_0x437341,null))[_0x993f('0x3d')](handleError(_0x437341,null));}; \ No newline at end of file +var _0x0e9c=['key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','count','include','rows','catch','show','params','includeAll','create','body','find','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','SquareDetailsReport','fieldName','type'];(function(_0x277ab6,_0xf5fe4d){var _0x37e640=function(_0x2e3be4){while(--_0x2e3be4){_0x277ab6['push'](_0x277ab6['shift']());}};_0x37e640(++_0xf5fe4d);}(_0x0e9c,0xb4));var _0xc0e9=function(_0x3b0d12,_0x581b78){_0x3b0d12=_0x3b0d12-0x0;var _0x44eb08=_0x0e9c[_0x3b0d12];return _0x44eb08;};'use strict';var pdf=require(_0xc0e9('0x0'));var emlformat=require(_0xc0e9('0x1'));var rimraf=require(_0xc0e9('0x2'));var zipdir=require(_0xc0e9('0x3'));var jsonpatch=require(_0xc0e9('0x4'));var rp=require(_0xc0e9('0x5'));var moment=require(_0xc0e9('0x6'));var BPromise=require(_0xc0e9('0x7'));var Mustache=require(_0xc0e9('0x8'));var util=require('util');var path=require(_0xc0e9('0x9'));var sox=require(_0xc0e9('0xa'));var csv=require(_0xc0e9('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc0e9('0xc'));var squel=require(_0xc0e9('0xd'));var crypto=require(_0xc0e9('0xe'));var jsforce=require(_0xc0e9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xc0e9('0xb'));var querystring=require(_0xc0e9('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc0e9('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc0e9('0x12'));var hardwareService=require(_0xc0e9('0x13'));var logger=require(_0xc0e9('0x14'))(_0xc0e9('0x15'));var utils=require(_0xc0e9('0x16'));var config=require(_0xc0e9('0x17'));var db=require(_0xc0e9('0x18'))['db'];function respondWithStatusCode(_0x69b3c9,_0x47469a){_0x47469a=_0x47469a||0xcc;return function(_0x40f113){if(_0x40f113){return _0x69b3c9['sendStatus'](_0x47469a);}return _0x69b3c9[_0xc0e9('0x19')](_0x47469a)[_0xc0e9('0x1a')]();};}function respondWithResult(_0xb1a4cc,_0x2ad4af){_0x2ad4af=_0x2ad4af||0xc8;return function(_0xe93aa0){if(_0xe93aa0){return _0xb1a4cc[_0xc0e9('0x19')](_0x2ad4af)['json'](_0xe93aa0);}};}function respondWithFilteredResult(_0x420768,_0x31fee5){return function(_0x3fcf8d){if(_0x3fcf8d){var _0x5a0d0f=_0x3fcf8d['count'],_0x195925=_0x31fee5['offset'],_0x31e6ad=_0x31fee5[_0xc0e9('0x1b')]+_0x31fee5[_0xc0e9('0x1c')],_0x2aa1c8;if(_0x31e6ad>=_0x5a0d0f){_0x31e6ad=_0x5a0d0f;_0x2aa1c8=0xc8;}else{_0x2aa1c8=0xce;}_0x420768[_0xc0e9('0x19')](_0x2aa1c8);return _0x420768[_0xc0e9('0x1d')](_0xc0e9('0x1e'),_0x195925+'-'+_0x31e6ad+'/'+_0x5a0d0f)[_0xc0e9('0x1f')](_0x3fcf8d);}return null;};}function patchUpdates(_0x5e92e9){return function(_0x5bde21){try{jsonpatch[_0xc0e9('0x20')](_0x5bde21,_0x5e92e9,!![]);}catch(_0x4add12){return BPromise[_0xc0e9('0x21')](_0x4add12);}return _0x5bde21[_0xc0e9('0x22')]();};}function saveUpdates(_0x3ca6a1,_0x2c46fe){return function(_0x33319d){if(_0x33319d){return _0x33319d[_0xc0e9('0x23')](_0x3ca6a1)[_0xc0e9('0x24')](function(_0xdb2694){return _0xdb2694;});}return null;};}function removeEntity(_0x55b2fb,_0x3daaef){return function(_0x26f16d){if(_0x26f16d){return _0x26f16d['destroy']()[_0xc0e9('0x24')](function(){_0x55b2fb['status'](0xcc)[_0xc0e9('0x1a')]();});}};}function handleEntityNotFound(_0x129e84,_0x125039){return function(_0x3b180f){if(!_0x3b180f){_0x129e84[_0xc0e9('0x25')](0x194);}return _0x3b180f;};}function handleError(_0x352f6c,_0xe202bd){_0xe202bd=_0xe202bd||0x1f4;return function(_0x13eb1c){logger[_0xc0e9('0x26')](_0x13eb1c[_0xc0e9('0x27')]);if(_0x13eb1c['name']){delete _0x13eb1c[_0xc0e9('0x28')];}_0x352f6c[_0xc0e9('0x19')](_0xe202bd)[_0xc0e9('0x29')](_0x13eb1c);};}exports['index']=function(_0x1ddfb8,_0x3da554){var _0x200f6f={},_0x2679de={},_0x29ddc9={'count':0x0,'rows':[]};var _0x404cba=_['map'](db[_0xc0e9('0x2a')]['rawAttributes'],function(_0x114b2e){return{'name':_0x114b2e[_0xc0e9('0x2b')],'type':_0x114b2e[_0xc0e9('0x2c')][_0xc0e9('0x2d')]};});_0x2679de[_0xc0e9('0x2e')]=_[_0xc0e9('0x2f')](_0x404cba,_0xc0e9('0x28'));_0x2679de[_0xc0e9('0x30')]=_[_0xc0e9('0x31')](_0x1ddfb8[_0xc0e9('0x30')]);_0x2679de[_0xc0e9('0x32')]=_[_0xc0e9('0x33')](_0x2679de[_0xc0e9('0x2e')],_0x2679de[_0xc0e9('0x30')]);_0x200f6f[_0xc0e9('0x34')]=_[_0xc0e9('0x33')](_0x2679de[_0xc0e9('0x2e')],qs[_0xc0e9('0x35')](_0x1ddfb8[_0xc0e9('0x30')][_0xc0e9('0x35')]));_0x200f6f[_0xc0e9('0x34')]=_0x200f6f['attributes'][_0xc0e9('0x36')]?_0x200f6f['attributes']:_0x2679de['model'];if(!_0x1ddfb8[_0xc0e9('0x30')][_0xc0e9('0x37')]('nolimit')){_0x200f6f['limit']=qs[_0xc0e9('0x1c')](_0x1ddfb8[_0xc0e9('0x30')][_0xc0e9('0x1c')]);_0x200f6f[_0xc0e9('0x1b')]=qs['offset'](_0x1ddfb8[_0xc0e9('0x30')][_0xc0e9('0x1b')]);}_0x200f6f['order']=qs[_0xc0e9('0x38')](_0x1ddfb8[_0xc0e9('0x30')][_0xc0e9('0x38')]);_0x200f6f[_0xc0e9('0x39')]=qs[_0xc0e9('0x32')](_[_0xc0e9('0x3a')](_0x1ddfb8[_0xc0e9('0x30')],_0x2679de[_0xc0e9('0x32')]));if(_0x1ddfb8[_0xc0e9('0x30')][_0xc0e9('0x3b')]){_0x200f6f[_0xc0e9('0x39')]=_['merge'](_0x200f6f[_0xc0e9('0x39')],{'$or':_[_0xc0e9('0x2f')](_0x404cba,function(_0x8d77f5){if(_0x8d77f5[_0xc0e9('0x2c')]!==_0xc0e9('0x3c')){var _0x40e394={};_0x40e394[_0x8d77f5[_0xc0e9('0x28')]]={'$like':'%'+_0x1ddfb8['query'][_0xc0e9('0x3b')]+'%'};return _0x40e394;}})});}_0x200f6f=_[_0xc0e9('0x3d')]({},_0x200f6f,_0x1ddfb8[_0xc0e9('0x3e')]);var _0x5687cc={'where':_0x200f6f[_0xc0e9('0x39')]};return db[_0xc0e9('0x2a')][_0xc0e9('0x3f')](_0x5687cc)['then'](function(_0x4baf60){_0x29ddc9[_0xc0e9('0x3f')]=_0x4baf60;if(_0x1ddfb8[_0xc0e9('0x30')]['includeAll']){_0x200f6f[_0xc0e9('0x40')]=[{'all':!![]}];}return db[_0xc0e9('0x2a')]['findAll'](_0x200f6f);})['then'](function(_0x255850){_0x29ddc9[_0xc0e9('0x41')]=_0x255850;return _0x29ddc9;})[_0xc0e9('0x24')](respondWithFilteredResult(_0x3da554,_0x200f6f))[_0xc0e9('0x42')](handleError(_0x3da554,null));};exports[_0xc0e9('0x43')]=function(_0x3c3aa0,_0x22a0f4){var _0x379d1f={'raw':!![],'where':{'id':_0x3c3aa0[_0xc0e9('0x44')]['id']}},_0x5ac19f={};_0x5ac19f[_0xc0e9('0x2e')]=_['keys'](db[_0xc0e9('0x2a')]['rawAttributes']);_0x5ac19f[_0xc0e9('0x30')]=_[_0xc0e9('0x31')](_0x3c3aa0[_0xc0e9('0x30')]);_0x5ac19f['filters']=_[_0xc0e9('0x33')](_0x5ac19f['model'],_0x5ac19f[_0xc0e9('0x30')]);_0x379d1f[_0xc0e9('0x34')]=_[_0xc0e9('0x33')](_0x5ac19f[_0xc0e9('0x2e')],qs[_0xc0e9('0x35')](_0x3c3aa0[_0xc0e9('0x30')][_0xc0e9('0x35')]));_0x379d1f[_0xc0e9('0x34')]=_0x379d1f['attributes'][_0xc0e9('0x36')]?_0x379d1f[_0xc0e9('0x34')]:_0x5ac19f[_0xc0e9('0x2e')];if(_0x3c3aa0[_0xc0e9('0x30')][_0xc0e9('0x45')]){_0x379d1f[_0xc0e9('0x40')]=[{'all':!![]}];}_0x379d1f=_[_0xc0e9('0x3d')]({},_0x379d1f,_0x3c3aa0[_0xc0e9('0x3e')]);return db[_0xc0e9('0x2a')]['find'](_0x379d1f)[_0xc0e9('0x24')](handleEntityNotFound(_0x22a0f4,null))[_0xc0e9('0x24')](respondWithResult(_0x22a0f4,null))[_0xc0e9('0x42')](handleError(_0x22a0f4,null));};exports[_0xc0e9('0x46')]=function(_0x495b1b,_0x3184f0){return db[_0xc0e9('0x2a')][_0xc0e9('0x46')](_0x495b1b['body'],{})[_0xc0e9('0x24')](respondWithResult(_0x3184f0,0xc9))[_0xc0e9('0x42')](handleError(_0x3184f0,null));};exports[_0xc0e9('0x23')]=function(_0x55bb4b,_0x52efb0){if(_0x55bb4b[_0xc0e9('0x47')]['id']){delete _0x55bb4b[_0xc0e9('0x47')]['id'];}return db['SquareDetailsReport'][_0xc0e9('0x48')]({'where':{'id':_0x55bb4b['params']['id']}})[_0xc0e9('0x24')](handleEntityNotFound(_0x52efb0,null))[_0xc0e9('0x24')](saveUpdates(_0x55bb4b[_0xc0e9('0x47')],null))['then'](respondWithResult(_0x52efb0,null))[_0xc0e9('0x42')](handleError(_0x52efb0,null));};exports[_0xc0e9('0x49')]=function(_0x5b4ba9,_0x36ab6c){return db['SquareDetailsReport'][_0xc0e9('0x48')]({'where':{'id':_0x5b4ba9[_0xc0e9('0x44')]['id']}})[_0xc0e9('0x24')](handleEntityNotFound(_0x36ab6c,null))[_0xc0e9('0x24')](removeEntity(_0x36ab6c,null))[_0xc0e9('0x42')](handleError(_0x36ab6c,null));};exports[_0xc0e9('0x4a')]=function(_0x2c1a7d,_0x540519){return db[_0xc0e9('0x2a')]['describe']()[_0xc0e9('0x24')](respondWithResult(_0x540519,null))[_0xc0e9('0x42')](handleError(_0x540519,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 5db88ba..bd3141e 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 _0x08af=['lodash','util','api','bluebird','request-promise','path','rimraf','define','SquareDetailsReport','report_square_details'];(function(_0x2ae8ce,_0x2a5a1f){var _0x4bf686=function(_0x41cabf){while(--_0x41cabf){_0x2ae8ce['push'](_0x2ae8ce['shift']());}};_0x4bf686(++_0x2a5a1f);}(_0x08af,0x1c2));var _0xf08a=function(_0x10b317,_0x2adf32){_0x10b317=_0x10b317-0x0;var _0x1e3054=_0x08af[_0x10b317];return _0x1e3054;};'use strict';var _=require(_0xf08a('0x0'));var util=require(_0xf08a('0x1'));var logger=require('../../config/logger')(_0xf08a('0x2'));var moment=require('moment');var BPromise=require(_0xf08a('0x3'));var rp=require(_0xf08a('0x4'));var fs=require('fs');var path=require(_0xf08a('0x5'));var rimraf=require(_0xf08a('0x6'));var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module['exports']=function(_0x14ab52,_0x1671bc){return _0x14ab52[_0xf08a('0x7')](_0xf08a('0x8'),attributes,{'tableName':_0xf08a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d45=['../../config/environment','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x5d45,0x179));var _0x55d4=function(_0x5afbd4,_0x3acd27){_0x5afbd4=_0x5afbd4-0x0;var _0x4a07c1=_0x5d45[_0x5afbd4];return _0x4a07c1;};'use strict';var _=require(_0x55d4('0x0'));var util=require(_0x55d4('0x1'));var logger=require(_0x55d4('0x2'))('api');var moment=require(_0x55d4('0x3'));var BPromise=require('bluebird');var rp=require(_0x55d4('0x4'));var fs=require('fs');var path=require(_0x55d4('0x5'));var rimraf=require(_0x55d4('0x6'));var config=require(_0x55d4('0x7'));var attributes=require('./squareReportDetail.attributes');module[_0x55d4('0x8')]=function(_0x258633,_0x7e54c0){return _0x258633[_0x55d4('0x9')](_0x55d4('0xa'),attributes,{'tableName':_0x55d4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 96ffc37..83b6a19 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 _0x4fbe=['then','CreateSquareDetailsReport','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareDetailsReport,\x20%s,\x20%s','result','catch','create','body','options','raw'];(function(_0x1babf4,_0x415dc1){var _0x569406=function(_0x396161){while(--_0x396161){_0x1babf4['push'](_0x1babf4['shift']());}};_0x569406(++_0x415dc1);}(_0x4fbe,0x1a2));var _0xe4fb=function(_0x5b20eb,_0x54dfaa){_0x5b20eb=_0x5b20eb-0x0;var _0x1c062d=_0x4fbe[_0x5b20eb];return _0x1c062d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe4fb('0x0'));var rs=require(_0xe4fb('0x1'));var fs=require('fs');var Redis=require(_0xe4fb('0x2'));var db=require(_0xe4fb('0x3'))['db'];var utils=require(_0xe4fb('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xe4fb('0x5'));var client=jayson[_0xe4fb('0x6')][_0xe4fb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x37a9d0,_0x4662cc,_0x4b04f8){return new BPromise(function(_0x36d783,_0x42b359){return client[_0xe4fb('0x8')](_0x37a9d0,_0x4b04f8)['then'](function(_0x1bedb1){logger[_0xe4fb('0x9')]('SquareDetailsReport,\x20%s,\x20%s',_0x4662cc,_0xe4fb('0xa'));logger[_0xe4fb('0xb')](_0xe4fb('0xc'),_0x4662cc,_0xe4fb('0xa'),JSON[_0xe4fb('0xd')](_0x1bedb1));if(_0x1bedb1['error']){if(_0x1bedb1[_0xe4fb('0xe')][_0xe4fb('0xf')]===0x1f4){logger[_0xe4fb('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x4662cc,_0x1bedb1[_0xe4fb('0xe')][_0xe4fb('0x10')]);return _0x42b359(_0x1bedb1[_0xe4fb('0xe')][_0xe4fb('0x10')]);}logger[_0xe4fb('0xe')](_0xe4fb('0x11'),_0x4662cc,_0x1bedb1[_0xe4fb('0xe')]['message']);return _0x36d783(_0x1bedb1[_0xe4fb('0xe')][_0xe4fb('0x10')]);}else{logger['info'](_0xe4fb('0x11'),_0x4662cc,'request\x20sent');_0x36d783(_0x1bedb1[_0xe4fb('0x12')][_0xe4fb('0x10')]);}})[_0xe4fb('0x13')](function(_0x2647c9){logger[_0xe4fb('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x4662cc,_0x2647c9);_0x42b359(_0x2647c9);});});}exports['CreateSquareDetailsReport']=function(_0x3c0dcd){var _0x49c0af=this;return new Promise(function(_0x23484c,_0x1714b4){return db['SquareDetailsReport'][_0xe4fb('0x14')](_0x3c0dcd[_0xe4fb('0x15')],{'raw':_0x3c0dcd['options']?_0x3c0dcd[_0xe4fb('0x16')][_0xe4fb('0x17')]===undefined?!![]:![]:!![]})[_0xe4fb('0x18')](function(_0xf8ee33){logger['info'](_0xe4fb('0x19'),_0x3c0dcd);logger[_0xe4fb('0xb')](_0xe4fb('0x19'),_0x3c0dcd,JSON[_0xe4fb('0xd')](_0xf8ee33));_0x23484c(_0xf8ee33);})[_0xe4fb('0x13')](function(_0x1650fe){logger[_0xe4fb('0xe')](_0xe4fb('0x19'),_0x1650fe[_0xe4fb('0x10')],_0x3c0dcd);_0x1714b4(_0x49c0af['error'](0x1f4,_0x1650fe[_0xe4fb('0x10')]));});});}; \ No newline at end of file +var _0x57ff=['SquareDetailsReport','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x5a102f,_0xffa686){var _0x255c2b=function(_0x51b671){while(--_0x51b671){_0x5a102f['push'](_0x5a102f['shift']());}};_0x255c2b(++_0xffa686);}(_0x57ff,0x165));var _0xf57f=function(_0x315062,_0x3b97d7){_0x315062=_0x315062-0x0;var _0x1bea22=_0x57ff[_0x315062];return _0x1bea22;};'use strict';var _=require(_0xf57f('0x0'));var util=require(_0xf57f('0x1'));var moment=require(_0xf57f('0x2'));var BPromise=require(_0xf57f('0x3'));var rs=require(_0xf57f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf57f('0x5'))['db'];var utils=require(_0xf57f('0x6'));var logger=require(_0xf57f('0x7'))(_0xf57f('0x8'));var config=require('../../config/environment');var jayson=require(_0xf57f('0x9'));var client=jayson[_0xf57f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa658d5,_0x16fafc,_0x417cd8){return new BPromise(function(_0x508d2e,_0x17fd3c){return client[_0xf57f('0xb')](_0xa658d5,_0x417cd8)[_0xf57f('0xc')](function(_0x37c16b){logger[_0xf57f('0xd')](_0xf57f('0xe'),_0x16fafc,_0xf57f('0xf'));logger['debug']('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x16fafc,'request\x20sent',JSON['stringify'](_0x37c16b));if(_0x37c16b[_0xf57f('0x10')]){if(_0x37c16b[_0xf57f('0x10')][_0xf57f('0x11')]===0x1f4){logger[_0xf57f('0x10')](_0xf57f('0xe'),_0x16fafc,_0x37c16b['error'][_0xf57f('0x12')]);return _0x17fd3c(_0x37c16b[_0xf57f('0x10')][_0xf57f('0x12')]);}logger[_0xf57f('0x10')](_0xf57f('0xe'),_0x16fafc,_0x37c16b[_0xf57f('0x10')][_0xf57f('0x12')]);return _0x508d2e(_0x37c16b[_0xf57f('0x10')][_0xf57f('0x12')]);}else{logger[_0xf57f('0xd')](_0xf57f('0xe'),_0x16fafc,'request\x20sent');_0x508d2e(_0x37c16b[_0xf57f('0x13')][_0xf57f('0x12')]);}})[_0xf57f('0x14')](function(_0x569788){logger[_0xf57f('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x16fafc,_0x569788);_0x17fd3c(_0x569788);});});}exports['CreateSquareDetailsReport']=function(_0x3c0daf){var _0x9f2976=this;return new Promise(function(_0x538173,_0x3596d6){return db[_0xf57f('0x15')][_0xf57f('0x16')](_0x3c0daf[_0xf57f('0x17')],{'raw':_0x3c0daf[_0xf57f('0x18')]?_0x3c0daf[_0xf57f('0x18')][_0xf57f('0x19')]===undefined?!![]:![]:!![]})[_0xf57f('0xc')](function(_0x48dc4f){logger[_0xf57f('0xd')]('CreateSquareDetailsReport',_0x3c0daf);logger['debug']('CreateSquareDetailsReport',_0x3c0daf,JSON[_0xf57f('0x1a')](_0x48dc4f));_0x538173(_0x48dc4f);})[_0xf57f('0x14')](function(_0x20590b){logger['error']('CreateSquareDetailsReport',_0x20590b[_0xf57f('0x12')],_0x3c0daf);_0x3596d6(_0x9f2976[_0xf57f('0x10')](0x1f4,_0x20590b[_0xf57f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 6fb15c9..4db4c8d 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 _0x6c79=['../../components/auth/service','./system.controller','get','index','/process/:pid/kill','isAuthenticated','killProcess','exports','express','Router'];(function(_0x3ceeed,_0x213a9e){var _0x279112=function(_0x1616b3){while(--_0x1616b3){_0x3ceeed['push'](_0x3ceeed['shift']());}};_0x279112(++_0x213a9e);}(_0x6c79,0x184));var _0x96c7=function(_0x1e3b8c,_0x291f35){_0x1e3b8c=_0x1e3b8c-0x0;var _0x59c81e=_0x6c79[_0x1e3b8c];return _0x59c81e;};'use strict';var express=require(_0x96c7('0x0'));var router=express[_0x96c7('0x1')]();var auth=require(_0x96c7('0x2'));var controller=require(_0x96c7('0x3'));router[_0x96c7('0x4')]('/',auth['isAuthenticated'](),controller[_0x96c7('0x5')]);router['get'](_0x96c7('0x6'),auth[_0x96c7('0x7')](),controller[_0x96c7('0x8')]);module[_0x96c7('0x9')]=router; \ No newline at end of file +var _0x23e6=['index','isAuthenticated','killProcess','exports','Router','../../components/auth/service','./system.controller','get'];(function(_0x25bca6,_0xe415ea){var _0x3f8d02=function(_0x3e581b){while(--_0x3e581b){_0x25bca6['push'](_0x25bca6['shift']());}};_0x3f8d02(++_0xe415ea);}(_0x23e6,0xf4));var _0x623e=function(_0x4b006b,_0x3c1db3){_0x4b006b=_0x4b006b-0x0;var _0x362121=_0x23e6[_0x4b006b];return _0x362121;};'use strict';var express=require('express');var router=express[_0x623e('0x0')]();var auth=require(_0x623e('0x1'));var controller=require(_0x623e('0x2'));router[_0x623e('0x3')]('/',auth['isAuthenticated'](),controller[_0x623e('0x4')]);router['get']('/process/:pid/kill',auth[_0x623e('0x5')](),controller[_0x623e('0x6')]);module[_0x623e('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 3d203bd..bb25a50 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 _0xc040=['api','util','bluebird','lodash','error','inspect','name','send','index','then','status','catch','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','../../config/logger'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xc040,0xc6));var _0x0c04=function(_0x5dcf2d,_0x234849){_0x5dcf2d=_0x5dcf2d-0x0;var _0xaeb7c4=_0xc040[_0x5dcf2d];return _0xaeb7c4;};'use strict';var info=require('systeminformation');var exec=require(_0x0c04('0x0'))['exec'];var logger=require(_0x0c04('0x1'))(_0x0c04('0x2'));var util=require(_0x0c04('0x3'));var BPromise=require(_0x0c04('0x4'));var _=require(_0x0c04('0x5'));function handleError(_0x3c19c6,_0x131362,_0x48ebfe){_0x131362=_0x131362||0x1f4;return function(_0x1e7b18){logger[_0x0c04('0x6')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x48ebfe,_0x131362,util[_0x0c04('0x7')](_0x1e7b18,{'showHidden':![],'depth':null}));delete _0x1e7b18[_0x0c04('0x8')];_0x3c19c6['status'](_0x131362)[_0x0c04('0x9')](_0x1e7b18);};}exports[_0x0c04('0xa')]=function(_0x143fb1,_0x5c150c){return info['getAllData']()[_0x0c04('0xb')](function(_0x1a08e2){return _0x5c150c[_0x0c04('0xc')](0xc8)['json'](_0x1a08e2);})[_0x0c04('0xd')](function(_0xa29bd6){return _0x5c150c[_0x0c04('0xc')](0x1f4)[_0x0c04('0xe')](_0xa29bd6);});};exports[_0x0c04('0xf')]=function(_0x5c9734,_0x648503){var _0x49ed0d=[_0x0c04('0x10')];return new BPromise(function(_0x1166b8,_0x4a2516){return exec(util[_0x0c04('0x11')](_0x0c04('0x12'),_0x5c9734[_0x0c04('0x13')][_0x0c04('0x14')]),function(_0x46e4a5,_0xdf0493,_0x3f86f1){if(_0x46e4a5){return _0x4a2516(_0x46e4a5);}return _0x1166b8(_0xdf0493);});})[_0x0c04('0xb')](function(_0x40e4b4){var _0x2037d8=![];var _0x284599=_0x40e4b4[_0x0c04('0x15')](/\n/);for(var _0x5a5cec=0x0,_0x228509=_0x49ed0d['length'];_0x5a5cec<_0x228509,_0x2037d8===![];_0x5a5cec+=0x1){if(_0x40e4b4['indexOf'](_0x49ed0d[_0x5a5cec])>=0x0){_0x2037d8=!![];}}if(!_0x2037d8){throw new Error(util['format'](_0x0c04('0x16'),_0x5c9734[_0x0c04('0x13')][_0x0c04('0x14')]));}process[_0x0c04('0x17')](_0x5c9734[_0x0c04('0x13')][_0x0c04('0x14')],'SIGINT');return _0x648503[_0x0c04('0xc')](0xc8)[_0x0c04('0xe')]({'message':util[_0x0c04('0x11')](_0x0c04('0x18'),_0x5c9734[_0x0c04('0x13')][_0x0c04('0x14')])});})[_0x0c04('0xd')](handleError(_0x648503,null,_0x0c04('0xf')));}; \ No newline at end of file +var _0x47a8=['child_process','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation'];(function(_0x3b1fec,_0x48be3f){var _0x590660=function(_0x3eaac7){while(--_0x3eaac7){_0x3b1fec['push'](_0x3b1fec['shift']());}};_0x590660(++_0x48be3f);}(_0x47a8,0x154));var _0x847a=function(_0x1c12bd,_0x1c9dda){_0x1c12bd=_0x1c12bd-0x0;var _0x59c2f7=_0x47a8[_0x1c12bd];return _0x59c2f7;};'use strict';var info=require(_0x847a('0x0'));var exec=require(_0x847a('0x1'))['exec'];var logger=require(_0x847a('0x2'))(_0x847a('0x3'));var util=require(_0x847a('0x4'));var BPromise=require(_0x847a('0x5'));var _=require(_0x847a('0x6'));function handleError(_0x1640ce,_0x1ad94f,_0xbd90b7){_0x1ad94f=_0x1ad94f||0x1f4;return function(_0x56e046){logger[_0x847a('0x7')](_0x847a('0x8'),_0xbd90b7,_0x1ad94f,util[_0x847a('0x9')](_0x56e046,{'showHidden':![],'depth':null}));delete _0x56e046[_0x847a('0xa')];_0x1640ce[_0x847a('0xb')](_0x1ad94f)[_0x847a('0xc')](_0x56e046);};}exports[_0x847a('0xd')]=function(_0x5034b7,_0x14d907){return info[_0x847a('0xe')]()[_0x847a('0xf')](function(_0x5a2999){return _0x14d907[_0x847a('0xb')](0xc8)[_0x847a('0x10')](_0x5a2999);})[_0x847a('0x11')](function(_0x150b5c){return _0x14d907[_0x847a('0xb')](0x1f4)[_0x847a('0x10')](_0x150b5c);});};exports[_0x847a('0x12')]=function(_0x55c547,_0x2f21b3){var _0x11877b=[_0x847a('0x13')];return new BPromise(function(_0x13d2c5,_0x133590){return exec(util[_0x847a('0x14')](_0x847a('0x15'),_0x55c547['params']['pid']),function(_0x5ecc85,_0x31720a,_0x2bdcff){if(_0x5ecc85){return _0x133590(_0x5ecc85);}return _0x13d2c5(_0x31720a);});})['then'](function(_0x1ca617){var _0x3d5a39=![];var _0x181dfa=_0x1ca617[_0x847a('0x16')](/\n/);for(var _0x2ed5f9=0x0,_0x2455ff=_0x11877b[_0x847a('0x17')];_0x2ed5f9<_0x2455ff,_0x3d5a39===![];_0x2ed5f9+=0x1){if(_0x1ca617[_0x847a('0x18')](_0x11877b[_0x2ed5f9])>=0x0){_0x3d5a39=!![];}}if(!_0x3d5a39){throw new Error(util['format'](_0x847a('0x19'),_0x55c547[_0x847a('0x1a')]['pid']));}process[_0x847a('0x1b')](_0x55c547[_0x847a('0x1a')][_0x847a('0x1c')],_0x847a('0x1d'));return _0x2f21b3[_0x847a('0xb')](0xc8)['json']({'message':util[_0x847a('0x14')](_0x847a('0x1e'),_0x55c547[_0x847a('0x1a')][_0x847a('0x1c')])});})[_0x847a('0x11')](handleError(_0x2f21b3,null,_0x847a('0x12')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index be86288..a337a48 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 _0x55e0=['util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55e0,0xdc));var _0x055e=function(_0x43071a,_0x3602bc){_0x43071a=_0x43071a-0x0;var _0x236389=_0x55e0[_0x43071a];return _0x236389;};'use strict';var multer=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var path=require(_0x055e('0x2'));var timeout=require(_0x055e('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x055e('0x4'));var interaction=require(_0x055e('0x5'));var config=require(_0x055e('0x6'));var controller=require(_0x055e('0x7'));router[_0x055e('0x8')]('/',auth[_0x055e('0x9')](),controller['index']);router['get'](_0x055e('0xa'),auth['isAuthenticated'](),controller[_0x055e('0xb')]);router[_0x055e('0xc')]('/',auth[_0x055e('0x9')](),controller[_0x055e('0xd')]);router[_0x055e('0xe')]('/:id',auth[_0x055e('0x9')](),controller[_0x055e('0xf')]);router[_0x055e('0x10')](_0x055e('0xa'),auth[_0x055e('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x153f=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x481ffc,_0x4acb82){var _0x51d09a=function(_0x2d73e0){while(--_0x2d73e0){_0x481ffc['push'](_0x481ffc['shift']());}};_0x51d09a(++_0x4acb82);}(_0x153f,0x15b));var _0xf153=function(_0x5a3bf0,_0x40f342){_0x5a3bf0=_0x5a3bf0-0x0;var _0x1edd43=_0x153f[_0x5a3bf0];return _0x1edd43;};'use strict';var multer=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var path=require(_0xf153('0x2'));var timeout=require(_0xf153('0x3'));var express=require(_0xf153('0x4'));var router=express[_0xf153('0x5')]();var auth=require(_0xf153('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf153('0x7'));var controller=require('./tag.controller');router[_0xf153('0x8')]('/',auth[_0xf153('0x9')](),controller[_0xf153('0xa')]);router[_0xf153('0x8')](_0xf153('0xb'),auth['isAuthenticated'](),controller[_0xf153('0xc')]);router[_0xf153('0xd')]('/',auth[_0xf153('0x9')](),controller[_0xf153('0xe')]);router[_0xf153('0xf')](_0xf153('0xb'),auth[_0xf153('0x9')](),controller[_0xf153('0x10')]);router[_0xf153('0x11')](_0xf153('0xb'),auth['isAuthenticated'](),controller[_0xf153('0x12')]);module[_0xf153('0x13')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index c38548c..10c9544 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 _0xd7d1=['sequelize','exports','STRING','name','#0091EA'];(function(_0x75aecb,_0x3007da){var _0x240b42=function(_0x4d1729){while(--_0x4d1729){_0x75aecb['push'](_0x75aecb['shift']());}};_0x240b42(++_0x3007da);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x2cf5c5,_0x3e3532){_0x2cf5c5=_0x2cf5c5-0x0;var _0x1b0389=_0xd7d1[_0x2cf5c5];return _0x1b0389;};'use strict';var Sequelize=require(_0x1d7d('0x0'));module[_0x1d7d('0x1')]={'name':{'type':Sequelize[_0x1d7d('0x2')],'unique':_0x1d7d('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x1d7d('0x2')],'defaultValue':_0x1d7d('0x4')},'description':{'type':Sequelize[_0x1d7d('0x2')]}}; \ No newline at end of file +var _0x087b=['sequelize','exports','STRING'];(function(_0x1da4a6,_0x2a1ccb){var _0x58a9a1=function(_0xc64bb7){while(--_0xc64bb7){_0x1da4a6['push'](_0x1da4a6['shift']());}};_0x58a9a1(++_0x2a1ccb);}(_0x087b,0x11a));var _0xb087=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x087b[_0x4a3898];return _0x25ceb0;};'use strict';var Sequelize=require(_0xb087('0x0'));module[_0xb087('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xb087('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xb087('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 5174f1f..1013606 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 _0xbc44=['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','../../config/utils','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','update','destroy','then','Tags','UserProfileResource','sendStatus','error','stack','name','send','index','Tag','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','user','get','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','request-promise','moment','mustache'];(function(_0xdda192,_0x333354){var _0x4b320a=function(_0x2587bd){while(--_0x2587bd){_0xdda192['push'](_0xdda192['shift']());}};_0x4b320a(++_0x333354);}(_0xbc44,0x142));var _0x4bc4=function(_0x4bb0d4,_0x52c88f){_0x4bb0d4=_0x4bb0d4-0x0;var _0x3fd954=_0xbc44[_0x4bb0d4];return _0x3fd954;};'use strict';var pdf=require(_0x4bc4('0x0'));var emlformat=require(_0x4bc4('0x1'));var rimraf=require(_0x4bc4('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4bc4('0x3'));var moment=require(_0x4bc4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4bc4('0x5'));var util=require(_0x4bc4('0x6'));var path=require(_0x4bc4('0x7'));var sox=require('sox');var csv=require(_0x4bc4('0x8'));var ejs=require(_0x4bc4('0x9'));var fs=require('fs');var _=require(_0x4bc4('0xa'));var squel=require(_0x4bc4('0xb'));var crypto=require(_0x4bc4('0xc'));var jsforce=require(_0x4bc4('0xd'));var deskjs=require(_0x4bc4('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4bc4('0xf'));var Papa=require(_0x4bc4('0x10'));var Redis=require(_0x4bc4('0x11'));var authService=require(_0x4bc4('0x12'));var qs=require(_0x4bc4('0x13'));var as=require(_0x4bc4('0x14'));var hardwareService=require(_0x4bc4('0x15'));var logger=require(_0x4bc4('0x16'))('api');var utils=require(_0x4bc4('0x17'));var config=require('../../config/environment');var db=require(_0x4bc4('0x18'))['db'];function respondWithStatusCode(_0x4a57c5,_0x4a1ead){_0x4a1ead=_0x4a1ead||0xcc;return function(_0x2c0bdd){if(_0x2c0bdd){return _0x4a57c5['sendStatus'](_0x4a1ead);}return _0x4a57c5['status'](_0x4a1ead)[_0x4bc4('0x19')]();};}function respondWithResult(_0x81a083,_0x45e776){_0x45e776=_0x45e776||0xc8;return function(_0x97573){if(_0x97573){return _0x81a083[_0x4bc4('0x1a')](_0x45e776)[_0x4bc4('0x1b')](_0x97573);}};}function respondWithFilteredResult(_0x2f72ae,_0x4eb8e0){return function(_0x47eb1f){if(_0x47eb1f){var _0x3ea840=_0x47eb1f[_0x4bc4('0x1c')],_0x67cfac=_0x4eb8e0[_0x4bc4('0x1d')],_0x3f2db8=_0x4eb8e0[_0x4bc4('0x1d')]+_0x4eb8e0[_0x4bc4('0x1e')],_0x13b6e0;if(_0x3f2db8>=_0x3ea840){_0x3f2db8=_0x3ea840;_0x13b6e0=0xc8;}else{_0x13b6e0=0xce;}_0x2f72ae[_0x4bc4('0x1a')](_0x13b6e0);return _0x2f72ae[_0x4bc4('0x1f')](_0x4bc4('0x20'),_0x67cfac+'-'+_0x3f2db8+'/'+_0x3ea840)[_0x4bc4('0x1b')](_0x47eb1f);}return null;};}function patchUpdates(_0x205256){return function(_0x167b17){try{jsonpatch['apply'](_0x167b17,_0x205256,!![]);}catch(_0x22c651){return BPromise['reject'](_0x22c651);}return _0x167b17['save']();};}function saveUpdates(_0x3211d7,_0x34b7c6){return function(_0x40dfe8){if(_0x40dfe8){return _0x40dfe8[_0x4bc4('0x21')](_0x3211d7)['then'](function(_0x1ed860){return _0x1ed860;});}return null;};}function removeEntity(_0x33f208,_0x8b4f96){return function(_0x45a284){if(_0x45a284){return _0x45a284[_0x4bc4('0x22')]()[_0x4bc4('0x23')](function(){var _0x4daf9b=_0x45a284['get']({'plain':!![]});var _0x526beb=_0x4bc4('0x24');return db[_0x4bc4('0x25')][_0x4bc4('0x22')]({'where':{'type':_0x526beb,'resourceId':_0x4daf9b['id']}})[_0x4bc4('0x23')](function(){return _0x45a284;});})[_0x4bc4('0x23')](function(){_0x33f208['status'](0xcc)[_0x4bc4('0x19')]();});}};}function handleEntityNotFound(_0x2e292e,_0x326b82){return function(_0x449fdf){if(!_0x449fdf){_0x2e292e[_0x4bc4('0x26')](0x194);}return _0x449fdf;};}function handleError(_0x2aa61e,_0x203e9f){_0x203e9f=_0x203e9f||0x1f4;return function(_0x44aaf9){logger[_0x4bc4('0x27')](_0x44aaf9[_0x4bc4('0x28')]);if(_0x44aaf9[_0x4bc4('0x29')]){delete _0x44aaf9[_0x4bc4('0x29')];}_0x2aa61e['status'](_0x203e9f)[_0x4bc4('0x2a')](_0x44aaf9);};}exports[_0x4bc4('0x2b')]=function(_0x530520,_0x12596a){var _0x21a879={},_0xb7d7a1={},_0x207bef={'count':0x0,'rows':[]};var _0x72b6f0=_['map'](db[_0x4bc4('0x2c')][_0x4bc4('0x2d')],function(_0x59999f){return{'name':_0x59999f[_0x4bc4('0x2e')],'type':_0x59999f[_0x4bc4('0x2f')][_0x4bc4('0x30')]};});_0xb7d7a1[_0x4bc4('0x31')]=_[_0x4bc4('0x32')](_0x72b6f0,_0x4bc4('0x29'));_0xb7d7a1['query']=_[_0x4bc4('0x33')](_0x530520[_0x4bc4('0x34')]);_0xb7d7a1[_0x4bc4('0x35')]=_[_0x4bc4('0x36')](_0xb7d7a1[_0x4bc4('0x31')],_0xb7d7a1[_0x4bc4('0x34')]);_0x21a879['attributes']=_[_0x4bc4('0x36')](_0xb7d7a1[_0x4bc4('0x31')],qs[_0x4bc4('0x37')](_0x530520[_0x4bc4('0x34')][_0x4bc4('0x37')]));_0x21a879[_0x4bc4('0x38')]=_0x21a879[_0x4bc4('0x38')]['length']?_0x21a879[_0x4bc4('0x38')]:_0xb7d7a1[_0x4bc4('0x31')];if(!_0x530520[_0x4bc4('0x34')][_0x4bc4('0x39')](_0x4bc4('0x3a'))){_0x21a879[_0x4bc4('0x1e')]=qs['limit'](_0x530520[_0x4bc4('0x34')][_0x4bc4('0x1e')]);_0x21a879[_0x4bc4('0x1d')]=qs[_0x4bc4('0x1d')](_0x530520[_0x4bc4('0x34')][_0x4bc4('0x1d')]);}_0x21a879['order']=qs['sort'](_0x530520[_0x4bc4('0x34')]['sort']);_0x21a879[_0x4bc4('0x3b')]=qs[_0x4bc4('0x35')](_['pick'](_0x530520['query'],_0xb7d7a1[_0x4bc4('0x35')]));if(_0x530520[_0x4bc4('0x34')][_0x4bc4('0x3c')]){_0x21a879[_0x4bc4('0x3b')]=_[_0x4bc4('0x3d')](_0x21a879[_0x4bc4('0x3b')],{'$or':_[_0x4bc4('0x32')](_0x72b6f0,function(_0x3f70a5){if(_0x3f70a5[_0x4bc4('0x2f')]!==_0x4bc4('0x3e')){var _0x212a81={};_0x212a81[_0x3f70a5[_0x4bc4('0x29')]]={'$like':'%'+_0x530520['query'][_0x4bc4('0x3c')]+'%'};return _0x212a81;}})});}_0x21a879=_['merge']({},_0x21a879,_0x530520[_0x4bc4('0x3f')]);var _0x3ff5eb={'where':_0x21a879[_0x4bc4('0x3b')]};return db[_0x4bc4('0x2c')]['count'](_0x3ff5eb)['then'](function(_0xbb03f4){_0x207bef[_0x4bc4('0x1c')]=_0xbb03f4;if(_0x530520['query'][_0x4bc4('0x40')]){_0x21a879[_0x4bc4('0x41')]=[{'all':!![]}];}return db[_0x4bc4('0x2c')][_0x4bc4('0x42')](_0x21a879);})[_0x4bc4('0x23')](function(_0x5b717f){_0x207bef[_0x4bc4('0x43')]=_0x5b717f;return _0x207bef;})['then'](respondWithFilteredResult(_0x12596a,_0x21a879))[_0x4bc4('0x44')](handleError(_0x12596a,null));};exports['show']=function(_0x19dd58,_0x5f5c84){var _0x519e7e={'raw':!![],'where':{'id':_0x19dd58[_0x4bc4('0x45')]['id']}},_0x5b5674={};_0x5b5674[_0x4bc4('0x31')]=_[_0x4bc4('0x33')](db[_0x4bc4('0x2c')]['rawAttributes']);_0x5b5674[_0x4bc4('0x34')]=_[_0x4bc4('0x33')](_0x19dd58[_0x4bc4('0x34')]);_0x5b5674[_0x4bc4('0x35')]=_[_0x4bc4('0x36')](_0x5b5674[_0x4bc4('0x31')],_0x5b5674[_0x4bc4('0x34')]);_0x519e7e[_0x4bc4('0x38')]=_[_0x4bc4('0x36')](_0x5b5674['model'],qs[_0x4bc4('0x37')](_0x19dd58['query']['fields']));_0x519e7e[_0x4bc4('0x38')]=_0x519e7e[_0x4bc4('0x38')][_0x4bc4('0x46')]?_0x519e7e['attributes']:_0x5b5674['model'];if(_0x19dd58[_0x4bc4('0x34')][_0x4bc4('0x40')]){_0x519e7e['include']=[{'all':!![]}];}_0x519e7e=_['merge']({},_0x519e7e,_0x19dd58[_0x4bc4('0x3f')]);return db[_0x4bc4('0x2c')][_0x4bc4('0x47')](_0x519e7e)[_0x4bc4('0x23')](handleEntityNotFound(_0x5f5c84,null))['then'](respondWithResult(_0x5f5c84,null))['catch'](handleError(_0x5f5c84,null));};exports[_0x4bc4('0x48')]=function(_0x4686a7,_0x5f1504){return db[_0x4bc4('0x2c')][_0x4bc4('0x48')](_0x4686a7[_0x4bc4('0x49')],{})['then'](function(_0x4f1fb6){var _0x4f2cb1=_0x4686a7[_0x4bc4('0x4a')][_0x4bc4('0x4b')]({'plain':!![]});if(!_0x4f2cb1)throw new Error(_0x4bc4('0x4c'));if(_0x4f2cb1[_0x4bc4('0x4d')]===_0x4bc4('0x4a')){var _0x5ab523=_0x4f1fb6[_0x4bc4('0x4b')]({'plain':!![]});var _0x544cfc=_0x4bc4('0x24');return db[_0x4bc4('0x4e')]['find']({'where':{'name':_0x544cfc,'userProfileId':_0x4f2cb1[_0x4bc4('0x4f')]},'raw':!![]})[_0x4bc4('0x23')](function(_0x39939f){if(_0x39939f&&_0x39939f[_0x4bc4('0x50')]===0x0){return db[_0x4bc4('0x25')][_0x4bc4('0x48')]({'name':_0x5ab523[_0x4bc4('0x29')],'resourceId':_0x5ab523['id'],'type':_0x39939f['name'],'sectionId':_0x39939f['id']},{})[_0x4bc4('0x23')](function(){return _0x4f1fb6;});}else{return _0x4f1fb6;}})[_0x4bc4('0x44')](function(_0x399133){logger[_0x4bc4('0x27')](_0x4bc4('0x51'),_0x399133);throw _0x399133;});}return _0x4f1fb6;})[_0x4bc4('0x23')](respondWithResult(_0x5f1504,0xc9))[_0x4bc4('0x44')](handleError(_0x5f1504,null));};exports[_0x4bc4('0x21')]=function(_0x4f45a1,_0x309e60){if(_0x4f45a1['body']['id']){delete _0x4f45a1['body']['id'];}return db['Tag'][_0x4bc4('0x47')]({'where':{'id':_0x4f45a1[_0x4bc4('0x45')]['id']}})[_0x4bc4('0x23')](handleEntityNotFound(_0x309e60,null))[_0x4bc4('0x23')](saveUpdates(_0x4f45a1[_0x4bc4('0x49')],null))[_0x4bc4('0x23')](respondWithResult(_0x309e60,null))['catch'](handleError(_0x309e60,null));};exports[_0x4bc4('0x22')]=function(_0x157257,_0x11025a){return db[_0x4bc4('0x2c')][_0x4bc4('0x47')]({'where':{'id':_0x157257[_0x4bc4('0x45')]['id']}})[_0x4bc4('0x23')](handleEntityNotFound(_0x11025a,null))[_0x4bc4('0x23')](removeEntity(_0x11025a,null))['catch'](handleError(_0x11025a,null));}; \ No newline at end of file +var _0xd7ef=['rows','params','fields','find','catch','create','body','role','user','get','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','then','Tags','UserProfileResource','destroy','end','name','send','index','map','Tag','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd7ef,0xa5));var _0xfd7e=function(_0x5ee169,_0x27e270){_0x5ee169=_0x5ee169-0x0;var _0x257d72=_0xd7ef[_0x5ee169];return _0x257d72;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfd7e('0x0'));var rimraf=require(_0xfd7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfd7e('0x2'));var moment=require('moment');var BPromise=require(_0xfd7e('0x3'));var Mustache=require(_0xfd7e('0x4'));var util=require(_0xfd7e('0x5'));var path=require(_0xfd7e('0x6'));var sox=require('sox');var csv=require(_0xfd7e('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfd7e('0x8'));var squel=require(_0xfd7e('0x9'));var crypto=require(_0xfd7e('0xa'));var jsforce=require(_0xfd7e('0xb'));var deskjs=require(_0xfd7e('0xc'));var toCsv=require(_0xfd7e('0x7'));var querystring=require('querystring');var Papa=require(_0xfd7e('0xd'));var Redis=require(_0xfd7e('0xe'));var authService=require(_0xfd7e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfd7e('0x10'));var hardwareService=require(_0xfd7e('0x11'));var logger=require(_0xfd7e('0x12'))(_0xfd7e('0x13'));var utils=require(_0xfd7e('0x14'));var config=require(_0xfd7e('0x15'));var db=require(_0xfd7e('0x16'))['db'];function respondWithStatusCode(_0x12d15a,_0x1ca699){_0x1ca699=_0x1ca699||0xcc;return function(_0x59e687){if(_0x59e687){return _0x12d15a[_0xfd7e('0x17')](_0x1ca699);}return _0x12d15a[_0xfd7e('0x18')](_0x1ca699)['end']();};}function respondWithResult(_0x28dfab,_0x37e142){_0x37e142=_0x37e142||0xc8;return function(_0x2fbe41){if(_0x2fbe41){return _0x28dfab['status'](_0x37e142)[_0xfd7e('0x19')](_0x2fbe41);}};}function respondWithFilteredResult(_0x17f232,_0x305f86){return function(_0x3a8be6){if(_0x3a8be6){var _0x391fe5=_0x3a8be6[_0xfd7e('0x1a')],_0x390de1=_0x305f86['offset'],_0x28ca17=_0x305f86[_0xfd7e('0x1b')]+_0x305f86[_0xfd7e('0x1c')],_0x582dbd;if(_0x28ca17>=_0x391fe5){_0x28ca17=_0x391fe5;_0x582dbd=0xc8;}else{_0x582dbd=0xce;}_0x17f232[_0xfd7e('0x18')](_0x582dbd);return _0x17f232[_0xfd7e('0x1d')]('Content-Range',_0x390de1+'-'+_0x28ca17+'/'+_0x391fe5)['json'](_0x3a8be6);}return null;};}function patchUpdates(_0x15c50c){return function(_0x18d508){try{jsonpatch[_0xfd7e('0x1e')](_0x18d508,_0x15c50c,!![]);}catch(_0xa88774){return BPromise[_0xfd7e('0x1f')](_0xa88774);}return _0x18d508[_0xfd7e('0x20')]();};}function saveUpdates(_0x255a88,_0x526866){return function(_0x3e873c){if(_0x3e873c){return _0x3e873c['update'](_0x255a88)['then'](function(_0x17781a){return _0x17781a;});}return null;};}function removeEntity(_0x5ee5eb,_0x559f59){return function(_0x560bf1){if(_0x560bf1){return _0x560bf1['destroy']()[_0xfd7e('0x21')](function(){var _0x1e6ebf=_0x560bf1['get']({'plain':!![]});var _0x159231=_0xfd7e('0x22');return db[_0xfd7e('0x23')][_0xfd7e('0x24')]({'where':{'type':_0x159231,'resourceId':_0x1e6ebf['id']}})[_0xfd7e('0x21')](function(){return _0x560bf1;});})[_0xfd7e('0x21')](function(){_0x5ee5eb[_0xfd7e('0x18')](0xcc)[_0xfd7e('0x25')]();});}};}function handleEntityNotFound(_0x44cbe3,_0x873190){return function(_0x16529e){if(!_0x16529e){_0x44cbe3[_0xfd7e('0x17')](0x194);}return _0x16529e;};}function handleError(_0x5784ec,_0x428def){_0x428def=_0x428def||0x1f4;return function(_0x256cf0){logger['error'](_0x256cf0['stack']);if(_0x256cf0[_0xfd7e('0x26')]){delete _0x256cf0[_0xfd7e('0x26')];}_0x5784ec[_0xfd7e('0x18')](_0x428def)[_0xfd7e('0x27')](_0x256cf0);};}exports[_0xfd7e('0x28')]=function(_0x4021b6,_0x23cd37){var _0x50e855={},_0x47592f={},_0x5185e4={'count':0x0,'rows':[]};var _0x55aca2=_[_0xfd7e('0x29')](db[_0xfd7e('0x2a')][_0xfd7e('0x2b')],function(_0x15a143){return{'name':_0x15a143['fieldName'],'type':_0x15a143[_0xfd7e('0x2c')][_0xfd7e('0x2d')]};});_0x47592f[_0xfd7e('0x2e')]=_[_0xfd7e('0x29')](_0x55aca2,'name');_0x47592f[_0xfd7e('0x2f')]=_[_0xfd7e('0x30')](_0x4021b6[_0xfd7e('0x2f')]);_0x47592f[_0xfd7e('0x31')]=_[_0xfd7e('0x32')](_0x47592f[_0xfd7e('0x2e')],_0x47592f[_0xfd7e('0x2f')]);_0x50e855[_0xfd7e('0x33')]=_['intersection'](_0x47592f[_0xfd7e('0x2e')],qs['fields'](_0x4021b6[_0xfd7e('0x2f')]['fields']));_0x50e855[_0xfd7e('0x33')]=_0x50e855[_0xfd7e('0x33')][_0xfd7e('0x34')]?_0x50e855[_0xfd7e('0x33')]:_0x47592f[_0xfd7e('0x2e')];if(!_0x4021b6['query'][_0xfd7e('0x35')](_0xfd7e('0x36'))){_0x50e855['limit']=qs[_0xfd7e('0x1c')](_0x4021b6[_0xfd7e('0x2f')]['limit']);_0x50e855[_0xfd7e('0x1b')]=qs[_0xfd7e('0x1b')](_0x4021b6[_0xfd7e('0x2f')][_0xfd7e('0x1b')]);}_0x50e855[_0xfd7e('0x37')]=qs[_0xfd7e('0x38')](_0x4021b6[_0xfd7e('0x2f')]['sort']);_0x50e855[_0xfd7e('0x39')]=qs['filters'](_['pick'](_0x4021b6[_0xfd7e('0x2f')],_0x47592f[_0xfd7e('0x31')]));if(_0x4021b6['query'][_0xfd7e('0x3a')]){_0x50e855[_0xfd7e('0x39')]=_['merge'](_0x50e855[_0xfd7e('0x39')],{'$or':_['map'](_0x55aca2,function(_0x2233e4){if(_0x2233e4[_0xfd7e('0x2c')]!==_0xfd7e('0x3b')){var _0x5c1ba6={};_0x5c1ba6[_0x2233e4[_0xfd7e('0x26')]]={'$like':'%'+_0x4021b6['query'][_0xfd7e('0x3a')]+'%'};return _0x5c1ba6;}})});}_0x50e855=_[_0xfd7e('0x3c')]({},_0x50e855,_0x4021b6[_0xfd7e('0x3d')]);var _0x117847={'where':_0x50e855[_0xfd7e('0x39')]};return db[_0xfd7e('0x2a')][_0xfd7e('0x1a')](_0x117847)[_0xfd7e('0x21')](function(_0x35d4e3){_0x5185e4[_0xfd7e('0x1a')]=_0x35d4e3;if(_0x4021b6[_0xfd7e('0x2f')]['includeAll']){_0x50e855[_0xfd7e('0x3e')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x50e855);})[_0xfd7e('0x21')](function(_0x27342d){_0x5185e4[_0xfd7e('0x3f')]=_0x27342d;return _0x5185e4;})[_0xfd7e('0x21')](respondWithFilteredResult(_0x23cd37,_0x50e855))['catch'](handleError(_0x23cd37,null));};exports['show']=function(_0x5b4fcd,_0x56a5d8){var _0xaedc2c={'raw':!![],'where':{'id':_0x5b4fcd[_0xfd7e('0x40')]['id']}},_0x16bbac={};_0x16bbac[_0xfd7e('0x2e')]=_[_0xfd7e('0x30')](db[_0xfd7e('0x2a')][_0xfd7e('0x2b')]);_0x16bbac[_0xfd7e('0x2f')]=_[_0xfd7e('0x30')](_0x5b4fcd[_0xfd7e('0x2f')]);_0x16bbac[_0xfd7e('0x31')]=_[_0xfd7e('0x32')](_0x16bbac[_0xfd7e('0x2e')],_0x16bbac['query']);_0xaedc2c[_0xfd7e('0x33')]=_['intersection'](_0x16bbac[_0xfd7e('0x2e')],qs[_0xfd7e('0x41')](_0x5b4fcd[_0xfd7e('0x2f')][_0xfd7e('0x41')]));_0xaedc2c[_0xfd7e('0x33')]=_0xaedc2c[_0xfd7e('0x33')]['length']?_0xaedc2c[_0xfd7e('0x33')]:_0x16bbac[_0xfd7e('0x2e')];if(_0x5b4fcd[_0xfd7e('0x2f')]['includeAll']){_0xaedc2c[_0xfd7e('0x3e')]=[{'all':!![]}];}_0xaedc2c=_['merge']({},_0xaedc2c,_0x5b4fcd['options']);return db[_0xfd7e('0x2a')][_0xfd7e('0x42')](_0xaedc2c)[_0xfd7e('0x21')](handleEntityNotFound(_0x56a5d8,null))[_0xfd7e('0x21')](respondWithResult(_0x56a5d8,null))[_0xfd7e('0x43')](handleError(_0x56a5d8,null));};exports['create']=function(_0x123c99,_0x21792a){return db[_0xfd7e('0x2a')][_0xfd7e('0x44')](_0x123c99[_0xfd7e('0x45')],{})[_0xfd7e('0x21')](function(_0xbcd40d){var _0x4bc1c6=_0x123c99['user']['get']({'plain':!![]});if(!_0x4bc1c6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4bc1c6[_0xfd7e('0x46')]===_0xfd7e('0x47')){var _0x258311=_0xbcd40d[_0xfd7e('0x48')]({'plain':!![]});var _0xf6c7be=_0xfd7e('0x22');return db[_0xfd7e('0x49')][_0xfd7e('0x42')]({'where':{'name':_0xf6c7be,'userProfileId':_0x4bc1c6[_0xfd7e('0x4a')]},'raw':!![]})[_0xfd7e('0x21')](function(_0x228ee5){if(_0x228ee5&&_0x228ee5[_0xfd7e('0x4b')]===0x0){return db[_0xfd7e('0x23')][_0xfd7e('0x44')]({'name':_0x258311[_0xfd7e('0x26')],'resourceId':_0x258311['id'],'type':_0x228ee5['name'],'sectionId':_0x228ee5['id']},{})['then'](function(){return _0xbcd40d;});}else{return _0xbcd40d;}})[_0xfd7e('0x43')](function(_0x4ec2aa){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ec2aa);throw _0x4ec2aa;});}return _0xbcd40d;})[_0xfd7e('0x21')](respondWithResult(_0x21792a,0xc9))[_0xfd7e('0x43')](handleError(_0x21792a,null));};exports['update']=function(_0x4396ec,_0x126161){if(_0x4396ec[_0xfd7e('0x45')]['id']){delete _0x4396ec['body']['id'];}return db['Tag'][_0xfd7e('0x42')]({'where':{'id':_0x4396ec[_0xfd7e('0x40')]['id']}})['then'](handleEntityNotFound(_0x126161,null))['then'](saveUpdates(_0x4396ec[_0xfd7e('0x45')],null))['then'](respondWithResult(_0x126161,null))['catch'](handleError(_0x126161,null));};exports[_0xfd7e('0x24')]=function(_0x22e801,_0x1e8ca2){return db['Tag'][_0xfd7e('0x42')]({'where':{'id':_0x22e801['params']['id']}})[_0xfd7e('0x21')](handleEntityNotFound(_0x1e8ca2,null))[_0xfd7e('0x21')](removeEntity(_0x1e8ca2,null))['catch'](handleError(_0x1e8ca2,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 865f2c0..33f99e1 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 _0x34ed=['define','tools_tags','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./tag.attributes','exports'];(function(_0x2ae11f,_0x5af16d){var _0x3b3b15=function(_0x38c667){while(--_0x38c667){_0x2ae11f['push'](_0x2ae11f['shift']());}};_0x3b3b15(++_0x5af16d);}(_0x34ed,0x124));var _0xd34e=function(_0x3a9083,_0x3c9f8d){_0x3a9083=_0x3a9083-0x0;var _0x160306=_0x34ed[_0x3a9083];return _0x160306;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd34e('0x0'))(_0xd34e('0x1'));var moment=require(_0xd34e('0x2'));var BPromise=require(_0xd34e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd34e('0x4'));var config=require(_0xd34e('0x5'));var attributes=require(_0xd34e('0x6'));module[_0xd34e('0x7')]=function(_0x578370,_0x15ea2c){return _0x578370[_0xd34e('0x8')]('Tag',attributes,{'tableName':_0xd34e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3eae=['rimraf','../../config/environment','./tag.attributes','define','Tag','tools_tags','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x20dfa8,_0x3189ef){var _0x58ea54=function(_0xeec6fa){while(--_0xeec6fa){_0x20dfa8['push'](_0x20dfa8['shift']());}};_0x58ea54(++_0x3189ef);}(_0x3eae,0x126));var _0xe3ea=function(_0x57014b,_0x360c0f){_0x57014b=_0x57014b-0x0;var _0x2b258a=_0x3eae[_0x57014b];return _0x2b258a;};'use strict';var _=require(_0xe3ea('0x0'));var util=require(_0xe3ea('0x1'));var logger=require(_0xe3ea('0x2'))(_0xe3ea('0x3'));var moment=require('moment');var BPromise=require(_0xe3ea('0x4'));var rp=require(_0xe3ea('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe3ea('0x6'));var config=require(_0xe3ea('0x7'));var attributes=require(_0xe3ea('0x8'));module['exports']=function(_0x20b837,_0x345ccd){return _0x20b837[_0xe3ea('0x9')](_0xe3ea('0xa'),attributes,{'tableName':_0xe3ea('0xb'),'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 f692a00..54204ef 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 _0x4ea3=['Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x4ea3,0x70));var _0x34ea=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x4ea3[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var moment=require(_0x34ea('0x2'));var BPromise=require(_0x34ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x34ea('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x34ea('0x6'));var jayson=require(_0x34ea('0x7'));var client=jayson[_0x34ea('0x8')][_0x34ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40434e,_0x18b461,_0x22b09e){return new BPromise(function(_0x5bec7c,_0x341727){return client[_0x34ea('0xa')](_0x40434e,_0x22b09e)[_0x34ea('0xb')](function(_0x5132c4){logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,'request\x20sent');logger['debug'](_0x34ea('0xe'),_0x18b461,_0x34ea('0xf'),JSON[_0x34ea('0x10')](_0x5132c4));if(_0x5132c4['error']){if(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x12')]===0x1f4){logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);return _0x341727(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')]['message']);return _0x5bec7c(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}else{logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,_0x34ea('0xf'));_0x5bec7c(_0x5132c4['result'][_0x34ea('0x13')]);}})[_0x34ea('0x14')](function(_0x3fa3b0){logger[_0x34ea('0x11')]('Tag,\x20%s,\x20%s',_0x18b461,_0x3fa3b0);_0x341727(_0x3fa3b0);});});} \ No newline at end of file +var _0x1d2d=['lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x3003e3,_0x348f0c){var _0x5a550a=function(_0x321680){while(--_0x321680){_0x3003e3['push'](_0x3003e3['shift']());}};_0x5a550a(++_0x348f0c);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x5c0711,_0x41ad27){_0x5c0711=_0x5c0711-0x0;var _0x34e53d=_0x1d2d[_0x5c0711];return _0x34e53d;};'use strict';var _=require(_0xd1d2('0x0'));var util=require(_0xd1d2('0x1'));var moment=require(_0xd1d2('0x2'));var BPromise=require(_0xd1d2('0x3'));var rs=require(_0xd1d2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd1d2('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd1d2('0x6'));var config=require(_0xd1d2('0x7'));var jayson=require(_0xd1d2('0x8'));var client=jayson[_0xd1d2('0x9')][_0xd1d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x353dbd,_0x55be7a,_0x1eaf41){return new BPromise(function(_0x21bc28,_0x35735f){return client[_0xd1d2('0xb')](_0x353dbd,_0x1eaf41)[_0xd1d2('0xc')](function(_0x59e484){logger[_0xd1d2('0xd')](_0xd1d2('0xe'),_0x55be7a,_0xd1d2('0xf'));logger[_0xd1d2('0x10')](_0xd1d2('0x11'),_0x55be7a,_0xd1d2('0xf'),JSON[_0xd1d2('0x12')](_0x59e484));if(_0x59e484['error']){if(_0x59e484[_0xd1d2('0x13')][_0xd1d2('0x14')]===0x1f4){logger[_0xd1d2('0x13')](_0xd1d2('0xe'),_0x55be7a,_0x59e484[_0xd1d2('0x13')][_0xd1d2('0x15')]);return _0x35735f(_0x59e484[_0xd1d2('0x13')][_0xd1d2('0x15')]);}logger[_0xd1d2('0x13')](_0xd1d2('0xe'),_0x55be7a,_0x59e484['error'][_0xd1d2('0x15')]);return _0x21bc28(_0x59e484[_0xd1d2('0x13')][_0xd1d2('0x15')]);}else{logger['info'](_0xd1d2('0xe'),_0x55be7a,_0xd1d2('0xf'));_0x21bc28(_0x59e484[_0xd1d2('0x16')][_0xd1d2('0x15')]);}})[_0xd1d2('0x17')](function(_0x2723b3){logger[_0xd1d2('0x13')]('Tag,\x20%s,\x20%s',_0x55be7a,_0x2723b3);_0x35735f(_0x2723b3);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index a7075fd..bc33496 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 _0x7b78=['/:id','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','isAuthenticated','get','show','/:id/queues','getQueues','/:id/users','getAgents','post','create','addQueues','addAgents','update','delete'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7b78,0xe9));var _0x87b7=function(_0xc8a97,_0xbedd75){_0xc8a97=_0xc8a97-0x0;var _0x192611=_0x7b78[_0xc8a97];return _0x192611;};'use strict';var multer=require(_0x87b7('0x0'));var util=require(_0x87b7('0x1'));var path=require(_0x87b7('0x2'));var timeout=require(_0x87b7('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x87b7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x87b7('0x5'));var controller=require('./team.controller');router['get']('/',auth[_0x87b7('0x6')](),controller['index']);router[_0x87b7('0x7')]('/:id',auth[_0x87b7('0x6')](),controller[_0x87b7('0x8')]);router['get'](_0x87b7('0x9'),auth[_0x87b7('0x6')](),controller[_0x87b7('0xa')]);router[_0x87b7('0x7')](_0x87b7('0xb'),auth[_0x87b7('0x6')](),controller[_0x87b7('0xc')]);router[_0x87b7('0xd')]('/',auth[_0x87b7('0x6')](),controller[_0x87b7('0xe')]);router['post']('/:id/queues',auth[_0x87b7('0x6')](),controller[_0x87b7('0xf')]);router[_0x87b7('0xd')](_0x87b7('0xb'),auth['isAuthenticated'](),controller[_0x87b7('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x87b7('0x11')]);router[_0x87b7('0x12')](_0x87b7('0x13'),auth['isAuthenticated'](),controller[_0x87b7('0x14')]);router[_0x87b7('0x12')]('/:id/queues',auth['isAuthenticated'](),controller['removeQueues']);router[_0x87b7('0x12')](_0x87b7('0xb'),auth[_0x87b7('0x6')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x6902=['/:id/queues','getQueues','/:id/users','getAgents','post','create','addQueues','addAgents','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./team.controller','isAuthenticated','index','get','/:id'];(function(_0x17a032,_0x400f32){var _0xbe693a=function(_0x1cd98e){while(--_0x1cd98e){_0x17a032['push'](_0x17a032['shift']());}};_0xbe693a(++_0x400f32);}(_0x6902,0x179));var _0x2690=function(_0x4e4ad6,_0x358edb){_0x4e4ad6=_0x4e4ad6-0x0;var _0x1ac9f1=_0x6902[_0x4e4ad6];return _0x1ac9f1;};'use strict';var multer=require(_0x2690('0x0'));var util=require(_0x2690('0x1'));var path=require(_0x2690('0x2'));var timeout=require(_0x2690('0x3'));var express=require(_0x2690('0x4'));var router=express[_0x2690('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x2690('0x6'));var config=require(_0x2690('0x7'));var controller=require(_0x2690('0x8'));router['get']('/',auth[_0x2690('0x9')](),controller[_0x2690('0xa')]);router[_0x2690('0xb')](_0x2690('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2690('0xb')](_0x2690('0xd'),auth[_0x2690('0x9')](),controller[_0x2690('0xe')]);router[_0x2690('0xb')](_0x2690('0xf'),auth['isAuthenticated'](),controller[_0x2690('0x10')]);router[_0x2690('0x11')]('/',auth[_0x2690('0x9')](),controller[_0x2690('0x12')]);router[_0x2690('0x11')](_0x2690('0xd'),auth[_0x2690('0x9')](),controller[_0x2690('0x13')]);router[_0x2690('0x11')](_0x2690('0xf'),auth[_0x2690('0x9')](),controller[_0x2690('0x14')]);router['put'](_0x2690('0xc'),auth[_0x2690('0x9')](),controller[_0x2690('0x15')]);router[_0x2690('0x16')]('/:id',auth[_0x2690('0x9')](),controller[_0x2690('0x17')]);router[_0x2690('0x16')](_0x2690('0xd'),auth[_0x2690('0x9')](),controller['removeQueues']);router[_0x2690('0x16')](_0x2690('0xf'),auth['isAuthenticated'](),controller[_0x2690('0x18')]);module[_0x2690('0x19')]=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 88ffc0f..2a0cee2 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 _0x5650=['exports','STRING','name','sequelize'];(function(_0x18adde,_0x2c12a6){var _0x11a4d0=function(_0x2d530f){while(--_0x2d530f){_0x18adde['push'](_0x18adde['shift']());}};_0x11a4d0(++_0x2c12a6);}(_0x5650,0x193));var _0x0565=function(_0x5b6d2a,_0x2a4e3b){_0x5b6d2a=_0x5b6d2a-0x0;var _0x536640=_0x5650[_0x5b6d2a];return _0x536640;};'use strict';var Sequelize=require(_0x0565('0x0'));module[_0x0565('0x1')]={'name':{'type':Sequelize[_0x0565('0x2')],'allowNull':![],'unique':_0x0565('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdeb8=['STRING','name','sequelize'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xdeb8,0x1a3));var _0x8deb=function(_0x482cf6,_0x3f3174){_0x482cf6=_0x482cf6-0x0;var _0x45048e=_0xdeb8[_0x482cf6];return _0x45048e;};'use strict';var Sequelize=require(_0x8deb('0x0'));module['exports']={'name':{'type':Sequelize[_0x8deb('0x1')],'allowNull':![],'unique':_0x8deb('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 7a25f23..f55088e 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 _0x34bd=['model','query','keys','filters','attributes','intersection','fields','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','count','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','order','Queues','addQueues','isValidChannel','add','removeQueues','Sequelize','remove','ids','addAgents','Voice','Chat','Sms','Fax','Openchannel','each','User','online','voicePause','interface','upsert','isNil','format','SIP/%s','spread','length','emit','userTeam:save','voice','chat','mail','sms','fax','removeAgents','UserVoiceQueueRt','userTeam:remove','getAgents','hasOwnProperty','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./team.socket','status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','Teams','UserProfileResource','error','stack','name','send','map','Team','fieldName','type'];(function(_0x9069e,_0x108e36){var _0x2c7a9a=function(_0x206fc3){while(--_0x206fc3){_0x9069e['push'](_0x9069e['shift']());}};_0x2c7a9a(++_0x108e36);}(_0x34bd,0x1d2));var _0xd34b=function(_0x3e330a,_0x11bf04){_0x3e330a=_0x3e330a-0x0;var _0x451dee=_0x34bd[_0x3e330a];return _0x451dee;};'use strict';var pdf=require(_0xd34b('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd34b('0x1'));var jsonpatch=require(_0xd34b('0x2'));var rp=require(_0xd34b('0x3'));var moment=require(_0xd34b('0x4'));var BPromise=require(_0xd34b('0x5'));var Mustache=require(_0xd34b('0x6'));var util=require(_0xd34b('0x7'));var path=require('path');var sox=require(_0xd34b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd34b('0x9'));var crypto=require(_0xd34b('0xa'));var jsforce=require(_0xd34b('0xb'));var deskjs=require(_0xd34b('0xc'));var toCsv=require(_0xd34b('0xd'));var querystring=require(_0xd34b('0xe'));var Papa=require(_0xd34b('0xf'));var Redis=require(_0xd34b('0x10'));var authService=require(_0xd34b('0x11'));var qs=require(_0xd34b('0x12'));var as=require(_0xd34b('0x13'));var hardwareService=require(_0xd34b('0x14'));var logger=require('../../config/logger')(_0xd34b('0x15'));var utils=require('../../config/utils');var config=require(_0xd34b('0x16'));var db=require(_0xd34b('0x17'))['db'];config[_0xd34b('0x18')]=_[_0xd34b('0x19')](config[_0xd34b('0x18')],{'host':_0xd34b('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd34b('0x18')]));require(_0xd34b('0x1b'))['register'](socket);function respondWithStatusCode(_0x14e108,_0x2f4fe4){_0x2f4fe4=_0x2f4fe4||0xcc;return function(_0x1ebdc5){if(_0x1ebdc5){return _0x14e108['sendStatus'](_0x2f4fe4);}return _0x14e108[_0xd34b('0x1c')](_0x2f4fe4)[_0xd34b('0x1d')]();};}function respondWithResult(_0x5a46be,_0x3c74e2){_0x3c74e2=_0x3c74e2||0xc8;return function(_0x4ce87b){if(_0x4ce87b){return _0x5a46be[_0xd34b('0x1c')](_0x3c74e2)[_0xd34b('0x1e')](_0x4ce87b);}};}function respondWithFilteredResult(_0x2ace5a,_0x56ea27){return function(_0x152c8d){if(_0x152c8d){var _0x193965=_0x152c8d['count'],_0x1bbbb1=_0x56ea27['offset'],_0x105f67=_0x56ea27[_0xd34b('0x1f')]+_0x56ea27[_0xd34b('0x20')],_0x206f16;if(_0x105f67>=_0x193965){_0x105f67=_0x193965;_0x206f16=0xc8;}else{_0x206f16=0xce;}_0x2ace5a[_0xd34b('0x1c')](_0x206f16);return _0x2ace5a[_0xd34b('0x21')](_0xd34b('0x22'),_0x1bbbb1+'-'+_0x105f67+'/'+_0x193965)[_0xd34b('0x1e')](_0x152c8d);}return null;};}function patchUpdates(_0x4a3273){return function(_0xa8ffe5){try{jsonpatch[_0xd34b('0x23')](_0xa8ffe5,_0x4a3273,!![]);}catch(_0x1ae4ec){return BPromise[_0xd34b('0x24')](_0x1ae4ec);}return _0xa8ffe5['save']();};}function saveUpdates(_0x45c569,_0x259abb){return function(_0x92bcb3){if(_0x92bcb3){return _0x92bcb3[_0xd34b('0x25')](_0x45c569)[_0xd34b('0x26')](function(_0x27eb68){return _0x27eb68;});}return null;};}function removeEntity(_0x5afc42,_0x50da22){return function(_0x49c485){if(_0x49c485){return _0x49c485[_0xd34b('0x27')]()[_0xd34b('0x26')](function(){var _0x54c88a=_0x49c485['get']({'plain':!![]});var _0x5e5519=_0xd34b('0x28');return db[_0xd34b('0x29')][_0xd34b('0x27')]({'where':{'type':_0x5e5519,'resourceId':_0x54c88a['id']}})['then'](function(){return _0x49c485;});})[_0xd34b('0x26')](function(){_0x5afc42[_0xd34b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21a653,_0x38637f){return function(_0x342885){if(!_0x342885){_0x21a653['sendStatus'](0x194);}return _0x342885;};}function handleError(_0x161529,_0x4f047d){_0x4f047d=_0x4f047d||0x1f4;return function(_0x182266){logger[_0xd34b('0x2a')](_0x182266[_0xd34b('0x2b')]);if(_0x182266['name']){delete _0x182266[_0xd34b('0x2c')];}_0x161529['status'](_0x4f047d)[_0xd34b('0x2d')](_0x182266);};}exports['index']=function(_0x311a09,_0x567b74){var _0x24ef6c={},_0x3f3ff0={},_0x49cdbe={'count':0x0,'rows':[]};var _0x2c573d=_[_0xd34b('0x2e')](db[_0xd34b('0x2f')]['rawAttributes'],function(_0xfe0957){return{'name':_0xfe0957[_0xd34b('0x30')],'type':_0xfe0957[_0xd34b('0x31')]['key']};});_0x3f3ff0[_0xd34b('0x32')]=_[_0xd34b('0x2e')](_0x2c573d,_0xd34b('0x2c'));_0x3f3ff0[_0xd34b('0x33')]=_[_0xd34b('0x34')](_0x311a09[_0xd34b('0x33')]);_0x3f3ff0[_0xd34b('0x35')]=_['intersection'](_0x3f3ff0[_0xd34b('0x32')],_0x3f3ff0[_0xd34b('0x33')]);_0x24ef6c[_0xd34b('0x36')]=_[_0xd34b('0x37')](_0x3f3ff0[_0xd34b('0x32')],qs['fields'](_0x311a09[_0xd34b('0x33')][_0xd34b('0x38')]));_0x24ef6c[_0xd34b('0x36')]=_0x24ef6c['attributes']['length']?_0x24ef6c[_0xd34b('0x36')]:_0x3f3ff0[_0xd34b('0x32')];if(!_0x311a09[_0xd34b('0x33')]['hasOwnProperty'](_0xd34b('0x39'))){_0x24ef6c[_0xd34b('0x20')]=qs[_0xd34b('0x20')](_0x311a09[_0xd34b('0x33')]['limit']);_0x24ef6c['offset']=qs[_0xd34b('0x1f')](_0x311a09[_0xd34b('0x33')]['offset']);}_0x24ef6c['order']=qs['sort'](_0x311a09[_0xd34b('0x33')][_0xd34b('0x3a')]);_0x24ef6c['where']=qs[_0xd34b('0x35')](_[_0xd34b('0x3b')](_0x311a09[_0xd34b('0x33')],_0x3f3ff0[_0xd34b('0x35')]));if(_0x311a09[_0xd34b('0x33')]['filter']){_0x24ef6c[_0xd34b('0x3c')]=_[_0xd34b('0x3d')](_0x24ef6c[_0xd34b('0x3c')],{'$or':_[_0xd34b('0x2e')](_0x2c573d,function(_0x589ec9){if(_0x589ec9[_0xd34b('0x31')]!==_0xd34b('0x3e')){var _0x539d27={};_0x539d27[_0x589ec9['name']]={'$like':'%'+_0x311a09[_0xd34b('0x33')][_0xd34b('0x3f')]+'%'};return _0x539d27;}})});}_0x24ef6c=_[_0xd34b('0x3d')]({},_0x24ef6c,_0x311a09[_0xd34b('0x40')]);var _0x4a9660={'where':_0x24ef6c[_0xd34b('0x3c')]};return db[_0xd34b('0x2f')]['count'](_0x4a9660)['then'](function(_0x4d4bfa){_0x49cdbe[_0xd34b('0x41')]=_0x4d4bfa;if(_0x311a09['query']['includeAll']){_0x24ef6c[_0xd34b('0x42')]=[{'all':!![]}];}return db['Team'][_0xd34b('0x43')](_0x24ef6c);})['then'](function(_0x10dd5b){_0x49cdbe[_0xd34b('0x44')]=_0x10dd5b;return _0x49cdbe;})[_0xd34b('0x26')](respondWithFilteredResult(_0x567b74,_0x24ef6c))[_0xd34b('0x45')](handleError(_0x567b74,null));};exports[_0xd34b('0x46')]=function(_0x5deab1,_0x168441){var _0x3fc4b0={'raw':![],'where':{'id':_0x5deab1[_0xd34b('0x47')]['id']}},_0x175a10={};_0x175a10[_0xd34b('0x32')]=_[_0xd34b('0x34')](db[_0xd34b('0x2f')][_0xd34b('0x48')]);_0x175a10[_0xd34b('0x33')]=_[_0xd34b('0x34')](_0x5deab1[_0xd34b('0x33')]);_0x175a10[_0xd34b('0x35')]=_['intersection'](_0x175a10['model'],_0x175a10[_0xd34b('0x33')]);_0x3fc4b0[_0xd34b('0x36')]=_['intersection'](_0x175a10[_0xd34b('0x32')],qs[_0xd34b('0x38')](_0x5deab1['query'][_0xd34b('0x38')]));_0x3fc4b0[_0xd34b('0x36')]=_0x3fc4b0['attributes']['length']?_0x3fc4b0[_0xd34b('0x36')]:_0x175a10[_0xd34b('0x32')];if(_0x5deab1[_0xd34b('0x33')]['includeAll']){_0x3fc4b0[_0xd34b('0x42')]=[{'all':!![]}];}_0x3fc4b0=_['merge']({},_0x3fc4b0,_0x5deab1[_0xd34b('0x40')]);return db['Team'][_0xd34b('0x49')](_0x3fc4b0)['then'](handleEntityNotFound(_0x168441,null))[_0xd34b('0x26')](respondWithResult(_0x168441,null))[_0xd34b('0x45')](handleError(_0x168441,null));};exports[_0xd34b('0x4a')]=function(_0x334661,_0x19508c){return db[_0xd34b('0x2f')][_0xd34b('0x4a')](_0x334661[_0xd34b('0x4b')],{})[_0xd34b('0x26')](function(_0x149b3f){var _0x9b5b9d=_0x334661[_0xd34b('0x4c')][_0xd34b('0x4d')]({'plain':!![]});if(!_0x9b5b9d)throw new Error(_0xd34b('0x4e'));if(_0x9b5b9d[_0xd34b('0x4f')]===_0xd34b('0x4c')){var _0x4dc1c5=_0x149b3f[_0xd34b('0x4d')]({'plain':!![]});var _0xdef8f2=_0xd34b('0x28');return db[_0xd34b('0x50')][_0xd34b('0x49')]({'where':{'name':_0xdef8f2,'userProfileId':_0x9b5b9d[_0xd34b('0x51')]},'raw':!![]})[_0xd34b('0x26')](function(_0x1a9a96){if(_0x1a9a96&&_0x1a9a96['autoAssociation']===0x0){return db[_0xd34b('0x29')][_0xd34b('0x4a')]({'name':_0x4dc1c5[_0xd34b('0x2c')],'resourceId':_0x4dc1c5['id'],'type':_0x1a9a96[_0xd34b('0x2c')],'sectionId':_0x1a9a96['id']},{})['then'](function(){return _0x149b3f;});}else{return _0x149b3f;}})[_0xd34b('0x45')](function(_0x2ad613){logger[_0xd34b('0x2a')](_0xd34b('0x52'),_0x2ad613);throw _0x2ad613;});}return _0x149b3f;})[_0xd34b('0x26')](respondWithResult(_0x19508c,0xc9))[_0xd34b('0x45')](handleError(_0x19508c,null));};exports[_0xd34b('0x25')]=function(_0x3075e9,_0x3a5856){if(_0x3075e9[_0xd34b('0x4b')]['id']){delete _0x3075e9[_0xd34b('0x4b')]['id'];}return db[_0xd34b('0x2f')][_0xd34b('0x49')]({'where':{'id':_0x3075e9[_0xd34b('0x47')]['id']}})[_0xd34b('0x26')](handleEntityNotFound(_0x3a5856,null))['then'](saveUpdates(_0x3075e9[_0xd34b('0x4b')],null))[_0xd34b('0x26')](respondWithResult(_0x3a5856,null))[_0xd34b('0x45')](handleError(_0x3a5856,null));};exports['destroy']=function(_0x1de8ca,_0x816bb9){return db[_0xd34b('0x2f')][_0xd34b('0x49')]({'where':{'id':_0x1de8ca[_0xd34b('0x47')]['id']}})[_0xd34b('0x26')](handleEntityNotFound(_0x816bb9,null))[_0xd34b('0x26')](removeEntity(_0x816bb9,null))['catch'](handleError(_0x816bb9,null));};exports[_0xd34b('0x53')]=function(_0x3bc817,_0x35d484,_0x4cae9e){return db[_0xd34b('0x2f')][_0xd34b('0x54')]({'where':{'id':_0x3bc817[_0xd34b('0x47')]['id']}})[_0xd34b('0x26')](handleEntityNotFound(_0x35d484,null))[_0xd34b('0x26')](function(_0x29b4c0){if(!_0x3bc817[_0xd34b('0x33')][_0xd34b('0x55')]||!utils['isValidChannel'](_0x3bc817[_0xd34b('0x33')][_0xd34b('0x55')])){throw new db['Sequelize'][(_0xd34b('0x56'))](_0xd34b('0x57'));}var _0x5e4fa2={};var _0x5b8151={};_0x5b8151[_0xd34b('0x32')]=_[_0xd34b('0x34')](db[_[_0xd34b('0x58')](_0x3bc817[_0xd34b('0x33')]['channel'][_0xd34b('0x59')]())+_0xd34b('0x5a')][_0xd34b('0x48')]);_0x5b8151[_0xd34b('0x33')]=_[_0xd34b('0x34')](_0x3bc817['query']);_0x5b8151[_0xd34b('0x35')]=_[_0xd34b('0x37')](_0x5b8151[_0xd34b('0x32')],_0x5b8151['query']);_0x5e4fa2[_0xd34b('0x36')]=_[_0xd34b('0x37')](_0x5b8151[_0xd34b('0x32')],qs[_0xd34b('0x38')](_0x3bc817[_0xd34b('0x33')][_0xd34b('0x38')]));_0x5e4fa2[_0xd34b('0x36')]=_0x5e4fa2['attributes']['length']?_0x5e4fa2[_0xd34b('0x36')]:_0x5b8151['model'];_0x5e4fa2[_0xd34b('0x20')]=qs[_0xd34b('0x20')](_0x3bc817[_0xd34b('0x33')]['limit']);_0x5e4fa2['offset']=qs[_0xd34b('0x1f')](_0x3bc817[_0xd34b('0x33')][_0xd34b('0x1f')]);_0x5e4fa2[_0xd34b('0x5b')]=qs['sort'](_0x3bc817['query'][_0xd34b('0x3a')]);_0x5e4fa2[_0xd34b('0x3c')]=qs[_0xd34b('0x35')](_['pick'](_0x3bc817['query'],_0x5b8151[_0xd34b('0x35')]));_0x5e4fa2=_[_0xd34b('0x3d')]({},_0x5e4fa2,_0x3bc817[_0xd34b('0x40')]);return _0x29b4c0[_0xd34b('0x4d')+_[_0xd34b('0x58')](_0x3bc817[_0xd34b('0x33')][_0xd34b('0x55')][_0xd34b('0x59')]())+_0xd34b('0x5c')](_0x5e4fa2);})[_0xd34b('0x26')](respondWithResult(_0x35d484,null))['catch'](handleError(_0x35d484,null));};exports[_0xd34b('0x5d')]=function(_0x24e6a2,_0x41510f,_0x338c7a){return db[_0xd34b('0x2f')][_0xd34b('0x54')]({'where':{'id':_0x24e6a2[_0xd34b('0x47')]['id']}})[_0xd34b('0x26')](function(_0x163f0f){if(_0x163f0f){if(!_0x24e6a2[_0xd34b('0x4b')][_0xd34b('0x55')]||!utils[_0xd34b('0x5e')](_0x24e6a2['body']['channel'])){throw new db['Sequelize'][(_0xd34b('0x56'))]('Unknown\x20channel');}return _0x163f0f[_0xd34b('0x5f')+_[_0xd34b('0x58')](_0x24e6a2['body'][_0xd34b('0x55')][_0xd34b('0x59')]())+'Queues'](_0x24e6a2[_0xd34b('0x4b')]['ids']);}return null;})[_0xd34b('0x26')](handleEntityNotFound(_0x41510f,null))['then'](respondWithStatusCode(_0x41510f,null))[_0xd34b('0x45')](handleError(_0x41510f,null));};exports[_0xd34b('0x60')]=function(_0x9be403,_0x44a95b,_0x155668){return db[_0xd34b('0x2f')]['findOne']({'where':{'id':_0x9be403['params']['id']}})['then'](function(_0xafc1d7){if(_0xafc1d7){if(!_0x9be403[_0xd34b('0x33')][_0xd34b('0x55')]||!utils[_0xd34b('0x5e')](_0x9be403['query'][_0xd34b('0x55')])){throw new db[(_0xd34b('0x61'))]['ValidationError']('Unknown\x20channel');}return _0xafc1d7[_0xd34b('0x62')+_[_0xd34b('0x58')](_0x9be403[_0xd34b('0x33')][_0xd34b('0x55')][_0xd34b('0x59')]())+_0xd34b('0x5c')](_0x9be403['query'][_0xd34b('0x63')]);}return null;})['then'](handleEntityNotFound(_0x44a95b,null))['then'](respondWithStatusCode(_0x44a95b,null))[_0xd34b('0x45')](handleError(_0x44a95b,null));};exports[_0xd34b('0x64')]=function(_0x348b4a,_0x19abe9,_0x38714d){return db[_0xd34b('0x2f')][_0xd34b('0x49')]({'where':{'id':_0x348b4a[_0xd34b('0x47')]['id']}})[_0xd34b('0x26')](handleEntityNotFound(_0x19abe9,null))[_0xd34b('0x26')](function(_0xac0a54){if(_0xac0a54){var _0x1497ee=[_0xd34b('0x65'),_0xd34b('0x66'),'Mail',_0xd34b('0x67'),_0xd34b('0x68'),_0xd34b('0x69')];return BPromise[_0xd34b('0x6a')](_0x1497ee,function(_0x4fa51c){return _0xac0a54[_0xd34b('0x4d')+_0x4fa51c+_0xd34b('0x5c')]({'attributes':['id',_0xd34b('0x2c')]})['then'](function(_0x92d639){return BPromise['each'](_0x92d639,function(_0x50b6a0){return _0x50b6a0['addAgents'](_0x348b4a['body'][_0xd34b('0x63')])['then'](function(){if(_0x4fa51c===_0xd34b('0x65')){return db[_0xd34b('0x6b')][_0xd34b('0x43')]({'where':{'id':_0x348b4a['body'][_0xd34b('0x63')]},'attributes':['id',_0xd34b('0x2c'),_0xd34b('0x6c'),_0xd34b('0x6d'),_0xd34b('0x6e')],'raw':!![]})['then'](function(_0xcfd416){return BPromise[_0xd34b('0x6a')](_[_0xd34b('0x3f')](_0xcfd416,{'online':0x1}),function(_0x2cc811){return db['UserVoiceQueueRt'][_0xd34b('0x6f')]({'membername':_0x2cc811[_0xd34b('0x2c')],'UserId':_0x2cc811['id'],'queue_name':_0x50b6a0[_0xd34b('0x2c')],'VoiceQueueId':_0x50b6a0['id'],'interface':_[_0xd34b('0x70')](_0x2cc811['interface'])?util[_0xd34b('0x71')](_0xd34b('0x72'),_0x2cc811[_0xd34b('0x2c')]):_0x2cc811[_0xd34b('0x6e')],'paused':_0x2cc811[_0xd34b('0x6d')]||![],'penalty':0x0});});});}});});})[_0xd34b('0x26')](function(){return _0xac0a54;});})[_0xd34b('0x26')](function(){return _0xac0a54;});}})[_0xd34b('0x26')](function(_0x493497){if(_0x493497){return _0x493497[_0xd34b('0x64')](_0x348b4a[_0xd34b('0x4b')][_0xd34b('0x63')],_['omit'](_0x348b4a[_0xd34b('0x4b')],[_0xd34b('0x63'),'id'])||{})[_0xd34b('0x73')](function(_0xf836a7){for(var _0x1290ab=0x0;_0x1290ab<_0x348b4a[_0xd34b('0x4b')][_0xd34b('0x63')][_0xd34b('0x74')];_0x1290ab+=0x1){socket[_0xd34b('0x75')](_0xd34b('0x76'),{'UserId':_0x348b4a[_0xd34b('0x4b')][_0xd34b('0x63')][_0x1290ab],'TeamId':_0x348b4a[_0xd34b('0x47')]['id']});}return _0xf836a7;});}})['then'](respondWithResult(_0x19abe9,null))['catch'](handleError(_0x19abe9,null));};exports['removeAgents']=function(_0x56502e,_0x106aa7,_0xaf6ebc){return db['Team'][_0xd34b('0x49')]({'where':{'id':_0x56502e[_0xd34b('0x47')]['id']}})[_0xd34b('0x26')](handleEntityNotFound(_0x106aa7,null))[_0xd34b('0x26')](function(_0x50f02d){if(_0x50f02d){return BPromise[_0xd34b('0x6a')]([_0xd34b('0x77'),_0xd34b('0x78'),_0xd34b('0x79'),_0xd34b('0x7a'),_0xd34b('0x7b'),'openchannel'],function(_0x5b3d55){return _0x50f02d[_0xd34b('0x4d')+_[_0xd34b('0x58')](_0x5b3d55)+_0xd34b('0x5c')]({'attributes':['id',_0xd34b('0x2c')]})[_0xd34b('0x26')](function(_0x5d1009){return BPromise[_0xd34b('0x6a')](_0x5d1009,function(_0x42ba74){return _0x42ba74[_0xd34b('0x7c')](_0x56502e[_0xd34b('0x33')][_0xd34b('0x63')])[_0xd34b('0x26')](function(){if(_0x5b3d55==='voice'){return db[_0xd34b('0x7d')][_0xd34b('0x27')]({'where':{'VoiceQueueId':_0x42ba74['id'],'UserId':_0x56502e[_0xd34b('0x33')][_0xd34b('0x63')]}});}});});})[_0xd34b('0x26')](function(){return _0x50f02d;});})[_0xd34b('0x26')](function(){return _0x50f02d;});}})[_0xd34b('0x26')](function(_0x164f09){if(_0x164f09){return _0x164f09[_0xd34b('0x7c')](_0x56502e[_0xd34b('0x33')][_0xd34b('0x63')])[_0xd34b('0x26')](function(){if(_['isArray'](_0x56502e[_0xd34b('0x33')][_0xd34b('0x63')])){for(var _0x414e00=0x0;_0x414e00<_0x56502e[_0xd34b('0x33')][_0xd34b('0x63')][_0xd34b('0x74')];_0x414e00+=0x1){socket[_0xd34b('0x75')](_0xd34b('0x7e'),{'UserId':Number(_0x56502e[_0xd34b('0x33')][_0xd34b('0x63')][_0x414e00]),'TeamId':Number(_0x56502e[_0xd34b('0x47')]['id'])});}}else{socket[_0xd34b('0x75')](_0xd34b('0x7e'),{'UserId':Number(_0x56502e[_0xd34b('0x33')][_0xd34b('0x63')]),'TeamId':Number(_0x56502e[_0xd34b('0x47')]['id'])});}});}})[_0xd34b('0x26')](respondWithStatusCode(_0x106aa7,null))[_0xd34b('0x45')](handleError(_0x106aa7,null));};exports[_0xd34b('0x7f')]=function(_0x2dd131,_0x11a876,_0xf34434){var _0x43add4={};var _0x4e1cb0={};var _0x3e141d;var _0xb3ec05;return db[_0xd34b('0x2f')][_0xd34b('0x54')]({'where':{'id':_0x2dd131[_0xd34b('0x47')]['id']}})['then'](handleEntityNotFound(_0x11a876,null))[_0xd34b('0x26')](function(_0x3eb15c){if(_0x3eb15c){_0x3e141d=_0x3eb15c;_0x4e1cb0[_0xd34b('0x32')]=_[_0xd34b('0x34')](db['User'][_0xd34b('0x48')]);_0x4e1cb0['query']=_[_0xd34b('0x34')](_0x2dd131['query']);_0x4e1cb0[_0xd34b('0x35')]=_[_0xd34b('0x37')](_0x4e1cb0[_0xd34b('0x32')],_0x4e1cb0[_0xd34b('0x33')]);_0x43add4['attributes']=_['intersection'](_0x4e1cb0[_0xd34b('0x32')],qs['fields'](_0x2dd131[_0xd34b('0x33')][_0xd34b('0x38')]));_0x43add4[_0xd34b('0x36')]=_0x43add4[_0xd34b('0x36')]['length']?_0x43add4['attributes']:_0x4e1cb0[_0xd34b('0x32')];_0x43add4[_0xd34b('0x5b')]=qs['sort'](_0x2dd131[_0xd34b('0x33')]['sort']);_0x43add4[_0xd34b('0x3c')]=qs[_0xd34b('0x35')](_['pick'](_0x2dd131[_0xd34b('0x33')],_0x4e1cb0[_0xd34b('0x35')]));if(_0x2dd131[_0xd34b('0x33')][_0xd34b('0x3f')]){_0x43add4['where']=_[_0xd34b('0x3d')](_0x43add4[_0xd34b('0x3c')],{'$or':_[_0xd34b('0x2e')](_0x43add4[_0xd34b('0x36')],function(_0x575aec){var _0x4526c1={};_0x4526c1[_0x575aec]={'$like':'%'+_0x2dd131[_0xd34b('0x33')]['filter']+'%'};return _0x4526c1;})});}_0x43add4=_[_0xd34b('0x3d')]({},_0x43add4,_0x2dd131[_0xd34b('0x40')]);return _0x3e141d[_0xd34b('0x7f')](_0x43add4);}})[_0xd34b('0x26')](function(_0x15d16f){if(_0x15d16f){_0xb3ec05=_0x15d16f[_0xd34b('0x74')];if(!_0x2dd131['query'][_0xd34b('0x80')]('nolimit')){_0x43add4[_0xd34b('0x20')]=qs[_0xd34b('0x20')](_0x2dd131[_0xd34b('0x33')][_0xd34b('0x20')]);_0x43add4['offset']=qs[_0xd34b('0x1f')](_0x2dd131[_0xd34b('0x33')][_0xd34b('0x1f')]);}return _0x3e141d[_0xd34b('0x7f')](_0x43add4);}})['then'](function(_0x103d21){if(_0x103d21){return _0x103d21?{'count':_0xb3ec05,'rows':_0x103d21}:null;}})[_0xd34b('0x26')](respondWithResult(_0x11a876,null))['catch'](handleError(_0x11a876,null));}; \ No newline at end of file +var _0xb79a=['UserVoiceQueueRt','upsert','SIP/%s','emit','userTeam:save','removeAgents','chat','mail','sms','fax','voice','getAgents','User','hasOwnProperty','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./team.socket','register','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','get','Teams','UserProfileResource','destroy','sendStatus','error','stack','send','map','Team','rawAttributes','type','model','name','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','VIRTUAL','merge','includeAll','include','findAll','rows','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','channel','Queue','Queues','add','toLowerCase','ids','removeQueues','remove','addAgents','Voice','Chat','Mail','Sms','Fax','each','online','voicePause','interface','filter'];(function(_0x267d8d,_0xe90f65){var _0x11a98f=function(_0x5703c9){while(--_0x5703c9){_0x267d8d['push'](_0x267d8d['shift']());}};_0x11a98f(++_0xe90f65);}(_0xb79a,0x18e));var _0xab79=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb79a[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0xab79('0x0'));var emlformat=require(_0xab79('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xab79('0x2'));var jsonpatch=require(_0xab79('0x3'));var rp=require(_0xab79('0x4'));var moment=require(_0xab79('0x5'));var BPromise=require(_0xab79('0x6'));var Mustache=require(_0xab79('0x7'));var util=require(_0xab79('0x8'));var path=require(_0xab79('0x9'));var sox=require('sox');var csv=require(_0xab79('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xab79('0xb'));var squel=require(_0xab79('0xc'));var crypto=require(_0xab79('0xd'));var jsforce=require(_0xab79('0xe'));var deskjs=require(_0xab79('0xf'));var toCsv=require(_0xab79('0xa'));var querystring=require(_0xab79('0x10'));var Papa=require(_0xab79('0x11'));var Redis=require(_0xab79('0x12'));var authService=require(_0xab79('0x13'));var qs=require(_0xab79('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xab79('0x15'))(_0xab79('0x16'));var utils=require(_0xab79('0x17'));var config=require(_0xab79('0x18'));var db=require(_0xab79('0x19'))['db'];config[_0xab79('0x1a')]=_['defaults'](config['redis'],{'host':_0xab79('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xab79('0x1a')]));require(_0xab79('0x1c'))[_0xab79('0x1d')](socket);function respondWithStatusCode(_0x4c5ec7,_0x5b8cd7){_0x5b8cd7=_0x5b8cd7||0xcc;return function(_0x5c817c){if(_0x5c817c){return _0x4c5ec7['sendStatus'](_0x5b8cd7);}return _0x4c5ec7[_0xab79('0x1e')](_0x5b8cd7)[_0xab79('0x1f')]();};}function respondWithResult(_0x4ae6d8,_0x5d2137){_0x5d2137=_0x5d2137||0xc8;return function(_0x5d492f){if(_0x5d492f){return _0x4ae6d8[_0xab79('0x1e')](_0x5d2137)[_0xab79('0x20')](_0x5d492f);}};}function respondWithFilteredResult(_0x53bcd0,_0x21bc1b){return function(_0x1a1deb){if(_0x1a1deb){var _0x3393de=_0x1a1deb[_0xab79('0x21')],_0x117bfa=_0x21bc1b[_0xab79('0x22')],_0x4cbff5=_0x21bc1b[_0xab79('0x22')]+_0x21bc1b['limit'],_0x2716ef;if(_0x4cbff5>=_0x3393de){_0x4cbff5=_0x3393de;_0x2716ef=0xc8;}else{_0x2716ef=0xce;}_0x53bcd0[_0xab79('0x1e')](_0x2716ef);return _0x53bcd0[_0xab79('0x23')](_0xab79('0x24'),_0x117bfa+'-'+_0x4cbff5+'/'+_0x3393de)[_0xab79('0x20')](_0x1a1deb);}return null;};}function patchUpdates(_0x2c94d2){return function(_0x595942){try{jsonpatch[_0xab79('0x25')](_0x595942,_0x2c94d2,!![]);}catch(_0x4e8e1b){return BPromise[_0xab79('0x26')](_0x4e8e1b);}return _0x595942[_0xab79('0x27')]();};}function saveUpdates(_0x37e1d5,_0x1bea71){return function(_0x475732){if(_0x475732){return _0x475732[_0xab79('0x28')](_0x37e1d5)[_0xab79('0x29')](function(_0x323e35){return _0x323e35;});}return null;};}function removeEntity(_0x397ce4,_0x1e440a){return function(_0xb669a){if(_0xb669a){return _0xb669a['destroy']()[_0xab79('0x29')](function(){var _0x1e6ac1=_0xb669a[_0xab79('0x2a')]({'plain':!![]});var _0x454ed8=_0xab79('0x2b');return db[_0xab79('0x2c')][_0xab79('0x2d')]({'where':{'type':_0x454ed8,'resourceId':_0x1e6ac1['id']}})[_0xab79('0x29')](function(){return _0xb669a;});})['then'](function(){_0x397ce4[_0xab79('0x1e')](0xcc)[_0xab79('0x1f')]();});}};}function handleEntityNotFound(_0x268a04,_0x4eecc3){return function(_0x4d5d2f){if(!_0x4d5d2f){_0x268a04[_0xab79('0x2e')](0x194);}return _0x4d5d2f;};}function handleError(_0x6ea2d9,_0x5f10ef){_0x5f10ef=_0x5f10ef||0x1f4;return function(_0x2f6dc3){logger[_0xab79('0x2f')](_0x2f6dc3[_0xab79('0x30')]);if(_0x2f6dc3['name']){delete _0x2f6dc3['name'];}_0x6ea2d9[_0xab79('0x1e')](_0x5f10ef)[_0xab79('0x31')](_0x2f6dc3);};}exports['index']=function(_0x13b965,_0x4b5396){var _0x3f8e22={},_0x18e9bf={},_0x5520bd={'count':0x0,'rows':[]};var _0x42f534=_[_0xab79('0x32')](db[_0xab79('0x33')][_0xab79('0x34')],function(_0x1bf844){return{'name':_0x1bf844['fieldName'],'type':_0x1bf844[_0xab79('0x35')]['key']};});_0x18e9bf[_0xab79('0x36')]=_['map'](_0x42f534,_0xab79('0x37'));_0x18e9bf['query']=_[_0xab79('0x38')](_0x13b965[_0xab79('0x39')]);_0x18e9bf[_0xab79('0x3a')]=_[_0xab79('0x3b')](_0x18e9bf[_0xab79('0x36')],_0x18e9bf['query']);_0x3f8e22[_0xab79('0x3c')]=_[_0xab79('0x3b')](_0x18e9bf['model'],qs[_0xab79('0x3d')](_0x13b965['query'][_0xab79('0x3d')]));_0x3f8e22['attributes']=_0x3f8e22[_0xab79('0x3c')][_0xab79('0x3e')]?_0x3f8e22[_0xab79('0x3c')]:_0x18e9bf[_0xab79('0x36')];if(!_0x13b965[_0xab79('0x39')]['hasOwnProperty'](_0xab79('0x3f'))){_0x3f8e22['limit']=qs['limit'](_0x13b965[_0xab79('0x39')][_0xab79('0x40')]);_0x3f8e22['offset']=qs[_0xab79('0x22')](_0x13b965['query'][_0xab79('0x22')]);}_0x3f8e22[_0xab79('0x41')]=qs[_0xab79('0x42')](_0x13b965[_0xab79('0x39')][_0xab79('0x42')]);_0x3f8e22[_0xab79('0x43')]=qs[_0xab79('0x3a')](_[_0xab79('0x44')](_0x13b965[_0xab79('0x39')],_0x18e9bf[_0xab79('0x3a')]));if(_0x13b965[_0xab79('0x39')]['filter']){_0x3f8e22[_0xab79('0x43')]=_['merge'](_0x3f8e22['where'],{'$or':_[_0xab79('0x32')](_0x42f534,function(_0x17b816){if(_0x17b816['type']!==_0xab79('0x45')){var _0x47a4e8={};_0x47a4e8[_0x17b816[_0xab79('0x37')]]={'$like':'%'+_0x13b965[_0xab79('0x39')]['filter']+'%'};return _0x47a4e8;}})});}_0x3f8e22=_[_0xab79('0x46')]({},_0x3f8e22,_0x13b965['options']);var _0x37780f={'where':_0x3f8e22['where']};return db[_0xab79('0x33')][_0xab79('0x21')](_0x37780f)['then'](function(_0x32e3c9){_0x5520bd['count']=_0x32e3c9;if(_0x13b965[_0xab79('0x39')][_0xab79('0x47')]){_0x3f8e22[_0xab79('0x48')]=[{'all':!![]}];}return db['Team'][_0xab79('0x49')](_0x3f8e22);})[_0xab79('0x29')](function(_0x133b21){_0x5520bd[_0xab79('0x4a')]=_0x133b21;return _0x5520bd;})[_0xab79('0x29')](respondWithFilteredResult(_0x4b5396,_0x3f8e22))['catch'](handleError(_0x4b5396,null));};exports['show']=function(_0x521058,_0x3e5fde){var _0x4d96aa={'raw':![],'where':{'id':_0x521058[_0xab79('0x4b')]['id']}},_0x16a487={};_0x16a487[_0xab79('0x36')]=_[_0xab79('0x38')](db[_0xab79('0x33')]['rawAttributes']);_0x16a487[_0xab79('0x39')]=_[_0xab79('0x38')](_0x521058[_0xab79('0x39')]);_0x16a487[_0xab79('0x3a')]=_[_0xab79('0x3b')](_0x16a487[_0xab79('0x36')],_0x16a487[_0xab79('0x39')]);_0x4d96aa['attributes']=_[_0xab79('0x3b')](_0x16a487['model'],qs[_0xab79('0x3d')](_0x521058[_0xab79('0x39')][_0xab79('0x3d')]));_0x4d96aa[_0xab79('0x3c')]=_0x4d96aa['attributes']['length']?_0x4d96aa[_0xab79('0x3c')]:_0x16a487[_0xab79('0x36')];if(_0x521058[_0xab79('0x39')][_0xab79('0x47')]){_0x4d96aa['include']=[{'all':!![]}];}_0x4d96aa=_[_0xab79('0x46')]({},_0x4d96aa,_0x521058[_0xab79('0x4c')]);return db[_0xab79('0x33')][_0xab79('0x4d')](_0x4d96aa)['then'](handleEntityNotFound(_0x3e5fde,null))[_0xab79('0x29')](respondWithResult(_0x3e5fde,null))['catch'](handleError(_0x3e5fde,null));};exports[_0xab79('0x4e')]=function(_0x42829c,_0x5b6138){return db['Team']['create'](_0x42829c[_0xab79('0x4f')],{})[_0xab79('0x29')](function(_0x564c08){var _0x425016=_0x42829c[_0xab79('0x50')]['get']({'plain':!![]});if(!_0x425016)throw new Error(_0xab79('0x51'));if(_0x425016[_0xab79('0x52')]===_0xab79('0x50')){var _0x10444e=_0x564c08[_0xab79('0x2a')]({'plain':!![]});var _0x512271=_0xab79('0x2b');return db[_0xab79('0x53')][_0xab79('0x4d')]({'where':{'name':_0x512271,'userProfileId':_0x425016[_0xab79('0x54')]},'raw':!![]})[_0xab79('0x29')](function(_0x5dc121){if(_0x5dc121&&_0x5dc121[_0xab79('0x55')]===0x0){return db[_0xab79('0x2c')][_0xab79('0x4e')]({'name':_0x10444e[_0xab79('0x37')],'resourceId':_0x10444e['id'],'type':_0x5dc121[_0xab79('0x37')],'sectionId':_0x5dc121['id']},{})[_0xab79('0x29')](function(){return _0x564c08;});}else{return _0x564c08;}})[_0xab79('0x56')](function(_0x2e8d73){logger[_0xab79('0x2f')](_0xab79('0x57'),_0x2e8d73);throw _0x2e8d73;});}return _0x564c08;})[_0xab79('0x29')](respondWithResult(_0x5b6138,0xc9))[_0xab79('0x56')](handleError(_0x5b6138,null));};exports[_0xab79('0x28')]=function(_0x1141f2,_0x45ede1){if(_0x1141f2['body']['id']){delete _0x1141f2[_0xab79('0x4f')]['id'];}return db[_0xab79('0x33')]['find']({'where':{'id':_0x1141f2[_0xab79('0x4b')]['id']}})[_0xab79('0x29')](handleEntityNotFound(_0x45ede1,null))[_0xab79('0x29')](saveUpdates(_0x1141f2[_0xab79('0x4f')],null))[_0xab79('0x29')](respondWithResult(_0x45ede1,null))['catch'](handleError(_0x45ede1,null));};exports[_0xab79('0x2d')]=function(_0x5c15a0,_0xf59670){return db[_0xab79('0x33')]['find']({'where':{'id':_0x5c15a0[_0xab79('0x4b')]['id']}})[_0xab79('0x29')](handleEntityNotFound(_0xf59670,null))['then'](removeEntity(_0xf59670,null))[_0xab79('0x56')](handleError(_0xf59670,null));};exports[_0xab79('0x58')]=function(_0xf41178,_0x2a82fa,_0x366a2f){return db[_0xab79('0x33')][_0xab79('0x59')]({'where':{'id':_0xf41178[_0xab79('0x4b')]['id']}})[_0xab79('0x29')](handleEntityNotFound(_0x2a82fa,null))[_0xab79('0x29')](function(_0x2a1dec){if(!_0xf41178[_0xab79('0x39')]['channel']||!utils[_0xab79('0x5a')](_0xf41178[_0xab79('0x39')]['channel'])){throw new db[(_0xab79('0x5b'))][(_0xab79('0x5c'))](_0xab79('0x5d'));}var _0x2b64ea={};var _0x381b5d={};_0x381b5d[_0xab79('0x36')]=_[_0xab79('0x38')](db[_[_0xab79('0x5e')](_0xf41178['query'][_0xab79('0x5f')]['toLowerCase']())+_0xab79('0x60')][_0xab79('0x34')]);_0x381b5d[_0xab79('0x39')]=_[_0xab79('0x38')](_0xf41178[_0xab79('0x39')]);_0x381b5d['filters']=_[_0xab79('0x3b')](_0x381b5d[_0xab79('0x36')],_0x381b5d[_0xab79('0x39')]);_0x2b64ea[_0xab79('0x3c')]=_[_0xab79('0x3b')](_0x381b5d[_0xab79('0x36')],qs[_0xab79('0x3d')](_0xf41178['query']['fields']));_0x2b64ea[_0xab79('0x3c')]=_0x2b64ea[_0xab79('0x3c')][_0xab79('0x3e')]?_0x2b64ea[_0xab79('0x3c')]:_0x381b5d[_0xab79('0x36')];_0x2b64ea['limit']=qs[_0xab79('0x40')](_0xf41178['query']['limit']);_0x2b64ea[_0xab79('0x22')]=qs[_0xab79('0x22')](_0xf41178[_0xab79('0x39')][_0xab79('0x22')]);_0x2b64ea[_0xab79('0x41')]=qs[_0xab79('0x42')](_0xf41178[_0xab79('0x39')][_0xab79('0x42')]);_0x2b64ea['where']=qs[_0xab79('0x3a')](_['pick'](_0xf41178[_0xab79('0x39')],_0x381b5d['filters']));_0x2b64ea=_[_0xab79('0x46')]({},_0x2b64ea,_0xf41178[_0xab79('0x4c')]);return _0x2a1dec[_0xab79('0x2a')+_['capitalize'](_0xf41178[_0xab79('0x39')][_0xab79('0x5f')]['toLowerCase']())+_0xab79('0x61')](_0x2b64ea);})['then'](respondWithResult(_0x2a82fa,null))[_0xab79('0x56')](handleError(_0x2a82fa,null));};exports['addQueues']=function(_0x1b439e,_0x514548,_0x583cec){return db[_0xab79('0x33')][_0xab79('0x59')]({'where':{'id':_0x1b439e[_0xab79('0x4b')]['id']}})[_0xab79('0x29')](function(_0x29cb62){if(_0x29cb62){if(!_0x1b439e['body'][_0xab79('0x5f')]||!utils['isValidChannel'](_0x1b439e[_0xab79('0x4f')][_0xab79('0x5f')])){throw new db['Sequelize'][(_0xab79('0x5c'))](_0xab79('0x5d'));}return _0x29cb62[_0xab79('0x62')+_[_0xab79('0x5e')](_0x1b439e['body'][_0xab79('0x5f')][_0xab79('0x63')]())+_0xab79('0x61')](_0x1b439e['body'][_0xab79('0x64')]);}return null;})['then'](handleEntityNotFound(_0x514548,null))['then'](respondWithStatusCode(_0x514548,null))['catch'](handleError(_0x514548,null));};exports[_0xab79('0x65')]=function(_0x4d110e,_0x175cc5,_0x5acd98){return db[_0xab79('0x33')][_0xab79('0x59')]({'where':{'id':_0x4d110e['params']['id']}})[_0xab79('0x29')](function(_0x147c86){if(_0x147c86){if(!_0x4d110e[_0xab79('0x39')][_0xab79('0x5f')]||!utils[_0xab79('0x5a')](_0x4d110e[_0xab79('0x39')][_0xab79('0x5f')])){throw new db[(_0xab79('0x5b'))]['ValidationError']('Unknown\x20channel');}return _0x147c86[_0xab79('0x66')+_[_0xab79('0x5e')](_0x4d110e[_0xab79('0x39')]['channel'][_0xab79('0x63')]())+_0xab79('0x61')](_0x4d110e[_0xab79('0x39')]['ids']);}return null;})[_0xab79('0x29')](handleEntityNotFound(_0x175cc5,null))['then'](respondWithStatusCode(_0x175cc5,null))['catch'](handleError(_0x175cc5,null));};exports[_0xab79('0x67')]=function(_0x194c55,_0x43a756,_0x104daa){return db[_0xab79('0x33')]['find']({'where':{'id':_0x194c55['params']['id']}})[_0xab79('0x29')](handleEntityNotFound(_0x43a756,null))[_0xab79('0x29')](function(_0x5356ff){if(_0x5356ff){var _0x38596a=[_0xab79('0x68'),_0xab79('0x69'),_0xab79('0x6a'),_0xab79('0x6b'),_0xab79('0x6c'),'Openchannel'];return BPromise[_0xab79('0x6d')](_0x38596a,function(_0x5941fd){return _0x5356ff[_0xab79('0x2a')+_0x5941fd+_0xab79('0x61')]({'attributes':['id',_0xab79('0x37')]})[_0xab79('0x29')](function(_0x1de0f6){return BPromise['each'](_0x1de0f6,function(_0x4df2d9){return _0x4df2d9[_0xab79('0x67')](_0x194c55[_0xab79('0x4f')]['ids'])[_0xab79('0x29')](function(){if(_0x5941fd===_0xab79('0x68')){return db['User'][_0xab79('0x49')]({'where':{'id':_0x194c55['body'][_0xab79('0x64')]},'attributes':['id',_0xab79('0x37'),_0xab79('0x6e'),_0xab79('0x6f'),_0xab79('0x70')],'raw':!![]})[_0xab79('0x29')](function(_0x4e111e){return BPromise[_0xab79('0x6d')](_[_0xab79('0x71')](_0x4e111e,{'online':0x1}),function(_0x57a22e){return db[_0xab79('0x72')][_0xab79('0x73')]({'membername':_0x57a22e[_0xab79('0x37')],'UserId':_0x57a22e['id'],'queue_name':_0x4df2d9['name'],'VoiceQueueId':_0x4df2d9['id'],'interface':_['isNil'](_0x57a22e[_0xab79('0x70')])?util['format'](_0xab79('0x74'),_0x57a22e[_0xab79('0x37')]):_0x57a22e[_0xab79('0x70')],'paused':_0x57a22e[_0xab79('0x6f')]||![],'penalty':0x0});});});}});});})[_0xab79('0x29')](function(){return _0x5356ff;});})[_0xab79('0x29')](function(){return _0x5356ff;});}})[_0xab79('0x29')](function(_0x110bcf){if(_0x110bcf){return _0x110bcf[_0xab79('0x67')](_0x194c55['body'][_0xab79('0x64')],_['omit'](_0x194c55[_0xab79('0x4f')],[_0xab79('0x64'),'id'])||{})['spread'](function(_0x51b5d0){for(var _0x31b9de=0x0;_0x31b9de<_0x194c55['body']['ids'][_0xab79('0x3e')];_0x31b9de+=0x1){socket[_0xab79('0x75')](_0xab79('0x76'),{'UserId':_0x194c55['body'][_0xab79('0x64')][_0x31b9de],'TeamId':_0x194c55[_0xab79('0x4b')]['id']});}return _0x51b5d0;});}})[_0xab79('0x29')](respondWithResult(_0x43a756,null))[_0xab79('0x56')](handleError(_0x43a756,null));};exports[_0xab79('0x77')]=function(_0x5f0113,_0x45375e,_0x2883d8){return db[_0xab79('0x33')]['find']({'where':{'id':_0x5f0113[_0xab79('0x4b')]['id']}})[_0xab79('0x29')](handleEntityNotFound(_0x45375e,null))[_0xab79('0x29')](function(_0x3d71e5){if(_0x3d71e5){return BPromise[_0xab79('0x6d')](['voice',_0xab79('0x78'),_0xab79('0x79'),_0xab79('0x7a'),_0xab79('0x7b'),'openchannel'],function(_0x4c3abf){return _0x3d71e5['get'+_[_0xab79('0x5e')](_0x4c3abf)+_0xab79('0x61')]({'attributes':['id',_0xab79('0x37')]})[_0xab79('0x29')](function(_0x1a300f){return BPromise[_0xab79('0x6d')](_0x1a300f,function(_0x52a7f9){return _0x52a7f9['removeAgents'](_0x5f0113[_0xab79('0x39')][_0xab79('0x64')])[_0xab79('0x29')](function(){if(_0x4c3abf===_0xab79('0x7c')){return db[_0xab79('0x72')][_0xab79('0x2d')]({'where':{'VoiceQueueId':_0x52a7f9['id'],'UserId':_0x5f0113[_0xab79('0x39')][_0xab79('0x64')]}});}});});})['then'](function(){return _0x3d71e5;});})['then'](function(){return _0x3d71e5;});}})[_0xab79('0x29')](function(_0x3a4664){if(_0x3a4664){return _0x3a4664[_0xab79('0x77')](_0x5f0113[_0xab79('0x39')][_0xab79('0x64')])['then'](function(){if(_['isArray'](_0x5f0113[_0xab79('0x39')]['ids'])){for(var _0x5ab88a=0x0;_0x5ab88a<_0x5f0113[_0xab79('0x39')]['ids']['length'];_0x5ab88a+=0x1){socket[_0xab79('0x75')]('userTeam:remove',{'UserId':Number(_0x5f0113[_0xab79('0x39')]['ids'][_0x5ab88a]),'TeamId':Number(_0x5f0113[_0xab79('0x4b')]['id'])});}}else{socket[_0xab79('0x75')]('userTeam:remove',{'UserId':Number(_0x5f0113[_0xab79('0x39')][_0xab79('0x64')]),'TeamId':Number(_0x5f0113[_0xab79('0x4b')]['id'])});}});}})[_0xab79('0x29')](respondWithStatusCode(_0x45375e,null))[_0xab79('0x56')](handleError(_0x45375e,null));};exports[_0xab79('0x7d')]=function(_0x529c12,_0x186db2,_0x1ddb22){var _0x560f5c={};var _0x3342c3={};var _0x1bebc9;var _0x5b4c41;return db[_0xab79('0x33')][_0xab79('0x59')]({'where':{'id':_0x529c12[_0xab79('0x4b')]['id']}})[_0xab79('0x29')](handleEntityNotFound(_0x186db2,null))[_0xab79('0x29')](function(_0x38c3b2){if(_0x38c3b2){_0x1bebc9=_0x38c3b2;_0x3342c3[_0xab79('0x36')]=_['keys'](db[_0xab79('0x7e')]['rawAttributes']);_0x3342c3[_0xab79('0x39')]=_[_0xab79('0x38')](_0x529c12[_0xab79('0x39')]);_0x3342c3[_0xab79('0x3a')]=_[_0xab79('0x3b')](_0x3342c3[_0xab79('0x36')],_0x3342c3[_0xab79('0x39')]);_0x560f5c[_0xab79('0x3c')]=_[_0xab79('0x3b')](_0x3342c3[_0xab79('0x36')],qs[_0xab79('0x3d')](_0x529c12[_0xab79('0x39')]['fields']));_0x560f5c['attributes']=_0x560f5c[_0xab79('0x3c')][_0xab79('0x3e')]?_0x560f5c['attributes']:_0x3342c3[_0xab79('0x36')];_0x560f5c[_0xab79('0x41')]=qs[_0xab79('0x42')](_0x529c12[_0xab79('0x39')][_0xab79('0x42')]);_0x560f5c['where']=qs[_0xab79('0x3a')](_['pick'](_0x529c12[_0xab79('0x39')],_0x3342c3[_0xab79('0x3a')]));if(_0x529c12[_0xab79('0x39')][_0xab79('0x71')]){_0x560f5c[_0xab79('0x43')]=_[_0xab79('0x46')](_0x560f5c[_0xab79('0x43')],{'$or':_[_0xab79('0x32')](_0x560f5c[_0xab79('0x3c')],function(_0x5f38d4){var _0xa7cbc2={};_0xa7cbc2[_0x5f38d4]={'$like':'%'+_0x529c12['query'][_0xab79('0x71')]+'%'};return _0xa7cbc2;})});}_0x560f5c=_[_0xab79('0x46')]({},_0x560f5c,_0x529c12['options']);return _0x1bebc9[_0xab79('0x7d')](_0x560f5c);}})['then'](function(_0x48179b){if(_0x48179b){_0x5b4c41=_0x48179b[_0xab79('0x3e')];if(!_0x529c12[_0xab79('0x39')][_0xab79('0x7f')](_0xab79('0x3f'))){_0x560f5c[_0xab79('0x40')]=qs['limit'](_0x529c12[_0xab79('0x39')][_0xab79('0x40')]);_0x560f5c[_0xab79('0x22')]=qs[_0xab79('0x22')](_0x529c12['query'][_0xab79('0x22')]);}return _0x1bebc9['getAgents'](_0x560f5c);}})[_0xab79('0x29')](function(_0x18d785){if(_0x18d785){return _0x18d785?{'count':_0x5b4c41,'rows':_0x18d785}:null;}})[_0xab79('0x29')](respondWithResult(_0x186db2,null))[_0xab79('0x56')](handleError(_0x186db2,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index c02f660..d114425 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 _0x21f9=['events','../../mysqldb','Team','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x21f9,0xe6));var _0x921f=function(_0x314210,_0x337540){_0x314210=_0x314210-0x0;var _0x45b142=_0x21f9[_0x314210];return _0x45b142;};'use strict';var EventEmitter=require(_0x921f('0x0'));var Team=require(_0x921f('0x1'))['db'][_0x921f('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x921f('0x3'),'afterUpdate':_0x921f('0x4'),'afterDestroy':_0x921f('0x5')};function emitEvent(_0xd16659){return function(_0x62804,_0x35ec03,_0x562aae){TeamEvents['emit'](_0xd16659+':'+_0x62804['id'],_0x62804);TeamEvents[_0x921f('0x6')](_0xd16659,_0x62804);_0x562aae(null);};}for(var e in events){if(events[_0x921f('0x7')](e)){var event=events[e];Team[_0x921f('0x8')](e,emitEvent(event));}}module[_0x921f('0x9')]=TeamEvents; \ No newline at end of file +var _0xfc91=['emit','hasOwnProperty','hook','exports','Team','setMaxListeners','save','update','remove'];(function(_0x2d12be,_0x22287e){var _0xa1d91c=function(_0x201ff2){while(--_0x201ff2){_0x2d12be['push'](_0x2d12be['shift']());}};_0xa1d91c(++_0x22287e);}(_0xfc91,0xf7));var _0x1fc9=function(_0x34e609,_0x31e042){_0x34e609=_0x34e609-0x0;var _0x3a51d6=_0xfc91[_0x34e609];return _0x3a51d6;};'use strict';var EventEmitter=require('events');var Team=require('../../mysqldb')['db'][_0x1fc9('0x0')];var TeamEvents=new EventEmitter();TeamEvents[_0x1fc9('0x1')](0x0);var events={'afterCreate':_0x1fc9('0x2'),'afterUpdate':_0x1fc9('0x3'),'afterDestroy':_0x1fc9('0x4')};function emitEvent(_0xc2323b){return function(_0x53cc4a,_0x11ad25,_0x177883){TeamEvents[_0x1fc9('0x5')](_0xc2323b+':'+_0x53cc4a['id'],_0x53cc4a);TeamEvents[_0x1fc9('0x5')](_0xc2323b,_0x53cc4a);_0x177883(null);};}for(var e in events){if(events[_0x1fc9('0x6')](e)){var event=events[e];Team[_0x1fc9('0x7')](e,emitEvent(event));}}module[_0x1fc9('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index ad7965d..7f1b924 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 _0x4661=['api','moment','bluebird','request-promise','../../config/environment','./team.attributes','define','Team','teams','util'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4661,0x135));var _0x1466=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4661[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require(_0x1466('0x0'));var logger=require('../../config/logger')(_0x1466('0x1'));var moment=require(_0x1466('0x2'));var BPromise=require(_0x1466('0x3'));var rp=require(_0x1466('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1466('0x5'));var attributes=require(_0x1466('0x6'));module['exports']=function(_0x3d2fd6,_0x460c54){return _0x3d2fd6[_0x1466('0x7')](_0x1466('0x8'),attributes,{'tableName':_0x1466('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7896=['rimraf','define','lodash','util','api','moment','bluebird','request-promise'];(function(_0x39df39,_0x5a2fd8){var _0x28ebf2=function(_0xc8375d){while(--_0xc8375d){_0x39df39['push'](_0x39df39['shift']());}};_0x28ebf2(++_0x5a2fd8);}(_0x7896,0xe2));var _0x6789=function(_0x8a2dae,_0x2a21a7){_0x8a2dae=_0x8a2dae-0x0;var _0x308f20=_0x7896[_0x8a2dae];return _0x308f20;};'use strict';var _=require(_0x6789('0x0'));var util=require(_0x6789('0x1'));var logger=require('../../config/logger')(_0x6789('0x2'));var moment=require(_0x6789('0x3'));var BPromise=require(_0x6789('0x4'));var rp=require(_0x6789('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6789('0x6'));var config=require('../../config/environment');var attributes=require('./team.attributes');module['exports']=function(_0x2aae7e,_0x595621){return _0x2aae7e[_0x6789('0x7')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index b8dd94f..bad468c 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 _0x214a=['http','redis','defaults','localhost','socket.io-emitter','./team.socket','request','then','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x214a,0x1f2));var _0xa214=function(_0x563e0d,_0x4da67e){_0x563e0d=_0x563e0d-0x0;var _0xd9fcfc=_0x214a[_0x563e0d];return _0xd9fcfc;};'use strict';var _=require(_0xa214('0x0'));var util=require(_0xa214('0x1'));var moment=require(_0xa214('0x2'));var BPromise=require(_0xa214('0x3'));var rs=require(_0xa214('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa214('0x5'))['db'];var utils=require(_0xa214('0x6'));var logger=require(_0xa214('0x7'))(_0xa214('0x8'));var config=require(_0xa214('0x9'));var jayson=require(_0xa214('0xa'));var client=jayson[_0xa214('0xb')][_0xa214('0xc')]({'port':0x232a});config[_0xa214('0xd')]=_[_0xa214('0xe')](config['redis'],{'host':_0xa214('0xf'),'port':0x18eb});var socket=require(_0xa214('0x10'))(new Redis(config[_0xa214('0xd')]));require(_0xa214('0x11'))['register'](socket);function respondWithRpcPromise(_0x4ad71d,_0x5c71e6,_0x3bbb0c){return new BPromise(function(_0x1a5524,_0x895b2f){return client[_0xa214('0x12')](_0x4ad71d,_0x3bbb0c)[_0xa214('0x13')](function(_0x13fba7){logger[_0xa214('0x14')](_0xa214('0x15'),_0x5c71e6,'request\x20sent');logger[_0xa214('0x16')](_0xa214('0x17'),_0x5c71e6,_0xa214('0x18'),JSON[_0xa214('0x19')](_0x13fba7));if(_0x13fba7[_0xa214('0x1a')]){if(_0x13fba7[_0xa214('0x1a')]['code']===0x1f4){logger[_0xa214('0x1a')](_0xa214('0x15'),_0x5c71e6,_0x13fba7[_0xa214('0x1a')][_0xa214('0x1b')]);return _0x895b2f(_0x13fba7[_0xa214('0x1a')]['message']);}logger[_0xa214('0x1a')]('Team,\x20%s,\x20%s',_0x5c71e6,_0x13fba7['error'][_0xa214('0x1b')]);return _0x1a5524(_0x13fba7['error'][_0xa214('0x1b')]);}else{logger['info'](_0xa214('0x15'),_0x5c71e6,_0xa214('0x18'));_0x1a5524(_0x13fba7[_0xa214('0x1c')]['message']);}})[_0xa214('0x1d')](function(_0x1ff405){logger[_0xa214('0x1a')](_0xa214('0x15'),_0x5c71e6,_0x1ff405);_0x895b2f(_0x1ff405);});});} \ No newline at end of file +var _0x2ff1=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','../../mysqldb'];(function(_0x117bdb,_0x44a377){var _0x14cffa=function(_0x424bd9){while(--_0x424bd9){_0x117bdb['push'](_0x117bdb['shift']());}};_0x14cffa(++_0x44a377);}(_0x2ff1,0x64));var _0x12ff=function(_0x4f3b8b,_0x152233){_0x4f3b8b=_0x4f3b8b-0x0;var _0x17ac35=_0x2ff1[_0x4f3b8b];return _0x17ac35;};'use strict';var _=require(_0x12ff('0x0'));var util=require('util');var moment=require(_0x12ff('0x1'));var BPromise=require(_0x12ff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x12ff('0x3'))['db'];var utils=require(_0x12ff('0x4'));var logger=require('../../config/logger')(_0x12ff('0x5'));var config=require(_0x12ff('0x6'));var jayson=require(_0x12ff('0x7'));var client=jayson[_0x12ff('0x8')][_0x12ff('0x9')]({'port':0x232a});config[_0x12ff('0xa')]=_['defaults'](config[_0x12ff('0xa')],{'host':_0x12ff('0xb'),'port':0x18eb});var socket=require(_0x12ff('0xc'))(new Redis(config[_0x12ff('0xa')]));require('./team.socket')[_0x12ff('0xd')](socket);function respondWithRpcPromise(_0xb50c2a,_0x1cda38,_0x1e1760){return new BPromise(function(_0x39f8bd,_0x5ca93b){return client[_0x12ff('0xe')](_0xb50c2a,_0x1e1760)[_0x12ff('0xf')](function(_0x5ad78a){logger[_0x12ff('0x10')](_0x12ff('0x11'),_0x1cda38,_0x12ff('0x12'));logger[_0x12ff('0x13')](_0x12ff('0x14'),_0x1cda38,_0x12ff('0x12'),JSON[_0x12ff('0x15')](_0x5ad78a));if(_0x5ad78a[_0x12ff('0x16')]){if(_0x5ad78a['error'][_0x12ff('0x17')]===0x1f4){logger[_0x12ff('0x16')](_0x12ff('0x11'),_0x1cda38,_0x5ad78a[_0x12ff('0x16')][_0x12ff('0x18')]);return _0x5ca93b(_0x5ad78a[_0x12ff('0x16')][_0x12ff('0x18')]);}logger[_0x12ff('0x16')](_0x12ff('0x11'),_0x1cda38,_0x5ad78a[_0x12ff('0x16')][_0x12ff('0x18')]);return _0x39f8bd(_0x5ad78a[_0x12ff('0x16')][_0x12ff('0x18')]);}else{logger[_0x12ff('0x10')](_0x12ff('0x11'),_0x1cda38,_0x12ff('0x12'));_0x39f8bd(_0x5ad78a[_0x12ff('0x19')][_0x12ff('0x18')]);}})['catch'](function(_0x5c12cd){logger[_0x12ff('0x16')]('Team,\x20%s,\x20%s',_0x1cda38,_0x5c12cd);_0x5ca93b(_0x5c12cd);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index e339001..96342bb 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 _0xd2f5=['length','team:','./team.events','remove','emit','removeListener','register'];(function(_0x258b2f,_0x16706c){var _0x4798a1=function(_0x127db8){while(--_0x127db8){_0x258b2f['push'](_0x258b2f['shift']());}};_0x4798a1(++_0x16706c);}(_0xd2f5,0x144));var _0x5d2f=function(_0x2654b3,_0xfc640b){_0x2654b3=_0x2654b3-0x0;var _0x49123b=_0xd2f5[_0x2654b3];return _0x49123b;};'use strict';var TeamEvents=require(_0x5d2f('0x0'));var events=['save',_0x5d2f('0x1'),'update'];function createListener(_0x2a7bb2,_0x4b9d79){return function(_0x784b59){_0x4b9d79[_0x5d2f('0x2')](_0x2a7bb2,_0x784b59);};}function removeListener(_0x102911,_0xc7102b){return function(){TeamEvents[_0x5d2f('0x3')](_0x102911,_0xc7102b);};}exports[_0x5d2f('0x4')]=function(_0x2392df){for(var _0x16e9fa=0x0,_0x4b2540=events[_0x5d2f('0x5')];_0x16e9fa<_0x4b2540;_0x16e9fa++){var _0x908c6=events[_0x16e9fa];var _0x1c8c59=createListener(_0x5d2f('0x6')+_0x908c6,_0x2392df);TeamEvents['on'](_0x908c6,_0x1c8c59);}}; \ No newline at end of file +var _0xbb67=['removeListener','register','team:','save','remove','update','emit'];(function(_0x57e887,_0x4f3627){var _0x2ac9df=function(_0x42ae65){while(--_0x42ae65){_0x57e887['push'](_0x57e887['shift']());}};_0x2ac9df(++_0x4f3627);}(_0xbb67,0x161));var _0x7bb6=function(_0x3c2a4b,_0x4fb1c1){_0x3c2a4b=_0x3c2a4b-0x0;var _0x36f4d9=_0xbb67[_0x3c2a4b];return _0x36f4d9;};'use strict';var TeamEvents=require('./team.events');var events=[_0x7bb6('0x0'),_0x7bb6('0x1'),_0x7bb6('0x2')];function createListener(_0x35c9ba,_0x2a1dcb){return function(_0x5b8771){_0x2a1dcb[_0x7bb6('0x3')](_0x35c9ba,_0x5b8771);};}function removeListener(_0x2c1ddb,_0x1f527c){return function(){TeamEvents[_0x7bb6('0x4')](_0x2c1ddb,_0x1f527c);};}exports[_0x7bb6('0x5')]=function(_0x139b0e){for(var _0x4b5232=0x0,_0x2a059b=events['length'];_0x4b5232<_0x2a059b;_0x4b5232++){var _0x45441a=events[_0x4b5232];var _0x15fb32=createListener(_0x7bb6('0x6')+_0x45441a,_0x139b0e);TeamEvents['on'](_0x45441a,_0x15fb32);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 76abdfa..493bcb7 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 _0x1c7c=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','show','post','create','put','/:id','update','destroy'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x1c7c,0x11e));var _0xc1c7=function(_0x8d13ed,_0x1449e5){_0x8d13ed=_0x8d13ed-0x0;var _0x5f0b91=_0x1c7c[_0x8d13ed];return _0x5f0b91;};'use strict';var multer=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var path=require(_0xc1c7('0x2'));var timeout=require(_0xc1c7('0x3'));var express=require('express');var router=express[_0xc1c7('0x4')]();var auth=require(_0xc1c7('0x5'));var interaction=require(_0xc1c7('0x6'));var config=require(_0xc1c7('0x7'));var controller=require(_0xc1c7('0x8'));router[_0xc1c7('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc1c7('0x9')]('/:id',auth[_0xc1c7('0xa')](),controller[_0xc1c7('0xb')]);router[_0xc1c7('0xc')]('/',auth[_0xc1c7('0xa')](),controller[_0xc1c7('0xd')]);router[_0xc1c7('0xe')](_0xc1c7('0xf'),auth[_0xc1c7('0xa')](),controller[_0xc1c7('0x10')]);router['delete'](_0xc1c7('0xf'),auth[_0xc1c7('0xa')](),controller[_0xc1c7('0x11')]);module[_0xc1c7('0x12')]=router; \ No newline at end of file +var _0xfded=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./template.controller','get','isAuthenticated','index','/:id','post','create'];(function(_0x5a11bf,_0x4041a9){var _0x30a90c=function(_0x46a35a){while(--_0x46a35a){_0x5a11bf['push'](_0x5a11bf['shift']());}};_0x30a90c(++_0x4041a9);}(_0xfded,0xd2));var _0xdfde=function(_0x36e0e9,_0x138073){_0x36e0e9=_0x36e0e9-0x0;var _0x4591f5=_0xfded[_0x36e0e9];return _0x4591f5;};'use strict';var multer=require(_0xdfde('0x0'));var util=require(_0xdfde('0x1'));var path=require(_0xdfde('0x2'));var timeout=require(_0xdfde('0x3'));var express=require('express');var router=express[_0xdfde('0x4')]();var auth=require(_0xdfde('0x5'));var interaction=require(_0xdfde('0x6'));var config=require('../../config/environment');var controller=require(_0xdfde('0x7'));router[_0xdfde('0x8')]('/',auth[_0xdfde('0x9')](),controller[_0xdfde('0xa')]);router[_0xdfde('0x8')](_0xdfde('0xb'),auth[_0xdfde('0x9')](),controller['show']);router[_0xdfde('0xc')]('/',auth['isAuthenticated'](),controller[_0xdfde('0xd')]);router['put'](_0xdfde('0xb'),auth[_0xdfde('0x9')](),controller['update']);router['delete'](_0xdfde('0xb'),auth['isAuthenticated'](),controller[_0xdfde('0xe')]);module[_0xdfde('0xf')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 75579ed..81af848 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 _0x0f95=['TEXT','sequelize','exports','STRING'];(function(_0x15a3d3,_0x1fe368){var _0x1fa778=function(_0x3ad80a){while(--_0x3ad80a){_0x15a3d3['push'](_0x15a3d3['shift']());}};_0x1fa778(++_0x1fe368);}(_0x0f95,0x125));var _0x50f9=function(_0x193e28,_0x3dac1d){_0x193e28=_0x193e28-0x0;var _0x20ef59=_0x0f95[_0x193e28];return _0x20ef59;};'use strict';var Sequelize=require(_0x50f9('0x0'));module[_0x50f9('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x50f9('0x2')]},'html':{'type':Sequelize[_0x50f9('0x3')]}}; \ No newline at end of file +var _0xbb2d=['sequelize','STRING','TEXT'];(function(_0x458ba0,_0x47e4d9){var _0x59efd2=function(_0x35b760){while(--_0x35b760){_0x458ba0['push'](_0x458ba0['shift']());}};_0x59efd2(++_0x47e4d9);}(_0xbb2d,0x87));var _0xdbb2=function(_0x350343,_0x256f69){_0x350343=_0x350343-0x0;var _0x9afc1c=_0xbb2d[_0x350343];return _0x9afc1c;};'use strict';var Sequelize=require(_0xdbb2('0x0'));module['exports']={'name':{'type':Sequelize[_0xdbb2('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xdbb2('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 6fdfedf..bd1d485 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 _0x8ef5=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Templates','error','stack','name','index','map','Template','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','find','html-pdf','eml-format','rimraf'];(function(_0x2edfbf,_0x5f0e97){var _0x22560e=function(_0x4f66a7){while(--_0x4f66a7){_0x2edfbf['push'](_0x2edfbf['shift']());}};_0x22560e(++_0x5f0e97);}(_0x8ef5,0xed));var _0x58ef=function(_0x52b146,_0x30570d){_0x52b146=_0x52b146-0x0;var _0x245c8e=_0x8ef5[_0x52b146];return _0x245c8e;};'use strict';var pdf=require(_0x58ef('0x0'));var emlformat=require(_0x58ef('0x1'));var rimraf=require(_0x58ef('0x2'));var zipdir=require(_0x58ef('0x3'));var jsonpatch=require(_0x58ef('0x4'));var rp=require('request-promise');var moment=require(_0x58ef('0x5'));var BPromise=require(_0x58ef('0x6'));var Mustache=require(_0x58ef('0x7'));var util=require(_0x58ef('0x8'));var path=require(_0x58ef('0x9'));var sox=require(_0x58ef('0xa'));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(_0x58ef('0xb'));var deskjs=require(_0x58ef('0xc'));var toCsv=require(_0x58ef('0xd'));var querystring=require('querystring');var Papa=require(_0x58ef('0xe'));var Redis=require('ioredis');var authService=require(_0x58ef('0xf'));var qs=require(_0x58ef('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x58ef('0x11'));var logger=require(_0x58ef('0x12'))(_0x58ef('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x58ef('0x14'))['db'];function respondWithStatusCode(_0x51aea2,_0x492abe){_0x492abe=_0x492abe||0xcc;return function(_0x317b2a){if(_0x317b2a){return _0x51aea2[_0x58ef('0x15')](_0x492abe);}return _0x51aea2[_0x58ef('0x16')](_0x492abe)[_0x58ef('0x17')]();};}function respondWithResult(_0x2896fa,_0x1ee1c2){_0x1ee1c2=_0x1ee1c2||0xc8;return function(_0x4ea678){if(_0x4ea678){return _0x2896fa['status'](_0x1ee1c2)[_0x58ef('0x18')](_0x4ea678);}};}function respondWithFilteredResult(_0x347d02,_0x28e7dd){return function(_0x62ecf2){if(_0x62ecf2){var _0x34dfbe=_0x62ecf2[_0x58ef('0x19')],_0x4e117d=_0x28e7dd['offset'],_0x5bfb2e=_0x28e7dd[_0x58ef('0x1a')]+_0x28e7dd[_0x58ef('0x1b')],_0x53b356;if(_0x5bfb2e>=_0x34dfbe){_0x5bfb2e=_0x34dfbe;_0x53b356=0xc8;}else{_0x53b356=0xce;}_0x347d02[_0x58ef('0x16')](_0x53b356);return _0x347d02[_0x58ef('0x1c')](_0x58ef('0x1d'),_0x4e117d+'-'+_0x5bfb2e+'/'+_0x34dfbe)['json'](_0x62ecf2);}return null;};}function patchUpdates(_0x3d820e){return function(_0x4be0e6){try{jsonpatch[_0x58ef('0x1e')](_0x4be0e6,_0x3d820e,!![]);}catch(_0x39442d){return BPromise[_0x58ef('0x1f')](_0x39442d);}return _0x4be0e6[_0x58ef('0x20')]();};}function saveUpdates(_0x5caa1e,_0x2ab392){return function(_0x2b4438){if(_0x2b4438){return _0x2b4438[_0x58ef('0x21')](_0x5caa1e)[_0x58ef('0x22')](function(_0x4549da){return _0x4549da;});}return null;};}function removeEntity(_0x1fb031,_0x28eaee){return function(_0x3adcbd){if(_0x3adcbd){return _0x3adcbd[_0x58ef('0x23')]()['then'](function(){var _0x5f11ce=_0x3adcbd[_0x58ef('0x24')]({'plain':!![]});var _0x4f270f=_0x58ef('0x25');return db['UserProfileResource'][_0x58ef('0x23')]({'where':{'type':_0x4f270f,'resourceId':_0x5f11ce['id']}})[_0x58ef('0x22')](function(){return _0x3adcbd;});})[_0x58ef('0x22')](function(){_0x1fb031[_0x58ef('0x16')](0xcc)[_0x58ef('0x17')]();});}};}function handleEntityNotFound(_0x44b0ee,_0x59360a){return function(_0x3a3f1d){if(!_0x3a3f1d){_0x44b0ee[_0x58ef('0x15')](0x194);}return _0x3a3f1d;};}function handleError(_0x1d0afb,_0x4dc6bd){_0x4dc6bd=_0x4dc6bd||0x1f4;return function(_0x5f4569){logger[_0x58ef('0x26')](_0x5f4569[_0x58ef('0x27')]);if(_0x5f4569[_0x58ef('0x28')]){delete _0x5f4569[_0x58ef('0x28')];}_0x1d0afb[_0x58ef('0x16')](_0x4dc6bd)['send'](_0x5f4569);};}exports[_0x58ef('0x29')]=function(_0x14d1ab,_0x210d40){var _0x186d68={},_0x2a6666={},_0x1971b0={'count':0x0,'rows':[]};var _0x43fc3e=_[_0x58ef('0x2a')](db[_0x58ef('0x2b')][_0x58ef('0x2c')],function(_0x555c9f){return{'name':_0x555c9f[_0x58ef('0x2d')],'type':_0x555c9f[_0x58ef('0x2e')][_0x58ef('0x2f')]};});_0x2a6666['model']=_[_0x58ef('0x2a')](_0x43fc3e,_0x58ef('0x28'));_0x2a6666[_0x58ef('0x30')]=_[_0x58ef('0x31')](_0x14d1ab[_0x58ef('0x30')]);_0x2a6666[_0x58ef('0x32')]=_[_0x58ef('0x33')](_0x2a6666[_0x58ef('0x34')],_0x2a6666[_0x58ef('0x30')]);_0x186d68[_0x58ef('0x35')]=_['intersection'](_0x2a6666[_0x58ef('0x34')],qs['fields'](_0x14d1ab[_0x58ef('0x30')][_0x58ef('0x36')]));_0x186d68[_0x58ef('0x35')]=_0x186d68[_0x58ef('0x35')][_0x58ef('0x37')]?_0x186d68['attributes']:_0x2a6666['model'];if(!_0x14d1ab[_0x58ef('0x30')]['hasOwnProperty'](_0x58ef('0x38'))){_0x186d68[_0x58ef('0x1b')]=qs[_0x58ef('0x1b')](_0x14d1ab[_0x58ef('0x30')]['limit']);_0x186d68[_0x58ef('0x1a')]=qs['offset'](_0x14d1ab['query'][_0x58ef('0x1a')]);}_0x186d68[_0x58ef('0x39')]=qs[_0x58ef('0x3a')](_0x14d1ab[_0x58ef('0x30')][_0x58ef('0x3a')]);_0x186d68[_0x58ef('0x3b')]=qs['filters'](_['pick'](_0x14d1ab[_0x58ef('0x30')],_0x2a6666[_0x58ef('0x32')]));if(_0x14d1ab['query'][_0x58ef('0x3c')]){_0x186d68[_0x58ef('0x3b')]=_[_0x58ef('0x3d')](_0x186d68['where'],{'$or':_[_0x58ef('0x2a')](_0x43fc3e,function(_0x1e4d61){if(_0x1e4d61['type']!==_0x58ef('0x3e')){var _0x38e444={};_0x38e444[_0x1e4d61['name']]={'$like':'%'+_0x14d1ab[_0x58ef('0x30')][_0x58ef('0x3c')]+'%'};return _0x38e444;}})});}_0x186d68=_['merge']({},_0x186d68,_0x14d1ab[_0x58ef('0x3f')]);var _0x28bfce={'where':_0x186d68[_0x58ef('0x3b')]};return db[_0x58ef('0x2b')][_0x58ef('0x19')](_0x28bfce)['then'](function(_0x4b30ce){_0x1971b0[_0x58ef('0x19')]=_0x4b30ce;if(_0x14d1ab['query'][_0x58ef('0x40')]){_0x186d68[_0x58ef('0x41')]=[{'all':!![]}];}return db[_0x58ef('0x2b')][_0x58ef('0x42')](_0x186d68);})[_0x58ef('0x22')](function(_0x229954){_0x1971b0[_0x58ef('0x43')]=_0x229954;return _0x1971b0;})[_0x58ef('0x22')](respondWithFilteredResult(_0x210d40,_0x186d68))[_0x58ef('0x44')](handleError(_0x210d40,null));};exports[_0x58ef('0x45')]=function(_0x151a7b,_0x3a29c7){var _0x46a538={'raw':!![],'where':{'id':_0x151a7b[_0x58ef('0x46')]['id']}},_0x54dde3={};_0x54dde3['model']=_['keys'](db['Template'][_0x58ef('0x2c')]);_0x54dde3[_0x58ef('0x30')]=_[_0x58ef('0x31')](_0x151a7b[_0x58ef('0x30')]);_0x54dde3[_0x58ef('0x32')]=_[_0x58ef('0x33')](_0x54dde3[_0x58ef('0x34')],_0x54dde3[_0x58ef('0x30')]);_0x46a538[_0x58ef('0x35')]=_[_0x58ef('0x33')](_0x54dde3[_0x58ef('0x34')],qs['fields'](_0x151a7b[_0x58ef('0x30')]['fields']));_0x46a538[_0x58ef('0x35')]=_0x46a538[_0x58ef('0x35')][_0x58ef('0x37')]?_0x46a538[_0x58ef('0x35')]:_0x54dde3['model'];if(_0x151a7b[_0x58ef('0x30')][_0x58ef('0x40')]){_0x46a538[_0x58ef('0x41')]=[{'all':!![]}];}_0x46a538=_[_0x58ef('0x3d')]({},_0x46a538,_0x151a7b[_0x58ef('0x3f')]);return db['Template']['find'](_0x46a538)[_0x58ef('0x22')](handleEntityNotFound(_0x3a29c7,null))[_0x58ef('0x22')](respondWithResult(_0x3a29c7,null))[_0x58ef('0x44')](handleError(_0x3a29c7,null));};exports[_0x58ef('0x47')]=function(_0x703dbc,_0x328fff){return db[_0x58ef('0x2b')][_0x58ef('0x47')](_0x703dbc[_0x58ef('0x48')],{})[_0x58ef('0x22')](function(_0x58388e){var _0x2f9160=_0x703dbc[_0x58ef('0x49')][_0x58ef('0x24')]({'plain':!![]});if(!_0x2f9160)throw new Error(_0x58ef('0x4a'));if(_0x2f9160['role']===_0x58ef('0x49')){var _0x542e97=_0x58388e['get']({'plain':!![]});var _0x423b5c='Templates';return db[_0x58ef('0x4b')]['find']({'where':{'name':_0x423b5c,'userProfileId':_0x2f9160[_0x58ef('0x4c')]},'raw':!![]})[_0x58ef('0x22')](function(_0x315a0c){if(_0x315a0c&&_0x315a0c[_0x58ef('0x4d')]===0x0){return db[_0x58ef('0x4e')]['create']({'name':_0x542e97[_0x58ef('0x28')],'resourceId':_0x542e97['id'],'type':_0x315a0c[_0x58ef('0x28')],'sectionId':_0x315a0c['id']},{})['then'](function(){return _0x58388e;});}else{return _0x58388e;}})[_0x58ef('0x44')](function(_0x98415){logger[_0x58ef('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x98415);throw _0x98415;});}return _0x58388e;})[_0x58ef('0x22')](respondWithResult(_0x328fff,0xc9))['catch'](handleError(_0x328fff,null));};exports['update']=function(_0x574b5f,_0x34e81a){if(_0x574b5f[_0x58ef('0x48')]['id']){delete _0x574b5f[_0x58ef('0x48')]['id'];}return db[_0x58ef('0x2b')][_0x58ef('0x4f')]({'where':{'id':_0x574b5f[_0x58ef('0x46')]['id']}})[_0x58ef('0x22')](handleEntityNotFound(_0x34e81a,null))[_0x58ef('0x22')](saveUpdates(_0x574b5f['body'],null))[_0x58ef('0x22')](respondWithResult(_0x34e81a,null))[_0x58ef('0x44')](handleError(_0x34e81a,null));};exports[_0x58ef('0x23')]=function(_0x578fc8,_0x42a84d){return db['Template']['find']({'where':{'id':_0x578fc8['params']['id']}})[_0x58ef('0x22')](handleEntityNotFound(_0x42a84d,null))[_0x58ef('0x22')](removeEntity(_0x42a84d,null))['catch'](handleError(_0x42a84d,null));}; \ No newline at end of file +var _0xa695=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','count','set','Content-Range','apply','save','then','destroy','get','Templates','sendStatus','stack','name','send','index','map','Template','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','sort','where','pick','filters','filter','merge','options','includeAll','include','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource'];(function(_0x63b6d3,_0x13c87d){var _0x41a70c=function(_0x33021d){while(--_0x33021d){_0x63b6d3['push'](_0x63b6d3['shift']());}};_0x41a70c(++_0x13c87d);}(_0xa695,0x1e9));var _0x5a69=function(_0x58e455,_0x37def5){_0x58e455=_0x58e455-0x0;var _0x11f425=_0xa695[_0x58e455];return _0x11f425;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5a69('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5a69('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5a69('0x2'));var Mustache=require(_0x5a69('0x3'));var util=require(_0x5a69('0x4'));var path=require(_0x5a69('0x5'));var sox=require(_0x5a69('0x6'));var csv=require(_0x5a69('0x7'));var ejs=require(_0x5a69('0x8'));var fs=require('fs');var _=require(_0x5a69('0x9'));var squel=require('squel');var crypto=require(_0x5a69('0xa'));var jsforce=require(_0x5a69('0xb'));var deskjs=require(_0x5a69('0xc'));var toCsv=require(_0x5a69('0x7'));var querystring=require(_0x5a69('0xd'));var Papa=require(_0x5a69('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5a69('0xf'));var as=require(_0x5a69('0x10'));var hardwareService=require(_0x5a69('0x11'));var logger=require(_0x5a69('0x12'))(_0x5a69('0x13'));var utils=require(_0x5a69('0x14'));var config=require(_0x5a69('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18a723,_0x4ce07d){_0x4ce07d=_0x4ce07d||0xcc;return function(_0x3f517f){if(_0x3f517f){return _0x18a723['sendStatus'](_0x4ce07d);}return _0x18a723['status'](_0x4ce07d)[_0x5a69('0x16')]();};}function respondWithResult(_0x22f3b1,_0x55f264){_0x55f264=_0x55f264||0xc8;return function(_0x174580){if(_0x174580){return _0x22f3b1[_0x5a69('0x17')](_0x55f264)[_0x5a69('0x18')](_0x174580);}};}function respondWithFilteredResult(_0x5834b8,_0x20ede8){return function(_0x4c8139){if(_0x4c8139){var _0x5f3ec0=_0x4c8139[_0x5a69('0x19')],_0x2f5669=_0x20ede8['offset'],_0x55f31f=_0x20ede8['offset']+_0x20ede8['limit'],_0x15664c;if(_0x55f31f>=_0x5f3ec0){_0x55f31f=_0x5f3ec0;_0x15664c=0xc8;}else{_0x15664c=0xce;}_0x5834b8['status'](_0x15664c);return _0x5834b8[_0x5a69('0x1a')](_0x5a69('0x1b'),_0x2f5669+'-'+_0x55f31f+'/'+_0x5f3ec0)['json'](_0x4c8139);}return null;};}function patchUpdates(_0x16672a){return function(_0x3f493e){try{jsonpatch[_0x5a69('0x1c')](_0x3f493e,_0x16672a,!![]);}catch(_0x4ed74c){return BPromise['reject'](_0x4ed74c);}return _0x3f493e[_0x5a69('0x1d')]();};}function saveUpdates(_0x1603bb,_0x33eaad){return function(_0x528f4a){if(_0x528f4a){return _0x528f4a['update'](_0x1603bb)[_0x5a69('0x1e')](function(_0x2594a5){return _0x2594a5;});}return null;};}function removeEntity(_0x2d006d,_0x3f27eb){return function(_0x44dbf1){if(_0x44dbf1){return _0x44dbf1[_0x5a69('0x1f')]()[_0x5a69('0x1e')](function(){var _0x26914d=_0x44dbf1[_0x5a69('0x20')]({'plain':!![]});var _0x1ff2b1=_0x5a69('0x21');return db['UserProfileResource']['destroy']({'where':{'type':_0x1ff2b1,'resourceId':_0x26914d['id']}})[_0x5a69('0x1e')](function(){return _0x44dbf1;});})[_0x5a69('0x1e')](function(){_0x2d006d['status'](0xcc)[_0x5a69('0x16')]();});}};}function handleEntityNotFound(_0x3163ae,_0x58734f){return function(_0x429649){if(!_0x429649){_0x3163ae[_0x5a69('0x22')](0x194);}return _0x429649;};}function handleError(_0x102bfe,_0x2fd5ed){_0x2fd5ed=_0x2fd5ed||0x1f4;return function(_0x36d340){logger['error'](_0x36d340[_0x5a69('0x23')]);if(_0x36d340[_0x5a69('0x24')]){delete _0x36d340[_0x5a69('0x24')];}_0x102bfe['status'](_0x2fd5ed)[_0x5a69('0x25')](_0x36d340);};}exports[_0x5a69('0x26')]=function(_0x47cab7,_0x40943d){var _0x48ad33={},_0x56320e={},_0x5b6aab={'count':0x0,'rows':[]};var _0x559254=_[_0x5a69('0x27')](db[_0x5a69('0x28')][_0x5a69('0x29')],function(_0xdb6e1b){return{'name':_0xdb6e1b[_0x5a69('0x2a')],'type':_0xdb6e1b[_0x5a69('0x2b')]['key']};});_0x56320e[_0x5a69('0x2c')]=_[_0x5a69('0x27')](_0x559254,'name');_0x56320e['query']=_['keys'](_0x47cab7[_0x5a69('0x2d')]);_0x56320e['filters']=_[_0x5a69('0x2e')](_0x56320e[_0x5a69('0x2c')],_0x56320e[_0x5a69('0x2d')]);_0x48ad33[_0x5a69('0x2f')]=_['intersection'](_0x56320e[_0x5a69('0x2c')],qs[_0x5a69('0x30')](_0x47cab7[_0x5a69('0x2d')][_0x5a69('0x30')]));_0x48ad33[_0x5a69('0x2f')]=_0x48ad33[_0x5a69('0x2f')][_0x5a69('0x31')]?_0x48ad33['attributes']:_0x56320e[_0x5a69('0x2c')];if(!_0x47cab7[_0x5a69('0x2d')][_0x5a69('0x32')](_0x5a69('0x33'))){_0x48ad33[_0x5a69('0x34')]=qs[_0x5a69('0x34')](_0x47cab7[_0x5a69('0x2d')][_0x5a69('0x34')]);_0x48ad33[_0x5a69('0x35')]=qs[_0x5a69('0x35')](_0x47cab7[_0x5a69('0x2d')][_0x5a69('0x35')]);}_0x48ad33['order']=qs['sort'](_0x47cab7[_0x5a69('0x2d')][_0x5a69('0x36')]);_0x48ad33[_0x5a69('0x37')]=qs['filters'](_[_0x5a69('0x38')](_0x47cab7[_0x5a69('0x2d')],_0x56320e[_0x5a69('0x39')]));if(_0x47cab7[_0x5a69('0x2d')][_0x5a69('0x3a')]){_0x48ad33[_0x5a69('0x37')]=_[_0x5a69('0x3b')](_0x48ad33[_0x5a69('0x37')],{'$or':_[_0x5a69('0x27')](_0x559254,function(_0x281754){if(_0x281754[_0x5a69('0x2b')]!=='VIRTUAL'){var _0xb9866a={};_0xb9866a[_0x281754[_0x5a69('0x24')]]={'$like':'%'+_0x47cab7[_0x5a69('0x2d')]['filter']+'%'};return _0xb9866a;}})});}_0x48ad33=_[_0x5a69('0x3b')]({},_0x48ad33,_0x47cab7[_0x5a69('0x3c')]);var _0x3ad40e={'where':_0x48ad33[_0x5a69('0x37')]};return db[_0x5a69('0x28')]['count'](_0x3ad40e)['then'](function(_0x53db4c){_0x5b6aab[_0x5a69('0x19')]=_0x53db4c;if(_0x47cab7[_0x5a69('0x2d')][_0x5a69('0x3d')]){_0x48ad33[_0x5a69('0x3e')]=[{'all':!![]}];}return db[_0x5a69('0x28')]['findAll'](_0x48ad33);})['then'](function(_0x1f578a){_0x5b6aab[_0x5a69('0x3f')]=_0x1f578a;return _0x5b6aab;})[_0x5a69('0x1e')](respondWithFilteredResult(_0x40943d,_0x48ad33))[_0x5a69('0x40')](handleError(_0x40943d,null));};exports[_0x5a69('0x41')]=function(_0x449c02,_0x229bbd){var _0x4a4977={'raw':!![],'where':{'id':_0x449c02[_0x5a69('0x42')]['id']}},_0x4f675f={};_0x4f675f[_0x5a69('0x2c')]=_['keys'](db[_0x5a69('0x28')]['rawAttributes']);_0x4f675f['query']=_[_0x5a69('0x43')](_0x449c02[_0x5a69('0x2d')]);_0x4f675f[_0x5a69('0x39')]=_['intersection'](_0x4f675f[_0x5a69('0x2c')],_0x4f675f['query']);_0x4a4977['attributes']=_[_0x5a69('0x2e')](_0x4f675f['model'],qs[_0x5a69('0x30')](_0x449c02['query'][_0x5a69('0x30')]));_0x4a4977[_0x5a69('0x2f')]=_0x4a4977['attributes'][_0x5a69('0x31')]?_0x4a4977[_0x5a69('0x2f')]:_0x4f675f[_0x5a69('0x2c')];if(_0x449c02['query'][_0x5a69('0x3d')]){_0x4a4977[_0x5a69('0x3e')]=[{'all':!![]}];}_0x4a4977=_[_0x5a69('0x3b')]({},_0x4a4977,_0x449c02['options']);return db[_0x5a69('0x28')][_0x5a69('0x44')](_0x4a4977)[_0x5a69('0x1e')](handleEntityNotFound(_0x229bbd,null))[_0x5a69('0x1e')](respondWithResult(_0x229bbd,null))[_0x5a69('0x40')](handleError(_0x229bbd,null));};exports[_0x5a69('0x45')]=function(_0xa0e085,_0x21d3c8){return db['Template'][_0x5a69('0x45')](_0xa0e085[_0x5a69('0x46')],{})[_0x5a69('0x1e')](function(_0xa36dcb){var _0x2bb0ad=_0xa0e085[_0x5a69('0x47')][_0x5a69('0x20')]({'plain':!![]});if(!_0x2bb0ad)throw new Error(_0x5a69('0x48'));if(_0x2bb0ad[_0x5a69('0x49')]===_0x5a69('0x47')){var _0xc7165e=_0xa36dcb[_0x5a69('0x20')]({'plain':!![]});var _0x933f35=_0x5a69('0x21');return db[_0x5a69('0x4a')][_0x5a69('0x44')]({'where':{'name':_0x933f35,'userProfileId':_0x2bb0ad[_0x5a69('0x4b')]},'raw':!![]})[_0x5a69('0x1e')](function(_0x5acc83){if(_0x5acc83&&_0x5acc83[_0x5a69('0x4c')]===0x0){return db[_0x5a69('0x4d')][_0x5a69('0x45')]({'name':_0xc7165e[_0x5a69('0x24')],'resourceId':_0xc7165e['id'],'type':_0x5acc83[_0x5a69('0x24')],'sectionId':_0x5acc83['id']},{})[_0x5a69('0x1e')](function(){return _0xa36dcb;});}else{return _0xa36dcb;}})[_0x5a69('0x40')](function(_0x1e0416){logger[_0x5a69('0x4e')](_0x5a69('0x4f'),_0x1e0416);throw _0x1e0416;});}return _0xa36dcb;})[_0x5a69('0x1e')](respondWithResult(_0x21d3c8,0xc9))[_0x5a69('0x40')](handleError(_0x21d3c8,null));};exports[_0x5a69('0x50')]=function(_0x3c75d5,_0x5d8a3c){if(_0x3c75d5[_0x5a69('0x46')]['id']){delete _0x3c75d5[_0x5a69('0x46')]['id'];}return db[_0x5a69('0x28')][_0x5a69('0x44')]({'where':{'id':_0x3c75d5[_0x5a69('0x42')]['id']}})[_0x5a69('0x1e')](handleEntityNotFound(_0x5d8a3c,null))['then'](saveUpdates(_0x3c75d5[_0x5a69('0x46')],null))[_0x5a69('0x1e')](respondWithResult(_0x5d8a3c,null))[_0x5a69('0x40')](handleError(_0x5d8a3c,null));};exports[_0x5a69('0x1f')]=function(_0x571b5b,_0x5490dc){return db['Template'][_0x5a69('0x44')]({'where':{'id':_0x571b5b[_0x5a69('0x42')]['id']}})[_0x5a69('0x1e')](handleEntityNotFound(_0x5490dc,null))[_0x5a69('0x1e')](removeEntity(_0x5490dc,null))[_0x5a69('0x40')](handleError(_0x5490dc,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 2dd36ae..1c1ffbf 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 _0x18c6=['lodash','util','api','moment','request-promise','path','rimraf','./template.attributes','define','Template','tools_templates'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x18c6,0xfd));var _0x618c=function(_0x4a7f27,_0x1ae54d){_0x4a7f27=_0x4a7f27-0x0;var _0x3d2190=_0x18c6[_0x4a7f27];return _0x3d2190;};'use strict';var _=require(_0x618c('0x0'));var util=require(_0x618c('0x1'));var logger=require('../../config/logger')(_0x618c('0x2'));var moment=require(_0x618c('0x3'));var BPromise=require('bluebird');var rp=require(_0x618c('0x4'));var fs=require('fs');var path=require(_0x618c('0x5'));var rimraf=require(_0x618c('0x6'));var config=require('../../config/environment');var attributes=require(_0x618c('0x7'));module['exports']=function(_0x17f271,_0x51f49a){return _0x17f271[_0x618c('0x8')](_0x618c('0x9'),attributes,{'tableName':_0x618c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1edf=['api','moment','bluebird','request-promise','rimraf','./template.attributes','exports','define','Template','tools_templates','util','../../config/logger'];(function(_0x2fc087,_0x72b243){var _0x37bfeb=function(_0x3980fa){while(--_0x3980fa){_0x2fc087['push'](_0x2fc087['shift']());}};_0x37bfeb(++_0x72b243);}(_0x1edf,0x1a2));var _0xf1ed=function(_0x44a4f3,_0x4ed8ab){_0x44a4f3=_0x44a4f3-0x0;var _0x819350=_0x1edf[_0x44a4f3];return _0x819350;};'use strict';var _=require('lodash');var util=require(_0xf1ed('0x0'));var logger=require(_0xf1ed('0x1'))(_0xf1ed('0x2'));var moment=require(_0xf1ed('0x3'));var BPromise=require(_0xf1ed('0x4'));var rp=require(_0xf1ed('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf1ed('0x6'));var config=require('../../config/environment');var attributes=require(_0xf1ed('0x7'));module[_0xf1ed('0x8')]=function(_0x4006bf,_0x4bc8a2){return _0x4006bf[_0xf1ed('0x9')](_0xf1ed('0xa'),attributes,{'tableName':_0xf1ed('0xb'),'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 7fa7f6a..b34d8f7 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 _0xed10=['Template,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetTemplate','findAll','options','where','attributes','limit','include','map','model','stringify','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','Template,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xed10,0x109));var _0x0ed1=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xed10[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x0ed1('0x0'));var util=require('util');var moment=require(_0x0ed1('0x1'));var BPromise=require('bluebird');var rs=require(_0x0ed1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0ed1('0x3'))['db'];var utils=require(_0x0ed1('0x4'));var logger=require(_0x0ed1('0x5'))(_0x0ed1('0x6'));var config=require('../../config/environment');var jayson=require(_0x0ed1('0x7'));var client=jayson['client'][_0x0ed1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x360ab8,_0x465f07,_0xfa9598){return new BPromise(function(_0x19ce6e,_0xd003e7){return client[_0x0ed1('0x9')](_0x360ab8,_0xfa9598)[_0x0ed1('0xa')](function(_0x5ca392){logger['info'](_0x0ed1('0xb'),_0x465f07,_0x0ed1('0xc'));logger[_0x0ed1('0xd')](_0x0ed1('0xe'),_0x465f07,_0x0ed1('0xc'),JSON['stringify'](_0x5ca392));if(_0x5ca392[_0x0ed1('0xf')]){if(_0x5ca392[_0x0ed1('0xf')][_0x0ed1('0x10')]===0x1f4){logger['error'](_0x0ed1('0xb'),_0x465f07,_0x5ca392['error']['message']);return _0xd003e7(_0x5ca392[_0x0ed1('0xf')][_0x0ed1('0x11')]);}logger[_0x0ed1('0xf')]('Template,\x20%s,\x20%s',_0x465f07,_0x5ca392[_0x0ed1('0xf')][_0x0ed1('0x11')]);return _0x19ce6e(_0x5ca392[_0x0ed1('0xf')][_0x0ed1('0x11')]);}else{logger[_0x0ed1('0x12')]('Template,\x20%s,\x20%s',_0x465f07,_0x0ed1('0xc'));_0x19ce6e(_0x5ca392[_0x0ed1('0x13')][_0x0ed1('0x11')]);}})[_0x0ed1('0x14')](function(_0x225f9b){logger[_0x0ed1('0xf')](_0x0ed1('0xb'),_0x465f07,_0x225f9b);_0xd003e7(_0x225f9b);});});}exports[_0x0ed1('0x15')]=function(_0x24bed7){var _0xbe1399=this;return new Promise(function(_0x196997,_0x5bc335){return db['Template'][_0x0ed1('0x16')]({'raw':_0x24bed7['options']?_0x24bed7[_0x0ed1('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x24bed7[_0x0ed1('0x17')]?_0x24bed7[_0x0ed1('0x17')][_0x0ed1('0x18')]||null:null,'attributes':_0x24bed7['options']?_0x24bed7['options'][_0x0ed1('0x19')]||null:null,'limit':_0x24bed7[_0x0ed1('0x17')]?_0x24bed7[_0x0ed1('0x17')][_0x0ed1('0x1a')]||null:null,'include':_0x24bed7[_0x0ed1('0x17')]?_0x24bed7[_0x0ed1('0x17')][_0x0ed1('0x1b')]?_[_0x0ed1('0x1c')](_0x24bed7['options']['include'],function(_0x4bc420){return{'model':db[_0x4bc420[_0x0ed1('0x1d')]],'as':_0x4bc420['as'],'attributes':_0x4bc420['attributes'],'include':_0x4bc420[_0x0ed1('0x1b')]?_[_0x0ed1('0x1c')](_0x4bc420['include'],function(_0x494f63){return{'model':db[_0x494f63[_0x0ed1('0x1d')]],'as':_0x494f63['as'],'attributes':_0x494f63[_0x0ed1('0x19')],'include':_0x494f63[_0x0ed1('0x1b')]?_['map'](_0x494f63[_0x0ed1('0x1b')],function(_0x2678d2){return{'model':db[_0x2678d2[_0x0ed1('0x1d')]],'as':_0x2678d2['as'],'attributes':_0x2678d2[_0x0ed1('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23dbfb){logger[_0x0ed1('0x12')](_0x0ed1('0x15'),_0x24bed7);logger[_0x0ed1('0xd')](_0x0ed1('0x15'),_0x24bed7,JSON[_0x0ed1('0x1e')](_0x23dbfb));_0x196997(_0x23dbfb);})[_0x0ed1('0x14')](function(_0x801ec2){logger[_0x0ed1('0xf')](_0x0ed1('0x15'),_0x801ec2[_0x0ed1('0x11')],_0x24bed7);_0x5bc335(_0xbe1399['error'](0x1f4,_0x801ec2[_0x0ed1('0x11')]));});});}; \ No newline at end of file +var _0x7dd6=['../../config/environment','jayson/promise','client','http','then','Template,\x20%s,\x20%s','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','catch','GetTemplate','findAll','options','attributes','include','map','model','debug','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x6d90b9,_0x53e65c){var _0x357ea9=function(_0xd361e7){while(--_0xd361e7){_0x6d90b9['push'](_0x6d90b9['shift']());}};_0x357ea9(++_0x53e65c);}(_0x7dd6,0xed));var _0x67dd=function(_0x11e05d,_0x3a4491){_0x11e05d=_0x11e05d-0x0;var _0x335588=_0x7dd6[_0x11e05d];return _0x335588;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x67dd('0x0'));var BPromise=require('bluebird');var rs=require(_0x67dd('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67dd('0x2'))['db'];var utils=require(_0x67dd('0x3'));var logger=require(_0x67dd('0x4'))(_0x67dd('0x5'));var config=require(_0x67dd('0x6'));var jayson=require(_0x67dd('0x7'));var client=jayson[_0x67dd('0x8')][_0x67dd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4dab06,_0x26c06b,_0x16ff6a){return new BPromise(function(_0x45eeb8,_0x2c6dfe){return client['request'](_0x4dab06,_0x16ff6a)[_0x67dd('0xa')](function(_0xb4196c){logger['info'](_0x67dd('0xb'),_0x26c06b,'request\x20sent');logger['debug'](_0x67dd('0xc'),_0x26c06b,'request\x20sent',JSON[_0x67dd('0xd')](_0xb4196c));if(_0xb4196c[_0x67dd('0xe')]){if(_0xb4196c[_0x67dd('0xe')]['code']===0x1f4){logger[_0x67dd('0xe')](_0x67dd('0xb'),_0x26c06b,_0xb4196c[_0x67dd('0xe')][_0x67dd('0xf')]);return _0x2c6dfe(_0xb4196c[_0x67dd('0xe')][_0x67dd('0xf')]);}logger[_0x67dd('0xe')]('Template,\x20%s,\x20%s',_0x26c06b,_0xb4196c['error'][_0x67dd('0xf')]);return _0x45eeb8(_0xb4196c['error'][_0x67dd('0xf')]);}else{logger[_0x67dd('0x10')]('Template,\x20%s,\x20%s',_0x26c06b,_0x67dd('0x11'));_0x45eeb8(_0xb4196c['result'][_0x67dd('0xf')]);}})[_0x67dd('0x12')](function(_0x40e27b){logger[_0x67dd('0xe')](_0x67dd('0xb'),_0x26c06b,_0x40e27b);_0x2c6dfe(_0x40e27b);});});}exports[_0x67dd('0x13')]=function(_0x464300){var _0x3aa968=this;return new Promise(function(_0x3d4609,_0x40cafe){return db['Template'][_0x67dd('0x14')]({'raw':_0x464300[_0x67dd('0x15')]?_0x464300[_0x67dd('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x464300[_0x67dd('0x15')]?_0x464300['options']['where']||null:null,'attributes':_0x464300[_0x67dd('0x15')]?_0x464300[_0x67dd('0x15')][_0x67dd('0x16')]||null:null,'limit':_0x464300['options']?_0x464300['options']['limit']||null:null,'include':_0x464300[_0x67dd('0x15')]?_0x464300['options'][_0x67dd('0x17')]?_[_0x67dd('0x18')](_0x464300['options'][_0x67dd('0x17')],function(_0x203553){return{'model':db[_0x203553[_0x67dd('0x19')]],'as':_0x203553['as'],'attributes':_0x203553['attributes'],'include':_0x203553[_0x67dd('0x17')]?_[_0x67dd('0x18')](_0x203553['include'],function(_0x4aa885){return{'model':db[_0x4aa885[_0x67dd('0x19')]],'as':_0x4aa885['as'],'attributes':_0x4aa885[_0x67dd('0x16')],'include':_0x4aa885[_0x67dd('0x17')]?_[_0x67dd('0x18')](_0x4aa885[_0x67dd('0x17')],function(_0x5824d0){return{'model':db[_0x5824d0[_0x67dd('0x19')]],'as':_0x5824d0['as'],'attributes':_0x5824d0[_0x67dd('0x16')]};}):[]};}):[]};}):[]:[]})[_0x67dd('0xa')](function(_0x580b0a){logger['info'](_0x67dd('0x13'),_0x464300);logger[_0x67dd('0x1a')](_0x67dd('0x13'),_0x464300,JSON[_0x67dd('0xd')](_0x580b0a));_0x3d4609(_0x580b0a);})['catch'](function(_0x887838){logger[_0x67dd('0xe')](_0x67dd('0x13'),_0x887838[_0x67dd('0xf')],_0x464300);_0x40cafe(_0x3aa968[_0x67dd('0xe')](0x1f4,_0x887838[_0x67dd('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 70f403f..3d2298c 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 _0x3706=['/:id/any_conditions','/:id/actions','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','getAllConditions','getAnyConditions','create','post','/:id/all_conditions'];(function(_0x2605dc,_0x50cf7e){var _0x4568c9=function(_0x447f7c){while(--_0x447f7c){_0x2605dc['push'](_0x2605dc['shift']());}};_0x4568c9(++_0x50cf7e);}(_0x3706,0x101));var _0x6370=function(_0x3f4891,_0x4e6f62){_0x3f4891=_0x3f4891-0x0;var _0x54f2d8=_0x3706[_0x3f4891];return _0x54f2d8;};'use strict';var multer=require(_0x6370('0x0'));var util=require(_0x6370('0x1'));var path=require('path');var timeout=require(_0x6370('0x2'));var express=require(_0x6370('0x3'));var router=express[_0x6370('0x4')]();var auth=require(_0x6370('0x5'));var interaction=require(_0x6370('0x6'));var config=require(_0x6370('0x7'));var controller=require(_0x6370('0x8'));router[_0x6370('0x9')]('/',auth[_0x6370('0xa')](),controller[_0x6370('0xb')]);router[_0x6370('0x9')](_0x6370('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x6370('0x9')]('/:id/all_conditions',auth[_0x6370('0xa')](),controller[_0x6370('0xd')]);router[_0x6370('0x9')]('/:id/any_conditions',auth[_0x6370('0xa')](),controller[_0x6370('0xe')]);router['get']('/:id/actions',auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth[_0x6370('0xa')](),controller[_0x6370('0xf')]);router[_0x6370('0x10')](_0x6370('0x11'),auth[_0x6370('0xa')](),controller['addAllCondition']);router[_0x6370('0x10')](_0x6370('0x12'),auth['isAuthenticated'](),controller['addAnyCondition']);router[_0x6370('0x10')](_0x6370('0x13'),auth[_0x6370('0xa')](),controller['addAction']);router[_0x6370('0x14')](_0x6370('0xc'),auth[_0x6370('0xa')](),controller[_0x6370('0x15')]);router[_0x6370('0x16')](_0x6370('0xc'),auth[_0x6370('0xa')](),controller[_0x6370('0x17')]);module[_0x6370('0x18')]=router; \ No newline at end of file +var _0x8c85=['/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','addAllCondition','addAnyCondition','put','/:id','update','destroy','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','./trigger.controller','get','index','isAuthenticated','show','/:id/all_conditions','getAllConditions'];(function(_0x3253f3,_0x1c57d8){var _0x598c26=function(_0x4c1251){while(--_0x4c1251){_0x3253f3['push'](_0x3253f3['shift']());}};_0x598c26(++_0x1c57d8);}(_0x8c85,0x6c));var _0x58c8=function(_0x23157e,_0x3b0d54){_0x23157e=_0x23157e-0x0;var _0x2ad027=_0x8c85[_0x23157e];return _0x2ad027;};'use strict';var multer=require(_0x58c8('0x0'));var util=require(_0x58c8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x58c8('0x2'));var router=express['Router']();var auth=require(_0x58c8('0x3'));var interaction=require(_0x58c8('0x4'));var config=require('../../config/environment');var controller=require(_0x58c8('0x5'));router[_0x58c8('0x6')]('/',auth['isAuthenticated'](),controller[_0x58c8('0x7')]);router[_0x58c8('0x6')]('/:id',auth[_0x58c8('0x8')](),controller[_0x58c8('0x9')]);router[_0x58c8('0x6')](_0x58c8('0xa'),auth[_0x58c8('0x8')](),controller[_0x58c8('0xb')]);router[_0x58c8('0x6')](_0x58c8('0xc'),auth[_0x58c8('0x8')](),controller[_0x58c8('0xd')]);router['get'](_0x58c8('0xe'),auth[_0x58c8('0x8')](),controller[_0x58c8('0xf')]);router[_0x58c8('0x10')]('/',auth[_0x58c8('0x8')](),controller['create']);router[_0x58c8('0x10')](_0x58c8('0xa'),auth['isAuthenticated'](),controller[_0x58c8('0x11')]);router[_0x58c8('0x10')](_0x58c8('0xc'),auth[_0x58c8('0x8')](),controller[_0x58c8('0x12')]);router['post'](_0x58c8('0xe'),auth[_0x58c8('0x8')](),controller['addAction']);router[_0x58c8('0x13')](_0x58c8('0x14'),auth[_0x58c8('0x8')](),controller[_0x58c8('0x15')]);router['delete'](_0x58c8('0x14'),auth[_0x58c8('0x8')](),controller[_0x58c8('0x16')]);module[_0x58c8('0x17')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index ca16ea0..ac12861 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 _0x3a97=['BOOLEAN','sequelize','exports','STRING'];(function(_0x3a3655,_0x8e8ce5){var _0x4f6afc=function(_0x383f61){while(--_0x383f61){_0x3a3655['push'](_0x3a3655['shift']());}};_0x4f6afc(++_0x8e8ce5);}(_0x3a97,0x179));var _0x73a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a97[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x73a9('0x0'));module[_0x73a9('0x1')]={'name':{'type':Sequelize[_0x73a9('0x2')]},'channel':{'type':Sequelize[_0x73a9('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x73a9('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x7690=['sequelize','STRING'];(function(_0x2cf7eb,_0x588ce3){var _0x110230=function(_0x2286af){while(--_0x2286af){_0x2cf7eb['push'](_0x2cf7eb['shift']());}};_0x110230(++_0x588ce3);}(_0x7690,0x186));var _0x0769=function(_0xa4affe,_0x1d1398){_0xa4affe=_0xa4affe-0x0;var _0x402bab=_0x7690[_0xa4affe];return _0x402bab;};'use strict';var Sequelize=require(_0x0769('0x0'));module['exports']={'name':{'type':Sequelize[_0x0769('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0769('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 6d0ef57..5b3364d 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 _0xbb3b=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','then','get','Triggers','UserProfileResource','end','error','stack','name','index','rawAttributes','fieldName','type','model','map','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','Trigger','include','rows','catch','show','keys','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','params','TriggerAllId','Condition','TriggerAnyId','order','getAllConditions','hasOwnProperty','getAnyConditions','addAction','Action','getActions','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','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','../../config/logger'];(function(_0x1aff98,_0x500f41){var _0x4c8670=function(_0x2b2623){while(--_0x2b2623){_0x1aff98['push'](_0x1aff98['shift']());}};_0x4c8670(++_0x500f41);}(_0xbb3b,0x1b6));var _0xbbb3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb3b[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbbb3('0x0'));var rimraf=require(_0xbbb3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbbb3('0x2'));var rp=require('request-promise');var moment=require(_0xbbb3('0x3'));var BPromise=require(_0xbbb3('0x4'));var Mustache=require(_0xbbb3('0x5'));var util=require('util');var path=require(_0xbbb3('0x6'));var sox=require(_0xbbb3('0x7'));var csv=require(_0xbbb3('0x8'));var ejs=require(_0xbbb3('0x9'));var fs=require('fs');var _=require(_0xbbb3('0xa'));var squel=require(_0xbbb3('0xb'));var crypto=require(_0xbbb3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbbb3('0xd'));var toCsv=require(_0xbbb3('0x8'));var querystring=require(_0xbbb3('0xe'));var Papa=require(_0xbbb3('0xf'));var Redis=require(_0xbbb3('0x10'));var authService=require(_0xbbb3('0x11'));var qs=require(_0xbbb3('0x12'));var as=require(_0xbbb3('0x13'));var hardwareService=require(_0xbbb3('0x14'));var logger=require(_0xbbb3('0x15'))(_0xbbb3('0x16'));var utils=require(_0xbbb3('0x17'));var config=require(_0xbbb3('0x18'));var db=require(_0xbbb3('0x19'))['db'];function respondWithStatusCode(_0x42397e,_0x2686d9){_0x2686d9=_0x2686d9||0xcc;return function(_0x320e6c){if(_0x320e6c){return _0x42397e[_0xbbb3('0x1a')](_0x2686d9);}return _0x42397e['status'](_0x2686d9)['end']();};}function respondWithResult(_0x56b566,_0x2a43aa){_0x2a43aa=_0x2a43aa||0xc8;return function(_0x43f42f){if(_0x43f42f){return _0x56b566[_0xbbb3('0x1b')](_0x2a43aa)['json'](_0x43f42f);}};}function respondWithFilteredResult(_0x32f36a,_0x59a6e6){return function(_0x186051){if(_0x186051){var _0x496ada=_0x186051[_0xbbb3('0x1c')],_0x525b94=_0x59a6e6[_0xbbb3('0x1d')],_0xe0e853=_0x59a6e6[_0xbbb3('0x1d')]+_0x59a6e6[_0xbbb3('0x1e')],_0x15eec1;if(_0xe0e853>=_0x496ada){_0xe0e853=_0x496ada;_0x15eec1=0xc8;}else{_0x15eec1=0xce;}_0x32f36a['status'](_0x15eec1);return _0x32f36a[_0xbbb3('0x1f')](_0xbbb3('0x20'),_0x525b94+'-'+_0xe0e853+'/'+_0x496ada)[_0xbbb3('0x21')](_0x186051);}return null;};}function patchUpdates(_0xed9e96){return function(_0x2adfad){try{jsonpatch[_0xbbb3('0x22')](_0x2adfad,_0xed9e96,!![]);}catch(_0x5c6561){return BPromise[_0xbbb3('0x23')](_0x5c6561);}return _0x2adfad['save']();};}function saveUpdates(_0x1c7ead,_0x5216f4){return function(_0x32477e){if(_0x32477e){return _0x32477e[_0xbbb3('0x24')](_0x1c7ead)['then'](function(_0x5597b5){return _0x5597b5;});}return null;};}function removeEntity(_0x40adb9,_0x327558){return function(_0x17a6c2){if(_0x17a6c2){return _0x17a6c2[_0xbbb3('0x25')]()[_0xbbb3('0x26')](function(){var _0x55222d=_0x17a6c2[_0xbbb3('0x27')]({'plain':!![]});var _0x2f64ee=_0xbbb3('0x28');return db[_0xbbb3('0x29')]['destroy']({'where':{'type':_0x2f64ee,'resourceId':_0x55222d['id']}})[_0xbbb3('0x26')](function(){return _0x17a6c2;});})[_0xbbb3('0x26')](function(){_0x40adb9[_0xbbb3('0x1b')](0xcc)[_0xbbb3('0x2a')]();});}};}function handleEntityNotFound(_0x4a8a72,_0x5e8388){return function(_0x42d845){if(!_0x42d845){_0x4a8a72[_0xbbb3('0x1a')](0x194);}return _0x42d845;};}function handleError(_0x4cf299,_0xabfeae){_0xabfeae=_0xabfeae||0x1f4;return function(_0x1d2e3a){logger[_0xbbb3('0x2b')](_0x1d2e3a[_0xbbb3('0x2c')]);if(_0x1d2e3a[_0xbbb3('0x2d')]){delete _0x1d2e3a[_0xbbb3('0x2d')];}_0x4cf299[_0xbbb3('0x1b')](_0xabfeae)['send'](_0x1d2e3a);};}exports[_0xbbb3('0x2e')]=function(_0x432d93,_0x1a95b0){var _0x446153={},_0x3cad1d={},_0x3e04d0={'count':0x0,'rows':[]};var _0x5e47e3=_['map'](db['Trigger'][_0xbbb3('0x2f')],function(_0x1c2375){return{'name':_0x1c2375[_0xbbb3('0x30')],'type':_0x1c2375[_0xbbb3('0x31')]['key']};});_0x3cad1d[_0xbbb3('0x32')]=_[_0xbbb3('0x33')](_0x5e47e3,_0xbbb3('0x2d'));_0x3cad1d[_0xbbb3('0x34')]=_['keys'](_0x432d93[_0xbbb3('0x34')]);_0x3cad1d[_0xbbb3('0x35')]=_[_0xbbb3('0x36')](_0x3cad1d[_0xbbb3('0x32')],_0x3cad1d[_0xbbb3('0x34')]);_0x446153['attributes']=_[_0xbbb3('0x36')](_0x3cad1d[_0xbbb3('0x32')],qs['fields'](_0x432d93['query'][_0xbbb3('0x37')]));_0x446153[_0xbbb3('0x38')]=_0x446153[_0xbbb3('0x38')][_0xbbb3('0x39')]?_0x446153['attributes']:_0x3cad1d[_0xbbb3('0x32')];if(!_0x432d93[_0xbbb3('0x34')]['hasOwnProperty'](_0xbbb3('0x3a'))){_0x446153[_0xbbb3('0x1e')]=qs['limit'](_0x432d93['query'][_0xbbb3('0x1e')]);_0x446153[_0xbbb3('0x1d')]=qs['offset'](_0x432d93['query']['offset']);}_0x446153['order']=qs['sort'](_0x432d93['query'][_0xbbb3('0x3b')]);_0x446153[_0xbbb3('0x3c')]=qs[_0xbbb3('0x35')](_[_0xbbb3('0x3d')](_0x432d93[_0xbbb3('0x34')],_0x3cad1d[_0xbbb3('0x35')]));if(_0x432d93[_0xbbb3('0x34')][_0xbbb3('0x3e')]){_0x446153[_0xbbb3('0x3c')]=_[_0xbbb3('0x3f')](_0x446153[_0xbbb3('0x3c')],{'$or':_[_0xbbb3('0x33')](_0x5e47e3,function(_0x4de361){if(_0x4de361[_0xbbb3('0x31')]!=='VIRTUAL'){var _0x197086={};_0x197086[_0x4de361[_0xbbb3('0x2d')]]={'$like':'%'+_0x432d93[_0xbbb3('0x34')][_0xbbb3('0x3e')]+'%'};return _0x197086;}})});}_0x446153=_['merge']({},_0x446153,_0x432d93['options']);var _0x3b8d6e={'where':_0x446153['where']};return db[_0xbbb3('0x40')]['count'](_0x3b8d6e)[_0xbbb3('0x26')](function(_0x166ac5){_0x3e04d0[_0xbbb3('0x1c')]=_0x166ac5;if(_0x432d93['query']['includeAll']){_0x446153[_0xbbb3('0x41')]=[{'all':!![]}];}return db[_0xbbb3('0x40')]['findAll'](_0x446153);})[_0xbbb3('0x26')](function(_0x45ca49){_0x3e04d0[_0xbbb3('0x42')]=_0x45ca49;return _0x3e04d0;})['then'](respondWithFilteredResult(_0x1a95b0,_0x446153))[_0xbbb3('0x43')](handleError(_0x1a95b0,null));};exports[_0xbbb3('0x44')]=function(_0x49f20d,_0x46d718){var _0x15176e={'raw':![],'where':{'id':_0x49f20d['params']['id']}},_0xd34788={};_0xd34788[_0xbbb3('0x32')]=_[_0xbbb3('0x45')](db[_0xbbb3('0x40')][_0xbbb3('0x2f')]);_0xd34788['query']=_[_0xbbb3('0x45')](_0x49f20d[_0xbbb3('0x34')]);_0xd34788[_0xbbb3('0x35')]=_[_0xbbb3('0x36')](_0xd34788[_0xbbb3('0x32')],_0xd34788['query']);_0x15176e[_0xbbb3('0x38')]=_[_0xbbb3('0x36')](_0xd34788[_0xbbb3('0x32')],qs[_0xbbb3('0x37')](_0x49f20d[_0xbbb3('0x34')][_0xbbb3('0x37')]));_0x15176e[_0xbbb3('0x38')]=_0x15176e[_0xbbb3('0x38')][_0xbbb3('0x39')]?_0x15176e['attributes']:_0xd34788[_0xbbb3('0x32')];if(_0x49f20d['query'][_0xbbb3('0x46')]){_0x15176e['include']=[{'all':!![]}];}_0x15176e=_['merge']({},_0x15176e,_0x49f20d[_0xbbb3('0x47')]);return db[_0xbbb3('0x40')][_0xbbb3('0x48')](_0x15176e)[_0xbbb3('0x26')](handleEntityNotFound(_0x46d718,null))[_0xbbb3('0x26')](respondWithResult(_0x46d718,null))[_0xbbb3('0x43')](handleError(_0x46d718,null));};exports[_0xbbb3('0x49')]=function(_0x4cd64e,_0x567c24){return db[_0xbbb3('0x40')][_0xbbb3('0x49')](_0x4cd64e[_0xbbb3('0x4a')],{})[_0xbbb3('0x26')](function(_0xd5575){var _0x5221dc=_0x4cd64e[_0xbbb3('0x4b')][_0xbbb3('0x27')]({'plain':!![]});if(!_0x5221dc)throw new Error(_0xbbb3('0x4c'));if(_0x5221dc[_0xbbb3('0x4d')]===_0xbbb3('0x4b')){var _0x430f07=_0xd5575[_0xbbb3('0x27')]({'plain':!![]});var _0x48119c=_0xbbb3('0x28');return db['UserProfileSection'][_0xbbb3('0x48')]({'where':{'name':_0x48119c,'userProfileId':_0x5221dc[_0xbbb3('0x4e')]},'raw':!![]})['then'](function(_0x3f8d24){if(_0x3f8d24&&_0x3f8d24[_0xbbb3('0x4f')]===0x0){return db[_0xbbb3('0x29')][_0xbbb3('0x49')]({'name':_0x430f07[_0xbbb3('0x2d')],'resourceId':_0x430f07['id'],'type':_0x3f8d24[_0xbbb3('0x2d')],'sectionId':_0x3f8d24['id']},{})['then'](function(){return _0xd5575;});}else{return _0xd5575;}})['catch'](function(_0x45a393){logger[_0xbbb3('0x2b')](_0xbbb3('0x50'),_0x45a393);throw _0x45a393;});}return _0xd5575;})['then'](respondWithResult(_0x567c24,0xc9))['catch'](handleError(_0x567c24,null));};exports[_0xbbb3('0x24')]=function(_0x504403,_0x1a15b6){if(_0x504403[_0xbbb3('0x4a')]['id']){delete _0x504403['body']['id'];}return db[_0xbbb3('0x40')][_0xbbb3('0x48')]({'where':{'id':_0x504403[_0xbbb3('0x51')]['id']}})[_0xbbb3('0x26')](handleEntityNotFound(_0x1a15b6,null))[_0xbbb3('0x26')](saveUpdates(_0x504403[_0xbbb3('0x4a')],null))[_0xbbb3('0x26')](respondWithResult(_0x1a15b6,null))[_0xbbb3('0x43')](handleError(_0x1a15b6,null));};exports['destroy']=function(_0x5a79ff,_0x3c3a90){return db[_0xbbb3('0x40')][_0xbbb3('0x48')]({'where':{'id':_0x5a79ff[_0xbbb3('0x51')]['id']}})['then'](handleEntityNotFound(_0x3c3a90,null))[_0xbbb3('0x26')](removeEntity(_0x3c3a90,null))[_0xbbb3('0x43')](handleError(_0x3c3a90,null));};exports['addAllCondition']=function(_0x12051b,_0x424c45,_0x358bc5){if(_0x12051b[_0xbbb3('0x4a')]['id']){delete _0x12051b[_0xbbb3('0x4a')]['id'];}return db[_0xbbb3('0x40')][_0xbbb3('0x48')]({'where':{'id':_0x12051b[_0xbbb3('0x51')]['id']}})[_0xbbb3('0x26')](handleEntityNotFound(_0x424c45,null))[_0xbbb3('0x26')](function(_0x3a656){if(_0x3a656){_0x12051b[_0xbbb3('0x4a')][_0xbbb3('0x52')]=_0x3a656['id'];return db[_0xbbb3('0x53')][_0xbbb3('0x49')](_0x12051b['body']);}})[_0xbbb3('0x26')](respondWithResult(_0x424c45,null))[_0xbbb3('0x43')](handleError(_0x424c45,null));};exports['addAnyCondition']=function(_0x2641ea,_0x4f9494,_0x41b441){if(_0x2641ea['body']['id']){delete _0x2641ea[_0xbbb3('0x4a')]['id'];}return db[_0xbbb3('0x40')][_0xbbb3('0x48')]({'where':{'id':_0x2641ea['params']['id']}})['then'](handleEntityNotFound(_0x4f9494,null))[_0xbbb3('0x26')](function(_0x3b3ef3){if(_0x3b3ef3){_0x2641ea[_0xbbb3('0x4a')][_0xbbb3('0x54')]=_0x3b3ef3['id'];return db['Condition']['create'](_0x2641ea[_0xbbb3('0x4a')]);}})[_0xbbb3('0x26')](respondWithResult(_0x4f9494,null))[_0xbbb3('0x43')](handleError(_0x4f9494,null));};exports['getAllConditions']=function(_0x591313,_0xd26021,_0x16bc95){var _0x5678d9={};var _0x4159f4={};var _0x57a6b1;var _0x18d75d;return db[_0xbbb3('0x40')]['findOne']({'where':{'id':_0x591313['params']['id']}})[_0xbbb3('0x26')](handleEntityNotFound(_0xd26021,null))[_0xbbb3('0x26')](function(_0xe5486d){if(_0xe5486d){_0x57a6b1=_0xe5486d;_0x4159f4[_0xbbb3('0x32')]=_[_0xbbb3('0x45')](db['Condition'][_0xbbb3('0x2f')]);_0x4159f4[_0xbbb3('0x34')]=_[_0xbbb3('0x45')](_0x591313[_0xbbb3('0x34')]);_0x4159f4['filters']=_[_0xbbb3('0x36')](_0x4159f4[_0xbbb3('0x32')],_0x4159f4[_0xbbb3('0x34')]);_0x5678d9[_0xbbb3('0x38')]=_['intersection'](_0x4159f4[_0xbbb3('0x32')],qs[_0xbbb3('0x37')](_0x591313[_0xbbb3('0x34')]['fields']));_0x5678d9[_0xbbb3('0x38')]=_0x5678d9[_0xbbb3('0x38')][_0xbbb3('0x39')]?_0x5678d9[_0xbbb3('0x38')]:_0x4159f4[_0xbbb3('0x32')];_0x5678d9[_0xbbb3('0x55')]=qs[_0xbbb3('0x3b')](_0x591313[_0xbbb3('0x34')][_0xbbb3('0x3b')]);_0x5678d9[_0xbbb3('0x3c')]=qs[_0xbbb3('0x35')](_[_0xbbb3('0x3d')](_0x591313[_0xbbb3('0x34')],_0x4159f4[_0xbbb3('0x35')]));if(_0x591313['query'][_0xbbb3('0x3e')]){_0x5678d9[_0xbbb3('0x3c')]=_[_0xbbb3('0x3f')](_0x5678d9['where'],{'$or':_[_0xbbb3('0x33')](_0x5678d9[_0xbbb3('0x38')],function(_0x59bc8b){var _0x5e103f={};_0x5e103f[_0x59bc8b]={'$like':'%'+_0x591313['query'][_0xbbb3('0x3e')]+'%'};return _0x5e103f;})});}_0x5678d9=_[_0xbbb3('0x3f')]({},_0x5678d9,_0x591313[_0xbbb3('0x47')]);return _0x57a6b1[_0xbbb3('0x56')](_0x5678d9);}})[_0xbbb3('0x26')](function(_0x390e9a){if(_0x390e9a){_0x18d75d=_0x390e9a[_0xbbb3('0x39')];if(!_0x591313['query'][_0xbbb3('0x57')](_0xbbb3('0x3a'))){_0x5678d9[_0xbbb3('0x1e')]=qs[_0xbbb3('0x1e')](_0x591313['query'][_0xbbb3('0x1e')]);_0x5678d9['offset']=qs['offset'](_0x591313[_0xbbb3('0x34')]['offset']);}return _0x57a6b1[_0xbbb3('0x56')](_0x5678d9);}})[_0xbbb3('0x26')](function(_0x4e73cc){if(_0x4e73cc){return _0x4e73cc?{'count':_0x18d75d,'rows':_0x4e73cc}:null;}})['then'](respondWithResult(_0xd26021,null))['catch'](handleError(_0xd26021,null));};exports[_0xbbb3('0x58')]=function(_0x446e9c,_0x5eccee,_0xb1737e){var _0x136d14={};var _0x489b59={};var _0x316815;var _0x44cdf4;return db['Trigger']['findOne']({'where':{'id':_0x446e9c[_0xbbb3('0x51')]['id']}})[_0xbbb3('0x26')](handleEntityNotFound(_0x5eccee,null))[_0xbbb3('0x26')](function(_0x854d42){if(_0x854d42){_0x316815=_0x854d42;_0x489b59[_0xbbb3('0x32')]=_[_0xbbb3('0x45')](db[_0xbbb3('0x53')]['rawAttributes']);_0x489b59['query']=_[_0xbbb3('0x45')](_0x446e9c[_0xbbb3('0x34')]);_0x489b59['filters']=_[_0xbbb3('0x36')](_0x489b59['model'],_0x489b59['query']);_0x136d14[_0xbbb3('0x38')]=_[_0xbbb3('0x36')](_0x489b59['model'],qs[_0xbbb3('0x37')](_0x446e9c[_0xbbb3('0x34')][_0xbbb3('0x37')]));_0x136d14[_0xbbb3('0x38')]=_0x136d14[_0xbbb3('0x38')][_0xbbb3('0x39')]?_0x136d14[_0xbbb3('0x38')]:_0x489b59[_0xbbb3('0x32')];_0x136d14[_0xbbb3('0x55')]=qs[_0xbbb3('0x3b')](_0x446e9c[_0xbbb3('0x34')][_0xbbb3('0x3b')]);_0x136d14[_0xbbb3('0x3c')]=qs[_0xbbb3('0x35')](_[_0xbbb3('0x3d')](_0x446e9c[_0xbbb3('0x34')],_0x489b59['filters']));if(_0x446e9c[_0xbbb3('0x34')][_0xbbb3('0x3e')]){_0x136d14[_0xbbb3('0x3c')]=_['merge'](_0x136d14[_0xbbb3('0x3c')],{'$or':_['map'](_0x136d14[_0xbbb3('0x38')],function(_0x132ef0){var _0x2de6b8={};_0x2de6b8[_0x132ef0]={'$like':'%'+_0x446e9c['query'][_0xbbb3('0x3e')]+'%'};return _0x2de6b8;})});}_0x136d14=_[_0xbbb3('0x3f')]({},_0x136d14,_0x446e9c[_0xbbb3('0x47')]);return _0x316815[_0xbbb3('0x58')](_0x136d14);}})[_0xbbb3('0x26')](function(_0x320427){if(_0x320427){_0x44cdf4=_0x320427['length'];if(!_0x446e9c['query']['hasOwnProperty'](_0xbbb3('0x3a'))){_0x136d14[_0xbbb3('0x1e')]=qs[_0xbbb3('0x1e')](_0x446e9c[_0xbbb3('0x34')]['limit']);_0x136d14['offset']=qs[_0xbbb3('0x1d')](_0x446e9c[_0xbbb3('0x34')][_0xbbb3('0x1d')]);}return _0x316815['getAnyConditions'](_0x136d14);}})[_0xbbb3('0x26')](function(_0x3b77fb){if(_0x3b77fb){return _0x3b77fb?{'count':_0x44cdf4,'rows':_0x3b77fb}:null;}})[_0xbbb3('0x26')](respondWithResult(_0x5eccee,null))[_0xbbb3('0x43')](handleError(_0x5eccee,null));};exports[_0xbbb3('0x59')]=function(_0x345f48,_0x4ceaab,_0x85d27){if(_0x345f48[_0xbbb3('0x4a')]['id']){delete _0x345f48[_0xbbb3('0x4a')]['id'];}return db['Trigger'][_0xbbb3('0x48')]({'where':{'id':_0x345f48[_0xbbb3('0x51')]['id']}})[_0xbbb3('0x26')](handleEntityNotFound(_0x4ceaab,null))[_0xbbb3('0x26')](function(_0x253d11){if(_0x253d11){_0x345f48[_0xbbb3('0x4a')]['TriggerId']=_0x253d11['id'];return db[_0xbbb3('0x5a')][_0xbbb3('0x49')](_0x345f48[_0xbbb3('0x4a')]);}})[_0xbbb3('0x26')](respondWithResult(_0x4ceaab,null))[_0xbbb3('0x43')](handleError(_0x4ceaab,null));};exports['getActions']=function(_0x46a23d,_0xf6b7fd,_0x503458){var _0xb017b0={};var _0x3a30ba={};var _0x2d6f0e;var _0x28c174;return db[_0xbbb3('0x40')]['findOne']({'where':{'id':_0x46a23d[_0xbbb3('0x51')]['id']}})[_0xbbb3('0x26')](handleEntityNotFound(_0xf6b7fd,null))[_0xbbb3('0x26')](function(_0x27bbeb){if(_0x27bbeb){_0x2d6f0e=_0x27bbeb;_0x3a30ba[_0xbbb3('0x32')]=_[_0xbbb3('0x45')](db[_0xbbb3('0x5a')][_0xbbb3('0x2f')]);_0x3a30ba[_0xbbb3('0x34')]=_['keys'](_0x46a23d[_0xbbb3('0x34')]);_0x3a30ba['filters']=_[_0xbbb3('0x36')](_0x3a30ba[_0xbbb3('0x32')],_0x3a30ba[_0xbbb3('0x34')]);_0xb017b0[_0xbbb3('0x38')]=_[_0xbbb3('0x36')](_0x3a30ba['model'],qs[_0xbbb3('0x37')](_0x46a23d[_0xbbb3('0x34')][_0xbbb3('0x37')]));_0xb017b0[_0xbbb3('0x38')]=_0xb017b0[_0xbbb3('0x38')][_0xbbb3('0x39')]?_0xb017b0[_0xbbb3('0x38')]:_0x3a30ba['model'];_0xb017b0[_0xbbb3('0x55')]=qs['sort'](_0x46a23d[_0xbbb3('0x34')][_0xbbb3('0x3b')]);_0xb017b0[_0xbbb3('0x3c')]=qs[_0xbbb3('0x35')](_[_0xbbb3('0x3d')](_0x46a23d[_0xbbb3('0x34')],_0x3a30ba[_0xbbb3('0x35')]));if(_0x46a23d[_0xbbb3('0x34')][_0xbbb3('0x3e')]){_0xb017b0['where']=_[_0xbbb3('0x3f')](_0xb017b0['where'],{'$or':_[_0xbbb3('0x33')](_0xb017b0[_0xbbb3('0x38')],function(_0x4c307c){var _0x5578e4={};_0x5578e4[_0x4c307c]={'$like':'%'+_0x46a23d['query'][_0xbbb3('0x3e')]+'%'};return _0x5578e4;})});}_0xb017b0=_[_0xbbb3('0x3f')]({},_0xb017b0,_0x46a23d[_0xbbb3('0x47')]);return _0x2d6f0e['getActions'](_0xb017b0);}})[_0xbbb3('0x26')](function(_0x1dff65){if(_0x1dff65){_0x28c174=_0x1dff65[_0xbbb3('0x39')];if(!_0x46a23d[_0xbbb3('0x34')]['hasOwnProperty'](_0xbbb3('0x3a'))){_0xb017b0[_0xbbb3('0x1e')]=qs[_0xbbb3('0x1e')](_0x46a23d[_0xbbb3('0x34')][_0xbbb3('0x1e')]);_0xb017b0[_0xbbb3('0x1d')]=qs[_0xbbb3('0x1d')](_0x46a23d[_0xbbb3('0x34')][_0xbbb3('0x1d')]);}return _0x2d6f0e[_0xbbb3('0x5b')](_0xb017b0);}})[_0xbbb3('0x26')](function(_0x2f3b7e){if(_0x2f3b7e){return _0x2f3b7e?{'count':_0x28c174,'rows':_0x2f3b7e}:null;}})[_0xbbb3('0x26')](respondWithResult(_0xf6b7fd,null))[_0xbbb3('0x43')](handleError(_0xf6b7fd,null));}; \ No newline at end of file +var _0xe04a=['options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','role','user','Triggers','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','sort','getAllConditions','getAnyConditions','addAction','getActions','Action','html-pdf','rimraf','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','json','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','Trigger','fieldName','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','type','VIRTUAL','filter'];(function(_0x4617e7,_0x47f76f){var _0x45aeda=function(_0x38e4ae){while(--_0x38e4ae){_0x4617e7['push'](_0x4617e7['shift']());}};_0x45aeda(++_0x47f76f);}(_0xe04a,0x196));var _0xae04=function(_0x3ca318,_0x4cb00c){_0x3ca318=_0x3ca318-0x0;var _0x5f4864=_0xe04a[_0x3ca318];return _0x5f4864;};'use strict';var pdf=require(_0xae04('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xae04('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xae04('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xae04('0x3'));var util=require(_0xae04('0x4'));var path=require('path');var sox=require(_0xae04('0x5'));var csv=require(_0xae04('0x6'));var ejs=require(_0xae04('0x7'));var fs=require('fs');var _=require(_0xae04('0x8'));var squel=require(_0xae04('0x9'));var crypto=require(_0xae04('0xa'));var jsforce=require(_0xae04('0xb'));var deskjs=require(_0xae04('0xc'));var toCsv=require('to-csv');var querystring=require(_0xae04('0xd'));var Papa=require(_0xae04('0xe'));var Redis=require(_0xae04('0xf'));var authService=require(_0xae04('0x10'));var qs=require(_0xae04('0x11'));var as=require(_0xae04('0x12'));var hardwareService=require(_0xae04('0x13'));var logger=require('../../config/logger')(_0xae04('0x14'));var utils=require('../../config/utils');var config=require(_0xae04('0x15'));var db=require(_0xae04('0x16'))['db'];function respondWithStatusCode(_0x1c684f,_0x34a1ab){_0x34a1ab=_0x34a1ab||0xcc;return function(_0x5b8d85){if(_0x5b8d85){return _0x1c684f['sendStatus'](_0x34a1ab);}return _0x1c684f[_0xae04('0x17')](_0x34a1ab)[_0xae04('0x18')]();};}function respondWithResult(_0x1c49f3,_0x4f8d1a){_0x4f8d1a=_0x4f8d1a||0xc8;return function(_0x36b488){if(_0x36b488){return _0x1c49f3[_0xae04('0x17')](_0x4f8d1a)['json'](_0x36b488);}};}function respondWithFilteredResult(_0x6285be,_0x51e733){return function(_0x5b0ca9){if(_0x5b0ca9){var _0x3ccdf1=_0x5b0ca9[_0xae04('0x19')],_0x206edd=_0x51e733[_0xae04('0x1a')],_0xbfc86=_0x51e733[_0xae04('0x1a')]+_0x51e733[_0xae04('0x1b')],_0x177cbf;if(_0xbfc86>=_0x3ccdf1){_0xbfc86=_0x3ccdf1;_0x177cbf=0xc8;}else{_0x177cbf=0xce;}_0x6285be[_0xae04('0x17')](_0x177cbf);return _0x6285be[_0xae04('0x1c')]('Content-Range',_0x206edd+'-'+_0xbfc86+'/'+_0x3ccdf1)[_0xae04('0x1d')](_0x5b0ca9);}return null;};}function patchUpdates(_0x434ad6){return function(_0xc371d4){try{jsonpatch[_0xae04('0x1e')](_0xc371d4,_0x434ad6,!![]);}catch(_0x528c24){return BPromise[_0xae04('0x1f')](_0x528c24);}return _0xc371d4[_0xae04('0x20')]();};}function saveUpdates(_0x32973d,_0x2d7bd4){return function(_0x65fa8c){if(_0x65fa8c){return _0x65fa8c[_0xae04('0x21')](_0x32973d)[_0xae04('0x22')](function(_0x3fbb3a){return _0x3fbb3a;});}return null;};}function removeEntity(_0x32ea85,_0x1899a1){return function(_0x49d392){if(_0x49d392){return _0x49d392[_0xae04('0x23')]()[_0xae04('0x22')](function(){var _0x116fd7=_0x49d392[_0xae04('0x24')]({'plain':!![]});var _0x3f1851='Triggers';return db[_0xae04('0x25')]['destroy']({'where':{'type':_0x3f1851,'resourceId':_0x116fd7['id']}})['then'](function(){return _0x49d392;});})[_0xae04('0x22')](function(){_0x32ea85[_0xae04('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cc7de,_0x47f6f8){return function(_0x25c614){if(!_0x25c614){_0x2cc7de[_0xae04('0x26')](0x194);}return _0x25c614;};}function handleError(_0xec7cd7,_0x44f9f8){_0x44f9f8=_0x44f9f8||0x1f4;return function(_0x2dde65){logger[_0xae04('0x27')](_0x2dde65[_0xae04('0x28')]);if(_0x2dde65[_0xae04('0x29')]){delete _0x2dde65[_0xae04('0x29')];}_0xec7cd7[_0xae04('0x17')](_0x44f9f8)[_0xae04('0x2a')](_0x2dde65);};}exports[_0xae04('0x2b')]=function(_0x29214a,_0x4e3b29){var _0x2240d5={},_0x10a0db={},_0x50d0bc={'count':0x0,'rows':[]};var _0x248e07=_['map'](db[_0xae04('0x2c')]['rawAttributes'],function(_0x5f55a8){return{'name':_0x5f55a8[_0xae04('0x2d')],'type':_0x5f55a8['type']['key']};});_0x10a0db[_0xae04('0x2e')]=_[_0xae04('0x2f')](_0x248e07,_0xae04('0x29'));_0x10a0db['query']=_[_0xae04('0x30')](_0x29214a[_0xae04('0x31')]);_0x10a0db[_0xae04('0x32')]=_[_0xae04('0x33')](_0x10a0db[_0xae04('0x2e')],_0x10a0db[_0xae04('0x31')]);_0x2240d5['attributes']=_[_0xae04('0x33')](_0x10a0db[_0xae04('0x2e')],qs['fields'](_0x29214a[_0xae04('0x31')][_0xae04('0x34')]));_0x2240d5[_0xae04('0x35')]=_0x2240d5['attributes'][_0xae04('0x36')]?_0x2240d5[_0xae04('0x35')]:_0x10a0db[_0xae04('0x2e')];if(!_0x29214a[_0xae04('0x31')][_0xae04('0x37')](_0xae04('0x38'))){_0x2240d5['limit']=qs['limit'](_0x29214a[_0xae04('0x31')]['limit']);_0x2240d5[_0xae04('0x1a')]=qs[_0xae04('0x1a')](_0x29214a[_0xae04('0x31')][_0xae04('0x1a')]);}_0x2240d5[_0xae04('0x39')]=qs['sort'](_0x29214a['query']['sort']);_0x2240d5[_0xae04('0x3a')]=qs[_0xae04('0x32')](_[_0xae04('0x3b')](_0x29214a[_0xae04('0x31')],_0x10a0db[_0xae04('0x32')]));if(_0x29214a[_0xae04('0x31')]['filter']){_0x2240d5[_0xae04('0x3a')]=_[_0xae04('0x3c')](_0x2240d5['where'],{'$or':_[_0xae04('0x2f')](_0x248e07,function(_0x256900){if(_0x256900[_0xae04('0x3d')]!==_0xae04('0x3e')){var _0x23d3e2={};_0x23d3e2[_0x256900[_0xae04('0x29')]]={'$like':'%'+_0x29214a[_0xae04('0x31')][_0xae04('0x3f')]+'%'};return _0x23d3e2;}})});}_0x2240d5=_[_0xae04('0x3c')]({},_0x2240d5,_0x29214a[_0xae04('0x40')]);var _0x44c753={'where':_0x2240d5[_0xae04('0x3a')]};return db[_0xae04('0x2c')][_0xae04('0x19')](_0x44c753)[_0xae04('0x22')](function(_0x12cbfa){_0x50d0bc['count']=_0x12cbfa;if(_0x29214a[_0xae04('0x31')]['includeAll']){_0x2240d5[_0xae04('0x41')]=[{'all':!![]}];}return db['Trigger'][_0xae04('0x42')](_0x2240d5);})[_0xae04('0x22')](function(_0x2f8705){_0x50d0bc[_0xae04('0x43')]=_0x2f8705;return _0x50d0bc;})[_0xae04('0x22')](respondWithFilteredResult(_0x4e3b29,_0x2240d5))[_0xae04('0x44')](handleError(_0x4e3b29,null));};exports[_0xae04('0x45')]=function(_0xa2af8f,_0x4b19c2){var _0x10edd3={'raw':![],'where':{'id':_0xa2af8f[_0xae04('0x46')]['id']}},_0x360d6f={};_0x360d6f['model']=_[_0xae04('0x30')](db[_0xae04('0x2c')][_0xae04('0x47')]);_0x360d6f['query']=_[_0xae04('0x30')](_0xa2af8f['query']);_0x360d6f['filters']=_['intersection'](_0x360d6f[_0xae04('0x2e')],_0x360d6f[_0xae04('0x31')]);_0x10edd3[_0xae04('0x35')]=_[_0xae04('0x33')](_0x360d6f['model'],qs['fields'](_0xa2af8f['query'][_0xae04('0x34')]));_0x10edd3[_0xae04('0x35')]=_0x10edd3['attributes']['length']?_0x10edd3[_0xae04('0x35')]:_0x360d6f['model'];if(_0xa2af8f[_0xae04('0x31')][_0xae04('0x48')]){_0x10edd3[_0xae04('0x41')]=[{'all':!![]}];}_0x10edd3=_['merge']({},_0x10edd3,_0xa2af8f[_0xae04('0x40')]);return db[_0xae04('0x2c')][_0xae04('0x49')](_0x10edd3)['then'](handleEntityNotFound(_0x4b19c2,null))[_0xae04('0x22')](respondWithResult(_0x4b19c2,null))[_0xae04('0x44')](handleError(_0x4b19c2,null));};exports[_0xae04('0x4a')]=function(_0x752c2d,_0x13b52e){return db[_0xae04('0x2c')]['create'](_0x752c2d[_0xae04('0x4b')],{})[_0xae04('0x22')](function(_0x56fc7e){var _0x3dbee2=_0x752c2d['user'][_0xae04('0x24')]({'plain':!![]});if(!_0x3dbee2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3dbee2[_0xae04('0x4c')]===_0xae04('0x4d')){var _0x2aca32=_0x56fc7e['get']({'plain':!![]});var _0x3f8288=_0xae04('0x4e');return db[_0xae04('0x4f')][_0xae04('0x49')]({'where':{'name':_0x3f8288,'userProfileId':_0x3dbee2['userProfileId']},'raw':!![]})[_0xae04('0x22')](function(_0x3a80d6){if(_0x3a80d6&&_0x3a80d6[_0xae04('0x50')]===0x0){return db['UserProfileResource'][_0xae04('0x4a')]({'name':_0x2aca32[_0xae04('0x29')],'resourceId':_0x2aca32['id'],'type':_0x3a80d6[_0xae04('0x29')],'sectionId':_0x3a80d6['id']},{})[_0xae04('0x22')](function(){return _0x56fc7e;});}else{return _0x56fc7e;}})['catch'](function(_0x298733){logger[_0xae04('0x27')](_0xae04('0x51'),_0x298733);throw _0x298733;});}return _0x56fc7e;})[_0xae04('0x22')](respondWithResult(_0x13b52e,0xc9))['catch'](handleError(_0x13b52e,null));};exports[_0xae04('0x21')]=function(_0x1dbdb3,_0x38bded){if(_0x1dbdb3[_0xae04('0x4b')]['id']){delete _0x1dbdb3[_0xae04('0x4b')]['id'];}return db[_0xae04('0x2c')]['find']({'where':{'id':_0x1dbdb3['params']['id']}})[_0xae04('0x22')](handleEntityNotFound(_0x38bded,null))[_0xae04('0x22')](saveUpdates(_0x1dbdb3[_0xae04('0x4b')],null))['then'](respondWithResult(_0x38bded,null))[_0xae04('0x44')](handleError(_0x38bded,null));};exports[_0xae04('0x23')]=function(_0xd9b17d,_0x4bcfd1){return db[_0xae04('0x2c')][_0xae04('0x49')]({'where':{'id':_0xd9b17d[_0xae04('0x46')]['id']}})[_0xae04('0x22')](handleEntityNotFound(_0x4bcfd1,null))[_0xae04('0x22')](removeEntity(_0x4bcfd1,null))['catch'](handleError(_0x4bcfd1,null));};exports[_0xae04('0x52')]=function(_0x4a7ebd,_0xdf464c,_0x2a24df){if(_0x4a7ebd[_0xae04('0x4b')]['id']){delete _0x4a7ebd[_0xae04('0x4b')]['id'];}return db[_0xae04('0x2c')][_0xae04('0x49')]({'where':{'id':_0x4a7ebd[_0xae04('0x46')]['id']}})[_0xae04('0x22')](handleEntityNotFound(_0xdf464c,null))['then'](function(_0x2d0014){if(_0x2d0014){_0x4a7ebd[_0xae04('0x4b')][_0xae04('0x53')]=_0x2d0014['id'];return db[_0xae04('0x54')]['create'](_0x4a7ebd[_0xae04('0x4b')]);}})[_0xae04('0x22')](respondWithResult(_0xdf464c,null))[_0xae04('0x44')](handleError(_0xdf464c,null));};exports[_0xae04('0x55')]=function(_0xeb4152,_0x3688fe,_0x587413){if(_0xeb4152[_0xae04('0x4b')]['id']){delete _0xeb4152[_0xae04('0x4b')]['id'];}return db['Trigger'][_0xae04('0x49')]({'where':{'id':_0xeb4152[_0xae04('0x46')]['id']}})['then'](handleEntityNotFound(_0x3688fe,null))[_0xae04('0x22')](function(_0x255594){if(_0x255594){_0xeb4152['body'][_0xae04('0x56')]=_0x255594['id'];return db[_0xae04('0x54')]['create'](_0xeb4152[_0xae04('0x4b')]);}})[_0xae04('0x22')](respondWithResult(_0x3688fe,null))[_0xae04('0x44')](handleError(_0x3688fe,null));};exports['getAllConditions']=function(_0x682ed9,_0x32b831,_0x3ee786){var _0x43a03b={};var _0x48ef2c={};var _0x24ec22;var _0x11f822;return db['Trigger'][_0xae04('0x57')]({'where':{'id':_0x682ed9[_0xae04('0x46')]['id']}})[_0xae04('0x22')](handleEntityNotFound(_0x32b831,null))['then'](function(_0x3d984b){if(_0x3d984b){_0x24ec22=_0x3d984b;_0x48ef2c['model']=_[_0xae04('0x30')](db['Condition'][_0xae04('0x47')]);_0x48ef2c[_0xae04('0x31')]=_[_0xae04('0x30')](_0x682ed9[_0xae04('0x31')]);_0x48ef2c['filters']=_['intersection'](_0x48ef2c[_0xae04('0x2e')],_0x48ef2c[_0xae04('0x31')]);_0x43a03b[_0xae04('0x35')]=_[_0xae04('0x33')](_0x48ef2c[_0xae04('0x2e')],qs[_0xae04('0x34')](_0x682ed9[_0xae04('0x31')][_0xae04('0x34')]));_0x43a03b[_0xae04('0x35')]=_0x43a03b[_0xae04('0x35')]['length']?_0x43a03b[_0xae04('0x35')]:_0x48ef2c[_0xae04('0x2e')];_0x43a03b[_0xae04('0x39')]=qs[_0xae04('0x58')](_0x682ed9['query'][_0xae04('0x58')]);_0x43a03b[_0xae04('0x3a')]=qs[_0xae04('0x32')](_[_0xae04('0x3b')](_0x682ed9[_0xae04('0x31')],_0x48ef2c[_0xae04('0x32')]));if(_0x682ed9['query']['filter']){_0x43a03b[_0xae04('0x3a')]=_['merge'](_0x43a03b[_0xae04('0x3a')],{'$or':_[_0xae04('0x2f')](_0x43a03b[_0xae04('0x35')],function(_0x4ec3be){var _0x150c6f={};_0x150c6f[_0x4ec3be]={'$like':'%'+_0x682ed9[_0xae04('0x31')][_0xae04('0x3f')]+'%'};return _0x150c6f;})});}_0x43a03b=_['merge']({},_0x43a03b,_0x682ed9['options']);return _0x24ec22[_0xae04('0x59')](_0x43a03b);}})[_0xae04('0x22')](function(_0x1fcb2c){if(_0x1fcb2c){_0x11f822=_0x1fcb2c['length'];if(!_0x682ed9[_0xae04('0x31')][_0xae04('0x37')](_0xae04('0x38'))){_0x43a03b[_0xae04('0x1b')]=qs[_0xae04('0x1b')](_0x682ed9[_0xae04('0x31')][_0xae04('0x1b')]);_0x43a03b[_0xae04('0x1a')]=qs[_0xae04('0x1a')](_0x682ed9['query'][_0xae04('0x1a')]);}return _0x24ec22[_0xae04('0x59')](_0x43a03b);}})[_0xae04('0x22')](function(_0x2c4993){if(_0x2c4993){return _0x2c4993?{'count':_0x11f822,'rows':_0x2c4993}:null;}})[_0xae04('0x22')](respondWithResult(_0x32b831,null))[_0xae04('0x44')](handleError(_0x32b831,null));};exports['getAnyConditions']=function(_0x4234f9,_0x1cca9d,_0xcfdf9c){var _0x5bfd0e={};var _0x4b0adc={};var _0x5ed1f7;var _0x71af65;return db[_0xae04('0x2c')]['findOne']({'where':{'id':_0x4234f9[_0xae04('0x46')]['id']}})[_0xae04('0x22')](handleEntityNotFound(_0x1cca9d,null))[_0xae04('0x22')](function(_0x49a3b6){if(_0x49a3b6){_0x5ed1f7=_0x49a3b6;_0x4b0adc[_0xae04('0x2e')]=_[_0xae04('0x30')](db[_0xae04('0x54')][_0xae04('0x47')]);_0x4b0adc[_0xae04('0x31')]=_[_0xae04('0x30')](_0x4234f9[_0xae04('0x31')]);_0x4b0adc[_0xae04('0x32')]=_[_0xae04('0x33')](_0x4b0adc[_0xae04('0x2e')],_0x4b0adc['query']);_0x5bfd0e[_0xae04('0x35')]=_['intersection'](_0x4b0adc['model'],qs[_0xae04('0x34')](_0x4234f9[_0xae04('0x31')][_0xae04('0x34')]));_0x5bfd0e[_0xae04('0x35')]=_0x5bfd0e['attributes'][_0xae04('0x36')]?_0x5bfd0e[_0xae04('0x35')]:_0x4b0adc[_0xae04('0x2e')];_0x5bfd0e[_0xae04('0x39')]=qs['sort'](_0x4234f9[_0xae04('0x31')][_0xae04('0x58')]);_0x5bfd0e[_0xae04('0x3a')]=qs[_0xae04('0x32')](_[_0xae04('0x3b')](_0x4234f9[_0xae04('0x31')],_0x4b0adc['filters']));if(_0x4234f9['query']['filter']){_0x5bfd0e['where']=_[_0xae04('0x3c')](_0x5bfd0e[_0xae04('0x3a')],{'$or':_[_0xae04('0x2f')](_0x5bfd0e[_0xae04('0x35')],function(_0x370798){var _0x306e9f={};_0x306e9f[_0x370798]={'$like':'%'+_0x4234f9[_0xae04('0x31')]['filter']+'%'};return _0x306e9f;})});}_0x5bfd0e=_[_0xae04('0x3c')]({},_0x5bfd0e,_0x4234f9[_0xae04('0x40')]);return _0x5ed1f7[_0xae04('0x5a')](_0x5bfd0e);}})[_0xae04('0x22')](function(_0x5561ce){if(_0x5561ce){_0x71af65=_0x5561ce['length'];if(!_0x4234f9[_0xae04('0x31')]['hasOwnProperty'](_0xae04('0x38'))){_0x5bfd0e[_0xae04('0x1b')]=qs[_0xae04('0x1b')](_0x4234f9[_0xae04('0x31')]['limit']);_0x5bfd0e['offset']=qs[_0xae04('0x1a')](_0x4234f9['query'][_0xae04('0x1a')]);}return _0x5ed1f7[_0xae04('0x5a')](_0x5bfd0e);}})[_0xae04('0x22')](function(_0x4cd28a){if(_0x4cd28a){return _0x4cd28a?{'count':_0x71af65,'rows':_0x4cd28a}:null;}})['then'](respondWithResult(_0x1cca9d,null))[_0xae04('0x44')](handleError(_0x1cca9d,null));};exports[_0xae04('0x5b')]=function(_0x5f3e3e,_0x509457,_0x5c46d0){if(_0x5f3e3e[_0xae04('0x4b')]['id']){delete _0x5f3e3e[_0xae04('0x4b')]['id'];}return db[_0xae04('0x2c')][_0xae04('0x49')]({'where':{'id':_0x5f3e3e[_0xae04('0x46')]['id']}})[_0xae04('0x22')](handleEntityNotFound(_0x509457,null))['then'](function(_0x418558){if(_0x418558){_0x5f3e3e[_0xae04('0x4b')]['TriggerId']=_0x418558['id'];return db['Action'][_0xae04('0x4a')](_0x5f3e3e['body']);}})[_0xae04('0x22')](respondWithResult(_0x509457,null))[_0xae04('0x44')](handleError(_0x509457,null));};exports[_0xae04('0x5c')]=function(_0x15c0e9,_0x2700d1,_0xac838b){var _0x327ef1={};var _0x282bbc={};var _0x4577ec;var _0x2b965f;return db['Trigger'][_0xae04('0x57')]({'where':{'id':_0x15c0e9[_0xae04('0x46')]['id']}})[_0xae04('0x22')](handleEntityNotFound(_0x2700d1,null))[_0xae04('0x22')](function(_0x163fd7){if(_0x163fd7){_0x4577ec=_0x163fd7;_0x282bbc[_0xae04('0x2e')]=_[_0xae04('0x30')](db[_0xae04('0x5d')][_0xae04('0x47')]);_0x282bbc['query']=_['keys'](_0x15c0e9[_0xae04('0x31')]);_0x282bbc[_0xae04('0x32')]=_[_0xae04('0x33')](_0x282bbc[_0xae04('0x2e')],_0x282bbc[_0xae04('0x31')]);_0x327ef1['attributes']=_['intersection'](_0x282bbc[_0xae04('0x2e')],qs[_0xae04('0x34')](_0x15c0e9[_0xae04('0x31')]['fields']));_0x327ef1['attributes']=_0x327ef1[_0xae04('0x35')]['length']?_0x327ef1[_0xae04('0x35')]:_0x282bbc[_0xae04('0x2e')];_0x327ef1[_0xae04('0x39')]=qs[_0xae04('0x58')](_0x15c0e9[_0xae04('0x31')][_0xae04('0x58')]);_0x327ef1[_0xae04('0x3a')]=qs[_0xae04('0x32')](_[_0xae04('0x3b')](_0x15c0e9[_0xae04('0x31')],_0x282bbc[_0xae04('0x32')]));if(_0x15c0e9[_0xae04('0x31')][_0xae04('0x3f')]){_0x327ef1[_0xae04('0x3a')]=_[_0xae04('0x3c')](_0x327ef1[_0xae04('0x3a')],{'$or':_[_0xae04('0x2f')](_0x327ef1[_0xae04('0x35')],function(_0x2dbb7b){var _0x6a142={};_0x6a142[_0x2dbb7b]={'$like':'%'+_0x15c0e9['query']['filter']+'%'};return _0x6a142;})});}_0x327ef1=_['merge']({},_0x327ef1,_0x15c0e9[_0xae04('0x40')]);return _0x4577ec[_0xae04('0x5c')](_0x327ef1);}})[_0xae04('0x22')](function(_0x56f444){if(_0x56f444){_0x2b965f=_0x56f444['length'];if(!_0x15c0e9['query'][_0xae04('0x37')]('nolimit')){_0x327ef1[_0xae04('0x1b')]=qs['limit'](_0x15c0e9['query']['limit']);_0x327ef1['offset']=qs[_0xae04('0x1a')](_0x15c0e9[_0xae04('0x31')][_0xae04('0x1a')]);}return _0x4577ec[_0xae04('0x5c')](_0x327ef1);}})['then'](function(_0x174b36){if(_0x174b36){return _0x174b36?{'count':_0x2b965f,'rows':_0x174b36}:null;}})['then'](respondWithResult(_0x2700d1,null))[_0xae04('0x44')](handleError(_0x2700d1,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 47b0cb3..d20a45b 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 _0x4621=['api','moment','request-promise','path','rimraf','exports','Trigger','util','../../config/logger'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4621,0xa0));var _0x1462=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4621[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x1462('0x0'));var logger=require(_0x1462('0x1'))(_0x1462('0x2'));var moment=require(_0x1462('0x3'));var BPromise=require('bluebird');var rp=require(_0x1462('0x4'));var fs=require('fs');var path=require(_0x1462('0x5'));var rimraf=require(_0x1462('0x6'));var config=require('../../config/environment');var attributes=require('./trigger.attributes');module[_0x1462('0x7')]=function(_0x27d939,_0x20f083){return _0x27d939['define'](_0x1462('0x8'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa07c=['path','rimraf','../../config/environment','./trigger.attributes','exports','define','tools_triggers','lodash','util','api','request-promise'];(function(_0x43aaa7,_0x553cd1){var _0x4cdbcc=function(_0xaafbf9){while(--_0xaafbf9){_0x43aaa7['push'](_0x43aaa7['shift']());}};_0x4cdbcc(++_0x553cd1);}(_0xa07c,0x104));var _0xca07=function(_0x1a74ea,_0x43d767){_0x1a74ea=_0x1a74ea-0x0;var _0x12280b=_0xa07c[_0x1a74ea];return _0x12280b;};'use strict';var _=require(_0xca07('0x0'));var util=require(_0xca07('0x1'));var logger=require('../../config/logger')(_0xca07('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xca07('0x3'));var fs=require('fs');var path=require(_0xca07('0x4'));var rimraf=require(_0xca07('0x5'));var config=require(_0xca07('0x6'));var attributes=require(_0xca07('0x7'));module[_0xca07('0x8')]=function(_0x450f66,_0x4fdd48){return _0x450f66[_0xca07('0x9')]('Trigger',attributes,{'tableName':_0xca07('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index a8f6a57..41129c1 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 _0xb9be=['Trigger','findAll','options','limit','include','map','model','attributes','ShowTrigger','find','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','debug','stringify','error','code','request\x20sent','result','message','catch','GetTrigger'];(function(_0xd2ea71,_0x4bbb95){var _0x2180df=function(_0xa3ab6){while(--_0xa3ab6){_0xd2ea71['push'](_0xd2ea71['shift']());}};_0x2180df(++_0x4bbb95);}(_0xb9be,0xc5));var _0xeb9b=function(_0x4327fe,_0x4f8040){_0x4327fe=_0x4327fe-0x0;var _0x138651=_0xb9be[_0x4327fe];return _0x138651;};'use strict';var _=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var moment=require(_0xeb9b('0x2'));var BPromise=require(_0xeb9b('0x3'));var rs=require(_0xeb9b('0x4'));var fs=require('fs');var Redis=require(_0xeb9b('0x5'));var db=require(_0xeb9b('0x6'))['db'];var utils=require(_0xeb9b('0x7'));var logger=require(_0xeb9b('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeb9b('0x9'));var client=jayson[_0xeb9b('0xa')][_0xeb9b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49a8b9,_0x1ee7e0,_0x58ca1d){return new BPromise(function(_0x210eeb,_0x28dc5f){return client[_0xeb9b('0xc')](_0x49a8b9,_0x58ca1d)[_0xeb9b('0xd')](function(_0x418204){logger[_0xeb9b('0xe')](_0xeb9b('0xf'),_0x1ee7e0,'request\x20sent');logger[_0xeb9b('0x10')]('Trigger,\x20%s,\x20%s,\x20%s',_0x1ee7e0,'request\x20sent',JSON[_0xeb9b('0x11')](_0x418204));if(_0x418204[_0xeb9b('0x12')]){if(_0x418204['error'][_0xeb9b('0x13')]===0x1f4){logger[_0xeb9b('0x12')](_0xeb9b('0xf'),_0x1ee7e0,_0x418204[_0xeb9b('0x12')]['message']);return _0x28dc5f(_0x418204['error']['message']);}logger[_0xeb9b('0x12')](_0xeb9b('0xf'),_0x1ee7e0,_0x418204[_0xeb9b('0x12')]['message']);return _0x210eeb(_0x418204['error']['message']);}else{logger[_0xeb9b('0xe')](_0xeb9b('0xf'),_0x1ee7e0,_0xeb9b('0x14'));_0x210eeb(_0x418204[_0xeb9b('0x15')][_0xeb9b('0x16')]);}})[_0xeb9b('0x17')](function(_0x239ccf){logger['error'](_0xeb9b('0xf'),_0x1ee7e0,_0x239ccf);_0x28dc5f(_0x239ccf);});});}exports[_0xeb9b('0x18')]=function(_0x21aca6){var _0x3a11e3=this;return new Promise(function(_0x3cbe3e,_0x1a140c){return db[_0xeb9b('0x19')][_0xeb9b('0x1a')]({'raw':_0x21aca6[_0xeb9b('0x1b')]?_0x21aca6[_0xeb9b('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x21aca6[_0xeb9b('0x1b')]?_0x21aca6['options']['where']||null:null,'attributes':_0x21aca6[_0xeb9b('0x1b')]?_0x21aca6[_0xeb9b('0x1b')]['attributes']||null:null,'limit':_0x21aca6[_0xeb9b('0x1b')]?_0x21aca6[_0xeb9b('0x1b')][_0xeb9b('0x1c')]||null:null,'include':_0x21aca6[_0xeb9b('0x1b')]?_0x21aca6[_0xeb9b('0x1b')][_0xeb9b('0x1d')]?_[_0xeb9b('0x1e')](_0x21aca6[_0xeb9b('0x1b')][_0xeb9b('0x1d')],function(_0x46df93){return{'model':db[_0x46df93[_0xeb9b('0x1f')]],'as':_0x46df93['as'],'attributes':_0x46df93[_0xeb9b('0x20')],'include':_0x46df93[_0xeb9b('0x1d')]?_[_0xeb9b('0x1e')](_0x46df93[_0xeb9b('0x1d')],function(_0x434461){return{'model':db[_0x434461['model']],'as':_0x434461['as'],'attributes':_0x434461[_0xeb9b('0x20')],'include':_0x434461['include']?_[_0xeb9b('0x1e')](_0x434461['include'],function(_0x347ec1){return{'model':db[_0x347ec1[_0xeb9b('0x1f')]],'as':_0x347ec1['as'],'attributes':_0x347ec1[_0xeb9b('0x20')]};}):[]};}):[]};}):[]:[]})[_0xeb9b('0xd')](function(_0x52f6c1){logger[_0xeb9b('0xe')](_0xeb9b('0x18'),_0x21aca6);logger['debug'](_0xeb9b('0x18'),_0x21aca6,JSON[_0xeb9b('0x11')](_0x52f6c1));_0x3cbe3e(_0x52f6c1);})['catch'](function(_0x2a4b51){logger[_0xeb9b('0x12')](_0xeb9b('0x18'),_0x2a4b51['message'],_0x21aca6);_0x1a140c(_0x3a11e3[_0xeb9b('0x12')](0x1f4,_0x2a4b51['message']));});});};exports[_0xeb9b('0x21')]=function(_0x4c1331){var _0x411467=this;return new Promise(function(_0x54c659,_0x27578d){return db['Trigger'][_0xeb9b('0x22')]({'raw':_0x4c1331['options']?_0x4c1331[_0xeb9b('0x1b')][_0xeb9b('0x23')]===undefined?!![]:![]:!![],'where':_0x4c1331[_0xeb9b('0x1b')]?_0x4c1331[_0xeb9b('0x1b')][_0xeb9b('0x24')]||null:null,'attributes':_0x4c1331[_0xeb9b('0x1b')]?_0x4c1331[_0xeb9b('0x1b')][_0xeb9b('0x20')]||null:null,'include':_0x4c1331[_0xeb9b('0x1b')]?_0x4c1331[_0xeb9b('0x1b')]['include']?_[_0xeb9b('0x1e')](_0x4c1331[_0xeb9b('0x1b')][_0xeb9b('0x1d')],function(_0x21ecfd){return{'model':db[_0x21ecfd[_0xeb9b('0x1f')]],'as':_0x21ecfd['as'],'attributes':_0x21ecfd[_0xeb9b('0x20')],'include':_0x21ecfd[_0xeb9b('0x1d')]?_['map'](_0x21ecfd[_0xeb9b('0x1d')],function(_0x2f3179){return{'model':db[_0x2f3179[_0xeb9b('0x1f')]],'as':_0x2f3179['as'],'attributes':_0x2f3179['attributes'],'include':_0x2f3179[_0xeb9b('0x1d')]?_[_0xeb9b('0x1e')](_0x2f3179[_0xeb9b('0x1d')],function(_0xab9ad5){return{'model':db[_0xab9ad5[_0xeb9b('0x1f')]],'as':_0xab9ad5['as'],'attributes':_0xab9ad5[_0xeb9b('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24d235){logger[_0xeb9b('0xe')]('ShowTrigger',_0x4c1331);logger[_0xeb9b('0x10')](_0xeb9b('0x21'),_0x4c1331,JSON[_0xeb9b('0x11')](_0x24d235));_0x54c659(_0x24d235);})[_0xeb9b('0x17')](function(_0x37c678){logger[_0xeb9b('0x12')](_0xeb9b('0x21'),_0x37c678['message'],_0x4c1331);_0x27578d(_0x411467[_0xeb9b('0x12')](0x1f4,_0x37c678[_0xeb9b('0x16')]));});});}; \ No newline at end of file +var _0x34b7=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','map','include','model','then','ShowTrigger','find','moment','bluebird'];(function(_0x4d0284,_0x5a83aa){var _0x376d4a=function(_0x1114b0){while(--_0x1114b0){_0x4d0284['push'](_0x4d0284['shift']());}};_0x376d4a(++_0x5a83aa);}(_0x34b7,0x196));var _0x734b=function(_0x5ddda9,_0x43e558){_0x5ddda9=_0x5ddda9-0x0;var _0x53a004=_0x34b7[_0x5ddda9];return _0x53a004;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x734b('0x0'));var BPromise=require(_0x734b('0x1'));var rs=require(_0x734b('0x2'));var fs=require('fs');var Redis=require(_0x734b('0x3'));var db=require(_0x734b('0x4'))['db'];var utils=require(_0x734b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x734b('0x6'));var jayson=require(_0x734b('0x7'));var client=jayson[_0x734b('0x8')][_0x734b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28918a,_0x35d685,_0x58e2f1){return new BPromise(function(_0x1eb803,_0x2e7932){return client['request'](_0x28918a,_0x58e2f1)['then'](function(_0x5f4b3a){logger[_0x734b('0xa')]('Trigger,\x20%s,\x20%s',_0x35d685,_0x734b('0xb'));logger[_0x734b('0xc')](_0x734b('0xd'),_0x35d685,_0x734b('0xb'),JSON[_0x734b('0xe')](_0x5f4b3a));if(_0x5f4b3a[_0x734b('0xf')]){if(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x10')]===0x1f4){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x2e7932(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}logger['error'](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x1eb803(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}else{logger[_0x734b('0xa')](_0x734b('0x11'),_0x35d685,_0x734b('0xb'));_0x1eb803(_0x5f4b3a[_0x734b('0x13')][_0x734b('0x12')]);}})[_0x734b('0x14')](function(_0x4d2d23){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x4d2d23);_0x2e7932(_0x4d2d23);});});}exports[_0x734b('0x15')]=function(_0x5edbe9){var _0x4d3b9c=this;return new Promise(function(_0x56a95c,_0xcd12a1){return db[_0x734b('0x16')][_0x734b('0x17')]({'raw':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')][_0x734b('0x19')]===undefined?!![]:![]:!![],'where':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')][_0x734b('0x1a')]||null:null,'attributes':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')][_0x734b('0x1b')]||null:null,'limit':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')]['limit']||null:null,'include':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')]['include']?_[_0x734b('0x1c')](_0x5edbe9[_0x734b('0x18')][_0x734b('0x1d')],function(_0x11fb8e){return{'model':db[_0x11fb8e[_0x734b('0x1e')]],'as':_0x11fb8e['as'],'attributes':_0x11fb8e[_0x734b('0x1b')],'include':_0x11fb8e[_0x734b('0x1d')]?_[_0x734b('0x1c')](_0x11fb8e[_0x734b('0x1d')],function(_0x3abbe6){return{'model':db[_0x3abbe6[_0x734b('0x1e')]],'as':_0x3abbe6['as'],'attributes':_0x3abbe6[_0x734b('0x1b')],'include':_0x3abbe6[_0x734b('0x1d')]?_['map'](_0x3abbe6['include'],function(_0x13cc5a){return{'model':db[_0x13cc5a[_0x734b('0x1e')]],'as':_0x13cc5a['as'],'attributes':_0x13cc5a['attributes']};}):[]};}):[]};}):[]:[]})[_0x734b('0x1f')](function(_0x2dd51a){logger[_0x734b('0xa')](_0x734b('0x15'),_0x5edbe9);logger[_0x734b('0xc')](_0x734b('0x15'),_0x5edbe9,JSON[_0x734b('0xe')](_0x2dd51a));_0x56a95c(_0x2dd51a);})['catch'](function(_0x1f3652){logger[_0x734b('0xf')](_0x734b('0x15'),_0x1f3652[_0x734b('0x12')],_0x5edbe9);_0xcd12a1(_0x4d3b9c[_0x734b('0xf')](0x1f4,_0x1f3652[_0x734b('0x12')]));});});};exports[_0x734b('0x20')]=function(_0x21ed3c){var _0x371ead=this;return new Promise(function(_0x3065b0,_0x5dcabf){return db[_0x734b('0x16')][_0x734b('0x21')]({'raw':_0x21ed3c['options']?_0x21ed3c[_0x734b('0x18')][_0x734b('0x19')]===undefined?!![]:![]:!![],'where':_0x21ed3c[_0x734b('0x18')]?_0x21ed3c[_0x734b('0x18')][_0x734b('0x1a')]||null:null,'attributes':_0x21ed3c[_0x734b('0x18')]?_0x21ed3c[_0x734b('0x18')][_0x734b('0x1b')]||null:null,'include':_0x21ed3c[_0x734b('0x18')]?_0x21ed3c[_0x734b('0x18')][_0x734b('0x1d')]?_[_0x734b('0x1c')](_0x21ed3c[_0x734b('0x18')][_0x734b('0x1d')],function(_0x4512fc){return{'model':db[_0x4512fc['model']],'as':_0x4512fc['as'],'attributes':_0x4512fc[_0x734b('0x1b')],'include':_0x4512fc['include']?_[_0x734b('0x1c')](_0x4512fc[_0x734b('0x1d')],function(_0x3413bf){return{'model':db[_0x3413bf[_0x734b('0x1e')]],'as':_0x3413bf['as'],'attributes':_0x3413bf[_0x734b('0x1b')],'include':_0x3413bf[_0x734b('0x1d')]?_['map'](_0x3413bf['include'],function(_0x3460a0){return{'model':db[_0x3460a0['model']],'as':_0x3460a0['as'],'attributes':_0x3460a0[_0x734b('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2de959){logger['info'](_0x734b('0x20'),_0x21ed3c);logger['debug'](_0x734b('0x20'),_0x21ed3c,JSON[_0x734b('0xe')](_0x2de959));_0x3065b0(_0x2de959);})[_0x734b('0x14')](function(_0x34a504){logger[_0x734b('0xf')](_0x734b('0x20'),_0x34a504[_0x734b('0x12')],_0x21ed3c);_0x5dcabf(_0x371ead['error'](0x1f4,_0x34a504[_0x734b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 8ce939f..70257ae 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 _0x207c=['get','/:id','isAuthenticated','post','/:id/clone','create','put','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./trunk.controller'];(function(_0x58d787,_0x11801d){var _0x5222c4=function(_0x1c6bc5){while(--_0x1c6bc5){_0x58d787['push'](_0x58d787['shift']());}};_0x5222c4(++_0x11801d);}(_0x207c,0x1e8));var _0xc207=function(_0x104857,_0x34844c){_0x104857=_0x104857-0x0;var _0x5c7d6d=_0x207c[_0x104857];return _0x5c7d6d;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var auth=require(_0xc207('0x5'));var interaction=require(_0xc207('0x6'));var config=require('../../config/environment');var controller=require(_0xc207('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc207('0x8')](_0xc207('0x9'),auth[_0xc207('0xa')](),controller['show']);router[_0xc207('0xb')](_0xc207('0xc'),auth[_0xc207('0xa')](),controller['clone']);router[_0xc207('0xb')]('/',auth[_0xc207('0xa')](),controller[_0xc207('0xd')]);router[_0xc207('0xe')](_0xc207('0x9'),auth[_0xc207('0xa')](),controller['update']);router['delete']('/:id',auth[_0xc207('0xa')](),controller['destroy']);module[_0xc207('0xf')]=router; \ No newline at end of file +var _0x425d=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','/:id/clone','clone','create','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x373f3c,_0x44e12b){var _0x555326=function(_0x5dd8d9){while(--_0x5dd8d9){_0x373f3c['push'](_0x373f3c['shift']());}};_0x555326(++_0x44e12b);}(_0x425d,0x1e0));var _0xd425=function(_0x1bab7d,_0x422688){_0x1bab7d=_0x1bab7d-0x0;var _0x42e972=_0x425d[_0x1bab7d];return _0x42e972;};'use strict';var multer=require(_0xd425('0x0'));var util=require('util');var path=require(_0xd425('0x1'));var timeout=require(_0xd425('0x2'));var express=require(_0xd425('0x3'));var router=express[_0xd425('0x4')]();var auth=require(_0xd425('0x5'));var interaction=require(_0xd425('0x6'));var config=require(_0xd425('0x7'));var controller=require('./trunk.controller');router[_0xd425('0x8')]('/',auth[_0xd425('0x9')](),controller[_0xd425('0xa')]);router[_0xd425('0x8')](_0xd425('0xb'),auth[_0xd425('0x9')](),controller['show']);router[_0xd425('0xc')](_0xd425('0xd'),auth[_0xd425('0x9')](),controller[_0xd425('0xe')]);router[_0xd425('0xc')]('/',auth[_0xd425('0x9')](),controller[_0xd425('0xf')]);router[_0xd425('0x10')](_0xd425('0xb'),auth[_0xd425('0x9')](),controller[_0xd425('0x11')]);router[_0xd425('0x12')](_0xd425('0xb'),auth[_0xd425('0x9')](),controller[_0xd425('0x13')]);module[_0xd425('0x14')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 31931cd..a98a3e5 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 _0x3c13=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','rfc2833','info','shortinfo','auto','nonat','update','outgoing','yes','force_rport,comedia','nat','join','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','INTEGER','always','accept','refuse','originate','uac','uas','pai','active','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','getDataValue','split'];(function(_0x43fa1a,_0x3be06d){var _0x214e21=function(_0x5c2a2b){while(--_0x5c2a2b){_0x43fa1a['push'](_0x43fa1a['shift']());}};_0x214e21(++_0x3be06d);}(_0x3c13,0xdb));var _0x33c1=function(_0x5102a6,_0x15063d){_0x5102a6=_0x5102a6-0x0;var _0x420726=_0x3c13[_0x5102a6];return _0x420726;};'use strict';var Sequelize=require(_0x33c1('0x0'));module[_0x33c1('0x1')]={'name':{'type':Sequelize[_0x33c1('0x2')],'allowNull':![],'unique':_0x33c1('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x33c1('0x4'),_0x33c1('0x5'),'peer'),'allowNull':![],'defaultValue':_0x33c1('0x4')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x33c1('0x6')},'callingpres':{'type':Sequelize['ENUM'](_0x33c1('0x7'),'ALLOWED_PASSED_SCREEN',_0x33c1('0x8'),'ALLOWED','PROHIB_NOT_SCREENED',_0x33c1('0x9'),_0x33c1('0xa'),_0x33c1('0xb'))},'deny':{'type':Sequelize[_0x33c1('0x2')]},'permit':{'type':Sequelize[_0x33c1('0x2')]},'secret':{'type':Sequelize[_0x33c1('0x2')]},'md5secret':{'type':Sequelize[_0x33c1('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':'udp','set':function(_0x438f5d){this[_0x33c1('0xc')](_0x33c1('0xd'),_0x438f5d?_0x438f5d['join'](','):null);},'get':function(){return this[_0x33c1('0xe')](_0x33c1('0xd'))?this['getDataValue'](_0x33c1('0xd'))[_0x33c1('0xf')](','):null;},'comment':_0x33c1('0x10')},'dtmfmode':{'type':Sequelize[_0x33c1('0x11')](_0x33c1('0x12'),_0x33c1('0x13'),_0x33c1('0x14'),'inband',_0x33c1('0x15')),'defaultValue':_0x33c1('0x12')},'directmedia':{'type':Sequelize[_0x33c1('0x11')]('yes','no',_0x33c1('0x16'),_0x33c1('0x17'),_0x33c1('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x33c1('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x33c1('0x2')]},'directmediadeny':{'type':Sequelize[_0x33c1('0x2')]},'nat':{'type':Sequelize[_0x33c1('0x2')],'defaultValue':_0x33c1('0x1a'),'set':function(_0x4d6087){this['setDataValue'](_0x33c1('0x1b'),_0x4d6087?_0x4d6087['join'](','):null);},'get':function(){return this[_0x33c1('0xe')]('nat')?this[_0x33c1('0xe')](_0x33c1('0x1b'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x33c1('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x33c1('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x33c1('0x2')]},'language':{'type':Sequelize[_0x33c1('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x33c1('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4f4866){this[_0x33c1('0xc')]('allow',_0x4f4866?_0x4f4866[_0x33c1('0x1c')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x33c1('0xe')](_0x33c1('0x1d'))?this[_0x33c1('0xe')](_0x33c1('0x1d'))[_0x33c1('0xf')](';'):null;},'comment':_0x33c1('0x1e')},'autoframing':{'type':Sequelize['ENUM'](_0x33c1('0x19'),'no')},'insecure':{'type':Sequelize[_0x33c1('0x2')],'defaultValue':_0x33c1('0x1f'),'set':function(_0x18c7c6){this['setDataValue'](_0x33c1('0x20'),_0x18c7c6?_0x18c7c6[_0x33c1('0x1c')](','):null);},'get':function(){return this[_0x33c1('0xe')](_0x33c1('0x20'))?this[_0x33c1('0xe')]('insecure')[_0x33c1('0xf')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x33c1('0x11')](_0x33c1('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x33c1('0x11')](_0x33c1('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x33c1('0x11')](_0x33c1('0x19'),'no','never')},'promiscredir':{'type':Sequelize[_0x33c1('0x11')](_0x33c1('0x19'),'no')},'useclientcode':{'type':Sequelize[_0x33c1('0x11')](_0x33c1('0x19'),'no')},'accountcode':{'type':Sequelize[_0x33c1('0x21')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x33c1('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x33c1('0x2')]},'callcounter':{'type':Sequelize[_0x33c1('0x11')]('yes','no'),'defaultValue':_0x33c1('0x19')},'busylevel':{'type':Sequelize[_0x33c1('0x21')](0xb)},'allowoverlap':{'type':Sequelize[_0x33c1('0x11')](_0x33c1('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0x33c1('0x11')](_0x33c1('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0x33c1('0x11')](_0x33c1('0x19'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no')},'subscribecontext':{'type':Sequelize[_0x33c1('0x2')]},'template':{'type':Sequelize[_0x33c1('0x2')]},'videosupport':{'type':Sequelize[_0x33c1('0x11')](_0x33c1('0x19'),'no',_0x33c1('0x22')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x33c1('0x21')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x33c1('0x11')](_0x33c1('0x19'),'no')},'mailbox':{'type':Sequelize[_0x33c1('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0x33c1('0x23'),_0x33c1('0x24'),_0x33c1('0x25'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x33c1('0x21')](0xb)},'session_refresher':{'type':Sequelize[_0x33c1('0x11')](_0x33c1('0x26'),_0x33c1('0x27')),'defaultValue':_0x33c1('0x27')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x33c1('0x2')]},'fromdomain':{'type':Sequelize[_0x33c1('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x33c1('0x21')](0x5)},'qualify':{'type':Sequelize[_0x33c1('0x11')](_0x33c1('0x19'),'no'),'defaultValue':_0x33c1('0x19')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x33c1('0x2')]},'defaultuser':{'type':Sequelize[_0x33c1('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x33c1('0x21')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x33c1('0x21')](0xb)},'sendrpid':{'type':Sequelize[_0x33c1('0x11')](_0x33c1('0x19'),'no',_0x33c1('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x33c1('0x2')]},'callbackextension':{'type':Sequelize[_0x33c1('0x2')]},'timert1':{'type':Sequelize[_0x33c1('0x21')](0xb)},'timerb':{'type':Sequelize[_0x33c1('0x21')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x33c1('0x2')]},'contactacl':{'type':Sequelize[_0x33c1('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x33c1('0x2')]},'use_q850_reason':{'type':Sequelize[_0x33c1('0x2')]},'maxforwards':{'type':Sequelize[_0x33c1('0x21')](0xb)},'encryption':{'type':Sequelize[_0x33c1('0x11')](_0x33c1('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x33c1('0x11')](_0x33c1('0x19'),'no')},'force_avp':{'type':Sequelize[_0x33c1('0x11')](_0x33c1('0x19'),'no')},'icesupport':{'type':Sequelize[_0x33c1('0x11')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x33c1('0x11')](_0x33c1('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0x33c1('0x11')](_0x33c1('0x19'),'no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize[_0x33c1('0x21')](0xb)},'dtlscertfile':{'type':Sequelize[_0x33c1('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x33c1('0x2')]},'dtlscipher':{'type':Sequelize[_0x33c1('0x2')]},'dtlscafile':{'type':Sequelize[_0x33c1('0x2')]},'dtlscapath':{'type':Sequelize[_0x33c1('0x2')]},'dtlssetup':{'type':Sequelize[_0x33c1('0x11')](_0x33c1('0x29'),_0x33c1('0x2a'),_0x33c1('0x2b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x33c1('0x2')]},'usereqphone':{'type':Sequelize['ENUM'](_0x33c1('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x33c1('0x2')]},'recordofffeature':{'type':Sequelize[_0x33c1('0x2')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x33c1('0x11')](_0x33c1('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0x33c1('0x11')](_0x33c1('0x19'),'no')},'vmexten':{'type':Sequelize[_0x33c1('0x2')]},'mohinterpret':{'type':Sequelize[_0x33c1('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x33c1('0x2')]},'description':{'type':Sequelize[_0x33c1('0x2')]},'host':{'type':Sequelize[_0x33c1('0x2')],'defaultValue':_0x33c1('0x2c')},'canreinvite':{'type':Sequelize[_0x33c1('0x11')](_0x33c1('0x19'),'no','nonat',_0x33c1('0x17'),_0x33c1('0x2d')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x33c1('0x2')]},'active':{'type':Sequelize[_0x33c1('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0x3737=['user','peer','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','nonat','outgoing','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','setDataValue','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','refuse','originate','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','update','BOOLEAN','sequelize','STRING','name','friend'];(function(_0x134e14,_0x2bfb85){var _0x448af8=function(_0x4c0a8d){while(--_0x4c0a8d){_0x134e14['push'](_0x134e14['shift']());}};_0x448af8(++_0x2bfb85);}(_0x3737,0x1d9));var _0x7373=function(_0x585c28,_0x3da696){_0x585c28=_0x585c28-0x0;var _0x38a640=_0x3737[_0x585c28];return _0x38a640;};'use strict';var Sequelize=require(_0x7373('0x0'));module['exports']={'name':{'type':Sequelize[_0x7373('0x1')],'allowNull':![],'unique':_0x7373('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x7373('0x3'),_0x7373('0x4'),_0x7373('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x7373('0x1')],'allowNull':![],'defaultValue':_0x7373('0x6')},'callingpres':{'type':Sequelize[_0x7373('0x7')](_0x7373('0x8'),_0x7373('0x9'),'ALLOWED_FAILED_SCREEN',_0x7373('0xa'),_0x7373('0xb'),_0x7373('0xc'),_0x7373('0xd'),_0x7373('0xe'))},'deny':{'type':Sequelize[_0x7373('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x7373('0x1')]},'md5secret':{'type':Sequelize[_0x7373('0x1')]},'remotesecret':{'type':Sequelize[_0x7373('0x1')]},'transport':{'type':Sequelize[_0x7373('0x1')],'defaultValue':_0x7373('0xf'),'set':function(_0x5d0202){this['setDataValue'](_0x7373('0x10'),_0x5d0202?_0x5d0202[_0x7373('0x11')](','):null);},'get':function(){return this[_0x7373('0x12')](_0x7373('0x10'))?this[_0x7373('0x12')]('transport')[_0x7373('0x13')](','):null;},'comment':_0x7373('0x14')},'dtmfmode':{'type':Sequelize['ENUM'](_0x7373('0x15'),'info',_0x7373('0x16'),_0x7373('0x17'),_0x7373('0x18')),'defaultValue':_0x7373('0x15')},'directmedia':{'type':Sequelize[_0x7373('0x7')]('yes','no',_0x7373('0x19'),'update',_0x7373('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x7373('0x1b'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x7373('0x1')]},'directmediadeny':{'type':Sequelize[_0x7373('0x1')]},'nat':{'type':Sequelize[_0x7373('0x1')],'defaultValue':_0x7373('0x1c'),'set':function(_0x141673){this['setDataValue'](_0x7373('0x1d'),_0x141673?_0x141673[_0x7373('0x11')](','):null);},'get':function(){return this['getDataValue'](_0x7373('0x1d'))?this[_0x7373('0x12')]('nat')[_0x7373('0x13')](','):null;},'comment':_0x7373('0x1e')},'callgroup':{'type':Sequelize[_0x7373('0x1')]},'namedcallgroup':{'type':Sequelize[_0x7373('0x1')]},'pickupgroup':{'type':Sequelize[_0x7373('0x1')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7373('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x7373('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x7373('0x1f')},'allow':{'type':Sequelize[_0x7373('0x1')],'allowNull':![],'defaultValue':_0x7373('0x20'),'set':function(_0x46a3b8){this[_0x7373('0x21')](_0x7373('0x22'),_0x46a3b8?_0x46a3b8[_0x7373('0x11')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x7373('0x12')](_0x7373('0x22'))?this[_0x7373('0x12')]('allow')[_0x7373('0x13')](';'):null;},'comment':_0x7373('0x23')},'autoframing':{'type':Sequelize['ENUM'](_0x7373('0x1b'),'no')},'insecure':{'type':Sequelize[_0x7373('0x1')],'defaultValue':_0x7373('0x24'),'set':function(_0x5e493a){this[_0x7373('0x21')](_0x7373('0x25'),_0x5e493a?_0x5e493a[_0x7373('0x11')](','):null);},'get':function(){return this['getDataValue'](_0x7373('0x25'))?this[_0x7373('0x12')](_0x7373('0x25'))[_0x7373('0x13')](','):null;},'comment':_0x7373('0x26')},'trustrpid':{'type':Sequelize[_0x7373('0x7')](_0x7373('0x1b'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x7373('0x1b'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x7373('0x7')](_0x7373('0x1b'),'no','never')},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize[_0x7373('0x7')](_0x7373('0x1b'),'no')},'accountcode':{'type':Sequelize[_0x7373('0x27')](0xb)},'setvar':{'type':Sequelize[_0x7373('0x1')]},'callerid':{'type':Sequelize[_0x7373('0x1')],'defaultValue':_0x7373('0x28')},'amaflags':{'type':Sequelize[_0x7373('0x1')]},'callcounter':{'type':Sequelize[_0x7373('0x7')]('yes','no'),'defaultValue':_0x7373('0x1b')},'busylevel':{'type':Sequelize[_0x7373('0x27')](0xb)},'allowoverlap':{'type':Sequelize[_0x7373('0x7')](_0x7373('0x1b'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize[_0x7373('0x7')](_0x7373('0x1b'),'no')},'ignoresdpversion':{'type':Sequelize[_0x7373('0x7')](_0x7373('0x1b'),'no')},'subscribecontext':{'type':Sequelize[_0x7373('0x1')]},'template':{'type':Sequelize[_0x7373('0x1')]},'videosupport':{'type':Sequelize[_0x7373('0x7')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x7373('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x7373('0x7')](_0x7373('0x1b'),'no')},'mailbox':{'type':Sequelize[_0x7373('0x1')]},'session_timers':{'type':Sequelize['ENUM']('accept',_0x7373('0x29'),_0x7373('0x2a'))},'session_expires':{'type':Sequelize[_0x7373('0x27')](0xb)},'session_minse':{'type':Sequelize[_0x7373('0x27')](0xb)},'session_refresher':{'type':Sequelize[_0x7373('0x7')]('uac',_0x7373('0x2b')),'defaultValue':_0x7373('0x2b')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x7373('0x1')]},'fromdomain':{'type':Sequelize[_0x7373('0x1')]},'fromuser':{'type':Sequelize[_0x7373('0x1')]},'port':{'type':Sequelize[_0x7373('0x27')](0x5)},'qualify':{'type':Sequelize[_0x7373('0x7')]('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x7373('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x7373('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x7373('0x7')](_0x7373('0x1b'),'no',_0x7373('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x7373('0x27')](0xb)},'qualifyfreq':{'type':Sequelize[_0x7373('0x27')](0xb)},'contactpermit':{'type':Sequelize[_0x7373('0x1')]},'contactdeny':{'type':Sequelize[_0x7373('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x7373('0x1')]},'use_q850_reason':{'type':Sequelize[_0x7373('0x1')]},'maxforwards':{'type':Sequelize[_0x7373('0x27')](0xb)},'encryption':{'type':Sequelize[_0x7373('0x7')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x7373('0x7')](_0x7373('0x1b'),'no')},'force_avp':{'type':Sequelize[_0x7373('0x7')]('yes','no')},'icesupport':{'type':Sequelize[_0x7373('0x7')](_0x7373('0x1b'),'no')},'dtlsenable':{'type':Sequelize[_0x7373('0x7')](_0x7373('0x1b'),'no')},'dtlsverify':{'type':Sequelize[_0x7373('0x7')](_0x7373('0x1b'),'no',_0x7373('0x2d'),_0x7373('0x2e'))},'dtlsrekey':{'type':Sequelize[_0x7373('0x27')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x7373('0x1')]},'dtlscipher':{'type':Sequelize[_0x7373('0x1')]},'dtlscafile':{'type':Sequelize[_0x7373('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x7373('0x7')](_0x7373('0x2f'),_0x7373('0x30'),_0x7373('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x7373('0x1')]},'usereqphone':{'type':Sequelize[_0x7373('0x7')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x7373('0x1')]},'call_limit':{'type':Sequelize[_0x7373('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x7373('0x7')](_0x7373('0x1b'),'no')},'subscribemwi':{'type':Sequelize[_0x7373('0x7')](_0x7373('0x1b'),'no')},'vmexten':{'type':Sequelize[_0x7373('0x1')]},'mohinterpret':{'type':Sequelize[_0x7373('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x7373('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x7373('0x1')],'defaultValue':_0x7373('0x32')},'canreinvite':{'type':Sequelize[_0x7373('0x7')](_0x7373('0x1b'),'no',_0x7373('0x19'),_0x7373('0x33'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x7373('0x1')]},'otherFields':{'type':Sequelize[_0x7373('0x1')]},'active':{'type':Sequelize[_0x7373('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x7373('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 cbde85e..8d8733d 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 _0x8a8c=['Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','offset','set','Content-Range','apply','update','destroy','get','Trunks','sendStatus','stack','name','send','map','Trunk','fieldName','type','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','params','rawAttributes','clone','find','createdAt','omit','body','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','readFileSync','join','root','server/files/templates/trunk.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','utf8','server/files/templates/registry.ejs','Reload','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','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','client','http','test','ValidationError','request','then','info'];(function(_0x183adc,_0x530a97){var _0x2f809b=function(_0x52aef3){while(--_0x52aef3){_0x183adc['push'](_0x183adc['shift']());}};_0x2f809b(++_0x530a97);}(_0x8a8c,0x1a0));var _0xc8a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a8c[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xc8a8('0x0'));var emlformat=require(_0xc8a8('0x1'));var rimraf=require(_0xc8a8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc8a8('0x3'));var moment=require(_0xc8a8('0x4'));var BPromise=require(_0xc8a8('0x5'));var Mustache=require('mustache');var util=require(_0xc8a8('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc8a8('0x7'));var ejs=require(_0xc8a8('0x8'));var fs=require('fs');var _=require(_0xc8a8('0x9'));var squel=require(_0xc8a8('0xa'));var crypto=require(_0xc8a8('0xb'));var jsforce=require(_0xc8a8('0xc'));var deskjs=require(_0xc8a8('0xd'));var toCsv=require(_0xc8a8('0x7'));var querystring=require(_0xc8a8('0xe'));var Papa=require(_0xc8a8('0xf'));var Redis=require(_0xc8a8('0x10'));var authService=require(_0xc8a8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc8a8('0x12'));var hardwareService=require(_0xc8a8('0x13'));var logger=require(_0xc8a8('0x14'))(_0xc8a8('0x15'));var utils=require(_0xc8a8('0x16'));var config=require(_0xc8a8('0x17'));var db=require(_0xc8a8('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xc8a8('0x19')][_0xc8a8('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x492810,_0x22cecc,_0x4bb46e){if(_0x4bb46e){var _0x163072=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x163072[_0xc8a8('0x1b')](_0x22cecc)){return _0x492810;}else{throw new db['Sequelize'][(_0xc8a8('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 _0x492810;}}function respondWithRpcPromise(_0x51bd39,_0x4aa1d2,_0x160abe,_0x33a450){return new BPromise(function(_0x2b5e3a,_0x2bdd56){var _0x46e183=_0x33a450||client;return _0x46e183[_0xc8a8('0x1d')](_0x51bd39,_0x160abe)[_0xc8a8('0x1e')](function(_0x500414){logger[_0xc8a8('0x1f')](_0xc8a8('0x20'),_0x4aa1d2,_0xc8a8('0x21'));logger[_0xc8a8('0x22')](_0xc8a8('0x23'),_0x4aa1d2,'request\x20sent',JSON[_0xc8a8('0x24')](_0x500414));if(_0x500414['error']){if(_0x500414[_0xc8a8('0x25')]['code']===0x1f4){logger[_0xc8a8('0x25')]('Trunk,\x20%s,\x20%s',_0x4aa1d2,_0x500414[_0xc8a8('0x25')][_0xc8a8('0x26')]);return _0x2bdd56(_0x500414[_0xc8a8('0x25')][_0xc8a8('0x26')]);}logger[_0xc8a8('0x25')](_0xc8a8('0x20'),_0x4aa1d2,_0x500414['error']['message']);return _0x2b5e3a(_0x500414[_0xc8a8('0x25')]['message']);}else{logger['info']('Trunk,\x20%s,\x20%s',_0x4aa1d2,_0xc8a8('0x21'));_0x2b5e3a(_0x500414[_0xc8a8('0x27')][_0xc8a8('0x26')]);}})[_0xc8a8('0x28')](function(_0x3e8d7d){logger['error']('Trunk,\x20%s,\x20%s',_0x4aa1d2,_0x3e8d7d);_0x2bdd56(_0x3e8d7d);});});}function respondWithStatusCode(_0x5cd87c,_0x44ba45){_0x44ba45=_0x44ba45||0xcc;return function(_0x150e27){if(_0x150e27){return _0x5cd87c['sendStatus'](_0x44ba45);}return _0x5cd87c[_0xc8a8('0x29')](_0x44ba45)[_0xc8a8('0x2a')]();};}function respondWithResult(_0x234579,_0x549e38){_0x549e38=_0x549e38||0xc8;return function(_0x398958){if(_0x398958){return _0x234579[_0xc8a8('0x29')](_0x549e38)[_0xc8a8('0x2b')](_0x398958);}};}function respondWithFilteredResult(_0x396840,_0x3842cc){return function(_0x4c8290){if(_0x4c8290){var _0x5a76f7=_0x4c8290['count'],_0x37016a=_0x3842cc['offset'],_0x588ce1=_0x3842cc[_0xc8a8('0x2c')]+_0x3842cc['limit'],_0x1681c2;if(_0x588ce1>=_0x5a76f7){_0x588ce1=_0x5a76f7;_0x1681c2=0xc8;}else{_0x1681c2=0xce;}_0x396840[_0xc8a8('0x29')](_0x1681c2);return _0x396840[_0xc8a8('0x2d')](_0xc8a8('0x2e'),_0x37016a+'-'+_0x588ce1+'/'+_0x5a76f7)[_0xc8a8('0x2b')](_0x4c8290);}return null;};}function patchUpdates(_0x59a95f){return function(_0xbf053a){try{jsonpatch[_0xc8a8('0x2f')](_0xbf053a,_0x59a95f,!![]);}catch(_0x4b99af){return BPromise['reject'](_0x4b99af);}return _0xbf053a['save']();};}function saveUpdates(_0x5de415,_0x30229f){return function(_0x2ee723){if(_0x2ee723){return _0x2ee723[_0xc8a8('0x30')](_0x5de415)[_0xc8a8('0x1e')](function(_0x3f594b){return _0x3f594b;});}return null;};}function removeEntity(_0x1ada93,_0x1ba5ff){return function(_0x42e061){if(_0x42e061){return _0x42e061[_0xc8a8('0x31')]()[_0xc8a8('0x1e')](function(){var _0x1b8bcc=_0x42e061[_0xc8a8('0x32')]({'plain':!![]});var _0x1c56a0=_0xc8a8('0x33');return db['UserProfileResource'][_0xc8a8('0x31')]({'where':{'type':_0x1c56a0,'resourceId':_0x1b8bcc['id']}})['then'](function(){return _0x42e061;});})[_0xc8a8('0x1e')](function(){_0x1ada93[_0xc8a8('0x29')](0xcc)[_0xc8a8('0x2a')]();});}};}function handleEntityNotFound(_0x33ce86,_0x23d4f1){return function(_0xf08dbc){if(!_0xf08dbc){_0x33ce86[_0xc8a8('0x34')](0x194);}return _0xf08dbc;};}function handleError(_0x47dc59,_0x329b2c){_0x329b2c=_0x329b2c||0x1f4;return function(_0x56ceb9){logger['error'](_0x56ceb9[_0xc8a8('0x35')]);if(_0x56ceb9[_0xc8a8('0x36')]){delete _0x56ceb9[_0xc8a8('0x36')];}_0x47dc59[_0xc8a8('0x29')](_0x329b2c)[_0xc8a8('0x37')](_0x56ceb9);};}exports['index']=function(_0x50488e,_0x56dae6){var _0x539a0c={},_0x407906={},_0x4398bd={'count':0x0,'rows':[]};var _0x318b25=_[_0xc8a8('0x38')](db[_0xc8a8('0x39')]['rawAttributes'],function(_0x3317d){return{'name':_0x3317d[_0xc8a8('0x3a')],'type':_0x3317d[_0xc8a8('0x3b')]['key']};});_0x407906['model']=_['map'](_0x318b25,_0xc8a8('0x36'));_0x407906['query']=_[_0xc8a8('0x3c')](_0x50488e['query']);_0x407906[_0xc8a8('0x3d')]=_[_0xc8a8('0x3e')](_0x407906[_0xc8a8('0x3f')],_0x407906[_0xc8a8('0x40')]);_0x539a0c[_0xc8a8('0x41')]=_[_0xc8a8('0x3e')](_0x407906['model'],qs[_0xc8a8('0x42')](_0x50488e[_0xc8a8('0x40')][_0xc8a8('0x42')]));_0x539a0c['attributes']=_0x539a0c[_0xc8a8('0x41')][_0xc8a8('0x43')]?_0x539a0c['attributes']:_0x407906[_0xc8a8('0x3f')];if(!_0x50488e[_0xc8a8('0x40')][_0xc8a8('0x44')](_0xc8a8('0x45'))){_0x539a0c['limit']=qs[_0xc8a8('0x46')](_0x50488e[_0xc8a8('0x40')][_0xc8a8('0x46')]);_0x539a0c[_0xc8a8('0x2c')]=qs[_0xc8a8('0x2c')](_0x50488e[_0xc8a8('0x40')]['offset']);}_0x539a0c[_0xc8a8('0x47')]=qs['sort'](_0x50488e[_0xc8a8('0x40')][_0xc8a8('0x48')]);_0x539a0c[_0xc8a8('0x49')]=qs[_0xc8a8('0x3d')](_[_0xc8a8('0x4a')](_0x50488e[_0xc8a8('0x40')],_0x407906[_0xc8a8('0x3d')]));if(_0x50488e['query'][_0xc8a8('0x4b')]){_0x539a0c['where']=_[_0xc8a8('0x4c')](_0x539a0c[_0xc8a8('0x49')],{'$or':_[_0xc8a8('0x38')](_0x318b25,function(_0x3445b9){if(_0x3445b9['type']!==_0xc8a8('0x4d')){var _0x2fe25c={};_0x2fe25c[_0x3445b9[_0xc8a8('0x36')]]={'$like':'%'+_0x50488e[_0xc8a8('0x40')][_0xc8a8('0x4b')]+'%'};return _0x2fe25c;}})});}_0x539a0c=_[_0xc8a8('0x4c')]({},_0x539a0c,_0x50488e[_0xc8a8('0x4e')]);var _0x3e0294={'where':_0x539a0c[_0xc8a8('0x49')]};return db['Trunk'][_0xc8a8('0x4f')](_0x3e0294)[_0xc8a8('0x1e')](function(_0x4d1c49){_0x4398bd[_0xc8a8('0x4f')]=_0x4d1c49;if(_0x50488e[_0xc8a8('0x40')][_0xc8a8('0x50')]){_0x539a0c[_0xc8a8('0x51')]=[{'all':!![]}];}return db[_0xc8a8('0x39')][_0xc8a8('0x52')](_0x539a0c);})[_0xc8a8('0x1e')](function(_0x35b1dc){_0x4398bd['rows']=_0x35b1dc;return _0x4398bd;})[_0xc8a8('0x1e')](respondWithFilteredResult(_0x56dae6,_0x539a0c))[_0xc8a8('0x28')](handleError(_0x56dae6,null));};exports['show']=function(_0x3d3193,_0xf6198e){var _0x10aaed={'raw':![],'where':{'id':_0x3d3193[_0xc8a8('0x53')]['id']}},_0x5c18ac={};_0x5c18ac[_0xc8a8('0x3f')]=_[_0xc8a8('0x3c')](db[_0xc8a8('0x39')][_0xc8a8('0x54')]);_0x5c18ac[_0xc8a8('0x40')]=_[_0xc8a8('0x3c')](_0x3d3193[_0xc8a8('0x40')]);_0x5c18ac[_0xc8a8('0x3d')]=_[_0xc8a8('0x3e')](_0x5c18ac[_0xc8a8('0x3f')],_0x5c18ac[_0xc8a8('0x40')]);_0x10aaed['attributes']=_[_0xc8a8('0x3e')](_0x5c18ac[_0xc8a8('0x3f')],qs['fields'](_0x3d3193[_0xc8a8('0x40')][_0xc8a8('0x42')]));_0x10aaed[_0xc8a8('0x41')]=_0x10aaed['attributes'][_0xc8a8('0x43')]?_0x10aaed['attributes']:_0x5c18ac[_0xc8a8('0x3f')];if(_0x3d3193['query']['includeAll']){_0x10aaed[_0xc8a8('0x51')]=[{'all':!![]}];}_0x10aaed=_[_0xc8a8('0x4c')]({},_0x10aaed,_0x3d3193[_0xc8a8('0x4e')]);return db['Trunk']['find'](_0x10aaed)['then'](handleEntityNotFound(_0xf6198e,null))[_0xc8a8('0x1e')](respondWithResult(_0xf6198e,null))[_0xc8a8('0x28')](handleError(_0xf6198e,null));};exports[_0xc8a8('0x55')]=function(_0x37e094,_0x802341){var _0x3c2f75={'where':{'id':_0x37e094[_0xc8a8('0x53')]['id']}},_0x446fc3={};_0x446fc3['model']=_['keys'](db[_0xc8a8('0x39')][_0xc8a8('0x54')]);_0x3c2f75['attributes']=_[_0xc8a8('0x3e')](_0x446fc3['model'],qs[_0xc8a8('0x42')](_0x37e094['query'][_0xc8a8('0x42')]));_0x3c2f75[_0xc8a8('0x41')]=_0x3c2f75[_0xc8a8('0x41')]['length']?_0x3c2f75[_0xc8a8('0x41')]:_0x446fc3['model'];if(_0x37e094[_0xc8a8('0x40')][_0xc8a8('0x50')]){_0x3c2f75[_0xc8a8('0x51')]=[{'all':!![]}];}_0x3c2f75=_[_0xc8a8('0x4c')]({},_0x3c2f75,_0x37e094[_0xc8a8('0x4e')]);return db[_0xc8a8('0x39')][_0xc8a8('0x56')](_0x3c2f75)['then'](handleEntityNotFound(_0x802341,null))[_0xc8a8('0x1e')](function(_0x558bdc){if(_0x558bdc){var _0x5df060=_0x558bdc[_0xc8a8('0x32')]({'plain':!![]});_0x5df060=qs['omit'](_0x5df060,['id',_0xc8a8('0x57'),'updatedAt']);_0x37e094['body']=_[_0xc8a8('0x58')](_0x37e094[_0xc8a8('0x59')],['id',_0xc8a8('0x57'),_0xc8a8('0x5a')]);return db['Trunk'][_0xc8a8('0x5b')](_[_0xc8a8('0x4c')](_0x5df060,_0x37e094[_0xc8a8('0x59')]),{'include':_0x37e094[_0xc8a8('0x40')]['includeAll']?[{'all':!![]}]:undefined})[_0xc8a8('0x1e')](function(_0x26fb63){var _0x291694=_0x37e094[_0xc8a8('0x5c')][_0xc8a8('0x32')]({'plain':!![]});if(!_0x291694)throw new Error(_0xc8a8('0x5d'));if(_0x291694[_0xc8a8('0x5e')]===_0xc8a8('0x5c')){var _0x15d812=_0x26fb63[_0xc8a8('0x32')]({'plain':!![]});var _0x578cdd=_0xc8a8('0x33');return db[_0xc8a8('0x5f')][_0xc8a8('0x56')]({'where':{'name':_0x578cdd,'userProfileId':_0x291694[_0xc8a8('0x60')]},'raw':!![]})['then'](function(_0x15479f){if(_0x15479f&&_0x15479f[_0xc8a8('0x61')]===0x0){return db[_0xc8a8('0x62')]['create']({'name':_0x15d812[_0xc8a8('0x36')],'resourceId':_0x15d812['id'],'type':_0x15479f[_0xc8a8('0x36')],'sectionId':_0x15479f['id']},{})['then'](function(){return _0x26fb63;});}else{return _0x26fb63;}})[_0xc8a8('0x28')](function(_0x2bbe9c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2bbe9c);throw _0x2bbe9c;});}return _0x26fb63;});}})[_0xc8a8('0x1e')](respondWithResult(_0x802341,0xc9))[_0xc8a8('0x28')](handleError(_0x802341,null));};exports[_0xc8a8('0x5b')]=function(_0x2e151d,_0x388f06,_0x66d3d4){var _0x2b5d05;return db[_0xc8a8('0x39')][_0xc8a8('0x5b')](_0x2e151d[_0xc8a8('0x59')],{'raw':!![]})['then'](function(_0x216289){_0x2b5d05=_0x216289;return db[_0xc8a8('0x39')][_0xc8a8('0x52')]({'raw':!![]});})[_0xc8a8('0x1e')](function(_0x19bc27){var _0x4a976a=fs[_0xc8a8('0x63')](path[_0xc8a8('0x64')](config[_0xc8a8('0x65')],_0xc8a8('0x66')),'utf8');var _0x139c25=fs['readFileSync'](path[_0xc8a8('0x64')](config[_0xc8a8('0x65')],'server/files/templates/registry.ejs'),'utf8');var _0xff219a=ejs[_0xc8a8('0x67')](_0x4a976a,{'trunks':_0x19bc27||[]});fs[_0xc8a8('0x68')](_0xc8a8('0x69'),_0xff219a);if(_0x2b5d05[_0xc8a8('0x6a')]){var _0x8cc23=ejs[_0xc8a8('0x67')](_0x139c25,{'trunks':_0x19bc27||[]});fs[_0xc8a8('0x68')](_0xc8a8('0x6b'),_0x8cc23);}})[_0xc8a8('0x1e')](function(){return respondWithRpcPromise('Reload',_0xc8a8('0x5b'),{'module':_0xc8a8('0x6c')});})[_0xc8a8('0x1e')](function(){var _0x1e574b=_0x2e151d[_0xc8a8('0x5c')][_0xc8a8('0x32')]({'plain':!![]});if(!_0x1e574b)throw new Error(_0xc8a8('0x5d'));if(_0x1e574b[_0xc8a8('0x5e')]==='user'){var _0x59d48=_0x2b5d05[_0xc8a8('0x32')]({'plain':!![]});return db[_0xc8a8('0x5f')][_0xc8a8('0x56')]({'where':{'name':_0xc8a8('0x33'),'userProfileId':_0x1e574b[_0xc8a8('0x60')]},'raw':!![]})[_0xc8a8('0x1e')](function(_0x496778){if(_0x496778&&_0x496778['autoAssociation']===0x0){return db[_0xc8a8('0x62')]['create']({'name':_0x59d48['name'],'resourceId':_0x59d48['id'],'type':_0x496778[_0xc8a8('0x36')],'sectionId':_0x496778['id']},{})[_0xc8a8('0x1e')](function(){return _0x2b5d05;});}else{return _0x2b5d05;}})['catch'](function(_0x4534b6){logger[_0xc8a8('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4534b6);throw _0x4534b6;});}return _0x2b5d05;})[_0xc8a8('0x1e')](respondWithResult(_0x388f06,0xc9))[_0xc8a8('0x28')](handleError(_0x388f06,null));};exports[_0xc8a8('0x30')]=function(_0x5d5e39,_0x57f512,_0x2e5df6){var _0x357053;return db['Trunk'][_0xc8a8('0x56')]({'where':{'id':_0x5d5e39[_0xc8a8('0x53')]['id']}})[_0xc8a8('0x1e')](handleEntityNotFound(_0x57f512,null))[_0xc8a8('0x1e')](saveUpdates(_0x5d5e39['body'],null))[_0xc8a8('0x1e')](function(_0x411c09){if(_0x411c09){_0x357053=_0x411c09;return db[_0xc8a8('0x39')]['findAll']({'raw':!![]});}})[_0xc8a8('0x1e')](function(_0x4cc1c7){if(_0x4cc1c7){var _0x115325=fs[_0xc8a8('0x63')](path[_0xc8a8('0x64')](config['root'],_0xc8a8('0x66')),_0xc8a8('0x6d'));var _0x1e176e=fs['readFileSync'](path[_0xc8a8('0x64')](config['root'],_0xc8a8('0x6e')),_0xc8a8('0x6d'));var _0x5d2b06=ejs[_0xc8a8('0x67')](_0x115325,{'trunks':_0x4cc1c7||[]});fs[_0xc8a8('0x68')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5d2b06);var _0x17adde=ejs[_0xc8a8('0x67')](_0x1e176e,{'trunks':_0x4cc1c7||[]});fs[_0xc8a8('0x68')](_0xc8a8('0x6b'),_0x17adde);return respondWithRpcPromise('Reload',_0xc8a8('0x30'),{'module':_0xc8a8('0x6c')});}return null;})[_0xc8a8('0x1e')](function(_0x1346ce){if(_0x1346ce){return _0x357053;}})[_0xc8a8('0x1e')](respondWithResult(_0x57f512,null))[_0xc8a8('0x28')](handleError(_0x57f512,null));};exports[_0xc8a8('0x31')]=function(_0x4d5993,_0x19bd4c,_0x399ca2){var _0x24d1f1;return db[_0xc8a8('0x39')][_0xc8a8('0x56')]({'where':{'id':_0x4d5993[_0xc8a8('0x53')]['id']}})[_0xc8a8('0x1e')](handleEntityNotFound(_0x19bd4c,null))[_0xc8a8('0x1e')](removeEntity(_0x19bd4c,null))[_0xc8a8('0x1e')](function(){return db[_0xc8a8('0x39')]['findAll']({'raw':!![]});})['then'](function(_0x1ca92d){var _0x274ef5=fs[_0xc8a8('0x63')](path[_0xc8a8('0x64')](config[_0xc8a8('0x65')],'server/files/templates/trunk.ejs'),_0xc8a8('0x6d'));var _0x3e9d51=fs[_0xc8a8('0x63')](path['join'](config[_0xc8a8('0x65')],_0xc8a8('0x6e')),_0xc8a8('0x6d'));var _0x2990a2=ejs[_0xc8a8('0x67')](_0x274ef5,{'trunks':_0x1ca92d});var _0x345399=ejs[_0xc8a8('0x67')](_0x3e9d51,{'trunks':_0x1ca92d});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x2990a2);fs[_0xc8a8('0x68')](_0xc8a8('0x6b'),_0x345399);return respondWithRpcPromise(_0xc8a8('0x6f'),_0xc8a8('0x31'),{'module':_0xc8a8('0x6c')});})[_0xc8a8('0x28')](handleError(_0x19bd4c,null));}; \ No newline at end of file +var _0x6e18=['info','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','reject','save','then','destroy','get','Trunks','stack','name','send','index','map','Trunk','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','includeAll','find','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/trunk.ejs','utf8','render','/etc/asterisk/sip_xcally_trunks.conf','registry','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','role','userProfileId','root','server/files/templates/registry.ejs','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','client','http','test','ValidationError','request'];(function(_0xbc4659,_0x578fba){var _0x5831f9=function(_0x5eb0eb){while(--_0x5eb0eb){_0xbc4659['push'](_0xbc4659['shift']());}};_0x5831f9(++_0x578fba);}(_0x6e18,0xc1));var _0x86e1=function(_0x4b6a08,_0x1f608e){_0x4b6a08=_0x4b6a08-0x0;var _0x44b8b9=_0x6e18[_0x4b6a08];return _0x44b8b9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x86e1('0x0'));var rimraf=require(_0x86e1('0x1'));var zipdir=require(_0x86e1('0x2'));var jsonpatch=require(_0x86e1('0x3'));var rp=require(_0x86e1('0x4'));var moment=require('moment');var BPromise=require(_0x86e1('0x5'));var Mustache=require(_0x86e1('0x6'));var util=require(_0x86e1('0x7'));var path=require(_0x86e1('0x8'));var sox=require('sox');var csv=require(_0x86e1('0x9'));var ejs=require(_0x86e1('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x86e1('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86e1('0xc'));var toCsv=require(_0x86e1('0x9'));var querystring=require('querystring');var Papa=require(_0x86e1('0xd'));var Redis=require('ioredis');var authService=require(_0x86e1('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x86e1('0xf'));var hardwareService=require(_0x86e1('0x10'));var logger=require('../../config/logger')(_0x86e1('0x11'));var utils=require(_0x86e1('0x12'));var config=require('../../config/environment');var db=require(_0x86e1('0x13'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x86e1('0x14')][_0x86e1('0x15')]({'port':0x232a});function checkPasswordPattern(_0x4452a0,_0x2c9367,_0xb9e86f){if(_0xb9e86f){var _0x9808d7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x9808d7[_0x86e1('0x16')](_0x2c9367)){return _0x4452a0;}else{throw new db['Sequelize'][(_0x86e1('0x17'))]('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 _0x4452a0;}}function respondWithRpcPromise(_0x278218,_0x3c15cc,_0x118af9,_0x29a386){return new BPromise(function(_0x201b94,_0x1e7784){var _0x54d61d=_0x29a386||client;return _0x54d61d[_0x86e1('0x18')](_0x278218,_0x118af9)['then'](function(_0x481d4d){logger[_0x86e1('0x19')](_0x86e1('0x1a'),_0x3c15cc,'request\x20sent');logger[_0x86e1('0x1b')]('Trunk,\x20%s,\x20%s,\x20%s',_0x3c15cc,_0x86e1('0x1c'),JSON[_0x86e1('0x1d')](_0x481d4d));if(_0x481d4d[_0x86e1('0x1e')]){if(_0x481d4d[_0x86e1('0x1e')][_0x86e1('0x1f')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x3c15cc,_0x481d4d['error'][_0x86e1('0x20')]);return _0x1e7784(_0x481d4d['error'][_0x86e1('0x20')]);}logger['error'](_0x86e1('0x1a'),_0x3c15cc,_0x481d4d[_0x86e1('0x1e')][_0x86e1('0x20')]);return _0x201b94(_0x481d4d['error'][_0x86e1('0x20')]);}else{logger['info']('Trunk,\x20%s,\x20%s',_0x3c15cc,_0x86e1('0x1c'));_0x201b94(_0x481d4d['result'][_0x86e1('0x20')]);}})[_0x86e1('0x21')](function(_0x30be22){logger[_0x86e1('0x1e')]('Trunk,\x20%s,\x20%s',_0x3c15cc,_0x30be22);_0x1e7784(_0x30be22);});});}function respondWithStatusCode(_0x2a0224,_0x486905){_0x486905=_0x486905||0xcc;return function(_0x11e5e1){if(_0x11e5e1){return _0x2a0224[_0x86e1('0x22')](_0x486905);}return _0x2a0224[_0x86e1('0x23')](_0x486905)[_0x86e1('0x24')]();};}function respondWithResult(_0x3fe7ed,_0x2d6418){_0x2d6418=_0x2d6418||0xc8;return function(_0x5c3b9f){if(_0x5c3b9f){return _0x3fe7ed[_0x86e1('0x23')](_0x2d6418)[_0x86e1('0x25')](_0x5c3b9f);}};}function respondWithFilteredResult(_0x4813a6,_0x160aea){return function(_0x5f2e78){if(_0x5f2e78){var _0x246b6e=_0x5f2e78[_0x86e1('0x26')],_0x355483=_0x160aea[_0x86e1('0x27')],_0x2fa4ed=_0x160aea[_0x86e1('0x27')]+_0x160aea[_0x86e1('0x28')],_0xb37394;if(_0x2fa4ed>=_0x246b6e){_0x2fa4ed=_0x246b6e;_0xb37394=0xc8;}else{_0xb37394=0xce;}_0x4813a6['status'](_0xb37394);return _0x4813a6['set']('Content-Range',_0x355483+'-'+_0x2fa4ed+'/'+_0x246b6e)[_0x86e1('0x25')](_0x5f2e78);}return null;};}function patchUpdates(_0x32329b){return function(_0x114f7f){try{jsonpatch['apply'](_0x114f7f,_0x32329b,!![]);}catch(_0x5b1b4e){return BPromise[_0x86e1('0x29')](_0x5b1b4e);}return _0x114f7f[_0x86e1('0x2a')]();};}function saveUpdates(_0x28aaf1,_0x400821){return function(_0x125a5b){if(_0x125a5b){return _0x125a5b['update'](_0x28aaf1)[_0x86e1('0x2b')](function(_0x5ae9cd){return _0x5ae9cd;});}return null;};}function removeEntity(_0xf5a572,_0xbae95d){return function(_0x5ae71f){if(_0x5ae71f){return _0x5ae71f[_0x86e1('0x2c')]()[_0x86e1('0x2b')](function(){var _0x48a487=_0x5ae71f[_0x86e1('0x2d')]({'plain':!![]});var _0x3e6c39=_0x86e1('0x2e');return db['UserProfileResource'][_0x86e1('0x2c')]({'where':{'type':_0x3e6c39,'resourceId':_0x48a487['id']}})[_0x86e1('0x2b')](function(){return _0x5ae71f;});})[_0x86e1('0x2b')](function(){_0xf5a572['status'](0xcc)[_0x86e1('0x24')]();});}};}function handleEntityNotFound(_0x237f40,_0x50a15d){return function(_0xb0b795){if(!_0xb0b795){_0x237f40['sendStatus'](0x194);}return _0xb0b795;};}function handleError(_0x4c53c8,_0x2e14ab){_0x2e14ab=_0x2e14ab||0x1f4;return function(_0x116f53){logger[_0x86e1('0x1e')](_0x116f53[_0x86e1('0x2f')]);if(_0x116f53[_0x86e1('0x30')]){delete _0x116f53[_0x86e1('0x30')];}_0x4c53c8['status'](_0x2e14ab)[_0x86e1('0x31')](_0x116f53);};}exports[_0x86e1('0x32')]=function(_0x386b0a,_0x25d090){var _0x2c45c0={},_0x44f670={},_0xceb90c={'count':0x0,'rows':[]};var _0x5b95e2=_[_0x86e1('0x33')](db[_0x86e1('0x34')][_0x86e1('0x35')],function(_0x3b14ef){return{'name':_0x3b14ef[_0x86e1('0x36')],'type':_0x3b14ef[_0x86e1('0x37')][_0x86e1('0x38')]};});_0x44f670[_0x86e1('0x39')]=_['map'](_0x5b95e2,_0x86e1('0x30'));_0x44f670['query']=_[_0x86e1('0x3a')](_0x386b0a['query']);_0x44f670[_0x86e1('0x3b')]=_[_0x86e1('0x3c')](_0x44f670['model'],_0x44f670[_0x86e1('0x3d')]);_0x2c45c0['attributes']=_['intersection'](_0x44f670[_0x86e1('0x39')],qs['fields'](_0x386b0a[_0x86e1('0x3d')][_0x86e1('0x3e')]));_0x2c45c0[_0x86e1('0x3f')]=_0x2c45c0[_0x86e1('0x3f')][_0x86e1('0x40')]?_0x2c45c0[_0x86e1('0x3f')]:_0x44f670['model'];if(!_0x386b0a['query'][_0x86e1('0x41')](_0x86e1('0x42'))){_0x2c45c0[_0x86e1('0x28')]=qs[_0x86e1('0x28')](_0x386b0a[_0x86e1('0x3d')][_0x86e1('0x28')]);_0x2c45c0['offset']=qs['offset'](_0x386b0a[_0x86e1('0x3d')][_0x86e1('0x27')]);}_0x2c45c0[_0x86e1('0x43')]=qs[_0x86e1('0x44')](_0x386b0a['query'][_0x86e1('0x44')]);_0x2c45c0[_0x86e1('0x45')]=qs[_0x86e1('0x3b')](_[_0x86e1('0x46')](_0x386b0a[_0x86e1('0x3d')],_0x44f670[_0x86e1('0x3b')]));if(_0x386b0a[_0x86e1('0x3d')]['filter']){_0x2c45c0[_0x86e1('0x45')]=_[_0x86e1('0x47')](_0x2c45c0[_0x86e1('0x45')],{'$or':_['map'](_0x5b95e2,function(_0x5d13c6){if(_0x5d13c6[_0x86e1('0x37')]!==_0x86e1('0x48')){var _0x5eead4={};_0x5eead4[_0x5d13c6['name']]={'$like':'%'+_0x386b0a['query'][_0x86e1('0x49')]+'%'};return _0x5eead4;}})});}_0x2c45c0=_['merge']({},_0x2c45c0,_0x386b0a[_0x86e1('0x4a')]);var _0x46b9be={'where':_0x2c45c0[_0x86e1('0x45')]};return db[_0x86e1('0x34')][_0x86e1('0x26')](_0x46b9be)[_0x86e1('0x2b')](function(_0xbe168a){_0xceb90c['count']=_0xbe168a;if(_0x386b0a['query']['includeAll']){_0x2c45c0[_0x86e1('0x4b')]=[{'all':!![]}];}return db[_0x86e1('0x34')][_0x86e1('0x4c')](_0x2c45c0);})[_0x86e1('0x2b')](function(_0x4251bc){_0xceb90c[_0x86e1('0x4d')]=_0x4251bc;return _0xceb90c;})[_0x86e1('0x2b')](respondWithFilteredResult(_0x25d090,_0x2c45c0))['catch'](handleError(_0x25d090,null));};exports[_0x86e1('0x4e')]=function(_0x1afa86,_0x691c90){var _0x423000={'raw':![],'where':{'id':_0x1afa86[_0x86e1('0x4f')]['id']}},_0x238b91={};_0x238b91['model']=_[_0x86e1('0x3a')](db[_0x86e1('0x34')][_0x86e1('0x35')]);_0x238b91[_0x86e1('0x3d')]=_[_0x86e1('0x3a')](_0x1afa86['query']);_0x238b91[_0x86e1('0x3b')]=_[_0x86e1('0x3c')](_0x238b91['model'],_0x238b91[_0x86e1('0x3d')]);_0x423000['attributes']=_[_0x86e1('0x3c')](_0x238b91['model'],qs[_0x86e1('0x3e')](_0x1afa86[_0x86e1('0x3d')][_0x86e1('0x3e')]));_0x423000[_0x86e1('0x3f')]=_0x423000[_0x86e1('0x3f')][_0x86e1('0x40')]?_0x423000[_0x86e1('0x3f')]:_0x238b91['model'];if(_0x1afa86['query'][_0x86e1('0x50')]){_0x423000[_0x86e1('0x4b')]=[{'all':!![]}];}_0x423000=_['merge']({},_0x423000,_0x1afa86[_0x86e1('0x4a')]);return db[_0x86e1('0x34')][_0x86e1('0x51')](_0x423000)['then'](handleEntityNotFound(_0x691c90,null))[_0x86e1('0x2b')](respondWithResult(_0x691c90,null))[_0x86e1('0x21')](handleError(_0x691c90,null));};exports['clone']=function(_0x28f69c,_0x1b5a3c){var _0xd27688={'where':{'id':_0x28f69c['params']['id']}},_0x1b1561={};_0x1b1561[_0x86e1('0x39')]=_[_0x86e1('0x3a')](db[_0x86e1('0x34')][_0x86e1('0x35')]);_0xd27688[_0x86e1('0x3f')]=_[_0x86e1('0x3c')](_0x1b1561[_0x86e1('0x39')],qs['fields'](_0x28f69c[_0x86e1('0x3d')][_0x86e1('0x3e')]));_0xd27688[_0x86e1('0x3f')]=_0xd27688[_0x86e1('0x3f')]['length']?_0xd27688['attributes']:_0x1b1561[_0x86e1('0x39')];if(_0x28f69c[_0x86e1('0x3d')][_0x86e1('0x50')]){_0xd27688[_0x86e1('0x4b')]=[{'all':!![]}];}_0xd27688=_[_0x86e1('0x47')]({},_0xd27688,_0x28f69c[_0x86e1('0x4a')]);return db[_0x86e1('0x34')][_0x86e1('0x51')](_0xd27688)[_0x86e1('0x2b')](handleEntityNotFound(_0x1b5a3c,null))[_0x86e1('0x2b')](function(_0x58348d){if(_0x58348d){var _0xfd054d=_0x58348d[_0x86e1('0x2d')]({'plain':!![]});_0xfd054d=qs[_0x86e1('0x52')](_0xfd054d,['id',_0x86e1('0x53'),_0x86e1('0x54')]);_0x28f69c[_0x86e1('0x55')]=_[_0x86e1('0x52')](_0x28f69c[_0x86e1('0x55')],['id','createdAt',_0x86e1('0x54')]);return db[_0x86e1('0x34')][_0x86e1('0x56')](_[_0x86e1('0x47')](_0xfd054d,_0x28f69c[_0x86e1('0x55')]),{'include':_0x28f69c[_0x86e1('0x3d')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0xc5697e){var _0x24125d=_0x28f69c[_0x86e1('0x57')]['get']({'plain':!![]});if(!_0x24125d)throw new Error(_0x86e1('0x58'));if(_0x24125d['role']===_0x86e1('0x57')){var _0x42ad76=_0xc5697e[_0x86e1('0x2d')]({'plain':!![]});var _0x54fb94='Trunks';return db[_0x86e1('0x59')]['find']({'where':{'name':_0x54fb94,'userProfileId':_0x24125d['userProfileId']},'raw':!![]})[_0x86e1('0x2b')](function(_0x41fd30){if(_0x41fd30&&_0x41fd30[_0x86e1('0x5a')]===0x0){return db[_0x86e1('0x5b')][_0x86e1('0x56')]({'name':_0x42ad76[_0x86e1('0x30')],'resourceId':_0x42ad76['id'],'type':_0x41fd30['name'],'sectionId':_0x41fd30['id']},{})[_0x86e1('0x2b')](function(){return _0xc5697e;});}else{return _0xc5697e;}})['catch'](function(_0x64e63){logger[_0x86e1('0x1e')](_0x86e1('0x5c'),_0x64e63);throw _0x64e63;});}return _0xc5697e;});}})[_0x86e1('0x2b')](respondWithResult(_0x1b5a3c,0xc9))['catch'](handleError(_0x1b5a3c,null));};exports[_0x86e1('0x56')]=function(_0x57bd99,_0x5bfd53,_0x41d554){var _0x1d07bc;return db[_0x86e1('0x34')][_0x86e1('0x56')](_0x57bd99[_0x86e1('0x55')],{'raw':!![]})[_0x86e1('0x2b')](function(_0x18e95e){_0x1d07bc=_0x18e95e;return db[_0x86e1('0x34')]['findAll']({'raw':!![]});})[_0x86e1('0x2b')](function(_0x10d441){var _0x3f988a=fs[_0x86e1('0x5d')](path[_0x86e1('0x5e')](config['root'],_0x86e1('0x5f')),_0x86e1('0x60'));var _0x377eb1=fs[_0x86e1('0x5d')](path[_0x86e1('0x5e')](config['root'],'server/files/templates/registry.ejs'),_0x86e1('0x60'));var _0x4c9a53=ejs[_0x86e1('0x61')](_0x3f988a,{'trunks':_0x10d441||[]});fs['writeFileSync'](_0x86e1('0x62'),_0x4c9a53);if(_0x1d07bc[_0x86e1('0x63')]){var _0x5a6460=ejs[_0x86e1('0x61')](_0x377eb1,{'trunks':_0x10d441||[]});fs[_0x86e1('0x64')](_0x86e1('0x65'),_0x5a6460);}})[_0x86e1('0x2b')](function(){return respondWithRpcPromise(_0x86e1('0x66'),_0x86e1('0x56'),{'module':_0x86e1('0x67')});})['then'](function(){var _0x131f99=_0x57bd99[_0x86e1('0x57')][_0x86e1('0x2d')]({'plain':!![]});if(!_0x131f99)throw new Error(_0x86e1('0x58'));if(_0x131f99[_0x86e1('0x68')]===_0x86e1('0x57')){var _0xa6da37=_0x1d07bc['get']({'plain':!![]});return db[_0x86e1('0x59')][_0x86e1('0x51')]({'where':{'name':_0x86e1('0x2e'),'userProfileId':_0x131f99[_0x86e1('0x69')]},'raw':!![]})[_0x86e1('0x2b')](function(_0x4775d9){if(_0x4775d9&&_0x4775d9[_0x86e1('0x5a')]===0x0){return db[_0x86e1('0x5b')]['create']({'name':_0xa6da37['name'],'resourceId':_0xa6da37['id'],'type':_0x4775d9['name'],'sectionId':_0x4775d9['id']},{})[_0x86e1('0x2b')](function(){return _0x1d07bc;});}else{return _0x1d07bc;}})[_0x86e1('0x21')](function(_0x43a668){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43a668);throw _0x43a668;});}return _0x1d07bc;})[_0x86e1('0x2b')](respondWithResult(_0x5bfd53,0xc9))[_0x86e1('0x21')](handleError(_0x5bfd53,null));};exports['update']=function(_0x209c2f,_0x64c799,_0x553341){var _0x5bd0c1;return db[_0x86e1('0x34')]['find']({'where':{'id':_0x209c2f[_0x86e1('0x4f')]['id']}})[_0x86e1('0x2b')](handleEntityNotFound(_0x64c799,null))[_0x86e1('0x2b')](saveUpdates(_0x209c2f[_0x86e1('0x55')],null))[_0x86e1('0x2b')](function(_0x216113){if(_0x216113){_0x5bd0c1=_0x216113;return db[_0x86e1('0x34')][_0x86e1('0x4c')]({'raw':!![]});}})[_0x86e1('0x2b')](function(_0x301abe){if(_0x301abe){var _0x28776d=fs[_0x86e1('0x5d')](path[_0x86e1('0x5e')](config[_0x86e1('0x6a')],_0x86e1('0x5f')),_0x86e1('0x60'));var _0x2f3ff1=fs[_0x86e1('0x5d')](path['join'](config[_0x86e1('0x6a')],_0x86e1('0x6b')),_0x86e1('0x60'));var _0x47a3c5=ejs[_0x86e1('0x61')](_0x28776d,{'trunks':_0x301abe||[]});fs[_0x86e1('0x64')](_0x86e1('0x62'),_0x47a3c5);var _0x51b3de=ejs[_0x86e1('0x61')](_0x2f3ff1,{'trunks':_0x301abe||[]});fs[_0x86e1('0x64')](_0x86e1('0x65'),_0x51b3de);return respondWithRpcPromise(_0x86e1('0x66'),_0x86e1('0x6c'),{'module':_0x86e1('0x67')});}return null;})[_0x86e1('0x2b')](function(_0x133148){if(_0x133148){return _0x5bd0c1;}})[_0x86e1('0x2b')](respondWithResult(_0x64c799,null))['catch'](handleError(_0x64c799,null));};exports['destroy']=function(_0x2a86b8,_0x54ac00,_0x46d808){var _0x309076;return db['Trunk'][_0x86e1('0x51')]({'where':{'id':_0x2a86b8[_0x86e1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x54ac00,null))[_0x86e1('0x2b')](removeEntity(_0x54ac00,null))[_0x86e1('0x2b')](function(){return db[_0x86e1('0x34')][_0x86e1('0x4c')]({'raw':!![]});})[_0x86e1('0x2b')](function(_0x5f1d28){var _0x1c67d8=fs[_0x86e1('0x5d')](path[_0x86e1('0x5e')](config[_0x86e1('0x6a')],_0x86e1('0x5f')),_0x86e1('0x60'));var _0x578c50=fs[_0x86e1('0x5d')](path[_0x86e1('0x5e')](config[_0x86e1('0x6a')],_0x86e1('0x6b')),_0x86e1('0x60'));var _0x5a487f=ejs[_0x86e1('0x61')](_0x1c67d8,{'trunks':_0x5f1d28});var _0x3c12dc=ejs[_0x86e1('0x61')](_0x578c50,{'trunks':_0x5f1d28});fs[_0x86e1('0x64')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5a487f);fs[_0x86e1('0x64')](_0x86e1('0x65'),_0x3c12dc);return respondWithRpcPromise('Reload',_0x86e1('0x2c'),{'module':'chan_sip.so'});})['catch'](handleError(_0x54ac00,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 037098a..b1556c1 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 _0xd5fe=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks'];(function(_0x528c4b,_0x3aaa85){var _0x367caf=function(_0x43d4ba){while(--_0x43d4ba){_0x528c4b['push'](_0x528c4b['shift']());}};_0x367caf(++_0x3aaa85);}(_0xd5fe,0x168));var _0xed5f=function(_0xf10840,_0xad3916){_0xf10840=_0xf10840-0x0;var _0x1fdf7e=_0xd5fe[_0xf10840];return _0x1fdf7e;};'use strict';var _=require(_0xed5f('0x0'));var util=require(_0xed5f('0x1'));var logger=require(_0xed5f('0x2'))(_0xed5f('0x3'));var moment=require(_0xed5f('0x4'));var BPromise=require(_0xed5f('0x5'));var rp=require(_0xed5f('0x6'));var fs=require('fs');var path=require(_0xed5f('0x7'));var rimraf=require(_0xed5f('0x8'));var config=require(_0xed5f('0x9'));var attributes=require(_0xed5f('0xa'));module[_0xed5f('0xb')]=function(_0x482107,_0x1e8b10){return _0x482107[_0xed5f('0xc')](_0xed5f('0xd'),attributes,{'tableName':_0xed5f('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfcdb=['request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger','api','bluebird'];(function(_0x1a9f94,_0x65e3dc){var _0x1db2ae=function(_0x5c9e9a){while(--_0x5c9e9a){_0x1a9f94['push'](_0x1a9f94['shift']());}};_0x1db2ae(++_0x65e3dc);}(_0xfcdb,0xa3));var _0xbfcd=function(_0x580869,_0x540760){_0x580869=_0x580869-0x0;var _0x3bfc5d=_0xfcdb[_0x580869];return _0x3bfc5d;};'use strict';var _=require(_0xbfcd('0x0'));var util=require(_0xbfcd('0x1'));var logger=require(_0xbfcd('0x2'))(_0xbfcd('0x3'));var moment=require('moment');var BPromise=require(_0xbfcd('0x4'));var rp=require(_0xbfcd('0x5'));var fs=require('fs');var path=require(_0xbfcd('0x6'));var rimraf=require(_0xbfcd('0x7'));var config=require(_0xbfcd('0x8'));var attributes=require(_0xbfcd('0x9'));module[_0xbfcd('0xa')]=function(_0x3b39f0,_0x36bac7){return _0x3b39f0[_0xbfcd('0xb')](_0xbfcd('0xc'),attributes,{'tableName':_0xbfcd('0xd'),'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 0f16716..fd9d6da 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 _0x5f66=['debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','GetTrunk','findAll','options','attributes','limit','include','model','map','ShowTrunk','Trunk','raw','where','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','Trunk,\x20%s,\x20%s','request\x20sent'];(function(_0x34cfd7,_0x209113){var _0x1d9742=function(_0x59e242){while(--_0x59e242){_0x34cfd7['push'](_0x34cfd7['shift']());}};_0x1d9742(++_0x209113);}(_0x5f66,0x1a0));var _0x65f6=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5f66[_0xefd519];return _0x4bb882;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('Trunk,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}exports[_0x65f6('0x15')]=function(_0x1f974c){var _0xc8660c=this;return new Promise(function(_0x18380e,_0x495dd6){return db['Trunk'][_0x65f6('0x16')]({'raw':_0x1f974c['options']?_0x1f974c['options']['raw']===undefined?!![]:![]:!![],'where':_0x1f974c[_0x65f6('0x17')]?_0x1f974c[_0x65f6('0x17')]['where']||null:null,'attributes':_0x1f974c[_0x65f6('0x17')]?_0x1f974c[_0x65f6('0x17')][_0x65f6('0x18')]||null:null,'limit':_0x1f974c[_0x65f6('0x17')]?_0x1f974c[_0x65f6('0x17')][_0x65f6('0x19')]||null:null,'include':_0x1f974c['options']?_0x1f974c[_0x65f6('0x17')]['include']?_['map'](_0x1f974c[_0x65f6('0x17')][_0x65f6('0x1a')],function(_0x524e42){return{'model':db[_0x524e42[_0x65f6('0x1b')]],'as':_0x524e42['as'],'attributes':_0x524e42[_0x65f6('0x18')],'include':_0x524e42[_0x65f6('0x1a')]?_[_0x65f6('0x1c')](_0x524e42['include'],function(_0x9d7bb0){return{'model':db[_0x9d7bb0[_0x65f6('0x1b')]],'as':_0x9d7bb0['as'],'attributes':_0x9d7bb0[_0x65f6('0x18')],'include':_0x9d7bb0['include']?_['map'](_0x9d7bb0['include'],function(_0x29abdb){return{'model':db[_0x29abdb[_0x65f6('0x1b')]],'as':_0x29abdb['as'],'attributes':_0x29abdb['attributes']};}):[]};}):[]};}):[]:[]})[_0x65f6('0xa')](function(_0x28f710){logger['info'](_0x65f6('0x15'),_0x1f974c);logger[_0x65f6('0xd')](_0x65f6('0x15'),_0x1f974c,JSON['stringify'](_0x28f710));_0x18380e(_0x28f710);})['catch'](function(_0x488d36){logger[_0x65f6('0x12')](_0x65f6('0x15'),_0x488d36[_0x65f6('0x11')],_0x1f974c);_0x495dd6(_0xc8660c[_0x65f6('0x12')](0x1f4,_0x488d36[_0x65f6('0x11')]));});});};exports[_0x65f6('0x1d')]=function(_0x144e55){var _0x4ace4c=this;return new Promise(function(_0x4ea23d,_0x154cbd){return db[_0x65f6('0x1e')]['find']({'raw':_0x144e55['options']?_0x144e55[_0x65f6('0x17')][_0x65f6('0x1f')]===undefined?!![]:![]:!![],'where':_0x144e55[_0x65f6('0x17')]?_0x144e55[_0x65f6('0x17')][_0x65f6('0x20')]||null:null,'attributes':_0x144e55[_0x65f6('0x17')]?_0x144e55['options'][_0x65f6('0x18')]||null:null,'include':_0x144e55[_0x65f6('0x17')]?_0x144e55[_0x65f6('0x17')]['include']?_[_0x65f6('0x1c')](_0x144e55[_0x65f6('0x17')][_0x65f6('0x1a')],function(_0x45510a){return{'model':db[_0x45510a[_0x65f6('0x1b')]],'as':_0x45510a['as'],'attributes':_0x45510a[_0x65f6('0x18')],'include':_0x45510a['include']?_[_0x65f6('0x1c')](_0x45510a[_0x65f6('0x1a')],function(_0x4f3e22){return{'model':db[_0x4f3e22[_0x65f6('0x1b')]],'as':_0x4f3e22['as'],'attributes':_0x4f3e22['attributes'],'include':_0x4f3e22[_0x65f6('0x1a')]?_['map'](_0x4f3e22[_0x65f6('0x1a')],function(_0x24f7fd){return{'model':db[_0x24f7fd['model']],'as':_0x24f7fd['as'],'attributes':_0x24f7fd[_0x65f6('0x18')]};}):[]};}):[]};}):[]:[]})[_0x65f6('0xa')](function(_0x3b261d){logger['info']('ShowTrunk',_0x144e55);logger[_0x65f6('0xd')]('ShowTrunk',_0x144e55,JSON[_0x65f6('0xf')](_0x3b261d));_0x4ea23d(_0x3b261d);})['catch'](function(_0x22d760){logger[_0x65f6('0x12')]('ShowTrunk',_0x22d760[_0x65f6('0x11')],_0x144e55);_0x154cbd(_0x4ace4c['error'](0x1f4,_0x22d760['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(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x5f2f,0x73));var _0xf5f2=function(_0x29a8da,_0x329267){_0x29a8da=_0x29a8da-0x0;var _0x31e7aa=_0x5f2f[_0x29a8da];return _0x31e7aa;};'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 dd507b5..6009fdc 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 _0x5f66=['/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','/:id/sms_accounts','addChatWebsites','/:id/square_projects','addSquareProjects','put','/:id','update','/:id/password','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeFaxInteractions','removeSmsInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeApiKey','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./user.controller','isAuthenticated','index','describe','get','/whoami','whoami','show','/:id/avatar','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','/:id/prefixes','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getSquareProjects','getScheduledCalls','/:id/api_key','getApiKey','post','bulkCreate','addContacts','create','addQueues','root','server/files/images/','format','originalname','file','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause'];(function(_0xff0c88,_0x35f357){var _0x24d5be=function(_0x57a563){while(--_0x57a563){_0xff0c88['push'](_0xff0c88['shift']());}};_0x24d5be(++_0x35f357);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var auth=require(_0x65f6('0x4'));var interaction=require(_0x65f6('0x5'));var config=require('../../config/environment');var controller=require(_0x65f6('0x6'));router['get']('/',auth[_0x65f6('0x7')](),controller[_0x65f6('0x8')]);router['get']('/describe',auth[_0x65f6('0x7')](),controller[_0x65f6('0x9')]);router[_0x65f6('0xa')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller[_0x65f6('0xc')]);router['get']('/:id',auth[_0x65f6('0x7')](),controller[_0x65f6('0xd')]);router[_0x65f6('0xa')](_0x65f6('0xe'),controller['getAvatar']);router[_0x65f6('0xa')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x65f6('0xf')]);router['get'](_0x65f6('0x10'),auth['isAuthenticated'](),controller[_0x65f6('0x11')]);router[_0x65f6('0xa')](_0x65f6('0x12'),auth[_0x65f6('0x7')](),controller[_0x65f6('0x13')]);router[_0x65f6('0xa')](_0x65f6('0x14'),auth[_0x65f6('0x7')](),controller[_0x65f6('0x15')]);router[_0x65f6('0xa')]('/:id/recordings',auth[_0x65f6('0x7')](),controller['getRecordings']);router['get'](_0x65f6('0x16'),auth[_0x65f6('0x7')](),controller[_0x65f6('0x17')]);router[_0x65f6('0xa')](_0x65f6('0x18'),auth[_0x65f6('0x7')](),controller[_0x65f6('0x19')]);router[_0x65f6('0xa')]('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0x65f6('0x1a')]);router['get']('/:id/mail/interactions',auth['isAuthenticated'](),controller[_0x65f6('0x1b')]);router[_0x65f6('0xa')]('/:id/sms/interactions',auth[_0x65f6('0x7')](),controller[_0x65f6('0x1c')]);router[_0x65f6('0xa')](_0x65f6('0x1d'),auth[_0x65f6('0x7')](),controller[_0x65f6('0x1e')]);router['get'](_0x65f6('0x1f'),auth['isAuthenticated'](),controller['getTeams']);router[_0x65f6('0xa')](_0x65f6('0x20'),auth['isAuthenticated'](),controller[_0x65f6('0x21')]);router[_0x65f6('0xa')](_0x65f6('0x22'),auth[_0x65f6('0x7')](),controller['getAgents']);router[_0x65f6('0xa')](_0x65f6('0x23'),auth[_0x65f6('0x7')](),controller['getVoicePrefixes']);router['get']('/:id/fax_accounts',auth[_0x65f6('0x7')](),controller[_0x65f6('0x24')]);router['get'](_0x65f6('0x25'),auth[_0x65f6('0x7')](),controller['getMailAccounts']);router[_0x65f6('0xa')](_0x65f6('0x26'),auth[_0x65f6('0x7')](),controller['getOpenchannelAccounts']);router['get']('/:id/sms_accounts',auth[_0x65f6('0x7')](),controller[_0x65f6('0x27')]);router[_0x65f6('0xa')](_0x65f6('0x28'),auth[_0x65f6('0x7')](),controller[_0x65f6('0x29')]);router[_0x65f6('0xa')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0x65f6('0x2a')]);router[_0x65f6('0xa')]('/:id/scheduled_calls',auth['isAuthenticated'](),controller[_0x65f6('0x2b')]);router[_0x65f6('0xa')](_0x65f6('0x2c'),auth[_0x65f6('0x7')](),controller[_0x65f6('0x2d')]);router[_0x65f6('0x2e')]('/create_many',auth[_0x65f6('0x7')](),controller[_0x65f6('0x2f')]);router[_0x65f6('0x2e')]('/:id/contacts',auth[_0x65f6('0x7')](),controller[_0x65f6('0x30')]);router[_0x65f6('0x2e')]('/',auth[_0x65f6('0x7')](),controller[_0x65f6('0x31')]);router[_0x65f6('0x2e')]('/:id/queues',auth[_0x65f6('0x7')](),controller[_0x65f6('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x36dbf4,_0x5a740a,_0x2b403b){_0x2b403b(null,path['join'](config[_0x65f6('0x33')],_0x65f6('0x34')));},'filename':function(_0x5ce050,_0x12dee6,_0x13e41a){_0x13e41a(null,util[_0x65f6('0x35')]('%s-%s',Date['now'](),_0x12dee6[_0x65f6('0x36')]));}})});router['post'](_0x65f6('0xe'),upload['single'](_0x65f6('0x37')),controller[_0x65f6('0x38')]);router['post'](_0x65f6('0x39'),auth['isAuthenticated'](),controller['login']);router[_0x65f6('0x2e')](_0x65f6('0x3a'),auth[_0x65f6('0x7')](),controller[_0x65f6('0x3b')]);router[_0x65f6('0x2e')](_0x65f6('0x3c'),auth[_0x65f6('0x7')](),controller[_0x65f6('0x3d')]);router['post'](_0x65f6('0x3e'),auth['isAuthenticated'](),controller[_0x65f6('0x3f')]);router[_0x65f6('0x2e')](_0x65f6('0x1f'),auth[_0x65f6('0x7')](),controller['addTeams']);router[_0x65f6('0x2e')](_0x65f6('0x40'),auth[_0x65f6('0x7')](),controller[_0x65f6('0x41')]);router[_0x65f6('0x2e')](_0x65f6('0x42'),auth[_0x65f6('0x7')](),controller[_0x65f6('0x43')]);router[_0x65f6('0x2e')]('/:id/fax_interactions',auth[_0x65f6('0x7')](),controller[_0x65f6('0x44')]);router[_0x65f6('0x2e')](_0x65f6('0x45'),auth[_0x65f6('0x7')](),controller[_0x65f6('0x46')]);router[_0x65f6('0x2e')](_0x65f6('0x47'),auth[_0x65f6('0x7')](),controller[_0x65f6('0x48')]);router[_0x65f6('0x2e')](_0x65f6('0x49'),auth[_0x65f6('0x7')](),controller[_0x65f6('0x4a')]);router[_0x65f6('0x2e')](_0x65f6('0x25'),auth['isAuthenticated'](),controller[_0x65f6('0x4b')]);router[_0x65f6('0x2e')](_0x65f6('0x26'),auth[_0x65f6('0x7')](),controller['addOpenchannelAccounts']);router[_0x65f6('0x2e')](_0x65f6('0x4c'),auth[_0x65f6('0x7')](),controller['addSmsAccounts']);router[_0x65f6('0x2e')](_0x65f6('0x28'),auth[_0x65f6('0x7')](),controller[_0x65f6('0x4d')]);router['post'](_0x65f6('0x4e'),auth['isAuthenticated'](),controller[_0x65f6('0x4f')]);router[_0x65f6('0x2e')]('/:id/api_key',auth[_0x65f6('0x7')](),controller['createApiKey']);router[_0x65f6('0x50')](_0x65f6('0x51'),auth[_0x65f6('0x7')](),controller[_0x65f6('0x52')]);router[_0x65f6('0x50')](_0x65f6('0x53'),auth['isAuthenticated'](),controller['changePassword']);router[_0x65f6('0x54')](_0x65f6('0x10'),auth[_0x65f6('0x7')](),controller[_0x65f6('0x55')]);router[_0x65f6('0x54')](_0x65f6('0x1f'),auth[_0x65f6('0x7')](),controller[_0x65f6('0x56')]);router[_0x65f6('0x54')]('/:id',auth[_0x65f6('0x7')](),controller[_0x65f6('0x57')]);router[_0x65f6('0x54')]('/:id/chat_interactions',auth[_0x65f6('0x7')](),controller[_0x65f6('0x58')]);router['delete'](_0x65f6('0x42'),auth[_0x65f6('0x7')](),controller['removeMailInteractions']);router[_0x65f6('0x54')]('/:id/fax_interactions',auth[_0x65f6('0x7')](),controller[_0x65f6('0x59')]);router[_0x65f6('0x54')]('/:id/sms_interactions',auth[_0x65f6('0x7')](),controller[_0x65f6('0x5a')]);router['delete'](_0x65f6('0x47'),auth[_0x65f6('0x7')](),controller['removeOpenchannelInteractions']);router[_0x65f6('0x54')](_0x65f6('0x49'),auth[_0x65f6('0x7')](),controller[_0x65f6('0x5b')]);router[_0x65f6('0x54')](_0x65f6('0x25'),auth[_0x65f6('0x7')](),controller[_0x65f6('0x5c')]);router['delete']('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x65f6('0x5d')]);router[_0x65f6('0x54')](_0x65f6('0x4c'),auth[_0x65f6('0x7')](),controller['removeSmsAccounts']);router[_0x65f6('0x54')](_0x65f6('0x28'),auth[_0x65f6('0x7')](),controller['removeChatWebsites']);router[_0x65f6('0x54')](_0x65f6('0x4e'),auth[_0x65f6('0x7')](),controller['removeSquareProjects']);router['delete'](_0x65f6('0x2c'),auth[_0x65f6('0x7')](),controller[_0x65f6('0x5e')]);module[_0x65f6('0x5f')]=router; \ No newline at end of file +var _0x1261=['getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','/create_many','addContacts','create','diskStorage','server/files/images/','format','%s-%s','single','file','login','/:id/logout','/:id/pause','pause','/:id/unpause','/:id/teams','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','addSmsInteractions','/:id/openchannel_interactions','/:id/fax_accounts','/:id/openchannel_accounts','addSquareProjects','/:id/api_key','put','update','changePassword','removeQueues','removeTeams','delete','destroy','/:id/fax_interactions','/:id/sms_interactions','removeSmsInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','/:id/square_projects','removeSquareProjects','removeApiKey','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','/describe','describe','/whoami','isAuthenticated','whoami','/:id','show','/:id/avatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/screen_recordings','/:id/chat/interactions','/:id/openchannel/interactions','getMailInteractions','/:id/fax/interactions','getFaxInteractions','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites'];(function(_0xab2cbf,_0x167723){var _0x2e58ec=function(_0x5bc3cb){while(--_0x5bc3cb){_0xab2cbf['push'](_0xab2cbf['shift']());}};_0x2e58ec(++_0x167723);}(_0x1261,0x144));var _0x1126=function(_0x3396cd,_0x4047f0){_0x3396cd=_0x3396cd-0x0;var _0x2d6b4a=_0x1261[_0x3396cd];return _0x2d6b4a;};'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['get'](_0x1126('0xf'),auth[_0x1126('0xd')](),controller[_0x1126('0x10')]);router['get'](_0x1126('0x11'),controller['getAvatar']);router['get'](_0x1126('0x12'),auth['isAuthenticated'](),controller[_0x1126('0x13')]);router[_0x1126('0x9')](_0x1126('0x14'),auth[_0x1126('0xd')](),controller[_0x1126('0x15')]);router[_0x1126('0x9')](_0x1126('0x16'),auth[_0x1126('0xd')](),controller[_0x1126('0x17')]);router['get']('/:id/groups',auth[_0x1126('0xd')](),controller[_0x1126('0x18')]);router[_0x1126('0x9')]('/:id/recordings',auth[_0x1126('0xd')](),controller['getRecordings']);router[_0x1126('0x9')](_0x1126('0x19'),auth[_0x1126('0xd')](),controller['getScreenRecordings']);router[_0x1126('0x9')](_0x1126('0x1a'),auth['isAuthenticated'](),controller['getChatInteractions']);router[_0x1126('0x9')](_0x1126('0x1b'),auth['isAuthenticated'](),controller['getOpenchannelInteractions']);router[_0x1126('0x9')]('/:id/mail/interactions',auth[_0x1126('0xd')](),controller[_0x1126('0x1c')]);router[_0x1126('0x9')]('/:id/sms/interactions',auth[_0x1126('0xd')](),controller['getSmsInteractions']);router['get'](_0x1126('0x1d'),auth[_0x1126('0xd')](),controller[_0x1126('0x1e')]);router[_0x1126('0x9')]('/:id/teams',auth[_0x1126('0xd')](),controller[_0x1126('0x1f')]);router['get'](_0x1126('0x20'),auth['isAuthenticated'](),controller['getLists']);router['get'](_0x1126('0x21'),auth[_0x1126('0xd')](),controller[_0x1126('0x22')]);router[_0x1126('0x9')](_0x1126('0x23'),auth[_0x1126('0xd')](),controller[_0x1126('0x24')]);router[_0x1126('0x9')]('/:id/fax_accounts',auth[_0x1126('0xd')](),controller[_0x1126('0x25')]);router[_0x1126('0x9')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x1126('0x26')]);router[_0x1126('0x9')]('/:id/openchannel_accounts',auth[_0x1126('0xd')](),controller[_0x1126('0x27')]);router['get'](_0x1126('0x28'),auth['isAuthenticated'](),controller[_0x1126('0x29')]);router['get'](_0x1126('0x2a'),auth['isAuthenticated'](),controller[_0x1126('0x2b')]);router['get']('/:id/square_projects',auth['isAuthenticated'](),controller[_0x1126('0x2c')]);router[_0x1126('0x9')](_0x1126('0x2d'),auth['isAuthenticated'](),controller[_0x1126('0x2e')]);router[_0x1126('0x9')]('/:id/api_key',auth[_0x1126('0xd')](),controller[_0x1126('0x2f')]);router[_0x1126('0x30')](_0x1126('0x31'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0x1126('0x30')](_0x1126('0x12'),auth[_0x1126('0xd')](),controller[_0x1126('0x32')]);router['post']('/',auth[_0x1126('0xd')](),controller[_0x1126('0x33')]);router[_0x1126('0x30')](_0x1126('0x14'),auth[_0x1126('0xd')](),controller['addQueues']);var upload=multer({'storage':multer[_0x1126('0x34')]({'destination':function(_0x457efd,_0x1e8402,_0x42e773){_0x42e773(null,path['join'](config['root'],_0x1126('0x35')));},'filename':function(_0x31d07c,_0x511e6b,_0xde37cf){_0xde37cf(null,util[_0x1126('0x36')](_0x1126('0x37'),Date['now'](),_0x511e6b['originalname']));}})});router[_0x1126('0x30')](_0x1126('0x11'),upload[_0x1126('0x38')](_0x1126('0x39')),controller['addAvatar']);router[_0x1126('0x30')]('/:id/login',auth[_0x1126('0xd')](),controller[_0x1126('0x3a')]);router[_0x1126('0x30')](_0x1126('0x3b'),auth[_0x1126('0xd')](),controller['logout']);router[_0x1126('0x30')](_0x1126('0x3c'),auth[_0x1126('0xd')](),controller[_0x1126('0x3d')]);router[_0x1126('0x30')](_0x1126('0x3e'),auth[_0x1126('0xd')](),controller['unpause']);router[_0x1126('0x30')](_0x1126('0x3f'),auth[_0x1126('0xd')](),controller[_0x1126('0x40')]);router[_0x1126('0x30')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x1126('0x41')]);router[_0x1126('0x30')](_0x1126('0x42'),auth[_0x1126('0xd')](),controller[_0x1126('0x43')]);router[_0x1126('0x30')]('/:id/fax_interactions',auth['isAuthenticated'](),controller['addFaxInteractions']);router[_0x1126('0x30')]('/:id/sms_interactions',auth[_0x1126('0xd')](),controller[_0x1126('0x44')]);router[_0x1126('0x30')](_0x1126('0x45'),auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router[_0x1126('0x30')](_0x1126('0x46'),auth[_0x1126('0xd')](),controller['addFaxAccounts']);router[_0x1126('0x30')]('/:id/mail_accounts',auth[_0x1126('0xd')](),controller['addMailAccounts']);router[_0x1126('0x30')](_0x1126('0x47'),auth[_0x1126('0xd')](),controller['addOpenchannelAccounts']);router[_0x1126('0x30')](_0x1126('0x28'),auth[_0x1126('0xd')](),controller['addSmsAccounts']);router['post']('/:id/chat_websites',auth[_0x1126('0xd')](),controller['addChatWebsites']);router[_0x1126('0x30')]('/:id/square_projects',auth[_0x1126('0xd')](),controller[_0x1126('0x48')]);router[_0x1126('0x30')](_0x1126('0x49'),auth[_0x1126('0xd')](),controller['createApiKey']);router[_0x1126('0x4a')](_0x1126('0xf'),auth['isAuthenticated'](),controller[_0x1126('0x4b')]);router[_0x1126('0x4a')]('/:id/password',auth[_0x1126('0xd')](),controller[_0x1126('0x4c')]);router['delete'](_0x1126('0x14'),auth[_0x1126('0xd')](),controller[_0x1126('0x4d')]);router['delete'](_0x1126('0x3f'),auth[_0x1126('0xd')](),controller[_0x1126('0x4e')]);router[_0x1126('0x4f')](_0x1126('0xf'),auth[_0x1126('0xd')](),controller[_0x1126('0x50')]);router[_0x1126('0x4f')]('/:id/chat_interactions',auth[_0x1126('0xd')](),controller['removeChatInteractions']);router[_0x1126('0x4f')](_0x1126('0x42'),auth['isAuthenticated'](),controller['removeMailInteractions']);router[_0x1126('0x4f')](_0x1126('0x51'),auth[_0x1126('0xd')](),controller['removeFaxInteractions']);router[_0x1126('0x4f')](_0x1126('0x52'),auth[_0x1126('0xd')](),controller[_0x1126('0x53')]);router['delete'](_0x1126('0x45'),auth[_0x1126('0xd')](),controller['removeOpenchannelInteractions']);router['delete']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x1126('0x54')]);router[_0x1126('0x4f')]('/:id/mail_accounts',auth[_0x1126('0xd')](),controller[_0x1126('0x55')]);router[_0x1126('0x4f')](_0x1126('0x47'),auth[_0x1126('0xd')](),controller['removeOpenchannelAccounts']);router[_0x1126('0x4f')](_0x1126('0x28'),auth['isAuthenticated'](),controller[_0x1126('0x56')]);router[_0x1126('0x4f')](_0x1126('0x2a'),auth[_0x1126('0xd')](),controller[_0x1126('0x57')]);router['delete'](_0x1126('0x58'),auth['isAuthenticated'](),controller[_0x1126('0x59')]);router[_0x1126('0x4f')](_0x1126('0x49'),auth['isAuthenticated'](),controller[_0x1126('0x5a')]);module[_0x1126('0x5b')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index c96b446..d10f0cb 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(_0x402094,_0x33a6e6){var _0x2f2d3c=function(_0x497c72){while(--_0x497c72){_0x402094['push'](_0x402094['shift']());}};_0x2f2d3c(++_0x33a6e6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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(_0x5d5fcd,_0x165444){var _0x5ec451=function(_0x1fb0c5){while(--_0x1fb0c5){_0x5d5fcd['push'](_0x5d5fcd['shift']());}};_0x5ec451(++_0x165444);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 aca3735..961bc69 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 _0xbbdd=['getAgents','Agents','values','addChatInteractions','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','SquareProject','getSquareProjects','addSquareProjects','CmHopper','$and','$or','$gt','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','$contained','$any','firstName','lastName','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','eml-format','zip-dir','fast-json-patch','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','defaults','redis','localhost','socket.io-emitter','./user.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~!@#$%^&-_=+[{]}.','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','Users','user','agent','Telephones','telephone','map','value','includes','role','name','stack','send','index','User','rawAttributes','fieldName','key','differenceBy','password','query','keys','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','sequelize','lower','options','include','findAll','rows','show','params','salt','length','includeAll','bulkCreate','body','find','describe','addContacts','ids','omit','admin','../../config/license/util','getLicense','telephones','users','isNil','License\x20limit\x20reached','format','count\x20%s:\x20%s','create','internal','Setting','findById','securePassword','min_internal','max','QueryTypes','SELECT','from','mailbox','email','permissions','101','102','103','104','106','108','109','100','111','VoiceMail','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','oldPassword','newPassword','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','Sequelize','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','addQueues','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queues','penalty','spread','emit','voice','VoiceQueue','push','SIP/%s','each','UserVoiceQueueRt','upsert','removeQueues','QueueId','addAvatar','userpic','file','getAvatar','join','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','root','getContacts','findOne','CmContact','CmList','List','Tags','color','tag','getQueues','Queue','pick','Unknown\x20role','getVoiceQueuesRt','nolimit','getGroups','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','headers','x-forwarded-for','connection','socket','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','all','LOGIN','PAUSE','LOGININPAUSE','concat','isMiddleware','resolve','logout','pause','QueuePause','getChannels','DEFAULT\x20PAUSE','mailPause','faxPause','openchannelPause','smsPause','pauseType','lastPauseAt','manual','mail','chat','fax','sms','openchannel','%s%s','Pause','unpause','getTeams','addTeams','Team','setDataValue','Voice','getChatQueues','Chat','getMailQueues','Mail','getSmsQueues','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','transaction','addAgent','getDataValue','Queue:save','removeTeams','getVoiceQueues','flatten','removeAgent','Queue:remove','getLists'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xbbdd,0x1ba));var _0xdbbd=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0xbbdd[_0x5a79e2];return _0x266c45;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdbbd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdbbd('0x1'));var jsonpatch=require(_0xdbbd('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdbbd('0x3'));var util=require('util');var path=require('path');var sox=require(_0xdbbd('0x4'));var csv=require(_0xdbbd('0x5'));var ejs=require(_0xdbbd('0x6'));var fs=require('fs');var _=require(_0xdbbd('0x7'));var squel=require('squel');var crypto=require(_0xdbbd('0x8'));var jsforce=require(_0xdbbd('0x9'));var deskjs=require(_0xdbbd('0xa'));var toCsv=require(_0xdbbd('0x5'));var querystring=require(_0xdbbd('0xb'));var Papa=require(_0xdbbd('0xc'));var Redis=require(_0xdbbd('0xd'));var authService=require(_0xdbbd('0xe'));var qs=require(_0xdbbd('0xf'));var as=require(_0xdbbd('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdbbd('0x11'))(_0xdbbd('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0xdbbd('0x13')](config[_0xdbbd('0x14')],{'host':_0xdbbd('0x15'),'port':0x18eb});var socket=require(_0xdbbd('0x16'))(new Redis(config[_0xdbbd('0x14')]));require(_0xdbbd('0x17'))[_0xdbbd('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0xdbbd('0x19')][_0xdbbd('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x4f5a4c,_0x38dc82,_0x1a64d9){if(_0x1a64d9){var _0x2c76ad=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c76ad[_0xdbbd('0x1b')](_0x38dc82)){return _0x4f5a4c;}else{throw new db['Sequelize'][(_0xdbbd('0x1c'))](_0xdbbd('0x1d'));}}else{return _0x4f5a4c;}}function respondWithRpcPromise(_0x54ee58,_0x87438c,_0x158894,_0x26eb4c){return new BPromise(function(_0x315b2d,_0x322ffc){var _0x536a69=_0x26eb4c||client;return _0x536a69['request'](_0x54ee58,_0x158894)['then'](function(_0x397210){logger[_0xdbbd('0x1e')](_0xdbbd('0x1f'),_0x87438c,_0xdbbd('0x20'));logger[_0xdbbd('0x21')]('User,\x20%s,\x20%s,\x20%s',_0x87438c,_0xdbbd('0x20'),JSON[_0xdbbd('0x22')](_0x397210));if(_0x397210[_0xdbbd('0x23')]){if(_0x397210[_0xdbbd('0x23')][_0xdbbd('0x24')]===0x1f4){logger[_0xdbbd('0x23')]('User,\x20%s,\x20%s',_0x87438c,_0x397210['error'][_0xdbbd('0x25')]);return _0x322ffc(_0x397210['error'][_0xdbbd('0x25')]);}logger[_0xdbbd('0x23')](_0xdbbd('0x1f'),_0x87438c,_0x397210[_0xdbbd('0x23')]['message']);return _0x315b2d(_0x397210[_0xdbbd('0x23')][_0xdbbd('0x25')]);}else{logger[_0xdbbd('0x1e')]('User,\x20%s,\x20%s',_0x87438c,_0xdbbd('0x20'));_0x315b2d(_0x397210[_0xdbbd('0x26')][_0xdbbd('0x25')]);}})[_0xdbbd('0x27')](function(_0x31f535){logger[_0xdbbd('0x23')]('User,\x20%s,\x20%s',_0x87438c,_0x31f535);_0x322ffc(_0x31f535);});});}function respondWithStatusCode(_0xeaa316,_0x44062a){_0x44062a=_0x44062a||0xcc;return function(_0xb11f5d){if(_0xb11f5d){return _0xeaa316[_0xdbbd('0x28')](_0x44062a);}return _0xeaa316[_0xdbbd('0x29')](_0x44062a)[_0xdbbd('0x2a')]();};}function respondWithResult(_0x22d6cc,_0x5f2a3f){_0x5f2a3f=_0x5f2a3f||0xc8;return function(_0x2d287d){if(_0x2d287d){return _0x22d6cc['status'](_0x5f2a3f)[_0xdbbd('0x2b')](_0x2d287d);}};}function respondWithFilteredResult(_0x52f1c9,_0x192572){return function(_0x1337bf){if(_0x1337bf){var _0x49aeab=_0x1337bf[_0xdbbd('0x2c')],_0x24da65=_0x192572[_0xdbbd('0x2d')],_0x2ce1eb=_0x192572[_0xdbbd('0x2d')]+_0x192572[_0xdbbd('0x2e')],_0x107c08;if(_0x2ce1eb>=_0x49aeab){_0x2ce1eb=_0x49aeab;_0x107c08=0xc8;}else{_0x107c08=0xce;}_0x52f1c9[_0xdbbd('0x29')](_0x107c08);return _0x52f1c9[_0xdbbd('0x2f')](_0xdbbd('0x30'),_0x24da65+'-'+_0x2ce1eb+'/'+_0x49aeab)['json'](_0x1337bf);}return null;};}function patchUpdates(_0x35e87a){return function(_0x3c5d79){try{jsonpatch[_0xdbbd('0x31')](_0x3c5d79,_0x35e87a,!![]);}catch(_0x226bb){return BPromise[_0xdbbd('0x32')](_0x226bb);}return _0x3c5d79['save']();};}function saveUpdates(_0x252eb4,_0x420db4){return function(_0x14189a){if(_0x14189a){return _0x14189a[_0xdbbd('0x33')](_0x252eb4)[_0xdbbd('0x34')](function(_0x5460e7){return _0x5460e7;});}return null;};}function removeEntity(_0x479b91,_0x35120f){return function(_0x189c8b){if(_0x189c8b){return _0x189c8b[_0xdbbd('0x35')]()[_0xdbbd('0x34')](function(){var _0x57aa55=_0x189c8b[_0xdbbd('0x36')]({'plain':!![]});var _0x5e26bc=[{'name':_0xdbbd('0x37'),'value':_0xdbbd('0x38'),'ignore':!![]},{'name':'Agents','value':_0xdbbd('0x39'),'ignore':![]},{'name':_0xdbbd('0x3a'),'value':_0xdbbd('0x3b'),'ignore':![]}];var _0x82b1d7=_(_0x5e26bc)['filter']('ignore')[_0xdbbd('0x3c')](_0xdbbd('0x3d'))[_0xdbbd('0x3d')]();if(_[_0xdbbd('0x3e')](_0x82b1d7,_0x57aa55[_0xdbbd('0x3f')])){return;}var _0x40e247=_['find'](_0x5e26bc,['value',_0x57aa55[_0xdbbd('0x3f')]])[_0xdbbd('0x40')];return db['UserProfileResource'][_0xdbbd('0x35')]({'where':{'type':_0x40e247,'resourceId':_0x57aa55['id']}})[_0xdbbd('0x34')](function(){return _0x189c8b;});})['then'](function(){_0x479b91[_0xdbbd('0x29')](0xcc)[_0xdbbd('0x2a')]();});}};}function handleEntityNotFound(_0xbf3b81,_0x573568){return function(_0x10cd3f){if(!_0x10cd3f){_0xbf3b81[_0xdbbd('0x28')](0x194);}return _0x10cd3f;};}function handleError(_0x53da26,_0x52c574){_0x52c574=_0x52c574||0x1f4;return function(_0xc61d6f){logger[_0xdbbd('0x23')](_0xc61d6f[_0xdbbd('0x41')]);if(_0xc61d6f[_0xdbbd('0x40')]){delete _0xc61d6f[_0xdbbd('0x40')];}_0x53da26[_0xdbbd('0x29')](_0x52c574)[_0xdbbd('0x42')](_0xc61d6f);};}exports[_0xdbbd('0x43')]=function(_0xceeac3,_0x373788){var _0x3122f4={},_0x1bf934={},_0x1f26b9={'count':0x0,'rows':[]};var _0xa42562=_[_0xdbbd('0x3c')](db[_0xdbbd('0x44')][_0xdbbd('0x45')],function(_0x4c93e0){return{'name':_0x4c93e0[_0xdbbd('0x46')],'type':_0x4c93e0['type'][_0xdbbd('0x47')]};});_0x1bf934['model']=_[_0xdbbd('0x48')](_['map'](_0xa42562,_0xdbbd('0x40')),[_0xdbbd('0x49'),'salt']);_0x1bf934[_0xdbbd('0x4a')]=_[_0xdbbd('0x4b')](_0xceeac3[_0xdbbd('0x4a')]);_0x1bf934['filters']=_[_0xdbbd('0x4c')](_0x1bf934[_0xdbbd('0x4d')],_0x1bf934[_0xdbbd('0x4a')]);_0x3122f4['attributes']=_['intersection'](_0x1bf934[_0xdbbd('0x4d')],qs[_0xdbbd('0x4e')](_0xceeac3[_0xdbbd('0x4a')][_0xdbbd('0x4e')]));_0x3122f4[_0xdbbd('0x4f')]=_0x3122f4[_0xdbbd('0x4f')]['length']?_0x3122f4[_0xdbbd('0x4f')]:_0x1bf934[_0xdbbd('0x4d')];if(!_0xceeac3[_0xdbbd('0x4a')][_0xdbbd('0x50')]('nolimit')){_0x3122f4[_0xdbbd('0x2e')]=qs['limit'](_0xceeac3[_0xdbbd('0x4a')][_0xdbbd('0x2e')]);_0x3122f4['offset']=qs[_0xdbbd('0x2d')](_0xceeac3[_0xdbbd('0x4a')][_0xdbbd('0x2d')]);}_0x3122f4[_0xdbbd('0x51')]=qs[_0xdbbd('0x52')](_0xceeac3['query'][_0xdbbd('0x52')]);_0x3122f4[_0xdbbd('0x53')]=qs[_0xdbbd('0x54')](_['pick'](_0xceeac3[_0xdbbd('0x4a')],_0x1bf934[_0xdbbd('0x54')]));if(_0xceeac3[_0xdbbd('0x4a')][_0xdbbd('0x55')]){_0x3122f4[_0xdbbd('0x53')]=_[_0xdbbd('0x56')](_0x3122f4[_0xdbbd('0x53')],{'$or':_['map'](_0xa42562,function(_0x37191c){if(_0x37191c[_0xdbbd('0x57')]!==_0xdbbd('0x58')){return db[_0xdbbd('0x59')]['where'](db['sequelize']['fn'](_0xdbbd('0x5a'),db['sequelize']['col'](_0x37191c['name'])),{'$like':db['sequelize']['fn'](_0xdbbd('0x5a'),'%'+_0xceeac3['query'][_0xdbbd('0x55')]+'%')});}})});}_0x3122f4=_[_0xdbbd('0x56')]({},_0x3122f4,_0xceeac3[_0xdbbd('0x5b')]);var _0x235c6a={'where':_0x3122f4[_0xdbbd('0x53')]};return db[_0xdbbd('0x44')]['count'](_0x235c6a)[_0xdbbd('0x34')](function(_0x17a0e8){_0x1f26b9[_0xdbbd('0x2c')]=_0x17a0e8;if(_0xceeac3[_0xdbbd('0x4a')]['includeAll']){_0x3122f4[_0xdbbd('0x5c')]=[{'all':!![]}];}return db[_0xdbbd('0x44')][_0xdbbd('0x5d')](_0x3122f4);})[_0xdbbd('0x34')](function(_0x4bd45e){_0x1f26b9[_0xdbbd('0x5e')]=_0x4bd45e;return _0x1f26b9;})['then'](respondWithFilteredResult(_0x373788,_0x3122f4))[_0xdbbd('0x27')](handleError(_0x373788,null));};exports[_0xdbbd('0x5f')]=function(_0x580ec9,_0x62526){var _0x47ce0b={'raw':![],'where':{'id':_0x580ec9[_0xdbbd('0x60')]['id']}},_0x3c30db={};_0x3c30db[_0xdbbd('0x4d')]=_['differenceBy'](_[_0xdbbd('0x4b')](db[_0xdbbd('0x44')][_0xdbbd('0x45')]),['password',_0xdbbd('0x61')]);_0x3c30db[_0xdbbd('0x4a')]=_['keys'](_0x580ec9[_0xdbbd('0x4a')]);_0x3c30db['filters']=_[_0xdbbd('0x4c')](_0x3c30db[_0xdbbd('0x4d')],_0x3c30db[_0xdbbd('0x4a')]);_0x47ce0b[_0xdbbd('0x4f')]=_['intersection'](_0x3c30db[_0xdbbd('0x4d')],qs[_0xdbbd('0x4e')](_0x580ec9['query'][_0xdbbd('0x4e')]));_0x47ce0b[_0xdbbd('0x4f')]=_0x47ce0b[_0xdbbd('0x4f')][_0xdbbd('0x62')]?_0x47ce0b[_0xdbbd('0x4f')]:_0x3c30db[_0xdbbd('0x4d')];if(_0x580ec9['query'][_0xdbbd('0x63')]){_0x47ce0b[_0xdbbd('0x5c')]=[{'all':!![]}];}_0x47ce0b=_['merge']({},_0x47ce0b,_0x580ec9[_0xdbbd('0x5b')]);return db[_0xdbbd('0x44')]['find'](_0x47ce0b)['then'](handleEntityNotFound(_0x62526,null))['then'](respondWithResult(_0x62526,null))[_0xdbbd('0x27')](handleError(_0x62526,null));};exports[_0xdbbd('0x64')]=function(_0xc87709,_0x252949){return db['User'][_0xdbbd('0x64')](_0xc87709[_0xdbbd('0x65')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x252949,0xc9))[_0xdbbd('0x27')](handleError(_0x252949,null));};exports[_0xdbbd('0x33')]=function(_0xa594f1,_0x14f5fe){if(_0xa594f1[_0xdbbd('0x65')]['id']){delete _0xa594f1[_0xdbbd('0x65')]['id'];}delete _0xa594f1[_0xdbbd('0x65')][_0xdbbd('0x3f')];return db[_0xdbbd('0x44')][_0xdbbd('0x66')]({'where':{'id':_0xa594f1[_0xdbbd('0x60')]['id']}})[_0xdbbd('0x34')](handleEntityNotFound(_0x14f5fe,null))['then'](saveUpdates(_0xa594f1['body'],null))[_0xdbbd('0x34')](respondWithResult(_0x14f5fe,null))[_0xdbbd('0x27')](handleError(_0x14f5fe,null));};exports[_0xdbbd('0x67')]=function(_0x2efe76,_0x32f75d){return db[_0xdbbd('0x44')]['describe']()[_0xdbbd('0x34')](respondWithResult(_0x32f75d,null))[_0xdbbd('0x27')](handleError(_0x32f75d,null));};exports[_0xdbbd('0x68')]=function(_0x167bb2,_0x4457ae,_0x5cfeac){return db['User'][_0xdbbd('0x66')]({'where':{'id':_0x167bb2[_0xdbbd('0x60')]['id']}})[_0xdbbd('0x34')](handleEntityNotFound(_0x4457ae,null))[_0xdbbd('0x34')](function(_0x1bcad2){if(_0x1bcad2){return _0x1bcad2[_0xdbbd('0x68')](_0x167bb2[_0xdbbd('0x65')][_0xdbbd('0x69')],_[_0xdbbd('0x6a')](_0x167bb2['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x4457ae,null))[_0xdbbd('0x27')](handleError(_0x4457ae,null));};var getLicense=function(_0x9dd1de){return new BPromise(function(_0x5605fc,_0x348744){var _0x3a2d6a=0x0;_0x9dd1de['body']['role']===_0xdbbd('0x39')&&_0x5605fc('agent\x20role');return db[_0xdbbd('0x44')]['count']({'where':{'$or':[{'role':_0x9dd1de['body'][_0xdbbd('0x3f')]==='telephone'?_0xdbbd('0x3b'):[_0xdbbd('0x6b'),'user']}]}})['then'](function(_0x519143){_0x3a2d6a=_0x519143;return require(_0xdbbd('0x6c'))[_0xdbbd('0x6d')]();})[_0xdbbd('0x34')](function(_0x4f7635){var _0x4e6074=_0x9dd1de[_0xdbbd('0x65')][_0xdbbd('0x3f')]===_0xdbbd('0x3b')?_0xdbbd('0x6e'):_0xdbbd('0x6f');if(!_[_0xdbbd('0x70')](_0x4f7635[_0x4e6074])&&_0x3a2d6a>=_0x4f7635[_0x4e6074]){return _0x348744({'message':_0xdbbd('0x71')});}return _0x5605fc(util[_0xdbbd('0x72')](_0xdbbd('0x73'),_0x4e6074,_0x3a2d6a));})[_0xdbbd('0x27')](function(_0x170452){return _0x348744(_0x170452);});});};exports[_0xdbbd('0x74')]=function(_0x5e469d,_0x391cad){return getLicense(_0x5e469d)[_0xdbbd('0x34')](function(_0x5c3854){if(!_0x5e469d['body'][_0xdbbd('0x75')]){var _0x474868;return db[_0xdbbd('0x76')][_0xdbbd('0x77')](0x1)['then'](function(_0x4fc613){return checkPasswordPattern(_0x4fc613,_0x5e469d[_0xdbbd('0x65')][_0xdbbd('0x49')],_0x4fc613[_0xdbbd('0x78')]);})['then'](function(_0x2e69c3){_0x474868=_0x2e69c3[_0xdbbd('0x79')];return db['User'][_0xdbbd('0x7a')](_0xdbbd('0x75'));})[_0xdbbd('0x34')](function(_0x4fa9c2){if(_['isNil'](_0x4fa9c2)){if(_0x474868){_0x5e469d['body'][_0xdbbd('0x75')]=_0x474868;}else{_0x5e469d[_0xdbbd('0x65')][_0xdbbd('0x75')]=0x1;}}else{if(_[_0xdbbd('0x70')](_0x474868)||_0x474868==_0x4fa9c2){_0x5e469d['body'][_0xdbbd('0x75')]=_0x4fa9c2+0x1;}else if(_0x474868>_0x4fa9c2){_0x5e469d[_0xdbbd('0x65')][_0xdbbd('0x75')]=_0x474868;}else{return db[_0xdbbd('0x59')][_0xdbbd('0x4a')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0xdbbd('0x59')][_0xdbbd('0x7b')][_0xdbbd('0x7c')]})['then'](function(_0x4b356f){if(_0x4b356f&&_0x4b356f[_0xdbbd('0x62')]){for(var _0x526df6=0x0,_0x14eebf=_0x4b356f[_0xdbbd('0x62')];_0x526df6<_0x14eebf&&_[_0xdbbd('0x70')](_0x5e469d[_0xdbbd('0x65')]['internal']);_0x526df6++){if(_0x474868<=_0x4b356f[_0x526df6][_0xdbbd('0x7d')]){_0x5e469d['body'][_0xdbbd('0x75')]=_0x4b356f[_0x526df6][_0xdbbd('0x7d')];}else if(_0x474868>_0x4b356f[_0x526df6][_0xdbbd('0x7d')]&&_0x474868<=_0x4b356f[_0x526df6]['to']){_0x5e469d[_0xdbbd('0x65')][_0xdbbd('0x75')]=_0x474868;}}}if(_['isNil'](_0x5e469d['body']['internal'])){_0x5e469d[_0xdbbd('0x65')][_0xdbbd('0x75')]=_0x4fa9c2+0x1;}});}}});}})[_0xdbbd('0x34')](function(){if(_0x5e469d[_0xdbbd('0x65')]['voicemail']){_0x5e469d['body'][_0xdbbd('0x7e')]=_0x5e469d[_0xdbbd('0x65')][_0xdbbd('0x75')];_0x5e469d['body']['VoiceMail']={'mailbox':_0x5e469d[_0xdbbd('0x65')][_0xdbbd('0x75')],'password':_0x5e469d['body']['password'],'fullname':_0x5e469d[_0xdbbd('0x65')]['fullname'],'email':_0x5e469d['body'][_0xdbbd('0x7f')]};}if(_0x5e469d[_0xdbbd('0x65')]&&_0x5e469d[_0xdbbd('0x65')]['role']===_0xdbbd('0x39')){_0x5e469d['body'][_0xdbbd('0x80')]=[_0xdbbd('0x81'),_0xdbbd('0x82'),_0xdbbd('0x83'),'110',_0xdbbd('0x84'),'105',_0xdbbd('0x85'),'107',_0xdbbd('0x86'),_0xdbbd('0x87'),_0xdbbd('0x88'),_0xdbbd('0x89')];}return db[_0xdbbd('0x44')]['create'](_0x5e469d[_0xdbbd('0x65')],{'include':[{'model':db['VoiceMail'],'as':_0xdbbd('0x8a')}]});})[_0xdbbd('0x34')](function(_0x1728e9){if(_0x5e469d[_0xdbbd('0x65')][_0xdbbd('0x3f')]===_0xdbbd('0x38'))return _0x1728e9;var _0x158c91=_0x5e469d[_0xdbbd('0x38')][_0xdbbd('0x36')]({'plain':!![]});if(!_0x158c91)throw new Error(_0xdbbd('0x8b'));if(_0x158c91[_0xdbbd('0x3f')]===_0xdbbd('0x38')){var _0x129c91=_0x1728e9['get']({'plain':!![]});var _0x152a1f=[{'name':'Agents','value':_0xdbbd('0x39')},{'name':_0xdbbd('0x3a'),'value':_0xdbbd('0x3b')}];var _0x3e6591=_[_0xdbbd('0x66')](_0x152a1f,[_0xdbbd('0x3d'),_0x129c91[_0xdbbd('0x3f')]])[_0xdbbd('0x40')];return db[_0xdbbd('0x8c')]['find']({'where':{'name':_0x3e6591,'userProfileId':_0x158c91[_0xdbbd('0x8d')]},'raw':!![]})[_0xdbbd('0x34')](function(_0x17f25e){if(_0x17f25e&&_0x17f25e[_0xdbbd('0x8e')]===0x0){return db[_0xdbbd('0x8f')][_0xdbbd('0x74')]({'name':_0x129c91['name'],'resourceId':_0x129c91['id'],'type':_0x17f25e[_0xdbbd('0x40')],'sectionId':_0x17f25e['id']},{})[_0xdbbd('0x34')](function(){return _0x1728e9;});}else{return _0x1728e9;}})[_0xdbbd('0x27')](function(_0x542f96){logger[_0xdbbd('0x23')](_0xdbbd('0x90'),_0x542f96);throw _0x542f96;});}return _0x1728e9;})[_0xdbbd('0x34')](respondWithResult(_0x391cad,0xc9))['catch'](handleError(_0x391cad,null));};exports[_0xdbbd('0x91')]=function(_0x128e0e,_0x50b7a9,_0x2c95af){var _0x2265e0=![];if(_0x128e0e[_0xdbbd('0x65')]['id']){delete _0x128e0e[_0xdbbd('0x65')]['id'];}return db['Setting']['findOne']({'attributes':['id',_0xdbbd('0x78')]})[_0xdbbd('0x34')](function(_0x3bec26){_0x2265e0=_0x3bec26[_0xdbbd('0x78')];return db[_0xdbbd('0x44')][_0xdbbd('0x66')]({'where':{'id':_0x128e0e[_0xdbbd('0x60')]['id']}});})['then'](function(_0x293ed7){if(_0x293ed7){if(_0x293ed7['id']==_0x128e0e[_0xdbbd('0x38')]['id']){if(!_0x128e0e[_0xdbbd('0x65')][_0xdbbd('0x92')]||!_0x128e0e['body'][_0xdbbd('0x93')]){throw new db['Sequelize'][(_0xdbbd('0x1c'))](_0xdbbd('0x94'));}if(!_0x293ed7[_0xdbbd('0x95')](_0x128e0e['body']['oldPassword'])){throw new db[(_0xdbbd('0x96'))][(_0xdbbd('0x1c'))](_0xdbbd('0x97'));}if(_0x128e0e[_0xdbbd('0x65')]['oldPassword']==_0x128e0e['body'][_0xdbbd('0x93')]){throw new db[(_0xdbbd('0x96'))][(_0xdbbd('0x1c'))](_0xdbbd('0x98'));}return _0x293ed7;}else if(_0x128e0e['user']['role']=='admin'){if(!_0x128e0e['body'][_0xdbbd('0x93')]){throw new db['Sequelize'][(_0xdbbd('0x1c'))](_0xdbbd('0x99'));}return _0x293ed7;}else if(_0x128e0e['user'][_0xdbbd('0x3f')]=='user'){if(!_0x128e0e[_0xdbbd('0x65')]['newPassword']){throw new db[(_0xdbbd('0x96'))][(_0xdbbd('0x1c'))](_0xdbbd('0x99'));}if(_0x293ed7['role']!='agent'){throw new db[(_0xdbbd('0x96'))][(_0xdbbd('0x1c'))]('Unauthorized');}return _0x293ed7;}else{throw new db[(_0xdbbd('0x96'))][(_0xdbbd('0x1c'))](_0xdbbd('0x9a'));}}return null;})[_0xdbbd('0x34')](handleEntityNotFound(_0x50b7a9,null))[_0xdbbd('0x34')](function(_0x4813ce){return checkPasswordPattern(_0x4813ce,_0x128e0e[_0xdbbd('0x65')]['newPassword'],_0x2265e0);})[_0xdbbd('0x34')](saveUpdates({'password':_0x128e0e[_0xdbbd('0x65')][_0xdbbd('0x93')],'passwordResetAt':_0x128e0e[_0xdbbd('0x38')]['id']==_0x128e0e[_0xdbbd('0x60')]['id']?moment():null},null))['then'](respondWithResult(_0x50b7a9,null))[_0xdbbd('0x27')](handleError(_0x50b7a9,null));};exports[_0xdbbd('0x9b')]=function(_0x2a5ffb,_0x1aeb1c,_0x17cb1f){var _0x1c1820=_0x2a5ffb[_0xdbbd('0x65')][_0xdbbd('0x9c')];return db[_0xdbbd('0x44')][_0xdbbd('0x66')]({'where':{'id':_0x2a5ffb['params']['id']},'attributes':['id',_0xdbbd('0x40'),_0xdbbd('0x3f'),_0xdbbd('0x9d'),_0xdbbd('0x9e'),_0xdbbd('0x9f'),_0xdbbd('0xa0')]})[_0xdbbd('0x34')](handleEntityNotFound(_0x1aeb1c,null))[_0xdbbd('0x34')](function(_0x20a81a){if(_0x20a81a){if(!utils[_0xdbbd('0xa1')](_0x1c1820)){throw new db[(_0xdbbd('0x96'))][(_0xdbbd('0x1c'))](_0xdbbd('0xa2'));}return _0x20a81a['add'+_[_0xdbbd('0xa3')](_0x1c1820[_0xdbbd('0xa4')]())+_0xdbbd('0xa5')](_0x2a5ffb['body'][_0xdbbd('0x69')],{'penalty':_0x2a5ffb[_0xdbbd('0x65')][_0xdbbd('0xa6')]||0x0})[_0xdbbd('0xa7')](function(_0xd3d319){for(var _0x41252e=0x0;_0x41252e<_0x2a5ffb[_0xdbbd('0x65')][_0xdbbd('0x69')]['length'];_0x41252e+=0x1){var _0x394db7={'UserId':_0x2a5ffb['params']['id']};_0x394db7[_[_0xdbbd('0xa3')](_0x1c1820['toLowerCase']())+'QueueId']=_0x2a5ffb['body'][_0xdbbd('0x69')][_0x41252e];socket[_0xdbbd('0xa8')]('user'+_[_0xdbbd('0xa3')](_0x1c1820[_0xdbbd('0xa4')]())+'Queue:save',_0x394db7);}return _0xd3d319;})['then'](function(){if(_0x1c1820===_0xdbbd('0xa9')){return db[_0xdbbd('0xaa')][_0xdbbd('0x5d')]({'where':{'id':_0x2a5ffb[_0xdbbd('0x65')]['ids']||[]},'raw':!![],'attributes':['id',_0xdbbd('0x40')]});}})[_0xdbbd('0x34')](function(_0x505d7f){var _0x341326=_0x20a81a[_0xdbbd('0x36')]({'plain':!![]});var _0x429276=[];if(_0x1c1820===_0xdbbd('0xa9')&&_0x341326['role']==='agent'&&_0x341326[_0xdbbd('0x9d')]){for(var _0x56c699=0x0;_0x56c699<_0x505d7f[_0xdbbd('0x62')];_0x56c699+=0x1){_0x429276[_0xdbbd('0xab')]({'membername':_0x341326['name'],'UserId':_0x341326['id'],'queue_name':_0x505d7f[_0x56c699][_0xdbbd('0x40')],'VoiceQueueId':_0x505d7f[_0x56c699]['id'],'interface':_[_0xdbbd('0x70')](_0x341326['interface'])?util['format'](_0xdbbd('0xac'),_0x341326[_0xdbbd('0x40')]):_0x341326[_0xdbbd('0xa0')],'paused':_0x341326['voicePause']||![],'penalty':_0x2a5ffb[_0xdbbd('0x65')][_0xdbbd('0xa6')]||0x0});}return BPromise[_0xdbbd('0xad')](_0x429276,function(_0x499a48){return db[_0xdbbd('0xae')][_0xdbbd('0xaf')](_0x499a48);});}return _0x20a81a;});}})[_0xdbbd('0x34')](respondWithStatusCode(_0x1aeb1c,null))[_0xdbbd('0x27')](handleError(_0x1aeb1c,null));};exports[_0xdbbd('0xb0')]=function(_0x5a061a,_0x2448da,_0x1de27c){var _0x31a704;return db['User']['find']({'where':{'id':_0x5a061a[_0xdbbd('0x60')]['id']},'attributes':['id',_0xdbbd('0x40'),_0xdbbd('0x3f')]})['then'](handleEntityNotFound(_0x2448da,null))[_0xdbbd('0x34')](function(_0x5d7933){if(_0x5d7933){_0x31a704=_0x5d7933;if(!_0x5a061a['query']['channel']||!utils[_0xdbbd('0xa1')](_0x5a061a['query'][_0xdbbd('0x9c')])){throw new db[(_0xdbbd('0x96'))][(_0xdbbd('0x1c'))]('Unknown\x20channel');}return _0x5d7933['remove'+_[_0xdbbd('0xa3')](_0x5a061a[_0xdbbd('0x4a')][_0xdbbd('0x9c')]['toLowerCase']())+'Queues'](_0x5a061a[_0xdbbd('0x4a')][_0xdbbd('0x69')]);}})[_0xdbbd('0x34')](function(_0x2c19d3){for(var _0x3a3814=0x0;_0x3a3814<_0x5a061a[_0xdbbd('0x4a')][_0xdbbd('0x69')][_0xdbbd('0x62')];_0x3a3814+=0x1){var _0x3363f0={'UserId':_0x5a061a[_0xdbbd('0x60')]['id']};_0x3363f0[_[_0xdbbd('0xa3')](_0x5a061a[_0xdbbd('0x4a')][_0xdbbd('0x9c')]['toLowerCase']())+_0xdbbd('0xb1')]=_0x5a061a[_0xdbbd('0x4a')][_0xdbbd('0x69')][_0x3a3814];socket['emit']('user'+_[_0xdbbd('0xa3')](_0x5a061a[_0xdbbd('0x4a')][_0xdbbd('0x9c')]['toLowerCase']())+'Queue:remove',_0x3363f0);}return _0x2c19d3;})[_0xdbbd('0x34')](function(){if(_0x5a061a['query'][_0xdbbd('0x9c')]===_0xdbbd('0xa9')){return db[_0xdbbd('0xae')][_0xdbbd('0x35')]({'where':{'UserId':_0x5a061a[_0xdbbd('0x60')]['id'],'VoiceQueueId':_0x5a061a['query'][_0xdbbd('0x69')]},'individualHooks':!![]})[_0xdbbd('0x34')](function(){return _0x31a704;});}return _0x31a704;})[_0xdbbd('0x34')](respondWithStatusCode(_0x2448da,null))['catch'](handleError(_0x2448da,null));};exports[_0xdbbd('0xb2')]=function(_0x3b9285,_0x21b1d0,_0x1e8f61){_0x3b9285[_0xdbbd('0x65')][_0xdbbd('0xb3')]=_0x3b9285[_0xdbbd('0xb4')]['filename'];return db[_0xdbbd('0x44')][_0xdbbd('0x66')]({'where':{'id':_0x3b9285['params']['id']}})[_0xdbbd('0x34')](handleEntityNotFound(_0x21b1d0,null))[_0xdbbd('0x34')](saveUpdates(_0x3b9285[_0xdbbd('0x65')],null))['then'](respondWithResult(_0x21b1d0,null))[_0xdbbd('0x27')](handleError(_0x21b1d0,null));};exports[_0xdbbd('0xb5')]=function(_0x1a0401,_0x55be46,_0x4f9ef9){var _0x396525=path[_0xdbbd('0xb6')](config['root'],_0xdbbd('0xb7'));return db['User']['find']({'where':{'id':_0x1a0401[_0xdbbd('0x60')]['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x55be46,null))[_0xdbbd('0x34')](function(_0x425744){if(_0x425744){if(_['isNil'](_0x425744['userpic'])){return _0x55be46[_0xdbbd('0xb8')](_0x396525);}else{if(!fs[_0xdbbd('0xb9')](path[_0xdbbd('0xb6')](config['root'],_0xdbbd('0xba'),_0x425744[_0xdbbd('0xb3')]))){return _0x55be46[_0xdbbd('0xb8')](_0x396525);}return _0x55be46['download'](path[_0xdbbd('0xb6')](config[_0xdbbd('0xbb')],'server/files/images/',_0x425744[_0xdbbd('0xb3')]));}}})[_0xdbbd('0x27')](handleError(_0x55be46,null));};exports[_0xdbbd('0xbc')]=function(_0x37fed6,_0x5d1a85,_0x426c23){var _0x45fee3={};var _0xc63391={};var _0x5c320d;var _0x1b0d44;return db[_0xdbbd('0x44')][_0xdbbd('0xbd')]({'where':{'id':_0x37fed6[_0xdbbd('0x60')]['id']}})[_0xdbbd('0x34')](handleEntityNotFound(_0x5d1a85,null))[_0xdbbd('0x34')](function(_0x5e342f){if(_0x5e342f){_0x5c320d=_0x5e342f;_0xc63391[_0xdbbd('0x4d')]=_[_0xdbbd('0x4b')](db[_0xdbbd('0xbe')][_0xdbbd('0x45')]);_0xc63391['query']=_[_0xdbbd('0x4b')](_0x37fed6[_0xdbbd('0x4a')]);_0xc63391[_0xdbbd('0x54')]=_[_0xdbbd('0x4c')](_0xc63391[_0xdbbd('0x4d')],_0xc63391[_0xdbbd('0x4a')]);_0x45fee3[_0xdbbd('0x4f')]=_[_0xdbbd('0x4c')](_0xc63391[_0xdbbd('0x4d')],qs['fields'](_0x37fed6['query']['fields']));_0x45fee3[_0xdbbd('0x4f')]=_0x45fee3['attributes'][_0xdbbd('0x62')]?_0x45fee3[_0xdbbd('0x4f')]:_0xc63391[_0xdbbd('0x4d')];_0x45fee3[_0xdbbd('0x51')]=qs['sort'](_0x37fed6[_0xdbbd('0x4a')][_0xdbbd('0x52')]);_0x45fee3[_0xdbbd('0x53')]=qs[_0xdbbd('0x54')](_['pick'](_0x37fed6[_0xdbbd('0x4a')],_0xc63391[_0xdbbd('0x54')]));if(_0x37fed6[_0xdbbd('0x4a')]['filter']){_0x45fee3['where']=_[_0xdbbd('0x56')](_0x45fee3[_0xdbbd('0x53')],{'$or':_[_0xdbbd('0x3c')](_0x45fee3[_0xdbbd('0x4f')],function(_0x1118ce){var _0x2a67bc={};_0x2a67bc[_0x1118ce]={'$like':'%'+_0x37fed6[_0xdbbd('0x4a')][_0xdbbd('0x55')]+'%'};return _0x2a67bc;})});}_0x45fee3=_[_0xdbbd('0x56')]({},_0x45fee3,_0x37fed6[_0xdbbd('0x5b')]);return _0x5c320d[_0xdbbd('0xbc')](_0x45fee3);}})[_0xdbbd('0x34')](function(_0x3703a5){if(_0x3703a5){_0x1b0d44=_0x3703a5[_0xdbbd('0x62')];if(_0x37fed6[_0xdbbd('0x4a')]['hasOwnProperty'](_0xdbbd('0x63'))){_0x45fee3[_0xdbbd('0x5c')]=[{'model':db[_0xdbbd('0xbf')],'as':_0xdbbd('0xc0'),'required':![]},{'model':db['Tag'],'as':_0xdbbd('0xc1'),'attributes':['id',_0xdbbd('0x40'),_0xdbbd('0xc2')],'where':_0x37fed6[_0xdbbd('0x4a')][_0xdbbd('0xc3')]?{'id':_0x37fed6[_0xdbbd('0x4a')][_0xdbbd('0xc3')]}:undefined,'required':_0x37fed6[_0xdbbd('0x4a')][_0xdbbd('0xc3')]?!![]:![]}];}if(!_0x37fed6[_0xdbbd('0x4a')][_0xdbbd('0x50')]('nolimit')){_0x45fee3['limit']=qs[_0xdbbd('0x2e')](_0x37fed6[_0xdbbd('0x4a')][_0xdbbd('0x2e')]);_0x45fee3[_0xdbbd('0x2d')]=qs[_0xdbbd('0x2d')](_0x37fed6['query'][_0xdbbd('0x2d')]);}return _0x5c320d[_0xdbbd('0xbc')](_0x45fee3);}})[_0xdbbd('0x34')](function(_0x2ba876){if(_0x2ba876){return _0x2ba876?{'count':_0x1b0d44,'rows':_0x2ba876}:null;}})[_0xdbbd('0x34')](respondWithResult(_0x5d1a85,null))[_0xdbbd('0x27')](handleError(_0x5d1a85,null));};exports[_0xdbbd('0xc4')]=function(_0x21a85e,_0x54e401,_0x20b3d2){var _0x1b59ec;var _0x3c7823;var _0xd696a8={};var _0x535918;return db[_0xdbbd('0x44')][_0xdbbd('0xbd')]({'where':{'id':_0x21a85e[_0xdbbd('0x60')]['id']},'attributes':['id',_0xdbbd('0x40'),_0xdbbd('0x3f')]})['then'](handleEntityNotFound(_0x54e401,null))[_0xdbbd('0x34')](function(_0x9a4b9b){if(!utils[_0xdbbd('0xa1')](_0x21a85e[_0xdbbd('0x4a')][_0xdbbd('0x9c')])){throw new db[(_0xdbbd('0x96'))]['ValidationError']('Unknown\x20channel');}_0x1b59ec=_0x9a4b9b;var _0x304774={};_0x304774[_0xdbbd('0x4d')]=_['keys'](db[_[_0xdbbd('0xa3')](_0x21a85e[_0xdbbd('0x4a')]['channel'])+_0xdbbd('0xc5')][_0xdbbd('0x45')]);_0x304774[_0xdbbd('0x4a')]=_[_0xdbbd('0x4b')](_0x21a85e[_0xdbbd('0x4a')]);_0x304774[_0xdbbd('0x54')]=_[_0xdbbd('0x4c')](_0x304774[_0xdbbd('0x4d')],_0x304774['query']);_0xd696a8['attributes']=_[_0xdbbd('0x4c')](_0x304774['model'],qs['fields'](_0x21a85e['query'][_0xdbbd('0x4e')]));_0xd696a8[_0xdbbd('0x4f')]=_0xd696a8[_0xdbbd('0x4f')][_0xdbbd('0x62')]?_0xd696a8['attributes']:_0x304774[_0xdbbd('0x4d')];_0xd696a8[_0xdbbd('0x51')]=qs[_0xdbbd('0x52')](_0x21a85e[_0xdbbd('0x4a')][_0xdbbd('0x52')]);_0xd696a8[_0xdbbd('0x53')]=qs['filters'](_[_0xdbbd('0xc6')](_0x21a85e[_0xdbbd('0x4a')],_0x304774[_0xdbbd('0x54')]));if(_0x21a85e[_0xdbbd('0x4a')][_0xdbbd('0x55')]){_0xd696a8[_0xdbbd('0x53')]=_[_0xdbbd('0x56')](_0xd696a8[_0xdbbd('0x53')],{'$or':_['map'](_0xd696a8[_0xdbbd('0x4f')],function(_0x1b2e36){var _0x57d27d={};_0x57d27d[_0x1b2e36]={'$like':'%'+_0x21a85e[_0xdbbd('0x4a')][_0xdbbd('0x55')]+'%'};return _0x57d27d;})});}_0xd696a8=_[_0xdbbd('0x56')]({},_0xd696a8,_0x21a85e['options']);switch(_0x1b59ec[_0xdbbd('0x3f')]){case _0xdbbd('0x6b'):return db[_[_0xdbbd('0xa3')](_0x21a85e[_0xdbbd('0x4a')]['channel'])+'Queue'][_0xdbbd('0x5d')](_0xd696a8);case _0xdbbd('0x38'):case _0xdbbd('0x39'):return _0x1b59ec[_0xdbbd('0x36')+_[_0xdbbd('0xa3')](_0x21a85e[_0xdbbd('0x4a')][_0xdbbd('0x9c')])+_0xdbbd('0xa5')](_0xd696a8);default:throw new db[(_0xdbbd('0x96'))][(_0xdbbd('0x1c'))](_0xdbbd('0xc7'));}})[_0xdbbd('0x34')](function(_0xaade96){_0x535918=_0xaade96[_0xdbbd('0x62')];if(!_0x21a85e[_0xdbbd('0x4a')][_0xdbbd('0x50')]('nolimit')){_0xd696a8[_0xdbbd('0x2e')]=qs['limit'](_0x21a85e[_0xdbbd('0x4a')]['limit']);_0xd696a8[_0xdbbd('0x2d')]=qs[_0xdbbd('0x2d')](_0x21a85e[_0xdbbd('0x4a')][_0xdbbd('0x2d')]);}switch(_0x1b59ec[_0xdbbd('0x3f')]){case _0xdbbd('0x6b'):return db[_[_0xdbbd('0xa3')](_0x21a85e[_0xdbbd('0x4a')]['channel'])+_0xdbbd('0xc5')][_0xdbbd('0x5d')](_0xd696a8);case _0xdbbd('0x38'):case _0xdbbd('0x39'):return _0x1b59ec[_0xdbbd('0x36')+_[_0xdbbd('0xa3')](_0x21a85e[_0xdbbd('0x4a')]['channel'])+'Queues'](_0xd696a8);}})[_0xdbbd('0x34')](function(_0x52dded){return{'count':_0x535918,'rows':_0x52dded};})[_0xdbbd('0x34')](respondWithResult(_0x54e401,null))[_0xdbbd('0x27')](handleError(_0x54e401,null));};exports[_0xdbbd('0xc8')]=function(_0x38d2e2,_0x32cb3d,_0x3114ed){var _0x4d569a={};var _0x592eac={};var _0x34e99d;var _0x35735d;return db['User'][_0xdbbd('0xbd')]({'where':{'id':_0x38d2e2[_0xdbbd('0x60')]['id']}})[_0xdbbd('0x34')](handleEntityNotFound(_0x32cb3d,null))[_0xdbbd('0x34')](function(_0x4aefd5){if(_0x4aefd5){_0x34e99d=_0x4aefd5;_0x592eac[_0xdbbd('0x4d')]=_['keys'](db['UserVoiceQueueRt'][_0xdbbd('0x45')]);_0x592eac[_0xdbbd('0x4a')]=_[_0xdbbd('0x4b')](_0x38d2e2[_0xdbbd('0x4a')]);_0x592eac['filters']=_['intersection'](_0x592eac[_0xdbbd('0x4d')],_0x592eac[_0xdbbd('0x4a')]);_0x4d569a['attributes']=_[_0xdbbd('0x4c')](_0x592eac[_0xdbbd('0x4d')],qs[_0xdbbd('0x4e')](_0x38d2e2['query'][_0xdbbd('0x4e')]));_0x4d569a['attributes']=_0x4d569a[_0xdbbd('0x4f')][_0xdbbd('0x62')]?_0x4d569a[_0xdbbd('0x4f')]:_0x592eac[_0xdbbd('0x4d')];_0x4d569a[_0xdbbd('0x51')]=qs[_0xdbbd('0x52')](_0x38d2e2['query'][_0xdbbd('0x52')]);_0x4d569a['where']=qs['filters'](_[_0xdbbd('0xc6')](_0x38d2e2['query'],_0x592eac['filters']));if(_0x38d2e2['query'][_0xdbbd('0x55')]){_0x4d569a[_0xdbbd('0x53')]=_[_0xdbbd('0x56')](_0x4d569a[_0xdbbd('0x53')],{'$or':_[_0xdbbd('0x3c')](_0x4d569a[_0xdbbd('0x4f')],function(_0x550b87){var _0x390602={};_0x390602[_0x550b87]={'$like':'%'+_0x38d2e2[_0xdbbd('0x4a')][_0xdbbd('0x55')]+'%'};return _0x390602;})});}_0x4d569a=_[_0xdbbd('0x56')]({},_0x4d569a,_0x38d2e2['options']);return _0x34e99d[_0xdbbd('0xc8')](_0x4d569a);}})[_0xdbbd('0x34')](function(_0x1c9a8a){if(_0x1c9a8a){_0x35735d=_0x1c9a8a[_0xdbbd('0x62')];if(!_0x38d2e2['query'][_0xdbbd('0x50')](_0xdbbd('0xc9'))){_0x4d569a[_0xdbbd('0x2e')]=qs[_0xdbbd('0x2e')](_0x38d2e2[_0xdbbd('0x4a')][_0xdbbd('0x2e')]);_0x4d569a[_0xdbbd('0x2d')]=qs[_0xdbbd('0x2d')](_0x38d2e2['query'][_0xdbbd('0x2d')]);}return _0x34e99d[_0xdbbd('0xc8')](_0x4d569a);}})['then'](function(_0x357f4e){if(_0x357f4e){return _0x357f4e?{'count':_0x35735d,'rows':_0x357f4e}:null;}})[_0xdbbd('0x34')](respondWithResult(_0x32cb3d,null))[_0xdbbd('0x27')](handleError(_0x32cb3d,null));};exports[_0xdbbd('0xca')]=function(_0x209787,_0x20100e,_0x44b0ca){var _0x37fc73={};var _0x28bcef={};var _0x37b368;var _0x2f478c;return db['User']['findOne']({'where':{'id':_0x209787[_0xdbbd('0x60')]['id']}})['then'](handleEntityNotFound(_0x20100e,null))[_0xdbbd('0x34')](function(_0x2a05dc){if(_0x2a05dc){_0x37b368=_0x2a05dc;_0x28bcef[_0xdbbd('0x4d')]=_['keys'](db['ChatGroup'][_0xdbbd('0x45')]);_0x28bcef[_0xdbbd('0x4a')]=_[_0xdbbd('0x4b')](_0x209787['query']);_0x28bcef[_0xdbbd('0x54')]=_[_0xdbbd('0x4c')](_0x28bcef[_0xdbbd('0x4d')],_0x28bcef[_0xdbbd('0x4a')]);_0x37fc73[_0xdbbd('0x4f')]=_[_0xdbbd('0x4c')](_0x28bcef[_0xdbbd('0x4d')],qs[_0xdbbd('0x4e')](_0x209787[_0xdbbd('0x4a')][_0xdbbd('0x4e')]));_0x37fc73[_0xdbbd('0x4f')]=_0x37fc73[_0xdbbd('0x4f')][_0xdbbd('0x62')]?_0x37fc73[_0xdbbd('0x4f')]:_0x28bcef[_0xdbbd('0x4d')];_0x37fc73[_0xdbbd('0x51')]=qs[_0xdbbd('0x52')](_0x209787[_0xdbbd('0x4a')][_0xdbbd('0x52')]);_0x37fc73[_0xdbbd('0x53')]=qs['filters'](_[_0xdbbd('0xc6')](_0x209787[_0xdbbd('0x4a')],_0x28bcef[_0xdbbd('0x54')]));if(_0x209787['query']['filter']){_0x37fc73[_0xdbbd('0x53')]=_[_0xdbbd('0x56')](_0x37fc73[_0xdbbd('0x53')],{'$or':_[_0xdbbd('0x3c')](_0x37fc73[_0xdbbd('0x4f')],function(_0x125502){var _0xd3a98e={};_0xd3a98e[_0x125502]={'$like':'%'+_0x209787[_0xdbbd('0x4a')][_0xdbbd('0x55')]+'%'};return _0xd3a98e;})});}_0x37fc73=_[_0xdbbd('0x56')]({},_0x37fc73,_0x209787['options']);return _0x37b368[_0xdbbd('0xca')](_0x37fc73);}})[_0xdbbd('0x34')](function(_0x565576){if(_0x565576){_0x2f478c=_0x565576[_0xdbbd('0x62')];if(!_0x209787[_0xdbbd('0x4a')][_0xdbbd('0x50')](_0xdbbd('0xc9'))){_0x37fc73[_0xdbbd('0x2e')]=qs[_0xdbbd('0x2e')](_0x209787[_0xdbbd('0x4a')][_0xdbbd('0x2e')]);_0x37fc73['offset']=qs[_0xdbbd('0x2d')](_0x209787['query']['offset']);}return _0x37b368[_0xdbbd('0xca')](_0x37fc73);}})[_0xdbbd('0x34')](function(_0x3e021a){if(_0x3e021a){return _0x3e021a?{'count':_0x2f478c,'rows':_0x3e021a}:null;}})[_0xdbbd('0x34')](respondWithResult(_0x20100e,null))[_0xdbbd('0x27')](handleError(_0x20100e,null));};exports[_0xdbbd('0xcb')]=function(_0x2cacee,_0x4ba1df,_0x3b5154){var _0x381333={'raw':!![],'where':{}};var _0x4cda5e={};var _0x378dd3={'count':0x0,'rows':[]};return db[_0xdbbd('0x44')][_0xdbbd('0xbd')]({'where':{'id':_0x2cacee[_0xdbbd('0x60')]['id']}})[_0xdbbd('0x34')](handleEntityNotFound(_0x4ba1df,null))[_0xdbbd('0x34')](function(_0x4bb8b6){if(_0x4bb8b6){_0x4cda5e[_0xdbbd('0x4d')]=_[_0xdbbd('0x4b')](db[_0xdbbd('0xcc')][_0xdbbd('0x45')]);_0x4cda5e[_0xdbbd('0x4a')]=_[_0xdbbd('0x4b')](_0x2cacee[_0xdbbd('0x4a')]);_0x4cda5e[_0xdbbd('0x54')]=_['intersection'](_0x4cda5e[_0xdbbd('0x4d')],_0x4cda5e['query']);_0x381333['attributes']=_[_0xdbbd('0x4c')](_0x4cda5e[_0xdbbd('0x4d')],qs['fields'](_0x2cacee[_0xdbbd('0x4a')]['fields']));_0x381333['attributes']=_0x381333[_0xdbbd('0x4f')][_0xdbbd('0x62')]?_0x381333[_0xdbbd('0x4f')]:_0x4cda5e[_0xdbbd('0x4d')];if(!_0x2cacee[_0xdbbd('0x4a')][_0xdbbd('0x50')](_0xdbbd('0xc9'))){_0x381333[_0xdbbd('0x2e')]=qs[_0xdbbd('0x2e')](_0x2cacee['query'][_0xdbbd('0x2e')]);_0x381333['offset']=qs[_0xdbbd('0x2d')](_0x2cacee['query']['offset']);}_0x381333[_0xdbbd('0x51')]=qs[_0xdbbd('0x52')](_0x2cacee[_0xdbbd('0x4a')][_0xdbbd('0x52')]);_0x381333[_0xdbbd('0x53')]=qs[_0xdbbd('0x54')](_[_0xdbbd('0xc6')](_0x2cacee[_0xdbbd('0x4a')],_0x4cda5e['filters']));_0x381333[_0xdbbd('0x53')][_0xdbbd('0xcd')]=_0x4bb8b6['id'];if(_0x2cacee[_0xdbbd('0x4a')][_0xdbbd('0x55')]){_0x381333['where']=_[_0xdbbd('0x56')](_0x381333[_0xdbbd('0x53')],{'$or':_[_0xdbbd('0x3c')](_0x381333[_0xdbbd('0x4f')],function(_0x108906){var _0x8ee6b3={};_0x8ee6b3[_0x108906]={'$like':'%'+_0x2cacee['query'][_0xdbbd('0x55')]+'%'};return _0x8ee6b3;})});}_0x381333=_[_0xdbbd('0x56')]({},_0x381333,_0x2cacee[_0xdbbd('0x5b')]);return db[_0xdbbd('0xcc')][_0xdbbd('0x2c')]({'where':_0x381333['where']})[_0xdbbd('0x34')](function(_0x4d61fa){_0x378dd3['count']=_0x4d61fa;if(_0x2cacee[_0xdbbd('0x4a')][_0xdbbd('0x63')]){_0x381333['include']=[{'all':!![]}];}return db['VoiceRecording'][_0xdbbd('0x5d')](_0x381333);})[_0xdbbd('0x34')](function(_0xb4e4d0){_0x378dd3[_0xdbbd('0x5e')]=_0xb4e4d0;return _0x378dd3;});}})[_0xdbbd('0x34')](respondWithFilteredResult(_0x4ba1df,_0x381333))[_0xdbbd('0x27')](handleError(_0x4ba1df,null));};exports[_0xdbbd('0xce')]=function(_0x4ba83b,_0x399b2d,_0x225bc7){var _0x5aba23={'raw':!![],'where':{}};var _0x4fff8f={};var _0x1a6ac9={'count':0x0,'rows':[]};return db[_0xdbbd('0x44')]['findOne']({'where':{'id':_0x4ba83b[_0xdbbd('0x60')]['id']}})[_0xdbbd('0x34')](handleEntityNotFound(_0x399b2d,null))[_0xdbbd('0x34')](function(_0x19052a){if(_0x19052a){_0x4fff8f[_0xdbbd('0x4d')]=_[_0xdbbd('0x4b')](db['ScreenRecording'][_0xdbbd('0x45')]);_0x4fff8f[_0xdbbd('0x4a')]=_['keys'](_0x4ba83b[_0xdbbd('0x4a')]);_0x4fff8f[_0xdbbd('0x54')]=_[_0xdbbd('0x4c')](_0x4fff8f[_0xdbbd('0x4d')],_0x4fff8f[_0xdbbd('0x4a')]);_0x5aba23[_0xdbbd('0x4f')]=_[_0xdbbd('0x4c')](_0x4fff8f[_0xdbbd('0x4d')],qs['fields'](_0x4ba83b['query'][_0xdbbd('0x4e')]));_0x5aba23['attributes']=_0x5aba23[_0xdbbd('0x4f')][_0xdbbd('0x62')]?_0x5aba23[_0xdbbd('0x4f')]:_0x4fff8f[_0xdbbd('0x4d')];if(!_0x4ba83b[_0xdbbd('0x4a')][_0xdbbd('0x50')](_0xdbbd('0xc9'))){_0x5aba23['limit']=qs[_0xdbbd('0x2e')](_0x4ba83b[_0xdbbd('0x4a')][_0xdbbd('0x2e')]);_0x5aba23[_0xdbbd('0x2d')]=qs[_0xdbbd('0x2d')](_0x4ba83b['query'][_0xdbbd('0x2d')]);}_0x5aba23['order']=qs['sort'](_0x4ba83b[_0xdbbd('0x4a')][_0xdbbd('0x52')]);_0x5aba23[_0xdbbd('0x53')]=qs[_0xdbbd('0x54')](_[_0xdbbd('0xc6')](_0x4ba83b[_0xdbbd('0x4a')],_0x4fff8f[_0xdbbd('0x54')]));_0x5aba23['where']['UserId']=_0x19052a['id'];if(_0x4ba83b[_0xdbbd('0x4a')][_0xdbbd('0x55')]){_0x5aba23[_0xdbbd('0x53')]=_[_0xdbbd('0x56')](_0x5aba23[_0xdbbd('0x53')],{'$or':_[_0xdbbd('0x3c')](_0x5aba23['attributes'],function(_0x4bcf42){var _0x3b810a={};_0x3b810a[_0x4bcf42]={'$like':'%'+_0x4ba83b[_0xdbbd('0x4a')][_0xdbbd('0x55')]+'%'};return _0x3b810a;})});}_0x5aba23=_[_0xdbbd('0x56')]({},_0x5aba23,_0x4ba83b[_0xdbbd('0x5b')]);return db['ScreenRecording'][_0xdbbd('0x2c')]({'where':_0x5aba23['where']})[_0xdbbd('0x34')](function(_0x257736){_0x1a6ac9[_0xdbbd('0x2c')]=_0x257736;if(_0x4ba83b[_0xdbbd('0x4a')][_0xdbbd('0x63')]){_0x5aba23[_0xdbbd('0x5c')]=[{'all':!![]}];}return db[_0xdbbd('0xcf')][_0xdbbd('0x5d')](_0x5aba23);})['then'](function(_0x52febf){_0x1a6ac9[_0xdbbd('0x5e')]=_0x52febf;return _0x1a6ac9;});}})[_0xdbbd('0x34')](respondWithFilteredResult(_0x399b2d,_0x5aba23))[_0xdbbd('0x27')](handleError(_0x399b2d,null));};exports[_0xdbbd('0xd0')]=function(_0x5303e8,_0xd94740,_0xe63a5e){var _0x31c1ef={};var _0x5811e5={};var _0x26236a;var _0x41d1dd;return db[_0xdbbd('0x44')][_0xdbbd('0xbd')]({'where':{'id':_0x5303e8[_0xdbbd('0x60')]['id']}})[_0xdbbd('0x34')](handleEntityNotFound(_0xd94740,null))[_0xdbbd('0x34')](function(_0x4f205e){if(_0x4f205e){_0x26236a=_0x4f205e;_0x5811e5[_0xdbbd('0x4d')]=_['keys'](db[_0xdbbd('0xd1')][_0xdbbd('0x45')]);_0x5811e5[_0xdbbd('0x4a')]=_[_0xdbbd('0x4b')](_0x5303e8[_0xdbbd('0x4a')]);_0x5811e5[_0xdbbd('0x54')]=_['intersection'](_0x5811e5[_0xdbbd('0x4d')],_0x5811e5['query']);_0x31c1ef[_0xdbbd('0x4f')]=_['intersection'](_0x5811e5[_0xdbbd('0x4d')],qs[_0xdbbd('0x4e')](_0x5303e8['query'][_0xdbbd('0x4e')]));_0x31c1ef['attributes']=_0x31c1ef[_0xdbbd('0x4f')][_0xdbbd('0x62')]?_0x31c1ef[_0xdbbd('0x4f')]:_0x5811e5['model'];_0x31c1ef['order']=qs['sort'](_0x5303e8[_0xdbbd('0x4a')]['sort']);_0x31c1ef['where']=qs['filters'](_[_0xdbbd('0xc6')](_0x5303e8[_0xdbbd('0x4a')],_0x5811e5['filters']));if(_0x5303e8[_0xdbbd('0x4a')][_0xdbbd('0x55')]){_0x31c1ef[_0xdbbd('0x53')]=_[_0xdbbd('0x56')](_0x31c1ef[_0xdbbd('0x53')],{'$or':_[_0xdbbd('0x3c')](_0x31c1ef[_0xdbbd('0x4f')],function(_0x4d564d){var _0x5dc68d={};_0x5dc68d[_0x4d564d]={'$like':'%'+_0x5303e8[_0xdbbd('0x4a')][_0xdbbd('0x55')]+'%'};return _0x5dc68d;})});}_0x31c1ef=_['merge']({},_0x31c1ef,_0x5303e8[_0xdbbd('0x5b')]);return _0x26236a['getChatInteractions'](_0x31c1ef);}})['then'](function(_0x489923){if(_0x489923){_0x41d1dd=_0x489923['length'];if(!_0x5303e8['query'][_0xdbbd('0x50')](_0xdbbd('0xc9'))){_0x31c1ef[_0xdbbd('0x2e')]=qs[_0xdbbd('0x2e')](_0x5303e8[_0xdbbd('0x4a')][_0xdbbd('0x2e')]);_0x31c1ef[_0xdbbd('0x2d')]=qs['offset'](_0x5303e8[_0xdbbd('0x4a')]['offset']);}return _0x26236a[_0xdbbd('0xd0')](_0x31c1ef);}})[_0xdbbd('0x34')](function(_0x5dc211){if(_0x5dc211){return _0x5dc211?{'count':_0x41d1dd,'rows':_0x5dc211}:null;}})[_0xdbbd('0x34')](respondWithResult(_0xd94740,null))[_0xdbbd('0x27')](handleError(_0xd94740,null));};exports['getOpenchannelInteractions']=function(_0x264f65,_0x5d199c,_0x1fc0ac){var _0x45ff8d={};var _0x4266c2={};var _0x3999fc;var _0x31a803;return db[_0xdbbd('0x44')][_0xdbbd('0xbd')]({'where':{'id':_0x264f65[_0xdbbd('0x60')]['id']}})[_0xdbbd('0x34')](handleEntityNotFound(_0x5d199c,null))[_0xdbbd('0x34')](function(_0x578aab){if(_0x578aab){_0x3999fc=_0x578aab;_0x4266c2['model']=_[_0xdbbd('0x4b')](db['OpenchannelInteraction'][_0xdbbd('0x45')]);_0x4266c2['query']=_[_0xdbbd('0x4b')](_0x264f65[_0xdbbd('0x4a')]);_0x4266c2[_0xdbbd('0x54')]=_[_0xdbbd('0x4c')](_0x4266c2['model'],_0x4266c2[_0xdbbd('0x4a')]);_0x45ff8d['attributes']=_['intersection'](_0x4266c2[_0xdbbd('0x4d')],qs[_0xdbbd('0x4e')](_0x264f65['query'][_0xdbbd('0x4e')]));_0x45ff8d[_0xdbbd('0x4f')]=_0x45ff8d[_0xdbbd('0x4f')][_0xdbbd('0x62')]?_0x45ff8d[_0xdbbd('0x4f')]:_0x4266c2[_0xdbbd('0x4d')];_0x45ff8d[_0xdbbd('0x51')]=qs['sort'](_0x264f65[_0xdbbd('0x4a')][_0xdbbd('0x52')]);_0x45ff8d[_0xdbbd('0x53')]=qs['filters'](_[_0xdbbd('0xc6')](_0x264f65[_0xdbbd('0x4a')],_0x4266c2[_0xdbbd('0x54')]));if(_0x264f65[_0xdbbd('0x4a')][_0xdbbd('0x55')]){_0x45ff8d[_0xdbbd('0x53')]=_[_0xdbbd('0x56')](_0x45ff8d[_0xdbbd('0x53')],{'$or':_['map'](_0x45ff8d[_0xdbbd('0x4f')],function(_0x5238e3){var _0x35c385={};_0x35c385[_0x5238e3]={'$like':'%'+_0x264f65[_0xdbbd('0x4a')][_0xdbbd('0x55')]+'%'};return _0x35c385;})});}_0x45ff8d=_['merge']({},_0x45ff8d,_0x264f65[_0xdbbd('0x5b')]);return _0x3999fc[_0xdbbd('0xd2')](_0x45ff8d);}})[_0xdbbd('0x34')](function(_0x1ec9fd){if(_0x1ec9fd){_0x31a803=_0x1ec9fd[_0xdbbd('0x62')];if(!_0x264f65[_0xdbbd('0x4a')]['hasOwnProperty'](_0xdbbd('0xc9'))){_0x45ff8d[_0xdbbd('0x2e')]=qs[_0xdbbd('0x2e')](_0x264f65['query'][_0xdbbd('0x2e')]);_0x45ff8d[_0xdbbd('0x2d')]=qs['offset'](_0x264f65[_0xdbbd('0x4a')][_0xdbbd('0x2d')]);}return _0x3999fc['getOpenchannelInteractions'](_0x45ff8d);}})['then'](function(_0x1ec278){if(_0x1ec278){return _0x1ec278?{'count':_0x31a803,'rows':_0x1ec278}:null;}})['then'](respondWithResult(_0x5d199c,null))[_0xdbbd('0x27')](handleError(_0x5d199c,null));};exports[_0xdbbd('0xd3')]=function(_0x3c87de,_0x9453d0,_0x5e3a19){var _0x388629={'raw':!![],'where':{}};var _0xbef779={};var _0x5d60a9={'count':0x0,'rows':[]};return db['User'][_0xdbbd('0xbd')]({'where':{'id':_0x3c87de['params']['id']}})[_0xdbbd('0x34')](handleEntityNotFound(_0x9453d0,null))[_0xdbbd('0x34')](function(_0x5b0777){if(_0x5b0777){_0xbef779['model']=_['keys'](db[_0xdbbd('0xd4')][_0xdbbd('0x45')]);_0xbef779[_0xdbbd('0x4a')]=_[_0xdbbd('0x4b')](_0x3c87de[_0xdbbd('0x4a')]);_0xbef779[_0xdbbd('0x54')]=_[_0xdbbd('0x4c')](_0xbef779[_0xdbbd('0x4d')],_0xbef779[_0xdbbd('0x4a')]);_0x388629[_0xdbbd('0x4f')]=_['intersection'](_0xbef779[_0xdbbd('0x4d')],qs[_0xdbbd('0x4e')](_0x3c87de[_0xdbbd('0x4a')][_0xdbbd('0x4e')]));_0x388629[_0xdbbd('0x4f')]=_0x388629[_0xdbbd('0x4f')][_0xdbbd('0x62')]?_0x388629['attributes']:_0xbef779[_0xdbbd('0x4d')];if(!_0x3c87de[_0xdbbd('0x4a')]['hasOwnProperty'](_0xdbbd('0xc9'))){_0x388629[_0xdbbd('0x2e')]=qs['limit'](_0x3c87de[_0xdbbd('0x4a')][_0xdbbd('0x2e')]);_0x388629['offset']=qs[_0xdbbd('0x2d')](_0x3c87de[_0xdbbd('0x4a')][_0xdbbd('0x2d')]);}_0x388629[_0xdbbd('0x51')]=qs[_0xdbbd('0x52')](_0x3c87de[_0xdbbd('0x4a')][_0xdbbd('0x52')]);_0x388629['where']=qs[_0xdbbd('0x54')](_[_0xdbbd('0xc6')](_0x3c87de[_0xdbbd('0x4a')],_0xbef779[_0xdbbd('0x54')]));_0x388629[_0xdbbd('0x53')][_0xdbbd('0xcd')]=_0x5b0777['id'];if(_0x3c87de[_0xdbbd('0x4a')][_0xdbbd('0x55')]){_0x388629[_0xdbbd('0x53')]=_[_0xdbbd('0x56')](_0x388629[_0xdbbd('0x53')],{'$or':_[_0xdbbd('0x3c')](_0x388629['attributes'],function(_0x357e93){var _0xa4442a={};_0xa4442a[_0x357e93]={'$like':'%'+_0x3c87de[_0xdbbd('0x4a')][_0xdbbd('0x55')]+'%'};return _0xa4442a;})});}_0x388629=_['merge']({},_0x388629,_0x3c87de['options']);return db[_0xdbbd('0xd4')][_0xdbbd('0x2c')]({'where':_0x388629[_0xdbbd('0x53')]})['then'](function(_0x17871d){_0x5d60a9[_0xdbbd('0x2c')]=_0x17871d;if(_0x3c87de[_0xdbbd('0x4a')][_0xdbbd('0x63')]){_0x388629[_0xdbbd('0x5c')]=[{'all':!![]}];}return db[_0xdbbd('0xd4')][_0xdbbd('0x5d')](_0x388629);})['then'](function(_0x60ede5){_0x5d60a9[_0xdbbd('0x5e')]=_0x60ede5;return _0x5d60a9;});}})[_0xdbbd('0x34')](respondWithFilteredResult(_0x9453d0,_0x388629))['catch'](handleError(_0x9453d0,null));};exports[_0xdbbd('0xd5')]=function(_0x330dc1,_0x3bff86,_0x55edcf){var _0x3c2f70={};var _0x1d505c={};var _0x32c76a;var _0x226fd6;return db[_0xdbbd('0x44')][_0xdbbd('0xbd')]({'where':{'id':_0x330dc1[_0xdbbd('0x60')]['id']}})[_0xdbbd('0x34')](handleEntityNotFound(_0x3bff86,null))[_0xdbbd('0x34')](function(_0x3498b3){if(_0x3498b3){_0x32c76a=_0x3498b3;_0x1d505c[_0xdbbd('0x4d')]=_['keys'](db['SmsInteraction'][_0xdbbd('0x45')]);_0x1d505c[_0xdbbd('0x4a')]=_[_0xdbbd('0x4b')](_0x330dc1[_0xdbbd('0x4a')]);_0x1d505c[_0xdbbd('0x54')]=_[_0xdbbd('0x4c')](_0x1d505c[_0xdbbd('0x4d')],_0x1d505c[_0xdbbd('0x4a')]);_0x3c2f70[_0xdbbd('0x4f')]=_['intersection'](_0x1d505c[_0xdbbd('0x4d')],qs[_0xdbbd('0x4e')](_0x330dc1[_0xdbbd('0x4a')][_0xdbbd('0x4e')]));_0x3c2f70[_0xdbbd('0x4f')]=_0x3c2f70[_0xdbbd('0x4f')][_0xdbbd('0x62')]?_0x3c2f70[_0xdbbd('0x4f')]:_0x1d505c[_0xdbbd('0x4d')];_0x3c2f70[_0xdbbd('0x51')]=qs[_0xdbbd('0x52')](_0x330dc1[_0xdbbd('0x4a')][_0xdbbd('0x52')]);_0x3c2f70[_0xdbbd('0x53')]=qs[_0xdbbd('0x54')](_[_0xdbbd('0xc6')](_0x330dc1[_0xdbbd('0x4a')],_0x1d505c[_0xdbbd('0x54')]));if(_0x330dc1[_0xdbbd('0x4a')][_0xdbbd('0x55')]){_0x3c2f70['where']=_[_0xdbbd('0x56')](_0x3c2f70[_0xdbbd('0x53')],{'$or':_[_0xdbbd('0x3c')](_0x3c2f70[_0xdbbd('0x4f')],function(_0x3ae77c){var _0x274556={};_0x274556[_0x3ae77c]={'$like':'%'+_0x330dc1[_0xdbbd('0x4a')][_0xdbbd('0x55')]+'%'};return _0x274556;})});}_0x3c2f70=_[_0xdbbd('0x56')]({},_0x3c2f70,_0x330dc1[_0xdbbd('0x5b')]);return _0x32c76a[_0xdbbd('0xd5')](_0x3c2f70);}})['then'](function(_0xa356ec){if(_0xa356ec){_0x226fd6=_0xa356ec[_0xdbbd('0x62')];if(!_0x330dc1['query']['hasOwnProperty'](_0xdbbd('0xc9'))){_0x3c2f70[_0xdbbd('0x2e')]=qs[_0xdbbd('0x2e')](_0x330dc1['query'][_0xdbbd('0x2e')]);_0x3c2f70['offset']=qs[_0xdbbd('0x2d')](_0x330dc1['query']['offset']);}return _0x32c76a['getSmsInteractions'](_0x3c2f70);}})[_0xdbbd('0x34')](function(_0x3d1cc2){if(_0x3d1cc2){return _0x3d1cc2?{'count':_0x226fd6,'rows':_0x3d1cc2}:null;}})['then'](respondWithResult(_0x3bff86,null))[_0xdbbd('0x27')](handleError(_0x3bff86,null));};exports[_0xdbbd('0xd6')]=function(_0x50209f,_0x22a3a2,_0x2352ed){var _0x13dbae={};var _0x5a6287={};var _0xda7da9;var _0x1036d9;return db[_0xdbbd('0x44')][_0xdbbd('0xbd')]({'where':{'id':_0x50209f['params']['id']}})[_0xdbbd('0x34')](handleEntityNotFound(_0x22a3a2,null))[_0xdbbd('0x34')](function(_0x14436a){if(_0x14436a){_0xda7da9=_0x14436a;_0x5a6287[_0xdbbd('0x4d')]=_['keys'](db[_0xdbbd('0xd7')][_0xdbbd('0x45')]);_0x5a6287[_0xdbbd('0x4a')]=_['keys'](_0x50209f['query']);_0x5a6287['filters']=_[_0xdbbd('0x4c')](_0x5a6287[_0xdbbd('0x4d')],_0x5a6287[_0xdbbd('0x4a')]);_0x13dbae[_0xdbbd('0x4f')]=_['intersection'](_0x5a6287[_0xdbbd('0x4d')],qs['fields'](_0x50209f[_0xdbbd('0x4a')][_0xdbbd('0x4e')]));_0x13dbae[_0xdbbd('0x4f')]=_0x13dbae['attributes'][_0xdbbd('0x62')]?_0x13dbae[_0xdbbd('0x4f')]:_0x5a6287[_0xdbbd('0x4d')];_0x13dbae['order']=qs[_0xdbbd('0x52')](_0x50209f['query'][_0xdbbd('0x52')]);_0x13dbae[_0xdbbd('0x53')]=qs[_0xdbbd('0x54')](_['pick'](_0x50209f[_0xdbbd('0x4a')],_0x5a6287[_0xdbbd('0x54')]));if(_0x50209f[_0xdbbd('0x4a')][_0xdbbd('0x55')]){_0x13dbae[_0xdbbd('0x53')]=_['merge'](_0x13dbae[_0xdbbd('0x53')],{'$or':_[_0xdbbd('0x3c')](_0x13dbae[_0xdbbd('0x4f')],function(_0x2ff178){var _0x4157c7={};_0x4157c7[_0x2ff178]={'$like':'%'+_0x50209f['query'][_0xdbbd('0x55')]+'%'};return _0x4157c7;})});}_0x13dbae=_[_0xdbbd('0x56')]({},_0x13dbae,_0x50209f[_0xdbbd('0x5b')]);return _0xda7da9['getFaxInteractions'](_0x13dbae);}})[_0xdbbd('0x34')](function(_0x3c1c9b){if(_0x3c1c9b){_0x1036d9=_0x3c1c9b['length'];if(!_0x50209f[_0xdbbd('0x4a')][_0xdbbd('0x50')]('nolimit')){_0x13dbae[_0xdbbd('0x2e')]=qs['limit'](_0x50209f[_0xdbbd('0x4a')][_0xdbbd('0x2e')]);_0x13dbae[_0xdbbd('0x2d')]=qs[_0xdbbd('0x2d')](_0x50209f[_0xdbbd('0x4a')][_0xdbbd('0x2d')]);}return _0xda7da9['getFaxInteractions'](_0x13dbae);}})[_0xdbbd('0x34')](function(_0x1a5dba){if(_0x1a5dba){return _0x1a5dba?{'count':_0x1036d9,'rows':_0x1a5dba}:null;}})[_0xdbbd('0x34')](respondWithResult(_0x22a3a2,null))[_0xdbbd('0x27')](handleError(_0x22a3a2,null));};exports[_0xdbbd('0xd8')]=function(_0x4a3bfc,_0x57b447,_0x25b5fa){var _0x16da96;var _0x1b6174;var _0x909e43;var _0x49ebdc=!_['isNil'](_0x4a3bfc[_0xdbbd('0x60')]['id'])?_0x4a3bfc[_0xdbbd('0x60')]['id']:!_[_0xdbbd('0x70')](_0x4a3bfc['user']['id'])?_0x4a3bfc[_0xdbbd('0x38')]['id']:null;return db[_0xdbbd('0x44')][_0xdbbd('0x66')]({'where':{'id':_0x49ebdc,'role':{'$or':['admin','user',_0xdbbd('0x39')]}},'attributes':['id',_0xdbbd('0x40'),_0xdbbd('0xd9'),_0xdbbd('0xda'),_0xdbbd('0x3f'),_0xdbbd('0x75'),_0xdbbd('0x9e')]})['then'](function(_0x19fb7b){if(_0x19fb7b){if(_0x19fb7b[_0xdbbd('0x3f')]===_0xdbbd('0x39')){_0x16da96=_0x19fb7b;if(_0x4a3bfc[_0xdbbd('0x65')]['interface']){_0x909e43=util[_0xdbbd('0x72')](_0xdbbd('0xdb'),_0x16da96[_0x4a3bfc[_0xdbbd('0x65')][_0xdbbd('0xa0')]]);}else if(_0x4a3bfc[_0xdbbd('0x65')][_0xdbbd('0xdc')]){_0x909e43=util[_0xdbbd('0x72')](_0xdbbd('0xac'),_0x4a3bfc[_0xdbbd('0x65')][_0xdbbd('0xdc')]);}else{_0x909e43=util[_0xdbbd('0x72')](_0xdbbd('0xac'),_0x16da96[_0xdbbd('0x40')]);}socket['to'](util['format'](_0xdbbd('0xdd'),_0x16da96['name']))[_0xdbbd('0xa8')]('user:forcelogout',{'ip':_0x4a3bfc[_0xdbbd('0xde')][_0xdbbd('0xdf')]||_0x4a3bfc[_0xdbbd('0xe0')]['remoteAddress']||_0x4a3bfc[_0xdbbd('0xe1')]['remoteAddress']||_0x4a3bfc[_0xdbbd('0xe0')][_0xdbbd('0xe1')][_0xdbbd('0xe2')]});return db[_0xdbbd('0xae')][_0xdbbd('0x35')]({'where':{'membername':_0x16da96[_0xdbbd('0x40')]},'individualHooks':!![]});}}else{throw new db[(_0xdbbd('0x96'))][(_0xdbbd('0x1c'))](_0xdbbd('0xe3'));}})[_0xdbbd('0x34')](function(){if(_0x16da96){return _0x16da96['getVoiceQueues']({'raw':!![]});}})[_0xdbbd('0x34')](function(_0x3f2c1a){if(_0x16da96){var _0x254ff0=[];if(_0x3f2c1a){_0x1b6174=_0x3f2c1a;if(_0x1b6174[_0xdbbd('0x62')]){for(var _0x38564d=0x0;_0x38564d<_0x1b6174[_0xdbbd('0x62')];_0x38564d++){_0x254ff0['push']({'membername':_0x16da96[_0xdbbd('0x40')],'UserId':_0x16da96['id'],'queue_name':_0x1b6174[_0x38564d][_0xdbbd('0x40')],'VoiceQueueId':_0x1b6174[_0x38564d]['id'],'interface':_0x909e43,'paused':_0x16da96[_0xdbbd('0x9e')]||![],'penalty':_0x1b6174[_0x38564d]['UserVoiceQueue.penalty']||0x0});}return BPromise['each'](_0x254ff0,function(_0x1f61b2){return db[_0xdbbd('0xae')][_0xdbbd('0xaf')](_0x1f61b2);});}}}})[_0xdbbd('0x34')](function(){if(_0x16da96){return db[_0xdbbd('0xe4')][_0xdbbd('0x5d')]({'where':{'membername':_0x16da96[_0xdbbd('0x40')],'exitAt':null}});}})[_0xdbbd('0x34')](function(_0x410a20){if(_0x16da96){var _0x5339c2=[];_0x410a20[_0xdbbd('0xe5')](function(_0x14c78f){_0x5339c2[_0xdbbd('0xab')](_0x14c78f[_0xdbbd('0x33')]({'exitAt':moment()[_0xdbbd('0x72')](_0xdbbd('0xe6'))}));});return BPromise[_0xdbbd('0xe7')](_0x5339c2);}})[_0xdbbd('0x34')](function(){if(_0x16da96){var _0x2955fe=[];var _0x1b0105=[];var _0x4e8114=utils['getChannels']();var _0x2599e5={'membername':_0x16da96[_0xdbbd('0x40')],'interface':_0x909e43,'enterAt':moment()['format'](_0xdbbd('0xe6')),'role':_0x16da96['role'],'internal':_0x16da96[_0xdbbd('0x75')]};_0x4e8114[_0xdbbd('0xe5')](function(_0x12d308){_0x2955fe[_0xdbbd('0xab')](_['merge']({'channel':_0x12d308,'type':_0xdbbd('0xe8'),'data1':_0x4a3bfc['body']['device'],'data2':_0x909e43},_0x2599e5));if(_0x16da96[_0xdbbd('0x9e')]){_0x1b0105[_0xdbbd('0xab')](_[_0xdbbd('0x56')]({'channel':_0x12d308,'type':_0xdbbd('0xe9'),'data1':_0xdbbd('0xea')},_0x2599e5));}});return db[_0xdbbd('0xe4')][_0xdbbd('0x64')](_0x2955fe[_0xdbbd('0xeb')](_0x1b0105),{'individualHooks':!![]});}})[_0xdbbd('0x34')](function(){if(_0x16da96){return _0x16da96[_0xdbbd('0x33')]({'online':!![],'lastLoginAt':moment()[_0xdbbd('0x72')](_0xdbbd('0xe6')),'voicePause':_0x16da96[_0xdbbd('0x9e')]||![],'mailPause':_0x16da96[_0xdbbd('0x9e')]||![],'chatPause':_0x16da96[_0xdbbd('0x9e')]||![],'faxPause':_0x16da96[_0xdbbd('0x9e')]||![],'smsPause':_0x16da96[_0xdbbd('0x9e')]||![],'openchannelPause':_0x16da96[_0xdbbd('0x9e')]||![],'pauseType':_0x16da96[_0xdbbd('0x9e')]?_0xdbbd('0xea'):null,'interface':_0x909e43,'lastPauseAt':moment()[_0xdbbd('0x72')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xdbbd('0x34')](function(_0x5639ec){if(_0x4a3bfc[_0xdbbd('0xec')]){return _0x25b5fa();}else{return BPromise[_0xdbbd('0xed')](_0x5639ec)[_0xdbbd('0x34')](respondWithResult(_0x57b447,null));}})[_0xdbbd('0x27')](handleError(_0x57b447,null));};exports[_0xdbbd('0xee')]=function(_0x3fb9a1,_0x4829f0,_0xd921a5){var _0x17e8b2;return db['User'][_0xdbbd('0x66')]({'where':{'id':_0x3fb9a1[_0xdbbd('0x60')]['id'],'role':'agent'},'attributes':['id','name',_0xdbbd('0x3f')]})['then'](handleEntityNotFound(_0x4829f0,null))['then'](function(_0x568e23){if(_0x568e23){_0x17e8b2=_0x568e23;return db[_0xdbbd('0xae')][_0xdbbd('0x35')]({'where':{'membername':_0x17e8b2['name']},'individualHooks':!![]});}})[_0xdbbd('0x34')](function(){return db[_0xdbbd('0xe4')][_0xdbbd('0x5d')]({'where':{'membername':_0x17e8b2[_0xdbbd('0x40')],'exitAt':null}});})[_0xdbbd('0x34')](function(_0x33c89d){var _0x4c3f53=[];_0x33c89d['forEach'](function(_0x301d54){_0x4c3f53[_0xdbbd('0xab')](_0x301d54[_0xdbbd('0x33')]({'exitAt':moment()[_0xdbbd('0x72')](_0xdbbd('0xe6'))}));});return BPromise['all'](_0x4c3f53);})[_0xdbbd('0x34')](function(){return _0x17e8b2['update']({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0xdbbd('0x34')](respondWithResult(_0x4829f0,null))[_0xdbbd('0x27')](handleError(_0x4829f0,null));};exports[_0xdbbd('0xef')]=function(_0x45a860,_0x198df7,_0x37c152){var _0x56961c;return db[_0xdbbd('0xae')]['update']({'paused':0x1},{'where':{'UserId':_0x45a860[_0xdbbd('0x60')]['id']},'individualHooks':!![]})[_0xdbbd('0x34')](function(){return db['User']['find']({'where':{'id':_0x45a860[_0xdbbd('0x60')]['id'],'role':'agent'},'attributes':['id',_0xdbbd('0x40'),_0xdbbd('0x3f'),'internal',_0xdbbd('0xa0')]});})[_0xdbbd('0x34')](handleEntityNotFound(_0x198df7,null))[_0xdbbd('0x34')](function(_0x2b164f){if(_0x2b164f){_0x56961c=_0x2b164f;return respondWithRpcPromise(_0xdbbd('0xf0'),'pause',{'id':_0x56961c['id'],'name':_0x56961c['name'],'pause':!![]});}})[_0xdbbd('0x34')](function(){if(_0x56961c){return db[_0xdbbd('0xe4')][_0xdbbd('0x5d')]({'where':{'membername':_0x56961c['name'],'type':'PAUSE','exitAt':null}});}})[_0xdbbd('0x34')](function(_0x452e61){if(_0x452e61[_0xdbbd('0x62')]){var _0x468db8=moment()[_0xdbbd('0x72')](_0xdbbd('0xe6'));for(var _0x34207f=0x0,_0x5a22c3=_0x452e61['length'];_0x34207f<_0x5a22c3;_0x34207f++){_0x452e61[_0x34207f]['updateAttributes']({'exitAt':_0x468db8});}}})[_0xdbbd('0x34')](function(){var _0x3e2885=[];var _0x7f5f15=utils[_0xdbbd('0xf1')]();_0x7f5f15[_0xdbbd('0xe5')](function(_0x5650a1){_0x3e2885[_0xdbbd('0xab')]({'channel':_0x5650a1,'membername':_0x56961c[_0xdbbd('0x40')],'interface':_[_0xdbbd('0x70')](_0x56961c[_0xdbbd('0xa0')])?util[_0xdbbd('0x72')](_0xdbbd('0xac'),_0x56961c[_0xdbbd('0x40')]):_0x56961c[_0xdbbd('0xa0')],'type':_0xdbbd('0xe9'),'enterAt':moment()[_0xdbbd('0x72')](_0xdbbd('0xe6')),'data1':_0x45a860[_0xdbbd('0x65')][_0xdbbd('0x57')]||'DEFAULT\x20PAUSE','role':_0x56961c['role'],'internal':_0x56961c['internal']});});return db[_0xdbbd('0xe4')]['bulkCreate'](_0x3e2885,{'individualHooks':!![]});})[_0xdbbd('0x34')](function(){return _0x56961c[_0xdbbd('0x33')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x45a860[_0xdbbd('0x65')][_0xdbbd('0x57')]||_0xdbbd('0xf2'),'lastPauseAt':moment()[_0xdbbd('0x72')](_0xdbbd('0xe6'))});})['then'](respondWithResult(_0x198df7,null))[_0xdbbd('0x27')](handleError(_0x198df7,null));};exports['unpause']=function(_0xca4bf1,_0x289026,_0xf67915){var _0x525aff;return db[_0xdbbd('0x44')][_0xdbbd('0x66')]({'where':{'id':_0xca4bf1[_0xdbbd('0x60')]['id']},'attributes':['id',_0xdbbd('0x40'),_0xdbbd('0x3f'),_0xdbbd('0x9f'),_0xdbbd('0xf3'),'chatPause',_0xdbbd('0xf4'),_0xdbbd('0xf5'),_0xdbbd('0xf6'),_0xdbbd('0xf7'),_0xdbbd('0xf8')]})[_0xdbbd('0x34')](handleEntityNotFound(_0x289026,null))['then'](function(_0x134325){if(_0x134325){_0x525aff=_0x134325;if(_0xca4bf1[_0xdbbd('0x65')][_0xdbbd('0x9c')]&&!utils['isValidChannel'](_0xca4bf1[_0xdbbd('0x65')][_0xdbbd('0x9c')])){throw new db[(_0xdbbd('0x96'))][(_0xdbbd('0x1c'))](_0xdbbd('0xa2'));}switch(_0xca4bf1[_0xdbbd('0x65')][_0xdbbd('0x9c')]){case'voice':return respondWithRpcPromise('QueuePause','unpause',{'id':_0x525aff['id'],'name':_0x525aff[_0xdbbd('0x40')],'pause':![]})[_0xdbbd('0x34')](function(){return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x525aff['id']},'individualHooks':!![]});})['then'](function(){return db[_0xdbbd('0xe4')][_0xdbbd('0x66')]({'where':{'channel':_0xca4bf1[_0xdbbd('0x65')]['channel'],'membername':_0x525aff[_0xdbbd('0x40')],'type':'PAUSE','exitAt':null}});})[_0xdbbd('0x34')](function(_0x4ba0c5){if(_0x4ba0c5){return _0x4ba0c5[_0xdbbd('0x33')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xdbbd('0xf9')},{'individualHooks':!![]});}return null;})[_0xdbbd('0x34')](function(){return _0x525aff[_0xdbbd('0x33')]({'voicePause':![]});});case _0xdbbd('0xfa'):case _0xdbbd('0xfb'):case _0xdbbd('0xfc'):case _0xdbbd('0xfd'):case _0xdbbd('0xfe'):return db['MemberReport'][_0xdbbd('0x66')]({'where':{'channel':_0xca4bf1['body']['channel'],'membername':_0x525aff[_0xdbbd('0x40')],'type':_0xdbbd('0xe9'),'exitAt':null}})['then'](function(_0x4fdb8a){if(_0x4fdb8a){return _0x4fdb8a[_0xdbbd('0x33')]({'exitAt':moment()['format'](_0xdbbd('0xe6')),'data2':_0xdbbd('0xf9')},{'individualHooks':!![]});}return null;})[_0xdbbd('0x34')](function(){var _0x2e1e56={};_[_0xdbbd('0x2f')](_0x2e1e56,util['format'](_0xdbbd('0xff'),_0xca4bf1[_0xdbbd('0x65')][_0xdbbd('0x9c')],_0xdbbd('0x100')),![]);return _0x525aff['update'](_0x2e1e56);});default:return respondWithRpcPromise(_0xdbbd('0xf0'),_0xdbbd('0x101'),{'id':_0x525aff['id'],'name':_0x525aff[_0xdbbd('0x40')],'pause':![]})[_0xdbbd('0x34')](function(){return db['UserVoiceQueueRt'][_0xdbbd('0x33')]({'paused':0x0},{'where':{'UserId':_0x525aff['id']}});})[_0xdbbd('0x34')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x525aff[_0xdbbd('0x40')],'type':_0xdbbd('0xe9'),'exitAt':null}});})[_0xdbbd('0x34')](function(_0x5dd0e0){var _0x564bee=[];_0x5dd0e0[_0xdbbd('0xe5')](function(_0x38fee2){_0x564bee[_0xdbbd('0xab')](_0x38fee2[_0xdbbd('0x33')]({'exitAt':moment()['format'](_0xdbbd('0xe6')),'data2':'manual'}));});return BPromise[_0xdbbd('0xe7')](_0x564bee);})[_0xdbbd('0x34')](function(){return _0x525aff[_0xdbbd('0x33')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xdbbd('0x34')](respondWithResult(_0x289026,null))[_0xdbbd('0x27')](handleError(_0x289026,null));};exports[_0xdbbd('0x102')]=function(_0x39f1e2,_0x250234,_0x2e1ebc){var _0x45eda3={};var _0x4b8d64={};var _0x31d12f;var _0x46d7c7;return db['User']['findOne']({'where':{'id':_0x39f1e2['params']['id']}})[_0xdbbd('0x34')](handleEntityNotFound(_0x250234,null))['then'](function(_0x376f35){if(_0x376f35){_0x31d12f=_0x376f35;_0x4b8d64[_0xdbbd('0x4d')]=_['keys'](db['Team']['rawAttributes']);_0x4b8d64[_0xdbbd('0x4a')]=_[_0xdbbd('0x4b')](_0x39f1e2[_0xdbbd('0x4a')]);_0x4b8d64[_0xdbbd('0x54')]=_[_0xdbbd('0x4c')](_0x4b8d64[_0xdbbd('0x4d')],_0x4b8d64['query']);_0x45eda3[_0xdbbd('0x4f')]=_['intersection'](_0x4b8d64[_0xdbbd('0x4d')],qs['fields'](_0x39f1e2['query']['fields']));_0x45eda3[_0xdbbd('0x4f')]=_0x45eda3[_0xdbbd('0x4f')]['length']?_0x45eda3['attributes']:_0x4b8d64[_0xdbbd('0x4d')];_0x45eda3[_0xdbbd('0x51')]=qs[_0xdbbd('0x52')](_0x39f1e2[_0xdbbd('0x4a')][_0xdbbd('0x52')]);_0x45eda3[_0xdbbd('0x53')]=qs[_0xdbbd('0x54')](_['pick'](_0x39f1e2[_0xdbbd('0x4a')],_0x4b8d64[_0xdbbd('0x54')]));if(_0x39f1e2[_0xdbbd('0x4a')][_0xdbbd('0x55')]){_0x45eda3['where']=_[_0xdbbd('0x56')](_0x45eda3[_0xdbbd('0x53')],{'$or':_[_0xdbbd('0x3c')](_0x45eda3[_0xdbbd('0x4f')],function(_0x27b448){var _0x1f005a={};_0x1f005a[_0x27b448]={'$like':'%'+_0x39f1e2[_0xdbbd('0x4a')][_0xdbbd('0x55')]+'%'};return _0x1f005a;})});}_0x45eda3=_['merge']({},_0x45eda3,_0x39f1e2[_0xdbbd('0x5b')]);return _0x31d12f[_0xdbbd('0x102')](_0x45eda3);}})[_0xdbbd('0x34')](function(_0x16e182){if(_0x16e182){_0x46d7c7=_0x16e182['length'];if(!_0x39f1e2['query'][_0xdbbd('0x50')](_0xdbbd('0xc9'))){_0x45eda3[_0xdbbd('0x2e')]=qs['limit'](_0x39f1e2[_0xdbbd('0x4a')][_0xdbbd('0x2e')]);_0x45eda3[_0xdbbd('0x2d')]=qs['offset'](_0x39f1e2[_0xdbbd('0x4a')][_0xdbbd('0x2d')]);}return _0x31d12f[_0xdbbd('0x102')](_0x45eda3);}})[_0xdbbd('0x34')](function(_0x19acc1){if(_0x19acc1){return _0x19acc1?{'count':_0x46d7c7,'rows':_0x19acc1}:null;}})[_0xdbbd('0x34')](respondWithResult(_0x250234,null))[_0xdbbd('0x27')](handleError(_0x250234,null));};exports[_0xdbbd('0x103')]=function(_0x4748b2,_0x5a21ae){return db[_0xdbbd('0x44')]['find']({'where':{'id':_0x4748b2['params']['id']}})['then'](handleEntityNotFound(_0x5a21ae,null))[_0xdbbd('0x34')](function(_0x18de01){if(_0x18de01){var _0x5a7a70=_0x18de01[_0xdbbd('0x36')]({'plain':!![]});return _0x18de01[_0xdbbd('0x103')](_0x4748b2['body'][_0xdbbd('0x69')],_[_0xdbbd('0x6a')](_0x4748b2[_0xdbbd('0x65')],['ids','id'])||{})[_0xdbbd('0x34')](function(){for(var _0xb2ab6f=0x0;_0xb2ab6f<_0x4748b2[_0xdbbd('0x65')][_0xdbbd('0x69')][_0xdbbd('0x62')];_0xb2ab6f++){var _0x2464db=[];db[_0xdbbd('0x104')][_0xdbbd('0xbd')]({'where':{'id':_0x4748b2[_0xdbbd('0x65')][_0xdbbd('0x69')][_0xb2ab6f]}})[_0xdbbd('0x34')](function(_0x2e9d17){_0x2464db[_0xdbbd('0xab')](_0x2e9d17['getVoiceQueues']()[_0xdbbd('0x34')](function(_0x486129){for(var _0x381507=0x0;_0x381507<_0x486129[_0xdbbd('0x62')];_0x381507++){_0x486129[_0x381507][_0xdbbd('0x105')](_0xdbbd('0x9c'),_0xdbbd('0x106'));}return _0x486129;}));_0x2464db[_0xdbbd('0xab')](_0x2e9d17[_0xdbbd('0x107')]()[_0xdbbd('0x34')](function(_0x499985){for(var _0x2e183d=0x0;_0x2e183d<_0x499985[_0xdbbd('0x62')];_0x2e183d++){_0x499985[_0x2e183d]['setDataValue'](_0xdbbd('0x9c'),_0xdbbd('0x108'));}return _0x499985;}));_0x2464db[_0xdbbd('0xab')](_0x2e9d17[_0xdbbd('0x109')]()[_0xdbbd('0x34')](function(_0x1e4e83){for(var _0x2396d8=0x0;_0x2396d8<_0x1e4e83[_0xdbbd('0x62')];_0x2396d8++){_0x1e4e83[_0x2396d8]['setDataValue']('channel',_0xdbbd('0x10a'));}return _0x1e4e83;}));_0x2464db[_0xdbbd('0xab')](_0x2e9d17[_0xdbbd('0x10b')]()[_0xdbbd('0x34')](function(_0x304946){for(var _0x2b1b76=0x0;_0x2b1b76<_0x304946[_0xdbbd('0x62')];_0x2b1b76++){_0x304946[_0x2b1b76]['setDataValue'](_0xdbbd('0x9c'),'Sms');}return _0x304946;}));_0x2464db['push'](_0x2e9d17[_0xdbbd('0x10c')]()[_0xdbbd('0x34')](function(_0xd2e12){for(var _0x1e09d5=0x0;_0x1e09d5<_0xd2e12[_0xdbbd('0x62')];_0x1e09d5++){_0xd2e12[_0x1e09d5][_0xdbbd('0x105')](_0xdbbd('0x9c'),_0xdbbd('0x10d'));}return _0xd2e12;}));_0x2464db[_0xdbbd('0xab')](_0x2e9d17[_0xdbbd('0x10e')]()[_0xdbbd('0x34')](function(_0x3ebbb1){for(var _0x75d2cf=0x0;_0x75d2cf<_0x3ebbb1[_0xdbbd('0x62')];_0x75d2cf++){_0x3ebbb1[_0x75d2cf][_0xdbbd('0x105')](_0xdbbd('0x9c'),_0xdbbd('0x10f'));}return _0x3ebbb1;}));return BPromise[_0xdbbd('0xe7')](_0x2464db);})['then'](function(_0x482930){var _0x2eb56b=_['flatten'](_0x482930);_0x2464db=[];return db[_0xdbbd('0x59')][_0xdbbd('0x110')](function(_0x280bd2){for(var _0x2efc0f=0x0;_0x2efc0f<_0x2eb56b['length'];_0x2efc0f++){_0x2464db[_0xdbbd('0xab')](_0x2eb56b[_0x2efc0f][_0xdbbd('0x111')](_0x5a7a70['id']),{'transaction':_0x280bd2});}return BPromise[_0xdbbd('0xe7')](_0x2464db)['then'](function(){if(_0x5a7a70[_0xdbbd('0x9d')]){return BPromise[_0xdbbd('0xad')](_[_0xdbbd('0x55')](_0x2eb56b,function(_0x193160){return _0x193160['getDataValue'](_0xdbbd('0x9c'))==='Voice';}),function(_0x3b7522){return db[_0xdbbd('0xae')][_0xdbbd('0xaf')]({'membername':_0x5a7a70[_0xdbbd('0x40')],'UserId':_0x5a7a70['id'],'queue_name':_0x3b7522['name'],'VoiceQueueId':_0x3b7522['id'],'interface':_[_0xdbbd('0x70')](_0x5a7a70[_0xdbbd('0xa0')])?util[_0xdbbd('0x72')](_0xdbbd('0xac'),_0x5a7a70[_0xdbbd('0x40')]):_0x5a7a70[_0xdbbd('0xa0')],'paused':_0x5a7a70['voicePause']||![],'penalty':_0x5a7a70[_0xdbbd('0xa6')]},{'transaction':_0x280bd2});});}else{return;}})['then'](function(){for(var _0x31b46d=0x0;_0x31b46d<_0x2eb56b[_0xdbbd('0x62')];_0x31b46d++){var _0x1df635=_0x2eb56b[_0x31b46d][_0xdbbd('0x112')](_0xdbbd('0x9c'));var _0x114e32=_0x1df635+_0xdbbd('0xb1');socket[_0xdbbd('0xa8')](_0xdbbd('0x38')+_0x1df635+_0xdbbd('0x113'),{'UserId':_0x5a7a70['id'],['queueField']:_0x2eb56b[_0x31b46d]['id']});}});});});}});}})[_0xdbbd('0x34')](respondWithStatusCode(_0x5a21ae,null))[_0xdbbd('0x27')](handleError(_0x5a21ae,null));};exports['removeTeams']=function(_0x2c8b07,_0x566542){return db[_0xdbbd('0x44')][_0xdbbd('0xbd')]({'where':{'id':_0x2c8b07['params']['id']}})[_0xdbbd('0x34')](handleEntityNotFound(_0x566542,null))[_0xdbbd('0x34')](function(_0x17c8d5){if(_0x17c8d5){var _0xc936ee=_0x17c8d5[_0xdbbd('0x36')]({'plain':!![]});var _0x2cccbb=_0x2c8b07[_0xdbbd('0x4a')][_0xdbbd('0x69')];return _0x17c8d5[_0xdbbd('0x114')](_0x2cccbb)[_0xdbbd('0x34')](function(){for(var _0x12422a=0x0;_0x12422a<_0x2cccbb[_0xdbbd('0x62')];_0x12422a++){var _0x102582=[];db[_0xdbbd('0x104')][_0xdbbd('0xbd')]({'where':{'id':_0x2cccbb[_0x12422a]}})[_0xdbbd('0x34')](function(_0x168594){_0x102582[_0xdbbd('0xab')](_0x168594[_0xdbbd('0x115')]()['then'](function(_0x65f42){for(var _0x3033e8=0x0;_0x3033e8<_0x65f42[_0xdbbd('0x62')];_0x3033e8++){_0x65f42[_0x3033e8][_0xdbbd('0x105')](_0xdbbd('0x9c'),_0xdbbd('0x106'));}return _0x65f42;}));_0x102582[_0xdbbd('0xab')](_0x168594[_0xdbbd('0x107')]()[_0xdbbd('0x34')](function(_0x28452d){for(var _0x519ba7=0x0;_0x519ba7<_0x28452d[_0xdbbd('0x62')];_0x519ba7++){_0x28452d[_0x519ba7]['setDataValue']('channel',_0xdbbd('0x108'));}return _0x28452d;}));_0x102582[_0xdbbd('0xab')](_0x168594['getMailQueues']()[_0xdbbd('0x34')](function(_0x1e5567){for(var _0x2ce4f9=0x0;_0x2ce4f9<_0x1e5567[_0xdbbd('0x62')];_0x2ce4f9++){_0x1e5567[_0x2ce4f9][_0xdbbd('0x105')](_0xdbbd('0x9c'),_0xdbbd('0x10a'));}return _0x1e5567;}));_0x102582[_0xdbbd('0xab')](_0x168594[_0xdbbd('0x10b')]()[_0xdbbd('0x34')](function(_0x260c74){for(var _0x1905e2=0x0;_0x1905e2<_0x260c74['length'];_0x1905e2++){_0x260c74[_0x1905e2]['setDataValue']('channel','Sms');}return _0x260c74;}));_0x102582[_0xdbbd('0xab')](_0x168594[_0xdbbd('0x10c')]()[_0xdbbd('0x34')](function(_0x15b854){for(var _0xb2a096=0x0;_0xb2a096<_0x15b854[_0xdbbd('0x62')];_0xb2a096++){_0x15b854[_0xb2a096][_0xdbbd('0x105')](_0xdbbd('0x9c'),_0xdbbd('0x10d'));}return _0x15b854;}));_0x102582[_0xdbbd('0xab')](_0x168594['getOpenchannelQueues']()[_0xdbbd('0x34')](function(_0x40bdee){for(var _0x2ac345=0x0;_0x2ac345<_0x40bdee[_0xdbbd('0x62')];_0x2ac345++){_0x40bdee[_0x2ac345]['setDataValue'](_0xdbbd('0x9c'),_0xdbbd('0x10f'));}return _0x40bdee;}));return BPromise['all'](_0x102582);})['then'](function(_0x2afafa){var _0x671061=_[_0xdbbd('0x116')](_0x2afafa);_0x102582=[];return db['sequelize'][_0xdbbd('0x110')](function(_0x1ccc95){for(var _0x4906ec=0x0;_0x4906ec<_0x671061[_0xdbbd('0x62')];_0x4906ec++){_0x102582[_0xdbbd('0xab')](_0x671061[_0x4906ec][_0xdbbd('0x117')](_0xc936ee['id']),{'transaction':_0x1ccc95});}return BPromise[_0xdbbd('0xe7')](_0x102582)[_0xdbbd('0x34')](function(){if(_0xc936ee[_0xdbbd('0x9d')]){return BPromise[_0xdbbd('0xad')](_[_0xdbbd('0x55')](_0x671061,function(_0x3f31bd){return _0x3f31bd[_0xdbbd('0x112')]('channel')===_0xdbbd('0x106');}),function(_0x5924ea){return db[_0xdbbd('0xae')][_0xdbbd('0x35')]({'where':{'VoiceQueueId':_0x5924ea['id'],'UserId':_0xc936ee['id']},'transaction':_0x1ccc95});});}else{return;}})[_0xdbbd('0x34')](function(){for(var _0x30a226=0x0;_0x30a226<_0x671061[_0xdbbd('0x62')];_0x30a226++){var _0x1f3f26=_0x671061[_0x30a226][_0xdbbd('0x112')]('channel');var _0x4c32cd=_0x1f3f26+_0xdbbd('0xb1');socket['emit'](_0xdbbd('0x38')+_0x1f3f26+_0xdbbd('0x118'),{'UserId':_0xc936ee['id'],['queueField']:_0x671061[_0x30a226]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x566542,null))[_0xdbbd('0x27')](handleError(_0x566542,null));};exports['getLists']=function(_0x385ddb,_0x51643e,_0x3da8d4){var _0x55954d={};var _0x5be23a={};var _0x1d0834;var _0x405df6;return db[_0xdbbd('0x44')][_0xdbbd('0xbd')]({'where':{'id':_0x385ddb[_0xdbbd('0x60')]['id']}})[_0xdbbd('0x34')](handleEntityNotFound(_0x51643e,null))['then'](function(_0xc1f9c0){if(_0xc1f9c0){_0x1d0834=_0xc1f9c0;_0x5be23a[_0xdbbd('0x4d')]=_['keys'](db[_0xdbbd('0xbf')][_0xdbbd('0x45')]);_0x5be23a[_0xdbbd('0x4a')]=_[_0xdbbd('0x4b')](_0x385ddb[_0xdbbd('0x4a')]);_0x5be23a['filters']=_['intersection'](_0x5be23a[_0xdbbd('0x4d')],_0x5be23a[_0xdbbd('0x4a')]);_0x55954d[_0xdbbd('0x4f')]=_[_0xdbbd('0x4c')](_0x5be23a[_0xdbbd('0x4d')],qs['fields'](_0x385ddb['query'][_0xdbbd('0x4e')]));_0x55954d['attributes']=_0x55954d['attributes'][_0xdbbd('0x62')]?_0x55954d['attributes']:_0x5be23a['model'];_0x55954d[_0xdbbd('0x51')]=qs['sort'](_0x385ddb['query']['sort']);_0x55954d[_0xdbbd('0x53')]=qs[_0xdbbd('0x54')](_[_0xdbbd('0xc6')](_0x385ddb[_0xdbbd('0x4a')],_0x5be23a[_0xdbbd('0x54')]));if(_0x385ddb[_0xdbbd('0x4a')][_0xdbbd('0x55')]){_0x55954d[_0xdbbd('0x53')]=_[_0xdbbd('0x56')](_0x55954d[_0xdbbd('0x53')],{'$or':_[_0xdbbd('0x3c')](_0x55954d[_0xdbbd('0x4f')],function(_0x2c43dc){var _0x534a72={};_0x534a72[_0x2c43dc]={'$like':'%'+_0x385ddb[_0xdbbd('0x4a')]['filter']+'%'};return _0x534a72;})});}_0x55954d=_[_0xdbbd('0x56')]({},_0x55954d,_0x385ddb[_0xdbbd('0x5b')]);return _0x1d0834[_0xdbbd('0x119')](_0x55954d);}})[_0xdbbd('0x34')](function(_0x1b9024){if(_0x1b9024){_0x405df6=_0x1b9024[_0xdbbd('0x62')];if(!_0x385ddb[_0xdbbd('0x4a')][_0xdbbd('0x50')]('nolimit')){_0x55954d[_0xdbbd('0x2e')]=qs['limit'](_0x385ddb[_0xdbbd('0x4a')][_0xdbbd('0x2e')]);_0x55954d[_0xdbbd('0x2d')]=qs['offset'](_0x385ddb[_0xdbbd('0x4a')][_0xdbbd('0x2d')]);}return _0x1d0834[_0xdbbd('0x119')](_0x55954d);}})[_0xdbbd('0x34')](function(_0x507935){if(_0x507935){return _0x507935?{'count':_0x405df6,'rows':_0x507935}:null;}})[_0xdbbd('0x34')](respondWithResult(_0x51643e,null))['catch'](handleError(_0x51643e,null));};exports[_0xdbbd('0x11a')]=function(_0x3a63a8,_0x46641e,_0x255bb3){var _0x346fa5={};var _0x646fa3={};var _0x5b3f2d;var _0x55cd;return db[_0xdbbd('0x44')]['findOne']({'where':{'id':_0x3a63a8[_0xdbbd('0x60')]['id']}})[_0xdbbd('0x34')](handleEntityNotFound(_0x46641e,null))['then'](function(_0x1c80a5){if(_0x1c80a5){_0x5b3f2d=_0x1c80a5;_0x646fa3[_0xdbbd('0x4d')]=_[_0xdbbd('0x4b')](db['User'][_0xdbbd('0x45')]);_0x646fa3['query']=_[_0xdbbd('0x4b')](_0x3a63a8[_0xdbbd('0x4a')]);_0x646fa3[_0xdbbd('0x54')]=_[_0xdbbd('0x4c')](_0x646fa3[_0xdbbd('0x4d')],_0x646fa3[_0xdbbd('0x4a')]);_0x346fa5['attributes']=_['intersection'](_0x646fa3[_0xdbbd('0x4d')],qs[_0xdbbd('0x4e')](_0x3a63a8[_0xdbbd('0x4a')][_0xdbbd('0x4e')]));_0x346fa5[_0xdbbd('0x4f')]=_0x346fa5[_0xdbbd('0x4f')][_0xdbbd('0x62')]?_0x346fa5[_0xdbbd('0x4f')]:_0x646fa3['model'];_0x346fa5[_0xdbbd('0x51')]=qs[_0xdbbd('0x52')](_0x3a63a8[_0xdbbd('0x4a')]['sort']);_0x346fa5['where']=qs['filters'](_['pick'](_0x3a63a8[_0xdbbd('0x4a')],_0x646fa3['filters']));if(_0x3a63a8[_0xdbbd('0x4a')][_0xdbbd('0x55')]){_0x346fa5[_0xdbbd('0x53')]=_[_0xdbbd('0x56')](_0x346fa5[_0xdbbd('0x53')],{'$or':_[_0xdbbd('0x3c')](_0x346fa5['attributes'],function(_0x1f79dc){var _0x8c7d22={};_0x8c7d22[_0x1f79dc]={'$like':'%'+_0x3a63a8['query'][_0xdbbd('0x55')]+'%'};return _0x8c7d22;})});}_0x346fa5['model']=db[_0xdbbd('0x44')];_0x346fa5['as']=_0xdbbd('0x11b');_0x346fa5=_[_0xdbbd('0x56')]({},_0x346fa5,_0x3a63a8[_0xdbbd('0x5b')]);return _0x5b3f2d['getVoiceQueues']({'include':[_0x346fa5]});}})[_0xdbbd('0x34')](function(_0x3cfe81){if(_0x3cfe81){var _0x10f367={},_0x4406a9=[],_0x5a5ee7=0x0;for(var _0x502e38=0x0;_0x502e38<_0x3cfe81[_0xdbbd('0x62')];_0x502e38+=0x1){for(var _0x2b3275=0x0,_0x13f77b;_0x2b3275<_0x3cfe81[_0x502e38]['Agents'][_0xdbbd('0x62')];_0x2b3275+=0x1){_0x13f77b=_0x3cfe81[_0x502e38]['Agents'][_0x2b3275][_0xdbbd('0x36')]({'plain':!![]});_0x10f367[_0x13f77b['id']]=_0x13f77b;}}_0x10f367=_[_0xdbbd('0x11c')](_0x10f367);for(var _0x535040=qs[_0xdbbd('0x2d')](_0x3a63a8[_0xdbbd('0x4a')]['offset']);_0x535040<_0x10f367['length']&&_0x4406a9[_0xdbbd('0x62')]=_0x37902c){_0x44f783=_0x37902c;_0x28f3cc=0xc8;}else{_0x28f3cc=0xce;}_0x51c6f4[_0xd8aa('0x2c')](_0x28f3cc);return _0x51c6f4[_0xd8aa('0x31')](_0xd8aa('0x32'),_0x168a2e+'-'+_0x44f783+'/'+_0x37902c)[_0xd8aa('0x2d')](_0x441466);}return null;};}function patchUpdates(_0x3b8476){return function(_0x271230){try{jsonpatch[_0xd8aa('0x33')](_0x271230,_0x3b8476,!![]);}catch(_0x5c343b){return BPromise[_0xd8aa('0x34')](_0x5c343b);}return _0x271230[_0xd8aa('0x35')]();};}function saveUpdates(_0x47401e,_0x511b4a){return function(_0x1d16d6){if(_0x1d16d6){return _0x1d16d6[_0xd8aa('0x36')](_0x47401e)[_0xd8aa('0x20')](function(_0x45c216){return _0x45c216;});}return null;};}function removeEntity(_0x249564,_0x25672a){return function(_0x400bdf){if(_0x400bdf){return _0x400bdf[_0xd8aa('0x37')]()[_0xd8aa('0x20')](function(){var _0x47a3b2=_0x400bdf[_0xd8aa('0x38')]({'plain':!![]});var _0xef25cb=[{'name':_0xd8aa('0x39'),'value':_0xd8aa('0x3a'),'ignore':!![]},{'name':_0xd8aa('0x3b'),'value':_0xd8aa('0x3c'),'ignore':![]},{'name':_0xd8aa('0x3d'),'value':_0xd8aa('0x3e'),'ignore':![]}];var _0xb8bfe6=_(_0xef25cb)['filter'](_0xd8aa('0x3f'))['map'](_0xd8aa('0x40'))[_0xd8aa('0x40')]();if(_['includes'](_0xb8bfe6,_0x47a3b2[_0xd8aa('0x41')])){return;}var _0x1a4f2c=_[_0xd8aa('0x42')](_0xef25cb,[_0xd8aa('0x40'),_0x47a3b2[_0xd8aa('0x41')]])['name'];return db['UserProfileResource'][_0xd8aa('0x37')]({'where':{'type':_0x1a4f2c,'resourceId':_0x47a3b2['id']}})['then'](function(){return _0x400bdf;});})[_0xd8aa('0x20')](function(){_0x249564[_0xd8aa('0x2c')](0xcc)[_0xd8aa('0x43')]();});}};}function handleEntityNotFound(_0x43c58d,_0x475169){return function(_0x3430ae){if(!_0x3430ae){_0x43c58d[_0xd8aa('0x2b')](0x194);}return _0x3430ae;};}function handleError(_0x3b0220,_0xce52cb){_0xce52cb=_0xce52cb||0x1f4;return function(_0xa34bea){logger[_0xd8aa('0x26')](_0xa34bea['stack']);if(_0xa34bea[_0xd8aa('0x44')]){delete _0xa34bea[_0xd8aa('0x44')];}_0x3b0220[_0xd8aa('0x2c')](_0xce52cb)['send'](_0xa34bea);};}exports[_0xd8aa('0x45')]=function(_0x7e3882,_0x417ff9){var _0x2fedbe={},_0x3a0284={},_0x3bbb17={'count':0x0,'rows':[]};var _0x2b28f9=_[_0xd8aa('0x46')](db[_0xd8aa('0x47')][_0xd8aa('0x48')],function(_0x20c7a0){return{'name':_0x20c7a0[_0xd8aa('0x49')],'type':_0x20c7a0[_0xd8aa('0x4a')][_0xd8aa('0x4b')]};});_0x3a0284[_0xd8aa('0x4c')]=_[_0xd8aa('0x4d')](_[_0xd8aa('0x46')](_0x2b28f9,_0xd8aa('0x44')),['password',_0xd8aa('0x4e')]);_0x3a0284[_0xd8aa('0x4f')]=_[_0xd8aa('0x50')](_0x7e3882[_0xd8aa('0x4f')]);_0x3a0284[_0xd8aa('0x51')]=_[_0xd8aa('0x52')](_0x3a0284['model'],_0x3a0284[_0xd8aa('0x4f')]);_0x2fedbe['attributes']=_[_0xd8aa('0x52')](_0x3a0284['model'],qs[_0xd8aa('0x53')](_0x7e3882['query']['fields']));_0x2fedbe[_0xd8aa('0x54')]=_0x2fedbe[_0xd8aa('0x54')][_0xd8aa('0x55')]?_0x2fedbe[_0xd8aa('0x54')]:_0x3a0284[_0xd8aa('0x4c')];if(!_0x7e3882[_0xd8aa('0x4f')]['hasOwnProperty'](_0xd8aa('0x56'))){_0x2fedbe[_0xd8aa('0x30')]=qs[_0xd8aa('0x30')](_0x7e3882[_0xd8aa('0x4f')][_0xd8aa('0x30')]);_0x2fedbe['offset']=qs['offset'](_0x7e3882['query'][_0xd8aa('0x2f')]);}_0x2fedbe[_0xd8aa('0x57')]=qs[_0xd8aa('0x58')](_0x7e3882[_0xd8aa('0x4f')][_0xd8aa('0x58')]);_0x2fedbe[_0xd8aa('0x59')]=qs['filters'](_[_0xd8aa('0x5a')](_0x7e3882[_0xd8aa('0x4f')],_0x3a0284['filters']));if(_0x7e3882[_0xd8aa('0x4f')][_0xd8aa('0x5b')]){_0x2fedbe[_0xd8aa('0x59')]=_['merge'](_0x2fedbe[_0xd8aa('0x59')],{'$or':_[_0xd8aa('0x46')](_0x2b28f9,function(_0x3b93b1){if(_0x3b93b1[_0xd8aa('0x4a')]!==_0xd8aa('0x5c')){return db[_0xd8aa('0x5d')]['where'](db['sequelize']['fn'](_0xd8aa('0x5e'),db[_0xd8aa('0x5d')][_0xd8aa('0x5f')](_0x3b93b1[_0xd8aa('0x44')])),{'$like':db[_0xd8aa('0x5d')]['fn'](_0xd8aa('0x5e'),'%'+_0x7e3882[_0xd8aa('0x4f')]['filter']+'%')});}})});}_0x2fedbe=_[_0xd8aa('0x60')]({},_0x2fedbe,_0x7e3882[_0xd8aa('0x61')]);var _0x54e8cc={'where':_0x2fedbe[_0xd8aa('0x59')]};return db['User'][_0xd8aa('0x2e')](_0x54e8cc)[_0xd8aa('0x20')](function(_0xe65291){_0x3bbb17['count']=_0xe65291;if(_0x7e3882['query']['includeAll']){_0x2fedbe['include']=[{'all':!![]}];}return db[_0xd8aa('0x47')][_0xd8aa('0x62')](_0x2fedbe);})[_0xd8aa('0x20')](function(_0x5113b5){_0x3bbb17['rows']=_0x5113b5;return _0x3bbb17;})['then'](respondWithFilteredResult(_0x417ff9,_0x2fedbe))[_0xd8aa('0x2a')](handleError(_0x417ff9,null));};exports[_0xd8aa('0x63')]=function(_0x178775,_0x2d33cb){var _0x1a94f4={'raw':![],'where':{'id':_0x178775[_0xd8aa('0x64')]['id']}},_0x19e97d={};_0x19e97d[_0xd8aa('0x4c')]=_[_0xd8aa('0x4d')](_[_0xd8aa('0x50')](db[_0xd8aa('0x47')][_0xd8aa('0x48')]),[_0xd8aa('0x65'),'salt']);_0x19e97d['query']=_[_0xd8aa('0x50')](_0x178775[_0xd8aa('0x4f')]);_0x19e97d[_0xd8aa('0x51')]=_[_0xd8aa('0x52')](_0x19e97d['model'],_0x19e97d[_0xd8aa('0x4f')]);_0x1a94f4[_0xd8aa('0x54')]=_['intersection'](_0x19e97d['model'],qs[_0xd8aa('0x53')](_0x178775[_0xd8aa('0x4f')][_0xd8aa('0x53')]));_0x1a94f4[_0xd8aa('0x54')]=_0x1a94f4['attributes']['length']?_0x1a94f4[_0xd8aa('0x54')]:_0x19e97d['model'];if(_0x178775[_0xd8aa('0x4f')][_0xd8aa('0x66')]){_0x1a94f4[_0xd8aa('0x67')]=[{'all':!![]}];}_0x1a94f4=_[_0xd8aa('0x60')]({},_0x1a94f4,_0x178775[_0xd8aa('0x61')]);return db[_0xd8aa('0x47')]['find'](_0x1a94f4)[_0xd8aa('0x20')](handleEntityNotFound(_0x2d33cb,null))[_0xd8aa('0x20')](respondWithResult(_0x2d33cb,null))[_0xd8aa('0x2a')](handleError(_0x2d33cb,null));};exports[_0xd8aa('0x68')]=function(_0x17c5ac,_0x170954){return db[_0xd8aa('0x47')][_0xd8aa('0x68')](_0x17c5ac[_0xd8aa('0x69')],{'raw':![],'individualHooks':!![]})[_0xd8aa('0x20')](respondWithResult(_0x170954,0xc9))[_0xd8aa('0x2a')](handleError(_0x170954,null));};exports[_0xd8aa('0x36')]=function(_0x167532,_0x9d33c3){if(_0x167532[_0xd8aa('0x69')]['id']){delete _0x167532[_0xd8aa('0x69')]['id'];}delete _0x167532[_0xd8aa('0x69')][_0xd8aa('0x41')];return db[_0xd8aa('0x47')][_0xd8aa('0x42')]({'where':{'id':_0x167532[_0xd8aa('0x64')]['id']}})['then'](handleEntityNotFound(_0x9d33c3,null))['then'](saveUpdates(_0x167532['body'],null))[_0xd8aa('0x20')](respondWithResult(_0x9d33c3,null))['catch'](handleError(_0x9d33c3,null));};exports[_0xd8aa('0x6a')]=function(_0xcda805,_0x2926e8){return db[_0xd8aa('0x47')][_0xd8aa('0x6a')]()[_0xd8aa('0x20')](respondWithResult(_0x2926e8,null))[_0xd8aa('0x2a')](handleError(_0x2926e8,null));};exports[_0xd8aa('0x6b')]=function(_0x3a3cb8,_0x3ef3c8,_0x1824fa){return db['User']['find']({'where':{'id':_0x3a3cb8[_0xd8aa('0x64')]['id']}})['then'](handleEntityNotFound(_0x3ef3c8,null))[_0xd8aa('0x20')](function(_0x57d1c3){if(_0x57d1c3){return _0x57d1c3['addContacts'](_0x3a3cb8[_0xd8aa('0x69')][_0xd8aa('0x6c')],_[_0xd8aa('0x6d')](_0x3a3cb8[_0xd8aa('0x69')],['ids','id'])||{});}})[_0xd8aa('0x20')](respondWithResult(_0x3ef3c8,null))[_0xd8aa('0x2a')](handleError(_0x3ef3c8,null));};var getLicense=function(_0x28b7e8){return new BPromise(function(_0x9f73cf,_0x17bc21){var _0x24132d=0x0;_0x28b7e8[_0xd8aa('0x69')][_0xd8aa('0x41')]===_0xd8aa('0x3c')&&_0x9f73cf(_0xd8aa('0x6e'));return db['User'][_0xd8aa('0x2e')]({'where':{'$or':[{'role':_0x28b7e8[_0xd8aa('0x69')][_0xd8aa('0x41')]==='telephone'?'telephone':[_0xd8aa('0x6f'),_0xd8aa('0x3a')]}]}})['then'](function(_0x2c869e){_0x24132d=_0x2c869e;return require(_0xd8aa('0x70'))[_0xd8aa('0x71')]();})[_0xd8aa('0x20')](function(_0x425524){var _0x27c98a=_0x28b7e8[_0xd8aa('0x69')]['role']===_0xd8aa('0x3e')?_0xd8aa('0x72'):_0xd8aa('0x73');if(!_[_0xd8aa('0x74')](_0x425524[_0x27c98a])&&_0x24132d>=_0x425524[_0x27c98a]){return _0x17bc21({'message':_0xd8aa('0x75')});}return _0x9f73cf(util[_0xd8aa('0x76')](_0xd8aa('0x77'),_0x27c98a,_0x24132d));})[_0xd8aa('0x2a')](function(_0x56d58b){return _0x17bc21(_0x56d58b);});});};exports[_0xd8aa('0x78')]=function(_0x45da98,_0x27b10b){return getLicense(_0x45da98)['then'](function(_0x1f8902){if(!_0x45da98[_0xd8aa('0x69')][_0xd8aa('0x79')]){var _0x2d6dd3;return db[_0xd8aa('0x7a')][_0xd8aa('0x7b')](0x1)[_0xd8aa('0x20')](function(_0x2c6083){return checkPasswordPattern(_0x2c6083,_0x45da98[_0xd8aa('0x69')][_0xd8aa('0x65')],_0x2c6083[_0xd8aa('0x7c')]);})[_0xd8aa('0x20')](function(_0x2bb705){_0x2d6dd3=_0x2bb705[_0xd8aa('0x7d')];return db[_0xd8aa('0x47')][_0xd8aa('0x7e')](_0xd8aa('0x79'));})[_0xd8aa('0x20')](function(_0x4f9efb){if(_[_0xd8aa('0x74')](_0x4f9efb)){if(_0x2d6dd3){_0x45da98[_0xd8aa('0x69')][_0xd8aa('0x79')]=_0x2d6dd3;}else{_0x45da98[_0xd8aa('0x69')]['internal']=0x1;}}else{if(_[_0xd8aa('0x74')](_0x2d6dd3)||_0x2d6dd3==_0x4f9efb){_0x45da98[_0xd8aa('0x69')][_0xd8aa('0x79')]=_0x4f9efb+0x1;}else if(_0x2d6dd3>_0x4f9efb){_0x45da98[_0xd8aa('0x69')]['internal']=_0x2d6dd3;}else{return db[_0xd8aa('0x5d')]['query'](_0xd8aa('0x7f'),{'type':db[_0xd8aa('0x5d')][_0xd8aa('0x80')][_0xd8aa('0x81')]})[_0xd8aa('0x20')](function(_0xabf19e){if(_0xabf19e&&_0xabf19e[_0xd8aa('0x55')]){for(var _0x480345=0x0,_0x512c32=_0xabf19e[_0xd8aa('0x55')];_0x480345<_0x512c32&&_[_0xd8aa('0x74')](_0x45da98[_0xd8aa('0x69')]['internal']);_0x480345++){if(_0x2d6dd3<=_0xabf19e[_0x480345][_0xd8aa('0x82')]){_0x45da98[_0xd8aa('0x69')][_0xd8aa('0x79')]=_0xabf19e[_0x480345][_0xd8aa('0x82')];}else if(_0x2d6dd3>_0xabf19e[_0x480345][_0xd8aa('0x82')]&&_0x2d6dd3<=_0xabf19e[_0x480345]['to']){_0x45da98['body']['internal']=_0x2d6dd3;}}}if(_[_0xd8aa('0x74')](_0x45da98['body'][_0xd8aa('0x79')])){_0x45da98[_0xd8aa('0x69')][_0xd8aa('0x79')]=_0x4f9efb+0x1;}});}}});}})[_0xd8aa('0x20')](function(){if(_0x45da98[_0xd8aa('0x69')][_0xd8aa('0x83')]){_0x45da98['body'][_0xd8aa('0x84')]=_0x45da98[_0xd8aa('0x69')][_0xd8aa('0x79')];_0x45da98['body']['VoiceMail']={'mailbox':_0x45da98['body']['internal'],'password':_0x45da98[_0xd8aa('0x69')][_0xd8aa('0x65')],'fullname':_0x45da98['body']['fullname'],'email':_0x45da98[_0xd8aa('0x69')][_0xd8aa('0x85')]};}if(_0x45da98['body']&&_0x45da98['body'][_0xd8aa('0x41')]===_0xd8aa('0x3c')){_0x45da98[_0xd8aa('0x69')]['permissions']=['101',_0xd8aa('0x86'),_0xd8aa('0x87'),_0xd8aa('0x88'),_0xd8aa('0x89'),_0xd8aa('0x8a'),_0xd8aa('0x8b'),_0xd8aa('0x8c'),_0xd8aa('0x8d'),_0xd8aa('0x8e'),_0xd8aa('0x8f'),_0xd8aa('0x90')];}return db[_0xd8aa('0x47')][_0xd8aa('0x78')](_0x45da98[_0xd8aa('0x69')],{'include':[{'model':db[_0xd8aa('0x91')],'as':_0xd8aa('0x91')}]});})['then'](function(_0x262913){if(_0x45da98[_0xd8aa('0x69')]['role']===_0xd8aa('0x3a'))return _0x262913;var _0x352bce=_0x45da98[_0xd8aa('0x3a')][_0xd8aa('0x38')]({'plain':!![]});if(!_0x352bce)throw new Error(_0xd8aa('0x92'));if(_0x352bce['role']===_0xd8aa('0x3a')){var _0xd9b3bb=_0x262913['get']({'plain':!![]});var _0x41877a=[{'name':_0xd8aa('0x3b'),'value':'agent'},{'name':_0xd8aa('0x3d'),'value':_0xd8aa('0x3e')}];var _0x254641=_[_0xd8aa('0x42')](_0x41877a,[_0xd8aa('0x40'),_0xd9b3bb[_0xd8aa('0x41')]])['name'];return db[_0xd8aa('0x93')][_0xd8aa('0x42')]({'where':{'name':_0x254641,'userProfileId':_0x352bce[_0xd8aa('0x94')]},'raw':!![]})[_0xd8aa('0x20')](function(_0x2f6386){if(_0x2f6386&&_0x2f6386['autoAssociation']===0x0){return db[_0xd8aa('0x95')]['create']({'name':_0xd9b3bb[_0xd8aa('0x44')],'resourceId':_0xd9b3bb['id'],'type':_0x2f6386[_0xd8aa('0x44')],'sectionId':_0x2f6386['id']},{})[_0xd8aa('0x20')](function(){return _0x262913;});}else{return _0x262913;}})[_0xd8aa('0x2a')](function(_0x48db69){logger[_0xd8aa('0x26')](_0xd8aa('0x96'),_0x48db69);throw _0x48db69;});}return _0x262913;})[_0xd8aa('0x20')](respondWithResult(_0x27b10b,0xc9))[_0xd8aa('0x2a')](handleError(_0x27b10b,null));};exports['changePassword']=function(_0x767730,_0x44ed5f,_0x2d7177){var _0x36d479=![];if(_0x767730[_0xd8aa('0x69')]['id']){delete _0x767730['body']['id'];}return db['Setting'][_0xd8aa('0x97')]({'attributes':['id',_0xd8aa('0x7c')]})[_0xd8aa('0x20')](function(_0x17cf24){_0x36d479=_0x17cf24[_0xd8aa('0x7c')];return db[_0xd8aa('0x47')][_0xd8aa('0x42')]({'where':{'id':_0x767730['params']['id']}});})[_0xd8aa('0x20')](function(_0x237ed9){if(_0x237ed9){if(_0x237ed9['id']==_0x767730['user']['id']){if(!_0x767730['body'][_0xd8aa('0x98')]||!_0x767730['body'][_0xd8aa('0x99')]){throw new db[(_0xd8aa('0x9a'))][(_0xd8aa('0x1d'))](_0xd8aa('0x9b'));}if(!_0x237ed9[_0xd8aa('0x9c')](_0x767730[_0xd8aa('0x69')]['oldPassword'])){throw new db['Sequelize']['ValidationError'](_0xd8aa('0x9d'));}if(_0x767730[_0xd8aa('0x69')][_0xd8aa('0x98')]==_0x767730[_0xd8aa('0x69')]['newPassword']){throw new db[(_0xd8aa('0x9a'))][(_0xd8aa('0x1d'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}return _0x237ed9;}else if(_0x767730[_0xd8aa('0x3a')][_0xd8aa('0x41')]==_0xd8aa('0x6f')){if(!_0x767730[_0xd8aa('0x69')][_0xd8aa('0x99')]){throw new db[(_0xd8aa('0x9a'))][(_0xd8aa('0x1d'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0x237ed9;}else if(_0x767730[_0xd8aa('0x3a')]['role']==_0xd8aa('0x3a')){if(!_0x767730[_0xd8aa('0x69')]['newPassword']){throw new db[(_0xd8aa('0x9a'))][(_0xd8aa('0x1d'))](_0xd8aa('0x9e'));}if(_0x237ed9[_0xd8aa('0x41')]!=_0xd8aa('0x3c')){throw new db[(_0xd8aa('0x9a'))][(_0xd8aa('0x1d'))]('Unauthorized');}return _0x237ed9;}else{throw new db[(_0xd8aa('0x9a'))][(_0xd8aa('0x1d'))](_0xd8aa('0x9f'));}}return null;})[_0xd8aa('0x20')](handleEntityNotFound(_0x44ed5f,null))['then'](function(_0xdad00e){return checkPasswordPattern(_0xdad00e,_0x767730[_0xd8aa('0x69')]['newPassword'],_0x36d479);})['then'](saveUpdates({'password':_0x767730['body']['newPassword'],'passwordResetAt':_0x767730[_0xd8aa('0x3a')]['id']==_0x767730[_0xd8aa('0x64')]['id']?moment():null},null))[_0xd8aa('0x20')](respondWithResult(_0x44ed5f,null))['catch'](handleError(_0x44ed5f,null));};exports[_0xd8aa('0xa0')]=function(_0x5cdd31,_0x76dc90,_0x540aff){var _0x4e011e=_0x5cdd31['body'][_0xd8aa('0xa1')];return db['User'][_0xd8aa('0x42')]({'where':{'id':_0x5cdd31[_0xd8aa('0x64')]['id']},'attributes':['id',_0xd8aa('0x44'),_0xd8aa('0x41'),_0xd8aa('0xa2'),'loginInPause',_0xd8aa('0xa3'),'interface']})['then'](handleEntityNotFound(_0x76dc90,null))[_0xd8aa('0x20')](function(_0x2eca6a){if(_0x2eca6a){if(!utils[_0xd8aa('0xa4')](_0x4e011e)){throw new db[(_0xd8aa('0x9a'))]['ValidationError'](_0xd8aa('0xa5'));}return _0x2eca6a[_0xd8aa('0xa6')+_[_0xd8aa('0xa7')](_0x4e011e[_0xd8aa('0xa8')]())+'Queues'](_0x5cdd31[_0xd8aa('0x69')][_0xd8aa('0x6c')],{'penalty':_0x5cdd31[_0xd8aa('0x69')][_0xd8aa('0xa9')]||0x0})[_0xd8aa('0xaa')](function(_0x252936){for(var _0x3d5219=0x0;_0x3d5219<_0x5cdd31[_0xd8aa('0x69')][_0xd8aa('0x6c')]['length'];_0x3d5219+=0x1){var _0x4664d1={'UserId':_0x5cdd31['params']['id']};_0x4664d1[_[_0xd8aa('0xa7')](_0x4e011e['toLowerCase']())+_0xd8aa('0xab')]=_0x5cdd31['body'][_0xd8aa('0x6c')][_0x3d5219];socket[_0xd8aa('0xac')](_0xd8aa('0x3a')+_[_0xd8aa('0xa7')](_0x4e011e['toLowerCase']())+'Queue:save',_0x4664d1);}return _0x252936;})['then'](function(){if(_0x4e011e===_0xd8aa('0xad')){return db[_0xd8aa('0xae')][_0xd8aa('0x62')]({'where':{'id':_0x5cdd31[_0xd8aa('0x69')][_0xd8aa('0x6c')]||[]},'raw':!![],'attributes':['id',_0xd8aa('0x44')]});}})[_0xd8aa('0x20')](function(_0x5b1ef9){var _0x4b88c9=_0x2eca6a[_0xd8aa('0x38')]({'plain':!![]});var _0x6dc54f=[];if(_0x4e011e===_0xd8aa('0xad')&&_0x4b88c9['role']===_0xd8aa('0x3c')&&_0x4b88c9[_0xd8aa('0xa2')]){for(var _0x1fd79a=0x0;_0x1fd79a<_0x5b1ef9['length'];_0x1fd79a+=0x1){_0x6dc54f[_0xd8aa('0xaf')]({'membername':_0x4b88c9[_0xd8aa('0x44')],'UserId':_0x4b88c9['id'],'queue_name':_0x5b1ef9[_0x1fd79a][_0xd8aa('0x44')],'VoiceQueueId':_0x5b1ef9[_0x1fd79a]['id'],'interface':_[_0xd8aa('0x74')](_0x4b88c9[_0xd8aa('0xb0')])?util[_0xd8aa('0x76')](_0xd8aa('0xb1'),_0x4b88c9[_0xd8aa('0x44')]):_0x4b88c9[_0xd8aa('0xb0')],'paused':_0x4b88c9[_0xd8aa('0xa3')]||![],'penalty':_0x5cdd31[_0xd8aa('0x69')]['penalty']||0x0});}return BPromise['each'](_0x6dc54f,function(_0x3c9e08){return db[_0xd8aa('0xb2')][_0xd8aa('0xb3')](_0x3c9e08);});}return _0x2eca6a;});}})['then'](respondWithStatusCode(_0x76dc90,null))['catch'](handleError(_0x76dc90,null));};exports[_0xd8aa('0xb4')]=function(_0x8879c7,_0x2cf443,_0x555672){var _0x598eed;return db[_0xd8aa('0x47')][_0xd8aa('0x42')]({'where':{'id':_0x8879c7['params']['id']},'attributes':['id',_0xd8aa('0x44'),_0xd8aa('0x41')]})['then'](handleEntityNotFound(_0x2cf443,null))[_0xd8aa('0x20')](function(_0x1cfc94){if(_0x1cfc94){_0x598eed=_0x1cfc94;if(!_0x8879c7['query'][_0xd8aa('0xa1')]||!utils[_0xd8aa('0xa4')](_0x8879c7[_0xd8aa('0x4f')][_0xd8aa('0xa1')])){throw new db[(_0xd8aa('0x9a'))][(_0xd8aa('0x1d'))]('Unknown\x20channel');}return _0x1cfc94[_0xd8aa('0xb5')+_[_0xd8aa('0xa7')](_0x8879c7[_0xd8aa('0x4f')][_0xd8aa('0xa1')][_0xd8aa('0xa8')]())+_0xd8aa('0xb6')](_0x8879c7[_0xd8aa('0x4f')][_0xd8aa('0x6c')]);}})['then'](function(_0xa6c881){for(var _0xeced06=0x0;_0xeced06<_0x8879c7[_0xd8aa('0x4f')][_0xd8aa('0x6c')]['length'];_0xeced06+=0x1){var _0x3de8d1={'UserId':_0x8879c7['params']['id']};_0x3de8d1[_['capitalize'](_0x8879c7[_0xd8aa('0x4f')][_0xd8aa('0xa1')][_0xd8aa('0xa8')]())+_0xd8aa('0xab')]=_0x8879c7[_0xd8aa('0x4f')][_0xd8aa('0x6c')][_0xeced06];socket[_0xd8aa('0xac')](_0xd8aa('0x3a')+_['capitalize'](_0x8879c7[_0xd8aa('0x4f')][_0xd8aa('0xa1')][_0xd8aa('0xa8')]())+_0xd8aa('0xb7'),_0x3de8d1);}return _0xa6c881;})[_0xd8aa('0x20')](function(){if(_0x8879c7[_0xd8aa('0x4f')][_0xd8aa('0xa1')]===_0xd8aa('0xad')){return db[_0xd8aa('0xb2')][_0xd8aa('0x37')]({'where':{'UserId':_0x8879c7[_0xd8aa('0x64')]['id'],'VoiceQueueId':_0x8879c7[_0xd8aa('0x4f')]['ids']},'individualHooks':!![]})[_0xd8aa('0x20')](function(){return _0x598eed;});}return _0x598eed;})[_0xd8aa('0x20')](respondWithStatusCode(_0x2cf443,null))['catch'](handleError(_0x2cf443,null));};exports[_0xd8aa('0xb8')]=function(_0x12ff4d,_0x11f4ca,_0x450a4d){_0x12ff4d[_0xd8aa('0x69')][_0xd8aa('0xb9')]=_0x12ff4d[_0xd8aa('0xba')]['filename'];return db['User']['find']({'where':{'id':_0x12ff4d[_0xd8aa('0x64')]['id']}})['then'](handleEntityNotFound(_0x11f4ca,null))[_0xd8aa('0x20')](saveUpdates(_0x12ff4d[_0xd8aa('0x69')],null))[_0xd8aa('0x20')](respondWithResult(_0x11f4ca,null))[_0xd8aa('0x2a')](handleError(_0x11f4ca,null));};exports[_0xd8aa('0xbb')]=function(_0x2e5410,_0x4ad975,_0x3e67dc){var _0x58262b=path[_0xd8aa('0xbc')](config[_0xd8aa('0xbd')],_0xd8aa('0xbe'));return db[_0xd8aa('0x47')][_0xd8aa('0x42')]({'where':{'id':_0x2e5410['params']['id']},'attributes':['id',_0xd8aa('0xb9')],'raw':!![]})[_0xd8aa('0x20')](handleEntityNotFound(_0x4ad975,null))[_0xd8aa('0x20')](function(_0x1885ae){if(_0x1885ae){if(_[_0xd8aa('0x74')](_0x1885ae[_0xd8aa('0xb9')])){return _0x4ad975['download'](_0x58262b);}else{if(!fs[_0xd8aa('0xbf')](path['join'](config[_0xd8aa('0xbd')],_0xd8aa('0xc0'),_0x1885ae[_0xd8aa('0xb9')]))){return _0x4ad975[_0xd8aa('0xc1')](_0x58262b);}return _0x4ad975[_0xd8aa('0xc1')](path[_0xd8aa('0xbc')](config[_0xd8aa('0xbd')],_0xd8aa('0xc0'),_0x1885ae[_0xd8aa('0xb9')]));}}})[_0xd8aa('0x2a')](handleError(_0x4ad975,null));};exports['getContacts']=function(_0x2e2649,_0x50a873,_0x55a069){var _0x4f8a57={};var _0x29769d={};var _0x5ddd28;var _0x47dee0;return db[_0xd8aa('0x47')][_0xd8aa('0x97')]({'where':{'id':_0x2e2649[_0xd8aa('0x64')]['id']}})[_0xd8aa('0x20')](handleEntityNotFound(_0x50a873,null))['then'](function(_0x16f5cf){if(_0x16f5cf){_0x5ddd28=_0x16f5cf;_0x29769d[_0xd8aa('0x4c')]=_[_0xd8aa('0x50')](db[_0xd8aa('0xc2')][_0xd8aa('0x48')]);_0x29769d[_0xd8aa('0x4f')]=_[_0xd8aa('0x50')](_0x2e2649[_0xd8aa('0x4f')]);_0x29769d[_0xd8aa('0x51')]=_[_0xd8aa('0x52')](_0x29769d[_0xd8aa('0x4c')],_0x29769d[_0xd8aa('0x4f')]);_0x4f8a57[_0xd8aa('0x54')]=_[_0xd8aa('0x52')](_0x29769d[_0xd8aa('0x4c')],qs[_0xd8aa('0x53')](_0x2e2649[_0xd8aa('0x4f')][_0xd8aa('0x53')]));_0x4f8a57[_0xd8aa('0x54')]=_0x4f8a57[_0xd8aa('0x54')][_0xd8aa('0x55')]?_0x4f8a57[_0xd8aa('0x54')]:_0x29769d[_0xd8aa('0x4c')];_0x4f8a57[_0xd8aa('0x57')]=qs['sort'](_0x2e2649[_0xd8aa('0x4f')]['sort']);_0x4f8a57[_0xd8aa('0x59')]=qs[_0xd8aa('0x51')](_['pick'](_0x2e2649['query'],_0x29769d[_0xd8aa('0x51')]));if(_0x2e2649[_0xd8aa('0x4f')][_0xd8aa('0x5b')]){_0x4f8a57[_0xd8aa('0x59')]=_['merge'](_0x4f8a57[_0xd8aa('0x59')],{'$or':_[_0xd8aa('0x46')](_0x4f8a57['attributes'],function(_0x1b4605){var _0x26bf11={};_0x26bf11[_0x1b4605]={'$like':'%'+_0x2e2649[_0xd8aa('0x4f')][_0xd8aa('0x5b')]+'%'};return _0x26bf11;})});}_0x4f8a57=_['merge']({},_0x4f8a57,_0x2e2649[_0xd8aa('0x61')]);return _0x5ddd28[_0xd8aa('0xc3')](_0x4f8a57);}})[_0xd8aa('0x20')](function(_0x3862cc){if(_0x3862cc){_0x47dee0=_0x3862cc['length'];if(_0x2e2649[_0xd8aa('0x4f')][_0xd8aa('0xc4')]('includeAll')){_0x4f8a57[_0xd8aa('0x67')]=[{'model':db[_0xd8aa('0xc5')],'as':_0xd8aa('0xc6'),'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xd8aa('0x44'),_0xd8aa('0xc7')],'where':_0x2e2649[_0xd8aa('0x4f')]['tag']?{'id':_0x2e2649[_0xd8aa('0x4f')][_0xd8aa('0xc8')]}:undefined,'required':_0x2e2649[_0xd8aa('0x4f')][_0xd8aa('0xc8')]?!![]:![]}];}if(!_0x2e2649[_0xd8aa('0x4f')][_0xd8aa('0xc4')](_0xd8aa('0x56'))){_0x4f8a57['limit']=qs[_0xd8aa('0x30')](_0x2e2649[_0xd8aa('0x4f')][_0xd8aa('0x30')]);_0x4f8a57[_0xd8aa('0x2f')]=qs[_0xd8aa('0x2f')](_0x2e2649[_0xd8aa('0x4f')][_0xd8aa('0x2f')]);}return _0x5ddd28['getContacts'](_0x4f8a57);}})[_0xd8aa('0x20')](function(_0x49c390){if(_0x49c390){return _0x49c390?{'count':_0x47dee0,'rows':_0x49c390}:null;}})['then'](respondWithResult(_0x50a873,null))[_0xd8aa('0x2a')](handleError(_0x50a873,null));};exports[_0xd8aa('0xc9')]=function(_0x1cdaba,_0x2b3bbc,_0x1fe408){var _0x43a9a3;var _0x5ee756;var _0x2838ad={};var _0x4c8efc;return db[_0xd8aa('0x47')][_0xd8aa('0x97')]({'where':{'id':_0x1cdaba['params']['id']},'attributes':['id',_0xd8aa('0x44'),_0xd8aa('0x41')]})[_0xd8aa('0x20')](handleEntityNotFound(_0x2b3bbc,null))[_0xd8aa('0x20')](function(_0x1fa658){if(!utils['isValidChannel'](_0x1cdaba[_0xd8aa('0x4f')][_0xd8aa('0xa1')])){throw new db['Sequelize'][(_0xd8aa('0x1d'))](_0xd8aa('0xa5'));}_0x43a9a3=_0x1fa658;var _0x4f20d0={};_0x4f20d0['model']=_[_0xd8aa('0x50')](db[_[_0xd8aa('0xa7')](_0x1cdaba[_0xd8aa('0x4f')][_0xd8aa('0xa1')])+_0xd8aa('0xca')]['rawAttributes']);_0x4f20d0[_0xd8aa('0x4f')]=_[_0xd8aa('0x50')](_0x1cdaba[_0xd8aa('0x4f')]);_0x4f20d0['filters']=_[_0xd8aa('0x52')](_0x4f20d0[_0xd8aa('0x4c')],_0x4f20d0[_0xd8aa('0x4f')]);_0x2838ad[_0xd8aa('0x54')]=_[_0xd8aa('0x52')](_0x4f20d0['model'],qs[_0xd8aa('0x53')](_0x1cdaba[_0xd8aa('0x4f')][_0xd8aa('0x53')]));_0x2838ad[_0xd8aa('0x54')]=_0x2838ad['attributes'][_0xd8aa('0x55')]?_0x2838ad[_0xd8aa('0x54')]:_0x4f20d0['model'];_0x2838ad['order']=qs[_0xd8aa('0x58')](_0x1cdaba[_0xd8aa('0x4f')][_0xd8aa('0x58')]);_0x2838ad['where']=qs[_0xd8aa('0x51')](_[_0xd8aa('0x5a')](_0x1cdaba[_0xd8aa('0x4f')],_0x4f20d0['filters']));if(_0x1cdaba[_0xd8aa('0x4f')][_0xd8aa('0x5b')]){_0x2838ad[_0xd8aa('0x59')]=_[_0xd8aa('0x60')](_0x2838ad[_0xd8aa('0x59')],{'$or':_[_0xd8aa('0x46')](_0x2838ad[_0xd8aa('0x54')],function(_0x10ade1){var _0x9b6348={};_0x9b6348[_0x10ade1]={'$like':'%'+_0x1cdaba['query'][_0xd8aa('0x5b')]+'%'};return _0x9b6348;})});}_0x2838ad=_[_0xd8aa('0x60')]({},_0x2838ad,_0x1cdaba['options']);switch(_0x43a9a3['role']){case _0xd8aa('0x6f'):return db[_['capitalize'](_0x1cdaba[_0xd8aa('0x4f')]['channel'])+'Queue'][_0xd8aa('0x62')](_0x2838ad);case _0xd8aa('0x3a'):case _0xd8aa('0x3c'):return _0x43a9a3[_0xd8aa('0x38')+_[_0xd8aa('0xa7')](_0x1cdaba[_0xd8aa('0x4f')]['channel'])+_0xd8aa('0xb6')](_0x2838ad);default:throw new db[(_0xd8aa('0x9a'))]['ValidationError'](_0xd8aa('0xcb'));}})[_0xd8aa('0x20')](function(_0x1a2120){_0x4c8efc=_0x1a2120[_0xd8aa('0x55')];if(!_0x1cdaba['query'][_0xd8aa('0xc4')](_0xd8aa('0x56'))){_0x2838ad[_0xd8aa('0x30')]=qs[_0xd8aa('0x30')](_0x1cdaba[_0xd8aa('0x4f')][_0xd8aa('0x30')]);_0x2838ad[_0xd8aa('0x2f')]=qs[_0xd8aa('0x2f')](_0x1cdaba[_0xd8aa('0x4f')][_0xd8aa('0x2f')]);}switch(_0x43a9a3[_0xd8aa('0x41')]){case _0xd8aa('0x6f'):return db[_[_0xd8aa('0xa7')](_0x1cdaba[_0xd8aa('0x4f')][_0xd8aa('0xa1')])+_0xd8aa('0xca')][_0xd8aa('0x62')](_0x2838ad);case _0xd8aa('0x3a'):case _0xd8aa('0x3c'):return _0x43a9a3[_0xd8aa('0x38')+_['capitalize'](_0x1cdaba[_0xd8aa('0x4f')]['channel'])+_0xd8aa('0xb6')](_0x2838ad);}})['then'](function(_0x902198){return{'count':_0x4c8efc,'rows':_0x902198};})[_0xd8aa('0x20')](respondWithResult(_0x2b3bbc,null))[_0xd8aa('0x2a')](handleError(_0x2b3bbc,null));};exports[_0xd8aa('0xcc')]=function(_0x3d7ec1,_0x594f53,_0x504a99){var _0x5aebfb={};var _0x3da422={};var _0x42a97f;var _0x5a7896;return db['User'][_0xd8aa('0x97')]({'where':{'id':_0x3d7ec1['params']['id']}})[_0xd8aa('0x20')](handleEntityNotFound(_0x594f53,null))[_0xd8aa('0x20')](function(_0x52df99){if(_0x52df99){_0x42a97f=_0x52df99;_0x3da422[_0xd8aa('0x4c')]=_['keys'](db[_0xd8aa('0xb2')][_0xd8aa('0x48')]);_0x3da422[_0xd8aa('0x4f')]=_['keys'](_0x3d7ec1[_0xd8aa('0x4f')]);_0x3da422['filters']=_[_0xd8aa('0x52')](_0x3da422[_0xd8aa('0x4c')],_0x3da422[_0xd8aa('0x4f')]);_0x5aebfb[_0xd8aa('0x54')]=_[_0xd8aa('0x52')](_0x3da422[_0xd8aa('0x4c')],qs['fields'](_0x3d7ec1[_0xd8aa('0x4f')][_0xd8aa('0x53')]));_0x5aebfb[_0xd8aa('0x54')]=_0x5aebfb[_0xd8aa('0x54')]['length']?_0x5aebfb['attributes']:_0x3da422[_0xd8aa('0x4c')];_0x5aebfb['order']=qs[_0xd8aa('0x58')](_0x3d7ec1[_0xd8aa('0x4f')][_0xd8aa('0x58')]);_0x5aebfb[_0xd8aa('0x59')]=qs[_0xd8aa('0x51')](_[_0xd8aa('0x5a')](_0x3d7ec1[_0xd8aa('0x4f')],_0x3da422[_0xd8aa('0x51')]));if(_0x3d7ec1[_0xd8aa('0x4f')][_0xd8aa('0x5b')]){_0x5aebfb[_0xd8aa('0x59')]=_[_0xd8aa('0x60')](_0x5aebfb[_0xd8aa('0x59')],{'$or':_[_0xd8aa('0x46')](_0x5aebfb['attributes'],function(_0x3d0c9b){var _0x367fcc={};_0x367fcc[_0x3d0c9b]={'$like':'%'+_0x3d7ec1['query']['filter']+'%'};return _0x367fcc;})});}_0x5aebfb=_[_0xd8aa('0x60')]({},_0x5aebfb,_0x3d7ec1[_0xd8aa('0x61')]);return _0x42a97f[_0xd8aa('0xcc')](_0x5aebfb);}})[_0xd8aa('0x20')](function(_0x476c35){if(_0x476c35){_0x5a7896=_0x476c35['length'];if(!_0x3d7ec1[_0xd8aa('0x4f')][_0xd8aa('0xc4')]('nolimit')){_0x5aebfb[_0xd8aa('0x30')]=qs[_0xd8aa('0x30')](_0x3d7ec1['query'][_0xd8aa('0x30')]);_0x5aebfb[_0xd8aa('0x2f')]=qs['offset'](_0x3d7ec1[_0xd8aa('0x4f')][_0xd8aa('0x2f')]);}return _0x42a97f['getVoiceQueuesRt'](_0x5aebfb);}})[_0xd8aa('0x20')](function(_0x49951a){if(_0x49951a){return _0x49951a?{'count':_0x5a7896,'rows':_0x49951a}:null;}})[_0xd8aa('0x20')](respondWithResult(_0x594f53,null))[_0xd8aa('0x2a')](handleError(_0x594f53,null));};exports['getGroups']=function(_0x3f90a7,_0x3e12a2,_0xade793){var _0x446332={};var _0x4f728a={};var _0x552396;var _0xf577f0;return db[_0xd8aa('0x47')][_0xd8aa('0x97')]({'where':{'id':_0x3f90a7[_0xd8aa('0x64')]['id']}})[_0xd8aa('0x20')](handleEntityNotFound(_0x3e12a2,null))[_0xd8aa('0x20')](function(_0x55b77d){if(_0x55b77d){_0x552396=_0x55b77d;_0x4f728a[_0xd8aa('0x4c')]=_[_0xd8aa('0x50')](db[_0xd8aa('0xcd')][_0xd8aa('0x48')]);_0x4f728a[_0xd8aa('0x4f')]=_[_0xd8aa('0x50')](_0x3f90a7['query']);_0x4f728a[_0xd8aa('0x51')]=_['intersection'](_0x4f728a[_0xd8aa('0x4c')],_0x4f728a[_0xd8aa('0x4f')]);_0x446332[_0xd8aa('0x54')]=_[_0xd8aa('0x52')](_0x4f728a['model'],qs[_0xd8aa('0x53')](_0x3f90a7[_0xd8aa('0x4f')]['fields']));_0x446332[_0xd8aa('0x54')]=_0x446332['attributes'][_0xd8aa('0x55')]?_0x446332['attributes']:_0x4f728a[_0xd8aa('0x4c')];_0x446332[_0xd8aa('0x57')]=qs['sort'](_0x3f90a7[_0xd8aa('0x4f')]['sort']);_0x446332[_0xd8aa('0x59')]=qs[_0xd8aa('0x51')](_[_0xd8aa('0x5a')](_0x3f90a7[_0xd8aa('0x4f')],_0x4f728a[_0xd8aa('0x51')]));if(_0x3f90a7[_0xd8aa('0x4f')][_0xd8aa('0x5b')]){_0x446332[_0xd8aa('0x59')]=_[_0xd8aa('0x60')](_0x446332[_0xd8aa('0x59')],{'$or':_[_0xd8aa('0x46')](_0x446332[_0xd8aa('0x54')],function(_0x26c3b7){var _0x2e44c0={};_0x2e44c0[_0x26c3b7]={'$like':'%'+_0x3f90a7[_0xd8aa('0x4f')][_0xd8aa('0x5b')]+'%'};return _0x2e44c0;})});}_0x446332=_[_0xd8aa('0x60')]({},_0x446332,_0x3f90a7[_0xd8aa('0x61')]);return _0x552396[_0xd8aa('0xce')](_0x446332);}})['then'](function(_0x111866){if(_0x111866){_0xf577f0=_0x111866[_0xd8aa('0x55')];if(!_0x3f90a7[_0xd8aa('0x4f')]['hasOwnProperty']('nolimit')){_0x446332[_0xd8aa('0x30')]=qs[_0xd8aa('0x30')](_0x3f90a7['query'][_0xd8aa('0x30')]);_0x446332['offset']=qs[_0xd8aa('0x2f')](_0x3f90a7['query']['offset']);}return _0x552396[_0xd8aa('0xce')](_0x446332);}})['then'](function(_0x4a60a0){if(_0x4a60a0){return _0x4a60a0?{'count':_0xf577f0,'rows':_0x4a60a0}:null;}})[_0xd8aa('0x20')](respondWithResult(_0x3e12a2,null))[_0xd8aa('0x2a')](handleError(_0x3e12a2,null));};exports[_0xd8aa('0xcf')]=function(_0x6e6601,_0x5ebc8c,_0x3a3175){var _0x145de7={'raw':!![],'where':{}};var _0x3cfa35={};var _0x274f6f={'count':0x0,'rows':[]};return db[_0xd8aa('0x47')][_0xd8aa('0x97')]({'where':{'id':_0x6e6601[_0xd8aa('0x64')]['id']}})[_0xd8aa('0x20')](handleEntityNotFound(_0x5ebc8c,null))[_0xd8aa('0x20')](function(_0x55530c){if(_0x55530c){_0x3cfa35[_0xd8aa('0x4c')]=_[_0xd8aa('0x50')](db[_0xd8aa('0xd0')][_0xd8aa('0x48')]);_0x3cfa35['query']=_[_0xd8aa('0x50')](_0x6e6601[_0xd8aa('0x4f')]);_0x3cfa35[_0xd8aa('0x51')]=_[_0xd8aa('0x52')](_0x3cfa35['model'],_0x3cfa35[_0xd8aa('0x4f')]);_0x145de7['attributes']=_[_0xd8aa('0x52')](_0x3cfa35['model'],qs[_0xd8aa('0x53')](_0x6e6601[_0xd8aa('0x4f')][_0xd8aa('0x53')]));_0x145de7[_0xd8aa('0x54')]=_0x145de7[_0xd8aa('0x54')][_0xd8aa('0x55')]?_0x145de7[_0xd8aa('0x54')]:_0x3cfa35[_0xd8aa('0x4c')];if(!_0x6e6601[_0xd8aa('0x4f')]['hasOwnProperty']('nolimit')){_0x145de7['limit']=qs[_0xd8aa('0x30')](_0x6e6601[_0xd8aa('0x4f')][_0xd8aa('0x30')]);_0x145de7[_0xd8aa('0x2f')]=qs[_0xd8aa('0x2f')](_0x6e6601[_0xd8aa('0x4f')][_0xd8aa('0x2f')]);}_0x145de7[_0xd8aa('0x57')]=qs[_0xd8aa('0x58')](_0x6e6601['query'][_0xd8aa('0x58')]);_0x145de7[_0xd8aa('0x59')]=qs[_0xd8aa('0x51')](_[_0xd8aa('0x5a')](_0x6e6601[_0xd8aa('0x4f')],_0x3cfa35[_0xd8aa('0x51')]));_0x145de7[_0xd8aa('0x59')][_0xd8aa('0xd1')]=_0x55530c['id'];if(_0x6e6601[_0xd8aa('0x4f')]['filter']){_0x145de7[_0xd8aa('0x59')]=_[_0xd8aa('0x60')](_0x145de7[_0xd8aa('0x59')],{'$or':_[_0xd8aa('0x46')](_0x145de7[_0xd8aa('0x54')],function(_0x157e49){var _0x52dfcc={};_0x52dfcc[_0x157e49]={'$like':'%'+_0x6e6601[_0xd8aa('0x4f')][_0xd8aa('0x5b')]+'%'};return _0x52dfcc;})});}_0x145de7=_[_0xd8aa('0x60')]({},_0x145de7,_0x6e6601[_0xd8aa('0x61')]);return db[_0xd8aa('0xd0')]['count']({'where':_0x145de7[_0xd8aa('0x59')]})[_0xd8aa('0x20')](function(_0x5368a8){_0x274f6f['count']=_0x5368a8;if(_0x6e6601[_0xd8aa('0x4f')][_0xd8aa('0x66')]){_0x145de7[_0xd8aa('0x67')]=[{'all':!![]}];}return db[_0xd8aa('0xd0')]['findAll'](_0x145de7);})['then'](function(_0x10530f){_0x274f6f[_0xd8aa('0xd2')]=_0x10530f;return _0x274f6f;});}})[_0xd8aa('0x20')](respondWithFilteredResult(_0x5ebc8c,_0x145de7))[_0xd8aa('0x2a')](handleError(_0x5ebc8c,null));};exports['getScreenRecordings']=function(_0x22488c,_0x36e08b,_0x4cafaa){var _0x2bf00={'raw':!![],'where':{}};var _0x5b8f99={};var _0x538332={'count':0x0,'rows':[]};return db['User'][_0xd8aa('0x97')]({'where':{'id':_0x22488c[_0xd8aa('0x64')]['id']}})[_0xd8aa('0x20')](handleEntityNotFound(_0x36e08b,null))[_0xd8aa('0x20')](function(_0x4eb238){if(_0x4eb238){_0x5b8f99['model']=_['keys'](db[_0xd8aa('0xd3')][_0xd8aa('0x48')]);_0x5b8f99[_0xd8aa('0x4f')]=_[_0xd8aa('0x50')](_0x22488c[_0xd8aa('0x4f')]);_0x5b8f99[_0xd8aa('0x51')]=_['intersection'](_0x5b8f99[_0xd8aa('0x4c')],_0x5b8f99[_0xd8aa('0x4f')]);_0x2bf00[_0xd8aa('0x54')]=_[_0xd8aa('0x52')](_0x5b8f99['model'],qs['fields'](_0x22488c[_0xd8aa('0x4f')][_0xd8aa('0x53')]));_0x2bf00[_0xd8aa('0x54')]=_0x2bf00[_0xd8aa('0x54')][_0xd8aa('0x55')]?_0x2bf00[_0xd8aa('0x54')]:_0x5b8f99[_0xd8aa('0x4c')];if(!_0x22488c[_0xd8aa('0x4f')][_0xd8aa('0xc4')]('nolimit')){_0x2bf00[_0xd8aa('0x30')]=qs['limit'](_0x22488c['query'][_0xd8aa('0x30')]);_0x2bf00[_0xd8aa('0x2f')]=qs[_0xd8aa('0x2f')](_0x22488c['query'][_0xd8aa('0x2f')]);}_0x2bf00[_0xd8aa('0x57')]=qs[_0xd8aa('0x58')](_0x22488c['query'][_0xd8aa('0x58')]);_0x2bf00['where']=qs['filters'](_[_0xd8aa('0x5a')](_0x22488c['query'],_0x5b8f99['filters']));_0x2bf00[_0xd8aa('0x59')][_0xd8aa('0xd1')]=_0x4eb238['id'];if(_0x22488c[_0xd8aa('0x4f')]['filter']){_0x2bf00['where']=_[_0xd8aa('0x60')](_0x2bf00['where'],{'$or':_[_0xd8aa('0x46')](_0x2bf00[_0xd8aa('0x54')],function(_0x1d620c){var _0x1cd8f1={};_0x1cd8f1[_0x1d620c]={'$like':'%'+_0x22488c[_0xd8aa('0x4f')]['filter']+'%'};return _0x1cd8f1;})});}_0x2bf00=_[_0xd8aa('0x60')]({},_0x2bf00,_0x22488c[_0xd8aa('0x61')]);return db[_0xd8aa('0xd3')][_0xd8aa('0x2e')]({'where':_0x2bf00['where']})[_0xd8aa('0x20')](function(_0x4ad432){_0x538332[_0xd8aa('0x2e')]=_0x4ad432;if(_0x22488c[_0xd8aa('0x4f')][_0xd8aa('0x66')]){_0x2bf00[_0xd8aa('0x67')]=[{'all':!![]}];}return db['ScreenRecording'][_0xd8aa('0x62')](_0x2bf00);})[_0xd8aa('0x20')](function(_0x253d35){_0x538332['rows']=_0x253d35;return _0x538332;});}})[_0xd8aa('0x20')](respondWithFilteredResult(_0x36e08b,_0x2bf00))[_0xd8aa('0x2a')](handleError(_0x36e08b,null));};exports['getChatInteractions']=function(_0x113be8,_0x55000b,_0x4181a0){var _0x284386={};var _0x1ed995={};var _0x51e40d;var _0x1980da;return db[_0xd8aa('0x47')][_0xd8aa('0x97')]({'where':{'id':_0x113be8[_0xd8aa('0x64')]['id']}})[_0xd8aa('0x20')](handleEntityNotFound(_0x55000b,null))[_0xd8aa('0x20')](function(_0x3ebd2b){if(_0x3ebd2b){_0x51e40d=_0x3ebd2b;_0x1ed995[_0xd8aa('0x4c')]=_[_0xd8aa('0x50')](db[_0xd8aa('0xd4')][_0xd8aa('0x48')]);_0x1ed995[_0xd8aa('0x4f')]=_['keys'](_0x113be8['query']);_0x1ed995[_0xd8aa('0x51')]=_['intersection'](_0x1ed995[_0xd8aa('0x4c')],_0x1ed995[_0xd8aa('0x4f')]);_0x284386[_0xd8aa('0x54')]=_[_0xd8aa('0x52')](_0x1ed995[_0xd8aa('0x4c')],qs['fields'](_0x113be8[_0xd8aa('0x4f')][_0xd8aa('0x53')]));_0x284386[_0xd8aa('0x54')]=_0x284386[_0xd8aa('0x54')][_0xd8aa('0x55')]?_0x284386['attributes']:_0x1ed995[_0xd8aa('0x4c')];_0x284386[_0xd8aa('0x57')]=qs[_0xd8aa('0x58')](_0x113be8[_0xd8aa('0x4f')][_0xd8aa('0x58')]);_0x284386[_0xd8aa('0x59')]=qs[_0xd8aa('0x51')](_[_0xd8aa('0x5a')](_0x113be8[_0xd8aa('0x4f')],_0x1ed995[_0xd8aa('0x51')]));if(_0x113be8[_0xd8aa('0x4f')]['filter']){_0x284386[_0xd8aa('0x59')]=_[_0xd8aa('0x60')](_0x284386[_0xd8aa('0x59')],{'$or':_[_0xd8aa('0x46')](_0x284386['attributes'],function(_0x3c2933){var _0xa79da5={};_0xa79da5[_0x3c2933]={'$like':'%'+_0x113be8[_0xd8aa('0x4f')][_0xd8aa('0x5b')]+'%'};return _0xa79da5;})});}_0x284386=_[_0xd8aa('0x60')]({},_0x284386,_0x113be8['options']);return _0x51e40d[_0xd8aa('0xd5')](_0x284386);}})[_0xd8aa('0x20')](function(_0x3bcbc8){if(_0x3bcbc8){_0x1980da=_0x3bcbc8['length'];if(!_0x113be8['query'][_0xd8aa('0xc4')]('nolimit')){_0x284386[_0xd8aa('0x30')]=qs[_0xd8aa('0x30')](_0x113be8[_0xd8aa('0x4f')][_0xd8aa('0x30')]);_0x284386[_0xd8aa('0x2f')]=qs[_0xd8aa('0x2f')](_0x113be8[_0xd8aa('0x4f')]['offset']);}return _0x51e40d['getChatInteractions'](_0x284386);}})[_0xd8aa('0x20')](function(_0x1b3e68){if(_0x1b3e68){return _0x1b3e68?{'count':_0x1980da,'rows':_0x1b3e68}:null;}})['then'](respondWithResult(_0x55000b,null))[_0xd8aa('0x2a')](handleError(_0x55000b,null));};exports[_0xd8aa('0xd6')]=function(_0x523707,_0x1ab2ff,_0x44e91e){var _0x20bd7f={};var _0x2d4017={};var _0x369eb0;var _0x2a056a;return db[_0xd8aa('0x47')][_0xd8aa('0x97')]({'where':{'id':_0x523707[_0xd8aa('0x64')]['id']}})[_0xd8aa('0x20')](handleEntityNotFound(_0x1ab2ff,null))[_0xd8aa('0x20')](function(_0x1e5d00){if(_0x1e5d00){_0x369eb0=_0x1e5d00;_0x2d4017[_0xd8aa('0x4c')]=_[_0xd8aa('0x50')](db['OpenchannelInteraction'][_0xd8aa('0x48')]);_0x2d4017[_0xd8aa('0x4f')]=_[_0xd8aa('0x50')](_0x523707['query']);_0x2d4017[_0xd8aa('0x51')]=_[_0xd8aa('0x52')](_0x2d4017[_0xd8aa('0x4c')],_0x2d4017[_0xd8aa('0x4f')]);_0x20bd7f['attributes']=_[_0xd8aa('0x52')](_0x2d4017['model'],qs[_0xd8aa('0x53')](_0x523707[_0xd8aa('0x4f')][_0xd8aa('0x53')]));_0x20bd7f[_0xd8aa('0x54')]=_0x20bd7f[_0xd8aa('0x54')]['length']?_0x20bd7f['attributes']:_0x2d4017['model'];_0x20bd7f[_0xd8aa('0x57')]=qs[_0xd8aa('0x58')](_0x523707[_0xd8aa('0x4f')][_0xd8aa('0x58')]);_0x20bd7f[_0xd8aa('0x59')]=qs[_0xd8aa('0x51')](_[_0xd8aa('0x5a')](_0x523707[_0xd8aa('0x4f')],_0x2d4017[_0xd8aa('0x51')]));if(_0x523707[_0xd8aa('0x4f')]['filter']){_0x20bd7f[_0xd8aa('0x59')]=_['merge'](_0x20bd7f[_0xd8aa('0x59')],{'$or':_[_0xd8aa('0x46')](_0x20bd7f[_0xd8aa('0x54')],function(_0x3d6bc1){var _0x2469e9={};_0x2469e9[_0x3d6bc1]={'$like':'%'+_0x523707[_0xd8aa('0x4f')][_0xd8aa('0x5b')]+'%'};return _0x2469e9;})});}_0x20bd7f=_[_0xd8aa('0x60')]({},_0x20bd7f,_0x523707[_0xd8aa('0x61')]);return _0x369eb0[_0xd8aa('0xd6')](_0x20bd7f);}})['then'](function(_0x285898){if(_0x285898){_0x2a056a=_0x285898[_0xd8aa('0x55')];if(!_0x523707[_0xd8aa('0x4f')][_0xd8aa('0xc4')](_0xd8aa('0x56'))){_0x20bd7f[_0xd8aa('0x30')]=qs['limit'](_0x523707[_0xd8aa('0x4f')][_0xd8aa('0x30')]);_0x20bd7f[_0xd8aa('0x2f')]=qs['offset'](_0x523707[_0xd8aa('0x4f')][_0xd8aa('0x2f')]);}return _0x369eb0['getOpenchannelInteractions'](_0x20bd7f);}})['then'](function(_0x14dbf0){if(_0x14dbf0){return _0x14dbf0?{'count':_0x2a056a,'rows':_0x14dbf0}:null;}})[_0xd8aa('0x20')](respondWithResult(_0x1ab2ff,null))[_0xd8aa('0x2a')](handleError(_0x1ab2ff,null));};exports[_0xd8aa('0xd7')]=function(_0x259e64,_0x5ab9bb,_0x332596){var _0x414260={'raw':!![],'where':{}};var _0x26a80e={};var _0x31ad22={'count':0x0,'rows':[]};return db['User'][_0xd8aa('0x97')]({'where':{'id':_0x259e64[_0xd8aa('0x64')]['id']}})[_0xd8aa('0x20')](handleEntityNotFound(_0x5ab9bb,null))['then'](function(_0x41d308){if(_0x41d308){_0x26a80e[_0xd8aa('0x4c')]=_[_0xd8aa('0x50')](db[_0xd8aa('0xd8')]['rawAttributes']);_0x26a80e[_0xd8aa('0x4f')]=_[_0xd8aa('0x50')](_0x259e64['query']);_0x26a80e['filters']=_['intersection'](_0x26a80e['model'],_0x26a80e[_0xd8aa('0x4f')]);_0x414260[_0xd8aa('0x54')]=_[_0xd8aa('0x52')](_0x26a80e['model'],qs[_0xd8aa('0x53')](_0x259e64[_0xd8aa('0x4f')][_0xd8aa('0x53')]));_0x414260[_0xd8aa('0x54')]=_0x414260['attributes'][_0xd8aa('0x55')]?_0x414260[_0xd8aa('0x54')]:_0x26a80e['model'];if(!_0x259e64[_0xd8aa('0x4f')]['hasOwnProperty'](_0xd8aa('0x56'))){_0x414260[_0xd8aa('0x30')]=qs['limit'](_0x259e64[_0xd8aa('0x4f')][_0xd8aa('0x30')]);_0x414260['offset']=qs[_0xd8aa('0x2f')](_0x259e64[_0xd8aa('0x4f')][_0xd8aa('0x2f')]);}_0x414260['order']=qs[_0xd8aa('0x58')](_0x259e64[_0xd8aa('0x4f')]['sort']);_0x414260['where']=qs[_0xd8aa('0x51')](_[_0xd8aa('0x5a')](_0x259e64[_0xd8aa('0x4f')],_0x26a80e['filters']));_0x414260['where'][_0xd8aa('0xd1')]=_0x41d308['id'];if(_0x259e64[_0xd8aa('0x4f')]['filter']){_0x414260[_0xd8aa('0x59')]=_['merge'](_0x414260[_0xd8aa('0x59')],{'$or':_[_0xd8aa('0x46')](_0x414260[_0xd8aa('0x54')],function(_0x484906){var _0x5a255c={};_0x5a255c[_0x484906]={'$like':'%'+_0x259e64['query'][_0xd8aa('0x5b')]+'%'};return _0x5a255c;})});}_0x414260=_['merge']({},_0x414260,_0x259e64[_0xd8aa('0x61')]);return db['MailInteraction'][_0xd8aa('0x2e')]({'where':_0x414260[_0xd8aa('0x59')]})['then'](function(_0x52bd87){_0x31ad22['count']=_0x52bd87;if(_0x259e64['query']['includeAll']){_0x414260[_0xd8aa('0x67')]=[{'all':!![]}];}return db[_0xd8aa('0xd8')][_0xd8aa('0x62')](_0x414260);})[_0xd8aa('0x20')](function(_0x479073){_0x31ad22['rows']=_0x479073;return _0x31ad22;});}})[_0xd8aa('0x20')](respondWithFilteredResult(_0x5ab9bb,_0x414260))['catch'](handleError(_0x5ab9bb,null));};exports['getSmsInteractions']=function(_0x59ee57,_0x1d07e7,_0x3936b2){var _0x1c9d6c={};var _0x35a065={};var _0x370bcf;var _0x509d2e;return db['User'][_0xd8aa('0x97')]({'where':{'id':_0x59ee57['params']['id']}})['then'](handleEntityNotFound(_0x1d07e7,null))[_0xd8aa('0x20')](function(_0xa70cbf){if(_0xa70cbf){_0x370bcf=_0xa70cbf;_0x35a065[_0xd8aa('0x4c')]=_[_0xd8aa('0x50')](db[_0xd8aa('0xd9')]['rawAttributes']);_0x35a065[_0xd8aa('0x4f')]=_[_0xd8aa('0x50')](_0x59ee57[_0xd8aa('0x4f')]);_0x35a065[_0xd8aa('0x51')]=_[_0xd8aa('0x52')](_0x35a065[_0xd8aa('0x4c')],_0x35a065[_0xd8aa('0x4f')]);_0x1c9d6c[_0xd8aa('0x54')]=_[_0xd8aa('0x52')](_0x35a065[_0xd8aa('0x4c')],qs['fields'](_0x59ee57[_0xd8aa('0x4f')]['fields']));_0x1c9d6c[_0xd8aa('0x54')]=_0x1c9d6c[_0xd8aa('0x54')][_0xd8aa('0x55')]?_0x1c9d6c[_0xd8aa('0x54')]:_0x35a065['model'];_0x1c9d6c['order']=qs['sort'](_0x59ee57[_0xd8aa('0x4f')][_0xd8aa('0x58')]);_0x1c9d6c[_0xd8aa('0x59')]=qs[_0xd8aa('0x51')](_[_0xd8aa('0x5a')](_0x59ee57[_0xd8aa('0x4f')],_0x35a065['filters']));if(_0x59ee57[_0xd8aa('0x4f')][_0xd8aa('0x5b')]){_0x1c9d6c[_0xd8aa('0x59')]=_[_0xd8aa('0x60')](_0x1c9d6c['where'],{'$or':_[_0xd8aa('0x46')](_0x1c9d6c['attributes'],function(_0x513775){var _0x4eb2de={};_0x4eb2de[_0x513775]={'$like':'%'+_0x59ee57[_0xd8aa('0x4f')]['filter']+'%'};return _0x4eb2de;})});}_0x1c9d6c=_['merge']({},_0x1c9d6c,_0x59ee57[_0xd8aa('0x61')]);return _0x370bcf[_0xd8aa('0xda')](_0x1c9d6c);}})['then'](function(_0x4c1c61){if(_0x4c1c61){_0x509d2e=_0x4c1c61[_0xd8aa('0x55')];if(!_0x59ee57[_0xd8aa('0x4f')][_0xd8aa('0xc4')](_0xd8aa('0x56'))){_0x1c9d6c[_0xd8aa('0x30')]=qs[_0xd8aa('0x30')](_0x59ee57[_0xd8aa('0x4f')][_0xd8aa('0x30')]);_0x1c9d6c[_0xd8aa('0x2f')]=qs[_0xd8aa('0x2f')](_0x59ee57[_0xd8aa('0x4f')][_0xd8aa('0x2f')]);}return _0x370bcf[_0xd8aa('0xda')](_0x1c9d6c);}})['then'](function(_0x21f667){if(_0x21f667){return _0x21f667?{'count':_0x509d2e,'rows':_0x21f667}:null;}})[_0xd8aa('0x20')](respondWithResult(_0x1d07e7,null))['catch'](handleError(_0x1d07e7,null));};exports[_0xd8aa('0xdb')]=function(_0x239f3b,_0xdc170c,_0x3c9f4c){var _0x29171d={};var _0x4fc646={};var _0x5a7bfa;var _0x70e01d;return db[_0xd8aa('0x47')][_0xd8aa('0x97')]({'where':{'id':_0x239f3b[_0xd8aa('0x64')]['id']}})['then'](handleEntityNotFound(_0xdc170c,null))[_0xd8aa('0x20')](function(_0x2b9715){if(_0x2b9715){_0x5a7bfa=_0x2b9715;_0x4fc646['model']=_[_0xd8aa('0x50')](db[_0xd8aa('0xdc')]['rawAttributes']);_0x4fc646[_0xd8aa('0x4f')]=_[_0xd8aa('0x50')](_0x239f3b[_0xd8aa('0x4f')]);_0x4fc646['filters']=_[_0xd8aa('0x52')](_0x4fc646['model'],_0x4fc646[_0xd8aa('0x4f')]);_0x29171d['attributes']=_[_0xd8aa('0x52')](_0x4fc646['model'],qs[_0xd8aa('0x53')](_0x239f3b[_0xd8aa('0x4f')][_0xd8aa('0x53')]));_0x29171d[_0xd8aa('0x54')]=_0x29171d[_0xd8aa('0x54')][_0xd8aa('0x55')]?_0x29171d[_0xd8aa('0x54')]:_0x4fc646[_0xd8aa('0x4c')];_0x29171d['order']=qs[_0xd8aa('0x58')](_0x239f3b[_0xd8aa('0x4f')][_0xd8aa('0x58')]);_0x29171d['where']=qs[_0xd8aa('0x51')](_['pick'](_0x239f3b[_0xd8aa('0x4f')],_0x4fc646[_0xd8aa('0x51')]));if(_0x239f3b[_0xd8aa('0x4f')]['filter']){_0x29171d['where']=_[_0xd8aa('0x60')](_0x29171d[_0xd8aa('0x59')],{'$or':_[_0xd8aa('0x46')](_0x29171d['attributes'],function(_0x26e454){var _0x56305e={};_0x56305e[_0x26e454]={'$like':'%'+_0x239f3b[_0xd8aa('0x4f')]['filter']+'%'};return _0x56305e;})});}_0x29171d=_[_0xd8aa('0x60')]({},_0x29171d,_0x239f3b[_0xd8aa('0x61')]);return _0x5a7bfa[_0xd8aa('0xdb')](_0x29171d);}})[_0xd8aa('0x20')](function(_0x524382){if(_0x524382){_0x70e01d=_0x524382[_0xd8aa('0x55')];if(!_0x239f3b[_0xd8aa('0x4f')][_0xd8aa('0xc4')]('nolimit')){_0x29171d['limit']=qs[_0xd8aa('0x30')](_0x239f3b[_0xd8aa('0x4f')][_0xd8aa('0x30')]);_0x29171d[_0xd8aa('0x2f')]=qs[_0xd8aa('0x2f')](_0x239f3b[_0xd8aa('0x4f')][_0xd8aa('0x2f')]);}return _0x5a7bfa[_0xd8aa('0xdb')](_0x29171d);}})[_0xd8aa('0x20')](function(_0x422bf9){if(_0x422bf9){return _0x422bf9?{'count':_0x70e01d,'rows':_0x422bf9}:null;}})['then'](respondWithResult(_0xdc170c,null))[_0xd8aa('0x2a')](handleError(_0xdc170c,null));};exports[_0xd8aa('0xdd')]=function(_0x1432dc,_0x1ee607,_0x5d4eea){var _0x15a111;var _0x22d676;var _0x23aec6;var _0x4feddd=!_[_0xd8aa('0x74')](_0x1432dc['params']['id'])?_0x1432dc[_0xd8aa('0x64')]['id']:!_[_0xd8aa('0x74')](_0x1432dc[_0xd8aa('0x3a')]['id'])?_0x1432dc[_0xd8aa('0x3a')]['id']:null;return db[_0xd8aa('0x47')][_0xd8aa('0x42')]({'where':{'id':_0x4feddd,'role':{'$or':[_0xd8aa('0x6f'),_0xd8aa('0x3a'),_0xd8aa('0x3c')]}},'attributes':['id',_0xd8aa('0x44'),'phone',_0xd8aa('0xde'),_0xd8aa('0x41'),_0xd8aa('0x79'),_0xd8aa('0xdf')]})['then'](function(_0x5ef740){if(_0x5ef740){if(_0x5ef740[_0xd8aa('0x41')]===_0xd8aa('0x3c')){_0x15a111=_0x5ef740;if(_0x1432dc[_0xd8aa('0x69')][_0xd8aa('0xb0')]){_0x23aec6=util[_0xd8aa('0x76')]('LOCAL/%s@from-sip/n',_0x15a111[_0x1432dc[_0xd8aa('0x69')]['interface']]);}else if(_0x1432dc['body'][_0xd8aa('0xe0')]){_0x23aec6=util['format'](_0xd8aa('0xb1'),_0x1432dc['body'][_0xd8aa('0xe0')]);}else{_0x23aec6=util[_0xd8aa('0x76')](_0xd8aa('0xb1'),_0x15a111[_0xd8aa('0x44')]);}socket['to'](util[_0xd8aa('0x76')]('user:%s',_0x15a111[_0xd8aa('0x44')]))[_0xd8aa('0xac')](_0xd8aa('0xe1'),{'ip':_0x1432dc['headers'][_0xd8aa('0xe2')]||_0x1432dc['connection']['remoteAddress']||_0x1432dc[_0xd8aa('0xe3')]['remoteAddress']||_0x1432dc['connection'][_0xd8aa('0xe3')][_0xd8aa('0xe4')]});return db[_0xd8aa('0xb2')]['destroy']({'where':{'membername':_0x15a111[_0xd8aa('0x44')]},'individualHooks':!![]});}}else{throw new db[(_0xd8aa('0x9a'))][(_0xd8aa('0x1d'))](_0xd8aa('0xe5'));}})[_0xd8aa('0x20')](function(){if(_0x15a111){return _0x15a111['getVoiceQueues']({'raw':!![]});}})[_0xd8aa('0x20')](function(_0x5499ac){if(_0x15a111){var _0x5bf5ac=[];if(_0x5499ac){_0x22d676=_0x5499ac;if(_0x22d676[_0xd8aa('0x55')]){for(var _0x186ad8=0x0;_0x186ad8<_0x22d676[_0xd8aa('0x55')];_0x186ad8++){_0x5bf5ac['push']({'membername':_0x15a111[_0xd8aa('0x44')],'UserId':_0x15a111['id'],'queue_name':_0x22d676[_0x186ad8][_0xd8aa('0x44')],'VoiceQueueId':_0x22d676[_0x186ad8]['id'],'interface':_0x23aec6,'paused':_0x15a111[_0xd8aa('0xdf')]||![],'penalty':_0x22d676[_0x186ad8][_0xd8aa('0xe6')]||0x0});}return BPromise[_0xd8aa('0xe7')](_0x5bf5ac,function(_0x48d44d){return db[_0xd8aa('0xb2')][_0xd8aa('0xb3')](_0x48d44d);});}}}})[_0xd8aa('0x20')](function(){if(_0x15a111){return db[_0xd8aa('0xe8')][_0xd8aa('0x62')]({'where':{'membername':_0x15a111[_0xd8aa('0x44')],'exitAt':null}});}})[_0xd8aa('0x20')](function(_0x5409dc){if(_0x15a111){var _0x6512d=[];_0x5409dc[_0xd8aa('0xe9')](function(_0x5834dd){_0x6512d[_0xd8aa('0xaf')](_0x5834dd['update']({'exitAt':moment()[_0xd8aa('0x76')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xd8aa('0xea')](_0x6512d);}})[_0xd8aa('0x20')](function(){if(_0x15a111){var _0x95b11f=[];var _0x589dd3=[];var _0x1af92d=utils['getChannels']();var _0x2049cc={'membername':_0x15a111[_0xd8aa('0x44')],'interface':_0x23aec6,'enterAt':moment()['format'](_0xd8aa('0xeb')),'role':_0x15a111[_0xd8aa('0x41')],'internal':_0x15a111[_0xd8aa('0x79')]};_0x1af92d['forEach'](function(_0x2e6eaf){_0x95b11f[_0xd8aa('0xaf')](_[_0xd8aa('0x60')]({'channel':_0x2e6eaf,'type':_0xd8aa('0xec'),'data1':_0x1432dc['body']['device'],'data2':_0x23aec6},_0x2049cc));if(_0x15a111['loginInPause']){_0x589dd3[_0xd8aa('0xaf')](_[_0xd8aa('0x60')]({'channel':_0x2e6eaf,'type':_0xd8aa('0xed'),'data1':_0xd8aa('0xee')},_0x2049cc));}});return db[_0xd8aa('0xe8')]['bulkCreate'](_0x95b11f[_0xd8aa('0xef')](_0x589dd3),{'individualHooks':!![]});}})[_0xd8aa('0x20')](function(){if(_0x15a111){return _0x15a111[_0xd8aa('0x36')]({'online':!![],'lastLoginAt':moment()[_0xd8aa('0x76')](_0xd8aa('0xeb')),'voicePause':_0x15a111['loginInPause']||![],'mailPause':_0x15a111[_0xd8aa('0xdf')]||![],'chatPause':_0x15a111['loginInPause']||![],'faxPause':_0x15a111['loginInPause']||![],'smsPause':_0x15a111[_0xd8aa('0xdf')]||![],'openchannelPause':_0x15a111['loginInPause']||![],'pauseType':_0x15a111[_0xd8aa('0xdf')]?_0xd8aa('0xee'):null,'interface':_0x23aec6,'lastPauseAt':moment()[_0xd8aa('0x76')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xd8aa('0x20')](function(_0x192189){if(_0x1432dc[_0xd8aa('0xf0')]){return _0x5d4eea();}else{return BPromise['resolve'](_0x192189)[_0xd8aa('0x20')](respondWithResult(_0x1ee607,null));}})[_0xd8aa('0x2a')](handleError(_0x1ee607,null));};exports[_0xd8aa('0xf1')]=function(_0x44f577,_0x6758a6,_0x1217be){var _0x4487ef;return db[_0xd8aa('0x47')][_0xd8aa('0x42')]({'where':{'id':_0x44f577[_0xd8aa('0x64')]['id'],'role':_0xd8aa('0x3c')},'attributes':['id',_0xd8aa('0x44'),_0xd8aa('0x41')]})[_0xd8aa('0x20')](handleEntityNotFound(_0x6758a6,null))[_0xd8aa('0x20')](function(_0x518246){if(_0x518246){_0x4487ef=_0x518246;return db[_0xd8aa('0xb2')][_0xd8aa('0x37')]({'where':{'membername':_0x4487ef[_0xd8aa('0x44')]},'individualHooks':!![]});}})[_0xd8aa('0x20')](function(){return db[_0xd8aa('0xe8')][_0xd8aa('0x62')]({'where':{'membername':_0x4487ef[_0xd8aa('0x44')],'exitAt':null}});})['then'](function(_0x526675){var _0x285640=[];_0x526675[_0xd8aa('0xe9')](function(_0x1fa4e8){_0x285640[_0xd8aa('0xaf')](_0x1fa4e8[_0xd8aa('0x36')]({'exitAt':moment()['format'](_0xd8aa('0xeb'))}));});return BPromise[_0xd8aa('0xea')](_0x285640);})[_0xd8aa('0x20')](function(){return _0x4487ef['update']({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})['then'](respondWithResult(_0x6758a6,null))[_0xd8aa('0x2a')](handleError(_0x6758a6,null));};exports[_0xd8aa('0xf2')]=function(_0x3d0db3,_0x41bcdd,_0x30f6ef){var _0x30f55e;return db[_0xd8aa('0xb2')][_0xd8aa('0x36')]({'paused':0x1},{'where':{'UserId':_0x3d0db3[_0xd8aa('0x64')]['id']},'individualHooks':!![]})['then'](function(){return db[_0xd8aa('0x47')]['find']({'where':{'id':_0x3d0db3[_0xd8aa('0x64')]['id'],'role':_0xd8aa('0x3c')},'attributes':['id',_0xd8aa('0x44'),_0xd8aa('0x41'),_0xd8aa('0x79'),_0xd8aa('0xb0')]});})['then'](handleEntityNotFound(_0x41bcdd,null))[_0xd8aa('0x20')](function(_0x30728a){if(_0x30728a){_0x30f55e=_0x30728a;return respondWithRpcPromise(_0xd8aa('0xf3'),_0xd8aa('0xf2'),{'id':_0x30f55e['id'],'name':_0x30f55e[_0xd8aa('0x44')],'pause':!![]});}})[_0xd8aa('0x20')](function(){if(_0x30f55e){return db[_0xd8aa('0xe8')]['findAll']({'where':{'membername':_0x30f55e[_0xd8aa('0x44')],'type':'PAUSE','exitAt':null}});}})[_0xd8aa('0x20')](function(_0x2f9582){if(_0x2f9582['length']){var _0x1fd867=moment()['format'](_0xd8aa('0xeb'));for(var _0x2cdd0f=0x0,_0x3fe963=_0x2f9582[_0xd8aa('0x55')];_0x2cdd0f<_0x3fe963;_0x2cdd0f++){_0x2f9582[_0x2cdd0f][_0xd8aa('0xf4')]({'exitAt':_0x1fd867});}}})[_0xd8aa('0x20')](function(){var _0x343174=[];var _0xc36175=utils['getChannels']();_0xc36175[_0xd8aa('0xe9')](function(_0xfb515d){_0x343174[_0xd8aa('0xaf')]({'channel':_0xfb515d,'membername':_0x30f55e['name'],'interface':_[_0xd8aa('0x74')](_0x30f55e[_0xd8aa('0xb0')])?util[_0xd8aa('0x76')](_0xd8aa('0xb1'),_0x30f55e[_0xd8aa('0x44')]):_0x30f55e[_0xd8aa('0xb0')],'type':'PAUSE','enterAt':moment()['format'](_0xd8aa('0xeb')),'data1':_0x3d0db3[_0xd8aa('0x69')][_0xd8aa('0x4a')]||_0xd8aa('0xf5'),'role':_0x30f55e[_0xd8aa('0x41')],'internal':_0x30f55e['internal']});});return db[_0xd8aa('0xe8')]['bulkCreate'](_0x343174,{'individualHooks':!![]});})[_0xd8aa('0x20')](function(){return _0x30f55e[_0xd8aa('0x36')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x3d0db3[_0xd8aa('0x69')][_0xd8aa('0x4a')]||_0xd8aa('0xf5'),'lastPauseAt':moment()[_0xd8aa('0x76')](_0xd8aa('0xeb'))});})[_0xd8aa('0x20')](respondWithResult(_0x41bcdd,null))[_0xd8aa('0x2a')](handleError(_0x41bcdd,null));};exports[_0xd8aa('0xf6')]=function(_0x38d444,_0x193bbc,_0x471647){var _0x211962;return db[_0xd8aa('0x47')]['find']({'where':{'id':_0x38d444[_0xd8aa('0x64')]['id']},'attributes':['id',_0xd8aa('0x44'),_0xd8aa('0x41'),_0xd8aa('0xa3'),_0xd8aa('0xf7'),_0xd8aa('0xf8'),_0xd8aa('0xf9'),_0xd8aa('0xfa'),_0xd8aa('0xfb'),_0xd8aa('0xfc'),'lastPauseAt']})[_0xd8aa('0x20')](handleEntityNotFound(_0x193bbc,null))[_0xd8aa('0x20')](function(_0x5e6e00){if(_0x5e6e00){_0x211962=_0x5e6e00;if(_0x38d444[_0xd8aa('0x69')]['channel']&&!utils[_0xd8aa('0xa4')](_0x38d444['body'][_0xd8aa('0xa1')])){throw new db['Sequelize'][(_0xd8aa('0x1d'))](_0xd8aa('0xa5'));}switch(_0x38d444['body'][_0xd8aa('0xa1')]){case _0xd8aa('0xad'):return respondWithRpcPromise(_0xd8aa('0xf3'),'unpause',{'id':_0x211962['id'],'name':_0x211962[_0xd8aa('0x44')],'pause':![]})['then'](function(){return db[_0xd8aa('0xb2')]['update']({'paused':0x0},{'where':{'UserId':_0x211962['id']},'individualHooks':!![]});})[_0xd8aa('0x20')](function(){return db[_0xd8aa('0xe8')][_0xd8aa('0x42')]({'where':{'channel':_0x38d444[_0xd8aa('0x69')]['channel'],'membername':_0x211962[_0xd8aa('0x44')],'type':_0xd8aa('0xed'),'exitAt':null}});})[_0xd8aa('0x20')](function(_0xda2256){if(_0xda2256){return _0xda2256[_0xd8aa('0x36')]({'exitAt':moment()[_0xd8aa('0x76')](_0xd8aa('0xeb')),'data2':_0xd8aa('0xfd')},{'individualHooks':!![]});}return null;})[_0xd8aa('0x20')](function(){return _0x211962[_0xd8aa('0x36')]({'voicePause':![]});});case'mail':case _0xd8aa('0xfe'):case _0xd8aa('0xff'):case'sms':case _0xd8aa('0x100'):return db['MemberReport']['find']({'where':{'channel':_0x38d444[_0xd8aa('0x69')][_0xd8aa('0xa1')],'membername':_0x211962[_0xd8aa('0x44')],'type':'PAUSE','exitAt':null}})['then'](function(_0x5d4e76){if(_0x5d4e76){return _0x5d4e76[_0xd8aa('0x36')]({'exitAt':moment()['format'](_0xd8aa('0xeb')),'data2':'manual'},{'individualHooks':!![]});}return null;})['then'](function(){var _0x34000f={};_['set'](_0x34000f,util[_0xd8aa('0x76')](_0xd8aa('0x101'),_0x38d444[_0xd8aa('0x69')][_0xd8aa('0xa1')],_0xd8aa('0x102')),![]);return _0x211962[_0xd8aa('0x36')](_0x34000f);});default:return respondWithRpcPromise(_0xd8aa('0xf3'),_0xd8aa('0xf6'),{'id':_0x211962['id'],'name':_0x211962[_0xd8aa('0x44')],'pause':![]})[_0xd8aa('0x20')](function(){return db[_0xd8aa('0xb2')][_0xd8aa('0x36')]({'paused':0x0},{'where':{'UserId':_0x211962['id']}});})[_0xd8aa('0x20')](function(){return db[_0xd8aa('0xe8')]['findAll']({'where':{'membername':_0x211962[_0xd8aa('0x44')],'type':_0xd8aa('0xed'),'exitAt':null}});})[_0xd8aa('0x20')](function(_0xa1bed9){var _0x329c85=[];_0xa1bed9['forEach'](function(_0x593d80){_0x329c85[_0xd8aa('0xaf')](_0x593d80[_0xd8aa('0x36')]({'exitAt':moment()[_0xd8aa('0x76')](_0xd8aa('0xeb')),'data2':_0xd8aa('0xfd')}));});return BPromise[_0xd8aa('0xea')](_0x329c85);})['then'](function(){return _0x211962['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xd8aa('0x20')](respondWithResult(_0x193bbc,null))[_0xd8aa('0x2a')](handleError(_0x193bbc,null));};exports[_0xd8aa('0x103')]=function(_0x230dd2,_0x39f56d,_0x158782){var _0x2b719={};var _0x189249={};var _0x4ef987;var _0x3573a7;return db[_0xd8aa('0x47')][_0xd8aa('0x97')]({'where':{'id':_0x230dd2['params']['id']}})[_0xd8aa('0x20')](handleEntityNotFound(_0x39f56d,null))[_0xd8aa('0x20')](function(_0x30bdd3){if(_0x30bdd3){_0x4ef987=_0x30bdd3;_0x189249[_0xd8aa('0x4c')]=_[_0xd8aa('0x50')](db['Team'][_0xd8aa('0x48')]);_0x189249[_0xd8aa('0x4f')]=_[_0xd8aa('0x50')](_0x230dd2[_0xd8aa('0x4f')]);_0x189249['filters']=_[_0xd8aa('0x52')](_0x189249[_0xd8aa('0x4c')],_0x189249[_0xd8aa('0x4f')]);_0x2b719[_0xd8aa('0x54')]=_['intersection'](_0x189249[_0xd8aa('0x4c')],qs[_0xd8aa('0x53')](_0x230dd2[_0xd8aa('0x4f')][_0xd8aa('0x53')]));_0x2b719[_0xd8aa('0x54')]=_0x2b719[_0xd8aa('0x54')][_0xd8aa('0x55')]?_0x2b719['attributes']:_0x189249['model'];_0x2b719['order']=qs[_0xd8aa('0x58')](_0x230dd2['query'][_0xd8aa('0x58')]);_0x2b719[_0xd8aa('0x59')]=qs[_0xd8aa('0x51')](_['pick'](_0x230dd2[_0xd8aa('0x4f')],_0x189249[_0xd8aa('0x51')]));if(_0x230dd2[_0xd8aa('0x4f')][_0xd8aa('0x5b')]){_0x2b719['where']=_[_0xd8aa('0x60')](_0x2b719[_0xd8aa('0x59')],{'$or':_[_0xd8aa('0x46')](_0x2b719[_0xd8aa('0x54')],function(_0x2cbc57){var _0x56a467={};_0x56a467[_0x2cbc57]={'$like':'%'+_0x230dd2['query'][_0xd8aa('0x5b')]+'%'};return _0x56a467;})});}_0x2b719=_[_0xd8aa('0x60')]({},_0x2b719,_0x230dd2[_0xd8aa('0x61')]);return _0x4ef987['getTeams'](_0x2b719);}})['then'](function(_0x154bb){if(_0x154bb){_0x3573a7=_0x154bb['length'];if(!_0x230dd2[_0xd8aa('0x4f')]['hasOwnProperty'](_0xd8aa('0x56'))){_0x2b719[_0xd8aa('0x30')]=qs[_0xd8aa('0x30')](_0x230dd2['query'][_0xd8aa('0x30')]);_0x2b719[_0xd8aa('0x2f')]=qs[_0xd8aa('0x2f')](_0x230dd2[_0xd8aa('0x4f')][_0xd8aa('0x2f')]);}return _0x4ef987[_0xd8aa('0x103')](_0x2b719);}})['then'](function(_0x1a9f54){if(_0x1a9f54){return _0x1a9f54?{'count':_0x3573a7,'rows':_0x1a9f54}:null;}})[_0xd8aa('0x20')](respondWithResult(_0x39f56d,null))[_0xd8aa('0x2a')](handleError(_0x39f56d,null));};exports[_0xd8aa('0x104')]=function(_0x293b1e,_0x594359){return db['User'][_0xd8aa('0x42')]({'where':{'id':_0x293b1e[_0xd8aa('0x64')]['id']}})[_0xd8aa('0x20')](handleEntityNotFound(_0x594359,null))[_0xd8aa('0x20')](function(_0x2b0089){if(_0x2b0089){var _0x107d25=_0x2b0089[_0xd8aa('0x38')]({'plain':!![]});return _0x2b0089['addTeams'](_0x293b1e['body'][_0xd8aa('0x6c')],_['omit'](_0x293b1e[_0xd8aa('0x69')],[_0xd8aa('0x6c'),'id'])||{})['then'](function(){for(var _0x54a12a=0x0;_0x54a12a<_0x293b1e['body'][_0xd8aa('0x6c')][_0xd8aa('0x55')];_0x54a12a++){var _0x47f3b0=[];db[_0xd8aa('0x105')][_0xd8aa('0x97')]({'where':{'id':_0x293b1e['body'][_0xd8aa('0x6c')][_0x54a12a]}})[_0xd8aa('0x20')](function(_0x18887d){_0x47f3b0[_0xd8aa('0xaf')](_0x18887d[_0xd8aa('0x106')]()['then'](function(_0x4feb2c){for(var _0x1fb310=0x0;_0x1fb310<_0x4feb2c[_0xd8aa('0x55')];_0x1fb310++){_0x4feb2c[_0x1fb310][_0xd8aa('0x107')](_0xd8aa('0xa1'),'Voice');}return _0x4feb2c;}));_0x47f3b0[_0xd8aa('0xaf')](_0x18887d[_0xd8aa('0x108')]()[_0xd8aa('0x20')](function(_0x3749f9){for(var _0x207722=0x0;_0x207722<_0x3749f9[_0xd8aa('0x55')];_0x207722++){_0x3749f9[_0x207722][_0xd8aa('0x107')](_0xd8aa('0xa1'),_0xd8aa('0x109'));}return _0x3749f9;}));_0x47f3b0['push'](_0x18887d['getMailQueues']()[_0xd8aa('0x20')](function(_0x36e8b9){for(var _0x48b352=0x0;_0x48b352<_0x36e8b9[_0xd8aa('0x55')];_0x48b352++){_0x36e8b9[_0x48b352][_0xd8aa('0x107')]('channel','Mail');}return _0x36e8b9;}));_0x47f3b0['push'](_0x18887d[_0xd8aa('0x10a')]()[_0xd8aa('0x20')](function(_0x5d3c0d){for(var _0x2d64f2=0x0;_0x2d64f2<_0x5d3c0d['length'];_0x2d64f2++){_0x5d3c0d[_0x2d64f2]['setDataValue'](_0xd8aa('0xa1'),_0xd8aa('0x10b'));}return _0x5d3c0d;}));_0x47f3b0['push'](_0x18887d[_0xd8aa('0x10c')]()[_0xd8aa('0x20')](function(_0xda47e8){for(var _0xfaddae=0x0;_0xfaddae<_0xda47e8['length'];_0xfaddae++){_0xda47e8[_0xfaddae][_0xd8aa('0x107')]('channel','Fax');}return _0xda47e8;}));_0x47f3b0[_0xd8aa('0xaf')](_0x18887d['getOpenchannelQueues']()[_0xd8aa('0x20')](function(_0x4cb664){for(var _0x1a7079=0x0;_0x1a7079<_0x4cb664[_0xd8aa('0x55')];_0x1a7079++){_0x4cb664[_0x1a7079]['setDataValue'](_0xd8aa('0xa1'),'Openchannel');}return _0x4cb664;}));return BPromise[_0xd8aa('0xea')](_0x47f3b0);})['then'](function(_0xee9af7){var _0x105026=_[_0xd8aa('0x10d')](_0xee9af7);_0x47f3b0=[];return db['sequelize'][_0xd8aa('0x10e')](function(_0xd49cb8){for(var _0x5bbce9=0x0;_0x5bbce9<_0x105026['length'];_0x5bbce9++){_0x47f3b0[_0xd8aa('0xaf')](_0x105026[_0x5bbce9][_0xd8aa('0x10f')](_0x107d25['id']),{'transaction':_0xd49cb8});}return BPromise['all'](_0x47f3b0)[_0xd8aa('0x20')](function(){if(_0x107d25[_0xd8aa('0xa2')]){return BPromise[_0xd8aa('0xe7')](_[_0xd8aa('0x5b')](_0x105026,function(_0x5e4359){return _0x5e4359[_0xd8aa('0x110')](_0xd8aa('0xa1'))===_0xd8aa('0x111');}),function(_0x10c583){return db['UserVoiceQueueRt']['upsert']({'membername':_0x107d25[_0xd8aa('0x44')],'UserId':_0x107d25['id'],'queue_name':_0x10c583[_0xd8aa('0x44')],'VoiceQueueId':_0x10c583['id'],'interface':_[_0xd8aa('0x74')](_0x107d25[_0xd8aa('0xb0')])?util[_0xd8aa('0x76')](_0xd8aa('0xb1'),_0x107d25[_0xd8aa('0x44')]):_0x107d25[_0xd8aa('0xb0')],'paused':_0x107d25[_0xd8aa('0xa3')]||![],'penalty':_0x107d25[_0xd8aa('0xa9')]},{'transaction':_0xd49cb8});});}else{return;}})[_0xd8aa('0x20')](function(){for(var _0x37d2fc=0x0;_0x37d2fc<_0x105026['length'];_0x37d2fc++){var _0x1a45e1=_0x105026[_0x37d2fc]['getDataValue']('channel');var _0x274e79=_0x1a45e1+_0xd8aa('0xab');socket[_0xd8aa('0xac')](_0xd8aa('0x3a')+_0x1a45e1+_0xd8aa('0x112'),{'UserId':_0x107d25['id'],['queueField']:_0x105026[_0x37d2fc]['id']});}});});});}});}})[_0xd8aa('0x20')](respondWithStatusCode(_0x594359,null))['catch'](handleError(_0x594359,null));};exports['removeTeams']=function(_0x27d500,_0x1c52db){return db[_0xd8aa('0x47')][_0xd8aa('0x97')]({'where':{'id':_0x27d500[_0xd8aa('0x64')]['id']}})[_0xd8aa('0x20')](handleEntityNotFound(_0x1c52db,null))[_0xd8aa('0x20')](function(_0x564a6a){if(_0x564a6a){var _0x247f7f=_0x564a6a[_0xd8aa('0x38')]({'plain':!![]});var _0x3f30fa=_0x27d500[_0xd8aa('0x4f')]['ids'];return _0x564a6a[_0xd8aa('0x113')](_0x3f30fa)[_0xd8aa('0x20')](function(){for(var _0x1c9f34=0x0;_0x1c9f34<_0x3f30fa[_0xd8aa('0x55')];_0x1c9f34++){var _0x2ab22e=[];db[_0xd8aa('0x105')]['findOne']({'where':{'id':_0x3f30fa[_0x1c9f34]}})[_0xd8aa('0x20')](function(_0x5c5162){_0x2ab22e['push'](_0x5c5162[_0xd8aa('0x106')]()[_0xd8aa('0x20')](function(_0x85be9f){for(var _0x56073b=0x0;_0x56073b<_0x85be9f[_0xd8aa('0x55')];_0x56073b++){_0x85be9f[_0x56073b][_0xd8aa('0x107')](_0xd8aa('0xa1'),'Voice');}return _0x85be9f;}));_0x2ab22e['push'](_0x5c5162[_0xd8aa('0x108')]()[_0xd8aa('0x20')](function(_0x557ca6){for(var _0x3ceaaa=0x0;_0x3ceaaa<_0x557ca6[_0xd8aa('0x55')];_0x3ceaaa++){_0x557ca6[_0x3ceaaa][_0xd8aa('0x107')](_0xd8aa('0xa1'),'Chat');}return _0x557ca6;}));_0x2ab22e[_0xd8aa('0xaf')](_0x5c5162[_0xd8aa('0x114')]()[_0xd8aa('0x20')](function(_0x5a0c22){for(var _0x251003=0x0;_0x251003<_0x5a0c22[_0xd8aa('0x55')];_0x251003++){_0x5a0c22[_0x251003][_0xd8aa('0x107')](_0xd8aa('0xa1'),_0xd8aa('0x115'));}return _0x5a0c22;}));_0x2ab22e[_0xd8aa('0xaf')](_0x5c5162[_0xd8aa('0x10a')]()[_0xd8aa('0x20')](function(_0x48ed0f){for(var _0x44020c=0x0;_0x44020c<_0x48ed0f[_0xd8aa('0x55')];_0x44020c++){_0x48ed0f[_0x44020c]['setDataValue'](_0xd8aa('0xa1'),_0xd8aa('0x10b'));}return _0x48ed0f;}));_0x2ab22e[_0xd8aa('0xaf')](_0x5c5162[_0xd8aa('0x10c')]()[_0xd8aa('0x20')](function(_0x20c0bb){for(var _0x242dd5=0x0;_0x242dd5<_0x20c0bb['length'];_0x242dd5++){_0x20c0bb[_0x242dd5][_0xd8aa('0x107')](_0xd8aa('0xa1'),_0xd8aa('0x116'));}return _0x20c0bb;}));_0x2ab22e[_0xd8aa('0xaf')](_0x5c5162[_0xd8aa('0x117')]()['then'](function(_0xef932e){for(var _0x532c81=0x0;_0x532c81<_0xef932e[_0xd8aa('0x55')];_0x532c81++){_0xef932e[_0x532c81]['setDataValue'](_0xd8aa('0xa1'),_0xd8aa('0x118'));}return _0xef932e;}));return BPromise[_0xd8aa('0xea')](_0x2ab22e);})[_0xd8aa('0x20')](function(_0x30b4a4){var _0x502286=_[_0xd8aa('0x10d')](_0x30b4a4);_0x2ab22e=[];return db[_0xd8aa('0x5d')][_0xd8aa('0x10e')](function(_0x4b9430){for(var _0x3ed7fe=0x0;_0x3ed7fe<_0x502286[_0xd8aa('0x55')];_0x3ed7fe++){_0x2ab22e[_0xd8aa('0xaf')](_0x502286[_0x3ed7fe][_0xd8aa('0x119')](_0x247f7f['id']),{'transaction':_0x4b9430});}return BPromise['all'](_0x2ab22e)['then'](function(){if(_0x247f7f[_0xd8aa('0xa2')]){return BPromise[_0xd8aa('0xe7')](_[_0xd8aa('0x5b')](_0x502286,function(_0x3c24a7){return _0x3c24a7[_0xd8aa('0x110')](_0xd8aa('0xa1'))===_0xd8aa('0x111');}),function(_0x1187b7){return db['UserVoiceQueueRt'][_0xd8aa('0x37')]({'where':{'VoiceQueueId':_0x1187b7['id'],'UserId':_0x247f7f['id']},'transaction':_0x4b9430});});}else{return;}})['then'](function(){for(var _0x229446=0x0;_0x229446<_0x502286[_0xd8aa('0x55')];_0x229446++){var _0x1787c9=_0x502286[_0x229446]['getDataValue'](_0xd8aa('0xa1'));var _0x7661e=_0x1787c9+_0xd8aa('0xab');socket['emit'](_0xd8aa('0x3a')+_0x1787c9+'Queue:remove',{'UserId':_0x247f7f['id'],['queueField']:_0x502286[_0x229446]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x1c52db,null))[_0xd8aa('0x2a')](handleError(_0x1c52db,null));};exports[_0xd8aa('0x11a')]=function(_0x11f7cf,_0x4bfc93,_0x50e147){var _0x2926c1={};var _0x18a70f={};var _0x3acc07;var _0x47e329;return db[_0xd8aa('0x47')][_0xd8aa('0x97')]({'where':{'id':_0x11f7cf[_0xd8aa('0x64')]['id']}})[_0xd8aa('0x20')](handleEntityNotFound(_0x4bfc93,null))[_0xd8aa('0x20')](function(_0x53f1be){if(_0x53f1be){_0x3acc07=_0x53f1be;_0x18a70f[_0xd8aa('0x4c')]=_[_0xd8aa('0x50')](db[_0xd8aa('0xc5')][_0xd8aa('0x48')]);_0x18a70f[_0xd8aa('0x4f')]=_[_0xd8aa('0x50')](_0x11f7cf[_0xd8aa('0x4f')]);_0x18a70f[_0xd8aa('0x51')]=_[_0xd8aa('0x52')](_0x18a70f[_0xd8aa('0x4c')],_0x18a70f[_0xd8aa('0x4f')]);_0x2926c1[_0xd8aa('0x54')]=_[_0xd8aa('0x52')](_0x18a70f[_0xd8aa('0x4c')],qs[_0xd8aa('0x53')](_0x11f7cf[_0xd8aa('0x4f')][_0xd8aa('0x53')]));_0x2926c1[_0xd8aa('0x54')]=_0x2926c1[_0xd8aa('0x54')]['length']?_0x2926c1[_0xd8aa('0x54')]:_0x18a70f[_0xd8aa('0x4c')];_0x2926c1[_0xd8aa('0x57')]=qs[_0xd8aa('0x58')](_0x11f7cf[_0xd8aa('0x4f')][_0xd8aa('0x58')]);_0x2926c1[_0xd8aa('0x59')]=qs[_0xd8aa('0x51')](_[_0xd8aa('0x5a')](_0x11f7cf[_0xd8aa('0x4f')],_0x18a70f[_0xd8aa('0x51')]));if(_0x11f7cf['query'][_0xd8aa('0x5b')]){_0x2926c1['where']=_[_0xd8aa('0x60')](_0x2926c1[_0xd8aa('0x59')],{'$or':_[_0xd8aa('0x46')](_0x2926c1[_0xd8aa('0x54')],function(_0x24e77c){var _0x5c5032={};_0x5c5032[_0x24e77c]={'$like':'%'+_0x11f7cf['query'][_0xd8aa('0x5b')]+'%'};return _0x5c5032;})});}_0x2926c1=_[_0xd8aa('0x60')]({},_0x2926c1,_0x11f7cf[_0xd8aa('0x61')]);return _0x3acc07[_0xd8aa('0x11a')](_0x2926c1);}})['then'](function(_0x194860){if(_0x194860){_0x47e329=_0x194860[_0xd8aa('0x55')];if(!_0x11f7cf[_0xd8aa('0x4f')][_0xd8aa('0xc4')](_0xd8aa('0x56'))){_0x2926c1[_0xd8aa('0x30')]=qs[_0xd8aa('0x30')](_0x11f7cf[_0xd8aa('0x4f')]['limit']);_0x2926c1[_0xd8aa('0x2f')]=qs[_0xd8aa('0x2f')](_0x11f7cf[_0xd8aa('0x4f')][_0xd8aa('0x2f')]);}return _0x3acc07[_0xd8aa('0x11a')](_0x2926c1);}})[_0xd8aa('0x20')](function(_0x15ecb6){if(_0x15ecb6){return _0x15ecb6?{'count':_0x47e329,'rows':_0x15ecb6}:null;}})[_0xd8aa('0x20')](respondWithResult(_0x4bfc93,null))['catch'](handleError(_0x4bfc93,null));};exports[_0xd8aa('0x11b')]=function(_0x4488b0,_0x32d977,_0x2550ff){var _0x3a9798={};var _0x25e100={};var _0x53d351;var _0xd96191;return db[_0xd8aa('0x47')][_0xd8aa('0x97')]({'where':{'id':_0x4488b0[_0xd8aa('0x64')]['id']}})[_0xd8aa('0x20')](handleEntityNotFound(_0x32d977,null))[_0xd8aa('0x20')](function(_0x36e2d6){if(_0x36e2d6){_0x53d351=_0x36e2d6;_0x25e100['model']=_[_0xd8aa('0x50')](db['User']['rawAttributes']);_0x25e100[_0xd8aa('0x4f')]=_[_0xd8aa('0x50')](_0x4488b0[_0xd8aa('0x4f')]);_0x25e100['filters']=_[_0xd8aa('0x52')](_0x25e100[_0xd8aa('0x4c')],_0x25e100[_0xd8aa('0x4f')]);_0x3a9798[_0xd8aa('0x54')]=_[_0xd8aa('0x52')](_0x25e100[_0xd8aa('0x4c')],qs[_0xd8aa('0x53')](_0x4488b0['query'][_0xd8aa('0x53')]));_0x3a9798[_0xd8aa('0x54')]=_0x3a9798[_0xd8aa('0x54')][_0xd8aa('0x55')]?_0x3a9798[_0xd8aa('0x54')]:_0x25e100[_0xd8aa('0x4c')];_0x3a9798[_0xd8aa('0x57')]=qs[_0xd8aa('0x58')](_0x4488b0[_0xd8aa('0x4f')][_0xd8aa('0x58')]);_0x3a9798[_0xd8aa('0x59')]=qs[_0xd8aa('0x51')](_[_0xd8aa('0x5a')](_0x4488b0['query'],_0x25e100['filters']));if(_0x4488b0[_0xd8aa('0x4f')]['filter']){_0x3a9798[_0xd8aa('0x59')]=_[_0xd8aa('0x60')](_0x3a9798['where'],{'$or':_[_0xd8aa('0x46')](_0x3a9798[_0xd8aa('0x54')],function(_0x42f3ea){var _0x11da02={};_0x11da02[_0x42f3ea]={'$like':'%'+_0x4488b0[_0xd8aa('0x4f')][_0xd8aa('0x5b')]+'%'};return _0x11da02;})});}_0x3a9798[_0xd8aa('0x4c')]=db[_0xd8aa('0x47')];_0x3a9798['as']=_0xd8aa('0x3b');_0x3a9798=_['merge']({},_0x3a9798,_0x4488b0['options']);return _0x53d351['getVoiceQueues']({'include':[_0x3a9798]});}})[_0xd8aa('0x20')](function(_0x215980){if(_0x215980){var _0x6a6a09={},_0x5d3641=[],_0x16408d=0x0;for(var _0x42259e=0x0;_0x42259e<_0x215980[_0xd8aa('0x55')];_0x42259e+=0x1){for(var _0x37e1d2=0x0,_0x35e538;_0x37e1d2<_0x215980[_0x42259e][_0xd8aa('0x3b')]['length'];_0x37e1d2+=0x1){_0x35e538=_0x215980[_0x42259e][_0xd8aa('0x3b')][_0x37e1d2][_0xd8aa('0x38')]({'plain':!![]});_0x6a6a09[_0x35e538['id']]=_0x35e538;}}_0x6a6a09=_[_0xd8aa('0x11c')](_0x6a6a09);for(var _0x31eca9=qs[_0xd8aa('0x2f')](_0x4488b0[_0xd8aa('0x4f')][_0xd8aa('0x2f')]);_0x31eca9<_0x6a6a09['length']&&_0x5d3641[_0xd8aa('0x55')]=_0x23fe9a[_0x7433('0x54')]){throw new Error(_0x7433('0x55'));}})[_0x7433('0x2a')](function(){if(_0x522000){return db[_0x7433('0x2e')][_0x7433('0x4f')]({'where':{'membername':_0x522000[_0x7433('0x2c')]},'individualHooks':!![]});}})[_0x7433('0x2a')](function(){if(_0x522000){return _0x522000['getVoiceQueues']({'raw':!![]});}})[_0x7433('0x2a')](function(_0x335fa0){if(_0x522000){if(_0x335fa0){var _0x302ad2=[];_0x56a6c1=_0x335fa0;if(_0x56a6c1[_0x7433('0x32')]){for(var _0x22b9cf=0x0;_0x22b9cf<_0x56a6c1[_0x7433('0x32')];_0x22b9cf++){_0x302ad2[_0x7433('0x36')](db[_0x7433('0x2e')][_0x7433('0x56')]({'membername':_0x522000[_0x7433('0x2c')],'UserId':_0x522000['id'],'queue_name':_0x56a6c1[_0x22b9cf][_0x7433('0x2c')],'VoiceQueueId':_0x56a6c1[_0x22b9cf]['id'],'interface':_0x50af54,'paused':_0x522000[_0x7433('0x57')]||![],'penalty':_0x56a6c1[_0x22b9cf][_0x7433('0x58')]||0x0}));}return BPromise[_0x7433('0x4d')](_0x302ad2);}}}})['then'](function(){if(_0x522000){return db[_0x7433('0x3f')][_0x7433('0x1f')]({'where':{'membername':_0x522000[_0x7433('0x2c')],'exitAt':null}});}})['then'](function(_0x1a3e50){if(_0x522000){if(_0x1a3e50&&_0x1a3e50['length']){var _0x2b8bbc=[];_0x1a3e50[_0x7433('0x35')](function(_0x8a77c){_0x2b8bbc['push'](_0x8a77c[_0x7433('0x2f')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x7433('0x4d')](_0x2b8bbc);}}})[_0x7433('0x2a')](function(_0x53f847){if(_0x522000){var _0x3acae7=[];var _0xe11a72=[];var _0x571bff=utils[_0x7433('0x34')]();var _0x3f2a95={'membername':_0x522000[_0x7433('0x2c')],'interface':_0x50af54,'enterAt':moment()[_0x7433('0x39')](_0x7433('0x31')),'role':_0x522000[_0x7433('0x3d')],'internal':_0x522000[_0x7433('0x2d')]};_0x571bff['forEach'](function(_0x59c7e6){_0x3acae7[_0x7433('0x36')](_[_0x7433('0x59')]({'channel':_0x59c7e6,'type':'LOGIN','data1':_0x7433('0x5a'),'data2':_0x50af54},_0x3f2a95));if(_0x522000[_0x7433('0x57')]){_0xe11a72[_0x7433('0x36')](_[_0x7433('0x59')]({'channel':_0x59c7e6,'type':_0x7433('0x30'),'data1':_0x7433('0x5b')},_0x3f2a95));}});return db[_0x7433('0x3f')][_0x7433('0x40')](_0x3acae7[_0x7433('0x5c')](_0xe11a72),{'individualHooks':!![]});}})[_0x7433('0x2a')](function(){if(_0x522000){return _0x522000[_0x7433('0x2f')]({'online':!![],'lastLoginAt':moment()['format'](_0x7433('0x31')),'voicePause':_0x522000[_0x7433('0x57')]||![],'mailPause':_0x522000[_0x7433('0x57')]||![],'chatPause':_0x522000[_0x7433('0x57')]||![],'faxPause':_0x522000['loginInPause']||![],'smsPause':_0x522000[_0x7433('0x57')]||![],'openchannelPause':_0x522000[_0x7433('0x57')]||![],'pauseType':_0x522000[_0x7433('0x57')]?_0x7433('0x5b'):null,'lastPauseAt':moment()['format'](_0x7433('0x31')),'interface':_0x50af54});}})[_0x7433('0x2a')](function(_0x39d228){_0x4156cf(_0x39d228);})[_0x7433('0x1c')](function(_0x3e3d56){_0x9653e3(_0x304fab['error'](0x1f4,_0x3e3d56[_0x7433('0x19')]));});});}; \ No newline at end of file +var _0xe13d=['LoginUser','mobile','phone','loginInPause','count','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./user.socket','request','then','info','request\x20sent','debug','stringify','error','code','User,\x20%s,\x20%s','message','result','GetUser','User','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowUser','find','PauseUser','name','role','internal','UserVoiceQueueRt','MemberReport','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','getChannels','forEach','push','isNil','interface','SIP/%s','PAUSE','body','type','uniqueid','bulkCreate','update','DEFAULT\x20PAUSE','UnpauseUser','findOne','channel','isValidChannel','voice','system','mail','chat','fax','sms','openchannel','set','%s%s','Pause','destroy','all'];(function(_0x36656e,_0x3a2f35){var _0x4fb2eb=function(_0x10d8ad){while(--_0x10d8ad){_0x36656e['push'](_0x36656e['shift']());}};_0x4fb2eb(++_0x3a2f35);}(_0xe13d,0x1f1));var _0xde13=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xe13d[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0xde13('0x0'));var util=require('util');var moment=require(_0xde13('0x1'));var BPromise=require('bluebird');var rs=require(_0xde13('0x2'));var fs=require('fs');var Redis=require(_0xde13('0x3'));var db=require(_0xde13('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xde13('0x5'))(_0xde13('0x6'));var config=require(_0xde13('0x7'));var jayson=require(_0xde13('0x8'));var client=jayson[_0xde13('0x9')][_0xde13('0xa')]({'port':0x232a});config[_0xde13('0xb')]=_[_0xde13('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xde13('0xd'))(new Redis(config[_0xde13('0xb')]));require(_0xde13('0xe'))['register'](socket);function respondWithRpcPromise(_0x47969a,_0x3a8f64,_0x187c83){return new BPromise(function(_0x1fe466,_0xbdb81d){return client[_0xde13('0xf')](_0x47969a,_0x187c83)[_0xde13('0x10')](function(_0x98cebc){logger[_0xde13('0x11')]('User,\x20%s,\x20%s',_0x3a8f64,_0xde13('0x12'));logger[_0xde13('0x13')]('User,\x20%s,\x20%s,\x20%s',_0x3a8f64,_0xde13('0x12'),JSON[_0xde13('0x14')](_0x98cebc));if(_0x98cebc[_0xde13('0x15')]){if(_0x98cebc['error'][_0xde13('0x16')]===0x1f4){logger[_0xde13('0x15')](_0xde13('0x17'),_0x3a8f64,_0x98cebc[_0xde13('0x15')][_0xde13('0x18')]);return _0xbdb81d(_0x98cebc[_0xde13('0x15')][_0xde13('0x18')]);}logger['error'](_0xde13('0x17'),_0x3a8f64,_0x98cebc[_0xde13('0x15')][_0xde13('0x18')]);return _0x1fe466(_0x98cebc[_0xde13('0x15')][_0xde13('0x18')]);}else{logger['info'](_0xde13('0x17'),_0x3a8f64,_0xde13('0x12'));_0x1fe466(_0x98cebc[_0xde13('0x19')]['message']);}})['catch'](function(_0x2422e8){logger[_0xde13('0x15')](_0xde13('0x17'),_0x3a8f64,_0x2422e8);_0xbdb81d(_0x2422e8);});});}exports[_0xde13('0x1a')]=function(_0x2999ef){var _0x4abbef=this;return new Promise(function(_0x4dd30a,_0x82ab48){return db[_0xde13('0x1b')][_0xde13('0x1c')]({'raw':_0x2999ef[_0xde13('0x1d')]?_0x2999ef[_0xde13('0x1d')][_0xde13('0x1e')]===undefined?!![]:![]:!![],'where':_0x2999ef[_0xde13('0x1d')]?_0x2999ef['options'][_0xde13('0x1f')]||null:null,'attributes':_0x2999ef[_0xde13('0x1d')]?_0x2999ef[_0xde13('0x1d')][_0xde13('0x20')]||null:null,'limit':_0x2999ef['options']?_0x2999ef[_0xde13('0x1d')][_0xde13('0x21')]||null:null,'include':_0x2999ef[_0xde13('0x1d')]?_0x2999ef['options'][_0xde13('0x22')]?_[_0xde13('0x23')](_0x2999ef[_0xde13('0x1d')][_0xde13('0x22')],function(_0x3583d8){return{'model':db[_0x3583d8['model']],'as':_0x3583d8['as'],'attributes':_0x3583d8[_0xde13('0x20')],'include':_0x3583d8['include']?_[_0xde13('0x23')](_0x3583d8[_0xde13('0x22')],function(_0x3f4691){return{'model':db[_0x3f4691[_0xde13('0x24')]],'as':_0x3f4691['as'],'attributes':_0x3f4691[_0xde13('0x20')],'include':_0x3f4691['include']?_['map'](_0x3f4691[_0xde13('0x22')],function(_0x19b65f){return{'model':db[_0x19b65f['model']],'as':_0x19b65f['as'],'attributes':_0x19b65f[_0xde13('0x20')]};}):[]};}):[]};}):[]:[]})[_0xde13('0x10')](function(_0x41a0ae){logger[_0xde13('0x11')](_0xde13('0x1a'),_0x2999ef);logger[_0xde13('0x13')]('GetUser',_0x2999ef,JSON[_0xde13('0x14')](_0x41a0ae));_0x4dd30a(_0x41a0ae);})[_0xde13('0x25')](function(_0x72361){logger[_0xde13('0x15')](_0xde13('0x1a'),_0x72361[_0xde13('0x18')],_0x2999ef);_0x82ab48(_0x4abbef[_0xde13('0x15')](0x1f4,_0x72361['message']));});});};exports[_0xde13('0x26')]=function(_0x4b76d5){var _0x9a593f=this;return new Promise(function(_0x336543,_0x4df626){return db[_0xde13('0x1b')][_0xde13('0x27')]({'raw':_0x4b76d5['options']?_0x4b76d5[_0xde13('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x4b76d5[_0xde13('0x1d')]?_0x4b76d5[_0xde13('0x1d')][_0xde13('0x1f')]||null:null,'attributes':_0x4b76d5[_0xde13('0x1d')]?_0x4b76d5['options'][_0xde13('0x20')]||null:null,'include':_0x4b76d5[_0xde13('0x1d')]?_0x4b76d5[_0xde13('0x1d')]['include']?_[_0xde13('0x23')](_0x4b76d5[_0xde13('0x1d')][_0xde13('0x22')],function(_0x30a118){return{'model':db[_0x30a118[_0xde13('0x24')]],'as':_0x30a118['as'],'attributes':_0x30a118['attributes'],'include':_0x30a118[_0xde13('0x22')]?_[_0xde13('0x23')](_0x30a118[_0xde13('0x22')],function(_0x5cf3eb){return{'model':db[_0x5cf3eb[_0xde13('0x24')]],'as':_0x5cf3eb['as'],'attributes':_0x5cf3eb[_0xde13('0x20')],'include':_0x5cf3eb[_0xde13('0x22')]?_['map'](_0x5cf3eb[_0xde13('0x22')],function(_0xfbec){return{'model':db[_0xfbec[_0xde13('0x24')]],'as':_0xfbec['as'],'attributes':_0xfbec[_0xde13('0x20')]};}):[]};}):[]};}):[]:[]})[_0xde13('0x10')](function(_0x149997){logger[_0xde13('0x11')](_0xde13('0x26'),_0x4b76d5);logger[_0xde13('0x13')](_0xde13('0x26'),_0x4b76d5,JSON[_0xde13('0x14')](_0x149997));_0x336543(_0x149997);})[_0xde13('0x25')](function(_0x57d139){logger[_0xde13('0x15')](_0xde13('0x26'),_0x57d139[_0xde13('0x18')],_0x4b76d5);_0x4df626(_0x9a593f['error'](0x1f4,_0x57d139['message']));});});};exports[_0xde13('0x28')]=function(_0x2b83da){var _0x15927b=this;return new Promise(function(_0x29b9ab,_0x2fd34e){var _0x3f59f3;return db[_0xde13('0x1b')][_0xde13('0x27')]({'where':_0x2b83da[_0xde13('0x1d')]['where']||{},'attributes':['id',_0xde13('0x29'),_0xde13('0x2a'),_0xde13('0x2b'),'interface']})[_0xde13('0x10')](function(_0x2edfee){if(_0x2edfee){_0x3f59f3=_0x2edfee;return db[_0xde13('0x2c')]['update']({'paused':0x1},{'where':{'UserId':_0x3f59f3['id']},'individualHooks':!![]});}})[_0xde13('0x10')](function(){if(_0x3f59f3){return db[_0xde13('0x2d')][_0xde13('0x1c')]({'where':{'membername':_0x3f59f3[_0xde13('0x29')],'type':'PAUSE','exitAt':null}});}})[_0xde13('0x10')](function(_0x4cf92b){if(_0x3f59f3){if(_0x4cf92b&&_0x4cf92b['length']){var _0x279970=moment()[_0xde13('0x2e')](_0xde13('0x2f'));for(var _0x34c58e=0x0,_0x236ebc=_0x4cf92b[_0xde13('0x30')];_0x34c58e<_0x236ebc;_0x34c58e++){_0x4cf92b[_0x34c58e][_0xde13('0x31')]({'exitAt':_0x279970});}}}})[_0xde13('0x10')](function(){if(_0x3f59f3){var _0x551a33=[];var _0xbd3e0e=utils[_0xde13('0x32')]();_0xbd3e0e[_0xde13('0x33')](function(_0x21f08c){_0x551a33[_0xde13('0x34')]({'channel':_0x21f08c,'membername':_0x3f59f3[_0xde13('0x29')],'interface':_[_0xde13('0x35')](_0x3f59f3[_0xde13('0x36')])?util[_0xde13('0x2e')](_0xde13('0x37'),_0x3f59f3['name']):_0x3f59f3[_0xde13('0x36')],'type':_0xde13('0x38'),'enterAt':moment()['format'](_0xde13('0x2f')),'data1':_0x2b83da[_0xde13('0x39')][_0xde13('0x3a')]||'DEFAULT\x20PAUSE','role':_0x3f59f3['role'],'internal':_0x3f59f3['internal'],'uniqueid':_0x2b83da[_0xde13('0x39')][_0xde13('0x3b')]||null});});return db[_0xde13('0x2d')][_0xde13('0x3c')](_0x551a33,{'individualHooks':!![]});}})['then'](function(){if(_0x3f59f3){return _0x3f59f3[_0xde13('0x3d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x2b83da[_0xde13('0x39')][_0xde13('0x3a')]||_0xde13('0x3e'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})['then'](function(_0xbcdc6a){_0x29b9ab(_0xbcdc6a);})[_0xde13('0x25')](function(_0xaae1d2){_0x2fd34e(_0x15927b['error'](0x1f4,_0xaae1d2[_0xde13('0x18')]));});});};exports[_0xde13('0x3f')]=function(_0x3e88c3){var _0x10c71c=this;return new Promise(function(_0x224990,_0x460755){var _0x29c18b;return db[_0xde13('0x1b')][_0xde13('0x40')]({'where':_0x3e88c3[_0xde13('0x1d')][_0xde13('0x1f')]||{},'attributes':['id',_0xde13('0x29')]})[_0xde13('0x10')](function(_0x50891d){if(_0x50891d){_0x29c18b=_0x50891d;if(_0x3e88c3['body'][_0xde13('0x41')]&&!utils[_0xde13('0x42')](_0x3e88c3[_0xde13('0x39')]['channel'])){throw new Error('Unknown\x20channel');}switch(_0x3e88c3[_0xde13('0x39')][_0xde13('0x41')]){case _0xde13('0x43'):return db['UserVoiceQueueRt'][_0xde13('0x3d')]({'paused':0x0},{'where':{'UserId':_0x29c18b['id']}})[_0xde13('0x10')](function(){return db[_0xde13('0x2d')][_0xde13('0x27')]({'where':{'channel':_0x3e88c3['body'][_0xde13('0x41')],'membername':_0x29c18b[_0xde13('0x29')],'type':_0xde13('0x38'),'exitAt':null}});})[_0xde13('0x10')](function(_0x59c0cb){if(_0x59c0cb){return _0x59c0cb['update']({'exitAt':moment()['format'](_0xde13('0x2f')),'data2':_0xde13('0x44')},{'individualHooks':!![]});}return null;})[_0xde13('0x10')](function(){return _0x29c18b[_0xde13('0x3d')]({'voicePause':![]});});case _0xde13('0x45'):case _0xde13('0x46'):case _0xde13('0x47'):case _0xde13('0x48'):case _0xde13('0x49'):return db[_0xde13('0x2d')][_0xde13('0x27')]({'where':{'channel':_0x3e88c3[_0xde13('0x39')][_0xde13('0x41')],'membername':_0x29c18b[_0xde13('0x29')],'type':_0xde13('0x38'),'exitAt':null}})['then'](function(_0x301176){return _0x301176['update']({'exitAt':moment()[_0xde13('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xde13('0x44')},{'individualHooks':!![]});})['then'](function(){var _0x480e4e={};_[_0xde13('0x4a')](_0x480e4e,util['format'](_0xde13('0x4b'),_0x3e88c3['body'][_0xde13('0x41')],_0xde13('0x4c')),![]);return _0x29c18b[_0xde13('0x3d')](_0x480e4e);});default:return db['UserVoiceQueueRt'][_0xde13('0x3d')]({'paused':0x0},{'where':{'UserId':_0x29c18b['id']}})[_0xde13('0x10')](function(){return db[_0xde13('0x2d')][_0xde13('0x1c')]({'where':{'membername':_0x29c18b[_0xde13('0x29')],'type':'PAUSE','exitAt':null}});})[_0xde13('0x10')](function(_0x3eed0c){var _0x35ed18=[];_0x3eed0c[_0xde13('0x33')](function(_0x16e58b){_0x35ed18[_0xde13('0x34')](_0x16e58b[_0xde13('0x3d')]({'exitAt':moment()[_0xde13('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xde13('0x44')}));});return BPromise['all'](_0x35ed18);})['then'](function(){return _0x29c18b['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xde13('0x10')](function(_0xb88c59){_0x224990(_0xb88c59);})[_0xde13('0x25')](function(_0x65028f){_0x460755(_0x10c71c[_0xde13('0x15')](0x1f4,_0x65028f[_0xde13('0x18')]));});});};exports['LogoutUser']=function(_0x5b8432){var _0x2f75e6=this;return new Promise(function(_0x162f47,_0x38a46e){var _0x36c0e2;return db[_0xde13('0x1b')]['findOne']({'where':_0x5b8432['options'][_0xde13('0x1f')]||{},'attributes':['id',_0xde13('0x29')]})[_0xde13('0x10')](function(_0x4f070e){if(_0x4f070e){_0x36c0e2=_0x4f070e;return db['UserVoiceQueueRt'][_0xde13('0x4d')]({'where':{'membername':_0x36c0e2[_0xde13('0x29')]},'individualHooks':!![]});}})[_0xde13('0x10')](function(){if(_0x36c0e2){return db[_0xde13('0x2d')][_0xde13('0x1c')]({'where':{'membername':_0x36c0e2[_0xde13('0x29')],'exitAt':null}});}})[_0xde13('0x10')](function(_0xfe011b){if(_0x36c0e2){if(_0xfe011b&&_0xfe011b['length']){var _0x1319fc=[];_0xfe011b[_0xde13('0x33')](function(_0x221dbd){_0x1319fc['push'](_0x221dbd[_0xde13('0x3d')]({'exitAt':moment()['format'](_0xde13('0x2f'))}));});return BPromise[_0xde13('0x4e')](_0x1319fc);}}})[_0xde13('0x10')](function(){if(_0x36c0e2){return _0x36c0e2['update']({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xde13('0x10')](function(_0x361ee3){_0x162f47(_0x361ee3);})[_0xde13('0x25')](function(_0x23e6ea){_0x38a46e(_0x2f75e6[_0xde13('0x15')](0x1f4,_0x23e6ea['message']));});});};exports[_0xde13('0x4f')]=function(_0x47a417){var _0x1233b3=this;return new Promise(function(_0x13d3a8,_0xa7a296){var _0x51c5a5;var _0x400b92;var _0x31ada5;var _0xe74baf;return db[_0xde13('0x1b')][_0xde13('0x40')]({'where':_0x47a417[_0xde13('0x1d')][_0xde13('0x1f')]||{},'attributes':['id',_0xde13('0x29'),_0xde13('0x2a'),_0xde13('0x50'),_0xde13('0x51'),'internal',_0xde13('0x52'),'interface']})[_0xde13('0x10')](function(_0xc99d58){if(_0xc99d58){_0x51c5a5=_0xc99d58;_0xe74baf=_0x47a417[_0xde13('0x39')]['interface']?_0x47a417[_0xde13('0x39')][_0xde13('0x36')]:util[_0xde13('0x2e')]('SIP/%s',_0x51c5a5[_0xde13('0x29')]);return db[_0xde13('0x1b')][_0xde13('0x53')]({'where':{'role':_0xde13('0x54'),'online':!![],'id':{'$ne':_0x51c5a5['id']}}});}})[_0xde13('0x10')](function(_0x50f30d){if(_0x50f30d){_0x31ada5=_0x50f30d;return require('../../config/license/util')[_0xde13('0x55')]();}})[_0xde13('0x10')](function(_0x482ec9){if(_0x482ec9&&_0x482ec9['agents']&&_0x31ada5>=_0x482ec9[_0xde13('0x56')]){throw new Error(_0xde13('0x57'));}})[_0xde13('0x10')](function(){if(_0x51c5a5){return db[_0xde13('0x2c')][_0xde13('0x4d')]({'where':{'membername':_0x51c5a5[_0xde13('0x29')]},'individualHooks':!![]});}})[_0xde13('0x10')](function(){if(_0x51c5a5){return _0x51c5a5[_0xde13('0x58')]({'raw':!![]});}})[_0xde13('0x10')](function(_0x45958e){if(_0x51c5a5){if(_0x45958e){var _0xf05e61=[];_0x400b92=_0x45958e;if(_0x400b92[_0xde13('0x30')]){for(var _0x4bae0a=0x0;_0x4bae0a<_0x400b92[_0xde13('0x30')];_0x4bae0a++){_0xf05e61['push'](db[_0xde13('0x2c')][_0xde13('0x59')]({'membername':_0x51c5a5['name'],'UserId':_0x51c5a5['id'],'queue_name':_0x400b92[_0x4bae0a][_0xde13('0x29')],'VoiceQueueId':_0x400b92[_0x4bae0a]['id'],'interface':_0xe74baf,'paused':_0x51c5a5[_0xde13('0x52')]||![],'penalty':_0x400b92[_0x4bae0a][_0xde13('0x5a')]||0x0}));}return BPromise[_0xde13('0x4e')](_0xf05e61);}}}})['then'](function(){if(_0x51c5a5){return db['MemberReport']['findAll']({'where':{'membername':_0x51c5a5[_0xde13('0x29')],'exitAt':null}});}})['then'](function(_0x4d49c2){if(_0x51c5a5){if(_0x4d49c2&&_0x4d49c2[_0xde13('0x30')]){var _0x307f3c=[];_0x4d49c2[_0xde13('0x33')](function(_0x405e38){_0x307f3c['push'](_0x405e38['update']({'exitAt':moment()[_0xde13('0x2e')](_0xde13('0x2f'))}));});return BPromise[_0xde13('0x4e')](_0x307f3c);}}})[_0xde13('0x10')](function(_0x4346d4){if(_0x51c5a5){var _0x3bc3ac=[];var _0x536067=[];var _0x15e9f5=utils[_0xde13('0x32')]();var _0x2feaeb={'membername':_0x51c5a5['name'],'interface':_0xe74baf,'enterAt':moment()[_0xde13('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x51c5a5['role'],'internal':_0x51c5a5[_0xde13('0x2b')]};_0x15e9f5[_0xde13('0x33')](function(_0x11efef){_0x3bc3ac[_0xde13('0x34')](_[_0xde13('0x5b')]({'channel':_0x11efef,'type':_0xde13('0x5c'),'data1':_0xde13('0x5d'),'data2':_0xe74baf},_0x2feaeb));if(_0x51c5a5[_0xde13('0x52')]){_0x536067[_0xde13('0x34')](_[_0xde13('0x5b')]({'channel':_0x11efef,'type':_0xde13('0x38'),'data1':_0xde13('0x5e')},_0x2feaeb));}});return db[_0xde13('0x2d')][_0xde13('0x3c')](_0x3bc3ac[_0xde13('0x5f')](_0x536067),{'individualHooks':!![]});}})[_0xde13('0x10')](function(){if(_0x51c5a5){return _0x51c5a5[_0xde13('0x3d')]({'online':!![],'lastLoginAt':moment()['format'](_0xde13('0x2f')),'voicePause':_0x51c5a5[_0xde13('0x52')]||![],'mailPause':_0x51c5a5['loginInPause']||![],'chatPause':_0x51c5a5[_0xde13('0x52')]||![],'faxPause':_0x51c5a5[_0xde13('0x52')]||![],'smsPause':_0x51c5a5['loginInPause']||![],'openchannelPause':_0x51c5a5[_0xde13('0x52')]||![],'pauseType':_0x51c5a5[_0xde13('0x52')]?_0xde13('0x5e'):null,'lastPauseAt':moment()['format'](_0xde13('0x2f')),'interface':_0xe74baf});}})[_0xde13('0x10')](function(_0x37c4be){_0x13d3a8(_0x37c4be);})[_0xde13('0x25')](function(_0x27f835){_0xa7a296(_0x1233b3[_0xde13('0x15')](0x1f4,_0x27f835[_0xde13('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index be78686..923c25c 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 _0xa1b0=['remove','update','emit','register','user:','./user.events','save'];(function(_0x39106e,_0x586f3d){var _0x892aec=function(_0xded1b5){while(--_0xded1b5){_0x39106e['push'](_0x39106e['shift']());}};_0x892aec(++_0x586f3d);}(_0xa1b0,0x1c5));var _0x0a1b=function(_0x42ba84,_0x4a3c10){_0x42ba84=_0x42ba84-0x0;var _0x22a316=_0xa1b0[_0x42ba84];return _0x22a316;};'use strict';var UserEvents=require(_0x0a1b('0x0'));var events=[_0x0a1b('0x1'),_0x0a1b('0x2'),_0x0a1b('0x3')];function createListener(_0x57a75d,_0x1726a6){return function(_0x4ad999){_0x1726a6[_0x0a1b('0x4')](_0x57a75d,_0x4ad999);};}function removeListener(_0x5c4e51,_0x284336){return function(){UserEvents['removeListener'](_0x5c4e51,_0x284336);};}exports[_0x0a1b('0x5')]=function(_0x1560f4){for(var _0x3f22e1=0x0,_0x446b8d=events['length'];_0x3f22e1<_0x446b8d;_0x3f22e1++){var _0x5a2a62=events[_0x3f22e1];var _0x599af8=createListener(_0x0a1b('0x6')+_0x5a2a62,_0x1560f4);UserEvents['on'](_0x5a2a62,_0x599af8);}}; \ No newline at end of file +var _0xa5f5=['./user.events','save','remove','update','emit','length','user:'];(function(_0x3a0f3e,_0x52601f){var _0x300e5a=function(_0x333e1f){while(--_0x333e1f){_0x3a0f3e['push'](_0x3a0f3e['shift']());}};_0x300e5a(++_0x52601f);}(_0xa5f5,0xfc));var _0x5a5f=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xa5f5[_0x2f45ea];return _0x485a84;};'use strict';var UserEvents=require(_0x5a5f('0x0'));var events=[_0x5a5f('0x1'),_0x5a5f('0x2'),_0x5a5f('0x3')];function createListener(_0x4b5530,_0x187fc4){return function(_0x37f084){_0x187fc4[_0x5a5f('0x4')](_0x4b5530,_0x37f084);};}function removeListener(_0x28d684,_0x4ee65a){return function(){UserEvents['removeListener'](_0x28d684,_0x4ee65a);};}exports['register']=function(_0x4bc033){for(var _0x1ea433=0x0,_0x4e2f2d=events[_0x5a5f('0x5')];_0x1ea433<_0x4e2f2d;_0x1ea433++){var _0x3c72f4=events[_0x1ea433];var _0x3858a2=createListener(_0x5a5f('0x6')+_0x3c72f4,_0x4bc033);UserEvents['on'](_0x3c72f4,_0x3858a2);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index eeaf52b..d60468d 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 _0x2cb0=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x2cb0,0x1cc));var _0x02cb=function(_0x1329c2,_0x14c07){_0x1329c2=_0x1329c2-0x0;var _0xc675f1=_0x2cb0[_0x1329c2];return _0xc675f1;};'use strict';var multer=require(_0x02cb('0x0'));var util=require(_0x02cb('0x1'));var path=require(_0x02cb('0x2'));var timeout=require(_0x02cb('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x02cb('0x4'));var interaction=require(_0x02cb('0x5'));var config=require(_0x02cb('0x6'));module[_0x02cb('0x7')]=router; \ No newline at end of file +var _0x690e=['express','Router','../../components/interaction/service','../../config/environment','multer','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x690e,0xcc));var _0xe690=function(_0xcf79d6,_0x267df9){_0xcf79d6=_0xcf79d6-0x0;var _0x580c76=_0x690e[_0xcf79d6];return _0x580c76;};'use strict';var multer=require(_0xe690('0x0'));var util=require(_0xe690('0x1'));var path=require(_0xe690('0x2'));var timeout=require(_0xe690('0x3'));var express=require(_0xe690('0x4'));var router=express[_0xe690('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xe690('0x6'));var config=require(_0xe690('0x7'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 3474887..12d7e4d 100644 --- a/server/api/userChatQueue/userChatQueue.attributes.js +++ b/server/api/userChatQueue/userChatQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x58d792,_0x18b0f8){var _0x3b7f69=function(_0x47d324){while(--_0x47d324){_0x58d792['push'](_0x58d792['shift']());}};_0x3b7f69(++_0x18b0f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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(_0x428d5b,_0xe0b248){var _0x4cad30=function(_0x1344c7){while(--_0x1344c7){_0x428d5b['push'](_0x428d5b['shift']());}};_0x4cad30(++_0xe0b248);}(_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 dd8ddb1..97e886c 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 _0x0e5a=['exports','define','UserChatQueue','user_has_chat_queues','lodash','util','moment','bluebird','request-promise','path','../../config/environment','./userChatQueue.attributes'];(function(_0x298bd1,_0x28f9d3){var _0x413aa6=function(_0x285a37){while(--_0x285a37){_0x298bd1['push'](_0x298bd1['shift']());}};_0x413aa6(++_0x28f9d3);}(_0x0e5a,0x70));var _0xa0e5=function(_0x5b84d9,_0x1bddf8){_0x5b84d9=_0x5b84d9-0x0;var _0x38a9b2=_0x0e5a[_0x5b84d9];return _0x38a9b2;};'use strict';var _=require(_0xa0e5('0x0'));var util=require(_0xa0e5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa0e5('0x2'));var BPromise=require(_0xa0e5('0x3'));var rp=require(_0xa0e5('0x4'));var fs=require('fs');var path=require(_0xa0e5('0x5'));var rimraf=require('rimraf');var config=require(_0xa0e5('0x6'));var attributes=require(_0xa0e5('0x7'));module[_0xa0e5('0x8')]=function(_0x51deae,_0x49182b){return _0x51deae[_0xa0e5('0x9')](_0xa0e5('0xa'),attributes,{'tableName':_0xa0e5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5eed=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserChatQueue','user_has_chat_queues'];(function(_0x1a0da2,_0x3c54d6){var _0x49ad7f=function(_0x29dea4){while(--_0x29dea4){_0x1a0da2['push'](_0x1a0da2['shift']());}};_0x49ad7f(++_0x3c54d6);}(_0x5eed,0x10a));var _0xd5ee=function(_0x4dbea3,_0x524787){_0x4dbea3=_0x4dbea3-0x0;var _0x1d1072=_0x5eed[_0x4dbea3];return _0x1d1072;};'use strict';var _=require(_0xd5ee('0x0'));var util=require(_0xd5ee('0x1'));var logger=require(_0xd5ee('0x2'))(_0xd5ee('0x3'));var moment=require(_0xd5ee('0x4'));var BPromise=require(_0xd5ee('0x5'));var rp=require(_0xd5ee('0x6'));var fs=require('fs');var path=require(_0xd5ee('0x7'));var rimraf=require(_0xd5ee('0x8'));var config=require(_0xd5ee('0x9'));var attributes=require('./userChatQueue.attributes');module[_0xd5ee('0xa')]=function(_0x347377,_0xc7de11){return _0x347377[_0xd5ee('0xb')](_0xd5ee('0xc'),attributes,{'tableName':_0xd5ee('0xd'),'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 2d5c730..56d7a2f 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 _0x32c0=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash'];(function(_0x1fc41b,_0x563845){var _0x2d2bee=function(_0x2f47b1){while(--_0x2f47b1){_0x1fc41b['push'](_0x1fc41b['shift']());}};_0x2d2bee(++_0x563845);}(_0x32c0,0x1a3));var _0x032c=function(_0x280cc2,_0x4edcbb){_0x280cc2=_0x280cc2-0x0;var _0x251cc9=_0x32c0[_0x280cc2];return _0x251cc9;};'use strict';var _=require(_0x032c('0x0'));var util=require('util');var moment=require(_0x032c('0x1'));var BPromise=require('bluebird');var rs=require(_0x032c('0x2'));var fs=require('fs');var Redis=require(_0x032c('0x3'));var db=require(_0x032c('0x4'))['db'];var utils=require(_0x032c('0x5'));var logger=require(_0x032c('0x6'))(_0x032c('0x7'));var config=require(_0x032c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x032c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56942f,_0x2e1aee,_0x476188){return new BPromise(function(_0x1216c9,_0x5d7670){return client[_0x032c('0xa')](_0x56942f,_0x476188)[_0x032c('0xb')](function(_0x52f8c2){logger[_0x032c('0xc')](_0x032c('0xd'),_0x2e1aee,'request\x20sent');logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x2e1aee,_0x032c('0xe'),JSON[_0x032c('0xf')](_0x52f8c2));if(_0x52f8c2[_0x032c('0x10')]){if(_0x52f8c2[_0x032c('0x10')][_0x032c('0x11')]===0x1f4){logger['error'](_0x032c('0xd'),_0x2e1aee,_0x52f8c2['error'][_0x032c('0x12')]);return _0x5d7670(_0x52f8c2['error'][_0x032c('0x12')]);}logger[_0x032c('0x10')](_0x032c('0xd'),_0x2e1aee,_0x52f8c2[_0x032c('0x10')][_0x032c('0x12')]);return _0x1216c9(_0x52f8c2[_0x032c('0x10')]['message']);}else{logger[_0x032c('0xc')](_0x032c('0xd'),_0x2e1aee,_0x032c('0xe'));_0x1216c9(_0x52f8c2[_0x032c('0x13')]['message']);}})['catch'](function(_0x75f051){logger[_0x032c('0x10')](_0x032c('0xd'),_0x2e1aee,_0x75f051);_0x5d7670(_0x75f051);});});} \ No newline at end of file +var _0xc92d=['UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then'];(function(_0x45d404,_0x47356e){var _0x5b26b4=function(_0x1c50f1){while(--_0x1c50f1){_0x45d404['push'](_0x45d404['shift']());}};_0x5b26b4(++_0x47356e);}(_0xc92d,0x7a));var _0xdc92=function(_0x10c90e,_0x2a0672){_0x10c90e=_0x10c90e-0x0;var _0x2fbfee=_0xc92d[_0x10c90e];return _0x2fbfee;};'use strict';var _=require(_0xdc92('0x0'));var util=require(_0xdc92('0x1'));var moment=require('moment');var BPromise=require(_0xdc92('0x2'));var rs=require(_0xdc92('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdc92('0x4'))['db'];var utils=require(_0xdc92('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xdc92('0x6'));var client=jayson[_0xdc92('0x7')][_0xdc92('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x198b53,_0x5ba709,_0x4c7457){return new BPromise(function(_0x6f8738,_0xae472b){return client[_0xdc92('0x9')](_0x198b53,_0x4c7457)[_0xdc92('0xa')](function(_0x22b16a){logger['info'](_0xdc92('0xb'),_0x5ba709,'request\x20sent');logger[_0xdc92('0xc')](_0xdc92('0xd'),_0x5ba709,_0xdc92('0xe'),JSON['stringify'](_0x22b16a));if(_0x22b16a[_0xdc92('0xf')]){if(_0x22b16a['error'][_0xdc92('0x10')]===0x1f4){logger['error'](_0xdc92('0xb'),_0x5ba709,_0x22b16a[_0xdc92('0xf')][_0xdc92('0x11')]);return _0xae472b(_0x22b16a[_0xdc92('0xf')][_0xdc92('0x11')]);}logger[_0xdc92('0xf')](_0xdc92('0xb'),_0x5ba709,_0x22b16a[_0xdc92('0xf')][_0xdc92('0x11')]);return _0x6f8738(_0x22b16a['error'][_0xdc92('0x11')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x5ba709,_0xdc92('0xe'));_0x6f8738(_0x22b16a[_0xdc92('0x12')]['message']);}})['catch'](function(_0x16d74b){logger['error'](_0xdc92('0xb'),_0x5ba709,_0x16d74b);_0xae472b(_0x16d74b);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 29323ae..9a8c41d 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 _0x0132=['../../components/auth/service','../../config/environment','exports','multer','util','connect-timeout','express','Router'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x0132,0x153));var _0x2013=function(_0x460763,_0x388eb8){_0x460763=_0x460763-0x0;var _0xdc541=_0x0132[_0x460763];return _0xdc541;};'use strict';var multer=require(_0x2013('0x0'));var util=require(_0x2013('0x1'));var path=require('path');var timeout=require(_0x2013('0x2'));var express=require(_0x2013('0x3'));var router=express[_0x2013('0x4')]();var auth=require(_0x2013('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2013('0x6'));module[_0x2013('0x7')]=router; \ No newline at end of file +var _0x522b=['exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x522b,0x1c3));var _0xb522=function(_0x42c118,_0x197006){_0x42c118=_0x42c118-0x0;var _0x112ebd=_0x522b[_0x42c118];return _0x112ebd;};'use strict';var multer=require(_0xb522('0x0'));var util=require(_0xb522('0x1'));var path=require('path');var timeout=require(_0xb522('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xb522('0x3'));var interaction=require(_0xb522('0x4'));var config=require('../../config/environment');module[_0xb522('0x5')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 42ba8e1..59f6f2e 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 _0xea28=['INTEGER','STRING','sequelize','exports'];(function(_0x199ea0,_0x10ec35){var _0x214f76=function(_0x2fdb6b){while(--_0x2fdb6b){_0x199ea0['push'](_0x199ea0['shift']());}};_0x214f76(++_0x10ec35);}(_0xea28,0x13a));var _0x8ea2=function(_0x436082,_0x161887){_0x436082=_0x436082-0x0;var _0x1d266c=_0xea28[_0x436082];return _0x1d266c;};'use strict';var Sequelize=require(_0x8ea2('0x0'));module[_0x8ea2('0x1')]={'penalty':{'type':Sequelize[_0x8ea2('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8ea2('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x8ea2('0x3')]}}; \ No newline at end of file +var _0x1775=['STRING','exports','INTEGER'];(function(_0x4ca7a7,_0x2d1bd6){var _0x19ec6c=function(_0x2ba04d){while(--_0x2ba04d){_0x4ca7a7['push'](_0x4ca7a7['shift']());}};_0x19ec6c(++_0x2d1bd6);}(_0x1775,0x1db));var _0x5177=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1775[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x5177('0x0')]={'penalty':{'type':Sequelize[_0x5177('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x5177('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x5177('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 490a6a3..1ce7a8c 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 _0x7f1b=['moment','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash'];(function(_0x4608e9,_0x111a90){var _0x46c7f3=function(_0x30873a){while(--_0x30873a){_0x4608e9['push'](_0x4608e9['shift']());}};_0x46c7f3(++_0x111a90);}(_0x7f1b,0x12b));var _0xb7f1=function(_0x187d1f,_0x4cfbba){_0x187d1f=_0x187d1f-0x0;var _0x4e043b=_0x7f1b[_0x187d1f];return _0x4e043b;};'use strict';var _=require(_0xb7f1('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb7f1('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7f1('0x2'));var rimraf=require(_0xb7f1('0x3'));var config=require(_0xb7f1('0x4'));var attributes=require(_0xb7f1('0x5'));module[_0xb7f1('0x6')]=function(_0x5a7d99,_0x36be46){return _0x5a7d99[_0xb7f1('0x7')](_0xb7f1('0x8'),attributes,{'tableName':_0xb7f1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6abf=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserFaxQueue','util','api','moment'];(function(_0x40ad0f,_0x4ee070){var _0x147b1e=function(_0x2e4718){while(--_0x2e4718){_0x40ad0f['push'](_0x40ad0f['shift']());}};_0x147b1e(++_0x4ee070);}(_0x6abf,0x1b5));var _0xf6ab=function(_0xa6df,_0x2b2969){_0xa6df=_0xa6df-0x0;var _0x4a43fd=_0x6abf[_0xa6df];return _0x4a43fd;};'use strict';var _=require('lodash');var util=require(_0xf6ab('0x0'));var logger=require('../../config/logger')(_0xf6ab('0x1'));var moment=require(_0xf6ab('0x2'));var BPromise=require(_0xf6ab('0x3'));var rp=require(_0xf6ab('0x4'));var fs=require('fs');var path=require(_0xf6ab('0x5'));var rimraf=require(_0xf6ab('0x6'));var config=require(_0xf6ab('0x7'));var attributes=require('./userFaxQueue.attributes');module[_0xf6ab('0x8')]=function(_0x3a9a82,_0x311eda){return _0x3a9a82[_0xf6ab('0x9')](_0xf6ab('0xa'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 784b5f5..af13883 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 _0x9b94=['request\x20sent','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserFaxQueue,\x20%s,\x20%s'];(function(_0x8ef06a,_0x247f09){var _0x494cda=function(_0x25e762){while(--_0x25e762){_0x8ef06a['push'](_0x8ef06a['shift']());}};_0x494cda(++_0x247f09);}(_0x9b94,0x135));var _0x49b9=function(_0x406347,_0x3afc59){_0x406347=_0x406347-0x0;var _0x75e14e=_0x9b94[_0x406347];return _0x75e14e;};'use strict';var _=require(_0x49b9('0x0'));var util=require(_0x49b9('0x1'));var moment=require(_0x49b9('0x2'));var BPromise=require(_0x49b9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49b9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x49b9('0x5'));var logger=require(_0x49b9('0x6'))(_0x49b9('0x7'));var config=require(_0x49b9('0x8'));var jayson=require(_0x49b9('0x9'));var client=jayson[_0x49b9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x357e54,_0x162c6b,_0x35b409){return new BPromise(function(_0x111aa6,_0x4d6b43){return client[_0x49b9('0xb')](_0x357e54,_0x35b409)[_0x49b9('0xc')](function(_0x3303c8){logger[_0x49b9('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x162c6b,'request\x20sent');logger[_0x49b9('0xe')](_0x49b9('0xf'),_0x162c6b,'request\x20sent',JSON[_0x49b9('0x10')](_0x3303c8));if(_0x3303c8['error']){if(_0x3303c8[_0x49b9('0x11')][_0x49b9('0x12')]===0x1f4){logger[_0x49b9('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x162c6b,_0x3303c8[_0x49b9('0x11')]['message']);return _0x4d6b43(_0x3303c8[_0x49b9('0x11')][_0x49b9('0x13')]);}logger[_0x49b9('0x11')](_0x49b9('0x14'),_0x162c6b,_0x3303c8[_0x49b9('0x11')]['message']);return _0x111aa6(_0x3303c8[_0x49b9('0x11')]['message']);}else{logger[_0x49b9('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x162c6b,_0x49b9('0x15'));_0x111aa6(_0x3303c8['result']['message']);}})['catch'](function(_0x45d3e2){logger['error'](_0x49b9('0x14'),_0x162c6b,_0x45d3e2);_0x4d6b43(_0x45d3e2);});});} \ No newline at end of file +var _0x22a7=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3be7ff,_0x12e714){var _0x186721=function(_0x2bc9e1){while(--_0x2bc9e1){_0x3be7ff['push'](_0x3be7ff['shift']());}};_0x186721(++_0x12e714);}(_0x22a7,0xe4));var _0x722a=function(_0x1fb6be,_0x2fd9a3){_0x1fb6be=_0x1fb6be-0x0;var _0x1eebff=_0x22a7[_0x1fb6be];return _0x1eebff;};'use strict';var _=require(_0x722a('0x0'));var util=require(_0x722a('0x1'));var moment=require(_0x722a('0x2'));var BPromise=require(_0x722a('0x3'));var rs=require(_0x722a('0x4'));var fs=require('fs');var Redis=require(_0x722a('0x5'));var db=require(_0x722a('0x6'))['db'];var utils=require(_0x722a('0x7'));var logger=require(_0x722a('0x8'))(_0x722a('0x9'));var config=require(_0x722a('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x722a('0xb')][_0x722a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ddaf1,_0x48970e,_0x264ea4){return new BPromise(function(_0x1cd32c,_0x1846c0){return client[_0x722a('0xd')](_0x2ddaf1,_0x264ea4)[_0x722a('0xe')](function(_0x4ac1a2){logger[_0x722a('0xf')](_0x722a('0x10'),_0x48970e,_0x722a('0x11'));logger[_0x722a('0x12')](_0x722a('0x13'),_0x48970e,_0x722a('0x11'),JSON[_0x722a('0x14')](_0x4ac1a2));if(_0x4ac1a2['error']){if(_0x4ac1a2[_0x722a('0x15')][_0x722a('0x16')]===0x1f4){logger[_0x722a('0x15')](_0x722a('0x10'),_0x48970e,_0x4ac1a2['error']['message']);return _0x1846c0(_0x4ac1a2[_0x722a('0x15')][_0x722a('0x17')]);}logger[_0x722a('0x15')](_0x722a('0x10'),_0x48970e,_0x4ac1a2[_0x722a('0x15')][_0x722a('0x17')]);return _0x1cd32c(_0x4ac1a2[_0x722a('0x15')][_0x722a('0x17')]);}else{logger['info'](_0x722a('0x10'),_0x48970e,'request\x20sent');_0x1cd32c(_0x4ac1a2[_0x722a('0x18')]['message']);}})[_0x722a('0x19')](function(_0xe5c3a4){logger['error'](_0x722a('0x10'),_0x48970e,_0xe5c3a4);_0x1846c0(_0xe5c3a4);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 4541e33..d67f534 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 _0xa8db=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4de8ce,_0x38b57a){var _0x495a63=function(_0x6ccf96){while(--_0x6ccf96){_0x4de8ce['push'](_0x4de8ce['shift']());}};_0x495a63(++_0x38b57a);}(_0xa8db,0x12a));var _0xba8d=function(_0x4b6778,_0x505a76){_0x4b6778=_0x4b6778-0x0;var _0x22dbb9=_0xa8db[_0x4b6778];return _0x22dbb9;};'use strict';var multer=require(_0xba8d('0x0'));var util=require(_0xba8d('0x1'));var path=require(_0xba8d('0x2'));var timeout=require(_0xba8d('0x3'));var express=require(_0xba8d('0x4'));var router=express['Router']();var auth=require(_0xba8d('0x5'));var interaction=require(_0xba8d('0x6'));var config=require(_0xba8d('0x7'));module[_0xba8d('0x8')]=router; \ No newline at end of file +var _0x7ad8=['path','connect-timeout','express','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x2f0978,_0x37249c){var _0x417306=function(_0x385e96){while(--_0x385e96){_0x2f0978['push'](_0x2f0978['shift']());}};_0x417306(++_0x37249c);}(_0x7ad8,0x76));var _0x87ad=function(_0x333fc8,_0x2b292c){_0x333fc8=_0x333fc8-0x0;var _0x432439=_0x7ad8[_0x333fc8];return _0x432439;};'use strict';var multer=require(_0x87ad('0x0'));var util=require('util');var path=require(_0x87ad('0x1'));var timeout=require(_0x87ad('0x2'));var express=require(_0x87ad('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x87ad('0x4'));var config=require(_0x87ad('0x5'));module[_0x87ad('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index ba7623a..100e043 100644 --- a/server/api/userMailQueue/userMailQueue.attributes.js +++ b/server/api/userMailQueue/userMailQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['INTEGER','sequelize','exports'];(function(_0x3f6115,_0x3c8ad0){var _0x3ed5f0=function(_0x5f5814){while(--_0x5f5814){_0x3f6115['push'](_0x3f6115['shift']());}};_0x3ed5f0(++_0x3c8ad0);}(_0xe706,0xa3));var _0x6e70=function(_0x338f03,_0x28941b){_0x338f03=_0x338f03-0x0;var _0x514d7e=_0xe706[_0x338f03];return _0x514d7e;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x283f07,_0x538ad7){var _0x25056a=function(_0x1909f9){while(--_0x1909f9){_0x283f07['push'](_0x283f07['shift']());}};_0x25056a(++_0x538ad7);}(_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')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index b7b2040..0ec4a38 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 _0xb7e7=['UserMailQueue','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','define'];(function(_0x16bee2,_0x2d3a79){var _0x393c93=function(_0x3ccd87){while(--_0x3ccd87){_0x16bee2['push'](_0x16bee2['shift']());}};_0x393c93(++_0x2d3a79);}(_0xb7e7,0x121));var _0x7b7e=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0xb7e7[_0x38ced4];return _0x547c07;};'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':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','../../config/logger','api'];(function(_0x51a015,_0x57fb90){var _0x1933cd=function(_0x38cf7d){while(--_0x38cf7d){_0x51a015['push'](_0x51a015['shift']());}};_0x1933cd(++_0x57fb90);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index b54f61b..2eee4c3 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 _0x1602=['../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','UserMailQueue,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x40ce06,_0x2b829e){var _0x40491a=function(_0x3053f9){while(--_0x3053f9){_0x40ce06['push'](_0x40ce06['shift']());}};_0x40491a(++_0x2b829e);}(_0x1602,0x135));var _0x2160=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1602[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x2160('0x0'));var util=require(_0x2160('0x1'));var moment=require(_0x2160('0x2'));var BPromise=require(_0x2160('0x3'));var rs=require(_0x2160('0x4'));var fs=require('fs');var Redis=require(_0x2160('0x5'));var db=require(_0x2160('0x6'))['db'];var utils=require(_0x2160('0x7'));var logger=require(_0x2160('0x8'))(_0x2160('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2160('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x67e499,_0x33a580,_0x4b33e2){return new BPromise(function(_0x1f2586,_0x308c7d){return client[_0x2160('0xb')](_0x67e499,_0x4b33e2)['then'](function(_0x44c7bf){logger['info'](_0x2160('0xc'),_0x33a580,'request\x20sent');logger[_0x2160('0xd')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x33a580,'request\x20sent',JSON[_0x2160('0xe')](_0x44c7bf));if(_0x44c7bf[_0x2160('0xf')]){if(_0x44c7bf[_0x2160('0xf')][_0x2160('0x10')]===0x1f4){logger[_0x2160('0xf')](_0x2160('0xc'),_0x33a580,_0x44c7bf[_0x2160('0xf')][_0x2160('0x11')]);return _0x308c7d(_0x44c7bf[_0x2160('0xf')][_0x2160('0x11')]);}logger[_0x2160('0xf')](_0x2160('0xc'),_0x33a580,_0x44c7bf['error']['message']);return _0x1f2586(_0x44c7bf[_0x2160('0xf')][_0x2160('0x11')]);}else{logger[_0x2160('0x12')](_0x2160('0xc'),_0x33a580,_0x2160('0x13'));_0x1f2586(_0x44c7bf['result'][_0x2160('0x11')]);}})[_0x2160('0x14')](function(_0x10b771){logger['error'](_0x2160('0xc'),_0x33a580,_0x10b771);_0x308c7d(_0x10b771);});});} \ No newline at end of file +var _0x94ba=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch'];(function(_0xd4bd9e,_0x4cb513){var _0x106b78=function(_0x57fe7c){while(--_0x57fe7c){_0xd4bd9e['push'](_0xd4bd9e['shift']());}};_0x106b78(++_0x4cb513);}(_0x94ba,0xbe));var _0xa94b=function(_0x3ad5fe,_0x4b57bc){_0x3ad5fe=_0x3ad5fe-0x0;var _0x186865=_0x94ba[_0x3ad5fe];return _0x186865;};'use strict';var _=require(_0xa94b('0x0'));var util=require(_0xa94b('0x1'));var moment=require(_0xa94b('0x2'));var BPromise=require(_0xa94b('0x3'));var rs=require(_0xa94b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa94b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa94b('0x6'))(_0xa94b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa94b('0x8')][_0xa94b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x363129,_0x262c09,_0x54c158){return new BPromise(function(_0x41aca1,_0x2165ae){return client['request'](_0x363129,_0x54c158)['then'](function(_0x1aaa45){logger[_0xa94b('0xa')](_0xa94b('0xb'),_0x262c09,'request\x20sent');logger[_0xa94b('0xc')](_0xa94b('0xd'),_0x262c09,_0xa94b('0xe'),JSON[_0xa94b('0xf')](_0x1aaa45));if(_0x1aaa45[_0xa94b('0x10')]){if(_0x1aaa45[_0xa94b('0x10')]['code']===0x1f4){logger[_0xa94b('0x10')](_0xa94b('0xb'),_0x262c09,_0x1aaa45[_0xa94b('0x10')][_0xa94b('0x11')]);return _0x2165ae(_0x1aaa45[_0xa94b('0x10')][_0xa94b('0x11')]);}logger[_0xa94b('0x10')](_0xa94b('0xb'),_0x262c09,_0x1aaa45['error'][_0xa94b('0x11')]);return _0x41aca1(_0x1aaa45[_0xa94b('0x10')]['message']);}else{logger[_0xa94b('0xa')]('UserMailQueue,\x20%s,\x20%s',_0x262c09,'request\x20sent');_0x41aca1(_0x1aaa45['result'][_0xa94b('0x11')]);}})[_0xa94b('0x12')](function(_0x401e69){logger[_0xa94b('0x10')](_0xa94b('0xb'),_0x262c09,_0x401e69);_0x2165ae(_0x401e69);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index edd6e87..37929a4 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 _0x0755=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','connect-timeout','Router'];(function(_0xf9297,_0x1e8622){var _0x5a6e6e=function(_0x3901c9){while(--_0x3901c9){_0xf9297['push'](_0xf9297['shift']());}};_0x5a6e6e(++_0x1e8622);}(_0x0755,0x194));var _0x5075=function(_0x3d4454,_0x25d4d3){_0x3d4454=_0x3d4454-0x0;var _0x2425f9=_0x0755[_0x3d4454];return _0x2425f9;};'use strict';var multer=require(_0x5075('0x0'));var util=require(_0x5075('0x1'));var path=require('path');var timeout=require(_0x5075('0x2'));var express=require('express');var router=express[_0x5075('0x3')]();var auth=require(_0x5075('0x4'));var interaction=require(_0x5075('0x5'));var config=require(_0x5075('0x6'));module[_0x5075('0x7')]=router; \ No newline at end of file +var _0x29ee=['Router','../../config/environment','exports','multer','path','connect-timeout','express'];(function(_0x48a4c7,_0x478455){var _0x142f01=function(_0x75cda7){while(--_0x75cda7){_0x48a4c7['push'](_0x48a4c7['shift']());}};_0x142f01(++_0x478455);}(_0x29ee,0x1bc));var _0xe29e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x29ee[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0xe29e('0x0'));var util=require('util');var path=require(_0xe29e('0x1'));var timeout=require(_0xe29e('0x2'));var express=require(_0xe29e('0x3'));var router=express[_0xe29e('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe29e('0x5'));module[_0xe29e('0x6')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 587d59d..f83a7b9 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['exports','INTEGER'];(function(_0x4ac48d,_0x171a68){var _0x7537af=function(_0x1c6ca6){while(--_0x1c6ca6){_0x4ac48d['push'](_0x4ac48d['shift']());}};_0x7537af(++_0x171a68);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x18bca7,_0x13ccb8){var _0x1158e5=function(_0x323ba2){while(--_0x323ba2){_0x18bca7['push'](_0x18bca7['shift']());}};_0x1158e5(++_0x13ccb8);}(_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/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 2d992e7..24b4000 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 _0x491d=['api','bluebird','request-promise','rimraf','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash'];(function(_0x2e2b45,_0x2a07e3){var _0x2bf3c2=function(_0x51d98d){while(--_0x51d98d){_0x2e2b45['push'](_0x2e2b45['shift']());}};_0x2bf3c2(++_0x2a07e3);}(_0x491d,0xbc));var _0xd491=function(_0x40e313,_0x4333f7){_0x40e313=_0x40e313-0x0;var _0x176932=_0x491d[_0x40e313];return _0x176932;};'use strict';var _=require(_0xd491('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd491('0x1'));var moment=require('moment');var BPromise=require(_0xd491('0x2'));var rp=require(_0xd491('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd491('0x4'));var config=require('../../config/environment');var attributes=require('./userOpenchannelQueue.attributes');module[_0xd491('0x5')]=function(_0x8d5d3f,_0x4e95b3){return _0x8d5d3f[_0xd491('0x6')](_0xd491('0x7'),attributes,{'tableName':_0xd491('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x772d=['exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./userOpenchannelQueue.attributes'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x772d,0xac));var _0xd772=function(_0x3e1bf2,_0x121002){_0x3e1bf2=_0x3e1bf2-0x0;var _0x1de65a=_0x772d[_0x3e1bf2];return _0x1de65a;};'use strict';var _=require(_0xd772('0x0'));var util=require(_0xd772('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd772('0x2'));var BPromise=require(_0xd772('0x3'));var rp=require(_0xd772('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd772('0x5'));var config=require(_0xd772('0x6'));var attributes=require(_0xd772('0x7'));module[_0xd772('0x8')]=function(_0x553b90,_0x1a883c){return _0x553b90[_0xd772('0x9')](_0xd772('0xa'),attributes,{'tableName':_0xd772('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index a22959c..eb5a53b 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 _0x0681=['error','UserOpenchannelQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','stringify'];(function(_0x2df6d7,_0x86cea6){var _0x222040=function(_0x1cc1d1){while(--_0x1cc1d1){_0x2df6d7['push'](_0x2df6d7['shift']());}};_0x222040(++_0x86cea6);}(_0x0681,0x101));var _0x1068=function(_0x3f7e37,_0x32f790){_0x3f7e37=_0x3f7e37-0x0;var _0x2a3ec7=_0x0681[_0x3f7e37];return _0x2a3ec7;};'use strict';var _=require(_0x1068('0x0'));var util=require(_0x1068('0x1'));var moment=require(_0x1068('0x2'));var BPromise=require(_0x1068('0x3'));var rs=require(_0x1068('0x4'));var fs=require('fs');var Redis=require(_0x1068('0x5'));var db=require(_0x1068('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1068('0x7'))(_0x1068('0x8'));var config=require(_0x1068('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1068('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe971b6,_0x22ccde,_0x16a787){return new BPromise(function(_0xe6c676,_0x6236a1){return client[_0x1068('0xb')](_0xe971b6,_0x16a787)[_0x1068('0xc')](function(_0x312196){logger[_0x1068('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x22ccde,_0x1068('0xe'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x22ccde,_0x1068('0xe'),JSON[_0x1068('0xf')](_0x312196));if(_0x312196['error']){if(_0x312196[_0x1068('0x10')]['code']===0x1f4){logger['error'](_0x1068('0x11'),_0x22ccde,_0x312196[_0x1068('0x10')]['message']);return _0x6236a1(_0x312196[_0x1068('0x10')][_0x1068('0x12')]);}logger[_0x1068('0x10')](_0x1068('0x11'),_0x22ccde,_0x312196[_0x1068('0x10')][_0x1068('0x12')]);return _0xe6c676(_0x312196[_0x1068('0x10')][_0x1068('0x12')]);}else{logger[_0x1068('0xd')](_0x1068('0x11'),_0x22ccde,_0x1068('0xe'));_0xe6c676(_0x312196[_0x1068('0x13')][_0x1068('0x12')]);}})[_0x1068('0x14')](function(_0x4aab3f){logger[_0x1068('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x22ccde,_0x4aab3f);_0x6236a1(_0x4aab3f);});});} \ No newline at end of file +var _0x2547=['UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug'];(function(_0x2ce2b3,_0x272f46){var _0x2e9e2d=function(_0xa7ad76){while(--_0xa7ad76){_0x2ce2b3['push'](_0x2ce2b3['shift']());}};_0x2e9e2d(++_0x272f46);}(_0x2547,0x1d5));var _0x7254=function(_0x21c50f,_0x5ed5d9){_0x21c50f=_0x21c50f-0x0;var _0x16c4c8=_0x2547[_0x21c50f];return _0x16c4c8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7254('0x0'));var BPromise=require(_0x7254('0x1'));var rs=require(_0x7254('0x2'));var fs=require('fs');var Redis=require(_0x7254('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7254('0x4'));var logger=require('../../config/logger')(_0x7254('0x5'));var config=require(_0x7254('0x6'));var jayson=require(_0x7254('0x7'));var client=jayson[_0x7254('0x8')][_0x7254('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22fc62,_0x3c9d56,_0x22a12f){return new BPromise(function(_0x3df4f4,_0x15894e){return client[_0x7254('0xa')](_0x22fc62,_0x22a12f)[_0x7254('0xb')](function(_0x419670){logger[_0x7254('0xc')](_0x7254('0xd'),_0x3c9d56,'request\x20sent');logger[_0x7254('0xe')](_0x7254('0xf'),_0x3c9d56,_0x7254('0x10'),JSON['stringify'](_0x419670));if(_0x419670[_0x7254('0x11')]){if(_0x419670[_0x7254('0x11')][_0x7254('0x12')]===0x1f4){logger[_0x7254('0x11')](_0x7254('0xd'),_0x3c9d56,_0x419670[_0x7254('0x11')]['message']);return _0x15894e(_0x419670[_0x7254('0x11')][_0x7254('0x13')]);}logger[_0x7254('0x11')](_0x7254('0xd'),_0x3c9d56,_0x419670[_0x7254('0x11')][_0x7254('0x13')]);return _0x3df4f4(_0x419670[_0x7254('0x11')][_0x7254('0x13')]);}else{logger[_0x7254('0xc')](_0x7254('0xd'),_0x3c9d56,_0x7254('0x10'));_0x3df4f4(_0x419670[_0x7254('0x14')]['message']);}})[_0x7254('0x15')](function(_0x510bca){logger[_0x7254('0x11')](_0x7254('0xd'),_0x3c9d56,_0x510bca);_0x15894e(_0x510bca);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 648820a..373d6cc 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 _0x1d7e=['multer','express','Router','../../components/auth/service','./userProfile.controller','get','isAuthenticated','index','/describe','show','/:id/resources','post','create','/:id/clone','clone','/:id/sections','addSections','addResources','put','/:id','delete','destroy','removeSections','removeResources','exports'];(function(_0x2472f3,_0x42952d){var _0x5a6f54=function(_0x253b8b){while(--_0x253b8b){_0x2472f3['push'](_0x2472f3['shift']());}};_0x5a6f54(++_0x42952d);}(_0x1d7e,0x1f4));var _0xe1d7=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x1d7e[_0x50007c];return _0x5c1ec7;};'use strict';var multer=require(_0xe1d7('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe1d7('0x1'));var router=express[_0xe1d7('0x2')]();var auth=require(_0xe1d7('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe1d7('0x4'));router[_0xe1d7('0x5')]('/',auth[_0xe1d7('0x6')](),controller[_0xe1d7('0x7')]);router[_0xe1d7('0x5')](_0xe1d7('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0xe1d7('0x5')]('/:id',auth[_0xe1d7('0x6')](),controller[_0xe1d7('0x9')]);router[_0xe1d7('0x5')]('/:id/sections',auth[_0xe1d7('0x6')](),controller['getSections']);router[_0xe1d7('0x5')](_0xe1d7('0xa'),auth[_0xe1d7('0x6')](),controller['getResources']);router[_0xe1d7('0xb')]('/',auth[_0xe1d7('0x6')](),controller[_0xe1d7('0xc')]);router['post'](_0xe1d7('0xd'),auth['isAuthenticated'](),controller[_0xe1d7('0xe')]);router['post'](_0xe1d7('0xf'),auth['isAuthenticated'](),controller[_0xe1d7('0x10')]);router['post'](_0xe1d7('0xa'),auth[_0xe1d7('0x6')](),controller[_0xe1d7('0x11')]);router[_0xe1d7('0x12')](_0xe1d7('0x13'),auth['isAuthenticated'](),controller['update']);router[_0xe1d7('0x14')]('/:id',auth[_0xe1d7('0x6')](),controller[_0xe1d7('0x15')]);router[_0xe1d7('0x14')](_0xe1d7('0xf'),auth[_0xe1d7('0x6')](),controller[_0xe1d7('0x16')]);router[_0xe1d7('0x14')](_0xe1d7('0xa'),auth[_0xe1d7('0x6')](),controller[_0xe1d7('0x17')]);module[_0xe1d7('0x18')]=router; \ No newline at end of file +var _0x6cf9=['removeSections','removeResources','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','show','getSections','/:id/resources','post','/:id/clone','clone','addSections','addResources','put','/:id','update','delete','destroy','/:id/sections'];(function(_0x4624c4,_0x2620c9){var _0x3c0d60=function(_0x18abbe){while(--_0x18abbe){_0x4624c4['push'](_0x4624c4['shift']());}};_0x3c0d60(++_0x2620c9);}(_0x6cf9,0x8f));var _0x96cf=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x6cf9[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0x96cf('0x0'));var util=require(_0x96cf('0x1'));var path=require('path');var timeout=require(_0x96cf('0x2'));var express=require(_0x96cf('0x3'));var router=express['Router']();var auth=require(_0x96cf('0x4'));var interaction=require(_0x96cf('0x5'));var config=require(_0x96cf('0x6'));var controller=require('./userProfile.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x96cf('0x7')]);router[_0x96cf('0x8')](_0x96cf('0x9'),auth[_0x96cf('0xa')](),controller['describe']);router[_0x96cf('0x8')]('/:id',auth[_0x96cf('0xa')](),controller[_0x96cf('0xb')]);router[_0x96cf('0x8')]('/:id/sections',auth[_0x96cf('0xa')](),controller[_0x96cf('0xc')]);router['get'](_0x96cf('0xd'),auth['isAuthenticated'](),controller['getResources']);router[_0x96cf('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x96cf('0xe')](_0x96cf('0xf'),auth[_0x96cf('0xa')](),controller[_0x96cf('0x10')]);router[_0x96cf('0xe')]('/:id/sections',auth[_0x96cf('0xa')](),controller[_0x96cf('0x11')]);router[_0x96cf('0xe')](_0x96cf('0xd'),auth[_0x96cf('0xa')](),controller[_0x96cf('0x12')]);router[_0x96cf('0x13')](_0x96cf('0x14'),auth[_0x96cf('0xa')](),controller[_0x96cf('0x15')]);router[_0x96cf('0x16')]('/:id',auth[_0x96cf('0xa')](),controller[_0x96cf('0x17')]);router[_0x96cf('0x16')](_0x96cf('0x18'),auth[_0x96cf('0xa')](),controller[_0x96cf('0x19')]);router[_0x96cf('0x16')](_0x96cf('0xd'),auth[_0x96cf('0xa')](),controller[_0x96cf('0x1a')]);module[_0x96cf('0x1b')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 267a4ae..9041b43 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 _0x590a=['join','getDataValue','crudPermissions','exports','STRING','name'];(function(_0x44f0c1,_0x38a68f){var _0x12d335=function(_0x119b49){while(--_0x119b49){_0x44f0c1['push'](_0x44f0c1['shift']());}};_0x12d335(++_0x38a68f);}(_0x590a,0x159));var _0xa590=function(_0x15eafd,_0x46ba79){_0x15eafd=_0x15eafd-0x0;var _0x5a89ce=_0x590a[_0x15eafd];return _0x5a89ce;};'use strict';var Sequelize=require('sequelize');module[_0xa590('0x0')]={'name':{'type':Sequelize[_0xa590('0x1')],'allowNull':![],'unique':_0xa590('0x2')},'crudPermissions':{'type':Sequelize[_0xa590('0x1')],'set':function(_0x379aed){this['setDataValue']('crudPermissions',_0x379aed?_0x379aed[_0xa590('0x3')](''):[]);},'get':function(){return this[_0xa590('0x4')](_0xa590('0x5'))?this['getDataValue'](_0xa590('0x5'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xa590('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x1808=['getDataValue','split','sequelize','exports','name','STRING','crudPermissions','join'];(function(_0x417d51,_0x372986){var _0x2ae3a1=function(_0x1c0ae6){while(--_0x1c0ae6){_0x417d51['push'](_0x417d51['shift']());}};_0x2ae3a1(++_0x372986);}(_0x1808,0xe2));var _0x8180=function(_0x452ac2,_0x45f034){_0x452ac2=_0x452ac2-0x0;var _0x5a589a=_0x1808[_0x452ac2];return _0x5a589a;};'use strict';var Sequelize=require(_0x8180('0x0'));module[_0x8180('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8180('0x2')},'crudPermissions':{'type':Sequelize[_0x8180('0x3')],'set':function(_0x48ef84){this['setDataValue'](_0x8180('0x4'),_0x48ef84?_0x48ef84[_0x8180('0x5')](''):[]);},'get':function(){return this[_0x8180('0x6')](_0x8180('0x4'))?this[_0x8180('0x6')]('crudPermissions')[_0x8180('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x8180('0x3')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 3b0c29b..27efd47 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 _0x3891=['VoiceMail','voicerecordings','VoiceRecording','Agents','User','role','agent','Telephones','membername','telephone','VoiceQueues','queue','inbound','QueueCampaigns','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','MailQueue','mailaccounts','MailAccount','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','teams','voicequeues','queuecampaigns','users','telephones','Users','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','DeskAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','Interval','pauses','scheduler','Schedule','sounds','Sound','tags','templates','triggers','Trigger','trunks','Trunk','variables','plugins','extractedreports','Reports','metrics','AnalyticMetric','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','count','offset','limit','set','reject','save','destroy','error','name','index','map','UserProfile','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','nolimit','sort','where','VIRTUAL','filter','merge','options','then','includeAll','include','findAll','rows','catch','show','params','length','find','create','clone','get','omit','createdAt','crudPermissions','body','updatedAt','sequelize','each','autoAssociation','sectionId','UserProfileSection','UserProfileResource','Resources','update','describe','addSections','userProfileId','push','removeSections','ids','getSections','enabled','isEmpty','includes','subsections','findOne','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','section','undefined','Sequelize','Unknown\x20section','mergeResources','childModel','ValidationError','Invalid\x20section\x20\x27','parentSections','all','ignore','union','hasOwnProperty','pick','field','AnalyticExtractedReport','associatedResources','reportType','default','reportId','DefaultReports','custom','CustomReports','Tag','Tags','color','tag','value','toLowerCase','odbc','SquareOdbc','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','CmList','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','inboundroutes','VoiceExtension','VoiceContext','voicemails'];(function(_0x54d4fa,_0x3f2dff){var _0x4a8f19=function(_0x573df8){while(--_0x573df8){_0x54d4fa['push'](_0x54d4fa['shift']());}};_0x4a8f19(++_0x3f2dff);}(_0x3891,0x132));var _0x1389=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x3891[_0x4b7895];return _0x264180;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1389('0x0'));var rimraf=require(_0x1389('0x1'));var zipdir=require(_0x1389('0x2'));var jsonpatch=require(_0x1389('0x3'));var rp=require(_0x1389('0x4'));var moment=require(_0x1389('0x5'));var BPromise=require(_0x1389('0x6'));var Mustache=require(_0x1389('0x7'));var util=require('util');var path=require(_0x1389('0x8'));var sox=require(_0x1389('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x1389('0xa'));var squel=require(_0x1389('0xb'));var crypto=require('crypto');var jsforce=require(_0x1389('0xc'));var deskjs=require(_0x1389('0xd'));var toCsv=require(_0x1389('0xe'));var querystring=require(_0x1389('0xf'));var Papa=require(_0x1389('0x10'));var Redis=require(_0x1389('0x11'));var authService=require(_0x1389('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1389('0x13'));var hardwareService=require(_0x1389('0x14'));var logger=require(_0x1389('0x15'))(_0x1389('0x16'));var utils=require(_0x1389('0x17'));var config=require('../../config/environment');var db=require(_0x1389('0x18'))['db'];config[_0x1389('0x19')]=_['defaults'](config[_0x1389('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x1389('0x1a'))(new Redis(config[_0x1389('0x19')]));require(_0x1389('0x1b'))[_0x1389('0x1c')](socket);function respondWithStatusCode(_0x11cff4,_0x5b6cbb){_0x5b6cbb=_0x5b6cbb||0xcc;return function(_0x129788){if(_0x129788){return _0x11cff4[_0x1389('0x1d')](_0x5b6cbb);}return _0x11cff4[_0x1389('0x1e')](_0x5b6cbb)[_0x1389('0x1f')]();};}function respondWithResult(_0x105cd9,_0x1ecd6d){_0x1ecd6d=_0x1ecd6d||0xc8;return function(_0x4a8da4){if(_0x4a8da4){return _0x105cd9[_0x1389('0x1e')](_0x1ecd6d)[_0x1389('0x20')](_0x4a8da4);}};}function respondWithFilteredResult(_0x41bd5e,_0xbcf125){return function(_0x83f00d){if(_0x83f00d){var _0x2af6b3=_0x83f00d[_0x1389('0x21')],_0x27e63c=_0xbcf125[_0x1389('0x22')],_0x10d44e=_0xbcf125[_0x1389('0x22')]+_0xbcf125[_0x1389('0x23')],_0x1bb8ee;if(_0x10d44e>=_0x2af6b3){_0x10d44e=_0x2af6b3;_0x1bb8ee=0xc8;}else{_0x1bb8ee=0xce;}_0x41bd5e[_0x1389('0x1e')](_0x1bb8ee);return _0x41bd5e[_0x1389('0x24')]('Content-Range',_0x27e63c+'-'+_0x10d44e+'/'+_0x2af6b3)[_0x1389('0x20')](_0x83f00d);}return null;};}function patchUpdates(_0x44b92a){return function(_0x2ed65a){try{jsonpatch['apply'](_0x2ed65a,_0x44b92a,!![]);}catch(_0x333359){return BPromise[_0x1389('0x25')](_0x333359);}return _0x2ed65a[_0x1389('0x26')]();};}function saveUpdates(_0x528653,_0x36863b){return function(_0x5ddf29){if(_0x5ddf29){return _0x5ddf29['update'](_0x528653)['then'](function(_0x138c7e){return _0x138c7e;});}return null;};}function removeEntity(_0x24637b,_0x569eda){return function(_0x48494b){if(_0x48494b){return _0x48494b[_0x1389('0x27')]()['then'](function(){_0x24637b[_0x1389('0x1e')](0xcc)[_0x1389('0x1f')]();});}};}function handleEntityNotFound(_0x51a706,_0x18578f){return function(_0x230d77){if(!_0x230d77){_0x51a706[_0x1389('0x1d')](0x194);}return _0x230d77;};}function handleError(_0xadd2f8,_0xe69fb1){_0xe69fb1=_0xe69fb1||0x1f4;return function(_0x43d588){logger[_0x1389('0x28')](_0x43d588['stack']);if(_0x43d588[_0x1389('0x29')]){delete _0x43d588[_0x1389('0x29')];}_0xadd2f8['status'](_0xe69fb1)['send'](_0x43d588);};}exports[_0x1389('0x2a')]=function(_0x35c053,_0x1a9e8c){var _0x216a62={},_0x3fbd04={},_0x50b500={'count':0x0,'rows':[]};var _0x4a5c96=_[_0x1389('0x2b')](db[_0x1389('0x2c')][_0x1389('0x2d')],function(_0xfb908d){return{'name':_0xfb908d[_0x1389('0x2e')],'type':_0xfb908d[_0x1389('0x2f')][_0x1389('0x30')]};});_0x3fbd04['model']=_[_0x1389('0x2b')](_0x4a5c96,'name');_0x3fbd04['query']=_[_0x1389('0x31')](_0x35c053[_0x1389('0x32')]);_0x3fbd04[_0x1389('0x33')]=_[_0x1389('0x34')](_0x3fbd04[_0x1389('0x35')],_0x3fbd04[_0x1389('0x32')]);_0x216a62[_0x1389('0x36')]=_[_0x1389('0x34')](_0x3fbd04[_0x1389('0x35')],qs[_0x1389('0x37')](_0x35c053[_0x1389('0x32')][_0x1389('0x37')]));_0x216a62['attributes']=_0x216a62[_0x1389('0x36')]['length']?_0x216a62[_0x1389('0x36')]:_0x3fbd04['model'];if(!_0x35c053[_0x1389('0x32')]['hasOwnProperty'](_0x1389('0x38'))){_0x216a62[_0x1389('0x23')]=qs[_0x1389('0x23')](_0x35c053['query']['limit']);_0x216a62[_0x1389('0x22')]=qs[_0x1389('0x22')](_0x35c053[_0x1389('0x32')][_0x1389('0x22')]);}_0x216a62['order']=qs['sort'](_0x35c053['query'][_0x1389('0x39')]);_0x216a62[_0x1389('0x3a')]=qs['filters'](_['pick'](_0x35c053[_0x1389('0x32')],_0x3fbd04[_0x1389('0x33')]));if(_0x35c053[_0x1389('0x32')]['filter']){_0x216a62[_0x1389('0x3a')]=_['merge'](_0x216a62[_0x1389('0x3a')],{'$or':_[_0x1389('0x2b')](_0x4a5c96,function(_0x23afc9){if(_0x23afc9[_0x1389('0x2f')]!==_0x1389('0x3b')){var _0x2fa401={};_0x2fa401[_0x23afc9[_0x1389('0x29')]]={'$like':'%'+_0x35c053['query'][_0x1389('0x3c')]+'%'};return _0x2fa401;}})});}_0x216a62=_[_0x1389('0x3d')]({},_0x216a62,_0x35c053[_0x1389('0x3e')]);var _0x2a8e33={'where':_0x216a62[_0x1389('0x3a')]};return db[_0x1389('0x2c')][_0x1389('0x21')](_0x2a8e33)[_0x1389('0x3f')](function(_0x5df425){_0x50b500[_0x1389('0x21')]=_0x5df425;if(_0x35c053[_0x1389('0x32')][_0x1389('0x40')]){_0x216a62[_0x1389('0x41')]=[{'all':!![]}];}return db[_0x1389('0x2c')][_0x1389('0x42')](_0x216a62);})[_0x1389('0x3f')](function(_0xc2c537){_0x50b500[_0x1389('0x43')]=_0xc2c537;return _0x50b500;})[_0x1389('0x3f')](respondWithFilteredResult(_0x1a9e8c,_0x216a62))[_0x1389('0x44')](handleError(_0x1a9e8c,null));};exports[_0x1389('0x45')]=function(_0x132c70,_0x259ef4){var _0x1157a0={'raw':![],'where':{'id':_0x132c70[_0x1389('0x46')]['id']}},_0x146595={};_0x146595[_0x1389('0x35')]=_['keys'](db['UserProfile'][_0x1389('0x2d')]);_0x146595[_0x1389('0x32')]=_['keys'](_0x132c70[_0x1389('0x32')]);_0x146595[_0x1389('0x33')]=_[_0x1389('0x34')](_0x146595[_0x1389('0x35')],_0x146595[_0x1389('0x32')]);_0x1157a0[_0x1389('0x36')]=_[_0x1389('0x34')](_0x146595[_0x1389('0x35')],qs[_0x1389('0x37')](_0x132c70[_0x1389('0x32')][_0x1389('0x37')]));_0x1157a0['attributes']=_0x1157a0['attributes'][_0x1389('0x47')]?_0x1157a0[_0x1389('0x36')]:_0x146595[_0x1389('0x35')];if(_0x132c70[_0x1389('0x32')][_0x1389('0x40')]){_0x1157a0[_0x1389('0x41')]=[{'all':!![]}];}_0x1157a0=_['merge']({},_0x1157a0,_0x132c70[_0x1389('0x3e')]);return db[_0x1389('0x2c')][_0x1389('0x48')](_0x1157a0)[_0x1389('0x3f')](handleEntityNotFound(_0x259ef4,null))['then'](respondWithResult(_0x259ef4,null))[_0x1389('0x44')](handleError(_0x259ef4,null));};exports[_0x1389('0x49')]=function(_0x29d3fe,_0x4de941){return db[_0x1389('0x2c')][_0x1389('0x49')](_0x29d3fe['body'],{})[_0x1389('0x3f')](respondWithResult(_0x4de941,0xc9))[_0x1389('0x44')](handleError(_0x4de941,null));};exports[_0x1389('0x4a')]=function(_0x198cf3,_0x3ccf0d){var _0x5220af={'where':{'id':_0x198cf3[_0x1389('0x46')]['id']}},_0x3af7e4={};_0x3af7e4[_0x1389('0x35')]=_[_0x1389('0x31')](db['UserProfile']['rawAttributes']);_0x5220af[_0x1389('0x36')]=_[_0x1389('0x34')](_0x3af7e4[_0x1389('0x35')],qs[_0x1389('0x37')](_0x198cf3['query'][_0x1389('0x37')]));_0x5220af['attributes']=_0x5220af[_0x1389('0x36')][_0x1389('0x47')]?_0x5220af[_0x1389('0x36')]:_0x3af7e4[_0x1389('0x35')];if(_0x198cf3['query'][_0x1389('0x40')]){_0x5220af['include']=[{'all':!![]}];}_0x5220af=_[_0x1389('0x3d')]({},_0x5220af,_0x198cf3[_0x1389('0x3e')]);return db[_0x1389('0x2c')][_0x1389('0x48')](_0x5220af)[_0x1389('0x3f')](handleEntityNotFound(_0x3ccf0d,null))['then'](function(_0x2ea9e5){if(_0x2ea9e5){var _0x4716ea=_0x2ea9e5[_0x1389('0x4b')]({'plain':!![]});_0x4716ea=qs[_0x1389('0x4c')](_0x4716ea,['id',_0x1389('0x4d'),'updatedAt',_0x1389('0x4e')]);_0x198cf3[_0x1389('0x4f')]=_[_0x1389('0x4c')](_0x198cf3[_0x1389('0x4f')],['id',_0x1389('0x4d'),_0x1389('0x50')]);return db[_0x1389('0x51')]['transaction'](function(_0x10aacd){return db['UserProfile']['create'](_['merge'](_0x4716ea,_0x198cf3['body']),{'include':_0x198cf3[_0x1389('0x32')][_0x1389('0x40')]?[{'all':!![]}]:undefined,'transaction':_0x10aacd})['then'](function(_0x1617ac){var _0x59fd3c=_0x1617ac[_0x1389('0x4b')]({'plain':!![]});return db['UserProfileSection'][_0x1389('0x42')]({'where':{'userProfileId':_0x198cf3[_0x1389('0x46')]['id']},'raw':!![]})[_0x1389('0x3f')](function(_0x421ac8){if(_0x421ac8){return BPromise[_0x1389('0x52')](_0x421ac8,function(_0x5d0a44){return new BPromise(function(_0x215002,_0x251087){if(_0x5d0a44[_0x1389('0x53')]===null||_0x5d0a44['autoAssociation']===0x1)_0x215002(null);return db['UserProfileResource'][_0x1389('0x42')]({'where':{'sectionId':_0x5d0a44['id']},'raw':!![]})['then'](function(_0x5ac460){var _0x33ac03=_[_0x1389('0x2b')](_0x5ac460,function(_0x4d03d4){return qs[_0x1389('0x4c')](_0x4d03d4,['id',_0x1389('0x4d'),_0x1389('0x50'),_0x1389('0x54')]);});_0x215002(_0x33ac03);})[_0x1389('0x44')](function(_0x21e26a){_0x251087(_0x21e26a);});})[_0x1389('0x3f')](function(_0x4cad04){var _0x556e86=qs[_0x1389('0x4c')](_0x5d0a44,['id','createdAt',_0x1389('0x50')]);_0x556e86['userProfileId']=_0x59fd3c['id'];if(_0x4cad04)_0x556e86['Resources']=_0x4cad04;return _0x556e86;})[_0x1389('0x3f')](function(_0x5b24a6){return db[_0x1389('0x55')][_0x1389('0x49')](_0x5b24a6,{'include':[{'model':db[_0x1389('0x56')],'as':_0x1389('0x57')}],'raw':!![],'transaction':_0x10aacd});});})[_0x1389('0x3f')](function(){return _0x59fd3c;});}});});});}})[_0x1389('0x3f')](respondWithResult(_0x3ccf0d,0xc9))[_0x1389('0x44')](handleError(_0x3ccf0d,null));};exports[_0x1389('0x58')]=function(_0x4e8834,_0x461c41){if(_0x4e8834['body']['id']){delete _0x4e8834['body']['id'];}return db['UserProfile']['find']({'where':{'id':_0x4e8834[_0x1389('0x46')]['id']}})['then'](handleEntityNotFound(_0x461c41,null))[_0x1389('0x3f')](saveUpdates(_0x4e8834['body'],null))[_0x1389('0x3f')](respondWithResult(_0x461c41,null))[_0x1389('0x44')](handleError(_0x461c41,null));};exports[_0x1389('0x27')]=function(_0x3bc1b5,_0x25b207){return db[_0x1389('0x2c')][_0x1389('0x48')]({'where':{'id':_0x3bc1b5[_0x1389('0x46')]['id']}})[_0x1389('0x3f')](handleEntityNotFound(_0x25b207,null))[_0x1389('0x3f')](removeEntity(_0x25b207,null))[_0x1389('0x44')](handleError(_0x25b207,null));};exports[_0x1389('0x59')]=function(_0x690eab,_0x49dffe){return db[_0x1389('0x2c')][_0x1389('0x59')]()[_0x1389('0x3f')](respondWithResult(_0x49dffe,null))[_0x1389('0x44')](handleError(_0x49dffe,null));};exports[_0x1389('0x5a')]=function(_0xc538b9,_0x3d0866){var _0x5e018b=_0xc538b9[_0x1389('0x4f')];return db['UserProfile']['find']({'where':{'id':_0xc538b9[_0x1389('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d0866,null))['then'](function(_0x2c028a){if(_0x2c028a){return db['sequelize']['transaction'](function(_0x5b9dd5){return db[_0x1389('0x55')][_0x1389('0x27')]({'where':{'userProfileId':_0xc538b9['params']['id'],'sectionId':_[_0x1389('0x2b')](_0x5e018b,function(_0x428cb2){return _0x428cb2[_0x1389('0x54')];})},'transaction':_0x5b9dd5})[_0x1389('0x3f')](function(){var _0x4cecd3=_['map'](_0x5e018b,function(_0x3551d2){_0x3551d2[_0x1389('0x5b')]=_0xc538b9[_0x1389('0x46')]['id'];return _0x3551d2;});var _0x55965b=[];return BPromise[_0x1389('0x52')](_0x4cecd3,function(_0x3417bb){return db[_0x1389('0x55')][_0x1389('0x49')](_0x3417bb,{'include':[{'model':db[_0x1389('0x56')],'as':_0x1389('0x57')}],'raw':!![],'transaction':_0x5b9dd5})['then'](function(_0x5334f3){_0x55965b[_0x1389('0x5c')](_0x5334f3[_0x1389('0x4b')]({'plain':!![]}));});})['then'](function(){return _0x55965b;});});});}})[_0x1389('0x3f')](function(_0x2d43ac){return _0x2d43ac;})[_0x1389('0x3f')](respondWithResult(_0x3d0866,null))[_0x1389('0x44')](handleError(_0x3d0866,null));};exports[_0x1389('0x5d')]=function(_0x32e3a2,_0x55e942){var _0x5dd779;return db['UserProfile'][_0x1389('0x48')]({'where':{'id':_0x32e3a2[_0x1389('0x46')]['id']},'attributes':['id','name']})[_0x1389('0x3f')](handleEntityNotFound(_0x55e942,null))[_0x1389('0x3f')](function(_0x38b377){if(_0x38b377){_0x5dd779=_0x38b377;return db[_0x1389('0x55')][_0x1389('0x27')]({'where':{'userProfileId':_0x32e3a2[_0x1389('0x46')]['id'],'sectionId':_0x32e3a2['query'][_0x1389('0x5e')]}});}})[_0x1389('0x3f')](function(){return _0x5dd779;})[_0x1389('0x3f')](respondWithStatusCode(_0x55e942,null))['catch'](handleError(_0x55e942,null));};exports[_0x1389('0x5f')]=function(_0xe11b53,_0x5f3ad4){var _0x251787=[];var _0x3664c2=[];return db[_0x1389('0x55')][_0x1389('0x42')]({'where':{'userProfileId':_0xe11b53['params']['id']},'raw':!![]})[_0x1389('0x3f')](function(_0x559f9c){_0x251787=_[_0x1389('0x3c')](_0x559f9c,function(_0x26293c){return _0x26293c[_0x1389('0x60')]===0x1||_['includes']([0x3eb,0x709],_0x26293c[_0x1389('0x54')]);});if(!_[_0x1389('0x61')](_0x251787)){return _[_0x1389('0x2b')](_0x251787,function(_0x303227){return _0x303227['sectionId'];});}else{return;}})[_0x1389('0x3f')](function(_0x5d79f7){if(_0x5d79f7)_0x3664c2=_0x5d79f7;if(_[_0x1389('0x62')](_0x3664c2,0x64)){var _0x3e0d11=_[_0x1389('0x48')](_0x251787,{'sectionId':0x64});return hasDefaultDashboard(_0x3e0d11)['then'](function(_0x1602a1){return _[_0x1389('0x2b')](_0x251787,function(_0xcaf6f3){if(_0xcaf6f3['sectionId']===0x64){_0xcaf6f3[_0x1389('0x63')]=_0x1602a1;}return _0xcaf6f3;});});}else{return;}})[_0x1389('0x3f')](function(_0x208fbb){if(_0x208fbb)_0x251787=_0x208fbb;if(_[_0x1389('0x62')](_0x3664c2,0x3eb)){var _0x1b30e8=_[_0x1389('0x48')](_0x251787,{'sectionId':0x3eb});return getCustomDashboards(_0x1b30e8)[_0x1389('0x3f')](function(_0x4b037f){return _[_0x1389('0x2b')](_0x251787,function(_0x51ca74){if(_0x1b30e8['enabled']){if(_0x51ca74[_0x1389('0x54')]===0x3eb){_0x51ca74[_0x1389('0x63')]=_0x4b037f;}}else{if(_0x51ca74[_0x1389('0x54')]===0x64){_0x51ca74[_0x1389('0x63')]=_0x4b037f;}}return _0x51ca74;});});}else{return;}})[_0x1389('0x3f')](function(_0xbcf2a4){if(_0xbcf2a4)_0x251787=_0xbcf2a4;if(_[_0x1389('0x62')](_0x3664c2,0x709)){var _0x5195d5=_[_0x1389('0x48')](_0x251787,{'sectionId':0x709});return getPlugins(_0x5195d5)[_0x1389('0x3f')](function(_0x553ef2){if(_0x5195d5[_0x1389('0x60')]){return _['map'](_0x251787,function(_0x578289){if(_0x578289['sectionId']===0x709){_0x578289[_0x1389('0x63')]=_0x553ef2;}return _0x578289;});}else{var _0xc30405={'sectionId':0x76c,'enabled':0x1,'subsections':_0x553ef2};var _0x2a99c3=_[_0x1389('0x2b')](_0x251787);_0x2a99c3[_0x1389('0x5c')](_0xc30405);return _0x2a99c3;}});}else{return;}})[_0x1389('0x3f')](function(_0x99589c){if(_0x99589c)_0x251787=_0x99589c;return _[_0x1389('0x3c')](_0x251787,[_0x1389('0x60'),0x1]);})['then'](respondWithResult(_0x5f3ad4,null))[_0x1389('0x44')](handleError(_0x5f3ad4,null));};function hasDefaultDashboard(_0x41dfbd){var _0x7cfad3=[0x65];return new BPromise(function(_0xc0792b,_0x532bdf){try{if(_0x41dfbd['autoAssociation']){_0xc0792b(_0x7cfad3);}else{return db[_0x1389('0x56')][_0x1389('0x64')]({'where':{'sectionId':_0x41dfbd['id']},'raw':!![]})[_0x1389('0x3f')](function(_0x38e9ee){_0x38e9ee?_0xc0792b(_0x7cfad3):_0xc0792b();});}}catch(_0x3df679){_0x532bdf(_0x3df679);}});}function getCustomDashboards(_0x539258){var _0x34ffc1=[];return new BPromise(function(_0x3c4163,_0xb97cf8){try{if(_0x539258[_0x1389('0x53')]){return db['Dashboard'][_0x1389('0x42')]({'raw':!![]})[_0x1389('0x3f')](function(_0x194c07){_0x194c07[_0x1389('0x65')](function(_0x501f50){_0x34ffc1[_0x1389('0x5c')](_0x501f50['id']+0x1869f);});_0x3c4163(_0x34ffc1);});}else{return db[_0x1389('0x56')][_0x1389('0x42')]({'where':{'sectionId':_0x539258['id']},'raw':!![]})['then'](function(_0x4eb49d){_0x4eb49d[_0x1389('0x65')](function(_0x517b35){_0x34ffc1['push'](_0x517b35[_0x1389('0x66')]+0x1869f);});_0x3c4163(_0x34ffc1);});}}catch(_0x70f410){_0xb97cf8(_0x70f410);}});}function getPlugins(_0x5cdfea){var _0x36205d=[];return new BPromise(function(_0x538c3a,_0x5dbb4a){try{if(_0x5cdfea[_0x1389('0x53')]){return db[_0x1389('0x67')][_0x1389('0x42')]({'raw':!![]})[_0x1389('0x3f')](function(_0x23d706){_0x23d706[_0x1389('0x65')](function(_0x50fc31){_0x36205d[_0x1389('0x5c')](_0x50fc31['id']+0x15b38);});_0x538c3a(_0x36205d);});}else{return db[_0x1389('0x56')][_0x1389('0x42')]({'where':{'sectionId':_0x5cdfea['id']},'raw':!![]})[_0x1389('0x3f')](function(_0x47fa22){_0x47fa22[_0x1389('0x65')](function(_0x450507){_0x36205d[_0x1389('0x5c')](_0x450507['resourceId']+0x15b38);});_0x538c3a(_0x36205d);});}}catch(_0x398270){_0x5dbb4a(_0x398270);}});}exports[_0x1389('0x68')]=function(_0x3d52ad,_0x4113ed){return db[_0x1389('0x2c')][_0x1389('0x48')]({'where':{'id':_0x3d52ad[_0x1389('0x46')]['id']}})['then'](handleEntityNotFound(_0x4113ed,null))[_0x1389('0x3f')](function(_0x35b085){if(_0x35b085){return db[_0x1389('0x51')]['transaction'](function(_0x3edc37){return db['UserProfileSection'][_0x1389('0x42')]({'where':{'userProfileId':_0x3d52ad['params']['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x3c2c33){if(_0x3c2c33){return db[_0x1389('0x55')][_0x1389('0x27')]({'where':{'userProfileId':_0x3d52ad[_0x1389('0x46')]['id'],'id':_['map'](_0x3c2c33,function(_0x574bc0){return _0x574bc0['id'];})},'transaction':_0x3edc37});}})[_0x1389('0x3f')](function(_0x4d4797){var _0x37e6db=_[_0x1389('0x2b')](_0x3d52ad[_0x1389('0x4f')],function(_0x8c735b){_0x8c735b['userProfileId']=_0x3d52ad[_0x1389('0x46')]['id'];return _0x8c735b;});return db[_0x1389('0x55')][_0x1389('0x69')](_0x37e6db,{'raw':!![],'transaction':_0x3edc37});})[_0x1389('0x3f')](function(_0x52e21a){var _0x4f4137=_[_0x1389('0x3c')](_[_0x1389('0x2b')](_0x52e21a,function(_0x4c85a0){return _0x4c85a0[_0x1389('0x4b')]({'plain':!![]});}),{'includeAll':![]});if(_0x4f4137){return db[_0x1389('0x55')][_0x1389('0x42')]({'where':{'userProfileId':_0x3d52ad[_0x1389('0x46')]['id'],'sectionId':_[_0x1389('0x2b')](_0x4f4137,function(_0x5a3f2c){return _0x5a3f2c[_0x1389('0x54')];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0x350425){var _0x117e5a=_['map'](_0x3d52ad['body'],function(_0x1e767e){_0x1e767e[_0x1389('0x5b')]=_0x3d52ad[_0x1389('0x46')]['id'];return _0x1e767e;});return db[_0x1389('0x56')]['bulkCreate'](_0x117e5a,{'raw':!![],'transaction':_0x3edc37});});}})['catch'](handleError(_0x4113ed,null));});}})[_0x1389('0x3f')](function(_0x76f88f){var _0x35d419=_[_0x1389('0x2b')](_0x76f88f,function(_0x2365df){return _0x2365df['get']({'plain':!![]});});})['then'](respondWithResult(_0x4113ed,null))['catch'](handleError(_0x4113ed,null));};exports[_0x1389('0x6a')]=function(_0x20aaec,_0x562ebf,_0x18ed10){return db[_0x1389('0x2c')]['find']({'where':{'id':_0x20aaec[_0x1389('0x46')]['id']}})[_0x1389('0x3f')](handleEntityNotFound(_0x562ebf,null))['then'](function(_0x1d3421){if(_0x1d3421){return _0x1d3421[_0x1389('0x6a')](_0x20aaec[_0x1389('0x32')][_0x1389('0x5e')]);}})[_0x1389('0x3f')](respondWithStatusCode(_0x562ebf,null))[_0x1389('0x44')](handleError(_0x562ebf,null));};exports['getResources']=function(_0x1b6d30,_0x4778a4){var _0x5cadef={'raw':![],'where':{}};var _0x335dbe={};var _0x12d8cf={'count':0x0,'rows':[]};var _0x262f19=_0x1b6d30[_0x1389('0x32')][_0x1389('0x6b')];if(typeof _0x262f19===_0x1389('0x6c')){throw new db[(_0x1389('0x6d'))]['ValidationError'](_0x1389('0x6e'));}var _0xf51a79=_0x1b6d30[_0x1389('0x32')][_0x1389('0x6f')]||![];var _0x58da34=getQueryModels(_0x262f19,_0xf51a79);if(typeof _0x58da34[_0x1389('0x70')]===_0x1389('0x6c')){throw new db[(_0x1389('0x6d'))][(_0x1389('0x71'))](_0x1389('0x72')+_0x262f19+'\x27');}var _0x6077f5=[];if(!_['isEmpty'](_0x58da34[_0x1389('0x73')])){_0x6077f5=_0x58da34['parentSections'];}else{_0x6077f5=[{'name':_0x262f19}];}return db['UserProfile'][_0x1389('0x64')]({'where':{'id':_0x1b6d30[_0x1389('0x46')]['id']}})[_0x1389('0x3f')](handleEntityNotFound(_0x4778a4,null))['then'](function(_0x50bda8){if(_0x50bda8){var _0x490894=[];for(var _0x291fc8=0x0;_0x291fc8<_0x6077f5['length'];_0x291fc8++){_0x490894[_0x1389('0x5c')](db[_0x1389('0x55')]['findOne']({'where':{'userProfileId':_0x50bda8['id'],'name':_0x6077f5[_0x291fc8][_0x1389('0x29')]},'raw':!![]}));}return BPromise[_0x1389('0x74')](_0x490894);}})[_0x1389('0x3f')](function(_0x2aef1a){var _0x2ecaf8=_['filter'](_0x2aef1a,function(_0xf4cf33){return _0xf4cf33?_0xf4cf33:undefined;});var _0x5d8112=_[_0x1389('0x3c')](_0x6077f5,[_0x1389('0x75'),!![]]);var _0x9c75b3=_[_0x1389('0x61')](_0x2ecaf8)&&_['isEmpty'](_0x5d8112)?null:_[_0x1389('0x76')](_0x5d8112,_0x2ecaf8);if(_0x9c75b3){var _0x5f23ff=[];for(var _0x31ac4c=0x0;_0x31ac4c<_0x9c75b3[_0x1389('0x47')];_0x31ac4c++){var _0x2641a6=_[_0x1389('0x48')](_0x6077f5,function(_0x48306e){return _0x9c75b3[_0x31ac4c]?_0x48306e[_0x1389('0x29')]===_0x9c75b3[_0x31ac4c][_0x1389('0x29')]:null;});if(_0x2641a6){if(_0x9c75b3[_0x31ac4c][_0x1389('0x75')]){_0x5f23ff[_0x1389('0x5c')](getAllResources(_0x58da34[_0x1389('0x70')],_0x9c75b3[_0x31ac4c]));}else{if(!_0x9c75b3[_0x31ac4c][_0x1389('0x53')]){_0x5f23ff[_0x1389('0x5c')](getAllowedResources(_0x2641a6,_0x9c75b3[_0x31ac4c],_0x58da34[_0x1389('0x70')]));}else{if(_0x2641a6[_0x1389('0x35')]){_0x5f23ff['push'](getAllFilteredResources(_0x2641a6,_0x9c75b3[_0x31ac4c]));}}}}}return BPromise['all'](_0x5f23ff);}else{return null;}})[_0x1389('0x3f')](function(_0x432bf8){var _0xff6ff6=_0x432bf8;var _0x3e5b42=null;if(_0xff6ff6){_0x3e5b42=_0xff6ff6['length']===0x1?_0xff6ff6[0x0]:null;}if(_0x3e5b42||_0xff6ff6){var _0x462a42=db[_0x58da34[_0x1389('0x70')]][_0x1389('0x2d')];_0x335dbe[_0x1389('0x35')]=_['keys'](_0x462a42);_0x335dbe[_0x1389('0x32')]=_[_0x1389('0x31')](_0x1b6d30[_0x1389('0x32')]);_0x335dbe[_0x1389('0x33')]=_[_0x1389('0x34')](_0x335dbe[_0x1389('0x35')],_0x335dbe[_0x1389('0x32')]);_0x5cadef[_0x1389('0x36')]=_['intersection'](_0x335dbe['model'],qs['fields'](_0x1b6d30[_0x1389('0x32')][_0x1389('0x37')]));_0x5cadef[_0x1389('0x36')]=_0x5cadef[_0x1389('0x36')][_0x1389('0x47')]?_0x5cadef[_0x1389('0x36')]:_0x335dbe['model'];if(!_0x1b6d30[_0x1389('0x32')][_0x1389('0x77')](_0x1389('0x38'))){_0x5cadef[_0x1389('0x23')]=qs[_0x1389('0x23')](_0x1b6d30[_0x1389('0x32')][_0x1389('0x23')]);_0x5cadef[_0x1389('0x22')]=qs[_0x1389('0x22')](_0x1b6d30[_0x1389('0x32')][_0x1389('0x22')]);}_0x5cadef['order']=qs['sort'](_0x1b6d30[_0x1389('0x32')][_0x1389('0x39')]);_0x5cadef[_0x1389('0x3a')]=qs['filters'](_[_0x1389('0x78')](_0x1b6d30[_0x1389('0x32')],_0x335dbe[_0x1389('0x33')]));if(_0x1b6d30[_0x1389('0x32')][_0x1389('0x3c')]){_0x5cadef[_0x1389('0x3a')]=_['merge'](_0x5cadef[_0x1389('0x3a')],{'$or':_[_0x1389('0x2b')](_0x462a42,function(_0xb14acd){if(_0xb14acd[_0x1389('0x2f')][_0x1389('0x30')]!=='VIRTUAL'){var _0x2aae81={};_0x2aae81[_0xb14acd['field']]={'$like':'%'+_0x1b6d30[_0x1389('0x32')][_0x1389('0x3c')]+'%'};return _0x2aae81;}})});}var _0x1381dc=[];if(_0x3e5b42){var _0x51b810=_[_0x1389('0x48')](_0x6077f5,['name',_0x3e5b42[_0x1389('0x29')]]);if(_0x51b810[_0x1389('0x79')]){var _0x1411d5={};if(_0x58da34['childModel']===_0x1389('0x7a')){_0x1411d5[_0x51b810['foreignKey']]=_[_0x1389('0x2b')](_0x3e5b42['associatedResources'],'id');}else{_0x1411d5[_0x51b810['foreignKey']]=_0x3e5b42['associatedResources'];}_0x1381dc[_0x1389('0x5c')](_0x1411d5);}else{_0x5cadef[_0x1389('0x3a')]['id']=_0x3e5b42[_0x1389('0x7b')];}}else{for(var _0x33dab8=0x0;_0x33dab8<_0xff6ff6[_0x1389('0x47')];_0x33dab8++){var _0x51b810=_[_0x1389('0x48')](_0x6077f5,[_0x1389('0x29'),_0xff6ff6[_0x33dab8][_0x1389('0x29')]]);if(_0x51b810[_0x1389('0x79')]){var _0x1411d5={};_0x1411d5[_0x51b810['foreignKey']]=_0xff6ff6[_0x33dab8][_0x1389('0x7b')];_0x1381dc[_0x1389('0x5c')](_0x1411d5);}else{if(!_0x5cadef[_0x1389('0x3a')]['id'])_0x5cadef['where']['id']=[];_0xff6ff6[_0x33dab8][_0x1389('0x7b')][_0x1389('0x65')](function(_0x527915){_0x5cadef[_0x1389('0x3a')]['id']['push'](_0x527915);});}}}if(!_[_0x1389('0x61')](_0x1381dc)){_0x5cadef['where']=_[_0x1389('0x3d')](_0x5cadef['where'],{'$and':{'$or':_0x1381dc}});}_0x5cadef=_[_0x1389('0x3d')]({},_0x5cadef,_0x1b6d30['options']);if(_0x3e5b42&&!_0x3e5b42[_0x1389('0x53')]&&_0x58da34[_0x1389('0x70')]==='AnalyticExtractedReport'){if(_0x1b6d30[_0x1389('0x32')][_0x1389('0x40')]){_0x5cadef[_0x1389('0x41')]=[{'all':!![]}];}return db[_0x58da34[_0x1389('0x70')]][_0x1389('0x42')](_0x5cadef)['then'](function(_0x23229b){var _0xea562=[];_0x23229b[_0x1389('0x65')](function(_0x5212a3){var _0x45e9e6;switch(_0x5212a3[_0x1389('0x7c')]){case _0x1389('0x7d'):_0x45e9e6=_[_0x1389('0x48')](_0x3e5b42[_0x1389('0x7b')],function(_0x10a3b8){return _0x10a3b8['id']===_0x5212a3[_0x1389('0x7e')]&&_0x10a3b8['type']===_0x1389('0x7f');});break;case _0x1389('0x80'):_0x45e9e6=_['find'](_0x3e5b42[_0x1389('0x7b')],function(_0x47d0bd){return _0x47d0bd['id']===_0x5212a3[_0x1389('0x7e')]&&_0x47d0bd[_0x1389('0x2f')]===_0x1389('0x81');});break;}if(_0x45e9e6)_0xea562[_0x1389('0x5c')](_0x5212a3);});_0x12d8cf[_0x1389('0x21')]=_0xea562[_0x1389('0x47')];_0x12d8cf[_0x1389('0x43')]=_0xea562;return _0x12d8cf;});}else{return db[_0x58da34[_0x1389('0x70')]][_0x1389('0x21')]({'where':_0x5cadef[_0x1389('0x3a')]})[_0x1389('0x3f')](function(_0x3bf7f8){_0x12d8cf['count']=_0x3bf7f8;if(_0x1b6d30[_0x1389('0x32')][_0x1389('0x40')]){if(_0x58da34['childModel']==='CmContact'){_0x5cadef[_0x1389('0x41')]=[{'model':db[_0x1389('0x82')],'as':_0x1389('0x83'),'attributes':['id',_0x1389('0x29'),_0x1389('0x84')],'required':_0x1b6d30[_0x1389('0x32')]['tag']?!![]:![]},{'model':db[_0x1389('0x82')],'as':'ThroughTags','attributes':['id','name',_0x1389('0x84')],'through':_0x1b6d30['query'][_0x1389('0x85')]?{'attributes':[],'where':{'TagId':_0x1b6d30[_0x1389('0x32')]['tag']||undefined}}:{},'required':_0x1b6d30[_0x1389('0x32')][_0x1389('0x85')]?!![]:![]}];}else{_0x5cadef[_0x1389('0x41')]=[{'all':!![]}];}}return db[_0x58da34[_0x1389('0x70')]][_0x1389('0x42')](_0x5cadef);})[_0x1389('0x3f')](function(_0x2b67bf){_0x12d8cf[_0x1389('0x43')]=_0x2b67bf;return _0x12d8cf;});}}else{return _0x12d8cf;}})[_0x1389('0x3f')](respondWithFilteredResult(_0x4778a4,_0x5cadef))[_0x1389('0x44')](handleError(_0x4778a4,null));};function getAllResources(_0x5660be,_0x41f0be){return new BPromise(function(_0x55487e,_0x7b6150){if(_0x41f0be){var _0x34c53e=_0x41f0be['filter']?{[_0x41f0be[_0x1389('0x3c')][_0x1389('0x79')]]:_0x41f0be[_0x1389('0x3c')][_0x1389('0x86')]}:undefined;return db[_0x5660be][_0x1389('0x42')]({'where':_0x34c53e,'raw':!![]})[_0x1389('0x3f')](function(_0x4d1f09){_0x41f0be['associatedResources']=_['map'](_0x4d1f09,'id');_0x55487e(_0x41f0be);})[_0x1389('0x44')](function(_0x4e7add){_0x7b6150(_0x4e7add);});}else{_0x55487e(null);}});}function getAllFilteredResources(_0x63e971,_0x2f194e){return new BPromise(function(_0x5e2ed2,_0x220297){var _0x21da6d=_0x63e971['filter']?{[_0x63e971['filter'][_0x1389('0x79')]]:_0x63e971[_0x1389('0x3c')][_0x1389('0x86')]}:undefined;return db[_0x63e971[_0x1389('0x35')]]['findAll']({'where':_0x21da6d,'raw':!![]})['then'](function(_0x5319de){_0x2f194e[_0x1389('0x7b')]=_['map'](_0x5319de,function(_0xaf805c){return _0xaf805c[_0x1389('0x29')];});_0x5e2ed2(_0x2f194e);})['catch'](function(_0x4626ae){_0x220297(_0x4626ae);});});}function getAllowedResources(_0x6f2670,_0x309cc8,_0x3ad849){return new BPromise(function(_0x1a6482,_0x105dab){if(_0x309cc8){return db[_0x1389('0x56')][_0x1389('0x42')]({'where':{'sectionId':_0x309cc8['id']},'raw':!![]})[_0x1389('0x3f')](function(_0x59c842){if(_0x6f2670['field']&&_0x6f2670[_0x1389('0x79')]!=='id'){_0x309cc8['associatedResources']=_['map'](_0x59c842,function(_0x5a5b50){return _0x5a5b50[_0x6f2670[_0x1389('0x79')]];});}else{if(_0x3ad849===_0x1389('0x7a')){_0x309cc8['associatedResources']=_['map'](_0x59c842,function(_0x267997){return{'id':_0x267997[_0x1389('0x66')],'type':_0x267997['type']};});}else{_0x309cc8[_0x1389('0x7b')]=_[_0x1389('0x2b')](_0x59c842,function(_0x433bd0){return _0x433bd0[_0x1389('0x66')];});}}_0x1a6482(_0x309cc8);})['catch'](function(_0x816510){_0x105dab(_0x816510);});}else{_0x1a6482(null);}});}function getQueryModels(_0x25866e,_0x1f75bf){var _0x526c77=_0x25866e[_0x1389('0x87')]();var _0xf32b0f={'childModel':undefined,'parentSections':[]};switch(_0x526c77){case'squareprojects':_0xf32b0f['childModel']='SquareProject';break;case _0x1389('0x88'):_0xf32b0f[_0x1389('0x70')]=_0x1389('0x89');break;case'squarerecordings':_0xf32b0f['childModel']=_0x1389('0x8a');_0xf32b0f[_0x1389('0x73')]=[{'name':_0x1389('0x8b'),'field':'name','foreignKey':_0x1389('0x8c')}];break;case _0x1389('0x8d'):_0xf32b0f[_0x1389('0x70')]=_0x1389('0x8e');break;case _0x1389('0x8f'):_0xf32b0f[_0x1389('0x70')]=_0x1389('0x90');_0xf32b0f[_0x1389('0x73')]=[{'name':_0x1389('0x91'),'field':'id','foreignKey':_0x1389('0x92')}];break;case'lists':_0xf32b0f[_0x1389('0x70')]=_0x1389('0x93');break;case'companies':_0xf32b0f[_0x1389('0x70')]='CmCompany';break;case'globalcustomfields':_0xf32b0f[_0x1389('0x70')]=_0x1389('0x94');break;case _0x1389('0x95'):_0xf32b0f['childModel']=_0x1389('0x96');break;case _0x1389('0x97'):_0xf32b0f['childModel']=_0x1389('0x98');break;case'faxqueues':_0xf32b0f[_0x1389('0x70')]=_0x1389('0x99');break;case _0x1389('0x9a'):_0xf32b0f[_0x1389('0x70')]=_0x1389('0x9b');break;case _0x1389('0x9c'):case'internalroutes':case'outboundroutes':_0xf32b0f['childModel']=_0x1389('0x9d');break;case'contexts':_0xf32b0f[_0x1389('0x70')]=_0x1389('0x9e');break;case _0x1389('0x9f'):_0xf32b0f[_0x1389('0x70')]=_0x1389('0xa0');break;case _0x1389('0xa1'):_0xf32b0f['childModel']=_0x1389('0xa2');_0xf32b0f[_0x1389('0x73')]=[{'name':_0x1389('0xa3'),'field':_0x1389('0x29'),'foreignKey':'membername','model':_0x1389('0xa4'),'filter':{'field':_0x1389('0xa5'),'value':[_0x1389('0xa6')]}},{'name':_0x1389('0xa7'),'field':_0x1389('0x29'),'foreignKey':_0x1389('0xa8'),'model':_0x1389('0xa4'),'filter':{'field':'role','value':[_0x1389('0xa9')]}},{'name':_0x1389('0xaa'),'field':'name','foreignKey':_0x1389('0xab'),'model':'VoiceQueue','filter':{'field':'type','value':[_0x1389('0xac')]}},{'name':_0x1389('0xad'),'field':_0x1389('0x29'),'foreignKey':'queue','model':_0x1389('0xae'),'filter':{'field':_0x1389('0x2f'),'value':[_0x1389('0xaf')]}}];break;case _0x1389('0xb0'):_0xf32b0f[_0x1389('0x70')]=_0x1389('0xb1');break;case _0x1389('0xb2'):_0xf32b0f[_0x1389('0x70')]=_0x1389('0xb3');break;case _0x1389('0xb4'):_0xf32b0f[_0x1389('0x70')]=_0x1389('0xb5');break;case'ivrcampaigns':_0xf32b0f['childModel']=_0x1389('0xb6');break;case'mailqueues':_0xf32b0f['childModel']=_0x1389('0xb7');break;case _0x1389('0xb8'):_0xf32b0f[_0x1389('0x70')]=_0x1389('0xb9');break;case'mailsubstatuses':_0xf32b0f[_0x1389('0x70')]='MailSubstatus';break;case _0x1389('0xba'):_0xf32b0f[_0x1389('0x70')]=_0x1389('0xbb');break;case _0x1389('0xbc'):_0xf32b0f[_0x1389('0x70')]=_0x1389('0xbd');break;case _0x1389('0xbe'):_0xf32b0f[_0x1389('0x70')]=_0x1389('0xbf');break;case _0x1389('0xc0'):_0xf32b0f[_0x1389('0x70')]=_0x1389('0xc1');break;case _0x1389('0xc2'):_0xf32b0f[_0x1389('0x70')]='Team';break;case _0x1389('0xc3'):case _0x1389('0xc4'):_0xf32b0f[_0x1389('0x70')]=_0x1389('0xae');if(_0x1f75bf){_0xf32b0f['parentSections']=[{'name':'VoiceQueues'},{'name':_0x1389('0xad')}];}break;case _0x1389('0xc5'):case'agents':case _0x1389('0xc6'):_0xf32b0f['childModel']=_0x1389('0xa4');if(_0x1f75bf){_0xf32b0f[_0x1389('0x73')]=[{'name':_0x1389('0xc7'),'filter':{'field':_0x1389('0xa5'),'value':[_0x1389('0xc8'),'user']},'ignore':!![]},{'name':_0x1389('0xa3')},{'name':_0x1389('0xa7')}];}break;case _0x1389('0xc9'):_0xf32b0f['childModel']=_0x1389('0xca');break;case _0x1389('0xcb'):_0xf32b0f[_0x1389('0x70')]='SalesforceAccount';break;case _0x1389('0xcc'):_0xf32b0f['childModel']=_0x1389('0xcd');break;case _0x1389('0xce'):_0xf32b0f['childModel']='SugarcrmAccount';break;case'deskaccounts':_0xf32b0f[_0x1389('0x70')]=_0x1389('0xcf');break;case'zohoaccounts':_0xf32b0f['childModel']='ZohoAccount';break;case _0x1389('0xd0'):_0xf32b0f[_0x1389('0x70')]=_0x1389('0xa4');break;case _0x1389('0xd1'):_0xf32b0f[_0x1389('0x70')]=_0x1389('0xd2');break;case _0x1389('0xd3'):_0xf32b0f[_0x1389('0x70')]=_0x1389('0xd4');break;case'customdashboards':_0xf32b0f['childModel']=_0x1389('0xd5');break;case _0x1389('0xd6'):_0xf32b0f[_0x1389('0x70')]=_0x1389('0xd7');break;case _0x1389('0xd8'):_0xf32b0f['childModel']='Pause';break;case _0x1389('0xd9'):_0xf32b0f[_0x1389('0x70')]=_0x1389('0xda');break;case _0x1389('0xdb'):_0xf32b0f[_0x1389('0x70')]=_0x1389('0xdc');break;case _0x1389('0xdd'):_0xf32b0f[_0x1389('0x70')]=_0x1389('0x82');break;case _0x1389('0xde'):_0xf32b0f['childModel']='Template';break;case _0x1389('0xdf'):_0xf32b0f['childModel']=_0x1389('0xe0');break;case _0x1389('0xe1'):_0xf32b0f['childModel']=_0x1389('0xe2');break;case _0x1389('0xe3'):_0xf32b0f[_0x1389('0x70')]='Variable';break;case _0x1389('0xe4'):_0xf32b0f[_0x1389('0x70')]=_0x1389('0x67');break;case _0x1389('0xe5'):_0xf32b0f['childModel']='AnalyticExtractedReport';_0xf32b0f[_0x1389('0x73')]=[{'name':_0x1389('0xe6'),'field':'id','foreignKey':_0x1389('0x7e')}];break;case _0x1389('0xe7'):_0xf32b0f[_0x1389('0x70')]=_0x1389('0xe8');break;default:return _0xf32b0f;}return _0xf32b0f;} \ No newline at end of file +var _0x04ed=['userProfileId','Resources','describe','each','push','ids','includes','sectionId','enabled','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','removeResources','getResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27','isEmpty','parentSections','all','ignore','hasOwnProperty','key','field','AnalyticExtractedReport','foreignKey','associatedResources','reportType','default','reportId','DefaultReports','custom','CustomReports','CmContact','Tags','tag','Tag','ThroughTags','color','value','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','Lists','ListId','CmList','companies','CmCompany','CmCustomField','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoicePrefix','ivrcampaigns','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','smsqueues','SmsQueue','smsaccounts','SmsAccount','teams','Team','voicequeues','queuecampaigns','users','telephones','Users','user','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Disposition','intervals','Interval','pauses','Pause','scheduler','sounds','Sound','tags','Template','Trigger','trunks','Trunk','variables','Variable','plugins','Reports','metrics','AnalyticMetric','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','sendStatus','status','json','offset','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','UserProfile','type','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','params','find','create','body','clone','rawAttributes','options','createdAt','crudPermissions','omit','updatedAt','sequelize','transaction','get','UserProfileSection','autoAssociation','UserProfileResource','catch'];(function(_0x193ddf,_0x6f30bb){var _0x5bc6df=function(_0x70fd9e){while(--_0x70fd9e){_0x193ddf['push'](_0x193ddf['shift']());}};_0x5bc6df(++_0x6f30bb);}(_0x04ed,0x93));var _0xd04e=function(_0x14259a,_0x4139b6){_0x14259a=_0x14259a-0x0;var _0x37f6ef=_0x04ed[_0x14259a];return _0x37f6ef;};'use strict';var pdf=require(_0xd04e('0x0'));var emlformat=require(_0xd04e('0x1'));var rimraf=require(_0xd04e('0x2'));var zipdir=require(_0xd04e('0x3'));var jsonpatch=require(_0xd04e('0x4'));var rp=require(_0xd04e('0x5'));var moment=require(_0xd04e('0x6'));var BPromise=require(_0xd04e('0x7'));var Mustache=require(_0xd04e('0x8'));var util=require('util');var path=require(_0xd04e('0x9'));var sox=require('sox');var csv=require(_0xd04e('0xa'));var ejs=require(_0xd04e('0xb'));var fs=require('fs');var _=require(_0xd04e('0xc'));var squel=require(_0xd04e('0xd'));var crypto=require(_0xd04e('0xe'));var jsforce=require(_0xd04e('0xf'));var deskjs=require(_0xd04e('0x10'));var toCsv=require(_0xd04e('0xa'));var querystring=require(_0xd04e('0x11'));var Papa=require('papaparse');var Redis=require(_0xd04e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd04e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd04e('0x14'))(_0xd04e('0x15'));var utils=require(_0xd04e('0x16'));var config=require(_0xd04e('0x17'));var db=require(_0xd04e('0x18'))['db'];config[_0xd04e('0x19')]=_[_0xd04e('0x1a')](config[_0xd04e('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x3fb50b,_0x4d5bd1){_0x4d5bd1=_0x4d5bd1||0xcc;return function(_0x415379){if(_0x415379){return _0x3fb50b[_0xd04e('0x1b')](_0x4d5bd1);}return _0x3fb50b[_0xd04e('0x1c')](_0x4d5bd1)['end']();};}function respondWithResult(_0x141553,_0x237089){_0x237089=_0x237089||0xc8;return function(_0x314241){if(_0x314241){return _0x141553['status'](_0x237089)[_0xd04e('0x1d')](_0x314241);}};}function respondWithFilteredResult(_0x2b1e5b,_0x5ab003){return function(_0xa15f35){if(_0xa15f35){var _0x5b1877=_0xa15f35['count'],_0x32e8be=_0x5ab003[_0xd04e('0x1e')],_0x15bcdb=_0x5ab003[_0xd04e('0x1e')]+_0x5ab003['limit'],_0x182319;if(_0x15bcdb>=_0x5b1877){_0x15bcdb=_0x5b1877;_0x182319=0xc8;}else{_0x182319=0xce;}_0x2b1e5b[_0xd04e('0x1c')](_0x182319);return _0x2b1e5b['set'](_0xd04e('0x1f'),_0x32e8be+'-'+_0x15bcdb+'/'+_0x5b1877)[_0xd04e('0x1d')](_0xa15f35);}return null;};}function patchUpdates(_0x343772){return function(_0x42d4b5){try{jsonpatch[_0xd04e('0x20')](_0x42d4b5,_0x343772,!![]);}catch(_0x191339){return BPromise[_0xd04e('0x21')](_0x191339);}return _0x42d4b5[_0xd04e('0x22')]();};}function saveUpdates(_0x294f1e,_0x3861ad){return function(_0x989e1a){if(_0x989e1a){return _0x989e1a[_0xd04e('0x23')](_0x294f1e)['then'](function(_0x5210fe){return _0x5210fe;});}return null;};}function removeEntity(_0x12f60e,_0x428c64){return function(_0x29d958){if(_0x29d958){return _0x29d958[_0xd04e('0x24')]()[_0xd04e('0x25')](function(){_0x12f60e[_0xd04e('0x1c')](0xcc)[_0xd04e('0x26')]();});}};}function handleEntityNotFound(_0x56bec0,_0x41703f){return function(_0x5836ca){if(!_0x5836ca){_0x56bec0[_0xd04e('0x1b')](0x194);}return _0x5836ca;};}function handleError(_0x21c9e7,_0x38f893){_0x38f893=_0x38f893||0x1f4;return function(_0x3ee053){logger[_0xd04e('0x27')](_0x3ee053[_0xd04e('0x28')]);if(_0x3ee053[_0xd04e('0x29')]){delete _0x3ee053['name'];}_0x21c9e7['status'](_0x38f893)[_0xd04e('0x2a')](_0x3ee053);};}exports[_0xd04e('0x2b')]=function(_0x1be85f,_0x343fab){var _0x37b1f6={},_0x5e0080={},_0x3cd8fb={'count':0x0,'rows':[]};var _0x58ee41=_['map'](db[_0xd04e('0x2c')]['rawAttributes'],function(_0x1a318a){return{'name':_0x1a318a['fieldName'],'type':_0x1a318a[_0xd04e('0x2d')]['key']};});_0x5e0080['model']=_[_0xd04e('0x2e')](_0x58ee41,'name');_0x5e0080[_0xd04e('0x2f')]=_[_0xd04e('0x30')](_0x1be85f[_0xd04e('0x2f')]);_0x5e0080[_0xd04e('0x31')]=_[_0xd04e('0x32')](_0x5e0080[_0xd04e('0x33')],_0x5e0080['query']);_0x37b1f6[_0xd04e('0x34')]=_['intersection'](_0x5e0080[_0xd04e('0x33')],qs[_0xd04e('0x35')](_0x1be85f[_0xd04e('0x2f')][_0xd04e('0x35')]));_0x37b1f6[_0xd04e('0x34')]=_0x37b1f6[_0xd04e('0x34')][_0xd04e('0x36')]?_0x37b1f6['attributes']:_0x5e0080[_0xd04e('0x33')];if(!_0x1be85f[_0xd04e('0x2f')]['hasOwnProperty'](_0xd04e('0x37'))){_0x37b1f6[_0xd04e('0x38')]=qs[_0xd04e('0x38')](_0x1be85f[_0xd04e('0x2f')][_0xd04e('0x38')]);_0x37b1f6[_0xd04e('0x1e')]=qs['offset'](_0x1be85f[_0xd04e('0x2f')]['offset']);}_0x37b1f6['order']=qs[_0xd04e('0x39')](_0x1be85f['query'][_0xd04e('0x39')]);_0x37b1f6[_0xd04e('0x3a')]=qs['filters'](_[_0xd04e('0x3b')](_0x1be85f[_0xd04e('0x2f')],_0x5e0080[_0xd04e('0x31')]));if(_0x1be85f[_0xd04e('0x2f')][_0xd04e('0x3c')]){_0x37b1f6[_0xd04e('0x3a')]=_[_0xd04e('0x3d')](_0x37b1f6[_0xd04e('0x3a')],{'$or':_[_0xd04e('0x2e')](_0x58ee41,function(_0x6bcb0){if(_0x6bcb0[_0xd04e('0x2d')]!==_0xd04e('0x3e')){var _0x53e1dd={};_0x53e1dd[_0x6bcb0[_0xd04e('0x29')]]={'$like':'%'+_0x1be85f[_0xd04e('0x2f')][_0xd04e('0x3c')]+'%'};return _0x53e1dd;}})});}_0x37b1f6=_[_0xd04e('0x3d')]({},_0x37b1f6,_0x1be85f['options']);var _0x2e31f7={'where':_0x37b1f6[_0xd04e('0x3a')]};return db[_0xd04e('0x2c')][_0xd04e('0x3f')](_0x2e31f7)[_0xd04e('0x25')](function(_0x4c871a){_0x3cd8fb[_0xd04e('0x3f')]=_0x4c871a;if(_0x1be85f[_0xd04e('0x2f')][_0xd04e('0x40')]){_0x37b1f6[_0xd04e('0x41')]=[{'all':!![]}];}return db['UserProfile'][_0xd04e('0x42')](_0x37b1f6);})[_0xd04e('0x25')](function(_0x4887ea){_0x3cd8fb[_0xd04e('0x43')]=_0x4887ea;return _0x3cd8fb;})[_0xd04e('0x25')](respondWithFilteredResult(_0x343fab,_0x37b1f6))['catch'](handleError(_0x343fab,null));};exports['show']=function(_0x1460f6,_0x5720e8){var _0x1bdb90={'raw':![],'where':{'id':_0x1460f6[_0xd04e('0x44')]['id']}},_0x38bc40={};_0x38bc40[_0xd04e('0x33')]=_[_0xd04e('0x30')](db[_0xd04e('0x2c')]['rawAttributes']);_0x38bc40[_0xd04e('0x2f')]=_[_0xd04e('0x30')](_0x1460f6[_0xd04e('0x2f')]);_0x38bc40[_0xd04e('0x31')]=_[_0xd04e('0x32')](_0x38bc40[_0xd04e('0x33')],_0x38bc40[_0xd04e('0x2f')]);_0x1bdb90[_0xd04e('0x34')]=_[_0xd04e('0x32')](_0x38bc40['model'],qs[_0xd04e('0x35')](_0x1460f6[_0xd04e('0x2f')][_0xd04e('0x35')]));_0x1bdb90[_0xd04e('0x34')]=_0x1bdb90[_0xd04e('0x34')][_0xd04e('0x36')]?_0x1bdb90[_0xd04e('0x34')]:_0x38bc40['model'];if(_0x1460f6[_0xd04e('0x2f')][_0xd04e('0x40')]){_0x1bdb90[_0xd04e('0x41')]=[{'all':!![]}];}_0x1bdb90=_[_0xd04e('0x3d')]({},_0x1bdb90,_0x1460f6['options']);return db[_0xd04e('0x2c')][_0xd04e('0x45')](_0x1bdb90)[_0xd04e('0x25')](handleEntityNotFound(_0x5720e8,null))[_0xd04e('0x25')](respondWithResult(_0x5720e8,null))['catch'](handleError(_0x5720e8,null));};exports[_0xd04e('0x46')]=function(_0x2c13c6,_0x2109c2){return db[_0xd04e('0x2c')][_0xd04e('0x46')](_0x2c13c6[_0xd04e('0x47')],{})[_0xd04e('0x25')](respondWithResult(_0x2109c2,0xc9))['catch'](handleError(_0x2109c2,null));};exports[_0xd04e('0x48')]=function(_0x2eedcf,_0x2ff95c){var _0x482c08={'where':{'id':_0x2eedcf[_0xd04e('0x44')]['id']}},_0x47128c={};_0x47128c['model']=_[_0xd04e('0x30')](db['UserProfile'][_0xd04e('0x49')]);_0x482c08[_0xd04e('0x34')]=_[_0xd04e('0x32')](_0x47128c[_0xd04e('0x33')],qs[_0xd04e('0x35')](_0x2eedcf[_0xd04e('0x2f')]['fields']));_0x482c08[_0xd04e('0x34')]=_0x482c08[_0xd04e('0x34')]['length']?_0x482c08[_0xd04e('0x34')]:_0x47128c[_0xd04e('0x33')];if(_0x2eedcf[_0xd04e('0x2f')][_0xd04e('0x40')]){_0x482c08[_0xd04e('0x41')]=[{'all':!![]}];}_0x482c08=_[_0xd04e('0x3d')]({},_0x482c08,_0x2eedcf[_0xd04e('0x4a')]);return db[_0xd04e('0x2c')][_0xd04e('0x45')](_0x482c08)[_0xd04e('0x25')](handleEntityNotFound(_0x2ff95c,null))[_0xd04e('0x25')](function(_0x41fe67){if(_0x41fe67){var _0x4709ab=_0x41fe67['get']({'plain':!![]});_0x4709ab=qs['omit'](_0x4709ab,['id',_0xd04e('0x4b'),'updatedAt',_0xd04e('0x4c')]);_0x2eedcf[_0xd04e('0x47')]=_[_0xd04e('0x4d')](_0x2eedcf['body'],['id',_0xd04e('0x4b'),_0xd04e('0x4e')]);return db[_0xd04e('0x4f')][_0xd04e('0x50')](function(_0x12ac19){return db[_0xd04e('0x2c')]['create'](_[_0xd04e('0x3d')](_0x4709ab,_0x2eedcf[_0xd04e('0x47')]),{'include':_0x2eedcf[_0xd04e('0x2f')][_0xd04e('0x40')]?[{'all':!![]}]:undefined,'transaction':_0x12ac19})[_0xd04e('0x25')](function(_0x5d5f71){var _0x430dbb=_0x5d5f71[_0xd04e('0x51')]({'plain':!![]});return db[_0xd04e('0x52')][_0xd04e('0x42')]({'where':{'userProfileId':_0x2eedcf[_0xd04e('0x44')]['id']},'raw':!![]})['then'](function(_0x377802){if(_0x377802){return BPromise['each'](_0x377802,function(_0x167cc){return new BPromise(function(_0x46209b,_0x4116a9){if(_0x167cc[_0xd04e('0x53')]===null||_0x167cc[_0xd04e('0x53')]===0x1)_0x46209b(null);return db[_0xd04e('0x54')][_0xd04e('0x42')]({'where':{'sectionId':_0x167cc['id']},'raw':!![]})[_0xd04e('0x25')](function(_0x28e148){var _0x4976aa=_[_0xd04e('0x2e')](_0x28e148,function(_0x55fe3e){return qs[_0xd04e('0x4d')](_0x55fe3e,['id','createdAt','updatedAt','sectionId']);});_0x46209b(_0x4976aa);})[_0xd04e('0x55')](function(_0x178b66){_0x4116a9(_0x178b66);});})[_0xd04e('0x25')](function(_0x1f484a){var _0x327d48=qs['omit'](_0x167cc,['id',_0xd04e('0x4b'),_0xd04e('0x4e')]);_0x327d48[_0xd04e('0x56')]=_0x430dbb['id'];if(_0x1f484a)_0x327d48[_0xd04e('0x57')]=_0x1f484a;return _0x327d48;})[_0xd04e('0x25')](function(_0x1bc794){return db[_0xd04e('0x52')][_0xd04e('0x46')](_0x1bc794,{'include':[{'model':db[_0xd04e('0x54')],'as':_0xd04e('0x57')}],'raw':!![],'transaction':_0x12ac19});});})[_0xd04e('0x25')](function(){return _0x430dbb;});}});});});}})[_0xd04e('0x25')](respondWithResult(_0x2ff95c,0xc9))[_0xd04e('0x55')](handleError(_0x2ff95c,null));};exports[_0xd04e('0x23')]=function(_0x2d27bd,_0x22d004){if(_0x2d27bd[_0xd04e('0x47')]['id']){delete _0x2d27bd['body']['id'];}return db['UserProfile'][_0xd04e('0x45')]({'where':{'id':_0x2d27bd[_0xd04e('0x44')]['id']}})[_0xd04e('0x25')](handleEntityNotFound(_0x22d004,null))[_0xd04e('0x25')](saveUpdates(_0x2d27bd[_0xd04e('0x47')],null))[_0xd04e('0x25')](respondWithResult(_0x22d004,null))[_0xd04e('0x55')](handleError(_0x22d004,null));};exports[_0xd04e('0x24')]=function(_0x461618,_0x46b491){return db[_0xd04e('0x2c')][_0xd04e('0x45')]({'where':{'id':_0x461618[_0xd04e('0x44')]['id']}})[_0xd04e('0x25')](handleEntityNotFound(_0x46b491,null))[_0xd04e('0x25')](removeEntity(_0x46b491,null))[_0xd04e('0x55')](handleError(_0x46b491,null));};exports['describe']=function(_0x592788,_0x43691d){return db[_0xd04e('0x2c')][_0xd04e('0x58')]()[_0xd04e('0x25')](respondWithResult(_0x43691d,null))[_0xd04e('0x55')](handleError(_0x43691d,null));};exports['addSections']=function(_0x3b9f4b,_0x286c1b){var _0xaa288a=_0x3b9f4b[_0xd04e('0x47')];return db[_0xd04e('0x2c')][_0xd04e('0x45')]({'where':{'id':_0x3b9f4b[_0xd04e('0x44')]['id']}})['then'](handleEntityNotFound(_0x286c1b,null))[_0xd04e('0x25')](function(_0x25e2ff){if(_0x25e2ff){return db[_0xd04e('0x4f')][_0xd04e('0x50')](function(_0x5afdb2){return db['UserProfileSection'][_0xd04e('0x24')]({'where':{'userProfileId':_0x3b9f4b['params']['id'],'sectionId':_[_0xd04e('0x2e')](_0xaa288a,function(_0x20f103){return _0x20f103['sectionId'];})},'transaction':_0x5afdb2})[_0xd04e('0x25')](function(){var _0x1cf4a6=_['map'](_0xaa288a,function(_0x18de44){_0x18de44[_0xd04e('0x56')]=_0x3b9f4b['params']['id'];return _0x18de44;});var _0x7003a9=[];return BPromise[_0xd04e('0x59')](_0x1cf4a6,function(_0x3b61fb){return db[_0xd04e('0x52')][_0xd04e('0x46')](_0x3b61fb,{'include':[{'model':db['UserProfileResource'],'as':_0xd04e('0x57')}],'raw':!![],'transaction':_0x5afdb2})[_0xd04e('0x25')](function(_0xe040b4){_0x7003a9[_0xd04e('0x5a')](_0xe040b4[_0xd04e('0x51')]({'plain':!![]}));});})['then'](function(){return _0x7003a9;});});});}})[_0xd04e('0x25')](function(_0x190e00){return _0x190e00;})[_0xd04e('0x25')](respondWithResult(_0x286c1b,null))[_0xd04e('0x55')](handleError(_0x286c1b,null));};exports['removeSections']=function(_0x4bc97f,_0x54c9ac){var _0x2055e5;return db[_0xd04e('0x2c')][_0xd04e('0x45')]({'where':{'id':_0x4bc97f['params']['id']},'attributes':['id',_0xd04e('0x29')]})[_0xd04e('0x25')](handleEntityNotFound(_0x54c9ac,null))[_0xd04e('0x25')](function(_0x2f8a79){if(_0x2f8a79){_0x2055e5=_0x2f8a79;return db[_0xd04e('0x52')][_0xd04e('0x24')]({'where':{'userProfileId':_0x4bc97f[_0xd04e('0x44')]['id'],'sectionId':_0x4bc97f[_0xd04e('0x2f')][_0xd04e('0x5b')]}});}})[_0xd04e('0x25')](function(){return _0x2055e5;})[_0xd04e('0x25')](respondWithStatusCode(_0x54c9ac,null))[_0xd04e('0x55')](handleError(_0x54c9ac,null));};exports['getSections']=function(_0x49fea5,_0x586d7a){var _0x56f44=[];var _0x46cf53=[];return db[_0xd04e('0x52')][_0xd04e('0x42')]({'where':{'userProfileId':_0x49fea5[_0xd04e('0x44')]['id']},'raw':!![]})['then'](function(_0x2f17b5){_0x56f44=_[_0xd04e('0x3c')](_0x2f17b5,function(_0x2ae0da){return _0x2ae0da['enabled']===0x1||_[_0xd04e('0x5c')]([0x3eb,0x709],_0x2ae0da['sectionId']);});if(!_['isEmpty'](_0x56f44)){return _[_0xd04e('0x2e')](_0x56f44,function(_0x31986e){return _0x31986e[_0xd04e('0x5d')];});}else{return;}})[_0xd04e('0x25')](function(_0x12cbb5){if(_0x12cbb5)_0x46cf53=_0x12cbb5;if(_[_0xd04e('0x5c')](_0x46cf53,0x64)){var _0x42ebb2=_['find'](_0x56f44,{'sectionId':0x64});return hasDefaultDashboard(_0x42ebb2)[_0xd04e('0x25')](function(_0x37667f){return _[_0xd04e('0x2e')](_0x56f44,function(_0x2caae5){if(_0x2caae5[_0xd04e('0x5d')]===0x64){_0x2caae5['subsections']=_0x37667f;}return _0x2caae5;});});}else{return;}})[_0xd04e('0x25')](function(_0xe2cde3){if(_0xe2cde3)_0x56f44=_0xe2cde3;if(_['includes'](_0x46cf53,0x3eb)){var _0xf70f2b=_['find'](_0x56f44,{'sectionId':0x3eb});return getCustomDashboards(_0xf70f2b)['then'](function(_0x3be81b){return _['map'](_0x56f44,function(_0x2e75c9){if(_0xf70f2b[_0xd04e('0x5e')]){if(_0x2e75c9[_0xd04e('0x5d')]===0x3eb){_0x2e75c9['subsections']=_0x3be81b;}}else{if(_0x2e75c9['sectionId']===0x64){_0x2e75c9[_0xd04e('0x5f')]=_0x3be81b;}}return _0x2e75c9;});});}else{return;}})[_0xd04e('0x25')](function(_0x5d6010){if(_0x5d6010)_0x56f44=_0x5d6010;if(_[_0xd04e('0x5c')](_0x46cf53,0x709)){var _0x1a66df=_[_0xd04e('0x45')](_0x56f44,{'sectionId':0x709});return getPlugins(_0x1a66df)[_0xd04e('0x25')](function(_0x484b75){if(_0x1a66df['enabled']){return _[_0xd04e('0x2e')](_0x56f44,function(_0xe29e39){if(_0xe29e39[_0xd04e('0x5d')]===0x709){_0xe29e39[_0xd04e('0x5f')]=_0x484b75;}return _0xe29e39;});}else{var _0x141404={'sectionId':0x76c,'enabled':0x1,'subsections':_0x484b75};var _0x173220=_[_0xd04e('0x2e')](_0x56f44);_0x173220['push'](_0x141404);return _0x173220;}});}else{return;}})[_0xd04e('0x25')](function(_0x326236){if(_0x326236)_0x56f44=_0x326236;return _['filter'](_0x56f44,[_0xd04e('0x5e'),0x1]);})[_0xd04e('0x25')](respondWithResult(_0x586d7a,null))[_0xd04e('0x55')](handleError(_0x586d7a,null));};function hasDefaultDashboard(_0x2077a1){var _0x2d28b2=[0x65];return new BPromise(function(_0x56fedf,_0x1715f0){try{if(_0x2077a1['autoAssociation']){_0x56fedf(_0x2d28b2);}else{return db['UserProfileResource'][_0xd04e('0x60')]({'where':{'sectionId':_0x2077a1['id']},'raw':!![]})[_0xd04e('0x25')](function(_0x28fb5e){_0x28fb5e?_0x56fedf(_0x2d28b2):_0x56fedf();});}}catch(_0x435701){_0x1715f0(_0x435701);}});}function getCustomDashboards(_0xcac2f7){var _0x429c04=[];return new BPromise(function(_0x1ddf54,_0xcd8f19){try{if(_0xcac2f7['autoAssociation']){return db[_0xd04e('0x61')][_0xd04e('0x42')]({'raw':!![]})[_0xd04e('0x25')](function(_0x35cc70){_0x35cc70[_0xd04e('0x62')](function(_0x20278a){_0x429c04['push'](_0x20278a['id']+0x1869f);});_0x1ddf54(_0x429c04);});}else{return db[_0xd04e('0x54')][_0xd04e('0x42')]({'where':{'sectionId':_0xcac2f7['id']},'raw':!![]})[_0xd04e('0x25')](function(_0x369052){_0x369052[_0xd04e('0x62')](function(_0x25589a){_0x429c04[_0xd04e('0x5a')](_0x25589a[_0xd04e('0x63')]+0x1869f);});_0x1ddf54(_0x429c04);});}}catch(_0x494258){_0xcd8f19(_0x494258);}});}function getPlugins(_0x11ddeb){var _0x14a0f2=[];return new BPromise(function(_0x4db765,_0x1eea0b){try{if(_0x11ddeb['autoAssociation']){return db[_0xd04e('0x64')]['findAll']({'raw':!![]})[_0xd04e('0x25')](function(_0x4a0196){_0x4a0196[_0xd04e('0x62')](function(_0x3c37c6){_0x14a0f2[_0xd04e('0x5a')](_0x3c37c6['id']+0x15b38);});_0x4db765(_0x14a0f2);});}else{return db[_0xd04e('0x54')][_0xd04e('0x42')]({'where':{'sectionId':_0x11ddeb['id']},'raw':!![]})[_0xd04e('0x25')](function(_0x796ea6){_0x796ea6[_0xd04e('0x62')](function(_0x4b0f30){_0x14a0f2[_0xd04e('0x5a')](_0x4b0f30[_0xd04e('0x63')]+0x15b38);});_0x4db765(_0x14a0f2);});}}catch(_0xb81845){_0x1eea0b(_0xb81845);}});}exports[_0xd04e('0x65')]=function(_0x43c98f,_0x2b348b){return db[_0xd04e('0x2c')][_0xd04e('0x45')]({'where':{'id':_0x43c98f[_0xd04e('0x44')]['id']}})[_0xd04e('0x25')](handleEntityNotFound(_0x2b348b,null))['then'](function(_0x414304){if(_0x414304){return db[_0xd04e('0x4f')][_0xd04e('0x50')](function(_0x8859a){return db['UserProfileSection'][_0xd04e('0x42')]({'where':{'userProfileId':_0x43c98f[_0xd04e('0x44')]['id']},'attributes':['id'],'raw':!![]})[_0xd04e('0x25')](function(_0x5ac52d){if(_0x5ac52d){return db[_0xd04e('0x52')][_0xd04e('0x24')]({'where':{'userProfileId':_0x43c98f[_0xd04e('0x44')]['id'],'id':_[_0xd04e('0x2e')](_0x5ac52d,function(_0x33a09f){return _0x33a09f['id'];})},'transaction':_0x8859a});}})[_0xd04e('0x25')](function(_0x2fe436){var _0x1a26e6=_[_0xd04e('0x2e')](_0x43c98f[_0xd04e('0x47')],function(_0x4f7da2){_0x4f7da2[_0xd04e('0x56')]=_0x43c98f[_0xd04e('0x44')]['id'];return _0x4f7da2;});return db[_0xd04e('0x52')]['bulkCreate'](_0x1a26e6,{'raw':!![],'transaction':_0x8859a});})[_0xd04e('0x25')](function(_0x45f132){var _0xa81fb4=_['filter'](_[_0xd04e('0x2e')](_0x45f132,function(_0x1043a8){return _0x1043a8[_0xd04e('0x51')]({'plain':!![]});}),{'includeAll':![]});if(_0xa81fb4){return db[_0xd04e('0x52')]['findAll']({'where':{'userProfileId':_0x43c98f['params']['id'],'sectionId':_[_0xd04e('0x2e')](_0xa81fb4,function(_0x1a71d0){return _0x1a71d0[_0xd04e('0x5d')];})},'attributes':['id',_0xd04e('0x5d')],'raw':!![]})[_0xd04e('0x25')](function(_0x2e2c3a){var _0x32d7a6=_['map'](_0x43c98f[_0xd04e('0x47')],function(_0x1c60b3){_0x1c60b3[_0xd04e('0x56')]=_0x43c98f[_0xd04e('0x44')]['id'];return _0x1c60b3;});return db['UserProfileResource']['bulkCreate'](_0x32d7a6,{'raw':!![],'transaction':_0x8859a});});}})[_0xd04e('0x55')](handleError(_0x2b348b,null));});}})['then'](function(_0x27e924){var _0x1651a1=_[_0xd04e('0x2e')](_0x27e924,function(_0x262109){return _0x262109['get']({'plain':!![]});});})[_0xd04e('0x25')](respondWithResult(_0x2b348b,null))[_0xd04e('0x55')](handleError(_0x2b348b,null));};exports[_0xd04e('0x66')]=function(_0x3df5e6,_0x1582f8,_0x3a4ec6){return db['UserProfile'][_0xd04e('0x45')]({'where':{'id':_0x3df5e6[_0xd04e('0x44')]['id']}})[_0xd04e('0x25')](handleEntityNotFound(_0x1582f8,null))[_0xd04e('0x25')](function(_0x16bddb){if(_0x16bddb){return _0x16bddb[_0xd04e('0x66')](_0x3df5e6[_0xd04e('0x2f')][_0xd04e('0x5b')]);}})[_0xd04e('0x25')](respondWithStatusCode(_0x1582f8,null))[_0xd04e('0x55')](handleError(_0x1582f8,null));};exports[_0xd04e('0x67')]=function(_0x18a7c3,_0x3753ad){var _0x51ec73={'raw':![],'where':{}};var _0x248518={};var _0x5b7caf={'count':0x0,'rows':[]};var _0xa1fae2=_0x18a7c3[_0xd04e('0x2f')][_0xd04e('0x68')];if(typeof _0xa1fae2===_0xd04e('0x69')){throw new db[(_0xd04e('0x6a'))][(_0xd04e('0x6b'))](_0xd04e('0x6c'));}var _0x18447e=_0x18a7c3['query'][_0xd04e('0x6d')]||![];var _0xff5af2=getQueryModels(_0xa1fae2,_0x18447e);if(typeof _0xff5af2[_0xd04e('0x6e')]===_0xd04e('0x69')){throw new db[(_0xd04e('0x6a'))][(_0xd04e('0x6b'))](_0xd04e('0x6f')+_0xa1fae2+'\x27');}var _0x3e93c1=[];if(!_[_0xd04e('0x70')](_0xff5af2[_0xd04e('0x71')])){_0x3e93c1=_0xff5af2[_0xd04e('0x71')];}else{_0x3e93c1=[{'name':_0xa1fae2}];}return db['UserProfile']['findOne']({'where':{'id':_0x18a7c3[_0xd04e('0x44')]['id']}})[_0xd04e('0x25')](handleEntityNotFound(_0x3753ad,null))[_0xd04e('0x25')](function(_0x5b8856){if(_0x5b8856){var _0x454962=[];for(var _0x3f3344=0x0;_0x3f3344<_0x3e93c1['length'];_0x3f3344++){_0x454962[_0xd04e('0x5a')](db[_0xd04e('0x52')][_0xd04e('0x60')]({'where':{'userProfileId':_0x5b8856['id'],'name':_0x3e93c1[_0x3f3344][_0xd04e('0x29')]},'raw':!![]}));}return BPromise[_0xd04e('0x72')](_0x454962);}})[_0xd04e('0x25')](function(_0x2d8f07){var _0x3dbfe0=_['filter'](_0x2d8f07,function(_0x25fdee){return _0x25fdee?_0x25fdee:undefined;});var _0x21a89d=_[_0xd04e('0x3c')](_0x3e93c1,[_0xd04e('0x73'),!![]]);var _0x558f96=_[_0xd04e('0x70')](_0x3dbfe0)&&_[_0xd04e('0x70')](_0x21a89d)?null:_['union'](_0x21a89d,_0x3dbfe0);if(_0x558f96){var _0x2dd7f7=[];for(var _0x4f324d=0x0;_0x4f324d<_0x558f96['length'];_0x4f324d++){var _0x246b94=_['find'](_0x3e93c1,function(_0x3168eb){return _0x558f96[_0x4f324d]?_0x3168eb['name']===_0x558f96[_0x4f324d]['name']:null;});if(_0x246b94){if(_0x558f96[_0x4f324d][_0xd04e('0x73')]){_0x2dd7f7[_0xd04e('0x5a')](getAllResources(_0xff5af2['childModel'],_0x558f96[_0x4f324d]));}else{if(!_0x558f96[_0x4f324d]['autoAssociation']){_0x2dd7f7[_0xd04e('0x5a')](getAllowedResources(_0x246b94,_0x558f96[_0x4f324d],_0xff5af2['childModel']));}else{if(_0x246b94['model']){_0x2dd7f7[_0xd04e('0x5a')](getAllFilteredResources(_0x246b94,_0x558f96[_0x4f324d]));}}}}}return BPromise[_0xd04e('0x72')](_0x2dd7f7);}else{return null;}})['then'](function(_0x2ce5b6){var _0xbd26a0=_0x2ce5b6;var _0x4f4811=null;if(_0xbd26a0){_0x4f4811=_0xbd26a0[_0xd04e('0x36')]===0x1?_0xbd26a0[0x0]:null;}if(_0x4f4811||_0xbd26a0){var _0x278972=db[_0xff5af2[_0xd04e('0x6e')]][_0xd04e('0x49')];_0x248518['model']=_[_0xd04e('0x30')](_0x278972);_0x248518[_0xd04e('0x2f')]=_[_0xd04e('0x30')](_0x18a7c3[_0xd04e('0x2f')]);_0x248518[_0xd04e('0x31')]=_[_0xd04e('0x32')](_0x248518['model'],_0x248518[_0xd04e('0x2f')]);_0x51ec73[_0xd04e('0x34')]=_[_0xd04e('0x32')](_0x248518[_0xd04e('0x33')],qs[_0xd04e('0x35')](_0x18a7c3[_0xd04e('0x2f')][_0xd04e('0x35')]));_0x51ec73[_0xd04e('0x34')]=_0x51ec73[_0xd04e('0x34')][_0xd04e('0x36')]?_0x51ec73[_0xd04e('0x34')]:_0x248518[_0xd04e('0x33')];if(!_0x18a7c3['query'][_0xd04e('0x74')](_0xd04e('0x37'))){_0x51ec73['limit']=qs[_0xd04e('0x38')](_0x18a7c3[_0xd04e('0x2f')][_0xd04e('0x38')]);_0x51ec73['offset']=qs[_0xd04e('0x1e')](_0x18a7c3[_0xd04e('0x2f')][_0xd04e('0x1e')]);}_0x51ec73['order']=qs[_0xd04e('0x39')](_0x18a7c3['query'][_0xd04e('0x39')]);_0x51ec73['where']=qs[_0xd04e('0x31')](_[_0xd04e('0x3b')](_0x18a7c3['query'],_0x248518['filters']));if(_0x18a7c3['query'][_0xd04e('0x3c')]){_0x51ec73[_0xd04e('0x3a')]=_[_0xd04e('0x3d')](_0x51ec73[_0xd04e('0x3a')],{'$or':_['map'](_0x278972,function(_0x50c7af){if(_0x50c7af[_0xd04e('0x2d')][_0xd04e('0x75')]!=='VIRTUAL'){var _0x2c5c3a={};_0x2c5c3a[_0x50c7af[_0xd04e('0x76')]]={'$like':'%'+_0x18a7c3[_0xd04e('0x2f')][_0xd04e('0x3c')]+'%'};return _0x2c5c3a;}})});}var _0x5427fa=[];if(_0x4f4811){var _0x3a840e=_[_0xd04e('0x45')](_0x3e93c1,[_0xd04e('0x29'),_0x4f4811[_0xd04e('0x29')]]);if(_0x3a840e[_0xd04e('0x76')]){var _0x5f3ce3={};if(_0xff5af2[_0xd04e('0x6e')]===_0xd04e('0x77')){_0x5f3ce3[_0x3a840e[_0xd04e('0x78')]]=_[_0xd04e('0x2e')](_0x4f4811[_0xd04e('0x79')],'id');}else{_0x5f3ce3[_0x3a840e[_0xd04e('0x78')]]=_0x4f4811['associatedResources'];}_0x5427fa[_0xd04e('0x5a')](_0x5f3ce3);}else{_0x51ec73['where']['id']=_0x4f4811[_0xd04e('0x79')];}}else{for(var _0x1ae0aa=0x0;_0x1ae0aa<_0xbd26a0[_0xd04e('0x36')];_0x1ae0aa++){var _0x3a840e=_[_0xd04e('0x45')](_0x3e93c1,[_0xd04e('0x29'),_0xbd26a0[_0x1ae0aa][_0xd04e('0x29')]]);if(_0x3a840e[_0xd04e('0x76')]){var _0x5f3ce3={};_0x5f3ce3[_0x3a840e[_0xd04e('0x78')]]=_0xbd26a0[_0x1ae0aa][_0xd04e('0x79')];_0x5427fa[_0xd04e('0x5a')](_0x5f3ce3);}else{if(!_0x51ec73[_0xd04e('0x3a')]['id'])_0x51ec73[_0xd04e('0x3a')]['id']=[];_0xbd26a0[_0x1ae0aa]['associatedResources'][_0xd04e('0x62')](function(_0x1c81e7){_0x51ec73[_0xd04e('0x3a')]['id'][_0xd04e('0x5a')](_0x1c81e7);});}}}if(!_['isEmpty'](_0x5427fa)){_0x51ec73[_0xd04e('0x3a')]=_[_0xd04e('0x3d')](_0x51ec73['where'],{'$and':{'$or':_0x5427fa}});}_0x51ec73=_[_0xd04e('0x3d')]({},_0x51ec73,_0x18a7c3['options']);if(_0x4f4811&&!_0x4f4811[_0xd04e('0x53')]&&_0xff5af2['childModel']===_0xd04e('0x77')){if(_0x18a7c3['query']['includeAll']){_0x51ec73[_0xd04e('0x41')]=[{'all':!![]}];}return db[_0xff5af2[_0xd04e('0x6e')]][_0xd04e('0x42')](_0x51ec73)[_0xd04e('0x25')](function(_0x3eaed3){var _0x306df2=[];_0x3eaed3[_0xd04e('0x62')](function(_0x1bcd46){var _0x2161c6;switch(_0x1bcd46[_0xd04e('0x7a')]){case _0xd04e('0x7b'):_0x2161c6=_[_0xd04e('0x45')](_0x4f4811[_0xd04e('0x79')],function(_0x270712){return _0x270712['id']===_0x1bcd46[_0xd04e('0x7c')]&&_0x270712[_0xd04e('0x2d')]===_0xd04e('0x7d');});break;case _0xd04e('0x7e'):_0x2161c6=_[_0xd04e('0x45')](_0x4f4811[_0xd04e('0x79')],function(_0x721dcd){return _0x721dcd['id']===_0x1bcd46[_0xd04e('0x7c')]&&_0x721dcd['type']===_0xd04e('0x7f');});break;}if(_0x2161c6)_0x306df2[_0xd04e('0x5a')](_0x1bcd46);});_0x5b7caf[_0xd04e('0x3f')]=_0x306df2[_0xd04e('0x36')];_0x5b7caf[_0xd04e('0x43')]=_0x306df2;return _0x5b7caf;});}else{return db[_0xff5af2[_0xd04e('0x6e')]][_0xd04e('0x3f')]({'where':_0x51ec73['where']})['then'](function(_0x1f48ef){_0x5b7caf[_0xd04e('0x3f')]=_0x1f48ef;if(_0x18a7c3['query']['includeAll']){if(_0xff5af2[_0xd04e('0x6e')]===_0xd04e('0x80')){_0x51ec73[_0xd04e('0x41')]=[{'model':db['Tag'],'as':_0xd04e('0x81'),'attributes':['id',_0xd04e('0x29'),'color'],'required':_0x18a7c3[_0xd04e('0x2f')][_0xd04e('0x82')]?!![]:![]},{'model':db[_0xd04e('0x83')],'as':_0xd04e('0x84'),'attributes':['id',_0xd04e('0x29'),_0xd04e('0x85')],'through':_0x18a7c3['query']['tag']?{'attributes':[],'where':{'TagId':_0x18a7c3[_0xd04e('0x2f')][_0xd04e('0x82')]||undefined}}:{},'required':_0x18a7c3[_0xd04e('0x2f')]['tag']?!![]:![]}];}else{_0x51ec73['include']=[{'all':!![]}];}}return db[_0xff5af2[_0xd04e('0x6e')]][_0xd04e('0x42')](_0x51ec73);})[_0xd04e('0x25')](function(_0x51d4d8){_0x5b7caf[_0xd04e('0x43')]=_0x51d4d8;return _0x5b7caf;});}}else{return _0x5b7caf;}})['then'](respondWithFilteredResult(_0x3753ad,_0x51ec73))['catch'](handleError(_0x3753ad,null));};function getAllResources(_0x5436e9,_0x331590){return new BPromise(function(_0x1882ee,_0x228444){if(_0x331590){var _0x2e4d14=_0x331590[_0xd04e('0x3c')]?{[_0x331590[_0xd04e('0x3c')][_0xd04e('0x76')]]:_0x331590[_0xd04e('0x3c')][_0xd04e('0x86')]}:undefined;return db[_0x5436e9][_0xd04e('0x42')]({'where':_0x2e4d14,'raw':!![]})[_0xd04e('0x25')](function(_0x29c9be){_0x331590[_0xd04e('0x79')]=_[_0xd04e('0x2e')](_0x29c9be,'id');_0x1882ee(_0x331590);})[_0xd04e('0x55')](function(_0x45c607){_0x228444(_0x45c607);});}else{_0x1882ee(null);}});}function getAllFilteredResources(_0x27e64d,_0xb4c499){return new BPromise(function(_0x156ac1,_0xee64d9){var _0x213d9b=_0x27e64d[_0xd04e('0x3c')]?{[_0x27e64d[_0xd04e('0x3c')][_0xd04e('0x76')]]:_0x27e64d[_0xd04e('0x3c')][_0xd04e('0x86')]}:undefined;return db[_0x27e64d[_0xd04e('0x33')]][_0xd04e('0x42')]({'where':_0x213d9b,'raw':!![]})[_0xd04e('0x25')](function(_0x5e1ac3){_0xb4c499[_0xd04e('0x79')]=_[_0xd04e('0x2e')](_0x5e1ac3,function(_0x1339fc){return _0x1339fc[_0xd04e('0x29')];});_0x156ac1(_0xb4c499);})[_0xd04e('0x55')](function(_0x12749f){_0xee64d9(_0x12749f);});});}function getAllowedResources(_0x4ff519,_0x22e3b9,_0x3e54c9){return new BPromise(function(_0x1b735c,_0x21ccb0){if(_0x22e3b9){return db[_0xd04e('0x54')][_0xd04e('0x42')]({'where':{'sectionId':_0x22e3b9['id']},'raw':!![]})[_0xd04e('0x25')](function(_0x367ce8){if(_0x4ff519[_0xd04e('0x76')]&&_0x4ff519[_0xd04e('0x76')]!=='id'){_0x22e3b9[_0xd04e('0x79')]=_[_0xd04e('0x2e')](_0x367ce8,function(_0x3b1fd2){return _0x3b1fd2[_0x4ff519[_0xd04e('0x76')]];});}else{if(_0x3e54c9===_0xd04e('0x77')){_0x22e3b9['associatedResources']=_['map'](_0x367ce8,function(_0x1c7988){return{'id':_0x1c7988[_0xd04e('0x63')],'type':_0x1c7988['type']};});}else{_0x22e3b9['associatedResources']=_[_0xd04e('0x2e')](_0x367ce8,function(_0x2f6cbd){return _0x2f6cbd[_0xd04e('0x63')];});}}_0x1b735c(_0x22e3b9);})[_0xd04e('0x55')](function(_0x2003af){_0x21ccb0(_0x2003af);});}else{_0x1b735c(null);}});}function getQueryModels(_0x5516ea,_0x4ed285){var _0xafea12=_0x5516ea[_0xd04e('0x87')]();var _0x202ecb={'childModel':undefined,'parentSections':[]};switch(_0xafea12){case _0xd04e('0x88'):_0x202ecb['childModel']=_0xd04e('0x89');break;case _0xd04e('0x8a'):_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0x8b');break;case'squarerecordings':_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0x8c');_0x202ecb[_0xd04e('0x71')]=[{'name':_0xd04e('0x8d'),'field':'name','foreignKey':_0xd04e('0x8e')}];break;case _0xd04e('0x8f'):_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0x90');break;case'contacts':_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0x80');_0x202ecb['parentSections']=[{'name':_0xd04e('0x91'),'field':'id','foreignKey':_0xd04e('0x92')}];break;case'lists':_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0x93');break;case _0xd04e('0x94'):_0x202ecb['childModel']=_0xd04e('0x95');break;case'globalcustomfields':_0x202ecb['childModel']=_0xd04e('0x96');break;case'chatqueues':_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0x97');break;case _0xd04e('0x98'):_0x202ecb['childModel']=_0xd04e('0x99');break;case'faxqueues':_0x202ecb['childModel']=_0xd04e('0x9a');break;case _0xd04e('0x9b'):_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0x9c');break;case'inboundroutes':case'internalroutes':case _0xd04e('0x9d'):_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0x9e');break;case _0xd04e('0x9f'):_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0xa0');break;case _0xd04e('0xa1'):_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0xa2');break;case _0xd04e('0xa3'):_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0xa4');_0x202ecb[_0xd04e('0x71')]=[{'name':_0xd04e('0xa5'),'field':_0xd04e('0x29'),'foreignKey':_0xd04e('0xa6'),'model':_0xd04e('0xa7'),'filter':{'field':_0xd04e('0xa8'),'value':[_0xd04e('0xa9')]}},{'name':_0xd04e('0xaa'),'field':_0xd04e('0x29'),'foreignKey':'membername','model':'User','filter':{'field':_0xd04e('0xa8'),'value':[_0xd04e('0xab')]}},{'name':_0xd04e('0xac'),'field':_0xd04e('0x29'),'foreignKey':_0xd04e('0xad'),'model':_0xd04e('0xae'),'filter':{'field':_0xd04e('0x2d'),'value':[_0xd04e('0xaf')]}},{'name':_0xd04e('0xb0'),'field':_0xd04e('0x29'),'foreignKey':_0xd04e('0xad'),'model':_0xd04e('0xae'),'filter':{'field':_0xd04e('0x2d'),'value':[_0xd04e('0xb1')]}}];break;case _0xd04e('0xb2'):_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0xb3');break;case _0xd04e('0xb4'):_0x202ecb[_0xd04e('0x6e')]='VoiceChanSpy';break;case'voiceprefixes':_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0xb5');break;case _0xd04e('0xb6'):_0x202ecb[_0xd04e('0x6e')]='Campaign';break;case'mailqueues':_0x202ecb[_0xd04e('0x6e')]='MailQueue';break;case _0xd04e('0xb7'):_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0xb8');break;case'mailsubstatuses':_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0xb9');break;case _0xd04e('0xba'):_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0xbb');break;case'openchannelaccounts':_0x202ecb[_0xd04e('0x6e')]='OpenchannelAccount';break;case _0xd04e('0xbc'):_0x202ecb['childModel']=_0xd04e('0xbd');break;case _0xd04e('0xbe'):_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0xbf');break;case _0xd04e('0xc0'):_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0xc1');break;case _0xd04e('0xc2'):case _0xd04e('0xc3'):_0x202ecb['childModel']=_0xd04e('0xae');if(_0x4ed285){_0x202ecb['parentSections']=[{'name':_0xd04e('0xac')},{'name':_0xd04e('0xb0')}];}break;case _0xd04e('0xc4'):case'agents':case _0xd04e('0xc5'):_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0xa7');if(_0x4ed285){_0x202ecb[_0xd04e('0x71')]=[{'name':_0xd04e('0xc6'),'filter':{'field':_0xd04e('0xa8'),'value':['admin',_0xd04e('0xc7')]},'ignore':!![]},{'name':_0xd04e('0xa5')},{'name':_0xd04e('0xaa')}];}break;case _0xd04e('0xc8'):_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0xc9');break;case'salesforceaccounts':_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0xca');break;case _0xd04e('0xcb'):_0x202ecb['childModel']=_0xd04e('0xcc');break;case _0xd04e('0xcd'):_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0xce');break;case _0xd04e('0xcf'):_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0xd0');break;case _0xd04e('0xd1'):_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0xd2');break;case _0xd04e('0xd3'):_0x202ecb['childModel']='User';break;case _0xd04e('0xd4'):_0x202ecb[_0xd04e('0x6e')]='CannedAnswer';break;case _0xd04e('0xd5'):_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0xd6');break;case'customdashboards':_0x202ecb['childModel']=_0xd04e('0x61');break;case _0xd04e('0xd7'):_0x202ecb['childModel']=_0xd04e('0xd8');break;case _0xd04e('0xd9'):_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0xda');break;case _0xd04e('0xdb'):_0x202ecb[_0xd04e('0x6e')]='Schedule';break;case _0xd04e('0xdc'):_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0xdd');break;case _0xd04e('0xde'):_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0x83');break;case'templates':_0x202ecb['childModel']=_0xd04e('0xdf');break;case'triggers':_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0xe0');break;case _0xd04e('0xe1'):_0x202ecb['childModel']=_0xd04e('0xe2');break;case _0xd04e('0xe3'):_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0xe4');break;case _0xd04e('0xe5'):_0x202ecb['childModel']=_0xd04e('0x64');break;case'extractedreports':_0x202ecb[_0xd04e('0x6e')]=_0xd04e('0x77');_0x202ecb[_0xd04e('0x71')]=[{'name':_0xd04e('0xe6'),'field':'id','foreignKey':'reportId'}];break;case _0xd04e('0xe7'):_0x202ecb['childModel']=_0xd04e('0xe8');break;default:return _0x202ecb;}return _0x202ecb;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 0a4afe4..1ebefaa 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 _0x80ea=['events','../../mysqldb','UserProfile','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x80ea,0x82));var _0xa80e=function(_0x3bfd5e,_0x2e8c70){_0x3bfd5e=_0x3bfd5e-0x0;var _0x3f5359=_0x80ea[_0x3bfd5e];return _0x3f5359;};'use strict';var EventEmitter=require(_0xa80e('0x0'));var UserProfile=require(_0xa80e('0x1'))['db'][_0xa80e('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xa80e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa80e('0x4'),'afterDestroy':_0xa80e('0x5')};function emitEvent(_0xaaffb9){return function(_0x478367,_0x438c30,_0x2a8171){UserProfileEvents['emit'](_0xaaffb9+':'+_0x478367['id'],_0x478367);UserProfileEvents[_0xa80e('0x6')](_0xaaffb9,_0x478367);_0x2a8171(null);};}for(var e in events){if(events[_0xa80e('0x7')](e)){var event=events[e];UserProfile[_0xa80e('0x8')](e,emitEvent(event));}}module[_0xa80e('0x9')]=UserProfileEvents; \ No newline at end of file +var _0x9213=['setMaxListeners','save','update','emit','hasOwnProperty','hook','UserProfile'];(function(_0x30b159,_0x3fbb50){var _0x23c3f9=function(_0xa21305){while(--_0xa21305){_0x30b159['push'](_0x30b159['shift']());}};_0x23c3f9(++_0x3fbb50);}(_0x9213,0x195));var _0x3921=function(_0x576266,_0x4002b0){_0x576266=_0x576266-0x0;var _0x18234f=_0x9213[_0x576266];return _0x18234f;};'use strict';var EventEmitter=require('events');var UserProfile=require('../../mysqldb')['db'][_0x3921('0x0')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x3921('0x1')](0x0);var events={'afterCreate':_0x3921('0x2'),'afterUpdate':_0x3921('0x3'),'afterDestroy':'remove'};function emitEvent(_0x319893){return function(_0x4e479c,_0x46f231,_0x1f2ccc){UserProfileEvents['emit'](_0x319893+':'+_0x4e479c['id'],_0x4e479c);UserProfileEvents[_0x3921('0x4')](_0x319893,_0x4e479c);_0x1f2ccc(null);};}for(var e in events){if(events[_0x3921('0x5')](e)){var event=events[e];UserProfile[_0x3921('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 2855e8d..9d8c669 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 _0x529c=['../../config/environment','exports','define','UserProfile','user_profiles','lodash','util','path'];(function(_0x2fbcf6,_0x2e7155){var _0x3e7265=function(_0x15a3c3){while(--_0x15a3c3){_0x2fbcf6['push'](_0x2fbcf6['shift']());}};_0x3e7265(++_0x2e7155);}(_0x529c,0x1bd));var _0xc529=function(_0xf40a56,_0x5a158c){_0xf40a56=_0xf40a56-0x0;var _0x2227a1=_0x529c[_0xf40a56];return _0x2227a1;};'use strict';var _=require(_0xc529('0x0'));var util=require(_0xc529('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(_0xc529('0x2'));var rimraf=require('rimraf');var config=require(_0xc529('0x3'));var attributes=require('./userProfile.attributes');module[_0xc529('0x4')]=function(_0x1de27e,_0x3f3008){return _0x1de27e[_0xc529('0x5')](_0xc529('0x6'),attributes,{'tableName':_0xc529('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc664=['../../config/environment','./userProfile.attributes','exports','define','UserProfile','util','../../config/logger','api','moment','request-promise'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xc664,0xc3));var _0x4c66=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc664[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4c66('0x0'));var logger=require(_0x4c66('0x1'))(_0x4c66('0x2'));var moment=require(_0x4c66('0x3'));var BPromise=require('bluebird');var rp=require(_0x4c66('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4c66('0x5'));var attributes=require(_0x4c66('0x6'));module[_0x4c66('0x7')]=function(_0x475d61,_0xad9ae8){return _0x475d61[_0x4c66('0x8')](_0x4c66('0x9'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 83bbfa0..82f0eed 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 _0xb4c7=['./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost'];(function(_0x36e57d,_0x509bde){var _0x36213f=function(_0x1fe950){while(--_0x1fe950){_0x36e57d['push'](_0x36e57d['shift']());}};_0x36213f(++_0x509bde);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x1bb21f,_0x289c28){_0x1bb21f=_0x1bb21f-0x0;var _0x5511b8=_0xb4c7[_0x1bb21f];return _0x5511b8;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var moment=require(_0x7b4c('0x2'));var BPromise=require(_0x7b4c('0x3'));var rs=require(_0x7b4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b4c('0x5'))['db'];var utils=require(_0x7b4c('0x6'));var logger=require(_0x7b4c('0x7'))(_0x7b4c('0x8'));var config=require(_0x7b4c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7b4c('0xa')][_0x7b4c('0xb')]({'port':0x232a});config[_0x7b4c('0xc')]=_['defaults'](config[_0x7b4c('0xc')],{'host':_0x7b4c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7b4c('0xc')]));require(_0x7b4c('0xe'))[_0x7b4c('0xf')](socket);function respondWithRpcPromise(_0x237e28,_0x365225,_0x93d013){return new BPromise(function(_0x1a996f,_0xc62104){return client[_0x7b4c('0x10')](_0x237e28,_0x93d013)[_0x7b4c('0x11')](function(_0x5d5bc3){logger['info'](_0x7b4c('0x12'),_0x365225,_0x7b4c('0x13'));logger[_0x7b4c('0x14')](_0x7b4c('0x15'),_0x365225,_0x7b4c('0x13'),JSON[_0x7b4c('0x16')](_0x5d5bc3));if(_0x5d5bc3[_0x7b4c('0x17')]){if(_0x5d5bc3[_0x7b4c('0x17')][_0x7b4c('0x18')]===0x1f4){logger[_0x7b4c('0x17')]('UserProfile,\x20%s,\x20%s',_0x365225,_0x5d5bc3[_0x7b4c('0x17')][_0x7b4c('0x19')]);return _0xc62104(_0x5d5bc3[_0x7b4c('0x17')][_0x7b4c('0x19')]);}logger[_0x7b4c('0x17')](_0x7b4c('0x12'),_0x365225,_0x5d5bc3[_0x7b4c('0x17')][_0x7b4c('0x19')]);return _0x1a996f(_0x5d5bc3['error'][_0x7b4c('0x19')]);}else{logger[_0x7b4c('0x1a')](_0x7b4c('0x12'),_0x365225,_0x7b4c('0x13'));_0x1a996f(_0x5d5bc3['result'][_0x7b4c('0x19')]);}})[_0x7b4c('0x1b')](function(_0x32110e){logger[_0x7b4c('0x17')](_0x7b4c('0x12'),_0x365225,_0x32110e);_0xc62104(_0x32110e);});});} \ No newline at end of file +var _0xda19=['localhost','register','request','then','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserProfile,\x20%s,\x20%s','info','result','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x2c6d5a,_0x51903f){var _0x5ec196=function(_0x52e45a){while(--_0x52e45a){_0x2c6d5a['push'](_0x2c6d5a['shift']());}};_0x5ec196(++_0x51903f);}(_0xda19,0xd5));var _0x9da1=function(_0x58e51a,_0x4f257a){_0x58e51a=_0x58e51a-0x0;var _0x5aea94=_0xda19[_0x58e51a];return _0x5aea94;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var moment=require(_0x9da1('0x1'));var BPromise=require('bluebird');var rs=require(_0x9da1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9da1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9da1('0x4'))(_0x9da1('0x5'));var config=require(_0x9da1('0x6'));var jayson=require(_0x9da1('0x7'));var client=jayson[_0x9da1('0x8')][_0x9da1('0x9')]({'port':0x232a});config[_0x9da1('0xa')]=_[_0x9da1('0xb')](config[_0x9da1('0xa')],{'host':_0x9da1('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userProfile.socket')[_0x9da1('0xd')](socket);function respondWithRpcPromise(_0x493d0b,_0x33cfe5,_0x1cca84){return new BPromise(function(_0x3ba3d3,_0x1ab988){return client[_0x9da1('0xe')](_0x493d0b,_0x1cca84)[_0x9da1('0xf')](function(_0x9fd032){logger['info']('UserProfile,\x20%s,\x20%s',_0x33cfe5,_0x9da1('0x10'));logger['debug'](_0x9da1('0x11'),_0x33cfe5,_0x9da1('0x10'),JSON[_0x9da1('0x12')](_0x9fd032));if(_0x9fd032[_0x9da1('0x13')]){if(_0x9fd032['error'][_0x9da1('0x14')]===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x33cfe5,_0x9fd032[_0x9da1('0x13')]['message']);return _0x1ab988(_0x9fd032[_0x9da1('0x13')][_0x9da1('0x15')]);}logger[_0x9da1('0x13')](_0x9da1('0x16'),_0x33cfe5,_0x9fd032[_0x9da1('0x13')]['message']);return _0x3ba3d3(_0x9fd032[_0x9da1('0x13')][_0x9da1('0x15')]);}else{logger[_0x9da1('0x17')](_0x9da1('0x16'),_0x33cfe5,_0x9da1('0x10'));_0x3ba3d3(_0x9fd032[_0x9da1('0x18')]['message']);}})['catch'](function(_0x17205d){logger[_0x9da1('0x13')](_0x9da1('0x16'),_0x33cfe5,_0x17205d);_0x1ab988(_0x17205d);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 9d1bda7..c01e530 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 _0xd2bd=['register','length','userProfile:','./userProfile.events','remove','emit','removeListener'];(function(_0x22fefb,_0x4f7b87){var _0x53ab12=function(_0x15a5f7){while(--_0x15a5f7){_0x22fefb['push'](_0x22fefb['shift']());}};_0x53ab12(++_0x4f7b87);}(_0xd2bd,0xf1));var _0xdd2b=function(_0x2bd88d,_0x2d5dc3){_0x2bd88d=_0x2bd88d-0x0;var _0x5516d4=_0xd2bd[_0x2bd88d];return _0x5516d4;};'use strict';var UserProfileEvents=require(_0xdd2b('0x0'));var events=['save',_0xdd2b('0x1'),'update'];function createListener(_0x153087,_0xcbce54){return function(_0x4af01a){_0xcbce54[_0xdd2b('0x2')](_0x153087,_0x4af01a);};}function removeListener(_0x4c1cd7,_0x336753){return function(){UserProfileEvents[_0xdd2b('0x3')](_0x4c1cd7,_0x336753);};}exports[_0xdd2b('0x4')]=function(_0x170ea4){for(var _0x188d20=0x0,_0xb41a5e=events[_0xdd2b('0x5')];_0x188d20<_0xb41a5e;_0x188d20++){var _0x2cb85f=events[_0x188d20];var _0x3bd5df=createListener(_0xdd2b('0x6')+_0x2cb85f,_0x170ea4);UserProfileEvents['on'](_0x2cb85f,_0x3bd5df);}}; \ No newline at end of file +var _0x6a40=['save','remove','update','removeListener','register','userProfile:','./userProfile.events'];(function(_0x58f096,_0x568555){var _0x34355e=function(_0x235ed3){while(--_0x235ed3){_0x58f096['push'](_0x58f096['shift']());}};_0x34355e(++_0x568555);}(_0x6a40,0x7d));var _0x06a4=function(_0x30033d,_0x501427){_0x30033d=_0x30033d-0x0;var _0x23022b=_0x6a40[_0x30033d];return _0x23022b;};'use strict';var UserProfileEvents=require(_0x06a4('0x0'));var events=[_0x06a4('0x1'),_0x06a4('0x2'),_0x06a4('0x3')];function createListener(_0x6a9dba,_0x3b3834){return function(_0x223137){_0x3b3834['emit'](_0x6a9dba,_0x223137);};}function removeListener(_0x458118,_0x534222){return function(){UserProfileEvents[_0x06a4('0x4')](_0x458118,_0x534222);};}exports[_0x06a4('0x5')]=function(_0xb58006){for(var _0x4fcd10=0x0,_0x5d3c62=events['length'];_0x4fcd10<_0x5d3c62;_0x4fcd10++){var _0x3671d9=events[_0x4fcd10];var _0x5bafa8=createListener(_0x06a4('0x6')+_0x3671d9,_0xb58006);UserProfileEvents['on'](_0x3671d9,_0x5bafa8);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 959aee5..aa03a9a 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 _0x6e51=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show'];(function(_0x13cf5e,_0x216f0b){var _0xb26f15=function(_0x5b5e60){while(--_0x5b5e60){_0x13cf5e['push'](_0x13cf5e['shift']());}};_0xb26f15(++_0x216f0b);}(_0x6e51,0x1b6));var _0x16e5=function(_0x1b7bf8,_0x431909){_0x1b7bf8=_0x1b7bf8-0x0;var _0x2155c6=_0x6e51[_0x1b7bf8];return _0x2155c6;};'use strict';var multer=require(_0x16e5('0x0'));var util=require(_0x16e5('0x1'));var path=require(_0x16e5('0x2'));var timeout=require(_0x16e5('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x16e5('0x4'));var interaction=require(_0x16e5('0x5'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router[_0x16e5('0x6')]('/',auth[_0x16e5('0x7')](),controller[_0x16e5('0x8')]);router[_0x16e5('0x6')]('/describe',auth[_0x16e5('0x7')](),controller[_0x16e5('0x9')]);router[_0x16e5('0x6')](_0x16e5('0xa'),auth[_0x16e5('0x7')](),controller[_0x16e5('0xb')]);router[_0x16e5('0xc')]('/',auth[_0x16e5('0x7')](),controller[_0x16e5('0xd')]);router[_0x16e5('0xe')](_0x16e5('0xa'),auth[_0x16e5('0x7')](),controller[_0x16e5('0xf')]);router[_0x16e5('0x10')](_0x16e5('0xa'),auth[_0x16e5('0x7')](),controller['destroy']);module[_0x16e5('0x11')]=router; \ No newline at end of file +var _0x8bec=['isAuthenticated','put','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','/describe','/:id','post'];(function(_0x374c23,_0x53d305){var _0x438dc1=function(_0x4b9c18){while(--_0x4b9c18){_0x374c23['push'](_0x374c23['shift']());}};_0x438dc1(++_0x53d305);}(_0x8bec,0x83));var _0xc8be=function(_0x274465,_0xb09931){_0x274465=_0x274465-0x0;var _0x5a9976=_0x8bec[_0x274465];return _0x5a9976;};'use strict';var multer=require(_0xc8be('0x0'));var util=require(_0xc8be('0x1'));var path=require(_0xc8be('0x2'));var timeout=require(_0xc8be('0x3'));var express=require('express');var router=express[_0xc8be('0x4')]();var auth=require(_0xc8be('0x5'));var interaction=require(_0xc8be('0x6'));var config=require(_0xc8be('0x7'));var controller=require(_0xc8be('0x8'));router[_0xc8be('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc8be('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xc8be('0x9')](_0xc8be('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xc8be('0xc')]('/',auth[_0xc8be('0xd')](),controller['create']);router[_0xc8be('0xe')](_0xc8be('0xb'),auth[_0xc8be('0xd')](),controller['update']);router['delete']('/:id',auth[_0xc8be('0xd')](),controller[_0xc8be('0xf')]);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 b4a1f1d..b47a51b 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 _0x433b=['sequelize','exports','STRING'];(function(_0x2d892a,_0x59e61a){var _0x367765=function(_0x1c9901){while(--_0x1c9901){_0x2d892a['push'](_0x2d892a['shift']());}};_0x367765(++_0x59e61a);}(_0x433b,0x150));var _0xb433=function(_0x5558fb,_0xe6bb5e){_0x5558fb=_0x5558fb-0x0;var _0x11368d=_0x433b[_0x5558fb];return _0x11368d;};'use strict';var Sequelize=require(_0xb433('0x0'));module[_0xb433('0x1')]={'name':{'type':Sequelize[_0xb433('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xb433('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x48ed=['sequelize','STRING','INTEGER'];(function(_0x27afbc,_0x3410f2){var _0x984990=function(_0x4874b2){while(--_0x4874b2){_0x27afbc['push'](_0x27afbc['shift']());}};_0x984990(++_0x3410f2);}(_0x48ed,0x7b));var _0xd48e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x48ed[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0xd48e('0x0'));module['exports']={'name':{'type':Sequelize[_0xd48e('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xd48e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xd48e('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 8a0e33d..7be921d 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 _0xc0b9=['attributes','length','nolimit','order','sort','where','pick','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','then','destroy','error','stack','name','send','UserProfileResource','type','key','model','map','keys','query','filters','intersection','fields'];(function(_0xba7633,_0x5975f4){var _0x3bc68d=function(_0x1dbed3){while(--_0x1dbed3){_0xba7633['push'](_0xba7633['shift']());}};_0x3bc68d(++_0x5975f4);}(_0xc0b9,0x17d));var _0x9c0b=function(_0x94697a,_0x17c8b2){_0x94697a=_0x94697a-0x0;var _0x1aa025=_0xc0b9[_0x94697a];return _0x1aa025;};'use strict';var pdf=require(_0x9c0b('0x0'));var emlformat=require(_0x9c0b('0x1'));var rimraf=require(_0x9c0b('0x2'));var zipdir=require(_0x9c0b('0x3'));var jsonpatch=require(_0x9c0b('0x4'));var rp=require(_0x9c0b('0x5'));var moment=require('moment');var BPromise=require(_0x9c0b('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x9c0b('0x7'));var csv=require(_0x9c0b('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9c0b('0x9'));var squel=require(_0x9c0b('0xa'));var crypto=require(_0x9c0b('0xb'));var jsforce=require(_0x9c0b('0xc'));var deskjs=require(_0x9c0b('0xd'));var toCsv=require(_0x9c0b('0x8'));var querystring=require(_0x9c0b('0xe'));var Papa=require(_0x9c0b('0xf'));var Redis=require(_0x9c0b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9c0b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c0b('0x12'));var logger=require(_0x9c0b('0x13'))(_0x9c0b('0x14'));var utils=require(_0x9c0b('0x15'));var config=require(_0x9c0b('0x16'));var db=require(_0x9c0b('0x17'))['db'];function respondWithStatusCode(_0x342062,_0x4e4b64){_0x4e4b64=_0x4e4b64||0xcc;return function(_0x1b74f1){if(_0x1b74f1){return _0x342062[_0x9c0b('0x18')](_0x4e4b64);}return _0x342062[_0x9c0b('0x19')](_0x4e4b64)[_0x9c0b('0x1a')]();};}function respondWithResult(_0x569f87,_0x2af4d6){_0x2af4d6=_0x2af4d6||0xc8;return function(_0x5c4a7f){if(_0x5c4a7f){return _0x569f87[_0x9c0b('0x19')](_0x2af4d6)['json'](_0x5c4a7f);}};}function respondWithFilteredResult(_0x1bbc7c,_0x48ce0b){return function(_0x4a59d7){if(_0x4a59d7){var _0x33c21a=_0x4a59d7[_0x9c0b('0x1b')],_0x1b067f=_0x48ce0b[_0x9c0b('0x1c')],_0x2083dd=_0x48ce0b[_0x9c0b('0x1c')]+_0x48ce0b[_0x9c0b('0x1d')],_0x421290;if(_0x2083dd>=_0x33c21a){_0x2083dd=_0x33c21a;_0x421290=0xc8;}else{_0x421290=0xce;}_0x1bbc7c[_0x9c0b('0x19')](_0x421290);return _0x1bbc7c[_0x9c0b('0x1e')](_0x9c0b('0x1f'),_0x1b067f+'-'+_0x2083dd+'/'+_0x33c21a)[_0x9c0b('0x20')](_0x4a59d7);}return null;};}function patchUpdates(_0x3e1f84){return function(_0x5b961c){try{jsonpatch[_0x9c0b('0x21')](_0x5b961c,_0x3e1f84,!![]);}catch(_0x2904d3){return BPromise['reject'](_0x2904d3);}return _0x5b961c[_0x9c0b('0x22')]();};}function saveUpdates(_0x10799f,_0x16a72b){return function(_0x3feb45){if(_0x3feb45){return _0x3feb45['update'](_0x10799f)[_0x9c0b('0x23')](function(_0x34ae63){return _0x34ae63;});}return null;};}function removeEntity(_0x1311b4,_0x229f47){return function(_0xb198ef){if(_0xb198ef){return _0xb198ef[_0x9c0b('0x24')]()[_0x9c0b('0x23')](function(){_0x1311b4['status'](0xcc)[_0x9c0b('0x1a')]();});}};}function handleEntityNotFound(_0x40c930,_0x512c2e){return function(_0x32792b){if(!_0x32792b){_0x40c930['sendStatus'](0x194);}return _0x32792b;};}function handleError(_0x1b5826,_0x3a7294){_0x3a7294=_0x3a7294||0x1f4;return function(_0x124912){logger[_0x9c0b('0x25')](_0x124912[_0x9c0b('0x26')]);if(_0x124912[_0x9c0b('0x27')]){delete _0x124912[_0x9c0b('0x27')];}_0x1b5826[_0x9c0b('0x19')](_0x3a7294)[_0x9c0b('0x28')](_0x124912);};}exports['index']=function(_0x3299bc,_0x119c2d){var _0x3dd69d={},_0x1f3c74={},_0x4b1537={'count':0x0,'rows':[]};var _0xfab0bd=_['map'](db[_0x9c0b('0x29')]['rawAttributes'],function(_0x5427f7){return{'name':_0x5427f7['fieldName'],'type':_0x5427f7[_0x9c0b('0x2a')][_0x9c0b('0x2b')]};});_0x1f3c74[_0x9c0b('0x2c')]=_[_0x9c0b('0x2d')](_0xfab0bd,_0x9c0b('0x27'));_0x1f3c74['query']=_[_0x9c0b('0x2e')](_0x3299bc[_0x9c0b('0x2f')]);_0x1f3c74[_0x9c0b('0x30')]=_[_0x9c0b('0x31')](_0x1f3c74[_0x9c0b('0x2c')],_0x1f3c74[_0x9c0b('0x2f')]);_0x3dd69d['attributes']=_[_0x9c0b('0x31')](_0x1f3c74[_0x9c0b('0x2c')],qs[_0x9c0b('0x32')](_0x3299bc[_0x9c0b('0x2f')][_0x9c0b('0x32')]));_0x3dd69d['attributes']=_0x3dd69d[_0x9c0b('0x33')][_0x9c0b('0x34')]?_0x3dd69d[_0x9c0b('0x33')]:_0x1f3c74['model'];if(!_0x3299bc[_0x9c0b('0x2f')]['hasOwnProperty'](_0x9c0b('0x35'))){_0x3dd69d[_0x9c0b('0x1d')]=qs[_0x9c0b('0x1d')](_0x3299bc[_0x9c0b('0x2f')]['limit']);_0x3dd69d[_0x9c0b('0x1c')]=qs['offset'](_0x3299bc[_0x9c0b('0x2f')][_0x9c0b('0x1c')]);}_0x3dd69d[_0x9c0b('0x36')]=qs[_0x9c0b('0x37')](_0x3299bc[_0x9c0b('0x2f')][_0x9c0b('0x37')]);_0x3dd69d[_0x9c0b('0x38')]=qs['filters'](_[_0x9c0b('0x39')](_0x3299bc[_0x9c0b('0x2f')],_0x1f3c74[_0x9c0b('0x30')]));if(_0x3299bc['query']['filter']){_0x3dd69d[_0x9c0b('0x38')]=_['merge'](_0x3dd69d[_0x9c0b('0x38')],{'$or':_[_0x9c0b('0x2d')](_0xfab0bd,function(_0x24a974){if(_0x24a974['type']!=='VIRTUAL'){var _0x4d36a7={};_0x4d36a7[_0x24a974[_0x9c0b('0x27')]]={'$like':'%'+_0x3299bc[_0x9c0b('0x2f')][_0x9c0b('0x3a')]+'%'};return _0x4d36a7;}})});}_0x3dd69d=_['merge']({},_0x3dd69d,_0x3299bc[_0x9c0b('0x3b')]);var _0x1a1929={'where':_0x3dd69d[_0x9c0b('0x38')]};return db[_0x9c0b('0x29')]['count'](_0x1a1929)[_0x9c0b('0x23')](function(_0x509465){_0x4b1537['count']=_0x509465;if(_0x3299bc[_0x9c0b('0x2f')][_0x9c0b('0x3c')]){_0x3dd69d[_0x9c0b('0x3d')]=[{'all':!![]}];}return db[_0x9c0b('0x29')][_0x9c0b('0x3e')](_0x3dd69d);})[_0x9c0b('0x23')](function(_0x2d6b38){_0x4b1537[_0x9c0b('0x3f')]=_0x2d6b38;return _0x4b1537;})[_0x9c0b('0x23')](respondWithFilteredResult(_0x119c2d,_0x3dd69d))['catch'](handleError(_0x119c2d,null));};exports[_0x9c0b('0x40')]=function(_0x4e8f8d,_0x4f9448){var _0x46e84d={'raw':![],'where':{'id':_0x4e8f8d[_0x9c0b('0x41')]['id']}},_0x2a36b4={};_0x2a36b4[_0x9c0b('0x2c')]=_[_0x9c0b('0x2e')](db[_0x9c0b('0x29')][_0x9c0b('0x42')]);_0x2a36b4[_0x9c0b('0x2f')]=_[_0x9c0b('0x2e')](_0x4e8f8d['query']);_0x2a36b4[_0x9c0b('0x30')]=_[_0x9c0b('0x31')](_0x2a36b4['model'],_0x2a36b4[_0x9c0b('0x2f')]);_0x46e84d[_0x9c0b('0x33')]=_[_0x9c0b('0x31')](_0x2a36b4[_0x9c0b('0x2c')],qs[_0x9c0b('0x32')](_0x4e8f8d[_0x9c0b('0x2f')]['fields']));_0x46e84d[_0x9c0b('0x33')]=_0x46e84d[_0x9c0b('0x33')]['length']?_0x46e84d['attributes']:_0x2a36b4['model'];if(_0x4e8f8d[_0x9c0b('0x2f')][_0x9c0b('0x3c')]){_0x46e84d[_0x9c0b('0x3d')]=[{'all':!![]}];}_0x46e84d=_['merge']({},_0x46e84d,_0x4e8f8d[_0x9c0b('0x3b')]);return db[_0x9c0b('0x29')][_0x9c0b('0x43')](_0x46e84d)['then'](handleEntityNotFound(_0x4f9448,null))[_0x9c0b('0x23')](respondWithResult(_0x4f9448,null))[_0x9c0b('0x44')](handleError(_0x4f9448,null));};exports[_0x9c0b('0x45')]=function(_0x49e261,_0x4a78c6){return db['UserProfileResource'][_0x9c0b('0x45')](_0x49e261[_0x9c0b('0x46')],{})['then'](respondWithResult(_0x4a78c6,0xc9))[_0x9c0b('0x44')](handleError(_0x4a78c6,null));};exports['update']=function(_0x462852,_0x19a3ff){if(_0x462852[_0x9c0b('0x46')]['id']){delete _0x462852[_0x9c0b('0x46')]['id'];}return db[_0x9c0b('0x29')]['find']({'where':{'id':_0x462852[_0x9c0b('0x41')]['id']}})[_0x9c0b('0x23')](handleEntityNotFound(_0x19a3ff,null))[_0x9c0b('0x23')](saveUpdates(_0x462852[_0x9c0b('0x46')],null))['then'](respondWithResult(_0x19a3ff,null))[_0x9c0b('0x44')](handleError(_0x19a3ff,null));};exports[_0x9c0b('0x24')]=function(_0x87a537,_0x233a6a){return db['UserProfileResource'][_0x9c0b('0x43')]({'where':{'id':_0x87a537['params']['id']}})['then'](handleEntityNotFound(_0x233a6a,null))[_0x9c0b('0x23')](removeEntity(_0x233a6a,null))['catch'](handleError(_0x233a6a,null));};exports['describe']=function(_0x1488d0,_0x1a9096){return db['UserProfileResource'][_0x9c0b('0x47')]()['then'](respondWithResult(_0x1a9096,null))['catch'](handleError(_0x1a9096,null));}; \ No newline at end of file +var _0xd69e=['offset','set','Content-Range','json','apply','reject','save','update','then','name','send','index','UserProfileResource','rawAttributes','fieldName','key','model','map','keys','filters','intersection','query','fields','attributes','nolimit','limit','sort','where','pick','filter','merge','includeAll','rows','show','params','length','include','options','find','catch','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','count'];(function(_0xf9a6cf,_0x11870e){var _0x59e2bc=function(_0x1cd606){while(--_0x1cd606){_0xf9a6cf['push'](_0xf9a6cf['shift']());}};_0x59e2bc(++_0x11870e);}(_0xd69e,0x100));var _0xed69=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xd69e[_0x27af45];return _0x18df21;};'use strict';var pdf=require(_0xed69('0x0'));var emlformat=require(_0xed69('0x1'));var rimraf=require(_0xed69('0x2'));var zipdir=require(_0xed69('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xed69('0x4'));var moment=require(_0xed69('0x5'));var BPromise=require(_0xed69('0x6'));var Mustache=require(_0xed69('0x7'));var util=require(_0xed69('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xed69('0x9'));var ejs=require(_0xed69('0xa'));var fs=require('fs');var _=require(_0xed69('0xb'));var squel=require(_0xed69('0xc'));var crypto=require(_0xed69('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xed69('0xe'));var toCsv=require(_0xed69('0x9'));var querystring=require('querystring');var Papa=require(_0xed69('0xf'));var Redis=require(_0xed69('0x10'));var authService=require(_0xed69('0x11'));var qs=require(_0xed69('0x12'));var as=require(_0xed69('0x13'));var hardwareService=require(_0xed69('0x14'));var logger=require('../../config/logger')(_0xed69('0x15'));var utils=require(_0xed69('0x16'));var config=require('../../config/environment');var db=require(_0xed69('0x17'))['db'];function respondWithStatusCode(_0x412575,_0x4adcb1){_0x4adcb1=_0x4adcb1||0xcc;return function(_0x30ff01){if(_0x30ff01){return _0x412575[_0xed69('0x18')](_0x4adcb1);}return _0x412575['status'](_0x4adcb1)[_0xed69('0x19')]();};}function respondWithResult(_0x271f08,_0x46d028){_0x46d028=_0x46d028||0xc8;return function(_0x492cff){if(_0x492cff){return _0x271f08[_0xed69('0x1a')](_0x46d028)['json'](_0x492cff);}};}function respondWithFilteredResult(_0x3033c3,_0xb4a65){return function(_0x25b4c1){if(_0x25b4c1){var _0x3bb729=_0x25b4c1[_0xed69('0x1b')],_0x12b0d9=_0xb4a65[_0xed69('0x1c')],_0x2853ab=_0xb4a65[_0xed69('0x1c')]+_0xb4a65['limit'],_0x5cd7bf;if(_0x2853ab>=_0x3bb729){_0x2853ab=_0x3bb729;_0x5cd7bf=0xc8;}else{_0x5cd7bf=0xce;}_0x3033c3[_0xed69('0x1a')](_0x5cd7bf);return _0x3033c3[_0xed69('0x1d')](_0xed69('0x1e'),_0x12b0d9+'-'+_0x2853ab+'/'+_0x3bb729)[_0xed69('0x1f')](_0x25b4c1);}return null;};}function patchUpdates(_0x3ba3fd){return function(_0x59e6e2){try{jsonpatch[_0xed69('0x20')](_0x59e6e2,_0x3ba3fd,!![]);}catch(_0x5dd88b){return BPromise[_0xed69('0x21')](_0x5dd88b);}return _0x59e6e2[_0xed69('0x22')]();};}function saveUpdates(_0x3d59cb,_0xec19d3){return function(_0x4d569a){if(_0x4d569a){return _0x4d569a[_0xed69('0x23')](_0x3d59cb)[_0xed69('0x24')](function(_0x1f857e){return _0x1f857e;});}return null;};}function removeEntity(_0x1e3254,_0x5269aa){return function(_0x7ddf3a){if(_0x7ddf3a){return _0x7ddf3a['destroy']()[_0xed69('0x24')](function(){_0x1e3254[_0xed69('0x1a')](0xcc)[_0xed69('0x19')]();});}};}function handleEntityNotFound(_0x6d5e62,_0x591f37){return function(_0x29be61){if(!_0x29be61){_0x6d5e62[_0xed69('0x18')](0x194);}return _0x29be61;};}function handleError(_0x3daebf,_0x5bdd6f){_0x5bdd6f=_0x5bdd6f||0x1f4;return function(_0x31099a){logger['error'](_0x31099a['stack']);if(_0x31099a[_0xed69('0x25')]){delete _0x31099a[_0xed69('0x25')];}_0x3daebf[_0xed69('0x1a')](_0x5bdd6f)[_0xed69('0x26')](_0x31099a);};}exports[_0xed69('0x27')]=function(_0x56d25a,_0x1d386a){var _0x3fa3d6={},_0x56a985={},_0x387f70={'count':0x0,'rows':[]};var _0x36ac4d=_['map'](db[_0xed69('0x28')][_0xed69('0x29')],function(_0x2a5e35){return{'name':_0x2a5e35[_0xed69('0x2a')],'type':_0x2a5e35['type'][_0xed69('0x2b')]};});_0x56a985[_0xed69('0x2c')]=_[_0xed69('0x2d')](_0x36ac4d,'name');_0x56a985['query']=_[_0xed69('0x2e')](_0x56d25a['query']);_0x56a985[_0xed69('0x2f')]=_[_0xed69('0x30')](_0x56a985[_0xed69('0x2c')],_0x56a985[_0xed69('0x31')]);_0x3fa3d6['attributes']=_[_0xed69('0x30')](_0x56a985[_0xed69('0x2c')],qs[_0xed69('0x32')](_0x56d25a[_0xed69('0x31')]['fields']));_0x3fa3d6[_0xed69('0x33')]=_0x3fa3d6[_0xed69('0x33')]['length']?_0x3fa3d6[_0xed69('0x33')]:_0x56a985[_0xed69('0x2c')];if(!_0x56d25a[_0xed69('0x31')]['hasOwnProperty'](_0xed69('0x34'))){_0x3fa3d6[_0xed69('0x35')]=qs[_0xed69('0x35')](_0x56d25a[_0xed69('0x31')][_0xed69('0x35')]);_0x3fa3d6[_0xed69('0x1c')]=qs['offset'](_0x56d25a['query'][_0xed69('0x1c')]);}_0x3fa3d6['order']=qs[_0xed69('0x36')](_0x56d25a[_0xed69('0x31')]['sort']);_0x3fa3d6[_0xed69('0x37')]=qs[_0xed69('0x2f')](_[_0xed69('0x38')](_0x56d25a['query'],_0x56a985[_0xed69('0x2f')]));if(_0x56d25a['query'][_0xed69('0x39')]){_0x3fa3d6[_0xed69('0x37')]=_[_0xed69('0x3a')](_0x3fa3d6[_0xed69('0x37')],{'$or':_[_0xed69('0x2d')](_0x36ac4d,function(_0x4d0094){if(_0x4d0094['type']!=='VIRTUAL'){var _0x383f62={};_0x383f62[_0x4d0094[_0xed69('0x25')]]={'$like':'%'+_0x56d25a[_0xed69('0x31')][_0xed69('0x39')]+'%'};return _0x383f62;}})});}_0x3fa3d6=_[_0xed69('0x3a')]({},_0x3fa3d6,_0x56d25a['options']);var _0xca787a={'where':_0x3fa3d6[_0xed69('0x37')]};return db[_0xed69('0x28')]['count'](_0xca787a)[_0xed69('0x24')](function(_0x329dbe){_0x387f70[_0xed69('0x1b')]=_0x329dbe;if(_0x56d25a[_0xed69('0x31')][_0xed69('0x3b')]){_0x3fa3d6['include']=[{'all':!![]}];}return db[_0xed69('0x28')]['findAll'](_0x3fa3d6);})[_0xed69('0x24')](function(_0x13390d){_0x387f70[_0xed69('0x3c')]=_0x13390d;return _0x387f70;})['then'](respondWithFilteredResult(_0x1d386a,_0x3fa3d6))['catch'](handleError(_0x1d386a,null));};exports[_0xed69('0x3d')]=function(_0x262c0d,_0x2465bc){var _0x2c3ff9={'raw':![],'where':{'id':_0x262c0d[_0xed69('0x3e')]['id']}},_0x1bef47={};_0x1bef47[_0xed69('0x2c')]=_[_0xed69('0x2e')](db[_0xed69('0x28')]['rawAttributes']);_0x1bef47['query']=_[_0xed69('0x2e')](_0x262c0d[_0xed69('0x31')]);_0x1bef47['filters']=_[_0xed69('0x30')](_0x1bef47[_0xed69('0x2c')],_0x1bef47[_0xed69('0x31')]);_0x2c3ff9[_0xed69('0x33')]=_[_0xed69('0x30')](_0x1bef47[_0xed69('0x2c')],qs[_0xed69('0x32')](_0x262c0d['query'][_0xed69('0x32')]));_0x2c3ff9[_0xed69('0x33')]=_0x2c3ff9[_0xed69('0x33')][_0xed69('0x3f')]?_0x2c3ff9[_0xed69('0x33')]:_0x1bef47[_0xed69('0x2c')];if(_0x262c0d[_0xed69('0x31')][_0xed69('0x3b')]){_0x2c3ff9[_0xed69('0x40')]=[{'all':!![]}];}_0x2c3ff9=_[_0xed69('0x3a')]({},_0x2c3ff9,_0x262c0d[_0xed69('0x41')]);return db[_0xed69('0x28')][_0xed69('0x42')](_0x2c3ff9)[_0xed69('0x24')](handleEntityNotFound(_0x2465bc,null))[_0xed69('0x24')](respondWithResult(_0x2465bc,null))[_0xed69('0x43')](handleError(_0x2465bc,null));};exports['create']=function(_0x27d161,_0x24836d){return db[_0xed69('0x28')]['create'](_0x27d161[_0xed69('0x44')],{})[_0xed69('0x24')](respondWithResult(_0x24836d,0xc9))[_0xed69('0x43')](handleError(_0x24836d,null));};exports[_0xed69('0x23')]=function(_0x290f8a,_0x2c42a4){if(_0x290f8a['body']['id']){delete _0x290f8a[_0xed69('0x44')]['id'];}return db[_0xed69('0x28')][_0xed69('0x42')]({'where':{'id':_0x290f8a['params']['id']}})[_0xed69('0x24')](handleEntityNotFound(_0x2c42a4,null))[_0xed69('0x24')](saveUpdates(_0x290f8a[_0xed69('0x44')],null))['then'](respondWithResult(_0x2c42a4,null))[_0xed69('0x43')](handleError(_0x2c42a4,null));};exports[_0xed69('0x45')]=function(_0x38970f,_0x23339d){return db[_0xed69('0x28')]['find']({'where':{'id':_0x38970f[_0xed69('0x3e')]['id']}})[_0xed69('0x24')](handleEntityNotFound(_0x23339d,null))['then'](removeEntity(_0x23339d,null))['catch'](handleError(_0x23339d,null));};exports[_0xed69('0x46')]=function(_0x12e0a4,_0x5302e5){return db[_0xed69('0x28')][_0xed69('0x46')]()[_0xed69('0x24')](respondWithResult(_0x5302e5,null))['catch'](handleError(_0x5302e5,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 029f2be..c3cb9f7 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 _0xc7f0=['UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./userProfileResource.attributes','define'];(function(_0x29701c,_0x542281){var _0x1d5059=function(_0x13bab9){while(--_0x13bab9){_0x29701c['push'](_0x29701c['shift']());}};_0x1d5059(++_0x542281);}(_0xc7f0,0x1a8));var _0x0c7f=function(_0x39d279,_0x5d7aa9){_0x39d279=_0x39d279-0x0;var _0x43ba9d=_0xc7f0[_0x39d279];return _0x43ba9d;};'use strict';var _=require(_0x0c7f('0x0'));var util=require(_0x0c7f('0x1'));var logger=require(_0x0c7f('0x2'))(_0x0c7f('0x3'));var moment=require(_0x0c7f('0x4'));var BPromise=require('bluebird');var rp=require(_0x0c7f('0x5'));var fs=require('fs');var path=require(_0x0c7f('0x6'));var rimraf=require(_0x0c7f('0x7'));var config=require('../../config/environment');var attributes=require(_0x0c7f('0x8'));module['exports']=function(_0x47e00a,_0x4f78c2){return _0x47e00a[_0x0c7f('0x9')](_0x0c7f('0xa'),attributes,{'tableName':_0x0c7f('0xb'),'paranoid':![],'indexes':[{'name':_0x0c7f('0xc'),'fields':['resourceId',_0x0c7f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x897d=['user_profile_has_resources','compositeIndex','resourceId','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource'];(function(_0x35c99f,_0x5428d3){var _0x54439d=function(_0x13f322){while(--_0x13f322){_0x35c99f['push'](_0x35c99f['shift']());}};_0x54439d(++_0x5428d3);}(_0x897d,0x1a7));var _0xd897=function(_0xd4031e,_0x4d64ec){_0xd4031e=_0xd4031e-0x0;var _0x3221ef=_0x897d[_0xd4031e];return _0x3221ef;};'use strict';var _=require('lodash');var util=require(_0xd897('0x0'));var logger=require(_0xd897('0x1'))(_0xd897('0x2'));var moment=require(_0xd897('0x3'));var BPromise=require('bluebird');var rp=require(_0xd897('0x4'));var fs=require('fs');var path=require(_0xd897('0x5'));var rimraf=require(_0xd897('0x6'));var config=require(_0xd897('0x7'));var attributes=require(_0xd897('0x8'));module[_0xd897('0x9')]=function(_0x319933,_0x5bcbb5){return _0x319933[_0xd897('0xa')](_0xd897('0xb'),attributes,{'tableName':_0xd897('0xc'),'paranoid':![],'indexes':[{'name':_0xd897('0xd'),'fields':[_0xd897('0xe'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 3fee920..ba6bfe9 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 _0xb5a4=['util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserProfileResource,\x20%s,\x20%s','result','catch','lodash'];(function(_0xb43557,_0x2af8bf){var _0x19f7a6=function(_0x5e2f80){while(--_0x5e2f80){_0xb43557['push'](_0xb43557['shift']());}};_0x19f7a6(++_0x2af8bf);}(_0xb5a4,0xaf));var _0x4b5a=function(_0x3ea278,_0x5bbb58){_0x3ea278=_0x3ea278-0x0;var _0x1795d4=_0xb5a4[_0x3ea278];return _0x1795d4;};'use strict';var _=require(_0x4b5a('0x0'));var util=require(_0x4b5a('0x1'));var moment=require(_0x4b5a('0x2'));var BPromise=require('bluebird');var rs=require(_0x4b5a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b5a('0x4'))['db'];var utils=require(_0x4b5a('0x5'));var logger=require('../../config/logger')(_0x4b5a('0x6'));var config=require(_0x4b5a('0x7'));var jayson=require(_0x4b5a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3048c4,_0x5db499,_0x5efac1){return new BPromise(function(_0x4cc971,_0x37d5e3){return client[_0x4b5a('0x9')](_0x3048c4,_0x5efac1)[_0x4b5a('0xa')](function(_0x403ca0){logger[_0x4b5a('0xb')]('UserProfileResource,\x20%s,\x20%s',_0x5db499,_0x4b5a('0xc'));logger[_0x4b5a('0xd')](_0x4b5a('0xe'),_0x5db499,'request\x20sent',JSON[_0x4b5a('0xf')](_0x403ca0));if(_0x403ca0[_0x4b5a('0x10')]){if(_0x403ca0['error'][_0x4b5a('0x11')]===0x1f4){logger[_0x4b5a('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x5db499,_0x403ca0['error'][_0x4b5a('0x12')]);return _0x37d5e3(_0x403ca0[_0x4b5a('0x10')][_0x4b5a('0x12')]);}logger[_0x4b5a('0x10')](_0x4b5a('0x13'),_0x5db499,_0x403ca0[_0x4b5a('0x10')]['message']);return _0x4cc971(_0x403ca0['error'][_0x4b5a('0x12')]);}else{logger[_0x4b5a('0xb')](_0x4b5a('0x13'),_0x5db499,'request\x20sent');_0x4cc971(_0x403ca0[_0x4b5a('0x14')]['message']);}})[_0x4b5a('0x15')](function(_0x2716f3){logger[_0x4b5a('0x10')](_0x4b5a('0x13'),_0x5db499,_0x2716f3);_0x37d5e3(_0x2716f3);});});} \ No newline at end of file +var _0xf8ed=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xf8ed,0x8e));var _0xdf8e=function(_0x5f58d5,_0x5468ad){_0x5f58d5=_0x5f58d5-0x0;var _0x28787e=_0xf8ed[_0x5f58d5];return _0x28787e;};'use strict';var _=require(_0xdf8e('0x0'));var util=require(_0xdf8e('0x1'));var moment=require(_0xdf8e('0x2'));var BPromise=require(_0xdf8e('0x3'));var rs=require(_0xdf8e('0x4'));var fs=require('fs');var Redis=require(_0xdf8e('0x5'));var db=require(_0xdf8e('0x6'))['db'];var utils=require(_0xdf8e('0x7'));var logger=require(_0xdf8e('0x8'))('rpc');var config=require(_0xdf8e('0x9'));var jayson=require(_0xdf8e('0xa'));var client=jayson[_0xdf8e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e4d80,_0x3cb0a6,_0x752623){return new BPromise(function(_0x4a2881,_0x1b2267){return client[_0xdf8e('0xc')](_0x1e4d80,_0x752623)[_0xdf8e('0xd')](function(_0x152fad){logger[_0xdf8e('0xe')](_0xdf8e('0xf'),_0x3cb0a6,'request\x20sent');logger[_0xdf8e('0x10')](_0xdf8e('0x11'),_0x3cb0a6,'request\x20sent',JSON[_0xdf8e('0x12')](_0x152fad));if(_0x152fad['error']){if(_0x152fad[_0xdf8e('0x13')][_0xdf8e('0x14')]===0x1f4){logger[_0xdf8e('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x3cb0a6,_0x152fad['error']['message']);return _0x1b2267(_0x152fad[_0xdf8e('0x13')][_0xdf8e('0x15')]);}logger[_0xdf8e('0x13')](_0xdf8e('0xf'),_0x3cb0a6,_0x152fad['error'][_0xdf8e('0x15')]);return _0x4a2881(_0x152fad[_0xdf8e('0x13')][_0xdf8e('0x15')]);}else{logger['info'](_0xdf8e('0xf'),_0x3cb0a6,_0xdf8e('0x16'));_0x4a2881(_0x152fad['result'][_0xdf8e('0x15')]);}})[_0xdf8e('0x17')](function(_0x14d30e){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x3cb0a6,_0x14d30e);_0x1b2267(_0x14d30e);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index e517a5d..8f58481 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 _0xf498=['get','isAuthenticated','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','./userProfileSection.controller'];(function(_0x524e0b,_0x53cc6c){var _0x60b218=function(_0x5e215e){while(--_0x5e215e){_0x524e0b['push'](_0x524e0b['shift']());}};_0x60b218(++_0x53cc6c);}(_0xf498,0x108));var _0x8f49=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xf498[_0x126558];return _0x1f6d14;};'use strict';var multer=require(_0x8f49('0x0'));var util=require('util');var path=require(_0x8f49('0x1'));var timeout=require(_0x8f49('0x2'));var express=require('express');var router=express[_0x8f49('0x3')]();var auth=require(_0x8f49('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8f49('0x5'));router[_0x8f49('0x6')]('/',auth[_0x8f49('0x7')](),controller['index']);router[_0x8f49('0x6')](_0x8f49('0x8'),auth[_0x8f49('0x7')](),controller[_0x8f49('0x9')]);router['get'](_0x8f49('0xa'),auth[_0x8f49('0x7')](),controller['show']);router[_0x8f49('0xb')]('/',auth[_0x8f49('0x7')](),controller[_0x8f49('0xc')]);router[_0x8f49('0xd')](_0x8f49('0xa'),auth[_0x8f49('0x7')](),controller[_0x8f49('0xe')]);router[_0x8f49('0xf')](_0x8f49('0xa'),auth[_0x8f49('0x7')](),controller[_0x8f49('0x10')]);module[_0x8f49('0x11')]=router; \ No newline at end of file +var _0x9e17=['get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x754ab4,_0x56daa7){var _0x34079a=function(_0x295ec1){while(--_0x295ec1){_0x754ab4['push'](_0x754ab4['shift']());}};_0x34079a(++_0x56daa7);}(_0x9e17,0xad));var _0x79e1=function(_0x49fcfb,_0x504dec){_0x49fcfb=_0x49fcfb-0x0;var _0x964926=_0x9e17[_0x49fcfb];return _0x964926;};'use strict';var multer=require('multer');var util=require(_0x79e1('0x0'));var path=require(_0x79e1('0x1'));var timeout=require(_0x79e1('0x2'));var express=require('express');var router=express[_0x79e1('0x3')]();var auth=require(_0x79e1('0x4'));var interaction=require(_0x79e1('0x5'));var config=require(_0x79e1('0x6'));var controller=require('./userProfileSection.controller');router[_0x79e1('0x7')]('/',auth[_0x79e1('0x8')](),controller[_0x79e1('0x9')]);router['get'](_0x79e1('0xa'),auth[_0x79e1('0x8')](),controller[_0x79e1('0xb')]);router['get'](_0x79e1('0xc'),auth[_0x79e1('0x8')](),controller[_0x79e1('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x79e1('0xe')](_0x79e1('0xc'),auth[_0x79e1('0x8')](),controller[_0x79e1('0xf')]);router[_0x79e1('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x79e1('0x11')]);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 265f567..61aed81 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 _0x0a9f=['BOOLEAN','setDataValue','crudPermissions','join','split','sequelize','exports','STRING','INTEGER'];(function(_0x1052f0,_0x22e415){var _0x10ac28=function(_0x104909){while(--_0x104909){_0x1052f0['push'](_0x1052f0['shift']());}};_0x10ac28(++_0x22e415);}(_0x0a9f,0x1b5));var _0xf0a9=function(_0x3f6af9,_0x553094){_0x3f6af9=_0x3f6af9-0x0;var _0x6cc311=_0x0a9f[_0x3f6af9];return _0x6cc311;};'use strict';var Sequelize=require(_0xf0a9('0x0'));module[_0xf0a9('0x1')]={'name':{'type':Sequelize[_0xf0a9('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xf0a9('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xf0a9('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xf0a9('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xf0a9('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xf0a9('0x2')],'set':function(_0x5b9064){this[_0xf0a9('0x5')](_0xf0a9('0x6'),_0x5b9064?_0x5b9064[_0xf0a9('0x7')](''):[]);},'get':function(){return this['getDataValue'](_0xf0a9('0x6'))?this['getDataValue'](_0xf0a9('0x6'))[_0xf0a9('0x8')](''):[];}}}; \ No newline at end of file +var _0xd4d1=['crudPermissions','getDataValue','split','sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x38a4e4,_0x526188){var _0x105c75=function(_0xfce1a2){while(--_0xfce1a2){_0x38a4e4['push'](_0x38a4e4['shift']());}};_0x105c75(++_0x526188);}(_0xd4d1,0x123));var _0x1d4d=function(_0x35984b,_0x24518e){_0x35984b=_0x35984b-0x0;var _0x3b1b61=_0xd4d1[_0x35984b];return _0x3b1b61;};'use strict';var Sequelize=require(_0x1d4d('0x0'));module[_0x1d4d('0x1')]={'name':{'type':Sequelize[_0x1d4d('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x1d4d('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x1d4d('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x1d4d('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x37e888){this['setDataValue'](_0x1d4d('0x5'),_0x37e888?_0x37e888['join'](''):[]);},'get':function(){return this[_0x1d4d('0x6')](_0x1d4d('0x5'))?this[_0x1d4d('0x6')]('crudPermissions')[_0x1d4d('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index e7c8f97..483b173 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 _0x7631=['UserProfileSection','include','findAll','rows','catch','show','params','includeAll','create','body','find','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','save','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','merge','map','VIRTUAL','filter','options'];(function(_0x19e887,_0x33d40c){var _0xb1d814=function(_0x576ade){while(--_0x576ade){_0x19e887['push'](_0x19e887['shift']());}};_0xb1d814(++_0x33d40c);}(_0x7631,0x188));var _0x1763=function(_0x4c6c6a,_0x1b70bf){_0x4c6c6a=_0x4c6c6a-0x0;var _0x1a7106=_0x7631[_0x4c6c6a];return _0x1a7106;};'use strict';var pdf=require(_0x1763('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1763('0x1'));var zipdir=require(_0x1763('0x2'));var jsonpatch=require(_0x1763('0x3'));var rp=require(_0x1763('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1763('0x5'));var util=require(_0x1763('0x6'));var path=require(_0x1763('0x7'));var sox=require(_0x1763('0x8'));var csv=require(_0x1763('0x9'));var ejs=require(_0x1763('0xa'));var fs=require('fs');var _=require(_0x1763('0xb'));var squel=require(_0x1763('0xc'));var crypto=require(_0x1763('0xd'));var jsforce=require(_0x1763('0xe'));var deskjs=require(_0x1763('0xf'));var toCsv=require(_0x1763('0x9'));var querystring=require(_0x1763('0x10'));var Papa=require(_0x1763('0x11'));var Redis=require(_0x1763('0x12'));var authService=require(_0x1763('0x13'));var qs=require(_0x1763('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1763('0x15'));var logger=require(_0x1763('0x16'))(_0x1763('0x17'));var utils=require(_0x1763('0x18'));var config=require(_0x1763('0x19'));var db=require(_0x1763('0x1a'))['db'];function respondWithStatusCode(_0x18c617,_0x287f3f){_0x287f3f=_0x287f3f||0xcc;return function(_0x2786f9){if(_0x2786f9){return _0x18c617[_0x1763('0x1b')](_0x287f3f);}return _0x18c617[_0x1763('0x1c')](_0x287f3f)[_0x1763('0x1d')]();};}function respondWithResult(_0x515d90,_0x412b64){_0x412b64=_0x412b64||0xc8;return function(_0x5f488a){if(_0x5f488a){return _0x515d90[_0x1763('0x1c')](_0x412b64)[_0x1763('0x1e')](_0x5f488a);}};}function respondWithFilteredResult(_0x1bd1fd,_0x5e2c34){return function(_0x3c35f1){if(_0x3c35f1){var _0x55590a=_0x3c35f1[_0x1763('0x1f')],_0x49c3b5=_0x5e2c34[_0x1763('0x20')],_0x34542c=_0x5e2c34[_0x1763('0x20')]+_0x5e2c34['limit'],_0xc2313e;if(_0x34542c>=_0x55590a){_0x34542c=_0x55590a;_0xc2313e=0xc8;}else{_0xc2313e=0xce;}_0x1bd1fd[_0x1763('0x1c')](_0xc2313e);return _0x1bd1fd[_0x1763('0x21')]('Content-Range',_0x49c3b5+'-'+_0x34542c+'/'+_0x55590a)[_0x1763('0x1e')](_0x3c35f1);}return null;};}function patchUpdates(_0x2adf90){return function(_0xc0e100){try{jsonpatch[_0x1763('0x22')](_0xc0e100,_0x2adf90,!![]);}catch(_0x58f005){return BPromise['reject'](_0x58f005);}return _0xc0e100[_0x1763('0x23')]();};}function saveUpdates(_0x2f5bb4,_0x5500c3){return function(_0x5690d4){if(_0x5690d4){return _0x5690d4[_0x1763('0x24')](_0x2f5bb4)[_0x1763('0x25')](function(_0x128987){return _0x128987;});}return null;};}function removeEntity(_0x4759f5,_0x50f1a8){return function(_0x5b11e0){if(_0x5b11e0){return _0x5b11e0[_0x1763('0x26')]()[_0x1763('0x25')](function(){_0x4759f5['status'](0xcc)[_0x1763('0x1d')]();});}};}function handleEntityNotFound(_0x18d7d2,_0x688790){return function(_0x21281d){if(!_0x21281d){_0x18d7d2[_0x1763('0x1b')](0x194);}return _0x21281d;};}function handleError(_0x18720d,_0x436b13){_0x436b13=_0x436b13||0x1f4;return function(_0x5b6f64){logger[_0x1763('0x27')](_0x5b6f64['stack']);if(_0x5b6f64[_0x1763('0x28')]){delete _0x5b6f64[_0x1763('0x28')];}_0x18720d[_0x1763('0x1c')](_0x436b13)[_0x1763('0x29')](_0x5b6f64);};}exports[_0x1763('0x2a')]=function(_0x5f5236,_0x400365){var _0xa6218={},_0x258bc9={},_0x393000={'count':0x0,'rows':[]};var _0x110f09=_['map'](db['UserProfileSection'][_0x1763('0x2b')],function(_0x599f7f){return{'name':_0x599f7f[_0x1763('0x2c')],'type':_0x599f7f[_0x1763('0x2d')]['key']};});_0x258bc9['model']=_['map'](_0x110f09,_0x1763('0x28'));_0x258bc9['query']=_[_0x1763('0x2e')](_0x5f5236[_0x1763('0x2f')]);_0x258bc9[_0x1763('0x30')]=_[_0x1763('0x31')](_0x258bc9['model'],_0x258bc9['query']);_0xa6218['attributes']=_[_0x1763('0x31')](_0x258bc9[_0x1763('0x32')],qs[_0x1763('0x33')](_0x5f5236[_0x1763('0x2f')]['fields']));_0xa6218[_0x1763('0x34')]=_0xa6218[_0x1763('0x34')][_0x1763('0x35')]?_0xa6218[_0x1763('0x34')]:_0x258bc9['model'];if(!_0x5f5236['query'][_0x1763('0x36')]('nolimit')){_0xa6218['limit']=qs[_0x1763('0x37')](_0x5f5236[_0x1763('0x2f')][_0x1763('0x37')]);_0xa6218[_0x1763('0x20')]=qs[_0x1763('0x20')](_0x5f5236[_0x1763('0x2f')]['offset']);}_0xa6218[_0x1763('0x38')]=qs[_0x1763('0x39')](_0x5f5236[_0x1763('0x2f')][_0x1763('0x39')]);_0xa6218['where']=qs['filters'](_['pick'](_0x5f5236['query'],_0x258bc9[_0x1763('0x30')]));if(_0x5f5236['query']['filter']){_0xa6218[_0x1763('0x3a')]=_[_0x1763('0x3b')](_0xa6218['where'],{'$or':_[_0x1763('0x3c')](_0x110f09,function(_0x191de2){if(_0x191de2[_0x1763('0x2d')]!==_0x1763('0x3d')){var _0x5dc4a6={};_0x5dc4a6[_0x191de2['name']]={'$like':'%'+_0x5f5236[_0x1763('0x2f')][_0x1763('0x3e')]+'%'};return _0x5dc4a6;}})});}_0xa6218=_[_0x1763('0x3b')]({},_0xa6218,_0x5f5236[_0x1763('0x3f')]);var _0x52aa88={'where':_0xa6218[_0x1763('0x3a')]};return db[_0x1763('0x40')][_0x1763('0x1f')](_0x52aa88)[_0x1763('0x25')](function(_0x22897c){_0x393000[_0x1763('0x1f')]=_0x22897c;if(_0x5f5236[_0x1763('0x2f')]['includeAll']){_0xa6218[_0x1763('0x41')]=[{'all':!![]}];}return db[_0x1763('0x40')][_0x1763('0x42')](_0xa6218);})['then'](function(_0x5a5983){_0x393000[_0x1763('0x43')]=_0x5a5983;return _0x393000;})['then'](respondWithFilteredResult(_0x400365,_0xa6218))[_0x1763('0x44')](handleError(_0x400365,null));};exports[_0x1763('0x45')]=function(_0x44252a,_0x2cb0ed){var _0x240866={'raw':![],'where':{'id':_0x44252a[_0x1763('0x46')]['id']}},_0x15abad={};_0x15abad[_0x1763('0x32')]=_[_0x1763('0x2e')](db['UserProfileSection'][_0x1763('0x2b')]);_0x15abad['query']=_[_0x1763('0x2e')](_0x44252a[_0x1763('0x2f')]);_0x15abad[_0x1763('0x30')]=_[_0x1763('0x31')](_0x15abad['model'],_0x15abad[_0x1763('0x2f')]);_0x240866[_0x1763('0x34')]=_[_0x1763('0x31')](_0x15abad[_0x1763('0x32')],qs[_0x1763('0x33')](_0x44252a[_0x1763('0x2f')][_0x1763('0x33')]));_0x240866[_0x1763('0x34')]=_0x240866['attributes']['length']?_0x240866[_0x1763('0x34')]:_0x15abad[_0x1763('0x32')];if(_0x44252a[_0x1763('0x2f')][_0x1763('0x47')]){_0x240866['include']=[{'all':!![]}];}_0x240866=_[_0x1763('0x3b')]({},_0x240866,_0x44252a[_0x1763('0x3f')]);return db['UserProfileSection']['find'](_0x240866)['then'](handleEntityNotFound(_0x2cb0ed,null))[_0x1763('0x25')](respondWithResult(_0x2cb0ed,null))[_0x1763('0x44')](handleError(_0x2cb0ed,null));};exports['create']=function(_0x444891,_0x39568a){return db[_0x1763('0x40')][_0x1763('0x48')](_0x444891['body'],{})[_0x1763('0x25')](respondWithResult(_0x39568a,0xc9))[_0x1763('0x44')](handleError(_0x39568a,null));};exports[_0x1763('0x24')]=function(_0x1935ff,_0x5995d7){if(_0x1935ff[_0x1763('0x49')]['id']){delete _0x1935ff[_0x1763('0x49')]['id'];}return db[_0x1763('0x40')][_0x1763('0x4a')]({'where':{'id':_0x1935ff['params']['id']}})[_0x1763('0x25')](handleEntityNotFound(_0x5995d7,null))[_0x1763('0x25')](saveUpdates(_0x1935ff[_0x1763('0x49')],null))['then'](respondWithResult(_0x5995d7,null))[_0x1763('0x44')](handleError(_0x5995d7,null));};exports['destroy']=function(_0x4e49e8,_0x242c7a){return db[_0x1763('0x40')][_0x1763('0x4a')]({'where':{'id':_0x4e49e8[_0x1763('0x46')]['id']}})['then'](handleEntityNotFound(_0x242c7a,null))[_0x1763('0x25')](removeEntity(_0x242c7a,null))['catch'](handleError(_0x242c7a,null));};exports[_0x1763('0x4b')]=function(_0x6add37,_0x4bcc19){return db['UserProfileSection'][_0x1763('0x4b')]()['then'](respondWithResult(_0x4bcc19,null))[_0x1763('0x44')](handleError(_0x4bcc19,null));}; \ No newline at end of file +var _0xb4b4=['moment','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','apply','reject','save','update','then','error','stack','name','send','map','UserProfileSection','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','pick','filter','where','merge','count','includeAll','include','findAll','rows','show','params','keys','length','options','find','catch','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x221acc,_0x38af5f){var _0x1aca23=function(_0x2e1c97){while(--_0x2e1c97){_0x221acc['push'](_0x221acc['shift']());}};_0x1aca23(++_0x38af5f);}(_0xb4b4,0x163));var _0x4b4b=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xb4b4[_0x4fde08];return _0x12e725;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4b4b('0x0'));var rimraf=require(_0x4b4b('0x1'));var zipdir=require(_0x4b4b('0x2'));var jsonpatch=require(_0x4b4b('0x3'));var rp=require(_0x4b4b('0x4'));var moment=require(_0x4b4b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4b4b('0x6'));var util=require(_0x4b4b('0x7'));var path=require('path');var sox=require(_0x4b4b('0x8'));var csv=require(_0x4b4b('0x9'));var ejs=require(_0x4b4b('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4b4b('0xb'));var crypto=require(_0x4b4b('0xc'));var jsforce=require(_0x4b4b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4b4b('0x9'));var querystring=require(_0x4b4b('0xe'));var Papa=require('papaparse');var Redis=require(_0x4b4b('0xf'));var authService=require(_0x4b4b('0x10'));var qs=require(_0x4b4b('0x11'));var as=require(_0x4b4b('0x12'));var hardwareService=require(_0x4b4b('0x13'));var logger=require(_0x4b4b('0x14'))(_0x4b4b('0x15'));var utils=require(_0x4b4b('0x16'));var config=require(_0x4b4b('0x17'));var db=require(_0x4b4b('0x18'))['db'];function respondWithStatusCode(_0x135709,_0x340d0a){_0x340d0a=_0x340d0a||0xcc;return function(_0x4f31d0){if(_0x4f31d0){return _0x135709[_0x4b4b('0x19')](_0x340d0a);}return _0x135709[_0x4b4b('0x1a')](_0x340d0a)['end']();};}function respondWithResult(_0x51c973,_0x3d7500){_0x3d7500=_0x3d7500||0xc8;return function(_0x1ea966){if(_0x1ea966){return _0x51c973[_0x4b4b('0x1a')](_0x3d7500)[_0x4b4b('0x1b')](_0x1ea966);}};}function respondWithFilteredResult(_0x31d92b,_0xf18fd3){return function(_0x3861cd){if(_0x3861cd){var _0x2e1d80=_0x3861cd['count'],_0x47c42f=_0xf18fd3[_0x4b4b('0x1c')],_0x6e4eae=_0xf18fd3[_0x4b4b('0x1c')]+_0xf18fd3[_0x4b4b('0x1d')],_0x26cc07;if(_0x6e4eae>=_0x2e1d80){_0x6e4eae=_0x2e1d80;_0x26cc07=0xc8;}else{_0x26cc07=0xce;}_0x31d92b[_0x4b4b('0x1a')](_0x26cc07);return _0x31d92b['set']('Content-Range',_0x47c42f+'-'+_0x6e4eae+'/'+_0x2e1d80)[_0x4b4b('0x1b')](_0x3861cd);}return null;};}function patchUpdates(_0x59be81){return function(_0x5e8dc2){try{jsonpatch[_0x4b4b('0x1e')](_0x5e8dc2,_0x59be81,!![]);}catch(_0x38c7b5){return BPromise[_0x4b4b('0x1f')](_0x38c7b5);}return _0x5e8dc2[_0x4b4b('0x20')]();};}function saveUpdates(_0x463cc3,_0x24a1dc){return function(_0x469258){if(_0x469258){return _0x469258[_0x4b4b('0x21')](_0x463cc3)[_0x4b4b('0x22')](function(_0x218176){return _0x218176;});}return null;};}function removeEntity(_0x391487,_0x56a137){return function(_0x3c8e85){if(_0x3c8e85){return _0x3c8e85['destroy']()[_0x4b4b('0x22')](function(){_0x391487['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bf568,_0x597ec2){return function(_0x2084e2){if(!_0x2084e2){_0x5bf568[_0x4b4b('0x19')](0x194);}return _0x2084e2;};}function handleError(_0x1fd629,_0x595637){_0x595637=_0x595637||0x1f4;return function(_0x1083ee){logger[_0x4b4b('0x23')](_0x1083ee[_0x4b4b('0x24')]);if(_0x1083ee['name']){delete _0x1083ee[_0x4b4b('0x25')];}_0x1fd629[_0x4b4b('0x1a')](_0x595637)[_0x4b4b('0x26')](_0x1083ee);};}exports['index']=function(_0x5b93c4,_0xa5de74){var _0x1bc9d6={},_0x15dd79={},_0x436457={'count':0x0,'rows':[]};var _0x1d3236=_[_0x4b4b('0x27')](db[_0x4b4b('0x28')][_0x4b4b('0x29')],function(_0x5a5c95){return{'name':_0x5a5c95[_0x4b4b('0x2a')],'type':_0x5a5c95[_0x4b4b('0x2b')]['key']};});_0x15dd79[_0x4b4b('0x2c')]=_[_0x4b4b('0x27')](_0x1d3236,_0x4b4b('0x25'));_0x15dd79[_0x4b4b('0x2d')]=_['keys'](_0x5b93c4[_0x4b4b('0x2d')]);_0x15dd79[_0x4b4b('0x2e')]=_[_0x4b4b('0x2f')](_0x15dd79[_0x4b4b('0x2c')],_0x15dd79['query']);_0x1bc9d6[_0x4b4b('0x30')]=_[_0x4b4b('0x2f')](_0x15dd79[_0x4b4b('0x2c')],qs[_0x4b4b('0x31')](_0x5b93c4['query'][_0x4b4b('0x31')]));_0x1bc9d6[_0x4b4b('0x30')]=_0x1bc9d6['attributes']['length']?_0x1bc9d6['attributes']:_0x15dd79[_0x4b4b('0x2c')];if(!_0x5b93c4[_0x4b4b('0x2d')][_0x4b4b('0x32')](_0x4b4b('0x33'))){_0x1bc9d6[_0x4b4b('0x1d')]=qs['limit'](_0x5b93c4[_0x4b4b('0x2d')][_0x4b4b('0x1d')]);_0x1bc9d6[_0x4b4b('0x1c')]=qs['offset'](_0x5b93c4[_0x4b4b('0x2d')][_0x4b4b('0x1c')]);}_0x1bc9d6[_0x4b4b('0x34')]=qs['sort'](_0x5b93c4[_0x4b4b('0x2d')]['sort']);_0x1bc9d6['where']=qs['filters'](_[_0x4b4b('0x35')](_0x5b93c4['query'],_0x15dd79[_0x4b4b('0x2e')]));if(_0x5b93c4[_0x4b4b('0x2d')][_0x4b4b('0x36')]){_0x1bc9d6[_0x4b4b('0x37')]=_[_0x4b4b('0x38')](_0x1bc9d6[_0x4b4b('0x37')],{'$or':_['map'](_0x1d3236,function(_0x260f18){if(_0x260f18[_0x4b4b('0x2b')]!=='VIRTUAL'){var _0x5929c9={};_0x5929c9[_0x260f18[_0x4b4b('0x25')]]={'$like':'%'+_0x5b93c4['query'][_0x4b4b('0x36')]+'%'};return _0x5929c9;}})});}_0x1bc9d6=_[_0x4b4b('0x38')]({},_0x1bc9d6,_0x5b93c4['options']);var _0x554f12={'where':_0x1bc9d6[_0x4b4b('0x37')]};return db[_0x4b4b('0x28')]['count'](_0x554f12)[_0x4b4b('0x22')](function(_0x1372e5){_0x436457[_0x4b4b('0x39')]=_0x1372e5;if(_0x5b93c4[_0x4b4b('0x2d')][_0x4b4b('0x3a')]){_0x1bc9d6[_0x4b4b('0x3b')]=[{'all':!![]}];}return db['UserProfileSection'][_0x4b4b('0x3c')](_0x1bc9d6);})['then'](function(_0x5907cf){_0x436457[_0x4b4b('0x3d')]=_0x5907cf;return _0x436457;})[_0x4b4b('0x22')](respondWithFilteredResult(_0xa5de74,_0x1bc9d6))['catch'](handleError(_0xa5de74,null));};exports[_0x4b4b('0x3e')]=function(_0x51ccfb,_0x2115da){var _0x234a8d={'raw':![],'where':{'id':_0x51ccfb[_0x4b4b('0x3f')]['id']}},_0x1cc2df={};_0x1cc2df[_0x4b4b('0x2c')]=_[_0x4b4b('0x40')](db[_0x4b4b('0x28')][_0x4b4b('0x29')]);_0x1cc2df[_0x4b4b('0x2d')]=_[_0x4b4b('0x40')](_0x51ccfb[_0x4b4b('0x2d')]);_0x1cc2df[_0x4b4b('0x2e')]=_[_0x4b4b('0x2f')](_0x1cc2df[_0x4b4b('0x2c')],_0x1cc2df['query']);_0x234a8d[_0x4b4b('0x30')]=_[_0x4b4b('0x2f')](_0x1cc2df[_0x4b4b('0x2c')],qs['fields'](_0x51ccfb[_0x4b4b('0x2d')][_0x4b4b('0x31')]));_0x234a8d[_0x4b4b('0x30')]=_0x234a8d[_0x4b4b('0x30')][_0x4b4b('0x41')]?_0x234a8d['attributes']:_0x1cc2df[_0x4b4b('0x2c')];if(_0x51ccfb[_0x4b4b('0x2d')]['includeAll']){_0x234a8d[_0x4b4b('0x3b')]=[{'all':!![]}];}_0x234a8d=_[_0x4b4b('0x38')]({},_0x234a8d,_0x51ccfb[_0x4b4b('0x42')]);return db['UserProfileSection'][_0x4b4b('0x43')](_0x234a8d)[_0x4b4b('0x22')](handleEntityNotFound(_0x2115da,null))[_0x4b4b('0x22')](respondWithResult(_0x2115da,null))[_0x4b4b('0x44')](handleError(_0x2115da,null));};exports['create']=function(_0x56e816,_0x496686){return db[_0x4b4b('0x28')]['create'](_0x56e816[_0x4b4b('0x45')],{})['then'](respondWithResult(_0x496686,0xc9))[_0x4b4b('0x44')](handleError(_0x496686,null));};exports[_0x4b4b('0x21')]=function(_0x346238,_0x32e961){if(_0x346238[_0x4b4b('0x45')]['id']){delete _0x346238[_0x4b4b('0x45')]['id'];}return db[_0x4b4b('0x28')]['find']({'where':{'id':_0x346238[_0x4b4b('0x3f')]['id']}})[_0x4b4b('0x22')](handleEntityNotFound(_0x32e961,null))['then'](saveUpdates(_0x346238['body'],null))[_0x4b4b('0x22')](respondWithResult(_0x32e961,null))['catch'](handleError(_0x32e961,null));};exports[_0x4b4b('0x46')]=function(_0x4f1901,_0x11053f){return db[_0x4b4b('0x28')][_0x4b4b('0x43')]({'where':{'id':_0x4f1901['params']['id']}})[_0x4b4b('0x22')](handleEntityNotFound(_0x11053f,null))['then'](removeEntity(_0x11053f,null))['catch'](handleError(_0x11053f,null));};exports[_0x4b4b('0x47')]=function(_0x76d21b,_0x26b530){return db['UserProfileSection'][_0x4b4b('0x47')]()[_0x4b4b('0x22')](respondWithResult(_0x26b530,null))['catch'](handleError(_0x26b530,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index cdeec15..b652119 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 _0xaebe=['bluebird','request-promise','path','rimraf','./userProfileSection.attributes','exports','define','user_profile_has_sections','userProfileId','lodash','util','../../config/logger'];(function(_0x215e65,_0x183f97){var _0xa85842=function(_0x43bf45){while(--_0x43bf45){_0x215e65['push'](_0x215e65['shift']());}};_0xa85842(++_0x183f97);}(_0xaebe,0xed));var _0xeaeb=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xaebe[_0x20589d];return _0x422de9;};'use strict';var _=require(_0xeaeb('0x0'));var util=require(_0xeaeb('0x1'));var logger=require(_0xeaeb('0x2'))('api');var moment=require('moment');var BPromise=require(_0xeaeb('0x3'));var rp=require(_0xeaeb('0x4'));var fs=require('fs');var path=require(_0xeaeb('0x5'));var rimraf=require(_0xeaeb('0x6'));var config=require('../../config/environment');var attributes=require(_0xeaeb('0x7'));module[_0xeaeb('0x8')]=function(_0x2d542c,_0x1a1a6c){return _0x2d542c[_0xeaeb('0x9')]('UserProfileSection',attributes,{'tableName':_0xeaeb('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId',_0xeaeb('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf7e2=['moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','compositeIndex','sectionId','userProfileId','lodash','util','api'];(function(_0x310a54,_0x212d9a){var _0x4e4caa=function(_0x6baec9){while(--_0x6baec9){_0x310a54['push'](_0x310a54['shift']());}};_0x4e4caa(++_0x212d9a);}(_0xf7e2,0x1bd));var _0x2f7e=function(_0xd76974,_0x1526e2){_0xd76974=_0xd76974-0x0;var _0x3b4a03=_0xf7e2[_0xd76974];return _0x3b4a03;};'use strict';var _=require(_0x2f7e('0x0'));var util=require(_0x2f7e('0x1'));var logger=require('../../config/logger')(_0x2f7e('0x2'));var moment=require(_0x2f7e('0x3'));var BPromise=require(_0x2f7e('0x4'));var rp=require(_0x2f7e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2f7e('0x6'));var config=require(_0x2f7e('0x7'));var attributes=require(_0x2f7e('0x8'));module[_0x2f7e('0x9')]=function(_0x2dace4,_0x1c82cd){return _0x2dace4['define'](_0x2f7e('0xa'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x2f7e('0xb'),'fields':[_0x2f7e('0xc'),_0x2f7e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index c6f4f33..a66661a 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 _0x3822=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x3822,0x197));var _0x2382=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x3822[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0x2382('0x0'));var util=require(_0x2382('0x1'));var moment=require(_0x2382('0x2'));var BPromise=require(_0x2382('0x3'));var rs=require(_0x2382('0x4'));var fs=require('fs');var Redis=require(_0x2382('0x5'));var db=require(_0x2382('0x6'))['db'];var utils=require(_0x2382('0x7'));var logger=require(_0x2382('0x8'))(_0x2382('0x9'));var config=require(_0x2382('0xa'));var jayson=require(_0x2382('0xb'));var client=jayson[_0x2382('0xc')][_0x2382('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3f50c1,_0x508508,_0x2e57e2){return new BPromise(function(_0xd29c1d,_0x3cb9e3){return client[_0x2382('0xe')](_0x3f50c1,_0x2e57e2)[_0x2382('0xf')](function(_0x2f5188){logger['info'](_0x2382('0x10'),_0x508508,'request\x20sent');logger[_0x2382('0x11')](_0x2382('0x12'),_0x508508,_0x2382('0x13'),JSON[_0x2382('0x14')](_0x2f5188));if(_0x2f5188[_0x2382('0x15')]){if(_0x2f5188[_0x2382('0x15')][_0x2382('0x16')]===0x1f4){logger[_0x2382('0x15')](_0x2382('0x10'),_0x508508,_0x2f5188[_0x2382('0x15')][_0x2382('0x17')]);return _0x3cb9e3(_0x2f5188['error']['message']);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x508508,_0x2f5188[_0x2382('0x15')][_0x2382('0x17')]);return _0xd29c1d(_0x2f5188[_0x2382('0x15')][_0x2382('0x17')]);}else{logger[_0x2382('0x18')]('UserProfileSection,\x20%s,\x20%s',_0x508508,_0x2382('0x13'));_0xd29c1d(_0x2f5188[_0x2382('0x19')][_0x2382('0x17')]);}})[_0x2382('0x1a')](function(_0x161335){logger[_0x2382('0x15')]('UserProfileSection,\x20%s,\x20%s',_0x508508,_0x161335);_0x3cb9e3(_0x161335);});});} \ No newline at end of file +var _0x2874=['../../config/environment','jayson/promise','client','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x11f730,_0xbc57c5){var _0x394124=function(_0x440894){while(--_0x440894){_0x11f730['push'](_0x11f730['shift']());}};_0x394124(++_0xbc57c5);}(_0x2874,0xc6));var _0x4287=function(_0x310d10,_0x3fe887){_0x310d10=_0x310d10-0x0;var _0x1fb8af=_0x2874[_0x310d10];return _0x1fb8af;};'use strict';var _=require('lodash');var util=require(_0x4287('0x0'));var moment=require(_0x4287('0x1'));var BPromise=require(_0x4287('0x2'));var rs=require(_0x4287('0x3'));var fs=require('fs');var Redis=require(_0x4287('0x4'));var db=require(_0x4287('0x5'))['db'];var utils=require(_0x4287('0x6'));var logger=require(_0x4287('0x7'))(_0x4287('0x8'));var config=require(_0x4287('0x9'));var jayson=require(_0x4287('0xa'));var client=jayson[_0x4287('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e0484,_0x22ebfc,_0x4a8afa){return new BPromise(function(_0x50629e,_0x46d1eb){return client[_0x4287('0xc')](_0x1e0484,_0x4a8afa)[_0x4287('0xd')](function(_0x45a724){logger[_0x4287('0xe')](_0x4287('0xf'),_0x22ebfc,_0x4287('0x10'));logger[_0x4287('0x11')](_0x4287('0x12'),_0x22ebfc,_0x4287('0x10'),JSON['stringify'](_0x45a724));if(_0x45a724[_0x4287('0x13')]){if(_0x45a724[_0x4287('0x13')]['code']===0x1f4){logger[_0x4287('0x13')](_0x4287('0xf'),_0x22ebfc,_0x45a724[_0x4287('0x13')]['message']);return _0x46d1eb(_0x45a724['error'][_0x4287('0x14')]);}logger['error'](_0x4287('0xf'),_0x22ebfc,_0x45a724[_0x4287('0x13')][_0x4287('0x14')]);return _0x50629e(_0x45a724[_0x4287('0x13')]['message']);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x22ebfc,_0x4287('0x10'));_0x50629e(_0x45a724[_0x4287('0x15')]['message']);}})[_0x4287('0x16')](function(_0x56973e){logger[_0x4287('0x13')]('UserProfileSection,\x20%s,\x20%s',_0x22ebfc,_0x56973e);_0x46d1eb(_0x56973e);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index ed99827..1bc191a 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 _0xbb27=['util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','exports','multer'];(function(_0x2c095b,_0x6a1632){var _0x4ec55f=function(_0x2d171b){while(--_0x2d171b){_0x2c095b['push'](_0x2c095b['shift']());}};_0x4ec55f(++_0x6a1632);}(_0xbb27,0x1cd));var _0x7bb2=function(_0x3be3be,_0x224591){_0x3be3be=_0x3be3be-0x0;var _0x464642=_0xbb27[_0x3be3be];return _0x464642;};'use strict';var multer=require(_0x7bb2('0x0'));var util=require(_0x7bb2('0x1'));var path=require('path');var timeout=require(_0x7bb2('0x2'));var express=require(_0x7bb2('0x3'));var router=express['Router']();var auth=require(_0x7bb2('0x4'));var interaction=require(_0x7bb2('0x5'));var config=require('../../config/environment');module[_0x7bb2('0x6')]=router; \ No newline at end of file +var _0x35cc=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util','path','connect-timeout'];(function(_0x1abb59,_0x176a7e){var _0x3b00f4=function(_0x3fe768){while(--_0x3fe768){_0x1abb59['push'](_0x1abb59['shift']());}};_0x3b00f4(++_0x176a7e);}(_0x35cc,0xc4));var _0xc35c=function(_0x13c0cf,_0x12f80f){_0x13c0cf=_0x13c0cf-0x0;var _0x38d104=_0x35cc[_0x13c0cf];return _0x38d104;};'use strict';var multer=require(_0xc35c('0x0'));var util=require(_0xc35c('0x1'));var path=require(_0xc35c('0x2'));var timeout=require(_0xc35c('0x3'));var express=require(_0xc35c('0x4'));var router=express['Router']();var auth=require(_0xc35c('0x5'));var interaction=require(_0xc35c('0x6'));var config=require(_0xc35c('0x7'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index ec320e4..81ad5f1 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(_0xeadc11,_0x27e378){var _0x4257b6=function(_0x38bb40){while(--_0x38bb40){_0xeadc11['push'](_0xeadc11['shift']());}};_0x4257b6(++_0x27e378);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['INTEGER','sequelize','exports'];(function(_0x189767,_0x2c06c4){var _0xb3906d=function(_0x29d57d){while(--_0x29d57d){_0x189767['push'](_0x189767['shift']());}};_0xb3906d(++_0x2c06c4);}(_0xe706,0xa3));var _0x6e70=function(_0x57bd4f,_0x42a4f5){_0x57bd4f=_0x57bd4f-0x0;var _0x25c08f=_0xe706[_0x57bd4f];return _0x25c08f;};'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 7b518a6..8cc3a1e 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 _0xfbcd=['path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api'];(function(_0x100d4c,_0x1d1e60){var _0x1bce92=function(_0x2dcb8d){while(--_0x2dcb8d){_0x100d4c['push'](_0x100d4c['shift']());}};_0x1bce92(++_0x1d1e60);}(_0xfbcd,0x110));var _0xdfbc=function(_0x15bc08,_0x4eeed7){_0x15bc08=_0x15bc08-0x0;var _0x3e67ee=_0xfbcd[_0x15bc08];return _0x3e67ee;};'use strict';var _=require(_0xdfbc('0x0'));var util=require(_0xdfbc('0x1'));var logger=require(_0xdfbc('0x2'))(_0xdfbc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdfbc('0x4'));var rimraf=require(_0xdfbc('0x5'));var config=require(_0xdfbc('0x6'));var attributes=require(_0xdfbc('0x7'));module[_0xdfbc('0x8')]=function(_0x29c8b6,_0x407412){return _0x29c8b6[_0xdfbc('0x9')](_0xdfbc('0xa'),attributes,{'tableName':_0xdfbc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a51=['path','../../config/environment','exports','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2e819c,_0x3f99a5){var _0x24e271=function(_0x27d596){while(--_0x27d596){_0x2e819c['push'](_0x2e819c['shift']());}};_0x24e271(++_0x3f99a5);}(_0x6a51,0xcd));var _0x16a5=function(_0x445101,_0x2414bf){_0x445101=_0x445101-0x0;var _0x3c3d04=_0x6a51[_0x445101];return _0x3c3d04;};'use strict';var _=require(_0x16a5('0x0'));var util=require(_0x16a5('0x1'));var logger=require(_0x16a5('0x2'))('api');var moment=require(_0x16a5('0x3'));var BPromise=require(_0x16a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x16a5('0x5'));var rimraf=require('rimraf');var config=require(_0x16a5('0x6'));var attributes=require('./userSmsQueue.attributes');module[_0x16a5('0x7')]=function(_0x18b3d6,_0x4aaab7){return _0x18b3d6['define'](_0x16a5('0x8'),attributes,{'tableName':_0x16a5('0x9'),'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 3994b90..449dc83 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 _0x02b5=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','result','catch','lodash','moment'];(function(_0x23c6f2,_0x4e033c){var _0x4c270b=function(_0x4913f0){while(--_0x4913f0){_0x23c6f2['push'](_0x23c6f2['shift']());}};_0x4c270b(++_0x4e033c);}(_0x02b5,0x11e));var _0x502b=function(_0x542560,_0x491653){_0x542560=_0x542560-0x0;var _0x4b6f20=_0x02b5[_0x542560];return _0x4b6f20;};'use strict';var _=require(_0x502b('0x0'));var util=require('util');var moment=require(_0x502b('0x1'));var BPromise=require(_0x502b('0x2'));var rs=require(_0x502b('0x3'));var fs=require('fs');var Redis=require(_0x502b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x502b('0x5'));var logger=require(_0x502b('0x6'))(_0x502b('0x7'));var config=require(_0x502b('0x8'));var jayson=require(_0x502b('0x9'));var client=jayson[_0x502b('0xa')][_0x502b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a326f,_0x572d72,_0x46e858){return new BPromise(function(_0x3681b8,_0x392e7f){return client[_0x502b('0xc')](_0x2a326f,_0x46e858)[_0x502b('0xd')](function(_0x1d8740){logger[_0x502b('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x572d72,_0x502b('0xf'));logger['debug'](_0x502b('0x10'),_0x572d72,'request\x20sent',JSON[_0x502b('0x11')](_0x1d8740));if(_0x1d8740[_0x502b('0x12')]){if(_0x1d8740['error'][_0x502b('0x13')]===0x1f4){logger[_0x502b('0x12')](_0x502b('0x14'),_0x572d72,_0x1d8740[_0x502b('0x12')]['message']);return _0x392e7f(_0x1d8740[_0x502b('0x12')][_0x502b('0x15')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x572d72,_0x1d8740[_0x502b('0x12')][_0x502b('0x15')]);return _0x3681b8(_0x1d8740['error'][_0x502b('0x15')]);}else{logger['info'](_0x502b('0x14'),_0x572d72,_0x502b('0xf'));_0x3681b8(_0x1d8740[_0x502b('0x16')][_0x502b('0x15')]);}})[_0x502b('0x17')](function(_0x24ce2d){logger[_0x502b('0x12')](_0x502b('0x14'),_0x572d72,_0x24ce2d);_0x392e7f(_0x24ce2d);});});} \ No newline at end of file +var _0x9128=['request\x20sent','stringify','error','UserSmsQueue,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9128,0x8d));var _0x8912=function(_0x4d8789,_0x3fdff1){_0x4d8789=_0x4d8789-0x0;var _0x404e41=_0x9128[_0x4d8789];return _0x404e41;};'use strict';var _=require(_0x8912('0x0'));var util=require(_0x8912('0x1'));var moment=require(_0x8912('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8912('0x3'));var db=require(_0x8912('0x4'))['db'];var utils=require(_0x8912('0x5'));var logger=require(_0x8912('0x6'))(_0x8912('0x7'));var config=require(_0x8912('0x8'));var jayson=require(_0x8912('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x981cd,_0xadfa39,_0x16826c){return new BPromise(function(_0x4b66fd,_0x469f65){return client['request'](_0x981cd,_0x16826c)[_0x8912('0xa')](function(_0x2b79ca){logger['info']('UserSmsQueue,\x20%s,\x20%s',_0xadfa39,_0x8912('0xb'));logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0xadfa39,_0x8912('0xb'),JSON[_0x8912('0xc')](_0x2b79ca));if(_0x2b79ca[_0x8912('0xd')]){if(_0x2b79ca[_0x8912('0xd')]['code']===0x1f4){logger[_0x8912('0xd')](_0x8912('0xe'),_0xadfa39,_0x2b79ca[_0x8912('0xd')][_0x8912('0xf')]);return _0x469f65(_0x2b79ca[_0x8912('0xd')][_0x8912('0xf')]);}logger[_0x8912('0xd')](_0x8912('0xe'),_0xadfa39,_0x2b79ca[_0x8912('0xd')][_0x8912('0xf')]);return _0x4b66fd(_0x2b79ca[_0x8912('0xd')][_0x8912('0xf')]);}else{logger[_0x8912('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0xadfa39,_0x8912('0xb'));_0x4b66fd(_0x2b79ca[_0x8912('0x11')][_0x8912('0xf')]);}})[_0x8912('0x12')](function(_0x13cba9){logger[_0x8912('0xd')](_0x8912('0xe'),_0xadfa39,_0x13cba9);_0x469f65(_0x13cba9);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 75568bf..5a010d4 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 _0xdded=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util','path'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xdded,0x14a));var _0xddde=function(_0x128dd7,_0x2eee8e){_0x128dd7=_0x128dd7-0x0;var _0x51f070=_0xdded[_0x128dd7];return _0x51f070;};'use strict';var multer=require(_0xddde('0x0'));var util=require(_0xddde('0x1'));var path=require(_0xddde('0x2'));var timeout=require(_0xddde('0x3'));var express=require(_0xddde('0x4'));var router=express[_0xddde('0x5')]();var auth=require(_0xddde('0x6'));var interaction=require(_0xddde('0x7'));var config=require(_0xddde('0x8'));module['exports']=router; \ No newline at end of file +var _0x2cbe=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x25cd57,_0x65e923){var _0x737a2d=function(_0xc846ea){while(--_0xc846ea){_0x25cd57['push'](_0x25cd57['shift']());}};_0x737a2d(++_0x65e923);}(_0x2cbe,0x11f));var _0xe2cb=function(_0x428774,_0x383962){_0x428774=_0x428774-0x0;var _0x53a01c=_0x2cbe[_0x428774];return _0x53a01c;};'use strict';var multer=require(_0xe2cb('0x0'));var util=require('util');var path=require(_0xe2cb('0x1'));var timeout=require(_0xe2cb('0x2'));var express=require(_0xe2cb('0x3'));var router=express[_0xe2cb('0x4')]();var auth=require(_0xe2cb('0x5'));var interaction=require(_0xe2cb('0x6'));var config=require(_0xe2cb('0x7'));module[_0xe2cb('0x8')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index c10683b..f830d92 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(_0x1d6a2c,_0xcf2361){var _0x58fa00=function(_0x2e2f34){while(--_0x2e2f34){_0x1d6a2c['push'](_0x1d6a2c['shift']());}};_0x58fa00(++_0xcf2361);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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(_0x56d896,_0x3b4c9c){var _0x293639=function(_0x126c14){while(--_0x126c14){_0x56d896['push'](_0x56d896['shift']());}};_0x293639(++_0x3b4c9c);}(_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/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index b3b586d..f95d7bf 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 _0xed1f=['user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue'];(function(_0x4ae56a,_0x103522){var _0x3399ec=function(_0x54977f){while(--_0x54977f){_0x4ae56a['push'](_0x4ae56a['shift']());}};_0x3399ec(++_0x103522);}(_0xed1f,0x6a));var _0xfed1=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0xed1f[_0x1b6c6d];return _0x290d9d;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var logger=require(_0xfed1('0x2'))(_0xfed1('0x3'));var moment=require(_0xfed1('0x4'));var BPromise=require(_0xfed1('0x5'));var rp=require(_0xfed1('0x6'));var fs=require('fs');var path=require(_0xfed1('0x7'));var rimraf=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var attributes=require(_0xfed1('0xa'));module[_0xfed1('0xb')]=function(_0x3d6706,_0x42751d){return _0x3d6706[_0xfed1('0xc')](_0xfed1('0xd'),attributes,{'tableName':_0xfed1('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b9b=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues'];(function(_0x4a46d9,_0x35f52f){var _0x121b4f=function(_0x239347){while(--_0x239347){_0x4a46d9['push'](_0x4a46d9['shift']());}};_0x121b4f(++_0x35f52f);}(_0x9b9b,0x114));var _0xb9b9=function(_0x1e77ed,_0x5720c1){_0x1e77ed=_0x1e77ed-0x0;var _0x32ed55=_0x9b9b[_0x1e77ed];return _0x32ed55;};'use strict';var _=require('lodash');var util=require(_0xb9b9('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb9b9('0x1'));var BPromise=require(_0xb9b9('0x2'));var rp=require(_0xb9b9('0x3'));var fs=require('fs');var path=require(_0xb9b9('0x4'));var rimraf=require(_0xb9b9('0x5'));var config=require(_0xb9b9('0x6'));var attributes=require(_0xb9b9('0x7'));module[_0xb9b9('0x8')]=function(_0x79dd,_0x3d1a95){return _0x79dd[_0xb9b9('0x9')](_0xb9b9('0xa'),attributes,{'tableName':_0xb9b9('0xb'),'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 1d20e90..4baa01f 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 _0xacc2=['UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','../../mysqldb','rpc','jayson/promise','client','http','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x10136e,_0x1bb577){var _0x34be9a=function(_0x3af687){while(--_0x3af687){_0x10136e['push'](_0x10136e['shift']());}};_0x34be9a(++_0x1bb577);}(_0xacc2,0x126));var _0x2acc=function(_0x5c878f,_0x2c49c1){_0x5c878f=_0x5c878f-0x0;var _0x1f0c5b=_0xacc2[_0x5c878f];return _0x1f0c5b;};'use strict';var _=require(_0x2acc('0x0'));var util=require(_0x2acc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2acc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2acc('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2acc('0x4'));var config=require('../../config/environment');var jayson=require(_0x2acc('0x5'));var client=jayson[_0x2acc('0x6')][_0x2acc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x16f8f2,_0x36fc6f,_0x4cec40){return new BPromise(function(_0x3c9e7f,_0x4aff24){return client['request'](_0x16f8f2,_0x4cec40)['then'](function(_0x4164f9){logger[_0x2acc('0x8')](_0x2acc('0x9'),_0x36fc6f,_0x2acc('0xa'));logger[_0x2acc('0xb')](_0x2acc('0xc'),_0x36fc6f,_0x2acc('0xa'),JSON[_0x2acc('0xd')](_0x4164f9));if(_0x4164f9[_0x2acc('0xe')]){if(_0x4164f9[_0x2acc('0xe')]['code']===0x1f4){logger[_0x2acc('0xe')](_0x2acc('0x9'),_0x36fc6f,_0x4164f9[_0x2acc('0xe')]['message']);return _0x4aff24(_0x4164f9[_0x2acc('0xe')][_0x2acc('0xf')]);}logger[_0x2acc('0xe')](_0x2acc('0x9'),_0x36fc6f,_0x4164f9['error'][_0x2acc('0xf')]);return _0x3c9e7f(_0x4164f9[_0x2acc('0xe')][_0x2acc('0xf')]);}else{logger[_0x2acc('0x8')](_0x2acc('0x9'),_0x36fc6f,_0x2acc('0xa'));_0x3c9e7f(_0x4164f9[_0x2acc('0x10')][_0x2acc('0xf')]);}})[_0x2acc('0x11')](function(_0x436e48){logger[_0x2acc('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x36fc6f,_0x436e48);_0x4aff24(_0x436e48);});});} \ No newline at end of file +var _0x75a6=['client','http','request','info','UserVoiceQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x75a6,0x11e));var _0x675a=function(_0x122f9f,_0x37b1aa){_0x122f9f=_0x122f9f-0x0;var _0x4e8f0c=_0x75a6[_0x122f9f];return _0x4e8f0c;};'use strict';var _=require(_0x675a('0x0'));var util=require('util');var moment=require(_0x675a('0x1'));var BPromise=require(_0x675a('0x2'));var rs=require(_0x675a('0x3'));var fs=require('fs');var Redis=require(_0x675a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x675a('0x5'))(_0x675a('0x6'));var config=require(_0x675a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x675a('0x8')][_0x675a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e93c5,_0x280a8c,_0x2ceec8){return new BPromise(function(_0x38326d,_0x2365d2){return client[_0x675a('0xa')](_0x1e93c5,_0x2ceec8)['then'](function(_0xeb79fb){logger[_0x675a('0xb')](_0x675a('0xc'),_0x280a8c,'request\x20sent');logger[_0x675a('0xd')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x280a8c,_0x675a('0xe'),JSON[_0x675a('0xf')](_0xeb79fb));if(_0xeb79fb[_0x675a('0x10')]){if(_0xeb79fb[_0x675a('0x10')][_0x675a('0x11')]===0x1f4){logger[_0x675a('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x280a8c,_0xeb79fb['error'][_0x675a('0x12')]);return _0x2365d2(_0xeb79fb[_0x675a('0x10')][_0x675a('0x12')]);}logger[_0x675a('0x10')](_0x675a('0xc'),_0x280a8c,_0xeb79fb[_0x675a('0x10')]['message']);return _0x38326d(_0xeb79fb['error'][_0x675a('0x12')]);}else{logger['info'](_0x675a('0xc'),_0x280a8c,_0x675a('0xe'));_0x38326d(_0xeb79fb[_0x675a('0x13')][_0x675a('0x12')]);}})[_0x675a('0x14')](function(_0x1f4206){logger[_0x675a('0x10')](_0x675a('0xc'),_0x280a8c,_0x1f4206);_0x2365d2(_0x1f4206);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 92bd362..f6fa763 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 _0x06eb=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','exports','multer','util','path'];(function(_0x52e68e,_0x309912){var _0x3211a4=function(_0x467c01){while(--_0x467c01){_0x52e68e['push'](_0x52e68e['shift']());}};_0x3211a4(++_0x309912);}(_0x06eb,0x1c8));var _0xb06e=function(_0x5aee55,_0x1f2203){_0x5aee55=_0x5aee55-0x0;var _0x3ef38f=_0x06eb[_0x5aee55];return _0x3ef38f;};'use strict';var multer=require(_0xb06e('0x0'));var util=require(_0xb06e('0x1'));var path=require(_0xb06e('0x2'));var timeout=require(_0xb06e('0x3'));var express=require(_0xb06e('0x4'));var router=express[_0xb06e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb06e('0x6'));var config=require(_0xb06e('0x7'));module[_0xb06e('0x8')]=router; \ No newline at end of file +var _0xef21=['path','../../components/interaction/service','exports'];(function(_0x4b3067,_0x4cd498){var _0x4d4e6e=function(_0x1afeaa){while(--_0x1afeaa){_0x4b3067['push'](_0x4b3067['shift']());}};_0x4d4e6e(++_0x4cd498);}(_0xef21,0x1e3));var _0x1ef2=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xef21[_0x1a36a5];return _0x746243;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1ef2('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x1ef2('0x1'));var config=require('../../config/environment');module[_0x1ef2('0x2')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 70ab2ff..f5f9b92 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 _0x98a0=['Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','exports','INTEGER'];(function(_0x10d6cd,_0xd52be){var _0x3657e5=function(_0x37e281){while(--_0x37e281){_0x10d6cd['push'](_0x10d6cd['shift']());}};_0x3657e5(++_0xd52be);}(_0x98a0,0x1c5));var _0x098a=function(_0x50a35b,_0xea2c16){_0x50a35b=_0x50a35b-0x0;var _0x5c75dd=_0x98a0[_0x50a35b];return _0x5c75dd;};'use strict';var Sequelize=require(_0x098a('0x0'));module[_0x098a('0x1')]={'uniqueid':{'type':Sequelize[_0x098a('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x098a('0x3')},'membername':{'type':Sequelize[_0x098a('0x4')],'allowNull':![],'comment':_0x098a('0x3')},'UserId':{'type':Sequelize[_0x098a('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x098a('0x4')],'allowNull':![],'unique':_0x098a('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x098a('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x098a('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x098a('0x3')},'penalty':{'type':Sequelize[_0x098a('0x2')](0xb),'defaultValue':0x0,'comment':_0x098a('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0xa03e=['INTEGER','STRING','Required\x20by\x20Asterisk','queue_interface','exports'];(function(_0x33f81c,_0xd92e96){var _0x532a09=function(_0x930b75){while(--_0x930b75){_0x33f81c['push'](_0x33f81c['shift']());}};_0x532a09(++_0xd92e96);}(_0xa03e,0x144));var _0xea03=function(_0x4230fe,_0x25552a){_0x4230fe=_0x4230fe-0x0;var _0x16cfca=_0xa03e[_0x4230fe];return _0x16cfca;};'use strict';var Sequelize=require('sequelize');module[_0xea03('0x0')]={'uniqueid':{'type':Sequelize[_0xea03('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xea03('0x2')],'allowNull':![],'comment':_0xea03('0x3')},'UserId':{'type':Sequelize[_0xea03('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xea03('0x2')],'allowNull':![],'unique':'queue_interface','comment':_0xea03('0x3')},'VoiceQueueId':{'type':Sequelize[_0xea03('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xea03('0x2')],'allowNull':![],'unique':_0xea03('0x4'),'comment':_0xea03('0x3')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xea03('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xea03('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 9e1bdfa..0052440 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 _0xc41a=['save','update','emit','hasOwnProperty','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x26600e,_0x243088){var _0x5347f8=function(_0x21702c){while(--_0x21702c){_0x26600e['push'](_0x26600e['shift']());}};_0x5347f8(++_0x243088);}(_0xc41a,0x194));var _0xac41=function(_0x4a8996,_0x1ffa34){_0x4a8996=_0x4a8996-0x0;var _0x3baac1=_0xc41a[_0x4a8996];return _0x3baac1;};'use strict';var EventEmitter=require(_0xac41('0x0'));var UserVoiceQueueRt=require(_0xac41('0x1'))['db'][_0xac41('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xac41('0x3')](0x0);var events={'afterCreate':_0xac41('0x4'),'afterUpdate':_0xac41('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4b2522){return function(_0x38e96f,_0x207c0e,_0x2c9a61){UserVoiceQueueRtEvents[_0xac41('0x6')](_0x4b2522+':'+_0x38e96f['id'],_0x38e96f);UserVoiceQueueRtEvents[_0xac41('0x6')](_0x4b2522,_0x38e96f);_0x2c9a61(null);};}for(var e in events){if(events[_0xac41('0x7')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x2611=['UserVoiceQueueRt','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x138c68,_0x51ef61){var _0x457e23=function(_0xce7cb5){while(--_0xce7cb5){_0x138c68['push'](_0x138c68['shift']());}};_0x457e23(++_0x51ef61);}(_0x2611,0x1dc));var _0x1261=function(_0x374170,_0x2405e7){_0x374170=_0x374170-0x0;var _0x213db3=_0x2611[_0x374170];return _0x213db3;};'use strict';var EventEmitter=require(_0x1261('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x1261('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x1261('0x2')](0x0);var events={'afterCreate':_0x1261('0x3'),'afterUpdate':'update','afterDestroy':_0x1261('0x4')};function emitEvent(_0x3bbd63){return function(_0x362daa,_0x2452a9,_0x55539f){UserVoiceQueueRtEvents[_0x1261('0x5')](_0x3bbd63+':'+_0x362daa['id'],_0x362daa);UserVoiceQueueRtEvents[_0x1261('0x5')](_0x3bbd63,_0x362daa);_0x55539f(null);};}for(var e in events){if(events[_0x1261('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x1261('0x7')](e,emitEvent(event));}}module[_0x1261('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 561d45b..3e9c577 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 _0x9689=['request-promise','rimraf','../../config/environment','./userVoiceQueueRt.attributes','user_has_voice_queues_rt','util','../../config/logger','api','moment','bluebird'];(function(_0x54ac2b,_0x51f6dd){var _0x5b1586=function(_0x11912d){while(--_0x11912d){_0x54ac2b['push'](_0x54ac2b['shift']());}};_0x5b1586(++_0x51f6dd);}(_0x9689,0x69));var _0x9968=function(_0xe3470f,_0x547dcb){_0xe3470f=_0xe3470f-0x0;var _0x5b7ee3=_0x9689[_0xe3470f];return _0x5b7ee3;};'use strict';var _=require('lodash');var util=require(_0x9968('0x0'));var logger=require(_0x9968('0x1'))(_0x9968('0x2'));var moment=require(_0x9968('0x3'));var BPromise=require(_0x9968('0x4'));var rp=require(_0x9968('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9968('0x6'));var config=require(_0x9968('0x7'));var attributes=require(_0x9968('0x8'));module['exports']=function(_0x440c75,_0x1eeaba){return _0x440c75['define']('UserVoiceQueueRt',attributes,{'tableName':_0x9968('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d35=['path','rimraf','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1cade0,_0x9b9e80){var _0x51c0a2=function(_0x4a5607){while(--_0x4a5607){_0x1cade0['push'](_0x1cade0['shift']());}};_0x51c0a2(++_0x9b9e80);}(_0x0d35,0x172));var _0x50d3=function(_0xdab90e,_0x5261db){_0xdab90e=_0xdab90e-0x0;var _0x4d917e=_0x0d35[_0xdab90e];return _0x4d917e;};'use strict';var _=require(_0x50d3('0x0'));var util=require(_0x50d3('0x1'));var logger=require(_0x50d3('0x2'))(_0x50d3('0x3'));var moment=require(_0x50d3('0x4'));var BPromise=require(_0x50d3('0x5'));var rp=require(_0x50d3('0x6'));var fs=require('fs');var path=require(_0x50d3('0x7'));var rimraf=require(_0x50d3('0x8'));var config=require('../../config/environment');var attributes=require(_0x50d3('0x9'));module[_0x50d3('0xa')]=function(_0x50fee9,_0x38c69d){return _0x50fee9[_0x50d3('0xb')](_0x50d3('0xc'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index cf2de56..97336ce 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 _0x7a68=['code','error','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','sequelize','COUNT','literal','outboundQueuePauses','debug','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x12c562,_0x4a15a9){var _0x184d9c=function(_0x2d5b73){while(--_0x2d5b73){_0x12c562['push'](_0x12c562['shift']());}};_0x184d9c(++_0x4a15a9);}(_0x7a68,0x84));var _0x87a6=function(_0x14bd60,_0x73b2f9){_0x14bd60=_0x14bd60-0x0;var _0x4b0a31=_0x7a68[_0x14bd60];return _0x4b0a31;};'use strict';var _=require(_0x87a6('0x0'));var util=require(_0x87a6('0x1'));var moment=require(_0x87a6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x87a6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x87a6('0x4'));var logger=require(_0x87a6('0x5'))(_0x87a6('0x6'));var config=require(_0x87a6('0x7'));var jayson=require(_0x87a6('0x8'));var client=jayson[_0x87a6('0x9')][_0x87a6('0xa')]({'port':0x232a});config[_0x87a6('0xb')]=_[_0x87a6('0xc')](config['redis'],{'host':_0x87a6('0xd'),'port':0x18eb});var socket=require(_0x87a6('0xe'))(new Redis(config[_0x87a6('0xb')]));require(_0x87a6('0xf'))[_0x87a6('0x10')](socket);function respondWithRpcPromise(_0x32ca78,_0x155f4a,_0xed7758){return new BPromise(function(_0x225c20,_0x17eb94){return client[_0x87a6('0x11')](_0x32ca78,_0xed7758)[_0x87a6('0x12')](function(_0x42c10f){logger[_0x87a6('0x13')](_0x87a6('0x14'),_0x155f4a,_0x87a6('0x15'));logger['debug'](_0x87a6('0x16'),_0x155f4a,_0x87a6('0x15'),JSON[_0x87a6('0x17')](_0x42c10f));if(_0x42c10f['error']){if(_0x42c10f['error'][_0x87a6('0x18')]===0x1f4){logger[_0x87a6('0x19')](_0x87a6('0x14'),_0x155f4a,_0x42c10f[_0x87a6('0x19')][_0x87a6('0x1a')]);return _0x17eb94(_0x42c10f['error'][_0x87a6('0x1a')]);}logger[_0x87a6('0x19')](_0x87a6('0x14'),_0x155f4a,_0x42c10f[_0x87a6('0x19')][_0x87a6('0x1a')]);return _0x225c20(_0x42c10f[_0x87a6('0x19')]['message']);}else{logger[_0x87a6('0x13')](_0x87a6('0x14'),_0x155f4a,'request\x20sent');_0x225c20(_0x42c10f[_0x87a6('0x1b')][_0x87a6('0x1a')]);}})[_0x87a6('0x1c')](function(_0x4dae0e){logger['error'](_0x87a6('0x14'),_0x155f4a,_0x4dae0e);_0x17eb94(_0x4dae0e);});});}exports[_0x87a6('0x1d')]=function(_0x1ca466){var _0x11a84d=this;return new Promise(function(_0x372493,_0x583720){return db[_0x87a6('0x1e')][_0x87a6('0x1f')]({'raw':_0x1ca466['options']?_0x1ca466[_0x87a6('0x20')][_0x87a6('0x21')]===undefined?!![]:![]:!![],'where':_0x1ca466[_0x87a6('0x20')]?_0x1ca466['options']['where']||null:null,'attributes':[[db[_0x87a6('0x22')]['fn'](_0x87a6('0x23'),db[_0x87a6('0x22')]['fn']('IF',db[_0x87a6('0x22')][_0x87a6('0x24')]('`paused`\x20=\x201,\x201,\x20null'))),_0x87a6('0x25')]]})[_0x87a6('0x12')](function(_0xd7dd88){logger[_0x87a6('0x13')](_0x87a6('0x1d'),_0x1ca466);logger[_0x87a6('0x26')]('GetVoiceQueueRtPauses',_0x1ca466,JSON[_0x87a6('0x17')](_0xd7dd88));_0x372493(_0xd7dd88);})[_0x87a6('0x1c')](function(_0x2d4a84){logger[_0x87a6('0x19')]('GetVoiceQueueRtPauses',_0x2d4a84['message'],_0x1ca466);_0x583720(_0x11a84d['error'](0x1f4,_0x2d4a84['message']));});});}; \ No newline at end of file +var _0xa1cb=['options','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','GetVoiceQueueRtPauses','findAll'];(function(_0x5c6994,_0x19ad9a){var _0x1d5c84=function(_0x4a385a){while(--_0x4a385a){_0x5c6994['push'](_0x5c6994['shift']());}};_0x1d5c84(++_0x19ad9a);}(_0xa1cb,0xe6));var _0xba1c=function(_0x2ea1ee,_0x5c8ad1){_0x2ea1ee=_0x2ea1ee-0x0;var _0xe5f0f5=_0xa1cb[_0x2ea1ee];return _0xe5f0f5;};'use strict';var _=require(_0xba1c('0x0'));var util=require(_0xba1c('0x1'));var moment=require(_0xba1c('0x2'));var BPromise=require(_0xba1c('0x3'));var rs=require(_0xba1c('0x4'));var fs=require('fs');var Redis=require(_0xba1c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xba1c('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xba1c('0x7'));var jayson=require(_0xba1c('0x8'));var client=jayson['client'][_0xba1c('0x9')]({'port':0x232a});config[_0xba1c('0xa')]=_['defaults'](config[_0xba1c('0xa')],{'host':_0xba1c('0xb'),'port':0x18eb});var socket=require(_0xba1c('0xc'))(new Redis(config[_0xba1c('0xa')]));require('./userVoiceQueueRt.socket')['register'](socket);function respondWithRpcPromise(_0x119ca9,_0x236843,_0x4d24ca){return new BPromise(function(_0x2ce833,_0x429d8d){return client[_0xba1c('0xd')](_0x119ca9,_0x4d24ca)[_0xba1c('0xe')](function(_0x2785f4){logger[_0xba1c('0xf')](_0xba1c('0x10'),_0x236843,'request\x20sent');logger[_0xba1c('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x236843,'request\x20sent',JSON[_0xba1c('0x12')](_0x2785f4));if(_0x2785f4[_0xba1c('0x13')]){if(_0x2785f4[_0xba1c('0x13')][_0xba1c('0x14')]===0x1f4){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x236843,_0x2785f4[_0xba1c('0x13')][_0xba1c('0x15')]);return _0x429d8d(_0x2785f4['error'][_0xba1c('0x15')]);}logger[_0xba1c('0x13')](_0xba1c('0x10'),_0x236843,_0x2785f4[_0xba1c('0x13')][_0xba1c('0x15')]);return _0x2ce833(_0x2785f4[_0xba1c('0x13')][_0xba1c('0x15')]);}else{logger[_0xba1c('0xf')](_0xba1c('0x10'),_0x236843,_0xba1c('0x16'));_0x2ce833(_0x2785f4['result'][_0xba1c('0x15')]);}})[_0xba1c('0x17')](function(_0xe4a8d2){logger['error'](_0xba1c('0x10'),_0x236843,_0xe4a8d2);_0x429d8d(_0xe4a8d2);});});}exports[_0xba1c('0x18')]=function(_0x3ae0bc){var _0x2122c4=this;return new Promise(function(_0x182654,_0x1b90d2){return db['UserVoiceQueueRt'][_0xba1c('0x19')]({'raw':_0x3ae0bc[_0xba1c('0x1a')]?_0x3ae0bc['options']['raw']===undefined?!![]:![]:!![],'where':_0x3ae0bc[_0xba1c('0x1a')]?_0x3ae0bc[_0xba1c('0x1a')][_0xba1c('0x1b')]||null:null,'attributes':[[db[_0xba1c('0x1c')]['fn'](_0xba1c('0x1d'),db[_0xba1c('0x1c')]['fn']('IF',db[_0xba1c('0x1c')]['literal'](_0xba1c('0x1e')))),_0xba1c('0x1f')]]})[_0xba1c('0xe')](function(_0x29790c){logger['info'](_0xba1c('0x18'),_0x3ae0bc);logger[_0xba1c('0x11')](_0xba1c('0x18'),_0x3ae0bc,JSON[_0xba1c('0x12')](_0x29790c));_0x182654(_0x29790c);})[_0xba1c('0x17')](function(_0x1babe5){logger[_0xba1c('0x13')](_0xba1c('0x18'),_0x1babe5[_0xba1c('0x15')],_0x3ae0bc);_0x1b90d2(_0x2122c4[_0xba1c('0x13')](0x1f4,_0x1babe5[_0xba1c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 9d7ed04..7b969fa 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 _0x9e94=['length','userVoiceQueueRt:','./userVoiceQueueRt.events','update','emit','removeListener','register'];(function(_0x307430,_0x5e8161){var _0x16b75a=function(_0x2dd25e){while(--_0x2dd25e){_0x307430['push'](_0x307430['shift']());}};_0x16b75a(++_0x5e8161);}(_0x9e94,0x12f));var _0x49e9=function(_0x10e6b4,_0xd89b9b){_0x10e6b4=_0x10e6b4-0x0;var _0x1c69c4=_0x9e94[_0x10e6b4];return _0x1c69c4;};'use strict';var UserVoiceQueueRtEvents=require(_0x49e9('0x0'));var events=['save','remove',_0x49e9('0x1')];function createListener(_0x1f258f,_0x645191){return function(_0x20d42e){_0x645191[_0x49e9('0x2')](_0x1f258f,_0x20d42e);};}function removeListener(_0x2da599,_0x53bf3d){return function(){UserVoiceQueueRtEvents[_0x49e9('0x3')](_0x2da599,_0x53bf3d);};}exports[_0x49e9('0x4')]=function(_0x4d031d){for(var _0x4ababa=0x0,_0x24a402=events[_0x49e9('0x5')];_0x4ababa<_0x24a402;_0x4ababa++){var _0x1dc065=events[_0x4ababa];var _0x243b74=createListener(_0x49e9('0x6')+_0x1dc065,_0x4d031d);UserVoiceQueueRtEvents['on'](_0x1dc065,_0x243b74);}}; \ No newline at end of file +var _0x867c=['emit','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','update'];(function(_0x1afea6,_0x314555){var _0x3d54eb=function(_0x3eb1e2){while(--_0x3eb1e2){_0x1afea6['push'](_0x1afea6['shift']());}};_0x3d54eb(++_0x314555);}(_0x867c,0xbd));var _0xc867=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0x867c[_0x30faec];return _0x29484f;};'use strict';var UserVoiceQueueRtEvents=require(_0xc867('0x0'));var events=[_0xc867('0x1'),'remove',_0xc867('0x2')];function createListener(_0x5350cd,_0x2193b3){return function(_0x551afb){_0x2193b3[_0xc867('0x3')](_0x5350cd,_0x551afb);};}function removeListener(_0x2c78d8,_0x3a354b){return function(){UserVoiceQueueRtEvents[_0xc867('0x4')](_0x2c78d8,_0x3a354b);};}exports[_0xc867('0x5')]=function(_0x486d06){for(var _0x3c1616=0x0,_0x1e9f39=events[_0xc867('0x6')];_0x3c1616<_0x1e9f39;_0x3c1616++){var _0x5e3988=events[_0x3c1616];var _0x257d4b=createListener(_0xc867('0x7')+_0x5e3988,_0x486d06);UserVoiceQueueRtEvents['on'](_0x5e3988,_0x257d4b);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 40507e0..67ba701 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 _0x4b32=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','index','get','/:id','isAuthenticated','show','create','put','destroy','exports','multer','connect-timeout','express'];(function(_0x5163c7,_0x5e4498){var _0x41c36f=function(_0x13f33d){while(--_0x13f33d){_0x5163c7['push'](_0x5163c7['shift']());}};_0x41c36f(++_0x5e4498);}(_0x4b32,0x96));var _0x24b3=function(_0x3397b4,_0x477b27){_0x3397b4=_0x3397b4-0x0;var _0x5717c7=_0x4b32[_0x3397b4];return _0x5717c7;};'use strict';var multer=require(_0x24b3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x24b3('0x1'));var express=require(_0x24b3('0x2'));var router=express[_0x24b3('0x3')]();var auth=require(_0x24b3('0x4'));var interaction=require(_0x24b3('0x5'));var config=require(_0x24b3('0x6'));var controller=require(_0x24b3('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x24b3('0x8')]);router[_0x24b3('0x9')](_0x24b3('0xa'),auth[_0x24b3('0xb')](),controller[_0x24b3('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x24b3('0xd')]);router[_0x24b3('0xe')](_0x24b3('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x24b3('0xa'),auth[_0x24b3('0xb')](),controller[_0x24b3('0xf')]);module[_0x24b3('0x10')]=router; \ No newline at end of file +var _0xf8d3=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./variable.controller','get','index','isAuthenticated','create','put'];(function(_0x15ccfe,_0xb6e509){var _0x538030=function(_0x5b16f1){while(--_0x5b16f1){_0x15ccfe['push'](_0x15ccfe['shift']());}};_0x538030(++_0xb6e509);}(_0xf8d3,0xb0));var _0x3f8d=function(_0x223a00,_0x1f1e9f){_0x223a00=_0x223a00-0x0;var _0x152f91=_0xf8d3[_0x223a00];return _0x152f91;};'use strict';var multer=require(_0x3f8d('0x0'));var util=require(_0x3f8d('0x1'));var path=require(_0x3f8d('0x2'));var timeout=require(_0x3f8d('0x3'));var express=require(_0x3f8d('0x4'));var router=express[_0x3f8d('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x3f8d('0x6'));var config=require(_0x3f8d('0x7'));var controller=require(_0x3f8d('0x8'));router[_0x3f8d('0x9')]('/',auth['isAuthenticated'](),controller[_0x3f8d('0xa')]);router[_0x3f8d('0x9')]('/:id',auth[_0x3f8d('0xb')](),controller['show']);router['post']('/',auth[_0x3f8d('0xb')](),controller[_0x3f8d('0xc')]);router[_0x3f8d('0xd')](_0x3f8d('0xe'),auth[_0x3f8d('0xb')](),controller[_0x3f8d('0xf')]);router[_0x3f8d('0x10')](_0x3f8d('0xe'),auth[_0x3f8d('0xb')](),controller[_0x3f8d('0x11')]);module[_0x3f8d('0x12')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 8341542..0f63c51 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 _0xa614=['name','sequelize'];(function(_0x554091,_0x3905ed){var _0x1d4809=function(_0x5ba5fe){while(--_0x5ba5fe){_0x554091['push'](_0x554091['shift']());}};_0x1d4809(++_0x3905ed);}(_0xa614,0xd3));var _0x4a61=function(_0x310a1b,_0x4c9129){_0x310a1b=_0x310a1b-0x0;var _0xdea206=_0xa614[_0x310a1b];return _0xdea206;};'use strict';var Sequelize=require(_0x4a61('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4a61('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x97d1=['exports','name','STRING','sequelize'];(function(_0x7737a4,_0x5e2f54){var _0x3509de=function(_0x2ad70a){while(--_0x2ad70a){_0x7737a4['push'](_0x7737a4['shift']());}};_0x3509de(++_0x5e2f54);}(_0x97d1,0xf7));var _0x197d=function(_0xd1cf76,_0x1e667d){_0xd1cf76=_0xd1cf76-0x0;var _0x580cbf=_0x97d1[_0xd1cf76];return _0x580cbf;};'use strict';var Sequelize=require(_0x197d('0x0'));module[_0x197d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x197d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x197d('0x3')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 5087995..92cfb7f 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 _0x96c1=['user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','error','stack','name','send','index','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','params','Variable','keys','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x1daa21,_0x346bb2){var _0x1e32e7=function(_0x5320cf){while(--_0x5320cf){_0x1daa21['push'](_0x1daa21['shift']());}};_0x1e32e7(++_0x346bb2);}(_0x96c1,0x1bd));var _0x196c=function(_0x4fcaa0,_0xcb1d8b){_0x4fcaa0=_0x4fcaa0-0x0;var _0x489a68=_0x96c1[_0x4fcaa0];return _0x489a68;};'use strict';var pdf=require(_0x196c('0x0'));var emlformat=require(_0x196c('0x1'));var rimraf=require(_0x196c('0x2'));var zipdir=require(_0x196c('0x3'));var jsonpatch=require(_0x196c('0x4'));var rp=require(_0x196c('0x5'));var moment=require(_0x196c('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x196c('0x7'));var util=require(_0x196c('0x8'));var path=require(_0x196c('0x9'));var sox=require(_0x196c('0xa'));var csv=require(_0x196c('0xb'));var ejs=require(_0x196c('0xc'));var fs=require('fs');var _=require(_0x196c('0xd'));var squel=require(_0x196c('0xe'));var crypto=require(_0x196c('0xf'));var jsforce=require(_0x196c('0x10'));var deskjs=require(_0x196c('0x11'));var toCsv=require(_0x196c('0xb'));var querystring=require(_0x196c('0x12'));var Papa=require(_0x196c('0x13'));var Redis=require(_0x196c('0x14'));var authService=require(_0x196c('0x15'));var qs=require(_0x196c('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x196c('0x17'))(_0x196c('0x18'));var utils=require(_0x196c('0x19'));var config=require(_0x196c('0x1a'));var db=require(_0x196c('0x1b'))['db'];function respondWithStatusCode(_0x3133d7,_0x495fc3){_0x495fc3=_0x495fc3||0xcc;return function(_0x202657){if(_0x202657){return _0x3133d7[_0x196c('0x1c')](_0x495fc3);}return _0x3133d7[_0x196c('0x1d')](_0x495fc3)[_0x196c('0x1e')]();};}function respondWithResult(_0x3d30f7,_0x4e4080){_0x4e4080=_0x4e4080||0xc8;return function(_0x48839c){if(_0x48839c){return _0x3d30f7[_0x196c('0x1d')](_0x4e4080)[_0x196c('0x1f')](_0x48839c);}};}function respondWithFilteredResult(_0x5243e4,_0x5a1848){return function(_0x56db05){if(_0x56db05){var _0x4122f8=_0x56db05['count'],_0x307416=_0x5a1848[_0x196c('0x20')],_0x5c0b4e=_0x5a1848['offset']+_0x5a1848[_0x196c('0x21')],_0x149519;if(_0x5c0b4e>=_0x4122f8){_0x5c0b4e=_0x4122f8;_0x149519=0xc8;}else{_0x149519=0xce;}_0x5243e4['status'](_0x149519);return _0x5243e4[_0x196c('0x22')](_0x196c('0x23'),_0x307416+'-'+_0x5c0b4e+'/'+_0x4122f8)['json'](_0x56db05);}return null;};}function patchUpdates(_0x5ef4ef){return function(_0x2cb514){try{jsonpatch[_0x196c('0x24')](_0x2cb514,_0x5ef4ef,!![]);}catch(_0x42ce12){return BPromise[_0x196c('0x25')](_0x42ce12);}return _0x2cb514[_0x196c('0x26')]();};}function saveUpdates(_0x589f4e,_0x3e9902){return function(_0x16c8d8){if(_0x16c8d8){return _0x16c8d8[_0x196c('0x27')](_0x589f4e)[_0x196c('0x28')](function(_0x2c1a03){return _0x2c1a03;});}return null;};}function removeEntity(_0x50d99e,_0x5ab980){return function(_0x434816){if(_0x434816){return _0x434816[_0x196c('0x29')]()[_0x196c('0x28')](function(){var _0x5050d2=_0x434816[_0x196c('0x2a')]({'plain':!![]});var _0x12d16b=_0x196c('0x2b');return db[_0x196c('0x2c')][_0x196c('0x29')]({'where':{'type':_0x12d16b,'resourceId':_0x5050d2['id']}})[_0x196c('0x28')](function(){return _0x434816;});})[_0x196c('0x28')](function(){_0x50d99e[_0x196c('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18c780,_0xb9234a){return function(_0xfb779e){if(!_0xfb779e){_0x18c780['sendStatus'](0x194);}return _0xfb779e;};}function handleError(_0x3bbd0f,_0x2dd102){_0x2dd102=_0x2dd102||0x1f4;return function(_0x257b9f){logger[_0x196c('0x2d')](_0x257b9f[_0x196c('0x2e')]);if(_0x257b9f[_0x196c('0x2f')]){delete _0x257b9f['name'];}_0x3bbd0f[_0x196c('0x1d')](_0x2dd102)[_0x196c('0x30')](_0x257b9f);};}exports[_0x196c('0x31')]=function(_0xfa0c28,_0x5e8ea2){var _0x176265={},_0x238771={},_0x196e51={'count':0x0,'rows':[]};var _0x37a81f=_['map'](db['Variable']['rawAttributes'],function(_0x320451){return{'name':_0x320451[_0x196c('0x32')],'type':_0x320451['type'][_0x196c('0x33')]};});_0x238771[_0x196c('0x34')]=_[_0x196c('0x35')](_0x37a81f,_0x196c('0x2f'));_0x238771[_0x196c('0x36')]=_['keys'](_0xfa0c28[_0x196c('0x36')]);_0x238771[_0x196c('0x37')]=_[_0x196c('0x38')](_0x238771[_0x196c('0x34')],_0x238771[_0x196c('0x36')]);_0x176265[_0x196c('0x39')]=_[_0x196c('0x38')](_0x238771['model'],qs[_0x196c('0x3a')](_0xfa0c28[_0x196c('0x36')][_0x196c('0x3a')]));_0x176265[_0x196c('0x39')]=_0x176265[_0x196c('0x39')][_0x196c('0x3b')]?_0x176265[_0x196c('0x39')]:_0x238771['model'];if(!_0xfa0c28[_0x196c('0x36')][_0x196c('0x3c')]('nolimit')){_0x176265[_0x196c('0x21')]=qs['limit'](_0xfa0c28[_0x196c('0x36')]['limit']);_0x176265[_0x196c('0x20')]=qs[_0x196c('0x20')](_0xfa0c28[_0x196c('0x36')]['offset']);}_0x176265[_0x196c('0x3d')]=qs[_0x196c('0x3e')](_0xfa0c28['query'][_0x196c('0x3e')]);_0x176265['where']=qs['filters'](_[_0x196c('0x3f')](_0xfa0c28['query'],_0x238771['filters']));if(_0xfa0c28[_0x196c('0x36')][_0x196c('0x40')]){_0x176265['where']=_['merge'](_0x176265[_0x196c('0x41')],{'$or':_[_0x196c('0x35')](_0x37a81f,function(_0x29d50c){if(_0x29d50c['type']!==_0x196c('0x42')){var _0x3cd974={};_0x3cd974[_0x29d50c[_0x196c('0x2f')]]={'$like':'%'+_0xfa0c28['query'][_0x196c('0x40')]+'%'};return _0x3cd974;}})});}_0x176265=_[_0x196c('0x43')]({},_0x176265,_0xfa0c28[_0x196c('0x44')]);var _0x559fc8={'where':_0x176265[_0x196c('0x41')]};return db['Variable'][_0x196c('0x45')](_0x559fc8)[_0x196c('0x28')](function(_0x3179b5){_0x196e51[_0x196c('0x45')]=_0x3179b5;if(_0xfa0c28[_0x196c('0x36')][_0x196c('0x46')]){_0x176265[_0x196c('0x47')]=[{'all':!![]}];}return db['Variable'][_0x196c('0x48')](_0x176265);})[_0x196c('0x28')](function(_0x3ee439){_0x196e51[_0x196c('0x49')]=_0x3ee439;return _0x196e51;})['then'](respondWithFilteredResult(_0x5e8ea2,_0x176265))[_0x196c('0x4a')](handleError(_0x5e8ea2,null));};exports[_0x196c('0x4b')]=function(_0x101083,_0x5efec7){var _0x4a2bb8={'raw':!![],'where':{'id':_0x101083[_0x196c('0x4c')]['id']}},_0x3757ee={};_0x3757ee[_0x196c('0x34')]=_['keys'](db[_0x196c('0x4d')]['rawAttributes']);_0x3757ee[_0x196c('0x36')]=_[_0x196c('0x4e')](_0x101083[_0x196c('0x36')]);_0x3757ee[_0x196c('0x37')]=_[_0x196c('0x38')](_0x3757ee[_0x196c('0x34')],_0x3757ee[_0x196c('0x36')]);_0x4a2bb8[_0x196c('0x39')]=_[_0x196c('0x38')](_0x3757ee[_0x196c('0x34')],qs['fields'](_0x101083[_0x196c('0x36')][_0x196c('0x3a')]));_0x4a2bb8[_0x196c('0x39')]=_0x4a2bb8[_0x196c('0x39')][_0x196c('0x3b')]?_0x4a2bb8[_0x196c('0x39')]:_0x3757ee[_0x196c('0x34')];if(_0x101083[_0x196c('0x36')][_0x196c('0x46')]){_0x4a2bb8[_0x196c('0x47')]=[{'all':!![]}];}_0x4a2bb8=_[_0x196c('0x43')]({},_0x4a2bb8,_0x101083['options']);return db[_0x196c('0x4d')]['find'](_0x4a2bb8)['then'](handleEntityNotFound(_0x5efec7,null))[_0x196c('0x28')](respondWithResult(_0x5efec7,null))[_0x196c('0x4a')](handleError(_0x5efec7,null));};exports[_0x196c('0x4f')]=function(_0x2873b1,_0xa917a5){return db[_0x196c('0x4d')]['create'](_0x2873b1[_0x196c('0x50')],{})['then'](function(_0x746197){var _0x23d4ec=_0x2873b1['user'][_0x196c('0x2a')]({'plain':!![]});if(!_0x23d4ec)throw new Error(_0x196c('0x51'));if(_0x23d4ec[_0x196c('0x52')]===_0x196c('0x53')){var _0x163c87=_0x746197[_0x196c('0x2a')]({'plain':!![]});var _0x15aa4b='Variables';return db[_0x196c('0x54')][_0x196c('0x55')]({'where':{'name':_0x15aa4b,'userProfileId':_0x23d4ec['userProfileId']},'raw':!![]})['then'](function(_0x22fe85){if(_0x22fe85&&_0x22fe85[_0x196c('0x56')]===0x0){return db[_0x196c('0x2c')]['create']({'name':_0x163c87[_0x196c('0x2f')],'resourceId':_0x163c87['id'],'type':_0x22fe85[_0x196c('0x2f')],'sectionId':_0x22fe85['id']},{})['then'](function(){return _0x746197;});}else{return _0x746197;}})[_0x196c('0x4a')](function(_0x153671){logger[_0x196c('0x2d')](_0x196c('0x57'),_0x153671);throw _0x153671;});}return _0x746197;})[_0x196c('0x28')](respondWithResult(_0xa917a5,0xc9))[_0x196c('0x4a')](handleError(_0xa917a5,null));};exports[_0x196c('0x27')]=function(_0x290982,_0x50ab80){if(_0x290982[_0x196c('0x50')]['id']){delete _0x290982[_0x196c('0x50')]['id'];}return db[_0x196c('0x4d')][_0x196c('0x55')]({'where':{'id':_0x290982[_0x196c('0x4c')]['id']}})[_0x196c('0x28')](handleEntityNotFound(_0x50ab80,null))[_0x196c('0x28')](saveUpdates(_0x290982['body'],null))['then'](respondWithResult(_0x50ab80,null))[_0x196c('0x4a')](handleError(_0x50ab80,null));};exports[_0x196c('0x29')]=function(_0x3e9059,_0x5ee47d){return db[_0x196c('0x4d')][_0x196c('0x55')]({'where':{'id':_0x3e9059[_0x196c('0x4c')]['id']}})[_0x196c('0x28')](handleEntityNotFound(_0x5ee47d,null))['then'](removeEntity(_0x5ee47d,null))['catch'](handleError(_0x5ee47d,null));}; \ No newline at end of file +var _0xb358=['../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','save','then','destroy','get','Variables','UserProfileResource','error','name','send','index','map','Variable','type','key','keys','query','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filters','merge','options','count','includeAll','findAll','rows','catch','params','rawAttributes','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/utils'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xb358,0x1b5));var _0x8b35=function(_0x221079,_0x55c2e5){_0x221079=_0x221079-0x0;var _0x820490=_0xb358[_0x221079];return _0x820490;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8b35('0x0'));var rimraf=require(_0x8b35('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8b35('0x2'));var moment=require(_0x8b35('0x3'));var BPromise=require(_0x8b35('0x4'));var Mustache=require(_0x8b35('0x5'));var util=require(_0x8b35('0x6'));var path=require(_0x8b35('0x7'));var sox=require(_0x8b35('0x8'));var csv=require(_0x8b35('0x9'));var ejs=require(_0x8b35('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8b35('0xb'));var crypto=require(_0x8b35('0xc'));var jsforce=require(_0x8b35('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8b35('0x9'));var querystring=require(_0x8b35('0xe'));var Papa=require(_0x8b35('0xf'));var Redis=require(_0x8b35('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8b35('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8b35('0x12'));var config=require(_0x8b35('0x13'));var db=require(_0x8b35('0x14'))['db'];function respondWithStatusCode(_0x5316f2,_0x4fd1df){_0x4fd1df=_0x4fd1df||0xcc;return function(_0x5fd158){if(_0x5fd158){return _0x5316f2[_0x8b35('0x15')](_0x4fd1df);}return _0x5316f2[_0x8b35('0x16')](_0x4fd1df)[_0x8b35('0x17')]();};}function respondWithResult(_0x4e572f,_0x2f8ad3){_0x2f8ad3=_0x2f8ad3||0xc8;return function(_0x213e0a){if(_0x213e0a){return _0x4e572f[_0x8b35('0x16')](_0x2f8ad3)[_0x8b35('0x18')](_0x213e0a);}};}function respondWithFilteredResult(_0x22611c,_0x3254a7){return function(_0x4c4539){if(_0x4c4539){var _0x578450=_0x4c4539['count'],_0x5e53e7=_0x3254a7[_0x8b35('0x19')],_0x3b24cf=_0x3254a7['offset']+_0x3254a7[_0x8b35('0x1a')],_0x5bc158;if(_0x3b24cf>=_0x578450){_0x3b24cf=_0x578450;_0x5bc158=0xc8;}else{_0x5bc158=0xce;}_0x22611c[_0x8b35('0x16')](_0x5bc158);return _0x22611c[_0x8b35('0x1b')]('Content-Range',_0x5e53e7+'-'+_0x3b24cf+'/'+_0x578450)[_0x8b35('0x18')](_0x4c4539);}return null;};}function patchUpdates(_0x1ed7d8){return function(_0x5f4ca9){try{jsonpatch[_0x8b35('0x1c')](_0x5f4ca9,_0x1ed7d8,!![]);}catch(_0x200fdb){return BPromise['reject'](_0x200fdb);}return _0x5f4ca9[_0x8b35('0x1d')]();};}function saveUpdates(_0x54d33f,_0x25ebad){return function(_0x401d70){if(_0x401d70){return _0x401d70['update'](_0x54d33f)[_0x8b35('0x1e')](function(_0x2d280c){return _0x2d280c;});}return null;};}function removeEntity(_0x17bb89,_0x574ef6){return function(_0x111fd7){if(_0x111fd7){return _0x111fd7[_0x8b35('0x1f')]()[_0x8b35('0x1e')](function(){var _0x12ceab=_0x111fd7[_0x8b35('0x20')]({'plain':!![]});var _0x57556d=_0x8b35('0x21');return db[_0x8b35('0x22')]['destroy']({'where':{'type':_0x57556d,'resourceId':_0x12ceab['id']}})[_0x8b35('0x1e')](function(){return _0x111fd7;});})[_0x8b35('0x1e')](function(){_0x17bb89[_0x8b35('0x16')](0xcc)[_0x8b35('0x17')]();});}};}function handleEntityNotFound(_0x59c38c,_0x457412){return function(_0x51ee59){if(!_0x51ee59){_0x59c38c[_0x8b35('0x15')](0x194);}return _0x51ee59;};}function handleError(_0x1ac81a,_0x4fb045){_0x4fb045=_0x4fb045||0x1f4;return function(_0x3fa112){logger[_0x8b35('0x23')](_0x3fa112['stack']);if(_0x3fa112[_0x8b35('0x24')]){delete _0x3fa112[_0x8b35('0x24')];}_0x1ac81a[_0x8b35('0x16')](_0x4fb045)[_0x8b35('0x25')](_0x3fa112);};}exports[_0x8b35('0x26')]=function(_0x320052,_0x3232a7){var _0x22bd9b={},_0x53dd49={},_0xb56d53={'count':0x0,'rows':[]};var _0x16057b=_[_0x8b35('0x27')](db[_0x8b35('0x28')]['rawAttributes'],function(_0x36e748){return{'name':_0x36e748['fieldName'],'type':_0x36e748[_0x8b35('0x29')][_0x8b35('0x2a')]};});_0x53dd49['model']=_[_0x8b35('0x27')](_0x16057b,_0x8b35('0x24'));_0x53dd49['query']=_[_0x8b35('0x2b')](_0x320052[_0x8b35('0x2c')]);_0x53dd49['filters']=_[_0x8b35('0x2d')](_0x53dd49[_0x8b35('0x2e')],_0x53dd49['query']);_0x22bd9b[_0x8b35('0x2f')]=_[_0x8b35('0x2d')](_0x53dd49[_0x8b35('0x2e')],qs[_0x8b35('0x30')](_0x320052[_0x8b35('0x2c')][_0x8b35('0x30')]));_0x22bd9b['attributes']=_0x22bd9b['attributes']['length']?_0x22bd9b['attributes']:_0x53dd49[_0x8b35('0x2e')];if(!_0x320052[_0x8b35('0x2c')][_0x8b35('0x31')]('nolimit')){_0x22bd9b[_0x8b35('0x1a')]=qs[_0x8b35('0x1a')](_0x320052[_0x8b35('0x2c')][_0x8b35('0x1a')]);_0x22bd9b[_0x8b35('0x19')]=qs[_0x8b35('0x19')](_0x320052[_0x8b35('0x2c')][_0x8b35('0x19')]);}_0x22bd9b[_0x8b35('0x32')]=qs[_0x8b35('0x33')](_0x320052[_0x8b35('0x2c')][_0x8b35('0x33')]);_0x22bd9b[_0x8b35('0x34')]=qs['filters'](_[_0x8b35('0x35')](_0x320052[_0x8b35('0x2c')],_0x53dd49[_0x8b35('0x36')]));if(_0x320052[_0x8b35('0x2c')]['filter']){_0x22bd9b[_0x8b35('0x34')]=_[_0x8b35('0x37')](_0x22bd9b[_0x8b35('0x34')],{'$or':_[_0x8b35('0x27')](_0x16057b,function(_0x5b67a6){if(_0x5b67a6[_0x8b35('0x29')]!=='VIRTUAL'){var _0x1187fd={};_0x1187fd[_0x5b67a6['name']]={'$like':'%'+_0x320052[_0x8b35('0x2c')]['filter']+'%'};return _0x1187fd;}})});}_0x22bd9b=_[_0x8b35('0x37')]({},_0x22bd9b,_0x320052[_0x8b35('0x38')]);var _0x11911d={'where':_0x22bd9b[_0x8b35('0x34')]};return db[_0x8b35('0x28')][_0x8b35('0x39')](_0x11911d)[_0x8b35('0x1e')](function(_0x2037b3){_0xb56d53[_0x8b35('0x39')]=_0x2037b3;if(_0x320052[_0x8b35('0x2c')][_0x8b35('0x3a')]){_0x22bd9b['include']=[{'all':!![]}];}return db[_0x8b35('0x28')][_0x8b35('0x3b')](_0x22bd9b);})[_0x8b35('0x1e')](function(_0xcade55){_0xb56d53[_0x8b35('0x3c')]=_0xcade55;return _0xb56d53;})[_0x8b35('0x1e')](respondWithFilteredResult(_0x3232a7,_0x22bd9b))[_0x8b35('0x3d')](handleError(_0x3232a7,null));};exports['show']=function(_0x58679b,_0x24101b){var _0x1a1889={'raw':!![],'where':{'id':_0x58679b[_0x8b35('0x3e')]['id']}},_0x4a0d0e={};_0x4a0d0e[_0x8b35('0x2e')]=_['keys'](db['Variable'][_0x8b35('0x3f')]);_0x4a0d0e[_0x8b35('0x2c')]=_[_0x8b35('0x2b')](_0x58679b[_0x8b35('0x2c')]);_0x4a0d0e[_0x8b35('0x36')]=_[_0x8b35('0x2d')](_0x4a0d0e[_0x8b35('0x2e')],_0x4a0d0e[_0x8b35('0x2c')]);_0x1a1889['attributes']=_['intersection'](_0x4a0d0e['model'],qs[_0x8b35('0x30')](_0x58679b[_0x8b35('0x2c')]['fields']));_0x1a1889[_0x8b35('0x2f')]=_0x1a1889['attributes'][_0x8b35('0x40')]?_0x1a1889[_0x8b35('0x2f')]:_0x4a0d0e[_0x8b35('0x2e')];if(_0x58679b[_0x8b35('0x2c')][_0x8b35('0x3a')]){_0x1a1889[_0x8b35('0x41')]=[{'all':!![]}];}_0x1a1889=_[_0x8b35('0x37')]({},_0x1a1889,_0x58679b[_0x8b35('0x38')]);return db[_0x8b35('0x28')]['find'](_0x1a1889)[_0x8b35('0x1e')](handleEntityNotFound(_0x24101b,null))['then'](respondWithResult(_0x24101b,null))['catch'](handleError(_0x24101b,null));};exports[_0x8b35('0x42')]=function(_0x48ff7f,_0x49025e){return db[_0x8b35('0x28')][_0x8b35('0x42')](_0x48ff7f[_0x8b35('0x43')],{})[_0x8b35('0x1e')](function(_0x37d739){var _0x396cfb=_0x48ff7f[_0x8b35('0x44')][_0x8b35('0x20')]({'plain':!![]});if(!_0x396cfb)throw new Error(_0x8b35('0x45'));if(_0x396cfb[_0x8b35('0x46')]===_0x8b35('0x44')){var _0xe519f=_0x37d739['get']({'plain':!![]});var _0x259b35=_0x8b35('0x21');return db[_0x8b35('0x47')]['find']({'where':{'name':_0x259b35,'userProfileId':_0x396cfb[_0x8b35('0x48')]},'raw':!![]})[_0x8b35('0x1e')](function(_0x3a4fe0){if(_0x3a4fe0&&_0x3a4fe0[_0x8b35('0x49')]===0x0){return db[_0x8b35('0x22')][_0x8b35('0x42')]({'name':_0xe519f[_0x8b35('0x24')],'resourceId':_0xe519f['id'],'type':_0x3a4fe0[_0x8b35('0x24')],'sectionId':_0x3a4fe0['id']},{})[_0x8b35('0x1e')](function(){return _0x37d739;});}else{return _0x37d739;}})['catch'](function(_0x17be24){logger['error'](_0x8b35('0x4a'),_0x17be24);throw _0x17be24;});}return _0x37d739;})['then'](respondWithResult(_0x49025e,0xc9))[_0x8b35('0x3d')](handleError(_0x49025e,null));};exports['update']=function(_0x11ca90,_0x4b9f5a){if(_0x11ca90[_0x8b35('0x43')]['id']){delete _0x11ca90[_0x8b35('0x43')]['id'];}return db['Variable'][_0x8b35('0x4b')]({'where':{'id':_0x11ca90['params']['id']}})[_0x8b35('0x1e')](handleEntityNotFound(_0x4b9f5a,null))['then'](saveUpdates(_0x11ca90[_0x8b35('0x43')],null))[_0x8b35('0x1e')](respondWithResult(_0x4b9f5a,null))[_0x8b35('0x3d')](handleError(_0x4b9f5a,null));};exports[_0x8b35('0x1f')]=function(_0x334623,_0x2a4336){return db[_0x8b35('0x28')][_0x8b35('0x4b')]({'where':{'id':_0x334623[_0x8b35('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2a4336,null))[_0x8b35('0x1e')](removeEntity(_0x2a4336,null))['catch'](handleError(_0x2a4336,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 5eef867..fd24159 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 _0x9ffd=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','Variable','lodash','util'];(function(_0x111719,_0xec696b){var _0x4dd3bf=function(_0x503689){while(--_0x503689){_0x111719['push'](_0x111719['shift']());}};_0x4dd3bf(++_0xec696b);}(_0x9ffd,0x1d7));var _0xd9ff=function(_0x13a951,_0x23c9a7){_0x13a951=_0x13a951-0x0;var _0x3c3e11=_0x9ffd[_0x13a951];return _0x3c3e11;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var logger=require(_0xd9ff('0x2'))(_0xd9ff('0x3'));var moment=require('moment');var BPromise=require(_0xd9ff('0x4'));var rp=require(_0xd9ff('0x5'));var fs=require('fs');var path=require(_0xd9ff('0x6'));var rimraf=require(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var attributes=require('./variable.attributes');module['exports']=function(_0x43bc7f,_0x5d5f0d){return _0x43bc7f[_0xd9ff('0x9')](_0xd9ff('0xa'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa8db=['Variable','tools_variables','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./variable.attributes','exports'];(function(_0x50029c,_0x23c6f3){var _0x1e5a73=function(_0x2f8319){while(--_0x2f8319){_0x50029c['push'](_0x50029c['shift']());}};_0x1e5a73(++_0x23c6f3);}(_0xa8db,0x16d));var _0xba8d=function(_0x425716,_0x3e9d1c){_0x425716=_0x425716-0x0;var _0x2d39af=_0xa8db[_0x425716];return _0x2d39af;};'use strict';var _=require('lodash');var util=require(_0xba8d('0x0'));var logger=require(_0xba8d('0x1'))(_0xba8d('0x2'));var moment=require('moment');var BPromise=require(_0xba8d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba8d('0x4'));var rimraf=require(_0xba8d('0x5'));var config=require(_0xba8d('0x6'));var attributes=require(_0xba8d('0x7'));module[_0xba8d('0x8')]=function(_0x89faab,_0x3dc3df){return _0x89faab['define'](_0xba8d('0x9'),attributes,{'tableName':_0xba8d('0xa'),'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 4e8bd8f..a502e30 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 _0x0771=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','Variable','find','options','attributes','include','map','lodash','bluebird'];(function(_0x233637,_0x55b3d7){var _0x3ec050=function(_0x5a6469){while(--_0x5a6469){_0x233637['push'](_0x233637['shift']());}};_0x3ec050(++_0x55b3d7);}(_0x0771,0x193));var _0x1077=function(_0x420516,_0x5ce5ca){_0x420516=_0x420516-0x0;var _0x16484e=_0x0771[_0x420516];return _0x16484e;};'use strict';var _=require(_0x1077('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1077('0x1'));var rs=require(_0x1077('0x2'));var fs=require('fs');var Redis=require(_0x1077('0x3'));var db=require(_0x1077('0x4'))['db'];var utils=require(_0x1077('0x5'));var logger=require('../../config/logger')(_0x1077('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1077('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x278a27,_0x52d96e,_0x3fd7d2){return new BPromise(function(_0x3ec0e5,_0x41a88c){return client['request'](_0x278a27,_0x3fd7d2)[_0x1077('0x8')](function(_0x40410d){logger[_0x1077('0x9')](_0x1077('0xa'),_0x52d96e,_0x1077('0xb'));logger[_0x1077('0xc')](_0x1077('0xd'),_0x52d96e,_0x1077('0xb'),JSON[_0x1077('0xe')](_0x40410d));if(_0x40410d[_0x1077('0xf')]){if(_0x40410d[_0x1077('0xf')][_0x1077('0x10')]===0x1f4){logger['error']('Variable,\x20%s,\x20%s',_0x52d96e,_0x40410d[_0x1077('0xf')]['message']);return _0x41a88c(_0x40410d[_0x1077('0xf')][_0x1077('0x11')]);}logger[_0x1077('0xf')](_0x1077('0xa'),_0x52d96e,_0x40410d['error'][_0x1077('0x11')]);return _0x3ec0e5(_0x40410d[_0x1077('0xf')]['message']);}else{logger['info'](_0x1077('0xa'),_0x52d96e,_0x1077('0xb'));_0x3ec0e5(_0x40410d[_0x1077('0x12')]['message']);}})[_0x1077('0x13')](function(_0xfea71d){logger[_0x1077('0xf')]('Variable,\x20%s,\x20%s',_0x52d96e,_0xfea71d);_0x41a88c(_0xfea71d);});});}exports[_0x1077('0x14')]=function(_0x5c8f4c){var _0x40e717=this;return new Promise(function(_0x52331d,_0x53429d){return db[_0x1077('0x15')][_0x1077('0x16')]({'raw':_0x5c8f4c[_0x1077('0x17')]?_0x5c8f4c[_0x1077('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5c8f4c['options']?_0x5c8f4c[_0x1077('0x17')]['where']||null:null,'attributes':_0x5c8f4c[_0x1077('0x17')]?_0x5c8f4c[_0x1077('0x17')][_0x1077('0x18')]||null:null,'include':_0x5c8f4c[_0x1077('0x17')]?_0x5c8f4c[_0x1077('0x17')]['include']?_['map'](_0x5c8f4c[_0x1077('0x17')][_0x1077('0x19')],function(_0x376dc6){return{'model':db[_0x376dc6['model']],'as':_0x376dc6['as'],'attributes':_0x376dc6[_0x1077('0x18')],'include':_0x376dc6[_0x1077('0x19')]?_[_0x1077('0x1a')](_0x376dc6[_0x1077('0x19')],function(_0x23802a){return{'model':db[_0x23802a['model']],'as':_0x23802a['as'],'attributes':_0x23802a[_0x1077('0x18')],'include':_0x23802a[_0x1077('0x19')]?_[_0x1077('0x1a')](_0x23802a[_0x1077('0x19')],function(_0x242cf2){return{'model':db[_0x242cf2['model']],'as':_0x242cf2['as'],'attributes':_0x242cf2[_0x1077('0x18')]};}):[]};}):[]};}):[]:[]})[_0x1077('0x8')](function(_0x2d7b74){logger[_0x1077('0x9')](_0x1077('0x14'),_0x5c8f4c);logger[_0x1077('0xc')](_0x1077('0x14'),_0x5c8f4c,JSON['stringify'](_0x2d7b74));_0x52331d(_0x2d7b74);})[_0x1077('0x13')](function(_0x26e483){logger[_0x1077('0xf')]('ShowVariable',_0x26e483[_0x1077('0x11')],_0x5c8f4c);_0x53429d(_0x40e717[_0x1077('0xf')](0x1f4,_0x26e483[_0x1077('0x11')]));});});}; \ No newline at end of file +var _0x0a84=['model','then','ShowVariable','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','Variable,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','Variable','find','options','where','attributes','include','map'];(function(_0x39b9e7,_0x227961){var _0x52637b=function(_0x2bb762){while(--_0x2bb762){_0x39b9e7['push'](_0x39b9e7['shift']());}};_0x52637b(++_0x227961);}(_0x0a84,0x1a7));var _0x40a8=function(_0x4dba0d,_0x92bb78){_0x4dba0d=_0x4dba0d-0x0;var _0x50cf83=_0x0a84[_0x4dba0d];return _0x50cf83;};'use strict';var _=require('lodash');var util=require(_0x40a8('0x0'));var moment=require(_0x40a8('0x1'));var BPromise=require('bluebird');var rs=require(_0x40a8('0x2'));var fs=require('fs');var Redis=require(_0x40a8('0x3'));var db=require(_0x40a8('0x4'))['db'];var utils=require(_0x40a8('0x5'));var logger=require(_0x40a8('0x6'))(_0x40a8('0x7'));var config=require(_0x40a8('0x8'));var jayson=require(_0x40a8('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x524bdc,_0x16b446,_0x57c38f){return new BPromise(function(_0x4ba1e2,_0x994a5a){return client[_0x40a8('0xa')](_0x524bdc,_0x57c38f)['then'](function(_0x19113c){logger['info'](_0x40a8('0xb'),_0x16b446,_0x40a8('0xc'));logger[_0x40a8('0xd')]('Variable,\x20%s,\x20%s,\x20%s',_0x16b446,_0x40a8('0xc'),JSON[_0x40a8('0xe')](_0x19113c));if(_0x19113c['error']){if(_0x19113c[_0x40a8('0xf')]['code']===0x1f4){logger['error'](_0x40a8('0xb'),_0x16b446,_0x19113c['error']['message']);return _0x994a5a(_0x19113c[_0x40a8('0xf')][_0x40a8('0x10')]);}logger[_0x40a8('0xf')](_0x40a8('0xb'),_0x16b446,_0x19113c[_0x40a8('0xf')][_0x40a8('0x10')]);return _0x4ba1e2(_0x19113c[_0x40a8('0xf')][_0x40a8('0x10')]);}else{logger[_0x40a8('0x11')](_0x40a8('0xb'),_0x16b446,_0x40a8('0xc'));_0x4ba1e2(_0x19113c[_0x40a8('0x12')]['message']);}})[_0x40a8('0x13')](function(_0x42e233){logger[_0x40a8('0xf')](_0x40a8('0xb'),_0x16b446,_0x42e233);_0x994a5a(_0x42e233);});});}exports['ShowVariable']=function(_0x7b8a53){var _0x28cc7e=this;return new Promise(function(_0x42ace3,_0xae864a){return db[_0x40a8('0x14')][_0x40a8('0x15')]({'raw':_0x7b8a53[_0x40a8('0x16')]?_0x7b8a53[_0x40a8('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x7b8a53[_0x40a8('0x16')]?_0x7b8a53[_0x40a8('0x16')][_0x40a8('0x17')]||null:null,'attributes':_0x7b8a53[_0x40a8('0x16')]?_0x7b8a53['options'][_0x40a8('0x18')]||null:null,'include':_0x7b8a53[_0x40a8('0x16')]?_0x7b8a53[_0x40a8('0x16')][_0x40a8('0x19')]?_[_0x40a8('0x1a')](_0x7b8a53[_0x40a8('0x16')][_0x40a8('0x19')],function(_0xaf74b1){return{'model':db[_0xaf74b1[_0x40a8('0x1b')]],'as':_0xaf74b1['as'],'attributes':_0xaf74b1[_0x40a8('0x18')],'include':_0xaf74b1[_0x40a8('0x19')]?_[_0x40a8('0x1a')](_0xaf74b1[_0x40a8('0x19')],function(_0x2decad){return{'model':db[_0x2decad['model']],'as':_0x2decad['as'],'attributes':_0x2decad['attributes'],'include':_0x2decad['include']?_[_0x40a8('0x1a')](_0x2decad[_0x40a8('0x19')],function(_0x406d21){return{'model':db[_0x406d21['model']],'as':_0x406d21['as'],'attributes':_0x406d21[_0x40a8('0x18')]};}):[]};}):[]};}):[]:[]})[_0x40a8('0x1c')](function(_0x285649){logger['info'](_0x40a8('0x1d'),_0x7b8a53);logger[_0x40a8('0xd')]('ShowVariable',_0x7b8a53,JSON['stringify'](_0x285649));_0x42ace3(_0x285649);})['catch'](function(_0x271de8){logger[_0x40a8('0xf')](_0x40a8('0x1d'),_0x271de8[_0x40a8('0x10')],_0x7b8a53);_0xae864a(_0x28cc7e[_0x40a8('0xf')](0x1f4,_0x271de8['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 749713f..66517cc 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 _0xe45d=['Router','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','restart','/migrations','migrations','express'];(function(_0x51e99b,_0x2d7d42){var _0x2af489=function(_0xade5a3){while(--_0xade5a3){_0x51e99b['push'](_0x51e99b['shift']());}};_0x2af489(++_0x2d7d42);}(_0xe45d,0xed));var _0xde45=function(_0x4c487a,_0xb8f3ea){_0x4c487a=_0x4c487a-0x0;var _0x3e31cb=_0xe45d[_0x4c487a];return _0x3e31cb;};'use strict';var express=require(_0xde45('0x0'));var router=express[_0xde45('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xde45('0x2'));router[_0xde45('0x3')]('/',controller[_0xde45('0x4')]);router[_0xde45('0x3')](_0xde45('0x5'),auth[_0xde45('0x6')](),auth[_0xde45('0x7')](),controller[_0xde45('0x8')]);router['get'](_0xde45('0x9'),auth[_0xde45('0x6')](),auth['canUpdate'](),controller[_0xde45('0xa')]);router[_0xde45('0x3')]('/pull',auth['isAuthenticated'](),auth[_0xde45('0x7')](),controller['pull']);router[_0xde45('0x3')]('/restart',auth[_0xde45('0x6')](),controller[_0xde45('0xb')]);router[_0xde45('0x3')](_0xde45('0xc'),controller[_0xde45('0xd')]);module['exports']=router; \ No newline at end of file +var _0xd561=['isAuthenticated','canUpdate','fetch','reset','/pull','pull','/restart','/migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index','/fetch'];(function(_0x51b362,_0x2a3af3){var _0x18bd6=function(_0xd5fcdb){while(--_0xd5fcdb){_0x51b362['push'](_0x51b362['shift']());}};_0x18bd6(++_0x2a3af3);}(_0xd561,0x1c9));var _0x1d56=function(_0x2f8345,_0x1f6c1c){_0x2f8345=_0x2f8345-0x0;var _0x28179a=_0xd561[_0x2f8345];return _0x28179a;};'use strict';var express=require(_0x1d56('0x0'));var router=express[_0x1d56('0x1')]();var auth=require(_0x1d56('0x2'));var controller=require(_0x1d56('0x3'));router[_0x1d56('0x4')]('/',controller[_0x1d56('0x5')]);router['get'](_0x1d56('0x6'),auth[_0x1d56('0x7')](),auth[_0x1d56('0x8')](),controller[_0x1d56('0x9')]);router[_0x1d56('0x4')]('/reset',auth[_0x1d56('0x7')](),auth[_0x1d56('0x8')](),controller[_0x1d56('0xa')]);router[_0x1d56('0x4')](_0x1d56('0xb'),auth[_0x1d56('0x7')](),auth[_0x1d56('0x8')](),controller[_0x1d56('0xc')]);router[_0x1d56('0x4')](_0x1d56('0xd'),auth[_0x1d56('0x7')](),controller['restart']);router['get'](_0x1d56('0xe'),controller['migrations']);module[_0x1d56('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 172b51a..0bd68e0 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 _0xd4ad=['last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','exec','../../mysqldb','simple-git','index','exports','query','fetch','tags','2.0.0','json','status','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','root','server','length','.js','push','sort','sequelize','Migration','getQueryInterface','Database\x20migrated\x20successfully\x20from\x20version\x20'];(function(_0x59ac82,_0x421954){var _0x4ad620=function(_0x3526a3){while(--_0x3526a3){_0x59ac82['push'](_0x59ac82['shift']());}};_0x4ad620(++_0x421954);}(_0xd4ad,0x1e4));var _0xdd4a=function(_0x19b689,_0x21d2e8){_0x19b689=_0x19b689-0x0;var _0x51c5ee=_0xd4ad[_0x19b689];return _0x51c5ee;};'use strict';var Umzug=require(_0xdd4a('0x0'));var path=require(_0xdd4a('0x1'));var fs=require('fs');var _=require(_0xdd4a('0x2'));var pkginfo=require(_0xdd4a('0x3'))(module,_0xdd4a('0x4'));var compareVersions=require('compare-versions');var exec=require('child_process')[_0xdd4a('0x5')];var db=require(_0xdd4a('0x6'))['db'];var config=require('../../config/environment');var pm2=require('../../config/pm2');var logger=require('../../config/logger')('update');var git=require(_0xdd4a('0x7'))(config['root']);exports[_0xdd4a('0x8')]=function(_0x5b5ab3,_0x3c7a01){var _0x45647c={'current':module[_0xdd4a('0x9')][_0xdd4a('0x4')],'phonebar':0x2};if(_0x5b5ab3[_0xdd4a('0xa')]&&_0x5b5ab3[_0xdd4a('0xa')]['latest']){return git[_0xdd4a('0xb')]()[_0xdd4a('0xc')](function(_0x2616be,_0x5d7550){_0x45647c['latest']=(_0x2616be?module[_0xdd4a('0x9')][_0xdd4a('0x4')]:_0x5d7550['latest'])||_0xdd4a('0xd');return _0x3c7a01['status'](0xc8)[_0xdd4a('0xe')](_0x45647c);});}else{return _0x3c7a01[_0xdd4a('0xf')](0xc8)[_0xdd4a('0xe')](_0x45647c);}};exports[_0xdd4a('0xb')]=function(_0x3077e1,_0x3d3656){return git[_0xdd4a('0xb')](['origin',_0xdd4a('0x10')],function(_0x1098fc){if(_0x1098fc){logger[_0xdd4a('0x11')](_0x1098fc);return _0x3d3656[_0xdd4a('0xf')](0x1f4)[_0xdd4a('0xe')](_0x1098fc);}logger[_0xdd4a('0x12')](_0xdd4a('0x13'));return _0x3d3656[_0xdd4a('0xf')](0xc8)[_0xdd4a('0xe')]({'output':_0xdd4a('0x14')});});};exports[_0xdd4a('0x15')]=function(_0x295142,_0x95c5ec){return git[_0xdd4a('0x15')]([_0xdd4a('0x16'),_0xdd4a('0x17')],function(_0x19078a){if(_0x19078a){logger['error'](_0x19078a);return _0x95c5ec[_0xdd4a('0xf')](0x1f4)['json'](_0x19078a);}logger['info'](_0xdd4a('0x18'));return _0x95c5ec['status'](0xc8)[_0xdd4a('0xe')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0xfc51f,_0x18d81c){exec(_0xdd4a('0x19'),function(_0x21b4fc,_0x55b94f,_0x4e67a5){logger[_0xdd4a('0x12')](_0x55b94f);logger[_0xdd4a('0x12')](_0x4e67a5);if(_0x21b4fc){logger['error'](_0x21b4fc);return _0x18d81c['status'](0x1f4)[_0xdd4a('0xe')](_0x21b4fc);}return _0x18d81c['status'](0xc8)[_0xdd4a('0xe')]({'output':_0x55b94f});});};exports[_0xdd4a('0x1a')]=function(_0x42189e,_0x56e6a5){return pm2[_0xdd4a('0x1a')](_0xdd4a('0x1b'))[_0xdd4a('0x1c')](function(_0x29304a){logger['info'](_0xdd4a('0x1d'),_0x29304a);return _0x56e6a5[_0xdd4a('0xf')](0xc8)[_0xdd4a('0xe')]({'output':_0xdd4a('0x1e')});})['catch'](function(_0x40c8cf){logger['error'](_0x40c8cf);return _0x56e6a5['status'](0x1f4)['json'](_0x40c8cf);});};exports[_0xdd4a('0x1f')]=function(_0x233119,_0x154d3c){var _0x3a5033=fs[_0xdd4a('0x20')](path[_0xdd4a('0x21')](config[_0xdd4a('0x22')],_0xdd4a('0x23'),'migrations'));var _0x3d4b1f=[];for(var _0x2c574f=0x0;_0x2c574f<_0x3a5033[_0xdd4a('0x24')];_0x2c574f++){var _0x33c767=_0x3a5033[_0x2c574f]['replace'](_0xdd4a('0x25'),'');if(compareVersions(module[_0xdd4a('0x9')][_0xdd4a('0x4')],_0x33c767)===-0x1){_0x3d4b1f[_0xdd4a('0x26')](_0x33c767);}}if(_0x3d4b1f[_0xdd4a('0x24')]){var _0x57aa3c=_0x3d4b1f[_0xdd4a('0x27')](compareVersions);var _0x16d211=new Umzug({'storage':_0xdd4a('0x28'),'storageOptions':{'model':db[_0xdd4a('0x29')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db['sequelize'][_0xdd4a('0x2a')](),db[_0xdd4a('0x28')]['constructor'],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0xdd4a('0x21')](config[_0xdd4a('0x22')],_0xdd4a('0x23'),'migrations'),'pattern':/\.js$/}});_0x16d211['up']({'migrations':_['map'](_0x57aa3c,function(_0x44e470){return _0x44e470+'.js';})})[_0xdd4a('0x1c')](function(){return _0x154d3c[_0xdd4a('0xf')](0xc8)['json']({'output':_0xdd4a('0x2b')+module['exports']['version']+'\x20to\x20'+_[_0xdd4a('0x2c')](_0x57aa3c),'migrations':_[_0xdd4a('0x21')](_0x57aa3c)});})[_0xdd4a('0x2d')](function(_0x5c48fb){if(_0x5c48fb instanceof db[_0xdd4a('0x28')][_0xdd4a('0x2e')]){return _0x154d3c[_0xdd4a('0xf')](0xc8)[_0xdd4a('0xe')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x154d3c[_0xdd4a('0xf')](0x1f4)['json'](_0x5c48fb);}});}else{return _0x154d3c['status'](0xc8)[_0xdd4a('0xe')]({'output':_0xdd4a('0x2f')});}}; \ No newline at end of file +var _0xfd49=['reset','--hard','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','root','length','push','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','map','.js','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','simple-git','query','latest','fetch','tags','exports','2.0.0','status','json','origin','master','error','git\x20fetch\x20origin\x20master'];(function(_0x2a95fc,_0x4c8868){var _0x4bea5e=function(_0x3dace0){while(--_0x3dace0){_0x2a95fc['push'](_0x2a95fc['shift']());}};_0x4bea5e(++_0x4c8868);}(_0xfd49,0x121));var _0x9fd4=function(_0x1fea98,_0x10987d){_0x1fea98=_0x1fea98-0x0;var _0x58b21d=_0xfd49[_0x1fea98];return _0x58b21d;};'use strict';var Umzug=require(_0x9fd4('0x0'));var path=require(_0x9fd4('0x1'));var fs=require('fs');var _=require(_0x9fd4('0x2'));var pkginfo=require(_0x9fd4('0x3'))(module,_0x9fd4('0x4'));var compareVersions=require('compare-versions');var exec=require(_0x9fd4('0x5'))[_0x9fd4('0x6')];var db=require(_0x9fd4('0x7'))['db'];var config=require(_0x9fd4('0x8'));var pm2=require(_0x9fd4('0x9'));var logger=require('../../config/logger')('update');var git=require(_0x9fd4('0xa'))(config['root']);exports['index']=function(_0x2ea444,_0x5aa18c){var _0x19c5cf={'current':module['exports'][_0x9fd4('0x4')],'phonebar':0x2};if(_0x2ea444[_0x9fd4('0xb')]&&_0x2ea444['query'][_0x9fd4('0xc')]){return git[_0x9fd4('0xd')]()[_0x9fd4('0xe')](function(_0x4a7aa6,_0x165ebb){_0x19c5cf[_0x9fd4('0xc')]=(_0x4a7aa6?module[_0x9fd4('0xf')][_0x9fd4('0x4')]:_0x165ebb[_0x9fd4('0xc')])||_0x9fd4('0x10');return _0x5aa18c[_0x9fd4('0x11')](0xc8)[_0x9fd4('0x12')](_0x19c5cf);});}else{return _0x5aa18c[_0x9fd4('0x11')](0xc8)['json'](_0x19c5cf);}};exports[_0x9fd4('0xd')]=function(_0x4047e0,_0x2bdb31){return git['fetch']([_0x9fd4('0x13'),_0x9fd4('0x14')],function(_0x1a609a){if(_0x1a609a){logger[_0x9fd4('0x15')](_0x1a609a);return _0x2bdb31[_0x9fd4('0x11')](0x1f4)['json'](_0x1a609a);}logger['info']('git\x20fetch');return _0x2bdb31[_0x9fd4('0x11')](0xc8)[_0x9fd4('0x12')]({'output':_0x9fd4('0x16')});});};exports[_0x9fd4('0x17')]=function(_0xba6cf4,_0x2e55cc){return git[_0x9fd4('0x17')]([_0x9fd4('0x18'),'FETCH_HEAD'],function(_0x31a657){if(_0x31a657){logger[_0x9fd4('0x15')](_0x31a657);return _0x2e55cc[_0x9fd4('0x11')](0x1f4)[_0x9fd4('0x12')](_0x31a657);}logger[_0x9fd4('0x19')](_0x9fd4('0x1a'));return _0x2e55cc[_0x9fd4('0x11')](0xc8)['json']({'output':_0x9fd4('0x1b')});});};exports[_0x9fd4('0x1c')]=function(_0xc72c7b,_0xdb2064){exec('npm\x20install\x20--production',function(_0x18c402,_0x907f07,_0x2a44dc){logger[_0x9fd4('0x19')](_0x907f07);logger['info'](_0x2a44dc);if(_0x18c402){logger[_0x9fd4('0x15')](_0x18c402);return _0xdb2064['status'](0x1f4)[_0x9fd4('0x12')](_0x18c402);}return _0xdb2064[_0x9fd4('0x11')](0xc8)[_0x9fd4('0x12')]({'output':_0x907f07});});};exports[_0x9fd4('0x1d')]=function(_0x56d428,_0x3ed6ff){return pm2[_0x9fd4('0x1d')](_0x9fd4('0x1e'))['then'](function(_0x48c6c1){logger['info'](_0x9fd4('0x1f'),_0x48c6c1);return _0x3ed6ff[_0x9fd4('0x11')](0xc8)[_0x9fd4('0x12')]({'output':_0x9fd4('0x20')});})[_0x9fd4('0x21')](function(_0x24cc70){logger['error'](_0x24cc70);return _0x3ed6ff[_0x9fd4('0x11')](0x1f4)['json'](_0x24cc70);});};exports[_0x9fd4('0x22')]=function(_0x1d621a,_0x3d4b40){var _0x50fed9=fs[_0x9fd4('0x23')](path[_0x9fd4('0x24')](config[_0x9fd4('0x25')],'server','migrations'));var _0x26b659=[];for(var _0x1e1678=0x0;_0x1e1678<_0x50fed9[_0x9fd4('0x26')];_0x1e1678++){var _0x3fef2c=_0x50fed9[_0x1e1678]['replace']('.js','');if(compareVersions(module[_0x9fd4('0xf')][_0x9fd4('0x4')],_0x3fef2c)===-0x1){_0x26b659[_0x9fd4('0x27')](_0x3fef2c);}}if(_0x26b659[_0x9fd4('0x26')]){var _0x1439d2=_0x26b659['sort'](compareVersions);var _0x56210c=new Umzug({'storage':_0x9fd4('0x28'),'storageOptions':{'model':db['Migration'],'modelName':_0x9fd4('0x29'),'columnName':_0x9fd4('0x4')},'migrations':{'params':[db['sequelize'][_0x9fd4('0x2a')](),db[_0x9fd4('0x28')]['constructor'],function(){throw new Error(_0x9fd4('0x2b'));}],'path':path['join'](config[_0x9fd4('0x25')],_0x9fd4('0x2c'),_0x9fd4('0x22')),'pattern':/\.js$/}});_0x56210c['up']({'migrations':_[_0x9fd4('0x2d')](_0x1439d2,function(_0x4121af){return _0x4121af+_0x9fd4('0x2e');})})[_0x9fd4('0x2f')](function(){return _0x3d4b40[_0x9fd4('0x11')](0xc8)['json']({'output':_0x9fd4('0x30')+module['exports']['version']+_0x9fd4('0x31')+_[_0x9fd4('0x32')](_0x1439d2),'migrations':_['join'](_0x1439d2)});})['catch'](function(_0x3ede67){if(_0x3ede67 instanceof db['sequelize']['UniqueConstraintError']){return _0x3d4b40[_0x9fd4('0x11')](0xc8)['json']({'output':_0x9fd4('0x33')});}else{return _0x3d4b40['status'](0x1f4)[_0x9fd4('0x12')](_0x3ede67);}});}else{return _0x3d4b40['status'](0xc8)['json']({'output':_0x9fd4('0x33')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index f90bef0..5847e75 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 _0xd236=['/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','index','get','/describe','describe','show','put'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd236,0x17f));var _0x6d23=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xd236[_0x122096];return _0x3d1966;};'use strict';var multer=require(_0x6d23('0x0'));var util=require('util');var path=require(_0x6d23('0x1'));var timeout=require(_0x6d23('0x2'));var express=require(_0x6d23('0x3'));var router=express[_0x6d23('0x4')]();var auth=require(_0x6d23('0x5'));var interaction=require(_0x6d23('0x6'));var config=require(_0x6d23('0x7'));var controller=require(_0x6d23('0x8'));router['get']('/',auth[_0x6d23('0x9')](),controller[_0x6d23('0xa')]);router[_0x6d23('0xb')](_0x6d23('0xc'),auth['isAuthenticated'](),controller[_0x6d23('0xd')]);router[_0x6d23('0xb')]('/:id',auth[_0x6d23('0x9')](),controller[_0x6d23('0xe')]);router['post']('/',auth[_0x6d23('0x9')](),controller['create']);router[_0x6d23('0xf')](_0x6d23('0x10'),auth[_0x6d23('0x9')](),controller[_0x6d23('0x11')]);router[_0x6d23('0x12')](_0x6d23('0x10'),auth[_0x6d23('0x9')](),controller[_0x6d23('0x13')]);module[_0x6d23('0x14')]=router; \ No newline at end of file +var _0x5be4=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get'];(function(_0x274963,_0x2e05c5){var _0x1707b6=function(_0x5356a1){while(--_0x5356a1){_0x274963['push'](_0x274963['shift']());}};_0x1707b6(++_0x2e05c5);}(_0x5be4,0x11c));var _0x45be=function(_0x69cc2c,_0xfada42){_0x69cc2c=_0x69cc2c-0x0;var _0x1bbd12=_0x5be4[_0x69cc2c];return _0x1bbd12;};'use strict';var multer=require(_0x45be('0x0'));var util=require(_0x45be('0x1'));var path=require(_0x45be('0x2'));var timeout=require(_0x45be('0x3'));var express=require(_0x45be('0x4'));var router=express[_0x45be('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x45be('0x6'));var config=require(_0x45be('0x7'));var controller=require(_0x45be('0x8'));router[_0x45be('0x9')]('/',auth[_0x45be('0xa')](),controller[_0x45be('0xb')]);router[_0x45be('0x9')](_0x45be('0xc'),auth[_0x45be('0xa')](),controller[_0x45be('0xd')]);router[_0x45be('0x9')](_0x45be('0xe'),auth[_0x45be('0xa')](),controller[_0x45be('0xf')]);router[_0x45be('0x10')]('/',auth[_0x45be('0xa')](),controller[_0x45be('0x11')]);router[_0x45be('0x12')](_0x45be('0xe'),auth[_0x45be('0xa')](),controller['update']);router[_0x45be('0x13')](_0x45be('0xe'),auth['isAuthenticated'](),controller[_0x45be('0x14')]);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 740bee8..cf639d3 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 _0x6aa7=['BOOLEAN','sequelize','STRING','DATE','INTEGER'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6aa7,0x178));var _0x76aa=function(_0x2450a7,_0x1a722e){_0x2450a7=_0x2450a7-0x0;var _0x310f15=_0x6aa7[_0x2450a7];return _0x310f15;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'type':{'type':Sequelize[_0x76aa('0x1')]},'uniqueid':{'type':Sequelize[_0x76aa('0x1')]},'calleridnum':{'type':Sequelize[_0x76aa('0x1')]},'calleridname':{'type':Sequelize[_0x76aa('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x76aa('0x1')]},'membername':{'type':Sequelize[_0x76aa('0x1')]},'agentcalledAt':{'type':Sequelize[_0x76aa('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x76aa('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x76aa('0x3')]},'agentcomplete':{'type':Sequelize[_0x76aa('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x76aa('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x76aa('0x3')]},'agentacw':{'type':Sequelize[_0x76aa('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x76aa('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x76aa('0x1')]},'channel':{'type':Sequelize[_0x76aa('0x1')]},'channelstate':{'type':Sequelize[_0x76aa('0x3')]},'channelstatedesc':{'type':Sequelize[_0x76aa('0x1')]},'connectedlinenum':{'type':Sequelize[_0x76aa('0x1')]},'connectedlinename':{'type':Sequelize[_0x76aa('0x1')]},'language':{'type':Sequelize[_0x76aa('0x1')]},'accountcode':{'type':Sequelize[_0x76aa('0x1')]},'context':{'type':Sequelize[_0x76aa('0x1')]},'exten':{'type':Sequelize[_0x76aa('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x76aa('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x76aa('0x1')]},'destcalleridnum':{'type':Sequelize[_0x76aa('0x1')]},'destcalleridname':{'type':Sequelize[_0x76aa('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x76aa('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x76aa('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x76aa('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x76aa('0x1')]},'destuniqueid':{'type':Sequelize[_0x76aa('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x76aa('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x76aa('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x76aa('0x1')]},'transferuniqueid':{'type':Sequelize[_0x76aa('0x1')]},'agententerreason':{'type':Sequelize[_0x76aa('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5fc3=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x4623eb,_0xbc6808){var _0x148475=function(_0x4d2f2f){while(--_0x4d2f2f){_0x4623eb['push'](_0x4623eb['shift']());}};_0x148475(++_0xbc6808);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x5fc3[_0x4d07cc];return _0x42de3b;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x35fc('0x2')]},'calleridnum':{'type':Sequelize[_0x35fc('0x2')]},'calleridname':{'type':Sequelize[_0x35fc('0x2')]},'queue':{'type':Sequelize[_0x35fc('0x2')]},'interface':{'type':Sequelize[_0x35fc('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x35fc('0x3')]},'agentconnectAt':{'type':Sequelize[_0x35fc('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x35fc('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x35fc('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x35fc('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x35fc('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x35fc('0x4')]},'agentacw':{'type':Sequelize[_0x35fc('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x35fc('0x4')]},'reason':{'type':Sequelize[_0x35fc('0x2')]},'lastevent':{'type':Sequelize[_0x35fc('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x35fc('0x4')]},'channelstatedesc':{'type':Sequelize[_0x35fc('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x35fc('0x2')]},'language':{'type':Sequelize[_0x35fc('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x35fc('0x2')]},'exten':{'type':Sequelize[_0x35fc('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x35fc('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x35fc('0x2')]},'destcalleridname':{'type':Sequelize[_0x35fc('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x35fc('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x35fc('0x2')]},'destlanguage':{'type':Sequelize[_0x35fc('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x35fc('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x35fc('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x35fc('0x2')]},'transfer':{'type':Sequelize[_0x35fc('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x35fc('0x2')],'comment':_0x35fc('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x35fc('0x2')]},'agententerreason':{'type':Sequelize[_0x35fc('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 80097a0..afa44e2 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 _0x4e3c=['rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','api','sendStatus','status','json','count','offset','set','Content-Range','apply','update','destroy','then','end','error','stack','name','index','map','VoiceAgentReport','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','limit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll'];(function(_0x25b729,_0x5ae23b){var _0x9ae96a=function(_0x50b9bf){while(--_0x50b9bf){_0x25b729['push'](_0x25b729['shift']());}};_0x9ae96a(++_0x5ae23b);}(_0x4e3c,0x1f2));var _0xc4e3=function(_0x3e23fd,_0x324cb8){_0x3e23fd=_0x3e23fd-0x0;var _0x23e70d=_0x4e3c[_0x3e23fd];return _0x23e70d;};'use strict';var pdf=require(_0xc4e3('0x0'));var emlformat=require(_0xc4e3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc4e3('0x2'));var jsonpatch=require(_0xc4e3('0x3'));var rp=require(_0xc4e3('0x4'));var moment=require(_0xc4e3('0x5'));var BPromise=require(_0xc4e3('0x6'));var Mustache=require(_0xc4e3('0x7'));var util=require(_0xc4e3('0x8'));var path=require(_0xc4e3('0x9'));var sox=require(_0xc4e3('0xa'));var csv=require(_0xc4e3('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc4e3('0xc'));var squel=require(_0xc4e3('0xd'));var crypto=require(_0xc4e3('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc4e3('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc4e3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc4e3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc4e3('0x12'));var logger=require('../../config/logger')(_0xc4e3('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bdb9b,_0x1847b4){_0x1847b4=_0x1847b4||0xcc;return function(_0x3ab42d){if(_0x3ab42d){return _0x4bdb9b[_0xc4e3('0x14')](_0x1847b4);}return _0x4bdb9b[_0xc4e3('0x15')](_0x1847b4)['end']();};}function respondWithResult(_0x3c6835,_0x3161d5){_0x3161d5=_0x3161d5||0xc8;return function(_0x51be3c){if(_0x51be3c){return _0x3c6835['status'](_0x3161d5)[_0xc4e3('0x16')](_0x51be3c);}};}function respondWithFilteredResult(_0x7a310,_0x4859f7){return function(_0x22f516){if(_0x22f516){var _0x4671e6=_0x22f516[_0xc4e3('0x17')],_0x4f2d2f=_0x4859f7[_0xc4e3('0x18')],_0xadf27d=_0x4859f7[_0xc4e3('0x18')]+_0x4859f7['limit'],_0xd1ec36;if(_0xadf27d>=_0x4671e6){_0xadf27d=_0x4671e6;_0xd1ec36=0xc8;}else{_0xd1ec36=0xce;}_0x7a310[_0xc4e3('0x15')](_0xd1ec36);return _0x7a310[_0xc4e3('0x19')](_0xc4e3('0x1a'),_0x4f2d2f+'-'+_0xadf27d+'/'+_0x4671e6)[_0xc4e3('0x16')](_0x22f516);}return null;};}function patchUpdates(_0x5a5424){return function(_0x17df42){try{jsonpatch[_0xc4e3('0x1b')](_0x17df42,_0x5a5424,!![]);}catch(_0x5c22d7){return BPromise['reject'](_0x5c22d7);}return _0x17df42['save']();};}function saveUpdates(_0x2d1ac0,_0x278fe7){return function(_0x46c7e6){if(_0x46c7e6){return _0x46c7e6[_0xc4e3('0x1c')](_0x2d1ac0)['then'](function(_0x14bef8){return _0x14bef8;});}return null;};}function removeEntity(_0xc388b8,_0x42ab56){return function(_0x331559){if(_0x331559){return _0x331559[_0xc4e3('0x1d')]()[_0xc4e3('0x1e')](function(){_0xc388b8[_0xc4e3('0x15')](0xcc)[_0xc4e3('0x1f')]();});}};}function handleEntityNotFound(_0x1f768d,_0x650cc3){return function(_0x11ff42){if(!_0x11ff42){_0x1f768d[_0xc4e3('0x14')](0x194);}return _0x11ff42;};}function handleError(_0x1aea66,_0x13192e){_0x13192e=_0x13192e||0x1f4;return function(_0x4d25e6){logger[_0xc4e3('0x20')](_0x4d25e6[_0xc4e3('0x21')]);if(_0x4d25e6['name']){delete _0x4d25e6[_0xc4e3('0x22')];}_0x1aea66['status'](_0x13192e)['send'](_0x4d25e6);};}exports[_0xc4e3('0x23')]=function(_0x45ecf1,_0x1acaaf){var _0x1296b0={},_0x56e42a={},_0x469abb={'count':0x0,'rows':[]};var _0x539bda=_[_0xc4e3('0x24')](db[_0xc4e3('0x25')][_0xc4e3('0x26')],function(_0x31ca31){return{'name':_0x31ca31[_0xc4e3('0x27')],'type':_0x31ca31['type'][_0xc4e3('0x28')]};});_0x56e42a['model']=_['map'](_0x539bda,_0xc4e3('0x22'));_0x56e42a[_0xc4e3('0x29')]=_[_0xc4e3('0x2a')](_0x45ecf1[_0xc4e3('0x29')]);_0x56e42a[_0xc4e3('0x2b')]=_[_0xc4e3('0x2c')](_0x56e42a['model'],_0x56e42a[_0xc4e3('0x29')]);_0x1296b0[_0xc4e3('0x2d')]=_[_0xc4e3('0x2c')](_0x56e42a[_0xc4e3('0x2e')],qs[_0xc4e3('0x2f')](_0x45ecf1[_0xc4e3('0x29')]['fields']));_0x1296b0['attributes']=_0x1296b0[_0xc4e3('0x2d')][_0xc4e3('0x30')]?_0x1296b0[_0xc4e3('0x2d')]:_0x56e42a['model'];if(!_0x45ecf1[_0xc4e3('0x29')]['hasOwnProperty'](_0xc4e3('0x31'))){_0x1296b0['limit']=qs[_0xc4e3('0x32')](_0x45ecf1[_0xc4e3('0x29')][_0xc4e3('0x32')]);_0x1296b0[_0xc4e3('0x18')]=qs['offset'](_0x45ecf1[_0xc4e3('0x29')][_0xc4e3('0x18')]);}_0x1296b0[_0xc4e3('0x33')]=qs['sort'](_0x45ecf1[_0xc4e3('0x29')][_0xc4e3('0x34')]);_0x1296b0['where']=qs['filters'](_[_0xc4e3('0x35')](_0x45ecf1['query'],_0x56e42a[_0xc4e3('0x2b')]));if(_0x45ecf1[_0xc4e3('0x29')][_0xc4e3('0x36')]){_0x1296b0['where']=_[_0xc4e3('0x37')](_0x1296b0[_0xc4e3('0x38')],{'$or':_[_0xc4e3('0x24')](_0x539bda,function(_0x1237b0){if(_0x1237b0['type']!==_0xc4e3('0x39')){var _0x2ab6bb={};_0x2ab6bb[_0x1237b0['name']]={'$like':'%'+_0x45ecf1['query']['filter']+'%'};return _0x2ab6bb;}})});}_0x1296b0=_['merge']({},_0x1296b0,_0x45ecf1[_0xc4e3('0x3a')]);var _0x69dab4={'where':_0x1296b0[_0xc4e3('0x38')]};return db[_0xc4e3('0x25')][_0xc4e3('0x17')](_0x69dab4)['then'](function(_0x5268df){_0x469abb[_0xc4e3('0x17')]=_0x5268df;if(_0x45ecf1['query'][_0xc4e3('0x3b')]){_0x1296b0[_0xc4e3('0x3c')]=[{'all':!![]}];}return db[_0xc4e3('0x25')][_0xc4e3('0x3d')](_0x1296b0);})[_0xc4e3('0x1e')](function(_0x176574){_0x469abb[_0xc4e3('0x3e')]=_0x176574;return _0x469abb;})[_0xc4e3('0x1e')](respondWithFilteredResult(_0x1acaaf,_0x1296b0))[_0xc4e3('0x3f')](handleError(_0x1acaaf,null));};exports[_0xc4e3('0x40')]=function(_0x10d721,_0x209c60){var _0x47c157={'raw':![],'where':{'id':_0x10d721[_0xc4e3('0x41')]['id']}},_0x41c548={};_0x41c548[_0xc4e3('0x2e')]=_[_0xc4e3('0x2a')](db[_0xc4e3('0x25')][_0xc4e3('0x26')]);_0x41c548[_0xc4e3('0x29')]=_[_0xc4e3('0x2a')](_0x10d721['query']);_0x41c548[_0xc4e3('0x2b')]=_[_0xc4e3('0x2c')](_0x41c548['model'],_0x41c548[_0xc4e3('0x29')]);_0x47c157['attributes']=_['intersection'](_0x41c548['model'],qs[_0xc4e3('0x2f')](_0x10d721[_0xc4e3('0x29')][_0xc4e3('0x2f')]));_0x47c157[_0xc4e3('0x2d')]=_0x47c157['attributes']['length']?_0x47c157['attributes']:_0x41c548[_0xc4e3('0x2e')];if(_0x10d721[_0xc4e3('0x29')]['includeAll']){_0x47c157[_0xc4e3('0x3c')]=[{'all':!![]}];}_0x47c157=_[_0xc4e3('0x37')]({},_0x47c157,_0x10d721[_0xc4e3('0x3a')]);return db[_0xc4e3('0x25')][_0xc4e3('0x42')](_0x47c157)['then'](handleEntityNotFound(_0x209c60,null))[_0xc4e3('0x1e')](respondWithResult(_0x209c60,null))[_0xc4e3('0x3f')](handleError(_0x209c60,null));};exports[_0xc4e3('0x43')]=function(_0x14ea48,_0x1a9f09){return db['VoiceAgentReport']['create'](_0x14ea48[_0xc4e3('0x44')],{})[_0xc4e3('0x1e')](respondWithResult(_0x1a9f09,0xc9))[_0xc4e3('0x3f')](handleError(_0x1a9f09,null));};exports[_0xc4e3('0x1c')]=function(_0x2c5576,_0x42faf3){if(_0x2c5576[_0xc4e3('0x44')]['id']){delete _0x2c5576[_0xc4e3('0x44')]['id'];}return db[_0xc4e3('0x25')][_0xc4e3('0x42')]({'where':{'id':_0x2c5576[_0xc4e3('0x41')]['id']}})['then'](handleEntityNotFound(_0x42faf3,null))[_0xc4e3('0x1e')](saveUpdates(_0x2c5576[_0xc4e3('0x44')],null))[_0xc4e3('0x1e')](respondWithResult(_0x42faf3,null))['catch'](handleError(_0x42faf3,null));};exports[_0xc4e3('0x1d')]=function(_0x43b666,_0x291c4c){return db['VoiceAgentReport'][_0xc4e3('0x42')]({'where':{'id':_0x43b666[_0xc4e3('0x41')]['id']}})[_0xc4e3('0x1e')](handleEntityNotFound(_0x291c4c,null))[_0xc4e3('0x1e')](removeEntity(_0x291c4c,null))[_0xc4e3('0x3f')](handleError(_0x291c4c,null));};exports[_0xc4e3('0x45')]=function(_0x3e9134,_0x4c1b6d){return db[_0xc4e3('0x25')][_0xc4e3('0x45')]()[_0xc4e3('0x1e')](respondWithResult(_0x4c1b6d,null))['catch'](handleError(_0x4c1b6d,null));}; \ No newline at end of file +var _0x8017=['index','map','VoiceAgentReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','find','create','update','body','destroy','params','describe','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','Content-Range','apply','save','then','error','stack','name','send'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8017,0x1f0));var _0x7801=function(_0x2e8418,_0x58c529){_0x2e8418=_0x2e8418-0x0;var _0x548fe6=_0x8017[_0x2e8418];return _0x548fe6;};'use strict';var pdf=require(_0x7801('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7801('0x1'));var jsonpatch=require(_0x7801('0x2'));var rp=require(_0x7801('0x3'));var moment=require('moment');var BPromise=require(_0x7801('0x4'));var Mustache=require(_0x7801('0x5'));var util=require(_0x7801('0x6'));var path=require(_0x7801('0x7'));var sox=require(_0x7801('0x8'));var csv=require(_0x7801('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7801('0xa'));var squel=require(_0x7801('0xb'));var crypto=require(_0x7801('0xc'));var jsforce=require(_0x7801('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7801('0xe'));var Papa=require(_0x7801('0xf'));var Redis=require(_0x7801('0x10'));var authService=require(_0x7801('0x11'));var qs=require(_0x7801('0x12'));var as=require(_0x7801('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7801('0x14'))('api');var utils=require(_0x7801('0x15'));var config=require('../../config/environment');var db=require(_0x7801('0x16'))['db'];function respondWithStatusCode(_0x44f36c,_0x18cabc){_0x18cabc=_0x18cabc||0xcc;return function(_0x588dae){if(_0x588dae){return _0x44f36c[_0x7801('0x17')](_0x18cabc);}return _0x44f36c[_0x7801('0x18')](_0x18cabc)[_0x7801('0x19')]();};}function respondWithResult(_0x345708,_0x3a37f6){_0x3a37f6=_0x3a37f6||0xc8;return function(_0x395007){if(_0x395007){return _0x345708[_0x7801('0x18')](_0x3a37f6)[_0x7801('0x1a')](_0x395007);}};}function respondWithFilteredResult(_0xea533d,_0x3d703a){return function(_0x5aa91e){if(_0x5aa91e){var _0x1d1ff0=_0x5aa91e['count'],_0x5a101e=_0x3d703a['offset'],_0x51d460=_0x3d703a[_0x7801('0x1b')]+_0x3d703a['limit'],_0x188554;if(_0x51d460>=_0x1d1ff0){_0x51d460=_0x1d1ff0;_0x188554=0xc8;}else{_0x188554=0xce;}_0xea533d['status'](_0x188554);return _0xea533d['set'](_0x7801('0x1c'),_0x5a101e+'-'+_0x51d460+'/'+_0x1d1ff0)[_0x7801('0x1a')](_0x5aa91e);}return null;};}function patchUpdates(_0x4289b3){return function(_0x27420d){try{jsonpatch[_0x7801('0x1d')](_0x27420d,_0x4289b3,!![]);}catch(_0x2d39a3){return BPromise['reject'](_0x2d39a3);}return _0x27420d[_0x7801('0x1e')]();};}function saveUpdates(_0x5cd4bd,_0x3978dc){return function(_0x587139){if(_0x587139){return _0x587139['update'](_0x5cd4bd)[_0x7801('0x1f')](function(_0x387751){return _0x387751;});}return null;};}function removeEntity(_0x4aefa8,_0x3784e8){return function(_0x297957){if(_0x297957){return _0x297957['destroy']()[_0x7801('0x1f')](function(){_0x4aefa8[_0x7801('0x18')](0xcc)[_0x7801('0x19')]();});}};}function handleEntityNotFound(_0x343d2b,_0x24a25c){return function(_0x50b0aa){if(!_0x50b0aa){_0x343d2b[_0x7801('0x17')](0x194);}return _0x50b0aa;};}function handleError(_0x229236,_0x68a5b8){_0x68a5b8=_0x68a5b8||0x1f4;return function(_0x21f133){logger[_0x7801('0x20')](_0x21f133[_0x7801('0x21')]);if(_0x21f133[_0x7801('0x22')]){delete _0x21f133['name'];}_0x229236['status'](_0x68a5b8)[_0x7801('0x23')](_0x21f133);};}exports[_0x7801('0x24')]=function(_0x20229b,_0x28536c){var _0x5716b4={},_0x2fbd38={},_0x8d5c69={'count':0x0,'rows':[]};var _0x6b802b=_[_0x7801('0x25')](db[_0x7801('0x26')][_0x7801('0x27')],function(_0x5f0bba){return{'name':_0x5f0bba[_0x7801('0x28')],'type':_0x5f0bba[_0x7801('0x29')][_0x7801('0x2a')]};});_0x2fbd38['model']=_[_0x7801('0x25')](_0x6b802b,'name');_0x2fbd38[_0x7801('0x2b')]=_[_0x7801('0x2c')](_0x20229b[_0x7801('0x2b')]);_0x2fbd38[_0x7801('0x2d')]=_[_0x7801('0x2e')](_0x2fbd38[_0x7801('0x2f')],_0x2fbd38[_0x7801('0x2b')]);_0x5716b4['attributes']=_['intersection'](_0x2fbd38[_0x7801('0x2f')],qs[_0x7801('0x30')](_0x20229b[_0x7801('0x2b')][_0x7801('0x30')]));_0x5716b4[_0x7801('0x31')]=_0x5716b4[_0x7801('0x31')][_0x7801('0x32')]?_0x5716b4[_0x7801('0x31')]:_0x2fbd38['model'];if(!_0x20229b['query'][_0x7801('0x33')](_0x7801('0x34'))){_0x5716b4[_0x7801('0x35')]=qs[_0x7801('0x35')](_0x20229b[_0x7801('0x2b')][_0x7801('0x35')]);_0x5716b4[_0x7801('0x1b')]=qs[_0x7801('0x1b')](_0x20229b[_0x7801('0x2b')][_0x7801('0x1b')]);}_0x5716b4[_0x7801('0x36')]=qs['sort'](_0x20229b[_0x7801('0x2b')][_0x7801('0x37')]);_0x5716b4[_0x7801('0x38')]=qs[_0x7801('0x2d')](_[_0x7801('0x39')](_0x20229b['query'],_0x2fbd38[_0x7801('0x2d')]));if(_0x20229b['query'][_0x7801('0x3a')]){_0x5716b4[_0x7801('0x38')]=_['merge'](_0x5716b4['where'],{'$or':_[_0x7801('0x25')](_0x6b802b,function(_0x386a3b){if(_0x386a3b[_0x7801('0x29')]!==_0x7801('0x3b')){var _0x34530c={};_0x34530c[_0x386a3b[_0x7801('0x22')]]={'$like':'%'+_0x20229b[_0x7801('0x2b')][_0x7801('0x3a')]+'%'};return _0x34530c;}})});}_0x5716b4=_[_0x7801('0x3c')]({},_0x5716b4,_0x20229b[_0x7801('0x3d')]);var _0x4780dc={'where':_0x5716b4[_0x7801('0x38')]};return db[_0x7801('0x26')][_0x7801('0x3e')](_0x4780dc)['then'](function(_0x3deff1){_0x8d5c69['count']=_0x3deff1;if(_0x20229b[_0x7801('0x2b')][_0x7801('0x3f')]){_0x5716b4[_0x7801('0x40')]=[{'all':!![]}];}return db[_0x7801('0x26')][_0x7801('0x41')](_0x5716b4);})[_0x7801('0x1f')](function(_0x7b34bc){_0x8d5c69[_0x7801('0x42')]=_0x7b34bc;return _0x8d5c69;})[_0x7801('0x1f')](respondWithFilteredResult(_0x28536c,_0x5716b4))[_0x7801('0x43')](handleError(_0x28536c,null));};exports[_0x7801('0x44')]=function(_0x3f3039,_0x2fa4dd){var _0x49b68a={'raw':![],'where':{'id':_0x3f3039['params']['id']}},_0xc08346={};_0xc08346['model']=_['keys'](db['VoiceAgentReport'][_0x7801('0x27')]);_0xc08346[_0x7801('0x2b')]=_[_0x7801('0x2c')](_0x3f3039[_0x7801('0x2b')]);_0xc08346['filters']=_[_0x7801('0x2e')](_0xc08346['model'],_0xc08346['query']);_0x49b68a[_0x7801('0x31')]=_[_0x7801('0x2e')](_0xc08346[_0x7801('0x2f')],qs[_0x7801('0x30')](_0x3f3039[_0x7801('0x2b')][_0x7801('0x30')]));_0x49b68a[_0x7801('0x31')]=_0x49b68a[_0x7801('0x31')]['length']?_0x49b68a[_0x7801('0x31')]:_0xc08346['model'];if(_0x3f3039[_0x7801('0x2b')][_0x7801('0x3f')]){_0x49b68a[_0x7801('0x40')]=[{'all':!![]}];}_0x49b68a=_[_0x7801('0x3c')]({},_0x49b68a,_0x3f3039['options']);return db['VoiceAgentReport'][_0x7801('0x45')](_0x49b68a)[_0x7801('0x1f')](handleEntityNotFound(_0x2fa4dd,null))['then'](respondWithResult(_0x2fa4dd,null))[_0x7801('0x43')](handleError(_0x2fa4dd,null));};exports[_0x7801('0x46')]=function(_0x3a8782,_0xc26e14){return db[_0x7801('0x26')][_0x7801('0x46')](_0x3a8782['body'],{})['then'](respondWithResult(_0xc26e14,0xc9))['catch'](handleError(_0xc26e14,null));};exports[_0x7801('0x47')]=function(_0x16e6be,_0x2cc6b2){if(_0x16e6be[_0x7801('0x48')]['id']){delete _0x16e6be['body']['id'];}return db[_0x7801('0x26')][_0x7801('0x45')]({'where':{'id':_0x16e6be['params']['id']}})[_0x7801('0x1f')](handleEntityNotFound(_0x2cc6b2,null))[_0x7801('0x1f')](saveUpdates(_0x16e6be['body'],null))['then'](respondWithResult(_0x2cc6b2,null))[_0x7801('0x43')](handleError(_0x2cc6b2,null));};exports[_0x7801('0x49')]=function(_0x10d9f0,_0x2eca24){return db[_0x7801('0x26')]['find']({'where':{'id':_0x10d9f0[_0x7801('0x4a')]['id']}})[_0x7801('0x1f')](handleEntityNotFound(_0x2eca24,null))[_0x7801('0x1f')](removeEntity(_0x2eca24,null))[_0x7801('0x43')](handleError(_0x2eca24,null));};exports[_0x7801('0x4b')]=function(_0x62a82d,_0x450c3f){return db[_0x7801('0x26')][_0x7801('0x4b')]()[_0x7801('0x1f')](respondWithResult(_0x450c3f,null))[_0x7801('0x43')](handleError(_0x450c3f,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 673d4c7..7dda237 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 _0x8446=['report_agent','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./voiceAgentReport.attributes','exports'];(function(_0x297c55,_0x34fa75){var _0x120389=function(_0x595108){while(--_0x595108){_0x297c55['push'](_0x297c55['shift']());}};_0x120389(++_0x34fa75);}(_0x8446,0xfb));var _0x6844=function(_0x500dd2,_0x23bd28){_0x500dd2=_0x500dd2-0x0;var _0xa7c859=_0x8446[_0x500dd2];return _0xa7c859;};'use strict';var _=require(_0x6844('0x0'));var util=require(_0x6844('0x1'));var logger=require(_0x6844('0x2'))(_0x6844('0x3'));var moment=require('moment');var BPromise=require(_0x6844('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6844('0x5'));var config=require(_0x6844('0x6'));var attributes=require(_0x6844('0x7'));module[_0x6844('0x8')]=function(_0x5575a2,_0x252367){return _0x5575a2['define']('VoiceAgentReport',attributes,{'tableName':_0x6844('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid','destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xadc2=['path','./voiceAgentReport.attributes','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x30e08d,_0x5aae9b){var _0x304aae=function(_0x1a2033){while(--_0x1a2033){_0x30e08d['push'](_0x30e08d['shift']());}};_0x304aae(++_0x5aae9b);}(_0xadc2,0x187));var _0x2adc=function(_0x5bd60b,_0x13465a){_0x5bd60b=_0x5bd60b-0x0;var _0x2dcff0=_0xadc2[_0x5bd60b];return _0x2dcff0;};'use strict';var _=require(_0x2adc('0x0'));var util=require('util');var logger=require(_0x2adc('0x1'))(_0x2adc('0x2'));var moment=require('moment');var BPromise=require(_0x2adc('0x3'));var rp=require(_0x2adc('0x4'));var fs=require('fs');var path=require(_0x2adc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2adc('0x6'));module['exports']=function(_0x38b07c,_0x4ca949){return _0x38b07c[_0x2adc('0x7')](_0x2adc('0x8'),attributes,{'tableName':_0x2adc('0x9'),'paranoid':![],'indexes':[{'fields':[_0x2adc('0xa'),_0x2adc('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 167a3d7..1ad8eee 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 _0x1be9=['UpdateVoiceAgentReport','update','where','attributes','then','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','catch'];(function(_0x2a3b0b,_0x51c1cb){var _0xcb702d=function(_0x22e5bf){while(--_0x22e5bf){_0x2a3b0b['push'](_0x2a3b0b['shift']());}};_0xcb702d(++_0x51c1cb);}(_0x1be9,0x116));var _0x91be=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x1be9[_0x1beef3];return _0x5af964;};'use strict';var _=require(_0x91be('0x0'));var util=require(_0x91be('0x1'));var moment=require(_0x91be('0x2'));var BPromise=require(_0x91be('0x3'));var rs=require(_0x91be('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x91be('0x5'))['db'];var utils=require(_0x91be('0x6'));var logger=require(_0x91be('0x7'))(_0x91be('0x8'));var config=require(_0x91be('0x9'));var jayson=require(_0x91be('0xa'));var client=jayson['client'][_0x91be('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25f330,_0x569fa7,_0x53f1a7){return new BPromise(function(_0x15de96,_0x113486){return client['request'](_0x25f330,_0x53f1a7)['then'](function(_0x4340ad){logger[_0x91be('0xc')](_0x91be('0xd'),_0x569fa7,_0x91be('0xe'));logger['debug'](_0x91be('0xf'),_0x569fa7,_0x91be('0xe'),JSON[_0x91be('0x10')](_0x4340ad));if(_0x4340ad[_0x91be('0x11')]){if(_0x4340ad[_0x91be('0x11')][_0x91be('0x12')]===0x1f4){logger[_0x91be('0x11')](_0x91be('0xd'),_0x569fa7,_0x4340ad[_0x91be('0x11')][_0x91be('0x13')]);return _0x113486(_0x4340ad[_0x91be('0x11')]['message']);}logger[_0x91be('0x11')](_0x91be('0xd'),_0x569fa7,_0x4340ad[_0x91be('0x11')][_0x91be('0x13')]);return _0x15de96(_0x4340ad['error'][_0x91be('0x13')]);}else{logger[_0x91be('0xc')](_0x91be('0xd'),_0x569fa7,_0x91be('0xe'));_0x15de96(_0x4340ad[_0x91be('0x14')][_0x91be('0x13')]);}})['catch'](function(_0x292131){logger[_0x91be('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x569fa7,_0x292131);_0x113486(_0x292131);});});}exports[_0x91be('0x15')]=function(_0x514d7e){var _0x5f5022=this;return new Promise(function(_0x3ff3a7,_0x23df77){return db[_0x91be('0x16')][_0x91be('0x17')](_0x514d7e[_0x91be('0x18')],{'raw':_0x514d7e[_0x91be('0x19')]?_0x514d7e[_0x91be('0x19')][_0x91be('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x32dd74){logger[_0x91be('0xc')]('CreateVoiceAgentReport',_0x514d7e);logger['debug'](_0x91be('0x15'),_0x514d7e,JSON[_0x91be('0x10')](_0x32dd74));_0x3ff3a7(_0x32dd74);})[_0x91be('0x1b')](function(_0x35a762){logger['error']('CreateVoiceAgentReport',_0x35a762[_0x91be('0x13')],_0x514d7e);_0x23df77(_0x5f5022[_0x91be('0x11')](0x1f4,_0x35a762[_0x91be('0x13')]));});});};exports[_0x91be('0x1c')]=function(_0x609103){var _0x529558=this;return new Promise(function(_0x2a890c,_0x2e1bcb){return db[_0x91be('0x16')][_0x91be('0x1d')](_0x609103[_0x91be('0x18')],{'raw':_0x609103[_0x91be('0x19')]?_0x609103[_0x91be('0x19')][_0x91be('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x609103[_0x91be('0x19')]?_0x609103['options'][_0x91be('0x1e')]||null:null,'attributes':_0x609103[_0x91be('0x19')]?_0x609103[_0x91be('0x19')][_0x91be('0x1f')]||null:null,'limit':_0x609103[_0x91be('0x19')]?_0x609103[_0x91be('0x19')]['limit']||null:null})[_0x91be('0x20')](function(_0x13e7e6){logger['info'](_0x91be('0x1c'),_0x609103);logger[_0x91be('0x21')]('UpdateVoiceAgentReport',_0x609103,JSON['stringify'](_0x13e7e6));_0x2a890c(_0x13e7e6);})[_0x91be('0x1b')](function(_0x1a1bcb){logger[_0x91be('0x11')](_0x91be('0x1c'),_0x1a1bcb['message'],_0x609103);_0x2e1bcb(_0x529558[_0x91be('0x11')](0x1f4,_0x1a1bcb[_0x91be('0x13')]));});});}; \ No newline at end of file +var _0x0c21=['request\x20sent','debug','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','info','catch','CreateVoiceAgentReport','create','body','options','raw','then','update','where','attributes','limit','UpdateVoiceAgentReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x4c80d7,_0x2bef29){var _0x3c5095=function(_0x1b0e67){while(--_0x1b0e67){_0x4c80d7['push'](_0x4c80d7['shift']());}};_0x3c5095(++_0x2bef29);}(_0x0c21,0xa0));var _0x10c2=function(_0x425748,_0x2545df){_0x425748=_0x425748-0x0;var _0x336ab4=_0x0c21[_0x425748];return _0x336ab4;};'use strict';var _=require(_0x10c2('0x0'));var util=require(_0x10c2('0x1'));var moment=require(_0x10c2('0x2'));var BPromise=require(_0x10c2('0x3'));var rs=require(_0x10c2('0x4'));var fs=require('fs');var Redis=require(_0x10c2('0x5'));var db=require(_0x10c2('0x6'))['db'];var utils=require(_0x10c2('0x7'));var logger=require(_0x10c2('0x8'))(_0x10c2('0x9'));var config=require(_0x10c2('0xa'));var jayson=require(_0x10c2('0xb'));var client=jayson[_0x10c2('0xc')][_0x10c2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x6d39c4,_0x10d62b,_0x25737e){return new BPromise(function(_0x5eeeed,_0x422ae3){return client[_0x10c2('0xe')](_0x6d39c4,_0x25737e)['then'](function(_0x172dc4){logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x10d62b,_0x10c2('0xf'));logger[_0x10c2('0x10')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x10d62b,_0x10c2('0xf'),JSON[_0x10c2('0x11')](_0x172dc4));if(_0x172dc4[_0x10c2('0x12')]){if(_0x172dc4[_0x10c2('0x12')][_0x10c2('0x13')]===0x1f4){logger[_0x10c2('0x12')](_0x10c2('0x14'),_0x10d62b,_0x172dc4[_0x10c2('0x12')][_0x10c2('0x15')]);return _0x422ae3(_0x172dc4['error'][_0x10c2('0x15')]);}logger[_0x10c2('0x12')](_0x10c2('0x14'),_0x10d62b,_0x172dc4[_0x10c2('0x12')]['message']);return _0x5eeeed(_0x172dc4[_0x10c2('0x12')]['message']);}else{logger[_0x10c2('0x16')]('VoiceAgentReport,\x20%s,\x20%s',_0x10d62b,_0x10c2('0xf'));_0x5eeeed(_0x172dc4['result']['message']);}})[_0x10c2('0x17')](function(_0x134342){logger[_0x10c2('0x12')](_0x10c2('0x14'),_0x10d62b,_0x134342);_0x422ae3(_0x134342);});});}exports[_0x10c2('0x18')]=function(_0xe6ba5){var _0x511911=this;return new Promise(function(_0x3fe56a,_0x1d778a){return db['VoiceAgentReport'][_0x10c2('0x19')](_0xe6ba5[_0x10c2('0x1a')],{'raw':_0xe6ba5['options']?_0xe6ba5[_0x10c2('0x1b')][_0x10c2('0x1c')]===undefined?!![]:![]:!![]})[_0x10c2('0x1d')](function(_0xb442d2){logger[_0x10c2('0x16')](_0x10c2('0x18'),_0xe6ba5);logger[_0x10c2('0x10')](_0x10c2('0x18'),_0xe6ba5,JSON[_0x10c2('0x11')](_0xb442d2));_0x3fe56a(_0xb442d2);})[_0x10c2('0x17')](function(_0x52d055){logger['error'](_0x10c2('0x18'),_0x52d055[_0x10c2('0x15')],_0xe6ba5);_0x1d778a(_0x511911[_0x10c2('0x12')](0x1f4,_0x52d055[_0x10c2('0x15')]));});});};exports['UpdateVoiceAgentReport']=function(_0x140664){var _0x45d60c=this;return new Promise(function(_0xf0378f,_0x5bd8d8){return db['VoiceAgentReport'][_0x10c2('0x1e')](_0x140664['body'],{'raw':_0x140664['options']?_0x140664[_0x10c2('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x140664[_0x10c2('0x1b')]?_0x140664[_0x10c2('0x1b')][_0x10c2('0x1f')]||null:null,'attributes':_0x140664[_0x10c2('0x1b')]?_0x140664[_0x10c2('0x1b')][_0x10c2('0x20')]||null:null,'limit':_0x140664['options']?_0x140664[_0x10c2('0x1b')][_0x10c2('0x21')]||null:null})['then'](function(_0x256231){logger[_0x10c2('0x16')]('UpdateVoiceAgentReport',_0x140664);logger[_0x10c2('0x10')]('UpdateVoiceAgentReport',_0x140664,JSON[_0x10c2('0x11')](_0x256231));_0xf0378f(_0x256231);})['catch'](function(_0x3ae502){logger['error'](_0x10c2('0x22'),_0x3ae502['message'],_0x140664);_0x5bd8d8(_0x45d60c[_0x10c2('0x12')](0x1f4,_0x3ae502[_0x10c2('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 196ec49..848b8c5 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 _0xab8a=['/:id','update','delete','destroy','exports','multer','util','path','express','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','post','put'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xab8a,0x9e));var _0xaab8=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0xab8a[_0x31a371];return _0x2a5bd6;};'use strict';var multer=require(_0xaab8('0x0'));var util=require(_0xaab8('0x1'));var path=require(_0xaab8('0x2'));var timeout=require('connect-timeout');var express=require(_0xaab8('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xaab8('0x4'));var config=require('../../config/environment');var controller=require(_0xaab8('0x5'));router[_0xaab8('0x6')]('/',auth[_0xaab8('0x7')](),controller[_0xaab8('0x8')]);router[_0xaab8('0x6')](_0xaab8('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xaab8('0x6')]('/:id',auth[_0xaab8('0x7')](),controller['show']);router[_0xaab8('0xa')]('/',auth[_0xaab8('0x7')](),controller['create']);router[_0xaab8('0xb')](_0xaab8('0xc'),auth[_0xaab8('0x7')](),controller[_0xaab8('0xd')]);router[_0xaab8('0xe')](_0xaab8('0xc'),auth[_0xaab8('0x7')](),controller[_0xaab8('0xf')]);module[_0xaab8('0x10')]=router; \ No newline at end of file +var _0x6478=['connect-timeout','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x1a3253,_0x26d60e){var _0x4797c2=function(_0x704075){while(--_0x704075){_0x1a3253['push'](_0x1a3253['shift']());}};_0x4797c2(++_0x26d60e);}(_0x6478,0x96));var _0x8647=function(_0x114da5,_0x34677b){_0x114da5=_0x114da5-0x0;var _0x1e52e3=_0x6478[_0x114da5];return _0x1e52e3;};'use strict';var multer=require('multer');var util=require(_0x8647('0x0'));var path=require(_0x8647('0x1'));var timeout=require(_0x8647('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x8647('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8647('0x4'));var controller=require(_0x8647('0x5'));router[_0x8647('0x6')]('/',auth[_0x8647('0x7')](),controller[_0x8647('0x8')]);router[_0x8647('0x6')](_0x8647('0x9'),auth[_0x8647('0x7')](),controller['describe']);router[_0x8647('0x6')](_0x8647('0xa'),auth['isAuthenticated'](),controller[_0x8647('0xb')]);router[_0x8647('0xc')]('/',auth[_0x8647('0x7')](),controller[_0x8647('0xd')]);router[_0x8647('0xe')](_0x8647('0xa'),auth[_0x8647('0x7')](),controller[_0x8647('0xf')]);router[_0x8647('0x10')](_0x8647('0xa'),auth[_0x8647('0x7')](),controller[_0x8647('0x11')]);module[_0x8647('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 4ef8443..d4edcc4 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(_0xb1496a,_0x190543){var _0x301916=function(_0x4e17ab){while(--_0x4e17ab){_0xb1496a['push'](_0xb1496a['shift']());}};_0x301916(++_0x190543);}(_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')]={'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 _0xa9e0=['dialer','DATE','INTEGER','sequelize','exports','STRING','internal','inbound-fax','outbound-fax'];(function(_0x10de99,_0xdd42d){var _0x8550e5=function(_0x3c1aae){while(--_0x3c1aae){_0x10de99['push'](_0x10de99['shift']());}};_0x8550e5(++_0xdd42d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'uniqueid':{'type':Sequelize[_0x0a9e('0x2')]},'type':{'type':Sequelize['ENUM']('inbound',_0x0a9e('0x3'),'outbound',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'))},'tag':{'type':Sequelize[_0x0a9e('0x2')]},'accountcode':{'type':Sequelize[_0x0a9e('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x0a9e('0x2')]},'destinationcontext':{'type':Sequelize[_0x0a9e('0x2')]},'callerid':{'type':Sequelize[_0x0a9e('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0a9e('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x0a9e('0x7')]},'answertime':{'type':Sequelize[_0x0a9e('0x7')]},'endtime':{'type':Sequelize[_0x0a9e('0x7')]},'duration':{'type':Sequelize[_0x0a9e('0x8')]},'billableseconds':{'type':Sequelize[_0x0a9e('0x8')]},'mohtime':{'type':Sequelize[_0x0a9e('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0a9e('0x2')]},'prefix':{'type':Sequelize[_0x0a9e('0x2')]},'routeid':{'type':Sequelize[_0x0a9e('0x8')]},'sipcallid':{'type':Sequelize[_0x0a9e('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 3a786ac..6023fa4 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 _0x5a9b=['hasOwnProperty','sort','where','filter','VIRTUAL','merge','options','VoiceCallReport','then','include','fullname','alias','User','findAll','rows','catch','show','params','includeAll','create','body','find','describe','uniqueid','user','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','sendStatus','error','stack','send','map','type','key','model','name','query','keys','filters','intersection','attributes','fields','length'];(function(_0x1c582b,_0x37af43){var _0x444b40=function(_0x18bbc8){while(--_0x18bbc8){_0x1c582b['push'](_0x1c582b['shift']());}};_0x444b40(++_0x37af43);}(_0x5a9b,0x103));var _0xb5a9=function(_0x59e06e,_0x3b453d){_0x59e06e=_0x59e06e-0x0;var _0xe2f12b=_0x5a9b[_0x59e06e];return _0xe2f12b;};'use strict';var pdf=require(_0xb5a9('0x0'));var emlformat=require(_0xb5a9('0x1'));var rimraf=require(_0xb5a9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5a9('0x3'));var rp=require(_0xb5a9('0x4'));var moment=require(_0xb5a9('0x5'));var BPromise=require(_0xb5a9('0x6'));var Mustache=require('mustache');var util=require(_0xb5a9('0x7'));var path=require(_0xb5a9('0x8'));var sox=require(_0xb5a9('0x9'));var csv=require(_0xb5a9('0xa'));var ejs=require(_0xb5a9('0xb'));var fs=require('fs');var _=require(_0xb5a9('0xc'));var squel=require(_0xb5a9('0xd'));var crypto=require(_0xb5a9('0xe'));var jsforce=require(_0xb5a9('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb5a9('0x10'));var Papa=require(_0xb5a9('0x11'));var Redis=require(_0xb5a9('0x12'));var authService=require(_0xb5a9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb5a9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb5a9('0x15'))(_0xb5a9('0x16'));var utils=require(_0xb5a9('0x17'));var config=require(_0xb5a9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42d455,_0x5c4012){_0x5c4012=_0x5c4012||0xcc;return function(_0x4cffdf){if(_0x4cffdf){return _0x42d455['sendStatus'](_0x5c4012);}return _0x42d455[_0xb5a9('0x19')](_0x5c4012)[_0xb5a9('0x1a')]();};}function respondWithResult(_0x47b2fd,_0x4e1648){_0x4e1648=_0x4e1648||0xc8;return function(_0x4292d2){if(_0x4292d2){return _0x47b2fd[_0xb5a9('0x19')](_0x4e1648)[_0xb5a9('0x1b')](_0x4292d2);}};}function respondWithFilteredResult(_0x338467,_0x5b2abf){return function(_0x58907e){if(_0x58907e){var _0x14311c=_0x58907e[_0xb5a9('0x1c')],_0x5a4b10=_0x5b2abf[_0xb5a9('0x1d')],_0xb7df3b=_0x5b2abf[_0xb5a9('0x1d')]+_0x5b2abf[_0xb5a9('0x1e')],_0x44d600;if(_0xb7df3b>=_0x14311c){_0xb7df3b=_0x14311c;_0x44d600=0xc8;}else{_0x44d600=0xce;}_0x338467[_0xb5a9('0x19')](_0x44d600);return _0x338467[_0xb5a9('0x1f')](_0xb5a9('0x20'),_0x5a4b10+'-'+_0xb7df3b+'/'+_0x14311c)[_0xb5a9('0x1b')](_0x58907e);}return null;};}function patchUpdates(_0x23e8fb){return function(_0x4d6c87){try{jsonpatch[_0xb5a9('0x21')](_0x4d6c87,_0x23e8fb,!![]);}catch(_0x49c1a9){return BPromise[_0xb5a9('0x22')](_0x49c1a9);}return _0x4d6c87[_0xb5a9('0x23')]();};}function saveUpdates(_0xbccc03,_0x18529c){return function(_0x805050){if(_0x805050){return _0x805050['update'](_0xbccc03)['then'](function(_0x5920e0){return _0x5920e0;});}return null;};}function removeEntity(_0xe5dab,_0x463cdb){return function(_0x4aef1a){if(_0x4aef1a){return _0x4aef1a[_0xb5a9('0x24')]()['then'](function(){_0xe5dab[_0xb5a9('0x19')](0xcc)[_0xb5a9('0x1a')]();});}};}function handleEntityNotFound(_0x2705ae,_0x5a1763){return function(_0x4721bb){if(!_0x4721bb){_0x2705ae[_0xb5a9('0x25')](0x194);}return _0x4721bb;};}function handleError(_0x1c9227,_0x2a3912){_0x2a3912=_0x2a3912||0x1f4;return function(_0x4199ab){logger[_0xb5a9('0x26')](_0x4199ab[_0xb5a9('0x27')]);if(_0x4199ab['name']){delete _0x4199ab['name'];}_0x1c9227[_0xb5a9('0x19')](_0x2a3912)[_0xb5a9('0x28')](_0x4199ab);};}exports['index']=function(_0x56254f,_0x3aab56){var _0x1a890a={},_0x35fa08={},_0x563d8c={'count':0x0,'rows':[]};var _0x4e8166=_[_0xb5a9('0x29')](db['VoiceCallReport']['rawAttributes'],function(_0x26d556){return{'name':_0x26d556['fieldName'],'type':_0x26d556[_0xb5a9('0x2a')][_0xb5a9('0x2b')]};});_0x35fa08[_0xb5a9('0x2c')]=_['map'](_0x4e8166,_0xb5a9('0x2d'));_0x35fa08[_0xb5a9('0x2e')]=_[_0xb5a9('0x2f')](_0x56254f[_0xb5a9('0x2e')]);_0x35fa08[_0xb5a9('0x30')]=_[_0xb5a9('0x31')](_0x35fa08['model'],_0x35fa08['query']);_0x1a890a[_0xb5a9('0x32')]=_[_0xb5a9('0x31')](_0x35fa08[_0xb5a9('0x2c')],qs[_0xb5a9('0x33')](_0x56254f[_0xb5a9('0x2e')][_0xb5a9('0x33')]));_0x1a890a[_0xb5a9('0x32')]=_0x1a890a[_0xb5a9('0x32')][_0xb5a9('0x34')]?_0x1a890a['attributes']:_0x35fa08['model'];if(!_0x56254f['query'][_0xb5a9('0x35')]('nolimit')){_0x1a890a[_0xb5a9('0x1e')]=qs[_0xb5a9('0x1e')](_0x56254f[_0xb5a9('0x2e')][_0xb5a9('0x1e')]);_0x1a890a[_0xb5a9('0x1d')]=qs[_0xb5a9('0x1d')](_0x56254f[_0xb5a9('0x2e')][_0xb5a9('0x1d')]);}_0x1a890a['order']=qs[_0xb5a9('0x36')](_0x56254f[_0xb5a9('0x2e')]['sort']);_0x1a890a[_0xb5a9('0x37')]=qs[_0xb5a9('0x30')](_['pick'](_0x56254f[_0xb5a9('0x2e')],_0x35fa08[_0xb5a9('0x30')]));if(_0x56254f[_0xb5a9('0x2e')][_0xb5a9('0x38')]){_0x1a890a['where']=_['merge'](_0x1a890a['where'],{'$or':_[_0xb5a9('0x29')](_0x4e8166,function(_0x4adf33){if(_0x4adf33[_0xb5a9('0x2a')]!==_0xb5a9('0x39')){var _0x47dadb={};_0x47dadb[_0x4adf33[_0xb5a9('0x2d')]]={'$like':'%'+_0x56254f[_0xb5a9('0x2e')]['filter']+'%'};return _0x47dadb;}})});}_0x1a890a=_[_0xb5a9('0x3a')]({},_0x1a890a,_0x56254f[_0xb5a9('0x3b')]);var _0x4bc922={'where':_0x1a890a[_0xb5a9('0x37')]};return db[_0xb5a9('0x3c')][_0xb5a9('0x1c')](_0x4bc922)[_0xb5a9('0x3d')](function(_0x36cb85){_0x563d8c['count']=_0x36cb85;if(_0x56254f[_0xb5a9('0x2e')]['includeAll']){_0x1a890a[_0xb5a9('0x3e')]=[{'attributes':['id','name',_0xb5a9('0x3f'),_0xb5a9('0x40')],'model':db[_0xb5a9('0x41')],'as':_0xb5a9('0x41')}];}return db['VoiceCallReport'][_0xb5a9('0x42')](_0x1a890a);})['then'](function(_0x5c11d0){_0x563d8c[_0xb5a9('0x43')]=_0x5c11d0;return _0x563d8c;})[_0xb5a9('0x3d')](respondWithFilteredResult(_0x3aab56,_0x1a890a))[_0xb5a9('0x44')](handleError(_0x3aab56,null));};exports[_0xb5a9('0x45')]=function(_0x5b439d,_0x3b3beb){var _0x53b45a={'raw':!![],'where':{'id':_0x5b439d[_0xb5a9('0x46')]['id']}},_0xe4e4fd={};_0xe4e4fd[_0xb5a9('0x2c')]=_['keys'](db['VoiceCallReport']['rawAttributes']);_0xe4e4fd[_0xb5a9('0x2e')]=_[_0xb5a9('0x2f')](_0x5b439d[_0xb5a9('0x2e')]);_0xe4e4fd[_0xb5a9('0x30')]=_[_0xb5a9('0x31')](_0xe4e4fd[_0xb5a9('0x2c')],_0xe4e4fd[_0xb5a9('0x2e')]);_0x53b45a['attributes']=_[_0xb5a9('0x31')](_0xe4e4fd[_0xb5a9('0x2c')],qs[_0xb5a9('0x33')](_0x5b439d['query'][_0xb5a9('0x33')]));_0x53b45a[_0xb5a9('0x32')]=_0x53b45a['attributes'][_0xb5a9('0x34')]?_0x53b45a['attributes']:_0xe4e4fd[_0xb5a9('0x2c')];if(_0x5b439d['query'][_0xb5a9('0x47')]){_0x53b45a[_0xb5a9('0x3e')]=[{'all':!![]}];}_0x53b45a=_[_0xb5a9('0x3a')]({},_0x53b45a,_0x5b439d[_0xb5a9('0x3b')]);return db[_0xb5a9('0x3c')]['find'](_0x53b45a)[_0xb5a9('0x3d')](handleEntityNotFound(_0x3b3beb,null))[_0xb5a9('0x3d')](respondWithResult(_0x3b3beb,null))['catch'](handleError(_0x3b3beb,null));};exports[_0xb5a9('0x48')]=function(_0x5d3444,_0x546efa){return db[_0xb5a9('0x3c')][_0xb5a9('0x48')](_0x5d3444[_0xb5a9('0x49')],{})[_0xb5a9('0x3d')](respondWithResult(_0x546efa,0xc9))[_0xb5a9('0x44')](handleError(_0x546efa,null));};exports[_0xb5a9('0x24')]=function(_0xb39e9d,_0x3195c4){return db[_0xb5a9('0x3c')][_0xb5a9('0x4a')]({'where':{'id':_0xb39e9d[_0xb5a9('0x46')]['id']}})['then'](handleEntityNotFound(_0x3195c4,null))[_0xb5a9('0x3d')](removeEntity(_0x3195c4,null))['catch'](handleError(_0x3195c4,null));};exports['describe']=function(_0x59caec,_0x127c83){return db['VoiceCallReport'][_0xb5a9('0x4b')]()['then'](respondWithResult(_0x127c83,null))[_0xb5a9('0x44')](handleError(_0x127c83,null));};exports['update']=function(_0x26be4f,_0xdd9b0c){if(_0x26be4f[_0xb5a9('0x49')]['uniqueid']){delete _0x26be4f[_0xb5a9('0x49')][_0xb5a9('0x4c')];}return db[_0xb5a9('0x3c')][_0xb5a9('0x4a')]({'where':{'uniqueid':_0x26be4f['params']['id'],'UserId':{'$or':[null,_0x26be4f[_0xb5a9('0x4d')]['id']]}}})['then'](handleEntityNotFound(_0xdd9b0c,null))['then'](saveUpdates(_0x26be4f[_0xb5a9('0x49')],null))['then'](respondWithResult(_0xdd9b0c,null))[_0xb5a9('0x44')](handleError(_0xdd9b0c,null));}; \ No newline at end of file +var _0x6676=['then','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','findAll','rows','catch','show','params','options','find','create','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6676,0x1f0));var _0x6667=function(_0xb1477,_0x3a08ab){_0xb1477=_0xb1477-0x0;var _0x144429=_0x6676[_0xb1477];return _0x144429;};'use strict';var pdf=require(_0x6667('0x0'));var emlformat=require(_0x6667('0x1'));var rimraf=require(_0x6667('0x2'));var zipdir=require(_0x6667('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6667('0x4'));var moment=require(_0x6667('0x5'));var BPromise=require(_0x6667('0x6'));var Mustache=require(_0x6667('0x7'));var util=require('util');var path=require(_0x6667('0x8'));var sox=require(_0x6667('0x9'));var csv=require(_0x6667('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6667('0xb'));var squel=require(_0x6667('0xc'));var crypto=require(_0x6667('0xd'));var jsforce=require(_0x6667('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6667('0xa'));var querystring=require(_0x6667('0xf'));var Papa=require('papaparse');var Redis=require(_0x6667('0x10'));var authService=require(_0x6667('0x11'));var qs=require(_0x6667('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6667('0x13'));var logger=require(_0x6667('0x14'))(_0x6667('0x15'));var utils=require(_0x6667('0x16'));var config=require('../../config/environment');var db=require(_0x6667('0x17'))['db'];function respondWithStatusCode(_0x491a68,_0x5b1b62){_0x5b1b62=_0x5b1b62||0xcc;return function(_0x4109fe){if(_0x4109fe){return _0x491a68[_0x6667('0x18')](_0x5b1b62);}return _0x491a68[_0x6667('0x19')](_0x5b1b62)['end']();};}function respondWithResult(_0x31e99b,_0x1f4cf5){_0x1f4cf5=_0x1f4cf5||0xc8;return function(_0x53585f){if(_0x53585f){return _0x31e99b[_0x6667('0x19')](_0x1f4cf5)[_0x6667('0x1a')](_0x53585f);}};}function respondWithFilteredResult(_0xfb6802,_0x576d78){return function(_0x4b4fd9){if(_0x4b4fd9){var _0x4d7bdb=_0x4b4fd9[_0x6667('0x1b')],_0x20f3f7=_0x576d78[_0x6667('0x1c')],_0x1d33b8=_0x576d78[_0x6667('0x1c')]+_0x576d78[_0x6667('0x1d')],_0x4eb871;if(_0x1d33b8>=_0x4d7bdb){_0x1d33b8=_0x4d7bdb;_0x4eb871=0xc8;}else{_0x4eb871=0xce;}_0xfb6802[_0x6667('0x19')](_0x4eb871);return _0xfb6802['set'](_0x6667('0x1e'),_0x20f3f7+'-'+_0x1d33b8+'/'+_0x4d7bdb)['json'](_0x4b4fd9);}return null;};}function patchUpdates(_0x1e2cf9){return function(_0x420264){try{jsonpatch[_0x6667('0x1f')](_0x420264,_0x1e2cf9,!![]);}catch(_0x1a8bac){return BPromise[_0x6667('0x20')](_0x1a8bac);}return _0x420264[_0x6667('0x21')]();};}function saveUpdates(_0xd179e,_0x2e7b87){return function(_0x11ab61){if(_0x11ab61){return _0x11ab61[_0x6667('0x22')](_0xd179e)['then'](function(_0x44c21c){return _0x44c21c;});}return null;};}function removeEntity(_0x3f1b31,_0x1a45e3){return function(_0x2c27dd){if(_0x2c27dd){return _0x2c27dd[_0x6667('0x23')]()[_0x6667('0x24')](function(){_0x3f1b31[_0x6667('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58758d,_0x4d1950){return function(_0x1d9ecd){if(!_0x1d9ecd){_0x58758d[_0x6667('0x18')](0x194);}return _0x1d9ecd;};}function handleError(_0x13000f,_0x128675){_0x128675=_0x128675||0x1f4;return function(_0x1d35d4){logger[_0x6667('0x25')](_0x1d35d4[_0x6667('0x26')]);if(_0x1d35d4[_0x6667('0x27')]){delete _0x1d35d4[_0x6667('0x27')];}_0x13000f[_0x6667('0x19')](_0x128675)['send'](_0x1d35d4);};}exports[_0x6667('0x28')]=function(_0x4a6f8a,_0x390d6d){var _0x49e911={},_0x359aa4={},_0xcc30f8={'count':0x0,'rows':[]};var _0xcfb7b2=_[_0x6667('0x29')](db[_0x6667('0x2a')][_0x6667('0x2b')],function(_0x2dc7f6){return{'name':_0x2dc7f6[_0x6667('0x2c')],'type':_0x2dc7f6['type'][_0x6667('0x2d')]};});_0x359aa4['model']=_['map'](_0xcfb7b2,_0x6667('0x27'));_0x359aa4[_0x6667('0x2e')]=_[_0x6667('0x2f')](_0x4a6f8a[_0x6667('0x2e')]);_0x359aa4[_0x6667('0x30')]=_['intersection'](_0x359aa4[_0x6667('0x31')],_0x359aa4[_0x6667('0x2e')]);_0x49e911['attributes']=_[_0x6667('0x32')](_0x359aa4[_0x6667('0x31')],qs[_0x6667('0x33')](_0x4a6f8a[_0x6667('0x2e')][_0x6667('0x33')]));_0x49e911['attributes']=_0x49e911[_0x6667('0x34')][_0x6667('0x35')]?_0x49e911[_0x6667('0x34')]:_0x359aa4[_0x6667('0x31')];if(!_0x4a6f8a[_0x6667('0x2e')][_0x6667('0x36')](_0x6667('0x37'))){_0x49e911['limit']=qs[_0x6667('0x1d')](_0x4a6f8a[_0x6667('0x2e')]['limit']);_0x49e911[_0x6667('0x1c')]=qs[_0x6667('0x1c')](_0x4a6f8a['query'][_0x6667('0x1c')]);}_0x49e911['order']=qs[_0x6667('0x38')](_0x4a6f8a['query']['sort']);_0x49e911[_0x6667('0x39')]=qs[_0x6667('0x30')](_[_0x6667('0x3a')](_0x4a6f8a[_0x6667('0x2e')],_0x359aa4[_0x6667('0x30')]));if(_0x4a6f8a[_0x6667('0x2e')][_0x6667('0x3b')]){_0x49e911[_0x6667('0x39')]=_[_0x6667('0x3c')](_0x49e911['where'],{'$or':_[_0x6667('0x29')](_0xcfb7b2,function(_0x48d930){if(_0x48d930[_0x6667('0x3d')]!==_0x6667('0x3e')){var _0x18d1e6={};_0x18d1e6[_0x48d930[_0x6667('0x27')]]={'$like':'%'+_0x4a6f8a[_0x6667('0x2e')][_0x6667('0x3b')]+'%'};return _0x18d1e6;}})});}_0x49e911=_[_0x6667('0x3c')]({},_0x49e911,_0x4a6f8a['options']);var _0x33d525={'where':_0x49e911[_0x6667('0x39')]};return db[_0x6667('0x2a')][_0x6667('0x1b')](_0x33d525)[_0x6667('0x24')](function(_0xc6063f){_0xcc30f8[_0x6667('0x1b')]=_0xc6063f;if(_0x4a6f8a['query'][_0x6667('0x3f')]){_0x49e911[_0x6667('0x40')]=[{'attributes':['id',_0x6667('0x27'),_0x6667('0x41'),_0x6667('0x42')],'model':db['User'],'as':'User'}];}return db['VoiceCallReport'][_0x6667('0x43')](_0x49e911);})[_0x6667('0x24')](function(_0x46472a){_0xcc30f8[_0x6667('0x44')]=_0x46472a;return _0xcc30f8;})[_0x6667('0x24')](respondWithFilteredResult(_0x390d6d,_0x49e911))[_0x6667('0x45')](handleError(_0x390d6d,null));};exports[_0x6667('0x46')]=function(_0x395fa0,_0x394ccc){var _0x3dafc9={'raw':!![],'where':{'id':_0x395fa0[_0x6667('0x47')]['id']}},_0x5c2c2e={};_0x5c2c2e[_0x6667('0x31')]=_[_0x6667('0x2f')](db['VoiceCallReport']['rawAttributes']);_0x5c2c2e['query']=_[_0x6667('0x2f')](_0x395fa0[_0x6667('0x2e')]);_0x5c2c2e[_0x6667('0x30')]=_[_0x6667('0x32')](_0x5c2c2e[_0x6667('0x31')],_0x5c2c2e['query']);_0x3dafc9[_0x6667('0x34')]=_['intersection'](_0x5c2c2e['model'],qs['fields'](_0x395fa0[_0x6667('0x2e')][_0x6667('0x33')]));_0x3dafc9[_0x6667('0x34')]=_0x3dafc9[_0x6667('0x34')][_0x6667('0x35')]?_0x3dafc9['attributes']:_0x5c2c2e[_0x6667('0x31')];if(_0x395fa0[_0x6667('0x2e')][_0x6667('0x3f')]){_0x3dafc9[_0x6667('0x40')]=[{'all':!![]}];}_0x3dafc9=_[_0x6667('0x3c')]({},_0x3dafc9,_0x395fa0[_0x6667('0x48')]);return db['VoiceCallReport'][_0x6667('0x49')](_0x3dafc9)[_0x6667('0x24')](handleEntityNotFound(_0x394ccc,null))[_0x6667('0x24')](respondWithResult(_0x394ccc,null))['catch'](handleError(_0x394ccc,null));};exports[_0x6667('0x4a')]=function(_0x1d90bb,_0x55a758){return db[_0x6667('0x2a')]['create'](_0x1d90bb['body'],{})['then'](respondWithResult(_0x55a758,0xc9))[_0x6667('0x45')](handleError(_0x55a758,null));};exports['destroy']=function(_0x3df3a8,_0x45b53d){return db[_0x6667('0x2a')]['find']({'where':{'id':_0x3df3a8['params']['id']}})['then'](handleEntityNotFound(_0x45b53d,null))[_0x6667('0x24')](removeEntity(_0x45b53d,null))[_0x6667('0x45')](handleError(_0x45b53d,null));};exports[_0x6667('0x4b')]=function(_0x2347d3,_0x9279d4){return db[_0x6667('0x2a')]['describe']()[_0x6667('0x24')](respondWithResult(_0x9279d4,null))[_0x6667('0x45')](handleError(_0x9279d4,null));};exports['update']=function(_0x1c8a78,_0x4ecade){if(_0x1c8a78['body']['uniqueid']){delete _0x1c8a78['body']['uniqueid'];}return db[_0x6667('0x2a')][_0x6667('0x49')]({'where':{'uniqueid':_0x1c8a78['params']['id'],'UserId':{'$or':[null,_0x1c8a78['user']['id']]}}})['then'](handleEntityNotFound(_0x4ecade,null))['then'](saveUpdates(_0x1c8a78['body'],null))[_0x6667('0x24')](respondWithResult(_0x4ecade,null))[_0x6667('0x45')](handleError(_0x4ecade,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index ad8ab53..01e50be 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 _0x5998=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','VoiceCallReport','report_call'];(function(_0x5e5820,_0x5e4cfd){var _0x2f7654=function(_0x510682){while(--_0x510682){_0x5e5820['push'](_0x5e5820['shift']());}};_0x2f7654(++_0x5e4cfd);}(_0x5998,0xeb));var _0x8599=function(_0x3708ea,_0x406786){_0x3708ea=_0x3708ea-0x0;var _0x3c0a70=_0x5998[_0x3708ea];return _0x3c0a70;};'use strict';var _=require(_0x8599('0x0'));var util=require(_0x8599('0x1'));var logger=require(_0x8599('0x2'))(_0x8599('0x3'));var moment=require(_0x8599('0x4'));var BPromise=require(_0x8599('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8599('0x6'));var rimraf=require('rimraf');var config=require(_0x8599('0x7'));var attributes=require('./voiceCallReport.attributes');module[_0x8599('0x8')]=function(_0x114bc8,_0x18f179){return _0x114bc8[_0x8599('0x9')](_0x8599('0xa'),attributes,{'tableName':_0x8599('0xb'),'paranoid':![],'indexes':[{'fields':[_0x8599('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x229b=['util','../../config/logger','api','moment','exports','define','report_call','uniqueid'];(function(_0x67fea5,_0x5ed94d){var _0x1f5101=function(_0x407baa){while(--_0x407baa){_0x67fea5['push'](_0x67fea5['shift']());}};_0x1f5101(++_0x5ed94d);}(_0x229b,0xb8));var _0xb229=function(_0x4bf2d8,_0x2d3dd4){_0x4bf2d8=_0x4bf2d8-0x0;var _0x4cdc4f=_0x229b[_0x4bf2d8];return _0x4cdc4f;};'use strict';var _=require('lodash');var util=require(_0xb229('0x0'));var logger=require(_0xb229('0x1'))(_0xb229('0x2'));var moment=require(_0xb229('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module[_0xb229('0x4')]=function(_0x337ce7,_0x2c7847){return _0x337ce7[_0xb229('0x5')]('VoiceCallReport',attributes,{'tableName':_0xb229('0x6'),'paranoid':![],'indexes':[{'fields':[_0xb229('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 0ada188..9bd19d9 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 _0x7e1b=['http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceCallReport','findAll','options','where','limit','include','map','model','attributes','GetVoiceCallReport','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x30fa99,_0x4a5db1){var _0x268542=function(_0x1f6a4b){while(--_0x1f6a4b){_0x30fa99['push'](_0x30fa99['shift']());}};_0x268542(++_0x4a5db1);}(_0x7e1b,0x17c));var _0xb7e1=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x7e1b[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xb7e1('0x0'));var util=require(_0xb7e1('0x1'));var moment=require('moment');var BPromise=require(_0xb7e1('0x2'));var rs=require(_0xb7e1('0x3'));var fs=require('fs');var Redis=require(_0xb7e1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb7e1('0x5'));var logger=require(_0xb7e1('0x6'))(_0xb7e1('0x7'));var config=require('../../config/environment');var jayson=require(_0xb7e1('0x8'));var client=jayson[_0xb7e1('0x9')][_0xb7e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bf7ad,_0x1dc01,_0x4617b2){return new BPromise(function(_0x3bf997,_0x456582){return client[_0xb7e1('0xb')](_0x5bf7ad,_0x4617b2)[_0xb7e1('0xc')](function(_0x569819){logger[_0xb7e1('0xd')](_0xb7e1('0xe'),_0x1dc01,_0xb7e1('0xf'));logger[_0xb7e1('0x10')](_0xb7e1('0x11'),_0x1dc01,'request\x20sent',JSON[_0xb7e1('0x12')](_0x569819));if(_0x569819[_0xb7e1('0x13')]){if(_0x569819[_0xb7e1('0x13')][_0xb7e1('0x14')]===0x1f4){logger['error'](_0xb7e1('0xe'),_0x1dc01,_0x569819[_0xb7e1('0x13')][_0xb7e1('0x15')]);return _0x456582(_0x569819[_0xb7e1('0x13')][_0xb7e1('0x15')]);}logger[_0xb7e1('0x13')]('VoiceCallReport,\x20%s,\x20%s',_0x1dc01,_0x569819[_0xb7e1('0x13')]['message']);return _0x3bf997(_0x569819['error'][_0xb7e1('0x15')]);}else{logger[_0xb7e1('0xd')](_0xb7e1('0xe'),_0x1dc01,'request\x20sent');_0x3bf997(_0x569819[_0xb7e1('0x16')][_0xb7e1('0x15')]);}})[_0xb7e1('0x17')](function(_0x564a9d){logger['error'](_0xb7e1('0xe'),_0x1dc01,_0x564a9d);_0x456582(_0x564a9d);});});}exports['GetVoiceCallReport']=function(_0x13b06c){var _0x331eb7=this;return new Promise(function(_0x4366b9,_0x4e203b){return db[_0xb7e1('0x18')][_0xb7e1('0x19')]({'raw':_0x13b06c[_0xb7e1('0x1a')]?_0x13b06c['options']['raw']===undefined?!![]:![]:!![],'where':_0x13b06c[_0xb7e1('0x1a')]?_0x13b06c['options'][_0xb7e1('0x1b')]||null:null,'attributes':_0x13b06c[_0xb7e1('0x1a')]?_0x13b06c[_0xb7e1('0x1a')]['attributes']||null:null,'limit':_0x13b06c[_0xb7e1('0x1a')]?_0x13b06c[_0xb7e1('0x1a')][_0xb7e1('0x1c')]||null:null,'include':_0x13b06c[_0xb7e1('0x1a')]?_0x13b06c['options'][_0xb7e1('0x1d')]?_[_0xb7e1('0x1e')](_0x13b06c[_0xb7e1('0x1a')]['include'],function(_0xfd37d1){return{'model':db[_0xfd37d1[_0xb7e1('0x1f')]],'as':_0xfd37d1['as'],'attributes':_0xfd37d1[_0xb7e1('0x20')],'include':_0xfd37d1[_0xb7e1('0x1d')]?_[_0xb7e1('0x1e')](_0xfd37d1[_0xb7e1('0x1d')],function(_0x16cddc){return{'model':db[_0x16cddc[_0xb7e1('0x1f')]],'as':_0x16cddc['as'],'attributes':_0x16cddc[_0xb7e1('0x20')],'include':_0x16cddc[_0xb7e1('0x1d')]?_[_0xb7e1('0x1e')](_0x16cddc[_0xb7e1('0x1d')],function(_0x436ea4){return{'model':db[_0x436ea4['model']],'as':_0x436ea4['as'],'attributes':_0x436ea4[_0xb7e1('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb7e1('0xc')](function(_0x5b9df3){logger[_0xb7e1('0xd')](_0xb7e1('0x21'),_0x13b06c);logger[_0xb7e1('0x10')](_0xb7e1('0x21'),_0x13b06c,JSON[_0xb7e1('0x12')](_0x5b9df3));_0x4366b9(_0x5b9df3);})['catch'](function(_0x2f9de9){logger[_0xb7e1('0x13')]('GetVoiceCallReport',_0x2f9de9[_0xb7e1('0x15')],_0x13b06c);_0x4e203b(_0x331eb7['error'](0x1f4,_0x2f9de9[_0xb7e1('0x15')]));});});};exports[_0xb7e1('0x22')]=function(_0x3b5fde){var _0x7b5281=this;return new Promise(function(_0x4754ef,_0x119276){return db['VoiceCallReport'][_0xb7e1('0x23')](_0x3b5fde[_0xb7e1('0x24')],{'raw':_0x3b5fde[_0xb7e1('0x1a')]?_0x3b5fde[_0xb7e1('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xb7e1('0xc')](function(_0x2cc5b1){logger['info'](_0xb7e1('0x22'),_0x3b5fde);logger[_0xb7e1('0x10')]('CreateVoiceCallReport',_0x3b5fde,JSON[_0xb7e1('0x12')](_0x2cc5b1));_0x4754ef(_0x2cc5b1);})['catch'](function(_0x33c330){logger[_0xb7e1('0x13')]('CreateVoiceCallReport',_0x33c330[_0xb7e1('0x15')],_0x3b5fde);_0x119276(_0x7b5281[_0xb7e1('0x13')](0x1f4,_0x33c330[_0xb7e1('0x15')]));});});};exports[_0xb7e1('0x25')]=function(_0x5426c9){var _0x47709e=this;return new Promise(function(_0x273a19,_0x4602f1){return db[_0xb7e1('0x18')][_0xb7e1('0x26')](_0x5426c9[_0xb7e1('0x24')],{'raw':_0x5426c9['options']?_0x5426c9[_0xb7e1('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5426c9['options']?_0x5426c9[_0xb7e1('0x1a')][_0xb7e1('0x1b')]||null:null,'attributes':_0x5426c9[_0xb7e1('0x1a')]?_0x5426c9[_0xb7e1('0x1a')][_0xb7e1('0x20')]||null:null,'limit':_0x5426c9[_0xb7e1('0x1a')]?_0x5426c9['options']['limit']||null:null})['then'](function(_0x754a2d){logger[_0xb7e1('0xd')](_0xb7e1('0x25'),_0x5426c9);logger[_0xb7e1('0x10')]('UpdateVoiceCallReport',_0x5426c9,JSON[_0xb7e1('0x12')](_0x754a2d));_0x273a19(_0x754a2d);})[_0xb7e1('0x17')](function(_0x2d7d8e){logger['error'](_0xb7e1('0x25'),_0x2d7d8e[_0xb7e1('0x15')],_0x5426c9);_0x4602f1(_0x47709e[_0xb7e1('0x13')](0x1f4,_0x2d7d8e[_0xb7e1('0x15')]));});});}; \ No newline at end of file +var _0xc623=['then','GetVoiceCallReport','debug','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','VoiceCallReport','options','raw','where','attributes','limit','model','include','map'];(function(_0x20a26e,_0xfcc25e){var _0x1a481f=function(_0x6efa73){while(--_0x6efa73){_0x20a26e['push'](_0x20a26e['shift']());}};_0x1a481f(++_0xfcc25e);}(_0xc623,0xac));var _0x3c62=function(_0x6f0142,_0x2a9eb3){_0x6f0142=_0x6f0142-0x0;var _0x970d28=_0xc623[_0x6f0142];return _0x970d28;};'use strict';var _=require(_0x3c62('0x0'));var util=require('util');var moment=require(_0x3c62('0x1'));var BPromise=require('bluebird');var rs=require(_0x3c62('0x2'));var fs=require('fs');var Redis=require(_0x3c62('0x3'));var db=require(_0x3c62('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3c62('0x5'))('rpc');var config=require(_0x3c62('0x6'));var jayson=require(_0x3c62('0x7'));var client=jayson[_0x3c62('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbab590,_0xaa6662,_0x549956){return new BPromise(function(_0x9d4ceb,_0x5b1760){return client['request'](_0xbab590,_0x549956)['then'](function(_0x200089){logger[_0x3c62('0x9')](_0x3c62('0xa'),_0xaa6662,'request\x20sent');logger['debug']('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0xaa6662,_0x3c62('0xb'),JSON[_0x3c62('0xc')](_0x200089));if(_0x200089[_0x3c62('0xd')]){if(_0x200089[_0x3c62('0xd')][_0x3c62('0xe')]===0x1f4){logger[_0x3c62('0xd')](_0x3c62('0xa'),_0xaa6662,_0x200089[_0x3c62('0xd')][_0x3c62('0xf')]);return _0x5b1760(_0x200089[_0x3c62('0xd')][_0x3c62('0xf')]);}logger['error'](_0x3c62('0xa'),_0xaa6662,_0x200089[_0x3c62('0xd')][_0x3c62('0xf')]);return _0x9d4ceb(_0x200089[_0x3c62('0xd')][_0x3c62('0xf')]);}else{logger[_0x3c62('0x9')](_0x3c62('0xa'),_0xaa6662,_0x3c62('0xb'));_0x9d4ceb(_0x200089['result'][_0x3c62('0xf')]);}})[_0x3c62('0x10')](function(_0xeb92d7){logger[_0x3c62('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0xaa6662,_0xeb92d7);_0x5b1760(_0xeb92d7);});});}exports['GetVoiceCallReport']=function(_0x521a36){var _0x453327=this;return new Promise(function(_0x45d70b,_0x55fef1){return db[_0x3c62('0x11')]['findAll']({'raw':_0x521a36['options']?_0x521a36[_0x3c62('0x12')][_0x3c62('0x13')]===undefined?!![]:![]:!![],'where':_0x521a36[_0x3c62('0x12')]?_0x521a36['options'][_0x3c62('0x14')]||null:null,'attributes':_0x521a36[_0x3c62('0x12')]?_0x521a36[_0x3c62('0x12')][_0x3c62('0x15')]||null:null,'limit':_0x521a36[_0x3c62('0x12')]?_0x521a36[_0x3c62('0x12')][_0x3c62('0x16')]||null:null,'include':_0x521a36[_0x3c62('0x12')]?_0x521a36[_0x3c62('0x12')]['include']?_['map'](_0x521a36[_0x3c62('0x12')]['include'],function(_0x397ae2){return{'model':db[_0x397ae2[_0x3c62('0x17')]],'as':_0x397ae2['as'],'attributes':_0x397ae2[_0x3c62('0x15')],'include':_0x397ae2[_0x3c62('0x18')]?_[_0x3c62('0x19')](_0x397ae2[_0x3c62('0x18')],function(_0x40c100){return{'model':db[_0x40c100[_0x3c62('0x17')]],'as':_0x40c100['as'],'attributes':_0x40c100[_0x3c62('0x15')],'include':_0x40c100['include']?_[_0x3c62('0x19')](_0x40c100['include'],function(_0x16c474){return{'model':db[_0x16c474[_0x3c62('0x17')]],'as':_0x16c474['as'],'attributes':_0x16c474[_0x3c62('0x15')]};}):[]};}):[]};}):[]:[]})[_0x3c62('0x1a')](function(_0x1c191d){logger[_0x3c62('0x9')](_0x3c62('0x1b'),_0x521a36);logger[_0x3c62('0x1c')](_0x3c62('0x1b'),_0x521a36,JSON['stringify'](_0x1c191d));_0x45d70b(_0x1c191d);})[_0x3c62('0x10')](function(_0x10d8ea){logger['error'](_0x3c62('0x1b'),_0x10d8ea['message'],_0x521a36);_0x55fef1(_0x453327[_0x3c62('0xd')](0x1f4,_0x10d8ea[_0x3c62('0xf')]));});});};exports[_0x3c62('0x1d')]=function(_0x20f466){var _0xa08e6f=this;return new Promise(function(_0x54a08c,_0x5274ef){return db[_0x3c62('0x11')][_0x3c62('0x1e')](_0x20f466[_0x3c62('0x1f')],{'raw':_0x20f466[_0x3c62('0x12')]?_0x20f466[_0x3c62('0x12')][_0x3c62('0x13')]===undefined?!![]:![]:!![]})[_0x3c62('0x1a')](function(_0x557cad){logger[_0x3c62('0x9')](_0x3c62('0x1d'),_0x20f466);logger[_0x3c62('0x1c')](_0x3c62('0x1d'),_0x20f466,JSON[_0x3c62('0xc')](_0x557cad));_0x54a08c(_0x557cad);})[_0x3c62('0x10')](function(_0x523cdc){logger['error'](_0x3c62('0x1d'),_0x523cdc[_0x3c62('0xf')],_0x20f466);_0x5274ef(_0xa08e6f[_0x3c62('0xd')](0x1f4,_0x523cdc['message']));});});};exports[_0x3c62('0x20')]=function(_0x4bd1d2){var _0x40c56e=this;return new Promise(function(_0x14ae01,_0x169f5c){return db[_0x3c62('0x11')]['update'](_0x4bd1d2[_0x3c62('0x1f')],{'raw':_0x4bd1d2[_0x3c62('0x12')]?_0x4bd1d2['options'][_0x3c62('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4bd1d2[_0x3c62('0x12')]?_0x4bd1d2['options']['where']||null:null,'attributes':_0x4bd1d2[_0x3c62('0x12')]?_0x4bd1d2[_0x3c62('0x12')][_0x3c62('0x15')]||null:null,'limit':_0x4bd1d2[_0x3c62('0x12')]?_0x4bd1d2[_0x3c62('0x12')]['limit']||null:null})['then'](function(_0x3e4fd4){logger[_0x3c62('0x9')]('UpdateVoiceCallReport',_0x4bd1d2);logger[_0x3c62('0x1c')](_0x3c62('0x20'),_0x4bd1d2,JSON['stringify'](_0x3e4fd4));_0x14ae01(_0x3e4fd4);})[_0x3c62('0x10')](function(_0xcab4f6){logger[_0x3c62('0xd')](_0x3c62('0x20'),_0xcab4f6[_0x3c62('0xf')],_0x4bd1d2);_0x169f5c(_0x40c56e[_0x3c62('0xd')](0x1f4,_0xcab4f6[_0x3c62('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index c53890e..0146f77 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 _0x29b1=['isAuthenticated','index','/:id','show','post','put','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get'];(function(_0x393658,_0x4f642b){var _0x23f7e6=function(_0x37cc9d){while(--_0x37cc9d){_0x393658['push'](_0x393658['shift']());}};_0x23f7e6(++_0x4f642b);}(_0x29b1,0x13b));var _0x129b=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x29b1[_0x3ea913];return _0x2b4f28;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x129b('0x0'));var timeout=require(_0x129b('0x1'));var express=require(_0x129b('0x2'));var router=express[_0x129b('0x3')]();var auth=require(_0x129b('0x4'));var interaction=require(_0x129b('0x5'));var config=require(_0x129b('0x6'));var controller=require(_0x129b('0x7'));router[_0x129b('0x8')]('/',auth[_0x129b('0x9')](),controller[_0x129b('0xa')]);router['get'](_0x129b('0xb'),auth['isAuthenticated'](),controller[_0x129b('0xc')]);router[_0x129b('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x129b('0xe')]('/:id',auth[_0x129b('0x9')](),controller[_0x129b('0xf')]);router[_0x129b('0x10')](_0x129b('0xb'),auth[_0x129b('0x9')](),controller[_0x129b('0x11')]);module['exports']=router; \ No newline at end of file +var _0x9120=['./voiceChanSpy.controller','get','isAuthenticated','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x7c5240,_0x2033b2){var _0x2b9b64=function(_0xa39ee4){while(--_0xa39ee4){_0x7c5240['push'](_0x7c5240['shift']());}};_0x2b9b64(++_0x2033b2);}(_0x9120,0x1b3));var _0x0912=function(_0x5a4570,_0x3949eb){_0x5a4570=_0x5a4570-0x0;var _0x22017d=_0x9120[_0x5a4570];return _0x22017d;};'use strict';var multer=require(_0x0912('0x0'));var util=require(_0x0912('0x1'));var path=require(_0x0912('0x2'));var timeout=require(_0x0912('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x0912('0x4'));var interaction=require(_0x0912('0x5'));var config=require(_0x0912('0x6'));var controller=require(_0x0912('0x7'));router[_0x0912('0x8')]('/',auth[_0x0912('0x9')](),controller['index']);router[_0x0912('0x8')](_0x0912('0xa'),auth[_0x0912('0x9')](),controller['show']);router[_0x0912('0xb')]('/',auth[_0x0912('0x9')](),controller[_0x0912('0xc')]);router[_0x0912('0xd')](_0x0912('0xa'),auth['isAuthenticated'](),controller[_0x0912('0xe')]);router[_0x0912('0xf')](_0x0912('0xa'),auth[_0x0912('0x9')](),controller['destroy']);module[_0x0912('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 94f2945..38a7cfb 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 _0xa5d8=['exports','name','STRING','setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0xa5d8,0x1b7));var _0x8a5d=function(_0xc11b27,_0x4d387e){_0xc11b27=_0xc11b27-0x0;var _0x237e70=_0xa5d8[_0xc11b27];return _0x237e70;};'use strict';var Sequelize=require(_0x8a5d('0x0'));module[_0x8a5d('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':_0x8a5d('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x8a5d('0x3')],'set':function(_0x3256fc){this[_0x8a5d('0x4')](_0x8a5d('0x5'),_0x3256fc?_0x3256fc[_0x8a5d('0x6')](''):[]);},'get':function(){return this[_0x8a5d('0x7')](_0x8a5d('0x5'))?this[_0x8a5d('0x7')](_0x8a5d('0x5'))[_0x8a5d('0x8')](''):[];}},'auth':{'type':Sequelize[_0x8a5d('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0x8a5d('0x3')]},'record':{'type':Sequelize[_0x8a5d('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8a5d('0x3')]}}; \ No newline at end of file +var _0x63b1=['sequelize','exports','STRING','name','setDataValue','join','getDataValue','options','split','BOOLEAN'];(function(_0x3aeb36,_0x312dc9){var _0xa2ef21=function(_0x50a46b){while(--_0x50a46b){_0x3aeb36['push'](_0x3aeb36['shift']());}};_0xa2ef21(++_0x312dc9);}(_0x63b1,0x96));var _0x163b=function(_0x28d367,_0x17cf88){_0x28d367=_0x28d367-0x0;var _0x1e9328=_0x63b1[_0x28d367];return _0x1e9328;};'use strict';var Sequelize=require(_0x163b('0x0'));module[_0x163b('0x1')]={'name':{'type':Sequelize[_0x163b('0x2')]},'prefix':{'type':Sequelize[_0x163b('0x2')],'unique':_0x163b('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x163b('0x2')],'set':function(_0x299a70){this[_0x163b('0x4')]('options',_0x299a70?_0x299a70[_0x163b('0x5')](''):[]);},'get':function(){return this[_0x163b('0x6')](_0x163b('0x7'))?this[_0x163b('0x6')](_0x163b('0x7'))[_0x163b('0x8')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x163b('0x2')]},'record':{'type':Sequelize[_0x163b('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x163b('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 943090a..df8cc7f 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 _0xffe6=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','count','includeAll','findAll','catch','keys','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChanSpies','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','apply','reject','save','destroy','then','get','UserProfileResource','error','stack','name','send','index','map','VoiceChanSpy','fieldName','key','query','filters','model','intersection','fields','attributes'];(function(_0x34f070,_0x155063){var _0x12fb44=function(_0x42a88e){while(--_0x42a88e){_0x34f070['push'](_0x34f070['shift']());}};_0x12fb44(++_0x155063);}(_0xffe6,0x1f4));var _0x6ffe=function(_0x44adb5,_0x339102){_0x44adb5=_0x44adb5-0x0;var _0x48451e=_0xffe6[_0x44adb5];return _0x48451e;};'use strict';var pdf=require(_0x6ffe('0x0'));var emlformat=require(_0x6ffe('0x1'));var rimraf=require(_0x6ffe('0x2'));var zipdir=require(_0x6ffe('0x3'));var jsonpatch=require(_0x6ffe('0x4'));var rp=require(_0x6ffe('0x5'));var moment=require(_0x6ffe('0x6'));var BPromise=require(_0x6ffe('0x7'));var Mustache=require('mustache');var util=require(_0x6ffe('0x8'));var path=require(_0x6ffe('0x9'));var sox=require(_0x6ffe('0xa'));var csv=require(_0x6ffe('0xb'));var ejs=require(_0x6ffe('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6ffe('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6ffe('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6ffe('0xf'));var Papa=require('papaparse');var Redis=require(_0x6ffe('0x10'));var authService=require(_0x6ffe('0x11'));var qs=require(_0x6ffe('0x12'));var as=require(_0x6ffe('0x13'));var hardwareService=require(_0x6ffe('0x14'));var logger=require(_0x6ffe('0x15'))('api');var utils=require(_0x6ffe('0x16'));var config=require(_0x6ffe('0x17'));var db=require(_0x6ffe('0x18'))['db'];function respondWithStatusCode(_0x484e81,_0x4fe900){_0x4fe900=_0x4fe900||0xcc;return function(_0x5c6c1a){if(_0x5c6c1a){return _0x484e81[_0x6ffe('0x19')](_0x4fe900);}return _0x484e81[_0x6ffe('0x1a')](_0x4fe900)[_0x6ffe('0x1b')]();};}function respondWithResult(_0x5b7ff2,_0x476f94){_0x476f94=_0x476f94||0xc8;return function(_0x1e6330){if(_0x1e6330){return _0x5b7ff2['status'](_0x476f94)[_0x6ffe('0x1c')](_0x1e6330);}};}function respondWithFilteredResult(_0x3fa20d,_0x27d3c0){return function(_0x4bac30){if(_0x4bac30){var _0x248190=_0x4bac30['count'],_0x392271=_0x27d3c0['offset'],_0x5ee854=_0x27d3c0[_0x6ffe('0x1d')]+_0x27d3c0[_0x6ffe('0x1e')],_0x29ad71;if(_0x5ee854>=_0x248190){_0x5ee854=_0x248190;_0x29ad71=0xc8;}else{_0x29ad71=0xce;}_0x3fa20d[_0x6ffe('0x1a')](_0x29ad71);return _0x3fa20d['set']('Content-Range',_0x392271+'-'+_0x5ee854+'/'+_0x248190)[_0x6ffe('0x1c')](_0x4bac30);}return null;};}function patchUpdates(_0x4c7075){return function(_0x5abb29){try{jsonpatch[_0x6ffe('0x1f')](_0x5abb29,_0x4c7075,!![]);}catch(_0x4040be){return BPromise[_0x6ffe('0x20')](_0x4040be);}return _0x5abb29[_0x6ffe('0x21')]();};}function saveUpdates(_0x4f4d7,_0x353e16){return function(_0x2d4964){if(_0x2d4964){return _0x2d4964['update'](_0x4f4d7)['then'](function(_0x19526b){return _0x19526b;});}return null;};}function removeEntity(_0x110407,_0xe0521c){return function(_0x5c1770){if(_0x5c1770){return _0x5c1770[_0x6ffe('0x22')]()[_0x6ffe('0x23')](function(){var _0x16eb3c=_0x5c1770[_0x6ffe('0x24')]({'plain':!![]});var _0x330931='ChanSpies';return db[_0x6ffe('0x25')][_0x6ffe('0x22')]({'where':{'type':_0x330931,'resourceId':_0x16eb3c['id']}})[_0x6ffe('0x23')](function(){return _0x5c1770;});})[_0x6ffe('0x23')](function(){_0x110407[_0x6ffe('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48d179,_0x560d44){return function(_0x2efca0){if(!_0x2efca0){_0x48d179[_0x6ffe('0x19')](0x194);}return _0x2efca0;};}function handleError(_0x1b869b,_0x1e3bd9){_0x1e3bd9=_0x1e3bd9||0x1f4;return function(_0x4048fd){logger[_0x6ffe('0x26')](_0x4048fd[_0x6ffe('0x27')]);if(_0x4048fd[_0x6ffe('0x28')]){delete _0x4048fd[_0x6ffe('0x28')];}_0x1b869b[_0x6ffe('0x1a')](_0x1e3bd9)[_0x6ffe('0x29')](_0x4048fd);};}exports[_0x6ffe('0x2a')]=function(_0x118e82,_0x2ccbc7){var _0x1a2345={},_0x1d57a4={},_0x5496f0={'count':0x0,'rows':[]};var _0x412f02=_[_0x6ffe('0x2b')](db[_0x6ffe('0x2c')]['rawAttributes'],function(_0x166509){return{'name':_0x166509[_0x6ffe('0x2d')],'type':_0x166509['type'][_0x6ffe('0x2e')]};});_0x1d57a4['model']=_[_0x6ffe('0x2b')](_0x412f02,_0x6ffe('0x28'));_0x1d57a4[_0x6ffe('0x2f')]=_['keys'](_0x118e82[_0x6ffe('0x2f')]);_0x1d57a4[_0x6ffe('0x30')]=_['intersection'](_0x1d57a4[_0x6ffe('0x31')],_0x1d57a4[_0x6ffe('0x2f')]);_0x1a2345['attributes']=_[_0x6ffe('0x32')](_0x1d57a4[_0x6ffe('0x31')],qs[_0x6ffe('0x33')](_0x118e82[_0x6ffe('0x2f')][_0x6ffe('0x33')]));_0x1a2345[_0x6ffe('0x34')]=_0x1a2345[_0x6ffe('0x34')]['length']?_0x1a2345[_0x6ffe('0x34')]:_0x1d57a4[_0x6ffe('0x31')];if(!_0x118e82[_0x6ffe('0x2f')][_0x6ffe('0x35')](_0x6ffe('0x36'))){_0x1a2345[_0x6ffe('0x1e')]=qs['limit'](_0x118e82[_0x6ffe('0x2f')][_0x6ffe('0x1e')]);_0x1a2345['offset']=qs[_0x6ffe('0x1d')](_0x118e82[_0x6ffe('0x2f')][_0x6ffe('0x1d')]);}_0x1a2345['order']=qs[_0x6ffe('0x37')](_0x118e82['query']['sort']);_0x1a2345[_0x6ffe('0x38')]=qs[_0x6ffe('0x30')](_[_0x6ffe('0x39')](_0x118e82[_0x6ffe('0x2f')],_0x1d57a4['filters']));if(_0x118e82[_0x6ffe('0x2f')][_0x6ffe('0x3a')]){_0x1a2345[_0x6ffe('0x38')]=_[_0x6ffe('0x3b')](_0x1a2345[_0x6ffe('0x38')],{'$or':_[_0x6ffe('0x2b')](_0x412f02,function(_0x267052){if(_0x267052[_0x6ffe('0x3c')]!=='VIRTUAL'){var _0x3bff1e={};_0x3bff1e[_0x267052[_0x6ffe('0x28')]]={'$like':'%'+_0x118e82[_0x6ffe('0x2f')][_0x6ffe('0x3a')]+'%'};return _0x3bff1e;}})});}_0x1a2345=_[_0x6ffe('0x3b')]({},_0x1a2345,_0x118e82[_0x6ffe('0x3d')]);var _0x217e8f={'where':_0x1a2345[_0x6ffe('0x38')]};return db[_0x6ffe('0x2c')][_0x6ffe('0x3e')](_0x217e8f)['then'](function(_0x47632c){_0x5496f0['count']=_0x47632c;if(_0x118e82[_0x6ffe('0x2f')][_0x6ffe('0x3f')]){_0x1a2345['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0x6ffe('0x40')](_0x1a2345);})[_0x6ffe('0x23')](function(_0x1477f4){_0x5496f0['rows']=_0x1477f4;return _0x5496f0;})[_0x6ffe('0x23')](respondWithFilteredResult(_0x2ccbc7,_0x1a2345))[_0x6ffe('0x41')](handleError(_0x2ccbc7,null));};exports['show']=function(_0x6a7628,_0x193c8d){var _0x2c7a83={'raw':![],'where':{'id':_0x6a7628['params']['id']}},_0x87c670={};_0x87c670['model']=_[_0x6ffe('0x42')](db[_0x6ffe('0x2c')][_0x6ffe('0x43')]);_0x87c670['query']=_[_0x6ffe('0x42')](_0x6a7628['query']);_0x87c670[_0x6ffe('0x30')]=_[_0x6ffe('0x32')](_0x87c670[_0x6ffe('0x31')],_0x87c670[_0x6ffe('0x2f')]);_0x2c7a83['attributes']=_[_0x6ffe('0x32')](_0x87c670['model'],qs['fields'](_0x6a7628[_0x6ffe('0x2f')][_0x6ffe('0x33')]));_0x2c7a83[_0x6ffe('0x34')]=_0x2c7a83[_0x6ffe('0x34')][_0x6ffe('0x44')]?_0x2c7a83['attributes']:_0x87c670[_0x6ffe('0x31')];if(_0x6a7628[_0x6ffe('0x2f')][_0x6ffe('0x3f')]){_0x2c7a83['include']=[{'all':!![]}];}_0x2c7a83=_['merge']({},_0x2c7a83,_0x6a7628[_0x6ffe('0x3d')]);return db[_0x6ffe('0x2c')][_0x6ffe('0x45')](_0x2c7a83)['then'](handleEntityNotFound(_0x193c8d,null))[_0x6ffe('0x23')](respondWithResult(_0x193c8d,null))['catch'](handleError(_0x193c8d,null));};exports[_0x6ffe('0x46')]=function(_0x137960,_0x10b9d1){return db[_0x6ffe('0x2c')][_0x6ffe('0x46')](_0x137960[_0x6ffe('0x47')],{})[_0x6ffe('0x23')](function(_0x5c6973){var _0x4bb505=_0x137960[_0x6ffe('0x48')][_0x6ffe('0x24')]({'plain':!![]});if(!_0x4bb505)throw new Error(_0x6ffe('0x49'));if(_0x4bb505['role']===_0x6ffe('0x48')){var _0x3d0106=_0x5c6973[_0x6ffe('0x24')]({'plain':!![]});var _0x5a2bab=_0x6ffe('0x4a');return db['UserProfileSection'][_0x6ffe('0x45')]({'where':{'name':_0x5a2bab,'userProfileId':_0x4bb505[_0x6ffe('0x4b')]},'raw':!![]})[_0x6ffe('0x23')](function(_0x45610a){if(_0x45610a&&_0x45610a['autoAssociation']===0x0){return db[_0x6ffe('0x25')][_0x6ffe('0x46')]({'name':_0x3d0106[_0x6ffe('0x28')],'resourceId':_0x3d0106['id'],'type':_0x45610a[_0x6ffe('0x28')],'sectionId':_0x45610a['id']},{})['then'](function(){return _0x5c6973;});}else{return _0x5c6973;}})[_0x6ffe('0x41')](function(_0x4e693b){logger[_0x6ffe('0x26')](_0x6ffe('0x4c'),_0x4e693b);throw _0x4e693b;});}return _0x5c6973;})[_0x6ffe('0x23')](respondWithResult(_0x10b9d1,0xc9))[_0x6ffe('0x41')](handleError(_0x10b9d1,null));};exports[_0x6ffe('0x4d')]=function(_0xdca54d,_0xe462c3){if(_0xdca54d[_0x6ffe('0x47')]['id']){delete _0xdca54d['body']['id'];}return db[_0x6ffe('0x2c')]['find']({'where':{'id':_0xdca54d[_0x6ffe('0x4e')]['id']}})[_0x6ffe('0x23')](handleEntityNotFound(_0xe462c3,null))[_0x6ffe('0x23')](saveUpdates(_0xdca54d[_0x6ffe('0x47')],null))['then'](respondWithResult(_0xe462c3,null))['catch'](handleError(_0xe462c3,null));};exports[_0x6ffe('0x22')]=function(_0xee2ded,_0x4835b1){return db['VoiceChanSpy'][_0x6ffe('0x45')]({'where':{'id':_0xee2ded[_0x6ffe('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4835b1,null))['then'](removeEntity(_0x4835b1,null))[_0x6ffe('0x41')](handleError(_0x4835b1,null));}; \ No newline at end of file +var _0x00ee=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','zip-dir','fast-json-patch','request-promise','moment','mustache','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/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','get','ChanSpies','error','name','send','VoiceChanSpy','rawAttributes','type','key','model','map','keys','query','filters','intersection','fields','attributes'];(function(_0x5d8f,_0x14d9d3){var _0x252a50=function(_0x4b65e7){while(--_0x4b65e7){_0x5d8f['push'](_0x5d8f['shift']());}};_0x252a50(++_0x14d9d3);}(_0x00ee,0x1aa));var _0xe00e=function(_0x2f57b2,_0xa8e91a){_0x2f57b2=_0x2f57b2-0x0;var _0x5ace77=_0x00ee[_0x2f57b2];return _0x5ace77;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe00e('0x0'));var jsonpatch=require(_0xe00e('0x1'));var rp=require(_0xe00e('0x2'));var moment=require(_0xe00e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe00e('0x4'));var util=require('util');var path=require(_0xe00e('0x5'));var sox=require('sox');var csv=require(_0xe00e('0x6'));var ejs=require(_0xe00e('0x7'));var fs=require('fs');var _=require(_0xe00e('0x8'));var squel=require(_0xe00e('0x9'));var crypto=require(_0xe00e('0xa'));var jsforce=require(_0xe00e('0xb'));var deskjs=require(_0xe00e('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe00e('0xd'));var Papa=require(_0xe00e('0xe'));var Redis=require(_0xe00e('0xf'));var authService=require(_0xe00e('0x10'));var qs=require(_0xe00e('0x11'));var as=require(_0xe00e('0x12'));var hardwareService=require(_0xe00e('0x13'));var logger=require(_0xe00e('0x14'))(_0xe00e('0x15'));var utils=require('../../config/utils');var config=require(_0xe00e('0x16'));var db=require(_0xe00e('0x17'))['db'];function respondWithStatusCode(_0x1c331c,_0x1d6552){_0x1d6552=_0x1d6552||0xcc;return function(_0x34b342){if(_0x34b342){return _0x1c331c[_0xe00e('0x18')](_0x1d6552);}return _0x1c331c[_0xe00e('0x19')](_0x1d6552)[_0xe00e('0x1a')]();};}function respondWithResult(_0x219769,_0x544fc6){_0x544fc6=_0x544fc6||0xc8;return function(_0x1e56af){if(_0x1e56af){return _0x219769[_0xe00e('0x19')](_0x544fc6)[_0xe00e('0x1b')](_0x1e56af);}};}function respondWithFilteredResult(_0x5e3276,_0x4a6a03){return function(_0x39dd0d){if(_0x39dd0d){var _0x1bf7ef=_0x39dd0d[_0xe00e('0x1c')],_0x1b74b8=_0x4a6a03[_0xe00e('0x1d')],_0x30e5a1=_0x4a6a03[_0xe00e('0x1d')]+_0x4a6a03[_0xe00e('0x1e')],_0xdb0090;if(_0x30e5a1>=_0x1bf7ef){_0x30e5a1=_0x1bf7ef;_0xdb0090=0xc8;}else{_0xdb0090=0xce;}_0x5e3276[_0xe00e('0x19')](_0xdb0090);return _0x5e3276['set'](_0xe00e('0x1f'),_0x1b74b8+'-'+_0x30e5a1+'/'+_0x1bf7ef)[_0xe00e('0x1b')](_0x39dd0d);}return null;};}function patchUpdates(_0xe1a1d8){return function(_0x3738ae){try{jsonpatch[_0xe00e('0x20')](_0x3738ae,_0xe1a1d8,!![]);}catch(_0x934248){return BPromise[_0xe00e('0x21')](_0x934248);}return _0x3738ae[_0xe00e('0x22')]();};}function saveUpdates(_0x4c5d76,_0xbcb531){return function(_0x3d4f0a){if(_0x3d4f0a){return _0x3d4f0a[_0xe00e('0x23')](_0x4c5d76)[_0xe00e('0x24')](function(_0x8f744f){return _0x8f744f;});}return null;};}function removeEntity(_0x21a508,_0x4be462){return function(_0x1ae367){if(_0x1ae367){return _0x1ae367['destroy']()[_0xe00e('0x24')](function(){var _0x1e87af=_0x1ae367[_0xe00e('0x25')]({'plain':!![]});var _0x4cc672=_0xe00e('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x4cc672,'resourceId':_0x1e87af['id']}})[_0xe00e('0x24')](function(){return _0x1ae367;});})[_0xe00e('0x24')](function(){_0x21a508[_0xe00e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57f262,_0x455610){return function(_0x3b1fb0){if(!_0x3b1fb0){_0x57f262[_0xe00e('0x18')](0x194);}return _0x3b1fb0;};}function handleError(_0x361ca9,_0x20a6df){_0x20a6df=_0x20a6df||0x1f4;return function(_0x3c16bb){logger[_0xe00e('0x27')](_0x3c16bb['stack']);if(_0x3c16bb[_0xe00e('0x28')]){delete _0x3c16bb[_0xe00e('0x28')];}_0x361ca9[_0xe00e('0x19')](_0x20a6df)[_0xe00e('0x29')](_0x3c16bb);};}exports['index']=function(_0x58d412,_0x2de4fb){var _0x38f3bc={},_0x577863={},_0x26e6eb={'count':0x0,'rows':[]};var _0xbbb227=_['map'](db[_0xe00e('0x2a')][_0xe00e('0x2b')],function(_0x5394d4){return{'name':_0x5394d4['fieldName'],'type':_0x5394d4[_0xe00e('0x2c')][_0xe00e('0x2d')]};});_0x577863[_0xe00e('0x2e')]=_[_0xe00e('0x2f')](_0xbbb227,_0xe00e('0x28'));_0x577863['query']=_[_0xe00e('0x30')](_0x58d412[_0xe00e('0x31')]);_0x577863[_0xe00e('0x32')]=_[_0xe00e('0x33')](_0x577863[_0xe00e('0x2e')],_0x577863[_0xe00e('0x31')]);_0x38f3bc['attributes']=_[_0xe00e('0x33')](_0x577863[_0xe00e('0x2e')],qs[_0xe00e('0x34')](_0x58d412[_0xe00e('0x31')][_0xe00e('0x34')]));_0x38f3bc[_0xe00e('0x35')]=_0x38f3bc[_0xe00e('0x35')][_0xe00e('0x36')]?_0x38f3bc[_0xe00e('0x35')]:_0x577863['model'];if(!_0x58d412[_0xe00e('0x31')][_0xe00e('0x37')](_0xe00e('0x38'))){_0x38f3bc[_0xe00e('0x1e')]=qs['limit'](_0x58d412[_0xe00e('0x31')][_0xe00e('0x1e')]);_0x38f3bc[_0xe00e('0x1d')]=qs[_0xe00e('0x1d')](_0x58d412[_0xe00e('0x31')]['offset']);}_0x38f3bc[_0xe00e('0x39')]=qs[_0xe00e('0x3a')](_0x58d412[_0xe00e('0x31')][_0xe00e('0x3a')]);_0x38f3bc[_0xe00e('0x3b')]=qs[_0xe00e('0x32')](_[_0xe00e('0x3c')](_0x58d412[_0xe00e('0x31')],_0x577863[_0xe00e('0x32')]));if(_0x58d412[_0xe00e('0x31')][_0xe00e('0x3d')]){_0x38f3bc['where']=_[_0xe00e('0x3e')](_0x38f3bc[_0xe00e('0x3b')],{'$or':_[_0xe00e('0x2f')](_0xbbb227,function(_0x1fe3e5){if(_0x1fe3e5[_0xe00e('0x2c')]!==_0xe00e('0x3f')){var _0x243828={};_0x243828[_0x1fe3e5['name']]={'$like':'%'+_0x58d412[_0xe00e('0x31')][_0xe00e('0x3d')]+'%'};return _0x243828;}})});}_0x38f3bc=_[_0xe00e('0x3e')]({},_0x38f3bc,_0x58d412[_0xe00e('0x40')]);var _0xf8d9b4={'where':_0x38f3bc['where']};return db[_0xe00e('0x2a')]['count'](_0xf8d9b4)[_0xe00e('0x24')](function(_0x202e0b){_0x26e6eb[_0xe00e('0x1c')]=_0x202e0b;if(_0x58d412[_0xe00e('0x31')][_0xe00e('0x41')]){_0x38f3bc[_0xe00e('0x42')]=[{'all':!![]}];}return db[_0xe00e('0x2a')][_0xe00e('0x43')](_0x38f3bc);})[_0xe00e('0x24')](function(_0x336561){_0x26e6eb[_0xe00e('0x44')]=_0x336561;return _0x26e6eb;})[_0xe00e('0x24')](respondWithFilteredResult(_0x2de4fb,_0x38f3bc))[_0xe00e('0x45')](handleError(_0x2de4fb,null));};exports['show']=function(_0x6a9e9f,_0x4d2182){var _0x50a153={'raw':![],'where':{'id':_0x6a9e9f[_0xe00e('0x46')]['id']}},_0x5ce7f7={};_0x5ce7f7[_0xe00e('0x2e')]=_[_0xe00e('0x30')](db['VoiceChanSpy'][_0xe00e('0x2b')]);_0x5ce7f7[_0xe00e('0x31')]=_[_0xe00e('0x30')](_0x6a9e9f[_0xe00e('0x31')]);_0x5ce7f7[_0xe00e('0x32')]=_[_0xe00e('0x33')](_0x5ce7f7[_0xe00e('0x2e')],_0x5ce7f7[_0xe00e('0x31')]);_0x50a153['attributes']=_[_0xe00e('0x33')](_0x5ce7f7[_0xe00e('0x2e')],qs[_0xe00e('0x34')](_0x6a9e9f[_0xe00e('0x31')][_0xe00e('0x34')]));_0x50a153[_0xe00e('0x35')]=_0x50a153[_0xe00e('0x35')]['length']?_0x50a153[_0xe00e('0x35')]:_0x5ce7f7[_0xe00e('0x2e')];if(_0x6a9e9f['query']['includeAll']){_0x50a153[_0xe00e('0x42')]=[{'all':!![]}];}_0x50a153=_[_0xe00e('0x3e')]({},_0x50a153,_0x6a9e9f[_0xe00e('0x40')]);return db[_0xe00e('0x2a')][_0xe00e('0x47')](_0x50a153)[_0xe00e('0x24')](handleEntityNotFound(_0x4d2182,null))['then'](respondWithResult(_0x4d2182,null))[_0xe00e('0x45')](handleError(_0x4d2182,null));};exports[_0xe00e('0x48')]=function(_0x11df3e,_0x5e8143){return db['VoiceChanSpy'][_0xe00e('0x48')](_0x11df3e[_0xe00e('0x49')],{})['then'](function(_0x27b71d){var _0x228db8=_0x11df3e['user'][_0xe00e('0x25')]({'plain':!![]});if(!_0x228db8)throw new Error(_0xe00e('0x4a'));if(_0x228db8[_0xe00e('0x4b')]===_0xe00e('0x4c')){var _0x5b4d8f=_0x27b71d[_0xe00e('0x25')]({'plain':!![]});var _0x5430d5='ChanSpies';return db['UserProfileSection'][_0xe00e('0x47')]({'where':{'name':_0x5430d5,'userProfileId':_0x228db8['userProfileId']},'raw':!![]})[_0xe00e('0x24')](function(_0x1f4611){if(_0x1f4611&&_0x1f4611['autoAssociation']===0x0){return db[_0xe00e('0x4d')][_0xe00e('0x48')]({'name':_0x5b4d8f[_0xe00e('0x28')],'resourceId':_0x5b4d8f['id'],'type':_0x1f4611[_0xe00e('0x28')],'sectionId':_0x1f4611['id']},{})[_0xe00e('0x24')](function(){return _0x27b71d;});}else{return _0x27b71d;}})[_0xe00e('0x45')](function(_0x6908ba){logger[_0xe00e('0x27')](_0xe00e('0x4e'),_0x6908ba);throw _0x6908ba;});}return _0x27b71d;})[_0xe00e('0x24')](respondWithResult(_0x5e8143,0xc9))[_0xe00e('0x45')](handleError(_0x5e8143,null));};exports['update']=function(_0x5b75ec,_0x491c52){if(_0x5b75ec[_0xe00e('0x49')]['id']){delete _0x5b75ec[_0xe00e('0x49')]['id'];}return db[_0xe00e('0x2a')]['find']({'where':{'id':_0x5b75ec[_0xe00e('0x46')]['id']}})[_0xe00e('0x24')](handleEntityNotFound(_0x491c52,null))['then'](saveUpdates(_0x5b75ec['body'],null))[_0xe00e('0x24')](respondWithResult(_0x491c52,null))[_0xe00e('0x45')](handleError(_0x491c52,null));};exports[_0xe00e('0x4f')]=function(_0x31eea9,_0xfc7c13){return db[_0xe00e('0x2a')][_0xe00e('0x47')]({'where':{'id':_0x31eea9[_0xe00e('0x46')]['id']}})[_0xe00e('0x24')](handleEntityNotFound(_0xfc7c13,null))['then'](removeEntity(_0xfc7c13,null))['catch'](handleError(_0xfc7c13,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 80554fd..58ff609 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 _0x9619=['merge','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','options','StopMixMonitor','length','internal','name','concat','User','findAll','agent','then','exports','models','define','VoiceChanSpy','VoiceExtension','bulkCreate','catch','destroy','util','bluebird','./voiceChanSpy.attributes','from-sip','format','%s%s','prefix','system','Set','CDR(type)=%s','push'];(function(_0x2a54ff,_0x501491){var _0x4b2d5b=function(_0x483fdd){while(--_0x483fdd){_0x2a54ff['push'](_0x2a54ff['shift']());}};_0x4b2d5b(++_0x501491);}(_0x9619,0xff));var _0x9961=function(_0x45d4e5,_0x5a6da4){_0x45d4e5=_0x45d4e5-0x0;var _0x42bef5=_0x9619[_0x45d4e5];return _0x42bef5;};'use strict';var _=require('lodash');var util=require(_0x9961('0x0'));var BPromise=require(_0x9961('0x1'));var attributes=require(_0x9961('0x2'));var getUserApplications=function(_0x4fbff3,_0x50d8cb,_0x4cbf0a){var _0x2f7363=0x1;var _0x1ad782=[];var _0x570e34={'context':_0x50d8cb['context']||_0x9961('0x3'),'exten':util[_0x9961('0x4')](_0x9961('0x5'),_0x4fbff3[_0x9961('0x6')],_0x4cbf0a),'type':_0x9961('0x7'),'isApp':![],'ChanSpyId':_0x4fbff3['id'],'UserId':_0x50d8cb['id']};_0x1ad782['push'](_['merge']({'app':_0x9961('0x8'),'appdata':util[_0x9961('0x4')](_0x9961('0x9'),'chanspy'),'priority':_0x2f7363++},_0x570e34));if(_0x4fbff3['record']){_0x1ad782[_0x9961('0xa')](_[_0x9961('0xb')]({'app':_0x9961('0xc'),'appdata':util[_0x9961('0x4')](_0x9961('0xd'),_0x4fbff3[_0x9961('0xe')]),'priority':_0x2f7363++},_0x570e34));}if(_0x4fbff3[_0x9961('0xf')]){_0x1ad782[_0x9961('0xa')](_[_0x9961('0xb')]({'app':_0x9961('0x10'),'appdata':_0x4fbff3[_0x9961('0x11')],'priority':_0x2f7363++},_0x570e34));}_0x1ad782[_0x9961('0xa')](_[_0x9961('0xb')]({'app':_0x9961('0x12'),'appdata':util[_0x9961('0x4')](_0x9961('0x13'),_0x50d8cb['name'],_0x4fbff3[_0x9961('0x14')]?_0x4fbff3[_0x9961('0x14')]['join'](''):''),'priority':_0x2f7363++},_0x570e34));if(_0x4fbff3['record']){_0x1ad782[_0x9961('0xa')](_[_0x9961('0xb')]({'app':_0x9961('0x15'),'priority':_0x2f7363++},_0x570e34));}return _0x1ad782;};var getChanSpyApplications=function(_0x1dea24,_0x3392cd){var _0x426df0=[];for(var _0x49aeea=0x0,_0x13a4c7=0x1;_0x49aeea<_0x3392cd[_0x9961('0x16')];_0x49aeea++,_0x13a4c7=0x1){_0x426df0=_0x426df0['concat'](getUserApplications(_0x1dea24,_0x3392cd[_0x49aeea],_0x3392cd[_0x49aeea]['internal']));if(_0x3392cd[_0x49aeea][_0x9961('0x17')]!=_0x3392cd[_0x49aeea][_0x9961('0x18')]){_0x426df0=_0x426df0[_0x9961('0x19')](getUserApplications(_0x1dea24,_0x3392cd[_0x49aeea],_0x3392cd[_0x49aeea]['name']));}}return _0x426df0;};var getChanSpyPromise=function(_0x25ff0f,_0x1e5e84){return new BPromise(function(_0x5972a2,_0x241f04){return _0x25ff0f[_0x9961('0x1a')][_0x9961('0x1b')]({'attributes':['id','name',_0x9961('0x17')],'where':{'role':_0x9961('0x1c'),'chanspy':!![]},'raw':!![]})[_0x9961('0x1d')](function(_0x40ef43){if(_0x40ef43){return _0x5972a2(getChanSpyApplications(_0x1e5e84,_0x40ef43));}return _0x5972a2([]);})['catch'](function(_0xa16dd1){_0x241f04(_0xa16dd1);});});};module[_0x9961('0x1e')]=function(_0x3b0ed6,_0x42dfed){var _0x4a8792=_0x3b0ed6[_0x9961('0x1f')];return _0x3b0ed6[_0x9961('0x20')](_0x9961('0x21'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x54c690,_0x14ac20,_0x53e082){return getChanSpyPromise(_0x4a8792,_0x54c690)[_0x9961('0x1d')](function(_0x842e4a){if(_0x842e4a&&_0x842e4a['length']){return _0x4a8792[_0x9961('0x22')][_0x9961('0x23')](_0x842e4a);}})[_0x9961('0x1d')](function(){_0x53e082();})[_0x9961('0x24')](function(_0x58741b){_0x53e082(_0x58741b);});},'afterUpdate':function(_0x1efaf8,_0x5d3b6d,_0x21c642){return _0x4a8792['VoiceExtension'][_0x9961('0x25')]({'where':{'ChanSpyId':_0x1efaf8['id']}})[_0x9961('0x1d')](function(){return getChanSpyPromise(_0x4a8792,_0x1efaf8);})[_0x9961('0x1d')](function(_0x1fb742){if(_0x1fb742&&_0x1fb742['length']){return _0x4a8792[_0x9961('0x22')][_0x9961('0x23')](_0x1fb742);}})[_0x9961('0x1d')](function(){_0x21c642();})[_0x9961('0x24')](function(_0x271900){_0x21c642(_0x271900);});},'afterDestroy':function(_0x19d76a,_0x2e1f5b,_0x239c0d){return _0x4a8792[_0x9961('0x22')][_0x9961('0x25')]({'where':{'ChanSpyId':_0x19d76a['id']}})[_0x9961('0x1d')](function(){_0x239c0d();})[_0x9961('0x24')](function(_0x286d04){_0x239c0d(_0x286d04);});}}});}; \ No newline at end of file +var _0xa3d6=['SIP/%s,%s','name','options','join','StopMixMonitor','concat','internal','User','findAll','agent','then','catch','define','VoiceExtension','bulkCreate','length','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','system','push','merge','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','auth','Authenticate','password'];(function(_0x348d0a,_0x5c77d2){var _0x4c9b=function(_0xbb4c43){while(--_0xbb4c43){_0x348d0a['push'](_0x348d0a['shift']());}};_0x4c9b(++_0x5c77d2);}(_0xa3d6,0x131));var _0x6a3d=function(_0x349f5d,_0x48b5ce){_0x349f5d=_0x349f5d-0x0;var _0x69e807=_0xa3d6[_0x349f5d];return _0x69e807;};'use strict';var _=require(_0x6a3d('0x0'));var util=require(_0x6a3d('0x1'));var BPromise=require(_0x6a3d('0x2'));var attributes=require(_0x6a3d('0x3'));var getUserApplications=function(_0x13ed86,_0x4a51d1,_0x57b839){var _0x5be34c=0x1;var _0x5d6724=[];var _0x54637d={'context':_0x4a51d1[_0x6a3d('0x4')]||_0x6a3d('0x5'),'exten':util[_0x6a3d('0x6')]('%s%s',_0x13ed86['prefix'],_0x57b839),'type':_0x6a3d('0x7'),'isApp':![],'ChanSpyId':_0x13ed86['id'],'UserId':_0x4a51d1['id']};_0x5d6724[_0x6a3d('0x8')](_[_0x6a3d('0x9')]({'app':'Set','appdata':util[_0x6a3d('0x6')](_0x6a3d('0xa'),_0x6a3d('0xb')),'priority':_0x5be34c++},_0x54637d));if(_0x13ed86[_0x6a3d('0xc')]){_0x5d6724[_0x6a3d('0x8')](_[_0x6a3d('0x9')]({'app':_0x6a3d('0xd'),'appdata':util['format'](_0x6a3d('0xe'),_0x13ed86[_0x6a3d('0xf')]),'priority':_0x5be34c++},_0x54637d));}if(_0x13ed86[_0x6a3d('0x10')]){_0x5d6724[_0x6a3d('0x8')](_['merge']({'app':_0x6a3d('0x11'),'appdata':_0x13ed86[_0x6a3d('0x12')],'priority':_0x5be34c++},_0x54637d));}_0x5d6724['push'](_[_0x6a3d('0x9')]({'app':'ChanSpy','appdata':util[_0x6a3d('0x6')](_0x6a3d('0x13'),_0x4a51d1[_0x6a3d('0x14')],_0x13ed86['options']?_0x13ed86[_0x6a3d('0x15')][_0x6a3d('0x16')](''):''),'priority':_0x5be34c++},_0x54637d));if(_0x13ed86[_0x6a3d('0xc')]){_0x5d6724[_0x6a3d('0x8')](_[_0x6a3d('0x9')]({'app':_0x6a3d('0x17'),'priority':_0x5be34c++},_0x54637d));}return _0x5d6724;};var getChanSpyApplications=function(_0x47bb49,_0x5bdd05){var _0x4b4b47=[];for(var _0x3e1bbd=0x0,_0x4f4ee1=0x1;_0x3e1bbd<_0x5bdd05['length'];_0x3e1bbd++,_0x4f4ee1=0x1){_0x4b4b47=_0x4b4b47[_0x6a3d('0x18')](getUserApplications(_0x47bb49,_0x5bdd05[_0x3e1bbd],_0x5bdd05[_0x3e1bbd][_0x6a3d('0x19')]));if(_0x5bdd05[_0x3e1bbd]['internal']!=_0x5bdd05[_0x3e1bbd][_0x6a3d('0x14')]){_0x4b4b47=_0x4b4b47[_0x6a3d('0x18')](getUserApplications(_0x47bb49,_0x5bdd05[_0x3e1bbd],_0x5bdd05[_0x3e1bbd]['name']));}}return _0x4b4b47;};var getChanSpyPromise=function(_0x6107f2,_0x350f3e){return new BPromise(function(_0x328ca6,_0x414b70){return _0x6107f2[_0x6a3d('0x1a')][_0x6a3d('0x1b')]({'attributes':['id','name',_0x6a3d('0x19')],'where':{'role':_0x6a3d('0x1c'),'chanspy':!![]},'raw':!![]})[_0x6a3d('0x1d')](function(_0x2b28a0){if(_0x2b28a0){return _0x328ca6(getChanSpyApplications(_0x350f3e,_0x2b28a0));}return _0x328ca6([]);})[_0x6a3d('0x1e')](function(_0x44355f){_0x414b70(_0x44355f);});});};module['exports']=function(_0x233b65,_0x47127a){var _0x4e7ef6=_0x233b65['models'];return _0x233b65[_0x6a3d('0x1f')]('VoiceChanSpy',attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x575acd,_0xba24e,_0x6e1d85){return getChanSpyPromise(_0x4e7ef6,_0x575acd)[_0x6a3d('0x1d')](function(_0x4df764){if(_0x4df764&&_0x4df764['length']){return _0x4e7ef6[_0x6a3d('0x20')][_0x6a3d('0x21')](_0x4df764);}})[_0x6a3d('0x1d')](function(){_0x6e1d85();})[_0x6a3d('0x1e')](function(_0x4c7ffe){_0x6e1d85(_0x4c7ffe);});},'afterUpdate':function(_0x3e42c4,_0x22dd36,_0xec7d08){return _0x4e7ef6[_0x6a3d('0x20')]['destroy']({'where':{'ChanSpyId':_0x3e42c4['id']}})[_0x6a3d('0x1d')](function(){return getChanSpyPromise(_0x4e7ef6,_0x3e42c4);})[_0x6a3d('0x1d')](function(_0x1b4cd7){if(_0x1b4cd7&&_0x1b4cd7[_0x6a3d('0x22')]){return _0x4e7ef6[_0x6a3d('0x20')][_0x6a3d('0x21')](_0x1b4cd7);}})[_0x6a3d('0x1d')](function(){_0xec7d08();})['catch'](function(_0x3fc5e8){_0xec7d08(_0x3fc5e8);});},'afterDestroy':function(_0x5b7744,_0x5e8f31,_0x588a2b){return _0x4e7ef6[_0x6a3d('0x20')][_0x6a3d('0x23')]({'where':{'ChanSpyId':_0x5b7744['id']}})[_0x6a3d('0x1d')](function(){_0x588a2b();})[_0x6a3d('0x1e')](function(_0x3df963){_0x588a2b(_0x3df963);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 27e347f..3c6a91c 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 _0xaa45=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xaa45,0xef));var _0x5aa4=function(_0x29e3b6,_0x40b0b4){_0x29e3b6=_0x29e3b6-0x0;var _0x55d4b0=_0xaa45[_0x29e3b6];return _0x55d4b0;};'use strict';var _=require(_0x5aa4('0x0'));var util=require(_0x5aa4('0x1'));var moment=require(_0x5aa4('0x2'));var BPromise=require(_0x5aa4('0x3'));var rs=require(_0x5aa4('0x4'));var fs=require('fs');var Redis=require(_0x5aa4('0x5'));var db=require(_0x5aa4('0x6'))['db'];var utils=require(_0x5aa4('0x7'));var logger=require(_0x5aa4('0x8'))(_0x5aa4('0x9'));var config=require(_0x5aa4('0xa'));var jayson=require(_0x5aa4('0xb'));var client=jayson[_0x5aa4('0xc')][_0x5aa4('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3dfe03,_0x1b1265,_0x21f851){return new BPromise(function(_0x39438c,_0x36ca61){return client[_0x5aa4('0xe')](_0x3dfe03,_0x21f851)['then'](function(_0x4f5695){logger[_0x5aa4('0xf')](_0x5aa4('0x10'),_0x1b1265,_0x5aa4('0x11'));logger['debug']('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x1b1265,_0x5aa4('0x11'),JSON[_0x5aa4('0x12')](_0x4f5695));if(_0x4f5695[_0x5aa4('0x13')]){if(_0x4f5695[_0x5aa4('0x13')][_0x5aa4('0x14')]===0x1f4){logger[_0x5aa4('0x13')](_0x5aa4('0x10'),_0x1b1265,_0x4f5695[_0x5aa4('0x13')][_0x5aa4('0x15')]);return _0x36ca61(_0x4f5695['error']['message']);}logger[_0x5aa4('0x13')](_0x5aa4('0x10'),_0x1b1265,_0x4f5695[_0x5aa4('0x13')][_0x5aa4('0x15')]);return _0x39438c(_0x4f5695[_0x5aa4('0x13')]['message']);}else{logger[_0x5aa4('0xf')](_0x5aa4('0x10'),_0x1b1265,_0x5aa4('0x11'));_0x39438c(_0x4f5695[_0x5aa4('0x16')][_0x5aa4('0x15')]);}})[_0x5aa4('0x17')](function(_0x99004c){logger['error'](_0x5aa4('0x10'),_0x1b1265,_0x99004c);_0x36ca61(_0x99004c);});});} \ No newline at end of file +var _0xc90c=['../../config/utils','../../config/logger','../../config/environment','http','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','error','message','result','lodash','util','randomstring','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc90c,0xec));var _0xcc90=function(_0x10b2e8,_0x2504db){_0x10b2e8=_0x10b2e8-0x0;var _0x3c8aa3=_0xc90c[_0x10b2e8];return _0x3c8aa3;};'use strict';var _=require(_0xcc90('0x0'));var util=require(_0xcc90('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcc90('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc90('0x3'))['db'];var utils=require(_0xcc90('0x4'));var logger=require(_0xcc90('0x5'))('rpc');var config=require(_0xcc90('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcc90('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ef5d4,_0x360a76,_0x23dbc3){return new BPromise(function(_0x1d9836,_0x5803a9){return client[_0xcc90('0x8')](_0x2ef5d4,_0x23dbc3)['then'](function(_0x4e6c57){logger[_0xcc90('0x9')](_0xcc90('0xa'),_0x360a76,_0xcc90('0xb'));logger[_0xcc90('0xc')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x360a76,_0xcc90('0xb'),JSON['stringify'](_0x4e6c57));if(_0x4e6c57[_0xcc90('0xd')]){if(_0x4e6c57[_0xcc90('0xd')]['code']===0x1f4){logger[_0xcc90('0xd')](_0xcc90('0xa'),_0x360a76,_0x4e6c57[_0xcc90('0xd')][_0xcc90('0xe')]);return _0x5803a9(_0x4e6c57[_0xcc90('0xd')][_0xcc90('0xe')]);}logger[_0xcc90('0xd')](_0xcc90('0xa'),_0x360a76,_0x4e6c57[_0xcc90('0xd')][_0xcc90('0xe')]);return _0x1d9836(_0x4e6c57[_0xcc90('0xd')][_0xcc90('0xe')]);}else{logger['info'](_0xcc90('0xa'),_0x360a76,'request\x20sent');_0x1d9836(_0x4e6c57[_0xcc90('0xf')]['message']);}})['catch'](function(_0x1c1c82){logger[_0xcc90('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x360a76,_0x1c1c82);_0x5803a9(_0x1c1c82);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 91f35ac..a2f6a3e 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 _0xc15f=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceContext.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','destroy'];(function(_0x5d3903,_0x3d6c3e){var _0x4b8bc9=function(_0x92b297){while(--_0x92b297){_0x5d3903['push'](_0x5d3903['shift']());}};_0x4b8bc9(++_0x3d6c3e);}(_0xc15f,0x18d));var _0xfc15=function(_0x25a42a,_0x3d489b){_0x25a42a=_0x25a42a-0x0;var _0x1129b1=_0xc15f[_0x25a42a];return _0x1129b1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfc15('0x0'));var timeout=require(_0xfc15('0x1'));var express=require(_0xfc15('0x2'));var router=express[_0xfc15('0x3')]();var auth=require(_0xfc15('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfc15('0x5'));var controller=require(_0xfc15('0x6'));router['get']('/',auth[_0xfc15('0x7')](),controller[_0xfc15('0x8')]);router[_0xfc15('0x9')](_0xfc15('0xa'),auth[_0xfc15('0x7')](),controller[_0xfc15('0xb')]);router[_0xfc15('0xc')]('/',auth[_0xfc15('0x7')](),controller[_0xfc15('0xd')]);router[_0xfc15('0xe')]('/:id',auth[_0xfc15('0x7')](),controller[_0xfc15('0xf')]);router['delete'](_0xfc15('0xa'),auth[_0xfc15('0x7')](),controller[_0xfc15('0x10')]);module[_0xfc15('0x11')]=router; \ No newline at end of file +var _0xcd35=['destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete'];(function(_0x4a5f8b,_0xcb0c57){var _0x21b14b=function(_0x1b1ef5){while(--_0x1b1ef5){_0x4a5f8b['push'](_0x4a5f8b['shift']());}};_0x21b14b(++_0xcb0c57);}(_0xcd35,0x191));var _0x5cd3=function(_0x14e174,_0x1f0437){_0x14e174=_0x14e174-0x0;var _0x187d78=_0xcd35[_0x14e174];return _0x187d78;};'use strict';var multer=require(_0x5cd3('0x0'));var util=require(_0x5cd3('0x1'));var path=require(_0x5cd3('0x2'));var timeout=require(_0x5cd3('0x3'));var express=require(_0x5cd3('0x4'));var router=express['Router']();var auth=require(_0x5cd3('0x5'));var interaction=require(_0x5cd3('0x6'));var config=require(_0x5cd3('0x7'));var controller=require(_0x5cd3('0x8'));router[_0x5cd3('0x9')]('/',auth['isAuthenticated'](),controller[_0x5cd3('0xa')]);router[_0x5cd3('0x9')](_0x5cd3('0xb'),auth[_0x5cd3('0xc')](),controller[_0x5cd3('0xd')]);router[_0x5cd3('0xe')]('/',auth[_0x5cd3('0xc')](),controller[_0x5cd3('0xf')]);router[_0x5cd3('0x10')]('/:id',auth[_0x5cd3('0xc')](),controller[_0x5cd3('0x11')]);router[_0x5cd3('0x12')](_0x5cd3('0xb'),auth[_0x5cd3('0xc')](),controller[_0x5cd3('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 9e7fe7e..a621853 100644 --- a/server/api/voiceContext/voiceContext.attributes.js +++ b/server/api/voiceContext/voiceContext.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['exports','STRING','BOOLEAN','sequelize'];(function(_0x3ef4a8,_0x1702ed){var _0x23b6cf=function(_0x21c439){while(--_0x21c439){_0x3ef4a8['push'](_0x3ef4a8['shift']());}};_0x23b6cf(++_0x1702ed);}(_0xe14b,0x93));var _0xbe14=function(_0x16dbe,_0x98dfaa){_0x16dbe=_0x16dbe-0x0;var _0x525c03=_0xe14b[_0x16dbe];return _0x525c03;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xbe14('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xbe14('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x34e8=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x46fe78,_0x5786fd){var _0x1069d1=function(_0xad6eed){while(--_0xad6eed){_0x46fe78['push'](_0x46fe78['shift']());}};_0x1069d1(++_0x5786fd);}(_0x34e8,0x12c));var _0x834e=function(_0x562734,_0x2dce0c){_0x562734=_0x562734-0x0;var _0x3cac32=_0x34e8[_0x562734];return _0x3cac32;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')],'unique':_0x834e('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x834e('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index fc5cc70..5276335 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 _0xe9a4=['join','root','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','utf8','chan_sip.so','server/files/templates/context.ejs','render','html-pdf','rimraf','fast-json-patch','moment','mustache','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','get','Contexts','destroy','stack','name','send','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','VoiceContext','includeAll','include','rows','show','params','length','find','create','body','readFileSync'];(function(_0x422c5d,_0x395613){var _0x2c580e=function(_0xae60f6){while(--_0xae60f6){_0x422c5d['push'](_0x422c5d['shift']());}};_0x2c580e(++_0x395613);}(_0xe9a4,0x1c1));var _0x4e9a=function(_0x196ce1,_0x46e836){_0x196ce1=_0x196ce1-0x0;var _0x360a64=_0xe9a4[_0x196ce1];return _0x360a64;};'use strict';var pdf=require(_0x4e9a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4e9a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4e9a('0x2'));var rp=require('request-promise');var moment=require(_0x4e9a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4e9a('0x4'));var util=require('util');var path=require(_0x4e9a('0x5'));var sox=require('sox');var csv=require(_0x4e9a('0x6'));var ejs=require(_0x4e9a('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4e9a('0x8'));var crypto=require(_0x4e9a('0x9'));var jsforce=require(_0x4e9a('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4e9a('0x6'));var querystring=require(_0x4e9a('0xb'));var Papa=require(_0x4e9a('0xc'));var Redis=require(_0x4e9a('0xd'));var authService=require(_0x4e9a('0xe'));var qs=require(_0x4e9a('0xf'));var as=require(_0x4e9a('0x10'));var hardwareService=require(_0x4e9a('0x11'));var logger=require(_0x4e9a('0x12'))(_0x4e9a('0x13'));var utils=require('../../config/utils');var config=require(_0x4e9a('0x14'));var db=require(_0x4e9a('0x15'))['db'];var jayson=require(_0x4e9a('0x16'));var client=jayson[_0x4e9a('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x23a4cf,_0x296645,_0x2a63a7){if(_0x2a63a7){var _0x5b7891=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5b7891[_0x4e9a('0x18')](_0x296645)){return _0x23a4cf;}else{throw new db[(_0x4e9a('0x19'))][(_0x4e9a('0x1a'))](_0x4e9a('0x1b'));}}else{return _0x23a4cf;}}function respondWithRpcPromise(_0x13109a,_0xda021b,_0x398a12,_0x2e73f4){return new BPromise(function(_0xdca440,_0x105ae1){var _0x299870=_0x2e73f4||client;return _0x299870['request'](_0x13109a,_0x398a12)[_0x4e9a('0x1c')](function(_0x90ec62){logger[_0x4e9a('0x1d')](_0x4e9a('0x1e'),_0xda021b,_0x4e9a('0x1f'));logger[_0x4e9a('0x20')](_0x4e9a('0x21'),_0xda021b,_0x4e9a('0x1f'),JSON[_0x4e9a('0x22')](_0x90ec62));if(_0x90ec62[_0x4e9a('0x23')]){if(_0x90ec62[_0x4e9a('0x23')]['code']===0x1f4){logger['error'](_0x4e9a('0x1e'),_0xda021b,_0x90ec62[_0x4e9a('0x23')]['message']);return _0x105ae1(_0x90ec62[_0x4e9a('0x23')][_0x4e9a('0x24')]);}logger[_0x4e9a('0x23')]('VoiceContext,\x20%s,\x20%s',_0xda021b,_0x90ec62['error'][_0x4e9a('0x24')]);return _0xdca440(_0x90ec62[_0x4e9a('0x23')]['message']);}else{logger[_0x4e9a('0x1d')](_0x4e9a('0x1e'),_0xda021b,_0x4e9a('0x1f'));_0xdca440(_0x90ec62[_0x4e9a('0x25')][_0x4e9a('0x24')]);}})[_0x4e9a('0x26')](function(_0xa3305b){logger['error'](_0x4e9a('0x1e'),_0xda021b,_0xa3305b);_0x105ae1(_0xa3305b);});});}function respondWithStatusCode(_0x8fbc8b,_0x53b2a2){_0x53b2a2=_0x53b2a2||0xcc;return function(_0x29f61d){if(_0x29f61d){return _0x8fbc8b[_0x4e9a('0x27')](_0x53b2a2);}return _0x8fbc8b['status'](_0x53b2a2)[_0x4e9a('0x28')]();};}function respondWithResult(_0x463953,_0x3fb34){_0x3fb34=_0x3fb34||0xc8;return function(_0x56837b){if(_0x56837b){return _0x463953[_0x4e9a('0x29')](_0x3fb34)[_0x4e9a('0x2a')](_0x56837b);}};}function respondWithFilteredResult(_0x275ab9,_0x32b9d4){return function(_0x397716){if(_0x397716){var _0x2610d5=_0x397716[_0x4e9a('0x2b')],_0x5b2f1c=_0x32b9d4[_0x4e9a('0x2c')],_0x463101=_0x32b9d4[_0x4e9a('0x2c')]+_0x32b9d4['limit'],_0x53c347;if(_0x463101>=_0x2610d5){_0x463101=_0x2610d5;_0x53c347=0xc8;}else{_0x53c347=0xce;}_0x275ab9['status'](_0x53c347);return _0x275ab9[_0x4e9a('0x2d')](_0x4e9a('0x2e'),_0x5b2f1c+'-'+_0x463101+'/'+_0x2610d5)[_0x4e9a('0x2a')](_0x397716);}return null;};}function patchUpdates(_0x4b51c2){return function(_0x11d03b){try{jsonpatch[_0x4e9a('0x2f')](_0x11d03b,_0x4b51c2,!![]);}catch(_0x191a06){return BPromise[_0x4e9a('0x30')](_0x191a06);}return _0x11d03b[_0x4e9a('0x31')]();};}function saveUpdates(_0x56f82d,_0x11c9dc){return function(_0x29b997){if(_0x29b997){return _0x29b997[_0x4e9a('0x32')](_0x56f82d)[_0x4e9a('0x1c')](function(_0x309d44){return _0x309d44;});}return null;};}function removeEntity(_0x249ad8,_0x426550){return function(_0x32a1cc){if(_0x32a1cc){return _0x32a1cc['destroy']()[_0x4e9a('0x1c')](function(){var _0x518b21=_0x32a1cc[_0x4e9a('0x33')]({'plain':!![]});var _0x2ab52a=_0x4e9a('0x34');return db['UserProfileResource'][_0x4e9a('0x35')]({'where':{'type':_0x2ab52a,'resourceId':_0x518b21['id']}})[_0x4e9a('0x1c')](function(){return _0x32a1cc;});})[_0x4e9a('0x1c')](function(){_0x249ad8[_0x4e9a('0x29')](0xcc)[_0x4e9a('0x28')]();});}};}function handleEntityNotFound(_0x324d51,_0x319a29){return function(_0x39da88){if(!_0x39da88){_0x324d51[_0x4e9a('0x27')](0x194);}return _0x39da88;};}function handleError(_0x1d1366,_0x199171){_0x199171=_0x199171||0x1f4;return function(_0x6f83e3){logger[_0x4e9a('0x23')](_0x6f83e3[_0x4e9a('0x36')]);if(_0x6f83e3[_0x4e9a('0x37')]){delete _0x6f83e3[_0x4e9a('0x37')];}_0x1d1366['status'](_0x199171)[_0x4e9a('0x38')](_0x6f83e3);};}exports[_0x4e9a('0x39')]=function(_0x335bfa,_0x1fac1c){var _0x8d85dd={},_0x3cada5={},_0x27ecbd={'count':0x0,'rows':[]};var _0x3aecb3=_[_0x4e9a('0x3a')](db['VoiceContext'][_0x4e9a('0x3b')],function(_0x7c1517){return{'name':_0x7c1517['fieldName'],'type':_0x7c1517[_0x4e9a('0x3c')][_0x4e9a('0x3d')]};});_0x3cada5[_0x4e9a('0x3e')]=_[_0x4e9a('0x3a')](_0x3aecb3,_0x4e9a('0x37'));_0x3cada5['query']=_[_0x4e9a('0x3f')](_0x335bfa[_0x4e9a('0x40')]);_0x3cada5[_0x4e9a('0x41')]=_[_0x4e9a('0x42')](_0x3cada5['model'],_0x3cada5[_0x4e9a('0x40')]);_0x8d85dd[_0x4e9a('0x43')]=_[_0x4e9a('0x42')](_0x3cada5['model'],qs[_0x4e9a('0x44')](_0x335bfa[_0x4e9a('0x40')]['fields']));_0x8d85dd[_0x4e9a('0x43')]=_0x8d85dd[_0x4e9a('0x43')]['length']?_0x8d85dd[_0x4e9a('0x43')]:_0x3cada5[_0x4e9a('0x3e')];if(!_0x335bfa[_0x4e9a('0x40')][_0x4e9a('0x45')](_0x4e9a('0x46'))){_0x8d85dd[_0x4e9a('0x47')]=qs[_0x4e9a('0x47')](_0x335bfa[_0x4e9a('0x40')][_0x4e9a('0x47')]);_0x8d85dd['offset']=qs['offset'](_0x335bfa['query']['offset']);}_0x8d85dd[_0x4e9a('0x48')]=qs[_0x4e9a('0x49')](_0x335bfa['query'][_0x4e9a('0x49')]);_0x8d85dd['where']=qs[_0x4e9a('0x41')](_[_0x4e9a('0x4a')](_0x335bfa['query'],_0x3cada5['filters']));if(_0x335bfa['query'][_0x4e9a('0x4b')]){_0x8d85dd[_0x4e9a('0x4c')]=_['merge'](_0x8d85dd[_0x4e9a('0x4c')],{'$or':_[_0x4e9a('0x3a')](_0x3aecb3,function(_0x4f848c){if(_0x4f848c[_0x4e9a('0x3c')]!==_0x4e9a('0x4d')){var _0x3af39c={};_0x3af39c[_0x4f848c[_0x4e9a('0x37')]]={'$like':'%'+_0x335bfa[_0x4e9a('0x40')][_0x4e9a('0x4b')]+'%'};return _0x3af39c;}})});}_0x8d85dd=_[_0x4e9a('0x4e')]({},_0x8d85dd,_0x335bfa[_0x4e9a('0x4f')]);var _0x2399a8={'where':_0x8d85dd['where']};return db[_0x4e9a('0x50')][_0x4e9a('0x2b')](_0x2399a8)[_0x4e9a('0x1c')](function(_0x1d4192){_0x27ecbd[_0x4e9a('0x2b')]=_0x1d4192;if(_0x335bfa[_0x4e9a('0x40')][_0x4e9a('0x51')]){_0x8d85dd[_0x4e9a('0x52')]=[{'all':!![]}];}return db[_0x4e9a('0x50')]['findAll'](_0x8d85dd);})[_0x4e9a('0x1c')](function(_0x3b99ab){_0x27ecbd[_0x4e9a('0x53')]=_0x3b99ab;return _0x27ecbd;})['then'](respondWithFilteredResult(_0x1fac1c,_0x8d85dd))['catch'](handleError(_0x1fac1c,null));};exports[_0x4e9a('0x54')]=function(_0x28ef98,_0x3fdcf1){var _0x306c5c={'raw':![],'where':{'id':_0x28ef98[_0x4e9a('0x55')]['id']}},_0x1521d7={};_0x1521d7[_0x4e9a('0x3e')]=_[_0x4e9a('0x3f')](db['VoiceContext'][_0x4e9a('0x3b')]);_0x1521d7['query']=_[_0x4e9a('0x3f')](_0x28ef98[_0x4e9a('0x40')]);_0x1521d7[_0x4e9a('0x41')]=_[_0x4e9a('0x42')](_0x1521d7[_0x4e9a('0x3e')],_0x1521d7[_0x4e9a('0x40')]);_0x306c5c[_0x4e9a('0x43')]=_[_0x4e9a('0x42')](_0x1521d7[_0x4e9a('0x3e')],qs[_0x4e9a('0x44')](_0x28ef98[_0x4e9a('0x40')][_0x4e9a('0x44')]));_0x306c5c[_0x4e9a('0x43')]=_0x306c5c['attributes'][_0x4e9a('0x56')]?_0x306c5c[_0x4e9a('0x43')]:_0x1521d7[_0x4e9a('0x3e')];if(_0x28ef98[_0x4e9a('0x40')][_0x4e9a('0x51')]){_0x306c5c[_0x4e9a('0x52')]=[{'all':!![]}];}_0x306c5c=_[_0x4e9a('0x4e')]({},_0x306c5c,_0x28ef98[_0x4e9a('0x4f')]);return db['VoiceContext'][_0x4e9a('0x57')](_0x306c5c)[_0x4e9a('0x1c')](handleEntityNotFound(_0x3fdcf1,null))[_0x4e9a('0x1c')](respondWithResult(_0x3fdcf1,null))[_0x4e9a('0x26')](handleError(_0x3fdcf1,null));};exports[_0x4e9a('0x58')]=function(_0x181df8,_0x43d7bd,_0x223713){var _0xc2d672;return db['VoiceContext']['create'](_0x181df8[_0x4e9a('0x59')],{'raw':!![]})[_0x4e9a('0x1c')](function(_0x1da803){_0xc2d672=_0x1da803;return db['VoiceContext']['findAll']({'raw':!![]});})[_0x4e9a('0x1c')](function(_0x5ef872){var _0x178197=fs[_0x4e9a('0x5a')](path[_0x4e9a('0x5b')](config[_0x4e9a('0x5c')],'server/files/templates/context.ejs'),'utf8');var _0x260e0b=ejs['render'](_0x178197,{'contexts':_0x5ef872||[]});fs[_0x4e9a('0x5d')](_0x4e9a('0x5e'),_0x260e0b);})[_0x4e9a('0x1c')](function(){return respondWithRpcPromise(_0x4e9a('0x5f'),_0x4e9a('0x58'),{'module':'chan_sip.so'});})['then'](function(){var _0x1c8ef1=_0x181df8[_0x4e9a('0x60')]['get']({'plain':!![]});if(!_0x1c8ef1)throw new Error(_0x4e9a('0x61'));if(_0x1c8ef1[_0x4e9a('0x62')]===_0x4e9a('0x60')){var _0x402ea5=_0xc2d672[_0x4e9a('0x33')]({'plain':!![]});return db[_0x4e9a('0x63')][_0x4e9a('0x57')]({'where':{'name':_0x4e9a('0x34'),'userProfileId':_0x1c8ef1[_0x4e9a('0x64')]},'raw':!![]})['then'](function(_0x19213b){if(_0x19213b&&_0x19213b[_0x4e9a('0x65')]===0x0){return db['UserProfileResource']['create']({'name':_0x402ea5[_0x4e9a('0x37')],'resourceId':_0x402ea5['id'],'type':_0x19213b[_0x4e9a('0x37')],'sectionId':_0x19213b['id']},{})[_0x4e9a('0x1c')](function(){return _0xc2d672;});}else{return _0xc2d672;}})[_0x4e9a('0x26')](function(_0x40274d){logger['error'](_0x4e9a('0x66'),_0x40274d);throw _0x40274d;});}return _0xc2d672;})[_0x4e9a('0x1c')](respondWithResult(_0x43d7bd,0xc9))['catch'](handleError(_0x43d7bd,null));};exports[_0x4e9a('0x32')]=function(_0x2aa33f,_0xbd8c49,_0x4f2ff5){var _0x5e2a65;return db[_0x4e9a('0x50')][_0x4e9a('0x57')]({'where':{'id':_0x2aa33f['params']['id']}})['then'](handleEntityNotFound(_0xbd8c49,null))[_0x4e9a('0x1c')](saveUpdates(_0x2aa33f['body'],null))[_0x4e9a('0x1c')](function(_0xc7d42d){if(_0xc7d42d){_0x5e2a65=_0xc7d42d;return db[_0x4e9a('0x50')][_0x4e9a('0x67')]({'raw':!![]});}})[_0x4e9a('0x1c')](function(_0x455d7f){var _0x3dd9c0=fs['readFileSync'](path[_0x4e9a('0x5b')](config['root'],'server/files/templates/context.ejs'),_0x4e9a('0x68'));var _0x2b1f0b=ejs['render'](_0x3dd9c0,{'contexts':_0x455d7f||[]});fs[_0x4e9a('0x5d')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x2b1f0b);})[_0x4e9a('0x1c')](function(){return respondWithRpcPromise('Reload','update',{'module':_0x4e9a('0x69')});})['then'](function(){return _0x5e2a65;})[_0x4e9a('0x1c')](respondWithResult(_0xbd8c49,null))[_0x4e9a('0x26')](handleError(_0xbd8c49,null));};exports[_0x4e9a('0x35')]=function(_0x4e3ff4,_0x7b929e,_0x164a45){var _0x51aff0;return db[_0x4e9a('0x50')][_0x4e9a('0x57')]({'where':{'id':_0x4e3ff4[_0x4e9a('0x55')]['id']}})[_0x4e9a('0x1c')](handleEntityNotFound(_0x7b929e,null))[_0x4e9a('0x1c')](removeEntity(_0x7b929e,null))[_0x4e9a('0x1c')](function(){return db[_0x4e9a('0x50')][_0x4e9a('0x67')]({'raw':!![]});})[_0x4e9a('0x1c')](function(_0x426ec0){var _0x5a9536=fs[_0x4e9a('0x5a')](path['join'](config[_0x4e9a('0x5c')],_0x4e9a('0x6a')),_0x4e9a('0x68'));var _0x5c5707=ejs[_0x4e9a('0x6b')](_0x5a9536,{'contexts':_0x426ec0});fs['writeFileSync'](_0x4e9a('0x5e'),_0x5c5707);return respondWithRpcPromise(_0x4e9a('0x5f'),_0x4e9a('0x35'),{'module':'chan_sip.so'});})['catch'](handleError(_0x7b929e,null));}; \ No newline at end of file +var _0xd33a=['stringify','error','message','result','catch','sendStatus','status','end','json','offset','Content-Range','apply','reject','update','then','Contexts','UserProfileResource','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','VoiceContext','count','includeAll','include','findAll','show','params','find','create','body','readFileSync','join','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Reload','root','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','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','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','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s'];(function(_0x7b8a87,_0x2f2523){var _0x2131a1=function(_0x856847){while(--_0x856847){_0x7b8a87['push'](_0x7b8a87['shift']());}};_0x2131a1(++_0x2f2523);}(_0xd33a,0x11f));var _0xad33=function(_0x49d533,_0xf3a407){_0x49d533=_0x49d533-0x0;var _0x2a1358=_0xd33a[_0x49d533];return _0x2a1358;};'use strict';var pdf=require(_0xad33('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xad33('0x1'));var zipdir=require(_0xad33('0x2'));var jsonpatch=require(_0xad33('0x3'));var rp=require(_0xad33('0x4'));var moment=require(_0xad33('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xad33('0x6'));var util=require(_0xad33('0x7'));var path=require(_0xad33('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xad33('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xad33('0xa'));var jsforce=require(_0xad33('0xb'));var deskjs=require(_0xad33('0xc'));var toCsv=require('to-csv');var querystring=require(_0xad33('0xd'));var Papa=require(_0xad33('0xe'));var Redis=require('ioredis');var authService=require(_0xad33('0xf'));var qs=require(_0xad33('0x10'));var as=require(_0xad33('0x11'));var hardwareService=require(_0xad33('0x12'));var logger=require(_0xad33('0x13'))(_0xad33('0x14'));var utils=require(_0xad33('0x15'));var config=require(_0xad33('0x16'));var db=require(_0xad33('0x17'))['db'];var jayson=require(_0xad33('0x18'));var client=jayson[_0xad33('0x19')][_0xad33('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x5cd43c,_0x20a14b,_0x4305c8){if(_0x4305c8){var _0x138a4e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x138a4e[_0xad33('0x1b')](_0x20a14b)){return _0x5cd43c;}else{throw new db[(_0xad33('0x1c'))][(_0xad33('0x1d'))](_0xad33('0x1e'));}}else{return _0x5cd43c;}}function respondWithRpcPromise(_0x54529a,_0x19acd3,_0x37a870,_0x29f2c9){return new BPromise(function(_0x50603d,_0x3d2a3c){var _0x5127ff=_0x29f2c9||client;return _0x5127ff[_0xad33('0x1f')](_0x54529a,_0x37a870)['then'](function(_0x3a880c){logger[_0xad33('0x20')](_0xad33('0x21'),_0x19acd3,_0xad33('0x22'));logger[_0xad33('0x23')](_0xad33('0x24'),_0x19acd3,_0xad33('0x22'),JSON[_0xad33('0x25')](_0x3a880c));if(_0x3a880c[_0xad33('0x26')]){if(_0x3a880c[_0xad33('0x26')]['code']===0x1f4){logger[_0xad33('0x26')]('VoiceContext,\x20%s,\x20%s',_0x19acd3,_0x3a880c[_0xad33('0x26')][_0xad33('0x27')]);return _0x3d2a3c(_0x3a880c[_0xad33('0x26')][_0xad33('0x27')]);}logger[_0xad33('0x26')](_0xad33('0x21'),_0x19acd3,_0x3a880c[_0xad33('0x26')][_0xad33('0x27')]);return _0x50603d(_0x3a880c['error'][_0xad33('0x27')]);}else{logger[_0xad33('0x20')](_0xad33('0x21'),_0x19acd3,'request\x20sent');_0x50603d(_0x3a880c[_0xad33('0x28')][_0xad33('0x27')]);}})[_0xad33('0x29')](function(_0x2100a9){logger[_0xad33('0x26')](_0xad33('0x21'),_0x19acd3,_0x2100a9);_0x3d2a3c(_0x2100a9);});});}function respondWithStatusCode(_0x5c97fd,_0x1f05b3){_0x1f05b3=_0x1f05b3||0xcc;return function(_0x32bba6){if(_0x32bba6){return _0x5c97fd[_0xad33('0x2a')](_0x1f05b3);}return _0x5c97fd[_0xad33('0x2b')](_0x1f05b3)[_0xad33('0x2c')]();};}function respondWithResult(_0x329009,_0x2a65c2){_0x2a65c2=_0x2a65c2||0xc8;return function(_0x9d32a4){if(_0x9d32a4){return _0x329009[_0xad33('0x2b')](_0x2a65c2)[_0xad33('0x2d')](_0x9d32a4);}};}function respondWithFilteredResult(_0x5ddfaa,_0x54c5da){return function(_0x48b30c){if(_0x48b30c){var _0x4f803c=_0x48b30c['count'],_0x3b351f=_0x54c5da[_0xad33('0x2e')],_0x527969=_0x54c5da[_0xad33('0x2e')]+_0x54c5da['limit'],_0x19a35b;if(_0x527969>=_0x4f803c){_0x527969=_0x4f803c;_0x19a35b=0xc8;}else{_0x19a35b=0xce;}_0x5ddfaa[_0xad33('0x2b')](_0x19a35b);return _0x5ddfaa['set'](_0xad33('0x2f'),_0x3b351f+'-'+_0x527969+'/'+_0x4f803c)[_0xad33('0x2d')](_0x48b30c);}return null;};}function patchUpdates(_0x1bd0d4){return function(_0x29fb86){try{jsonpatch[_0xad33('0x30')](_0x29fb86,_0x1bd0d4,!![]);}catch(_0x41fe5f){return BPromise[_0xad33('0x31')](_0x41fe5f);}return _0x29fb86['save']();};}function saveUpdates(_0x48ccfa,_0x14d7b1){return function(_0x218e6f){if(_0x218e6f){return _0x218e6f[_0xad33('0x32')](_0x48ccfa)[_0xad33('0x33')](function(_0x272712){return _0x272712;});}return null;};}function removeEntity(_0x1fe463,_0x1f832c){return function(_0x2f7382){if(_0x2f7382){return _0x2f7382['destroy']()[_0xad33('0x33')](function(){var _0x267449=_0x2f7382['get']({'plain':!![]});var _0x1ab54f=_0xad33('0x34');return db[_0xad33('0x35')][_0xad33('0x36')]({'where':{'type':_0x1ab54f,'resourceId':_0x267449['id']}})[_0xad33('0x33')](function(){return _0x2f7382;});})['then'](function(){_0x1fe463[_0xad33('0x2b')](0xcc)[_0xad33('0x2c')]();});}};}function handleEntityNotFound(_0xa62fcc,_0x2d1480){return function(_0x312fac){if(!_0x312fac){_0xa62fcc[_0xad33('0x2a')](0x194);}return _0x312fac;};}function handleError(_0x5ecb01,_0x2ffed4){_0x2ffed4=_0x2ffed4||0x1f4;return function(_0x2b58f4){logger[_0xad33('0x26')](_0x2b58f4[_0xad33('0x37')]);if(_0x2b58f4[_0xad33('0x38')]){delete _0x2b58f4[_0xad33('0x38')];}_0x5ecb01['status'](_0x2ffed4)['send'](_0x2b58f4);};}exports[_0xad33('0x39')]=function(_0x4d8332,_0x2ef8f0){var _0x51b661={},_0x5b71e9={},_0x225efe={'count':0x0,'rows':[]};var _0x1275e6=_[_0xad33('0x3a')](db['VoiceContext'][_0xad33('0x3b')],function(_0xc150c4){return{'name':_0xc150c4[_0xad33('0x3c')],'type':_0xc150c4[_0xad33('0x3d')][_0xad33('0x3e')]};});_0x5b71e9[_0xad33('0x3f')]=_[_0xad33('0x3a')](_0x1275e6,'name');_0x5b71e9[_0xad33('0x40')]=_[_0xad33('0x41')](_0x4d8332[_0xad33('0x40')]);_0x5b71e9[_0xad33('0x42')]=_['intersection'](_0x5b71e9[_0xad33('0x3f')],_0x5b71e9[_0xad33('0x40')]);_0x51b661['attributes']=_[_0xad33('0x43')](_0x5b71e9[_0xad33('0x3f')],qs[_0xad33('0x44')](_0x4d8332['query'][_0xad33('0x44')]));_0x51b661[_0xad33('0x45')]=_0x51b661[_0xad33('0x45')][_0xad33('0x46')]?_0x51b661[_0xad33('0x45')]:_0x5b71e9['model'];if(!_0x4d8332['query'][_0xad33('0x47')](_0xad33('0x48'))){_0x51b661[_0xad33('0x49')]=qs[_0xad33('0x49')](_0x4d8332[_0xad33('0x40')]['limit']);_0x51b661[_0xad33('0x2e')]=qs[_0xad33('0x2e')](_0x4d8332[_0xad33('0x40')][_0xad33('0x2e')]);}_0x51b661[_0xad33('0x4a')]=qs['sort'](_0x4d8332['query'][_0xad33('0x4b')]);_0x51b661[_0xad33('0x4c')]=qs[_0xad33('0x42')](_['pick'](_0x4d8332[_0xad33('0x40')],_0x5b71e9[_0xad33('0x42')]));if(_0x4d8332[_0xad33('0x40')]['filter']){_0x51b661['where']=_[_0xad33('0x4d')](_0x51b661[_0xad33('0x4c')],{'$or':_[_0xad33('0x3a')](_0x1275e6,function(_0x5f0e3c){if(_0x5f0e3c[_0xad33('0x3d')]!==_0xad33('0x4e')){var _0x3b64b5={};_0x3b64b5[_0x5f0e3c[_0xad33('0x38')]]={'$like':'%'+_0x4d8332[_0xad33('0x40')][_0xad33('0x4f')]+'%'};return _0x3b64b5;}})});}_0x51b661=_[_0xad33('0x4d')]({},_0x51b661,_0x4d8332[_0xad33('0x50')]);var _0x3b17b7={'where':_0x51b661[_0xad33('0x4c')]};return db[_0xad33('0x51')][_0xad33('0x52')](_0x3b17b7)[_0xad33('0x33')](function(_0x684e3a){_0x225efe['count']=_0x684e3a;if(_0x4d8332[_0xad33('0x40')][_0xad33('0x53')]){_0x51b661[_0xad33('0x54')]=[{'all':!![]}];}return db[_0xad33('0x51')][_0xad33('0x55')](_0x51b661);})[_0xad33('0x33')](function(_0x118872){_0x225efe['rows']=_0x118872;return _0x225efe;})[_0xad33('0x33')](respondWithFilteredResult(_0x2ef8f0,_0x51b661))[_0xad33('0x29')](handleError(_0x2ef8f0,null));};exports[_0xad33('0x56')]=function(_0x3ef7bb,_0x58a0a7){var _0x52814d={'raw':![],'where':{'id':_0x3ef7bb[_0xad33('0x57')]['id']}},_0xaf1ad8={};_0xaf1ad8['model']=_['keys'](db['VoiceContext']['rawAttributes']);_0xaf1ad8['query']=_[_0xad33('0x41')](_0x3ef7bb[_0xad33('0x40')]);_0xaf1ad8['filters']=_['intersection'](_0xaf1ad8['model'],_0xaf1ad8[_0xad33('0x40')]);_0x52814d[_0xad33('0x45')]=_[_0xad33('0x43')](_0xaf1ad8[_0xad33('0x3f')],qs[_0xad33('0x44')](_0x3ef7bb[_0xad33('0x40')][_0xad33('0x44')]));_0x52814d[_0xad33('0x45')]=_0x52814d[_0xad33('0x45')][_0xad33('0x46')]?_0x52814d[_0xad33('0x45')]:_0xaf1ad8[_0xad33('0x3f')];if(_0x3ef7bb[_0xad33('0x40')]['includeAll']){_0x52814d['include']=[{'all':!![]}];}_0x52814d=_[_0xad33('0x4d')]({},_0x52814d,_0x3ef7bb[_0xad33('0x50')]);return db[_0xad33('0x51')][_0xad33('0x58')](_0x52814d)['then'](handleEntityNotFound(_0x58a0a7,null))['then'](respondWithResult(_0x58a0a7,null))[_0xad33('0x29')](handleError(_0x58a0a7,null));};exports[_0xad33('0x59')]=function(_0x47a30a,_0x1cf0a6,_0x2cf132){var _0x387ee9;return db['VoiceContext'][_0xad33('0x59')](_0x47a30a[_0xad33('0x5a')],{'raw':!![]})[_0xad33('0x33')](function(_0x2e38ba){_0x387ee9=_0x2e38ba;return db[_0xad33('0x51')][_0xad33('0x55')]({'raw':!![]});})[_0xad33('0x33')](function(_0x3cc00e){var _0x4cdeb2=fs[_0xad33('0x5b')](path[_0xad33('0x5c')](config['root'],_0xad33('0x5d')),_0xad33('0x5e'));var _0x4cb428=ejs[_0xad33('0x5f')](_0x4cdeb2,{'contexts':_0x3cc00e||[]});fs[_0xad33('0x60')](_0xad33('0x61'),_0x4cb428);})[_0xad33('0x33')](function(){return respondWithRpcPromise('Reload',_0xad33('0x59'),{'module':_0xad33('0x62')});})[_0xad33('0x33')](function(){var _0x28fdf1=_0x47a30a[_0xad33('0x63')][_0xad33('0x64')]({'plain':!![]});if(!_0x28fdf1)throw new Error(_0xad33('0x65'));if(_0x28fdf1[_0xad33('0x66')]==='user'){var _0x15dac3=_0x387ee9[_0xad33('0x64')]({'plain':!![]});return db['UserProfileSection'][_0xad33('0x58')]({'where':{'name':'Contexts','userProfileId':_0x28fdf1[_0xad33('0x67')]},'raw':!![]})[_0xad33('0x33')](function(_0x30b68b){if(_0x30b68b&&_0x30b68b[_0xad33('0x68')]===0x0){return db[_0xad33('0x35')][_0xad33('0x59')]({'name':_0x15dac3[_0xad33('0x38')],'resourceId':_0x15dac3['id'],'type':_0x30b68b[_0xad33('0x38')],'sectionId':_0x30b68b['id']},{})['then'](function(){return _0x387ee9;});}else{return _0x387ee9;}})[_0xad33('0x29')](function(_0x9618b){logger[_0xad33('0x26')](_0xad33('0x69'),_0x9618b);throw _0x9618b;});}return _0x387ee9;})[_0xad33('0x33')](respondWithResult(_0x1cf0a6,0xc9))[_0xad33('0x29')](handleError(_0x1cf0a6,null));};exports[_0xad33('0x32')]=function(_0x242e91,_0xce5230,_0x27df77){var _0x354e35;return db[_0xad33('0x51')][_0xad33('0x58')]({'where':{'id':_0x242e91[_0xad33('0x57')]['id']}})[_0xad33('0x33')](handleEntityNotFound(_0xce5230,null))[_0xad33('0x33')](saveUpdates(_0x242e91[_0xad33('0x5a')],null))[_0xad33('0x33')](function(_0x5d7900){if(_0x5d7900){_0x354e35=_0x5d7900;return db['VoiceContext'][_0xad33('0x55')]({'raw':!![]});}})[_0xad33('0x33')](function(_0x1979ef){var _0x10bb0f=fs[_0xad33('0x5b')](path['join'](config['root'],_0xad33('0x5d')),'utf8');var _0x536489=ejs['render'](_0x10bb0f,{'contexts':_0x1979ef||[]});fs[_0xad33('0x60')](_0xad33('0x61'),_0x536489);})[_0xad33('0x33')](function(){return respondWithRpcPromise(_0xad33('0x6a'),'update',{'module':'chan_sip.so'});})[_0xad33('0x33')](function(){return _0x354e35;})[_0xad33('0x33')](respondWithResult(_0xce5230,null))[_0xad33('0x29')](handleError(_0xce5230,null));};exports['destroy']=function(_0x4ddc00,_0x177952,_0x413186){var _0x292bd9;return db['VoiceContext'][_0xad33('0x58')]({'where':{'id':_0x4ddc00[_0xad33('0x57')]['id']}})['then'](handleEntityNotFound(_0x177952,null))[_0xad33('0x33')](removeEntity(_0x177952,null))['then'](function(){return db[_0xad33('0x51')]['findAll']({'raw':!![]});})[_0xad33('0x33')](function(_0x40ebf0){var _0x10a68a=fs[_0xad33('0x5b')](path['join'](config[_0xad33('0x6b')],'server/files/templates/context.ejs'),'utf8');var _0x365083=ejs[_0xad33('0x5f')](_0x10a68a,{'contexts':_0x40ebf0});fs[_0xad33('0x60')](_0xad33('0x61'),_0x365083);return respondWithRpcPromise(_0xad33('0x6a'),_0xad33('0x36'),{'module':_0xad33('0x62')});})[_0xad33('0x29')](handleError(_0x177952,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 1e504b0..c25febe 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 _0xc6c4=['exports','define','request-promise','path','../../config/environment','./voiceContext.attributes'];(function(_0x2a409c,_0x589035){var _0x1f2fbb=function(_0x1647f6){while(--_0x1647f6){_0x2a409c['push'](_0x2a409c['shift']());}};_0x1f2fbb(++_0x589035);}(_0xc6c4,0x8c));var _0x4c6c=function(_0x14252b,_0x124186){_0x14252b=_0x14252b-0x0;var _0x111129=_0xc6c4[_0x14252b];return _0x111129;};'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(_0x4c6c('0x0'));var fs=require('fs');var path=require(_0x4c6c('0x1'));var rimraf=require('rimraf');var config=require(_0x4c6c('0x2'));var attributes=require(_0x4c6c('0x3'));module[_0x4c6c('0x4')]=function(_0x57b02a,_0x395d53){return _0x57b02a[_0x4c6c('0x5')]('VoiceContext',attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf03d=['exports','define','VoiceContext','voice_contexts','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./voiceContext.attributes'];(function(_0x3bf861,_0x1d3a62){var _0x2dd829=function(_0x21256a){while(--_0x21256a){_0x3bf861['push'](_0x3bf861['shift']());}};_0x2dd829(++_0x1d3a62);}(_0xf03d,0x19c));var _0xdf03=function(_0x53b45b,_0x3ba44b){_0x53b45b=_0x53b45b-0x0;var _0x4e5c7c=_0xf03d[_0x53b45b];return _0x4e5c7c;};'use strict';var _=require('lodash');var util=require(_0xdf03('0x0'));var logger=require(_0xdf03('0x1'))(_0xdf03('0x2'));var moment=require('moment');var BPromise=require(_0xdf03('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf03('0x4'));var rimraf=require(_0xdf03('0x5'));var config=require(_0xdf03('0x6'));var attributes=require(_0xdf03('0x7'));module[_0xdf03('0x8')]=function(_0x3cfb2e,_0x549c34){return _0x3cfb2e[_0xdf03('0x9')](_0xdf03('0xa'),attributes,{'tableName':_0xdf03('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index bb5a64b..d811b54 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 _0x0aab=['request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','VoiceContext,\x20%s,\x20%s'];(function(_0x5bf407,_0x10939c){var _0x1d3a28=function(_0x54d328){while(--_0x54d328){_0x5bf407['push'](_0x5bf407['shift']());}};_0x1d3a28(++_0x10939c);}(_0x0aab,0x169));var _0xb0aa=function(_0x513047,_0x2199c5){_0x513047=_0x513047-0x0;var _0x15b779=_0x0aab[_0x513047];return _0x15b779;};'use strict';var _=require(_0xb0aa('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb0aa('0x1'));var rs=require(_0xb0aa('0x2'));var fs=require('fs');var Redis=require(_0xb0aa('0x3'));var db=require(_0xb0aa('0x4'))['db'];var utils=require(_0xb0aa('0x5'));var logger=require(_0xb0aa('0x6'))('rpc');var config=require(_0xb0aa('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb0aa('0x8')][_0xb0aa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x58bcfd,_0x4c1b16,_0x1e180e){return new BPromise(function(_0x388a53,_0x53dd65){return client['request'](_0x58bcfd,_0x1e180e)[_0xb0aa('0xa')](function(_0xc81721){logger[_0xb0aa('0xb')](_0xb0aa('0xc'),_0x4c1b16,_0xb0aa('0xd'));logger[_0xb0aa('0xe')](_0xb0aa('0xf'),_0x4c1b16,_0xb0aa('0xd'),JSON[_0xb0aa('0x10')](_0xc81721));if(_0xc81721[_0xb0aa('0x11')]){if(_0xc81721[_0xb0aa('0x11')][_0xb0aa('0x12')]===0x1f4){logger['error'](_0xb0aa('0xc'),_0x4c1b16,_0xc81721[_0xb0aa('0x11')][_0xb0aa('0x13')]);return _0x53dd65(_0xc81721['error'][_0xb0aa('0x13')]);}logger[_0xb0aa('0x11')](_0xb0aa('0xc'),_0x4c1b16,_0xc81721[_0xb0aa('0x11')][_0xb0aa('0x13')]);return _0x388a53(_0xc81721[_0xb0aa('0x11')][_0xb0aa('0x13')]);}else{logger[_0xb0aa('0xb')]('VoiceContext,\x20%s,\x20%s',_0x4c1b16,_0xb0aa('0xd'));_0x388a53(_0xc81721[_0xb0aa('0x14')][_0xb0aa('0x13')]);}})[_0xb0aa('0x15')](function(_0x52f4f3){logger[_0xb0aa('0x11')]('VoiceContext,\x20%s,\x20%s',_0x4c1b16,_0x52f4f3);_0x53dd65(_0x52f4f3);});});} \ No newline at end of file +var _0x91d1=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment'];(function(_0x3a0c67,_0x130b5c){var _0x38e40b=function(_0x17ae7e){while(--_0x17ae7e){_0x3a0c67['push'](_0x3a0c67['shift']());}};_0x38e40b(++_0x130b5c);}(_0x91d1,0x17a));var _0x191d=function(_0x1f8265,_0x5239aa){_0x1f8265=_0x1f8265-0x0;var _0x27219e=_0x91d1[_0x1f8265];return _0x27219e;};'use strict';var _=require('lodash');var util=require(_0x191d('0x0'));var moment=require(_0x191d('0x1'));var BPromise=require(_0x191d('0x2'));var rs=require(_0x191d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x191d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x191d('0x5'))(_0x191d('0x6'));var config=require('../../config/environment');var jayson=require(_0x191d('0x7'));var client=jayson[_0x191d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2111f1,_0x1e8c00,_0x57b0ee){return new BPromise(function(_0x582afd,_0x5d7ad9){return client['request'](_0x2111f1,_0x57b0ee)['then'](function(_0x400e8d){logger[_0x191d('0x9')](_0x191d('0xa'),_0x1e8c00,_0x191d('0xb'));logger[_0x191d('0xc')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x1e8c00,'request\x20sent',JSON[_0x191d('0xd')](_0x400e8d));if(_0x400e8d[_0x191d('0xe')]){if(_0x400e8d[_0x191d('0xe')][_0x191d('0xf')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x1e8c00,_0x400e8d[_0x191d('0xe')][_0x191d('0x10')]);return _0x5d7ad9(_0x400e8d[_0x191d('0xe')][_0x191d('0x10')]);}logger[_0x191d('0xe')](_0x191d('0xa'),_0x1e8c00,_0x400e8d[_0x191d('0xe')]['message']);return _0x582afd(_0x400e8d[_0x191d('0xe')][_0x191d('0x10')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x1e8c00,'request\x20sent');_0x582afd(_0x400e8d[_0x191d('0x11')][_0x191d('0x10')]);}})[_0x191d('0x12')](function(_0x4eb5b8){logger['error'](_0x191d('0xa'),_0x1e8c00,_0x4eb5b8);_0x5d7ad9(_0x4eb5b8);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 6f76adc..adb5b1f 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 _0x3c47=['show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x141449,_0x4f2291){var _0x30db77=function(_0x5b6021){while(--_0x5b6021){_0x141449['push'](_0x141449['shift']());}};_0x30db77(++_0x4f2291);}(_0x3c47,0x188));var _0x73c4=function(_0x51ed77,_0x35baf6){_0x51ed77=_0x51ed77-0x0;var _0x1e3512=_0x3c47[_0x51ed77];return _0x1e3512;};'use strict';var multer=require(_0x73c4('0x0'));var util=require(_0x73c4('0x1'));var path=require(_0x73c4('0x2'));var timeout=require(_0x73c4('0x3'));var express=require(_0x73c4('0x4'));var router=express[_0x73c4('0x5')]();var auth=require(_0x73c4('0x6'));var interaction=require(_0x73c4('0x7'));var config=require(_0x73c4('0x8'));var controller=require(_0x73c4('0x9'));router[_0x73c4('0xa')]('/',auth[_0x73c4('0xb')](),controller[_0x73c4('0xc')]);router[_0x73c4('0xa')](_0x73c4('0xd'),auth[_0x73c4('0xb')](),controller[_0x73c4('0xe')]);router[_0x73c4('0xa')](_0x73c4('0xf'),auth[_0x73c4('0xb')](),controller[_0x73c4('0x10')]);router[_0x73c4('0x11')]('/',auth['isAuthenticated'](),controller[_0x73c4('0x12')]);router[_0x73c4('0x13')](_0x73c4('0xf'),auth['isAuthenticated'](),controller[_0x73c4('0x14')]);router[_0x73c4('0x15')](_0x73c4('0xf'),auth[_0x73c4('0xb')](),controller[_0x73c4('0x16')]);module[_0x73c4('0x17')]=router; \ No newline at end of file +var _0x7236=['/:id','show','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','describe'];(function(_0x23a466,_0x1beaa6){var _0x19a480=function(_0x497a15){while(--_0x497a15){_0x23a466['push'](_0x23a466['shift']());}};_0x19a480(++_0x1beaa6);}(_0x7236,0xf7));var _0x6723=function(_0x1069a0,_0x7cdaf9){_0x1069a0=_0x1069a0-0x0;var _0x518919=_0x7236[_0x1069a0];return _0x518919;};'use strict';var multer=require(_0x6723('0x0'));var util=require('util');var path=require(_0x6723('0x1'));var timeout=require(_0x6723('0x2'));var express=require(_0x6723('0x3'));var router=express[_0x6723('0x4')]();var auth=require(_0x6723('0x5'));var interaction=require(_0x6723('0x6'));var config=require(_0x6723('0x7'));var controller=require(_0x6723('0x8'));router[_0x6723('0x9')]('/',auth[_0x6723('0xa')](),controller[_0x6723('0xb')]);router['get']('/describe',auth[_0x6723('0xa')](),controller[_0x6723('0xc')]);router[_0x6723('0x9')](_0x6723('0xd'),auth[_0x6723('0xa')](),controller[_0x6723('0xe')]);router['post']('/',auth[_0x6723('0xa')](),controller[_0x6723('0xf')]);router[_0x6723('0x10')](_0x6723('0xd'),auth[_0x6723('0xa')](),controller['update']);router[_0x6723('0x11')]('/:id',auth[_0x6723('0xa')](),controller[_0x6723('0x12')]);module[_0x6723('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index c58810d..7ead0b0 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 _0x1554=['STRING','INTEGER','DATE','called,connect,complete','exports'];(function(_0x3af126,_0x230eb7){var _0x2c094c=function(_0x2c0dc8){while(--_0x2c0dc8){_0x3af126['push'](_0x3af126['shift']());}};_0x2c094c(++_0x230eb7);}(_0x1554,0x108));var _0x4155=function(_0x160e7b,_0x31b29c){_0x160e7b=_0x160e7b-0x0;var _0x3fc88a=_0x1554[_0x160e7b];return _0x3fc88a;};'use strict';var Sequelize=require('sequelize');module[_0x4155('0x0')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x4155('0x1')]},'channelstate':{'type':Sequelize[_0x4155('0x2')]},'channelstatedesc':{'type':Sequelize[_0x4155('0x1')]},'calleridnum':{'type':Sequelize[_0x4155('0x1')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x4155('0x1')]},'connectedlinename':{'type':Sequelize[_0x4155('0x1')]},'language':{'type':Sequelize[_0x4155('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x4155('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x4155('0x2')]},'uniqueid':{'type':Sequelize[_0x4155('0x1')]},'linkedid':{'type':Sequelize[_0x4155('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x4155('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x4155('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x4155('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x4155('0x1')]},'destaccountcode':{'type':Sequelize[_0x4155('0x1')]},'destcontext':{'type':Sequelize[_0x4155('0x1')]},'destexten':{'type':Sequelize[_0x4155('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x4155('0x1')]},'destlinkedid':{'type':Sequelize[_0x4155('0x1')]},'dialstring':{'type':Sequelize[_0x4155('0x1')]},'dialstatus':{'type':Sequelize[_0x4155('0x1')]},'starttime':{'type':Sequelize[_0x4155('0x3')]},'answertime':{'type':Sequelize[_0x4155('0x3')]},'endtime':{'type':Sequelize[_0x4155('0x3')]},'lastevent':{'type':Sequelize[_0x4155('0x1')],'comment':_0x4155('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x4155('0x2')]},'holdtime':{'type':Sequelize[_0x4155('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x08f0=['DATE','sequelize','STRING','INTEGER'];(function(_0x491277,_0x533095){var _0x1e5393=function(_0x203085){while(--_0x203085){_0x491277['push'](_0x491277['shift']());}};_0x1e5393(++_0x533095);}(_0x08f0,0x15d));var _0x008f=function(_0x13d14d,_0x281eeb){_0x13d14d=_0x13d14d-0x0;var _0xf7f87e=_0x08f0[_0x13d14d];return _0xf7f87e;};'use strict';var Sequelize=require(_0x008f('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x008f('0x1')]},'channel':{'type':Sequelize[_0x008f('0x1')]},'channelstate':{'type':Sequelize[_0x008f('0x2')]},'channelstatedesc':{'type':Sequelize[_0x008f('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x008f('0x1')]},'connectedlinenum':{'type':Sequelize[_0x008f('0x1')]},'connectedlinename':{'type':Sequelize[_0x008f('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x008f('0x2')]},'uniqueid':{'type':Sequelize[_0x008f('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x008f('0x1')]},'destchannelstate':{'type':Sequelize[_0x008f('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x008f('0x1')]},'destcalleridnum':{'type':Sequelize[_0x008f('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x008f('0x1')]},'destlanguage':{'type':Sequelize[_0x008f('0x1')]},'destaccountcode':{'type':Sequelize[_0x008f('0x1')]},'destcontext':{'type':Sequelize[_0x008f('0x1')]},'destexten':{'type':Sequelize[_0x008f('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x008f('0x1')]},'destlinkedid':{'type':Sequelize[_0x008f('0x1')]},'dialstring':{'type':Sequelize[_0x008f('0x1')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x008f('0x3')]},'answertime':{'type':Sequelize[_0x008f('0x3')]},'endtime':{'type':Sequelize[_0x008f('0x3')]},'lastevent':{'type':Sequelize[_0x008f('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x008f('0x2')]},'duration':{'type':Sequelize[_0x008f('0x2')]},'holdtime':{'type':Sequelize[_0x008f('0x2')]},'billableseconds':{'type':Sequelize[_0x008f('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 60baab0..0a5c8c6 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 _0x088d=['find','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','name','VoiceDialReport','fieldName','type','key','model','map','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','limit','sort','where','pick','merge','filter','options','rows','catch','show','params','keys','includeAll','create','body'];(function(_0x3a4a1f,_0x406fb5){var _0x18112d=function(_0x8c3f34){while(--_0x8c3f34){_0x3a4a1f['push'](_0x3a4a1f['shift']());}};_0x18112d(++_0x406fb5);}(_0x088d,0x16a));var _0xd088=function(_0xa4ff36,_0x3e673c){_0xa4ff36=_0xa4ff36-0x0;var _0x2772fc=_0x088d[_0xa4ff36];return _0x2772fc;};'use strict';var pdf=require(_0xd088('0x0'));var emlformat=require(_0xd088('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd088('0x2'));var jsonpatch=require(_0xd088('0x3'));var rp=require(_0xd088('0x4'));var moment=require(_0xd088('0x5'));var BPromise=require(_0xd088('0x6'));var Mustache=require(_0xd088('0x7'));var util=require(_0xd088('0x8'));var path=require(_0xd088('0x9'));var sox=require(_0xd088('0xa'));var csv=require('to-csv');var ejs=require(_0xd088('0xb'));var fs=require('fs');var _=require(_0xd088('0xc'));var squel=require(_0xd088('0xd'));var crypto=require('crypto');var jsforce=require(_0xd088('0xe'));var deskjs=require(_0xd088('0xf'));var toCsv=require(_0xd088('0x10'));var querystring=require(_0xd088('0x11'));var Papa=require(_0xd088('0x12'));var Redis=require(_0xd088('0x13'));var authService=require(_0xd088('0x14'));var qs=require(_0xd088('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd088('0x16'));var logger=require('../../config/logger')(_0xd088('0x17'));var utils=require('../../config/utils');var config=require(_0xd088('0x18'));var db=require(_0xd088('0x19'))['db'];function respondWithStatusCode(_0x162ef3,_0x430034){_0x430034=_0x430034||0xcc;return function(_0x3d0e8d){if(_0x3d0e8d){return _0x162ef3[_0xd088('0x1a')](_0x430034);}return _0x162ef3[_0xd088('0x1b')](_0x430034)['end']();};}function respondWithResult(_0x5b3423,_0x4355e5){_0x4355e5=_0x4355e5||0xc8;return function(_0x9176a){if(_0x9176a){return _0x5b3423[_0xd088('0x1b')](_0x4355e5)[_0xd088('0x1c')](_0x9176a);}};}function respondWithFilteredResult(_0x46662e,_0x11d611){return function(_0x2bc98b){if(_0x2bc98b){var _0x5058dd=_0x2bc98b[_0xd088('0x1d')],_0x4f4c00=_0x11d611['offset'],_0x147e76=_0x11d611[_0xd088('0x1e')]+_0x11d611['limit'],_0x5b09e9;if(_0x147e76>=_0x5058dd){_0x147e76=_0x5058dd;_0x5b09e9=0xc8;}else{_0x5b09e9=0xce;}_0x46662e[_0xd088('0x1b')](_0x5b09e9);return _0x46662e[_0xd088('0x1f')](_0xd088('0x20'),_0x4f4c00+'-'+_0x147e76+'/'+_0x5058dd)['json'](_0x2bc98b);}return null;};}function patchUpdates(_0x244790){return function(_0x44a53e){try{jsonpatch[_0xd088('0x21')](_0x44a53e,_0x244790,!![]);}catch(_0x5a23cd){return BPromise[_0xd088('0x22')](_0x5a23cd);}return _0x44a53e[_0xd088('0x23')]();};}function saveUpdates(_0x35cc2a,_0x52c4be){return function(_0x4b0d0e){if(_0x4b0d0e){return _0x4b0d0e[_0xd088('0x24')](_0x35cc2a)['then'](function(_0x2599a2){return _0x2599a2;});}return null;};}function removeEntity(_0x280497,_0x428b13){return function(_0x19aa79){if(_0x19aa79){return _0x19aa79[_0xd088('0x25')]()[_0xd088('0x26')](function(){_0x280497[_0xd088('0x1b')](0xcc)[_0xd088('0x27')]();});}};}function handleEntityNotFound(_0x3fc15f,_0x379560){return function(_0x8c9c2d){if(!_0x8c9c2d){_0x3fc15f['sendStatus'](0x194);}return _0x8c9c2d;};}function handleError(_0x2201dd,_0x173e2b){_0x173e2b=_0x173e2b||0x1f4;return function(_0x3ddacf){logger['error'](_0x3ddacf['stack']);if(_0x3ddacf[_0xd088('0x28')]){delete _0x3ddacf[_0xd088('0x28')];}_0x2201dd[_0xd088('0x1b')](_0x173e2b)['send'](_0x3ddacf);};}exports['index']=function(_0x50befc,_0x301897){var _0x25a655={},_0x2a549c={},_0x1734c6={'count':0x0,'rows':[]};var _0x5684c0=_['map'](db[_0xd088('0x29')]['rawAttributes'],function(_0x4f4b61){return{'name':_0x4f4b61[_0xd088('0x2a')],'type':_0x4f4b61[_0xd088('0x2b')][_0xd088('0x2c')]};});_0x2a549c[_0xd088('0x2d')]=_[_0xd088('0x2e')](_0x5684c0,_0xd088('0x28'));_0x2a549c[_0xd088('0x2f')]=_['keys'](_0x50befc['query']);_0x2a549c[_0xd088('0x30')]=_[_0xd088('0x31')](_0x2a549c['model'],_0x2a549c[_0xd088('0x2f')]);_0x25a655['attributes']=_[_0xd088('0x31')](_0x2a549c[_0xd088('0x2d')],qs[_0xd088('0x32')](_0x50befc[_0xd088('0x2f')][_0xd088('0x32')]));_0x25a655['attributes']=_0x25a655['attributes'][_0xd088('0x33')]?_0x25a655[_0xd088('0x34')]:_0x2a549c[_0xd088('0x2d')];if(!_0x50befc[_0xd088('0x2f')][_0xd088('0x35')](_0xd088('0x36'))){_0x25a655[_0xd088('0x37')]=qs[_0xd088('0x37')](_0x50befc[_0xd088('0x2f')][_0xd088('0x37')]);_0x25a655['offset']=qs[_0xd088('0x1e')](_0x50befc[_0xd088('0x2f')]['offset']);}_0x25a655['order']=qs[_0xd088('0x38')](_0x50befc[_0xd088('0x2f')][_0xd088('0x38')]);_0x25a655[_0xd088('0x39')]=qs['filters'](_[_0xd088('0x3a')](_0x50befc['query'],_0x2a549c['filters']));if(_0x50befc['query']['filter']){_0x25a655['where']=_[_0xd088('0x3b')](_0x25a655[_0xd088('0x39')],{'$or':_[_0xd088('0x2e')](_0x5684c0,function(_0x46eb56){if(_0x46eb56['type']!=='VIRTUAL'){var _0x126279={};_0x126279[_0x46eb56[_0xd088('0x28')]]={'$like':'%'+_0x50befc[_0xd088('0x2f')][_0xd088('0x3c')]+'%'};return _0x126279;}})});}_0x25a655=_[_0xd088('0x3b')]({},_0x25a655,_0x50befc[_0xd088('0x3d')]);var _0x45f972={'where':_0x25a655[_0xd088('0x39')]};return db[_0xd088('0x29')][_0xd088('0x1d')](_0x45f972)[_0xd088('0x26')](function(_0x233f34){_0x1734c6['count']=_0x233f34;if(_0x50befc['query']['includeAll']){_0x25a655['include']=[{'all':!![]}];}return db[_0xd088('0x29')]['findAll'](_0x25a655);})[_0xd088('0x26')](function(_0x2da8a8){_0x1734c6[_0xd088('0x3e')]=_0x2da8a8;return _0x1734c6;})[_0xd088('0x26')](respondWithFilteredResult(_0x301897,_0x25a655))[_0xd088('0x3f')](handleError(_0x301897,null));};exports[_0xd088('0x40')]=function(_0x55765c,_0x55253f){var _0x4d8d9a={'raw':!![],'where':{'id':_0x55765c[_0xd088('0x41')]['id']}},_0x31fff4={};_0x31fff4['model']=_[_0xd088('0x42')](db[_0xd088('0x29')]['rawAttributes']);_0x31fff4[_0xd088('0x2f')]=_[_0xd088('0x42')](_0x55765c[_0xd088('0x2f')]);_0x31fff4[_0xd088('0x30')]=_[_0xd088('0x31')](_0x31fff4['model'],_0x31fff4['query']);_0x4d8d9a[_0xd088('0x34')]=_['intersection'](_0x31fff4[_0xd088('0x2d')],qs[_0xd088('0x32')](_0x55765c[_0xd088('0x2f')][_0xd088('0x32')]));_0x4d8d9a[_0xd088('0x34')]=_0x4d8d9a[_0xd088('0x34')][_0xd088('0x33')]?_0x4d8d9a[_0xd088('0x34')]:_0x31fff4[_0xd088('0x2d')];if(_0x55765c['query'][_0xd088('0x43')]){_0x4d8d9a['include']=[{'all':!![]}];}_0x4d8d9a=_[_0xd088('0x3b')]({},_0x4d8d9a,_0x55765c[_0xd088('0x3d')]);return db[_0xd088('0x29')]['find'](_0x4d8d9a)[_0xd088('0x26')](handleEntityNotFound(_0x55253f,null))['then'](respondWithResult(_0x55253f,null))[_0xd088('0x3f')](handleError(_0x55253f,null));};exports[_0xd088('0x44')]=function(_0x2a4fc4,_0xba65d4){return db[_0xd088('0x29')][_0xd088('0x44')](_0x2a4fc4[_0xd088('0x45')],{})['then'](respondWithResult(_0xba65d4,0xc9))[_0xd088('0x3f')](handleError(_0xba65d4,null));};exports[_0xd088('0x24')]=function(_0x1d1a6a,_0x380450){if(_0x1d1a6a[_0xd088('0x45')]['id']){delete _0x1d1a6a[_0xd088('0x45')]['id'];}return db[_0xd088('0x29')][_0xd088('0x46')]({'where':{'id':_0x1d1a6a[_0xd088('0x41')]['id']}})[_0xd088('0x26')](handleEntityNotFound(_0x380450,null))['then'](saveUpdates(_0x1d1a6a['body'],null))[_0xd088('0x26')](respondWithResult(_0x380450,null))[_0xd088('0x3f')](handleError(_0x380450,null));};exports[_0xd088('0x25')]=function(_0x14f9ab,_0x28694d){return db[_0xd088('0x29')][_0xd088('0x46')]({'where':{'id':_0x14f9ab[_0xd088('0x41')]['id']}})[_0xd088('0x26')](handleEntityNotFound(_0x28694d,null))['then'](removeEntity(_0x28694d,null))[_0xd088('0x3f')](handleError(_0x28694d,null));};exports[_0xd088('0x47')]=function(_0x4a5bb5,_0x1e11e7){return db[_0xd088('0x29')]['describe']()['then'](respondWithResult(_0x1e11e7,null))[_0xd088('0x3f')](handleError(_0x1e11e7,null));}; \ No newline at end of file +var _0xfcae=['status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceDialReport','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','end'];(function(_0x2377a3,_0x7b4522){var _0x538284=function(_0x8c6a36){while(--_0x8c6a36){_0x2377a3['push'](_0x2377a3['shift']());}};_0x538284(++_0x7b4522);}(_0xfcae,0xcf));var _0xefca=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xfcae[_0x9cd4c3];return _0x4c9025;};'use strict';var pdf=require(_0xefca('0x0'));var emlformat=require(_0xefca('0x1'));var rimraf=require(_0xefca('0x2'));var zipdir=require(_0xefca('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xefca('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xefca('0x5'));var util=require(_0xefca('0x6'));var path=require(_0xefca('0x7'));var sox=require(_0xefca('0x8'));var csv=require('to-csv');var ejs=require(_0xefca('0x9'));var fs=require('fs');var _=require(_0xefca('0xa'));var squel=require(_0xefca('0xb'));var crypto=require(_0xefca('0xc'));var jsforce=require(_0xefca('0xd'));var deskjs=require(_0xefca('0xe'));var toCsv=require(_0xefca('0xf'));var querystring=require(_0xefca('0x10'));var Papa=require(_0xefca('0x11'));var Redis=require(_0xefca('0x12'));var authService=require(_0xefca('0x13'));var qs=require(_0xefca('0x14'));var as=require(_0xefca('0x15'));var hardwareService=require(_0xefca('0x16'));var logger=require(_0xefca('0x17'))('api');var utils=require(_0xefca('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59e7e4,_0x324e3a){_0x324e3a=_0x324e3a||0xcc;return function(_0x30a95a){if(_0x30a95a){return _0x59e7e4[_0xefca('0x19')](_0x324e3a);}return _0x59e7e4['status'](_0x324e3a)[_0xefca('0x1a')]();};}function respondWithResult(_0x40d37c,_0x4c8f6d){_0x4c8f6d=_0x4c8f6d||0xc8;return function(_0x16915b){if(_0x16915b){return _0x40d37c[_0xefca('0x1b')](_0x4c8f6d)[_0xefca('0x1c')](_0x16915b);}};}function respondWithFilteredResult(_0x32c45e,_0x3f5c5c){return function(_0x214a1e){if(_0x214a1e){var _0x32b8bf=_0x214a1e[_0xefca('0x1d')],_0x3d9d0e=_0x3f5c5c[_0xefca('0x1e')],_0x53b09b=_0x3f5c5c[_0xefca('0x1e')]+_0x3f5c5c[_0xefca('0x1f')],_0x35a0c1;if(_0x53b09b>=_0x32b8bf){_0x53b09b=_0x32b8bf;_0x35a0c1=0xc8;}else{_0x35a0c1=0xce;}_0x32c45e['status'](_0x35a0c1);return _0x32c45e[_0xefca('0x20')](_0xefca('0x21'),_0x3d9d0e+'-'+_0x53b09b+'/'+_0x32b8bf)[_0xefca('0x1c')](_0x214a1e);}return null;};}function patchUpdates(_0x5da187){return function(_0x4186b8){try{jsonpatch[_0xefca('0x22')](_0x4186b8,_0x5da187,!![]);}catch(_0x46b02f){return BPromise[_0xefca('0x23')](_0x46b02f);}return _0x4186b8[_0xefca('0x24')]();};}function saveUpdates(_0x1a6b2b,_0x34a901){return function(_0x10513c){if(_0x10513c){return _0x10513c[_0xefca('0x25')](_0x1a6b2b)[_0xefca('0x26')](function(_0x1930ad){return _0x1930ad;});}return null;};}function removeEntity(_0x46b3cf,_0x45da4c){return function(_0x4cc6ae){if(_0x4cc6ae){return _0x4cc6ae[_0xefca('0x27')]()[_0xefca('0x26')](function(){_0x46b3cf[_0xefca('0x1b')](0xcc)[_0xefca('0x1a')]();});}};}function handleEntityNotFound(_0x4d1dbe,_0x5eef50){return function(_0xd8fec0){if(!_0xd8fec0){_0x4d1dbe[_0xefca('0x19')](0x194);}return _0xd8fec0;};}function handleError(_0x57c511,_0x254b95){_0x254b95=_0x254b95||0x1f4;return function(_0x368926){logger[_0xefca('0x28')](_0x368926[_0xefca('0x29')]);if(_0x368926[_0xefca('0x2a')]){delete _0x368926[_0xefca('0x2a')];}_0x57c511[_0xefca('0x1b')](_0x254b95)[_0xefca('0x2b')](_0x368926);};}exports[_0xefca('0x2c')]=function(_0x16abf2,_0x14fab8){var _0x4d8c22={},_0x40ee0e={},_0x180783={'count':0x0,'rows':[]};var _0x538009=_[_0xefca('0x2d')](db[_0xefca('0x2e')]['rawAttributes'],function(_0x50d581){return{'name':_0x50d581['fieldName'],'type':_0x50d581[_0xefca('0x2f')][_0xefca('0x30')]};});_0x40ee0e[_0xefca('0x31')]=_['map'](_0x538009,'name');_0x40ee0e[_0xefca('0x32')]=_[_0xefca('0x33')](_0x16abf2[_0xefca('0x32')]);_0x40ee0e[_0xefca('0x34')]=_[_0xefca('0x35')](_0x40ee0e[_0xefca('0x31')],_0x40ee0e['query']);_0x4d8c22['attributes']=_[_0xefca('0x35')](_0x40ee0e[_0xefca('0x31')],qs[_0xefca('0x36')](_0x16abf2[_0xefca('0x32')][_0xefca('0x36')]));_0x4d8c22[_0xefca('0x37')]=_0x4d8c22[_0xefca('0x37')][_0xefca('0x38')]?_0x4d8c22['attributes']:_0x40ee0e[_0xefca('0x31')];if(!_0x16abf2[_0xefca('0x32')][_0xefca('0x39')](_0xefca('0x3a'))){_0x4d8c22[_0xefca('0x1f')]=qs[_0xefca('0x1f')](_0x16abf2['query']['limit']);_0x4d8c22[_0xefca('0x1e')]=qs[_0xefca('0x1e')](_0x16abf2['query'][_0xefca('0x1e')]);}_0x4d8c22[_0xefca('0x3b')]=qs[_0xefca('0x3c')](_0x16abf2[_0xefca('0x32')]['sort']);_0x4d8c22[_0xefca('0x3d')]=qs[_0xefca('0x34')](_[_0xefca('0x3e')](_0x16abf2[_0xefca('0x32')],_0x40ee0e[_0xefca('0x34')]));if(_0x16abf2[_0xefca('0x32')][_0xefca('0x3f')]){_0x4d8c22[_0xefca('0x3d')]=_[_0xefca('0x40')](_0x4d8c22[_0xefca('0x3d')],{'$or':_['map'](_0x538009,function(_0x5cdecb){if(_0x5cdecb[_0xefca('0x2f')]!==_0xefca('0x41')){var _0x539dc4={};_0x539dc4[_0x5cdecb[_0xefca('0x2a')]]={'$like':'%'+_0x16abf2[_0xefca('0x32')]['filter']+'%'};return _0x539dc4;}})});}_0x4d8c22=_[_0xefca('0x40')]({},_0x4d8c22,_0x16abf2[_0xefca('0x42')]);var _0x39d5e5={'where':_0x4d8c22[_0xefca('0x3d')]};return db[_0xefca('0x2e')][_0xefca('0x1d')](_0x39d5e5)['then'](function(_0x46116e){_0x180783['count']=_0x46116e;if(_0x16abf2['query'][_0xefca('0x43')]){_0x4d8c22[_0xefca('0x44')]=[{'all':!![]}];}return db['VoiceDialReport'][_0xefca('0x45')](_0x4d8c22);})[_0xefca('0x26')](function(_0x37da6c){_0x180783['rows']=_0x37da6c;return _0x180783;})[_0xefca('0x26')](respondWithFilteredResult(_0x14fab8,_0x4d8c22))['catch'](handleError(_0x14fab8,null));};exports[_0xefca('0x46')]=function(_0x4ff75e,_0x568196){var _0x465bb8={'raw':!![],'where':{'id':_0x4ff75e[_0xefca('0x47')]['id']}},_0x2211a1={};_0x2211a1[_0xefca('0x31')]=_[_0xefca('0x33')](db[_0xefca('0x2e')][_0xefca('0x48')]);_0x2211a1[_0xefca('0x32')]=_[_0xefca('0x33')](_0x4ff75e['query']);_0x2211a1['filters']=_[_0xefca('0x35')](_0x2211a1['model'],_0x2211a1[_0xefca('0x32')]);_0x465bb8[_0xefca('0x37')]=_['intersection'](_0x2211a1[_0xefca('0x31')],qs[_0xefca('0x36')](_0x4ff75e[_0xefca('0x32')][_0xefca('0x36')]));_0x465bb8['attributes']=_0x465bb8[_0xefca('0x37')][_0xefca('0x38')]?_0x465bb8[_0xefca('0x37')]:_0x2211a1[_0xefca('0x31')];if(_0x4ff75e[_0xefca('0x32')][_0xefca('0x43')]){_0x465bb8[_0xefca('0x44')]=[{'all':!![]}];}_0x465bb8=_[_0xefca('0x40')]({},_0x465bb8,_0x4ff75e[_0xefca('0x42')]);return db[_0xefca('0x2e')][_0xefca('0x49')](_0x465bb8)['then'](handleEntityNotFound(_0x568196,null))[_0xefca('0x26')](respondWithResult(_0x568196,null))[_0xefca('0x4a')](handleError(_0x568196,null));};exports[_0xefca('0x4b')]=function(_0x389cc2,_0x544f76){return db[_0xefca('0x2e')]['create'](_0x389cc2[_0xefca('0x4c')],{})['then'](respondWithResult(_0x544f76,0xc9))['catch'](handleError(_0x544f76,null));};exports[_0xefca('0x25')]=function(_0x88d52a,_0xc0195b){if(_0x88d52a[_0xefca('0x4c')]['id']){delete _0x88d52a[_0xefca('0x4c')]['id'];}return db['VoiceDialReport'][_0xefca('0x49')]({'where':{'id':_0x88d52a[_0xefca('0x47')]['id']}})[_0xefca('0x26')](handleEntityNotFound(_0xc0195b,null))[_0xefca('0x26')](saveUpdates(_0x88d52a[_0xefca('0x4c')],null))[_0xefca('0x26')](respondWithResult(_0xc0195b,null))[_0xefca('0x4a')](handleError(_0xc0195b,null));};exports[_0xefca('0x27')]=function(_0x575866,_0x12f357){return db[_0xefca('0x2e')][_0xefca('0x49')]({'where':{'id':_0x575866[_0xefca('0x47')]['id']}})[_0xefca('0x26')](handleEntityNotFound(_0x12f357,null))[_0xefca('0x26')](removeEntity(_0x12f357,null))[_0xefca('0x4a')](handleError(_0x12f357,null));};exports[_0xefca('0x4d')]=function(_0x1070ad,_0x505719){return db[_0xefca('0x2e')]['describe']()[_0xefca('0x26')](respondWithResult(_0x505719,null))[_0xefca('0x4a')](handleError(_0x505719,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 5e536a8..c538ddc 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 _0x5744=['moment','bluebird','rimraf','../../config/environment','./voiceDialReport.attributes','exports','report_dial','uniqueid','../../config/logger','api'];(function(_0x1f109c,_0xd9952e){var _0x3984e8=function(_0x40b60b){while(--_0x40b60b){_0x1f109c['push'](_0x1f109c['shift']());}};_0x3984e8(++_0xd9952e);}(_0x5744,0x184));var _0x4574=function(_0x3ccf25,_0x372b32){_0x3ccf25=_0x3ccf25-0x0;var _0x204ee3=_0x5744[_0x3ccf25];return _0x204ee3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4574('0x0'))(_0x4574('0x1'));var moment=require(_0x4574('0x2'));var BPromise=require(_0x4574('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4574('0x4'));var config=require(_0x4574('0x5'));var attributes=require(_0x4574('0x6'));module[_0x4574('0x7')]=function(_0x3858fe,_0x2c819f){return _0x3858fe['define']('VoiceDialReport',attributes,{'tableName':_0x4574('0x8'),'paranoid':![],'indexes':[{'fields':[_0x4574('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc9aa=['../../config/environment','VoiceDialReport','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xc9aa,0x1b0));var _0xac9a=function(_0x187279,_0x26d152){_0x187279=_0x187279-0x0;var _0x3da59d=_0xc9aa[_0x187279];return _0x3da59d;};'use strict';var _=require(_0xac9a('0x0'));var util=require(_0xac9a('0x1'));var logger=require(_0xac9a('0x2'))(_0xac9a('0x3'));var moment=require('moment');var BPromise=require(_0xac9a('0x4'));var rp=require(_0xac9a('0x5'));var fs=require('fs');var path=require(_0xac9a('0x6'));var rimraf=require(_0xac9a('0x7'));var config=require(_0xac9a('0x8'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x823b96,_0x5bf014){return _0x823b96['define'](_0xac9a('0x9'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xac9a('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 2b304bb..4861760 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 _0x7ee1=['options','raw','UpdateVoiceDialReport','update','where','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body'];(function(_0x194b25,_0x4bedc4){var _0x107ac5=function(_0x13bcce){while(--_0x13bcce){_0x194b25['push'](_0x194b25['shift']());}};_0x107ac5(++_0x4bedc4);}(_0x7ee1,0xab));var _0x17ee=function(_0x240ad3,_0x3bb1ff){_0x240ad3=_0x240ad3-0x0;var _0x5532e9=_0x7ee1[_0x240ad3];return _0x5532e9;};'use strict';var _=require(_0x17ee('0x0'));var util=require('util');var moment=require(_0x17ee('0x1'));var BPromise=require(_0x17ee('0x2'));var rs=require(_0x17ee('0x3'));var fs=require('fs');var Redis=require(_0x17ee('0x4'));var db=require(_0x17ee('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x17ee('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x17ee('0x7'));var client=jayson[_0x17ee('0x8')][_0x17ee('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e6b4c,_0x28cc37,_0x59b876){return new BPromise(function(_0x314088,_0x59a51e){return client[_0x17ee('0xa')](_0x3e6b4c,_0x59b876)[_0x17ee('0xb')](function(_0x56b583){logger[_0x17ee('0xc')](_0x17ee('0xd'),_0x28cc37,_0x17ee('0xe'));logger[_0x17ee('0xf')](_0x17ee('0x10'),_0x28cc37,_0x17ee('0xe'),JSON[_0x17ee('0x11')](_0x56b583));if(_0x56b583[_0x17ee('0x12')]){if(_0x56b583[_0x17ee('0x12')][_0x17ee('0x13')]===0x1f4){logger[_0x17ee('0x12')](_0x17ee('0xd'),_0x28cc37,_0x56b583['error'][_0x17ee('0x14')]);return _0x59a51e(_0x56b583[_0x17ee('0x12')]['message']);}logger[_0x17ee('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x28cc37,_0x56b583[_0x17ee('0x12')][_0x17ee('0x14')]);return _0x314088(_0x56b583[_0x17ee('0x12')][_0x17ee('0x14')]);}else{logger['info'](_0x17ee('0xd'),_0x28cc37,_0x17ee('0xe'));_0x314088(_0x56b583[_0x17ee('0x15')]['message']);}})[_0x17ee('0x16')](function(_0x47c346){logger[_0x17ee('0x12')](_0x17ee('0xd'),_0x28cc37,_0x47c346);_0x59a51e(_0x47c346);});});}exports[_0x17ee('0x17')]=function(_0x3785ed){var _0x15d245=this;return new Promise(function(_0x5506a3,_0x536c75){return db[_0x17ee('0x18')][_0x17ee('0x19')](_0x3785ed[_0x17ee('0x1a')],{'raw':_0x3785ed[_0x17ee('0x1b')]?_0x3785ed['options'][_0x17ee('0x1c')]===undefined?!![]:![]:!![]})[_0x17ee('0xb')](function(_0x25782c){logger[_0x17ee('0xc')]('CreateVoiceDialReport',_0x3785ed);logger[_0x17ee('0xf')](_0x17ee('0x17'),_0x3785ed,JSON[_0x17ee('0x11')](_0x25782c));_0x5506a3(_0x25782c);})['catch'](function(_0x3672df){logger[_0x17ee('0x12')](_0x17ee('0x17'),_0x3672df[_0x17ee('0x14')],_0x3785ed);_0x536c75(_0x15d245[_0x17ee('0x12')](0x1f4,_0x3672df['message']));});});};exports[_0x17ee('0x1d')]=function(_0xc01da5){var _0xf20fe0=this;return new Promise(function(_0x1ce8c7,_0x88a4af){return db[_0x17ee('0x18')][_0x17ee('0x1e')](_0xc01da5[_0x17ee('0x1a')],{'raw':_0xc01da5['options']?_0xc01da5[_0x17ee('0x1b')][_0x17ee('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc01da5[_0x17ee('0x1b')]?_0xc01da5[_0x17ee('0x1b')][_0x17ee('0x1f')]||null:null,'attributes':_0xc01da5[_0x17ee('0x1b')]?_0xc01da5['options']['attributes']||null:null,'limit':_0xc01da5[_0x17ee('0x1b')]?_0xc01da5[_0x17ee('0x1b')][_0x17ee('0x20')]||null:null})['then'](function(_0x393231){logger[_0x17ee('0xc')](_0x17ee('0x1d'),_0xc01da5);logger['debug'](_0x17ee('0x1d'),_0xc01da5,JSON[_0x17ee('0x11')](_0x393231));_0x1ce8c7(_0x393231);})[_0x17ee('0x16')](function(_0x1e5727){logger['error'](_0x17ee('0x1d'),_0x1e5727[_0x17ee('0x14')],_0xc01da5);_0x88a4af(_0xf20fe0[_0x17ee('0x12')](0x1f4,_0x1e5727['message']));});});}; \ No newline at end of file +var _0xa73a=['catch','create','body','options','raw','debug','CreateVoiceDialReport','UpdateVoiceDialReport','update','where','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x46e2d2,_0x521b98){var _0x1cff4a=function(_0x31a2a3){while(--_0x31a2a3){_0x46e2d2['push'](_0x46e2d2['shift']());}};_0x1cff4a(++_0x521b98);}(_0xa73a,0x82));var _0xaa73=function(_0x880aed,_0x16597b){_0x880aed=_0x880aed-0x0;var _0x40df37=_0xa73a[_0x880aed];return _0x40df37;};'use strict';var _=require('lodash');var util=require(_0xaa73('0x0'));var moment=require(_0xaa73('0x1'));var BPromise=require(_0xaa73('0x2'));var rs=require(_0xaa73('0x3'));var fs=require('fs');var Redis=require(_0xaa73('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xaa73('0x5'));var config=require(_0xaa73('0x6'));var jayson=require(_0xaa73('0x7'));var client=jayson[_0xaa73('0x8')][_0xaa73('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c6837,_0x9ecf94,_0x52dea4){return new BPromise(function(_0x5772ab,_0x3d0e03){return client[_0xaa73('0xa')](_0x3c6837,_0x52dea4)[_0xaa73('0xb')](function(_0x13a31a){logger[_0xaa73('0xc')](_0xaa73('0xd'),_0x9ecf94,'request\x20sent');logger['debug'](_0xaa73('0xe'),_0x9ecf94,'request\x20sent',JSON[_0xaa73('0xf')](_0x13a31a));if(_0x13a31a['error']){if(_0x13a31a[_0xaa73('0x10')][_0xaa73('0x11')]===0x1f4){logger[_0xaa73('0x10')](_0xaa73('0xd'),_0x9ecf94,_0x13a31a[_0xaa73('0x10')][_0xaa73('0x12')]);return _0x3d0e03(_0x13a31a['error'][_0xaa73('0x12')]);}logger[_0xaa73('0x10')](_0xaa73('0xd'),_0x9ecf94,_0x13a31a[_0xaa73('0x10')][_0xaa73('0x12')]);return _0x5772ab(_0x13a31a[_0xaa73('0x10')][_0xaa73('0x12')]);}else{logger[_0xaa73('0xc')](_0xaa73('0xd'),_0x9ecf94,'request\x20sent');_0x5772ab(_0x13a31a[_0xaa73('0x13')]['message']);}})[_0xaa73('0x14')](function(_0x350974){logger[_0xaa73('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x9ecf94,_0x350974);_0x3d0e03(_0x350974);});});}exports['CreateVoiceDialReport']=function(_0x3ce616){var _0x5cc83b=this;return new Promise(function(_0x9ec989,_0x388ded){return db['VoiceDialReport'][_0xaa73('0x15')](_0x3ce616[_0xaa73('0x16')],{'raw':_0x3ce616[_0xaa73('0x17')]?_0x3ce616[_0xaa73('0x17')][_0xaa73('0x18')]===undefined?!![]:![]:!![]})[_0xaa73('0xb')](function(_0x4de045){logger[_0xaa73('0xc')]('CreateVoiceDialReport',_0x3ce616);logger[_0xaa73('0x19')](_0xaa73('0x1a'),_0x3ce616,JSON[_0xaa73('0xf')](_0x4de045));_0x9ec989(_0x4de045);})[_0xaa73('0x14')](function(_0x53b746){logger['error'](_0xaa73('0x1a'),_0x53b746[_0xaa73('0x12')],_0x3ce616);_0x388ded(_0x5cc83b[_0xaa73('0x10')](0x1f4,_0x53b746[_0xaa73('0x12')]));});});};exports[_0xaa73('0x1b')]=function(_0x482795){var _0x233764=this;return new Promise(function(_0x2809fc,_0x24f853){return db['VoiceDialReport'][_0xaa73('0x1c')](_0x482795[_0xaa73('0x16')],{'raw':_0x482795[_0xaa73('0x17')]?_0x482795[_0xaa73('0x17')][_0xaa73('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x482795[_0xaa73('0x17')]?_0x482795[_0xaa73('0x17')][_0xaa73('0x1d')]||null:null,'attributes':_0x482795['options']?_0x482795['options']['attributes']||null:null,'limit':_0x482795[_0xaa73('0x17')]?_0x482795['options']['limit']||null:null})['then'](function(_0x7b7f86){logger[_0xaa73('0xc')]('UpdateVoiceDialReport',_0x482795);logger['debug']('UpdateVoiceDialReport',_0x482795,JSON[_0xaa73('0xf')](_0x7b7f86));_0x2809fc(_0x7b7f86);})[_0xaa73('0x14')](function(_0x4a53e9){logger[_0xaa73('0x10')]('UpdateVoiceDialReport',_0x4a53e9[_0xaa73('0x12')],_0x482795);_0x24f853(_0x233764['error'](0x1f4,_0x4a53e9[_0xaa73('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 3366fc5..3b8ba74 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 _0xf0f4=['addApplications','put','/:id','delete','destroy','exports','util','express','Router','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','show','post','create','/:id/applications'];(function(_0x348eab,_0x4c540b){var _0x595611=function(_0xacca5d){while(--_0xacca5d){_0x348eab['push'](_0x348eab['shift']());}};_0x595611(++_0x4c540b);}(_0xf0f4,0x182));var _0x4f0f=function(_0x5bbb68,_0x232b4c){_0x5bbb68=_0x5bbb68-0x0;var _0x4a8ea2=_0xf0f4[_0x5bbb68];return _0x4a8ea2;};'use strict';var multer=require('multer');var util=require(_0x4f0f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4f0f('0x1'));var router=express[_0x4f0f('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x4f0f('0x3'));var config=require(_0x4f0f('0x4'));var controller=require(_0x4f0f('0x5'));router[_0x4f0f('0x6')]('/',auth[_0x4f0f('0x7')](),controller[_0x4f0f('0x8')]);router[_0x4f0f('0x6')]('/:id',auth[_0x4f0f('0x7')](),controller[_0x4f0f('0x9')]);router[_0x4f0f('0xa')]('/',auth['isAuthenticated'](),controller[_0x4f0f('0xb')]);router[_0x4f0f('0xa')](_0x4f0f('0xc'),auth[_0x4f0f('0x7')](),controller[_0x4f0f('0xd')]);router[_0x4f0f('0xe')](_0x4f0f('0xf'),auth[_0x4f0f('0x7')](),controller['update']);router[_0x4f0f('0x10')](_0x4f0f('0xf'),auth[_0x4f0f('0x7')](),controller[_0x4f0f('0x11')]);module[_0x4f0f('0x12')]=router; \ No newline at end of file +var _0x36cd=['get','isAuthenticated','/:id','show','post','create','/:id/applications','put','delete','destroy','exports','util','express','Router','../../components/auth/service','../../config/environment','./voiceExtension.controller'];(function(_0x3986fc,_0x41fd49){var _0x514bd1=function(_0x4f038f){while(--_0x4f038f){_0x3986fc['push'](_0x3986fc['shift']());}};_0x514bd1(++_0x41fd49);}(_0x36cd,0x1a3));var _0xd36c=function(_0x20156c,_0x12e1ff){_0x20156c=_0x20156c-0x0;var _0x4cb19a=_0x36cd[_0x20156c];return _0x4cb19a;};'use strict';var multer=require('multer');var util=require(_0xd36c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd36c('0x1'));var router=express[_0xd36c('0x2')]();var auth=require(_0xd36c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd36c('0x4'));var controller=require(_0xd36c('0x5'));router[_0xd36c('0x6')]('/',auth[_0xd36c('0x7')](),controller['index']);router[_0xd36c('0x6')](_0xd36c('0x8'),auth[_0xd36c('0x7')](),controller[_0xd36c('0x9')]);router[_0xd36c('0xa')]('/',auth['isAuthenticated'](),controller[_0xd36c('0xb')]);router[_0xd36c('0xa')](_0xd36c('0xc'),auth[_0xd36c('0x7')](),controller['addApplications']);router[_0xd36c('0xd')]('/:id',auth[_0xd36c('0x7')](),controller['update']);router[_0xd36c('0xe')](_0xd36c('0x8'),auth[_0xd36c('0x7')](),controller[_0xd36c('0xf')]);module[_0xd36c('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 1ecefbb..65aba3b 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(_0x9ba35c,_0x48affd){var _0x26b4d1=function(_0x60171f){while(--_0x60171f){_0x9ba35c['push'](_0x9ba35c['shift']());}};_0x26b4d1(++_0x48affd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x8cc8b3,_0x2adbd9){var _0x295b74=function(_0x203812){while(--_0x203812){_0x8cc8b3['push'](_0x8cc8b3['shift']());}};_0x295b74(++_0x2adbd9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 1768d0c..f1b53cc 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 _0x47b3=['user','InboundRoutes','InternalRoutes','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','exten','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','findOne','VoiceExtensionId','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','get','inbound','OutboundRoutes','outbound','internal','ignore','map','value','includes','find','type','name','UserProfileResource','error','stack','index','VoiceExtension','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','includeAll','params','create','startsWith','body','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x24d06a,_0x59c850){var _0x4a987d=function(_0x3bd772){while(--_0x3bd772){_0x24d06a['push'](_0x24d06a['shift']());}};_0x4a987d(++_0x59c850);}(_0x47b3,0x153));var _0x347b=function(_0x350bd8,_0x498e58){_0x350bd8=_0x350bd8-0x0;var _0x1275ea=_0x47b3[_0x350bd8];return _0x1275ea;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x347b('0x0'));var rimraf=require(_0x347b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x347b('0x2'));var moment=require('moment');var BPromise=require(_0x347b('0x3'));var Mustache=require(_0x347b('0x4'));var util=require('util');var path=require(_0x347b('0x5'));var sox=require(_0x347b('0x6'));var csv=require(_0x347b('0x7'));var ejs=require(_0x347b('0x8'));var fs=require('fs');var _=require(_0x347b('0x9'));var squel=require(_0x347b('0xa'));var crypto=require(_0x347b('0xb'));var jsforce=require(_0x347b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x347b('0x7'));var querystring=require(_0x347b('0xd'));var Papa=require(_0x347b('0xe'));var Redis=require(_0x347b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x347b('0x10'));var as=require(_0x347b('0x11'));var hardwareService=require(_0x347b('0x12'));var logger=require(_0x347b('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x347b('0x14'));var db=require(_0x347b('0x15'))['db'];config[_0x347b('0x16')]=_[_0x347b('0x17')](config[_0x347b('0x16')],{'host':_0x347b('0x18'),'port':0x18eb});var socket=require(_0x347b('0x19'))(new Redis(config[_0x347b('0x16')]));require('./voiceExtension.socket')[_0x347b('0x1a')](socket);function respondWithStatusCode(_0x41c47f,_0x5a6262){_0x5a6262=_0x5a6262||0xcc;return function(_0x3e883f){if(_0x3e883f){return _0x41c47f[_0x347b('0x1b')](_0x5a6262);}return _0x41c47f[_0x347b('0x1c')](_0x5a6262)[_0x347b('0x1d')]();};}function respondWithResult(_0x47f141,_0x548128){_0x548128=_0x548128||0xc8;return function(_0x10bccf){if(_0x10bccf){return _0x47f141[_0x347b('0x1c')](_0x548128)['json'](_0x10bccf);}};}function respondWithFilteredResult(_0x2fe740,_0x20fb8d){return function(_0x511bbc){if(_0x511bbc){var _0x253b8f=_0x511bbc['count'],_0x411c5e=_0x20fb8d[_0x347b('0x1e')],_0x27deb7=_0x20fb8d['offset']+_0x20fb8d[_0x347b('0x1f')],_0x1307f4;if(_0x27deb7>=_0x253b8f){_0x27deb7=_0x253b8f;_0x1307f4=0xc8;}else{_0x1307f4=0xce;}_0x2fe740[_0x347b('0x1c')](_0x1307f4);return _0x2fe740[_0x347b('0x20')](_0x347b('0x21'),_0x411c5e+'-'+_0x27deb7+'/'+_0x253b8f)[_0x347b('0x22')](_0x511bbc);}return null;};}function patchUpdates(_0x15612c){return function(_0xd022bc){try{jsonpatch[_0x347b('0x23')](_0xd022bc,_0x15612c,!![]);}catch(_0x466901){return BPromise['reject'](_0x466901);}return _0xd022bc[_0x347b('0x24')]();};}function saveUpdates(_0x889167,_0x369388){return function(_0x344a99){if(_0x344a99){return _0x344a99[_0x347b('0x25')](_0x889167)[_0x347b('0x26')](function(_0x42ce31){return _0x42ce31;});}return null;};}function removeEntity(_0x3ed257,_0x13da84){return function(_0x29b6a6){if(_0x29b6a6){return _0x29b6a6[_0x347b('0x27')]()[_0x347b('0x26')](function(){var _0x5c5cf8=_0x29b6a6[_0x347b('0x28')]({'plain':!![]});var _0x3b6f16=[{'name':'InboundRoutes','value':_0x347b('0x29'),'ignore':![]},{'name':_0x347b('0x2a'),'value':_0x347b('0x2b'),'ignore':![]},{'name':'InternalRoutes','value':_0x347b('0x2c'),'ignore':![]}];var _0x37e886=_(_0x3b6f16)['filter'](_0x347b('0x2d'))[_0x347b('0x2e')]('value')[_0x347b('0x2f')]();if(_[_0x347b('0x30')](_0x37e886,_0x5c5cf8['type'])){return;}var _0x21ee0a=_[_0x347b('0x31')](_0x3b6f16,[_0x347b('0x2f'),_0x5c5cf8[_0x347b('0x32')]])[_0x347b('0x33')];return db[_0x347b('0x34')][_0x347b('0x27')]({'where':{'type':_0x21ee0a,'resourceId':_0x5c5cf8['id']}})['then'](function(){return _0x29b6a6;});})[_0x347b('0x26')](function(){_0x3ed257[_0x347b('0x1c')](0xcc)[_0x347b('0x1d')]();});}};}function handleEntityNotFound(_0xdce3b6,_0x37f984){return function(_0x3da046){if(!_0x3da046){_0xdce3b6[_0x347b('0x1b')](0x194);}return _0x3da046;};}function handleError(_0x8653a,_0x25ba1f){_0x25ba1f=_0x25ba1f||0x1f4;return function(_0x4fc0b1){logger[_0x347b('0x35')](_0x4fc0b1[_0x347b('0x36')]);if(_0x4fc0b1[_0x347b('0x33')]){delete _0x4fc0b1['name'];}_0x8653a[_0x347b('0x1c')](_0x25ba1f)['send'](_0x4fc0b1);};}exports[_0x347b('0x37')]=function(_0x4b6dc4,_0x5a2948){var _0x2d1e0c={},_0x386cb0={},_0x5073b6={'count':0x0,'rows':[]};var _0x5d0cfd=_[_0x347b('0x2e')](db[_0x347b('0x38')][_0x347b('0x39')],function(_0x2086d9){return{'name':_0x2086d9[_0x347b('0x3a')],'type':_0x2086d9[_0x347b('0x32')]['key']};});_0x386cb0['model']=_[_0x347b('0x2e')](_0x5d0cfd,'name');_0x386cb0[_0x347b('0x3b')]=_[_0x347b('0x3c')](_0x4b6dc4['query']);_0x386cb0[_0x347b('0x3d')]=_[_0x347b('0x3e')](_0x386cb0[_0x347b('0x3f')],_0x386cb0['query']);_0x2d1e0c[_0x347b('0x40')]=_[_0x347b('0x3e')](_0x386cb0[_0x347b('0x3f')],qs[_0x347b('0x41')](_0x4b6dc4[_0x347b('0x3b')][_0x347b('0x41')]));_0x2d1e0c[_0x347b('0x40')]=_0x2d1e0c[_0x347b('0x40')][_0x347b('0x42')]?_0x2d1e0c[_0x347b('0x40')]:_0x386cb0['model'];if(!_0x4b6dc4[_0x347b('0x3b')][_0x347b('0x43')]('nolimit')){_0x2d1e0c['limit']=qs[_0x347b('0x1f')](_0x4b6dc4[_0x347b('0x3b')][_0x347b('0x1f')]);_0x2d1e0c['offset']=qs[_0x347b('0x1e')](_0x4b6dc4['query'][_0x347b('0x1e')]);}_0x2d1e0c[_0x347b('0x44')]=qs[_0x347b('0x45')](_0x4b6dc4[_0x347b('0x3b')]['sort']);_0x2d1e0c[_0x347b('0x46')]=qs[_0x347b('0x3d')](_[_0x347b('0x47')](_0x4b6dc4['query'],_0x386cb0[_0x347b('0x3d')]));if(_0x4b6dc4[_0x347b('0x3b')][_0x347b('0x48')]){_0x2d1e0c[_0x347b('0x46')]=_[_0x347b('0x49')](_0x2d1e0c[_0x347b('0x46')],{'$or':_['map'](_0x5d0cfd,function(_0x2f7463){if(_0x2f7463[_0x347b('0x32')]!==_0x347b('0x4a')){var _0x449601={};_0x449601[_0x2f7463[_0x347b('0x33')]]={'$like':'%'+_0x4b6dc4[_0x347b('0x3b')]['filter']+'%'};return _0x449601;}})});}_0x2d1e0c=_[_0x347b('0x49')]({},_0x2d1e0c,_0x4b6dc4[_0x347b('0x4b')]);var _0x3bb4db={'where':_0x2d1e0c[_0x347b('0x46')]};return db[_0x347b('0x38')][_0x347b('0x4c')](_0x3bb4db)['then'](function(_0x15b616){_0x5073b6[_0x347b('0x4c')]=_0x15b616;if(_0x4b6dc4[_0x347b('0x3b')]['includeAll']){_0x2d1e0c[_0x347b('0x4d')]=[{'all':!![]}];}return db[_0x347b('0x38')][_0x347b('0x4e')](_0x2d1e0c);})[_0x347b('0x26')](function(_0x4943ff){_0x5073b6[_0x347b('0x4f')]=_0x4943ff;return _0x5073b6;})['then'](respondWithFilteredResult(_0x5a2948,_0x2d1e0c))[_0x347b('0x50')](handleError(_0x5a2948,null));};exports[_0x347b('0x51')]=function(_0x401c47,_0x4a38c8){var _0x4a44b3={'raw':![],'where':{'id':_0x401c47['params']['id']}},_0x2a506f={};_0x2a506f[_0x347b('0x3f')]=_[_0x347b('0x3c')](db[_0x347b('0x38')]['rawAttributes']);_0x2a506f[_0x347b('0x3b')]=_['keys'](_0x401c47['query']);_0x2a506f['filters']=_[_0x347b('0x3e')](_0x2a506f['model'],_0x2a506f[_0x347b('0x3b')]);_0x4a44b3['attributes']=_[_0x347b('0x3e')](_0x2a506f[_0x347b('0x3f')],qs[_0x347b('0x41')](_0x401c47['query'][_0x347b('0x41')]));_0x4a44b3['attributes']=_0x4a44b3['attributes']['length']?_0x4a44b3[_0x347b('0x40')]:_0x2a506f[_0x347b('0x3f')];if(_0x401c47[_0x347b('0x3b')][_0x347b('0x52')]){_0x4a44b3['include']=[{'all':!![]}];}_0x4a44b3=_[_0x347b('0x49')]({},_0x4a44b3,_0x401c47[_0x347b('0x4b')]);return db[_0x347b('0x38')]['find'](_0x4a44b3)[_0x347b('0x26')](handleEntityNotFound(_0x4a38c8,null))[_0x347b('0x26')](respondWithResult(_0x4a38c8,null))['catch'](handleError(_0x4a38c8,null));};exports[_0x347b('0x27')]=function(_0x2dc6ec,_0x31f562){return db[_0x347b('0x38')][_0x347b('0x31')]({'where':{'id':_0x2dc6ec[_0x347b('0x53')]['id']}})[_0x347b('0x26')](handleEntityNotFound(_0x31f562,null))['then'](removeEntity(_0x31f562,null))[_0x347b('0x50')](handleError(_0x31f562,null));};exports[_0x347b('0x54')]=function(_0x42c821,_0x104763){if(_0x42c821['body'][_0x347b('0x32')]==='outbound'&&!_[_0x347b('0x55')](_0x42c821[_0x347b('0x56')]['exten'],'_')){_0x42c821[_0x347b('0x56')]['exten']='_'[_0x347b('0x57')](_0x42c821['body']['exten']);}return db[_0x347b('0x38')][_0x347b('0x54')](_0x42c821[_0x347b('0x56')],{'raw':![]})[_0x347b('0x26')](function(_0x511c1a){var _0x5ec35d=_0x42c821['user']['get']({'plain':!![]});if(!_0x5ec35d)throw new Error(_0x347b('0x58'));if(_0x5ec35d['role']===_0x347b('0x59')){var _0x198851=_0x511c1a[_0x347b('0x28')]({'plain':!![]});var _0x274ea0=[{'name':_0x347b('0x5a'),'value':_0x347b('0x29')},{'name':_0x347b('0x2a'),'value':_0x347b('0x2b')},{'name':_0x347b('0x5b'),'value':'internal'}];var _0x1cdb19=_[_0x347b('0x31')](_0x274ea0,['value',_0x198851[_0x347b('0x32')]])[_0x347b('0x33')];return db[_0x347b('0x5c')]['find']({'where':{'name':_0x1cdb19,'userProfileId':_0x5ec35d[_0x347b('0x5d')]},'raw':!![]})[_0x347b('0x26')](function(_0x23ae2c){if(_0x23ae2c&&_0x23ae2c[_0x347b('0x5e')]===0x0){return db[_0x347b('0x34')]['create']({'name':_0x198851[_0x347b('0x33')],'resourceId':_0x198851['id'],'type':_0x23ae2c['name'],'sectionId':_0x23ae2c['id']},{})[_0x347b('0x26')](function(){return _0x511c1a;});}else{return _0x511c1a;}})[_0x347b('0x50')](function(_0x390854){logger[_0x347b('0x35')](_0x347b('0x5f'),_0x390854);throw _0x390854;});}return _0x511c1a;})[_0x347b('0x26')](respondWithResult(_0x104763,0xc9))[_0x347b('0x50')](handleError(_0x104763,null));};exports[_0x347b('0x25')]=function(_0xb96808,_0x1ea7d1){if(_0xb96808[_0x347b('0x56')]['id']){delete _0xb96808[_0x347b('0x56')]['id'];}return db[_0x347b('0x38')]['find']({'where':{'id':_0xb96808[_0x347b('0x53')]['id']}})[_0x347b('0x26')](handleEntityNotFound(_0x1ea7d1,null))['then'](function(_0x3e2cc5){if(_0x3e2cc5){return db[_0x347b('0x38')]['update'](_[_0x347b('0x47')](_0xb96808[_0x347b('0x56')],[_0x347b('0x60'),_0x347b('0x61'),_0x347b('0x62'),_0x347b('0x63'),_0x347b('0x64'),_0x347b('0x65')]),{'where':{'context':_0x3e2cc5[_0x347b('0x61')],'exten':_0x3e2cc5[_0x347b('0x60')]},'individualHooks':!![]})[_0x347b('0x26')](function(_0x3066a6){return _0x3066a6;});}return null;})[_0x347b('0x26')](respondWithStatusCode(_0x1ea7d1,null))[_0x347b('0x50')](handleError(_0x1ea7d1,null));};exports[_0x347b('0x66')]=function(_0xf7e107,_0x361b55,_0x24159d){return db[_0x347b('0x38')][_0x347b('0x67')]({'where':{'id':_0xf7e107[_0x347b('0x53')]['id']}})['then'](handleEntityNotFound(_0x361b55,null))[_0x347b('0x26')](function(_0x173e27){if(_0x173e27){return db['sequelize']['transaction'](function(_0x934db2){return db[_0x347b('0x38')][_0x347b('0x27')]({'where':{'VoiceExtensionId':_0xf7e107[_0x347b('0x53')]['id']},'transaction':_0x934db2})[_0x347b('0x26')](function(_0x516bbf){var _0x4977d0=_['map'](_0xf7e107[_0x347b('0x56')],function(_0x5c61c7){_0x5c61c7[_0x347b('0x68')]=_0xf7e107['params']['id'];return _0x5c61c7;});return db[_0x347b('0x38')]['bulkCreate'](_0x4977d0,{'transaction':_0x934db2});});})['then'](function(){return db[_0x347b('0x38')][_0x347b('0x69')]({'where':{'isApp':!![],'VoiceExtensionId':_0xf7e107[_0x347b('0x53')]['id']},'order':_0x347b('0x6a')});});}})['then'](respondWithResult(_0x361b55,null))[_0x347b('0x50')](handleError(_0x361b55,null));}; \ No newline at end of file +var _0x799a=['count','offset','limit','set','reject','save','update','then','destroy','InboundRoutes','inbound','InternalRoutes','internal','filter','map','value','find','name','UserProfileResource','error','stack','VoiceExtension','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','options','includeAll','include','findAll','rows','catch','show','params','keys','create','startsWith','body','exten','concat','user','get','role','outbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','mandatoryDisposition','sequelize','transaction','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','zip-dir','fast-json-patch','request-promise','moment','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/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','sendStatus','status','end','json'];(function(_0x5f2f5d,_0x2acb71){var _0x38acbb=function(_0x4aa0f6){while(--_0x4aa0f6){_0x5f2f5d['push'](_0x5f2f5d['shift']());}};_0x38acbb(++_0x2acb71);}(_0x799a,0xa6));var _0xa799=function(_0x307100,_0x51b164){_0x307100=_0x307100-0x0;var _0x33675e=_0x799a[_0x307100];return _0x33675e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa799('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa799('0x1'));var jsonpatch=require(_0xa799('0x2'));var rp=require(_0xa799('0x3'));var moment=require(_0xa799('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa799('0x5'));var util=require('util');var path=require(_0xa799('0x6'));var sox=require('sox');var csv=require(_0xa799('0x7'));var ejs=require(_0xa799('0x8'));var fs=require('fs');var _=require(_0xa799('0x9'));var squel=require(_0xa799('0xa'));var crypto=require(_0xa799('0xb'));var jsforce=require(_0xa799('0xc'));var deskjs=require(_0xa799('0xd'));var toCsv=require(_0xa799('0x7'));var querystring=require(_0xa799('0xe'));var Papa=require(_0xa799('0xf'));var Redis=require('ioredis');var authService=require(_0xa799('0x10'));var qs=require(_0xa799('0x11'));var as=require(_0xa799('0x12'));var hardwareService=require(_0xa799('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xa799('0x14'));var config=require(_0xa799('0x15'));var db=require(_0xa799('0x16'))['db'];config[_0xa799('0x17')]=_[_0xa799('0x18')](config[_0xa799('0x17')],{'host':_0xa799('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa799('0x17')]));require('./voiceExtension.socket')['register'](socket);function respondWithStatusCode(_0xb41ac4,_0x212292){_0x212292=_0x212292||0xcc;return function(_0x52db58){if(_0x52db58){return _0xb41ac4[_0xa799('0x1a')](_0x212292);}return _0xb41ac4[_0xa799('0x1b')](_0x212292)[_0xa799('0x1c')]();};}function respondWithResult(_0x346b35,_0xbc8d51){_0xbc8d51=_0xbc8d51||0xc8;return function(_0x53acc1){if(_0x53acc1){return _0x346b35[_0xa799('0x1b')](_0xbc8d51)[_0xa799('0x1d')](_0x53acc1);}};}function respondWithFilteredResult(_0x2416e7,_0x26bedc){return function(_0x44dec2){if(_0x44dec2){var _0x212b44=_0x44dec2[_0xa799('0x1e')],_0x5226bc=_0x26bedc['offset'],_0x5498ce=_0x26bedc[_0xa799('0x1f')]+_0x26bedc[_0xa799('0x20')],_0x2567ff;if(_0x5498ce>=_0x212b44){_0x5498ce=_0x212b44;_0x2567ff=0xc8;}else{_0x2567ff=0xce;}_0x2416e7[_0xa799('0x1b')](_0x2567ff);return _0x2416e7[_0xa799('0x21')]('Content-Range',_0x5226bc+'-'+_0x5498ce+'/'+_0x212b44)[_0xa799('0x1d')](_0x44dec2);}return null;};}function patchUpdates(_0x3c5de1){return function(_0x2c937b){try{jsonpatch['apply'](_0x2c937b,_0x3c5de1,!![]);}catch(_0xebe2b6){return BPromise[_0xa799('0x22')](_0xebe2b6);}return _0x2c937b[_0xa799('0x23')]();};}function saveUpdates(_0x4563af,_0x149b96){return function(_0x1a9cca){if(_0x1a9cca){return _0x1a9cca[_0xa799('0x24')](_0x4563af)[_0xa799('0x25')](function(_0xa44565){return _0xa44565;});}return null;};}function removeEntity(_0x436816,_0x5c9974){return function(_0x3046d1){if(_0x3046d1){return _0x3046d1[_0xa799('0x26')]()['then'](function(){var _0x2a4bde=_0x3046d1['get']({'plain':!![]});var _0x192cc1=[{'name':_0xa799('0x27'),'value':_0xa799('0x28'),'ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':_0xa799('0x29'),'value':_0xa799('0x2a'),'ignore':![]}];var _0x2af8f1=_(_0x192cc1)[_0xa799('0x2b')]('ignore')[_0xa799('0x2c')](_0xa799('0x2d'))['value']();if(_['includes'](_0x2af8f1,_0x2a4bde['type'])){return;}var _0x185553=_[_0xa799('0x2e')](_0x192cc1,['value',_0x2a4bde['type']])[_0xa799('0x2f')];return db[_0xa799('0x30')]['destroy']({'where':{'type':_0x185553,'resourceId':_0x2a4bde['id']}})[_0xa799('0x25')](function(){return _0x3046d1;});})[_0xa799('0x25')](function(){_0x436816[_0xa799('0x1b')](0xcc)[_0xa799('0x1c')]();});}};}function handleEntityNotFound(_0x2e402c,_0x12c2e0){return function(_0x99f4c3){if(!_0x99f4c3){_0x2e402c[_0xa799('0x1a')](0x194);}return _0x99f4c3;};}function handleError(_0x3211f1,_0x430584){_0x430584=_0x430584||0x1f4;return function(_0x55bd39){logger[_0xa799('0x31')](_0x55bd39[_0xa799('0x32')]);if(_0x55bd39['name']){delete _0x55bd39[_0xa799('0x2f')];}_0x3211f1['status'](_0x430584)['send'](_0x55bd39);};}exports['index']=function(_0x267b28,_0x4bfaef){var _0x1d0037={},_0x100d50={},_0x1b4824={'count':0x0,'rows':[]};var _0x202f5e=_[_0xa799('0x2c')](db[_0xa799('0x33')][_0xa799('0x34')],function(_0x3fdc62){return{'name':_0x3fdc62[_0xa799('0x35')],'type':_0x3fdc62['type']['key']};});_0x100d50[_0xa799('0x36')]=_[_0xa799('0x2c')](_0x202f5e,_0xa799('0x2f'));_0x100d50[_0xa799('0x37')]=_['keys'](_0x267b28[_0xa799('0x37')]);_0x100d50[_0xa799('0x38')]=_[_0xa799('0x39')](_0x100d50[_0xa799('0x36')],_0x100d50[_0xa799('0x37')]);_0x1d0037['attributes']=_[_0xa799('0x39')](_0x100d50[_0xa799('0x36')],qs[_0xa799('0x3a')](_0x267b28['query']['fields']));_0x1d0037[_0xa799('0x3b')]=_0x1d0037['attributes'][_0xa799('0x3c')]?_0x1d0037[_0xa799('0x3b')]:_0x100d50[_0xa799('0x36')];if(!_0x267b28[_0xa799('0x37')][_0xa799('0x3d')](_0xa799('0x3e'))){_0x1d0037['limit']=qs['limit'](_0x267b28[_0xa799('0x37')][_0xa799('0x20')]);_0x1d0037[_0xa799('0x1f')]=qs['offset'](_0x267b28[_0xa799('0x37')][_0xa799('0x1f')]);}_0x1d0037['order']=qs[_0xa799('0x3f')](_0x267b28[_0xa799('0x37')][_0xa799('0x3f')]);_0x1d0037[_0xa799('0x40')]=qs[_0xa799('0x38')](_[_0xa799('0x41')](_0x267b28['query'],_0x100d50['filters']));if(_0x267b28['query']['filter']){_0x1d0037[_0xa799('0x40')]=_[_0xa799('0x42')](_0x1d0037['where'],{'$or':_[_0xa799('0x2c')](_0x202f5e,function(_0x352b9c){if(_0x352b9c[_0xa799('0x43')]!=='VIRTUAL'){var _0x330c55={};_0x330c55[_0x352b9c['name']]={'$like':'%'+_0x267b28[_0xa799('0x37')][_0xa799('0x2b')]+'%'};return _0x330c55;}})});}_0x1d0037=_[_0xa799('0x42')]({},_0x1d0037,_0x267b28[_0xa799('0x44')]);var _0x205bee={'where':_0x1d0037[_0xa799('0x40')]};return db[_0xa799('0x33')][_0xa799('0x1e')](_0x205bee)[_0xa799('0x25')](function(_0x3a1321){_0x1b4824[_0xa799('0x1e')]=_0x3a1321;if(_0x267b28[_0xa799('0x37')][_0xa799('0x45')]){_0x1d0037[_0xa799('0x46')]=[{'all':!![]}];}return db['VoiceExtension'][_0xa799('0x47')](_0x1d0037);})['then'](function(_0x3df8dd){_0x1b4824[_0xa799('0x48')]=_0x3df8dd;return _0x1b4824;})[_0xa799('0x25')](respondWithFilteredResult(_0x4bfaef,_0x1d0037))[_0xa799('0x49')](handleError(_0x4bfaef,null));};exports[_0xa799('0x4a')]=function(_0x4a157b,_0x2cb6ed){var _0x461bbe={'raw':![],'where':{'id':_0x4a157b[_0xa799('0x4b')]['id']}},_0x3fcad2={};_0x3fcad2[_0xa799('0x36')]=_[_0xa799('0x4c')](db[_0xa799('0x33')][_0xa799('0x34')]);_0x3fcad2[_0xa799('0x37')]=_[_0xa799('0x4c')](_0x4a157b[_0xa799('0x37')]);_0x3fcad2[_0xa799('0x38')]=_[_0xa799('0x39')](_0x3fcad2['model'],_0x3fcad2[_0xa799('0x37')]);_0x461bbe[_0xa799('0x3b')]=_[_0xa799('0x39')](_0x3fcad2[_0xa799('0x36')],qs[_0xa799('0x3a')](_0x4a157b[_0xa799('0x37')][_0xa799('0x3a')]));_0x461bbe[_0xa799('0x3b')]=_0x461bbe[_0xa799('0x3b')][_0xa799('0x3c')]?_0x461bbe[_0xa799('0x3b')]:_0x3fcad2[_0xa799('0x36')];if(_0x4a157b[_0xa799('0x37')]['includeAll']){_0x461bbe[_0xa799('0x46')]=[{'all':!![]}];}_0x461bbe=_['merge']({},_0x461bbe,_0x4a157b['options']);return db['VoiceExtension'][_0xa799('0x2e')](_0x461bbe)[_0xa799('0x25')](handleEntityNotFound(_0x2cb6ed,null))[_0xa799('0x25')](respondWithResult(_0x2cb6ed,null))[_0xa799('0x49')](handleError(_0x2cb6ed,null));};exports['destroy']=function(_0xd897c1,_0x41c1b6){return db[_0xa799('0x33')][_0xa799('0x2e')]({'where':{'id':_0xd897c1[_0xa799('0x4b')]['id']}})[_0xa799('0x25')](handleEntityNotFound(_0x41c1b6,null))[_0xa799('0x25')](removeEntity(_0x41c1b6,null))['catch'](handleError(_0x41c1b6,null));};exports[_0xa799('0x4d')]=function(_0x315338,_0x37b650){if(_0x315338['body'][_0xa799('0x43')]==='outbound'&&!_[_0xa799('0x4e')](_0x315338[_0xa799('0x4f')][_0xa799('0x50')],'_')){_0x315338[_0xa799('0x4f')][_0xa799('0x50')]='_'[_0xa799('0x51')](_0x315338['body'][_0xa799('0x50')]);}return db[_0xa799('0x33')][_0xa799('0x4d')](_0x315338[_0xa799('0x4f')],{'raw':![]})[_0xa799('0x25')](function(_0x48334f){var _0x418d09=_0x315338[_0xa799('0x52')][_0xa799('0x53')]({'plain':!![]});if(!_0x418d09)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x418d09[_0xa799('0x54')]==='user'){var _0xe4ac9f=_0x48334f[_0xa799('0x53')]({'plain':!![]});var _0xc44ed8=[{'name':_0xa799('0x27'),'value':'inbound'},{'name':'OutboundRoutes','value':_0xa799('0x55')},{'name':_0xa799('0x29'),'value':_0xa799('0x2a')}];var _0x35a3a1=_[_0xa799('0x2e')](_0xc44ed8,[_0xa799('0x2d'),_0xe4ac9f[_0xa799('0x43')]])['name'];return db[_0xa799('0x56')][_0xa799('0x2e')]({'where':{'name':_0x35a3a1,'userProfileId':_0x418d09[_0xa799('0x57')]},'raw':!![]})[_0xa799('0x25')](function(_0x1add09){if(_0x1add09&&_0x1add09[_0xa799('0x58')]===0x0){return db[_0xa799('0x30')][_0xa799('0x4d')]({'name':_0xe4ac9f['name'],'resourceId':_0xe4ac9f['id'],'type':_0x1add09[_0xa799('0x2f')],'sectionId':_0x1add09['id']},{})['then'](function(){return _0x48334f;});}else{return _0x48334f;}})['catch'](function(_0x432a9f){logger[_0xa799('0x31')](_0xa799('0x59'),_0x432a9f);throw _0x432a9f;});}return _0x48334f;})['then'](respondWithResult(_0x37b650,0xc9))['catch'](handleError(_0x37b650,null));};exports[_0xa799('0x24')]=function(_0x4354f5,_0x42f1d0){if(_0x4354f5[_0xa799('0x4f')]['id']){delete _0x4354f5[_0xa799('0x4f')]['id'];}return db[_0xa799('0x33')]['find']({'where':{'id':_0x4354f5['params']['id']}})['then'](handleEntityNotFound(_0x42f1d0,null))[_0xa799('0x25')](function(_0x15bc14){if(_0x15bc14){return db['VoiceExtension']['update'](_[_0xa799('0x41')](_0x4354f5[_0xa799('0x4f')],['exten',_0xa799('0x5a'),_0xa799('0x5b'),'recordingFormat','cutdigits',_0xa799('0x5c')]),{'where':{'context':_0x15bc14[_0xa799('0x5a')],'exten':_0x15bc14['exten']},'individualHooks':!![]})[_0xa799('0x25')](function(_0x5e3510){return _0x5e3510;});}return null;})['then'](respondWithStatusCode(_0x42f1d0,null))['catch'](handleError(_0x42f1d0,null));};exports['addApplications']=function(_0x2fb2a4,_0x2623be,_0x1ad7e9){return db[_0xa799('0x33')]['findOne']({'where':{'id':_0x2fb2a4['params']['id']}})[_0xa799('0x25')](handleEntityNotFound(_0x2623be,null))['then'](function(_0x3b8d35){if(_0x3b8d35){return db[_0xa799('0x5d')][_0xa799('0x5e')](function(_0x2acaa4){return db[_0xa799('0x33')][_0xa799('0x26')]({'where':{'VoiceExtensionId':_0x2fb2a4[_0xa799('0x4b')]['id']},'transaction':_0x2acaa4})[_0xa799('0x25')](function(_0x23a9a9){var _0x264613=_[_0xa799('0x2c')](_0x2fb2a4[_0xa799('0x4f')],function(_0x250613){_0x250613['VoiceExtensionId']=_0x2fb2a4['params']['id'];return _0x250613;});return db[_0xa799('0x33')][_0xa799('0x5f')](_0x264613,{'transaction':_0x2acaa4});});})[_0xa799('0x25')](function(){return db[_0xa799('0x33')][_0xa799('0x60')]({'where':{'isApp':!![],'VoiceExtensionId':_0x2fb2a4['params']['id']},'order':_0xa799('0x61')});});}})[_0xa799('0x25')](respondWithResult(_0x2623be,null))['catch'](handleError(_0x2623be,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 2f94c58..99e7933 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 _0xc67b=['update','remove','emit','hasOwnProperty','hook','exports','events','VoiceExtension','setMaxListeners','save'];(function(_0x1a525a,_0x2c1f8f){var _0x48b700=function(_0x5f0f12){while(--_0x5f0f12){_0x1a525a['push'](_0x1a525a['shift']());}};_0x48b700(++_0x2c1f8f);}(_0xc67b,0x178));var _0xbc67=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc67b[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xbc67('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xbc67('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xbc67('0x2')](0x0);var events={'afterCreate':_0xbc67('0x3'),'afterUpdate':_0xbc67('0x4'),'afterDestroy':_0xbc67('0x5')};function emitEvent(_0x39dd13){return function(_0x2609c6,_0x12f18b,_0x2ccb04){VoiceExtensionEvents[_0xbc67('0x6')](_0x39dd13+':'+_0x2609c6['id'],_0x2609c6);VoiceExtensionEvents[_0xbc67('0x6')](_0x39dd13,_0x2609c6);_0x2ccb04(null);};}for(var e in events){if(events[_0xbc67('0x7')](e)){var event=events[e];VoiceExtension[_0xbc67('0x8')](e,emitEvent(event));}}module[_0xbc67('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0x481e=['emit','hasOwnProperty','hook','exports','events','VoiceExtension','save','update','remove'];(function(_0x49bd79,_0x533088){var _0x3c62c7=function(_0x2b7610){while(--_0x2b7610){_0x49bd79['push'](_0x49bd79['shift']());}};_0x3c62c7(++_0x533088);}(_0x481e,0x1c6));var _0xe481=function(_0x1df18f,_0x20f03f){_0x1df18f=_0x1df18f-0x0;var _0x1a35b9=_0x481e[_0x1df18f];return _0x1a35b9;};'use strict';var EventEmitter=require(_0xe481('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xe481('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe481('0x2'),'afterUpdate':_0xe481('0x3'),'afterDestroy':_0xe481('0x4')};function emitEvent(_0x4e3dff){return function(_0x27bede,_0xc61148,_0xdba3a9){VoiceExtensionEvents[_0xe481('0x5')](_0x4e3dff+':'+_0x27bede['id'],_0x27bede);VoiceExtensionEvents[_0xe481('0x5')](_0x4e3dff,_0x27bede);_0xdba3a9(null);};}for(var e in events){if(events[_0xe481('0x6')](e)){var event=events[e];VoiceExtension[_0xe481('0x7')](e,emitEvent(event));}}module[_0xe481('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 0de6d9d..0281530 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 _0x483c=['bluebird','request-promise','./voiceExtension.attributes','exports','VoiceExtension','lodash','util','../../config/logger','moment'];(function(_0x171462,_0x489a7e){var _0x5c4ab2=function(_0x25fa78){while(--_0x25fa78){_0x171462['push'](_0x171462['shift']());}};_0x5c4ab2(++_0x489a7e);}(_0x483c,0x191));var _0xc483=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x483c[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0xc483('0x0'));var util=require(_0xc483('0x1'));var logger=require(_0xc483('0x2'))('api');var moment=require(_0xc483('0x3'));var BPromise=require(_0xc483('0x4'));var rp=require(_0xc483('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc483('0x6'));module[_0xc483('0x7')]=function(_0x5a4173,_0x2d976a){return _0x5a4173['define'](_0xc483('0x8'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2cfc=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./voiceExtension.attributes','exports','VoiceExtension','voice_extensions','lodash'];(function(_0x219e78,_0x5a8dfe){var _0x12b950=function(_0x4e41dc){while(--_0x4e41dc){_0x219e78['push'](_0x219e78['shift']());}};_0x12b950(++_0x5a8dfe);}(_0x2cfc,0x77));var _0xc2cf=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x2cfc[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0xc2cf('0x0'));var util=require(_0xc2cf('0x1'));var logger=require(_0xc2cf('0x2'))(_0xc2cf('0x3'));var moment=require(_0xc2cf('0x4'));var BPromise=require(_0xc2cf('0x5'));var rp=require(_0xc2cf('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc2cf('0x7'));var attributes=require(_0xc2cf('0x8'));module[_0xc2cf('0x9')]=function(_0x3d9e86,_0x1dfb02){return _0x3d9e86['define'](_0xc2cf('0xa'),attributes,{'tableName':_0xc2cf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 2ee4d20..2a8b616 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 _0x80be=['request','then','request\x20sent','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','info','catch','VoiceExtension','findAll','options','where','attributes','limit','map','include','model','GetVoiceExtension','debug','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x318f0a,_0x3f5072){var _0x103345=function(_0x41b230){while(--_0x41b230){_0x318f0a['push'](_0x318f0a['shift']());}};_0x103345(++_0x3f5072);}(_0x80be,0xa5));var _0xe80b=function(_0x43d94e,_0x586a51){_0x43d94e=_0x43d94e-0x0;var _0x43f712=_0x80be[_0x43d94e];return _0x43f712;};'use strict';var _=require(_0xe80b('0x0'));var util=require(_0xe80b('0x1'));var moment=require(_0xe80b('0x2'));var BPromise=require(_0xe80b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe80b('0x4'));var logger=require(_0xe80b('0x5'))(_0xe80b('0x6'));var config=require(_0xe80b('0x7'));var jayson=require(_0xe80b('0x8'));var client=jayson[_0xe80b('0x9')]['http']({'port':0x232a});config[_0xe80b('0xa')]=_[_0xe80b('0xb')](config['redis'],{'host':_0xe80b('0xc'),'port':0x18eb});var socket=require(_0xe80b('0xd'))(new Redis(config[_0xe80b('0xa')]));require('./voiceExtension.socket')[_0xe80b('0xe')](socket);function respondWithRpcPromise(_0x54a3c9,_0x21f1f3,_0x105d78){return new BPromise(function(_0x297da7,_0x70320a){return client[_0xe80b('0xf')](_0x54a3c9,_0x105d78)[_0xe80b('0x10')](function(_0x4ac825){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x21f1f3,_0xe80b('0x11'));logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x21f1f3,_0xe80b('0x11'),JSON[_0xe80b('0x12')](_0x4ac825));if(_0x4ac825[_0xe80b('0x13')]){if(_0x4ac825[_0xe80b('0x13')][_0xe80b('0x14')]===0x1f4){logger[_0xe80b('0x13')](_0xe80b('0x15'),_0x21f1f3,_0x4ac825['error'][_0xe80b('0x16')]);return _0x70320a(_0x4ac825[_0xe80b('0x13')][_0xe80b('0x16')]);}logger[_0xe80b('0x13')](_0xe80b('0x15'),_0x21f1f3,_0x4ac825[_0xe80b('0x13')][_0xe80b('0x16')]);return _0x297da7(_0x4ac825[_0xe80b('0x13')][_0xe80b('0x16')]);}else{logger[_0xe80b('0x17')](_0xe80b('0x15'),_0x21f1f3,_0xe80b('0x11'));_0x297da7(_0x4ac825['result'][_0xe80b('0x16')]);}})[_0xe80b('0x18')](function(_0x32044d){logger[_0xe80b('0x13')](_0xe80b('0x15'),_0x21f1f3,_0x32044d);_0x70320a(_0x32044d);});});}exports['GetVoiceExtension']=function(_0x5e0aad){var _0x4338d5=this;return new Promise(function(_0x431995,_0x59d5ae){return db[_0xe80b('0x19')][_0xe80b('0x1a')]({'raw':_0x5e0aad[_0xe80b('0x1b')]?_0x5e0aad['options']['raw']===undefined?!![]:![]:!![],'where':_0x5e0aad[_0xe80b('0x1b')]?_0x5e0aad[_0xe80b('0x1b')][_0xe80b('0x1c')]||null:null,'attributes':_0x5e0aad['options']?_0x5e0aad[_0xe80b('0x1b')][_0xe80b('0x1d')]||null:null,'limit':_0x5e0aad[_0xe80b('0x1b')]?_0x5e0aad[_0xe80b('0x1b')][_0xe80b('0x1e')]||null:null,'include':_0x5e0aad[_0xe80b('0x1b')]?_0x5e0aad[_0xe80b('0x1b')]['include']?_[_0xe80b('0x1f')](_0x5e0aad[_0xe80b('0x1b')][_0xe80b('0x20')],function(_0x3a298b){return{'model':db[_0x3a298b[_0xe80b('0x21')]],'as':_0x3a298b['as'],'attributes':_0x3a298b[_0xe80b('0x1d')],'include':_0x3a298b[_0xe80b('0x20')]?_[_0xe80b('0x1f')](_0x3a298b[_0xe80b('0x20')],function(_0x3fff7b){return{'model':db[_0x3fff7b[_0xe80b('0x21')]],'as':_0x3fff7b['as'],'attributes':_0x3fff7b[_0xe80b('0x1d')],'include':_0x3fff7b[_0xe80b('0x20')]?_[_0xe80b('0x1f')](_0x3fff7b[_0xe80b('0x20')],function(_0x1aec49){return{'model':db[_0x1aec49[_0xe80b('0x21')]],'as':_0x1aec49['as'],'attributes':_0x1aec49['attributes']};}):[]};}):[]};}):[]:[]})[_0xe80b('0x10')](function(_0x311120){logger[_0xe80b('0x17')](_0xe80b('0x22'),_0x5e0aad);logger[_0xe80b('0x23')](_0xe80b('0x22'),_0x5e0aad,JSON[_0xe80b('0x12')](_0x311120));_0x431995(_0x311120);})[_0xe80b('0x18')](function(_0x202f93){logger[_0xe80b('0x13')]('GetVoiceExtension',_0x202f93[_0xe80b('0x16')],_0x5e0aad);_0x59d5ae(_0x4338d5['error'](0x1f4,_0x202f93[_0xe80b('0x16')]));});});}; \ No newline at end of file +var _0x1883=['VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','limit','include','model','map','stringify','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','then','info'];(function(_0x27c383,_0x284463){var _0x1143a9=function(_0x3e9eee){while(--_0x3e9eee){_0x27c383['push'](_0x27c383['shift']());}};_0x1143a9(++_0x284463);}(_0x1883,0x144));var _0x3188=function(_0x44ac46,_0x2640cf){_0x44ac46=_0x44ac46-0x0;var _0x1d7dd8=_0x1883[_0x44ac46];return _0x1d7dd8;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var moment=require('moment');var BPromise=require(_0x3188('0x2'));var rs=require(_0x3188('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3188('0x4'))['db'];var utils=require(_0x3188('0x5'));var logger=require(_0x3188('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3188('0x7'));var client=jayson[_0x3188('0x8')][_0x3188('0x9')]({'port':0x232a});config[_0x3188('0xa')]=_[_0x3188('0xb')](config[_0x3188('0xa')],{'host':_0x3188('0xc'),'port':0x18eb});var socket=require(_0x3188('0xd'))(new Redis(config[_0x3188('0xa')]));require(_0x3188('0xe'))[_0x3188('0xf')](socket);function respondWithRpcPromise(_0x3d7794,_0x1cc8d6,_0x57c790){return new BPromise(function(_0x218995,_0xec090b){return client['request'](_0x3d7794,_0x57c790)[_0x3188('0x10')](function(_0x13f121){logger[_0x3188('0x11')](_0x3188('0x12'),_0x1cc8d6,_0x3188('0x13'));logger[_0x3188('0x14')](_0x3188('0x15'),_0x1cc8d6,_0x3188('0x13'),JSON['stringify'](_0x13f121));if(_0x13f121[_0x3188('0x16')]){if(_0x13f121[_0x3188('0x16')][_0x3188('0x17')]===0x1f4){logger[_0x3188('0x16')](_0x3188('0x12'),_0x1cc8d6,_0x13f121[_0x3188('0x16')][_0x3188('0x18')]);return _0xec090b(_0x13f121['error'][_0x3188('0x18')]);}logger[_0x3188('0x16')](_0x3188('0x12'),_0x1cc8d6,_0x13f121['error'][_0x3188('0x18')]);return _0x218995(_0x13f121[_0x3188('0x16')][_0x3188('0x18')]);}else{logger[_0x3188('0x11')](_0x3188('0x12'),_0x1cc8d6,'request\x20sent');_0x218995(_0x13f121[_0x3188('0x19')]['message']);}})[_0x3188('0x1a')](function(_0x1d5d84){logger[_0x3188('0x16')](_0x3188('0x12'),_0x1cc8d6,_0x1d5d84);_0xec090b(_0x1d5d84);});});}exports[_0x3188('0x1b')]=function(_0x393995){var _0x516f3c=this;return new Promise(function(_0x1a7771,_0xff05da){return db[_0x3188('0x1c')][_0x3188('0x1d')]({'raw':_0x393995[_0x3188('0x1e')]?_0x393995[_0x3188('0x1e')][_0x3188('0x1f')]===undefined?!![]:![]:!![],'where':_0x393995['options']?_0x393995[_0x3188('0x1e')]['where']||null:null,'attributes':_0x393995[_0x3188('0x1e')]?_0x393995[_0x3188('0x1e')][_0x3188('0x20')]||null:null,'limit':_0x393995['options']?_0x393995['options'][_0x3188('0x21')]||null:null,'include':_0x393995[_0x3188('0x1e')]?_0x393995[_0x3188('0x1e')]['include']?_['map'](_0x393995[_0x3188('0x1e')][_0x3188('0x22')],function(_0x5e1414){return{'model':db[_0x5e1414[_0x3188('0x23')]],'as':_0x5e1414['as'],'attributes':_0x5e1414['attributes'],'include':_0x5e1414[_0x3188('0x22')]?_[_0x3188('0x24')](_0x5e1414[_0x3188('0x22')],function(_0x58f486){return{'model':db[_0x58f486['model']],'as':_0x58f486['as'],'attributes':_0x58f486[_0x3188('0x20')],'include':_0x58f486['include']?_[_0x3188('0x24')](_0x58f486['include'],function(_0x2dd5d4){return{'model':db[_0x2dd5d4[_0x3188('0x23')]],'as':_0x2dd5d4['as'],'attributes':_0x2dd5d4[_0x3188('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3188('0x10')](function(_0x59440f){logger[_0x3188('0x11')]('GetVoiceExtension',_0x393995);logger[_0x3188('0x14')](_0x3188('0x1b'),_0x393995,JSON[_0x3188('0x25')](_0x59440f));_0x1a7771(_0x59440f);})[_0x3188('0x1a')](function(_0x5cdaab){logger[_0x3188('0x16')]('GetVoiceExtension',_0x5cdaab['message'],_0x393995);_0xff05da(_0x516f3c[_0x3188('0x16')](0x1f4,_0x5cdaab['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index d6ec345..72bf6fb 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 _0xdcaa=['update','emit','length','voiceExtension:','./voiceExtension.events','save'];(function(_0x1efbd1,_0x3354b9){var _0x1d6a0d=function(_0xec0e15){while(--_0xec0e15){_0x1efbd1['push'](_0x1efbd1['shift']());}};_0x1d6a0d(++_0x3354b9);}(_0xdcaa,0x172));var _0xadca=function(_0x45b541,_0x3ad37e){_0x45b541=_0x45b541-0x0;var _0x33ca51=_0xdcaa[_0x45b541];return _0x33ca51;};'use strict';var VoiceExtensionEvents=require(_0xadca('0x0'));var events=[_0xadca('0x1'),'remove',_0xadca('0x2')];function createListener(_0x43881c,_0x3470c8){return function(_0x1cafeb){_0x3470c8[_0xadca('0x3')](_0x43881c,_0x1cafeb);};}function removeListener(_0x58ad6a,_0x235cab){return function(){VoiceExtensionEvents['removeListener'](_0x58ad6a,_0x235cab);};}exports['register']=function(_0x3962f0){for(var _0x504969=0x0,_0x2cad97=events[_0xadca('0x4')];_0x504969<_0x2cad97;_0x504969++){var _0x3295a2=events[_0x504969];var _0x2ba833=createListener(_0xadca('0x5')+_0x3295a2,_0x3962f0);VoiceExtensionEvents['on'](_0x3295a2,_0x2ba833);}}; \ No newline at end of file +var _0x7b69=['length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x3cbcb3,_0x5a052d){var _0x111c5c=function(_0x3f3ae5){while(--_0x3f3ae5){_0x3cbcb3['push'](_0x3cbcb3['shift']());}};_0x111c5c(++_0x5a052d);}(_0x7b69,0xf0));var _0x97b6=function(_0x260cd8,_0x12ba1b){_0x260cd8=_0x260cd8-0x0;var _0x59cafe=_0x7b69[_0x260cd8];return _0x59cafe;};'use strict';var VoiceExtensionEvents=require(_0x97b6('0x0'));var events=[_0x97b6('0x1'),_0x97b6('0x2'),_0x97b6('0x3')];function createListener(_0x36ced0,_0x18d75e){return function(_0x5b66f6){_0x18d75e[_0x97b6('0x4')](_0x36ced0,_0x5b66f6);};}function removeListener(_0x2d1592,_0x539128){return function(){VoiceExtensionEvents['removeListener'](_0x2d1592,_0x539128);};}exports['register']=function(_0x2aa085){for(var _0x59a08d=0x0,_0x2f9a8f=events[_0x97b6('0x5')];_0x59a08d<_0x2f9a8f;_0x59a08d++){var _0x3726f2=events[_0x59a08d];var _0x575412=createListener(_0x97b6('0x6')+_0x3726f2,_0x2aa085);VoiceExtensionEvents['on'](_0x3726f2,_0x575412);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 7a4787a..7094d1b 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 _0x805e=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated','/:id','show','/:id/messages','getMessages','post','create','put','update','exports'];(function(_0x26d319,_0x3d6f33){var _0x373d42=function(_0x268f7b){while(--_0x268f7b){_0x26d319['push'](_0x26d319['shift']());}};_0x373d42(++_0x3d6f33);}(_0x805e,0xab));var _0xe805=function(_0x4b89d9,_0x3a4a59){_0x4b89d9=_0x4b89d9-0x0;var _0x5648ac=_0x805e[_0x4b89d9];return _0x5648ac;};'use strict';var multer=require(_0xe805('0x0'));var util=require(_0xe805('0x1'));var path=require(_0xe805('0x2'));var timeout=require(_0xe805('0x3'));var express=require(_0xe805('0x4'));var router=express['Router']();var auth=require(_0xe805('0x5'));var interaction=require(_0xe805('0x6'));var config=require('../../config/environment');var controller=require(_0xe805('0x7'));router[_0xe805('0x8')]('/',auth[_0xe805('0x9')](),controller['index']);router[_0xe805('0x8')](_0xe805('0xa'),auth[_0xe805('0x9')](),controller[_0xe805('0xb')]);router[_0xe805('0x8')](_0xe805('0xc'),auth[_0xe805('0x9')](),controller[_0xe805('0xd')]);router[_0xe805('0xe')]('/',auth[_0xe805('0x9')](),controller[_0xe805('0xf')]);router[_0xe805('0x10')](_0xe805('0xa'),auth[_0xe805('0x9')](),controller[_0xe805('0x11')]);router['delete'](_0xe805('0xa'),auth[_0xe805('0x9')](),controller['destroy']);module[_0xe805('0x12')]=router; \ No newline at end of file +var _0x3cc7=['index','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x3cc7,0x116));var _0x73cc=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x3cc7[_0x484e36];return _0xafc85d;};'use strict';var multer=require(_0x73cc('0x0'));var util=require(_0x73cc('0x1'));var path=require(_0x73cc('0x2'));var timeout=require(_0x73cc('0x3'));var express=require('express');var router=express[_0x73cc('0x4')]();var auth=require(_0x73cc('0x5'));var interaction=require(_0x73cc('0x6'));var config=require('../../config/environment');var controller=require(_0x73cc('0x7'));router[_0x73cc('0x8')]('/',auth[_0x73cc('0x9')](),controller[_0x73cc('0xa')]);router[_0x73cc('0x8')](_0x73cc('0xb'),auth[_0x73cc('0x9')](),controller[_0x73cc('0xc')]);router[_0x73cc('0x8')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x73cc('0xd')]('/',auth['isAuthenticated'](),controller[_0x73cc('0xe')]);router[_0x73cc('0xf')](_0x73cc('0xb'),auth[_0x73cc('0x9')](),controller['update']);router[_0x73cc('0x10')]('/:id',auth[_0x73cc('0x9')](),controller['destroy']);module[_0x73cc('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index a968006..04a1f9a 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 _0x13f6=['getDataValue','fullname','\x20-\x20','sequelize','exports','from-voicemail','contest_mailbox','STRING','setDataValue','email','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL'];(function(_0x4dd15b,_0x1d880a){var _0x2445f2=function(_0x236d63){while(--_0x236d63){_0x4dd15b['push'](_0x4dd15b['shift']());}};_0x2445f2(++_0x1d880a);}(_0x13f6,0x124));var _0x613f=function(_0x2d25d9,_0x27554f){_0x2d25d9=_0x2d25d9-0x0;var _0x2391d7=_0x13f6[_0x2d25d9];return _0x2391d7;};'use strict';var Sequelize=require(_0x613f('0x0'));module[_0x613f('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0x613f('0x2'),'unique':_0x613f('0x3')},'mailbox':{'type':Sequelize[_0x613f('0x4')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x613f('0x4')]},'fullname':{'type':Sequelize[_0x613f('0x4')]},'email':{'type':Sequelize[_0x613f('0x4')],'validate':{'isEmail':!![]},'set':function(_0x5c9aa9){this[_0x613f('0x5')](_0x613f('0x6'),typeof _0x5c9aa9==='string'&&_0x5c9aa9['trim']()?_0x5c9aa9['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x613f('0x4')],'defaultValue':_0x613f('0x7')},'attach':{'type':Sequelize[_0x613f('0x8')](_0x613f('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x613f('0x8')](_0x613f('0x9'),'no'),'defaultValue':_0x613f('0x9'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x613f('0x4')]},'review':{'type':Sequelize[_0x613f('0x8')](_0x613f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x613f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x613f('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x613f('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x613f('0x8')](_0x613f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x613f('0x8')](_0x613f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x613f('0x8')](_0x613f('0x9'),'no'),'defaultValue':_0x613f('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x613f('0x8')](_0x613f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x613f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x613f('0x9'),'allowNull':![]},'stamp':{'type':_0x613f('0xb')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x613f('0x4')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x613f('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x613f('0xd')],'get':function(){return this[_0x613f('0xe')](_0x613f('0xf'))+_0x613f('0x10')+this[_0x613f('0xe')]('mailbox');}}}; \ No newline at end of file +var _0x2032=['yes','ENUM','INTEGER','VIRTUAL','fullname','getDataValue','mailbox','exports','STRING','contest_mailbox','setDataValue','email','string','trim'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x2032,0xd9));var _0x2203=function(_0x4a9cbe,_0x529a76){_0x4a9cbe=_0x4a9cbe-0x0;var _0x12ac3b=_0x2032[_0x4a9cbe];return _0x12ac3b;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'customer_id':{'type':Sequelize[_0x2203('0x1')]},'context':{'type':Sequelize[_0x2203('0x1')],'defaultValue':'from-voicemail','unique':_0x2203('0x2')},'mailbox':{'type':Sequelize[_0x2203('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x2203('0x1')]},'fullname':{'type':Sequelize[_0x2203('0x1')]},'email':{'type':Sequelize[_0x2203('0x1')],'validate':{'isEmail':!![]},'set':function(_0x201796){this[_0x2203('0x3')](_0x2203('0x4'),typeof _0x201796===_0x2203('0x5')&&_0x201796[_0x2203('0x6')]()?_0x201796[_0x2203('0x6')]():null);}},'pager':{'type':Sequelize[_0x2203('0x1')]},'tz':{'type':Sequelize[_0x2203('0x1')],'defaultValue':'central'},'attach':{'type':Sequelize['ENUM'](_0x2203('0x7'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x2203('0x8')](_0x2203('0x7'),'no'),'defaultValue':_0x2203('0x7'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x2203('0x1')]},'review':{'type':Sequelize['ENUM'](_0x2203('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x2203('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x2203('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x2203('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x2203('0x8')](_0x2203('0x7'),'no'),'defaultValue':_0x2203('0x7'),'allowNull':![]},'forcename':{'type':Sequelize[_0x2203('0x8')](_0x2203('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x2203('0x8')](_0x2203('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x2203('0x8')](_0x2203('0x7'),'no'),'defaultValue':_0x2203('0x7'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x2203('0x1')]},'emailbody':{'type':Sequelize[_0x2203('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x2203('0x9')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x2203('0xa')],'get':function(){return this['getDataValue'](_0x2203('0xb'))+'\x20-\x20'+this[_0x2203('0xc')](_0x2203('0xd'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 1986e48..abd3f2c 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 _0x1789=['offset','limit','set','Content-Range','json','apply','save','update','then','Voicemails','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages','VoiceMailMessage','hasOwnProperty','mailbox','findAndCountAll','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','status','end','count'];(function(_0x4f92e8,_0x36916f){var _0x25ded9=function(_0x2f51b8){while(--_0x2f51b8){_0x4f92e8['push'](_0x4f92e8['shift']());}};_0x25ded9(++_0x36916f);}(_0x1789,0x92));var _0x9178=function(_0x3bcb39,_0x2e1bd0){_0x3bcb39=_0x3bcb39-0x0;var _0x158bc4=_0x1789[_0x3bcb39];return _0x158bc4;};'use strict';var pdf=require(_0x9178('0x0'));var emlformat=require(_0x9178('0x1'));var rimraf=require(_0x9178('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9178('0x3'));var rp=require(_0x9178('0x4'));var moment=require(_0x9178('0x5'));var BPromise=require(_0x9178('0x6'));var Mustache=require(_0x9178('0x7'));var util=require('util');var path=require('path');var sox=require(_0x9178('0x8'));var csv=require(_0x9178('0x9'));var ejs=require(_0x9178('0xa'));var fs=require('fs');var _=require(_0x9178('0xb'));var squel=require('squel');var crypto=require(_0x9178('0xc'));var jsforce=require(_0x9178('0xd'));var deskjs=require(_0x9178('0xe'));var toCsv=require(_0x9178('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9178('0xf'));var qs=require(_0x9178('0x10'));var as=require(_0x9178('0x11'));var hardwareService=require(_0x9178('0x12'));var logger=require('../../config/logger')(_0x9178('0x13'));var utils=require(_0x9178('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b3737,_0x1400a4){_0x1400a4=_0x1400a4||0xcc;return function(_0x321d98){if(_0x321d98){return _0x5b3737['sendStatus'](_0x1400a4);}return _0x5b3737[_0x9178('0x15')](_0x1400a4)[_0x9178('0x16')]();};}function respondWithResult(_0x2b01d0,_0x496489){_0x496489=_0x496489||0xc8;return function(_0x2daff3){if(_0x2daff3){return _0x2b01d0[_0x9178('0x15')](_0x496489)['json'](_0x2daff3);}};}function respondWithFilteredResult(_0x38f96a,_0x4d931e){return function(_0x4281aa){if(_0x4281aa){var _0x703536=_0x4281aa[_0x9178('0x17')],_0x26eeb9=_0x4d931e[_0x9178('0x18')],_0x45d428=_0x4d931e[_0x9178('0x18')]+_0x4d931e[_0x9178('0x19')],_0x1fdaf9;if(_0x45d428>=_0x703536){_0x45d428=_0x703536;_0x1fdaf9=0xc8;}else{_0x1fdaf9=0xce;}_0x38f96a[_0x9178('0x15')](_0x1fdaf9);return _0x38f96a[_0x9178('0x1a')](_0x9178('0x1b'),_0x26eeb9+'-'+_0x45d428+'/'+_0x703536)[_0x9178('0x1c')](_0x4281aa);}return null;};}function patchUpdates(_0x30c430){return function(_0x5c9fef){try{jsonpatch[_0x9178('0x1d')](_0x5c9fef,_0x30c430,!![]);}catch(_0x1cef7f){return BPromise['reject'](_0x1cef7f);}return _0x5c9fef[_0x9178('0x1e')]();};}function saveUpdates(_0x59b1d2,_0x94c136){return function(_0x1de1a2){if(_0x1de1a2){return _0x1de1a2[_0x9178('0x1f')](_0x59b1d2)[_0x9178('0x20')](function(_0x3f570b){return _0x3f570b;});}return null;};}function removeEntity(_0x16e535,_0x327b4b){return function(_0x4c13cf){if(_0x4c13cf){return _0x4c13cf['destroy']()[_0x9178('0x20')](function(){var _0x53995e=_0x4c13cf['get']({'plain':!![]});var _0x2c40c1=_0x9178('0x21');return db[_0x9178('0x22')][_0x9178('0x23')]({'where':{'type':_0x2c40c1,'resourceId':_0x53995e['id']}})[_0x9178('0x20')](function(){return _0x4c13cf;});})[_0x9178('0x20')](function(){_0x16e535[_0x9178('0x15')](0xcc)[_0x9178('0x16')]();});}};}function handleEntityNotFound(_0x1b39c5,_0x2114ec){return function(_0x16cebe){if(!_0x16cebe){_0x1b39c5[_0x9178('0x24')](0x194);}return _0x16cebe;};}function handleError(_0x3dccbf,_0x3af74d){_0x3af74d=_0x3af74d||0x1f4;return function(_0x4d2c72){logger[_0x9178('0x25')](_0x4d2c72[_0x9178('0x26')]);if(_0x4d2c72['name']){delete _0x4d2c72[_0x9178('0x27')];}_0x3dccbf[_0x9178('0x15')](_0x3af74d)[_0x9178('0x28')](_0x4d2c72);};}exports[_0x9178('0x29')]=function(_0x23e54c,_0x3b2487){var _0x5d9747={},_0x267f42={},_0x47201c={'count':0x0,'rows':[]};var _0x553a32=_[_0x9178('0x2a')](db[_0x9178('0x2b')][_0x9178('0x2c')],function(_0x3b4ad8){return{'name':_0x3b4ad8[_0x9178('0x2d')],'type':_0x3b4ad8[_0x9178('0x2e')][_0x9178('0x2f')]};});_0x267f42['model']=_[_0x9178('0x2a')](_0x553a32,'name');_0x267f42[_0x9178('0x30')]=_[_0x9178('0x31')](_0x23e54c['query']);_0x267f42[_0x9178('0x32')]=_[_0x9178('0x33')](_0x267f42[_0x9178('0x34')],_0x267f42[_0x9178('0x30')]);_0x5d9747['attributes']=_[_0x9178('0x33')](_0x267f42[_0x9178('0x34')],qs[_0x9178('0x35')](_0x23e54c[_0x9178('0x30')][_0x9178('0x35')]));_0x5d9747[_0x9178('0x36')]=_0x5d9747[_0x9178('0x36')][_0x9178('0x37')]?_0x5d9747['attributes']:_0x267f42[_0x9178('0x34')];if(!_0x23e54c[_0x9178('0x30')]['hasOwnProperty'](_0x9178('0x38'))){_0x5d9747['limit']=qs[_0x9178('0x19')](_0x23e54c['query']['limit']);_0x5d9747[_0x9178('0x18')]=qs[_0x9178('0x18')](_0x23e54c['query'][_0x9178('0x18')]);}_0x5d9747[_0x9178('0x39')]=qs['sort'](_0x23e54c['query'][_0x9178('0x3a')]);_0x5d9747[_0x9178('0x3b')]=qs[_0x9178('0x32')](_[_0x9178('0x3c')](_0x23e54c['query'],_0x267f42['filters']));if(_0x23e54c[_0x9178('0x30')]['filter']){_0x5d9747['where']=_[_0x9178('0x3d')](_0x5d9747[_0x9178('0x3b')],{'$or':_[_0x9178('0x2a')](_0x553a32,function(_0x481b75){if(_0x481b75[_0x9178('0x2e')]!==_0x9178('0x3e')){var _0x3f8528={};_0x3f8528[_0x481b75['name']]={'$like':'%'+_0x23e54c[_0x9178('0x30')][_0x9178('0x3f')]+'%'};return _0x3f8528;}})});}_0x5d9747=_[_0x9178('0x3d')]({},_0x5d9747,_0x23e54c[_0x9178('0x40')]);var _0xcdfb9c={'where':_0x5d9747[_0x9178('0x3b')]};return db[_0x9178('0x2b')]['count'](_0xcdfb9c)[_0x9178('0x20')](function(_0xd407db){_0x47201c[_0x9178('0x17')]=_0xd407db;if(_0x23e54c[_0x9178('0x30')]['includeAll']){_0x5d9747[_0x9178('0x41')]=[{'all':!![]}];}return db[_0x9178('0x2b')][_0x9178('0x42')](_0x5d9747);})[_0x9178('0x20')](function(_0x49b282){_0x47201c[_0x9178('0x43')]=_0x49b282;return _0x47201c;})['then'](respondWithFilteredResult(_0x3b2487,_0x5d9747))['catch'](handleError(_0x3b2487,null));};exports[_0x9178('0x44')]=function(_0x1bd23a,_0x20f9c7){var _0x69ad3c={'raw':!![],'where':{'id':_0x1bd23a[_0x9178('0x45')]['id']}},_0x490262={};_0x490262[_0x9178('0x34')]=_[_0x9178('0x31')](db['VoiceMail'][_0x9178('0x2c')]);_0x490262[_0x9178('0x30')]=_[_0x9178('0x31')](_0x1bd23a['query']);_0x490262[_0x9178('0x32')]=_[_0x9178('0x33')](_0x490262[_0x9178('0x34')],_0x490262['query']);_0x69ad3c[_0x9178('0x36')]=_[_0x9178('0x33')](_0x490262['model'],qs[_0x9178('0x35')](_0x1bd23a[_0x9178('0x30')]['fields']));_0x69ad3c[_0x9178('0x36')]=_0x69ad3c[_0x9178('0x36')][_0x9178('0x37')]?_0x69ad3c['attributes']:_0x490262['model'];if(_0x1bd23a[_0x9178('0x30')]['includeAll']){_0x69ad3c[_0x9178('0x41')]=[{'all':!![]}];}_0x69ad3c=_[_0x9178('0x3d')]({},_0x69ad3c,_0x1bd23a[_0x9178('0x40')]);return db[_0x9178('0x2b')][_0x9178('0x46')](_0x69ad3c)['then'](handleEntityNotFound(_0x20f9c7,null))[_0x9178('0x20')](respondWithResult(_0x20f9c7,null))[_0x9178('0x47')](handleError(_0x20f9c7,null));};exports['create']=function(_0x42acef,_0x3b30c6){return db['VoiceMail'][_0x9178('0x48')](_0x42acef['body'],{})[_0x9178('0x20')](function(_0x33ce2a){var _0x322f19=_0x42acef[_0x9178('0x49')][_0x9178('0x4a')]({'plain':!![]});if(!_0x322f19)throw new Error(_0x9178('0x4b'));if(_0x322f19['role']===_0x9178('0x49')){var _0x3f5278=_0x33ce2a[_0x9178('0x4a')]({'plain':!![]});var _0x3d4ea0=_0x9178('0x21');return db[_0x9178('0x4c')][_0x9178('0x46')]({'where':{'name':_0x3d4ea0,'userProfileId':_0x322f19[_0x9178('0x4d')]},'raw':!![]})[_0x9178('0x20')](function(_0x4624e9){if(_0x4624e9&&_0x4624e9['autoAssociation']===0x0){return db[_0x9178('0x22')][_0x9178('0x48')]({'name':_0x3f5278[_0x9178('0x27')],'resourceId':_0x3f5278['id'],'type':_0x4624e9[_0x9178('0x27')],'sectionId':_0x4624e9['id']},{})[_0x9178('0x20')](function(){return _0x33ce2a;});}else{return _0x33ce2a;}})[_0x9178('0x47')](function(_0x3bd3da){logger['error'](_0x9178('0x4e'),_0x3bd3da);throw _0x3bd3da;});}return _0x33ce2a;})[_0x9178('0x20')](respondWithResult(_0x3b30c6,0xc9))[_0x9178('0x47')](handleError(_0x3b30c6,null));};exports[_0x9178('0x1f')]=function(_0x4f2165,_0x304614){if(_0x4f2165[_0x9178('0x4f')]['id']){delete _0x4f2165[_0x9178('0x4f')]['id'];}return db['VoiceMail'][_0x9178('0x46')]({'where':{'id':_0x4f2165[_0x9178('0x45')]['id']}})[_0x9178('0x20')](handleEntityNotFound(_0x304614,null))[_0x9178('0x20')](saveUpdates(_0x4f2165[_0x9178('0x4f')],null))[_0x9178('0x20')](respondWithResult(_0x304614,null))['catch'](handleError(_0x304614,null));};exports['destroy']=function(_0x8581f1,_0x395d55){return db[_0x9178('0x2b')][_0x9178('0x46')]({'where':{'id':_0x8581f1[_0x9178('0x45')]['id']}})[_0x9178('0x20')](handleEntityNotFound(_0x395d55,null))[_0x9178('0x20')](removeEntity(_0x395d55,null))[_0x9178('0x47')](handleError(_0x395d55,null));};exports[_0x9178('0x50')]=function(_0x3ca4b1,_0x406411,_0x34fc20){return db[_0x9178('0x2b')]['findOne']({'where':{'id':_0x3ca4b1[_0x9178('0x45')]['id']}})['then'](handleEntityNotFound(_0x406411,null))[_0x9178('0x20')](function(_0x4f0a77){var _0x40ea60;var _0x580a5c={},_0x1ca6f3={};_0x1ca6f3['model']=_['keys'](db[_0x9178('0x51')][_0x9178('0x2c')]);_0x1ca6f3[_0x9178('0x30')]=_['keys'](_0x3ca4b1[_0x9178('0x30')]);_0x1ca6f3[_0x9178('0x32')]=_[_0x9178('0x33')](_0x1ca6f3['model'],_0x1ca6f3[_0x9178('0x30')]);_0x580a5c[_0x9178('0x36')]=_[_0x9178('0x33')](_0x1ca6f3[_0x9178('0x34')],qs[_0x9178('0x35')](_0x3ca4b1[_0x9178('0x30')]['fields']));_0x580a5c[_0x9178('0x36')]=_0x580a5c[_0x9178('0x36')][_0x9178('0x37')]?_0x580a5c['attributes']:_0x1ca6f3['model'];if(!_0x3ca4b1[_0x9178('0x30')][_0x9178('0x52')](_0x9178('0x38'))){_0x580a5c['limit']=qs[_0x9178('0x19')](_0x3ca4b1[_0x9178('0x30')][_0x9178('0x19')]);_0x580a5c['offset']=qs[_0x9178('0x18')](_0x3ca4b1[_0x9178('0x30')]['offset']);}_0x580a5c[_0x9178('0x39')]=qs[_0x9178('0x3a')](_0x3ca4b1[_0x9178('0x30')]['sort']);_0x580a5c['where']=qs[_0x9178('0x32')](_[_0x9178('0x3c')](_0x3ca4b1['query'],_0x1ca6f3[_0x9178('0x32')]));if(_0x3ca4b1[_0x9178('0x30')][_0x9178('0x3f')]){_0x580a5c['where']=_['merge'](_0x580a5c[_0x9178('0x3b')],{'$or':_['map'](_0x580a5c['attributes'],function(_0x5ab1bc){var _0x22eb98={};_0x22eb98[_0x5ab1bc]={'$like':'%'+_0x3ca4b1[_0x9178('0x30')][_0x9178('0x3f')]+'%'};return _0x22eb98;})});}_0x580a5c['where']=_[_0x9178('0x3d')](_0x580a5c[_0x9178('0x3b')],{'mailboxuser':_0x4f0a77[_0x9178('0x53')]});_0x580a5c=_[_0x9178('0x3d')]({},_0x580a5c,_0x3ca4b1[_0x9178('0x40')]);return db[_0x9178('0x51')][_0x9178('0x54')](_0x580a5c)[_0x9178('0x20')](respondWithFilteredResult(_0x406411,_0x580a5c));})['catch'](handleError(_0x406411,null));}; \ No newline at end of file +var _0xda33=['eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','set','json','apply','reject','save','update','then','destroy','Voicemails','UserProfileResource','end','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','length','find','create','user','get','role','UserProfileSection','userProfileId','autoAssociation','body','findOne','VoiceMailMessage','mailbox','findAndCountAll','html-pdf'];(function(_0x4fd064,_0xe55a1c){var _0x58f25b=function(_0x52e296){while(--_0x52e296){_0x4fd064['push'](_0x4fd064['shift']());}};_0x58f25b(++_0xe55a1c);}(_0xda33,0x1b7));var _0x3da3=function(_0x5597cc,_0x2b0e13){_0x5597cc=_0x5597cc-0x0;var _0x49a760=_0xda33[_0x5597cc];return _0x49a760;};'use strict';var pdf=require(_0x3da3('0x0'));var emlformat=require(_0x3da3('0x1'));var rimraf=require(_0x3da3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3da3('0x3'));var rp=require(_0x3da3('0x4'));var moment=require('moment');var BPromise=require(_0x3da3('0x5'));var Mustache=require(_0x3da3('0x6'));var util=require(_0x3da3('0x7'));var path=require(_0x3da3('0x8'));var sox=require(_0x3da3('0x9'));var csv=require(_0x3da3('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3da3('0xb'));var squel=require(_0x3da3('0xc'));var crypto=require(_0x3da3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3da3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3da3('0xf'));var Papa=require(_0x3da3('0x10'));var Redis=require('ioredis');var authService=require(_0x3da3('0x11'));var qs=require(_0x3da3('0x12'));var as=require(_0x3da3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3da3('0x14'))(_0x3da3('0x15'));var utils=require('../../config/utils');var config=require(_0x3da3('0x16'));var db=require(_0x3da3('0x17'))['db'];function respondWithStatusCode(_0x4be409,_0x136d73){_0x136d73=_0x136d73||0xcc;return function(_0x938909){if(_0x938909){return _0x4be409[_0x3da3('0x18')](_0x136d73);}return _0x4be409[_0x3da3('0x19')](_0x136d73)['end']();};}function respondWithResult(_0x4d13d9,_0x9de857){_0x9de857=_0x9de857||0xc8;return function(_0x50fc67){if(_0x50fc67){return _0x4d13d9[_0x3da3('0x19')](_0x9de857)['json'](_0x50fc67);}};}function respondWithFilteredResult(_0x46ced7,_0x445c3c){return function(_0x304fd3){if(_0x304fd3){var _0x17d5fc=_0x304fd3['count'],_0x5c70ed=_0x445c3c[_0x3da3('0x1a')],_0x403e41=_0x445c3c[_0x3da3('0x1a')]+_0x445c3c['limit'],_0x236241;if(_0x403e41>=_0x17d5fc){_0x403e41=_0x17d5fc;_0x236241=0xc8;}else{_0x236241=0xce;}_0x46ced7[_0x3da3('0x19')](_0x236241);return _0x46ced7[_0x3da3('0x1b')]('Content-Range',_0x5c70ed+'-'+_0x403e41+'/'+_0x17d5fc)[_0x3da3('0x1c')](_0x304fd3);}return null;};}function patchUpdates(_0x27af8a){return function(_0x52b54b){try{jsonpatch[_0x3da3('0x1d')](_0x52b54b,_0x27af8a,!![]);}catch(_0x58d8da){return BPromise[_0x3da3('0x1e')](_0x58d8da);}return _0x52b54b[_0x3da3('0x1f')]();};}function saveUpdates(_0x2a67c1,_0x5dbfa5){return function(_0x383ea7){if(_0x383ea7){return _0x383ea7[_0x3da3('0x20')](_0x2a67c1)[_0x3da3('0x21')](function(_0x21fe58){return _0x21fe58;});}return null;};}function removeEntity(_0x2f0ea0,_0x3053dd){return function(_0x3beb9a){if(_0x3beb9a){return _0x3beb9a[_0x3da3('0x22')]()[_0x3da3('0x21')](function(){var _0x18ce08=_0x3beb9a['get']({'plain':!![]});var _0x5f5c55=_0x3da3('0x23');return db[_0x3da3('0x24')][_0x3da3('0x22')]({'where':{'type':_0x5f5c55,'resourceId':_0x18ce08['id']}})[_0x3da3('0x21')](function(){return _0x3beb9a;});})[_0x3da3('0x21')](function(){_0x2f0ea0[_0x3da3('0x19')](0xcc)[_0x3da3('0x25')]();});}};}function handleEntityNotFound(_0x50d761,_0x265f81){return function(_0x18efd9){if(!_0x18efd9){_0x50d761[_0x3da3('0x18')](0x194);}return _0x18efd9;};}function handleError(_0x231d83,_0x10751e){_0x10751e=_0x10751e||0x1f4;return function(_0x485d89){logger[_0x3da3('0x26')](_0x485d89[_0x3da3('0x27')]);if(_0x485d89[_0x3da3('0x28')]){delete _0x485d89[_0x3da3('0x28')];}_0x231d83[_0x3da3('0x19')](_0x10751e)[_0x3da3('0x29')](_0x485d89);};}exports[_0x3da3('0x2a')]=function(_0x18d100,_0x463b9d){var _0x52ee7f={},_0x173edf={},_0x37b0fe={'count':0x0,'rows':[]};var _0x8a3387=_[_0x3da3('0x2b')](db[_0x3da3('0x2c')][_0x3da3('0x2d')],function(_0x13ad99){return{'name':_0x13ad99[_0x3da3('0x2e')],'type':_0x13ad99[_0x3da3('0x2f')][_0x3da3('0x30')]};});_0x173edf['model']=_[_0x3da3('0x2b')](_0x8a3387,'name');_0x173edf[_0x3da3('0x31')]=_[_0x3da3('0x32')](_0x18d100[_0x3da3('0x31')]);_0x173edf[_0x3da3('0x33')]=_['intersection'](_0x173edf['model'],_0x173edf[_0x3da3('0x31')]);_0x52ee7f['attributes']=_[_0x3da3('0x34')](_0x173edf[_0x3da3('0x35')],qs[_0x3da3('0x36')](_0x18d100[_0x3da3('0x31')][_0x3da3('0x36')]));_0x52ee7f[_0x3da3('0x37')]=_0x52ee7f[_0x3da3('0x37')]['length']?_0x52ee7f[_0x3da3('0x37')]:_0x173edf[_0x3da3('0x35')];if(!_0x18d100[_0x3da3('0x31')][_0x3da3('0x38')](_0x3da3('0x39'))){_0x52ee7f[_0x3da3('0x3a')]=qs['limit'](_0x18d100[_0x3da3('0x31')][_0x3da3('0x3a')]);_0x52ee7f[_0x3da3('0x1a')]=qs['offset'](_0x18d100[_0x3da3('0x31')]['offset']);}_0x52ee7f[_0x3da3('0x3b')]=qs['sort'](_0x18d100[_0x3da3('0x31')][_0x3da3('0x3c')]);_0x52ee7f[_0x3da3('0x3d')]=qs['filters'](_[_0x3da3('0x3e')](_0x18d100['query'],_0x173edf[_0x3da3('0x33')]));if(_0x18d100[_0x3da3('0x31')][_0x3da3('0x3f')]){_0x52ee7f[_0x3da3('0x3d')]=_[_0x3da3('0x40')](_0x52ee7f['where'],{'$or':_[_0x3da3('0x2b')](_0x8a3387,function(_0x2c1ab8){if(_0x2c1ab8[_0x3da3('0x2f')]!==_0x3da3('0x41')){var _0x729799={};_0x729799[_0x2c1ab8[_0x3da3('0x28')]]={'$like':'%'+_0x18d100[_0x3da3('0x31')][_0x3da3('0x3f')]+'%'};return _0x729799;}})});}_0x52ee7f=_[_0x3da3('0x40')]({},_0x52ee7f,_0x18d100[_0x3da3('0x42')]);var _0x4eb79c={'where':_0x52ee7f[_0x3da3('0x3d')]};return db[_0x3da3('0x2c')][_0x3da3('0x43')](_0x4eb79c)[_0x3da3('0x21')](function(_0x44753c){_0x37b0fe[_0x3da3('0x43')]=_0x44753c;if(_0x18d100[_0x3da3('0x31')][_0x3da3('0x44')]){_0x52ee7f[_0x3da3('0x45')]=[{'all':!![]}];}return db[_0x3da3('0x2c')][_0x3da3('0x46')](_0x52ee7f);})[_0x3da3('0x21')](function(_0x286cc9){_0x37b0fe['rows']=_0x286cc9;return _0x37b0fe;})['then'](respondWithFilteredResult(_0x463b9d,_0x52ee7f))[_0x3da3('0x47')](handleError(_0x463b9d,null));};exports[_0x3da3('0x48')]=function(_0x3722b7,_0x51ddfa){var _0x47187b={'raw':!![],'where':{'id':_0x3722b7[_0x3da3('0x49')]['id']}},_0x366b4b={};_0x366b4b[_0x3da3('0x35')]=_[_0x3da3('0x32')](db['VoiceMail'][_0x3da3('0x2d')]);_0x366b4b['query']=_[_0x3da3('0x32')](_0x3722b7[_0x3da3('0x31')]);_0x366b4b[_0x3da3('0x33')]=_[_0x3da3('0x34')](_0x366b4b[_0x3da3('0x35')],_0x366b4b[_0x3da3('0x31')]);_0x47187b[_0x3da3('0x37')]=_[_0x3da3('0x34')](_0x366b4b[_0x3da3('0x35')],qs[_0x3da3('0x36')](_0x3722b7[_0x3da3('0x31')][_0x3da3('0x36')]));_0x47187b[_0x3da3('0x37')]=_0x47187b['attributes'][_0x3da3('0x4a')]?_0x47187b[_0x3da3('0x37')]:_0x366b4b[_0x3da3('0x35')];if(_0x3722b7[_0x3da3('0x31')][_0x3da3('0x44')]){_0x47187b[_0x3da3('0x45')]=[{'all':!![]}];}_0x47187b=_[_0x3da3('0x40')]({},_0x47187b,_0x3722b7['options']);return db[_0x3da3('0x2c')][_0x3da3('0x4b')](_0x47187b)[_0x3da3('0x21')](handleEntityNotFound(_0x51ddfa,null))['then'](respondWithResult(_0x51ddfa,null))['catch'](handleError(_0x51ddfa,null));};exports[_0x3da3('0x4c')]=function(_0x45b9d8,_0x3a2e26){return db['VoiceMail'][_0x3da3('0x4c')](_0x45b9d8['body'],{})[_0x3da3('0x21')](function(_0x1b0e13){var _0x4cb431=_0x45b9d8[_0x3da3('0x4d')][_0x3da3('0x4e')]({'plain':!![]});if(!_0x4cb431)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4cb431[_0x3da3('0x4f')]===_0x3da3('0x4d')){var _0x57ad7b=_0x1b0e13['get']({'plain':!![]});var _0x595e48=_0x3da3('0x23');return db[_0x3da3('0x50')]['find']({'where':{'name':_0x595e48,'userProfileId':_0x4cb431[_0x3da3('0x51')]},'raw':!![]})[_0x3da3('0x21')](function(_0x5dd5d6){if(_0x5dd5d6&&_0x5dd5d6[_0x3da3('0x52')]===0x0){return db['UserProfileResource'][_0x3da3('0x4c')]({'name':_0x57ad7b[_0x3da3('0x28')],'resourceId':_0x57ad7b['id'],'type':_0x5dd5d6[_0x3da3('0x28')],'sectionId':_0x5dd5d6['id']},{})['then'](function(){return _0x1b0e13;});}else{return _0x1b0e13;}})[_0x3da3('0x47')](function(_0x3da1c3){logger[_0x3da3('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3da1c3);throw _0x3da1c3;});}return _0x1b0e13;})[_0x3da3('0x21')](respondWithResult(_0x3a2e26,0xc9))[_0x3da3('0x47')](handleError(_0x3a2e26,null));};exports[_0x3da3('0x20')]=function(_0x318af4,_0x3e734f){if(_0x318af4[_0x3da3('0x53')]['id']){delete _0x318af4[_0x3da3('0x53')]['id'];}return db[_0x3da3('0x2c')]['find']({'where':{'id':_0x318af4[_0x3da3('0x49')]['id']}})[_0x3da3('0x21')](handleEntityNotFound(_0x3e734f,null))[_0x3da3('0x21')](saveUpdates(_0x318af4[_0x3da3('0x53')],null))[_0x3da3('0x21')](respondWithResult(_0x3e734f,null))[_0x3da3('0x47')](handleError(_0x3e734f,null));};exports[_0x3da3('0x22')]=function(_0x22cd5b,_0x13e94b){return db['VoiceMail'][_0x3da3('0x4b')]({'where':{'id':_0x22cd5b[_0x3da3('0x49')]['id']}})[_0x3da3('0x21')](handleEntityNotFound(_0x13e94b,null))['then'](removeEntity(_0x13e94b,null))[_0x3da3('0x47')](handleError(_0x13e94b,null));};exports['getMessages']=function(_0x410ec6,_0x2fbb0b,_0x4fc3a6){return db[_0x3da3('0x2c')][_0x3da3('0x54')]({'where':{'id':_0x410ec6[_0x3da3('0x49')]['id']}})['then'](handleEntityNotFound(_0x2fbb0b,null))['then'](function(_0x5553f4){var _0x59340d;var _0x13768c={},_0x2f1610={};_0x2f1610[_0x3da3('0x35')]=_[_0x3da3('0x32')](db[_0x3da3('0x55')]['rawAttributes']);_0x2f1610['query']=_[_0x3da3('0x32')](_0x410ec6[_0x3da3('0x31')]);_0x2f1610[_0x3da3('0x33')]=_['intersection'](_0x2f1610[_0x3da3('0x35')],_0x2f1610[_0x3da3('0x31')]);_0x13768c[_0x3da3('0x37')]=_[_0x3da3('0x34')](_0x2f1610['model'],qs[_0x3da3('0x36')](_0x410ec6[_0x3da3('0x31')]['fields']));_0x13768c['attributes']=_0x13768c[_0x3da3('0x37')]['length']?_0x13768c[_0x3da3('0x37')]:_0x2f1610[_0x3da3('0x35')];if(!_0x410ec6[_0x3da3('0x31')][_0x3da3('0x38')]('nolimit')){_0x13768c[_0x3da3('0x3a')]=qs['limit'](_0x410ec6[_0x3da3('0x31')][_0x3da3('0x3a')]);_0x13768c['offset']=qs[_0x3da3('0x1a')](_0x410ec6[_0x3da3('0x31')][_0x3da3('0x1a')]);}_0x13768c[_0x3da3('0x3b')]=qs[_0x3da3('0x3c')](_0x410ec6[_0x3da3('0x31')]['sort']);_0x13768c[_0x3da3('0x3d')]=qs['filters'](_[_0x3da3('0x3e')](_0x410ec6[_0x3da3('0x31')],_0x2f1610[_0x3da3('0x33')]));if(_0x410ec6[_0x3da3('0x31')][_0x3da3('0x3f')]){_0x13768c[_0x3da3('0x3d')]=_[_0x3da3('0x40')](_0x13768c[_0x3da3('0x3d')],{'$or':_[_0x3da3('0x2b')](_0x13768c[_0x3da3('0x37')],function(_0x2e8b85){var _0x509804={};_0x509804[_0x2e8b85]={'$like':'%'+_0x410ec6[_0x3da3('0x31')][_0x3da3('0x3f')]+'%'};return _0x509804;})});}_0x13768c['where']=_[_0x3da3('0x40')](_0x13768c[_0x3da3('0x3d')],{'mailboxuser':_0x5553f4[_0x3da3('0x56')]});_0x13768c=_[_0x3da3('0x40')]({},_0x13768c,_0x410ec6[_0x3da3('0x42')]);return db[_0x3da3('0x55')][_0x3da3('0x57')](_0x13768c)[_0x3da3('0x21')](respondWithFilteredResult(_0x2fbb0b,_0x13768c));})[_0x3da3('0x47')](handleError(_0x2fbb0b,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 549dc2a..97ab276 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 _0xacc5=['path','rimraf','./voiceMail.attributes','exports','VoiceMail','voice_voicemail','mailbox','context','lodash','api','bluebird','request-promise'];(function(_0x3ea416,_0x380f69){var _0x1f8eb0=function(_0x32ef27){while(--_0x32ef27){_0x3ea416['push'](_0x3ea416['shift']());}};_0x1f8eb0(++_0x380f69);}(_0xacc5,0x188));var _0x5acc=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xacc5[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x5acc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5acc('0x1'));var moment=require('moment');var BPromise=require(_0x5acc('0x2'));var rp=require(_0x5acc('0x3'));var fs=require('fs');var path=require(_0x5acc('0x4'));var rimraf=require(_0x5acc('0x5'));var config=require('../../config/environment');var attributes=require(_0x5acc('0x6'));module[_0x5acc('0x7')]=function(_0x175a0a,_0x117067){return _0x175a0a['define'](_0x5acc('0x8'),attributes,{'tableName':_0x5acc('0x9'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x5acc('0xa'),_0x5acc('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x33f8=['VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define'];(function(_0x334d1e,_0x28a488){var _0x3b33ba=function(_0x25afca){while(--_0x25afca){_0x334d1e['push'](_0x334d1e['shift']());}};_0x3b33ba(++_0x28a488);}(_0x33f8,0x1f4));var _0x833f=function(_0x2a62c1,_0x4a1af1){_0x2a62c1=_0x2a62c1-0x0;var _0xf24dd4=_0x33f8[_0x2a62c1];return _0xf24dd4;};'use strict';var _=require(_0x833f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x833f('0x1'));var moment=require(_0x833f('0x2'));var BPromise=require('bluebird');var rp=require(_0x833f('0x3'));var fs=require('fs');var path=require(_0x833f('0x4'));var rimraf=require(_0x833f('0x5'));var config=require(_0x833f('0x6'));var attributes=require(_0x833f('0x7'));module[_0x833f('0x8')]=function(_0x3bd816,_0x5f345f){return _0x3bd816[_0x833f('0x9')](_0x833f('0xa'),attributes,{'tableName':_0x833f('0xb'),'paranoid':![],'indexes':[{'name':_0x833f('0xc'),'fields':[_0x833f('0xd'),_0x833f('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 07ae665..e810beb 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 _0x2826=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x4e002d,_0xef5495){var _0x3b43f0=function(_0x1f5240){while(--_0x1f5240){_0x4e002d['push'](_0x4e002d['shift']());}};_0x3b43f0(++_0xef5495);}(_0x2826,0x103));var _0x6282=function(_0x422311,_0x54125c){_0x422311=_0x422311-0x0;var _0x356858=_0x2826[_0x422311];return _0x356858;};'use strict';var _=require(_0x6282('0x0'));var util=require(_0x6282('0x1'));var moment=require(_0x6282('0x2'));var BPromise=require('bluebird');var rs=require(_0x6282('0x3'));var fs=require('fs');var Redis=require(_0x6282('0x4'));var db=require(_0x6282('0x5'))['db'];var utils=require(_0x6282('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6282('0x7'));var jayson=require(_0x6282('0x8'));var client=jayson[_0x6282('0x9')][_0x6282('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d2cab,_0x140954,_0x2bde38){return new BPromise(function(_0x243af8,_0x199c31){return client['request'](_0x3d2cab,_0x2bde38)[_0x6282('0xb')](function(_0x352f69){logger[_0x6282('0xc')](_0x6282('0xd'),_0x140954,_0x6282('0xe'));logger[_0x6282('0xf')](_0x6282('0x10'),_0x140954,_0x6282('0xe'),JSON['stringify'](_0x352f69));if(_0x352f69[_0x6282('0x11')]){if(_0x352f69[_0x6282('0x11')][_0x6282('0x12')]===0x1f4){logger[_0x6282('0x11')]('VoiceMail,\x20%s,\x20%s',_0x140954,_0x352f69[_0x6282('0x11')][_0x6282('0x13')]);return _0x199c31(_0x352f69[_0x6282('0x11')]['message']);}logger[_0x6282('0x11')](_0x6282('0xd'),_0x140954,_0x352f69['error'][_0x6282('0x13')]);return _0x243af8(_0x352f69[_0x6282('0x11')][_0x6282('0x13')]);}else{logger[_0x6282('0xc')](_0x6282('0xd'),_0x140954,_0x6282('0xe'));_0x243af8(_0x352f69[_0x6282('0x14')][_0x6282('0x13')]);}})[_0x6282('0x15')](function(_0x544ea9){logger['error'](_0x6282('0xd'),_0x140954,_0x544ea9);_0x199c31(_0x544ea9);});});} \ No newline at end of file +var _0x7991=['util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','http','then','request\x20sent','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','catch','lodash'];(function(_0x261522,_0x1adc1f){var _0x98a25a=function(_0x1b0f9c){while(--_0x1b0f9c){_0x261522['push'](_0x261522['shift']());}};_0x98a25a(++_0x1adc1f);}(_0x7991,0x120));var _0x1799=function(_0x4dafc0,_0x55016b){_0x4dafc0=_0x4dafc0-0x0;var _0x289eb6=_0x7991[_0x4dafc0];return _0x289eb6;};'use strict';var _=require(_0x1799('0x0'));var util=require(_0x1799('0x1'));var moment=require(_0x1799('0x2'));var BPromise=require(_0x1799('0x3'));var rs=require(_0x1799('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1799('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x1799('0x6'));var jayson=require(_0x1799('0x7'));var client=jayson['client'][_0x1799('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x28b670,_0x1c2125,_0x312155){return new BPromise(function(_0x5138a9,_0xfe50d4){return client['request'](_0x28b670,_0x312155)[_0x1799('0x9')](function(_0x12b7c0){logger['info']('VoiceMail,\x20%s,\x20%s',_0x1c2125,_0x1799('0xa'));logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0x1c2125,_0x1799('0xa'),JSON[_0x1799('0xb')](_0x12b7c0));if(_0x12b7c0[_0x1799('0xc')]){if(_0x12b7c0[_0x1799('0xc')][_0x1799('0xd')]===0x1f4){logger[_0x1799('0xc')](_0x1799('0xe'),_0x1c2125,_0x12b7c0[_0x1799('0xc')]['message']);return _0xfe50d4(_0x12b7c0[_0x1799('0xc')][_0x1799('0xf')]);}logger['error'](_0x1799('0xe'),_0x1c2125,_0x12b7c0[_0x1799('0xc')][_0x1799('0xf')]);return _0x5138a9(_0x12b7c0[_0x1799('0xc')]['message']);}else{logger['info'](_0x1799('0xe'),_0x1c2125,'request\x20sent');_0x5138a9(_0x12b7c0['result']['message']);}})[_0x1799('0x10')](function(_0x560fe0){logger[_0x1799('0xc')](_0x1799('0xe'),_0x1c2125,_0x560fe0);_0xfe50d4(_0x560fe0);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 7153e42..bb78f4e 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 _0x46ed=['multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','create','update','delete','exports'];(function(_0x26a349,_0x4ced97){var _0x1c5fd8=function(_0x3fd9f3){while(--_0x3fd9f3){_0x26a349['push'](_0x26a349['shift']());}};_0x1c5fd8(++_0x4ced97);}(_0x46ed,0x168));var _0xd46e=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x46ed[_0x599f41];return _0x2e4d58;};'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('./voiceMailMessage.controller');router[_0xd46e('0x7')]('/',auth[_0xd46e('0x8')](),controller[_0xd46e('0x9')]);router[_0xd46e('0x7')](_0xd46e('0xa'),auth[_0xd46e('0x8')](),controller[_0xd46e('0xb')]);router[_0xd46e('0x7')](_0xd46e('0xc'),auth[_0xd46e('0x8')](),controller[_0xd46e('0xd')]);router['post']('/',auth[_0xd46e('0x8')](),controller[_0xd46e('0xe')]);router['put'](_0xd46e('0xa'),auth[_0xd46e('0x8')](),controller[_0xd46e('0xf')]);router[_0xd46e('0x10')](_0xd46e('0xa'),auth[_0xd46e('0x8')](),controller['destroy']);module[_0xd46e('0x11')]=router; \ No newline at end of file +var _0x5fab=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','show','download','post','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x2780ab,_0x1d9fb1){var _0x4900d8=function(_0x471035){while(--_0x471035){_0x2780ab['push'](_0x2780ab['shift']());}};_0x4900d8(++_0x1d9fb1);}(_0x5fab,0x177));var _0xb5fa=function(_0x58da8a,_0x1fb6ff){_0x58da8a=_0x58da8a-0x0;var _0x5294b9=_0x5fab[_0x58da8a];return _0x5294b9;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var auth=require(_0xb5fa('0x5'));var interaction=require(_0xb5fa('0x6'));var config=require(_0xb5fa('0x7'));var controller=require(_0xb5fa('0x8'));router[_0xb5fa('0x9')]('/',auth[_0xb5fa('0xa')](),controller[_0xb5fa('0xb')]);router['get']('/:id',auth[_0xb5fa('0xa')](),controller[_0xb5fa('0xc')]);router[_0xb5fa('0x9')]('/:id/download',auth[_0xb5fa('0xa')](),controller[_0xb5fa('0xd')]);router[_0xb5fa('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb5fa('0xf')](_0xb5fa('0x10'),auth[_0xb5fa('0xa')](),controller[_0xb5fa('0x11')]);router[_0xb5fa('0x12')](_0xb5fa('0x10'),auth[_0xb5fa('0xa')](),controller[_0xb5fa('0x13')]);module[_0xb5fa('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 3447854..e496f2d 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 _0xa13e=['STRING','BLOB','long','sequelize','exports','VIRTUAL','getDataValue','INTEGER'];(function(_0x4b1ac6,_0x33c5df){var _0x5c39ab=function(_0x2b77f4){while(--_0x2b77f4){_0x4b1ac6['push'](_0x4b1ac6['shift']());}};_0x5c39ab(++_0x33c5df);}(_0xa13e,0x1e3));var _0xea13=function(_0x148d8b,_0x1e3b3b){_0x148d8b=_0x148d8b-0x0;var _0x27e191=_0xa13e[_0x148d8b];return _0x27e191;};'use strict';var Sequelize=require(_0xea13('0x0'));module[_0xea13('0x1')]={'name':{'type':Sequelize[_0xea13('0x2')],'get':function(_0x2990f6){return this[_0xea13('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xea13('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xea13('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xea13('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0xea13('0x5')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xea13('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xea13('0x6')](_0xea13('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0xea13('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xea13('0x5')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','allowNull':![]}}; \ No newline at end of file +var _0x8713=['TIMESTAMP','exports','VIRTUAL','STRING','BLOB'];(function(_0xaf3612,_0x417ae0){var _0x8df3e9=function(_0x3d1e60){while(--_0x3d1e60){_0xaf3612['push'](_0xaf3612['shift']());}};_0x8df3e9(++_0x417ae0);}(_0x8713,0x191));var _0x3871=function(_0x4f0b02,_0x3464a3){_0x4f0b02=_0x4f0b02-0x0;var _0x58149d=_0x8713[_0x4f0b02];return _0x58149d;};'use strict';var Sequelize=require('sequelize');module[_0x3871('0x0')]={'name':{'type':Sequelize[_0x3871('0x1')],'get':function(_0x20cb98){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x3871('0x2')],'defaultValue':''},'context':{'type':Sequelize[_0x3871('0x2')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x3871('0x2')],'defaultValue':''},'origtime':{'type':Sequelize[_0x3871('0x2')],'defaultValue':''},'duration':{'type':Sequelize[_0x3871('0x2')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x3871('0x2')],'defaultValue':''},'recording':{'type':Sequelize[_0x3871('0x3')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x3871('0x2')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x3871('0x2')],'defaultValue':''},'stamp':{'type':_0x3871('0x4'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index a4750d1..3fb43c5 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 _0x8958=['to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','update','then','error','name','map','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','sort','where','filters','pick','filter','merge','options','VoiceMailMessage','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','params','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','send','eml-format','moment','mustache','util','path'];(function(_0xcc8e3e,_0x2f7ddb){var _0x5edf94=function(_0x494554){while(--_0x494554){_0xcc8e3e['push'](_0xcc8e3e['shift']());}};_0x5edf94(++_0x2f7ddb);}(_0x8958,0x93));var _0x8895=function(_0x3cb731,_0x207931){_0x3cb731=_0x3cb731-0x0;var _0x5566e9=_0x8958[_0x3cb731];return _0x5566e9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8895('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8895('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x8895('0x2'));var util=require(_0x8895('0x3'));var path=require(_0x8895('0x4'));var sox=require('sox');var csv=require(_0x8895('0x5'));var ejs=require(_0x8895('0x6'));var fs=require('fs');var _=require(_0x8895('0x7'));var squel=require(_0x8895('0x8'));var crypto=require(_0x8895('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8895('0xa'));var toCsv=require(_0x8895('0x5'));var querystring=require(_0x8895('0xb'));var Papa=require(_0x8895('0xc'));var Redis=require(_0x8895('0xd'));var authService=require(_0x8895('0xe'));var qs=require(_0x8895('0xf'));var as=require(_0x8895('0x10'));var hardwareService=require(_0x8895('0x11'));var logger=require(_0x8895('0x12'))('api');var utils=require(_0x8895('0x13'));var config=require(_0x8895('0x14'));var db=require(_0x8895('0x15'))['db'];function respondWithStatusCode(_0x301bec,_0x446e1a){_0x446e1a=_0x446e1a||0xcc;return function(_0xaf93bc){if(_0xaf93bc){return _0x301bec['sendStatus'](_0x446e1a);}return _0x301bec[_0x8895('0x16')](_0x446e1a)[_0x8895('0x17')]();};}function respondWithResult(_0x56c18e,_0x57d40a){_0x57d40a=_0x57d40a||0xc8;return function(_0x47b9fe){if(_0x47b9fe){return _0x56c18e[_0x8895('0x16')](_0x57d40a)['json'](_0x47b9fe);}};}function respondWithFilteredResult(_0x4156f5,_0x337101){return function(_0x195789){if(_0x195789){var _0x3d7b59=_0x195789[_0x8895('0x18')],_0x2c9d40=_0x337101[_0x8895('0x19')],_0x5b4c2e=_0x337101[_0x8895('0x19')]+_0x337101[_0x8895('0x1a')],_0x4128e2;if(_0x5b4c2e>=_0x3d7b59){_0x5b4c2e=_0x3d7b59;_0x4128e2=0xc8;}else{_0x4128e2=0xce;}_0x4156f5[_0x8895('0x16')](_0x4128e2);return _0x4156f5[_0x8895('0x1b')](_0x8895('0x1c'),_0x2c9d40+'-'+_0x5b4c2e+'/'+_0x3d7b59)[_0x8895('0x1d')](_0x195789);}return null;};}function patchUpdates(_0x2da618){return function(_0x24fef0){try{jsonpatch[_0x8895('0x1e')](_0x24fef0,_0x2da618,!![]);}catch(_0x2df795){return BPromise['reject'](_0x2df795);}return _0x24fef0['save']();};}function saveUpdates(_0x4fcbc3,_0x3daf43){return function(_0x456282){if(_0x456282){return _0x456282[_0x8895('0x1f')](_0x4fcbc3)[_0x8895('0x20')](function(_0x3f7d5a){return _0x3f7d5a;});}return null;};}function removeEntity(_0x35bda5,_0x461346){return function(_0xc1ce17){if(_0xc1ce17){return _0xc1ce17['destroy']()[_0x8895('0x20')](function(){_0x35bda5[_0x8895('0x16')](0xcc)[_0x8895('0x17')]();});}};}function handleEntityNotFound(_0x1f71f3,_0x29223d){return function(_0x4d092d){if(!_0x4d092d){_0x1f71f3['sendStatus'](0x194);}return _0x4d092d;};}function handleError(_0x278c81,_0x398382){_0x398382=_0x398382||0x1f4;return function(_0x38f7ad){logger[_0x8895('0x21')](_0x38f7ad['stack']);if(_0x38f7ad[_0x8895('0x22')]){delete _0x38f7ad[_0x8895('0x22')];}_0x278c81[_0x8895('0x16')](_0x398382)['send'](_0x38f7ad);};}exports['index']=function(_0x78b57,_0x555e60){var _0x3d51b0={},_0x3e3b48={},_0x10b48f={'count':0x0,'rows':[]};var _0xf5fb66=_[_0x8895('0x23')](db['VoiceMailMessage']['rawAttributes'],function(_0x6e449d){return{'name':_0x6e449d[_0x8895('0x24')],'type':_0x6e449d[_0x8895('0x25')][_0x8895('0x26')]};});_0x3e3b48[_0x8895('0x27')]=_['differenceBy'](_['map'](_0xf5fb66,_0x8895('0x22')),[_0x8895('0x22')]);_0x3e3b48[_0x8895('0x28')]=_[_0x8895('0x29')](_0x78b57[_0x8895('0x28')]);_0x3e3b48['filters']=_[_0x8895('0x2a')](_0x3e3b48['model'],_0x3e3b48[_0x8895('0x28')]);_0x3d51b0['attributes']=_[_0x8895('0x2a')](_0x3e3b48[_0x8895('0x27')],qs[_0x8895('0x2b')](_0x78b57[_0x8895('0x28')][_0x8895('0x2b')]));_0x3d51b0['attributes']=_0x3d51b0[_0x8895('0x2c')][_0x8895('0x2d')]?_0x3d51b0[_0x8895('0x2c')]:_0x3e3b48[_0x8895('0x27')];if(!_0x78b57[_0x8895('0x28')]['hasOwnProperty'](_0x8895('0x2e'))){_0x3d51b0['limit']=qs[_0x8895('0x1a')](_0x78b57['query'][_0x8895('0x1a')]);_0x3d51b0[_0x8895('0x19')]=qs[_0x8895('0x19')](_0x78b57[_0x8895('0x28')][_0x8895('0x19')]);}_0x3d51b0['order']=qs[_0x8895('0x2f')](_0x78b57['query'][_0x8895('0x2f')]);_0x3d51b0[_0x8895('0x30')]=qs[_0x8895('0x31')](_[_0x8895('0x32')](_0x78b57[_0x8895('0x28')],_0x3e3b48[_0x8895('0x31')]));if(_0x78b57['query'][_0x8895('0x33')]){_0x3d51b0[_0x8895('0x30')]=_['merge'](_0x3d51b0[_0x8895('0x30')],{'$or':_['map'](_0xf5fb66,function(_0x134d5c){if(_0x134d5c[_0x8895('0x25')]!=='VIRTUAL'){var _0xa01540={};_0xa01540[_0x134d5c[_0x8895('0x22')]]={'$like':'%'+_0x78b57['query']['filter']+'%'};return _0xa01540;}})});}_0x3d51b0=_[_0x8895('0x34')]({},_0x3d51b0,_0x78b57[_0x8895('0x35')]);var _0x55aacc={'where':_0x3d51b0[_0x8895('0x30')]};return db[_0x8895('0x36')]['count'](_0x55aacc)[_0x8895('0x20')](function(_0x25c854){_0x10b48f[_0x8895('0x18')]=_0x25c854;if(_0x78b57[_0x8895('0x28')][_0x8895('0x37')]){_0x3d51b0[_0x8895('0x38')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x8895('0x39')](_0x3d51b0);})['then'](function(_0x20a521){_0x10b48f[_0x8895('0x3a')]=_0x20a521;return _0x10b48f;})['then'](respondWithFilteredResult(_0x555e60,_0x3d51b0))[_0x8895('0x3b')](handleError(_0x555e60,null));};exports['show']=function(_0x1e6395,_0x5e6413){var _0x4af3b1={'raw':!![],'where':{'id':_0x1e6395['params']['id']}},_0x51277b={};_0x51277b['model']=_['keys'](db[_0x8895('0x36')][_0x8895('0x3c')]);_0x51277b['query']=_['keys'](_0x1e6395[_0x8895('0x28')]);_0x51277b[_0x8895('0x31')]=_['intersection'](_0x51277b[_0x8895('0x27')],_0x51277b[_0x8895('0x28')]);_0x4af3b1[_0x8895('0x2c')]=_[_0x8895('0x2a')](_0x51277b[_0x8895('0x27')],qs['fields'](_0x1e6395['query']['fields']));_0x4af3b1[_0x8895('0x2c')]=_0x4af3b1['attributes'][_0x8895('0x2d')]?_0x4af3b1[_0x8895('0x2c')]:_0x51277b[_0x8895('0x27')];if(_0x1e6395[_0x8895('0x28')]['includeAll']){_0x4af3b1[_0x8895('0x38')]=[{'all':!![]}];}_0x4af3b1=_[_0x8895('0x34')]({},_0x4af3b1,_0x1e6395[_0x8895('0x35')]);return db[_0x8895('0x36')][_0x8895('0x3d')](_0x4af3b1)[_0x8895('0x20')](handleEntityNotFound(_0x5e6413,null))[_0x8895('0x20')](respondWithResult(_0x5e6413,null))[_0x8895('0x3b')](handleError(_0x5e6413,null));};exports['create']=function(_0x4740df,_0x3bf0e3){return db['VoiceMailMessage'][_0x8895('0x3e')](_0x4740df['body'],{})['then'](respondWithResult(_0x3bf0e3,0xc9))[_0x8895('0x3b')](handleError(_0x3bf0e3,null));};exports[_0x8895('0x1f')]=function(_0x130018,_0x53c4a2){if(_0x130018[_0x8895('0x3f')]['id']){delete _0x130018['body']['id'];}return db[_0x8895('0x36')][_0x8895('0x3d')]({'where':{'id':_0x130018[_0x8895('0x40')]['id']}})[_0x8895('0x20')](handleEntityNotFound(_0x53c4a2,null))[_0x8895('0x20')](saveUpdates(_0x130018[_0x8895('0x3f')],null))[_0x8895('0x20')](respondWithResult(_0x53c4a2,null))['catch'](handleError(_0x53c4a2,null));};exports['destroy']=function(_0x2a933c,_0x113c8c){return db['VoiceMailMessage'][_0x8895('0x3d')]({'where':{'id':_0x2a933c['params']['id']}})['then'](handleEntityNotFound(_0x113c8c,null))[_0x8895('0x20')](removeEntity(_0x113c8c,null))['catch'](handleError(_0x113c8c,null));};exports[_0x8895('0x41')]=function(_0x2c2979,_0x43aada,_0x459e1a){return db[_0x8895('0x36')][_0x8895('0x3d')]({'where':{'id':_0x2c2979[_0x8895('0x40')]['id']},'attributes':['id',_0x8895('0x42'),'msg_id']})[_0x8895('0x20')](handleEntityNotFound(_0x43aada,null))[_0x8895('0x20')](function(_0x2f81f7){if(_0x2f81f7){if(!_0x2f81f7['recording']){throw new db[(_0x8895('0x43'))][(_0x8895('0x44'))](_0x8895('0x45'));}var _0x14e769={'Content-Type':_0x8895('0x46'),'Content-Disposition':_0x8895('0x47')};if(_0x2f81f7[_0x8895('0x48')]){_0x14e769[_0x8895('0x49')]=_0x8895('0x4a')+_0x2f81f7[_0x8895('0x48')]+'.wav\x22';}_0x43aada[_0x8895('0x1b')](_0x14e769);return _0x43aada[_0x8895('0x4b')](new Buffer(_0x2f81f7[_0x8895('0x42')]));}})[_0x8895('0x3b')](handleError(_0x43aada,null));}; \ No newline at end of file +var _0x24ca=['index','map','VoiceMailMessage','rawAttributes','type','key','model','keys','filters','intersection','attributes','query','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','fields','length','find','create','body','destroy','download','recording','msg_id','Sequelize','audio/wav','Content-Disposition','.wav\x22','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','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','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','stack','name','send'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x24ca,0x1bc));var _0xa24c=function(_0x28014d,_0x383e2f){_0x28014d=_0x28014d-0x0;var _0x2572cc=_0x24ca[_0x28014d];return _0x2572cc;};'use strict';var pdf=require(_0xa24c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa24c('0x1'));var zipdir=require(_0xa24c('0x2'));var jsonpatch=require(_0xa24c('0x3'));var rp=require('request-promise');var moment=require(_0xa24c('0x4'));var BPromise=require(_0xa24c('0x5'));var Mustache=require(_0xa24c('0x6'));var util=require(_0xa24c('0x7'));var path=require(_0xa24c('0x8'));var sox=require(_0xa24c('0x9'));var csv=require(_0xa24c('0xa'));var ejs=require(_0xa24c('0xb'));var fs=require('fs');var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0xa'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43bcd3,_0x11090c){_0x11090c=_0x11090c||0xcc;return function(_0xcee4fe){if(_0xcee4fe){return _0x43bcd3[_0xa24c('0x1a')](_0x11090c);}return _0x43bcd3['status'](_0x11090c)[_0xa24c('0x1b')]();};}function respondWithResult(_0x3c23fc,_0x26ff28){_0x26ff28=_0x26ff28||0xc8;return function(_0x2fcd8b){if(_0x2fcd8b){return _0x3c23fc[_0xa24c('0x1c')](_0x26ff28)[_0xa24c('0x1d')](_0x2fcd8b);}};}function respondWithFilteredResult(_0x448275,_0x5d4727){return function(_0x47a063){if(_0x47a063){var _0xb80781=_0x47a063[_0xa24c('0x1e')],_0x87aa90=_0x5d4727[_0xa24c('0x1f')],_0x49ce53=_0x5d4727['offset']+_0x5d4727[_0xa24c('0x20')],_0x5babb5;if(_0x49ce53>=_0xb80781){_0x49ce53=_0xb80781;_0x5babb5=0xc8;}else{_0x5babb5=0xce;}_0x448275['status'](_0x5babb5);return _0x448275[_0xa24c('0x21')](_0xa24c('0x22'),_0x87aa90+'-'+_0x49ce53+'/'+_0xb80781)[_0xa24c('0x1d')](_0x47a063);}return null;};}function patchUpdates(_0xefdbd9){return function(_0x4ff97c){try{jsonpatch[_0xa24c('0x23')](_0x4ff97c,_0xefdbd9,!![]);}catch(_0x18b7e0){return BPromise[_0xa24c('0x24')](_0x18b7e0);}return _0x4ff97c['save']();};}function saveUpdates(_0x48a768,_0x506424){return function(_0x4cd77e){if(_0x4cd77e){return _0x4cd77e[_0xa24c('0x25')](_0x48a768)[_0xa24c('0x26')](function(_0x26e9c3){return _0x26e9c3;});}return null;};}function removeEntity(_0x180297,_0x51a275){return function(_0x30ec21){if(_0x30ec21){return _0x30ec21['destroy']()[_0xa24c('0x26')](function(){_0x180297[_0xa24c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(!_0x43a0c0){_0x346ee8[_0xa24c('0x1a')](0x194);}return _0x43a0c0;};}function handleError(_0x14cc65,_0x47e0eb){_0x47e0eb=_0x47e0eb||0x1f4;return function(_0xec9167){logger['error'](_0xec9167[_0xa24c('0x27')]);if(_0xec9167[_0xa24c('0x28')]){delete _0xec9167[_0xa24c('0x28')];}_0x14cc65['status'](_0x47e0eb)[_0xa24c('0x29')](_0xec9167);};}exports[_0xa24c('0x2a')]=function(_0x14fd5a,_0x314121){var _0x11e4e0={},_0x3ad0e6={},_0x39609a={'count':0x0,'rows':[]};var _0x5b23f4=_[_0xa24c('0x2b')](db[_0xa24c('0x2c')][_0xa24c('0x2d')],function(_0x12dbdc){return{'name':_0x12dbdc['fieldName'],'type':_0x12dbdc[_0xa24c('0x2e')][_0xa24c('0x2f')]};});_0x3ad0e6[_0xa24c('0x30')]=_['differenceBy'](_[_0xa24c('0x2b')](_0x5b23f4,_0xa24c('0x28')),[_0xa24c('0x28')]);_0x3ad0e6['query']=_[_0xa24c('0x31')](_0x14fd5a['query']);_0x3ad0e6[_0xa24c('0x32')]=_[_0xa24c('0x33')](_0x3ad0e6[_0xa24c('0x30')],_0x3ad0e6['query']);_0x11e4e0[_0xa24c('0x34')]=_[_0xa24c('0x33')](_0x3ad0e6[_0xa24c('0x30')],qs['fields'](_0x14fd5a[_0xa24c('0x35')]['fields']));_0x11e4e0[_0xa24c('0x34')]=_0x11e4e0[_0xa24c('0x34')]['length']?_0x11e4e0['attributes']:_0x3ad0e6[_0xa24c('0x30')];if(!_0x14fd5a[_0xa24c('0x35')][_0xa24c('0x36')](_0xa24c('0x37'))){_0x11e4e0[_0xa24c('0x20')]=qs[_0xa24c('0x20')](_0x14fd5a[_0xa24c('0x35')]['limit']);_0x11e4e0[_0xa24c('0x1f')]=qs[_0xa24c('0x1f')](_0x14fd5a[_0xa24c('0x35')][_0xa24c('0x1f')]);}_0x11e4e0[_0xa24c('0x38')]=qs[_0xa24c('0x39')](_0x14fd5a[_0xa24c('0x35')][_0xa24c('0x39')]);_0x11e4e0[_0xa24c('0x3a')]=qs[_0xa24c('0x32')](_['pick'](_0x14fd5a[_0xa24c('0x35')],_0x3ad0e6[_0xa24c('0x32')]));if(_0x14fd5a[_0xa24c('0x35')][_0xa24c('0x3b')]){_0x11e4e0['where']=_['merge'](_0x11e4e0[_0xa24c('0x3a')],{'$or':_['map'](_0x5b23f4,function(_0xb690b5){if(_0xb690b5[_0xa24c('0x2e')]!==_0xa24c('0x3c')){var _0xa10c1={};_0xa10c1[_0xb690b5[_0xa24c('0x28')]]={'$like':'%'+_0x14fd5a['query']['filter']+'%'};return _0xa10c1;}})});}_0x11e4e0=_[_0xa24c('0x3d')]({},_0x11e4e0,_0x14fd5a[_0xa24c('0x3e')]);var _0x3603db={'where':_0x11e4e0[_0xa24c('0x3a')]};return db[_0xa24c('0x2c')][_0xa24c('0x1e')](_0x3603db)['then'](function(_0x56f392){_0x39609a[_0xa24c('0x1e')]=_0x56f392;if(_0x14fd5a[_0xa24c('0x35')][_0xa24c('0x3f')]){_0x11e4e0[_0xa24c('0x40')]=[{'all':!![]}];}return db[_0xa24c('0x2c')]['findAll'](_0x11e4e0);})[_0xa24c('0x26')](function(_0x7895e){_0x39609a['rows']=_0x7895e;return _0x39609a;})['then'](respondWithFilteredResult(_0x314121,_0x11e4e0))[_0xa24c('0x41')](handleError(_0x314121,null));};exports[_0xa24c('0x42')]=function(_0x231eea,_0x537849){var _0x58ac8b={'raw':!![],'where':{'id':_0x231eea[_0xa24c('0x43')]['id']}},_0x21e204={};_0x21e204[_0xa24c('0x30')]=_[_0xa24c('0x31')](db[_0xa24c('0x2c')][_0xa24c('0x2d')]);_0x21e204[_0xa24c('0x35')]=_[_0xa24c('0x31')](_0x231eea['query']);_0x21e204['filters']=_[_0xa24c('0x33')](_0x21e204[_0xa24c('0x30')],_0x21e204[_0xa24c('0x35')]);_0x58ac8b['attributes']=_[_0xa24c('0x33')](_0x21e204[_0xa24c('0x30')],qs[_0xa24c('0x44')](_0x231eea[_0xa24c('0x35')][_0xa24c('0x44')]));_0x58ac8b[_0xa24c('0x34')]=_0x58ac8b[_0xa24c('0x34')][_0xa24c('0x45')]?_0x58ac8b[_0xa24c('0x34')]:_0x21e204[_0xa24c('0x30')];if(_0x231eea['query'][_0xa24c('0x3f')]){_0x58ac8b[_0xa24c('0x40')]=[{'all':!![]}];}_0x58ac8b=_[_0xa24c('0x3d')]({},_0x58ac8b,_0x231eea['options']);return db[_0xa24c('0x2c')][_0xa24c('0x46')](_0x58ac8b)[_0xa24c('0x26')](handleEntityNotFound(_0x537849,null))[_0xa24c('0x26')](respondWithResult(_0x537849,null))[_0xa24c('0x41')](handleError(_0x537849,null));};exports[_0xa24c('0x47')]=function(_0x1a20bd,_0x46f725){return db[_0xa24c('0x2c')][_0xa24c('0x47')](_0x1a20bd[_0xa24c('0x48')],{})['then'](respondWithResult(_0x46f725,0xc9))[_0xa24c('0x41')](handleError(_0x46f725,null));};exports[_0xa24c('0x25')]=function(_0x42028b,_0x32afc2){if(_0x42028b[_0xa24c('0x48')]['id']){delete _0x42028b[_0xa24c('0x48')]['id'];}return db[_0xa24c('0x2c')][_0xa24c('0x46')]({'where':{'id':_0x42028b[_0xa24c('0x43')]['id']}})['then'](handleEntityNotFound(_0x32afc2,null))['then'](saveUpdates(_0x42028b[_0xa24c('0x48')],null))['then'](respondWithResult(_0x32afc2,null))[_0xa24c('0x41')](handleError(_0x32afc2,null));};exports[_0xa24c('0x49')]=function(_0x4ec677,_0x24b3df){return db[_0xa24c('0x2c')][_0xa24c('0x46')]({'where':{'id':_0x4ec677['params']['id']}})['then'](handleEntityNotFound(_0x24b3df,null))[_0xa24c('0x26')](removeEntity(_0x24b3df,null))['catch'](handleError(_0x24b3df,null));};exports[_0xa24c('0x4a')]=function(_0x2a3665,_0x3c3c8b,_0x37f7ea){return db[_0xa24c('0x2c')][_0xa24c('0x46')]({'where':{'id':_0x2a3665[_0xa24c('0x43')]['id']},'attributes':['id',_0xa24c('0x4b'),_0xa24c('0x4c')]})[_0xa24c('0x26')](handleEntityNotFound(_0x3c3c8b,null))['then'](function(_0xfe488c){if(_0xfe488c){if(!_0xfe488c[_0xa24c('0x4b')]){throw new db[(_0xa24c('0x4d'))]['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0x487cc9={'Content-Type':_0xa24c('0x4e'),'Content-Disposition':'attachment'};if(_0xfe488c[_0xa24c('0x4c')]){_0x487cc9[_0xa24c('0x4f')]='attachment;\x20filename=\x22'+_0xfe488c[_0xa24c('0x4c')]+_0xa24c('0x50');}_0x3c3c8b[_0xa24c('0x21')](_0x487cc9);return _0x3c3c8b[_0xa24c('0x29')](new Buffer(_0xfe488c[_0xa24c('0x4b')]));}})[_0xa24c('0x41')](handleError(_0x3c3c8b,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 9de99b7..fc1e306 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 _0x41c2=['util','bluebird','request-promise','path','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir'];(function(_0x3cf1d8,_0x1a60c5){var _0x4ace84=function(_0x2417e7){while(--_0x2417e7){_0x3cf1d8['push'](_0x3cf1d8['shift']());}};_0x4ace84(++_0x1a60c5);}(_0x41c2,0x1a7));var _0x241c=function(_0x145973,_0x23a7ce){_0x145973=_0x145973-0x0;var _0x7141ce=_0x41c2[_0x145973];return _0x7141ce;};'use strict';var _=require('lodash');var util=require(_0x241c('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x241c('0x1'));var rp=require(_0x241c('0x2'));var fs=require('fs');var path=require(_0x241c('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x241c('0x4'));module[_0x241c('0x5')]=function(_0x4ae826,_0x12d0e7){return _0x4ae826[_0x241c('0x6')](_0x241c('0x7'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':'dir','fields':[_0x241c('0x8')]}],'timestamps':![]});}; \ No newline at end of file +var _0xe1ce=['dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage'];(function(_0x1c8446,_0x43c489){var _0xf5c1f7=function(_0x535308){while(--_0x535308){_0x1c8446['push'](_0x1c8446['shift']());}};_0xf5c1f7(++_0x43c489);}(_0xe1ce,0x1d2));var _0xee1c=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xe1ce[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require(_0xee1c('0x0'));var util=require(_0xee1c('0x1'));var logger=require(_0xee1c('0x2'))(_0xee1c('0x3'));var moment=require(_0xee1c('0x4'));var BPromise=require(_0xee1c('0x5'));var rp=require(_0xee1c('0x6'));var fs=require('fs');var path=require(_0xee1c('0x7'));var rimraf=require(_0xee1c('0x8'));var config=require(_0xee1c('0x9'));var attributes=require(_0xee1c('0xa'));module[_0xee1c('0xb')]=function(_0x23287d,_0x1a8789){return _0x23287d[_0xee1c('0xc')](_0xee1c('0xd'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0xee1c('0xe'),'fields':[_0xee1c('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index d784a45..9af68be 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 _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x4975,0x86));var _0x5497=function(_0x4a9e7f,_0x1f4fd2){_0x4a9e7f=_0x4a9e7f-0x0;var _0xc8e66e=_0x4975[_0x4a9e7f];return _0xc8e66e;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file +var _0xda2d=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment'];(function(_0x259c99,_0x28fc7b){var _0x589fef=function(_0x3fd915){while(--_0x3fd915){_0x259c99['push'](_0x259c99['shift']());}};_0x589fef(++_0x28fc7b);}(_0xda2d,0x102));var _0xdda2=function(_0x3054ca,_0x2852e8){_0x3054ca=_0x3054ca-0x0;var _0x33f557=_0xda2d[_0x3054ca];return _0x33f557;};'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']('VoiceMailMessage,\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')]('VoiceMailMessage,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 3082381..5add19f 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 _0xe978=['isAuthenticated','index','/:id','/:id/sounds','getSounds','post','create','put','update','destroy','removeSound','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x18c292,_0xb66e7d){var _0x495418=function(_0x3a26f8){while(--_0x3a26f8){_0x18c292['push'](_0x18c292['shift']());}};_0x495418(++_0xb66e7d);}(_0xe978,0xfc));var _0x8e97=function(_0xee2962,_0x30b614){_0xee2962=_0xee2962-0x0;var _0x115838=_0xe978[_0xee2962];return _0x115838;};'use strict';var multer=require(_0x8e97('0x0'));var util=require(_0x8e97('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8e97('0x2'));var router=express[_0x8e97('0x3')]();var auth=require(_0x8e97('0x4'));var interaction=require(_0x8e97('0x5'));var config=require(_0x8e97('0x6'));var controller=require('./voiceMusicOnHold.controller');router[_0x8e97('0x7')]('/',auth[_0x8e97('0x8')](),controller[_0x8e97('0x9')]);router['get'](_0x8e97('0xa'),auth[_0x8e97('0x8')](),controller['show']);router[_0x8e97('0x7')](_0x8e97('0xb'),auth[_0x8e97('0x8')](),controller[_0x8e97('0xc')]);router[_0x8e97('0xd')]('/',auth['isAuthenticated'](),controller[_0x8e97('0xe')]);router['post'](_0x8e97('0xb'),auth[_0x8e97('0x8')](),controller['addSound']);router[_0x8e97('0xf')](_0x8e97('0xa'),auth[_0x8e97('0x8')](),controller[_0x8e97('0x10')]);router['delete'](_0x8e97('0xa'),auth[_0x8e97('0x8')](),controller[_0x8e97('0x11')]);router['delete']('/:id/sounds/:id2',auth['isAuthenticated'](),controller[_0x8e97('0x12')]);module[_0x8e97('0x13')]=router; \ No newline at end of file +var _0xb264=['connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','/:id/sounds','post','create','addSound','update','delete','destroy','removeSound','multer','util'];(function(_0x2c1114,_0x2a5c50){var _0x2b877c=function(_0x4f356d){while(--_0x4f356d){_0x2c1114['push'](_0x2c1114['shift']());}};_0x2b877c(++_0x2a5c50);}(_0xb264,0x108));var _0x4b26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb264[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4b26('0x0'));var util=require(_0x4b26('0x1'));var path=require('path');var timeout=require(_0x4b26('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x4b26('0x3'));var interaction=require(_0x4b26('0x4'));var config=require(_0x4b26('0x5'));var controller=require(_0x4b26('0x6'));router[_0x4b26('0x7')]('/',auth[_0x4b26('0x8')](),controller[_0x4b26('0x9')]);router['get'](_0x4b26('0xa'),auth[_0x4b26('0x8')](),controller['show']);router[_0x4b26('0x7')](_0x4b26('0xb'),auth[_0x4b26('0x8')](),controller['getSounds']);router[_0x4b26('0xc')]('/',auth[_0x4b26('0x8')](),controller[_0x4b26('0xd')]);router[_0x4b26('0xc')](_0x4b26('0xb'),auth['isAuthenticated'](),controller[_0x4b26('0xe')]);router['put'](_0x4b26('0xa'),auth[_0x4b26('0x8')](),controller[_0x4b26('0xf')]);router[_0x4b26('0x10')](_0x4b26('0xa'),auth['isAuthenticated'](),controller[_0x4b26('0x11')]);router[_0x4b26('0x10')]('/:id/sounds/:id2',auth['isAuthenticated'](),controller[_0x4b26('0x12')]);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 3e34115..f39cb1f 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 _0xecbe=['name','custom','mp3nb','quietmp3nb','mp3','TIMESTAMP','BOOLEAN','sequelize','exports','STRING'];(function(_0x5d92c2,_0x26d815){var _0x415601=function(_0x507e8f){while(--_0x507e8f){_0x5d92c2['push'](_0x5d92c2['shift']());}};_0x415601(++_0x26d815);}(_0xecbe,0x1a1));var _0xeecb=function(_0x571714,_0x30d2b3){_0x571714=_0x571714-0x0;var _0x599a14=_0xecbe[_0x571714];return _0x599a14;};'use strict';var Sequelize=require(_0xeecb('0x0'));module[_0xeecb('0x1')]={'name':{'type':Sequelize[_0xeecb('0x2')],'allowNull':![],'unique':_0xeecb('0x3')},'mode':{'type':Sequelize['ENUM'](_0xeecb('0x4'),'files',_0xeecb('0x5'),_0xeecb('0x6'),'quietmp3',_0xeecb('0x7')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xeecb('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xeecb('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xeecb('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xeecb('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xeecb('0x2')],'allowNull':!![]},'stamp':{'type':_0xeecb('0x8')},'defaultEntry':{'type':Sequelize[_0xeecb('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc822=['sequelize','exports','STRING','ENUM','custom','mp3nb','quietmp3nb','quietmp3','mp3','files'];(function(_0x30e3d0,_0x261bdb){var _0x325af5=function(_0x21140a){while(--_0x21140a){_0x30e3d0['push'](_0x30e3d0['shift']());}};_0x325af5(++_0x261bdb);}(_0xc822,0x186));var _0x2c82=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xc822[_0x5b78e8];return _0xf2c321;};'use strict';var Sequelize=require(_0x2c82('0x0'));module[_0x2c82('0x1')]={'name':{'type':Sequelize[_0x2c82('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x2c82('0x3')](_0x2c82('0x4'),'files',_0x2c82('0x5'),_0x2c82('0x6'),_0x2c82('0x7'),_0x2c82('0x8')),'allowNull':!![],'defaultValue':_0x2c82('0x9')},'directory':{'type':Sequelize[_0x2c82('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x2c82('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x2c82('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x2c82('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x2c82('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 71ac5c9..50da402 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 _0xa8a1=['attributes','hasOwnProperty','sort','where','pick','filter','merge','options','VoiceMusicOnHold','includeAll','findAll','rows','catch','show','params','fields','length','include','find','update','body','create','sequelize','transaction','files','join','root','server/files/moh','mode','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','readdirSync','directory','forEach','rmdirSync','Sequelize','ValidationError','addSound','findOne','save_name','converted_format','createdAt','format','%s.%s','extname','removeSound','id2','unlinkSync','getSounds','Sound','order','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','destroy','then','get','MusicOnHolds','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xa8a1,0x1ef));var _0x1a8a=function(_0x41bfa1,_0x15e28c){_0x41bfa1=_0x41bfa1-0x0;var _0x49b8d5=_0xa8a1[_0x41bfa1];return _0x49b8d5;};'use strict';var pdf=require(_0x1a8a('0x0'));var emlformat=require(_0x1a8a('0x1'));var rimraf=require(_0x1a8a('0x2'));var zipdir=require(_0x1a8a('0x3'));var jsonpatch=require(_0x1a8a('0x4'));var rp=require(_0x1a8a('0x5'));var moment=require(_0x1a8a('0x6'));var BPromise=require(_0x1a8a('0x7'));var Mustache=require(_0x1a8a('0x8'));var util=require(_0x1a8a('0x9'));var path=require(_0x1a8a('0xa'));var sox=require('sox');var csv=require(_0x1a8a('0xb'));var ejs=require(_0x1a8a('0xc'));var fs=require('fs');var _=require(_0x1a8a('0xd'));var squel=require(_0x1a8a('0xe'));var crypto=require('crypto');var jsforce=require(_0x1a8a('0xf'));var deskjs=require(_0x1a8a('0x10'));var toCsv=require(_0x1a8a('0xb'));var querystring=require('querystring');var Papa=require(_0x1a8a('0x11'));var Redis=require(_0x1a8a('0x12'));var authService=require(_0x1a8a('0x13'));var qs=require(_0x1a8a('0x14'));var as=require(_0x1a8a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a8a('0x16'))(_0x1a8a('0x17'));var utils=require(_0x1a8a('0x18'));var config=require('../../config/environment');var db=require(_0x1a8a('0x19'))['db'];function respondWithStatusCode(_0x16c6a6,_0xb39da3){_0xb39da3=_0xb39da3||0xcc;return function(_0x57afda){if(_0x57afda){return _0x16c6a6[_0x1a8a('0x1a')](_0xb39da3);}return _0x16c6a6[_0x1a8a('0x1b')](_0xb39da3)['end']();};}function respondWithResult(_0x36d6d7,_0x5b089c){_0x5b089c=_0x5b089c||0xc8;return function(_0xec6e4a){if(_0xec6e4a){return _0x36d6d7[_0x1a8a('0x1b')](_0x5b089c)[_0x1a8a('0x1c')](_0xec6e4a);}};}function respondWithFilteredResult(_0x4bcd25,_0x851fb8){return function(_0x9a19a1){if(_0x9a19a1){var _0x5e9f0b=_0x9a19a1[_0x1a8a('0x1d')],_0x25ad58=_0x851fb8[_0x1a8a('0x1e')],_0xdf84a=_0x851fb8['offset']+_0x851fb8[_0x1a8a('0x1f')],_0x18bc77;if(_0xdf84a>=_0x5e9f0b){_0xdf84a=_0x5e9f0b;_0x18bc77=0xc8;}else{_0x18bc77=0xce;}_0x4bcd25['status'](_0x18bc77);return _0x4bcd25['set'](_0x1a8a('0x20'),_0x25ad58+'-'+_0xdf84a+'/'+_0x5e9f0b)[_0x1a8a('0x1c')](_0x9a19a1);}return null;};}function patchUpdates(_0x4b3fa5){return function(_0x1ba7ee){try{jsonpatch[_0x1a8a('0x21')](_0x1ba7ee,_0x4b3fa5,!![]);}catch(_0x3d0f19){return BPromise[_0x1a8a('0x22')](_0x3d0f19);}return _0x1ba7ee['save']();};}function saveUpdates(_0xae7520,_0x5f5a13){return function(_0x37f596){if(_0x37f596){return _0x37f596['update'](_0xae7520)['then'](function(_0xdbb57b){return _0xdbb57b;});}return null;};}function removeEntity(_0x1f7793,_0x31cab1){return function(_0x176181){if(_0x176181){return _0x176181[_0x1a8a('0x23')]()[_0x1a8a('0x24')](function(){var _0xe1e562=_0x176181[_0x1a8a('0x25')]({'plain':!![]});var _0x20b26d=_0x1a8a('0x26');return db['UserProfileResource'][_0x1a8a('0x23')]({'where':{'type':_0x20b26d,'resourceId':_0xe1e562['id']}})[_0x1a8a('0x24')](function(){return _0x176181;});})['then'](function(){_0x1f7793['status'](0xcc)[_0x1a8a('0x27')]();});}};}function handleEntityNotFound(_0x852f9e,_0x30540e){return function(_0x318478){if(!_0x318478){_0x852f9e[_0x1a8a('0x1a')](0x194);}return _0x318478;};}function handleError(_0x354df2,_0x1c3e9d){_0x1c3e9d=_0x1c3e9d||0x1f4;return function(_0x45494e){logger[_0x1a8a('0x28')](_0x45494e[_0x1a8a('0x29')]);if(_0x45494e[_0x1a8a('0x2a')]){delete _0x45494e['name'];}_0x354df2[_0x1a8a('0x1b')](_0x1c3e9d)[_0x1a8a('0x2b')](_0x45494e);};}exports[_0x1a8a('0x2c')]=function(_0x15be15,_0x2df590){var _0x27223c={},_0x188438={},_0x570cf0={'count':0x0,'rows':[]};var _0x1ea3c7=_[_0x1a8a('0x2d')](db['VoiceMusicOnHold'][_0x1a8a('0x2e')],function(_0x5f2534){return{'name':_0x5f2534[_0x1a8a('0x2f')],'type':_0x5f2534[_0x1a8a('0x30')][_0x1a8a('0x31')]};});_0x188438[_0x1a8a('0x32')]=_[_0x1a8a('0x2d')](_0x1ea3c7,_0x1a8a('0x2a'));_0x188438['query']=_[_0x1a8a('0x33')](_0x15be15[_0x1a8a('0x34')]);_0x188438[_0x1a8a('0x35')]=_[_0x1a8a('0x36')](_0x188438['model'],_0x188438[_0x1a8a('0x34')]);_0x27223c[_0x1a8a('0x37')]=_[_0x1a8a('0x36')](_0x188438[_0x1a8a('0x32')],qs['fields'](_0x15be15[_0x1a8a('0x34')]['fields']));_0x27223c[_0x1a8a('0x37')]=_0x27223c['attributes']['length']?_0x27223c[_0x1a8a('0x37')]:_0x188438[_0x1a8a('0x32')];if(!_0x15be15[_0x1a8a('0x34')][_0x1a8a('0x38')]('nolimit')){_0x27223c[_0x1a8a('0x1f')]=qs[_0x1a8a('0x1f')](_0x15be15[_0x1a8a('0x34')][_0x1a8a('0x1f')]);_0x27223c[_0x1a8a('0x1e')]=qs[_0x1a8a('0x1e')](_0x15be15['query'][_0x1a8a('0x1e')]);}_0x27223c['order']=qs[_0x1a8a('0x39')](_0x15be15[_0x1a8a('0x34')]['sort']);_0x27223c[_0x1a8a('0x3a')]=qs['filters'](_[_0x1a8a('0x3b')](_0x15be15[_0x1a8a('0x34')],_0x188438[_0x1a8a('0x35')]));if(_0x15be15[_0x1a8a('0x34')][_0x1a8a('0x3c')]){_0x27223c['where']=_['merge'](_0x27223c['where'],{'$or':_['map'](_0x1ea3c7,function(_0x227b21){if(_0x227b21[_0x1a8a('0x30')]!=='VIRTUAL'){var _0x578b41={};_0x578b41[_0x227b21[_0x1a8a('0x2a')]]={'$like':'%'+_0x15be15[_0x1a8a('0x34')][_0x1a8a('0x3c')]+'%'};return _0x578b41;}})});}_0x27223c=_[_0x1a8a('0x3d')]({},_0x27223c,_0x15be15[_0x1a8a('0x3e')]);var _0x5e24aa={'where':_0x27223c['where']};return db[_0x1a8a('0x3f')][_0x1a8a('0x1d')](_0x5e24aa)[_0x1a8a('0x24')](function(_0x3e04e0){_0x570cf0[_0x1a8a('0x1d')]=_0x3e04e0;if(_0x15be15['query'][_0x1a8a('0x40')]){_0x27223c['include']=[{'all':!![]}];}return db[_0x1a8a('0x3f')][_0x1a8a('0x41')](_0x27223c);})['then'](function(_0x58e4a3){_0x570cf0[_0x1a8a('0x42')]=_0x58e4a3;return _0x570cf0;})['then'](respondWithFilteredResult(_0x2df590,_0x27223c))[_0x1a8a('0x43')](handleError(_0x2df590,null));};exports[_0x1a8a('0x44')]=function(_0x50cf33,_0x42393e){var _0x5e2286={'raw':![],'where':{'id':_0x50cf33[_0x1a8a('0x45')]['id']}},_0x4d87ab={};_0x4d87ab[_0x1a8a('0x32')]=_[_0x1a8a('0x33')](db[_0x1a8a('0x3f')][_0x1a8a('0x2e')]);_0x4d87ab[_0x1a8a('0x34')]=_[_0x1a8a('0x33')](_0x50cf33[_0x1a8a('0x34')]);_0x4d87ab[_0x1a8a('0x35')]=_['intersection'](_0x4d87ab[_0x1a8a('0x32')],_0x4d87ab['query']);_0x5e2286[_0x1a8a('0x37')]=_[_0x1a8a('0x36')](_0x4d87ab[_0x1a8a('0x32')],qs[_0x1a8a('0x46')](_0x50cf33[_0x1a8a('0x34')]['fields']));_0x5e2286[_0x1a8a('0x37')]=_0x5e2286[_0x1a8a('0x37')][_0x1a8a('0x47')]?_0x5e2286[_0x1a8a('0x37')]:_0x4d87ab[_0x1a8a('0x32')];if(_0x50cf33['query'][_0x1a8a('0x40')]){_0x5e2286[_0x1a8a('0x48')]=[{'all':!![]}];}_0x5e2286=_[_0x1a8a('0x3d')]({},_0x5e2286,_0x50cf33[_0x1a8a('0x3e')]);return db['VoiceMusicOnHold'][_0x1a8a('0x49')](_0x5e2286)[_0x1a8a('0x24')](handleEntityNotFound(_0x42393e,null))['then'](respondWithResult(_0x42393e,null))[_0x1a8a('0x43')](handleError(_0x42393e,null));};exports[_0x1a8a('0x4a')]=function(_0x3ffdae,_0x39fc06){if(_0x3ffdae[_0x1a8a('0x4b')]['id']){delete _0x3ffdae[_0x1a8a('0x4b')]['id'];}return db[_0x1a8a('0x3f')][_0x1a8a('0x49')]({'where':{'id':_0x3ffdae[_0x1a8a('0x45')]['id']}})[_0x1a8a('0x24')](handleEntityNotFound(_0x39fc06,null))['then'](saveUpdates(_0x3ffdae['body'],null))['then'](respondWithResult(_0x39fc06,null))[_0x1a8a('0x43')](handleError(_0x39fc06,null));};exports[_0x1a8a('0x4c')]=function(_0x44eef8,_0x57e29e,_0x194eaa){return db[_0x1a8a('0x4d')][_0x1a8a('0x4e')](function(_0x245baa){if(_0x44eef8[_0x1a8a('0x4b')]['mode']===_0x1a8a('0x4f')){_0x44eef8['body']['directory']=path[_0x1a8a('0x50')](config[_0x1a8a('0x51')],_0x1a8a('0x52'),_0x44eef8[_0x1a8a('0x4b')][_0x1a8a('0x2a')]);}return db[_0x1a8a('0x3f')][_0x1a8a('0x4c')](_0x44eef8['body'],{'transaction':_0x245baa})[_0x1a8a('0x24')](function(_0x3d3d18){if(_0x44eef8['body'][_0x1a8a('0x53')]===_0x1a8a('0x4f')){fs[_0x1a8a('0x54')](_0x3d3d18['directory'],parseInt('0777',0x8));}var _0x40a3d9=_0x44eef8[_0x1a8a('0x55')][_0x1a8a('0x25')]({'plain':!![]});if(!_0x40a3d9)throw new Error(_0x1a8a('0x56'));if(_0x40a3d9[_0x1a8a('0x57')]===_0x1a8a('0x55')){var _0x47ba3e=_0x3d3d18['get']({'plain':!![]});return db['UserProfileSection'][_0x1a8a('0x49')]({'where':{'name':_0x1a8a('0x26'),'userProfileId':_0x40a3d9[_0x1a8a('0x58')]},'raw':!![]})[_0x1a8a('0x24')](function(_0x346ae3){if(_0x346ae3&&_0x346ae3[_0x1a8a('0x59')]===0x0){return db['UserProfileResource'][_0x1a8a('0x4c')]({'name':_0x47ba3e[_0x1a8a('0x2a')],'resourceId':_0x47ba3e['id'],'type':_0x346ae3['name'],'sectionId':_0x346ae3['id']},{})[_0x1a8a('0x24')](function(){return _0x3d3d18;});}else{return _0x3d3d18;}})[_0x1a8a('0x43')](function(_0x41909f){logger[_0x1a8a('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41909f);});}return _0x3d3d18;});})['then'](respondWithResult(_0x57e29e,0xc9))[_0x1a8a('0x43')](handleError(_0x57e29e,null));};exports[_0x1a8a('0x23')]=function(_0x43015d,_0x4234ae,_0x243acb){var _0x360755;return db[_0x1a8a('0x3f')][_0x1a8a('0x49')]({'where':{'id':_0x43015d['params']['id']}})[_0x1a8a('0x24')](function(_0x507940){if(_0x507940){return db[_0x1a8a('0x4d')]['transaction'](function(_0x1330bd){return _0x507940[_0x1a8a('0x23')]({'transaction':_0x1330bd,'raw':!![]})[_0x1a8a('0x24')](function(_0x301f17){if(_0x301f17['directory']){fs[_0x1a8a('0x5a')](_0x301f17[_0x1a8a('0x5b')])[_0x1a8a('0x5c')](function(_0x1a34b){fs['unlinkSync'](path['join'](_0x301f17[_0x1a8a('0x5b')],_0x1a34b));});fs[_0x1a8a('0x5d')](_0x301f17[_0x1a8a('0x5b')]);}return _0x301f17;});})[_0x1a8a('0x43')](function(_0x2490dc){throw new db[(_0x1a8a('0x5e'))][(_0x1a8a('0x5f'))](_0x2490dc['message']);});}})[_0x1a8a('0x24')](handleEntityNotFound(_0x4234ae,null))[_0x1a8a('0x24')](removeEntity(_0x4234ae,null))[_0x1a8a('0x43')](handleError(_0x4234ae,null));};exports[_0x1a8a('0x60')]=function(_0x276eb5,_0x1ed706,_0x58e301){return db[_0x1a8a('0x4d')][_0x1a8a('0x4e')](function(_0xc2856b){var _0x2a7185;return db[_0x1a8a('0x3f')]['find']({'where':{'id':_0x276eb5[_0x1a8a('0x45')]['id']}})['then'](function(_0x5e52f1){if(_0x5e52f1){_0x2a7185=_0x5e52f1;return _0x5e52f1[_0x1a8a('0x60')](_0x276eb5[_0x1a8a('0x4b')]['id'],{'transaction':_0xc2856b});}})[_0x1a8a('0x24')](function(_0x1f1ce2){if(_0x1f1ce2){return db['Sound'][_0x1a8a('0x61')]({'where':{'id':_0x276eb5[_0x1a8a('0x4b')]['id']},'attributes':['id',_0x1a8a('0x2a'),_0x1a8a('0x62'),_0x1a8a('0x63'),_0x1a8a('0x64')],'raw':!![]});}})[_0x1a8a('0x24')](function(_0x2db363){if(_0x2db363){var _0x1269bc=path[_0x1a8a('0x50')](config[_0x1a8a('0x51')],'server/files/sounds/converted',util[_0x1a8a('0x65')](_0x1a8a('0x66'),path['basename'](_0x2db363[_0x1a8a('0x62')],path[_0x1a8a('0x67')](_0x2db363[_0x1a8a('0x62')])),_0x2db363[_0x1a8a('0x63')]));var _0x110def=path['join'](config[_0x1a8a('0x51')],_0x1a8a('0x52'),_0x2a7185[_0x1a8a('0x2a')],util[_0x1a8a('0x65')](_0x1a8a('0x66'),_0x2db363['name'],_0x2db363[_0x1a8a('0x63')]));fs['symlinkSync'](_0x1269bc,_0x110def);return _0x2db363;}})['catch'](function(_0x475e69){throw new db['Sequelize']['ValidationError'](_0x475e69['message']);});})[_0x1a8a('0x24')](handleEntityNotFound(_0x1ed706,null))[_0x1a8a('0x24')](respondWithResult(_0x1ed706,0xc9))[_0x1a8a('0x43')](handleError(_0x1ed706,null));};exports[_0x1a8a('0x68')]=function(_0x4211e2,_0x1840c1,_0x328c97){return db[_0x1a8a('0x4d')][_0x1a8a('0x4e')](function(_0x206084){var _0x49eba8;return db[_0x1a8a('0x3f')][_0x1a8a('0x61')]({'where':{'id':_0x4211e2[_0x1a8a('0x45')]['id']}})[_0x1a8a('0x24')](handleEntityNotFound(_0x1840c1,null))['then'](function(_0x4f638e){if(_0x4f638e){_0x49eba8=_0x4f638e;return _0x4f638e[_0x1a8a('0x68')](_0x4211e2['params']['id2']);}})[_0x1a8a('0x24')](function(_0x1b03e3){if(_0x1b03e3){return db['Sound'][_0x1a8a('0x61')]({'where':{'id':_0x4211e2[_0x1a8a('0x45')][_0x1a8a('0x69')]},'attributes':['id','name',_0x1a8a('0x62'),'converted_format',_0x1a8a('0x64')],'raw':!![]});}})[_0x1a8a('0x24')](function(_0x40e8a0){if(_0x40e8a0){fs[_0x1a8a('0x6a')](path['join'](_0x49eba8[_0x1a8a('0x5b')],util[_0x1a8a('0x65')](_0x1a8a('0x66'),_0x40e8a0[_0x1a8a('0x2a')],_0x40e8a0[_0x1a8a('0x63')])));return _0x40e8a0;}})[_0x1a8a('0x43')](function(_0x22e327){throw new db[(_0x1a8a('0x5e'))][(_0x1a8a('0x5f'))](_0x22e327['message']);});})[_0x1a8a('0x24')](handleEntityNotFound(_0x1840c1,null))['then'](respondWithStatusCode(_0x1840c1,0xcc))[_0x1a8a('0x43')](handleError(_0x1840c1,null));};exports[_0x1a8a('0x6b')]=function(_0x448eb7,_0x18b68b,_0x3390b7){var _0x215a2d={};var _0x31b699={};var _0x2e1228;var _0x29470b;return db[_0x1a8a('0x3f')]['findOne']({'where':{'id':_0x448eb7['params']['id']}})[_0x1a8a('0x24')](handleEntityNotFound(_0x18b68b,null))['then'](function(_0x41beca){if(_0x41beca){_0x2e1228=_0x41beca;_0x31b699[_0x1a8a('0x32')]=_['keys'](db[_0x1a8a('0x6c')]['rawAttributes']);_0x31b699[_0x1a8a('0x34')]=_['keys'](_0x448eb7[_0x1a8a('0x34')]);_0x31b699[_0x1a8a('0x35')]=_[_0x1a8a('0x36')](_0x31b699[_0x1a8a('0x32')],_0x31b699['query']);_0x215a2d[_0x1a8a('0x37')]=_[_0x1a8a('0x36')](_0x31b699[_0x1a8a('0x32')],qs[_0x1a8a('0x46')](_0x448eb7[_0x1a8a('0x34')][_0x1a8a('0x46')]));_0x215a2d['attributes']=_0x215a2d['attributes']['length']?_0x215a2d[_0x1a8a('0x37')]:_0x31b699[_0x1a8a('0x32')];_0x215a2d[_0x1a8a('0x6d')]=qs[_0x1a8a('0x39')](_0x448eb7[_0x1a8a('0x34')]['sort']);_0x215a2d[_0x1a8a('0x3a')]=qs[_0x1a8a('0x35')](_[_0x1a8a('0x3b')](_0x448eb7[_0x1a8a('0x34')],_0x31b699[_0x1a8a('0x35')]));if(_0x448eb7[_0x1a8a('0x34')][_0x1a8a('0x3c')]){_0x215a2d[_0x1a8a('0x3a')]=_[_0x1a8a('0x3d')](_0x215a2d['where'],{'$or':_[_0x1a8a('0x2d')](_0x215a2d['attributes'],function(_0x56957d){var _0x19fb0f={};_0x19fb0f[_0x56957d]={'$like':'%'+_0x448eb7[_0x1a8a('0x34')][_0x1a8a('0x3c')]+'%'};return _0x19fb0f;})});}_0x215a2d=_[_0x1a8a('0x3d')]({},_0x215a2d,_0x448eb7[_0x1a8a('0x3e')]);return _0x2e1228['getSounds'](_0x215a2d);}})['then'](function(_0x471928){if(_0x471928){_0x29470b=_0x471928[_0x1a8a('0x47')];if(!_0x448eb7[_0x1a8a('0x34')][_0x1a8a('0x38')]('nolimit')){_0x215a2d[_0x1a8a('0x1f')]=qs[_0x1a8a('0x1f')](_0x448eb7['query'][_0x1a8a('0x1f')]);_0x215a2d[_0x1a8a('0x1e')]=qs['offset'](_0x448eb7[_0x1a8a('0x34')]['offset']);}return _0x2e1228[_0x1a8a('0x6b')](_0x215a2d);}})[_0x1a8a('0x24')](function(_0x315807){if(_0x315807){return _0x315807?{'count':_0x29470b,'rows':_0x315807}:null;}})[_0x1a8a('0x24')](respondWithResult(_0x18b68b,null))['catch'](handleError(_0x18b68b,null));}; \ No newline at end of file +var _0x8506=['path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','apply','save','destroy','get','MusicOnHolds','UserProfileResource','then','error','stack','name','index','map','rawAttributes','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','VoiceMusicOnHold','count','includeAll','include','findAll','rows','catch','show','keys','length','find','update','body','params','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','message','addSound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','symlinkSync','Sequelize','removeSound','id2','getSounds','Sound','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x5b2880,_0x306e40){var _0x1aa5a6=function(_0x51b7b5){while(--_0x51b7b5){_0x5b2880['push'](_0x5b2880['shift']());}};_0x1aa5a6(++_0x306e40);}(_0x8506,0x1aa));var _0x6850=function(_0x2e8ac0,_0x5b0d33){_0x2e8ac0=_0x2e8ac0-0x0;var _0x29b13e=_0x8506[_0x2e8ac0];return _0x29b13e;};'use strict';var pdf=require(_0x6850('0x0'));var emlformat=require(_0x6850('0x1'));var rimraf=require(_0x6850('0x2'));var zipdir=require(_0x6850('0x3'));var jsonpatch=require(_0x6850('0x4'));var rp=require(_0x6850('0x5'));var moment=require(_0x6850('0x6'));var BPromise=require(_0x6850('0x7'));var Mustache=require(_0x6850('0x8'));var util=require(_0x6850('0x9'));var path=require(_0x6850('0xa'));var sox=require(_0x6850('0xb'));var csv=require(_0x6850('0xc'));var ejs=require(_0x6850('0xd'));var fs=require('fs');var _=require(_0x6850('0xe'));var squel=require('squel');var crypto=require(_0x6850('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x6850('0x10'));var toCsv=require(_0x6850('0xc'));var querystring=require('querystring');var Papa=require(_0x6850('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6850('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6850('0x13'))(_0x6850('0x14'));var utils=require('../../config/utils');var config=require(_0x6850('0x15'));var db=require(_0x6850('0x16'))['db'];function respondWithStatusCode(_0x56a81a,_0xe61ecf){_0xe61ecf=_0xe61ecf||0xcc;return function(_0x43d844){if(_0x43d844){return _0x56a81a[_0x6850('0x17')](_0xe61ecf);}return _0x56a81a[_0x6850('0x18')](_0xe61ecf)[_0x6850('0x19')]();};}function respondWithResult(_0x4f7534,_0x178a6d){_0x178a6d=_0x178a6d||0xc8;return function(_0x164501){if(_0x164501){return _0x4f7534['status'](_0x178a6d)[_0x6850('0x1a')](_0x164501);}};}function respondWithFilteredResult(_0x91ef64,_0x42e37e){return function(_0xa7d8e7){if(_0xa7d8e7){var _0x1cdbba=_0xa7d8e7['count'],_0x155f38=_0x42e37e['offset'],_0x543536=_0x42e37e[_0x6850('0x1b')]+_0x42e37e['limit'],_0x1421e1;if(_0x543536>=_0x1cdbba){_0x543536=_0x1cdbba;_0x1421e1=0xc8;}else{_0x1421e1=0xce;}_0x91ef64['status'](_0x1421e1);return _0x91ef64['set']('Content-Range',_0x155f38+'-'+_0x543536+'/'+_0x1cdbba)[_0x6850('0x1a')](_0xa7d8e7);}return null;};}function patchUpdates(_0x307b63){return function(_0xc30b52){try{jsonpatch[_0x6850('0x1c')](_0xc30b52,_0x307b63,!![]);}catch(_0x7042b){return BPromise['reject'](_0x7042b);}return _0xc30b52[_0x6850('0x1d')]();};}function saveUpdates(_0x573cf7,_0x56512f){return function(_0x273856){if(_0x273856){return _0x273856['update'](_0x573cf7)['then'](function(_0x24b68c){return _0x24b68c;});}return null;};}function removeEntity(_0x31dcd1,_0x8ba47b){return function(_0xf1eeb8){if(_0xf1eeb8){return _0xf1eeb8[_0x6850('0x1e')]()['then'](function(){var _0x1dd9c3=_0xf1eeb8[_0x6850('0x1f')]({'plain':!![]});var _0x510d9d=_0x6850('0x20');return db[_0x6850('0x21')][_0x6850('0x1e')]({'where':{'type':_0x510d9d,'resourceId':_0x1dd9c3['id']}})[_0x6850('0x22')](function(){return _0xf1eeb8;});})[_0x6850('0x22')](function(){_0x31dcd1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f87a9,_0x5a788b){return function(_0x2e3523){if(!_0x2e3523){_0x1f87a9['sendStatus'](0x194);}return _0x2e3523;};}function handleError(_0x184b57,_0x1eae8a){_0x1eae8a=_0x1eae8a||0x1f4;return function(_0x4e866a){logger[_0x6850('0x23')](_0x4e866a[_0x6850('0x24')]);if(_0x4e866a[_0x6850('0x25')]){delete _0x4e866a[_0x6850('0x25')];}_0x184b57[_0x6850('0x18')](_0x1eae8a)['send'](_0x4e866a);};}exports[_0x6850('0x26')]=function(_0x6c48dd,_0x5126af){var _0x89b2b6={},_0x36a52e={},_0x583b96={'count':0x0,'rows':[]};var _0x5b0be4=_[_0x6850('0x27')](db['VoiceMusicOnHold'][_0x6850('0x28')],function(_0x2d32d8){return{'name':_0x2d32d8['fieldName'],'type':_0x2d32d8[_0x6850('0x29')]['key']};});_0x36a52e[_0x6850('0x2a')]=_[_0x6850('0x27')](_0x5b0be4,_0x6850('0x25'));_0x36a52e[_0x6850('0x2b')]=_['keys'](_0x6c48dd[_0x6850('0x2b')]);_0x36a52e[_0x6850('0x2c')]=_[_0x6850('0x2d')](_0x36a52e[_0x6850('0x2a')],_0x36a52e[_0x6850('0x2b')]);_0x89b2b6['attributes']=_['intersection'](_0x36a52e[_0x6850('0x2a')],qs[_0x6850('0x2e')](_0x6c48dd[_0x6850('0x2b')][_0x6850('0x2e')]));_0x89b2b6[_0x6850('0x2f')]=_0x89b2b6[_0x6850('0x2f')]['length']?_0x89b2b6[_0x6850('0x2f')]:_0x36a52e['model'];if(!_0x6c48dd[_0x6850('0x2b')][_0x6850('0x30')](_0x6850('0x31'))){_0x89b2b6['limit']=qs[_0x6850('0x32')](_0x6c48dd[_0x6850('0x2b')]['limit']);_0x89b2b6[_0x6850('0x1b')]=qs[_0x6850('0x1b')](_0x6c48dd[_0x6850('0x2b')][_0x6850('0x1b')]);}_0x89b2b6[_0x6850('0x33')]=qs[_0x6850('0x34')](_0x6c48dd[_0x6850('0x2b')][_0x6850('0x34')]);_0x89b2b6['where']=qs[_0x6850('0x2c')](_[_0x6850('0x35')](_0x6c48dd[_0x6850('0x2b')],_0x36a52e[_0x6850('0x2c')]));if(_0x6c48dd[_0x6850('0x2b')][_0x6850('0x36')]){_0x89b2b6[_0x6850('0x37')]=_[_0x6850('0x38')](_0x89b2b6['where'],{'$or':_[_0x6850('0x27')](_0x5b0be4,function(_0x3daddd){if(_0x3daddd[_0x6850('0x29')]!==_0x6850('0x39')){var _0x24d73e={};_0x24d73e[_0x3daddd[_0x6850('0x25')]]={'$like':'%'+_0x6c48dd[_0x6850('0x2b')]['filter']+'%'};return _0x24d73e;}})});}_0x89b2b6=_[_0x6850('0x38')]({},_0x89b2b6,_0x6c48dd[_0x6850('0x3a')]);var _0x28bde1={'where':_0x89b2b6[_0x6850('0x37')]};return db[_0x6850('0x3b')]['count'](_0x28bde1)[_0x6850('0x22')](function(_0x2c40f6){_0x583b96[_0x6850('0x3c')]=_0x2c40f6;if(_0x6c48dd[_0x6850('0x2b')][_0x6850('0x3d')]){_0x89b2b6[_0x6850('0x3e')]=[{'all':!![]}];}return db[_0x6850('0x3b')][_0x6850('0x3f')](_0x89b2b6);})[_0x6850('0x22')](function(_0x539c6e){_0x583b96[_0x6850('0x40')]=_0x539c6e;return _0x583b96;})[_0x6850('0x22')](respondWithFilteredResult(_0x5126af,_0x89b2b6))[_0x6850('0x41')](handleError(_0x5126af,null));};exports[_0x6850('0x42')]=function(_0x5abc81,_0x5bf1fd){var _0x2e179a={'raw':![],'where':{'id':_0x5abc81['params']['id']}},_0x35a25f={};_0x35a25f[_0x6850('0x2a')]=_[_0x6850('0x43')](db['VoiceMusicOnHold']['rawAttributes']);_0x35a25f[_0x6850('0x2b')]=_[_0x6850('0x43')](_0x5abc81[_0x6850('0x2b')]);_0x35a25f[_0x6850('0x2c')]=_[_0x6850('0x2d')](_0x35a25f[_0x6850('0x2a')],_0x35a25f[_0x6850('0x2b')]);_0x2e179a[_0x6850('0x2f')]=_[_0x6850('0x2d')](_0x35a25f[_0x6850('0x2a')],qs[_0x6850('0x2e')](_0x5abc81[_0x6850('0x2b')][_0x6850('0x2e')]));_0x2e179a[_0x6850('0x2f')]=_0x2e179a['attributes'][_0x6850('0x44')]?_0x2e179a[_0x6850('0x2f')]:_0x35a25f[_0x6850('0x2a')];if(_0x5abc81[_0x6850('0x2b')][_0x6850('0x3d')]){_0x2e179a[_0x6850('0x3e')]=[{'all':!![]}];}_0x2e179a=_[_0x6850('0x38')]({},_0x2e179a,_0x5abc81[_0x6850('0x3a')]);return db[_0x6850('0x3b')][_0x6850('0x45')](_0x2e179a)[_0x6850('0x22')](handleEntityNotFound(_0x5bf1fd,null))[_0x6850('0x22')](respondWithResult(_0x5bf1fd,null))[_0x6850('0x41')](handleError(_0x5bf1fd,null));};exports[_0x6850('0x46')]=function(_0x18dde5,_0xb9639c){if(_0x18dde5[_0x6850('0x47')]['id']){delete _0x18dde5[_0x6850('0x47')]['id'];}return db[_0x6850('0x3b')][_0x6850('0x45')]({'where':{'id':_0x18dde5[_0x6850('0x48')]['id']}})['then'](handleEntityNotFound(_0xb9639c,null))[_0x6850('0x22')](saveUpdates(_0x18dde5[_0x6850('0x47')],null))['then'](respondWithResult(_0xb9639c,null))[_0x6850('0x41')](handleError(_0xb9639c,null));};exports[_0x6850('0x49')]=function(_0x4034ab,_0x5af4a5,_0x410ac2){return db[_0x6850('0x4a')][_0x6850('0x4b')](function(_0x5cfff0){if(_0x4034ab[_0x6850('0x47')][_0x6850('0x4c')]===_0x6850('0x4d')){_0x4034ab[_0x6850('0x47')][_0x6850('0x4e')]=path[_0x6850('0x4f')](config[_0x6850('0x50')],_0x6850('0x51'),_0x4034ab[_0x6850('0x47')][_0x6850('0x25')]);}return db[_0x6850('0x3b')][_0x6850('0x49')](_0x4034ab['body'],{'transaction':_0x5cfff0})[_0x6850('0x22')](function(_0x182ef3){if(_0x4034ab[_0x6850('0x47')][_0x6850('0x4c')]==='files'){fs[_0x6850('0x52')](_0x182ef3[_0x6850('0x4e')],parseInt('0777',0x8));}var _0x8ca802=_0x4034ab[_0x6850('0x53')]['get']({'plain':!![]});if(!_0x8ca802)throw new Error(_0x6850('0x54'));if(_0x8ca802[_0x6850('0x55')]==='user'){var _0x3ce99f=_0x182ef3['get']({'plain':!![]});return db['UserProfileSection'][_0x6850('0x45')]({'where':{'name':_0x6850('0x20'),'userProfileId':_0x8ca802['userProfileId']},'raw':!![]})[_0x6850('0x22')](function(_0x576ba0){if(_0x576ba0&&_0x576ba0[_0x6850('0x56')]===0x0){return db[_0x6850('0x21')][_0x6850('0x49')]({'name':_0x3ce99f['name'],'resourceId':_0x3ce99f['id'],'type':_0x576ba0[_0x6850('0x25')],'sectionId':_0x576ba0['id']},{})['then'](function(){return _0x182ef3;});}else{return _0x182ef3;}})[_0x6850('0x41')](function(_0x4d4efb){logger[_0x6850('0x23')](_0x6850('0x57'),_0x4d4efb);});}return _0x182ef3;});})[_0x6850('0x22')](respondWithResult(_0x5af4a5,0xc9))[_0x6850('0x41')](handleError(_0x5af4a5,null));};exports[_0x6850('0x1e')]=function(_0x2f5f78,_0x306611,_0x4b2f99){var _0x58cc11;return db['VoiceMusicOnHold'][_0x6850('0x45')]({'where':{'id':_0x2f5f78[_0x6850('0x48')]['id']}})[_0x6850('0x22')](function(_0x24170a){if(_0x24170a){return db[_0x6850('0x4a')]['transaction'](function(_0x336b15){return _0x24170a['destroy']({'transaction':_0x336b15,'raw':!![]})[_0x6850('0x22')](function(_0x337875){if(_0x337875[_0x6850('0x4e')]){fs[_0x6850('0x58')](_0x337875[_0x6850('0x4e')])[_0x6850('0x59')](function(_0x42bbe8){fs[_0x6850('0x5a')](path[_0x6850('0x4f')](_0x337875[_0x6850('0x4e')],_0x42bbe8));});fs[_0x6850('0x5b')](_0x337875[_0x6850('0x4e')]);}return _0x337875;});})[_0x6850('0x41')](function(_0x2e0b5f){throw new db['Sequelize'][(_0x6850('0x5c'))](_0x2e0b5f[_0x6850('0x5d')]);});}})[_0x6850('0x22')](handleEntityNotFound(_0x306611,null))[_0x6850('0x22')](removeEntity(_0x306611,null))[_0x6850('0x41')](handleError(_0x306611,null));};exports[_0x6850('0x5e')]=function(_0x3306c1,_0x54cc32,_0x54e7ee){return db[_0x6850('0x4a')]['transaction'](function(_0x4dbd6e){var _0x44507e;return db[_0x6850('0x3b')]['find']({'where':{'id':_0x3306c1[_0x6850('0x48')]['id']}})['then'](function(_0x5d9cd2){if(_0x5d9cd2){_0x44507e=_0x5d9cd2;return _0x5d9cd2['addSound'](_0x3306c1[_0x6850('0x47')]['id'],{'transaction':_0x4dbd6e});}})[_0x6850('0x22')](function(_0x1e0129){if(_0x1e0129){return db['Sound'][_0x6850('0x5f')]({'where':{'id':_0x3306c1[_0x6850('0x47')]['id']},'attributes':['id',_0x6850('0x25'),_0x6850('0x60'),_0x6850('0x61'),_0x6850('0x62')],'raw':!![]});}})[_0x6850('0x22')](function(_0x16b670){if(_0x16b670){var _0x372dcd=path[_0x6850('0x4f')](config[_0x6850('0x50')],_0x6850('0x63'),util[_0x6850('0x64')](_0x6850('0x65'),path[_0x6850('0x66')](_0x16b670[_0x6850('0x60')],path['extname'](_0x16b670[_0x6850('0x60')])),_0x16b670[_0x6850('0x61')]));var _0x22a943=path[_0x6850('0x4f')](config[_0x6850('0x50')],_0x6850('0x51'),_0x44507e['name'],util['format'](_0x6850('0x65'),_0x16b670['name'],_0x16b670['converted_format']));fs[_0x6850('0x67')](_0x372dcd,_0x22a943);return _0x16b670;}})[_0x6850('0x41')](function(_0x2bfcd4){throw new db[(_0x6850('0x68'))]['ValidationError'](_0x2bfcd4[_0x6850('0x5d')]);});})[_0x6850('0x22')](handleEntityNotFound(_0x54cc32,null))[_0x6850('0x22')](respondWithResult(_0x54cc32,0xc9))['catch'](handleError(_0x54cc32,null));};exports['removeSound']=function(_0x586aea,_0x5a7e8b,_0x46c8fd){return db[_0x6850('0x4a')][_0x6850('0x4b')](function(_0x246a2a){var _0x6caa3;return db[_0x6850('0x3b')]['findOne']({'where':{'id':_0x586aea['params']['id']}})[_0x6850('0x22')](handleEntityNotFound(_0x5a7e8b,null))[_0x6850('0x22')](function(_0x3f47b8){if(_0x3f47b8){_0x6caa3=_0x3f47b8;return _0x3f47b8[_0x6850('0x69')](_0x586aea['params'][_0x6850('0x6a')]);}})[_0x6850('0x22')](function(_0x1b7189){if(_0x1b7189){return db['Sound'][_0x6850('0x5f')]({'where':{'id':_0x586aea[_0x6850('0x48')][_0x6850('0x6a')]},'attributes':['id',_0x6850('0x25'),'save_name','converted_format',_0x6850('0x62')],'raw':!![]});}})[_0x6850('0x22')](function(_0x2b525c){if(_0x2b525c){fs[_0x6850('0x5a')](path[_0x6850('0x4f')](_0x6caa3['directory'],util[_0x6850('0x64')](_0x6850('0x65'),_0x2b525c[_0x6850('0x25')],_0x2b525c['converted_format'])));return _0x2b525c;}})['catch'](function(_0x4f34f7){throw new db['Sequelize']['ValidationError'](_0x4f34f7['message']);});})[_0x6850('0x22')](handleEntityNotFound(_0x5a7e8b,null))['then'](respondWithStatusCode(_0x5a7e8b,0xcc))[_0x6850('0x41')](handleError(_0x5a7e8b,null));};exports[_0x6850('0x6b')]=function(_0xd7cb8b,_0x35c3d6,_0x553367){var _0x39e5df={};var _0x419b4c={};var _0x465aa8;var _0x44664d;return db[_0x6850('0x3b')][_0x6850('0x5f')]({'where':{'id':_0xd7cb8b[_0x6850('0x48')]['id']}})[_0x6850('0x22')](handleEntityNotFound(_0x35c3d6,null))[_0x6850('0x22')](function(_0x4fc5e6){if(_0x4fc5e6){_0x465aa8=_0x4fc5e6;_0x419b4c['model']=_[_0x6850('0x43')](db[_0x6850('0x6c')]['rawAttributes']);_0x419b4c['query']=_[_0x6850('0x43')](_0xd7cb8b[_0x6850('0x2b')]);_0x419b4c[_0x6850('0x2c')]=_['intersection'](_0x419b4c[_0x6850('0x2a')],_0x419b4c['query']);_0x39e5df['attributes']=_['intersection'](_0x419b4c['model'],qs[_0x6850('0x2e')](_0xd7cb8b[_0x6850('0x2b')][_0x6850('0x2e')]));_0x39e5df[_0x6850('0x2f')]=_0x39e5df[_0x6850('0x2f')][_0x6850('0x44')]?_0x39e5df[_0x6850('0x2f')]:_0x419b4c[_0x6850('0x2a')];_0x39e5df[_0x6850('0x33')]=qs['sort'](_0xd7cb8b[_0x6850('0x2b')][_0x6850('0x34')]);_0x39e5df[_0x6850('0x37')]=qs[_0x6850('0x2c')](_[_0x6850('0x35')](_0xd7cb8b[_0x6850('0x2b')],_0x419b4c[_0x6850('0x2c')]));if(_0xd7cb8b[_0x6850('0x2b')][_0x6850('0x36')]){_0x39e5df['where']=_[_0x6850('0x38')](_0x39e5df[_0x6850('0x37')],{'$or':_['map'](_0x39e5df[_0x6850('0x2f')],function(_0x5f0a61){var _0x29511e={};_0x29511e[_0x5f0a61]={'$like':'%'+_0xd7cb8b['query'][_0x6850('0x36')]+'%'};return _0x29511e;})});}_0x39e5df=_[_0x6850('0x38')]({},_0x39e5df,_0xd7cb8b[_0x6850('0x3a')]);return _0x465aa8[_0x6850('0x6b')](_0x39e5df);}})[_0x6850('0x22')](function(_0x462184){if(_0x462184){_0x44664d=_0x462184[_0x6850('0x44')];if(!_0xd7cb8b[_0x6850('0x2b')][_0x6850('0x30')](_0x6850('0x31'))){_0x39e5df['limit']=qs[_0x6850('0x32')](_0xd7cb8b['query'][_0x6850('0x32')]);_0x39e5df[_0x6850('0x1b')]=qs[_0x6850('0x1b')](_0xd7cb8b[_0x6850('0x2b')]['offset']);}return _0x465aa8['getSounds'](_0x39e5df);}})[_0x6850('0x22')](function(_0x32627b){if(_0x32627b){return _0x32627b?{'count':_0x44664d,'rows':_0x32627b}:null;}})[_0x6850('0x22')](respondWithResult(_0x35c3d6,null))[_0x6850('0x41')](handleError(_0x35c3d6,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 701dba3..86cf973 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 _0x4114=['request-promise','path','rimraf','exports','define','voice_musiconhold','lodash','util','moment','bluebird'];(function(_0xb83b07,_0x144185){var _0x537229=function(_0xeab552){while(--_0xeab552){_0xb83b07['push'](_0xb83b07['shift']());}};_0x537229(++_0x144185);}(_0x4114,0xa6));var _0x4411=function(_0x39ce53,_0x4f847b){_0x39ce53=_0x39ce53-0x0;var _0x5da850=_0x4114[_0x39ce53];return _0x5da850;};'use strict';var _=require(_0x4411('0x0'));var util=require(_0x4411('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4411('0x2'));var BPromise=require(_0x4411('0x3'));var rp=require(_0x4411('0x4'));var fs=require('fs');var path=require(_0x4411('0x5'));var rimraf=require(_0x4411('0x6'));var config=require('../../config/environment');var attributes=require('./voiceMusicOnHold.attributes');module[_0x4411('0x7')]=function(_0x44472c,_0x516d24){return _0x44472c[_0x4411('0x8')]('VoiceMusicOnHold',attributes,{'tableName':_0x4411('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b93=['../../config/environment','./voiceMusicOnHold.attributes','exports','voice_musiconhold','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x581867,_0xb0e543){var _0x47731b=function(_0x2b39a6){while(--_0x2b39a6){_0x581867['push'](_0x581867['shift']());}};_0x47731b(++_0xb0e543);}(_0x2b93,0x1c7));var _0x32b9=function(_0x2f6541,_0x363cba){_0x2f6541=_0x2f6541-0x0;var _0x4d76d8=_0x2b93[_0x2f6541];return _0x4d76d8;};'use strict';var _=require('lodash');var util=require(_0x32b9('0x0'));var logger=require(_0x32b9('0x1'))(_0x32b9('0x2'));var moment=require(_0x32b9('0x3'));var BPromise=require('bluebird');var rp=require(_0x32b9('0x4'));var fs=require('fs');var path=require(_0x32b9('0x5'));var rimraf=require(_0x32b9('0x6'));var config=require(_0x32b9('0x7'));var attributes=require(_0x32b9('0x8'));module[_0x32b9('0x9')]=function(_0x330ea7,_0x17ff49){return _0x330ea7['define']('VoiceMusicOnHold',attributes,{'tableName':_0x32b9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index cb64e25..9d30088 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 _0x9314=['message','info','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xcd2662,_0x3f8cdc){var _0x139665=function(_0x59755f){while(--_0x59755f){_0xcd2662['push'](_0xcd2662['shift']());}};_0x139665(++_0x3f8cdc);}(_0x9314,0x1bd));var _0x4931=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9314[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4931('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4931('0x1'));var rs=require(_0x4931('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4931('0x3'))['db'];var utils=require(_0x4931('0x4'));var logger=require('../../config/logger')(_0x4931('0x5'));var config=require(_0x4931('0x6'));var jayson=require(_0x4931('0x7'));var client=jayson[_0x4931('0x8')][_0x4931('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5addb8,_0x11787b,_0x5d1c11){return new BPromise(function(_0xe12ae4,_0x1bcb12){return client['request'](_0x5addb8,_0x5d1c11)[_0x4931('0xa')](function(_0x366695){logger['info'](_0x4931('0xb'),_0x11787b,_0x4931('0xc'));logger[_0x4931('0xd')](_0x4931('0xe'),_0x11787b,_0x4931('0xc'),JSON[_0x4931('0xf')](_0x366695));if(_0x366695['error']){if(_0x366695[_0x4931('0x10')]['code']===0x1f4){logger[_0x4931('0x10')](_0x4931('0xb'),_0x11787b,_0x366695[_0x4931('0x10')][_0x4931('0x11')]);return _0x1bcb12(_0x366695[_0x4931('0x10')]['message']);}logger[_0x4931('0x10')](_0x4931('0xb'),_0x11787b,_0x366695[_0x4931('0x10')][_0x4931('0x11')]);return _0xe12ae4(_0x366695[_0x4931('0x10')][_0x4931('0x11')]);}else{logger[_0x4931('0x12')](_0x4931('0xb'),_0x11787b,_0x4931('0xc'));_0xe12ae4(_0x366695[_0x4931('0x13')][_0x4931('0x11')]);}})[_0x4931('0x14')](function(_0x2c391d){logger[_0x4931('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x11787b,_0x2c391d);_0x1bcb12(_0x2c391d);});});} \ No newline at end of file +var _0x5c7d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x5c7d,0x97));var _0xd5c7=function(_0x72305c,_0x213daf){_0x72305c=_0x72305c-0x0;var _0x5176f1=_0x5c7d[_0x72305c];return _0x5176f1;};'use strict';var _=require('lodash');var util=require(_0xd5c7('0x0'));var moment=require('moment');var BPromise=require(_0xd5c7('0x1'));var rs=require(_0xd5c7('0x2'));var fs=require('fs');var Redis=require(_0xd5c7('0x3'));var db=require(_0xd5c7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd5c7('0x5'))(_0xd5c7('0x6'));var config=require(_0xd5c7('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd5c7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x349e6c,_0x5c9413,_0x5c6b13){return new BPromise(function(_0x21f983,_0x3e0d04){return client[_0xd5c7('0x9')](_0x349e6c,_0x5c6b13)['then'](function(_0x59e5c1){logger[_0xd5c7('0xa')](_0xd5c7('0xb'),_0x5c9413,_0xd5c7('0xc'));logger[_0xd5c7('0xd')](_0xd5c7('0xe'),_0x5c9413,_0xd5c7('0xc'),JSON[_0xd5c7('0xf')](_0x59e5c1));if(_0x59e5c1['error']){if(_0x59e5c1[_0xd5c7('0x10')]['code']===0x1f4){logger['error'](_0xd5c7('0xb'),_0x5c9413,_0x59e5c1['error']['message']);return _0x3e0d04(_0x59e5c1['error']['message']);}logger[_0xd5c7('0x10')](_0xd5c7('0xb'),_0x5c9413,_0x59e5c1[_0xd5c7('0x10')]['message']);return _0x21f983(_0x59e5c1[_0xd5c7('0x10')][_0xd5c7('0x11')]);}else{logger[_0xd5c7('0xa')](_0xd5c7('0xb'),_0x5c9413,_0xd5c7('0xc'));_0x21f983(_0x59e5c1[_0xd5c7('0x12')][_0xd5c7('0x11')]);}})['catch'](function(_0x34b38b){logger['error'](_0xd5c7('0xb'),_0x5c9413,_0x34b38b);_0x3e0d04(_0x34b38b);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 5a405ee..b177243 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 _0xdba2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','describe','/:id','getAgents','post','create','addAgents','delete','destroy','removeAgents','exports','path','express','Router'];(function(_0x6f186b,_0x39b1df){var _0x28f9a8=function(_0x4b857f){while(--_0x4b857f){_0x6f186b['push'](_0x6f186b['shift']());}};_0x28f9a8(++_0x39b1df);}(_0xdba2,0x129));var _0x2dba=function(_0x440964,_0x56c481){_0x440964=_0x440964-0x0;var _0x4b5276=_0xdba2[_0x440964];return _0x4b5276;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2dba('0x0'));var timeout=require('connect-timeout');var express=require(_0x2dba('0x1'));var router=express[_0x2dba('0x2')]();var auth=require(_0x2dba('0x3'));var interaction=require(_0x2dba('0x4'));var config=require(_0x2dba('0x5'));var controller=require(_0x2dba('0x6'));router[_0x2dba('0x7')]('/',auth[_0x2dba('0x8')](),controller[_0x2dba('0x9')]);router[_0x2dba('0x7')]('/describe',auth[_0x2dba('0x8')](),controller[_0x2dba('0xa')]);router[_0x2dba('0x7')](_0x2dba('0xb'),auth[_0x2dba('0x8')](),controller['show']);router[_0x2dba('0x7')]('/:id/users',auth[_0x2dba('0x8')](),controller[_0x2dba('0xc')]);router[_0x2dba('0xd')]('/',auth['isAuthenticated'](),controller[_0x2dba('0xe')]);router[_0x2dba('0xd')]('/:id/users',auth[_0x2dba('0x8')](),controller[_0x2dba('0xf')]);router['put'](_0x2dba('0xb'),auth[_0x2dba('0x8')](),controller['update']);router[_0x2dba('0x10')](_0x2dba('0xb'),auth[_0x2dba('0x8')](),controller[_0x2dba('0x11')]);router['delete']('/:id/users',auth[_0x2dba('0x8')](),controller[_0x2dba('0x12')]);module[_0x2dba('0x13')]=router; \ No newline at end of file +var _0xeb63=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','show','/:id/users','getAgents','post','create','addAgents','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x9d0705,_0x3553e8){var _0xa3587f=function(_0xacc5f8){while(--_0xacc5f8){_0x9d0705['push'](_0x9d0705['shift']());}};_0xa3587f(++_0x3553e8);}(_0xeb63,0x1b2));var _0x3eb6=function(_0x3af95e,_0x17cf19){_0x3af95e=_0x3af95e-0x0;var _0x1e3c17=_0xeb63[_0x3af95e];return _0x1e3c17;};'use strict';var multer=require(_0x3eb6('0x0'));var util=require(_0x3eb6('0x1'));var path=require(_0x3eb6('0x2'));var timeout=require(_0x3eb6('0x3'));var express=require('express');var router=express[_0x3eb6('0x4')]();var auth=require(_0x3eb6('0x5'));var interaction=require(_0x3eb6('0x6'));var config=require(_0x3eb6('0x7'));var controller=require('./voicePrefix.controller');router['get']('/',auth[_0x3eb6('0x8')](),controller['index']);router[_0x3eb6('0x9')](_0x3eb6('0xa'),auth[_0x3eb6('0x8')](),controller[_0x3eb6('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3eb6('0xc')]);router['get'](_0x3eb6('0xd'),auth['isAuthenticated'](),controller[_0x3eb6('0xe')]);router[_0x3eb6('0xf')]('/',auth[_0x3eb6('0x8')](),controller[_0x3eb6('0x10')]);router[_0x3eb6('0xf')](_0x3eb6('0xd'),auth[_0x3eb6('0x8')](),controller[_0x3eb6('0x11')]);router['put'](_0x3eb6('0x12'),auth[_0x3eb6('0x8')](),controller[_0x3eb6('0x13')]);router[_0x3eb6('0x14')](_0x3eb6('0x12'),auth[_0x3eb6('0x8')](),controller[_0x3eb6('0x15')]);router['delete'](_0x3eb6('0xd'),auth[_0x3eb6('0x8')](),controller['removeAgents']);module[_0x3eb6('0x16')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 696b88d..8e42225 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 _0xafaf=['sequelize','exports','STRING','name','VIRTUAL','system-','getDataValue'];(function(_0x19abee,_0x4c892a){var _0x4e6570=function(_0xdc95ed){while(--_0xdc95ed){_0x19abee['push'](_0x19abee['shift']());}};_0x4e6570(++_0x4c892a);}(_0xafaf,0xfc));var _0xfafa=function(_0x51ebbb,_0xb1fb10){_0x51ebbb=_0x51ebbb-0x0;var _0x4a7c9b=_0xafaf[_0x51ebbb];return _0x4a7c9b;};'use strict';var Sequelize=require(_0xfafa('0x0'));module[_0xfafa('0x1')]={'name':{'type':Sequelize[_0xfafa('0x2')],'allowNull':![],'unique':_0xfafa('0x3')},'prefix':{'type':Sequelize[_0xfafa('0x4')],'get':function(_0x3dd6da){return _0xfafa('0x5')+this[_0xfafa('0x6')](_0xfafa('0x3'))+'-';}},'description':{'type':Sequelize[_0xfafa('0x2')]},'callerIdAll':{'type':Sequelize[_0xfafa('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x1c7d=['system-','getDataValue','INTEGER','sequelize','exports','STRING','name','VIRTUAL'];(function(_0x587fb5,_0x59cb3b){var _0x551105=function(_0x5bbef4){while(--_0x5bbef4){_0x587fb5['push'](_0x587fb5['shift']());}};_0x551105(++_0x59cb3b);}(_0x1c7d,0xe3));var _0xd1c7=function(_0x5842bc,_0x1348b){_0x5842bc=_0x5842bc-0x0;var _0xe16599=_0x1c7d[_0x5842bc];return _0xe16599;};'use strict';var Sequelize=require(_0xd1c7('0x0'));module[_0xd1c7('0x1')]={'name':{'type':Sequelize[_0xd1c7('0x2')],'allowNull':![],'unique':_0xd1c7('0x3')},'prefix':{'type':Sequelize[_0xd1c7('0x4')],'get':function(_0x570c45){return _0xd1c7('0x5')+this[_0xd1c7('0x6')](_0xd1c7('0x3'))+'-';}},'description':{'type':Sequelize[_0xd1c7('0x2')]},'callerIdAll':{'type':Sequelize[_0xd1c7('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xd1c7('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 25658ca..40b6e8c 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 _0x7839=['CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','NoOp','goto','context','${EXTEN:','charAt','update','sequelize','transaction','findById','addAgents','ids','omit','spread','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','emit','findOne','User','pick','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./voicePrefix.socket','status','end','json','offset','limit','set','Content-Range','apply','reject','save','then','get','VoicePrefixes','UserProfileResource','destroy','sendStatus','error','stack','name','VoicePrefix','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','map','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','describe','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','appdata','prefix','Voice\x20Prefix','VoicePrefixId','VoiceExtension','VoiceExtensionId','Extensions\x20creation\x20failed','push','Set'];(function(_0x15fe57,_0x50c402){var _0x21c3d8=function(_0x737874){while(--_0x737874){_0x15fe57['push'](_0x15fe57['shift']());}};_0x21c3d8(++_0x50c402);}(_0x7839,0x190));var _0x9783=function(_0x30b36d,_0x1988f4){_0x30b36d=_0x30b36d-0x0;var _0x452d50=_0x7839[_0x30b36d];return _0x452d50;};'use strict';var pdf=require(_0x9783('0x0'));var emlformat=require(_0x9783('0x1'));var rimraf=require(_0x9783('0x2'));var zipdir=require(_0x9783('0x3'));var jsonpatch=require(_0x9783('0x4'));var rp=require('request-promise');var moment=require(_0x9783('0x5'));var BPromise=require(_0x9783('0x6'));var Mustache=require(_0x9783('0x7'));var util=require(_0x9783('0x8'));var path=require(_0x9783('0x9'));var sox=require(_0x9783('0xa'));var csv=require(_0x9783('0xb'));var ejs=require(_0x9783('0xc'));var fs=require('fs');var _=require(_0x9783('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9783('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9783('0xf'));var Papa=require(_0x9783('0x10'));var Redis=require('ioredis');var authService=require(_0x9783('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9783('0x12'));var hardwareService=require(_0x9783('0x13'));var logger=require(_0x9783('0x14'))(_0x9783('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x9783('0x16'))['db'];config[_0x9783('0x17')]=_[_0x9783('0x18')](config[_0x9783('0x17')],{'host':_0x9783('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9783('0x17')]));require(_0x9783('0x1a'))['register'](socket);function respondWithStatusCode(_0x3ba5ab,_0x453fab){_0x453fab=_0x453fab||0xcc;return function(_0xb6652){if(_0xb6652){return _0x3ba5ab['sendStatus'](_0x453fab);}return _0x3ba5ab[_0x9783('0x1b')](_0x453fab)[_0x9783('0x1c')]();};}function respondWithResult(_0x2d3003,_0x3f6a90){_0x3f6a90=_0x3f6a90||0xc8;return function(_0x28f528){if(_0x28f528){return _0x2d3003[_0x9783('0x1b')](_0x3f6a90)[_0x9783('0x1d')](_0x28f528);}};}function respondWithFilteredResult(_0x517b88,_0x81d600){return function(_0x6547e4){if(_0x6547e4){var _0x21653e=_0x6547e4['count'],_0x5406f6=_0x81d600['offset'],_0x452792=_0x81d600[_0x9783('0x1e')]+_0x81d600[_0x9783('0x1f')],_0x109f95;if(_0x452792>=_0x21653e){_0x452792=_0x21653e;_0x109f95=0xc8;}else{_0x109f95=0xce;}_0x517b88[_0x9783('0x1b')](_0x109f95);return _0x517b88[_0x9783('0x20')](_0x9783('0x21'),_0x5406f6+'-'+_0x452792+'/'+_0x21653e)[_0x9783('0x1d')](_0x6547e4);}return null;};}function patchUpdates(_0x2d900e){return function(_0x2a90c9){try{jsonpatch[_0x9783('0x22')](_0x2a90c9,_0x2d900e,!![]);}catch(_0x54c2fd){return BPromise[_0x9783('0x23')](_0x54c2fd);}return _0x2a90c9[_0x9783('0x24')]();};}function saveUpdates(_0x2b4b92,_0x1fa66b){return function(_0x5bd550){if(_0x5bd550){return _0x5bd550['update'](_0x2b4b92)[_0x9783('0x25')](function(_0xc3bad){return _0xc3bad;});}return null;};}function removeEntity(_0xa6d2ee,_0x432583){return function(_0x407fc2){if(_0x407fc2){return _0x407fc2['destroy']()[_0x9783('0x25')](function(){var _0x265b07=_0x407fc2[_0x9783('0x26')]({'plain':!![]});var _0x4f9067=_0x9783('0x27');return db[_0x9783('0x28')][_0x9783('0x29')]({'where':{'type':_0x4f9067,'resourceId':_0x265b07['id']}})[_0x9783('0x25')](function(){return _0x407fc2;});})[_0x9783('0x25')](function(){_0xa6d2ee['status'](0xcc)[_0x9783('0x1c')]();});}};}function handleEntityNotFound(_0x2595f6,_0x1cd275){return function(_0x5e7ceb){if(!_0x5e7ceb){_0x2595f6[_0x9783('0x2a')](0x194);}return _0x5e7ceb;};}function handleError(_0x5d7ec1,_0x4f602c){_0x4f602c=_0x4f602c||0x1f4;return function(_0x208d80){logger[_0x9783('0x2b')](_0x208d80[_0x9783('0x2c')]);if(_0x208d80[_0x9783('0x2d')]){delete _0x208d80[_0x9783('0x2d')];}_0x5d7ec1[_0x9783('0x1b')](_0x4f602c)['send'](_0x208d80);};}exports['index']=function(_0x17d603,_0x3197ac){var _0x2cb512={},_0x1cdfce={},_0x50a0f6={'count':0x0,'rows':[]};var _0x31afc6=_['map'](db[_0x9783('0x2e')]['rawAttributes'],function(_0x1d2c21){return{'name':_0x1d2c21['fieldName'],'type':_0x1d2c21[_0x9783('0x2f')][_0x9783('0x30')]};});_0x1cdfce['model']=_['map'](_0x31afc6,_0x9783('0x2d'));_0x1cdfce[_0x9783('0x31')]=_[_0x9783('0x32')](_0x17d603[_0x9783('0x31')]);_0x1cdfce[_0x9783('0x33')]=_['intersection'](_0x1cdfce[_0x9783('0x34')],_0x1cdfce['query']);_0x2cb512[_0x9783('0x35')]=_[_0x9783('0x36')](_0x1cdfce['model'],qs['fields'](_0x17d603[_0x9783('0x31')][_0x9783('0x37')]));_0x2cb512[_0x9783('0x35')]=_0x2cb512[_0x9783('0x35')][_0x9783('0x38')]?_0x2cb512['attributes']:_0x1cdfce[_0x9783('0x34')];if(!_0x17d603[_0x9783('0x31')][_0x9783('0x39')](_0x9783('0x3a'))){_0x2cb512[_0x9783('0x1f')]=qs['limit'](_0x17d603[_0x9783('0x31')][_0x9783('0x1f')]);_0x2cb512[_0x9783('0x1e')]=qs[_0x9783('0x1e')](_0x17d603['query'][_0x9783('0x1e')]);}_0x2cb512['order']=qs['sort'](_0x17d603[_0x9783('0x31')][_0x9783('0x3b')]);_0x2cb512['where']=qs['filters'](_['pick'](_0x17d603[_0x9783('0x31')],_0x1cdfce[_0x9783('0x33')]));if(_0x17d603[_0x9783('0x31')][_0x9783('0x3c')]){_0x2cb512['where']=_[_0x9783('0x3d')](_0x2cb512[_0x9783('0x3e')],{'$or':_[_0x9783('0x3f')](_0x31afc6,function(_0x308b3d){if(_0x308b3d[_0x9783('0x2f')]!==_0x9783('0x40')){var _0x3068b3={};_0x3068b3[_0x308b3d[_0x9783('0x2d')]]={'$like':'%'+_0x17d603[_0x9783('0x31')][_0x9783('0x3c')]+'%'};return _0x3068b3;}})});}_0x2cb512=_[_0x9783('0x3d')]({},_0x2cb512,_0x17d603[_0x9783('0x41')]);var _0x3b531b={'where':_0x2cb512[_0x9783('0x3e')]};return db['VoicePrefix'][_0x9783('0x42')](_0x3b531b)[_0x9783('0x25')](function(_0x4b24c6){_0x50a0f6[_0x9783('0x42')]=_0x4b24c6;if(_0x17d603[_0x9783('0x31')][_0x9783('0x43')]){_0x2cb512['include']=[{'all':!![]}];}return db[_0x9783('0x2e')][_0x9783('0x44')](_0x2cb512);})[_0x9783('0x25')](function(_0x5e6430){_0x50a0f6[_0x9783('0x45')]=_0x5e6430;return _0x50a0f6;})[_0x9783('0x25')](respondWithFilteredResult(_0x3197ac,_0x2cb512))[_0x9783('0x46')](handleError(_0x3197ac,null));};exports[_0x9783('0x47')]=function(_0xf032fb,_0x440016){var _0x7f7615={'raw':![],'where':{'id':_0xf032fb[_0x9783('0x48')]['id']}},_0xe75751={};_0xe75751['model']=_[_0x9783('0x32')](db[_0x9783('0x2e')][_0x9783('0x49')]);_0xe75751[_0x9783('0x31')]=_[_0x9783('0x32')](_0xf032fb[_0x9783('0x31')]);_0xe75751[_0x9783('0x33')]=_[_0x9783('0x36')](_0xe75751[_0x9783('0x34')],_0xe75751[_0x9783('0x31')]);_0x7f7615['attributes']=_[_0x9783('0x36')](_0xe75751[_0x9783('0x34')],qs[_0x9783('0x37')](_0xf032fb['query'][_0x9783('0x37')]));_0x7f7615['attributes']=_0x7f7615[_0x9783('0x35')][_0x9783('0x38')]?_0x7f7615[_0x9783('0x35')]:_0xe75751['model'];if(_0xf032fb[_0x9783('0x31')]['includeAll']){_0x7f7615[_0x9783('0x4a')]=[{'all':!![]}];}_0x7f7615=_[_0x9783('0x3d')]({},_0x7f7615,_0xf032fb[_0x9783('0x41')]);return db[_0x9783('0x2e')][_0x9783('0x4b')](_0x7f7615)[_0x9783('0x25')](handleEntityNotFound(_0x440016,null))[_0x9783('0x25')](respondWithResult(_0x440016,null))[_0x9783('0x46')](handleError(_0x440016,null));};exports[_0x9783('0x29')]=function(_0x2a984a,_0x4c3525){return db[_0x9783('0x2e')]['find']({'where':{'id':_0x2a984a[_0x9783('0x48')]['id']}})[_0x9783('0x25')](handleEntityNotFound(_0x4c3525,null))[_0x9783('0x25')](removeEntity(_0x4c3525,null))[_0x9783('0x46')](handleError(_0x4c3525,null));};exports[_0x9783('0x4c')]=function(_0x56e32b,_0x12911d){return db[_0x9783('0x2e')][_0x9783('0x4c')]()[_0x9783('0x25')](respondWithResult(_0x12911d,null))[_0x9783('0x46')](handleError(_0x12911d,null));};exports[_0x9783('0x4d')]=function(_0x470104,_0x4b9c7b){var _0x5d219c;return db['sequelize']['transaction'](function(_0xd587fd){return db[_0x9783('0x2e')][_0x9783('0x4d')](_0x470104[_0x9783('0x4e')],{'transaction':_0xd587fd})[_0x9783('0x25')](function(_0x3356c9){_0x5d219c=_0x3356c9['get']({'plain':!![]});return db['VoiceExtension'][_0x9783('0x4b')]({'where':{'id':_0x5d219c['VoiceExtensionId']},'raw':!![]})[_0x9783('0x25')](function(_0x2bfbd9){return createVoicePrefixExtensions(_0x5d219c,_0x2bfbd9,_0xd587fd);});});})['then'](function(){var _0x3d5d23=_0x470104[_0x9783('0x4f')]['get']({'plain':!![]});if(!_0x3d5d23)throw new Error(_0x9783('0x50'));if(_0x3d5d23['role']===_0x9783('0x4f')){var _0x22efd0=_0x5d219c;return db[_0x9783('0x51')]['find']({'where':{'name':'VoicePrefixes','userProfileId':_0x3d5d23[_0x9783('0x52')]},'raw':!![]})[_0x9783('0x25')](function(_0xed5d49){if(_0xed5d49&&_0xed5d49[_0x9783('0x53')]===0x0){return db[_0x9783('0x28')][_0x9783('0x4d')]({'name':_0x22efd0[_0x9783('0x2d')],'resourceId':_0x22efd0['id'],'type':_0xed5d49[_0x9783('0x2d')],'sectionId':_0xed5d49['id']},{})[_0x9783('0x25')](function(){return _0x5d219c;});}else{return _0x5d219c;}})['catch'](function(_0x4391b7){logger[_0x9783('0x2b')](_0x9783('0x54'),_0x4391b7);throw _0x4391b7;});}return _0x5d219c;})[_0x9783('0x25')](respondWithResult(_0x4b9c7b,null))[_0x9783('0x46')](handleError(_0x4b9c7b,null));};function Extension(_0x4a42a7,_0x12514d,_0x2763d9,_0x333bb){this['context']=_0x9783('0x55');this[_0x9783('0x56')]=_0x4a42a7;this[_0x9783('0x57')]=_0x2763d9;this[_0x9783('0x2f')]=_0x9783('0x58');this[_0x9783('0x59')]=_0x9783('0x5a');this['priority']=_0x12514d;this[_0x9783('0x5b')]=_0x333bb;}function createVoicePrefixExtensions(_0x54fb50,_0x1c516b,_0xab9f8f){return new BPromise(function(_0xe7a284,_0x2e0161){var _0x449d28=new Extension(formatPrefixName(_0x54fb50[_0x9783('0x5c')]),0x1,'NoOp',_0x9783('0x5d'));_0x449d28[_0x9783('0x5e')]=_0x54fb50['id'];return db[_0x9783('0x5f')][_0x9783('0x4d')](_0x449d28,{'transaction':_0xab9f8f})[_0x9783('0x25')](function(_0x321e6e){var _0x15199f=_0x321e6e[_0x9783('0x26')]({'plain':!![]});var _0x1f228f=_['map'](addVoicePrefixExtensions(_0x54fb50,_0x1c516b),function(_0x30a01b){_0x30a01b[_0x9783('0x60')]=_0x15199f['id'];_0x30a01b[_0x9783('0x5e')]=_0x54fb50['id'];return _0x30a01b;});return db[_0x9783('0x5f')]['bulkCreate'](_0x1f228f,{'transaction':_0xab9f8f})[_0x9783('0x25')](function(_0x25b08d){if(!_0x25b08d){return _0x2e0161(_0x9783('0x61'));}else{return _0xe7a284(_0x25b08d);}})[_0x9783('0x46')](function(_0x35cd87){return _0x2e0161(_0x35cd87);});});;});};function addVoicePrefixExtensions(_0x4fb9b7,_0x39f53b){var _0x239a5c=[];var _0x352ec1=formatPrefixName(_0x4fb9b7[_0x9783('0x5c')]);_0x239a5c[_0x9783('0x62')](new Extension(_0x352ec1,0x2,_0x9783('0x63'),_0x9783('0x64')+_0x4fb9b7['name']));if(_0x4fb9b7[_0x9783('0x65')]){_0x239a5c[_0x9783('0x62')](new Extension(_0x352ec1,0x3,'Set',_0x9783('0x66')+_0x4fb9b7[_0x9783('0x65')]));}else{_0x239a5c[_0x9783('0x62')](new Extension(_0x352ec1,0x3,_0x9783('0x67'),'No\x20callerid\x20available'));}_0x239a5c[_0x9783('0x62')](new Extension(_0x352ec1,0x4,_0x9783('0x68'),_0x39f53b[_0x9783('0x69')]+','+_0x9783('0x6a')+(0x8+_0x4fb9b7[_0x9783('0x2d')]['length'])+'}'+','+0x1));return _0x239a5c;}function formatPrefixName(_0x329273){var _0x35a6c3='_';for(var _0x3c7f03=0x0;_0x3c7f03<_0x329273[_0x9783('0x38')];_0x3c7f03++){if(_0x329273['charAt'](_0x3c7f03)=='-'){_0x35a6c3+=_0x329273[_0x9783('0x6b')](_0x3c7f03);}else{_0x35a6c3+='['+_0x329273[_0x9783('0x6b')](_0x3c7f03)+']';}}_0x35a6c3+='.';return _0x35a6c3;}exports[_0x9783('0x6c')]=function(_0x472bcb,_0x2d7c8e,_0x35d700){var _0x41f8ba=_0x472bcb[_0x9783('0x4e')];_0x41f8ba['prefix']='system-'+_0x41f8ba[_0x9783('0x2d')]+'-';return db[_0x9783('0x6d')][_0x9783('0x6e')](function(_0x5b3891){return db[_0x9783('0x2e')]['update'](_0x41f8ba,{'where':{'id':_0x41f8ba['id']},'transaction':_0x5b3891})[_0x9783('0x25')](function(){return db[_0x9783('0x5f')]['destroy']({'where':{'VoicePrefixId':_0x41f8ba['id']},'transaction':_0x5b3891})[_0x9783('0x25')](function(){return db[_0x9783('0x5f')][_0x9783('0x4b')]({'where':{'id':_0x41f8ba[_0x9783('0x60')]},'raw':!![]})[_0x9783('0x25')](function(_0x5de100){return createVoicePrefixExtensions(_0x41f8ba,_0x5de100,_0x5b3891);});});});})[_0x9783('0x25')](function(){return db['VoicePrefix'][_0x9783('0x6f')](_0x41f8ba['id']);})['then'](respondWithResult(_0x2d7c8e,null))[_0x9783('0x46')](handleError(_0x2d7c8e,null));};exports[_0x9783('0x70')]=function(_0x27ffcb,_0x59150e,_0x425419){return db[_0x9783('0x2e')][_0x9783('0x4b')]({'where':{'id':_0x27ffcb['params']['id']}})[_0x9783('0x25')](handleEntityNotFound(_0x59150e,null))[_0x9783('0x25')](function(_0x3b3374){if(_0x3b3374){return _0x3b3374['addAgents'](_0x27ffcb[_0x9783('0x4e')][_0x9783('0x71')],_[_0x9783('0x72')](_0x27ffcb[_0x9783('0x4e')],[_0x9783('0x71'),'id'])||{})[_0x9783('0x73')](function(_0x5f1b42){for(var _0x4d2da9=0x0;_0x4d2da9<_0x27ffcb[_0x9783('0x4e')][_0x9783('0x71')][_0x9783('0x38')];_0x4d2da9+=0x1){socket['emit'](_0x9783('0x74'),{'UserId':_0x27ffcb[_0x9783('0x4e')][_0x9783('0x71')][_0x4d2da9],'VoicePrefixId':_0x27ffcb[_0x9783('0x48')]['id']});}return _0x5f1b42;});}})[_0x9783('0x25')](respondWithResult(_0x59150e,null))[_0x9783('0x46')](handleError(_0x59150e,null));};exports[_0x9783('0x75')]=function(_0x10c7ea,_0x11cf67,_0x5bd6a9){return db[_0x9783('0x2e')][_0x9783('0x4b')]({'where':{'id':_0x10c7ea['params']['id']}})[_0x9783('0x25')](handleEntityNotFound(_0x11cf67,null))[_0x9783('0x25')](function(_0x38dc89){if(_0x38dc89){return _0x38dc89['removeAgents'](_0x10c7ea[_0x9783('0x31')]['ids'])[_0x9783('0x25')](function(){if(_[_0x9783('0x76')](_0x10c7ea[_0x9783('0x31')][_0x9783('0x71')])){for(var _0x3c0709=0x0;_0x3c0709<_0x10c7ea['query'][_0x9783('0x71')][_0x9783('0x38')];_0x3c0709+=0x1){socket['emit'](_0x9783('0x77'),{'UserId':Number(_0x10c7ea['query'][_0x9783('0x71')][_0x3c0709]),'VoicePrefixId':Number(_0x10c7ea[_0x9783('0x48')]['id'])});}}else{socket[_0x9783('0x78')]('userVoicePrefix:remove',{'UserId':Number(_0x10c7ea[_0x9783('0x31')]['ids']),'VoicePrefixId':Number(_0x10c7ea[_0x9783('0x48')]['id'])});}});}})[_0x9783('0x25')](respondWithStatusCode(_0x11cf67,null))[_0x9783('0x46')](handleError(_0x11cf67,null));};exports['getAgents']=function(_0x15a120,_0x14edc0,_0x43a91c){var _0x31e107={};var _0x206058={};var _0x26261f;var _0x32714f;return db['VoicePrefix'][_0x9783('0x79')]({'where':{'id':_0x15a120[_0x9783('0x48')]['id']}})['then'](handleEntityNotFound(_0x14edc0,null))[_0x9783('0x25')](function(_0xea19ff){if(_0xea19ff){_0x26261f=_0xea19ff;_0x206058[_0x9783('0x34')]=_[_0x9783('0x32')](db[_0x9783('0x7a')]['rawAttributes']);_0x206058[_0x9783('0x31')]=_[_0x9783('0x32')](_0x15a120['query']);_0x206058['filters']=_[_0x9783('0x36')](_0x206058[_0x9783('0x34')],_0x206058[_0x9783('0x31')]);_0x31e107['attributes']=_[_0x9783('0x36')](_0x206058[_0x9783('0x34')],qs[_0x9783('0x37')](_0x15a120['query'][_0x9783('0x37')]));_0x31e107[_0x9783('0x35')]=_0x31e107[_0x9783('0x35')][_0x9783('0x38')]?_0x31e107[_0x9783('0x35')]:_0x206058[_0x9783('0x34')];_0x31e107['order']=qs[_0x9783('0x3b')](_0x15a120[_0x9783('0x31')][_0x9783('0x3b')]);_0x31e107['where']=qs[_0x9783('0x33')](_[_0x9783('0x7b')](_0x15a120[_0x9783('0x31')],_0x206058[_0x9783('0x33')]));if(_0x15a120[_0x9783('0x31')]['filter']){_0x31e107['where']=_['merge'](_0x31e107[_0x9783('0x3e')],{'$or':_['map'](_0x31e107[_0x9783('0x35')],function(_0x3db839){var _0x278867={};_0x278867[_0x3db839]={'$like':'%'+_0x15a120['query']['filter']+'%'};return _0x278867;})});}_0x31e107=_[_0x9783('0x3d')]({},_0x31e107,_0x15a120[_0x9783('0x41')]);return _0x26261f[_0x9783('0x7c')](_0x31e107);}})[_0x9783('0x25')](function(_0x31774a){if(_0x31774a){_0x32714f=_0x31774a[_0x9783('0x38')];if(!_0x15a120['query']['hasOwnProperty'](_0x9783('0x3a'))){_0x31e107[_0x9783('0x1f')]=qs[_0x9783('0x1f')](_0x15a120[_0x9783('0x31')][_0x9783('0x1f')]);_0x31e107[_0x9783('0x1e')]=qs[_0x9783('0x1e')](_0x15a120[_0x9783('0x31')]['offset']);}return _0x26261f['getAgents'](_0x31e107);}})[_0x9783('0x25')](function(_0x4e91dd){if(_0x4e91dd){return _0x4e91dd?{'count':_0x32714f,'rows':_0x4e91dd}:null;}})[_0x9783('0x25')](respondWithResult(_0x14edc0,null))[_0x9783('0x46')](handleError(_0x14edc0,null));}; \ No newline at end of file +var _0xd34d=['apply','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','send','index','map','VoicePrefix','type','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','keys','rawAttributes','options','find','params','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','exten','app','system','description','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','CDR(prefix)=','callerIdAll','push','Set','No\x20callerid\x20available','goto','context','findById','addAgents','omit','ids','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','User','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd34d,0xc5));var _0xdd34=function(_0x2ef3b2,_0x2dd3ee){_0x2ef3b2=_0x2ef3b2-0x0;var _0x3d2ead=_0xd34d[_0x2ef3b2];return _0x3d2ead;};'use strict';var pdf=require(_0xdd34('0x0'));var emlformat=require(_0xdd34('0x1'));var rimraf=require(_0xdd34('0x2'));var zipdir=require(_0xdd34('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdd34('0x4'));var Mustache=require(_0xdd34('0x5'));var util=require(_0xdd34('0x6'));var path=require('path');var sox=require(_0xdd34('0x7'));var csv=require(_0xdd34('0x8'));var ejs=require(_0xdd34('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xdd34('0xa'));var crypto=require(_0xdd34('0xb'));var jsforce=require(_0xdd34('0xc'));var deskjs=require(_0xdd34('0xd'));var toCsv=require(_0xdd34('0x8'));var querystring=require(_0xdd34('0xe'));var Papa=require(_0xdd34('0xf'));var Redis=require(_0xdd34('0x10'));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(_0xdd34('0x11'))('api');var utils=require(_0xdd34('0x12'));var config=require(_0xdd34('0x13'));var db=require(_0xdd34('0x14'))['db'];config[_0xdd34('0x15')]=_['defaults'](config['redis'],{'host':_0xdd34('0x16'),'port':0x18eb});var socket=require(_0xdd34('0x17'))(new Redis(config[_0xdd34('0x15')]));require(_0xdd34('0x18'))[_0xdd34('0x19')](socket);function respondWithStatusCode(_0x3bd2de,_0x2207d1){_0x2207d1=_0x2207d1||0xcc;return function(_0x119861){if(_0x119861){return _0x3bd2de[_0xdd34('0x1a')](_0x2207d1);}return _0x3bd2de['status'](_0x2207d1)[_0xdd34('0x1b')]();};}function respondWithResult(_0xc0f84b,_0x528122){_0x528122=_0x528122||0xc8;return function(_0x4ce5f4){if(_0x4ce5f4){return _0xc0f84b[_0xdd34('0x1c')](_0x528122)[_0xdd34('0x1d')](_0x4ce5f4);}};}function respondWithFilteredResult(_0x30caea,_0x5ec9df){return function(_0x5af4ca){if(_0x5af4ca){var _0x59d6d0=_0x5af4ca[_0xdd34('0x1e')],_0x57aec0=_0x5ec9df[_0xdd34('0x1f')],_0x33e9e1=_0x5ec9df[_0xdd34('0x1f')]+_0x5ec9df[_0xdd34('0x20')],_0x5171b7;if(_0x33e9e1>=_0x59d6d0){_0x33e9e1=_0x59d6d0;_0x5171b7=0xc8;}else{_0x5171b7=0xce;}_0x30caea[_0xdd34('0x1c')](_0x5171b7);return _0x30caea[_0xdd34('0x21')](_0xdd34('0x22'),_0x57aec0+'-'+_0x33e9e1+'/'+_0x59d6d0)['json'](_0x5af4ca);}return null;};}function patchUpdates(_0x553284){return function(_0x47d351){try{jsonpatch[_0xdd34('0x23')](_0x47d351,_0x553284,!![]);}catch(_0x2bf233){return BPromise['reject'](_0x2bf233);}return _0x47d351[_0xdd34('0x24')]();};}function saveUpdates(_0x1484e4,_0x1e20e0){return function(_0x276907){if(_0x276907){return _0x276907[_0xdd34('0x25')](_0x1484e4)[_0xdd34('0x26')](function(_0x15fd7b){return _0x15fd7b;});}return null;};}function removeEntity(_0x310eb7,_0x29f88b){return function(_0x38de1e){if(_0x38de1e){return _0x38de1e[_0xdd34('0x27')]()[_0xdd34('0x26')](function(){var _0x2a046a=_0x38de1e[_0xdd34('0x28')]({'plain':!![]});var _0x43decf=_0xdd34('0x29');return db[_0xdd34('0x2a')]['destroy']({'where':{'type':_0x43decf,'resourceId':_0x2a046a['id']}})[_0xdd34('0x26')](function(){return _0x38de1e;});})[_0xdd34('0x26')](function(){_0x310eb7[_0xdd34('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20ae11,_0x216e78){return function(_0x41ba80){if(!_0x41ba80){_0x20ae11[_0xdd34('0x1a')](0x194);}return _0x41ba80;};}function handleError(_0x3bfd1e,_0x4951bb){_0x4951bb=_0x4951bb||0x1f4;return function(_0x2dcd74){logger[_0xdd34('0x2b')](_0x2dcd74[_0xdd34('0x2c')]);if(_0x2dcd74['name']){delete _0x2dcd74['name'];}_0x3bfd1e[_0xdd34('0x1c')](_0x4951bb)[_0xdd34('0x2d')](_0x2dcd74);};}exports[_0xdd34('0x2e')]=function(_0xd5a71,_0xa18d4){var _0x74f1d6={},_0x1ff627={},_0x5c018a={'count':0x0,'rows':[]};var _0x2c451a=_[_0xdd34('0x2f')](db[_0xdd34('0x30')]['rawAttributes'],function(_0x532078){return{'name':_0x532078['fieldName'],'type':_0x532078[_0xdd34('0x31')]['key']};});_0x1ff627[_0xdd34('0x32')]=_['map'](_0x2c451a,_0xdd34('0x33'));_0x1ff627[_0xdd34('0x34')]=_['keys'](_0xd5a71[_0xdd34('0x34')]);_0x1ff627[_0xdd34('0x35')]=_[_0xdd34('0x36')](_0x1ff627[_0xdd34('0x32')],_0x1ff627[_0xdd34('0x34')]);_0x74f1d6[_0xdd34('0x37')]=_[_0xdd34('0x36')](_0x1ff627[_0xdd34('0x32')],qs[_0xdd34('0x38')](_0xd5a71['query'][_0xdd34('0x38')]));_0x74f1d6[_0xdd34('0x37')]=_0x74f1d6['attributes'][_0xdd34('0x39')]?_0x74f1d6[_0xdd34('0x37')]:_0x1ff627[_0xdd34('0x32')];if(!_0xd5a71[_0xdd34('0x34')][_0xdd34('0x3a')](_0xdd34('0x3b'))){_0x74f1d6[_0xdd34('0x20')]=qs[_0xdd34('0x20')](_0xd5a71['query'][_0xdd34('0x20')]);_0x74f1d6[_0xdd34('0x1f')]=qs[_0xdd34('0x1f')](_0xd5a71[_0xdd34('0x34')][_0xdd34('0x1f')]);}_0x74f1d6[_0xdd34('0x3c')]=qs[_0xdd34('0x3d')](_0xd5a71[_0xdd34('0x34')][_0xdd34('0x3d')]);_0x74f1d6[_0xdd34('0x3e')]=qs['filters'](_[_0xdd34('0x3f')](_0xd5a71[_0xdd34('0x34')],_0x1ff627['filters']));if(_0xd5a71[_0xdd34('0x34')][_0xdd34('0x40')]){_0x74f1d6[_0xdd34('0x3e')]=_[_0xdd34('0x41')](_0x74f1d6[_0xdd34('0x3e')],{'$or':_['map'](_0x2c451a,function(_0x5e4b02){if(_0x5e4b02[_0xdd34('0x31')]!=='VIRTUAL'){var _0x1c322a={};_0x1c322a[_0x5e4b02[_0xdd34('0x33')]]={'$like':'%'+_0xd5a71[_0xdd34('0x34')]['filter']+'%'};return _0x1c322a;}})});}_0x74f1d6=_[_0xdd34('0x41')]({},_0x74f1d6,_0xd5a71['options']);var _0x58d714={'where':_0x74f1d6['where']};return db[_0xdd34('0x30')][_0xdd34('0x1e')](_0x58d714)[_0xdd34('0x26')](function(_0x21eb48){_0x5c018a[_0xdd34('0x1e')]=_0x21eb48;if(_0xd5a71[_0xdd34('0x34')][_0xdd34('0x42')]){_0x74f1d6[_0xdd34('0x43')]=[{'all':!![]}];}return db[_0xdd34('0x30')]['findAll'](_0x74f1d6);})['then'](function(_0x3ef07d){_0x5c018a[_0xdd34('0x44')]=_0x3ef07d;return _0x5c018a;})[_0xdd34('0x26')](respondWithFilteredResult(_0xa18d4,_0x74f1d6))[_0xdd34('0x45')](handleError(_0xa18d4,null));};exports['show']=function(_0x1645e0,_0x37d52e){var _0x4310d3={'raw':![],'where':{'id':_0x1645e0['params']['id']}},_0x1b60da={};_0x1b60da[_0xdd34('0x32')]=_[_0xdd34('0x46')](db[_0xdd34('0x30')][_0xdd34('0x47')]);_0x1b60da[_0xdd34('0x34')]=_[_0xdd34('0x46')](_0x1645e0[_0xdd34('0x34')]);_0x1b60da[_0xdd34('0x35')]=_[_0xdd34('0x36')](_0x1b60da[_0xdd34('0x32')],_0x1b60da[_0xdd34('0x34')]);_0x4310d3[_0xdd34('0x37')]=_[_0xdd34('0x36')](_0x1b60da['model'],qs[_0xdd34('0x38')](_0x1645e0[_0xdd34('0x34')][_0xdd34('0x38')]));_0x4310d3[_0xdd34('0x37')]=_0x4310d3[_0xdd34('0x37')][_0xdd34('0x39')]?_0x4310d3[_0xdd34('0x37')]:_0x1b60da[_0xdd34('0x32')];if(_0x1645e0[_0xdd34('0x34')][_0xdd34('0x42')]){_0x4310d3['include']=[{'all':!![]}];}_0x4310d3=_[_0xdd34('0x41')]({},_0x4310d3,_0x1645e0[_0xdd34('0x48')]);return db[_0xdd34('0x30')][_0xdd34('0x49')](_0x4310d3)[_0xdd34('0x26')](handleEntityNotFound(_0x37d52e,null))['then'](respondWithResult(_0x37d52e,null))[_0xdd34('0x45')](handleError(_0x37d52e,null));};exports['destroy']=function(_0x2c3cb8,_0x54462){return db[_0xdd34('0x30')][_0xdd34('0x49')]({'where':{'id':_0x2c3cb8[_0xdd34('0x4a')]['id']}})['then'](handleEntityNotFound(_0x54462,null))[_0xdd34('0x26')](removeEntity(_0x54462,null))['catch'](handleError(_0x54462,null));};exports[_0xdd34('0x4b')]=function(_0x1bcff4,_0x48c821){return db[_0xdd34('0x30')][_0xdd34('0x4b')]()[_0xdd34('0x26')](respondWithResult(_0x48c821,null))[_0xdd34('0x45')](handleError(_0x48c821,null));};exports[_0xdd34('0x4c')]=function(_0x3ed8b1,_0x447a61){var _0x1b04d6;return db[_0xdd34('0x4d')][_0xdd34('0x4e')](function(_0x4a71c8){return db['VoicePrefix'][_0xdd34('0x4c')](_0x3ed8b1[_0xdd34('0x4f')],{'transaction':_0x4a71c8})['then'](function(_0x3350ac){_0x1b04d6=_0x3350ac['get']({'plain':!![]});return db[_0xdd34('0x50')]['find']({'where':{'id':_0x1b04d6[_0xdd34('0x51')]},'raw':!![]})[_0xdd34('0x26')](function(_0x59b4ba){return createVoicePrefixExtensions(_0x1b04d6,_0x59b4ba,_0x4a71c8);});});})[_0xdd34('0x26')](function(){var _0xca7ad6=_0x3ed8b1['user'][_0xdd34('0x28')]({'plain':!![]});if(!_0xca7ad6)throw new Error(_0xdd34('0x52'));if(_0xca7ad6[_0xdd34('0x53')]===_0xdd34('0x54')){var _0x4ef345=_0x1b04d6;return db[_0xdd34('0x55')]['find']({'where':{'name':_0xdd34('0x29'),'userProfileId':_0xca7ad6['userProfileId']},'raw':!![]})[_0xdd34('0x26')](function(_0x2654be){if(_0x2654be&&_0x2654be[_0xdd34('0x56')]===0x0){return db[_0xdd34('0x2a')]['create']({'name':_0x4ef345[_0xdd34('0x33')],'resourceId':_0x4ef345['id'],'type':_0x2654be[_0xdd34('0x33')],'sectionId':_0x2654be['id']},{})[_0xdd34('0x26')](function(){return _0x1b04d6;});}else{return _0x1b04d6;}})[_0xdd34('0x45')](function(_0x387678){logger['error'](_0xdd34('0x57'),_0x387678);throw _0x387678;});}return _0x1b04d6;})[_0xdd34('0x26')](respondWithResult(_0x447a61,null))['catch'](handleError(_0x447a61,null));};function Extension(_0xca8245,_0x3601fa,_0x27fe36,_0x4c3582){this['context']='from-sip';this[_0xdd34('0x58')]=_0xca8245;this[_0xdd34('0x59')]=_0x27fe36;this[_0xdd34('0x31')]=_0xdd34('0x5a');this[_0xdd34('0x5b')]=_0xdd34('0x5c');this['priority']=_0x3601fa;this[_0xdd34('0x5d')]=_0x4c3582;}function createVoicePrefixExtensions(_0x4b780e,_0x2b4cb9,_0x36d420){return new BPromise(function(_0x124a44,_0x8ba670){var _0x460c57=new Extension(formatPrefixName(_0x4b780e[_0xdd34('0x5e')]),0x1,_0xdd34('0x5f'),'Voice\x20Prefix');_0x460c57[_0xdd34('0x60')]=_0x4b780e['id'];return db[_0xdd34('0x50')]['create'](_0x460c57,{'transaction':_0x36d420})[_0xdd34('0x26')](function(_0x9167bb){var _0x6539d2=_0x9167bb['get']({'plain':!![]});var _0x40a09b=_[_0xdd34('0x2f')](addVoicePrefixExtensions(_0x4b780e,_0x2b4cb9),function(_0x32fcaf){_0x32fcaf[_0xdd34('0x51')]=_0x6539d2['id'];_0x32fcaf['VoicePrefixId']=_0x4b780e['id'];return _0x32fcaf;});return db[_0xdd34('0x50')][_0xdd34('0x61')](_0x40a09b,{'transaction':_0x36d420})['then'](function(_0x1f01a5){if(!_0x1f01a5){return _0x8ba670(_0xdd34('0x62'));}else{return _0x124a44(_0x1f01a5);}})['catch'](function(_0x4979cd){return _0x8ba670(_0x4979cd);});});;});};function addVoicePrefixExtensions(_0xb95539,_0x6bba9){var _0x4ddee8=[];var _0x35a285=formatPrefixName(_0xb95539[_0xdd34('0x5e')]);_0x4ddee8['push'](new Extension(_0x35a285,0x2,'Set',_0xdd34('0x63')+_0xb95539[_0xdd34('0x33')]));if(_0xb95539[_0xdd34('0x64')]){_0x4ddee8[_0xdd34('0x65')](new Extension(_0x35a285,0x3,_0xdd34('0x66'),'PREFIX-CALLERIDALL='+_0xb95539[_0xdd34('0x64')]));}else{_0x4ddee8[_0xdd34('0x65')](new Extension(_0x35a285,0x3,_0xdd34('0x5f'),_0xdd34('0x67')));}_0x4ddee8['push'](new Extension(_0x35a285,0x4,_0xdd34('0x68'),_0x6bba9[_0xdd34('0x69')]+','+'${EXTEN:'+(0x8+_0xb95539[_0xdd34('0x33')][_0xdd34('0x39')])+'}'+','+0x1));return _0x4ddee8;}function formatPrefixName(_0x390932){var _0x51df8e='_';for(var _0x36f0cd=0x0;_0x36f0cd<_0x390932[_0xdd34('0x39')];_0x36f0cd++){if(_0x390932['charAt'](_0x36f0cd)=='-'){_0x51df8e+=_0x390932['charAt'](_0x36f0cd);}else{_0x51df8e+='['+_0x390932['charAt'](_0x36f0cd)+']';}}_0x51df8e+='.';return _0x51df8e;}exports[_0xdd34('0x25')]=function(_0x4a558d,_0x249ea1,_0xd05404){var _0x85c772=_0x4a558d[_0xdd34('0x4f')];_0x85c772['prefix']='system-'+_0x85c772[_0xdd34('0x33')]+'-';return db['sequelize'][_0xdd34('0x4e')](function(_0x5ef106){return db[_0xdd34('0x30')][_0xdd34('0x25')](_0x85c772,{'where':{'id':_0x85c772['id']},'transaction':_0x5ef106})[_0xdd34('0x26')](function(){return db[_0xdd34('0x50')][_0xdd34('0x27')]({'where':{'VoicePrefixId':_0x85c772['id']},'transaction':_0x5ef106})[_0xdd34('0x26')](function(){return db['VoiceExtension']['find']({'where':{'id':_0x85c772['VoiceExtensionId']},'raw':!![]})[_0xdd34('0x26')](function(_0x33d1b4){return createVoicePrefixExtensions(_0x85c772,_0x33d1b4,_0x5ef106);});});});})[_0xdd34('0x26')](function(){return db[_0xdd34('0x30')][_0xdd34('0x6a')](_0x85c772['id']);})[_0xdd34('0x26')](respondWithResult(_0x249ea1,null))[_0xdd34('0x45')](handleError(_0x249ea1,null));};exports['addAgents']=function(_0x13864f,_0x1c47a5,_0x1cf480){return db[_0xdd34('0x30')][_0xdd34('0x49')]({'where':{'id':_0x13864f[_0xdd34('0x4a')]['id']}})[_0xdd34('0x26')](handleEntityNotFound(_0x1c47a5,null))['then'](function(_0x4ba223){if(_0x4ba223){return _0x4ba223[_0xdd34('0x6b')](_0x13864f['body']['ids'],_[_0xdd34('0x6c')](_0x13864f[_0xdd34('0x4f')],[_0xdd34('0x6d'),'id'])||{})['spread'](function(_0x4029f7){for(var _0xe42a5e=0x0;_0xe42a5e<_0x13864f[_0xdd34('0x4f')][_0xdd34('0x6d')][_0xdd34('0x39')];_0xe42a5e+=0x1){socket['emit'](_0xdd34('0x6e'),{'UserId':_0x13864f['body'][_0xdd34('0x6d')][_0xe42a5e],'VoicePrefixId':_0x13864f[_0xdd34('0x4a')]['id']});}return _0x4029f7;});}})[_0xdd34('0x26')](respondWithResult(_0x1c47a5,null))[_0xdd34('0x45')](handleError(_0x1c47a5,null));};exports[_0xdd34('0x6f')]=function(_0x2cacda,_0x5b9d7f,_0xef6eb){return db[_0xdd34('0x30')][_0xdd34('0x49')]({'where':{'id':_0x2cacda[_0xdd34('0x4a')]['id']}})[_0xdd34('0x26')](handleEntityNotFound(_0x5b9d7f,null))[_0xdd34('0x26')](function(_0x185da7){if(_0x185da7){return _0x185da7[_0xdd34('0x6f')](_0x2cacda['query'][_0xdd34('0x6d')])[_0xdd34('0x26')](function(){if(_[_0xdd34('0x70')](_0x2cacda[_0xdd34('0x34')][_0xdd34('0x6d')])){for(var _0x48a3b7=0x0;_0x48a3b7<_0x2cacda[_0xdd34('0x34')]['ids'][_0xdd34('0x39')];_0x48a3b7+=0x1){socket['emit'](_0xdd34('0x71'),{'UserId':Number(_0x2cacda[_0xdd34('0x34')][_0xdd34('0x6d')][_0x48a3b7]),'VoicePrefixId':Number(_0x2cacda[_0xdd34('0x4a')]['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x2cacda[_0xdd34('0x34')][_0xdd34('0x6d')]),'VoicePrefixId':Number(_0x2cacda[_0xdd34('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x5b9d7f,null))[_0xdd34('0x45')](handleError(_0x5b9d7f,null));};exports[_0xdd34('0x72')]=function(_0x9ad062,_0x1f16d0,_0x32b5be){var _0x1e077c={};var _0x3b8af3={};var _0x96b30b;var _0x4d17bf;return db[_0xdd34('0x30')]['findOne']({'where':{'id':_0x9ad062[_0xdd34('0x4a')]['id']}})[_0xdd34('0x26')](handleEntityNotFound(_0x1f16d0,null))[_0xdd34('0x26')](function(_0x478c4a){if(_0x478c4a){_0x96b30b=_0x478c4a;_0x3b8af3[_0xdd34('0x32')]=_['keys'](db[_0xdd34('0x73')][_0xdd34('0x47')]);_0x3b8af3[_0xdd34('0x34')]=_[_0xdd34('0x46')](_0x9ad062[_0xdd34('0x34')]);_0x3b8af3['filters']=_[_0xdd34('0x36')](_0x3b8af3[_0xdd34('0x32')],_0x3b8af3[_0xdd34('0x34')]);_0x1e077c['attributes']=_['intersection'](_0x3b8af3[_0xdd34('0x32')],qs[_0xdd34('0x38')](_0x9ad062[_0xdd34('0x34')][_0xdd34('0x38')]));_0x1e077c['attributes']=_0x1e077c[_0xdd34('0x37')]['length']?_0x1e077c[_0xdd34('0x37')]:_0x3b8af3['model'];_0x1e077c[_0xdd34('0x3c')]=qs[_0xdd34('0x3d')](_0x9ad062[_0xdd34('0x34')][_0xdd34('0x3d')]);_0x1e077c['where']=qs[_0xdd34('0x35')](_[_0xdd34('0x3f')](_0x9ad062[_0xdd34('0x34')],_0x3b8af3['filters']));if(_0x9ad062[_0xdd34('0x34')][_0xdd34('0x40')]){_0x1e077c[_0xdd34('0x3e')]=_[_0xdd34('0x41')](_0x1e077c[_0xdd34('0x3e')],{'$or':_[_0xdd34('0x2f')](_0x1e077c[_0xdd34('0x37')],function(_0x19f267){var _0x1cdec6={};_0x1cdec6[_0x19f267]={'$like':'%'+_0x9ad062[_0xdd34('0x34')][_0xdd34('0x40')]+'%'};return _0x1cdec6;})});}_0x1e077c=_[_0xdd34('0x41')]({},_0x1e077c,_0x9ad062[_0xdd34('0x48')]);return _0x96b30b[_0xdd34('0x72')](_0x1e077c);}})[_0xdd34('0x26')](function(_0x5002cc){if(_0x5002cc){_0x4d17bf=_0x5002cc[_0xdd34('0x39')];if(!_0x9ad062[_0xdd34('0x34')][_0xdd34('0x3a')](_0xdd34('0x3b'))){_0x1e077c[_0xdd34('0x20')]=qs[_0xdd34('0x20')](_0x9ad062['query'][_0xdd34('0x20')]);_0x1e077c[_0xdd34('0x1f')]=qs[_0xdd34('0x1f')](_0x9ad062[_0xdd34('0x34')][_0xdd34('0x1f')]);}return _0x96b30b[_0xdd34('0x72')](_0x1e077c);}})[_0xdd34('0x26')](function(_0x444751){if(_0x444751){return _0x444751?{'count':_0x4d17bf,'rows':_0x444751}:null;}})[_0xdd34('0x26')](respondWithResult(_0x1f16d0,null))['catch'](handleError(_0x1f16d0,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 53dc780..2cfc971 100644 --- a/server/api/voicePrefix/voicePrefix.events.js +++ b/server/api/voicePrefix/voicePrefix.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0xa5441f,_0x157c4c){var _0x3b2259=function(_0x1a3531){while(--_0x1a3531){_0xa5441f['push'](_0xa5441f['shift']());}};_0x3b2259(++_0x157c4c);}(_0x008c,0x188));var _0xc008=function(_0x1123bb,_0x54472a){_0x1123bb=_0x1123bb-0x0;var _0xdeb602=_0x008c[_0x1123bb];return _0xdeb602;};'use strict';var EventEmitter=require(_0xc008('0x0'));var VoicePrefix=require(_0xc008('0x1'))['db'][_0xc008('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xc008('0x3')](0x0);var events={'afterCreate':_0xc008('0x4'),'afterUpdate':'update','afterDestroy':_0xc008('0x5')};function emitEvent(_0x47063f){return function(_0x10b33c,_0x163bd9,_0x1cbe76){VoicePrefixEvents[_0xc008('0x6')](_0x47063f+':'+_0x10b33c['id'],_0x10b33c);VoicePrefixEvents[_0xc008('0x6')](_0x47063f,_0x10b33c);_0x1cbe76(null);};}for(var e in events){if(events[_0xc008('0x7')](e)){var event=events[e];VoicePrefix[_0xc008('0x8')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x34e8=['emit','hasOwnProperty','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','update','remove'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x34e8,0x12c));var _0x834e=function(_0x473b63,_0x5b17c7){_0x473b63=_0x473b63-0x0;var _0x6fc2f0=_0x34e8[_0x473b63];return _0x6fc2f0;};'use strict';var EventEmitter=require(_0x834e('0x0'));var VoicePrefix=require(_0x834e('0x1'))['db'][_0x834e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x834e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x834e('0x4'),'afterDestroy':_0x834e('0x5')};function emitEvent(_0x472111){return function(_0x31bf20,_0x289ef2,_0x19a3e0){VoicePrefixEvents[_0x834e('0x6')](_0x472111+':'+_0x31bf20['id'],_0x31bf20);VoicePrefixEvents['emit'](_0x472111,_0x31bf20);_0x19a3e0(null);};}for(var e in events){if(events[_0x834e('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x834e('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 264c73a..ee15fb2 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 _0xb942=['../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x35288d,_0x1908d2){var _0x1d2c2b=function(_0x19bfac){while(--_0x19bfac){_0x35288d['push'](_0x35288d['shift']());}};_0x1d2c2b(++_0x1908d2);}(_0xb942,0x7e));var _0x2b94=function(_0x3421b0,_0x22c2d9){_0x3421b0=_0x3421b0-0x0;var _0x39bd77=_0xb942[_0x3421b0];return _0x39bd77;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2b94('0x0'))(_0x2b94('0x1'));var moment=require('moment');var BPromise=require(_0x2b94('0x2'));var rp=require(_0x2b94('0x3'));var fs=require('fs');var path=require(_0x2b94('0x4'));var rimraf=require(_0x2b94('0x5'));var config=require(_0x2b94('0x6'));var attributes=require(_0x2b94('0x7'));module[_0x2b94('0x8')]=function(_0xc1f79d,_0x973f06){return _0xc1f79d[_0x2b94('0x9')](_0x2b94('0xa'),attributes,{'tableName':_0x2b94('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x319e=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash'];(function(_0x4b48af,_0x4ad5b9){var _0x64ac44=function(_0x268837){while(--_0x268837){_0x4b48af['push'](_0x4b48af['shift']());}};_0x64ac44(++_0x4ad5b9);}(_0x319e,0x1b9));var _0xe319=function(_0x269ef5,_0x492b53){_0x269ef5=_0x269ef5-0x0;var _0x22e63c=_0x319e[_0x269ef5];return _0x22e63c;};'use strict';var _=require(_0xe319('0x0'));var util=require(_0xe319('0x1'));var logger=require(_0xe319('0x2'))(_0xe319('0x3'));var moment=require('moment');var BPromise=require(_0xe319('0x4'));var rp=require(_0xe319('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe319('0x6'));var config=require(_0xe319('0x7'));var attributes=require(_0xe319('0x8'));module[_0xe319('0x9')]=function(_0x4399b2,_0x2e0980){return _0x4399b2[_0xe319('0xa')](_0xe319('0xb'),attributes,{'tableName':_0xe319('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 573563d..ee36900 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 _0x0782=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x3d6135,_0x256136){var _0x16f3c1=function(_0x5e7576){while(--_0x5e7576){_0x3d6135['push'](_0x3d6135['shift']());}};_0x16f3c1(++_0x256136);}(_0x0782,0x7e));var _0x2078=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0782[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x2078('0x0'));var moment=require(_0x2078('0x1'));var BPromise=require(_0x2078('0x2'));var rs=require(_0x2078('0x3'));var fs=require('fs');var Redis=require(_0x2078('0x4'));var db=require(_0x2078('0x5'))['db'];var utils=require(_0x2078('0x6'));var logger=require('../../config/logger')(_0x2078('0x7'));var config=require(_0x2078('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2078('0x9')][_0x2078('0xa')]({'port':0x232a});config[_0x2078('0xb')]=_[_0x2078('0xc')](config['redis'],{'host':_0x2078('0xd'),'port':0x18eb});var socket=require(_0x2078('0xe'))(new Redis(config[_0x2078('0xb')]));require(_0x2078('0xf'))['register'](socket);function respondWithRpcPromise(_0x44600d,_0x257d12,_0xd2205d){return new BPromise(function(_0x549c2a,_0x2a54d9){return client['request'](_0x44600d,_0xd2205d)['then'](function(_0x206917){logger[_0x2078('0x10')](_0x2078('0x11'),_0x257d12,_0x2078('0x12'));logger[_0x2078('0x13')](_0x2078('0x14'),_0x257d12,_0x2078('0x12'),JSON[_0x2078('0x15')](_0x206917));if(_0x206917[_0x2078('0x16')]){if(_0x206917['error']['code']===0x1f4){logger[_0x2078('0x16')](_0x2078('0x11'),_0x257d12,_0x206917['error'][_0x2078('0x17')]);return _0x2a54d9(_0x206917[_0x2078('0x16')][_0x2078('0x17')]);}logger[_0x2078('0x16')](_0x2078('0x11'),_0x257d12,_0x206917[_0x2078('0x16')][_0x2078('0x17')]);return _0x549c2a(_0x206917[_0x2078('0x16')][_0x2078('0x17')]);}else{logger[_0x2078('0x10')](_0x2078('0x11'),_0x257d12,'request\x20sent');_0x549c2a(_0x206917[_0x2078('0x18')][_0x2078('0x17')]);}})[_0x2078('0x19')](function(_0x370b53){logger[_0x2078('0x16')](_0x2078('0x11'),_0x257d12,_0x370b53);_0x2a54d9(_0x370b53);});});} \ No newline at end of file +var _0xa359=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoicePrefix,\x20%s,\x20%s','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xace9bb,_0x4243d1){var _0x12cc1f=function(_0x2878d8){while(--_0x2878d8){_0xace9bb['push'](_0xace9bb['shift']());}};_0x12cc1f(++_0x4243d1);}(_0xa359,0x12c));var _0x9a35=function(_0x47c5a6,_0x37a487){_0x47c5a6=_0x47c5a6-0x0;var _0xc2a43b=_0xa359[_0x47c5a6];return _0xc2a43b;};'use strict';var _=require(_0x9a35('0x0'));var util=require(_0x9a35('0x1'));var moment=require('moment');var BPromise=require(_0x9a35('0x2'));var rs=require(_0x9a35('0x3'));var fs=require('fs');var Redis=require(_0x9a35('0x4'));var db=require(_0x9a35('0x5'))['db'];var utils=require(_0x9a35('0x6'));var logger=require(_0x9a35('0x7'))(_0x9a35('0x8'));var config=require(_0x9a35('0x9'));var jayson=require(_0x9a35('0xa'));var client=jayson[_0x9a35('0xb')][_0x9a35('0xc')]({'port':0x232a});config[_0x9a35('0xd')]=_['defaults'](config[_0x9a35('0xd')],{'host':_0x9a35('0xe'),'port':0x18eb});var socket=require(_0x9a35('0xf'))(new Redis(config[_0x9a35('0xd')]));require(_0x9a35('0x10'))[_0x9a35('0x11')](socket);function respondWithRpcPromise(_0xa7522a,_0x5b73f2,_0x2e5d84){return new BPromise(function(_0x520370,_0x2924cf){return client[_0x9a35('0x12')](_0xa7522a,_0x2e5d84)[_0x9a35('0x13')](function(_0x42c80f){logger[_0x9a35('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x5b73f2,'request\x20sent');logger[_0x9a35('0x15')](_0x9a35('0x16'),_0x5b73f2,_0x9a35('0x17'),JSON['stringify'](_0x42c80f));if(_0x42c80f[_0x9a35('0x18')]){if(_0x42c80f[_0x9a35('0x18')][_0x9a35('0x19')]===0x1f4){logger[_0x9a35('0x18')](_0x9a35('0x1a'),_0x5b73f2,_0x42c80f[_0x9a35('0x18')][_0x9a35('0x1b')]);return _0x2924cf(_0x42c80f[_0x9a35('0x18')][_0x9a35('0x1b')]);}logger[_0x9a35('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x5b73f2,_0x42c80f[_0x9a35('0x18')]['message']);return _0x520370(_0x42c80f[_0x9a35('0x18')][_0x9a35('0x1b')]);}else{logger[_0x9a35('0x14')](_0x9a35('0x1a'),_0x5b73f2,'request\x20sent');_0x520370(_0x42c80f['result'][_0x9a35('0x1b')]);}})['catch'](function(_0x3618d6){logger['error'](_0x9a35('0x1a'),_0x5b73f2,_0x3618d6);_0x2924cf(_0x3618d6);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 64dbf6d..2a7e2b4 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 _0xfbef=['./voicePrefix.events','save','remove','update','emit','removeListener','register','length','voicePrefix:'];(function(_0x15278d,_0x313596){var _0x21c8a7=function(_0x321be9){while(--_0x321be9){_0x15278d['push'](_0x15278d['shift']());}};_0x21c8a7(++_0x313596);}(_0xfbef,0x99));var _0xffbe=function(_0x3d0ce5,_0x4fc389){_0x3d0ce5=_0x3d0ce5-0x0;var _0x461bc5=_0xfbef[_0x3d0ce5];return _0x461bc5;};'use strict';var VoicePrefixEvents=require(_0xffbe('0x0'));var events=[_0xffbe('0x1'),_0xffbe('0x2'),_0xffbe('0x3')];function createListener(_0x4d35cb,_0x9f0361){return function(_0x53505b){_0x9f0361[_0xffbe('0x4')](_0x4d35cb,_0x53505b);};}function removeListener(_0x571ae3,_0x59bb38){return function(){VoicePrefixEvents[_0xffbe('0x5')](_0x571ae3,_0x59bb38);};}exports[_0xffbe('0x6')]=function(_0x8f4eea){for(var _0x1a915b=0x0,_0x24e9f7=events[_0xffbe('0x7')];_0x1a915b<_0x24e9f7;_0x1a915b++){var _0x1c49ec=events[_0x1a915b];var _0x36b58a=createListener(_0xffbe('0x8')+_0x1c49ec,_0x8f4eea);VoicePrefixEvents['on'](_0x1c49ec,_0x36b58a);}}; \ No newline at end of file +var _0x0c2e=['register','length','./voicePrefix.events','remove','update','emit'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x0c2e,0xe6));var _0xe0c2=function(_0x3a6899,_0x48996b){_0x3a6899=_0x3a6899-0x0;var _0x3b206c=_0x0c2e[_0x3a6899];return _0x3b206c;};'use strict';var VoicePrefixEvents=require(_0xe0c2('0x0'));var events=['save',_0xe0c2('0x1'),_0xe0c2('0x2')];function createListener(_0x383b58,_0x55d547){return function(_0x4b9734){_0x55d547[_0xe0c2('0x3')](_0x383b58,_0x4b9734);};}function removeListener(_0x3aaaf7,_0xcb107d){return function(){VoicePrefixEvents['removeListener'](_0x3aaaf7,_0xcb107d);};}exports[_0xe0c2('0x4')]=function(_0x529d09){for(var _0x3e332d=0x0,_0x22cdee=events[_0xe0c2('0x5')];_0x3e332d<_0x22cdee;_0x3e332d++){var _0x501def=events[_0x3e332d];var _0x987da5=createListener('voicePrefix:'+_0x501def,_0x529d09);VoicePrefixEvents['on'](_0x501def,_0x987da5);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 3f6f125..696417b 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 _0xd59a=['../../config/environment','./voiceQueue.controller','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getTeams','/:id/users','getAgents','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/teams','addTeams','addAgents','/:id/lists','addLists','addBlackLists','put','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x100338,_0x5cdbcc){var _0x330d32=function(_0x50c3dc){while(--_0x50c3dc){_0x100338['push'](_0x100338['shift']());}};_0x330d32(++_0x5cdbcc);}(_0xd59a,0x81));var _0xad59=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd59a[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0xad59('0x0'));var path=require(_0xad59('0x1'));var timeout=require('connect-timeout');var express=require(_0xad59('0x2'));var router=express[_0xad59('0x3')]();var auth=require(_0xad59('0x4'));var interaction=require(_0xad59('0x5'));var config=require(_0xad59('0x6'));var controller=require(_0xad59('0x7'));router[_0xad59('0x8')]('/',auth[_0xad59('0x9')](),controller['index']);router[_0xad59('0x8')](_0xad59('0xa'),auth[_0xad59('0x9')](),controller[_0xad59('0xb')]);router['get'](_0xad59('0xc'),auth['isAuthenticated'](),controller[_0xad59('0xd')]);router[_0xad59('0x8')](_0xad59('0xe'),auth[_0xad59('0x9')](),controller[_0xad59('0xf')]);router['get'](_0xad59('0x10'),auth['isAuthenticated'](),controller[_0xad59('0x11')]);router['get'](_0xad59('0x12'),auth[_0xad59('0x9')](),controller[_0xad59('0x13')]);router[_0xad59('0x8')]('/:id/teams',auth[_0xad59('0x9')](),controller[_0xad59('0x14')]);router['get'](_0xad59('0x15'),auth[_0xad59('0x9')](),controller[_0xad59('0x16')]);router[_0xad59('0x8')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router['get']('/:id/lists',auth['isAuthenticated'](),controller[_0xad59('0x17')]);router[_0xad59('0x8')](_0xad59('0x18'),auth[_0xad59('0x9')](),controller[_0xad59('0x19')]);router[_0xad59('0x1a')]('/',auth[_0xad59('0x9')](),controller[_0xad59('0x1b')]);router[_0xad59('0x1a')](_0xad59('0x1c'),auth[_0xad59('0x9')](),controller[_0xad59('0x1d')]);router['post'](_0xad59('0x1e'),auth['isAuthenticated'](),controller[_0xad59('0x1f')]);router[_0xad59('0x1a')](_0xad59('0x15'),auth['isAuthenticated'](),controller[_0xad59('0x20')]);router[_0xad59('0x1a')](_0xad59('0x21'),auth[_0xad59('0x9')](),controller[_0xad59('0x22')]);router[_0xad59('0x1a')](_0xad59('0x18'),auth[_0xad59('0x9')](),controller[_0xad59('0x23')]);router[_0xad59('0x24')](_0xad59('0xa'),auth[_0xad59('0x9')](),controller[_0xad59('0x25')]);router[_0xad59('0x26')](_0xad59('0xa'),auth[_0xad59('0x9')](),controller[_0xad59('0x27')]);router[_0xad59('0x26')]('/:id/teams',auth['isAuthenticated'](),controller[_0xad59('0x28')]);router['delete'](_0xad59('0x15'),auth['isAuthenticated'](),controller[_0xad59('0x29')]);router[_0xad59('0x26')](_0xad59('0x21'),auth[_0xad59('0x9')](),controller[_0xad59('0x2a')]);router[_0xad59('0x26')](_0xad59('0x18'),auth[_0xad59('0x9')](),controller[_0xad59('0x2b')]);module[_0xad59('0x2c')]=router; \ No newline at end of file +var _0xf18e=['delete','destroy','removeBlackLists','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceQueue.controller','isAuthenticated','index','/:id','show','get','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','/:id/members','getMembers','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','clone','addTeams','addAgents','addLists','/:id/blacklists','put','update'];(function(_0x28611e,_0x586726){var _0x530f69=function(_0x407906){while(--_0x407906){_0x28611e['push'](_0x28611e['shift']());}};_0x530f69(++_0x586726);}(_0xf18e,0x144));var _0xef18=function(_0x3bf1e3,_0x143a13){_0x3bf1e3=_0x3bf1e3-0x0;var _0x31b24c=_0xf18e[_0x3bf1e3];return _0x31b24c;};'use strict';var multer=require(_0xef18('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xef18('0x1'));var express=require(_0xef18('0x2'));var router=express[_0xef18('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xef18('0x4'));var config=require(_0xef18('0x5'));var controller=require(_0xef18('0x6'));router['get']('/',auth[_0xef18('0x7')](),controller[_0xef18('0x8')]);router['get'](_0xef18('0x9'),auth[_0xef18('0x7')](),controller[_0xef18('0xa')]);router[_0xef18('0xb')]('/:id/hoppers',auth[_0xef18('0x7')](),controller[_0xef18('0xc')]);router['get'](_0xef18('0xd'),auth[_0xef18('0x7')](),controller['getHopperHistories']);router[_0xef18('0xb')](_0xef18('0xe'),auth[_0xef18('0x7')](),controller[_0xef18('0xf')]);router['get'](_0xef18('0x10'),auth[_0xef18('0x7')](),controller[_0xef18('0x11')]);router[_0xef18('0xb')](_0xef18('0x12'),auth[_0xef18('0x7')](),controller[_0xef18('0x13')]);router[_0xef18('0xb')](_0xef18('0x14'),auth[_0xef18('0x7')](),controller['getAgents']);router['get'](_0xef18('0x15'),auth[_0xef18('0x7')](),controller[_0xef18('0x16')]);router[_0xef18('0xb')](_0xef18('0x17'),auth['isAuthenticated'](),controller[_0xef18('0x18')]);router['get']('/:id/blacklists',auth[_0xef18('0x7')](),controller[_0xef18('0x19')]);router[_0xef18('0x1a')]('/',auth[_0xef18('0x7')](),controller[_0xef18('0x1b')]);router['post'](_0xef18('0x1c'),auth[_0xef18('0x7')](),controller[_0xef18('0x1d')]);router['post']('/:id/teams',auth[_0xef18('0x7')](),controller[_0xef18('0x1e')]);router['post'](_0xef18('0x14'),auth[_0xef18('0x7')](),controller[_0xef18('0x1f')]);router[_0xef18('0x1a')](_0xef18('0x17'),auth[_0xef18('0x7')](),controller[_0xef18('0x20')]);router['post'](_0xef18('0x21'),auth['isAuthenticated'](),controller['addBlackLists']);router[_0xef18('0x22')](_0xef18('0x9'),auth[_0xef18('0x7')](),controller[_0xef18('0x23')]);router[_0xef18('0x24')](_0xef18('0x9'),auth[_0xef18('0x7')](),controller[_0xef18('0x25')]);router[_0xef18('0x24')](_0xef18('0x12'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xef18('0x24')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);router['delete'](_0xef18('0x17'),auth['isAuthenticated'](),controller['removeLists']);router[_0xef18('0x24')](_0xef18('0x21'),auth[_0xef18('0x7')](),controller[_0xef18('0x26')]);module[_0xef18('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index cc8bea9..08c20f6 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(_0x3003fc,_0x5ac5de){var _0x22cb43=function(_0x478661){while(--_0x478661){_0x3003fc['push'](_0x3003fc['shift']());}};_0x22cb43(++_0x5ac5de);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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(_0x3c2efd,_0x405f28){var _0x433b01=function(_0xd9f231){while(--_0xd9f231){_0x3c2efd['push'](_0x3c2efd['shift']());}};_0x433b01(++_0x405f28);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 4efff4c..596dcf2 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 _0xa1b9=['findAll','rows','catch','show','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','inbound','outbound','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','includeAll','omit','updatedAt','QueueCampaigns','getHoppers','findOne','hasOwnProperty','nolimit','CmHopper','getHopperHistories','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','Agents','voicePause','interface','flatMap','sequelize','transaction','each','UserVoiceQueue','findOrCreate','penalty','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','forEach','userVoiceQueue:save','removeTeams','ids','User','field','tq.TeamId','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','toString','SELECT','every','all','union','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','emit','online','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','select','ContactId','CmListId','ListId','NOW()','createdAt','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','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','./voiceQueue.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','ignore','map','value','includes','type','find','end','stack','name','send','index','VoiceQueue','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','include'];(function(_0x57d631,_0x3792f6){var _0x1fb8ac=function(_0x233c33){while(--_0x233c33){_0x57d631['push'](_0x57d631['shift']());}};_0x1fb8ac(++_0x3792f6);}(_0xa1b9,0x71));var _0x9a1b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa1b9[_0x1facfa];return _0x9ec701;};'use strict';var pdf=require(_0x9a1b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9a1b('0x1'));var zipdir=require(_0x9a1b('0x2'));var jsonpatch=require(_0x9a1b('0x3'));var rp=require(_0x9a1b('0x4'));var moment=require(_0x9a1b('0x5'));var BPromise=require(_0x9a1b('0x6'));var Mustache=require(_0x9a1b('0x7'));var util=require('util');var path=require(_0x9a1b('0x8'));var sox=require(_0x9a1b('0x9'));var csv=require(_0x9a1b('0xa'));var ejs=require(_0x9a1b('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9a1b('0xc'));var crypto=require('crypto');var jsforce=require(_0x9a1b('0xd'));var deskjs=require(_0x9a1b('0xe'));var toCsv=require(_0x9a1b('0xa'));var querystring=require(_0x9a1b('0xf'));var Papa=require(_0x9a1b('0x10'));var Redis=require('ioredis');var authService=require(_0x9a1b('0x11'));var qs=require(_0x9a1b('0x12'));var as=require(_0x9a1b('0x13'));var hardwareService=require(_0x9a1b('0x14'));var logger=require(_0x9a1b('0x15'))(_0x9a1b('0x16'));var utils=require(_0x9a1b('0x17'));var config=require('../../config/environment');var db=require(_0x9a1b('0x18'))['db'];config[_0x9a1b('0x19')]=_[_0x9a1b('0x1a')](config['redis'],{'host':_0x9a1b('0x1b'),'port':0x18eb});var socket=require(_0x9a1b('0x1c'))(new Redis(config[_0x9a1b('0x19')]));require(_0x9a1b('0x1d'))[_0x9a1b('0x1e')](socket);function respondWithStatusCode(_0x157b6f,_0x3fe388){_0x3fe388=_0x3fe388||0xcc;return function(_0x18df50){if(_0x18df50){return _0x157b6f[_0x9a1b('0x1f')](_0x3fe388);}return _0x157b6f[_0x9a1b('0x20')](_0x3fe388)['end']();};}function respondWithResult(_0x357cd9,_0x2440fc){_0x2440fc=_0x2440fc||0xc8;return function(_0x5a1d3b){if(_0x5a1d3b){return _0x357cd9[_0x9a1b('0x20')](_0x2440fc)[_0x9a1b('0x21')](_0x5a1d3b);}};}function respondWithFilteredResult(_0x80245,_0x1a7324){return function(_0x402d0c){if(_0x402d0c){var _0x478626=_0x402d0c[_0x9a1b('0x22')],_0xe7a820=_0x1a7324[_0x9a1b('0x23')],_0x599325=_0x1a7324[_0x9a1b('0x23')]+_0x1a7324[_0x9a1b('0x24')],_0x403250;if(_0x599325>=_0x478626){_0x599325=_0x478626;_0x403250=0xc8;}else{_0x403250=0xce;}_0x80245['status'](_0x403250);return _0x80245[_0x9a1b('0x25')](_0x9a1b('0x26'),_0xe7a820+'-'+_0x599325+'/'+_0x478626)[_0x9a1b('0x21')](_0x402d0c);}return null;};}function patchUpdates(_0x1977a7){return function(_0x4a0ccd){try{jsonpatch[_0x9a1b('0x27')](_0x4a0ccd,_0x1977a7,!![]);}catch(_0x303110){return BPromise[_0x9a1b('0x28')](_0x303110);}return _0x4a0ccd[_0x9a1b('0x29')]();};}function saveUpdates(_0x1c9ab3,_0x327cac){return function(_0x2b8cfe){if(_0x2b8cfe){return _0x2b8cfe[_0x9a1b('0x2a')](_0x1c9ab3)[_0x9a1b('0x2b')](function(_0x37971c){return _0x37971c;});}return null;};}function removeEntity(_0x5841c1,_0x2439e9){return function(_0x3392da){if(_0x3392da){return _0x3392da[_0x9a1b('0x2c')]()['then'](function(){var _0x5cf12d=_0x3392da[_0x9a1b('0x2d')]({'plain':!![]});var _0x52fce9=[{'name':_0x9a1b('0x2e'),'value':'inbound','ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x432a3d=_(_0x52fce9)['filter'](_0x9a1b('0x2f'))[_0x9a1b('0x30')](_0x9a1b('0x31'))[_0x9a1b('0x31')]();if(_[_0x9a1b('0x32')](_0x432a3d,_0x5cf12d[_0x9a1b('0x33')])){return;}var _0x1c13d6=_[_0x9a1b('0x34')](_0x52fce9,[_0x9a1b('0x31'),_0x5cf12d[_0x9a1b('0x33')]])['name'];return db['UserProfileResource'][_0x9a1b('0x2c')]({'where':{'type':_0x1c13d6,'resourceId':_0x5cf12d['id']}})[_0x9a1b('0x2b')](function(){return _0x3392da;});})['then'](function(){_0x5841c1[_0x9a1b('0x20')](0xcc)[_0x9a1b('0x35')]();});}};}function handleEntityNotFound(_0x4028f0,_0x3bc034){return function(_0x311432){if(!_0x311432){_0x4028f0[_0x9a1b('0x1f')](0x194);}return _0x311432;};}function handleError(_0xc93663,_0xd428e0){_0xd428e0=_0xd428e0||0x1f4;return function(_0x1e7f23){logger['error'](_0x1e7f23[_0x9a1b('0x36')]);if(_0x1e7f23['name']){delete _0x1e7f23[_0x9a1b('0x37')];}_0xc93663[_0x9a1b('0x20')](_0xd428e0)[_0x9a1b('0x38')](_0x1e7f23);};}exports[_0x9a1b('0x39')]=function(_0x53a7db,_0xfc101c){var _0x3bf81e={},_0x2f56ae={},_0x39e26b={'count':0x0,'rows':[]};var _0x12dc16=_[_0x9a1b('0x30')](db[_0x9a1b('0x3a')][_0x9a1b('0x3b')],function(_0x2ec5d6){return{'name':_0x2ec5d6['fieldName'],'type':_0x2ec5d6[_0x9a1b('0x33')][_0x9a1b('0x3c')]};});_0x2f56ae[_0x9a1b('0x3d')]=_[_0x9a1b('0x30')](_0x12dc16,_0x9a1b('0x37'));_0x2f56ae[_0x9a1b('0x3e')]=_[_0x9a1b('0x3f')](_0x53a7db['query']);_0x2f56ae[_0x9a1b('0x40')]=_[_0x9a1b('0x41')](_0x2f56ae[_0x9a1b('0x3d')],_0x2f56ae[_0x9a1b('0x3e')]);_0x3bf81e[_0x9a1b('0x42')]=_[_0x9a1b('0x41')](_0x2f56ae[_0x9a1b('0x3d')],qs[_0x9a1b('0x43')](_0x53a7db[_0x9a1b('0x3e')]['fields']));_0x3bf81e[_0x9a1b('0x42')]=_0x3bf81e[_0x9a1b('0x42')]['length']?_0x3bf81e[_0x9a1b('0x42')]:_0x2f56ae[_0x9a1b('0x3d')];if(!_0x53a7db['query']['hasOwnProperty']('nolimit')){_0x3bf81e[_0x9a1b('0x24')]=qs[_0x9a1b('0x24')](_0x53a7db[_0x9a1b('0x3e')][_0x9a1b('0x24')]);_0x3bf81e[_0x9a1b('0x23')]=qs['offset'](_0x53a7db[_0x9a1b('0x3e')][_0x9a1b('0x23')]);}_0x3bf81e[_0x9a1b('0x44')]=qs[_0x9a1b('0x45')](_0x53a7db[_0x9a1b('0x3e')][_0x9a1b('0x45')]);_0x3bf81e[_0x9a1b('0x46')]=qs['filters'](_[_0x9a1b('0x47')](_0x53a7db[_0x9a1b('0x3e')],_0x2f56ae['filters']));if(_0x53a7db[_0x9a1b('0x3e')][_0x9a1b('0x48')]){_0x3bf81e[_0x9a1b('0x46')]=_[_0x9a1b('0x49')](_0x3bf81e['where'],{'$or':_[_0x9a1b('0x30')](_0x12dc16,function(_0x392045){if(_0x392045[_0x9a1b('0x33')]!==_0x9a1b('0x4a')){var _0x1863d8={};_0x1863d8[_0x392045[_0x9a1b('0x37')]]={'$like':'%'+_0x53a7db['query'][_0x9a1b('0x48')]+'%'};return _0x1863d8;}})});}_0x3bf81e=_[_0x9a1b('0x49')]({},_0x3bf81e,_0x53a7db[_0x9a1b('0x4b')]);var _0x483277={'where':_0x3bf81e[_0x9a1b('0x46')]};return db[_0x9a1b('0x3a')][_0x9a1b('0x22')](_0x483277)[_0x9a1b('0x2b')](function(_0x3275f2){_0x39e26b[_0x9a1b('0x22')]=_0x3275f2;if(_0x53a7db[_0x9a1b('0x3e')]['includeAll']){_0x3bf81e[_0x9a1b('0x4c')]=[{'all':!![]}];}return db[_0x9a1b('0x3a')][_0x9a1b('0x4d')](_0x3bf81e);})[_0x9a1b('0x2b')](function(_0x4f067b){_0x39e26b[_0x9a1b('0x4e')]=_0x4f067b;return _0x39e26b;})[_0x9a1b('0x2b')](respondWithFilteredResult(_0xfc101c,_0x3bf81e))[_0x9a1b('0x4f')](handleError(_0xfc101c,null));};exports[_0x9a1b('0x50')]=function(_0x2a49a0,_0x925a3b){var _0x2e3f2f={'raw':![],'where':{'id':_0x2a49a0['params']['id']}},_0x4a3939={};_0x4a3939[_0x9a1b('0x3d')]=_[_0x9a1b('0x3f')](db['VoiceQueue'][_0x9a1b('0x3b')]);_0x4a3939[_0x9a1b('0x3e')]=_[_0x9a1b('0x3f')](_0x2a49a0['query']);_0x4a3939['filters']=_['intersection'](_0x4a3939[_0x9a1b('0x3d')],_0x4a3939[_0x9a1b('0x3e')]);_0x2e3f2f['attributes']=_[_0x9a1b('0x41')](_0x4a3939[_0x9a1b('0x3d')],qs['fields'](_0x2a49a0['query'][_0x9a1b('0x43')]));_0x2e3f2f[_0x9a1b('0x42')]=_0x2e3f2f['attributes'][_0x9a1b('0x51')]?_0x2e3f2f[_0x9a1b('0x42')]:_0x4a3939[_0x9a1b('0x3d')];if(_0x2a49a0[_0x9a1b('0x3e')]['includeAll']){_0x2e3f2f['include']=[{'all':!![]}];}_0x2e3f2f=_['merge']({},_0x2e3f2f,_0x2a49a0[_0x9a1b('0x4b')]);return db[_0x9a1b('0x3a')][_0x9a1b('0x34')](_0x2e3f2f)[_0x9a1b('0x2b')](handleEntityNotFound(_0x925a3b,null))[_0x9a1b('0x2b')](respondWithResult(_0x925a3b,null))[_0x9a1b('0x4f')](handleError(_0x925a3b,null));};exports[_0x9a1b('0x52')]=function(_0x3a29ce,_0xfd1edc){return db[_0x9a1b('0x3a')][_0x9a1b('0x52')](_0x3a29ce[_0x9a1b('0x53')],{})[_0x9a1b('0x2b')](function(_0x2bc22a){var _0x5cb018=_0x3a29ce['user'][_0x9a1b('0x2d')]({'plain':!![]});if(!_0x5cb018)throw new Error(_0x9a1b('0x54'));if(_0x5cb018[_0x9a1b('0x55')]===_0x9a1b('0x56')){var _0x47b452=_0x2bc22a[_0x9a1b('0x2d')]({'plain':!![]});var _0x2fc033=[{'name':_0x9a1b('0x2e'),'value':_0x9a1b('0x57')},{'name':'QueueCampaigns','value':_0x9a1b('0x58')}];var _0x33c3b3=_[_0x9a1b('0x34')](_0x2fc033,[_0x9a1b('0x31'),_0x47b452['type']])[_0x9a1b('0x37')];return db[_0x9a1b('0x59')]['find']({'where':{'name':_0x33c3b3,'userProfileId':_0x5cb018[_0x9a1b('0x5a')]},'raw':!![]})['then'](function(_0x5da24f){if(_0x5da24f&&_0x5da24f[_0x9a1b('0x5b')]===0x0){return db[_0x9a1b('0x5c')][_0x9a1b('0x52')]({'name':_0x47b452['name'],'resourceId':_0x47b452['id'],'type':_0x5da24f[_0x9a1b('0x37')],'sectionId':_0x5da24f['id']},{})[_0x9a1b('0x2b')](function(){return _0x2bc22a;});}else{return _0x2bc22a;}})[_0x9a1b('0x4f')](function(_0x271fc7){logger[_0x9a1b('0x5d')](_0x9a1b('0x5e'),_0x271fc7);throw _0x271fc7;});}return _0x2bc22a;})[_0x9a1b('0x2b')](respondWithResult(_0xfd1edc,0xc9))[_0x9a1b('0x4f')](handleError(_0xfd1edc,null));};exports[_0x9a1b('0x5f')]=function(_0x3f2894,_0x364c1f){var _0x39be22={'where':{'id':_0x3f2894[_0x9a1b('0x60')]['id']}},_0x62fa15={};_0x62fa15[_0x9a1b('0x3d')]=_[_0x9a1b('0x3f')](db[_0x9a1b('0x3a')][_0x9a1b('0x3b')]);_0x39be22[_0x9a1b('0x42')]=_[_0x9a1b('0x41')](_0x62fa15[_0x9a1b('0x3d')],qs[_0x9a1b('0x43')](_0x3f2894[_0x9a1b('0x3e')]['fields']));_0x39be22[_0x9a1b('0x42')]=_0x39be22[_0x9a1b('0x42')]['length']?_0x39be22[_0x9a1b('0x42')]:_0x62fa15[_0x9a1b('0x3d')];if(_0x3f2894[_0x9a1b('0x3e')][_0x9a1b('0x61')]){_0x39be22['include']=[{'all':!![]}];}_0x39be22=_[_0x9a1b('0x49')]({},_0x39be22,_0x3f2894[_0x9a1b('0x4b')]);return db['VoiceQueue'][_0x9a1b('0x34')](_0x39be22)[_0x9a1b('0x2b')](handleEntityNotFound(_0x364c1f,null))['then'](function(_0x3a2a97){if(_0x3a2a97){var _0xeb21a7=_0x3a2a97['get']({'plain':!![]});_0xeb21a7=qs[_0x9a1b('0x62')](_0xeb21a7,['id','createdAt',_0x9a1b('0x63')]);_0x3f2894[_0x9a1b('0x53')]=_[_0x9a1b('0x62')](_0x3f2894[_0x9a1b('0x53')],['id','createdAt',_0x9a1b('0x63')]);return db[_0x9a1b('0x3a')][_0x9a1b('0x52')](_[_0x9a1b('0x49')](_0xeb21a7,_0x3f2894['body']),{'include':_0x3f2894[_0x9a1b('0x3e')][_0x9a1b('0x61')]?[{'all':!![]}]:undefined})[_0x9a1b('0x2b')](function(_0x47d925){var _0x3a553d=_0x3f2894['user']['get']({'plain':!![]});if(!_0x3a553d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a553d[_0x9a1b('0x55')]==='user'){var _0x39f727=_0x47d925[_0x9a1b('0x2d')]({'plain':!![]});var _0x899dfa=[{'name':_0x9a1b('0x2e'),'value':'inbound'},{'name':_0x9a1b('0x64'),'value':_0x9a1b('0x58')}];var _0x53b4d4=_[_0x9a1b('0x34')](_0x899dfa,[_0x9a1b('0x31'),_0x39f727[_0x9a1b('0x33')]])['name'];return db[_0x9a1b('0x59')][_0x9a1b('0x34')]({'where':{'name':_0x53b4d4,'userProfileId':_0x3a553d[_0x9a1b('0x5a')]},'raw':!![]})[_0x9a1b('0x2b')](function(_0x4766e8){if(_0x4766e8&&_0x4766e8[_0x9a1b('0x5b')]===0x0){return db[_0x9a1b('0x5c')]['create']({'name':_0x39f727['name'],'resourceId':_0x39f727['id'],'type':_0x4766e8[_0x9a1b('0x37')],'sectionId':_0x4766e8['id']},{})[_0x9a1b('0x2b')](function(){return _0x47d925;});}else{return _0x47d925;}})[_0x9a1b('0x4f')](function(_0x3448a3){logger[_0x9a1b('0x5d')](_0x9a1b('0x5e'),_0x3448a3);throw _0x3448a3;});}return _0x47d925;});}})[_0x9a1b('0x2b')](respondWithResult(_0x364c1f,0xc9))[_0x9a1b('0x4f')](handleError(_0x364c1f,null));};exports[_0x9a1b('0x2a')]=function(_0x3c14bd,_0x5ce2b0){if(_0x3c14bd[_0x9a1b('0x53')]['id']){delete _0x3c14bd[_0x9a1b('0x53')]['id'];}return db['VoiceQueue']['find']({'where':{'id':_0x3c14bd[_0x9a1b('0x60')]['id']}})[_0x9a1b('0x2b')](handleEntityNotFound(_0x5ce2b0,null))['then'](saveUpdates(_0x3c14bd['body'],null))[_0x9a1b('0x2b')](respondWithResult(_0x5ce2b0,null))[_0x9a1b('0x4f')](handleError(_0x5ce2b0,null));};exports[_0x9a1b('0x2c')]=function(_0x18b4bb,_0x1c51c8){return db[_0x9a1b('0x3a')][_0x9a1b('0x34')]({'where':{'id':_0x18b4bb[_0x9a1b('0x60')]['id']}})[_0x9a1b('0x2b')](handleEntityNotFound(_0x1c51c8,null))[_0x9a1b('0x2b')](removeEntity(_0x1c51c8,null))[_0x9a1b('0x4f')](handleError(_0x1c51c8,null));};exports[_0x9a1b('0x65')]=function(_0x2ec66d,_0x6dc531,_0x33008a){var _0x685f86={'raw':![],'where':{}};var _0x1919ec={};var _0x39a969={'count':0x0,'rows':[]};return db[_0x9a1b('0x3a')][_0x9a1b('0x66')]({'where':{'id':_0x2ec66d[_0x9a1b('0x60')]['id']}})[_0x9a1b('0x2b')](handleEntityNotFound(_0x6dc531,null))['then'](function(_0x107fb2){if(_0x107fb2){_0x1919ec['model']=_[_0x9a1b('0x3f')](db['CmHopper'][_0x9a1b('0x3b')]);_0x1919ec[_0x9a1b('0x3e')]=_[_0x9a1b('0x3f')](_0x2ec66d[_0x9a1b('0x3e')]);_0x1919ec['filters']=_[_0x9a1b('0x41')](_0x1919ec['model'],_0x1919ec[_0x9a1b('0x3e')]);_0x685f86['attributes']=_['intersection'](_0x1919ec['model'],qs[_0x9a1b('0x43')](_0x2ec66d[_0x9a1b('0x3e')][_0x9a1b('0x43')]));_0x685f86[_0x9a1b('0x42')]=_0x685f86['attributes'][_0x9a1b('0x51')]?_0x685f86['attributes']:_0x1919ec['model'];if(!_0x2ec66d['query'][_0x9a1b('0x67')](_0x9a1b('0x68'))){_0x685f86[_0x9a1b('0x24')]=qs[_0x9a1b('0x24')](_0x2ec66d[_0x9a1b('0x3e')][_0x9a1b('0x24')]);_0x685f86[_0x9a1b('0x23')]=qs[_0x9a1b('0x23')](_0x2ec66d[_0x9a1b('0x3e')]['offset']);}_0x685f86[_0x9a1b('0x44')]=qs[_0x9a1b('0x45')](_0x2ec66d[_0x9a1b('0x3e')][_0x9a1b('0x45')]);_0x685f86[_0x9a1b('0x46')]=qs[_0x9a1b('0x40')](_['pick'](_0x2ec66d[_0x9a1b('0x3e')],_0x1919ec[_0x9a1b('0x40')]));_0x685f86['where']['VoiceQueueId']=_0x107fb2['id'];if(_0x2ec66d[_0x9a1b('0x3e')][_0x9a1b('0x48')]){_0x685f86[_0x9a1b('0x46')]=_[_0x9a1b('0x49')](_0x685f86[_0x9a1b('0x46')],{'$or':_[_0x9a1b('0x30')](_0x685f86[_0x9a1b('0x42')],function(_0x3f0c90){var _0x4501c7={};_0x4501c7[_0x3f0c90]={'$like':'%'+_0x2ec66d['query'][_0x9a1b('0x48')]+'%'};return _0x4501c7;})});}_0x685f86=_[_0x9a1b('0x49')]({},_0x685f86,_0x2ec66d[_0x9a1b('0x4b')]);return db[_0x9a1b('0x69')][_0x9a1b('0x22')]({'where':_0x685f86[_0x9a1b('0x46')]})[_0x9a1b('0x2b')](function(_0x2bef9d){_0x39a969['count']=_0x2bef9d;if(_0x2ec66d[_0x9a1b('0x3e')][_0x9a1b('0x61')]){_0x685f86[_0x9a1b('0x4c')]=[{'all':!![]}];}return db['CmHopper'][_0x9a1b('0x4d')](_0x685f86);})[_0x9a1b('0x2b')](function(_0x114951){_0x39a969[_0x9a1b('0x4e')]=_0x114951;return _0x39a969;});}})[_0x9a1b('0x2b')](respondWithFilteredResult(_0x6dc531,_0x685f86))[_0x9a1b('0x4f')](handleError(_0x6dc531,null));};exports[_0x9a1b('0x6a')]=function(_0xd82974,_0x40a399,_0x34b8a4){var _0x5b4d49={'raw':!![],'where':{}};var _0xe48949={};var _0x3b762a={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0xd82974[_0x9a1b('0x60')]['id']}})[_0x9a1b('0x2b')](handleEntityNotFound(_0x40a399,null))['then'](function(_0x56cd90){if(_0x56cd90){_0xe48949[_0x9a1b('0x3d')]=_['keys'](db[_0x9a1b('0x6b')][_0x9a1b('0x3b')]);_0xe48949[_0x9a1b('0x3e')]=_[_0x9a1b('0x3f')](_0xd82974[_0x9a1b('0x3e')]);_0xe48949['filters']=_[_0x9a1b('0x41')](_0xe48949['model'],_0xe48949['query']);_0x5b4d49[_0x9a1b('0x42')]=_[_0x9a1b('0x41')](_0xe48949[_0x9a1b('0x3d')],qs[_0x9a1b('0x43')](_0xd82974['query'][_0x9a1b('0x43')]));_0x5b4d49[_0x9a1b('0x42')]=_0x5b4d49[_0x9a1b('0x42')][_0x9a1b('0x51')]?_0x5b4d49['attributes']:_0xe48949['model'];if(!_0xd82974['query'][_0x9a1b('0x67')](_0x9a1b('0x68'))){_0x5b4d49[_0x9a1b('0x24')]=qs[_0x9a1b('0x24')](_0xd82974[_0x9a1b('0x3e')][_0x9a1b('0x24')]);_0x5b4d49[_0x9a1b('0x23')]=qs[_0x9a1b('0x23')](_0xd82974[_0x9a1b('0x3e')][_0x9a1b('0x23')]);}_0x5b4d49[_0x9a1b('0x44')]=qs[_0x9a1b('0x45')](_0xd82974[_0x9a1b('0x3e')][_0x9a1b('0x45')]);_0x5b4d49[_0x9a1b('0x46')]=qs[_0x9a1b('0x40')](_[_0x9a1b('0x47')](_0xd82974[_0x9a1b('0x3e')],_0xe48949['filters']));_0x5b4d49[_0x9a1b('0x46')][_0x9a1b('0x6c')]=_0x56cd90['id'];if(_0xd82974[_0x9a1b('0x3e')][_0x9a1b('0x48')]){_0x5b4d49[_0x9a1b('0x46')]=_['merge'](_0x5b4d49['where'],{'$or':_[_0x9a1b('0x30')](_0x5b4d49[_0x9a1b('0x42')],function(_0x4d3994){var _0x3b118b={};_0x3b118b[_0x4d3994]={'$like':'%'+_0xd82974[_0x9a1b('0x3e')][_0x9a1b('0x48')]+'%'};return _0x3b118b;})});}_0x5b4d49=_['merge']({},_0x5b4d49,_0xd82974[_0x9a1b('0x4b')]);return db[_0x9a1b('0x6b')][_0x9a1b('0x22')]({'where':_0x5b4d49[_0x9a1b('0x46')]})['then'](function(_0x2096b5){_0x3b762a[_0x9a1b('0x22')]=_0x2096b5;if(_0xd82974[_0x9a1b('0x3e')]['includeAll']){_0x5b4d49[_0x9a1b('0x4c')]=[{'all':!![]}];}return db[_0x9a1b('0x6b')][_0x9a1b('0x4d')](_0x5b4d49);})[_0x9a1b('0x2b')](function(_0x256e89){_0x3b762a['rows']=_0x256e89;return _0x3b762a;});}})[_0x9a1b('0x2b')](respondWithFilteredResult(_0x40a399,_0x5b4d49))[_0x9a1b('0x4f')](handleError(_0x40a399,null));};exports[_0x9a1b('0x6d')]=function(_0xcac44e,_0x5c4c0e,_0x2c235d){var _0x307f43={'raw':!![],'where':{}};var _0x35904e={};var _0x147b28={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x9a1b('0x66')]({'where':{'id':_0xcac44e[_0x9a1b('0x60')]['id']}})[_0x9a1b('0x2b')](handleEntityNotFound(_0x5c4c0e,null))[_0x9a1b('0x2b')](function(_0x1ea563){if(_0x1ea563){_0x35904e[_0x9a1b('0x3d')]=_['keys'](db[_0x9a1b('0x6e')][_0x9a1b('0x3b')]);_0x35904e['query']=_[_0x9a1b('0x3f')](_0xcac44e[_0x9a1b('0x3e')]);_0x35904e[_0x9a1b('0x40')]=_[_0x9a1b('0x41')](_0x35904e[_0x9a1b('0x3d')],_0x35904e[_0x9a1b('0x3e')]);_0x307f43['attributes']=_[_0x9a1b('0x41')](_0x35904e[_0x9a1b('0x3d')],qs[_0x9a1b('0x43')](_0xcac44e[_0x9a1b('0x3e')][_0x9a1b('0x43')]));_0x307f43[_0x9a1b('0x42')]=_0x307f43['attributes']['length']?_0x307f43['attributes']:_0x35904e[_0x9a1b('0x3d')];if(!_0xcac44e[_0x9a1b('0x3e')]['hasOwnProperty'](_0x9a1b('0x68'))){_0x307f43['limit']=qs[_0x9a1b('0x24')](_0xcac44e[_0x9a1b('0x3e')][_0x9a1b('0x24')]);_0x307f43[_0x9a1b('0x23')]=qs[_0x9a1b('0x23')](_0xcac44e[_0x9a1b('0x3e')]['offset']);}_0x307f43[_0x9a1b('0x44')]=qs[_0x9a1b('0x45')](_0xcac44e[_0x9a1b('0x3e')]['sort']);_0x307f43[_0x9a1b('0x46')]=qs['filters'](_[_0x9a1b('0x47')](_0xcac44e[_0x9a1b('0x3e')],_0x35904e[_0x9a1b('0x40')]));_0x307f43[_0x9a1b('0x46')][_0x9a1b('0x6c')]=_0x1ea563['id'];if(_0xcac44e['query'][_0x9a1b('0x48')]){_0x307f43['where']=_[_0x9a1b('0x49')](_0x307f43[_0x9a1b('0x46')],{'$or':_[_0x9a1b('0x30')](_0x307f43[_0x9a1b('0x42')],function(_0x36b6aa){var _0x1c39ed={};_0x1c39ed[_0x36b6aa]={'$like':'%'+_0xcac44e[_0x9a1b('0x3e')][_0x9a1b('0x48')]+'%'};return _0x1c39ed;})});}_0x307f43=_[_0x9a1b('0x49')]({},_0x307f43,_0xcac44e[_0x9a1b('0x4b')]);return db[_0x9a1b('0x6e')][_0x9a1b('0x22')]({'where':_0x307f43[_0x9a1b('0x46')]})[_0x9a1b('0x2b')](function(_0x4c27b5){_0x147b28['count']=_0x4c27b5;if(_0xcac44e[_0x9a1b('0x3e')][_0x9a1b('0x61')]){_0x307f43[_0x9a1b('0x4c')]=[{'all':!![]}];}return db[_0x9a1b('0x6e')][_0x9a1b('0x4d')](_0x307f43);})[_0x9a1b('0x2b')](function(_0x2260c5){_0x147b28[_0x9a1b('0x4e')]=_0x2260c5;return _0x147b28;});}})['then'](respondWithFilteredResult(_0x5c4c0e,_0x307f43))[_0x9a1b('0x4f')](handleError(_0x5c4c0e,null));};exports[_0x9a1b('0x6f')]=function(_0x394271,_0x721289,_0x47f1a9){var _0x1d141e={'raw':!![],'where':{}};var _0x1b1831={};var _0x5a4717={'count':0x0,'rows':[]};return db[_0x9a1b('0x3a')][_0x9a1b('0x66')]({'where':{'id':_0x394271[_0x9a1b('0x60')]['id']}})[_0x9a1b('0x2b')](handleEntityNotFound(_0x721289,null))['then'](function(_0x1b49c0){if(_0x1b49c0){_0x1b1831[_0x9a1b('0x3d')]=_[_0x9a1b('0x3f')](db[_0x9a1b('0x70')]['rawAttributes']);_0x1b1831[_0x9a1b('0x3e')]=_[_0x9a1b('0x3f')](_0x394271[_0x9a1b('0x3e')]);_0x1b1831[_0x9a1b('0x40')]=_[_0x9a1b('0x41')](_0x1b1831[_0x9a1b('0x3d')],_0x1b1831[_0x9a1b('0x3e')]);_0x1d141e[_0x9a1b('0x42')]=_['intersection'](_0x1b1831[_0x9a1b('0x3d')],qs[_0x9a1b('0x43')](_0x394271[_0x9a1b('0x3e')][_0x9a1b('0x43')]));_0x1d141e[_0x9a1b('0x42')]=_0x1d141e['attributes'][_0x9a1b('0x51')]?_0x1d141e[_0x9a1b('0x42')]:_0x1b1831[_0x9a1b('0x3d')];if(!_0x394271['query']['hasOwnProperty'](_0x9a1b('0x68'))){_0x1d141e['limit']=qs[_0x9a1b('0x24')](_0x394271[_0x9a1b('0x3e')][_0x9a1b('0x24')]);_0x1d141e['offset']=qs['offset'](_0x394271[_0x9a1b('0x3e')]['offset']);}_0x1d141e[_0x9a1b('0x44')]=qs[_0x9a1b('0x45')](_0x394271['query'][_0x9a1b('0x45')]);_0x1d141e[_0x9a1b('0x46')]=qs['filters'](_[_0x9a1b('0x47')](_0x394271['query'],_0x1b1831['filters']));_0x1d141e[_0x9a1b('0x46')][_0x9a1b('0x6c')]=_0x1b49c0['id'];if(_0x394271[_0x9a1b('0x3e')][_0x9a1b('0x48')]){_0x1d141e[_0x9a1b('0x46')]=_['merge'](_0x1d141e['where'],{'$or':_[_0x9a1b('0x30')](_0x1d141e[_0x9a1b('0x42')],function(_0x71e75){var _0x3c62a8={};_0x3c62a8[_0x71e75]={'$like':'%'+_0x394271[_0x9a1b('0x3e')][_0x9a1b('0x48')]+'%'};return _0x3c62a8;})});}_0x1d141e=_[_0x9a1b('0x49')]({},_0x1d141e,_0x394271['options']);return db[_0x9a1b('0x70')][_0x9a1b('0x22')]({'where':_0x1d141e['where']})['then'](function(_0x5240df){_0x5a4717['count']=_0x5240df;if(_0x394271[_0x9a1b('0x3e')][_0x9a1b('0x61')]){_0x1d141e[_0x9a1b('0x4c')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x9a1b('0x4d')](_0x1d141e);})[_0x9a1b('0x2b')](function(_0x4781c1){_0x5a4717[_0x9a1b('0x4e')]=_0x4781c1;return _0x5a4717;});}})['then'](respondWithFilteredResult(_0x721289,_0x1d141e))[_0x9a1b('0x4f')](handleError(_0x721289,null));};exports['getTeams']=function(_0xd2328d,_0x21d3af,_0x1588ac){var _0x5979fe={};var _0x201f1c={};var _0x2eac96;var _0x3aa3a4;return db[_0x9a1b('0x3a')][_0x9a1b('0x66')]({'where':{'id':_0xd2328d['params']['id']}})[_0x9a1b('0x2b')](handleEntityNotFound(_0x21d3af,null))[_0x9a1b('0x2b')](function(_0x319f45){if(_0x319f45){_0x2eac96=_0x319f45;_0x201f1c['model']=_[_0x9a1b('0x3f')](db[_0x9a1b('0x71')][_0x9a1b('0x3b')]);_0x201f1c[_0x9a1b('0x3e')]=_[_0x9a1b('0x3f')](_0xd2328d['query']);_0x201f1c[_0x9a1b('0x40')]=_['intersection'](_0x201f1c['model'],_0x201f1c['query']);_0x5979fe[_0x9a1b('0x42')]=_[_0x9a1b('0x41')](_0x201f1c['model'],qs[_0x9a1b('0x43')](_0xd2328d['query'][_0x9a1b('0x43')]));_0x5979fe[_0x9a1b('0x42')]=_0x5979fe[_0x9a1b('0x42')][_0x9a1b('0x51')]?_0x5979fe[_0x9a1b('0x42')]:_0x201f1c[_0x9a1b('0x3d')];_0x5979fe['order']=qs[_0x9a1b('0x45')](_0xd2328d[_0x9a1b('0x3e')][_0x9a1b('0x45')]);_0x5979fe[_0x9a1b('0x46')]=qs['filters'](_[_0x9a1b('0x47')](_0xd2328d['query'],_0x201f1c[_0x9a1b('0x40')]));if(_0xd2328d['query'][_0x9a1b('0x48')]){_0x5979fe['where']=_[_0x9a1b('0x49')](_0x5979fe[_0x9a1b('0x46')],{'$or':_['map'](_0x5979fe[_0x9a1b('0x42')],function(_0x14531a){var _0x264fb4={};_0x264fb4[_0x14531a]={'$like':'%'+_0xd2328d[_0x9a1b('0x3e')][_0x9a1b('0x48')]+'%'};return _0x264fb4;})});}_0x5979fe=_['merge']({},_0x5979fe,_0xd2328d[_0x9a1b('0x4b')]);return _0x2eac96[_0x9a1b('0x72')](_0x5979fe);}})[_0x9a1b('0x2b')](function(_0x256e09){if(_0x256e09){_0x3aa3a4=_0x256e09[_0x9a1b('0x51')];if(!_0xd2328d[_0x9a1b('0x3e')][_0x9a1b('0x67')](_0x9a1b('0x68'))){_0x5979fe[_0x9a1b('0x24')]=qs[_0x9a1b('0x24')](_0xd2328d[_0x9a1b('0x3e')][_0x9a1b('0x24')]);_0x5979fe[_0x9a1b('0x23')]=qs[_0x9a1b('0x23')](_0xd2328d[_0x9a1b('0x3e')][_0x9a1b('0x23')]);}return _0x2eac96['getTeams'](_0x5979fe);}})['then'](function(_0x4b4882){if(_0x4b4882){return _0x4b4882?{'count':_0x3aa3a4,'rows':_0x4b4882}:null;}})[_0x9a1b('0x2b')](respondWithResult(_0x21d3af,null))[_0x9a1b('0x4f')](handleError(_0x21d3af,null));};exports[_0x9a1b('0x73')]=function(_0x44a715,_0x3e4899,_0x3c2fa1){var _0x4d8197=_0x44a715[_0x9a1b('0x53')]['teams'];var _0x14ec43=_[_0x9a1b('0x30')](_0x4d8197,'id');return db['Team'][_0x9a1b('0x4d')]({'where':{'id':_0x14ec43},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9a1b('0x74'),'attributes':['id',_0x9a1b('0x37'),'online',_0x9a1b('0x75'),_0x9a1b('0x76')],'raw':!![]}]})[_0x9a1b('0x2b')](function(_0x3481b8){if(_0x3481b8){var _0x1d4b6a=_[_0x9a1b('0x77')](_0x3481b8,function(_0x2999eb){var _0x5183dd=_0x2999eb['get']({'plain':!![]});_0x5183dd[_0x9a1b('0x74')]['forEach'](function(_0x11d29a){_0x11d29a['penalty']=_[_0x9a1b('0x34')](_0x4d8197,{'id':_0x5183dd['id']})['penalty'];});return _0x5183dd[_0x9a1b('0x74')];});return db[_0x9a1b('0x3a')][_0x9a1b('0x34')]({'where':{'id':_0x44a715[_0x9a1b('0x60')]['id']}})['then'](function(_0x4efc21){return db[_0x9a1b('0x78')][_0x9a1b('0x79')](function(_0x2575da){return _0x4efc21[_0x9a1b('0x73')](_0x14ec43,{'transaction':_0x2575da})[_0x9a1b('0x2b')](function(){return BPromise[_0x9a1b('0x7a')](_0x1d4b6a,function(_0x2e4a2f){return db[_0x9a1b('0x7b')][_0x9a1b('0x7c')]({'where':{'UserId':_0x2e4a2f['id'],'VoiceQueueId':_0x44a715[_0x9a1b('0x60')]['id']},'defaults':{'penalty':_0x2e4a2f[_0x9a1b('0x7d')]},'transaction':_0x2575da});});})[_0x9a1b('0x2b')](function(){return BPromise[_0x9a1b('0x7a')](_[_0x9a1b('0x48')](_0x1d4b6a,{'online':!![]}),function(_0x2eac89){return db[_0x9a1b('0x7e')][_0x9a1b('0x7f')]({'membername':_0x2eac89[_0x9a1b('0x37')],'UserId':_0x2eac89['id'],'queue_name':_0x4efc21['name'],'VoiceQueueId':_0x4efc21['id'],'interface':_[_0x9a1b('0x80')](_0x2eac89['interface'])?util[_0x9a1b('0x81')](_0x9a1b('0x82'),_0x2eac89[_0x9a1b('0x37')]):_0x2eac89[_0x9a1b('0x76')],'paused':_0x2eac89[_0x9a1b('0x75')]||![],'penalty':_0x2eac89[_0x9a1b('0x7d')]},{'transaction':_0x2575da});});})[_0x9a1b('0x2b')](function(){_0x1d4b6a[_0x9a1b('0x83')](function(_0x275f2b){socket['emit'](_0x9a1b('0x84'),{'UserId':_0x275f2b['id'],'VoiceQueueId':_0x4efc21['id']});});});});});}})[_0x9a1b('0x2b')](respondWithStatusCode(_0x3e4899,null))['catch'](handleError(_0x3e4899,null));};exports[_0x9a1b('0x85')]=function(_0x2d6ce8,_0x2dd66b,_0x2f6e32){return db[_0x9a1b('0x71')][_0x9a1b('0x4d')]({'where':{'id':_0x2d6ce8[_0x9a1b('0x3e')][_0x9a1b('0x86')]},'attributes':['id'],'include':[{'model':db[_0x9a1b('0x87')],'as':_0x9a1b('0x74'),'attributes':['id'],'raw':!![]}]})[_0x9a1b('0x2b')](handleEntityNotFound(_0x2dd66b,null))[_0x9a1b('0x2b')](function(_0x35aa75){var _0x32152f=_[_0x9a1b('0x30')](_0x35aa75,'id');var _0x369aaf=[];var _0x3b3f4c=[];var _0x5e8a1e=squel['select']();_0x5e8a1e[_0x9a1b('0x88')](_0x9a1b('0x89'))['from']('team_has_voice_queues','tq')[_0x9a1b('0x8a')]('user_has_teams','ut',_0x9a1b('0x8b'))[_0x9a1b('0x46')](_0x9a1b('0x8c'),_0x2d6ce8[_0x9a1b('0x60')]['id']);for(var _0x133d2c=0x0;_0x133d2c<_0x35aa75['length'];_0x133d2c+=0x1){let _0xf10acc=_0x35aa75[_0x133d2c];for(var _0xd098b1=0x0;_0xd098b1<_0xf10acc[_0x9a1b('0x74')][_0x9a1b('0x51')];_0xd098b1+=0x1){let _0x44871c=_0xf10acc[_0x9a1b('0x74')][_0xd098b1];var _0x2aa95d=_0x5e8a1e['clone']();_0x2aa95d[_0x9a1b('0x46')]('ut.UserId\x20=\x20?',_0x44871c['id']);_0x3b3f4c[_0x9a1b('0x8d')](db[_0x9a1b('0x78')]['query'](_0x2aa95d[_0x9a1b('0x8e')](),{'type':db[_0x9a1b('0x78')]['QueryTypes'][_0x9a1b('0x8f')]})[_0x9a1b('0x2b')](function(_0x2bd71a){if(_0x2bd71a['length']===0x1){return _0x44871c['id'];}else{var _0x21b78e=_[_0x9a1b('0x90')](_[_0x9a1b('0x30')](_0x2bd71a,'TeamId'),function(_0x21cc24){return _[_0x9a1b('0x32')](_0x32152f,_0x21cc24);});if(_0x21b78e){return _0x44871c['id'];}}}));}}return BPromise[_0x9a1b('0x91')](_0x3b3f4c)['then'](function(_0x51a095){_0x369aaf=_(_0x369aaf)[_0x9a1b('0x92')](_0x51a095)[_0x9a1b('0x93')]()[_0x9a1b('0x31')]();return db[_0x9a1b('0x3a')][_0x9a1b('0x34')]({'where':{'id':_0x2d6ce8[_0x9a1b('0x60')]['id']}})['then'](function(_0x51b152){return db['sequelize'][_0x9a1b('0x79')](function(_0x2b825c){return _0x51b152[_0x9a1b('0x85')](_0x2d6ce8[_0x9a1b('0x3e')]['ids'],{'transaction':_0x2b825c})[_0x9a1b('0x2b')](function(){if(!_[_0x9a1b('0x94')](_0x369aaf)){return _0x51b152[_0x9a1b('0x95')](_0x369aaf,{'transaction':_0x2b825c})[_0x9a1b('0x2b')](function(){return db['UserVoiceQueueRt'][_0x9a1b('0x2c')]({'where':{'VoiceQueueId':_0x2d6ce8['params']['id'],'UserId':_0x369aaf},'transaction':_0x2b825c});});}})[_0x9a1b('0x2b')](function(){_0x369aaf['forEach'](function(_0x289101){socket['emit'](_0x9a1b('0x96'),{'UserId':_0x289101,'VoiceQueueId':_0x51b152['id']});});});});});});})[_0x9a1b('0x2b')](respondWithStatusCode(_0x2dd66b,null))['catch'](handleError(_0x2dd66b,null));};exports['addAgents']=function(_0x2a8228,_0x2e085f,_0x4948a9){var _0x52d44f,_0x2f5e9c;return db[_0x9a1b('0x3a')]['find']({'where':{'id':_0x2a8228[_0x9a1b('0x60')]['id']}})[_0x9a1b('0x2b')](handleEntityNotFound(_0x2e085f,null))[_0x9a1b('0x2b')](function(_0x56f859){if(_0x56f859){_0x2f5e9c=_0x56f859;return _0x56f859[_0x9a1b('0x97')](_0x2a8228[_0x9a1b('0x53')]['ids'],_[_0x9a1b('0x62')](_0x2a8228[_0x9a1b('0x53')],[_0x9a1b('0x86'),'id'])||{})[_0x9a1b('0x98')](function(_0x419d2e){for(var _0x417af5=0x0;_0x417af5<_0x2a8228[_0x9a1b('0x53')]['ids']['length'];_0x417af5+=0x1){socket[_0x9a1b('0x99')](_0x9a1b('0x84'),{'UserId':_0x2a8228[_0x9a1b('0x53')][_0x9a1b('0x86')][_0x417af5],'VoiceQueueId':_0x2a8228[_0x9a1b('0x60')]['id']});}return _0x419d2e;});}})[_0x9a1b('0x2b')](function(_0x2d5214){_0x52d44f=_0x2d5214||[];if(_0x2f5e9c){return db[_0x9a1b('0x87')][_0x9a1b('0x4d')]({'where':{'id':_0x2a8228[_0x9a1b('0x53')][_0x9a1b('0x86')]},'attributes':['id','name','online',_0x9a1b('0x75'),_0x9a1b('0x76')],'raw':!![]});}})['then'](function(_0x4c82bd){if(!_['isEmpty'](_0x4c82bd)){var _0x3598b7=[];for(var _0x5356d0=0x0;_0x5356d0<_0x4c82bd['length'];_0x5356d0++){if(_0x4c82bd[_0x5356d0][_0x9a1b('0x9a')]){_0x3598b7[_0x9a1b('0x8d')](db['UserVoiceQueueRt'][_0x9a1b('0x7f')]({'membername':_0x4c82bd[_0x5356d0][_0x9a1b('0x37')],'UserId':_0x4c82bd[_0x5356d0]['id'],'queue_name':_0x2f5e9c[_0x9a1b('0x37')],'VoiceQueueId':_0x2f5e9c['id'],'interface':_['isNil'](_0x4c82bd[_0x5356d0][_0x9a1b('0x76')])?util[_0x9a1b('0x81')]('SIP/%s',_0x4c82bd[_0x5356d0][_0x9a1b('0x37')]):_0x4c82bd[_0x5356d0][_0x9a1b('0x76')],'paused':_0x4c82bd[_0x5356d0][_0x9a1b('0x75')]||![],'penalty':_0x2a8228[_0x9a1b('0x53')]['penalty']||0x0}));}}return BPromise[_0x9a1b('0x91')](_0x3598b7);}})[_0x9a1b('0x2b')](function(){return _0x52d44f;})['then'](respondWithResult(_0x2e085f,null))[_0x9a1b('0x4f')](handleError(_0x2e085f,null));};exports[_0x9a1b('0x95')]=function(_0x1ed9de,_0x125e33,_0x1cb4f5){return db[_0x9a1b('0x3a')]['find']({'where':{'id':_0x1ed9de[_0x9a1b('0x60')]['id']}})[_0x9a1b('0x2b')](handleEntityNotFound(_0x125e33,null))[_0x9a1b('0x2b')](function(_0x1203fd){if(_0x1203fd){return _0x1203fd[_0x9a1b('0x95')](_0x1ed9de[_0x9a1b('0x3e')][_0x9a1b('0x86')])[_0x9a1b('0x2b')](function(){if(_[_0x9a1b('0x9b')](_0x1ed9de['query'][_0x9a1b('0x86')])){for(var _0x59d0d6=0x0;_0x59d0d6<_0x1ed9de[_0x9a1b('0x3e')]['ids'][_0x9a1b('0x51')];_0x59d0d6+=0x1){socket[_0x9a1b('0x99')](_0x9a1b('0x96'),{'UserId':Number(_0x1ed9de[_0x9a1b('0x3e')][_0x9a1b('0x86')][_0x59d0d6]),'VoiceQueueId':Number(_0x1ed9de['params']['id'])});}}else{socket['emit'](_0x9a1b('0x96'),{'UserId':Number(_0x1ed9de[_0x9a1b('0x3e')][_0x9a1b('0x86')]),'VoiceQueueId':Number(_0x1ed9de[_0x9a1b('0x60')]['id'])});}});}})['then'](function(_0x12a64e){return db[_0x9a1b('0x7e')]['destroy']({'where':{'VoiceQueueId':_0x1ed9de[_0x9a1b('0x60')]['id'],'UserId':_0x1ed9de[_0x9a1b('0x3e')][_0x9a1b('0x86')]}})['then'](function(){return _0x12a64e;});})['then'](respondWithStatusCode(_0x125e33,null))[_0x9a1b('0x4f')](handleError(_0x125e33,null));};exports[_0x9a1b('0x9c')]=function(_0x52c65c,_0x4b0f13,_0x449bbc){var _0x133228={};var _0x5426c2={};var _0x4177f3;var _0x44f73d;return db[_0x9a1b('0x3a')]['findOne']({'where':{'id':_0x52c65c[_0x9a1b('0x60')]['id']}})[_0x9a1b('0x2b')](handleEntityNotFound(_0x4b0f13,null))[_0x9a1b('0x2b')](function(_0x4f574a){if(_0x4f574a){_0x4177f3=_0x4f574a;_0x5426c2[_0x9a1b('0x3d')]=_[_0x9a1b('0x3f')](db[_0x9a1b('0x87')][_0x9a1b('0x3b')]);_0x5426c2['query']=_[_0x9a1b('0x3f')](_0x52c65c[_0x9a1b('0x3e')]);_0x5426c2[_0x9a1b('0x40')]=_['intersection'](_0x5426c2[_0x9a1b('0x3d')],_0x5426c2['query']);_0x133228[_0x9a1b('0x42')]=_[_0x9a1b('0x41')](_0x5426c2[_0x9a1b('0x3d')],qs[_0x9a1b('0x43')](_0x52c65c['query'][_0x9a1b('0x43')]));_0x133228[_0x9a1b('0x42')]=_0x133228[_0x9a1b('0x42')][_0x9a1b('0x51')]?_0x133228[_0x9a1b('0x42')]:_0x5426c2['model'];_0x133228[_0x9a1b('0x44')]=qs[_0x9a1b('0x45')](_0x52c65c[_0x9a1b('0x3e')][_0x9a1b('0x45')]);_0x133228[_0x9a1b('0x46')]=qs['filters'](_[_0x9a1b('0x47')](_0x52c65c[_0x9a1b('0x3e')],_0x5426c2['filters']));if(_0x52c65c[_0x9a1b('0x3e')][_0x9a1b('0x48')]){_0x133228['where']=_[_0x9a1b('0x49')](_0x133228['where'],{'$or':_[_0x9a1b('0x30')](_0x133228[_0x9a1b('0x42')],function(_0x3bffee){var _0x1e8554={};_0x1e8554[_0x3bffee]={'$like':'%'+_0x52c65c[_0x9a1b('0x3e')][_0x9a1b('0x48')]+'%'};return _0x1e8554;})});}_0x133228=_[_0x9a1b('0x49')]({},_0x133228,_0x52c65c[_0x9a1b('0x4b')]);return _0x4177f3[_0x9a1b('0x9c')](_0x133228);}})[_0x9a1b('0x2b')](function(_0x3de127){if(_0x3de127){_0x44f73d=_0x3de127['length'];if(!_0x52c65c[_0x9a1b('0x3e')][_0x9a1b('0x67')](_0x9a1b('0x68'))){_0x133228[_0x9a1b('0x24')]=qs[_0x9a1b('0x24')](_0x52c65c[_0x9a1b('0x3e')]['limit']);_0x133228[_0x9a1b('0x23')]=qs[_0x9a1b('0x23')](_0x52c65c[_0x9a1b('0x3e')][_0x9a1b('0x23')]);}return _0x4177f3['getAgents'](_0x133228);}})['then'](function(_0x4d88dd){if(_0x4d88dd){return _0x4d88dd?{'count':_0x44f73d,'rows':_0x4d88dd}:null;}})[_0x9a1b('0x2b')](respondWithResult(_0x4b0f13,null))[_0x9a1b('0x4f')](handleError(_0x4b0f13,null));};exports['getMembers']=function(_0x59cb30,_0x20b24c,_0x136807){var _0x2a2af5={};var _0xae40e={};var _0x164638;var _0x3897d0;return db[_0x9a1b('0x3a')]['findOne']({'where':{'id':_0x59cb30[_0x9a1b('0x60')]['id']}})['then'](handleEntityNotFound(_0x20b24c,null))[_0x9a1b('0x2b')](function(_0x599504){if(_0x599504){_0x164638=_0x599504;_0xae40e['model']=_[_0x9a1b('0x3f')](db[_0x9a1b('0x7e')][_0x9a1b('0x3b')]);_0xae40e[_0x9a1b('0x3e')]=_['keys'](_0x59cb30[_0x9a1b('0x3e')]);_0xae40e[_0x9a1b('0x40')]=_[_0x9a1b('0x41')](_0xae40e[_0x9a1b('0x3d')],_0xae40e[_0x9a1b('0x3e')]);_0x2a2af5[_0x9a1b('0x42')]=_[_0x9a1b('0x41')](_0xae40e[_0x9a1b('0x3d')],qs[_0x9a1b('0x43')](_0x59cb30['query'][_0x9a1b('0x43')]));_0x2a2af5['attributes']=_0x2a2af5['attributes'][_0x9a1b('0x51')]?_0x2a2af5[_0x9a1b('0x42')]:_0xae40e[_0x9a1b('0x3d')];_0x2a2af5[_0x9a1b('0x44')]=qs[_0x9a1b('0x45')](_0x59cb30[_0x9a1b('0x3e')]['sort']);_0x2a2af5[_0x9a1b('0x46')]=qs[_0x9a1b('0x40')](_[_0x9a1b('0x47')](_0x59cb30[_0x9a1b('0x3e')],_0xae40e[_0x9a1b('0x40')]));if(_0x59cb30[_0x9a1b('0x3e')][_0x9a1b('0x48')]){_0x2a2af5[_0x9a1b('0x46')]=_[_0x9a1b('0x49')](_0x2a2af5['where'],{'$or':_[_0x9a1b('0x30')](_0x2a2af5[_0x9a1b('0x42')],function(_0x5a222a){var _0x5c9607={};_0x5c9607[_0x5a222a]={'$like':'%'+_0x59cb30['query'][_0x9a1b('0x48')]+'%'};return _0x5c9607;})});}_0x2a2af5=_[_0x9a1b('0x49')]({},_0x2a2af5,_0x59cb30[_0x9a1b('0x4b')]);return _0x164638[_0x9a1b('0x9d')](_0x2a2af5);}})[_0x9a1b('0x2b')](function(_0x3da46a){if(_0x3da46a){_0x3897d0=_0x3da46a['length'];if(!_0x59cb30[_0x9a1b('0x3e')][_0x9a1b('0x67')](_0x9a1b('0x68'))){_0x2a2af5[_0x9a1b('0x24')]=qs[_0x9a1b('0x24')](_0x59cb30[_0x9a1b('0x3e')][_0x9a1b('0x24')]);_0x2a2af5[_0x9a1b('0x23')]=qs[_0x9a1b('0x23')](_0x59cb30[_0x9a1b('0x3e')][_0x9a1b('0x23')]);}return _0x164638['getMembers'](_0x2a2af5);}})[_0x9a1b('0x2b')](function(_0x13511a){return _0x13511a?{'count':_0x3897d0,'rows':_0x13511a}:null;})[_0x9a1b('0x2b')](respondWithResult(_0x20b24c,null))['catch'](handleError(_0x20b24c,null));};exports[_0x9a1b('0x9e')]=function(_0x58ffc0,_0x4b13d2,_0x58f51c){var _0xb06bc9={};var _0x5a7c6f={};var _0x49d72d;var _0x1a0ceb;return db[_0x9a1b('0x3a')]['findOne']({'where':{'id':_0x58ffc0[_0x9a1b('0x60')]['id']}})[_0x9a1b('0x2b')](handleEntityNotFound(_0x4b13d2,null))[_0x9a1b('0x2b')](function(_0x36caab){if(_0x36caab){_0x49d72d=_0x36caab;_0x5a7c6f[_0x9a1b('0x3d')]=_[_0x9a1b('0x3f')](db[_0x9a1b('0x9f')]['rawAttributes']);_0x5a7c6f[_0x9a1b('0x3e')]=_[_0x9a1b('0x3f')](_0x58ffc0['query']);_0x5a7c6f['filters']=_[_0x9a1b('0x41')](_0x5a7c6f['model'],_0x5a7c6f[_0x9a1b('0x3e')]);_0xb06bc9[_0x9a1b('0x42')]=_[_0x9a1b('0x41')](_0x5a7c6f[_0x9a1b('0x3d')],qs['fields'](_0x58ffc0[_0x9a1b('0x3e')][_0x9a1b('0x43')]));_0xb06bc9[_0x9a1b('0x42')]=_0xb06bc9[_0x9a1b('0x42')]['length']?_0xb06bc9['attributes']:_0x5a7c6f['model'];_0xb06bc9['order']=qs[_0x9a1b('0x45')](_0x58ffc0[_0x9a1b('0x3e')][_0x9a1b('0x45')]);_0xb06bc9[_0x9a1b('0x46')]=qs[_0x9a1b('0x40')](_[_0x9a1b('0x47')](_0x58ffc0[_0x9a1b('0x3e')],_0x5a7c6f[_0x9a1b('0x40')]));if(_0x58ffc0[_0x9a1b('0x3e')][_0x9a1b('0x48')]){_0xb06bc9[_0x9a1b('0x46')]=_['merge'](_0xb06bc9[_0x9a1b('0x46')],{'$or':_[_0x9a1b('0x30')](_0xb06bc9[_0x9a1b('0x42')],function(_0x5c11c6){var _0x191396={};_0x191396[_0x5c11c6]={'$like':'%'+_0x58ffc0[_0x9a1b('0x3e')][_0x9a1b('0x48')]+'%'};return _0x191396;})});}_0xb06bc9=_[_0x9a1b('0x49')]({},_0xb06bc9,_0x58ffc0['options']);return _0x49d72d[_0x9a1b('0x9e')](_0xb06bc9);}})['then'](function(_0x48bc73){if(_0x48bc73){_0x1a0ceb=_0x48bc73['length'];if(!_0x58ffc0[_0x9a1b('0x3e')][_0x9a1b('0x67')](_0x9a1b('0x68'))){_0xb06bc9[_0x9a1b('0x24')]=qs['limit'](_0x58ffc0[_0x9a1b('0x3e')]['limit']);_0xb06bc9['offset']=qs['offset'](_0x58ffc0[_0x9a1b('0x3e')][_0x9a1b('0x23')]);}return _0x49d72d[_0x9a1b('0x9e')](_0xb06bc9);}})[_0x9a1b('0x2b')](function(_0x2c49f1){if(_0x2c49f1){return _0x2c49f1?{'count':_0x1a0ceb,'rows':_0x2c49f1}:null;}})[_0x9a1b('0x2b')](respondWithResult(_0x4b13d2,null))[_0x9a1b('0x4f')](handleError(_0x4b13d2,null));};exports['addLists']=function(_0x52ba24,_0x39fb72,_0x14c2b9){var _0x53da5f,_0x10b371;return db[_0x9a1b('0x3a')][_0x9a1b('0x34')]({'where':{'id':_0x52ba24[_0x9a1b('0x60')]['id']}})[_0x9a1b('0x2b')](handleEntityNotFound(_0x39fb72,null))[_0x9a1b('0x2b')](function(_0x36404d){if(_0x36404d){_0x10b371=_0x36404d;return _0x36404d[_0x9a1b('0xa0')](_0x52ba24[_0x9a1b('0x53')][_0x9a1b('0x86')],_[_0x9a1b('0x62')](_0x52ba24[_0x9a1b('0x53')],[_0x9a1b('0x86'),'id'])||{});}return null;})[_0x9a1b('0x98')](function(_0x329ce0){var _0x515a9b;_0x53da5f=_0x329ce0||[];var _0xaee330=[];if(_0x329ce0){for(var _0xdfa9e=0x0;_0xdfa9e<_0x329ce0[_0x9a1b('0x51')];_0xdfa9e+=0x1){var _0x1db668=_0x329ce0[_0xdfa9e]['get']({'plain':!![]});_0x10b371['dialCheckDuplicateType']=_0x52ba24[_0x9a1b('0x53')]['dialCheckDuplicateType']?_0x52ba24[_0x9a1b('0x53')][_0x9a1b('0xa1')]:_0x10b371[_0x9a1b('0xa1')];switch(_0x10b371[_0x9a1b('0xa1')]){case _0x9a1b('0xa2'):_0x515a9b=squel[_0x9a1b('0xa3')]()[_0x9a1b('0xa4')](_0x9a1b('0xa5'))[_0x9a1b('0xa6')]([_0x9a1b('0xa7'),_0x9a1b('0xa8'),'ContactId','ListId',_0x9a1b('0x6c'),'createdAt',_0x9a1b('0x63')],squel[_0x9a1b('0xa9')]()[_0x9a1b('0x88')](_0x9a1b('0xa7'),'phone')[_0x9a1b('0x88')]('NOW()',_0x9a1b('0xa8'))[_0x9a1b('0x88')]('id',_0x9a1b('0xaa'))[_0x9a1b('0x88')](_0x1db668[_0x9a1b('0xab')][_0x9a1b('0x8e')](),_0x9a1b('0xac'))[_0x9a1b('0x88')](_0x52ba24[_0x9a1b('0x60')]['id'][_0x9a1b('0x8e')](),_0x9a1b('0x6c'))[_0x9a1b('0x88')](_0x9a1b('0xad'),_0x9a1b('0xae'))[_0x9a1b('0x88')](_0x9a1b('0xad'),_0x9a1b('0x63'))['from'](_0x9a1b('0xaf'))[_0x9a1b('0x46')](_0x9a1b('0xb0'))['where'](_0x9a1b('0xb1'),_0x1db668[_0x9a1b('0xab')]['toString']())[_0x9a1b('0x46')](_0x9a1b('0xb2'))[_0x9a1b('0x46')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x9a1b('0x88')](_0x9a1b('0xb3'))[_0x9a1b('0xb4')](_0x9a1b('0xb5'))[_0x9a1b('0x46')](_0x9a1b('0x8c'),_0x52ba24[_0x9a1b('0x60')]['id'][_0x9a1b('0x8e')]()))['where'](_0x9a1b('0xb6'),squel[_0x9a1b('0xa9')]()[_0x9a1b('0x88')](_0x9a1b('0xb7'))[_0x9a1b('0xb4')](_0x9a1b('0xa5'))[_0x9a1b('0x46')]('VoiceQueueId\x20=\x20?',_0x52ba24['params']['id']['toString']())))[_0x9a1b('0x8e')]();break;case _0x9a1b('0xb8'):_0x515a9b=squel[_0x9a1b('0xa3')]()[_0x9a1b('0xa4')](_0x9a1b('0xa5'))['fromQuery']([_0x9a1b('0xa7'),_0x9a1b('0xa8'),_0x9a1b('0xaa'),'ListId',_0x9a1b('0x6c'),_0x9a1b('0xae'),'updatedAt'],squel[_0x9a1b('0xa9')]()[_0x9a1b('0x88')](_0x9a1b('0xa7'),_0x9a1b('0xa7'))[_0x9a1b('0x88')](_0x9a1b('0xad'),_0x9a1b('0xa8'))['field']('id',_0x9a1b('0xaa'))[_0x9a1b('0x88')](_0x1db668['CmListId'][_0x9a1b('0x8e')](),'ListId')['field'](_0x52ba24['params']['id']['toString'](),'VoiceQueueId')['field'](_0x9a1b('0xad'),_0x9a1b('0xae'))['field'](_0x9a1b('0xad'),_0x9a1b('0x63'))[_0x9a1b('0xb4')](_0x9a1b('0xaf'))[_0x9a1b('0x46')](_0x9a1b('0xb0'))[_0x9a1b('0x46')]('ListId\x20=\x20?',_0x1db668[_0x9a1b('0xab')][_0x9a1b('0x8e')]())[_0x9a1b('0x46')]('phone\x20IS\x20NOT\x20NULL')[_0x9a1b('0x46')](_0x9a1b('0xb6'),squel[_0x9a1b('0xa9')]()[_0x9a1b('0x88')](_0x9a1b('0xb7'))[_0x9a1b('0xb4')](_0x9a1b('0xa5'))[_0x9a1b('0x46')](_0x9a1b('0x8c'),_0x52ba24[_0x9a1b('0x60')]['id']['toString']())))[_0x9a1b('0x8e')]();break;default:_0x515a9b=squel[_0x9a1b('0xa3')]()[_0x9a1b('0xa4')]('cm_hopper')['fromQuery'](['phone',_0x9a1b('0xa8'),'ContactId',_0x9a1b('0xac'),_0x9a1b('0x6c'),_0x9a1b('0xae'),_0x9a1b('0x63')],squel[_0x9a1b('0xa9')]()[_0x9a1b('0x88')](_0x9a1b('0xa7'),'phone')['field']('NOW()',_0x9a1b('0xa8'))['field']('id',_0x9a1b('0xaa'))[_0x9a1b('0x88')](_0x1db668[_0x9a1b('0xab')][_0x9a1b('0x8e')](),'ListId')[_0x9a1b('0x88')](_0x52ba24[_0x9a1b('0x60')]['id'][_0x9a1b('0x8e')](),'VoiceQueueId')[_0x9a1b('0x88')](_0x9a1b('0xad'),_0x9a1b('0xae'))[_0x9a1b('0x88')]('NOW()',_0x9a1b('0x63'))[_0x9a1b('0xb4')](_0x9a1b('0xaf'))[_0x9a1b('0x46')]('deletedAt\x20IS\x20NULL')[_0x9a1b('0x46')](_0x9a1b('0xb1'),_0x1db668['CmListId'][_0x9a1b('0x8e')]())[_0x9a1b('0x46')](_0x9a1b('0xb2')))[_0x9a1b('0x8e')]();}_0xaee330['push'](db[_0x9a1b('0x78')][_0x9a1b('0x3e')](_0x515a9b));}return BPromise[_0x9a1b('0x91')](_0xaee330);}})[_0x9a1b('0x2b')](function(){return _0x53da5f;})[_0x9a1b('0x2b')](respondWithResult(_0x39fb72,null))[_0x9a1b('0x4f')](handleError(_0x39fb72,null));};exports[_0x9a1b('0xb9')]=function(_0x568eb5,_0x1f84a9,_0x31a3a8){return db[_0x9a1b('0x3a')][_0x9a1b('0x34')]({'where':{'id':_0x568eb5[_0x9a1b('0x60')]['id']}})[_0x9a1b('0x2b')](handleEntityNotFound(_0x1f84a9,null))[_0x9a1b('0x2b')](function(_0x38eb2b){if(_0x38eb2b){return _0x38eb2b[_0x9a1b('0xb9')](_0x568eb5[_0x9a1b('0x3e')][_0x9a1b('0x86')]);}})['then'](function(_0x5de3c8){if(_0x5de3c8){return db[_0x9a1b('0x69')]['destroy']({'where':{'ListId':_0x568eb5[_0x9a1b('0x3e')][_0x9a1b('0x86')],'VoiceQueueId':_0x568eb5['params']['id']}})[_0x9a1b('0x2b')](function(){return _0x5de3c8;});}})[_0x9a1b('0x2b')](respondWithStatusCode(_0x1f84a9,null))['catch'](handleError(_0x1f84a9,null));};exports['getBlackLists']=function(_0x2ea3b7,_0x26e976,_0x49a734){var _0x67d33a={};var _0x354674={};var _0x45f76e;var _0x430bea;return db[_0x9a1b('0x3a')][_0x9a1b('0x66')]({'where':{'id':_0x2ea3b7[_0x9a1b('0x60')]['id']}})['then'](handleEntityNotFound(_0x26e976,null))['then'](function(_0x33e703){if(_0x33e703){_0x45f76e=_0x33e703;_0x354674[_0x9a1b('0x3d')]=_['keys'](db[_0x9a1b('0x9f')][_0x9a1b('0x3b')]);_0x354674[_0x9a1b('0x3e')]=_[_0x9a1b('0x3f')](_0x2ea3b7[_0x9a1b('0x3e')]);_0x354674[_0x9a1b('0x40')]=_[_0x9a1b('0x41')](_0x354674[_0x9a1b('0x3d')],_0x354674[_0x9a1b('0x3e')]);_0x67d33a['attributes']=_[_0x9a1b('0x41')](_0x354674['model'],qs[_0x9a1b('0x43')](_0x2ea3b7['query']['fields']));_0x67d33a['attributes']=_0x67d33a[_0x9a1b('0x42')][_0x9a1b('0x51')]?_0x67d33a[_0x9a1b('0x42')]:_0x354674[_0x9a1b('0x3d')];_0x67d33a[_0x9a1b('0x44')]=qs[_0x9a1b('0x45')](_0x2ea3b7[_0x9a1b('0x3e')][_0x9a1b('0x45')]);_0x67d33a[_0x9a1b('0x46')]=qs['filters'](_[_0x9a1b('0x47')](_0x2ea3b7['query'],_0x354674[_0x9a1b('0x40')]));if(_0x2ea3b7[_0x9a1b('0x3e')][_0x9a1b('0x48')]){_0x67d33a[_0x9a1b('0x46')]=_[_0x9a1b('0x49')](_0x67d33a[_0x9a1b('0x46')],{'$or':_[_0x9a1b('0x30')](_0x67d33a[_0x9a1b('0x42')],function(_0x22c72d){var _0x4f2750={};_0x4f2750[_0x22c72d]={'$like':'%'+_0x2ea3b7[_0x9a1b('0x3e')][_0x9a1b('0x48')]+'%'};return _0x4f2750;})});}_0x67d33a=_[_0x9a1b('0x49')]({},_0x67d33a,_0x2ea3b7[_0x9a1b('0x4b')]);return _0x45f76e['getBlackLists'](_0x67d33a);}})[_0x9a1b('0x2b')](function(_0x585830){if(_0x585830){_0x430bea=_0x585830[_0x9a1b('0x51')];if(!_0x2ea3b7[_0x9a1b('0x3e')]['hasOwnProperty'](_0x9a1b('0x68'))){_0x67d33a[_0x9a1b('0x24')]=qs[_0x9a1b('0x24')](_0x2ea3b7[_0x9a1b('0x3e')][_0x9a1b('0x24')]);_0x67d33a[_0x9a1b('0x23')]=qs['offset'](_0x2ea3b7[_0x9a1b('0x3e')][_0x9a1b('0x23')]);}return _0x45f76e[_0x9a1b('0xba')](_0x67d33a);}})[_0x9a1b('0x2b')](function(_0x2c310d){if(_0x2c310d){return _0x2c310d?{'count':_0x430bea,'rows':_0x2c310d}:null;}})[_0x9a1b('0x2b')](respondWithResult(_0x26e976,null))[_0x9a1b('0x4f')](handleError(_0x26e976,null));};exports['addBlackLists']=function(_0x5e8fe5,_0x5b7bcf,_0x374d24){var _0x252b14,_0x5b1ddd;return db[_0x9a1b('0x3a')][_0x9a1b('0x34')]({'where':{'id':_0x5e8fe5[_0x9a1b('0x60')]['id']}})[_0x9a1b('0x2b')](handleEntityNotFound(_0x5b7bcf,null))[_0x9a1b('0x2b')](function(_0x2d7a9b){if(_0x2d7a9b){_0x5b1ddd=_0x2d7a9b;return _0x2d7a9b[_0x9a1b('0xbb')](_0x5e8fe5[_0x9a1b('0x53')][_0x9a1b('0x86')],_[_0x9a1b('0x62')](_0x5e8fe5[_0x9a1b('0x53')],[_0x9a1b('0x86'),'id'])||{});}return null;})[_0x9a1b('0x98')](function(_0x42fa66){var _0x52366c;_0x252b14=_0x42fa66||[];var _0x51bd5b=[];if(_0x42fa66){for(var _0x59598f=0x0;_0x59598f<_0x42fa66[_0x9a1b('0x51')];_0x59598f+=0x1){var _0xbf9178=_0x42fa66[_0x59598f]['get']({'plain':!![]});_0x52366c=squel[_0x9a1b('0xa3')]()['into'](_0x9a1b('0xbc'))[_0x9a1b('0xa6')](['phone','ContactId',_0x9a1b('0xac'),'VoiceQueueId',_0x9a1b('0xae'),'updatedAt'],squel[_0x9a1b('0xa9')]()[_0x9a1b('0x88')]('phone',_0x9a1b('0xa7'))[_0x9a1b('0x88')]('id',_0x9a1b('0xaa'))[_0x9a1b('0x88')](_0xbf9178[_0x9a1b('0xab')][_0x9a1b('0x8e')](),_0x9a1b('0xac'))[_0x9a1b('0x88')](_0x5e8fe5['params']['id']['toString'](),_0x9a1b('0x6c'))[_0x9a1b('0x88')](_0x9a1b('0xad'),_0x9a1b('0xae'))[_0x9a1b('0x88')](_0x9a1b('0xad'),_0x9a1b('0x63'))[_0x9a1b('0xb4')](_0x9a1b('0xaf'))[_0x9a1b('0x46')]('deletedAt\x20IS\x20NULL')['where'](_0x9a1b('0xb1'),_0xbf9178[_0x9a1b('0xab')][_0x9a1b('0x8e')]())[_0x9a1b('0x46')](_0x9a1b('0xb2')))[_0x9a1b('0x8e')]();_0x51bd5b['push'](db[_0x9a1b('0x78')]['query'](_0x52366c));}return BPromise[_0x9a1b('0x91')](_0x51bd5b);}})[_0x9a1b('0x2b')](function(){return _0x252b14;})[_0x9a1b('0x2b')](respondWithResult(_0x5b7bcf,null))[_0x9a1b('0x4f')](handleError(_0x5b7bcf,null));};exports[_0x9a1b('0xbd')]=function(_0x55fa92,_0x386e6f,_0x1f9eae){return db[_0x9a1b('0x3a')][_0x9a1b('0x34')]({'where':{'id':_0x55fa92['params']['id']}})[_0x9a1b('0x2b')](handleEntityNotFound(_0x386e6f,null))[_0x9a1b('0x2b')](function(_0x4dc229){if(_0x4dc229){return _0x4dc229[_0x9a1b('0xbd')](_0x55fa92[_0x9a1b('0x3e')][_0x9a1b('0x86')]);}})[_0x9a1b('0x2b')](function(_0x5f4786){if(_0x5f4786){return db[_0x9a1b('0x70')][_0x9a1b('0x2c')]({'where':{'ListId':_0x55fa92['query'][_0x9a1b('0x86')],'VoiceQueueId':_0x55fa92[_0x9a1b('0x60')]['id']}})[_0x9a1b('0x2b')](function(){return _0x5f4786;});}})[_0x9a1b('0x2b')](respondWithStatusCode(_0x386e6f,null))[_0x9a1b('0x4f')](handleError(_0x386e6f,null));}; \ No newline at end of file +var _0x4483=['ids','select','field','tq.TeamId','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','all','union','compact','isEmpty','removeAgents','forEach','userVoiceQueue:remove','addAgents','voicePause','SIP/%s','getAgents','getMembers','getLists','CmList','addLists','omit','spread','dialCheckDuplicateType','always','insert','fromQuery','phone','ContactId','ListId','NOW()','CmListId','updatedAt','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','into','scheduledAt','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','removeLists','CmHopper','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','socket.io-emitter','./voiceQueue.socket','sendStatus','status','end','json','offset','limit','Content-Range','apply','destroy','get','VoiceQueues','inbound','outbound','ignore','map','value','includes','type','find','name','UserProfileResource','then','error','index','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','VoiceQueue','count','include','catch','params','fields','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','body','QueueCampaigns','update','getHoppers','findOne','VoiceQueueId','findAll','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','User','online','interface','flatMap','Agents','penalty','sequelize','transaction','addTeams','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','format','emit','userVoiceQueue:save','removeTeams'];(function(_0x404957,_0x5192a4){var _0x4e0365=function(_0x4f6cd7){while(--_0x4f6cd7){_0x404957['push'](_0x404957['shift']());}};_0x4e0365(++_0x5192a4);}(_0x4483,0x1a3));var _0x3448=function(_0x212996,_0x479c68){_0x212996=_0x212996-0x0;var _0x6e2b8b=_0x4483[_0x212996];return _0x6e2b8b;};'use strict';var pdf=require(_0x3448('0x0'));var emlformat=require(_0x3448('0x1'));var rimraf=require(_0x3448('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3448('0x3'));var rp=require(_0x3448('0x4'));var moment=require(_0x3448('0x5'));var BPromise=require(_0x3448('0x6'));var Mustache=require(_0x3448('0x7'));var util=require('util');var path=require(_0x3448('0x8'));var sox=require(_0x3448('0x9'));var csv=require(_0x3448('0xa'));var ejs=require(_0x3448('0xb'));var fs=require('fs');var _=require(_0x3448('0xc'));var squel=require(_0x3448('0xd'));var crypto=require(_0x3448('0xe'));var jsforce=require(_0x3448('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3448('0x10'));var Papa=require(_0x3448('0x11'));var Redis=require(_0x3448('0x12'));var authService=require(_0x3448('0x13'));var qs=require(_0x3448('0x14'));var as=require(_0x3448('0x15'));var hardwareService=require(_0x3448('0x16'));var logger=require(_0x3448('0x17'))(_0x3448('0x18'));var utils=require(_0x3448('0x19'));var config=require(_0x3448('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x3448('0x1b')](config[_0x3448('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x3448('0x1d'))(new Redis(config[_0x3448('0x1c')]));require(_0x3448('0x1e'))['register'](socket);function respondWithStatusCode(_0x14104c,_0x2952a6){_0x2952a6=_0x2952a6||0xcc;return function(_0x4daf3e){if(_0x4daf3e){return _0x14104c[_0x3448('0x1f')](_0x2952a6);}return _0x14104c[_0x3448('0x20')](_0x2952a6)[_0x3448('0x21')]();};}function respondWithResult(_0x4fc70f,_0x472518){_0x472518=_0x472518||0xc8;return function(_0x28f5b9){if(_0x28f5b9){return _0x4fc70f[_0x3448('0x20')](_0x472518)[_0x3448('0x22')](_0x28f5b9);}};}function respondWithFilteredResult(_0x400af8,_0x1b2081){return function(_0x247d1a){if(_0x247d1a){var _0x425514=_0x247d1a['count'],_0x4a348c=_0x1b2081['offset'],_0x1658cd=_0x1b2081[_0x3448('0x23')]+_0x1b2081[_0x3448('0x24')],_0x5b410d;if(_0x1658cd>=_0x425514){_0x1658cd=_0x425514;_0x5b410d=0xc8;}else{_0x5b410d=0xce;}_0x400af8[_0x3448('0x20')](_0x5b410d);return _0x400af8['set'](_0x3448('0x25'),_0x4a348c+'-'+_0x1658cd+'/'+_0x425514)[_0x3448('0x22')](_0x247d1a);}return null;};}function patchUpdates(_0x317de6){return function(_0x18608e){try{jsonpatch[_0x3448('0x26')](_0x18608e,_0x317de6,!![]);}catch(_0x715c3){return BPromise['reject'](_0x715c3);}return _0x18608e['save']();};}function saveUpdates(_0x4e6716,_0x1b3d5a){return function(_0x200f72){if(_0x200f72){return _0x200f72['update'](_0x4e6716)['then'](function(_0x2dcd40){return _0x2dcd40;});}return null;};}function removeEntity(_0x4371d6,_0x22ad5c){return function(_0x4368c7){if(_0x4368c7){return _0x4368c7[_0x3448('0x27')]()['then'](function(){var _0x229ce7=_0x4368c7[_0x3448('0x28')]({'plain':!![]});var _0x114244=[{'name':_0x3448('0x29'),'value':_0x3448('0x2a'),'ignore':![]},{'name':'QueueCampaigns','value':_0x3448('0x2b'),'ignore':![]}];var _0x393081=_(_0x114244)['filter'](_0x3448('0x2c'))[_0x3448('0x2d')](_0x3448('0x2e'))[_0x3448('0x2e')]();if(_[_0x3448('0x2f')](_0x393081,_0x229ce7[_0x3448('0x30')])){return;}var _0x31be64=_[_0x3448('0x31')](_0x114244,['value',_0x229ce7[_0x3448('0x30')]])[_0x3448('0x32')];return db[_0x3448('0x33')]['destroy']({'where':{'type':_0x31be64,'resourceId':_0x229ce7['id']}})[_0x3448('0x34')](function(){return _0x4368c7;});})['then'](function(){_0x4371d6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x52fb48,_0xff6513){return function(_0x5e96f0){if(!_0x5e96f0){_0x52fb48['sendStatus'](0x194);}return _0x5e96f0;};}function handleError(_0x3d2a83,_0x37ceac){_0x37ceac=_0x37ceac||0x1f4;return function(_0x32121c){logger[_0x3448('0x35')](_0x32121c['stack']);if(_0x32121c[_0x3448('0x32')]){delete _0x32121c[_0x3448('0x32')];}_0x3d2a83[_0x3448('0x20')](_0x37ceac)['send'](_0x32121c);};}exports[_0x3448('0x36')]=function(_0x2b4474,_0x5e7e77){var _0x4d5dc8={},_0x191f37={},_0x26b250={'count':0x0,'rows':[]};var _0x3c7eb1=_[_0x3448('0x2d')](db['VoiceQueue'][_0x3448('0x37')],function(_0x36291e){return{'name':_0x36291e[_0x3448('0x38')],'type':_0x36291e[_0x3448('0x30')]['key']};});_0x191f37[_0x3448('0x39')]=_[_0x3448('0x2d')](_0x3c7eb1,'name');_0x191f37[_0x3448('0x3a')]=_[_0x3448('0x3b')](_0x2b4474[_0x3448('0x3a')]);_0x191f37[_0x3448('0x3c')]=_[_0x3448('0x3d')](_0x191f37[_0x3448('0x39')],_0x191f37[_0x3448('0x3a')]);_0x4d5dc8[_0x3448('0x3e')]=_[_0x3448('0x3d')](_0x191f37['model'],qs['fields'](_0x2b4474[_0x3448('0x3a')]['fields']));_0x4d5dc8[_0x3448('0x3e')]=_0x4d5dc8[_0x3448('0x3e')][_0x3448('0x3f')]?_0x4d5dc8[_0x3448('0x3e')]:_0x191f37['model'];if(!_0x2b4474[_0x3448('0x3a')][_0x3448('0x40')](_0x3448('0x41'))){_0x4d5dc8[_0x3448('0x24')]=qs[_0x3448('0x24')](_0x2b4474[_0x3448('0x3a')][_0x3448('0x24')]);_0x4d5dc8[_0x3448('0x23')]=qs[_0x3448('0x23')](_0x2b4474['query'][_0x3448('0x23')]);}_0x4d5dc8[_0x3448('0x42')]=qs[_0x3448('0x43')](_0x2b4474[_0x3448('0x3a')][_0x3448('0x43')]);_0x4d5dc8['where']=qs[_0x3448('0x3c')](_[_0x3448('0x44')](_0x2b4474[_0x3448('0x3a')],_0x191f37[_0x3448('0x3c')]));if(_0x2b4474[_0x3448('0x3a')][_0x3448('0x45')]){_0x4d5dc8[_0x3448('0x46')]=_[_0x3448('0x47')](_0x4d5dc8['where'],{'$or':_[_0x3448('0x2d')](_0x3c7eb1,function(_0x3d96be){if(_0x3d96be[_0x3448('0x30')]!=='VIRTUAL'){var _0x2465ff={};_0x2465ff[_0x3d96be[_0x3448('0x32')]]={'$like':'%'+_0x2b4474[_0x3448('0x3a')][_0x3448('0x45')]+'%'};return _0x2465ff;}})});}_0x4d5dc8=_[_0x3448('0x47')]({},_0x4d5dc8,_0x2b4474[_0x3448('0x48')]);var _0x213065={'where':_0x4d5dc8['where']};return db[_0x3448('0x49')][_0x3448('0x4a')](_0x213065)[_0x3448('0x34')](function(_0x81d512){_0x26b250[_0x3448('0x4a')]=_0x81d512;if(_0x2b4474[_0x3448('0x3a')]['includeAll']){_0x4d5dc8[_0x3448('0x4b')]=[{'all':!![]}];}return db['VoiceQueue']['findAll'](_0x4d5dc8);})[_0x3448('0x34')](function(_0x297343){_0x26b250['rows']=_0x297343;return _0x26b250;})[_0x3448('0x34')](respondWithFilteredResult(_0x5e7e77,_0x4d5dc8))[_0x3448('0x4c')](handleError(_0x5e7e77,null));};exports['show']=function(_0x4cf807,_0x1372a1){var _0x5d4263={'raw':![],'where':{'id':_0x4cf807[_0x3448('0x4d')]['id']}},_0x35f875={};_0x35f875[_0x3448('0x39')]=_[_0x3448('0x3b')](db[_0x3448('0x49')][_0x3448('0x37')]);_0x35f875[_0x3448('0x3a')]=_['keys'](_0x4cf807['query']);_0x35f875[_0x3448('0x3c')]=_[_0x3448('0x3d')](_0x35f875[_0x3448('0x39')],_0x35f875[_0x3448('0x3a')]);_0x5d4263['attributes']=_[_0x3448('0x3d')](_0x35f875[_0x3448('0x39')],qs[_0x3448('0x4e')](_0x4cf807[_0x3448('0x3a')][_0x3448('0x4e')]));_0x5d4263['attributes']=_0x5d4263[_0x3448('0x3e')]['length']?_0x5d4263[_0x3448('0x3e')]:_0x35f875[_0x3448('0x39')];if(_0x4cf807['query'][_0x3448('0x4f')]){_0x5d4263[_0x3448('0x4b')]=[{'all':!![]}];}_0x5d4263=_[_0x3448('0x47')]({},_0x5d4263,_0x4cf807[_0x3448('0x48')]);return db[_0x3448('0x49')][_0x3448('0x31')](_0x5d4263)[_0x3448('0x34')](handleEntityNotFound(_0x1372a1,null))['then'](respondWithResult(_0x1372a1,null))[_0x3448('0x4c')](handleError(_0x1372a1,null));};exports[_0x3448('0x50')]=function(_0x5dd19a,_0x5a81dd){return db[_0x3448('0x49')][_0x3448('0x50')](_0x5dd19a['body'],{})['then'](function(_0x371e8a){var _0xb6c293=_0x5dd19a[_0x3448('0x51')][_0x3448('0x28')]({'plain':!![]});if(!_0xb6c293)throw new Error(_0x3448('0x52'));if(_0xb6c293[_0x3448('0x53')]===_0x3448('0x51')){var _0x4c0053=_0x371e8a['get']({'plain':!![]});var _0x530dcb=[{'name':_0x3448('0x29'),'value':_0x3448('0x2a')},{'name':'QueueCampaigns','value':_0x3448('0x2b')}];var _0x14ef18=_['find'](_0x530dcb,[_0x3448('0x2e'),_0x4c0053[_0x3448('0x30')]])['name'];return db[_0x3448('0x54')][_0x3448('0x31')]({'where':{'name':_0x14ef18,'userProfileId':_0xb6c293[_0x3448('0x55')]},'raw':!![]})[_0x3448('0x34')](function(_0x38c3ab){if(_0x38c3ab&&_0x38c3ab[_0x3448('0x56')]===0x0){return db[_0x3448('0x33')][_0x3448('0x50')]({'name':_0x4c0053[_0x3448('0x32')],'resourceId':_0x4c0053['id'],'type':_0x38c3ab['name'],'sectionId':_0x38c3ab['id']},{})[_0x3448('0x34')](function(){return _0x371e8a;});}else{return _0x371e8a;}})['catch'](function(_0x2991e8){logger[_0x3448('0x35')](_0x3448('0x57'),_0x2991e8);throw _0x2991e8;});}return _0x371e8a;})[_0x3448('0x34')](respondWithResult(_0x5a81dd,0xc9))[_0x3448('0x4c')](handleError(_0x5a81dd,null));};exports[_0x3448('0x58')]=function(_0x4f8317,_0x163443){var _0x5795c7={'where':{'id':_0x4f8317[_0x3448('0x4d')]['id']}},_0x15b48b={};_0x15b48b[_0x3448('0x39')]=_[_0x3448('0x3b')](db[_0x3448('0x49')]['rawAttributes']);_0x5795c7['attributes']=_[_0x3448('0x3d')](_0x15b48b[_0x3448('0x39')],qs[_0x3448('0x4e')](_0x4f8317['query'][_0x3448('0x4e')]));_0x5795c7[_0x3448('0x3e')]=_0x5795c7[_0x3448('0x3e')][_0x3448('0x3f')]?_0x5795c7[_0x3448('0x3e')]:_0x15b48b[_0x3448('0x39')];if(_0x4f8317[_0x3448('0x3a')][_0x3448('0x4f')]){_0x5795c7[_0x3448('0x4b')]=[{'all':!![]}];}_0x5795c7=_[_0x3448('0x47')]({},_0x5795c7,_0x4f8317[_0x3448('0x48')]);return db[_0x3448('0x49')][_0x3448('0x31')](_0x5795c7)[_0x3448('0x34')](handleEntityNotFound(_0x163443,null))[_0x3448('0x34')](function(_0x2f3b0e){if(_0x2f3b0e){var _0x255cac=_0x2f3b0e[_0x3448('0x28')]({'plain':!![]});_0x255cac=qs['omit'](_0x255cac,['id',_0x3448('0x59'),'updatedAt']);_0x4f8317[_0x3448('0x5a')]=_['omit'](_0x4f8317[_0x3448('0x5a')],['id',_0x3448('0x59'),'updatedAt']);return db[_0x3448('0x49')][_0x3448('0x50')](_['merge'](_0x255cac,_0x4f8317['body']),{'include':_0x4f8317[_0x3448('0x3a')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x21f4e5){var _0xb64f29=_0x4f8317['user']['get']({'plain':!![]});if(!_0xb64f29)throw new Error(_0x3448('0x52'));if(_0xb64f29[_0x3448('0x53')]===_0x3448('0x51')){var _0x347612=_0x21f4e5[_0x3448('0x28')]({'plain':!![]});var _0x27003f=[{'name':_0x3448('0x29'),'value':_0x3448('0x2a')},{'name':_0x3448('0x5b'),'value':_0x3448('0x2b')}];var _0x143b28=_[_0x3448('0x31')](_0x27003f,[_0x3448('0x2e'),_0x347612[_0x3448('0x30')]])['name'];return db[_0x3448('0x54')][_0x3448('0x31')]({'where':{'name':_0x143b28,'userProfileId':_0xb64f29['userProfileId']},'raw':!![]})[_0x3448('0x34')](function(_0x31989e){if(_0x31989e&&_0x31989e['autoAssociation']===0x0){return db[_0x3448('0x33')][_0x3448('0x50')]({'name':_0x347612[_0x3448('0x32')],'resourceId':_0x347612['id'],'type':_0x31989e['name'],'sectionId':_0x31989e['id']},{})['then'](function(){return _0x21f4e5;});}else{return _0x21f4e5;}})[_0x3448('0x4c')](function(_0x489b70){logger[_0x3448('0x35')](_0x3448('0x57'),_0x489b70);throw _0x489b70;});}return _0x21f4e5;});}})[_0x3448('0x34')](respondWithResult(_0x163443,0xc9))['catch'](handleError(_0x163443,null));};exports[_0x3448('0x5c')]=function(_0x1f6111,_0x6ca224){if(_0x1f6111['body']['id']){delete _0x1f6111['body']['id'];}return db[_0x3448('0x49')][_0x3448('0x31')]({'where':{'id':_0x1f6111[_0x3448('0x4d')]['id']}})[_0x3448('0x34')](handleEntityNotFound(_0x6ca224,null))[_0x3448('0x34')](saveUpdates(_0x1f6111[_0x3448('0x5a')],null))['then'](respondWithResult(_0x6ca224,null))[_0x3448('0x4c')](handleError(_0x6ca224,null));};exports['destroy']=function(_0x3f7a64,_0x2cca2f){return db['VoiceQueue'][_0x3448('0x31')]({'where':{'id':_0x3f7a64[_0x3448('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2cca2f,null))['then'](removeEntity(_0x2cca2f,null))[_0x3448('0x4c')](handleError(_0x2cca2f,null));};exports[_0x3448('0x5d')]=function(_0x36d154,_0x392874,_0x35912d){var _0xfdd159={'raw':![],'where':{}};var _0x4f9ea5={};var _0x29f39b={'count':0x0,'rows':[]};return db[_0x3448('0x49')][_0x3448('0x5e')]({'where':{'id':_0x36d154[_0x3448('0x4d')]['id']}})[_0x3448('0x34')](handleEntityNotFound(_0x392874,null))[_0x3448('0x34')](function(_0x11d62f){if(_0x11d62f){_0x4f9ea5[_0x3448('0x39')]=_[_0x3448('0x3b')](db['CmHopper']['rawAttributes']);_0x4f9ea5[_0x3448('0x3a')]=_['keys'](_0x36d154[_0x3448('0x3a')]);_0x4f9ea5[_0x3448('0x3c')]=_['intersection'](_0x4f9ea5[_0x3448('0x39')],_0x4f9ea5['query']);_0xfdd159[_0x3448('0x3e')]=_[_0x3448('0x3d')](_0x4f9ea5[_0x3448('0x39')],qs[_0x3448('0x4e')](_0x36d154[_0x3448('0x3a')]['fields']));_0xfdd159[_0x3448('0x3e')]=_0xfdd159[_0x3448('0x3e')][_0x3448('0x3f')]?_0xfdd159['attributes']:_0x4f9ea5[_0x3448('0x39')];if(!_0x36d154[_0x3448('0x3a')][_0x3448('0x40')]('nolimit')){_0xfdd159[_0x3448('0x24')]=qs['limit'](_0x36d154['query'][_0x3448('0x24')]);_0xfdd159['offset']=qs[_0x3448('0x23')](_0x36d154['query'][_0x3448('0x23')]);}_0xfdd159[_0x3448('0x42')]=qs['sort'](_0x36d154['query'][_0x3448('0x43')]);_0xfdd159[_0x3448('0x46')]=qs['filters'](_[_0x3448('0x44')](_0x36d154[_0x3448('0x3a')],_0x4f9ea5['filters']));_0xfdd159[_0x3448('0x46')][_0x3448('0x5f')]=_0x11d62f['id'];if(_0x36d154[_0x3448('0x3a')][_0x3448('0x45')]){_0xfdd159['where']=_[_0x3448('0x47')](_0xfdd159['where'],{'$or':_[_0x3448('0x2d')](_0xfdd159['attributes'],function(_0x1afd5c){var _0x20a047={};_0x20a047[_0x1afd5c]={'$like':'%'+_0x36d154[_0x3448('0x3a')]['filter']+'%'};return _0x20a047;})});}_0xfdd159=_[_0x3448('0x47')]({},_0xfdd159,_0x36d154[_0x3448('0x48')]);return db['CmHopper'][_0x3448('0x4a')]({'where':_0xfdd159['where']})['then'](function(_0x1022fa){_0x29f39b['count']=_0x1022fa;if(_0x36d154[_0x3448('0x3a')][_0x3448('0x4f')]){_0xfdd159[_0x3448('0x4b')]=[{'all':!![]}];}return db['CmHopper'][_0x3448('0x60')](_0xfdd159);})[_0x3448('0x34')](function(_0x45f399){_0x29f39b[_0x3448('0x61')]=_0x45f399;return _0x29f39b;});}})[_0x3448('0x34')](respondWithFilteredResult(_0x392874,_0xfdd159))[_0x3448('0x4c')](handleError(_0x392874,null));};exports[_0x3448('0x62')]=function(_0x349f3b,_0x4c769b,_0x11f082){var _0x7073d8={'raw':!![],'where':{}};var _0xadb99b={};var _0x1fc391={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x349f3b['params']['id']}})[_0x3448('0x34')](handleEntityNotFound(_0x4c769b,null))['then'](function(_0x597ff8){if(_0x597ff8){_0xadb99b[_0x3448('0x39')]=_[_0x3448('0x3b')](db[_0x3448('0x63')][_0x3448('0x37')]);_0xadb99b['query']=_['keys'](_0x349f3b[_0x3448('0x3a')]);_0xadb99b[_0x3448('0x3c')]=_[_0x3448('0x3d')](_0xadb99b['model'],_0xadb99b[_0x3448('0x3a')]);_0x7073d8[_0x3448('0x3e')]=_[_0x3448('0x3d')](_0xadb99b[_0x3448('0x39')],qs['fields'](_0x349f3b[_0x3448('0x3a')][_0x3448('0x4e')]));_0x7073d8['attributes']=_0x7073d8['attributes'][_0x3448('0x3f')]?_0x7073d8[_0x3448('0x3e')]:_0xadb99b[_0x3448('0x39')];if(!_0x349f3b['query'][_0x3448('0x40')](_0x3448('0x41'))){_0x7073d8[_0x3448('0x24')]=qs[_0x3448('0x24')](_0x349f3b['query'][_0x3448('0x24')]);_0x7073d8[_0x3448('0x23')]=qs['offset'](_0x349f3b[_0x3448('0x3a')][_0x3448('0x23')]);}_0x7073d8['order']=qs['sort'](_0x349f3b[_0x3448('0x3a')][_0x3448('0x43')]);_0x7073d8[_0x3448('0x46')]=qs[_0x3448('0x3c')](_[_0x3448('0x44')](_0x349f3b[_0x3448('0x3a')],_0xadb99b[_0x3448('0x3c')]));_0x7073d8[_0x3448('0x46')][_0x3448('0x5f')]=_0x597ff8['id'];if(_0x349f3b[_0x3448('0x3a')]['filter']){_0x7073d8[_0x3448('0x46')]=_['merge'](_0x7073d8[_0x3448('0x46')],{'$or':_['map'](_0x7073d8[_0x3448('0x3e')],function(_0x9bd5a0){var _0x4aef21={};_0x4aef21[_0x9bd5a0]={'$like':'%'+_0x349f3b['query']['filter']+'%'};return _0x4aef21;})});}_0x7073d8=_[_0x3448('0x47')]({},_0x7073d8,_0x349f3b[_0x3448('0x48')]);return db[_0x3448('0x63')]['count']({'where':_0x7073d8[_0x3448('0x46')]})[_0x3448('0x34')](function(_0x4d34c6){_0x1fc391['count']=_0x4d34c6;if(_0x349f3b[_0x3448('0x3a')][_0x3448('0x4f')]){_0x7073d8[_0x3448('0x4b')]=[{'all':!![]}];}return db[_0x3448('0x63')][_0x3448('0x60')](_0x7073d8);})[_0x3448('0x34')](function(_0x3d5d57){_0x1fc391[_0x3448('0x61')]=_0x3d5d57;return _0x1fc391;});}})[_0x3448('0x34')](respondWithFilteredResult(_0x4c769b,_0x7073d8))['catch'](handleError(_0x4c769b,null));};exports['getHopperFinals']=function(_0x3bb139,_0x55cab2,_0x261baa){var _0x4d17b2={'raw':!![],'where':{}};var _0x4037b4={};var _0x226868={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x3448('0x5e')]({'where':{'id':_0x3bb139[_0x3448('0x4d')]['id']}})[_0x3448('0x34')](handleEntityNotFound(_0x55cab2,null))[_0x3448('0x34')](function(_0x15865){if(_0x15865){_0x4037b4[_0x3448('0x39')]=_[_0x3448('0x3b')](db[_0x3448('0x64')][_0x3448('0x37')]);_0x4037b4[_0x3448('0x3a')]=_[_0x3448('0x3b')](_0x3bb139['query']);_0x4037b4[_0x3448('0x3c')]=_[_0x3448('0x3d')](_0x4037b4[_0x3448('0x39')],_0x4037b4['query']);_0x4d17b2[_0x3448('0x3e')]=_[_0x3448('0x3d')](_0x4037b4[_0x3448('0x39')],qs[_0x3448('0x4e')](_0x3bb139[_0x3448('0x3a')][_0x3448('0x4e')]));_0x4d17b2['attributes']=_0x4d17b2['attributes'][_0x3448('0x3f')]?_0x4d17b2[_0x3448('0x3e')]:_0x4037b4[_0x3448('0x39')];if(!_0x3bb139[_0x3448('0x3a')][_0x3448('0x40')](_0x3448('0x41'))){_0x4d17b2[_0x3448('0x24')]=qs[_0x3448('0x24')](_0x3bb139[_0x3448('0x3a')][_0x3448('0x24')]);_0x4d17b2[_0x3448('0x23')]=qs[_0x3448('0x23')](_0x3bb139[_0x3448('0x3a')][_0x3448('0x23')]);}_0x4d17b2['order']=qs['sort'](_0x3bb139['query'][_0x3448('0x43')]);_0x4d17b2[_0x3448('0x46')]=qs[_0x3448('0x3c')](_[_0x3448('0x44')](_0x3bb139['query'],_0x4037b4[_0x3448('0x3c')]));_0x4d17b2['where'][_0x3448('0x5f')]=_0x15865['id'];if(_0x3bb139['query'][_0x3448('0x45')]){_0x4d17b2['where']=_[_0x3448('0x47')](_0x4d17b2[_0x3448('0x46')],{'$or':_[_0x3448('0x2d')](_0x4d17b2[_0x3448('0x3e')],function(_0x3f3098){var _0x7d3939={};_0x7d3939[_0x3f3098]={'$like':'%'+_0x3bb139[_0x3448('0x3a')][_0x3448('0x45')]+'%'};return _0x7d3939;})});}_0x4d17b2=_[_0x3448('0x47')]({},_0x4d17b2,_0x3bb139['options']);return db['CmHopperFinal'][_0x3448('0x4a')]({'where':_0x4d17b2[_0x3448('0x46')]})[_0x3448('0x34')](function(_0x3725d5){_0x226868['count']=_0x3725d5;if(_0x3bb139[_0x3448('0x3a')][_0x3448('0x4f')]){_0x4d17b2[_0x3448('0x4b')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x3448('0x60')](_0x4d17b2);})['then'](function(_0x1a0e7c){_0x226868[_0x3448('0x61')]=_0x1a0e7c;return _0x226868;});}})[_0x3448('0x34')](respondWithFilteredResult(_0x55cab2,_0x4d17b2))['catch'](handleError(_0x55cab2,null));};exports[_0x3448('0x65')]=function(_0x38707a,_0x3de3c8,_0xadf502){var _0x32a56b={'raw':!![],'where':{}};var _0x160ae7={};var _0x4569ab={'count':0x0,'rows':[]};return db[_0x3448('0x49')][_0x3448('0x5e')]({'where':{'id':_0x38707a[_0x3448('0x4d')]['id']}})[_0x3448('0x34')](handleEntityNotFound(_0x3de3c8,null))[_0x3448('0x34')](function(_0x434c06){if(_0x434c06){_0x160ae7[_0x3448('0x39')]=_['keys'](db['CmHopperBlack'][_0x3448('0x37')]);_0x160ae7[_0x3448('0x3a')]=_[_0x3448('0x3b')](_0x38707a['query']);_0x160ae7['filters']=_[_0x3448('0x3d')](_0x160ae7[_0x3448('0x39')],_0x160ae7[_0x3448('0x3a')]);_0x32a56b[_0x3448('0x3e')]=_[_0x3448('0x3d')](_0x160ae7[_0x3448('0x39')],qs[_0x3448('0x4e')](_0x38707a[_0x3448('0x3a')][_0x3448('0x4e')]));_0x32a56b[_0x3448('0x3e')]=_0x32a56b[_0x3448('0x3e')][_0x3448('0x3f')]?_0x32a56b['attributes']:_0x160ae7[_0x3448('0x39')];if(!_0x38707a[_0x3448('0x3a')][_0x3448('0x40')](_0x3448('0x41'))){_0x32a56b[_0x3448('0x24')]=qs[_0x3448('0x24')](_0x38707a[_0x3448('0x3a')][_0x3448('0x24')]);_0x32a56b[_0x3448('0x23')]=qs[_0x3448('0x23')](_0x38707a[_0x3448('0x3a')][_0x3448('0x23')]);}_0x32a56b['order']=qs['sort'](_0x38707a[_0x3448('0x3a')][_0x3448('0x43')]);_0x32a56b[_0x3448('0x46')]=qs['filters'](_[_0x3448('0x44')](_0x38707a[_0x3448('0x3a')],_0x160ae7[_0x3448('0x3c')]));_0x32a56b['where']['VoiceQueueId']=_0x434c06['id'];if(_0x38707a[_0x3448('0x3a')][_0x3448('0x45')]){_0x32a56b[_0x3448('0x46')]=_[_0x3448('0x47')](_0x32a56b[_0x3448('0x46')],{'$or':_[_0x3448('0x2d')](_0x32a56b[_0x3448('0x3e')],function(_0x126b14){var _0x2af9de={};_0x2af9de[_0x126b14]={'$like':'%'+_0x38707a[_0x3448('0x3a')][_0x3448('0x45')]+'%'};return _0x2af9de;})});}_0x32a56b=_[_0x3448('0x47')]({},_0x32a56b,_0x38707a[_0x3448('0x48')]);return db[_0x3448('0x66')]['count']({'where':_0x32a56b[_0x3448('0x46')]})[_0x3448('0x34')](function(_0x529005){_0x4569ab[_0x3448('0x4a')]=_0x529005;if(_0x38707a[_0x3448('0x3a')][_0x3448('0x4f')]){_0x32a56b[_0x3448('0x4b')]=[{'all':!![]}];}return db[_0x3448('0x66')][_0x3448('0x60')](_0x32a56b);})['then'](function(_0x36c3fb){_0x4569ab[_0x3448('0x61')]=_0x36c3fb;return _0x4569ab;});}})[_0x3448('0x34')](respondWithFilteredResult(_0x3de3c8,_0x32a56b))['catch'](handleError(_0x3de3c8,null));};exports['getTeams']=function(_0x43408e,_0x28e0be,_0x23123e){var _0x44175f={};var _0x39f0da={};var _0x1e505d;var _0x13da6f;return db[_0x3448('0x49')][_0x3448('0x5e')]({'where':{'id':_0x43408e['params']['id']}})[_0x3448('0x34')](handleEntityNotFound(_0x28e0be,null))[_0x3448('0x34')](function(_0x3f65db){if(_0x3f65db){_0x1e505d=_0x3f65db;_0x39f0da[_0x3448('0x39')]=_[_0x3448('0x3b')](db['Team'][_0x3448('0x37')]);_0x39f0da[_0x3448('0x3a')]=_[_0x3448('0x3b')](_0x43408e[_0x3448('0x3a')]);_0x39f0da[_0x3448('0x3c')]=_[_0x3448('0x3d')](_0x39f0da[_0x3448('0x39')],_0x39f0da[_0x3448('0x3a')]);_0x44175f[_0x3448('0x3e')]=_[_0x3448('0x3d')](_0x39f0da[_0x3448('0x39')],qs[_0x3448('0x4e')](_0x43408e[_0x3448('0x3a')][_0x3448('0x4e')]));_0x44175f[_0x3448('0x3e')]=_0x44175f[_0x3448('0x3e')][_0x3448('0x3f')]?_0x44175f[_0x3448('0x3e')]:_0x39f0da[_0x3448('0x39')];_0x44175f[_0x3448('0x42')]=qs[_0x3448('0x43')](_0x43408e['query'][_0x3448('0x43')]);_0x44175f['where']=qs[_0x3448('0x3c')](_[_0x3448('0x44')](_0x43408e['query'],_0x39f0da[_0x3448('0x3c')]));if(_0x43408e['query'][_0x3448('0x45')]){_0x44175f[_0x3448('0x46')]=_['merge'](_0x44175f[_0x3448('0x46')],{'$or':_[_0x3448('0x2d')](_0x44175f['attributes'],function(_0x1b7c18){var _0x17ad06={};_0x17ad06[_0x1b7c18]={'$like':'%'+_0x43408e[_0x3448('0x3a')]['filter']+'%'};return _0x17ad06;})});}_0x44175f=_['merge']({},_0x44175f,_0x43408e[_0x3448('0x48')]);return _0x1e505d[_0x3448('0x67')](_0x44175f);}})[_0x3448('0x34')](function(_0x2b9f8e){if(_0x2b9f8e){_0x13da6f=_0x2b9f8e[_0x3448('0x3f')];if(!_0x43408e[_0x3448('0x3a')][_0x3448('0x40')](_0x3448('0x41'))){_0x44175f['limit']=qs[_0x3448('0x24')](_0x43408e[_0x3448('0x3a')][_0x3448('0x24')]);_0x44175f[_0x3448('0x23')]=qs[_0x3448('0x23')](_0x43408e[_0x3448('0x3a')][_0x3448('0x23')]);}return _0x1e505d[_0x3448('0x67')](_0x44175f);}})[_0x3448('0x34')](function(_0x204160){if(_0x204160){return _0x204160?{'count':_0x13da6f,'rows':_0x204160}:null;}})[_0x3448('0x34')](respondWithResult(_0x28e0be,null))['catch'](handleError(_0x28e0be,null));};exports['addTeams']=function(_0x1f69af,_0x53a909,_0x257cd3){var _0x5e43e8=_0x1f69af[_0x3448('0x5a')]['teams'];var _0x25849d=_[_0x3448('0x2d')](_0x5e43e8,'id');return db[_0x3448('0x68')][_0x3448('0x60')]({'where':{'id':_0x25849d},'attributes':['id'],'include':[{'model':db[_0x3448('0x69')],'as':'Agents','attributes':['id',_0x3448('0x32'),_0x3448('0x6a'),'voicePause',_0x3448('0x6b')],'raw':!![]}]})[_0x3448('0x34')](function(_0x348cb6){if(_0x348cb6){var _0x595f3e=_[_0x3448('0x6c')](_0x348cb6,function(_0x40ebed){var _0x4812cc=_0x40ebed[_0x3448('0x28')]({'plain':!![]});_0x4812cc[_0x3448('0x6d')]['forEach'](function(_0x330187){_0x330187['penalty']=_[_0x3448('0x31')](_0x5e43e8,{'id':_0x4812cc['id']})[_0x3448('0x6e')];});return _0x4812cc[_0x3448('0x6d')];});return db[_0x3448('0x49')][_0x3448('0x31')]({'where':{'id':_0x1f69af[_0x3448('0x4d')]['id']}})[_0x3448('0x34')](function(_0x57a9a1){return db[_0x3448('0x6f')][_0x3448('0x70')](function(_0x4def13){return _0x57a9a1[_0x3448('0x71')](_0x25849d,{'transaction':_0x4def13})['then'](function(){return BPromise[_0x3448('0x72')](_0x595f3e,function(_0x5450d1){return db[_0x3448('0x73')][_0x3448('0x74')]({'where':{'UserId':_0x5450d1['id'],'VoiceQueueId':_0x1f69af[_0x3448('0x4d')]['id']},'defaults':{'penalty':_0x5450d1[_0x3448('0x6e')]},'transaction':_0x4def13});});})[_0x3448('0x34')](function(){return BPromise[_0x3448('0x72')](_[_0x3448('0x45')](_0x595f3e,{'online':!![]}),function(_0x5d14dc){return db[_0x3448('0x75')][_0x3448('0x76')]({'membername':_0x5d14dc[_0x3448('0x32')],'UserId':_0x5d14dc['id'],'queue_name':_0x57a9a1[_0x3448('0x32')],'VoiceQueueId':_0x57a9a1['id'],'interface':_[_0x3448('0x77')](_0x5d14dc['interface'])?util[_0x3448('0x78')]('SIP/%s',_0x5d14dc[_0x3448('0x32')]):_0x5d14dc[_0x3448('0x6b')],'paused':_0x5d14dc['voicePause']||![],'penalty':_0x5d14dc[_0x3448('0x6e')]},{'transaction':_0x4def13});});})[_0x3448('0x34')](function(){_0x595f3e['forEach'](function(_0x2a8e5a){socket[_0x3448('0x79')](_0x3448('0x7a'),{'UserId':_0x2a8e5a['id'],'VoiceQueueId':_0x57a9a1['id']});});});});});}})[_0x3448('0x34')](respondWithStatusCode(_0x53a909,null))[_0x3448('0x4c')](handleError(_0x53a909,null));};exports[_0x3448('0x7b')]=function(_0x6e98a9,_0x4080cb,_0x33bfb4){return db[_0x3448('0x68')][_0x3448('0x60')]({'where':{'id':_0x6e98a9[_0x3448('0x3a')][_0x3448('0x7c')]},'attributes':['id'],'include':[{'model':db[_0x3448('0x69')],'as':_0x3448('0x6d'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4080cb,null))[_0x3448('0x34')](function(_0x4b7a9f){var _0x2aabf2=_[_0x3448('0x2d')](_0x4b7a9f,'id');var _0x151c60=[];var _0x2cd059=[];var _0x117f9d=squel[_0x3448('0x7d')]();_0x117f9d[_0x3448('0x7e')](_0x3448('0x7f'))['from'](_0x3448('0x80'),'tq')[_0x3448('0x81')](_0x3448('0x82'),'ut',_0x3448('0x83'))['where'](_0x3448('0x84'),_0x6e98a9[_0x3448('0x4d')]['id']);for(var _0x57fb71=0x0;_0x57fb71<_0x4b7a9f[_0x3448('0x3f')];_0x57fb71+=0x1){let _0x5ab64e=_0x4b7a9f[_0x57fb71];for(var _0x3211f8=0x0;_0x3211f8<_0x5ab64e['Agents'][_0x3448('0x3f')];_0x3211f8+=0x1){let _0x16188f=_0x5ab64e[_0x3448('0x6d')][_0x3211f8];var _0x3eb27b=_0x117f9d[_0x3448('0x58')]();_0x3eb27b[_0x3448('0x46')](_0x3448('0x85'),_0x16188f['id']);_0x2cd059[_0x3448('0x86')](db[_0x3448('0x6f')][_0x3448('0x3a')](_0x3eb27b[_0x3448('0x87')](),{'type':db[_0x3448('0x6f')][_0x3448('0x88')]['SELECT']})[_0x3448('0x34')](function(_0x5e00dd){if(_0x5e00dd[_0x3448('0x3f')]===0x1){return _0x16188f['id'];}else{var _0x1044bf=_['every'](_[_0x3448('0x2d')](_0x5e00dd,'TeamId'),function(_0x1b3f4c){return _[_0x3448('0x2f')](_0x2aabf2,_0x1b3f4c);});if(_0x1044bf){return _0x16188f['id'];}}}));}}return BPromise[_0x3448('0x89')](_0x2cd059)[_0x3448('0x34')](function(_0x1b9668){_0x151c60=_(_0x151c60)[_0x3448('0x8a')](_0x1b9668)[_0x3448('0x8b')]()[_0x3448('0x2e')]();return db[_0x3448('0x49')][_0x3448('0x31')]({'where':{'id':_0x6e98a9[_0x3448('0x4d')]['id']}})[_0x3448('0x34')](function(_0x28ac3a){return db[_0x3448('0x6f')][_0x3448('0x70')](function(_0x5b3245){return _0x28ac3a['removeTeams'](_0x6e98a9[_0x3448('0x3a')]['ids'],{'transaction':_0x5b3245})[_0x3448('0x34')](function(){if(!_[_0x3448('0x8c')](_0x151c60)){return _0x28ac3a[_0x3448('0x8d')](_0x151c60,{'transaction':_0x5b3245})[_0x3448('0x34')](function(){return db[_0x3448('0x75')][_0x3448('0x27')]({'where':{'VoiceQueueId':_0x6e98a9[_0x3448('0x4d')]['id'],'UserId':_0x151c60},'transaction':_0x5b3245});});}})[_0x3448('0x34')](function(){_0x151c60[_0x3448('0x8e')](function(_0x2ba3a4){socket[_0x3448('0x79')](_0x3448('0x8f'),{'UserId':_0x2ba3a4,'VoiceQueueId':_0x28ac3a['id']});});});});});});})['then'](respondWithStatusCode(_0x4080cb,null))['catch'](handleError(_0x4080cb,null));};exports[_0x3448('0x90')]=function(_0x3e05b9,_0x28ffc0,_0x25d8ea){var _0x9d20c6,_0x5d175e;return db[_0x3448('0x49')][_0x3448('0x31')]({'where':{'id':_0x3e05b9[_0x3448('0x4d')]['id']}})[_0x3448('0x34')](handleEntityNotFound(_0x28ffc0,null))['then'](function(_0x4d207d){if(_0x4d207d){_0x5d175e=_0x4d207d;return _0x4d207d[_0x3448('0x90')](_0x3e05b9['body'][_0x3448('0x7c')],_['omit'](_0x3e05b9[_0x3448('0x5a')],[_0x3448('0x7c'),'id'])||{})['spread'](function(_0xec6855){for(var _0x28e4ad=0x0;_0x28e4ad<_0x3e05b9[_0x3448('0x5a')][_0x3448('0x7c')][_0x3448('0x3f')];_0x28e4ad+=0x1){socket[_0x3448('0x79')](_0x3448('0x7a'),{'UserId':_0x3e05b9[_0x3448('0x5a')][_0x3448('0x7c')][_0x28e4ad],'VoiceQueueId':_0x3e05b9[_0x3448('0x4d')]['id']});}return _0xec6855;});}})[_0x3448('0x34')](function(_0xc00265){_0x9d20c6=_0xc00265||[];if(_0x5d175e){return db['User'][_0x3448('0x60')]({'where':{'id':_0x3e05b9[_0x3448('0x5a')][_0x3448('0x7c')]},'attributes':['id','name','online',_0x3448('0x91'),_0x3448('0x6b')],'raw':!![]});}})['then'](function(_0x485297){if(!_['isEmpty'](_0x485297)){var _0x13db4f=[];for(var _0xb41f5e=0x0;_0xb41f5e<_0x485297['length'];_0xb41f5e++){if(_0x485297[_0xb41f5e][_0x3448('0x6a')]){_0x13db4f['push'](db[_0x3448('0x75')][_0x3448('0x76')]({'membername':_0x485297[_0xb41f5e]['name'],'UserId':_0x485297[_0xb41f5e]['id'],'queue_name':_0x5d175e[_0x3448('0x32')],'VoiceQueueId':_0x5d175e['id'],'interface':_['isNil'](_0x485297[_0xb41f5e]['interface'])?util[_0x3448('0x78')](_0x3448('0x92'),_0x485297[_0xb41f5e][_0x3448('0x32')]):_0x485297[_0xb41f5e][_0x3448('0x6b')],'paused':_0x485297[_0xb41f5e][_0x3448('0x91')]||![],'penalty':_0x3e05b9[_0x3448('0x5a')][_0x3448('0x6e')]||0x0}));}}return BPromise[_0x3448('0x89')](_0x13db4f);}})['then'](function(){return _0x9d20c6;})[_0x3448('0x34')](respondWithResult(_0x28ffc0,null))[_0x3448('0x4c')](handleError(_0x28ffc0,null));};exports[_0x3448('0x8d')]=function(_0x3facff,_0x3a90b5,_0xd01a38){return db[_0x3448('0x49')][_0x3448('0x31')]({'where':{'id':_0x3facff[_0x3448('0x4d')]['id']}})[_0x3448('0x34')](handleEntityNotFound(_0x3a90b5,null))['then'](function(_0xe3aad6){if(_0xe3aad6){return _0xe3aad6[_0x3448('0x8d')](_0x3facff[_0x3448('0x3a')]['ids'])[_0x3448('0x34')](function(){if(_['isArray'](_0x3facff['query'][_0x3448('0x7c')])){for(var _0x3b9c4f=0x0;_0x3b9c4f<_0x3facff[_0x3448('0x3a')][_0x3448('0x7c')][_0x3448('0x3f')];_0x3b9c4f+=0x1){socket[_0x3448('0x79')](_0x3448('0x8f'),{'UserId':Number(_0x3facff[_0x3448('0x3a')][_0x3448('0x7c')][_0x3b9c4f]),'VoiceQueueId':Number(_0x3facff[_0x3448('0x4d')]['id'])});}}else{socket[_0x3448('0x79')]('userVoiceQueue:remove',{'UserId':Number(_0x3facff[_0x3448('0x3a')][_0x3448('0x7c')]),'VoiceQueueId':Number(_0x3facff[_0x3448('0x4d')]['id'])});}});}})[_0x3448('0x34')](function(_0x5a7e1c){return db[_0x3448('0x75')][_0x3448('0x27')]({'where':{'VoiceQueueId':_0x3facff['params']['id'],'UserId':_0x3facff['query'][_0x3448('0x7c')]}})[_0x3448('0x34')](function(){return _0x5a7e1c;});})['then'](respondWithStatusCode(_0x3a90b5,null))['catch'](handleError(_0x3a90b5,null));};exports[_0x3448('0x93')]=function(_0x16a60e,_0xc0f1c6,_0x29ad4c){var _0x22e28a={};var _0x165531={};var _0x108d5c;var _0x4235bd;return db['VoiceQueue'][_0x3448('0x5e')]({'where':{'id':_0x16a60e[_0x3448('0x4d')]['id']}})[_0x3448('0x34')](handleEntityNotFound(_0xc0f1c6,null))['then'](function(_0x55f0cf){if(_0x55f0cf){_0x108d5c=_0x55f0cf;_0x165531[_0x3448('0x39')]=_[_0x3448('0x3b')](db[_0x3448('0x69')][_0x3448('0x37')]);_0x165531[_0x3448('0x3a')]=_['keys'](_0x16a60e[_0x3448('0x3a')]);_0x165531[_0x3448('0x3c')]=_[_0x3448('0x3d')](_0x165531[_0x3448('0x39')],_0x165531[_0x3448('0x3a')]);_0x22e28a[_0x3448('0x3e')]=_['intersection'](_0x165531[_0x3448('0x39')],qs[_0x3448('0x4e')](_0x16a60e[_0x3448('0x3a')][_0x3448('0x4e')]));_0x22e28a[_0x3448('0x3e')]=_0x22e28a[_0x3448('0x3e')]['length']?_0x22e28a[_0x3448('0x3e')]:_0x165531[_0x3448('0x39')];_0x22e28a[_0x3448('0x42')]=qs['sort'](_0x16a60e[_0x3448('0x3a')][_0x3448('0x43')]);_0x22e28a[_0x3448('0x46')]=qs['filters'](_[_0x3448('0x44')](_0x16a60e[_0x3448('0x3a')],_0x165531[_0x3448('0x3c')]));if(_0x16a60e[_0x3448('0x3a')]['filter']){_0x22e28a[_0x3448('0x46')]=_[_0x3448('0x47')](_0x22e28a[_0x3448('0x46')],{'$or':_['map'](_0x22e28a[_0x3448('0x3e')],function(_0xbaef21){var _0x5663f6={};_0x5663f6[_0xbaef21]={'$like':'%'+_0x16a60e['query'][_0x3448('0x45')]+'%'};return _0x5663f6;})});}_0x22e28a=_[_0x3448('0x47')]({},_0x22e28a,_0x16a60e['options']);return _0x108d5c[_0x3448('0x93')](_0x22e28a);}})['then'](function(_0x58e1c8){if(_0x58e1c8){_0x4235bd=_0x58e1c8['length'];if(!_0x16a60e[_0x3448('0x3a')][_0x3448('0x40')](_0x3448('0x41'))){_0x22e28a['limit']=qs[_0x3448('0x24')](_0x16a60e[_0x3448('0x3a')]['limit']);_0x22e28a['offset']=qs[_0x3448('0x23')](_0x16a60e['query'][_0x3448('0x23')]);}return _0x108d5c[_0x3448('0x93')](_0x22e28a);}})[_0x3448('0x34')](function(_0x1a940e){if(_0x1a940e){return _0x1a940e?{'count':_0x4235bd,'rows':_0x1a940e}:null;}})[_0x3448('0x34')](respondWithResult(_0xc0f1c6,null))['catch'](handleError(_0xc0f1c6,null));};exports[_0x3448('0x94')]=function(_0x31b3a9,_0x425d18,_0x39ff7e){var _0x5aca15={};var _0x567715={};var _0x19bae9;var _0x48b2b4;return db[_0x3448('0x49')][_0x3448('0x5e')]({'where':{'id':_0x31b3a9[_0x3448('0x4d')]['id']}})[_0x3448('0x34')](handleEntityNotFound(_0x425d18,null))[_0x3448('0x34')](function(_0x6ae6b8){if(_0x6ae6b8){_0x19bae9=_0x6ae6b8;_0x567715['model']=_[_0x3448('0x3b')](db[_0x3448('0x75')][_0x3448('0x37')]);_0x567715[_0x3448('0x3a')]=_[_0x3448('0x3b')](_0x31b3a9[_0x3448('0x3a')]);_0x567715[_0x3448('0x3c')]=_[_0x3448('0x3d')](_0x567715[_0x3448('0x39')],_0x567715[_0x3448('0x3a')]);_0x5aca15[_0x3448('0x3e')]=_[_0x3448('0x3d')](_0x567715[_0x3448('0x39')],qs['fields'](_0x31b3a9[_0x3448('0x3a')][_0x3448('0x4e')]));_0x5aca15['attributes']=_0x5aca15[_0x3448('0x3e')]['length']?_0x5aca15['attributes']:_0x567715[_0x3448('0x39')];_0x5aca15[_0x3448('0x42')]=qs[_0x3448('0x43')](_0x31b3a9[_0x3448('0x3a')][_0x3448('0x43')]);_0x5aca15['where']=qs[_0x3448('0x3c')](_[_0x3448('0x44')](_0x31b3a9[_0x3448('0x3a')],_0x567715[_0x3448('0x3c')]));if(_0x31b3a9[_0x3448('0x3a')]['filter']){_0x5aca15[_0x3448('0x46')]=_[_0x3448('0x47')](_0x5aca15['where'],{'$or':_[_0x3448('0x2d')](_0x5aca15[_0x3448('0x3e')],function(_0x50deb3){var _0x53281={};_0x53281[_0x50deb3]={'$like':'%'+_0x31b3a9[_0x3448('0x3a')][_0x3448('0x45')]+'%'};return _0x53281;})});}_0x5aca15=_[_0x3448('0x47')]({},_0x5aca15,_0x31b3a9['options']);return _0x19bae9[_0x3448('0x94')](_0x5aca15);}})[_0x3448('0x34')](function(_0x440781){if(_0x440781){_0x48b2b4=_0x440781[_0x3448('0x3f')];if(!_0x31b3a9['query'][_0x3448('0x40')](_0x3448('0x41'))){_0x5aca15[_0x3448('0x24')]=qs['limit'](_0x31b3a9[_0x3448('0x3a')]['limit']);_0x5aca15[_0x3448('0x23')]=qs[_0x3448('0x23')](_0x31b3a9[_0x3448('0x3a')][_0x3448('0x23')]);}return _0x19bae9['getMembers'](_0x5aca15);}})['then'](function(_0x2c6986){return _0x2c6986?{'count':_0x48b2b4,'rows':_0x2c6986}:null;})[_0x3448('0x34')](respondWithResult(_0x425d18,null))[_0x3448('0x4c')](handleError(_0x425d18,null));};exports[_0x3448('0x95')]=function(_0x160ced,_0x32eee1,_0x2aabeb){var _0x4eeafc={};var _0xb0f388={};var _0x232c11;var _0x5715d8;return db[_0x3448('0x49')][_0x3448('0x5e')]({'where':{'id':_0x160ced[_0x3448('0x4d')]['id']}})[_0x3448('0x34')](handleEntityNotFound(_0x32eee1,null))[_0x3448('0x34')](function(_0x16e9a2){if(_0x16e9a2){_0x232c11=_0x16e9a2;_0xb0f388[_0x3448('0x39')]=_[_0x3448('0x3b')](db[_0x3448('0x96')]['rawAttributes']);_0xb0f388[_0x3448('0x3a')]=_[_0x3448('0x3b')](_0x160ced['query']);_0xb0f388[_0x3448('0x3c')]=_['intersection'](_0xb0f388[_0x3448('0x39')],_0xb0f388[_0x3448('0x3a')]);_0x4eeafc[_0x3448('0x3e')]=_[_0x3448('0x3d')](_0xb0f388[_0x3448('0x39')],qs[_0x3448('0x4e')](_0x160ced['query'][_0x3448('0x4e')]));_0x4eeafc[_0x3448('0x3e')]=_0x4eeafc['attributes'][_0x3448('0x3f')]?_0x4eeafc['attributes']:_0xb0f388[_0x3448('0x39')];_0x4eeafc['order']=qs['sort'](_0x160ced[_0x3448('0x3a')][_0x3448('0x43')]);_0x4eeafc[_0x3448('0x46')]=qs['filters'](_['pick'](_0x160ced[_0x3448('0x3a')],_0xb0f388[_0x3448('0x3c')]));if(_0x160ced['query']['filter']){_0x4eeafc[_0x3448('0x46')]=_['merge'](_0x4eeafc['where'],{'$or':_[_0x3448('0x2d')](_0x4eeafc[_0x3448('0x3e')],function(_0x5e1d0c){var _0x84d0ae={};_0x84d0ae[_0x5e1d0c]={'$like':'%'+_0x160ced[_0x3448('0x3a')][_0x3448('0x45')]+'%'};return _0x84d0ae;})});}_0x4eeafc=_['merge']({},_0x4eeafc,_0x160ced[_0x3448('0x48')]);return _0x232c11[_0x3448('0x95')](_0x4eeafc);}})['then'](function(_0x36c947){if(_0x36c947){_0x5715d8=_0x36c947[_0x3448('0x3f')];if(!_0x160ced[_0x3448('0x3a')][_0x3448('0x40')](_0x3448('0x41'))){_0x4eeafc[_0x3448('0x24')]=qs[_0x3448('0x24')](_0x160ced[_0x3448('0x3a')][_0x3448('0x24')]);_0x4eeafc[_0x3448('0x23')]=qs[_0x3448('0x23')](_0x160ced[_0x3448('0x3a')][_0x3448('0x23')]);}return _0x232c11[_0x3448('0x95')](_0x4eeafc);}})[_0x3448('0x34')](function(_0x1bf40f){if(_0x1bf40f){return _0x1bf40f?{'count':_0x5715d8,'rows':_0x1bf40f}:null;}})[_0x3448('0x34')](respondWithResult(_0x32eee1,null))[_0x3448('0x4c')](handleError(_0x32eee1,null));};exports[_0x3448('0x97')]=function(_0x1206e1,_0x56c9a1,_0x5b3efe){var _0x55740b,_0x578951;return db['VoiceQueue'][_0x3448('0x31')]({'where':{'id':_0x1206e1[_0x3448('0x4d')]['id']}})[_0x3448('0x34')](handleEntityNotFound(_0x56c9a1,null))[_0x3448('0x34')](function(_0x5ad129){if(_0x5ad129){_0x578951=_0x5ad129;return _0x5ad129['addLists'](_0x1206e1[_0x3448('0x5a')][_0x3448('0x7c')],_[_0x3448('0x98')](_0x1206e1[_0x3448('0x5a')],[_0x3448('0x7c'),'id'])||{});}return null;})[_0x3448('0x99')](function(_0x49c48c){var _0x57fdee;_0x55740b=_0x49c48c||[];var _0x3dc655=[];if(_0x49c48c){for(var _0x5bddd9=0x0;_0x5bddd9<_0x49c48c[_0x3448('0x3f')];_0x5bddd9+=0x1){var _0x130a2f=_0x49c48c[_0x5bddd9][_0x3448('0x28')]({'plain':!![]});_0x578951['dialCheckDuplicateType']=_0x1206e1[_0x3448('0x5a')]['dialCheckDuplicateType']?_0x1206e1[_0x3448('0x5a')]['dialCheckDuplicateType']:_0x578951[_0x3448('0x9a')];switch(_0x578951[_0x3448('0x9a')]){case _0x3448('0x9b'):_0x57fdee=squel[_0x3448('0x9c')]()['into']('cm_hopper')[_0x3448('0x9d')]([_0x3448('0x9e'),'scheduledAt',_0x3448('0x9f'),_0x3448('0xa0'),_0x3448('0x5f'),_0x3448('0x59'),'updatedAt'],squel[_0x3448('0x7d')]()['field'](_0x3448('0x9e'),'phone')[_0x3448('0x7e')](_0x3448('0xa1'),'scheduledAt')['field']('id',_0x3448('0x9f'))[_0x3448('0x7e')](_0x130a2f[_0x3448('0xa2')][_0x3448('0x87')](),_0x3448('0xa0'))[_0x3448('0x7e')](_0x1206e1[_0x3448('0x4d')]['id'][_0x3448('0x87')](),'VoiceQueueId')[_0x3448('0x7e')]('NOW()',_0x3448('0x59'))[_0x3448('0x7e')](_0x3448('0xa1'),_0x3448('0xa3'))['from'](_0x3448('0xa4'))['where']('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x130a2f['CmListId'][_0x3448('0x87')]())[_0x3448('0x46')](_0x3448('0xa5'))[_0x3448('0x46')](_0x3448('0xa6'),squel[_0x3448('0x7d')]()[_0x3448('0x7e')]('COALESCE(calleridnum,\x27\x27)')['from'](_0x3448('0xa7'))[_0x3448('0x46')]('VoiceQueueId\x20=\x20?',_0x1206e1[_0x3448('0x4d')]['id'][_0x3448('0x87')]()))[_0x3448('0x46')](_0x3448('0xa6'),squel[_0x3448('0x7d')]()[_0x3448('0x7e')](_0x3448('0xa8'))['from'](_0x3448('0xa9'))[_0x3448('0x46')](_0x3448('0x84'),_0x1206e1[_0x3448('0x4d')]['id'][_0x3448('0x87')]())))[_0x3448('0x87')]();break;case'onlyIfOpen':_0x57fdee=squel[_0x3448('0x9c')]()[_0x3448('0xaa')](_0x3448('0xa9'))[_0x3448('0x9d')]([_0x3448('0x9e'),_0x3448('0xab'),_0x3448('0x9f'),_0x3448('0xa0'),'VoiceQueueId','createdAt',_0x3448('0xa3')],squel[_0x3448('0x7d')]()[_0x3448('0x7e')]('phone',_0x3448('0x9e'))[_0x3448('0x7e')]('NOW()',_0x3448('0xab'))[_0x3448('0x7e')]('id',_0x3448('0x9f'))['field'](_0x130a2f[_0x3448('0xa2')][_0x3448('0x87')](),_0x3448('0xa0'))['field'](_0x1206e1[_0x3448('0x4d')]['id']['toString'](),_0x3448('0x5f'))[_0x3448('0x7e')]('NOW()',_0x3448('0x59'))[_0x3448('0x7e')](_0x3448('0xa1'),_0x3448('0xa3'))[_0x3448('0xac')](_0x3448('0xa4'))[_0x3448('0x46')](_0x3448('0xad'))[_0x3448('0x46')](_0x3448('0xae'),_0x130a2f['CmListId']['toString']())[_0x3448('0x46')](_0x3448('0xa5'))[_0x3448('0x46')](_0x3448('0xa6'),squel[_0x3448('0x7d')]()['field'](_0x3448('0xa8'))[_0x3448('0xac')](_0x3448('0xa9'))['where'](_0x3448('0x84'),_0x1206e1[_0x3448('0x4d')]['id'][_0x3448('0x87')]())))[_0x3448('0x87')]();break;default:_0x57fdee=squel['insert']()['into'](_0x3448('0xa9'))[_0x3448('0x9d')]([_0x3448('0x9e'),'scheduledAt',_0x3448('0x9f'),'ListId',_0x3448('0x5f'),_0x3448('0x59'),_0x3448('0xa3')],squel['select']()[_0x3448('0x7e')](_0x3448('0x9e'),_0x3448('0x9e'))[_0x3448('0x7e')]('NOW()',_0x3448('0xab'))[_0x3448('0x7e')]('id',_0x3448('0x9f'))['field'](_0x130a2f[_0x3448('0xa2')][_0x3448('0x87')](),'ListId')[_0x3448('0x7e')](_0x1206e1[_0x3448('0x4d')]['id'][_0x3448('0x87')](),_0x3448('0x5f'))[_0x3448('0x7e')](_0x3448('0xa1'),_0x3448('0x59'))[_0x3448('0x7e')]('NOW()',_0x3448('0xa3'))[_0x3448('0xac')]('cm_contacts')[_0x3448('0x46')](_0x3448('0xad'))[_0x3448('0x46')](_0x3448('0xae'),_0x130a2f[_0x3448('0xa2')][_0x3448('0x87')]())[_0x3448('0x46')](_0x3448('0xa5')))[_0x3448('0x87')]();}_0x3dc655['push'](db[_0x3448('0x6f')][_0x3448('0x3a')](_0x57fdee));}return BPromise['all'](_0x3dc655);}})[_0x3448('0x34')](function(){return _0x55740b;})[_0x3448('0x34')](respondWithResult(_0x56c9a1,null))[_0x3448('0x4c')](handleError(_0x56c9a1,null));};exports[_0x3448('0xaf')]=function(_0x2c441d,_0x5a7177,_0x226568){return db[_0x3448('0x49')][_0x3448('0x31')]({'where':{'id':_0x2c441d['params']['id']}})[_0x3448('0x34')](handleEntityNotFound(_0x5a7177,null))[_0x3448('0x34')](function(_0x3d0484){if(_0x3d0484){return _0x3d0484[_0x3448('0xaf')](_0x2c441d[_0x3448('0x3a')][_0x3448('0x7c')]);}})[_0x3448('0x34')](function(_0xbd3ab3){if(_0xbd3ab3){return db[_0x3448('0xb0')][_0x3448('0x27')]({'where':{'ListId':_0x2c441d[_0x3448('0x3a')][_0x3448('0x7c')],'VoiceQueueId':_0x2c441d[_0x3448('0x4d')]['id']}})[_0x3448('0x34')](function(){return _0xbd3ab3;});}})[_0x3448('0x34')](respondWithStatusCode(_0x5a7177,null))['catch'](handleError(_0x5a7177,null));};exports[_0x3448('0xb1')]=function(_0x57d8b7,_0x27eb4a,_0x3d0df6){var _0x340e03={};var _0x3e725e={};var _0x2e2ae9;var _0x20990c;return db[_0x3448('0x49')][_0x3448('0x5e')]({'where':{'id':_0x57d8b7[_0x3448('0x4d')]['id']}})['then'](handleEntityNotFound(_0x27eb4a,null))[_0x3448('0x34')](function(_0x26b2bb){if(_0x26b2bb){_0x2e2ae9=_0x26b2bb;_0x3e725e['model']=_[_0x3448('0x3b')](db[_0x3448('0x96')][_0x3448('0x37')]);_0x3e725e[_0x3448('0x3a')]=_[_0x3448('0x3b')](_0x57d8b7['query']);_0x3e725e[_0x3448('0x3c')]=_['intersection'](_0x3e725e[_0x3448('0x39')],_0x3e725e[_0x3448('0x3a')]);_0x340e03[_0x3448('0x3e')]=_[_0x3448('0x3d')](_0x3e725e[_0x3448('0x39')],qs[_0x3448('0x4e')](_0x57d8b7[_0x3448('0x3a')][_0x3448('0x4e')]));_0x340e03[_0x3448('0x3e')]=_0x340e03['attributes'][_0x3448('0x3f')]?_0x340e03['attributes']:_0x3e725e[_0x3448('0x39')];_0x340e03[_0x3448('0x42')]=qs[_0x3448('0x43')](_0x57d8b7['query']['sort']);_0x340e03['where']=qs['filters'](_[_0x3448('0x44')](_0x57d8b7['query'],_0x3e725e[_0x3448('0x3c')]));if(_0x57d8b7['query']['filter']){_0x340e03[_0x3448('0x46')]=_[_0x3448('0x47')](_0x340e03[_0x3448('0x46')],{'$or':_[_0x3448('0x2d')](_0x340e03[_0x3448('0x3e')],function(_0x577f17){var _0x1a5f62={};_0x1a5f62[_0x577f17]={'$like':'%'+_0x57d8b7[_0x3448('0x3a')][_0x3448('0x45')]+'%'};return _0x1a5f62;})});}_0x340e03=_[_0x3448('0x47')]({},_0x340e03,_0x57d8b7['options']);return _0x2e2ae9[_0x3448('0xb1')](_0x340e03);}})[_0x3448('0x34')](function(_0x4f6807){if(_0x4f6807){_0x20990c=_0x4f6807[_0x3448('0x3f')];if(!_0x57d8b7['query'][_0x3448('0x40')](_0x3448('0x41'))){_0x340e03[_0x3448('0x24')]=qs['limit'](_0x57d8b7['query']['limit']);_0x340e03['offset']=qs[_0x3448('0x23')](_0x57d8b7[_0x3448('0x3a')][_0x3448('0x23')]);}return _0x2e2ae9[_0x3448('0xb1')](_0x340e03);}})[_0x3448('0x34')](function(_0x3f6c64){if(_0x3f6c64){return _0x3f6c64?{'count':_0x20990c,'rows':_0x3f6c64}:null;}})[_0x3448('0x34')](respondWithResult(_0x27eb4a,null))['catch'](handleError(_0x27eb4a,null));};exports[_0x3448('0xb2')]=function(_0x3a7dca,_0x2eeb09,_0x5df9d4){var _0x7971ff,_0x5e47bf;return db[_0x3448('0x49')][_0x3448('0x31')]({'where':{'id':_0x3a7dca[_0x3448('0x4d')]['id']}})[_0x3448('0x34')](handleEntityNotFound(_0x2eeb09,null))['then'](function(_0x3cdfac){if(_0x3cdfac){_0x5e47bf=_0x3cdfac;return _0x3cdfac['addBlackLists'](_0x3a7dca[_0x3448('0x5a')]['ids'],_[_0x3448('0x98')](_0x3a7dca[_0x3448('0x5a')],[_0x3448('0x7c'),'id'])||{});}return null;})[_0x3448('0x99')](function(_0x5a233f){var _0x31811a;_0x7971ff=_0x5a233f||[];var _0x5cf4f2=[];if(_0x5a233f){for(var _0x1bc712=0x0;_0x1bc712<_0x5a233f[_0x3448('0x3f')];_0x1bc712+=0x1){var _0x4d7d26=_0x5a233f[_0x1bc712]['get']({'plain':!![]});_0x31811a=squel['insert']()[_0x3448('0xaa')](_0x3448('0xb3'))[_0x3448('0x9d')]([_0x3448('0x9e'),_0x3448('0x9f'),_0x3448('0xa0'),_0x3448('0x5f'),_0x3448('0x59'),_0x3448('0xa3')],squel[_0x3448('0x7d')]()[_0x3448('0x7e')](_0x3448('0x9e'),_0x3448('0x9e'))[_0x3448('0x7e')]('id',_0x3448('0x9f'))[_0x3448('0x7e')](_0x4d7d26['CmListId'][_0x3448('0x87')](),'ListId')['field'](_0x3a7dca[_0x3448('0x4d')]['id'][_0x3448('0x87')](),'VoiceQueueId')[_0x3448('0x7e')](_0x3448('0xa1'),_0x3448('0x59'))[_0x3448('0x7e')]('NOW()',_0x3448('0xa3'))['from'](_0x3448('0xa4'))[_0x3448('0x46')](_0x3448('0xad'))[_0x3448('0x46')](_0x3448('0xae'),_0x4d7d26['CmListId']['toString']())[_0x3448('0x46')](_0x3448('0xa5')))[_0x3448('0x87')]();_0x5cf4f2[_0x3448('0x86')](db['sequelize'][_0x3448('0x3a')](_0x31811a));}return BPromise['all'](_0x5cf4f2);}})['then'](function(){return _0x7971ff;})[_0x3448('0x34')](respondWithResult(_0x2eeb09,null))[_0x3448('0x4c')](handleError(_0x2eeb09,null));};exports[_0x3448('0xb4')]=function(_0x470a2e,_0x23af8b,_0x459c8c){return db[_0x3448('0x49')][_0x3448('0x31')]({'where':{'id':_0x470a2e[_0x3448('0x4d')]['id']}})['then'](handleEntityNotFound(_0x23af8b,null))['then'](function(_0x369d81){if(_0x369d81){return _0x369d81['removeBlackLists'](_0x470a2e[_0x3448('0x3a')][_0x3448('0x7c')]);}})[_0x3448('0x34')](function(_0xfc9b28){if(_0xfc9b28){return db[_0x3448('0x66')][_0x3448('0x27')]({'where':{'ListId':_0x470a2e[_0x3448('0x3a')]['ids'],'VoiceQueueId':_0x470a2e['params']['id']}})[_0x3448('0x34')](function(){return _0xfc9b28;});}})[_0x3448('0x34')](respondWithStatusCode(_0x23af8b,null))[_0x3448('0x4c')](handleError(_0x23af8b,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 0e42995..f43bc91 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 _0x1c5f=['emit','hasOwnProperty','hook','exports','events','VoiceQueue','setMaxListeners','update','remove'];(function(_0x49a57c,_0x2eb02c){var _0x4e0316=function(_0x37e2e5){while(--_0x37e2e5){_0x49a57c['push'](_0x49a57c['shift']());}};_0x4e0316(++_0x2eb02c);}(_0x1c5f,0x1ea));var _0xf1c5=function(_0x2ddb2f,_0x17ed63){_0x2ddb2f=_0x2ddb2f-0x0;var _0x352f4f=_0x1c5f[_0x2ddb2f];return _0x352f4f;};'use strict';var EventEmitter=require(_0xf1c5('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xf1c5('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xf1c5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf1c5('0x3'),'afterDestroy':_0xf1c5('0x4')};function emitEvent(_0x37d7ae){return function(_0x46aa8d,_0x4496ab,_0x378fb8){VoiceQueueEvents['emit'](_0x37d7ae+':'+_0x46aa8d['id'],_0x46aa8d);VoiceQueueEvents[_0xf1c5('0x5')](_0x37d7ae,_0x46aa8d);_0x378fb8(null);};}for(var e in events){if(events[_0xf1c5('0x6')](e)){var event=events[e];VoiceQueue[_0xf1c5('0x7')](e,emitEvent(event));}}module[_0xf1c5('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0xb36a=['exports','events','VoiceQueue','setMaxListeners','save','update','emit'];(function(_0x327c3b,_0xe64a30){var _0x54c097=function(_0x102e42){while(--_0x102e42){_0x327c3b['push'](_0x327c3b['shift']());}};_0x54c097(++_0xe64a30);}(_0xb36a,0x8d));var _0xab36=function(_0x28a721,_0xefe5b5){_0x28a721=_0x28a721-0x0;var _0x1d0b5f=_0xb36a[_0x28a721];return _0x1d0b5f;};'use strict';var EventEmitter=require(_0xab36('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xab36('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xab36('0x2')](0x0);var events={'afterCreate':_0xab36('0x3'),'afterUpdate':_0xab36('0x4'),'afterDestroy':'remove'};function emitEvent(_0x417308){return function(_0x5b9d73,_0x36368a,_0x2a2213){VoiceQueueEvents['emit'](_0x417308+':'+_0x5b9d73['id'],_0x5b9d73);VoiceQueueEvents[_0xab36('0x5')](_0x417308,_0x5b9d73);_0x2a2213(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xab36('0x6')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index dce1d5b..e36fd90 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 _0x7706=['voice_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','VoiceQueue'];(function(_0x28394f,_0x5ebdd2){var _0x2618d2=function(_0x2ffed6){while(--_0x2ffed6){_0x28394f['push'](_0x28394f['shift']());}};_0x2618d2(++_0x5ebdd2);}(_0x7706,0x85));var _0x6770=function(_0x49d320,_0x50a5c7){_0x49d320=_0x49d320-0x0;var _0x478006=_0x7706[_0x49d320];return _0x478006;};'use strict';var _=require(_0x6770('0x0'));var util=require(_0x6770('0x1'));var logger=require(_0x6770('0x2'))('api');var moment=require(_0x6770('0x3'));var BPromise=require(_0x6770('0x4'));var rp=require(_0x6770('0x5'));var fs=require('fs');var path=require(_0x6770('0x6'));var rimraf=require(_0x6770('0x7'));var config=require(_0x6770('0x8'));var attributes=require('./voiceQueue.attributes');module['exports']=function(_0x1d23f2,_0x250864){return _0x1d23f2[_0x6770('0x9')](_0x6770('0xa'),attributes,{'tableName':_0x6770('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9180=['VoiceQueue','voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueue.attributes'];(function(_0x3a718c,_0x1f168e){var _0x591931=function(_0x1f32ea){while(--_0x1f32ea){_0x3a718c['push'](_0x3a718c['shift']());}};_0x591931(++_0x1f168e);}(_0x9180,0x146));var _0x0918=function(_0x1564bd,_0xe477c4){_0x1564bd=_0x1564bd-0x0;var _0x38dc93=_0x9180[_0x1564bd];return _0x38dc93;};'use strict';var _=require(_0x0918('0x0'));var util=require(_0x0918('0x1'));var logger=require(_0x0918('0x2'))(_0x0918('0x3'));var moment=require(_0x0918('0x4'));var BPromise=require(_0x0918('0x5'));var rp=require(_0x0918('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0918('0x7'));var config=require(_0x0918('0x8'));var attributes=require(_0x0918('0x9'));module['exports']=function(_0x3aed91,_0x352ed5){return _0x3aed91['define'](_0x0918('0xa'),attributes,{'tableName':_0x0918('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 7b6d099..89be885 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 _0x20ab=['rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','map','include','model','ShowVoiceQueue','find','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5ff517,_0x3e4ee0){var _0x19a245=function(_0x4c00ac){while(--_0x4c00ac){_0x5ff517['push'](_0x5ff517['shift']());}};_0x19a245(++_0x3e4ee0);}(_0x20ab,0x142));var _0xb20a=function(_0x269fba,_0xa68777){_0x269fba=_0x269fba-0x0;var _0x1eeb74=_0x20ab[_0x269fba];return _0x1eeb74;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb20a('0x0'));var BPromise=require(_0xb20a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb20a('0x2'));var db=require(_0xb20a('0x3'))['db'];var utils=require(_0xb20a('0x4'));var logger=require(_0xb20a('0x5'))(_0xb20a('0x6'));var config=require(_0xb20a('0x7'));var jayson=require(_0xb20a('0x8'));var client=jayson[_0xb20a('0x9')]['http']({'port':0x232a});config[_0xb20a('0xa')]=_[_0xb20a('0xb')](config[_0xb20a('0xa')],{'host':_0xb20a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb20a('0xa')]));require(_0xb20a('0xd'))[_0xb20a('0xe')](socket);function respondWithRpcPromise(_0x3c35fe,_0x3aa93f,_0xfa8277){return new BPromise(function(_0x57dc19,_0x45d170){return client[_0xb20a('0xf')](_0x3c35fe,_0xfa8277)[_0xb20a('0x10')](function(_0x4af158){logger['info'](_0xb20a('0x11'),_0x3aa93f,_0xb20a('0x12'));logger[_0xb20a('0x13')](_0xb20a('0x14'),_0x3aa93f,'request\x20sent',JSON[_0xb20a('0x15')](_0x4af158));if(_0x4af158[_0xb20a('0x16')]){if(_0x4af158[_0xb20a('0x16')][_0xb20a('0x17')]===0x1f4){logger[_0xb20a('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x3aa93f,_0x4af158[_0xb20a('0x16')][_0xb20a('0x18')]);return _0x45d170(_0x4af158[_0xb20a('0x16')][_0xb20a('0x18')]);}logger['error']('VoiceQueue,\x20%s,\x20%s',_0x3aa93f,_0x4af158[_0xb20a('0x16')][_0xb20a('0x18')]);return _0x57dc19(_0x4af158[_0xb20a('0x16')][_0xb20a('0x18')]);}else{logger[_0xb20a('0x19')]('VoiceQueue,\x20%s,\x20%s',_0x3aa93f,_0xb20a('0x12'));_0x57dc19(_0x4af158[_0xb20a('0x1a')]['message']);}})[_0xb20a('0x1b')](function(_0x5b8af5){logger[_0xb20a('0x16')](_0xb20a('0x11'),_0x3aa93f,_0x5b8af5);_0x45d170(_0x5b8af5);});});}exports[_0xb20a('0x1c')]=function(_0x5833d1){var _0x520704=this;return new Promise(function(_0x498008,_0x2315ce){return db[_0xb20a('0x1d')][_0xb20a('0x1e')]({'raw':_0x5833d1[_0xb20a('0x1f')]?_0x5833d1['options'][_0xb20a('0x20')]===undefined?!![]:![]:!![],'where':_0x5833d1[_0xb20a('0x1f')]?_0x5833d1[_0xb20a('0x1f')][_0xb20a('0x21')]||null:null,'attributes':_0x5833d1[_0xb20a('0x1f')]?_0x5833d1['options'][_0xb20a('0x22')]||null:null,'limit':_0x5833d1[_0xb20a('0x1f')]?_0x5833d1[_0xb20a('0x1f')][_0xb20a('0x23')]||null:null,'include':_0x5833d1[_0xb20a('0x1f')]?_0x5833d1[_0xb20a('0x1f')]['include']?_[_0xb20a('0x24')](_0x5833d1['options'][_0xb20a('0x25')],function(_0x323ff7){return{'model':db[_0x323ff7[_0xb20a('0x26')]],'as':_0x323ff7['as'],'attributes':_0x323ff7[_0xb20a('0x22')],'include':_0x323ff7[_0xb20a('0x25')]?_[_0xb20a('0x24')](_0x323ff7[_0xb20a('0x25')],function(_0x51af1d){return{'model':db[_0x51af1d['model']],'as':_0x51af1d['as'],'attributes':_0x51af1d[_0xb20a('0x22')],'include':_0x51af1d[_0xb20a('0x25')]?_[_0xb20a('0x24')](_0x51af1d[_0xb20a('0x25')],function(_0x43bb83){return{'model':db[_0x43bb83['model']],'as':_0x43bb83['as'],'attributes':_0x43bb83[_0xb20a('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb20a('0x10')](function(_0x5e4ca7){logger[_0xb20a('0x19')](_0xb20a('0x1c'),_0x5833d1);logger['debug'](_0xb20a('0x1c'),_0x5833d1,JSON[_0xb20a('0x15')](_0x5e4ca7));_0x498008(_0x5e4ca7);})[_0xb20a('0x1b')](function(_0x40dee3){logger[_0xb20a('0x16')](_0xb20a('0x1c'),_0x40dee3['message'],_0x5833d1);_0x2315ce(_0x520704[_0xb20a('0x16')](0x1f4,_0x40dee3[_0xb20a('0x18')]));});});};exports[_0xb20a('0x27')]=function(_0x5b1ad3){var _0x19ab40=this;return new Promise(function(_0x2dadf9,_0x1e0ca9){return db[_0xb20a('0x1d')][_0xb20a('0x28')]({'raw':_0x5b1ad3[_0xb20a('0x1f')]?_0x5b1ad3[_0xb20a('0x1f')][_0xb20a('0x20')]===undefined?!![]:![]:!![],'where':_0x5b1ad3[_0xb20a('0x1f')]?_0x5b1ad3[_0xb20a('0x1f')]['where']||null:null,'attributes':_0x5b1ad3[_0xb20a('0x1f')]?_0x5b1ad3[_0xb20a('0x1f')][_0xb20a('0x22')]||null:null,'include':_0x5b1ad3[_0xb20a('0x1f')]?_0x5b1ad3['options'][_0xb20a('0x25')]?_[_0xb20a('0x24')](_0x5b1ad3[_0xb20a('0x1f')]['include'],function(_0x382ccb){return{'model':db[_0x382ccb['model']],'as':_0x382ccb['as'],'attributes':_0x382ccb[_0xb20a('0x22')],'include':_0x382ccb[_0xb20a('0x25')]?_[_0xb20a('0x24')](_0x382ccb['include'],function(_0xf01ad3){return{'model':db[_0xf01ad3[_0xb20a('0x26')]],'as':_0xf01ad3['as'],'attributes':_0xf01ad3[_0xb20a('0x22')],'include':_0xf01ad3[_0xb20a('0x25')]?_['map'](_0xf01ad3['include'],function(_0x366c4b){return{'model':db[_0x366c4b[_0xb20a('0x26')]],'as':_0x366c4b['as'],'attributes':_0x366c4b[_0xb20a('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb20a('0x10')](function(_0x43a03f){logger[_0xb20a('0x19')]('ShowVoiceQueue',_0x5b1ad3);logger[_0xb20a('0x13')](_0xb20a('0x27'),_0x5b1ad3,JSON[_0xb20a('0x15')](_0x43a03f));_0x2dadf9(_0x43a03f);})[_0xb20a('0x1b')](function(_0x3d52fc){logger['error'](_0xb20a('0x27'),_0x3d52fc[_0xb20a('0x18')],_0x5b1ad3);_0x1e0ca9(_0x19ab40[_0xb20a('0x16')](0x1f4,_0x3d52fc[_0xb20a('0x18')]));});});}; \ No newline at end of file +var _0x1c67=['redis','localhost','socket.io-emitter','./voiceQueue.socket','register','then','info','request\x20sent','debug','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','result','catch','VoiceQueue','options','raw','attributes','limit','include','map','model','GetVoiceQueue','ShowVoiceQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x1c67,0xe4));var _0x71c6=function(_0x5b5161,_0x402fe7){_0x5b5161=_0x5b5161-0x0;var _0x45fb29=_0x1c67[_0x5b5161];return _0x45fb29;};'use strict';var _=require(_0x71c6('0x0'));var util=require(_0x71c6('0x1'));var moment=require(_0x71c6('0x2'));var BPromise=require(_0x71c6('0x3'));var rs=require(_0x71c6('0x4'));var fs=require('fs');var Redis=require(_0x71c6('0x5'));var db=require(_0x71c6('0x6'))['db'];var utils=require(_0x71c6('0x7'));var logger=require('../../config/logger')(_0x71c6('0x8'));var config=require(_0x71c6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x71c6('0xa')][_0x71c6('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x71c6('0xc')],{'host':_0x71c6('0xd'),'port':0x18eb});var socket=require(_0x71c6('0xe'))(new Redis(config[_0x71c6('0xc')]));require(_0x71c6('0xf'))[_0x71c6('0x10')](socket);function respondWithRpcPromise(_0x5dba12,_0x1496b5,_0x3bc73e){return new BPromise(function(_0x39ff23,_0x41f435){return client['request'](_0x5dba12,_0x3bc73e)[_0x71c6('0x11')](function(_0x1b289d){logger[_0x71c6('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x1496b5,_0x71c6('0x13'));logger[_0x71c6('0x14')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x1496b5,'request\x20sent',JSON[_0x71c6('0x15')](_0x1b289d));if(_0x1b289d['error']){if(_0x1b289d[_0x71c6('0x16')][_0x71c6('0x17')]===0x1f4){logger[_0x71c6('0x16')](_0x71c6('0x18'),_0x1496b5,_0x1b289d[_0x71c6('0x16')][_0x71c6('0x19')]);return _0x41f435(_0x1b289d['error'][_0x71c6('0x19')]);}logger['error'](_0x71c6('0x18'),_0x1496b5,_0x1b289d[_0x71c6('0x16')]['message']);return _0x39ff23(_0x1b289d[_0x71c6('0x16')][_0x71c6('0x19')]);}else{logger['info'](_0x71c6('0x18'),_0x1496b5,'request\x20sent');_0x39ff23(_0x1b289d[_0x71c6('0x1a')][_0x71c6('0x19')]);}})[_0x71c6('0x1b')](function(_0x1b352e){logger[_0x71c6('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x1496b5,_0x1b352e);_0x41f435(_0x1b352e);});});}exports['GetVoiceQueue']=function(_0x1b520d){var _0xafc8be=this;return new Promise(function(_0x548302,_0x48abd8){return db[_0x71c6('0x1c')]['findAll']({'raw':_0x1b520d[_0x71c6('0x1d')]?_0x1b520d[_0x71c6('0x1d')][_0x71c6('0x1e')]===undefined?!![]:![]:!![],'where':_0x1b520d[_0x71c6('0x1d')]?_0x1b520d[_0x71c6('0x1d')]['where']||null:null,'attributes':_0x1b520d['options']?_0x1b520d[_0x71c6('0x1d')][_0x71c6('0x1f')]||null:null,'limit':_0x1b520d['options']?_0x1b520d['options'][_0x71c6('0x20')]||null:null,'include':_0x1b520d['options']?_0x1b520d[_0x71c6('0x1d')]['include']?_['map'](_0x1b520d[_0x71c6('0x1d')][_0x71c6('0x21')],function(_0x474333){return{'model':db[_0x474333['model']],'as':_0x474333['as'],'attributes':_0x474333['attributes'],'include':_0x474333[_0x71c6('0x21')]?_[_0x71c6('0x22')](_0x474333[_0x71c6('0x21')],function(_0x3f2220){return{'model':db[_0x3f2220['model']],'as':_0x3f2220['as'],'attributes':_0x3f2220[_0x71c6('0x1f')],'include':_0x3f2220['include']?_[_0x71c6('0x22')](_0x3f2220['include'],function(_0x30382a){return{'model':db[_0x30382a[_0x71c6('0x23')]],'as':_0x30382a['as'],'attributes':_0x30382a[_0x71c6('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x232775){logger[_0x71c6('0x12')](_0x71c6('0x24'),_0x1b520d);logger[_0x71c6('0x14')]('GetVoiceQueue',_0x1b520d,JSON['stringify'](_0x232775));_0x548302(_0x232775);})[_0x71c6('0x1b')](function(_0x2b2168){logger[_0x71c6('0x16')](_0x71c6('0x24'),_0x2b2168[_0x71c6('0x19')],_0x1b520d);_0x48abd8(_0xafc8be['error'](0x1f4,_0x2b2168['message']));});});};exports[_0x71c6('0x25')]=function(_0x50df2){var _0x95caf7=this;return new Promise(function(_0x58187c,_0x5e9d41){return db[_0x71c6('0x1c')][_0x71c6('0x26')]({'raw':_0x50df2['options']?_0x50df2[_0x71c6('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x50df2[_0x71c6('0x1d')]?_0x50df2['options'][_0x71c6('0x27')]||null:null,'attributes':_0x50df2[_0x71c6('0x1d')]?_0x50df2[_0x71c6('0x1d')][_0x71c6('0x1f')]||null:null,'include':_0x50df2[_0x71c6('0x1d')]?_0x50df2[_0x71c6('0x1d')][_0x71c6('0x21')]?_[_0x71c6('0x22')](_0x50df2['options']['include'],function(_0xbcf080){return{'model':db[_0xbcf080[_0x71c6('0x23')]],'as':_0xbcf080['as'],'attributes':_0xbcf080[_0x71c6('0x1f')],'include':_0xbcf080[_0x71c6('0x21')]?_[_0x71c6('0x22')](_0xbcf080['include'],function(_0xadaa84){return{'model':db[_0xadaa84['model']],'as':_0xadaa84['as'],'attributes':_0xadaa84['attributes'],'include':_0xadaa84['include']?_[_0x71c6('0x22')](_0xadaa84[_0x71c6('0x21')],function(_0x25c3ed){return{'model':db[_0x25c3ed['model']],'as':_0x25c3ed['as'],'attributes':_0x25c3ed['attributes']};}):[]};}):[]};}):[]:[]})[_0x71c6('0x11')](function(_0x147ee7){logger[_0x71c6('0x12')](_0x71c6('0x25'),_0x50df2);logger['debug'](_0x71c6('0x25'),_0x50df2,JSON[_0x71c6('0x15')](_0x147ee7));_0x58187c(_0x147ee7);})[_0x71c6('0x1b')](function(_0x435adc){logger[_0x71c6('0x16')](_0x71c6('0x25'),_0x435adc[_0x71c6('0x19')],_0x50df2);_0x5e9d41(_0x95caf7[_0x71c6('0x16')](0x1f4,_0x435adc[_0x71c6('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 660a0c3..4e99a24 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 _0xa8e2=['update','emit','removeListener','register','length','save','remove'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa8e2,0xa6));var _0x2a8e=function(_0x32e44f,_0x20542c){_0x32e44f=_0x32e44f-0x0;var _0x5d3ae8=_0xa8e2[_0x32e44f];return _0x5d3ae8;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x2a8e('0x0'),_0x2a8e('0x1'),_0x2a8e('0x2')];function createListener(_0x15738,_0x582474){return function(_0x59a4d7){_0x582474[_0x2a8e('0x3')](_0x15738,_0x59a4d7);};}function removeListener(_0x3c742a,_0x4ba93d){return function(){VoiceQueueEvents[_0x2a8e('0x4')](_0x3c742a,_0x4ba93d);};}exports[_0x2a8e('0x5')]=function(_0x13e7ea){for(var _0xbe3722=0x0,_0x2dc3cf=events[_0x2a8e('0x6')];_0xbe3722<_0x2dc3cf;_0xbe3722++){var _0x1c5bd6=events[_0xbe3722];var _0x53abad=createListener('voiceQueue:'+_0x1c5bd6,_0x13e7ea);VoiceQueueEvents['on'](_0x1c5bd6,_0x53abad);}}; \ No newline at end of file +var _0x093b=['update','register','length','save','remove'];(function(_0x11eae9,_0x21d42e){var _0x91aa03=function(_0x54c222){while(--_0x54c222){_0x11eae9['push'](_0x11eae9['shift']());}};_0x91aa03(++_0x21d42e);}(_0x093b,0x80));var _0xb093=function(_0x28c939,_0x110e29){_0x28c939=_0x28c939-0x0;var _0x527fe9=_0x093b[_0x28c939];return _0x527fe9;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xb093('0x0'),_0xb093('0x1'),_0xb093('0x2')];function createListener(_0x15c6d7,_0x4f180b){return function(_0x3d4290){_0x4f180b['emit'](_0x15c6d7,_0x3d4290);};}function removeListener(_0x577b71,_0x14228f){return function(){VoiceQueueEvents['removeListener'](_0x577b71,_0x14228f);};}exports[_0xb093('0x3')]=function(_0x28ea96){for(var _0x281993=0x0,_0x50aff9=events[_0xb093('0x4')];_0x281993<_0x50aff9;_0x281993++){var _0x3e0b73=events[_0x281993];var _0x416beb=createListener('voiceQueue:'+_0x3e0b73,_0x28ea96);VoiceQueueEvents['on'](_0x3e0b73,_0x416beb);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 74177b5..073aafb 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 _0x8af6=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','get','/describe','describe','/index','/:id','post','create','put','exports','multer','util'];(function(_0x586937,_0x2e0632){var _0x2cfdc3=function(_0x344c2b){while(--_0x344c2b){_0x586937['push'](_0x586937['shift']());}};_0x2cfdc3(++_0x2e0632);}(_0x8af6,0x76));var _0x68af=function(_0x4edc56,_0x5f54de){_0x4edc56=_0x4edc56-0x0;var _0x3d0aca=_0x8af6[_0x4edc56];return _0x3d0aca;};'use strict';var multer=require(_0x68af('0x0'));var util=require(_0x68af('0x1'));var path=require(_0x68af('0x2'));var timeout=require(_0x68af('0x3'));var express=require(_0x68af('0x4'));var router=express[_0x68af('0x5')]();var auth=require(_0x68af('0x6'));var interaction=require(_0x68af('0x7'));var config=require(_0x68af('0x8'));var controller=require(_0x68af('0x9'));router['get']('/',auth[_0x68af('0xa')](),controller['index']);router[_0x68af('0xb')](_0x68af('0xc'),auth[_0x68af('0xa')](),controller[_0x68af('0xd')]);router[_0x68af('0xb')](_0x68af('0xe'),auth[_0x68af('0xa')](),controller['getVoiceQueuesReport']);router['get'](_0x68af('0xf'),auth[_0x68af('0xa')](),controller['show']);router[_0x68af('0x10')]('/',auth[_0x68af('0xa')](),controller[_0x68af('0x11')]);router[_0x68af('0x12')](_0x68af('0xf'),auth[_0x68af('0xa')](),controller['update']);router['delete'](_0x68af('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x68af('0x13')]=router; \ No newline at end of file +var _0xa751=['./voiceQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa751,0x175));var _0x1a75=function(_0x397cb8,_0x1b4984){_0x397cb8=_0x397cb8-0x0;var _0x32e074=_0xa751[_0x397cb8];return _0x32e074;};'use strict';var multer=require(_0x1a75('0x0'));var util=require(_0x1a75('0x1'));var path=require(_0x1a75('0x2'));var timeout=require(_0x1a75('0x3'));var express=require('express');var router=express[_0x1a75('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x1a75('0x5'));var config=require(_0x1a75('0x6'));var controller=require(_0x1a75('0x7'));router['get']('/',auth[_0x1a75('0x8')](),controller[_0x1a75('0x9')]);router[_0x1a75('0xa')](_0x1a75('0xb'),auth[_0x1a75('0x8')](),controller[_0x1a75('0xc')]);router[_0x1a75('0xa')]('/index',auth['isAuthenticated'](),controller['getVoiceQueuesReport']);router[_0x1a75('0xa')](_0x1a75('0xd'),auth[_0x1a75('0x8')](),controller[_0x1a75('0xe')]);router[_0x1a75('0xf')]('/',auth[_0x1a75('0x8')](),controller[_0x1a75('0x10')]);router[_0x1a75('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1a75('0x12')](_0x1a75('0xd'),auth[_0x1a75('0x8')](),controller[_0x1a75('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index abe52af..c357292 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 _0xfaeb=['sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','queuecallerleaveAt','setDataValue','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x40ddc0,_0x41c082){var _0x1aebf1=function(_0x3ba1f6){while(--_0x3ba1f6){_0x40ddc0['push'](_0x40ddc0['shift']());}};_0x1aebf1(++_0x41c082);}(_0xfaeb,0x1a4));var _0xbfae=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xfaeb[_0x11ce46];return _0x368a1e;};'use strict';var Sequelize=require(_0xbfae('0x0'));var moment=require(_0xbfae('0x1'));module[_0xbfae('0x2')]={'type':{'type':Sequelize[_0xbfae('0x3')]},'uniqueid':{'type':Sequelize[_0xbfae('0x3')]},'calleridnum':{'type':Sequelize[_0xbfae('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xbfae('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xbfae('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xbfae('0x4')],'set':function(_0x31206c){var _0x26143c=moment(_0x31206c);var _0x2d2c62=moment(this[_0xbfae('0x5')](_0xbfae('0x6')))[_0xbfae('0x7')](_0xbfae('0x8'));var _0x75465d=_0x26143c['diff'](_0x2d2c62,'seconds');this['setDataValue'](_0xbfae('0x9'),_0x31206c);this[_0xbfae('0xa')]('holdtime',_0x75465d||null);}},'position':{'type':Sequelize[_0xbfae('0xb')]},'count':{'type':Sequelize[_0xbfae('0xb')]},'queuecallerabandon':{'type':Sequelize[_0xbfae('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xbfae('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xbfae('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xbfae('0x4')]},'queuecallerexit':{'type':Sequelize[_0xbfae('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xbfae('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xbfae('0xd')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xbfae('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xbfae('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xbfae('0x3')]},'exten':{'type':Sequelize[_0xbfae('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xbfae('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xbfae('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xbfae('0x3')]},'transfer':{'type':Sequelize[_0xbfae('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xbfae('0xe')},'transferexten':{'type':Sequelize[_0xbfae('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xbfae('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xbfae('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0c80=['BOOLEAN','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'];(function(_0x18aafc,_0x5e8911){var _0x175550=function(_0x408de3){while(--_0x408de3){_0x18aafc['push'](_0x18aafc['shift']());}};_0x175550(++_0x5e8911);}(_0x0c80,0x7a));var _0x00c8=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x0c80[_0x5c2e3e];return _0x53f64a;};'use strict';var Sequelize=require(_0x00c8('0x0'));var moment=require(_0x00c8('0x1'));module[_0x00c8('0x2')]={'type':{'type':Sequelize[_0x00c8('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x00c8('0x3')]},'calleridname':{'type':Sequelize[_0x00c8('0x3')]},'queue':{'type':Sequelize[_0x00c8('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x00c8('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x00c8('0x4')],'set':function(_0x32a646){var _0xed8c47=moment(_0x32a646);var _0x1c76ae=moment(this[_0x00c8('0x5')](_0x00c8('0x6')))[_0x00c8('0x7')](_0x00c8('0x8'));var _0x30ad72=_0xed8c47[_0x00c8('0x9')](_0x1c76ae,'seconds');this[_0x00c8('0xa')](_0x00c8('0xb'),_0x32a646);this[_0x00c8('0xa')](_0x00c8('0xc'),_0x30ad72||null);}},'position':{'type':Sequelize[_0x00c8('0xd')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x00c8('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x00c8('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x00c8('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x00c8('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x00c8('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x00c8('0x3')],'comment':_0x00c8('0xf')},'originalposition':{'type':Sequelize[_0x00c8('0xd')]},'channel':{'type':Sequelize[_0x00c8('0x3')]},'connectedlinenum':{'type':Sequelize[_0x00c8('0x3')]},'connectedlinename':{'type':Sequelize[_0x00c8('0x3')]},'accountcode':{'type':Sequelize[_0x00c8('0x3')]},'context':{'type':Sequelize[_0x00c8('0x3')]},'exten':{'type':Sequelize[_0x00c8('0x3')]},'priority':{'type':Sequelize[_0x00c8('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x00c8('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x00c8('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x00c8('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x00c8('0x10')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x00c8('0x3')]},'disposition':{'type':Sequelize[_0x00c8('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x00c8('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 551ba9c..074668e 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 _0xdb28=['merge','VIRTUAL','filter','options','VoiceQueueReport','count','include','catch','show','rawAttributes','includeAll','find','create','body','params','destroy','describe','getVoiceQueuesReport','rows','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./voiceQueueReport.socket','register','sendStatus','status','end','offset','limit','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters'];(function(_0x33a232,_0xabbf43){var _0x5530f6=function(_0x208d2d){while(--_0x208d2d){_0x33a232['push'](_0x33a232['shift']());}};_0x5530f6(++_0xabbf43);}(_0xdb28,0x106));var _0x8db2=function(_0x1a9e0e,_0x276691){_0x1a9e0e=_0x1a9e0e-0x0;var _0x2617fb=_0xdb28[_0x1a9e0e];return _0x2617fb;};'use strict';var pdf=require(_0x8db2('0x0'));var emlformat=require(_0x8db2('0x1'));var rimraf=require(_0x8db2('0x2'));var zipdir=require(_0x8db2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8db2('0x4'));var moment=require(_0x8db2('0x5'));var BPromise=require(_0x8db2('0x6'));var Mustache=require(_0x8db2('0x7'));var util=require(_0x8db2('0x8'));var path=require('path');var sox=require(_0x8db2('0x9'));var csv=require(_0x8db2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0xa'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var db=require(_0x8db2('0x17'))['db'];config[_0x8db2('0x18')]=_[_0x8db2('0x19')](config[_0x8db2('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8db2('0x18')]));require(_0x8db2('0x1a'))[_0x8db2('0x1b')](socket);function respondWithStatusCode(_0x1d6a15,_0x227355){_0x227355=_0x227355||0xcc;return function(_0xfa285b){if(_0xfa285b){return _0x1d6a15[_0x8db2('0x1c')](_0x227355);}return _0x1d6a15[_0x8db2('0x1d')](_0x227355)[_0x8db2('0x1e')]();};}function respondWithResult(_0x16c8c2,_0x5489a9){_0x5489a9=_0x5489a9||0xc8;return function(_0x13b0f5){if(_0x13b0f5){return _0x16c8c2[_0x8db2('0x1d')](_0x5489a9)['json'](_0x13b0f5);}};}function respondWithFilteredResult(_0x2b3f73,_0x44957d){return function(_0x21db8c){if(_0x21db8c){var _0x3fddc2=_0x21db8c['count'],_0x2efd06=_0x44957d[_0x8db2('0x1f')],_0x46ce14=_0x44957d[_0x8db2('0x1f')]+_0x44957d[_0x8db2('0x20')],_0x51d60d;if(_0x46ce14>=_0x3fddc2){_0x46ce14=_0x3fddc2;_0x51d60d=0xc8;}else{_0x51d60d=0xce;}_0x2b3f73[_0x8db2('0x1d')](_0x51d60d);return _0x2b3f73['set'](_0x8db2('0x21'),_0x2efd06+'-'+_0x46ce14+'/'+_0x3fddc2)[_0x8db2('0x22')](_0x21db8c);}return null;};}function patchUpdates(_0x260940){return function(_0x297ba3){try{jsonpatch[_0x8db2('0x23')](_0x297ba3,_0x260940,!![]);}catch(_0x597260){return BPromise[_0x8db2('0x24')](_0x597260);}return _0x297ba3[_0x8db2('0x25')]();};}function saveUpdates(_0x18f69c,_0x125be2){return function(_0x2260d8){if(_0x2260d8){return _0x2260d8[_0x8db2('0x26')](_0x18f69c)[_0x8db2('0x27')](function(_0x5c6614){return _0x5c6614;});}return null;};}function removeEntity(_0x256202,_0x4f6516){return function(_0x5725f0){if(_0x5725f0){return _0x5725f0['destroy']()['then'](function(){_0x256202[_0x8db2('0x1d')](0xcc)[_0x8db2('0x1e')]();});}};}function handleEntityNotFound(_0x3be281,_0x2baed0){return function(_0x145328){if(!_0x145328){_0x3be281[_0x8db2('0x1c')](0x194);}return _0x145328;};}function handleError(_0x58cd9d,_0x3544ba){_0x3544ba=_0x3544ba||0x1f4;return function(_0x372311){logger[_0x8db2('0x28')](_0x372311[_0x8db2('0x29')]);if(_0x372311['name']){delete _0x372311[_0x8db2('0x2a')];}_0x58cd9d[_0x8db2('0x1d')](_0x3544ba)[_0x8db2('0x2b')](_0x372311);};}exports[_0x8db2('0x2c')]=function(_0xbe5ece,_0x21bae5){var _0xa54ea3={},_0x3124d5={},_0xbc5366={'count':0x0,'rows':[]};var _0x493cab=_[_0x8db2('0x2d')](db['VoiceQueueReport']['rawAttributes'],function(_0x302188){return{'name':_0x302188[_0x8db2('0x2e')],'type':_0x302188[_0x8db2('0x2f')]['key']};});_0x3124d5[_0x8db2('0x30')]=_['map'](_0x493cab,_0x8db2('0x2a'));_0x3124d5[_0x8db2('0x31')]=_[_0x8db2('0x32')](_0xbe5ece['query']);_0x3124d5['filters']=_[_0x8db2('0x33')](_0x3124d5[_0x8db2('0x30')],_0x3124d5['query']);_0xa54ea3['attributes']=_[_0x8db2('0x33')](_0x3124d5[_0x8db2('0x30')],qs[_0x8db2('0x34')](_0xbe5ece[_0x8db2('0x31')][_0x8db2('0x34')]));_0xa54ea3[_0x8db2('0x35')]=_0xa54ea3[_0x8db2('0x35')][_0x8db2('0x36')]?_0xa54ea3[_0x8db2('0x35')]:_0x3124d5[_0x8db2('0x30')];if(!_0xbe5ece['query'][_0x8db2('0x37')](_0x8db2('0x38'))){_0xa54ea3['limit']=qs[_0x8db2('0x20')](_0xbe5ece[_0x8db2('0x31')]['limit']);_0xa54ea3['offset']=qs[_0x8db2('0x1f')](_0xbe5ece['query'][_0x8db2('0x1f')]);}_0xa54ea3[_0x8db2('0x39')]=qs[_0x8db2('0x3a')](_0xbe5ece[_0x8db2('0x31')]['sort']);_0xa54ea3[_0x8db2('0x3b')]=qs['filters'](_[_0x8db2('0x3c')](_0xbe5ece[_0x8db2('0x31')],_0x3124d5[_0x8db2('0x3d')]));if(_0xbe5ece[_0x8db2('0x31')]['filter']){_0xa54ea3['where']=_[_0x8db2('0x3e')](_0xa54ea3[_0x8db2('0x3b')],{'$or':_['map'](_0x493cab,function(_0x2bac57){if(_0x2bac57[_0x8db2('0x2f')]!==_0x8db2('0x3f')){var _0x4cb253={};_0x4cb253[_0x2bac57[_0x8db2('0x2a')]]={'$like':'%'+_0xbe5ece[_0x8db2('0x31')][_0x8db2('0x40')]+'%'};return _0x4cb253;}})});}_0xa54ea3=_[_0x8db2('0x3e')]({},_0xa54ea3,_0xbe5ece[_0x8db2('0x41')]);var _0x40d82a={'where':_0xa54ea3[_0x8db2('0x3b')]};return db[_0x8db2('0x42')][_0x8db2('0x43')](_0x40d82a)[_0x8db2('0x27')](function(_0x21cf7c){_0xbc5366[_0x8db2('0x43')]=_0x21cf7c;if(_0xbe5ece[_0x8db2('0x31')]['includeAll']){_0xa54ea3[_0x8db2('0x44')]=[{'all':!![]}];}return db[_0x8db2('0x42')]['findAll'](_0xa54ea3);})['then'](function(_0x249c73){_0xbc5366['rows']=_0x249c73;return _0xbc5366;})[_0x8db2('0x27')](respondWithFilteredResult(_0x21bae5,_0xa54ea3))[_0x8db2('0x45')](handleError(_0x21bae5,null));};exports[_0x8db2('0x46')]=function(_0x307783,_0xb4fe2c){var _0x30d606={'raw':![],'where':{'id':_0x307783['params']['id']}},_0xa53fba={};_0xa53fba[_0x8db2('0x30')]=_[_0x8db2('0x32')](db[_0x8db2('0x42')][_0x8db2('0x47')]);_0xa53fba['query']=_[_0x8db2('0x32')](_0x307783[_0x8db2('0x31')]);_0xa53fba[_0x8db2('0x3d')]=_[_0x8db2('0x33')](_0xa53fba['model'],_0xa53fba[_0x8db2('0x31')]);_0x30d606['attributes']=_[_0x8db2('0x33')](_0xa53fba[_0x8db2('0x30')],qs[_0x8db2('0x34')](_0x307783['query']['fields']));_0x30d606[_0x8db2('0x35')]=_0x30d606['attributes'][_0x8db2('0x36')]?_0x30d606[_0x8db2('0x35')]:_0xa53fba[_0x8db2('0x30')];if(_0x307783[_0x8db2('0x31')][_0x8db2('0x48')]){_0x30d606[_0x8db2('0x44')]=[{'all':!![]}];}_0x30d606=_[_0x8db2('0x3e')]({},_0x30d606,_0x307783[_0x8db2('0x41')]);return db[_0x8db2('0x42')][_0x8db2('0x49')](_0x30d606)[_0x8db2('0x27')](handleEntityNotFound(_0xb4fe2c,null))[_0x8db2('0x27')](respondWithResult(_0xb4fe2c,null))['catch'](handleError(_0xb4fe2c,null));};exports[_0x8db2('0x4a')]=function(_0x2ada52,_0xdbba64){return db[_0x8db2('0x42')]['create'](_0x2ada52['body'],{})[_0x8db2('0x27')](respondWithResult(_0xdbba64,0xc9))[_0x8db2('0x45')](handleError(_0xdbba64,null));};exports[_0x8db2('0x26')]=function(_0x4c66e5,_0x540d90){if(_0x4c66e5['body']['id']){delete _0x4c66e5[_0x8db2('0x4b')]['id'];}return db[_0x8db2('0x42')][_0x8db2('0x49')]({'where':{'id':_0x4c66e5[_0x8db2('0x4c')]['id']}})[_0x8db2('0x27')](handleEntityNotFound(_0x540d90,null))[_0x8db2('0x27')](saveUpdates(_0x4c66e5[_0x8db2('0x4b')],null))['then'](respondWithResult(_0x540d90,null))['catch'](handleError(_0x540d90,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x42')][_0x8db2('0x49')]({'where':{'id':_0x18c6ef[_0x8db2('0x4c')]['id']}})[_0x8db2('0x27')](handleEntityNotFound(_0x2908e4,null))[_0x8db2('0x27')](removeEntity(_0x2908e4,null))[_0x8db2('0x45')](handleError(_0x2908e4,null));};exports[_0x8db2('0x4e')]=function(_0x3bc632,_0x319273){return db[_0x8db2('0x42')][_0x8db2('0x4e')]()[_0x8db2('0x27')](respondWithResult(_0x319273,null))['catch'](handleError(_0x319273,null));};exports[_0x8db2('0x4f')]=function(_0xb4b0a,_0x579317){var _0x27b644={},_0xd78022={},_0x3af298={'count':0x0,'rows':[]};_0xd78022['model']=_[_0x8db2('0x32')](db[_0x8db2('0x42')][_0x8db2('0x47')]);_0xd78022[_0x8db2('0x31')]=_[_0x8db2('0x32')](_0xb4b0a['query']);_0xd78022[_0x8db2('0x3d')]=_[_0x8db2('0x33')](_0xd78022[_0x8db2('0x30')],_0xd78022['query']);_0x27b644[_0x8db2('0x35')]=_[_0x8db2('0x33')](_0xd78022[_0x8db2('0x30')],qs[_0x8db2('0x34')](_0xb4b0a[_0x8db2('0x31')][_0x8db2('0x34')]));_0x27b644[_0x8db2('0x35')]=_0x27b644['attributes'][_0x8db2('0x36')]?_0x27b644[_0x8db2('0x35')]:_0xd78022['model'];if(!_0xb4b0a[_0x8db2('0x31')][_0x8db2('0x37')]('nolimit')){_0x27b644[_0x8db2('0x20')]=qs[_0x8db2('0x20')](_0xb4b0a[_0x8db2('0x31')][_0x8db2('0x20')]);_0x27b644[_0x8db2('0x1f')]=qs[_0x8db2('0x1f')](_0xb4b0a[_0x8db2('0x31')][_0x8db2('0x1f')]);}_0x27b644[_0x8db2('0x39')]=qs[_0x8db2('0x3a')](_0xb4b0a[_0x8db2('0x31')][_0x8db2('0x3a')]);_0x27b644[_0x8db2('0x3b')]=qs[_0x8db2('0x3d')](_[_0x8db2('0x3c')](_0xb4b0a[_0x8db2('0x31')],_0xd78022['filters']));if(_0xb4b0a[_0x8db2('0x31')][_0x8db2('0x40')]){_0x27b644[_0x8db2('0x3b')]=_[_0x8db2('0x3e')](_0x27b644[_0x8db2('0x3b')],{'$or':_['map'](_0x27b644[_0x8db2('0x35')],function(_0x2c3087){var _0x3ab670={};_0x3ab670[_0x2c3087]={'$like':'%'+_0xb4b0a[_0x8db2('0x31')][_0x8db2('0x40')]+'%'};return _0x3ab670;})});}_0x27b644=_[_0x8db2('0x3e')]({},_0x27b644,_0xb4b0a[_0x8db2('0x41')]);var _0x2c7b04={'where':_0x27b644[_0x8db2('0x3b')]};return db[_0x8db2('0x42')][_0x8db2('0x43')](_0x2c7b04)[_0x8db2('0x27')](function(_0x170a72){_0x3af298[_0x8db2('0x43')]=_0x170a72;if(_0xb4b0a[_0x8db2('0x31')][_0x8db2('0x48')]){_0x27b644[_0x8db2('0x44')]=[{'all':!![]}];}return db[_0x8db2('0x42')]['findAll'](_0x27b644);})[_0x8db2('0x27')](function(_0x536ac1){_0x3af298[_0x8db2('0x50')]=_0x536ac1;return _0x3af298;})['then'](respondWithFilteredResult(_0x579317,_0x27b644,_0x8db2('0x4f')))[_0x8db2('0x45')](handleError(_0x579317,null,_0x8db2('0x4f')));}; \ No newline at end of file +var _0xc4aa=['fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','options','VoiceQueueReport','includeAll','rows','catch','show','rawAttributes','include','find','body','params','describe','getVoiceQueuesReport','nolimit','order','findAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map'];(function(_0x175ac5,_0x3e0312){var _0x23d3ff=function(_0x1d998b){while(--_0x1d998b){_0x175ac5['push'](_0x175ac5['shift']());}};_0x23d3ff(++_0x3e0312);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xc4aa[_0x422905];return _0x33dc6c;};'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'];config[_0xac4a('0x16')]=_[_0xac4a('0x17')](config['redis'],{'host':_0xac4a('0x18'),'port':0x18eb});var socket=require(_0xac4a('0x19'))(new Redis(config[_0xac4a('0x16')]));require(_0xac4a('0x1a'))[_0xac4a('0x1b')](socket);function respondWithStatusCode(_0x3b71c0,_0x34bc01){_0x34bc01=_0x34bc01||0xcc;return function(_0x33c287){if(_0x33c287){return _0x3b71c0[_0xac4a('0x1c')](_0x34bc01);}return _0x3b71c0[_0xac4a('0x1d')](_0x34bc01)[_0xac4a('0x1e')]();};}function respondWithResult(_0x26dbb8,_0x4a2119){_0x4a2119=_0x4a2119||0xc8;return function(_0x402fff){if(_0x402fff){return _0x26dbb8[_0xac4a('0x1d')](_0x4a2119)[_0xac4a('0x1f')](_0x402fff);}};}function respondWithFilteredResult(_0x144553,_0x3e88e3){return function(_0x387a54){if(_0x387a54){var _0x28e304=_0x387a54[_0xac4a('0x20')],_0x44ec59=_0x3e88e3[_0xac4a('0x21')],_0x546c5d=_0x3e88e3[_0xac4a('0x21')]+_0x3e88e3['limit'],_0x5ac21e;if(_0x546c5d>=_0x28e304){_0x546c5d=_0x28e304;_0x5ac21e=0xc8;}else{_0x5ac21e=0xce;}_0x144553[_0xac4a('0x1d')](_0x5ac21e);return _0x144553[_0xac4a('0x22')](_0xac4a('0x23'),_0x44ec59+'-'+_0x546c5d+'/'+_0x28e304)[_0xac4a('0x1f')](_0x387a54);}return null;};}function patchUpdates(_0x123694){return function(_0x3e829c){try{jsonpatch[_0xac4a('0x24')](_0x3e829c,_0x123694,!![]);}catch(_0x3ca790){return BPromise['reject'](_0x3ca790);}return _0x3e829c[_0xac4a('0x25')]();};}function saveUpdates(_0x3204ad,_0x599787){return function(_0x3d7ce0){if(_0x3d7ce0){return _0x3d7ce0[_0xac4a('0x26')](_0x3204ad)[_0xac4a('0x27')](function(_0x947d8e){return _0x947d8e;});}return null;};}function removeEntity(_0x4d2d6c,_0x1b7998){return function(_0x2503d8){if(_0x2503d8){return _0x2503d8[_0xac4a('0x28')]()[_0xac4a('0x27')](function(){_0x4d2d6c[_0xac4a('0x1d')](0xcc)[_0xac4a('0x1e')]();});}};}function handleEntityNotFound(_0x222507,_0x36054a){return function(_0x3e2c69){if(!_0x3e2c69){_0x222507[_0xac4a('0x1c')](0x194);}return _0x3e2c69;};}function handleError(_0x1d0539,_0x215a31){_0x215a31=_0x215a31||0x1f4;return function(_0x14832b){logger[_0xac4a('0x29')](_0x14832b[_0xac4a('0x2a')]);if(_0x14832b[_0xac4a('0x2b')]){delete _0x14832b['name'];}_0x1d0539[_0xac4a('0x1d')](_0x215a31)[_0xac4a('0x2c')](_0x14832b);};}exports[_0xac4a('0x2d')]=function(_0x2772fe,_0x116700){var _0x4a5a9e={},_0x47f49c={},_0xdb7e={'count':0x0,'rows':[]};var _0x7a948b=_[_0xac4a('0x2e')](db['VoiceQueueReport']['rawAttributes'],function(_0x355755){return{'name':_0x355755[_0xac4a('0x2f')],'type':_0x355755[_0xac4a('0x30')][_0xac4a('0x31')]};});_0x47f49c[_0xac4a('0x32')]=_['map'](_0x7a948b,_0xac4a('0x2b'));_0x47f49c['query']=_[_0xac4a('0x33')](_0x2772fe['query']);_0x47f49c[_0xac4a('0x34')]=_[_0xac4a('0x35')](_0x47f49c[_0xac4a('0x32')],_0x47f49c[_0xac4a('0x36')]);_0x4a5a9e[_0xac4a('0x37')]=_[_0xac4a('0x35')](_0x47f49c[_0xac4a('0x32')],qs[_0xac4a('0x38')](_0x2772fe[_0xac4a('0x36')][_0xac4a('0x38')]));_0x4a5a9e[_0xac4a('0x37')]=_0x4a5a9e[_0xac4a('0x37')][_0xac4a('0x39')]?_0x4a5a9e[_0xac4a('0x37')]:_0x47f49c['model'];if(!_0x2772fe[_0xac4a('0x36')][_0xac4a('0x3a')]('nolimit')){_0x4a5a9e[_0xac4a('0x3b')]=qs[_0xac4a('0x3b')](_0x2772fe['query']['limit']);_0x4a5a9e[_0xac4a('0x21')]=qs[_0xac4a('0x21')](_0x2772fe[_0xac4a('0x36')][_0xac4a('0x21')]);}_0x4a5a9e['order']=qs[_0xac4a('0x3c')](_0x2772fe[_0xac4a('0x36')]['sort']);_0x4a5a9e[_0xac4a('0x3d')]=qs[_0xac4a('0x34')](_[_0xac4a('0x3e')](_0x2772fe['query'],_0x47f49c[_0xac4a('0x34')]));if(_0x2772fe[_0xac4a('0x36')][_0xac4a('0x3f')]){_0x4a5a9e['where']=_[_0xac4a('0x40')](_0x4a5a9e[_0xac4a('0x3d')],{'$or':_['map'](_0x7a948b,function(_0x59bebf){if(_0x59bebf[_0xac4a('0x30')]!=='VIRTUAL'){var _0x50e03e={};_0x50e03e[_0x59bebf['name']]={'$like':'%'+_0x2772fe['query'][_0xac4a('0x3f')]+'%'};return _0x50e03e;}})});}_0x4a5a9e=_[_0xac4a('0x40')]({},_0x4a5a9e,_0x2772fe[_0xac4a('0x41')]);var _0x472484={'where':_0x4a5a9e[_0xac4a('0x3d')]};return db[_0xac4a('0x42')][_0xac4a('0x20')](_0x472484)[_0xac4a('0x27')](function(_0x28292c){_0xdb7e[_0xac4a('0x20')]=_0x28292c;if(_0x2772fe[_0xac4a('0x36')][_0xac4a('0x43')]){_0x4a5a9e['include']=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x4a5a9e);})[_0xac4a('0x27')](function(_0x5c46a){_0xdb7e[_0xac4a('0x44')]=_0x5c46a;return _0xdb7e;})[_0xac4a('0x27')](respondWithFilteredResult(_0x116700,_0x4a5a9e))[_0xac4a('0x45')](handleError(_0x116700,null));};exports[_0xac4a('0x46')]=function(_0x8febf0,_0x3441f2){var _0x3e9973={'raw':![],'where':{'id':_0x8febf0['params']['id']}},_0x3edb19={};_0x3edb19[_0xac4a('0x32')]=_[_0xac4a('0x33')](db[_0xac4a('0x42')][_0xac4a('0x47')]);_0x3edb19[_0xac4a('0x36')]=_['keys'](_0x8febf0[_0xac4a('0x36')]);_0x3edb19[_0xac4a('0x34')]=_['intersection'](_0x3edb19[_0xac4a('0x32')],_0x3edb19['query']);_0x3e9973[_0xac4a('0x37')]=_[_0xac4a('0x35')](_0x3edb19[_0xac4a('0x32')],qs[_0xac4a('0x38')](_0x8febf0[_0xac4a('0x36')][_0xac4a('0x38')]));_0x3e9973[_0xac4a('0x37')]=_0x3e9973[_0xac4a('0x37')][_0xac4a('0x39')]?_0x3e9973[_0xac4a('0x37')]:_0x3edb19[_0xac4a('0x32')];if(_0x8febf0[_0xac4a('0x36')]['includeAll']){_0x3e9973[_0xac4a('0x48')]=[{'all':!![]}];}_0x3e9973=_[_0xac4a('0x40')]({},_0x3e9973,_0x8febf0[_0xac4a('0x41')]);return db['VoiceQueueReport'][_0xac4a('0x49')](_0x3e9973)[_0xac4a('0x27')](handleEntityNotFound(_0x3441f2,null))['then'](respondWithResult(_0x3441f2,null))[_0xac4a('0x45')](handleError(_0x3441f2,null));};exports['create']=function(_0x244950,_0xe620f6){return db[_0xac4a('0x42')]['create'](_0x244950['body'],{})[_0xac4a('0x27')](respondWithResult(_0xe620f6,0xc9))['catch'](handleError(_0xe620f6,null));};exports[_0xac4a('0x26')]=function(_0x566258,_0x3d2aaf){if(_0x566258['body']['id']){delete _0x566258[_0xac4a('0x4a')]['id'];}return db[_0xac4a('0x42')][_0xac4a('0x49')]({'where':{'id':_0x566258[_0xac4a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3d2aaf,null))[_0xac4a('0x27')](saveUpdates(_0x566258[_0xac4a('0x4a')],null))[_0xac4a('0x27')](respondWithResult(_0x3d2aaf,null))[_0xac4a('0x45')](handleError(_0x3d2aaf,null));};exports[_0xac4a('0x28')]=function(_0x138876,_0x187306){return db['VoiceQueueReport'][_0xac4a('0x49')]({'where':{'id':_0x138876[_0xac4a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x187306,null))[_0xac4a('0x27')](removeEntity(_0x187306,null))[_0xac4a('0x45')](handleError(_0x187306,null));};exports[_0xac4a('0x4c')]=function(_0x3ac36e,_0x4bb2fb){return db[_0xac4a('0x42')][_0xac4a('0x4c')]()[_0xac4a('0x27')](respondWithResult(_0x4bb2fb,null))[_0xac4a('0x45')](handleError(_0x4bb2fb,null));};exports[_0xac4a('0x4d')]=function(_0x49fbc3,_0x179373){var _0x564b10={},_0x307441={},_0x2c04af={'count':0x0,'rows':[]};_0x307441['model']=_['keys'](db[_0xac4a('0x42')][_0xac4a('0x47')]);_0x307441['query']=_[_0xac4a('0x33')](_0x49fbc3[_0xac4a('0x36')]);_0x307441[_0xac4a('0x34')]=_[_0xac4a('0x35')](_0x307441['model'],_0x307441[_0xac4a('0x36')]);_0x564b10[_0xac4a('0x37')]=_[_0xac4a('0x35')](_0x307441[_0xac4a('0x32')],qs[_0xac4a('0x38')](_0x49fbc3[_0xac4a('0x36')][_0xac4a('0x38')]));_0x564b10['attributes']=_0x564b10[_0xac4a('0x37')][_0xac4a('0x39')]?_0x564b10[_0xac4a('0x37')]:_0x307441[_0xac4a('0x32')];if(!_0x49fbc3[_0xac4a('0x36')][_0xac4a('0x3a')](_0xac4a('0x4e'))){_0x564b10[_0xac4a('0x3b')]=qs[_0xac4a('0x3b')](_0x49fbc3[_0xac4a('0x36')][_0xac4a('0x3b')]);_0x564b10[_0xac4a('0x21')]=qs[_0xac4a('0x21')](_0x49fbc3[_0xac4a('0x36')][_0xac4a('0x21')]);}_0x564b10[_0xac4a('0x4f')]=qs['sort'](_0x49fbc3[_0xac4a('0x36')]['sort']);_0x564b10[_0xac4a('0x3d')]=qs['filters'](_[_0xac4a('0x3e')](_0x49fbc3['query'],_0x307441[_0xac4a('0x34')]));if(_0x49fbc3['query']['filter']){_0x564b10[_0xac4a('0x3d')]=_[_0xac4a('0x40')](_0x564b10[_0xac4a('0x3d')],{'$or':_[_0xac4a('0x2e')](_0x564b10[_0xac4a('0x37')],function(_0xb7b884){var _0x592a4b={};_0x592a4b[_0xb7b884]={'$like':'%'+_0x49fbc3[_0xac4a('0x36')]['filter']+'%'};return _0x592a4b;})});}_0x564b10=_[_0xac4a('0x40')]({},_0x564b10,_0x49fbc3['options']);var _0x347880={'where':_0x564b10[_0xac4a('0x3d')]};return db[_0xac4a('0x42')][_0xac4a('0x20')](_0x347880)[_0xac4a('0x27')](function(_0x2bc39a){_0x2c04af[_0xac4a('0x20')]=_0x2bc39a;if(_0x49fbc3[_0xac4a('0x36')][_0xac4a('0x43')]){_0x564b10[_0xac4a('0x48')]=[{'all':!![]}];}return db[_0xac4a('0x42')][_0xac4a('0x50')](_0x564b10);})[_0xac4a('0x27')](function(_0x2cc410){_0x2c04af[_0xac4a('0x44')]=_0x2cc410;return _0x2c04af;})[_0xac4a('0x27')](respondWithFilteredResult(_0x179373,_0x564b10,_0xac4a('0x4d')))['catch'](handleError(_0x179373,null,_0xac4a('0x4d')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index d4a380a..476ae01 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 _0xd8ab=['../../mysqldb','VoiceQueueReport','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0xd8ab,0x195));var _0xbd8a=function(_0x548c87,_0x1fc4d4){_0x548c87=_0x548c87-0x0;var _0x359797=_0xd8ab[_0x548c87];return _0x359797;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xbd8a('0x0'))['db'][_0xbd8a('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xbd8a('0x2')](0x0);var events={'afterCreate':_0xbd8a('0x3'),'afterUpdate':'update','afterDestroy':_0xbd8a('0x4')};function emitEvent(_0x1366ab){return function(_0x237899,_0x553669,_0x5acdfe){VoiceQueueReportEvents[_0xbd8a('0x5')](_0x1366ab+':'+_0x237899['id'],_0x237899);VoiceQueueReportEvents[_0xbd8a('0x5')](_0x1366ab,_0x237899);_0x5acdfe(null);};}for(var e in events){if(events[_0xbd8a('0x6')](e)){var event=events[e];VoiceQueueReport[_0xbd8a('0x7')](e,emitEvent(event));}}module[_0xbd8a('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x7317=['exports','events','../../mysqldb','VoiceQueueReport','save','update','remove','emit','hook'];(function(_0x57a50d,_0x2871f8){var _0x1b25b3=function(_0x45691e){while(--_0x45691e){_0x57a50d['push'](_0x57a50d['shift']());}};_0x1b25b3(++_0x2871f8);}(_0x7317,0xac));var _0x7731=function(_0x1063e9,_0xe2d482){_0x1063e9=_0x1063e9-0x0;var _0x14c68b=_0x7317[_0x1063e9];return _0x14c68b;};'use strict';var EventEmitter=require(_0x7731('0x0'));var VoiceQueueReport=require(_0x7731('0x1'))['db'][_0x7731('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7731('0x3'),'afterUpdate':_0x7731('0x4'),'afterDestroy':_0x7731('0x5')};function emitEvent(_0x399b77){return function(_0x523fce,_0x18db7a,_0x41240b){VoiceQueueReportEvents[_0x7731('0x6')](_0x399b77+':'+_0x523fce['id'],_0x523fce);VoiceQueueReportEvents[_0x7731('0x6')](_0x399b77,_0x523fce);_0x41240b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x7731('0x7')](e,emitEvent(event));}}module[_0x7731('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 58baf14..fb278e0 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.model.js +++ b/server/api/voiceQueueReport/voiceQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['define','report_queue','uniqueid','calleridnum','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x49c653,_0x390195){var _0x31e169=function(_0x3684ac){while(--_0x3684ac){_0x49c653['push'](_0x49c653['shift']());}};_0x31e169(++_0x390195);}(_0xb10b,0x12a));var _0xbb10=function(_0x3b08de,_0x63ddd0){_0x3b08de=_0x3b08de-0x0;var _0x53fbe4=_0xb10b[_0x3b08de];return _0x53fbe4;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('VoiceQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'fields':[_0xbb10('0xc')]},{'fields':[_0xbb10('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5f66=['request-promise','path','../../config/environment','exports','VoiceQueueReport','report_queue','uniqueid','calleridnum','util','api','moment','bluebird'];(function(_0xa10e59,_0xb2d791){var _0x47f92a=function(_0x420a90){while(--_0x420a90){_0xa10e59['push'](_0xa10e59['shift']());}};_0x47f92a(++_0xb2d791);}(_0x5f66,0x1a0));var _0x65f6=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x5f66[_0x138adb];return _0x1b27f2;};'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 aa5d7af..e0c0a94 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 _0x1fab=['where','attributes','limit','include','map','model','GetVoiceQueueReport','CreateVoiceQueueReport','create','body','update','UpdateVoiceQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceQueueReport','findAll','options','raw'];(function(_0x1ae465,_0x284bdc){var _0x14dd28=function(_0x26c7c1){while(--_0x26c7c1){_0x1ae465['push'](_0x1ae465['shift']());}};_0x14dd28(++_0x284bdc);}(_0x1fab,0xf2));var _0xb1fa=function(_0x43edd6,_0x2c182a){_0x43edd6=_0x43edd6-0x0;var _0x42b948=_0x1fab[_0x43edd6];return _0x42b948;};'use strict';var _=require(_0xb1fa('0x0'));var util=require(_0xb1fa('0x1'));var moment=require(_0xb1fa('0x2'));var BPromise=require('bluebird');var rs=require(_0xb1fa('0x3'));var fs=require('fs');var Redis=require(_0xb1fa('0x4'));var db=require(_0xb1fa('0x5'))['db'];var utils=require(_0xb1fa('0x6'));var logger=require(_0xb1fa('0x7'))(_0xb1fa('0x8'));var config=require(_0xb1fa('0x9'));var jayson=require(_0xb1fa('0xa'));var client=jayson[_0xb1fa('0xb')][_0xb1fa('0xc')]({'port':0x232a});config[_0xb1fa('0xd')]=_[_0xb1fa('0xe')](config[_0xb1fa('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xb1fa('0xf'))(new Redis(config[_0xb1fa('0xd')]));require('./voiceQueueReport.socket')[_0xb1fa('0x10')](socket);function respondWithRpcPromise(_0x371589,_0x574c6b,_0x431dc9){return new BPromise(function(_0x2c2304,_0x18008a){return client[_0xb1fa('0x11')](_0x371589,_0x431dc9)[_0xb1fa('0x12')](function(_0x295138){logger[_0xb1fa('0x13')](_0xb1fa('0x14'),_0x574c6b,_0xb1fa('0x15'));logger[_0xb1fa('0x16')](_0xb1fa('0x17'),_0x574c6b,_0xb1fa('0x15'),JSON[_0xb1fa('0x18')](_0x295138));if(_0x295138[_0xb1fa('0x19')]){if(_0x295138[_0xb1fa('0x19')][_0xb1fa('0x1a')]===0x1f4){logger[_0xb1fa('0x19')](_0xb1fa('0x14'),_0x574c6b,_0x295138[_0xb1fa('0x19')]['message']);return _0x18008a(_0x295138[_0xb1fa('0x19')][_0xb1fa('0x1b')]);}logger['error'](_0xb1fa('0x14'),_0x574c6b,_0x295138[_0xb1fa('0x19')][_0xb1fa('0x1b')]);return _0x2c2304(_0x295138['error'][_0xb1fa('0x1b')]);}else{logger[_0xb1fa('0x13')](_0xb1fa('0x14'),_0x574c6b,_0xb1fa('0x15'));_0x2c2304(_0x295138[_0xb1fa('0x1c')][_0xb1fa('0x1b')]);}})[_0xb1fa('0x1d')](function(_0x54b74a){logger[_0xb1fa('0x19')]('VoiceQueueReport,\x20%s,\x20%s',_0x574c6b,_0x54b74a);_0x18008a(_0x54b74a);});});}exports['GetVoiceQueueReport']=function(_0x2fff28){var _0xb50ff0=this;return new Promise(function(_0x4d7238,_0x32f864){return db[_0xb1fa('0x1e')][_0xb1fa('0x1f')]({'raw':_0x2fff28[_0xb1fa('0x20')]?_0x2fff28['options'][_0xb1fa('0x21')]===undefined?!![]:![]:!![],'where':_0x2fff28[_0xb1fa('0x20')]?_0x2fff28['options'][_0xb1fa('0x22')]||null:null,'attributes':_0x2fff28[_0xb1fa('0x20')]?_0x2fff28['options'][_0xb1fa('0x23')]||null:null,'limit':_0x2fff28[_0xb1fa('0x20')]?_0x2fff28[_0xb1fa('0x20')][_0xb1fa('0x24')]||null:null,'include':_0x2fff28[_0xb1fa('0x20')]?_0x2fff28[_0xb1fa('0x20')][_0xb1fa('0x25')]?_['map'](_0x2fff28[_0xb1fa('0x20')]['include'],function(_0x3378ff){return{'model':db[_0x3378ff['model']],'as':_0x3378ff['as'],'attributes':_0x3378ff[_0xb1fa('0x23')],'include':_0x3378ff[_0xb1fa('0x25')]?_[_0xb1fa('0x26')](_0x3378ff['include'],function(_0x52f9c7){return{'model':db[_0x52f9c7[_0xb1fa('0x27')]],'as':_0x52f9c7['as'],'attributes':_0x52f9c7[_0xb1fa('0x23')],'include':_0x52f9c7[_0xb1fa('0x25')]?_[_0xb1fa('0x26')](_0x52f9c7[_0xb1fa('0x25')],function(_0x14fac9){return{'model':db[_0x14fac9[_0xb1fa('0x27')]],'as':_0x14fac9['as'],'attributes':_0x14fac9[_0xb1fa('0x23')]};}):[]};}):[]};}):[]:[]})[_0xb1fa('0x12')](function(_0x1e630c){logger[_0xb1fa('0x13')](_0xb1fa('0x28'),_0x2fff28);logger[_0xb1fa('0x16')](_0xb1fa('0x28'),_0x2fff28,JSON['stringify'](_0x1e630c));_0x4d7238(_0x1e630c);})[_0xb1fa('0x1d')](function(_0x3dc2c3){logger[_0xb1fa('0x19')](_0xb1fa('0x28'),_0x3dc2c3[_0xb1fa('0x1b')],_0x2fff28);_0x32f864(_0xb50ff0['error'](0x1f4,_0x3dc2c3['message']));});});};exports[_0xb1fa('0x29')]=function(_0x8de373){var _0x2272c7=this;return new Promise(function(_0x1ba2cb,_0x5e6ee4){return db[_0xb1fa('0x1e')][_0xb1fa('0x2a')](_0x8de373[_0xb1fa('0x2b')],{'raw':_0x8de373[_0xb1fa('0x20')]?_0x8de373[_0xb1fa('0x20')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x558304){logger['info'](_0xb1fa('0x29'),_0x8de373);logger[_0xb1fa('0x16')]('CreateVoiceQueueReport',_0x8de373,JSON[_0xb1fa('0x18')](_0x558304));_0x1ba2cb(_0x558304);})[_0xb1fa('0x1d')](function(_0x358fcc){logger['error']('CreateVoiceQueueReport',_0x358fcc['message'],_0x8de373);_0x5e6ee4(_0x2272c7['error'](0x1f4,_0x358fcc['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x3a4590){var _0x57aaa7=this;return new Promise(function(_0x58688d,_0xc64617){return db[_0xb1fa('0x1e')][_0xb1fa('0x2c')](_0x3a4590[_0xb1fa('0x2b')],{'raw':_0x3a4590['options']?_0x3a4590[_0xb1fa('0x20')][_0xb1fa('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a4590[_0xb1fa('0x20')]?_0x3a4590[_0xb1fa('0x20')][_0xb1fa('0x22')]||null:null,'attributes':_0x3a4590[_0xb1fa('0x20')]?_0x3a4590[_0xb1fa('0x20')][_0xb1fa('0x23')]||null:null,'limit':_0x3a4590[_0xb1fa('0x20')]?_0x3a4590[_0xb1fa('0x20')][_0xb1fa('0x24')]||null:null})[_0xb1fa('0x12')](function(_0x191494){logger[_0xb1fa('0x13')](_0xb1fa('0x2d'),_0x3a4590);logger[_0xb1fa('0x16')](_0xb1fa('0x2d'),_0x3a4590,JSON[_0xb1fa('0x18')](_0x191494));_0x58688d(_0x191494);})[_0xb1fa('0x1d')](function(_0x3de5c2){logger[_0xb1fa('0x19')](_0xb1fa('0x2d'),_0x3de5c2['message'],_0x3a4590);_0xc64617(_0x57aaa7[_0xb1fa('0x19')](0x1f4,_0x3de5c2['message']));});});}; \ No newline at end of file +var _0x9439=['catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','attributes','limit','map','include','model','stringify','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','request','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','message','info'];(function(_0x45e6a6,_0x4acc19){var _0x276dad=function(_0x9e02dd){while(--_0x9e02dd){_0x45e6a6['push'](_0x45e6a6['shift']());}};_0x276dad(++_0x4acc19);}(_0x9439,0x93));var _0x9943=function(_0x4acc17,_0x448db6){_0x4acc17=_0x4acc17-0x0;var _0x44fd05=_0x9439[_0x4acc17];return _0x44fd05;};'use strict';var _=require(_0x9943('0x0'));var util=require(_0x9943('0x1'));var moment=require(_0x9943('0x2'));var BPromise=require('bluebird');var rs=require(_0x9943('0x3'));var fs=require('fs');var Redis=require(_0x9943('0x4'));var db=require(_0x9943('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9943('0x6'))(_0x9943('0x7'));var config=require(_0x9943('0x8'));var jayson=require(_0x9943('0x9'));var client=jayson[_0x9943('0xa')][_0x9943('0xb')]({'port':0x232a});config[_0x9943('0xc')]=_[_0x9943('0xd')](config['redis'],{'host':_0x9943('0xe'),'port':0x18eb});var socket=require(_0x9943('0xf'))(new Redis(config[_0x9943('0xc')]));require(_0x9943('0x10'))['register'](socket);function respondWithRpcPromise(_0x34980e,_0x3213c4,_0x475f41){return new BPromise(function(_0x3427e3,_0xcdaf7){return client[_0x9943('0x11')](_0x34980e,_0x475f41)[_0x9943('0x12')](function(_0xfe39a8){logger['info'](_0x9943('0x13'),_0x3213c4,_0x9943('0x14'));logger[_0x9943('0x15')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x3213c4,_0x9943('0x14'),JSON['stringify'](_0xfe39a8));if(_0xfe39a8['error']){if(_0xfe39a8[_0x9943('0x16')]['code']===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x3213c4,_0xfe39a8['error'][_0x9943('0x17')]);return _0xcdaf7(_0xfe39a8[_0x9943('0x16')][_0x9943('0x17')]);}logger[_0x9943('0x16')](_0x9943('0x13'),_0x3213c4,_0xfe39a8[_0x9943('0x16')][_0x9943('0x17')]);return _0x3427e3(_0xfe39a8['error'][_0x9943('0x17')]);}else{logger[_0x9943('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0x3213c4,'request\x20sent');_0x3427e3(_0xfe39a8['result'][_0x9943('0x17')]);}})[_0x9943('0x19')](function(_0x19169c){logger['error'](_0x9943('0x13'),_0x3213c4,_0x19169c);_0xcdaf7(_0x19169c);});});}exports[_0x9943('0x1a')]=function(_0x36dc33){var _0x43e079=this;return new Promise(function(_0x4eb3a1,_0x52ed33){return db[_0x9943('0x1b')][_0x9943('0x1c')]({'raw':_0x36dc33[_0x9943('0x1d')]?_0x36dc33[_0x9943('0x1d')][_0x9943('0x1e')]===undefined?!![]:![]:!![],'where':_0x36dc33['options']?_0x36dc33[_0x9943('0x1d')]['where']||null:null,'attributes':_0x36dc33[_0x9943('0x1d')]?_0x36dc33['options'][_0x9943('0x1f')]||null:null,'limit':_0x36dc33['options']?_0x36dc33['options'][_0x9943('0x20')]||null:null,'include':_0x36dc33[_0x9943('0x1d')]?_0x36dc33[_0x9943('0x1d')]['include']?_[_0x9943('0x21')](_0x36dc33[_0x9943('0x1d')][_0x9943('0x22')],function(_0x14c9c6){return{'model':db[_0x14c9c6['model']],'as':_0x14c9c6['as'],'attributes':_0x14c9c6[_0x9943('0x1f')],'include':_0x14c9c6['include']?_['map'](_0x14c9c6[_0x9943('0x22')],function(_0x2db55e){return{'model':db[_0x2db55e[_0x9943('0x23')]],'as':_0x2db55e['as'],'attributes':_0x2db55e[_0x9943('0x1f')],'include':_0x2db55e[_0x9943('0x22')]?_[_0x9943('0x21')](_0x2db55e[_0x9943('0x22')],function(_0x1dc59e){return{'model':db[_0x1dc59e[_0x9943('0x23')]],'as':_0x1dc59e['as'],'attributes':_0x1dc59e[_0x9943('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9943('0x12')](function(_0x4cfc3f){logger[_0x9943('0x18')](_0x9943('0x1a'),_0x36dc33);logger['debug'](_0x9943('0x1a'),_0x36dc33,JSON[_0x9943('0x24')](_0x4cfc3f));_0x4eb3a1(_0x4cfc3f);})[_0x9943('0x19')](function(_0x464cb4){logger[_0x9943('0x16')](_0x9943('0x1a'),_0x464cb4[_0x9943('0x17')],_0x36dc33);_0x52ed33(_0x43e079[_0x9943('0x16')](0x1f4,_0x464cb4[_0x9943('0x17')]));});});};exports[_0x9943('0x25')]=function(_0x2e2fbc){var _0x38374f=this;return new Promise(function(_0xb6fcc0,_0xdc4939){return db['VoiceQueueReport'][_0x9943('0x26')](_0x2e2fbc[_0x9943('0x27')],{'raw':_0x2e2fbc[_0x9943('0x1d')]?_0x2e2fbc[_0x9943('0x1d')][_0x9943('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0xb59152){logger['info'](_0x9943('0x25'),_0x2e2fbc);logger[_0x9943('0x15')](_0x9943('0x25'),_0x2e2fbc,JSON[_0x9943('0x24')](_0xb59152));_0xb6fcc0(_0xb59152);})[_0x9943('0x19')](function(_0x345939){logger[_0x9943('0x16')](_0x9943('0x25'),_0x345939[_0x9943('0x17')],_0x2e2fbc);_0xdc4939(_0x38374f[_0x9943('0x16')](0x1f4,_0x345939[_0x9943('0x17')]));});});};exports[_0x9943('0x28')]=function(_0x28a907){var _0x4b88d5=this;return new Promise(function(_0xdf0062,_0x84e9f1){return db['VoiceQueueReport'][_0x9943('0x29')](_0x28a907[_0x9943('0x27')],{'raw':_0x28a907[_0x9943('0x1d')]?_0x28a907[_0x9943('0x1d')][_0x9943('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28a907[_0x9943('0x1d')]?_0x28a907[_0x9943('0x1d')][_0x9943('0x2a')]||null:null,'attributes':_0x28a907[_0x9943('0x1d')]?_0x28a907[_0x9943('0x1d')][_0x9943('0x1f')]||null:null,'limit':_0x28a907[_0x9943('0x1d')]?_0x28a907['options'][_0x9943('0x20')]||null:null})[_0x9943('0x12')](function(_0x4e9331){logger[_0x9943('0x18')](_0x9943('0x28'),_0x28a907);logger['debug']('UpdateVoiceQueueReport',_0x28a907,JSON[_0x9943('0x24')](_0x4e9331));_0xdf0062(_0x4e9331);})[_0x9943('0x19')](function(_0x9ea0f9){logger['error'](_0x9943('0x28'),_0x9ea0f9[_0x9943('0x17')],_0x28a907);_0x84e9f1(_0x4b88d5['error'](0x1f4,_0x9ea0f9[_0x9943('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index af0c3d6..83c9494 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 _0x6add=['emit','register','./voiceQueueReport.events','save'];(function(_0x47792c,_0xddb627){var _0x35432d=function(_0x5acb78){while(--_0x5acb78){_0x47792c['push'](_0x47792c['shift']());}};_0x35432d(++_0xddb627);}(_0x6add,0x17a));var _0xd6ad=function(_0x4c89dd,_0x408798){_0x4c89dd=_0x4c89dd-0x0;var _0x38a1a3=_0x6add[_0x4c89dd];return _0x38a1a3;};'use strict';var VoiceQueueReportEvents=require(_0xd6ad('0x0'));var events=[_0xd6ad('0x1'),'remove','update'];function createListener(_0x34ab48,_0x238efe){return function(_0x2111e1){_0x238efe[_0xd6ad('0x2')](_0x34ab48,_0x2111e1);};}function removeListener(_0x54bab9,_0x41da77){return function(){VoiceQueueReportEvents['removeListener'](_0x54bab9,_0x41da77);};}exports[_0xd6ad('0x3')]=function(_0xd9377b){for(var _0x3e124c=0x0,_0x5b1be6=events['length'];_0x3e124c<_0x5b1be6;_0x3e124c++){var _0x3a92d1=events[_0x3e124c];var _0x4a3c6e=createListener('voiceQueueReport:'+_0x3a92d1,_0xd9377b);VoiceQueueReportEvents['on'](_0x3a92d1,_0x4a3c6e);}}; \ No newline at end of file +var _0x5217=['length','voiceQueueReport:','./voiceQueueReport.events','save','emit','removeListener','register'];(function(_0x642e52,_0x1555df){var _0x2b01bc=function(_0x46f348){while(--_0x46f348){_0x642e52['push'](_0x642e52['shift']());}};_0x2b01bc(++_0x1555df);}(_0x5217,0x1ad));var _0x7521=function(_0x27161b,_0x1a8bae){_0x27161b=_0x27161b-0x0;var _0x1926d6=_0x5217[_0x27161b];return _0x1926d6;};'use strict';var VoiceQueueReportEvents=require(_0x7521('0x0'));var events=[_0x7521('0x1'),'remove','update'];function createListener(_0x1e6250,_0x23d7f0){return function(_0x4809da){_0x23d7f0[_0x7521('0x2')](_0x1e6250,_0x4809da);};}function removeListener(_0x21662f,_0x4ba85b){return function(){VoiceQueueReportEvents[_0x7521('0x3')](_0x21662f,_0x4ba85b);};}exports[_0x7521('0x4')]=function(_0x5d5248){for(var _0x2b42f6=0x0,_0x350cd9=events[_0x7521('0x5')];_0x2b42f6<_0x350cd9;_0x2b42f6++){var _0x5d6e76=events[_0x2b42f6];var _0xddbde1=createListener(_0x7521('0x6')+_0x5d6e76,_0x5d5248);VoiceQueueReportEvents['on'](_0x5d6e76,_0xddbde1);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 7b1916f..558d40f 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 _0xff19=['exports','multer','util','express','Router','../../components/auth/service','./voiceQueuesLog.controller','get','index','/:id','isAuthenticated','show','post','create','update','delete','destroy'];(function(_0x49a052,_0x104825){var _0x36960a=function(_0xeb527){while(--_0xeb527){_0x49a052['push'](_0x49a052['shift']());}};_0x36960a(++_0x104825);}(_0xff19,0x100));var _0x9ff1=function(_0x45c542,_0x45c9f1){_0x45c542=_0x45c542-0x0;var _0xf21697=_0xff19[_0x45c542];return _0xf21697;};'use strict';var multer=require(_0x9ff1('0x0'));var util=require(_0x9ff1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9ff1('0x2'));var router=express[_0x9ff1('0x3')]();var auth=require(_0x9ff1('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9ff1('0x5'));router[_0x9ff1('0x6')]('/',auth['isAuthenticated'](),controller[_0x9ff1('0x7')]);router[_0x9ff1('0x6')](_0x9ff1('0x8'),auth[_0x9ff1('0x9')](),controller[_0x9ff1('0xa')]);router[_0x9ff1('0xb')]('/',auth[_0x9ff1('0x9')](),controller[_0x9ff1('0xc')]);router['put'](_0x9ff1('0x8'),auth['isAuthenticated'](),controller[_0x9ff1('0xd')]);router[_0x9ff1('0xe')]('/:id',auth[_0x9ff1('0x9')](),controller[_0x9ff1('0xf')]);module[_0x9ff1('0x10')]=router; \ No newline at end of file +var _0xf4e0=['/:id','isAuthenticated','create','put','update','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xf4e0,0xac));var _0x0f4e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf4e0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0f4e('0x0'));var util=require(_0x0f4e('0x1'));var path=require('path');var timeout=require(_0x0f4e('0x2'));var express=require('express');var router=express[_0x0f4e('0x3')]();var auth=require(_0x0f4e('0x4'));var interaction=require(_0x0f4e('0x5'));var config=require(_0x0f4e('0x6'));var controller=require('./voiceQueuesLog.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x0f4e('0x7')](_0x0f4e('0x8'),auth[_0x0f4e('0x9')](),controller['show']);router['post']('/',auth[_0x0f4e('0x9')](),controller[_0x0f4e('0xa')]);router[_0x0f4e('0xb')](_0x0f4e('0x8'),auth[_0x0f4e('0x9')](),controller[_0x0f4e('0xc')]);router[_0x0f4e('0xd')](_0x0f4e('0x8'),auth[_0x0f4e('0x9')](),controller[_0x0f4e('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 27f96cd..292b47f 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 _0x8be4=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports'];(function(_0x45693f,_0x5d7a47){var _0x476dd0=function(_0xf7d8dd){while(--_0xf7d8dd){_0x45693f['push'](_0x45693f['shift']());}};_0x476dd0(++_0x5d7a47);}(_0x8be4,0x1a8));var _0x48be=function(_0x2307fa,_0x266e5e){_0x2307fa=_0x2307fa-0x0;var _0x496486=_0x8be4[_0x2307fa];return _0x496486;};'use strict';var Sequelize=require(_0x48be('0x0'));var moment=require(_0x48be('0x1'));module[_0x48be('0x2')]={'time':{'type':Sequelize[_0x48be('0x3')]},'callid':{'type':Sequelize[_0x48be('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x48be('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x48be('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x48be('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x48be('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x48be('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x48be('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x48be('0x4')],'allowNull':![],'defaultValue':moment()[_0x48be('0x5')](_0x48be('0x6'))}}; \ No newline at end of file +var _0x159d=['YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','STRING','DATE','format'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x159d,0x1e1));var _0xd159=function(_0xbe5459,_0x1dc50f){_0xbe5459=_0xbe5459-0x0;var _0x5396ff=_0x159d[_0xbe5459];return _0x5396ff;};'use strict';var Sequelize=require(_0xd159('0x0'));var moment=require('moment');module[_0xd159('0x1')]={'time':{'type':Sequelize[_0xd159('0x2')]},'callid':{'type':Sequelize[_0xd159('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xd159('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xd159('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xd159('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xd159('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xd159('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xd159('0x3')],'allowNull':![],'defaultValue':moment()[_0xd159('0x4')](_0xd159('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index dbaae44..809ac16 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 _0x9d42=['../../components/parsers/qs','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','create','body','find','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0xa3bb66,_0x4cf7b8){var _0x2e6524=function(_0x29f38f){while(--_0x29f38f){_0xa3bb66['push'](_0xa3bb66['shift']());}};_0x2e6524(++_0x4cf7b8);}(_0x9d42,0x1a8));var _0x29d4=function(_0x561f10,_0x581c75){_0x561f10=_0x561f10-0x0;var _0x31150c=_0x9d42[_0x561f10];return _0x31150c;};'use strict';var pdf=require(_0x29d4('0x0'));var emlformat=require(_0x29d4('0x1'));var rimraf=require(_0x29d4('0x2'));var zipdir=require(_0x29d4('0x3'));var jsonpatch=require(_0x29d4('0x4'));var rp=require(_0x29d4('0x5'));var moment=require(_0x29d4('0x6'));var BPromise=require(_0x29d4('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x29d4('0x8'));var sox=require(_0x29d4('0x9'));var csv=require(_0x29d4('0xa'));var ejs=require(_0x29d4('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x29d4('0xc'));var crypto=require(_0x29d4('0xd'));var jsforce=require(_0x29d4('0xe'));var deskjs=require(_0x29d4('0xf'));var toCsv=require(_0x29d4('0xa'));var querystring=require(_0x29d4('0x10'));var Papa=require(_0x29d4('0x11'));var Redis=require(_0x29d4('0x12'));var authService=require(_0x29d4('0x13'));var qs=require(_0x29d4('0x14'));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(_0x29d4('0x15'));var db=require(_0x29d4('0x16'))['db'];function respondWithStatusCode(_0x315d46,_0x3900fb){_0x3900fb=_0x3900fb||0xcc;return function(_0x1577d8){if(_0x1577d8){return _0x315d46[_0x29d4('0x17')](_0x3900fb);}return _0x315d46[_0x29d4('0x18')](_0x3900fb)['end']();};}function respondWithResult(_0x4d39c5,_0x438a3a){_0x438a3a=_0x438a3a||0xc8;return function(_0x586177){if(_0x586177){return _0x4d39c5[_0x29d4('0x18')](_0x438a3a)[_0x29d4('0x19')](_0x586177);}};}function respondWithFilteredResult(_0x41168f,_0x4a606f){return function(_0x1924ee){if(_0x1924ee){var _0x15a717=_0x1924ee[_0x29d4('0x1a')],_0x451e84=_0x4a606f[_0x29d4('0x1b')],_0x5513d5=_0x4a606f[_0x29d4('0x1b')]+_0x4a606f[_0x29d4('0x1c')],_0x17ffa3;if(_0x5513d5>=_0x15a717){_0x5513d5=_0x15a717;_0x17ffa3=0xc8;}else{_0x17ffa3=0xce;}_0x41168f['status'](_0x17ffa3);return _0x41168f[_0x29d4('0x1d')](_0x29d4('0x1e'),_0x451e84+'-'+_0x5513d5+'/'+_0x15a717)[_0x29d4('0x19')](_0x1924ee);}return null;};}function patchUpdates(_0x90f771){return function(_0xa650f){try{jsonpatch[_0x29d4('0x1f')](_0xa650f,_0x90f771,!![]);}catch(_0x2948a8){return BPromise[_0x29d4('0x20')](_0x2948a8);}return _0xa650f[_0x29d4('0x21')]();};}function saveUpdates(_0x4efe06,_0xfccf7a){return function(_0x422b2d){if(_0x422b2d){return _0x422b2d[_0x29d4('0x22')](_0x4efe06)[_0x29d4('0x23')](function(_0x791c2c){return _0x791c2c;});}return null;};}function removeEntity(_0x7b94fa,_0xc4240e){return function(_0x24e518){if(_0x24e518){return _0x24e518[_0x29d4('0x24')]()[_0x29d4('0x23')](function(){_0x7b94fa[_0x29d4('0x18')](0xcc)[_0x29d4('0x25')]();});}};}function handleEntityNotFound(_0x157213,_0x194979){return function(_0x1b13bd){if(!_0x1b13bd){_0x157213[_0x29d4('0x17')](0x194);}return _0x1b13bd;};}function handleError(_0x13e9eb,_0xf23a45){_0xf23a45=_0xf23a45||0x1f4;return function(_0x4d3469){logger[_0x29d4('0x26')](_0x4d3469[_0x29d4('0x27')]);if(_0x4d3469[_0x29d4('0x28')]){delete _0x4d3469[_0x29d4('0x28')];}_0x13e9eb['status'](_0xf23a45)['send'](_0x4d3469);};}exports['index']=function(_0x119b7d,_0x442212){var _0x49f7b5={},_0x897390={},_0x5cae2d={'count':0x0,'rows':[]};var _0xdd2e60=_[_0x29d4('0x29')](db[_0x29d4('0x2a')][_0x29d4('0x2b')],function(_0x137983){return{'name':_0x137983[_0x29d4('0x2c')],'type':_0x137983[_0x29d4('0x2d')][_0x29d4('0x2e')]};});_0x897390[_0x29d4('0x2f')]=_[_0x29d4('0x29')](_0xdd2e60,_0x29d4('0x28'));_0x897390[_0x29d4('0x30')]=_[_0x29d4('0x31')](_0x119b7d[_0x29d4('0x30')]);_0x897390[_0x29d4('0x32')]=_[_0x29d4('0x33')](_0x897390['model'],_0x897390[_0x29d4('0x30')]);_0x49f7b5[_0x29d4('0x34')]=_[_0x29d4('0x33')](_0x897390[_0x29d4('0x2f')],qs[_0x29d4('0x35')](_0x119b7d[_0x29d4('0x30')][_0x29d4('0x35')]));_0x49f7b5[_0x29d4('0x34')]=_0x49f7b5['attributes'][_0x29d4('0x36')]?_0x49f7b5['attributes']:_0x897390[_0x29d4('0x2f')];if(!_0x119b7d[_0x29d4('0x30')][_0x29d4('0x37')](_0x29d4('0x38'))){_0x49f7b5[_0x29d4('0x1c')]=qs[_0x29d4('0x1c')](_0x119b7d[_0x29d4('0x30')][_0x29d4('0x1c')]);_0x49f7b5[_0x29d4('0x1b')]=qs[_0x29d4('0x1b')](_0x119b7d[_0x29d4('0x30')]['offset']);}_0x49f7b5[_0x29d4('0x39')]=qs[_0x29d4('0x3a')](_0x119b7d[_0x29d4('0x30')][_0x29d4('0x3a')]);_0x49f7b5[_0x29d4('0x3b')]=qs[_0x29d4('0x32')](_[_0x29d4('0x3c')](_0x119b7d['query'],_0x897390['filters']));if(_0x119b7d['query'][_0x29d4('0x3d')]){_0x49f7b5[_0x29d4('0x3b')]=_[_0x29d4('0x3e')](_0x49f7b5['where'],{'$or':_['map'](_0xdd2e60,function(_0x2af0d2){if(_0x2af0d2[_0x29d4('0x2d')]!==_0x29d4('0x3f')){var _0x52287a={};_0x52287a[_0x2af0d2[_0x29d4('0x28')]]={'$like':'%'+_0x119b7d[_0x29d4('0x30')]['filter']+'%'};return _0x52287a;}})});}_0x49f7b5=_[_0x29d4('0x3e')]({},_0x49f7b5,_0x119b7d[_0x29d4('0x40')]);var _0x2a8107={'where':_0x49f7b5[_0x29d4('0x3b')]};return db['VoiceQueuesLog']['count'](_0x2a8107)[_0x29d4('0x23')](function(_0x598f10){_0x5cae2d[_0x29d4('0x1a')]=_0x598f10;if(_0x119b7d['query'][_0x29d4('0x41')]){_0x49f7b5[_0x29d4('0x42')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x29d4('0x43')](_0x49f7b5);})[_0x29d4('0x23')](function(_0x2a9bcb){_0x5cae2d[_0x29d4('0x44')]=_0x2a9bcb;return _0x5cae2d;})['then'](respondWithFilteredResult(_0x442212,_0x49f7b5))[_0x29d4('0x45')](handleError(_0x442212,null));};exports['show']=function(_0x3c5655,_0x6f7889){var _0x44db67={'raw':!![],'where':{'id':_0x3c5655['params']['id']}},_0x297e5e={};_0x297e5e[_0x29d4('0x2f')]=_[_0x29d4('0x31')](db['VoiceQueuesLog'][_0x29d4('0x2b')]);_0x297e5e[_0x29d4('0x30')]=_['keys'](_0x3c5655[_0x29d4('0x30')]);_0x297e5e[_0x29d4('0x32')]=_['intersection'](_0x297e5e[_0x29d4('0x2f')],_0x297e5e['query']);_0x44db67[_0x29d4('0x34')]=_[_0x29d4('0x33')](_0x297e5e[_0x29d4('0x2f')],qs[_0x29d4('0x35')](_0x3c5655[_0x29d4('0x30')][_0x29d4('0x35')]));_0x44db67[_0x29d4('0x34')]=_0x44db67[_0x29d4('0x34')][_0x29d4('0x36')]?_0x44db67[_0x29d4('0x34')]:_0x297e5e[_0x29d4('0x2f')];if(_0x3c5655[_0x29d4('0x30')][_0x29d4('0x41')]){_0x44db67[_0x29d4('0x42')]=[{'all':!![]}];}_0x44db67=_['merge']({},_0x44db67,_0x3c5655['options']);return db[_0x29d4('0x2a')]['find'](_0x44db67)['then'](handleEntityNotFound(_0x6f7889,null))[_0x29d4('0x23')](respondWithResult(_0x6f7889,null))[_0x29d4('0x45')](handleError(_0x6f7889,null));};exports[_0x29d4('0x46')]=function(_0x5546f7,_0x22611c){return db[_0x29d4('0x2a')][_0x29d4('0x46')](_0x5546f7[_0x29d4('0x47')],{})[_0x29d4('0x23')](respondWithResult(_0x22611c,0xc9))[_0x29d4('0x45')](handleError(_0x22611c,null));};exports['update']=function(_0x14d272,_0x4393aa){if(_0x14d272[_0x29d4('0x47')]['id']){delete _0x14d272[_0x29d4('0x47')]['id'];}return db[_0x29d4('0x2a')][_0x29d4('0x48')]({'where':{'id':_0x14d272['params']['id']}})[_0x29d4('0x23')](handleEntityNotFound(_0x4393aa,null))[_0x29d4('0x23')](saveUpdates(_0x14d272['body'],null))[_0x29d4('0x23')](respondWithResult(_0x4393aa,null))['catch'](handleError(_0x4393aa,null));};exports[_0x29d4('0x24')]=function(_0x1623fb,_0x4cee66){return db[_0x29d4('0x2a')][_0x29d4('0x48')]({'where':{'id':_0x1623fb[_0x29d4('0x49')]['id']}})['then'](handleEntityNotFound(_0x4cee66,null))[_0x29d4('0x23')](removeEntity(_0x4cee66,null))[_0x29d4('0x45')](handleError(_0x4cee66,null));}; \ No newline at end of file +var _0x0fe1=['rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','destroy','then','end','error','name','index','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map','VIRTUAL','filter','options','VoiceQueuesLog','show','params','includeAll','include','catch','create','body','update','find','html-pdf'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x0fe1,0x1a9));var _0x10fe=function(_0x2f6799,_0x4e7f00){_0x2f6799=_0x2f6799-0x0;var _0x3cb26f=_0x0fe1[_0x2f6799];return _0x3cb26f;};'use strict';var pdf=require(_0x10fe('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x10fe('0x1'));var zipdir=require(_0x10fe('0x2'));var jsonpatch=require(_0x10fe('0x3'));var rp=require('request-promise');var moment=require(_0x10fe('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x10fe('0x5'));var path=require(_0x10fe('0x6'));var sox=require(_0x10fe('0x7'));var csv=require(_0x10fe('0x8'));var ejs=require(_0x10fe('0x9'));var fs=require('fs');var _=require(_0x10fe('0xa'));var squel=require(_0x10fe('0xb'));var crypto=require(_0x10fe('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x10fe('0xd'));var toCsv=require(_0x10fe('0x8'));var querystring=require('querystring');var Papa=require(_0x10fe('0xe'));var Redis=require(_0x10fe('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x10fe('0x10'));var as=require(_0x10fe('0x11'));var hardwareService=require(_0x10fe('0x12'));var logger=require('../../config/logger')(_0x10fe('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x10fe('0x14'))['db'];function respondWithStatusCode(_0x4d0a1a,_0x18e2c5){_0x18e2c5=_0x18e2c5||0xcc;return function(_0x29df41){if(_0x29df41){return _0x4d0a1a[_0x10fe('0x15')](_0x18e2c5);}return _0x4d0a1a['status'](_0x18e2c5)['end']();};}function respondWithResult(_0x298a75,_0x3f2b1a){_0x3f2b1a=_0x3f2b1a||0xc8;return function(_0x2db40b){if(_0x2db40b){return _0x298a75[_0x10fe('0x16')](_0x3f2b1a)['json'](_0x2db40b);}};}function respondWithFilteredResult(_0x50cb12,_0x6fcce6){return function(_0x33b99c){if(_0x33b99c){var _0x47b54d=_0x33b99c[_0x10fe('0x17')],_0xe2ba7c=_0x6fcce6[_0x10fe('0x18')],_0x1fd43f=_0x6fcce6['offset']+_0x6fcce6['limit'],_0x59181b;if(_0x1fd43f>=_0x47b54d){_0x1fd43f=_0x47b54d;_0x59181b=0xc8;}else{_0x59181b=0xce;}_0x50cb12[_0x10fe('0x16')](_0x59181b);return _0x50cb12[_0x10fe('0x19')](_0x10fe('0x1a'),_0xe2ba7c+'-'+_0x1fd43f+'/'+_0x47b54d)[_0x10fe('0x1b')](_0x33b99c);}return null;};}function patchUpdates(_0x3a7694){return function(_0x5e70da){try{jsonpatch[_0x10fe('0x1c')](_0x5e70da,_0x3a7694,!![]);}catch(_0x7dc888){return BPromise[_0x10fe('0x1d')](_0x7dc888);}return _0x5e70da[_0x10fe('0x1e')]();};}function saveUpdates(_0x240109,_0x2d8b68){return function(_0x5888c9){if(_0x5888c9){return _0x5888c9['update'](_0x240109)['then'](function(_0x46656c){return _0x46656c;});}return null;};}function removeEntity(_0x3be6e9,_0x58f991){return function(_0x46be60){if(_0x46be60){return _0x46be60[_0x10fe('0x1f')]()[_0x10fe('0x20')](function(){_0x3be6e9[_0x10fe('0x16')](0xcc)[_0x10fe('0x21')]();});}};}function handleEntityNotFound(_0x52f332,_0x52a03d){return function(_0x539f8c){if(!_0x539f8c){_0x52f332[_0x10fe('0x15')](0x194);}return _0x539f8c;};}function handleError(_0x22ed97,_0x3a4d42){_0x3a4d42=_0x3a4d42||0x1f4;return function(_0x17a0b1){logger[_0x10fe('0x22')](_0x17a0b1['stack']);if(_0x17a0b1[_0x10fe('0x23')]){delete _0x17a0b1['name'];}_0x22ed97['status'](_0x3a4d42)['send'](_0x17a0b1);};}exports[_0x10fe('0x24')]=function(_0xb9428e,_0x4556d4){var _0x48e5cf={},_0x1a3cdc={},_0x383c60={'count':0x0,'rows':[]};var _0xe56796=_['map'](db['VoiceQueuesLog'][_0x10fe('0x25')],function(_0x3e6232){return{'name':_0x3e6232[_0x10fe('0x26')],'type':_0x3e6232[_0x10fe('0x27')][_0x10fe('0x28')]};});_0x1a3cdc['model']=_['map'](_0xe56796,_0x10fe('0x23'));_0x1a3cdc[_0x10fe('0x29')]=_[_0x10fe('0x2a')](_0xb9428e[_0x10fe('0x29')]);_0x1a3cdc[_0x10fe('0x2b')]=_[_0x10fe('0x2c')](_0x1a3cdc[_0x10fe('0x2d')],_0x1a3cdc[_0x10fe('0x29')]);_0x48e5cf[_0x10fe('0x2e')]=_[_0x10fe('0x2c')](_0x1a3cdc['model'],qs[_0x10fe('0x2f')](_0xb9428e['query'][_0x10fe('0x2f')]));_0x48e5cf['attributes']=_0x48e5cf[_0x10fe('0x2e')][_0x10fe('0x30')]?_0x48e5cf[_0x10fe('0x2e')]:_0x1a3cdc[_0x10fe('0x2d')];if(!_0xb9428e[_0x10fe('0x29')][_0x10fe('0x31')](_0x10fe('0x32'))){_0x48e5cf[_0x10fe('0x33')]=qs[_0x10fe('0x33')](_0xb9428e[_0x10fe('0x29')][_0x10fe('0x33')]);_0x48e5cf[_0x10fe('0x18')]=qs[_0x10fe('0x18')](_0xb9428e['query']['offset']);}_0x48e5cf[_0x10fe('0x34')]=qs[_0x10fe('0x35')](_0xb9428e[_0x10fe('0x29')][_0x10fe('0x35')]);_0x48e5cf[_0x10fe('0x36')]=qs['filters'](_[_0x10fe('0x37')](_0xb9428e['query'],_0x1a3cdc[_0x10fe('0x2b')]));if(_0xb9428e[_0x10fe('0x29')]['filter']){_0x48e5cf[_0x10fe('0x36')]=_[_0x10fe('0x38')](_0x48e5cf['where'],{'$or':_[_0x10fe('0x39')](_0xe56796,function(_0xf75780){if(_0xf75780[_0x10fe('0x27')]!==_0x10fe('0x3a')){var _0x1ad845={};_0x1ad845[_0xf75780[_0x10fe('0x23')]]={'$like':'%'+_0xb9428e['query'][_0x10fe('0x3b')]+'%'};return _0x1ad845;}})});}_0x48e5cf=_[_0x10fe('0x38')]({},_0x48e5cf,_0xb9428e[_0x10fe('0x3c')]);var _0x59e24a={'where':_0x48e5cf[_0x10fe('0x36')]};return db[_0x10fe('0x3d')][_0x10fe('0x17')](_0x59e24a)['then'](function(_0x337024){_0x383c60[_0x10fe('0x17')]=_0x337024;if(_0xb9428e[_0x10fe('0x29')]['includeAll']){_0x48e5cf['include']=[{'all':!![]}];}return db['VoiceQueuesLog']['findAll'](_0x48e5cf);})[_0x10fe('0x20')](function(_0x332f57){_0x383c60['rows']=_0x332f57;return _0x383c60;})[_0x10fe('0x20')](respondWithFilteredResult(_0x4556d4,_0x48e5cf))['catch'](handleError(_0x4556d4,null));};exports[_0x10fe('0x3e')]=function(_0x26a749,_0x478e64){var _0x5e39fc={'raw':!![],'where':{'id':_0x26a749[_0x10fe('0x3f')]['id']}},_0x448a79={};_0x448a79[_0x10fe('0x2d')]=_[_0x10fe('0x2a')](db[_0x10fe('0x3d')][_0x10fe('0x25')]);_0x448a79[_0x10fe('0x29')]=_[_0x10fe('0x2a')](_0x26a749['query']);_0x448a79[_0x10fe('0x2b')]=_[_0x10fe('0x2c')](_0x448a79[_0x10fe('0x2d')],_0x448a79['query']);_0x5e39fc[_0x10fe('0x2e')]=_[_0x10fe('0x2c')](_0x448a79[_0x10fe('0x2d')],qs['fields'](_0x26a749[_0x10fe('0x29')][_0x10fe('0x2f')]));_0x5e39fc[_0x10fe('0x2e')]=_0x5e39fc[_0x10fe('0x2e')][_0x10fe('0x30')]?_0x5e39fc[_0x10fe('0x2e')]:_0x448a79[_0x10fe('0x2d')];if(_0x26a749[_0x10fe('0x29')][_0x10fe('0x40')]){_0x5e39fc[_0x10fe('0x41')]=[{'all':!![]}];}_0x5e39fc=_[_0x10fe('0x38')]({},_0x5e39fc,_0x26a749[_0x10fe('0x3c')]);return db[_0x10fe('0x3d')]['find'](_0x5e39fc)[_0x10fe('0x20')](handleEntityNotFound(_0x478e64,null))[_0x10fe('0x20')](respondWithResult(_0x478e64,null))[_0x10fe('0x42')](handleError(_0x478e64,null));};exports[_0x10fe('0x43')]=function(_0x58bac4,_0x39d9bf){return db[_0x10fe('0x3d')]['create'](_0x58bac4[_0x10fe('0x44')],{})[_0x10fe('0x20')](respondWithResult(_0x39d9bf,0xc9))[_0x10fe('0x42')](handleError(_0x39d9bf,null));};exports[_0x10fe('0x45')]=function(_0x290297,_0xa08c15){if(_0x290297[_0x10fe('0x44')]['id']){delete _0x290297[_0x10fe('0x44')]['id'];}return db[_0x10fe('0x3d')][_0x10fe('0x46')]({'where':{'id':_0x290297[_0x10fe('0x3f')]['id']}})['then'](handleEntityNotFound(_0xa08c15,null))['then'](saveUpdates(_0x290297[_0x10fe('0x44')],null))[_0x10fe('0x20')](respondWithResult(_0xa08c15,null))[_0x10fe('0x42')](handleError(_0xa08c15,null));};exports[_0x10fe('0x1f')]=function(_0x37401a,_0x53741a){return db[_0x10fe('0x3d')]['find']({'where':{'id':_0x37401a['params']['id']}})[_0x10fe('0x20')](handleEntityNotFound(_0x53741a,null))['then'](removeEntity(_0x53741a,null))[_0x10fe('0x42')](handleError(_0x53741a,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index b584421..aa39eed 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 _0xc087=['rimraf','../../config/environment','voice_queues_log','event','dtm','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x7f1ac3,_0x4085fa){var _0x40d1d4=function(_0x5575dc){while(--_0x5575dc){_0x7f1ac3['push'](_0x7f1ac3['shift']());}};_0x40d1d4(++_0x4085fa);}(_0xc087,0xe1));var _0x7c08=function(_0x407bd8,_0x277add){_0x407bd8=_0x407bd8-0x0;var _0x20b6c9=_0xc087[_0x407bd8];return _0x20b6c9;};'use strict';var _=require('lodash');var util=require(_0x7c08('0x0'));var logger=require(_0x7c08('0x1'))(_0x7c08('0x2'));var moment=require(_0x7c08('0x3'));var BPromise=require(_0x7c08('0x4'));var rp=require(_0x7c08('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c08('0x6'));var config=require(_0x7c08('0x7'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x2205e5,_0x1f6568){return _0x2205e5['define']('VoiceQueuesLog',attributes,{'tableName':_0x7c08('0x8'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x7c08('0x9'),_0x7c08('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0x2c13=['request-promise','path','../../config/environment','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','api','moment','bluebird'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0x2c13,0x194));var _0x32c1=function(_0x2daf4b,_0xb88e2b){_0x2daf4b=_0x2daf4b-0x0;var _0x879c54=_0x2c13[_0x2daf4b];return _0x879c54;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x32c1('0x0'));var moment=require(_0x32c1('0x1'));var BPromise=require(_0x32c1('0x2'));var rp=require(_0x32c1('0x3'));var fs=require('fs');var path=require(_0x32c1('0x4'));var rimraf=require('rimraf');var config=require(_0x32c1('0x5'));var attributes=require('./voiceQueuesLog.attributes');module[_0x32c1('0x6')]=function(_0x3ba550,_0x21e937){return _0x3ba550[_0x32c1('0x7')](_0x32c1('0x8'),attributes,{'tableName':_0x32c1('0x9'),'paranoid':![],'indexes':[{'name':_0x32c1('0xa'),'fields':['event','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 5a024b7..6f3793b 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 _0x42f4=['jayson/promise','http','then','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment'];(function(_0x5e10ce,_0x102392){var _0x3ca8bf=function(_0x12414c){while(--_0x12414c){_0x5e10ce['push'](_0x5e10ce['shift']());}};_0x3ca8bf(++_0x102392);}(_0x42f4,0x19d));var _0x442f=function(_0x1e3671,_0x9ae4fc){_0x1e3671=_0x1e3671-0x0;var _0x48d5f5=_0x42f4[_0x1e3671];return _0x48d5f5;};'use strict';var _=require(_0x442f('0x0'));var util=require('util');var moment=require(_0x442f('0x1'));var BPromise=require(_0x442f('0x2'));var rs=require(_0x442f('0x3'));var fs=require('fs');var Redis=require(_0x442f('0x4'));var db=require(_0x442f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x442f('0x6'));var jayson=require(_0x442f('0x7'));var client=jayson['client'][_0x442f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11b450,_0x23c5ba,_0x37dfe7){return new BPromise(function(_0x6c0b4b,_0x476480){return client['request'](_0x11b450,_0x37dfe7)[_0x442f('0x9')](function(_0x4e32af){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x23c5ba,_0x442f('0xa'));logger[_0x442f('0xb')](_0x442f('0xc'),_0x23c5ba,_0x442f('0xa'),JSON[_0x442f('0xd')](_0x4e32af));if(_0x4e32af[_0x442f('0xe')]){if(_0x4e32af[_0x442f('0xe')][_0x442f('0xf')]===0x1f4){logger[_0x442f('0xe')](_0x442f('0x10'),_0x23c5ba,_0x4e32af['error'][_0x442f('0x11')]);return _0x476480(_0x4e32af[_0x442f('0xe')][_0x442f('0x11')]);}logger[_0x442f('0xe')](_0x442f('0x10'),_0x23c5ba,_0x4e32af[_0x442f('0xe')][_0x442f('0x11')]);return _0x6c0b4b(_0x4e32af[_0x442f('0xe')][_0x442f('0x11')]);}else{logger[_0x442f('0x12')](_0x442f('0x10'),_0x23c5ba,_0x442f('0xa'));_0x6c0b4b(_0x4e32af[_0x442f('0x13')][_0x442f('0x11')]);}})[_0x442f('0x14')](function(_0x3ff2b1){logger['error'](_0x442f('0x10'),_0x23c5ba,_0x3ff2b1);_0x476480(_0x3ff2b1);});});} \ No newline at end of file +var _0x49f8=['message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x210638,_0x3960b3){var _0x468213=function(_0x32d064){while(--_0x32d064){_0x210638['push'](_0x210638['shift']());}};_0x468213(++_0x3960b3);}(_0x49f8,0xff));var _0x849f=function(_0x55caea,_0x3bbd8c){_0x55caea=_0x55caea-0x0;var _0x4004e5=_0x49f8[_0x55caea];return _0x4004e5;};'use strict';var _=require(_0x849f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x849f('0x1'));var rs=require(_0x849f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x849f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x849f('0x4'))('rpc');var config=require(_0x849f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x849f('0x6')][_0x849f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x21f577,_0xb4c798,_0x33b630){return new BPromise(function(_0xc6443e,_0x565438){return client['request'](_0x21f577,_0x33b630)['then'](function(_0x306c11){logger[_0x849f('0x8')](_0x849f('0x9'),_0xb4c798,_0x849f('0xa'));logger[_0x849f('0xb')](_0x849f('0xc'),_0xb4c798,_0x849f('0xa'),JSON['stringify'](_0x306c11));if(_0x306c11[_0x849f('0xd')]){if(_0x306c11['error'][_0x849f('0xe')]===0x1f4){logger[_0x849f('0xd')](_0x849f('0x9'),_0xb4c798,_0x306c11[_0x849f('0xd')]['message']);return _0x565438(_0x306c11[_0x849f('0xd')][_0x849f('0xf')]);}logger[_0x849f('0xd')](_0x849f('0x9'),_0xb4c798,_0x306c11[_0x849f('0xd')]['message']);return _0xc6443e(_0x306c11['error'][_0x849f('0xf')]);}else{logger['info'](_0x849f('0x9'),_0xb4c798,_0x849f('0xa'));_0xc6443e(_0x306c11[_0x849f('0x10')][_0x849f('0xf')]);}})[_0x849f('0x11')](function(_0x19ba28){logger[_0x849f('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0xb4c798,_0x19ba28);_0x565438(_0x19ba28);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 6e5b7e8..bed314c 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 _0x1913=['delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceRecording.controller','index','get','/describe','isAuthenticated','describe','/:id','show','download','downloads','create','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1913,0x66));var _0x3191=function(_0x24b801,_0x3aeb72){_0x24b801=_0x24b801-0x0;var _0x4e7855=_0x1913[_0x24b801];return _0x4e7855;};'use strict';var multer=require(_0x3191('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3191('0x1'));var express=require(_0x3191('0x2'));var router=express[_0x3191('0x3')]();var auth=require(_0x3191('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3191('0x5'));var controller=require(_0x3191('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x3191('0x7')]);router[_0x3191('0x8')](_0x3191('0x9'),auth[_0x3191('0xa')](),controller[_0x3191('0xb')]);router[_0x3191('0x8')](_0x3191('0xc'),auth[_0x3191('0xa')](),controller[_0x3191('0xd')]);router[_0x3191('0x8')]('/:id/download',auth[_0x3191('0xa')](),controller[_0x3191('0xe')]);router[_0x3191('0x8')]('/:id/downloads',controller[_0x3191('0xf')]);router['post']('/',auth[_0x3191('0xa')](),controller[_0x3191('0x10')]);router['put']('/:id',auth[_0x3191('0xa')](),controller[_0x3191('0x11')]);router[_0x3191('0x12')](_0x3191('0xc'),auth[_0x3191('0xa')](),controller[_0x3191('0x13')]);module['exports']=router; \ No newline at end of file +var _0x570d=['create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','/:id/downloads'];(function(_0x142156,_0x5169f8){var _0x5b1ea3=function(_0x26080b){while(--_0x26080b){_0x142156['push'](_0x142156['shift']());}};_0x5b1ea3(++_0x5169f8);}(_0x570d,0x1e9));var _0xd570=function(_0x24fc4c,_0xbe330){_0x24fc4c=_0x24fc4c-0x0;var _0xf2cb7a=_0x570d[_0x24fc4c];return _0xf2cb7a;};'use strict';var multer=require(_0xd570('0x0'));var util=require(_0xd570('0x1'));var path=require(_0xd570('0x2'));var timeout=require(_0xd570('0x3'));var express=require(_0xd570('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xd570('0x5'));var config=require(_0xd570('0x6'));var controller=require(_0xd570('0x7'));router[_0xd570('0x8')]('/',auth[_0xd570('0x9')](),controller[_0xd570('0xa')]);router[_0xd570('0x8')](_0xd570('0xb'),auth[_0xd570('0x9')](),controller[_0xd570('0xc')]);router[_0xd570('0x8')]('/:id',auth[_0xd570('0x9')](),controller[_0xd570('0xd')]);router[_0xd570('0x8')](_0xd570('0xe'),auth[_0xd570('0x9')](),controller[_0xd570('0xf')]);router['get'](_0xd570('0x10'),controller['downloads']);router['post']('/',auth[_0xd570('0x9')](),controller[_0xd570('0x11')]);router[_0xd570('0x12')]('/:id',auth[_0xd570('0x9')](),controller[_0xd570('0x13')]);router[_0xd570('0x14')]('/:id',auth[_0xd570('0x9')](),controller[_0xd570('0x15')]);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 0544145..5be614b 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 _0x2560=['STRING','setDataValue','channel','membername','INTEGER','DATE','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment','path','exports','VIRTUAL','getDataValue','value','extname'];(function(_0x247502,_0x33d44a){var _0xe6e7d6=function(_0x453341){while(--_0x453341){_0x247502['push'](_0x247502['shift']());}};_0xe6e7d6(++_0x33d44a);}(_0x2560,0x9a));var _0x0256=function(_0x4d9dee,_0x477058){_0x4d9dee=_0x4d9dee-0x0;var _0x1e209c=_0x2560[_0x4d9dee];return _0x1e209c;};'use strict';var Sequelize=require(_0x0256('0x0'));var moment=require(_0x0256('0x1'));var path=require(_0x0256('0x2'));module[_0x0256('0x3')]={'format':{'type':Sequelize[_0x0256('0x4')],'get':function(){return this[_0x0256('0x5')](_0x0256('0x6'))?path[_0x0256('0x7')](this[_0x0256('0x5')](_0x0256('0x6'))):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x0256('0x8')],'set':function(_0x234793){if(_0x234793){this[_0x0256('0x9')](_0x0256('0xa'),_0x234793);this['setDataValue'](_0x0256('0xb'),_0x234793['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0256('0x8')]},'calleridnum':{'type':Sequelize[_0x0256('0x8')]},'calleridname':{'type':Sequelize[_0x0256('0x8')]},'connectedlinenum':{'type':Sequelize[_0x0256('0x8')]},'connectedlinename':{'type':Sequelize[_0x0256('0x8')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x0256('0x8')]},'exten':{'type':Sequelize[_0x0256('0x8')]},'value':{'type':Sequelize[_0x0256('0x8')]},'type':{'type':Sequelize[_0x0256('0x8')]},'rating':{'type':Sequelize[_0x0256('0xc')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x0256('0x8')]},'userDisposition':{'type':Sequelize[_0x0256('0x8')]},'createdAt':{'type':Sequelize[_0x0256('0xd')],'get':function(){return moment(this['getDataValue']('createdAt'))[_0x0256('0xe')](_0x0256('0xf'))[_0x0256('0x10')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0256('0x5')](_0x0256('0x11')))[_0x0256('0xe')](_0x0256('0xf'))[_0x0256('0x10')]();}}}; \ No newline at end of file +var _0x9be2=['updatedAt','sequelize','moment','path','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','channel','membername','split','DATE','format','MM-DD-YYYY\x20HH:mm','toString'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9be2,0x188));var _0x29be=function(_0xff31c7,_0x159e1d){_0xff31c7=_0xff31c7-0x0;var _0x6d8b0f=_0x9be2[_0xff31c7];return _0x6d8b0f;};'use strict';var Sequelize=require(_0x29be('0x0'));var moment=require(_0x29be('0x1'));var path=require(_0x29be('0x2'));module['exports']={'format':{'type':Sequelize[_0x29be('0x3')],'get':function(){return this[_0x29be('0x4')](_0x29be('0x5'))?path[_0x29be('0x6')](this['getDataValue']('value')):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x29be('0x7')],'set':function(_0x31a6e2){if(_0x31a6e2){this[_0x29be('0x8')](_0x29be('0x9'),_0x31a6e2);this['setDataValue'](_0x29be('0xa'),_0x31a6e2[_0x29be('0xb')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x29be('0x7')]},'calleridname':{'type':Sequelize[_0x29be('0x7')]},'connectedlinenum':{'type':Sequelize[_0x29be('0x7')]},'connectedlinename':{'type':Sequelize[_0x29be('0x7')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x29be('0x7')]},'value':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x29be('0x7')]},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x29be('0x7')]},'userDisposition':{'type':Sequelize['STRING']},'createdAt':{'type':Sequelize[_0x29be('0xc')],'get':function(){return moment(this[_0x29be('0x4')]('createdAt'))[_0x29be('0xd')](_0x29be('0xe'))[_0x29be('0xf')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x29be('0x4')](_0x29be('0x10')))['format'](_0x29be('0xe'))[_0x29be('0xf')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 926176d..159c391 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 _0xc893=['nolimit','sort','where','filters','pick','filter','merge','type','options','VoiceRecording','then','includeAll','include','findAll','rows','catch','params','find','create','body','describe','download','uniqueid','value','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','extname','unlink','Not\x20found','../../components/encryptor','sequelize','MD5','col','token','$and','push','recording','filename','info','cancellazione\x20fisica\x20documento\x20%s','unlinkSync','.cypher','isNil','File:\x20\x22','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','differenceBy','format','query','keys','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc893,0x169));var _0x3c89=function(_0x51ae0c,_0x440983){_0x51ae0c=_0x51ae0c-0x0;var _0x47283f=_0xc893[_0x51ae0c];return _0x47283f;};'use strict';var pdf=require(_0x3c89('0x0'));var emlformat=require(_0x3c89('0x1'));var rimraf=require(_0x3c89('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3c89('0x3'));var rp=require(_0x3c89('0x4'));var moment=require(_0x3c89('0x5'));var BPromise=require(_0x3c89('0x6'));var Mustache=require(_0x3c89('0x7'));var util=require(_0x3c89('0x8'));var path=require('path');var sox=require(_0x3c89('0x9'));var csv=require(_0x3c89('0xa'));var ejs=require(_0x3c89('0xb'));var fs=require('fs');var _=require(_0x3c89('0xc'));var squel=require(_0x3c89('0xd'));var crypto=require(_0x3c89('0xe'));var jsforce=require(_0x3c89('0xf'));var deskjs=require(_0x3c89('0x10'));var toCsv=require(_0x3c89('0xa'));var querystring=require('querystring');var Papa=require(_0x3c89('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3c89('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c89('0x13'));var logger=require('../../config/logger')(_0x3c89('0x14'));var utils=require(_0x3c89('0x15'));var config=require(_0x3c89('0x16'));var db=require(_0x3c89('0x17'))['db'];function respondWithStatusCode(_0x8b44a7,_0xc4e80f){_0xc4e80f=_0xc4e80f||0xcc;return function(_0xff81fe){if(_0xff81fe){return _0x8b44a7[_0x3c89('0x18')](_0xc4e80f);}return _0x8b44a7[_0x3c89('0x19')](_0xc4e80f)[_0x3c89('0x1a')]();};}function respondWithResult(_0x420faa,_0x14d9e0){_0x14d9e0=_0x14d9e0||0xc8;return function(_0x46d308){if(_0x46d308){return _0x420faa[_0x3c89('0x19')](_0x14d9e0)[_0x3c89('0x1b')](_0x46d308);}};}function respondWithFilteredResult(_0x78cef5,_0x459089){return function(_0xd18adb){if(_0xd18adb){var _0x1e2813=_0xd18adb[_0x3c89('0x1c')],_0x3a899f=_0x459089[_0x3c89('0x1d')],_0x5ac9b8=_0x459089[_0x3c89('0x1d')]+_0x459089[_0x3c89('0x1e')],_0x21c411;if(_0x5ac9b8>=_0x1e2813){_0x5ac9b8=_0x1e2813;_0x21c411=0xc8;}else{_0x21c411=0xce;}_0x78cef5[_0x3c89('0x19')](_0x21c411);return _0x78cef5[_0x3c89('0x1f')](_0x3c89('0x20'),_0x3a899f+'-'+_0x5ac9b8+'/'+_0x1e2813)[_0x3c89('0x1b')](_0xd18adb);}return null;};}function patchUpdates(_0x5520a3){return function(_0x493910){try{jsonpatch[_0x3c89('0x21')](_0x493910,_0x5520a3,!![]);}catch(_0x4534a9){return BPromise[_0x3c89('0x22')](_0x4534a9);}return _0x493910['save']();};}function saveUpdates(_0x3934c3,_0x2a77cb){return function(_0x40c1fb){if(_0x40c1fb){return _0x40c1fb[_0x3c89('0x23')](_0x3934c3)['then'](function(_0x3721bb){return _0x3721bb;});}return null;};}function removeEntity(_0x48d6e8,_0x296315){return function(_0x31f508){if(_0x31f508){return _0x31f508[_0x3c89('0x24')]()['then'](function(){_0x48d6e8[_0x3c89('0x19')](0xcc)[_0x3c89('0x1a')]();});}};}function handleEntityNotFound(_0x3ad141,_0x311d96){return function(_0x4221aa){if(!_0x4221aa){_0x3ad141[_0x3c89('0x18')](0x194);}return _0x4221aa;};}function handleError(_0x558ad0,_0x4e0f7c){_0x4e0f7c=_0x4e0f7c||0x1f4;return function(_0x33a93f){logger['error'](_0x33a93f[_0x3c89('0x25')]);if(_0x33a93f['name']){delete _0x33a93f[_0x3c89('0x26')];}_0x558ad0[_0x3c89('0x19')](_0x4e0f7c)[_0x3c89('0x27')](_0x33a93f);};}exports[_0x3c89('0x28')]=function(_0xc1ed0f,_0x44a14e){var _0x2d32dd={},_0x50a171={},_0x320842={'count':0x0,'rows':[]};var _0x203b7d=_[_0x3c89('0x29')](db['VoiceRecording'][_0x3c89('0x2a')],function(_0x3f87ab){return{'name':_0x3f87ab[_0x3c89('0x2b')],'type':_0x3f87ab['type'][_0x3c89('0x2c')]};});_0x50a171[_0x3c89('0x2d')]=_[_0x3c89('0x2e')](_[_0x3c89('0x29')](_0x203b7d,_0x3c89('0x26')),[_0x3c89('0x2f')]);_0x50a171[_0x3c89('0x30')]=_[_0x3c89('0x31')](_0xc1ed0f[_0x3c89('0x30')]);_0x50a171['filters']=_[_0x3c89('0x32')](_0x50a171[_0x3c89('0x2d')],_0x50a171[_0x3c89('0x30')]);_0x2d32dd[_0x3c89('0x33')]=_[_0x3c89('0x32')](_0x50a171[_0x3c89('0x2d')],qs[_0x3c89('0x34')](_0xc1ed0f[_0x3c89('0x30')][_0x3c89('0x34')]));_0x2d32dd['attributes']=_0x2d32dd[_0x3c89('0x33')][_0x3c89('0x35')]?_0x2d32dd[_0x3c89('0x33')]:_0x50a171['model'];if(!_0xc1ed0f['query'][_0x3c89('0x36')](_0x3c89('0x37'))){_0x2d32dd[_0x3c89('0x1e')]=qs[_0x3c89('0x1e')](_0xc1ed0f[_0x3c89('0x30')][_0x3c89('0x1e')]);_0x2d32dd['offset']=qs[_0x3c89('0x1d')](_0xc1ed0f['query'][_0x3c89('0x1d')]);}_0x2d32dd['order']=qs[_0x3c89('0x38')](_0xc1ed0f[_0x3c89('0x30')][_0x3c89('0x38')]);_0x2d32dd[_0x3c89('0x39')]=qs[_0x3c89('0x3a')](_[_0x3c89('0x3b')](_0xc1ed0f['query'],_0x50a171['filters']));if(_0xc1ed0f['query'][_0x3c89('0x3c')]){_0x2d32dd['where']=_[_0x3c89('0x3d')](_0x2d32dd['where'],{'$or':_[_0x3c89('0x29')](_0x203b7d,function(_0x51bdf7){if(_0x51bdf7[_0x3c89('0x3e')]!=='VIRTUAL'){var _0x3ff082={};_0x3ff082[_0x51bdf7[_0x3c89('0x26')]]={'$like':'%'+_0xc1ed0f['query'][_0x3c89('0x3c')]+'%'};return _0x3ff082;}})});}_0x2d32dd=_[_0x3c89('0x3d')]({},_0x2d32dd,_0xc1ed0f[_0x3c89('0x3f')]);var _0x1ce435={'where':_0x2d32dd[_0x3c89('0x39')]};return db[_0x3c89('0x40')]['count'](_0x1ce435)[_0x3c89('0x41')](function(_0x3267a7){_0x320842[_0x3c89('0x1c')]=_0x3267a7;if(_0xc1ed0f[_0x3c89('0x30')][_0x3c89('0x42')]){_0x2d32dd[_0x3c89('0x43')]=[{'all':!![]}];}return db[_0x3c89('0x40')][_0x3c89('0x44')](_0x2d32dd);})[_0x3c89('0x41')](function(_0x19d824){_0x320842[_0x3c89('0x45')]=_0x19d824;return _0x320842;})[_0x3c89('0x41')](respondWithFilteredResult(_0x44a14e,_0x2d32dd))[_0x3c89('0x46')](handleError(_0x44a14e,null));};exports['show']=function(_0x52394a,_0x91e066){var _0x11a58f={'raw':![],'where':{'id':_0x52394a[_0x3c89('0x47')]['id']}},_0x1aa84f={};_0x1aa84f[_0x3c89('0x2d')]=_[_0x3c89('0x31')](db[_0x3c89('0x40')][_0x3c89('0x2a')]);_0x1aa84f[_0x3c89('0x30')]=_[_0x3c89('0x31')](_0x52394a[_0x3c89('0x30')]);_0x1aa84f['filters']=_[_0x3c89('0x32')](_0x1aa84f[_0x3c89('0x2d')],_0x1aa84f[_0x3c89('0x30')]);_0x11a58f[_0x3c89('0x33')]=_[_0x3c89('0x32')](_0x1aa84f['model'],qs[_0x3c89('0x34')](_0x52394a['query']['fields']));_0x11a58f['attributes']=_0x11a58f[_0x3c89('0x33')][_0x3c89('0x35')]?_0x11a58f[_0x3c89('0x33')]:_0x1aa84f[_0x3c89('0x2d')];if(_0x52394a['query']['includeAll']){_0x11a58f['include']=[{'all':!![]}];}_0x11a58f=_['merge']({},_0x11a58f,_0x52394a['options']);return db[_0x3c89('0x40')][_0x3c89('0x48')](_0x11a58f)[_0x3c89('0x41')](handleEntityNotFound(_0x91e066,null))[_0x3c89('0x41')](respondWithResult(_0x91e066,null))[_0x3c89('0x46')](handleError(_0x91e066,null));};exports[_0x3c89('0x49')]=function(_0x3cfd26,_0x1ffd32){return db['VoiceRecording'][_0x3c89('0x49')](_0x3cfd26[_0x3c89('0x4a')],{})[_0x3c89('0x41')](respondWithResult(_0x1ffd32,0xc9))[_0x3c89('0x46')](handleError(_0x1ffd32,null));};exports[_0x3c89('0x23')]=function(_0x512dd7,_0x1b93d7){if(_0x512dd7[_0x3c89('0x4a')]['id']){delete _0x512dd7[_0x3c89('0x4a')]['id'];}return db['VoiceRecording'][_0x3c89('0x48')]({'where':{'id':_0x512dd7[_0x3c89('0x47')]['id']}})[_0x3c89('0x41')](handleEntityNotFound(_0x1b93d7,null))[_0x3c89('0x41')](saveUpdates(_0x512dd7[_0x3c89('0x4a')],null))[_0x3c89('0x41')](respondWithResult(_0x1b93d7,null))['catch'](handleError(_0x1b93d7,null));};exports[_0x3c89('0x4b')]=function(_0x3904ab,_0x19ed2c){return db[_0x3c89('0x40')][_0x3c89('0x4b')]()[_0x3c89('0x41')](respondWithResult(_0x19ed2c,null))[_0x3c89('0x46')](handleError(_0x19ed2c,null));};exports[_0x3c89('0x4c')]=function(_0x503a29,_0x356c65,_0xb7d6c6){var _0x4713b9=require('../../components/encryptor');var _0x57a036=![];var _0x4b4d7a={};if(_0x503a29[_0x3c89('0x30')][_0x3c89('0x3e')]&&_0x503a29[_0x3c89('0x30')][_0x3c89('0x3e')]===_0x3c89('0x4d')){_0x4b4d7a[_0x3c89('0x4d')]=_0x503a29['params']['id'];}else{_0x4b4d7a['id']=_0x503a29[_0x3c89('0x47')]['id'];}return db[_0x3c89('0x40')]['find']({'where':_0x4b4d7a,'attributes':['id',_0x3c89('0x4e')],'raw':!![]})[_0x3c89('0x41')](handleEntityNotFound(_0x356c65,null))[_0x3c89('0x41')](function(_0x5bffde){if(_0x5bffde){var _0x3cc5b7=_0x5bffde[_0x3c89('0x4e')];var _0x163878=util[_0x3c89('0x2f')](_0x3c89('0x4f'),_0x3cc5b7);if(fs['existsSync'](_0x163878)){_0x57a036=!![];return _0x4713b9[_0x3c89('0x50')](_0x163878,_0x3cc5b7,config[_0x3c89('0x51')]['recording'])[_0x3c89('0x41')](function(){return _0x5bffde;});}return _0x5bffde;}})[_0x3c89('0x41')](function(_0x1021ef){if(_0x1021ef){var _0x31665e=_0x1021ef[_0x3c89('0x4e')];if(!fs[_0x3c89('0x52')](_0x31665e)){throw new db[(_0x3c89('0x53'))][(_0x3c89('0x54'))](_0x3c89('0x55'));}if(_0x1021ef['filename']){return _0x356c65[_0x3c89('0x4c')](_0x31665e,_0x1021ef['filename']+path[_0x3c89('0x56')](_0x31665e),function(){if(_0x57a036){fs[_0x3c89('0x57')](_0x31665e);}});}else{return _0x356c65[_0x3c89('0x4c')](_0x31665e,function(_0x4ba67c){if(_0x57a036){fs[_0x3c89('0x57')](_0x31665e);}});}}})[_0x3c89('0x46')](function(_0x330d00){if(_0x330d00['message']==='VoiceRecording\x20not\x20found'){_0x356c65['status'](0x194)[_0x3c89('0x27')](_0x3c89('0x58'));}else{return handleError(_0x356c65,null);}});};exports['downloads']=function(_0x2ae6d7,_0x4cd252,_0x5869a6){var _0x4fde4a=require(_0x3c89('0x59'));var _0xed8267=![];var _0x53a2b1={'$and':[db['sequelize'][_0x3c89('0x39')](db[_0x3c89('0x5a')]['fn'](_0x3c89('0x5b'),db[_0x3c89('0x5a')][_0x3c89('0x5c')](_0x3c89('0x4d'))),_0x2ae6d7[_0x3c89('0x30')][_0x3c89('0x5d')])]};if(_0x2ae6d7[_0x3c89('0x30')]['type']&&_0x2ae6d7['query'][_0x3c89('0x3e')]===_0x3c89('0x4d')){_0x53a2b1[_0x3c89('0x5e')]['push']({'uniqueid':_0x2ae6d7['params']['id']});}else{_0x53a2b1[_0x3c89('0x5e')][_0x3c89('0x5f')]({'id':_0x2ae6d7[_0x3c89('0x47')]['id']});}return db[_0x3c89('0x40')][_0x3c89('0x48')]({'where':_0x53a2b1,'attributes':['id',_0x3c89('0x4e')],'raw':!![]})[_0x3c89('0x41')](handleEntityNotFound(_0x4cd252,null))[_0x3c89('0x41')](function(_0x10483a){if(_0x10483a){var _0xe9d8ff=util['format']('%s.cypher',_0x10483a[_0x3c89('0x4e')]);if(fs[_0x3c89('0x52')](_0xe9d8ff)){_0xed8267=!![];return _0x4fde4a['decryptFile'](_0xe9d8ff,_0x10483a[_0x3c89('0x4e')],config[_0x3c89('0x51')][_0x3c89('0x60')])[_0x3c89('0x41')](function(){return _0x10483a;});}return _0x10483a;}})[_0x3c89('0x41')](function(_0x2f6506){if(_0x2f6506){if(!fs['existsSync'](_0x2f6506[_0x3c89('0x4e')])){throw new db[(_0x3c89('0x53'))][(_0x3c89('0x54'))](_0x3c89('0x55'));}if(_0x2f6506[_0x3c89('0x61')]){return _0x4cd252[_0x3c89('0x4c')](_0x2f6506[_0x3c89('0x4e')],_0x2f6506['filename']+path[_0x3c89('0x56')](_0x2f6506[_0x3c89('0x4e')]),function(){if(_0xed8267){fs[_0x3c89('0x57')](_0x2f6506[_0x3c89('0x4e')]);}});}else{return _0x4cd252['download'](_0x2f6506[_0x3c89('0x4e')],function(_0x798f5){if(_0xed8267){fs[_0x3c89('0x57')](_0x2f6506['value']);}});}}})[_0x3c89('0x46')](handleError(_0x4cd252,null));};exports[_0x3c89('0x24')]=function(_0x4a6d4b,_0x494bb0){return db['VoiceRecording']['find']({'where':{'id':_0x4a6d4b[_0x3c89('0x47')]['id']}})['then'](function(_0x11585e){if(!_0x11585e)throw new ReferenceError('Entity\x20not\x20found');return _0x11585e;})[_0x3c89('0x41')](function(_0x4f6b8a){var _0x1c62d3=_0x4f6b8a[_0x3c89('0x4e')];logger[_0x3c89('0x62')](_0x3c89('0x63'),_0x1c62d3);if(!_['isNil'](_0x4f6b8a['value'])&&fs['existsSync'](_0x1c62d3)){logger[_0x3c89('0x62')]('File:\x20\x22'+_0x1c62d3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x3c89('0x64')](_0x1c62d3);}_0x1c62d3=_0x1c62d3+_0x3c89('0x65');if(!_[_0x3c89('0x66')](_0x4f6b8a[_0x3c89('0x4e')])&&fs['existsSync'](_0x1c62d3)){logger[_0x3c89('0x62')](_0x3c89('0x67')+_0x1c62d3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x3c89('0x64')](_0x1c62d3);}return _0x4f6b8a;})[_0x3c89('0x41')](function(_0x43b1a8){if(!_0x43b1a8)throw new InternalError();return _0x43b1a8['destroy']();})[_0x3c89('0x41')](function(){_0x494bb0[_0x3c89('0x19')](0xcc)[_0x3c89('0x1a')]();})[_0x3c89('0x46')](handleError(_0x494bb0,null));}; \ No newline at end of file +var _0xd00d=['uniqueid','value','existsSync','decryptFile','secrets','recording','ValidationError','VoiceRecording\x20not\x20found','filename','extname','download','unlink','message','Not\x20found','downloads','sequelize','col','token','$and','push','%s.cypher','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','count','offset','limit','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','map','VoiceRecording','rawAttributes','fieldName','key','differenceBy','format','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','filter','merge','options','include','show','params','length','includeAll','find','catch','create','body','describe','../../components/encryptor'];(function(_0x5616f3,_0x1aadb5){var _0x57f4ab=function(_0x1add6c){while(--_0x1add6c){_0x5616f3['push'](_0x5616f3['shift']());}};_0x57f4ab(++_0x1aadb5);}(_0xd00d,0x14e));var _0xdd00=function(_0x47adb8,_0x591ccc){_0x47adb8=_0x47adb8-0x0;var _0x4689a8=_0xd00d[_0x47adb8];return _0x4689a8;};'use strict';var pdf=require(_0xdd00('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdd00('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdd00('0x2'));var rp=require(_0xdd00('0x3'));var moment=require(_0xdd00('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdd00('0x5'));var util=require(_0xdd00('0x6'));var path=require(_0xdd00('0x7'));var sox=require(_0xdd00('0x8'));var csv=require(_0xdd00('0x9'));var ejs=require(_0xdd00('0xa'));var fs=require('fs');var _=require(_0xdd00('0xb'));var squel=require(_0xdd00('0xc'));var crypto=require(_0xdd00('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdd00('0xe'));var Redis=require(_0xdd00('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xdd00('0x10'));var as=require(_0xdd00('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd00('0x12'))(_0xdd00('0x13'));var utils=require(_0xdd00('0x14'));var config=require(_0xdd00('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c6d91,_0x56d717){_0x56d717=_0x56d717||0xcc;return function(_0x30b5cd){if(_0x30b5cd){return _0x4c6d91['sendStatus'](_0x56d717);}return _0x4c6d91['status'](_0x56d717)[_0xdd00('0x16')]();};}function respondWithResult(_0x424fb4,_0x572f5f){_0x572f5f=_0x572f5f||0xc8;return function(_0x2047b7){if(_0x2047b7){return _0x424fb4[_0xdd00('0x17')](_0x572f5f)[_0xdd00('0x18')](_0x2047b7);}};}function respondWithFilteredResult(_0x3201cc,_0x1062b6){return function(_0x4ba06f){if(_0x4ba06f){var _0x382ab8=_0x4ba06f[_0xdd00('0x19')],_0x10bad9=_0x1062b6[_0xdd00('0x1a')],_0x382557=_0x1062b6[_0xdd00('0x1a')]+_0x1062b6[_0xdd00('0x1b')],_0x411aa8;if(_0x382557>=_0x382ab8){_0x382557=_0x382ab8;_0x411aa8=0xc8;}else{_0x411aa8=0xce;}_0x3201cc[_0xdd00('0x17')](_0x411aa8);return _0x3201cc['set']('Content-Range',_0x10bad9+'-'+_0x382557+'/'+_0x382ab8)[_0xdd00('0x18')](_0x4ba06f);}return null;};}function patchUpdates(_0x208094){return function(_0x6d14e3){try{jsonpatch[_0xdd00('0x1c')](_0x6d14e3,_0x208094,!![]);}catch(_0x2a32d6){return BPromise[_0xdd00('0x1d')](_0x2a32d6);}return _0x6d14e3[_0xdd00('0x1e')]();};}function saveUpdates(_0x1aceaf,_0x56657f){return function(_0x583d75){if(_0x583d75){return _0x583d75[_0xdd00('0x1f')](_0x1aceaf)['then'](function(_0x524415){return _0x524415;});}return null;};}function removeEntity(_0x4b9d03,_0x208732){return function(_0x1ab965){if(_0x1ab965){return _0x1ab965[_0xdd00('0x20')]()[_0xdd00('0x21')](function(){_0x4b9d03[_0xdd00('0x17')](0xcc)[_0xdd00('0x16')]();});}};}function handleEntityNotFound(_0x55e465,_0x3f9f21){return function(_0x5a4b15){if(!_0x5a4b15){_0x55e465[_0xdd00('0x22')](0x194);}return _0x5a4b15;};}function handleError(_0x7e4c3e,_0x4ce3cf){_0x4ce3cf=_0x4ce3cf||0x1f4;return function(_0x328b5b){logger[_0xdd00('0x23')](_0x328b5b[_0xdd00('0x24')]);if(_0x328b5b[_0xdd00('0x25')]){delete _0x328b5b[_0xdd00('0x25')];}_0x7e4c3e[_0xdd00('0x17')](_0x4ce3cf)[_0xdd00('0x26')](_0x328b5b);};}exports['index']=function(_0x46f1a1,_0x3d136d){var _0x580ebc={},_0x4da7c4={},_0x50d200={'count':0x0,'rows':[]};var _0x35e4d6=_[_0xdd00('0x27')](db[_0xdd00('0x28')][_0xdd00('0x29')],function(_0x3d2dbd){return{'name':_0x3d2dbd[_0xdd00('0x2a')],'type':_0x3d2dbd['type'][_0xdd00('0x2b')]};});_0x4da7c4['model']=_[_0xdd00('0x2c')](_[_0xdd00('0x27')](_0x35e4d6,'name'),[_0xdd00('0x2d')]);_0x4da7c4[_0xdd00('0x2e')]=_[_0xdd00('0x2f')](_0x46f1a1[_0xdd00('0x2e')]);_0x4da7c4[_0xdd00('0x30')]=_[_0xdd00('0x31')](_0x4da7c4[_0xdd00('0x32')],_0x4da7c4[_0xdd00('0x2e')]);_0x580ebc['attributes']=_[_0xdd00('0x31')](_0x4da7c4['model'],qs[_0xdd00('0x33')](_0x46f1a1[_0xdd00('0x2e')]['fields']));_0x580ebc[_0xdd00('0x34')]=_0x580ebc[_0xdd00('0x34')]['length']?_0x580ebc[_0xdd00('0x34')]:_0x4da7c4[_0xdd00('0x32')];if(!_0x46f1a1[_0xdd00('0x2e')][_0xdd00('0x35')]('nolimit')){_0x580ebc[_0xdd00('0x1b')]=qs['limit'](_0x46f1a1[_0xdd00('0x2e')]['limit']);_0x580ebc[_0xdd00('0x1a')]=qs[_0xdd00('0x1a')](_0x46f1a1[_0xdd00('0x2e')]['offset']);}_0x580ebc[_0xdd00('0x36')]=qs[_0xdd00('0x37')](_0x46f1a1['query'][_0xdd00('0x37')]);_0x580ebc[_0xdd00('0x38')]=qs[_0xdd00('0x30')](_[_0xdd00('0x39')](_0x46f1a1['query'],_0x4da7c4[_0xdd00('0x30')]));if(_0x46f1a1[_0xdd00('0x2e')]['filter']){_0x580ebc[_0xdd00('0x38')]=_['merge'](_0x580ebc[_0xdd00('0x38')],{'$or':_[_0xdd00('0x27')](_0x35e4d6,function(_0x761ae2){if(_0x761ae2[_0xdd00('0x3a')]!==_0xdd00('0x3b')){var _0x2c2936={};_0x2c2936[_0x761ae2[_0xdd00('0x25')]]={'$like':'%'+_0x46f1a1[_0xdd00('0x2e')][_0xdd00('0x3c')]+'%'};return _0x2c2936;}})});}_0x580ebc=_[_0xdd00('0x3d')]({},_0x580ebc,_0x46f1a1[_0xdd00('0x3e')]);var _0x4487b9={'where':_0x580ebc['where']};return db['VoiceRecording']['count'](_0x4487b9)['then'](function(_0x3c49a2){_0x50d200['count']=_0x3c49a2;if(_0x46f1a1[_0xdd00('0x2e')]['includeAll']){_0x580ebc[_0xdd00('0x3f')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x580ebc);})['then'](function(_0x1aaf2b){_0x50d200['rows']=_0x1aaf2b;return _0x50d200;})[_0xdd00('0x21')](respondWithFilteredResult(_0x3d136d,_0x580ebc))['catch'](handleError(_0x3d136d,null));};exports[_0xdd00('0x40')]=function(_0x7959d1,_0x3186a0){var _0x5f044f={'raw':![],'where':{'id':_0x7959d1[_0xdd00('0x41')]['id']}},_0x21cd4a={};_0x21cd4a[_0xdd00('0x32')]=_[_0xdd00('0x2f')](db['VoiceRecording']['rawAttributes']);_0x21cd4a[_0xdd00('0x2e')]=_[_0xdd00('0x2f')](_0x7959d1['query']);_0x21cd4a[_0xdd00('0x30')]=_['intersection'](_0x21cd4a[_0xdd00('0x32')],_0x21cd4a['query']);_0x5f044f[_0xdd00('0x34')]=_[_0xdd00('0x31')](_0x21cd4a[_0xdd00('0x32')],qs[_0xdd00('0x33')](_0x7959d1[_0xdd00('0x2e')][_0xdd00('0x33')]));_0x5f044f[_0xdd00('0x34')]=_0x5f044f[_0xdd00('0x34')][_0xdd00('0x42')]?_0x5f044f[_0xdd00('0x34')]:_0x21cd4a[_0xdd00('0x32')];if(_0x7959d1[_0xdd00('0x2e')][_0xdd00('0x43')]){_0x5f044f['include']=[{'all':!![]}];}_0x5f044f=_[_0xdd00('0x3d')]({},_0x5f044f,_0x7959d1[_0xdd00('0x3e')]);return db['VoiceRecording'][_0xdd00('0x44')](_0x5f044f)[_0xdd00('0x21')](handleEntityNotFound(_0x3186a0,null))['then'](respondWithResult(_0x3186a0,null))[_0xdd00('0x45')](handleError(_0x3186a0,null));};exports[_0xdd00('0x46')]=function(_0x3ec199,_0x5bc9f3){return db[_0xdd00('0x28')]['create'](_0x3ec199[_0xdd00('0x47')],{})[_0xdd00('0x21')](respondWithResult(_0x5bc9f3,0xc9))[_0xdd00('0x45')](handleError(_0x5bc9f3,null));};exports[_0xdd00('0x1f')]=function(_0x14e6d7,_0x327b06){if(_0x14e6d7[_0xdd00('0x47')]['id']){delete _0x14e6d7['body']['id'];}return db['VoiceRecording'][_0xdd00('0x44')]({'where':{'id':_0x14e6d7[_0xdd00('0x41')]['id']}})[_0xdd00('0x21')](handleEntityNotFound(_0x327b06,null))[_0xdd00('0x21')](saveUpdates(_0x14e6d7['body'],null))['then'](respondWithResult(_0x327b06,null))['catch'](handleError(_0x327b06,null));};exports['describe']=function(_0x1aa525,_0x1fc53c){return db['VoiceRecording'][_0xdd00('0x48')]()[_0xdd00('0x21')](respondWithResult(_0x1fc53c,null))['catch'](handleError(_0x1fc53c,null));};exports['download']=function(_0x3d0dec,_0x3bd878,_0x361835){var _0x3c5242=require(_0xdd00('0x49'));var _0xfa46eb=![];var _0xe97119={};if(_0x3d0dec[_0xdd00('0x2e')][_0xdd00('0x3a')]&&_0x3d0dec['query'][_0xdd00('0x3a')]===_0xdd00('0x4a')){_0xe97119[_0xdd00('0x4a')]=_0x3d0dec[_0xdd00('0x41')]['id'];}else{_0xe97119['id']=_0x3d0dec['params']['id'];}return db[_0xdd00('0x28')][_0xdd00('0x44')]({'where':_0xe97119,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x3bd878,null))[_0xdd00('0x21')](function(_0x4334fe){if(_0x4334fe){var _0x382582=_0x4334fe[_0xdd00('0x4b')];var _0x402603=util['format']('%s.cypher',_0x382582);if(fs[_0xdd00('0x4c')](_0x402603)){_0xfa46eb=!![];return _0x3c5242[_0xdd00('0x4d')](_0x402603,_0x382582,config[_0xdd00('0x4e')][_0xdd00('0x4f')])[_0xdd00('0x21')](function(){return _0x4334fe;});}return _0x4334fe;}})['then'](function(_0x28b25f){if(_0x28b25f){var _0xfe2aeb=_0x28b25f[_0xdd00('0x4b')];if(!fs[_0xdd00('0x4c')](_0xfe2aeb)){throw new db['Sequelize'][(_0xdd00('0x50'))](_0xdd00('0x51'));}if(_0x28b25f[_0xdd00('0x52')]){return _0x3bd878['download'](_0xfe2aeb,_0x28b25f[_0xdd00('0x52')]+path[_0xdd00('0x53')](_0xfe2aeb),function(){if(_0xfa46eb){fs['unlink'](_0xfe2aeb);}});}else{return _0x3bd878[_0xdd00('0x54')](_0xfe2aeb,function(_0x9d5988){if(_0xfa46eb){fs[_0xdd00('0x55')](_0xfe2aeb);}});}}})[_0xdd00('0x45')](function(_0xcd3c52){if(_0xcd3c52[_0xdd00('0x56')]===_0xdd00('0x51')){_0x3bd878[_0xdd00('0x17')](0x194)[_0xdd00('0x26')](_0xdd00('0x57'));}else{return handleError(_0x3bd878,null);}});};exports[_0xdd00('0x58')]=function(_0x182cde,_0x306b9a,_0x16d711){var _0x38f8e7=require(_0xdd00('0x49'));var _0x36a345=![];var _0x52d3ce={'$and':[db['sequelize']['where'](db['sequelize']['fn']('MD5',db[_0xdd00('0x59')][_0xdd00('0x5a')](_0xdd00('0x4a'))),_0x182cde[_0xdd00('0x2e')][_0xdd00('0x5b')])]};if(_0x182cde[_0xdd00('0x2e')][_0xdd00('0x3a')]&&_0x182cde[_0xdd00('0x2e')]['type']===_0xdd00('0x4a')){_0x52d3ce[_0xdd00('0x5c')]['push']({'uniqueid':_0x182cde[_0xdd00('0x41')]['id']});}else{_0x52d3ce['$and'][_0xdd00('0x5d')]({'id':_0x182cde[_0xdd00('0x41')]['id']});}return db['VoiceRecording']['find']({'where':_0x52d3ce,'attributes':['id',_0xdd00('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x306b9a,null))[_0xdd00('0x21')](function(_0x385e02){if(_0x385e02){var _0x4b9ee1=util[_0xdd00('0x2d')](_0xdd00('0x5e'),_0x385e02[_0xdd00('0x4b')]);if(fs[_0xdd00('0x4c')](_0x4b9ee1)){_0x36a345=!![];return _0x38f8e7[_0xdd00('0x4d')](_0x4b9ee1,_0x385e02[_0xdd00('0x4b')],config[_0xdd00('0x4e')][_0xdd00('0x4f')])[_0xdd00('0x21')](function(){return _0x385e02;});}return _0x385e02;}})[_0xdd00('0x21')](function(_0x6ce814){if(_0x6ce814){if(!fs[_0xdd00('0x4c')](_0x6ce814['value'])){throw new db['Sequelize'][(_0xdd00('0x50'))](_0xdd00('0x51'));}if(_0x6ce814[_0xdd00('0x52')]){return _0x306b9a[_0xdd00('0x54')](_0x6ce814[_0xdd00('0x4b')],_0x6ce814['filename']+path[_0xdd00('0x53')](_0x6ce814[_0xdd00('0x4b')]),function(){if(_0x36a345){fs[_0xdd00('0x55')](_0x6ce814['value']);}});}else{return _0x306b9a[_0xdd00('0x54')](_0x6ce814[_0xdd00('0x4b')],function(_0x10bf1e){if(_0x36a345){fs['unlink'](_0x6ce814[_0xdd00('0x4b')]);}});}}})[_0xdd00('0x45')](handleError(_0x306b9a,null));};exports[_0xdd00('0x20')]=function(_0x180489,_0x3d327e){return db[_0xdd00('0x28')][_0xdd00('0x44')]({'where':{'id':_0x180489[_0xdd00('0x41')]['id']}})[_0xdd00('0x21')](function(_0x3c545a){if(!_0x3c545a)throw new ReferenceError(_0xdd00('0x5f'));return _0x3c545a;})[_0xdd00('0x21')](function(_0x3bc716){var _0x4570eb=_0x3bc716[_0xdd00('0x4b')];logger[_0xdd00('0x60')](_0xdd00('0x61'),_0x4570eb);if(!_['isNil'](_0x3bc716[_0xdd00('0x4b')])&&fs[_0xdd00('0x4c')](_0x4570eb)){logger[_0xdd00('0x60')](_0xdd00('0x62')+_0x4570eb+_0xdd00('0x63'));fs[_0xdd00('0x64')](_0x4570eb);}_0x4570eb=_0x4570eb+_0xdd00('0x65');if(!_['isNil'](_0x3bc716[_0xdd00('0x4b')])&&fs[_0xdd00('0x4c')](_0x4570eb)){logger['info'](_0xdd00('0x62')+_0x4570eb+_0xdd00('0x63'));fs[_0xdd00('0x64')](_0x4570eb);}return _0x3bc716;})[_0xdd00('0x21')](function(_0x24b165){if(!_0x24b165)throw new InternalError();return _0x24b165[_0xdd00('0x20')]();})['then'](function(){_0x3d327e['status'](0xcc)[_0xdd00('0x16')]();})[_0xdd00('0x45')](handleError(_0x3d327e,null));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 7dbe92a..5670446 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 _0x464a=['../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x464a,0xa1));var _0xa464=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x464a[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0xa464('0x0'));var logger=require(_0xa464('0x1'))(_0xa464('0x2'));var moment=require(_0xa464('0x3'));var BPromise=require(_0xa464('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa464('0x5'));var rimraf=require(_0xa464('0x6'));var config=require(_0xa464('0x7'));var attributes=require(_0xa464('0x8'));module[_0xa464('0x9')]=function(_0x5663bc,_0x146430){return _0x5663bc[_0xa464('0xa')](_0xa464('0xb'),attributes,{'tableName':_0xa464('0xc'),'paranoid':![],'indexes':[{'name':_0xa464('0xd'),'fields':[_0xa464('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8487=['bluebird','request-promise','path','rimraf','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','util','../../config/logger','moment'];(function(_0x256684,_0x529c1e){var _0x37a0c9=function(_0x4b431b){while(--_0x4b431b){_0x256684['push'](_0x256684['shift']());}};_0x37a0c9(++_0x529c1e);}(_0x8487,0x10e));var _0x7848=function(_0x180626,_0x294e4d){_0x180626=_0x180626-0x0;var _0x5db0b6=_0x8487[_0x180626];return _0x5db0b6;};'use strict';var _=require('lodash');var util=require(_0x7848('0x0'));var logger=require(_0x7848('0x1'))('api');var moment=require(_0x7848('0x2'));var BPromise=require(_0x7848('0x3'));var rp=require(_0x7848('0x4'));var fs=require('fs');var path=require(_0x7848('0x5'));var rimraf=require(_0x7848('0x6'));var config=require('../../config/environment');var attributes=require(_0x7848('0x7'));module[_0x7848('0x8')]=function(_0x5ce0e2,_0x184a8b){return _0x5ce0e2[_0x7848('0x9')](_0x7848('0xa'),attributes,{'tableName':_0x7848('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7848('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index f4edc31..1258905 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(_0x1a50e5,_0x14accb){var _0x53b463=function(_0x12df94){while(--_0x12df94){_0x1a50e5['push'](_0x1a50e5['shift']());}};_0x53b463(++_0x14accb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 645a25c..322a013 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 _0x2542=['exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy'];(function(_0x2f9c17,_0x103d10){var _0x43d8a5=function(_0x4503d4){while(--_0x4503d4){_0x2f9c17['push'](_0x2f9c17['shift']());}};_0x43d8a5(++_0x103d10);}(_0x2542,0x169));var _0x2254=function(_0x372f8d,_0x4682a8){_0x372f8d=_0x372f8d-0x0;var _0x30aaaa=_0x2542[_0x372f8d];return _0x30aaaa;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2254('0x5'));var config=require(_0x2254('0x6'));var controller=require(_0x2254('0x7'));router[_0x2254('0x8')]('/',auth[_0x2254('0x9')](),controller['index']);router[_0x2254('0x8')](_0x2254('0xa'),auth[_0x2254('0x9')](),controller[_0x2254('0xb')]);router[_0x2254('0xc')]('/',auth[_0x2254('0x9')](),controller[_0x2254('0xd')]);router[_0x2254('0xe')](_0x2254('0xa'),auth[_0x2254('0x9')](),controller[_0x2254('0xf')]);router['delete'](_0x2254('0xa'),auth[_0x2254('0x9')](),controller[_0x2254('0x10')]);module[_0x2254('0x11')]=router; \ No newline at end of file +var _0xfcf0=['/:id','post','create','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index'];(function(_0x106c25,_0x2899cc){var _0x393b6e=function(_0x58199d){while(--_0x58199d){_0x106c25['push'](_0x106c25['shift']());}};_0x393b6e(++_0x2899cc);}(_0xfcf0,0x138));var _0x0fcf=function(_0x12d6c2,_0x409bc8){_0x12d6c2=_0x12d6c2-0x0;var _0x1c9825=_0xfcf0[_0x12d6c2];return _0x1c9825;};'use strict';var multer=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var path=require('path');var timeout=require(_0x0fcf('0x2'));var express=require(_0x0fcf('0x3'));var router=express[_0x0fcf('0x4')]();var auth=require(_0x0fcf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0fcf('0x6'));var controller=require(_0x0fcf('0x7'));router[_0x0fcf('0x8')]('/',auth[_0x0fcf('0x9')](),controller[_0x0fcf('0xa')]);router[_0x0fcf('0x8')](_0x0fcf('0xb'),auth[_0x0fcf('0x9')](),controller['show']);router[_0x0fcf('0xc')]('/',auth[_0x0fcf('0x9')](),controller[_0x0fcf('0xd')]);router['put'](_0x0fcf('0xb'),auth[_0x0fcf('0x9')](),controller[_0x0fcf('0xe')]);router['delete'](_0x0fcf('0xb'),auth['isAuthenticated'](),controller[_0x0fcf('0xf')]);module[_0x0fcf('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 1d891ee..d91ff26 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 _0xefda=['exports','STRING','sequelize','moment'];(function(_0x153b29,_0x2eff50){var _0x51f3bc=function(_0xd9573c){while(--_0xd9573c){_0x153b29['push'](_0x153b29['shift']());}};_0x51f3bc(++_0x2eff50);}(_0xefda,0x126));var _0xaefd=function(_0x1418bf,_0x57f368){_0x1418bf=_0x1418bf-0x0;var _0x1757f1=_0xefda[_0x1418bf];return _0x1757f1;};'use strict';var Sequelize=require(_0xaefd('0x0'));var moment=require(_0xaefd('0x1'));module[_0xaefd('0x2')]={'type':{'type':Sequelize['ENUM']('blind','attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xaefd('0x3')]},'transferercalleridnum':{'type':Sequelize[_0xaefd('0x3')]},'transferercalleridname':{'type':Sequelize[_0xaefd('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0xaefd('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0xaefd('0x3')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xaefd('0x3')]},'transfererexten':{'type':Sequelize[_0xaefd('0x3')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xaefd('0x3')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xaefd('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0xaefd('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0xaefd('0x3')]},'transfereecontext':{'type':Sequelize[_0xaefd('0x3')]},'transfereeexten':{'type':Sequelize[_0xaefd('0x3')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xaefd('0x3')]}}; \ No newline at end of file +var _0x6647=['exports','ENUM','blind','attended','STRING','Yes','sequelize','moment'];(function(_0x33c1b1,_0x2355fb){var _0x2c2037=function(_0x1200fd){while(--_0x1200fd){_0x33c1b1['push'](_0x33c1b1['shift']());}};_0x2c2037(++_0x2355fb);}(_0x6647,0xe6));var _0x7664=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6647[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x7664('0x0'));var moment=require(_0x7664('0x1'));module[_0x7664('0x2')]={'type':{'type':Sequelize[_0x7664('0x3')](_0x7664('0x4'),_0x7664('0x5'))},'result':{'type':Sequelize[_0x7664('0x6')]},'transfererchannel':{'type':Sequelize[_0x7664('0x6')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x7664('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0x7664('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0x7664('0x6')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x7664('0x6')]},'transfererexten':{'type':Sequelize[_0x7664('0x6')]},'transfererlinkedid':{'type':Sequelize[_0x7664('0x6')]},'transfereechannel':{'type':Sequelize[_0x7664('0x6')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x7664('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x7664('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0x7664('0x6')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x7664('0x6')]},'transfereeexten':{'type':Sequelize[_0x7664('0x6')]},'transfereelinkedid':{'type':Sequelize[_0x7664('0x6')]},'isexternal':{'type':Sequelize[_0x7664('0x3')](_0x7664('0x7'),'No')},'context':{'type':Sequelize[_0x7664('0x6')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index e8a1ab8..57d5c22 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 _0x91a7=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','count','include','findAll','show','params','keys','includeAll','catch','create','body','find','eml-format','rimraf','zip-dir','request-promise','bluebird','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','VoiceTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields'];(function(_0x4449fa,_0x3ce2d5){var _0x9f7348=function(_0x29d708){while(--_0x29d708){_0x4449fa['push'](_0x4449fa['shift']());}};_0x9f7348(++_0x3ce2d5);}(_0x91a7,0xe7));var _0x791a=function(_0x58d4bc,_0xe0e1eb){_0x58d4bc=_0x58d4bc-0x0;var _0x2de044=_0x91a7[_0x58d4bc];return _0x2de044;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x791a('0x0'));var rimraf=require(_0x791a('0x1'));var zipdir=require(_0x791a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x791a('0x3'));var moment=require('moment');var BPromise=require(_0x791a('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x791a('0x5'));var sox=require(_0x791a('0x6'));var csv=require('to-csv');var ejs=require(_0x791a('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x791a('0x8'));var crypto=require(_0x791a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x791a('0xa'));var toCsv=require(_0x791a('0xb'));var querystring=require(_0x791a('0xc'));var Papa=require(_0x791a('0xd'));var Redis=require(_0x791a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x791a('0xf'));var as=require(_0x791a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x791a('0x11'))(_0x791a('0x12'));var utils=require(_0x791a('0x13'));var config=require(_0x791a('0x14'));var db=require(_0x791a('0x15'))['db'];function respondWithStatusCode(_0x3fc10a,_0x53dc41){_0x53dc41=_0x53dc41||0xcc;return function(_0x5daecd){if(_0x5daecd){return _0x3fc10a[_0x791a('0x16')](_0x53dc41);}return _0x3fc10a[_0x791a('0x17')](_0x53dc41)['end']();};}function respondWithResult(_0x346c44,_0x3a2ec6){_0x3a2ec6=_0x3a2ec6||0xc8;return function(_0x5d5b11){if(_0x5d5b11){return _0x346c44[_0x791a('0x17')](_0x3a2ec6)[_0x791a('0x18')](_0x5d5b11);}};}function respondWithFilteredResult(_0x2ef5c5,_0x5cdf2){return function(_0x55e845){if(_0x55e845){var _0x2ce2e0=_0x55e845['count'],_0x575d11=_0x5cdf2[_0x791a('0x19')],_0x43dea6=_0x5cdf2['offset']+_0x5cdf2[_0x791a('0x1a')],_0x355155;if(_0x43dea6>=_0x2ce2e0){_0x43dea6=_0x2ce2e0;_0x355155=0xc8;}else{_0x355155=0xce;}_0x2ef5c5['status'](_0x355155);return _0x2ef5c5['set']('Content-Range',_0x575d11+'-'+_0x43dea6+'/'+_0x2ce2e0)[_0x791a('0x18')](_0x55e845);}return null;};}function patchUpdates(_0x52fa43){return function(_0x4cf613){try{jsonpatch[_0x791a('0x1b')](_0x4cf613,_0x52fa43,!![]);}catch(_0x5a702e){return BPromise[_0x791a('0x1c')](_0x5a702e);}return _0x4cf613[_0x791a('0x1d')]();};}function saveUpdates(_0x5f3cec,_0x189c0d){return function(_0xcb5e66){if(_0xcb5e66){return _0xcb5e66[_0x791a('0x1e')](_0x5f3cec)[_0x791a('0x1f')](function(_0x530e32){return _0x530e32;});}return null;};}function removeEntity(_0x448085,_0x2054c6){return function(_0x25bae5){if(_0x25bae5){return _0x25bae5[_0x791a('0x20')]()[_0x791a('0x1f')](function(){_0x448085[_0x791a('0x17')](0xcc)[_0x791a('0x21')]();});}};}function handleEntityNotFound(_0x45a67d,_0x323c6a){return function(_0xe8e452){if(!_0xe8e452){_0x45a67d[_0x791a('0x16')](0x194);}return _0xe8e452;};}function handleError(_0x5e03a3,_0x1102c9){_0x1102c9=_0x1102c9||0x1f4;return function(_0x2728a0){logger[_0x791a('0x22')](_0x2728a0[_0x791a('0x23')]);if(_0x2728a0['name']){delete _0x2728a0[_0x791a('0x24')];}_0x5e03a3[_0x791a('0x17')](_0x1102c9)['send'](_0x2728a0);};}exports[_0x791a('0x25')]=function(_0x1785f5,_0x16dbaf){var _0x4c1626={},_0x29194d={},_0x2b3327={'count':0x0,'rows':[]};var _0x2b0784=_[_0x791a('0x26')](db[_0x791a('0x27')][_0x791a('0x28')],function(_0x628816){return{'name':_0x628816[_0x791a('0x29')],'type':_0x628816['type'][_0x791a('0x2a')]};});_0x29194d[_0x791a('0x2b')]=_[_0x791a('0x26')](_0x2b0784,'name');_0x29194d[_0x791a('0x2c')]=_['keys'](_0x1785f5[_0x791a('0x2c')]);_0x29194d[_0x791a('0x2d')]=_[_0x791a('0x2e')](_0x29194d[_0x791a('0x2b')],_0x29194d[_0x791a('0x2c')]);_0x4c1626[_0x791a('0x2f')]=_[_0x791a('0x2e')](_0x29194d['model'],qs[_0x791a('0x30')](_0x1785f5[_0x791a('0x2c')][_0x791a('0x30')]));_0x4c1626[_0x791a('0x2f')]=_0x4c1626[_0x791a('0x2f')]['length']?_0x4c1626[_0x791a('0x2f')]:_0x29194d[_0x791a('0x2b')];if(!_0x1785f5[_0x791a('0x2c')][_0x791a('0x31')](_0x791a('0x32'))){_0x4c1626['limit']=qs[_0x791a('0x1a')](_0x1785f5[_0x791a('0x2c')][_0x791a('0x1a')]);_0x4c1626[_0x791a('0x19')]=qs[_0x791a('0x19')](_0x1785f5['query'][_0x791a('0x19')]);}_0x4c1626['order']=qs[_0x791a('0x33')](_0x1785f5['query']['sort']);_0x4c1626[_0x791a('0x34')]=qs[_0x791a('0x2d')](_[_0x791a('0x35')](_0x1785f5[_0x791a('0x2c')],_0x29194d[_0x791a('0x2d')]));if(_0x1785f5[_0x791a('0x2c')][_0x791a('0x36')]){_0x4c1626['where']=_[_0x791a('0x37')](_0x4c1626['where'],{'$or':_[_0x791a('0x26')](_0x2b0784,function(_0x496005){if(_0x496005[_0x791a('0x38')]!==_0x791a('0x39')){var _0x4ead60={};_0x4ead60[_0x496005[_0x791a('0x24')]]={'$like':'%'+_0x1785f5[_0x791a('0x2c')]['filter']+'%'};return _0x4ead60;}})});}_0x4c1626=_[_0x791a('0x37')]({},_0x4c1626,_0x1785f5[_0x791a('0x3a')]);var _0x2861d6={'where':_0x4c1626[_0x791a('0x34')]};return db[_0x791a('0x27')][_0x791a('0x3b')](_0x2861d6)[_0x791a('0x1f')](function(_0xf223d8){_0x2b3327[_0x791a('0x3b')]=_0xf223d8;if(_0x1785f5[_0x791a('0x2c')]['includeAll']){_0x4c1626[_0x791a('0x3c')]=[{'all':!![]}];}return db[_0x791a('0x27')][_0x791a('0x3d')](_0x4c1626);})['then'](function(_0xf4e2fa){_0x2b3327['rows']=_0xf4e2fa;return _0x2b3327;})['then'](respondWithFilteredResult(_0x16dbaf,_0x4c1626))['catch'](handleError(_0x16dbaf,null));};exports[_0x791a('0x3e')]=function(_0xb88abf,_0x49b0d8){var _0x415c44={'raw':!![],'where':{'id':_0xb88abf[_0x791a('0x3f')]['id']}},_0x2d1692={};_0x2d1692[_0x791a('0x2b')]=_['keys'](db['VoiceTransferReport']['rawAttributes']);_0x2d1692[_0x791a('0x2c')]=_[_0x791a('0x40')](_0xb88abf['query']);_0x2d1692[_0x791a('0x2d')]=_[_0x791a('0x2e')](_0x2d1692[_0x791a('0x2b')],_0x2d1692[_0x791a('0x2c')]);_0x415c44['attributes']=_[_0x791a('0x2e')](_0x2d1692['model'],qs[_0x791a('0x30')](_0xb88abf[_0x791a('0x2c')][_0x791a('0x30')]));_0x415c44[_0x791a('0x2f')]=_0x415c44[_0x791a('0x2f')]['length']?_0x415c44[_0x791a('0x2f')]:_0x2d1692[_0x791a('0x2b')];if(_0xb88abf[_0x791a('0x2c')][_0x791a('0x41')]){_0x415c44[_0x791a('0x3c')]=[{'all':!![]}];}_0x415c44=_['merge']({},_0x415c44,_0xb88abf[_0x791a('0x3a')]);return db[_0x791a('0x27')]['find'](_0x415c44)['then'](handleEntityNotFound(_0x49b0d8,null))[_0x791a('0x1f')](respondWithResult(_0x49b0d8,null))[_0x791a('0x42')](handleError(_0x49b0d8,null));};exports[_0x791a('0x43')]=function(_0x5877f4,_0x5d1343){return db[_0x791a('0x27')][_0x791a('0x43')](_0x5877f4['body'],{})[_0x791a('0x1f')](respondWithResult(_0x5d1343,0xc9))[_0x791a('0x42')](handleError(_0x5d1343,null));};exports[_0x791a('0x1e')]=function(_0x549980,_0x5a30a6){if(_0x549980[_0x791a('0x44')]['id']){delete _0x549980[_0x791a('0x44')]['id'];}return db[_0x791a('0x27')][_0x791a('0x45')]({'where':{'id':_0x549980['params']['id']}})[_0x791a('0x1f')](handleEntityNotFound(_0x5a30a6,null))[_0x791a('0x1f')](saveUpdates(_0x549980[_0x791a('0x44')],null))[_0x791a('0x1f')](respondWithResult(_0x5a30a6,null))['catch'](handleError(_0x5a30a6,null));};exports[_0x791a('0x20')]=function(_0x19654d,_0xe0696b){return db[_0x791a('0x27')][_0x791a('0x45')]({'where':{'id':_0x19654d[_0x791a('0x3f')]['id']}})[_0x791a('0x1f')](handleEntityNotFound(_0xe0696b,null))['then'](removeEntity(_0xe0696b,null))[_0x791a('0x42')](handleError(_0xe0696b,null));}; \ No newline at end of file +var _0x0bb5=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','then','rows','show','params','options','find','catch','create','body','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','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','offset','Content-Range','json','apply','reject','save','update','destroy','error','stack','name','index','map','VoiceTransferReport','rawAttributes','type','key','model','query'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x0bb5,0x148));var _0x50bb=function(_0x4b76ad,_0x20cb88){_0x4b76ad=_0x4b76ad-0x0;var _0x42dac2=_0x0bb5[_0x4b76ad];return _0x42dac2;};'use strict';var pdf=require(_0x50bb('0x0'));var emlformat=require(_0x50bb('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x50bb('0x2'));var rp=require(_0x50bb('0x3'));var moment=require(_0x50bb('0x4'));var BPromise=require(_0x50bb('0x5'));var Mustache=require(_0x50bb('0x6'));var util=require(_0x50bb('0x7'));var path=require(_0x50bb('0x8'));var sox=require(_0x50bb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x50bb('0xa'));var squel=require(_0x50bb('0xb'));var crypto=require(_0x50bb('0xc'));var jsforce=require(_0x50bb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x50bb('0xe'));var Papa=require(_0x50bb('0xf'));var Redis=require(_0x50bb('0x10'));var authService=require(_0x50bb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x50bb('0x12'));var hardwareService=require(_0x50bb('0x13'));var logger=require(_0x50bb('0x14'))(_0x50bb('0x15'));var utils=require(_0x50bb('0x16'));var config=require(_0x50bb('0x17'));var db=require(_0x50bb('0x18'))['db'];function respondWithStatusCode(_0x4d7e3d,_0x226370){_0x226370=_0x226370||0xcc;return function(_0x58837d){if(_0x58837d){return _0x4d7e3d[_0x50bb('0x19')](_0x226370);}return _0x4d7e3d[_0x50bb('0x1a')](_0x226370)[_0x50bb('0x1b')]();};}function respondWithResult(_0x502250,_0x17007f){_0x17007f=_0x17007f||0xc8;return function(_0x309986){if(_0x309986){return _0x502250[_0x50bb('0x1a')](_0x17007f)['json'](_0x309986);}};}function respondWithFilteredResult(_0xbbc6a0,_0x5e8478){return function(_0x21befa){if(_0x21befa){var _0x3e1a51=_0x21befa['count'],_0x253073=_0x5e8478[_0x50bb('0x1c')],_0x42ffab=_0x5e8478[_0x50bb('0x1c')]+_0x5e8478['limit'],_0x908950;if(_0x42ffab>=_0x3e1a51){_0x42ffab=_0x3e1a51;_0x908950=0xc8;}else{_0x908950=0xce;}_0xbbc6a0[_0x50bb('0x1a')](_0x908950);return _0xbbc6a0['set'](_0x50bb('0x1d'),_0x253073+'-'+_0x42ffab+'/'+_0x3e1a51)[_0x50bb('0x1e')](_0x21befa);}return null;};}function patchUpdates(_0x4b06f5){return function(_0x4f1c0a){try{jsonpatch[_0x50bb('0x1f')](_0x4f1c0a,_0x4b06f5,!![]);}catch(_0x1499dc){return BPromise[_0x50bb('0x20')](_0x1499dc);}return _0x4f1c0a[_0x50bb('0x21')]();};}function saveUpdates(_0x56b25a,_0x19dc5d){return function(_0x32bfc3){if(_0x32bfc3){return _0x32bfc3[_0x50bb('0x22')](_0x56b25a)['then'](function(_0x3104c8){return _0x3104c8;});}return null;};}function removeEntity(_0x879fea,_0x1344ec){return function(_0x4825f8){if(_0x4825f8){return _0x4825f8[_0x50bb('0x23')]()['then'](function(){_0x879fea[_0x50bb('0x1a')](0xcc)[_0x50bb('0x1b')]();});}};}function handleEntityNotFound(_0x1a2a0b,_0x2ee87a){return function(_0x846311){if(!_0x846311){_0x1a2a0b[_0x50bb('0x19')](0x194);}return _0x846311;};}function handleError(_0x4f7f73,_0xad17ac){_0xad17ac=_0xad17ac||0x1f4;return function(_0xee0af0){logger[_0x50bb('0x24')](_0xee0af0[_0x50bb('0x25')]);if(_0xee0af0['name']){delete _0xee0af0[_0x50bb('0x26')];}_0x4f7f73['status'](_0xad17ac)['send'](_0xee0af0);};}exports[_0x50bb('0x27')]=function(_0x491632,_0x5cfe4b){var _0x41fd89={},_0x12ee2c={},_0x3004a3={'count':0x0,'rows':[]};var _0x1b74f9=_[_0x50bb('0x28')](db[_0x50bb('0x29')][_0x50bb('0x2a')],function(_0x41d479){return{'name':_0x41d479['fieldName'],'type':_0x41d479[_0x50bb('0x2b')][_0x50bb('0x2c')]};});_0x12ee2c[_0x50bb('0x2d')]=_[_0x50bb('0x28')](_0x1b74f9,'name');_0x12ee2c[_0x50bb('0x2e')]=_[_0x50bb('0x2f')](_0x491632[_0x50bb('0x2e')]);_0x12ee2c[_0x50bb('0x30')]=_[_0x50bb('0x31')](_0x12ee2c[_0x50bb('0x2d')],_0x12ee2c[_0x50bb('0x2e')]);_0x41fd89[_0x50bb('0x32')]=_[_0x50bb('0x31')](_0x12ee2c[_0x50bb('0x2d')],qs[_0x50bb('0x33')](_0x491632[_0x50bb('0x2e')]['fields']));_0x41fd89[_0x50bb('0x32')]=_0x41fd89[_0x50bb('0x32')][_0x50bb('0x34')]?_0x41fd89[_0x50bb('0x32')]:_0x12ee2c[_0x50bb('0x2d')];if(!_0x491632[_0x50bb('0x2e')][_0x50bb('0x35')](_0x50bb('0x36'))){_0x41fd89[_0x50bb('0x37')]=qs[_0x50bb('0x37')](_0x491632[_0x50bb('0x2e')]['limit']);_0x41fd89[_0x50bb('0x1c')]=qs[_0x50bb('0x1c')](_0x491632[_0x50bb('0x2e')][_0x50bb('0x1c')]);}_0x41fd89[_0x50bb('0x38')]=qs[_0x50bb('0x39')](_0x491632['query']['sort']);_0x41fd89[_0x50bb('0x3a')]=qs['filters'](_[_0x50bb('0x3b')](_0x491632[_0x50bb('0x2e')],_0x12ee2c[_0x50bb('0x30')]));if(_0x491632[_0x50bb('0x2e')][_0x50bb('0x3c')]){_0x41fd89['where']=_[_0x50bb('0x3d')](_0x41fd89['where'],{'$or':_[_0x50bb('0x28')](_0x1b74f9,function(_0xc78d23){if(_0xc78d23[_0x50bb('0x2b')]!=='VIRTUAL'){var _0x55d29c={};_0x55d29c[_0xc78d23[_0x50bb('0x26')]]={'$like':'%'+_0x491632[_0x50bb('0x2e')][_0x50bb('0x3c')]+'%'};return _0x55d29c;}})});}_0x41fd89=_[_0x50bb('0x3d')]({},_0x41fd89,_0x491632['options']);var _0x3c273b={'where':_0x41fd89['where']};return db['VoiceTransferReport'][_0x50bb('0x3e')](_0x3c273b)['then'](function(_0x33ad32){_0x3004a3[_0x50bb('0x3e')]=_0x33ad32;if(_0x491632[_0x50bb('0x2e')][_0x50bb('0x3f')]){_0x41fd89[_0x50bb('0x40')]=[{'all':!![]}];}return db[_0x50bb('0x29')][_0x50bb('0x41')](_0x41fd89);})[_0x50bb('0x42')](function(_0x46039a){_0x3004a3[_0x50bb('0x43')]=_0x46039a;return _0x3004a3;})['then'](respondWithFilteredResult(_0x5cfe4b,_0x41fd89))['catch'](handleError(_0x5cfe4b,null));};exports[_0x50bb('0x44')]=function(_0x13076f,_0x1cf062){var _0x1d929d={'raw':!![],'where':{'id':_0x13076f[_0x50bb('0x45')]['id']}},_0x5e8085={};_0x5e8085['model']=_[_0x50bb('0x2f')](db[_0x50bb('0x29')][_0x50bb('0x2a')]);_0x5e8085[_0x50bb('0x2e')]=_[_0x50bb('0x2f')](_0x13076f[_0x50bb('0x2e')]);_0x5e8085[_0x50bb('0x30')]=_[_0x50bb('0x31')](_0x5e8085[_0x50bb('0x2d')],_0x5e8085[_0x50bb('0x2e')]);_0x1d929d[_0x50bb('0x32')]=_[_0x50bb('0x31')](_0x5e8085[_0x50bb('0x2d')],qs[_0x50bb('0x33')](_0x13076f[_0x50bb('0x2e')][_0x50bb('0x33')]));_0x1d929d['attributes']=_0x1d929d[_0x50bb('0x32')]['length']?_0x1d929d[_0x50bb('0x32')]:_0x5e8085[_0x50bb('0x2d')];if(_0x13076f[_0x50bb('0x2e')][_0x50bb('0x3f')]){_0x1d929d[_0x50bb('0x40')]=[{'all':!![]}];}_0x1d929d=_[_0x50bb('0x3d')]({},_0x1d929d,_0x13076f[_0x50bb('0x46')]);return db[_0x50bb('0x29')][_0x50bb('0x47')](_0x1d929d)[_0x50bb('0x42')](handleEntityNotFound(_0x1cf062,null))[_0x50bb('0x42')](respondWithResult(_0x1cf062,null))[_0x50bb('0x48')](handleError(_0x1cf062,null));};exports[_0x50bb('0x49')]=function(_0x457bb4,_0x5880df){return db[_0x50bb('0x29')]['create'](_0x457bb4[_0x50bb('0x4a')],{})[_0x50bb('0x42')](respondWithResult(_0x5880df,0xc9))[_0x50bb('0x48')](handleError(_0x5880df,null));};exports[_0x50bb('0x22')]=function(_0x650e91,_0x39ac1a){if(_0x650e91[_0x50bb('0x4a')]['id']){delete _0x650e91[_0x50bb('0x4a')]['id'];}return db['VoiceTransferReport'][_0x50bb('0x47')]({'where':{'id':_0x650e91[_0x50bb('0x45')]['id']}})[_0x50bb('0x42')](handleEntityNotFound(_0x39ac1a,null))[_0x50bb('0x42')](saveUpdates(_0x650e91[_0x50bb('0x4a')],null))['then'](respondWithResult(_0x39ac1a,null))[_0x50bb('0x48')](handleError(_0x39ac1a,null));};exports[_0x50bb('0x23')]=function(_0x2a411d,_0x154ff8){return db[_0x50bb('0x29')]['find']({'where':{'id':_0x2a411d['params']['id']}})[_0x50bb('0x42')](handleEntityNotFound(_0x154ff8,null))['then'](removeEntity(_0x154ff8,null))[_0x50bb('0x48')](handleError(_0x154ff8,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 09be647..585ce92 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 _0x5f7b=['path','rimraf','../../config/environment','exports','define','report_call_transfer','lodash','util','api','moment','bluebird','request-promise'];(function(_0x4b830c,_0x2399de){var _0x274dbc=function(_0x3bc324){while(--_0x3bc324){_0x4b830c['push'](_0x4b830c['shift']());}};_0x274dbc(++_0x2399de);}(_0x5f7b,0x14a));var _0xb5f7=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x5f7b[_0x2112d4];return _0x434972;};'use strict';var _=require(_0xb5f7('0x0'));var util=require(_0xb5f7('0x1'));var logger=require('../../config/logger')(_0xb5f7('0x2'));var moment=require(_0xb5f7('0x3'));var BPromise=require(_0xb5f7('0x4'));var rp=require(_0xb5f7('0x5'));var fs=require('fs');var path=require(_0xb5f7('0x6'));var rimraf=require(_0xb5f7('0x7'));var config=require(_0xb5f7('0x8'));var attributes=require('./voiceTransferReport.attributes');module[_0xb5f7('0x9')]=function(_0x50c8b6,_0x44689a){return _0x50c8b6[_0xb5f7('0xa')]('VoiceTransferReport',attributes,{'tableName':_0xb5f7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd3b=['./voiceTransferReport.attributes','exports','VoiceTransferReport','report_call_transfer','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1a21ff,_0x4a7550){var _0x25afc1=function(_0x4a66ec){while(--_0x4a66ec){_0x1a21ff['push'](_0x1a21ff['shift']());}};_0x25afc1(++_0x4a7550);}(_0xcd3b,0x19c));var _0xbcd3=function(_0x5d1fc1,_0x3edfae){_0x5d1fc1=_0x5d1fc1-0x0;var _0x525445=_0xcd3b[_0x5d1fc1];return _0x525445;};'use strict';var _=require(_0xbcd3('0x0'));var util=require('util');var logger=require(_0xbcd3('0x1'))(_0xbcd3('0x2'));var moment=require(_0xbcd3('0x3'));var BPromise=require(_0xbcd3('0x4'));var rp=require(_0xbcd3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbcd3('0x6'));var config=require(_0xbcd3('0x7'));var attributes=require(_0xbcd3('0x8'));module[_0xbcd3('0x9')]=function(_0x31fd88,_0x426b60){return _0x31fd88['define'](_0xbcd3('0xa'),attributes,{'tableName':_0xbcd3('0xb'),'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 2d6662c..bdaa666 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 _0x632f=['result','catch','CreateVoiceTransferReport','VoiceTransferReport','body','options','raw','debug','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','VoiceTransferReport,\x20%s,\x20%s'];(function(_0x5111f5,_0x4dfbad){var _0x25c542=function(_0x361c04){while(--_0x361c04){_0x5111f5['push'](_0x5111f5['shift']());}};_0x25c542(++_0x4dfbad);}(_0x632f,0x166));var _0xf632=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x632f[_0x1beef3];return _0x5af964;};'use strict';var _=require('lodash');var util=require(_0xf632('0x0'));var moment=require('moment');var BPromise=require(_0xf632('0x1'));var rs=require(_0xf632('0x2'));var fs=require('fs');var Redis=require(_0xf632('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf632('0x4'));var logger=require('../../config/logger')(_0xf632('0x5'));var config=require('../../config/environment');var jayson=require(_0xf632('0x6'));var client=jayson[_0xf632('0x7')][_0xf632('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e6498,_0x429845,_0x1c0bc5){return new BPromise(function(_0x443723,_0x562e19){return client['request'](_0x4e6498,_0x1c0bc5)['then'](function(_0x354a8c){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x429845,_0xf632('0x9'));logger['debug'](_0xf632('0xa'),_0x429845,_0xf632('0x9'),JSON[_0xf632('0xb')](_0x354a8c));if(_0x354a8c[_0xf632('0xc')]){if(_0x354a8c[_0xf632('0xc')][_0xf632('0xd')]===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x429845,_0x354a8c[_0xf632('0xc')][_0xf632('0xe')]);return _0x562e19(_0x354a8c[_0xf632('0xc')]['message']);}logger[_0xf632('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x429845,_0x354a8c[_0xf632('0xc')][_0xf632('0xe')]);return _0x443723(_0x354a8c['error']['message']);}else{logger[_0xf632('0xf')](_0xf632('0x10'),_0x429845,_0xf632('0x9'));_0x443723(_0x354a8c[_0xf632('0x11')][_0xf632('0xe')]);}})[_0xf632('0x12')](function(_0x15d825){logger[_0xf632('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x429845,_0x15d825);_0x562e19(_0x15d825);});});}exports[_0xf632('0x13')]=function(_0x4eb335){var _0x5defdb=this;return new Promise(function(_0x37c099,_0x50ff84){return db[_0xf632('0x14')]['create'](_0x4eb335[_0xf632('0x15')],{'raw':_0x4eb335[_0xf632('0x16')]?_0x4eb335[_0xf632('0x16')][_0xf632('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x490128){logger[_0xf632('0xf')](_0xf632('0x13'),_0x4eb335);logger[_0xf632('0x18')](_0xf632('0x13'),_0x4eb335,JSON['stringify'](_0x490128));_0x37c099(_0x490128);})[_0xf632('0x12')](function(_0x216869){logger['error']('CreateVoiceTransferReport',_0x216869[_0xf632('0xe')],_0x4eb335);_0x50ff84(_0x5defdb['error'](0x1f4,_0x216869['message']));});});}; \ No newline at end of file +var _0x2668=['error','message','request\x20sent','result','catch','create','body','options','raw','CreateVoiceTransferReport','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x40d078,_0x210a77){var _0x46fc81=function(_0x3673da){while(--_0x3673da){_0x40d078['push'](_0x40d078['shift']());}};_0x46fc81(++_0x210a77);}(_0x2668,0x1c4));var _0x8266=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x2668[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8266('0x0'));var rs=require(_0x8266('0x1'));var fs=require('fs');var Redis=require(_0x8266('0x2'));var db=require(_0x8266('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8266('0x4'))('rpc');var config=require(_0x8266('0x5'));var jayson=require(_0x8266('0x6'));var client=jayson[_0x8266('0x7')][_0x8266('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12aa7c,_0x434bc9,_0x2a964b){return new BPromise(function(_0x15eb2c,_0x2fdd87){return client[_0x8266('0x9')](_0x12aa7c,_0x2a964b)[_0x8266('0xa')](function(_0x444143){logger[_0x8266('0xb')](_0x8266('0xc'),_0x434bc9,'request\x20sent');logger[_0x8266('0xd')](_0x8266('0xe'),_0x434bc9,'request\x20sent',JSON[_0x8266('0xf')](_0x444143));if(_0x444143[_0x8266('0x10')]){if(_0x444143['error']['code']===0x1f4){logger[_0x8266('0x10')](_0x8266('0xc'),_0x434bc9,_0x444143[_0x8266('0x10')][_0x8266('0x11')]);return _0x2fdd87(_0x444143['error']['message']);}logger[_0x8266('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x434bc9,_0x444143[_0x8266('0x10')][_0x8266('0x11')]);return _0x15eb2c(_0x444143['error'][_0x8266('0x11')]);}else{logger[_0x8266('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0x434bc9,_0x8266('0x12'));_0x15eb2c(_0x444143[_0x8266('0x13')]['message']);}})[_0x8266('0x14')](function(_0x352dfc){logger[_0x8266('0x10')](_0x8266('0xc'),_0x434bc9,_0x352dfc);_0x2fdd87(_0x352dfc);});});}exports['CreateVoiceTransferReport']=function(_0x213dc4){var _0x595c26=this;return new Promise(function(_0x34f6b6,_0x504602){return db['VoiceTransferReport'][_0x8266('0x15')](_0x213dc4[_0x8266('0x16')],{'raw':_0x213dc4[_0x8266('0x17')]?_0x213dc4[_0x8266('0x17')][_0x8266('0x18')]===undefined?!![]:![]:!![]})[_0x8266('0xa')](function(_0x511d8c){logger[_0x8266('0xb')](_0x8266('0x19'),_0x213dc4);logger[_0x8266('0xd')](_0x8266('0x19'),_0x213dc4,JSON[_0x8266('0xf')](_0x511d8c));_0x34f6b6(_0x511d8c);})[_0x8266('0x14')](function(_0x1a0751){logger[_0x8266('0x10')]('CreateVoiceTransferReport',_0x1a0751[_0x8266('0x11')],_0x213dc4);_0x504602(_0x595c26[_0x8266('0x10')](0x1f4,_0x1a0751[_0x8266('0x11')]));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index f9fa164..a83c1ad 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ff5=['join','Offline\x20apps:','status','None','seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./rpc','./config/environment','app','./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','sync','then','listen','info','start','Online\x20apps:','map','filter','online','name'];(function(_0x20228b,_0x511ef3){var _0x17b89f=function(_0x2474b2){while(--_0x2474b2){_0x20228b['push'](_0x20228b['shift']());}};_0x17b89f(++_0x511ef3);}(_0x7ff5,0x12d));var _0x57ff=function(_0x1be8f4,_0x52aa07){_0x1be8f4=_0x1be8f4-0x0;var _0x33c64a=_0x7ff5[_0x1be8f4];return _0x33c64a;};'use strict';var _=require(_0x57ff('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0x57ff('0x1'));var config=require(_0x57ff('0x2'));var logger=require('./config/logger')(_0x57ff('0x3'));var pm2=require('./config/pm2');var pm2Config=require(_0x57ff('0x4'));var schedule=require(_0x57ff('0x5'));var chat=require(_0x57ff('0x6'));function main(){return mysqldb['db'][_0x57ff('0x7')][_0x57ff('0x8')]()[_0x57ff('0x9')](function(){return rpc[_0x57ff('0xa')]();})[_0x57ff('0x9')](function(_0x6c500c){logger[_0x57ff('0xb')](_0x6c500c);return chat[_0x57ff('0xc')]();})['then'](function(){return schedule[_0x57ff('0xc')]();})[_0x57ff('0x9')](function(_0x2d1853){logger['info'](_0x2d1853);return pm2[_0x57ff('0xc')](pm2Config);})[_0x57ff('0x9')](function(_0x406e23){logger[_0x57ff('0xb')](_0x57ff('0xd'),_[_0x57ff('0xe')](_[_0x57ff('0xf')](_0x406e23,{'status':_0x57ff('0x10')}),_0x57ff('0x11'))[_0x57ff('0x12')]());logger[_0x57ff('0xb')](_0x57ff('0x13'),_[_0x57ff('0xe')](_['filter'](_0x406e23,function(_0x1af883){return _0x1af883[_0x57ff('0x14')]!==_0x57ff('0x10');}),_0x57ff('0x11'))['join']()||_0x57ff('0x15'));config[_0x57ff('0x16')]&&require('./config/seedDB')[_0x57ff('0x17')]();require(_0x57ff('0x18'))[_0x57ff('0x17')]();})[_0x57ff('0x19')](function(_0xcec6b){logger[_0x57ff('0x1a')](_0x57ff('0x1b'),_0xcec6b);process[_0x57ff('0x1c')](0x1);});}main(); \ No newline at end of file +var _0xff5a=['Offline\x20apps:','map','None','seedDB','./config/seedDB','default','./config/license','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./rpc','./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','sync','then','listen','info','start','Online\x20apps:','filter','online','name','join'];(function(_0x100ca3,_0x37d616){var _0x2d572e=function(_0x1f504c){while(--_0x1f504c){_0x100ca3['push'](_0x100ca3['shift']());}};_0x2d572e(++_0x37d616);}(_0xff5a,0x104));var _0xaff5=function(_0xcf67c0,_0x151072){_0xcf67c0=_0xcf67c0-0x0;var _0x180573=_0xff5a[_0xcf67c0];return _0x180573;};'use strict';var _=require(_0xaff5('0x0'));var mysqldb=require(_0xaff5('0x1'));var rpc=require(_0xaff5('0x2'));var config=require(_0xaff5('0x3'));var logger=require(_0xaff5('0x4'))('app');var pm2=require(_0xaff5('0x5'));var pm2Config=require(_0xaff5('0x6'));var schedule=require(_0xaff5('0x7'));var chat=require(_0xaff5('0x8'));function main(){return mysqldb['db'][_0xaff5('0x9')][_0xaff5('0xa')]()[_0xaff5('0xb')](function(){return rpc[_0xaff5('0xc')]();})['then'](function(_0x294f24){logger[_0xaff5('0xd')](_0x294f24);return chat['start']();})['then'](function(){return schedule[_0xaff5('0xe')]();})[_0xaff5('0xb')](function(_0x41c398){logger[_0xaff5('0xd')](_0x41c398);return pm2[_0xaff5('0xe')](pm2Config);})[_0xaff5('0xb')](function(_0x7e371b){logger[_0xaff5('0xd')](_0xaff5('0xf'),_['map'](_[_0xaff5('0x10')](_0x7e371b,{'status':_0xaff5('0x11')}),_0xaff5('0x12'))[_0xaff5('0x13')]());logger[_0xaff5('0xd')](_0xaff5('0x14'),_[_0xaff5('0x15')](_[_0xaff5('0x10')](_0x7e371b,function(_0x48b6cc){return _0x48b6cc['status']!==_0xaff5('0x11');}),_0xaff5('0x12'))[_0xaff5('0x13')]()||_0xaff5('0x16'));config[_0xaff5('0x17')]&&require(_0xaff5('0x18'))[_0xaff5('0x19')]();require(_0xaff5('0x1a'))[_0xaff5('0x19')]();})['catch'](function(_0x3c9b97){logger['error'](_0xaff5('0x1b'),_0x3c9b97);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 361717e..129c7df 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 _0x2032=['params','closed','then','status','disposition','unmanaged','json','Unmanaged.','authorization','startsWith','headers','Basic','User','find','authenticate','catch','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','../../config/license/util','getLicense','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','promisify','sign','payload','options','verify','randomBytes','toString','../../config/environment','../../config/license/hardware','lodash','express-jwt','composable-middleware','crypto','bluebird','secrets','session','role','fullname','name','internal','email','userpic','permissions','chatPause','faxPause','smsPause','openchannelPause','showWebBar','lastPauseAt','allowmessenger','passwordResetAt','phoneBarEnableSettings','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x1d99c2,_0x57bc47){_0x1d99c2=_0x1d99c2-0x0;var _0x52aeb3=_0x2032[_0x1d99c2];return _0x52aeb3;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x2203('0x0'));var hardwareConf=require(_0x2203('0x1'));var _=require(_0x2203('0x2'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x2203('0x3'));var compose=require(_0x2203('0x4'));var basicAuth=require('basic-auth');var crypto=require(_0x2203('0x5'));var BPromise=require(_0x2203('0x6'));var validateJwt=expressJwt({'secret':config[_0x2203('0x7')][_0x2203('0x8')]});var userAttributes=['id',_0x2203('0x9'),_0x2203('0xa'),_0x2203('0xb'),_0x2203('0xc'),_0x2203('0xd'),_0x2203('0xe'),_0x2203('0xf'),'md5secret','voicePause',_0x2203('0x10'),'mailPause',_0x2203('0x11'),_0x2203('0x12'),_0x2203('0x13'),'pauseType',_0x2203('0x14'),'lastLoginAt',_0x2203('0x15'),'crudPermissions',_0x2203('0x16'),_0x2203('0x17'),'alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone',_0x2203('0x18'),'phoneBarExpires','phoneBarPrefixRequired',_0x2203('0x19'),_0x2203('0x1a'),_0x2203('0x1b'),_0x2203('0x1c'),_0x2203('0x1d')];exports[_0x2203('0x1e')]=function(){return this[_0x2203('0x1f')](!![])[_0x2203('0x20')](function(_0xdf9d0b,_0x3053f3,_0x5129fb){if(_0xdf9d0b[_0x2203('0x21')]){_0x5129fb();}else{return db[_0x2203('0x22')]['findOne']({'where':{'id':_0xdf9d0b[_0x2203('0x23')]['id']},'attributes':['id',_0x2203('0x24'),'disposition'],'raw':!![]})[_0x2203('0x25')](function(_0x5ee83c){if(_0x5ee83c&&_0x5ee83c[_0x2203('0x24')]){return _0x3053f3[_0x2203('0x26')](_0x5ee83c[_0x2203('0x27')]===_0x2203('0x28')?0x195:0x193)[_0x2203('0x29')]({'message':_0x5ee83c[_0x2203('0x27')]==='unmanaged'?_0x2203('0x2a'):'Forbidden.'});}else{_0x5129fb();}})['catch'](function(_0x15f543){_0x5129fb(_0x15f543);});}});};exports['isAuthenticated']=function isAuthenticated(_0x3b8ef9){return compose()[_0x2203('0x20')](function(_0x5d4c4e,_0x3ee25b,_0x5e29cd){if(_0x5d4c4e['headers'][_0x2203('0x2b')]){if(_[_0x2203('0x2c')](_0x5d4c4e[_0x2203('0x2d')][_0x2203('0x2b')],_0x2203('0x2e'))){var _0x3114ef=basicAuth(_0x5d4c4e);db[_0x2203('0x2f')][_0x2203('0x30')]({'where':{'name':_0x3114ef['name']}})[_0x2203('0x25')](function(_0x36b958){if(!_0x36b958||!_0x36b958[_0x2203('0x31')](_0x3114ef['pass'])){return _0x3ee25b[_0x2203('0x26')](0x191)[_0x2203('0x29')]({'message':'Wrong\x20credentials.'});}_0x5d4c4e[_0x2203('0x21')]={'id':_0x36b958['id']};_0x5e29cd();})[_0x2203('0x32')](function(_0x1c6a77){_0x5e29cd(_0x1c6a77);});}else if(_[_0x2203('0x2c')](_0x5d4c4e[_0x2203('0x2d')][_0x2203('0x2b')],_0x2203('0x33'))){validateJwt(_0x5d4c4e,_0x3ee25b,_0x5e29cd);}else{if(_0x3b8ef9){_0x5e29cd();}else{return _0x3ee25b['status'](0x193)[_0x2203('0x29')]({'message':_0x2203('0x34')});}}}else if(_0x5d4c4e[_0x2203('0x35')][_0x2203('0x36')]){try{var _0x52a426={'audience':hardwareConf[_0x2203('0x37')](),'issuer':hardwareConf[_0x2203('0x37')]()};verifyJwt(_0x5d4c4e[_0x2203('0x35')][_0x2203('0x36')],_0x52a426)['then'](function(_0xea1637){return db[_0x2203('0x2f')]['find']({'where':{'id':_0xea1637['sub']}})[_0x2203('0x25')](function(_0x52fafc){if(!_0x52fafc||!_['isEqual'](_0x52fafc[_0x2203('0x38')],_0xea1637[_0x2203('0x39')])){return _0x3ee25b[_0x2203('0x26')](0x191)[_0x2203('0x29')]({'message':_0x2203('0x3a')});}_0x5d4c4e['user']={'id':_0x52fafc['id']};_0x5e29cd();});})[_0x2203('0x32')](function(){return _0x3ee25b[_0x2203('0x26')](0x191)['json']({'message':_0x2203('0x3b')});});}catch(_0x20fbe1){_0x5e29cd(_0x20fbe1);}}else if(_0x3b8ef9){_0x5e29cd();}else{return _0x3ee25b[_0x2203('0x26')](0x193)[_0x2203('0x29')]({'message':_0x2203('0x34')});}})[_0x2203('0x20')](function(_0x29da55,_0x44228e,_0x708faa){if(_0x29da55['user']){db[_0x2203('0x2f')][_0x2203('0x30')]({'where':{'id':_0x29da55['user']['id']},'attributes':userAttributes})['then'](function(_0x2c58b1){if(!_0x2c58b1){return _0x44228e['status'](0x194)[_0x2203('0x29')]({'message':_0x2203('0x3c')});}_0x29da55[_0x2203('0x21')]=_0x2c58b1;_0x708faa();})['catch'](function(_0x5a2b90){_0x708faa(_0x5a2b90);});}else if(_0x3b8ef9){_0x708faa();}else{return _0x44228e[_0x2203('0x26')](0x194)['json']({'message':_0x2203('0x3d')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x2203('0x20')](function(_0x4b6fc5,_0x86097c,_0x13ed9e){return require(_0x2203('0x3e'))[_0x2203('0x3f')]()[_0x2203('0x25')](function(_0x5436d2){if(_0x5436d2['update']){_0x13ed9e();}else{return _0x86097c['status'](0x193)[_0x2203('0x29')]({'message':_0x2203('0x40')});}})[_0x2203('0x32')](function(_0x3b0c7a){_0x13ed9e(_0x3b0c7a);});});};exports[_0x2203('0x41')]=function(_0x3b250a,_0x1c7e3d,_0x590b4e){_0x3b250a[_0x2203('0x41')]=!![];return _0x590b4e();};exports[_0x2203('0x42')]=function signToken(_0x108fde){return signJwt(_0x108fde);};exports[_0x2203('0x43')]=function(_0x493d12,_0x50d74a){if(!_0x493d12[_0x2203('0x21')]){return _0x50d74a['status'](0x194)[_0x2203('0x29')]({'message':_0x2203('0x44')});}var _0x132091={'payload':{'id':_0x493d12['user']['id'],'role':_0x493d12['user'][_0x2203('0x9')]},'options':{'expiresIn':0x15180}};return signJwt(_0x132091)[_0x2203('0x25')](function(_0x368444){_0x50d74a[_0x2203('0x45')](_0x2203('0x46'),_0x368444);_0x50d74a[_0x2203('0x47')]('/dashboards/general');})[_0x2203('0x32')](function(_0x165a3f){return _0x50d74a[_0x2203('0x26')](0x1f4)[_0x2203('0x48')](_0x165a3f);});};exports[_0x2203('0x49')]=function(_0x36b99f){if(_[_0x2203('0x4a')](_0x36b99f[_0x2203('0x38')])||_[_0x2203('0x4a')](_0x36b99f[_0x2203('0x4b')])){return null;}else{return createJwt(_0x36b99f);}};exports['generateApiKey']=function(_0x2e2ca5){_0x2e2ca5[_0x2203('0x38')]=generateNonce();_0x2e2ca5[_0x2203('0x4b')]=generateIssuedAt();return createJwt(_0x2e2ca5);};exports[_0x2203('0x4c')]=function(_0x4c3259,_0x58bd5c){var _0x1c6661=_0x4c3259['query'][_0x2203('0x36')];if(_0x1c6661){var _0x15a8e8={'nonce':_0x58bd5c[_0x2203('0x38')],'iat':_0x58bd5c[_0x2203('0x4b')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x2203('0x37')]()};return verifyJwt(_0x1c6661,_0x15a8e8)[_0x2203('0x25')](function(){return generateApiKey(_0x58bd5c);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};function signJwt(_0x29bd91){var _0x381b3e=BPromise[_0x2203('0x4d')](jwt[_0x2203('0x4e')],{'context':jwt});var _0x5a71a5=_0x29bd91['secret']||config[_0x2203('0x7')]['session'];return new BPromise(function(_0x543fde,_0x450082){_0x381b3e(_0x29bd91[_0x2203('0x4f')],_0x5a71a5,_0x29bd91[_0x2203('0x50')])['then'](function(_0x4c1496){_0x543fde(_0x4c1496);})[_0x2203('0x32')](function(_0x3eecb7){_0x450082(_0x3eecb7);});});}function verifyJwt(_0x12d7fa,_0x21d2d7,_0x225b0e){var _0x21fd78=BPromise['promisify'](jwt[_0x2203('0x51')],{'context':jwt});var _0x557659=_0x225b0e||config[_0x2203('0x7')][_0x2203('0x8')];return new BPromise(function(_0x246aff,_0x1e49dd){_0x21fd78(_0x12d7fa,_0x557659,_0x21d2d7)['then'](function(_0x506795){_0x246aff(_0x506795);})[_0x2203('0x32')](function(_0x1f772d){_0x1e49dd(_0x1f772d);});});}function generateNonce(){return crypto[_0x2203('0x52')](0x10)[_0x2203('0x53')]('hex');}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)[_0x2203('0x53')]();}function createJwt(_0x1c2734){var _0x57b891={'payload':{'iat':_0x1c2734[_0x2203('0x4b')],'nonce':_0x1c2734[_0x2203('0x38')]},'options':{'algorithm':'HS512','subject':_0x1c2734['id'][_0x2203('0x53')](),'issuer':hardwareConf[_0x2203('0x37')](),'audience':hardwareConf[_0x2203('0x37')]()}};return signJwt(_0x57b891)[_0x2203('0x25')](function(_0x4bb6f1){return{'iat':_0x1c2734[_0x2203('0x4b')],'nonce':_0x1c2734['apiKeyNonce'],'token':_0x4bb6f1};});} \ No newline at end of file +var _0x4137=['json','unmanaged','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','startsWith','Basic','User','then','authenticate','pass','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','find','sub','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','../../config/license/util','getLicense','update','Forbidden','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','sign','payload','verify','toString','hex','floor','now','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','secrets','session','fullname','name','internal','email','permissions','md5secret','chatPause','mailPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','userProfileId','use','user','ChatInteraction','findOne','params','closed','disposition','status'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x4137,0xf8));var _0x7413=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x4137[_0x27af45];return _0x18df21;};'use strict';var db=require(_0x7413('0x0'))['db'];var config=require(_0x7413('0x1'));var hardwareConf=require(_0x7413('0x2'));var _=require(_0x7413('0x3'));var jwt=require(_0x7413('0x4'));var expressJwt=require(_0x7413('0x5'));var compose=require(_0x7413('0x6'));var basicAuth=require(_0x7413('0x7'));var crypto=require(_0x7413('0x8'));var BPromise=require(_0x7413('0x9'));var validateJwt=expressJwt({'secret':config[_0x7413('0xa')][_0x7413('0xb')]});var userAttributes=['id','role',_0x7413('0xc'),_0x7413('0xd'),_0x7413('0xe'),_0x7413('0xf'),'userpic',_0x7413('0x10'),_0x7413('0x11'),'voicePause',_0x7413('0x12'),_0x7413('0x13'),'faxPause',_0x7413('0x14'),_0x7413('0x15'),_0x7413('0x16'),_0x7413('0x17'),_0x7413('0x18'),'lastPauseAt',_0x7413('0x19'),_0x7413('0x1a'),'passwordResetAt',_0x7413('0x1b'),_0x7413('0x1c'),_0x7413('0x1d'),'phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings',_0x7413('0x1e'),_0x7413('0x1f'),'phoneBarRemoteControl',_0x7413('0x20'),_0x7413('0x21'),'interface',_0x7413('0x22')];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])[_0x7413('0x23')](function(_0x568d1f,_0x195c72,_0x538862){if(_0x568d1f[_0x7413('0x24')]){_0x538862();}else{return db[_0x7413('0x25')][_0x7413('0x26')]({'where':{'id':_0x568d1f[_0x7413('0x27')]['id']},'attributes':['id',_0x7413('0x28'),_0x7413('0x29')],'raw':!![]})['then'](function(_0xecc3e){if(_0xecc3e&&_0xecc3e[_0x7413('0x28')]){return _0x195c72[_0x7413('0x2a')](_0xecc3e[_0x7413('0x29')]==='unmanaged'?0x195:0x193)[_0x7413('0x2b')]({'message':_0xecc3e[_0x7413('0x29')]===_0x7413('0x2c')?_0x7413('0x2d'):_0x7413('0x2e')});}else{_0x538862();}})[_0x7413('0x2f')](function(_0x4886e3){_0x538862(_0x4886e3);});}});};exports[_0x7413('0x30')]=function isAuthenticated(_0x56a06a){return compose()['use'](function(_0x138508,_0x599654,_0x1585ba){if(_0x138508[_0x7413('0x31')][_0x7413('0x32')]){if(_[_0x7413('0x33')](_0x138508[_0x7413('0x31')][_0x7413('0x32')],_0x7413('0x34'))){var _0x41cb5d=basicAuth(_0x138508);db[_0x7413('0x35')]['find']({'where':{'name':_0x41cb5d['name']}})[_0x7413('0x36')](function(_0x48c2dc){if(!_0x48c2dc||!_0x48c2dc[_0x7413('0x37')](_0x41cb5d[_0x7413('0x38')])){return _0x599654[_0x7413('0x2a')](0x191)['json']({'message':_0x7413('0x39')});}_0x138508[_0x7413('0x24')]={'id':_0x48c2dc['id']};_0x1585ba();})[_0x7413('0x2f')](function(_0x4843fd){_0x1585ba(_0x4843fd);});}else if(_[_0x7413('0x33')](_0x138508[_0x7413('0x31')]['authorization'],_0x7413('0x3a'))){validateJwt(_0x138508,_0x599654,_0x1585ba);}else{if(_0x56a06a){_0x1585ba();}else{return _0x599654['status'](0x193)[_0x7413('0x2b')]({'message':_0x7413('0x3b')});}}}else if(_0x138508[_0x7413('0x3c')][_0x7413('0x3d')]){try{var _0x25fa52={'audience':hardwareConf[_0x7413('0x3e')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x138508[_0x7413('0x3c')][_0x7413('0x3d')],_0x25fa52)[_0x7413('0x36')](function(_0x31ae6a){return db[_0x7413('0x35')][_0x7413('0x3f')]({'where':{'id':_0x31ae6a[_0x7413('0x40')]}})['then'](function(_0xd763f9){if(!_0xd763f9||!_[_0x7413('0x41')](_0xd763f9[_0x7413('0x42')],_0x31ae6a[_0x7413('0x43')])){return _0x599654[_0x7413('0x2a')](0x191)['json']({'message':_0x7413('0x44')});}_0x138508['user']={'id':_0xd763f9['id']};_0x1585ba();});})[_0x7413('0x2f')](function(){return _0x599654[_0x7413('0x2a')](0x191)[_0x7413('0x2b')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0xe6b096){_0x1585ba(_0xe6b096);}}else if(_0x56a06a){_0x1585ba();}else{return _0x599654['status'](0x193)[_0x7413('0x2b')]({'message':_0x7413('0x3b')});}})['use'](function(_0x499cfa,_0x440bfe,_0x26a8ad){if(_0x499cfa[_0x7413('0x24')]){db['User']['find']({'where':{'id':_0x499cfa[_0x7413('0x24')]['id']},'attributes':userAttributes})['then'](function(_0x50aa24){if(!_0x50aa24){return _0x440bfe[_0x7413('0x2a')](0x194)['json']({'message':_0x7413('0x45')});}_0x499cfa[_0x7413('0x24')]=_0x50aa24;_0x26a8ad();})[_0x7413('0x2f')](function(_0x2b178c){_0x26a8ad(_0x2b178c);});}else if(_0x56a06a){_0x26a8ad();}else{return _0x440bfe[_0x7413('0x2a')](0x194)['json']({'message':_0x7413('0x46')});}});};exports[_0x7413('0x47')]=function canUpdate(){return compose()[_0x7413('0x23')](function(_0xfa34ef,_0x245777,_0x1168cd){return require(_0x7413('0x48'))[_0x7413('0x49')]()[_0x7413('0x36')](function(_0x26a241){if(_0x26a241[_0x7413('0x4a')]){_0x1168cd();}else{return _0x245777[_0x7413('0x2a')](0x193)['json']({'message':_0x7413('0x4b')});}})['catch'](function(_0x56cb6f){_0x1168cd(_0x56cb6f);});});};exports['isMiddleware']=function(_0x53c47c,_0x5c86ad,_0x44af7d){_0x53c47c['isMiddleware']=!![];return _0x44af7d();};exports['signToken']=function signToken(_0x5dc077){return signJwt(_0x5dc077);};exports['setTokenCookie']=function(_0x4c6746,_0x3d92ec){if(!_0x4c6746[_0x7413('0x24')]){return _0x3d92ec[_0x7413('0x2a')](0x194)[_0x7413('0x2b')]({'message':_0x7413('0x4c')});}var _0x57cb9e={'payload':{'id':_0x4c6746[_0x7413('0x24')]['id'],'role':_0x4c6746['user'][_0x7413('0x4d')]},'options':{'expiresIn':0x15180}};return signJwt(_0x57cb9e)[_0x7413('0x36')](function(_0xa063d1){_0x3d92ec[_0x7413('0x4e')](_0x7413('0x4f'),_0xa063d1);_0x3d92ec[_0x7413('0x50')](_0x7413('0x51'));})[_0x7413('0x2f')](function(_0x35d198){return _0x3d92ec[_0x7413('0x2a')](0x1f4)[_0x7413('0x52')](_0x35d198);});};exports[_0x7413('0x53')]=function(_0x3fbec4){if(_['isNil'](_0x3fbec4[_0x7413('0x42')])||_[_0x7413('0x54')](_0x3fbec4[_0x7413('0x55')])){return null;}else{return createJwt(_0x3fbec4);}};exports[_0x7413('0x56')]=function(_0x3f9db8){_0x3f9db8[_0x7413('0x42')]=generateNonce();_0x3f9db8[_0x7413('0x55')]=generateIssuedAt();return createJwt(_0x3f9db8);};exports[_0x7413('0x57')]=function(_0x426852,_0x1c3af5){var _0xf41d85=_0x426852['query'][_0x7413('0x3d')];if(_0xf41d85){var _0x52a088={'nonce':_0x1c3af5[_0x7413('0x42')],'iat':_0x1c3af5[_0x7413('0x55')],'audience':hardwareConf[_0x7413('0x3e')](),'issuer':hardwareConf[_0x7413('0x3e')]()};return verifyJwt(_0xf41d85,_0x52a088)[_0x7413('0x36')](function(){return generateApiKey(_0x1c3af5);});}else{throw{'message':_0x7413('0x58')};}};function signJwt(_0x203729){var _0x7de9d8=BPromise[_0x7413('0x59')](jwt[_0x7413('0x5a')],{'context':jwt});var _0x521f5e=_0x203729['secret']||config[_0x7413('0xa')]['session'];return new BPromise(function(_0x563fa8,_0x27d2b6){_0x7de9d8(_0x203729[_0x7413('0x5b')],_0x521f5e,_0x203729['options'])[_0x7413('0x36')](function(_0x586d25){_0x563fa8(_0x586d25);})['catch'](function(_0xe58860){_0x27d2b6(_0xe58860);});});}function verifyJwt(_0x5f263e,_0x24f54e,_0x24bfb7){var _0x1a7338=BPromise[_0x7413('0x59')](jwt[_0x7413('0x5c')],{'context':jwt});var _0x6f1d2d=_0x24bfb7||config[_0x7413('0xa')][_0x7413('0xb')];return new BPromise(function(_0x66795,_0x2031e3){_0x1a7338(_0x5f263e,_0x6f1d2d,_0x24f54e)['then'](function(_0x369891){_0x66795(_0x369891);})['catch'](function(_0x5206d0){_0x2031e3(_0x5206d0);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x7413('0x5d')](_0x7413('0x5e'));}function generateIssuedAt(){return Math[_0x7413('0x5f')](Date[_0x7413('0x60')]()/0x3e8)['toString']();}function createJwt(_0x5a6a66){var _0x291399={'payload':{'iat':_0x5a6a66['apiKeyIat'],'nonce':_0x5a6a66[_0x7413('0x42')]},'options':{'algorithm':'HS512','subject':_0x5a6a66['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x291399)['then'](function(_0x6734e4){return{'iat':_0x5a6a66[_0x7413('0x55')],'nonce':_0x5a6a66[_0x7413('0x42')],'token':_0x6734e4};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index b380922..5b7e5f3 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 _0xe706=['unlink','crypto','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','data','update','end','final','binary','write','close','createDecipher'];(function(_0xe1063b,_0x49f6a5){var _0x3f79b1=function(_0x1c0f8e){while(--_0x1c0f8e){_0xe1063b['push'](_0xe1063b['shift']());}};_0x3f79b1(++_0x49f6a5);}(_0xe706,0xa3));var _0x6e70=function(_0x3d0678,_0x10e9ae){_0x3d0678=_0x3d0678-0x0;var _0x7f9a43=_0xe706[_0x3d0678];return _0x7f9a43;};'use strict';var crypto=require(_0x6e70('0x0'));var fs=require('fs');var BPromise=require(_0x6e70('0x1'));var defaultOptions={'algorithm':_0x6e70('0x2')};function combineOptions(_0x5e8446){var _0x2cae77={};for(var _0x315629 in defaultOptions){if(defaultOptions[_0x6e70('0x3')](_0x315629)){_0x2cae77[_0x315629]=defaultOptions[_0x315629];}}if(_0x5e8446){for(var _0x7dfbc3 in _0x5e8446){if(_0x5e8446[_0x6e70('0x3')](_0x7dfbc3)){_0x2cae77[_0x7dfbc3]=_0x5e8446[_0x7dfbc3];}}}return _0x2cae77;}exports[_0x6e70('0x4')]=function(_0x376a8d,_0x506db9,_0x1b0389,_0x4381d1){return new BPromise(function(_0x36357b,_0x293ce7){_0x4381d1=combineOptions(_0x4381d1);var _0x45a2d4=new Buffer(_0x1b0389);var _0x188ed3=fs[_0x6e70('0x5')](_0x376a8d);var _0x449b48=fs[_0x6e70('0x6')](_0x506db9);var _0x25e61c=crypto[_0x6e70('0x7')](_0x4381d1[_0x6e70('0x8')],_0x45a2d4);_0x188ed3['on'](_0x6e70('0x9'),function(_0x3f474a){var _0x37b3e0=new Buffer(_0x25e61c[_0x6e70('0xa')](_0x3f474a),'binary');_0x449b48['write'](_0x37b3e0);});_0x188ed3['on'](_0x6e70('0xb'),function(){try{var _0x15a1a5=new Buffer(_0x25e61c[_0x6e70('0xc')](_0x6e70('0xd')),_0x6e70('0xd'));_0x449b48[_0x6e70('0xe')](_0x15a1a5);_0x449b48[_0x6e70('0xb')]();_0x449b48['on'](_0x6e70('0xf'),function(){return _0x36357b(_0x506db9);});}catch(_0x5dfbaa){fs['unlink'](_0x506db9);return _0x293ce7(_0x5dfbaa);}});});};exports['decryptFile']=function(_0x257e81,_0x5a37a6,_0x53aed0,_0x304716){return new BPromise(function(_0x22c50c,_0x5d9263){_0x304716=combineOptions(_0x304716);var _0x24f3ac=new Buffer(_0x53aed0);var _0x5c3fe7=fs[_0x6e70('0x5')](_0x257e81);var _0x161f23=fs['createWriteStream'](_0x5a37a6);var _0x49029f=crypto[_0x6e70('0x10')](_0x304716['algorithm'],_0x24f3ac);_0x5c3fe7['on'](_0x6e70('0x9'),function(_0x173afe){var _0x53acdc=new Buffer(_0x49029f['update'](_0x173afe),_0x6e70('0xd'));_0x161f23[_0x6e70('0xe')](_0x53acdc);});_0x5c3fe7['on'](_0x6e70('0xb'),function(){try{var _0x3a9978=new Buffer(_0x49029f[_0x6e70('0xc')](_0x6e70('0xd')),_0x6e70('0xd'));_0x161f23[_0x6e70('0xe')](_0x3a9978);_0x161f23[_0x6e70('0xb')]();_0x161f23['on'](_0x6e70('0xf'),function(){return _0x22c50c(_0x5a37a6);});}catch(_0x4a0cfe){fs[_0x6e70('0x11')](_0x5a37a6);return _0x5d9263(_0x4a0cfe);}});});}; \ No newline at end of file +var _0xb7e7=['crypto','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','update','binary','write','end','final','createDecipher','data','close','unlink'];(function(_0x343f11,_0x1d5672){var _0x1e18d1=function(_0x27206c){while(--_0x27206c){_0x343f11['push'](_0x343f11['shift']());}};_0x1e18d1(++_0x1d5672);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xb7e7[_0x4c12ec];return _0x3ae42c;};'use strict';var crypto=require(_0x7b7e('0x0'));var fs=require('fs');var BPromise=require('bluebird');var defaultOptions={'algorithm':_0x7b7e('0x1')};function combineOptions(_0x518dc6){var _0x1b7cc7={};for(var _0x54a37f in defaultOptions){if(defaultOptions[_0x7b7e('0x2')](_0x54a37f)){_0x1b7cc7[_0x54a37f]=defaultOptions[_0x54a37f];}}if(_0x518dc6){for(var _0x556d68 in _0x518dc6){if(_0x518dc6[_0x7b7e('0x2')](_0x556d68)){_0x1b7cc7[_0x556d68]=_0x518dc6[_0x556d68];}}}return _0x1b7cc7;}exports[_0x7b7e('0x3')]=function(_0x1d9384,_0x52047f,_0x53ed64,_0x333fa4){return new BPromise(function(_0x372bde,_0x7f87e0){_0x333fa4=combineOptions(_0x333fa4);var _0x55ce81=new Buffer(_0x53ed64);var _0x42b871=fs[_0x7b7e('0x4')](_0x1d9384);var _0x2917f9=fs[_0x7b7e('0x5')](_0x52047f);var _0x148964=crypto[_0x7b7e('0x6')](_0x333fa4[_0x7b7e('0x7')],_0x55ce81);_0x42b871['on']('data',function(_0x299519){var _0x1eef0a=new Buffer(_0x148964[_0x7b7e('0x8')](_0x299519),_0x7b7e('0x9'));_0x2917f9[_0x7b7e('0xa')](_0x1eef0a);});_0x42b871['on'](_0x7b7e('0xb'),function(){try{var _0x36d2a3=new Buffer(_0x148964[_0x7b7e('0xc')](_0x7b7e('0x9')),'binary');_0x2917f9[_0x7b7e('0xa')](_0x36d2a3);_0x2917f9[_0x7b7e('0xb')]();_0x2917f9['on']('close',function(){return _0x372bde(_0x52047f);});}catch(_0x422d3a){fs['unlink'](_0x52047f);return _0x7f87e0(_0x422d3a);}});});};exports['decryptFile']=function(_0x2889ed,_0xd304f5,_0xf067da,_0x457ec5){return new BPromise(function(_0x3d2fb2,_0x5703fd){_0x457ec5=combineOptions(_0x457ec5);var _0x51baf6=new Buffer(_0xf067da);var _0xc7f087=fs[_0x7b7e('0x4')](_0x2889ed);var _0x27f999=fs[_0x7b7e('0x5')](_0xd304f5);var _0x2cc400=crypto[_0x7b7e('0xd')](_0x457ec5[_0x7b7e('0x7')],_0x51baf6);_0xc7f087['on'](_0x7b7e('0xe'),function(_0x2acb8c){var _0x429a0e=new Buffer(_0x2cc400[_0x7b7e('0x8')](_0x2acb8c),_0x7b7e('0x9'));_0x27f999[_0x7b7e('0xa')](_0x429a0e);});_0xc7f087['on'](_0x7b7e('0xb'),function(){try{var _0x9776c3=new Buffer(_0x2cc400[_0x7b7e('0xc')](_0x7b7e('0x9')),'binary');_0x27f999[_0x7b7e('0xa')](_0x9776c3);_0x27f999[_0x7b7e('0xb')]();_0x27f999['on'](_0x7b7e('0xf'),function(){return _0x3d2fb2(_0xd304f5);});}catch(_0x4c0647){fs[_0x7b7e('0x10')](_0xd304f5);return _0x5703fd(_0x4c0647);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 7988d55..6032b6a 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 _0x41bb=['format','CSV','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','Empty','length','QueryTypes','SELECT','dirname','.csv','existsSync','mkdirSync','join','%s%d.%s','csv','%s.%s','writeFileSync','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','util','path','to-csv','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info'];(function(_0x387d12,_0x4277dd){var _0x427a9e=function(_0x1b9226){while(--_0x1b9226){_0x387d12['push'](_0x387d12['shift']());}};_0x427a9e(++_0x4277dd);}(_0x41bb,0xc5));var _0xb41b=function(_0x4f4367,_0x20cbf1){_0x4f4367=_0x4f4367-0x0;var _0x1e995f=_0x41bb[_0x4f4367];return _0x1e995f;};'use strict';var util=require(_0xb41b('0x0'));var path=require(_0xb41b('0x1'));var _=require('lodash');var csv=require(_0xb41b('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xb41b('0x3'));var rimraf=require(_0xb41b('0x4'));var db=require(_0xb41b('0x5'))['db'];var dbH=require(_0xb41b('0x5'))['dbH'];var logger=require(_0xb41b('0x6'))(_0xb41b('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xb41b('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x497242,_0x2704f0){var _0x29c30d={'status':_0x497242};var _0x53722a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2704f0){_0x29c30d[_0xb41b('0x9')]=_0x2704f0;}return db[_0xb41b('0xa')][_0xb41b('0xb')](_0x29c30d,_0x53722a);}function main(){var _0xa2aa66=0x1388;var _0x26d531;logger[_0xb41b('0xc')](util[_0xb41b('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xb41b('0xe')));return db['Setting'][_0xb41b('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb41b('0x10'),_0xb41b('0x11')]})[_0xb41b('0x12')](function(_0x2066d5){if(_0x2066d5){_0x26d531=_0x2066d5;_0xa2aa66=_0x26d531['splitSizeCsv']||0x1388;}})[_0xb41b('0x12')](function(){return dbH[_0xb41b('0x13')][_0xb41b('0x14')](util[_0xb41b('0xd')](_0xb41b('0x15'),QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0xb41b('0x12')](function(_0xdc5fb0){if(!_0xdc5fb0[0x0][_0xb41b('0x16')]){return analyticExtractedReport(_0xb41b('0x17'));}var _0x29ea51=[];var _0x54591e=0x0;var _0x2f3673=!![];if(_0xdc5fb0&&_0xdc5fb0[_0xb41b('0x18')]){var _0x401dd9=_0xdc5fb0[0x0][_0xb41b('0x16')]%(_0x54591e+_0xa2aa66);if(_0x26d531[_0xb41b('0x10')]){for(;_0x2f3673;_0x54591e+=_0xa2aa66,_0x401dd9=_0xdc5fb0[0x0][_0xb41b('0x16')]%(_0x54591e+_0xa2aa66)){if(_0x401dd9==0x0||_0x401dd9==_0xdc5fb0[0x0][_0xb41b('0x16')]){_0x2f3673=![];}_0x29ea51['push'](dbH['sequelize']['query'](util[_0xb41b('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xa2aa66,_0x54591e),{'type':dbH[_0xb41b('0x13')][_0xb41b('0x19')][_0xb41b('0x1a')]}));}}else{_0x29ea51['push'](dbH['sequelize'][_0xb41b('0x14')](QUERY,{'type':dbH[_0xb41b('0x13')][_0xb41b('0x19')][_0xb41b('0x1a')]}));}}var _0x232ff1=path[_0xb41b('0x1b')](PATH);var _0x4c73da=path['basename'](PATH,_0xb41b('0x1c'));var _0x21045f=_0x26d531[_0xb41b('0x10')]&&_0x29ea51['length']>0x1;var _0x14e9c8=[];if(!fs[_0xb41b('0x1d')](path['join'](_0x232ff1,_0x4c73da))&&_0x21045f){fs[_0xb41b('0x1e')](path[_0xb41b('0x1f')](_0x232ff1,_0x4c73da));}return BPromise['each'](_0x29ea51,function(_0xed3c7e){_0x14e9c8['push'](_0xed3c7e);})[_0xb41b('0x12')](function(){for(var _0x4c6a91=0x0;_0x4c6a91<_0x14e9c8['length'];_0x4c6a91+=0x1){var _0x3af2c;var _0x4265b8=_0x14e9c8[_0x4c6a91];if(_0x21045f){_0x3af2c=path['join'](_0x232ff1,_0x4c73da,util['format'](_0xb41b('0x20'),_0x4c73da,_0x4c6a91,_0xb41b('0x21')));}else{_0x3af2c=path[_0xb41b('0x1f')](_0x232ff1,util[_0xb41b('0xd')](_0xb41b('0x22'),_0x4c73da,_0xb41b('0x21')));}fs[_0xb41b('0x23')](_0x3af2c,csv(_0x4265b8));}})['then'](function(){if(_0x21045f){zipdir(path[_0xb41b('0x1f')](_0x232ff1,_0x4c73da),{'saveTo':path[_0xb41b('0x1f')](_0x232ff1,util['format'](_0xb41b('0x22'),_0x4c73da,'zip'))},function(_0x38277f,_0x31d4cd){});rimraf(path['join'](_0x232ff1,_0x4c73da),function(){});}})[_0xb41b('0x12')](function(){logger['info'](util[_0xb41b('0xd')](_0xb41b('0x24'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xb41b('0x25'),_0x21045f?util[_0xb41b('0xd')](_0xb41b('0x22'),_0x4c73da,_0x21045f?_0xb41b('0x26'):_0xb41b('0x21')):null);});})[_0xb41b('0x27')](function(_0x157048){logger[_0xb41b('0xc')](util[_0xb41b('0xd')](_0xb41b('0x28'),EXTRACTED_REPORT_ID,'CSV'),util[_0xb41b('0x29')](_0x157048,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0x4bc3=['length','existsSync','join','mkdirSync','each','csv','writeFileSync','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','split','push','sequelize','QueryTypes','dirname','basename'];(function(_0x1ef87c,_0x664915){var _0x1c54c4=function(_0x183769){while(--_0x183769){_0x1ef87c['push'](_0x1ef87c['shift']());}};_0x1c54c4(++_0x664915);}(_0x4bc3,0x16e));var _0x34bc=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x4bc3[_0x5d6456];return _0x4d66c1;};'use strict';var util=require(_0x34bc('0x0'));var path=require(_0x34bc('0x1'));var _=require('lodash');var csv=require(_0x34bc('0x2'));var fs=require('fs');var BPromise=require(_0x34bc('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x34bc('0x4'));var db=require(_0x34bc('0x5'))['db'];var dbH=require(_0x34bc('0x5'))[_0x34bc('0x6')];var logger=require(_0x34bc('0x7'))(_0x34bc('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x34bc('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x34bc('0x9')][0x4];function analyticExtractedReport(_0x50320d,_0x502087){var _0x18a01c={'status':_0x50320d};var _0x474108={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x502087){_0x18a01c[_0x34bc('0xa')]=_0x502087;}return db[_0x34bc('0xb')][_0x34bc('0xc')](_0x18a01c,_0x474108);}function main(){var _0x41b2ff=0x1388;var _0x5de8b5;logger['info'](util[_0x34bc('0xd')](_0x34bc('0xe'),EXTRACTED_REPORT_ID,_0x34bc('0xf')));return db['Setting'][_0x34bc('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x34bc('0x11')]})[_0x34bc('0x12')](function(_0x164fb2){if(_0x164fb2){_0x5de8b5=_0x164fb2;_0x41b2ff=_0x5de8b5['splitSizeCsv']||0x1388;}})[_0x34bc('0x12')](function(){return dbH['sequelize'][_0x34bc('0x13')](util[_0x34bc('0xd')](_0x34bc('0x14'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x34bc('0x15')]});})['then'](function(_0x3e93bf){if(!_0x3e93bf[0x0][_0x34bc('0x16')]){return analyticExtractedReport(_0x34bc('0x17'));}var _0x25da29=[];var _0x2db2dd=0x0;var _0x69542f=!![];if(_0x3e93bf&&_0x3e93bf['length']){var _0x4fa0ab=_0x3e93bf[0x0]['num']%(_0x2db2dd+_0x41b2ff);if(_0x5de8b5[_0x34bc('0x18')]){for(;_0x69542f;_0x2db2dd+=_0x41b2ff,_0x4fa0ab=_0x3e93bf[0x0][_0x34bc('0x16')]%(_0x2db2dd+_0x41b2ff)){if(_0x4fa0ab==0x0||_0x4fa0ab==_0x3e93bf[0x0][_0x34bc('0x16')]){_0x69542f=![];}_0x25da29[_0x34bc('0x19')](dbH['sequelize'][_0x34bc('0x13')](util[_0x34bc('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x41b2ff,_0x2db2dd),{'type':dbH[_0x34bc('0x1a')][_0x34bc('0x1b')]['SELECT']}));}}else{_0x25da29[_0x34bc('0x19')](dbH[_0x34bc('0x1a')][_0x34bc('0x13')](QUERY,{'type':dbH[_0x34bc('0x1a')][_0x34bc('0x1b')][_0x34bc('0x15')]}));}}var _0x48087e=path[_0x34bc('0x1c')](PATH);var _0x3c9939=path[_0x34bc('0x1d')](PATH,'.csv');var _0x4c4b9a=_0x5de8b5[_0x34bc('0x18')]&&_0x25da29[_0x34bc('0x1e')]>0x1;var _0x4263de=[];if(!fs[_0x34bc('0x1f')](path[_0x34bc('0x20')](_0x48087e,_0x3c9939))&&_0x4c4b9a){fs[_0x34bc('0x21')](path[_0x34bc('0x20')](_0x48087e,_0x3c9939));}return BPromise[_0x34bc('0x22')](_0x25da29,function(_0x19472e){_0x4263de[_0x34bc('0x19')](_0x19472e);})[_0x34bc('0x12')](function(){for(var _0x1edcb0=0x0;_0x1edcb0<_0x4263de['length'];_0x1edcb0+=0x1){var _0x43e527;var _0x48ec13=_0x4263de[_0x1edcb0];if(_0x4c4b9a){_0x43e527=path['join'](_0x48087e,_0x3c9939,util[_0x34bc('0xd')]('%s%d.%s',_0x3c9939,_0x1edcb0,_0x34bc('0x23')));}else{_0x43e527=path[_0x34bc('0x20')](_0x48087e,util[_0x34bc('0xd')]('%s.%s',_0x3c9939,_0x34bc('0x23')));}fs[_0x34bc('0x24')](_0x43e527,csv(_0x48ec13));}})[_0x34bc('0x12')](function(){if(_0x4c4b9a){zipdir(path[_0x34bc('0x20')](_0x48087e,_0x3c9939),{'saveTo':path[_0x34bc('0x20')](_0x48087e,util[_0x34bc('0xd')]('%s.%s',_0x3c9939,_0x34bc('0x25')))},function(_0x1fb7c5,_0x22aacc){});rimraf(path[_0x34bc('0x20')](_0x48087e,_0x3c9939),function(){});}})[_0x34bc('0x12')](function(){logger[_0x34bc('0x26')](util['format'](_0x34bc('0x27'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x4c4b9a?util[_0x34bc('0xd')]('%s.%s',_0x3c9939,_0x4c4b9a?_0x34bc('0x25'):_0x34bc('0x23')):null);});})[_0x34bc('0x28')](function(_0x452a51){logger[_0x34bc('0x26')](util[_0x34bc('0xd')](_0x34bc('0x29'),EXTRACTED_REPORT_ID,'CSV'),util[_0x34bc('0x2a')](_0x452a51,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x34bc('0x2b'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 115ad74..8efbdd1 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(_0x48f9c2,_0x398c34){var _0x20a61b=function(_0x12ab92){while(--_0x12ab92){_0x48f9c2['push'](_0x48f9c2['shift']());}};_0x20a61b(++_0x398c34);}(_0xb10b,0x12a));var _0xbb10=function(_0xbc86fc,_0x1bb24d){_0xbc86fc=_0xbc86fc-0x0;var _0x549976=_0xb10b[_0xbc86fc];return _0x549976;};'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 _0xd8b0=['format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','landscape','black','body','toString','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','pipe','finish','error','log','err','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','splitSizePdf','then','length','push','sequelize','query'];(function(_0x2c7bbe,_0x95cf94){var _0xc4e188=function(_0x22aff4){while(--_0x22aff4){_0x2c7bbe['push'](_0x2c7bbe['shift']());}};_0xc4e188(++_0x95cf94);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var util=require('util');var path=require('path');var moment=require('moment');var PdfPrinter=require(_0x0d8b('0x2'));var zipdir=require(_0x0d8b('0x3'));var rimraf=require(_0x0d8b('0x4'));var db=require(_0x0d8b('0x5'))['db'];var dbH=require(_0x0d8b('0x5'))['dbH'];var logger=require('../../config/logger')(_0x0d8b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x0d8b('0x7')][0x2]);var QUERY=process[_0x0d8b('0x7')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x0d8b('0x7')][0x5];var FORMAT=_0x0d8b('0x8');var _extractedReport;function analyticExtractedReport(_0x58e4e2,_0x129310){var _0x348e65={'status':_0x58e4e2};var _0x3b027f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x129310){_0x348e65[_0x0d8b('0x9')]=_0x129310;}return db[_0x0d8b('0xa')][_0x0d8b('0xb')](_0x348e65,_0x3b027f);}function getHeader(_0x2c5e9e){var _0x28f87c=[];for(var _0x48fa16 in _0x2c5e9e){if(_0x2c5e9e[_0x0d8b('0xc')](_0x48fa16)){_0x28f87c['push']({'text':_0x48fa16,'style':_0x0d8b('0xd')});}}return _0x28f87c;}function extractReport(_0xc574a3){var _0x340cc4=0x1388;var _0x92cdd8;if(!_0xc574a3[0x0][_0x0d8b('0xe')]){return analyticExtractedReport(_0x0d8b('0xf'));}var _0x15dd0f=[];var _0x31a8cc=0x0;var _0x1d4bbc=!![];var _0x2ce75e=path[_0x0d8b('0x10')](PATH);var _0xe65334=path[_0x0d8b('0x11')](PATH,_0x0d8b('0x12'));var _0x4f6f21=![];var _0x23eb7b=[];return db[_0x0d8b('0x13')][_0x0d8b('0x14')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0d8b('0x15'),_0x0d8b('0x16')]})['then'](function(_0x106a01){if(_0x106a01){_0x92cdd8=_0x106a01;_0x340cc4=_0x92cdd8[_0x0d8b('0x16')]||0x3e8;}})[_0x0d8b('0x17')](function(){if(_0xc574a3&&_0xc574a3[_0x0d8b('0x18')]){var _0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4);if(_0x92cdd8[_0x0d8b('0x15')]){for(;_0x1d4bbc;_0x31a8cc+=_0x340cc4,_0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4)){if(_0x333674==0x0||_0x333674==_0xc574a3[0x0]['num']){_0x1d4bbc=![];}_0x15dd0f[_0x0d8b('0x19')](dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')](_0x0d8b('0x1d'),QUERY,_0x340cc4,_0x31a8cc),{'type':dbH[_0x0d8b('0x1a')][_0x0d8b('0x1e')][_0x0d8b('0x1f')]}));}}else{_0x15dd0f['push'](dbH['sequelize'][_0x0d8b('0x1b')](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}_0x4f6f21=_0x92cdd8[_0x0d8b('0x15')]&&_0x15dd0f[_0x0d8b('0x18')]>0x1;if(!fs[_0x0d8b('0x20')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334))&&_0x4f6f21){fs[_0x0d8b('0x22')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334));}return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4562cb){_0x23eb7b[_0x0d8b('0x19')](_0x4562cb);});})['then'](function(){return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4463ee,_0x5363e3){var _0xe1ef20;var _0x4a0ae4=util[_0x0d8b('0x1c')](_0x0d8b('0x24'),NAME,_extractedReport[_0x0d8b('0x25')],moment(_extractedReport['startDate'])['format'](FORMAT),moment(_extractedReport[_0x0d8b('0x26')])[_0x0d8b('0x1c')](FORMAT));var _0x4c05ee={'pageSize':'A4','pageOrientation':_0x0d8b('0x27'),'content':[{'text':_0x4a0ae4,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x0d8b('0x28')}}};var _0x4b59e5={'headerRows':0x1,'body':[]};_0x4b59e5[_0x0d8b('0x29')]['push'](getHeader(_0x4463ee[0x0]));var _0x2ab00d;for(var _0x546bf6=0x0;_0x546bf6<_0x4463ee[_0x0d8b('0x18')];_0x546bf6+=0x1){_0x2ab00d=[];for(var _0x544735 in _0x4463ee[_0x546bf6]){if(_0x4463ee[_0x546bf6][_0x0d8b('0xc')](_0x544735)){_0x2ab00d[_0x0d8b('0x19')](_0x4463ee[_0x546bf6][_0x544735]?_[_0x0d8b('0x2a')](_0x4463ee[_0x546bf6][_0x544735]):'');}}_0x4b59e5['body']['push'](_0x2ab00d);}_0x4c05ee['content'][_0x0d8b('0x19')]({'table':_0x4b59e5});return new BPromise(function(_0x5515d2,_0x3cdf3c){var _0x54f6f3=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0x0d8b('0x2b'),'italics':__dirname+_0x0d8b('0x2c'),'bolditalics':__dirname+_0x0d8b('0x2d')}});var _0xdeee5d=_0x54f6f3[_0x0d8b('0x2e')](_0x4c05ee);if(_0x4f6f21){_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334,util[_0x0d8b('0x1c')](_0x0d8b('0x2f'),_0xe65334,_0x5363e3,'pdf'));}else{_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')]('%s.%s',_0xe65334,_0x0d8b('0x30')));}var _0x23f7f6=_0xdeee5d[_0x0d8b('0x31')](fs['createWriteStream'](_0xe1ef20));_0x23f7f6['on'](_0x0d8b('0x32'),function(){_0x5515d2();});_0x23f7f6['on'](_0x0d8b('0x33'),function(_0x206157){console[_0x0d8b('0x34')](_0x0d8b('0x35'),_0x206157);_0x3cdf3c(_0x206157);});_0xdeee5d['end']();});});})[_0x0d8b('0x17')](function(){if(_0x4f6f21){return new BPromise(function(_0x1649fc,_0x5ad0fe){zipdir(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),{'saveTo':path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x0d8b('0x37')))},function(_0x519088){if(_0x519088){_0x5ad0fe(_0x519088);}else{_0x1649fc();}});});}})['then'](function(){if(_0x4f6f21){rimraf(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),function(){});}})['then'](function(){logger['info'](util[_0x0d8b('0x1c')](_0x0d8b('0x38'),EXTRACTED_REPORT_ID,_0x0d8b('0x39')));return analyticExtractedReport(_0x0d8b('0x3a'),_0x4f6f21?util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x4f6f21?'zip':_0x0d8b('0x30')):null);});}function main(){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x3c'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')));return db[_0x0d8b('0xa')][_0x0d8b('0x3e')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x1d06b6){_extractedReport=_0x1d06b6;return dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x0d8b('0x1a')]['QueryTypes'][_0x0d8b('0x1f')]});})[_0x0d8b('0x17')](extractReport)[_0x0d8b('0x3f')](function(_0x26ac10){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x40'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')),util[_0x0d8b('0x41')](_0x26ac10,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x0d8b('0x42'));});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 833d624..aa886a2 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 _0x7d2b=['%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','push','query','QueryTypes','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','Completed','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','util','path','lodash','json2xls','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','num','Empty','length'];(function(_0x1e0c19,_0x54eaf4){var _0x32b513=function(_0x374774){while(--_0x374774){_0x1e0c19['push'](_0x1e0c19['shift']());}};_0x32b513(++_0x54eaf4);}(_0x7d2b,0x1aa));var _0xb7d2=function(_0x20a69c,_0x259e3d){_0x20a69c=_0x20a69c-0x0;var _0x20abe6=_0x7d2b[_0x20a69c];return _0x20abe6;};'use strict';var util=require(_0xb7d2('0x0'));var path=require(_0xb7d2('0x1'));var _=require(_0xb7d2('0x2'));var fs=require('fs');var json2xls=require(_0xb7d2('0x3'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0xb7d2('0x4'));var db=require(_0xb7d2('0x5'))['db'];var dbH=require('../../mysqldb')[_0xb7d2('0x6')];var logger=require(_0xb7d2('0x7'))(_0xb7d2('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xb7d2('0x9')][0x2]);var QUERY=process[_0xb7d2('0x9')][0x3];var PATH=process[_0xb7d2('0x9')][0x4];function analyticExtractedReport(_0x4d9c6a,_0x39e7bf){var _0x5b3e67={'status':_0x4d9c6a};var _0x3862c5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x39e7bf){_0x5b3e67['savename']=_0x39e7bf;}return db[_0xb7d2('0xa')][_0xb7d2('0xb')](_0x5b3e67,_0x3862c5);}function main(){var _0x1a6a36=0x1388;var _0x5c8c49;logger['info'](util[_0xb7d2('0xc')](_0xb7d2('0xd'),EXTRACTED_REPORT_ID,_0xb7d2('0xe')));return db[_0xb7d2('0xf')][_0xb7d2('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb7d2('0x11'),_0xb7d2('0x12')]})[_0xb7d2('0x13')](function(_0x37df24){if(_0x37df24){_0x5c8c49=_0x37df24;_0x1a6a36=_0x5c8c49[_0xb7d2('0x12')]||0x1388;}})['then'](function(){return dbH[_0xb7d2('0x14')]['query'](util[_0xb7d2('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xb7d2('0x14')]['QueryTypes']['SELECT']});})[_0xb7d2('0x13')](function(_0x4bae61){if(!_0x4bae61[0x0][_0xb7d2('0x15')]){return analyticExtractedReport(_0xb7d2('0x16'));}var _0x52980d=[];var _0x22f089=0x0;var _0x9f4f40=!![];if(_0x5c8c49[_0xb7d2('0x11')]){if(_0x4bae61&&_0x4bae61[_0xb7d2('0x17')]){var _0x4f7b00=_0x4bae61[0x0][_0xb7d2('0x15')]%(_0x22f089+_0x1a6a36);for(;_0x9f4f40;_0x22f089+=_0x1a6a36,_0x4f7b00=_0x4bae61[0x0]['num']%(_0x22f089+_0x1a6a36)){if(_0x4f7b00==0x0||_0x4f7b00==_0x4bae61[0x0][_0xb7d2('0x15')]){_0x9f4f40=![];}_0x52980d['push'](dbH[_0xb7d2('0x14')]['query'](util[_0xb7d2('0xc')](_0xb7d2('0x18'),QUERY,_0x1a6a36,_0x22f089),{'type':dbH[_0xb7d2('0x14')]['QueryTypes'][_0xb7d2('0x19')]}));}}}else{_0x52980d[_0xb7d2('0x1a')](dbH[_0xb7d2('0x14')][_0xb7d2('0x1b')](QUERY,{'type':dbH[_0xb7d2('0x14')][_0xb7d2('0x1c')][_0xb7d2('0x19')]}));}var _0x3665a1=path[_0xb7d2('0x1d')](PATH);var _0x1c210a=path[_0xb7d2('0x1e')](PATH,_0xb7d2('0x1f'));var _0x1aa0e2=_0x5c8c49[_0xb7d2('0x11')]&&_0x52980d[_0xb7d2('0x17')]>0x1;var _0x306bd4=[];if(!fs[_0xb7d2('0x20')](path[_0xb7d2('0x21')](_0x3665a1,_0x1c210a))&&_0x1aa0e2){fs[_0xb7d2('0x22')](path[_0xb7d2('0x21')](_0x3665a1,_0x1c210a));}return BPromise[_0xb7d2('0x23')](_0x52980d,function(_0x47b21b){_0x306bd4[_0xb7d2('0x1a')](_0x47b21b);})[_0xb7d2('0x13')](function(){for(var _0xa5f306=0x0;_0xa5f306<_0x306bd4[_0xb7d2('0x17')];_0xa5f306+=0x1){var _0x87ce1b;var _0x52a833=_0x306bd4[_0xa5f306];if(_0x1aa0e2){_0x87ce1b=path[_0xb7d2('0x21')](_0x3665a1,_0x1c210a,util[_0xb7d2('0xc')](_0xb7d2('0x24'),_0x1c210a,_0xa5f306,_0xb7d2('0x25')));}else{_0x87ce1b=path[_0xb7d2('0x21')](_0x3665a1,util[_0xb7d2('0xc')](_0xb7d2('0x26'),_0x1c210a,'xlsx'));}fs[_0xb7d2('0x27')](_0x87ce1b,json2xls(_0x52a833),_0xb7d2('0x28'));}})[_0xb7d2('0x13')](function(){if(_0x1aa0e2){zipdir(path['join'](_0x3665a1,_0x1c210a),{'saveTo':path[_0xb7d2('0x21')](_0x3665a1,util[_0xb7d2('0xc')](_0xb7d2('0x26'),_0x1c210a,_0xb7d2('0x29')))},function(_0x48633d,_0x58300e){});rimraf(path[_0xb7d2('0x21')](_0x3665a1,_0x1c210a),function(){});}})['then'](function(){logger['info'](util[_0xb7d2('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xb7d2('0xe')));return analyticExtractedReport(_0xb7d2('0x2a'),_0x1aa0e2?util[_0xb7d2('0xc')](_0xb7d2('0x26'),_0x1c210a,_0x1aa0e2?_0xb7d2('0x29'):_0xb7d2('0x25')):null);});})['catch'](function(_0x3aeac9){logger[_0xb7d2('0x2b')](util[_0xb7d2('0xc')](_0xb7d2('0x2c'),EXTRACTED_REPORT_ID,_0xb7d2('0xe')),util['inspect'](_0x3aeac9,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0xb1d8=['Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','xlsx','%s.%s','writeFileSync','zip','info','Completed','catch','Failed','util','lodash','json2xls','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num'];(function(_0x1b2863,_0x104885){var _0x510ca7=function(_0x54229e){while(--_0x54229e){_0x1b2863['push'](_0x1b2863['shift']());}};_0x510ca7(++_0x104885);}(_0xb1d8,0xef));var _0x8b1d=function(_0x8fb477,_0x3d8d1f){_0x8fb477=_0x8fb477-0x0;var _0x30ad32=_0xb1d8[_0x8fb477];return _0x30ad32;};'use strict';var util=require(_0x8b1d('0x0'));var path=require('path');var _=require(_0x8b1d('0x1'));var fs=require('fs');var json2xls=require(_0x8b1d('0x2'));var BPromise=require('bluebird');var zipdir=require(_0x8b1d('0x3'));var rimraf=require(_0x8b1d('0x4'));var db=require(_0x8b1d('0x5'))['db'];var dbH=require(_0x8b1d('0x5'))[_0x8b1d('0x6')];var logger=require(_0x8b1d('0x7'))(_0x8b1d('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x8b1d('0x9')][0x2]);var QUERY=process[_0x8b1d('0x9')][0x3];var PATH=process[_0x8b1d('0x9')][0x4];function analyticExtractedReport(_0x2b202e,_0x3e33aa){var _0x2e60a5={'status':_0x2b202e};var _0x2aeb46={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3e33aa){_0x2e60a5[_0x8b1d('0xa')]=_0x3e33aa;}return db[_0x8b1d('0xb')]['update'](_0x2e60a5,_0x2aeb46);}function main(){var _0x348ff7=0x1388;var _0x304683;logger['info'](util[_0x8b1d('0xc')](_0x8b1d('0xd'),EXTRACTED_REPORT_ID,_0x8b1d('0xe')));return db['Setting'][_0x8b1d('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8b1d('0x10'),_0x8b1d('0x11')]})['then'](function(_0x50ec84){if(_0x50ec84){_0x304683=_0x50ec84;_0x348ff7=_0x304683[_0x8b1d('0x11')]||0x1388;}})[_0x8b1d('0x12')](function(){return dbH[_0x8b1d('0x13')][_0x8b1d('0x14')](util[_0x8b1d('0xc')](_0x8b1d('0x15'),QUERY),{'type':dbH[_0x8b1d('0x13')][_0x8b1d('0x16')][_0x8b1d('0x17')]});})['then'](function(_0x4381a4){if(!_0x4381a4[0x0][_0x8b1d('0x18')]){return analyticExtractedReport(_0x8b1d('0x19'));}var _0x174ad9=[];var _0x21b88a=0x0;var _0x55b8d1=!![];if(_0x304683[_0x8b1d('0x10')]){if(_0x4381a4&&_0x4381a4[_0x8b1d('0x1a')]){var _0x4eb0e8=_0x4381a4[0x0][_0x8b1d('0x18')]%(_0x21b88a+_0x348ff7);for(;_0x55b8d1;_0x21b88a+=_0x348ff7,_0x4eb0e8=_0x4381a4[0x0]['num']%(_0x21b88a+_0x348ff7)){if(_0x4eb0e8==0x0||_0x4eb0e8==_0x4381a4[0x0][_0x8b1d('0x18')]){_0x55b8d1=![];}_0x174ad9[_0x8b1d('0x1b')](dbH[_0x8b1d('0x13')][_0x8b1d('0x14')](util[_0x8b1d('0xc')](_0x8b1d('0x1c'),QUERY,_0x348ff7,_0x21b88a),{'type':dbH['sequelize']['QueryTypes'][_0x8b1d('0x17')]}));}}}else{_0x174ad9[_0x8b1d('0x1b')](dbH['sequelize'][_0x8b1d('0x14')](QUERY,{'type':dbH[_0x8b1d('0x13')][_0x8b1d('0x16')][_0x8b1d('0x17')]}));}var _0x4dbd29=path[_0x8b1d('0x1d')](PATH);var _0x48de6f=path[_0x8b1d('0x1e')](PATH,_0x8b1d('0x1f'));var _0x2d55d3=_0x304683[_0x8b1d('0x10')]&&_0x174ad9[_0x8b1d('0x1a')]>0x1;var _0x198b7c=[];if(!fs[_0x8b1d('0x20')](path[_0x8b1d('0x21')](_0x4dbd29,_0x48de6f))&&_0x2d55d3){fs[_0x8b1d('0x22')](path[_0x8b1d('0x21')](_0x4dbd29,_0x48de6f));}return BPromise[_0x8b1d('0x23')](_0x174ad9,function(_0x1950e5){_0x198b7c[_0x8b1d('0x1b')](_0x1950e5);})[_0x8b1d('0x12')](function(){for(var _0x363420=0x0;_0x363420<_0x198b7c[_0x8b1d('0x1a')];_0x363420+=0x1){var _0x3a9747;var _0x4db754=_0x198b7c[_0x363420];if(_0x2d55d3){_0x3a9747=path['join'](_0x4dbd29,_0x48de6f,util[_0x8b1d('0xc')]('%s%d.%s',_0x48de6f,_0x363420,_0x8b1d('0x24')));}else{_0x3a9747=path[_0x8b1d('0x21')](_0x4dbd29,util['format'](_0x8b1d('0x25'),_0x48de6f,'xlsx'));}fs[_0x8b1d('0x26')](_0x3a9747,json2xls(_0x4db754),'binary');}})[_0x8b1d('0x12')](function(){if(_0x2d55d3){zipdir(path[_0x8b1d('0x21')](_0x4dbd29,_0x48de6f),{'saveTo':path[_0x8b1d('0x21')](_0x4dbd29,util['format'](_0x8b1d('0x25'),_0x48de6f,_0x8b1d('0x27')))},function(_0x135673,_0xbd2852){});rimraf(path[_0x8b1d('0x21')](_0x4dbd29,_0x48de6f),function(){});}})[_0x8b1d('0x12')](function(){logger[_0x8b1d('0x28')](util[_0x8b1d('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x8b1d('0xe')));return analyticExtractedReport(_0x8b1d('0x29'),_0x2d55d3?util[_0x8b1d('0xc')](_0x8b1d('0x25'),_0x48de6f,_0x2d55d3?'zip':_0x8b1d('0x24')):null);});})[_0x8b1d('0x2a')](function(_0x1848a3){logger['info'](util[_0x8b1d('0xc')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x8b1d('0xe')),util['inspect'](_0x1848a3,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x8b1d('0x2b'));});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 56b6adf..2b67003 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 _0xa870=['CDR(type)=%s','context','VoiceExtensionId','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','intervals','tag','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','bulkCreate','sortBy','catch','error','rewrite','lodash','models','findAll','VoiceExtension','IntervalId','then','uniq','map','exten','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','Set','format'];(function(_0x45fed1,_0x550ca1){var _0x11133c=function(_0x301777){while(--_0x301777){_0x45fed1['push'](_0x45fed1['shift']());}};_0x11133c(++_0x550ca1);}(_0xa870,0x143));var _0x0a87=function(_0x5198ba,_0x406a6b){_0x5198ba=_0x5198ba-0x0;var _0x4b01e9=_0xa870[_0x5198ba];return _0x4b01e9;};'use strict';var _=require(_0x0a87('0x0'));var util=require('util');function rewrite(_0x4e3e40,_0x373b13){var _0x190175=this;return _0x4e3e40[_0x0a87('0x1')]['Interval'][_0x0a87('0x2')]({'raw':!![]})['then'](function(_0x46782a){_0x190175['intervals']=_0x46782a;return _0x4e3e40['models'][_0x0a87('0x3')][_0x0a87('0x2')]({'where':{'IntervalId':_0x373b13[_0x0a87('0x4')]},'raw':!![]});})[_0x0a87('0x5')](function(_0x4d8254){return _0x4e3e40[_0x0a87('0x1')]['VoiceExtension'][_0x0a87('0x2')]({'where':{'exten':{'$in':_[_0x0a87('0x6')](_[_0x0a87('0x7')](_0x4d8254,_0x0a87('0x8')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x37adae){var _0x435315=_[_0x0a87('0x9')](_0x37adae,{'priority':'1'});var _0x1c8acb=_[_0x0a87('0x9')](_0x37adae,{'isApp':0x1});var _0x2cce84=_[_0x0a87('0xa')](_0x1c8acb,'exten');var _0x3a0408=[_0x0a87('0xb'),_0x0a87('0xc')];var _0x1c2299=[];var _0x5df1ba=[];for(var _0x3a84a4 in _0x2cce84){if(_0x2cce84[_0x0a87('0xd')](_0x3a84a4)){_0x190175[_0x0a87('0xe')]=0x2;_0x190175[_0x0a87('0xf')]=[];_0x190175[_0x0a87('0x10')]=_[_0x0a87('0x11')](_0x435315,{'exten':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x8')]});_0x190175[_0x0a87('0xf')][_0x0a87('0x12')]({'type':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x13')],'app':_0x0a87('0x14'),'appdata':util[_0x0a87('0x15')](_0x0a87('0x16'),_0x2cce84[_0x3a84a4][0x0]['type']),'context':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x17')],'exten':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x8')],'priority':_0x190175[_0x0a87('0xe')]++,'VoiceExtensionId':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x18')]});if(_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x13')]==='outbound'){if(_0x190175['extension']){_0x190175[_0x0a87('0xf')][_0x0a87('0x12')]({'type':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x13')],'app':_0x0a87('0x14'),'appdata':_0x0a87('0x19')+(_0x190175[_0x0a87('0x10')][_0x0a87('0x1a')]?_0x0a87('0x1b')+_0x190175['extension'][_0x0a87('0x1a')]+'}':_0x0a87('0x1c')),'context':_0x2cce84[_0x3a84a4][0x0]['context'],'exten':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x8')],'priority':_0x190175[_0x0a87('0xe')]++,'VoiceExtensionId':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x18')]});}_0x190175['extensions'][_0x0a87('0x12')]({'type':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x13')],'app':_0x0a87('0x14'),'appdata':_0x0a87('0x1d')+_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x18')],'context':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x17')],'exten':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x8')],'priority':_0x190175[_0x0a87('0xe')]++,'VoiceExtensionId':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x18')]});var _0x47b0b2=_0x190175[_0x0a87('0xe')]++;_0x190175['extensions'][_0x0a87('0x12')]({'type':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x13')],'app':_0x0a87('0x1e'),'appdata':_0x0a87('0x1f')+(_0x47b0b2+0x2)+'):Goto('+(_0x47b0b2+0x1)+')','context':_0x2cce84[_0x3a84a4][0x0]['context'],'exten':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x8')],'priority':_0x47b0b2,'VoiceExtensionId':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x18')]});if(_0x190175[_0x0a87('0x10')]){_0x190175[_0x0a87('0xf')][_0x0a87('0x12')]({'type':_0x2cce84[_0x3a84a4][0x0]['type'],'app':_0x0a87('0x14'),'appdata':_0x190175['extension'][_0x0a87('0x1a')]?_0x0a87('0x20')+_0x190175[_0x0a87('0x10')][_0x0a87('0x1a')]+'}':_0x0a87('0x21'),'context':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x17')],'exten':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x8')],'priority':_0x190175[_0x0a87('0xe')]++,'VoiceExtensionId':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x18')]});}_0x190175[_0x0a87('0xf')][_0x0a87('0x12')]({'type':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x13')],'app':'Set','appdata':_0x0a87('0x22')+_0x2cce84[_0x3a84a4][0x0]['VoiceExtensionId'],'context':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x17')],'exten':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x8')],'priority':_0x190175[_0x0a87('0xe')]++,'VoiceExtensionId':_0x2cce84[_0x3a84a4][0x0]['VoiceExtensionId']});if(_0x190175['extension']&&_0x190175[_0x0a87('0x10')]['hasOwnProperty']('recordingFormat')&&_0x190175['extension'][_0x0a87('0x23')]!=='none'){_0x190175[_0x0a87('0xf')][_0x0a87('0x12')]({'type':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x13')],'app':_0x0a87('0x14'),'appdata':_0x0a87('0x24'),'context':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x17')],'exten':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x8')],'priority':_0x190175['priority']++,'VoiceExtensionId':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x18')]});_0x190175[_0x0a87('0xf')][_0x0a87('0x12')]({'type':_0x2cce84[_0x3a84a4][0x0]['type'],'app':_0x0a87('0x14'),'appdata':_0x0a87('0x25')+_0x190175[_0x0a87('0x10')][_0x0a87('0x23')]||_0x0a87('0x26'),'context':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x17')],'exten':_0x2cce84[_0x3a84a4][0x0]['exten'],'priority':_0x190175['priority']++,'VoiceExtensionId':_0x2cce84[_0x3a84a4][0x0]['VoiceExtensionId']});}}_0x190175[_0x0a87('0xf')]['push']({'type':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x13')],'app':_0x0a87('0x14'),'appdata':_0x0a87('0x27'),'context':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x17')],'exten':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x8')],'priority':_0x190175[_0x0a87('0xe')]++,'VoiceExtensionId':_0x2cce84[_0x3a84a4][0x0]['VoiceExtensionId']});_0x190175[_0x0a87('0xf')]['push']({'type':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x13')],'app':_0x0a87('0x14'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x17')],'exten':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x8')],'priority':_0x190175[_0x0a87('0xe')]++,'VoiceExtensionId':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x18')]});_0x190175[_0x0a87('0xf')][_0x0a87('0x12')]({'type':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x13')],'app':_0x0a87('0x14'),'appdata':_0x0a87('0x28'),'context':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x17')],'exten':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x8')],'priority':_0x190175[_0x0a87('0xe')]++,'VoiceExtensionId':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x18')]});for(var _0x179e1f=0x0,_0x4811df=0x0;_0x179e1f<_0x2cce84[_0x3a84a4][_0x0a87('0x29')];_0x179e1f+=0x1,_0x4811df=0x0){var _0x3f12fd=_0x2cce84[_0x3a84a4][_0x179e1f];if(_0x3f12fd[_0x0a87('0x13')]){_0x3f12fd[_0x0a87('0x13')]=_0x3f12fd[_0x0a87('0x13')][_0x0a87('0x2a')]();}var _0x43a625=[];var _0x521078=[];delete _0x3f12fd['id'];delete _0x3f12fd[_0x0a87('0x2b')];delete _0x3f12fd[_0x0a87('0x2c')];var _0x46b319=_0x3f12fd[_0x0a87('0x2d')]!=='*,*,*,*'?[_0x3f12fd[_0x0a87('0x2d')]]:_0x3f12fd[_0x0a87('0x4')]?_[_0x0a87('0x7')](_[_0x0a87('0x9')](_0x190175[_0x0a87('0x2e')],{'IntervalId':_0x3f12fd[_0x0a87('0x4')]}),_0x0a87('0x2d')):[];if(_0x3f12fd[_0x0a87('0xd')](_0x0a87('0x2f'))){if(_0x3f12fd[_0x0a87('0x2f')]&&_0x3f12fd[_0x0a87('0x2f')]!=='--'){_0x43a625[_0x0a87('0x12')]({'type':_0x3f12fd[_0x0a87('0x13')],'app':_0x0a87('0x14'),'appdata':'CDR(tag)='+_0x3f12fd[_0x0a87('0x2f')],'context':_0x3f12fd[_0x0a87('0x17')],'exten':_0x3f12fd['exten'],'priority':_0x46b319[_0x0a87('0x29')]+_0x190175[_0x0a87('0xe')]+_0x4811df++,'VoiceExtensionId':_0x3f12fd['VoiceExtensionId']});}}if(_0x3f12fd['type']===_0x0a87('0x30')&&_0x3f12fd[_0x0a87('0xd')]('callerID')){if(_0x3f12fd[_0x0a87('0x31')]){_0x43a625[_0x0a87('0x12')]({'type':_0x3f12fd[_0x0a87('0x13')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x3f12fd[_0x0a87('0x31')]+')','context':_0x3f12fd[_0x0a87('0x17')],'exten':_0x3f12fd[_0x0a87('0x8')],'priority':_0x46b319[_0x0a87('0x29')]+_0x190175[_0x0a87('0xe')]+_0x4811df++,'VoiceExtensionId':_0x3f12fd[_0x0a87('0x18')]});}else{_0x43a625[_0x0a87('0x12')]({'type':_0x3f12fd[_0x0a87('0x13')],'app':_0x0a87('0x1e'),'appdata':_0x0a87('0x32'),'context':_0x3f12fd[_0x0a87('0x17')],'exten':_0x3f12fd[_0x0a87('0x8')],'priority':_0x46b319[_0x0a87('0x29')]+_0x190175['priority']+_0x4811df++,'VoiceExtensionId':_0x3f12fd[_0x0a87('0x18')]});}}if(_0x3f12fd[_0x0a87('0xd')](_0x0a87('0x33'))){if(_0x3a0408[_0x0a87('0x34')](_0x3f12fd[_0x0a87('0x35')][_0x0a87('0x2a')]())>=0x0&&_0x3f12fd[_0x0a87('0x36')]!=='custom'){if(_0x3f12fd['answer']){_0x43a625[_0x0a87('0x12')]({'type':_0x3f12fd[_0x0a87('0x13')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x3f12fd[_0x0a87('0x17')],'exten':_0x3f12fd[_0x0a87('0x8')],'priority':_0x46b319[_0x0a87('0x29')]+_0x190175['priority']+_0x4811df++,'VoiceExtensionId':_0x3f12fd['VoiceExtensionId']});_0x43a625['push']({'type':_0x3f12fd['type'],'app':_0x0a87('0x14'),'appdata':_0x0a87('0x37'),'context':_0x3f12fd[_0x0a87('0x17')],'exten':_0x3f12fd[_0x0a87('0x8')],'priority':_0x46b319[_0x0a87('0x29')]+_0x190175[_0x0a87('0xe')]+_0x4811df++,'VoiceExtensionId':_0x3f12fd['VoiceExtensionId']});}else{_0x43a625['push']({'type':_0x3f12fd[_0x0a87('0x13')],'app':_0x0a87('0x1e'),'appdata':_0x0a87('0x38'),'context':_0x3f12fd['context'],'exten':_0x3f12fd['exten'],'priority':_0x46b319[_0x0a87('0x29')]+_0x190175['priority']+_0x4811df++,'VoiceExtensionId':_0x3f12fd['VoiceExtensionId']});_0x43a625[_0x0a87('0x12')]({'type':_0x3f12fd['type'],'app':_0x0a87('0x14'),'appdata':_0x0a87('0x39'),'context':_0x3f12fd[_0x0a87('0x17')],'exten':_0x3f12fd[_0x0a87('0x8')],'priority':_0x46b319[_0x0a87('0x29')]+_0x190175[_0x0a87('0xe')]+_0x4811df++,'VoiceExtensionId':_0x3f12fd['VoiceExtensionId']});}}}for(var _0x4c840f=0x0;_0x4c840f<_0x46b319[_0x0a87('0x29')];_0x4c840f+=0x1){var _0x4e937b=_0x190175[_0x0a87('0xe')]+_0x46b319[_0x0a87('0x29')];var _0x5f4343=_0x4c840f===_0x46b319[_0x0a87('0x29')]-0x1?_0x190175['priority']+_0x43a625[_0x0a87('0x29')]+_0x521078[_0x0a87('0x29')]+0x2:_0x190175['priority']+_0x4c840f+0x1;_0x43a625[_0x0a87('0x3a')](_0x4c840f,0x0,{'type':_0x3f12fd[_0x0a87('0x13')],'app':_0x0a87('0x3b'),'appdata':_0x46b319[_0x4c840f]+'?'+_0x3f12fd[_0x0a87('0x17')]+_0x0a87('0x3c')+_0x4e937b+':'+_0x3f12fd[_0x0a87('0x17')]+_0x0a87('0x3c')+_0x5f4343,'exten':_0x3f12fd['exten'],'context':_0x3f12fd[_0x0a87('0x17')],'priority':_0x190175[_0x0a87('0xe')]+_0x4c840f,'VoiceExtensionId':_0x2cce84[_0x3a84a4][0x0]['VoiceExtensionId']});}_0x3f12fd[_0x0a87('0xe')]=_0x43a625['length']?_[_0x0a87('0x3d')](_0x43a625)[_0x0a87('0xe')]+0x1:_0x190175[_0x0a87('0xe')];_0x190175[_0x0a87('0xe')]=(_0x521078['length']?_[_0x0a87('0x3d')](_0x521078)[_0x0a87('0xe')]:_0x3f12fd[_0x0a87('0xe')])+0x1;_0x190175[_0x0a87('0xf')]=_['concat'](_0x190175[_0x0a87('0xf')],_0x43a625,[_0x3f12fd],_0x521078);}_0x190175[_0x0a87('0xf')][_0x0a87('0x12')]({'type':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x13')],'app':'Hangup','exten':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x8')],'context':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x17')],'priority':_0x190175[_0x0a87('0xe')],'VoiceExtensionId':_0x2cce84[_0x3a84a4][0x0][_0x0a87('0x18')]});_0x1c2299['push'](_0x2cce84[_0x3a84a4][0x0]['VoiceExtensionId']);_0x5df1ba=_[_0x0a87('0x3e')](_0x5df1ba,_0x190175['extensions']);}}return _0x4e3e40[_0x0a87('0x3f')](function(_0x372872){return _0x4e3e40[_0x0a87('0x1')][_0x0a87('0x3')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x1c2299}},'transaction':_0x372872})[_0x0a87('0x5')](function(_0x5a419a){return _0x4e3e40['models'][_0x0a87('0x3')][_0x0a87('0x40')](_[_0x0a87('0x41')](_0x5df1ba,_0x0a87('0xe')),{'transaction':_0x372872});});});})[_0x0a87('0x42')](function(_0x3d1075){console[_0x0a87('0x43')](_0x3d1075);});}exports[_0x0a87('0x44')]=rewrite; \ No newline at end of file +var _0xed8a=['$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','intervals','tag','CDR(tag)=','length','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','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','concat','transaction','destroy','bulkCreate','error','rewrite','lodash','util','models','Interval','then','VoiceExtension','findAll','IntervalId','uniq','map','exten','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','type','Set','CDR(type)=%s','context','VoiceExtensionId','outbound','push','CDR(destination)=','${EXTEN}','CDR(routeid)=','ExecIf'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xed8a,0xc5));var _0xaed8=function(_0x1797eb,_0x4a4ed1){_0x1797eb=_0x1797eb-0x0;var _0x3c948a=_0xed8a[_0x1797eb];return _0x3c948a;};'use strict';var _=require(_0xaed8('0x0'));var util=require(_0xaed8('0x1'));function rewrite(_0x2ce300,_0x43f9d1){var _0x568d05=this;return _0x2ce300[_0xaed8('0x2')][_0xaed8('0x3')]['findAll']({'raw':!![]})[_0xaed8('0x4')](function(_0x2b330f){_0x568d05['intervals']=_0x2b330f;return _0x2ce300['models'][_0xaed8('0x5')][_0xaed8('0x6')]({'where':{'IntervalId':_0x43f9d1[_0xaed8('0x7')]},'raw':!![]});})[_0xaed8('0x4')](function(_0x291304){return _0x2ce300[_0xaed8('0x2')][_0xaed8('0x5')]['findAll']({'where':{'exten':{'$in':_[_0xaed8('0x8')](_[_0xaed8('0x9')](_0x291304,_0xaed8('0xa')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xaed8('0x4')](function(_0x29b08a){var _0x1385ef=_[_0xaed8('0xb')](_0x29b08a,{'priority':'1'});var _0x24b0c4=_['filter'](_0x29b08a,{'isApp':0x1});var _0x47c916=_[_0xaed8('0xc')](_0x24b0c4,'exten');var _0x3eed24=[_0xaed8('0xd'),_0xaed8('0xe')];var _0x36d561=[];var _0x53bf67=[];for(var _0x3509b0 in _0x47c916){if(_0x47c916[_0xaed8('0xf')](_0x3509b0)){_0x568d05[_0xaed8('0x10')]=0x2;_0x568d05[_0xaed8('0x11')]=[];_0x568d05[_0xaed8('0x12')]=_[_0xaed8('0x13')](_0x1385ef,{'exten':_0x47c916[_0x3509b0][0x0]['exten']});_0x568d05[_0xaed8('0x11')]['push']({'type':_0x47c916[_0x3509b0][0x0][_0xaed8('0x14')],'app':_0xaed8('0x15'),'appdata':util['format'](_0xaed8('0x16'),_0x47c916[_0x3509b0][0x0][_0xaed8('0x14')]),'context':_0x47c916[_0x3509b0][0x0][_0xaed8('0x17')],'exten':_0x47c916[_0x3509b0][0x0][_0xaed8('0xa')],'priority':_0x568d05[_0xaed8('0x10')]++,'VoiceExtensionId':_0x47c916[_0x3509b0][0x0][_0xaed8('0x18')]});if(_0x47c916[_0x3509b0][0x0][_0xaed8('0x14')]===_0xaed8('0x19')){if(_0x568d05[_0xaed8('0x12')]){_0x568d05[_0xaed8('0x11')][_0xaed8('0x1a')]({'type':_0x47c916[_0x3509b0][0x0][_0xaed8('0x14')],'app':_0xaed8('0x15'),'appdata':_0xaed8('0x1b')+(_0x568d05[_0xaed8('0x12')]['cutdigits']?'${EXTEN:'+_0x568d05[_0xaed8('0x12')]['cutdigits']+'}':_0xaed8('0x1c')),'context':_0x47c916[_0x3509b0][0x0][_0xaed8('0x17')],'exten':_0x47c916[_0x3509b0][0x0][_0xaed8('0xa')],'priority':_0x568d05[_0xaed8('0x10')]++,'VoiceExtensionId':_0x47c916[_0x3509b0][0x0]['VoiceExtensionId']});}_0x568d05['extensions']['push']({'type':_0x47c916[_0x3509b0][0x0][_0xaed8('0x14')],'app':_0xaed8('0x15'),'appdata':_0xaed8('0x1d')+_0x47c916[_0x3509b0][0x0][_0xaed8('0x18')],'context':_0x47c916[_0x3509b0][0x0][_0xaed8('0x17')],'exten':_0x47c916[_0x3509b0][0x0][_0xaed8('0xa')],'priority':_0x568d05[_0xaed8('0x10')]++,'VoiceExtensionId':_0x47c916[_0x3509b0][0x0][_0xaed8('0x18')]});var _0x10c1fa=_0x568d05['priority']++;_0x568d05[_0xaed8('0x11')][_0xaed8('0x1a')]({'type':_0x47c916[_0x3509b0][0x0][_0xaed8('0x14')],'app':_0xaed8('0x1e'),'appdata':_0xaed8('0x1f')+(_0x10c1fa+0x2)+_0xaed8('0x20')+(_0x10c1fa+0x1)+')','context':_0x47c916[_0x3509b0][0x0]['context'],'exten':_0x47c916[_0x3509b0][0x0][_0xaed8('0xa')],'priority':_0x10c1fa,'VoiceExtensionId':_0x47c916[_0x3509b0][0x0]['VoiceExtensionId']});if(_0x568d05[_0xaed8('0x12')]){_0x568d05['extensions'][_0xaed8('0x1a')]({'type':_0x47c916[_0x3509b0][0x0]['type'],'app':_0xaed8('0x15'),'appdata':_0x568d05[_0xaed8('0x12')][_0xaed8('0x21')]?_0xaed8('0x22')+_0x568d05[_0xaed8('0x12')][_0xaed8('0x21')]+'}':_0xaed8('0x23'),'context':_0x47c916[_0x3509b0][0x0][_0xaed8('0x17')],'exten':_0x47c916[_0x3509b0][0x0][_0xaed8('0xa')],'priority':_0x568d05[_0xaed8('0x10')]++,'VoiceExtensionId':_0x47c916[_0x3509b0][0x0]['VoiceExtensionId']});}_0x568d05[_0xaed8('0x11')][_0xaed8('0x1a')]({'type':_0x47c916[_0x3509b0][0x0][_0xaed8('0x14')],'app':_0xaed8('0x15'),'appdata':_0xaed8('0x24')+_0x47c916[_0x3509b0][0x0]['VoiceExtensionId'],'context':_0x47c916[_0x3509b0][0x0][_0xaed8('0x17')],'exten':_0x47c916[_0x3509b0][0x0][_0xaed8('0xa')],'priority':_0x568d05[_0xaed8('0x10')]++,'VoiceExtensionId':_0x47c916[_0x3509b0][0x0][_0xaed8('0x18')]});if(_0x568d05[_0xaed8('0x12')]&&_0x568d05[_0xaed8('0x12')]['hasOwnProperty']('recordingFormat')&&_0x568d05[_0xaed8('0x12')][_0xaed8('0x25')]!==_0xaed8('0x26')){_0x568d05['extensions']['push']({'type':_0x47c916[_0x3509b0][0x0][_0xaed8('0x14')],'app':_0xaed8('0x15'),'appdata':_0xaed8('0x27'),'context':_0x47c916[_0x3509b0][0x0]['context'],'exten':_0x47c916[_0x3509b0][0x0][_0xaed8('0xa')],'priority':_0x568d05[_0xaed8('0x10')]++,'VoiceExtensionId':_0x47c916[_0x3509b0][0x0][_0xaed8('0x18')]});_0x568d05['extensions'][_0xaed8('0x1a')]({'type':_0x47c916[_0x3509b0][0x0][_0xaed8('0x14')],'app':_0xaed8('0x15'),'appdata':_0xaed8('0x28')+_0x568d05[_0xaed8('0x12')][_0xaed8('0x25')]||_0xaed8('0x29'),'context':_0x47c916[_0x3509b0][0x0][_0xaed8('0x17')],'exten':_0x47c916[_0x3509b0][0x0][_0xaed8('0xa')],'priority':_0x568d05['priority']++,'VoiceExtensionId':_0x47c916[_0x3509b0][0x0][_0xaed8('0x18')]});}}_0x568d05[_0xaed8('0x11')][_0xaed8('0x1a')]({'type':_0x47c916[_0x3509b0][0x0][_0xaed8('0x14')],'app':'Set','appdata':_0xaed8('0x2a'),'context':_0x47c916[_0x3509b0][0x0][_0xaed8('0x17')],'exten':_0x47c916[_0x3509b0][0x0][_0xaed8('0xa')],'priority':_0x568d05[_0xaed8('0x10')]++,'VoiceExtensionId':_0x47c916[_0x3509b0][0x0][_0xaed8('0x18')]});_0x568d05[_0xaed8('0x11')][_0xaed8('0x1a')]({'type':_0x47c916[_0x3509b0][0x0][_0xaed8('0x14')],'app':'Set','appdata':_0xaed8('0x2b'),'context':_0x47c916[_0x3509b0][0x0][_0xaed8('0x17')],'exten':_0x47c916[_0x3509b0][0x0]['exten'],'priority':_0x568d05[_0xaed8('0x10')]++,'VoiceExtensionId':_0x47c916[_0x3509b0][0x0]['VoiceExtensionId']});_0x568d05[_0xaed8('0x11')][_0xaed8('0x1a')]({'type':_0x47c916[_0x3509b0][0x0]['type'],'app':_0xaed8('0x15'),'appdata':_0xaed8('0x2c'),'context':_0x47c916[_0x3509b0][0x0]['context'],'exten':_0x47c916[_0x3509b0][0x0][_0xaed8('0xa')],'priority':_0x568d05[_0xaed8('0x10')]++,'VoiceExtensionId':_0x47c916[_0x3509b0][0x0]['VoiceExtensionId']});for(var _0x2d458e=0x0,_0x2b4a20=0x0;_0x2d458e<_0x47c916[_0x3509b0]['length'];_0x2d458e+=0x1,_0x2b4a20=0x0){var _0x381121=_0x47c916[_0x3509b0][_0x2d458e];if(_0x381121['type']){_0x381121[_0xaed8('0x14')]=_0x381121[_0xaed8('0x14')][_0xaed8('0x2d')]();}var _0x5be7f5=[];var _0x54e897=[];delete _0x381121['id'];delete _0x381121[_0xaed8('0x2e')];delete _0x381121[_0xaed8('0x2f')];var _0x4ddb0f=_0x381121[_0xaed8('0x30')]!==_0xaed8('0x31')?[_0x381121[_0xaed8('0x30')]]:_0x381121[_0xaed8('0x7')]?_[_0xaed8('0x9')](_[_0xaed8('0xb')](_0x568d05[_0xaed8('0x32')],{'IntervalId':_0x381121[_0xaed8('0x7')]}),_0xaed8('0x30')):[];if(_0x381121[_0xaed8('0xf')]('tag')){if(_0x381121[_0xaed8('0x33')]&&_0x381121['tag']!=='--'){_0x5be7f5[_0xaed8('0x1a')]({'type':_0x381121[_0xaed8('0x14')],'app':'Set','appdata':_0xaed8('0x34')+_0x381121[_0xaed8('0x33')],'context':_0x381121[_0xaed8('0x17')],'exten':_0x381121['exten'],'priority':_0x4ddb0f[_0xaed8('0x35')]+_0x568d05[_0xaed8('0x10')]+_0x2b4a20++,'VoiceExtensionId':_0x381121['VoiceExtensionId']});}}if(_0x381121[_0xaed8('0x14')]===_0xaed8('0x19')&&_0x381121[_0xaed8('0xf')](_0xaed8('0x36'))){if(_0x381121[_0xaed8('0x36')]){_0x5be7f5[_0xaed8('0x1a')]({'type':_0x381121['type'],'app':_0xaed8('0x1e'),'appdata':_0xaed8('0x37')+_0x381121[_0xaed8('0x36')]+')','context':_0x381121[_0xaed8('0x17')],'exten':_0x381121[_0xaed8('0xa')],'priority':_0x4ddb0f[_0xaed8('0x35')]+_0x568d05['priority']+_0x2b4a20++,'VoiceExtensionId':_0x381121[_0xaed8('0x18')]});}else{_0x5be7f5[_0xaed8('0x1a')]({'type':_0x381121[_0xaed8('0x14')],'app':_0xaed8('0x1e'),'appdata':_0xaed8('0x38'),'context':_0x381121[_0xaed8('0x17')],'exten':_0x381121[_0xaed8('0xa')],'priority':_0x4ddb0f[_0xaed8('0x35')]+_0x568d05[_0xaed8('0x10')]+_0x2b4a20++,'VoiceExtensionId':_0x381121[_0xaed8('0x18')]});}}if(_0x381121['hasOwnProperty'](_0xaed8('0x39'))){if(_0x3eed24[_0xaed8('0x3a')](_0x381121['app'][_0xaed8('0x2d')]())>=0x0&&_0x381121[_0xaed8('0x3b')]!==_0xaed8('0x3c')){if(_0x381121['answer']){_0x5be7f5[_0xaed8('0x1a')]({'type':_0x381121[_0xaed8('0x14')],'app':'ExecIf','appdata':_0xaed8('0x3d'),'context':_0x381121[_0xaed8('0x17')],'exten':_0x381121[_0xaed8('0xa')],'priority':_0x4ddb0f[_0xaed8('0x35')]+_0x568d05[_0xaed8('0x10')]+_0x2b4a20++,'VoiceExtensionId':_0x381121[_0xaed8('0x18')]});_0x5be7f5[_0xaed8('0x1a')]({'type':_0x381121['type'],'app':_0xaed8('0x15'),'appdata':_0xaed8('0x3e'),'context':_0x381121[_0xaed8('0x17')],'exten':_0x381121[_0xaed8('0xa')],'priority':_0x4ddb0f[_0xaed8('0x35')]+_0x568d05[_0xaed8('0x10')]+_0x2b4a20++,'VoiceExtensionId':_0x381121[_0xaed8('0x18')]});}else{_0x5be7f5[_0xaed8('0x1a')]({'type':_0x381121['type'],'app':_0xaed8('0x1e'),'appdata':_0xaed8('0x3f'),'context':_0x381121[_0xaed8('0x17')],'exten':_0x381121[_0xaed8('0xa')],'priority':_0x4ddb0f[_0xaed8('0x35')]+_0x568d05[_0xaed8('0x10')]+_0x2b4a20++,'VoiceExtensionId':_0x381121[_0xaed8('0x18')]});_0x5be7f5[_0xaed8('0x1a')]({'type':_0x381121['type'],'app':'Set','appdata':_0xaed8('0x40'),'context':_0x381121[_0xaed8('0x17')],'exten':_0x381121[_0xaed8('0xa')],'priority':_0x4ddb0f[_0xaed8('0x35')]+_0x568d05[_0xaed8('0x10')]+_0x2b4a20++,'VoiceExtensionId':_0x381121[_0xaed8('0x18')]});}}}for(var _0x3a5afb=0x0;_0x3a5afb<_0x4ddb0f[_0xaed8('0x35')];_0x3a5afb+=0x1){var _0x452cb2=_0x568d05[_0xaed8('0x10')]+_0x4ddb0f[_0xaed8('0x35')];var _0xc88d83=_0x3a5afb===_0x4ddb0f[_0xaed8('0x35')]-0x1?_0x568d05[_0xaed8('0x10')]+_0x5be7f5[_0xaed8('0x35')]+_0x54e897['length']+0x2:_0x568d05[_0xaed8('0x10')]+_0x3a5afb+0x1;_0x5be7f5[_0xaed8('0x41')](_0x3a5afb,0x0,{'type':_0x381121[_0xaed8('0x14')],'app':_0xaed8('0x42'),'appdata':_0x4ddb0f[_0x3a5afb]+'?'+_0x381121['context']+_0xaed8('0x43')+_0x452cb2+':'+_0x381121['context']+_0xaed8('0x43')+_0xc88d83,'exten':_0x381121[_0xaed8('0xa')],'context':_0x381121[_0xaed8('0x17')],'priority':_0x568d05[_0xaed8('0x10')]+_0x3a5afb,'VoiceExtensionId':_0x47c916[_0x3509b0][0x0][_0xaed8('0x18')]});}_0x381121[_0xaed8('0x10')]=_0x5be7f5[_0xaed8('0x35')]?_[_0xaed8('0x44')](_0x5be7f5)[_0xaed8('0x10')]+0x1:_0x568d05[_0xaed8('0x10')];_0x568d05['priority']=(_0x54e897[_0xaed8('0x35')]?_[_0xaed8('0x44')](_0x54e897)['priority']:_0x381121[_0xaed8('0x10')])+0x1;_0x568d05[_0xaed8('0x11')]=_['concat'](_0x568d05[_0xaed8('0x11')],_0x5be7f5,[_0x381121],_0x54e897);}_0x568d05['extensions'][_0xaed8('0x1a')]({'type':_0x47c916[_0x3509b0][0x0]['type'],'app':_0xaed8('0x45'),'exten':_0x47c916[_0x3509b0][0x0]['exten'],'context':_0x47c916[_0x3509b0][0x0][_0xaed8('0x17')],'priority':_0x568d05[_0xaed8('0x10')],'VoiceExtensionId':_0x47c916[_0x3509b0][0x0][_0xaed8('0x18')]});_0x36d561['push'](_0x47c916[_0x3509b0][0x0]['VoiceExtensionId']);_0x53bf67=_[_0xaed8('0x46')](_0x53bf67,_0x568d05[_0xaed8('0x11')]);}}return _0x2ce300[_0xaed8('0x47')](function(_0x5c3f74){return _0x2ce300[_0xaed8('0x2')]['VoiceExtension'][_0xaed8('0x48')]({'where':{'VoiceExtensionId':{'$in':_0x36d561}},'transaction':_0x5c3f74})[_0xaed8('0x4')](function(_0x136cae){return _0x2ce300[_0xaed8('0x2')][_0xaed8('0x5')][_0xaed8('0x49')](_['sortBy'](_0x53bf67,_0xaed8('0x10')),{'transaction':_0x5c3f74});});});})['catch'](function(_0x3e0870){console[_0xaed8('0x4a')](_0x3e0870);});}exports[_0xaed8('0x4b')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 60de26a..75e28b9 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 _0xcb91=['generalCheckHopper','Error\x20processing\x20rows\x20block:','resolve','emit','contact:csv_','unlinkSync','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','Missing\x20filepath\x20parameter!','undefined','zipObject','split','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','birthDate','YYYY-MM-DD','email','ListId','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','phone','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','where','\x20=\x20?','into','fromQuery','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','VoiceQueueId','all','VoiceQueue','BlackLists','get','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s'];(function(_0x2f593c,_0x396834){var _0x38065f=function(_0x234fb6){while(--_0x234fb6){_0x2f593c['push'](_0x2f593c['shift']());}};_0x38065f(++_0x396834);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xcb91[_0x13b02f];return _0x12e9a6;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x1cb9('0x0'));var fs=require('fs');var squel=require(_0x1cb9('0x1'));var Papa=require(_0x1cb9('0x2'));var Redis=require(_0x1cb9('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('api');config[_0x1cb9('0x6')]=_[_0x1cb9('0x7')](config['redis'],{'host':_0x1cb9('0x8'),'port':0x18eb});var socket=require(_0x1cb9('0x9'))(new Redis(config['redis']));require(_0x1cb9('0xa'))[_0x1cb9('0xb')](socket);try{if(!process['argv'][0x2]||process[_0x1cb9('0xc')][0x2]==='undefined'||process['argv'][0x2]===_0x1cb9('0xd')){throw new Error(_0x1cb9('0xe'));}var FILEPATH=process[_0x1cb9('0xc')][0x2];if(!process[_0x1cb9('0xc')][0x3]||process[_0x1cb9('0xc')][0x3]==='undefined'||process[_0x1cb9('0xc')][0x3]===_0x1cb9('0xd')||!process[_0x1cb9('0xc')][0x4]||process[_0x1cb9('0xc')][0x4]===_0x1cb9('0xf')||process['argv'][0x4]==='null'){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x1cb9('0x10')](process[_0x1cb9('0xc')][0x3][_0x1cb9('0x11')](','),process[_0x1cb9('0xc')][0x4]['split'](','));if(!process[_0x1cb9('0xc')][0x5]||process[_0x1cb9('0xc')][0x5]===_0x1cb9('0xf')||process[_0x1cb9('0xc')][0x5]===_0x1cb9('0xd')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x1cb9('0xc')][0x6]&&process[_0x1cb9('0xc')][0x6]!==_0x1cb9('0xf')&&process[_0x1cb9('0xc')][0x6]!==_0x1cb9('0xd')?process[_0x1cb9('0xc')][0x6]:null;var DUPLICATES=process[_0x1cb9('0xc')][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0x1cb9('0xc')][0x7]!==_0x1cb9('0xd')?process[_0x1cb9('0xc')][0x7]:null;if(!process[_0x1cb9('0xc')][0x8]||process[_0x1cb9('0xc')][0x8]===_0x1cb9('0xf')||process[_0x1cb9('0xc')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x1cb9('0xc')][0x8];}catch(_0x5dbfae){logger[_0x1cb9('0x12')](_0x5dbfae);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x2265ea,_0x523b26,_0x599275,_0x2e3854){var _0x325637={'message':_0x523b26};_0x325637[_0x2265ea]=!![];if(_0x599275){_0x325637[_0x1cb9('0x13')]=_0x599275;}if(_0x2e3854){_0x325637[_0x1cb9('0x14')]=_0x2e3854;}return _0x325637;}function isEmail(_0x45b8d3){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x1cb9('0x15')](_0x45b8d3);}function checkRow(_0x59ebea,_0x55b232,_0x6c6f61){return new BPromise(function(_0x557199,_0x10a419){if(_[_0x1cb9('0x16')](_0x59ebea)){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),_0x1cb9('0x17'),null,_0x6c6f61));}if(_0x59ebea[_0x1cb9('0x18')]&&_0x59ebea['errors'][_0x1cb9('0x19')]){var _0x9df250=_['map'](_0x59ebea[_0x1cb9('0x18')],_0x1cb9('0x1a'))[_0x1cb9('0x1b')](';');return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),_0x9df250,null,_0x6c6f61));}var _0x406821={};for(var _0x21d6f5 in FIELDS){if(FIELDS[_0x1cb9('0x1c')](_0x21d6f5)&&FIELDS[_0x21d6f5]){_0x406821[_0x21d6f5]=_0x59ebea[_0x1cb9('0x1d')][0x0][FIELDS[_0x21d6f5]]||_0x59ebea[_0x1cb9('0x1d')][0x0]['\ufeff'+FIELDS[_0x21d6f5]];}}if(!_0x406821[_0x1cb9('0x1e')]){return _0x10a419(handleCheckRowError('error',_0x1cb9('0x1f'),null,_0x6c6f61));}if(!_0x406821['phone']){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'phone\x20not\x20specified!',null,_0x6c6f61));}if(_0x406821[_0x1cb9('0x20')]){var _0x41011c=moment(_0x406821[_0x1cb9('0x20')],_0x1cb9('0x21'));if(!_0x41011c['isValid']()){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x6c6f61));}}if(_0x406821[_0x1cb9('0x22')]){if(!isEmail(_0x406821[_0x1cb9('0x22')])){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'email\x20format\x20is\x20not\x20valid!',null,_0x6c6f61));}}_0x406821[_0x1cb9('0x23')]=LISTID;_0x406821['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x1cb9('0x19')]&&_0x55b232){var _0x58f4f5={};for(var _0x2164e3=0x0,_0x42a688=DUPLICATES[_0x1cb9('0x19')];_0x2164e3<_0x42a688;_0x2164e3+=0x1){_0x58f4f5[DUPLICATES[_0x2164e3]]=_0x406821[DUPLICATES[_0x2164e3]];}var _0xae910=_['find'](_0x55b232,_0x58f4f5);if(_0xae910){return _0x10a419(handleCheckRowError(_0x1cb9('0x24'),_0x1cb9('0x25'),_0xae910,_0x6c6f61));}}return db[_0x1cb9('0x26')][_0x1cb9('0x27')](_0x406821,{'raw':!![],'hooks':![],'fields':_[_0x1cb9('0x28')](_0x406821)})[_0x1cb9('0x29')](function(_0xc6d5fd){if(DUPLICATES&&DUPLICATES[_0x1cb9('0x19')]&&_0x55b232){_0x55b232[_0x1cb9('0x2a')](_[_0x1cb9('0x2b')](_0x406821,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xc6d5fd['id'];return _0x557199();})[_0x1cb9('0x2c')](function(_0x26b950){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'Error\x20while\x20creating\x20contact:\x20'+(_0x26b950['message']||JSON[_0x1cb9('0x2d')](_0x26b950)),null,_0x6c6f61));});});}function checkHopper(){function _0x30f7e4(){return function(_0x91c937){logger[_0x1cb9('0x12')](_0x1cb9('0x2e'),_0x1cb9('0x2f'),util[_0x1cb9('0x30')](_0x91c937,{'showHidden':![],'depth':null}));};}var _0x3f5637=function(_0x4d3e39,_0x2aa59b){var _0x1482c4=squel[_0x1cb9('0x31')]()['into'](_0x1cb9('0x32'))['fromQuery']([_0x1cb9('0x33'),'scheduledAt',_0x1cb9('0x34'),_0x1cb9('0x23'),_0x2aa59b,_0x1cb9('0x35'),_0x1cb9('0x36')],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x33'),'phone')['field'](_0x1cb9('0x39'),_0x1cb9('0x3a'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x4d3e39['id'][_0x1cb9('0x3b')](),_0x2aa59b)['field']('NOW()','createdAt')[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')](_0x1cb9('0x3d'))['where'](_0x1cb9('0x3e'))['where'](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x1cb9('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')]('phone')['from'](_0x1cb9('0x32'))[_0x1cb9('0x40')](_0x2aa59b+_0x1cb9('0x41'),_0x4d3e39['id'][_0x1cb9('0x3b')]())))[_0x1cb9('0x3b')]();return _0x1482c4;};var _0x58832e=function(_0x11d877,_0x5594fc){var _0x4c59e7=squel['insert']()[_0x1cb9('0x42')](_0x1cb9('0x32'))[_0x1cb9('0x43')]([_0x1cb9('0x33'),_0x1cb9('0x3a'),_0x1cb9('0x34'),_0x1cb9('0x23'),_0x5594fc,_0x1cb9('0x35'),_0x1cb9('0x36')],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')]('phone',_0x1cb9('0x33'))[_0x1cb9('0x38')](_0x1cb9('0x39'),'scheduledAt')[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x11d877['id'][_0x1cb9('0x3b')](),_0x5594fc)['field'](_0x1cb9('0x39'),'createdAt')[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')]('cm_contacts')[_0x1cb9('0x40')](_0x1cb9('0x3e'))[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')](_0x1cb9('0x44'),squel[_0x1cb9('0x45')](hopperContacts))[_0x1cb9('0x40')](_0x1cb9('0x46'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x47'))[_0x1cb9('0x3c')](_0x1cb9('0x48'))[_0x1cb9('0x40')](_0x5594fc+_0x1cb9('0x41'),_0x11d877['id'][_0x1cb9('0x3b')]()))[_0x1cb9('0x40')](_0x1cb9('0x49'),squel['select']()[_0x1cb9('0x38')]('phone')[_0x1cb9('0x3c')]('cm_hopper')[_0x1cb9('0x40')](_0x5594fc+'\x20=\x20?',_0x11d877['id']['toString']())))[_0x1cb9('0x3b')]();return _0x4c59e7;};function _0x3b0c2e(_0x303da3,_0x4bce54){var _0x3c157f=squel[_0x1cb9('0x31')]()['into']('cm_hopper')[_0x1cb9('0x43')]([_0x1cb9('0x33'),_0x1cb9('0x3a'),_0x1cb9('0x34'),_0x1cb9('0x23'),_0x4bce54,_0x1cb9('0x35'),_0x1cb9('0x36')],squel['select']()[_0x1cb9('0x38')](_0x1cb9('0x33'),_0x1cb9('0x33'))['field'](_0x1cb9('0x39'),_0x1cb9('0x3a'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),'ListId')[_0x1cb9('0x38')](_0x303da3['id'][_0x1cb9('0x3b')](),_0x4bce54)[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x35'))[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')](_0x1cb9('0x3d'))[_0x1cb9('0x40')]('deletedAt\x20IS\x20NULL')[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x1cb9('0x40')](_0x1cb9('0x46')))[_0x1cb9('0x3b')]();return _0x3c157f;}function _0x173db5(_0x3c2f9c,_0x75c734){var _0xc515a6=squel[_0x1cb9('0x31')]()['into']('cm_hopper_black')[_0x1cb9('0x43')](['phone','ContactId','ListId',_0x75c734,'createdAt','updatedAt'],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x33'),_0x1cb9('0x33'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))['field'](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x3c2f9c['id']['toString'](),_0x75c734)[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x35'))[_0x1cb9('0x38')](_0x1cb9('0x39'),'updatedAt')['from']('cm_contacts')[_0x1cb9('0x40')](_0x1cb9('0x3e'))[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())['where'](_0x1cb9('0x44'),squel[_0x1cb9('0x45')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x1cb9('0x3b')]();return _0xc515a6;}return db['VoiceQueue'][_0x1cb9('0x4a')]({'where':{'type':_0x1cb9('0x4b')},'attributes':['id',_0x1cb9('0x4c')],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x4e'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x4aeeff){var _0xde0d93=[];if(_0x4aeeff){var _0x15fc04;for(var _0x330fc1=0x0,_0x17c361;_0x330fc1<_0x4aeeff['length'];_0x330fc1+=0x1){_0x17c361=_0x4aeeff[_0x330fc1]['get']({'plain':!![]});switch(_0x17c361[_0x1cb9('0x4c')]){case _0x1cb9('0x4f'):_0xde0d93[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x58832e(_0x17c361,_0x1cb9('0x52')))['then'](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;case'onlyIfOpen':_0xde0d93[_0x1cb9('0x2a')](db[_0x1cb9('0x50')]['query'](_0x3f5637(_0x17c361,_0x1cb9('0x52')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;default:_0xde0d93['push'](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x3b0c2e(_0x17c361,_0x1cb9('0x52')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}}return _0xde0d93;})[_0x1cb9('0x53')]()['then'](function(){return db[_0x1cb9('0x54')][_0x1cb9('0x4a')]({'where':{'type':_0x1cb9('0x4b')},'attributes':['id'],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x55'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x128a41){var _0x37bcd9=[];if(_0x128a41){var _0x4cd544;for(var _0x28bac2=0x0,_0x78e9c;_0x28bac2<_0x128a41['length'];_0x28bac2+=0x1){_0x78e9c=_0x128a41[_0x28bac2][_0x1cb9('0x56')]({'plain':!![]});_0x37bcd9['push'](db[_0x1cb9('0x50')]['query'](_0x173db5(_0x78e9c,'VoiceQueueId'))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}return _0x37bcd9;})['all']();})[_0x1cb9('0x29')](function(){return db['Campaign'][_0x1cb9('0x4a')]({'attributes':['id',_0x1cb9('0x4c')],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x4e'),'where':{'id':LISTID}}]})['then'](function(_0x45ca54){var _0x3d25a3=[];if(_0x45ca54){for(var _0x2a157d=0x0,_0x27cc3c;_0x2a157d<_0x45ca54[_0x1cb9('0x19')];_0x2a157d+=0x1){_0x27cc3c=_0x45ca54[_0x2a157d][_0x1cb9('0x56')]({'plain':!![]});switch(_0x27cc3c['dialCheckDuplicateType']){case _0x1cb9('0x4f'):_0x3d25a3[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x58832e(_0x27cc3c,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})['catch'](_0x30f7e4()));break;case _0x1cb9('0x58'):_0x3d25a3[_0x1cb9('0x2a')](db['sequelize'][_0x1cb9('0x51')](_0x3f5637(_0x27cc3c,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;default:_0x3d25a3[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x3b0c2e(_0x27cc3c,'CampaignId'))[_0x1cb9('0x29')](function(){})['catch'](_0x30f7e4()));}}}return _0x3d25a3;})[_0x1cb9('0x53')]();})[_0x1cb9('0x29')](function(){return db['Campaign'][_0x1cb9('0x4a')]({'attributes':['id'],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x55'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x56f23d){var _0x113367=[];if(_0x56f23d){for(var _0x39b0cb=0x0,_0x429371;_0x39b0cb<_0x56f23d['length'];_0x39b0cb+=0x1){_0x429371=_0x56f23d[_0x39b0cb][_0x1cb9('0x56')]({'plain':!![]});_0x113367[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x173db5(_0x429371,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}return _0x113367;})['all']();})[_0x1cb9('0x2c')](function(_0x4b15a4){logger[_0x1cb9('0x12')](_0x1cb9('0x59'),_0x1cb9('0x5a'),_0x4b15a4[_0x1cb9('0x1a')]);});}var processPromises=function(_0x4bdbd2){return BPromise[_0x1cb9('0x53')](promises)[_0x1cb9('0x29')](function(_0x5e68a1){})[_0x1cb9('0x2c')](function(_0x416508){logger[_0x1cb9('0x12')](_0x1cb9('0x5b'),JSON[_0x1cb9('0x2d')](_0x416508));})['finally'](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4bdbd2){return _0x4bdbd2['resume']();}});};var endCsv=function(){return BPromise[_0x1cb9('0x5c')]()[_0x1cb9('0x29')](function(){if(hopperContacts){return checkHopper();}})[_0x1cb9('0x29')](function(){socket[_0x1cb9('0x5d')](_0x1cb9('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x1cb9('0x5f')](FILEPATH);}catch(_0x1e6402){logger[_0x1cb9('0x12')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x1cb9('0x2d')](_0x1e6402));}finally{process[_0x1cb9('0x60')](0x0);}});};process['on'](_0x1cb9('0x61'),function(){logger['info'](_0x1cb9('0x62'));endCsv();});function main(){return BPromise[_0x1cb9('0x5c')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x1cb9('0x11')](',');return db[_0x1cb9('0x26')][_0x1cb9('0x4a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x1cb9('0x29')](function(_0x5cb5e5){var _0x2c0416=fs[_0x1cb9('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x2c0416,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5bd78d,_0x1f2d69){total+=0x1;var _0x3ba0a5=total;promises['push'](checkRow(_0x5bd78d,_0x5cb5e5,_0x3ba0a5)['then'](function(){success+=0x1;})[_0x1cb9('0x2c')](function(_0x3486e5){if(_0x3486e5['error']){errors+=0x1;delete _0x3486e5['error'];}else if(_0x3486e5[_0x1cb9('0x24')]){duplicates+=0x1;delete _0x3486e5['duplicate'];}rows['push'](_0x3486e5);}));if(total%0xc8===0x0){_0x1f2d69['pause']();return processPromises(_0x1f2d69);}},'complete':function(){return processPromises()[_0x1cb9('0x29')](function(){logger['info'](_0x1cb9('0x64'));endCsv();});},'error':function(_0x3c717b,_0x33ec43){logger['info'](_0x1cb9('0x65'),JSON[_0x1cb9('0x2d')](_0x3c717b));endCsv();}});})[_0x1cb9('0x2c')](function(_0x4c54b5){logger[_0x1cb9('0x12')](_0x1cb9('0x66'),JSON[_0x1cb9('0x2d')](_0x4c54b5));});}main(); \ No newline at end of file +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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xb7e7,0x121));var _0x7b7e=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xb7e7[_0x465028];return _0xb783d4;};'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 diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 13ad086..ba271dd 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 _0x25c1=['exit','errors','push','code','message','info','query','spread','catch','main','stringify','send','start','binding','root','server/files/tmp','writeFileSync','parse','data','length','rows','hasOwnProperty','trim','replace','isValid','isNaN','UserId','isNumber','includes','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','SystemRow','appendFileSync','emit','Abort\x20parser','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','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','campaigns_has_cm_blacklists','finish','affectedRows','contact:import:','unlink','argv','arguments\x20\x20\x20','existsSync','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','bluebird','moment','squel','../../../mysqldb','../../../config/logger','import','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','phone','from','join','.id\x20=\x20','where','\x20=\x20','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','scheduledat','ContactId','ListId','createdAt','priority','recallme','fields','cm_contacts','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','cm_hopper','toString','cm_contacts.phone','cm_contacts.id','cm_hopper_black','updatedAt','cm_contacts.ListId\x20=\x20','.CmListId','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','error'];(function(_0x4ad5d8,_0x506815){var _0x404bfe=function(_0x1eaf85){while(--_0x1eaf85){_0x4ad5d8['push'](_0x4ad5d8['shift']());}};_0x404bfe(++_0x506815);}(_0x25c1,0x148));var _0x125c=function(_0x1b690b,_0xdd5468){_0x1b690b=_0x1b690b-0x0;var _0x2cebff=_0x25c1[_0x1b690b];return _0x2cebff;};'use strict';var fs=require('fs');var path=require(_0x125c('0x0'));var _=require(_0x125c('0x1'));var Papa=require(_0x125c('0x2'));var util=require('util');var BPromise=require(_0x125c('0x3'));var moment=require(_0x125c('0x4'));var squel=require(_0x125c('0x5'));var Redis=require('ioredis');var db=require(_0x125c('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0x125c('0x7'))(_0x125c('0x8'));config[_0x125c('0x9')]=_['defaults'](config[_0x125c('0x9')],{'host':_0x125c('0xa'),'port':0x18eb});var socket=require(_0x125c('0xb'))(new Redis(config[_0x125c('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x125c('0xc')](_0x125c('0xd'));function isEmail(_0x4b0e0b){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))*$/[_0x125c('0xe')](_0x4b0e0b);}function selectNotIn(_0x152307,_0x517442,_0x4ca701,_0x38f4fe,_0xe5256c){return squel[_0x125c('0xf')]()['field'](_0x125c('0x10'))[_0x125c('0x11')](_0x38f4fe)[_0x125c('0x12')](_0x517442,null,_0x517442+_0x125c('0x13')+_0x38f4fe+'.'+_0x4ca701)[_0x125c('0x14')](_0x38f4fe+'.'+_0x4ca701+_0x125c('0x15')+_0x152307+'.'+_0x4ca701)[_0x125c('0x14')](_0x517442+'.dialCheckDuplicateType\x20IN\x20('+_0xe5256c[_0x125c('0x12')]()+')');}function insertCmHopper(_0x1aff5f,_0x4ba45e,_0x41fe2b,_0x460e6e,_0x3c9744){var _0x4ee755=['cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id',_0x125c('0x16'),_0x4ba45e+'.'+_0x460e6e,_0x125c('0x17'),_0x125c('0x18'),_0x125c('0x19'),_0x125c('0x1a'),'\x22'+_0x3c9744+'\x22'];return squel[_0x125c('0x1b')]()[_0x125c('0x1c')]('cm_hopper')[_0x125c('0x1d')]([_0x125c('0x10'),_0x125c('0x1e'),_0x125c('0x1f'),_0x125c('0x20'),_0x460e6e,_0x125c('0x21'),'updatedAt',_0x125c('0x22'),'UserId',_0x125c('0x23')],squel[_0x125c('0xf')]()[_0x125c('0x24')](_0x4ee755)[_0x125c('0x11')](_0x4ba45e)['join'](_0x125c('0x25'),null,'cm_contacts.ListId\x20=\x20'+_0x4ba45e+'.CmListId')[_0x125c('0x12')](_0x41fe2b,null,_0x41fe2b+'.id\x20=\x20'+_0x4ba45e+'.'+_0x460e6e)[_0x125c('0x14')](_0x4ba45e+_0x125c('0x26'),_0x1aff5f)[_0x125c('0x14')](_0x125c('0x27'),NOW)[_0x125c('0x14')](_0x125c('0x28'),selectNotIn(_0x4ba45e,_0x41fe2b,_0x460e6e,'cm_hopper',['\x22always\x22',_0x125c('0x29')]))['where'](_0x125c('0x28'),selectNotIn(_0x4ba45e,_0x41fe2b,_0x460e6e,_0x125c('0x2a'),['\x22always\x22'])))[_0x125c('0x2b')]();}function insertCmHopperBlack(_0x5c17c4,_0x25a318,_0x5892b2,_0x485ddc){var _0x1f398a=[_0x125c('0x2c'),_0x125c('0x2d'),_0x125c('0x16'),_0x25a318+'.'+_0x485ddc,_0x125c('0x17'),_0x125c('0x18')];return squel[_0x125c('0x1b')]()['into'](_0x125c('0x2e'))['fromQuery']([_0x125c('0x10'),'ContactId','ListId',_0x485ddc,_0x125c('0x21'),_0x125c('0x2f')],squel[_0x125c('0xf')]()[_0x125c('0x24')](_0x1f398a)['from'](_0x25a318)[_0x125c('0x12')](_0x125c('0x25'),null,_0x125c('0x30')+_0x25a318+_0x125c('0x31'))['join'](_0x5892b2,null,_0x5892b2+_0x125c('0x13')+_0x25a318+'.'+_0x485ddc)[_0x125c('0x14')](_0x25a318+_0x125c('0x26'),_0x5c17c4)[_0x125c('0x14')](_0x125c('0x27'),NOW)[_0x125c('0x14')](_0x125c('0x28'),squel[_0x125c('0xf')]()['field'](_0x125c('0x10'))[_0x125c('0x11')]('cm_hopper_black')[_0x125c('0x14')](_0x125c('0x32'),_0x5c17c4)[_0x125c('0x14')](_0x485ddc+_0x125c('0x33'),_0x25a318+'.'+_0x485ddc)))[_0x125c('0x2b')]();}function insertCmContact(_0x60e421,_0x5ae0cb,_0x440c68,_0x26c54d){var _0x571202=_[_0x125c('0x34')](_[_0x125c('0x35')](_0x26c54d),[_0x125c('0x20'),_0x125c('0x36'),'createdAt',_0x125c('0x2f')]);return squel[_0x125c('0x1b')]()[_0x125c('0x1c')]('cm_contacts')[_0x125c('0x1d')](_0x571202,squel[_0x125c('0xf')]()[_0x125c('0x24')](_0x571202)[_0x125c('0x11')](_0x5ae0cb)[_0x125c('0x14')]('('+_0x440c68[_0x125c('0x12')](',')+_0x125c('0x37'),squel[_0x125c('0xf')]()[_0x125c('0x24')](_0x440c68)['from']('cm_contacts')['where']('ListId\x20=\x20?',_0x60e421)['where'](_0x125c('0x38')))[_0x125c('0x14')](_0x125c('0x39'),squel[_0x125c('0xf')]()['field'](_0x125c('0x3a'),_0x125c('0x3b'))[_0x125c('0x11')](_0x5ae0cb)[_0x125c('0x3c')](_0x440c68[_0x125c('0x12')](','))))[_0x125c('0x2b')]();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x2a2f68){logger[_0x125c('0x3d')](_0x2a2f68['message']);process[_0x125c('0x3e')](0x1);}function handleError(_0x20bbf2,_0x302f7d){stats[_0x125c('0x3f')][_0x125c('0x40')]({'name':_0x302f7d[_0x125c('0x41')],'message':_0x302f7d[_0x125c('0x42')],'row':_0x20bbf2});}function handleQuery(_0x1515fa){logger[_0x125c('0x43')](_0x1515fa);return db['sequelize'][_0x125c('0x44')](_0x1515fa)[_0x125c('0x45')](function(_0x150488){results[_0x125c('0x40')](_0x150488);})[_0x125c('0x46')](function(_0x158803){logger[_0x125c('0x3d')](_0x158803[_0x125c('0x42')]);});}function main(_0x5869ee,_0x1c59d2,_0x18f4e2,_0x641b8b){logger[_0x125c('0x43')](_0x125c('0x47'),_0x5869ee,JSON[_0x125c('0x48')](_0x1c59d2));process[_0x125c('0x49')](_0x125c('0x4a'));var _0x2c2c5f=_0x1c59d2[_0x125c('0x4b')];var _0xecb58d=_0x1c59d2['socket_timestamp'];var _0x3e4b2d=path[_0x125c('0x12')](config[_0x125c('0x4c')],_0x125c('0x4d'),_0xecb58d+'.csv');var _0x43dcf3=_[_0x125c('0x35')](_0x2c2c5f)[_0x125c('0x12')]();logger[_0x125c('0x43')]('header',_0x43dcf3);fs[_0x125c('0x4e')](_0x3e4b2d,_0x43dcf3+'\x0a');Papa[_0x125c('0x4f')](fs['createReadStream'](_0x5869ee),{'header':!![],'skipEmptyLines':!![],'step':function(_0x8f6197,_0x49afd5){try{for(var _0x50f386=0x0,_0xdc24b2=[];_0x50f386<_0x8f6197[_0x125c('0x50')][_0x125c('0x51')];_0x50f386++){stats[_0x125c('0x52')]+=0x1;if(_0x8f6197[_0x125c('0x3f')][_0x50f386]){handleError(_0x8f6197[_0x125c('0x50')][_0x50f386],_0x8f6197[_0x125c('0x3f')][_0x50f386]);}else{var _0x196ee6=[];for(var _0x3fd470 in _0x2c2c5f){if(_0x2c2c5f[_0x125c('0x53')](_0x3fd470)){if(_0x8f6197[_0x125c('0x50')][_0x50f386][_0x2c2c5f[_0x3fd470]]){var _0x5f1311=_[_0x125c('0x54')](_0x8f6197[_0x125c('0x50')][_0x50f386][_0x2c2c5f[_0x3fd470]][_0x125c('0x55')](/"/g,'\x27'));switch(_0x3fd470){case _0x125c('0x1e'):var _0x530ae3=moment(_0x5f1311,_0x125c('0xd'),!![]);if(_0x530ae3[_0x125c('0x56')]()){_0xdc24b2[_0x125c('0x40')]('\x22'+_0x5f1311+'\x22');}else{_0x196ee6[_0x125c('0x40')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x125c('0x22'):var _0x10593b=parseInt(_0x5f1311);_0x5f1311=_[_0x125c('0x57')](_0x10593b)||_0x10593b<0x0||_0x10593b>0x4?_0x641b8b?0x3:0x2:_0x10593b;_0xdc24b2[_0x125c('0x40')]('\x22'+_0x5f1311+'\x22');break;case _0x125c('0x58'):var _0x1c7625=parseInt(_0x5f1311);if(_[_0x125c('0x59')](_0x1c7625)&&_[_0x125c('0x5a')](_0x18f4e2,_0x1c7625)){_0xdc24b2['push']('\x22'+_0x1c7625+'\x22');}else{_0x196ee6['push'](_0x125c('0x5b'));}break;case _0x125c('0x5c'):if(isEmail(_0x5f1311)){_0xdc24b2['push']('\x22'+_0x5f1311+'\x22');}else{_0x196ee6['push']('email\x20wrong\x20format');}break;case _0x125c('0x5d'):var _0x3fee3e=moment(_0x5f1311,_0x125c('0x5e'),!![]);if(_0x3fee3e[_0x125c('0x56')]()){_0xdc24b2['push']('\x22'+_0x5f1311+'\x22');}else{_0x196ee6[_0x125c('0x40')](_0x125c('0x5f'));}break;default:_0xdc24b2['push']('\x22'+_0x5f1311+'\x22');}}else{switch(_0x3fd470){case _0x125c('0x60'):case _0x125c('0x10'):_0x196ee6['push'](_0x3fd470+'\x20not\x20specified');break;default:_0xdc24b2[_0x125c('0x40')]('\x22\x22');}}}}if(_0x196ee6[_0x125c('0x51')]){handleError(_0x8f6197[_0x125c('0x50')][_0x50f386],{'code':_0x125c('0x61'),'message':_0x196ee6[_0x125c('0x12')]()});}else{fs[_0x125c('0x62')](_0x3e4b2d,_0xdc24b2[_0x125c('0x12')]()+'\x0a');}_0xdc24b2=[];}if(!(stats[_0x125c('0x52')]%0xc8)){socket[_0x125c('0x63')]('contact:import:'+_0xecb58d,stats);stats[_0x125c('0x3f')]=[];}}if(stopped){logger['info'](_0x125c('0x64'));_0x49afd5['abort']();}}catch(_0x1a12f2){handleError(_0x8f6197[_0x125c('0x50')][_0x50f386],{'code':'SystemError','message':_0x1a12f2[_0x125c('0x42')]});logger[_0x125c('0x3d')]('step',_0x1a12f2[_0x125c('0x42')]);}},'complete':function(){try{var _0x4517a7=[];var _0xb5452a=_0x125c('0x25');if(_0x1c59d2[_0x125c('0x65')]&&_0x1c59d2['duplicates'][_0x125c('0x51')]){_0xb5452a=_0x125c('0x66')+_0xecb58d;_0x4517a7[_0x125c('0x40')](_0x125c('0x67')+_0xb5452a+_0x125c('0x68'));}var _0x383825=util[_0x125c('0xc')](_0x125c('0x69'),_0x3e4b2d,_0xb5452a,_0x43dcf3,_0x1c59d2[_0x125c('0x20')],_0x1c59d2[_0x125c('0x36')]||null,NOW,NOW);if(_[_0x125c('0x6a')](_0x2c2c5f[_0x125c('0x1e')])){_0x383825+=_0x125c('0x6b');}_0x4517a7[_0x125c('0x40')](_0x383825);if(_0x1c59d2[_0x125c('0x65')]&&_0x1c59d2[_0x125c('0x65')][_0x125c('0x51')]){_0x4517a7['push'](insertCmContact(_0x1c59d2[_0x125c('0x20')],_0xb5452a,_0x1c59d2[_0x125c('0x65')],_0x2c2c5f));_0x4517a7[_0x125c('0x40')]('DROP\x20TABLE\x20'+_0xb5452a+';');}_0x4517a7[_0x125c('0x40')](insertCmHopper(_0x1c59d2['ListId'],'voice_queues_has_cm_lists',_0x125c('0x6c'),_0x125c('0x6d'),_0x641b8b));_0x4517a7[_0x125c('0x40')](insertCmHopperBlack(_0x1c59d2[_0x125c('0x20')],_0x125c('0x6e'),_0x125c('0x6c'),_0x125c('0x6d')));_0x4517a7[_0x125c('0x40')](insertCmHopper(_0x1c59d2['ListId'],_0x125c('0x6f'),_0x125c('0x70'),'CampaignId',_0x641b8b));_0x4517a7[_0x125c('0x40')](insertCmHopperBlack(_0x1c59d2['ListId'],_0x125c('0x71'),_0x125c('0x70'),'CampaignId'));BPromise['each'](_0x4517a7,handleQuery)['then'](function(_0x15a297){stats[_0x125c('0x72')]=!![];stats[_0x125c('0x73')]=_0x1c59d2[_0x125c('0x65')]&&_0x1c59d2[_0x125c('0x65')]['length']?results[0x2][_0x125c('0x73')]:results[0x0][_0x125c('0x73')];socket['emit'](_0x125c('0x74')+_0xecb58d,stats);fs[_0x125c('0x75')](_0x5869ee);fs[_0x125c('0x75')](_0x3e4b2d);process['exit'](0x0);})[_0x125c('0x46')](function(_0x597a93){logger[_0x125c('0x3d')](_0x597a93['message']);process[_0x125c('0x3e')](0x1);});}catch(_0x577c84){logger['error']('complete',_0x577c84[_0x125c('0x42')]);process[_0x125c('0x3e')](0x1);}},'error':function(_0x387e98,_0x345a37,_0x1e7813,_0x49339e){throw new Error(_0x49339e);}});}function validate(){if(process[_0x125c('0x76')]&&process[_0x125c('0x76')][_0x125c('0x51')]<0x4){throw new Error(_0x125c('0x77'));}var _0x57e69e=path[_0x125c('0x12')](config['root'],'server/files/tmp',process[_0x125c('0x76')][0x2]);if(!fs[_0x125c('0x78')](_0x57e69e)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x33a544={};try{_0x33a544=JSON[_0x125c('0x4f')](process[_0x125c('0x76')][0x3]);if(!_0x33a544[_0x125c('0x4b')]){throw new Error(_0x125c('0x79'));}if(!_0x33a544[_0x125c('0x4b')][_0x125c('0x10')]){throw new Error(_0x125c('0x7a'));}if(!_0x33a544[_0x125c('0x4b')]['firstName']){throw new Error(_0x125c('0x7b'));}var _0x4623fb=0x0;if(_0x33a544[_0x125c('0x4b')][_0x125c('0x58')]){_0x4623fb=0x1;}if(!_0x33a544[_0x125c('0x20')]){throw new Error(_0x125c('0x7c'));}}catch(_0x17acc2){throw new Error(_0x125c('0x7d'));}var _0x25c092=[];try{_0x25c092=_[_0x125c('0x7e')](JSON[_0x125c('0x4f')](process[_0x125c('0x76')][0x4]),'id');}catch(_0x21f4f0){logger[_0x125c('0x43')](_0x125c('0x7f'));}main(_0x57e69e,_0x33a544,_0x25c092,_0x4623fb);}validate();process['on'](_0x125c('0x80'),handleStop);process['on'](_0x125c('0x81'),handleUncaughtException); \ No newline at end of file +var _0x5de4=['\x22onlyIfOpen\x22','cm_contacts.ListId','insert','phone','cm_contacts.phone\x20NOT\x20IN\x20(?)','ListId\x20=\x20?','\x20=\x20?','toString','concat','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','info','Received\x20SIGINT','error','message','exit','errors','sequelize','query','spread','push','catch','main','stringify','.csv','keys','header','writeFileSync','parse','createReadStream','data','length','rows','hasOwnProperty','trim','replace','isNaN','includes','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','\x20not\x20specified','emit','contact:import:','abort','SystemError','step','duplicates','CREATE\x20TABLE\x20','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','each','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','root','server/files/tmp','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','binding','phone\x20is\x20mandatory','firstName','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','util','bluebird','ioredis','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22'];(function(_0x3f25c4,_0x7d5eb5){var _0x2b213d=function(_0x4d0381){while(--_0x4d0381){_0x3f25c4['push'](_0x3f25c4['shift']());}};_0x2b213d(++_0x7d5eb5);}(_0x5de4,0x1cb));var _0x45de=function(_0x5cc11f,_0x3c8903){_0x5cc11f=_0x5cc11f-0x0;var _0xbfaf1e=_0x5de4[_0x5cc11f];return _0xbfaf1e;};'use strict';var fs=require('fs');var path=require(_0x45de('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require(_0x45de('0x1'));var BPromise=require(_0x45de('0x2'));var moment=require('moment');var squel=require('squel');var Redis=require(_0x45de('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x45de('0x4'));var logger=require(_0x45de('0x5'))('import');config[_0x45de('0x6')]=_['defaults'](config['redis'],{'host':_0x45de('0x7'),'port':0x18eb});var socket=require(_0x45de('0x8'))(new Redis(config[_0x45de('0x6')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x45de('0x9')](_0x45de('0xa'));function isEmail(_0xbcd5b6){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))*$/[_0x45de('0xb')](_0xbcd5b6);}function selectNotIn(_0x13e804,_0x3bc251,_0x252917,_0x2d56ca,_0x1c90f3){return squel[_0x45de('0xc')]()[_0x45de('0xd')]('phone')[_0x45de('0xe')](_0x2d56ca)[_0x45de('0xf')](_0x3bc251,null,_0x3bc251+'.id\x20=\x20'+_0x2d56ca+'.'+_0x252917)[_0x45de('0x10')](_0x2d56ca+'.'+_0x252917+_0x45de('0x11')+_0x13e804+'.'+_0x252917)['where'](_0x3bc251+_0x45de('0x12')+_0x1c90f3[_0x45de('0xf')]()+')');}function insertCmHopper(_0x2889ce,_0x268007,_0x13aa66,_0x1fd7ed,_0xad1d72){var _0x28833c=[_0x45de('0x13'),_0x45de('0x14'),_0x45de('0x15'),'cm_contacts.ListId',_0x268007+'.'+_0x1fd7ed,_0x45de('0x16'),_0x45de('0x17'),_0x45de('0x18'),_0x45de('0x19'),'\x22'+_0xad1d72+'\x22'];return squel['insert']()[_0x45de('0x1a')](_0x45de('0x1b'))[_0x45de('0x1c')](['phone',_0x45de('0x1d'),_0x45de('0x1e'),_0x45de('0x1f'),_0x1fd7ed,_0x45de('0x20'),_0x45de('0x21'),_0x45de('0x22'),_0x45de('0x23'),_0x45de('0x24')],squel[_0x45de('0xc')]()[_0x45de('0x25')](_0x28833c)['from'](_0x268007)[_0x45de('0xf')](_0x45de('0x26'),null,_0x45de('0x27')+_0x268007+_0x45de('0x28'))[_0x45de('0xf')](_0x13aa66,null,_0x13aa66+_0x45de('0x29')+_0x268007+'.'+_0x1fd7ed)[_0x45de('0x10')](_0x268007+_0x45de('0x2a'),_0x2889ce)[_0x45de('0x10')](_0x45de('0x2b'),NOW)[_0x45de('0x10')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x268007,_0x13aa66,_0x1fd7ed,_0x45de('0x1b'),[_0x45de('0x2c'),_0x45de('0x2d')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x268007,_0x13aa66,_0x1fd7ed,'cm_hopper',['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x195291,_0x52dd89,_0x236031,_0x3f6097){var _0x3829eb=[_0x45de('0x13'),_0x45de('0x15'),_0x45de('0x2e'),_0x52dd89+'.'+_0x3f6097,_0x45de('0x16'),_0x45de('0x17')];return squel[_0x45de('0x2f')]()['into']('cm_hopper_black')[_0x45de('0x1c')]([_0x45de('0x30'),_0x45de('0x1e'),_0x45de('0x1f'),_0x3f6097,_0x45de('0x20'),_0x45de('0x21')],squel[_0x45de('0xc')]()[_0x45de('0x25')](_0x3829eb)[_0x45de('0xe')](_0x52dd89)[_0x45de('0xf')](_0x45de('0x26'),null,_0x45de('0x27')+_0x52dd89+_0x45de('0x28'))[_0x45de('0xf')](_0x236031,null,_0x236031+_0x45de('0x29')+_0x52dd89+'.'+_0x3f6097)[_0x45de('0x10')](_0x52dd89+_0x45de('0x2a'),_0x195291)[_0x45de('0x10')](_0x45de('0x2b'),NOW)[_0x45de('0x10')](_0x45de('0x31'),squel['select']()[_0x45de('0xd')](_0x45de('0x30'))[_0x45de('0xe')]('cm_hopper_black')['where'](_0x45de('0x32'),_0x195291)[_0x45de('0x10')](_0x3f6097+_0x45de('0x33'),_0x52dd89+'.'+_0x3f6097)))[_0x45de('0x34')]();}function insertCmContact(_0x9624d3,_0x29c7be,_0x21c8c5,_0x5744b6){var _0x480976=_[_0x45de('0x35')](_['keys'](_0x5744b6),['ListId','CompanyId','createdAt',_0x45de('0x21')]);return squel[_0x45de('0x2f')]()['into'](_0x45de('0x26'))[_0x45de('0x1c')](_0x480976,squel['select']()[_0x45de('0x25')](_0x480976)[_0x45de('0xe')](_0x29c7be)[_0x45de('0x10')]('('+_0x21c8c5[_0x45de('0xf')](',')+')\x20NOT\x20IN\x20?',squel['select']()['fields'](_0x21c8c5)[_0x45de('0xe')](_0x45de('0x26'))[_0x45de('0x10')]('ListId\x20=\x20?',_0x9624d3)[_0x45de('0x10')](_0x45de('0x36')))[_0x45de('0x10')](_0x45de('0x37'),squel[_0x45de('0xc')]()[_0x45de('0xd')](_0x45de('0x38'),'min_id')[_0x45de('0xe')](_0x29c7be)['group'](_0x21c8c5[_0x45de('0xf')](','))))['toString']();}function handleStop(){logger[_0x45de('0x39')](_0x45de('0x3a'));stopped=!![];}function handleUncaughtException(_0x13c78b){logger[_0x45de('0x3b')](_0x13c78b[_0x45de('0x3c')]);process[_0x45de('0x3d')](0x1);}function handleError(_0x589473,_0x3c6bdc){stats[_0x45de('0x3e')]['push']({'name':_0x3c6bdc['code'],'message':_0x3c6bdc[_0x45de('0x3c')],'row':_0x589473});}function handleQuery(_0x3e5095){logger['info'](_0x3e5095);return db[_0x45de('0x3f')][_0x45de('0x40')](_0x3e5095)[_0x45de('0x41')](function(_0x1b1b0c){results[_0x45de('0x42')](_0x1b1b0c);})[_0x45de('0x43')](function(_0x21a7d7){logger[_0x45de('0x3b')](_0x21a7d7[_0x45de('0x3c')]);});}function main(_0x2e3bd9,_0x5760cf,_0x1ddde7,_0x3c701e){logger[_0x45de('0x39')](_0x45de('0x44'),_0x2e3bd9,JSON[_0x45de('0x45')](_0x5760cf));process['send']('start');var _0xd8e860=_0x5760cf['binding'];var _0x2bf926=_0x5760cf['socket_timestamp'];var _0x2cfb71=path[_0x45de('0xf')](config['root'],'server/files/tmp',_0x2bf926+_0x45de('0x46'));var _0x452e6e=_[_0x45de('0x47')](_0xd8e860)['join']();logger[_0x45de('0x39')](_0x45de('0x48'),_0x452e6e);fs[_0x45de('0x49')](_0x2cfb71,_0x452e6e+'\x0a');Papa[_0x45de('0x4a')](fs[_0x45de('0x4b')](_0x2e3bd9),{'header':!![],'skipEmptyLines':!![],'step':function(_0x10fae1,_0x38ae65){try{for(var _0x5132d2=0x0,_0x6f4e1f=[];_0x5132d2<_0x10fae1[_0x45de('0x4c')][_0x45de('0x4d')];_0x5132d2++){stats[_0x45de('0x4e')]+=0x1;if(_0x10fae1[_0x45de('0x3e')][_0x5132d2]){handleError(_0x10fae1['data'][_0x5132d2],_0x10fae1[_0x45de('0x3e')][_0x5132d2]);}else{var _0x302a7c=[];for(var _0x34ae33 in _0xd8e860){if(_0xd8e860[_0x45de('0x4f')](_0x34ae33)){if(_0x10fae1[_0x45de('0x4c')][_0x5132d2][_0xd8e860[_0x34ae33]]){var _0x14976d=_[_0x45de('0x50')](_0x10fae1[_0x45de('0x4c')][_0x5132d2][_0xd8e860[_0x34ae33]][_0x45de('0x51')](/"/g,'\x27'));switch(_0x34ae33){case _0x45de('0x1d'):var _0x5e941f=moment(_0x14976d,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x5e941f['isValid']()){_0x6f4e1f['push']('\x22'+_0x14976d+'\x22');}else{_0x302a7c[_0x45de('0x42')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x45de('0x22'):var _0x4abe90=parseInt(_0x14976d);_0x14976d=_[_0x45de('0x52')](_0x4abe90)||_0x4abe90<0x0||_0x4abe90>0x4?_0x3c701e?0x3:0x2:_0x4abe90;_0x6f4e1f[_0x45de('0x42')]('\x22'+_0x14976d+'\x22');break;case'UserId':var _0x460fff=parseInt(_0x14976d);if(_['isNumber'](_0x460fff)&&_[_0x45de('0x53')](_0x1ddde7,_0x460fff)){_0x6f4e1f[_0x45de('0x42')]('\x22'+_0x460fff+'\x22');}else{_0x302a7c[_0x45de('0x42')]('agent\x20not\x20exists');}break;case _0x45de('0x54'):if(isEmail(_0x14976d)){_0x6f4e1f[_0x45de('0x42')]('\x22'+_0x14976d+'\x22');}else{_0x302a7c[_0x45de('0x42')](_0x45de('0x55'));}break;case _0x45de('0x56'):var _0x3df86d=moment(_0x14976d,_0x45de('0x57'),!![]);if(_0x3df86d[_0x45de('0x58')]()){_0x6f4e1f[_0x45de('0x42')]('\x22'+_0x14976d+'\x22');}else{_0x302a7c[_0x45de('0x42')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x6f4e1f[_0x45de('0x42')]('\x22'+_0x14976d+'\x22');}}else{switch(_0x34ae33){case'firstName':case _0x45de('0x30'):_0x302a7c['push'](_0x34ae33+_0x45de('0x59'));break;default:_0x6f4e1f[_0x45de('0x42')]('\x22\x22');}}}}if(_0x302a7c['length']){handleError(_0x10fae1['data'][_0x5132d2],{'code':'SystemRow','message':_0x302a7c[_0x45de('0xf')]()});}else{fs['appendFileSync'](_0x2cfb71,_0x6f4e1f['join']()+'\x0a');}_0x6f4e1f=[];}if(!(stats['rows']%0xc8)){socket[_0x45de('0x5a')](_0x45de('0x5b')+_0x2bf926,stats);stats[_0x45de('0x3e')]=[];}}if(stopped){logger[_0x45de('0x39')]('Abort\x20parser');_0x38ae65[_0x45de('0x5c')]();}}catch(_0x263bd6){handleError(_0x10fae1[_0x45de('0x4c')][_0x5132d2],{'code':_0x45de('0x5d'),'message':_0x263bd6[_0x45de('0x3c')]});logger['error'](_0x45de('0x5e'),_0x263bd6['message']);}},'complete':function(){try{var _0x47b42d=[];var _0x3440b0='cm_contacts';if(_0x5760cf['duplicates']&&_0x5760cf[_0x45de('0x5f')][_0x45de('0x4d')]){_0x3440b0='cm_contacts_'+_0x2bf926;_0x47b42d[_0x45de('0x42')](_0x45de('0x60')+_0x3440b0+'\x20LIKE\x20cm_contacts;');}var _0x58e8c5=util[_0x45de('0x9')](_0x45de('0x61'),_0x2cfb71,_0x3440b0,_0x452e6e,_0x5760cf[_0x45de('0x1f')],_0x5760cf[_0x45de('0x62')]||null,NOW,NOW);if(_[_0x45de('0x63')](_0xd8e860['scheduledat'])){_0x58e8c5+=_0x45de('0x64');}_0x47b42d[_0x45de('0x42')](_0x58e8c5);if(_0x5760cf[_0x45de('0x5f')]&&_0x5760cf['duplicates'][_0x45de('0x4d')]){_0x47b42d[_0x45de('0x42')](insertCmContact(_0x5760cf[_0x45de('0x1f')],_0x3440b0,_0x5760cf[_0x45de('0x5f')],_0xd8e860));_0x47b42d['push'](_0x45de('0x65')+_0x3440b0+';');}_0x47b42d[_0x45de('0x42')](insertCmHopper(_0x5760cf['ListId'],_0x45de('0x66'),_0x45de('0x67'),_0x45de('0x68'),_0x3c701e));_0x47b42d[_0x45de('0x42')](insertCmHopperBlack(_0x5760cf['ListId'],'voice_queues_has_cm_blacklists','voice_queues','VoiceQueueId'));_0x47b42d[_0x45de('0x42')](insertCmHopper(_0x5760cf['ListId'],_0x45de('0x69'),'campaigns',_0x45de('0x6a'),_0x3c701e));_0x47b42d['push'](insertCmHopperBlack(_0x5760cf['ListId'],_0x45de('0x6b'),'campaigns','CampaignId'));BPromise[_0x45de('0x6c')](_0x47b42d,handleQuery)['then'](function(_0x507164){stats['finish']=!![];stats[_0x45de('0x6d')]=_0x5760cf[_0x45de('0x5f')]&&_0x5760cf[_0x45de('0x5f')][_0x45de('0x4d')]?results[0x2][_0x45de('0x6d')]:results[0x0][_0x45de('0x6d')];socket[_0x45de('0x5a')](_0x45de('0x5b')+_0x2bf926,stats);fs[_0x45de('0x6e')](_0x2e3bd9);fs[_0x45de('0x6e')](_0x2cfb71);process['exit'](0x0);})[_0x45de('0x43')](function(_0x2a3e23){logger[_0x45de('0x3b')](_0x2a3e23[_0x45de('0x3c')]);process['exit'](0x1);});}catch(_0x481797){logger['error'](_0x45de('0x6f'),_0x481797[_0x45de('0x3c')]);process[_0x45de('0x3d')](0x1);}},'error':function(_0x5be1f7,_0x2fbf2c,_0x218ab8,_0x14da0a){throw new Error(_0x14da0a);}});}function validate(){if(process[_0x45de('0x70')]&&process[_0x45de('0x70')][_0x45de('0x4d')]<0x4){throw new Error(_0x45de('0x71'));}var _0x3b45b7=path[_0x45de('0xf')](config[_0x45de('0x72')],_0x45de('0x73'),process[_0x45de('0x70')][0x2]);if(!fs['existsSync'](_0x3b45b7)){throw new Error(_0x45de('0x74'));}var _0x4d598d={};try{_0x4d598d=JSON['parse'](process[_0x45de('0x70')][0x3]);if(!_0x4d598d['binding']){throw new Error(_0x45de('0x75'));}if(!_0x4d598d[_0x45de('0x76')][_0x45de('0x30')]){throw new Error(_0x45de('0x77'));}if(!_0x4d598d['binding'][_0x45de('0x78')]){throw new Error('firstName\x20is\x20mandatory');}var _0xdf2839=0x0;if(_0x4d598d[_0x45de('0x76')][_0x45de('0x23')]){_0xdf2839=0x1;}if(!_0x4d598d[_0x45de('0x1f')]){throw new Error(_0x45de('0x79'));}}catch(_0x5ebaa8){throw new Error(_0x45de('0x7a'));}var _0x26e05f=[];try{_0x26e05f=_[_0x45de('0x7b')](JSON[_0x45de('0x4a')](process[_0x45de('0x70')][0x4]),'id');}catch(_0x59abd7){logger[_0x45de('0x39')](_0x45de('0x7c'));}main(_0x3b45b7,_0x4d598d,_0x26e05f,_0xdf2839);}validate();process['on'](_0x45de('0x7d'),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 d672041..7a6d96c 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 _0x955f=['string','toLowerCase','inbound','variable','queue','push','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','voice','***\x20Call\x20Info\x20***','Caller\x20Number','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','UniqueId','uniqueid','agentcalledAt','Agent\x20Name','destcalleridname','Agent\x20Connect','Agent\x20Complete','agentcompleteAt','Hold\x20Time','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','Date','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','billableseconds','getSubjects'];(function(_0x2b2c50,_0x2deb39){var _0x54ad6e=function(_0xaca22e){while(--_0xaca22e){_0x2b2c50['push'](_0x2b2c50['shift']());}};_0x54ad6e(++_0x2deb39);}(_0x955f,0x1eb));var _0xf955=function(_0x150a4c,_0x4b55c7){_0x150a4c=_0x150a4c-0x0;var _0x4268a0=_0x955f[_0x150a4c];return _0x4268a0;};'use strict';exports[_0xf955('0x0')]=function(_0x471baa,_0x438668){var _0x382225=[{'type':_0xf955('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x471baa[_0xf955('0x2')]()){case'voice':switch(_0x438668['toLowerCase']()){case _0xf955('0x3'):_0x382225['push']({'type':_0xf955('0x4'),'content':'','variableName':_0xf955('0x5')});_0x382225[_0xf955('0x6')]({'type':'variable','content':'','variableName':_0xf955('0x7')});break;case _0xf955('0x8'):_0x382225['push']({'type':_0xf955('0x1'),'content':_0xf955('0x9'),'variableName':null});_0x382225[_0xf955('0x6')]({'type':_0xf955('0x4'),'content':'','variableName':_0xf955('0xa')});break;}}return _0x382225;};exports[_0xf955('0xb')]=function(_0x186719,_0x4d213a){var _0xf7e3e=[];switch(_0x186719['toLowerCase']()){case _0xf955('0xc'):switch(_0x4d213a[_0xf955('0x2')]()){case _0xf955('0x3'):_0xf7e3e=[{'type':'string','content':_0xf955('0xd'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xf955('0xe'),'keyType':'variable','variableName':_0xf955('0x7')},{'type':_0xf955('0xf'),'content':'','key':_0xf955('0x10'),'keyType':_0xf955('0x4'),'variableName':_0xf955('0x11')},{'type':_0xf955('0xf'),'content':'','key':_0xf955('0x12'),'keyType':_0xf955('0x4'),'variableName':_0xf955('0x13')},{'type':_0xf955('0xf'),'content':'','key':'Queue','keyType':_0xf955('0x4'),'variableName':'queue'},{'type':_0xf955('0xf'),'content':'','key':_0xf955('0x14'),'keyType':_0xf955('0x4'),'variableName':_0xf955('0x15')},{'type':'keyValue','content':'','key':'Date','keyType':_0xf955('0x4'),'variableName':_0xf955('0x16')},{'type':_0xf955('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xf955('0xf'),'content':'','key':_0xf955('0x17'),'keyType':_0xf955('0x4'),'variableName':_0xf955('0x18')},{'type':_0xf955('0xf'),'content':'','key':'Agent\x20Number','keyType':_0xf955('0x4'),'variableName':_0xf955('0xa')},{'type':_0xf955('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xf955('0xf'),'content':'','key':'Agent\x20Ring','keyType':_0xf955('0x4'),'variableName':_0xf955('0x16')},{'type':_0xf955('0xf'),'content':'','key':_0xf955('0x19'),'keyType':_0xf955('0x4'),'variableName':'agentconnectAt'},{'type':_0xf955('0xf'),'content':'','key':_0xf955('0x1a'),'keyType':_0xf955('0x4'),'variableName':_0xf955('0x1b')},{'type':_0xf955('0xf'),'content':'','key':_0xf955('0x1c'),'keyType':_0xf955('0x4'),'variableName':'holdtime'},{'type':_0xf955('0xf'),'content':'','key':_0xf955('0x1d'),'keyType':_0xf955('0x4'),'variableName':_0xf955('0x1e')}];break;case _0xf955('0x8'):_0xf7e3e=[{'type':_0xf955('0x1'),'content':_0xf955('0xd'),'variableName':null},{'type':'keyValue','content':'','key':_0xf955('0x1f'),'keyType':_0xf955('0x4'),'keyContent':'','variableName':_0xf955('0xa')},{'type':_0xf955('0xf'),'content':'','key':_0xf955('0x20'),'keyType':_0xf955('0x4'),'keyContent':'','variableName':'membername'},{'type':_0xf955('0xf'),'content':'','key':_0xf955('0x14'),'keyType':'variable','keyContent':'','variableName':_0xf955('0x15')},{'type':_0xf955('0xf'),'content':'','key':_0xf955('0x21'),'keyType':_0xf955('0x4'),'keyContent':'','variableName':'starttime'},{'type':_0xf955('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0xf955('0xf'),'content':'','key':_0xf955('0x22'),'keyType':_0xf955('0x4'),'keyContent':'','variableName':_0xf955('0x23')},{'type':_0xf955('0xf'),'content':'','key':_0xf955('0x24'),'keyType':_0xf955('0x4'),'keyContent':'','variableName':_0xf955('0x25')},{'type':'keyValue','content':'','key':_0xf955('0x26'),'keyType':_0xf955('0x4'),'keyContent':'','variableName':_0xf955('0x27')},{'type':_0xf955('0xf'),'content':'','key':'Billable\x20Time','keyType':_0xf955('0x4'),'keyContent':'','variableName':_0xf955('0x28')}];break;}}return _0xf7e3e;}; \ No newline at end of file +var _0x02ce=['toLowerCase','voice','inbound','push','variable','queue','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridnum','Queue','uniqueid','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','outbound','Called\x20Number','Member\x20Name','membername','UniqueId','Date','starttime','***\x20Time\x20Info\x20***','Answer\x20Time','answertime','endtime','Duration','duration','Billable\x20Time','getSubjects','string'];(function(_0x4786a8,_0x280d5f){var _0x3bd704=function(_0x49f8d8){while(--_0x49f8d8){_0x4786a8['push'](_0x4786a8['shift']());}};_0x3bd704(++_0x280d5f);}(_0x02ce,0x1ac));var _0xe02c=function(_0xab3e1d,_0x36b809){_0xab3e1d=_0xab3e1d-0x0;var _0x369dd7=_0x02ce[_0xab3e1d];return _0x369dd7;};'use strict';exports[_0xe02c('0x0')]=function(_0x110909,_0x3f9bc7){var _0x5a49d9=[{'type':_0xe02c('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x110909[_0xe02c('0x2')]()){case _0xe02c('0x3'):switch(_0x3f9bc7[_0xe02c('0x2')]()){case _0xe02c('0x4'):_0x5a49d9[_0xe02c('0x5')]({'type':_0xe02c('0x6'),'content':'','variableName':_0xe02c('0x7')});_0x5a49d9[_0xe02c('0x5')]({'type':_0xe02c('0x6'),'content':'','variableName':'calleridnum'});break;case'outbound':_0x5a49d9[_0xe02c('0x5')]({'type':_0xe02c('0x1'),'content':_0xe02c('0x8'),'variableName':null});_0x5a49d9[_0xe02c('0x5')]({'type':_0xe02c('0x6'),'content':'','variableName':_0xe02c('0x9')});break;}}return _0x5a49d9;};exports[_0xe02c('0xa')]=function(_0x20ea63,_0x17e684){var _0x36c558=[];switch(_0x20ea63[_0xe02c('0x2')]()){case _0xe02c('0x3'):switch(_0x17e684[_0xe02c('0x2')]()){case _0xe02c('0x4'):_0x36c558=[{'type':_0xe02c('0x1'),'content':_0xe02c('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0xe02c('0xc'),'content':'','key':_0xe02c('0xd'),'keyType':'variable','variableName':_0xe02c('0xe')},{'type':'keyValue','content':'','key':'Caller\x20Name','keyType':_0xe02c('0x6'),'variableName':'calleridname'},{'type':_0xe02c('0xc'),'content':'','key':'Call\x20To','keyType':_0xe02c('0x6'),'variableName':'destexten'},{'type':_0xe02c('0xc'),'content':'','key':_0xe02c('0xf'),'keyType':'variable','variableName':_0xe02c('0x7')},{'type':_0xe02c('0xc'),'content':'','key':'UniqueId','keyType':_0xe02c('0x6'),'variableName':_0xe02c('0x10')},{'type':'keyValue','content':'','key':'Date','keyType':_0xe02c('0x6'),'variableName':'agentcalledAt'},{'type':_0xe02c('0x1'),'content':_0xe02c('0x11'),'key':null,'keyType':null,'variableName':null},{'type':_0xe02c('0xc'),'content':'','key':_0xe02c('0x12'),'keyType':_0xe02c('0x6'),'variableName':'destcalleridname'},{'type':_0xe02c('0xc'),'content':'','key':'Agent\x20Number','keyType':'variable','variableName':_0xe02c('0x9')},{'type':_0xe02c('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xe02c('0xc'),'content':'','key':_0xe02c('0x13'),'keyType':'variable','variableName':_0xe02c('0x14')},{'type':_0xe02c('0xc'),'content':'','key':_0xe02c('0x15'),'keyType':_0xe02c('0x6'),'variableName':_0xe02c('0x16')},{'type':_0xe02c('0xc'),'content':'','key':_0xe02c('0x17'),'keyType':_0xe02c('0x6'),'variableName':_0xe02c('0x18')},{'type':_0xe02c('0xc'),'content':'','key':_0xe02c('0x19'),'keyType':'variable','variableName':_0xe02c('0x1a')},{'type':_0xe02c('0xc'),'content':'','key':_0xe02c('0x1b'),'keyType':_0xe02c('0x6'),'variableName':_0xe02c('0x1c')}];break;case _0xe02c('0x1d'):_0x36c558=[{'type':_0xe02c('0x1'),'content':_0xe02c('0xb'),'variableName':null},{'type':'keyValue','content':'','key':_0xe02c('0x1e'),'keyType':_0xe02c('0x6'),'keyContent':'','variableName':_0xe02c('0x9')},{'type':'keyValue','content':'','key':_0xe02c('0x1f'),'keyType':_0xe02c('0x6'),'keyContent':'','variableName':_0xe02c('0x20')},{'type':_0xe02c('0xc'),'content':'','key':_0xe02c('0x21'),'keyType':_0xe02c('0x6'),'keyContent':'','variableName':_0xe02c('0x10')},{'type':_0xe02c('0xc'),'content':'','key':_0xe02c('0x22'),'keyType':_0xe02c('0x6'),'keyContent':'','variableName':_0xe02c('0x23')},{'type':'string','content':_0xe02c('0x24')},{'type':_0xe02c('0xc'),'content':'','key':_0xe02c('0x25'),'keyType':_0xe02c('0x6'),'keyContent':'','variableName':_0xe02c('0x26')},{'type':_0xe02c('0xc'),'content':'','key':'Complete\x20Time','keyType':_0xe02c('0x6'),'keyContent':'','variableName':_0xe02c('0x27')},{'type':'keyValue','content':'','key':_0xe02c('0x28'),'keyType':_0xe02c('0x6'),'keyContent':'','variableName':_0xe02c('0x29')},{'type':_0xe02c('0xc'),'content':'','key':_0xe02c('0x2a'),'keyType':'variable','keyContent':'','variableName':'billableseconds'}];break;}}return _0x36c558;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 4c51635..fc47b03 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 _0x99dd=['fax','mobile','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','findOne','then','catch','error','tracked','user','clone','body','omit','html','phone'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x99dd,0xb1));var _0xd99d=function(_0x268cd2,_0x3f08fc){_0x268cd2=_0x268cd2-0x0;var _0x2480c9=_0x99dd[_0x268cd2];return _0x2480c9;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0xd99d('0x0'))(_0xd99d('0x1')),'mail':require('../../config/logger')('mail-interactions'),'fax':require('../../config/logger')(_0xd99d('0x2')),'sms':require(_0xd99d('0x0'))(_0xd99d('0x3')),'chat':require(_0xd99d('0x0'))('chat-interactions')};function getInteractionId(_0x486dba,_0x4d1716,_0x233a5f){if(_0x486dba&&_0x486dba[_[_0xd99d('0x4')](_0x233a5f)+_0xd99d('0x5')]){return _0x486dba[_[_0xd99d('0x4')](_0x233a5f)+_0xd99d('0x5')];}else if(_0x486dba&&_0x486dba['id']){return _0x486dba['id'];}else if(_0x4d1716&&_0x4d1716['id']){return _0x4d1716['id'];}else{return _0xd99d('0x6');}}function log(_0x2e00f7,_0x39b958,_0x1d30fd,_0x5023be,_0x4ed76e,_0x41aeb5){loggers[_0x4ed76e[_0xd99d('0x7')]()][_0x2e00f7](_0xd99d('0x8'),_0x41aeb5['toUpperCase'](),_0x39b958?_0x39b958['id']:null,_0x39b958?_0x39b958[_0xd99d('0x9')]:null,_0x39b958?_0x39b958[_0xd99d('0xa')]:null,getInteractionId(_0x1d30fd,_0x5023be,_0x4ed76e),_0x1d30fd?JSON[_0xd99d('0xb')](_0x1d30fd):'null');}function updateUser(_0xf78008,_0x3b1f42,_0x2c8338,_0x1b2e66,_0x45c1c0){db[_[_0xd99d('0x4')](_0x1b2e66)+'Interaction'][_0xd99d('0xc')]({'where':{'id':getInteractionId(_0x3b1f42,_0x2c8338,_0x1b2e66)}})[_0xd99d('0xd')](function(_0x19ee48){if(_0x19ee48){return _0x19ee48['update']({'UserId':_0xf78008?_0xf78008['id']:null});}})[_0xd99d('0xd')](function(_0x488a39){if(_0x488a39){log('info',_0xf78008,_0x3b1f42,_0x2c8338,_0x1b2e66,_0x45c1c0);}})[_0xd99d('0xe')](function(){log(_0xd99d('0xf'),_0xf78008,_0x3b1f42,_0x2c8338,_0x1b2e66,_0x45c1c0);});}exports[_0xd99d('0x10')]=function(_0x57c3b5,_0x82147a){return function(_0x4cd54b,_0x2e7bc2,_0x43cca6){var _0x4e24ec=_0x4cd54b[_0xd99d('0x11')];var _0x28d8db={};var _0x401a7b=_0x4cd54b['query'];if(_0x28d8db){_0x28d8db=_[_0xd99d('0x12')](_0x4cd54b[_0xd99d('0x13')]);_0x28d8db=_[_0xd99d('0x14')](_0x28d8db,[_0xd99d('0x13'),_0xd99d('0x15'),_0xd99d('0x16'),_0xd99d('0x17'),_0xd99d('0x18')]);}updateUser(_0x4e24ec,_0x28d8db,_0x401a7b,_0x57c3b5,_0x82147a);_0x43cca6(null);};}; \ No newline at end of file +var _0x51d6=['info','catch','error','tracked','user','query','clone','body','html','phone','fax','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','upperFirst','InteractionId','unknown','toLowerCase','toUpperCase','name','role','stringify','null','Interaction','findOne','then'];(function(_0x59b710,_0x43f64d){var _0x55e5f6=function(_0x3941d5){while(--_0x3941d5){_0x59b710['push'](_0x59b710['shift']());}};_0x55e5f6(++_0x43f64d);}(_0x51d6,0x1cb));var _0x651d=function(_0x265f89,_0x58f4e1){_0x265f89=_0x265f89-0x0;var _0x5a75c3=_0x51d6[_0x265f89];return _0x5a75c3;};'use strict';var _=require(_0x651d('0x0'));var db=require(_0x651d('0x1'))['db'];var loggers={'openchannel':require(_0x651d('0x2'))(_0x651d('0x3')),'mail':require(_0x651d('0x2'))(_0x651d('0x4')),'fax':require('../../config/logger')('fax-interactions'),'sms':require('../../config/logger')('sms-interactions'),'chat':require('../../config/logger')('chat-interactions')};function getInteractionId(_0x56d3b2,_0x595ae0,_0x34a2c4){if(_0x56d3b2&&_0x56d3b2[_[_0x651d('0x5')](_0x34a2c4)+_0x651d('0x6')]){return _0x56d3b2[_[_0x651d('0x5')](_0x34a2c4)+_0x651d('0x6')];}else if(_0x56d3b2&&_0x56d3b2['id']){return _0x56d3b2['id'];}else if(_0x595ae0&&_0x595ae0['id']){return _0x595ae0['id'];}else{return _0x651d('0x7');}}function log(_0x2e5d98,_0x4067ba,_0x92568c,_0x540d00,_0x3b74b1,_0xf1a7f5){loggers[_0x3b74b1[_0x651d('0x8')]()][_0x2e5d98]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xf1a7f5[_0x651d('0x9')](),_0x4067ba?_0x4067ba['id']:null,_0x4067ba?_0x4067ba[_0x651d('0xa')]:null,_0x4067ba?_0x4067ba[_0x651d('0xb')]:null,getInteractionId(_0x92568c,_0x540d00,_0x3b74b1),_0x92568c?JSON[_0x651d('0xc')](_0x92568c):_0x651d('0xd'));}function updateUser(_0x2f30b1,_0x1938a3,_0x2fe92f,_0x382c2f,_0x26f666){db[_[_0x651d('0x5')](_0x382c2f)+_0x651d('0xe')][_0x651d('0xf')]({'where':{'id':getInteractionId(_0x1938a3,_0x2fe92f,_0x382c2f)}})[_0x651d('0x10')](function(_0x4caf5c){if(_0x4caf5c){return _0x4caf5c['update']({'UserId':_0x2f30b1?_0x2f30b1['id']:null});}})['then'](function(_0x2232bf){if(_0x2232bf){log(_0x651d('0x11'),_0x2f30b1,_0x1938a3,_0x2fe92f,_0x382c2f,_0x26f666);}})[_0x651d('0x12')](function(){log(_0x651d('0x13'),_0x2f30b1,_0x1938a3,_0x2fe92f,_0x382c2f,_0x26f666);});}exports[_0x651d('0x14')]=function(_0x2c6304,_0x1c2125){return function(_0xbd4baa,_0x286caf,_0xd8fd62){var _0x5a1167=_0xbd4baa[_0x651d('0x15')];var _0x5bc508={};var _0x1ab345=_0xbd4baa[_0x651d('0x16')];if(_0x5bc508){_0x5bc508=_[_0x651d('0x17')](_0xbd4baa[_0x651d('0x18')]);_0x5bc508=_['omit'](_0x5bc508,[_0x651d('0x18'),_0x651d('0x19'),_0x651d('0x1a'),_0x651d('0x1b'),'mobile']);}updateUser(_0x5a1167,_0x5bc508,_0x1ab345,_0x2c6304,_0x1c2125);_0xd8fd62(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 45bda84..949815f 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 _0xadfa=['catch','user','isUserLimit','crypto','util','composable-middleware','../../config/environment','data1','license','split','createDecipher','format','%s:%s:%s','update','base64','utf8','final','hasOwnProperty','use','License','findOne','then','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0xecf76f,_0xad107c){var _0x5700d2=function(_0x37d3e3){while(--_0x37d3e3){_0xecf76f['push'](_0xecf76f['shift']());}};_0x5700d2(++_0xad107c);}(_0xadfa,0x10b));var _0xaadf=function(_0x102480,_0x2d137d){_0x102480=_0x102480-0x0;var _0x3daa4d=_0xadfa[_0x102480];return _0x3daa4d;};'use strict';var crypto=require(_0xaadf('0x0'));var util=require(_0xaadf('0x1'));var compose=require(_0xaadf('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0xaadf('0x3'));function getValueFromLicense(_0xd12a91,_0x437aaa){if(_0xd12a91&&_0x437aaa){if(_0x437aaa[_0xaadf('0x4')]&&_0x437aaa[_0xaadf('0x5')]){var _0x3ebdca=_0x437aaa[_0xaadf('0x4')];var _0x2cefac=_0x437aaa['license'];var _0x3b6430=_0x3ebdca[_0xaadf('0x6')]('-')[0x4];var _0x207cd7=_0x3ebdca[_0xaadf('0x6')]('-')[0x0];var _0xfe2b87=crypto[_0xaadf('0x7')]('aes-256-ctr',util[_0xaadf('0x8')](_0xaadf('0x9'),_0x3b6430,_0x3ebdca,_0x207cd7));var _0xca2f7f=_0xfe2b87[_0xaadf('0xa')](_0x2cefac,_0xaadf('0xb'),_0xaadf('0xc'));_0xca2f7f+=_0xfe2b87[_0xaadf('0xd')](_0xaadf('0xc'));var _0x23b4c3=JSON['parse'](_0xca2f7f);return _0x23b4c3[_0xaadf('0xe')](_0xd12a91)?_0x23b4c3[_0xd12a91]:null;}}return null;}function isLimit(_0x23ebad,_0x4f2cd5,_0x19d5e9,_0x1448a5){var _0x292642=_0x4f2cd5;return compose()[_0xaadf('0xf')](function(_0x46d324,_0x4e22d1,_0x1e940b){return db[_0xaadf('0x10')][_0xaadf('0x11')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x534b6d){var _0x2f9210=getValueFromLicense(_0x23ebad,_0x534b6d);return _0x2f9210?_0x2f9210:_0x292642;})[_0xaadf('0x12')](function(_0x23ab58){_0x292642=_0x23ab58;return _0x19d5e9['count'](_0x1448a5);})[_0xaadf('0x12')](function(_0x17fd4b){if(_0x17fd4b>=_0x292642){return _0x4e22d1['status'](0x193)[_0xaadf('0x13')]({'message':util['format'](_0xaadf('0x14'),_0x23ebad)});}_0x1e940b();})[_0xaadf('0x15')](function(_0x3e5fc6){_0x1e940b(_0x3e5fc6);});});}function isUserLimit(){return isLimit('users',0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':_0xaadf('0x16')}]}});}exports[_0xaadf('0x17')]=isUserLimit; \ No newline at end of file +var _0x28fb=['json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','update','base64','utf8','final','hasOwnProperty','License','findOne','then','count','status'];(function(_0x10275b,_0x89c49a){var _0x5577e3=function(_0x590d18){while(--_0x590d18){_0x10275b['push'](_0x10275b['shift']());}};_0x5577e3(++_0x89c49a);}(_0x28fb,0x1ab));var _0xb28f=function(_0x24e0c9,_0x284109){_0x24e0c9=_0x24e0c9-0x0;var _0x4448f0=_0x28fb[_0x24e0c9];return _0x4448f0;};'use strict';var crypto=require(_0xb28f('0x0'));var util=require(_0xb28f('0x1'));var compose=require(_0xb28f('0x2'));var db=require(_0xb28f('0x3'))['db'];var config=require(_0xb28f('0x4'));function getValueFromLicense(_0x2f4010,_0x4b5358){if(_0x2f4010&&_0x4b5358){if(_0x4b5358[_0xb28f('0x5')]&&_0x4b5358[_0xb28f('0x6')]){var _0xac6436=_0x4b5358[_0xb28f('0x5')];var _0x249f80=_0x4b5358[_0xb28f('0x6')];var _0x524ac7=_0xac6436[_0xb28f('0x7')]('-')[0x4];var _0x27432a=_0xac6436[_0xb28f('0x7')]('-')[0x0];var _0x2fdef8=crypto[_0xb28f('0x8')](_0xb28f('0x9'),util[_0xb28f('0xa')]('%s:%s:%s',_0x524ac7,_0xac6436,_0x27432a));var _0xe68e72=_0x2fdef8[_0xb28f('0xb')](_0x249f80,_0xb28f('0xc'),_0xb28f('0xd'));_0xe68e72+=_0x2fdef8[_0xb28f('0xe')]('utf8');var _0x35c4ca=JSON['parse'](_0xe68e72);return _0x35c4ca[_0xb28f('0xf')](_0x2f4010)?_0x35c4ca[_0x2f4010]:null;}}return null;}function isLimit(_0x30e48c,_0x25249c,_0xb8b7ff,_0x372c00){var _0x39a763=_0x25249c;return compose()['use'](function(_0x55b2d6,_0x558c97,_0x20191f){return db[_0xb28f('0x10')][_0xb28f('0x11')]({'where':{'id':0x1},'raw':!![]})[_0xb28f('0x12')](function(_0x2e37cc){var _0x29d5e3=getValueFromLicense(_0x30e48c,_0x2e37cc);return _0x29d5e3?_0x29d5e3:_0x39a763;})['then'](function(_0x5e1a3f){_0x39a763=_0x5e1a3f;return _0xb8b7ff[_0xb28f('0x13')](_0x372c00);})[_0xb28f('0x12')](function(_0x187234){if(_0x187234>=_0x39a763){return _0x558c97[_0xb28f('0x14')](0x193)[_0xb28f('0x15')]({'message':util[_0xb28f('0xa')](_0xb28f('0x16'),_0x30e48c)});}_0x20191f();})[_0xb28f('0x17')](function(_0x28e4e8){_0x20191f(_0x28e4e8);});});}function isUserLimit(){return isLimit(_0xb28f('0x18'),0x1,db['User'],{'where':{'$or':[{'role':_0xb28f('0x19')},{'role':_0xb28f('0x1a')}]}});}exports[_0xb28f('0x1b')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 2bfc265..c2a67ab 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 _0x26d2=['castTo','text','field','\x20AS\x20','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$ne','<>\x20?','$substring','$startsWith','LIKE\x20?','$lt','<\x20?','$gt','$gte','BETWEEN\x20?\x20AND\x20?','start','$endsWith','pop','utcOffset','hours','seconds','lodash','startsWith','[$or]','replace','[$and]','split','length','shift','forEach','filter','map','conditions','push','DATE','operator','$eq','$between','includes','$lte','value','add','days','format','YYYY-MM-DD'];(function(_0x216a5f,_0x41d4f7){var _0x4919e2=function(_0x299f23){while(--_0x299f23){_0x216a5f['push'](_0x216a5f['shift']());}};_0x4919e2(++_0x41d4f7);}(_0x26d2,0x11a));var _0x226d=function(_0x136619,_0x31c9b2){_0x136619=_0x136619-0x0;var _0x38c4a5=_0x26d2[_0x136619];return _0x38c4a5;};'use strict';var _=require(_0x226d('0x0'));var moment=require('moment');exports['parseSearch']=function(_0x1e520d){var _0x456ad5={'conditions':[]};_0x456ad5['sqlOperator']=_[_0x226d('0x1')](_0x1e520d,_0x226d('0x2'))?'or':'and';var _0x2c6904=_0x1e520d[_0x226d('0x3')](_0x226d('0x4'),'')[_0x226d('0x3')](_0x226d('0x2'),'')[_0x226d('0x5')]('||');for(var _0xa984dc=0x0;_0xa984dc<_0x2c6904[_0x226d('0x6')];_0xa984dc++){var _0x3a9aef=_0x2c6904[_0xa984dc]['split'](':=');var _0x5afb06=_0x3a9aef[0x0];var _0x267a47=_0x3a9aef['slice'](0x1);_0x267a47['forEach'](function(_0x39be02){var _0x382a23=_0x39be02[_0x226d('0x5')]('[')[_0x226d('0x7')]();var _0x49cdaf=_0x39be02['match'](/\[(.*?)\]/g);_0x49cdaf[_0x226d('0x8')](function(_0x5f6a8f){var _0x11a15e=_0x5f6a8f['split']('[')[_0x226d('0x9')](function(_0x408561){return _0x408561['indexOf'](']')>-0x1;})[_0x226d('0xa')](function(_0x396621){return _0x396621['split'](']')[0x0];})[0x0];_0x456ad5[_0x226d('0xb')][_0x226d('0xc')]({'field':_0x5afb06,'operator':_0x382a23,'value':_0x11a15e});});});}return _0x456ad5;};exports['buildExpression']=function(_0x103c45,_0x56db6d,_0x2f898c){var _0x36be5d={};if(_0x56db6d===_0x226d('0xd')){if(_0x2f898c[_0x226d('0xe')]===_0x226d('0xf')){_0x2f898c['operator']=_0x226d('0x10');_0x2f898c['value']+=','+_0x2f898c['value'];}else if(_[_0x226d('0x11')](['$gt',_0x226d('0x12')],_0x2f898c[_0x226d('0xe')])){_0x2f898c['value']=moment(_0x2f898c[_0x226d('0x13')])[_0x226d('0x14')](0x1,_0x226d('0x15'))[_0x226d('0x16')](_0x226d('0x17'));}}if(_0x2f898c['castTo']){_0x56db6d=_0x2f898c[_0x226d('0x18')];_0x36be5d[_0x226d('0x19')]='CAST('+_0x103c45+'.'+_0x2f898c[_0x226d('0x1a')]+_0x226d('0x1b')+_0x2f898c[_0x226d('0x18')]+')\x20'+parseOperator(_0x2f898c['operator']);}else{_0x36be5d[_0x226d('0x19')]=_0x103c45+'.'+_0x2f898c[_0x226d('0x1a')]+'\x20'+parseOperator(_0x2f898c[_0x226d('0xe')]);}if(_['includes'](['$ne',_0x226d('0x1c')],_0x2f898c[_0x226d('0xe')]))_0x36be5d['text']='('+_0x36be5d[_0x226d('0x19')]+_0x226d('0x1d')+_0x103c45+'.'+_0x2f898c[_0x226d('0x1a')]+_0x226d('0x1e');_0x36be5d[_0x226d('0x13')]=parseValue(_0x56db6d,_0x2f898c[_0x226d('0xe')],_0x2f898c[_0x226d('0x13')]);return _0x36be5d;};function parseOperator(_0x86ae7e){var _0x4c235f;switch(_0x86ae7e){case _0x226d('0x1f'):_0x4c235f=_0x226d('0x20');break;case _0x226d('0x1c'):_0x4c235f=_0x226d('0x21');break;case'$eq':_0x4c235f=_0x226d('0x22');break;case _0x226d('0x23'):_0x4c235f=_0x226d('0x24');break;case _0x226d('0x25'):case _0x226d('0x26'):case'$endsWith':_0x4c235f=_0x226d('0x27');break;case _0x226d('0x28'):_0x4c235f=_0x226d('0x29');break;case _0x226d('0x2a'):_0x4c235f='>\x20?';break;case _0x226d('0x12'):_0x4c235f='<=\x20?';break;case _0x226d('0x2b'):_0x4c235f='>=\x20?';break;case'$between':_0x4c235f=_0x226d('0x2c');break;}return _0x4c235f;}function parseValue(_0x2d674a,_0x351d60,_0x19a14e){var _0x4c92b4={'start':undefined,'end':undefined};switch(_0x351d60){case _0x226d('0x1f'):case'$notIn':_0x4c92b4['start']=_0x19a14e['split'](',');break;case'$substring':_0x4c92b4['start']='%'+_0x19a14e+'%';break;case _0x226d('0x26'):_0x4c92b4[_0x226d('0x2d')]=_0x19a14e+'%';break;case _0x226d('0x2e'):_0x4c92b4[_0x226d('0x2d')]='%'+_0x19a14e;break;case _0x226d('0x10'):var _0xdf6a37=_0x19a14e[_0x226d('0x5')](',');var _0x19a14e=_0xdf6a37[_0x226d('0x7')]();var _0xcb43b6=_0xdf6a37[_0x226d('0x2f')]();if(_0x2d674a===_0x226d('0xd')){_0x19a14e=moment(_0x19a14e)[_0x226d('0x30')](0x0,!![])[_0x226d('0x16')]();_0xcb43b6=moment(_0xcb43b6)[_0x226d('0x30')](0x0,!![])['add'](0x17,_0x226d('0x31'))['add'](0x3b,'minutes')[_0x226d('0x14')](0x3b,_0x226d('0x32'))[_0x226d('0x16')]();}_0x4c92b4={'start':_0x19a14e,'end':_0xcb43b6};break;default:_0x4c92b4[_0x226d('0x2d')]=_0x19a14e;break;}return _0x4c92b4;} \ No newline at end of file +var _0xcef4=['field','\x20AS\x20','$notIn','\x20IS\x20NULL)','$in','=\x20?','$ne','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','add','hours','minutes','seconds','lodash','sqlOperator','[$or]','and','replace','[$and]','split','length','slice','forEach','shift','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','$lte','format','YYYY-MM-DD','castTo','text','CAST('];(function(_0x46266b,_0x29c9a4){var _0x1f08d6=function(_0x39760d){while(--_0x39760d){_0x46266b['push'](_0x46266b['shift']());}};_0x1f08d6(++_0x29c9a4);}(_0xcef4,0xb3));var _0x4cef=function(_0xc55d64,_0x133f2d){_0xc55d64=_0xc55d64-0x0;var _0x4194f6=_0xcef4[_0xc55d64];return _0x4194f6;};'use strict';var _=require(_0x4cef('0x0'));var moment=require('moment');exports['parseSearch']=function(_0x1f4af3){var _0x1ee84d={'conditions':[]};_0x1ee84d[_0x4cef('0x1')]=_['startsWith'](_0x1f4af3,_0x4cef('0x2'))?'or':_0x4cef('0x3');var _0x285280=_0x1f4af3[_0x4cef('0x4')](_0x4cef('0x5'),'')['replace'](_0x4cef('0x2'),'')[_0x4cef('0x6')]('||');for(var _0x2d150b=0x0;_0x2d150b<_0x285280[_0x4cef('0x7')];_0x2d150b++){var _0xd01533=_0x285280[_0x2d150b][_0x4cef('0x6')](':=');var _0x4343fd=_0xd01533[0x0];var _0x216053=_0xd01533[_0x4cef('0x8')](0x1);_0x216053[_0x4cef('0x9')](function(_0x46f8da){var _0x24b1c0=_0x46f8da[_0x4cef('0x6')]('[')[_0x4cef('0xa')]();var _0x53acec=_0x46f8da['match'](/\[(.*?)\]/g);_0x53acec['forEach'](function(_0x361796){var _0x4061d5=_0x361796[_0x4cef('0x6')]('[')['filter'](function(_0x3ed473){return _0x3ed473[_0x4cef('0xb')](']')>-0x1;})[_0x4cef('0xc')](function(_0x3a9fc1){return _0x3a9fc1[_0x4cef('0x6')](']')[0x0];})[0x0];_0x1ee84d[_0x4cef('0xd')][_0x4cef('0xe')]({'field':_0x4343fd,'operator':_0x24b1c0,'value':_0x4061d5});});});}return _0x1ee84d;};exports[_0x4cef('0xf')]=function(_0x3eaf94,_0x149a9d,_0x3745c0){var _0x11b84f={};if(_0x149a9d===_0x4cef('0x10')){if(_0x3745c0[_0x4cef('0x11')]===_0x4cef('0x12')){_0x3745c0['operator']=_0x4cef('0x13');_0x3745c0[_0x4cef('0x14')]+=','+_0x3745c0[_0x4cef('0x14')];}else if(_[_0x4cef('0x15')]([_0x4cef('0x16'),_0x4cef('0x17')],_0x3745c0[_0x4cef('0x11')])){_0x3745c0[_0x4cef('0x14')]=moment(_0x3745c0['value'])['add'](0x1,'days')[_0x4cef('0x18')](_0x4cef('0x19'));}}if(_0x3745c0[_0x4cef('0x1a')]){_0x149a9d=_0x3745c0[_0x4cef('0x1a')];_0x11b84f[_0x4cef('0x1b')]=_0x4cef('0x1c')+_0x3eaf94+'.'+_0x3745c0[_0x4cef('0x1d')]+_0x4cef('0x1e')+_0x3745c0[_0x4cef('0x1a')]+')\x20'+parseOperator(_0x3745c0[_0x4cef('0x11')]);}else{_0x11b84f[_0x4cef('0x1b')]=_0x3eaf94+'.'+_0x3745c0[_0x4cef('0x1d')]+'\x20'+parseOperator(_0x3745c0['operator']);}if(_[_0x4cef('0x15')](['$ne',_0x4cef('0x1f')],_0x3745c0['operator']))_0x11b84f[_0x4cef('0x1b')]='('+_0x11b84f[_0x4cef('0x1b')]+'\x20OR\x20'+_0x3eaf94+'.'+_0x3745c0[_0x4cef('0x1d')]+_0x4cef('0x20');_0x11b84f[_0x4cef('0x14')]=parseValue(_0x149a9d,_0x3745c0[_0x4cef('0x11')],_0x3745c0[_0x4cef('0x14')]);return _0x11b84f;};function parseOperator(_0x1f7e49){var _0x452365;switch(_0x1f7e49){case _0x4cef('0x21'):_0x452365='IN\x20?';break;case _0x4cef('0x1f'):_0x452365='NOT\x20IN\x20?';break;case _0x4cef('0x12'):_0x452365=_0x4cef('0x22');break;case _0x4cef('0x23'):_0x452365=_0x4cef('0x24');break;case _0x4cef('0x25'):case _0x4cef('0x26'):case _0x4cef('0x27'):_0x452365=_0x4cef('0x28');break;case _0x4cef('0x29'):_0x452365=_0x4cef('0x2a');break;case _0x4cef('0x16'):_0x452365=_0x4cef('0x2b');break;case'$lte':_0x452365='<=\x20?';break;case'$gte':_0x452365='>=\x20?';break;case _0x4cef('0x13'):_0x452365=_0x4cef('0x2c');break;}return _0x452365;}function parseValue(_0x675b20,_0x2778e6,_0x38872e){var _0x5f0651={'start':undefined,'end':undefined};switch(_0x2778e6){case'$in':case _0x4cef('0x1f'):_0x5f0651['start']=_0x38872e['split'](',');break;case _0x4cef('0x25'):_0x5f0651['start']='%'+_0x38872e+'%';break;case _0x4cef('0x26'):_0x5f0651[_0x4cef('0x2d')]=_0x38872e+'%';break;case _0x4cef('0x27'):_0x5f0651[_0x4cef('0x2d')]='%'+_0x38872e;break;case _0x4cef('0x13'):var _0x95a856=_0x38872e['split'](',');var _0x38872e=_0x95a856[_0x4cef('0xa')]();var _0x35c5b5=_0x95a856[_0x4cef('0x2e')]();if(_0x675b20===_0x4cef('0x10')){_0x38872e=moment(_0x38872e)[_0x4cef('0x2f')](0x0,!![])[_0x4cef('0x18')]();_0x35c5b5=moment(_0x35c5b5)[_0x4cef('0x2f')](0x0,!![])[_0x4cef('0x30')](0x17,_0x4cef('0x31'))[_0x4cef('0x30')](0x3b,_0x4cef('0x32'))[_0x4cef('0x30')](0x3b,_0x4cef('0x33'))[_0x4cef('0x18')]();}_0x5f0651={'start':_0x38872e,'end':_0x35c5b5};break;default:_0x5f0651[_0x4cef('0x2d')]=_0x38872e;break;}return _0x5f0651;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 78faba1..5c6ddba 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 _0x977c=['filters','isEmpty','forOwn','parse','split','limit','sort','map','indexOf','priority','cast','col','unsigned','DESC','ASC','omit','isArray','length','isObject','isString','hasOwnProperty','isNumeric','match','^[0-9]*$','isEmail','getFullTextValue','forEach','push','toString','join','lodash','fields'];(function(_0x223c5f,_0x3e83fc){var _0x5694ba=function(_0x3d6784){while(--_0x3d6784){_0x223c5f['push'](_0x223c5f['shift']());}};_0x5694ba(++_0x3e83fc);}(_0x977c,0xfe));var _0xc977=function(_0x41f029,_0x10c199){_0x41f029=_0x41f029-0x0;var _0x40b9c3=_0x977c[_0x41f029];return _0x40b9c3;};'use strict';var _=require(_0xc977('0x0'));var sequelize=require('sequelize');var LIMIT_VALUE=0xfa;exports[_0xc977('0x1')]=function(_0x23ed85){var _0x388968=null;if(_0x23ed85){_0x388968=_0x23ed85['split'](',');}return _0x388968;};exports[_0xc977('0x2')]=function(_0x270e82){var _0x34f3a3={};if(!_[_0xc977('0x3')](_0x270e82)){_0x34f3a3={};_[_0xc977('0x4')](_0x270e82,function(_0x1af1dd,_0x161f0e){try{_0x34f3a3[_0x161f0e]=_['isArray'](_0x1af1dd)?_0x1af1dd:JSON[_0xc977('0x5')](_0x1af1dd);}catch(_0x2a98a3){_0x34f3a3[_0x161f0e]=_0x1af1dd[_0xc977('0x6')](',');}});}return _0x34f3a3;};exports[_0xc977('0x7')]=function(_0x1d564d){_0x1d564d=parseInt(_0x1d564d,0xa);if(!_0x1d564d||_0x1d564d<0x0){_0x1d564d=LIMIT_VALUE;}return _0x1d564d;};exports['offset']=function(_0x330ef5){_0x330ef5=parseInt(_0x330ef5,0xa);if(!_0x330ef5||_0x330ef5<0x0){_0x330ef5=0x0;}return _0x330ef5;};exports[_0xc977('0x8')]=function(_0x4694e9){var _0x3a8674,_0x1f1e03=null;if(_0x4694e9){_0x3a8674=_0x4694e9[_0xc977('0x6')](',');_0x1f1e03=_[_0xc977('0x9')](_0x3a8674,function(_0x20eeef){if(_0x20eeef[_0xc977('0xa')]('-')===0x0){return[_0x20eeef===_0xc977('0xb')?sequelize[_0xc977('0xc')](sequelize[_0xc977('0xd')](_0xc977('0xb')),_0xc977('0xe')):_0x20eeef['substr'](0x1),_0xc977('0xf')];}else{return[_0x20eeef===_0xc977('0xb')?sequelize[_0xc977('0xc')](sequelize[_0xc977('0xd')](_0xc977('0xb')),_0xc977('0xe')):_0x20eeef,_0xc977('0x10')];}});}return _0x1f1e03;};exports[_0xc977('0x11')]=function(_0x568dc3,_0x2b28e9){if(_[_0xc977('0x3')](_0x568dc3)){return _0x568dc3;}if(_[_0xc977('0x12')](_0x568dc3)){for(var _0x3b0d77=0x0;_0x3b0d77<_0x568dc3[_0xc977('0x13')];_0x3b0d77+=0x1){_0x568dc3[_0x3b0d77]=this[_0xc977('0x11')](_0x568dc3[_0x3b0d77],_0x2b28e9);}return _0x568dc3;}if(!_[_0xc977('0x14')](_0x568dc3)){return _0x568dc3;}if(_[_0xc977('0x15')](_0x2b28e9)){_0x2b28e9=[_0x2b28e9];}if(!_['isArray'](_0x2b28e9)){return _0x568dc3;}for(var _0x133cc2=0x0;_0x133cc2<_0x2b28e9[_0xc977('0x13')];_0x133cc2+=0x1){_['unset'](_0x568dc3,_0x2b28e9[_0x133cc2]);}for(var _0x133059 in _0x568dc3){if(_0x568dc3[_0xc977('0x16')](_0x133059)){_0x568dc3[_0x133059]=this[_0xc977('0x11')](_0x568dc3[_0x133059],_0x2b28e9);}}return _0x568dc3;};exports[_0xc977('0x17')]=function(_0x45e40b){return _0x45e40b[_0xc977('0x18')](RegExp(_0xc977('0x19')))?!![]:![];};exports[_0xc977('0x1a')]=function(_0x258820){return _0x258820[_0xc977('0x18')](/^\S+@\S+$/)?!![]:![];};exports[_0xc977('0x1b')]=function(_0x156cec){var _0x396849=[];_0x156cec[_0xc977('0x6')]('\x20')[_0xc977('0x1c')](function(_0x130dca){_0x396849[_0xc977('0x1d')]('+'+_0x130dca[_0xc977('0x1e')]()+'*');});return _0x396849[_0xc977('0x1f')]('\x20');}; \ No newline at end of file +var _0xf35f=['getFullTextValue','forEach','join','lodash','sequelize','split','filters','isEmpty','forOwn','isArray','parse','offset','sort','map','cast','col','priority','substr','unsigned','omit','isObject','length','hasOwnProperty','isNumeric','^[0-9]*$','isEmail','match'];(function(_0x1080dc,_0x4de2a6){var _0x22ac59=function(_0x55b0cf){while(--_0x55b0cf){_0x1080dc['push'](_0x1080dc['shift']());}};_0x22ac59(++_0x4de2a6);}(_0xf35f,0x147));var _0xff35=function(_0x104116,_0x618e32){_0x104116=_0x104116-0x0;var _0x357573=_0xf35f[_0x104116];return _0x357573;};'use strict';var _=require(_0xff35('0x0'));var sequelize=require(_0xff35('0x1'));var LIMIT_VALUE=0xfa;exports['fields']=function(_0x123286){var _0x5888d5=null;if(_0x123286){_0x5888d5=_0x123286[_0xff35('0x2')](',');}return _0x5888d5;};exports[_0xff35('0x3')]=function(_0x32722b){var _0x23bb09={};if(!_[_0xff35('0x4')](_0x32722b)){_0x23bb09={};_[_0xff35('0x5')](_0x32722b,function(_0x5a2245,_0x41112e){try{_0x23bb09[_0x41112e]=_[_0xff35('0x6')](_0x5a2245)?_0x5a2245:JSON[_0xff35('0x7')](_0x5a2245);}catch(_0xd4bd66){_0x23bb09[_0x41112e]=_0x5a2245[_0xff35('0x2')](',');}});}return _0x23bb09;};exports['limit']=function(_0x4c33f9){_0x4c33f9=parseInt(_0x4c33f9,0xa);if(!_0x4c33f9||_0x4c33f9<0x0){_0x4c33f9=LIMIT_VALUE;}return _0x4c33f9;};exports[_0xff35('0x8')]=function(_0x458e55){_0x458e55=parseInt(_0x458e55,0xa);if(!_0x458e55||_0x458e55<0x0){_0x458e55=0x0;}return _0x458e55;};exports[_0xff35('0x9')]=function(_0x47f9d2){var _0x43e26a,_0x5bc5b4=null;if(_0x47f9d2){_0x43e26a=_0x47f9d2[_0xff35('0x2')](',');_0x5bc5b4=_[_0xff35('0xa')](_0x43e26a,function(_0x4c1796){if(_0x4c1796['indexOf']('-')===0x0){return[_0x4c1796==='priority'?sequelize[_0xff35('0xb')](sequelize[_0xff35('0xc')](_0xff35('0xd')),'unsigned'):_0x4c1796[_0xff35('0xe')](0x1),'DESC'];}else{return[_0x4c1796===_0xff35('0xd')?sequelize['cast'](sequelize[_0xff35('0xc')](_0xff35('0xd')),_0xff35('0xf')):_0x4c1796,'ASC'];}});}return _0x5bc5b4;};exports[_0xff35('0x10')]=function(_0x2a55fe,_0x8c6bd5){if(_[_0xff35('0x4')](_0x2a55fe)){return _0x2a55fe;}if(_['isArray'](_0x2a55fe)){for(var _0x3c0658=0x0;_0x3c0658<_0x2a55fe['length'];_0x3c0658+=0x1){_0x2a55fe[_0x3c0658]=this[_0xff35('0x10')](_0x2a55fe[_0x3c0658],_0x8c6bd5);}return _0x2a55fe;}if(!_[_0xff35('0x11')](_0x2a55fe)){return _0x2a55fe;}if(_['isString'](_0x8c6bd5)){_0x8c6bd5=[_0x8c6bd5];}if(!_['isArray'](_0x8c6bd5)){return _0x2a55fe;}for(var _0x38a89b=0x0;_0x38a89b<_0x8c6bd5[_0xff35('0x12')];_0x38a89b+=0x1){_['unset'](_0x2a55fe,_0x8c6bd5[_0x38a89b]);}for(var _0x24d06f in _0x2a55fe){if(_0x2a55fe[_0xff35('0x13')](_0x24d06f)){_0x2a55fe[_0x24d06f]=this['omit'](_0x2a55fe[_0x24d06f],_0x8c6bd5);}}return _0x2a55fe;};exports[_0xff35('0x14')]=function(_0x45f55e){return _0x45f55e['match'](RegExp(_0xff35('0x15')))?!![]:![];};exports[_0xff35('0x16')]=function(_0xb1caff){return _0xb1caff[_0xff35('0x17')](/^\S+@\S+$/)?!![]:![];};exports[_0xff35('0x18')]=function(_0x82791d){var _0x598ec0=[];_0x82791d[_0xff35('0x2')]('\x20')[_0xff35('0x19')](function(_0x24d14c){_0x598ec0['push']('+'+_0x24d14c['toString']()+'*');});return _0x598ec0[_0xff35('0x1a')]('\x20');}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index dea7400..f47e5db 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa909=['html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','express','serve-favicon','body-parser','method-override','cookie-parser','path','cors','moment','../mysqldb','env','production','set','appPath','join','root','public','development','test','client','use','json\x20replacer','static','get','/server/views','engine'];(function(_0x62b58e,_0x46fe1e){var _0x37fe84=function(_0x12a2ca){while(--_0x12a2ca){_0x62b58e['push'](_0x62b58e['shift']());}};_0x37fe84(++_0x46fe1e);}(_0xa909,0x107));var _0x9a90=function(_0x5e267d,_0x4d84e1){_0x5e267d=_0x5e267d-0x0;var _0x154dd2=_0xa909[_0x5e267d];return _0x154dd2;};'use strict';var express=require(_0x9a90('0x0'));var favicon=require(_0x9a90('0x1'));var bodyParser=require(_0x9a90('0x2'));var methodOverride=require(_0x9a90('0x3'));var cookieParser=require(_0x9a90('0x4'));var errorHandler=require('errorhandler');var path=require(_0x9a90('0x5'));var passport=require('passport');var cors=require(_0x9a90('0x6'));var moment=require(_0x9a90('0x7'));var config=require('./environment');var db=require(_0x9a90('0x8'))['db'];exports['default']=function(_0xa669f4){var _0x15c033=_0xa669f4['get'](_0x9a90('0x9'));if(_0x15c033===_0x9a90('0xa')){_0xa669f4[_0x9a90('0xb')](_0x9a90('0xc'),path[_0x9a90('0xd')](config[_0x9a90('0xe')],_0x9a90('0xf')));}if(_0x15c033===_0x9a90('0x10')||_0x15c033===_0x9a90('0x11')){_0xa669f4['set']('appPath',path[_0x9a90('0xd')](config['root'],_0x9a90('0x12')));_0xa669f4[_0x9a90('0x13')](errorHandler());}_0xa669f4[_0x9a90('0xb')](_0x9a90('0x14'),function(_0x202aa8,_0x1d8c45){if(this[_0x202aa8]instanceof Date){_0x1d8c45=this[_0x202aa8]['toISOString']()['split']('.')[0x0]+'Z';}return _0x1d8c45;});_0xa669f4[_0x9a90('0x13')](express[_0x9a90('0x15')](_0xa669f4[_0x9a90('0x16')](_0x9a90('0xc'))));_0xa669f4[_0x9a90('0xb')]('views',config[_0x9a90('0xe')]+_0x9a90('0x17'));_0xa669f4[_0x9a90('0x18')](_0x9a90('0x19'),require(_0x9a90('0x1a'))[_0x9a90('0x1b')]);_0xa669f4[_0x9a90('0xb')](_0x9a90('0x1c'),_0x9a90('0x19'));_0xa669f4['use'](bodyParser[_0x9a90('0x1d')]({'limit':_0x9a90('0x1e'),'extended':!![]}));_0xa669f4['use'](bodyParser[_0x9a90('0x1f')]({'limit':_0x9a90('0x1e')}));_0xa669f4[_0x9a90('0x13')](cors());_0xa669f4['use'](methodOverride());_0xa669f4[_0x9a90('0x13')](cookieParser());_0xa669f4[_0x9a90('0x13')](passport['initialize']());}; \ No newline at end of file +var _0xee9d=['development','test','client','json\x20replacer','toISOString','split','use','static','views','/server/views','engine','html','ejs','renderFile','view\x20engine','50mb','initialize','body-parser','method-override','cookie-parser','path','passport','moment','../mysqldb','default','get','set','appPath','join','root'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xee9d,0xa7));var _0xdee9=function(_0x5ca787,_0x26719d){_0x5ca787=_0x5ca787-0x0;var _0x4f7c3e=_0xee9d[_0x5ca787];return _0x4f7c3e;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require(_0xdee9('0x0'));var methodOverride=require(_0xdee9('0x1'));var cookieParser=require(_0xdee9('0x2'));var errorHandler=require('errorhandler');var path=require(_0xdee9('0x3'));var passport=require(_0xdee9('0x4'));var cors=require('cors');var moment=require(_0xdee9('0x5'));var config=require('./environment');var db=require(_0xdee9('0x6'))['db'];exports[_0xdee9('0x7')]=function(_0x48bd63){var _0x2d4633=_0x48bd63[_0xdee9('0x8')]('env');if(_0x2d4633==='production'){_0x48bd63[_0xdee9('0x9')](_0xdee9('0xa'),path[_0xdee9('0xb')](config[_0xdee9('0xc')],'public'));}if(_0x2d4633===_0xdee9('0xd')||_0x2d4633===_0xdee9('0xe')){_0x48bd63['set']('appPath',path['join'](config[_0xdee9('0xc')],_0xdee9('0xf')));_0x48bd63['use'](errorHandler());}_0x48bd63[_0xdee9('0x9')](_0xdee9('0x10'),function(_0x18e5c6,_0x107330){if(this[_0x18e5c6]instanceof Date){_0x107330=this[_0x18e5c6][_0xdee9('0x11')]()[_0xdee9('0x12')]('.')[0x0]+'Z';}return _0x107330;});_0x48bd63[_0xdee9('0x13')](express[_0xdee9('0x14')](_0x48bd63[_0xdee9('0x8')]('appPath')));_0x48bd63[_0xdee9('0x9')](_0xdee9('0x15'),config[_0xdee9('0xc')]+_0xdee9('0x16'));_0x48bd63[_0xdee9('0x17')](_0xdee9('0x18'),require(_0xdee9('0x19'))[_0xdee9('0x1a')]);_0x48bd63['set'](_0xdee9('0x1b'),_0xdee9('0x18'));_0x48bd63[_0xdee9('0x13')](bodyParser['urlencoded']({'limit':_0xdee9('0x1c'),'extended':!![]}));_0x48bd63[_0xdee9('0x13')](bodyParser['json']({'limit':_0xdee9('0x1c')}));_0x48bd63[_0xdee9('0x13')](cors());_0x48bd63[_0xdee9('0x13')](methodOverride());_0x48bd63[_0xdee9('0x13')](cookieParser());_0x48bd63[_0xdee9('0x13')](passport[_0xdee9('0x1d')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index e1b948e..25d0164 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 _0x7118=['IPv4','internal','concat','head','mac','address','127.0.0.1','getFirstInterface','cpus','map','join','createHash','md5','update','digest','hex','getUuid','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','substring','bimedia-machine-uuid','child_process','networkInterfaces','orderBy','keys','filter','family'];(function(_0x77b525,_0xd4dc1e){var _0xa83673=function(_0x133b1f){while(--_0x133b1f){_0x77b525['push'](_0x77b525['shift']());}};_0xa83673(++_0xd4dc1e);}(_0x7118,0x159));var _0x8711=function(_0x2f7d7a,_0x216684){_0x2f7d7a=_0x2f7d7a-0x0;var _0x1169e1=_0x7118[_0x2f7d7a];return _0x1169e1;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require(_0x8711('0x0'));var exec=require(_0x8711('0x1'))['execSync'];function getInterfaces(){var _0x1758c5=[];var _0x3ea36f=os[_0x8711('0x2')]();var _0x259c36=_[_0x8711('0x3')](_[_0x8711('0x4')](_0x3ea36f));for(var _0x206b82=0x0;_0x206b82<_0x259c36['length'];_0x206b82++){var _0x385033=_0x3ea36f[_0x259c36[_0x206b82]][_0x8711('0x5')](function(_0x1f23a9){return _0x1f23a9[_0x8711('0x6')]===_0x8711('0x7')&&_0x1f23a9[_0x8711('0x8')]===![];});_0x1758c5=_0x1758c5[_0x8711('0x9')](_0x385033);}return _0x1758c5;}function getFirstInterface(){var _0x2f01ca=_[_0x8711('0xa')](getInterfaces());return{'macAddress':_0x2f01ca&&_0x2f01ca[_0x8711('0xb')]?_0x2f01ca[_0x8711('0xb')]:'00:00:00:00:00:00','ipAddress':_0x2f01ca&&_0x2f01ca['address']?_0x2f01ca[_0x8711('0xc')]:_0x8711('0xd')};}exports[_0x8711('0xe')]=getFirstInterface;function getCPUhash(){var _0x4b1fbe=_['orderBy'](os[_0x8711('0xf')]()[_0x8711('0x10')](function(_0x5d2c38){return _0x5d2c38['model'];}))[_0x8711('0x11')](':');return crypto[_0x8711('0x12')](_0x8711('0x13'))[_0x8711('0x14')](_0x4b1fbe)[_0x8711('0x15')](_0x8711('0x16'));}exports[_0x8711('0x17')]=function(){switch(os['platform']()){case _0x8711('0x18'):return exec(_0x8711('0x19'),{'encoding':_0x8711('0x1a')})[_0x8711('0x1b')]('\x0d\x0a','');default:var _0x3ab905=getFirstInterface();var _0x4628e9=getCPUhash();var _0x57fedb=_0x4628e9+'|'+os[_0x8711('0x1c')]()+'|'+_0x3ab905[_0x8711('0x1d')]+'|'+_0x3ab905[_0x8711('0x1e')];var _0xe1e9b3=crypto[_0x8711('0x12')]('md5')['update'](_0x57fedb)['digest'](_0x8711('0x16'));return _0xe1e9b3[_0x8711('0x1f')](0x0,0x8)+'-'+_0xe1e9b3[_0x8711('0x1f')](0x8,0xc)+'-'+_0xe1e9b3['substring'](0xc,0x10)+'-'+_0xe1e9b3['substring'](0x10,0x14)+'-'+_0xe1e9b3[_0x8711('0x1f')](0x14);}}; \ No newline at end of file +var _0xc7a3=['crypto','bimedia-machine-uuid','child_process','execSync','orderBy','length','IPv4','concat','head','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','map','model','createHash','md5','update','digest','hex','platform','win32','replace','hostname','ipAddress','substring'];(function(_0x1f2657,_0x40d753){var _0xe9e45f=function(_0x12b98f){while(--_0x12b98f){_0x1f2657['push'](_0x1f2657['shift']());}};_0xe9e45f(++_0x40d753);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x3bf9db,_0x1faa5d){_0x3bf9db=_0x3bf9db-0x0;var _0x5ed75b=_0xc7a3[_0x3bf9db];return _0x5ed75b;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x3c7a('0x0'));var machine=require(_0x3c7a('0x1'));var exec=require(_0x3c7a('0x2'))[_0x3c7a('0x3')];function getInterfaces(){var _0x283aed=[];var _0x2d6d97=os['networkInterfaces']();var _0x44fd47=_[_0x3c7a('0x4')](_['keys'](_0x2d6d97));for(var _0x9c6b1a=0x0;_0x9c6b1a<_0x44fd47[_0x3c7a('0x5')];_0x9c6b1a++){var _0x2736c1=_0x2d6d97[_0x44fd47[_0x9c6b1a]]['filter'](function(_0x115c8a){return _0x115c8a['family']===_0x3c7a('0x6')&&_0x115c8a['internal']===![];});_0x283aed=_0x283aed[_0x3c7a('0x7')](_0x2736c1);}return _0x283aed;}function getFirstInterface(){var _0x3120d8=_[_0x3c7a('0x8')](getInterfaces());return{'macAddress':_0x3120d8&&_0x3120d8['mac']?_0x3120d8[_0x3c7a('0x9')]:_0x3c7a('0xa'),'ipAddress':_0x3120d8&&_0x3120d8['address']?_0x3120d8[_0x3c7a('0xb')]:'127.0.0.1'};}exports[_0x3c7a('0xc')]=getFirstInterface;function getCPUhash(){var _0x4e5413=_[_0x3c7a('0x4')](os[_0x3c7a('0xd')]()[_0x3c7a('0xe')](function(_0x16ea63){return _0x16ea63[_0x3c7a('0xf')];}))['join'](':');return crypto[_0x3c7a('0x10')](_0x3c7a('0x11'))[_0x3c7a('0x12')](_0x4e5413)[_0x3c7a('0x13')](_0x3c7a('0x14'));}exports['getUuid']=function(){switch(os[_0x3c7a('0x15')]()){case _0x3c7a('0x16'):return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x3c7a('0x17')]('\x0d\x0a','');default:var _0xb9201c=getFirstInterface();var _0x687077=getCPUhash();var _0x4d7a8c=_0x687077+'|'+os[_0x3c7a('0x18')]()+'|'+_0xb9201c['macAddress']+'|'+_0xb9201c[_0x3c7a('0x19')];var _0x22e7a5=crypto[_0x3c7a('0x10')](_0x3c7a('0x11'))[_0x3c7a('0x12')](_0x4d7a8c)[_0x3c7a('0x13')]('hex');return _0x22e7a5[_0x3c7a('0x1a')](0x0,0x8)+'-'+_0x22e7a5[_0x3c7a('0x1a')](0x8,0xc)+'-'+_0x22e7a5[_0x3c7a('0x1a')](0xc,0x10)+'-'+_0x22e7a5[_0x3c7a('0x1a')](0x10,0x14)+'-'+_0x22e7a5[_0x3c7a('0x1a')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 453db95..546be43 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 _0x7880=['getFirstInterface','MOTLICENSE','Motion\x20License\x20Alert','get','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','data1','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','version','./hardware','license','../../api/jira/jira.controller','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','createCipher','aes-256-ctr','secrets','utf8','base64','update','||FIELD||VALUE||\x0a','User','findOne','admin','fullname','email','|reason|','|uuid|','|machineUuid|','|name|','|email|'];(function(_0x21b032,_0x470065){var _0x1f906a=function(_0x5835d9){while(--_0x5835d9){_0x21b032['push'](_0x21b032['shift']());}};_0x1f906a(++_0x470065);}(_0x7880,0x10f));var _0x0788=function(_0x28258a,_0x22f398){_0x28258a=_0x28258a-0x0;var _0x4e968e=_0x7880[_0x28258a];return _0x4e968e;};'use strict';var util=require(_0x0788('0x0'));var crypto=require('crypto');var moment=require(_0x0788('0x1'));var rp=require(_0x0788('0x2'));var BPromise=require(_0x0788('0x3'));var pkginfo=require(_0x0788('0x4'))(module,_0x0788('0x5'));var db=require('../../mysqldb')['db'];var config=require('../environment');var hardware=require(_0x0788('0x6'));var logger=require('../logger')(_0x0788('0x7'));var jira=require(_0x0788('0x8'));var HOST=_0x0788('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x5ece1c){return new BPromise(function(_0x14cfa5,_0x450b71){var _0x5366c7=util[_0x0788('0xa')](_0x0788('0xb'),HOST,_0x5ece1c,module[_0x0788('0xc')][_0x0788('0x5')]);if(oldToken){_0x5366c7=util[_0x0788('0xa')](_0x0788('0xd'),HOST,_0x5ece1c,module[_0x0788('0xc')][_0x0788('0x5')],oldToken);}var _0x172cb6={'uri':_0x5366c7,'method':_0x0788('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x172cb6)[_0x0788('0xf')](function(_0x51f861){_0x14cfa5(_0x51f861);})[_0x0788('0x10')](function(_0x47c4fc){_0x450b71(_0x47c4fc);});});}function encryptDate(_0x423e99){var _0x9d3024=crypto[_0x0788('0x11')](_0x0788('0x12'),config[_0x0788('0x13')]['session']);var _0x2c4682=_0x9d3024['update'](_0x423e99,_0x0788('0x14'),'base64');_0x2c4682+=_0x9d3024['final'](_0x0788('0x15'));return _0x2c4682;}function decryptDate(_0x8a7e08){var _0x32eae1=crypto['createDecipher'](_0x0788('0x12'),config[_0x0788('0x13')]['session']);var _0x334f58=_0x32eae1[_0x0788('0x16')](_0x8a7e08,_0x0788('0x15'),'utf8');_0x334f58+=_0x32eae1['final'](_0x0788('0x14'));return _0x334f58;}function sendJiraAlert(_0xf82fbc,_0x5ce32d,_0x3f0de9){var _0x3e0ad7=_0x0788('0x17');return db[_0x0788('0x18')][_0x0788('0x19')]({'where':{'role':_0x0788('0x1a')},'attributes':[_0x0788('0x1b'),_0x0788('0x1c')],'raw':!![]})['then'](function(_0x2739ac){ADMIN=_0x2739ac;_0x3e0ad7+=_0x0788('0x1d')+_0x3f0de9+'|\x0a';_0x3e0ad7+=_0x0788('0x1e')+_0xf82fbc+'|\x0a';_0x3e0ad7+=_0x0788('0x1f')+_0x5ce32d+'|\x0a';_0x3e0ad7+=_0x0788('0x20')+ADMIN[_0x0788('0x1b')]+'|\x0a';_0x3e0ad7+=_0x0788('0x21')+ADMIN['email']+'|\x0a';return _0x3e0ad7;})[_0x0788('0xf')](function(_0x1b373d){var _0x2525f7=hardware[_0x0788('0x22')]()['ipAddress'];return jira['openIssue']({'key':_0x0788('0x23'),'summary':_0x0788('0x24'),'description':_0x1b373d,'issuetype':'Alert','oldToken':_0xf82fbc,'newToken':_0x5ce32d,'email':ADMIN[_0x0788('0x1c')],'name':ADMIN[_0x0788('0x1b')],'reason':GRAY_PERIOD_REASON,'ip':_0x2525f7});});}function manageLicense(_0x4b99fa,_0x42cfcb){var _0x2e7874=_0x42cfcb[_0x0788('0x25')]({'plain':!![]});httpRequest(_0x4b99fa)[_0x0788('0xf')](function(_0x4bfc25){if(oldToken){oldToken=undefined;}if(_0x4bfc25[_0x0788('0x26')]){if(!_0x2e7874['license']&&_0x2e7874['license']!=_0x4bfc25[_0x0788('0x7')]||_0x2e7874[_0x0788('0x7')]&&_0x2e7874[_0x0788('0x27')]){logger[_0x0788('0x28')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x2e7874['license']&&!_0x2e7874['data2']&&_0x2e7874[_0x0788('0x7')]!=_0x4bfc25[_0x0788('0x7')]){logger['info'](_0x0788('0x29'));}if(_0x2e7874[_0x0788('0x7')]&&!_0x2e7874['data2']&&_0x2e7874[_0x0788('0x7')]==_0x4bfc25['license']){return _0x42cfcb;}return _0x42cfcb[_0x0788('0x16')]({'data1':_0x4b99fa,'data2':null,'license':_0x4bfc25['license']});}else{if(_0x4bfc25[_0x0788('0x7')]||_0x2e7874[_0x0788('0x7')]){if(!_0x2e7874[_0x0788('0x27')]){if(_0x2e7874['data1']==_0x4b99fa){GRAY_PERIOD_REASON='Disabled';logger[_0x0788('0x28')](_0x0788('0x2a'));}else{GRAY_PERIOD_REASON=_0x0788('0x2b');oldToken=_0x2e7874['data1'];logger[_0x0788('0x28')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2e7874[_0x0788('0x2c')],_0x4b99fa);}sendJiraAlert(_0x2e7874[_0x0788('0x2c')],_0x4bfc25[_0x0788('0x2d')],GRAY_PERIOD_REASON);logger[_0x0788('0x28')](_0x0788('0x2e'),GRAY_PERIOD_REASON[_0x0788('0x2f')](),moment()['format'](_0x0788('0x30')));return _0x42cfcb[_0x0788('0x16')]({'data2':encryptDate(moment()[_0x0788('0xa')](_0x0788('0x30')))});}else{if(moment()[_0x0788('0x31')](decryptDate(_0x2e7874[_0x0788('0x27')]),_0x0788('0x32'))>DAYS){logger[_0x0788('0x28')](_0x0788('0x33'),moment()[_0x0788('0xa')](_0x0788('0x30')));return _0x42cfcb['update']({'data1':_0x4b99fa,'data2':null,'license':null});}}}else{if(_0x2e7874[_0x0788('0x2c')]!=_0x4b99fa){logger[_0x0788('0x28')](_0x0788('0x34'),_0x2e7874[_0x0788('0x2c')],_0x4b99fa);return _0x42cfcb[_0x0788('0x16')]({'data1':_0x4b99fa,'data2':null,'license':null});}}}return _0x42cfcb;})[_0x0788('0xf')](function(_0x493758){_0x42cfcb=_0x493758;})[_0x0788('0x10')](function(_0x574d00){logger[_0x0788('0x35')](_0x574d00[_0x0788('0x36')]);})[_0x0788('0x37')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x42cfcb);},TIME);});}function defaultLicense(){var _0x167b78=hardware[_0x0788('0x38')]();if(_0x167b78){return db['License'][_0x0788('0x39')]({'where':{'id':0x1},'defaults':{'data1':_0x167b78}})[_0x0788('0x3a')](function(_0x72750f,_0x16a56b){logger[_0x0788('0x28')](_0x0788('0x3b'),_0x167b78);manageLicense(_0x167b78,_0x72750f);})[_0x0788('0x10')](function(_0xd13e15){logger['error'](_0xd13e15[_0x0788('0x36')]);});}}exports[_0x0788('0x3c')]=defaultLicense; \ No newline at end of file +var _0xe3b3=['default','util','crypto','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../environment','./hardware','license','../../api/jira/jira.controller','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','createCipher','aes-256-ctr','secrets','session','update','utf8','base64','final','||FIELD||VALUE||\x0a','findOne','fullname','email','|uuid|','|machineUuid|','|email|','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','days','error','message','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s'];(function(_0x4a209a,_0x575ff9){var _0x4b3c20=function(_0x1a50c1){while(--_0x1a50c1){_0x4a209a['push'](_0x4a209a['shift']());}};_0x4b3c20(++_0x575ff9);}(_0xe3b3,0x1b3));var _0x3e3b=function(_0x26c6f9,_0x19b895){_0x26c6f9=_0x26c6f9-0x0;var _0x2fcca0=_0xe3b3[_0x26c6f9];return _0x2fcca0;};'use strict';var util=require(_0x3e3b('0x0'));var crypto=require(_0x3e3b('0x1'));var moment=require(_0x3e3b('0x2'));var rp=require(_0x3e3b('0x3'));var BPromise=require(_0x3e3b('0x4'));var pkginfo=require(_0x3e3b('0x5'))(module,_0x3e3b('0x6'));var db=require(_0x3e3b('0x7'))['db'];var config=require(_0x3e3b('0x8'));var hardware=require(_0x3e3b('0x9'));var logger=require('../logger')(_0x3e3b('0xa'));var jira=require(_0x3e3b('0xb'));var HOST=_0x3e3b('0xc');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x57c8f9){return new BPromise(function(_0x11ed30,_0x46c928){var _0x3d7821=util[_0x3e3b('0xd')](_0x3e3b('0xe'),HOST,_0x57c8f9,module[_0x3e3b('0xf')][_0x3e3b('0x6')]);if(oldToken){_0x3d7821=util[_0x3e3b('0xd')](_0x3e3b('0x10'),HOST,_0x57c8f9,module['exports'][_0x3e3b('0x6')],oldToken);}var _0x5bfd04={'uri':_0x3d7821,'method':_0x3e3b('0x11'),'timeout':0xea60,'json':!![]};return rp(_0x5bfd04)[_0x3e3b('0x12')](function(_0x3f6279){_0x11ed30(_0x3f6279);})[_0x3e3b('0x13')](function(_0x6821b9){_0x46c928(_0x6821b9);});});}function encryptDate(_0x32a679){var _0x1ae7a6=crypto[_0x3e3b('0x14')](_0x3e3b('0x15'),config[_0x3e3b('0x16')][_0x3e3b('0x17')]);var _0x404a2d=_0x1ae7a6[_0x3e3b('0x18')](_0x32a679,_0x3e3b('0x19'),_0x3e3b('0x1a'));_0x404a2d+=_0x1ae7a6[_0x3e3b('0x1b')](_0x3e3b('0x1a'));return _0x404a2d;}function decryptDate(_0x4fffd3){var _0x2a6d19=crypto['createDecipher'](_0x3e3b('0x15'),config[_0x3e3b('0x16')][_0x3e3b('0x17')]);var _0x5a36e3=_0x2a6d19['update'](_0x4fffd3,'base64',_0x3e3b('0x19'));_0x5a36e3+=_0x2a6d19[_0x3e3b('0x1b')](_0x3e3b('0x19'));return _0x5a36e3;}function sendJiraAlert(_0x35fc4e,_0x3b1573,_0x1cd81d){var _0x375624=_0x3e3b('0x1c');return db['User'][_0x3e3b('0x1d')]({'where':{'role':'admin'},'attributes':[_0x3e3b('0x1e'),_0x3e3b('0x1f')],'raw':!![]})[_0x3e3b('0x12')](function(_0x3d9412){ADMIN=_0x3d9412;_0x375624+='|reason|'+_0x1cd81d+'|\x0a';_0x375624+=_0x3e3b('0x20')+_0x35fc4e+'|\x0a';_0x375624+=_0x3e3b('0x21')+_0x3b1573+'|\x0a';_0x375624+='|name|'+ADMIN[_0x3e3b('0x1e')]+'|\x0a';_0x375624+=_0x3e3b('0x22')+ADMIN['email']+'|\x0a';return _0x375624;})['then'](function(_0x5cba48){var _0x47660d=hardware[_0x3e3b('0x23')]()[_0x3e3b('0x24')];return jira[_0x3e3b('0x25')]({'key':_0x3e3b('0x26'),'summary':_0x3e3b('0x27'),'description':_0x5cba48,'issuetype':_0x3e3b('0x28'),'oldToken':_0x35fc4e,'newToken':_0x3b1573,'email':ADMIN[_0x3e3b('0x1f')],'name':ADMIN[_0x3e3b('0x1e')],'reason':GRAY_PERIOD_REASON,'ip':_0x47660d});});}function manageLicense(_0x452be0,_0x46eec4){var _0x29af34=_0x46eec4[_0x3e3b('0x29')]({'plain':!![]});httpRequest(_0x452be0)[_0x3e3b('0x12')](function(_0x1d85cb){if(oldToken){oldToken=undefined;}if(_0x1d85cb['active']){if(!_0x29af34[_0x3e3b('0xa')]&&_0x29af34[_0x3e3b('0xa')]!=_0x1d85cb[_0x3e3b('0xa')]||_0x29af34['license']&&_0x29af34[_0x3e3b('0x2a')]){logger['info'](_0x3e3b('0x2b'));}if(_0x29af34['license']&&!_0x29af34['data2']&&_0x29af34[_0x3e3b('0xa')]!=_0x1d85cb[_0x3e3b('0xa')]){logger[_0x3e3b('0x2c')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x29af34[_0x3e3b('0xa')]&&!_0x29af34[_0x3e3b('0x2a')]&&_0x29af34['license']==_0x1d85cb[_0x3e3b('0xa')]){return _0x46eec4;}return _0x46eec4[_0x3e3b('0x18')]({'data1':_0x452be0,'data2':null,'license':_0x1d85cb[_0x3e3b('0xa')]});}else{if(_0x1d85cb[_0x3e3b('0xa')]||_0x29af34['license']){if(!_0x29af34[_0x3e3b('0x2a')]){if(_0x29af34[_0x3e3b('0x2d')]==_0x452be0){GRAY_PERIOD_REASON=_0x3e3b('0x2e');logger[_0x3e3b('0x2c')](_0x3e3b('0x2f'));}else{GRAY_PERIOD_REASON='Changed';oldToken=_0x29af34[_0x3e3b('0x2d')];logger['info'](_0x3e3b('0x30'),_0x29af34[_0x3e3b('0x2d')],_0x452be0);}sendJiraAlert(_0x29af34['data1'],_0x1d85cb[_0x3e3b('0x31')],GRAY_PERIOD_REASON);logger[_0x3e3b('0x2c')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x3e3b('0x32')](),moment()['format'](_0x3e3b('0x33')));return _0x46eec4[_0x3e3b('0x18')]({'data2':encryptDate(moment()[_0x3e3b('0xd')](_0x3e3b('0x33')))});}else{if(moment()[_0x3e3b('0x34')](decryptDate(_0x29af34[_0x3e3b('0x2a')]),_0x3e3b('0x35'))>DAYS){logger[_0x3e3b('0x2c')]('DEMO\x20START\x20AT\x20%s',moment()[_0x3e3b('0xd')](_0x3e3b('0x33')));return _0x46eec4[_0x3e3b('0x18')]({'data1':_0x452be0,'data2':null,'license':null});}}}else{if(_0x29af34['data1']!=_0x452be0){logger['info'](_0x3e3b('0x30'),_0x29af34[_0x3e3b('0x2d')],_0x452be0);return _0x46eec4[_0x3e3b('0x18')]({'data1':_0x452be0,'data2':null,'license':null});}}}return _0x46eec4;})[_0x3e3b('0x12')](function(_0x1514a2){_0x46eec4=_0x1514a2;})[_0x3e3b('0x13')](function(_0x33a599){logger[_0x3e3b('0x36')](_0x33a599[_0x3e3b('0x37')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x3e3b('0x38')](),_0x46eec4);},TIME);});}function defaultLicense(){var _0x50b2b4=hardware[_0x3e3b('0x38')]();if(_0x50b2b4){return db[_0x3e3b('0x39')][_0x3e3b('0x3a')]({'where':{'id':0x1},'defaults':{'data1':_0x50b2b4}})[_0x3e3b('0x3b')](function(_0x5a11a1,_0x2a48cb){logger[_0x3e3b('0x2c')](_0x3e3b('0x3c'),_0x50b2b4);manageLicense(_0x50b2b4,_0x5a11a1);})[_0x3e3b('0x13')](function(_0x42591e){logger[_0x3e3b('0x36')](_0x42591e[_0x3e3b('0x37')]);});}}exports[_0x3e3b('0x3d')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index efb7dff..6cff25c 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 _0x9b06=['License\x20key\x20value\x20not\x20found','data1','data2','split','aes-256-ctr','%s:%s:%s','final','utf8','parse','demo','uuid','machineUuid','session','update','base64','gray','deadline','add','days','grayReason','changed','disabled','2027-01-01T00:00:00.000Z','getUuid','message','Demo\x20license','getLicense','License','find','defaults','checkLicense','crypto','lodash','moment','./hardware','../../mysqldb','license','isEmpty'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x9b06,0xb7));var _0x69b0=function(_0x499aa8,_0x54e409){_0x499aa8=_0x499aa8-0x0;var _0x4558fc=_0x9b06[_0x499aa8];return _0x4558fc;};'use strict';var crypto=require(_0x69b0('0x0'));var util=require('util');var _=require(_0x69b0('0x1'));var moment=require(_0x69b0('0x2'));var hardware=require(_0x69b0('0x3'));var config=require('../environment');var db=require(_0x69b0('0x4'))['db'];function checkLicense(_0xdd7ce2,_0x1041bc){if(_0xdd7ce2){try{var _0x305628=_0x1041bc||_0xdd7ce2[_0x69b0('0x5')];if(_[_0x69b0('0x6')](_0x305628)){throw new Error(_0x69b0('0x7'));}var _0xa8f7da=_0xdd7ce2[_0x69b0('0x8')];var _0x16a93b=_0xdd7ce2[_0x69b0('0x9')];var _0x10e7b8=_0xa8f7da['split']('-')[0x4];var _0xaee0ae=_0xa8f7da[_0x69b0('0xa')]('-')[0x0];var _0x3b7004=crypto['createDecipher'](_0x69b0('0xb'),util['format'](_0x69b0('0xc'),_0x10e7b8,_0xa8f7da,_0xaee0ae));var _0x1d94ed=_0x3b7004['update'](_0x305628,'base64','utf8');_0x1d94ed+=_0x3b7004[_0x69b0('0xd')](_0x69b0('0xe'));var _0x368a3c=JSON[_0x69b0('0xf')](_0x1d94ed);_0x368a3c[_0x69b0('0x10')]=![];_0x368a3c[_0x69b0('0x11')]=_0xa8f7da;_0x368a3c[_0x69b0('0x12')]=hardware['getUuid']();if(_0x16a93b){var _0x2865a4=crypto['createDecipher'](_0x69b0('0xb'),config['secrets'][_0x69b0('0x13')]);var _0x13d640=_0x2865a4[_0x69b0('0x14')](_0x16a93b,_0x69b0('0x15'),_0x69b0('0xe'));_0x13d640+=_0x2865a4[_0x69b0('0xd')]('utf8');_0x368a3c[_0x69b0('0x16')]=_0x13d640;_0x368a3c[_0x69b0('0x17')]=moment(_0x13d640)[_0x69b0('0x18')](0x7,_0x69b0('0x19'))['format']();_0x368a3c[_0x69b0('0x1a')]=_0x368a3c[_0x69b0('0x11')]!=_0x368a3c[_0x69b0('0x12')]?_0x69b0('0x1b'):_0x69b0('0x1c');}return _0x368a3c;}catch(_0x4f4729){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x69b0('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0xdd7ce2['data1'],'machineUuid':hardware[_0x69b0('0x1e')](),'message':_0x4f4729[_0x69b0('0x1f')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x69b0('0x20'),'uuid':_0xdd7ce2[_0x69b0('0x8')],'machineUuid':hardware[_0x69b0('0x1e')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0x69b0('0x21')]=function(_0x5b471e){return db[_0x69b0('0x22')][_0x69b0('0x23')](_[_0x69b0('0x24')](_0x5b471e,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x51d901){return checkLicense(_0x51d901,null);});};exports[_0x69b0('0x25')]=checkLicense; \ No newline at end of file +var _0xecfd=['%s:%s:%s','base64','utf8','final','parse','demo','uuid','machineUuid','getUuid','session','update','gray','add','days','changed','disabled','message','2027-01-01T00:00:00.000Z','Demo\x20license','getLicense','License','find','defaults','checkLicense','util','lodash','moment','../environment','../../mysqldb','license','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','format'];(function(_0x5497d2,_0x1183fb){var _0x4cb025=function(_0x594275){while(--_0x594275){_0x5497d2['push'](_0x5497d2['shift']());}};_0x4cb025(++_0x1183fb);}(_0xecfd,0xa8));var _0xdecf=function(_0x469eb9,_0x6c3137){_0x469eb9=_0x469eb9-0x0;var _0x435681=_0xecfd[_0x469eb9];return _0x435681;};'use strict';var crypto=require('crypto');var util=require(_0xdecf('0x0'));var _=require(_0xdecf('0x1'));var moment=require(_0xdecf('0x2'));var hardware=require('./hardware');var config=require(_0xdecf('0x3'));var db=require(_0xdecf('0x4'))['db'];function checkLicense(_0x691c41,_0x1048dd){if(_0x691c41){try{var _0x35ed42=_0x1048dd||_0x691c41[_0xdecf('0x5')];if(_['isEmpty'](_0x35ed42)){throw new Error(_0xdecf('0x6'));}var _0x1e3396=_0x691c41[_0xdecf('0x7')];var _0x255ade=_0x691c41[_0xdecf('0x8')];var _0x47086c=_0x1e3396[_0xdecf('0x9')]('-')[0x4];var _0x59eb41=_0x1e3396[_0xdecf('0x9')]('-')[0x0];var _0xac10d7=crypto[_0xdecf('0xa')]('aes-256-ctr',util[_0xdecf('0xb')](_0xdecf('0xc'),_0x47086c,_0x1e3396,_0x59eb41));var _0x214d0f=_0xac10d7['update'](_0x35ed42,_0xdecf('0xd'),_0xdecf('0xe'));_0x214d0f+=_0xac10d7[_0xdecf('0xf')]('utf8');var _0x29a659=JSON[_0xdecf('0x10')](_0x214d0f);_0x29a659[_0xdecf('0x11')]=![];_0x29a659[_0xdecf('0x12')]=_0x1e3396;_0x29a659[_0xdecf('0x13')]=hardware[_0xdecf('0x14')]();if(_0x255ade){var _0x1c4d50=crypto[_0xdecf('0xa')]('aes-256-ctr',config['secrets'][_0xdecf('0x15')]);var _0x12252c=_0x1c4d50[_0xdecf('0x16')](_0x255ade,'base64','utf8');_0x12252c+=_0x1c4d50['final'](_0xdecf('0xe'));_0x29a659[_0xdecf('0x17')]=_0x12252c;_0x29a659['deadline']=moment(_0x12252c)[_0xdecf('0x18')](0x7,_0xdecf('0x19'))[_0xdecf('0xb')]();_0x29a659['grayReason']=_0x29a659['uuid']!=_0x29a659[_0xdecf('0x13')]?_0xdecf('0x1a'):_0xdecf('0x1b');}return _0x29a659;}catch(_0x187372){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':_0x691c41[_0xdecf('0x7')],'machineUuid':hardware[_0xdecf('0x14')](),'message':_0x187372[_0xdecf('0x1c')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xdecf('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xdecf('0x1e'),'uuid':_0x691c41[_0xdecf('0x7')],'machineUuid':hardware[_0xdecf('0x14')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0xdecf('0x1f')]=function(_0xdfab7c){return db[_0xdecf('0x20')][_0xdecf('0x21')](_[_0xdecf('0x22')](_0xdfab7c,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x61c361){return checkLicense(_0x61c361,null);});};exports[_0xdecf('0x23')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 459919a..2c86594 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 _0x228d=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x559359,_0x37f65f){var _0x19822f=function(_0x26f720){while(--_0x26f720){_0x559359['push'](_0x559359['shift']());}};_0x19822f(++_0x37f65f);}(_0x228d,0x87));var _0xd228=function(_0x339da2,_0x3aa23a){_0x339da2=_0x339da2-0x0;var _0x4c6e10=_0x228d[_0x339da2];return _0x4c6e10;};'use strict';module[_0xd228('0x0')]={'DOMAIN':_0xd228('0x1'),'SESSION_SECRET':_0xd228('0x2'),'GOOGLE_ID':_0xd228('0x3'),'GOOGLE_SECRET':_0xd228('0x4'),'DEBUG':''}; \ No newline at end of file +var _0xb068=['app-id','secret','http://localhost:9000'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb068,0x119));var _0x8b06=function(_0x4f292d,_0x25535f){_0x4f292d=_0x4f292d-0x0;var _0x3af45f=_0xb068[_0x4f292d];return _0x3af45f;};'use strict';module['exports']={'DOMAIN':_0x8b06('0x0'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x8b06('0x1'),'GOOGLE_SECRET':_0x8b06('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index cf55e3f..39b657e 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe3c1=['error','transports','File','info','Console','env','debugLevel','moment','winston','path','/var','log','xcally','format','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','message','exports','Logger','%s-%s'];(function(_0x51ed62,_0x574379){var _0x34aee3=function(_0x2958bc){while(--_0x2958bc){_0x51ed62['push'](_0x51ed62['shift']());}};_0x34aee3(++_0x574379);}(_0xe3c1,0x157));var _0x1e3c=function(_0x5c38cd,_0x5a6b4e){_0x5c38cd=_0x5c38cd-0x0;var _0xc985ef=_0xe3c1[_0x5c38cd];return _0xc985ef;};'use strict';var moment=require(_0x1e3c('0x0'));var winston=require(_0x1e3c('0x1'));var util=require('util');var path=require(_0x1e3c('0x2'));var debugLevel='INFO';function filename(_0x3c9c35,_0x16a661){return path['join'](_0x1e3c('0x3'),_0x1e3c('0x4'),_0x1e3c('0x5'),util[_0x1e3c('0x6')]('%s-%s.log',_0x3c9c35,_0x16a661));}function formatter(_0x3af050,_0x3d272a){return util[_0x1e3c('0x6')](_0x1e3c('0x7'),moment()[_0x1e3c('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),_0x3d272a[_0x1e3c('0x8')][_0x1e3c('0x9')](),_0x3af050,_0x3d272a[_0x1e3c('0xa')]);}module[_0x1e3c('0xb')]=function(_0x1001f9){return new winston[(_0x1e3c('0xc'))]({'transports':[new winston['transports']['File']({'name':util[_0x1e3c('0x6')](_0x1e3c('0xd'),_0x1001f9,_0x1e3c('0xe')),'filename':filename(_0x1001f9,_0x1e3c('0xe')),'level':_0x1e3c('0xe'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2a1fa2){return formatter(_0x1001f9,_0x2a1fa2);}}),new winston[(_0x1e3c('0xf'))][(_0x1e3c('0x10'))]({'name':util[_0x1e3c('0x6')]('%s-%s',_0x1001f9,_0x1e3c('0x11')),'filename':filename(_0x1001f9,'info'),'level':_0x1e3c('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x24215b){return formatter(_0x1001f9,_0x24215b);}}),new winston[(_0x1e3c('0xf'))][(_0x1e3c('0x12'))]({'level':process[_0x1e3c('0x13')][_0x1e3c('0x14')]||debugLevel,'json':![],'formatter':function(_0x31f6d7){return formatter(_0x1001f9,_0x31f6d7);}})]});}; \ No newline at end of file +var _0xdaf4=['message','exports','Logger','transports','File','%s-%s','error','info','Console','env','debugLevel','moment','winston','util','path','join','/var','log','xcally','%s-%s.log','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x37ef0f,_0x32a484){var _0x3b28ad=function(_0x415e39){while(--_0x415e39){_0x37ef0f['push'](_0x37ef0f['shift']());}};_0x3b28ad(++_0x32a484);}(_0xdaf4,0x11f));var _0x4daf=function(_0x4aa4e6,_0x278c45){_0x4aa4e6=_0x4aa4e6-0x0;var _0x322588=_0xdaf4[_0x4aa4e6];return _0x322588;};'use strict';var moment=require(_0x4daf('0x0'));var winston=require(_0x4daf('0x1'));var util=require(_0x4daf('0x2'));var path=require(_0x4daf('0x3'));var debugLevel='INFO';function filename(_0x2751cd,_0x468812){return path[_0x4daf('0x4')](_0x4daf('0x5'),_0x4daf('0x6'),_0x4daf('0x7'),util['format'](_0x4daf('0x8'),_0x2751cd,_0x468812));}function formatter(_0x1e53ae,_0x4aad19){return util[_0x4daf('0x9')](_0x4daf('0xa'),moment()[_0x4daf('0x9')](_0x4daf('0xb')),_0x4aad19['level']['toUpperCase'](),_0x1e53ae,_0x4aad19[_0x4daf('0xc')]);}module[_0x4daf('0xd')]=function(_0x5606a1){return new winston[(_0x4daf('0xe'))]({'transports':[new winston[(_0x4daf('0xf'))][(_0x4daf('0x10'))]({'name':util[_0x4daf('0x9')](_0x4daf('0x11'),_0x5606a1,'error'),'filename':filename(_0x5606a1,_0x4daf('0x12')),'level':_0x4daf('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x443a7d){return formatter(_0x5606a1,_0x443a7d);}}),new winston[(_0x4daf('0xf'))][(_0x4daf('0x10'))]({'name':util[_0x4daf('0x9')](_0x4daf('0x11'),_0x5606a1,_0x4daf('0x13')),'filename':filename(_0x5606a1,_0x4daf('0x13')),'level':_0x4daf('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x573418){return formatter(_0x5606a1,_0x573418);}}),new winston['transports'][(_0x4daf('0x14'))]({'level':process[_0x4daf('0x15')][_0x4daf('0x16')]||debugLevel,'json':![],'formatter':function(_0x1dcb10){return formatter(_0x5606a1,_0x1dcb10);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 673e3ad..a00169f 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 _0x7d1c=['../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/routing/index.js','../../services/xdr/index.js','exports','path','express','join'];(function(_0x58143d,_0x1007e3){var _0x4eb5a1=function(_0x3c374f){while(--_0x3c374f){_0x58143d['push'](_0x58143d['shift']());}};_0x4eb5a1(++_0x1007e3);}(_0x7d1c,0x141));var _0xc7d1=function(_0x1b8ad9,_0x301373){_0x1b8ad9=_0x1b8ad9-0x0;var _0x279227=_0x7d1c[_0x1b8ad9];return _0x279227;};'use strict';var path=require(_0xc7d1('0x0'));var os=require('os');var config={'apps':[{'name':_0xc7d1('0x1'),'script':path[_0xc7d1('0x2')](__dirname,_0xc7d1('0x3'))},{'name':_0xc7d1('0x4'),'script':path[_0xc7d1('0x2')](__dirname,_0xc7d1('0x5'))},{'name':_0xc7d1('0x6'),'script':path[_0xc7d1('0x2')](__dirname,_0xc7d1('0x7'))},{'name':_0xc7d1('0x8'),'script':path[_0xc7d1('0x2')](__dirname,'../../services/email/index.js')},{'name':'routing','script':path[_0xc7d1('0x2')](__dirname,_0xc7d1('0x9'))},{'name':'xdr','script':path[_0xc7d1('0x2')](__dirname,_0xc7d1('0xa'))}]};module[_0xc7d1('0xb')]=config; \ No newline at end of file +var _0x9fe1=['agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','path','join','../../services/express/index.js','ami'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9fe1,0x18c));var _0x19fe=function(_0xca559d,_0x4a7ff0){_0xca559d=_0xca559d-0x0;var _0x2aacd2=_0x9fe1[_0xca559d];return _0x2aacd2;};'use strict';var path=require(_0x19fe('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x19fe('0x1')](__dirname,_0x19fe('0x2'))},{'name':_0x19fe('0x3'),'script':path['join'](__dirname,'../../services/ami/index.js')},{'name':_0x19fe('0x4'),'script':path[_0x19fe('0x1')](__dirname,_0x19fe('0x5'))},{'name':_0x19fe('0x6'),'script':path[_0x19fe('0x1')](__dirname,_0x19fe('0x7'))},{'name':_0x19fe('0x8'),'script':path[_0x19fe('0x1')](__dirname,_0x19fe('0x9'))},{'name':'xdr','script':path[_0x19fe('0x1')](__dirname,'../../services/xdr/index.js')}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index b5b12b1..c7a54aa 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 _0xcc34=['then','disconnect','stop','restart','list','describe','delete','dump','saved','./config','connect','connected','start'];(function(_0x55c8d5,_0x29fd23){var _0x4a74f4=function(_0x4efa2d){while(--_0x4efa2d){_0x55c8d5['push'](_0x55c8d5['shift']());}};_0x4a74f4(++_0x29fd23);}(_0xcc34,0x7e));var _0x4cc3=function(_0x47515b,_0x4f9c33){_0x47515b=_0x47515b-0x0;var _0x4bef44=_0xcc34[_0x47515b];return _0x4bef44;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x4cc3('0x0'));function connect(){return new BPromise(function(_0x4804de,_0x64da87){return pm2[_0x4cc3('0x1')](function(_0x2de0d8){if(_0x2de0d8){return _0x64da87(_0x2de0d8);}return _0x4804de(_0x4cc3('0x2'));});});};exports[_0x4cc3('0x3')]=function(_0x2a80a5){return connect()[_0x4cc3('0x4')](function(){return new BPromise(function(_0x2dcf04,_0x24946c){return pm2[_0x4cc3('0x3')](_0x2a80a5,function(_0x567f7d,_0x3d1773){if(_0x567f7d){return _0x24946c(_0x567f7d);}pm2[_0x4cc3('0x5')]();return _0x2dcf04(_0x3d1773);});});});};exports[_0x4cc3('0x6')]=function(_0x578bc3){return connect()[_0x4cc3('0x4')](function(){return new BPromise(function(_0xe0d4da,_0xc0a2e3){return pm2['stop'](_0x578bc3,function(_0x30adb2,_0x198aab){if(_0x30adb2){return _0xc0a2e3(_0x30adb2);}pm2[_0x4cc3('0x5')]();return _0xe0d4da(_0x198aab);});});});};exports[_0x4cc3('0x7')]=function(_0x40b322){return connect()[_0x4cc3('0x4')](function(){return new BPromise(function(_0x3ed734,_0x545978){return pm2[_0x4cc3('0x7')](_0x40b322,function(_0x2dbbab,_0x2cc8bb){if(_0x2dbbab){return _0x545978(_0x2dbbab);}pm2[_0x4cc3('0x5')]();return _0x3ed734(_0x2cc8bb);});});});};exports[_0x4cc3('0x8')]=function(){return connect()[_0x4cc3('0x4')](function(){return new BPromise(function(_0x974cbe,_0x5b8ca7){return pm2['list'](function(_0x38da05,_0x32cadb){if(_0x38da05){return _0x5b8ca7(_0x38da05);}pm2[_0x4cc3('0x5')]();return _0x974cbe(_0x32cadb);});});});};exports[_0x4cc3('0x9')]=function(_0x35589c){return connect()[_0x4cc3('0x4')](function(){return new BPromise(function(_0x3c3e40,_0x4cc49e){return pm2[_0x4cc3('0x9')](_0x35589c,function(_0x4727e1,_0x47bf9e){if(_0x4727e1){return _0x4cc49e(_0x4727e1);}pm2[_0x4cc3('0x5')]();return _0x3c3e40(_0x47bf9e);});});});};exports['delete']=function(_0xed7330){return connect()[_0x4cc3('0x4')](function(){return new BPromise(function(_0x14fc0d,_0x32ad9b){return pm2[_0x4cc3('0xa')](_0xed7330,function(_0x184e5b,_0x5d0f81){if(_0x184e5b){return _0x32ad9b(_0x184e5b);}pm2[_0x4cc3('0x5')]();return _0x14fc0d(_0x5d0f81);});});});};exports[_0x4cc3('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x3d4975,_0x279875){return pm2[_0x4cc3('0xb')](function(_0x36c8ee){if(_0x36c8ee){return _0x279875(_0x36c8ee);}return _0x3d4975(_0x4cc3('0xc'));});});});}; \ No newline at end of file +var _0x56a6=['saved','pm2','bluebird','./config','connected','start','then','disconnect','stop','restart','list','describe','delete','dump'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x56a6,0x17b));var _0x656a=function(_0x550867,_0x3a833e){_0x550867=_0x550867-0x0;var _0x5cf9ff=_0x56a6[_0x550867];return _0x5cf9ff;};'use strict';var pm2=require(_0x656a('0x0'));var BPromise=require(_0x656a('0x1'));var config=require(_0x656a('0x2'));function connect(){return new BPromise(function(_0xaa8734,_0x5703f7){return pm2['connect'](function(_0x431d5c){if(_0x431d5c){return _0x5703f7(_0x431d5c);}return _0xaa8734(_0x656a('0x3'));});});};exports[_0x656a('0x4')]=function(_0x4d764b){return connect()[_0x656a('0x5')](function(){return new BPromise(function(_0x29e5a9,_0x1ce536){return pm2['start'](_0x4d764b,function(_0x42f089,_0x33cb4a){if(_0x42f089){return _0x1ce536(_0x42f089);}pm2[_0x656a('0x6')]();return _0x29e5a9(_0x33cb4a);});});});};exports['stop']=function(_0xea808c){return connect()['then'](function(){return new BPromise(function(_0x524116,_0x147192){return pm2[_0x656a('0x7')](_0xea808c,function(_0x380aa8,_0x218d19){if(_0x380aa8){return _0x147192(_0x380aa8);}pm2['disconnect']();return _0x524116(_0x218d19);});});});};exports[_0x656a('0x8')]=function(_0xd98931){return connect()[_0x656a('0x5')](function(){return new BPromise(function(_0x111aaa,_0x52721a){return pm2['restart'](_0xd98931,function(_0x4cc2ce,_0x16312b){if(_0x4cc2ce){return _0x52721a(_0x4cc2ce);}pm2[_0x656a('0x6')]();return _0x111aaa(_0x16312b);});});});};exports[_0x656a('0x9')]=function(){return connect()[_0x656a('0x5')](function(){return new BPromise(function(_0x228bb5,_0x5707b4){return pm2[_0x656a('0x9')](function(_0x2721cd,_0x36b24e){if(_0x2721cd){return _0x5707b4(_0x2721cd);}pm2[_0x656a('0x6')]();return _0x228bb5(_0x36b24e);});});});};exports[_0x656a('0xa')]=function(_0x29f176){return connect()[_0x656a('0x5')](function(){return new BPromise(function(_0x3c8d71,_0x552b5b){return pm2[_0x656a('0xa')](_0x29f176,function(_0x27a11,_0x3ad0ad){if(_0x27a11){return _0x552b5b(_0x27a11);}pm2[_0x656a('0x6')]();return _0x3c8d71(_0x3ad0ad);});});});};exports[_0x656a('0xb')]=function(_0x69bd9a){return connect()[_0x656a('0x5')](function(){return new BPromise(function(_0x24d985,_0x2f186f){return pm2['delete'](_0x69bd9a,function(_0x38be9f,_0xe31a24){if(_0x38be9f){return _0x2f186f(_0x38be9f);}pm2[_0x656a('0x6')]();return _0x24d985(_0xe31a24);});});});};exports[_0x656a('0xc')]=function(){return connect()[_0x656a('0x5')](function(){return new BPromise(function(_0x17377a,_0x3e1307){return pm2[_0x656a('0xc')](function(_0x53661e){if(_0x53661e){return _0x3e1307(_0x53661e);}return _0x17377a(_0x656a('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index b104e82..6ac7c3a 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 _0x0cba=['YYYY-MM-DD\x20HH:mm:ss','map','emit','chatInteraction:update','catch','error','start','lodash','moment','ioredis','../../mysqldb','../../config/environment','redis','defaults','localhost','socket.io-emitter','find','then','ChatInteraction','findAll','lastMsgAt','subtract','chatTimeout','minutes','update','system','timeout'];(function(_0x3f0e56,_0x2cb8c5){var _0x4ed31b=function(_0x108a5e){while(--_0x108a5e){_0x3f0e56['push'](_0x3f0e56['shift']());}};_0x4ed31b(++_0x2cb8c5);}(_0x0cba,0x181));var _0xa0cb=function(_0x2eee25,_0x53460d){_0x2eee25=_0x2eee25-0x0;var _0x1cb8c4=_0x0cba[_0x2eee25];return _0x1cb8c4;};'use strict';var _=require(_0xa0cb('0x0'));var moment=require(_0xa0cb('0x1'));var Redis=require(_0xa0cb('0x2'));var db=require(_0xa0cb('0x3'))['db'];var config=require(_0xa0cb('0x4'));config[_0xa0cb('0x5')]=_[_0xa0cb('0x6')](config[_0xa0cb('0x5')],{'host':_0xa0cb('0x7'),'port':0x18eb});var io=require(_0xa0cb('0x8'))(new Redis(config[_0xa0cb('0x5')]));function closeInteractions(){var _0x2a92bb=0x0;var _0x1032d7=[];return db['Setting'][_0xa0cb('0x9')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xa0cb('0xa')](function(_0x15e36b){_0x2a92bb=_0x15e36b['chatTimeout'];if(_0x2a92bb){return db[_0xa0cb('0xb')][_0xa0cb('0xc')]({'raw':!![],'attributes':['id',_0xa0cb('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xa0cb('0xe')](_0x15e36b[_0xa0cb('0xf')],_0xa0cb('0x10'))}}});}else{return[];}})[_0xa0cb('0xa')](function(_0xaf7826){_0x1032d7=_0xaf7826;if(_0x2a92bb){return db[_0xa0cb('0xb')][_0xa0cb('0x11')]({'closeReason':_0xa0cb('0x12'),'disposition':_0xa0cb('0x13'),'closed':!![],'closedAt':moment()['format'](_0xa0cb('0x14'))},{'where':{'id':_[_0xa0cb('0x15')](_0x1032d7||[],'id')}});}})[_0xa0cb('0xa')](function(_0x44f7ac){for(var _0x6cd8e9=0x0;_0x6cd8e9<_0x1032d7['length'];_0x6cd8e9++){io[_0xa0cb('0x16')](_0xa0cb('0x17'),{'id':_0x1032d7[_0x6cd8e9]['id'],'closed':!![]});}})[_0xa0cb('0x18')](function(_0x2bb9c0){console[_0xa0cb('0x19')](_0x2bb9c0);});}exports[_0xa0cb('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x98c5=['subtract','minutes','then','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','chatInteraction:update','catch','error','start','lodash','moment','../../mysqldb','../../config/environment','redis','socket.io-emitter','find','chatTimeout','ChatInteraction','findAll','lastMsgAt'];(function(_0x436c0b,_0x555729){var _0x54eb15=function(_0x26aae5){while(--_0x26aae5){_0x436c0b['push'](_0x436c0b['shift']());}};_0x54eb15(++_0x555729);}(_0x98c5,0x17c));var _0x598c=function(_0x16df99,_0x4669ce){_0x16df99=_0x16df99-0x0;var _0x4e8f0c=_0x98c5[_0x16df99];return _0x4e8f0c;};'use strict';var _=require(_0x598c('0x0'));var moment=require(_0x598c('0x1'));var Redis=require('ioredis');var db=require(_0x598c('0x2'))['db'];var config=require(_0x598c('0x3'));config[_0x598c('0x4')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x598c('0x5'))(new Redis(config[_0x598c('0x4')]));function closeInteractions(){var _0x277816=0x0;var _0x804a00=[];return db['Setting'][_0x598c('0x6')]({'raw':!![],'attributes':['id',_0x598c('0x7')],'where':{'id':0x1}})['then'](function(_0x34c6a2){_0x277816=_0x34c6a2['chatTimeout'];if(_0x277816){return db[_0x598c('0x8')][_0x598c('0x9')]({'raw':!![],'attributes':['id',_0x598c('0xa')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x598c('0xb')](_0x34c6a2['chatTimeout'],_0x598c('0xc'))}}});}else{return[];}})[_0x598c('0xd')](function(_0x31fd23){_0x804a00=_0x31fd23;if(_0x277816){return db[_0x598c('0x8')]['update']({'closeReason':_0x598c('0xe'),'disposition':_0x598c('0xf'),'closed':!![],'closedAt':moment()[_0x598c('0x10')](_0x598c('0x11'))},{'where':{'id':_['map'](_0x804a00||[],'id')}});}})[_0x598c('0xd')](function(_0x5968cf){for(var _0x2ef0de=0x0;_0x2ef0de<_0x804a00[_0x598c('0x12')];_0x2ef0de++){io['emit'](_0x598c('0x13'),{'id':_0x804a00[_0x2ef0de]['id'],'closed':!![]});}})[_0x598c('0x14')](function(_0x55a8f8){console[_0x598c('0x15')](_0x55a8f8);});}exports[_0x598c('0x16')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index f0162d0..99c55aa 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 _0x3cb9=['status','message','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','runReport','catch','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','findAll','keys','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','cron','active','isBetween','startAt','endAt','add','stop\x20cron','update','update\x20cron','run','start','lodash','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','auth','user','format','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','basename','extname','join','existsSync','Sent','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify'];(function(_0x4ac1f8,_0x4cbcbe){var _0x5c71bd=function(_0x321a69){while(--_0x321a69){_0x4ac1f8['push'](_0x4ac1f8['shift']());}};_0x5c71bd(++_0x4cbcbe);}(_0x3cb9,0x19b));var _0x93cb=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x3cb9[_0x4b2436];return _0x4f5ab2;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require(_0x93cb('0x0'));var moment=require('moment');var CronJobManager=require(_0x93cb('0x1'));var jayson=require(_0x93cb('0x2'));var BPromise=require(_0x93cb('0x3'));var logger=require(_0x93cb('0x4'))(_0x93cb('0x5'));var db=require(_0x93cb('0x6'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x93cb('0x7'));var client=jayson[_0x93cb('0x8')][_0x93cb('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x20c049,_0x18858b){return function(){logger[_0x93cb('0xa')](_0x93cb('0xb'),_0x20c049[_0x93cb('0xc')]);var _0x1cd5a1=!![];var _0x9243b8={'tls':{'rejectUnauthorized':![]}};if(_0x20c049[_0x93cb('0xd')][_0x93cb('0xe')]['service']){_0x9243b8[_0x93cb('0xf')]=_0x20c049['MailAccount'][_0x93cb('0xe')][_0x93cb('0xf')];}else{_0x9243b8[_0x93cb('0x10')]=_0x20c049[_0x93cb('0xd')][_0x93cb('0xe')][_0x93cb('0x10')];_0x9243b8[_0x93cb('0x11')]=_0x20c049[_0x93cb('0xd')]['Smtp'][_0x93cb('0x11')];_0x9243b8[_0x93cb('0x12')]=_0x20c049[_0x93cb('0xd')][_0x93cb('0xe')][_0x93cb('0x12')];}if(_0x20c049[_0x93cb('0xd')][_0x93cb('0xe')]['authentication']){_0x9243b8[_0x93cb('0x13')]={'user':_0x20c049['MailAccount'][_0x93cb('0xe')][_0x93cb('0x14')],'pass':_0x20c049[_0x93cb('0xd')]['Smtp']['pass']};}var _0x1847e7={'account':_0x9243b8,'message':{'from':util[_0x93cb('0x15')]('\x22%s\x22\x20<%s>',_0x20c049[_0x93cb('0xd')]['name'],_0x20c049[_0x93cb('0xd')][_0x93cb('0xc')]||_0x20c049[_0x93cb('0xd')]['Smtp'][_0x93cb('0x14')]),'to':_0x20c049[_0x93cb('0xc')],'cc':_0x20c049['cc'],'bcc':_0x20c049[_0x93cb('0x16')],'subject':util[_0x93cb('0x15')](_0x93cb('0x17'),_0x18858b[_0x93cb('0x18')],_0x20c049[_0x93cb('0x19')],_0x20c049[_0x93cb('0x1a')])}};var _0x318e0a=path['join'](__dirname,_0x93cb('0x1b'));var _0x167dad=_0x18858b[_0x93cb('0x1c')];var _0x438274=util[_0x93cb('0x15')](_0x93cb('0x1d'),path[_0x93cb('0x1e')](_0x18858b[_0x93cb('0x1c')],path[_0x93cb('0x1f')](_0x18858b[_0x93cb('0x1c')])),'zip');var _0x5028fe=path[_0x93cb('0x20')](_0x318e0a,_0x167dad);var _0x3fc45d=path[_0x93cb('0x20')](_0x318e0a,_0x438274);if(fs[_0x93cb('0x21')](_0x5028fe)){_0x18858b['status']=_0x93cb('0x22');_0x1847e7['message'][_0x93cb('0x23')]=[{'filename':_0x167dad,'path':_0x5028fe}];_0x1847e7['message'][_0x93cb('0x24')]=util[_0x93cb('0x15')](_0x93cb('0x25'),JSON[_0x93cb('0x26')](_0x18858b,null,0x2));}else if(fs[_0x93cb('0x21')](_0x3fc45d)){_0x18858b[_0x93cb('0x27')]=_0x93cb('0x22');_0x1847e7[_0x93cb('0x28')][_0x93cb('0x23')]=[{'filename':_0x438274,'path':_0x3fc45d}];}else{_0x1847e7[_0x93cb('0x28')][_0x93cb('0x24')]=_0x93cb('0x29');if(!_0x20c049['sendIfEmpty']){_0x1cd5a1=![];logger[_0x93cb('0xa')](_0x93cb('0x2a'));}}if(_0x1cd5a1){return client[_0x93cb('0x2b')](_0x93cb('0x2c'),_0x1847e7)[_0x93cb('0x2d')](function(_0x3eed4a){if(_0x3eed4a[_0x93cb('0x2e')]){return logger['error']('error\x20mail',JSON[_0x93cb('0x26')](_0x3eed4a));}return logger['info']('email\x20sent');})['catch'](function(_0x4666b6){return logger[_0x93cb('0x2e')](_0x93cb('0x2f'),JSON[_0x93cb('0x26')](_0x4666b6));});}};}function handleError(){return function(_0x585686){return logger[_0x93cb('0x2e')](JSON[_0x93cb('0x26')](_0x585686));};}function handleResult(_0x47e6f8){return function(_0x3b60b3){logger[_0x93cb('0xa')](_0x93cb('0x30'),JSON['stringify'](_0x3b60b3));if(_0x47e6f8[_0x93cb('0xd')]&&_0x47e6f8[_0x93cb('0xd')][_0x93cb('0xe')]&&!_[_0x93cb('0x31')](_0x47e6f8[_0x93cb('0xc')])){setTimeout(handleSendEmail(_0x47e6f8,_0x3b60b3),0x3c*0x3e8);}};}function handleJob(_0x3526d5){return function(){try{if(_[_0x93cb('0x31')](_0x3526d5['subtractNumber'])){return logger[_0x93cb('0xa')](_0x93cb('0x32'));}if(_[_0x93cb('0x31')](_0x3526d5[_0x93cb('0x1a')])){return logger[_0x93cb('0xa')](_0x93cb('0x33'));}var _0x3b9751={'startDate':moment()[_0x93cb('0x34')](_0x3526d5[_0x93cb('0x19')],_0x3526d5[_0x93cb('0x1a')])[_0x93cb('0x15')](_0x93cb('0x35')),'endDate':moment()[_0x93cb('0x15')](_0x93cb('0x35')),'type':_0x93cb('0x36'),'output':_0x3526d5['output'],'name':_0x3526d5[_0x93cb('0x18')]};if(!_[_0x93cb('0x31')](_0x3526d5['DefaultReportId'])){logger[_0x93cb('0xa')]('exec\x20defaul\x20report\x20id:%s',_0x3526d5[_0x93cb('0x37')]);return analyticDefaultReportController[_0x93cb('0x38')]({'id':_0x3526d5['DefaultReportId']},_0x3b9751)[_0x93cb('0x2d')](handleResult(_0x3526d5))[_0x93cb('0x39')](handleError());}if(!_[_0x93cb('0x31')](_0x3526d5['CustomReportId'])){logger[_0x93cb('0xa')](_0x93cb('0x3a'),_0x3526d5[_0x93cb('0x3b')]);return analyticCustomReportController[_0x93cb('0x38')]({'id':_0x3526d5['CustomReportId']},_0x3b9751)[_0x93cb('0x2d')](handleResult(_0x3526d5))[_0x93cb('0x39')](handleError());}}catch(_0x1563c0){logger['error'](JSON[_0x93cb('0x26')](_0x1563c0));}return logger[_0x93cb('0xa')](_0x93cb('0x3c'));};}function getJobs(_0x1daedd){var _0x431b2c={};if(_0x1daedd){_0x431b2c['id']=_0x1daedd;}return db[_0x93cb('0x3d')][_0x93cb('0x3e')]({'where':_0x431b2c,'include':[{'model':db[_0x93cb('0xd')],'attributes':['id',_0x93cb('0x18'),_0x93cb('0xc')],'include':[{'model':db['MailServerOut'],'as':_0x93cb('0xe')}]}]})[_0x93cb('0x2d')](function(_0x331354){var _0x55ccb4=_[_0x93cb('0x3f')](manager[_0x93cb('0x40')]);var _0x2fde41=_[_0x93cb('0x41')](_0x331354,function(_0x24878b){return _0x24878b['id'][_0x93cb('0x42')]();});var _0x5c59ca=_[_0x93cb('0x43')](_0x331354,function(_0x2d0671){return _0x2d0671['id'][_0x93cb('0x42')]();});var _0x5eaac6=_0x1daedd?_0x2fde41:_[_0x93cb('0x44')](_0x2fde41,_0x55ccb4);var _0x67a400=_[_0x93cb('0x45')](_0x2fde41,_0x55ccb4);var _0x5f2e97=_[_0x93cb('0x44')](_0x55ccb4,_0x2fde41);var _0x496117;var _0x5baacd;for(_0x496117=0x0;_0x496117<_0x5f2e97[_0x93cb('0x46')]&&!_0x1daedd;_0x496117+=0x1){_0x5baacd=_0x5f2e97[_0x496117][_0x93cb('0x42')]();if(manager[_0x93cb('0x47')](_0x5baacd)){manager[_0x93cb('0x48')](_0x5baacd);manager[_0x93cb('0x49')](_0x5baacd);logger[_0x93cb('0xa')](_0x93cb('0x4a'),_0x5baacd);}}logger[_0x93cb('0xa')](_0x93cb('0x4b'),JSON[_0x93cb('0x26')](_0x5eaac6));for(_0x496117=0x0;_0x496117<_0x5eaac6[_0x93cb('0x46')];_0x496117+=0x1){_0x5baacd=_0x5eaac6[_0x496117][_0x93cb('0x42')]();logger[_0x93cb('0xa')](_0x93cb('0x4c'),_0x5baacd);if(_0x1daedd){logger[_0x93cb('0xa')](_0x93cb('0x4d'),_0x1daedd);logger[_0x93cb('0xa')](JSON[_0x93cb('0x26')](_0x5c59ca[_0x5baacd]));BPromise[_0x93cb('0x4e')]()[_0x93cb('0x2d')](handleJob(_0x5c59ca[_0x5baacd]));logger[_0x93cb('0xa')]('run\x20job',_0x5c59ca[_0x5baacd][_0x93cb('0x18')],_0x5c59ca[_0x5baacd][_0x93cb('0x4f')]);}else if(_0x5c59ca[_0x5baacd]['cron']&&_0x5c59ca[_0x5baacd][_0x93cb('0x50')]&&moment()[_0x93cb('0x51')](_0x5c59ca[_0x5baacd][_0x93cb('0x52')],_0x5c59ca[_0x5baacd][_0x93cb('0x53')])){manager[_0x93cb('0x54')](_0x5baacd,_0x5c59ca[_0x5baacd]['cron'],handleJob(_0x5c59ca[_0x5baacd]));manager['start'](_0x5baacd);logger[_0x93cb('0xa')]('add\x20cron',_0x5c59ca[_0x5baacd][_0x93cb('0x18')],_0x5c59ca[_0x5baacd][_0x93cb('0x4f')]);}else if(manager[_0x93cb('0x47')](_0x5baacd)){manager[_0x93cb('0x48')](_0x5baacd);manager['deleteJob'](_0x5baacd);logger[_0x93cb('0xa')](_0x93cb('0x55'),_0x5c59ca[_0x5baacd][_0x93cb('0x18')],_0x5c59ca[_0x5baacd][_0x93cb('0x4f')]);}}for(_0x496117=0x0,_0x5baacd;_0x496117<_0x67a400[_0x93cb('0x46')]&&!_0x1daedd;_0x496117+=0x1){_0x5baacd=_0x67a400[_0x496117][_0x93cb('0x42')]();if(manager[_0x93cb('0x47')](_0x5baacd)){if(_0x5c59ca[_0x5baacd][_0x93cb('0x4f')]&&_0x5c59ca[_0x5baacd]['active']&&moment()[_0x93cb('0x51')](_0x5c59ca[_0x5baacd][_0x93cb('0x52')],_0x5c59ca[_0x5baacd][_0x93cb('0x53')])){manager[_0x93cb('0x56')](_0x5baacd,_0x5c59ca[_0x5baacd]['cron'],handleJob(_0x5c59ca[_0x5baacd]));logger[_0x93cb('0xa')](_0x93cb('0x57'),_0x5c59ca[_0x5baacd][_0x93cb('0x18')],_0x5c59ca[_0x5baacd][_0x93cb('0x4f')]);}else{manager[_0x93cb('0x48')](_0x5baacd);manager['deleteJob'](_0x5baacd);logger['info'](_0x93cb('0x55'),_0x5c59ca[_0x5baacd][_0x93cb('0x18')],_0x5c59ca[_0x5baacd]['cron']);}}}})[_0x93cb('0x39')](function(_0x597792){logger['error'](JSON['stringify'](_0x597792));});}exports[_0x93cb('0x58')]=function(_0x54aa32){return getJobs(_0x54aa32);};exports[_0x93cb('0x59')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x9358=['path','moment','cron-job-manager','jayson/promise','../logger','schedule','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','service','Smtp','host','MailAccount','port','secure','auth','user','format','\x22%s\x22\x20<%s>','name','email','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','existsSync','message','text','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','error\x20mail','stringify','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','DefaultReportId','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','toString','difference','intersection','length','exists','deleteJob','delete\x20cron','toRun','index','resolve','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop','stop\x20cron','update','run','util'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x9358,0x1a8));var _0x8935=function(_0x1d5aac,_0x59c1f0){_0x1d5aac=_0x1d5aac-0x0;var _0x48832d=_0x9358[_0x1d5aac];return _0x48832d;};'use strict';var fs=require('fs');var util=require(_0x8935('0x0'));var path=require(_0x8935('0x1'));var _=require('lodash');var moment=require(_0x8935('0x2'));var CronJobManager=require(_0x8935('0x3'));var jayson=require(_0x8935('0x4'));var BPromise=require('bluebird');var logger=require(_0x8935('0x5'))(_0x8935('0x6'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x8935('0x7'));var client=jayson[_0x8935('0x8')][_0x8935('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5bf0f9,_0x576ad9){return function(){logger[_0x8935('0xa')](_0x8935('0xb'),_0x5bf0f9['email']);var _0x428408=!![];var _0x294dc2={'tls':{'rejectUnauthorized':![]}};if(_0x5bf0f9['MailAccount']['Smtp']['service']){_0x294dc2[_0x8935('0xc')]=_0x5bf0f9['MailAccount'][_0x8935('0xd')][_0x8935('0xc')];}else{_0x294dc2[_0x8935('0xe')]=_0x5bf0f9[_0x8935('0xf')][_0x8935('0xd')][_0x8935('0xe')];_0x294dc2[_0x8935('0x10')]=_0x5bf0f9[_0x8935('0xf')][_0x8935('0xd')]['port'];_0x294dc2[_0x8935('0x11')]=_0x5bf0f9['MailAccount'][_0x8935('0xd')][_0x8935('0x11')];}if(_0x5bf0f9['MailAccount']['Smtp']['authentication']){_0x294dc2[_0x8935('0x12')]={'user':_0x5bf0f9[_0x8935('0xf')][_0x8935('0xd')][_0x8935('0x13')],'pass':_0x5bf0f9['MailAccount']['Smtp']['pass']};}var _0x2a831c={'account':_0x294dc2,'message':{'from':util[_0x8935('0x14')](_0x8935('0x15'),_0x5bf0f9[_0x8935('0xf')][_0x8935('0x16')],_0x5bf0f9['MailAccount'][_0x8935('0x17')]||_0x5bf0f9[_0x8935('0xf')][_0x8935('0xd')]['user']),'to':_0x5bf0f9['email'],'cc':_0x5bf0f9['cc'],'bcc':_0x5bf0f9['bcc'],'subject':util[_0x8935('0x14')](_0x8935('0x18'),_0x576ad9[_0x8935('0x16')],_0x5bf0f9[_0x8935('0x19')],_0x5bf0f9[_0x8935('0x1a')])}};var _0x551223=path[_0x8935('0x1b')](__dirname,_0x8935('0x1c'));var _0x6bac58=_0x576ad9[_0x8935('0x1d')];var _0x1e70d0=util[_0x8935('0x14')](_0x8935('0x1e'),path[_0x8935('0x1f')](_0x576ad9['savename'],path[_0x8935('0x20')](_0x576ad9[_0x8935('0x1d')])),'zip');var _0x12250=path['join'](_0x551223,_0x6bac58);var _0x4223a6=path[_0x8935('0x1b')](_0x551223,_0x1e70d0);if(fs[_0x8935('0x21')](_0x12250)){_0x576ad9['status']='Sent';_0x2a831c[_0x8935('0x22')]['attachments']=[{'filename':_0x6bac58,'path':_0x12250}];_0x2a831c['message'][_0x8935('0x23')]=util[_0x8935('0x14')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON['stringify'](_0x576ad9,null,0x2));}else if(fs[_0x8935('0x21')](_0x4223a6)){_0x576ad9['status']=_0x8935('0x24');_0x2a831c[_0x8935('0x22')]['attachments']=[{'filename':_0x1e70d0,'path':_0x4223a6}];}else{_0x2a831c['message']['text']=_0x8935('0x25');if(!_0x5bf0f9[_0x8935('0x26')]){_0x428408=![];logger['info'](_0x8935('0x27'));}}if(_0x428408){return client[_0x8935('0x28')](_0x8935('0x29'),_0x2a831c)[_0x8935('0x2a')](function(_0x3c9d0c){if(_0x3c9d0c[_0x8935('0x2b')]){return logger[_0x8935('0x2b')](_0x8935('0x2c'),JSON[_0x8935('0x2d')](_0x3c9d0c));}return logger[_0x8935('0xa')](_0x8935('0x2e'));})[_0x8935('0x2f')](function(_0x16901b){return logger[_0x8935('0x2b')](_0x8935('0x2c'),JSON['stringify'](_0x16901b));});}};}function handleError(){return function(_0x59b20d){return logger[_0x8935('0x2b')](JSON['stringify'](_0x59b20d));};}function handleResult(_0x8350b5){return function(_0x42b039){logger[_0x8935('0xa')](_0x8935('0x30'),JSON[_0x8935('0x2d')](_0x42b039));if(_0x8350b5[_0x8935('0xf')]&&_0x8350b5[_0x8935('0xf')][_0x8935('0xd')]&&!_['isNil'](_0x8350b5['email'])){setTimeout(handleSendEmail(_0x8350b5,_0x42b039),0x3c*0x3e8);}};}function handleJob(_0x501931){return function(){try{if(_[_0x8935('0x31')](_0x501931[_0x8935('0x19')])){return logger[_0x8935('0xa')](_0x8935('0x32'));}if(_[_0x8935('0x31')](_0x501931[_0x8935('0x1a')])){return logger[_0x8935('0xa')](_0x8935('0x33'));}var _0x1aabee={'startDate':moment()['subtract'](_0x501931[_0x8935('0x19')],_0x501931[_0x8935('0x1a')])[_0x8935('0x14')](_0x8935('0x34')),'endDate':moment()[_0x8935('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x501931['output'],'name':_0x501931[_0x8935('0x16')]};if(!_[_0x8935('0x31')](_0x501931[_0x8935('0x35')])){logger[_0x8935('0xa')]('exec\x20defaul\x20report\x20id:%s',_0x501931[_0x8935('0x35')]);return analyticDefaultReportController[_0x8935('0x36')]({'id':_0x501931[_0x8935('0x35')]},_0x1aabee)['then'](handleResult(_0x501931))[_0x8935('0x2f')](handleError());}if(!_['isNil'](_0x501931[_0x8935('0x37')])){logger[_0x8935('0xa')]('exec\x20custom\x20report\x20id:%s',_0x501931[_0x8935('0x37')]);return analyticCustomReportController[_0x8935('0x36')]({'id':_0x501931['CustomReportId']},_0x1aabee)['then'](handleResult(_0x501931))[_0x8935('0x2f')](handleError());}}catch(_0x577cd5){logger[_0x8935('0x2b')](JSON[_0x8935('0x2d')](_0x577cd5));}return logger[_0x8935('0xa')](_0x8935('0x38'));};}function getJobs(_0x25fa1b){var _0x4b26b2={};if(_0x25fa1b){_0x4b26b2['id']=_0x25fa1b;}return db[_0x8935('0x39')][_0x8935('0x3a')]({'where':_0x4b26b2,'include':[{'model':db['MailAccount'],'attributes':['id','name',_0x8935('0x17')],'include':[{'model':db[_0x8935('0x3b')],'as':'Smtp'}]}]})[_0x8935('0x2a')](function(_0x3b78b4){var _0x46e23d=_[_0x8935('0x3c')](manager[_0x8935('0x3d')]);var _0x325be5=_[_0x8935('0x3e')](_0x3b78b4,function(_0x2867cf){return _0x2867cf['id'][_0x8935('0x3f')]();});var _0x5a9783=_['keyBy'](_0x3b78b4,function(_0x4ac04e){return _0x4ac04e['id']['toString']();});var _0x2e8ef5=_0x25fa1b?_0x325be5:_[_0x8935('0x40')](_0x325be5,_0x46e23d);var _0x4e7108=_[_0x8935('0x41')](_0x325be5,_0x46e23d);var _0x59abe9=_['difference'](_0x46e23d,_0x325be5);var _0x33b4e0;var _0xc19920;for(_0x33b4e0=0x0;_0x33b4e0<_0x59abe9[_0x8935('0x42')]&&!_0x25fa1b;_0x33b4e0+=0x1){_0xc19920=_0x59abe9[_0x33b4e0]['toString']();if(manager[_0x8935('0x43')](_0xc19920)){manager['stop'](_0xc19920);manager[_0x8935('0x44')](_0xc19920);logger[_0x8935('0xa')](_0x8935('0x45'),_0xc19920);}}logger[_0x8935('0xa')](_0x8935('0x46'),JSON[_0x8935('0x2d')](_0x2e8ef5));for(_0x33b4e0=0x0;_0x33b4e0<_0x2e8ef5[_0x8935('0x42')];_0x33b4e0+=0x1){_0xc19920=_0x2e8ef5[_0x33b4e0][_0x8935('0x3f')]();logger[_0x8935('0xa')](_0x8935('0x47'),_0xc19920);if(_0x25fa1b){logger[_0x8935('0xa')]('my\x20id',_0x25fa1b);logger[_0x8935('0xa')](JSON[_0x8935('0x2d')](_0x5a9783[_0xc19920]));BPromise[_0x8935('0x48')]()['then'](handleJob(_0x5a9783[_0xc19920]));logger[_0x8935('0xa')]('run\x20job',_0x5a9783[_0xc19920][_0x8935('0x16')],_0x5a9783[_0xc19920][_0x8935('0x49')]);}else if(_0x5a9783[_0xc19920][_0x8935('0x49')]&&_0x5a9783[_0xc19920][_0x8935('0x4a')]&&moment()[_0x8935('0x4b')](_0x5a9783[_0xc19920][_0x8935('0x4c')],_0x5a9783[_0xc19920][_0x8935('0x4d')])){manager[_0x8935('0x4e')](_0xc19920,_0x5a9783[_0xc19920][_0x8935('0x49')],handleJob(_0x5a9783[_0xc19920]));manager[_0x8935('0x4f')](_0xc19920);logger['info'](_0x8935('0x50'),_0x5a9783[_0xc19920][_0x8935('0x16')],_0x5a9783[_0xc19920][_0x8935('0x49')]);}else if(manager['exists'](_0xc19920)){manager[_0x8935('0x51')](_0xc19920);manager[_0x8935('0x44')](_0xc19920);logger[_0x8935('0xa')](_0x8935('0x52'),_0x5a9783[_0xc19920]['name'],_0x5a9783[_0xc19920][_0x8935('0x49')]);}}for(_0x33b4e0=0x0,_0xc19920;_0x33b4e0<_0x4e7108['length']&&!_0x25fa1b;_0x33b4e0+=0x1){_0xc19920=_0x4e7108[_0x33b4e0][_0x8935('0x3f')]();if(manager['exists'](_0xc19920)){if(_0x5a9783[_0xc19920][_0x8935('0x49')]&&_0x5a9783[_0xc19920][_0x8935('0x4a')]&&moment()[_0x8935('0x4b')](_0x5a9783[_0xc19920][_0x8935('0x4c')],_0x5a9783[_0xc19920][_0x8935('0x4d')])){manager[_0x8935('0x53')](_0xc19920,_0x5a9783[_0xc19920][_0x8935('0x49')],handleJob(_0x5a9783[_0xc19920]));logger[_0x8935('0xa')]('update\x20cron',_0x5a9783[_0xc19920][_0x8935('0x16')],_0x5a9783[_0xc19920][_0x8935('0x49')]);}else{manager[_0x8935('0x51')](_0xc19920);manager[_0x8935('0x44')](_0xc19920);logger[_0x8935('0xa')]('stop\x20cron',_0x5a9783[_0xc19920][_0x8935('0x16')],_0x5a9783[_0xc19920][_0x8935('0x49')]);}}}})[_0x8935('0x2f')](function(_0x24a0e3){logger[_0x8935('0x2b')](JSON[_0x8935('0x2d')](_0x24a0e3));});}exports[_0x8935('0x54')]=function(_0x41bc36){return getJobs(_0x41bc36);};exports['start']=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 4e1221b..530d673 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0bc9=['then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','util','../mysqldb','push','Innocenzo','innocenzo.biondo','now','Biondo','@xcally.com','CmContact','destroy'];(function(_0x526074,_0x5e5d09){var _0x83c6c8=function(_0x571483){while(--_0x571483){_0x526074['push'](_0x526074['shift']());}};_0x83c6c8(++_0x5e5d09);}(_0x0bc9,0x1ee));var _0x90bc=function(_0xb9b2f5,_0x2b16cd){_0xb9b2f5=_0xb9b2f5-0x0;var _0x20b906=_0x0bc9[_0xb9b2f5];return _0x20b906;};'use strict';var util=require(_0x90bc('0x0'));var db=require(_0x90bc('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x90bc('0x2')]({'id':i,'firstName':_0x90bc('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x90bc('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x90bc('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x90bc('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x90bc('0x5')](),'updatedAt':Date[_0x90bc('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x90bc('0x2')]({'id':i,'firstName':_0x90bc('0x3')+i,'lastName':_0x90bc('0x6')+i,'phone':0xf879fb460+i,'email':_0x90bc('0x4')+i+_0x90bc('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x90bc('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x90bc('0x5')](),'updatedAt':Date[_0x90bc('0x5')]()});}db[_0x90bc('0x8')][_0x90bc('0x9')]({'where':{}})[_0x90bc('0xa')](function(){return db['CmContact'][_0x90bc('0xb')](contacts);})[_0x90bc('0xa')](function(){console[_0x90bc('0xc')](_0x90bc('0xd'),_0x90bc('0xe'));return db[_0x90bc('0xf')]['destroy']({'where':{}});})[_0x90bc('0xa')](function(){return db[_0x90bc('0xf')][_0x90bc('0xb')](hopper);})[_0x90bc('0xa')](function(){console[_0x90bc('0xc')](_0x90bc('0xd'),_0x90bc('0x10'));return db[_0x90bc('0x8')][_0x90bc('0xb')](contacts2);})[_0x90bc('0xa')](function(){console[_0x90bc('0xc')]('finished\x20populating',_0x90bc('0x11'));return db[_0x90bc('0xf')]['bulkCreate'](hopper2);})[_0x90bc('0xa')](function(){console[_0x90bc('0xc')](_0x90bc('0xd'),'hopper2');})['catch'](function(_0x4ee222){console[_0x90bc('0xc')](_0x4ee222);}); \ No newline at end of file +var _0x2b7a=['@xcally.com','push','now','CmContact','destroy','bulkCreate','then','finished\x20populating','CmHopper','hopper1','log','Innocenzo','Biondo','innocenzo.biondo'];(function(_0x432d73,_0x241c63){var _0x14e72a=function(_0x2fdc20){while(--_0x2fdc20){_0x432d73['push'](_0x432d73['shift']());}};_0x14e72a(++_0x241c63);}(_0x2b7a,0x131));var _0xa2b7=function(_0x158728,_0x48244d){_0x158728=_0x158728-0x0;var _0x196356=_0x2b7a[_0x158728];return _0x196356;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xa2b7('0x0')+i,'lastName':_0xa2b7('0x1')+i,'phone':0xf879fb460+i,'email':_0xa2b7('0x2')+i+_0xa2b7('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xa2b7('0x4')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa2b7('0x5')](),'updatedAt':Date[_0xa2b7('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xa2b7('0x0')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xa2b7('0x4')]({'id':i,'active':![],'scheduledat':Date[_0xa2b7('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db[_0xa2b7('0x6')][_0xa2b7('0x7')]({'where':{}})['then'](function(){return db['CmContact'][_0xa2b7('0x8')](contacts);})[_0xa2b7('0x9')](function(){console['log'](_0xa2b7('0xa'),'contacts1');return db[_0xa2b7('0xb')][_0xa2b7('0x7')]({'where':{}});})['then'](function(){return db[_0xa2b7('0xb')][_0xa2b7('0x8')](hopper);})[_0xa2b7('0x9')](function(){console['log'](_0xa2b7('0xa'),_0xa2b7('0xc'));return db[_0xa2b7('0x6')][_0xa2b7('0x8')](contacts2);})[_0xa2b7('0x9')](function(){console[_0xa2b7('0xd')](_0xa2b7('0xa'),'contacts2');return db[_0xa2b7('0xb')]['bulkCreate'](hopper2);})[_0xa2b7('0x9')](function(){console['log']('finished\x20populating','hopper2');})['catch'](function(_0x547aed){console[_0xa2b7('0xd')](_0x547aed);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index dbfc621..f1e94c4 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb23b=['actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','password','friend','wss','ulaw','yes','/etc/pki/tls/private/motion.key'];(function(_0x5c4669,_0x7f9bcd){var _0xf18b6a=function(_0x5ba22d){while(--_0x5ba22d){_0x5c4669['push'](_0x5c4669['shift']());}};_0xf18b6a(++_0x7f9bcd);}(_0xb23b,0x148));var _0xbb23=function(_0x302579,_0x15820f){_0x302579=_0x302579-0x0;var _0x3f4cbc=_0xb23b[_0x302579];return _0x3f4cbc;};'use strict';var util=require(_0xbb23('0x0'));var db=require(_0xbb23('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xbb23('0x2')]({'name':util[_0xbb23('0x3')]('%s%s','agent',i),'fullname':util[_0xbb23('0x3')](_0xbb23('0x4'),'agent',i),'email':util[_0xbb23('0x3')]('%s%s@xcally.com',_0xbb23('0x5'),i),'role':_0xbb23('0x5'),'password':_0xbb23('0x6'),'internal':0xfa0+i,'type':_0xbb23('0x7'),'transport':['udp','ws',_0xbb23('0x8')],'disallow':['all'],'allow':[_0xbb23('0x9')],'defaultuser':util[_0xbb23('0x3')](_0xbb23('0x4'),_0xbb23('0x5'),i),'encryption':_0xbb23('0xa'),'avpf':'yes','force_avp':'yes','icesupport':_0xbb23('0xa'),'dtlsenable':_0xbb23('0xa'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xbb23('0xb'),'dtlssetup':_0xbb23('0xc'),'callerid':util['format'](_0xbb23('0xd'),util['format'](_0xbb23('0x4'),_0xbb23('0x5'),i),0xfa0+i)});}db[_0xbb23('0xe')][_0xbb23('0xf')](users)[_0xbb23('0x10')](function(){console[_0xbb23('0x11')](_0xbb23('0x12'));})[_0xbb23('0x13')](function(_0x2577c5){console[_0xbb23('0x11')](_0x2577c5);}); \ No newline at end of file +var _0x0836=['User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','format','agent','%s%s','%s%s@xcally.com','friend','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>'];(function(_0x3c6d35,_0x40d855){var _0x16510e=function(_0x347d16){while(--_0x347d16){_0x3c6d35['push'](_0x3c6d35['shift']());}};_0x16510e(++_0x40d855);}(_0x0836,0x16e));var _0x6083=function(_0x564671,_0x302639){_0x564671=_0x564671-0x0;var _0x30bc2a=_0x0836[_0x564671];return _0x30bc2a;};'use strict';var util=require(_0x6083('0x0'));var db=require(_0x6083('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x6083('0x2')]({'name':util[_0x6083('0x3')]('%s%s',_0x6083('0x4'),i),'fullname':util[_0x6083('0x3')](_0x6083('0x5'),'agent',i),'email':util[_0x6083('0x3')](_0x6083('0x6'),_0x6083('0x4'),i),'role':_0x6083('0x4'),'password':'password','internal':0xfa0+i,'type':_0x6083('0x7'),'transport':['udp','ws','wss'],'disallow':['all'],'allow':[_0x6083('0x8')],'defaultuser':util['format'](_0x6083('0x5'),_0x6083('0x4'),i),'encryption':_0x6083('0x9'),'avpf':_0x6083('0x9'),'force_avp':_0x6083('0x9'),'icesupport':_0x6083('0x9'),'dtlsenable':_0x6083('0x9'),'dtlsverify':'no','dtlscertfile':_0x6083('0xa'),'dtlsprivatekey':_0x6083('0xb'),'dtlssetup':_0x6083('0xc'),'callerid':util[_0x6083('0x3')](_0x6083('0xd'),util[_0x6083('0x3')](_0x6083('0x5'),'agent',i),0xfa0+i)});}db[_0x6083('0xe')][_0x6083('0xf')](users)[_0x6083('0x10')](function(){console[_0x6083('0x11')](_0x6083('0x12'));})[_0x6083('0x13')](function(_0x19cf5b){console[_0x6083('0x11')](_0x19cf5b);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index e8c2922..e9b078b 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeeb7=['request','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED','lodash','util','../mysqldb','name','Agents','User','role','telephone','agent','type','ivr','findOne','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','then','map','where','Campaign','format','%s:queue:%s','user:%s','query','find','handshake','ChatInteractions','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteractions','admin','voice:inbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','user','voice:outbound','userProfileId','VoiceQueue','SmsQueues','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','all','length','voice','chat','sms','mail','openchannel','campaign:%s:%s','leave','removeChatInteractions','emit','removeMailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','default','connection','setMaxListeners','address'];(function(_0x53e3de,_0x13da7b){var _0x7b905b=function(_0x29b56a){while(--_0x29b56a){_0x53e3de['push'](_0x53e3de['shift']());}};_0x7b905b(++_0x13da7b);}(_0xeeb7,0xbb));var _0x7eeb=function(_0x34d275,_0x5d84ee){_0x34d275=_0x34d275-0x0;var _0x1379cc=_0xeeb7[_0x34d275];return _0x1379cc;};'use strict';var _=require(_0x7eeb('0x0'));var util=require(_0x7eeb('0x1'));var BPromise=require('bluebird');var db=require(_0x7eeb('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x7eeb('0x3')],'include':[{'as':_0x7eeb('0x4'),'model':db[_0x7eeb('0x5')],'attributes':['id','name',_0x7eeb('0x6')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x7eeb('0x3')],'where':{'role':_0x7eeb('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x7eeb('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x7eeb('0x3')],'where':{'role':_0x7eeb('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x7eeb('0x3'),_0x7eeb('0x9')],'where':{'type':_0x7eeb('0xa')}};function getAssociatedResources(_0x400e22,_0x21819b,_0x39b192){return db['UserProfileSection'][_0x7eeb('0xb')]({'where':{'name':_0x400e22,'userProfileId':_0x21819b},'raw':!![]})['then'](function(_0x5525ed){if(_0x5525ed){if(_0x5525ed[_0x7eeb('0xc')]){switch(_0x400e22){case _0x7eeb('0xd'):case _0x7eeb('0xe'):case _0x7eeb('0xf'):case'SmsQueues':case _0x7eeb('0x10'):case _0x7eeb('0x11'):return db[_0x39b192][_0x7eeb('0x12')](queryQueues);case'Telephones':return db[_0x39b192]['findAll'](queryTelephones);case _0x7eeb('0x13'):return db[_0x39b192][_0x7eeb('0x12')](queryTrunks);case _0x7eeb('0x14'):return db[_0x39b192][_0x7eeb('0x12')](queryCampaigns);}}else{return db[_0x7eeb('0x15')][_0x7eeb('0x12')]({'attributes':[_0x7eeb('0x16')],'where':{'sectionId':_0x5525ed['id']},'raw':!![]})[_0x7eeb('0x17')](function(_0x1cca86){if(_0x1cca86){var _0x8a5c7a={'where':{'id':_[_0x7eeb('0x18')](_0x1cca86,_0x7eeb('0x16'))},'raw':!![]};switch(_0x39b192){case _0x7eeb('0x5'):_0x8a5c7a[_0x7eeb('0x19')][_0x7eeb('0x6')]='telephone';break;case _0x7eeb('0x1a'):_0x8a5c7a['where'][_0x7eeb('0x9')]=_0x7eeb('0xa');break;}return db[_0x39b192]['findAll'](_0x8a5c7a);}else{return[];}});}}else{return[];}})['then'](function(_0x1d1161){return _0x1d1161;});}function joinOrLeaveQueues(_0x4dff7a,_0x21b349,_0x16e85a,_0x5b5b82){_0x4dff7a[_0x21b349](util[_0x7eeb('0x1b')](_0x7eeb('0x1c'),_0x16e85a,_0x5b5b82[_0x7eeb('0x3')]));if(_0x5b5b82[_0x7eeb('0x4')]){for(var _0x510636=0x0;_0x510636<_0x5b5b82[_0x7eeb('0x4')]['length'];_0x510636+=0x1){_0x4dff7a[_0x21b349](util[_0x7eeb('0x1b')](_0x7eeb('0x1d'),_0x5b5b82['Agents'][_0x510636][_0x7eeb('0x3')]));}}}function joinOrLeave(_0x510f5e,_0x5832a5,_0x2e9923){var _0x2ac5e8;if(_0x510f5e['handshake'][_0x7eeb('0x1e')]['id']){db[_0x7eeb('0x5')][_0x7eeb('0x1f')]({'attributes':['id',_0x7eeb('0x3'),_0x7eeb('0x6'),'userProfileId'],'where':{'id':_0x510f5e[_0x7eeb('0x20')][_0x7eeb('0x1e')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x7eeb('0x21'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x7eeb('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x7eeb('0x23')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x7eeb('0x24')],'as':_0x7eeb('0x25'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x7eeb('0x26'),'attributes':['id'],'raw':!![]}]})[_0x7eeb('0x17')](function(_0x1d9cdc){if(_0x1d9cdc){_0x2ac5e8=_0x1d9cdc;_0x510f5e[_0x5832a5](util[_0x7eeb('0x1b')](_0x7eeb('0x1d'),_0x1d9cdc[_0x7eeb('0x3')]));var _0x2a9b93=[];switch(_0x1d9cdc['role']){case _0x7eeb('0x27'):_0x510f5e[_0x5832a5](_0x7eeb('0x28'));_0x510f5e[_0x5832a5]('voice:outbound');if(queryQueues[_0x7eeb('0x29')](_0x7eeb('0x2a'))){delete queryQueues[_0x7eeb('0x2a')];}_0x2a9b93[_0x7eeb('0x2b')](db['VoiceQueue'][_0x7eeb('0x12')](queryQueues));_0x2a9b93[_0x7eeb('0x2b')](db[_0x7eeb('0x2c')][_0x7eeb('0x12')](queryQueues));_0x2a9b93[_0x7eeb('0x2b')](db[_0x7eeb('0x2d')]['findAll'](queryQueues));_0x2a9b93['push'](db[_0x7eeb('0x2e')][_0x7eeb('0x12')](queryQueues));_0x2a9b93['push'](db[_0x7eeb('0x2f')][_0x7eeb('0x12')](queryQueues));_0x2a9b93[_0x7eeb('0x2b')](db['OpenchannelQueue'][_0x7eeb('0x12')](queryQueues));_0x2a9b93[_0x7eeb('0x2b')](db['User'][_0x7eeb('0x12')](queryTelephones));_0x2a9b93[_0x7eeb('0x2b')](db['Trunk'][_0x7eeb('0x12')](queryTrunks));_0x2a9b93[_0x7eeb('0x2b')](db[_0x7eeb('0x1a')][_0x7eeb('0x12')](queryCampaigns));_0x2a9b93[_0x7eeb('0x2b')](db[_0x7eeb('0x5')]['findAll'](queryAgents));break;case _0x7eeb('0x30'):_0x510f5e[_0x5832a5](_0x7eeb('0x28'));_0x510f5e[_0x5832a5](_0x7eeb('0x31'));_0x2a9b93[_0x7eeb('0x2b')](getAssociatedResources(_0x7eeb('0xd'),_0x1d9cdc[_0x7eeb('0x32')],_0x7eeb('0x33')));_0x2a9b93[_0x7eeb('0x2b')](getAssociatedResources(_0x7eeb('0xe'),_0x1d9cdc[_0x7eeb('0x32')],_0x7eeb('0x2c')));_0x2a9b93['push'](getAssociatedResources('FaxQueues',_0x1d9cdc[_0x7eeb('0x32')],_0x7eeb('0x2d')));_0x2a9b93[_0x7eeb('0x2b')](getAssociatedResources(_0x7eeb('0x34'),_0x1d9cdc[_0x7eeb('0x32')],_0x7eeb('0x2e')));_0x2a9b93[_0x7eeb('0x2b')](getAssociatedResources(_0x7eeb('0x10'),_0x1d9cdc[_0x7eeb('0x32')],_0x7eeb('0x2f')));_0x2a9b93[_0x7eeb('0x2b')](getAssociatedResources('OpenchannelQueues',_0x1d9cdc[_0x7eeb('0x32')],'OpenchannelQueue'));_0x2a9b93[_0x7eeb('0x2b')](getAssociatedResources('Telephones',_0x1d9cdc['userProfileId'],_0x7eeb('0x5')));_0x2a9b93[_0x7eeb('0x2b')](getAssociatedResources(_0x7eeb('0x13'),_0x1d9cdc[_0x7eeb('0x32')],_0x7eeb('0x35')));_0x2a9b93[_0x7eeb('0x2b')](getAssociatedResources(_0x7eeb('0x14'),_0x1d9cdc[_0x7eeb('0x32')],_0x7eeb('0x1a')));_0x2a9b93[_0x7eeb('0x2b')](db[_0x7eeb('0x5')][_0x7eeb('0x12')](queryAgents));break;case _0x7eeb('0x8'):_0x510f5e[_0x5832a5]('voice:inbound');_0x510f5e[_0x5832a5](_0x7eeb('0x31'));_0x2a9b93[_0x7eeb('0x2b')](_0x1d9cdc[_0x7eeb('0x36')]({'attributes':['id',_0x7eeb('0x3')]}));_0x2a9b93['push'](_0x1d9cdc[_0x7eeb('0x37')]({'attributes':['id','name']}));_0x2a9b93[_0x7eeb('0x2b')](_0x1d9cdc[_0x7eeb('0x38')]({'attributes':['id','name']}));_0x2a9b93[_0x7eeb('0x2b')](_0x1d9cdc[_0x7eeb('0x39')]({'attributes':['id',_0x7eeb('0x3')]}));_0x2a9b93[_0x7eeb('0x2b')](_0x1d9cdc['getMailQueues']({'attributes':['id',_0x7eeb('0x3')]}));_0x2a9b93['push'](_0x1d9cdc[_0x7eeb('0x3a')]({'attributes':['id',_0x7eeb('0x3')]}));break;}return BPromise[_0x7eeb('0x3b')](_0x2a9b93);}})[_0x7eeb('0x17')](function(_0x29a1f7){if(_0x29a1f7&&_0x29a1f7[_0x7eeb('0x3c')]){for(var _0xf5993b=0x0;_0xf5993b<_0x29a1f7[_0x7eeb('0x3c')];_0xf5993b+=0x1){for(var _0x3b1007=0x0;_0x3b1007<_0x29a1f7[_0xf5993b][_0x7eeb('0x3c')];_0x3b1007+=0x1){switch(_0xf5993b){case 0x0:joinOrLeaveQueues(_0x510f5e,_0x5832a5,_0x7eeb('0x3d'),_0x29a1f7[_0xf5993b][_0x3b1007]);break;case 0x1:joinOrLeaveQueues(_0x510f5e,_0x5832a5,_0x7eeb('0x3e'),_0x29a1f7[_0xf5993b][_0x3b1007]);break;case 0x2:joinOrLeaveQueues(_0x510f5e,_0x5832a5,'fax',_0x29a1f7[_0xf5993b][_0x3b1007]);break;case 0x3:joinOrLeaveQueues(_0x510f5e,_0x5832a5,_0x7eeb('0x3f'),_0x29a1f7[_0xf5993b][_0x3b1007]);break;case 0x4:joinOrLeaveQueues(_0x510f5e,_0x5832a5,_0x7eeb('0x40'),_0x29a1f7[_0xf5993b][_0x3b1007]);break;case 0x5:joinOrLeaveQueues(_0x510f5e,_0x5832a5,_0x7eeb('0x41'),_0x29a1f7[_0xf5993b][_0x3b1007]);break;case 0x6:_0x510f5e[_0x5832a5](util[_0x7eeb('0x1b')]('telephone:%s',_0x29a1f7[_0xf5993b][_0x3b1007][_0x7eeb('0x3')]));break;case 0x7:_0x510f5e[_0x5832a5](util[_0x7eeb('0x1b')]('trunk:%s',_0x29a1f7[_0xf5993b][_0x3b1007][_0x7eeb('0x3')]));break;case 0x8:_0x510f5e[_0x5832a5](util[_0x7eeb('0x1b')](_0x7eeb('0x42'),_0x29a1f7[_0xf5993b][_0x3b1007][_0x7eeb('0x9')],_0x29a1f7[_0xf5993b][_0x3b1007]['name']));break;case 0x9:_0x510f5e[_0x5832a5](util[_0x7eeb('0x1b')](_0x7eeb('0x1d'),_0x29a1f7[_0xf5993b][_0x3b1007][_0x7eeb('0x3')]));break;}}}}})[_0x7eeb('0x17')](function(){if(_0x5832a5===_0x7eeb('0x43')){var _0x185b9e=_[_0x7eeb('0x18')](_0x2ac5e8[_0x7eeb('0x21')],'id');return _0x2ac5e8[_0x7eeb('0x44')](_0x185b9e)[_0x7eeb('0x17')](function(){for(var _0x51966b=0x0;_0x51966b<_0x185b9e[_0x7eeb('0x3c')];_0x51966b+=0x1){_0x2e9923[_0x7eeb('0x45')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x185b9e[_0x51966b]),'UserId':Number(_0x2ac5e8['id'])});}});}})[_0x7eeb('0x17')](function(){if(_0x5832a5===_0x7eeb('0x43')){var _0x52cb13=_[_0x7eeb('0x18')](_0x2ac5e8[_0x7eeb('0x22')],'id');return _0x2ac5e8[_0x7eeb('0x46')](_0x52cb13)[_0x7eeb('0x17')](function(){for(var _0x4ee381=0x0;_0x4ee381<_0x52cb13['length'];_0x4ee381+=0x1){_0x2e9923[_0x7eeb('0x45')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x52cb13[_0x4ee381]),'UserId':Number(_0x2ac5e8['id'])});}});}})['then'](function(){if(_0x5832a5==='leave'){var _0x5bc205=_[_0x7eeb('0x18')](_0x2ac5e8['FaxInteractions'],'id');return _0x2ac5e8[_0x7eeb('0x47')](_0x5bc205)['then'](function(){for(var _0x671952=0x0;_0x671952<_0x5bc205['length'];_0x671952+=0x1){_0x2e9923['emit'](_0x7eeb('0x48'),{'FaxInteractionId':Number(_0x5bc205[_0x671952]),'UserId':Number(_0x2ac5e8['id'])});}});}})[_0x7eeb('0x17')](function(){if(_0x5832a5===_0x7eeb('0x43')){var _0x4216bc=_[_0x7eeb('0x18')](_0x2ac5e8['SmsInteractions'],'id');return _0x2ac5e8[_0x7eeb('0x49')](_0x4216bc)[_0x7eeb('0x17')](function(){for(var _0x3fc391=0x0;_0x3fc391<_0x4216bc[_0x7eeb('0x3c')];_0x3fc391+=0x1){_0x2e9923[_0x7eeb('0x45')](_0x7eeb('0x4a'),{'SmsInteractionId':Number(_0x4216bc[_0x3fc391]),'UserId':Number(_0x2ac5e8['id'])});}});}})['then'](function(){if(_0x5832a5===_0x7eeb('0x43')){var _0x3c4e54=_[_0x7eeb('0x18')](_0x2ac5e8['OpenchannelInteractions'],'id');return _0x2ac5e8[_0x7eeb('0x4b')](_0x3c4e54)[_0x7eeb('0x17')](function(){for(var _0x222120=0x0;_0x222120<_0x3c4e54[_0x7eeb('0x3c')];_0x222120+=0x1){_0x2e9923[_0x7eeb('0x45')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x3c4e54[_0x222120]),'UserId':Number(_0x2ac5e8['id'])});}});}})['catch'](function(_0x486dd7){_0x510f5e['log'](_0x486dd7);});}}function onDisconnect(_0x17f7e8,_0x513ed6){joinOrLeave(_0x17f7e8,_0x7eeb('0x43'),_0x513ed6);}function onConnect(_0xbba2d9){joinOrLeave(_0xbba2d9,'join');}exports[_0x7eeb('0x4c')]=function(_0x2f8831){_0x2f8831['on'](_0x7eeb('0x4d'),function(_0x33594e){_0x33594e[_0x7eeb('0x4e')](0x0);_0x33594e[_0x7eeb('0x4f')]=_0x33594e[_0x7eeb('0x50')][_0x7eeb('0x4d')][_0x7eeb('0x51')]+':'+_0x33594e[_0x7eeb('0x50')][_0x7eeb('0x4d')][_0x7eeb('0x52')];_0x33594e[_0x7eeb('0x53')]=new Date();_0x33594e[_0x7eeb('0x54')]=function(_0x542e57){console[_0x7eeb('0x54')](_0x7eeb('0x55')+_0x33594e['nsp'][_0x7eeb('0x3')]+'['+_0x33594e['address']+']',_0x542e57);};_0x33594e['on'](_0x7eeb('0x56'),function(){onDisconnect(_0x33594e,_0x2f8831);_0x33594e['log'](_0x7eeb('0x57'));});onConnect(_0x33594e);_0x33594e[_0x7eeb('0x54')](_0x7eeb('0x58'));});}; \ No newline at end of file +var _0x07f7=['removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','log','join','default','setMaxListeners','address','connection','remoteAddress','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','Agents','User','name','role','agent','telephone','type','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','map','resourceId','where','Campaign','format','%s:queue:%s','length','query','find','handshake','ChatInteraction','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','user:%s','voice:inbound','hasOwnProperty','include','push','VoiceQueue','MailQueue','OpenchannelQueue','Trunk','user','voice:outbound','userProfileId','ChatQueue','FaxQueue','SmsQueue','OpenchannelQueues','Telephones','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','all','voice','fax','sms','mail','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove'];(function(_0x36a8e1,_0x11ea64){var _0x4c6327=function(_0x4243d){while(--_0x4243d){_0x36a8e1['push'](_0x36a8e1['shift']());}};_0x4c6327(++_0x11ea64);}(_0x07f7,0x18f));var _0x707f=function(_0x2caf3a,_0x1d65d6){_0x2caf3a=_0x2caf3a-0x0;var _0x34f044=_0x07f7[_0x2caf3a];return _0x34f044;};'use strict';var _=require(_0x707f('0x0'));var util=require(_0x707f('0x1'));var BPromise=require(_0x707f('0x2'));var db=require(_0x707f('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':_0x707f('0x4'),'model':db[_0x707f('0x5')],'attributes':['id',_0x707f('0x6'),_0x707f('0x7')],'raw':!![],'where':{'role':_0x707f('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x707f('0x6')],'where':{'role':_0x707f('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x707f('0x6')]};var queryAgents={'raw':!![],'attributes':['id',_0x707f('0x6')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x707f('0x6'),_0x707f('0xa')],'where':{'type':_0x707f('0xb')}};function getAssociatedResources(_0x2cc43a,_0x38ab49,_0x640073){return db[_0x707f('0xc')]['findOne']({'where':{'name':_0x2cc43a,'userProfileId':_0x38ab49},'raw':!![]})[_0x707f('0xd')](function(_0x5b5544){if(_0x5b5544){if(_0x5b5544[_0x707f('0xe')]){switch(_0x2cc43a){case _0x707f('0xf'):case'ChatQueues':case _0x707f('0x10'):case _0x707f('0x11'):case _0x707f('0x12'):case'OpenchannelQueues':return db[_0x640073][_0x707f('0x13')](queryQueues);case'Telephones':return db[_0x640073][_0x707f('0x13')](queryTelephones);case _0x707f('0x14'):return db[_0x640073]['findAll'](queryTrunks);case _0x707f('0x15'):return db[_0x640073]['findAll'](queryCampaigns);}}else{return db[_0x707f('0x16')]['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0x5b5544['id']},'raw':!![]})[_0x707f('0xd')](function(_0x4c4fd2){if(_0x4c4fd2){var _0x4f7662={'where':{'id':_[_0x707f('0x17')](_0x4c4fd2,_0x707f('0x18'))},'raw':!![]};switch(_0x640073){case _0x707f('0x5'):_0x4f7662[_0x707f('0x19')][_0x707f('0x7')]=_0x707f('0x9');break;case _0x707f('0x1a'):_0x4f7662['where']['type']=_0x707f('0xb');break;}return db[_0x640073][_0x707f('0x13')](_0x4f7662);}else{return[];}});}}else{return[];}})[_0x707f('0xd')](function(_0x256ca1){return _0x256ca1;});}function joinOrLeaveQueues(_0x577032,_0x3a8197,_0x57a037,_0xeb6ae2){_0x577032[_0x3a8197](util[_0x707f('0x1b')](_0x707f('0x1c'),_0x57a037,_0xeb6ae2[_0x707f('0x6')]));if(_0xeb6ae2['Agents']){for(var _0x30c388=0x0;_0x30c388<_0xeb6ae2[_0x707f('0x4')][_0x707f('0x1d')];_0x30c388+=0x1){_0x577032[_0x3a8197](util[_0x707f('0x1b')]('user:%s',_0xeb6ae2[_0x707f('0x4')][_0x30c388]['name']));}}}function joinOrLeave(_0x48a4eb,_0x11ce20,_0x810751){var _0x349739;if(_0x48a4eb['handshake'][_0x707f('0x1e')]['id']){db['User'][_0x707f('0x1f')]({'attributes':['id',_0x707f('0x6'),_0x707f('0x7'),'userProfileId'],'where':{'id':_0x48a4eb[_0x707f('0x20')]['query']['id']},'include':[{'model':db[_0x707f('0x21')],'as':_0x707f('0x22'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x707f('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x707f('0x24')],'as':_0x707f('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x707f('0x26')],'as':_0x707f('0x27'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x707f('0x28'),'attributes':['id'],'raw':!![]}]})[_0x707f('0xd')](function(_0x50e1b3){if(_0x50e1b3){_0x349739=_0x50e1b3;_0x48a4eb[_0x11ce20](util['format'](_0x707f('0x29'),_0x50e1b3[_0x707f('0x6')]));var _0x9cbfb=[];switch(_0x50e1b3[_0x707f('0x7')]){case'admin':_0x48a4eb[_0x11ce20](_0x707f('0x2a'));_0x48a4eb[_0x11ce20]('voice:outbound');if(queryQueues[_0x707f('0x2b')]('include')){delete queryQueues[_0x707f('0x2c')];}_0x9cbfb[_0x707f('0x2d')](db[_0x707f('0x2e')][_0x707f('0x13')](queryQueues));_0x9cbfb[_0x707f('0x2d')](db['ChatQueue'][_0x707f('0x13')](queryQueues));_0x9cbfb[_0x707f('0x2d')](db['FaxQueue']['findAll'](queryQueues));_0x9cbfb[_0x707f('0x2d')](db['SmsQueue'][_0x707f('0x13')](queryQueues));_0x9cbfb[_0x707f('0x2d')](db[_0x707f('0x2f')]['findAll'](queryQueues));_0x9cbfb[_0x707f('0x2d')](db[_0x707f('0x30')]['findAll'](queryQueues));_0x9cbfb['push'](db[_0x707f('0x5')]['findAll'](queryTelephones));_0x9cbfb['push'](db[_0x707f('0x31')]['findAll'](queryTrunks));_0x9cbfb[_0x707f('0x2d')](db[_0x707f('0x1a')][_0x707f('0x13')](queryCampaigns));_0x9cbfb['push'](db['User'][_0x707f('0x13')](queryAgents));break;case _0x707f('0x32'):_0x48a4eb[_0x11ce20](_0x707f('0x2a'));_0x48a4eb[_0x11ce20](_0x707f('0x33'));_0x9cbfb['push'](getAssociatedResources(_0x707f('0xf'),_0x50e1b3[_0x707f('0x34')],_0x707f('0x2e')));_0x9cbfb[_0x707f('0x2d')](getAssociatedResources('ChatQueues',_0x50e1b3[_0x707f('0x34')],_0x707f('0x35')));_0x9cbfb[_0x707f('0x2d')](getAssociatedResources(_0x707f('0x10'),_0x50e1b3['userProfileId'],_0x707f('0x36')));_0x9cbfb['push'](getAssociatedResources(_0x707f('0x11'),_0x50e1b3['userProfileId'],_0x707f('0x37')));_0x9cbfb['push'](getAssociatedResources(_0x707f('0x12'),_0x50e1b3[_0x707f('0x34')],_0x707f('0x2f')));_0x9cbfb[_0x707f('0x2d')](getAssociatedResources(_0x707f('0x38'),_0x50e1b3[_0x707f('0x34')],_0x707f('0x30')));_0x9cbfb[_0x707f('0x2d')](getAssociatedResources(_0x707f('0x39'),_0x50e1b3[_0x707f('0x34')],_0x707f('0x5')));_0x9cbfb['push'](getAssociatedResources(_0x707f('0x14'),_0x50e1b3[_0x707f('0x34')],_0x707f('0x31')));_0x9cbfb[_0x707f('0x2d')](getAssociatedResources(_0x707f('0x15'),_0x50e1b3[_0x707f('0x34')],_0x707f('0x1a')));_0x9cbfb[_0x707f('0x2d')](db[_0x707f('0x5')]['findAll'](queryAgents));break;case _0x707f('0x8'):_0x48a4eb[_0x11ce20]('voice:inbound');_0x48a4eb[_0x11ce20](_0x707f('0x33'));_0x9cbfb[_0x707f('0x2d')](_0x50e1b3[_0x707f('0x3a')]({'attributes':['id',_0x707f('0x6')]}));_0x9cbfb['push'](_0x50e1b3[_0x707f('0x3b')]({'attributes':['id',_0x707f('0x6')]}));_0x9cbfb[_0x707f('0x2d')](_0x50e1b3[_0x707f('0x3c')]({'attributes':['id','name']}));_0x9cbfb[_0x707f('0x2d')](_0x50e1b3['getSmsQueues']({'attributes':['id',_0x707f('0x6')]}));_0x9cbfb[_0x707f('0x2d')](_0x50e1b3[_0x707f('0x3d')]({'attributes':['id',_0x707f('0x6')]}));_0x9cbfb[_0x707f('0x2d')](_0x50e1b3['getOpenchannelQueues']({'attributes':['id','name']}));break;}return BPromise[_0x707f('0x3e')](_0x9cbfb);}})[_0x707f('0xd')](function(_0x472852){if(_0x472852&&_0x472852['length']){for(var _0x45bff1=0x0;_0x45bff1<_0x472852[_0x707f('0x1d')];_0x45bff1+=0x1){for(var _0x4271fb=0x0;_0x4271fb<_0x472852[_0x45bff1]['length'];_0x4271fb+=0x1){switch(_0x45bff1){case 0x0:joinOrLeaveQueues(_0x48a4eb,_0x11ce20,_0x707f('0x3f'),_0x472852[_0x45bff1][_0x4271fb]);break;case 0x1:joinOrLeaveQueues(_0x48a4eb,_0x11ce20,'chat',_0x472852[_0x45bff1][_0x4271fb]);break;case 0x2:joinOrLeaveQueues(_0x48a4eb,_0x11ce20,_0x707f('0x40'),_0x472852[_0x45bff1][_0x4271fb]);break;case 0x3:joinOrLeaveQueues(_0x48a4eb,_0x11ce20,_0x707f('0x41'),_0x472852[_0x45bff1][_0x4271fb]);break;case 0x4:joinOrLeaveQueues(_0x48a4eb,_0x11ce20,_0x707f('0x42'),_0x472852[_0x45bff1][_0x4271fb]);break;case 0x5:joinOrLeaveQueues(_0x48a4eb,_0x11ce20,'openchannel',_0x472852[_0x45bff1][_0x4271fb]);break;case 0x6:_0x48a4eb[_0x11ce20](util[_0x707f('0x1b')](_0x707f('0x43'),_0x472852[_0x45bff1][_0x4271fb][_0x707f('0x6')]));break;case 0x7:_0x48a4eb[_0x11ce20](util['format'](_0x707f('0x44'),_0x472852[_0x45bff1][_0x4271fb][_0x707f('0x6')]));break;case 0x8:_0x48a4eb[_0x11ce20](util[_0x707f('0x1b')]('campaign:%s:%s',_0x472852[_0x45bff1][_0x4271fb][_0x707f('0xa')],_0x472852[_0x45bff1][_0x4271fb][_0x707f('0x6')]));break;case 0x9:_0x48a4eb[_0x11ce20](util[_0x707f('0x1b')](_0x707f('0x29'),_0x472852[_0x45bff1][_0x4271fb][_0x707f('0x6')]));break;}}}}})[_0x707f('0xd')](function(){if(_0x11ce20===_0x707f('0x45')){var _0x3d5c55=_[_0x707f('0x17')](_0x349739[_0x707f('0x22')],'id');return _0x349739[_0x707f('0x46')](_0x3d5c55)[_0x707f('0xd')](function(){for(var _0x2b60ad=0x0;_0x2b60ad<_0x3d5c55[_0x707f('0x1d')];_0x2b60ad+=0x1){_0x810751[_0x707f('0x47')](_0x707f('0x48'),{'ChatInteractionId':Number(_0x3d5c55[_0x2b60ad]),'UserId':Number(_0x349739['id'])});}});}})['then'](function(){if(_0x11ce20===_0x707f('0x45')){var _0x35e327=_[_0x707f('0x17')](_0x349739['MailInteractions'],'id');return _0x349739[_0x707f('0x49')](_0x35e327)[_0x707f('0xd')](function(){for(var _0x5b3a29=0x0;_0x5b3a29<_0x35e327[_0x707f('0x1d')];_0x5b3a29+=0x1){_0x810751[_0x707f('0x47')](_0x707f('0x4a'),{'MailInteractionId':Number(_0x35e327[_0x5b3a29]),'UserId':Number(_0x349739['id'])});}});}})[_0x707f('0xd')](function(){if(_0x11ce20===_0x707f('0x45')){var _0x56f63e=_[_0x707f('0x17')](_0x349739[_0x707f('0x25')],'id');return _0x349739['removeFaxInteractions'](_0x56f63e)[_0x707f('0xd')](function(){for(var _0x1683d9=0x0;_0x1683d9<_0x56f63e['length'];_0x1683d9+=0x1){_0x810751[_0x707f('0x47')](_0x707f('0x4b'),{'FaxInteractionId':Number(_0x56f63e[_0x1683d9]),'UserId':Number(_0x349739['id'])});}});}})[_0x707f('0xd')](function(){if(_0x11ce20==='leave'){var _0x2e07f0=_['map'](_0x349739[_0x707f('0x27')],'id');return _0x349739[_0x707f('0x4c')](_0x2e07f0)[_0x707f('0xd')](function(){for(var _0x5857fc=0x0;_0x5857fc<_0x2e07f0[_0x707f('0x1d')];_0x5857fc+=0x1){_0x810751['emit'](_0x707f('0x4d'),{'SmsInteractionId':Number(_0x2e07f0[_0x5857fc]),'UserId':Number(_0x349739['id'])});}});}})[_0x707f('0xd')](function(){if(_0x11ce20===_0x707f('0x45')){var _0x4ed867=_['map'](_0x349739[_0x707f('0x28')],'id');return _0x349739[_0x707f('0x4e')](_0x4ed867)[_0x707f('0xd')](function(){for(var _0x5189f3=0x0;_0x5189f3<_0x4ed867[_0x707f('0x1d')];_0x5189f3+=0x1){_0x810751[_0x707f('0x47')](_0x707f('0x4f'),{'OpenchannelInteractionId':Number(_0x4ed867[_0x5189f3]),'UserId':Number(_0x349739['id'])});}});}})['catch'](function(_0x48d1a1){_0x48a4eb[_0x707f('0x50')](_0x48d1a1);});}}function onDisconnect(_0x5329be,_0x69e27c){joinOrLeave(_0x5329be,'leave',_0x69e27c);}function onConnect(_0x16d204){joinOrLeave(_0x16d204,_0x707f('0x51'));}exports[_0x707f('0x52')]=function(_0xeee7f6){_0xeee7f6['on']('connection',function(_0x5823d8){_0x5823d8[_0x707f('0x53')](0x0);_0x5823d8[_0x707f('0x54')]=_0x5823d8['request'][_0x707f('0x55')][_0x707f('0x56')]+':'+_0x5823d8[_0x707f('0x57')][_0x707f('0x55')][_0x707f('0x58')];_0x5823d8[_0x707f('0x59')]=new Date();_0x5823d8[_0x707f('0x50')]=function(_0x504d6a){console['log'](_0x707f('0x5a')+_0x5823d8[_0x707f('0x5b')]['name']+'['+_0x5823d8[_0x707f('0x54')]+']',_0x504d6a);};_0x5823d8['on'](_0x707f('0x5c'),function(){onDisconnect(_0x5823d8,_0xeee7f6);_0x5823d8[_0x707f('0x50')](_0x707f('0x5d'));});onConnect(_0x5823d8);_0x5823d8['log'](_0x707f('0x5e'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 1a713bb..c1d36da 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 _0xe961=['condition','../logger','client','http','ChatInteraction','afterCreate','newinteraction','Chat','afterUpdate','closedinteraction','SmsInteraction','Sms','newmessage','FaxInteraction','FaxMessage','MailInteraction','Mail','MailMessage','Openchannel','OpenchannelMessage','EventManager','then','info','Trigger,\x20%s','error','catch','event','UserId','User','find','interface','format','SIP/%s','name','channel','incomingmessage','outgoingmessage','opened','changed','closed','get','default','hasOwnProperty','model','hook','callback','toLowerCase'];(function(_0x5e50a6,_0xdbac2e){var _0x5df0da=function(_0x44d6b2){while(--_0x44d6b2){_0x5e50a6['push'](_0x5e50a6['shift']());}};_0x5df0da(++_0xdbac2e);}(_0xe961,0x11b));var _0x1e96=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xe961[_0x173d7e];return _0x2220d6;};'use strict';var util=require('util');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var logger=require(_0x1e96('0x0'))('triggers');var client=jayson[_0x1e96('0x1')][_0x1e96('0x2')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x1e96('0x3'),'event':_0x1e96('0x4'),'condition':_0x1e96('0x5'),'callback':afterCreate},{'channel':_0x1e96('0x6'),'model':_0x1e96('0x3'),'event':_0x1e96('0x7'),'condition':_0x1e96('0x8'),'callback':afterUpdate},{'channel':_0x1e96('0x6'),'model':'ChatMessage','event':_0x1e96('0x4'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Sms','model':_0x1e96('0x9'),'event':'afterCreate','condition':_0x1e96('0x5'),'callback':afterCreate},{'channel':_0x1e96('0xa'),'model':_0x1e96('0x9'),'event':_0x1e96('0x7'),'condition':_0x1e96('0x8'),'callback':afterUpdate},{'channel':_0x1e96('0xa'),'model':'SmsMessage','event':_0x1e96('0x4'),'condition':_0x1e96('0xb'),'callback':afterCreateMessage},{'channel':'Fax','model':'FaxInteraction','event':_0x1e96('0x4'),'condition':_0x1e96('0x5'),'callback':afterCreate},{'channel':'Fax','model':_0x1e96('0xc'),'event':_0x1e96('0x7'),'condition':_0x1e96('0x8'),'callback':afterUpdate},{'channel':'Fax','model':_0x1e96('0xd'),'event':_0x1e96('0x4'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':_0x1e96('0xe'),'event':_0x1e96('0x4'),'condition':_0x1e96('0x5'),'callback':afterCreate},{'channel':_0x1e96('0xf'),'model':_0x1e96('0xe'),'event':_0x1e96('0x7'),'condition':_0x1e96('0x8'),'callback':afterUpdate},{'channel':_0x1e96('0xf'),'model':_0x1e96('0x10'),'event':_0x1e96('0x4'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x1e96('0x11'),'model':'OpenchannelInteraction','event':'afterCreate','condition':_0x1e96('0x5'),'callback':afterCreate},{'channel':'Openchannel','model':'OpenchannelInteraction','event':_0x1e96('0x7'),'condition':_0x1e96('0x8'),'callback':afterUpdate},{'channel':'Openchannel','model':_0x1e96('0x12'),'event':_0x1e96('0x4'),'condition':_0x1e96('0xb'),'callback':afterCreateMessage}];function request(_0x4b8750){return client['request'](_0x1e96('0x13'),_0x4b8750)[_0x1e96('0x14')](function(_0xc6eb5a){logger[_0x1e96('0x15')](_0x1e96('0x16'),_0x1e96('0x13'),_0xc6eb5a);if(_0xc6eb5a[_0x1e96('0x17')]){if(_0xc6eb5a[_0x1e96('0x17')]['code']===0x1f4){logger['error']('Trigger,\x20%s',_0x1e96('0x13'),_0xc6eb5a['error']);}}})[_0x1e96('0x18')](function(_0x1bd6d){logger[_0x1e96('0x17')](_0x1e96('0x16'),_0x1e96('0x13'),_0x1bd6d);});}function afterCreateMessage(_0x1b2ba4,_0x25a790){return function(_0x31df23,_0x4d5e43){_0x31df23=_0x31df23['get']({'plain':!![]});_0x31df23['channel']=_0x1b2ba4;_0x31df23[_0x1e96('0x19')]=_0x31df23['direction'];if(_0x31df23[_0x1e96('0x1a')]){return db[_0x1e96('0x1b')][_0x1e96('0x1c')]({'where':{'id':_0x31df23[_0x1e96('0x1a')]},'attributes':['id','name'],'raw':!![]})[_0x1e96('0x14')](function(_0xf0e32c){_0x31df23[_0x1e96('0x1d')]=util[_0x1e96('0x1e')](_0x1e96('0x1f'),_0xf0e32c[_0x1e96('0x20')]);_0x31df23[_0x1e96('0x21')]=_0x1b2ba4;return request({'event':_0x1e96('0x22'),'message':_0x31df23});})[_0x1e96('0x18')](function(_0x3818ed){console[_0x1e96('0x17')](_0x3818ed);});}else{return request({'event':_0x1e96('0x23'),'message':_0x31df23});}};}function afterCreate(_0x5ca7ef,_0x305edd){return function(_0x3475eb,_0x120325){_0x3475eb=_0x3475eb['get']({'plain':!![]});_0x3475eb[_0x1e96('0x21')]=_0x5ca7ef;_0x3475eb['event']=_0x1e96('0x24');return request({'event':_0x305edd,'message':_0x3475eb});};}function afterUpdate(_0x4aa450,_0xf8dfa4){return function(_0x241b6b,_0x5b1459){if(_0x241b6b[_0x1e96('0x25')](_0x1e96('0x26'))&&_0x241b6b[_0x1e96('0x26')]){_0x241b6b=_0x241b6b[_0x1e96('0x27')]({'plain':!![]});_0x241b6b[_0x1e96('0x21')]=_0x4aa450;_0x241b6b[_0x1e96('0x19')]=_0x1e96('0x26');if(_0x241b6b[_0x1e96('0x1a')]){return db[_0x1e96('0x1b')]['find']({'where':{'id':_0x241b6b[_0x1e96('0x1a')]},'attributes':['id',_0x1e96('0x20')],'raw':!![]})[_0x1e96('0x14')](function(_0x4dc89b){_0x241b6b['interface']=util['format']('SIP/%s',_0x4dc89b[_0x1e96('0x20')]);return request({'event':_0xf8dfa4,'message':_0x241b6b});})['catch'](function(_0xd3461d){console[_0x1e96('0x17')](_0xd3461d);});}else{return request({'event':_0xf8dfa4,'message':_0x241b6b});}}};}exports[_0x1e96('0x28')]=function(){for(var _0x6a5170=0x0;_0x6a5170=_0x4fac81[_0x6bc6('0x15')]){throw Error(_0x6bc6('0x16'));}_0x341761(_0x204901);})[_0x6bc6('0x17')](function(_0x3dfbbb){_0x323155(_0x3dfbbb);});});}; \ No newline at end of file +var _0xa58d=['role','User','count','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','fax','sms','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense'];(function(_0x6b6340,_0x6302c4){var _0x3609bf=function(_0x1620a0){while(--_0x1620a0){_0x6b6340['push'](_0x6b6340['shift']());}};_0x3609bf(++_0x6302c4);}(_0xa58d,0x1d4));var _0xda58=function(_0x4638a7,_0x538b7a){_0x4638a7=_0x4638a7-0x0;var _0x33a63a=_0xa58d[_0x4638a7];return _0x33a63a;};'use strict';var _=require(_0xda58('0x0'));var BPromise=require(_0xda58('0x1'));var db=require(_0xda58('0x2'))['db'];var util=require(_0xda58('0x3'));var channels=['voice','mail','chat',_0xda58('0x4'),_0xda58('0x5'),'openchannel'];exports[_0xda58('0x6')]=function(){return channels;};exports[_0xda58('0x7')]=function(_0x47a173){_0x47a173=_0x47a173[_0xda58('0x8')]();return _[_0xda58('0x9')](channels,_0x47a173);};exports[_0xda58('0xa')]=function(_0xef53c8,_0x1b45d8,_0x487cb5,_0x24bc7a){var _0x45f3c0={'loginAttempts':_0x1b45d8,'blocked':_0x487cb5};if(!_[_0xda58('0xb')](_0x24bc7a)){_0x45f3c0[_0xda58('0xc')]=_0x24bc7a;}return _0xef53c8[_0xda58('0xd')](_0x45f3c0);};exports[_0xda58('0xe')]=function(_0x2d0a68){return new BPromise(function(_0xefe1ec,_0x5880bd){var _0x3b5e20=0x0;if(_0x2d0a68[_0xda58('0xf')]!=='agent'){_0xefe1ec(_0x2d0a68);}db[_0xda58('0x10')][_0xda58('0x11')]({'where':{'role':_0xda58('0x12'),'online':!![],'id':{'$ne':_0x2d0a68['id']}}})[_0xda58('0x13')](function(_0x18e7f6){_0x3b5e20=_0x18e7f6;return util[_0xda58('0xe')]();})[_0xda58('0x13')](function(_0x8f718c){if(_0x8f718c&&_0x8f718c[_0xda58('0x14')]&&_0x3b5e20>=_0x8f718c[_0xda58('0x14')]){throw Error(_0xda58('0x15'));}_0xefe1ec(_0x2d0a68);})[_0xda58('0x16')](function(_0x383582){_0x5880bd(_0x383582);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 913e415..f61a2b3 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5bcd=['send','exports','404','status','render'];(function(_0xb085c8,_0x301d1d){var _0x2d59a6=function(_0x5a2be1){while(--_0x5a2be1){_0xb085c8['push'](_0xb085c8['shift']());}};_0x2d59a6(++_0x301d1d);}(_0x5bcd,0xa1));var _0xd5bc=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x5bcd[_0x2cfb58];return _0xd99951;};'use strict';module[_0xd5bc('0x0')][0x194]=function pageNotFound(_0x73df8f,_0xfe7f0){var _0x236e7c=_0xd5bc('0x1');var _0x5f3c44=0x194;var _0x587bdc={'status':_0x5f3c44};_0xfe7f0['status'](_0x587bdc[_0xd5bc('0x2')]);_0xfe7f0[_0xd5bc('0x3')](_0x236e7c,{},function(_0x4126b8,_0x5ace70){if(_0x4126b8){return _0xfe7f0[_0xd5bc('0x2')](_0x587bdc[_0xd5bc('0x2')])['json'](_0x587bdc);}_0xfe7f0[_0xd5bc('0x4')](_0x5ace70);});}; \ No newline at end of file +var _0x3334=['send','exports','404','status','render','json'];(function(_0xe5b349,_0x5f06e4){var _0x26b0ad=function(_0x1a97f1){while(--_0x1a97f1){_0xe5b349['push'](_0xe5b349['shift']());}};_0x26b0ad(++_0x5f06e4);}(_0x3334,0xeb));var _0x4333=function(_0x349af5,_0x2e3623){_0x349af5=_0x349af5-0x0;var _0xbd54f3=_0x3334[_0x349af5];return _0xbd54f3;};'use strict';module[_0x4333('0x0')][0x194]=function pageNotFound(_0x50a2e3,_0x5a89c2){var _0x3b2971=_0x4333('0x1');var _0x59ac02=0x194;var _0x1a13c6={'status':_0x59ac02};_0x5a89c2[_0x4333('0x2')](_0x1a13c6[_0x4333('0x2')]);_0x5a89c2[_0x4333('0x3')](_0x3b2971,{},function(_0x5169ce,_0x10fbfd){if(_0x5169ce){return _0x5a89c2['status'](_0x1a13c6[_0x4333('0x2')])[_0x4333('0x4')](_0x1a13c6);}_0x5a89c2[_0x4333('0x5')](_0x10fbfd);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 5ee1b8c..0f82a0a 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x812d=['team_has_sms_queues','OpenchannelAccountId','Answers','openchannel_interaction_has_tags','user_has_openchannel_interactions','OpenchannelInteractionId','AttachmentId','UserOpenchannelQueue','OpenchannelQueueId','team_has_openchannel_queues','ChatWebsiteId','ChatApplication','ChatMessage','OpenchannelQueueReport','Agent','Queue','ChatQueueId','chat_interaction_has_tags','ChatInteractionId','team_has_chat_queues','ChatGroupId','ChatProactiveAction','Website','CmCompany','CompanyId','Company','cm_contact_has_tags','CampaignId','OwnerId','Automation','OneAll','AutomationAllId','Any','OneAny','Actions','AutomationId','Intervals','SmsApplications','AnalyticDefaultReport','DefaultReportId','CustomReportId','Mohs','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','SalesforceAccount','Configurations','AccountId','Subjects','SubjectId','DescriptionId','Subject','Description','Field','Descriptions','FieldId','VariableId','DeskField','ZohoAccount','ZendeskField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerField','Dynamics365Field','FreshsalesConfiguration','FromId','ToId','SessionId','JscriptyProject','ProjectId','team_has_voice_queues','ChatQueues','team_has_fax_queues','TrunkId','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ToAgent','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','cm_user_has_lists','userProfileId','UserProfileSections','Resources','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','xcall','xC@LL1234','127.0.0.1','name','utf8','sequelizeHistory','motion2','mysql','database','username','password','options','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceRecording/voiceRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','Trunk','VoiceTransferReport','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','Action','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','hasOne','cascade','UserId','VoiceRecording','Recordings','hasMany','UserVoiceQueueRt','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','FaxInteractions','belongsTo','UserProfile','belongsToMany','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','MailInteractions','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','VoiceQueues','MailQueues','UserMailQueue','UserChatQueue','FaxQueues','SmsQueues','UserSmsQueue','OpenchannelQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','Hoppers','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','voice_queues_has_cm_blacklists','ScreenRecording','VoiceMailMessage','Messages','mailboxuser','QueueCalls','uniqueid','AgentReports','ContactId','MailServerOut','Smtp','Dispositions','MailAccountId','Interactions','List','ListId','TemplateId','team_has_mail_queues','Teams','MailInteractionId','Contact','Owner','Tag','mail_interaction_has_tags','Users','Attachment','Attachments','Interaction','Account','restrict','TagId','Dashboard','Exntensions','mandatoryDispositionPauseId','FaxApplication','FaxQueue','FaxInteractionId','FaxAccountId','fax_interaction_has_tags','Tags','FaxQueueReport','SmsAccountId','SmsApplication','SmsMessage','SmsInteractionId','sms_interaction_has_tags','ThroughTags','user_has_sms_interactions','SmsQueue'];(function(_0x23a046,_0x1240d8){var _0x38165b=function(_0x9598f9){while(--_0x9598f9){_0x23a046['push'](_0x23a046['shift']());}};_0x38165b(++_0x1240d8);}(_0x812d,0x6e));var _0xd812=function(_0x1fbd0f,_0x10c042){_0x1fbd0f=_0x1fbd0f-0x0;var _0x5a5ffb=_0x812d[_0x1fbd0f];return _0x5a5ffb;};'use strict';var path=require('path');var config=require(_0xd812('0x0'));var Sequelize=require(_0xd812('0x1'));var _=require(_0xd812('0x2'));var jstz=require(_0xd812('0x3'));var timezone=jstz[_0xd812('0x4')]();config[_0xd812('0x1')]=_[_0xd812('0x5')](config[_0xd812('0x1')],{'database':'motion2','username':_0xd812('0x6'),'password':_0xd812('0x7'),'options':{'host':_0xd812('0x8'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xd812('0x9')](),'define':{'charset':_0xd812('0xa'),'collate':'utf8_general_ci'}}});config[_0xd812('0xb')]=_[_0xd812('0x5')](config['sequelizeHistory'],{'database':_0xd812('0xc'),'username':_0xd812('0x6'),'password':_0xd812('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xd812('0xd'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xd812('0xa'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0xd812('0xe')],config[_0xd812('0x1')][_0xd812('0xf')],config['sequelize'][_0xd812('0x10')],config[_0xd812('0x1')][_0xd812('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xd812('0xb')][_0xd812('0xe')],config[_0xd812('0xb')][_0xd812('0xf')],config[_0xd812('0xb')]['password'],config['sequelizeHistory']['options'])};db[_0xd812('0x12')]=db['sequelize']['import'](_0xd812('0x13'));db[_0xd812('0x14')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x16'));db[_0xd812('0x17')]=db[_0xd812('0x1')]['import']('../api/voiceContext/voiceContext.model');db[_0xd812('0x18')]=db['sequelize'][_0xd812('0x15')]('../api/voiceExtension/voiceExtension.model');db['VoiceMusicOnHold']=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x19'));db[_0xd812('0x1a')]=db[_0xd812('0x1')]['import']('../api/voiceQueue/voiceQueue.model');db['VoiceRecording']=db['sequelize'][_0xd812('0x15')](_0xd812('0x1b'));db['ScreenRecording']=db[_0xd812('0x1')]['import']('../api/screenRecording/screenRecording.model');db[_0xd812('0x1c')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x1d'));db['VoiceMailMessage']=db[_0xd812('0x1')][_0xd812('0x15')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0xd812('0x1e')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x1f'));db['VoiceDialReport']=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x20'));db[_0xd812('0x21')]=db['sequelize']['import'](_0xd812('0x22'));db[_0xd812('0x23')]=db[_0xd812('0x1')][_0xd812('0x15')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0xd812('0x24')]=db[_0xd812('0x1')][_0xd812('0x15')]('../api/memberReport/memberReport.model');db[_0xd812('0x25')]=db[_0xd812('0x1')][_0xd812('0x15')]('../api/trunk/trunk.model');db[_0xd812('0x26')]=db['sequelize'][_0xd812('0x15')]('../api/voiceTransferReport/voiceTransferReport.model');db['UserVoiceQueueRt']=db['sequelize'][_0xd812('0x15')](_0xd812('0x27'));db[_0xd812('0x28')]=db[_0xd812('0x1')]['import'](_0xd812('0x29'));db['UserChatQueue']=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x2a'));db['UserMailQueue']=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x2b'));db[_0xd812('0x2c')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x2d'));db['UserSmsQueue']=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x2e'));db['UserOpenchannelQueue']=db[_0xd812('0x1')][_0xd812('0x15')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xd812('0x2f')]=db['sequelize'][_0xd812('0x15')](_0xd812('0x30'));db['MailServerOut']=db['sequelize']['import']('../api/mailServerOut/mailServerOut.model');db[_0xd812('0x31')]=db['sequelize']['import'](_0xd812('0x32'));db[_0xd812('0x33')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x34'));db[_0xd812('0x35')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x36'));db[_0xd812('0x37')]=db['sequelize']['import'](_0xd812('0x38'));db[_0xd812('0x39')]=db[_0xd812('0x1')]['import'](_0xd812('0x3a'));db[_0xd812('0x3b')]=db['sequelize'][_0xd812('0x15')](_0xd812('0x3c'));db[_0xd812('0x3d')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x3e'));db['Dashboard']=db[_0xd812('0x1')]['import'](_0xd812('0x3f'));db[_0xd812('0x40')]=db['sequelize'][_0xd812('0x15')](_0xd812('0x41'));db[_0xd812('0x42')]=db['sequelize'][_0xd812('0x15')](_0xd812('0x43'));db['FaxApplication']=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x44'));db[_0xd812('0x45')]=db['sequelize'][_0xd812('0x15')](_0xd812('0x46'));db[_0xd812('0x47')]=db[_0xd812('0x1')][_0xd812('0x15')]('../api/faxMessage/faxMessage.model');db['FaxQueue']=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x48'));db['FaxQueueReport']=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x49'));db[_0xd812('0x4a')]=db['sequelize'][_0xd812('0x15')](_0xd812('0x4b'));db['SmsApplication']=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x4c'));db[_0xd812('0x4d')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x4e'));db['SmsMessage']=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x4f'));db['SmsQueue']=db[_0xd812('0x1')][_0xd812('0x15')]('../api/smsQueue/smsQueue.model');db['OpenchannelAccount']=db[_0xd812('0x1')][_0xd812('0x15')]('../api/openchannelAccount/openchannelAccount.model');db[_0xd812('0x50')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x51'));db[_0xd812('0x52')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x53'));db[_0xd812('0x54')]=db['sequelize']['import'](_0xd812('0x55'));db[_0xd812('0x56')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x57'));db[_0xd812('0x58')]=db[_0xd812('0x1')]['import']('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db['ChatApplication']=db[_0xd812('0x1')]['import']('../api/chatApplication/chatApplication.model');db[_0xd812('0x59')]=db[_0xd812('0x1')]['import'](_0xd812('0x5a'));db['ChatMessage']=db[_0xd812('0x1')]['import']('../api/chatMessage/chatMessage.model');db[_0xd812('0x5b')]=db['sequelize']['import'](_0xd812('0x5c'));db[_0xd812('0x5d')]=db[_0xd812('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0xd812('0x5e')]=db[_0xd812('0x1')]['import'](_0xd812('0x5f'));db['ChatProactiveAction']=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x60'));db['CmCompany']=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x61'));db[_0xd812('0x62')]=db['sequelize'][_0xd812('0x15')](_0xd812('0x63'));db[_0xd812('0x64')]=db['sequelize'][_0xd812('0x15')](_0xd812('0x65'));db[_0xd812('0x66')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x67'));db[_0xd812('0x68')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x69'));db[_0xd812('0x6a')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x6b'));db[_0xd812('0x6c')]=db[_0xd812('0x1')][_0xd812('0x15')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0xd812('0x15')]('../api/cmCustomField/cmCustomField.model');db[_0xd812('0x6d')]=db[_0xd812('0x1')][_0xd812('0x15')]('../api/action/action.model');db['Automation']=db['sequelize'][_0xd812('0x15')]('../api/automation/automation.model');db[_0xd812('0x6e')]=db['sequelize'][_0xd812('0x15')](_0xd812('0x6f'));db[_0xd812('0x70')]=db['sequelize'][_0xd812('0x15')](_0xd812('0x71'));db[_0xd812('0x72')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x73'));db[_0xd812('0x74')]=db[_0xd812('0x1')][_0xd812('0x15')]('../api/interval/interval.model');db[_0xd812('0x75')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x76'));db[_0xd812('0x77')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x78'));db[_0xd812('0x79')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x7a'));db[_0xd812('0x7b')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x7c'));db[_0xd812('0x7d')]=db['sequelize'][_0xd812('0x15')](_0xd812('0x7e'));db['Tag']=db[_0xd812('0x1')][_0xd812('0x15')]('../api/tag/tag.model');db[_0xd812('0x7f')]=db[_0xd812('0x1')][_0xd812('0x15')]('../api/template/template.model');db[_0xd812('0x80')]=db['sequelize']['import'](_0xd812('0x81'));db[_0xd812('0x82')]=db['sequelize'][_0xd812('0x15')](_0xd812('0x83'));db['Integration']=db['sequelize']['import'](_0xd812('0x84'));db[_0xd812('0x85')]=db[_0xd812('0x1')]['import'](_0xd812('0x86'));db[_0xd812('0x87')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x88'));db['AnalyticDefaultReport']=db['sequelize'][_0xd812('0x15')](_0xd812('0x89'));db[_0xd812('0x8a')]=db['sequelize']['import'](_0xd812('0x8b'));db[_0xd812('0x8c')]=db[_0xd812('0x1')]['import'](_0xd812('0x8d'));db[_0xd812('0x8e')]=db[_0xd812('0x1')][_0xd812('0x15')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0xd812('0x8f')]=db[_0xd812('0x1')][_0xd812('0x15')]('../api/analyticTreeReport/analyticTreeReport.model');db['SalesforceAccount']=db[_0xd812('0x1')]['import'](_0xd812('0x90'));db[_0xd812('0x91')]=db['sequelize'][_0xd812('0x15')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xd812('0x92')]=db['sequelize'][_0xd812('0x15')](_0xd812('0x93'));db[_0xd812('0x94')]=db[_0xd812('0x1')][_0xd812('0x15')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xd812('0x95')]=db[_0xd812('0x1')]['import']('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0xd812('0x96')]=db[_0xd812('0x1')]['import'](_0xd812('0x97'));db[_0xd812('0x98')]=db['sequelize']['import'](_0xd812('0x99'));db[_0xd812('0x9a')]=db[_0xd812('0x1')][_0xd812('0x15')]('../api/intDeskConfiguration/intDeskConfiguration.model');db['DeskField']=db[_0xd812('0x1')][_0xd812('0x15')]('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x9b'));db[_0xd812('0x9c')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0x9d'));db[_0xd812('0x9e')]=db['sequelize']['import'](_0xd812('0x9f'));db[_0xd812('0xa0')]=db[_0xd812('0x1')][_0xd812('0x15')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0xd812('0xa1')]=db['sequelize'][_0xd812('0x15')](_0xd812('0xa2'));db['ZendeskField']=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xa3'));db[_0xd812('0xa4')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xa5'));db[_0xd812('0xa6')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xa7'));db[_0xd812('0xa8')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xa9'));db[_0xd812('0xaa')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xab'));db[_0xd812('0xac')]=db['sequelize'][_0xd812('0x15')](_0xd812('0xad'));db['VtigerField']=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xae'));db[_0xd812('0xaf')]=db[_0xd812('0x1')][_0xd812('0x15')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0xd812('0xb0')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xb1'));db[_0xd812('0xb2')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xb3'));db[_0xd812('0xb4')]=db[_0xd812('0x1')]['import'](_0xd812('0xb5'));db[_0xd812('0xb6')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xb7'));db['Dynamics365Field']=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xb8'));db[_0xd812('0xb9')]=db[_0xd812('0x1')]['import'](_0xd812('0xba'));db['FreshsalesConfiguration']=db['sequelize'][_0xd812('0x15')](_0xd812('0xbb'));db[_0xd812('0xbc')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xbd'));db[_0xd812('0xbe')]=db[_0xd812('0x1')][_0xd812('0x15')]('../api/integration/integration.model');db['Network']=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xbf'));db[_0xd812('0xc0')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xc1'));db[_0xd812('0xc2')]=db[_0xd812('0x1')]['import'](_0xd812('0xc3'));db[_0xd812('0xc4')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xc5'));db[_0xd812('0xc6')]=db[_0xd812('0x1')]['import'](_0xd812('0xc7'));db[_0xd812('0xc8')]=db['sequelize'][_0xd812('0x15')](_0xd812('0xc9'));db[_0xd812('0xca')]=db[_0xd812('0x1')]['import']('../api/smsQueueReport/smsQueueReport.model');db[_0xd812('0xcb')]=db['sequelize'][_0xd812('0x15')]('../api/squareReport/squareReport.model');db['SquareDetailsReport']=db['sequelize'][_0xd812('0x15')](_0xd812('0xcc'));db['JscriptyProject']=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xcd'));db[_0xd812('0xce')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xcf'));db['SquareOdbc']=db[_0xd812('0x1')]['import'](_0xd812('0xd0'));db[_0xd812('0xd1')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xd2'));db[_0xd812('0xd3')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xd4'));db['SquareMessage']=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xd5'));db[_0xd812('0xd6')]=db[_0xd812('0x1')]['import'](_0xd812('0xd7'));db[_0xd812('0xd8')]=db['sequelize']['import'](_0xd812('0xd9'));db[_0xd812('0xda')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xdb'));db['Migration']=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xdc'));db['Attachment']=db[_0xd812('0x1')][_0xd812('0x15')]('../api/attachment/attachment.model');db['Plugin']=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xdd'));db[_0xd812('0xde')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xdf'));db[_0xd812('0xe0')]=db[_0xd812('0x1')]['import']('../api/chatTransferReport/chatTransferReport.model');db[_0xd812('0xe1')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xe2'));db['OpenchannelTransferReport']=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xe3'));db[_0xd812('0xe4')]=db['sequelize'][_0xd812('0x15')]('../api/smsTransferReport/smsTransferReport.model');db[_0xd812('0xe5')]=db[_0xd812('0x1')]['import'](_0xd812('0xe6'));db[_0xd812('0xe7')]=db[_0xd812('0x1')][_0xd812('0x15')](_0xd812('0xe8'));db['UserProfile']=db['sequelize'][_0xd812('0x15')](_0xd812('0xe9'));db[_0xd812('0xea')]=db[_0xd812('0x1')]['import'](_0xd812('0xeb'));db[_0xd812('0xec')]=db[_0xd812('0x1')]['import'](_0xd812('0xed'));db[_0xd812('0x12')][_0xd812('0xee')](db[_0xd812('0x1c')],{'as':_0xd812('0x1c'),'onDelete':_0xd812('0xef'),'foreignKey':_0xd812('0xf0')});db[_0xd812('0x12')]['hasMany'](db[_0xd812('0xf1')],{'as':_0xd812('0xf2'),'foreignKey':'UserId'});db[_0xd812('0x12')][_0xd812('0xf3')](db[_0xd812('0xf4')],{'as':_0xd812('0xf5'),'foreignKey':_0xd812('0xf0')});db['User'][_0xd812('0xf3')](db[_0xd812('0x18')],{'as':_0xd812('0xf6'),'onDelete':_0xd812('0xef'),'hooks':!![]});db[_0xd812('0x12')][_0xd812('0xf3')](db[_0xd812('0x68')],{'as':_0xd812('0xf7'),'foreignKey':'UserId'});db[_0xd812('0x12')][_0xd812('0xf3')](db['CmHopperHistory'],{'as':_0xd812('0xf8'),'foreignKey':_0xd812('0xf0')});db[_0xd812('0x12')][_0xd812('0xf3')](db['ReportAgentPreview'],{'as':_0xd812('0x6c'),'foreignKey':_0xd812('0xf0')});db[_0xd812('0x12')]['hasMany'](db[_0xd812('0x52')],{'as':_0xd812('0xf9'),'foreignKey':'UserId'});db['User'][_0xd812('0xf3')](db[_0xd812('0x59')],{'as':'ChatInteractions','foreignKey':_0xd812('0xf0')});db[_0xd812('0x12')]['hasMany'](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0xd812('0xf0')});db[_0xd812('0x12')][_0xd812('0xf3')](db[_0xd812('0x45')],{'as':_0xd812('0xfa'),'foreignKey':'UserId'});db[_0xd812('0x12')][_0xd812('0xf3')](db[_0xd812('0x37')],{'as':'MailInteractions','foreignKey':'UserId'});db[_0xd812('0x12')][_0xd812('0xfb')](db['UserProfile'],{'as':_0xd812('0xfc'),'foreignKey':'userProfileId'});db['User'][_0xd812('0xfd')](db[_0xd812('0x5e')],{'as':'Groups','through':_0xd812('0xfe')});db[_0xd812('0x12')][_0xd812('0xfd')](db[_0xd812('0x62')],{'as':_0xd812('0xff'),'through':_0xd812('0x100')});db[_0xd812('0x12')]['belongsToMany'](db[_0xd812('0xe5')],{'as':_0xd812('0x101'),'through':'cm_user_has_lists'});db[_0xd812('0x12')][_0xd812('0xfd')](db['Team'],{'through':'user_has_teams'});db[_0xd812('0x12')][_0xd812('0xfd')](db[_0xd812('0x37')],{'as':_0xd812('0x102'),'through':_0xd812('0x103')});db[_0xd812('0x12')][_0xd812('0xfd')](db[_0xd812('0x59')],{'as':_0xd812('0x104'),'through':_0xd812('0x105')});db[_0xd812('0x12')][_0xd812('0xfd')](db[_0xd812('0x45')],{'as':_0xd812('0xfa'),'through':_0xd812('0x106')});db[_0xd812('0x12')][_0xd812('0xfd')](db[_0xd812('0x4d')],{'as':_0xd812('0x107'),'through':'user_has_sms_interactions'});db[_0xd812('0x12')][_0xd812('0xfd')](db[_0xd812('0x52')],{'as':_0xd812('0xf9'),'through':'user_has_openchannel_interactions'});db[_0xd812('0x12')][_0xd812('0xfd')](db[_0xd812('0x1a')],{'as':_0xd812('0x108'),'through':_0xd812('0x28'),'required':![]});db[_0xd812('0x12')][_0xd812('0xfd')](db['MailQueue'],{'as':_0xd812('0x109'),'through':_0xd812('0x10a'),'required':![]});db['User'][_0xd812('0xfd')](db[_0xd812('0x5d')],{'as':'ChatQueues','through':_0xd812('0x10b'),'required':![],'hooks':!![]});db[_0xd812('0x12')][_0xd812('0xfd')](db['FaxQueue'],{'as':_0xd812('0x10c'),'through':_0xd812('0x2c'),'required':![]});db[_0xd812('0x12')][_0xd812('0xfd')](db['SmsQueue'],{'as':_0xd812('0x10d'),'through':_0xd812('0x10e'),'required':![]});db[_0xd812('0x12')][_0xd812('0xfd')](db[_0xd812('0x56')],{'as':_0xd812('0x10f'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0xd812('0xfd')](db[_0xd812('0xe5')],{'through':'cm_user_has_lists'});db['User']['belongsToMany'](db[_0xd812('0xe7')],{'as':_0xd812('0x110'),'through':_0xd812('0x111'),'required':![]});db[_0xd812('0x12')]['belongsToMany'](db[_0xd812('0x58')],{'as':_0xd812('0x112'),'through':'user_has_chat_websites'});db[_0xd812('0x12')][_0xd812('0xfd')](db[_0xd812('0x42')],{'as':'FaxAccounts','through':_0xd812('0x113')});db['User'][_0xd812('0xfd')](db[_0xd812('0x31')],{'as':_0xd812('0x114'),'through':_0xd812('0x115')});db['User'][_0xd812('0xfd')](db[_0xd812('0x116')],{'as':_0xd812('0x117'),'through':_0xd812('0x118')});db[_0xd812('0x12')][_0xd812('0xfd')](db[_0xd812('0x4a')],{'as':_0xd812('0x119'),'through':_0xd812('0x11a')});db[_0xd812('0x12')][_0xd812('0xfd')](db['SquareProject'],{'as':'SquareProjects','through':_0xd812('0x11b')});db['VoiceChanSpy']['hasMany'](db['VoiceExtension'],{'as':_0xd812('0x11c'),'onDelete':_0xd812('0xef'),'foreignKey':_0xd812('0x11d')});db[_0xd812('0x17')]['hasMany'](db[_0xd812('0x18')],{'onDelete':'cascade'});db[_0xd812('0x18')][_0xd812('0xf3')](db[_0xd812('0x18')],{'as':_0xd812('0x11e'),'onDelete':_0xd812('0xef')});db[_0xd812('0x11f')][_0xd812('0xfd')](db[_0xd812('0x7d')],{'as':_0xd812('0x120'),'through':_0xd812('0x121')});db[_0xd812('0x1a')]['hasMany'](db[_0xd812('0xf4')],{'as':'Members','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xd812('0xf3')](db['CmHopper'],{'as':_0xd812('0x122'),'foreignKey':_0xd812('0x123')});db['VoiceQueue']['hasMany'](db['CmHopperFinal'],{'as':_0xd812('0xf7'),'foreignKey':_0xd812('0x123')});db[_0xd812('0x1a')]['hasMany'](db[_0xd812('0x6a')],{'as':_0xd812('0x124'),'foreignKey':_0xd812('0x123')});db[_0xd812('0x1a')]['hasMany'](db[_0xd812('0x6c')],{'as':_0xd812('0x6c'),'foreignKey':_0xd812('0x123')});db[_0xd812('0x1a')][_0xd812('0xf3')](db[_0xd812('0x66')],{'as':_0xd812('0x125'),'foreignKey':'VoiceQueueId'});db[_0xd812('0x1a')][_0xd812('0xf3')](db[_0xd812('0xc8')],{'as':_0xd812('0x126'),'foreignKey':_0xd812('0x123')});db[_0xd812('0x1a')][_0xd812('0xfb')](db[_0xd812('0x25')],{'as':_0xd812('0x25'),'foreignKey':'TrunkId'});db[_0xd812('0x1a')][_0xd812('0xfb')](db[_0xd812('0x25')],{'as':_0xd812('0x127'),'foreignKey':_0xd812('0x128')});db[_0xd812('0x1a')][_0xd812('0xfb')](db[_0xd812('0x74')],{'as':_0xd812('0x74'),'foreignKey':_0xd812('0x129')});db[_0xd812('0x1a')]['belongsTo'](db['Pause'],{'as':_0xd812('0x12a'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xd812('0x1a')][_0xd812('0xfd')](db[_0xd812('0xe5')],{'as':'Lists','through':_0xd812('0x12b')});db['VoiceQueue'][_0xd812('0xfd')](db[_0xd812('0x12')],{'as':_0xd812('0x12c'),'through':_0xd812('0x28')});db[_0xd812('0x1a')][_0xd812('0xfd')](db[_0xd812('0xd6')],{'as':'Teams','through':'team_has_voice_queues'});db[_0xd812('0x1a')][_0xd812('0xfd')](db[_0xd812('0xe5')],{'as':'BlackLists','through':_0xd812('0x12d')});db[_0xd812('0xf1')]['belongsTo'](db[_0xd812('0x12')],{'as':'User','foreignKey':'UserId'});db[_0xd812('0x12e')][_0xd812('0xfb')](db[_0xd812('0x12')],{'as':_0xd812('0x12'),'foreignKey':'UserId'});db['VoiceMail'][_0xd812('0xf3')](db[_0xd812('0x12f')],{'as':_0xd812('0x130'),'onDelete':'cascade','foreignKey':'mailboxuser','sourceKey':'mailbox'});db['VoiceMailMessage'][_0xd812('0xfb')](db[_0xd812('0x1c')],{'foreignKey':_0xd812('0x131'),'targetKey':'mailbox'});db[_0xd812('0x1e')][_0xd812('0xf3')](db['VoiceQueueReport'],{'as':_0xd812('0x132'),'foreignKey':_0xd812('0x133'),'constraints':![]});db[_0xd812('0x1e')][_0xd812('0xf3')](db[_0xd812('0x21')],{'as':_0xd812('0x134'),'foreignKey':_0xd812('0x133'),'constraints':![]});db[_0xd812('0x1e')][_0xd812('0xfb')](db[_0xd812('0x12')],{'as':_0xd812('0x12'),'foreignKey':_0xd812('0xf0')});db[_0xd812('0x1e')]['belongsTo'](db[_0xd812('0x62')],{'as':'Contact','foreignKey':_0xd812('0x135')});db[_0xd812('0x2f')][_0xd812('0xfb')](db[_0xd812('0x31')],{'as':_0xd812('0x31'),'foreignKey':'MailAccountId'});db[_0xd812('0x136')][_0xd812('0xfb')](db['MailAccount'],{'as':_0xd812('0x31'),'foreignKey':'MailAccountId'});db[_0xd812('0x31')][_0xd812('0xee')](db[_0xd812('0x2f')],{'as':'Imap','onDelete':'cascade'});db[_0xd812('0x31')][_0xd812('0xee')](db['MailServerOut'],{'as':_0xd812('0x137'),'onDelete':'cascade'});db[_0xd812('0x31')][_0xd812('0xf3')](db[_0xd812('0x70')],{'as':_0xd812('0x138'),'foreignKey':_0xd812('0x139')});db[_0xd812('0x31')]['hasMany'](db[_0xd812('0x6e')],{'as':'Answers','foreignKey':_0xd812('0x139')});db[_0xd812('0x31')][_0xd812('0xf3')](db[_0xd812('0x39')],{'as':_0xd812('0x130'),'foreignKey':_0xd812('0x139')});db[_0xd812('0x31')]['hasMany'](db[_0xd812('0x37')],{'as':_0xd812('0x13a')});db[_0xd812('0x31')]['hasMany'](db[_0xd812('0x3b')],{'as':'Applications'});db[_0xd812('0x31')][_0xd812('0xfb')](db[_0xd812('0xe5')],{'as':_0xd812('0x13b'),'foreignKey':_0xd812('0x13c')});db[_0xd812('0x31')][_0xd812('0xfb')](db[_0xd812('0x7f')],{'as':'Template','foreignKey':_0xd812('0x13d')});db[_0xd812('0x31')][_0xd812('0xfb')](db[_0xd812('0x75')],{'as':_0xd812('0x12a'),'foreignKey':'mandatoryDispositionPauseId'});db['MailAccount'][_0xd812('0xfd')](db[_0xd812('0x12')],{'as':_0xd812('0x12c'),'through':_0xd812('0x115')});db['MailQueue']['belongsToMany'](db[_0xd812('0x12')],{'as':_0xd812('0x12c'),'through':_0xd812('0x10a')});db[_0xd812('0x33')][_0xd812('0xfd')](db[_0xd812('0xd6')],{'through':_0xd812('0x13e'),'as':_0xd812('0x13f')});db['MailInteraction']['hasMany'](db[_0xd812('0x39')],{'as':_0xd812('0x130'),'onDelete':'cascade','foreignKey':_0xd812('0x140')});db[_0xd812('0x37')][_0xd812('0xfb')](db[_0xd812('0x31')],{'as':'Account','foreignKey':_0xd812('0x139')});db[_0xd812('0x37')][_0xd812('0xfb')](db['CmContact'],{'as':_0xd812('0x141'),'foreignKey':_0xd812('0x135')});db[_0xd812('0x37')][_0xd812('0xfb')](db[_0xd812('0x12')],{'as':_0xd812('0x142'),'foreignKey':_0xd812('0xf0')});db['MailInteraction']['belongsToMany'](db['Tag'],{'through':'mail_interaction_has_tags','as':'Tags'});db[_0xd812('0x37')][_0xd812('0xfd')](db[_0xd812('0x143')],{'through':_0xd812('0x144'),'as':'ThroughTags'});db[_0xd812('0x37')]['belongsToMany'](db['User'],{'as':_0xd812('0x145'),'through':_0xd812('0x103'),'foreignKey':'MailInteractionId'});db[_0xd812('0x39')][_0xd812('0xf3')](db[_0xd812('0x146')],{'as':_0xd812('0x147'),'onDelete':_0xd812('0xef')});db[_0xd812('0x39')][_0xd812('0xfb')](db['User'],{'as':_0xd812('0x12')});db[_0xd812('0x39')]['belongsTo'](db[_0xd812('0x62')],{'onDelete':_0xd812('0xef'),'as':_0xd812('0x141')});db[_0xd812('0x39')][_0xd812('0xfb')](db[_0xd812('0x37')],{'as':_0xd812('0x148'),'foreignKey':_0xd812('0x140')});db[_0xd812('0x39')][_0xd812('0xfb')](db[_0xd812('0x31')],{'as':_0xd812('0x149'),'foreignKey':'MailAccountId'});db[_0xd812('0x3b')]['belongsTo'](db[_0xd812('0x12')],{'onDelete':_0xd812('0x14a')});db[_0xd812('0x3b')]['belongsTo'](db[_0xd812('0x33')],{'onDelete':'restrict'});db[_0xd812('0x3b')][_0xd812('0xfb')](db[_0xd812('0x31')],{'onDelete':_0xd812('0x14a')});db[_0xd812('0x3b')][_0xd812('0xfb')](db[_0xd812('0x74')],{'onDelete':_0xd812('0x14a'),'foreignKey':'IntervalId'});db[_0xd812('0x3b')][_0xd812('0xfb')](db[_0xd812('0x143')],{'onDelete':'restrict','foreignKey':_0xd812('0x14b')});db[_0xd812('0x3d')][_0xd812('0xfb')](db[_0xd812('0x31')],{});db[_0xd812('0x3d')][_0xd812('0xfb')](db[_0xd812('0xe5')],{'as':_0xd812('0x13b'),'foreignKey':_0xd812('0x13c')});db['MailQueueReport'][_0xd812('0xfb')](db[_0xd812('0x62')],{'as':_0xd812('0x141'),'foreignKey':_0xd812('0x135')});db[_0xd812('0x3d')][_0xd812('0xfb')](db[_0xd812('0x37')],{});db[_0xd812('0x3d')][_0xd812('0xfb')](db[_0xd812('0x39')],{});db['MailQueueReport']['belongsTo'](db[_0xd812('0x12')],{});db['MailQueueReport'][_0xd812('0xfb')](db[_0xd812('0x33')],{});db[_0xd812('0x14c')][_0xd812('0xf3')](db[_0xd812('0x40')],{'as':'Items','onDelete':'cascade'});db[_0xd812('0x42')]['hasMany'](db[_0xd812('0x70')],{'as':_0xd812('0x138'),'foreignKey':'FaxAccountId'});db['FaxAccount']['hasMany'](db[_0xd812('0x6e')],{'as':'Answers','foreignKey':'FaxAccountId'});db[_0xd812('0x42')][_0xd812('0xf3')](db[_0xd812('0x45')],{'as':_0xd812('0x13a')});db[_0xd812('0x42')][_0xd812('0xf3')](db['FaxApplication'],{'as':_0xd812('0x11e')});db[_0xd812('0x42')][_0xd812('0xf3')](db['VoiceExtension'],{'as':_0xd812('0x14d'),'onDelete':'cascade'});db[_0xd812('0x42')][_0xd812('0xf3')](db[_0xd812('0x47')],{'as':'Messages'});db[_0xd812('0x42')][_0xd812('0xfb')](db[_0xd812('0x25')],{'as':_0xd812('0x25')});db[_0xd812('0x42')][_0xd812('0xfb')](db[_0xd812('0xe5')],{'as':'List','foreignKey':_0xd812('0x13c')});db[_0xd812('0x42')][_0xd812('0xfb')](db['Pause'],{'as':_0xd812('0x12a'),'foreignKey':_0xd812('0x14e')});db[_0xd812('0x42')][_0xd812('0xfd')](db[_0xd812('0x12')],{'as':_0xd812('0x12c'),'through':_0xd812('0x113')});db[_0xd812('0x14f')][_0xd812('0xfb')](db[_0xd812('0x12')],{'onDelete':_0xd812('0x14a')});db['FaxApplication']['belongsTo'](db[_0xd812('0x150')],{'onDelete':_0xd812('0x14a')});db['FaxApplication'][_0xd812('0xfb')](db[_0xd812('0x42')],{'onDelete':_0xd812('0x14a')});db['FaxApplication'][_0xd812('0xfb')](db[_0xd812('0x143')],{'onDelete':_0xd812('0x14a'),'foreignKey':_0xd812('0x14b')});db[_0xd812('0x45')][_0xd812('0xf3')](db['FaxMessage'],{'as':_0xd812('0x130'),'onDelete':_0xd812('0xef'),'foreignKey':_0xd812('0x151')});db[_0xd812('0x45')][_0xd812('0xfb')](db['FaxAccount'],{'as':'Account','foreignKey':_0xd812('0x152')});db['FaxInteraction']['belongsTo'](db['CmContact'],{'as':_0xd812('0x141'),'foreignKey':'ContactId'});db[_0xd812('0x45')]['belongsTo'](db[_0xd812('0x12')],{'as':_0xd812('0x142'),'foreignKey':_0xd812('0xf0')});db[_0xd812('0x45')][_0xd812('0xfd')](db[_0xd812('0x143')],{'through':_0xd812('0x153'),'as':_0xd812('0x154')});db[_0xd812('0x45')]['belongsToMany'](db[_0xd812('0x143')],{'through':'fax_interaction_has_tags','as':'ThroughTags'});db[_0xd812('0x45')][_0xd812('0xfd')](db['User'],{'as':_0xd812('0x145'),'through':'user_has_fax_interactions','foreignKey':'FaxInteractionId'});db[_0xd812('0x47')][_0xd812('0xfb')](db[_0xd812('0x12')],{'onDelete':'cascade','as':'User'});db['FaxMessage'][_0xd812('0xfb')](db[_0xd812('0x45')],{'as':_0xd812('0x148'),'foreignKey':_0xd812('0x151')});db[_0xd812('0x47')][_0xd812('0xfb')](db[_0xd812('0x62')],{'onDelete':_0xd812('0xef'),'as':_0xd812('0x141')});db['FaxMessage'][_0xd812('0xfb')](db[_0xd812('0x146')],{'as':_0xd812('0x146'),'foreignKey':'AttachmentId'});db[_0xd812('0x47')][_0xd812('0xfb')](db['FaxAccount'],{'as':_0xd812('0x149'),'foreignKey':_0xd812('0x152')});db[_0xd812('0x150')][_0xd812('0xfd')](db[_0xd812('0x12')],{'as':_0xd812('0x12c'),'through':_0xd812('0x2c')});db['FaxQueue'][_0xd812('0xfd')](db[_0xd812('0xd6')],{'through':'team_has_fax_queues','as':_0xd812('0x13f')});db[_0xd812('0x155')][_0xd812('0xfb')](db[_0xd812('0x42')],{});db[_0xd812('0x155')][_0xd812('0xfb')](db['CmList'],{'as':_0xd812('0x13b'),'foreignKey':_0xd812('0x13c')});db[_0xd812('0x155')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0xd812('0x135')});db[_0xd812('0x155')][_0xd812('0xfb')](db[_0xd812('0x45')],{});db['FaxQueueReport'][_0xd812('0xfb')](db[_0xd812('0x47')],{});db['FaxQueueReport']['belongsTo'](db[_0xd812('0x12')],{});db[_0xd812('0x155')][_0xd812('0xfb')](db[_0xd812('0x150')],{});db[_0xd812('0x4a')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':'SmsAccountId'});db[_0xd812('0x4a')][_0xd812('0xf3')](db[_0xd812('0x6e')],{'as':'Answers','foreignKey':_0xd812('0x156')});db['SmsAccount'][_0xd812('0xf3')](db['SmsMessage'],{'as':_0xd812('0x130'),'foreignKey':_0xd812('0x156')});db[_0xd812('0x4a')][_0xd812('0xf3')](db[_0xd812('0x4d')],{'as':_0xd812('0x13a')});db[_0xd812('0x4a')][_0xd812('0xf3')](db[_0xd812('0x157')],{'as':'Applications'});db[_0xd812('0x4a')][_0xd812('0xfb')](db[_0xd812('0xe5')],{'as':_0xd812('0x13b'),'foreignKey':'ListId'});db[_0xd812('0x4a')][_0xd812('0xfb')](db['Pause'],{'as':_0xd812('0x12a'),'foreignKey':_0xd812('0x14e')});db['SmsAccount'][_0xd812('0xfd')](db['User'],{'as':'Agents','through':_0xd812('0x11a')});db['SmsApplication'][_0xd812('0xfb')](db[_0xd812('0x12')],{'onDelete':_0xd812('0x14a')});db[_0xd812('0x157')]['belongsTo'](db['SmsQueue'],{'onDelete':_0xd812('0x14a')});db[_0xd812('0x157')][_0xd812('0xfb')](db[_0xd812('0x4a')],{'onDelete':_0xd812('0x14a')});db['SmsApplication']['belongsTo'](db['Interval'],{'onDelete':_0xd812('0x14a'),'foreignKey':_0xd812('0x129')});db[_0xd812('0x157')][_0xd812('0xfb')](db[_0xd812('0x143')],{'onDelete':'restrict','foreignKey':_0xd812('0x14b')});db[_0xd812('0x4d')]['hasMany'](db[_0xd812('0x158')],{'as':_0xd812('0x130'),'onDelete':_0xd812('0xef'),'foreignKey':_0xd812('0x159')});db[_0xd812('0x4d')][_0xd812('0xfb')](db[_0xd812('0x4a')],{'as':_0xd812('0x149'),'foreignKey':_0xd812('0x156')});db[_0xd812('0x4d')][_0xd812('0xfb')](db[_0xd812('0x62')],{'as':'Contact','foreignKey':_0xd812('0x135')});db[_0xd812('0x4d')]['belongsTo'](db['User'],{'as':_0xd812('0x142'),'foreignKey':_0xd812('0xf0')});db[_0xd812('0x4d')]['belongsToMany'](db[_0xd812('0x143')],{'through':_0xd812('0x15a'),'as':_0xd812('0x154')});db[_0xd812('0x4d')][_0xd812('0xfd')](db[_0xd812('0x143')],{'through':'sms_interaction_has_tags','as':_0xd812('0x15b')});db['SmsInteraction']['belongsToMany'](db[_0xd812('0x12')],{'as':'Users','through':_0xd812('0x15c'),'foreignKey':_0xd812('0x159')});db[_0xd812('0x158')][_0xd812('0xfb')](db['User'],{'as':_0xd812('0x12')});db['SmsMessage'][_0xd812('0xfb')](db[_0xd812('0x62')],{'onDelete':_0xd812('0xef'),'as':_0xd812('0x141')});db[_0xd812('0x158')]['belongsTo'](db['SmsInteraction'],{'onDelete':_0xd812('0xef'),'as':_0xd812('0x148'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0xd812('0xfb')](db[_0xd812('0x4a')],{'as':_0xd812('0x149'),'foreignKey':'SmsAccountId'});db[_0xd812('0x15d')][_0xd812('0xfd')](db[_0xd812('0x12')],{'as':_0xd812('0x12c'),'through':_0xd812('0x10e'),'foreignKey':'SmsQueueId'});db[_0xd812('0x15d')]['belongsToMany'](db[_0xd812('0xd6')],{'through':_0xd812('0x15e'),'as':_0xd812('0x13f')});db[_0xd812('0x116')][_0xd812('0xf3')](db[_0xd812('0x70')],{'as':_0xd812('0x138'),'foreignKey':_0xd812('0x15f')});db[_0xd812('0x116')][_0xd812('0xf3')](db[_0xd812('0x6e')],{'as':_0xd812('0x160'),'foreignKey':_0xd812('0x15f')});db[_0xd812('0x116')][_0xd812('0xf3')](db[_0xd812('0x52')],{'as':_0xd812('0x13a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount']['hasMany'](db[_0xd812('0x54')],{'as':_0xd812('0x130'),'foreignKey':_0xd812('0x15f')});db[_0xd812('0x116')][_0xd812('0xf3')](db[_0xd812('0x50')],{'as':_0xd812('0x11e'),'foreignKey':_0xd812('0x15f')});db[_0xd812('0x116')][_0xd812('0xfb')](db[_0xd812('0xe5')],{'as':_0xd812('0x13b'),'foreignKey':'ListId'});db[_0xd812('0x116')][_0xd812('0xfb')](db[_0xd812('0x75')],{'as':_0xd812('0x12a'),'foreignKey':_0xd812('0x14e')});db[_0xd812('0x116')]['belongsToMany'](db[_0xd812('0x12')],{'as':_0xd812('0x12c'),'through':_0xd812('0x118')});db[_0xd812('0x50')][_0xd812('0xfb')](db[_0xd812('0x12')],{'onDelete':_0xd812('0x14a')});db['OpenchannelApplication'][_0xd812('0xfb')](db[_0xd812('0x56')],{'onDelete':_0xd812('0x14a'),'foreignKey':'OpenchannelQueueId'});db[_0xd812('0x50')][_0xd812('0xfb')](db[_0xd812('0x116')],{'onDelete':_0xd812('0x14a'),'foreignKey':_0xd812('0x15f')});db[_0xd812('0x50')][_0xd812('0xfb')](db[_0xd812('0x74')],{'onDelete':_0xd812('0x14a'),'foreignKey':'IntervalId'});db['OpenchannelApplication']['belongsTo'](db[_0xd812('0x143')],{'onDelete':_0xd812('0x14a'),'foreignKey':_0xd812('0x14b')});db[_0xd812('0x52')][_0xd812('0xf3')](db[_0xd812('0x54')],{'as':'Messages','onDelete':_0xd812('0xef'),'foreignKey':'OpenchannelInteractionId'});db[_0xd812('0x52')][_0xd812('0xfb')](db[_0xd812('0x116')],{'as':_0xd812('0x149'),'foreignKey':_0xd812('0x15f')});db[_0xd812('0x52')][_0xd812('0xfb')](db['CmContact'],{'as':_0xd812('0x141'),'foreignKey':_0xd812('0x135')});db[_0xd812('0x52')][_0xd812('0xfb')](db[_0xd812('0x12')],{'as':_0xd812('0x142'),'foreignKey':_0xd812('0xf0')});db[_0xd812('0x52')][_0xd812('0xfd')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':'Tags'});db[_0xd812('0x52')][_0xd812('0xfd')](db[_0xd812('0x143')],{'through':_0xd812('0x161'),'as':_0xd812('0x15b')});db[_0xd812('0x52')][_0xd812('0xfd')](db[_0xd812('0x12')],{'as':_0xd812('0x145'),'through':_0xd812('0x162'),'foreignKey':_0xd812('0x163')});db[_0xd812('0x54')]['belongsTo'](db[_0xd812('0x12')],{'onDelete':_0xd812('0xef'),'as':'User'});db['OpenchannelMessage'][_0xd812('0xfb')](db[_0xd812('0x62')],{'onDelete':_0xd812('0xef'),'as':'Contact'});db[_0xd812('0x54')][_0xd812('0xfb')](db['OpenchannelInteraction'],{'onDelete':_0xd812('0xef'),'as':_0xd812('0x148'),'foreignKey':'OpenchannelInteractionId'});db[_0xd812('0x54')][_0xd812('0xfb')](db[_0xd812('0x146')],{'as':_0xd812('0x146'),'foreignKey':_0xd812('0x164')});db[_0xd812('0x54')]['belongsTo'](db[_0xd812('0x116')],{'as':_0xd812('0x149'),'foreignKey':'OpenchannelAccountId'});db[_0xd812('0x56')][_0xd812('0xfd')](db[_0xd812('0x12')],{'as':'Agents','through':_0xd812('0x165'),'foreignKey':_0xd812('0x166')});db['OpenchannelQueue'][_0xd812('0xfd')](db[_0xd812('0xd6')],{'through':_0xd812('0x167'),'as':_0xd812('0x13f')});db[_0xd812('0x58')][_0xd812('0xf3')](db[_0xd812('0x70')],{'as':_0xd812('0x138'),'foreignKey':_0xd812('0x168')});db['ChatWebsite'][_0xd812('0xf3')](db[_0xd812('0x6e')],{'as':_0xd812('0x160'),'foreignKey':_0xd812('0x168')});db[_0xd812('0x58')]['hasMany'](db['ChatProactiveAction'],{'as':'ProactiveActions'});db['ChatWebsite'][_0xd812('0xf3')](db['ChatInteraction'],{'as':_0xd812('0x13a')});db['ChatWebsite'][_0xd812('0xf3')](db[_0xd812('0x169')],{'as':_0xd812('0x11e')});db[_0xd812('0x58')][_0xd812('0xf3')](db[_0xd812('0x16a')],{'as':'Messages'});db[_0xd812('0x58')][_0xd812('0xfb')](db['CmList'],{'as':_0xd812('0x13b'),'foreignKey':_0xd812('0x13c')});db['ChatWebsite'][_0xd812('0xfb')](db[_0xd812('0x74')],{'as':_0xd812('0x74'),'foreignKey':_0xd812('0x129')});db['ChatWebsite'][_0xd812('0xfb')](db['Pause'],{'as':_0xd812('0x12a'),'foreignKey':_0xd812('0x14e')});db[_0xd812('0x58')][_0xd812('0xfd')](db['User'],{'as':'Agents','through':'user_has_chat_websites'});db['OpenchannelQueueReport']['belongsTo'](db[_0xd812('0x116')],{});db['OpenchannelQueueReport'][_0xd812('0xfb')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0xd812('0x16b')]['belongsTo'](db[_0xd812('0x62')],{'as':'Contact','foreignKey':_0xd812('0x135')});db[_0xd812('0x16b')][_0xd812('0xfb')](db[_0xd812('0x52')],{});db[_0xd812('0x16b')][_0xd812('0xfb')](db[_0xd812('0x54')],{});db[_0xd812('0x16b')]['belongsTo'](db[_0xd812('0x12')],{});db[_0xd812('0x16b')][_0xd812('0xfb')](db['OpenchannelQueue'],{});db['ChatApplication'][_0xd812('0xfb')](db[_0xd812('0x12')],{'as':_0xd812('0x16c'),'foreignKey':'UserId','onDelete':_0xd812('0x14a')});db[_0xd812('0x169')]['belongsTo'](db[_0xd812('0x5d')],{'as':_0xd812('0x16d'),'foreignKey':_0xd812('0x16e'),'onDelete':_0xd812('0x14a')});db[_0xd812('0x169')]['belongsTo'](db[_0xd812('0x58')],{'as':'Website','foreignKey':_0xd812('0x168'),'onDelete':_0xd812('0x14a')});db['ChatApplication'][_0xd812('0xfb')](db['Tag'],{'onDelete':_0xd812('0x14a'),'foreignKey':'TagId'});db[_0xd812('0x59')][_0xd812('0xf3')](db[_0xd812('0x16a')],{'as':_0xd812('0x130'),'onDelete':_0xd812('0xef'),'foreignKey':'ChatInteractionId'});db[_0xd812('0x59')][_0xd812('0xfb')](db[_0xd812('0x58')],{'as':_0xd812('0x149'),'foreignKey':_0xd812('0x168')});db[_0xd812('0x59')][_0xd812('0xfb')](db[_0xd812('0x62')],{'as':_0xd812('0x141'),'foreignKey':_0xd812('0x135')});db[_0xd812('0x59')]['belongsTo'](db[_0xd812('0x12')],{'as':_0xd812('0x142'),'foreignKey':'UserId'});db['ChatInteraction'][_0xd812('0xfd')](db[_0xd812('0x143')],{'through':_0xd812('0x16f'),'as':'Tags'});db[_0xd812('0x59')][_0xd812('0xfd')](db[_0xd812('0x143')],{'through':_0xd812('0x16f'),'as':_0xd812('0x15b')});db[_0xd812('0x59')]['belongsToMany'](db[_0xd812('0x12')],{'as':_0xd812('0x145'),'through':_0xd812('0x105'),'foreignKey':_0xd812('0x170')});db['ChatMessage'][_0xd812('0xfb')](db[_0xd812('0x12')],{'onDelete':'cascade','as':_0xd812('0x12')});db[_0xd812('0x16a')]['belongsTo'](db[_0xd812('0x62')],{'onDelete':'cascade','as':'Contact','foreignKey':_0xd812('0x135')});db['ChatMessage'][_0xd812('0xfb')](db[_0xd812('0x59')],{'onDelete':_0xd812('0xef'),'as':_0xd812('0x148'),'foreignKey':_0xd812('0x170')});db['ChatMessage'][_0xd812('0xfb')](db[_0xd812('0x146')],{'as':_0xd812('0x146'),'foreignKey':'AttachmentId'});db[_0xd812('0x16a')]['belongsTo'](db[_0xd812('0x58')],{'as':_0xd812('0x149'),'foreignKey':_0xd812('0x168')});db['ChatOfflineMessage']['belongsTo'](db[_0xd812('0x62')],{'onDelete':_0xd812('0xef'),'as':'Contact','foreignKey':_0xd812('0x135')});db['ChatOfflineMessage'][_0xd812('0xfb')](db[_0xd812('0x58')],{'as':'Account','foreignKey':_0xd812('0x168')});db[_0xd812('0x5d')][_0xd812('0xfd')](db['User'],{'as':_0xd812('0x12c'),'through':'UserChatQueue','hooks':!![]});db[_0xd812('0x5d')]['belongsToMany'](db[_0xd812('0xd6')],{'through':_0xd812('0x171'),'as':'Teams'});db['ChatGroup'][_0xd812('0xf3')](db[_0xd812('0xc2')],{'as':_0xd812('0x130'),'foreignKey':_0xd812('0x172'),'onDelete':_0xd812('0xef')});db[_0xd812('0x5e')][_0xd812('0xfd')](db[_0xd812('0x12')],{'as':'Members','through':_0xd812('0xfe')});db[_0xd812('0x173')]['belongsTo'](db[_0xd812('0x58')],{'as':_0xd812('0x174'),'foreignKey':_0xd812('0x168')});db[_0xd812('0x175')][_0xd812('0xf3')](db[_0xd812('0x62')],{'as':'Contacts','foreignKey':_0xd812('0x176')});db['CmContact'][_0xd812('0xf3')](db['CmHopper'],{'as':'Hoppers','foreignKey':'ContactId'});db['CmContact'][_0xd812('0xf3')](db[_0xd812('0x68')],{'as':_0xd812('0xf7'),'foreignKey':_0xd812('0x135')});db['CmContact'][_0xd812('0xf3')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xd812('0x135')});db[_0xd812('0x62')]['hasMany'](db['ReportAgentPreview'],{'as':_0xd812('0x6c'),'foreignKey':'ContactId'});db[_0xd812('0x62')][_0xd812('0xf3')](db[_0xd812('0xc8')],{'as':_0xd812('0x126'),'foreignKey':'ContactId'});db[_0xd812('0x62')][_0xd812('0xf3')](db[_0xd812('0x52')],{'as':_0xd812('0xf9'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xd812('0x62')]['hasMany'](db[_0xd812('0x59')],{'as':'ChatInteractions','foreignKey':_0xd812('0x135'),'onDelete':'restrict'});db[_0xd812('0x62')]['hasMany'](db[_0xd812('0x4d')],{'as':_0xd812('0x107'),'foreignKey':_0xd812('0x135'),'onDelete':_0xd812('0x14a')});db['CmContact']['hasMany'](db[_0xd812('0x45')],{'as':_0xd812('0xfa'),'foreignKey':_0xd812('0x135'),'onDelete':_0xd812('0x14a')});db[_0xd812('0x62')]['hasMany'](db[_0xd812('0x37')],{'as':_0xd812('0x102'),'foreignKey':_0xd812('0x135'),'onDelete':_0xd812('0x14a')});db[_0xd812('0x62')][_0xd812('0xfb')](db[_0xd812('0x175')],{'as':_0xd812('0x177'),'foreignKey':_0xd812('0x176')});db[_0xd812('0x62')][_0xd812('0xfb')](db['CmList'],{'as':_0xd812('0x13b'),'foreignKey':_0xd812('0x13c'),'onDelete':'cascade'});db[_0xd812('0x62')]['belongsToMany'](db['User'],{'as':_0xd812('0x145'),'through':_0xd812('0x100')});db[_0xd812('0x62')][_0xd812('0xfd')](db['Tag'],{'as':_0xd812('0x154'),'through':_0xd812('0x178')});db[_0xd812('0x62')][_0xd812('0xfd')](db[_0xd812('0x143')],{'through':_0xd812('0x178'),'as':_0xd812('0x15b')});db['CmHopper'][_0xd812('0xfb')](db[_0xd812('0x62')],{'as':_0xd812('0x141'),'foreignKey':_0xd812('0x135'),'onDelete':_0xd812('0xef')});db['CmHopper'][_0xd812('0xfb')](db[_0xd812('0xe5')],{'as':_0xd812('0x13b'),'foreignKey':'ListId','onDelete':_0xd812('0xef')});db[_0xd812('0x64')][_0xd812('0xfb')](db[_0xd812('0x12')],{'as':_0xd812('0x16c'),'foreignKey':_0xd812('0xf0')});db[_0xd812('0x64')][_0xd812('0xfb')](db[_0xd812('0x1a')],{'as':_0xd812('0x16d'),'foreignKey':_0xd812('0x123'),'onDelete':_0xd812('0xef')});db['CmHopper'][_0xd812('0xfb')](db[_0xd812('0xda')],{'as':_0xd812('0xda'),'foreignKey':_0xd812('0x179'),'onDelete':'cascade'});db[_0xd812('0x64')]['belongsTo'](db[_0xd812('0x12')],{'as':_0xd812('0x142'),'foreignKey':_0xd812('0x17a')});db['CmHopperBlack']['belongsTo'](db[_0xd812('0x62')],{'as':_0xd812('0x141'),'foreignKey':_0xd812('0x135'),'onDelete':'cascade'});db[_0xd812('0x66')]['belongsTo'](db[_0xd812('0xe5')],{'as':'List','foreignKey':_0xd812('0x13c'),'onDelete':_0xd812('0xef')});db[_0xd812('0x66')][_0xd812('0xfb')](db[_0xd812('0x1a')],{'as':_0xd812('0x16d'),'foreignKey':_0xd812('0x123'),'onDelete':'cascade'});db[_0xd812('0x66')][_0xd812('0xfb')](db[_0xd812('0xda')],{'as':_0xd812('0xda'),'foreignKey':'CampaignId','onDelete':'cascade'});db[_0xd812('0x17b')][_0xd812('0xf3')](db[_0xd812('0x72')],{'as':{'plural':'All','singular':_0xd812('0x17c')},'foreignKey':_0xd812('0x17d'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0xd812('0xf3')](db[_0xd812('0x72')],{'as':{'plural':_0xd812('0x17e'),'singular':_0xd812('0x17f')},'foreignKey':'AutomationAnyId','onDelete':_0xd812('0xef'),'hooks':!![]});db[_0xd812('0x17b')][_0xd812('0xf3')](db[_0xd812('0x6d')],{'as':_0xd812('0x180'),'foreignKey':_0xd812('0x181'),'onDelete':_0xd812('0xef'),'hooks':!![]});db[_0xd812('0x74')][_0xd812('0xf3')](db[_0xd812('0x74')],{'as':_0xd812('0x182'),'foreignKey':_0xd812('0x129'),'onDelete':_0xd812('0xef'),'hooks':!![],'required':![]});db[_0xd812('0x74')][_0xd812('0xf3')](db[_0xd812('0x18')],{'as':_0xd812('0xf6'),'foreignKey':_0xd812('0x129'),'onDelete':_0xd812('0x14a')});db['Interval']['hasMany'](db[_0xd812('0x3b')],{'as':'MailApplications','foreignKey':'IntervalId'});db[_0xd812('0x74')][_0xd812('0xf3')](db[_0xd812('0x169')],{'as':'ChatApplications','foreignKey':_0xd812('0x129')});db[_0xd812('0x74')]['hasMany'](db[_0xd812('0x14f')],{'as':'FaxApplications','foreignKey':_0xd812('0x129')});db[_0xd812('0x74')][_0xd812('0xf3')](db[_0xd812('0x157')],{'as':_0xd812('0x183'),'foreignKey':_0xd812('0x129')});db[_0xd812('0x7b')]['belongsTo'](db['MailAccount'],{});db[_0xd812('0x7b')][_0xd812('0xfb')](db[_0xd812('0x184')],{'foreignKey':_0xd812('0x185')});db[_0xd812('0x7b')]['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0xd812('0x186')});db[_0xd812('0x7d')][_0xd812('0xfd')](db[_0xd812('0x11f')],{'as':_0xd812('0x187'),'through':_0xd812('0x121'),'onDelete':'restrict'});db['Tag'][_0xd812('0xfd')](db[_0xd812('0x62')],{'through':_0xd812('0x178')});db[_0xd812('0x143')][_0xd812('0xfd')](db['ChatInteraction'],{'through':_0xd812('0x16f')});db[_0xd812('0x143')][_0xd812('0xfd')](db[_0xd812('0x37')],{'through':_0xd812('0x144')});db['Tag'][_0xd812('0xfd')](db['SmsInteraction'],{'through':'sms_interaction_has_tags'});db[_0xd812('0x143')][_0xd812('0xfd')](db['FaxInteraction'],{'through':'fax_interaction_has_tags'});db[_0xd812('0x143')][_0xd812('0xfd')](db[_0xd812('0x52')],{'through':_0xd812('0x161')});db['Trigger']['hasMany'](db[_0xd812('0x72')],{'as':{'plural':_0xd812('0x188'),'singular':_0xd812('0x189')},'foreignKey':_0xd812('0x18a'),'onDelete':'cascade','hooks':!![]});db[_0xd812('0x80')][_0xd812('0xf3')](db[_0xd812('0x72')],{'as':{'plural':_0xd812('0x18b'),'singular':_0xd812('0x18c')},'foreignKey':_0xd812('0x18d'),'onDelete':_0xd812('0xef'),'hooks':!![]});db[_0xd812('0x80')][_0xd812('0xf3')](db[_0xd812('0x6d')],{'as':_0xd812('0x180'),'foreignKey':_0xd812('0x18e'),'onDelete':_0xd812('0xef'),'hooks':!![]});db['AnalyticCustomReport'][_0xd812('0xf3')](db[_0xd812('0x8e')],{'as':_0xd812('0x18f'),'onDelete':_0xd812('0xef'),'foreignKey':_0xd812('0x186'),'hooks':!![]});db['AnalyticDefaultReport'][_0xd812('0xf3')](db[_0xd812('0x8e')],{'as':'Fields','onDelete':_0xd812('0xef'),'foreignKey':_0xd812('0x185')});db[_0xd812('0x8c')]['hasMany'](db[_0xd812('0x8e')],{'as':_0xd812('0x18f'),'onDelete':_0xd812('0xef'),'foreignKey':_0xd812('0x190')});db[_0xd812('0x8e')][_0xd812('0xfb')](db[_0xd812('0x8c')],{'foreignKey':_0xd812('0x190')});db[_0xd812('0x191')][_0xd812('0xf3')](db[_0xd812('0x91')],{'as':_0xd812('0x192'),'onDelete':_0xd812('0xef'),'foreignKey':_0xd812('0x193')});db[_0xd812('0x91')][_0xd812('0xf3')](db['SalesforceField'],{'as':_0xd812('0x194'),'onDelete':_0xd812('0xef'),'foreignKey':_0xd812('0x195')});db[_0xd812('0x91')][_0xd812('0xf3')](db[_0xd812('0x92')],{'as':'Descriptions','onDelete':_0xd812('0xef'),'foreignKey':_0xd812('0x196')});db[_0xd812('0x91')][_0xd812('0xf3')](db[_0xd812('0x92')],{'as':_0xd812('0x18f'),'onDelete':_0xd812('0xef'),'foreignKey':'FieldId'});db['SalesforceConfiguration'][_0xd812('0xfb')](db[_0xd812('0x191')],{'as':_0xd812('0x149'),'foreignKey':_0xd812('0x193')});db[_0xd812('0x92')]['hasMany'](db['SalesforceField'],{'as':_0xd812('0x197'),'foreignKey':_0xd812('0x195')});db[_0xd812('0x92')][_0xd812('0xf3')](db[_0xd812('0x92')],{'as':_0xd812('0x198'),'foreignKey':'DescriptionId'});db[_0xd812('0x92')][_0xd812('0xf3')](db[_0xd812('0x92')],{'as':_0xd812('0x199'),'foreignKey':'FieldId'});db[_0xd812('0x92')][_0xd812('0xfb')](db[_0xd812('0x82')],{'as':_0xd812('0x82'),'foreignKey':'VariableId'});db[_0xd812('0x94')][_0xd812('0xf3')](db[_0xd812('0x95')],{'as':'Configurations','onDelete':_0xd812('0xef'),'foreignKey':_0xd812('0x193')});db[_0xd812('0x95')][_0xd812('0xf3')](db[_0xd812('0x96')],{'as':_0xd812('0x194'),'onDelete':_0xd812('0xef'),'foreignKey':'SubjectId'});db[_0xd812('0x95')]['hasMany'](db['SugarcrmField'],{'as':_0xd812('0x19a'),'onDelete':_0xd812('0xef'),'foreignKey':_0xd812('0x196')});db[_0xd812('0x95')]['hasMany'](db[_0xd812('0x96')],{'as':'Fields','onDelete':_0xd812('0xef'),'foreignKey':_0xd812('0x19b')});db[_0xd812('0x95')][_0xd812('0xfb')](db['SugarcrmAccount'],{'as':_0xd812('0x149'),'foreignKey':_0xd812('0x193')});db[_0xd812('0x96')]['hasMany'](db[_0xd812('0x96')],{'as':_0xd812('0x197'),'foreignKey':_0xd812('0x195')});db[_0xd812('0x96')][_0xd812('0xf3')](db[_0xd812('0x96')],{'as':_0xd812('0x198'),'foreignKey':_0xd812('0x196')});db[_0xd812('0x96')]['hasMany'](db['SugarcrmField'],{'as':'Field','foreignKey':_0xd812('0x19b')});db[_0xd812('0x96')][_0xd812('0xfb')](db[_0xd812('0x82')],{'as':_0xd812('0x82'),'foreignKey':_0xd812('0x19c')});db[_0xd812('0x98')]['hasMany'](db[_0xd812('0x9a')],{'as':_0xd812('0x192'),'onDelete':_0xd812('0xef'),'foreignKey':_0xd812('0x193')});db[_0xd812('0x9a')][_0xd812('0xf3')](db[_0xd812('0x19d')],{'as':_0xd812('0x194'),'onDelete':'cascade','foreignKey':'SubjectId'});db['DeskConfiguration'][_0xd812('0xf3')](db[_0xd812('0x19d')],{'as':_0xd812('0x19a'),'onDelete':_0xd812('0xef'),'foreignKey':_0xd812('0x196')});db[_0xd812('0x9a')][_0xd812('0xf3')](db[_0xd812('0x19d')],{'as':_0xd812('0x18f'),'onDelete':_0xd812('0xef'),'foreignKey':'FieldId'});db[_0xd812('0x9a')][_0xd812('0xfb')](db[_0xd812('0x98')],{'as':'Account','foreignKey':'AccountId'});db['DeskConfiguration'][_0xd812('0xfd')](db[_0xd812('0x143')],{'through':'int_desk_configuration_has_tags'});db[_0xd812('0x19d')][_0xd812('0xf3')](db[_0xd812('0x19d')],{'as':_0xd812('0x197'),'foreignKey':_0xd812('0x195')});db[_0xd812('0x19d')][_0xd812('0xf3')](db[_0xd812('0x19d')],{'as':_0xd812('0x198'),'foreignKey':_0xd812('0x196')});db[_0xd812('0x19d')][_0xd812('0xf3')](db[_0xd812('0x19d')],{'as':'Field','foreignKey':'FieldId'});db['DeskField'][_0xd812('0xfb')](db[_0xd812('0x82')],{'as':_0xd812('0x82'),'foreignKey':_0xd812('0x19c')});db[_0xd812('0x19e')]['hasMany'](db[_0xd812('0x9c')],{'as':'Configurations','onDelete':_0xd812('0xef'),'foreignKey':_0xd812('0x193')});db['ZohoConfiguration'][_0xd812('0xf3')](db['ZohoField'],{'as':_0xd812('0x194'),'onDelete':_0xd812('0xef'),'foreignKey':_0xd812('0x195')});db[_0xd812('0x9c')]['hasMany'](db[_0xd812('0x9e')],{'as':_0xd812('0x19a'),'onDelete':_0xd812('0xef'),'foreignKey':'DescriptionId'});db[_0xd812('0x9c')][_0xd812('0xf3')](db['ZohoField'],{'as':'Fields','onDelete':'cascade','foreignKey':_0xd812('0x19b')});db[_0xd812('0x9c')]['belongsTo'](db[_0xd812('0x19e')],{'as':'Account','foreignKey':_0xd812('0x193')});db[_0xd812('0x9e')][_0xd812('0xf3')](db[_0xd812('0x9e')],{'as':'Subject','foreignKey':_0xd812('0x195')});db['ZohoField']['hasMany'](db[_0xd812('0x9e')],{'as':_0xd812('0x198'),'foreignKey':_0xd812('0x196')});db[_0xd812('0x9e')]['hasMany'](db['ZohoField'],{'as':_0xd812('0x199'),'foreignKey':_0xd812('0x19b')});db[_0xd812('0x9e')][_0xd812('0xfb')](db['Variable'],{'as':'Variable','foreignKey':_0xd812('0x19c')});db['ZendeskAccount'][_0xd812('0xf3')](db[_0xd812('0xa1')],{'as':'Configurations','onDelete':_0xd812('0xef'),'foreignKey':'AccountId'});db[_0xd812('0xa1')][_0xd812('0xf3')](db[_0xd812('0x19f')],{'as':_0xd812('0x194'),'foreignKey':_0xd812('0x195')});db[_0xd812('0xa1')][_0xd812('0xf3')](db[_0xd812('0x19f')],{'as':_0xd812('0x19a'),'foreignKey':_0xd812('0x196')});db['ZendeskConfiguration']['hasMany'](db[_0xd812('0x19f')],{'as':_0xd812('0x18f'),'foreignKey':_0xd812('0x19b')});db[_0xd812('0xa1')][_0xd812('0xfb')](db[_0xd812('0xa0')],{'as':_0xd812('0x149'),'foreignKey':_0xd812('0x193')});db[_0xd812('0xa1')][_0xd812('0xfd')](db['Tag'],{'through':_0xd812('0x1a0')});db[_0xd812('0x19f')][_0xd812('0xf3')](db[_0xd812('0x19f')],{'as':'Subject','foreignKey':_0xd812('0x195')});db[_0xd812('0x19f')]['hasMany'](db[_0xd812('0x19f')],{'as':'Description','foreignKey':_0xd812('0x196')});db[_0xd812('0x19f')]['hasMany'](db[_0xd812('0x19f')],{'as':_0xd812('0x199'),'foreignKey':'FieldId'});db[_0xd812('0x19f')]['belongsTo'](db['Variable'],{'as':_0xd812('0x82'),'foreignKey':_0xd812('0x19c')});db[_0xd812('0xa4')][_0xd812('0xf3')](db[_0xd812('0xa6')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xd812('0x193')});db['FreshdeskConfiguration'][_0xd812('0xf3')](db['FreshdeskField'],{'as':_0xd812('0x194'),'onDelete':_0xd812('0xef'),'foreignKey':_0xd812('0x195')});db[_0xd812('0xa6')][_0xd812('0xf3')](db[_0xd812('0xa8')],{'as':_0xd812('0x19a'),'onDelete':_0xd812('0xef'),'foreignKey':'DescriptionId'});db[_0xd812('0xa6')][_0xd812('0xf3')](db[_0xd812('0xa8')],{'as':_0xd812('0x18f'),'onDelete':_0xd812('0xef'),'foreignKey':_0xd812('0x19b')});db[_0xd812('0xa6')]['belongsTo'](db[_0xd812('0xa4')],{'as':_0xd812('0x149'),'foreignKey':'AccountId'});db[_0xd812('0xa6')][_0xd812('0xfd')](db[_0xd812('0x143')],{'through':_0xd812('0x1a1')});db['FreshdeskField']['hasMany'](db['FreshdeskField'],{'as':_0xd812('0x197'),'foreignKey':_0xd812('0x195')});db[_0xd812('0xa8')][_0xd812('0xf3')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0xd812('0xa8')][_0xd812('0xf3')](db[_0xd812('0xa8')],{'as':_0xd812('0x199'),'foreignKey':'FieldId'});db[_0xd812('0xa8')]['belongsTo'](db[_0xd812('0x82')],{'as':_0xd812('0x82'),'foreignKey':_0xd812('0x19c')});db[_0xd812('0xaa')]['hasMany'](db[_0xd812('0xac')],{'as':'Configurations','onDelete':_0xd812('0xef'),'foreignKey':_0xd812('0x193')});db[_0xd812('0xac')]['hasMany'](db[_0xd812('0x1a2')],{'as':'Subjects','foreignKey':_0xd812('0x195')});db[_0xd812('0xac')]['hasMany'](db[_0xd812('0x1a2')],{'as':_0xd812('0x19a'),'foreignKey':'DescriptionId'});db[_0xd812('0xac')]['hasMany'](db['VtigerField'],{'as':_0xd812('0x18f'),'foreignKey':_0xd812('0x19b')});db[_0xd812('0xac')][_0xd812('0xfb')](db[_0xd812('0xaa')],{'as':_0xd812('0x149'),'foreignKey':_0xd812('0x193')});db[_0xd812('0x1a2')][_0xd812('0xf3')](db[_0xd812('0x1a2')],{'as':'Subject','foreignKey':_0xd812('0x195')});db[_0xd812('0x1a2')]['hasMany'](db[_0xd812('0x1a2')],{'as':_0xd812('0x198'),'foreignKey':'DescriptionId'});db[_0xd812('0x1a2')][_0xd812('0xf3')](db[_0xd812('0x1a2')],{'as':'Field','foreignKey':_0xd812('0x19b')});db['VtigerField']['belongsTo'](db[_0xd812('0x82')],{'as':_0xd812('0x82'),'foreignKey':'VariableId'});db[_0xd812('0xaf')][_0xd812('0xf3')](db[_0xd812('0xb0')],{'as':'Configurations','onDelete':_0xd812('0xef'),'foreignKey':_0xd812('0x193')});db['ServicenowConfiguration'][_0xd812('0xf3')](db[_0xd812('0xb2')],{'as':_0xd812('0x194'),'foreignKey':_0xd812('0x195')});db['ServicenowConfiguration']['hasMany'](db[_0xd812('0xb2')],{'as':_0xd812('0x19a'),'foreignKey':_0xd812('0x196')});db[_0xd812('0xb0')][_0xd812('0xf3')](db[_0xd812('0xb2')],{'as':'Fields','foreignKey':'FieldId'});db['ServicenowConfiguration'][_0xd812('0xfb')](db[_0xd812('0xaf')],{'as':_0xd812('0x149'),'foreignKey':_0xd812('0x193')});db[_0xd812('0xb2')][_0xd812('0xf3')](db['ServicenowField'],{'as':_0xd812('0x197'),'foreignKey':_0xd812('0x195')});db[_0xd812('0xb2')]['hasMany'](db[_0xd812('0xb2')],{'as':_0xd812('0x198'),'foreignKey':_0xd812('0x196')});db[_0xd812('0xb2')][_0xd812('0xf3')](db[_0xd812('0xb2')],{'as':'Field','foreignKey':_0xd812('0x19b')});db['ServicenowField'][_0xd812('0xfb')](db[_0xd812('0x82')],{'as':_0xd812('0x82'),'foreignKey':'VariableId'});db['Dynamics365Account'][_0xd812('0xf3')](db['Dynamics365Configuration'],{'as':'Configurations','onDelete':_0xd812('0xef'),'foreignKey':_0xd812('0x193')});db[_0xd812('0xb6')][_0xd812('0xf3')](db[_0xd812('0x1a3')],{'as':_0xd812('0x194'),'onDelete':_0xd812('0xef'),'foreignKey':'SubjectId'});db['Dynamics365Configuration']['hasMany'](db['Dynamics365Field'],{'as':'Descriptions','onDelete':_0xd812('0xef'),'foreignKey':'DescriptionId'});db[_0xd812('0xb6')][_0xd812('0xf3')](db['Dynamics365Field'],{'as':_0xd812('0x18f'),'onDelete':'cascade','foreignKey':_0xd812('0x19b')});db[_0xd812('0xb6')][_0xd812('0xfb')](db[_0xd812('0xb4')],{'as':_0xd812('0x149'),'foreignKey':_0xd812('0x193')});db[_0xd812('0x1a3')][_0xd812('0xf3')](db['Dynamics365Field'],{'as':'Subject','foreignKey':_0xd812('0x195')});db[_0xd812('0x1a3')][_0xd812('0xf3')](db[_0xd812('0x1a3')],{'as':'Description','foreignKey':_0xd812('0x196')});db[_0xd812('0x1a3')][_0xd812('0xf3')](db[_0xd812('0x1a3')],{'as':_0xd812('0x199'),'foreignKey':_0xd812('0x19b')});db[_0xd812('0x1a3')][_0xd812('0xfb')](db[_0xd812('0x82')],{'as':'Variable','foreignKey':_0xd812('0x19c')});db[_0xd812('0xb9')]['hasMany'](db[_0xd812('0x1a4')],{'as':_0xd812('0x192'),'onDelete':'cascade','foreignKey':_0xd812('0x193')});db[_0xd812('0x1a4')]['hasMany'](db['FreshsalesField'],{'as':_0xd812('0x194'),'foreignKey':'SubjectId'});db['FreshsalesConfiguration'][_0xd812('0xf3')](db[_0xd812('0xbc')],{'as':'Descriptions','foreignKey':_0xd812('0x196')});db[_0xd812('0x1a4')]['hasMany'](db['FreshsalesField'],{'as':_0xd812('0x18f'),'foreignKey':_0xd812('0x19b')});db[_0xd812('0x1a4')]['belongsTo'](db[_0xd812('0xb9')],{'as':'Account','foreignKey':_0xd812('0x193')});db['FreshsalesField'][_0xd812('0xf3')](db[_0xd812('0xbc')],{'as':_0xd812('0x197'),'foreignKey':_0xd812('0x195')});db[_0xd812('0xbc')][_0xd812('0xf3')](db[_0xd812('0xbc')],{'as':'Description','foreignKey':_0xd812('0x196')});db['FreshsalesField'][_0xd812('0xf3')](db[_0xd812('0xbc')],{'as':_0xd812('0x199'),'foreignKey':'FieldId'});db[_0xd812('0xbc')][_0xd812('0xfb')](db[_0xd812('0x82')],{'as':_0xd812('0x82'),'foreignKey':'VariableId'});db[_0xd812('0xc0')]['belongsTo'](db['ChatWebsite'],{});db[_0xd812('0xc0')]['belongsTo'](db['CmList'],{'as':_0xd812('0x13b'),'foreignKey':_0xd812('0x13c')});db[_0xd812('0xc0')]['belongsTo'](db[_0xd812('0x62')],{'as':_0xd812('0x141'),'foreignKey':_0xd812('0x135')});db[_0xd812('0xc0')][_0xd812('0xfb')](db[_0xd812('0x59')],{});db[_0xd812('0xc0')][_0xd812('0xfb')](db[_0xd812('0x16a')],{});db[_0xd812('0xc0')][_0xd812('0xfb')](db[_0xd812('0x12')],{});db[_0xd812('0xc0')]['belongsTo'](db[_0xd812('0x5d')],{});db[_0xd812('0xc2')]['belongsTo'](db[_0xd812('0x12')],{'onDelete':'cascade','foreignKey':_0xd812('0x1a5')});db[_0xd812('0xc2')][_0xd812('0xfb')](db[_0xd812('0x12')],{'onDelete':'cascade','foreignKey':_0xd812('0x1a6')});db['JscriptySessionReport'][_0xd812('0xf3')](db['JscriptyQuestionReport'],{'foreignKey':_0xd812('0x1a7'),'onDelete':_0xd812('0xef')});db[_0xd812('0xc8')][_0xd812('0xf3')](db[_0xd812('0xc4')],{'foreignKey':_0xd812('0x1a7'),'onDelete':_0xd812('0xef')});db[_0xd812('0xca')][_0xd812('0xfb')](db[_0xd812('0x4a')],{});db[_0xd812('0xca')][_0xd812('0xfb')](db[_0xd812('0xe5')],{'as':_0xd812('0x13b'),'foreignKey':'ListId'});db[_0xd812('0xca')][_0xd812('0xfb')](db[_0xd812('0x62')],{'as':_0xd812('0x141'),'foreignKey':_0xd812('0x135')});db[_0xd812('0xca')][_0xd812('0xfb')](db[_0xd812('0x4d')],{});db[_0xd812('0xca')]['belongsTo'](db[_0xd812('0x158')],{});db[_0xd812('0xca')][_0xd812('0xfb')](db['User'],{});db['SmsQueueReport'][_0xd812('0xfb')](db[_0xd812('0x15d')],{});db[_0xd812('0x1a8')][_0xd812('0xf3')](db[_0xd812('0xc8')],{'foreignKey':_0xd812('0x1a9')});db[_0xd812('0x1a8')][_0xd812('0xf3')](db[_0xd812('0xc6')],{'foreignKey':_0xd812('0x1a9')});db[_0xd812('0x1a8')]['hasMany'](db[_0xd812('0xc4')],{'foreignKey':_0xd812('0x1a9')});db['SquareProject']['belongsToMany'](db['User'],{'as':_0xd812('0x145'),'through':_0xd812('0x11b')});db[_0xd812('0xd6')][_0xd812('0xfd')](db[_0xd812('0x12')],{'as':'Agents','through':'user_has_teams'});db[_0xd812('0xd6')][_0xd812('0xfd')](db[_0xd812('0x1a')],{'through':_0xd812('0x1aa'),'as':_0xd812('0x108')});db[_0xd812('0xd6')][_0xd812('0xfd')](db[_0xd812('0x33')],{'through':_0xd812('0x13e'),'as':_0xd812('0x109')});db['Team'][_0xd812('0xfd')](db['ChatQueue'],{'through':_0xd812('0x171'),'as':_0xd812('0x1ab')});db[_0xd812('0xd6')]['belongsToMany'](db[_0xd812('0x150')],{'through':_0xd812('0x1ac'),'as':_0xd812('0x10c')});db[_0xd812('0xd6')]['belongsToMany'](db[_0xd812('0x15d')],{'through':'team_has_sms_queues','as':'SmsQueues'});db['Team'][_0xd812('0xfd')](db['OpenchannelQueue'],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db[_0xd812('0xda')][_0xd812('0xf3')](db[_0xd812('0x64')],{'as':_0xd812('0x122'),'foreignKey':_0xd812('0x179')});db[_0xd812('0xda')][_0xd812('0xf3')](db[_0xd812('0x68')],{'as':_0xd812('0xf7'),'foreignKey':_0xd812('0x179')});db[_0xd812('0xda')][_0xd812('0xf3')](db[_0xd812('0x6a')],{'as':_0xd812('0x124'),'foreignKey':'CampaignId'});db[_0xd812('0xda')][_0xd812('0xf3')](db[_0xd812('0x66')],{'as':'HopperBlacks','foreignKey':_0xd812('0x179')});db[_0xd812('0xda')]['belongsTo'](db[_0xd812('0x25')],{'as':_0xd812('0x25'),'foreignKey':_0xd812('0x1ad')});db[_0xd812('0xda')]['belongsTo'](db[_0xd812('0x25')],{'as':_0xd812('0x127'),'foreignKey':_0xd812('0x128')});db[_0xd812('0xda')]['belongsTo'](db[_0xd812('0x74')],{'as':_0xd812('0x74'),'foreignKey':'IntervalId'});db[_0xd812('0xda')][_0xd812('0xfb')](db[_0xd812('0xd1')],{'as':_0xd812('0xd1'),'foreignKey':_0xd812('0x1ae')});db[_0xd812('0xda')][_0xd812('0xfd')](db['CmList'],{'as':_0xd812('0x101'),'through':'campaigns_has_cm_lists'});db[_0xd812('0xda')][_0xd812('0xfd')](db[_0xd812('0xe5')],{'as':'BlackLists','through':_0xd812('0x1af')});db['MailTransferReport'][_0xd812('0xfb')](db['MailMessage'],{});db[_0xd812('0xde')][_0xd812('0xfb')](db[_0xd812('0x37')],{});db[_0xd812('0xde')][_0xd812('0xfb')](db['MailAccount'],{'foreignKey':_0xd812('0x1b0'),'as':_0xd812('0x1b1')});db[_0xd812('0xde')][_0xd812('0xfb')](db[_0xd812('0x12')],{'foreignKey':_0xd812('0x1b2'),'as':_0xd812('0x1b3')});db['MailTransferReport'][_0xd812('0xfb')](db['User'],{'foreignKey':_0xd812('0x1b4'),'as':'ToAgent'});db[_0xd812('0xde')]['belongsTo'](db[_0xd812('0x33')],{'foreignKey':_0xd812('0x1b5'),'as':_0xd812('0x1b6')});db[_0xd812('0xde')][_0xd812('0xfb')](db[_0xd812('0x31')],{'foreignKey':_0xd812('0x1b7'),'as':_0xd812('0x1b8')});db[_0xd812('0xe0')][_0xd812('0xfb')](db[_0xd812('0x16a')],{});db[_0xd812('0xe0')][_0xd812('0xfb')](db[_0xd812('0x59')],{});db['ChatTransferReport'][_0xd812('0xfb')](db['ChatWebsite'],{'foreignKey':'FromChatWebsiteId','as':_0xd812('0x1b1')});db[_0xd812('0xe0')]['belongsTo'](db[_0xd812('0x12')],{'foreignKey':_0xd812('0x1b2'),'as':_0xd812('0x1b3')});db['ChatTransferReport'][_0xd812('0xfb')](db[_0xd812('0x12')],{'foreignKey':_0xd812('0x1b4'),'as':_0xd812('0x1b9')});db['ChatTransferReport'][_0xd812('0xfb')](db[_0xd812('0x5d')],{'foreignKey':_0xd812('0x1ba'),'as':_0xd812('0x1b6')});db['ChatTransferReport'][_0xd812('0xfb')](db['ChatWebsite'],{'foreignKey':_0xd812('0x1bb'),'as':'ToAccount'});db[_0xd812('0xe1')][_0xd812('0xfb')](db[_0xd812('0x47')],{});db[_0xd812('0xe1')][_0xd812('0xfb')](db[_0xd812('0x45')],{});db[_0xd812('0xe1')][_0xd812('0xfb')](db['FaxAccount'],{'foreignKey':_0xd812('0x1bc'),'as':'FromAccount'});db[_0xd812('0xe1')][_0xd812('0xfb')](db[_0xd812('0x12')],{'foreignKey':_0xd812('0x1b2'),'as':_0xd812('0x1b3')});db[_0xd812('0xe1')][_0xd812('0xfb')](db['User'],{'foreignKey':_0xd812('0x1b4'),'as':'ToAgent'});db[_0xd812('0xe1')][_0xd812('0xfb')](db['FaxQueue'],{'foreignKey':_0xd812('0x1bd'),'as':_0xd812('0x1b6')});db[_0xd812('0xe1')][_0xd812('0xfb')](db[_0xd812('0x42')],{'foreignKey':'ToFaxAccountId','as':'ToAccount'});db[_0xd812('0x1be')]['belongsTo'](db[_0xd812('0x54')],{});db[_0xd812('0x1be')][_0xd812('0xfb')](db[_0xd812('0x52')],{});db['OpenchannelTransferReport'][_0xd812('0xfb')](db[_0xd812('0x116')],{'foreignKey':_0xd812('0x1bf'),'as':_0xd812('0x1b1')});db['OpenchannelTransferReport']['belongsTo'](db[_0xd812('0x12')],{'foreignKey':_0xd812('0x1b2'),'as':_0xd812('0x1b3')});db[_0xd812('0x1be')][_0xd812('0xfb')](db[_0xd812('0x12')],{'foreignKey':_0xd812('0x1b4'),'as':_0xd812('0x1b9')});db[_0xd812('0x1be')][_0xd812('0xfb')](db[_0xd812('0x56')],{'foreignKey':_0xd812('0x1c0'),'as':_0xd812('0x1b6')});db[_0xd812('0x1be')][_0xd812('0xfb')](db[_0xd812('0x116')],{'foreignKey':_0xd812('0x1c1'),'as':_0xd812('0x1b8')});db[_0xd812('0xe4')][_0xd812('0xfb')](db[_0xd812('0x158')],{});db[_0xd812('0xe4')][_0xd812('0xfb')](db[_0xd812('0x4d')],{});db['SmsTransferReport']['belongsTo'](db[_0xd812('0x4a')],{'foreignKey':_0xd812('0x1c2'),'as':_0xd812('0x1b1')});db['SmsTransferReport']['belongsTo'](db[_0xd812('0x12')],{'foreignKey':_0xd812('0x1b2'),'as':_0xd812('0x1b3')});db[_0xd812('0xe4')][_0xd812('0xfb')](db[_0xd812('0x12')],{'foreignKey':_0xd812('0x1b4'),'as':_0xd812('0x1b9')});db[_0xd812('0xe4')][_0xd812('0xfb')](db[_0xd812('0x15d')],{'foreignKey':_0xd812('0x1c3'),'as':_0xd812('0x1b6')});db[_0xd812('0xe4')][_0xd812('0xfb')](db[_0xd812('0x4a')],{'foreignKey':_0xd812('0x1c4'),'as':'ToAccount'});db[_0xd812('0xe5')][_0xd812('0xf3')](db[_0xd812('0x70')],{'as':_0xd812('0x138'),'foreignKey':'ListId'});db['CmList'][_0xd812('0xf3')](db[_0xd812('0x1c5')],{'as':_0xd812('0x1c6'),'foreignKey':_0xd812('0x13c')});db[_0xd812('0xe5')][_0xd812('0xf3')](db[_0xd812('0x62')],{'as':_0xd812('0xff'),'onDelete':'cascade','foreignKey':_0xd812('0x13c')});db[_0xd812('0xe5')][_0xd812('0xf3')](db['CmHopperFinal'],{'as':_0xd812('0xf7'),'foreignKey':_0xd812('0x13c')});db[_0xd812('0xe5')][_0xd812('0xf3')](db[_0xd812('0x6a')],{'as':_0xd812('0xf8'),'foreignKey':_0xd812('0x13c')});db[_0xd812('0xe5')][_0xd812('0xf3')](db[_0xd812('0x6c')],{'as':_0xd812('0x6c'),'foreignKey':_0xd812('0x13c')});db[_0xd812('0xe5')]['belongsToMany'](db[_0xd812('0x1a')],{'as':'Queues','through':_0xd812('0x12b')});db[_0xd812('0xe5')][_0xd812('0xfd')](db[_0xd812('0x12')],{'as':_0xd812('0x12c'),'through':_0xd812('0x1c7')});db[_0xd812('0xe7')][_0xd812('0xf3')](db[_0xd812('0x18')],{'as':_0xd812('0xf6'),'onDelete':_0xd812('0x14a')});db[_0xd812('0xe7')][_0xd812('0xfd')](db[_0xd812('0x12')],{'as':_0xd812('0x12c'),'through':_0xd812('0x111')});db['UserProfile']['hasMany'](db[_0xd812('0x12')],{'as':_0xd812('0x145'),'foreignKey':_0xd812('0x1c8')});db['UserProfile'][_0xd812('0xf3')](db[_0xd812('0xea')],{'as':_0xd812('0x1c9'),'foreignKey':'userProfileId','onDelete':_0xd812('0xef')});db['UserProfileSection']['hasMany'](db[_0xd812('0xec')],{'as':_0xd812('0x1ca'),'foreignKey':'sectionId','onDelete':_0xd812('0xef')});module[_0xd812('0x1cb')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x3f25=['../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','hasOne','cascade','UserId','hasMany','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','SmsInteractions','FaxInteractions','belongsTo','UserProfile','belongsToMany','cm_user_has_lists','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueue','MailQueue','MailQueues','UserMailQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','user_has_openchannel_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Sounds','moh_has_sounds','Members','Hoppers','VoiceQueueId','HopperHistories','JscriptySessions','TrunkBackup','TrunkBackupId','Interval','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','MailAccountId','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Interaction','restrict','IntervalId','TagId','Items','FaxAccountId','Applications','Exntensions','ContactId','fax_interaction_has_tags','Users','FaxInteractionId','team_has_fax_queues','SmsAccountId','SmsMessage','user_has_sms_accounts','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelInteractionId','openchannel_interaction_has_tags','OpenchannelQueueId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','Queue','Website','chat_interaction_has_tags','ChatInteractionId','AttachmentId','team_has_chat_queues','ChatInternalMessage','ChatGroupId','chat_group_has_users','Contacts','CompanyId','MailInteractions','cm_user_has_contacts','Agent','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','Schedule','Mohs','cm_contact_has_tags','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','TriggerId','Fields','CustomReportId','MetricId','SalesforceField','Subjects','Descriptions','DescriptionId','FieldId','AccountId','Description','VariableId','SugarcrmField','Subject','SubjectId','Field','Configurations','int_desk_configuration_has_tags','ZohoField','ZendeskConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','ServicenowConfiguration','Dynamics365Configuration','FreshsalesField','FromId','ToId','SessionId','ProjectId','user_has_teams','VoiceQueues','HopperBlacks','TrunkId','SquareProjectId','Lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToAccount','FromChatWebsiteId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToSmsAccountId','CmCustomField','Queues','UserProfileSections','userProfileId','Resources','sectionId','exports','../config/environment','sequelize','lodash','xcall','127.0.0.1','mysql','name','utf8','sequelizeHistory','motion2','xC@LL1234','utf8mb4','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsQueue','../api/smsQueue/smsQueue.model','../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','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Sound','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix'];(function(_0x1a1e1e,_0xcfab0c){var _0x2d30a6=function(_0x5e15fe){while(--_0x5e15fe){_0x1a1e1e['push'](_0x1a1e1e['shift']());}};_0x2d30a6(++_0xcfab0c);}(_0x3f25,0xd5));var _0x53f2=function(_0x56d993,_0x18f973){_0x56d993=_0x56d993-0x0;var _0x4e1b19=_0x3f25[_0x56d993];return _0x4e1b19;};'use strict';var path=require('path');var config=require(_0x53f2('0x0'));var Sequelize=require(_0x53f2('0x1'));var _=require(_0x53f2('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x53f2('0x1')]=_['defaultsDeep'](config[_0x53f2('0x1')],{'database':'motion2','username':_0x53f2('0x3'),'password':'xC@LL1234','options':{'host':_0x53f2('0x4'),'port':0xcea,'dialect':_0x53f2('0x5'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x53f2('0x6')](),'define':{'charset':_0x53f2('0x7'),'collate':'utf8_general_ci'}}});config[_0x53f2('0x8')]=_['defaultsDeep'](config['sequelizeHistory'],{'database':_0x53f2('0x9'),'username':_0x53f2('0x3'),'password':_0x53f2('0xa'),'options':{'host':_0x53f2('0x4'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x53f2('0xb')},'logging':![],'timezone':timezone[_0x53f2('0x6')](),'define':{'charset':_0x53f2('0x7'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x53f2('0xc')],config['sequelize'][_0x53f2('0xd')],config[_0x53f2('0x1')][_0x53f2('0xe')],config[_0x53f2('0x1')][_0x53f2('0xf')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x53f2('0x8')][_0x53f2('0xc')],config['sequelizeHistory']['username'],config['sequelizeHistory'][_0x53f2('0xe')],config[_0x53f2('0x8')][_0x53f2('0xf')])};db[_0x53f2('0x10')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x12'));db[_0x53f2('0x13')]=db['sequelize'][_0x53f2('0x11')](_0x53f2('0x14'));db[_0x53f2('0x15')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x16'));db[_0x53f2('0x17')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x18'));db['VoiceMusicOnHold']=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db['sequelize'][_0x53f2('0x11')](_0x53f2('0x19'));db[_0x53f2('0x1a')]=db[_0x53f2('0x1')]['import'](_0x53f2('0x1b'));db[_0x53f2('0x1c')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x1d'));db[_0x53f2('0x1e')]=db[_0x53f2('0x1')]['import'](_0x53f2('0x1f'));db[_0x53f2('0x20')]=db['sequelize']['import']('../api/voiceMailMessage/voiceMailMessage.model');db[_0x53f2('0x21')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x22'));db[_0x53f2('0x23')]=db['sequelize'][_0x53f2('0x11')](_0x53f2('0x24'));db[_0x53f2('0x25')]=db['sequelize'][_0x53f2('0x11')](_0x53f2('0x26'));db[_0x53f2('0x27')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x28'));db['MemberReport']=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x29'));db[_0x53f2('0x2a')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x2b'));db[_0x53f2('0x2c')]=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x53f2('0x2d')]=db['sequelize']['import'](_0x53f2('0x2e'));db[_0x53f2('0x2f')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x30'));db[_0x53f2('0x31')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x32'));db['UserMailQueue']=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/userMailQueue/userMailQueue.model');db[_0x53f2('0x33')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x34'));db[_0x53f2('0x35')]=db['sequelize'][_0x53f2('0x11')](_0x53f2('0x36'));db[_0x53f2('0x37')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x38'));db[_0x53f2('0x39')]=db[_0x53f2('0x1')]['import'](_0x53f2('0x3a'));db[_0x53f2('0x3b')]=db[_0x53f2('0x1')]['import'](_0x53f2('0x3c'));db[_0x53f2('0x3d')]=db['sequelize'][_0x53f2('0x11')]('../api/mailAccount/mailAccount.model');db['MailQueue']=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x3e'));db['MailSubstatus']=db[_0x53f2('0x1')]['import'](_0x53f2('0x3f'));db[_0x53f2('0x40')]=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/mailInteraction/mailInteraction.model');db[_0x53f2('0x41')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x42'));db['MailApplication']=db[_0x53f2('0x1')]['import'](_0x53f2('0x43'));db[_0x53f2('0x44')]=db['sequelize']['import'](_0x53f2('0x45'));db[_0x53f2('0x46')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x47'));db[_0x53f2('0x48')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x49'));db[_0x53f2('0x4a')]=db['sequelize'][_0x53f2('0x11')](_0x53f2('0x4b'));db[_0x53f2('0x4c')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x4d'));db[_0x53f2('0x4e')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x4f'));db[_0x53f2('0x50')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x51'));db[_0x53f2('0x52')]=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/faxQueue/faxQueue.model');db[_0x53f2('0x53')]=db[_0x53f2('0x1')]['import']('../api/faxQueueReport/faxQueueReport.model');db[_0x53f2('0x54')]=db['sequelize'][_0x53f2('0x11')](_0x53f2('0x55'));db[_0x53f2('0x56')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x57'));db[_0x53f2('0x58')]=db['sequelize'][_0x53f2('0x11')](_0x53f2('0x59'));db['SmsMessage']=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/smsMessage/smsMessage.model');db[_0x53f2('0x5a')]=db[_0x53f2('0x1')]['import'](_0x53f2('0x5b'));db['OpenchannelAccount']=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/openchannelAccount/openchannelAccount.model');db['OpenchannelApplication']=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x5c'));db[_0x53f2('0x5d')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x5e'));db[_0x53f2('0x5f')]=db['sequelize'][_0x53f2('0x11')](_0x53f2('0x60'));db[_0x53f2('0x61')]=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/openchannelQueue/openchannelQueue.model');db[_0x53f2('0x62')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x63'));db[_0x53f2('0x64')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x65'));db[_0x53f2('0x66')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x67'));db[_0x53f2('0x68')]=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/chatInteraction/chatInteraction.model');db[_0x53f2('0x69')]=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/chatMessage/chatMessage.model');db[_0x53f2('0x6a')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x6b'));db[_0x53f2('0x6c')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x6d'));db[_0x53f2('0x6e')]=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/chatGroup/chatGroup.model');db[_0x53f2('0x6f')]=db[_0x53f2('0x1')]['import']('../api/chatProactiveAction/chatProactiveAction.model');db[_0x53f2('0x70')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x71'));db[_0x53f2('0x72')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x73'));db[_0x53f2('0x74')]=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/cmHopper/cmHopper.model');db[_0x53f2('0x75')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x76'));db[_0x53f2('0x77')]=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x53f2('0x78')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x79'));db[_0x53f2('0x7a')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x7b'));db['CmCustomField']=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x7c'));db[_0x53f2('0x7d')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x7e'));db[_0x53f2('0x7f')]=db[_0x53f2('0x1')]['import']('../api/automation/automation.model');db[_0x53f2('0x80')]=db['sequelize'][_0x53f2('0x11')](_0x53f2('0x81'));db['Disposition']=db['sequelize'][_0x53f2('0x11')](_0x53f2('0x82'));db[_0x53f2('0x83')]=db[_0x53f2('0x1')]['import']('../api/condition/condition.model');db['Interval']=db['sequelize'][_0x53f2('0x11')](_0x53f2('0x84'));db['Pause']=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x85'));db[_0x53f2('0x86')]=db['sequelize'][_0x53f2('0x11')](_0x53f2('0x87'));db[_0x53f2('0x88')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x89'));db['Schedule']=db['sequelize'][_0x53f2('0x11')]('../api/schedule/schedule.model');db[_0x53f2('0x8a')]=db['sequelize'][_0x53f2('0x11')]('../api/sound/sound.model');db[_0x53f2('0x8b')]=db['sequelize']['import'](_0x53f2('0x8c'));db[_0x53f2('0x8d')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x8e'));db[_0x53f2('0x8f')]=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/trigger/trigger.model');db[_0x53f2('0x90')]=db[_0x53f2('0x1')]['import'](_0x53f2('0x91'));db[_0x53f2('0x92')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x93'));db[_0x53f2('0x94')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x95'));db[_0x53f2('0x96')]=db[_0x53f2('0x1')]['import'](_0x53f2('0x97'));db[_0x53f2('0x98')]=db['sequelize'][_0x53f2('0x11')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x53f2('0x99')]=db[_0x53f2('0x1')]['import'](_0x53f2('0x9a'));db[_0x53f2('0x9b')]=db['sequelize'][_0x53f2('0x11')](_0x53f2('0x9c'));db[_0x53f2('0x9d')]=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x53f2('0x9e')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0x9f'));db[_0x53f2('0xa0')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0xa1'));db[_0x53f2('0xa2')]=db['sequelize'][_0x53f2('0x11')](_0x53f2('0xa3'));db['SalesforceField']=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0xa4'));db[_0x53f2('0xa5')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0xa6'));db[_0x53f2('0xa7')]=db[_0x53f2('0x1')]['import'](_0x53f2('0xa8'));db['SugarcrmField']=db['sequelize'][_0x53f2('0x11')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x53f2('0xa9')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0xaa'));db[_0x53f2('0xab')]=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x53f2('0xac')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0xad'));db[_0x53f2('0xae')]=db['sequelize'][_0x53f2('0x11')](_0x53f2('0xaf'));db[_0x53f2('0xb0')]=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0xb1'));db[_0x53f2('0xb2')]=db['sequelize']['import']('../api/intZendeskAccount/intZendeskAccount.model');db['ZendeskConfiguration']=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x53f2('0xb3')]=db[_0x53f2('0x1')]['import'](_0x53f2('0xb4'));db[_0x53f2('0xb5')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0xb6'));db[_0x53f2('0xb7')]=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x53f2('0xb8')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0xb9'));db[_0x53f2('0xba')]=db[_0x53f2('0x1')]['import'](_0x53f2('0xbb'));db[_0x53f2('0xbc')]=db['sequelize']['import'](_0x53f2('0xbd'));db[_0x53f2('0xbe')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0xbf'));db[_0x53f2('0xc0')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0xc1'));db['ServicenowConfiguration']=db['sequelize'][_0x53f2('0x11')](_0x53f2('0xc2'));db[_0x53f2('0xc3')]=db['sequelize'][_0x53f2('0x11')](_0x53f2('0xc4'));db[_0x53f2('0xc5')]=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0xc6'));db[_0x53f2('0xc7')]=db['sequelize'][_0x53f2('0x11')](_0x53f2('0xc8'));db[_0x53f2('0xc9')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0xca'));db[_0x53f2('0xcb')]=db['sequelize']['import']('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db['FreshsalesField']=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0xcc'));db[_0x53f2('0x92')]=db[_0x53f2('0x1')]['import']('../api/integration/integration.model');db[_0x53f2('0xcd')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0xce'));db[_0x53f2('0xcf')]=db[_0x53f2('0x1')]['import'](_0x53f2('0xd0'));db['ChatInternalMessage']=db['sequelize'][_0x53f2('0x11')](_0x53f2('0xd1'));db[_0x53f2('0xd2')]=db['sequelize'][_0x53f2('0x11')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x53f2('0xd3')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0xd4'));db[_0x53f2('0xd5')]=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x53f2('0xd6')]=db['sequelize'][_0x53f2('0x11')](_0x53f2('0xd7'));db[_0x53f2('0xd8')]=db[_0x53f2('0x1')]['import'](_0x53f2('0xd9'));db['SquareDetailsReport']=db[_0x53f2('0x1')]['import'](_0x53f2('0xda'));db[_0x53f2('0xdb')]=db['sequelize'][_0x53f2('0x11')]('../api/jscriptyProject/jscriptyProject.model');db[_0x53f2('0xdc')]=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/setting/setting.model');db[_0x53f2('0xdd')]=db['sequelize'][_0x53f2('0x11')]('../api/squareOdbc/squareOdbc.model');db[_0x53f2('0xde')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0xdf'));db[_0x53f2('0xe0')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0xe1'));db[_0x53f2('0xe2')]=db['sequelize'][_0x53f2('0x11')](_0x53f2('0xe3'));db[_0x53f2('0xe4')]=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/team/team.model');db['License']=db['sequelize']['import'](_0x53f2('0xe5'));db[_0x53f2('0xe6')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0xe7'));db[_0x53f2('0xe8')]=db['sequelize'][_0x53f2('0x11')](_0x53f2('0xe9'));db[_0x53f2('0xea')]=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/attachment/attachment.model');db[_0x53f2('0xeb')]=db['sequelize'][_0x53f2('0x11')]('../api/plugin/plugin.model');db[_0x53f2('0xec')]=db['sequelize']['import']('../api/mailTransferReport/mailTransferReport.model');db[_0x53f2('0xed')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0xee'));db[_0x53f2('0xef')]=db['sequelize'][_0x53f2('0x11')](_0x53f2('0xf0'));db['OpenchannelTransferReport']=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0xf1'));db[_0x53f2('0xf2')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0xf3'));db[_0x53f2('0xf4')]=db[_0x53f2('0x1')]['import'](_0x53f2('0xf5'));db[_0x53f2('0xf6')]=db[_0x53f2('0x1')][_0x53f2('0x11')]('../api/voicePrefix/voicePrefix.model');db['UserProfile']=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0xf7'));db[_0x53f2('0xf8')]=db[_0x53f2('0x1')]['import'](_0x53f2('0xf9'));db[_0x53f2('0xfa')]=db[_0x53f2('0x1')][_0x53f2('0x11')](_0x53f2('0xfb'));db[_0x53f2('0x10')][_0x53f2('0xfc')](db['VoiceMail'],{'as':'VoiceMail','onDelete':_0x53f2('0xfd'),'foreignKey':_0x53f2('0xfe')});db[_0x53f2('0x10')][_0x53f2('0xff')](db[_0x53f2('0x1a')],{'as':'Recordings','foreignKey':'UserId'});db[_0x53f2('0x10')][_0x53f2('0xff')](db[_0x53f2('0x2d')],{'as':'VoiceQueuesRt','foreignKey':_0x53f2('0xfe')});db[_0x53f2('0x10')]['hasMany'](db[_0x53f2('0x17')],{'as':_0x53f2('0x100'),'onDelete':'cascade','hooks':!![]});db[_0x53f2('0x10')]['hasMany'](db['CmHopperFinal'],{'as':_0x53f2('0x101'),'foreignKey':'UserId'});db[_0x53f2('0x10')]['hasMany'](db[_0x53f2('0x78')],{'as':_0x53f2('0x102'),'foreignKey':_0x53f2('0xfe')});db[_0x53f2('0x10')]['hasMany'](db[_0x53f2('0x7a')],{'as':_0x53f2('0x7a'),'foreignKey':'UserId'});db[_0x53f2('0x10')][_0x53f2('0xff')](db[_0x53f2('0x5d')],{'as':_0x53f2('0x103'),'foreignKey':'UserId'});db[_0x53f2('0x10')]['hasMany'](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':'UserId'});db[_0x53f2('0x10')][_0x53f2('0xff')](db[_0x53f2('0x58')],{'as':_0x53f2('0x104'),'foreignKey':_0x53f2('0xfe')});db[_0x53f2('0x10')]['hasMany'](db[_0x53f2('0x4e')],{'as':_0x53f2('0x105'),'foreignKey':_0x53f2('0xfe')});db[_0x53f2('0x10')][_0x53f2('0xff')](db[_0x53f2('0x40')],{'as':'MailInteractions','foreignKey':_0x53f2('0xfe')});db[_0x53f2('0x10')][_0x53f2('0x106')](db['UserProfile'],{'as':_0x53f2('0x107'),'foreignKey':'userProfileId'});db['User'][_0x53f2('0x108')](db[_0x53f2('0x6e')],{'as':'Groups','through':'chat_group_has_users'});db[_0x53f2('0x10')][_0x53f2('0x108')](db[_0x53f2('0x72')],{'as':'Contacts','through':'cm_user_has_contacts'});db[_0x53f2('0x10')]['belongsToMany'](db[_0x53f2('0xf4')],{'as':'Lists','through':_0x53f2('0x109')});db[_0x53f2('0x10')][_0x53f2('0x108')](db[_0x53f2('0xe4')],{'through':'user_has_teams'});db['User'][_0x53f2('0x108')](db[_0x53f2('0x40')],{'as':'MailInteractions','through':_0x53f2('0x10a')});db[_0x53f2('0x10')][_0x53f2('0x108')](db['ChatInteraction'],{'as':_0x53f2('0x10b'),'through':_0x53f2('0x10c')});db[_0x53f2('0x10')][_0x53f2('0x108')](db[_0x53f2('0x4e')],{'as':_0x53f2('0x105'),'through':_0x53f2('0x10d')});db['User']['belongsToMany'](db['SmsInteraction'],{'as':_0x53f2('0x104'),'through':_0x53f2('0x10e')});db['User'][_0x53f2('0x108')](db['OpenchannelInteraction'],{'as':_0x53f2('0x103'),'through':_0x53f2('0x10f')});db[_0x53f2('0x10')][_0x53f2('0x108')](db[_0x53f2('0x110')],{'as':'VoiceQueues','through':_0x53f2('0x2f'),'required':![]});db['User'][_0x53f2('0x108')](db[_0x53f2('0x111')],{'as':_0x53f2('0x112'),'through':_0x53f2('0x113'),'required':![]});db['User']['belongsToMany'](db['ChatQueue'],{'as':_0x53f2('0x114'),'through':_0x53f2('0x31'),'required':![],'hooks':!![]});db[_0x53f2('0x10')][_0x53f2('0x108')](db[_0x53f2('0x52')],{'as':_0x53f2('0x115'),'through':_0x53f2('0x33'),'required':![]});db[_0x53f2('0x10')][_0x53f2('0x108')](db[_0x53f2('0x5a')],{'as':_0x53f2('0x116'),'through':_0x53f2('0x35'),'required':![]});db['User']['belongsToMany'](db[_0x53f2('0x61')],{'as':_0x53f2('0x117'),'through':_0x53f2('0x37'),'required':![]});db[_0x53f2('0x10')]['belongsToMany'](db[_0x53f2('0xf4')],{'through':_0x53f2('0x109')});db[_0x53f2('0x10')][_0x53f2('0x108')](db['VoicePrefix'],{'as':'VoicePrefixes','through':'user_has_voice_prefixes','required':![]});db[_0x53f2('0x10')][_0x53f2('0x108')](db[_0x53f2('0x62')],{'as':_0x53f2('0x118'),'through':_0x53f2('0x119')});db[_0x53f2('0x10')][_0x53f2('0x108')](db[_0x53f2('0x4a')],{'as':_0x53f2('0x11a'),'through':_0x53f2('0x11b')});db[_0x53f2('0x10')]['belongsToMany'](db['MailAccount'],{'as':_0x53f2('0x11c'),'through':_0x53f2('0x11d')});db['User'][_0x53f2('0x108')](db[_0x53f2('0x11e')],{'as':'OpenchannelAccounts','through':_0x53f2('0x11f')});db[_0x53f2('0x10')][_0x53f2('0x108')](db[_0x53f2('0x54')],{'as':'SmsAccounts','through':'user_has_sms_accounts'});db[_0x53f2('0x10')][_0x53f2('0x108')](db['SquareProject'],{'as':_0x53f2('0x120'),'through':_0x53f2('0x121')});db[_0x53f2('0x13')]['hasMany'](db[_0x53f2('0x17')],{'as':_0x53f2('0x122'),'onDelete':_0x53f2('0xfd'),'foreignKey':_0x53f2('0x123')});db['VoiceContext']['hasMany'](db['VoiceExtension'],{'onDelete':_0x53f2('0xfd')});db['VoiceExtension'][_0x53f2('0xff')](db[_0x53f2('0x17')],{'as':'Applications','onDelete':_0x53f2('0xfd')});db['VoiceMusicOnHold'][_0x53f2('0x108')](db[_0x53f2('0x8a')],{'as':_0x53f2('0x124'),'through':_0x53f2('0x125')});db['VoiceQueue'][_0x53f2('0xff')](db[_0x53f2('0x2d')],{'as':_0x53f2('0x126'),'foreignKey':'VoiceQueueId'});db[_0x53f2('0x110')][_0x53f2('0xff')](db[_0x53f2('0x74')],{'as':_0x53f2('0x127'),'foreignKey':_0x53f2('0x128')});db[_0x53f2('0x110')][_0x53f2('0xff')](db[_0x53f2('0x77')],{'as':_0x53f2('0x101'),'foreignKey':_0x53f2('0x128')});db[_0x53f2('0x110')]['hasMany'](db[_0x53f2('0x78')],{'as':_0x53f2('0x129'),'foreignKey':_0x53f2('0x128')});db[_0x53f2('0x110')][_0x53f2('0xff')](db['ReportAgentPreview'],{'as':_0x53f2('0x7a'),'foreignKey':_0x53f2('0x128')});db[_0x53f2('0x110')][_0x53f2('0xff')](db[_0x53f2('0x75')],{'as':'HopperBlacks','foreignKey':_0x53f2('0x128')});db['VoiceQueue'][_0x53f2('0xff')](db[_0x53f2('0xd5')],{'as':_0x53f2('0x12a'),'foreignKey':_0x53f2('0x128')});db[_0x53f2('0x110')][_0x53f2('0x106')](db[_0x53f2('0x2a')],{'as':_0x53f2('0x2a'),'foreignKey':'TrunkId'});db[_0x53f2('0x110')][_0x53f2('0x106')](db['Trunk'],{'as':_0x53f2('0x12b'),'foreignKey':_0x53f2('0x12c')});db[_0x53f2('0x110')]['belongsTo'](db[_0x53f2('0x12d')],{'as':_0x53f2('0x12d'),'foreignKey':'IntervalId'});db[_0x53f2('0x110')][_0x53f2('0x106')](db[_0x53f2('0x12e')],{'as':_0x53f2('0x12f'),'foreignKey':_0x53f2('0x130')});db['VoiceQueue'][_0x53f2('0x108')](db[_0x53f2('0xf4')],{'as':'Lists','through':_0x53f2('0x131')});db[_0x53f2('0x110')][_0x53f2('0x108')](db[_0x53f2('0x10')],{'as':_0x53f2('0x132'),'through':_0x53f2('0x2f')});db['VoiceQueue']['belongsToMany'](db[_0x53f2('0xe4')],{'as':_0x53f2('0x133'),'through':_0x53f2('0x134')});db['VoiceQueue'][_0x53f2('0x108')](db[_0x53f2('0xf4')],{'as':_0x53f2('0x135'),'through':_0x53f2('0x136')});db[_0x53f2('0x1a')][_0x53f2('0x106')](db[_0x53f2('0x10')],{'as':_0x53f2('0x10'),'foreignKey':'UserId'});db[_0x53f2('0x1c')][_0x53f2('0x106')](db[_0x53f2('0x10')],{'as':_0x53f2('0x10'),'foreignKey':'UserId'});db[_0x53f2('0x1e')][_0x53f2('0xff')](db[_0x53f2('0x20')],{'as':_0x53f2('0x137'),'onDelete':_0x53f2('0xfd'),'foreignKey':_0x53f2('0x138'),'sourceKey':_0x53f2('0x139')});db[_0x53f2('0x20')][_0x53f2('0x106')](db['VoiceMail'],{'foreignKey':_0x53f2('0x138'),'targetKey':_0x53f2('0x139')});db[_0x53f2('0x21')]['hasMany'](db[_0x53f2('0x27')],{'as':_0x53f2('0x13a'),'foreignKey':_0x53f2('0x13b'),'constraints':![]});db[_0x53f2('0x21')][_0x53f2('0xff')](db[_0x53f2('0x25')],{'as':_0x53f2('0x13c'),'foreignKey':_0x53f2('0x13b'),'constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0x53f2('0x10')],{'as':'User','foreignKey':_0x53f2('0xfe')});db[_0x53f2('0x21')]['belongsTo'](db[_0x53f2('0x72')],{'as':_0x53f2('0x13d'),'foreignKey':'ContactId'});db[_0x53f2('0x39')]['belongsTo'](db[_0x53f2('0x3d')],{'as':_0x53f2('0x3d'),'foreignKey':_0x53f2('0x13e')});db['MailServerOut']['belongsTo'](db['MailAccount'],{'as':_0x53f2('0x3d'),'foreignKey':_0x53f2('0x13e')});db[_0x53f2('0x3d')][_0x53f2('0xfc')](db[_0x53f2('0x39')],{'as':'Imap','onDelete':'cascade'});db['MailAccount'][_0x53f2('0xfc')](db[_0x53f2('0x3b')],{'as':_0x53f2('0x13f'),'onDelete':'cascade'});db[_0x53f2('0x3d')][_0x53f2('0xff')](db[_0x53f2('0x140')],{'as':_0x53f2('0x141'),'foreignKey':_0x53f2('0x13e')});db['MailAccount']['hasMany'](db[_0x53f2('0x80')],{'as':_0x53f2('0x142'),'foreignKey':_0x53f2('0x13e')});db['MailAccount']['hasMany'](db[_0x53f2('0x41')],{'as':_0x53f2('0x137'),'foreignKey':_0x53f2('0x13e')});db[_0x53f2('0x3d')][_0x53f2('0xff')](db[_0x53f2('0x40')],{'as':_0x53f2('0x143')});db[_0x53f2('0x3d')][_0x53f2('0xff')](db[_0x53f2('0x144')],{'as':'Applications'});db['MailAccount']['belongsTo'](db[_0x53f2('0xf4')],{'as':_0x53f2('0x145'),'foreignKey':_0x53f2('0x146')});db[_0x53f2('0x3d')][_0x53f2('0x106')](db[_0x53f2('0x8d')],{'as':_0x53f2('0x8d'),'foreignKey':_0x53f2('0x147')});db[_0x53f2('0x3d')][_0x53f2('0x106')](db['Pause'],{'as':_0x53f2('0x12f'),'foreignKey':_0x53f2('0x130')});db[_0x53f2('0x3d')][_0x53f2('0x108')](db[_0x53f2('0x10')],{'as':_0x53f2('0x132'),'through':_0x53f2('0x11d')});db['MailQueue'][_0x53f2('0x108')](db['User'],{'as':_0x53f2('0x132'),'through':_0x53f2('0x113')});db[_0x53f2('0x111')][_0x53f2('0x108')](db['Team'],{'through':_0x53f2('0x148'),'as':'Teams'});db[_0x53f2('0x40')][_0x53f2('0xff')](db[_0x53f2('0x41')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x53f2('0x149')});db[_0x53f2('0x40')][_0x53f2('0x106')](db[_0x53f2('0x3d')],{'as':_0x53f2('0x14a'),'foreignKey':_0x53f2('0x13e')});db[_0x53f2('0x40')][_0x53f2('0x106')](db[_0x53f2('0x72')],{'as':_0x53f2('0x13d'),'foreignKey':'ContactId'});db['MailInteraction'][_0x53f2('0x106')](db[_0x53f2('0x10')],{'as':_0x53f2('0x14b'),'foreignKey':'UserId'});db['MailInteraction'][_0x53f2('0x108')](db[_0x53f2('0x8b')],{'through':_0x53f2('0x14c'),'as':_0x53f2('0x14d')});db[_0x53f2('0x40')][_0x53f2('0x108')](db[_0x53f2('0x8b')],{'through':'mail_interaction_has_tags','as':_0x53f2('0x14e')});db[_0x53f2('0x40')][_0x53f2('0x108')](db['User'],{'as':'Users','through':'user_has_mail_interactions','foreignKey':'MailInteractionId'});db['MailMessage']['hasMany'](db[_0x53f2('0xea')],{'as':'Attachments','onDelete':_0x53f2('0xfd')});db[_0x53f2('0x41')][_0x53f2('0x106')](db['User'],{'as':_0x53f2('0x10')});db[_0x53f2('0x41')][_0x53f2('0x106')](db[_0x53f2('0x72')],{'onDelete':_0x53f2('0xfd'),'as':'Contact'});db[_0x53f2('0x41')][_0x53f2('0x106')](db['MailInteraction'],{'as':_0x53f2('0x14f'),'foreignKey':_0x53f2('0x149')});db[_0x53f2('0x41')][_0x53f2('0x106')](db['MailAccount'],{'as':_0x53f2('0x14a'),'foreignKey':_0x53f2('0x13e')});db[_0x53f2('0x144')]['belongsTo'](db[_0x53f2('0x10')],{'onDelete':'restrict'});db[_0x53f2('0x144')]['belongsTo'](db[_0x53f2('0x111')],{'onDelete':_0x53f2('0x150')});db[_0x53f2('0x144')][_0x53f2('0x106')](db[_0x53f2('0x3d')],{'onDelete':_0x53f2('0x150')});db['MailApplication']['belongsTo'](db[_0x53f2('0x12d')],{'onDelete':_0x53f2('0x150'),'foreignKey':_0x53f2('0x151')});db[_0x53f2('0x144')]['belongsTo'](db[_0x53f2('0x8b')],{'onDelete':_0x53f2('0x150'),'foreignKey':_0x53f2('0x152')});db[_0x53f2('0x44')][_0x53f2('0x106')](db[_0x53f2('0x3d')],{});db['MailQueueReport'][_0x53f2('0x106')](db['CmList'],{'as':_0x53f2('0x145'),'foreignKey':_0x53f2('0x146')});db[_0x53f2('0x44')][_0x53f2('0x106')](db[_0x53f2('0x72')],{'as':_0x53f2('0x13d'),'foreignKey':'ContactId'});db[_0x53f2('0x44')][_0x53f2('0x106')](db[_0x53f2('0x40')],{});db[_0x53f2('0x44')][_0x53f2('0x106')](db['MailMessage'],{});db[_0x53f2('0x44')][_0x53f2('0x106')](db[_0x53f2('0x10')],{});db[_0x53f2('0x44')][_0x53f2('0x106')](db[_0x53f2('0x111')],{});db[_0x53f2('0x46')][_0x53f2('0xff')](db[_0x53f2('0x48')],{'as':_0x53f2('0x153'),'onDelete':_0x53f2('0xfd')});db[_0x53f2('0x4a')][_0x53f2('0xff')](db['Disposition'],{'as':_0x53f2('0x141'),'foreignKey':_0x53f2('0x154')});db[_0x53f2('0x4a')][_0x53f2('0xff')](db['CannedAnswer'],{'as':_0x53f2('0x142'),'foreignKey':_0x53f2('0x154')});db[_0x53f2('0x4a')]['hasMany'](db['FaxInteraction'],{'as':'Interactions'});db[_0x53f2('0x4a')]['hasMany'](db[_0x53f2('0x4c')],{'as':_0x53f2('0x155')});db[_0x53f2('0x4a')][_0x53f2('0xff')](db[_0x53f2('0x17')],{'as':_0x53f2('0x156'),'onDelete':_0x53f2('0xfd')});db['FaxAccount'][_0x53f2('0xff')](db['FaxMessage'],{'as':_0x53f2('0x137')});db[_0x53f2('0x4a')][_0x53f2('0x106')](db[_0x53f2('0x2a')],{'as':_0x53f2('0x2a')});db[_0x53f2('0x4a')]['belongsTo'](db['CmList'],{'as':_0x53f2('0x145'),'foreignKey':'ListId'});db[_0x53f2('0x4a')][_0x53f2('0x106')](db[_0x53f2('0x12e')],{'as':_0x53f2('0x12f'),'foreignKey':_0x53f2('0x130')});db[_0x53f2('0x4a')][_0x53f2('0x108')](db[_0x53f2('0x10')],{'as':_0x53f2('0x132'),'through':_0x53f2('0x11b')});db['FaxApplication'][_0x53f2('0x106')](db[_0x53f2('0x10')],{'onDelete':_0x53f2('0x150')});db[_0x53f2('0x4c')][_0x53f2('0x106')](db[_0x53f2('0x52')],{'onDelete':_0x53f2('0x150')});db['FaxApplication'][_0x53f2('0x106')](db['FaxAccount'],{'onDelete':'restrict'});db['FaxApplication']['belongsTo'](db[_0x53f2('0x8b')],{'onDelete':'restrict','foreignKey':_0x53f2('0x152')});db['FaxInteraction'][_0x53f2('0xff')](db['FaxMessage'],{'as':_0x53f2('0x137'),'onDelete':_0x53f2('0xfd'),'foreignKey':'FaxInteractionId'});db[_0x53f2('0x4e')][_0x53f2('0x106')](db[_0x53f2('0x4a')],{'as':_0x53f2('0x14a'),'foreignKey':_0x53f2('0x154')});db[_0x53f2('0x4e')][_0x53f2('0x106')](db['CmContact'],{'as':_0x53f2('0x13d'),'foreignKey':_0x53f2('0x157')});db[_0x53f2('0x4e')]['belongsTo'](db[_0x53f2('0x10')],{'as':'Owner','foreignKey':'UserId'});db[_0x53f2('0x4e')][_0x53f2('0x108')](db['Tag'],{'through':_0x53f2('0x158'),'as':'Tags'});db['FaxInteraction']['belongsToMany'](db['Tag'],{'through':_0x53f2('0x158'),'as':_0x53f2('0x14e')});db['FaxInteraction'][_0x53f2('0x108')](db[_0x53f2('0x10')],{'as':_0x53f2('0x159'),'through':_0x53f2('0x10d'),'foreignKey':_0x53f2('0x15a')});db[_0x53f2('0x50')][_0x53f2('0x106')](db[_0x53f2('0x10')],{'onDelete':_0x53f2('0xfd'),'as':_0x53f2('0x10')});db[_0x53f2('0x50')][_0x53f2('0x106')](db[_0x53f2('0x4e')],{'as':_0x53f2('0x14f'),'foreignKey':_0x53f2('0x15a')});db[_0x53f2('0x50')]['belongsTo'](db['CmContact'],{'onDelete':_0x53f2('0xfd'),'as':_0x53f2('0x13d')});db[_0x53f2('0x50')][_0x53f2('0x106')](db[_0x53f2('0xea')],{'as':_0x53f2('0xea'),'foreignKey':'AttachmentId'});db['FaxMessage']['belongsTo'](db[_0x53f2('0x4a')],{'as':_0x53f2('0x14a'),'foreignKey':_0x53f2('0x154')});db[_0x53f2('0x52')][_0x53f2('0x108')](db[_0x53f2('0x10')],{'as':_0x53f2('0x132'),'through':'UserFaxQueue'});db[_0x53f2('0x52')][_0x53f2('0x108')](db[_0x53f2('0xe4')],{'through':_0x53f2('0x15b'),'as':_0x53f2('0x133')});db['FaxQueueReport']['belongsTo'](db[_0x53f2('0x4a')],{});db[_0x53f2('0x53')][_0x53f2('0x106')](db[_0x53f2('0xf4')],{'as':_0x53f2('0x145'),'foreignKey':_0x53f2('0x146')});db[_0x53f2('0x53')]['belongsTo'](db[_0x53f2('0x72')],{'as':_0x53f2('0x13d'),'foreignKey':_0x53f2('0x157')});db[_0x53f2('0x53')]['belongsTo'](db['FaxInteraction'],{});db[_0x53f2('0x53')][_0x53f2('0x106')](db[_0x53f2('0x50')],{});db[_0x53f2('0x53')][_0x53f2('0x106')](db[_0x53f2('0x10')],{});db[_0x53f2('0x53')]['belongsTo'](db[_0x53f2('0x52')],{});db[_0x53f2('0x54')][_0x53f2('0xff')](db[_0x53f2('0x140')],{'as':'Dispositions','foreignKey':'SmsAccountId'});db[_0x53f2('0x54')][_0x53f2('0xff')](db[_0x53f2('0x80')],{'as':_0x53f2('0x142'),'foreignKey':_0x53f2('0x15c')});db[_0x53f2('0x54')][_0x53f2('0xff')](db[_0x53f2('0x15d')],{'as':_0x53f2('0x137'),'foreignKey':_0x53f2('0x15c')});db[_0x53f2('0x54')][_0x53f2('0xff')](db['SmsInteraction'],{'as':_0x53f2('0x143')});db[_0x53f2('0x54')][_0x53f2('0xff')](db['SmsApplication'],{'as':_0x53f2('0x155')});db[_0x53f2('0x54')][_0x53f2('0x106')](db['CmList'],{'as':_0x53f2('0x145'),'foreignKey':_0x53f2('0x146')});db[_0x53f2('0x54')][_0x53f2('0x106')](db[_0x53f2('0x12e')],{'as':_0x53f2('0x12f'),'foreignKey':_0x53f2('0x130')});db[_0x53f2('0x54')][_0x53f2('0x108')](db['User'],{'as':'Agents','through':_0x53f2('0x15e')});db[_0x53f2('0x56')][_0x53f2('0x106')](db['User'],{'onDelete':_0x53f2('0x150')});db[_0x53f2('0x56')][_0x53f2('0x106')](db['SmsQueue'],{'onDelete':_0x53f2('0x150')});db['SmsApplication']['belongsTo'](db[_0x53f2('0x54')],{'onDelete':_0x53f2('0x150')});db[_0x53f2('0x56')][_0x53f2('0x106')](db[_0x53f2('0x12d')],{'onDelete':_0x53f2('0x150'),'foreignKey':'IntervalId'});db[_0x53f2('0x56')][_0x53f2('0x106')](db[_0x53f2('0x8b')],{'onDelete':_0x53f2('0x150'),'foreignKey':_0x53f2('0x152')});db[_0x53f2('0x58')][_0x53f2('0xff')](db[_0x53f2('0x15d')],{'as':_0x53f2('0x137'),'onDelete':_0x53f2('0xfd'),'foreignKey':_0x53f2('0x15f')});db[_0x53f2('0x58')][_0x53f2('0x106')](db['SmsAccount'],{'as':_0x53f2('0x14a'),'foreignKey':_0x53f2('0x15c')});db['SmsInteraction'][_0x53f2('0x106')](db[_0x53f2('0x72')],{'as':'Contact','foreignKey':_0x53f2('0x157')});db['SmsInteraction'][_0x53f2('0x106')](db[_0x53f2('0x10')],{'as':'Owner','foreignKey':'UserId'});db['SmsInteraction'][_0x53f2('0x108')](db[_0x53f2('0x8b')],{'through':_0x53f2('0x160'),'as':_0x53f2('0x14d')});db['SmsInteraction'][_0x53f2('0x108')](db[_0x53f2('0x8b')],{'through':'sms_interaction_has_tags','as':_0x53f2('0x14e')});db[_0x53f2('0x58')]['belongsToMany'](db[_0x53f2('0x10')],{'as':'Users','through':_0x53f2('0x10e'),'foreignKey':_0x53f2('0x15f')});db[_0x53f2('0x15d')][_0x53f2('0x106')](db['User'],{'as':_0x53f2('0x10')});db['SmsMessage'][_0x53f2('0x106')](db[_0x53f2('0x72')],{'onDelete':_0x53f2('0xfd'),'as':_0x53f2('0x13d')});db['SmsMessage']['belongsTo'](db[_0x53f2('0x58')],{'onDelete':_0x53f2('0xfd'),'as':_0x53f2('0x14f'),'foreignKey':_0x53f2('0x15f')});db[_0x53f2('0x15d')][_0x53f2('0x106')](db[_0x53f2('0x54')],{'as':_0x53f2('0x14a'),'foreignKey':_0x53f2('0x15c')});db['SmsQueue'][_0x53f2('0x108')](db[_0x53f2('0x10')],{'as':_0x53f2('0x132'),'through':_0x53f2('0x35'),'foreignKey':_0x53f2('0x161')});db[_0x53f2('0x5a')][_0x53f2('0x108')](db[_0x53f2('0xe4')],{'through':_0x53f2('0x162'),'as':_0x53f2('0x133')});db[_0x53f2('0x11e')][_0x53f2('0xff')](db['Disposition'],{'as':_0x53f2('0x141'),'foreignKey':'OpenchannelAccountId'});db[_0x53f2('0x11e')][_0x53f2('0xff')](db[_0x53f2('0x80')],{'as':'Answers','foreignKey':_0x53f2('0x163')});db[_0x53f2('0x11e')][_0x53f2('0xff')](db[_0x53f2('0x5d')],{'as':_0x53f2('0x143'),'foreignKey':_0x53f2('0x163')});db[_0x53f2('0x11e')][_0x53f2('0xff')](db[_0x53f2('0x5f')],{'as':'Messages','foreignKey':_0x53f2('0x163')});db[_0x53f2('0x11e')][_0x53f2('0xff')](db[_0x53f2('0x164')],{'as':_0x53f2('0x155'),'foreignKey':_0x53f2('0x163')});db[_0x53f2('0x11e')][_0x53f2('0x106')](db[_0x53f2('0xf4')],{'as':_0x53f2('0x145'),'foreignKey':_0x53f2('0x146')});db[_0x53f2('0x11e')]['belongsTo'](db[_0x53f2('0x12e')],{'as':_0x53f2('0x12f'),'foreignKey':_0x53f2('0x130')});db['OpenchannelAccount']['belongsToMany'](db['User'],{'as':_0x53f2('0x132'),'through':_0x53f2('0x11f')});db[_0x53f2('0x164')][_0x53f2('0x106')](db[_0x53f2('0x10')],{'onDelete':_0x53f2('0x150')});db[_0x53f2('0x164')][_0x53f2('0x106')](db['OpenchannelQueue'],{'onDelete':_0x53f2('0x150'),'foreignKey':'OpenchannelQueueId'});db[_0x53f2('0x164')][_0x53f2('0x106')](db[_0x53f2('0x11e')],{'onDelete':_0x53f2('0x150'),'foreignKey':_0x53f2('0x163')});db['OpenchannelApplication'][_0x53f2('0x106')](db[_0x53f2('0x12d')],{'onDelete':'restrict','foreignKey':_0x53f2('0x151')});db[_0x53f2('0x164')][_0x53f2('0x106')](db[_0x53f2('0x8b')],{'onDelete':_0x53f2('0x150'),'foreignKey':_0x53f2('0x152')});db[_0x53f2('0x5d')][_0x53f2('0xff')](db['OpenchannelMessage'],{'as':_0x53f2('0x137'),'onDelete':'cascade','foreignKey':_0x53f2('0x165')});db[_0x53f2('0x5d')][_0x53f2('0x106')](db[_0x53f2('0x11e')],{'as':_0x53f2('0x14a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelInteraction'][_0x53f2('0x106')](db['CmContact'],{'as':_0x53f2('0x13d'),'foreignKey':'ContactId'});db[_0x53f2('0x5d')][_0x53f2('0x106')](db[_0x53f2('0x10')],{'as':_0x53f2('0x14b'),'foreignKey':_0x53f2('0xfe')});db[_0x53f2('0x5d')]['belongsToMany'](db[_0x53f2('0x8b')],{'through':_0x53f2('0x166'),'as':_0x53f2('0x14d')});db[_0x53f2('0x5d')][_0x53f2('0x108')](db[_0x53f2('0x8b')],{'through':_0x53f2('0x166'),'as':_0x53f2('0x14e')});db[_0x53f2('0x5d')][_0x53f2('0x108')](db[_0x53f2('0x10')],{'as':_0x53f2('0x159'),'through':_0x53f2('0x10f'),'foreignKey':'OpenchannelInteractionId'});db[_0x53f2('0x5f')]['belongsTo'](db[_0x53f2('0x10')],{'onDelete':_0x53f2('0xfd'),'as':_0x53f2('0x10')});db[_0x53f2('0x5f')][_0x53f2('0x106')](db[_0x53f2('0x72')],{'onDelete':_0x53f2('0xfd'),'as':'Contact'});db[_0x53f2('0x5f')][_0x53f2('0x106')](db[_0x53f2('0x5d')],{'onDelete':'cascade','as':_0x53f2('0x14f'),'foreignKey':'OpenchannelInteractionId'});db[_0x53f2('0x5f')][_0x53f2('0x106')](db[_0x53f2('0xea')],{'as':_0x53f2('0xea'),'foreignKey':'AttachmentId'});db['OpenchannelMessage'][_0x53f2('0x106')](db[_0x53f2('0x11e')],{'as':_0x53f2('0x14a'),'foreignKey':_0x53f2('0x163')});db[_0x53f2('0x61')]['belongsToMany'](db[_0x53f2('0x10')],{'as':_0x53f2('0x132'),'through':_0x53f2('0x37'),'foreignKey':_0x53f2('0x167')});db[_0x53f2('0x61')][_0x53f2('0x108')](db[_0x53f2('0xe4')],{'through':_0x53f2('0x168'),'as':_0x53f2('0x133')});db[_0x53f2('0x62')]['hasMany'](db[_0x53f2('0x140')],{'as':_0x53f2('0x141'),'foreignKey':_0x53f2('0x169')});db[_0x53f2('0x62')][_0x53f2('0xff')](db[_0x53f2('0x80')],{'as':_0x53f2('0x142'),'foreignKey':_0x53f2('0x169')});db[_0x53f2('0x62')][_0x53f2('0xff')](db[_0x53f2('0x6f')],{'as':_0x53f2('0x16a')});db['ChatWebsite'][_0x53f2('0xff')](db['ChatInteraction'],{'as':_0x53f2('0x143')});db[_0x53f2('0x62')][_0x53f2('0xff')](db[_0x53f2('0x66')],{'as':'Applications'});db['ChatWebsite'][_0x53f2('0xff')](db[_0x53f2('0x69')],{'as':_0x53f2('0x137')});db[_0x53f2('0x62')][_0x53f2('0x106')](db[_0x53f2('0xf4')],{'as':_0x53f2('0x145'),'foreignKey':_0x53f2('0x146')});db['ChatWebsite']['belongsTo'](db['Interval'],{'as':'Interval','foreignKey':_0x53f2('0x151')});db[_0x53f2('0x62')]['belongsTo'](db[_0x53f2('0x12e')],{'as':_0x53f2('0x12f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x53f2('0x62')][_0x53f2('0x108')](db['User'],{'as':_0x53f2('0x132'),'through':_0x53f2('0x119')});db[_0x53f2('0x64')][_0x53f2('0x106')](db[_0x53f2('0x11e')],{});db['OpenchannelQueueReport'][_0x53f2('0x106')](db['CmList'],{'as':'List','foreignKey':_0x53f2('0x146')});db[_0x53f2('0x64')][_0x53f2('0x106')](db[_0x53f2('0x72')],{'as':_0x53f2('0x13d'),'foreignKey':'ContactId'});db['OpenchannelQueueReport'][_0x53f2('0x106')](db['OpenchannelInteraction'],{});db[_0x53f2('0x64')]['belongsTo'](db['OpenchannelMessage'],{});db[_0x53f2('0x64')][_0x53f2('0x106')](db[_0x53f2('0x10')],{});db[_0x53f2('0x64')][_0x53f2('0x106')](db[_0x53f2('0x61')],{});db[_0x53f2('0x66')]['belongsTo'](db[_0x53f2('0x10')],{'as':'Agent','foreignKey':_0x53f2('0xfe'),'onDelete':'restrict'});db[_0x53f2('0x66')][_0x53f2('0x106')](db['ChatQueue'],{'as':_0x53f2('0x16b'),'foreignKey':'ChatQueueId','onDelete':_0x53f2('0x150')});db['ChatApplication'][_0x53f2('0x106')](db['ChatWebsite'],{'as':_0x53f2('0x16c'),'foreignKey':_0x53f2('0x169'),'onDelete':_0x53f2('0x150')});db['ChatApplication']['belongsTo'](db['Tag'],{'onDelete':_0x53f2('0x150'),'foreignKey':'TagId'});db[_0x53f2('0x68')]['hasMany'](db['ChatMessage'],{'as':_0x53f2('0x137'),'onDelete':_0x53f2('0xfd'),'foreignKey':'ChatInteractionId'});db[_0x53f2('0x68')]['belongsTo'](db[_0x53f2('0x62')],{'as':_0x53f2('0x14a'),'foreignKey':_0x53f2('0x169')});db[_0x53f2('0x68')]['belongsTo'](db[_0x53f2('0x72')],{'as':_0x53f2('0x13d'),'foreignKey':_0x53f2('0x157')});db['ChatInteraction'][_0x53f2('0x106')](db[_0x53f2('0x10')],{'as':'Owner','foreignKey':_0x53f2('0xfe')});db[_0x53f2('0x68')][_0x53f2('0x108')](db[_0x53f2('0x8b')],{'through':'chat_interaction_has_tags','as':_0x53f2('0x14d')});db[_0x53f2('0x68')][_0x53f2('0x108')](db[_0x53f2('0x8b')],{'through':_0x53f2('0x16d'),'as':_0x53f2('0x14e')});db['ChatInteraction'][_0x53f2('0x108')](db[_0x53f2('0x10')],{'as':_0x53f2('0x159'),'through':_0x53f2('0x10c'),'foreignKey':_0x53f2('0x16e')});db[_0x53f2('0x69')][_0x53f2('0x106')](db[_0x53f2('0x10')],{'onDelete':'cascade','as':'User'});db[_0x53f2('0x69')][_0x53f2('0x106')](db[_0x53f2('0x72')],{'onDelete':_0x53f2('0xfd'),'as':_0x53f2('0x13d'),'foreignKey':_0x53f2('0x157')});db[_0x53f2('0x69')][_0x53f2('0x106')](db[_0x53f2('0x68')],{'onDelete':_0x53f2('0xfd'),'as':_0x53f2('0x14f'),'foreignKey':_0x53f2('0x16e')});db[_0x53f2('0x69')]['belongsTo'](db[_0x53f2('0xea')],{'as':_0x53f2('0xea'),'foreignKey':_0x53f2('0x16f')});db[_0x53f2('0x69')][_0x53f2('0x106')](db[_0x53f2('0x62')],{'as':_0x53f2('0x14a'),'foreignKey':'ChatWebsiteId'});db['ChatOfflineMessage'][_0x53f2('0x106')](db[_0x53f2('0x72')],{'onDelete':_0x53f2('0xfd'),'as':'Contact','foreignKey':'ContactId'});db[_0x53f2('0x6a')]['belongsTo'](db[_0x53f2('0x62')],{'as':_0x53f2('0x14a'),'foreignKey':_0x53f2('0x169')});db['ChatQueue'][_0x53f2('0x108')](db[_0x53f2('0x10')],{'as':_0x53f2('0x132'),'through':_0x53f2('0x31'),'hooks':!![]});db[_0x53f2('0x6c')][_0x53f2('0x108')](db['Team'],{'through':_0x53f2('0x170'),'as':_0x53f2('0x133')});db[_0x53f2('0x6e')][_0x53f2('0xff')](db[_0x53f2('0x171')],{'as':_0x53f2('0x137'),'foreignKey':_0x53f2('0x172'),'onDelete':'cascade'});db[_0x53f2('0x6e')][_0x53f2('0x108')](db[_0x53f2('0x10')],{'as':_0x53f2('0x126'),'through':_0x53f2('0x173')});db[_0x53f2('0x6f')]['belongsTo'](db[_0x53f2('0x62')],{'as':_0x53f2('0x16c'),'foreignKey':_0x53f2('0x169')});db[_0x53f2('0x70')]['hasMany'](db[_0x53f2('0x72')],{'as':_0x53f2('0x174'),'foreignKey':_0x53f2('0x175')});db[_0x53f2('0x72')][_0x53f2('0xff')](db['CmHopper'],{'as':_0x53f2('0x127'),'foreignKey':_0x53f2('0x157')});db[_0x53f2('0x72')][_0x53f2('0xff')](db[_0x53f2('0x77')],{'as':_0x53f2('0x101'),'foreignKey':_0x53f2('0x157')});db['CmContact']['hasMany'](db['CmHopperHistory'],{'as':_0x53f2('0x129'),'foreignKey':_0x53f2('0x157')});db[_0x53f2('0x72')]['hasMany'](db[_0x53f2('0x7a')],{'as':_0x53f2('0x7a'),'foreignKey':_0x53f2('0x157')});db[_0x53f2('0x72')]['hasMany'](db['JscriptySessionReport'],{'as':_0x53f2('0x12a'),'foreignKey':_0x53f2('0x157')});db['CmContact'][_0x53f2('0xff')](db[_0x53f2('0x5d')],{'as':_0x53f2('0x103'),'foreignKey':_0x53f2('0x157'),'onDelete':'restrict'});db['CmContact']['hasMany'](db[_0x53f2('0x68')],{'as':'ChatInteractions','foreignKey':'ContactId','onDelete':_0x53f2('0x150')});db[_0x53f2('0x72')][_0x53f2('0xff')](db[_0x53f2('0x58')],{'as':_0x53f2('0x104'),'foreignKey':_0x53f2('0x157'),'onDelete':_0x53f2('0x150')});db[_0x53f2('0x72')][_0x53f2('0xff')](db[_0x53f2('0x4e')],{'as':_0x53f2('0x105'),'foreignKey':_0x53f2('0x157'),'onDelete':_0x53f2('0x150')});db[_0x53f2('0x72')]['hasMany'](db[_0x53f2('0x40')],{'as':_0x53f2('0x176'),'foreignKey':_0x53f2('0x157'),'onDelete':_0x53f2('0x150')});db[_0x53f2('0x72')][_0x53f2('0x106')](db[_0x53f2('0x70')],{'as':'Company','foreignKey':_0x53f2('0x175')});db[_0x53f2('0x72')]['belongsTo'](db[_0x53f2('0xf4')],{'as':_0x53f2('0x145'),'foreignKey':_0x53f2('0x146'),'onDelete':_0x53f2('0xfd')});db[_0x53f2('0x72')][_0x53f2('0x108')](db[_0x53f2('0x10')],{'as':_0x53f2('0x159'),'through':_0x53f2('0x177')});db['CmContact'][_0x53f2('0x108')](db[_0x53f2('0x8b')],{'as':_0x53f2('0x14d'),'through':'cm_contact_has_tags'});db[_0x53f2('0x72')][_0x53f2('0x108')](db[_0x53f2('0x8b')],{'through':'cm_contact_has_tags','as':_0x53f2('0x14e')});db[_0x53f2('0x74')][_0x53f2('0x106')](db[_0x53f2('0x72')],{'as':_0x53f2('0x13d'),'foreignKey':_0x53f2('0x157'),'onDelete':_0x53f2('0xfd')});db['CmHopper'][_0x53f2('0x106')](db[_0x53f2('0xf4')],{'as':'List','foreignKey':_0x53f2('0x146'),'onDelete':_0x53f2('0xfd')});db[_0x53f2('0x74')][_0x53f2('0x106')](db['User'],{'as':_0x53f2('0x178'),'foreignKey':_0x53f2('0xfe')});db[_0x53f2('0x74')][_0x53f2('0x106')](db[_0x53f2('0x110')],{'as':_0x53f2('0x16b'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db['CmHopper']['belongsTo'](db[_0x53f2('0xe6')],{'as':'Campaign','foreignKey':_0x53f2('0x179'),'onDelete':_0x53f2('0xfd')});db[_0x53f2('0x74')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x53f2('0x17a')});db['CmHopperBlack'][_0x53f2('0x106')](db[_0x53f2('0x72')],{'as':_0x53f2('0x13d'),'foreignKey':_0x53f2('0x157'),'onDelete':_0x53f2('0xfd')});db['CmHopperBlack'][_0x53f2('0x106')](db[_0x53f2('0xf4')],{'as':_0x53f2('0x145'),'foreignKey':_0x53f2('0x146'),'onDelete':_0x53f2('0xfd')});db[_0x53f2('0x75')][_0x53f2('0x106')](db[_0x53f2('0x110')],{'as':_0x53f2('0x16b'),'foreignKey':_0x53f2('0x128'),'onDelete':_0x53f2('0xfd')});db['CmHopperBlack'][_0x53f2('0x106')](db[_0x53f2('0xe6')],{'as':'Campaign','foreignKey':_0x53f2('0x179'),'onDelete':'cascade'});db[_0x53f2('0x7f')][_0x53f2('0xff')](db['Condition'],{'as':{'plural':_0x53f2('0x17b'),'singular':_0x53f2('0x17c')},'foreignKey':_0x53f2('0x17d'),'onDelete':'cascade','hooks':!![]});db[_0x53f2('0x7f')][_0x53f2('0xff')](db[_0x53f2('0x83')],{'as':{'plural':_0x53f2('0x17e'),'singular':_0x53f2('0x17f')},'foreignKey':_0x53f2('0x180'),'onDelete':_0x53f2('0xfd'),'hooks':!![]});db[_0x53f2('0x7f')][_0x53f2('0xff')](db[_0x53f2('0x7d')],{'as':_0x53f2('0x181'),'foreignKey':_0x53f2('0x182'),'onDelete':_0x53f2('0xfd'),'hooks':!![]});db['Interval'][_0x53f2('0xff')](db[_0x53f2('0x12d')],{'as':'Intervals','foreignKey':_0x53f2('0x151'),'onDelete':_0x53f2('0xfd'),'hooks':!![],'required':![]});db[_0x53f2('0x12d')][_0x53f2('0xff')](db[_0x53f2('0x17')],{'as':_0x53f2('0x100'),'foreignKey':_0x53f2('0x151'),'onDelete':'restrict'});db[_0x53f2('0x12d')][_0x53f2('0xff')](db[_0x53f2('0x144')],{'as':_0x53f2('0x183'),'foreignKey':_0x53f2('0x151')});db[_0x53f2('0x12d')]['hasMany'](db[_0x53f2('0x66')],{'as':_0x53f2('0x184'),'foreignKey':_0x53f2('0x151')});db[_0x53f2('0x12d')][_0x53f2('0xff')](db[_0x53f2('0x4c')],{'as':_0x53f2('0x185'),'foreignKey':_0x53f2('0x151')});db[_0x53f2('0x12d')][_0x53f2('0xff')](db[_0x53f2('0x56')],{'as':_0x53f2('0x186'),'foreignKey':_0x53f2('0x151')});db['Schedule'][_0x53f2('0x106')](db['MailAccount'],{});db['Schedule'][_0x53f2('0x106')](db[_0x53f2('0x98')],{'foreignKey':_0x53f2('0x187')});db[_0x53f2('0x188')]['belongsTo'](db[_0x53f2('0x96')],{'foreignKey':'CustomReportId'});db['Sound'][_0x53f2('0x108')](db['VoiceMusicOnHold'],{'as':_0x53f2('0x189'),'through':_0x53f2('0x125'),'onDelete':_0x53f2('0x150')});db[_0x53f2('0x8b')][_0x53f2('0x108')](db['CmContact'],{'through':_0x53f2('0x18a')});db['Tag']['belongsToMany'](db[_0x53f2('0x68')],{'through':'chat_interaction_has_tags'});db[_0x53f2('0x8b')][_0x53f2('0x108')](db[_0x53f2('0x40')],{'through':_0x53f2('0x14c')});db[_0x53f2('0x8b')][_0x53f2('0x108')](db[_0x53f2('0x58')],{'through':_0x53f2('0x160')});db['Tag'][_0x53f2('0x108')](db[_0x53f2('0x4e')],{'through':_0x53f2('0x158')});db[_0x53f2('0x8b')][_0x53f2('0x108')](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db[_0x53f2('0x8f')][_0x53f2('0xff')](db['Condition'],{'as':{'plural':'AllConditions','singular':_0x53f2('0x18b')},'foreignKey':_0x53f2('0x18c'),'onDelete':_0x53f2('0xfd'),'hooks':!![]});db['Trigger'][_0x53f2('0xff')](db[_0x53f2('0x83')],{'as':{'plural':_0x53f2('0x18d'),'singular':'AnyCondition'},'foreignKey':_0x53f2('0x18e'),'onDelete':_0x53f2('0xfd'),'hooks':!![]});db[_0x53f2('0x8f')]['hasMany'](db['Action'],{'as':_0x53f2('0x181'),'foreignKey':_0x53f2('0x18f'),'onDelete':_0x53f2('0xfd'),'hooks':!![]});db[_0x53f2('0x96')][_0x53f2('0xff')](db['AnalyticFieldReport'],{'as':_0x53f2('0x190'),'onDelete':'cascade','foreignKey':_0x53f2('0x191'),'hooks':!![]});db[_0x53f2('0x98')][_0x53f2('0xff')](db[_0x53f2('0x9d')],{'as':_0x53f2('0x190'),'onDelete':_0x53f2('0xfd'),'foreignKey':_0x53f2('0x187')});db[_0x53f2('0x9b')]['hasMany'](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x53f2('0xfd'),'foreignKey':_0x53f2('0x192')});db[_0x53f2('0x9d')][_0x53f2('0x106')](db[_0x53f2('0x9b')],{'foreignKey':_0x53f2('0x192')});db[_0x53f2('0xa0')][_0x53f2('0xff')](db[_0x53f2('0xa2')],{'as':'Configurations','onDelete':_0x53f2('0xfd'),'foreignKey':'AccountId'});db[_0x53f2('0xa2')]['hasMany'](db[_0x53f2('0x193')],{'as':_0x53f2('0x194'),'onDelete':_0x53f2('0xfd'),'foreignKey':'SubjectId'});db[_0x53f2('0xa2')][_0x53f2('0xff')](db[_0x53f2('0x193')],{'as':_0x53f2('0x195'),'onDelete':'cascade','foreignKey':_0x53f2('0x196')});db[_0x53f2('0xa2')]['hasMany'](db[_0x53f2('0x193')],{'as':_0x53f2('0x190'),'onDelete':'cascade','foreignKey':_0x53f2('0x197')});db[_0x53f2('0xa2')][_0x53f2('0x106')](db[_0x53f2('0xa0')],{'as':_0x53f2('0x14a'),'foreignKey':_0x53f2('0x198')});db[_0x53f2('0x193')][_0x53f2('0xff')](db[_0x53f2('0x193')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x53f2('0x193')]['hasMany'](db[_0x53f2('0x193')],{'as':_0x53f2('0x199'),'foreignKey':_0x53f2('0x196')});db[_0x53f2('0x193')][_0x53f2('0xff')](db[_0x53f2('0x193')],{'as':'Field','foreignKey':_0x53f2('0x197')});db['SalesforceField'][_0x53f2('0x106')](db['Variable'],{'as':_0x53f2('0x90'),'foreignKey':_0x53f2('0x19a')});db[_0x53f2('0xa5')][_0x53f2('0xff')](db[_0x53f2('0xa7')],{'as':'Configurations','onDelete':_0x53f2('0xfd'),'foreignKey':'AccountId'});db[_0x53f2('0xa7')][_0x53f2('0xff')](db[_0x53f2('0x19b')],{'as':'Subjects','onDelete':_0x53f2('0xfd'),'foreignKey':'SubjectId'});db['SugarcrmConfiguration'][_0x53f2('0xff')](db[_0x53f2('0x19b')],{'as':_0x53f2('0x195'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x53f2('0xa7')]['hasMany'](db[_0x53f2('0x19b')],{'as':_0x53f2('0x190'),'onDelete':_0x53f2('0xfd'),'foreignKey':'FieldId'});db['SugarcrmConfiguration'][_0x53f2('0x106')](db['SugarcrmAccount'],{'as':_0x53f2('0x14a'),'foreignKey':'AccountId'});db[_0x53f2('0x19b')]['hasMany'](db['SugarcrmField'],{'as':_0x53f2('0x19c'),'foreignKey':_0x53f2('0x19d')});db['SugarcrmField'][_0x53f2('0xff')](db[_0x53f2('0x19b')],{'as':_0x53f2('0x199'),'foreignKey':_0x53f2('0x196')});db[_0x53f2('0x19b')]['hasMany'](db[_0x53f2('0x19b')],{'as':_0x53f2('0x19e'),'foreignKey':'FieldId'});db['SugarcrmField']['belongsTo'](db[_0x53f2('0x90')],{'as':'Variable','foreignKey':_0x53f2('0x19a')});db[_0x53f2('0xa9')][_0x53f2('0xff')](db['DeskConfiguration'],{'as':_0x53f2('0x19f'),'onDelete':_0x53f2('0xfd'),'foreignKey':'AccountId'});db[_0x53f2('0xab')][_0x53f2('0xff')](db[_0x53f2('0xac')],{'as':_0x53f2('0x194'),'onDelete':_0x53f2('0xfd'),'foreignKey':_0x53f2('0x19d')});db['DeskConfiguration']['hasMany'](db[_0x53f2('0xac')],{'as':'Descriptions','onDelete':_0x53f2('0xfd'),'foreignKey':'DescriptionId'});db[_0x53f2('0xab')]['hasMany'](db[_0x53f2('0xac')],{'as':'Fields','onDelete':_0x53f2('0xfd'),'foreignKey':_0x53f2('0x197')});db[_0x53f2('0xab')]['belongsTo'](db['DeskAccount'],{'as':_0x53f2('0x14a'),'foreignKey':_0x53f2('0x198')});db['DeskConfiguration']['belongsToMany'](db[_0x53f2('0x8b')],{'through':_0x53f2('0x1a0')});db[_0x53f2('0xac')][_0x53f2('0xff')](db[_0x53f2('0xac')],{'as':_0x53f2('0x19c'),'foreignKey':_0x53f2('0x19d')});db[_0x53f2('0xac')][_0x53f2('0xff')](db[_0x53f2('0xac')],{'as':_0x53f2('0x199'),'foreignKey':_0x53f2('0x196')});db[_0x53f2('0xac')][_0x53f2('0xff')](db[_0x53f2('0xac')],{'as':_0x53f2('0x19e'),'foreignKey':'FieldId'});db[_0x53f2('0xac')][_0x53f2('0x106')](db[_0x53f2('0x90')],{'as':_0x53f2('0x90'),'foreignKey':_0x53f2('0x19a')});db[_0x53f2('0xae')][_0x53f2('0xff')](db[_0x53f2('0xb0')],{'as':_0x53f2('0x19f'),'onDelete':_0x53f2('0xfd'),'foreignKey':'AccountId'});db[_0x53f2('0xb0')][_0x53f2('0xff')](db[_0x53f2('0x1a1')],{'as':_0x53f2('0x194'),'onDelete':_0x53f2('0xfd'),'foreignKey':_0x53f2('0x19d')});db[_0x53f2('0xb0')][_0x53f2('0xff')](db['ZohoField'],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x53f2('0x196')});db['ZohoConfiguration']['hasMany'](db['ZohoField'],{'as':'Fields','onDelete':_0x53f2('0xfd'),'foreignKey':_0x53f2('0x197')});db['ZohoConfiguration']['belongsTo'](db[_0x53f2('0xae')],{'as':_0x53f2('0x14a'),'foreignKey':_0x53f2('0x198')});db['ZohoField']['hasMany'](db[_0x53f2('0x1a1')],{'as':_0x53f2('0x19c'),'foreignKey':'SubjectId'});db[_0x53f2('0x1a1')]['hasMany'](db[_0x53f2('0x1a1')],{'as':'Description','foreignKey':_0x53f2('0x196')});db[_0x53f2('0x1a1')][_0x53f2('0xff')](db['ZohoField'],{'as':_0x53f2('0x19e'),'foreignKey':'FieldId'});db['ZohoField'][_0x53f2('0x106')](db[_0x53f2('0x90')],{'as':'Variable','foreignKey':_0x53f2('0x19a')});db['ZendeskAccount'][_0x53f2('0xff')](db[_0x53f2('0x1a2')],{'as':'Configurations','onDelete':_0x53f2('0xfd'),'foreignKey':_0x53f2('0x198')});db[_0x53f2('0x1a2')]['hasMany'](db[_0x53f2('0xb3')],{'as':_0x53f2('0x194'),'foreignKey':_0x53f2('0x19d')});db[_0x53f2('0x1a2')]['hasMany'](db['ZendeskField'],{'as':_0x53f2('0x195'),'foreignKey':_0x53f2('0x196')});db[_0x53f2('0x1a2')]['hasMany'](db[_0x53f2('0xb3')],{'as':_0x53f2('0x190'),'foreignKey':_0x53f2('0x197')});db[_0x53f2('0x1a2')][_0x53f2('0x106')](db['ZendeskAccount'],{'as':_0x53f2('0x14a'),'foreignKey':_0x53f2('0x198')});db['ZendeskConfiguration'][_0x53f2('0x108')](db[_0x53f2('0x8b')],{'through':_0x53f2('0x1a3')});db[_0x53f2('0xb3')]['hasMany'](db[_0x53f2('0xb3')],{'as':_0x53f2('0x19c'),'foreignKey':_0x53f2('0x19d')});db[_0x53f2('0xb3')][_0x53f2('0xff')](db[_0x53f2('0xb3')],{'as':'Description','foreignKey':_0x53f2('0x196')});db[_0x53f2('0xb3')][_0x53f2('0xff')](db[_0x53f2('0xb3')],{'as':_0x53f2('0x19e'),'foreignKey':_0x53f2('0x197')});db[_0x53f2('0xb3')][_0x53f2('0x106')](db[_0x53f2('0x90')],{'as':_0x53f2('0x90'),'foreignKey':_0x53f2('0x19a')});db['FreshdeskAccount'][_0x53f2('0xff')](db[_0x53f2('0xb7')],{'as':_0x53f2('0x19f'),'onDelete':_0x53f2('0xfd'),'foreignKey':_0x53f2('0x198')});db[_0x53f2('0xb7')][_0x53f2('0xff')](db[_0x53f2('0xb8')],{'as':_0x53f2('0x194'),'onDelete':_0x53f2('0xfd'),'foreignKey':'SubjectId'});db[_0x53f2('0xb7')][_0x53f2('0xff')](db[_0x53f2('0xb8')],{'as':'Descriptions','onDelete':_0x53f2('0xfd'),'foreignKey':'DescriptionId'});db[_0x53f2('0xb7')]['hasMany'](db[_0x53f2('0xb8')],{'as':_0x53f2('0x190'),'onDelete':_0x53f2('0xfd'),'foreignKey':'FieldId'});db[_0x53f2('0xb7')][_0x53f2('0x106')](db[_0x53f2('0xb5')],{'as':_0x53f2('0x14a'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0x53f2('0x108')](db[_0x53f2('0x8b')],{'through':_0x53f2('0x1a4')});db['FreshdeskField'][_0x53f2('0xff')](db[_0x53f2('0xb8')],{'as':'Subject','foreignKey':_0x53f2('0x19d')});db[_0x53f2('0xb8')][_0x53f2('0xff')](db['FreshdeskField'],{'as':_0x53f2('0x199'),'foreignKey':'DescriptionId'});db[_0x53f2('0xb8')]['hasMany'](db['FreshdeskField'],{'as':_0x53f2('0x19e'),'foreignKey':_0x53f2('0x197')});db[_0x53f2('0xb8')][_0x53f2('0x106')](db[_0x53f2('0x90')],{'as':'Variable','foreignKey':'VariableId'});db['VtigerAccount'][_0x53f2('0xff')](db['VtigerConfiguration'],{'as':_0x53f2('0x19f'),'onDelete':_0x53f2('0xfd'),'foreignKey':'AccountId'});db[_0x53f2('0xbc')][_0x53f2('0xff')](db[_0x53f2('0xbe')],{'as':_0x53f2('0x194'),'foreignKey':_0x53f2('0x19d')});db[_0x53f2('0xbc')][_0x53f2('0xff')](db[_0x53f2('0xbe')],{'as':_0x53f2('0x195'),'foreignKey':_0x53f2('0x196')});db[_0x53f2('0xbc')][_0x53f2('0xff')](db[_0x53f2('0xbe')],{'as':_0x53f2('0x190'),'foreignKey':_0x53f2('0x197')});db['VtigerConfiguration'][_0x53f2('0x106')](db[_0x53f2('0xba')],{'as':_0x53f2('0x14a'),'foreignKey':'AccountId'});db['VtigerField'][_0x53f2('0xff')](db[_0x53f2('0xbe')],{'as':_0x53f2('0x19c'),'foreignKey':_0x53f2('0x19d')});db[_0x53f2('0xbe')]['hasMany'](db['VtigerField'],{'as':_0x53f2('0x199'),'foreignKey':_0x53f2('0x196')});db[_0x53f2('0xbe')][_0x53f2('0xff')](db['VtigerField'],{'as':_0x53f2('0x19e'),'foreignKey':_0x53f2('0x197')});db[_0x53f2('0xbe')][_0x53f2('0x106')](db['Variable'],{'as':_0x53f2('0x90'),'foreignKey':_0x53f2('0x19a')});db['ServicenowAccount'][_0x53f2('0xff')](db[_0x53f2('0x1a5')],{'as':_0x53f2('0x19f'),'onDelete':_0x53f2('0xfd'),'foreignKey':_0x53f2('0x198')});db[_0x53f2('0x1a5')][_0x53f2('0xff')](db[_0x53f2('0xc3')],{'as':'Subjects','foreignKey':_0x53f2('0x19d')});db['ServicenowConfiguration'][_0x53f2('0xff')](db[_0x53f2('0xc3')],{'as':_0x53f2('0x195'),'foreignKey':'DescriptionId'});db[_0x53f2('0x1a5')][_0x53f2('0xff')](db[_0x53f2('0xc3')],{'as':_0x53f2('0x190'),'foreignKey':_0x53f2('0x197')});db[_0x53f2('0x1a5')][_0x53f2('0x106')](db[_0x53f2('0xc0')],{'as':_0x53f2('0x14a'),'foreignKey':'AccountId'});db[_0x53f2('0xc3')][_0x53f2('0xff')](db[_0x53f2('0xc3')],{'as':'Subject','foreignKey':_0x53f2('0x19d')});db[_0x53f2('0xc3')]['hasMany'](db[_0x53f2('0xc3')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x53f2('0xc3')]['hasMany'](db[_0x53f2('0xc3')],{'as':'Field','foreignKey':'FieldId'});db['ServicenowField'][_0x53f2('0x106')](db[_0x53f2('0x90')],{'as':_0x53f2('0x90'),'foreignKey':_0x53f2('0x19a')});db[_0x53f2('0xc5')][_0x53f2('0xff')](db['Dynamics365Configuration'],{'as':_0x53f2('0x19f'),'onDelete':_0x53f2('0xfd'),'foreignKey':_0x53f2('0x198')});db[_0x53f2('0x1a6')][_0x53f2('0xff')](db[_0x53f2('0xc7')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x53f2('0x19d')});db['Dynamics365Configuration'][_0x53f2('0xff')](db[_0x53f2('0xc7')],{'as':'Descriptions','onDelete':_0x53f2('0xfd'),'foreignKey':_0x53f2('0x196')});db['Dynamics365Configuration'][_0x53f2('0xff')](db[_0x53f2('0xc7')],{'as':_0x53f2('0x190'),'onDelete':'cascade','foreignKey':_0x53f2('0x197')});db['Dynamics365Configuration'][_0x53f2('0x106')](db[_0x53f2('0xc5')],{'as':_0x53f2('0x14a'),'foreignKey':_0x53f2('0x198')});db[_0x53f2('0xc7')][_0x53f2('0xff')](db[_0x53f2('0xc7')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x53f2('0xc7')][_0x53f2('0xff')](db['Dynamics365Field'],{'as':_0x53f2('0x199'),'foreignKey':_0x53f2('0x196')});db[_0x53f2('0xc7')][_0x53f2('0xff')](db[_0x53f2('0xc7')],{'as':_0x53f2('0x19e'),'foreignKey':_0x53f2('0x197')});db[_0x53f2('0xc7')][_0x53f2('0x106')](db[_0x53f2('0x90')],{'as':'Variable','foreignKey':'VariableId'});db[_0x53f2('0xc9')][_0x53f2('0xff')](db[_0x53f2('0xcb')],{'as':_0x53f2('0x19f'),'onDelete':_0x53f2('0xfd'),'foreignKey':'AccountId'});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':_0x53f2('0x194'),'foreignKey':_0x53f2('0x19d')});db[_0x53f2('0xcb')][_0x53f2('0xff')](db[_0x53f2('0x1a7')],{'as':_0x53f2('0x195'),'foreignKey':_0x53f2('0x196')});db['FreshsalesConfiguration']['hasMany'](db[_0x53f2('0x1a7')],{'as':_0x53f2('0x190'),'foreignKey':_0x53f2('0x197')});db[_0x53f2('0xcb')]['belongsTo'](db['FreshsalesAccount'],{'as':_0x53f2('0x14a'),'foreignKey':_0x53f2('0x198')});db[_0x53f2('0x1a7')][_0x53f2('0xff')](db[_0x53f2('0x1a7')],{'as':_0x53f2('0x19c'),'foreignKey':_0x53f2('0x19d')});db['FreshsalesField']['hasMany'](db['FreshsalesField'],{'as':_0x53f2('0x199'),'foreignKey':_0x53f2('0x196')});db[_0x53f2('0x1a7')][_0x53f2('0xff')](db[_0x53f2('0x1a7')],{'as':_0x53f2('0x19e'),'foreignKey':_0x53f2('0x197')});db[_0x53f2('0x1a7')][_0x53f2('0x106')](db['Variable'],{'as':_0x53f2('0x90'),'foreignKey':'VariableId'});db['ChatQueueReport'][_0x53f2('0x106')](db['ChatWebsite'],{});db[_0x53f2('0xcf')]['belongsTo'](db[_0x53f2('0xf4')],{'as':_0x53f2('0x145'),'foreignKey':_0x53f2('0x146')});db[_0x53f2('0xcf')][_0x53f2('0x106')](db['CmContact'],{'as':_0x53f2('0x13d'),'foreignKey':'ContactId'});db['ChatQueueReport'][_0x53f2('0x106')](db['ChatInteraction'],{});db[_0x53f2('0xcf')][_0x53f2('0x106')](db[_0x53f2('0x69')],{});db[_0x53f2('0xcf')][_0x53f2('0x106')](db[_0x53f2('0x10')],{});db[_0x53f2('0xcf')][_0x53f2('0x106')](db[_0x53f2('0x6c')],{});db[_0x53f2('0x171')][_0x53f2('0x106')](db[_0x53f2('0x10')],{'onDelete':_0x53f2('0xfd'),'foreignKey':_0x53f2('0x1a8')});db[_0x53f2('0x171')]['belongsTo'](db[_0x53f2('0x10')],{'onDelete':_0x53f2('0xfd'),'foreignKey':_0x53f2('0x1a9')});db[_0x53f2('0xd5')][_0x53f2('0xff')](db['JscriptyQuestionReport'],{'foreignKey':_0x53f2('0x1aa'),'onDelete':_0x53f2('0xfd')});db['JscriptySessionReport'][_0x53f2('0xff')](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':_0x53f2('0xfd')});db['SmsQueueReport'][_0x53f2('0x106')](db[_0x53f2('0x54')],{});db[_0x53f2('0xd6')][_0x53f2('0x106')](db[_0x53f2('0xf4')],{'as':_0x53f2('0x145'),'foreignKey':_0x53f2('0x146')});db[_0x53f2('0xd6')][_0x53f2('0x106')](db['CmContact'],{'as':_0x53f2('0x13d'),'foreignKey':_0x53f2('0x157')});db['SmsQueueReport']['belongsTo'](db['SmsInteraction'],{});db[_0x53f2('0xd6')][_0x53f2('0x106')](db['SmsMessage'],{});db[_0x53f2('0xd6')][_0x53f2('0x106')](db['User'],{});db[_0x53f2('0xd6')][_0x53f2('0x106')](db[_0x53f2('0x5a')],{});db[_0x53f2('0xdb')][_0x53f2('0xff')](db[_0x53f2('0xd5')],{'foreignKey':_0x53f2('0x1ab')});db[_0x53f2('0xdb')][_0x53f2('0xff')](db[_0x53f2('0xd3')],{'foreignKey':_0x53f2('0x1ab')});db['JscriptyProject'][_0x53f2('0xff')](db[_0x53f2('0xd2')],{'foreignKey':'ProjectId'});db[_0x53f2('0xde')][_0x53f2('0x108')](db['User'],{'as':'Users','through':'user_has_square_projects'});db[_0x53f2('0xe4')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x53f2('0x1ac')});db[_0x53f2('0xe4')][_0x53f2('0x108')](db[_0x53f2('0x110')],{'through':'team_has_voice_queues','as':_0x53f2('0x1ad')});db[_0x53f2('0xe4')]['belongsToMany'](db['MailQueue'],{'through':_0x53f2('0x148'),'as':'MailQueues'});db[_0x53f2('0xe4')][_0x53f2('0x108')](db[_0x53f2('0x6c')],{'through':_0x53f2('0x170'),'as':_0x53f2('0x114')});db[_0x53f2('0xe4')]['belongsToMany'](db[_0x53f2('0x52')],{'through':'team_has_fax_queues','as':_0x53f2('0x115')});db[_0x53f2('0xe4')][_0x53f2('0x108')](db['SmsQueue'],{'through':'team_has_sms_queues','as':_0x53f2('0x116')});db[_0x53f2('0xe4')][_0x53f2('0x108')](db[_0x53f2('0x61')],{'through':_0x53f2('0x168'),'as':_0x53f2('0x117')});db[_0x53f2('0xe6')]['hasMany'](db['CmHopper'],{'as':_0x53f2('0x127'),'foreignKey':_0x53f2('0x179')});db[_0x53f2('0xe6')]['hasMany'](db[_0x53f2('0x77')],{'as':'HopperFinals','foreignKey':'CampaignId'});db[_0x53f2('0xe6')]['hasMany'](db[_0x53f2('0x78')],{'as':_0x53f2('0x129'),'foreignKey':_0x53f2('0x179')});db[_0x53f2('0xe6')][_0x53f2('0xff')](db[_0x53f2('0x75')],{'as':_0x53f2('0x1ae'),'foreignKey':'CampaignId'});db[_0x53f2('0xe6')]['belongsTo'](db[_0x53f2('0x2a')],{'as':_0x53f2('0x2a'),'foreignKey':_0x53f2('0x1af')});db['Campaign'][_0x53f2('0x106')](db[_0x53f2('0x2a')],{'as':'TrunkBackup','foreignKey':_0x53f2('0x12c')});db[_0x53f2('0xe6')][_0x53f2('0x106')](db[_0x53f2('0x12d')],{'as':'Interval','foreignKey':'IntervalId'});db[_0x53f2('0xe6')]['belongsTo'](db[_0x53f2('0xde')],{'as':_0x53f2('0xde'),'foreignKey':_0x53f2('0x1b0')});db[_0x53f2('0xe6')][_0x53f2('0x108')](db['CmList'],{'as':_0x53f2('0x1b1'),'through':'campaigns_has_cm_lists'});db['Campaign'][_0x53f2('0x108')](db['CmList'],{'as':'BlackLists','through':_0x53f2('0x1b2')});db[_0x53f2('0xec')][_0x53f2('0x106')](db[_0x53f2('0x41')],{});db[_0x53f2('0xec')][_0x53f2('0x106')](db[_0x53f2('0x40')],{});db[_0x53f2('0xec')]['belongsTo'](db['MailAccount'],{'foreignKey':_0x53f2('0x1b3'),'as':_0x53f2('0x1b4')});db[_0x53f2('0xec')]['belongsTo'](db['User'],{'foreignKey':_0x53f2('0x1b5'),'as':_0x53f2('0x1b6')});db['MailTransferReport'][_0x53f2('0x106')](db[_0x53f2('0x10')],{'foreignKey':_0x53f2('0x1b7'),'as':_0x53f2('0x1b8')});db['MailTransferReport'][_0x53f2('0x106')](db['MailQueue'],{'foreignKey':_0x53f2('0x1b9'),'as':_0x53f2('0x1ba')});db['MailTransferReport'][_0x53f2('0x106')](db[_0x53f2('0x3d')],{'foreignKey':'ToMailAccountId','as':_0x53f2('0x1bb')});db[_0x53f2('0xed')]['belongsTo'](db['ChatMessage'],{});db[_0x53f2('0xed')][_0x53f2('0x106')](db[_0x53f2('0x68')],{});db[_0x53f2('0xed')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x53f2('0x1bc'),'as':'FromAccount'});db['ChatTransferReport'][_0x53f2('0x106')](db['User'],{'foreignKey':'FromUserId','as':_0x53f2('0x1b6')});db[_0x53f2('0xed')][_0x53f2('0x106')](db[_0x53f2('0x10')],{'foreignKey':_0x53f2('0x1b7'),'as':_0x53f2('0x1b8')});db[_0x53f2('0xed')]['belongsTo'](db[_0x53f2('0x6c')],{'foreignKey':'ToChatQueueId','as':_0x53f2('0x1ba')});db[_0x53f2('0xed')][_0x53f2('0x106')](db[_0x53f2('0x62')],{'foreignKey':_0x53f2('0x1bd'),'as':_0x53f2('0x1bb')});db[_0x53f2('0xef')]['belongsTo'](db[_0x53f2('0x50')],{});db[_0x53f2('0xef')][_0x53f2('0x106')](db['FaxInteraction'],{});db['FaxTransferReport']['belongsTo'](db[_0x53f2('0x4a')],{'foreignKey':_0x53f2('0x1be'),'as':_0x53f2('0x1b4')});db[_0x53f2('0xef')]['belongsTo'](db[_0x53f2('0x10')],{'foreignKey':_0x53f2('0x1b5'),'as':_0x53f2('0x1b6')});db[_0x53f2('0xef')][_0x53f2('0x106')](db[_0x53f2('0x10')],{'foreignKey':_0x53f2('0x1b7'),'as':_0x53f2('0x1b8')});db[_0x53f2('0xef')][_0x53f2('0x106')](db[_0x53f2('0x52')],{'foreignKey':_0x53f2('0x1bf'),'as':'ToQueue'});db[_0x53f2('0xef')][_0x53f2('0x106')](db[_0x53f2('0x4a')],{'foreignKey':_0x53f2('0x1c0'),'as':_0x53f2('0x1bb')});db[_0x53f2('0x1c1')][_0x53f2('0x106')](db['OpenchannelMessage'],{});db[_0x53f2('0x1c1')][_0x53f2('0x106')](db[_0x53f2('0x5d')],{});db['OpenchannelTransferReport'][_0x53f2('0x106')](db[_0x53f2('0x11e')],{'foreignKey':_0x53f2('0x1c2'),'as':'FromAccount'});db[_0x53f2('0x1c1')][_0x53f2('0x106')](db['User'],{'foreignKey':_0x53f2('0x1b5'),'as':_0x53f2('0x1b6')});db[_0x53f2('0x1c1')][_0x53f2('0x106')](db[_0x53f2('0x10')],{'foreignKey':'ToUserId','as':_0x53f2('0x1b8')});db['OpenchannelTransferReport']['belongsTo'](db[_0x53f2('0x61')],{'foreignKey':_0x53f2('0x1c3'),'as':_0x53f2('0x1ba')});db[_0x53f2('0x1c1')][_0x53f2('0x106')](db[_0x53f2('0x11e')],{'foreignKey':'ToOpenchannelAccountId','as':_0x53f2('0x1bb')});db[_0x53f2('0xf2')]['belongsTo'](db[_0x53f2('0x15d')],{});db[_0x53f2('0xf2')]['belongsTo'](db['SmsInteraction'],{});db[_0x53f2('0xf2')][_0x53f2('0x106')](db[_0x53f2('0x54')],{'foreignKey':'FromSmsAccountId','as':_0x53f2('0x1b4')});db[_0x53f2('0xf2')]['belongsTo'](db[_0x53f2('0x10')],{'foreignKey':_0x53f2('0x1b5'),'as':_0x53f2('0x1b6')});db[_0x53f2('0xf2')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':_0x53f2('0x1b8')});db['SmsTransferReport'][_0x53f2('0x106')](db[_0x53f2('0x5a')],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db['SmsTransferReport'][_0x53f2('0x106')](db['SmsAccount'],{'foreignKey':_0x53f2('0x1c4'),'as':_0x53f2('0x1bb')});db['CmList'][_0x53f2('0xff')](db[_0x53f2('0x140')],{'as':'Dispositions','foreignKey':_0x53f2('0x146')});db[_0x53f2('0xf4')][_0x53f2('0xff')](db[_0x53f2('0x1c5')],{'as':'CustomFields','foreignKey':_0x53f2('0x146')});db[_0x53f2('0xf4')]['hasMany'](db[_0x53f2('0x72')],{'as':_0x53f2('0x174'),'onDelete':_0x53f2('0xfd'),'foreignKey':'ListId'});db[_0x53f2('0xf4')]['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x53f2('0x146')});db[_0x53f2('0xf4')]['hasMany'](db[_0x53f2('0x78')],{'as':'HopperHistory','foreignKey':'ListId'});db[_0x53f2('0xf4')]['hasMany'](db[_0x53f2('0x7a')],{'as':'ReportAgentPreview','foreignKey':_0x53f2('0x146')});db[_0x53f2('0xf4')]['belongsToMany'](db[_0x53f2('0x110')],{'as':_0x53f2('0x1c6'),'through':_0x53f2('0x131')});db['CmList']['belongsToMany'](db[_0x53f2('0x10')],{'as':_0x53f2('0x132'),'through':_0x53f2('0x109')});db['VoicePrefix'][_0x53f2('0xff')](db[_0x53f2('0x17')],{'as':_0x53f2('0x100'),'onDelete':_0x53f2('0x150')});db['VoicePrefix']['belongsToMany'](db[_0x53f2('0x10')],{'as':_0x53f2('0x132'),'through':'user_has_voice_prefixes'});db[_0x53f2('0x107')][_0x53f2('0xff')](db[_0x53f2('0x10')],{'as':_0x53f2('0x159'),'foreignKey':'userProfileId'});db[_0x53f2('0x107')]['hasMany'](db[_0x53f2('0xf8')],{'as':_0x53f2('0x1c7'),'foreignKey':_0x53f2('0x1c8'),'onDelete':_0x53f2('0xfd')});db['UserProfileSection'][_0x53f2('0xff')](db[_0x53f2('0xfa')],{'as':_0x53f2('0x1c9'),'foreignKey':_0x53f2('0x1ca'),'onDelete':_0x53f2('0xfd')});module[_0x53f2('0x1cb')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index bac57d8..eff7d06 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7803=['./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/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/squareReportDetail','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/recordings','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','./api/campaign','/api/migrations','/api/attachments','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/jira','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','join','root','/www','static','/demo','/snippet','snippet','1.0.16','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','util','./errors','api','./config/logger','default','use','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','remoteAddress','statusCode','user','name','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','url','device','other','agent_id','agent_name','/api/users','./api/user','./api/voiceChanSpy','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/dials/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/openchannelQueueReport','/api/chat/applications','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/cannedAnswer','./api/disposition','./api/condition','/api/intervals','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','/api/variables','./api/variable','/api/integrations','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics'];(function(_0x5b1093,_0x211678){var _0x34018d=function(_0x3aac95){while(--_0x3aac95){_0x5b1093['push'](_0x5b1093['shift']());}};_0x34018d(++_0x211678);}(_0x7803,0x17f));var _0x3780=function(_0xa44406,_0xe170c7){_0xa44406=_0xa44406-0x0;var _0x5291f8=_0x7803[_0xa44406];return _0x5291f8;};'use strict';var path=require(_0x3780('0x0'));var express=require(_0x3780('0x1'));var ewinston=require('express-winston');var util=require(_0x3780('0x2'));var errors=require(_0x3780('0x3'));var config=require('./config/environment');var logger=require('./config/logger')(_0x3780('0x4'));var authLogger=require(_0x3780('0x5'))('auth');exports[_0x3780('0x6')]=function(_0xb93920){_0xb93920[_0x3780('0x7')](ewinston[_0x3780('0x8')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x9168c4,_0x14f104){return util[_0x3780('0x9')](_0x3780('0xa'),_0x9168c4[_0x3780('0xb')],_0x9168c4[_0x3780('0xc')][_0x3780('0xd')]?_0x9168c4[_0x3780('0xc')]['x-forwarded-for']:_0x9168c4[_0x3780('0xe')][_0x3780('0xf')]||_0x9168c4['ip'],_0x9168c4['url'],_0x14f104[_0x3780('0x10')],_0x14f104['responseTime'],_0x9168c4[_0x3780('0x11')]?_0x9168c4['user']['id']:null,_0x9168c4[_0x3780('0x11')]?_0x9168c4['user'][_0x3780('0x12')]:null,_0x9168c4[_0x3780('0x11')]?_0x9168c4[_0x3780('0x11')][_0x3780('0x13')]:null);}}));_0xb93920[_0x3780('0x7')](ewinston[_0x3780('0x8')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x5ea7fa,_0x16c65c){var _0x25707a=_0x3780('0x14');if(_0x5ea7fa[_0x3780('0x15')]&&_0x5ea7fa[_0x3780('0x15')]['device']&&_0x5ea7fa[_0x3780('0x15')]['agent_id']){_0x25707a='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x3780('0x9')](_0x25707a,_0x5ea7fa[_0x3780('0xb')],_0x5ea7fa[_0x3780('0xc')][_0x3780('0xd')]?_0x5ea7fa[_0x3780('0xc')][_0x3780('0xd')]:_0x5ea7fa[_0x3780('0xe')][_0x3780('0xf')]||_0x5ea7fa['ip'],_0x5ea7fa[_0x3780('0x16')],_0x16c65c[_0x3780('0x10')],_0x16c65c['responseTime'],_0x5ea7fa['user']?_0x5ea7fa[_0x3780('0x11')]['id']:null,_0x5ea7fa[_0x3780('0x11')]?_0x5ea7fa['user'][_0x3780('0x12')]:null,_0x5ea7fa[_0x3780('0x11')]?_0x5ea7fa[_0x3780('0x11')][_0x3780('0x13')]:null,_0x5ea7fa[_0x3780('0x15')]&&_0x5ea7fa['body'][_0x3780('0x17')]?_0x5ea7fa[_0x3780('0x15')][_0x3780('0x17')]:_0x3780('0x18'),_0x5ea7fa['body']&&_0x5ea7fa[_0x3780('0x15')]['agent_id']?_0x5ea7fa[_0x3780('0x15')][_0x3780('0x19')]:'',_0x5ea7fa[_0x3780('0x15')]&&_0x5ea7fa[_0x3780('0x15')][_0x3780('0x1a')]?_0x5ea7fa[_0x3780('0x15')][_0x3780('0x1a')]:'');},'ignoreRoute':function(_0x1c9f5a){var _0x289a74=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x289a74['test'](_0x1c9f5a[_0x3780('0x16')]);}}));_0xb93920['use'](_0x3780('0x1b'),require(_0x3780('0x1c')));_0xb93920['use']('/api/voice/chanspy',require(_0x3780('0x1d')));_0xb93920[_0x3780('0x7')]('/api/voice/contexts',require('./api/voiceContext'));_0xb93920['use']('/api/voice/extensions',require(_0x3780('0x1e')));_0xb93920['use'](_0x3780('0x1f'),require('./api/voiceMusicOnHold'));_0xb93920[_0x3780('0x7')](_0x3780('0x20'),require(_0x3780('0x21')));_0xb93920[_0x3780('0x7')](_0x3780('0x22'),require(_0x3780('0x23')));_0xb93920['use'](_0x3780('0x24'),require(_0x3780('0x25')));_0xb93920[_0x3780('0x7')](_0x3780('0x26'),require(_0x3780('0x27')));_0xb93920['use'](_0x3780('0x28'),require(_0x3780('0x29')));_0xb93920[_0x3780('0x7')]('/api/voice/calls/reports',require('./api/voiceCallReport'));_0xb93920[_0x3780('0x7')](_0x3780('0x2a'),require('./api/voiceDialReport'));_0xb93920['use']('/api/voice/agents/reports',require(_0x3780('0x2b')));_0xb93920[_0x3780('0x7')]('/api/voice/queues/reports',require(_0x3780('0x2c')));_0xb93920[_0x3780('0x7')](_0x3780('0x2d'),require(_0x3780('0x2e')));_0xb93920[_0x3780('0x7')](_0x3780('0x2f'),require(_0x3780('0x30')));_0xb93920[_0x3780('0x7')](_0x3780('0x31'),require(_0x3780('0x32')));_0xb93920[_0x3780('0x7')](_0x3780('0x33'),require(_0x3780('0x34')));_0xb93920[_0x3780('0x7')]('/api/mail/accounts',require(_0x3780('0x35')));_0xb93920['use'](_0x3780('0x36'),require(_0x3780('0x37')));_0xb93920['use'](_0x3780('0x38'),require(_0x3780('0x39')));_0xb93920[_0x3780('0x7')](_0x3780('0x3a'),require('./api/mailInteraction'));_0xb93920['use'](_0x3780('0x3b'),require('./api/mailMessage'));_0xb93920['use'](_0x3780('0x3c'),require(_0x3780('0x3d')));_0xb93920[_0x3780('0x7')](_0x3780('0x3e'),require(_0x3780('0x3f')));_0xb93920[_0x3780('0x7')](_0x3780('0x40'),require(_0x3780('0x41')));_0xb93920[_0x3780('0x7')]('/api/dashboards/items',require(_0x3780('0x42')));_0xb93920[_0x3780('0x7')](_0x3780('0x43'),require(_0x3780('0x44')));_0xb93920[_0x3780('0x7')](_0x3780('0x45'),require(_0x3780('0x46')));_0xb93920[_0x3780('0x7')]('/api/fax/interactions',require(_0x3780('0x47')));_0xb93920[_0x3780('0x7')]('/api/fax/messages',require(_0x3780('0x48')));_0xb93920['use'](_0x3780('0x49'),require(_0x3780('0x4a')));_0xb93920['use'](_0x3780('0x4b'),require('./api/faxQueueReport'));_0xb93920[_0x3780('0x7')](_0x3780('0x4c'),require(_0x3780('0x4d')));_0xb93920[_0x3780('0x7')]('/api/sms/applications',require(_0x3780('0x4e')));_0xb93920[_0x3780('0x7')](_0x3780('0x4f'),require(_0x3780('0x50')));_0xb93920[_0x3780('0x7')](_0x3780('0x51'),require('./api/smsMessage'));_0xb93920[_0x3780('0x7')]('/api/sms/queues',require('./api/smsQueue'));_0xb93920[_0x3780('0x7')](_0x3780('0x52'),require(_0x3780('0x53')));_0xb93920[_0x3780('0x7')](_0x3780('0x54'),require(_0x3780('0x55')));_0xb93920[_0x3780('0x7')](_0x3780('0x56'),require(_0x3780('0x57')));_0xb93920[_0x3780('0x7')](_0x3780('0x58'),require(_0x3780('0x59')));_0xb93920[_0x3780('0x7')](_0x3780('0x5a'),require(_0x3780('0x5b')));_0xb93920[_0x3780('0x7')](_0x3780('0x5c'),require('./api/chatWebsite'));_0xb93920['use']('/api/openchannel/reports/queue',require(_0x3780('0x5d')));_0xb93920[_0x3780('0x7')](_0x3780('0x5e'),require('./api/chatApplication'));_0xb93920[_0x3780('0x7')]('/api/chat/interactions',require(_0x3780('0x5f')));_0xb93920['use'](_0x3780('0x60'),require(_0x3780('0x61')));_0xb93920[_0x3780('0x7')](_0x3780('0x62'),require('./api/chatOfflineMessage'));_0xb93920[_0x3780('0x7')](_0x3780('0x63'),require('./api/chatQueue'));_0xb93920[_0x3780('0x7')]('/api/chat/groups',require(_0x3780('0x64')));_0xb93920['use'](_0x3780('0x65'),require('./api/chatProactiveAction'));_0xb93920[_0x3780('0x7')](_0x3780('0x66'),require(_0x3780('0x67')));_0xb93920[_0x3780('0x7')](_0x3780('0x68'),require(_0x3780('0x69')));_0xb93920[_0x3780('0x7')](_0x3780('0x6a'),require(_0x3780('0x6b')));_0xb93920[_0x3780('0x7')]('/api/cm/hopper_black',require(_0x3780('0x6c')));_0xb93920[_0x3780('0x7')](_0x3780('0x6d'),require(_0x3780('0x6e')));_0xb93920['use'](_0x3780('0x6f'),require(_0x3780('0x70')));_0xb93920[_0x3780('0x7')](_0x3780('0x71'),require(_0x3780('0x72')));_0xb93920[_0x3780('0x7')](_0x3780('0x73'),require(_0x3780('0x74')));_0xb93920['use'](_0x3780('0x75'),require('./api/automation'));_0xb93920['use']('/api/canned_answers',require(_0x3780('0x76')));_0xb93920[_0x3780('0x7')]('/api/dispositions',require(_0x3780('0x77')));_0xb93920['use']('/api/conditions',require(_0x3780('0x78')));_0xb93920['use'](_0x3780('0x79'),require('./api/interval'));_0xb93920[_0x3780('0x7')]('/api/pauses',require(_0x3780('0x7a')));_0xb93920[_0x3780('0x7')](_0x3780('0x7b'),require('./api/cdr'));_0xb93920[_0x3780('0x7')](_0x3780('0x7c'),require(_0x3780('0x7d')));_0xb93920['use'](_0x3780('0x7e'),require('./api/schedule'));_0xb93920['use'](_0x3780('0x7f'),require(_0x3780('0x80')));_0xb93920[_0x3780('0x7')](_0x3780('0x81'),require(_0x3780('0x82')));_0xb93920[_0x3780('0x7')](_0x3780('0x83'),require(_0x3780('0x84')));_0xb93920['use'](_0x3780('0x85'),require('./api/trigger'));_0xb93920[_0x3780('0x7')](_0x3780('0x86'),require(_0x3780('0x87')));_0xb93920['use'](_0x3780('0x88'),require(_0x3780('0x89')));_0xb93920['use']('/api/integrations/reports',require(_0x3780('0x8a')));_0xb93920[_0x3780('0x7')](_0x3780('0x8b'),require(_0x3780('0x8c')));_0xb93920[_0x3780('0x7')]('/api/analytics/default_reports',require(_0x3780('0x8d')));_0xb93920[_0x3780('0x7')](_0x3780('0x8e'),require(_0x3780('0x8f')));_0xb93920[_0x3780('0x7')](_0x3780('0x90'),require(_0x3780('0x91')));_0xb93920['use'](_0x3780('0x92'),require(_0x3780('0x93')));_0xb93920[_0x3780('0x7')](_0x3780('0x94'),require(_0x3780('0x95')));_0xb93920[_0x3780('0x7')]('/api/integrations/salesforce/accounts',require(_0x3780('0x96')));_0xb93920[_0x3780('0x7')]('/api/integrations/salesforce/configurations',require(_0x3780('0x97')));_0xb93920[_0x3780('0x7')](_0x3780('0x98'),require('./api/intSalesforceField'));_0xb93920['use'](_0x3780('0x99'),require(_0x3780('0x9a')));_0xb93920['use']('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0xb93920[_0x3780('0x7')](_0x3780('0x9b'),require('./api/intSugarcrmField'));_0xb93920[_0x3780('0x7')](_0x3780('0x9c'),require(_0x3780('0x9d')));_0xb93920[_0x3780('0x7')](_0x3780('0x9e'),require(_0x3780('0x9f')));_0xb93920[_0x3780('0x7')](_0x3780('0xa0'),require(_0x3780('0xa1')));_0xb93920[_0x3780('0x7')](_0x3780('0xa2'),require(_0x3780('0xa3')));_0xb93920[_0x3780('0x7')](_0x3780('0xa4'),require(_0x3780('0xa5')));_0xb93920[_0x3780('0x7')](_0x3780('0xa6'),require(_0x3780('0xa7')));_0xb93920[_0x3780('0x7')]('/api/integrations/zendesk/accounts',require(_0x3780('0xa8')));_0xb93920['use'](_0x3780('0xa9'),require('./api/intZendeskConfiguration'));_0xb93920[_0x3780('0x7')](_0x3780('0xaa'),require(_0x3780('0xab')));_0xb93920[_0x3780('0x7')]('/api/integrations/freshdesk/accounts',require('./api/intFreshdeskAccount'));_0xb93920[_0x3780('0x7')](_0x3780('0xac'),require('./api/intFreshdeskConfiguration'));_0xb93920['use'](_0x3780('0xad'),require(_0x3780('0xae')));_0xb93920[_0x3780('0x7')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0xb93920[_0x3780('0x7')](_0x3780('0xaf'),require(_0x3780('0xb0')));_0xb93920[_0x3780('0x7')](_0x3780('0xb1'),require(_0x3780('0xb2')));_0xb93920[_0x3780('0x7')](_0x3780('0xb3'),require(_0x3780('0xb4')));_0xb93920['use']('/api/integrations/servicenow/configurations',require(_0x3780('0xb5')));_0xb93920[_0x3780('0x7')](_0x3780('0xb6'),require(_0x3780('0xb7')));_0xb93920[_0x3780('0x7')]('/api/integrations/dynamics365/accounts',require(_0x3780('0xb8')));_0xb93920[_0x3780('0x7')]('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0xb93920[_0x3780('0x7')](_0x3780('0xb9'),require('./api/intDynamics365Field'));_0xb93920[_0x3780('0x7')](_0x3780('0xba'),require('./api/intFreshsalesAccount'));_0xb93920[_0x3780('0x7')]('/api/integrations/freshsales/configurations',require('./api/intFreshsalesConfiguration'));_0xb93920[_0x3780('0x7')](_0x3780('0xbb'),require(_0x3780('0xbc')));_0xb93920[_0x3780('0x7')]('/api/networks',require(_0x3780('0xbd')));_0xb93920[_0x3780('0x7')](_0x3780('0xbe'),require(_0x3780('0xbf')));_0xb93920[_0x3780('0x7')]('/api/chat/internal/messages',require(_0x3780('0xc0')));_0xb93920[_0x3780('0x7')](_0x3780('0xc1'),require(_0x3780('0xc2')));_0xb93920['use'](_0x3780('0xc3'),require(_0x3780('0xc4')));_0xb93920['use'](_0x3780('0xc5'),require(_0x3780('0xc6')));_0xb93920[_0x3780('0x7')](_0x3780('0xc7'),require('./api/smsQueueReport'));_0xb93920[_0x3780('0x7')](_0x3780('0xc8'),require(_0x3780('0xc9')));_0xb93920[_0x3780('0x7')](_0x3780('0xca'),require(_0x3780('0xcb')));_0xb93920[_0x3780('0x7')]('/api/jscripty/projects',require(_0x3780('0xcc')));_0xb93920[_0x3780('0x7')](_0x3780('0xcd'),require('./api/setting'));_0xb93920[_0x3780('0x7')](_0x3780('0xce'),require(_0x3780('0xcf')));_0xb93920[_0x3780('0x7')]('/api/square/projects',require('./api/squareProject'));_0xb93920[_0x3780('0x7')](_0x3780('0xd0'),require('./api/squareRecording'));_0xb93920['use'](_0x3780('0xd1'),require(_0x3780('0xd2')));_0xb93920[_0x3780('0x7')](_0x3780('0xd3'),require(_0x3780('0xd4')));_0xb93920[_0x3780('0x7')](_0x3780('0xd5'),require(_0x3780('0xd6')));_0xb93920['use']('/api/campaigns',require(_0x3780('0xd7')));_0xb93920[_0x3780('0x7')](_0x3780('0xd8'),require('./api/migration'));_0xb93920[_0x3780('0x7')](_0x3780('0xd9'),require('./api/attachment'));_0xb93920[_0x3780('0x7')](_0x3780('0xda'),require(_0x3780('0xdb')));_0xb93920['use']('/api/mail/reports/transfer',require(_0x3780('0xdc')));_0xb93920['use'](_0x3780('0xdd'),require(_0x3780('0xde')));_0xb93920['use'](_0x3780('0xdf'),require(_0x3780('0xe0')));_0xb93920[_0x3780('0x7')](_0x3780('0xe1'),require('./api/openchannelTransferReport'));_0xb93920[_0x3780('0x7')]('/api/sms/reports/transfer',require(_0x3780('0xe2')));_0xb93920[_0x3780('0x7')](_0x3780('0xe3'),require(_0x3780('0xe4')));_0xb93920[_0x3780('0x7')](_0x3780('0xe5'),require(_0x3780('0xe6')));_0xb93920['use'](_0x3780('0xe7'),require(_0x3780('0xe8')));_0xb93920['use']('/api/userProfile/sections',require(_0x3780('0xe9')));_0xb93920['use'](_0x3780('0xea'),require(_0x3780('0xeb')));_0xb93920[_0x3780('0x7')](_0x3780('0xec'),require(_0x3780('0xed')));_0xb93920[_0x3780('0x7')](_0x3780('0xee'),require(_0x3780('0xef')));_0xb93920[_0x3780('0x7')]('/api/jira',require(_0x3780('0xf0')));_0xb93920[_0x3780('0x7')]('/api/rpc',require(_0x3780('0xf1')));_0xb93920[_0x3780('0x7')]('/api/version',require(_0x3780('0xf2')));_0xb93920['use'](_0x3780('0xf3'),require(_0x3780('0xf4')));_0xb93920['use'](_0x3780('0xf5'),require(_0x3780('0xf6')));_0xb93920['use'](_0x3780('0xf7'),express['static'](path[_0x3780('0xf8')](config[_0x3780('0xf9')],'/apidoc')));_0xb93920['use'](_0x3780('0xfa'),express[_0x3780('0xfb')](path[_0x3780('0xf8')](config[_0x3780('0xf9')],_0x3780('0xfa'))));_0xb93920[_0x3780('0x7')](_0x3780('0xfc'),express[_0x3780('0xfb')](path[_0x3780('0xf8')](config[_0x3780('0xf9')],'/demo')));_0xb93920[_0x3780('0x7')](_0x3780('0xfd'),express[_0x3780('0xfb')](path[_0x3780('0xf8')](config[_0x3780('0xf9')],_0x3780('0xfe'),_0x3780('0xff'))));_0xb93920['use']('/plugins',express[_0x3780('0xfb')](path[_0x3780('0xf8')](config[_0x3780('0xf9')],_0x3780('0x100'))));_0xb93920[_0x3780('0x101')](_0x3780('0x102'))['get'](errors[0x194]);_0xb93920[_0x3780('0x101')]('/*')[_0x3780('0x103')](function(_0xe18d32,_0x322d35){_0x322d35[_0x3780('0x104')](path[_0x3780('0x105')](_0xb93920['get'](_0x3780('0x106'))+_0x3780('0x107')));});}; \ No newline at end of file +var _0xc4b3=['/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/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/auth/google','/api/jira','./api/jira','/api/version','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','/www','static','root','/demo','join','/snippet','snippet','1.0.16','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','path','express','express-winston','util','./config/environment','./config/logger','api','default','use','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','role','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)','other','agent_name','test','/api/users','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./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/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','./api/interval','./api/pause','/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/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','./api/integrationReport','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField'];(function(_0x1eeb97,_0x3340ac){var _0x5349b3=function(_0x47c7c1){while(--_0x47c7c1){_0x1eeb97['push'](_0x1eeb97['shift']());}};_0x5349b3(++_0x3340ac);}(_0xc4b3,0x192));var _0x3c4b=function(_0x101b9b,_0x5ad26e){_0x101b9b=_0x101b9b-0x0;var _0x4997f6=_0xc4b3[_0x101b9b];return _0x4997f6;};'use strict';var path=require(_0x3c4b('0x0'));var express=require(_0x3c4b('0x1'));var ewinston=require(_0x3c4b('0x2'));var util=require(_0x3c4b('0x3'));var errors=require('./errors');var config=require(_0x3c4b('0x4'));var logger=require(_0x3c4b('0x5'))(_0x3c4b('0x6'));var authLogger=require('./config/logger')('auth');exports[_0x3c4b('0x7')]=function(_0xd5c94c){_0xd5c94c[_0x3c4b('0x8')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x4aa017,_0x533fe7){return util[_0x3c4b('0x9')](_0x3c4b('0xa'),_0x4aa017[_0x3c4b('0xb')],_0x4aa017[_0x3c4b('0xc')][_0x3c4b('0xd')]?_0x4aa017[_0x3c4b('0xc')][_0x3c4b('0xd')]:_0x4aa017[_0x3c4b('0xe')][_0x3c4b('0xf')]||_0x4aa017['ip'],_0x4aa017[_0x3c4b('0x10')],_0x533fe7[_0x3c4b('0x11')],_0x533fe7[_0x3c4b('0x12')],_0x4aa017['user']?_0x4aa017['user']['id']:null,_0x4aa017[_0x3c4b('0x13')]?_0x4aa017[_0x3c4b('0x13')][_0x3c4b('0x14')]:null,_0x4aa017['user']?_0x4aa017[_0x3c4b('0x13')][_0x3c4b('0x15')]:null);}}));_0xd5c94c[_0x3c4b('0x8')](ewinston[_0x3c4b('0x16')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x543322,_0xf3056a){var _0x77966e=_0x3c4b('0x17');if(_0x543322[_0x3c4b('0x18')]&&_0x543322[_0x3c4b('0x18')][_0x3c4b('0x19')]&&_0x543322[_0x3c4b('0x18')][_0x3c4b('0x1a')]){_0x77966e=_0x3c4b('0x1b');}return util['format'](_0x77966e,_0x543322[_0x3c4b('0xb')],_0x543322[_0x3c4b('0xc')][_0x3c4b('0xd')]?_0x543322[_0x3c4b('0xc')][_0x3c4b('0xd')]:_0x543322[_0x3c4b('0xe')][_0x3c4b('0xf')]||_0x543322['ip'],_0x543322['url'],_0xf3056a[_0x3c4b('0x11')],_0xf3056a[_0x3c4b('0x12')],_0x543322['user']?_0x543322[_0x3c4b('0x13')]['id']:null,_0x543322[_0x3c4b('0x13')]?_0x543322['user'][_0x3c4b('0x14')]:null,_0x543322[_0x3c4b('0x13')]?_0x543322[_0x3c4b('0x13')][_0x3c4b('0x15')]:null,_0x543322[_0x3c4b('0x18')]&&_0x543322[_0x3c4b('0x18')][_0x3c4b('0x19')]?_0x543322[_0x3c4b('0x18')]['device']:_0x3c4b('0x1c'),_0x543322[_0x3c4b('0x18')]&&_0x543322[_0x3c4b('0x18')]['agent_id']?_0x543322['body'][_0x3c4b('0x1a')]:'',_0x543322['body']&&_0x543322[_0x3c4b('0x18')][_0x3c4b('0x1d')]?_0x543322[_0x3c4b('0x18')][_0x3c4b('0x1d')]:'');},'ignoreRoute':function(_0x19ab9a){var _0x137b32=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x137b32[_0x3c4b('0x1e')](_0x19ab9a[_0x3c4b('0x10')]);}}));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x1f'),require('./api/user'));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x20'),require(_0x3c4b('0x21')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x22'),require(_0x3c4b('0x23')));_0xd5c94c['use'](_0x3c4b('0x24'),require(_0x3c4b('0x25')));_0xd5c94c[_0x3c4b('0x8')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0xd5c94c['use']('/api/voice/queues',require(_0x3c4b('0x26')));_0xd5c94c['use'](_0x3c4b('0x27'),require(_0x3c4b('0x28')));_0xd5c94c['use'](_0x3c4b('0x29'),require(_0x3c4b('0x2a')));_0xd5c94c['use'](_0x3c4b('0x2b'),require(_0x3c4b('0x2c')));_0xd5c94c['use'](_0x3c4b('0x2d'),require(_0x3c4b('0x2e')));_0xd5c94c['use'](_0x3c4b('0x2f'),require(_0x3c4b('0x30')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x31'),require(_0x3c4b('0x32')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x33'),require(_0x3c4b('0x34')));_0xd5c94c[_0x3c4b('0x8')]('/api/voice/queues/reports',require(_0x3c4b('0x35')));_0xd5c94c['use'](_0x3c4b('0x36'),require('./api/memberReport'));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x37'),require(_0x3c4b('0x38')));_0xd5c94c['use']('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0xd5c94c[_0x3c4b('0x8')]('/api/mail/out_servers',require('./api/mailServerOut'));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x39'),require('./api/mailAccount'));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x3a'),require(_0x3c4b('0x3b')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x3c'),require('./api/mailSubstatus'));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x3d'),require(_0x3c4b('0x3e')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x3f'),require(_0x3c4b('0x40')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x41'),require(_0x3c4b('0x42')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x43'),require('./api/mailQueueReport'));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x44'),require(_0x3c4b('0x45')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x46'),require(_0x3c4b('0x47')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x48'),require(_0x3c4b('0x49')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x4a'),require(_0x3c4b('0x4b')));_0xd5c94c['use'](_0x3c4b('0x4c'),require(_0x3c4b('0x4d')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x4e'),require('./api/faxMessage'));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x4f'),require(_0x3c4b('0x50')));_0xd5c94c['use'](_0x3c4b('0x51'),require(_0x3c4b('0x52')));_0xd5c94c['use'](_0x3c4b('0x53'),require(_0x3c4b('0x54')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x55'),require(_0x3c4b('0x56')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x57'),require(_0x3c4b('0x58')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x59'),require(_0x3c4b('0x5a')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x5b'),require('./api/smsQueue'));_0xd5c94c['use'](_0x3c4b('0x5c'),require('./api/openchannelAccount'));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x5d'),require(_0x3c4b('0x5e')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x5f'),require(_0x3c4b('0x60')));_0xd5c94c['use'](_0x3c4b('0x61'),require('./api/openchannelMessage'));_0xd5c94c['use'](_0x3c4b('0x62'),require(_0x3c4b('0x63')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x64'),require(_0x3c4b('0x65')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x66'),require(_0x3c4b('0x67')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x68'),require(_0x3c4b('0x69')));_0xd5c94c['use'](_0x3c4b('0x6a'),require(_0x3c4b('0x6b')));_0xd5c94c['use'](_0x3c4b('0x6c'),require('./api/chatMessage'));_0xd5c94c[_0x3c4b('0x8')]('/api/chat/offline_messages',require(_0x3c4b('0x6d')));_0xd5c94c['use'](_0x3c4b('0x6e'),require(_0x3c4b('0x6f')));_0xd5c94c['use'](_0x3c4b('0x70'),require(_0x3c4b('0x71')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x72'),require(_0x3c4b('0x73')));_0xd5c94c['use']('/api/cm/companies',require(_0x3c4b('0x74')));_0xd5c94c['use'](_0x3c4b('0x75'),require(_0x3c4b('0x76')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x77'),require('./api/cmHopper'));_0xd5c94c[_0x3c4b('0x8')]('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0xd5c94c[_0x3c4b('0x8')]('/api/cm/hopper_final',require(_0x3c4b('0x78')));_0xd5c94c['use'](_0x3c4b('0x79'),require('./api/cmHopperHistory'));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x7a'),require(_0x3c4b('0x7b')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x7c'),require(_0x3c4b('0x7d')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x7e'),require(_0x3c4b('0x7f')));_0xd5c94c[_0x3c4b('0x8')]('/api/canned_answers',require(_0x3c4b('0x80')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x81'),require(_0x3c4b('0x82')));_0xd5c94c['use'](_0x3c4b('0x83'),require(_0x3c4b('0x84')));_0xd5c94c[_0x3c4b('0x8')]('/api/intervals',require(_0x3c4b('0x85')));_0xd5c94c[_0x3c4b('0x8')]('/api/pauses',require(_0x3c4b('0x86')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x87'),require('./api/cdr'));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x88'),require(_0x3c4b('0x89')));_0xd5c94c['use'](_0x3c4b('0x8a'),require(_0x3c4b('0x8b')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x8c'),require(_0x3c4b('0x8d')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x8e'),require(_0x3c4b('0x8f')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x90'),require(_0x3c4b('0x91')));_0xd5c94c['use'](_0x3c4b('0x92'),require(_0x3c4b('0x93')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x94'),require(_0x3c4b('0x95')));_0xd5c94c['use'](_0x3c4b('0x96'),require(_0x3c4b('0x97')));_0xd5c94c[_0x3c4b('0x8')]('/api/integrations/reports',require(_0x3c4b('0x98')));_0xd5c94c[_0x3c4b('0x8')]('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0xd5c94c[_0x3c4b('0x8')]('/api/analytics/default_reports',require(_0x3c4b('0x99')));_0xd5c94c[_0x3c4b('0x8')]('/api/analytics/extracted_reports',require(_0x3c4b('0x9a')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x9b'),require(_0x3c4b('0x9c')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x9d'),require(_0x3c4b('0x9e')));_0xd5c94c[_0x3c4b('0x8')]('/api/analytics/tree_reports',require(_0x3c4b('0x9f')));_0xd5c94c[_0x3c4b('0x8')]('/api/integrations/salesforce/accounts',require(_0x3c4b('0xa0')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xa1'),require(_0x3c4b('0xa2')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xa3'),require('./api/intSalesforceField'));_0xd5c94c['use'](_0x3c4b('0xa4'),require(_0x3c4b('0xa5')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xa6'),require(_0x3c4b('0xa7')));_0xd5c94c['use'](_0x3c4b('0xa8'),require(_0x3c4b('0xa9')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xaa'),require(_0x3c4b('0xab')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xac'),require(_0x3c4b('0xad')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xae'),require(_0x3c4b('0xaf')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xb0'),require(_0x3c4b('0xb1')));_0xd5c94c[_0x3c4b('0x8')]('/api/integrations/zoho/configurations',require(_0x3c4b('0xb2')));_0xd5c94c['use'](_0x3c4b('0xb3'),require(_0x3c4b('0xb4')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xb5'),require(_0x3c4b('0xb6')));_0xd5c94c['use'](_0x3c4b('0xb7'),require('./api/intZendeskConfiguration'));_0xd5c94c['use'](_0x3c4b('0xb8'),require(_0x3c4b('0xb9')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xba'),require('./api/intFreshdeskAccount'));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xbb'),require(_0x3c4b('0xbc')));_0xd5c94c['use'](_0x3c4b('0xbd'),require('./api/intFreshdeskField'));_0xd5c94c['use'](_0x3c4b('0xbe'),require(_0x3c4b('0xbf')));_0xd5c94c['use'](_0x3c4b('0xc0'),require('./api/intVtigerConfiguration'));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xc1'),require('./api/intVtigerField'));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xc2'),require(_0x3c4b('0xc3')));_0xd5c94c[_0x3c4b('0x8')]('/api/integrations/servicenow/configurations',require(_0x3c4b('0xc4')));_0xd5c94c['use'](_0x3c4b('0xc5'),require(_0x3c4b('0xc6')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xc7'),require(_0x3c4b('0xc8')));_0xd5c94c[_0x3c4b('0x8')]('/api/integrations/dynamics365/configurations',require(_0x3c4b('0xc9')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xca'),require('./api/intDynamics365Field'));_0xd5c94c['use']('/api/integrations/freshsales/accounts',require(_0x3c4b('0xcb')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xcc'),require(_0x3c4b('0xcd')));_0xd5c94c['use'](_0x3c4b('0xce'),require(_0x3c4b('0xcf')));_0xd5c94c['use'](_0x3c4b('0xd0'),require(_0x3c4b('0xd1')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xd2'),require(_0x3c4b('0xd3')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xd4'),require(_0x3c4b('0xd5')));_0xd5c94c['use'](_0x3c4b('0xd6'),require(_0x3c4b('0xd7')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xd8'),require(_0x3c4b('0xd9')));_0xd5c94c['use'](_0x3c4b('0xda'),require(_0x3c4b('0xdb')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xdc'),require(_0x3c4b('0xdd')));_0xd5c94c['use'](_0x3c4b('0xde'),require(_0x3c4b('0xdf')));_0xd5c94c['use'](_0x3c4b('0xe0'),require(_0x3c4b('0xe1')));_0xd5c94c['use']('/api/jscripty/projects',require(_0x3c4b('0xe2')));_0xd5c94c['use'](_0x3c4b('0xe3'),require('./api/setting'));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xe4'),require(_0x3c4b('0xe5')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xe6'),require(_0x3c4b('0xe7')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xe8'),require(_0x3c4b('0xe9')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xea'),require(_0x3c4b('0xeb')));_0xd5c94c['use'](_0x3c4b('0xec'),require(_0x3c4b('0xed')));_0xd5c94c[_0x3c4b('0x8')]('/api/license',require(_0x3c4b('0xee')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xef'),require(_0x3c4b('0xf0')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xf1'),require(_0x3c4b('0xf2')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xf3'),require('./api/attachment'));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xf4'),require(_0x3c4b('0xf5')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xf6'),require(_0x3c4b('0xf7')));_0xd5c94c['use']('/api/chat/reports/transfer',require(_0x3c4b('0xf8')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xf9'),require(_0x3c4b('0xfa')));_0xd5c94c[_0x3c4b('0x8')]('/api/openchannel/reports/transfer',require(_0x3c4b('0xfb')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xfc'),require(_0x3c4b('0xfd')));_0xd5c94c[_0x3c4b('0x8')]('/api/cm/lists',require(_0x3c4b('0xfe')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0xff'),require(_0x3c4b('0x100')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x101'),require(_0x3c4b('0x102')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x103'),require(_0x3c4b('0x104')));_0xd5c94c['use'](_0x3c4b('0x105'),require(_0x3c4b('0x106')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x107'),require(_0x3c4b('0x108')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x109'),require('./api/authGoogle'));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x10a'),require(_0x3c4b('0x10b')));_0xd5c94c[_0x3c4b('0x8')]('/api/rpc',require('./api/rpc'));_0xd5c94c['use'](_0x3c4b('0x10c'),require('./api/version'));_0xd5c94c['use'](_0x3c4b('0x10d'),require(_0x3c4b('0x10e')));_0xd5c94c['use'](_0x3c4b('0x10f'),require(_0x3c4b('0x110')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x111'),express['static'](path['join'](config['root'],_0x3c4b('0x111'))));_0xd5c94c['use'](_0x3c4b('0x112'),express[_0x3c4b('0x113')](path['join'](config[_0x3c4b('0x114')],_0x3c4b('0x112'))));_0xd5c94c['use'](_0x3c4b('0x115'),express[_0x3c4b('0x113')](path[_0x3c4b('0x116')](config[_0x3c4b('0x114')],'/demo')));_0xd5c94c[_0x3c4b('0x8')](_0x3c4b('0x117'),express[_0x3c4b('0x113')](path[_0x3c4b('0x116')](config['root'],_0x3c4b('0x118'),_0x3c4b('0x119'))));_0xd5c94c['use'](_0x3c4b('0x11a'),express[_0x3c4b('0x113')](path[_0x3c4b('0x116')](config[_0x3c4b('0x114')],_0x3c4b('0x11b'))));_0xd5c94c[_0x3c4b('0x11c')](_0x3c4b('0x11d'))[_0x3c4b('0x11e')](errors[0x194]);_0xd5c94c[_0x3c4b('0x11c')]('/*')[_0x3c4b('0x11e')](function(_0x18d041,_0x5eacdc){_0x5eacdc[_0x3c4b('0x11f')](path['resolve'](_0xd5c94c['get'](_0x3c4b('0x120'))+'/index.html'));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 7ef5ffd..7f588b9 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4346=['rpc','port','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','bluebird','lodash','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','server','http'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4346,0x139));var _0x6434=function(_0x403115,_0x2d6d03){_0x403115=_0x403115-0x0;var _0x596ef3=_0x4346[_0x403115];return _0x596ef3;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x6434('0x0'));var _=require(_0x6434('0x1'));var config=require('../config/environment');exports['listen']=function(){return new BPromise(function(_0x5aa449,_0x2a132e){var _0x58a9e1={};_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x3')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require('../api/voiceExtension/voiceExtension.rpc'));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x4')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require('../api/voiceRecording/voiceRecording.rpc'));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x5')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x6')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x7')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x8')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require('../api/trunk/trunk.rpc'));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x9')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0xa')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require('../api/mailServerIn/mailServerIn.rpc'));_0x58a9e1=_['merge'](_0x58a9e1,require('../api/mailAccount/mailAccount.rpc'));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0xb')));_0x58a9e1=_['merge'](_0x58a9e1,require(_0x6434('0xc')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0xd')));_0x58a9e1=_['merge'](_0x58a9e1,require(_0x6434('0xe')));_0x58a9e1=_['merge'](_0x58a9e1,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x58a9e1=_['merge'](_0x58a9e1,require(_0x6434('0xf')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x10')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x11')));_0x58a9e1=_['merge'](_0x58a9e1,require(_0x6434('0x12')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require('../api/faxQueue/faxQueue.rpc'));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x13')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x14')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require('../api/smsInteraction/smsInteraction.rpc'));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require('../api/smsMessage/smsMessage.rpc'));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x15')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x58a9e1=_['merge'](_0x58a9e1,require(_0x6434('0x16')));_0x58a9e1=_['merge'](_0x58a9e1,require(_0x6434('0x17')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x18')));_0x58a9e1=_['merge'](_0x58a9e1,require(_0x6434('0x19')));_0x58a9e1=_['merge'](_0x58a9e1,require(_0x6434('0x1a')));_0x58a9e1=_['merge'](_0x58a9e1,require(_0x6434('0x1b')));_0x58a9e1=_['merge'](_0x58a9e1,require(_0x6434('0x1c')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x1d')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x1e')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x1f')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x20')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x21')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x22')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require('../api/sound/sound.rpc'));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x23')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x24')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x25')));_0x58a9e1=_['merge'](_0x58a9e1,require(_0x6434('0x26')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x27')));_0x58a9e1=_['merge'](_0x58a9e1,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x58a9e1=_['merge'](_0x58a9e1,require(_0x6434('0x28')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x29')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x2a')));_0x58a9e1=_['merge'](_0x58a9e1,require(_0x6434('0x2b')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x2c')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require('../api/squareOdbc/squareOdbc.rpc'));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x2d')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x2e')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x2f')));_0x58a9e1=_[_0x6434('0x2')](_0x58a9e1,require(_0x6434('0x30')));_0x58a9e1=_['merge'](_0x58a9e1,require(_0x6434('0x31')));_0x58a9e1=_['merge'](_0x58a9e1,require(_0x6434('0x32')));var _0x24111b=jayson[_0x6434('0x33')](_0x58a9e1)[_0x6434('0x34')]();var _0x56e402=config[_0x6434('0x35')][_0x6434('0x36')]||config[_0x6434('0x36')]+0x1;var _0x4c1ab6=config[_0x6434('0x35')]['ip']||'localhost';_0x24111b['on']('error',function(_0x43a1e4){return _0x2a132e(_0x43a1e4);});_0x24111b[_0x6434('0x37')](_0x56e402,_0x4c1ab6,function(){console[_0x6434('0x38')](_0x6434('0x39'),_0x4c1ab6,_0x56e402);require(_0x6434('0x3a'))[_0x6434('0x3b')]();return _0x5aa449(_0x6434('0x3c')+_0x4c1ab6+':'+_0x56e402);});});}; \ No newline at end of file +var _0xefb6=['../config/triggers','jayson/promise','lodash','../config/environment','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','server','http','rpc','port','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!'];(function(_0x406bde,_0x8d38e7){var _0x84ab65=function(_0x46376f){while(--_0x46376f){_0x406bde['push'](_0x406bde['shift']());}};_0x84ab65(++_0x8d38e7);}(_0xefb6,0x1e1));var _0x6efb=function(_0x102b0c,_0x33dee4){_0x102b0c=_0x102b0c-0x0;var _0x9b15ca=_0xefb6[_0x102b0c];return _0x9b15ca;};'use strict';var jayson=require(_0x6efb('0x0'));var BPromise=require('bluebird');var _=require(_0x6efb('0x1'));var config=require(_0x6efb('0x2'));exports['listen']=function(){return new BPromise(function(_0x3f7856,_0x53b66e){var _0x3e872f={};_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require('../api/user/user.rpc'));_0x3e872f=_['merge'](_0x3e872f,require('../api/voiceExtension/voiceExtension.rpc'));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x4')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x5')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x6')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x7')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x8')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x9')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require('../api/memberReport/memberReport.rpc'));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require('../api/trunk/trunk.rpc'));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0xa')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0xb')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0xc')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0xd')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0xe')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0xf')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require('../api/mailMessage/mailMessage.rpc'));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require('../api/mailApplication/mailApplication.rpc'));_0x3e872f=_['merge'](_0x3e872f,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require('../api/faxAccount/faxAccount.rpc'));_0x3e872f=_['merge'](_0x3e872f,require(_0x6efb('0x10')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x11')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x12')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require('../api/faxQueue/faxQueue.rpc'));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x13')));_0x3e872f=_['merge'](_0x3e872f,require(_0x6efb('0x14')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require('../api/smsMessage/smsMessage.rpc'));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x15')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x16')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x17')));_0x3e872f=_['merge'](_0x3e872f,require(_0x6efb('0x18')));_0x3e872f=_['merge'](_0x3e872f,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x3e872f=_['merge'](_0x3e872f,require(_0x6efb('0x19')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x1a')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x1b')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x1c')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x1d')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x1e')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x1f')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x20')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x21')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x22')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require('../api/sound/sound.rpc'));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require('../api/template/template.rpc'));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require('../api/trigger/trigger.rpc'));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x23')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x24')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x25')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x26')));_0x3e872f=_['merge'](_0x3e872f,require(_0x6efb('0x27')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x28')));_0x3e872f=_['merge'](_0x3e872f,require(_0x6efb('0x29')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x2a')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x2b')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x2c')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x2d')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x2e')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x2f')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x30')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require('../api/squareProject/squareProject.rpc'));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require('../api/squareRecording/squareRecording.rpc'));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x31')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x32')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require(_0x6efb('0x33')));_0x3e872f=_[_0x6efb('0x3')](_0x3e872f,require('../api/plugin/plugin.rpc'));var _0x287e19=jayson[_0x6efb('0x34')](_0x3e872f)[_0x6efb('0x35')]();var _0x5685b6=config[_0x6efb('0x36')][_0x6efb('0x37')]||config[_0x6efb('0x37')]+0x1;var _0x570858=config[_0x6efb('0x36')]['ip']||'localhost';_0x287e19['on']('error',function(_0x56c0f7){return _0x53b66e(_0x56c0f7);});_0x287e19[_0x6efb('0x38')](_0x5685b6,_0x570858,function(){console[_0x6efb('0x39')](_0x6efb('0x3a'),_0x570858,_0x5685b6);require(_0x6efb('0x3b'))['default']();return _0x3f7856('RPC\x20listening\x20on\x20'+_0x570858+':'+_0x5685b6);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index e664d26..9631f06 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 _0x9c44=['no\x20code','replace','result=','indexOf','substr','startsWith','length','match','error','E_AGI_SOCKET_ERROR','code','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','inherits','prototype','sendRequest','sync','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setExtension','noop','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','events','EventEmitter','./reply','./error','setEncoding','utf8','setTimeout','emit','ready','toLowerCase','hangup','substring','520\x20End\x20of\x20proper','function'];(function(_0x5b5cde,_0x1f7c5f){var _0x364ad2=function(_0x4a1172){while(--_0x4a1172){_0x5b5cde['push'](_0x5b5cde['shift']());}};_0x364ad2(++_0x1f7c5f);}(_0x9c44,0x178));var _0x49c4=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9c44[_0x18ab2a];return _0x16dcee;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIReply=require(_0x49c4('0x2'));var AGIError=require(_0x49c4('0x3'));function AGIChannel(_0x455700){var _0x2ad237=this,_0x4e0313=new AGIReply(),_0x4941f1=![],_0x41a183={};EventEmitter['call'](_0x2ad237);_0x455700[_0x49c4('0x4')](_0x49c4('0x5'));_0x455700[_0x49c4('0x6')](0x8*0x3c*0x3c*0x3e8);_0x4e0313[_0x49c4('0x4')](_0x49c4('0x5'));_0x4e0313['on']('headers',function(_0x11c586){for(var _0x42e4f8 in _0x11c586){_0x2ad237[_0x42e4f8]=_0x11c586[_0x42e4f8];}_0x2ad237[_0x49c4('0x7')](_0x49c4('0x8'));});_0x4e0313['on']('line',function(_0x5ab4a3){if(_0x5ab4a3[_0x49c4('0x9')]()==_0x49c4('0xa')){_0x2ad237['emit'](_0x49c4('0xa'));return;}if(_0x5ab4a3[_0x49c4('0xb')](0x0,0xb)=='520-Invalid'){_0x4941f1=!![];}if(_0x4941f1){_0x41a183['rx']+=_0x5ab4a3+'\x0a';if(_0x5ab4a3['search'](_0x49c4('0xc'))!=-0x1){_0x4941f1=![];}}else{_0x41a183['rx']=_0x5ab4a3;}if(_0x4941f1){return;}if(typeof _0x41a183['cb']==_0x49c4('0xd')){var _0x5487cd=_0x41a183['rx']['substring'](0x0,0x3),_0x7df3a9=null,_0x403bfb=null;_0x5487cd=parseInt(_0x5487cd);if(isNaN(_0x5487cd)){_0x41a183['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x49c4('0xe')});return;}if(_0x5487cd!=0xc8){_0x41a183['cb'](null,{'code':_0x5487cd,'result':-0x1,'extra':'KO'});return;}_0x7df3a9=_0x41a183['rx'][_0x49c4('0xb')](0x4)[_0x49c4('0xf')](_0x49c4('0x10'),'');if(_0x7df3a9[_0x49c4('0x11')]('\x20')!=-0x1){_0x7df3a9=_0x7df3a9[_0x49c4('0x12')](0x0,_0x7df3a9[_0x49c4('0x11')]('\x20'));}if(_[_0x49c4('0x13')](_0x7df3a9,'-1')){_0x7df3a9=parseInt(_0x7df3a9);}_0x403bfb=_0x41a183['rx']['split']('\x20');if(_0x403bfb[_0x49c4('0x14')]==0x3){_0x403bfb=_0x403bfb[0x2][_0x49c4('0xb')](0x1,_0x403bfb[0x2][_0x49c4('0x14')]-0x1);}else if(_0x403bfb[_0x49c4('0x14')]>0x3){var _0x2abc78=/\((.+)\)/;var _0x53e3a2=_0x41a183['rx'][_0x49c4('0x15')](_0x2abc78);if(_0x53e3a2){_0x403bfb=_0x53e3a2[0x1];}else{_0x403bfb=null;}}else{_0x403bfb=null;}_0x41a183['cb'](null,{'code':_0x5487cd,'result':_0x7df3a9,'extra':_0x403bfb});}});_0x455700['on'](_0x49c4('0x16'),function(_0x4c3253){_0x2ad237['emit'](_0x49c4('0x16'),new AGIError(_0x49c4('0x17'),_0x4c3253[_0x49c4('0x18')]));});_0x455700['on']('close',function(){_0x2ad237[_0x49c4('0x7')]('close',new AGIError(_0x49c4('0x19')));});_0x455700['on'](_0x49c4('0x1a'),function(){_0x2ad237[_0x49c4('0x7')](_0x49c4('0x1a'),new AGIError(_0x49c4('0x1b')));_0x455700[_0x49c4('0x1c')]();});_0x455700[_0x49c4('0x1d')](_0x4e0313);this[_0x49c4('0x1e')]=function(_0x2197d2,_0x578447){var _0x2197d2=_0x2197d2||'',_0x578447=typeof _0x578447==_0x49c4('0xd')?_0x578447:new Function();_0x41a183={'tx':_0x2197d2,'rx':'','cb':_0x578447};_0x455700['write'](_0x2197d2+'\x0a');},this['close']=function(){_0x455700[_0x49c4('0x1c')]();};}util[_0x49c4('0x1f')](AGIChannel,EventEmitter);AGIChannel[_0x49c4('0x20')][_0x49c4('0x21')]=function(_0x4811c4){return this['command'][_0x49c4('0x22')](this,_0x4811c4);};AGIChannel[_0x49c4('0x20')]['answer']=function(){return this[_0x49c4('0x21')](_0x49c4('0x23'));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x24')]=function(_0x531d92,_0x543ea2,_0x449960){_0x531d92=_0x531d92===undefined?'beep':_0x531d92;_0x543ea2=_0x543ea2===undefined?'5':_0x543ea2;_0x449960=_0x449960===undefined?'1':_0x449960;return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x26'),_0x531d92,_0x543ea2*0x3e8,_0x449960));};AGIChannel[_0x49c4('0x20')]['noop']=function(_0x889909){_0x889909=_0x889909||_0x49c4('0x27');return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x28'),_0x889909));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x29')]=function(_0x427b26,_0x17b50f){if(_[_0x49c4('0x2a')](_0x17b50f)){return this[_0x49c4('0x21')](util['format']('EXEC\x20%s\x20%s',_0x427b26,_0x17b50f['join'](',')));}return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x2b'),_0x427b26,_0x17b50f));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x2c')]=function(_0x574fd3){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x2d'),_0x574fd3));};AGIChannel[_0x49c4('0x20')]['setExtension']=function(_0x57a29c){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x2e'),_0x57a29c));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x2f')]=function(_0x4a0c7a){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x30'),_0x4a0c7a));};AGIChannel['prototype']['hangup']=function(){return this[_0x49c4('0x21')](_0x49c4('0x31'));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x32')]=function(_0x2b45a1,_0x2cf897){var _0x1d1557=_[_0x49c4('0x33')](_0x2cf897)||_[_0x49c4('0x34')](_0x2cf897)?_0x2cf897['toString']():_0x2cf897;return this[_0x49c4('0x21')](util['format'](_0x49c4('0x35'),_0x2b45a1,_0x1d1557?_0x1d1557[_0x49c4('0x36')]()[_0x49c4('0xf')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x49c4('0x20')]['sayNumber']=function(_0x335f0c,_0x31f3ff){return this[_0x49c4('0x21')](util['format'](_0x49c4('0x37'),_0x335f0c,_0x31f3ff));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x38')]=function(_0x5e5366,_0x1ba7a0){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x39'),_0x5e5366,_0x1ba7a0));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x3a')]=function(_0x1e506a,_0x4e0663){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x3b'),_0x1e506a,_0x4e0663));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x3c')]=function(_0x29dd5d,_0x1be62d,_0xc9722b){_0x1be62d=_0x1be62d||this[_0x49c4('0x3d')];_0xc9722b=_0xc9722b||0x1;this[_0x49c4('0x2c')](_0x29dd5d);this[_0x49c4('0x3e')](_0x1be62d);this[_0x49c4('0x2f')](_0xc9722b);return this[_0x49c4('0x3f')](util['format'](_0x49c4('0x40'),_0x29dd5d,_0x1be62d,_0xc9722b));};AGIChannel['prototype'][_0x49c4('0x41')]=function(_0x4915bc){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x42'),_0x4915bc));};AGIChannel[_0x49c4('0x20')]['recordFile']=function(_0x4d628a,_0x20490b,_0x1e7bdc,_0x38349b,_0x117151,_0x490823){_0x20490b=_0x20490b||_0x49c4('0x43');_0x1e7bdc=_0x1e7bdc||'';_0x38349b=_0x38349b===undefined?-0x1:_0x38349b==='-1'?-0x1:_0x38349b*0x3e8;_0x117151=_0x117151===undefined?'':'s='+_0x117151;_0x490823=_0x490823?_0x49c4('0x44'):'';return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x45'),_0x4d628a,_0x20490b,_0x1e7bdc,_0x38349b,_0x490823,_0x117151));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x46')]=function(_0x3351c1,_0x3c4a1d){_0x3c4a1d=_0x3c4a1d||'';return this['sendRequest'](util[_0x49c4('0x25')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x3351c1,_0x3c4a1d));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x47')]=function(_0x301def){return this[_0x49c4('0x29')](_0x49c4('0x48'),_0x301def);};AGIChannel['prototype'][_0x49c4('0x49')]=function(_0x15b674){return this[_0x49c4('0x29')](_0x49c4('0x4a'),_0x15b674);};AGIChannel[_0x49c4('0x20')][_0x49c4('0x16')]=function(_0x9779ef,_0x4d89e0){this[_0x49c4('0x3f')](util['format'](_0x49c4('0x4b'),_0x9779ef['id'],_0x9779ef[_0x49c4('0x4c')],_0x4d89e0));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x49c4('0x4d')]=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(_0x2f1cf5,_0x51182a){var _0x15efda=function(_0x58018a){while(--_0x58018a){_0x2f1cf5['push'](_0x2f1cf5['shift']());}};_0x15efda(++_0x51182a);}(_0x70e0,0x17b));var _0x070e=function(_0x14f23e,_0x17379d){_0x14f23e=_0x14f23e-0x0;var _0x5d5312=_0x70e0[_0x14f23e];return _0x5d5312;};'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 b78fd03..5ed3be9 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 _0x64b3=['name','exports','util','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message'];(function(_0x117821,_0xaa1933){var _0x4ae9ff=function(_0x253662){while(--_0x253662){_0x117821['push'](_0x117821['shift']());}};_0x4ae9ff(++_0xaa1933);}(_0x64b3,0x1de));var _0x364b=function(_0x4d66e0,_0x30e464){_0x4d66e0=_0x4d66e0-0x0;var _0x3924ac=_0x64b3[_0x4d66e0];return _0x3924ac;};'use strict';var util=require(_0x364b('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x364b('0x1'),'E_AGI_SERVER_CLOSE':_0x364b('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x364b('0x3'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x364b('0x4'),'E_AGI_SOCKET_CLOSE':_0x364b('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x364b('0x6'),'E_AGI_COMMAND_EMPTY':_0x364b('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x364b('0x8'),'E_AGI_IVR_ENTRY':_0x364b('0x9')};function AGIError(_0x53ae27){var _0x53ae27=_0x53ae27||null,_0x38efef=_0x38efef||[],_0x325e14=0x1,_0x3f6653='';if(!error[_0x53ae27]){_0x53ae27=_0x364b('0xa');}_0x38efef[_0x364b('0xb')](error[_0x53ae27]);while(arguments[_0x325e14]){_0x38efef[_0x364b('0xb')](arguments[_0x325e14]);_0x325e14++;}_0x3f6653=util[_0x364b('0xc')][_0x364b('0xd')](util,_0x38efef);this[_0x364b('0xe')]=_0x3f6653;this[_0x364b('0xf')]=_0x53ae27;}module[_0x364b('0x10')]=AGIError; \ No newline at end of file +var _0xb90d=['message','name','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','E_AGI_UNDEFINED','push','apply'];(function(_0x2b5e9e,_0x2d4d6d){var _0x3a98e2=function(_0xdd5d20){while(--_0xdd5d20){_0x2b5e9e['push'](_0x2b5e9e['shift']());}};_0x3a98e2(++_0x2d4d6d);}(_0xb90d,0x17a));var _0xdb90=function(_0x32ab87,_0x5803d0){_0x32ab87=_0x32ab87-0x0;var _0x5ae2b0=_0xb90d[_0x32ab87];return _0x5ae2b0;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xdb90('0x0'),'E_AGI_ARGUMENT_PORT':_0xdb90('0x1'),'E_AGI_SERVER_ERROR':_0xdb90('0x2'),'E_AGI_SERVER_CLOSE':_0xdb90('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xdb90('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xdb90('0x5'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xdb90('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xdb90('0x7'),'E_AGI_COMMAND_EMPTY':_0xdb90('0x8'),'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(_0x2cc7cd){var _0x2cc7cd=_0x2cc7cd||null,_0x6d8ec5=_0x6d8ec5||[],_0xbb1e2=0x1,_0x57862b='';if(!error[_0x2cc7cd]){_0x2cc7cd=_0xdb90('0x9');}_0x6d8ec5[_0xdb90('0xa')](error[_0x2cc7cd]);while(arguments[_0xbb1e2]){_0x6d8ec5[_0xdb90('0xa')](arguments[_0xbb1e2]);_0xbb1e2++;}_0x57862b=util['format'][_0xdb90('0xb')](util,_0x6d8ec5);this[_0xdb90('0xc')]=_0x57862b;this[_0xdb90('0xd')]=_0x2cc7cd;}module[_0xdb90('0xe')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 9b693a9..5d3b1b5 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 _0x065e=['default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','lodash','getdigits','getsecretdigits','vertices','prototype','addVertex','edges','push','numberOfEdges','size','relations','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','target','default','menu','invalid','vswitch'];(function(_0x5ab2a2,_0x558e5f){var _0x5b5569=function(_0x4cc340){while(--_0x4cc340){_0x5ab2a2['push'](_0x5ab2a2['shift']());}};_0x5b5569(++_0x558e5f);}(_0x065e,0x1a7));var _0xe065=function(_0x6fe021,_0x5ac4fb){_0x6fe021=_0x6fe021-0x0;var _0x21f09f=_0x065e[_0x6fe021];return _0x21f09f;};'use strict';var _=require(_0xe065('0x0'));var logger=require('../../../config/logger')('agi');var verticesWithRetry=['menu',_0xe065('0x1'),_0xe065('0x2')];var Graph=function(){this[_0xe065('0x3')]={};this['edges']={};this['numberOfEdges']=0x0;};Graph[_0xe065('0x4')][_0xe065('0x5')]=function(_0x5b099e){this[_0xe065('0x3')][_0x5b099e['id']]=_0x5b099e;this[_0xe065('0x6')][_0x5b099e['id']]=[];};Graph[_0xe065('0x4')]['addEdge']=function(_0x267122,_0x5afbd4,_0x273e22){this[_0xe065('0x6')][_0x267122][_0xe065('0x7')]({'target':_0x5afbd4,'condition':_0x273e22});this[_0xe065('0x8')]+=0x1;};Graph[_0xe065('0x4')]['size']=function(){return _[_0xe065('0x9')](this[_0xe065('0x3')]);};Graph[_0xe065('0x4')][_0xe065('0xa')]=function(){return this[_0xe065('0x8')];};Graph[_0xe065('0x4')]['getVertex']=function(_0x595907){return this[_0xe065('0x3')][_0x595907];};Graph[_0xe065('0x4')][_0xe065('0xb')]=function(_0x5bd30f,_0x3aa3be){if(!this[_0xe065('0x3')][_0x5bd30f]){return logger[_0xe065('0xc')](_0xe065('0xd'));}var _0x29297b=_0x3aa3be(this['vertices'][_0x5bd30f]);if(!_0x29297b){return logger[_0xe065('0xc')](_0xe065('0xe'));}if(this[_0xe065('0x6')][_0x5bd30f][_0xe065('0xf')]===0x0){return logger[_0xe065('0xc')](_0xe065('0x10'));}for(var _0x2e5feb=0x0,_0x545100=[],_0x1ba88d=![];_0x2e5feb\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','agicommand','maxRetry','omit','hasOwnProperty','isArray','length','source','target','addEdge','getSquareProject','then','catch','agi_','inspect','debug','variables','close','hangup','sync','production','start','root','stringify','joinAt','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','traverseBFS','vertex','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','getLicense','voice'];(function(_0x3f581f,_0x4ea03c){var _0x1e0d19=function(_0x2b9d8a){while(--_0x2b9d8a){_0x3f581f['push'](_0x3f581f['shift']());}};_0x1e0d19(++_0x4ea03c);}(_0xac95,0xa8));var _0x5ac9=function(_0x3c0fad,_0x2aad16){_0x3c0fad=_0x3c0fad-0x0;var _0x5c43f2=_0xac95[_0x3c0fad];return _0x5c43f2;};'use strict';var parser=require(_0x5ac9('0x0'));var _=require(_0x5ac9('0x1'));var syncho=require(_0x5ac9('0x2'));var util=require(_0x5ac9('0x3'));var moment=require('moment');var config=require('../../config/environment');var logger=require(_0x5ac9('0x4'))(_0x5ac9('0x5'));var utilLicense=require('../../config/license/util');var rpc=require(_0x5ac9('0x6'));var mailRpc=require(_0x5ac9('0x7'));var Graph=require('./graph');var Vertices=require(_0x5ac9('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x5ac9('0x5')]=_[_0x5ac9('0x9')](config['agi'],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x32afbc){process[_0x5ac9('0xa')](function(){syncho(function(){try{setChannelVariables(_0x32afbc);agiHandler(_0x32afbc);}catch(_0x28bc1f){logger[_0x5ac9('0xb')](_0x28bc1f[_0x5ac9('0xc')]);}});});}function listeningHandler(){console[_0x5ac9('0xd')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x5ac9('0x5')][_0x5ac9('0xe')]);logger['info'](util[_0x5ac9('0xf')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x5ac9('0x5')]['ip'],config['agi'][_0x5ac9('0xe')]));}function errorHandler(_0x296b34){if(_0x296b34&&_0x296b34[_0x5ac9('0x10')]&&_0x296b34[_0x5ac9('0x11')]){logger['error'](util['format'](_0x5ac9('0x12'),_0x296b34['name'],_0x296b34[_0x5ac9('0x11')]));}else{logger[_0x5ac9('0xb')](util['format'](_0x5ac9('0x13'),_0x296b34[_0x5ac9('0xc')]));}}function closeHandler(){logger[_0x5ac9('0x14')](util[_0x5ac9('0xf')](_0x5ac9('0x15'),this[_0x5ac9('0x16')],this[_0x5ac9('0x17')],this[_0x5ac9('0x18')],this[_0x5ac9('0x19')],this['uniqueid']));try{createSquareReport(this);}catch(_0x53a8db){logger[_0x5ac9('0xb')](_0x53a8db[_0x5ac9('0xc')]);}}function timeoutHandler(){logger[_0x5ac9('0x14')](util[_0x5ac9('0xf')](_0x5ac9('0x1a'),this[_0x5ac9('0x16')],this[_0x5ac9('0x17')],this[_0x5ac9('0x18')],this[_0x5ac9('0x19')],this[_0x5ac9('0x1b')]));}function hangupHandler(){logger[_0x5ac9('0x14')](util[_0x5ac9('0xf')](_0x5ac9('0x1c'),this['arg_1'],this[_0x5ac9('0x17')],this[_0x5ac9('0x18')],this[_0x5ac9('0x19')],this[_0x5ac9('0x1b')]));this[_0x5ac9('0x1d')]=!![];}function getRoot(_0x492679){return parser[_0x5ac9('0x1e')](_0x492679,{'object':!![]})[_0x5ac9('0x1f')]['root'];}function addVertex(_0x5e42a1,_0x5a4664,_0xc36d2){_0x5a4664[_0x5ac9('0x20')]=_0xc36d2;if(_0x5a4664['hasOwnProperty']('retry')){_0x5a4664[_0x5ac9('0x21')]=parseInt(_0x5a4664['retry'],0xa);}_0x5e42a1['addVertex'](_[_0x5ac9('0x22')](_0x5a4664,'mxCell'));}function initGraph(_0x12f725,_0x3b77be){var _0x770c48=new Graph();for(var _0x3a7f68 in _0x12f725){if(_0x12f725[_0x5ac9('0x23')](_0x3a7f68)){if(_[_0x5ac9('0x24')](_0x12f725[_0x3a7f68])){for(var _0x13aaa7=0x0;_0x13aaa7<_0x12f725[_0x3a7f68][_0x5ac9('0x25')];_0x13aaa7+=0x1){addVertex(_0x770c48,_0x12f725[_0x3a7f68][_0x13aaa7],_0x3a7f68);}}else{addVertex(_0x770c48,_0x12f725[_0x3a7f68],_0x3a7f68);}}}for(var _0x203d19=0x0;_0x203d19<_0x3b77be['length'];_0x203d19+=0x1){if(_0x3b77be[_0x203d19][_0x5ac9('0x26')]&&_0x3b77be[_0x203d19][_0x5ac9('0x27')]){_0x770c48[_0x5ac9('0x28')](_0x3b77be[_0x203d19][_0x5ac9('0x26')],_0x3b77be[_0x203d19][_0x5ac9('0x27')],_0x3b77be[_0x203d19]['value']);}}return _0x770c48;}function getSquareProject(_0x47f6ad,_0x2e5b69){rpc[_0x5ac9('0x29')](_0x47f6ad)['then'](function(_0x3a15cf){_0x2e5b69(null,_0x3a15cf);})['catch'](function(_0x16b970){_0x2e5b69(null,_0x16b970);});}function createSquareReport(_0x2c85dc,_0x1d0d5a){rpc['createSquareReport'](_0x2c85dc)[_0x5ac9('0x2a')](function(_0x128866){if(_0x1d0d5a){_0x1d0d5a(null,_0x128866);}})[_0x5ac9('0x2b')](function(_0x30fb2b){if(_0x1d0d5a){_0x1d0d5a(null,_0x30fb2b);}});}function setChannelVariables(_0x5ce12f){for(var _0x35d73d in _0x5ce12f){if(_0x5ce12f['hasOwnProperty'](_0x35d73d)){if(_0x35d73d['indexOf'](_0x5ac9('0x2c'))===0x0){_0x5ce12f[_0x35d73d['substring'](0x4)]=_0x5ce12f[_0x35d73d];delete _0x5ce12f[_0x35d73d];}}}}function getLogFromObject(_0x5696c8){return util[_0x5ac9('0x2d')](_0x5696c8,{'showHidden':![],'depth':null});}function agiHandler(_0x148d0b){var _0x3e12be,_0x2f2fb4,_0x2f7f2f,_0x28754f,_0x6225c5;logger[_0x5ac9('0x2e')](_0x5ac9('0x2f'),JSON['stringify'](_0x148d0b,null,0x2));logger[_0x5ac9('0x14')](util[_0x5ac9('0xf')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x148d0b['arg_1'],_0x148d0b[_0x5ac9('0x17')],_0x148d0b[_0x5ac9('0x18')],_0x148d0b[_0x5ac9('0x19')],_0x148d0b[_0x5ac9('0x1b')]));_0x148d0b['on']('error',errorHandler);_0x148d0b['on'](_0x5ac9('0x30'),closeHandler);_0x148d0b['on']('timeout',timeoutHandler);_0x148d0b[_0x5ac9('0x1d')]=![];_0x148d0b['on'](_0x5ac9('0x31'),hangupHandler);var _0x2cb1d5=getSquareProject[_0x5ac9('0x32')](null,_0x148d0b[_0x5ac9('0x16')]);if(_0x2cb1d5){if(_0x2cb1d5[_0x5ac9('0x33')]){_0x3e12be=getRoot(_0x2cb1d5[_0x5ac9('0x33')]);if(_0x3e12be&&_0x3e12be[_0x5ac9('0x34')]){logger[_0x5ac9('0x2e')](_0x5ac9('0x35'),JSON[_0x5ac9('0x36')](_0x3e12be,null,0x2));_0x148d0b[_0x5ac9('0x37')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2f2fb4=initGraph(_[_0x5ac9('0x22')](_0x3e12be,_0x5ac9('0x38')),_0x3e12be[_0x5ac9('0x38')]);_0x2f7f2f=new Vertices(_0x148d0b,rpc,mailRpc);logger[_0x5ac9('0x14')](util[_0x5ac9('0xf')](_0x5ac9('0x39'),_0x148d0b['arg_1'],_0x148d0b[_0x5ac9('0x17')],_0x148d0b[_0x5ac9('0x18')],_0x148d0b['dnid'],_0x148d0b['uniqueid']));_0x2f2fb4['traverseBFS'](_0x3e12be[_0x5ac9('0x34')]['id'],function(_0xc6be86){try{_0xc6be86=_0x2f7f2f[_0x5ac9('0x3a')](_0xc6be86);logger[_0x5ac9('0x2e')]('vertex',JSON[_0x5ac9('0x36')](_0xc6be86,null,0x2));if(_0xc6be86['agicommand']==='gotoc'){logger[_0x5ac9('0x14')](_0x5ac9('0x3b'));_0x148d0b['context']=_0xc6be86[_0x5ac9('0x3c')]||_0x148d0b[_0x5ac9('0x3c')];_0x148d0b['extension']=_0xc6be86[_0x5ac9('0x3d')];_0x148d0b[_0x5ac9('0x3e')]=_0xc6be86[_0x5ac9('0x3e')]?_0xc6be86[_0x5ac9('0x3e')]-0x1:0x1;return null;}else if(_0xc6be86&&_0x2f7f2f[_0xc6be86[_0x5ac9('0x20')]]){_0x6225c5=_0x2f7f2f[_0xc6be86[_0x5ac9('0x20')]](_0xc6be86);logger[_0x5ac9('0x14')](_0x5ac9('0x3f'),JSON[_0x5ac9('0x36')](_0x6225c5,null,0x2));if(_0x6225c5&&_0x6225c5[_0x5ac9('0x40')]===AGI_CODE_SUCCESS&&_0x6225c5[_0x5ac9('0x41')]!==AGI_RESULT_ERROR&&!_0x148d0b[_0x5ac9('0x1d')]){logger['debug'](_0x5ac9('0x3f'),getLogFromObject(_0x6225c5));return _[_0x5ac9('0x42')](_0x6225c5[_0x5ac9('0x41')])?null:_0x6225c5['result'][_0x5ac9('0x43')]();}else{logger[_0x5ac9('0xb')](_0x5ac9('0x3f'),getLogFromObject(_0x6225c5));return null;}}else{logger['error'](_0x5ac9('0x44'));return null;}}catch(_0x3044a9){logger[_0x5ac9('0xb')](_0x3044a9[_0x5ac9('0xc')]);return null;}});if(_0x3e12be[_0x5ac9('0x45')]){logger[_0x5ac9('0x14')](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x148d0b[_0x5ac9('0x16')],_0x148d0b['calleridname'],_0x148d0b[_0x5ac9('0x18')],_0x148d0b['dnid'],_0x148d0b[_0x5ac9('0x1b')]));_0x2f2fb4[_0x5ac9('0x46')](_0x3e12be[_0x5ac9('0x45')]['id'],function(_0x398906){try{_0x398906=_0x2f7f2f[_0x5ac9('0x3a')](_0x398906);logger[_0x5ac9('0x2e')](_0x5ac9('0x47'),JSON[_0x5ac9('0x36')](_0x398906,null,0x2));if(_0x398906&&_0x2f7f2f[_0x398906[_0x5ac9('0x20')]]){_0x6225c5=_0x2f7f2f[_0x398906[_0x5ac9('0x20')]](_0x398906);if(_0x6225c5){logger[_0x5ac9('0x2e')]('response',getLogFromObject(_0x6225c5));return _[_0x5ac9('0x42')](_0x6225c5[_0x5ac9('0x41')])?null:_0x6225c5['result']['toString']();}else{logger[_0x5ac9('0xb')](_0x5ac9('0x3f'),getLogFromObject(_0x6225c5));return null;}}else{logger[_0x5ac9('0xb')]('agicommand\x20not\x20found');return null;}}catch(_0x33446e){logger[_0x5ac9('0xb')](_0x33446e[_0x5ac9('0xc')]);return null;}});}logger[_0x5ac9('0x14')](util[_0x5ac9('0xf')](_0x5ac9('0x48'),_0x148d0b['arg_1'],_0x148d0b['calleridname'],_0x148d0b[_0x5ac9('0x18')],_0x148d0b[_0x5ac9('0x19')],_0x148d0b['uniqueid']));logger[_0x5ac9('0x14')](util[_0x5ac9('0xf')](_0x5ac9('0x49'),_0x148d0b[_0x5ac9('0x3c')],_0x148d0b[_0x5ac9('0x3d')],parseInt(_0x148d0b['priority'],0xa)+0x1));_0x148d0b[_0x5ac9('0x4a')](_0x148d0b[_0x5ac9('0x3c')],_0x148d0b[_0x5ac9('0x3d')],parseInt(_0x148d0b['priority'],0xa)+0x1);_0x148d0b[_0x5ac9('0x30')]();}}else{logger[_0x5ac9('0xb')](util[_0x5ac9('0xf')](_0x5ac9('0x4b'),_0x148d0b[_0x5ac9('0x16')]));_0x148d0b['continueAt'](_0x148d0b['context'],_0x148d0b[_0x5ac9('0x3d')],parseInt(_0x148d0b['priority'],0xa)+0x1);_0x148d0b[_0x5ac9('0x30')]();}}else{logger['error'](util[_0x5ac9('0xf')]('Project\x20%s\x20not\x20found',_0x148d0b[_0x5ac9('0x16')]));_0x148d0b[_0x5ac9('0x4a')](_0x148d0b['context'],_0x148d0b['extension'],parseInt(_0x148d0b[_0x5ac9('0x3e')],0xa)+0x1);_0x148d0b[_0x5ac9('0x30')]();}}function main(){var _0x43db69;return utilLicense[_0x5ac9('0x4c')]()[_0x5ac9('0x2a')](function(_0x3b90d9){if(_0x3b90d9){if(_0x3b90d9[_0x5ac9('0x4d')]){if(_0x3b90d9[_0x5ac9('0x4e')]&&_0x3b90d9['callysquare']>0x0){logger[_0x5ac9('0x14')](util['format'](_0x5ac9('0x4f'),_0x3b90d9[_0x5ac9('0x4e')]));_0x43db69=_0x3b90d9['callysquare'];}else{logger[_0x5ac9('0x14')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x5ac9('0x14')](_0x5ac9('0x50'));_0x43db69=-0x1;}}})[_0x5ac9('0x2b')](function(_0x388011){logger[_0x5ac9('0xb')]('[LICENSE]',_0x388011[_0x5ac9('0xc')]);})[_0x5ac9('0x45')](function(){var _0x24b61f=require('./server')(config[_0x5ac9('0x5')][_0x5ac9('0xe')],config[_0x5ac9('0x5')]['ip'],_0x43db69);_0x24b61f['on']('error',errorHandler);_0x24b61f['on'](_0x5ac9('0x51'),listeningHandler);_0x24b61f['on']('connection',connectionHandler);_0x24b61f['on'](_0x5ac9('0x30'),closeHandler);});}main(); \ No newline at end of file +var _0xe198=['finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','./server','listening','connection','xml2json','lodash','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./mailRpc','./graph','./vertices','defaults','127.0.0.1','nextTick','error','stack','log','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[%s]\x20%s','name','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','value','getSquareProject','catch','createSquareReport','then','indexOf','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','agicommand','response','code','result','isUndefined','toString'];(function(_0x411dab,_0x50aa6b){var _0x363ab8=function(_0x23db48){while(--_0x23db48){_0x411dab['push'](_0x411dab['shift']());}};_0x363ab8(++_0x50aa6b);}(_0xe198,0x6f));var _0x8e19=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xe198[_0x2dea24];return _0x309d58;};'use strict';var parser=require(_0x8e19('0x0'));var _=require(_0x8e19('0x1'));var syncho=require('syncho');var util=require('util');var moment=require(_0x8e19('0x2'));var config=require(_0x8e19('0x3'));var logger=require(_0x8e19('0x4'))(_0x8e19('0x5'));var utilLicense=require(_0x8e19('0x6'));var rpc=require('./rpc');var mailRpc=require(_0x8e19('0x7'));var Graph=require(_0x8e19('0x8'));var Vertices=require(_0x8e19('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x8e19('0x5')]=_[_0x8e19('0xa')](config[_0x8e19('0x5')],{'ip':_0x8e19('0xb'),'port':0x11dd});function connectionHandler(_0xfc45e){process[_0x8e19('0xc')](function(){syncho(function(){try{setChannelVariables(_0xfc45e);agiHandler(_0xfc45e);}catch(_0x1646d4){logger[_0x8e19('0xd')](_0x1646d4[_0x8e19('0xe')]);}});});}function listeningHandler(){console[_0x8e19('0xf')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x8e19('0x5')][_0x8e19('0x10')]);logger[_0x8e19('0x11')](util[_0x8e19('0x12')](_0x8e19('0x13'),config[_0x8e19('0x5')]['ip'],config[_0x8e19('0x5')][_0x8e19('0x10')]));}function errorHandler(_0x48433d){if(_0x48433d&&_0x48433d['name']&&_0x48433d[_0x8e19('0x14')]){logger['error'](util['format'](_0x8e19('0x15'),_0x48433d[_0x8e19('0x16')],_0x48433d[_0x8e19('0x14')]));}else{logger[_0x8e19('0xd')](util['format'](_0x8e19('0x17'),_0x48433d[_0x8e19('0xe')]));}}function closeHandler(){logger['info'](util[_0x8e19('0x12')](_0x8e19('0x18'),this['arg_1'],this[_0x8e19('0x19')],this[_0x8e19('0x1a')],this[_0x8e19('0x1b')],this[_0x8e19('0x1c')]));try{createSquareReport(this);}catch(_0x368896){logger[_0x8e19('0xd')](_0x368896[_0x8e19('0xe')]);}}function timeoutHandler(){logger[_0x8e19('0x11')](util[_0x8e19('0x12')](_0x8e19('0x1d'),this[_0x8e19('0x1e')],this[_0x8e19('0x19')],this[_0x8e19('0x1a')],this[_0x8e19('0x1b')],this['uniqueid']));}function hangupHandler(){logger[_0x8e19('0x11')](util[_0x8e19('0x12')](_0x8e19('0x1f'),this[_0x8e19('0x1e')],this[_0x8e19('0x19')],this[_0x8e19('0x1a')],this[_0x8e19('0x1b')],this[_0x8e19('0x1c')]));this[_0x8e19('0x20')]=!![];}function getRoot(_0x1223c9){return parser[_0x8e19('0x21')](_0x1223c9,{'object':!![]})[_0x8e19('0x22')][_0x8e19('0x23')];}function addVertex(_0x56b5bf,_0x33d921,_0x556f61){_0x33d921['agicommand']=_0x556f61;if(_0x33d921[_0x8e19('0x24')](_0x8e19('0x25'))){_0x33d921[_0x8e19('0x26')]=parseInt(_0x33d921['retry'],0xa);}_0x56b5bf[_0x8e19('0x27')](_[_0x8e19('0x28')](_0x33d921,_0x8e19('0x29')));}function initGraph(_0x35e5a5,_0x16ad8d){var _0x406d21=new Graph();for(var _0x49314a in _0x35e5a5){if(_0x35e5a5[_0x8e19('0x24')](_0x49314a)){if(_[_0x8e19('0x2a')](_0x35e5a5[_0x49314a])){for(var _0x25dd6b=0x0;_0x25dd6b<_0x35e5a5[_0x49314a][_0x8e19('0x2b')];_0x25dd6b+=0x1){addVertex(_0x406d21,_0x35e5a5[_0x49314a][_0x25dd6b],_0x49314a);}}else{addVertex(_0x406d21,_0x35e5a5[_0x49314a],_0x49314a);}}}for(var _0x551feb=0x0;_0x551feb<_0x16ad8d[_0x8e19('0x2b')];_0x551feb+=0x1){if(_0x16ad8d[_0x551feb][_0x8e19('0x2c')]&&_0x16ad8d[_0x551feb]['target']){_0x406d21['addEdge'](_0x16ad8d[_0x551feb][_0x8e19('0x2c')],_0x16ad8d[_0x551feb][_0x8e19('0x2d')],_0x16ad8d[_0x551feb][_0x8e19('0x2e')]);}}return _0x406d21;}function getSquareProject(_0x343e9d,_0x3195a8){rpc[_0x8e19('0x2f')](_0x343e9d)['then'](function(_0x5b53b2){_0x3195a8(null,_0x5b53b2);})[_0x8e19('0x30')](function(_0x5e0cf7){_0x3195a8(null,_0x5e0cf7);});}function createSquareReport(_0xb99bbe,_0x13010b){rpc[_0x8e19('0x31')](_0xb99bbe)[_0x8e19('0x32')](function(_0x5693c1){if(_0x13010b){_0x13010b(null,_0x5693c1);}})[_0x8e19('0x30')](function(_0x1b8b1d){if(_0x13010b){_0x13010b(null,_0x1b8b1d);}});}function setChannelVariables(_0x5aef26){for(var _0x4bf173 in _0x5aef26){if(_0x5aef26[_0x8e19('0x24')](_0x4bf173)){if(_0x4bf173[_0x8e19('0x33')](_0x8e19('0x34'))===0x0){_0x5aef26[_0x4bf173[_0x8e19('0x35')](0x4)]=_0x5aef26[_0x4bf173];delete _0x5aef26[_0x4bf173];}}}}function getLogFromObject(_0x457024){return util[_0x8e19('0x36')](_0x457024,{'showHidden':![],'depth':null});}function agiHandler(_0x264a65){var _0x11d6ac,_0x4b0f3f,_0x46a38c,_0xa4a108,_0x5e880a;logger[_0x8e19('0x37')](_0x8e19('0x38'),JSON[_0x8e19('0x39')](_0x264a65,null,0x2));logger[_0x8e19('0x11')](util[_0x8e19('0x12')](_0x8e19('0x3a'),_0x264a65[_0x8e19('0x1e')],_0x264a65['calleridname'],_0x264a65[_0x8e19('0x1a')],_0x264a65[_0x8e19('0x1b')],_0x264a65[_0x8e19('0x1c')]));_0x264a65['on'](_0x8e19('0xd'),errorHandler);_0x264a65['on'](_0x8e19('0x3b'),closeHandler);_0x264a65['on'](_0x8e19('0x3c'),timeoutHandler);_0x264a65[_0x8e19('0x20')]=![];_0x264a65['on'](_0x8e19('0x3d'),hangupHandler);var _0x15e4e6=getSquareProject[_0x8e19('0x3e')](null,_0x264a65[_0x8e19('0x1e')]);if(_0x15e4e6){if(_0x15e4e6[_0x8e19('0x3f')]){_0x11d6ac=getRoot(_0x15e4e6['production']);if(_0x11d6ac&&_0x11d6ac[_0x8e19('0x40')]){logger['debug']('root',JSON['stringify'](_0x11d6ac,null,0x2));_0x264a65['joinAt']=moment()[_0x8e19('0x12')](_0x8e19('0x41'));_0x4b0f3f=initGraph(_[_0x8e19('0x28')](_0x11d6ac,_0x8e19('0x29')),_0x11d6ac['mxCell']);_0x46a38c=new Vertices(_0x264a65,rpc,mailRpc);logger[_0x8e19('0x11')](util[_0x8e19('0x12')](_0x8e19('0x42'),_0x264a65[_0x8e19('0x1e')],_0x264a65[_0x8e19('0x19')],_0x264a65[_0x8e19('0x1a')],_0x264a65['dnid'],_0x264a65['uniqueid']));_0x4b0f3f[_0x8e19('0x43')](_0x11d6ac[_0x8e19('0x40')]['id'],function(_0x7b0bd){try{_0x7b0bd=_0x46a38c[_0x8e19('0x44')](_0x7b0bd);logger['debug'](_0x8e19('0x45'),JSON[_0x8e19('0x39')](_0x7b0bd,null,0x2));if(_0x7b0bd['agicommand']===_0x8e19('0x46')){logger[_0x8e19('0x11')](_0x8e19('0x47'));_0x264a65['context']=_0x7b0bd['context']||_0x264a65[_0x8e19('0x48')];_0x264a65[_0x8e19('0x49')]=_0x7b0bd[_0x8e19('0x49')];_0x264a65['priority']=_0x7b0bd[_0x8e19('0x4a')]?_0x7b0bd[_0x8e19('0x4a')]-0x1:0x1;return null;}else if(_0x7b0bd&&_0x46a38c[_0x7b0bd[_0x8e19('0x4b')]]){_0x5e880a=_0x46a38c[_0x7b0bd[_0x8e19('0x4b')]](_0x7b0bd);logger['info'](_0x8e19('0x4c'),JSON[_0x8e19('0x39')](_0x5e880a,null,0x2));if(_0x5e880a&&_0x5e880a[_0x8e19('0x4d')]===AGI_CODE_SUCCESS&&_0x5e880a[_0x8e19('0x4e')]!==AGI_RESULT_ERROR&&!_0x264a65['evtHangup']){logger[_0x8e19('0x37')](_0x8e19('0x4c'),getLogFromObject(_0x5e880a));return _[_0x8e19('0x4f')](_0x5e880a[_0x8e19('0x4e')])?null:_0x5e880a[_0x8e19('0x4e')][_0x8e19('0x50')]();}else{logger[_0x8e19('0xd')](_0x8e19('0x4c'),getLogFromObject(_0x5e880a));return null;}}else{logger[_0x8e19('0xd')]('agicommand\x20not\x20found');return null;}}catch(_0x446b7b){logger['error'](_0x446b7b[_0x8e19('0xe')]);return null;}});if(_0x11d6ac[_0x8e19('0x51')]){logger[_0x8e19('0x11')](util[_0x8e19('0x12')](_0x8e19('0x52'),_0x264a65[_0x8e19('0x1e')],_0x264a65[_0x8e19('0x19')],_0x264a65[_0x8e19('0x1a')],_0x264a65['dnid'],_0x264a65[_0x8e19('0x1c')]));_0x4b0f3f[_0x8e19('0x43')](_0x11d6ac[_0x8e19('0x51')]['id'],function(_0x477cb6){try{_0x477cb6=_0x46a38c[_0x8e19('0x44')](_0x477cb6);logger[_0x8e19('0x37')](_0x8e19('0x45'),JSON[_0x8e19('0x39')](_0x477cb6,null,0x2));if(_0x477cb6&&_0x46a38c[_0x477cb6[_0x8e19('0x4b')]]){_0x5e880a=_0x46a38c[_0x477cb6['agicommand']](_0x477cb6);if(_0x5e880a){logger[_0x8e19('0x37')](_0x8e19('0x4c'),getLogFromObject(_0x5e880a));return _[_0x8e19('0x4f')](_0x5e880a[_0x8e19('0x4e')])?null:_0x5e880a[_0x8e19('0x4e')][_0x8e19('0x50')]();}else{logger[_0x8e19('0xd')]('response',getLogFromObject(_0x5e880a));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x22f71b){logger[_0x8e19('0xd')](_0x22f71b[_0x8e19('0xe')]);return null;}});}logger[_0x8e19('0x11')](util[_0x8e19('0x12')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x264a65[_0x8e19('0x1e')],_0x264a65[_0x8e19('0x19')],_0x264a65[_0x8e19('0x1a')],_0x264a65[_0x8e19('0x1b')],_0x264a65[_0x8e19('0x1c')]));logger[_0x8e19('0x11')](util[_0x8e19('0x12')](_0x8e19('0x53'),_0x264a65['context'],_0x264a65['extension'],parseInt(_0x264a65[_0x8e19('0x4a')],0xa)+0x1));_0x264a65[_0x8e19('0x54')](_0x264a65[_0x8e19('0x48')],_0x264a65[_0x8e19('0x49')],parseInt(_0x264a65[_0x8e19('0x4a')],0xa)+0x1);_0x264a65[_0x8e19('0x3b')]();}}else{logger[_0x8e19('0xd')](util[_0x8e19('0x12')](_0x8e19('0x55'),_0x264a65[_0x8e19('0x1e')]));_0x264a65[_0x8e19('0x54')](_0x264a65[_0x8e19('0x48')],_0x264a65[_0x8e19('0x49')],parseInt(_0x264a65[_0x8e19('0x4a')],0xa)+0x1);_0x264a65[_0x8e19('0x3b')]();}}else{logger[_0x8e19('0xd')](util[_0x8e19('0x12')](_0x8e19('0x56'),_0x264a65['arg_1']));_0x264a65['continueAt'](_0x264a65[_0x8e19('0x48')],_0x264a65[_0x8e19('0x49')],parseInt(_0x264a65['priority'],0xa)+0x1);_0x264a65[_0x8e19('0x3b')]();}}function main(){var _0x48edb1;return utilLicense[_0x8e19('0x57')]()['then'](function(_0x2d84b5){if(_0x2d84b5){if(_0x2d84b5[_0x8e19('0x58')]){if(_0x2d84b5[_0x8e19('0x59')]&&_0x2d84b5[_0x8e19('0x59')]>0x0){logger[_0x8e19('0x11')](util[_0x8e19('0x12')](_0x8e19('0x5a'),_0x2d84b5[_0x8e19('0x59')]));_0x48edb1=_0x2d84b5['callysquare'];}else{logger[_0x8e19('0x11')](_0x8e19('0x5b'));}}else{logger[_0x8e19('0x11')](_0x8e19('0x5c'));_0x48edb1=-0x1;}}})[_0x8e19('0x30')](function(_0x4c30ac){logger[_0x8e19('0xd')]('[LICENSE]',_0x4c30ac[_0x8e19('0xe')]);})[_0x8e19('0x51')](function(){var _0x114227=require(_0x8e19('0x5d'))(config['agi']['port'],config[_0x8e19('0x5')]['ip'],_0x48edb1);_0x114227['on']('error',errorHandler);_0x114227['on'](_0x8e19('0x5e'),listeningHandler);_0x114227['on'](_0x8e19('0x5f'),connectionHandler);_0x114227['on'](_0x8e19('0x3b'),closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index e0a3eef..3bd6350 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(_0x4cc0c2,_0x59e71f){var _0x444078=function(_0x1e202c){while(--_0x1e202c){_0x4cc0c2['push'](_0x4cc0c2['shift']());}};_0x444078(++_0x59e71f);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x344321,_0x2d3719){var _0x3d25f0=function(_0x4717d1){while(--_0x4717d1){_0x344321['push'](_0x344321['shift']());}};_0x3d25f0(++_0x2d3719);}(_0x814b,0x1a2));var _0xb814=function(_0x2fffff,_0x415518){_0x2fffff=_0x2fffff-0x0;var _0x4f2a2c=_0x814b[_0x2fffff];return _0x4f2a2c;};'use strict';var BPromise=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var client=jayson[_0xb814('0x2')][_0xb814('0x3')]({'port':0x232b});function request(_0xfbb64b,_0x477725){return new BPromise(function(_0x4a98af,_0x38c21a){return client[_0xb814('0x4')](_0xfbb64b,_0x477725)[_0xb814('0x5')](function(_0x4237bc){if(_0x4237bc[_0xb814('0x6')]){return _0x38c21a(_0x4237bc[_0xb814('0x6')]['message']);}else{return _0x4a98af(_0x4237bc[_0xb814('0x7')]);}})[_0xb814('0x8')](function(_0x5c8539){return _0x38c21a(_0x5c8539);});});}exports[_0xb814('0x9')]=function(_0x2913a6,_0x186d5a){return request(_0xb814('0xa'),{'account':_0x2913a6,'message':_0x186d5a});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 13fa0fe..8ccaa8c 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(_0x410c8b,_0x533057){var _0x5a809c=function(_0x55339d){while(--_0x55339d){_0x410c8b['push'](_0x410c8b['shift']());}};_0x5a809c(++_0x533057);}(_0x7a54,0x106));var _0x47a5=function(_0x264369,_0x4a6c85){_0x264369=_0x264369-0x0;var _0x1fc951=_0x7a54[_0x264369];return _0x1fc951;};'use strict';var util=require(_0x47a5('0x0'));var Transform=require(_0x47a5('0x1'))[_0x47a5('0x2')];function AGIReply(_0x58157c){Transform[_0x47a5('0x3')](this,_0x58157c);this[_0x47a5('0x4')]='';this['_inBody']=![];}util[_0x47a5('0x5')](AGIReply,Transform);AGIReply[_0x47a5('0x6')][_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){var _0x3d5629='\x0a',_0x59199c=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x343372=-0x1,_0x30e405=-0x1,_0x506eda='',_0x194fb0=0x0,_0x5077f3='',_0x5d90b3='';this[_0x47a5('0x4')]+=_0x3717e1[_0x47a5('0x8')]();_0x5077f3=this['_localBuffer'];if(!this[_0x47a5('0x9')]){_0x194fb0=0x0;while(_0x59199c[_0x194fb0]){while((_0x30e405=_0x5077f3['indexOf'](_0x59199c[_0x194fb0]))!=-0x1){_0x506eda=_0x59199c[_0x194fb0];_0x5d90b3=_0x5077f3['substring'](0x0,_0x30e405);_0x5077f3=_0x5077f3[_0x47a5('0xa')](_0x30e405+_0x506eda[_0x47a5('0xb')]);var _0x2f399b=_0x5d90b3[_0x47a5('0xc')](_0x3d5629),_0x250fad=0x0,_0xd612dd={},_0xd308b8='',_0x1eae59='',_0x5beb89=-0x1;while(_0x2f399b[_0x250fad]){_0x5beb89=_0x2f399b[_0x250fad][_0x47a5('0xd')](':');if(_0x5beb89!=-0x1){_0xd308b8=_0x2f399b[_0x250fad][_0x47a5('0xe')](0x0,_0x5beb89)[_0x47a5('0xf')]();_0x1eae59=_0x2f399b[_0x250fad][_0x47a5('0xe')](_0x5beb89+0x1)[_0x47a5('0xf')]();if(_0xd308b8[_0x47a5('0xb')]>0x0){_0xd612dd[_0xd308b8]=_0x1eae59;}}else{}_0x250fad++;}this[_0x47a5('0x10')]('headers',_0xd612dd);this[_0x47a5('0x9')]=!![];}_0x194fb0++;}this[_0x47a5('0x4')]=_0x5077f3;}else{while((_0x343372=_0x5077f3[_0x47a5('0xd')](_0x3d5629))!=-0x1){_0x5d90b3=_0x5077f3[_0x47a5('0xa')](0x0,_0x343372);this[_0x47a5('0x10')]('line',_0x5d90b3);_0x5077f3=_0x5077f3['substring'](_0x343372+_0x3d5629[_0x47a5('0xb')]);}this['_localBuffer']=_0x5077f3;}_0x545a97();};module['exports']=AGIReply; \ No newline at end of file +var _0xb10b=['call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','trim','slice','length','emit','headers','line','exports','util','Transform'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0xb10b,0x12a));var _0xbb10=function(_0xc2dde6,_0x1cccc9){_0xc2dde6=_0xc2dde6-0x0;var _0x9fc29c=_0xb10b[_0xc2dde6];return _0x9fc29c;};'use strict';var util=require(_0xbb10('0x0'));var Transform=require('stream')[_0xbb10('0x1')];function AGIReply(_0x35bc5f){Transform[_0xbb10('0x2')](this,_0x35bc5f);this['_localBuffer']='';this[_0xbb10('0x3')]=![];}util[_0xbb10('0x4')](AGIReply,Transform);AGIReply[_0xbb10('0x5')][_0xbb10('0x6')]=function(_0x49baf4,_0x312b72,_0x481979){var _0x328583='\x0a',_0x3cdd53=['\x0a\x0a',_0xbb10('0x7')],_0x513741=-0x1,_0x1b9e94=-0x1,_0x3fb675='',_0x21370f=0x0,_0x1c3ee5='',_0x2353ef='';this[_0xbb10('0x8')]+=_0x49baf4[_0xbb10('0x9')]();_0x1c3ee5=this['_localBuffer'];if(!this['_inBody']){_0x21370f=0x0;while(_0x3cdd53[_0x21370f]){while((_0x1b9e94=_0x1c3ee5[_0xbb10('0xa')](_0x3cdd53[_0x21370f]))!=-0x1){_0x3fb675=_0x3cdd53[_0x21370f];_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x1b9e94);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x1b9e94+_0x3fb675['length']);var _0x408248=_0x2353ef[_0xbb10('0xc')](_0x328583),_0x5be7e0=0x0,_0x44fb19={},_0x916a32='',_0x285009='',_0x193a27=-0x1;while(_0x408248[_0x5be7e0]){_0x193a27=_0x408248[_0x5be7e0][_0xbb10('0xa')](':');if(_0x193a27!=-0x1){_0x916a32=_0x408248[_0x5be7e0]['slice'](0x0,_0x193a27)[_0xbb10('0xd')]();_0x285009=_0x408248[_0x5be7e0][_0xbb10('0xe')](_0x193a27+0x1)[_0xbb10('0xd')]();if(_0x916a32[_0xbb10('0xf')]>0x0){_0x44fb19[_0x916a32]=_0x285009;}}else{}_0x5be7e0++;}this[_0xbb10('0x10')](_0xbb10('0x11'),_0x44fb19);this[_0xbb10('0x3')]=!![];}_0x21370f++;}this[_0xbb10('0x8')]=_0x1c3ee5;}else{while((_0x513741=_0x1c3ee5[_0xbb10('0xa')](_0x328583))!=-0x1){_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x513741);this['emit'](_0xbb10('0x12'),_0x2353ef);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x513741+_0x328583[_0xbb10('0xf')]);}this[_0xbb10('0x8')]=_0x1c3ee5;}_0x481979();};module[_0xbb10('0x13')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 85bfd49..de55538 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 _0xbc6b=['ShowSquareProject','production','getMailAccountById','MailServerOut','Smtp','email','getSquareProjectById','name','ShowVoiceQueue','ShowVariable','getSquareOdbcById','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','Interval','getSmsAccountById','ShowSmsAccount','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','ShowPause','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','http','request','then','error','catch','getSquareProject'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xbc6b,0xd4));var _0xbbc6=function(_0x4e4f0e,_0x1c3892){_0x4e4f0e=_0x4e4f0e-0x0;var _0x1a7219=_0xbc6b[_0x4e4f0e];return _0x1a7219;};'use strict';var BPromise=require(_0xbbc6('0x0'));var moment=require(_0xbbc6('0x1'));var _=require(_0xbbc6('0x2'));var util=require(_0xbbc6('0x3'));var jayson=require(_0xbbc6('0x4'));var client=jayson[_0xbbc6('0x5')][_0xbbc6('0x6')]({'port':0x2329});function request(_0x3476fb,_0x5670d0){return new BPromise(function(_0x573586,_0x4e1b1d){return client[_0xbbc6('0x7')](_0x3476fb,_0x5670d0)[_0xbbc6('0x8')](function(_0x2b86a0){if(_0x2b86a0[_0xbbc6('0x9')]){return _0x4e1b1d(_0x2b86a0['error']['message']);}else{return _0x573586(_0x2b86a0['result']);}})[_0xbbc6('0xa')](function(_0x467df7){return _0x4e1b1d(_0x467df7);});});}exports[_0xbbc6('0xb')]=function(_0x38c88f){return request(_0xbbc6('0xc'),{'options':{'raw':![],'where':{'name':_0x38c88f},'attributes':[_0xbbc6('0xd')]}});};exports[_0xbbc6('0xe')]=function(_0x84bd9c){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x84bd9c},'include':[{'model':_0xbbc6('0xf'),'as':_0xbbc6('0x10')}],'attributes':['id','name',_0xbbc6('0x11')]}});};exports[_0xbbc6('0x12')]=function(_0x9a913){return request(_0xbbc6('0xc'),{'options':{'where':{'id':_0x9a913},'attributes':[_0xbbc6('0x13')]}});};exports['getVoiceQueueById']=function(_0x29d08c){return request(_0xbbc6('0x14'),{'options':{'where':{'id':_0x29d08c},'attributes':[_0xbbc6('0x13')]}});};exports['getVariableById']=function(_0x45781f){return request(_0xbbc6('0x15'),{'options':{'where':{'id':_0x45781f},'attributes':[_0xbbc6('0x13')]}});};exports[_0xbbc6('0x16')]=function(_0x5e2648){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x5e2648},'attributes':[_0xbbc6('0x17')]}});};exports[_0xbbc6('0x18')]=function(_0x12060e){return request(_0xbbc6('0x19'),{'options':{'where':{'id':_0x12060e},'attributes':['name']}});};exports[_0xbbc6('0x1a')]=function(_0x54972f){return request(_0xbbc6('0x1b'),{'options':{'where':{'id':_0x54972f},'attributes':[_0xbbc6('0x13')]}});};exports[_0xbbc6('0x1c')]=function(_0x28aa28){return request(_0xbbc6('0x1d'),{'options':{'where':{'id':_0x28aa28},'attributes':[_0xbbc6('0x1e')]}});};exports[_0xbbc6('0x1f')]=function(_0x4b49db){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x4b49db},'include':[{'model':_0xbbc6('0x20'),'as':'Intervals'}]}});};exports[_0xbbc6('0x21')]=function(_0x5ec049){return request(_0xbbc6('0x22'),{'options':{'where':{'id':_0x5ec049},'attributes':['id',_0xbbc6('0x13')]}});};exports['createSmsMessage']=function(_0xc20812){return request('CreateSmsMessage',{'body':_0xc20812});};exports['createSquareDetailsReport']=function(_0x106ebc){return request(_0xbbc6('0x23'),{'body':_0x106ebc});};exports[_0xbbc6('0x24')]=function(_0x498be5){return request(_0xbbc6('0x25'),{'body':_['merge'](_0x498be5,{'project_name':_0x498be5[_0xbbc6('0x26')],'prev_project_name':_0x498be5['arg_2']||'','is_subproject':_0x498be5[_0xbbc6('0x27')]?!![]:![],'leaveAt':moment()[_0xbbc6('0x28')](_0xbbc6('0x29'))})});};exports[_0xbbc6('0x2a')]=function(_0x13d17f){return request('CreateSquareRecording',{'body':_0x13d17f});};exports[_0xbbc6('0x2b')]=function(_0x57de62){return request(_0xbbc6('0x2c'),{'body':_0x57de62});};exports[_0xbbc6('0x2d')]=function(_0x2ac894){return request(_0xbbc6('0x2e'),{'options':{'raw':![],'where':{'phone':_0x2ac894[_0xbbc6('0x2f')],'ListId':_0x2ac894[_0xbbc6('0x30')]}}})[_0xbbc6('0x8')](function(_0x57399a){if(_0x57399a){return _0x57399a;}return request('CreateCmContact',{'body':_0x2ac894});});};exports['getPauseById']=function(_0x26c8d4){return request(_0xbbc6('0x31'),{'options':{'where':{'id':_0x26c8d4},'attributes':[_0xbbc6('0x13')]}});};exports['agentLogin']=function(_0x8abe94,_0x1a6651){return request(_0xbbc6('0x32'),{'body':{'interface':_0x1a6651},'options':{'where':_0x8abe94}});};exports[_0xbbc6('0x33')]=function(_0x2acdde,_0x56cf81,_0xff4690){return request(_0xbbc6('0x34'),{'body':{'type':_0x56cf81,'uniqueid':_0xff4690},'options':{'where':_0x2acdde}});};exports[_0xbbc6('0x35')]=function(_0x5b7d1b){return request(_0xbbc6('0x36'),{'body':{},'options':{'where':_0x5b7d1b}});};exports['agentLogout']=function(_0x41e807){return request(_0xbbc6('0x37'),{'body':{},'options':{'where':_0x41e807}});}; \ No newline at end of file +var _0x38dc=['CreateSquareReport','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','phone','ListId','CreateCmContact','agentLogin','agentPause','PauseUser','agentUnpause','lodash','util','request','then','error','message','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','Smtp','email','ShowVoiceQueue','name','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','ShowTrunk','ShowSound','getIntervalById','ShowInterval','getSmsAccountById','createSmsMessage','CreateSquareDetailsReport'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x38dc,0x117));var _0xc38d=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x38dc[_0x3b380d];return _0x54502b;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0xc38d('0x0'));var util=require(_0xc38d('0x1'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x2329});function request(_0x64b921,_0x5dc8f5){return new BPromise(function(_0x3d7c66,_0x5a4c01){return client[_0xc38d('0x2')](_0x64b921,_0x5dc8f5)[_0xc38d('0x3')](function(_0x501765){if(_0x501765[_0xc38d('0x4')]){return _0x5a4c01(_0x501765[_0xc38d('0x4')][_0xc38d('0x5')]);}else{return _0x3d7c66(_0x501765['result']);}})[_0xc38d('0x6')](function(_0xb975a1){return _0x5a4c01(_0xb975a1);});});}exports[_0xc38d('0x7')]=function(_0x30dde9){return request(_0xc38d('0x8'),{'options':{'raw':![],'where':{'name':_0x30dde9},'attributes':[_0xc38d('0x9')]}});};exports[_0xc38d('0xa')]=function(_0x264ddc){return request(_0xc38d('0xb'),{'options':{'raw':![],'where':{'id':_0x264ddc},'include':[{'model':'MailServerOut','as':_0xc38d('0xc')}],'attributes':['id','name',_0xc38d('0xd')]}});};exports['getSquareProjectById']=function(_0x41f2d1){return request(_0xc38d('0x8'),{'options':{'where':{'id':_0x41f2d1},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x56b377){return request(_0xc38d('0xe'),{'options':{'where':{'id':_0x56b377},'attributes':[_0xc38d('0xf')]}});};exports[_0xc38d('0x10')]=function(_0x33cb70){return request(_0xc38d('0x11'),{'options':{'where':{'id':_0x33cb70},'attributes':[_0xc38d('0xf')]}});};exports[_0xc38d('0x12')]=function(_0x4a3c4f){return request(_0xc38d('0x13'),{'options':{'where':{'id':_0x4a3c4f},'attributes':['dsn']}});};exports[_0xc38d('0x14')]=function(_0x3d1418){return request(_0xc38d('0x15'),{'options':{'where':{'id':_0x3d1418},'attributes':[_0xc38d('0xf')]}});};exports['getTrunkById']=function(_0x174bcd){return request(_0xc38d('0x16'),{'options':{'where':{'id':_0x174bcd},'attributes':[_0xc38d('0xf')]}});};exports['getSoundById']=function(_0x27c320){return request(_0xc38d('0x17'),{'options':{'where':{'id':_0x27c320},'attributes':['save_name']}});};exports[_0xc38d('0x18')]=function(_0x2f68fb){return request(_0xc38d('0x19'),{'options':{'raw':![],'where':{'id':_0x2f68fb},'include':[{'model':'Interval','as':'Intervals'}]}});};exports[_0xc38d('0x1a')]=function(_0x40654b){return request('ShowSmsAccount',{'options':{'where':{'id':_0x40654b},'attributes':['id','name']}});};exports[_0xc38d('0x1b')]=function(_0x31752e){return request('CreateSmsMessage',{'body':_0x31752e});};exports['createSquareDetailsReport']=function(_0x29b63a){return request(_0xc38d('0x1c'),{'body':_0x29b63a});};exports['createSquareReport']=function(_0x286ceb){return request(_0xc38d('0x1d'),{'body':_['merge'](_0x286ceb,{'project_name':_0x286ceb[_0xc38d('0x1e')],'prev_project_name':_0x286ceb[_0xc38d('0x1f')]||'','is_subproject':_0x286ceb[_0xc38d('0x1f')]?!![]:![],'leaveAt':moment()['format'](_0xc38d('0x20'))})});};exports[_0xc38d('0x21')]=function(_0x4a57c5){return request(_0xc38d('0x22'),{'body':_0x4a57c5});};exports[_0xc38d('0x23')]=function(_0x1261f0){return request('CreateSquareMessage',{'body':_0x1261f0});};exports[_0xc38d('0x24')]=function(_0x164413){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x164413[_0xc38d('0x25')],'ListId':_0x164413[_0xc38d('0x26')]}}})['then'](function(_0x50de05){if(_0x50de05){return _0x50de05;}return request(_0xc38d('0x27'),{'body':_0x164413});});};exports['getPauseById']=function(_0x40a121){return request('ShowPause',{'options':{'where':{'id':_0x40a121},'attributes':['name']}});};exports[_0xc38d('0x28')]=function(_0x30747e,_0x39c9c5){return request('LoginUser',{'body':{'interface':_0x39c9c5},'options':{'where':_0x30747e}});};exports[_0xc38d('0x29')]=function(_0x37290c,_0xb046c6,_0x5a553e){return request(_0xc38d('0x2a'),{'body':{'type':_0xb046c6,'uniqueid':_0x5a553e},'options':{'where':_0x37290c}});};exports[_0xc38d('0x2b')]=function(_0x9cb572){return request('UnpauseUser',{'body':{},'options':{'where':_0x9cb572}});};exports['agentLogout']=function(_0x157ea1){return request('LogoutUser',{'body':{},'options':{'where':_0x157ea1}});}; \ 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 26789c7..2f65bb9 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 _0x54ef=['exports','./polly','./lex'];(function(_0x200680,_0x33f0b0){var _0x4218f8=function(_0x304a8a){while(--_0x304a8a){_0x200680['push'](_0x200680['shift']());}};_0x4218f8(++_0x33f0b0);}(_0x54ef,0x112));var _0xf54e=function(_0x1a6437,_0x2233a5){_0x1a6437=_0x1a6437-0x0;var _0x3e123a=_0x54ef[_0x1a6437];return _0x3e123a;};var polly=require(_0xf54e('0x0'));var lex=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x2123=['exports','./polly','./lex'];(function(_0x5f4abc,_0x1692ac){var _0x3c29a6=function(_0x46309e){while(--_0x46309e){_0x5f4abc['push'](_0x5f4abc['shift']());}};_0x3c29a6(++_0x1692ac);}(_0x2123,0x190));var _0x3212=function(_0x49421c,_0x3c6a2c){_0x49421c=_0x49421c-0x0;var _0x3f54ae=_0x2123[_0x49421c];return _0x3f54ae;};var polly=require(_0x3212('0x0'));var lex=require(_0x3212('0x1'));module[_0x3212('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 80ae10e..f82be73 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 _0x2356=['exports'];(function(_0x54bac5,_0x8d3a16){var _0xc15971=function(_0x254653){while(--_0x254653){_0x54bac5['push'](_0x54bac5['shift']());}};_0xc15971(++_0x8d3a16);}(_0x2356,0x14f));var _0x6235=function(_0x4baf98,_0xa7ebd9){_0x4baf98=_0x4baf98-0x0;var _0x5da718=_0x2356[_0x4baf98];return _0x5da718;};'use strict';var lex=require('./lib/api');module[_0x6235('0x0')]=function(_0xbfa2ed,_0x590910,_0x49b0d5,_0x18ce63,_0x32930d,_0x5c536f){return lex(_0xbfa2ed,_0x590910,_0x49b0d5,_0x18ce63,_0x32930d,_0x5c536f);}; \ No newline at end of file +var _0x6308=['./lib/api'];(function(_0x161644,_0x324798){var _0x3ca6d5=function(_0x47b122){while(--_0x47b122){_0x161644['push'](_0x161644['shift']());}};_0x3ca6d5(++_0x324798);}(_0x6308,0x1f2));var _0x8630=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x6308[_0x2aa0e7];return _0x1472c0;};'use strict';var lex=require(_0x8630('0x0'));module['exports']=function(_0x1b6f0f,_0x54447a,_0x54a006,_0x315284,_0x1ba5a4,_0x89e9db){return lex(_0x1b6f0f,_0x54447a,_0x54a006,_0x315284,_0x1ba5a4,_0x89e9db);}; \ 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 187d43b..cf967ab 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 _0x5ca3=['aws-sdk','slots','hasOwnProperty','slot_','exports','LexRuntime','$LATEST','bluebird'];(function(_0x12ab78,_0x2da7f2){var _0x4b8b7c=function(_0x59219a){while(--_0x59219a){_0x12ab78['push'](_0x12ab78['shift']());}};_0x4b8b7c(++_0x2da7f2);}(_0x5ca3,0x1d7));var _0x35ca=function(_0x27179a,_0x1583a3){_0x27179a=_0x27179a-0x0;var _0x355b44=_0x5ca3[_0x27179a];return _0x355b44;};'use strict';var BPromise=require(_0x35ca('0x0'));var AWS=require(_0x35ca('0x1'));function lexResult(_0x15d2d2,_0x3a6187){return new BPromise(function(_0x19788f,_0x32ed77){_0x15d2d2['postText'](_0x3a6187,function(_0x30f94a,_0x8c85ee){if(_0x30f94a){_0x32ed77(_0x30f94a);}if(_0x8c85ee['slots']){for(const _0x514dfb in _0x8c85ee[_0x35ca('0x2')]){if(_0x8c85ee[_0x35ca('0x2')][_0x35ca('0x3')](_0x514dfb)){var _0x55d024=_0x8c85ee[_0x35ca('0x2')][_0x514dfb];_0x8c85ee[_0x35ca('0x4')+_0x514dfb]=_0x55d024;}}}_0x19788f(_0x8c85ee);});});}module[_0x35ca('0x5')]=function(_0x22adca,_0x54231a,_0x516728,_0x1d6425,_0x162ada,_0x2a1f0e){var _0x1c01e2=new AWS[(_0x35ca('0x6'))]({'accessKeyId':_0x54231a,'secretAccessKey':_0x516728,'region':_0x1d6425});var _0x3ecadb={'botAlias':_0x35ca('0x7'),'botName':_0x2a1f0e,'inputText':_0x162ada,'userId':_0x22adca};return lexResult(_0x1c01e2,_0x3ecadb);}; \ No newline at end of file +var _0x8896=['aws-sdk','postText','slots','hasOwnProperty','LexRuntime','$LATEST','bluebird'];(function(_0xc0213d,_0x4a3b1d){var _0x1a93c4=function(_0xc683f3){while(--_0xc683f3){_0xc0213d['push'](_0xc0213d['shift']());}};_0x1a93c4(++_0x4a3b1d);}(_0x8896,0x16b));var _0x6889=function(_0x1c29e4,_0x25182e){_0x1c29e4=_0x1c29e4-0x0;var _0x2925eb=_0x8896[_0x1c29e4];return _0x2925eb;};'use strict';var BPromise=require(_0x6889('0x0'));var AWS=require(_0x6889('0x1'));function lexResult(_0x2fc869,_0xcc1767){return new BPromise(function(_0xf2c919,_0x4bd155){_0x2fc869[_0x6889('0x2')](_0xcc1767,function(_0x1fe5f1,_0xc458b8){if(_0x1fe5f1){_0x4bd155(_0x1fe5f1);}if(_0xc458b8[_0x6889('0x3')]){for(const _0x23f3ef in _0xc458b8[_0x6889('0x3')]){if(_0xc458b8[_0x6889('0x3')][_0x6889('0x4')](_0x23f3ef)){var _0x522090=_0xc458b8[_0x6889('0x3')][_0x23f3ef];_0xc458b8['slot_'+_0x23f3ef]=_0x522090;}}}_0xf2c919(_0xc458b8);});});}module['exports']=function(_0x5ce05c,_0x37f6cf,_0x401f9b,_0x565c14,_0x589e38,_0x48fd2e){var _0x579ea2=new AWS[(_0x6889('0x5'))]({'accessKeyId':_0x37f6cf,'secretAccessKey':_0x401f9b,'region':_0x565c14});var _0x53b63b={'botAlias':_0x6889('0x6'),'botName':_0x48fd2e,'inputText':_0x589e38,'userId':_0x5ce05c};return lexResult(_0x579ea2,_0x53b63b);}; \ 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 ea7205a..0b4b2f2 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 _0xd4a0=['exports','./lib/api'];(function(_0x4defd6,_0x37bbd3){var _0x4c9276=function(_0x1d7a3d){while(--_0x1d7a3d){_0x4defd6['push'](_0x4defd6['shift']());}};_0x4c9276(++_0x37bbd3);}(_0xd4a0,0x18b));var _0x0d4a=function(_0x4c8bc7,_0x3bc716){_0x4c8bc7=_0x4c8bc7-0x0;var _0x5b3d9b=_0xd4a0[_0x4c8bc7];return _0x5b3d9b;};'use strict';var polly=require(_0x0d4a('0x0'));module[_0x0d4a('0x1')]=function(_0x49b7c7,_0x2f7f5f,_0x4597f6,_0x142b38,_0x402eff,_0x37a5ef,_0x35d7f7){return polly(_0x49b7c7,_0x2f7f5f,_0x4597f6,_0x142b38,_0x402eff,_0x37a5ef,_0x35d7f7);}; \ No newline at end of file +var _0xe921=['exports'];(function(_0x2ccf68,_0x1d41df){var _0x2793f7=function(_0x3351af){while(--_0x3351af){_0x2ccf68['push'](_0x2ccf68['shift']());}};_0x2793f7(++_0x1d41df);}(_0xe921,0x104));var _0x1e92=function(_0x5b8671,_0x37c759){_0x5b8671=_0x5b8671-0x0;var _0x4643ea=_0xe921[_0x5b8671];return _0x4643ea;};'use strict';var polly=require('./lib/api');module[_0x1e92('0x0')]=function(_0x40925f,_0x7aaf23,_0x2ff83e,_0x1d24df,_0x37837a,_0x198321,_0x54184c){return polly(_0x40925f,_0x7aaf23,_0x2ff83e,_0x1d24df,_0x37837a,_0x198321,_0x54184c);}; \ 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 de3f5e1..129b7e9 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 _0xb226=['writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','mp3','path','randomstring','aws-sdk','synthesizeSpeech','AudioStream'];(function(_0x2ddaea,_0x4406a5){var _0x1f5b46=function(_0x4f31bf){while(--_0x4f31bf){_0x2ddaea['push'](_0x2ddaea['shift']());}};_0x1f5b46(++_0x4406a5);}(_0xb226,0xe2));var _0x6b22=function(_0x433446,_0x4e8885){_0x433446=_0x433446-0x0;var _0xe3aad3=_0xb226[_0x433446];return _0xe3aad3;};'use strict';var fs=require('fs');var path=require(_0x6b22('0x0'));var BPromise=require('bluebird');var rs=require(_0x6b22('0x1'));var AWS=require(_0x6b22('0x2'));function pollyResult(_0x57e5e7,_0x1cbae7,_0x51df0b){return new BPromise(function(_0x4c6522,_0x3ddd1c){_0x57e5e7[_0x6b22('0x3')](_0x1cbae7,function(_0x2b583e,_0x262323){if(_0x2b583e){_0x3ddd1c(_0x2b583e);}else if(_0x262323){if(_0x262323[_0x6b22('0x4')]instanceof Buffer){fs[_0x6b22('0x5')](_0x51df0b,_0x262323[_0x6b22('0x4')],function(_0x47e6b4){if(_0x47e6b4){_0x3ddd1c(_0x47e6b4);}else{_0x4c6522();}});}else{_0x3ddd1c(new Error(_0x6b22('0x6')));}}else{_0x3ddd1c(new Error(_0x6b22('0x7')));}});});}module['exports']=function(_0x3ac23c,_0x37426f,_0x298200,_0x959498,_0x49bdf6,_0x7d3342,_0x4e31dc){var _0x584971=new AWS[(_0x6b22('0x8'))]({'accessKeyId':_0x3ac23c,'secretAccessKey':_0x37426f,'region':_0x298200});var _0x55b8fc={'Text':_0x49bdf6,'TextType':_0x7d3342||_0x6b22('0x9'),'OutputFormat':_0x6b22('0xa'),'VoiceId':_0x959498};return pollyResult(_0x584971,_0x55b8fc,_0x4e31dc);}; \ No newline at end of file +var _0xaab2=['synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','aws-sdk'];(function(_0x12237d,_0x544532){var _0x781a33=function(_0x474397){while(--_0x474397){_0x12237d['push'](_0x12237d['shift']());}};_0x781a33(++_0x544532);}(_0xaab2,0x194));var _0x2aab=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xaab2[_0x5783f4];return _0x28e380;};'use strict';var fs=require('fs');var path=require(_0x2aab('0x0'));var BPromise=require(_0x2aab('0x1'));var rs=require('randomstring');var AWS=require(_0x2aab('0x2'));function pollyResult(_0x1846c1,_0x1745ed,_0x42cfa3){return new BPromise(function(_0x2ab182,_0x53fecd){_0x1846c1[_0x2aab('0x3')](_0x1745ed,function(_0x248832,_0x2d2fdb){if(_0x248832){_0x53fecd(_0x248832);}else if(_0x2d2fdb){if(_0x2d2fdb[_0x2aab('0x4')]instanceof Buffer){fs['writeFile'](_0x42cfa3,_0x2d2fdb['AudioStream'],function(_0x38811c){if(_0x38811c){_0x53fecd(_0x38811c);}else{_0x2ab182();}});}else{_0x53fecd(new Error(_0x2aab('0x5')));}}else{_0x53fecd(new Error(_0x2aab('0x6')));}});});}module[_0x2aab('0x7')]=function(_0x5d2aa1,_0x41c004,_0x3a2f0d,_0x371bf5,_0x307ffc,_0x34cdc6,_0x2fdf92){var _0x1dffe4=new AWS[(_0x2aab('0x8'))]({'accessKeyId':_0x5d2aa1,'secretAccessKey':_0x41c004,'region':_0x3a2f0d});var _0x1b4f14={'Text':_0x307ffc,'TextType':_0x34cdc6||_0x2aab('0x9'),'OutputFormat':_0x2aab('0xa'),'VoiceId':_0x371bf5};return pollyResult(_0x1dffe4,_0x1b4f14,_0x2fdf92);}; \ 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 346efb7..7472442 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 _0x427a=['./lib/api'];(function(_0x7d3a15,_0x5ba5a6){var _0xc9a9c3=function(_0xfad676){while(--_0xfad676){_0x7d3a15['push'](_0x7d3a15['shift']());}};_0xc9a9c3(++_0x5ba5a6);}(_0x427a,0x1c4));var _0xa427=function(_0x561fa4,_0x22f756){_0x561fa4=_0x561fa4-0x0;var _0x440ab9=_0x427a[_0x561fa4];return _0x440ab9;};'use strict';var asr=require(_0xa427('0x0'));module['exports']=function(_0x97928c,_0x34f84b,_0x5bd870,_0xfc4e02){return asr(_0x97928c,_0x34f84b,_0x5bd870);}; \ No newline at end of file +var _0x403c=['./lib/api','exports'];(function(_0x5a154a,_0xabef7a){var _0x14ba71=function(_0x21e612){while(--_0x21e612){_0x5a154a['push'](_0x5a154a['shift']());}};_0x14ba71(++_0xabef7a);}(_0x403c,0x78));var _0xc403=function(_0x1eeb48,_0x126c7b){_0x1eeb48=_0x1eeb48-0x0;var _0x2a499f=_0x403c[_0x1eeb48];return _0x2a499f;};'use strict';var asr=require(_0xc403('0x0'));module[_0xc403('0x1')]=function(_0x397708,_0x336c41,_0x1f4e89,_0x41fb95){return asr(_0x397708,_0x336c41,_0x1f4e89);}; \ 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 cda05a8..002fc03 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 _0x74f1=['8000','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key='];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x74f1,0x111));var _0x174f=function(_0x336082,_0x5c364b){_0x336082=_0x336082-0x0;var _0x2ea2eb=_0x74f1[_0x336082];return _0x2ea2eb;};'use strict';var url=require(_0x174f('0x0'));var BPromise=require(_0x174f('0x1'));var fs=require('fs');var host=_0x174f('0x2');module[_0x174f('0x3')]=function(_0x6428e6,_0xe4f79e,_0x1a6390){return new BPromise(function(_0x5ecaeb,_0x5a2415){var _0x54c741;if(typeof _0x6428e6!==_0x174f('0x4')||_0x6428e6[_0x174f('0x5')]===0x0){return _0x5a2415(_0x174f('0x6'));}if(typeof _0xe4f79e!==_0x174f('0x4')||_0xe4f79e['length']===0x0){return _0x5a2415(_0x174f('0x7'));}if(typeof _0x1a6390!==_0x174f('0x8')&&(typeof _0x1a6390!=='string'||_0x1a6390['length']===0x0)){return _0x5a2415(_0x174f('0x9'));}try{_0x54c741=fs[_0x174f('0xa')](_0x6428e6)[_0x174f('0xb')](_0x174f('0xc'));}catch(_0x3d781a){return _0x5a2415(_0x3d781a);}return _0x5ecaeb({'method':_0x174f('0xd'),'uri':host+_0x174f('0xe')+_0xe4f79e,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x174f('0xf'),'languageCode':_0x1a6390},'audio':{'content':_0x54c741}},'json':!![]});});}; \ No newline at end of file +var _0x022b=['string','length','key\x20should\x20be\x20a\x20string','toString','base64','POST','LINEAR16','url','bluebird','https://speech.googleapis.com','exports','filepath\x20should\x20be\x20a\x20string'];(function(_0x26a94c,_0xa71520){var _0x298149=function(_0x34a4d5){while(--_0x34a4d5){_0x26a94c['push'](_0x26a94c['shift']());}};_0x298149(++_0xa71520);}(_0x022b,0x16f));var _0xb022=function(_0x7b8099,_0x287b37){_0x7b8099=_0x7b8099-0x0;var _0x4649f6=_0x022b[_0x7b8099];return _0x4649f6;};'use strict';var url=require(_0xb022('0x0'));var BPromise=require(_0xb022('0x1'));var fs=require('fs');var host=_0xb022('0x2');module[_0xb022('0x3')]=function(_0x340392,_0x333913,_0x5327ac){return new BPromise(function(_0x34b8cf,_0x1f58b6){var _0x6e5925;if(typeof _0x340392!=='string'||_0x340392['length']===0x0){return _0x1f58b6(_0xb022('0x4'));}if(typeof _0x333913!==_0xb022('0x5')||_0x333913[_0xb022('0x6')]===0x0){return _0x1f58b6(_0xb022('0x7'));}if(typeof _0x5327ac!=='undefined'&&(typeof _0x5327ac!==_0xb022('0x5')||_0x5327ac['length']===0x0)){return _0x1f58b6('lang\x20should\x20be\x20a\x20string');}try{_0x6e5925=fs['readFileSync'](_0x340392)[_0xb022('0x8')](_0xb022('0x9'));}catch(_0x22658c){return _0x1f58b6(_0x22658c);}return _0x34b8cf({'method':_0xb022('0xa'),'uri':host+'/v1/speech:recognize?key='+_0x333913,'body':{'config':{'encoding':_0xb022('0xb'),'sampleRateHertz':'8000','languageCode':_0x5327ac},'audio':{'content':_0x6e5925}},'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 ae591b9..72ea415 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 _0x3d70=['exports'];(function(_0xaadd25,_0x4b3fb7){var _0x3e11fe=function(_0x17f44c){while(--_0x17f44c){_0xaadd25['push'](_0xaadd25['shift']());}};_0x3e11fe(++_0x4b3fb7);}(_0x3d70,0xf6));var _0x03d7=function(_0x1b3564,_0x16c919){_0x1b3564=_0x1b3564-0x0;var _0x504069=_0x3d70[_0x1b3564];return _0x504069;};var asr=require('./asr');module[_0x03d7('0x0')]={'asr':asr}; \ No newline at end of file +var _0xbd3a=['exports','./asr'];(function(_0x33b816,_0x2e05d4){var _0x52fef7=function(_0xa2b3eb){while(--_0xa2b3eb){_0x33b816['push'](_0x33b816['shift']());}};_0x52fef7(++_0x2e05d4);}(_0xbd3a,0xb9));var _0xabd3=function(_0x56b926,_0x14f730){_0x56b926=_0x56b926-0x0;var _0x4f963f=_0xbd3a[_0x56b926];return _0x4f963f;};var asr=require(_0xabd3('0x0'));module[_0xabd3('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 6188059..9ee4e90 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 _0x5f2b=['voice','audioConfig','MP3','text:synthesize','POST','.mp3','audioContent','split','googleTTS','asr','uri','results','transcript','alternatives','join','map','confidence','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','actionIncomplete','fulfillment','speech','score','status','metadata','endConversation','isFallbackIntent','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','ispeechTTS','format','ispeechASR','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','path','http','https','url','parse','randomstring','sox','request-promise','util','apiai-promise','./google','./aws','./tilde','./sestek','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','data','transcode','wav','error\x20convert','finish\x20to\x20convert','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','input'];(function(_0x192eac,_0x26b7e1){var _0x36922a=function(_0x736632){while(--_0x736632){_0x192eac['push'](_0x192eac['shift']());}};_0x36922a(++_0x26b7e1);}(_0x5f2b,0x17a));var _0xb5f2=function(_0x30130f,_0x777421){_0x30130f=_0x30130f-0x0;var _0x44f220=_0x5f2b[_0x30130f];return _0x44f220;};'use strict';var fs=require('fs');var path=require(_0xb5f2('0x0'));var http=require(_0xb5f2('0x1'));var https=require(_0xb5f2('0x2'));var urlParse=require(_0xb5f2('0x3'))[_0xb5f2('0x4')];var BPromise=require('bluebird');var rs=require(_0xb5f2('0x5'));var sox=require(_0xb5f2('0x6'));var rp=require(_0xb5f2('0x7'));var util=require(_0xb5f2('0x8'));var querystring=require('querystring');var tts=require('google-tts-api');var apiai=require(_0xb5f2('0x9'));var md5=require('md5');var google=require(_0xb5f2('0xa'));var aws=require(_0xb5f2('0xb'));var tilde=require(_0xb5f2('0xc'));var sestek=require(_0xb5f2('0xd'));var logger=require(_0xb5f2('0xe'))('agi');var ISPEECH_API=_0xb5f2('0xf');function downloadFile(_0x289e9d,_0x21aac0){return new BPromise(function(_0x4eacef,_0xf1a60){var _0x2c9090=urlParse(_0x289e9d);var _0xe1cdf6=_0x2c9090[_0xb5f2('0x10')]===_0xb5f2('0x11')?https:http;var _0x25f12f={'host':_0x2c9090[_0xb5f2('0x12')],'path':_0x2c9090[_0xb5f2('0x0')],'headers':{'user-agent':_0xb5f2('0x13')}};_0xe1cdf6[_0xb5f2('0x14')](_0x25f12f,function(_0x5434f8){if(_0x5434f8[_0xb5f2('0x15')]!==0xc8){logger[_0xb5f2('0x16')](_0xb5f2('0x17')+_0x289e9d+_0xb5f2('0x18')+_0x5434f8[_0xb5f2('0x15')]+'\x20('+_0x5434f8[_0xb5f2('0x19')]+')');_0xf1a60(new Error(_0xb5f2('0x17')+_0x289e9d+_0xb5f2('0x18')+_0x5434f8[_0xb5f2('0x15')]+'\x20('+_0x5434f8[_0xb5f2('0x19')]+')'));return;}var _0x25a86c=fs[_0xb5f2('0x1a')](_0x21aac0);_0x25a86c['on'](_0xb5f2('0x1b'),function(){logger[_0xb5f2('0x1c')](_0xb5f2('0x1d'));_0x25a86c[_0xb5f2('0x1e')](_0x4eacef);});_0x25a86c['on'](_0xb5f2('0x16'),function(_0x2614c8){fs[_0xb5f2('0x1f')](_0x21aac0);logger[_0xb5f2('0x16')](_0xb5f2('0x20'),_0x2614c8);_0xf1a60(_0x2614c8);});_0x5434f8[_0xb5f2('0x21')](_0x25a86c);})['on']('error',function(_0x3f6571){logger['error'](_0x3f6571);_0xf1a60(_0x3f6571);})[_0xb5f2('0x22')]();});}function uploadFile(_0x704b9c){return new BPromise(function(_0x49dff4,_0x44ab1c){var _0x5c3c0a=urlParse(_0x704b9c);var _0x33b501=_0x5c3c0a[_0xb5f2('0x10')]===_0xb5f2('0x11')?https:http;var _0x56857e={'host':_0x5c3c0a[_0xb5f2('0x12')],'path':_0x5c3c0a[_0xb5f2('0x0')],'headers':{'user-agent':_0xb5f2('0x13')}};_0x33b501[_0xb5f2('0x14')](_0x56857e,function(_0x49e300){if(_0x49e300[_0xb5f2('0x15')]!==0xc8){_0x44ab1c(new Error('request\x20to\x20'+_0x704b9c+_0xb5f2('0x18')+_0x49e300[_0xb5f2('0x15')]+'\x20('+_0x49e300[_0xb5f2('0x19')]+')'));return;}var _0x15dc58='';_0x49e300['on'](_0xb5f2('0x23'),function(_0x22ecc9){_0x15dc58+=_0x22ecc9;});_0x49e300['on'](_0xb5f2('0x22'),function(){_0x49dff4(_0x15dc58);});})['on'](_0xb5f2('0x16'),function(_0x3dcb22){_0x44ab1c(_0x3dcb22);})[_0xb5f2('0x22')]();});}function convertFile(_0x61a533,_0x31af39){return new BPromise(function(_0x239d17,_0x10e0bb){var _0x590863=sox[_0xb5f2('0x24')](_0x61a533,_0x31af39,{'sampleRate':0x1f40,'format':_0xb5f2('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x590863['on'](_0xb5f2('0x16'),function(_0xeb984f){logger[_0xb5f2('0x16')](_0xb5f2('0x26'),_0xeb984f);_0x10e0bb(_0xeb984f);});_0x590863['on'](_0xb5f2('0x22'),function(){logger[_0xb5f2('0x1c')](_0xb5f2('0x27'));_0x239d17();});_0x590863['start']();});}function base64Decode(_0x399eef,_0x437627){var _0x17c95c=path[_0xb5f2('0x28')](__dirname,_0xb5f2('0x29'),rs[_0xb5f2('0x2a')](0x4)+_0xb5f2('0x2b'));fs[_0xb5f2('0x2c')](_0x17c95c,_0x399eef,_0xb5f2('0x2d'));return convertFile(_0x17c95c,_0x437627)[_0xb5f2('0x2e')](function(){try{fs[_0xb5f2('0x1f')](_0x17c95c);fs[_0xb5f2('0x2f')](_0x437627,_0xb5f2('0x30'));}catch(_0x5b6798){logger[_0xb5f2('0x16')](_0x5b6798);}return _0x437627['split']('.')[0x0];});}function base64Encode(_0x4edaa6){var _0x51f242=fs[_0xb5f2('0x31')](_0x4edaa6);return new Buffer(_0x51f242)[_0xb5f2('0x32')]('base64');}exports['googleCloudTTS']=function(_0x1ca328,_0x5bb113,_0x446921,_0x2f6898,_0x151702,_0x4be28f){var _0x407f25,_0x122c6d;var _0x2e093c=_0xb5f2('0x33');var _0x11f26d=_0xb5f2('0x34')+_0x1ca328;var _0x1643d6={};if(_0x5bb113==='ssml'){_0x1643d6[_0xb5f2('0x35')]={'ssml':_0x446921};}else{_0x1643d6[_0xb5f2('0x35')]={'text':_0x446921};};_0x1643d6[_0xb5f2('0x36')]={'languageCode':_0x2f6898,'ssmlGender':_0x151702};_0x1643d6[_0xb5f2('0x37')]={'audioEncoding':_0xb5f2('0x38'),'sampleRateHertz':0x1f40};var _0x3b2c3b={'url':_0x2e093c+_0xb5f2('0x39')+_0x11f26d,'method':_0xb5f2('0x3a'),'json':!![],'body':_0x1643d6};return rp(_0x3b2c3b)['then'](function(_0x378115){return new BPromise(function(_0x1e5af5,_0x5a328a){_0x407f25=path[_0xb5f2('0x28')](__dirname,_0xb5f2('0x29'),rs[_0xb5f2('0x2a')](0x4)+_0xb5f2('0x3b'));var _0x2df418=Buffer['from'](_0x378115[_0xb5f2('0x3c')],_0xb5f2('0x2d'));return fs['writeFile'](_0x407f25,_0x2df418,function(_0x9196f0){_0x5a328a(_0x9196f0);},function(_0x21124f){fs['chmodSync'](_0x407f25,_0xb5f2('0x30'));_0x1e5af5(_0x21124f);});});})[_0xb5f2('0x2e')](function(_0x45ecdc){_0x122c6d=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+'.wav');return convertFile(_0x407f25,_0x122c6d);})['then'](function(){try{fs[_0xb5f2('0x1f')](_0x407f25);fs[_0xb5f2('0x2f')](_0x122c6d,_0xb5f2('0x30'));}catch(_0x401848){logger['error'](_0x401848);}logger[_0xb5f2('0x1c')]('googleCloudTTS\x20path',_0x122c6d['split']('.')[0x0]);return _0x122c6d[_0xb5f2('0x3d')]('.')[0x0];});};exports[_0xb5f2('0x3e')]=function(_0x14e14d,_0x3bfa88){var _0xa2c23f,_0x56c2a5;return tts(_0x14e14d,_0x3bfa88||'en',0x1)[_0xb5f2('0x2e')](function(_0x47ca6a){logger['info'](_0x47ca6a);_0xa2c23f=path[_0xb5f2('0x28')](__dirname,'tmp',rs[_0xb5f2('0x2a')](0x4)+_0xb5f2('0x3b'));return downloadFile(_0x47ca6a,_0xa2c23f);})[_0xb5f2('0x2e')](function(){_0x56c2a5=path[_0xb5f2('0x28')](__dirname,_0xb5f2('0x29'),rs[_0xb5f2('0x2a')](0x4)+_0xb5f2('0x2b'));return convertFile(_0xa2c23f,_0x56c2a5);})[_0xb5f2('0x2e')](function(){try{fs[_0xb5f2('0x1f')](_0xa2c23f);fs[_0xb5f2('0x2f')](_0x56c2a5,_0xb5f2('0x30'));}catch(_0x253716){logger[_0xb5f2('0x16')](_0x253716);}logger['info']('goggleTTS\x20path',_0x56c2a5['split']('.')[0x0]);return _0x56c2a5[_0xb5f2('0x3d')]('.')[0x0];});};exports['googleASR']=function(_0x4fb274,_0x1369a2,_0x4da275){return google[_0xb5f2('0x3f')](_0x4fb274,_0x1369a2,_0x4da275)[_0xb5f2('0x2e')](function(_0x2c9311){logger[_0xb5f2('0x1c')](_0x2c9311[_0xb5f2('0x40')]);return rp(_0x2c9311);})[_0xb5f2('0x2e')](function(_0x24f132){var _0x24505f='';var _0x411a2e=0x0;try{fs[_0xb5f2('0x1f')](_0x4fb274);}catch(_0x25d2db){logger[_0xb5f2('0x16')](_0x25d2db);}if(_0x24f132&&_0x24f132[_0xb5f2('0x41')]){_0x24505f=_0x24f132['results']['map'](function(_0x2a5dee){return _0x2a5dee&&_0x2a5dee['alternatives'][0x0]&&_0x2a5dee['alternatives'][0x0][_0xb5f2('0x42')]?_0x2a5dee[_0xb5f2('0x43')][0x0]['transcript']:'';})[_0xb5f2('0x44')]('\x0a');_0x411a2e=_0x24f132[_0xb5f2('0x41')][_0xb5f2('0x45')](function(_0x5b58ed){return _0x5b58ed&&_0x5b58ed[_0xb5f2('0x43')][0x0]&&_0x5b58ed[_0xb5f2('0x43')][0x0][_0xb5f2('0x46')]?_0x5b58ed[_0xb5f2('0x43')][0x0]['confidence']:0x0;})[_0xb5f2('0x44')]('\x0a');}logger[_0xb5f2('0x1c')]('googleASR\x20transcription',_0x24505f);logger[_0xb5f2('0x1c')](_0xb5f2('0x47'),_0x411a2e);return{'transcript':_0x24505f,'confidence':_0x411a2e};})[_0xb5f2('0x48')](function(_0x6235ee){logger[_0xb5f2('0x16')](_0xb5f2('0x49'),_0x6235ee[_0xb5f2('0x15')],_0x6235ee[_0xb5f2('0x4a')],_0x6235ee[_0xb5f2('0x4b')]);});};exports[_0xb5f2('0x4c')]=function(_0x40defe,_0x50def0,_0x1eac29,_0x1747d5){var _0x408a45=apiai(_0x50def0,{'language':_0x1747d5||'en'});return _0x408a45[_0xb5f2('0x4d')](_0x1eac29,{'sessionId':md5(_0x40defe)})[_0xb5f2('0x2e')](function(_0x3b9caf){logger[_0xb5f2('0x1c')](JSON[_0xb5f2('0x4e')](_0x3b9caf));return{'source':_0x3b9caf[_0xb5f2('0x4f')][_0xb5f2('0x50')],'resolvedQuery':_0x3b9caf[_0xb5f2('0x4f')][_0xb5f2('0x51')],'action':_0x3b9caf[_0xb5f2('0x4f')]['action'],'actionIncomplete':_0x3b9caf['result'][_0xb5f2('0x52')],'speech':_0x3b9caf['result'][_0xb5f2('0x53')][_0xb5f2('0x54')],'score':_0x3b9caf[_0xb5f2('0x4f')][_0xb5f2('0x55')],'statusCode':_0x3b9caf[_0xb5f2('0x56')]['code'],'endConversation':_0x3b9caf[_0xb5f2('0x4f')][_0xb5f2('0x57')][_0xb5f2('0x58')]||![],'isFallbackIntent':_0x3b9caf[_0xb5f2('0x4f')][_0xb5f2('0x57')][_0xb5f2('0x59')]};});};exports['tildeASR']=function(_0x4f82e7,_0x557379,_0x5d34e1,_0x319f14){return tilde[_0xb5f2('0x3f')](_0x4f82e7,_0x557379,_0x5d34e1,_0x319f14)['then'](function(_0x35ef3e){try{fs[_0xb5f2('0x1f')](_0x4f82e7);}catch(_0x2a4d2c){logger[_0xb5f2('0x16')](_0x2a4d2c);}logger[_0xb5f2('0x1c')](_0xb5f2('0x5a'),_0x35ef3e['transcript']);logger['info'](_0xb5f2('0x5b'),_0x35ef3e[_0xb5f2('0x46')]);return _0x35ef3e;});};exports['awsPolly']=function(_0x188c62,_0x473dcc,_0xb99f3c,_0x1995e2,_0xcb005e,_0x3a7dba){var _0x14f390=path[_0xb5f2('0x28')](__dirname,_0xb5f2('0x29'),rs[_0xb5f2('0x2a')](0x4)+'.mp3');var _0x147df4;return aws[_0xb5f2('0x5c')](_0x188c62,_0x473dcc,_0xb99f3c,_0x1995e2,_0xcb005e,_0x3a7dba,_0x14f390)[_0xb5f2('0x2e')](function(){_0x147df4=path[_0xb5f2('0x28')](__dirname,_0xb5f2('0x29'),rs['generate'](0x4)+'.wav');return convertFile(_0x14f390,_0x147df4);})[_0xb5f2('0x2e')](function(){try{fs['unlink'](_0x14f390);fs['chmodSync'](_0x147df4,_0xb5f2('0x30'));}catch(_0x4bd05d){logger[_0xb5f2('0x16')](_0x4bd05d);}return _0x147df4[_0xb5f2('0x3d')]('.')[0x0];});};exports[_0xb5f2('0x5d')]=function(_0x26bf2d,_0x5dc250,_0x51faea,_0x80d444,_0x5d6520,_0x41b96f){return aws['lex'](_0x26bf2d,_0x5dc250,_0x51faea,_0x80d444,_0x5d6520,_0x41b96f)[_0xb5f2('0x2e')](function(_0x30eb22){logger[_0xb5f2('0x1c')](JSON[_0xb5f2('0x4e')](_0x30eb22));return _0x30eb22;});};exports[_0xb5f2('0x5e')]=function(_0x51b225,_0x4c7362,_0x3579e3,_0x3a3609){var _0x3a6763=util[_0xb5f2('0x5f')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x51b225,encodeURIComponent(_0x4c7362),_0x3579e3,_0x3a3609);var _0x223086=path[_0xb5f2('0x28')](__dirname,'tmp',rs['generate'](0x4)+_0xb5f2('0x3b'));var _0x5a7dab;return downloadFile(_0x3a6763,_0x223086)[_0xb5f2('0x2e')](function(){_0x5a7dab=path[_0xb5f2('0x28')](__dirname,_0xb5f2('0x29'),rs[_0xb5f2('0x2a')](0x4)+_0xb5f2('0x2b'));return convertFile(_0x223086,_0x5a7dab);})[_0xb5f2('0x2e')](function(){try{fs[_0xb5f2('0x1f')](_0x223086);fs[_0xb5f2('0x2f')](_0x5a7dab,'777');}catch(_0x2d75dc){logger[_0xb5f2('0x16')](_0x2d75dc);}return _0x5a7dab[_0xb5f2('0x3d')]('.')[0x0];});};exports[_0xb5f2('0x60')]=function(_0x18cd59,_0xb19dbd,_0x4d4bf3,_0x4f110a){var _0x219a01=util[_0xb5f2('0x5f')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0xb19dbd,_0x4d4bf3,base64Encode(_0x18cd59),_0x4f110a?util[_0xb5f2('0x5f')]('model=%s',encodeURIComponent(_0x4f110a)):_0xb5f2('0x61'));return uploadFile(_0x219a01)['then'](function(_0x1e130e){return querystring[_0xb5f2('0x4')](_0x1e130e);});};exports[_0xb5f2('0x62')]=function(_0x431ddc,_0x22e6fd){return sestek[_0xb5f2('0x63')](_0x431ddc,_0x22e6fd)[_0xb5f2('0x2e')](function(_0xe9811f){logger[_0xb5f2('0x1c')](JSON['stringify'](_0xe9811f));var _0x35394b={'speech':_0xe9811f[_0xb5f2('0x64')],'action':_0xe9811f[_0xb5f2('0x65')]?_0xe9811f[_0xb5f2('0x65')][_0xb5f2('0x66')]:undefined,'actiondata':_0xe9811f[_0xb5f2('0x65')]?_0xe9811f[_0xb5f2('0x65')][_0xb5f2('0x67')]:undefined};if(_0xe9811f[_0xb5f2('0x65')]&&_0xe9811f[_0xb5f2('0x65')][_0xb5f2('0x68')]){return base64Decode(_0xe9811f[_0xb5f2('0x65')][_0xb5f2('0x68')][_0xb5f2('0x69')],path['resolve'](__dirname,'tmp',rs[_0xb5f2('0x2a')](0x4)+_0xb5f2('0x2b')))[_0xb5f2('0x2e')](function(_0x388369){_0x35394b[_0xb5f2('0x6a')]=_0x388369;return _0x35394b;});}return _0x35394b;});};exports[_0xb5f2('0x6b')]=function(){return __dirname;}; \ No newline at end of file +var _0xadb1=['googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','generate','googleASR','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','textRequest','source','result','resolvedQuery','action','actionIncomplete','speech','score','code','metadata','endConversation','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','stringify','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','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','path','http','https','url','parse','bluebird','randomstring','sox','request-promise','querystring','google-tts-api','apiai-promise','md5','./google','./aws','./sestek','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','error','unlink','download\x20error','end','get','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync'];(function(_0x32d72d,_0x2d7ac3){var _0x4fdb4a=function(_0xf60d53){while(--_0xf60d53){_0x32d72d['push'](_0x32d72d['shift']());}};_0x4fdb4a(++_0x2d7ac3);}(_0xadb1,0x1f0));var _0x1adb=function(_0x2d4a2c,_0x559d2f){_0x2d4a2c=_0x2d4a2c-0x0;var _0xab020a=_0xadb1[_0x2d4a2c];return _0xab020a;};'use strict';var fs=require('fs');var path=require(_0x1adb('0x0'));var http=require(_0x1adb('0x1'));var https=require(_0x1adb('0x2'));var urlParse=require(_0x1adb('0x3'))[_0x1adb('0x4')];var BPromise=require(_0x1adb('0x5'));var rs=require(_0x1adb('0x6'));var sox=require(_0x1adb('0x7'));var rp=require(_0x1adb('0x8'));var util=require('util');var querystring=require(_0x1adb('0x9'));var tts=require(_0x1adb('0xa'));var apiai=require(_0x1adb('0xb'));var md5=require(_0x1adb('0xc'));var google=require(_0x1adb('0xd'));var aws=require(_0x1adb('0xe'));var tilde=require('./tilde');var sestek=require(_0x1adb('0xf'));var logger=require(_0x1adb('0x10'))('agi');var ISPEECH_API=_0x1adb('0x11');function downloadFile(_0x4715f6,_0x3e62d0){return new BPromise(function(_0x2e9ee2,_0x2f819f){var _0x5d8665=urlParse(_0x4715f6);var _0x14362e=_0x5d8665[_0x1adb('0x12')]===_0x1adb('0x13')?https:http;var _0x389685={'host':_0x5d8665[_0x1adb('0x14')],'path':_0x5d8665[_0x1adb('0x0')],'headers':{'user-agent':_0x1adb('0x15')}};_0x14362e['get'](_0x389685,function(_0x5c23c4){if(_0x5c23c4[_0x1adb('0x16')]!==0xc8){logger['error'](_0x1adb('0x17')+_0x4715f6+_0x1adb('0x18')+_0x5c23c4[_0x1adb('0x16')]+'\x20('+_0x5c23c4[_0x1adb('0x19')]+')');_0x2f819f(new Error(_0x1adb('0x17')+_0x4715f6+'\x20failed,\x20status\x20code\x20=\x20'+_0x5c23c4['statusCode']+'\x20('+_0x5c23c4[_0x1adb('0x19')]+')'));return;}var _0x2f17b7=fs[_0x1adb('0x1a')](_0x3e62d0);_0x2f17b7['on']('finish',function(){logger[_0x1adb('0x1b')](_0x1adb('0x1c'));_0x2f17b7['close'](_0x2e9ee2);});_0x2f17b7['on'](_0x1adb('0x1d'),function(_0x54477b){fs[_0x1adb('0x1e')](_0x3e62d0);logger[_0x1adb('0x1d')](_0x1adb('0x1f'),_0x54477b);_0x2f819f(_0x54477b);});_0x5c23c4['pipe'](_0x2f17b7);})['on'](_0x1adb('0x1d'),function(_0x4c806e){logger[_0x1adb('0x1d')](_0x4c806e);_0x2f819f(_0x4c806e);})[_0x1adb('0x20')]();});}function uploadFile(_0x5db895){return new BPromise(function(_0x364c7d,_0x1136bd){var _0x58ee05=urlParse(_0x5db895);var _0x38f694=_0x58ee05['protocol']===_0x1adb('0x13')?https:http;var _0x175772={'host':_0x58ee05[_0x1adb('0x14')],'path':_0x58ee05[_0x1adb('0x0')],'headers':{'user-agent':'WHAT_EVER'}};_0x38f694[_0x1adb('0x21')](_0x175772,function(_0x7e24de){if(_0x7e24de[_0x1adb('0x16')]!==0xc8){_0x1136bd(new Error(_0x1adb('0x17')+_0x5db895+_0x1adb('0x18')+_0x7e24de[_0x1adb('0x16')]+'\x20('+_0x7e24de[_0x1adb('0x19')]+')'));return;}var _0x10265a='';_0x7e24de['on']('data',function(_0x2383ff){_0x10265a+=_0x2383ff;});_0x7e24de['on']('end',function(){_0x364c7d(_0x10265a);});})['on']('error',function(_0xa22301){_0x1136bd(_0xa22301);})['end']();});}function convertFile(_0x48b2d1,_0x5f5381){return new BPromise(function(_0x565e38,_0x4b60f1){var _0x3a7724=sox[_0x1adb('0x22')](_0x48b2d1,_0x5f5381,{'sampleRate':0x1f40,'format':_0x1adb('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3a7724['on']('error',function(_0x39b35f){logger[_0x1adb('0x1d')](_0x1adb('0x24'),_0x39b35f);_0x4b60f1(_0x39b35f);});_0x3a7724['on'](_0x1adb('0x20'),function(){logger[_0x1adb('0x1b')](_0x1adb('0x25'));_0x565e38();});_0x3a7724[_0x1adb('0x26')]();});}function base64Decode(_0x412cd1,_0x17c3dd){var _0x56c93a=path[_0x1adb('0x27')](__dirname,_0x1adb('0x28'),rs['generate'](0x4)+_0x1adb('0x29'));fs[_0x1adb('0x2a')](_0x56c93a,_0x412cd1,_0x1adb('0x2b'));return convertFile(_0x56c93a,_0x17c3dd)[_0x1adb('0x2c')](function(){try{fs[_0x1adb('0x1e')](_0x56c93a);fs[_0x1adb('0x2d')](_0x17c3dd,_0x1adb('0x2e'));}catch(_0x8ba0e0){logger[_0x1adb('0x1d')](_0x8ba0e0);}return _0x17c3dd[_0x1adb('0x2f')]('.')[0x0];});}function base64Encode(_0x2a8427){var _0x410543=fs[_0x1adb('0x30')](_0x2a8427);return new Buffer(_0x410543)['toString'](_0x1adb('0x2b'));}exports[_0x1adb('0x31')]=function(_0x5023af,_0x4f3a18,_0x2f46a6,_0x43886c,_0x5dd314,_0xde93f4){var _0x5a7ac1,_0x1aeb67;var _0x1f3521=_0x1adb('0x32');var _0x51279a=_0x1adb('0x33')+_0x5023af;var _0x468436={};if(_0x4f3a18==='ssml'){_0x468436[_0x1adb('0x34')]={'ssml':_0x2f46a6};}else{_0x468436[_0x1adb('0x34')]={'text':_0x2f46a6};};_0x468436[_0x1adb('0x35')]={'languageCode':_0x43886c,'ssmlGender':_0x5dd314};_0x468436[_0x1adb('0x36')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x19633e={'url':_0x1f3521+'text:synthesize'+_0x51279a,'method':'POST','json':!![],'body':_0x468436};return rp(_0x19633e)[_0x1adb('0x2c')](function(_0x508100){return new BPromise(function(_0x1449c1,_0x1be711){_0x5a7ac1=path[_0x1adb('0x27')](__dirname,_0x1adb('0x28'),rs['generate'](0x4)+_0x1adb('0x37'));var _0x21c6cc=Buffer[_0x1adb('0x38')](_0x508100[_0x1adb('0x39')],_0x1adb('0x2b'));return fs[_0x1adb('0x3a')](_0x5a7ac1,_0x21c6cc,function(_0x36a2a2){_0x1be711(_0x36a2a2);},function(_0x268363){fs[_0x1adb('0x2d')](_0x5a7ac1,_0x1adb('0x2e'));_0x1449c1(_0x268363);});});})[_0x1adb('0x2c')](function(_0x3bb00c){_0x1aeb67=path[_0x1adb('0x27')](__dirname,_0x1adb('0x28'),rs['generate'](0x4)+_0x1adb('0x29'));return convertFile(_0x5a7ac1,_0x1aeb67);})[_0x1adb('0x2c')](function(){try{fs['unlink'](_0x5a7ac1);fs[_0x1adb('0x2d')](_0x1aeb67,_0x1adb('0x2e'));}catch(_0x3005bb){logger[_0x1adb('0x1d')](_0x3005bb);}logger[_0x1adb('0x1b')](_0x1adb('0x3b'),_0x1aeb67['split']('.')[0x0]);return _0x1aeb67[_0x1adb('0x2f')]('.')[0x0];});};exports[_0x1adb('0x3c')]=function(_0x39e398,_0x1a11b8){var _0xb792e8,_0x15f056;return tts(_0x39e398,_0x1a11b8||'en',0x1)[_0x1adb('0x2c')](function(_0x488a8c){logger[_0x1adb('0x1b')](_0x488a8c);_0xb792e8=path[_0x1adb('0x27')](__dirname,_0x1adb('0x28'),rs['generate'](0x4)+_0x1adb('0x37'));return downloadFile(_0x488a8c,_0xb792e8);})[_0x1adb('0x2c')](function(){_0x15f056=path[_0x1adb('0x27')](__dirname,_0x1adb('0x28'),rs[_0x1adb('0x3d')](0x4)+_0x1adb('0x29'));return convertFile(_0xb792e8,_0x15f056);})[_0x1adb('0x2c')](function(){try{fs[_0x1adb('0x1e')](_0xb792e8);fs[_0x1adb('0x2d')](_0x15f056,_0x1adb('0x2e'));}catch(_0x4de16f){logger['error'](_0x4de16f);}logger[_0x1adb('0x1b')]('goggleTTS\x20path',_0x15f056[_0x1adb('0x2f')]('.')[0x0]);return _0x15f056[_0x1adb('0x2f')]('.')[0x0];});};exports[_0x1adb('0x3e')]=function(_0x5655e2,_0xc5e26b,_0x4b04fd){return google['asr'](_0x5655e2,_0xc5e26b,_0x4b04fd)[_0x1adb('0x2c')](function(_0x222b92){logger[_0x1adb('0x1b')](_0x222b92[_0x1adb('0x3f')]);return rp(_0x222b92);})['then'](function(_0x2540bc){var _0x75937e='';var _0x3902c4=0x0;try{fs[_0x1adb('0x1e')](_0x5655e2);}catch(_0x24e98b){logger[_0x1adb('0x1d')](_0x24e98b);}if(_0x2540bc&&_0x2540bc[_0x1adb('0x40')]){_0x75937e=_0x2540bc[_0x1adb('0x40')]['map'](function(_0x4eec6a){return _0x4eec6a&&_0x4eec6a[_0x1adb('0x41')][0x0]&&_0x4eec6a[_0x1adb('0x41')][0x0]['transcript']?_0x4eec6a[_0x1adb('0x41')][0x0][_0x1adb('0x42')]:'';})[_0x1adb('0x43')]('\x0a');_0x3902c4=_0x2540bc['results'][_0x1adb('0x44')](function(_0x308c4f){return _0x308c4f&&_0x308c4f[_0x1adb('0x41')][0x0]&&_0x308c4f[_0x1adb('0x41')][0x0][_0x1adb('0x45')]?_0x308c4f['alternatives'][0x0][_0x1adb('0x45')]:0x0;})[_0x1adb('0x43')]('\x0a');}logger['info'](_0x1adb('0x46'),_0x75937e);logger[_0x1adb('0x1b')]('googleASR\x20confidence',_0x3902c4);return{'transcript':_0x75937e,'confidence':_0x3902c4};})[_0x1adb('0x47')](function(_0x2c9cda){logger['error'](_0x1adb('0x48'),_0x2c9cda[_0x1adb('0x16')],_0x2c9cda[_0x1adb('0x49')],_0x2c9cda[_0x1adb('0x4a')]);});};exports['googleDialogflow']=function(_0x53d144,_0x161977,_0x392f6f,_0x3a6091){var _0xe5bef6=apiai(_0x161977,{'language':_0x3a6091||'en'});return _0xe5bef6[_0x1adb('0x4b')](_0x392f6f,{'sessionId':md5(_0x53d144)})[_0x1adb('0x2c')](function(_0x1a4e2a){logger[_0x1adb('0x1b')](JSON['stringify'](_0x1a4e2a));return{'source':_0x1a4e2a['result'][_0x1adb('0x4c')],'resolvedQuery':_0x1a4e2a[_0x1adb('0x4d')][_0x1adb('0x4e')],'action':_0x1a4e2a[_0x1adb('0x4d')][_0x1adb('0x4f')],'actionIncomplete':_0x1a4e2a[_0x1adb('0x4d')][_0x1adb('0x50')],'speech':_0x1a4e2a[_0x1adb('0x4d')]['fulfillment'][_0x1adb('0x51')],'score':_0x1a4e2a[_0x1adb('0x4d')][_0x1adb('0x52')],'statusCode':_0x1a4e2a['status'][_0x1adb('0x53')],'endConversation':_0x1a4e2a['result'][_0x1adb('0x54')][_0x1adb('0x55')]||![],'isFallbackIntent':_0x1a4e2a['result'][_0x1adb('0x54')]['isFallbackIntent']};});};exports[_0x1adb('0x56')]=function(_0x2b79f8,_0x12c59b,_0x380767,_0x2b9ef2){return tilde['asr'](_0x2b79f8,_0x12c59b,_0x380767,_0x2b9ef2)[_0x1adb('0x2c')](function(_0x234271){try{fs[_0x1adb('0x1e')](_0x2b79f8);}catch(_0x57eca6){logger[_0x1adb('0x1d')](_0x57eca6);}logger[_0x1adb('0x1b')]('Tilde\x20ASR\x20transcription',_0x234271[_0x1adb('0x42')]);logger[_0x1adb('0x1b')](_0x1adb('0x57'),_0x234271[_0x1adb('0x45')]);return _0x234271;});};exports[_0x1adb('0x58')]=function(_0x31db63,_0x1e2825,_0x281f09,_0x2b576f,_0x188893,_0x4e09b8){var _0x12e83d=path[_0x1adb('0x27')](__dirname,_0x1adb('0x28'),rs[_0x1adb('0x3d')](0x4)+'.mp3');var _0x3129e8;return aws[_0x1adb('0x59')](_0x31db63,_0x1e2825,_0x281f09,_0x2b576f,_0x188893,_0x4e09b8,_0x12e83d)[_0x1adb('0x2c')](function(){_0x3129e8=path[_0x1adb('0x27')](__dirname,_0x1adb('0x28'),rs[_0x1adb('0x3d')](0x4)+_0x1adb('0x29'));return convertFile(_0x12e83d,_0x3129e8);})[_0x1adb('0x2c')](function(){try{fs[_0x1adb('0x1e')](_0x12e83d);fs[_0x1adb('0x2d')](_0x3129e8,_0x1adb('0x2e'));}catch(_0x2a783a){logger[_0x1adb('0x1d')](_0x2a783a);}return _0x3129e8[_0x1adb('0x2f')]('.')[0x0];});};exports[_0x1adb('0x5a')]=function(_0x3c29bf,_0x3b0ad2,_0x1daf92,_0x5205d7,_0x3fdd78,_0x482128){return aws['lex'](_0x3c29bf,_0x3b0ad2,_0x1daf92,_0x5205d7,_0x3fdd78,_0x482128)[_0x1adb('0x2c')](function(_0x278f93){logger['info'](JSON[_0x1adb('0x5b')](_0x278f93));return _0x278f93;});};exports[_0x1adb('0x5c')]=function(_0x4d68ca,_0xe808e6,_0x22748b,_0x30eec3){var _0x134496=util[_0x1adb('0x5d')](_0x1adb('0x5e'),ISPEECH_API,_0x4d68ca,encodeURIComponent(_0xe808e6),_0x22748b,_0x30eec3);var _0x3d0642=path['resolve'](__dirname,_0x1adb('0x28'),rs[_0x1adb('0x3d')](0x4)+_0x1adb('0x37'));var _0x35f914;return downloadFile(_0x134496,_0x3d0642)[_0x1adb('0x2c')](function(){_0x35f914=path[_0x1adb('0x27')](__dirname,_0x1adb('0x28'),rs[_0x1adb('0x3d')](0x4)+_0x1adb('0x29'));return convertFile(_0x3d0642,_0x35f914);})[_0x1adb('0x2c')](function(){try{fs[_0x1adb('0x1e')](_0x3d0642);fs['chmodSync'](_0x35f914,'777');}catch(_0x5dfbe3){logger[_0x1adb('0x1d')](_0x5dfbe3);}return _0x35f914[_0x1adb('0x2f')]('.')[0x0];});};exports[_0x1adb('0x5f')]=function(_0x4673d2,_0x558ecc,_0x2a36e3,_0x4f6c9e){var _0xb4ceb=util['format'](_0x1adb('0x60'),ISPEECH_API,_0x558ecc,_0x2a36e3,base64Encode(_0x4673d2),_0x4f6c9e?util[_0x1adb('0x5d')](_0x1adb('0x61'),encodeURIComponent(_0x4f6c9e)):_0x1adb('0x62'));return uploadFile(_0xb4ceb)[_0x1adb('0x2c')](function(_0x562440){return querystring[_0x1adb('0x4')](_0x562440);});};exports[_0x1adb('0x63')]=function(_0x46b7d5,_0xaacbaf){return sestek[_0x1adb('0x64')](_0x46b7d5,_0xaacbaf)[_0x1adb('0x2c')](function(_0x55f02d){logger[_0x1adb('0x1b')](JSON[_0x1adb('0x5b')](_0x55f02d));var _0x550f87={'speech':_0x55f02d[_0x1adb('0x65')],'action':_0x55f02d[_0x1adb('0x66')]?_0x55f02d[_0x1adb('0x66')][_0x1adb('0x67')]:undefined,'actiondata':_0x55f02d[_0x1adb('0x66')]?_0x55f02d[_0x1adb('0x66')][_0x1adb('0x68')]:undefined};if(_0x55f02d[_0x1adb('0x66')]&&_0x55f02d['channelData']['AudioFromTts']){return base64Decode(_0x55f02d[_0x1adb('0x66')][_0x1adb('0x69')][_0x1adb('0x6a')],path['resolve'](__dirname,_0x1adb('0x28'),rs[_0x1adb('0x3d')](0x4)+'.wav'))[_0x1adb('0x2c')](function(_0x664591){_0x550f87[_0x1adb('0x6b')]=_0x664591;return _0x550f87;});}return _0x550f87;});};exports[_0x1adb('0x6c')]=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 ebf2f27..4cebbca 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 _0x1327=['./nda','exports'];(function(_0x3db1f7,_0x2beb9b){var _0x5016ed=function(_0x344ece){while(--_0x344ece){_0x3db1f7['push'](_0x3db1f7['shift']());}};_0x5016ed(++_0x2beb9b);}(_0x1327,0x17c));var _0x7132=function(_0x5fc0b9,_0x3a90ec){_0x5fc0b9=_0x5fc0b9-0x0;var _0xa7cbdf=_0x1327[_0x5fc0b9];return _0xa7cbdf;};var nda=require(_0x7132('0x0'));module[_0x7132('0x1')]={'nda':nda}; \ No newline at end of file +var _0xb069=['./nda','exports'];(function(_0x349c4f,_0x4f29dc){var _0x545b18=function(_0x2b5058){while(--_0x2b5058){_0x349c4f['push'](_0x349c4f['shift']());}};_0x545b18(++_0x4f29dc);}(_0xb069,0x1c2));var _0x9b06=function(_0x1d8806,_0x9630f8){_0x1d8806=_0x1d8806-0x0;var _0xaa535b=_0xb069[_0x1d8806];return _0xaa535b;};var nda=require(_0x9b06('0x0'));module[_0x9b06('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 f52ceb5..e158461 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 _0x2deb=['custom_action_data','CustomActionData','info','request-promise','url','../../../../../config/logger','agi','POST','resolve','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','extension','text','Bearer\x20','project','body','channelData','AudioOutputSettings','audio/wav','custom_action','CustomAction'];(function(_0x5f49c0,_0x27a1b4){var _0x5ab653=function(_0x4de962){while(--_0x4de962){_0x5f49c0['push'](_0x5f49c0['shift']());}};_0x5ab653(++_0x27a1b4);}(_0x2deb,0xdb));var _0xb2de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2deb[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0xb2de('0x0'));var url=require(_0xb2de('0x1'));var logger=require(_0xb2de('0x2'))(_0xb2de('0x3'));module['exports']=function(_0x48edfe,_0x2bce08){var _0x1eaf6f={'method':_0xb2de('0x4'),'uri':url[_0xb2de('0x5')](_0x2bce08['ndauth_url'],'/token'),'form':{'grant_type':_0xb2de('0x6'),'username':_0x2bce08[_0xb2de('0x7')],'password':_0x2bce08[_0xb2de('0x6')]},'json':!![]};return rp(_0x1eaf6f)['then'](function(_0x253d0b){var _0x1a4c44={'method':'POST','uri':url[_0xb2de('0x5')](_0x2bce08[_0xb2de('0x8')],_0xb2de('0x9')),'body':{'type':_0x2bce08['ndaactivity_type']||_0xb2de('0xa'),'channelId':_0xb2de('0xb'),'conversation':{'id':_0x48edfe[_0xb2de('0xc')]},'from':{'id':_0x48edfe[_0xb2de('0xd')],'name':_0x48edfe['calleridname']},'recipient':{'id':_0x48edfe['dnid'],'name':_0x48edfe[_0xb2de('0xe')]},'text':_0x2bce08[_0xb2de('0xf')],'channelData':{}},'headers':{'Authorization':_0xb2de('0x10')+_0x253d0b['access_token']},'json':!![]};if(_0x2bce08[_0xb2de('0x11')]){_0x1a4c44[_0xb2de('0x12')][_0xb2de('0x13')]['ProjectName']=_0x2bce08[_0xb2de('0x11')];}if(_0x2bce08['ndagenerate_audio']=='1'){_0x1a4c44[_0xb2de('0x12')]['channelData'][_0xb2de('0x14')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xb2de('0x15')};}if(_0x2bce08[_0xb2de('0x16')]){_0x1a4c44['body'][_0xb2de('0x13')][_0xb2de('0x17')]=_0x2bce08[_0xb2de('0x16')];if(_0x2bce08[_0xb2de('0x18')]){_0x1a4c44[_0xb2de('0x12')][_0xb2de('0x13')][_0xb2de('0x19')]=_0x2bce08[_0xb2de('0x18')];}}logger[_0xb2de('0x1a')](JSON['stringify'](_0x1a4c44));return rp(_0x1a4c44);});}; \ No newline at end of file +var _0xa388=['project','channelData','ProjectName','ndagenerate_audio','body','AudioOutputSettings','audio/wav','custom_action','CustomAction','CustomActionData','custom_action_data','info','stringify','request-promise','agi','resolve','ndauth_url','username','password','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','callerid','calleridname','dnid','text','Bearer\x20','access_token'];(function(_0x474709,_0x45a22d){var _0x243a15=function(_0x30af06){while(--_0x30af06){_0x474709['push'](_0x474709['shift']());}};_0x243a15(++_0x45a22d);}(_0xa388,0x10d));var _0x8a38=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa388[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0x8a38('0x0'));var url=require('url');var logger=require('../../../../../config/logger')(_0x8a38('0x1'));module['exports']=function(_0x273eba,_0x444c2e){var _0xff61e8={'method':'POST','uri':url[_0x8a38('0x2')](_0x444c2e[_0x8a38('0x3')],'/token'),'form':{'grant_type':'password','username':_0x444c2e[_0x8a38('0x4')],'password':_0x444c2e[_0x8a38('0x5')]},'json':!![]};return rp(_0xff61e8)[_0x8a38('0x6')](function(_0x2b8260){var _0x382fb5={'method':_0x8a38('0x7'),'uri':url[_0x8a38('0x2')](_0x444c2e[_0x8a38('0x8')],_0x8a38('0x9')),'body':{'type':_0x444c2e[_0x8a38('0xa')]||_0x8a38('0xb'),'channelId':'Nda','conversation':{'id':_0x273eba[_0x8a38('0xc')]},'from':{'id':_0x273eba[_0x8a38('0xd')],'name':_0x273eba[_0x8a38('0xe')]},'recipient':{'id':_0x273eba[_0x8a38('0xf')],'name':_0x273eba['extension']},'text':_0x444c2e[_0x8a38('0x10')],'channelData':{}},'headers':{'Authorization':_0x8a38('0x11')+_0x2b8260[_0x8a38('0x12')]},'json':!![]};if(_0x444c2e[_0x8a38('0x13')]){_0x382fb5['body'][_0x8a38('0x14')][_0x8a38('0x15')]=_0x444c2e[_0x8a38('0x13')];}if(_0x444c2e[_0x8a38('0x16')]=='1'){_0x382fb5[_0x8a38('0x17')][_0x8a38('0x14')][_0x8a38('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x8a38('0x19')};}if(_0x444c2e[_0x8a38('0x1a')]){_0x382fb5[_0x8a38('0x17')]['channelData'][_0x8a38('0x1b')]=_0x444c2e[_0x8a38('0x1a')];if(_0x444c2e['custom_action_data']){_0x382fb5[_0x8a38('0x17')][_0x8a38('0x14')][_0x8a38('0x1c')]=_0x444c2e[_0x8a38('0x1d')];}}logger[_0x8a38('0x1e')](JSON[_0x8a38('0x1f')](_0x382fb5));return rp(_0x382fb5);});}; \ 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 b29e577..9cf19f2 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 _0x4e40=['./lib/api','exports'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x4e40,0x10c));var _0x04e4=function(_0x330b53,_0x3c7655){_0x330b53=_0x330b53-0x0;var _0x37e226=_0x4e40[_0x330b53];return _0x37e226;};'use strict';var asr=require(_0x04e4('0x0'));module[_0x04e4('0x1')]=function(_0x46e606,_0x15811e,_0x2a0138,_0x2d5918){return asr(_0x46e606,_0x15811e,_0x2a0138,_0x2d5918);}; \ No newline at end of file +var _0x9279=['./lib/api'];(function(_0x13f138,_0x3eb594){var _0x34a02b=function(_0x434a4a){while(--_0x434a4a){_0x13f138['push'](_0x13f138['shift']());}};_0x34a02b(++_0x3eb594);}(_0x9279,0xb7));var _0x9927=function(_0x596f6e,_0x3f8857){_0x596f6e=_0x596f6e-0x0;var _0x1e0803=_0x9279[_0x596f6e];return _0x1e0803;};'use strict';var asr=require(_0x9927('0x0'));module['exports']=function(_0xe30cf,_0x5eb79b,_0x59b119,_0x3dfae3){return asr(_0xe30cf,_0x5eb79b,_0x59b119,_0x3dfae3);}; \ 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 ff8d736..81f0c5f 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 _0x5647=['exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','error','terminate','parse','result','final','hypotheses','likelihood','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','info','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','close','bluebird','lodash','../../../../../../config/logger','agi'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5647,0xf8));var _0x7564=function(_0x2e2146,_0x2be827){_0x2e2146=_0x2e2146-0x0;var _0x2c6159=_0x5647[_0x2e2146];return _0x2c6159;};'use strict';var BPromise=require(_0x7564('0x0'));var _=require(_0x7564('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require(_0x7564('0x2'))(_0x7564('0x3'));module[_0x7564('0x4')]=function(_0x3325b5,_0x118889,_0x52acf7,_0x1377b8){return new BPromise(function(_0x4b62d3,_0x5731d7){logger['info'](_0x7564('0x5'),_0x1377b8||_0x7564('0x6'));var _0x3cff6e=new WebSocket(_0x1377b8||_0x7564('0x6'),{'perMessageDeflate':![]});var _0xfa689b='';var _0x34cd91='0';var _0x3afb='1';var _0x549082='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x374274(_0x26bf1a){var _0x2a46a9=crypto[_0x7564('0x7')]('sha1');_0x2a46a9[_0x7564('0x8')](_0x26bf1a);return _0x2a46a9[_0x7564('0x9')](_0x7564('0xa'));}function _0x4ddb46(){try{logger['info'](_0x7564('0xb'));var _0x9b57d9=moment()[_0x7564('0xc')]();var _0x4a34c0=_0x374274(_0x9b57d9+_0x118889+_0x52acf7);_0x3cff6e[_0x7564('0xd')](JSON[_0x7564('0xe')]({'appID':_0x118889,'timestamp':_0x9b57d9,'appKey':_0x4a34c0}));var _0x7bec7b=fs[_0x7564('0xf')](_0x3325b5);_0x7bec7b['on'](_0x7564('0x10'),function(_0xd84995){_0x3cff6e[_0x7564('0xd')](_0xd84995);});_0x7bec7b['on']('close',function(){_0x3cff6e['send']('EOS');});}catch(_0x37f807){logger[_0x7564('0x11')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x37f807));_0x3cff6e[_0x7564('0x12')]();}}function _0x47c5b2(_0x2b60a3){try{if(_0x2b60a3){var _0x20cc2a=JSON[_0x7564('0x13')](_0x2b60a3);switch(_0x20cc2a['status']){case 0x0:if(_0x20cc2a[_0x7564('0x14')]){if(_0x20cc2a['result'][_0x7564('0x15')]){logger['info']('Tilde\x20ASR\x20hypoteses',JSON[_0x7564('0xe')](_0x20cc2a['result'][_0x7564('0x16')]));_0xfa689b=_0x20cc2a[_0x7564('0x14')][_0x7564('0x16')][0x0]['transcript'];_0x34cd91=_0x20cc2a['result'][_0x7564('0x16')][0x0][_0x7564('0x17')];_0x3afb='0';_0x549082='Success.';_0x3cff6e[_0x7564('0x12')]();}}break;case 0x1:logger['info'](_0x7564('0x18'));_0x3afb='1';_0x549082=_0x7564('0x18');break;case 0x2:logger['info'](_0x7564('0x19'));_0x3afb='2';_0x549082=_0x7564('0x19');break;case 0x9:logger[_0x7564('0x1a')](_0x7564('0x1b'));_0x3afb='9';_0x549082=_0x7564('0x1b');break;case 0xa:logger[_0x7564('0x1a')](_0x7564('0x1c'));_0x3afb='10';_0x549082=_0x7564('0x1c');break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x3afb='11';_0x549082=_0x7564('0x1d');}}}catch(_0x304807){logger['error'](_0x7564('0x1e'),JSON[_0x7564('0xe')](_0x304807));_0x3cff6e[_0x7564('0x12')]();}}function _0x47f19a(){logger[_0x7564('0x1a')](_0x7564('0x1f'));_0x4b62d3({'transcript':_0xfa689b,'confidence':_0x34cd91,'status':_0x3afb,'status_message':_0x549082});}function _0x5aa9a8(_0x166127){logger[_0x7564('0x11')](_0x7564('0x20'));if(!_['isNil'](_0x166127)){logger[_0x7564('0x11')](_[_0x7564('0x21')](_0x166127)?JSON['stringify'](_0x166127):_0x166127);}}_0x3cff6e['on'](_0x7564('0x22'),_0x4ddb46);_0x3cff6e['on']('message',_0x47c5b2);_0x3cff6e['on'](_0x7564('0x23'),_0x47f19a);_0x3cff6e['on'](_0x7564('0x11'),_0x5aa9a8);});}; \ No newline at end of file +var _0xfd1c=['exports','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','update','hex','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','moment','crypto','../../../../../../config/logger'];(function(_0x486ace,_0xe6751f){var _0x281bfc=function(_0x52920b){while(--_0x52920b){_0x486ace['push'](_0x486ace['shift']());}};_0x281bfc(++_0xe6751f);}(_0xfd1c,0x1d0));var _0xcfd1=function(_0x110d59,_0x50c4fb){_0x110d59=_0x110d59-0x0;var _0x2fce64=_0xfd1c[_0x110d59];return _0x2fce64;};'use strict';var BPromise=require(_0xcfd1('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xcfd1('0x1'));var crypto=require(_0xcfd1('0x2'));var logger=require(_0xcfd1('0x3'))('agi');module[_0xcfd1('0x4')]=function(_0x3507dc,_0x3d4bbb,_0x442eed,_0x58a7ea){return new BPromise(function(_0x1bfb68,_0x6e22f8){logger['info']('Tilde\x20URI',_0x58a7ea||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x2b734f=new WebSocket(_0x58a7ea||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x23f080='';var _0x449b4a='0';var _0x12c100='1';var _0x5672eb=_0xcfd1('0x5');function _0x4064af(_0x3dc7f1){var _0x50cb0f=crypto['createHash']('sha1');_0x50cb0f[_0xcfd1('0x6')](_0x3dc7f1);return _0x50cb0f['digest'](_0xcfd1('0x7'));}function _0x556272(){try{logger[_0xcfd1('0x8')](_0xcfd1('0x9'));var _0x535d7d=moment()[_0xcfd1('0xa')]();var _0x4ff62d=_0x4064af(_0x535d7d+_0x3d4bbb+_0x442eed);_0x2b734f[_0xcfd1('0xb')](JSON[_0xcfd1('0xc')]({'appID':_0x3d4bbb,'timestamp':_0x535d7d,'appKey':_0x4ff62d}));var _0x12d456=fs[_0xcfd1('0xd')](_0x3507dc);_0x12d456['on']('data',function(_0x8210c){_0x2b734f[_0xcfd1('0xb')](_0x8210c);});_0x12d456['on'](_0xcfd1('0xe'),function(){_0x2b734f['send'](_0xcfd1('0xf'));});}catch(_0x472cd2){logger['error'](_0xcfd1('0x10'),JSON[_0xcfd1('0xc')](_0x472cd2));_0x2b734f[_0xcfd1('0x11')]();}}function _0x3f2739(_0x496b64){try{if(_0x496b64){var _0x907234=JSON[_0xcfd1('0x12')](_0x496b64);switch(_0x907234[_0xcfd1('0x13')]){case 0x0:if(_0x907234['result']){if(_0x907234[_0xcfd1('0x14')][_0xcfd1('0x15')]){logger[_0xcfd1('0x8')](_0xcfd1('0x16'),JSON[_0xcfd1('0xc')](_0x907234[_0xcfd1('0x14')][_0xcfd1('0x17')]));_0x23f080=_0x907234['result'][_0xcfd1('0x17')][0x0]['transcript'];_0x449b4a=_0x907234[_0xcfd1('0x14')]['hypotheses'][0x0][_0xcfd1('0x18')];_0x12c100='0';_0x5672eb=_0xcfd1('0x19');_0x2b734f[_0xcfd1('0x11')]();}}break;case 0x1:logger[_0xcfd1('0x8')](_0xcfd1('0x5'));_0x12c100='1';_0x5672eb=_0xcfd1('0x5');break;case 0x2:logger[_0xcfd1('0x8')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x12c100='2';_0x5672eb=_0xcfd1('0x1a');break;case 0x9:logger[_0xcfd1('0x8')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x12c100='9';_0x5672eb='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0xcfd1('0x8')](_0xcfd1('0x1b'));_0x12c100='10';_0x5672eb=_0xcfd1('0x1b');break;case 0xb:logger[_0xcfd1('0x8')](_0xcfd1('0x1c'));_0x12c100='11';_0x5672eb=_0xcfd1('0x1c');}}}catch(_0x145791){logger[_0xcfd1('0x1d')](_0xcfd1('0x1e'),JSON[_0xcfd1('0xc')](_0x145791));_0x2b734f[_0xcfd1('0x11')]();}}function _0x58d209(){logger[_0xcfd1('0x8')]('Close\x20Tilde\x20ASR\x20socket');_0x1bfb68({'transcript':_0x23f080,'confidence':_0x449b4a,'status':_0x12c100,'status_message':_0x5672eb});}function _0x5ad031(_0x367581){logger[_0xcfd1('0x1d')](_0xcfd1('0x1f'));if(!_[_0xcfd1('0x20')](_0x367581)){logger[_0xcfd1('0x1d')](_[_0xcfd1('0x21')](_0x367581)?JSON[_0xcfd1('0xc')](_0x367581):_0x367581);}}_0x2b734f['on'](_0xcfd1('0x22'),_0x556272);_0x2b734f['on'](_0xcfd1('0x23'),_0x3f2739);_0x2b734f['on'](_0xcfd1('0xe'),_0x58d209);_0x2b734f['on']('error',_0x5ad031);});}; \ 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 76faa55..4a82cad 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 _0xfaf6=['exports'];(function(_0x20053a,_0x33910a){var _0x583238=function(_0x38ba7a){while(--_0x38ba7a){_0x20053a['push'](_0x20053a['shift']());}};_0x583238(++_0x33910a);}(_0xfaf6,0x175));var _0x6faf=function(_0xad2102,_0x1b9379){_0xad2102=_0xad2102-0x0;var _0x2405b5=_0xfaf6[_0xad2102];return _0x2405b5;};var asr=require('./asr');module[_0x6faf('0x0')]={'asr':asr}; \ No newline at end of file +var _0xf663=['exports'];(function(_0x6cca9f,_0x51a0f4){var _0x90c606=function(_0x50a2b6){while(--_0x50a2b6){_0x6cca9f['push'](_0x6cca9f['shift']());}};_0x90c606(++_0x51a0f4);}(_0xf663,0x1aa));var _0x3f66=function(_0x4215d6,_0x519e9a){_0x4215d6=_0x4215d6-0x0;var _0x3514f1=_0xf663[_0x4215d6];return _0x3514f1;};var asr=require('./asr');module[_0x3f66('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 27a7be3..6a91558 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 _0x4fdb=['code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','./error','./channel','call','emit','createServer','listen','listening','connection','getConnections','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready'];(function(_0x282187,_0x2c4fc5){var _0x561d20=function(_0x45c8d4){while(--_0x45c8d4){_0x282187['push'](_0x282187['shift']());}};_0x561d20(++_0x2c4fc5);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x28a244,_0x29cdab){_0x28a244=_0x28a244-0x0;var _0x38c6f5=_0x4fdb[_0x28a244];return _0x38c6f5;};'use strict';var util=require(_0xb4fd('0x0'));var net=require(_0xb4fd('0x1'));var EventEmitter=require(_0xb4fd('0x2'))[_0xb4fd('0x3')];var AGIError=require(_0xb4fd('0x4'));var AGIChannel=require(_0xb4fd('0x5'));var AGIServer=function(_0x260a35,_0xd55d8e,_0x1c0b08){var _0x5b73bb=this,_0x260a35=_0x260a35||0x11dd,_0xd55d8e=_0xd55d8e||'127.0.0.1',_0x14052b=null,_0x5d8b39=0x0;EventEmitter[_0xb4fd('0x6')](_0x5b73bb);function _0x3af8e3(){if(!_0x260a35){_0x5b73bb[_0xb4fd('0x7')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x14052b=net[_0xb4fd('0x8')]();_0x14052b[_0xb4fd('0x9')](_0x260a35,_0xd55d8e);_0x14052b['on'](_0xb4fd('0xa'),function(){_0x5b73bb['emit'](_0xb4fd('0xa'));});_0x14052b['on'](_0xb4fd('0xb'),function(_0x2148db){_0x14052b[_0xb4fd('0xc')](function(_0x306bd4,_0x502379){if(_0x306bd4){_0x5b73bb[_0xb4fd('0x7')](_0xb4fd('0xd'),new AGIError(_0xb4fd('0xe'),_0x306bd4));}else if(_0x1c0b08&&_0x1c0b08<0x0){_0x5b73bb[_0xb4fd('0x7')]('error',new AGIError(_0xb4fd('0xf')));_0x2148db[_0xb4fd('0x10')]();}else if(_0x1c0b08&&_0x1c0b08>0x0&&_0x1c0b08<_0x502379){_0x5d8b39+=0x1;_0x5b73bb[_0xb4fd('0x7')]('error',new AGIError(_0xb4fd('0x11'),_0x5d8b39));_0x2148db[_0xb4fd('0x10')]();}else{var _0xc35d8d=new AGIChannel(_0x2148db);_0xc35d8d['on'](_0xb4fd('0x12'),function(){_0x5b73bb[_0xb4fd('0x7')](_0xb4fd('0xb'),_0xc35d8d);});}});});_0x14052b['on'](_0xb4fd('0xd'),function(_0x47e288){_0x5b73bb[_0xb4fd('0x7')](_0xb4fd('0xd'),new AGIError(_0xb4fd('0xe'),_0x47e288[_0xb4fd('0x13')]));});_0x14052b['on'](_0xb4fd('0x14'),function(){_0x5b73bb[_0xb4fd('0x7')](_0xb4fd('0x14'),new AGIError(_0xb4fd('0x15')));});}process[_0xb4fd('0x16')](function(){_0x3af8e3();});};util[_0xb4fd('0x17')](AGIServer,EventEmitter);module[_0xb4fd('0x18')]=function(_0x5e930d,_0x560eaf,_0x504e80){return new AGIServer(_0x5e930d,_0x560eaf,_0x504e80);}; \ No newline at end of file +var _0x7ee1=['127.0.0.1','call','emit','E_AGI_ARGUMENT_PORT','createServer','listening','connection','getConnections','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','util','events','EventEmitter','./error','./channel'];(function(_0x553178,_0x17211a){var _0x2fa017=function(_0x48aaf5){while(--_0x48aaf5){_0x553178['push'](_0x553178['shift']());}};_0x2fa017(++_0x17211a);}(_0x7ee1,0xab));var _0x17ee=function(_0x3de33f,_0x5d7b09){_0x3de33f=_0x3de33f-0x0;var _0x1898d1=_0x7ee1[_0x3de33f];return _0x1898d1;};'use strict';var util=require(_0x17ee('0x0'));var net=require('net');var EventEmitter=require(_0x17ee('0x1'))[_0x17ee('0x2')];var AGIError=require(_0x17ee('0x3'));var AGIChannel=require(_0x17ee('0x4'));var AGIServer=function(_0x45c9e3,_0x48baa3,_0x3a5743){var _0x5172f0=this,_0x45c9e3=_0x45c9e3||0x11dd,_0x48baa3=_0x48baa3||_0x17ee('0x5'),_0x2e4db0=null,_0x2efefb=0x0;EventEmitter[_0x17ee('0x6')](_0x5172f0);function _0x59b876(){if(!_0x45c9e3){_0x5172f0[_0x17ee('0x7')]('error',new AGIError(_0x17ee('0x8')));return![];}_0x2e4db0=net[_0x17ee('0x9')]();_0x2e4db0['listen'](_0x45c9e3,_0x48baa3);_0x2e4db0['on'](_0x17ee('0xa'),function(){_0x5172f0[_0x17ee('0x7')](_0x17ee('0xa'));});_0x2e4db0['on'](_0x17ee('0xb'),function(_0x3ac76a){_0x2e4db0[_0x17ee('0xc')](function(_0xac3906,_0xcb2375){if(_0xac3906){_0x5172f0[_0x17ee('0x7')](_0x17ee('0xd'),new AGIError(_0x17ee('0xe'),_0xac3906));}else if(_0x3a5743&&_0x3a5743<0x0){_0x5172f0[_0x17ee('0x7')]('error',new AGIError(_0x17ee('0xf')));_0x3ac76a[_0x17ee('0x10')]();}else if(_0x3a5743&&_0x3a5743>0x0&&_0x3a5743<_0xcb2375){_0x2efefb+=0x1;_0x5172f0['emit'](_0x17ee('0xd'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x2efefb));_0x3ac76a[_0x17ee('0x10')]();}else{var _0x27447d=new AGIChannel(_0x3ac76a);_0x27447d['on'](_0x17ee('0x11'),function(){_0x5172f0[_0x17ee('0x7')]('connection',_0x27447d);});}});});_0x2e4db0['on'](_0x17ee('0xd'),function(_0x749078){_0x5172f0[_0x17ee('0x7')]('error',new AGIError(_0x17ee('0xe'),_0x749078[_0x17ee('0x12')]));});_0x2e4db0['on'](_0x17ee('0x13'),function(){_0x5172f0[_0x17ee('0x7')](_0x17ee('0x13'),new AGIError(_0x17ee('0x14')));});}process[_0x17ee('0x15')](function(){_0x59b876();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x24d546,_0x17693e,_0x1f8fb){return new AGIServer(_0x24d546,_0x17693e,_0x1f8fb);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index dc72619..354aab8 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 _0xdd74=['Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','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','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','googleTTS','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','vswitch','join','exports','path','util','shelljs','odbc','randomstring','moment','mustache','agi','../../config/environment','./scripts','rawHeaders','rawBody','getdigits','getsecretdigits','channel','rpc','prototype','getVariable','then','name','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervals','getIntervalById','map','Intervals','interval','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','isNil','list_id','scheduledAt','callback','callback_priority','agentPause','agent','error','agentUnpause','agentLogout','agentLogin','internal','format','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','MP3','google_tts_language','restAPI','url','method','number','timeout','includes','POST','PUT','toUpperCase','body','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','parse','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','tildeASR','appsecret','clear','clone','hasOwnProperty','isString','recursiveNodeIndex','isArray','length','saveRestApiResult','isPlainObject','%s.%s','setVariable','replaceObjectAllVariables','replaceAllVariables','split','replaceAll','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','Enter\x20in\x20AGI\x20(%s)\x20block','label','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','isConfigured','Wait\x20%s\x20seconds\x20before\x20answer','wait','result','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','application','noop','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','MRCPRecog','SESTEK_ASR_CONFIDENCE','RECOG_INSTANCE()','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20odbc\x20database\x20found','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','bot','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','retry','getSound','file_id','variable_id','toString','test','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','no\x20valid\x20credentials\x20configured','no\x20text\x20configured','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','message','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','recordFile','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','wav','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20FOUND\x20BY','success','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','getPause','pause_id','playback','no\x20file\x20audio\x20found','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','createSquareRecording','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','account_id','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','Smtp','service','host','port','secure','authentication','auth','pass','template_id','sendMail\x20message'];(function(_0x179cc9,_0x15051d){var _0x5c70db=function(_0x41ca05){while(--_0x41ca05){_0x179cc9['push'](_0x179cc9['shift']());}};_0x5c70db(++_0x15051d);}(_0xdd74,0x1e7));var _0x4dd7=function(_0x28e6ca,_0xc0f98b){_0x28e6ca=_0x28e6ca-0x0;var _0x35078b=_0xdd74[_0x28e6ca];return _0x35078b;};'use strict';var fs=require('fs');var path=require(_0x4dd7('0x0'));var util=require(_0x4dd7('0x1'));var _=require('lodash');var sh=require(_0x4dd7('0x2'));var odbc=require(_0x4dd7('0x3'))();var rs=require(_0x4dd7('0x4'));var moment=require(_0x4dd7('0x5'));var Mustache=require(_0x4dd7('0x6'));var rp=require('request-promise');var logger=require('../../config/logger')(_0x4dd7('0x7'));var config=require(_0x4dd7('0x8'));var scripts=require(_0x4dd7('0x9'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x4dd7('0xa'),_0x4dd7('0xb')];var verticesWithRetry=['menu',_0x4dd7('0xc'),_0x4dd7('0xd')];var AGIVertices=function(_0x4e1ee5,_0x14abf3,_0x201b45){this[_0x4dd7('0xe')]=_0x4e1ee5;this[_0x4dd7('0xf')]=_0x14abf3;this['mailRpc']=_0x201b45;};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x11')]=function(_0x2753e2,_0x545ac1){this[_0x4dd7('0xf')]['getVariableById'](_0x2753e2)[_0x4dd7('0x12')](function(_0x3f75b6){_0x545ac1(null,_0x3f75b6?_0x3f75b6[_0x4dd7('0x13')]:![]);})['catch'](function(_0x1159bc){_0x545ac1(_0x1159bc);});};AGIVertices['prototype'][_0x4dd7('0x14')]=function(_0x3da0ad,_0x278c51){this[_0x4dd7('0xf')][_0x4dd7('0x15')](_0x3da0ad)['then'](function(_0x503b65){_0x278c51(null,_0x503b65?_0x503b65[_0x4dd7('0x13')]:![]);})[_0x4dd7('0x16')](function(_0x40e8dc){_0x278c51(_0x40e8dc);});};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x17')]=function(_0x9eae51,_0x25dd09){this['rpc']['getSquareProjectById'](_0x9eae51)[_0x4dd7('0x12')](function(_0x3dd767){_0x25dd09(null,_0x3dd767?_0x3dd767[_0x4dd7('0x13')]:![]);})[_0x4dd7('0x16')](function(_0x23e44e){_0x25dd09(_0x23e44e);});};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x18')]=function(_0x2209dd,_0x2aee60){this[_0x4dd7('0xf')][_0x4dd7('0x19')](_0x2209dd)[_0x4dd7('0x12')](function(_0x424fa3){_0x2aee60(null,_0x424fa3?_0x424fa3[_0x4dd7('0x1a')]:![]);})[_0x4dd7('0x16')](function(_0x5f13fd){_0x2aee60(_0x5f13fd);});};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x1b')]=function(_0x45bdf6,_0xbcb86a){this[_0x4dd7('0xf')][_0x4dd7('0x1c')](_0x45bdf6)['then'](function(_0x729926){_0xbcb86a(null,_0x729926?_0x729926[_0x4dd7('0x13')]:![]);})[_0x4dd7('0x16')](function(_0x2f40fe){_0xbcb86a(_0x2f40fe);});};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x1d')]=function(_0xa45b55,_0x6e7251){this['rpc']['getTrunkById'](_0xa45b55)['then'](function(_0x167b6f){_0x6e7251(null,_0x167b6f?_0x167b6f[_0x4dd7('0x13')]:![]);})['catch'](function(_0x42c484){_0x6e7251(_0x42c484);});};AGIVertices[_0x4dd7('0x10')]['getSound']=function(_0x33a06e,_0x1eeab8){var _0xecbaf5=this;this[_0x4dd7('0xf')]['getSoundById'](_0x33a06e)['then'](function(_0x107b2e){_0x1eeab8(null,_0x107b2e?_0xecbaf5[_0x4dd7('0x1e')](_0x107b2e[_0x4dd7('0x1f')]):![]);})[_0x4dd7('0x16')](function(_0x3af200){_0x1eeab8(_0x3af200);});};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x20')]=function(_0x38e9ab,_0x5f5587){this[_0x4dd7('0xf')][_0x4dd7('0x21')](_0x38e9ab)['then'](function(_0x26af5){_0x5f5587(null,_0x26af5?_0x26af5:![]);})['catch'](function(_0x11606c){_0x5f5587(_0x11606c);});};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x22')]=function(_0x4ea4e9,_0x203b52,_0x30ed8b){this[_0x4dd7('0x23')][_0x4dd7('0x22')](_0x4ea4e9,_0x203b52)[_0x4dd7('0x12')](function(){_0x30ed8b(null);})['catch'](function(_0x18ecb3){_0x30ed8b(_0x18ecb3);});};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x24')]=function(_0x497a03,_0x2c0ba2){this[_0x4dd7('0xf')][_0x4dd7('0x25')](_0x497a03)['then'](function(_0x51bca8){if(_0x51bca8){if(_0x51bca8['IntervalId']){_0x2c0ba2(null,[_0x51bca8['interval']]);}else{_0x2c0ba2(null,_[_0x4dd7('0x26')](_0x51bca8[_0x4dd7('0x27')],_0x4dd7('0x28')));}}else{_0x2c0ba2(null,![]);}})[_0x4dd7('0x16')](function(_0x47f531){_0x2c0ba2(_0x47f531);});};AGIVertices[_0x4dd7('0x10')]['getSoundPath']=function(_0x2003c1){return util['format']('%s/sounds/converted/%s',FILES_PATH,_0x2003c1);};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x29')]=function(_0x49edb5,_0x28dbe2,_0x309243){odbc[_0x4dd7('0x2a')](_0x49edb5,function(_0x34bd60){if(_0x34bd60){logger['error'](_0x4dd7('0x2b'),_0x34bd60);_0x309243(_0x34bd60);}else{logger['info'](_0x4dd7('0x2c'));odbc[_0x4dd7('0x2d')](_0x28dbe2,function(_0x3de0d1,_0x1bf609){if(_0x3de0d1){logger[_0x4dd7('0x2e')](_0x4dd7('0x2f'),_0x28dbe2);_0x309243(_0x3de0d1);}else{logger[_0x4dd7('0x2e')](_0x4dd7('0x30'),_0x28dbe2);odbc[_0x4dd7('0x31')](function(_0xd5e6d0){if(_0xd5e6d0){logger['error'](_0x4dd7('0x32'),_0xd5e6d0);}_0x309243(null,_0x1bf609);});}});}});};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x33')]=function(_0x3fff20,_0x252eb2){this[_0x4dd7('0xf')][_0x4dd7('0x34')](_0x3fff20)['then'](function(_0x1b272b){_0x252eb2(null,_0x1b272b?_0x1b272b:![]);})[_0x4dd7('0x16')](function(_0x2eb1bd){_0x252eb2(_0x2eb1bd);});};AGIVertices['prototype']['createSmsMessage']=function(_0x2c7f92,_0x351b9e){this[_0x4dd7('0xf')][_0x4dd7('0x35')](_0x2c7f92)[_0x4dd7('0x12')](function(_0x2f3504){_0x351b9e(null,_0x2f3504);})[_0x4dd7('0x16')](function(_0x2d2464){_0x351b9e(_0x2d2464);});};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x36')]=function(_0x1d4857,_0x4ff02f,_0x32f2ad){this[_0x4dd7('0xf')]['createSquareDetailsReport']({'uniqueid':this[_0x4dd7('0xe')][_0x4dd7('0x37')],'node':_0x1d4857['label'],'application':_0x1d4857[_0x4dd7('0x38')],'data':_0x4ff02f||null,'project_name':this['channel'][_0x4dd7('0x39')],'callerid':this[_0x4dd7('0xe')][_0x4dd7('0x3a')]})['then'](function(_0x2b5e7d){if(_0x32f2ad){_0x32f2ad(null,_0x2b5e7d);}})['catch'](function(_0x346cf9){if(_0x32f2ad){_0x32f2ad(_0x346cf9);}});};AGIVertices[_0x4dd7('0x10')]['createSquareRecording']=function(_0x447021,_0x2d8cd7,_0x48864f,_0x119b9d){this[_0x4dd7('0xf')]['createSquareRecording']({'uniqueid':this[_0x4dd7('0xe')]['uniqueid'],'callerid':this['channel'][_0x4dd7('0x3a')],'calleridname':this[_0x4dd7('0xe')][_0x4dd7('0x3b')],'context':this['channel']['context'],'extension':this[_0x4dd7('0xe')][_0x4dd7('0x3c')],'priority':this[_0x4dd7('0xe')][_0x4dd7('0x3d')],'accountcode':this[_0x4dd7('0xe')][_0x4dd7('0x3e')],'dnid':this[_0x4dd7('0xe')][_0x4dd7('0x3f')],'projectName':this[_0x4dd7('0xe')]['arg_1'],'saveName':_0x2d8cd7,'filename':_0x447021[_0x4dd7('0x40')]||_0x2d8cd7,'savePath':_0x48864f})[_0x4dd7('0x12')](function(_0xdebd){_0x119b9d(null,_0xdebd);})[_0x4dd7('0x16')](function(_0x5afe53){_0x119b9d(_0x5afe53);});};AGIVertices['prototype']['createSquareMessage']=function(_0x3a442f,_0x1d9468,_0x7ed80e){this[_0x4dd7('0xf')][_0x4dd7('0x41')]({'uniqueid':this['channel'][_0x4dd7('0x37')],'body':_0x3a442f,'direction':_0x1d9468})[_0x4dd7('0x12')](function(_0x2485b2){if(_0x7ed80e){_0x7ed80e(null,_0x2485b2);}})['catch'](function(_0x5393d3){if(_0x7ed80e){_0x7ed80e(_0x5393d3);}});};AGIVertices[_0x4dd7('0x10')]['createCmContact']=function(_0xab0d6b,_0x500668){this[_0x4dd7('0xf')][_0x4dd7('0x42')]({'firstName':_[_0x4dd7('0x43')](_0xab0d6b[_0x4dd7('0x13')])||_['isNil'](_0xab0d6b['name'])?_0x4dd7('0x44')+Math[_0x4dd7('0x45')]():_0xab0d6b[_0x4dd7('0x13')],'lastName':_[_0x4dd7('0x43')](_0xab0d6b[_0x4dd7('0x46')])||_[_0x4dd7('0x47')](_0xab0d6b['lastName'])?null:_0xab0d6b[_0x4dd7('0x46')],'phone':_0xab0d6b['phone'],'ListId':_0xab0d6b[_0x4dd7('0x48')],'scheduledat':_0xab0d6b[_0x4dd7('0x49')],'callbackUniqueid':this[_0x4dd7('0xe')][_0x4dd7('0x37')],'tags':_0x4dd7('0x4a'),'description':'Callback\x20scheduled\x20at\x20'+_0xab0d6b[_0x4dd7('0x49')]['toString'](),'priority':_0xab0d6b[_0x4dd7('0x4b')]})[_0x4dd7('0x12')](function(_0x2201ba){_0x500668(null,_0x2201ba);})[_0x4dd7('0x16')](function(_0x362f8f){_0x500668(_0x362f8f);});};AGIVertices[_0x4dd7('0x10')]['getPause']=function(_0x35a164,_0x3f3daa){this[_0x4dd7('0xf')]['getPauseById'](_0x35a164)[_0x4dd7('0x12')](function(_0x10be4e){_0x3f3daa(null,_0x10be4e?_0x10be4e['name']:![]);})[_0x4dd7('0x16')](function(_0x7e50c5){_0x3f3daa(_0x7e50c5);});};AGIVertices['prototype'][_0x4dd7('0x4c')]=function(_0x3a2b9b,_0x2c0c98,_0x4f4819){var _0x2fa756={'role':_0x4dd7('0x4d')};_0x2fa756[_0x3a2b9b]=this[_0x4dd7('0xe')][_0x4dd7('0x3a')];this[_0x4dd7('0xf')]['agentPause'](_0x2fa756,_0x2c0c98,this[_0x4dd7('0xe')][_0x4dd7('0x37')])[_0x4dd7('0x12')](function(_0x273fa4){_0x4f4819(null,_[_0x4dd7('0x47')](_0x273fa4)?![]:!![]);})[_0x4dd7('0x16')](function(_0x4b9f8b){logger[_0x4dd7('0x4e')](_0x4b9f8b);_0x4f4819(null,![]);});};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x4f')]=function(_0x1fb71d,_0x2fc6a1){var _0x5ce67d={'role':_0x4dd7('0x4d')};_0x5ce67d[_0x1fb71d]=this['channel'][_0x4dd7('0x3a')];this['rpc'][_0x4dd7('0x4f')](_0x5ce67d)['then'](function(_0x2eb753){_0x2fc6a1(null,_[_0x4dd7('0x47')](_0x2eb753)?![]:!![]);})['catch'](function(_0x139cec){logger[_0x4dd7('0x4e')](_0x139cec);_0x2fc6a1(null,![]);});};AGIVertices['prototype'][_0x4dd7('0x50')]=function(_0x303d81,_0x190537){var _0x29abc2={'role':_0x4dd7('0x4d')};_0x29abc2[_0x303d81]=this[_0x4dd7('0xe')][_0x4dd7('0x3a')];this[_0x4dd7('0xf')][_0x4dd7('0x50')](_0x29abc2)[_0x4dd7('0x12')](function(_0x5be331){_0x190537(null,_['isNil'](_0x5be331)?![]:!![]);})['catch'](function(_0x41e57c){logger[_0x4dd7('0x4e')](_0x41e57c);_0x190537(null,![]);});};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x51')]=function(_0x36b206,_0x38f5c4){var _0x2eb2ea={'role':_0x4dd7('0x4d')};_0x2eb2ea[_0x36b206]=this[_0x4dd7('0xe')][_0x4dd7('0x3a')];var _0x2e10c4=_0x36b206!=_0x4dd7('0x52')?util[_0x4dd7('0x53')]('%s/%s@from-sip/n',_0x4dd7('0x54'),this[_0x4dd7('0xe')]['callerid']):undefined;this[_0x4dd7('0xf')]['agentLogin'](_0x2eb2ea,_0x2e10c4)[_0x4dd7('0x12')](function(_0x2b1009){_0x38f5c4(null,_[_0x4dd7('0x47')](_0x2b1009)?![]:!![]);})['catch'](function(_0x326951){logger[_0x4dd7('0x4e')](_0x326951);_0x38f5c4(null,![]);});};AGIVertices['prototype'][_0x4dd7('0x55')]=function(_0x4c6bc4,_0x35c4a0){sh[_0x4dd7('0x56')](_[_0x4dd7('0x57')](_0x4c6bc4),function(_0x33eb86,_0x444826){var _0x46b8e1=_0x444826[_0x4dd7('0x58')](/(\r\n|\n|\r)/gm,'');_0x35c4a0(null,_0x46b8e1);});};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x59')]=function(_0x5582b7,_0x546ed7){scripts[_0x4dd7('0x59')](_0x5582b7[_0x4dd7('0x5a')],_0x5582b7[_0x4dd7('0x5b')]||_0x4dd7('0x5c'),_0x5582b7[_0x4dd7('0x5c')],_0x5582b7[_0x4dd7('0x5d')]||_0x4dd7('0x5e'),_0x5582b7[_0x4dd7('0x5f')]||_0x4dd7('0x60'),_0x5582b7['audioEncoding']||_0x4dd7('0x61'))[_0x4dd7('0x12')](function(_0x4aebfe){_0x546ed7(null,_0x4aebfe);})[_0x4dd7('0x16')](function(_0x6239b1){_0x546ed7(_0x6239b1);});};AGIVertices[_0x4dd7('0x10')]['googleTTS']=function(_0x193cda,_0x3b2cb3){scripts['googleTTS'](_0x193cda['text'],_0x193cda[_0x4dd7('0x62')]||'en',0x1)['then'](function(_0x1ef13f){_0x3b2cb3(null,_0x1ef13f);})[_0x4dd7('0x16')](function(_0x4ea81b){_0x3b2cb3(_0x4ea81b);});};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x63')]=function(_0xadf0e4,_0x30288f){var _0x567cfc={'uri':_0xadf0e4[_0x4dd7('0x64')],'method':_0xadf0e4[_0x4dd7('0x65')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xadf0e4['timeout'])===_0x4dd7('0x66')&&parseInt(_0xadf0e4[_0x4dd7('0x67')])>=0x1?parseInt(_0xadf0e4[_0x4dd7('0x67')])*0x3e8:0x5*0x3e8};if(_[_0x4dd7('0x68')]([_0x4dd7('0x69'),_0x4dd7('0x6a')],_0x567cfc[_0x4dd7('0x65')][_0x4dd7('0x6b')]())){try{_0x567cfc[_0x4dd7('0x6c')]=_0xadf0e4[_0x4dd7('0xb')]?JSON['parse'](_0xadf0e4[_0x4dd7('0xb')]):{};}catch(_0x1c29c3){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x1c29c3);}}try{_0x567cfc[_0x4dd7('0x6d')]=_0xadf0e4['rawHeaders']?JSON['parse'](_0xadf0e4['rawHeaders']):{};}catch(_0x19f77b){logger[_0x4dd7('0x4e')](_0x4dd7('0x6e'),_0x19f77b);}if(_0xadf0e4[_0x4dd7('0x6f')]){try{var _0xd15fa7=require(_0xadf0e4[_0x4dd7('0x6f')])[_0x4dd7('0x70')](this,_0x567cfc);_0x567cfc[_0x4dd7('0x71')]=Mustache[_0x4dd7('0x72')](_0xadf0e4[_0x4dd7('0x64')],_0xd15fa7,{},['$$','$$']);if(_0x567cfc[_0x4dd7('0x6d')]){_0x567cfc[_0x4dd7('0x6d')]=JSON[_0x4dd7('0x73')](Mustache[_0x4dd7('0x72')](JSON[_0x4dd7('0x74')](_0x567cfc[_0x4dd7('0x6d')]),_0xd15fa7,{},['$$','$$']));}if(_0x567cfc[_0x4dd7('0x6c')]){_0x567cfc['body']=JSON[_0x4dd7('0x73')](Mustache['render'](JSON[_0x4dd7('0x74')](_0x567cfc[_0x4dd7('0x6c')]),_0xd15fa7,{},['$$','$$']));}}catch(_0x592c6b){logger[_0x4dd7('0x4e')](_0x4dd7('0x75'),_0x592c6b);}}rp(_0x567cfc)['then'](function(_0x2d024e){var _0x30921d={'statusCode':_0x2d024e[_0x4dd7('0x76')]||0xc8,'statusMessage':_0x2d024e[_0x4dd7('0x77')]||'OK','headers':_0x2d024e[_0x4dd7('0x6d')]||{},'body':_0x2d024e[_0x4dd7('0x6c')]||{}};_0x30288f(null,_0x30921d);})['catch'](function(_0x43cc5e){var _0x5b55ed={'statusCode':_0x43cc5e[_0x4dd7('0x76')]||0x1f4,'statusMessage':_0x43cc5e['message']||_0x4dd7('0x78'),'headers':_0x43cc5e['options'][_0x4dd7('0x6d')]||{},'body':_0x43cc5e[_0x4dd7('0x79')][_0x4dd7('0x6c')]||{}};_0x30288f(null,_0x5b55ed);});};AGIVertices[_0x4dd7('0x10')]['googleDialogflow']=function(_0x122a5e,_0x22d4b3){scripts[_0x4dd7('0x7a')](this[_0x4dd7('0xe')]['uniqueid'],_0x122a5e[_0x4dd7('0x7b')],_0x122a5e[_0x4dd7('0x5c')],_0x122a5e['dialogflow_language']||'en')[_0x4dd7('0x12')](function(_0x593a8f){_0x22d4b3(null,_0x593a8f);})[_0x4dd7('0x16')](function(_0x278c60){_0x22d4b3(_0x278c60);});};AGIVertices[_0x4dd7('0x10')]['sestekNDA']=function(_0x268e7d,_0x3d75a1){scripts[_0x4dd7('0x7c')](this['channel'],_0x268e7d)[_0x4dd7('0x12')](function(_0x44ed2a){_0x3d75a1(null,_0x44ed2a);})['catch'](function(_0x45ce65){_0x3d75a1(_0x45ce65);});};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x7d')]=function(_0x427c07,_0x119e2c){scripts[_0x4dd7('0x7d')](_0x427c07[_0x4dd7('0x7b')],_0x427c07[_0x4dd7('0x5c')],_0x427c07[_0x4dd7('0x7e')]||_0x4dd7('0x5e'),_0x427c07[_0x4dd7('0x7f')])[_0x4dd7('0x12')](function(_0x41039d){_0x119e2c(null,_0x41039d);})['catch'](function(_0x2837d9){_0x119e2c(_0x2837d9);});};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x80')]=function(_0x1c5bfc,_0x1a5a84,_0x1b648d){scripts[_0x4dd7('0x80')](_0x1a5a84,_0x1c5bfc[_0x4dd7('0x7b')],_0x1c5bfc[_0x4dd7('0x81')]||_0x4dd7('0x5e'),this['isConfigured'](_0x1c5bfc[_0x4dd7('0x82')])?_0x1c5bfc['model']:undefined)[_0x4dd7('0x12')](function(_0x5348e7){_0x1b648d(null,_0x5348e7);})[_0x4dd7('0x16')](function(_0x4c696f){_0x1b648d(_0x4c696f);});};AGIVertices['prototype'][_0x4dd7('0x83')]=function(_0xe2da03,_0x434c3d){scripts[_0x4dd7('0x83')](_0xe2da03['aws_access_key_id'],_0xe2da03[_0x4dd7('0x84')],_0xe2da03[_0x4dd7('0x85')],_0xe2da03['aws_polly_voice']||'Amy',_0xe2da03[_0x4dd7('0x5c')],_0xe2da03[_0x4dd7('0x86')]||_0x4dd7('0x5c'))[_0x4dd7('0x12')](function(_0x3ddab3){_0x434c3d(null,_0x3ddab3);})[_0x4dd7('0x16')](function(_0x2cbf96){_0x434c3d(_0x2cbf96);});};AGIVertices[_0x4dd7('0x10')]['awsLex']=function(_0x3c11ab,_0x28b03e){scripts[_0x4dd7('0x87')](this[_0x4dd7('0xe')]['uniqueid'],_0x3c11ab[_0x4dd7('0x88')],_0x3c11ab['aws_secret_access_key'],_0x3c11ab[_0x4dd7('0x89')],_0x3c11ab['text'],_0x3c11ab[_0x4dd7('0x8a')])[_0x4dd7('0x12')](function(_0x42b151){_0x28b03e(null,_0x42b151);})['catch'](function(_0x3f086b){_0x28b03e(_0x3f086b);});};AGIVertices['prototype'][_0x4dd7('0x8b')]=function(_0x209c91,_0x1e2ad6,_0x1bfcc2){scripts[_0x4dd7('0x8b')](_0x1e2ad6,_0x209c91[_0x4dd7('0x7b')],_0x209c91['google_asr_language']||'en-US')[_0x4dd7('0x12')](function(_0x1dbeb5){_0x1bfcc2(null,_0x1dbeb5);})[_0x4dd7('0x16')](function(_0x1341e4){_0x1bfcc2(_0x1341e4);});};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x8c')]=function(_0x477c72,_0x269919,_0x142a06){scripts['tildeASR'](_0x269919,_0x477c72['appid'],_0x477c72[_0x4dd7('0x8d')],_0x477c72['uri'])[_0x4dd7('0x12')](function(_0x5db4d6){_0x142a06(null,_0x5db4d6);})['catch'](function(_0x3e61b5){_0x142a06(_0x3e61b5);});};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x8e')]=function(_0x429398){var _0x3e64b3=_[_0x4dd7('0x68')](verticesWithRetry,_0x429398['agicommand'])?_0x429398:_[_0x4dd7('0x8f')](_0x429398);for(var _0x259838 in _0x3e64b3){if(_0x3e64b3[_0x4dd7('0x90')](_0x259838)){if(_0x3e64b3[_0x259838]&&_[_0x4dd7('0x91')](_0x3e64b3[_0x259838])){if(_['includes'](recursiveMapAttributes,_0x259838)){_0x3e64b3[_0x259838]=this['replaceObjectAllVariables'](_0x3e64b3[_0x259838]);}else{_0x3e64b3[_0x259838]=this['replaceAllVariables'](_0x3e64b3[_0x259838]);}}}}return _0x3e64b3;};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x92')]=function(_0x19b404){for(var _0x4c42ba in _0x19b404){if(_0x19b404['hasOwnProperty'](_0x4c42ba)){if(_['isPlainObject'](_0x19b404[_0x4c42ba])){this[_0x4dd7('0x92')](_0x19b404[_0x4c42ba]);}else if(_[_0x4dd7('0x93')](_0x19b404[_0x4c42ba])){for(var _0x554f86=0x0;_0x554f86<_0x19b404[_0x4c42ba][_0x4dd7('0x94')];_0x554f86++){this[_0x4dd7('0x92')](_0x19b404[_0x4c42ba][_0x554f86]);}}else if(_[_0x4dd7('0x91')](_0x19b404[_0x4c42ba])){_0x19b404[_0x4c42ba]=this['replaceAllVariables'](_0x19b404[_0x4c42ba]);}}}};AGIVertices['prototype'][_0x4dd7('0x95')]=function(_0x5741cb,_0x31f746){for(var _0x54eee4 in _0x5741cb){if(_0x5741cb['hasOwnProperty'](_0x54eee4)){if(_[_0x4dd7('0x96')](_0x5741cb[_0x54eee4])){if(!_['isEmpty'](_0x5741cb[_0x54eee4])){this['saveRestApiResult'](_0x5741cb[_0x54eee4],util[_0x4dd7('0x53')](_0x4dd7('0x97'),_0x31f746,_0x54eee4));}}else if(_[_0x4dd7('0x93')](_0x5741cb[_0x54eee4])){for(var _0x51b579=0x0;_0x51b579<_0x5741cb[_0x54eee4][_0x4dd7('0x94')];_0x51b579++){this['saveRestApiResult'](_0x5741cb[_0x54eee4][_0x51b579],util[_0x4dd7('0x53')](_0x4dd7('0x97'),_0x31f746,_0x54eee4+'['+_0x51b579+']'));}}else{if(!_[_0x4dd7('0x47')](_0x5741cb[_0x54eee4])){this['channel'][_0x4dd7('0x98')](util[_0x4dd7('0x53')](_0x4dd7('0x97'),_0x31f746,_0x54eee4),_0x5741cb[_0x54eee4]);}}}}};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x99')]=function(_0x5a6fc2){try{var _0x514420=JSON[_0x4dd7('0x73')](_0x5a6fc2);this['recursiveNodeIndex'](_0x514420);return JSON[_0x4dd7('0x74')](_0x514420);}catch(_0x1e3db6){return this['replaceAllVariables'](_0x5a6fc2);}};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x9a')]=function(_0x34704c){var _0xa50c6e=_0x34704c[_0x4dd7('0x9b')]('{');for(var _0x3f866d=0x1;_0x3f866d<_0xa50c6e[_0x4dd7('0x94')];_0x3f866d+=0x1){var _0x59ac10=_0xa50c6e[_0x3f866d][_0x4dd7('0x9b')]('}');if(_0x59ac10[_0x4dd7('0x94')]>0x1){_0x34704c=_0x34704c[_0x4dd7('0x9c')]('{'+_0x59ac10[0x0]+'}',this['channel'][_0x4dd7('0x11')](_0x59ac10[0x0])[_0x4dd7('0x9d')]||_0x59ac10[0x0]);}}if(_0xa50c6e[_0x4dd7('0x94')]===0x1){return _0x34704c['toString']();}return this[_0x4dd7('0x9a')](_0x34704c);};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x9e')]=function(_0x220cdb,_0x105184){var _0x52383e=this[_0x4dd7('0xe')][_0x4dd7('0x11')](_0x220cdb);if(_0x52383e['result']===-0x1){return _0x52383e;}logger[_0x4dd7('0x2e')](util['format'](_0x4dd7('0x9f'),_0x105184,_0x52383e[_0x4dd7('0x9d')]));return this['channel'][_0x4dd7('0x98')](_0x105184,_0x52383e[_0x4dd7('0x9d')]);};AGIVertices[_0x4dd7('0x10')]['isConfigured']=function(_0x36f11e){return _0x36f11e&&_0x36f11e!=='0'&&_0x36f11e!=='-1'&&_0x36f11e!=='';};AGIVertices['prototype'][_0x4dd7('0xa0')]=function(_0x388a69){this[_0x4dd7('0x36')]['sync'](this,_0x388a69,'-');_0x388a69['retry']=_0x388a69[_0x4dd7('0xa0')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x7')]=function(_0x5de5a4){logger[_0x4dd7('0x2e')](util['format'](_0x4dd7('0xa1'),_0x5de5a4[_0x4dd7('0xa2')]));return this['channel'][_0x4dd7('0x7')]([_0x5de5a4[_0x4dd7('0xa3')],_0x5de5a4[_0x4dd7('0xa4')]]);};AGIVertices['prototype']['answer']=function(_0x995e87){logger['info'](util[_0x4dd7('0x53')](_0x4dd7('0xa5'),_0x995e87['label']));if(this[_0x4dd7('0xa6')](_0x995e87[_0x4dd7('0x67')])){logger[_0x4dd7('0x2e')](util['format'](_0x4dd7('0xa7'),_0x995e87['timeout']));var _0x52ebbe=this[_0x4dd7('0xe')][_0x4dd7('0xa8')](_0x995e87['timeout']);if(_0x52ebbe[_0x4dd7('0xa9')]===-0x1){return _0x52ebbe;}}return this[_0x4dd7('0xe')][_0x4dd7('0xaa')]();};AGIVertices['prototype'][_0x4dd7('0x4a')]=function(_0x4e64f2){logger[_0x4dd7('0x2e')](util['format'](_0x4dd7('0xab'),_0x4e64f2['label']));if(!this[_0x4dd7('0xa6')](_0x4e64f2[_0x4dd7('0x48')])){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x4e64f2,_0x4dd7('0xac'));}_0x4e64f2[_0x4dd7('0x49')]=moment();if(this[_0x4dd7('0xa6')](_0x4e64f2[_0x4dd7('0xad')])){_0x4e64f2[_0x4dd7('0x49')]=moment()[_0x4dd7('0xae')](_0x4e64f2[_0x4dd7('0xad')],_0x4dd7('0xaf'));}if(!this[_0x4dd7('0xa6')](_0x4e64f2[_0x4dd7('0x4b')])){_0x4e64f2['callback_priority']=0x2;}this[_0x4dd7('0x42')]['sync'](this,_0x4e64f2);return this[_0x4dd7('0xe')]['noop'](util[_0x4dd7('0x53')](_0x4dd7('0xb0'),_0x4e64f2[_0x4dd7('0xb1')],_0x4e64f2[_0x4dd7('0x48')],_0x4e64f2[_0x4dd7('0x49')]));};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0xb2')]=function(_0x4831c5){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x4831c5[_0x4dd7('0xa2')]));var _0x2b57b4=this[_0x4dd7('0xe')][_0x4dd7('0x56')](_0x4831c5[_0x4dd7('0xb3')],_0x4831c5['options']);if(_0x2b57b4[_0x4dd7('0xa9')]===-0x1){return _0x2b57b4;}return this['channel'][_0x4dd7('0xb4')](util[_0x4dd7('0x53')]('Executed\x20command\x20%s\x20%s',_0x4831c5[_0x4dd7('0xb3')],_0x4831c5['options']));};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0xb5')]=function(_0x6098df){logger['info'](util['format'](_0x4dd7('0xb6'),_0x6098df[_0x4dd7('0xa2')]));if(!this['isConfigured'](_0x6098df[_0x4dd7('0x5c')])){return this['channel'][_0x4dd7('0xb4')]('no\x20text\x20configured');}var _0x4f6327='\x22'+_0x6098df[_0x4dd7('0x5c')]+'\x22';if(this['isConfigured'](_0x6098df[_0x4dd7('0x79')])){_0x4f6327+=','+_0x6098df[_0x4dd7('0x79')];}var _0x129d13=this[_0x4dd7('0xe')][_0x4dd7('0x56')](_0x4dd7('0xb7'),_0x4f6327);if(_0x129d13[_0x4dd7('0xa9')]===-0x1){return _0x129d13;}return this['channel']['noop'](util[_0x4dd7('0x53')](_0x4dd7('0xb8'),_0x4f6327));};AGIVertices['prototype']['sestektts']=function(_0x1fc880){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x1fc880[_0x4dd7('0xa2')]));if(!this[_0x4dd7('0xa6')](_0x1fc880[_0x4dd7('0x5c')])){return this['channel']['noop']('no\x20text\x20configured');}var _0x3efa8a='\x22'+_0x1fc880['text']+'\x22';if(this['isConfigured'](_0x1fc880['options'])){_0x3efa8a+=','+_0x1fc880[_0x4dd7('0x79')];}var _0x5d87f4=this['channel'][_0x4dd7('0x56')](_0x4dd7('0xb7'),_0x3efa8a);if(_0x5d87f4[_0x4dd7('0xa9')]===-0x1){return _0x5d87f4;}return this[_0x4dd7('0xe')]['noop'](util[_0x4dd7('0x53')](_0x4dd7('0xb8'),_0x3efa8a));};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0xb9')]=function(_0x3bba51){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0xba'),_0x3bba51[_0x4dd7('0xa2')]));if(!this[_0x4dd7('0xa6')](_0x3bba51[_0x4dd7('0xbb')])){return this[_0x4dd7('0xe')]['noop'](_0x4dd7('0xbc'));}var _0x14f051=_0x3bba51[_0x4dd7('0xbb')];if(this[_0x4dd7('0xa6')](_0x3bba51['options'])){_0x14f051+=','+_0x3bba51['options'];}var _0x1faf29=this[_0x4dd7('0xe')]['exec']('MRCPRecog',_0x14f051);if(_0x1faf29[_0x4dd7('0xa9')]===-0x1){return _0x1faf29;}var _0x552f63=this['getAndSetVariable'](_0x4dd7('0xbd'),_0x4dd7('0xbe'));if(_0x552f63[_0x4dd7('0xa9')]===-0x1){return _0x552f63;}var _0x4abf16=this['getAndSetVariable'](_0x4dd7('0xbf'),_0x4dd7('0xc0'));if(_0x4abf16['result']===-0x1){return _0x4abf16;}var _0x4e53b4=this[_0x4dd7('0x9e')]('RECOG_INSTANCE()',_0x4dd7('0xc1'));if(_0x4e53b4['result']===-0x1){return _0x4e53b4;}return this['channel'][_0x4dd7('0xb4')](util[_0x4dd7('0x53')](_0x4dd7('0xc2'),_0x14f051));};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0xc3')]=function(_0x3e6424){logger['info'](util['format'](_0x4dd7('0xc4'),_0x3e6424[_0x4dd7('0xa2')]));if(!this[_0x4dd7('0xa6')](_0x3e6424[_0x4dd7('0xbb')])){return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](_0x4dd7('0xbc'));}var _0x206459=_0x3e6424[_0x4dd7('0xbb')];if(this[_0x4dd7('0xa6')](_0x3e6424[_0x4dd7('0x79')])){_0x206459+=','+_0x3e6424[_0x4dd7('0x79')];}var _0x346858=this['channel'][_0x4dd7('0x56')](_0x4dd7('0xc5'),_0x206459);if(_0x346858[_0x4dd7('0xa9')]===-0x1){return _0x346858;}var _0x1c9060=this[_0x4dd7('0x9e')](_0x4dd7('0xbd'),_0x4dd7('0xc6'));if(_0x1c9060[_0x4dd7('0xa9')]===-0x1){return _0x1c9060;}var _0x309449=this[_0x4dd7('0x9e')](_0x4dd7('0xbf'),'SESTEK_ASR_TRANSCRIPT');if(_0x309449['result']===-0x1){return _0x309449;}var _0x52a947=this[_0x4dd7('0x9e')](_0x4dd7('0xc7'),_0x4dd7('0xc8'));if(_0x52a947[_0x4dd7('0xa9')]===-0x1){return _0x52a947;}return this['channel'][_0x4dd7('0xb4')](util[_0x4dd7('0x53')](_0x4dd7('0xc2'),_0x206459));};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0xc9')]=function(_0x1cb2a4){logger['info'](util[_0x4dd7('0x53')](_0x4dd7('0xca'),_0x1cb2a4[_0x4dd7('0xa2')]));if(!this[_0x4dd7('0xa6')](_0x1cb2a4['odbc_id'])){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x1cb2a4,'no\x20database\x20selected');}var _0x507634=this[_0x4dd7('0x18')][_0x4dd7('0x70')](this,_0x1cb2a4['odbc_id']);if(!_0x507634){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x1cb2a4,_0x4dd7('0xcb'));}if(!this['isConfigured'](_0x1cb2a4[_0x4dd7('0x2d')])){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x1cb2a4,'no\x20query\x20configured');}var _0x24766b=_0x1cb2a4[_0x4dd7('0x2d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util['format'](_0x4dd7('0xcc'),_0x24766b));var _0x13ef4a=this[_0x4dd7('0x29')][_0x4dd7('0x70')](this,_0x507634,_0x24766b);this['createSquareDetailsReport'][_0x4dd7('0x70')](this,_0x1cb2a4,_0x24766b);if(!this[_0x4dd7('0xa6')](_0x1cb2a4['variable_id'])){return this[_0x4dd7('0xe')]['noop'](_0x4dd7('0xcd'));}var _0x5d22ad=this[_0x4dd7('0x11')]['sync'](this,_0x1cb2a4['variable_id']);if(!_0x5d22ad){return this[_0x4dd7('0xe')]['error'](_0x1cb2a4,_0x4dd7('0xce'));}var _0x19b37d=this;_0x13ef4a[_0x4dd7('0xcf')](function(_0x40ef05,_0x2dd872){Object[_0x4dd7('0xd0')](_0x40ef05)['forEach'](function(_0x14a18e){_0x19b37d[_0x4dd7('0xe')]['setVariable'](util['format'](_0x4dd7('0xd1'),_0x5d22ad,_0x2dd872,_0x14a18e),_0x40ef05[_0x14a18e]);});});this[_0x4dd7('0xe')][_0x4dd7('0x98')](util['format'](_0x4dd7('0xd2'),_0x5d22ad),_0x13ef4a[_0x4dd7('0x94')]);return this[_0x4dd7('0xe')]['noop'](util[_0x4dd7('0x53')]('variable\x20%s\x20set',_0x5d22ad));};AGIVertices['prototype'][_0x4dd7('0xd3')]=function(_0x4cdb3c){logger[_0x4dd7('0xd4')](util[_0x4dd7('0x53')](_0x4dd7('0xd5'),_0x4cdb3c['label']));if(!this['isConfigured'](_0x4cdb3c[_0x4dd7('0xd6')])){return this['channel'][_0x4dd7('0x4e')](_0x4cdb3c,_0x4dd7('0xd7'));}var _0x3b0d43=this['getUser'][_0x4dd7('0x70')](this,_0x4cdb3c[_0x4dd7('0xd6')]);if(!_0x3b0d43){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x4cdb3c,_0x4dd7('0xd8'));}var _0x4bbee3=this[_0x4dd7('0xe')][_0x4dd7('0x56')](_0x4dd7('0xd9'),[util[_0x4dd7('0x53')](_0x4dd7('0xda'),_0x3b0d43),_0x4cdb3c[_0x4dd7('0x67')],_0x4cdb3c[_0x4dd7('0xdb')],_0x4cdb3c[_0x4dd7('0x64')]]);if(_0x4bbee3['result']===-0x1){return _0x4bbee3;}return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util[_0x4dd7('0x53')](_0x4dd7('0xdc'),_0x4dd7('0xd9')));};AGIVertices[_0x4dd7('0x10')]['dialogflow']=function(_0x3014b1){logger['info'](util[_0x4dd7('0x53')](_0x4dd7('0xdd'),_0x3014b1[_0x4dd7('0xa2')]));if(!this[_0x4dd7('0xa6')](_0x3014b1[_0x4dd7('0x7b')])){return this['channel'][_0x4dd7('0xb4')](_0x4dd7('0xde'));}if(!this[_0x4dd7('0xa6')](_0x3014b1[_0x4dd7('0x5c')])){return this['channel'][_0x4dd7('0xb4')]('no\x20text\x20configured');}this[_0x4dd7('0xe')]['bot']=!![];this['createSquareDetailsReport'](_0x3014b1);this[_0x4dd7('0x41')](_0x3014b1[_0x4dd7('0x5c')],'in');this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util[_0x4dd7('0x53')](_0x4dd7('0xdf'),_0x3014b1[_0x4dd7('0x5c')]));var _0x4eba52=this[_0x4dd7('0x7a')][_0x4dd7('0x70')](this,_0x3014b1);if(_0x4eba52){for(var _0x400518 in _0x4eba52){if(_0x4eba52[_0x4dd7('0x90')](_0x400518)){this[_0x4dd7('0xe')][_0x4dd7('0x98')](util[_0x4dd7('0x53')]('DIALOGFLOW_%s',_0x400518[_0x4dd7('0x6b')]()),_0x4eba52[_0x400518]);}}this[_0x4dd7('0x41')](_0x4eba52[_0x4dd7('0xe0')],_0x4dd7('0xe1'));return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util[_0x4dd7('0x53')](_0x4dd7('0xe2'),_0x4eba52[_0x4dd7('0xe0')]));}return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x3014b1,_0x4dd7('0xe3'));};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0xe4')]=function(_0x4705fc){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0xe5'),_0x4705fc[_0x4dd7('0xa2')]));if(!this[_0x4dd7('0xa6')](_0x4705fc[_0x4dd7('0xe6')])){return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](_0x4dd7('0xe7'));}if(!this['isConfigured'](_0x4705fc['username'])){return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](_0x4dd7('0xe8'));}if(!this['isConfigured'](_0x4705fc['password'])){return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](_0x4dd7('0xe9'));}if(!this[_0x4dd7('0xa6')](_0x4705fc[_0x4dd7('0xea')])){return this[_0x4dd7('0xe')]['noop']('no\x20text\x20configured');}this[_0x4dd7('0xe')][_0x4dd7('0xeb')]=!![];this[_0x4dd7('0x36')](_0x4705fc);this[_0x4dd7('0x41')](_0x4705fc['text'],'in');this[_0x4dd7('0xe')]['noop'](util[_0x4dd7('0x53')](_0x4dd7('0xec'),_0x4705fc[_0x4dd7('0x5c')]));var _0x2f9b29=this[_0x4dd7('0x7c')]['sync'](this,_0x4705fc);if(_0x2f9b29){for(var _0x1ea317 in _0x2f9b29){if(_0x2f9b29[_0x4dd7('0x90')](_0x1ea317)){this[_0x4dd7('0xe')][_0x4dd7('0x98')](util[_0x4dd7('0x53')](_0x4dd7('0xed'),_0x1ea317[_0x4dd7('0x6b')]()),_0x2f9b29[_0x1ea317]);}}this['createSquareMessage'](_0x2f9b29[_0x4dd7('0xe0')],_0x4dd7('0xe1'));if(_0x2f9b29[_0x4dd7('0xee')]){this['channel']['noop'](util[_0x4dd7('0x53')](_0x4dd7('0xef'),_0x2f9b29[_0x4dd7('0xee')]));var _0xf28763=this[_0x4dd7('0xe')][_0x4dd7('0xf0')](_0x2f9b29[_0x4dd7('0xee')]);try{fs[_0x4dd7('0xf1')](_0x2f9b29[_0x4dd7('0xee')]+_0x4dd7('0xf2'));}catch(_0x2e7876){logger['error'](_0x2e7876);}return _0xf28763;}else{return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util[_0x4dd7('0x53')]('SestekNDA\x20Result\x20%s',_0x2f9b29[_0x4dd7('0xe0')]));}}return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x4705fc,_0x4dd7('0xf3'));};AGIVertices['prototype'][_0x4dd7('0xf4')]=function(_0x196296){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0xf5'),_0x196296[_0x4dd7('0xa2')]));return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](_0x4dd7('0xf4'));};AGIVertices[_0x4dd7('0x10')]['ext_dial']=function(_0x25cc06){logger[_0x4dd7('0x2e')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x25cc06[_0x4dd7('0xa2')]));var _0x2ed990='';if(_0x25cc06[_0x4dd7('0xf6')]){if(!this[_0x4dd7('0xa6')](_0x25cc06['trunk_id'])){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x25cc06,_0x4dd7('0xf7'));}else{var _0x3418fc=parseInt(_0x25cc06[_0x4dd7('0xf6')],0xa);if(isNaN(_0x3418fc)){_0x2ed990=_0x25cc06[_0x4dd7('0xf6')];}else{_0x2ed990=this[_0x4dd7('0x1d')][_0x4dd7('0x70')](this,_0x25cc06[_0x4dd7('0xf6')]);if(!_0x2ed990){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x25cc06,_0x4dd7('0xf8'));}}}}else if(_0x25cc06[_0x4dd7('0xf9')]){_0x2ed990=_0x25cc06[_0x4dd7('0xf9')];}else{return this['channel'][_0x4dd7('0x4e')](_0x25cc06,_0x4dd7('0xf7'));}var _0x2e0095=this['channel'][_0x4dd7('0x56')](_0x4dd7('0xd9'),[util[_0x4dd7('0x53')](_0x4dd7('0xfa'),_0x2ed990,_0x25cc06[_0x4dd7('0xb1')]),_0x25cc06[_0x4dd7('0x67')],_0x25cc06['opts'],_0x25cc06[_0x4dd7('0x64')]]);if(_0x2e0095[_0x4dd7('0xa9')]===-0x1){return _0x2e0095;}return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util[_0x4dd7('0x53')](_0x4dd7('0xdc'),'DIAL'));};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0xfb')]=function(_0x4fa251){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0xfc'),_0x4fa251[_0x4dd7('0xa2')]));return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](_0x4dd7('0xfb'));};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0xc')]=function(_0x220e55){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x220e55['label']));if(_0x220e55[_0x4dd7('0xfd')]===0x0){return this[_0x4dd7('0xa0')](_0x220e55);}_0x220e55[_0x4dd7('0xfd')]-=0x1;if(!this[_0x4dd7('0xa6')](_0x220e55['file_id'])){return this[_0x4dd7('0xe')]['error'](_0x220e55,'no\x20file\x20audio\x20selected');}var _0x45b2c6=this[_0x4dd7('0xfe')]['sync'](this,_0x220e55[_0x4dd7('0xff')]);if(!_0x45b2c6){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x220e55,'no\x20file\x20audio\x20found');}if(!this[_0x4dd7('0xa6')](_0x220e55[_0x4dd7('0x100')])){return this[_0x4dd7('0xe')]['error']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x5ec32a=this[_0x4dd7('0xe')]['getData'](_0x45b2c6,_0x220e55['response'],_0x220e55['maxdigit']);var _0x311fc4=_0x5ec32a['result']?_0x5ec32a[_0x4dd7('0xa9')][_0x4dd7('0x101')]():'';logger[_0x4dd7('0x2e')](_0x4dd7('0x102'),JSON[_0x4dd7('0x74')](_0x5ec32a));if(_0x5ec32a['result']===-0x1){this['createSquareDetailsReport'][_0x4dd7('0x70')](this,_0x220e55,_0x311fc4);return _0x5ec32a;}else if(_0x5ec32a[_0x4dd7('0x9d')]==='timeout'){_0x5ec32a[_0x4dd7('0xa9')]=_0x311fc4[_0x4dd7('0x94')]>=parseInt(_0x220e55[_0x4dd7('0x103')])?'x':'i';}else{_0x5ec32a[_0x4dd7('0xa9')]=_0x311fc4[_0x4dd7('0x94')]>=parseInt(_0x220e55[_0x4dd7('0x103')])&&_0x311fc4['length']<=parseInt(_0x220e55[_0x4dd7('0x104')])?'x':'i';}var _0x58ecca=this[_0x4dd7('0x11')][_0x4dd7('0x70')](this,_0x220e55[_0x4dd7('0x100')]);if(!_0x58ecca){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x220e55,'no\x20variable\x20found');}this[_0x4dd7('0xe')]['setVariable'](_0x58ecca,_0x311fc4);if(this['isConfigured'](_0x220e55[_0x4dd7('0x105')])){var _0x3ceade=parseInt(_0x220e55[_0x4dd7('0x105')],0xa);var _0x3b35d1=rs[_0x4dd7('0x106')]({'charset':'*','length':_0x3ceade});var _0xd6d586=_0x311fc4['length'];if(_0xd6d586>0x0){if(_0xd6d586>_0x3ceade){this[_0x4dd7('0x36')][_0x4dd7('0x70')](this,_0x220e55,_0x220e55[_0x4dd7('0x107')]===_0x4dd7('0x108')?_0x3b35d1+_0x311fc4[_0x4dd7('0x109')](_0x3ceade):_0x311fc4[_0x4dd7('0x109')](0x0,_0xd6d586-_0x3ceade)+_0x3b35d1);}else{this[_0x4dd7('0x36')][_0x4dd7('0x70')](this,_0x220e55,rs['generate']({'charset':'*','length':_0xd6d586}));}}else{this[_0x4dd7('0x36')][_0x4dd7('0x70')](this,_0x220e55,'');}}else{this[_0x4dd7('0x36')][_0x4dd7('0x70')](this,_0x220e55,_0x311fc4);}return _0x5ec32a;};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0xd')]=function(_0x1478b1){logger[_0x4dd7('0x2e')](util['format'](_0x4dd7('0x10a'),_0x1478b1[_0x4dd7('0xa2')]));return this['getdigits'](_0x1478b1);};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x10b')]=function(_0xc4c2ea){logger['info'](util['format'](_0x4dd7('0x10c'),_0xc4c2ea[_0x4dd7('0xa2')]));this['createSquareDetailsReport'][_0x4dd7('0x70')](this,_0xc4c2ea,_0xc4c2ea[_0x4dd7('0x10d')]);return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util[_0x4dd7('0x53')]('GOAL\x20%s',_0xc4c2ea['goalname']));};AGIVertices[_0x4dd7('0x10')]['awspolly']=function(_0x5bf57a){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x5bf57a[_0x4dd7('0xa2')]));if(!this[_0x4dd7('0xa6')](_0x5bf57a[_0x4dd7('0x88')])||!this[_0x4dd7('0xa6')](_0x5bf57a[_0x4dd7('0x84')])){return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](_0x4dd7('0x10e'));}if(!this[_0x4dd7('0xa6')](_0x5bf57a[_0x4dd7('0x5c')])){return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](_0x4dd7('0x10f'));}this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util['format']('Trying\x20aws\x20Polly\x20%s',_0x5bf57a[_0x4dd7('0x5c')]));var _0x184ccf=this[_0x4dd7('0x83')][_0x4dd7('0x70')](this,_0x5bf57a);if(_0x184ccf){this['channel'][_0x4dd7('0xb4')](util[_0x4dd7('0x53')](_0x4dd7('0x110'),_0x184ccf));var _0x5d0d8d=this[_0x4dd7('0xe')][_0x4dd7('0xf0')](_0x184ccf);try{fs[_0x4dd7('0xf1')](_0x184ccf+_0x4dd7('0xf2'));}catch(_0x37a416){logger[_0x4dd7('0x4e')](_0x37a416);}return _0x5d0d8d;}return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x5bf57a,_0x4dd7('0x111'));};AGIVertices[_0x4dd7('0x10')]['awslex']=function(_0x317033){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x317033['label']));if(!this[_0x4dd7('0xa6')](_0x317033[_0x4dd7('0x88')])||!this[_0x4dd7('0xa6')](_0x317033['aws_secret_access_key'])){return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](_0x4dd7('0x10e'));}if(!this['isConfigured'](_0x317033[_0x4dd7('0x8a')])){return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](_0x4dd7('0x112'));}if(!this[_0x4dd7('0xa6')](_0x317033[_0x4dd7('0x5c')])){return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](_0x4dd7('0x10f'));}this[_0x4dd7('0xe')][_0x4dd7('0xeb')]=!![];this['createSquareDetailsReport'](_0x317033);this[_0x4dd7('0x41')](_0x317033[_0x4dd7('0x5c')],'in');this[_0x4dd7('0xe')]['noop'](util[_0x4dd7('0x53')](_0x4dd7('0x113'),_0x317033['text']));var _0x12f99d=this['awsLex'][_0x4dd7('0x70')](this,_0x317033);if(_0x12f99d){for(var _0x44d6ee in _0x12f99d){if(_0x12f99d[_0x4dd7('0x90')](_0x44d6ee)&&_[_0x4dd7('0x91')](_0x12f99d[_0x44d6ee])){this[_0x4dd7('0xe')][_0x4dd7('0x98')](util[_0x4dd7('0x53')]('AWS_LEX_%s',_0x44d6ee[_0x4dd7('0x6b')]()),_0x12f99d[_0x44d6ee]);}}if(_['isNil'](_0x12f99d['message'])){return this['channel']['noop'](_0x4dd7('0x114'));}else{this[_0x4dd7('0x41')](_0x12f99d['message'],_0x4dd7('0xe1'));return this['channel'][_0x4dd7('0xb4')](util[_0x4dd7('0x53')](_0x4dd7('0x115'),_0x12f99d[_0x4dd7('0x116')]));}}return this[_0x4dd7('0xe')]['error'](_0x317033,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x117')]=function(_0x599944){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0x118'),_0x599944['label'],_0x599944[_0x4dd7('0x67')]));if(!this[_0x4dd7('0xa6')](_0x599944[_0x4dd7('0x7b')])){return this[_0x4dd7('0xe')][_0x4dd7('0xb4')]('no\x20key\x20configured');}var _0x3a4e05='wav';var _0x4df88f=util['format'](_0x4dd7('0x119'),FILES_PATH,rs[_0x4dd7('0x106')](0x4));var _0x523fbd=util[_0x4dd7('0x53')](_0x4dd7('0x97'),_0x4df88f,_0x3a4e05);var _0x4a6c26=!![];if(_0x599944[_0x4dd7('0x11a')]===_0x4dd7('0x11b')){_0x4a6c26=![];}var _0x130b54=this['channel']['recordFile'](_0x4df88f,_0x3a4e05,_0x599944[_0x4dd7('0x11c')],_0x599944[_0x4dd7('0x67')],undefined,_0x4a6c26);if(_0x130b54[_0x4dd7('0xa9')]!==-0x1){this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util[_0x4dd7('0x53')]('google\x20%s\x20file\x20created',_0x523fbd));var _0x3e20c4=this[_0x4dd7('0x8b')][_0x4dd7('0x70')](this,_0x599944,_0x523fbd);if(_0x3e20c4){for(var _0x408858 in _0x3e20c4){if(_0x3e20c4[_0x4dd7('0x90')](_0x408858)){this[_0x4dd7('0xe')][_0x4dd7('0x98')](util[_0x4dd7('0x53')](_0x4dd7('0x11d'),_0x408858[_0x4dd7('0x6b')]()),_0x3e20c4[_0x408858]);}}return this[_0x4dd7('0xe')]['noop'](util[_0x4dd7('0x53')](_0x4dd7('0x11e'),JSON['stringify'](_0x3e20c4)));}}return _0x130b54;};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x11f')]=function(_0x56d87a){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x56d87a[_0x4dd7('0xa2')]));if(!this[_0x4dd7('0xa6')](_0x56d87a['appid'])){return this['channel'][_0x4dd7('0xb4')](_0x4dd7('0x120'));}if(!this[_0x4dd7('0xa6')](_0x56d87a[_0x4dd7('0x8d')])){return this[_0x4dd7('0xe')]['noop'](_0x4dd7('0x121'));}var _0x4bde84='wav';var _0x556a38=util['format'](_0x4dd7('0x119'),FILES_PATH,rs[_0x4dd7('0x106')](0x4));var _0xcb3523=util[_0x4dd7('0x53')](_0x4dd7('0x97'),_0x556a38,_0x4bde84);var _0x2fc06e=!![];if(_0x56d87a[_0x4dd7('0x11a')]===_0x4dd7('0x11b')){_0x2fc06e=![];}var _0xa7f3c4=this[_0x4dd7('0xe')][_0x4dd7('0x122')](_0x556a38,_0x4bde84,_0x56d87a[_0x4dd7('0x11c')],_0x56d87a[_0x4dd7('0x67')],undefined,_0x2fc06e);if(_0xa7f3c4['result']!==-0x1){this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util[_0x4dd7('0x53')]('tilde\x20%s\x20file\x20created',_0xcb3523));var _0x1d2d17=this[_0x4dd7('0x8c')]['sync'](this,_0x56d87a,_0xcb3523);if(_0x1d2d17){for(var _0x3f44d1 in _0x1d2d17){if(_0x1d2d17[_0x4dd7('0x90')](_0x3f44d1)){this['channel'][_0x4dd7('0x98')](util[_0x4dd7('0x53')]('TILDE_ASR_%s',_0x3f44d1['toUpperCase']()),_0x1d2d17[_0x3f44d1]);}}return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util[_0x4dd7('0x53')]('TildeASR\x20Result\x20%s',JSON[_0x4dd7('0x74')](_0x1d2d17)));}}return _0xa7f3c4;};AGIVertices['prototype'][_0x4dd7('0x123')]=function(_0x344ba5){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0x124'),_0x344ba5['label']));return this[_0x4dd7('0xe')][_0x4dd7('0x125')](_0x344ba5[_0x4dd7('0x126')],_0x344ba5[_0x4dd7('0x3c')],_0x344ba5[_0x4dd7('0x3d')]);};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x127')]=function(_0x211c33){logger['info'](util['format'](_0x4dd7('0x128'),_0x211c33[_0x4dd7('0xa2')]));if(!this['isConfigured'](_0x211c33[_0x4dd7('0x129')])){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x211c33,'no\x20condition\x20configured');}try{var _0x796a5a=eval(_0x211c33[_0x4dd7('0x129')])?_0x4dd7('0x12a'):'false';this[_0x4dd7('0xe')]['noop'](util[_0x4dd7('0x53')](_0x4dd7('0x12b'),_0x211c33[_0x4dd7('0x129')],_0x796a5a));return{'code':0xc8,'result':_0x796a5a};}catch(_0x5f139e){return{'code':0xc8,'result':_0x4dd7('0x12c')};}};AGIVertices['prototype'][_0x4dd7('0x12d')]=function(_0x1d65df){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0x12e'),_0x1d65df[_0x4dd7('0xa2')]));if(!this[_0x4dd7('0xa6')](_0x1d65df[_0x4dd7('0x12f')])){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x1d65df,_0x4dd7('0x130'));}var _0x9fc5f8=this[_0x4dd7('0x24')][_0x4dd7('0x70')](this,_0x1d65df[_0x4dd7('0x12f')]);if(!_0x9fc5f8){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x1d65df,'no\x20intervals\x20found');}for(var _0x2dbd0e=0x0;_0x2dbd0e<_0x9fc5f8['length'];_0x2dbd0e+=0x1){var _0x51f399=this[_0x4dd7('0xe')][_0x4dd7('0x11')](util[_0x4dd7('0x53')](_0x4dd7('0x131'),_0x9fc5f8[_0x2dbd0e]));if(_0x51f399[_0x4dd7('0xa9')]===-0x1){return _0x51f399;}logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0x132'),_0x9fc5f8[_0x2dbd0e],_0x51f399[_0x4dd7('0x9d')]));if(_0x51f399[_0x4dd7('0x9d')]===_0x4dd7('0x12a')){logger[_0x4dd7('0x2e')](util['format']('IFTIME\x20%s\x20%s',_0x9fc5f8[_0x2dbd0e],_0x4dd7('0x12a')));this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util[_0x4dd7('0x53')](_0x4dd7('0x132'),_0x9fc5f8[_0x2dbd0e],_0x4dd7('0x12a')));return{'code':0xc8,'result':_0x4dd7('0x12a')};}else{logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0x132'),_0x9fc5f8[_0x2dbd0e],_0x4dd7('0x12c')));this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util[_0x4dd7('0x53')](_0x4dd7('0x132'),_0x9fc5f8[_0x2dbd0e],'false'));}}return{'code':0xc8,'result':_0x4dd7('0x12c')};};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x133')]=function(_0x5112a6){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x5112a6['label']));return this[_0x4dd7('0xe')][_0x4dd7('0x133')]();};AGIVertices['prototype'][_0x4dd7('0x134')]=function(_0x3d8f4e){logger[_0x4dd7('0x2e')](util['format'](_0x4dd7('0x135'),_0x3d8f4e[_0x4dd7('0xa2')]));if(!this[_0x4dd7('0xa6')](_0x3d8f4e[_0x4dd7('0x7b')])){return this[_0x4dd7('0xe')]['noop'](_0x4dd7('0xde'));}var _0x3af646=_0x4dd7('0x136');var _0x41aba1=util[_0x4dd7('0x53')](_0x4dd7('0x119'),FILES_PATH,rs[_0x4dd7('0x106')](0x4));var _0x458d76=util[_0x4dd7('0x53')](_0x4dd7('0x97'),_0x41aba1,_0x3af646);var _0x55b4e5=!![];if(_0x3d8f4e[_0x4dd7('0x11a')]===_0x4dd7('0x11b')){_0x55b4e5=![];}var _0x3aab64=this[_0x4dd7('0xe')][_0x4dd7('0x122')](_0x41aba1,_0x3af646,_0x3d8f4e[_0x4dd7('0x11c')],_0x3d8f4e[_0x4dd7('0x67')],undefined,_0x55b4e5);if(_0x3aab64[_0x4dd7('0xa9')]!==-0x1){this[_0x4dd7('0xe')]['noop'](util[_0x4dd7('0x53')](_0x4dd7('0x137'),_0x458d76));var _0x3bde45=this['ispeechASR'][_0x4dd7('0x70')](this,_0x3d8f4e,_0x458d76);if(_0x3bde45){for(var _0x520e98 in _0x3bde45){if(_0x3bde45[_0x4dd7('0x90')](_0x520e98)){this['channel'][_0x4dd7('0x98')](util['format'](_0x4dd7('0x138'),_0x520e98['toUpperCase']()),_0x3bde45[_0x520e98]);}}return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util[_0x4dd7('0x53')](_0x4dd7('0x139'),JSON[_0x4dd7('0x74')](_0x3bde45)));}}return _0x3aab64;};AGIVertices[_0x4dd7('0x10')]['ispeechtts']=function(_0x1b4c23){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0x13a'),_0x1b4c23[_0x4dd7('0xa2')]));if(!this[_0x4dd7('0xa6')](_0x1b4c23[_0x4dd7('0x7b')])){return this[_0x4dd7('0xe')]['noop']('no\x20key\x20configured');}if(!this[_0x4dd7('0xa6')](_0x1b4c23[_0x4dd7('0x5c')])){return this[_0x4dd7('0xe')]['noop'](_0x4dd7('0x10f'));}this['channel'][_0x4dd7('0xb4')](util[_0x4dd7('0x53')](_0x4dd7('0x13b'),_0x1b4c23['text']));var _0x162f7b=this[_0x4dd7('0x7d')][_0x4dd7('0x70')](this,_0x1b4c23);if(_0x162f7b){this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util['format'](_0x4dd7('0x137'),_0x162f7b));var _0x34d016=this[_0x4dd7('0xe')][_0x4dd7('0xf0')](_0x162f7b,_0x1b4c23[_0x4dd7('0x11c')]);try{fs[_0x4dd7('0xf1')](_0x162f7b+_0x4dd7('0xf2'));}catch(_0x1f4c5a){logger['error'](_0x1f4c5a);}return _0x34d016;}return this['channel'][_0x4dd7('0x4e')](_0x1b4c23,_0x4dd7('0x13c'));};AGIVertices[_0x4dd7('0x10')]['login']=function(_0xb7faff){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0x13d'),_0xb7faff[_0x4dd7('0xa2')]));if(!this[_0x4dd7('0xa6')](_0xb7faff['findBy'])){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0xb7faff,_0x4dd7('0x13e'));}logger['info'](util[_0x4dd7('0x53')](_0x4dd7('0x13f'),this[_0x4dd7('0xe')]['callerid'],_0xb7faff[_0x4dd7('0x140')]));var _0x396613=this[_0x4dd7('0x51')]['sync'](this,_0xb7faff[_0x4dd7('0x140')]);if(_0x396613){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4dd7('0xe')][_0x4dd7('0x3a')],_0xb7faff[_0x4dd7('0x140')]));this['channel']['noop'](util[_0x4dd7('0x53')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4dd7('0xe')][_0x4dd7('0x3a')],_0xb7faff[_0x4dd7('0x140')]));return{'code':0xc8,'result':'success'};}else{logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0x141'),this['channel'][_0x4dd7('0x3a')],_0xb7faff[_0x4dd7('0x140')]));this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util[_0x4dd7('0x53')](_0x4dd7('0x141'),this[_0x4dd7('0xe')]['callerid'],_0xb7faff[_0x4dd7('0x140')]));return{'code':0xc8,'result':_0x4dd7('0x142')};}};AGIVertices['prototype'][_0x4dd7('0x143')]=function(_0x2019e3){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0x144'),_0x2019e3[_0x4dd7('0xa2')]));if(!this['isConfigured'](_0x2019e3[_0x4dd7('0x140')])){return this['channel'][_0x4dd7('0x4e')](_0x2019e3,_0x4dd7('0x13e'));}logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0x13f'),this[_0x4dd7('0xe')][_0x4dd7('0x3a')],_0x2019e3[_0x4dd7('0x140')]));var _0x5e7dec=this[_0x4dd7('0x50')]['sync'](this,_0x2019e3[_0x4dd7('0x140')]);if(_0x5e7dec){logger['info'](util[_0x4dd7('0x53')](_0x4dd7('0x145'),this[_0x4dd7('0xe')][_0x4dd7('0x3a')],_0x2019e3[_0x4dd7('0x140')]));this[_0x4dd7('0xe')]['noop'](util[_0x4dd7('0x53')](_0x4dd7('0x145'),this[_0x4dd7('0xe')]['callerid'],_0x2019e3[_0x4dd7('0x140')]));return{'code':0xc8,'result':_0x4dd7('0x146')};}else{logger[_0x4dd7('0x2e')](util['format'](_0x4dd7('0x141'),this[_0x4dd7('0xe')][_0x4dd7('0x3a')],_0x2019e3[_0x4dd7('0x140')]));this['channel'][_0x4dd7('0xb4')](util[_0x4dd7('0x53')](_0x4dd7('0x141'),this[_0x4dd7('0xe')][_0x4dd7('0x3a')],_0x2019e3[_0x4dd7('0x140')]));return{'code':0xc8,'result':_0x4dd7('0x142')};}};AGIVertices[_0x4dd7('0x10')]['math']=function(_0x1f3e13){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0x147'),_0x1f3e13[_0x4dd7('0xa2')]));if(!this['isConfigured'](_0x1f3e13[_0x4dd7('0x148')])){return this['channel'][_0x4dd7('0x4e')](_0x1f3e13,_0x4dd7('0x149'));}this['channel'][_0x4dd7('0xb4')](util['format'](_0x4dd7('0x14a'),_0x1f3e13[_0x4dd7('0x148')]));var _0x2bf7f2=eval(_0x1f3e13[_0x4dd7('0x148')]);if(!this[_0x4dd7('0xa6')](_0x1f3e13[_0x4dd7('0x100')])){return this['channel'][_0x4dd7('0xb4')](_0x4dd7('0xcd'));}var _0x5cabb6=this[_0x4dd7('0x11')][_0x4dd7('0x70')](this,_0x1f3e13['variable_id']);if(!_0x5cabb6){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x1f3e13,_0x4dd7('0xce'));}if(_['isArray'](_0x2bf7f2)){var _0x1a93c3=this;_0x2bf7f2[_0x4dd7('0xcf')](function(_0x55fe96,_0x2b6ef0){_0x1a93c3[_0x4dd7('0xe')][_0x4dd7('0x98')](util[_0x4dd7('0x53')]('%s[%s]',_0x5cabb6,_0x2b6ef0),_0x55fe96);});return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util[_0x4dd7('0x53')](_0x4dd7('0x14b'),_0x5cabb6));}else{return this[_0x4dd7('0xe')]['setVariable'](_0x5cabb6,_0x2bf7f2);}};AGIVertices['prototype'][_0x4dd7('0x14c')]=function(_0x223fb2){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0x14d'),_0x223fb2[_0x4dd7('0xa2')]));if(_0x223fb2[_0x4dd7('0xfd')]===0x0){return this[_0x4dd7('0xa0')](_0x223fb2);}_0x223fb2[_0x4dd7('0xfd')]-=0x1;if(!this[_0x4dd7('0xa6')](_0x223fb2[_0x4dd7('0xff')])){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x223fb2,_0x4dd7('0x14e'));}var _0x162ff1=this[_0x4dd7('0xfe')][_0x4dd7('0x70')](this,_0x223fb2['file_id']);if(!_0x162ff1){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x223fb2,'no\x20file\x20audio\x20found');}var _0x2f8955=this[_0x4dd7('0xe')][_0x4dd7('0x14f')](_0x162ff1,_0x223fb2['response'],_0x223fb2[_0x4dd7('0x150')]);var _0x49cd87=_0x2f8955[_0x4dd7('0xa9')];if(_0x2f8955[_0x4dd7('0xa9')]===-0x1){this[_0x4dd7('0x36')][_0x4dd7('0x70')](this,_0x223fb2,'-1');return _0x2f8955;}else if(_0x2f8955['extra']==='timeout'){_0x2f8955[_0x4dd7('0xa9')]=_0x2f8955['result'][_0x4dd7('0x94')]>0x0?_0x2f8955[_0x4dd7('0xa9')]:'t';}else if(_[_0x4dd7('0x43')](_0x2f8955[_0x4dd7('0xa9')])){_0x2f8955[_0x4dd7('0xa9')]='#';_0x49cd87='#';}if(!this['isConfigured'](_0x223fb2[_0x4dd7('0x100')])){this['channel'][_0x4dd7('0xb4')](_0x4dd7('0xcd'));}else{var _0x5b6e77=this[_0x4dd7('0x11')][_0x4dd7('0x70')](this,_0x223fb2[_0x4dd7('0x100')]);if(!_0x5b6e77){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x223fb2,_0x4dd7('0xce'));}this[_0x4dd7('0xe')]['setVariable'](_0x5b6e77,_0x49cd87);}this['createSquareDetailsReport'][_0x4dd7('0x70')](this,_0x223fb2,_0x49cd87);return _0x2f8955;};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0xb4')]=function(_0x1b8af2){logger['info'](util[_0x4dd7('0x53')](_0x4dd7('0x151'),_0x1b8af2[_0x4dd7('0xa2')]));return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](_0x1b8af2[_0x4dd7('0x152')]||_0x1b8af2[_0x4dd7('0xa2')]);};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x153')]=function(_0xd915e5){logger['info'](util[_0x4dd7('0x53')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0xd915e5[_0x4dd7('0xa2')]));if(!this[_0x4dd7('0xa6')](_0xd915e5[_0x4dd7('0x140')])){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0xd915e5,'no\x20find\x20by\x20configured');}logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0x13f'),this['channel'][_0x4dd7('0x3a')],_0xd915e5[_0x4dd7('0x140')]));var _0x1e09f1=this[_0x4dd7('0x154')]['sync'](this,_0xd915e5[_0x4dd7('0x155')]);var _0x33a456=this[_0x4dd7('0x4c')]['sync'](this,_0xd915e5[_0x4dd7('0x140')],_0x1e09f1);if(_0x33a456){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0x145'),this['channel'][_0x4dd7('0x3a')],_0xd915e5[_0x4dd7('0x140')]));this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util[_0x4dd7('0x53')](_0x4dd7('0x145'),this['channel'][_0x4dd7('0x3a')],_0xd915e5['findBy']));return{'code':0xc8,'result':_0x4dd7('0x146')};}else{logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0x141'),this[_0x4dd7('0xe')][_0x4dd7('0x3a')],_0xd915e5[_0x4dd7('0x140')]));this[_0x4dd7('0xe')]['noop'](util['format'](_0x4dd7('0x145'),this['channel'][_0x4dd7('0x3a')],_0xd915e5['findBy']));return{'code':0xc8,'result':_0x4dd7('0x142')};}};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x156')]=function(_0x5e2856){logger['info'](util[_0x4dd7('0x53')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x5e2856[_0x4dd7('0xa2')]));if(!this[_0x4dd7('0xa6')](_0x5e2856['file_id'])){return this['channel'][_0x4dd7('0x4e')](_0x5e2856,'no\x20file\x20audio\x20selected');}var _0x312f87=this[_0x4dd7('0xfe')][_0x4dd7('0x70')](this,_0x5e2856[_0x4dd7('0xff')]);if(!_0x312f87){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x5e2856,_0x4dd7('0x157'));}var _0x33a715=this[_0x4dd7('0xe')][_0x4dd7('0x56')](_0x4dd7('0x158'),[_0x312f87,_0x5e2856[_0x4dd7('0xdb')]]);if(_0x33a715['result']===-0x1){return _0x33a715;}return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util[_0x4dd7('0x53')](_0x4dd7('0x159'),_0x4dd7('0x158'),_0x312f87));};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x15a')]=function(_0x2b9e28){logger[_0x4dd7('0x2e')](util['format'](_0x4dd7('0x15b'),_0x2b9e28[_0x4dd7('0xa2')]));if(!this[_0x4dd7('0xa6')](_0x2b9e28[_0x4dd7('0x15c')])){return this[_0x4dd7('0xe')]['error'](_0x2b9e28,_0x4dd7('0x15d'));}var _0x43de4d='';var _0x2ae794=parseInt(_0x2b9e28[_0x4dd7('0x15c')],0xa);if(isNaN(_0x2ae794)){_0x43de4d=_0x2b9e28[_0x4dd7('0x15c')];}else{_0x43de4d=this[_0x4dd7('0x14')][_0x4dd7('0x70')](this,_0x2b9e28[_0x4dd7('0x15c')]);if(!_0x43de4d){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x2b9e28,'no\x20queue\x20found');}}var _0x56ef60='';if(this['isConfigured'](_0x2b9e28[_0x4dd7('0xff')])){var _0x3d2618=this[_0x4dd7('0xfe')][_0x4dd7('0x70')](this,_0x2b9e28['file_id']);if(_0x3d2618){_0x56ef60=_0x3d2618;}}this[_0x4dd7('0x36')][_0x4dd7('0x70')](this,_0x2b9e28,_0x43de4d);if(_0x2b9e28[_0x4dd7('0xdb')][_0x4dd7('0x15e')]('x')<0x0){_0x2b9e28[_0x4dd7('0xdb')]+='x';}if(_0x2b9e28[_0x4dd7('0xdb')][_0x4dd7('0x15e')]('X')<0x0){_0x2b9e28[_0x4dd7('0xdb')]+='X';}this[_0x4dd7('0xe')][_0x4dd7('0x98')](_0x4dd7('0x15f'),_0x43de4d?_0x43de4d[_0x4dd7('0x160')]():'');var _0x134946=this[_0x4dd7('0xe')]['exec']('QUEUE',[_0x43de4d,_0x2b9e28[_0x4dd7('0xdb')],_0x2b9e28['url'],_0x56ef60,_0x2b9e28[_0x4dd7('0x67')],_0x2b9e28[_0x4dd7('0x7')],_0x2b9e28[_0x4dd7('0x161')],_0x2b9e28[_0x4dd7('0x162')],'',_0x2b9e28['position']]);if(_0x134946[_0x4dd7('0xa9')]===-0x1){return _0x134946;}return this['channel'][_0x4dd7('0xb4')](util['format'](_0x4dd7('0x159'),'QUEUE',_0x43de4d));};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x163')]=function(_0x304ffb){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0x164'),_0x304ffb['label']));var _0x5e56a9=_0x304ffb[_0x4dd7('0x165')]||_0x4dd7('0x136');var _0x45db77=util['format'](_0x4dd7('0x166'),this['channel'][_0x4dd7('0x37')],rs['generate'](0x5));var _0xe12e0f=util['format'](_0x4dd7('0x167'),FILES_PATH,_0x45db77,_0x5e56a9);var _0x3d42a1=util[_0x4dd7('0x53')](_0x4dd7('0x119'),FILES_PATH,_0x45db77);this[_0x4dd7('0x168')][_0x4dd7('0x70')](this,_0x304ffb,_0x45db77,_0xe12e0f);this['channel'][_0x4dd7('0x98')]('RECORDING_SAVENAME',_0x45db77);logger[_0x4dd7('0x2e')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x3d42a1,_0x5e56a9,_0x304ffb[_0x4dd7('0x169')],_0x304ffb[_0x4dd7('0x67')]);return this[_0x4dd7('0xe')]['recordFile'](_0x3d42a1,_0x5e56a9,_0x304ffb[_0x4dd7('0x169')],_0x304ffb[_0x4dd7('0x67')],undefined,!![]);};AGIVertices['prototype'][_0x4dd7('0x16a')]=function(_0x2dbd60){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0x16b'),_0x2dbd60[_0x4dd7('0xa2')]));if(!this[_0x4dd7('0xa6')](_0x2dbd60[_0x4dd7('0x64')])){return this[_0x4dd7('0xe')]['noop'](_0x4dd7('0x16c'));}var _0x232a5f=this[_0x4dd7('0x63')][_0x4dd7('0x70')](this,_0x2dbd60);logger[_0x4dd7('0x2e')](util['format'](_0x4dd7('0x16d'),util[_0x4dd7('0x16e')](_0x232a5f,{'showHidden':![],'depth':null})));if(!this[_0x4dd7('0xa6')](_0x2dbd60[_0x4dd7('0x100')])){return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](_0x4dd7('0x16f'));}var _0x4c41bd=this[_0x4dd7('0x11')][_0x4dd7('0x70')](this,_0x2dbd60['variable_id']);if(!_0x4c41bd){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x2dbd60,_0x4dd7('0xce'));}this['channel'][_0x4dd7('0x98')](util['format'](_0x4dd7('0x170'),_0x4c41bd),_0x232a5f['statusCode']?_0x232a5f['statusCode']:_0x4dd7('0x171'));this['channel']['setVariable'](util[_0x4dd7('0x53')]('%s_STATUS_MESSAGE',_0x4c41bd),_0x232a5f[_0x4dd7('0x77')]?_0x232a5f[_0x4dd7('0x77')]:'OK');if(_0x232a5f[_0x4dd7('0x6c')]){try{this[_0x4dd7('0x95')](_0x232a5f[_0x4dd7('0x6c')],_0x4c41bd);}catch(_0x161e60){logger[_0x4dd7('0x4e')](util[_0x4dd7('0x53')](_0x4dd7('0x172'),_0x4c41bd));}}return this[_0x4dd7('0xe')]['noop'](util[_0x4dd7('0x53')](_0x4dd7('0x173'),_0x4c41bd));};AGIVertices['prototype']['saydigits']=function(_0x1a0932){logger['info'](util[_0x4dd7('0x53')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x1a0932[_0x4dd7('0xa2')]));return this[_0x4dd7('0xe')][_0x4dd7('0x174')](_0x1a0932[_0x4dd7('0x175')]['replace'](/\s+/g,''),_0x1a0932[_0x4dd7('0x169')]);};AGIVertices['prototype']['saynumber']=function(_0x1b3038){logger['info'](util['format'](_0x4dd7('0x176'),_0x1b3038[_0x4dd7('0xa2')]));return this[_0x4dd7('0xe')][_0x4dd7('0x177')](_0x1b3038['number'][_0x4dd7('0x58')](/\s+/g,''),_0x1b3038[_0x4dd7('0x169')]);};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x178')]=function(_0x176f4b){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0x179'),_0x176f4b[_0x4dd7('0xa2')]));return this[_0x4dd7('0xe')]['sayPhonetic'](_0x176f4b[_0x4dd7('0x5c')],_0x176f4b[_0x4dd7('0x169')]);};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x17a')]=function(_0x5b7c68){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0x17b'),_0x5b7c68[_0x4dd7('0xa2')]));if(!this[_0x4dd7('0xa6')](_0x5b7c68['account_id'])){return this['channel']['noop'](_0x4dd7('0x17c'));}var _0x1dccb0=this['getMailAccount']['sync'](this,_0x5b7c68[_0x4dd7('0x17d')]);if(!_0x1dccb0||!_0x1dccb0['Smtp']){return this['channel'][_0x4dd7('0x4e')](_0x5b7c68,_0x4dd7('0x17e'));}var _0x167d5d={'from':util[_0x4dd7('0x53')](_0x4dd7('0x17f'),_0x1dccb0[_0x4dd7('0x13')],_0x1dccb0[_0x4dd7('0x180')]||_0x1dccb0['Smtp']['user']),'to':_0x5b7c68['to']||'','cc':_0x5b7c68['cc']||'','bcc':_0x5b7c68[_0x4dd7('0x181')]||'','subject':_0x5b7c68[_0x4dd7('0x182')],'html':_0x5b7c68[_0x4dd7('0x5c')],'text':_0x5b7c68[_0x4dd7('0x5c')]};var _0x3ee00d={'tls':{'rejectUnauthorized':![]}};if(_0x1dccb0[_0x4dd7('0x183')][_0x4dd7('0x184')]){_0x3ee00d[_0x4dd7('0x184')]=_0x1dccb0[_0x4dd7('0x183')][_0x4dd7('0x184')];}else{_0x3ee00d[_0x4dd7('0x185')]=_0x1dccb0[_0x4dd7('0x183')][_0x4dd7('0x185')];_0x3ee00d['port']=_0x1dccb0[_0x4dd7('0x183')][_0x4dd7('0x186')];_0x3ee00d[_0x4dd7('0x187')]=_0x1dccb0[_0x4dd7('0x183')][_0x4dd7('0x187')];}if(_0x1dccb0['Smtp'][_0x4dd7('0x188')]){_0x3ee00d[_0x4dd7('0x189')]={'user':_0x1dccb0[_0x4dd7('0x183')]['user'],'pass':_0x1dccb0['Smtp'][_0x4dd7('0x18a')]};}if(this[_0x4dd7('0xa6')](_0x5b7c68[_0x4dd7('0x18b')])){}logger[_0x4dd7('0xd4')](_0x4dd7('0x18c'),JSON[_0x4dd7('0x74')](_0x167d5d));this[_0x4dd7('0x36')][_0x4dd7('0x70')](this,_0x5b7c68,_0x5b7c68['account_id']);this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util['format']('Trying\x20SendMail\x20with\x20account\x20%s',_0x1dccb0[_0x4dd7('0x13')]));this[_0x4dd7('0x22')]['sync'](this,_0x3ee00d,_0x167d5d);return this[_0x4dd7('0xe')]['noop'](_0x4dd7('0x18d'));};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x18e')]=function(_0x23af89){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0x18f'),_0x23af89[_0x4dd7('0xa2')]));return this['channel'][_0x4dd7('0xb4')](_0x4dd7('0x190'));};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x191')]=function(_0x5054af){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0x192'),_0x5054af[_0x4dd7('0xa2')]));if(!this['isConfigured'](_0x5054af[_0x4dd7('0x193')])){return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](_0x4dd7('0x194'));}var _0x5a1470=this[_0x4dd7('0x33')][_0x4dd7('0x70')](this,_0x5054af[_0x4dd7('0x193')]);if(!_0x5a1470){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x5054af,'no\x20sms\x20account\x20found');}var _0x563ea1={'body':_0x5054af[_0x4dd7('0x195')],'phone':_0x5054af['to']||'','SmsAccountId':_0x5a1470['id']};logger[_0x4dd7('0xd4')](_0x4dd7('0x196'),JSON[_0x4dd7('0x74')](_0x563ea1));this[_0x4dd7('0x36')][_0x4dd7('0x70')](this,_0x5054af,_0x5054af[_0x4dd7('0x193')]);this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util[_0x4dd7('0x53')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x5a1470['name']));this[_0x4dd7('0x35')][_0x4dd7('0x70')](this,_0x563ea1);return this[_0x4dd7('0xe')]['noop'](_0x4dd7('0x197'));};AGIVertices['prototype'][_0x4dd7('0x198')]=function(_0x9e3a76){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0x199'),_0x9e3a76[_0x4dd7('0xa2')]));if(!this[_0x4dd7('0xa6')](_0x9e3a76[_0x4dd7('0x100')])){return this[_0x4dd7('0xe')]['error'](_0x9e3a76,_0x4dd7('0x19a'));}var _0x27c895=this[_0x4dd7('0x11')][_0x4dd7('0x70')](this,_0x9e3a76[_0x4dd7('0x100')]);if(!_0x27c895){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x9e3a76,_0x4dd7('0xce'));}return this[_0x4dd7('0xe')][_0x4dd7('0x98')](_0x27c895,_0x9e3a76[_0x4dd7('0x19b')]);};AGIVertices[_0x4dd7('0x10')]['start']=function(_0x527c8f){logger['info'](util[_0x4dd7('0x53')](_0x4dd7('0x19c'),_0x527c8f['label']));this[_0x4dd7('0xe')]['noop'](_0x4dd7('0x19d'));if(_0x527c8f[_0x4dd7('0xaa')]==='yes'){this[_0x4dd7('0xe')]['noop']('Answer');return this[_0x4dd7('0xe')]['answer']();}return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](_0x4dd7('0x19e'));};AGIVertices['prototype'][_0x4dd7('0x19f')]=function(_0xf749a3){logger['info'](util[_0x4dd7('0x53')](_0x4dd7('0x1a0'),_0xf749a3[_0x4dd7('0xa2')]));if(!this[_0x4dd7('0xa6')](_0xf749a3[_0x4dd7('0x1a1')])){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0xf749a3,_0x4dd7('0x1a2'));}var _0x32d4f4=this[_0x4dd7('0x17')]['sync'](this,_0xf749a3[_0x4dd7('0x1a1')]);if(!this[_0x4dd7('0xa6')](_0x32d4f4)){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0xf749a3,util['format'](_0x4dd7('0x1a3'),_0xf749a3['project_id']));}if(_0x32d4f4===this[_0x4dd7('0xe')][_0x4dd7('0x39')]){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0xf749a3,_0x4dd7('0x1a4'));}this[_0x4dd7('0x36')][_0x4dd7('0x70')](this,_0xf749a3,_0x32d4f4);var _0x1e4e99=this[_0x4dd7('0xe')][_0x4dd7('0x56')](_0x4dd7('0x1a5'),util[_0x4dd7('0x53')](_0x4dd7('0x1a6'),config[_0x4dd7('0x7')][_0x4dd7('0x185')]||_0x4dd7('0x1a7'),_0x32d4f4,this[_0x4dd7('0xe')][_0x4dd7('0x39')]));if(_0x1e4e99[_0x4dd7('0xa9')]===-0x1){return _0x1e4e99;}return this[_0x4dd7('0xe')]['noop'](util[_0x4dd7('0x53')](_0x4dd7('0x159'),_0x4dd7('0x1a5'),_0x32d4f4));};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x1a8')]=function(_0x11f9fa){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x11f9fa[_0x4dd7('0xa2')]));var _0x110b48=this[_0x4dd7('0x55')][_0x4dd7('0x70')](this,_0x11f9fa[_0x4dd7('0xa3')]);this['createSquareDetailsReport'][_0x4dd7('0x70')](this,_0x11f9fa,_0x11f9fa[_0x4dd7('0xa3')]);if(this['isConfigured'](_0x11f9fa[_0x4dd7('0x100')])){var _0x318f92=this[_0x4dd7('0x11')][_0x4dd7('0x70')](this,_0x11f9fa['variable_id']);if(_0x318f92){this['channel']['setVariable'](_0x318f92,_0x110b48);return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util['format'](_0x4dd7('0x1a9'),_0x11f9fa[_0x4dd7('0xa3')],_0x318f92));}}return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util['format'](_0x4dd7('0x1aa'),_0x11f9fa[_0x4dd7('0xa3')]));};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x1ab')]=function(_0x5ac31c){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0x1ac'),_0x5ac31c[_0x4dd7('0xa2')]));if(!this[_0x4dd7('0xa6')](_0x5ac31c['apiKey'])){return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](_0x4dd7('0x1ad'));}if(!this[_0x4dd7('0xa6')](_0x5ac31c[_0x4dd7('0x5c')])){return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](_0x4dd7('0x10f'));}this['channel'][_0x4dd7('0xb4')](util[_0x4dd7('0x53')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x5ac31c['text']));var _0x559d38=this[_0x4dd7('0x59')][_0x4dd7('0x70')](this,_0x5ac31c);if(_0x559d38){this['channel']['noop'](util[_0x4dd7('0x53')](_0x4dd7('0x1ae'),_0x559d38));var _0x276c2f=this['channel'][_0x4dd7('0xf0')](_0x559d38);try{fs[_0x4dd7('0xf1')](_0x559d38+_0x4dd7('0xf2'));}catch(_0x2b3fdc){logger[_0x4dd7('0x4e')](_0x2b3fdc);}return _0x276c2f;}return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x5ac31c,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x1af')]=function(_0x343cbd){logger['info'](util[_0x4dd7('0x53')](_0x4dd7('0x1b0'),_0x343cbd[_0x4dd7('0xa2')]));if(!this[_0x4dd7('0xa6')](_0x343cbd[_0x4dd7('0x5c')])){return this['channel'][_0x4dd7('0xb4')](_0x4dd7('0x10f'));}this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util[_0x4dd7('0x53')]('Trying\x20Google\x20TTS\x20%s',_0x343cbd[_0x4dd7('0x5c')]));var _0x26ef1f=this[_0x4dd7('0x1b1')][_0x4dd7('0x70')](this,_0x343cbd);if(_0x26ef1f){this['channel']['noop'](util[_0x4dd7('0x53')]('Google\x20TTS\x20%s\x20file\x20created',_0x26ef1f));var _0x7c4be5=this[_0x4dd7('0xe')][_0x4dd7('0xf0')](_0x26ef1f);try{fs[_0x4dd7('0xf1')](_0x26ef1f+_0x4dd7('0xf2'));}catch(_0xb254fb){logger[_0x4dd7('0x4e')](_0xb254fb);}return _0x7c4be5;}return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x343cbd,_0x4dd7('0x1b2'));};AGIVertices['prototype'][_0x4dd7('0x1b3')]=function(_0x495ad1){logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x495ad1[_0x4dd7('0xa2')]));if(!this['isConfigured'](_0x495ad1[_0x4dd7('0x140')])){return this[_0x4dd7('0xe')][_0x4dd7('0x4e')](_0x495ad1,_0x4dd7('0x13e'));}logger['info'](util['format'](_0x4dd7('0x13f'),this[_0x4dd7('0xe')][_0x4dd7('0x3a')],_0x495ad1[_0x4dd7('0x140')]));var _0x3b3189=this[_0x4dd7('0x4f')][_0x4dd7('0x70')](this,_0x495ad1[_0x4dd7('0x140')]);if(_0x3b3189){logger['info'](util[_0x4dd7('0x53')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4dd7('0xe')][_0x4dd7('0x3a')],_0x495ad1[_0x4dd7('0x140')]));this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util['format'](_0x4dd7('0x145'),this[_0x4dd7('0xe')][_0x4dd7('0x3a')],_0x495ad1[_0x4dd7('0x140')]));return{'code':0xc8,'result':'success'};}else{logger[_0x4dd7('0x2e')](util[_0x4dd7('0x53')](_0x4dd7('0x141'),this[_0x4dd7('0xe')][_0x4dd7('0x3a')],_0x495ad1[_0x4dd7('0x140')]));this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util[_0x4dd7('0x53')](_0x4dd7('0x141'),this[_0x4dd7('0xe')][_0x4dd7('0x3a')],_0x495ad1[_0x4dd7('0x140')]));return{'code':0xc8,'result':_0x4dd7('0x142')};}};AGIVertices[_0x4dd7('0x10')][_0x4dd7('0x1b4')]=function(_0x43393b){logger['info'](util[_0x4dd7('0x53')](_0x4dd7('0x1b5'),_0x43393b[_0x4dd7('0xa2')]));var _0x3c6382=this[_0x4dd7('0xe')][_0x4dd7('0x56')]('VOICEMAIL',[_0x43393b[_0x4dd7('0x1b6')],_0x43393b[_0x4dd7('0x79')]]);if(_0x3c6382['result']===-0x1){return _0x3c6382;}return this[_0x4dd7('0xe')][_0x4dd7('0xb4')](util[_0x4dd7('0x53')](_0x4dd7('0x159'),'VOICEMAIL',_0x43393b['mailbox']));};AGIVertices['prototype'][_0x4dd7('0x1b7')]=function(_0x4da7b1){logger[_0x4dd7('0x2e')](util['format']('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x4da7b1[_0x4dd7('0xa2')]));if(!this[_0x4dd7('0xa6')](_0x4da7b1[_0x4dd7('0x100')])){return this[_0x4dd7('0xe')]['error'](_0x4da7b1,_0x4dd7('0x19a'));}var _0x19a30b=this[_0x4dd7('0x11')]['sync'](this,_0x4da7b1[_0x4dd7('0x100')]);if(!_0x19a30b){return this[_0x4dd7('0xe')]['error'](_0x4da7b1,_0x4dd7('0xce'));}var _0x14f3dd=this['channel'][_0x4dd7('0x11')](_0x19a30b);return{'code':0xc8,'result':_0x14f3dd[_0x4dd7('0x9d')]?_0x14f3dd[_0x4dd7('0x9d')]:'-'};};String[_0x4dd7('0x10')][_0x4dd7('0x9c')]=function(_0x3f38af,_0x146dbc){return this[_0x4dd7('0x9b')](_0x3f38af)[_0x4dd7('0x1b8')](_0x146dbc);};module[_0x4dd7('0x1b9')]=AGIVertices; \ No newline at end of file +var _0xe0f6=['Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','lodash','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','menu','getsecretdigits','channel','mailRpc','prototype','getVariable','rpc','getVariableById','then','getVoiceQueue','getVoiceQueueById','name','catch','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','agicommand','arg_1','callerid','createSquareRecording','calleridname','accountcode','dnid','file','createSquareMessage','uniqueid','createCmContact','isEmpty','isNil','callback_','random','lastName','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','callback_priority','getPauseById','agent','agentPause','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MP3','googleTTS','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','googleASR','tildeASR','appid','uri','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry','maxRetry','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','label','wait','result','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','minutes','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','options','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','speech','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','out','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','getSound','file_id','no\x20file\x20audio\x20found','getData','toString','mindigit','maxdigit','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','streamFile','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','%s/recordings/%s','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','extension','priority','gotoif','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ispeechASR','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','FIND\x20AGENT\x20%s\x20BY\x20%s','math','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','response','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','subject','service','host','port','secure','auth','pass','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','Answer','Skipped\x20Answer','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','no\x20apiKey\x20configured','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block'];(function(_0x27d616,_0x251ce7){var _0xcd15e7=function(_0x5c00a9){while(--_0x5c00a9){_0x27d616['push'](_0x27d616['shift']());}};_0xcd15e7(++_0x251ce7);}(_0xe0f6,0x1c8));var _0x6e0f=function(_0x5699da,_0x580c80){_0x5699da=_0x5699da-0x0;var _0x55abb0=_0xe0f6[_0x5699da];return _0x55abb0;};'use strict';var fs=require('fs');var path=require(_0x6e0f('0x0'));var util=require(_0x6e0f('0x1'));var _=require(_0x6e0f('0x2'));var sh=require('shelljs');var odbc=require(_0x6e0f('0x3'))();var rs=require(_0x6e0f('0x4'));var moment=require(_0x6e0f('0x5'));var Mustache=require(_0x6e0f('0x6'));var rp=require(_0x6e0f('0x7'));var logger=require(_0x6e0f('0x8'))(_0x6e0f('0x9'));var config=require(_0x6e0f('0xa'));var scripts=require(_0x6e0f('0xb'));var FILES_PATH=_0x6e0f('0xc');var recursiveMapAttributes=['rawHeaders',_0x6e0f('0xd')];var verticesWithRetry=[_0x6e0f('0xe'),'getdigits',_0x6e0f('0xf')];var AGIVertices=function(_0xbaf620,_0x501946,_0x1a66c8){this[_0x6e0f('0x10')]=_0xbaf620;this['rpc']=_0x501946;this[_0x6e0f('0x11')]=_0x1a66c8;};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x13')]=function(_0x50be5e,_0xbf5645){this[_0x6e0f('0x14')][_0x6e0f('0x15')](_0x50be5e)[_0x6e0f('0x16')](function(_0x238068){_0xbf5645(null,_0x238068?_0x238068['name']:![]);})['catch'](function(_0x1b6fb4){_0xbf5645(_0x1b6fb4);});};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x17')]=function(_0x489096,_0x2e2bfb){this[_0x6e0f('0x14')][_0x6e0f('0x18')](_0x489096)[_0x6e0f('0x16')](function(_0x9ef5ce){_0x2e2bfb(null,_0x9ef5ce?_0x9ef5ce[_0x6e0f('0x19')]:![]);})[_0x6e0f('0x1a')](function(_0x4024f5){_0x2e2bfb(_0x4024f5);});};AGIVertices['prototype']['getSquareProject']=function(_0x1793cf,_0x23cbed){this[_0x6e0f('0x14')][_0x6e0f('0x1b')](_0x1793cf)[_0x6e0f('0x16')](function(_0x24c536){_0x23cbed(null,_0x24c536?_0x24c536['name']:![]);})[_0x6e0f('0x1a')](function(_0x460f0d){_0x23cbed(_0x460f0d);});};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x1c')]=function(_0x12f888,_0x273b32){this[_0x6e0f('0x14')][_0x6e0f('0x1d')](_0x12f888)[_0x6e0f('0x16')](function(_0x5b1627){_0x273b32(null,_0x5b1627?_0x5b1627[_0x6e0f('0x1e')]:![]);})[_0x6e0f('0x1a')](function(_0xe48b45){_0x273b32(_0xe48b45);});};AGIVertices['prototype']['getUser']=function(_0x24ab86,_0x4e4c20){this[_0x6e0f('0x14')][_0x6e0f('0x1f')](_0x24ab86)[_0x6e0f('0x16')](function(_0x259923){_0x4e4c20(null,_0x259923?_0x259923[_0x6e0f('0x19')]:![]);})[_0x6e0f('0x1a')](function(_0x5b9b13){_0x4e4c20(_0x5b9b13);});};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x20')]=function(_0x22c628,_0x1a8dd2){this[_0x6e0f('0x14')][_0x6e0f('0x21')](_0x22c628)[_0x6e0f('0x16')](function(_0xb4997){_0x1a8dd2(null,_0xb4997?_0xb4997[_0x6e0f('0x19')]:![]);})[_0x6e0f('0x1a')](function(_0x3a862b){_0x1a8dd2(_0x3a862b);});};AGIVertices[_0x6e0f('0x12')]['getSound']=function(_0x111252,_0x46a3d8){var _0x54d88e=this;this[_0x6e0f('0x14')][_0x6e0f('0x22')](_0x111252)[_0x6e0f('0x16')](function(_0x442585){_0x46a3d8(null,_0x442585?_0x54d88e['getSoundPath'](_0x442585[_0x6e0f('0x23')]):![]);})[_0x6e0f('0x1a')](function(_0x3cf4d3){_0x46a3d8(_0x3cf4d3);});};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x24')]=function(_0x27b1ee,_0x58bf65){this['rpc'][_0x6e0f('0x25')](_0x27b1ee)[_0x6e0f('0x16')](function(_0x24fbe9){_0x58bf65(null,_0x24fbe9?_0x24fbe9:![]);})[_0x6e0f('0x1a')](function(_0x46f23d){_0x58bf65(_0x46f23d);});};AGIVertices['prototype']['sendMailMessage']=function(_0x1b41ff,_0x4d1b2d,_0x4b8f19){this[_0x6e0f('0x11')][_0x6e0f('0x26')](_0x1b41ff,_0x4d1b2d)[_0x6e0f('0x16')](function(){_0x4b8f19(null);})[_0x6e0f('0x1a')](function(_0x681c1d){_0x4b8f19(_0x681c1d);});};AGIVertices['prototype'][_0x6e0f('0x27')]=function(_0x5d0708,_0x887385){this[_0x6e0f('0x14')][_0x6e0f('0x28')](_0x5d0708)['then'](function(_0x15d48b){if(_0x15d48b){if(_0x15d48b[_0x6e0f('0x29')]){_0x887385(null,[_0x15d48b[_0x6e0f('0x2a')]]);}else{_0x887385(null,_[_0x6e0f('0x2b')](_0x15d48b[_0x6e0f('0x2c')],_0x6e0f('0x2a')));}}else{_0x887385(null,![]);}})['catch'](function(_0x3d842a){_0x887385(_0x3d842a);});};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x2d')]=function(_0x39e38d){return util[_0x6e0f('0x2e')](_0x6e0f('0x2f'),FILES_PATH,_0x39e38d);};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x30')]=function(_0x4358c3,_0x44a63d,_0x297d3a){odbc[_0x6e0f('0x31')](_0x4358c3,function(_0x3b01b9){if(_0x3b01b9){logger[_0x6e0f('0x32')](_0x6e0f('0x33'),_0x3b01b9);_0x297d3a(_0x3b01b9);}else{logger[_0x6e0f('0x34')](_0x6e0f('0x35'));odbc['query'](_0x44a63d,function(_0x553fbf,_0x52504c){if(_0x553fbf){logger['info'](_0x6e0f('0x36'),_0x44a63d);_0x297d3a(_0x553fbf);}else{logger[_0x6e0f('0x34')](_0x6e0f('0x37'),_0x44a63d);odbc[_0x6e0f('0x38')](function(_0x2536a7){if(_0x2536a7){logger[_0x6e0f('0x32')](_0x6e0f('0x39'),_0x2536a7);}_0x297d3a(null,_0x52504c);});}});}});};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x3a')]=function(_0x1b3582,_0x32385f){this['rpc'][_0x6e0f('0x3b')](_0x1b3582)[_0x6e0f('0x16')](function(_0x403d24){_0x32385f(null,_0x403d24?_0x403d24:![]);})[_0x6e0f('0x1a')](function(_0x216167){_0x32385f(_0x216167);});};AGIVertices[_0x6e0f('0x12')]['createSmsMessage']=function(_0x3acb73,_0x13904a){this[_0x6e0f('0x14')][_0x6e0f('0x3c')](_0x3acb73)[_0x6e0f('0x16')](function(_0x5e4b49){_0x13904a(null,_0x5e4b49);})['catch'](function(_0x2d0b71){_0x13904a(_0x2d0b71);});};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x3d')]=function(_0x24416a,_0x26abfc,_0x2811e2){this[_0x6e0f('0x14')]['createSquareDetailsReport']({'uniqueid':this[_0x6e0f('0x10')]['uniqueid'],'node':_0x24416a['label'],'application':_0x24416a[_0x6e0f('0x3e')],'data':_0x26abfc||null,'project_name':this[_0x6e0f('0x10')][_0x6e0f('0x3f')],'callerid':this[_0x6e0f('0x10')][_0x6e0f('0x40')]})['then'](function(_0x52e81d){if(_0x2811e2){_0x2811e2(null,_0x52e81d);}})[_0x6e0f('0x1a')](function(_0x775add){if(_0x2811e2){_0x2811e2(_0x775add);}});};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x41')]=function(_0x100e1e,_0x579390,_0x20d10a,_0x39c39c){this[_0x6e0f('0x14')][_0x6e0f('0x41')]({'uniqueid':this[_0x6e0f('0x10')]['uniqueid'],'callerid':this[_0x6e0f('0x10')][_0x6e0f('0x40')],'calleridname':this[_0x6e0f('0x10')][_0x6e0f('0x42')],'context':this[_0x6e0f('0x10')]['context'],'extension':this['channel']['extension'],'priority':this[_0x6e0f('0x10')]['priority'],'accountcode':this['channel'][_0x6e0f('0x43')],'dnid':this['channel'][_0x6e0f('0x44')],'projectName':this[_0x6e0f('0x10')][_0x6e0f('0x3f')],'saveName':_0x579390,'filename':_0x100e1e[_0x6e0f('0x45')]||_0x579390,'savePath':_0x20d10a})['then'](function(_0x255f54){_0x39c39c(null,_0x255f54);})['catch'](function(_0x3d0289){_0x39c39c(_0x3d0289);});};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x46')]=function(_0x25146b,_0xed3af8,_0x977ac5){this[_0x6e0f('0x14')]['createSquareMessage']({'uniqueid':this[_0x6e0f('0x10')][_0x6e0f('0x47')],'body':_0x25146b,'direction':_0xed3af8})[_0x6e0f('0x16')](function(_0x300b0b){if(_0x977ac5){_0x977ac5(null,_0x300b0b);}})[_0x6e0f('0x1a')](function(_0x3ffc91){if(_0x977ac5){_0x977ac5(_0x3ffc91);}});};AGIVertices['prototype'][_0x6e0f('0x48')]=function(_0x5c15a4,_0x1079ed){this[_0x6e0f('0x14')][_0x6e0f('0x48')]({'firstName':_[_0x6e0f('0x49')](_0x5c15a4[_0x6e0f('0x19')])||_[_0x6e0f('0x4a')](_0x5c15a4['name'])?_0x6e0f('0x4b')+Math[_0x6e0f('0x4c')]():_0x5c15a4[_0x6e0f('0x19')],'lastName':_[_0x6e0f('0x49')](_0x5c15a4[_0x6e0f('0x4d')])||_[_0x6e0f('0x4a')](_0x5c15a4[_0x6e0f('0x4d')])?null:_0x5c15a4['lastName'],'phone':_0x5c15a4['phone'],'ListId':_0x5c15a4[_0x6e0f('0x4e')],'scheduledat':_0x5c15a4[_0x6e0f('0x4f')],'callbackUniqueid':this[_0x6e0f('0x10')][_0x6e0f('0x47')],'tags':'callback','description':_0x6e0f('0x50')+_0x5c15a4[_0x6e0f('0x4f')]['toString'](),'priority':_0x5c15a4[_0x6e0f('0x51')]})[_0x6e0f('0x16')](function(_0x55ddc7){_0x1079ed(null,_0x55ddc7);})[_0x6e0f('0x1a')](function(_0x332535){_0x1079ed(_0x332535);});};AGIVertices[_0x6e0f('0x12')]['getPause']=function(_0x4a47db,_0x4423ad){this[_0x6e0f('0x14')][_0x6e0f('0x52')](_0x4a47db)['then'](function(_0x43a136){_0x4423ad(null,_0x43a136?_0x43a136[_0x6e0f('0x19')]:![]);})[_0x6e0f('0x1a')](function(_0x5cf742){_0x4423ad(_0x5cf742);});};AGIVertices[_0x6e0f('0x12')]['agentPause']=function(_0x27797a,_0x1a0606,_0x1b228c){var _0x414daa={'role':_0x6e0f('0x53')};_0x414daa[_0x27797a]=this[_0x6e0f('0x10')]['callerid'];this[_0x6e0f('0x14')][_0x6e0f('0x54')](_0x414daa,_0x1a0606,this[_0x6e0f('0x10')]['uniqueid'])['then'](function(_0xf92851){_0x1b228c(null,_['isNil'](_0xf92851)?![]:!![]);})[_0x6e0f('0x1a')](function(_0x46937d){logger[_0x6e0f('0x32')](_0x46937d);_0x1b228c(null,![]);});};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x55')]=function(_0x2ec01e,_0x522dc0){var _0x62cd4d={'role':_0x6e0f('0x53')};_0x62cd4d[_0x2ec01e]=this[_0x6e0f('0x10')][_0x6e0f('0x40')];this[_0x6e0f('0x14')][_0x6e0f('0x55')](_0x62cd4d)[_0x6e0f('0x16')](function(_0x4cf24a){_0x522dc0(null,_['isNil'](_0x4cf24a)?![]:!![]);})['catch'](function(_0x3ca37b){logger[_0x6e0f('0x32')](_0x3ca37b);_0x522dc0(null,![]);});};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x56')]=function(_0x3ed46e,_0x48398d){var _0x21da1c={'role':'agent'};_0x21da1c[_0x3ed46e]=this[_0x6e0f('0x10')][_0x6e0f('0x40')];this[_0x6e0f('0x14')][_0x6e0f('0x56')](_0x21da1c)[_0x6e0f('0x16')](function(_0x1d6831){_0x48398d(null,_[_0x6e0f('0x4a')](_0x1d6831)?![]:!![]);})['catch'](function(_0x2fb600){logger['error'](_0x2fb600);_0x48398d(null,![]);});};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x57')]=function(_0x3ef127,_0x2e3dc8){var _0x3ecf97={'role':_0x6e0f('0x53')};_0x3ecf97[_0x3ef127]=this['channel'][_0x6e0f('0x40')];var _0x5bb003=_0x3ef127!=_0x6e0f('0x58')?util['format'](_0x6e0f('0x59'),'LOCAL',this['channel'][_0x6e0f('0x40')]):undefined;this[_0x6e0f('0x14')][_0x6e0f('0x57')](_0x3ecf97,_0x5bb003)[_0x6e0f('0x16')](function(_0x4dc499){_0x2e3dc8(null,_[_0x6e0f('0x4a')](_0x4dc499)?![]:!![]);})['catch'](function(_0x448140){logger[_0x6e0f('0x32')](_0x448140);_0x2e3dc8(null,![]);});};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x5a')]=function(_0x2b90ef,_0x4c28f4){sh[_0x6e0f('0x5b')](_[_0x6e0f('0x5c')](_0x2b90ef),function(_0x5b9418,_0x3d7cb4){var _0x533de5=_0x3d7cb4[_0x6e0f('0x5d')](/(\r\n|\n|\r)/gm,'');_0x4c28f4(null,_0x533de5);});};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x5e')]=function(_0x2e44d3,_0x28ec11){scripts[_0x6e0f('0x5e')](_0x2e44d3[_0x6e0f('0x5f')],_0x2e44d3[_0x6e0f('0x60')]||_0x6e0f('0x61'),_0x2e44d3['text'],_0x2e44d3[_0x6e0f('0x62')]||_0x6e0f('0x63'),_0x2e44d3[_0x6e0f('0x64')]||'MALE',_0x2e44d3['audioEncoding']||_0x6e0f('0x65'))['then'](function(_0x1e7e2e){_0x28ec11(null,_0x1e7e2e);})[_0x6e0f('0x1a')](function(_0x447044){_0x28ec11(_0x447044);});};AGIVertices['prototype'][_0x6e0f('0x66')]=function(_0x41f1e1,_0x4b6499){scripts[_0x6e0f('0x66')](_0x41f1e1[_0x6e0f('0x61')],_0x41f1e1['google_tts_language']||'en',0x1)[_0x6e0f('0x16')](function(_0x59fc79){_0x4b6499(null,_0x59fc79);})[_0x6e0f('0x1a')](function(_0x13d200){_0x4b6499(_0x13d200);});};AGIVertices['prototype']['restAPI']=function(_0x25ebfb,_0x3edd76){var _0x4fcd3e={'uri':_0x25ebfb[_0x6e0f('0x67')],'method':_0x25ebfb[_0x6e0f('0x68')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x25ebfb[_0x6e0f('0x69')])===_0x6e0f('0x6a')&&parseInt(_0x25ebfb[_0x6e0f('0x69')])>=0x1?parseInt(_0x25ebfb[_0x6e0f('0x69')])*0x3e8:0x5*0x3e8};if(_[_0x6e0f('0x6b')]([_0x6e0f('0x6c'),_0x6e0f('0x6d')],_0x4fcd3e[_0x6e0f('0x68')][_0x6e0f('0x6e')]())){try{_0x4fcd3e[_0x6e0f('0x6f')]=_0x25ebfb[_0x6e0f('0xd')]?JSON[_0x6e0f('0x70')](_0x25ebfb[_0x6e0f('0xd')]):{};}catch(_0x163a32){logger['error'](_0x6e0f('0x71'),_0x163a32);}}try{_0x4fcd3e[_0x6e0f('0x72')]=_0x25ebfb[_0x6e0f('0x73')]?JSON[_0x6e0f('0x70')](_0x25ebfb['rawHeaders']):{};}catch(_0x11b28e){logger[_0x6e0f('0x32')](_0x6e0f('0x74'),_0x11b28e);}if(_0x25ebfb[_0x6e0f('0x75')]){try{var _0xeec3eb=require(_0x25ebfb['computedVariables'])[_0x6e0f('0x76')](this,_0x4fcd3e);_0x4fcd3e['uri']=Mustache['render'](_0x25ebfb[_0x6e0f('0x67')],_0xeec3eb,{},['$$','$$']);if(_0x4fcd3e['headers']){_0x4fcd3e[_0x6e0f('0x72')]=JSON['parse'](Mustache[_0x6e0f('0x77')](JSON[_0x6e0f('0x78')](_0x4fcd3e['headers']),_0xeec3eb,{},['$$','$$']));}if(_0x4fcd3e[_0x6e0f('0x6f')]){_0x4fcd3e['body']=JSON[_0x6e0f('0x70')](Mustache[_0x6e0f('0x77')](JSON[_0x6e0f('0x78')](_0x4fcd3e[_0x6e0f('0x6f')]),_0xeec3eb,{},['$$','$$']));}}catch(_0x54d22e){logger[_0x6e0f('0x32')](_0x6e0f('0x79'),_0x54d22e);}}rp(_0x4fcd3e)[_0x6e0f('0x16')](function(_0x14779b){var _0x18d844={'statusCode':_0x14779b['statusCode']||0xc8,'statusMessage':_0x14779b[_0x6e0f('0x7a')]||'OK','headers':_0x14779b[_0x6e0f('0x72')]||{},'body':_0x14779b[_0x6e0f('0x6f')]||{}};_0x3edd76(null,_0x18d844);})[_0x6e0f('0x1a')](function(_0xc9b170){var _0x40192a={'statusCode':_0xc9b170[_0x6e0f('0x7b')]||0x1f4,'statusMessage':_0xc9b170[_0x6e0f('0x7c')]||_0x6e0f('0x7d'),'headers':_0xc9b170['options'][_0x6e0f('0x72')]||{},'body':_0xc9b170['options'][_0x6e0f('0x6f')]||{}};_0x3edd76(null,_0x40192a);});};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x7e')]=function(_0x516553,_0x30721e){scripts[_0x6e0f('0x7e')](this['channel']['uniqueid'],_0x516553[_0x6e0f('0x7f')],_0x516553[_0x6e0f('0x61')],_0x516553[_0x6e0f('0x80')]||'en')[_0x6e0f('0x16')](function(_0x2f1348){_0x30721e(null,_0x2f1348);})[_0x6e0f('0x1a')](function(_0x16500f){_0x30721e(_0x16500f);});};AGIVertices[_0x6e0f('0x12')]['sestekNDA']=function(_0x2db61c,_0x8d0f51){scripts[_0x6e0f('0x81')](this[_0x6e0f('0x10')],_0x2db61c)[_0x6e0f('0x16')](function(_0x583138){_0x8d0f51(null,_0x583138);})['catch'](function(_0x252ccd){_0x8d0f51(_0x252ccd);});};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x82')]=function(_0x3a43f9,_0x4389bf){scripts['ispeechTTS'](_0x3a43f9['key'],_0x3a43f9[_0x6e0f('0x61')],_0x3a43f9['ispeech_tts_language']||'en-US',_0x3a43f9['speed'])[_0x6e0f('0x16')](function(_0x492a0c){_0x4389bf(null,_0x492a0c);})[_0x6e0f('0x1a')](function(_0x21babb){_0x4389bf(_0x21babb);});};AGIVertices['prototype']['ispeechASR']=function(_0x25dccd,_0x26405e,_0x47c06f){scripts['ispeechASR'](_0x26405e,_0x25dccd[_0x6e0f('0x7f')],_0x25dccd[_0x6e0f('0x83')]||_0x6e0f('0x63'),this[_0x6e0f('0x84')](_0x25dccd[_0x6e0f('0x85')])?_0x25dccd[_0x6e0f('0x85')]:undefined)[_0x6e0f('0x16')](function(_0x2eccbb){_0x47c06f(null,_0x2eccbb);})[_0x6e0f('0x1a')](function(_0xa48efd){_0x47c06f(_0xa48efd);});};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x86')]=function(_0x486d1f,_0x3999b3){scripts['awsPolly'](_0x486d1f['aws_access_key_id'],_0x486d1f[_0x6e0f('0x87')],_0x486d1f['aws_polly_region'],_0x486d1f['aws_polly_voice']||'Amy',_0x486d1f[_0x6e0f('0x61')],_0x486d1f[_0x6e0f('0x88')]||'text')[_0x6e0f('0x16')](function(_0x3ca509){_0x3999b3(null,_0x3ca509);})[_0x6e0f('0x1a')](function(_0x1ea0ea){_0x3999b3(_0x1ea0ea);});};AGIVertices[_0x6e0f('0x12')]['awsLex']=function(_0x54141,_0x1c0500){scripts[_0x6e0f('0x89')](this[_0x6e0f('0x10')][_0x6e0f('0x47')],_0x54141[_0x6e0f('0x8a')],_0x54141[_0x6e0f('0x87')],_0x54141[_0x6e0f('0x8b')],_0x54141['text'],_0x54141['aws_bot_name'])[_0x6e0f('0x16')](function(_0x226e55){_0x1c0500(null,_0x226e55);})['catch'](function(_0x181775){_0x1c0500(_0x181775);});};AGIVertices['prototype'][_0x6e0f('0x8c')]=function(_0x1cbe27,_0x258366,_0x398c26){scripts['googleASR'](_0x258366,_0x1cbe27[_0x6e0f('0x7f')],_0x1cbe27['google_asr_language']||_0x6e0f('0x63'))[_0x6e0f('0x16')](function(_0x5ef049){_0x398c26(null,_0x5ef049);})[_0x6e0f('0x1a')](function(_0x2d0886){_0x398c26(_0x2d0886);});};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x8d')]=function(_0x197409,_0x3149bf,_0x3536d2){scripts['tildeASR'](_0x3149bf,_0x197409[_0x6e0f('0x8e')],_0x197409['appsecret'],_0x197409[_0x6e0f('0x8f')])['then'](function(_0x54283a){_0x3536d2(null,_0x54283a);})[_0x6e0f('0x1a')](function(_0x3cdf8e){_0x3536d2(_0x3cdf8e);});};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x90')]=function(_0x124b78){var _0x4df2b3=_['includes'](verticesWithRetry,_0x124b78[_0x6e0f('0x3e')])?_0x124b78:_[_0x6e0f('0x91')](_0x124b78);for(var _0x5ba4b4 in _0x4df2b3){if(_0x4df2b3[_0x6e0f('0x92')](_0x5ba4b4)){if(_0x4df2b3[_0x5ba4b4]&&_[_0x6e0f('0x93')](_0x4df2b3[_0x5ba4b4])){if(_[_0x6e0f('0x6b')](recursiveMapAttributes,_0x5ba4b4)){_0x4df2b3[_0x5ba4b4]=this[_0x6e0f('0x94')](_0x4df2b3[_0x5ba4b4]);}else{_0x4df2b3[_0x5ba4b4]=this[_0x6e0f('0x95')](_0x4df2b3[_0x5ba4b4]);}}}}return _0x4df2b3;};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x96')]=function(_0x32bda3){for(var _0x3cdcc0 in _0x32bda3){if(_0x32bda3[_0x6e0f('0x92')](_0x3cdcc0)){if(_[_0x6e0f('0x97')](_0x32bda3[_0x3cdcc0])){this['recursiveNodeIndex'](_0x32bda3[_0x3cdcc0]);}else if(_[_0x6e0f('0x98')](_0x32bda3[_0x3cdcc0])){for(var _0x32550d=0x0;_0x32550d<_0x32bda3[_0x3cdcc0][_0x6e0f('0x99')];_0x32550d++){this[_0x6e0f('0x96')](_0x32bda3[_0x3cdcc0][_0x32550d]);}}else if(_[_0x6e0f('0x93')](_0x32bda3[_0x3cdcc0])){_0x32bda3[_0x3cdcc0]=this[_0x6e0f('0x95')](_0x32bda3[_0x3cdcc0]);}}}};AGIVertices[_0x6e0f('0x12')]['saveRestApiResult']=function(_0x331b97,_0x518689){for(var _0x5a8a3f in _0x331b97){if(_0x331b97[_0x6e0f('0x92')](_0x5a8a3f)){if(_['isPlainObject'](_0x331b97[_0x5a8a3f])){if(!_['isEmpty'](_0x331b97[_0x5a8a3f])){this[_0x6e0f('0x9a')](_0x331b97[_0x5a8a3f],util[_0x6e0f('0x2e')](_0x6e0f('0x9b'),_0x518689,_0x5a8a3f));}}else if(_[_0x6e0f('0x98')](_0x331b97[_0x5a8a3f])){for(var _0x4877cf=0x0;_0x4877cf<_0x331b97[_0x5a8a3f][_0x6e0f('0x99')];_0x4877cf++){this[_0x6e0f('0x9a')](_0x331b97[_0x5a8a3f][_0x4877cf],util[_0x6e0f('0x2e')](_0x6e0f('0x9b'),_0x518689,_0x5a8a3f+'['+_0x4877cf+']'));}}else{if(!_[_0x6e0f('0x4a')](_0x331b97[_0x5a8a3f])){this[_0x6e0f('0x10')][_0x6e0f('0x9c')](util[_0x6e0f('0x2e')](_0x6e0f('0x9b'),_0x518689,_0x5a8a3f),_0x331b97[_0x5a8a3f]);}}}}};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x94')]=function(_0x4525cd){try{var _0x4090bf=JSON['parse'](_0x4525cd);this[_0x6e0f('0x96')](_0x4090bf);return JSON[_0x6e0f('0x78')](_0x4090bf);}catch(_0x1724c2){return this[_0x6e0f('0x95')](_0x4525cd);}};AGIVertices['prototype'][_0x6e0f('0x95')]=function(_0x15ed06){var _0x5f30e2=_0x15ed06[_0x6e0f('0x9d')]('{');for(var _0x3a317e=0x1;_0x3a317e<_0x5f30e2[_0x6e0f('0x99')];_0x3a317e+=0x1){var _0x26a1c1=_0x5f30e2[_0x3a317e][_0x6e0f('0x9d')]('}');if(_0x26a1c1[_0x6e0f('0x99')]>0x1){_0x15ed06=_0x15ed06[_0x6e0f('0x9e')]('{'+_0x26a1c1[0x0]+'}',this['channel']['getVariable'](_0x26a1c1[0x0])[_0x6e0f('0x9f')]||_0x26a1c1[0x0]);}}if(_0x5f30e2[_0x6e0f('0x99')]===0x1){return _0x15ed06['toString']();}return this[_0x6e0f('0x95')](_0x15ed06);};AGIVertices['prototype'][_0x6e0f('0xa0')]=function(_0x31ac0f,_0x5ae54b){var _0x59e394=this['channel'][_0x6e0f('0x13')](_0x31ac0f);if(_0x59e394['result']===-0x1){return _0x59e394;}logger[_0x6e0f('0x34')](util['format'](_0x6e0f('0xa1'),_0x5ae54b,_0x59e394[_0x6e0f('0x9f')]));return this[_0x6e0f('0x10')]['setVariable'](_0x5ae54b,_0x59e394[_0x6e0f('0x9f')]);};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x84')]=function(_0x41d7f9){return _0x41d7f9&&_0x41d7f9!=='0'&&_0x41d7f9!=='-1'&&_0x41d7f9!=='';};AGIVertices['prototype']['maxRetry']=function(_0x47fe41){this[_0x6e0f('0x3d')][_0x6e0f('0x76')](this,_0x47fe41,'-');_0x47fe41[_0x6e0f('0xa2')]=_0x47fe41[_0x6e0f('0xa3')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x6e0f('0x12')]['agi']=function(_0x55c0b7){logger['info'](util['format'](_0x6e0f('0xa4'),_0x55c0b7['label']));return this[_0x6e0f('0x10')]['agi']([_0x55c0b7[_0x6e0f('0xa5')],_0x55c0b7['args']]);};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0xa6')]=function(_0x2e40e9){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0xa7'),_0x2e40e9[_0x6e0f('0xa8')]));if(this[_0x6e0f('0x84')](_0x2e40e9[_0x6e0f('0x69')])){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x2e40e9[_0x6e0f('0x69')]));var _0x44c72c=this[_0x6e0f('0x10')][_0x6e0f('0xa9')](_0x2e40e9[_0x6e0f('0x69')]);if(_0x44c72c[_0x6e0f('0xaa')]===-0x1){return _0x44c72c;}}return this[_0x6e0f('0x10')]['answer']();};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0xab')]=function(_0x16e5ad){logger['info'](util['format'](_0x6e0f('0xac'),_0x16e5ad['label']));if(!this[_0x6e0f('0x84')](_0x16e5ad['list_id'])){return this['channel'][_0x6e0f('0x32')](_0x16e5ad,'no\x20list\x20selected');}_0x16e5ad[_0x6e0f('0x4f')]=moment();if(this[_0x6e0f('0x84')](_0x16e5ad[_0x6e0f('0xad')])){_0x16e5ad[_0x6e0f('0x4f')]=moment()[_0x6e0f('0xae')](_0x16e5ad[_0x6e0f('0xad')],_0x6e0f('0xaf'));}if(!this[_0x6e0f('0x84')](_0x16e5ad[_0x6e0f('0x51')])){_0x16e5ad[_0x6e0f('0x51')]=0x2;}this['createCmContact'][_0x6e0f('0x76')](this,_0x16e5ad);return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util[_0x6e0f('0x2e')](_0x6e0f('0xb1'),_0x16e5ad[_0x6e0f('0xb2')],_0x16e5ad[_0x6e0f('0x4e')],_0x16e5ad[_0x6e0f('0x4f')]));};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0xb3')]=function(_0x6e0d11){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0xb4'),_0x6e0d11[_0x6e0f('0xa8')]));var _0x53ef1d=this['channel'][_0x6e0f('0x5b')](_0x6e0d11[_0x6e0f('0xb5')],_0x6e0d11['options']);if(_0x53ef1d['result']===-0x1){return _0x53ef1d;}return this['channel'][_0x6e0f('0xb0')](util[_0x6e0f('0x2e')](_0x6e0f('0xb6'),_0x6e0d11[_0x6e0f('0xb5')],_0x6e0d11[_0x6e0f('0xb7')]));};AGIVertices[_0x6e0f('0x12')]['lumenvoxtts']=function(_0x2e0fab){logger['info'](util[_0x6e0f('0x2e')](_0x6e0f('0xb8'),_0x2e0fab[_0x6e0f('0xa8')]));if(!this[_0x6e0f('0x84')](_0x2e0fab['text'])){return this['channel']['noop'](_0x6e0f('0xb9'));}var _0x273956='\x22'+_0x2e0fab[_0x6e0f('0x61')]+'\x22';if(this[_0x6e0f('0x84')](_0x2e0fab[_0x6e0f('0xb7')])){_0x273956+=','+_0x2e0fab['options'];}var _0x727706=this['channel']['exec'](_0x6e0f('0xba'),_0x273956);if(_0x727706[_0x6e0f('0xaa')]===-0x1){return _0x727706;}return this[_0x6e0f('0x10')]['noop'](util[_0x6e0f('0x2e')](_0x6e0f('0xbb'),_0x273956));};AGIVertices[_0x6e0f('0x12')]['sestektts']=function(_0x3cb9e8){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x3cb9e8[_0x6e0f('0xa8')]));if(!this['isConfigured'](_0x3cb9e8['text'])){return this['channel']['noop'](_0x6e0f('0xb9'));}var _0x29ff4e='\x22'+_0x3cb9e8['text']+'\x22';if(this['isConfigured'](_0x3cb9e8[_0x6e0f('0xb7')])){_0x29ff4e+=','+_0x3cb9e8['options'];}var _0x573884=this[_0x6e0f('0x10')][_0x6e0f('0x5b')](_0x6e0f('0xba'),_0x29ff4e);if(_0x573884[_0x6e0f('0xaa')]===-0x1){return _0x573884;}return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util['format'](_0x6e0f('0xbb'),_0x29ff4e));};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0xbc')]=function(_0x168fa3){logger['info'](util[_0x6e0f('0x2e')](_0x6e0f('0xbd'),_0x168fa3[_0x6e0f('0xa8')]));if(!this[_0x6e0f('0x84')](_0x168fa3[_0x6e0f('0xbe')])){return this['channel'][_0x6e0f('0xb0')](_0x6e0f('0xbf'));}var _0x39f1b9=_0x168fa3[_0x6e0f('0xbe')];if(this['isConfigured'](_0x168fa3['options'])){_0x39f1b9+=','+_0x168fa3['options'];}var _0x2fb5f2=this['channel'][_0x6e0f('0x5b')](_0x6e0f('0xc0'),_0x39f1b9);if(_0x2fb5f2['result']===-0x1){return _0x2fb5f2;}var _0x588b6f=this[_0x6e0f('0xa0')](_0x6e0f('0xc1'),_0x6e0f('0xc2'));if(_0x588b6f['result']===-0x1){return _0x588b6f;}var _0x3559f4=this['getAndSetVariable'](_0x6e0f('0xc3'),_0x6e0f('0xc4'));if(_0x3559f4[_0x6e0f('0xaa')]===-0x1){return _0x3559f4;}var _0x17ff68=this[_0x6e0f('0xa0')](_0x6e0f('0xc5'),_0x6e0f('0xc6'));if(_0x17ff68[_0x6e0f('0xaa')]===-0x1){return _0x17ff68;}return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util[_0x6e0f('0x2e')](_0x6e0f('0xc7'),_0x39f1b9));};AGIVertices[_0x6e0f('0x12')]['sestekasr']=function(_0x383bee){logger['info'](util[_0x6e0f('0x2e')](_0x6e0f('0xc8'),_0x383bee[_0x6e0f('0xa8')]));if(!this[_0x6e0f('0x84')](_0x383bee['grammar'])){return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](_0x6e0f('0xbf'));}var _0x59f3dd=_0x383bee['grammar'];if(this[_0x6e0f('0x84')](_0x383bee[_0x6e0f('0xb7')])){_0x59f3dd+=','+_0x383bee['options'];}var _0x503b24=this[_0x6e0f('0x10')][_0x6e0f('0x5b')](_0x6e0f('0xc0'),_0x59f3dd);if(_0x503b24[_0x6e0f('0xaa')]===-0x1){return _0x503b24;}var _0x4c50f3=this['getAndSetVariable'](_0x6e0f('0xc1'),_0x6e0f('0xc9'));if(_0x4c50f3['result']===-0x1){return _0x4c50f3;}var _0x22b6ac=this['getAndSetVariable'](_0x6e0f('0xc3'),_0x6e0f('0xca'));if(_0x22b6ac[_0x6e0f('0xaa')]===-0x1){return _0x22b6ac;}var _0x34a7b9=this[_0x6e0f('0xa0')](_0x6e0f('0xc5'),_0x6e0f('0xcb'));if(_0x34a7b9[_0x6e0f('0xaa')]===-0x1){return _0x34a7b9;}return this[_0x6e0f('0x10')]['noop'](util[_0x6e0f('0x2e')](_0x6e0f('0xc7'),_0x59f3dd));};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0xcc')]=function(_0x51f71b){logger['info'](util['format'](_0x6e0f('0xcd'),_0x51f71b['label']));if(!this[_0x6e0f('0x84')](_0x51f71b[_0x6e0f('0xce')])){return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0x51f71b,_0x6e0f('0xcf'));}var _0x2a02ff=this[_0x6e0f('0x1c')]['sync'](this,_0x51f71b['odbc_id']);if(!_0x2a02ff){return this['channel']['error'](_0x51f71b,_0x6e0f('0xd0'));}if(!this[_0x6e0f('0x84')](_0x51f71b[_0x6e0f('0xd1')])){return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0x51f71b,'no\x20query\x20configured');}var _0x162ed5=_0x51f71b[_0x6e0f('0xd1')][_0x6e0f('0x5d')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x6e0f('0xb0')](util['format'](_0x6e0f('0xd2'),_0x162ed5));var _0x32ecbd=this[_0x6e0f('0x30')][_0x6e0f('0x76')](this,_0x2a02ff,_0x162ed5);this['createSquareDetailsReport'][_0x6e0f('0x76')](this,_0x51f71b,_0x162ed5);if(!this['isConfigured'](_0x51f71b[_0x6e0f('0xd3')])){return this[_0x6e0f('0x10')]['noop'](_0x6e0f('0xd4'));}var _0x4e5395=this[_0x6e0f('0x13')][_0x6e0f('0x76')](this,_0x51f71b[_0x6e0f('0xd3')]);if(!_0x4e5395){return this[_0x6e0f('0x10')]['error'](_0x51f71b,_0x6e0f('0xd5'));}var _0x4f61e8=this;_0x32ecbd[_0x6e0f('0xd6')](function(_0x37ffbb,_0xd4d42c){Object[_0x6e0f('0xd7')](_0x37ffbb)['forEach'](function(_0x384a70){_0x4f61e8[_0x6e0f('0x10')][_0x6e0f('0x9c')](util[_0x6e0f('0x2e')](_0x6e0f('0xd8'),_0x4e5395,_0xd4d42c,_0x384a70),_0x37ffbb[_0x384a70]);});});this[_0x6e0f('0x10')][_0x6e0f('0x9c')](util['format'](_0x6e0f('0xd9'),_0x4e5395),_0x32ecbd[_0x6e0f('0x99')]);return this[_0x6e0f('0x10')]['noop'](util[_0x6e0f('0x2e')](_0x6e0f('0xda'),_0x4e5395));};AGIVertices[_0x6e0f('0x12')]['dial']=function(_0x4b0eba){logger[_0x6e0f('0xdb')](util[_0x6e0f('0x2e')](_0x6e0f('0xdc'),_0x4b0eba['label']));if(!this[_0x6e0f('0x84')](_0x4b0eba[_0x6e0f('0xdd')])){return this[_0x6e0f('0x10')]['error'](_0x4b0eba,_0x6e0f('0xde'));}var _0xd9d5c2=this[_0x6e0f('0xdf')]['sync'](this,_0x4b0eba[_0x6e0f('0xdd')]);if(!_0xd9d5c2){return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0x4b0eba,_0x6e0f('0xe0'));}var _0xaacd70=this['channel'][_0x6e0f('0x5b')](_0x6e0f('0xe1'),[util[_0x6e0f('0x2e')](_0x6e0f('0xe2'),_0xd9d5c2),_0x4b0eba[_0x6e0f('0x69')],_0x4b0eba[_0x6e0f('0xe3')],_0x4b0eba['url']]);if(_0xaacd70[_0x6e0f('0xaa')]===-0x1){return _0xaacd70;}return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util['format'](_0x6e0f('0xe4'),_0x6e0f('0xe1')));};AGIVertices['prototype'][_0x6e0f('0xe5')]=function(_0x45b898){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x45b898[_0x6e0f('0xa8')]));if(!this[_0x6e0f('0x84')](_0x45b898[_0x6e0f('0x7f')])){return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](_0x6e0f('0xe6'));}if(!this[_0x6e0f('0x84')](_0x45b898[_0x6e0f('0x61')])){return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](_0x6e0f('0xb9'));}this['channel'][_0x6e0f('0xe7')]=!![];this['createSquareDetailsReport'](_0x45b898);this[_0x6e0f('0x46')](_0x45b898[_0x6e0f('0x61')],'in');this['channel']['noop'](util[_0x6e0f('0x2e')](_0x6e0f('0xe8'),_0x45b898[_0x6e0f('0x61')]));var _0x5c87e6=this['googleDialogflow'][_0x6e0f('0x76')](this,_0x45b898);if(_0x5c87e6){for(var _0x3cdb63 in _0x5c87e6){if(_0x5c87e6[_0x6e0f('0x92')](_0x3cdb63)){this[_0x6e0f('0x10')][_0x6e0f('0x9c')](util['format']('DIALOGFLOW_%s',_0x3cdb63[_0x6e0f('0x6e')]()),_0x5c87e6[_0x3cdb63]);}}this[_0x6e0f('0x46')](_0x5c87e6[_0x6e0f('0xe9')],'out');return this['channel'][_0x6e0f('0xb0')](util['format']('Dialogflow\x20Result\x20%s',_0x5c87e6[_0x6e0f('0xe9')]));}return this['channel'][_0x6e0f('0x32')](_0x45b898,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0xea')]=function(_0x533620){logger[_0x6e0f('0x34')](util['format'](_0x6e0f('0xeb'),_0x533620[_0x6e0f('0xa8')]));if(!this[_0x6e0f('0x84')](_0x533620[_0x6e0f('0xec')])){return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](_0x6e0f('0xed'));}if(!this['isConfigured'](_0x533620[_0x6e0f('0xee')])){return this[_0x6e0f('0x10')][_0x6e0f('0xb0')]('no\x20username\x20configured');}if(!this['isConfigured'](_0x533620[_0x6e0f('0xef')])){return this['channel']['noop'](_0x6e0f('0xf0'));}if(!this[_0x6e0f('0x84')](_0x533620[_0x6e0f('0xf1')])){return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](_0x6e0f('0xb9'));}this[_0x6e0f('0x10')][_0x6e0f('0xe7')]=!![];this[_0x6e0f('0x3d')](_0x533620);this[_0x6e0f('0x46')](_0x533620[_0x6e0f('0x61')],'in');this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util['format']('Trying\x20SestekNDA:\x20%s',_0x533620['text']));var _0xddbadf=this['sestekNDA']['sync'](this,_0x533620);if(_0xddbadf){for(var _0x58c207 in _0xddbadf){if(_0xddbadf[_0x6e0f('0x92')](_0x58c207)){this[_0x6e0f('0x10')][_0x6e0f('0x9c')](util[_0x6e0f('0x2e')](_0x6e0f('0xf2'),_0x58c207[_0x6e0f('0x6e')]()),_0xddbadf[_0x58c207]);}}this['createSquareMessage'](_0xddbadf[_0x6e0f('0xe9')],_0x6e0f('0xf3'));if(_0xddbadf[_0x6e0f('0xf4')]){this[_0x6e0f('0x10')]['noop'](util[_0x6e0f('0x2e')]('Sestek\x20NDA\x20%s\x20file\x20created',_0xddbadf[_0x6e0f('0xf4')]));var _0x256eae=this['channel']['streamFile'](_0xddbadf[_0x6e0f('0xf4')]);try{fs[_0x6e0f('0xf5')](_0xddbadf[_0x6e0f('0xf4')]+_0x6e0f('0xf6'));}catch(_0x2c1657){logger[_0x6e0f('0x32')](_0x2c1657);}return _0x256eae;}else{return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util['format'](_0x6e0f('0xf7'),_0xddbadf['speech']));}}return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0x533620,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0x6e0f('0xf8')]=function(_0x1d738){logger[_0x6e0f('0x34')](util['format'](_0x6e0f('0xf9'),_0x1d738[_0x6e0f('0xa8')]));return this[_0x6e0f('0x10')]['noop']('end');};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0xfa')]=function(_0x44de8f){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x44de8f[_0x6e0f('0xa8')]));var _0x49c8f2='';if(_0x44de8f[_0x6e0f('0xfb')]){if(!this[_0x6e0f('0x84')](_0x44de8f[_0x6e0f('0xfb')])){return this[_0x6e0f('0x10')]['error'](_0x44de8f,_0x6e0f('0xfc'));}else{var _0x2a5e19=parseInt(_0x44de8f[_0x6e0f('0xfb')],0xa);if(isNaN(_0x2a5e19)){_0x49c8f2=_0x44de8f[_0x6e0f('0xfb')];}else{_0x49c8f2=this['getTrunk'][_0x6e0f('0x76')](this,_0x44de8f[_0x6e0f('0xfb')]);if(!_0x49c8f2){return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0x44de8f,'no\x20trunk\x20found');}}}}else if(_0x44de8f[_0x6e0f('0xfd')]){_0x49c8f2=_0x44de8f['trunk_name'];}else{return this[_0x6e0f('0x10')]['error'](_0x44de8f,_0x6e0f('0xfc'));}var _0x3af280=this[_0x6e0f('0x10')][_0x6e0f('0x5b')](_0x6e0f('0xe1'),[util[_0x6e0f('0x2e')]('SIP/%s/%s',_0x49c8f2,_0x44de8f['phone']),_0x44de8f[_0x6e0f('0x69')],_0x44de8f[_0x6e0f('0xe3')],_0x44de8f[_0x6e0f('0x67')]]);if(_0x3af280[_0x6e0f('0xaa')]===-0x1){return _0x3af280;}return this['channel'][_0x6e0f('0xb0')](util[_0x6e0f('0x2e')](_0x6e0f('0xe4'),'DIAL'));};AGIVertices['prototype'][_0x6e0f('0xfe')]=function(_0x5befa4){logger[_0x6e0f('0x34')](util['format'](_0x6e0f('0xff'),_0x5befa4[_0x6e0f('0xa8')]));return this[_0x6e0f('0x10')]['noop']('finally');};AGIVertices['prototype'][_0x6e0f('0x100')]=function(_0x10decf){logger[_0x6e0f('0x34')](util['format'](_0x6e0f('0x101'),_0x10decf['label']));if(_0x10decf[_0x6e0f('0xa2')]===0x0){return this[_0x6e0f('0xa3')](_0x10decf);}_0x10decf['retry']-=0x1;if(!this[_0x6e0f('0x84')](_0x10decf['file_id'])){return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0x10decf,_0x6e0f('0x102'));}var _0x41eec0=this[_0x6e0f('0x103')][_0x6e0f('0x76')](this,_0x10decf[_0x6e0f('0x104')]);if(!_0x41eec0){return this[_0x6e0f('0x10')]['error'](_0x10decf,_0x6e0f('0x105'));}if(!this[_0x6e0f('0x84')](_0x10decf[_0x6e0f('0xd3')])){return this['channel'][_0x6e0f('0x32')](_0x6e0f('0xd4'));}var _0x4470d9=this['channel'][_0x6e0f('0x106')](_0x41eec0,_0x10decf['response'],_0x10decf['maxdigit']);var _0x31dda0=_0x4470d9['result']?_0x4470d9[_0x6e0f('0xaa')][_0x6e0f('0x107')]():'';logger[_0x6e0f('0x34')]('test',JSON[_0x6e0f('0x78')](_0x4470d9));if(_0x4470d9[_0x6e0f('0xaa')]===-0x1){this['createSquareDetailsReport'][_0x6e0f('0x76')](this,_0x10decf,_0x31dda0);return _0x4470d9;}else if(_0x4470d9[_0x6e0f('0x9f')]===_0x6e0f('0x69')){_0x4470d9['result']=_0x31dda0[_0x6e0f('0x99')]>=parseInt(_0x10decf[_0x6e0f('0x108')])?'x':'i';}else{_0x4470d9[_0x6e0f('0xaa')]=_0x31dda0['length']>=parseInt(_0x10decf[_0x6e0f('0x108')])&&_0x31dda0['length']<=parseInt(_0x10decf[_0x6e0f('0x109')])?'x':'i';}var _0x5be4ec=this[_0x6e0f('0x13')]['sync'](this,_0x10decf[_0x6e0f('0xd3')]);if(!_0x5be4ec){return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0x10decf,_0x6e0f('0xd5'));}this[_0x6e0f('0x10')]['setVariable'](_0x5be4ec,_0x31dda0);if(this[_0x6e0f('0x84')](_0x10decf[_0x6e0f('0x10a')])){var _0x53da23=parseInt(_0x10decf[_0x6e0f('0x10a')],0xa);var _0x2adf3e=rs[_0x6e0f('0x10b')]({'charset':'*','length':_0x53da23});var _0x39d014=_0x31dda0['length'];if(_0x39d014>0x0){if(_0x39d014>_0x53da23){this[_0x6e0f('0x3d')][_0x6e0f('0x76')](this,_0x10decf,_0x10decf['hiddendigitspos']===_0x6e0f('0x10c')?_0x2adf3e+_0x31dda0[_0x6e0f('0x10d')](_0x53da23):_0x31dda0[_0x6e0f('0x10d')](0x0,_0x39d014-_0x53da23)+_0x2adf3e);}else{this[_0x6e0f('0x3d')]['sync'](this,_0x10decf,rs[_0x6e0f('0x10b')]({'charset':'*','length':_0x39d014}));}}else{this['createSquareDetailsReport'][_0x6e0f('0x76')](this,_0x10decf,'');}}else{this[_0x6e0f('0x3d')][_0x6e0f('0x76')](this,_0x10decf,_0x31dda0);}return _0x4470d9;};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0xf')]=function(_0x4c654b){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x10e'),_0x4c654b[_0x6e0f('0xa8')]));return this[_0x6e0f('0x100')](_0x4c654b);};AGIVertices['prototype'][_0x6e0f('0x10f')]=function(_0x1df26e){logger['info'](util[_0x6e0f('0x2e')](_0x6e0f('0x110'),_0x1df26e[_0x6e0f('0xa8')]));this[_0x6e0f('0x3d')]['sync'](this,_0x1df26e,_0x1df26e[_0x6e0f('0x111')]);return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util[_0x6e0f('0x2e')]('GOAL\x20%s',_0x1df26e['goalname']));};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x112')]=function(_0x580c08){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x113'),_0x580c08[_0x6e0f('0xa8')]));if(!this[_0x6e0f('0x84')](_0x580c08[_0x6e0f('0x8a')])||!this[_0x6e0f('0x84')](_0x580c08['aws_secret_access_key'])){return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](_0x6e0f('0x114'));}if(!this[_0x6e0f('0x84')](_0x580c08['text'])){return this[_0x6e0f('0x10')]['noop'](_0x6e0f('0xb9'));}this[_0x6e0f('0x10')]['noop'](util[_0x6e0f('0x2e')]('Trying\x20aws\x20Polly\x20%s',_0x580c08[_0x6e0f('0x61')]));var _0x57e32b=this['awsPolly'][_0x6e0f('0x76')](this,_0x580c08);if(_0x57e32b){this['channel'][_0x6e0f('0xb0')](util[_0x6e0f('0x2e')](_0x6e0f('0x115'),_0x57e32b));var _0x46cb3c=this['channel'][_0x6e0f('0x116')](_0x57e32b);try{fs['unlink'](_0x57e32b+_0x6e0f('0xf6'));}catch(_0xb24e8e){logger['error'](_0xb24e8e);}return _0x46cb3c;}return this['channel']['error'](_0x580c08,_0x6e0f('0x117'));};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x118')]=function(_0x40f7d2){logger['info'](util[_0x6e0f('0x2e')](_0x6e0f('0x119'),_0x40f7d2[_0x6e0f('0xa8')]));if(!this[_0x6e0f('0x84')](_0x40f7d2[_0x6e0f('0x8a')])||!this[_0x6e0f('0x84')](_0x40f7d2[_0x6e0f('0x87')])){return this[_0x6e0f('0x10')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x40f7d2[_0x6e0f('0x11a')])){return this[_0x6e0f('0x10')][_0x6e0f('0xb0')]('no\x20bot\x20name\x20configured');}if(!this[_0x6e0f('0x84')](_0x40f7d2[_0x6e0f('0x61')])){return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](_0x6e0f('0xb9'));}this[_0x6e0f('0x10')][_0x6e0f('0xe7')]=!![];this[_0x6e0f('0x3d')](_0x40f7d2);this[_0x6e0f('0x46')](_0x40f7d2['text'],'in');this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util[_0x6e0f('0x2e')](_0x6e0f('0x11b'),_0x40f7d2[_0x6e0f('0x61')]));var _0x4a3203=this[_0x6e0f('0x89')]['sync'](this,_0x40f7d2);if(_0x4a3203){for(var _0x198463 in _0x4a3203){if(_0x4a3203[_0x6e0f('0x92')](_0x198463)&&_[_0x6e0f('0x93')](_0x4a3203[_0x198463])){this[_0x6e0f('0x10')][_0x6e0f('0x9c')](util[_0x6e0f('0x2e')]('AWS_LEX_%s',_0x198463[_0x6e0f('0x6e')]()),_0x4a3203[_0x198463]);}}if(_[_0x6e0f('0x4a')](_0x4a3203['message'])){return this[_0x6e0f('0x10')]['noop'](_0x6e0f('0x11c'));}else{this[_0x6e0f('0x46')](_0x4a3203[_0x6e0f('0x7c')],'out');return this[_0x6e0f('0x10')]['noop'](util[_0x6e0f('0x2e')](_0x6e0f('0x11d'),_0x4a3203[_0x6e0f('0x7c')]));}}return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0x40f7d2,_0x6e0f('0x11e'));};AGIVertices[_0x6e0f('0x12')]['googleasr']=function(_0x2e5a79){logger[_0x6e0f('0x34')](util['format'](_0x6e0f('0x11f'),_0x2e5a79[_0x6e0f('0xa8')],_0x2e5a79[_0x6e0f('0x69')]));if(!this[_0x6e0f('0x84')](_0x2e5a79[_0x6e0f('0x7f')])){return this[_0x6e0f('0x10')]['noop'](_0x6e0f('0xe6'));}var _0x537131='wav';var _0x480736=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x6e0f('0x10b')](0x4));var _0x156245=util['format'](_0x6e0f('0x9b'),_0x480736,_0x537131);var _0x2c49a0=!![];if(_0x2e5a79[_0x6e0f('0x120')]===_0x6e0f('0x121')){_0x2c49a0=![];}var _0x3f0332=this[_0x6e0f('0x10')][_0x6e0f('0x122')](_0x480736,_0x537131,_0x2e5a79[_0x6e0f('0x123')],_0x2e5a79[_0x6e0f('0x69')],undefined,_0x2c49a0);if(_0x3f0332['result']!==-0x1){this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util[_0x6e0f('0x2e')](_0x6e0f('0x124'),_0x156245));var _0x6d0f4f=this[_0x6e0f('0x8c')]['sync'](this,_0x2e5a79,_0x156245);if(_0x6d0f4f){for(var _0x580c53 in _0x6d0f4f){if(_0x6d0f4f['hasOwnProperty'](_0x580c53)){this[_0x6e0f('0x10')][_0x6e0f('0x9c')](util['format'](_0x6e0f('0x125'),_0x580c53[_0x6e0f('0x6e')]()),_0x6d0f4f[_0x580c53]);}}return this[_0x6e0f('0x10')]['noop'](util[_0x6e0f('0x2e')]('GoogleASR\x20Result\x20%s',JSON[_0x6e0f('0x78')](_0x6d0f4f)));}}return _0x3f0332;};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x126')]=function(_0x44bfe4){logger['info'](util[_0x6e0f('0x2e')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x44bfe4[_0x6e0f('0xa8')]));if(!this['isConfigured'](_0x44bfe4['appid'])){return this['channel']['noop'](_0x6e0f('0x127'));}if(!this['isConfigured'](_0x44bfe4['appsecret'])){return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](_0x6e0f('0x128'));}var _0x31a789=_0x6e0f('0x129');var _0x5be258=util[_0x6e0f('0x2e')](_0x6e0f('0x12a'),FILES_PATH,rs[_0x6e0f('0x10b')](0x4));var _0x16be2e=util[_0x6e0f('0x2e')](_0x6e0f('0x9b'),_0x5be258,_0x31a789);var _0x30bc8e=!![];if(_0x44bfe4[_0x6e0f('0x120')]===_0x6e0f('0x121')){_0x30bc8e=![];}var _0x47cc43=this[_0x6e0f('0x10')][_0x6e0f('0x122')](_0x5be258,_0x31a789,_0x44bfe4[_0x6e0f('0x123')],_0x44bfe4[_0x6e0f('0x69')],undefined,_0x30bc8e);if(_0x47cc43[_0x6e0f('0xaa')]!==-0x1){this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util['format'](_0x6e0f('0x12b'),_0x16be2e));var _0x597f18=this[_0x6e0f('0x8d')]['sync'](this,_0x44bfe4,_0x16be2e);if(_0x597f18){for(var _0x2872ed in _0x597f18){if(_0x597f18[_0x6e0f('0x92')](_0x2872ed)){this[_0x6e0f('0x10')][_0x6e0f('0x9c')](util['format'](_0x6e0f('0x12c'),_0x2872ed[_0x6e0f('0x6e')]()),_0x597f18[_0x2872ed]);}}return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util['format'](_0x6e0f('0x12d'),JSON[_0x6e0f('0x78')](_0x597f18)));}}return _0x47cc43;};AGIVertices[_0x6e0f('0x12')]['gotoc']=function(_0xeadcc5){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x12e'),_0xeadcc5[_0x6e0f('0xa8')]));return this['channel'][_0x6e0f('0x12f')](_0xeadcc5[_0x6e0f('0x130')],_0xeadcc5[_0x6e0f('0x131')],_0xeadcc5[_0x6e0f('0x132')]);};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x133')]=function(_0x3b976b){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x3b976b[_0x6e0f('0xa8')]));if(!this[_0x6e0f('0x84')](_0x3b976b[_0x6e0f('0x134')])){return this['channel'][_0x6e0f('0x32')](_0x3b976b,_0x6e0f('0x135'));}try{var _0x4e039a=eval(_0x3b976b[_0x6e0f('0x134')])?_0x6e0f('0x136'):_0x6e0f('0x137');this[_0x6e0f('0x10')]['noop'](util['format'](_0x6e0f('0x138'),_0x3b976b[_0x6e0f('0x134')],_0x4e039a));return{'code':0xc8,'result':_0x4e039a};}catch(_0x3e98af){return{'code':0xc8,'result':_0x6e0f('0x137')};}};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x139')]=function(_0x149f8f){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x13a'),_0x149f8f[_0x6e0f('0xa8')]));if(!this[_0x6e0f('0x84')](_0x149f8f[_0x6e0f('0x13b')])){return this['channel'][_0x6e0f('0x32')](_0x149f8f,_0x6e0f('0x13c'));}var _0x5a12e0=this[_0x6e0f('0x27')][_0x6e0f('0x76')](this,_0x149f8f[_0x6e0f('0x13b')]);if(!_0x5a12e0){return this['channel'][_0x6e0f('0x32')](_0x149f8f,_0x6e0f('0x13d'));}for(var _0x2c061f=0x0;_0x2c061f<_0x5a12e0[_0x6e0f('0x99')];_0x2c061f+=0x1){var _0x57809a=this[_0x6e0f('0x10')][_0x6e0f('0x13')](util['format']('IFTIME(%s?true:false)',_0x5a12e0[_0x2c061f]));if(_0x57809a[_0x6e0f('0xaa')]===-0x1){return _0x57809a;}logger['info'](util[_0x6e0f('0x2e')](_0x6e0f('0x13e'),_0x5a12e0[_0x2c061f],_0x57809a[_0x6e0f('0x9f')]));if(_0x57809a[_0x6e0f('0x9f')]==='true'){logger[_0x6e0f('0x34')](util['format'](_0x6e0f('0x13e'),_0x5a12e0[_0x2c061f],_0x6e0f('0x136')));this['channel'][_0x6e0f('0xb0')](util[_0x6e0f('0x2e')]('IFTIME\x20%s\x20%s',_0x5a12e0[_0x2c061f],'true'));return{'code':0xc8,'result':_0x6e0f('0x136')};}else{logger[_0x6e0f('0x34')](util['format'](_0x6e0f('0x13e'),_0x5a12e0[_0x2c061f],'false'));this[_0x6e0f('0x10')]['noop'](util[_0x6e0f('0x2e')](_0x6e0f('0x13e'),_0x5a12e0[_0x2c061f],'false'));}}return{'code':0xc8,'result':_0x6e0f('0x137')};};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x13f')]=function(_0x255b51){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x140'),_0x255b51[_0x6e0f('0xa8')]));return this['channel']['hangup']();};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x141')]=function(_0x5c5bca){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x142'),_0x5c5bca['label']));if(!this[_0x6e0f('0x84')](_0x5c5bca[_0x6e0f('0x7f')])){return this[_0x6e0f('0x10')]['noop'](_0x6e0f('0xe6'));}var _0x5bcd1b=_0x6e0f('0x129');var _0x185303=util[_0x6e0f('0x2e')](_0x6e0f('0x12a'),FILES_PATH,rs[_0x6e0f('0x10b')](0x4));var _0x4995d3=util[_0x6e0f('0x2e')](_0x6e0f('0x9b'),_0x185303,_0x5bcd1b);var _0xacc688=!![];if(_0x5c5bca['beep']===_0x6e0f('0x121')){_0xacc688=![];}var _0x50c699=this[_0x6e0f('0x10')][_0x6e0f('0x122')](_0x185303,_0x5bcd1b,_0x5c5bca[_0x6e0f('0x123')],_0x5c5bca['timeout'],undefined,_0xacc688);if(_0x50c699['result']!==-0x1){this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util[_0x6e0f('0x2e')](_0x6e0f('0x143'),_0x4995d3));var _0x1a3fad=this[_0x6e0f('0x144')]['sync'](this,_0x5c5bca,_0x4995d3);if(_0x1a3fad){for(var _0x16ab87 in _0x1a3fad){if(_0x1a3fad['hasOwnProperty'](_0x16ab87)){this['channel'][_0x6e0f('0x9c')](util[_0x6e0f('0x2e')](_0x6e0f('0x145'),_0x16ab87[_0x6e0f('0x6e')]()),_0x1a3fad[_0x16ab87]);}}return this[_0x6e0f('0x10')]['noop'](util[_0x6e0f('0x2e')](_0x6e0f('0x146'),JSON[_0x6e0f('0x78')](_0x1a3fad)));}}return _0x50c699;};AGIVertices['prototype']['ispeechtts']=function(_0x102072){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x147'),_0x102072[_0x6e0f('0xa8')]));if(!this[_0x6e0f('0x84')](_0x102072[_0x6e0f('0x7f')])){return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](_0x6e0f('0xe6'));}if(!this[_0x6e0f('0x84')](_0x102072[_0x6e0f('0x61')])){return this[_0x6e0f('0x10')][_0x6e0f('0xb0')]('no\x20text\x20configured');}this['channel'][_0x6e0f('0xb0')](util[_0x6e0f('0x2e')](_0x6e0f('0x148'),_0x102072[_0x6e0f('0x61')]));var _0x3edcdd=this[_0x6e0f('0x82')][_0x6e0f('0x76')](this,_0x102072);if(_0x3edcdd){this['channel'][_0x6e0f('0xb0')](util[_0x6e0f('0x2e')](_0x6e0f('0x143'),_0x3edcdd));var _0x231bee=this['channel'][_0x6e0f('0x116')](_0x3edcdd,_0x102072[_0x6e0f('0x123')]);try{fs[_0x6e0f('0xf5')](_0x3edcdd+'.wav');}catch(_0x1e4d07){logger[_0x6e0f('0x32')](_0x1e4d07);}return _0x231bee;}return this[_0x6e0f('0x10')]['error'](_0x102072,_0x6e0f('0x149'));};AGIVertices['prototype']['login']=function(_0x3c0245){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x14a'),_0x3c0245[_0x6e0f('0xa8')]));if(!this[_0x6e0f('0x84')](_0x3c0245[_0x6e0f('0x14b')])){return this['channel'][_0x6e0f('0x32')](_0x3c0245,_0x6e0f('0x14c'));}logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x6e0f('0x10')][_0x6e0f('0x40')],_0x3c0245['findBy']));var _0x3aeb4a=this[_0x6e0f('0x57')][_0x6e0f('0x76')](this,_0x3c0245[_0x6e0f('0x14b')]);if(_0x3aeb4a){logger['info'](util[_0x6e0f('0x2e')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x6e0f('0x10')][_0x6e0f('0x40')],_0x3c0245[_0x6e0f('0x14b')]));this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util[_0x6e0f('0x2e')](_0x6e0f('0x14d'),this['channel'][_0x6e0f('0x40')],_0x3c0245['findBy']));return{'code':0xc8,'result':_0x6e0f('0x14e')};}else{logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x14f'),this[_0x6e0f('0x10')][_0x6e0f('0x40')],_0x3c0245[_0x6e0f('0x14b')]));this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x6e0f('0x40')],_0x3c0245[_0x6e0f('0x14b')]));return{'code':0xc8,'result':_0x6e0f('0x150')};}};AGIVertices['prototype'][_0x6e0f('0x151')]=function(_0x2b5ce1){logger[_0x6e0f('0x34')](util['format']('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x2b5ce1['label']));if(!this[_0x6e0f('0x84')](_0x2b5ce1[_0x6e0f('0x14b')])){return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0x2b5ce1,'no\x20find\x20by\x20configured');}logger[_0x6e0f('0x34')](util['format'](_0x6e0f('0x152'),this[_0x6e0f('0x10')][_0x6e0f('0x40')],_0x2b5ce1[_0x6e0f('0x14b')]));var _0x1fd215=this[_0x6e0f('0x56')][_0x6e0f('0x76')](this,_0x2b5ce1[_0x6e0f('0x14b')]);if(_0x1fd215){logger['info'](util[_0x6e0f('0x2e')](_0x6e0f('0x14d'),this[_0x6e0f('0x10')][_0x6e0f('0x40')],_0x2b5ce1[_0x6e0f('0x14b')]));this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util[_0x6e0f('0x2e')](_0x6e0f('0x14d'),this[_0x6e0f('0x10')][_0x6e0f('0x40')],_0x2b5ce1[_0x6e0f('0x14b')]));return{'code':0xc8,'result':_0x6e0f('0x14e')};}else{logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x14f'),this[_0x6e0f('0x10')][_0x6e0f('0x40')],_0x2b5ce1[_0x6e0f('0x14b')]));this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x6e0f('0x10')][_0x6e0f('0x40')],_0x2b5ce1[_0x6e0f('0x14b')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x153')]=function(_0x275dd1){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x275dd1[_0x6e0f('0xa8')]));if(!this[_0x6e0f('0x84')](_0x275dd1[_0x6e0f('0x154')])){return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0x275dd1,_0x6e0f('0x155'));}this[_0x6e0f('0x10')]['noop'](util['format'](_0x6e0f('0x156'),_0x275dd1[_0x6e0f('0x154')]));var _0x43d56e=eval(_0x275dd1[_0x6e0f('0x154')]);if(!this['isConfigured'](_0x275dd1[_0x6e0f('0xd3')])){return this['channel']['noop'](_0x6e0f('0xd4'));}var _0xcbe9df=this[_0x6e0f('0x13')][_0x6e0f('0x76')](this,_0x275dd1[_0x6e0f('0xd3')]);if(!_0xcbe9df){return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0x275dd1,_0x6e0f('0xd5'));}if(_['isArray'](_0x43d56e)){var _0x15606c=this;_0x43d56e['forEach'](function(_0x51864f,_0x4aec0a){_0x15606c[_0x6e0f('0x10')][_0x6e0f('0x9c')](util[_0x6e0f('0x2e')](_0x6e0f('0x157'),_0xcbe9df,_0x4aec0a),_0x51864f);});return this[_0x6e0f('0x10')]['noop'](util[_0x6e0f('0x2e')](_0x6e0f('0x158'),_0xcbe9df));}else{return this[_0x6e0f('0x10')][_0x6e0f('0x9c')](_0xcbe9df,_0x43d56e);}};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0xe')]=function(_0x4bfbf1){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x159'),_0x4bfbf1[_0x6e0f('0xa8')]));if(_0x4bfbf1[_0x6e0f('0xa2')]===0x0){return this['maxRetry'](_0x4bfbf1);}_0x4bfbf1[_0x6e0f('0xa2')]-=0x1;if(!this['isConfigured'](_0x4bfbf1[_0x6e0f('0x104')])){return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0x4bfbf1,'no\x20file\x20audio\x20selected');}var _0x1ace0e=this[_0x6e0f('0x103')][_0x6e0f('0x76')](this,_0x4bfbf1[_0x6e0f('0x104')]);if(!_0x1ace0e){return this[_0x6e0f('0x10')]['error'](_0x4bfbf1,_0x6e0f('0x105'));}var _0x3b959a=this[_0x6e0f('0x10')][_0x6e0f('0x106')](_0x1ace0e,_0x4bfbf1[_0x6e0f('0x15a')],_0x4bfbf1['digit']);var _0x1e5d43=_0x3b959a[_0x6e0f('0xaa')];if(_0x3b959a[_0x6e0f('0xaa')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x4bfbf1,'-1');return _0x3b959a;}else if(_0x3b959a[_0x6e0f('0x9f')]==='timeout'){_0x3b959a[_0x6e0f('0xaa')]=_0x3b959a['result'][_0x6e0f('0x99')]>0x0?_0x3b959a[_0x6e0f('0xaa')]:'t';}else if(_['isEmpty'](_0x3b959a[_0x6e0f('0xaa')])){_0x3b959a[_0x6e0f('0xaa')]='#';_0x1e5d43='#';}if(!this[_0x6e0f('0x84')](_0x4bfbf1['variable_id'])){this[_0x6e0f('0x10')][_0x6e0f('0xb0')](_0x6e0f('0xd4'));}else{var _0x222454=this[_0x6e0f('0x13')][_0x6e0f('0x76')](this,_0x4bfbf1[_0x6e0f('0xd3')]);if(!_0x222454){return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0x4bfbf1,_0x6e0f('0xd5'));}this['channel'][_0x6e0f('0x9c')](_0x222454,_0x1e5d43);}this[_0x6e0f('0x3d')][_0x6e0f('0x76')](this,_0x4bfbf1,_0x1e5d43);return _0x3b959a;};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0xb0')]=function(_0x3fb0a1){logger[_0x6e0f('0x34')](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x3fb0a1[_0x6e0f('0xa8')]));return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](_0x3fb0a1[_0x6e0f('0x15b')]||_0x3fb0a1[_0x6e0f('0xa8')]);};AGIVertices['prototype']['pause']=function(_0x5251bb){logger[_0x6e0f('0x34')](util['format'](_0x6e0f('0x15c'),_0x5251bb['label']));if(!this['isConfigured'](_0x5251bb[_0x6e0f('0x14b')])){return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0x5251bb,'no\x20find\x20by\x20configured');}logger['info'](util[_0x6e0f('0x2e')](_0x6e0f('0x152'),this['channel'][_0x6e0f('0x40')],_0x5251bb[_0x6e0f('0x14b')]));var _0x2e16e0=this['getPause'][_0x6e0f('0x76')](this,_0x5251bb['pause_id']);var _0x18a09f=this['agentPause'][_0x6e0f('0x76')](this,_0x5251bb['findBy'],_0x2e16e0);if(_0x18a09f){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x14d'),this[_0x6e0f('0x10')]['callerid'],_0x5251bb[_0x6e0f('0x14b')]));this[_0x6e0f('0x10')]['noop'](util[_0x6e0f('0x2e')](_0x6e0f('0x14d'),this[_0x6e0f('0x10')]['callerid'],_0x5251bb[_0x6e0f('0x14b')]));return{'code':0xc8,'result':_0x6e0f('0x14e')};}else{logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x14f'),this[_0x6e0f('0x10')][_0x6e0f('0x40')],_0x5251bb['findBy']));this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util[_0x6e0f('0x2e')](_0x6e0f('0x14d'),this[_0x6e0f('0x10')][_0x6e0f('0x40')],_0x5251bb['findBy']));return{'code':0xc8,'result':_0x6e0f('0x150')};}};AGIVertices[_0x6e0f('0x12')]['playback']=function(_0x37c588){logger['info'](util[_0x6e0f('0x2e')](_0x6e0f('0x15d'),_0x37c588['label']));if(!this['isConfigured'](_0x37c588[_0x6e0f('0x104')])){return this[_0x6e0f('0x10')]['error'](_0x37c588,_0x6e0f('0x102'));}var _0x1bdd84=this[_0x6e0f('0x103')][_0x6e0f('0x76')](this,_0x37c588[_0x6e0f('0x104')]);if(!_0x1bdd84){return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0x37c588,'no\x20file\x20audio\x20found');}var _0x443b98=this[_0x6e0f('0x10')]['exec'](_0x6e0f('0x15e'),[_0x1bdd84,_0x37c588[_0x6e0f('0xe3')]]);if(_0x443b98[_0x6e0f('0xaa')]===-0x1){return _0x443b98;}return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util[_0x6e0f('0x2e')]('Executed\x20command\x20%s\x20%s',_0x6e0f('0x15e'),_0x1bdd84));};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x15f')]=function(_0x4ea94d){logger['info'](util[_0x6e0f('0x2e')](_0x6e0f('0x160'),_0x4ea94d[_0x6e0f('0xa8')]));if(!this['isConfigured'](_0x4ea94d[_0x6e0f('0x161')])){return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0x4ea94d,'no\x20queue\x20selected');}var _0x57b69b='';var _0x27c888=parseInt(_0x4ea94d[_0x6e0f('0x161')],0xa);if(isNaN(_0x27c888)){_0x57b69b=_0x4ea94d[_0x6e0f('0x161')];}else{_0x57b69b=this['getVoiceQueue']['sync'](this,_0x4ea94d['queue_id']);if(!_0x57b69b){return this['channel'][_0x6e0f('0x32')](_0x4ea94d,_0x6e0f('0x162'));}}var _0x38ed65='';if(this[_0x6e0f('0x84')](_0x4ea94d['file_id'])){var _0x1fdd61=this['getSound']['sync'](this,_0x4ea94d['file_id']);if(_0x1fdd61){_0x38ed65=_0x1fdd61;}}this[_0x6e0f('0x3d')][_0x6e0f('0x76')](this,_0x4ea94d,_0x57b69b);if(_0x4ea94d['opts'][_0x6e0f('0x163')]('x')<0x0){_0x4ea94d[_0x6e0f('0xe3')]+='x';}if(_0x4ea94d[_0x6e0f('0xe3')][_0x6e0f('0x163')]('X')<0x0){_0x4ea94d['opts']+='X';}this['channel']['setVariable'](_0x6e0f('0x164'),_0x57b69b?_0x57b69b[_0x6e0f('0x165')]():'');var _0x3e6fb1=this[_0x6e0f('0x10')][_0x6e0f('0x5b')](_0x6e0f('0x166'),[_0x57b69b,_0x4ea94d[_0x6e0f('0xe3')],_0x4ea94d['url'],_0x38ed65,_0x4ea94d[_0x6e0f('0x69')],_0x4ea94d[_0x6e0f('0x9')],_0x4ea94d[_0x6e0f('0x167')],_0x4ea94d['gosub'],'',_0x4ea94d[_0x6e0f('0x168')]]);if(_0x3e6fb1['result']===-0x1){return _0x3e6fb1;}return this[_0x6e0f('0x10')]['noop'](util[_0x6e0f('0x2e')](_0x6e0f('0xb6'),'QUEUE',_0x57b69b));};AGIVertices['prototype']['record']=function(_0x5300ec){logger[_0x6e0f('0x34')](util['format']('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x5300ec[_0x6e0f('0xa8')]));var _0x4b59be=_0x5300ec[_0x6e0f('0x169')]||_0x6e0f('0x129');var _0x22875b=util[_0x6e0f('0x2e')](_0x6e0f('0x16a'),this[_0x6e0f('0x10')][_0x6e0f('0x47')],rs[_0x6e0f('0x10b')](0x5));var _0x55e0a9=util[_0x6e0f('0x2e')](_0x6e0f('0x16b'),FILES_PATH,_0x22875b,_0x4b59be);var _0x1ed359=util[_0x6e0f('0x2e')](_0x6e0f('0x12a'),FILES_PATH,_0x22875b);this[_0x6e0f('0x41')][_0x6e0f('0x76')](this,_0x5300ec,_0x22875b,_0x55e0a9);this[_0x6e0f('0x10')][_0x6e0f('0x9c')](_0x6e0f('0x16c'),_0x22875b);logger['info'](_0x6e0f('0x16d'),_0x1ed359,_0x4b59be,_0x5300ec[_0x6e0f('0x16e')],_0x5300ec[_0x6e0f('0x69')]);return this[_0x6e0f('0x10')][_0x6e0f('0x122')](_0x1ed359,_0x4b59be,_0x5300ec[_0x6e0f('0x16e')],_0x5300ec[_0x6e0f('0x69')],undefined,!![]);};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x16f')]=function(_0x4f500d){logger['info'](util[_0x6e0f('0x2e')](_0x6e0f('0x170'),_0x4f500d[_0x6e0f('0xa8')]));if(!this['isConfigured'](_0x4f500d[_0x6e0f('0x67')])){return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](_0x6e0f('0x171'));}var _0x7928f7=this[_0x6e0f('0x172')][_0x6e0f('0x76')](this,_0x4f500d);logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x173'),util[_0x6e0f('0x174')](_0x7928f7,{'showHidden':![],'depth':null})));if(!this[_0x6e0f('0x84')](_0x4f500d['variable_id'])){return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](_0x6e0f('0x175'));}var _0x45b3da=this[_0x6e0f('0x13')][_0x6e0f('0x76')](this,_0x4f500d[_0x6e0f('0xd3')]);if(!_0x45b3da){return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0x4f500d,'no\x20variable\x20found');}this['channel'][_0x6e0f('0x9c')](util[_0x6e0f('0x2e')](_0x6e0f('0x176'),_0x45b3da),_0x7928f7[_0x6e0f('0x7b')]?_0x7928f7[_0x6e0f('0x7b')]:_0x6e0f('0x177'));this[_0x6e0f('0x10')][_0x6e0f('0x9c')](util[_0x6e0f('0x2e')](_0x6e0f('0x178'),_0x45b3da),_0x7928f7['statusMessage']?_0x7928f7[_0x6e0f('0x7a')]:'OK');if(_0x7928f7[_0x6e0f('0x6f')]){try{this[_0x6e0f('0x9a')](_0x7928f7[_0x6e0f('0x6f')],_0x45b3da);}catch(_0x35dec8){logger[_0x6e0f('0x32')](util[_0x6e0f('0x2e')](_0x6e0f('0x179'),_0x45b3da));}}return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util['format'](_0x6e0f('0xda'),_0x45b3da));};AGIVertices['prototype'][_0x6e0f('0x17a')]=function(_0x427fe7){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x17b'),_0x427fe7[_0x6e0f('0xa8')]));return this[_0x6e0f('0x10')][_0x6e0f('0x17c')](_0x427fe7[_0x6e0f('0x17d')]['replace'](/\s+/g,''),_0x427fe7[_0x6e0f('0x16e')]);};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x17e')]=function(_0xc06558){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x17f'),_0xc06558[_0x6e0f('0xa8')]));return this[_0x6e0f('0x10')]['sayNumber'](_0xc06558[_0x6e0f('0x6a')][_0x6e0f('0x5d')](/\s+/g,''),_0xc06558[_0x6e0f('0x16e')]);};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x180')]=function(_0x58db02){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x58db02[_0x6e0f('0xa8')]));return this['channel'][_0x6e0f('0x181')](_0x58db02[_0x6e0f('0x61')],_0x58db02[_0x6e0f('0x16e')]);};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x182')]=function(_0xd416fa){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x183'),_0xd416fa[_0x6e0f('0xa8')]));if(!this['isConfigured'](_0xd416fa[_0x6e0f('0x184')])){return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](_0x6e0f('0x185'));}var _0x558c6f=this[_0x6e0f('0x24')][_0x6e0f('0x76')](this,_0xd416fa[_0x6e0f('0x184')]);if(!_0x558c6f||!_0x558c6f['Smtp']){return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0xd416fa,'no\x20mail\x20account\x20found');}var _0x1e6c05={'from':util[_0x6e0f('0x2e')](_0x6e0f('0x186'),_0x558c6f[_0x6e0f('0x19')],_0x558c6f[_0x6e0f('0x187')]||_0x558c6f[_0x6e0f('0x188')][_0x6e0f('0x189')]),'to':_0xd416fa['to']||'','cc':_0xd416fa['cc']||'','bcc':_0xd416fa[_0x6e0f('0x18a')]||'','subject':_0xd416fa[_0x6e0f('0x18b')],'html':_0xd416fa[_0x6e0f('0x61')],'text':_0xd416fa[_0x6e0f('0x61')]};var _0x21bc5a={'tls':{'rejectUnauthorized':![]}};if(_0x558c6f[_0x6e0f('0x188')]['service']){_0x21bc5a[_0x6e0f('0x18c')]=_0x558c6f[_0x6e0f('0x188')][_0x6e0f('0x18c')];}else{_0x21bc5a[_0x6e0f('0x18d')]=_0x558c6f[_0x6e0f('0x188')][_0x6e0f('0x18d')];_0x21bc5a[_0x6e0f('0x18e')]=_0x558c6f['Smtp'][_0x6e0f('0x18e')];_0x21bc5a[_0x6e0f('0x18f')]=_0x558c6f['Smtp'][_0x6e0f('0x18f')];}if(_0x558c6f[_0x6e0f('0x188')]['authentication']){_0x21bc5a[_0x6e0f('0x190')]={'user':_0x558c6f[_0x6e0f('0x188')]['user'],'pass':_0x558c6f[_0x6e0f('0x188')][_0x6e0f('0x191')]};}if(this['isConfigured'](_0xd416fa['template_id'])){}logger[_0x6e0f('0xdb')](_0x6e0f('0x192'),JSON['stringify'](_0x1e6c05));this['createSquareDetailsReport'][_0x6e0f('0x76')](this,_0xd416fa,_0xd416fa[_0x6e0f('0x184')]);this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util[_0x6e0f('0x2e')](_0x6e0f('0x193'),_0x558c6f['name']));this[_0x6e0f('0x26')]['sync'](this,_0x21bc5a,_0x1e6c05);return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](_0x6e0f('0x194'));};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x195')]=function(_0x29c945){logger['info'](util['format'](_0x6e0f('0x196'),_0x29c945[_0x6e0f('0xa8')]));return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](_0x6e0f('0x197'));};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x198')]=function(_0x24bd84){logger['info'](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x24bd84['label']));if(!this[_0x6e0f('0x84')](_0x24bd84['sms_account_id'])){return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](_0x6e0f('0x199'));}var _0x58c0b5=this[_0x6e0f('0x3a')][_0x6e0f('0x76')](this,_0x24bd84[_0x6e0f('0x19a')]);if(!_0x58c0b5){return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0x24bd84,_0x6e0f('0x19b'));}var _0x14b565={'body':_0x24bd84[_0x6e0f('0x19c')],'phone':_0x24bd84['to']||'','SmsAccountId':_0x58c0b5['id']};logger['debug'](_0x6e0f('0x19d'),JSON['stringify'](_0x14b565));this[_0x6e0f('0x3d')][_0x6e0f('0x76')](this,_0x24bd84,_0x24bd84['sms_account_id']);this['channel']['noop'](util[_0x6e0f('0x2e')](_0x6e0f('0x19e'),_0x58c0b5[_0x6e0f('0x19')]));this[_0x6e0f('0x3c')][_0x6e0f('0x76')](this,_0x14b565);return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](_0x6e0f('0x19f'));};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x1a0')]=function(_0x202734){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x1a1'),_0x202734[_0x6e0f('0xa8')]));if(!this[_0x6e0f('0x84')](_0x202734['variable_id'])){return this['channel'][_0x6e0f('0x32')](_0x202734,_0x6e0f('0x1a2'));}var _0xcb2d36=this[_0x6e0f('0x13')][_0x6e0f('0x76')](this,_0x202734[_0x6e0f('0xd3')]);if(!_0xcb2d36){return this['channel'][_0x6e0f('0x32')](_0x202734,_0x6e0f('0xd5'));}return this['channel'][_0x6e0f('0x9c')](_0xcb2d36,_0x202734[_0x6e0f('0x1a3')]);};AGIVertices['prototype'][_0x6e0f('0x1a4')]=function(_0x21a88a){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x1a5'),_0x21a88a['label']));this['channel']['noop']('START\x20CALLY\x20SQUARE');if(_0x21a88a['answer']==='yes'){this[_0x6e0f('0x10')][_0x6e0f('0xb0')](_0x6e0f('0x1a6'));return this['channel']['answer']();}return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](_0x6e0f('0x1a7'));};AGIVertices[_0x6e0f('0x12')]['subproject']=function(_0x284796){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x284796[_0x6e0f('0xa8')]));if(!this[_0x6e0f('0x84')](_0x284796[_0x6e0f('0x1a8')])){return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0x284796,_0x6e0f('0x1a9'));}var _0x334a11=this['getSquareProject'][_0x6e0f('0x76')](this,_0x284796[_0x6e0f('0x1a8')]);if(!this[_0x6e0f('0x84')](_0x334a11)){return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0x284796,util['format'](_0x6e0f('0x1aa'),_0x284796[_0x6e0f('0x1a8')]));}if(_0x334a11===this[_0x6e0f('0x10')]['arg_1']){return this['channel'][_0x6e0f('0x32')](_0x284796,_0x6e0f('0x1ab'));}this[_0x6e0f('0x3d')][_0x6e0f('0x76')](this,_0x284796,_0x334a11);var _0x1960e0=this[_0x6e0f('0x10')][_0x6e0f('0x5b')](_0x6e0f('0x1ac'),util[_0x6e0f('0x2e')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x6e0f('0x9')]['host']||_0x6e0f('0x1ad'),_0x334a11,this[_0x6e0f('0x10')][_0x6e0f('0x3f')]));if(_0x1960e0[_0x6e0f('0xaa')]===-0x1){return _0x1960e0;}return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util[_0x6e0f('0x2e')]('Executed\x20command\x20%s\x20%s','AGI',_0x334a11));};AGIVertices[_0x6e0f('0x12')][_0x6e0f('0x1ae')]=function(_0x85a7ae){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x1af'),_0x85a7ae['label']));var _0x58a063=this['shellCommand'][_0x6e0f('0x76')](this,_0x85a7ae[_0x6e0f('0xa5')]);this['createSquareDetailsReport'][_0x6e0f('0x76')](this,_0x85a7ae,_0x85a7ae[_0x6e0f('0xa5')]);if(this['isConfigured'](_0x85a7ae[_0x6e0f('0xd3')])){var _0x3f5036=this[_0x6e0f('0x13')][_0x6e0f('0x76')](this,_0x85a7ae['variable_id']);if(_0x3f5036){this[_0x6e0f('0x10')][_0x6e0f('0x9c')](_0x3f5036,_0x58a063);return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util[_0x6e0f('0x2e')](_0x6e0f('0x1b0'),_0x85a7ae[_0x6e0f('0xa5')],_0x3f5036));}}return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util[_0x6e0f('0x2e')](_0x6e0f('0x1b1'),_0x85a7ae[_0x6e0f('0xa5')]));};AGIVertices[_0x6e0f('0x12')]['google_cloud_tts']=function(_0xbe4943){logger['info'](util[_0x6e0f('0x2e')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0xbe4943[_0x6e0f('0xa8')]));if(!this[_0x6e0f('0x84')](_0xbe4943[_0x6e0f('0x5f')])){return this[_0x6e0f('0x10')][_0x6e0f('0xb0')](_0x6e0f('0x1b2'));}if(!this[_0x6e0f('0x84')](_0xbe4943['text'])){return this['channel'][_0x6e0f('0xb0')](_0x6e0f('0xb9'));}this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util['format']('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0xbe4943[_0x6e0f('0x61')]));var _0x58a0dc=this[_0x6e0f('0x5e')][_0x6e0f('0x76')](this,_0xbe4943);if(_0x58a0dc){this['channel'][_0x6e0f('0xb0')](util[_0x6e0f('0x2e')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x58a0dc));var _0x51bead=this['channel']['streamFile'](_0x58a0dc);try{fs['unlink'](_0x58a0dc+_0x6e0f('0xf6'));}catch(_0x2ac1cd){logger[_0x6e0f('0x32')](_0x2ac1cd);}return _0x51bead;}return this['channel'][_0x6e0f('0x32')](_0xbe4943,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['tts']=function(_0x2443bb){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x1b3'),_0x2443bb['label']));if(!this['isConfigured'](_0x2443bb['text'])){return this['channel'][_0x6e0f('0xb0')](_0x6e0f('0xb9'));}this[_0x6e0f('0x10')][_0x6e0f('0xb0')](util[_0x6e0f('0x2e')](_0x6e0f('0x1b4'),_0x2443bb[_0x6e0f('0x61')]));var _0x3d5af5=this[_0x6e0f('0x66')][_0x6e0f('0x76')](this,_0x2443bb);if(_0x3d5af5){this[_0x6e0f('0x10')]['noop'](util['format'](_0x6e0f('0x1b5'),_0x3d5af5));var _0x36b71e=this[_0x6e0f('0x10')][_0x6e0f('0x116')](_0x3d5af5);try{fs['unlink'](_0x3d5af5+'.wav');}catch(_0x1071d4){logger[_0x6e0f('0x32')](_0x1071d4);}return _0x36b71e;}return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0x2443bb,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x6e0f('0x12')]['unpause']=function(_0x3b0f7e){logger[_0x6e0f('0x34')](util['format']('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x3b0f7e[_0x6e0f('0xa8')]));if(!this['isConfigured'](_0x3b0f7e[_0x6e0f('0x14b')])){return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0x3b0f7e,_0x6e0f('0x14c'));}logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x152'),this[_0x6e0f('0x10')]['callerid'],_0x3b0f7e[_0x6e0f('0x14b')]));var _0x2612d4=this[_0x6e0f('0x55')][_0x6e0f('0x76')](this,_0x3b0f7e['findBy']);if(_0x2612d4){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x14d'),this[_0x6e0f('0x10')][_0x6e0f('0x40')],_0x3b0f7e[_0x6e0f('0x14b')]));this['channel']['noop'](util[_0x6e0f('0x2e')](_0x6e0f('0x14d'),this[_0x6e0f('0x10')][_0x6e0f('0x40')],_0x3b0f7e[_0x6e0f('0x14b')]));return{'code':0xc8,'result':_0x6e0f('0x14e')};}else{logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x14f'),this[_0x6e0f('0x10')][_0x6e0f('0x40')],_0x3b0f7e[_0x6e0f('0x14b')]));this[_0x6e0f('0x10')]['noop'](util[_0x6e0f('0x2e')](_0x6e0f('0x14f'),this['channel'][_0x6e0f('0x40')],_0x3b0f7e[_0x6e0f('0x14b')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x6e0f('0x1b6')]=function(_0x54f70f){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x1b7'),_0x54f70f[_0x6e0f('0xa8')]));var _0x4df2b7=this[_0x6e0f('0x10')][_0x6e0f('0x5b')](_0x6e0f('0x1b8'),[_0x54f70f[_0x6e0f('0x1b9')],_0x54f70f[_0x6e0f('0xb7')]]);if(_0x4df2b7[_0x6e0f('0xaa')]===-0x1){return _0x4df2b7;}return this['channel']['noop'](util[_0x6e0f('0x2e')](_0x6e0f('0xb6'),'VOICEMAIL',_0x54f70f[_0x6e0f('0x1b9')]));};AGIVertices['prototype'][_0x6e0f('0x1ba')]=function(_0x10279b){logger[_0x6e0f('0x34')](util[_0x6e0f('0x2e')](_0x6e0f('0x1bb'),_0x10279b[_0x6e0f('0xa8')]));if(!this[_0x6e0f('0x84')](_0x10279b[_0x6e0f('0xd3')])){return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0x10279b,_0x6e0f('0x1a2'));}var _0x57e9c2=this[_0x6e0f('0x13')]['sync'](this,_0x10279b['variable_id']);if(!_0x57e9c2){return this[_0x6e0f('0x10')][_0x6e0f('0x32')](_0x10279b,_0x6e0f('0xd5'));}var _0x39ee9c=this['channel'][_0x6e0f('0x13')](_0x57e9c2);return{'code':0xc8,'result':_0x39ee9c[_0x6e0f('0x9f')]?_0x39ee9c[_0x6e0f('0x9f')]:'-'};};String[_0x6e0f('0x12')][_0x6e0f('0x9e')]=function(_0x1dbbce,_0xcb3bc1){return this[_0x6e0f('0x9d')](_0x1dbbce)[_0x6e0f('0x1bc')](_0xcb3bc1);};module[_0x6e0f('0x1bd')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 94d6bb9..e0eb3d6 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 _0x032e=['[ACW][syncAgentConnect]\x20%s','acw','mandatoryDisposition','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../ami','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','interface','queue','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','update','uniqueid','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','message','[TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','[ACW][STOP]\x20%s'];(function(_0x464838,_0x28c910){var _0x2ca654=function(_0x380da8){while(--_0x380da8){_0x464838['push'](_0x464838['shift']());}};_0x2ca654(++_0x28c910);}(_0x032e,0x124));var _0xe032=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x032e[_0x491a7f];return _0x3d8f44;};'use strict';var util=require(_0xe032('0x0'));var _=require('lodash');var moment=require(_0xe032('0x1'));var ami=require(_0xe032('0x2'));var logger=require('../../../config/logger')('acw');var RpcUser=require(_0xe032('0x3'));var RpcVoiceAgentReport=require(_0xe032('0x4'));function Acw(_0x2f44f6){this[_0xe032('0x5')]=_0x2f44f6[_0xe032('0x5')];this[_0xe032('0x6')]=_0x2f44f6[_0xe032('0x6')];this[_0xe032('0x7')]=_0x2f44f6[_0xe032('0x7')];this[_0xe032('0x8')]={};ami['on'](_0xe032('0x9'),this[_0xe032('0xa')][_0xe032('0xb')](this));ami['on'](_0xe032('0xc'),this[_0xe032('0xd')][_0xe032('0xb')](this));ami['on'](_0xe032('0xe'),this[_0xe032('0xf')]['bind'](this));ami['on'](_0xe032('0x10'),this[_0xe032('0x11')][_0xe032('0xb')](this));ami['on'](_0xe032('0x12'),this[_0xe032('0x13')][_0xe032('0xb')](this));ami['on'](_0xe032('0x14'),this['syncBlindTransfer'][_0xe032('0xb')](this));ami['on'](_0xe032('0x15'),this[_0xe032('0x16')][_0xe032('0xb')](this));}function getDiff(_0x4aee44){var _0x311592=moment()[_0xe032('0x17')](0x0);var _0x176547=moment(_0x4aee44)[_0xe032('0x17')](0x0);return _0x311592[_0xe032('0x18')](_0x176547,_0xe032('0x19'));}Acw[_0xe032('0x1a')]['startAcw']=function(_0x231c35){try{var _0x749018=this;var _0x36fb7c=this[_0xe032('0x8')][_0x231c35][_0xe032('0x1b')];var _0x208b00=this['channels'][_0x231c35][_0xe032('0x1c')];var _0x25cedb=this[_0xe032('0x5')][_0x208b00];var _0x41d2a5=![];var _0x208c47='ACW';if(_0x25cedb['mandatoryDisposition']){if(_0x25cedb['mandatoryDispositionPause'][_0xe032('0x1d')]){_0x41d2a5=!![];_0x208c47=_0x25cedb['mandatoryDispositionPause'][_0xe032('0x1d')];}}ami[_0xe032('0x1e')]({'action':_0xe032('0x1f'),'interface':_0x36fb7c,'paused':!![],'reason':_0x208c47})[_0xe032('0x20')](function(_0x288d91){if(_0x749018[_0xe032('0x6')][_0x36fb7c]){return RpcUser[_0xe032('0x21')](_0x749018['agents'][_0x36fb7c]['id'])[_0xe032('0x20')](function(_0x866c81){if(_0x866c81&&!_0x866c81[_0xe032('0x22')]){logger[_0xe032('0x23')](_0xe032('0x24'),_0x231c35,_0x36fb7c,_0x208b00);var _0x33d89a=_0x749018[_0xe032('0x8')][_0x231c35][_0xe032('0x25')]&&_0x749018['channels'][_0x231c35]['destlinkedid']?_0x749018['channels'][_0x231c35][_0xe032('0x26')]:_0x231c35;return RpcUser[_0xe032('0x27')](_0x749018[_0xe032('0x6')][_0x36fb7c],_0x208c47,_0x33d89a)[_0xe032('0x20')](function(_0x2bfe8f){if(!_0x41d2a5){_0x749018[_0xe032('0x7')][_0x36fb7c]={};logger[_0xe032('0x23')](_0xe032('0x28'),_0x231c35,_0x749018[_0xe032('0x5')][_0x208b00][_0xe032('0x29')],_0x36fb7c,_0x208b00);_0x749018['timers'][_0x36fb7c][_0xe032('0x2a')]=setTimeout(_0x749018[_0xe032('0x2b')][_0xe032('0xb')](_0x749018,_0x36fb7c),_0x749018[_0xe032('0x5')][_0x208b00]['acwTimeout']*0x3e8);_0x749018['timers'][_0x36fb7c][_0xe032('0x2c')]=moment()[_0xe032('0x2d')](_0xe032('0x2e'));_0x749018[_0xe032('0x7')][_0x36fb7c]['uniqueid']=_0x231c35;_0x749018['timers'][_0x36fb7c]['queue']=_0x208b00;_0x749018[_0xe032('0x7')][_0x36fb7c][_0xe032('0x2f')]=function(){var _0x5518ac=getDiff(_0x749018[_0xe032('0x7')][_0x36fb7c]['lastPauseAt']);clearTimeout(_0x749018[_0xe032('0x7')][_0x36fb7c][_0xe032('0x2a')]);_0x749018[_0xe032('0x7')][_0x36fb7c][_0xe032('0x2a')]=![];RpcVoiceAgentReport[_0xe032('0x30')]({'acwtime':_0x5518ac},_0x749018['timers'][_0x36fb7c][_0xe032('0x31')],_0x36fb7c)[_0xe032('0x20')](function(_0x319a2f){logger[_0xe032('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x231c35,_0x5518ac,_0x319a2f);})[_0xe032('0x32')](function(_0x4c86e9){logger[_0xe032('0x33')]('[%s][UPDATE][ERRORS:%s]',_0x231c35,_0x4c86e9);});delete _0x749018[_0xe032('0x7')][_0x36fb7c];};}});}else{logger['info'](_0xe032('0x34'),_0x231c35,_0x36fb7c,_0x208b00);}});}})['catch'](function(_0x3970e1){logger[_0xe032('0x33')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x231c35,_0x749018[_0xe032('0x5')][_0x208b00][_0xe032('0x29')],_0x36fb7c,_0x208b00);})[_0xe032('0x35')](function(){delete _0x749018[_0xe032('0x8')][_0x231c35];});}catch(_0x4e222c){logger[_0xe032('0x33')]('[ACW][START]\x20%s',_0x4e222c[_0xe032('0x36')]);}};Acw[_0xe032('0x1a')]['stopAcw']=function(_0x450ba4){try{var _0x23b790=this;if(_0x23b790['timers'][_0x450ba4]){_0x23b790[_0xe032('0x7')][_0x450ba4][_0xe032('0x2a')]=![];var _0x3cc437=_0x23b790[_0xe032('0x7')][_0x450ba4][_0xe032('0x31')];var _0x42f58a=_0x23b790[_0xe032('0x7')][_0x450ba4][_0xe032('0x1c')];var _0x22651f=_0x23b790[_0xe032('0x5')][_0x42f58a][_0xe032('0x29')];logger[_0xe032('0x23')](_0xe032('0x37'),_0x450ba4);RpcUser[_0xe032('0x38')](this[_0xe032('0x6')][_0x450ba4]);RpcVoiceAgentReport[_0xe032('0x30')]({'acwtime':_0x22651f,'agentacw':!![]},_0x3cc437,_0x450ba4)[_0xe032('0x20')](function(_0x555914){logger[_0xe032('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x3cc437,_0x22651f,_0x555914);})[_0xe032('0x32')](function(_0x2bcfb4){logger[_0xe032('0x33')](_0xe032('0x39'),_0x3cc437,_0x2bcfb4);});}else{logger[_0xe032('0x33')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x450ba4);if(_0x23b790[_0xe032('0x7')]){logger['info'](_0xe032('0x3a'),JSON['stringify'](_0x23b790[_0xe032('0x7')]));}}}catch(_0x475355){logger[_0xe032('0x33')](_0xe032('0x3b'),_0x475355['message']);}};Acw[_0xe032('0x1a')]['syncAgentConnect']=function(_0x2b9664){try{if(this[_0xe032('0x5')][_0x2b9664[_0xe032('0x1c')]]&&(this[_0xe032('0x5')][_0x2b9664['queue']]['acw']||this[_0xe032('0x5')][_0x2b9664[_0xe032('0x1c')]]['mandatoryDisposition'])){if(this[_0xe032('0x6')][_0x2b9664[_0xe032('0x1b')]]){this[_0xe032('0x8')][_0x2b9664[_0xe032('0x31')]]={'queue':_0x2b9664[_0xe032('0x1c')],'interface':_0x2b9664['interface'],'destlinkedid':_0x2b9664[_0xe032('0x26')]};}}}catch(_0x7bc08){logger[_0xe032('0x33')](_0xe032('0x3c'),_0x7bc08[_0xe032('0x36')]);}};Acw[_0xe032('0x1a')][_0xe032('0x16')]=function(_0x318f86){try{if(this['voiceQueues'][_0x318f86['queue']]&&(this[_0xe032('0x5')][_0x318f86['queue']][_0xe032('0x3d')]||this[_0xe032('0x5')][_0x318f86[_0xe032('0x1c')]][_0xe032('0x3e')])){if(this[_0xe032('0x6')][_0x318f86[_0xe032('0x1b')]]){this[_0xe032('0x8')][_0x318f86[_0xe032('0x31')]]={'queue':_0x318f86[_0xe032('0x1c')],'interface':_0x318f86['interface']};}}}catch(_0x1549c){logger['error']('[ACW][syncAgentConnectPreview]\x20%s',_0x1549c[_0xe032('0x36')]);}};Acw[_0xe032('0x1a')][_0xe032('0xd')]=function(_0x1e54d3){try{if(this['channels'][_0x1e54d3[_0xe032('0x31')]]&&_[_0xe032('0x3f')](this[_0xe032('0x8')][_0x1e54d3[_0xe032('0x31')]][_0xe032('0x25')])){logger[_0xe032('0x23')](_0xe032('0x40'),_0x1e54d3['uniqueid']);this[_0xe032('0x41')](_0x1e54d3[_0xe032('0x31')]);}else if(this['channels'][_0x1e54d3[_0xe032('0x42')]]&&_[_0xe032('0x3f')](this[_0xe032('0x8')][_0x1e54d3[_0xe032('0x42')]][_0xe032('0x25')])){logger[_0xe032('0x23')](_0xe032('0x43'),_0x1e54d3[_0xe032('0x42')]);this[_0xe032('0x41')](_0x1e54d3[_0xe032('0x42')]);}}catch(_0x3a0253){logger[_0xe032('0x33')](_0xe032('0x44'),_0x3a0253[_0xe032('0x36')]);}};Acw['prototype'][_0xe032('0xf')]=function(_0x53c8b2){try{if(this[_0xe032('0x8')][_0x53c8b2[_0xe032('0x31')]]&&this[_0xe032('0x8')][_0x53c8b2[_0xe032('0x31')]][_0xe032('0x25')]){logger[_0xe032('0x23')](_0xe032('0x45'),_0x53c8b2[_0xe032('0x31')]);this[_0xe032('0x41')](_0x53c8b2[_0xe032('0x31')]);}else if(this[_0xe032('0x8')][_0x53c8b2['linkedid']]&&this[_0xe032('0x8')][_0x53c8b2[_0xe032('0x42')]]['attended']){logger[_0xe032('0x23')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x53c8b2[_0xe032('0x42')]);this[_0xe032('0x41')](_0x53c8b2[_0xe032('0x42')]);}}catch(_0x414243){logger[_0xe032('0x33')]('[ACW][syncHangup]\x20%s',_0x414243[_0xe032('0x36')]);}};Acw[_0xe032('0x1a')][_0xe032('0x13')]=function(_0x21a32f){try{if(!_[_0xe032('0x46')](this[_0xe032('0x8')][_0x21a32f[_0xe032('0x47')]])){this['startAcw'](_0x21a32f[_0xe032('0x47')]);if(this[_0xe032('0x8')][_0x21a32f[_0xe032('0x48')]]){this[_0xe032('0x8')][_0x21a32f[_0xe032('0x48')]][_0xe032('0x25')]=!![];this[_0xe032('0x8')][_0x21a32f[_0xe032('0x49')]]=this[_0xe032('0x8')][_0x21a32f['secondtransfereruniqueid']];delete this[_0xe032('0x8')][_0x21a32f[_0xe032('0x48')]];}}else if(!_[_0xe032('0x46')](this['channels'][_0x21a32f[_0xe032('0x49')]])){this[_0xe032('0x41')](_0x21a32f['transfertargetuniqueid']);if(this[_0xe032('0x8')][_0x21a32f[_0xe032('0x4a')]]){this[_0xe032('0x8')][_0x21a32f[_0xe032('0x4a')]][_0xe032('0x25')]=!![];this[_0xe032('0x8')][_0x21a32f[_0xe032('0x47')]]=this[_0xe032('0x8')][_0x21a32f[_0xe032('0x4a')]];delete this[_0xe032('0x8')][_0x21a32f[_0xe032('0x4a')]];}}}catch(_0x505986){logger[_0xe032('0x33')](_0xe032('0x4b'),_0x505986[_0xe032('0x36')]);}};Acw[_0xe032('0x1a')][_0xe032('0x4c')]=function(_0x4d305b){try{if(this[_0xe032('0x8')][_0x4d305b['transfereruniqueid']]){logger[_0xe032('0x23')](_0xe032('0x4d'),JSON[_0xe032('0x4e')](_0x4d305b[_0xe032('0x4f')]));this[_0xe032('0x41')](_0x4d305b[_0xe032('0x4f')]);}else if(this[_0xe032('0x8')][_0x4d305b[_0xe032('0x50')]]){logger[_0xe032('0x23')]('[%s][BLINDTRANSFER:LINKEDID]',JSON['stringify'](_0x4d305b['transfererlinkedid']));this[_0xe032('0x41')](_0x4d305b[_0xe032('0x50')]);}}catch(_0x889c28){logger[_0xe032('0x33')](_0xe032('0x51'),_0x889c28[_0xe032('0x36')]);}};Acw['prototype'][_0xe032('0x11')]=function(_0x1d66c3){try{if(this[_0xe032('0x5')][_0x1d66c3['queue']]&&this[_0xe032('0x5')][_0x1d66c3['queue']][_0xe032('0x52')]===_0xe032('0x53')){if(this['agents'][_0x1d66c3['interface']]){logger['info'](_0xe032('0x54'),_0x1d66c3['uniqueid'],_0x1d66c3['interface'],_0x1d66c3[_0xe032('0x1c')]);return RpcUser[_0xe032('0x27')](this[_0xe032('0x6')][_0x1d66c3['interface']],_0xe032('0x55'),_0x1d66c3['uniqueid']);}}}catch(_0x2cf342){logger[_0xe032('0x33')](_0xe032('0x56'),_0x2cf342[_0xe032('0x36')]);}};module[_0xe032('0x57')]=Acw; \ No newline at end of file +var _0xb903=['attended','destlinkedid','savePause','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','acwTimeout','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','[ACW][START]\x20%s','[TIMER][STOP][AGENT:%s]','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','interface','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','Auto-Pause','exports','util','lodash','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','syncAgentRingNoAnswer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','prototype','startAcw','channels','mandatoryDisposition','name','mandatoryDispositionPause','Action','QueuePause','then','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]'];(function(_0x5864c9,_0x59059e){var _0x2218ca=function(_0x4f4293){while(--_0x4f4293){_0x5864c9['push'](_0x5864c9['shift']());}};_0x2218ca(++_0x59059e);}(_0xb903,0x185));var _0x3b90=function(_0x1d3438,_0x3d2ab7){_0x1d3438=_0x1d3438-0x0;var _0x49ac92=_0xb903[_0x1d3438];return _0x49ac92;};'use strict';var util=require(_0x3b90('0x0'));var _=require(_0x3b90('0x1'));var moment=require(_0x3b90('0x2'));var ami=require(_0x3b90('0x3'));var logger=require('../../../config/logger')(_0x3b90('0x4'));var RpcUser=require(_0x3b90('0x5'));var RpcVoiceAgentReport=require(_0x3b90('0x6'));function Acw(_0x1cd5d8){this[_0x3b90('0x7')]=_0x1cd5d8[_0x3b90('0x7')];this[_0x3b90('0x8')]=_0x1cd5d8['agents'];this[_0x3b90('0x9')]=_0x1cd5d8['timers'];this['channels']={};ami['on'](_0x3b90('0xa'),this[_0x3b90('0xb')][_0x3b90('0xc')](this));ami['on'](_0x3b90('0xd'),this['syncHangupRequest']['bind'](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on']('agentringnoanswer',this[_0x3b90('0xe')][_0x3b90('0xc')](this));ami['on']('attendedtransfer',this[_0x3b90('0xf')][_0x3b90('0xc')](this));ami['on']('blindtransfer',this[_0x3b90('0x10')][_0x3b90('0xc')](this));ami['on'](_0x3b90('0x11'),this['syncAgentConnectPreview']['bind'](this));}function getDiff(_0x58c4d1){var _0x542cb3=moment()['milliseconds'](0x0);var _0x3a0a55=moment(_0x58c4d1)[_0x3b90('0x12')](0x0);return _0x542cb3['diff'](_0x3a0a55,'seconds');}Acw[_0x3b90('0x13')][_0x3b90('0x14')]=function(_0x381a9e){try{var _0x1af265=this;var _0x1efe01=this['channels'][_0x381a9e]['interface'];var _0xd83280=this[_0x3b90('0x15')][_0x381a9e]['queue'];var _0x269488=this[_0x3b90('0x7')][_0xd83280];var _0x11ad7d=![];var _0x131f3f='ACW';if(_0x269488[_0x3b90('0x16')]){if(_0x269488['mandatoryDispositionPause'][_0x3b90('0x17')]){_0x11ad7d=!![];_0x131f3f=_0x269488[_0x3b90('0x18')]['name'];}}ami[_0x3b90('0x19')]({'action':_0x3b90('0x1a'),'interface':_0x1efe01,'paused':!![],'reason':_0x131f3f})[_0x3b90('0x1b')](function(_0x3ce411){if(_0x1af265[_0x3b90('0x8')][_0x1efe01]){return RpcUser[_0x3b90('0x1c')](_0x1af265[_0x3b90('0x8')][_0x1efe01]['id'])[_0x3b90('0x1b')](function(_0xa98414){if(_0xa98414&&!_0xa98414[_0x3b90('0x1d')]){logger['info'](_0x3b90('0x1e'),_0x381a9e,_0x1efe01,_0xd83280);var _0x36b93e=_0x1af265[_0x3b90('0x15')][_0x381a9e][_0x3b90('0x1f')]&&_0x1af265[_0x3b90('0x15')][_0x381a9e][_0x3b90('0x20')]?_0x1af265['channels'][_0x381a9e]['destlinkedid']:_0x381a9e;return RpcUser[_0x3b90('0x21')](_0x1af265[_0x3b90('0x8')][_0x1efe01],_0x131f3f,_0x36b93e)[_0x3b90('0x1b')](function(_0x2ffa1a){if(!_0x11ad7d){_0x1af265['timers'][_0x1efe01]={};logger[_0x3b90('0x22')](_0x3b90('0x23'),_0x381a9e,_0x1af265[_0x3b90('0x7')][_0xd83280]['acwTimeout'],_0x1efe01,_0xd83280);_0x1af265[_0x3b90('0x9')][_0x1efe01][_0x3b90('0x24')]=setTimeout(_0x1af265[_0x3b90('0x25')][_0x3b90('0xc')](_0x1af265,_0x1efe01),_0x1af265[_0x3b90('0x7')][_0xd83280][_0x3b90('0x26')]*0x3e8);_0x1af265['timers'][_0x1efe01][_0x3b90('0x27')]=moment()['format'](_0x3b90('0x28'));_0x1af265[_0x3b90('0x9')][_0x1efe01][_0x3b90('0x29')]=_0x381a9e;_0x1af265[_0x3b90('0x9')][_0x1efe01][_0x3b90('0x2a')]=_0xd83280;_0x1af265[_0x3b90('0x9')][_0x1efe01][_0x3b90('0x2b')]=function(){var _0x2430ec=getDiff(_0x1af265['timers'][_0x1efe01]['lastPauseAt']);clearTimeout(_0x1af265[_0x3b90('0x9')][_0x1efe01][_0x3b90('0x24')]);_0x1af265[_0x3b90('0x9')][_0x1efe01][_0x3b90('0x24')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x2430ec},_0x1af265['timers'][_0x1efe01][_0x3b90('0x29')],_0x1efe01)[_0x3b90('0x1b')](function(_0x24d5c9){logger['info'](_0x3b90('0x2c'),_0x381a9e,_0x2430ec,_0x24d5c9);})['catch'](function(_0x49b4d2){logger[_0x3b90('0x2d')](_0x3b90('0x2e'),_0x381a9e,_0x49b4d2);});delete _0x1af265['timers'][_0x1efe01];};}});}else{logger[_0x3b90('0x22')](_0x3b90('0x2f'),_0x381a9e,_0x1efe01,_0xd83280);}});}})[_0x3b90('0x30')](function(_0x562882){logger['error'](_0x3b90('0x23'),_0x381a9e,_0x1af265[_0x3b90('0x7')][_0xd83280][_0x3b90('0x26')],_0x1efe01,_0xd83280);})[_0x3b90('0x31')](function(){delete _0x1af265['channels'][_0x381a9e];});}catch(_0x5a97fe){logger[_0x3b90('0x2d')](_0x3b90('0x32'),_0x5a97fe['message']);}};Acw['prototype'][_0x3b90('0x25')]=function(_0x146bc7){try{var _0x20416d=this;if(_0x20416d[_0x3b90('0x9')][_0x146bc7]){_0x20416d['timers'][_0x146bc7][_0x3b90('0x24')]=![];var _0x583842=_0x20416d[_0x3b90('0x9')][_0x146bc7][_0x3b90('0x29')];var _0x2355bf=_0x20416d[_0x3b90('0x9')][_0x146bc7][_0x3b90('0x2a')];var _0x3bf148=_0x20416d[_0x3b90('0x7')][_0x2355bf]['acwTimeout'];logger[_0x3b90('0x22')](_0x3b90('0x33'),_0x146bc7);RpcUser[_0x3b90('0x34')](this[_0x3b90('0x8')][_0x146bc7]);RpcVoiceAgentReport[_0x3b90('0x35')]({'acwtime':_0x3bf148,'agentacw':!![]},_0x583842,_0x146bc7)[_0x3b90('0x1b')](function(_0x63c44e){logger[_0x3b90('0x22')](_0x3b90('0x2c'),_0x583842,_0x3bf148,_0x63c44e);})['catch'](function(_0x369d0d){logger[_0x3b90('0x2d')](_0x3b90('0x2e'),_0x583842,_0x369d0d);});}else{logger[_0x3b90('0x2d')](_0x3b90('0x36'),_0x146bc7);if(_0x20416d[_0x3b90('0x9')]){logger[_0x3b90('0x22')](_0x3b90('0x37'),JSON[_0x3b90('0x38')](_0x20416d[_0x3b90('0x9')]));}}}catch(_0x47592a){logger[_0x3b90('0x2d')](_0x3b90('0x39'),_0x47592a[_0x3b90('0x3a')]);}};Acw[_0x3b90('0x13')][_0x3b90('0xb')]=function(_0x3a27cf){try{if(this[_0x3b90('0x7')][_0x3a27cf[_0x3b90('0x2a')]]&&(this[_0x3b90('0x7')][_0x3a27cf[_0x3b90('0x2a')]]['acw']||this[_0x3b90('0x7')][_0x3a27cf[_0x3b90('0x2a')]][_0x3b90('0x16')])){if(this[_0x3b90('0x8')][_0x3a27cf['interface']]){this[_0x3b90('0x15')][_0x3a27cf['uniqueid']]={'queue':_0x3a27cf['queue'],'interface':_0x3a27cf[_0x3b90('0x3b')],'destlinkedid':_0x3a27cf[_0x3b90('0x20')]};}}}catch(_0x49187d){logger[_0x3b90('0x2d')](_0x3b90('0x3c'),_0x49187d[_0x3b90('0x3a')]);}};Acw[_0x3b90('0x13')][_0x3b90('0x3d')]=function(_0x3fd5a1){try{if(this[_0x3b90('0x7')][_0x3fd5a1[_0x3b90('0x2a')]]&&(this[_0x3b90('0x7')][_0x3fd5a1['queue']][_0x3b90('0x4')]||this[_0x3b90('0x7')][_0x3fd5a1['queue']][_0x3b90('0x16')])){if(this[_0x3b90('0x8')][_0x3fd5a1[_0x3b90('0x3b')]]){this[_0x3b90('0x15')][_0x3fd5a1[_0x3b90('0x29')]]={'queue':_0x3fd5a1['queue'],'interface':_0x3fd5a1['interface']};}}}catch(_0x4034a3){logger['error'](_0x3b90('0x3e'),_0x4034a3[_0x3b90('0x3a')]);}};Acw[_0x3b90('0x13')][_0x3b90('0x3f')]=function(_0x177234){try{if(this['channels'][_0x177234['uniqueid']]&&_[_0x3b90('0x40')](this[_0x3b90('0x15')][_0x177234[_0x3b90('0x29')]]['attended'])){logger[_0x3b90('0x22')](_0x3b90('0x41'),_0x177234[_0x3b90('0x29')]);this[_0x3b90('0x14')](_0x177234[_0x3b90('0x29')]);}else if(this[_0x3b90('0x15')][_0x177234[_0x3b90('0x42')]]&&_[_0x3b90('0x40')](this[_0x3b90('0x15')][_0x177234['linkedid']][_0x3b90('0x1f')])){logger[_0x3b90('0x22')](_0x3b90('0x43'),_0x177234['linkedid']);this[_0x3b90('0x14')](_0x177234['linkedid']);}}catch(_0x288fbb){logger[_0x3b90('0x2d')](_0x3b90('0x44'),_0x288fbb['message']);}};Acw[_0x3b90('0x13')][_0x3b90('0x45')]=function(_0x5334b5){try{if(this['channels'][_0x5334b5[_0x3b90('0x29')]]&&this[_0x3b90('0x15')][_0x5334b5[_0x3b90('0x29')]][_0x3b90('0x1f')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x5334b5[_0x3b90('0x29')]);this[_0x3b90('0x14')](_0x5334b5[_0x3b90('0x29')]);}else if(this[_0x3b90('0x15')][_0x5334b5[_0x3b90('0x42')]]&&this[_0x3b90('0x15')][_0x5334b5[_0x3b90('0x42')]][_0x3b90('0x1f')]){logger[_0x3b90('0x22')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x5334b5[_0x3b90('0x42')]);this[_0x3b90('0x14')](_0x5334b5['linkedid']);}}catch(_0x1d211a){logger[_0x3b90('0x2d')]('[ACW][syncHangup]\x20%s',_0x1d211a[_0x3b90('0x3a')]);}};Acw[_0x3b90('0x13')][_0x3b90('0xf')]=function(_0x1bada9){try{if(!_[_0x3b90('0x46')](this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x47')]])){this['startAcw'](_0x1bada9[_0x3b90('0x47')]);if(this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x48')]]){this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x48')]][_0x3b90('0x1f')]=!![];this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x49')]]=this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x48')]];delete this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x48')]];}}else if(!_[_0x3b90('0x46')](this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x49')]])){this['startAcw'](_0x1bada9[_0x3b90('0x49')]);if(this['channels'][_0x1bada9[_0x3b90('0x4a')]]){this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x4a')]][_0x3b90('0x1f')]=!![];this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x47')]]=this['channels'][_0x1bada9[_0x3b90('0x4a')]];delete this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x4a')]];}}}catch(_0x8e1229){logger[_0x3b90('0x2d')](_0x3b90('0x4b'),_0x8e1229['message']);}};Acw[_0x3b90('0x13')][_0x3b90('0x10')]=function(_0xb41920){try{if(this['channels'][_0xb41920[_0x3b90('0x4c')]]){logger[_0x3b90('0x22')](_0x3b90('0x4d'),JSON[_0x3b90('0x38')](_0xb41920[_0x3b90('0x4c')]));this[_0x3b90('0x14')](_0xb41920[_0x3b90('0x4c')]);}else if(this[_0x3b90('0x15')][_0xb41920[_0x3b90('0x4e')]]){logger['info'](_0x3b90('0x4f'),JSON['stringify'](_0xb41920['transfererlinkedid']));this[_0x3b90('0x14')](_0xb41920[_0x3b90('0x4e')]);}}catch(_0x52c099){logger[_0x3b90('0x2d')](_0x3b90('0x50'),_0x52c099[_0x3b90('0x3a')]);}};Acw[_0x3b90('0x13')][_0x3b90('0xe')]=function(_0x260de4){try{if(this[_0x3b90('0x7')][_0x260de4['queue']]&&this['voiceQueues'][_0x260de4[_0x3b90('0x2a')]]['autopause']===_0x3b90('0x51')){if(this['agents'][_0x260de4[_0x3b90('0x3b')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x260de4['uniqueid'],_0x260de4[_0x3b90('0x3b')],_0x260de4[_0x3b90('0x2a')]);return RpcUser[_0x3b90('0x21')](this[_0x3b90('0x8')][_0x260de4[_0x3b90('0x3b')]],_0x3b90('0x52'),_0x260de4[_0x3b90('0x29')]);}}}catch(_0x490fd1){logger['error']('[ACW][syncAgentRingNoAnswer]\x20%s',_0x490fd1[_0x3b90('0x3a')]);}};module[_0x3b90('0x53')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 2715844..8f7fd3f 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 _0x70c7=['moment','util','../../config/logger','ami','../../config/environment','asterisk','username','password','promisify','error','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','actionSipPeerStatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','port','once','connect','shutdown','info','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','log','close','asterisk-manager','bluebird'];(function(_0x519fa1,_0x5e439d){var _0x4393c5=function(_0x3b219b){while(--_0x3b219b){_0x519fa1['push'](_0x519fa1['shift']());}};_0x4393c5(++_0x5e439d);}(_0x70c7,0x1ab));var _0x770c=function(_0x2273e0,_0x568a61){_0x2273e0=_0x2273e0-0x0;var _0x456e57=_0x70c7[_0x2273e0];return _0x456e57;};'use strict';var Manager=require(_0x770c('0x0'));var BPromise=require(_0x770c('0x1'));var moment=require(_0x770c('0x2'));var util=require(_0x770c('0x3'));var _=require('lodash');var logger=require(_0x770c('0x4'))(_0x770c('0x5'));var config=require(_0x770c('0x6'));var ami=new Manager(config[_0x770c('0x7')]['port'],config[_0x770c('0x7')]['ip'],config['asterisk'][_0x770c('0x8')],config[_0x770c('0x7')][_0x770c('0x9')],!![]);ami['keepConnected']();ami['Action']=BPromise[_0x770c('0xa')](ami['action']);function error(_0x50eb20){logger[_0x770c('0xb')](util[_0x770c('0xc')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x770c('0x7')]['username'],config[_0x770c('0x7')]['ip'],config[_0x770c('0x7')]['port'],util['inspect'](_0x50eb20,![],null)));}function close(){logger[_0x770c('0xb')](util[_0x770c('0xc')](_0x770c('0xd'),config['asterisk']['username'],config[_0x770c('0x7')]['ip'],config['asterisk']['port']));}ami[_0x770c('0xe')]=function(){return function(){return ami[_0x770c('0xf')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x770c('0xf')]({'action':'devicestatelist'});};};ami[_0x770c('0x10')]=function(){return function(){return ami[_0x770c('0xf')]({'action':'sippeerstatus'});};};ami[_0x770c('0x11')]=function(){return function(){return ami[_0x770c('0xf')]({'action':'queuesummary'});};};ami[_0x770c('0x12')]=function(){return function(){return ami['Action']({'action':_0x770c('0x13')});};};function connect(_0x2f42bf){logger['info'](util[_0x770c('0xc')](_0x770c('0x14'),config[_0x770c('0x7')][_0x770c('0x8')],config['asterisk']['ip'],config['asterisk'][_0x770c('0x15')]));ami[_0x770c('0x16')]('error',error);ami[_0x770c('0x16')]('close',close);}ami['on'](_0x770c('0x17'),connect);ami['on'](_0x770c('0x18'),function(_0x3f65e6){logger[_0x770c('0x19')](util[_0x770c('0xc')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x770c('0x7')][_0x770c('0x8')],config[_0x770c('0x7')]['ip'],config[_0x770c('0x7')][_0x770c('0x15')],util[_0x770c('0x1a')](_0x3f65e6,![],null)));});ami['on'](_0x770c('0x1b'),function(_0x56b18f){logger[_0x770c('0x19')](util['format'](_0x770c('0x1c'),config[_0x770c('0x7')][_0x770c('0x8')],config[_0x770c('0x7')]['ip'],config['asterisk'][_0x770c('0x15')]));return BPromise[_0x770c('0x1d')]()[_0x770c('0x1e')](ami['actionSipShowRegistry']())[_0x770c('0x1e')](ami['actionDeviceStateList']())[_0x770c('0x1e')](ami[_0x770c('0x10')]())[_0x770c('0x1e')](ami[_0x770c('0x11')]())[_0x770c('0x1e')](ami[_0x770c('0x12')]())['catch'](function(_0x2c28b8){console[_0x770c('0x1f')](_0x2c28b8);});});ami[_0x770c('0x16')]('error',error);ami[_0x770c('0x16')](_0x770c('0x20'),close);module['exports']=ami; \ No newline at end of file +var _0xd806=['ami','../../config/environment','asterisk','password','keepConnected','Action','error','format','username','port','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','shutdown','inspect','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','log','close','exports','util','lodash','../../config/logger'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd806,0xf9));var _0x6d80=function(_0x48ebe8,_0x300832){_0x48ebe8=_0x48ebe8-0x0;var _0x5c65fb=_0xd806[_0x48ebe8];return _0x5c65fb;};'use strict';var Manager=require('asterisk-manager');var BPromise=require('bluebird');var moment=require('moment');var util=require(_0x6d80('0x0'));var _=require(_0x6d80('0x1'));var logger=require(_0x6d80('0x2'))(_0x6d80('0x3'));var config=require(_0x6d80('0x4'));var ami=new Manager(config[_0x6d80('0x5')]['port'],config[_0x6d80('0x5')]['ip'],config[_0x6d80('0x5')]['username'],config['asterisk'][_0x6d80('0x6')],!![]);ami[_0x6d80('0x7')]();ami[_0x6d80('0x8')]=BPromise['promisify'](ami['action']);function error(_0x171941){logger[_0x6d80('0x9')](util[_0x6d80('0xa')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x6d80('0x5')][_0x6d80('0xb')],config[_0x6d80('0x5')]['ip'],config[_0x6d80('0x5')][_0x6d80('0xc')],util['inspect'](_0x171941,![],null)));}function close(){logger[_0x6d80('0x9')](util[_0x6d80('0xa')](_0x6d80('0xd'),config[_0x6d80('0x5')]['username'],config[_0x6d80('0x5')]['ip'],config['asterisk'][_0x6d80('0xc')]));}ami[_0x6d80('0xe')]=function(){return function(){return ami['Action']({'action':_0x6d80('0xf')});};};ami[_0x6d80('0x10')]=function(){return function(){return ami[_0x6d80('0x8')]({'action':_0x6d80('0x11')});};};ami[_0x6d80('0x12')]=function(){return function(){return ami[_0x6d80('0x8')]({'action':'sippeerstatus'});};};ami[_0x6d80('0x13')]=function(){return function(){return ami[_0x6d80('0x8')]({'action':_0x6d80('0x14')});};};ami[_0x6d80('0x15')]=function(){return function(){return ami['Action']({'action':_0x6d80('0x16')});};};function connect(_0x10eea4){logger[_0x6d80('0x17')](util[_0x6d80('0xa')](_0x6d80('0x18'),config['asterisk'][_0x6d80('0xb')],config[_0x6d80('0x5')]['ip'],config[_0x6d80('0x5')][_0x6d80('0xc')]));ami[_0x6d80('0x19')](_0x6d80('0x9'),error);ami['once']('close',close);}ami['on'](_0x6d80('0x1a'),connect);ami['on'](_0x6d80('0x1b'),function(_0x55b1e3){logger[_0x6d80('0x17')](util[_0x6d80('0xa')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0x6d80('0xb')],config[_0x6d80('0x5')]['ip'],config['asterisk']['port'],util[_0x6d80('0x1c')](_0x55b1e3,![],null)));});ami['on']('fullybooted',function(_0x12f84e){logger['info'](util[_0x6d80('0xa')](_0x6d80('0x1d'),config[_0x6d80('0x5')]['username'],config[_0x6d80('0x5')]['ip'],config['asterisk'][_0x6d80('0xc')]));return BPromise[_0x6d80('0x1e')]()[_0x6d80('0x1f')](ami[_0x6d80('0xe')]())['then'](ami[_0x6d80('0x10')]())[_0x6d80('0x1f')](ami['actionSipPeerStatus']())[_0x6d80('0x1f')](ami[_0x6d80('0x13')]())['then'](ami[_0x6d80('0x15')]())[_0x6d80('0x20')](function(_0x6530b2){console[_0x6d80('0x21')](_0x6530b2);});});ami['once'](_0x6d80('0x9'),error);ami[_0x6d80('0x19')](_0x6d80('0x22'),close);module[_0x6d80('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 73329bc..36d6128 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 _0x7549=['request','then','rpc','memberReport','error','message','exports','bluebird','../../config/logger','ami','client','http','Request'];(function(_0x19a72c,_0x2229cb){var _0x3c6199=function(_0x4293e9){while(--_0x4293e9){_0x19a72c['push'](_0x19a72c['shift']());}};_0x3c6199(++_0x2229cb);}(_0x7549,0xd7));var _0x9754=function(_0x351808,_0x2bba1a){_0x351808=_0x351808-0x0;var _0x1c7a06=_0x7549[_0x351808];return _0x1c7a06;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x9754('0x0'));var logger=require(_0x9754('0x1'))(_0x9754('0x2'));var client=jayson[_0x9754('0x3')][_0x9754('0x4')]({'port':0x2329});client[_0x9754('0x5')]=function(_0xb1e66,_0xf5b290){return new BPromise(function(_0x4160e6,_0x59526f){return client[_0x9754('0x6')](_0xb1e66,_0xf5b290)[_0x9754('0x7')](function(_0x5f4f10){logger['debug'](_0x9754('0x8'),_0x9754('0x9'),_0xb1e66,_0xf5b290,_0x5f4f10);if(_0x5f4f10['error']){logger['error'](_0x9754('0x8'),_0x9754('0x9'),_0xb1e66,_0x5f4f10[_0x9754('0xa')][_0x9754('0xb')],_0xf5b290);return _0x59526f(_0x5f4f10[_0x9754('0xa')][_0x9754('0xb')]);}else{return _0x4160e6(_0x5f4f10['result']);}})['catch'](function(_0x46a64b){logger['error'](_0x9754('0x8'),'memberReport',_0xb1e66,_0x46a64b,_0xf5b290);return _0x59526f(_0x46a64b);});});};module[_0x9754('0xc')]=client; \ No newline at end of file +var _0x5cea=['../../config/logger','ami','client','http','Request','request','then','debug','rpc','memberReport','error','message','result','exports','jayson/promise','bluebird'];(function(_0x463998,_0x48d0d9){var _0x2f64cb=function(_0xc29a00){while(--_0xc29a00){_0x463998['push'](_0x463998['shift']());}};_0x2f64cb(++_0x48d0d9);}(_0x5cea,0x16e));var _0xa5ce=function(_0x5a69c8,_0x64d3b){_0x5a69c8=_0x5a69c8-0x0;var _0x17f7e0=_0x5cea[_0x5a69c8];return _0x17f7e0;};'use strict';var jayson=require(_0xa5ce('0x0'));var BPromise=require(_0xa5ce('0x1'));var logger=require(_0xa5ce('0x2'))(_0xa5ce('0x3'));var client=jayson[_0xa5ce('0x4')][_0xa5ce('0x5')]({'port':0x2329});client[_0xa5ce('0x6')]=function(_0x501f03,_0x11ecf8){return new BPromise(function(_0x2d7f46,_0x1c0316){return client[_0xa5ce('0x7')](_0x501f03,_0x11ecf8)[_0xa5ce('0x8')](function(_0x4d8f67){logger[_0xa5ce('0x9')](_0xa5ce('0xa'),_0xa5ce('0xb'),_0x501f03,_0x11ecf8,_0x4d8f67);if(_0x4d8f67[_0xa5ce('0xc')]){logger['error'](_0xa5ce('0xa'),'memberReport',_0x501f03,_0x4d8f67['error'][_0xa5ce('0xd')],_0x11ecf8);return _0x1c0316(_0x4d8f67[_0xa5ce('0xc')][_0xa5ce('0xd')]);}else{return _0x2d7f46(_0x4d8f67[_0xa5ce('0xe')]);}})['catch'](function(_0x16f338){logger[_0xa5ce('0xc')](_0xa5ce('0xa'),_0xa5ce('0xb'),_0x501f03,_0x16f338,_0x11ecf8);return _0x1c0316(_0x16f338);});});};module[_0xa5ce('0xf')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 832dc51..5cba579 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 _0x9a6a=['lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','exports','lodash','isNil','string','voiceQueue','uniqueid','name','phone','Contact','firstName'];(function(_0x1ce2bb,_0xf151b){var _0x40dc49=function(_0x143c46){while(--_0x143c46){_0x1ce2bb['push'](_0x1ce2bb['shift']());}};_0x40dc49(++_0xf151b);}(_0x9a6a,0xce));var _0xa9a6=function(_0x577935,_0x56535d){_0x577935=_0x577935-0x0;var _0x455214=_0x9a6a[_0x577935];return _0x455214;};'use strict';var util=require('util');var _=require(_0xa9a6('0x0'));var moment=require('moment');function checkNameSurname(_0x2835b7,_0xa4a3ca,_0x4d1134){var _0x2fb58b='';if(!_[_0xa9a6('0x1')](_0xa4a3ca)&&_0xa9a6('0x2')===typeof _0xa4a3ca){_0x2fb58b+=_0xa4a3ca;}if(!_[_0xa9a6('0x1')](_0x4d1134)&&_0xa9a6('0x2')===typeof _0x4d1134){_0x2fb58b+='\x20'+_0x4d1134;}if(_0x2fb58b!==''){return _0x2fb58b;}return _0x2835b7;}function Action(_0x560bce,_0x58a70c,_0x4678ed){this[_0xa9a6('0x3')]=_0x560bce;this[_0xa9a6('0x4')]=_0x4678ed||undefined;this[_0xa9a6('0x5')]=checkNameSurname(_0x58a70c['Contact'][_0xa9a6('0x6')],_0x58a70c[_0xa9a6('0x7')][_0xa9a6('0x8')],_0x58a70c[_0xa9a6('0x7')][_0xa9a6('0x9')]);this[_0xa9a6('0xa')]=_0x58a70c[_0xa9a6('0x7')][_0xa9a6('0x6')];this[_0xa9a6('0xb')]=_0x560bce[_0xa9a6('0x5')];this[_0xa9a6('0xc')]=_0x58a70c[_0xa9a6('0xc')]||![];this[_0xa9a6('0xd')]=_0x560bce[_0xa9a6('0xd')];this[_0xa9a6('0xe')]=_0x560bce[_0xa9a6('0xe')]||0x3;this[_0xa9a6('0xf')]=_0x58a70c[_0xa9a6('0xf')];this['countbusyretry']=_0x58a70c[_0xa9a6('0x10')];this[_0xa9a6('0x11')]=_0x58a70c[_0xa9a6('0x11')];this[_0xa9a6('0x12')]=_0x58a70c['countnoanswerretry'];this['countnosuchnumberretry']=_0x58a70c[_0xa9a6('0x13')];this['countdropretry']=_0x58a70c[_0xa9a6('0x14')];this[_0xa9a6('0x15')]=_0x58a70c[_0xa9a6('0x15')];this[_0xa9a6('0x16')]=_0x58a70c[_0xa9a6('0x16')];this[_0xa9a6('0x17')]=_0x58a70c[_0xa9a6('0x17')];this[_0xa9a6('0x18')]=_0x58a70c[_0xa9a6('0x18')];this[_0xa9a6('0x19')]=_0x58a70c[_0xa9a6('0x19')];this[_0xa9a6('0x1a')]=_0x58a70c[_0xa9a6('0x1a')];this[_0xa9a6('0x1b')]=_0x58a70c[_0xa9a6('0x1b')];this['CampaignId']=_0x58a70c['CampaignId'];this[_0xa9a6('0x1c')]=_0x58a70c['id'];this[_0xa9a6('0x1d')]=_0x58a70c[_0xa9a6('0x7')][_0xa9a6('0x8')]||'';this['starttime']=moment()[_0xa9a6('0x1e')](_0xa9a6('0x1f'));this[_0xa9a6('0x20')]=_0x58a70c[_0xa9a6('0x20')];this[_0xa9a6('0x21')]=_0x58a70c[_0xa9a6('0x21')];this['callbackat']=_0x58a70c['callbackat'];this[_0xa9a6('0x22')]=_0x58a70c['recallme'];this[_0xa9a6('0x23')]='';this[_0xa9a6('0x24')]='';}Action[_0xa9a6('0x25')][_0xa9a6('0x26')]=function(){return util[_0xa9a6('0x1e')](_0xa9a6('0x27'),this[_0xa9a6('0x5')],this[_0xa9a6('0x3')][_0xa9a6('0x28')]>0x0?this[_0xa9a6('0xa')][_0xa9a6('0x29')](this[_0xa9a6('0x3')]['dialCutDigit']):this['number']);};Action['prototype']['getQueue']=function(){return this[_0xa9a6('0xb')];};module[_0xa9a6('0x2a')]=Action; \ No newline at end of file +var _0xf7b4=['getQueue','exports','util','isNil','string','voiceQueue','uniqueid','name','Contact','phone','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','CampaignId','idHopper','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','dialCutDigit','number','substring'];(function(_0x487873,_0x56c325){var _0x4f9b85=function(_0x34d619){while(--_0x34d619){_0x487873['push'](_0x487873['shift']());}};_0x4f9b85(++_0x56c325);}(_0xf7b4,0x152));var _0x4f7b=function(_0x5efe63,_0x1a6f74){_0x5efe63=_0x5efe63-0x0;var _0x3397b3=_0xf7b4[_0x5efe63];return _0x3397b3;};'use strict';var util=require(_0x4f7b('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x5ccf30,_0x103165,_0x50ea23){var _0x58d106='';if(!_[_0x4f7b('0x1')](_0x103165)&&_0x4f7b('0x2')===typeof _0x103165){_0x58d106+=_0x103165;}if(!_[_0x4f7b('0x1')](_0x50ea23)&&_0x4f7b('0x2')===typeof _0x50ea23){_0x58d106+='\x20'+_0x50ea23;}if(_0x58d106!==''){return _0x58d106;}return _0x5ccf30;}function Action(_0xc39829,_0x2637f0,_0x427f8b){this[_0x4f7b('0x3')]=_0xc39829;this[_0x4f7b('0x4')]=_0x427f8b||undefined;this[_0x4f7b('0x5')]=checkNameSurname(_0x2637f0[_0x4f7b('0x6')][_0x4f7b('0x7')],_0x2637f0[_0x4f7b('0x6')]['firstName'],_0x2637f0[_0x4f7b('0x6')][_0x4f7b('0x8')]);this['number']=_0x2637f0[_0x4f7b('0x6')][_0x4f7b('0x7')];this[_0x4f7b('0x9')]=_0xc39829[_0x4f7b('0x5')];this[_0x4f7b('0xa')]=_0x2637f0['active']||![];this[_0x4f7b('0xb')]=_0xc39829['type'];this['dialQueueTimeout']=_0xc39829[_0x4f7b('0xc')]||0x3;this[_0x4f7b('0xd')]=_0x2637f0[_0x4f7b('0xd')];this[_0x4f7b('0xe')]=_0x2637f0['countbusyretry'];this[_0x4f7b('0xf')]=_0x2637f0[_0x4f7b('0xf')];this[_0x4f7b('0x10')]=_0x2637f0[_0x4f7b('0x10')];this[_0x4f7b('0x11')]=_0x2637f0[_0x4f7b('0x11')];this[_0x4f7b('0x12')]=_0x2637f0[_0x4f7b('0x12')];this[_0x4f7b('0x13')]=_0x2637f0[_0x4f7b('0x13')];this[_0x4f7b('0x14')]=_0x2637f0[_0x4f7b('0x14')];this['countagentrejectretry']=_0x2637f0[_0x4f7b('0x15')];this['ContactId']=_0x2637f0['ContactId'];this[_0x4f7b('0x16')]=_0x2637f0[_0x4f7b('0x16')];this['UserId']=_0x2637f0[_0x4f7b('0x17')];this[_0x4f7b('0x18')]=_0x2637f0[_0x4f7b('0x18')];this[_0x4f7b('0x19')]=_0x2637f0['CampaignId'];this[_0x4f7b('0x1a')]=_0x2637f0['id'];this['ContactFirstName']=_0x2637f0[_0x4f7b('0x6')][_0x4f7b('0x1b')]||'';this[_0x4f7b('0x1c')]=moment()[_0x4f7b('0x1d')](_0x4f7b('0x1e'));this[_0x4f7b('0x1f')]=_0x2637f0[_0x4f7b('0x1f')];this[_0x4f7b('0x20')]=_0x2637f0[_0x4f7b('0x20')];this['callbackat']=_0x2637f0[_0x4f7b('0x21')];this[_0x4f7b('0x22')]=_0x2637f0[_0x4f7b('0x22')];this['originatecalleridnum']='';this[_0x4f7b('0x23')]='';}Action[_0x4f7b('0x24')]['getCaller']=function(){return util[_0x4f7b('0x1d')]('\x22%s\x22\x20<%s>',this[_0x4f7b('0x5')],this[_0x4f7b('0x3')][_0x4f7b('0x25')]>0x0?this[_0x4f7b('0x26')][_0x4f7b('0x27')](this[_0x4f7b('0x3')][_0x4f7b('0x25')]):this[_0x4f7b('0x26')]);};Action['prototype'][_0x4f7b('0x28')]=function(){return this[_0x4f7b('0x9')];};module[_0x4f7b('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 0748800..e9bc39b 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 _0x923a=['countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','diff','seconds','statedesc','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry'];(function(_0x55d420,_0x103084){var _0x26699e=function(_0x13666b){while(--_0x13666b){_0x55d420['push'](_0x55d420['shift']());}};_0x26699e(++_0x103084);}(_0x923a,0xbc));var _0xa923=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x923a[_0x21a9d9];return _0x46adce;};'use strict';var util=require('util');var _=require(_0xa923('0x0'));var moment=require(_0xa923('0x1'));function getSeconds(_0x2fff58,_0x2427ef){var _0x34b69b=moment(_0x2fff58)[_0xa923('0x2')](0x0);var _0x2dbac4=moment(_0x2427ef)[_0xa923('0x2')](0x0);return _0x34b69b[_0xa923('0x3')](_0x2dbac4,_0xa923('0x4'));}function AgentComplete(_0x916cd,_0x4903e2){this['state']=0x4;this[_0xa923('0x5')]='Answer';this[_0xa923('0x6')]=_0x916cd['scheduledat'];this[_0xa923('0x7')]=_0x916cd[_0xa923('0x7')];this[_0xa923('0x8')]=_0x916cd[_0xa923('0x7')]===_0xa923('0x9')?'queue':_0x916cd[_0xa923('0x7')];this[_0xa923('0xa')]=_0x916cd[_0xa923('0xa')];this[_0xa923('0xb')]=_0x916cd['countcongestionretry'];this['countnoanswerretry']=_0x916cd[_0xa923('0xc')];this[_0xa923('0xd')]=_0x916cd['countbusyretry']+_0x916cd[_0xa923('0xb')]+_0x916cd['countnoanswerretry']+_0x916cd['countnosuchnumberretry']+_0x916cd[_0xa923('0xe')]+_0x916cd[_0xa923('0xf')]+_0x916cd[_0xa923('0x10')]+_0x916cd[_0xa923('0x11')];this[_0xa923('0x12')]=_0x916cd[_0xa923('0x12')];this['countdropretry']=_0x916cd[_0xa923('0xe')];this[_0xa923('0xf')]=_0x916cd[_0xa923('0xf')];this[_0xa923('0x10')]=_0x916cd[_0xa923('0x10')];this['countagentrejectretry']=_0x916cd['countagentrejectretry'];this['uniqueid']=_0x4903e2[_0xa923('0x13')];this[_0xa923('0x14')]=_0x916cd[_0xa923('0x15')];this[_0xa923('0x16')]=_0x916cd[_0xa923('0x17')];this['starttime']=_0x916cd[_0xa923('0x18')];this['responsetime']=_0x916cd[_0xa923('0x19')];this['answertime']=_0x916cd[_0xa923('0x1a')];this[_0xa923('0x1b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x916cd['responsetime'],_0x916cd[_0xa923('0x18')]);this[_0xa923('0x1c')]=getSeconds(_0x916cd[_0xa923('0x1a')],_0x916cd[_0xa923('0x19')]);this[_0xa923('0x1d')]=getSeconds(this['endtime'],_0x916cd[_0xa923('0x1a')]);this['queue']=_0x4903e2['queue'];this[_0xa923('0x1e')]=_0x4903e2['membername'];this['reason']=_0x4903e2[_0xa923('0x1f')];this[_0xa923('0x20')]=_0x916cd[_0xa923('0x20')];this['callbackuniqueid']=_0x916cd[_0xa923('0x21')];this['callbackat']=_0x916cd['callbackat'];this[_0xa923('0x22')]=_0x916cd['recallme'];this[_0xa923('0x23')]=_0x916cd[_0xa923('0x23')];this['ListId']=_0x916cd['ListId'];this[_0xa923('0x24')]=_0x916cd['UserId'];this[_0xa923('0x25')]=_0x916cd[_0xa923('0x25')];this[_0xa923('0x26')]=_0x916cd[_0xa923('0x26')];this[_0xa923('0x27')]=_0x916cd[_0xa923('0x27')]||'';this[_0xa923('0x28')]=_0x916cd[_0xa923('0x28')]||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0xf8ae=['milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','moment'];(function(_0x16f7f2,_0x14adbb){var _0x325563=function(_0xda5d6c){while(--_0xda5d6c){_0x16f7f2['push'](_0x16f7f2['shift']());}};_0x325563(++_0x14adbb);}(_0xf8ae,0xab));var _0xef8a=function(_0x31aa84,_0x3bcc8b){_0x31aa84=_0x31aa84-0x0;var _0x2d9e3e=_0xf8ae[_0x31aa84];return _0x2d9e3e;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xef8a('0x0'));function getSeconds(_0x27cb69,_0x454d6e){var _0x2b0150=moment(_0x27cb69)[_0xef8a('0x1')](0x0);var _0x4b72ae=moment(_0x454d6e)[_0xef8a('0x1')](0x0);return _0x2b0150[_0xef8a('0x2')](_0x4b72ae,_0xef8a('0x3'));}function AgentComplete(_0x5e0f25,_0x27d036){this[_0xef8a('0x4')]=0x4;this['statedesc']=_0xef8a('0x5');this['scheduledat']=_0x5e0f25[_0xef8a('0x6')];this[_0xef8a('0x7')]=_0x5e0f25[_0xef8a('0x7')];this[_0xef8a('0x8')]=_0x5e0f25[_0xef8a('0x7')]===_0xef8a('0x9')?'queue':_0x5e0f25[_0xef8a('0x7')];this[_0xef8a('0xa')]=_0x5e0f25[_0xef8a('0xa')];this['countcongestionretry']=_0x5e0f25['countcongestionretry'];this[_0xef8a('0xb')]=_0x5e0f25['countnoanswerretry'];this[_0xef8a('0xc')]=_0x5e0f25[_0xef8a('0xa')]+_0x5e0f25[_0xef8a('0xd')]+_0x5e0f25[_0xef8a('0xb')]+_0x5e0f25['countnosuchnumberretry']+_0x5e0f25[_0xef8a('0xe')]+_0x5e0f25[_0xef8a('0xf')]+_0x5e0f25[_0xef8a('0x10')]+_0x5e0f25[_0xef8a('0x11')];this['countnosuchnumberretry']=_0x5e0f25['countnosuchnumberretry'];this[_0xef8a('0xe')]=_0x5e0f25[_0xef8a('0xe')];this[_0xef8a('0xf')]=_0x5e0f25[_0xef8a('0xf')];this[_0xef8a('0x10')]=_0x5e0f25[_0xef8a('0x10')];this[_0xef8a('0x11')]=_0x5e0f25[_0xef8a('0x11')];this[_0xef8a('0x12')]=_0x27d036['uniqueid'];this['calleridname']=_0x5e0f25[_0xef8a('0x13')];this[_0xef8a('0x14')]=_0x5e0f25['number'];this['starttime']=_0x5e0f25[_0xef8a('0x15')];this['responsetime']=_0x5e0f25[_0xef8a('0x16')];this[_0xef8a('0x17')]=_0x5e0f25['answertime'];this['endtime']=moment()[_0xef8a('0x18')](_0xef8a('0x19'));this[_0xef8a('0x1a')]=getSeconds(_0x5e0f25[_0xef8a('0x16')],_0x5e0f25[_0xef8a('0x15')]);this[_0xef8a('0x1b')]=getSeconds(_0x5e0f25[_0xef8a('0x17')],_0x5e0f25[_0xef8a('0x16')]);this[_0xef8a('0x1c')]=getSeconds(this['endtime'],_0x5e0f25[_0xef8a('0x17')]);this[_0xef8a('0x1d')]=_0x27d036[_0xef8a('0x1d')];this[_0xef8a('0x1e')]=_0x27d036[_0xef8a('0x1e')];this[_0xef8a('0x1f')]=_0x27d036[_0xef8a('0x1f')];this[_0xef8a('0x20')]=_0x5e0f25[_0xef8a('0x20')];this[_0xef8a('0x21')]=_0x5e0f25[_0xef8a('0x21')];this[_0xef8a('0x22')]=_0x5e0f25[_0xef8a('0x22')];this[_0xef8a('0x23')]=_0x5e0f25['recallme'];this[_0xef8a('0x24')]=_0x5e0f25[_0xef8a('0x24')];this['ListId']=_0x5e0f25[_0xef8a('0x25')];this[_0xef8a('0x26')]=_0x5e0f25[_0xef8a('0x26')];this[_0xef8a('0x27')]=_0x5e0f25[_0xef8a('0x27')];this[_0xef8a('0x28')]=_0x5e0f25[_0xef8a('0x28')];this[_0xef8a('0x29')]=_0x5e0f25[_0xef8a('0x29')]||'';this[_0xef8a('0x2a')]=_0x5e0f25[_0xef8a('0x2a')]||'';}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 079337a..60379cb 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 _0x858b=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x858b,0x1de));var _0xb858=function(_0x179b53,_0x31f6fe){_0x179b53=_0x179b53-0x0;var _0x38a146=_0x858b[_0x179b53];return _0x38a146;};'use strict';var util=require(_0xb858('0x0'));var _=require(_0xb858('0x1'));var moment=require(_0xb858('0x2'));function getSeconds(_0x3630e5,_0x30f798){var _0x156557=moment(_0x3630e5)[_0xb858('0x3')](0x0);var _0x356400=moment(_0x30f798)[_0xb858('0x3')](0x0);return _0x156557['diff'](_0x356400,_0xb858('0x4'));}function Final(_0x7a586a){this['uniqueid']=_0x7a586a[_0xb858('0x5')];this[_0xb858('0x6')]=_0x7a586a[_0xb858('0x6')];this[_0xb858('0x7')]=_0x7a586a[_0xb858('0x7')];this[_0xb858('0x8')]=_0x7a586a[_0xb858('0x7')]===_0xb858('0x9')?_0xb858('0xa'):_0x7a586a['type'];this[_0xb858('0xb')]=_0x7a586a[_0xb858('0xb')];this[_0xb858('0xc')]=_0x7a586a[_0xb858('0xc')];this[_0xb858('0xd')]=_0x7a586a[_0xb858('0xd')];this[_0xb858('0xe')]=_0x7a586a[_0xb858('0xb')]+_0x7a586a['countcongestionretry']+_0x7a586a[_0xb858('0xd')]+_0x7a586a[_0xb858('0xf')]+_0x7a586a[_0xb858('0x10')]+_0x7a586a[_0xb858('0x11')]+_0x7a586a[_0xb858('0x12')]+_0x7a586a[_0xb858('0x13')];this[_0xb858('0xf')]=_0x7a586a[_0xb858('0xf')];this['countdropretry']=_0x7a586a[_0xb858('0x10')];this[_0xb858('0x11')]=_0x7a586a[_0xb858('0x11')];this[_0xb858('0x12')]=_0x7a586a[_0xb858('0x12')];this[_0xb858('0x13')]=_0x7a586a[_0xb858('0x13')];this[_0xb858('0xa')]=_0x7a586a[_0xb858('0xa')];this[_0xb858('0x14')]=_0x7a586a['calleridname'];this[_0xb858('0x15')]=_0x7a586a[_0xb858('0x15')];this[_0xb858('0x16')]=_0x7a586a[_0xb858('0x16')];this[_0xb858('0x17')]=_0x7a586a[_0xb858('0x17')];this[_0xb858('0x18')]=_0x7a586a['responsetime'];this[_0xb858('0x19')]=_0x7a586a[_0xb858('0x19')]||0x0;this[_0xb858('0x1a')]=_0x7a586a[_0xb858('0x1a')]||0x0;this['talktime']=_0x7a586a['talktime']||0x0;this[_0xb858('0x1b')]=_0x7a586a[_0xb858('0x1b')];this['callbackuniqueid']=_0x7a586a[_0xb858('0x1c')];this[_0xb858('0x1d')]=_0x7a586a[_0xb858('0x1d')];this[_0xb858('0x1e')]=_0x7a586a[_0xb858('0x1e')];this[_0xb858('0x1f')]=_0x7a586a[_0xb858('0x1f')];this[_0xb858('0x20')]=_0x7a586a[_0xb858('0x20')];this['UserId']=_0x7a586a[_0xb858('0x21')];this[_0xb858('0x22')]=_0x7a586a[_0xb858('0x22')];this[_0xb858('0x23')]=_0x7a586a[_0xb858('0x23')];this[_0xb858('0x24')]=_0x7a586a[_0xb858('0x24')]||'';this['originatecalleridname']=_0x7a586a[_0xb858('0x25')]||'';}module[_0xb858('0x26')]=Final; \ No newline at end of file +var _0xc0b8=['exports','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xc0b8,0x76));var _0x8c0b=function(_0xf3fcf8,_0x311065){_0xf3fcf8=_0xf3fcf8-0x0;var _0x2820b6=_0xc0b8[_0xf3fcf8];return _0x2820b6;};'use strict';var util=require(_0x8c0b('0x0'));var _=require(_0x8c0b('0x1'));var moment=require(_0x8c0b('0x2'));function getSeconds(_0x5bf875,_0x2f36cb){var _0x43d44=moment(_0x5bf875)[_0x8c0b('0x3')](0x0);var _0x12c641=moment(_0x2f36cb)[_0x8c0b('0x3')](0x0);return _0x43d44['diff'](_0x12c641,_0x8c0b('0x4'));}function Final(_0x484bfd){this[_0x8c0b('0x5')]=_0x484bfd[_0x8c0b('0x5')];this[_0x8c0b('0x6')]=_0x484bfd[_0x8c0b('0x6')];this[_0x8c0b('0x7')]=_0x484bfd[_0x8c0b('0x7')];this[_0x8c0b('0x8')]=_0x484bfd[_0x8c0b('0x7')]===_0x8c0b('0x9')?_0x8c0b('0xa'):_0x484bfd[_0x8c0b('0x7')];this['countbusyretry']=_0x484bfd[_0x8c0b('0xb')];this[_0x8c0b('0xc')]=_0x484bfd['countcongestionretry'];this[_0x8c0b('0xd')]=_0x484bfd[_0x8c0b('0xd')];this[_0x8c0b('0xe')]=_0x484bfd[_0x8c0b('0xb')]+_0x484bfd[_0x8c0b('0xc')]+_0x484bfd[_0x8c0b('0xd')]+_0x484bfd[_0x8c0b('0xf')]+_0x484bfd[_0x8c0b('0x10')]+_0x484bfd[_0x8c0b('0x11')]+_0x484bfd[_0x8c0b('0x12')]+_0x484bfd[_0x8c0b('0x13')];this[_0x8c0b('0xf')]=_0x484bfd[_0x8c0b('0xf')];this['countdropretry']=_0x484bfd[_0x8c0b('0x10')];this[_0x8c0b('0x11')]=_0x484bfd['countabandonedretry'];this['countmachineretry']=_0x484bfd[_0x8c0b('0x12')];this[_0x8c0b('0x13')]=_0x484bfd[_0x8c0b('0x13')];this[_0x8c0b('0xa')]=_0x484bfd[_0x8c0b('0xa')];this[_0x8c0b('0x14')]=_0x484bfd[_0x8c0b('0x14')];this[_0x8c0b('0x15')]=_0x484bfd[_0x8c0b('0x15')];this[_0x8c0b('0x16')]=_0x484bfd[_0x8c0b('0x16')];this[_0x8c0b('0x17')]=_0x484bfd[_0x8c0b('0x17')];this['endtime']=_0x484bfd['responsetime'];this[_0x8c0b('0x18')]=_0x484bfd[_0x8c0b('0x18')]||0x0;this[_0x8c0b('0x19')]=_0x484bfd[_0x8c0b('0x19')]||0x0;this[_0x8c0b('0x1a')]=_0x484bfd['talktime']||0x0;this[_0x8c0b('0x1b')]=_0x484bfd['callback'];this[_0x8c0b('0x1c')]=_0x484bfd['callbackuniqueid'];this[_0x8c0b('0x1d')]=_0x484bfd[_0x8c0b('0x1d')];this[_0x8c0b('0x1e')]=_0x484bfd[_0x8c0b('0x1e')];this[_0x8c0b('0x1f')]=_0x484bfd[_0x8c0b('0x1f')];this[_0x8c0b('0x20')]=_0x484bfd[_0x8c0b('0x20')];this[_0x8c0b('0x21')]=_0x484bfd['UserId'];this[_0x8c0b('0x22')]=_0x484bfd[_0x8c0b('0x22')];this[_0x8c0b('0x23')]=_0x484bfd[_0x8c0b('0x23')];this[_0x8c0b('0x24')]=_0x484bfd[_0x8c0b('0x24')]||'';this[_0x8c0b('0x25')]=_0x484bfd['originatecalleridname']||'';}module[_0x8c0b('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 c6312a5..a4f1930 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 _0x0e0c=['diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds'];(function(_0x352c5f,_0xed7153){var _0x535af1=function(_0x14d5d5){while(--_0x14d5d5){_0x352c5f['push'](_0x352c5f['shift']());}};_0x535af1(++_0xed7153);}(_0x0e0c,0xb8));var _0xc0e0=function(_0x137f86,_0x3dc7f8){_0x137f86=_0x137f86-0x0;var _0x3b7758=_0x0e0c[_0x137f86];return _0x3b7758;};'use strict';var util=require(_0xc0e0('0x0'));var _=require(_0xc0e0('0x1'));var moment=require(_0xc0e0('0x2'));function getSeconds(_0x5fb2c2,_0x2bb9e3){var _0x3b2e4a=moment(_0x5fb2c2)[_0xc0e0('0x3')](0x0);var _0x378d31=moment(_0x2bb9e3)[_0xc0e0('0x3')](0x0);return _0x3b2e4a[_0xc0e0('0x4')](_0x378d31,_0xc0e0('0x5'));}function Hangup(_0x46e421,_0x3a8b67){this[_0xc0e0('0x6')]=0x4;this[_0xc0e0('0x7')]=_0xc0e0('0x8');this[_0xc0e0('0x9')]=_0x46e421[_0xc0e0('0x9')];this[_0xc0e0('0xa')]=_0x46e421[_0xc0e0('0xa')];this[_0xc0e0('0xb')]=_0x46e421[_0xc0e0('0xa')]===_0xc0e0('0xc')?_0xc0e0('0xd'):_0x46e421[_0xc0e0('0xa')];this[_0xc0e0('0xe')]=_0x46e421[_0xc0e0('0xe')];this[_0xc0e0('0xf')]=_0x46e421[_0xc0e0('0xf')];this[_0xc0e0('0x10')]=_0x46e421[_0xc0e0('0x10')];this[_0xc0e0('0x11')]=_0x46e421[_0xc0e0('0xe')]+_0x46e421[_0xc0e0('0xf')]+_0x46e421['countnoanswerretry']+_0x46e421[_0xc0e0('0x12')]+_0x46e421[_0xc0e0('0x13')]+_0x46e421['countabandonedretry']+_0x46e421['countmachineretry']+_0x46e421[_0xc0e0('0x14')];this[_0xc0e0('0x12')]=_0x46e421[_0xc0e0('0x12')];this[_0xc0e0('0x13')]=_0x46e421['countdropretry'];this[_0xc0e0('0x15')]=_0x46e421[_0xc0e0('0x15')];this[_0xc0e0('0x16')]=_0x46e421[_0xc0e0('0x16')];this[_0xc0e0('0x14')]=_0x46e421['countagentrejectretry'];this[_0xc0e0('0x17')]=_0x3a8b67[_0xc0e0('0x17')];this[_0xc0e0('0x18')]=_0x46e421['name'];this['calleridnum']=_0x46e421[_0xc0e0('0x19')];this['starttime']=_0x46e421[_0xc0e0('0x1a')];this[_0xc0e0('0x1b')]=_0x46e421[_0xc0e0('0x1b')];this[_0xc0e0('0x1c')]=moment()[_0xc0e0('0x1d')](_0xc0e0('0x1e'));this[_0xc0e0('0x1f')]=getSeconds(_0x46e421[_0xc0e0('0x1b')],_0x46e421[_0xc0e0('0x1a')]);this[_0xc0e0('0x20')]=0x0;this['talktime']=getSeconds(this[_0xc0e0('0x1c')],_0x46e421[_0xc0e0('0x1b')]);this[_0xc0e0('0xd')]=_0x46e421['queue'];this[_0xc0e0('0x21')]=_0xc0e0('0x22');this[_0xc0e0('0x23')]=_0x3a8b67[_0xc0e0('0x24')];this[_0xc0e0('0x25')]=_0x46e421[_0xc0e0('0x25')];this[_0xc0e0('0x26')]=_0x46e421[_0xc0e0('0x26')];this[_0xc0e0('0x27')]=_0x46e421[_0xc0e0('0x27')];this['recallme']=_0x46e421[_0xc0e0('0x28')];this[_0xc0e0('0x29')]=_0x46e421[_0xc0e0('0x29')];this[_0xc0e0('0x2a')]=_0x46e421[_0xc0e0('0x2a')];this[_0xc0e0('0x2b')]=_0x46e421[_0xc0e0('0x2b')];this[_0xc0e0('0x2c')]=_0x46e421['VoiceQueueId'];this[_0xc0e0('0x2d')]=_0x46e421['CampaignId'];}module[_0xc0e0('0x2e')]=Hangup; \ No newline at end of file +var _0x7d62=['number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','queue','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','util','lodash','moment','diff','seconds','state','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','calleridname','name','calleridnum'];(function(_0x5837b1,_0x54229a){var _0x490d8b=function(_0x3af82d){while(--_0x3af82d){_0x5837b1['push'](_0x5837b1['shift']());}};_0x490d8b(++_0x54229a);}(_0x7d62,0x1f2));var _0x27d6=function(_0x4fdf69,_0x9b161b){_0x4fdf69=_0x4fdf69-0x0;var _0x24a120=_0x7d62[_0x4fdf69];return _0x24a120;};'use strict';var util=require(_0x27d6('0x0'));var _=require(_0x27d6('0x1'));var moment=require(_0x27d6('0x2'));function getSeconds(_0x3abefd,_0x5b8b55){var _0x50f6f2=moment(_0x3abefd)['milliseconds'](0x0);var _0x757ec6=moment(_0x5b8b55)['milliseconds'](0x0);return _0x50f6f2[_0x27d6('0x3')](_0x757ec6,_0x27d6('0x4'));}function Hangup(_0x1d001a,_0xa3c557){this[_0x27d6('0x5')]=0x4;this['statedesc']=_0x27d6('0x6');this[_0x27d6('0x7')]=_0x1d001a[_0x27d6('0x7')];this[_0x27d6('0x8')]=_0x1d001a[_0x27d6('0x8')];this[_0x27d6('0x9')]=_0x1d001a[_0x27d6('0x8')]===_0x27d6('0xa')?'queue':_0x1d001a[_0x27d6('0x8')];this[_0x27d6('0xb')]=_0x1d001a[_0x27d6('0xb')];this[_0x27d6('0xc')]=_0x1d001a[_0x27d6('0xc')];this['countnoanswerretry']=_0x1d001a['countnoanswerretry'];this[_0x27d6('0xd')]=_0x1d001a[_0x27d6('0xb')]+_0x1d001a[_0x27d6('0xc')]+_0x1d001a['countnoanswerretry']+_0x1d001a[_0x27d6('0xe')]+_0x1d001a['countdropretry']+_0x1d001a[_0x27d6('0xf')]+_0x1d001a[_0x27d6('0x10')]+_0x1d001a['countagentrejectretry'];this[_0x27d6('0xe')]=_0x1d001a[_0x27d6('0xe')];this[_0x27d6('0x11')]=_0x1d001a[_0x27d6('0x11')];this[_0x27d6('0xf')]=_0x1d001a[_0x27d6('0xf')];this[_0x27d6('0x10')]=_0x1d001a[_0x27d6('0x10')];this[_0x27d6('0x12')]=_0x1d001a[_0x27d6('0x12')];this['uniqueid']=_0xa3c557['uniqueid'];this[_0x27d6('0x13')]=_0x1d001a[_0x27d6('0x14')];this[_0x27d6('0x15')]=_0x1d001a[_0x27d6('0x16')];this['starttime']=_0x1d001a[_0x27d6('0x17')];this[_0x27d6('0x18')]=_0x1d001a[_0x27d6('0x18')];this[_0x27d6('0x19')]=moment()[_0x27d6('0x1a')](_0x27d6('0x1b'));this['ringtime']=getSeconds(_0x1d001a[_0x27d6('0x18')],_0x1d001a[_0x27d6('0x17')]);this[_0x27d6('0x1c')]=0x0;this['talktime']=getSeconds(this['endtime'],_0x1d001a[_0x27d6('0x18')]);this['queue']=_0x1d001a[_0x27d6('0x1d')];this['membername']=_0x27d6('0x1e');this[_0x27d6('0x1f')]=_0xa3c557['cause-txt'];this[_0x27d6('0x20')]=_0x1d001a[_0x27d6('0x20')];this[_0x27d6('0x21')]=_0x1d001a[_0x27d6('0x21')];this[_0x27d6('0x22')]=_0x1d001a[_0x27d6('0x22')];this[_0x27d6('0x23')]=_0x1d001a[_0x27d6('0x23')];this['ContactId']=_0x1d001a[_0x27d6('0x24')];this['ListId']=_0x1d001a['ListId'];this['UserId']=_0x1d001a[_0x27d6('0x25')];this[_0x27d6('0x26')]=_0x1d001a[_0x27d6('0x26')];this[_0x27d6('0x27')]=_0x1d001a[_0x27d6('0x27')];}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 f0da7b7..dee6d77 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 _0x65b8=['ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','number','starttime','responsetime','endtime','ringtime','holdtime','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x65b8,0x1c1));var _0x865b=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x65b8[_0x3e5086];return _0xfeb102;};'use strict';var util=require(_0x865b('0x0'));var _=require(_0x865b('0x1'));var moment=require(_0x865b('0x2'));function getSeconds(_0x4606af,_0x5276e1){var _0x24cc5c=moment(_0x4606af)['milliseconds'](0x0);var _0x4aaabf=moment(_0x5276e1)[_0x865b('0x3')](0x0);return _0x24cc5c[_0x865b('0x4')](_0x4aaabf,_0x865b('0x5'));}function History(_0x116183){this['uniqueid']=_0x116183[_0x865b('0x6')];this[_0x865b('0x7')]=_0x116183[_0x865b('0x7')]||undefined;this[_0x865b('0x8')]=_0x116183[_0x865b('0x8')];this[_0x865b('0x9')]=_0x116183[_0x865b('0x8')]==='outbound'?_0x865b('0xa'):_0x116183[_0x865b('0x8')];this[_0x865b('0xb')]=_0x116183[_0x865b('0xb')];this[_0x865b('0xc')]=_0x116183['countcongestionretry'];this['countnoanswerretry']=_0x116183['countnoanswerretry'];this[_0x865b('0xd')]=_0x116183[_0x865b('0xb')]+_0x116183[_0x865b('0xc')]+_0x116183[_0x865b('0xe')]+_0x116183[_0x865b('0xf')]+_0x116183[_0x865b('0x10')]+_0x116183[_0x865b('0x11')]+_0x116183[_0x865b('0x12')]+_0x116183[_0x865b('0x13')];this[_0x865b('0xf')]=_0x116183['countnosuchnumberretry'];this[_0x865b('0x10')]=_0x116183[_0x865b('0x10')];this[_0x865b('0x11')]=_0x116183['countabandonedretry'];this[_0x865b('0x12')]=_0x116183[_0x865b('0x12')];this[_0x865b('0x13')]=_0x116183['countagentrejectretry'];this['queue']=_0x116183['queue'];this[_0x865b('0x14')]=_0x116183[_0x865b('0x15')];this['calleridnum']=_0x116183[_0x865b('0x16')];this[_0x865b('0x17')]=_0x116183['starttime'];this[_0x865b('0x18')]=_0x116183[_0x865b('0x18')];this[_0x865b('0x19')]=_0x116183[_0x865b('0x18')];this[_0x865b('0x1a')]=getSeconds(_0x116183[_0x865b('0x18')],_0x116183['starttime']);this[_0x865b('0x1b')]=0x0;this['talktime']=0x0;this['callback']=_0x116183['callback'];this[_0x865b('0x1c')]=_0x116183['callbackuniqueid'];this[_0x865b('0x1d')]=_0x116183[_0x865b('0x1d')];this[_0x865b('0x1e')]=_0x116183[_0x865b('0x1e')];this[_0x865b('0x1f')]=_0x116183['ContactId'];this[_0x865b('0x20')]=_0x116183[_0x865b('0x20')];this[_0x865b('0x21')]=_0x116183['UserId'];this[_0x865b('0x22')]=_0x116183['VoiceQueueId'];this['CampaignId']=_0x116183['CampaignId'];this[_0x865b('0x23')]=_0x116183[_0x865b('0x23')]||'';this[_0x865b('0x24')]=_0x116183[_0x865b('0x24')]||'';}module['exports']=History; \ No newline at end of file +var _0x0592=['ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','diff','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x25701b,_0x2a6976){var _0x3a8a2c=function(_0x1a5e78){while(--_0x1a5e78){_0x25701b['push'](_0x25701b['shift']());}};_0x3a8a2c(++_0x2a6976);}(_0x0592,0x137));var _0x2059=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0592[_0x19950b];return _0x3c6b41;};'use strict';var util=require('util');var _=require(_0x2059('0x0'));var moment=require('moment');function getSeconds(_0x644704,_0x2b1e4d){var _0x353aeb=moment(_0x644704)[_0x2059('0x1')](0x0);var _0x43faca=moment(_0x2b1e4d)['milliseconds'](0x0);return _0x353aeb[_0x2059('0x2')](_0x43faca,'seconds');}function History(_0x36b63b){this['uniqueid']=_0x36b63b['uniqueid'];this[_0x2059('0x3')]=_0x36b63b['scheduledat']||undefined;this[_0x2059('0x4')]=_0x36b63b[_0x2059('0x4')];this[_0x2059('0x5')]=_0x36b63b[_0x2059('0x4')]===_0x2059('0x6')?_0x2059('0x7'):_0x36b63b[_0x2059('0x4')];this[_0x2059('0x8')]=_0x36b63b[_0x2059('0x8')];this[_0x2059('0x9')]=_0x36b63b['countcongestionretry'];this[_0x2059('0xa')]=_0x36b63b[_0x2059('0xa')];this[_0x2059('0xb')]=_0x36b63b['countbusyretry']+_0x36b63b[_0x2059('0x9')]+_0x36b63b[_0x2059('0xa')]+_0x36b63b[_0x2059('0xc')]+_0x36b63b[_0x2059('0xd')]+_0x36b63b[_0x2059('0xe')]+_0x36b63b['countmachineretry']+_0x36b63b['countagentrejectretry'];this[_0x2059('0xc')]=_0x36b63b[_0x2059('0xc')];this['countdropretry']=_0x36b63b['countdropretry'];this[_0x2059('0xe')]=_0x36b63b['countabandonedretry'];this[_0x2059('0xf')]=_0x36b63b['countmachineretry'];this[_0x2059('0x10')]=_0x36b63b[_0x2059('0x10')];this[_0x2059('0x7')]=_0x36b63b[_0x2059('0x7')];this[_0x2059('0x11')]=_0x36b63b[_0x2059('0x12')];this[_0x2059('0x13')]=_0x36b63b['number'];this[_0x2059('0x14')]=_0x36b63b[_0x2059('0x14')];this[_0x2059('0x15')]=_0x36b63b[_0x2059('0x15')];this[_0x2059('0x16')]=_0x36b63b[_0x2059('0x15')];this[_0x2059('0x17')]=getSeconds(_0x36b63b[_0x2059('0x15')],_0x36b63b[_0x2059('0x14')]);this[_0x2059('0x18')]=0x0;this[_0x2059('0x19')]=0x0;this[_0x2059('0x1a')]=_0x36b63b[_0x2059('0x1a')];this[_0x2059('0x1b')]=_0x36b63b['callbackuniqueid'];this[_0x2059('0x1c')]=_0x36b63b['callbackat'];this[_0x2059('0x1d')]=_0x36b63b[_0x2059('0x1d')];this[_0x2059('0x1e')]=_0x36b63b['ContactId'];this[_0x2059('0x1f')]=_0x36b63b[_0x2059('0x1f')];this[_0x2059('0x20')]=_0x36b63b[_0x2059('0x20')];this[_0x2059('0x21')]=_0x36b63b[_0x2059('0x21')];this[_0x2059('0x22')]=_0x36b63b[_0x2059('0x22')];this[_0x2059('0x23')]=_0x36b63b[_0x2059('0x23')]||'';this['originatecalleridname']=_0x36b63b[_0x2059('0x24')]||'';}module[_0x2059('0x25')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index beaa720..b277eae 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 _0x865f=['predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','voice:queue:%s','ivr','format','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','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','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','isUndefined','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20predictive','handlePredictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','length','hasOwnProperty','originated','[decremetOriginate]\x20is\x20null\x20or\x20undefined','inspect','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','Action','status','catch','No\x20such\x20channel','updateOriginated','queue','campaigns','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','saveInDb','uniqueid','isNil','variable','amdstatus','xcally-motion-dialer','dialAMDActive','HANGUP','HangupInAMD','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','membername','amd','[syncMachine][createHistory]','[syncMachine]','[syncHangupInAMDIvr]','Machine','[syncMachineIvr][createHistory]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','outboundAnswerCallsDay','AnswerAGI','[syncHangupIvr]','Unknow','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','Drop','dropreason','TIMEOUT','countdropretry','dialDropMaxRetry','minutes','ContactId','[rescheduleContact][Drop]','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','channel','actionid','paused','stateinterface','push','pick','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','locked','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','\x20trunk\x20is\x20not\x20reachable','ifTime','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','command','interval','content','indexOf','true','iftime\x20%s,%s','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','checkIsTrunkReachable','checkIfTime','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','originate','SIP/%s/%s%s','trim','dialCutDigit','substring','TrunkBackup','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','countbusyretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','countcongestionretry','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','dialMachineMaxRetry','countmachineretry','dialMachineRetryFrequency','[rescheduleContact][Machine]','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','outboundNoSuchCallsDay','NoSuchNumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','stateGlobal','Busy','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','dialGlobalMaxRetry','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','outboundQueuePauses','[CatchErlangB]','floor','one\x20call\x20every:','[handlePredictive]','recallme','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','log','Contact\x20updated','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','Blacklist','inBlackList','limitCalls','temp','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[countReScheduled]\x20','checkContactBlack','[getContactDialer2]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','bluebird','md5','ioredis','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','sequence','voiceQueues','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20INTERVAL_IS_NULL','Interval','Intervals','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime'];(function(_0x38f202,_0x1df2b1){var _0x451615=function(_0x16199c){while(--_0x16199c){_0x38f202['push'](_0x38f202['shift']());}};_0x451615(++_0x1df2b1);}(_0x865f,0x19d));var _0xf865=function(_0x3333b3,_0x1e7bff){_0x3333b3=_0x3333b3-0x0;var _0x3e9b30=_0x865f[_0x3333b3];return _0x3e9b30;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0xf865('0x0'));var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var md5=require(_0xf865('0x1'));var Redis=require(_0xf865('0x2'));var config=require('../../../config/environment/');var logger=require(_0xf865('0x3'))('dialer');var loggerBooked=require(_0xf865('0x3'))(_0xf865('0x4'));var loggerPredictive=require(_0xf865('0x3'))(_0xf865('0x5'));var loggerPredictiveCalls=require(_0xf865('0x3'))(_0xf865('0x6'));var loggerSyncQueueSummary=require(_0xf865('0x3'))(_0xf865('0x7'));var ami=require(_0xf865('0x8'));config[_0xf865('0x9')]=_[_0xf865('0xa')](config[_0xf865('0x9')],{'host':_0xf865('0xb'),'port':0x18eb});var io=require(_0xf865('0xc'))(new Redis(config[_0xf865('0x9')]));var cmHopper=require(_0xf865('0xd'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xf865('0xe'));var cmHopperBlack=require(_0xf865('0xf'));var voiceQueueRt=require(_0xf865('0x10'));var Action=require(_0xf865('0x11'));var History=require(_0xf865('0x12'));var Final=require(_0xf865('0x13'));var AgentComplete=require(_0xf865('0x14'));var QueueCallerAbandon=require(_0xf865('0x15'));var Hangup=require(_0xf865('0x16'));var ipAgi=process[_0xf865('0x17')][_0xf865('0x18')]||_0xf865('0x19');var strategy={'rrmemory':_0xf865('0x1a'),'roundrobin':_0xf865('0x1b')};var Sequence=function(){};Sequence[_0xf865('0x1c')]['enqueue']=function(_0x197ead){this[_0xf865('0x1d')]=this['tail']?this[_0xf865('0x1d')][_0xf865('0x1e')](_0x197ead):_0x197ead();};function Dialer(_0x18cec5,_0x4c0aea){this[_0xf865('0x1f')]=new Sequence();this['preview']=_0x4c0aea;this[_0xf865('0x20')]=_0x18cec5[_0xf865('0x20')];this['campaigns']=_0x18cec5['campaigns'];this['agents']=_0x18cec5[_0xf865('0x21')];this[_0xf865('0x22')]=_0x18cec5[_0xf865('0x22')];this[_0xf865('0x23')]=config[_0xf865('0x23')]||0x2;this[_0xf865('0x24')]={};this[_0xf865('0x25')]={};this[_0xf865('0x26')]={};this[_0xf865('0x27')]={};this['optionPredictive']={};this[_0xf865('0x28')]={};this[_0xf865('0x29')]={};this[_0xf865('0x2a')]={};this[_0xf865('0x2b')]={};this[_0xf865('0x2c')]={};ami['on'](_0xf865('0x2d'),this[_0xf865('0x2e')][_0xf865('0x2f')](this));ami['on'](_0xf865('0x30'),this[_0xf865('0x31')][_0xf865('0x2f')](this));ami['on']('originateresponse',this[_0xf865('0x32')]['bind'](this));ami['on']('agentcomplete',this[_0xf865('0x33')][_0xf865('0x2f')](this));ami['on'](_0xf865('0x34'),this[_0xf865('0x7')]['bind'](this));ami['on'](_0xf865('0x35'),this[_0xf865('0x36')]['bind'](this));ami['on'](_0xf865('0x37'),this[_0xf865('0x38')][_0xf865('0x2f')](this));ami['on'](_0xf865('0x39'),this[_0xf865('0x3a')][_0xf865('0x2f')](this));ami['on'](_0xf865('0x3b'),this[_0xf865('0x3c')][_0xf865('0x2f')](this));ami['on'](_0xf865('0x3d'),this[_0xf865('0x3e')][_0xf865('0x2f')](this));this[_0xf865('0x3f')]();this[_0xf865('0x40')]();}function isNotNull(_0x172524){return _0x172524!==null&&!_['isUndefined'](_0x172524);}function checkIsLoggedIn(_0x53a597,_0x2093f0){return function(){if(_0x2093f0<=0x0){_0x53a597[_0xf865('0x41')]='AGENTS_NOT_LOGGED';throw _0x53a597[_0xf865('0x42')]+_0xf865('0x43');}};}function isActive(_0x465214){return _0x465214;}function checkIsActive(_0xb5aaf8,_0x2bcb86){return function(){if(!isActive(_0x2bcb86)){_0xb5aaf8[_0xf865('0x41')]=_0xf865('0x44');throw _0xb5aaf8['name']+'\x20NOT\x20Active';}};}function checkInterval(_0x548281){return function(){if(!isNotNull(_0x548281['Interval'])){_0x548281['message']='INTERVAL_IS_NULL';throw _0x548281[_0xf865('0x42')]+_0xf865('0x45');}if(!isNotNull(_0x548281[_0xf865('0x46')][_0xf865('0x47')])){_0x548281[_0xf865('0x41')]=_0xf865('0x48');throw _0x548281[_0xf865('0x42')]+_0xf865('0x45');}if(!isNotNull(_[_0xf865('0x49')](_0x548281[_0xf865('0x46')]['Intervals']))){_0x548281['message']=_0xf865('0x48');throw _0x548281[_0xf865('0x42')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x594350,_0x100b45,_0x1a7af1){return{'action':_0x594350,'response':_0x100b45,'message':_0x1a7af1,'stack':_0x1a7af1};}function myreject(_0x285b5b){return function(_0x3c7c6b){return _0x285b5b(msgResponse(_0xf865('0x4a'),_0xf865('0x4b'),JSON[_0xf865('0x4c')](_0x3c7c6b)));};}function getSeconds(_0x2fcdc0,_0x453705){var _0x3472f0=moment(_0x2fcdc0)[_0xf865('0x4d')](0x0);var _0x319a5e=moment(_0x453705)[_0xf865('0x4d')](0x0);return _0x3472f0[_0xf865('0x4e')](_0x319a5e,_0xf865('0x4f'));}function emit(_0x1f0131,_0x1db7f4,_0x37e524){io['to'](_0x1f0131)[_0xf865('0x50')](_0x1db7f4,_0x37e524);}function emitVoiceQueueSummary(_0x3d2c16){if(_0x3d2c16[_0xf865('0x51')]===_0xf865('0x52')){var _0xcea4e9={'id':_0x3d2c16['id'],'name':_0x3d2c16['name'],'strategy':_0x3d2c16[_0xf865('0x53')],'answered':_0x3d2c16[_0xf865('0x54')],'available':_0x3d2c16[_0xf865('0x55')],'loggedIn':_0x3d2c16[_0xf865('0x56')],'pTalking':_0x3d2c16[_0xf865('0x57')],'sumBillable':_0x3d2c16[_0xf865('0x58')],'sumDuration':_0x3d2c16[_0xf865('0x59')],'sumHoldTime':_0x3d2c16[_0xf865('0x5a')]||0x0,'talking':_0x3d2c16[_0xf865('0x5b')],'total':_0x3d2c16[_0xf865('0x5c')],'type':_0x3d2c16['type'],'unmanaged':_0x3d2c16[_0xf865('0x5d')],'abandoned':_0x3d2c16['abandoned'],'waiting':_0x3d2c16[_0xf865('0x5e')],'loggedInDb':_0x3d2c16[_0xf865('0x5f')],'dialActive':_0x3d2c16[_0xf865('0x60')],'dialMethod':_0x3d2c16[_0xf865('0x61')],'dialOriginateCallerIdName':_0x3d2c16[_0xf865('0x62')],'dialOriginateCallerIdNumber':_0x3d2c16[_0xf865('0x63')],'dialOriginateTimeout':_0x3d2c16[_0xf865('0x64')],'dialPrefix':_0x3d2c16[_0xf865('0x65')],'outboundAnswerAgiCallsDay':_0x3d2c16[_0xf865('0x66')],'outboundAnswerCallsDay':_0x3d2c16['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x3d2c16[_0xf865('0x67')],'outboundBusyCallsDay':_0x3d2c16[_0xf865('0x68')],'outboundCongestionCallsDay':_0x3d2c16[_0xf865('0x69')],'outboundDropCallsDayACS':_0x3d2c16['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x3d2c16[_0xf865('0x6a')],'outboundDropCallsDayTimeout':_0x3d2c16[_0xf865('0x6b')],'outboundNoAnswerCallsDay':_0x3d2c16[_0xf865('0x6c')],'outboundNoSuchCallsDay':_0x3d2c16['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x3d2c16[_0xf865('0x6d')],'outboundReCallsDay':_0x3d2c16[_0xf865('0x6e')],'outboundRejectCallsDay':_0x3d2c16[_0xf865('0x6f')],'outboundUnknownCallsDay':_0x3d2c16[_0xf865('0x70')],'predictiveIntervalAnsweredCalls':_0x3d2c16[_0xf865('0x71')],'predictiveIntervalAvgHoldtime':_0x3d2c16[_0xf865('0x72')],'predictiveIntervalAvgTalktime':_0x3d2c16[_0xf865('0x73')],'predictiveIntervalDroppedCallsCallersExit':_0x3d2c16['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x3d2c16[_0xf865('0x74')],'predictiveIntervalErlangCalls':_0x3d2c16[_0xf865('0x75')],'predictiveIntervalErlangCallsDroppedCalls':_0x3d2c16[_0xf865('0x76')],'predictiveIntervalHitRate':_0x3d2c16[_0xf865('0x77')],'predictiveIntervalMultiplicativeFactor':_0x3d2c16[_0xf865('0x78')],'predictiveIntervalPauses':_0x3d2c16[_0xf865('0x79')],'predictiveIntervalAvailable':_0x3d2c16[_0xf865('0x7a')],'predictiveIntervalTotalCalls':_0x3d2c16[_0xf865('0x7b')],'message':_0x3d2c16[_0xf865('0x41')],'originated':_0x3d2c16['originated'],'erlangCalls':_0x3d2c16[_0xf865('0x7c')],'erlangCallToSecond':_0x3d2c16['erlangCallToSecond'],'erlangAbandonmentRate':_0x3d2c16[_0xf865('0x7d')],'erlangBusyFactor':_0x3d2c16[_0xf865('0x7e')],'startPredictive':_0x3d2c16[_0xf865('0x28')],'startProgressive':_0x3d2c16[_0xf865('0x29')]};if(_0x3d2c16[_0xf865('0x7f')]){_0xcea4e9['Trunk']={'id':_0x3d2c16[_0xf865('0x7f')]['id'],'name':_0x3d2c16[_0xf865('0x7f')]['name'],'active':_0x3d2c16['Trunk'][_0xf865('0x80')],'callerid':_0x3d2c16[_0xf865('0x7f')][_0xf865('0x81')]};}if(_0x3d2c16['Interval']){_0xcea4e9[_0xf865('0x46')]={'id':_0x3d2c16[_0xf865('0x46')]['id'],'name':_0x3d2c16[_0xf865('0x46')]['name']};}var _0xf42512=md5(JSON['stringify'](_0xcea4e9));if(_0x3d2c16[_0xf865('0x1')]!==_0xf42512){_0x3d2c16['md5']=_0xf42512;emit(util['format'](_0xf865('0x82'),_0xcea4e9['name']),'voice_queue:save',_0xcea4e9);}}}function emitCampaignSummary(_0x25c638){if(_0x25c638['type']===_0xf865('0x83')){emit(util[_0xf865('0x84')](_0xf865('0x85'),_0x25c638[_0xf865('0x42')]),_0xf865('0x86'),_0x25c638);}}function checkGetDataPredictive(_0x4d15a0){if(isNotNull(_0x4d15a0)){if(!_['isEmpty'](_0x4d15a0)){loggerPredictive['info'](_0xf865('0x87'));loggerPredictive[_0xf865('0x88')](_0xf865('0x89'),_0x4d15a0[_0xf865('0x7b')]);loggerPredictive[_0xf865('0x88')](_0xf865('0x8a'),_0x4d15a0['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xf865('0x88')](_0xf865('0x8b'),_0x4d15a0['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xf865('0x88')](_0xf865('0x8c'),_0x4d15a0[_0xf865('0x8d')]);loggerPredictive[_0xf865('0x88')](_0xf865('0x8e'),_0x4d15a0[_0xf865('0x72')]);loggerPredictive[_0xf865('0x88')](_0xf865('0x8f'),_0x4d15a0['predictiveIntervalAvgTalktime']);loggerPredictive[_0xf865('0x88')](_0xf865('0x90'));if(_0x4d15a0[_0xf865('0x7b')]>0x0){if(!_['isUndefined'](_0x4d15a0[_0xf865('0x73')])&&_0x4d15a0[_0xf865('0x73')]>0x0){return!![];}else{loggerPredictive[_0xf865('0x88')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_[_0xf865('0x91')](_0x4d15a0['predictiveIntervalAvgHoldtime'])&&_0x4d15a0[_0xf865('0x72')]>0x0){return!![];}else{loggerPredictive[_0xf865('0x88')](_0xf865('0x92'));}}else{loggerPredictive[_0xf865('0x88')](_0xf865('0x93'));}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}}else{loggerPredictive['info'](_0xf865('0x94'));}return![];}function mergeDataErlangB(_0x30b063){return function(_0x22ab73){loggerPredictive['info'](_0xf865('0x95'));loggerPredictive[_0xf865('0x88')](_0xf865('0x96'),_0x22ab73[_0xf865('0x7c')]);loggerPredictive[_0xf865('0x88')](_0xf865('0x97'),_0x22ab73['erlangCallToSecond']);loggerPredictive[_0xf865('0x88')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x22ab73['erlangAbandonmentRate']);loggerPredictive[_0xf865('0x88')](_0xf865('0x98'),_0x22ab73[_0xf865('0x7e')]);loggerPredictive[_0xf865('0x88')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x22ab73[_0xf865('0x7d')]);loggerPredictive[_0xf865('0x88')](_0xf865('0x90'));_[_0xf865('0x99')](_0x30b063,_0x22ab73);};}function getDiff(_0xffc588){var _0x3bfbfb=moment()[_0xf865('0x4d')](0x0);var _0x6b0300=moment(_0xffc588)[_0xf865('0x4d')](0x0);return _0x3bfbfb[_0xf865('0x4e')](_0x6b0300,_0xf865('0x4f'));}function ifInterval(_0x5736d5,_0x6f22d7){if(_['isUndefined'](_0x6f22d7)){return![];}if(getDiff(_0x6f22d7)<_0x5736d5*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x2d12f7){if(isNotNull(_0x2d12f7)){if(!_[_0xf865('0x91')](_0x2d12f7[_0xf865('0x29')])){_0x2d12f7[_0xf865('0x29')]=undefined;loggerPredictive[_0xf865('0x88')](_0x2d12f7['name'],'clearing\x20variable\x20start\x20progressive');}if(!_[_0xf865('0x91')](_0x2d12f7[_0xf865('0x28')])){_0x2d12f7[_0xf865('0x28')]=undefined;loggerPredictive[_0xf865('0x88')](_0x2d12f7[_0xf865('0x42')],_0xf865('0x9a'));}if(!_['isUndefined'](_0x2d12f7[_0xf865('0x9b')])){clearInterval(_0x2d12f7[_0xf865('0x9b')]);_0x2d12f7[_0xf865('0x9b')]=undefined;loggerPredictive[_0xf865('0x88')](_0x2d12f7[_0xf865('0x42')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x4cd1b6,_0x242fe6){if(_0x242fe6===0x0){return 0x0;}var _0xadfe27=0x1;for(var _0x1c90a2=0x1;_0x1c90a2<=_0x242fe6;_0x1c90a2+=0x1){_0xadfe27=0x1+_0xadfe27*_0x1c90a2/_0x4cd1b6;}return 0x1/_0xadfe27;}function isVoiceQueueOutbound(_0x26884b){return _0x26884b===_0xf865('0x52');}function isNotPreview(_0x314a0c){return _0x314a0c!==_0xf865('0x9c');}function isCampaignIvr(_0x5e1a15){return _0x5e1a15===_0xf865('0x83');}function getCallerId(_0x8d9c3a,_0x3e1ec3,_0x3493ad){if(!_[_0xf865('0x91')](_0x3493ad)&&_0xf865('0x9d')===typeof _0x3493ad&&!_[_0xf865('0x49')](_0x3493ad)){if(!_[_0xf865('0x91')](_0x3e1ec3)&&_0xf865('0x9d')===typeof _0x3e1ec3&&!_['isEmpty'](_0x3e1ec3)){return util['format'](_0xf865('0x9e'),_0x3e1ec3,_0x3493ad);}return util[_0xf865('0x84')]('\x22%s\x22\x20<%s>',_0x3493ad,_0x3493ad);}if(!_[_0xf865('0x91')](_0x8d9c3a)&&_0xf865('0x9d')===typeof _0x8d9c3a&&!_[_0xf865('0x49')](_0x8d9c3a)){return _0x8d9c3a;}return _0xf865('0x9f');}function loggerCatchQueueSummary(_0x477b15,_0x32f3f0){return function(_0x3b4b88){freeVariablesPredictive(_0x32f3f0);emitVoiceQueueSummary(_0x32f3f0);emitCampaignSummary(_0x32f3f0);loggerSyncQueueSummary[_0xf865('0xa0')](_0x477b15,util['inspect'](_0x3b4b88,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x418350,_0x1b9173){return function(_0x59d0bb){loggerPredictive[_0xf865('0xa0')](_0x1b9173[_0xf865('0x42')],_0x418350);loggerPredictive[_0xf865('0xa0')](_0x59d0bb[_0xf865('0xa1')]);freeVariablesPredictive(_0x1b9173);};}function loggerCatch(_0x5f2925){return function(_0x45a69f){logger[_0xf865('0xa0')](_0x5f2925,util['inspect'](_0x45a69f,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x1a5f25){return _0x1a5f25&&!_[_0xf865('0x91')](_0x1a5f25)&&_0x1a5f25[_0xf865('0xa2')]>0x0;}function decremetOriginate(_0x5490c5){if(!_[_0xf865('0x91')](_0x5490c5)&&_0x5490c5!==null){if(_0x5490c5[_0xf865('0xa3')](_0xf865('0xa4'))){if(_0x5490c5['originated']>0x0){_0x5490c5[_0xf865('0xa4')]-=0x1;}else{logger[_0xf865('0xa0')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xf865('0xa0')](_0xf865('0xa5'));}}function checkContactLowerLimitOriginate(_0x2bb7f6,_0x194f70,_0x4f62e8){if(_0x194f70>_0x4f62e8){for(var _0x171b17=0x0;_0x171b17<_0x194f70-_0x4f62e8;_0x171b17+=0x1){decremetOriginate(_0x2bb7f6);}}}function loggerGetContactDialer(_0x13c25c,_0x45d13b,_0xef505b){return function(_0x5dfe45){checkContactLowerLimitOriginate(_0x45d13b,_0xef505b,0x0);logger[_0xf865('0xa0')](_0x13c25c,util[_0xf865('0xa6')](_0x5dfe45,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x51a20b){return function(_0x4eccf2){if(isNotNull(_0x4eccf2)&&isNotNull(_0x4eccf2[0x0])){if(_0x4eccf2[0x0]['contactsRescheduled']>0x0){_0x51a20b[_0xf865('0x41')]='RESCHEDULED_CONTACTS';logger[_0xf865('0x88')](_0xf865('0xa7')+_0x51a20b[_0xf865('0x42')],_0x4eccf2[0x0][_0xf865('0xa8')],_0xf865('0xa9'));}else{_0x51a20b[_0xf865('0x41')]=_0xf865('0xaa');logger['info'](_0xf865('0xab')+_0x51a20b[_0xf865('0x42')]);}}};}function notSendMessagesQueue(_0x22c103){if(_0x22c103['sendMessageOneNotActive']){freeVariablesPredictive(_0x22c103);if(_0x22c103[_0xf865('0xa4')]===0x0&&_0x22c103[_0xf865('0x5b')]===0x0&&_0x22c103[_0xf865('0x5e')]===0x0&&(_0x22c103[_0xf865('0x57')]||0x0)===0x0){_0x22c103[_0xf865('0xac')]=![];_0x22c103[_0xf865('0x55')]=0x0;_0x22c103[_0xf865('0x41')]=_0xf865('0x44');loggerSyncQueueSummary[_0xf865('0xa0')](_0xf865('0xad'),_0x22c103[_0xf865('0x42')],_0xf865('0xae'));}else{_0x22c103[_0xf865('0x41')]=_0xf865('0xaf');loggerSyncQueueSummary[_0xf865('0xa0')](_0xf865('0xad'),_0x22c103['name'],_0xf865('0xb0'));}emitVoiceQueueSummary(_0x22c103);}}function notSendMessagesCampaign(_0x41fdf8){if(_0x41fdf8['sendMessageOneNotActive']){if(_0x41fdf8[_0xf865('0xa4')]===0x0){_0x41fdf8['sendMessageOneNotActive']=![];_0x41fdf8[_0xf865('0x41')]=_0xf865('0x44');loggerSyncQueueSummary[_0xf865('0xa0')](_0xf865('0xb1'),_0x41fdf8[_0xf865('0x42')],'is\x20not\x20active');}else{_0x41fdf8['message']=_0xf865('0xaf');loggerSyncQueueSummary[_0xf865('0xa0')](_0xf865('0xb1'),_0x41fdf8[_0xf865('0x42')],_0xf865('0xb0'));}emitCampaignSummary(_0x41fdf8);}}function createObjHistory(_0x3785a3,_0x27f05d,_0x554c58,_0x1789bd,_0x49a681){_0x3785a3['message']=_0x554c58;var _0x16b4ba=new Action(_0x3785a3,_0x27f05d);var _0x3a043f=new History(_0x16b4ba);_0x3a043f[_0xf865('0xb2')]=_0x1789bd;_0x3a043f[_0xf865('0xb3')]=_0x49a681;_0x3a043f[_0xf865('0xb4')]=_0x16b4ba[_0xf865('0xb5')];return _0x3a043f;}Dialer[_0xf865('0x1c')][_0xf865('0x40')]=function(){var _0x8911c7=this;setInterval(function(){_0x8911c7[_0xf865('0xb6')](_0x8911c7[_0xf865('0x27')],'[uniqueid]');_0x8911c7[_0xf865('0xb6')](_0x8911c7['actions'],'[actions]');},0x32c8);};Dialer[_0xf865('0x1c')][_0xf865('0xb6')]=function(_0x5e08d8,_0x34fd84){var _0x3a8abf=this;for(var _0x56abf5 in _0x5e08d8){if(_0x5e08d8[_0xf865('0xa3')](_0x56abf5)){this['sequence']['enqueue'](function(){if(!_['isNil'](_0x5e08d8[_0x56abf5])){return ami[_0xf865('0xb7')]({'action':_0xf865('0xb8'),'channel':_0x5e08d8[_0x56abf5]['channel']})[_0xf865('0xb9')](function(_0x526f04){if(_0x526f04[_0xf865('0x41')]===_0xf865('0xba')){setTimeout(function(){if(_0x5e08d8[_0x56abf5]&&_0x5e08d8[_0x56abf5][_0xf865('0x51')]!==_0xf865('0x83')){_0x3a8abf[_0xf865('0xbb')](_0x3a8abf['voiceQueues'][_0x5e08d8[_0x56abf5][_0xf865('0xbc')]]);logger[_0xf865('0xa0')]('[Dialer][checkChannel]',_0x34fd84,_0x56abf5,_0x5e08d8[_0x56abf5]['queue']);delete _0x5e08d8[_0x56abf5];}if(_0x5e08d8[_0x56abf5]&&_0x5e08d8[_0x56abf5][_0xf865('0x51')]===_0xf865('0x83')){_0x3a8abf[_0xf865('0xbb')](_0x3a8abf[_0xf865('0xbd')][_0x5e08d8[_0x56abf5][_0xf865('0xbc')]]);logger[_0xf865('0xa0')](_0xf865('0xbe'),_0x34fd84,_0x56abf5,_0x5e08d8[_0x56abf5]['queue']);delete _0x5e08d8[_0x56abf5];}},0x2328);}});}});}}};Dialer[_0xf865('0x1c')][_0xf865('0xbf')]=function(_0x553fcb){return BPromise[_0xf865('0xc0')]()[_0xf865('0xc1')](cmHopper[_0xf865('0xbf')](_0x553fcb))[_0xf865('0xb9')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0xf865('0x1c')][_0xf865('0xc2')]=function(_0x3600b9){return BPromise[_0xf865('0xc0')]()[_0xf865('0xc1')](cmHopperBlack[_0xf865('0xc2')](_0x3600b9))['catch'](loggerCatch(_0xf865('0xc3')));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x5b6a17){return BPromise[_0xf865('0xc0')]()['then'](cmHopperBlack[_0xf865('0xc4')](_0x5b6a17))[_0xf865('0xb9')](loggerCatch(_0xf865('0xc5')));};Dialer[_0xf865('0x1c')][_0xf865('0xc6')]=function(_0x4b87c8){return BPromise['resolve']()[_0xf865('0xc1')](cmHopperHistory[_0xf865('0xc7')](_0x4b87c8))[_0xf865('0xb9')](loggerCatch(_0xf865('0xc8')));};Dialer[_0xf865('0x1c')]['rescheduleContact']=function(_0x77d75a){return BPromise[_0xf865('0xc0')]()[_0xf865('0xc1')](cmHopper[_0xf865('0xc9')](_0x77d75a))[_0xf865('0xb9')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0xf865('0x1c')][_0xf865('0xca')]=function(_0x4a15e9,_0x432a76,_0x389d61){return BPromise[_0xf865('0xc0')]()['then'](cmHopper[_0xf865('0xca')](_0x4a15e9,_0x432a76,_0x389d61))[_0xf865('0xb9')](loggerCatch(_0xf865('0xcb')));};Dialer[_0xf865('0x1c')][_0xf865('0xcc')]=function(_0x22e54c,_0x205dc8,_0xd77bd1,_0x316621){return BPromise[_0xf865('0xc0')]()[_0xf865('0xc1')](cmHopper['getContactDialer'](_0x22e54c,_0x205dc8,_0xd77bd1,_0x316621))[_0xf865('0xb9')](loggerCatch(_0xf865('0xcd')));};Dialer[_0xf865('0x1c')]['getContactDialerIvr']=function(_0x56b9ad,_0x72d86a,_0x501c48){return BPromise['resolve']()['then'](cmHopper[_0xf865('0xce')](_0x56b9ad,_0x72d86a,_0x501c48))[_0xf865('0xb9')](loggerCatch('[getContactDialer]\x20'));};Dialer[_0xf865('0x1c')][_0xf865('0xcf')]=function(_0x314acf){return BPromise[_0xf865('0xc0')]()[_0xf865('0xc1')](voiceQueueRt[_0xf865('0xcf')](_0x314acf))[_0xf865('0xb9')](loggerCatch(_0xf865('0xd0')));};Dialer['prototype'][_0xf865('0xd1')]=function(_0x19dd92){return BPromise[_0xf865('0xc0')]()[_0xf865('0xc1')](cmHopper['moveContactManagedDialer'](_0x19dd92))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0xf865('0x1c')][_0xf865('0xd2')]=function(_0x521685){return BPromise['resolve']()[_0xf865('0xc1')](cmHopperHistory['createHistory'](_0x521685))[_0xf865('0xb9')](loggerCatch(_0xf865('0xd3')));};Dialer['prototype'][_0xf865('0xbb')]=function(_0x3671db){if(!_[_0xf865('0x91')](_0x3671db)&&_0x3671db!==null){if(_0x3671db[_0xf865('0xa3')](_0xf865('0xa4'))){if(_0x3671db[_0xf865('0xa4')]>0x0){_0x3671db[_0xf865('0xa4')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xf865('0xa0')](_0xf865('0xd4'));}};Dialer[_0xf865('0x1c')][_0xf865('0xd5')]=function(_0x3fee3c,_0x251e28){var _0x5b3071=this;return function(_0x2d2591){_0x5b3071[_0xf865('0xbb')](_0x251e28);logger[_0xf865('0xa0')](_0x3fee3c,util['inspect'](_0x2d2591,{'showHidden':![],'depth':null}));};};Dialer[_0xf865('0x1c')][_0xf865('0xd6')]=function(_0x2c9df2,_0x38e18f,_0x595930){var _0x56bc51={'state':0x19,'statedesc':_0xf865('0xd7')};this[_0xf865('0xbb')](_0x38e18f);this['saveInDb'](_[_0xf865('0x99')](_0x56bc51,_['pick'](_0x595930,['ContactId',_0xf865('0xd8'),_0xf865('0xd9'),_0xf865('0xda'),_0xf865('0xdb')])),_0xf865('0xdc'),'[emptyContact]');logger[_0xf865('0xa0')](_0x2c9df2);};Dialer['prototype'][_0xf865('0xdd')]=function(_0x2f3da9){return _0x2f3da9===_0xf865('0xde');};Dialer[_0xf865('0x1c')][_0xf865('0xdf')]=function(_0x4ae328){return!_[_0xf865('0x91')](_0x4ae328)&&_0x4ae328&&!_['isUndefined'](_0x4ae328[_0xf865('0x42')])&&!_['isUndefined'](_0x4ae328[_0xf865('0x80')])&&_0x4ae328['active']&&(this['trunks'][util[_0xf865('0x84')](_0xf865('0xe0'),_0x4ae328[_0xf865('0x42')])][_0xf865('0xb8')]===_0xf865('0xe1')||this[_0xf865('0x22')][util[_0xf865('0x84')](_0xf865('0xe0'),_0x4ae328[_0xf865('0x42')])][_0xf865('0xb8')]===_0xf865('0xe2'));};Dialer[_0xf865('0x1c')][_0xf865('0xe3')]=function(_0x379a79,_0x502c57,_0x505133){this[_0xf865('0xd2')](_0x379a79)[_0xf865('0xb9')](loggerCatch(_0x502c57));this['moveContactManagedDialer'](_0x379a79)[_0xf865('0xb9')](loggerCatch(_0x505133));};Dialer[_0xf865('0x1c')]['syncVarSet']=function(_0x1e366f){var _0x2aa7ed=this['uniqueId'][_0x1e366f[_0xf865('0xe4')]];var _0x5af71a;if(!_[_0xf865('0xe5')](_0x1e366f)&&!_[_0xf865('0xe5')](_0x1e366f[_0xf865('0xe6')])&&!_[_0xf865('0xe5')](_0x1e366f['variable'][_0xf865('0xe7')])&&_0x1e366f['exten']===_0xf865('0xe8')&&_0x2aa7ed){if(_0x2aa7ed['type']!==_0xf865('0x83')&&this[_0xf865('0x20')][_0x2aa7ed[_0xf865('0xbc')]][_0xf865('0xe9')]&&_0x1e366f['value']===_0xf865('0xea')){delete this[_0xf865('0x27')][_0x1e366f[_0xf865('0xe4')]];this[_0xf865('0xbb')](this[_0xf865('0x20')][_0x2aa7ed[_0xf865('0xbc')]]);this[_0xf865('0x20')][_0x2aa7ed[_0xf865('0xbc')]]['outboundAnswerCallsDay']+=0x1;this[_0xf865('0x20')][_0x2aa7ed['queue']][_0xf865('0x66')]+=0x1;_0x5af71a=new Hangup(_0x2aa7ed,_0x1e366f);_0x5af71a[_0xf865('0xb2')]=0x12;_0x5af71a['statedesc']=_0xf865('0xeb');_0x5af71a['membername']=_0xf865('0xec');this[_0xf865('0xe3')](_0x5af71a,_0xf865('0xed'),_0xf865('0xee'));}if(_0x2aa7ed[_0xf865('0x51')]!==_0xf865('0x83')&&this[_0xf865('0x20')][_0x2aa7ed[_0xf865('0xbc')]][_0xf865('0xe9')]&&_0x1e366f[_0xf865('0xef')]===_0xf865('0xf0')){delete this[_0xf865('0x27')][_0x1e366f[_0xf865('0xe4')]];this[_0xf865('0xbb')](this[_0xf865('0x20')][_0x2aa7ed[_0xf865('0xbc')]]);this[_0xf865('0x20')][_0x2aa7ed['queue']]['outboundAnswerCallsDay']+=0x1;this[_0xf865('0x20')][_0x2aa7ed[_0xf865('0xbc')]]['outboundAnswerAgiCallsDay']+=0x1;_0x5af71a=new Hangup(_0x2aa7ed,_0x1e366f);_0x5af71a[_0xf865('0xb2')]=0x13;_0x5af71a['statedesc']='Machine';_0x5af71a[_0xf865('0xf1')]='AMD';_0x5af71a[_0xf865('0xf2')]=!![];this['saveInDb'](_0x5af71a,_0xf865('0xf3'),_0xf865('0xf4'));}if(_0x2aa7ed[_0xf865('0x51')]===_0xf865('0x83')&&this[_0xf865('0xbd')][_0x2aa7ed[_0xf865('0xbc')]][_0xf865('0xe9')]&&_0x1e366f[_0xf865('0xef')]===_0xf865('0xea')){delete this[_0xf865('0x27')][_0x1e366f[_0xf865('0xe4')]];this[_0xf865('0xbb')](this[_0xf865('0xbd')][_0x2aa7ed['queue']]);_0x5af71a=new Hangup(_0x2aa7ed,_0x1e366f);_0x5af71a['state']=0x12;_0x5af71a[_0xf865('0xb3')]='HangupInAMD';_0x5af71a['membername']='AMD';this[_0xf865('0xe3')](_0x5af71a,'[syncHangupInAMDIvr][createHistory]',_0xf865('0xf5'));}if(_0x2aa7ed[_0xf865('0x51')]===_0xf865('0x83')&&this['campaigns'][_0x2aa7ed[_0xf865('0xbc')]]['dialAMDActive']&&_0x1e366f[_0xf865('0xef')]===_0xf865('0xf0')){delete this[_0xf865('0x27')][_0x1e366f[_0xf865('0xe4')]];this[_0xf865('0xbb')](this[_0xf865('0xbd')][_0x2aa7ed[_0xf865('0xbc')]]);_0x5af71a=new Hangup(_0x2aa7ed,_0x1e366f);_0x5af71a[_0xf865('0xb2')]=0x13;_0x5af71a[_0xf865('0xb3')]=_0xf865('0xf6');_0x5af71a['membername']=_0xf865('0xec');_0x5af71a[_0xf865('0xf2')]=!![];this[_0xf865('0xe3')](_0x5af71a,_0xf865('0xf7'),'[syncMachineIvr]');}}};Dialer[_0xf865('0x1c')][_0xf865('0x36')]=function(_0x5f4753){var _0x5ab2f5=this[_0xf865('0x27')][_0x5f4753[_0xf865('0xe4')]];var _0x4159e3=this;var _0x1e61a2;if(_0x5ab2f5&&_0x5ab2f5['type']==='ivr'){delete this['uniqueId'][_0x5f4753[_0xf865('0xe4')]];this['updateOriginated'](this[_0xf865('0xbd')][_0x5ab2f5[_0xf865('0xbc')]]);this[_0xf865('0xbd')][_0x5ab2f5[_0xf865('0xbc')]][_0xf865('0xf8')]+=0x1;_0x1e61a2=new Hangup(_0x5ab2f5,_0x5f4753);this[_0xf865('0xd2')](_0x1e61a2)[_0xf865('0xb9')](loggerCatch(_0xf865('0xf9')));this[_0xf865('0xd1')](_0x1e61a2)[_0xf865('0xb9')](loggerCatch('[syncHangupIvr]'));}if(_0x5ab2f5&&_0x5ab2f5['type']!=='ivr'&&isNotNull(this[_0xf865('0x20')][_0x5ab2f5['queue']][_0xf865('0xfa')])){delete this[_0xf865('0x27')][_0x5f4753[_0xf865('0xe4')]];this[_0xf865('0xbb')](this[_0xf865('0x20')][_0x5ab2f5[_0xf865('0xbc')]]);this[_0xf865('0x20')][_0x5ab2f5[_0xf865('0xbc')]][_0xf865('0xfb')]+=0x1;this[_0xf865('0x20')][_0x5ab2f5[_0xf865('0xbc')]][_0xf865('0x66')]+=0x1;_0x1e61a2=new Hangup(_0x5ab2f5,_0x5f4753);_0x1e61a2[_0xf865('0xb2')]=0x10;_0x1e61a2[_0xf865('0xb3')]=_0xf865('0xfc');_0x1e61a2[_0xf865('0xf1')]='AGI';this[_0xf865('0xd2')](_0x1e61a2)[_0xf865('0xb9')](loggerCatch(_0xf865('0xf9')));this[_0xf865('0xd1')](_0x1e61a2)[_0xf865('0xb9')](loggerCatch(_0xf865('0xfd')));}if(_0x5ab2f5&&_0x5ab2f5['type']!==_0xf865('0x83')&&!isNotNull(this[_0xf865('0x20')][_0x5ab2f5[_0xf865('0xbc')]][_0xf865('0xfa')])){delete this[_0xf865('0x27')][_0x5f4753[_0xf865('0xe4')]];this['updateOriginated'](this[_0xf865('0x20')][_0x5ab2f5['queue']]);this[_0xf865('0x20')][_0x5ab2f5[_0xf865('0xbc')]]['outboundUnknownCallsDay']+=0x1;_0x1e61a2=new Hangup(_0x5ab2f5,_0x5f4753);_0x1e61a2[_0xf865('0xb2')]=0xc;_0x1e61a2[_0xf865('0xb3')]=_0x5f4753['cause-txt'];_0x1e61a2['membername']=_0xf865('0xfe');this[_0xf865('0xd2')](_0x1e61a2)[_0xf865('0xb9')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xf865('0xd1')](_0x1e61a2)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xf865('0x1c')][_0xf865('0x33')]=function(_0x6b1bec){var _0xa45610=this[_0xf865('0x27')][_0x6b1bec[_0xf865('0xe4')]];var _0x3bacac=this;if(this[_0xf865('0x20')][_0x6b1bec['queue']]){if(_0xa45610&&_0xa45610[_0xf865('0x51')]!==_0xf865('0x83')){delete this['uniqueId'][_0x6b1bec[_0xf865('0xe4')]];this[_0xf865('0x20')][_0x6b1bec[_0xf865('0xbc')]][_0xf865('0xfb')]+=0x1;var _0x30100d=new AgentComplete(_0xa45610,_0x6b1bec);if(_0x6b1bec['reason']===_0xf865('0xff')){_0x30100d[_0xf865('0x100')]=this[_0xf865('0x20')][_0x6b1bec[_0xf865('0xbc')]][_0xf865('0x101')]&&this[_0xf865('0x20')][_0x6b1bec[_0xf865('0xbc')]][_0xf865('0x102')]?moment()[_0xf865('0x84')](_0xf865('0x103')):undefined;}this[_0xf865('0xd2')](_0x30100d)[_0xf865('0xb9')](loggerCatch(_0xf865('0x104')));this[_0xf865('0xd1')](_0x30100d)[_0xf865('0xb9')](loggerCatch(_0xf865('0x105')));}}};Dialer[_0xf865('0x1c')][_0xf865('0x2e')]=function(_0x6ef7ed){if(this[_0xf865('0x20')][_0x6ef7ed[_0xf865('0xbc')]]){if(this[_0xf865('0x27')][_0x6ef7ed[_0xf865('0xe4')]]&&this[_0xf865('0x27')][_0x6ef7ed['uniqueid']]['type']!=='ivr'){this[_0xf865('0xbb')](this[_0xf865('0x20')][_0x6ef7ed['queue']]);this[_0xf865('0x27')][_0x6ef7ed[_0xf865('0xe4')]][_0xf865('0x106')]=moment()[_0xf865('0x84')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xf865('0x1c')][_0xf865('0x107')]=function(_0x2c206e){this['createHistory'](_0x2c206e)['catch'](loggerCatch(_0xf865('0x104')));this[_0xf865('0xd1')](_0x2c206e)[_0xf865('0xb9')](loggerCatch(_0xf865('0x108')));};Dialer['prototype'][_0xf865('0x31')]=function(_0x2dfbd0){var _0x38ea81=this[_0xf865('0x27')][_0x2dfbd0[_0xf865('0xe4')]];var _0x4d9d8d=this;if(this['voiceQueues'][_0x2dfbd0['queue']]){if(_0x38ea81&&_0x38ea81['type']!=='ivr'){delete this[_0xf865('0x27')][_0x2dfbd0[_0xf865('0xe4')]];this[_0xf865('0xbb')](this[_0xf865('0x20')][_0x2dfbd0[_0xf865('0xbc')]]);_0x38ea81[_0xf865('0x109')]=moment()[_0xf865('0x84')]('YYYY-MM-DD\x20HH:mm:ss');var _0x48aa36=new QueueCallerAbandon(_0x38ea81,_0x2dfbd0);if(getSeconds(_0x38ea81[_0xf865('0x109')],_0x38ea81['responsetime'])>=_0x38ea81[_0xf865('0x10a')]){this['voiceQueues'][_0x2dfbd0[_0xf865('0xbc')]][_0xf865('0x74')]+=0x1;this[_0xf865('0x20')][_0x2dfbd0[_0xf865('0xbc')]][_0xf865('0x6b')]+=0x1;this[_0xf865('0x20')][_0x2dfbd0['queue']][_0xf865('0x76')]+=0x1;_0x48aa36['state']=0xa;_0x48aa36[_0xf865('0xb3')]=_0xf865('0x10b');_0x48aa36[_0xf865('0x10c')]=_0xf865('0x10d');_0x48aa36[_0xf865('0x100')]=this[_0xf865('0x20')][_0x2dfbd0['queue']][_0xf865('0x101')]?moment()[_0xf865('0x84')](_0xf865('0x103')):undefined;if(_0x48aa36[_0xf865('0x10e')]>=this[_0xf865('0x20')][_0x2dfbd0[_0xf865('0xbc')]][_0xf865('0x10f')]-0x1){this[_0xf865('0x107')](_0x48aa36);}else{this[_0xf865('0xc9')]({'active':![],'countdropretry':_0x48aa36[_0xf865('0x10e')]+=0x1,'scheduledat':moment()['add'](this[_0xf865('0x20')][_0x2dfbd0[_0xf865('0xbc')]]['dialDropRetryFrequency'],_0xf865('0x110'))[_0xf865('0x84')](_0xf865('0x103')),'ContactId':_0x38ea81[_0xf865('0x111')],'ListId':_0x38ea81[_0xf865('0xd8')],'VoiceQueueId':_0x38ea81[_0xf865('0xda')]||undefined,'CampaignId':_0x38ea81['CampaignId']||undefined})['catch'](loggerCatch(_0xf865('0x112')));}}else{this[_0xf865('0x20')][_0x2dfbd0['queue']][_0xf865('0x8d')]+=0x1;this[_0xf865('0x20')][_0x2dfbd0[_0xf865('0xbc')]][_0xf865('0x6a')]+=0x1;_0x48aa36[_0xf865('0xb2')]=0xb;_0x48aa36['statedesc']=_0xf865('0x113');_0x48aa36['dropreason']=_0xf865('0x114');if(_0x48aa36[_0xf865('0x115')]>=this['voiceQueues'][_0x2dfbd0[_0xf865('0xbc')]]['dialAbandonedMaxRetry']-0x1){this[_0xf865('0x107')](_0x48aa36);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x48aa36[_0xf865('0x115')]+=0x1,'scheduledat':moment()['add'](this[_0xf865('0x20')][_0x2dfbd0[_0xf865('0xbc')]][_0xf865('0x116')],'minutes')['format'](_0xf865('0x103')),'ContactId':_0x38ea81[_0xf865('0x111')],'ListId':_0x38ea81['ListId'],'VoiceQueueId':_0x38ea81['VoiceQueueId']||undefined,'CampaignId':_0x38ea81[_0xf865('0xdb')]||undefined})[_0xf865('0xb9')](loggerCatch('[rescheduleContact][Abandoned]'));}}}}};Dialer['prototype'][_0xf865('0x38')]=function(_0xa81a0f){if(this[_0xf865('0x25')][_0xa81a0f[_0xf865('0xe4')]]){this['actions'][_0xa81a0f[_0xf865('0xe4')]][_0xf865('0x117')]=_0xa81a0f[_0xf865('0x117')];}if(this[_0xf865('0x27')][_0xa81a0f['uniqueid']]){this[_0xf865('0x27')][_0xa81a0f[_0xf865('0xe4')]][_0xf865('0x117')]=_0xa81a0f[_0xf865('0x117')];}};Dialer[_0xf865('0x1c')][_0xf865('0x3c')]=function(_0x5f45c0){if(strategy[this['voiceQueues'][this[_0xf865('0x25')][_0x5f45c0[_0xf865('0x118')]][_0xf865('0xbc')]][_0xf865('0x53')]]==='roundrobin'){if(this[_0xf865('0x25')][_0x5f45c0[_0xf865('0x118')]]&&_[_0xf865('0xe5')](this[_0xf865('0x25')][_0x5f45c0['actionid']]['locked'])&&_0x5f45c0[_0xf865('0xb8')]==='1'&&_0x5f45c0[_0xf865('0x119')]==='0'){if(this[_0xf865('0x21')][_0x5f45c0[_0xf865('0x11a')]]){if(!this[_0xf865('0x21')][_0x5f45c0[_0xf865('0x11a')]]['locked']){this['agents'][_0x5f45c0['stateinterface']]['locked']=!![];this[_0xf865('0x25')][_0x5f45c0[_0xf865('0x118')]]['locked']=!![];this['actions'][_0x5f45c0[_0xf865('0x118')]]['stateinterface']=_0x5f45c0[_0xf865('0x11a')];}}}}else if((strategy[this[_0xf865('0x20')][this[_0xf865('0x25')][_0x5f45c0[_0xf865('0x118')]][_0xf865('0xbc')]]['strategy']]||_0xf865('0x1a'))===_0xf865('0x1a')){if(this['actions'][_0x5f45c0[_0xf865('0x118')]]){if(this['agents'][_0x5f45c0[_0xf865('0x11a')]]){this[_0xf865('0x25')][_0x5f45c0[_0xf865('0x118')]][_0xf865('0x11a')]=_0x5f45c0['stateinterface'];if(_[_0xf865('0xe5')](this[_0xf865('0x2b')][this[_0xf865('0x25')][_0x5f45c0[_0xf865('0x118')]][_0xf865('0xbc')]])){this[_0xf865('0x2b')][this[_0xf865('0x25')][_0x5f45c0[_0xf865('0x118')]][_0xf865('0xbc')]]=[];}this[_0xf865('0x2b')][this[_0xf865('0x25')][_0x5f45c0[_0xf865('0x118')]][_0xf865('0xbc')]][_0xf865('0x11b')](_[_0xf865('0x99')](_[_0xf865('0x11c')](this[_0xf865('0x25')][_0x5f45c0[_0xf865('0x118')]],[_0xf865('0x11d'),_0xf865('0x11a')]),{'status':_0x5f45c0['status'],'paused':_0x5f45c0['paused']}));}}}};function unlockQueueStatus(_0x315747,_0x4400d2){setTimeout(function(){if(_[_0xf865('0x91')](_0x315747[_0xf865('0x11e')])){loggerBooked[_0xf865('0xa0')](_0xf865('0x11f'),_0x4400d2);}_0x315747['queueStatusComplete']=!![];loggerBooked['info'](_0xf865('0x120'),_0x4400d2,JSON[_0xf865('0x4c')](_[_0xf865('0x11c')](_0x315747,['name',_0xf865('0x11e')])));},0x1f3);}Dialer[_0xf865('0x1c')][_0xf865('0x3e')]=function(_0x50933c){var _0x1e0274=this;var _0x41e8e8=_0x1e0274[_0xf865('0x20')][_0x1e0274[_0xf865('0x25')][_0x50933c['actionid']][_0xf865('0xbc')]];if(strategy[this[_0xf865('0x20')][this[_0xf865('0x25')][_0x50933c[_0xf865('0x118')]]['queue']][_0xf865('0x53')]]==='roundrobin'){if(this[_0xf865('0x25')][_0x50933c[_0xf865('0x118')]]&&this[_0xf865('0x25')][_0x50933c[_0xf865('0x118')]][_0xf865('0x11a')]){this[_0xf865('0x9c')][_0xf865('0x121')](this[_0xf865('0x25')][_0x50933c[_0xf865('0x118')]][_0xf865('0x11d')],this[_0xf865('0x25')][_0x50933c[_0xf865('0x118')]][_0xf865('0x11a')])['catch'](function(_0x452ea7){logger['error'](_0xf865('0x122'),util['inspect'](_0x452ea7,{'showHidden':![],'depth':null}));})['finally'](function(){_0x1e0274[_0xf865('0xbb')](_0x1e0274[_0xf865('0x20')][_0x1e0274[_0xf865('0x25')][_0x50933c[_0xf865('0x118')]][_0xf865('0xbc')]]);_0x1e0274['agents'][_0x1e0274[_0xf865('0x25')][_0x50933c[_0xf865('0x118')]][_0xf865('0x11a')]][_0xf865('0x123')]=![];delete _0x1e0274[_0xf865('0x25')][_0x50933c[_0xf865('0x118')]];unlockQueueStatus(_0x41e8e8);});}else{this[_0xf865('0xbb')](this[_0xf865('0x20')][this[_0xf865('0x25')][_0x50933c[_0xf865('0x118')]][_0xf865('0xbc')]]);this[_0xf865('0xc9')]({'active':![],'ContactId':this['actions'][_0x50933c['actionid']][_0xf865('0x111')],'ListId':this[_0xf865('0x25')][_0x50933c[_0xf865('0x118')]]['ListId'],'VoiceQueueId':this['actions'][_0x50933c[_0xf865('0x118')]][_0xf865('0xda')]||undefined,'CampaignId':this['actions'][_0x50933c[_0xf865('0x118')]][_0xf865('0xdb')]||undefined})[_0xf865('0xb9')](loggerCatch(_0xf865('0x124')));delete this['actions'][_0x50933c[_0xf865('0x118')]];unlockQueueStatus(_0x41e8e8);}}else if((strategy[this[_0xf865('0x20')][this[_0xf865('0x25')][_0x50933c[_0xf865('0x118')]][_0xf865('0xbc')]][_0xf865('0x53')]]||_0xf865('0x1a'))===_0xf865('0x1a')){var _0x3ae80a;if(this[_0xf865('0x25')][_0x50933c[_0xf865('0x118')]]&&!_[_0xf865('0x49')](this[_0xf865('0x2b')][this[_0xf865('0x25')][_0x50933c['actionid']][_0xf865('0xbc')]])){if(this[_0xf865('0x2c')][_0x1e0274[_0xf865('0x25')][_0x50933c['actionid']][_0xf865('0xbc')]]){this[_0xf865('0x2c')][_0x1e0274[_0xf865('0x25')][_0x50933c[_0xf865('0x118')]]['queue']]=this[_0xf865('0x2c')][this[_0xf865('0x25')][_0x50933c[_0xf865('0x118')]][_0xf865('0xbc')]]?this[_0xf865('0x2c')][this[_0xf865('0x25')][_0x50933c['actionid']][_0xf865('0xbc')]]:this[_0xf865('0x2b')][this[_0xf865('0x25')][_0x50933c[_0xf865('0x118')]][_0xf865('0xbc')]]?this['queueBooked'][this[_0xf865('0x25')][_0x50933c[_0xf865('0x118')]][_0xf865('0xbc')]][_0xf865('0x125')]||0x0:0x0;}this[_0xf865('0x2b')][this[_0xf865('0x25')][_0x50933c[_0xf865('0x118')]][_0xf865('0xbc')]]['_rr']=this[_0xf865('0x2c')][this[_0xf865('0x25')][_0x50933c[_0xf865('0x118')]][_0xf865('0xbc')]];for(var _0x4c3d96=0x0;_0x4c3d96=0x0?!![]:![];})[_0xf865('0xb9')](myreject(_0x2bb0d9)));}}else{_0x2a6486[_0xf865('0x11b')](ami[_0xf865('0xb7')]({'action':_0xf865('0x138'),'command':util[_0xf865('0x84')](_0xf865('0x13d'),_0x34ceb5,!_[_0xf865('0x91')](config['timezones'][_0x273fde])?_0x273fde:'')})['then'](function(_0x129501){return _0x129501[_0xf865('0x13a')]['indexOf']('true')>=0x0?!![]:![];})[_0xf865('0xb9')](myreject(_0x2bb0d9)));}BPromise[_0xf865('0x13e')](_0x2a6486)['then'](function(_0x55e039){var _0x3b0d6c=_[_0xf865('0x13f')](_0x55e039);if(_0x3b0d6c){return _0x3243cb(_0x3b0d6c);}else{_0x485839[_0xf865('0x41')]=_0x27c3fc?_0xf865('0x140'):'INTERVAL_IS_OVERTIME';return _0x2bb0d9(msgResponse(_0xf865('0x141'),_0xf865('0x133'),'Global:\x20'+_0x27c3fc+'\x20'+_0x438a70+'\x20Interval\x20is\x20overtime:\x20'+util[_0xf865('0xa6')](_0x34ceb5,{'showHidden':![],'depth':null})+_0xf865('0x142')+_0x273fde));}})['catch'](function(_0x1a7292){return _0x2bb0d9(msgResponse(_0xf865('0x131'),_0xf865('0x133'),JSON['stringify'](_0x1a7292)));});});};Dialer['prototype'][_0xf865('0x143')]=function(_0x363c59){var _0x44c5a4=this;return function(){switch(_0x363c59['dialMethod']){case _0xf865('0x144'):freeVariablesPredictive(_0x363c59);_0x44c5a4[_0xf865('0x145')](_0x363c59,0x1);break;case _0xf865('0x146'):freeVariablesPredictive(_0x363c59);_0x44c5a4['handlePower'](_0x363c59,_0x363c59[_0xf865('0x147')]);break;case _0xf865('0x5'):_0x44c5a4[_0xf865('0x5')](_0x363c59);break;case'booked':freeVariablesPredictive(_0x363c59);_0x44c5a4[_0xf865('0x145')](_0x363c59,0x1);break;default:freeVariablesPredictive(_0x363c59);logger['error'](_0xf865('0x148'),_0x363c59[_0xf865('0x42')],_0xf865('0x149'));}};};Dialer[_0xf865('0x1c')][_0xf865('0x14a')]=function(_0x3cee8c){var _0x41c7b7=this;return function(){_0x41c7b7[_0xf865('0x14b')](_0x3cee8c);};};Dialer[_0xf865('0x1c')][_0xf865('0x7')]=function(_0x47b155){var _0x311a3d=this;if(isNotPreview(_0x47b155[_0xf865('0x61')])){if(isVoiceQueueOutbound(_0x47b155['type'])&&isActive(_0x47b155[_0xf865('0x60')])){_0x47b155['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0xf865('0xc1')](checkIsLoggedIn(_0x47b155,_0x47b155[_0xf865('0x56')]))[_0xf865('0xc1')](checkIsActive(_0x47b155,_0x47b155[_0xf865('0x60')]))[_0xf865('0xc1')](checkInterval(_0x47b155))[_0xf865('0xc1')](_0x311a3d[_0xf865('0x14c')](_0x47b155))[_0xf865('0xc1')](_0x311a3d[_0xf865('0x14d')](_0x47b155[_0xf865('0x14e')],_0x47b155[_0xf865('0x14f')],_0x47b155[_0xf865('0x42')],_0x47b155))[_0xf865('0xc1')](_0x311a3d[_0xf865('0x150')](_0x47b155[_0xf865('0x46')],_0x47b155[_0xf865('0x14f')],_0x47b155[_0xf865('0x42')],_0x47b155))[_0xf865('0xc1')](_0x311a3d[_0xf865('0x143')](_0x47b155))[_0xf865('0xb9')](loggerCatchQueueSummary(_0xf865('0x151'),_0x47b155));}else{notSendMessagesQueue(_0x47b155);}}else{freeVariablesPredictive(_0x47b155);}};Dialer[_0xf865('0x1c')][_0xf865('0x12f')]=function(){var _0x85b8c1=this;var _0x4addec;for(var _0x2bcdf1 in this['campaigns']){if(this[_0xf865('0xbd')][_0xf865('0xa3')](_0x2bcdf1)){_0x4addec=this[_0xf865('0xbd')][_0x2bcdf1];if(isCampaignIvr(_0x4addec['type'])&&isActive(_0x4addec[_0xf865('0x80')])){_0x4addec['sendMessageOneNotActive']=!![];BPromise[_0xf865('0xc0')]()[_0xf865('0xc1')](checkIsActive(_0x4addec,_0x4addec[_0xf865('0x80')]))[_0xf865('0xc1')](checkInterval(_0x4addec))[_0xf865('0xc1')](_0x85b8c1[_0xf865('0x14c')](_0x4addec))[_0xf865('0xc1')](_0x85b8c1[_0xf865('0x14d')](_0x4addec[_0xf865('0x14e')],_0x4addec[_0xf865('0x14f')],_0x4addec[_0xf865('0x42')],_0x4addec))[_0xf865('0xc1')](_0x85b8c1[_0xf865('0x150')](_0x4addec[_0xf865('0x46')],_0x4addec[_0xf865('0x14f')],_0x4addec[_0xf865('0x42')],_0x4addec))[_0xf865('0xc1')](_0x85b8c1['launchHandleIvr'](_0x4addec))['catch'](loggerCatchQueueSummary(_0xf865('0x152'),_0x4addec));}else{notSendMessagesCampaign(_0x4addec);}}}};function getCallerIdRandom(_0x347852,_0x16ac70){var _0x39c5db,_0x55c89a,_0x4db49b;if(_0x16ac70<=0x0){_0x16ac70=0x1;}_0x39c5db=new RegExp(_0xf865('0x153')+_0x16ac70+'}$');_0x55c89a=Math[_0xf865('0x154')](0xa,_0x16ac70-0x1);_0x4db49b=Math[_0xf865('0x154')](0xa,_0x16ac70)-0x1;return util['format']('%s',_[_0xf865('0x155')](_0x347852,_0x39c5db,_[_0xf865('0x156')](_0x55c89a,_0x4db49b)));}function extractCalleridName(_0x544df9){var _0x43d62d=_0x544df9[_0xf865('0x157')](/"(.*?)"/);return _0x43d62d?_0x43d62d[0x1]:_0x544df9;}function extractCalleridNumber(_0x37e7af){var _0x373676=_0x37e7af['match'](/<(.*?)>/);return _0x373676?_0x373676[0x1]:_0x37e7af;}Dialer[_0xf865('0x1c')][_0xf865('0x158')]=function(_0x3c5f9e,_0x596e10){var _0x7a5508=this;var _0x3be882=uuid['v4']();this[_0xf865('0x25')][_0x3be882]=new Action(_0x3c5f9e,_0x596e10,_0x3be882);return new BPromise(function(_0x63c4c6,_0x27d475){if(_['isUndefined'](_0x3c5f9e)&&_0xf865('0x159')!==typeof _0x3c5f9e){return _0x27d475(msgResponse('originate',_0xf865('0x133'),_0xf865('0x15a')));}if(_[_0xf865('0x91')](_0x596e10[_0xf865('0x15b')][_0xf865('0x15c')])||_0x596e10[_0xf865('0x15b')][_0xf865('0x15c')]===null){return _0x27d475(msgResponse('originate',_0xf865('0x133'),_0xf865('0x15d')));}var _0x4cad34={'XMD-CALLERID':_0x7a5508[_0xf865('0x25')][_0x3be882][_0xf865('0x15e')](),'XMD-AGI':_0x3c5f9e[_0xf865('0xfa')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x3c5f9e['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x3c5f9e['dialQueueProject2']?util[_0xf865('0x84')](_0xf865('0x15f'),ipAgi,_0x3c5f9e['dialQueueProject2']):_0xf865('0x160'),'XMD-QUEUE':_0x3c5f9e[_0xf865('0x51')]===_0xf865('0x52')?util['format'](_0xf865('0x161'),_0x3c5f9e[_0xf865('0x42')],_0x3c5f9e[_0xf865('0x162')]||'',_0x3c5f9e['dialAgiAfterHangupAgent']?'c':'',_0x3c5f9e[_0xf865('0x10a')]||0x3):'NONE','XMD-CONTACTID':_0x596e10[_0xf865('0x111')],'XMD-CDRTYPE':_0xf865('0x163'),'CALLERID(all)':_0x7a5508[_0xf865('0x25')][_0x3be882][_0xf865('0x15e')](),'XMD-AMD':_0x3c5f9e['dialAMDActive']?_0xf865('0x164'):_0xf865('0x160'),'XMD-DESTINATION':_0xf865('0xe8')};if(_0x3c5f9e[_0xf865('0xe9')]){_0x4cad34[_0xf865('0x165')]=_0x3c5f9e[_0xf865('0x166')]||0x9c4;_0x4cad34['XMD-AMDGREETING']=_0x3c5f9e['dialAMDGreeting']||0x5dc;_0x4cad34['XMD-AMDAFTERGREETINGSILENCE']=_0x3c5f9e[_0xf865('0x167')]||0x320;_0x4cad34['XMD-AMDTOTALANALYSISTIME']=_0x3c5f9e[_0xf865('0x168')]||0x1388;_0x4cad34[_0xf865('0x169')]=_0x3c5f9e[_0xf865('0x16a')]||0x64;_0x4cad34[_0xf865('0x16b')]=_0x3c5f9e[_0xf865('0x16c')]||0x32;_0x4cad34[_0xf865('0x16d')]=_0x3c5f9e[_0xf865('0x16e')]||0x3;_0x4cad34[_0xf865('0x16f')]=_0x3c5f9e[_0xf865('0x170')]||0x100;_0x4cad34[_0xf865('0x171')]=_0x3c5f9e[_0xf865('0x172')]||0x1388;}if(_0x3c5f9e[_0xf865('0x51')]==='outbound'){_0x4cad34[_0xf865('0x173')]=_0x596e10['VoiceQueueId'];}else{_0x4cad34[_0xf865('0x174')]=_0x596e10[_0xf865('0xdb')];}for(var _0x599e22 in _0x596e10[_0xf865('0x15b')]){if(_0x596e10[_0xf865('0x15b')][_0xf865('0xa3')](_0x599e22)){if(isNotNull(_0x596e10[_0xf865('0x15b')][_0x599e22])&&_0x599e22!=='id'&&_0x599e22!==_0xf865('0x175')&&_0x599e22!=='createdAt'&&_0x599e22!==_0xf865('0x176')){_0x4cad34[util[_0xf865('0x84')](_0xf865('0x177'),_0xf865('0x178'),_[_0xf865('0x179')](_0x599e22))]=_0x596e10[_0xf865('0x15b')][_0x599e22];}}}var _0x454a4e=_0x7a5508['isTrunkReachable'](_0x3c5f9e[_0xf865('0x7f')])?getCallerId(_0x3c5f9e[_0xf865('0x7f')]['callerid'],_0x3c5f9e[_0xf865('0x62')],_0x3c5f9e[_0xf865('0x17a')]>0x0?getCallerIdRandom(_0x3c5f9e[_0xf865('0x63')],_0x3c5f9e[_0xf865('0x17a')]):_0x3c5f9e[_0xf865('0x63')]):getCallerId(_[_0xf865('0xe5')](_0x3c5f9e['TrunkBackup'])?_0x3c5f9e[_0xf865('0x7f')][_0xf865('0x81')]:_0x3c5f9e['TrunkBackup'][_0xf865('0x81')],_0x3c5f9e[_0xf865('0x62')],_0x3c5f9e[_0xf865('0x17a')]>0x0?getCallerIdRandom(_0x3c5f9e[_0xf865('0x63')],_0x3c5f9e[_0xf865('0x17a')]):_0x3c5f9e['dialOriginateCallerIdNumber']);if(_0x454a4e){_0x4cad34[_0xf865('0x17b')]=_0x7a5508['actions'][_0x3be882]['originatecalleridname']=extractCalleridName(_0x454a4e);_0x4cad34[_0xf865('0x17c')]=_0x7a5508['actions'][_0x3be882][_0xf865('0x17d')]=extractCalleridNumber(_0x454a4e);}return ami[_0xf865('0xb7')]({'actionid':_0x3be882,'action':_0xf865('0x17e'),'channel':_0x7a5508[_0xf865('0xdf')](_0x3c5f9e[_0xf865('0x7f')])?util[_0xf865('0x84')](_0xf865('0x17f'),_0x3c5f9e['Trunk'][_0xf865('0x42')],isNotNull(_0x3c5f9e[_0xf865('0x65')])?_0x3c5f9e[_0xf865('0x65')][_0xf865('0x180')]()||'':'',_0x3c5f9e[_0xf865('0x181')]>0x0?_0x596e10[_0xf865('0x15b')][_0xf865('0x15c')][_0xf865('0x182')](_0x3c5f9e[_0xf865('0x181')]):_0x596e10[_0xf865('0x15b')][_0xf865('0x15c')]):util[_0xf865('0x84')]('SIP/%s/%s%s',_[_0xf865('0xe5')](_0x3c5f9e[_0xf865('0x183')])?_0x3c5f9e[_0xf865('0x7f')]['name']:_0x3c5f9e[_0xf865('0x183')]['name'],isNotNull(_0x3c5f9e[_0xf865('0x65')])?_0x3c5f9e[_0xf865('0x65')][_0xf865('0x180')]()||'':'',_0x3c5f9e['dialCutDigit']>0x0?_0x596e10[_0xf865('0x15b')][_0xf865('0x15c')]['substring'](_0x3c5f9e[_0xf865('0x181')]):_0x596e10[_0xf865('0x15b')][_0xf865('0x15c')]),'callerid':_0x454a4e,'Exten':_0xf865('0xe8'),'Context':_0xf865('0x184'),'Priority':'1','variable':_0x4cad34,'timeout':(_0x3c5f9e[_0xf865('0x64')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3be882})[_0xf865('0xc1')](function(_0x1ebe41){return _0x63c4c6(_0x1ebe41);})[_0xf865('0xb9')](function(_0x2fa8b6){_0x3c5f9e[_0xf865('0x6d')]+=0x1;var _0x2a7754=new History(_0x7a5508[_0xf865('0x25')][_0x3be882]);logger[_0xf865('0xa0')](util['format'](_0xf865('0x185'),JSON[_0xf865('0x4c')](_0x2fa8b6)));_0x2a7754[_0xf865('0xb2')]=0xe;_0x2a7754['statedesc']=_0xf865('0x186');_0x2a7754[_0xf865('0xb5')]=moment()[_0xf865('0x84')](_0xf865('0x103'));_0x2a7754[_0xf865('0xb4')]=_0x2a7754[_0xf865('0xb5')];_0x7a5508['createHistory'](_0x2a7754)[_0xf865('0xb9')](loggerCatch(_0xf865('0x187')));_0x7a5508[_0xf865('0xd1')](_0x2a7754)[_0xf865('0xb9')](loggerCatch(_0xf865('0x187')))[_0xf865('0x1e')](function(){delete _0x7a5508[_0xf865('0x25')][_0x3be882];return _0x27d475(msgResponse(_0xf865('0x17e'),_0xf865('0x4b'),_0xf865('0x188')));});});});};Dialer[_0xf865('0x1c')]['syncOriginateResponse']=function(_0x3cfb11){var _0x2c1cfb=this[_0xf865('0x25')][_0x3cfb11['actionid']];var _0x10fb1c=this;if(_0x2c1cfb){delete this[_0xf865('0x25')][_0x3cfb11[_0xf865('0x118')]];_0x2c1cfb[_0xf865('0x189')]=moment()[_0xf865('0x84')](_0xf865('0x103'));var _0x2f7d46=_0x2c1cfb[_0xf865('0x51')]===_0xf865('0x83')?this[_0xf865('0xbd')][_0x2c1cfb[_0xf865('0xbc')]]:this[_0xf865('0x20')][_0x2c1cfb[_0xf865('0x18a')]()];if(!this['isSuccess'](_0x3cfb11[_0xf865('0x18b')])){this[_0xf865('0xbb')](_0x2f7d46);return this[_0xf865('0x18c')](_0x2c1cfb,_0x2f7d46,_0x3cfb11)[_0xf865('0xc1')](function(_0x1da4ae){})[_0xf865('0xb9')](loggerCatch(_0xf865('0x18d')));}else{this[_0xf865('0x27')][_0x3cfb11[_0xf865('0xe4')]]=_0x2c1cfb;}}};Dialer['prototype']['checkRetriveMax']=function(_0x3fa131,_0xf320de,_0x310ac5){var _0x32e871=new History(_0xf320de);if(_0x32e871[_0xf865('0x18e')]+_0x32e871['countcongestionretry']+_0x32e871[_0xf865('0x18f')]+_0x32e871[_0xf865('0x190')]+_0x32e871[_0xf865('0x10e')]+_0x32e871['countabandonedretry']+_0x32e871['countmachineretry']+_0x32e871[_0xf865('0x191')]>=_0x310ac5['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x3fa131){case 0x3:if(_0x32e871['countnoanswerretry']>=_0x310ac5[_0xf865('0x192')]-0x1){return!![];}else{this[_0xf865('0xc9')]({'active':![],'countnoanswerretry':_0x32e871[_0xf865('0x18f')]+=0x1,'scheduledat':moment()[_0xf865('0x193')](_0x310ac5[_0xf865('0x194')],_0xf865('0x110'))[_0xf865('0x84')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x32e871[_0xf865('0x111')],'ListId':_0x32e871[_0xf865('0xd8')],'VoiceQueueId':_0x32e871[_0xf865('0xda')]||undefined,'CampaignId':_0x32e871['CampaignId']||undefined})[_0xf865('0xb9')](loggerCatch('[rescheduleContact][NoAnswer]'));}break;case 0x5:if(_0x32e871[_0xf865('0x18e')]>=_0x310ac5[_0xf865('0x195')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countbusyretry':_0x32e871[_0xf865('0x18e')]+=0x1,'scheduledat':moment()[_0xf865('0x193')](_0x310ac5[_0xf865('0x196')],_0xf865('0x110'))[_0xf865('0x84')](_0xf865('0x103')),'ContactId':_0x32e871[_0xf865('0x111')],'ListId':_0x32e871['ListId'],'VoiceQueueId':_0x32e871[_0xf865('0xda')]||undefined,'CampaignId':_0x32e871[_0xf865('0xdb')]||undefined})[_0xf865('0xb9')](loggerCatch(_0xf865('0x197')));}break;case 0x8:if(_0x32e871[_0xf865('0x198')]>=_0x310ac5[_0xf865('0x199')]-0x1){return!![];}else{this[_0xf865('0xc9')]({'active':![],'countcongestionretry':_0x32e871['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x310ac5[_0xf865('0x19a')],_0xf865('0x110'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x32e871['ContactId'],'ListId':_0x32e871['ListId'],'VoiceQueueId':_0x32e871['VoiceQueueId']||undefined,'CampaignId':_0x32e871['CampaignId']||undefined})[_0xf865('0xb9')](loggerCatch(_0xf865('0x19b')));}break;case 0x0:if(_0x32e871[_0xf865('0x190')]>=_0x310ac5['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0xf865('0xc9')]({'active':![],'countnosuchnumberretry':_0x32e871['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xf865('0x193')](_0x310ac5[_0xf865('0x19c')],_0xf865('0x110'))[_0xf865('0x84')](_0xf865('0x103')),'ContactId':_0x32e871[_0xf865('0x111')],'ListId':_0x32e871['ListId'],'VoiceQueueId':_0x32e871[_0xf865('0xda')]||undefined,'CampaignId':_0x32e871[_0xf865('0xdb')]||undefined})['catch'](loggerCatch(_0xf865('0x19d')));}break;case 0xa:if(_0x32e871[_0xf865('0x10e')]>=_0x310ac5[_0xf865('0x10f')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countdropretry':_0x32e871[_0xf865('0x10e')]+=0x1,'scheduledat':moment()[_0xf865('0x193')](_0x310ac5['dialDropRetryFrequency'],_0xf865('0x110'))[_0xf865('0x84')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x32e871[_0xf865('0x111')],'ListId':_0x32e871[_0xf865('0xd8')],'VoiceQueueId':_0x32e871[_0xf865('0xda')]||undefined,'CampaignId':_0x32e871['CampaignId']||undefined})[_0xf865('0xb9')](loggerCatch('[rescheduleContact][Drop]'));}break;case 0xb:if(_0x32e871[_0xf865('0x115')]>=_0x310ac5[_0xf865('0x19e')]-0x1){return!![];}else{this[_0xf865('0xc9')]({'active':![],'countabandonedretry':_0x32e871[_0xf865('0x115')]+=0x1,'scheduledat':moment()[_0xf865('0x193')](_0x310ac5[_0xf865('0x116')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x32e871['ContactId'],'ListId':_0x32e871['ListId'],'VoiceQueueId':_0x32e871[_0xf865('0xda')]||undefined,'CampaignId':_0x32e871[_0xf865('0xdb')]||undefined})[_0xf865('0xb9')](loggerCatch(_0xf865('0x19f')));}break;case 0x13:if(_0x32e871['countmachineretry']>=_0x310ac5[_0xf865('0x1a0')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countmachineretry':_0x32e871[_0xf865('0x1a1')]+=0x1,'scheduledat':moment()[_0xf865('0x193')](_0x310ac5[_0xf865('0x1a2')],_0xf865('0x110'))[_0xf865('0x84')](_0xf865('0x103')),'ContactId':_0x32e871['ContactId'],'ListId':_0x32e871[_0xf865('0xd8')],'VoiceQueueId':_0x32e871[_0xf865('0xda')]||undefined,'CampaignId':_0x32e871['CampaignId']||undefined})[_0xf865('0xb9')](loggerCatch(_0xf865('0x1a3')));}break;case 0x14:if(_0x32e871[_0xf865('0x191')]>=_0x310ac5['dialAgentRejectMaxRetry']-0x1){return!![];}else{this[_0xf865('0xc9')]({'active':![],'countagentrejectretry':_0x32e871[_0xf865('0x191')]+=0x1,'scheduledat':moment()[_0xf865('0x193')](_0x310ac5['dialAgentRejectRetryFrequency'],_0xf865('0x110'))[_0xf865('0x84')](_0xf865('0x103')),'ContactId':_0x32e871[_0xf865('0x111')],'ListId':_0x32e871[_0xf865('0xd8')],'VoiceQueueId':_0x32e871[_0xf865('0xda')]||undefined,'CampaignId':_0x32e871['CampaignId']||undefined})[_0xf865('0xb9')](loggerCatch(_0xf865('0x1a4')));}break;default:return!![];}};Dialer[_0xf865('0x1c')][_0xf865('0x18c')]=function(_0x4b7ec4,_0x5cc8d6,_0x343df7){var _0x2b41ff=this;var _0x329533=new History(_0x4b7ec4);return new BPromise(function(_0x423726,_0x46aa99){if(_[_0xf865('0x91')](_0x5cc8d6)&&_0xf865('0x159')!==typeof _0x5cc8d6){return _0x46aa99(msgResponse(_0xf865('0x1a5'),_0xf865('0x133'),_0xf865('0x1a6')));}if(_['isUndefined'](_0x343df7)&&'object'!==typeof _0x343df7){return _0x46aa99(msgResponse(_0xf865('0x1a5'),_0xf865('0x133'),_0xf865('0x1a7')));}switch(_0x343df7[_0xf865('0x1a8')]){case'0':_0x5cc8d6[_0xf865('0x1a9')]+=0x1;_0x329533['state']=0x0;_0x329533[_0xf865('0xb3')]=_0xf865('0x1aa');_0x2b41ff['createHistory'](_0x329533)[_0xf865('0xb9')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2b41ff[_0xf865('0x1ab')](0x0,_0x4b7ec4,_0x5cc8d6)){if(_0x329533[_0xf865('0x18e')]+_0x329533[_0xf865('0x198')]+_0x329533[_0xf865('0x18f')]+_0x329533[_0xf865('0x190')]+_0x329533[_0xf865('0x10e')]+_0x329533['countabandonedretry']+_0x329533[_0xf865('0x1a1')]+_0x329533[_0xf865('0x191')]>=_0x5cc8d6['dialGlobalMaxRetry']){_0x2b41ff['stateGlobal'](_0x329533,_0x423726,_0x46aa99,_0xf865('0x1ac'));}else{_0x2b41ff[_0xf865('0x1ad')](_0x329533,_0x423726,_0x46aa99,_0xf865('0x1ac'));}}break;case'3':_0x5cc8d6['outboundNoAnswerCallsDay']+=0x1;_0x329533[_0xf865('0xb2')]=0x3;_0x329533['statedesc']=_0xf865('0x1ae');_0x329533[_0xf865('0x18f')]+=0x1;_0x329533[_0xf865('0x1af')]+=0x1;_0x2b41ff[_0xf865('0xd2')](_0x329533)[_0xf865('0xb9')](loggerCatch(_0xf865('0x1b0')));if(_0x2b41ff[_0xf865('0x1ab')](0x3,_0x4b7ec4,_0x5cc8d6)){if(_0x329533[_0xf865('0x18f')]>=_0x5cc8d6[_0xf865('0x192')]){_0x2b41ff[_0xf865('0x1ad')](_0x329533,_0x423726,_0x46aa99,_0xf865('0x1b1'));}else{_0x2b41ff[_0xf865('0x1b2')](_0x329533,_0x423726,_0x46aa99,_0xf865('0x1b1'));}}break;case'5':_0x5cc8d6[_0xf865('0x68')]+=0x1;_0x329533[_0xf865('0xb2')]=0x5;_0x329533[_0xf865('0xb3')]=_0xf865('0x1b3');_0x329533[_0xf865('0x18e')]+=0x1;_0x329533[_0xf865('0x1af')]+=0x1;_0x2b41ff[_0xf865('0xd2')](_0x329533)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x2b41ff[_0xf865('0x1ab')](0x5,_0x4b7ec4,_0x5cc8d6)){if(_0x329533[_0xf865('0x18e')]>=_0x5cc8d6[_0xf865('0x195')]){_0x2b41ff['createStateFinal'](_0x329533,_0x423726,_0x46aa99,_0xf865('0x1b4'));}else{_0x2b41ff[_0xf865('0x1b2')](_0x329533,_0x423726,_0x46aa99,'reason\x205\x20busy');}}break;case'8':_0x5cc8d6[_0xf865('0x69')]+=0x1;_0x329533[_0xf865('0xb2')]=0x8;_0x329533[_0xf865('0xb3')]=_0xf865('0x1b5');_0x329533[_0xf865('0x198')]+=0x1;_0x329533[_0xf865('0x1af')]+=0x1;_0x2b41ff[_0xf865('0xd2')](_0x329533)[_0xf865('0xb9')](loggerCatch(_0xf865('0x1b6')));if(_0x2b41ff[_0xf865('0x1ab')](0x8,_0x4b7ec4,_0x5cc8d6)){if(_0x329533[_0xf865('0x198')]>=_0x5cc8d6['dialCongestionMaxRetry']){_0x2b41ff['createStateFinal'](_0x329533,_0x423726,_0x46aa99,'reason\x208\x20congestion');}else{_0x2b41ff[_0xf865('0x1b2')](_0x329533,_0x423726,_0x46aa99,_0xf865('0x1b7'));}}break;case'11':_0x5cc8d6[_0xf865('0x1b8')]+=0x1;_0x329533[_0xf865('0xb2')]=0xb;_0x329533[_0xf865('0xb3')]='Abandoned';_0x329533[_0xf865('0x115')]+=0x1;_0x329533[_0xf865('0x1af')]+=0x1;_0x2b41ff['createHistory'](_0x329533)[_0xf865('0xb9')](loggerCatch(_0xf865('0x1b9')));if(_0x2b41ff[_0xf865('0x1ab')](0xb,_0x4b7ec4,_0x5cc8d6)){if(_0x329533['countabandonedretry']>=_0x5cc8d6[_0xf865('0x19e')]){_0x2b41ff[_0xf865('0x1ad')](_0x329533,_0x423726,_0x46aa99,_0xf865('0x1ba'));}else{_0x2b41ff[_0xf865('0x1b2')](_0x329533,_0x423726,_0x46aa99,_0xf865('0x1ba'));}}break;case'20':_0x5cc8d6[_0xf865('0x6f')]+=0x1;_0x329533[_0xf865('0xb2')]=0x14;_0x329533[_0xf865('0xb3')]=_0xf865('0x1bb');_0x329533[_0xf865('0x191')]+=0x1;_0x329533[_0xf865('0x1af')]+=0x1;_0x2b41ff[_0xf865('0xd2')](_0x329533)[_0xf865('0xb9')](loggerCatch(_0xf865('0x1bc')));if(_0x2b41ff['checkRetriveMax'](0x14,_0x4b7ec4,_0x5cc8d6)){if(_0x329533[_0xf865('0x191')]>=_0x5cc8d6[_0xf865('0x1bd')]){_0x2b41ff[_0xf865('0x1ad')](_0x329533,_0x423726,_0x46aa99,_0xf865('0x1be'));}else{_0x2b41ff[_0xf865('0x1b2')](_0x329533,_0x423726,_0x46aa99,'reason\x2020\x20agentreject');}}break;default:_0x5cc8d6[_0xf865('0x70')]+=0x1;_0x329533['state']=0xc;_0x329533[_0xf865('0xb3')]=_0x343df7[_0xf865('0x1a8')];_0x2b41ff[_0xf865('0xd2')](_0x329533)[_0xf865('0xb9')](loggerCatch(_0xf865('0x1bf')));if(_0x2b41ff['checkRetriveMax'](_0x343df7[_0xf865('0x1a8')],_0x4b7ec4,_0x5cc8d6)){if(_0x329533['countbusyretry']+_0x329533[_0xf865('0x198')]+_0x329533[_0xf865('0x18f')]+_0x329533['countnosuchnumberretry']+_0x329533['countdropretry']+_0x329533[_0xf865('0x115')]+_0x329533['countmachineretry']+_0x329533[_0xf865('0x191')]>=_0x5cc8d6[_0xf865('0x1c0')]){_0x2b41ff[_0xf865('0x1b2')](_0x329533,_0x423726,_0x46aa99,_0x343df7['reason']);}else{_0x2b41ff[_0xf865('0x1ad')](_0x329533,_0x423726,_0x46aa99,_0x343df7[_0xf865('0x1a8')]);}}}});};Dialer[_0xf865('0x1c')]['stateGlobal']=function(_0x303a32,_0x1efe96,_0xafa6e0,_0x54938c){var _0x2d45c0=new Final(_0x303a32);_0x2d45c0[_0xf865('0xb2')]=0xf;_0x2d45c0[_0xf865('0xb3')]='Global';this[_0xf865('0x1ad')](_0x2d45c0,_0x1efe96,_0xafa6e0,_0x54938c);};Dialer['prototype']['createStateFinal']=function(_0x5d6f0f,_0xe21e29,_0x5270f2,_0x3ae187){this[_0xf865('0xd1')](_0x5d6f0f)[_0xf865('0xc1')](function(_0x31c799){return _0xe21e29(msgResponse(_0xf865('0x1a5'),_0xf865('0xde'),_0x3ae187));})[_0xf865('0xb9')](function(_0x1c765e){return _0x5270f2(msgResponse(_0xf865('0x1c1'),_0xf865('0x133'),'contact\x20not\x20moved'));});};Dialer[_0xf865('0x1c')]['predictive']=function(_0x105448){var _0x419c31=this;var _0x3e4a21=_0x105448[_0xf865('0x1c2')]/0x64;var _0x27490a=_0x105448[_0xf865('0x6b')]/(_0x105448[_0xf865('0x6b')]+_0x105448['outboundAnswerCallsDay']);var _0x36a258=Math['round'](_0x105448['predictiveIntervalAvailable']*(_0x105448[_0xf865('0x1c3')]/0x64));var _0x34b1d0=Math[_0xf865('0x1c4')](_0x105448[_0xf865('0x7a')]*(_0x105448[_0xf865('0x1c5')]/0x64));var _0xf8e2e9=_0x105448[_0xf865('0x55')]+_0x105448[_0xf865('0x5b')];var _0x4fcb30=Math['floor'](_0x105448['erlangCalls']*_0x105448[_0xf865('0x7d')]*_0x105448['predictiveIntervalHitRate']*_0x105448[_0xf865('0x78')]);if(_[_0xf865('0x91')](_0x105448['startProgressive'])){if(!_[_0xf865('0x91')](_0x105448[_0xf865('0x28')])){_0x105448['startPredictive']=undefined;loggerPredictive[_0xf865('0xa0')]('[startMethodPredictive][StartProgressive]',_0xf865('0x1c6'));}if(!_[_0xf865('0x91')](_0x105448[_0xf865('0x9b')])){loggerPredictive[_0xf865('0xa0')](_0xf865('0x1c7'),_0xf865('0x1c8'));clearInterval(_0x105448[_0xf865('0x9b')]);_0x105448['handlePredictive']=undefined;}_0x105448[_0xf865('0x29')]=moment()[_0xf865('0x84')](_0xf865('0x103'));loggerPredictive[_0xf865('0x88')](_0x105448[_0xf865('0x42')],_0xf865('0x1c9'),_0x105448['startProgressive']);this[_0xf865('0x145')](_0x105448,0x1);}else if(ifInterval(_0x105448[_0xf865('0x1ca')],_0x105448[_0xf865('0x29')])){this[_0xf865('0x145')](_0x105448,0x1);loggerPredictiveCalls[_0xf865('0x88')]('[startMethodPredictive][StartProgressive][Loop]',_0x105448[_0xf865('0x29')],_0x105448[_0xf865('0x42')]);_0x105448[_0xf865('0x7c')]=0x0;_0x105448[_0xf865('0x76')]=0x0;}else if(_0x3e4a21<_0x27490a&&_0x105448[_0xf865('0x1cb')]===_0xf865('0x1cc')){freeVariablesPredictive(_0x105448);loggerPredictive[_0xf865('0x88')](_0xf865('0x1cd'),'Dropped\x20calls\x20day',_0x27490a,_0xf865('0x29'),_0x105448[_0xf865('0x42')]);}else if(_0x4fcb30<_0x105448[_0xf865('0x76')]&&_0x105448[_0xf865('0x1cb')]===_0xf865('0x1cc')){freeVariablesPredictive(_0x105448);loggerPredictive[_0xf865('0x88')](_0xf865('0x1ce'),_0xf865('0x1cf'),_0x4fcb30,'Drop\x20in\x20this\x20interval',_0x105448[_0xf865('0x76')],'startProgressive',_0x105448[_0xf865('0x42')]);}else if(!ifInterval(_0x105448[_0xf865('0x1ca')],_0x105448[_0xf865('0x29')])&&_['isUndefined'](_0x105448[_0xf865('0x28')])&&!_['isUndefined'](_0x105448[_0xf865('0x29')])){_0x105448[_0xf865('0x28')]=moment()[_0xf865('0x84')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x105448[_0xf865('0x42')],_0xf865('0x1d0'),_0x105448[_0xf865('0x28')]);this[_0xf865('0xc6')](_0x105448['dialPredictiveInterval'])[_0xf865('0xc1')](this[_0xf865('0x1d1')](_0x105448))[_0xf865('0xc1')](mergeDataErlangB(_0x105448))[_0xf865('0xc1')](this[_0xf865('0x1d2')](_0x105448))[_0xf865('0xb9')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x105448));}else if(!ifInterval(_0x105448['dialPredictiveInterval'],_0x105448[_0xf865('0x28')])){_0x105448['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x105448[_0xf865('0x28')]=moment()[_0xf865('0x84')](_0xf865('0x103'));loggerPredictive[_0xf865('0x88')](_0x105448[_0xf865('0x42')],_0xf865('0x1d3'),_0x105448[_0xf865('0x28')]);clearInterval(_0x105448[_0xf865('0x9b')]);_0x105448[_0xf865('0x9b')]=undefined;this[_0xf865('0xc6')](_0x105448['dialPredictiveInterval'])[_0xf865('0xc1')](this['getDataPredictive'](_0x105448))['then'](mergeDataErlangB(_0x105448))[_0xf865('0xc1')](this[_0xf865('0x1d2')](_0x105448))[_0xf865('0xb9')](loggerCatchPredictive(_0xf865('0x1d4'),_0x105448));}else if(_0x105448['predictiveIntervalAvailable']&&_0xf8e2e9<_0x105448[_0xf865('0x7a')]-_0x34b1d0){freeVariablesPredictive(_0x105448);loggerPredictive[_0xf865('0x88')](_0x105448[_0xf865('0x42')],_0xf865('0x1d5'),_0xf8e2e9,_0xf865('0x1d6'),_0x105448[_0xf865('0x7a')],'-',_0x34b1d0,'=',_0x105448[_0xf865('0x7a')]-_0x34b1d0,')');}else if(_0x105448[_0xf865('0x7a')]&&_0xf8e2e9>_0x105448[_0xf865('0x7a')]+_0x36a258){freeVariablesPredictive(_0x105448);loggerPredictive[_0xf865('0x88')](_0x105448[_0xf865('0x42')],_0xf865('0x1d5'),_0xf8e2e9,')\x20are\x20more\x20than\x20threshold\x20(',_0x105448[_0xf865('0x7a')],'+',_0x36a258,'=',_0x105448[_0xf865('0x7a')]+_0x36a258,')');}};Dialer[_0xf865('0x1c')]['getDataPredictive']=function(_0x4236af){var _0x1b8e99=this;return function(_0x3c92ca){return new BPromise(function(_0x45b65c,_0x13dc6b){_['merge'](_0x4236af,_0x3c92ca[0x0]);if(checkGetDataPredictive(_0x3c92ca[0x0])){var _0x563da2=_0x4236af[_0xf865('0x7a')]=_0x4236af[_0xf865('0x5b')]+_0x4236af[_0xf865('0x55')];var _0x15adac=_0x4236af[_0xf865('0x1ca')]*0x3c;var _0x336d97=_0x3c92ca[0x0]['predictiveIntervalAvgTalktime']+_0x3c92ca[0x0][_0xf865('0x72')];var _0xce594f=(_0x3c92ca[0x0]['predictiveIntervalAnsweredCalls']+_0x3c92ca[0x0][_0xf865('0x74')]+_0x3c92ca[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x3c92ca[0x0][_0xf865('0x7b')];_0x4236af[_0xf865('0x77')]=_0xce594f>0x0?_0xce594f:0x1;switch(_0x4236af[_0xf865('0x1cb')]){case _0xf865('0x1cc'):var _0x34e627=_0x4236af['dialPredictiveOptimizationPercentage']/0x64;return _0x1b8e99[_0xf865('0x1d7')](_0x563da2,_0x15adac,_0x336d97,_0xce594f,_0x34e627)['then'](function(_0x453e0e){return _0x45b65c(_0x453e0e);});case _0xf865('0x1d8'):var _0x1c80f9=_0x4236af[_0xf865('0x1c2')]/0x64;return _0x1b8e99[_0xf865('0x1d9')](_0x563da2,_0x15adac,_0x336d97,_0xce594f,_0x1c80f9)[_0xf865('0xc1')](function(_0x517dff){return _0x45b65c(_0x517dff);});default:return _0x13dc6b(msgResponse('[getDataPredictive]',_0xf865('0x133'),'Unknown\x20Predictive'));}}else{return _0x13dc6b(msgResponse(_0xf865('0x1da'),_0xf865('0x133'),_0xf865('0x1db')));}});};};Dialer[_0xf865('0x1c')]['getDataPredictiveOld']=function(_0x507d26){var _0x6b68c6=this;return function(_0x23f2dd){return new BPromise(function(_0x501709,_0x329460){_[_0xf865('0x99')](_0x507d26,_0x23f2dd[0x0]);if(checkGetDataPredictive(_0x23f2dd[0x0])){loggerPredictive['info'](JSON['stringify'](_0x23f2dd[0x0]));if(_0x507d26[_0xf865('0x1cb')]===_0xf865('0x1cc')){return _0x6b68c6[_0xf865('0xcf')](_0x507d26['id'])[_0xf865('0xc1')](function(_0x1069a2){var _0x46b443=_0x507d26[_0xf865('0x56')]-_0x1069a2[0x0][_0xf865('0x1dc')];var _0x106817=_0x507d26[_0xf865('0x1ca')]*0x3c;var _0x2848b3=_0x23f2dd[0x0]['predictiveIntervalAvgTalktime']+_0x23f2dd[0x0][_0xf865('0x72')];var _0x40670f=(_0x23f2dd[0x0]['predictiveIntervalAnsweredCalls']+_0x23f2dd[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x23f2dd[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x23f2dd[0x0]['predictiveIntervalTotalCalls'];var _0x1843a0=_0x507d26[_0xf865('0x1c2')]/0x64;_0x507d26[_0xf865('0x79')]=_0x1069a2[0x0]['outboundQueuePauses']||0x0;_0x507d26[_0xf865('0x77')]=_0x40670f>0x0?_0x40670f:0x1;return _0x6b68c6[_0xf865('0x1d7')](_0x46b443,_0x106817,_0x2848b3,_0x40670f,_0x1843a0);})[_0xf865('0xc1')](function(_0x11ebff){return _0x501709(_0x11ebff);})['catch'](function(_0x57d37f){return _0x329460(msgResponse(_0xf865('0x1dd'),_0xf865('0x133'),JSON['stringify'](_0x57d37f)));});}if(_0x507d26[_0xf865('0x1cb')]===_0xf865('0x1d8')){return _0x6b68c6[_0xf865('0xcf')](_0x507d26['id'])['then'](function(_0x4115b2){var _0xd159af=_0x507d26[_0xf865('0x56')]-_0x4115b2[0x0][_0xf865('0x1dc')];var _0x60b32d=_0x507d26[_0xf865('0x1ca')]*0x3c;var _0x36509a=_0x23f2dd[0x0]['predictiveIntervalAvgTalktime']+_0x23f2dd[0x0][_0xf865('0x72')];var _0x5797f0=(_0x23f2dd[0x0]['predictiveIntervalAnsweredCalls']+_0x23f2dd[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x23f2dd[0x0][_0xf865('0x8d')])/_0x23f2dd[0x0][_0xf865('0x7b')];var _0x29a15a=_0x507d26[_0xf865('0x1c2')]/0x64;_0x507d26[_0xf865('0x79')]=_0x4115b2[0x0][_0xf865('0x1dc')]||0x0;_0x507d26['predictiveIntervalHitRate']=_0x5797f0>0x0?_0x5797f0:0x1;return _0x6b68c6[_0xf865('0x1d9')](_0xd159af,_0x60b32d,_0x36509a,_0x5797f0,_0x29a15a);})[_0xf865('0xc1')](function(_0x30bdfb){return _0x501709(_0x30bdfb);})['catch'](function(_0x1eb172){return _0x329460(msgResponse(_0xf865('0x1dd'),_0xf865('0x133'),JSON['stringify'](_0x1eb172)));});}}else{return _0x329460(msgResponse(_0xf865('0x1da'),'Failure',_0xf865('0x1db')));}});};};Dialer[_0xf865('0x1c')][_0xf865('0x1d2')]=function(_0x431843){var _0x21c40d=this;return function(){var _0x569b32=0x0;var _0x64439b=Math[_0xf865('0x1de')](_0x431843['erlangCallToSecond']*0x3e8);if(_0x64439b>0x0){_0x64439b=_0x64439b<0x64?0x64:_0x64439b;loggerPredictive[_0xf865('0x88')](_0x431843['name'],_0xf865('0x1df'),_0x64439b,_0xf865('0x4d'));_0x431843[_0xf865('0x9b')]=setInterval(function(){_0x21c40d[_0xf865('0x9b')](_0x431843);loggerPredictiveCalls[_0xf865('0x88')](_0xf865('0x1e0'),_0x569b32+=0x1);},_0x64439b);}else{loggerPredictive[_0xf865('0x88')](_0x431843[_0xf865('0x42')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype']['checkContactBlack']=function(_0x53edfa,_0x4086e1){var _0x58d09e=this;return function(_0x4f6203){if(_['isEmpty'](_0x4f6203)){if(_[_0xf865('0xe5')](_0x4086e1[_0xf865('0xd9')])||!_0x4086e1[_0xf865('0x1e1')]){if(_0x53edfa['dialMethod']===_0xf865('0x4')){_0x53edfa[_0xf865('0x11e')]=_[_0xf865('0x91')](_0x53edfa['queueStatusComplete'])?!![]:_0x53edfa[_0xf865('0x11e')];var _0x382d6c=uuid['v4']();_0x58d09e[_0xf865('0x25')][_0x382d6c]=new Action(_0x53edfa,_0x4086e1,_0x382d6c);loggerBooked[_0xf865('0x88')]('[booked][checkContactBlack]',_0x382d6c,_0xf865('0x1e2'),JSON[_0xf865('0x4c')](_0x53edfa['queueStatusComplete']),_0xf865('0x1e3'),_0x53edfa[_0xf865('0x42')]);if(_0x53edfa['queueStatusComplete']){_0x53edfa[_0xf865('0x11e')]=![];_0x58d09e[_0xf865('0x2b')][_0x58d09e[_0xf865('0x25')][_0x382d6c]['queue']]=[];ami['Action']({'actionid':_0x382d6c,'action':'queuestatus','queue':_0x53edfa[_0xf865('0x42')]})['catch'](function(_0x3e5583){_0x58d09e[_0xf865('0xbb')](_0x53edfa);_0x58d09e[_0xf865('0xc9')]({'active':![],'ContactId':_0x58d09e['actions'][_0x382d6c][_0xf865('0x111')],'ListId':_0x58d09e['actions'][_0x382d6c]['ListId'],'VoiceQueueId':_0x58d09e[_0xf865('0x25')][_0x382d6c]['VoiceQueueId']||undefined,'CampaignId':_0x58d09e['actions'][_0x382d6c][_0xf865('0xdb')]||undefined})['catch'](loggerCatch(_0xf865('0x1e4')));delete _0x58d09e['actions'][_0x382d6c];});}else{loggerBooked[_0xf865('0x88')](_0xf865('0x1e5'),JSON['stringify'](_0x53edfa[_0xf865('0x11e')]),_0xf865('0x1e3'),_0x53edfa['name']);_0x58d09e[_0xf865('0xbb')](_0x53edfa);_0x58d09e[_0xf865('0xc9')]({'active':![],'ContactId':_0x58d09e['actions'][_0x382d6c][_0xf865('0x111')],'ListId':_0x58d09e[_0xf865('0x25')][_0x382d6c][_0xf865('0xd8')],'VoiceQueueId':_0x58d09e[_0xf865('0x25')][_0x382d6c][_0xf865('0xda')]||undefined,'CampaignId':_0x58d09e[_0xf865('0x25')][_0x382d6c][_0xf865('0xdb')]||undefined})[_0xf865('0xb9')](loggerCatch(_0xf865('0x1e4')));delete _0x58d09e[_0xf865('0x25')][_0x382d6c];}}else{return _0x58d09e[_0xf865('0x158')](_0x53edfa,_0x4086e1);}}else{if(getDiff(_0x4086e1[_0xf865('0x1e6')])<_0x53edfa[_0xf865('0x1e7')]*0x3c){if(_0x4086e1[_0xf865('0x1e8')]&&!_0x4086e1[_0xf865('0x1e8')]['voicePause']){_0x58d09e[_0xf865('0x9c')][_0xf865('0x121')](_0x4086e1['id'])[_0xf865('0x1e')](function(){_0x58d09e[_0xf865('0xbb')](_0x53edfa);});}else{_0x58d09e['unlockContact']({'active':![]},_0x4086e1['id'],0x1)[_0xf865('0x1e')](function(){console[_0xf865('0x1e9')](_0xf865('0x1ea'));_0x58d09e['updateOriginated'](_0x53edfa);});}}else{_0x53edfa[_0xf865('0x6e')]+=0x1;_0x58d09e['updateOriginated'](_0x53edfa);if(_0x53edfa['dialRecallInQueue']){_0x58d09e['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4086e1['ContactId'],'ListId':_0x4086e1['ListId'],'VoiceQueueId':_0x4086e1[_0xf865('0xda')]||undefined,'CampaignId':_0x4086e1['CampaignId']||undefined})[_0xf865('0xb9')](loggerCatch(_0xf865('0x1eb')));_0x58d09e[_0xf865('0xd2')](createObjHistory(_0x53edfa,_0x4086e1,_0xf865('0x1ec'),0x17,_0xf865('0x1ed')))['catch'](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x58d09e[_0xf865('0xe3')](createObjHistory(_0x53edfa,_0x4086e1,_0xf865('0x1ee'),0x16,_0xf865('0x1ef')),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x53edfa[_0xf865('0x67')]+=0x1;_0x58d09e[_0xf865('0xe3')](createObjHistory(_0x53edfa,_0x4086e1,'BLACKLIST',0xd,_0xf865('0x1f0')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw _0xf865('0x1f1');}};};Dialer[_0xf865('0x1c')][_0xf865('0x14b')]=function(_0x3435cd){var _0x343d2b=this;var _0x1d2369=[];var _0x194da3=_0x3435cd[_0xf865('0x1f2')]-_0x3435cd[_0xf865('0xa4')]-_0x3435cd[_0xf865('0x1f3')];emitCampaignSummary(_0x3435cd);if(_0x194da3>0x0){if(_0x194da3>this[_0xf865('0x23')]){_0x194da3=this[_0xf865('0x23')];}_0x3435cd['temp']+=_0x194da3;this['getContactDialerIvr'](_0x3435cd['id'],_0x194da3,_0x3435cd[_0xf865('0x1f4')])['then'](function(_0x55a342){_0x3435cd[_0xf865('0x1f3')]-=_0x194da3;_0x3435cd[_0xf865('0x1f3')]=_0x3435cd[_0xf865('0x1f3')]>0x0?_0x3435cd[_0xf865('0x1f3')]:0x0;if(!checkContactEmpty(_0x55a342)){_0x3435cd[_0xf865('0x41')]='AVAILABLE_CONTACTS_FINISHED';logger['info']('[getContactCampaign2][Empty]'+_0x3435cd['name']);}else{_0x3435cd[_0xf865('0xa4')]+=_0x55a342[_0xf865('0xa2')];_0x3435cd[_0xf865('0x41')]=_0xf865('0x1f5');for(var _0x2aa50f=0x0;_0x2aa50f<_0x55a342[_0xf865('0xa2')];_0x2aa50f+=0x1){_0x3435cd[_0xf865('0x1f6')]+=0x1;if(_[_0xf865('0xe5')](_0x55a342[_0x2aa50f])||_['isNil'](_0x55a342[_0x2aa50f][_0xf865('0x15b')])||_[_0xf865('0xe5')](_0x55a342[_0x2aa50f][_0xf865('0x15b')][_0xf865('0x15c')])){_0x343d2b[_0xf865('0xd6')](_0xf865('0x1f7'),_0x3435cd,_0x55a342[_0x2aa50f]);}else{_0x343d2b['checkIsBlackListIvr'](_[_0xf865('0x11c')](_0x55a342[_0x2aa50f],[_0xf865('0xdb'),_0xf865('0x1f8')]))[_0xf865('0xc1')](_0x343d2b['checkContactBlack'](_0x3435cd,_0x55a342[_0x2aa50f]))['catch'](_0x343d2b[_0xf865('0xd5')](_0xf865('0x1f9'),_0x3435cd));}}}})[_0xf865('0xb9')](loggerGetContactDialer(_0xf865('0x1fa'),_0x3435cd,_0x194da3));}};Dialer[_0xf865('0x1c')][_0xf865('0x145')]=function(_0xea32bb,_0x964781){var _0x379233=this;var _0x2596b1=[];var _0x3dbca0=_0x964781>=0x1?_0x964781:0x1;var _0x178313=[];if(_0xea32bb[_0xf865('0x61')]===_0xf865('0x4')){_0x3dbca0=0x1;}var _0x1f6ac0=Math[_0xf865('0x1de')](_0xea32bb[_0xf865('0x55')]*_0x3dbca0)-_0xea32bb[_0xf865('0xa4')]-_0xea32bb[_0xf865('0x1f3')];emitVoiceQueueSummary(_0xea32bb);if(_0xea32bb[_0xf865('0x1fb')]>0x0){var _0x3c7bff=_0xea32bb[_0xf865('0x1fb')]-_0xea32bb[_0xf865('0xa4')]-_0xea32bb[_0xf865('0x5b')]-_0xea32bb[_0xf865('0x1f3')]-_0xea32bb[_0xf865('0x57')];if(_0x1f6ac0>_0x3c7bff){_0x1f6ac0=_0x3c7bff;}}if(_0x1f6ac0>0x0){if(_0xea32bb[_0xf865('0x61')]==='booked'){_0x1f6ac0=0x1;}if(_0x1f6ac0>this[_0xf865('0x23')]){_0x1f6ac0=this[_0xf865('0x23')];}_0xea32bb['temp']+=_0x1f6ac0;for(var _0x1ee500 in this[_0xf865('0x21')]){if(this[_0xf865('0x21')][_0xf865('0xa3')](_0x1ee500)){if(this[_0xf865('0x21')][_0x1ee500][_0xf865('0xb2')]===_0xf865('0x1fc')&&this['agents'][_0x1ee500][_0xf865('0xb8')]===_0xf865('0xe1')){_0x2596b1['push'](this[_0xf865('0x21')][_0x1ee500]['id']);}}}this[_0xf865('0xcc')](_0xea32bb['id'],_0x2596b1,_0x1f6ac0,_0xea32bb[_0xf865('0x1f4')])[_0xf865('0xc1')](function(_0x566d8f){_0xea32bb['temp']-=_0x1f6ac0;_0xea32bb[_0xf865('0x1f3')]=_0xea32bb['temp']>0x0?_0xea32bb['temp']:0x0;if(!checkContactEmpty(_0x566d8f)){_0x379233[_0xf865('0xbf')](_0xea32bb)[_0xf865('0xc1')](sendMessageReschedule(_0xea32bb))['catch'](loggerCatch(_0xf865('0x1fd')));}else{_0xea32bb[_0xf865('0xa4')]+=_0x566d8f[_0xf865('0xa2')];_0xea32bb[_0xf865('0x41')]=_0xea32bb['dialMethod']===_0xf865('0x4')?_0xf865('0x164'):'RUNNING';for(var _0x20f02d=0x0;_0x20f02d<_0x566d8f[_0xf865('0xa2')];_0x20f02d+=0x1){if(_[_0xf865('0xe5')](_0x566d8f[_0x20f02d])||_[_0xf865('0xe5')](_0x566d8f[_0x20f02d][_0xf865('0x15b')])||_[_0xf865('0xe5')](_0x566d8f[_0x20f02d][_0xf865('0x15b')][_0xf865('0x15c')])){_0x379233[_0xf865('0xd6')]('[actionOriginate]\x20',_0xea32bb,_0x566d8f[_0x20f02d]);}else{_0x379233[_0xf865('0xc2')](_[_0xf865('0x11c')](_0x566d8f[_0x20f02d],[_0xf865('0xda'),_0xf865('0x1f8')]))['then'](_0x379233[_0xf865('0x1fe')](_0xea32bb,_0x566d8f[_0x20f02d]))[_0xf865('0xb9')](_0x379233[_0xf865('0xd5')](_0xf865('0x1f7'),_0xea32bb));}}}})[_0xf865('0xb9')](loggerGetContactDialer(_0xf865('0x1ff'),_0xea32bb,_0x1f6ac0));}};Dialer[_0xf865('0x1c')][_0xf865('0x9b')]=function(_0x3540c9){var _0x38224b=this;if(_0x3540c9[_0xf865('0x1fb')]>0x0){var _0x5ce257=_0x3540c9['dialLimitQueue']-_0x3540c9['originated']-_0x3540c9[_0xf865('0x5b')];if(_0x5ce257>0x0){this[_0xf865('0x200')](_0x3540c9);}else{loggerPredictiveCalls[_0xf865('0x88')]('[handlePredictive][limitChannel]');}}else{this[_0xf865('0x200')](_0x3540c9);}};Dialer[_0xf865('0x1c')][_0xf865('0x200')]=function(_0x7c26d7){var _0x3a0057=this;var _0xd72c91=[];_0x7c26d7[_0xf865('0xa4')]+=0x1;for(var _0xa95a6c in this[_0xf865('0x21')]){if(this[_0xf865('0x21')][_0xf865('0xa3')](_0xa95a6c)){if(this['agents'][_0xa95a6c]['state']===_0xf865('0x1fc')&&this['agents'][_0xa95a6c][_0xf865('0xb8')]===_0xf865('0xe1')){_0xd72c91[_0xf865('0x11b')](this[_0xf865('0x21')][_0xa95a6c]['id']);}}}this['getContactDialer'](_0x7c26d7['id'],_0xd72c91,0x1,_0x7c26d7['dialOrderByScheduledAt'])['then'](function(_0x1a579a){if(!checkContactEmpty(_0x1a579a)){checkContactLowerLimitOriginate(_0x7c26d7,0x1,0x0);_0x3a0057[_0xf865('0xbf')](_0x7c26d7)[_0xf865('0xc1')](sendMessageReschedule(_0x7c26d7))[_0xf865('0xb9')](loggerCatch(_0xf865('0x1fd')));}else{_0x7c26d7[_0xf865('0x41')]='RUNNING';if(_[_0xf865('0xe5')](_0x1a579a[0x0])||_['isNil'](_0x1a579a[0x0]['Contact'])||_[_0xf865('0xe5')](_0x1a579a[0x0]['Contact'][_0xf865('0x15c')])){_0x3a0057['emptyContact'](_0xf865('0x1f7'),_0x7c26d7,_0x1a579a[0x0]);}else{_0x3a0057[_0xf865('0xc2')](_[_0xf865('0x11c')](_0x1a579a[0x0],[_0xf865('0xda'),_0xf865('0x1f8')]))[_0xf865('0xc1')](_0x3a0057[_0xf865('0x1fe')](_0x7c26d7,_0x1a579a[0x0]))['catch'](_0x3a0057[_0xf865('0xd5')](_0xf865('0x201'),_0x7c26d7));}}})[_0xf865('0xb9')](loggerGetContactDialer(_0xf865('0x202'),_0x7c26d7,0x1));emitVoiceQueueSummary(_0x7c26d7);};Dialer[_0xf865('0x1c')][_0xf865('0x1d7')]=function(_0x4e62ad,_0x3b0c95,_0x3e7027,_0x2ffc54,_0x40ae2e,_0x54fed6){loggerPredictive['info'](_0xf865('0x203'));loggerPredictive[_0xf865('0x88')](_0xf865('0x204'),_0x4e62ad);loggerPredictive[_0xf865('0x88')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3b0c95);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3e7027);loggerPredictive[_0xf865('0x88')](_0xf865('0x205'),_0x2ffc54);loggerPredictive[_0xf865('0x88')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x40ae2e);loggerPredictive[_0xf865('0x88')](_0xf865('0x90'));return new BPromise(function(_0x209aaa,_0x11f405){if(_0x4e62ad<=0x0||isNaN(_0x4e62ad)){return _0x11f405(msgResponse(_0xf865('0x206'),'Error',_0xf865('0x207')+_0x4e62ad));}if(_0x3e7027<=0x0||isNaN(_0x3e7027)){return _0x11f405(msgResponse(_0xf865('0x206'),_0xf865('0x4b'),_0xf865('0x208')+_0x3e7027));}if(_0x2ffc54<=0x0||isNaN(_0x2ffc54)){return _0x11f405(msgResponse(_0xf865('0x206'),_0xf865('0x4b'),_0xf865('0x209')+_0x2ffc54));}if(_0x3b0c95<=0x0||isNaN(_0x3b0c95)){return _0x11f405(msgResponse(_0xf865('0x206'),_0xf865('0x4b'),_0xf865('0x20a')+_0x3b0c95));}if(_0x40ae2e<=0x0||isNaN(_0x40ae2e)){return _0x11f405(msgResponse('[abandonmentRate]',_0xf865('0x4b'),'Amax\x20=\x20'+_0x40ae2e));}_0x54fed6=_0x54fed6||0x0;var _0x83fd75=0x1/_0x3e7027;var _0xfc90a4=0x0;var _0x335c83=0x0;var _0x306a4e=0x0;var _0x3fc9ef=0x0;for(var _0x7f136e=0x0;_0x306a4e<_0x40ae2e;_0x7f136e+=0x1){_0x335c83=_0x7f136e/_0x3b0c95;_0xfc90a4=(_0x2ffc54*_0x335c83+_0x54fed6)/_0x83fd75;_0x306a4e=erlangb(_0xfc90a4,_0x4e62ad);_0x3fc9ef=_0xfc90a4/_0x4e62ad*(0x1-erlangb(_0xfc90a4,_0x4e62ad));}return _0x209aaa({'erlangCalls':_0x7f136e,'erlangCallToSecond':_0x3b0c95/_0x7f136e,'erlangAbandonmentRate':_0x306a4e,'erlangBusyFactor':_0x3fc9ef});});};Dialer['prototype']['busyFactor']=function(_0x2f86d8,_0x5003a5,_0x2a1eaf,_0xb2ab0e,_0x3e139d,_0x146121){loggerPredictive[_0xf865('0x88')](_0xf865('0x20b'));loggerPredictive['info'](_0xf865('0x204'),_0x2f86d8);loggerPredictive['info'](_0xf865('0x20c'),_0x5003a5);loggerPredictive[_0xf865('0x88')](_0xf865('0x20d'),_0x2a1eaf);loggerPredictive[_0xf865('0x88')]('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',_0xb2ab0e);loggerPredictive['info'](_0xf865('0x20e'),_0x3e139d);loggerPredictive[_0xf865('0x88')]('---------------------------');return new BPromise(function(_0x5abd8d,_0xc694e8){if(_0x2f86d8<=0x0||isNaN(_0x2f86d8)){return _0xc694e8(msgResponse(_0xf865('0x20f'),_0xf865('0x4b'),_0xf865('0x207')+_0x2f86d8));}if(_0x2a1eaf<=0x0||isNaN(_0x2a1eaf)){return _0xc694e8(msgResponse(_0xf865('0x20f'),_0xf865('0x4b'),_0xf865('0x208')+_0x2a1eaf));}if(_0xb2ab0e<=0x0||isNaN(_0xb2ab0e)){return _0xc694e8(msgResponse(_0xf865('0x20f'),_0xf865('0x4b'),_0xf865('0x209')+_0xb2ab0e));}if(_0x5003a5<=0x0||isNaN(_0x5003a5)){return _0xc694e8(msgResponse(_0xf865('0x20f'),_0xf865('0x4b'),_0xf865('0x20a')+_0x5003a5));}if(_0x3e139d<=0x0||isNaN(_0x3e139d)){return _0xc694e8(msgResponse('[busyFactor]',_0xf865('0x4b'),'Umin\x20=\x20'+_0x3e139d));}_0x146121=_0x146121||0x0;var _0x1e942b=0x1/_0x2a1eaf;var _0x2889a4=0x0;var _0x118c69=0x0;var _0x1f6bb3=0x0;var _0xc4f483=0x0;for(var _0x3f721b=0x0;_0xc4f483<_0x3e139d;_0x3f721b+=0x1){_0x118c69=_0x3f721b/_0x5003a5;_0x2889a4=(_0xb2ab0e*_0x118c69+_0x146121)/_0x1e942b;_0x1f6bb3=erlangb(_0x2889a4,_0x2f86d8);_0xc4f483=_0x2889a4/_0x2f86d8*(0x1-erlangb(_0x2889a4,_0x2f86d8));}return _0x5abd8d({'erlangCalls':_0x3f721b,'erlangCallToSecond':_0x5003a5/_0x3f721b,'erlangAbandonmentRate':_0x1f6bb3,'erlangBusyFactor':_0xc4f483});});};module[_0xf865('0x210')]=Dialer; \ No newline at end of file +var _0xc11d=['[syncHangupInAMD][createHistory]','dialAMDActive','Machine','[syncMachine][createHistory]','[syncMachine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','AMD','amd','[syncMachineIvr][createHistory]','[syncMachineIvr]','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','cause-txt','reason','agent','agiafterat','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','YYYY-MM-DD\x20HH:mm:ss','responsetime','dialQueueTimeout','Drop','dropreason','dialDropMaxRetry','countdropretry','add','dialDropRetryFrequency','minutes','[rescheduleContact][Drop]','outboundDropCallsDayCallersExit','CALLEREXIT','countabandonedretry','dialAbandonedMaxRetry','actions','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','length','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','indexOf','true','content','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','progressive','power','handlePower','dialPowerLevel','Queue','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialTimezone','[syncQueueSummary]','dialGlobalInterval','\x5cw{0,','pow','random','match','actionOriginate','Contact','phone','originate','getCaller','\x22agi://%s/square,%s\x22','dialQueueProject2','NONE','\x22%s,%s%s,,,%s\x22','ACTIVE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialCutDigit','substring','trim','from-sip','[originateError]:\x20%s','OriginateError','starttime','[originate][error]','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','dialMachineMaxRetry','[rescheduleContact][Machine]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','object','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','Abandoned','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','predictiveIntervalAvailable',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','Agent','voicePause','log','Contact\x20updated','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','maxNumberOriginate','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','countReScheduled','RUNNING','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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]','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','uuid','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./final','./agentComplete','./hangup','env','XCALLY_IP_AGI','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','channels','contactsId','optionPredictive','ivrOriginated','queueBooked','queueBookedRR','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','NOT_ACTIVE','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','Error','stringify','milliseconds','diff','seconds','emit','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','md5','format','voice_queue:save','type','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','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','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','startPredictive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','stack','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','waiting','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','is\x20disactive','state','statedesc','endtime','clearZombieChannels','uniqueId','[uniqueid]','[actions]','hasOwnProperty','Action','channel','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','resolve','catch','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','then','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','isSuccess','isTrunkReachable','status','reachable','SIP/%s','unmonitored','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','value','HangupInAMD','membername'];(function(_0x3e6729,_0x16d4af){var _0x535bcd=function(_0x5e6c5f){while(--_0x5e6c5f){_0x3e6729['push'](_0x3e6729['shift']());}};_0x535bcd(++_0x16d4af);}(_0xc11d,0x11f));var _0xdc11=function(_0x4b9d13,_0xfff07f){_0x4b9d13=_0x4b9d13-0x0;var _0x335ee9=_0xc11d[_0x4b9d13];return _0x335ee9;};'use strict';var util=require(_0xdc11('0x0'));var _=require(_0xdc11('0x1'));var BPromise=require('bluebird');var uuid=require(_0xdc11('0x2'));var moment=require('moment');var rr=require('rr');var md5=require('md5');var Redis=require(_0xdc11('0x3'));var config=require(_0xdc11('0x4'));var logger=require(_0xdc11('0x5'))(_0xdc11('0x6'));var loggerBooked=require(_0xdc11('0x5'))(_0xdc11('0x7'));var loggerPredictive=require(_0xdc11('0x5'))(_0xdc11('0x8'));var loggerPredictiveCalls=require(_0xdc11('0x5'))(_0xdc11('0x9'));var loggerSyncQueueSummary=require(_0xdc11('0x5'))(_0xdc11('0xa'));var ami=require(_0xdc11('0xb'));config[_0xdc11('0xc')]=_[_0xdc11('0xd')](config[_0xdc11('0xc')],{'host':_0xdc11('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdc11('0xc')]));var cmHopper=require(_0xdc11('0xf'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xdc11('0x10'));var cmHopperBlack=require(_0xdc11('0x11'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require('./action');var History=require('./history');var Final=require(_0xdc11('0x12'));var AgentComplete=require(_0xdc11('0x13'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0xdc11('0x14'));var ipAgi=process[_0xdc11('0x15')][_0xdc11('0x16')]||'127.0.0.1';var strategy={'rrmemory':_0xdc11('0x17'),'roundrobin':_0xdc11('0x18')};var Sequence=function(){};Sequence[_0xdc11('0x19')][_0xdc11('0x1a')]=function(_0x1a59ef){this[_0xdc11('0x1b')]=this[_0xdc11('0x1b')]?this['tail'][_0xdc11('0x1c')](_0x1a59ef):_0x1a59ef();};function Dialer(_0x1a5ffe,_0x20a1cb){this[_0xdc11('0x1d')]=new Sequence();this['preview']=_0x20a1cb;this['voiceQueues']=_0x1a5ffe[_0xdc11('0x1e')];this[_0xdc11('0x1f')]=_0x1a5ffe[_0xdc11('0x1f')];this[_0xdc11('0x20')]=_0x1a5ffe['agents'];this[_0xdc11('0x21')]=_0x1a5ffe['trunks'];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this[_0xdc11('0x22')]={};this['actions']={};this[_0xdc11('0x23')]={};this['uniqueId']={};this[_0xdc11('0x24')]={};this['startPredictive']={};this['startProgressive']={};this[_0xdc11('0x25')]={};this[_0xdc11('0x26')]={};this[_0xdc11('0x27')]={};ami['on']('agentconnect',this[_0xdc11('0x28')][_0xdc11('0x29')](this));ami['on']('queuecallerabandon',this[_0xdc11('0x2a')][_0xdc11('0x29')](this));ami['on'](_0xdc11('0x2b'),this[_0xdc11('0x2c')]['bind'](this));ami['on'](_0xdc11('0x2d'),this['syncAgentComplete'][_0xdc11('0x29')](this));ami['on'](_0xdc11('0x2e'),this['syncQueueSummary'][_0xdc11('0x29')](this));ami['on']('hangup',this[_0xdc11('0x2f')][_0xdc11('0x29')](this));ami['on'](_0xdc11('0x30'),this[_0xdc11('0x31')][_0xdc11('0x29')](this));ami['on'](_0xdc11('0x32'),this[_0xdc11('0x33')][_0xdc11('0x29')](this));ami['on'](_0xdc11('0x34'),this[_0xdc11('0x35')][_0xdc11('0x29')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0xdc11('0x29')](this));this[_0xdc11('0x36')]();this[_0xdc11('0x37')]();}function isNotNull(_0x2cc25b){return _0x2cc25b!==null&&!_[_0xdc11('0x38')](_0x2cc25b);}function checkIsLoggedIn(_0x3ce4f2,_0xd0843c){return function(){if(_0xd0843c<=0x0){_0x3ce4f2[_0xdc11('0x39')]=_0xdc11('0x3a');throw _0x3ce4f2['name']+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x319b35){return _0x319b35;}function checkIsActive(_0x4e36aa,_0x3f509a){return function(){if(!isActive(_0x3f509a)){_0x4e36aa[_0xdc11('0x39')]=_0xdc11('0x3b');throw _0x4e36aa[_0xdc11('0x3c')]+_0xdc11('0x3d');}};}function checkInterval(_0x25467f){return function(){if(!isNotNull(_0x25467f[_0xdc11('0x3e')])){_0x25467f[_0xdc11('0x39')]=_0xdc11('0x3f');throw _0x25467f[_0xdc11('0x3c')]+_0xdc11('0x40');}if(!isNotNull(_0x25467f[_0xdc11('0x3e')][_0xdc11('0x41')])){_0x25467f['message']='INTERVAL_IS_NULL';throw _0x25467f['name']+_0xdc11('0x40');}if(!isNotNull(_[_0xdc11('0x42')](_0x25467f['Interval'][_0xdc11('0x41')]))){_0x25467f[_0xdc11('0x39')]='INTERVAL_IS_NULL';throw _0x25467f[_0xdc11('0x3c')]+_0xdc11('0x40');}};}function msgResponse(_0x1cc387,_0x4d8485,_0xa635e7){return{'action':_0x1cc387,'response':_0x4d8485,'message':_0xa635e7,'stack':_0xa635e7};}function myreject(_0x99c156){return function(_0x36d1b6){return _0x99c156(msgResponse('[ifTime][Action]',_0xdc11('0x43'),JSON[_0xdc11('0x44')](_0x36d1b6)));};}function getSeconds(_0x19246d,_0x13047d){var _0x20d2d3=moment(_0x19246d)[_0xdc11('0x45')](0x0);var _0x783d04=moment(_0x13047d)['milliseconds'](0x0);return _0x20d2d3[_0xdc11('0x46')](_0x783d04,_0xdc11('0x47'));}function emit(_0x4b89a2,_0x1d6400,_0x3f2949){io['to'](_0x4b89a2)[_0xdc11('0x48')](_0x1d6400,_0x3f2949);}function emitVoiceQueueSummary(_0x13e830){if(_0x13e830['type']===_0xdc11('0x49')){var _0x1d3148={'id':_0x13e830['id'],'name':_0x13e830[_0xdc11('0x3c')],'strategy':_0x13e830[_0xdc11('0x4a')],'answered':_0x13e830[_0xdc11('0x4b')],'available':_0x13e830[_0xdc11('0x4c')],'loggedIn':_0x13e830[_0xdc11('0x4d')],'pTalking':_0x13e830[_0xdc11('0x4e')],'sumBillable':_0x13e830[_0xdc11('0x4f')],'sumDuration':_0x13e830[_0xdc11('0x50')],'sumHoldTime':_0x13e830[_0xdc11('0x51')]||0x0,'talking':_0x13e830[_0xdc11('0x52')],'total':_0x13e830[_0xdc11('0x53')],'type':_0x13e830['type'],'unmanaged':_0x13e830[_0xdc11('0x54')],'abandoned':_0x13e830[_0xdc11('0x55')],'waiting':_0x13e830['waiting'],'loggedInDb':_0x13e830[_0xdc11('0x56')],'dialActive':_0x13e830[_0xdc11('0x57')],'dialMethod':_0x13e830[_0xdc11('0x58')],'dialOriginateCallerIdName':_0x13e830['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x13e830[_0xdc11('0x59')],'dialOriginateTimeout':_0x13e830[_0xdc11('0x5a')],'dialPrefix':_0x13e830[_0xdc11('0x5b')],'outboundAnswerAgiCallsDay':_0x13e830[_0xdc11('0x5c')],'outboundAnswerCallsDay':_0x13e830[_0xdc11('0x5d')],'outboundBlacklistCallsDay':_0x13e830[_0xdc11('0x5e')],'outboundBusyCallsDay':_0x13e830['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x13e830[_0xdc11('0x5f')],'outboundDropCallsDayACS':_0x13e830[_0xdc11('0x60')],'outboundDropCallsDayCallersExit':_0x13e830['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x13e830[_0xdc11('0x61')],'outboundNoAnswerCallsDay':_0x13e830[_0xdc11('0x62')],'outboundNoSuchCallsDay':_0x13e830[_0xdc11('0x63')],'outboundOriginateFailureCallsDay':_0x13e830[_0xdc11('0x64')],'outboundReCallsDay':_0x13e830[_0xdc11('0x65')],'outboundRejectCallsDay':_0x13e830[_0xdc11('0x66')],'outboundUnknownCallsDay':_0x13e830[_0xdc11('0x67')],'predictiveIntervalAnsweredCalls':_0x13e830[_0xdc11('0x68')],'predictiveIntervalAvgHoldtime':_0x13e830[_0xdc11('0x69')],'predictiveIntervalAvgTalktime':_0x13e830['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x13e830[_0xdc11('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x13e830[_0xdc11('0x6b')],'predictiveIntervalErlangCalls':_0x13e830[_0xdc11('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x13e830[_0xdc11('0x6d')],'predictiveIntervalHitRate':_0x13e830[_0xdc11('0x6e')],'predictiveIntervalMultiplicativeFactor':_0x13e830['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x13e830[_0xdc11('0x6f')],'predictiveIntervalAvailable':_0x13e830['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x13e830[_0xdc11('0x70')],'message':_0x13e830[_0xdc11('0x39')],'originated':_0x13e830[_0xdc11('0x71')],'erlangCalls':_0x13e830['erlangCalls'],'erlangCallToSecond':_0x13e830['erlangCallToSecond'],'erlangAbandonmentRate':_0x13e830[_0xdc11('0x72')],'erlangBusyFactor':_0x13e830[_0xdc11('0x73')],'startPredictive':_0x13e830['startPredictive'],'startProgressive':_0x13e830[_0xdc11('0x74')]};if(_0x13e830['Trunk']){_0x1d3148[_0xdc11('0x75')]={'id':_0x13e830[_0xdc11('0x75')]['id'],'name':_0x13e830['Trunk'][_0xdc11('0x3c')],'active':_0x13e830[_0xdc11('0x75')][_0xdc11('0x76')],'callerid':_0x13e830[_0xdc11('0x75')][_0xdc11('0x77')]};}if(_0x13e830[_0xdc11('0x3e')]){_0x1d3148[_0xdc11('0x3e')]={'id':_0x13e830[_0xdc11('0x3e')]['id'],'name':_0x13e830[_0xdc11('0x3e')][_0xdc11('0x3c')]};}var _0x1483f8=md5(JSON[_0xdc11('0x44')](_0x1d3148));if(_0x13e830[_0xdc11('0x78')]!==_0x1483f8){_0x13e830[_0xdc11('0x78')]=_0x1483f8;emit(util[_0xdc11('0x79')]('voice:queue:%s',_0x1d3148[_0xdc11('0x3c')]),_0xdc11('0x7a'),_0x1d3148);}}}function emitCampaignSummary(_0x212bf6){if(_0x212bf6[_0xdc11('0x7b')]==='ivr'){emit(util[_0xdc11('0x79')](_0xdc11('0x7c'),_0x212bf6['name']),_0xdc11('0x7d'),_0x212bf6);}}function checkGetDataPredictive(_0x24a5c6){if(isNotNull(_0x24a5c6)){if(!_['isEmpty'](_0x24a5c6)){loggerPredictive['info'](_0xdc11('0x7e'));loggerPredictive[_0xdc11('0x7f')](_0xdc11('0x80'),_0x24a5c6[_0xdc11('0x70')]);loggerPredictive[_0xdc11('0x7f')](_0xdc11('0x81'),_0x24a5c6[_0xdc11('0x68')]);loggerPredictive[_0xdc11('0x7f')](_0xdc11('0x82'),_0x24a5c6[_0xdc11('0x6b')]);loggerPredictive[_0xdc11('0x7f')](_0xdc11('0x83'),_0x24a5c6[_0xdc11('0x6a')]);loggerPredictive['info'](_0xdc11('0x84'),_0x24a5c6[_0xdc11('0x69')]);loggerPredictive[_0xdc11('0x7f')](_0xdc11('0x85'),_0x24a5c6[_0xdc11('0x86')]);loggerPredictive[_0xdc11('0x7f')](_0xdc11('0x87'));if(_0x24a5c6[_0xdc11('0x70')]>0x0){if(!_[_0xdc11('0x38')](_0x24a5c6[_0xdc11('0x86')])&&_0x24a5c6[_0xdc11('0x86')]>0x0){return!![];}else{loggerPredictive['info'](_0xdc11('0x88'));}if(!_['isUndefined'](_0x24a5c6[_0xdc11('0x69')])&&_0x24a5c6['predictiveIntervalAvgHoldtime']>0x0){return!![];}else{loggerPredictive[_0xdc11('0x7f')](_0xdc11('0x89'));}}else{loggerPredictive[_0xdc11('0x7f')](_0xdc11('0x8a'));}}else{loggerPredictive['info'](_0xdc11('0x8b'));}}else{loggerPredictive['info'](_0xdc11('0x8b'));}return![];}function mergeDataErlangB(_0x1d8066){return function(_0xc89ff3){loggerPredictive['info'](_0xdc11('0x8c'));loggerPredictive[_0xdc11('0x7f')](_0xdc11('0x8d'),_0xc89ff3[_0xdc11('0x8e')]);loggerPredictive[_0xdc11('0x7f')](_0xdc11('0x8f'),_0xc89ff3[_0xdc11('0x90')]);loggerPredictive[_0xdc11('0x7f')](_0xdc11('0x91'),_0xc89ff3['erlangAbandonmentRate']);loggerPredictive['info'](_0xdc11('0x92'),_0xc89ff3[_0xdc11('0x73')]);loggerPredictive[_0xdc11('0x7f')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xc89ff3[_0xdc11('0x72')]);loggerPredictive[_0xdc11('0x7f')](_0xdc11('0x87'));_[_0xdc11('0x93')](_0x1d8066,_0xc89ff3);};}function getDiff(_0x515c62){var _0x2c368b=moment()[_0xdc11('0x45')](0x0);var _0x3190f4=moment(_0x515c62)[_0xdc11('0x45')](0x0);return _0x2c368b[_0xdc11('0x46')](_0x3190f4,_0xdc11('0x47'));}function ifInterval(_0x5ac979,_0x579b15){if(_[_0xdc11('0x38')](_0x579b15)){return![];}if(getDiff(_0x579b15)<_0x5ac979*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x33e8af){if(isNotNull(_0x33e8af)){if(!_[_0xdc11('0x38')](_0x33e8af['startProgressive'])){_0x33e8af['startProgressive']=undefined;loggerPredictive[_0xdc11('0x7f')](_0x33e8af[_0xdc11('0x3c')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0xdc11('0x38')](_0x33e8af[_0xdc11('0x94')])){_0x33e8af[_0xdc11('0x94')]=undefined;loggerPredictive['info'](_0x33e8af[_0xdc11('0x3c')],_0xdc11('0x95'));}if(!_[_0xdc11('0x38')](_0x33e8af[_0xdc11('0x96')])){clearInterval(_0x33e8af['handlePredictive']);_0x33e8af[_0xdc11('0x96')]=undefined;loggerPredictive[_0xdc11('0x7f')](_0x33e8af[_0xdc11('0x3c')],_0xdc11('0x97'));}}}function erlangb(_0x90c9a9,_0x2550b9){if(_0x2550b9===0x0){return 0x0;}var _0xd8b00a=0x1;for(var _0x473349=0x1;_0x473349<=_0x2550b9;_0x473349+=0x1){_0xd8b00a=0x1+_0xd8b00a*_0x473349/_0x90c9a9;}return 0x1/_0xd8b00a;}function isVoiceQueueOutbound(_0x571596){return _0x571596===_0xdc11('0x49');}function isNotPreview(_0xf6771e){return _0xf6771e!==_0xdc11('0x98');}function isCampaignIvr(_0x4f42e3){return _0x4f42e3===_0xdc11('0x99');}function getCallerId(_0x357adc,_0x8fc6e1,_0x22a5b2){if(!_[_0xdc11('0x38')](_0x22a5b2)&&_0xdc11('0x9a')===typeof _0x22a5b2&&!_['isEmpty'](_0x22a5b2)){if(!_[_0xdc11('0x38')](_0x8fc6e1)&&_0xdc11('0x9a')===typeof _0x8fc6e1&&!_[_0xdc11('0x42')](_0x8fc6e1)){return util['format'](_0xdc11('0x9b'),_0x8fc6e1,_0x22a5b2);}return util[_0xdc11('0x79')](_0xdc11('0x9b'),_0x22a5b2,_0x22a5b2);}if(!_[_0xdc11('0x38')](_0x357adc)&&_0xdc11('0x9a')===typeof _0x357adc&&!_[_0xdc11('0x42')](_0x357adc)){return _0x357adc;}return _0xdc11('0x9c');}function loggerCatchQueueSummary(_0x3578d3,_0x474477){return function(_0x3b0038){freeVariablesPredictive(_0x474477);emitVoiceQueueSummary(_0x474477);emitCampaignSummary(_0x474477);loggerSyncQueueSummary['error'](_0x3578d3,util[_0xdc11('0x9d')](_0x3b0038,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1ddd3c,_0x412d81){return function(_0x2ef954){loggerPredictive[_0xdc11('0x9e')](_0x412d81[_0xdc11('0x3c')],_0x1ddd3c);loggerPredictive[_0xdc11('0x9e')](_0x2ef954[_0xdc11('0x9f')]);freeVariablesPredictive(_0x412d81);};}function loggerCatch(_0x4c029b){return function(_0x465eae){logger[_0xdc11('0x9e')](_0x4c029b,util[_0xdc11('0x9d')](_0x465eae,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5edc36){return _0x5edc36&&!_['isUndefined'](_0x5edc36)&&_0x5edc36['length']>0x0;}function decremetOriginate(_0x3f00a9){if(!_[_0xdc11('0x38')](_0x3f00a9)&&_0x3f00a9!==null){if(_0x3f00a9['hasOwnProperty'](_0xdc11('0x71'))){if(_0x3f00a9['originated']>0x0){_0x3f00a9[_0xdc11('0x71')]-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger['error']('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x12fcf4,_0xd037ae,_0x341080){if(_0xd037ae>_0x341080){for(var _0x5a0bc9=0x0;_0x5a0bc9<_0xd037ae-_0x341080;_0x5a0bc9+=0x1){decremetOriginate(_0x12fcf4);}}}function loggerGetContactDialer(_0x2b5962,_0x396cd4,_0x4110bc){return function(_0x52082c){checkContactLowerLimitOriginate(_0x396cd4,_0x4110bc,0x0);logger['error'](_0x2b5962,util['inspect'](_0x52082c,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x136052){return function(_0x32e479){if(isNotNull(_0x32e479)&&isNotNull(_0x32e479[0x0])){if(_0x32e479[0x0]['contactsRescheduled']>0x0){_0x136052['message']=_0xdc11('0xa0');logger[_0xdc11('0x7f')](_0xdc11('0xa1')+_0x136052[_0xdc11('0x3c')],_0x32e479[0x0][_0xdc11('0xa2')],_0xdc11('0xa3'));}else{_0x136052['message']=_0xdc11('0xa4');logger['info'](_0xdc11('0xa5')+_0x136052['name']);}}};}function notSendMessagesQueue(_0x5852e4){if(_0x5852e4[_0xdc11('0xa6')]){freeVariablesPredictive(_0x5852e4);if(_0x5852e4['originated']===0x0&&_0x5852e4[_0xdc11('0x52')]===0x0&&_0x5852e4[_0xdc11('0xa7')]===0x0&&(_0x5852e4['pTalking']||0x0)===0x0){_0x5852e4[_0xdc11('0xa6')]=![];_0x5852e4[_0xdc11('0x4c')]=0x0;_0x5852e4[_0xdc11('0x39')]=_0xdc11('0x3b');loggerSyncQueueSummary[_0xdc11('0x9e')](_0xdc11('0xa8'),_0x5852e4[_0xdc11('0x3c')],'is\x20not\x20active');}else{_0x5852e4[_0xdc11('0x39')]=_0xdc11('0xa9');loggerSyncQueueSummary[_0xdc11('0x9e')](_0xdc11('0xa8'),_0x5852e4[_0xdc11('0x3c')],'is\x20disactive');}emitVoiceQueueSummary(_0x5852e4);}}function notSendMessagesCampaign(_0x59f5db){if(_0x59f5db[_0xdc11('0xa6')]){if(_0x59f5db['originated']===0x0){_0x59f5db[_0xdc11('0xa6')]=![];_0x59f5db['message']=_0xdc11('0x3b');loggerSyncQueueSummary[_0xdc11('0x9e')](_0xdc11('0xaa'),_0x59f5db[_0xdc11('0x3c')],_0xdc11('0xab'));}else{_0x59f5db[_0xdc11('0x39')]='IS_DISACTIVED';loggerSyncQueueSummary['error'](_0xdc11('0xaa'),_0x59f5db[_0xdc11('0x3c')],_0xdc11('0xac'));}emitCampaignSummary(_0x59f5db);}}function createObjHistory(_0x4dfc80,_0x505c3d,_0x2c0abc,_0x511551,_0x5a7d22){_0x4dfc80[_0xdc11('0x39')]=_0x2c0abc;var _0x5b64e8=new Action(_0x4dfc80,_0x505c3d);var _0x3ec5d2=new History(_0x5b64e8);_0x3ec5d2[_0xdc11('0xad')]=_0x511551;_0x3ec5d2[_0xdc11('0xae')]=_0x5a7d22;_0x3ec5d2[_0xdc11('0xaf')]=_0x5b64e8['starttime'];return _0x3ec5d2;}Dialer[_0xdc11('0x19')]['loopClearZombieChannels']=function(){var _0x34e0f8=this;setInterval(function(){_0x34e0f8[_0xdc11('0xb0')](_0x34e0f8[_0xdc11('0xb1')],_0xdc11('0xb2'));_0x34e0f8['clearZombieChannels'](_0x34e0f8['actions'],_0xdc11('0xb3'));},0x32c8);};Dialer[_0xdc11('0x19')][_0xdc11('0xb0')]=function(_0x36e036,_0x4f6539){var _0x4a27b6=this;for(var _0x49470c in _0x36e036){if(_0x36e036[_0xdc11('0xb4')](_0x49470c)){this[_0xdc11('0x1d')]['enqueue'](function(){if(!_['isNil'](_0x36e036[_0x49470c])){return ami[_0xdc11('0xb5')]({'action':'status','channel':_0x36e036[_0x49470c][_0xdc11('0xb6')]})['catch'](function(_0x364c53){if(_0x364c53[_0xdc11('0x39')]===_0xdc11('0xb7')){setTimeout(function(){if(_0x36e036[_0x49470c]&&_0x36e036[_0x49470c][_0xdc11('0x7b')]!=='ivr'){_0x4a27b6[_0xdc11('0xb8')](_0x4a27b6[_0xdc11('0x1e')][_0x36e036[_0x49470c][_0xdc11('0xb9')]]);logger[_0xdc11('0x9e')](_0xdc11('0xba'),_0x4f6539,_0x49470c,_0x36e036[_0x49470c][_0xdc11('0xb9')]);delete _0x36e036[_0x49470c];}if(_0x36e036[_0x49470c]&&_0x36e036[_0x49470c][_0xdc11('0x7b')]==='ivr'){_0x4a27b6['updateOriginated'](_0x4a27b6[_0xdc11('0x1f')][_0x36e036[_0x49470c][_0xdc11('0xb9')]]);logger[_0xdc11('0x9e')]('[Dialer][checkChannel][ivr]',_0x4f6539,_0x49470c,_0x36e036[_0x49470c]['queue']);delete _0x36e036[_0x49470c];}},0x2328);}});}});}}};Dialer[_0xdc11('0x19')]['countReScheduled']=function(_0x54dc43){return BPromise[_0xdc11('0xbb')]()['then'](cmHopper['countReScheduled'](_0x54dc43))[_0xdc11('0xbc')](loggerCatch(_0xdc11('0xbd')));};Dialer[_0xdc11('0x19')][_0xdc11('0xbe')]=function(_0x3f5c7f){return BPromise['resolve']()['then'](cmHopperBlack['checkIsBlackList'](_0x3f5c7f))[_0xdc11('0xbc')](loggerCatch(_0xdc11('0xbf')));};Dialer[_0xdc11('0x19')]['checkIsBlackListIvr']=function(_0x299090){return BPromise[_0xdc11('0xbb')]()[_0xdc11('0xc0')](cmHopperBlack[_0xdc11('0xc1')](_0x299090))[_0xdc11('0xbc')](loggerCatch(_0xdc11('0xc2')));};Dialer[_0xdc11('0x19')][_0xdc11('0xc3')]=function(_0x1e2a49){return BPromise[_0xdc11('0xbb')]()[_0xdc11('0xc0')](cmHopperHistory[_0xdc11('0xc4')](_0x1e2a49))[_0xdc11('0xbc')](loggerCatch(_0xdc11('0xc5')));};Dialer[_0xdc11('0x19')][_0xdc11('0xc6')]=function(_0x58dcbd){return BPromise[_0xdc11('0xbb')]()[_0xdc11('0xc0')](cmHopper[_0xdc11('0xc6')](_0x58dcbd))[_0xdc11('0xbc')](loggerCatch(_0xdc11('0xc7')));};Dialer['prototype']['unlockContact']=function(_0x6d6d26,_0x17b9b4,_0x52558e){return BPromise[_0xdc11('0xbb')]()['then'](cmHopper[_0xdc11('0xc8')](_0x6d6d26,_0x17b9b4,_0x52558e))[_0xdc11('0xbc')](loggerCatch(_0xdc11('0xc9')));};Dialer[_0xdc11('0x19')][_0xdc11('0xca')]=function(_0x11817b,_0x48ff0a,_0x1f2aab,_0x39fa3c){return BPromise['resolve']()[_0xdc11('0xc0')](cmHopper['getContactDialer'](_0x11817b,_0x48ff0a,_0x1f2aab,_0x39fa3c))['catch'](loggerCatch(_0xdc11('0xcb')));};Dialer['prototype'][_0xdc11('0xcc')]=function(_0x3091b9,_0x2c80ce,_0x1314e1){return BPromise[_0xdc11('0xbb')]()[_0xdc11('0xc0')](cmHopper[_0xdc11('0xcc')](_0x3091b9,_0x2c80ce,_0x1314e1))[_0xdc11('0xbc')](loggerCatch(_0xdc11('0xcb')));};Dialer['prototype'][_0xdc11('0xcd')]=function(_0x416e01){return BPromise['resolve']()[_0xdc11('0xc0')](voiceQueueRt['getVoiceQueueRtPauses'](_0x416e01))['catch'](loggerCatch(_0xdc11('0xce')));};Dialer[_0xdc11('0x19')][_0xdc11('0xcf')]=function(_0x3fb569){return BPromise[_0xdc11('0xbb')]()[_0xdc11('0xc0')](cmHopper[_0xdc11('0xcf')](_0x3fb569))[_0xdc11('0xbc')](loggerCatch(_0xdc11('0xd0')));};Dialer[_0xdc11('0x19')][_0xdc11('0xd1')]=function(_0x3601a7){return BPromise[_0xdc11('0xbb')]()[_0xdc11('0xc0')](cmHopperHistory[_0xdc11('0xd1')](_0x3601a7))['catch'](loggerCatch(_0xdc11('0xd2')));};Dialer[_0xdc11('0x19')]['updateOriginated']=function(_0x2ccd45){if(!_['isUndefined'](_0x2ccd45)&&_0x2ccd45!==null){if(_0x2ccd45[_0xdc11('0xb4')](_0xdc11('0x71'))){if(_0x2ccd45['originated']>0x0){_0x2ccd45['originated']-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xdc11('0x9e')](_0xdc11('0xd3'));}};Dialer[_0xdc11('0x19')][_0xdc11('0xd4')]=function(_0x24e56c,_0x228593){var _0x1879b1=this;return function(_0x5b62da){_0x1879b1[_0xdc11('0xb8')](_0x228593);logger[_0xdc11('0x9e')](_0x24e56c,util[_0xdc11('0x9d')](_0x5b62da,{'showHidden':![],'depth':null}));};};Dialer[_0xdc11('0x19')][_0xdc11('0xd5')]=function(_0x1bbffa,_0x49e0b7,_0x1874e4){var _0x3a7743={'state':0x19,'statedesc':_0xdc11('0xd6')};this['updateOriginated'](_0x49e0b7);this[_0xdc11('0xd7')](_[_0xdc11('0x93')](_0x3a7743,_[_0xdc11('0xd8')](_0x1874e4,[_0xdc11('0xd9'),_0xdc11('0xda'),_0xdc11('0xdb'),_0xdc11('0xdc'),_0xdc11('0xdd')])),'[emptyContact][createHistory]','[emptyContact]');logger[_0xdc11('0x9e')](_0x1bbffa);};Dialer[_0xdc11('0x19')][_0xdc11('0xde')]=function(_0x3ccc22){return _0x3ccc22==='Success';};Dialer['prototype'][_0xdc11('0xdf')]=function(_0x408a49){return!_[_0xdc11('0x38')](_0x408a49)&&_0x408a49&&!_[_0xdc11('0x38')](_0x408a49[_0xdc11('0x3c')])&&!_[_0xdc11('0x38')](_0x408a49[_0xdc11('0x76')])&&_0x408a49['active']&&(this[_0xdc11('0x21')][util[_0xdc11('0x79')]('SIP/%s',_0x408a49[_0xdc11('0x3c')])][_0xdc11('0xe0')]===_0xdc11('0xe1')||this[_0xdc11('0x21')][util[_0xdc11('0x79')](_0xdc11('0xe2'),_0x408a49[_0xdc11('0x3c')])][_0xdc11('0xe0')]===_0xdc11('0xe3'));};Dialer['prototype'][_0xdc11('0xd7')]=function(_0x5f12b0,_0xd5d94c,_0x225a2c){this[_0xdc11('0xd1')](_0x5f12b0)[_0xdc11('0xbc')](loggerCatch(_0xd5d94c));this[_0xdc11('0xcf')](_0x5f12b0)[_0xdc11('0xbc')](loggerCatch(_0x225a2c));};Dialer[_0xdc11('0x19')][_0xdc11('0x33')]=function(_0x5634c7){var _0x2eeb9b=this[_0xdc11('0xb1')][_0x5634c7[_0xdc11('0xe4')]];var _0x3226c5;if(!_[_0xdc11('0xe5')](_0x5634c7)&&!_[_0xdc11('0xe5')](_0x5634c7[_0xdc11('0xe6')])&&!_['isNil'](_0x5634c7[_0xdc11('0xe6')][_0xdc11('0xe7')])&&_0x5634c7[_0xdc11('0xe8')]===_0xdc11('0xe9')&&_0x2eeb9b){if(_0x2eeb9b[_0xdc11('0x7b')]!==_0xdc11('0x99')&&this['voiceQueues'][_0x2eeb9b[_0xdc11('0xb9')]]['dialAMDActive']&&_0x5634c7[_0xdc11('0xea')]==='HANGUP'){delete this[_0xdc11('0xb1')][_0x5634c7['uniqueid']];this['updateOriginated'](this[_0xdc11('0x1e')][_0x2eeb9b[_0xdc11('0xb9')]]);this[_0xdc11('0x1e')][_0x2eeb9b[_0xdc11('0xb9')]][_0xdc11('0x5d')]+=0x1;this['voiceQueues'][_0x2eeb9b[_0xdc11('0xb9')]][_0xdc11('0x5c')]+=0x1;_0x3226c5=new Hangup(_0x2eeb9b,_0x5634c7);_0x3226c5['state']=0x12;_0x3226c5[_0xdc11('0xae')]=_0xdc11('0xeb');_0x3226c5[_0xdc11('0xec')]='AMD';this[_0xdc11('0xd7')](_0x3226c5,_0xdc11('0xed'),'[syncHangupInAMD]');}if(_0x2eeb9b[_0xdc11('0x7b')]!=='ivr'&&this[_0xdc11('0x1e')][_0x2eeb9b['queue']][_0xdc11('0xee')]&&_0x5634c7['value']==='MACHINE'){delete this['uniqueId'][_0x5634c7[_0xdc11('0xe4')]];this[_0xdc11('0xb8')](this[_0xdc11('0x1e')][_0x2eeb9b[_0xdc11('0xb9')]]);this[_0xdc11('0x1e')][_0x2eeb9b[_0xdc11('0xb9')]][_0xdc11('0x5d')]+=0x1;this['voiceQueues'][_0x2eeb9b[_0xdc11('0xb9')]][_0xdc11('0x5c')]+=0x1;_0x3226c5=new Hangup(_0x2eeb9b,_0x5634c7);_0x3226c5[_0xdc11('0xad')]=0x13;_0x3226c5[_0xdc11('0xae')]=_0xdc11('0xef');_0x3226c5[_0xdc11('0xec')]='AMD';_0x3226c5['amd']=!![];this['saveInDb'](_0x3226c5,_0xdc11('0xf0'),_0xdc11('0xf1'));}if(_0x2eeb9b[_0xdc11('0x7b')]===_0xdc11('0x99')&&this['campaigns'][_0x2eeb9b['queue']][_0xdc11('0xee')]&&_0x5634c7[_0xdc11('0xea')]==='HANGUP'){delete this[_0xdc11('0xb1')][_0x5634c7[_0xdc11('0xe4')]];this['updateOriginated'](this[_0xdc11('0x1f')][_0x2eeb9b[_0xdc11('0xb9')]]);_0x3226c5=new Hangup(_0x2eeb9b,_0x5634c7);_0x3226c5['state']=0x12;_0x3226c5[_0xdc11('0xae')]=_0xdc11('0xeb');_0x3226c5[_0xdc11('0xec')]='AMD';this[_0xdc11('0xd7')](_0x3226c5,_0xdc11('0xf2'),_0xdc11('0xf3'));}if(_0x2eeb9b['type']==='ivr'&&this[_0xdc11('0x1f')][_0x2eeb9b[_0xdc11('0xb9')]][_0xdc11('0xee')]&&_0x5634c7[_0xdc11('0xea')]==='MACHINE'){delete this['uniqueId'][_0x5634c7['uniqueid']];this['updateOriginated'](this[_0xdc11('0x1f')][_0x2eeb9b[_0xdc11('0xb9')]]);_0x3226c5=new Hangup(_0x2eeb9b,_0x5634c7);_0x3226c5['state']=0x13;_0x3226c5[_0xdc11('0xae')]=_0xdc11('0xef');_0x3226c5[_0xdc11('0xec')]=_0xdc11('0xf4');_0x3226c5[_0xdc11('0xf5')]=!![];this[_0xdc11('0xd7')](_0x3226c5,_0xdc11('0xf6'),_0xdc11('0xf7'));}}};Dialer['prototype']['syncHangup']=function(_0x529baf){var _0xe2cafc=this['uniqueId'][_0x529baf['uniqueid']];var _0x8c248b=this;var _0x214840;if(_0xe2cafc&&_0xe2cafc['type']===_0xdc11('0x99')){delete this[_0xdc11('0xb1')][_0x529baf['uniqueid']];this[_0xdc11('0xb8')](this[_0xdc11('0x1f')][_0xe2cafc[_0xdc11('0xb9')]]);this[_0xdc11('0x1f')][_0xe2cafc[_0xdc11('0xb9')]]['ivrAnswerCallsDay']+=0x1;_0x214840=new Hangup(_0xe2cafc,_0x529baf);this[_0xdc11('0xd1')](_0x214840)[_0xdc11('0xbc')](loggerCatch(_0xdc11('0xf8')));this[_0xdc11('0xcf')](_0x214840)[_0xdc11('0xbc')](loggerCatch(_0xdc11('0xf9')));}if(_0xe2cafc&&_0xe2cafc['type']!==_0xdc11('0x99')&&isNotNull(this[_0xdc11('0x1e')][_0xe2cafc[_0xdc11('0xb9')]][_0xdc11('0xfa')])){delete this[_0xdc11('0xb1')][_0x529baf[_0xdc11('0xe4')]];this[_0xdc11('0xb8')](this['voiceQueues'][_0xe2cafc[_0xdc11('0xb9')]]);this['voiceQueues'][_0xe2cafc[_0xdc11('0xb9')]][_0xdc11('0x5d')]+=0x1;this[_0xdc11('0x1e')][_0xe2cafc[_0xdc11('0xb9')]][_0xdc11('0x5c')]+=0x1;_0x214840=new Hangup(_0xe2cafc,_0x529baf);_0x214840[_0xdc11('0xad')]=0x10;_0x214840[_0xdc11('0xae')]='AnswerAGI';_0x214840['membername']='AGI';this[_0xdc11('0xd1')](_0x214840)[_0xdc11('0xbc')](loggerCatch(_0xdc11('0xf8')));this['moveContactManagedDialer'](_0x214840)[_0xdc11('0xbc')](loggerCatch(_0xdc11('0xf9')));}if(_0xe2cafc&&_0xe2cafc[_0xdc11('0x7b')]!==_0xdc11('0x99')&&!isNotNull(this['voiceQueues'][_0xe2cafc[_0xdc11('0xb9')]][_0xdc11('0xfa')])){delete this[_0xdc11('0xb1')][_0x529baf[_0xdc11('0xe4')]];this[_0xdc11('0xb8')](this[_0xdc11('0x1e')][_0xe2cafc[_0xdc11('0xb9')]]);this[_0xdc11('0x1e')][_0xe2cafc[_0xdc11('0xb9')]][_0xdc11('0x67')]+=0x1;_0x214840=new Hangup(_0xe2cafc,_0x529baf);_0x214840[_0xdc11('0xad')]=0xc;_0x214840[_0xdc11('0xae')]=_0x529baf[_0xdc11('0xfb')];_0x214840[_0xdc11('0xec')]='Unknow';this[_0xdc11('0xd1')](_0x214840)[_0xdc11('0xbc')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xdc11('0xcf')](_0x214840)[_0xdc11('0xbc')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xdc11('0x19')]['syncAgentComplete']=function(_0x15a0ce){var _0x255229=this[_0xdc11('0xb1')][_0x15a0ce['uniqueid']];var _0x5476f5=this;if(this['voiceQueues'][_0x15a0ce[_0xdc11('0xb9')]]){if(_0x255229&&_0x255229[_0xdc11('0x7b')]!==_0xdc11('0x99')){delete this[_0xdc11('0xb1')][_0x15a0ce['uniqueid']];this[_0xdc11('0x1e')][_0x15a0ce[_0xdc11('0xb9')]][_0xdc11('0x5d')]+=0x1;var _0x535ff0=new AgentComplete(_0x255229,_0x15a0ce);if(_0x15a0ce[_0xdc11('0xfc')]===_0xdc11('0xfd')){_0x535ff0[_0xdc11('0xfe')]=this[_0xdc11('0x1e')][_0x15a0ce[_0xdc11('0xb9')]]['dialQueueProject2']&&this[_0xdc11('0x1e')][_0x15a0ce[_0xdc11('0xb9')]]['dialAgiAfterHangupAgent']?moment()[_0xdc11('0x79')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this['createHistory'](_0x535ff0)['catch'](loggerCatch(_0xdc11('0xff')));this[_0xdc11('0xcf')](_0x535ff0)['catch'](loggerCatch(_0xdc11('0x100')));}}};Dialer[_0xdc11('0x19')][_0xdc11('0x28')]=function(_0x480672){if(this[_0xdc11('0x1e')][_0x480672['queue']]){if(this['uniqueId'][_0x480672[_0xdc11('0xe4')]]&&this[_0xdc11('0xb1')][_0x480672[_0xdc11('0xe4')]][_0xdc11('0x7b')]!==_0xdc11('0x99')){this[_0xdc11('0xb8')](this[_0xdc11('0x1e')][_0x480672[_0xdc11('0xb9')]]);this[_0xdc11('0xb1')][_0x480672[_0xdc11('0xe4')]][_0xdc11('0x101')]=moment()[_0xdc11('0x79')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xdc11('0x19')][_0xdc11('0x102')]=function(_0x13afbc){this[_0xdc11('0xd1')](_0x13afbc)[_0xdc11('0xbc')](loggerCatch(_0xdc11('0xff')));this[_0xdc11('0xcf')](_0x13afbc)[_0xdc11('0xbc')](loggerCatch(_0xdc11('0x103')));};Dialer[_0xdc11('0x19')][_0xdc11('0x2a')]=function(_0x539664){var _0x2969b3=this[_0xdc11('0xb1')][_0x539664['uniqueid']];var _0x12e483=this;if(this[_0xdc11('0x1e')][_0x539664['queue']]){if(_0x2969b3&&_0x2969b3['type']!=='ivr'){delete this[_0xdc11('0xb1')][_0x539664[_0xdc11('0xe4')]];this['updateOriginated'](this[_0xdc11('0x1e')][_0x539664[_0xdc11('0xb9')]]);_0x2969b3[_0xdc11('0x104')]=moment()[_0xdc11('0x79')](_0xdc11('0x105'));var _0x4060c0=new QueueCallerAbandon(_0x2969b3,_0x539664);if(getSeconds(_0x2969b3[_0xdc11('0x104')],_0x2969b3[_0xdc11('0x106')])>=_0x2969b3[_0xdc11('0x107')]){this['voiceQueues'][_0x539664['queue']][_0xdc11('0x6b')]+=0x1;this[_0xdc11('0x1e')][_0x539664['queue']][_0xdc11('0x61')]+=0x1;this[_0xdc11('0x1e')][_0x539664[_0xdc11('0xb9')]][_0xdc11('0x6d')]+=0x1;_0x4060c0['state']=0xa;_0x4060c0[_0xdc11('0xae')]=_0xdc11('0x108');_0x4060c0[_0xdc11('0x109')]='TIMEOUT';_0x4060c0[_0xdc11('0xfe')]=this[_0xdc11('0x1e')][_0x539664[_0xdc11('0xb9')]]['dialQueueProject2']?moment()[_0xdc11('0x79')](_0xdc11('0x105')):undefined;if(_0x4060c0['countdropretry']>=this['voiceQueues'][_0x539664['queue']][_0xdc11('0x10a')]-0x1){this[_0xdc11('0x102')](_0x4060c0);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x4060c0[_0xdc11('0x10b')]+=0x1,'scheduledat':moment()[_0xdc11('0x10c')](this[_0xdc11('0x1e')][_0x539664[_0xdc11('0xb9')]][_0xdc11('0x10d')],_0xdc11('0x10e'))[_0xdc11('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2969b3[_0xdc11('0xd9')],'ListId':_0x2969b3['ListId'],'VoiceQueueId':_0x2969b3[_0xdc11('0xdc')]||undefined,'CampaignId':_0x2969b3[_0xdc11('0xdd')]||undefined})[_0xdc11('0xbc')](loggerCatch(_0xdc11('0x10f')));}}else{this[_0xdc11('0x1e')][_0x539664[_0xdc11('0xb9')]][_0xdc11('0x6a')]+=0x1;this[_0xdc11('0x1e')][_0x539664[_0xdc11('0xb9')]][_0xdc11('0x110')]+=0x1;_0x4060c0[_0xdc11('0xad')]=0xb;_0x4060c0[_0xdc11('0xae')]='Abandoned';_0x4060c0[_0xdc11('0x109')]=_0xdc11('0x111');if(_0x4060c0[_0xdc11('0x112')]>=this['voiceQueues'][_0x539664[_0xdc11('0xb9')]][_0xdc11('0x113')]-0x1){this[_0xdc11('0x102')](_0x4060c0);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x4060c0[_0xdc11('0x112')]+=0x1,'scheduledat':moment()['add'](this['voiceQueues'][_0x539664[_0xdc11('0xb9')]]['dialAbandonedRetryFrequency'],_0xdc11('0x10e'))[_0xdc11('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2969b3[_0xdc11('0xd9')],'ListId':_0x2969b3['ListId'],'VoiceQueueId':_0x2969b3[_0xdc11('0xdc')]||undefined,'CampaignId':_0x2969b3[_0xdc11('0xdd')]||undefined})[_0xdc11('0xbc')](loggerCatch('[rescheduleContact][Abandoned]'));}}}}};Dialer['prototype'][_0xdc11('0x31')]=function(_0x274cf7){if(this[_0xdc11('0x114')][_0x274cf7[_0xdc11('0xe4')]]){this[_0xdc11('0x114')][_0x274cf7['uniqueid']]['channel']=_0x274cf7['channel'];}if(this[_0xdc11('0xb1')][_0x274cf7[_0xdc11('0xe4')]]){this[_0xdc11('0xb1')][_0x274cf7[_0xdc11('0xe4')]][_0xdc11('0xb6')]=_0x274cf7[_0xdc11('0xb6')];}};Dialer[_0xdc11('0x19')]['syncQueueMember']=function(_0x4251b5){if(strategy[this[_0xdc11('0x1e')][this['actions'][_0x4251b5[_0xdc11('0x115')]]['queue']][_0xdc11('0x4a')]]===_0xdc11('0x18')){if(this['actions'][_0x4251b5[_0xdc11('0x115')]]&&_['isNil'](this['actions'][_0x4251b5[_0xdc11('0x115')]][_0xdc11('0x116')])&&_0x4251b5['status']==='1'&&_0x4251b5[_0xdc11('0x117')]==='0'){if(this[_0xdc11('0x20')][_0x4251b5[_0xdc11('0x118')]]){if(!this[_0xdc11('0x20')][_0x4251b5[_0xdc11('0x118')]][_0xdc11('0x116')]){this[_0xdc11('0x20')][_0x4251b5[_0xdc11('0x118')]]['locked']=!![];this[_0xdc11('0x114')][_0x4251b5['actionid']][_0xdc11('0x116')]=!![];this['actions'][_0x4251b5[_0xdc11('0x115')]][_0xdc11('0x118')]=_0x4251b5['stateinterface'];}}}}else if((strategy[this[_0xdc11('0x1e')][this[_0xdc11('0x114')][_0x4251b5[_0xdc11('0x115')]][_0xdc11('0xb9')]][_0xdc11('0x4a')]]||_0xdc11('0x17'))===_0xdc11('0x17')){if(this[_0xdc11('0x114')][_0x4251b5[_0xdc11('0x115')]]){if(this['agents'][_0x4251b5['stateinterface']]){this[_0xdc11('0x114')][_0x4251b5['actionid']][_0xdc11('0x118')]=_0x4251b5[_0xdc11('0x118')];if(_[_0xdc11('0xe5')](this[_0xdc11('0x26')][this[_0xdc11('0x114')][_0x4251b5[_0xdc11('0x115')]][_0xdc11('0xb9')]])){this[_0xdc11('0x26')][this[_0xdc11('0x114')][_0x4251b5[_0xdc11('0x115')]][_0xdc11('0xb9')]]=[];}this['queueBooked'][this['actions'][_0x4251b5[_0xdc11('0x115')]][_0xdc11('0xb9')]][_0xdc11('0x119')](_[_0xdc11('0x93')](_[_0xdc11('0xd8')](this['actions'][_0x4251b5['actionid']],[_0xdc11('0x11a'),_0xdc11('0x118')]),{'status':_0x4251b5[_0xdc11('0xe0')],'paused':_0x4251b5['paused']}));}}}};function unlockQueueStatus(_0x229033,_0x52e62f){setTimeout(function(){if(_[_0xdc11('0x38')](_0x229033[_0xdc11('0x11b')])){loggerBooked[_0xdc11('0x9e')]('[unlockQueueStatus][undefined]',_0x52e62f);}_0x229033[_0xdc11('0x11b')]=!![];loggerBooked[_0xdc11('0x7f')]('[booked][unlockQueueStatus]',_0x52e62f,JSON[_0xdc11('0x44')](_[_0xdc11('0xd8')](_0x229033,[_0xdc11('0x3c'),_0xdc11('0x11b')])));},0x1f3);}Dialer['prototype'][_0xdc11('0x11c')]=function(_0x4bf7d4){var _0x2f4905=this;var _0x12aa32=_0x2f4905['voiceQueues'][_0x2f4905[_0xdc11('0x114')][_0x4bf7d4[_0xdc11('0x115')]][_0xdc11('0xb9')]];if(strategy[this['voiceQueues'][this['actions'][_0x4bf7d4[_0xdc11('0x115')]][_0xdc11('0xb9')]]['strategy']]==='roundrobin'){if(this[_0xdc11('0x114')][_0x4bf7d4[_0xdc11('0x115')]]&&this[_0xdc11('0x114')][_0x4bf7d4[_0xdc11('0x115')]][_0xdc11('0x118')]){this[_0xdc11('0x98')][_0xdc11('0x11d')](this[_0xdc11('0x114')][_0x4bf7d4[_0xdc11('0x115')]][_0xdc11('0x11a')],this['actions'][_0x4bf7d4[_0xdc11('0x115')]][_0xdc11('0x118')])[_0xdc11('0xbc')](function(_0xabeff9){logger['error'](_0xdc11('0x11e'),util['inspect'](_0xabeff9,{'showHidden':![],'depth':null}));})[_0xdc11('0x1c')](function(){_0x2f4905[_0xdc11('0xb8')](_0x2f4905['voiceQueues'][_0x2f4905['actions'][_0x4bf7d4[_0xdc11('0x115')]][_0xdc11('0xb9')]]);_0x2f4905[_0xdc11('0x20')][_0x2f4905[_0xdc11('0x114')][_0x4bf7d4[_0xdc11('0x115')]][_0xdc11('0x118')]]['locked']=![];delete _0x2f4905[_0xdc11('0x114')][_0x4bf7d4['actionid']];unlockQueueStatus(_0x12aa32);});}else{this[_0xdc11('0xb8')](this[_0xdc11('0x1e')][this['actions'][_0x4bf7d4['actionid']][_0xdc11('0xb9')]]);this[_0xdc11('0xc6')]({'active':![],'ContactId':this['actions'][_0x4bf7d4[_0xdc11('0x115')]][_0xdc11('0xd9')],'ListId':this['actions'][_0x4bf7d4[_0xdc11('0x115')]][_0xdc11('0xda')],'VoiceQueueId':this[_0xdc11('0x114')][_0x4bf7d4[_0xdc11('0x115')]][_0xdc11('0xdc')]||undefined,'CampaignId':this[_0xdc11('0x114')][_0x4bf7d4['actionid']][_0xdc11('0xdd')]||undefined})['catch'](loggerCatch(_0xdc11('0x11f')));delete this['actions'][_0x4bf7d4['actionid']];unlockQueueStatus(_0x12aa32);}}else if((strategy[this[_0xdc11('0x1e')][this[_0xdc11('0x114')][_0x4bf7d4[_0xdc11('0x115')]][_0xdc11('0xb9')]][_0xdc11('0x4a')]]||'rrmemory')===_0xdc11('0x17')){var _0x1473ce;if(this[_0xdc11('0x114')][_0x4bf7d4['actionid']]&&!_[_0xdc11('0x42')](this['queueBooked'][this['actions'][_0x4bf7d4[_0xdc11('0x115')]][_0xdc11('0xb9')]])){if(this[_0xdc11('0x27')][_0x2f4905['actions'][_0x4bf7d4[_0xdc11('0x115')]][_0xdc11('0xb9')]]){this[_0xdc11('0x27')][_0x2f4905[_0xdc11('0x114')][_0x4bf7d4[_0xdc11('0x115')]][_0xdc11('0xb9')]]=this[_0xdc11('0x27')][this[_0xdc11('0x114')][_0x4bf7d4[_0xdc11('0x115')]]['queue']]?this[_0xdc11('0x27')][this['actions'][_0x4bf7d4['actionid']]['queue']]:this[_0xdc11('0x26')][this[_0xdc11('0x114')][_0x4bf7d4[_0xdc11('0x115')]][_0xdc11('0xb9')]]?this[_0xdc11('0x26')][this['actions'][_0x4bf7d4[_0xdc11('0x115')]][_0xdc11('0xb9')]]['_rr']||0x0:0x0;}this['queueBooked'][this[_0xdc11('0x114')][_0x4bf7d4['actionid']][_0xdc11('0xb9')]]['_rr']=this[_0xdc11('0x27')][this[_0xdc11('0x114')][_0x4bf7d4[_0xdc11('0x115')]][_0xdc11('0xb9')]];for(var _0x156112=0x0;_0x156112=0x0?!![]:![];})[_0xdc11('0xbc')](myreject(_0x523e30)));}}else{_0x480666[_0xdc11('0x119')](ami[_0xdc11('0xb5')]({'action':_0xdc11('0x13a'),'command':util[_0xdc11('0x79')]('iftime\x20%s,%s',_0x26685b,!_[_0xdc11('0x38')](config[_0xdc11('0x136')][_0x589587])?_0x589587:'')})[_0xdc11('0xc0')](function(_0x34dfa3){return _0x34dfa3[_0xdc11('0x13f')]['indexOf'](_0xdc11('0x13e'))>=0x0?!![]:![];})['catch'](myreject(_0x523e30)));}BPromise[_0xdc11('0x140')](_0x480666)['then'](function(_0x538c3e){var _0x16d8b1=_[_0xdc11('0x141')](_0x538c3e);if(_0x16d8b1){return _0x223005(_0x16d8b1);}else{_0x22c8f7[_0xdc11('0x39')]=_0x57e210?_0xdc11('0x142'):'INTERVAL_IS_OVERTIME';return _0x523e30(msgResponse(_0xdc11('0x143'),_0xdc11('0x133'),'Global:\x20'+_0x57e210+'\x20'+_0x5be910+_0xdc11('0x144')+util[_0xdc11('0x9d')](_0x26685b,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x589587));}})[_0xdc11('0xbc')](function(_0x1eff25){return _0x523e30(msgResponse(_0xdc11('0x131'),'Failure',JSON['stringify'](_0x1eff25)));});});};Dialer[_0xdc11('0x19')][_0xdc11('0x145')]=function(_0x22eee2){var _0x8de37b=this;return function(){switch(_0x22eee2['dialMethod']){case _0xdc11('0x146'):freeVariablesPredictive(_0x22eee2);_0x8de37b['handlePower'](_0x22eee2,0x1);break;case _0xdc11('0x147'):freeVariablesPredictive(_0x22eee2);_0x8de37b[_0xdc11('0x148')](_0x22eee2,_0x22eee2[_0xdc11('0x149')]);break;case _0xdc11('0x8'):_0x8de37b['predictive'](_0x22eee2);break;case _0xdc11('0x7'):freeVariablesPredictive(_0x22eee2);_0x8de37b[_0xdc11('0x148')](_0x22eee2,0x1);break;default:freeVariablesPredictive(_0x22eee2);logger['error'](_0xdc11('0x14a'),_0x22eee2[_0xdc11('0x3c')],'method\x20not\x20recognized');}};};Dialer[_0xdc11('0x19')][_0xdc11('0x14b')]=function(_0x54487b){var _0x28d893=this;return function(){_0x28d893[_0xdc11('0x14c')](_0x54487b);};};Dialer[_0xdc11('0x19')][_0xdc11('0xa')]=function(_0x33e6b3){var _0x662184=this;if(isNotPreview(_0x33e6b3[_0xdc11('0x58')])){if(isVoiceQueueOutbound(_0x33e6b3[_0xdc11('0x7b')])&&isActive(_0x33e6b3['dialActive'])){_0x33e6b3[_0xdc11('0xa6')]=!![];BPromise[_0xdc11('0xbb')]()['then'](checkIsLoggedIn(_0x33e6b3,_0x33e6b3[_0xdc11('0x4d')]))[_0xdc11('0xc0')](checkIsActive(_0x33e6b3,_0x33e6b3[_0xdc11('0x57')]))[_0xdc11('0xc0')](checkInterval(_0x33e6b3))[_0xdc11('0xc0')](_0x662184[_0xdc11('0x14d')](_0x33e6b3))[_0xdc11('0xc0')](_0x662184[_0xdc11('0x130')](_0x33e6b3['dialGlobalInterval'],_0x33e6b3[_0xdc11('0x14e')],_0x33e6b3['name'],_0x33e6b3))['then'](_0x662184[_0xdc11('0x132')](_0x33e6b3[_0xdc11('0x3e')],_0x33e6b3[_0xdc11('0x14e')],_0x33e6b3[_0xdc11('0x3c')],_0x33e6b3))[_0xdc11('0xc0')](_0x662184[_0xdc11('0x145')](_0x33e6b3))[_0xdc11('0xbc')](loggerCatchQueueSummary(_0xdc11('0x14f'),_0x33e6b3));}else{notSendMessagesQueue(_0x33e6b3);}}else{freeVariablesPredictive(_0x33e6b3);}};Dialer[_0xdc11('0x19')][_0xdc11('0x12c')]=function(){var _0x25ca83=this;var _0x1e813c;for(var _0x44a760 in this[_0xdc11('0x1f')]){if(this['campaigns'][_0xdc11('0xb4')](_0x44a760)){_0x1e813c=this[_0xdc11('0x1f')][_0x44a760];if(isCampaignIvr(_0x1e813c[_0xdc11('0x7b')])&&isActive(_0x1e813c[_0xdc11('0x76')])){_0x1e813c[_0xdc11('0xa6')]=!![];BPromise[_0xdc11('0xbb')]()['then'](checkIsActive(_0x1e813c,_0x1e813c['active']))['then'](checkInterval(_0x1e813c))[_0xdc11('0xc0')](_0x25ca83[_0xdc11('0x14d')](_0x1e813c))[_0xdc11('0xc0')](_0x25ca83['checkIfTime'](_0x1e813c[_0xdc11('0x150')],_0x1e813c[_0xdc11('0x14e')],_0x1e813c['name'],_0x1e813c))['then'](_0x25ca83[_0xdc11('0x132')](_0x1e813c['Interval'],_0x1e813c[_0xdc11('0x14e')],_0x1e813c['name'],_0x1e813c))['then'](_0x25ca83[_0xdc11('0x14b')](_0x1e813c))[_0xdc11('0xbc')](loggerCatchQueueSummary('[syncCampaigns]',_0x1e813c));}else{notSendMessagesCampaign(_0x1e813c);}}}};function getCallerIdRandom(_0xa5322a,_0x279e3b){var _0x384aea,_0x14f51e,_0x1f068d;if(_0x279e3b<=0x0){_0x279e3b=0x1;}_0x384aea=new RegExp(_0xdc11('0x151')+_0x279e3b+'}$');_0x14f51e=Math['pow'](0xa,_0x279e3b-0x1);_0x1f068d=Math[_0xdc11('0x152')](0xa,_0x279e3b)-0x1;return util[_0xdc11('0x79')]('%s',_['replace'](_0xa5322a,_0x384aea,_[_0xdc11('0x153')](_0x14f51e,_0x1f068d)));}function extractCalleridName(_0x4d66d1){var _0x3069fd=_0x4d66d1[_0xdc11('0x154')](/"(.*?)"/);return _0x3069fd?_0x3069fd[0x1]:_0x4d66d1;}function extractCalleridNumber(_0x1ec422){var _0x981794=_0x1ec422['match'](/<(.*?)>/);return _0x981794?_0x981794[0x1]:_0x1ec422;}Dialer['prototype'][_0xdc11('0x155')]=function(_0x182951,_0x568181){var _0x37c1d9=this;var _0x59554d=uuid['v4']();this[_0xdc11('0x114')][_0x59554d]=new Action(_0x182951,_0x568181,_0x59554d);return new BPromise(function(_0x1ada26,_0x366b1f){if(_['isUndefined'](_0x182951)&&'object'!==typeof _0x182951){return _0x366b1f(msgResponse('originate',_0xdc11('0x133'),'voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x568181[_0xdc11('0x156')][_0xdc11('0x157')])||_0x568181[_0xdc11('0x156')][_0xdc11('0x157')]===null){return _0x366b1f(msgResponse(_0xdc11('0x158'),'Failure','contact\x20is\x20undefine'));}var _0x1c9881={'XMD-CALLERID':_0x37c1d9['actions'][_0x59554d][_0xdc11('0x159')](),'XMD-AGI':_0x182951[_0xdc11('0xfa')]?util[_0xdc11('0x79')](_0xdc11('0x15a'),ipAgi,_0x182951[_0xdc11('0xfa')]):'NONE','XMD-AGIAFTER':_0x182951[_0xdc11('0x15b')]?util[_0xdc11('0x79')](_0xdc11('0x15a'),ipAgi,_0x182951['dialQueueProject2']):_0xdc11('0x15c'),'XMD-QUEUE':_0x182951[_0xdc11('0x7b')]===_0xdc11('0x49')?util[_0xdc11('0x79')](_0xdc11('0x15d'),_0x182951[_0xdc11('0x3c')],_0x182951['dialQueueOptions']||'',_0x182951['dialAgiAfterHangupAgent']?'c':'',_0x182951['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x568181[_0xdc11('0xd9')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x37c1d9['actions'][_0x59554d]['getCaller'](),'XMD-AMD':_0x182951['dialAMDActive']?_0xdc11('0x15e'):_0xdc11('0x15c'),'XMD-DESTINATION':_0xdc11('0xe9')};if(_0x182951[_0xdc11('0xee')]){_0x1c9881['XMD-AMDINITIALSILENCE']=_0x182951[_0xdc11('0x15f')]||0x9c4;_0x1c9881[_0xdc11('0x160')]=_0x182951[_0xdc11('0x161')]||0x5dc;_0x1c9881[_0xdc11('0x162')]=_0x182951['dialAMDAfterGreetingSilence']||0x320;_0x1c9881[_0xdc11('0x163')]=_0x182951['dialAMDTotalAnalysisTime']||0x1388;_0x1c9881['XMD-AMDMINWORDLENGTH']=_0x182951[_0xdc11('0x164')]||0x64;_0x1c9881['XMD-AMDBETWEENWORDSSILENCE']=_0x182951['dialAMDBetweenWordsSilence']||0x32;_0x1c9881['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x182951[_0xdc11('0x165')]||0x3;_0x1c9881[_0xdc11('0x166')]=_0x182951[_0xdc11('0x167')]||0x100;_0x1c9881[_0xdc11('0x168')]=_0x182951[_0xdc11('0x169')]||0x1388;}if(_0x182951[_0xdc11('0x7b')]===_0xdc11('0x49')){_0x1c9881[_0xdc11('0x16a')]=_0x568181[_0xdc11('0xdc')];}else{_0x1c9881[_0xdc11('0x16b')]=_0x568181[_0xdc11('0xdd')];}for(var _0x179eed in _0x568181[_0xdc11('0x156')]){if(_0x568181[_0xdc11('0x156')]['hasOwnProperty'](_0x179eed)){if(isNotNull(_0x568181['Contact'][_0x179eed])&&_0x179eed!=='id'&&_0x179eed!==_0xdc11('0x16c')&&_0x179eed!==_0xdc11('0x16d')&&_0x179eed!==_0xdc11('0x16e')){_0x1c9881[util['format'](_0xdc11('0x16f'),_0xdc11('0x170'),_['toUpper'](_0x179eed))]=_0x568181['Contact'][_0x179eed];}}}var _0x9a4689=_0x37c1d9['isTrunkReachable'](_0x182951['Trunk'])?getCallerId(_0x182951[_0xdc11('0x75')][_0xdc11('0x77')],_0x182951[_0xdc11('0x171')],_0x182951['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x182951[_0xdc11('0x59')],_0x182951['dialRandomLastDigitCallerIdNumber']):_0x182951[_0xdc11('0x59')]):getCallerId(_[_0xdc11('0xe5')](_0x182951[_0xdc11('0x12d')])?_0x182951['Trunk'][_0xdc11('0x77')]:_0x182951[_0xdc11('0x12d')][_0xdc11('0x77')],_0x182951[_0xdc11('0x171')],_0x182951[_0xdc11('0x172')]>0x0?getCallerIdRandom(_0x182951[_0xdc11('0x59')],_0x182951[_0xdc11('0x172')]):_0x182951[_0xdc11('0x59')]);if(_0x9a4689){_0x1c9881['XMD-ORIGINATECALLERIDNAME']=_0x37c1d9[_0xdc11('0x114')][_0x59554d]['originatecalleridname']=extractCalleridName(_0x9a4689);_0x1c9881[_0xdc11('0x173')]=_0x37c1d9['actions'][_0x59554d]['originatecalleridnum']=extractCalleridNumber(_0x9a4689);}return ami[_0xdc11('0xb5')]({'actionid':_0x59554d,'action':_0xdc11('0x158'),'channel':_0x37c1d9[_0xdc11('0xdf')](_0x182951[_0xdc11('0x75')])?util[_0xdc11('0x79')](_0xdc11('0x174'),_0x182951[_0xdc11('0x75')][_0xdc11('0x3c')],isNotNull(_0x182951['dialPrefix'])?_0x182951[_0xdc11('0x5b')]['trim']()||'':'',_0x182951[_0xdc11('0x175')]>0x0?_0x568181[_0xdc11('0x156')][_0xdc11('0x157')][_0xdc11('0x176')](_0x182951['dialCutDigit']):_0x568181[_0xdc11('0x156')][_0xdc11('0x157')]):util[_0xdc11('0x79')](_0xdc11('0x174'),_['isNil'](_0x182951[_0xdc11('0x12d')])?_0x182951[_0xdc11('0x75')]['name']:_0x182951[_0xdc11('0x12d')][_0xdc11('0x3c')],isNotNull(_0x182951['dialPrefix'])?_0x182951[_0xdc11('0x5b')][_0xdc11('0x177')]()||'':'',_0x182951[_0xdc11('0x175')]>0x0?_0x568181[_0xdc11('0x156')][_0xdc11('0x157')][_0xdc11('0x176')](_0x182951[_0xdc11('0x175')]):_0x568181[_0xdc11('0x156')][_0xdc11('0x157')]),'callerid':_0x9a4689,'Exten':'xcally-motion-dialer','Context':_0xdc11('0x178'),'Priority':'1','variable':_0x1c9881,'timeout':(_0x182951[_0xdc11('0x5a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x59554d})[_0xdc11('0xc0')](function(_0x57d13f){return _0x1ada26(_0x57d13f);})['catch'](function(_0x1b648b){_0x182951['outboundOriginateFailureCallsDay']+=0x1;var _0x65c6cb=new History(_0x37c1d9['actions'][_0x59554d]);logger[_0xdc11('0x9e')](util[_0xdc11('0x79')](_0xdc11('0x179'),JSON[_0xdc11('0x44')](_0x1b648b)));_0x65c6cb['state']=0xe;_0x65c6cb[_0xdc11('0xae')]=_0xdc11('0x17a');_0x65c6cb[_0xdc11('0x17b')]=moment()['format'](_0xdc11('0x105'));_0x65c6cb[_0xdc11('0xaf')]=_0x65c6cb['starttime'];_0x37c1d9[_0xdc11('0xd1')](_0x65c6cb)[_0xdc11('0xbc')](loggerCatch('[originate][error]'));_0x37c1d9[_0xdc11('0xcf')](_0x65c6cb)[_0xdc11('0xbc')](loggerCatch(_0xdc11('0x17c')))[_0xdc11('0x1c')](function(){delete _0x37c1d9['actions'][_0x59554d];return _0x366b1f(msgResponse(_0xdc11('0x158'),_0xdc11('0x43'),'originate\x20action\x20Error'));});});});};Dialer[_0xdc11('0x19')][_0xdc11('0x2c')]=function(_0x51a1f5){var _0x11004b=this[_0xdc11('0x114')][_0x51a1f5['actionid']];var _0x1ed420=this;if(_0x11004b){delete this[_0xdc11('0x114')][_0x51a1f5[_0xdc11('0x115')]];_0x11004b['responsetime']=moment()[_0xdc11('0x79')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1323e6=_0x11004b[_0xdc11('0x7b')]===_0xdc11('0x99')?this[_0xdc11('0x1f')][_0x11004b[_0xdc11('0xb9')]]:this[_0xdc11('0x1e')][_0x11004b[_0xdc11('0x17d')]()];if(!this[_0xdc11('0xde')](_0x51a1f5[_0xdc11('0x17e')])){this['updateOriginated'](_0x1323e6);return this[_0xdc11('0x17f')](_0x11004b,_0x1323e6,_0x51a1f5)[_0xdc11('0xc0')](function(_0x168a82){})['catch'](loggerCatch(_0xdc11('0x180')));}else{this[_0xdc11('0xb1')][_0x51a1f5[_0xdc11('0xe4')]]=_0x11004b;}}};Dialer['prototype'][_0xdc11('0x181')]=function(_0x360767,_0x1aae80,_0x32ed27){var _0x53e434=new History(_0x1aae80);if(_0x53e434[_0xdc11('0x182')]+_0x53e434[_0xdc11('0x183')]+_0x53e434[_0xdc11('0x184')]+_0x53e434[_0xdc11('0x185')]+_0x53e434[_0xdc11('0x10b')]+_0x53e434[_0xdc11('0x112')]+_0x53e434[_0xdc11('0x186')]+_0x53e434[_0xdc11('0x187')]>=_0x32ed27[_0xdc11('0x188')]-0x1){return!![];}switch(_0x360767){case 0x3:if(_0x53e434[_0xdc11('0x184')]>=_0x32ed27[_0xdc11('0x189')]-0x1){return!![];}else{this[_0xdc11('0xc6')]({'active':![],'countnoanswerretry':_0x53e434[_0xdc11('0x184')]+=0x1,'scheduledat':moment()[_0xdc11('0x10c')](_0x32ed27['dialNoAnswerRetryFrequency'],_0xdc11('0x10e'))[_0xdc11('0x79')](_0xdc11('0x105')),'ContactId':_0x53e434[_0xdc11('0xd9')],'ListId':_0x53e434['ListId'],'VoiceQueueId':_0x53e434[_0xdc11('0xdc')]||undefined,'CampaignId':_0x53e434[_0xdc11('0xdd')]||undefined})[_0xdc11('0xbc')](loggerCatch(_0xdc11('0x18a')));}break;case 0x5:if(_0x53e434[_0xdc11('0x182')]>=_0x32ed27[_0xdc11('0x18b')]-0x1){return!![];}else{this[_0xdc11('0xc6')]({'active':![],'countbusyretry':_0x53e434['countbusyretry']+=0x1,'scheduledat':moment()[_0xdc11('0x10c')](_0x32ed27[_0xdc11('0x18c')],_0xdc11('0x10e'))[_0xdc11('0x79')](_0xdc11('0x105')),'ContactId':_0x53e434['ContactId'],'ListId':_0x53e434[_0xdc11('0xda')],'VoiceQueueId':_0x53e434[_0xdc11('0xdc')]||undefined,'CampaignId':_0x53e434['CampaignId']||undefined})[_0xdc11('0xbc')](loggerCatch(_0xdc11('0x18d')));}break;case 0x8:if(_0x53e434['countcongestionretry']>=_0x32ed27[_0xdc11('0x18e')]-0x1){return!![];}else{this[_0xdc11('0xc6')]({'active':![],'countcongestionretry':_0x53e434['countcongestionretry']+=0x1,'scheduledat':moment()[_0xdc11('0x10c')](_0x32ed27['dialCongestionRetryFrequency'],_0xdc11('0x10e'))[_0xdc11('0x79')](_0xdc11('0x105')),'ContactId':_0x53e434[_0xdc11('0xd9')],'ListId':_0x53e434[_0xdc11('0xda')],'VoiceQueueId':_0x53e434[_0xdc11('0xdc')]||undefined,'CampaignId':_0x53e434[_0xdc11('0xdd')]||undefined})[_0xdc11('0xbc')](loggerCatch(_0xdc11('0x18f')));}break;case 0x0:if(_0x53e434[_0xdc11('0x185')]>=_0x32ed27['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x53e434[_0xdc11('0x185')]+=0x1,'scheduledat':moment()[_0xdc11('0x10c')](_0x32ed27[_0xdc11('0x190')],'minutes')['format'](_0xdc11('0x105')),'ContactId':_0x53e434[_0xdc11('0xd9')],'ListId':_0x53e434[_0xdc11('0xda')],'VoiceQueueId':_0x53e434[_0xdc11('0xdc')]||undefined,'CampaignId':_0x53e434['CampaignId']||undefined})[_0xdc11('0xbc')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x53e434['countdropretry']>=_0x32ed27['dialDropMaxRetry']-0x1){return!![];}else{this[_0xdc11('0xc6')]({'active':![],'countdropretry':_0x53e434[_0xdc11('0x10b')]+=0x1,'scheduledat':moment()[_0xdc11('0x10c')](_0x32ed27[_0xdc11('0x10d')],_0xdc11('0x10e'))[_0xdc11('0x79')](_0xdc11('0x105')),'ContactId':_0x53e434[_0xdc11('0xd9')],'ListId':_0x53e434[_0xdc11('0xda')],'VoiceQueueId':_0x53e434[_0xdc11('0xdc')]||undefined,'CampaignId':_0x53e434[_0xdc11('0xdd')]||undefined})[_0xdc11('0xbc')](loggerCatch(_0xdc11('0x10f')));}break;case 0xb:if(_0x53e434[_0xdc11('0x112')]>=_0x32ed27['dialAbandonedMaxRetry']-0x1){return!![];}else{this[_0xdc11('0xc6')]({'active':![],'countabandonedretry':_0x53e434[_0xdc11('0x112')]+=0x1,'scheduledat':moment()['add'](_0x32ed27[_0xdc11('0x191')],_0xdc11('0x10e'))[_0xdc11('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x53e434[_0xdc11('0xd9')],'ListId':_0x53e434[_0xdc11('0xda')],'VoiceQueueId':_0x53e434[_0xdc11('0xdc')]||undefined,'CampaignId':_0x53e434[_0xdc11('0xdd')]||undefined})[_0xdc11('0xbc')](loggerCatch(_0xdc11('0x192')));}break;case 0x13:if(_0x53e434[_0xdc11('0x186')]>=_0x32ed27[_0xdc11('0x193')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countmachineretry':_0x53e434['countmachineretry']+=0x1,'scheduledat':moment()[_0xdc11('0x10c')](_0x32ed27['dialMachineRetryFrequency'],_0xdc11('0x10e'))[_0xdc11('0x79')](_0xdc11('0x105')),'ContactId':_0x53e434[_0xdc11('0xd9')],'ListId':_0x53e434[_0xdc11('0xda')],'VoiceQueueId':_0x53e434['VoiceQueueId']||undefined,'CampaignId':_0x53e434[_0xdc11('0xdd')]||undefined})[_0xdc11('0xbc')](loggerCatch(_0xdc11('0x194')));}break;case 0x14:if(_0x53e434['countagentrejectretry']>=_0x32ed27[_0xdc11('0x195')]-0x1){return!![];}else{this[_0xdc11('0xc6')]({'active':![],'countagentrejectretry':_0x53e434['countagentrejectretry']+=0x1,'scheduledat':moment()['add'](_0x32ed27['dialAgentRejectRetryFrequency'],_0xdc11('0x10e'))[_0xdc11('0x79')](_0xdc11('0x105')),'ContactId':_0x53e434[_0xdc11('0xd9')],'ListId':_0x53e434[_0xdc11('0xda')],'VoiceQueueId':_0x53e434[_0xdc11('0xdc')]||undefined,'CampaignId':_0x53e434[_0xdc11('0xdd')]||undefined})[_0xdc11('0xbc')](loggerCatch(_0xdc11('0x196')));}break;default:return!![];}};Dialer['prototype'][_0xdc11('0x17f')]=function(_0x3e0165,_0x271db0,_0x26d855){var _0x2b2831=this;var _0x1f74f2=new History(_0x3e0165);return new BPromise(function(_0xf6aa76,_0x175bda){if(_[_0xdc11('0x38')](_0x271db0)&&_0xdc11('0x197')!==typeof _0x271db0){return _0x175bda(msgResponse('[callProgressDetecting]','Failure',_0xdc11('0x198')));}if(_[_0xdc11('0x38')](_0x26d855)&&_0xdc11('0x197')!==typeof _0x26d855){return _0x175bda(msgResponse(_0xdc11('0x199'),_0xdc11('0x133'),_0xdc11('0x19a')));}switch(_0x26d855['reason']){case'0':_0x271db0[_0xdc11('0x63')]+=0x1;_0x1f74f2[_0xdc11('0xad')]=0x0;_0x1f74f2[_0xdc11('0xae')]=_0xdc11('0x19b');_0x2b2831[_0xdc11('0xd1')](_0x1f74f2)['catch'](loggerCatch(_0xdc11('0x19c')));if(_0x2b2831[_0xdc11('0x181')](0x0,_0x3e0165,_0x271db0)){if(_0x1f74f2[_0xdc11('0x182')]+_0x1f74f2[_0xdc11('0x183')]+_0x1f74f2[_0xdc11('0x184')]+_0x1f74f2[_0xdc11('0x185')]+_0x1f74f2[_0xdc11('0x10b')]+_0x1f74f2[_0xdc11('0x112')]+_0x1f74f2['countmachineretry']+_0x1f74f2[_0xdc11('0x187')]>=_0x271db0['dialGlobalMaxRetry']){_0x2b2831[_0xdc11('0x19d')](_0x1f74f2,_0xf6aa76,_0x175bda,_0xdc11('0x19e'));}else{_0x2b2831[_0xdc11('0x19f')](_0x1f74f2,_0xf6aa76,_0x175bda,_0xdc11('0x19e'));}}break;case'3':_0x271db0[_0xdc11('0x62')]+=0x1;_0x1f74f2[_0xdc11('0xad')]=0x3;_0x1f74f2[_0xdc11('0xae')]=_0xdc11('0x1a0');_0x1f74f2['countnoanswerretry']+=0x1;_0x1f74f2[_0xdc11('0x1a1')]+=0x1;_0x2b2831[_0xdc11('0xd1')](_0x1f74f2)[_0xdc11('0xbc')](loggerCatch(_0xdc11('0x1a2')));if(_0x2b2831[_0xdc11('0x181')](0x3,_0x3e0165,_0x271db0)){if(_0x1f74f2[_0xdc11('0x184')]>=_0x271db0[_0xdc11('0x189')]){_0x2b2831['createStateFinal'](_0x1f74f2,_0xf6aa76,_0x175bda,_0xdc11('0x1a3'));}else{_0x2b2831[_0xdc11('0x19d')](_0x1f74f2,_0xf6aa76,_0x175bda,_0xdc11('0x1a3'));}}break;case'5':_0x271db0[_0xdc11('0x1a4')]+=0x1;_0x1f74f2[_0xdc11('0xad')]=0x5;_0x1f74f2[_0xdc11('0xae')]=_0xdc11('0x1a5');_0x1f74f2[_0xdc11('0x182')]+=0x1;_0x1f74f2['countglobal']+=0x1;_0x2b2831[_0xdc11('0xd1')](_0x1f74f2)[_0xdc11('0xbc')](loggerCatch(_0xdc11('0x1a6')));if(_0x2b2831[_0xdc11('0x181')](0x5,_0x3e0165,_0x271db0)){if(_0x1f74f2[_0xdc11('0x182')]>=_0x271db0['dialBusyMaxRetry']){_0x2b2831[_0xdc11('0x19f')](_0x1f74f2,_0xf6aa76,_0x175bda,_0xdc11('0x1a7'));}else{_0x2b2831[_0xdc11('0x19d')](_0x1f74f2,_0xf6aa76,_0x175bda,'reason\x205\x20busy');}}break;case'8':_0x271db0[_0xdc11('0x5f')]+=0x1;_0x1f74f2[_0xdc11('0xad')]=0x8;_0x1f74f2[_0xdc11('0xae')]=_0xdc11('0x1a8');_0x1f74f2[_0xdc11('0x183')]+=0x1;_0x1f74f2[_0xdc11('0x1a1')]+=0x1;_0x2b2831['createHistory'](_0x1f74f2)[_0xdc11('0xbc')](loggerCatch(_0xdc11('0x1a9')));if(_0x2b2831[_0xdc11('0x181')](0x8,_0x3e0165,_0x271db0)){if(_0x1f74f2[_0xdc11('0x183')]>=_0x271db0[_0xdc11('0x18e')]){_0x2b2831[_0xdc11('0x19f')](_0x1f74f2,_0xf6aa76,_0x175bda,_0xdc11('0x1aa'));}else{_0x2b2831[_0xdc11('0x19d')](_0x1f74f2,_0xf6aa76,_0x175bda,'reason\x208\x20congestion');}}break;case'11':_0x271db0[_0xdc11('0x1ab')]+=0x1;_0x1f74f2['state']=0xb;_0x1f74f2[_0xdc11('0xae')]=_0xdc11('0x1ac');_0x1f74f2[_0xdc11('0x112')]+=0x1;_0x1f74f2[_0xdc11('0x1a1')]+=0x1;_0x2b2831['createHistory'](_0x1f74f2)['catch'](loggerCatch(_0xdc11('0x1ad')));if(_0x2b2831[_0xdc11('0x181')](0xb,_0x3e0165,_0x271db0)){if(_0x1f74f2[_0xdc11('0x112')]>=_0x271db0[_0xdc11('0x113')]){_0x2b2831['createStateFinal'](_0x1f74f2,_0xf6aa76,_0x175bda,'reason\x2011\x20abandoned');}else{_0x2b2831[_0xdc11('0x19d')](_0x1f74f2,_0xf6aa76,_0x175bda,_0xdc11('0x1ae'));}}break;case'20':_0x271db0[_0xdc11('0x66')]+=0x1;_0x1f74f2['state']=0x14;_0x1f74f2[_0xdc11('0xae')]=_0xdc11('0x1af');_0x1f74f2['countagentrejectretry']+=0x1;_0x1f74f2[_0xdc11('0x1a1')]+=0x1;_0x2b2831['createHistory'](_0x1f74f2)[_0xdc11('0xbc')](loggerCatch(_0xdc11('0x1b0')));if(_0x2b2831['checkRetriveMax'](0x14,_0x3e0165,_0x271db0)){if(_0x1f74f2['countagentrejectretry']>=_0x271db0[_0xdc11('0x195')]){_0x2b2831[_0xdc11('0x19f')](_0x1f74f2,_0xf6aa76,_0x175bda,'reason\x2020\x20agentreject');}else{_0x2b2831[_0xdc11('0x19d')](_0x1f74f2,_0xf6aa76,_0x175bda,_0xdc11('0x1b1'));}}break;default:_0x271db0['outboundUnknownCallsDay']+=0x1;_0x1f74f2['state']=0xc;_0x1f74f2[_0xdc11('0xae')]=_0x26d855[_0xdc11('0xfc')];_0x2b2831['createHistory'](_0x1f74f2)['catch'](loggerCatch(_0xdc11('0x1b2')));if(_0x2b2831[_0xdc11('0x181')](_0x26d855[_0xdc11('0xfc')],_0x3e0165,_0x271db0)){if(_0x1f74f2[_0xdc11('0x182')]+_0x1f74f2['countcongestionretry']+_0x1f74f2[_0xdc11('0x184')]+_0x1f74f2[_0xdc11('0x185')]+_0x1f74f2['countdropretry']+_0x1f74f2[_0xdc11('0x112')]+_0x1f74f2['countmachineretry']+_0x1f74f2['countagentrejectretry']>=_0x271db0[_0xdc11('0x188')]){_0x2b2831[_0xdc11('0x19d')](_0x1f74f2,_0xf6aa76,_0x175bda,_0x26d855[_0xdc11('0xfc')]);}else{_0x2b2831[_0xdc11('0x19f')](_0x1f74f2,_0xf6aa76,_0x175bda,_0x26d855['reason']);}}}});};Dialer['prototype'][_0xdc11('0x19d')]=function(_0x2add3c,_0x5c400e,_0x12a417,_0x41bf6d){var _0x6d0f29=new Final(_0x2add3c);_0x6d0f29['state']=0xf;_0x6d0f29['statedesc']=_0xdc11('0x1b3');this[_0xdc11('0x19f')](_0x6d0f29,_0x5c400e,_0x12a417,_0x41bf6d);};Dialer[_0xdc11('0x19')]['createStateFinal']=function(_0x4e232b,_0x539c3c,_0x165ba0,_0x4584a0){this[_0xdc11('0xcf')](_0x4e232b)[_0xdc11('0xc0')](function(_0x5bd33d){return _0x539c3c(msgResponse(_0xdc11('0x199'),_0xdc11('0x1b4'),_0x4584a0));})[_0xdc11('0xbc')](function(_0x5e5e43){return _0x165ba0(msgResponse(_0xdc11('0x1b5'),_0xdc11('0x133'),_0xdc11('0x1b6')));});};Dialer[_0xdc11('0x19')][_0xdc11('0x8')]=function(_0x48f401){var _0x1aa2bb=this;var _0x7450a0=_0x48f401[_0xdc11('0x1b7')]/0x64;var _0x539a3c=_0x48f401['outboundDropCallsDayTimeout']/(_0x48f401[_0xdc11('0x61')]+_0x48f401[_0xdc11('0x5d')]);var _0x2e69fe=Math[_0xdc11('0x1b8')](_0x48f401['predictiveIntervalAvailable']*(_0x48f401[_0xdc11('0x1b9')]/0x64));var _0x22786f=Math[_0xdc11('0x1b8')](_0x48f401['predictiveIntervalAvailable']*(_0x48f401[_0xdc11('0x1ba')]/0x64));var _0xb46bf1=_0x48f401[_0xdc11('0x4c')]+_0x48f401['talking'];var _0x3a8af2=Math[_0xdc11('0x1bb')](_0x48f401[_0xdc11('0x8e')]*_0x48f401[_0xdc11('0x72')]*_0x48f401[_0xdc11('0x6e')]*_0x48f401[_0xdc11('0x1bc')]);if(_[_0xdc11('0x38')](_0x48f401[_0xdc11('0x74')])){if(!_[_0xdc11('0x38')](_0x48f401[_0xdc11('0x94')])){_0x48f401[_0xdc11('0x94')]=undefined;loggerPredictive[_0xdc11('0x9e')]('[startMethodPredictive][StartProgressive]',_0xdc11('0x1bd'));}if(!_[_0xdc11('0x38')](_0x48f401[_0xdc11('0x96')])){loggerPredictive[_0xdc11('0x9e')](_0xdc11('0x1be'),_0xdc11('0x1bf'));clearInterval(_0x48f401[_0xdc11('0x96')]);_0x48f401['handlePredictive']=undefined;}_0x48f401[_0xdc11('0x74')]=moment()[_0xdc11('0x79')](_0xdc11('0x105'));loggerPredictive[_0xdc11('0x7f')](_0x48f401['name'],_0xdc11('0x1c0'),_0x48f401[_0xdc11('0x74')]);this['handlePower'](_0x48f401,0x1);}else if(ifInterval(_0x48f401['dialPredictiveInterval'],_0x48f401['startProgressive'])){this[_0xdc11('0x148')](_0x48f401,0x1);loggerPredictiveCalls['info'](_0xdc11('0x1c1'),_0x48f401[_0xdc11('0x74')],_0x48f401[_0xdc11('0x3c')]);_0x48f401[_0xdc11('0x8e')]=0x0;_0x48f401[_0xdc11('0x6d')]=0x0;}else if(_0x7450a0<_0x539a3c&&_0x48f401[_0xdc11('0x1c2')]===_0xdc11('0x1c3')){freeVariablesPredictive(_0x48f401);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day',_0x539a3c,_0xdc11('0x74'),_0x48f401[_0xdc11('0x3c')]);}else if(_0x3a8af2<_0x48f401[_0xdc11('0x6d')]&&_0x48f401[_0xdc11('0x1c2')]===_0xdc11('0x1c3')){freeVariablesPredictive(_0x48f401);loggerPredictive[_0xdc11('0x7f')](_0xdc11('0x1c4'),'Max\x20Drop\x20',_0x3a8af2,'Drop\x20in\x20this\x20interval',_0x48f401['predictiveIntervalErlangCallsDroppedCalls'],_0xdc11('0x74'),_0x48f401['name']);}else if(!ifInterval(_0x48f401[_0xdc11('0x1c5')],_0x48f401[_0xdc11('0x74')])&&_[_0xdc11('0x38')](_0x48f401[_0xdc11('0x94')])&&!_['isUndefined'](_0x48f401['startProgressive'])){_0x48f401['startPredictive']=moment()[_0xdc11('0x79')](_0xdc11('0x105'));loggerPredictive[_0xdc11('0x7f')](_0x48f401['name'],_0xdc11('0x1c6'),_0x48f401[_0xdc11('0x94')]);this['averageHandleTime'](_0x48f401[_0xdc11('0x1c5')])['then'](this[_0xdc11('0x1c7')](_0x48f401))['then'](mergeDataErlangB(_0x48f401))[_0xdc11('0xc0')](this[_0xdc11('0x1c8')](_0x48f401))['catch'](loggerCatchPredictive(_0xdc11('0x1c9'),_0x48f401));}else if(!ifInterval(_0x48f401[_0xdc11('0x1c5')],_0x48f401[_0xdc11('0x94')])){_0x48f401[_0xdc11('0x6d')]=0x0;_0x48f401['startPredictive']=moment()[_0xdc11('0x79')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xdc11('0x7f')](_0x48f401['name'],_0xdc11('0x1ca'),_0x48f401['startPredictive']);clearInterval(_0x48f401[_0xdc11('0x96')]);_0x48f401[_0xdc11('0x96')]=undefined;this['averageHandleTime'](_0x48f401[_0xdc11('0x1c5')])[_0xdc11('0xc0')](this['getDataPredictive'](_0x48f401))['then'](mergeDataErlangB(_0x48f401))[_0xdc11('0xc0')](this[_0xdc11('0x1c8')](_0x48f401))['catch'](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x48f401));}else if(_0x48f401['predictiveIntervalAvailable']&&_0xb46bf1<_0x48f401[_0xdc11('0x1cb')]-_0x22786f){freeVariablesPredictive(_0x48f401);loggerPredictive[_0xdc11('0x7f')](_0x48f401[_0xdc11('0x3c')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0xb46bf1,_0xdc11('0x1cc'),_0x48f401[_0xdc11('0x1cb')],'-',_0x22786f,'=',_0x48f401[_0xdc11('0x1cb')]-_0x22786f,')');}else if(_0x48f401[_0xdc11('0x1cb')]&&_0xb46bf1>_0x48f401['predictiveIntervalAvailable']+_0x2e69fe){freeVariablesPredictive(_0x48f401);loggerPredictive[_0xdc11('0x7f')](_0x48f401['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0xb46bf1,')\x20are\x20more\x20than\x20threshold\x20(',_0x48f401[_0xdc11('0x1cb')],'+',_0x2e69fe,'=',_0x48f401[_0xdc11('0x1cb')]+_0x2e69fe,')');}};Dialer[_0xdc11('0x19')][_0xdc11('0x1c7')]=function(_0x81f4d3){var _0x231b05=this;return function(_0x2137cb){return new BPromise(function(_0x4e8daa,_0x999a95){_[_0xdc11('0x93')](_0x81f4d3,_0x2137cb[0x0]);if(checkGetDataPredictive(_0x2137cb[0x0])){var _0x2ff37b=_0x81f4d3[_0xdc11('0x1cb')]=_0x81f4d3['talking']+_0x81f4d3[_0xdc11('0x4c')];var _0x113a34=_0x81f4d3[_0xdc11('0x1c5')]*0x3c;var _0x486475=_0x2137cb[0x0]['predictiveIntervalAvgTalktime']+_0x2137cb[0x0][_0xdc11('0x69')];var _0x4ff913=(_0x2137cb[0x0]['predictiveIntervalAnsweredCalls']+_0x2137cb[0x0][_0xdc11('0x6b')]+_0x2137cb[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2137cb[0x0][_0xdc11('0x70')];_0x81f4d3[_0xdc11('0x6e')]=_0x4ff913>0x0?_0x4ff913:0x1;switch(_0x81f4d3[_0xdc11('0x1c2')]){case _0xdc11('0x1c3'):var _0x2e5948=_0x81f4d3[_0xdc11('0x1b7')]/0x64;return _0x231b05[_0xdc11('0x1cd')](_0x2ff37b,_0x113a34,_0x486475,_0x4ff913,_0x2e5948)[_0xdc11('0xc0')](function(_0x1e9d91){return _0x4e8daa(_0x1e9d91);});case _0xdc11('0x1ce'):var _0x52309a=_0x81f4d3[_0xdc11('0x1b7')]/0x64;return _0x231b05[_0xdc11('0x1cf')](_0x2ff37b,_0x113a34,_0x486475,_0x4ff913,_0x52309a)['then'](function(_0x26adbf){return _0x4e8daa(_0x26adbf);});default:return _0x999a95(msgResponse('[getDataPredictive]',_0xdc11('0x133'),_0xdc11('0x1d0')));}}else{return _0x999a95(msgResponse('[getDataPredictive]',_0xdc11('0x133'),_0xdc11('0x1d1')));}});};};Dialer[_0xdc11('0x19')][_0xdc11('0x1d2')]=function(_0x2b79d5){var _0x2b5fdb=this;return function(_0x1e9c20){return new BPromise(function(_0x1e54e8,_0x309053){_[_0xdc11('0x93')](_0x2b79d5,_0x1e9c20[0x0]);if(checkGetDataPredictive(_0x1e9c20[0x0])){loggerPredictive[_0xdc11('0x7f')](JSON[_0xdc11('0x44')](_0x1e9c20[0x0]));if(_0x2b79d5[_0xdc11('0x1c2')]==='dropRate'){return _0x2b5fdb[_0xdc11('0xcd')](_0x2b79d5['id'])[_0xdc11('0xc0')](function(_0x162fe5){var _0x2b2bbb=_0x2b79d5[_0xdc11('0x4d')]-_0x162fe5[0x0][_0xdc11('0x1d3')];var _0x1131fc=_0x2b79d5[_0xdc11('0x1c5')]*0x3c;var _0x3546ad=_0x1e9c20[0x0][_0xdc11('0x86')]+_0x1e9c20[0x0][_0xdc11('0x69')];var _0x2c13f9=(_0x1e9c20[0x0][_0xdc11('0x68')]+_0x1e9c20[0x0][_0xdc11('0x6b')]+_0x1e9c20[0x0][_0xdc11('0x6a')])/_0x1e9c20[0x0][_0xdc11('0x70')];var _0x1ae191=_0x2b79d5[_0xdc11('0x1b7')]/0x64;_0x2b79d5[_0xdc11('0x6f')]=_0x162fe5[0x0][_0xdc11('0x1d3')]||0x0;_0x2b79d5[_0xdc11('0x6e')]=_0x2c13f9>0x0?_0x2c13f9:0x1;return _0x2b5fdb['abandonmentRate'](_0x2b2bbb,_0x1131fc,_0x3546ad,_0x2c13f9,_0x1ae191);})['then'](function(_0x1aa001){return _0x1e54e8(_0x1aa001);})['catch'](function(_0x21922e){return _0x309053(msgResponse(_0xdc11('0x1d4'),'Failure',JSON['stringify'](_0x21922e)));});}if(_0x2b79d5[_0xdc11('0x1c2')]==='agentBusyFactor'){return _0x2b5fdb[_0xdc11('0xcd')](_0x2b79d5['id'])[_0xdc11('0xc0')](function(_0x249b08){var _0x530484=_0x2b79d5['loggedIn']-_0x249b08[0x0]['outboundQueuePauses'];var _0x39b27a=_0x2b79d5[_0xdc11('0x1c5')]*0x3c;var _0x213069=_0x1e9c20[0x0][_0xdc11('0x86')]+_0x1e9c20[0x0][_0xdc11('0x69')];var _0x10a88a=(_0x1e9c20[0x0][_0xdc11('0x68')]+_0x1e9c20[0x0][_0xdc11('0x6b')]+_0x1e9c20[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1e9c20[0x0][_0xdc11('0x70')];var _0x29838b=_0x2b79d5[_0xdc11('0x1b7')]/0x64;_0x2b79d5[_0xdc11('0x6f')]=_0x249b08[0x0][_0xdc11('0x1d3')]||0x0;_0x2b79d5[_0xdc11('0x6e')]=_0x10a88a>0x0?_0x10a88a:0x1;return _0x2b5fdb[_0xdc11('0x1cf')](_0x530484,_0x39b27a,_0x213069,_0x10a88a,_0x29838b);})[_0xdc11('0xc0')](function(_0x4d7170){return _0x1e54e8(_0x4d7170);})[_0xdc11('0xbc')](function(_0x28a673){return _0x309053(msgResponse(_0xdc11('0x1d4'),'Failure',JSON[_0xdc11('0x44')](_0x28a673)));});}}else{return _0x309053(msgResponse('[getDataPredictive]',_0xdc11('0x133'),_0xdc11('0x1d1')));}});};};Dialer[_0xdc11('0x19')][_0xdc11('0x1c8')]=function(_0x4f8bf8){var _0x2273ba=this;return function(){var _0x286e8d=0x0;var _0x5cb944=Math[_0xdc11('0x1bb')](_0x4f8bf8[_0xdc11('0x90')]*0x3e8);if(_0x5cb944>0x0){_0x5cb944=_0x5cb944<0x64?0x64:_0x5cb944;loggerPredictive[_0xdc11('0x7f')](_0x4f8bf8['name'],_0xdc11('0x1d5'),_0x5cb944,'milliseconds');_0x4f8bf8['handlePredictive']=setInterval(function(){_0x2273ba[_0xdc11('0x96')](_0x4f8bf8);loggerPredictiveCalls[_0xdc11('0x7f')](_0xdc11('0x1d6'),_0x286e8d+=0x1);},_0x5cb944);}else{loggerPredictive[_0xdc11('0x7f')](_0x4f8bf8[_0xdc11('0x3c')],_0xdc11('0x1d7'));}};};Dialer[_0xdc11('0x19')][_0xdc11('0x1d8')]=function(_0x2b6ff5,_0x2dde8f){var _0x55f377=this;return function(_0x1cb3ad){if(_[_0xdc11('0x42')](_0x1cb3ad)){if(_['isNil'](_0x2dde8f[_0xdc11('0xdb')])||!_0x2dde8f[_0xdc11('0x1d9')]){if(_0x2b6ff5[_0xdc11('0x58')]==='booked'){_0x2b6ff5[_0xdc11('0x11b')]=_[_0xdc11('0x38')](_0x2b6ff5[_0xdc11('0x11b')])?!![]:_0x2b6ff5['queueStatusComplete'];var _0x57d18f=uuid['v4']();_0x55f377[_0xdc11('0x114')][_0x57d18f]=new Action(_0x2b6ff5,_0x2dde8f,_0x57d18f);loggerBooked[_0xdc11('0x7f')](_0xdc11('0x1da'),_0x57d18f,'queueStatusComplete:\x20',JSON[_0xdc11('0x44')](_0x2b6ff5[_0xdc11('0x11b')]),_0xdc11('0x1db'),_0x2b6ff5[_0xdc11('0x3c')]);if(_0x2b6ff5['queueStatusComplete']){_0x2b6ff5[_0xdc11('0x11b')]=![];_0x55f377['queueBooked'][_0x55f377[_0xdc11('0x114')][_0x57d18f][_0xdc11('0xb9')]]=[];ami['Action']({'actionid':_0x57d18f,'action':'queuestatus','queue':_0x2b6ff5['name']})[_0xdc11('0xbc')](function(_0x351ddc){_0x55f377['updateOriginated'](_0x2b6ff5);_0x55f377['rescheduleContact']({'active':![],'ContactId':_0x55f377[_0xdc11('0x114')][_0x57d18f][_0xdc11('0xd9')],'ListId':_0x55f377['actions'][_0x57d18f][_0xdc11('0xda')],'VoiceQueueId':_0x55f377[_0xdc11('0x114')][_0x57d18f][_0xdc11('0xdc')]||undefined,'CampaignId':_0x55f377['actions'][_0x57d18f]['CampaignId']||undefined})[_0xdc11('0xbc')](loggerCatch(_0xdc11('0x1dc')));delete _0x55f377['actions'][_0x57d18f];});}else{loggerBooked[_0xdc11('0x7f')]('[booked][checkContactBlack][else]',JSON['stringify'](_0x2b6ff5[_0xdc11('0x11b')]),'Queue:\x20',_0x2b6ff5['name']);_0x55f377[_0xdc11('0xb8')](_0x2b6ff5);_0x55f377[_0xdc11('0xc6')]({'active':![],'ContactId':_0x55f377[_0xdc11('0x114')][_0x57d18f][_0xdc11('0xd9')],'ListId':_0x55f377[_0xdc11('0x114')][_0x57d18f][_0xdc11('0xda')],'VoiceQueueId':_0x55f377['actions'][_0x57d18f][_0xdc11('0xdc')]||undefined,'CampaignId':_0x55f377[_0xdc11('0x114')][_0x57d18f]['CampaignId']||undefined})[_0xdc11('0xbc')](loggerCatch(_0xdc11('0x1dc')));delete _0x55f377['actions'][_0x57d18f];}}else{return _0x55f377[_0xdc11('0x155')](_0x2b6ff5,_0x2dde8f);}}else{if(getDiff(_0x2dde8f['scheduledat'])<_0x2b6ff5['dialRecallMeTimeout']*0x3c){if(_0x2dde8f[_0xdc11('0x1dd')]&&!_0x2dde8f[_0xdc11('0x1dd')][_0xdc11('0x1de')]){_0x55f377[_0xdc11('0x98')]['run'](_0x2dde8f['id'])[_0xdc11('0x1c')](function(){_0x55f377[_0xdc11('0xb8')](_0x2b6ff5);});}else{_0x55f377['unlockContact']({'active':![]},_0x2dde8f['id'],0x1)[_0xdc11('0x1c')](function(){console[_0xdc11('0x1df')](_0xdc11('0x1e0'));_0x55f377[_0xdc11('0xb8')](_0x2b6ff5);});}}else{_0x2b6ff5[_0xdc11('0x65')]+=0x1;_0x55f377[_0xdc11('0xb8')](_0x2b6ff5);if(_0x2b6ff5[_0xdc11('0x1e1')]){_0x55f377[_0xdc11('0xc6')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2dde8f[_0xdc11('0xd9')],'ListId':_0x2dde8f[_0xdc11('0xda')],'VoiceQueueId':_0x2dde8f[_0xdc11('0xdc')]||undefined,'CampaignId':_0x2dde8f[_0xdc11('0xdd')]||undefined})[_0xdc11('0xbc')](loggerCatch(_0xdc11('0x1e2')));_0x55f377['createHistory'](createObjHistory(_0x2b6ff5,_0x2dde8f,_0xdc11('0x1e3'),0x17,_0xdc11('0x1e4')))['catch'](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x55f377[_0xdc11('0xd7')](createObjHistory(_0x2b6ff5,_0x2dde8f,_0xdc11('0x1e5'),0x16,_0xdc11('0x1e6')),'[Originate][HistoryRecallClose][historyCatch]',_0xdc11('0x1e7'));}}}}else{_0x2b6ff5[_0xdc11('0x5e')]+=0x1;_0x55f377[_0xdc11('0xd7')](createObjHistory(_0x2b6ff5,_0x2dde8f,'BLACKLIST',0xd,_0xdc11('0x1e8')),_0xdc11('0x1e9'),_0xdc11('0x1ea'));throw _0xdc11('0x1eb');}};};Dialer[_0xdc11('0x19')][_0xdc11('0x14c')]=function(_0x294eb8){var _0x1f3108=this;var _0x1f262a=[];var _0x39b489=_0x294eb8[_0xdc11('0x1ec')]-_0x294eb8[_0xdc11('0x71')]-_0x294eb8['temp'];emitCampaignSummary(_0x294eb8);if(_0x39b489>0x0){if(_0x39b489>this[_0xdc11('0x1ed')]){_0x39b489=this[_0xdc11('0x1ed')];}_0x294eb8[_0xdc11('0x1ee')]+=_0x39b489;this[_0xdc11('0xcc')](_0x294eb8['id'],_0x39b489,_0x294eb8[_0xdc11('0x1ef')])[_0xdc11('0xc0')](function(_0x161a0b){_0x294eb8[_0xdc11('0x1ee')]-=_0x39b489;_0x294eb8[_0xdc11('0x1ee')]=_0x294eb8[_0xdc11('0x1ee')]>0x0?_0x294eb8[_0xdc11('0x1ee')]:0x0;if(!checkContactEmpty(_0x161a0b)){_0x294eb8[_0xdc11('0x39')]=_0xdc11('0xa4');logger[_0xdc11('0x7f')](_0xdc11('0x1f0')+_0x294eb8[_0xdc11('0x3c')]);}else{_0x294eb8[_0xdc11('0x71')]+=_0x161a0b['length'];_0x294eb8[_0xdc11('0x39')]='RUNNING';for(var _0x5c48e0=0x0;_0x5c48e0<_0x161a0b[_0xdc11('0x120')];_0x5c48e0+=0x1){_0x294eb8[_0xdc11('0x1f1')]+=0x1;if(_[_0xdc11('0xe5')](_0x161a0b[_0x5c48e0])||_[_0xdc11('0xe5')](_0x161a0b[_0x5c48e0][_0xdc11('0x156')])||_[_0xdc11('0xe5')](_0x161a0b[_0x5c48e0][_0xdc11('0x156')][_0xdc11('0x157')])){_0x1f3108[_0xdc11('0xd5')](_0xdc11('0x1f2'),_0x294eb8,_0x161a0b[_0x5c48e0]);}else{_0x1f3108[_0xdc11('0xc1')](_[_0xdc11('0xd8')](_0x161a0b[_0x5c48e0],[_0xdc11('0xdd'),'Contact.phone']))[_0xdc11('0xc0')](_0x1f3108[_0xdc11('0x1d8')](_0x294eb8,_0x161a0b[_0x5c48e0]))['catch'](_0x1f3108[_0xdc11('0xd4')](_0xdc11('0x1f3'),_0x294eb8));}}}})[_0xdc11('0xbc')](loggerGetContactDialer(_0xdc11('0x1f4'),_0x294eb8,_0x39b489));}};Dialer['prototype'][_0xdc11('0x148')]=function(_0x21ef5d,_0xe93525){var _0x5908a2=this;var _0x50aa4c=[];var _0x41dcd0=_0xe93525>=0x1?_0xe93525:0x1;var _0x54c2d6=[];if(_0x21ef5d[_0xdc11('0x58')]===_0xdc11('0x7')){_0x41dcd0=0x1;}var _0x472df6=Math['floor'](_0x21ef5d[_0xdc11('0x4c')]*_0x41dcd0)-_0x21ef5d[_0xdc11('0x71')]-_0x21ef5d[_0xdc11('0x1ee')];emitVoiceQueueSummary(_0x21ef5d);if(_0x21ef5d[_0xdc11('0x1f5')]>0x0){var _0x563b5d=_0x21ef5d['dialLimitQueue']-_0x21ef5d[_0xdc11('0x71')]-_0x21ef5d['talking']-_0x21ef5d[_0xdc11('0x1ee')]-_0x21ef5d[_0xdc11('0x4e')];if(_0x472df6>_0x563b5d){_0x472df6=_0x563b5d;}}if(_0x472df6>0x0){if(_0x21ef5d[_0xdc11('0x58')]==='booked'){_0x472df6=0x1;}if(_0x472df6>this['maxNumberOriginate']){_0x472df6=this['maxNumberOriginate'];}_0x21ef5d['temp']+=_0x472df6;for(var _0x2ef690 in this['agents']){if(this[_0xdc11('0x20')][_0xdc11('0xb4')](_0x2ef690)){if(this[_0xdc11('0x20')][_0x2ef690][_0xdc11('0xad')]===_0xdc11('0x1f6')&&this[_0xdc11('0x20')][_0x2ef690][_0xdc11('0xe0')]===_0xdc11('0xe1')){_0x50aa4c[_0xdc11('0x119')](this['agents'][_0x2ef690]['id']);}}}this[_0xdc11('0xca')](_0x21ef5d['id'],_0x50aa4c,_0x472df6,_0x21ef5d[_0xdc11('0x1ef')])[_0xdc11('0xc0')](function(_0x61bf42){_0x21ef5d['temp']-=_0x472df6;_0x21ef5d[_0xdc11('0x1ee')]=_0x21ef5d['temp']>0x0?_0x21ef5d[_0xdc11('0x1ee')]:0x0;if(!checkContactEmpty(_0x61bf42)){_0x5908a2[_0xdc11('0x1f7')](_0x21ef5d)[_0xdc11('0xc0')](sendMessageReschedule(_0x21ef5d))[_0xdc11('0xbc')](loggerCatch(_0xdc11('0xbd')));}else{_0x21ef5d[_0xdc11('0x71')]+=_0x61bf42[_0xdc11('0x120')];_0x21ef5d[_0xdc11('0x39')]=_0x21ef5d[_0xdc11('0x58')]===_0xdc11('0x7')?'ACTIVE':_0xdc11('0x1f8');for(var _0xf5d670=0x0;_0xf5d670<_0x61bf42[_0xdc11('0x120')];_0xf5d670+=0x1){if(_['isNil'](_0x61bf42[_0xf5d670])||_['isNil'](_0x61bf42[_0xf5d670]['Contact'])||_[_0xdc11('0xe5')](_0x61bf42[_0xf5d670]['Contact']['phone'])){_0x5908a2[_0xdc11('0xd5')](_0xdc11('0x1f2'),_0x21ef5d,_0x61bf42[_0xf5d670]);}else{_0x5908a2[_0xdc11('0xbe')](_[_0xdc11('0xd8')](_0x61bf42[_0xf5d670],[_0xdc11('0xdc'),_0xdc11('0x1f9')]))[_0xdc11('0xc0')](_0x5908a2['checkContactBlack'](_0x21ef5d,_0x61bf42[_0xf5d670]))[_0xdc11('0xbc')](_0x5908a2[_0xdc11('0xd4')](_0xdc11('0x1f2'),_0x21ef5d));}}}})['catch'](loggerGetContactDialer(_0xdc11('0x1fa'),_0x21ef5d,_0x472df6));}};Dialer[_0xdc11('0x19')][_0xdc11('0x96')]=function(_0x441b11){var _0x46d81c=this;if(_0x441b11[_0xdc11('0x1f5')]>0x0){var _0xc30b95=_0x441b11[_0xdc11('0x1f5')]-_0x441b11[_0xdc11('0x71')]-_0x441b11['talking'];if(_0xc30b95>0x0){this[_0xdc11('0x1fb')](_0x441b11);}else{loggerPredictiveCalls[_0xdc11('0x7f')]('[handlePredictive][limitChannel]');}}else{this[_0xdc11('0x1fb')](_0x441b11);}};Dialer['prototype'][_0xdc11('0x1fb')]=function(_0x2bb0eb){var _0x4d4f13=this;var _0x430c21=[];_0x2bb0eb[_0xdc11('0x71')]+=0x1;for(var _0x515d63 in this[_0xdc11('0x20')]){if(this[_0xdc11('0x20')][_0xdc11('0xb4')](_0x515d63)){if(this[_0xdc11('0x20')][_0x515d63]['state']===_0xdc11('0x1f6')&&this[_0xdc11('0x20')][_0x515d63][_0xdc11('0xe0')]===_0xdc11('0xe1')){_0x430c21[_0xdc11('0x119')](this['agents'][_0x515d63]['id']);}}}this[_0xdc11('0xca')](_0x2bb0eb['id'],_0x430c21,0x1,_0x2bb0eb[_0xdc11('0x1ef')])[_0xdc11('0xc0')](function(_0x46aa32){if(!checkContactEmpty(_0x46aa32)){checkContactLowerLimitOriginate(_0x2bb0eb,0x1,0x0);_0x4d4f13[_0xdc11('0x1f7')](_0x2bb0eb)[_0xdc11('0xc0')](sendMessageReschedule(_0x2bb0eb))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x2bb0eb[_0xdc11('0x39')]='RUNNING';if(_[_0xdc11('0xe5')](_0x46aa32[0x0])||_[_0xdc11('0xe5')](_0x46aa32[0x0]['Contact'])||_[_0xdc11('0xe5')](_0x46aa32[0x0][_0xdc11('0x156')][_0xdc11('0x157')])){_0x4d4f13[_0xdc11('0xd5')](_0xdc11('0x1f2'),_0x2bb0eb,_0x46aa32[0x0]);}else{_0x4d4f13[_0xdc11('0xbe')](_[_0xdc11('0xd8')](_0x46aa32[0x0],['VoiceQueueId',_0xdc11('0x1f9')]))[_0xdc11('0xc0')](_0x4d4f13[_0xdc11('0x1d8')](_0x2bb0eb,_0x46aa32[0x0]))[_0xdc11('0xbc')](_0x4d4f13[_0xdc11('0xd4')](_0xdc11('0x1fc'),_0x2bb0eb));}}})[_0xdc11('0xbc')](loggerGetContactDialer(_0xdc11('0x1fd'),_0x2bb0eb,0x1));emitVoiceQueueSummary(_0x2bb0eb);};Dialer[_0xdc11('0x19')]['abandonmentRate']=function(_0x25bc64,_0x1948cc,_0x5ba660,_0x34d502,_0x42862d,_0x1b3bf7){loggerPredictive[_0xdc11('0x7f')](_0xdc11('0x1fe'));loggerPredictive[_0xdc11('0x7f')](_0xdc11('0x1ff'),_0x25bc64);loggerPredictive[_0xdc11('0x7f')](_0xdc11('0x200'),_0x1948cc);loggerPredictive[_0xdc11('0x7f')](_0xdc11('0x201'),_0x5ba660);loggerPredictive[_0xdc11('0x7f')](_0xdc11('0x202'),_0x34d502);loggerPredictive[_0xdc11('0x7f')](_0xdc11('0x203'),_0x42862d);loggerPredictive['info'](_0xdc11('0x87'));return new BPromise(function(_0x5dea96,_0x3b6837){if(_0x25bc64<=0x0||isNaN(_0x25bc64)){return _0x3b6837(msgResponse(_0xdc11('0x204'),_0xdc11('0x43'),'m\x20=\x20'+_0x25bc64));}if(_0x5ba660<=0x0||isNaN(_0x5ba660)){return _0x3b6837(msgResponse(_0xdc11('0x204'),'Error','Ts\x20=\x20'+_0x5ba660));}if(_0x34d502<=0x0||isNaN(_0x34d502)){return _0x3b6837(msgResponse(_0xdc11('0x204'),_0xdc11('0x43'),_0xdc11('0x205')+_0x34d502));}if(_0x1948cc<=0x0||isNaN(_0x1948cc)){return _0x3b6837(msgResponse(_0xdc11('0x204'),_0xdc11('0x43'),_0xdc11('0x206')+_0x1948cc));}if(_0x42862d<=0x0||isNaN(_0x42862d)){return _0x3b6837(msgResponse(_0xdc11('0x204'),_0xdc11('0x43'),_0xdc11('0x207')+_0x42862d));}_0x1b3bf7=_0x1b3bf7||0x0;var _0x356177=0x1/_0x5ba660;var _0x3ffb8a=0x0;var _0x4d48d1=0x0;var _0x44018a=0x0;var _0x3cdda8=0x0;for(var _0x4b38ca=0x0;_0x44018a<_0x42862d;_0x4b38ca+=0x1){_0x4d48d1=_0x4b38ca/_0x1948cc;_0x3ffb8a=(_0x34d502*_0x4d48d1+_0x1b3bf7)/_0x356177;_0x44018a=erlangb(_0x3ffb8a,_0x25bc64);_0x3cdda8=_0x3ffb8a/_0x25bc64*(0x1-erlangb(_0x3ffb8a,_0x25bc64));}return _0x5dea96({'erlangCalls':_0x4b38ca,'erlangCallToSecond':_0x1948cc/_0x4b38ca,'erlangAbandonmentRate':_0x44018a,'erlangBusyFactor':_0x3cdda8});});};Dialer[_0xdc11('0x19')]['busyFactor']=function(_0x34274b,_0x442c65,_0x1857b5,_0x52bf88,_0x1c647a,_0x11ce28){loggerPredictive[_0xdc11('0x7f')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xdc11('0x7f')]('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',_0x34274b);loggerPredictive[_0xdc11('0x7f')](_0xdc11('0x200'),_0x442c65);loggerPredictive[_0xdc11('0x7f')](_0xdc11('0x201'),_0x1857b5);loggerPredictive[_0xdc11('0x7f')]('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',_0x52bf88);loggerPredictive[_0xdc11('0x7f')](_0xdc11('0x208'),_0x1c647a);loggerPredictive[_0xdc11('0x7f')](_0xdc11('0x87'));return new BPromise(function(_0x3ef511,_0x52a89a){if(_0x34274b<=0x0||isNaN(_0x34274b)){return _0x52a89a(msgResponse(_0xdc11('0x209'),_0xdc11('0x43'),'m\x20=\x20'+_0x34274b));}if(_0x1857b5<=0x0||isNaN(_0x1857b5)){return _0x52a89a(msgResponse(_0xdc11('0x209'),'Error','Ts\x20=\x20'+_0x1857b5));}if(_0x52bf88<=0x0||isNaN(_0x52bf88)){return _0x52a89a(msgResponse('[busyFactor]',_0xdc11('0x43'),'p\x20=\x20'+_0x52bf88));}if(_0x442c65<=0x0||isNaN(_0x442c65)){return _0x52a89a(msgResponse(_0xdc11('0x209'),_0xdc11('0x43'),_0xdc11('0x206')+_0x442c65));}if(_0x1c647a<=0x0||isNaN(_0x1c647a)){return _0x52a89a(msgResponse('[busyFactor]',_0xdc11('0x43'),_0xdc11('0x20a')+_0x1c647a));}_0x11ce28=_0x11ce28||0x0;var _0x575ff1=0x1/_0x1857b5;var _0x391128=0x0;var _0x6d505f=0x0;var _0xb658bc=0x0;var _0x1fd893=0x0;for(var _0x346a92=0x0;_0x1fd893<_0x1c647a;_0x346a92+=0x1){_0x6d505f=_0x346a92/_0x442c65;_0x391128=(_0x52bf88*_0x6d505f+_0x11ce28)/_0x575ff1;_0xb658bc=erlangb(_0x391128,_0x34274b);_0x1fd893=_0x391128/_0x34274b*(0x1-erlangb(_0x391128,_0x34274b));}return _0x3ef511({'erlangCalls':_0x346a92,'erlangCallToSecond':_0x442c65/_0x346a92,'erlangAbandonmentRate':_0xb658bc,'erlangBusyFactor':_0x1fd893});});};module[_0xdc11('0x20b')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index c53e765..4971eee 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 _0xe795=['uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry'];(function(_0x34e1e7,_0x256967){var _0x1e023e=function(_0x1c4f3f){while(--_0x1c4f3f){_0x34e1e7['push'](_0x34e1e7['shift']());}};_0x1e023e(++_0x256967);}(_0xe795,0x191));var _0x5e79=function(_0xafdafe,_0x590359){_0xafdafe=_0xafdafe-0x0;var _0x47544c=_0xe795[_0xafdafe];return _0x47544c;};'use strict';var util=require(_0x5e79('0x0'));var _=require(_0x5e79('0x1'));var moment=require(_0x5e79('0x2'));function getSeconds(_0x67962a,_0x283a22){var _0x27425f=moment(_0x67962a)[_0x5e79('0x3')](0x0);var _0x2a1bc1=moment(_0x283a22)[_0x5e79('0x3')](0x0);return _0x27425f[_0x5e79('0x4')](_0x2a1bc1,_0x5e79('0x5'));}function QueueCallerAbandon(_0x287930,_0x57ced2){this['scheduledat']=_0x287930[_0x5e79('0x6')];this['type']=_0x287930[_0x5e79('0x7')];this[_0x5e79('0x8')]=_0x287930['type']===_0x5e79('0x9')?'queue':_0x287930[_0x5e79('0x7')];this[_0x5e79('0xa')]=_0x287930[_0x5e79('0xa')];this['countcongestionretry']=_0x287930['countcongestionretry'];this['countnoanswerretry']=_0x287930[_0x5e79('0xb')];this[_0x5e79('0xc')]=_0x287930[_0x5e79('0xa')]+_0x287930[_0x5e79('0xd')]+_0x287930[_0x5e79('0xb')]+_0x287930[_0x5e79('0xe')]+_0x287930[_0x5e79('0xf')]+_0x287930['countabandonedretry']+_0x287930['countmachineretry']+_0x287930[_0x5e79('0x10')];this[_0x5e79('0xe')]=_0x287930['countnosuchnumberretry'];this['countdropretry']=_0x287930['countdropretry'];this[_0x5e79('0x11')]=_0x287930[_0x5e79('0x11')];this[_0x5e79('0x12')]=_0x287930[_0x5e79('0x12')];this[_0x5e79('0x10')]=_0x287930[_0x5e79('0x10')];this['uniqueid']=_0x57ced2[_0x5e79('0x13')];this[_0x5e79('0x14')]=_0x287930[_0x5e79('0x15')];this[_0x5e79('0x16')]=_0x287930[_0x5e79('0x17')];this[_0x5e79('0x18')]=_0x287930[_0x5e79('0x18')];this['responsetime']=_0x287930[_0x5e79('0x19')];this[_0x5e79('0x1a')]=_0x287930[_0x5e79('0x1a')];this[_0x5e79('0x1b')]=this[_0x5e79('0x1a')];this[_0x5e79('0x1c')]=getSeconds(_0x287930[_0x5e79('0x19')],_0x287930[_0x5e79('0x18')]);this['holdtime']=getSeconds(this[_0x5e79('0x1a')],_0x287930[_0x5e79('0x19')]);this['talktime']=0x0;this[_0x5e79('0x1d')]=_0x57ced2[_0x5e79('0x1d')];this[_0x5e79('0x1e')]=_0x57ced2[_0x5e79('0x1f')];this[_0x5e79('0x20')]=_0x57ced2[_0x5e79('0x20')];this['callback']=_0x287930[_0x5e79('0x21')];this[_0x5e79('0x22')]=_0x287930[_0x5e79('0x22')];this[_0x5e79('0x23')]=_0x287930[_0x5e79('0x23')];this[_0x5e79('0x24')]=_0x287930['recallme'];this[_0x5e79('0x25')]=_0x287930[_0x5e79('0x25')];this[_0x5e79('0x26')]=_0x287930['ListId'];this[_0x5e79('0x27')]=_0x287930[_0x5e79('0x27')];this[_0x5e79('0x28')]=_0x287930['VoiceQueueId'];this['CampaignId']=_0x287930['CampaignId'];this['originatecalleridnum']=_0x287930[_0x5e79('0x29')]||'';this['originatecalleridname']=_0x287930['originatecalleridname']||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0xe3b9=['outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','type','campaigntype'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe3b9,0xd4));var _0x9e3b=function(_0x53cc8f,_0x2b3650){_0x53cc8f=_0x53cc8f-0x0;var _0x5010f1=_0xe3b9[_0x53cc8f];return _0x5010f1;};'use strict';var util=require(_0x9e3b('0x0'));var _=require(_0x9e3b('0x1'));var moment=require(_0x9e3b('0x2'));function getSeconds(_0x8c6811,_0x2a9641){var _0x209771=moment(_0x8c6811)[_0x9e3b('0x3')](0x0);var _0x9bdaf7=moment(_0x2a9641)[_0x9e3b('0x3')](0x0);return _0x209771[_0x9e3b('0x4')](_0x9bdaf7,_0x9e3b('0x5'));}function QueueCallerAbandon(_0x26abe8,_0x841383){this['scheduledat']=_0x26abe8['scheduledat'];this[_0x9e3b('0x6')]=_0x26abe8[_0x9e3b('0x6')];this[_0x9e3b('0x7')]=_0x26abe8[_0x9e3b('0x6')]===_0x9e3b('0x8')?_0x9e3b('0x9'):_0x26abe8[_0x9e3b('0x6')];this[_0x9e3b('0xa')]=_0x26abe8[_0x9e3b('0xa')];this['countcongestionretry']=_0x26abe8['countcongestionretry'];this[_0x9e3b('0xb')]=_0x26abe8['countnoanswerretry'];this[_0x9e3b('0xc')]=_0x26abe8[_0x9e3b('0xa')]+_0x26abe8[_0x9e3b('0xd')]+_0x26abe8[_0x9e3b('0xb')]+_0x26abe8['countnosuchnumberretry']+_0x26abe8[_0x9e3b('0xe')]+_0x26abe8[_0x9e3b('0xf')]+_0x26abe8['countmachineretry']+_0x26abe8[_0x9e3b('0x10')];this[_0x9e3b('0x11')]=_0x26abe8['countnosuchnumberretry'];this[_0x9e3b('0xe')]=_0x26abe8[_0x9e3b('0xe')];this[_0x9e3b('0xf')]=_0x26abe8[_0x9e3b('0xf')];this[_0x9e3b('0x12')]=_0x26abe8[_0x9e3b('0x12')];this[_0x9e3b('0x10')]=_0x26abe8[_0x9e3b('0x10')];this['uniqueid']=_0x841383[_0x9e3b('0x13')];this[_0x9e3b('0x14')]=_0x26abe8[_0x9e3b('0x15')];this[_0x9e3b('0x16')]=_0x26abe8[_0x9e3b('0x17')];this[_0x9e3b('0x18')]=_0x26abe8['starttime'];this[_0x9e3b('0x19')]=_0x26abe8[_0x9e3b('0x19')];this[_0x9e3b('0x1a')]=_0x26abe8[_0x9e3b('0x1a')];this[_0x9e3b('0x1b')]=this[_0x9e3b('0x1a')];this[_0x9e3b('0x1c')]=getSeconds(_0x26abe8[_0x9e3b('0x19')],_0x26abe8[_0x9e3b('0x18')]);this[_0x9e3b('0x1d')]=getSeconds(this['droptime'],_0x26abe8[_0x9e3b('0x19')]);this[_0x9e3b('0x1e')]=0x0;this[_0x9e3b('0x9')]=_0x841383[_0x9e3b('0x9')];this[_0x9e3b('0x1f')]=_0x841383[_0x9e3b('0x20')];this[_0x9e3b('0x21')]=_0x841383[_0x9e3b('0x21')];this[_0x9e3b('0x22')]=_0x26abe8[_0x9e3b('0x22')];this['callbackuniqueid']=_0x26abe8['callbackuniqueid'];this[_0x9e3b('0x23')]=_0x26abe8[_0x9e3b('0x23')];this[_0x9e3b('0x24')]=_0x26abe8[_0x9e3b('0x24')];this[_0x9e3b('0x25')]=_0x26abe8[_0x9e3b('0x25')];this['ListId']=_0x26abe8['ListId'];this[_0x9e3b('0x26')]=_0x26abe8[_0x9e3b('0x26')];this[_0x9e3b('0x27')]=_0x26abe8['VoiceQueueId'];this[_0x9e3b('0x28')]=_0x26abe8[_0x9e3b('0x28')];this['originatecalleridnum']=_0x26abe8[_0x9e3b('0x29')]||'';this['originatecalleridname']=_0x26abe8[_0x9e3b('0x2a')]||'';}module[_0x9e3b('0x2b')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index be742c1..faeeb76 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 _0x2dff=['%s/%s/%s','tech','Trunk','name','localstationid','headerinfo','AttachmentId','lodash','moment','uniqueid','channel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2dff,0xac));var _0xf2df=function(_0x3a21c1,_0x1dcf73){_0x3a21c1=_0x3a21c1-0x0;var _0x5be9c6=_0x2dff[_0x3a21c1];return _0x5be9c6;};'use strict';var util=require('util');var _=require(_0xf2df('0x0'));var moment=require(_0xf2df('0x1'));function Action(_0x1f556b,_0x5a6f80,_0x387882){this[_0xf2df('0x2')]=_0x1f556b||undefined;this[_0xf2df('0x3')]=util['format'](_0xf2df('0x4'),_0x5a6f80[_0xf2df('0x5')],_0x5a6f80[_0xf2df('0x6')][_0xf2df('0x7')],_0x387882['fax']);this[_0xf2df('0x8')]=_0x5a6f80[_0xf2df('0x8')];this[_0xf2df('0x9')]=_0x5a6f80['headerinfo'];this['path']=_0x387882['path'];this[_0xf2df('0xa')]=_0x387882[_0xf2df('0xa')];}module['exports']=Action; \ No newline at end of file +var _0x74d5=['name','fax','localstationid','headerinfo','path','exports','util','moment','uniqueid','channel','format','%s/%s/%s','Trunk'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x74d5,0xd6));var _0x574d=function(_0x2dfd0e,_0x13739e){_0x2dfd0e=_0x2dfd0e-0x0;var _0x343af6=_0x74d5[_0x2dfd0e];return _0x343af6;};'use strict';var util=require(_0x574d('0x0'));var _=require('lodash');var moment=require(_0x574d('0x1'));function Action(_0x298b8d,_0x569aee,_0x27f476){this[_0x574d('0x2')]=_0x298b8d||undefined;this[_0x574d('0x3')]=util[_0x574d('0x4')](_0x574d('0x5'),_0x569aee['tech'],_0x569aee[_0x574d('0x6')][_0x574d('0x7')],_0x27f476[_0x574d('0x8')]);this[_0x574d('0x9')]=_0x569aee[_0x574d('0x9')];this['headerinfo']=_0x569aee[_0x574d('0xa')];this[_0x574d('0xb')]=_0x27f476[_0x574d('0xb')];this['AttachmentId']=_0x27f476['AttachmentId'];}module[_0x574d('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index ab90c88..49a9fdf 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 _0xa7cf=['catch','error','\x20notify\x20','\x20receiveFax\x20','stringify','syncOriginateResponse','pick','response','reason','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][NoUpdate1]','updateStatus','AttachmentId','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','execOriginate','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','message','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','format','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','lodash','bluebird','uuid','tiff2pdf','./util/gs','../ami','./channel','./util/util','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','bind','varset','syncVarSet','newstate','syncNewExten','syncReceiveFax','syncHangup','prototype','syncNewchannel','context','from-voip-provider','hasOwnProperty','localstationid','channels','uniqueid','channel','name','\x20syncNewchannel\x20','info','variable','value','syncNewState','channelstate','channelstatedesc','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','.pdf','application/pdf','fax'];(function(_0x87e628,_0x40f176){var _0x1a5387=function(_0x2dd4be){while(--_0x2dd4be){_0x87e628['push'](_0x87e628['shift']());}};_0x1a5387(++_0x40f176);}(_0xa7cf,0x174));var _0xfa7c=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xa7cf[_0x1589dd];return _0x1bddd1;};'use strict';var util=require(_0xfa7c('0x0'));var _=require(_0xfa7c('0x1'));var BPromise=require(_0xfa7c('0x2'));var uuid=require(_0xfa7c('0x3'));var moment=require('moment');var path=require('path');var tiff2pdf=require(_0xfa7c('0x4'));var gs=require(_0xfa7c('0x5'));var logger=require('../../../config/logger')('fax');var ami=require(_0xfa7c('0x6'));var rpcDb=require('./rpcDb');var Channel=require(_0xfa7c('0x7'));var ut=require(_0xfa7c('0x8'));var Action=require('./action');var faxAccount=require('../rpc/faxAccount');var attachment=require(_0xfa7c('0x9'));var faxMessage=require(_0xfa7c('0xa'));function Fax(_0x504b9e){this['channels']={};this[_0xfa7c('0xb')]=_0x504b9e[_0xfa7c('0xb')];this[_0xfa7c('0xc')]=_0x504b9e['trunks'];this[_0xfa7c('0xd')]={};ami['on'](_0xfa7c('0xe'),this['syncNewchannel'][_0xfa7c('0xf')](this));ami['on'](_0xfa7c('0x10'),this[_0xfa7c('0x11')]['bind'](this));ami['on'](_0xfa7c('0x12'),this['syncNewState'][_0xfa7c('0xf')](this));ami['on']('newexten',this[_0xfa7c('0x13')]['bind'](this));ami['on']('faxstatus',this['syncFaxStatus'][_0xfa7c('0xf')](this));ami['on']('receivefax',this[_0xfa7c('0x14')][_0xfa7c('0xf')](this));ami['on']('hangup',this[_0xfa7c('0x15')]['bind'](this));ami['on']('originateresponse',this['syncOriginateResponse']['bind'](this));}Fax[_0xfa7c('0x16')][_0xfa7c('0x17')]=function(_0x269d85){if(_0x269d85[_0xfa7c('0x18')]===_0xfa7c('0x19')){for(var _0x20e744 in this[_0xfa7c('0xb')]){if(this[_0xfa7c('0xb')][_0xfa7c('0x1a')](_0x20e744)){if(_0x269d85['exten']===this['faxAccounts'][_0x20e744][_0xfa7c('0x1b')]){this[_0xfa7c('0x1c')][_0x269d85['uniqueid']]={};this[_0xfa7c('0x1c')][_0x269d85[_0xfa7c('0x1d')]][_0xfa7c('0x1e')]=_0x269d85[_0xfa7c('0x1e')];this['channels'][_0x269d85['uniqueid']]['id']=this['faxAccounts'][_0x20e744]['id'];this['channels'][_0x269d85[_0xfa7c('0x1d')]]['name']=this[_0xfa7c('0xb')][_0x20e744][_0xfa7c('0x1f')];logger['info'](_0x269d85[_0xfa7c('0x1d')],_0xfa7c('0x20'));}}}}if(this[_0xfa7c('0xd')][_0x269d85[_0xfa7c('0x1d')]]){this[_0xfa7c('0x1c')][_0x269d85[_0xfa7c('0x1d')]]={};this[_0xfa7c('0x1c')][_0x269d85[_0xfa7c('0x1d')]]['channel']=_0x269d85[_0xfa7c('0x1e')];logger[_0xfa7c('0x21')](_0x269d85[_0xfa7c('0x1d')],_0xfa7c('0x20'));}};Fax[_0xfa7c('0x16')][_0xfa7c('0x11')]=function(_0x10b626){if(this[_0xfa7c('0x1c')][_0x10b626[_0xfa7c('0x1d')]]){for(var _0x2e52ff in _0x10b626[_0xfa7c('0x22')]){if(_0x10b626[_0xfa7c('0x22')]['hasOwnProperty'](_0x2e52ff)){this[_0xfa7c('0x1c')][_0x10b626[_0xfa7c('0x1d')]][_0x2e52ff]=_0x10b626[_0xfa7c('0x23')];}}}};Fax[_0xfa7c('0x16')][_0xfa7c('0x24')]=function(_0x2a344a){if(this[_0xfa7c('0x1c')][_0x2a344a[_0xfa7c('0x1d')]]){this[_0xfa7c('0x1c')][_0x2a344a['uniqueid']][_0xfa7c('0x25')]=_0x2a344a[_0xfa7c('0x25')];this[_0xfa7c('0x1c')][_0x2a344a[_0xfa7c('0x1d')]][_0xfa7c('0x26')]=_0x2a344a['channelstatedesc'];}};Fax[_0xfa7c('0x16')][_0xfa7c('0x13')]=function(_0x17bb2f){if(this['channels'][_0x17bb2f[_0xfa7c('0x1d')]]){for(var _0x23ae15 in _0x17bb2f[_0xfa7c('0x22')]){if(_0x17bb2f[_0xfa7c('0x22')][_0xfa7c('0x1a')](_0x23ae15)){this[_0xfa7c('0x1c')][_0x17bb2f[_0xfa7c('0x1d')]][_0x23ae15]=_0x17bb2f[_0xfa7c('0x23')];}}}};Fax[_0xfa7c('0x16')][_0xfa7c('0x27')]=function(_0xf455ab){if(this[_0xfa7c('0x1c')][_0xf455ab[_0xfa7c('0x1d')]]){this[_0xfa7c('0x1c')][_0xf455ab[_0xfa7c('0x1d')]][_0xfa7c('0x28')]=_0xf455ab[_0xfa7c('0x28')];this[_0xfa7c('0x1c')][_0xf455ab['uniqueid']][_0xfa7c('0x29')]=_0xf455ab[_0xfa7c('0x29')];this['channels'][_0xf455ab[_0xfa7c('0x1d')]][_0xfa7c('0x1b')]=_0xf455ab['localstationid'];this[_0xfa7c('0x1c')][_0xf455ab[_0xfa7c('0x1d')]][_0xfa7c('0x2a')]=_0xf455ab[_0xfa7c('0x2a')];logger[_0xfa7c('0x21')](_0xf455ab[_0xfa7c('0x1d')],_0xfa7c('0x2b'));}};Fax[_0xfa7c('0x16')][_0xfa7c('0x14')]=function(_0x5826ac){var _0x1fbbda=this;if(this[_0xfa7c('0x1c')][_0x5826ac['uniqueid']]){var _0x31713c=this[_0xfa7c('0x1c')][_0x5826ac[_0xfa7c('0x1d')]]['id'];this[_0xfa7c('0x1c')][_0x5826ac[_0xfa7c('0x1d')]][_0xfa7c('0x2c')]=_0x5826ac[_0xfa7c('0x2c')];this[_0xfa7c('0x1c')][_0x5826ac['uniqueid']]['pagestransferred']=_0x5826ac[_0xfa7c('0x2d')];this['channels'][_0x5826ac[_0xfa7c('0x1d')]][_0xfa7c('0x1b')]=_0x5826ac['localstationid'];this['channels'][_0x5826ac[_0xfa7c('0x1d')]]['resolution']=_0x5826ac[_0xfa7c('0x2e')];this[_0xfa7c('0x1c')][_0x5826ac['uniqueid']][_0xfa7c('0x2f')]=_0x5826ac[_0xfa7c('0x2f')];this[_0xfa7c('0x1c')][_0x5826ac[_0xfa7c('0x1d')]]['filename']=_0x5826ac['filename'];this[_0xfa7c('0x1c')][_0x5826ac['uniqueid']][_0xfa7c('0x30')]=_0x5826ac['calleridnum'];if(this[_0xfa7c('0x1c')][_0x5826ac[_0xfa7c('0x1d')]]['pagestransferred']>0x0){tiff2pdf(_0x5826ac['filename'],_0xfa7c('0x31'),function(_0x4ac8d6){logger[_0xfa7c('0x21')](_0x5826ac[_0xfa7c('0x1d')],_0xfa7c('0x32'),_0x4ac8d6['message']);attachment[_0xfa7c('0x33')]({'name':path['parse'](_0x5826ac[_0xfa7c('0x2a')])[_0xfa7c('0x1f')],'basename':path[_0xfa7c('0x34')](_0x5826ac[_0xfa7c('0x2a')])[_0xfa7c('0x1f')]+_0xfa7c('0x35'),'type':_0xfa7c('0x36')})['then'](function(_0x550e95){faxAccount['notify'](_0x31713c,{'from':_0x5826ac[_0xfa7c('0x30')],'mapKey':_0xfa7c('0x37'),'body':path[_0xfa7c('0x34')](_0x5826ac[_0xfa7c('0x2a')])['name']+_0xfa7c('0x35'),'AttachmentId':_0x550e95['id']})[_0xfa7c('0x38')](function(_0x58de64){logger[_0xfa7c('0x39')](_0x5826ac[_0xfa7c('0x1d')],_0xfa7c('0x3a'),JSON['stringify'](_0x58de64));});})[_0xfa7c('0x38')](function(_0x4ca61d){logger[_0xfa7c('0x39')](_0x5826ac[_0xfa7c('0x1d')],_0xfa7c('0x3b'),JSON[_0xfa7c('0x3c')](_0x4ca61d));});});}logger['info'](_0x5826ac[_0xfa7c('0x1d')],_0xfa7c('0x3b'));}};Fax[_0xfa7c('0x16')][_0xfa7c('0x3d')]=function(_0x42e5c2){if(this['actions'][_0x42e5c2[_0xfa7c('0x1d')]]){_['merge'](this[_0xfa7c('0x1c')][_0x42e5c2[_0xfa7c('0x1d')]],_[_0xfa7c('0x3e')](_0x42e5c2,[_0xfa7c('0x3f'),_0xfa7c('0x40')]));}};function updateStatus(_0x594528){if(_0x594528['AttachmentId']){faxMessage['update'](_0x594528['AttachmentId'],{'failMessage':_0xfa7c('0x41')})[_0xfa7c('0x42')](function(_0x47fdc9){ut[_0xfa7c('0x43')]('[Fax][Message][Error][Updated]',_0x47fdc9);})[_0xfa7c('0x38')](function(_0x16a5cf){ut[_0xfa7c('0x43')](_0xfa7c('0x44'),_0x16a5cf);});}else{ut[_0xfa7c('0x43')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0xfa7c('0x16')][_0xfa7c('0x45')]=function(_0x18633f,_0x1ed301,_0x474305){var _0xe01c14=this;var _0x59b43c={};if(_0x1ed301){_0x59b43c={'read':_0x1ed301};}else{_0x59b43c={'failMessage':_0x474305};}if(this[_0xfa7c('0xd')][_0x18633f][_0xfa7c('0x46')]){faxMessage['update'](this['actions'][_0x18633f][_0xfa7c('0x46')],_0x59b43c)[_0xfa7c('0x42')](function(_0x335159){ut[_0xfa7c('0x43')](_0xfa7c('0x47'),_0x335159);})[_0xfa7c('0x38')](function(_0x71cea7){ut['logger'](_0xfa7c('0x48'),_0x71cea7);})[_0xfa7c('0x49')](function(){delete _0xe01c14[_0xfa7c('0x1c')][_0x18633f];delete _0xe01c14[_0xfa7c('0xd')][_0x18633f];});}else{ut['logger'](_0xfa7c('0x4a'));delete this['channels'][_0x18633f];delete this[_0xfa7c('0xd')][_0x18633f];}};Fax['prototype'][_0xfa7c('0x15')]=function(_0x398a06){var _0x31215a=this;if(this[_0xfa7c('0x1c')][_0x398a06['uniqueid']]){if(this[_0xfa7c('0xd')][_0x398a06[_0xfa7c('0x1d')]]){this[_0xfa7c('0x1c')][_0x398a06[_0xfa7c('0x1d')]]['id']=this[_0xfa7c('0xd')][_0x398a06[_0xfa7c('0x1d')]]['id'];this[_0xfa7c('0x1c')][_0x398a06[_0xfa7c('0x1d')]][_0xfa7c('0x1f')]=this['actions'][_0x398a06['uniqueid']][_0xfa7c('0x1f')];}logger['info'](_0x398a06['uniqueid'],this[_0xfa7c('0xd')][_0x398a06['uniqueid']]?'\x20hangup\x20sendFile\x20':_0xfa7c('0x4b'),JSON['stringify'](this[_0xfa7c('0x1c')][_0x398a06[_0xfa7c('0x1d')]]));if(this['actions'][_0x398a06[_0xfa7c('0x1d')]]){if(this['channels'][_0x398a06[_0xfa7c('0x1d')]]['faxpages']>0x0&&this['channels'][_0x398a06[_0xfa7c('0x1d')]]['faxstatus']===_0xfa7c('0x4c')){this['updateStatus'](_0x398a06[_0xfa7c('0x1d')],!![]);}else{this[_0xfa7c('0x45')](_0x398a06[_0xfa7c('0x1d')],![],this[_0xfa7c('0x1c')][_0x398a06[_0xfa7c('0x1d')]][_0xfa7c('0x4d')]?_0xfa7c('0x4e')+this[_0xfa7c('0x1c')][_0x398a06[_0xfa7c('0x1d')]][_0xfa7c('0x4d')]:'SENDING\x20FAILED');}}}};Fax['prototype']['send']=function(_0x344034){var _0x52d4c5=this;return new BPromise(function(_0x210107,_0x4dc2ab){_0x52d4c5[_0xfa7c('0x4f')](_0x344034,_0x52d4c5[_0xfa7c('0xb')][_0x344034['FaxAccountId']])[_0xfa7c('0x42')](function(_0x13f8dd){ut[_0xfa7c('0x43')](_0xfa7c('0x50'),_0x13f8dd);_0x210107(ut['message'](_0xfa7c('0x51')));})[_0xfa7c('0x38')](function(_0x25513d){ut[_0xfa7c('0x43')]('[Fax][execOriginate][failure]',_0x25513d);updateStatus(_0x344034);_0x4dc2ab(ut['message'](_0xfa7c('0x52')));});});};Fax[_0xfa7c('0x16')][_0xfa7c('0x53')]=function(_0x933a22){var _0x27f115=this;return new BPromise(function(_0x16c76f,_0x27d35f){var _0x2b8ae4=_0x27f115[_0xfa7c('0x54')](_0x27f115['faxAccounts'][_0x933a22[_0xfa7c('0x55')]]['Trunk'],_0x933a22);if(_0x2b8ae4['isValid']){_0x16c76f(ut[_0xfa7c('0x56')](_0xfa7c('0x57')));}else{_0x27d35f(ut[_0xfa7c('0x56')](_0x2b8ae4[_0xfa7c('0x56')]));}});};function originate(_0x53c9ff,_0xae275c,_0xfbd31e){return new BPromise(function(_0x53d990,_0x3d1058){if(_0xfbd31e){var _0x3e3c94=util['format'](_0xfa7c('0x58'),path[_0xfa7c('0x34')](_0x53c9ff[_0xfa7c('0x59')])['name'],_0x53c9ff[_0xfa7c('0x59')]);gs['execute'](_0x3e3c94)[_0xfa7c('0x42')](function(){_0x53c9ff[_0xfa7c('0x59')]=util[_0xfa7c('0x5a')](_0xfa7c('0x5b'),path[_0xfa7c('0x34')](_0x53c9ff[_0xfa7c('0x59')])['dir'],path[_0xfa7c('0x34')](_0x53c9ff['path'])[_0xfa7c('0x1f')]);_0xae275c[_0xfa7c('0x5c')]=_0x53c9ff[_0xfa7c('0x59')];ut[_0xfa7c('0x43')](_0xfa7c('0x5d'),'');ami[_0xfa7c('0x5e')](ut[_0xfa7c('0x5f')](_0x53c9ff,_0xae275c))[_0xfa7c('0x42')](function(_0x45afab){_0x53d990(_0x45afab);})[_0xfa7c('0x38')](function(_0x494422){_0x3d1058(_0x494422);});})['catch'](function(_0x4be479){_0x3d1058(_0x4be479);});}else{ami[_0xfa7c('0x5e')](ut['variablesAction'](_0x53c9ff,_0xae275c))[_0xfa7c('0x42')](function(_0x1d46d1){_0x53d990(_0x1d46d1);})[_0xfa7c('0x38')](function(_0x309f02){_0x3d1058(_0x309f02);});}});}Fax['prototype'][_0xfa7c('0x4f')]=function(_0x44f028,_0x244539){var _0x161d5d=this;return new BPromise(function(_0x3373f3,_0x576bd2){var _0x35a3c8=uuid['v4']();var _0x386c93=ut['addVariables'](_0x44f028,_0x244539);_0x161d5d['actions'][_0x35a3c8]=new Action(_0x35a3c8,_0x244539,_0x44f028);var _0x43798b=_0x161d5d['actions'][_0x35a3c8];if(path[_0xfa7c('0x34')](_0x44f028[_0xfa7c('0x59')])['ext']===_0xfa7c('0x35')){originate(_0x43798b,_0x386c93,!![])[_0xfa7c('0x42')](function(_0x547cc4){_0x3373f3(_0x547cc4);})[_0xfa7c('0x38')](function(_0x594c34){_0x576bd2(_0x594c34);});}else{originate(_0x43798b,_0x386c93,![])[_0xfa7c('0x42')](function(_0x18a0e4){_0x3373f3(_0x18a0e4);})['catch'](function(_0x2ee801){_0x576bd2(_0x2ee801);});}});};Fax[_0xfa7c('0x16')][_0xfa7c('0x60')]=function(_0x9980f7){return!_['isNil'](_0x9980f7)&&!_[_0xfa7c('0x61')](_0x9980f7['name'])&&!_[_0xfa7c('0x61')](_0x9980f7['active'])&&_0x9980f7[_0xfa7c('0x62')]&&!_[_0xfa7c('0x61')](this[_0xfa7c('0xc')][util[_0xfa7c('0x5a')](_0xfa7c('0x63'),_0x9980f7[_0xfa7c('0x1f')])])&&!_['isNil'](this[_0xfa7c('0xc')][util[_0xfa7c('0x5a')](_0xfa7c('0x63'),_0x9980f7[_0xfa7c('0x1f')])][_0xfa7c('0x29')])&&(this[_0xfa7c('0xc')][util['format'](_0xfa7c('0x63'),_0x9980f7[_0xfa7c('0x1f')])][_0xfa7c('0x29')]===_0xfa7c('0x64')||this[_0xfa7c('0xc')][util[_0xfa7c('0x5a')]('SIP/%s',_0x9980f7[_0xfa7c('0x1f')])][_0xfa7c('0x29')]===_0xfa7c('0x65'));};Fax['prototype']['checkTrunk']=function(_0x21de53,_0x494473){if(!this[_0xfa7c('0x60')](_0x21de53)){ut[_0xfa7c('0x43')](_0xfa7c('0x66'),_[_0xfa7c('0x61')](_0x21de53)?'':_0x21de53['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0xfa7c('0x67')};}if(_['isNil'](_0x494473[_0xfa7c('0x37')])){ut[_0xfa7c('0x43')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xfa7c('0x3c')](_0x494473));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xfa7c('0x61')](_0x494473[_0xfa7c('0x59')])){ut[_0xfa7c('0x43')](_0xfa7c('0x68'),JSON[_0xfa7c('0x3c')](_0x494473));return{'isValid':![],'message':_0xfa7c('0x69')};}return{'isValid':!![],'message':_0xfa7c('0x6a')};};module['exports']=Fax; \ No newline at end of file +var _0x2799=['channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','syncHangup','syncOriginateResponse','prototype','context','from-voip-provider','localstationid','uniqueid','channel','name','info','actions','\x20syncNewchannel\x20','variable','hasOwnProperty','value','channelstate','channelstatedesc','status','\x20syncFaxStatus\x20','remotestationid','resolution','transferrate','filename','calleridnum','pagestransferred','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','.pdf','then','notify','parse','error','\x20notify\x20','stringify','catch','\x20receiveFax\x20','merge','pick','response','reason','logger','[Fax][Message][Error][Updated]','AttachmentId','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','FaxAccountId','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','path','execute','XMF-PATH','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','lodash','uuid','moment','tiff2pdf','../../../config/logger','fax','./channel','./util/util','../rpc/faxAccount','../rpc/faxMessage'];(function(_0x4c9fe6,_0x2b2a33){var _0x263a47=function(_0x27c190){while(--_0x27c190){_0x4c9fe6['push'](_0x4c9fe6['shift']());}};_0x263a47(++_0x2b2a33);}(_0x2799,0xd9));var _0x9279=function(_0x2e10bc,_0x3b5570){_0x2e10bc=_0x2e10bc-0x0;var _0x45e853=_0x2799[_0x2e10bc];return _0x45e853;};'use strict';var util=require(_0x9279('0x0'));var _=require(_0x9279('0x1'));var BPromise=require('bluebird');var uuid=require(_0x9279('0x2'));var moment=require(_0x9279('0x3'));var path=require('path');var tiff2pdf=require(_0x9279('0x4'));var gs=require('./util/gs');var logger=require(_0x9279('0x5'))(_0x9279('0x6'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require(_0x9279('0x7'));var ut=require(_0x9279('0x8'));var Action=require('./action');var faxAccount=require(_0x9279('0x9'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x9279('0xa'));function Fax(_0x1ae3a1){this[_0x9279('0xb')]={};this[_0x9279('0xc')]=_0x1ae3a1[_0x9279('0xc')];this['trunks']=_0x1ae3a1[_0x9279('0xd')];this['actions']={};ami['on'](_0x9279('0xe'),this[_0x9279('0xf')][_0x9279('0x10')](this));ami['on'](_0x9279('0x11'),this[_0x9279('0x12')][_0x9279('0x10')](this));ami['on'](_0x9279('0x13'),this[_0x9279('0x14')][_0x9279('0x10')](this));ami['on'](_0x9279('0x15'),this[_0x9279('0x16')][_0x9279('0x10')](this));ami['on'](_0x9279('0x17'),this[_0x9279('0x18')][_0x9279('0x10')](this));ami['on']('receivefax',this[_0x9279('0x19')][_0x9279('0x10')](this));ami['on']('hangup',this[_0x9279('0x1a')][_0x9279('0x10')](this));ami['on']('originateresponse',this[_0x9279('0x1b')]['bind'](this));}Fax[_0x9279('0x1c')]['syncNewchannel']=function(_0x356130){if(_0x356130[_0x9279('0x1d')]===_0x9279('0x1e')){for(var _0x1c4ae6 in this[_0x9279('0xc')]){if(this['faxAccounts']['hasOwnProperty'](_0x1c4ae6)){if(_0x356130['exten']===this[_0x9279('0xc')][_0x1c4ae6][_0x9279('0x1f')]){this[_0x9279('0xb')][_0x356130[_0x9279('0x20')]]={};this[_0x9279('0xb')][_0x356130[_0x9279('0x20')]][_0x9279('0x21')]=_0x356130['channel'];this['channels'][_0x356130[_0x9279('0x20')]]['id']=this[_0x9279('0xc')][_0x1c4ae6]['id'];this[_0x9279('0xb')][_0x356130[_0x9279('0x20')]][_0x9279('0x22')]=this['faxAccounts'][_0x1c4ae6][_0x9279('0x22')];logger[_0x9279('0x23')](_0x356130['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0x9279('0x24')][_0x356130[_0x9279('0x20')]]){this['channels'][_0x356130[_0x9279('0x20')]]={};this['channels'][_0x356130['uniqueid']][_0x9279('0x21')]=_0x356130[_0x9279('0x21')];logger[_0x9279('0x23')](_0x356130['uniqueid'],_0x9279('0x25'));}};Fax['prototype'][_0x9279('0x12')]=function(_0x5287f9){if(this[_0x9279('0xb')][_0x5287f9[_0x9279('0x20')]]){for(var _0x3ff84d in _0x5287f9[_0x9279('0x26')]){if(_0x5287f9[_0x9279('0x26')][_0x9279('0x27')](_0x3ff84d)){this[_0x9279('0xb')][_0x5287f9[_0x9279('0x20')]][_0x3ff84d]=_0x5287f9[_0x9279('0x28')];}}}};Fax['prototype'][_0x9279('0x14')]=function(_0x1140fd){if(this['channels'][_0x1140fd['uniqueid']]){this[_0x9279('0xb')][_0x1140fd['uniqueid']]['channelstate']=_0x1140fd[_0x9279('0x29')];this[_0x9279('0xb')][_0x1140fd[_0x9279('0x20')]]['channelstatedesc']=_0x1140fd[_0x9279('0x2a')];}};Fax['prototype'][_0x9279('0x16')]=function(_0x70016d){if(this[_0x9279('0xb')][_0x70016d['uniqueid']]){for(var _0x3728a7 in _0x70016d[_0x9279('0x26')]){if(_0x70016d[_0x9279('0x26')][_0x9279('0x27')](_0x3728a7)){this['channels'][_0x70016d['uniqueid']][_0x3728a7]=_0x70016d[_0x9279('0x28')];}}}};Fax[_0x9279('0x1c')]['syncFaxStatus']=function(_0x33747b){if(this[_0x9279('0xb')][_0x33747b[_0x9279('0x20')]]){this[_0x9279('0xb')][_0x33747b['uniqueid']]['operation']=_0x33747b['operation'];this[_0x9279('0xb')][_0x33747b[_0x9279('0x20')]][_0x9279('0x2b')]=_0x33747b[_0x9279('0x2b')];this['channels'][_0x33747b[_0x9279('0x20')]][_0x9279('0x1f')]=_0x33747b[_0x9279('0x1f')];this[_0x9279('0xb')][_0x33747b[_0x9279('0x20')]]['filename']=_0x33747b['filename'];logger['info'](_0x33747b[_0x9279('0x20')],_0x9279('0x2c'));}};Fax[_0x9279('0x1c')]['syncReceiveFax']=function(_0x215029){var _0x24ac8a=this;if(this[_0x9279('0xb')][_0x215029['uniqueid']]){var _0x5d3d5e=this[_0x9279('0xb')][_0x215029[_0x9279('0x20')]]['id'];this[_0x9279('0xb')][_0x215029[_0x9279('0x20')]][_0x9279('0x2d')]=_0x215029['remotestationid'];this[_0x9279('0xb')][_0x215029[_0x9279('0x20')]]['pagestransferred']=_0x215029['pagestransferred'];this[_0x9279('0xb')][_0x215029['uniqueid']][_0x9279('0x1f')]=_0x215029[_0x9279('0x1f')];this['channels'][_0x215029[_0x9279('0x20')]]['resolution']=_0x215029[_0x9279('0x2e')];this[_0x9279('0xb')][_0x215029[_0x9279('0x20')]][_0x9279('0x2f')]=_0x215029[_0x9279('0x2f')];this[_0x9279('0xb')][_0x215029[_0x9279('0x20')]][_0x9279('0x30')]=_0x215029[_0x9279('0x30')];this[_0x9279('0xb')][_0x215029[_0x9279('0x20')]][_0x9279('0x31')]=_0x215029[_0x9279('0x31')];if(this[_0x9279('0xb')][_0x215029[_0x9279('0x20')]][_0x9279('0x32')]>0x0){tiff2pdf(_0x215029[_0x9279('0x30')],_0x9279('0x33'),function(_0x3b69b5){logger['info'](_0x215029[_0x9279('0x20')],_0x9279('0x34'),_0x3b69b5[_0x9279('0x35')]);attachment[_0x9279('0x36')]({'name':path['parse'](_0x215029[_0x9279('0x30')])[_0x9279('0x22')],'basename':path['parse'](_0x215029[_0x9279('0x30')])[_0x9279('0x22')]+_0x9279('0x37'),'type':'application/pdf'})[_0x9279('0x38')](function(_0x238d68){faxAccount[_0x9279('0x39')](_0x5d3d5e,{'from':_0x215029[_0x9279('0x31')],'mapKey':_0x9279('0x6'),'body':path[_0x9279('0x3a')](_0x215029[_0x9279('0x30')])[_0x9279('0x22')]+_0x9279('0x37'),'AttachmentId':_0x238d68['id']})['catch'](function(_0x5c5ff6){logger[_0x9279('0x3b')](_0x215029[_0x9279('0x20')],_0x9279('0x3c'),JSON[_0x9279('0x3d')](_0x5c5ff6));});})[_0x9279('0x3e')](function(_0x1ee373){logger[_0x9279('0x3b')](_0x215029[_0x9279('0x20')],'\x20receiveFax\x20',JSON[_0x9279('0x3d')](_0x1ee373));});});}logger[_0x9279('0x23')](_0x215029['uniqueid'],_0x9279('0x3f'));}};Fax[_0x9279('0x1c')][_0x9279('0x1b')]=function(_0xd4ef4){if(this[_0x9279('0x24')][_0xd4ef4[_0x9279('0x20')]]){_[_0x9279('0x40')](this[_0x9279('0xb')][_0xd4ef4['uniqueid']],_[_0x9279('0x41')](_0xd4ef4,[_0x9279('0x42'),_0x9279('0x43')]));}};function updateStatus(_0xfd4c15){if(_0xfd4c15['AttachmentId']){faxMessage['update'](_0xfd4c15['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0x9279('0x38')](function(_0x568439){ut[_0x9279('0x44')](_0x9279('0x45'),_0x568439);})[_0x9279('0x3e')](function(_0x34ef5e){ut[_0x9279('0x44')]('[Fax][Message][Error][NoUpdate1]',_0x34ef5e);});}else{ut[_0x9279('0x44')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x9279('0x1c')]['updateStatus']=function(_0x231986,_0x6b9d4b,_0x183f16){var _0x24d201=this;var _0x5e185d={};if(_0x6b9d4b){_0x5e185d={'read':_0x6b9d4b};}else{_0x5e185d={'failMessage':_0x183f16};}if(this[_0x9279('0x24')][_0x231986][_0x9279('0x46')]){faxMessage[_0x9279('0x47')](this['actions'][_0x231986][_0x9279('0x46')],_0x5e185d)[_0x9279('0x38')](function(_0x26d5e4){ut['logger'](_0x9279('0x48'),_0x26d5e4);})['catch'](function(_0x159a58){ut[_0x9279('0x44')](_0x9279('0x49'),_0x159a58);})[_0x9279('0x4a')](function(){delete _0x24d201[_0x9279('0xb')][_0x231986];delete _0x24d201[_0x9279('0x24')][_0x231986];});}else{ut[_0x9279('0x44')](_0x9279('0x4b'));delete this['channels'][_0x231986];delete this[_0x9279('0x24')][_0x231986];}};Fax[_0x9279('0x1c')]['syncHangup']=function(_0x22c2f4){var _0x1f1781=this;if(this[_0x9279('0xb')][_0x22c2f4[_0x9279('0x20')]]){if(this[_0x9279('0x24')][_0x22c2f4[_0x9279('0x20')]]){this[_0x9279('0xb')][_0x22c2f4['uniqueid']]['id']=this[_0x9279('0x24')][_0x22c2f4[_0x9279('0x20')]]['id'];this['channels'][_0x22c2f4[_0x9279('0x20')]][_0x9279('0x22')]=this[_0x9279('0x24')][_0x22c2f4['uniqueid']][_0x9279('0x22')];}logger[_0x9279('0x23')](_0x22c2f4['uniqueid'],this['actions'][_0x22c2f4[_0x9279('0x20')]]?_0x9279('0x4c'):'\x20hangup\x20faxRiceive\x20',JSON[_0x9279('0x3d')](this[_0x9279('0xb')][_0x22c2f4[_0x9279('0x20')]]));if(this['actions'][_0x22c2f4[_0x9279('0x20')]]){if(this[_0x9279('0xb')][_0x22c2f4[_0x9279('0x20')]][_0x9279('0x4d')]>0x0&&this['channels'][_0x22c2f4[_0x9279('0x20')]]['faxstatus']==='SUCCESS'){this[_0x9279('0x4e')](_0x22c2f4['uniqueid'],!![]);}else{this[_0x9279('0x4e')](_0x22c2f4[_0x9279('0x20')],![],this[_0x9279('0xb')][_0x22c2f4[_0x9279('0x20')]][_0x9279('0x4f')]?_0x9279('0x50')+this['channels'][_0x22c2f4[_0x9279('0x20')]]['faxstatusstring']:_0x9279('0x51'));}}}};Fax['prototype'][_0x9279('0x52')]=function(_0x4e4f0e){var _0x1c4e06=this;return new BPromise(function(_0x19247e,_0x4a45f4){_0x1c4e06[_0x9279('0x53')](_0x4e4f0e,_0x1c4e06[_0x9279('0xc')][_0x4e4f0e['FaxAccountId']])[_0x9279('0x38')](function(_0x8e06bb){ut[_0x9279('0x44')](_0x9279('0x54'),_0x8e06bb);_0x19247e(ut[_0x9279('0x35')]('Fax\x20received'));})['catch'](function(_0x2f8f19){ut[_0x9279('0x44')](_0x9279('0x55'),_0x2f8f19);updateStatus(_0x4e4f0e);_0x4a45f4(ut['message'](_0x9279('0x56')));});});};Fax[_0x9279('0x1c')]['checkAfterSend']=function(_0x34b0e2){var _0x205f40=this;return new BPromise(function(_0x15b60b,_0x2d1cf8){var _0x517c7b=_0x205f40[_0x9279('0x57')](_0x205f40[_0x9279('0xc')][_0x34b0e2[_0x9279('0x58')]][_0x9279('0x59')],_0x34b0e2);if(_0x517c7b[_0x9279('0x5a')]){_0x15b60b(ut[_0x9279('0x35')](_0x9279('0x5b')));}else{_0x2d1cf8(ut[_0x9279('0x35')](_0x517c7b[_0x9279('0x35')]));}});};function originate(_0x5bd2cc,_0x2b6c9c,_0x2f5240){return new BPromise(function(_0xd138cb,_0x390dc3){if(_0x2f5240){var _0x9b9daf=util[_0x9279('0x5c')](_0x9279('0x5d'),path['parse'](_0x5bd2cc[_0x9279('0x5e')])[_0x9279('0x22')],_0x5bd2cc['path']);gs[_0x9279('0x5f')](_0x9b9daf)[_0x9279('0x38')](function(){_0x5bd2cc[_0x9279('0x5e')]=util['format']('%s/%s.tif',path[_0x9279('0x3a')](_0x5bd2cc['path'])['dir'],path['parse'](_0x5bd2cc['path'])['name']);_0x2b6c9c[_0x9279('0x60')]=_0x5bd2cc[_0x9279('0x5e')];ut[_0x9279('0x44')]('Convert\x20pdf\x20to\x20tif','');ami[_0x9279('0x61')](ut[_0x9279('0x62')](_0x5bd2cc,_0x2b6c9c))[_0x9279('0x38')](function(_0x251f59){_0xd138cb(_0x251f59);})[_0x9279('0x3e')](function(_0xd3176b){_0x390dc3(_0xd3176b);});})[_0x9279('0x3e')](function(_0x2504b5){_0x390dc3(_0x2504b5);});}else{ami[_0x9279('0x61')](ut[_0x9279('0x62')](_0x5bd2cc,_0x2b6c9c))['then'](function(_0x528f09){_0xd138cb(_0x528f09);})[_0x9279('0x3e')](function(_0x4dae36){_0x390dc3(_0x4dae36);});}});}Fax[_0x9279('0x1c')]['execOriginate']=function(_0x1cf438,_0x42e4be){var _0x1dffd9=this;return new BPromise(function(_0x5c0a88,_0x491039){var _0x4c5d34=uuid['v4']();var _0xe931b6=ut[_0x9279('0x63')](_0x1cf438,_0x42e4be);_0x1dffd9['actions'][_0x4c5d34]=new Action(_0x4c5d34,_0x42e4be,_0x1cf438);var _0x5f56ec=_0x1dffd9[_0x9279('0x24')][_0x4c5d34];if(path[_0x9279('0x3a')](_0x1cf438[_0x9279('0x5e')])['ext']==='.pdf'){originate(_0x5f56ec,_0xe931b6,!![])[_0x9279('0x38')](function(_0x37330f){_0x5c0a88(_0x37330f);})[_0x9279('0x3e')](function(_0x57d4a4){_0x491039(_0x57d4a4);});}else{originate(_0x5f56ec,_0xe931b6,![])[_0x9279('0x38')](function(_0x278189){_0x5c0a88(_0x278189);})[_0x9279('0x3e')](function(_0x4cf871){_0x491039(_0x4cf871);});}});};Fax[_0x9279('0x1c')][_0x9279('0x64')]=function(_0x588bdc){return!_[_0x9279('0x65')](_0x588bdc)&&!_['isNil'](_0x588bdc[_0x9279('0x22')])&&!_[_0x9279('0x65')](_0x588bdc[_0x9279('0x66')])&&_0x588bdc[_0x9279('0x66')]&&!_[_0x9279('0x65')](this[_0x9279('0xd')][util['format'](_0x9279('0x67'),_0x588bdc['name'])])&&!_[_0x9279('0x65')](this['trunks'][util[_0x9279('0x5c')]('SIP/%s',_0x588bdc[_0x9279('0x22')])][_0x9279('0x2b')])&&(this['trunks'][util['format']('SIP/%s',_0x588bdc[_0x9279('0x22')])][_0x9279('0x2b')]===_0x9279('0x68')||this[_0x9279('0xd')][util[_0x9279('0x5c')]('SIP/%s',_0x588bdc[_0x9279('0x22')])][_0x9279('0x2b')]===_0x9279('0x69'));};Fax['prototype']['checkTrunk']=function(_0x52c314,_0x58f48a){if(!this[_0x9279('0x64')](_0x52c314)){ut[_0x9279('0x44')](_0x9279('0x6a'),_[_0x9279('0x65')](_0x52c314)?'':_0x52c314[_0x9279('0x22')]+_0x9279('0x6b'));return{'isValid':![],'message':_0x9279('0x6c')};}if(_[_0x9279('0x65')](_0x58f48a[_0x9279('0x6')])){ut['logger'](_0x9279('0x6d'),JSON[_0x9279('0x3d')](_0x58f48a));return{'isValid':![],'message':_0x9279('0x6e')};}if(_[_0x9279('0x65')](_0x58f48a['path'])){ut[_0x9279('0x44')](_0x9279('0x6f'),JSON['stringify'](_0x58f48a));return{'isValid':![],'message':_0x9279('0x70')};}return{'isValid':!![],'message':_0x9279('0x71')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index b439ee2..3c93de3 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 _0x1c81=['lodash','inspect','notify','resolve','then','[Notify]\x20','preview'];(function(_0x2b51c6,_0x1dfe85){var _0x4d0e44=function(_0x288b9d){while(--_0x288b9d){_0x2b51c6['push'](_0x2b51c6['shift']());}};_0x4d0e44(++_0x1dfe85);}(_0x1c81,0xca));var _0x11c8=function(_0x1685d9,_0x371481){_0x1685d9=_0x1685d9-0x0;var _0x4889c9=_0x1c81[_0x1685d9];return _0x4889c9;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0x11c8('0x0'));var _=require(_0x11c8('0x1'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x40b3d4){return function(_0x3abb74){logger['error'](_0x40b3d4,util[_0x11c8('0x2')](_0x3abb74,{'showHidden':![],'depth':null}));};}exports[_0x11c8('0x3')]=function(_0x2c3730,_0x3e2025){return BPromise[_0x11c8('0x4')]()[_0x11c8('0x5')](faxAccount[_0x11c8('0x3')](_0x2c3730,_0x3e2025))['catch'](loggerCatch(_0x11c8('0x6')));}; \ No newline at end of file +var _0xf371=['error','inspect','notify','resolve','then','catch','[Notify]\x20','util','bluebird','preview','lodash'];(function(_0x40c2f4,_0x53b288){var _0x2bfd69=function(_0x8b0f69){while(--_0x8b0f69){_0x40c2f4['push'](_0x40c2f4['shift']());}};_0x2bfd69(++_0x53b288);}(_0xf371,0x1ca));var _0x1f37=function(_0x2dff99,_0x418cb2){_0x2dff99=_0x2dff99-0x0;var _0x541685=_0xf371[_0x2dff99];return _0x541685;};'use strict';var util=require(_0x1f37('0x0'));var BPromise=require(_0x1f37('0x1'));var logger=require('../../../config/logger')(_0x1f37('0x2'));var _=require(_0x1f37('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x3f9045){return function(_0xb57ef7){logger[_0x1f37('0x4')](_0x3f9045,util[_0x1f37('0x5')](_0xb57ef7,{'showHidden':![],'depth':null}));};}exports[_0x1f37('0x6')]=function(_0x5d134c,_0x4f9069){return BPromise[_0x1f37('0x7')]()[_0x1f37('0x8')](faxAccount[_0x1f37('0x6')](_0x5d134c,_0x4f9069))[_0x1f37('0x9')](loggerCatch(_0x1f37('0xa')));}; \ 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 4e181de..55824e5 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 _0xa496=['child_process','info','Exec\x20gs','\x20Error\x20:','fax','bluebird'];(function(_0x5633b3,_0x1d5142){var _0x58f7c4=function(_0x215be2){while(--_0x215be2){_0x5633b3['push'](_0x5633b3['shift']());}};_0x58f7c4(++_0x1d5142);}(_0xa496,0xd6));var _0x6a49=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa496[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var logger=require('../../../../config/logger')(_0x6a49('0x0'));var BPromise=require(_0x6a49('0x1'));var exec=require(_0x6a49('0x2'))['exec'];exports['execute']=function(_0xe973b3){return new BPromise(function(_0x306fef,_0x2f7f3b){exec(_0xe973b3,function(_0x4f68c9,_0x547c3d,_0x1cf1bd){logger[_0x6a49('0x3')]('Exec\x20gs',_0x547c3d);if(_0x4f68c9){logger['info'](_0x6a49('0x4'),_0x6a49('0x5'),util['inspect'](_0x4f68c9,{'showHidden':![],'depth':null}),_0x547c3d,_0x1cf1bd);_0x2f7f3b(_0x4f68c9);}_0x306fef(_0x547c3d);});});}; \ No newline at end of file +var _0xee12=['child_process','execute','info','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xee12,0x1e2));var _0x2ee1=function(_0x1db1b4,_0x496c40){_0x1db1b4=_0x1db1b4-0x0;var _0x7ef6c0=_0xee12[_0x1db1b4];return _0x7ef6c0;};'use strict';var util=require(_0x2ee1('0x0'));var logger=require(_0x2ee1('0x1'))(_0x2ee1('0x2'));var BPromise=require(_0x2ee1('0x3'));var exec=require(_0x2ee1('0x4'))['exec'];exports[_0x2ee1('0x5')]=function(_0x239d4e){return new BPromise(function(_0x1c0be3,_0xdf01d5){exec(_0x239d4e,function(_0x5a46dc,_0x297a05,_0x33283d){logger[_0x2ee1('0x6')]('Exec\x20gs',_0x297a05);if(_0x5a46dc){logger[_0x2ee1('0x6')]('Exec\x20gs',_0x2ee1('0x7'),util[_0x2ee1('0x8')](_0x5a46dc,{'showHidden':![],'depth':null}),_0x297a05,_0x33283d);_0xdf01d5(_0x5a46dc);}_0x1c0be3(_0x297a05);});});}; \ 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 d36c7ce..0b47bd6 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 _0xc788=['logger','inspect','addVariables','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','faxdetect','localstationid','path','originate','from-sip','\x22%s\x22\x20<%s>','uniqueid','util','lodash','moment','message'];(function(_0x226695,_0x2b824a){var _0x5314a3=function(_0x3d03b2){while(--_0x3d03b2){_0x226695['push'](_0x226695['shift']());}};_0x5314a3(++_0x2b824a);}(_0xc788,0xc4));var _0x8c78=function(_0x5b7b22,_0x5bc479){_0x5b7b22=_0x5b7b22-0x0;var _0x53dc9d=_0xc788[_0x5b7b22];return _0x53dc9d;};'use strict';var util=require(_0x8c78('0x0'));var _=require(_0x8c78('0x1'));var moment=require(_0x8c78('0x2'));var logger=require('../../../../config/logger')('fax');exports[_0x8c78('0x3')]=function(_0x1af8e2){return{'message':_0x1af8e2};};exports[_0x8c78('0x4')]=function(_0x1d0670,_0x386f0a){logger['info'](_0x1d0670,util[_0x8c78('0x5')](_0x386f0a,{'showHidden':![],'depth':null}));};exports[_0x8c78('0x6')]=function(_0x329152,_0x1ac27f){var _0x205cc1={'XMF-ECM':_0x1ac27f['ecm'],'XMF-HEADERINFO':_0x1ac27f[_0x8c78('0x7')],'XMF-MINRATE':_0x1ac27f[_0x8c78('0x8')],'XMF-MAXRATE':_0x1ac27f[_0x8c78('0x9')],'XMF-MODEM':util[_0x8c78('0xa')](_0x8c78('0xb'),_0x1ac27f[_0x8c78('0xc')]),'XMF-GATEWAY':_0x1ac27f['gateway'],'XMF-FAXDETECT':_0x1ac27f[_0x8c78('0xd')],'XMF-T38TIMEOUT':_0x1ac27f['t38timeout'],'XMF-LOCALSTATIONID':_0x1ac27f[_0x8c78('0xe')],'XMF-PATH':_0x329152[_0x8c78('0xf')]};return _0x205cc1;};exports['variablesAction']=function(_0x1a05a7,_0x95e78e){return{'actionid':_0x1a05a7['uniqueid'],'action':_0x8c78('0x10'),'channel':_0x1a05a7['channel'],'Exten':'xcally-motion-fax','Context':_0x8c78('0x11'),'Priority':'1','callerid':util[_0x8c78('0xa')](_0x8c78('0x12'),_0x1a05a7[_0x8c78('0x7')]?_0x1a05a7[_0x8c78('0x7')]:'',_0x1a05a7[_0x8c78('0xe')]),'variable':_0x95e78e,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1a05a7[_0x8c78('0x13')]};}; \ No newline at end of file +var _0x22fb=['uniqueid','from-sip','\x22%s\x22\x20<%s>','moment','fax','message','logger','info','inspect','addVariables','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path'];(function(_0x4f590f,_0x442aa5){var _0xaa58d3=function(_0x1f7d36){while(--_0x1f7d36){_0x4f590f['push'](_0x4f590f['shift']());}};_0xaa58d3(++_0x442aa5);}(_0x22fb,0x192));var _0xb22f=function(_0x320a11,_0x48497f){_0x320a11=_0x320a11-0x0;var _0x5e0670=_0x22fb[_0x320a11];return _0x5e0670;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xb22f('0x0'));var logger=require('../../../../config/logger')(_0xb22f('0x1'));exports[_0xb22f('0x2')]=function(_0x2221f1){return{'message':_0x2221f1};};exports[_0xb22f('0x3')]=function(_0x201512,_0x50cdab){logger[_0xb22f('0x4')](_0x201512,util[_0xb22f('0x5')](_0x50cdab,{'showHidden':![],'depth':null}));};exports[_0xb22f('0x6')]=function(_0xc3ffcc,_0x412a95){var _0x367d4b={'XMF-ECM':_0x412a95['ecm'],'XMF-HEADERINFO':_0x412a95[_0xb22f('0x7')],'XMF-MINRATE':_0x412a95[_0xb22f('0x8')],'XMF-MAXRATE':_0x412a95[_0xb22f('0x9')],'XMF-MODEM':util[_0xb22f('0xa')](_0xb22f('0xb'),_0x412a95[_0xb22f('0xc')]),'XMF-GATEWAY':_0x412a95[_0xb22f('0xd')],'XMF-FAXDETECT':_0x412a95[_0xb22f('0xe')],'XMF-T38TIMEOUT':_0x412a95[_0xb22f('0xf')],'XMF-LOCALSTATIONID':_0x412a95[_0xb22f('0x10')],'XMF-PATH':_0xc3ffcc[_0xb22f('0x11')]};return _0x367d4b;};exports['variablesAction']=function(_0x4b9e56,_0x5b2399){return{'actionid':_0x4b9e56[_0xb22f('0x12')],'action':'originate','channel':_0x4b9e56['channel'],'Exten':'xcally-motion-fax','Context':_0xb22f('0x13'),'Priority':'1','callerid':util[_0xb22f('0xa')](_0xb22f('0x14'),_0x4b9e56[_0xb22f('0x7')]?_0x4b9e56[_0xb22f('0x7')]:'',_0x4b9e56[_0xb22f('0x10')]),'variable':_0x5b2399,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4b9e56['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 8ec95a4..fe2f879 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 _0xd86e=['getTrunks','initVoiceQueues','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','catch','listen','sync','log','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd86e,0xfa));var _0xed86=function(_0x4bb6c1,_0x4d467e){_0x4bb6c1=_0x4bb6c1-0x0;var _0x4f7ff4=_0xd86e[_0x4bb6c1];return _0x4f7ff4;};'use strict';var BPromise=require(_0xed86('0x0'));var util=require(_0xed86('0x1'));var moment=require(_0xed86('0x2'));var server=require(_0xed86('0x3'));var Realtime=require(_0xed86('0x4'));var Report=require(_0xed86('0x5'));var Acw=require(_0xed86('0x6'));var Trigger=require(_0xed86('0x7'));var Dialer=require(_0xed86('0x8'));var Preview=require('./preview');var Fax=require('./fax');var user=require('./rpc/user');var voiceQueue=require(_0xed86('0x9'));var voiceQueueReport=require(_0xed86('0xa'));var voiceCallReport=require(_0xed86('0xb'));var trunk=require(_0xed86('0xc'));var trigger=require('./rpc/trigger');var template=require(_0xed86('0xd'));var cmHopperHistory=require(_0xed86('0xe'));var campaign=require(_0xed86('0xf'));var voiceExtension=require(_0xed86('0x10'));var faxAccount=require(_0xed86('0x11'));var zendesk=require(_0xed86('0x12'));var salesforce=require(_0xed86('0x13'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0xed86('0x14'));var desk=require(_0xed86('0x15'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0xed86('0x16'));var freshsales=require(_0xed86('0x17'));var servicenow=require(_0xed86('0x18'));var dynamics365=require(_0xed86('0x19'));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()[_0xed86('0x1a')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xed86('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xed86('0x1c')]()[_0xed86('0x1d')](user[_0xed86('0x1e')]())[_0xed86('0x1d')](realtime[_0xed86('0x1f')]())[_0xed86('0x1d')](user[_0xed86('0x20')]())[_0xed86('0x1d')](realtime[_0xed86('0x21')]())[_0xed86('0x1d')](trunk[_0xed86('0x22')]())[_0xed86('0x1d')](realtime['initTrunks']())[_0xed86('0x1d')](voiceQueue['getVoiceQueues']())[_0xed86('0x1d')](realtime[_0xed86('0x23')]())['then'](trigger['getTriggers']())['then'](realtime[_0xed86('0x24')]())['then'](template['getTemplates']())['then'](realtime[_0xed86('0x25')]())[_0xed86('0x1d')](zendesk[_0xed86('0x26')]())[_0xed86('0x1d')](realtime[_0xed86('0x27')]())[_0xed86('0x1d')](salesforce[_0xed86('0x28')]())[_0xed86('0x1d')](realtime[_0xed86('0x29')]())[_0xed86('0x1d')](sugarcrm['getSugarcrmAccounts']())[_0xed86('0x1d')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0xed86('0x2a')]())[_0xed86('0x1d')](realtime[_0xed86('0x2b')]())[_0xed86('0x1d')](desk[_0xed86('0x2c')]())[_0xed86('0x1d')](realtime[_0xed86('0x2d')]())['then'](zoho[_0xed86('0x2e')]())['then'](realtime[_0xed86('0x2f')]())[_0xed86('0x1d')](vtiger[_0xed86('0x30')]())['then'](realtime[_0xed86('0x31')]())[_0xed86('0x1d')](freshsales[_0xed86('0x32')]())['then'](realtime[_0xed86('0x33')]())[_0xed86('0x1d')](servicenow[_0xed86('0x34')]())['then'](realtime[_0xed86('0x35')]())[_0xed86('0x1d')](dynamics365['getDynamics365Accounts']())[_0xed86('0x1d')](realtime[_0xed86('0x36')]())[_0xed86('0x1d')](campaign[_0xed86('0x37')]())[_0xed86('0x1d')](realtime[_0xed86('0x38')]())[_0xed86('0x1d')](voiceExtension[_0xed86('0x39')]())[_0xed86('0x1d')](realtime[_0xed86('0x3a')]())['then'](faxAccount[_0xed86('0x3b')]())[_0xed86('0x1d')](realtime[_0xed86('0x3c')]())[_0xed86('0x1d')](function(){return realtime;});}function initParams(){return BPromise[_0xed86('0x1c')]()['then'](voiceQueueReport[_0xed86('0x3d')]())[_0xed86('0x1d')](realtime[_0xed86('0x3e')]())[_0xed86('0x1d')](cmHopperHistory[_0xed86('0x3f')]())[_0xed86('0x1d')](realtime[_0xed86('0x40')]())['then'](cmHopperHistory[_0xed86('0x41')]())['then'](realtime[_0xed86('0x42')]())[_0xed86('0x1d')](voiceCallReport['getVoiceCallReports']())['then'](realtime['initVoiceCallReports']())[_0xed86('0x1d')](function(_0x196f70){})[_0xed86('0x43')](function(_0x130070){console['log'](_0x130070);});}function main(){return server[_0xed86('0x44')](realtime,preview,fax)['then'](function(_0x1d0290){return initRealtime();})[_0xed86('0x1d')](function(){return initParams();})[_0xed86('0x1d')](function(){report[_0xed86('0x45')]();setInterval(initRealtime,0x1388);})[_0xed86('0x43')](function(_0x45ee15){console[_0xed86('0x46')](_0x45ee15);});}main(); \ No newline at end of file +var _0xbe9e=['getVoiceCallReports','listen','sync','catch','log','bluebird','util','./server','./report','./acw','./trigger','./dialer','./rpc/voiceQueueReport','./rpc/trunk','./rpc/template','./rpc/campaign','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory'];(function(_0x29771f,_0x1189ae){var _0x279baf=function(_0xd66325){while(--_0xd66325){_0x29771f['push'](_0x29771f['shift']());}};_0x279baf(++_0x1189ae);}(_0xbe9e,0x11d));var _0xebe9=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xbe9e[_0x4b055c];return _0x4b62bb;};'use strict';var BPromise=require(_0xebe9('0x0'));var util=require(_0xebe9('0x1'));var moment=require('moment');var server=require(_0xebe9('0x2'));var Realtime=require('./realtime');var Report=require(_0xebe9('0x3'));var Acw=require(_0xebe9('0x4'));var Trigger=require(_0xebe9('0x5'));var Dialer=require(_0xebe9('0x6'));var Preview=require('./preview');var Fax=require('./fax');var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xebe9('0x7'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xebe9('0x8'));var trigger=require('./rpc/trigger');var template=require(_0xebe9('0x9'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xebe9('0xa'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0xebe9('0xb'));var salesforce=require(_0xebe9('0xc'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xebe9('0xd'));var zoho=require(_0xebe9('0xe'));var vtiger=require(_0xebe9('0xf'));var freshsales=require(_0xebe9('0x10'));var servicenow=require(_0xebe9('0x11'));var dynamics365=require(_0xebe9('0x12'));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()[_0xebe9('0x13')](_0xebe9('0x14'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xebe9('0x13')](_0xebe9('0x14'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xebe9('0x15')]()[_0xebe9('0x16')](user['getAgents']())['then'](realtime[_0xebe9('0x17')]())['then'](user[_0xebe9('0x18')]())[_0xebe9('0x16')](realtime[_0xebe9('0x19')]())[_0xebe9('0x16')](trunk[_0xebe9('0x1a')]())['then'](realtime['initTrunks']())[_0xebe9('0x16')](voiceQueue[_0xebe9('0x1b')]())[_0xebe9('0x16')](realtime['initVoiceQueues']())[_0xebe9('0x16')](trigger['getTriggers']())[_0xebe9('0x16')](realtime[_0xebe9('0x1c')]())[_0xebe9('0x16')](template[_0xebe9('0x1d')]())[_0xebe9('0x16')](realtime['initTemplates']())[_0xebe9('0x16')](zendesk[_0xebe9('0x1e')]())[_0xebe9('0x16')](realtime[_0xebe9('0x1f')]())[_0xebe9('0x16')](salesforce[_0xebe9('0x20')]())[_0xebe9('0x16')](realtime[_0xebe9('0x21')]())['then'](sugarcrm['getSugarcrmAccounts']())['then'](realtime['initSugarcrmAccounts']())[_0xebe9('0x16')](freshdesk[_0xebe9('0x22')]())[_0xebe9('0x16')](realtime[_0xebe9('0x23')]())[_0xebe9('0x16')](desk[_0xebe9('0x24')]())[_0xebe9('0x16')](realtime[_0xebe9('0x25')]())[_0xebe9('0x16')](zoho['getZohoAccounts']())[_0xebe9('0x16')](realtime[_0xebe9('0x26')]())[_0xebe9('0x16')](vtiger['getVtigerAccounts']())['then'](realtime[_0xebe9('0x27')]())['then'](freshsales[_0xebe9('0x28')]())[_0xebe9('0x16')](realtime[_0xebe9('0x29')]())[_0xebe9('0x16')](servicenow['getServicenowAccounts']())[_0xebe9('0x16')](realtime['initServicenowAccounts']())[_0xebe9('0x16')](dynamics365[_0xebe9('0x2a')]())[_0xebe9('0x16')](realtime[_0xebe9('0x2b')]())[_0xebe9('0x16')](campaign[_0xebe9('0x2c')]())[_0xebe9('0x16')](realtime['initCampaigns']())[_0xebe9('0x16')](voiceExtension[_0xebe9('0x2d')]())[_0xebe9('0x16')](realtime['initVoiceExtensions']())[_0xebe9('0x16')](faxAccount[_0xebe9('0x2e')]())[_0xebe9('0x16')](realtime[_0xebe9('0x2f')]())[_0xebe9('0x16')](function(){return realtime;});}function initParams(){return BPromise[_0xebe9('0x15')]()[_0xebe9('0x16')](voiceQueueReport['getVoiceQueueReports']())[_0xebe9('0x16')](realtime[_0xebe9('0x30')]())[_0xebe9('0x16')](cmHopperHistory[_0xebe9('0x31')]())[_0xebe9('0x16')](realtime['initVoiceQueueHopperHistory']())[_0xebe9('0x16')](cmHopperHistory[_0xebe9('0x32')]())[_0xebe9('0x16')](realtime['initCampaignHopperHistory']())[_0xebe9('0x16')](voiceCallReport[_0xebe9('0x33')]())[_0xebe9('0x16')](realtime['initVoiceCallReports']())[_0xebe9('0x16')](function(_0x1aed8d){})['catch'](function(_0x5b9ddf){console['log'](_0x5b9ddf);});}function main(){return server[_0xebe9('0x34')](realtime,preview,fax)[_0xebe9('0x16')](function(_0x1d4710){return initRealtime();})[_0xebe9('0x16')](function(){return initParams();})[_0xebe9('0x16')](function(){report[_0xebe9('0x35')]();setInterval(initRealtime,0x1388);})[_0xebe9('0x36')](function(_0xa1c9a6){console[_0xebe9('0x37')](_0xa1c9a6);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index a2ae84a..f995e64 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 _0x7baf=['toLowerCase','not_inuse','idle','inuse','talking','format','address','stringify','user:%s','emit','user:save','lodash','util','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','state'];(function(_0x5de437,_0x3b8e20){var _0xe58691=function(_0x3f5942){while(--_0x3f5942){_0x5de437['push'](_0x5de437['shift']());}};_0xe58691(++_0x3b8e20);}(_0x7baf,0x9b));var _0xf7ba=function(_0x812136,_0x5df217){_0x812136=_0x812136-0x0;var _0x3b5c29=_0x7baf[_0x812136];return _0x3b5c29;};'use strict';var _=require(_0xf7ba('0x0'));var util=require(_0xf7ba('0x1'));var moment=require('moment');var md5=require(_0xf7ba('0x2'));var Redis=require(_0xf7ba('0x3'));var config=require(_0xf7ba('0x4'));config[_0xf7ba('0x5')]=_[_0xf7ba('0x6')](config[_0xf7ba('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xf7ba('0x7'))(new Redis(config[_0xf7ba('0x5')]));function Agent(_0x3c3688){this['id']=_0x3c3688['id']||0x0;this[_0xf7ba('0x8')]=_0x3c3688[_0xf7ba('0x8')]||'';this['email']=_0x3c3688[_0xf7ba('0x9')]||'';this[_0xf7ba('0xa')]=_0x3c3688['accountcode']||'';this[_0xf7ba('0xb')]=_0x3c3688['fullname']||'';this['state']=_0xf7ba('0xc');this[_0xf7ba('0xd')]=0x0;this['status']=_0xf7ba('0xc');this['address']='';this['phone']='';this['mobile']='';this[_0xf7ba('0xe')]='';this[_0xf7ba('0xf')]=_0x3c3688[_0xf7ba('0xf')]||![];this[_0xf7ba('0x10')]=_0xf7ba('0xc');this[_0xf7ba('0x11')]=0x0;this[_0xf7ba('0x12')]='';this[_0xf7ba('0x13')]='';this[_0xf7ba('0x14')]=![];this[_0xf7ba('0x15')]=![];this[_0xf7ba('0x2')]='';}Agent[_0xf7ba('0x16')][_0xf7ba('0x17')]=function(_0x3ab615){var _0x5936af;if(_0x3ab615&&_0x3ab615[_0xf7ba('0x18')]){_0x5936af=_0x3ab615[_0xf7ba('0x18')][_0xf7ba('0x19')]();switch(_0x5936af){case _0xf7ba('0x1a'):_0x5936af=_0xf7ba('0x1b');break;case _0xf7ba('0x1c'):_0x5936af=_0xf7ba('0x1d');break;}}if(_0x5936af&&this[_0xf7ba('0x10')]!==_0x5936af||_0x3ab615['statePause']){this[_0xf7ba('0x11')]=_['toNumber'](moment()[_0xf7ba('0x1e')]('x'));}if(_0x5936af){this[_0xf7ba('0x10')]=_0x5936af;}var _0x22becd={'id':this['id'],'name':this['name'],'email':this[_0xf7ba('0x9')],'accountcode':this[_0xf7ba('0xa')],'fullname':this[_0xf7ba('0xb')],'state':this['state'],'stateTime':this['stateTime'],'status':this['status'],'address':this[_0xf7ba('0x1f')],'online':this['online'],'voiceStatus':this[_0xf7ba('0x10')],'voiceStatusTime':this[_0xf7ba('0x11')],'voiceStatusCallerIdNumber':this[_0xf7ba('0x12')],'voiceStatusQueue':this[_0xf7ba('0x13')],'interface':this['interface'],'onhold':this['onhold']};var _0x1b576a=md5(JSON[_0xf7ba('0x20')](_0x22becd));if(this[_0xf7ba('0x2')]!==_0x1b576a){this['md5']=_0x1b576a;io['to'](util['format'](_0xf7ba('0x21'),_0x22becd[_0xf7ba('0x8')]))[_0xf7ba('0x22')](_0xf7ba('0x23'),_0x22becd);}};module['exports']=Agent; \ No newline at end of file +var _0x6cfc=['lodash','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','prototype','updateStatusRealtime','state','toLowerCase','not_inuse','inuse','talking','statePause','toNumber','format','voiceStatusQueue','stringify','user:%s','exports'];(function(_0xd474f9,_0xfbe067){var _0xf40bd5=function(_0x2742b6){while(--_0x2742b6){_0xd474f9['push'](_0xd474f9['shift']());}};_0xf40bd5(++_0xfbe067);}(_0x6cfc,0xea));var _0xc6cf=function(_0x4d21ff,_0x19d202){_0x4d21ff=_0x4d21ff-0x0;var _0x22b554=_0x6cfc[_0x4d21ff];return _0x22b554;};'use strict';var _=require(_0xc6cf('0x0'));var util=require(_0xc6cf('0x1'));var moment=require(_0xc6cf('0x2'));var md5=require(_0xc6cf('0x3'));var Redis=require(_0xc6cf('0x4'));var config=require(_0xc6cf('0x5'));config[_0xc6cf('0x6')]=_[_0xc6cf('0x7')](config[_0xc6cf('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xc6cf('0x8'))(new Redis(config[_0xc6cf('0x6')]));function Agent(_0x102f78){this['id']=_0x102f78['id']||0x0;this[_0xc6cf('0x9')]=_0x102f78[_0xc6cf('0x9')]||'';this['email']=_0x102f78[_0xc6cf('0xa')]||'';this['accountcode']=_0x102f78[_0xc6cf('0xb')]||'';this[_0xc6cf('0xc')]=_0x102f78['fullname']||'';this['state']=_0xc6cf('0xd');this[_0xc6cf('0xe')]=0x0;this[_0xc6cf('0xf')]=_0xc6cf('0xd');this[_0xc6cf('0x10')]='';this[_0xc6cf('0x11')]='';this[_0xc6cf('0x12')]='';this[_0xc6cf('0x13')]='';this[_0xc6cf('0x14')]=_0x102f78['online']||![];this[_0xc6cf('0x15')]=_0xc6cf('0xd');this[_0xc6cf('0x16')]=0x0;this[_0xc6cf('0x17')]='';this['voiceStatusQueue']='';this[_0xc6cf('0x18')]=![];this['local']=![];this[_0xc6cf('0x3')]='';}Agent[_0xc6cf('0x19')][_0xc6cf('0x1a')]=function(_0x2a5c1f){var _0x4c80b3;if(_0x2a5c1f&&_0x2a5c1f[_0xc6cf('0x1b')]){_0x4c80b3=_0x2a5c1f[_0xc6cf('0x1b')][_0xc6cf('0x1c')]();switch(_0x4c80b3){case _0xc6cf('0x1d'):_0x4c80b3='idle';break;case _0xc6cf('0x1e'):_0x4c80b3=_0xc6cf('0x1f');break;}}if(_0x4c80b3&&this[_0xc6cf('0x15')]!==_0x4c80b3||_0x2a5c1f[_0xc6cf('0x20')]){this[_0xc6cf('0x16')]=_[_0xc6cf('0x21')](moment()[_0xc6cf('0x22')]('x'));}if(_0x4c80b3){this[_0xc6cf('0x15')]=_0x4c80b3;}var _0x219ffe={'id':this['id'],'name':this['name'],'email':this['email'],'accountcode':this[_0xc6cf('0xb')],'fullname':this['fullname'],'state':this['state'],'stateTime':this['stateTime'],'status':this[_0xc6cf('0xf')],'address':this[_0xc6cf('0x10')],'online':this[_0xc6cf('0x14')],'voiceStatus':this[_0xc6cf('0x15')],'voiceStatusTime':this[_0xc6cf('0x16')],'voiceStatusCallerIdNumber':this[_0xc6cf('0x17')],'voiceStatusQueue':this[_0xc6cf('0x23')],'interface':this[_0xc6cf('0x13')],'onhold':this['onhold']};var _0x2bc2cb=md5(JSON[_0xc6cf('0x24')](_0x219ffe));if(this['md5']!==_0x2bc2cb){this[_0xc6cf('0x3')]=_0x2bc2cb;io['to'](util[_0xc6cf('0x22')](_0xc6cf('0x25'),_0x219ffe[_0xc6cf('0x9')]))['emit']('user:save',_0x219ffe);}};module[_0xc6cf('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index df0a124..092c6f2 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 _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(_0x31f94d,_0x97563){var _0xca77c0=function(_0x1e9e04){while(--_0x1e9e04){_0x31f94d['push'](_0x31f94d['shift']());}};_0xca77c0(++_0x97563);}(_0x757a,0xde));var _0xa757=function(_0x279953,_0x22326c){_0x279953=_0x279953-0x0;var _0x4c71d0=_0x757a[_0x279953];return _0x4c71d0;};'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 +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(_0x1ac53b,_0x31c1f1){var _0x6dcc75=function(_0x3a2a35){while(--_0x3a2a35){_0x1ac53b['push'](_0x1ac53b['shift']());}};_0x6dcc75(++_0x31c1f1);}(_0x757a,0xde));var _0xa757=function(_0x3ffdfd,_0x4b1064){_0x3ffdfd=_0x3ffdfd-0x0;var _0x55ca74=_0x757a[_0x3ffdfd];return _0x55ca74;};'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 7e1698f..1581344 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 _0xa63a=['mohtime','exports','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','unmanaged','lastapplication','lastdata','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa63a,0x154));var _0xaa63=function(_0xf273f9,_0x486198){_0xf273f9=_0xf273f9-0x0;var _0xb4abcc=_0xa63a[_0xf273f9];return _0xb4abcc;};'use strict';function Channel(){this['starttime']=null;this[_0xaa63('0x0')]='';this[_0xaa63('0x1')]='';this[_0xaa63('0x2')]=0x0;this[_0xaa63('0x3')]='';this[_0xaa63('0x4')]=undefined;this[_0xaa63('0x5')]=undefined;this[_0xaa63('0x6')]=0x0;this[_0xaa63('0x7')]='';this[_0xaa63('0x8')]=0x0;this[_0xaa63('0x9')]=0x0;this[_0xaa63('0xa')]=0x0;this['answered']=![];this['answertime']=null;this['endtime']=null;this[_0xaa63('0xb')]=![];this['abandoned']=![];this[_0xaa63('0xc')]='';this[_0xaa63('0xd')]='';this['duration']=0x0;this[_0xaa63('0xe')]=0x0;this[_0xaa63('0xf')]=0x0;this[_0xaa63('0x10')]=null;this[_0xaa63('0x11')]=null;this[_0xaa63('0x12')]=null;this[_0xaa63('0x13')]=![];this[_0xaa63('0x14')]=null;this['queue']=null;this[_0xaa63('0x15')]=[];this[_0xaa63('0x16')]=undefined;this[_0xaa63('0x17')]=undefined;this[_0xaa63('0x18')]=0x0;}module[_0xaa63('0x19')]=Channel; \ No newline at end of file +var _0x7e27=['answered','endtime','unmanaged','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','monitorFilename','monitors','transfercalleridnum','exports','starttime','channel','calleridnum','calleridname','connectedlinenum','connectedlinename','context','uniqueid','linkedid'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7e27,0xdd));var _0x77e2=function(_0x2b50ea,_0x4cb59b){_0x2b50ea=_0x2b50ea-0x0;var _0x2568b2=_0x7e27[_0x2b50ea];return _0x2568b2;};'use strict';function Channel(){this[_0x77e2('0x0')]=null;this[_0x77e2('0x1')]='';this['destinationchannel']='';this[_0x77e2('0x2')]=0x0;this[_0x77e2('0x3')]='';this[_0x77e2('0x4')]=undefined;this[_0x77e2('0x5')]=undefined;this['accountcode']=0x0;this[_0x77e2('0x6')]='';this[_0x77e2('0x7')]=0x0;this[_0x77e2('0x8')]=0x0;this['exten']=0x0;this[_0x77e2('0x9')]=![];this['answertime']=null;this[_0x77e2('0xa')]=null;this[_0x77e2('0xb')]=![];this['abandoned']=![];this[_0x77e2('0xc')]='';this[_0x77e2('0xd')]='';this[_0x77e2('0xe')]=0x0;this[_0x77e2('0xf')]=0x0;this[_0x77e2('0x10')]=0x0;this[_0x77e2('0x11')]=null;this[_0x77e2('0x12')]=null;this['disposition']=null;this['monitor']=![];this[_0x77e2('0x13')]=null;this['queue']=null;this[_0x77e2('0x14')]=[];this[_0x77e2('0x15')]=undefined;this['transferconnectedlinenum']=undefined;this['mohtime']=0x0;}module[_0x77e2('0x16')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 33f342e..560c017 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 _0xb38e=['remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb38e,0xa7));var _0xeb38=function(_0x311089,_0x5045fd){_0x311089=_0x311089-0x0;var _0x53e159=_0xb38e[_0x311089];return _0x53e159;};'use strict';function DeskAccount(_0x52c245){this['id']=_0x52c245['id']||0x0;this[_0xeb38('0x0')]=_0x52c245[_0xeb38('0x0')]||'';this[_0xeb38('0x1')]=_0x52c245[_0xeb38('0x1')]||'';this[_0xeb38('0x2')]=_0x52c245[_0xeb38('0x2')]||'';this['authType']=_0x52c245[_0xeb38('0x3')]||'';this[_0xeb38('0x4')]=_0x52c245['password']||'';this[_0xeb38('0x5')]=_0x52c245[_0xeb38('0x5')]||'';this[_0xeb38('0x6')]=_0x52c245[_0xeb38('0x6')]||'';this['token']=_0x52c245[_0xeb38('0x7')]||'';this[_0xeb38('0x8')]=_0x52c245[_0xeb38('0x8')]||'';this[_0xeb38('0x9')]=_0x52c245['type']||'';this[_0xeb38('0xa')]=_0x52c245[_0xeb38('0xa')]||'';this[_0xeb38('0xb')]=_0x52c245[_0xeb38('0xb')]||{};}module[_0xeb38('0xc')]=DeskAccount; \ No newline at end of file +var _0xbf07=['remoteUri','password','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username'];(function(_0x5c7019,_0x2f17da){var _0x13a50b=function(_0x4ea275){while(--_0x4ea275){_0x5c7019['push'](_0x5c7019['shift']());}};_0x13a50b(++_0x2f17da);}(_0xbf07,0x77));var _0x7bf0=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0xbf07[_0x22b68a];return _0x1ac67a;};'use strict';function DeskAccount(_0x3d7cd4){this['id']=_0x3d7cd4['id']||0x0;this[_0x7bf0('0x0')]=_0x3d7cd4[_0x7bf0('0x0')]||'';this[_0x7bf0('0x1')]=_0x3d7cd4['username']||'';this[_0x7bf0('0x2')]=_0x3d7cd4[_0x7bf0('0x2')]||'';this['authType']=_0x3d7cd4['authType']||'';this['password']=_0x3d7cd4[_0x7bf0('0x3')]||'';this['consumerKey']=_0x3d7cd4['consumerKey']||'';this['consumerSecret']=_0x3d7cd4[_0x7bf0('0x4')]||'';this['token']=_0x3d7cd4[_0x7bf0('0x5')]||'';this['tokenSecret']=_0x3d7cd4[_0x7bf0('0x6')]||'';this[_0x7bf0('0x7')]=_0x3d7cd4[_0x7bf0('0x7')]||'';this[_0x7bf0('0x8')]=_0x3d7cd4[_0x7bf0('0x8')]||'';this[_0x7bf0('0x9')]=_0x3d7cd4['Configurations']||{};}module[_0x7bf0('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 0a6df95..42b74d7 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 _0xb3c1=['serverUrl','Configurations','exports','name','username','remoteUri','tenantId','clientId','clientSecret'];(function(_0x42696c,_0x39e509){var _0x53dbb3=function(_0x31a38d){while(--_0x31a38d){_0x42696c['push'](_0x42696c['shift']());}};_0x53dbb3(++_0x39e509);}(_0xb3c1,0x9c));var _0x1b3c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb3c1[_0x321bb2];return _0x9c12ed;};'use strict';function Dynamics365Account(_0x5dacb8){this['id']=_0x5dacb8['id']||0x0;this[_0x1b3c('0x0')]=_0x5dacb8['name']||'';this['username']=_0x5dacb8[_0x1b3c('0x1')]||'';this['password']=_0x5dacb8['password']||'';this[_0x1b3c('0x2')]=_0x5dacb8[_0x1b3c('0x2')]||'';this[_0x1b3c('0x3')]=_0x5dacb8[_0x1b3c('0x3')]||'';this['clientId']=_0x5dacb8[_0x1b3c('0x4')]||'';this[_0x1b3c('0x5')]=_0x5dacb8['clientSecret']||{};this[_0x1b3c('0x6')]=_0x5dacb8[_0x1b3c('0x6')]||'';this[_0x1b3c('0x7')]=_0x5dacb8[_0x1b3c('0x7')]||{};}module[_0x1b3c('0x8')]=Dynamics365Account; \ No newline at end of file +var _0x5ef8=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name'];(function(_0x53fa9d,_0x3ecbb4){var _0x3743d3=function(_0xe4a80){while(--_0xe4a80){_0x53fa9d['push'](_0x53fa9d['shift']());}};_0x3743d3(++_0x3ecbb4);}(_0x5ef8,0x1cb));var _0x85ef=function(_0xcfcf93,_0x2a5d97){_0xcfcf93=_0xcfcf93-0x0;var _0x9eecba=_0x5ef8[_0xcfcf93];return _0x9eecba;};'use strict';function Dynamics365Account(_0x517de7){this['id']=_0x517de7['id']||0x0;this[_0x85ef('0x0')]=_0x517de7['name']||'';this[_0x85ef('0x1')]=_0x517de7[_0x85ef('0x1')]||'';this[_0x85ef('0x2')]=_0x517de7[_0x85ef('0x2')]||'';this[_0x85ef('0x3')]=_0x517de7['remoteUri']||'';this[_0x85ef('0x4')]=_0x517de7['tenantId']||'';this[_0x85ef('0x5')]=_0x517de7[_0x85ef('0x5')]||'';this[_0x85ef('0x6')]=_0x517de7[_0x85ef('0x6')]||{};this['serverUrl']=_0x517de7[_0x85ef('0x7')]||'';this[_0x85ef('0x8')]=_0x517de7[_0x85ef('0x8')]||{};}module[_0x85ef('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 9f3b6d0..6fdfe28 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 _0x27d8=['SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','modem','v17,v27,v29','gateway','t38timeout','tech'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x27d8,0x13f));var _0x827d=function(_0x3afe18,_0x26922c){_0x3afe18=_0x3afe18-0x0;var _0x19ed1f=_0x27d8[_0x3afe18];return _0x19ed1f;};'use strict';function FaxAccount(_0x113740){this['id']=_0x113740['id']||0x0;this[_0x827d('0x0')]=_0x113740[_0x827d('0x0')]||'';this['description']=_0x113740[_0x827d('0x1')];this[_0x827d('0x2')]=_0x113740[_0x827d('0x2')];this[_0x827d('0x3')]=_0x113740[_0x827d('0x3')];this[_0x827d('0x4')]=_0x113740[_0x827d('0x4')];this[_0x827d('0x5')]=_0x113740[_0x827d('0x5')]||0x960;this['maxrate']=_0x113740['maxrate']||0x3840;this[_0x827d('0x6')]=_0x113740[_0x827d('0x6')]||_0x827d('0x7');this[_0x827d('0x8')]=_0x113740[_0x827d('0x8')]||'no';this['faxdetect']=_0x113740['faxdetect']||'no';this[_0x827d('0x9')]=_0x113740['t38timeout']||0x1388;this['tech']=_0x113740[_0x827d('0xa')]||_0x827d('0xb');this[_0x827d('0xc')]=_0x113740[_0x827d('0xc')]?_0x113740[_0x827d('0xc')]:undefined;this[_0x827d('0xd')]=_0x113740[_0x827d('0xd')];this[_0x827d('0xe')]=_0x113740['key'];}module['exports']=FaxAccount; \ No newline at end of file +var _0x6b1b=['v17,v27,v29','faxdetect','t38timeout','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem'];(function(_0x1d0764,_0x2beb7c){var _0x423f49=function(_0x5334ee){while(--_0x5334ee){_0x1d0764['push'](_0x1d0764['shift']());}};_0x423f49(++_0x2beb7c);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6b1b[_0x3947c9];return _0x2e7871;};'use strict';function FaxAccount(_0x4a6532){this['id']=_0x4a6532['id']||0x0;this[_0xb6b1('0x0')]=_0x4a6532[_0xb6b1('0x0')]||'';this[_0xb6b1('0x1')]=_0x4a6532['description'];this[_0xb6b1('0x2')]=_0x4a6532[_0xb6b1('0x2')];this[_0xb6b1('0x3')]=_0x4a6532[_0xb6b1('0x3')];this[_0xb6b1('0x4')]=_0x4a6532[_0xb6b1('0x4')];this[_0xb6b1('0x5')]=_0x4a6532[_0xb6b1('0x5')]||0x960;this[_0xb6b1('0x6')]=_0x4a6532[_0xb6b1('0x6')]||0x3840;this[_0xb6b1('0x7')]=_0x4a6532['modem']||_0xb6b1('0x8');this['gateway']=_0x4a6532['gateway']||'no';this[_0xb6b1('0x9')]=_0x4a6532['faxdetect']||'no';this[_0xb6b1('0xa')]=_0x4a6532['t38timeout']||0x1388;this['tech']=_0x4a6532['tech']||'SIP';this[_0xb6b1('0xb')]=_0x4a6532[_0xb6b1('0xb')]?_0x4a6532['Trunk']:undefined;this[_0xb6b1('0xc')]=_0x4a6532['ListId'];this['key']=_0x4a6532[_0xb6b1('0xd')];}module[_0xb6b1('0xe')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index e0bd5da..7500adc 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 _0xcdf8=['username','apiKey','token','remoteUri','Configurations','exports'];(function(_0x439d15,_0x508525){var _0x39def2=function(_0x3cf84b){while(--_0x3cf84b){_0x439d15['push'](_0x439d15['shift']());}};_0x39def2(++_0x508525);}(_0xcdf8,0xba));var _0x8cdf=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0xcdf8[_0x22f8ab];return _0x2a70e5;};'use strict';function FreshdeskAccount(_0x11c2a0){this['id']=_0x11c2a0['id']||0x0;this['name']=_0x11c2a0['name']||'';this[_0x8cdf('0x0')]=_0x11c2a0[_0x8cdf('0x0')]||'';this[_0x8cdf('0x1')]=_0x11c2a0[_0x8cdf('0x2')]||'';this['remoteUri']=_0x11c2a0[_0x8cdf('0x3')]||'';this['serverUrl']=_0x11c2a0['serverUrl']||'';this[_0x8cdf('0x4')]=_0x11c2a0['Configurations']||{};}module[_0x8cdf('0x5')]=FreshdeskAccount; \ No newline at end of file +var _0xb2d3=['name','username','apiKey','token','remoteUri','Configurations'];(function(_0xa7d64d,_0x275ded){var _0x19f6ef=function(_0xcf0610){while(--_0xcf0610){_0xa7d64d['push'](_0xa7d64d['shift']());}};_0x19f6ef(++_0x275ded);}(_0xb2d3,0x19e));var _0x3b2d=function(_0x4d8666,_0x2ff19d){_0x4d8666=_0x4d8666-0x0;var _0x37175b=_0xb2d3[_0x4d8666];return _0x37175b;};'use strict';function FreshdeskAccount(_0x349dce){this['id']=_0x349dce['id']||0x0;this[_0x3b2d('0x0')]=_0x349dce[_0x3b2d('0x0')]||'';this[_0x3b2d('0x1')]=_0x349dce['username']||'';this[_0x3b2d('0x2')]=_0x349dce[_0x3b2d('0x3')]||'';this[_0x3b2d('0x4')]=_0x349dce[_0x3b2d('0x4')]||'';this['serverUrl']=_0x349dce['serverUrl']||'';this['Configurations']=_0x349dce[_0x3b2d('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 24bfca6..f897c2d 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 _0x95cf=['Configurations','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x568039,_0x254d6f){var _0x3b1462=function(_0x4c4194){while(--_0x4c4194){_0x568039['push'](_0x568039['shift']());}};_0x3b1462(++_0x254d6f);}(_0x95cf,0x14a));var _0xf95c=function(_0x452ec3,_0x34241b){_0x452ec3=_0x452ec3-0x0;var _0x2906bc=_0x95cf[_0x452ec3];return _0x2906bc;};'use strict';function FreshsalesAccount(_0x2c2284){this['id']=_0x2c2284['id']||0x0;this[_0xf95c('0x0')]=_0x2c2284[_0xf95c('0x0')]||'';this['username']=_0x2c2284[_0xf95c('0x1')]||'';this[_0xf95c('0x2')]=_0x2c2284[_0xf95c('0x3')]||'';this['remoteUri']=_0x2c2284[_0xf95c('0x4')]||'';this[_0xf95c('0x5')]=_0x2c2284[_0xf95c('0x5')]||'';this[_0xf95c('0x6')]=_0x2c2284[_0xf95c('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0xd5b4=['name','username','apiKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x13e724,_0x296739){var _0x334a44=function(_0x28f54e){while(--_0x28f54e){_0x13e724['push'](_0x13e724['shift']());}};_0x334a44(++_0x296739);}(_0xd5b4,0x157));var _0x4d5b=function(_0x147e3f,_0x3d6ce4){_0x147e3f=_0x147e3f-0x0;var _0x1ce9e5=_0xd5b4[_0x147e3f];return _0x1ce9e5;};'use strict';function FreshsalesAccount(_0x3c3738){this['id']=_0x3c3738['id']||0x0;this[_0x4d5b('0x0')]=_0x3c3738['name']||'';this[_0x4d5b('0x1')]=_0x3c3738['username']||'';this[_0x4d5b('0x2')]=_0x3c3738['token']||'';this['remoteUri']=_0x3c3738[_0x4d5b('0x3')]||'';this[_0x4d5b('0x4')]=_0x3c3738['serverUrl']||'';this[_0x4d5b('0x5')]=_0x3c3738[_0x4d5b('0x5')]||{};}module[_0x4d5b('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index c1256d6..8d921fb 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 _0xc54a=['mohtime','type','inbound','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','channel','connectedlinenum','connectedlinename','exten','priority','holdtime','lastAssignedTo'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc54a,0x17b));var _0xac54=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc54a[_0x3dd15e];return _0x231fd0;};'use strict';function QueueReport(){this[_0xac54('0x0')]=_0xac54('0x1');this['uniqueid']='';this['calleridnum']='';this[_0xac54('0x2')]='';this[_0xac54('0x3')]='';this[_0xac54('0x4')]=null;this[_0xac54('0x5')]=null;this['position']=0x1;this['count']=0x1;this['queuecallerabandon']=![];this[_0xac54('0x6')]=null;this[_0xac54('0x7')]=![];this[_0xac54('0x8')]=null;this[_0xac54('0x9')]=![];this['queuecallerexitAt']=null;this['originalposition']=0x1;this[_0xac54('0xa')]='';this[_0xac54('0xb')]='';this[_0xac54('0xc')]='';this['accountcode']='';this['context']='';this[_0xac54('0xd')]='';this[_0xac54('0xe')]='';this[_0xac54('0xf')]=0x0;this['assigned']=![];this[_0xac54('0x10')]='';this[_0xac54('0x11')]=0x0;this['variables']={};}module['exports']=QueueReport; \ No newline at end of file +var _0xa49b=['inbound','uniqueid','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','originalposition','channel','connectedlinenum','accountcode','context','exten','priority','assigned','lastAssignedTo','mohtime'];(function(_0x2593e7,_0x49e4c6){var _0xab62da=function(_0x987cae){while(--_0x987cae){_0x2593e7['push'](_0x2593e7['shift']());}};_0xab62da(++_0x49e4c6);}(_0xa49b,0x126));var _0xba49=function(_0x2a2349,_0xeb0cf6){_0x2a2349=_0x2a2349-0x0;var _0xb341c8=_0xa49b[_0x2a2349];return _0xb341c8;};'use strict';function QueueReport(){this['type']=_0xba49('0x0');this[_0xba49('0x1')]='';this[_0xba49('0x2')]='';this[_0xba49('0x3')]='';this['queue']='';this[_0xba49('0x4')]=null;this[_0xba49('0x5')]=null;this[_0xba49('0x6')]=0x1;this['count']=0x1;this[_0xba49('0x7')]=![];this[_0xba49('0x8')]=null;this[_0xba49('0x9')]=![];this['queuecallercompleteAt']=null;this[_0xba49('0xa')]=![];this['queuecallerexitAt']=null;this[_0xba49('0xb')]=0x1;this[_0xba49('0xc')]='';this[_0xba49('0xd')]='';this['connectedlinename']='';this[_0xba49('0xe')]='';this[_0xba49('0xf')]='';this[_0xba49('0x10')]='';this[_0xba49('0x11')]='';this['holdtime']=0x0;this[_0xba49('0x12')]=![];this[_0xba49('0x13')]='';this[_0xba49('0x14')]=0x0;this['variables']={};}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 d126b99..329bbbb 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 _0x0721=['remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username'];(function(_0x56a7c0,_0x50ab73){var _0x5e501b=function(_0x384c49){while(--_0x384c49){_0x56a7c0['push'](_0x56a7c0['shift']());}};_0x5e501b(++_0x50ab73);}(_0x0721,0x82));var _0x1072=function(_0x2becba,_0x4ea656){_0x2becba=_0x2becba-0x0;var _0x90b5dd=_0x0721[_0x2becba];return _0x90b5dd;};'use strict';function SalesforceAccount(_0x128815){this['id']=_0x128815['id']||0x0;this[_0x1072('0x0')]=_0x128815[_0x1072('0x0')]||'';this[_0x1072('0x1')]=_0x128815[_0x1072('0x1')]||'';this[_0x1072('0x2')]=_0x128815[_0x1072('0x2')]||'';this[_0x1072('0x3')]=_0x128815[_0x1072('0x3')]||'';this[_0x1072('0x4')]=_0x128815[_0x1072('0x4')]||'';this[_0x1072('0x5')]=_0x128815[_0x1072('0x5')]||'';this[_0x1072('0x6')]=_0x128815[_0x1072('0x6')]||'';this[_0x1072('0x7')]=_0x128815[_0x1072('0x7')]||_0x1072('0x8');this['serverUrl']=_0x128815[_0x1072('0x9')]||'';this[_0x1072('0xa')]=_0x128815['Configurations']||{};}module[_0x1072('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x2c1a=['Configurations','exports','username','remoteUri','password','clientId','clientSecret','type','serverUrl'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x2c1a,0x1bb));var _0xa2c1=function(_0x581f8e,_0x5617cb){_0x581f8e=_0x581f8e-0x0;var _0x18aec=_0x2c1a[_0x581f8e];return _0x18aec;};'use strict';function SalesforceAccount(_0x43bdc3){this['id']=_0x43bdc3['id']||0x0;this['name']=_0x43bdc3['name']||'';this[_0xa2c1('0x0')]=_0x43bdc3[_0xa2c1('0x0')]||'';this[_0xa2c1('0x1')]=_0x43bdc3[_0xa2c1('0x1')]||'';this[_0xa2c1('0x2')]=_0x43bdc3[_0xa2c1('0x2')]||'';this[_0xa2c1('0x3')]=_0x43bdc3['clientId']||'';this[_0xa2c1('0x4')]=_0x43bdc3[_0xa2c1('0x4')]||'';this['securityToken']=_0x43bdc3['securityToken']||'';this['type']=_0x43bdc3[_0xa2c1('0x5')]||'integrationTab';this[_0xa2c1('0x6')]=_0x43bdc3[_0xa2c1('0x6')]||'';this[_0xa2c1('0x7')]=_0x43bdc3[_0xa2c1('0x7')]||{};}module[_0xa2c1('0x8')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 78e8147..a3895db 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 _0xc29e=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0xc32ca2,_0x137fc8){var _0x2b2052=function(_0x53672d){while(--_0x53672d){_0xc32ca2['push'](_0xc32ca2['shift']());}};_0x2b2052(++_0x137fc8);}(_0xc29e,0x118));var _0xec29=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xc29e[_0x4243a3];return _0x1b2a33;};'use strict';function ServicenowAccount(_0x167595){this['id']=_0x167595['id']||0x0;this[_0xec29('0x0')]=_0x167595[_0xec29('0x0')]||'';this[_0xec29('0x1')]=_0x167595[_0xec29('0x1')]||'';this[_0xec29('0x2')]=_0x167595[_0xec29('0x2')]||'';this[_0xec29('0x3')]=_0x167595['remoteUri']||'';this[_0xec29('0x4')]=_0x167595[_0xec29('0x4')]||'';this[_0xec29('0x5')]=_0x167595[_0xec29('0x5')]||{};}module[_0xec29('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xffbd=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0xeb1e1a,_0x26c250){var _0x5b6a9f=function(_0x554da1){while(--_0x554da1){_0xeb1e1a['push'](_0xeb1e1a['shift']());}};_0x5b6a9f(++_0x26c250);}(_0xffbd,0x125));var _0xdffb=function(_0x4e7d4a,_0x35cdc8){_0x4e7d4a=_0x4e7d4a-0x0;var _0x235800=_0xffbd[_0x4e7d4a];return _0x235800;};'use strict';function ServicenowAccount(_0x3a3eca){this['id']=_0x3a3eca['id']||0x0;this[_0xdffb('0x0')]=_0x3a3eca['name']||'';this[_0xdffb('0x1')]=_0x3a3eca[_0xdffb('0x1')]||'';this[_0xdffb('0x2')]=_0x3a3eca[_0xdffb('0x2')]||'';this[_0xdffb('0x3')]=_0x3a3eca[_0xdffb('0x3')]||'';this['serverUrl']=_0x3a3eca[_0xdffb('0x4')]||'';this[_0xdffb('0x5')]=_0x3a3eca['Configurations']||{};}module[_0xdffb('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index bcca5df..8d336df 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 _0xe579=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0xb603f1,_0x31555a){var _0x5a77aa=function(_0x4991a1){while(--_0x4991a1){_0xb603f1['push'](_0xb603f1['shift']());}};_0x5a77aa(++_0x31555a);}(_0xe579,0x1a4));var _0x9e57=function(_0x116e4a,_0x416475){_0x116e4a=_0x116e4a-0x0;var _0x55e1f8=_0xe579[_0x116e4a];return _0x55e1f8;};'use strict';function SugarcrmAccount(_0x1a31fb){this['id']=_0x1a31fb['id']||0x0;this['name']=_0x1a31fb[_0x9e57('0x0')]||'';this[_0x9e57('0x1')]=_0x1a31fb[_0x9e57('0x1')]||'';this['password']=_0x1a31fb[_0x9e57('0x2')]||'';this[_0x9e57('0x3')]=_0x1a31fb['remoteUri']||'';this[_0x9e57('0x4')]=_0x1a31fb['serverUrl']||'';this[_0x9e57('0x5')]=_0x1a31fb['Configurations']||{};}module[_0x9e57('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xc46e=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x4a470a,_0xfe1d7f){var _0x38dc57=function(_0x5f1826){while(--_0x5f1826){_0x4a470a['push'](_0x4a470a['shift']());}};_0x38dc57(++_0xfe1d7f);}(_0xc46e,0x195));var _0xec46=function(_0x212579,_0xdb4d5a){_0x212579=_0x212579-0x0;var _0x55d50e=_0xc46e[_0x212579];return _0x55d50e;};'use strict';function SugarcrmAccount(_0x4c6d06){this['id']=_0x4c6d06['id']||0x0;this['name']=_0x4c6d06[_0xec46('0x0')]||'';this[_0xec46('0x1')]=_0x4c6d06[_0xec46('0x1')]||'';this[_0xec46('0x2')]=_0x4c6d06['password']||'';this[_0xec46('0x3')]=_0x4c6d06[_0xec46('0x3')]||'';this[_0xec46('0x4')]=_0x4c6d06[_0xec46('0x4')]||'';this[_0xec46('0x5')]=_0x4c6d06[_0xec46('0x5')]||{};}module[_0xec46('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 9b70e12..0d04def 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 _0xd1c6=['state','stateTime','unknown','address','name','accountcode'];(function(_0x2275fd,_0x2750ea){var _0x5c7af2=function(_0x42a9bf){while(--_0x42a9bf){_0x2275fd['push'](_0x2275fd['shift']());}};_0x5c7af2(++_0x2750ea);}(_0xd1c6,0x1c0));var _0x6d1c=function(_0x4fdabe,_0x246704){_0x4fdabe=_0x4fdabe-0x0;var _0x1c7f69=_0xd1c6[_0x4fdabe];return _0x1c7f69;};'use strict';function Telephone(_0x5288cb){this['id']=_0x5288cb['id']||0x0;this['name']=_0x5288cb[_0x6d1c('0x0')]||'';this[_0x6d1c('0x1')]=_0x5288cb['accountcode']||'';this[_0x6d1c('0x2')]='unknown';this[_0x6d1c('0x3')]=0x0;this['status']=_0x6d1c('0x4');this[_0x6d1c('0x5')]='';}module['exports']=Telephone; \ No newline at end of file +var _0x30d8=['accountcode','state','unknown','address','exports','name'];(function(_0x1e9449,_0x422da){var _0x1740ab=function(_0x2562b8){while(--_0x2562b8){_0x1e9449['push'](_0x1e9449['shift']());}};_0x1740ab(++_0x422da);}(_0x30d8,0x1eb));var _0x830d=function(_0x1609cf,_0x197913){_0x1609cf=_0x1609cf-0x0;var _0x54cf96=_0x30d8[_0x1609cf];return _0x54cf96;};'use strict';function Telephone(_0xb229cf){this['id']=_0xb229cf['id']||0x0;this[_0x830d('0x0')]=_0xb229cf[_0x830d('0x0')]||'';this[_0x830d('0x1')]=_0xb229cf[_0x830d('0x1')]||'';this[_0x830d('0x2')]='unknown';this['stateTime']=0x0;this['status']=_0x830d('0x3');this[_0x830d('0x4')]='';}module[_0x830d('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index ba1c220..069a839 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 _0x59ad=['exports','name','html'];(function(_0x12f78f,_0x433347){var _0x357600=function(_0x1859a2){while(--_0x1859a2){_0x12f78f['push'](_0x12f78f['shift']());}};_0x357600(++_0x433347);}(_0x59ad,0xee));var _0xd59a=function(_0x2d91bb,_0x5abaf8){_0x2d91bb=_0x2d91bb-0x0;var _0x43ad2f=_0x59ad[_0x2d91bb];return _0x43ad2f;};'use strict';function template(_0xc9ee44){this['id']=_0xc9ee44['id']||0x0;this[_0xd59a('0x0')]=_0xc9ee44[_0xd59a('0x0')]||'';this[_0xd59a('0x1')]=_0xc9ee44[_0xd59a('0x1')]||'';}module[_0xd59a('0x2')]=template; \ No newline at end of file +var _0x7b78=['html','exports','name'];(function(_0x16606b,_0x3d2f3d){var _0x13673f=function(_0xdee545){while(--_0xdee545){_0x16606b['push'](_0x16606b['shift']());}};_0x13673f(++_0x3d2f3d);}(_0x7b78,0xad));var _0x87b7=function(_0x30e6aa,_0xac0c89){_0x30e6aa=_0x30e6aa-0x0;var _0x479a78=_0x7b78[_0x30e6aa];return _0x479a78;};'use strict';function template(_0x223376){this['id']=_0x223376['id']||0x0;this[_0x87b7('0x0')]=_0x223376[_0x87b7('0x0')]||'';this[_0x87b7('0x1')]=_0x223376[_0x87b7('0x1')]||'';}module[_0x87b7('0x2')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 4eed987..f957f6e 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(_0x645df8,_0x299983){var _0x40187f=function(_0x1a0592){while(--_0x1a0592){_0x645df8['push'](_0x645df8['shift']());}};_0x40187f(++_0x299983);}(_0x9c44,0x178));var _0x49c4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9c44[_0x160c73];return _0xd9302;};'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 _0xa41a=['AnyConditions','Actions','name','channel','voice','status','AllConditions'];(function(_0x52caef,_0x5567b3){var _0x3870ce=function(_0x45d185){while(--_0x45d185){_0x52caef['push'](_0x52caef['shift']());}};_0x3870ce(++_0x5567b3);}(_0xa41a,0x6b));var _0xaa41=function(_0x205340,_0x6a19d3){_0x205340=_0x205340-0x0;var _0x45aff4=_0xa41a[_0x205340];return _0x45aff4;};'use strict';function Trigger(_0x33e667){this['id']=_0x33e667['id']||0x0;this[_0xaa41('0x0')]=_0x33e667['name']||'';this[_0xaa41('0x1')]=_0x33e667[_0xaa41('0x1')]||_0xaa41('0x2');this[_0xaa41('0x3')]=_0x33e667[_0xaa41('0x3')]||![];this[_0xaa41('0x4')]=_0x33e667[_0xaa41('0x4')]||[];this[_0xaa41('0x5')]=_0x33e667['AnyConditions']||[];this[_0xaa41('0x6')]=_0x33e667[_0xaa41('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 56cab9c..53d6c61 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 _0x462e=['indexOf','split','port','domain','domainport','refresh','registrationtime','address','active','name','unknown','stateTime','status','registry'];(function(_0xc87d08,_0x59c9be){var _0x30a714=function(_0x437c0d){while(--_0x437c0d){_0xc87d08['push'](_0xc87d08['shift']());}};_0x30a714(++_0x59c9be);}(_0x462e,0x13c));var _0xe462=function(_0x33c368,_0x360da4){_0x33c368=_0x33c368-0x0;var _0x36c85d=_0x462e[_0x33c368];return _0x36c85d;};'use strict';function Trunk(_0x2907ae){this['id']=_0x2907ae['id']||0x0;this[_0xe462('0x0')]=_0x2907ae[_0xe462('0x0')]||![];this[_0xe462('0x1')]=_0x2907ae[_0xe462('0x1')]||'';this['state']=_0xe462('0x2');this[_0xe462('0x3')]=0x0;this[_0xe462('0x4')]=_0xe462('0x2');this['registry']=_0x2907ae[_0xe462('0x5')]&&_0x2907ae[_0xe462('0x5')][_0xe462('0x6')](':')?_0x2907ae[_0xe462('0x5')][_0xe462('0x7')](':')[0x0]:'';this['host']='';this[_0xe462('0x8')]='';this[_0xe462('0x9')]='';this[_0xe462('0xa')]='';this[_0xe462('0xb')]='';this['stateRegistry']=_0xe462('0x2');this[_0xe462('0xc')]='';this[_0xe462('0xd')]='';}module['exports']=Trunk; \ No newline at end of file +var _0xfab2=['registry','host','port','domain','domainport','refresh','stateRegistry','address','active','name','state','unknown','status'];(function(_0x1765dc,_0x17d194){var _0x5e7800=function(_0x6d8197){while(--_0x6d8197){_0x1765dc['push'](_0x1765dc['shift']());}};_0x5e7800(++_0x17d194);}(_0xfab2,0xf2));var _0x2fab=function(_0x5c7e21,_0x55970c){_0x5c7e21=_0x5c7e21-0x0;var _0x476dc3=_0xfab2[_0x5c7e21];return _0x476dc3;};'use strict';function Trunk(_0x5b4bda){this['id']=_0x5b4bda['id']||0x0;this['active']=_0x5b4bda[_0x2fab('0x0')]||![];this['name']=_0x5b4bda[_0x2fab('0x1')]||'';this[_0x2fab('0x2')]=_0x2fab('0x3');this['stateTime']=0x0;this[_0x2fab('0x4')]=_0x2fab('0x3');this[_0x2fab('0x5')]=_0x5b4bda[_0x2fab('0x5')]&&_0x5b4bda[_0x2fab('0x5')]['indexOf'](':')?_0x5b4bda['registry']['split'](':')[0x0]:'';this[_0x2fab('0x6')]='';this[_0x2fab('0x7')]='';this[_0x2fab('0x8')]='';this[_0x2fab('0x9')]='';this[_0x2fab('0xa')]='';this[_0x2fab('0xb')]='unknown';this['registrationtime']='';this[_0x2fab('0xc')]='';}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 44391d3..a385138 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 _0x72d7=['exten','recordingFormat','mandatoryDisposition'];(function(_0x1cca7,_0x496ca4){var _0x4bd58c=function(_0x52acad){while(--_0x52acad){_0x1cca7['push'](_0x1cca7['shift']());}};_0x4bd58c(++_0x496ca4);}(_0x72d7,0x1f2));var _0x772d=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x72d7[_0x513aa5];return _0x1a1a7c;};'use strict';function voiceExtension(_0x44e4d3){this['id']=_0x44e4d3['id']||0x0;this[_0x772d('0x0')]=_0x44e4d3['exten']||'';this[_0x772d('0x1')]=_0x44e4d3[_0x772d('0x1')]||'none';this[_0x772d('0x2')]=_0x44e4d3[_0x772d('0x2')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x581b=['none','mandatoryDisposition','exten','recordingFormat'];(function(_0x6cdb11,_0x24489f){var _0x17f70a=function(_0x132e9a){while(--_0x132e9a){_0x6cdb11['push'](_0x6cdb11['shift']());}};_0x17f70a(++_0x24489f);}(_0x581b,0x10a));var _0xb581=function(_0x35e92e,_0x21581b){_0x35e92e=_0x35e92e-0x0;var _0x1205a8=_0x581b[_0x35e92e];return _0x1205a8;};'use strict';function voiceExtension(_0x237989){this['id']=_0x237989['id']||0x0;this[_0xb581('0x0')]=_0x237989[_0xb581('0x0')]||'';this[_0xb581('0x1')]=_0x237989[_0xb581('0x1')]||_0xb581('0x2');this['mandatoryDisposition']=_0x237989[_0xb581('0x3')]||![];}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 966bbf9..37362c8 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 _0x1c6a=['dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','unavailable','ringing','ringinuse','onhold','wav','wav49','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumBillable','unmanaged','abandoned','loggedIn','available','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1c6a,0x197));var _0xa1c6=function(_0x2fcf6b,_0xd140ff){_0x2fcf6b=_0x2fcf6b-0x0;var _0x155073=_0x1c6a[_0x2fcf6b];return _0x155073;};'use strict';var statusDesc=[_0xa1c6('0x0'),_0xa1c6('0x1'),_0xa1c6('0x2'),'busy','invalid',_0xa1c6('0x3'),_0xa1c6('0x4'),_0xa1c6('0x5'),_0xa1c6('0x6')];var monitorFormat={'wav':_0xa1c6('0x7'),'wav49':_0xa1c6('0x8'),'gsm':'gsm'};var strategy={'rrmemory':_0xa1c6('0x9'),'roundrobin':_0xa1c6('0xa')};function VoiceQueue(_0x379fae){this['id']=_0x379fae['id']||0x0;this[_0xa1c6('0xb')]=_0x379fae[_0xa1c6('0xb')]||'';this[_0xa1c6('0xc')]=_0x379fae[_0xa1c6('0xc')]||'';this[_0xa1c6('0xd')]=_0x379fae[_0xa1c6('0xd')]||_0xa1c6('0xe');this[_0xa1c6('0xf')]=0x0;this[_0xa1c6('0x10')]=0x0;this[_0xa1c6('0x11')]=0x0;this[_0xa1c6('0x12')]=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this[_0xa1c6('0x13')]=0x0;this[_0xa1c6('0x14')]=0x0;this[_0xa1c6('0x15')]=0x0;this[_0xa1c6('0x16')]=0x0;this[_0xa1c6('0x17')]=0x0;this['acw']=_0x379fae['acw']||![];this[_0xa1c6('0x18')]=_0x379fae[_0xa1c6('0x18')]||0xa;this[_0xa1c6('0x19')]=_0x379fae[_0xa1c6('0x19')]||'no';this[_0xa1c6('0x1a')]=!![];this[_0xa1c6('0x1b')]='';this[_0xa1c6('0x1c')]=0x0;this[_0xa1c6('0x1d')]=0x0;this[_0xa1c6('0x1e')]=_0x379fae[_0xa1c6('0x1e')]||null;this['dialGlobalInterval']=_0x379fae[_0xa1c6('0x1f')]?_0x379fae[_0xa1c6('0x1f')]:null;this[_0xa1c6('0x20')]=_0x379fae['dialActive'];this[_0xa1c6('0x21')]=_0x379fae[_0xa1c6('0x21')]||_0xa1c6('0x22');this[_0xa1c6('0x23')]=_0x379fae[_0xa1c6('0x23')]||0x0;this[_0xa1c6('0x24')]=_0x379fae[_0xa1c6('0x24')]||0x0;this['dialPowerLevel']=_0x379fae[_0xa1c6('0x25')]||0x1;this[_0xa1c6('0x26')]=_0x379fae[_0xa1c6('0x26')]||'dropRate';this['dialPredictiveOptimizationPercentage']=_0x379fae[_0xa1c6('0x27')]||0.03;this[_0xa1c6('0x28')]=_0x379fae[_0xa1c6('0x28')]||0x258;this[_0xa1c6('0x29')]=_0x379fae['dialOriginateCallerIdName']||'anonymous';this[_0xa1c6('0x2a')]=_0x379fae['dialOriginateCallerIdNumber']||_0xa1c6('0x2b');this[_0xa1c6('0x2c')]=_0x379fae['dialOriginateTimeout']||0x1e;this[_0xa1c6('0x2d')]=_0x379fae[_0xa1c6('0x2d')]||_0xa1c6('0x2e');this[_0xa1c6('0x2f')]=_0x379fae[_0xa1c6('0x2f')]||0x3;this[_0xa1c6('0x30')]=_0x379fae[_0xa1c6('0x30')]||undefined;this[_0xa1c6('0x31')]=_0x379fae[_0xa1c6('0x31')]||0x3;this[_0xa1c6('0x32')]=_0x379fae[_0xa1c6('0x32')]||0x96;this[_0xa1c6('0x33')]=_0x379fae[_0xa1c6('0x33')]||0x3;this[_0xa1c6('0x34')]=_0x379fae[_0xa1c6('0x34')]||0x96;this[_0xa1c6('0x35')]=_0x379fae[_0xa1c6('0x35')]||0x3;this[_0xa1c6('0x36')]=_0x379fae[_0xa1c6('0x36')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x379fae['dialNoSuchNumberMaxRetry']||0x3;this[_0xa1c6('0x37')]=_0x379fae[_0xa1c6('0x37')]||0x96;this[_0xa1c6('0x38')]=_0x379fae[_0xa1c6('0x38')]||0x3;this['dialDropRetryFrequency']=_0x379fae['dialDropRetryFrequency']||0x96;this[_0xa1c6('0x39')]=_0x379fae[_0xa1c6('0x39')]||0x3;this[_0xa1c6('0x3a')]=_0x379fae['dialAbandonedRetryFrequency']||0x96;this[_0xa1c6('0x3b')]=_0x379fae[_0xa1c6('0x3b')]||0x3;this[_0xa1c6('0x3c')]=_0x379fae[_0xa1c6('0x3c')]||0x96;this[_0xa1c6('0x3d')]=_0x379fae[_0xa1c6('0x3d')]||0x3;this[_0xa1c6('0x3e')]=_0x379fae[_0xa1c6('0x3e')]||0x96;this[_0xa1c6('0x3f')]=_0x379fae[_0xa1c6('0x3f')]||0x4;this[_0xa1c6('0x40')]=_0x379fae[_0xa1c6('0x40')]?_0x379fae[_0xa1c6('0x40')]:undefined;this['TrunkBackup']=_0x379fae[_0xa1c6('0x41')]?_0x379fae['TrunkBackup']:undefined;this[_0xa1c6('0x42')]=_0x379fae[_0xa1c6('0x42')]||undefined;this[_0xa1c6('0x43')]=_0x379fae[_0xa1c6('0x43')]?_0x379fae[_0xa1c6('0x43')]:undefined;this[_0xa1c6('0x44')]=_0x379fae[_0xa1c6('0x44')]||_0xa1c6('0x45');this[_0xa1c6('0x46')]=_0x379fae[_0xa1c6('0x46')]||undefined;this[_0xa1c6('0x47')]=_0x379fae['dialCutDigit']||undefined;this[_0xa1c6('0x48')]=strategy[_0x379fae[_0xa1c6('0x48')]]||'rrmemory';this[_0xa1c6('0x49')]=!![];this['dialAMDActive']=_0x379fae['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x379fae['dialAMDInitialSilence'];this[_0xa1c6('0x4a')]=_0x379fae[_0xa1c6('0x4a')];this[_0xa1c6('0x4b')]=_0x379fae[_0xa1c6('0x4b')];this['dialAMDTotalAnalysisTime']=_0x379fae[_0xa1c6('0x4c')];this[_0xa1c6('0x4d')]=_0x379fae[_0xa1c6('0x4d')];this[_0xa1c6('0x4e')]=_0x379fae[_0xa1c6('0x4e')];this[_0xa1c6('0x4f')]=_0x379fae[_0xa1c6('0x4f')];this[_0xa1c6('0x50')]=_0x379fae[_0xa1c6('0x50')];this[_0xa1c6('0x51')]=_0x379fae[_0xa1c6('0x51')];this[_0xa1c6('0x52')]=0x0;this[_0xa1c6('0x53')]=0x0;this['timeout']=_0x379fae[_0xa1c6('0x54')];this[_0xa1c6('0x55')]=0x0;this[_0xa1c6('0x56')]=0x0;this[_0xa1c6('0x57')]=0x0;this[_0xa1c6('0x58')]=0x0;this[_0xa1c6('0x59')]=0x0;this[_0xa1c6('0x5a')]=0x0;this[_0xa1c6('0x5b')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xa1c6('0x5c')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xa1c6('0x5d')]=0x0;this[_0xa1c6('0x5e')]=0x0;this[_0xa1c6('0x5f')]=0x0;this['outboundAbandonedDay']=0x0;this[_0xa1c6('0x60')]=undefined;this['startPredictive']=undefined;this[_0xa1c6('0x61')]=undefined;this[_0xa1c6('0x62')]=1.05;this[_0xa1c6('0x63')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0xa1c6('0x64')]=0x0;this[_0xa1c6('0x65')]=0x0;this[_0xa1c6('0x66')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xa1c6('0x67')]=0x0;this[_0xa1c6('0x68')]=0x0;this[_0xa1c6('0x69')]=_0x379fae[_0xa1c6('0x6a')]||0x14;this[_0xa1c6('0x6b')]=_0x379fae[_0xa1c6('0x6a')]||0xa;this[_0xa1c6('0x6c')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0xa1c6('0x6d')]=0x1;this[_0xa1c6('0x6e')]=0x0;this[_0xa1c6('0x6f')]=0x0;this[_0xa1c6('0x70')]=0x0;this[_0xa1c6('0x71')]=0x0;this[_0xa1c6('0x72')]=_0x379fae[_0xa1c6('0x72')]||0x1e;this[_0xa1c6('0x73')]=_0x379fae[_0xa1c6('0x73')]||![];this[_0xa1c6('0x74')]=_0x379fae[_0xa1c6('0x74')]||undefined;this[_0xa1c6('0x75')]=_0x379fae[_0xa1c6('0x75')]||![];this[_0xa1c6('0x76')]=_0x379fae['dialAgiAfterHangupAgent']||![];this[_0xa1c6('0xc')]=monitorFormat[_0x379fae['monitor_format']]?monitorFormat[_0x379fae[_0xa1c6('0xc')]]:undefined;this['mandatoryDisposition']=_0x379fae[_0xa1c6('0x77')]||![];this[_0xa1c6('0x78')]=_0x379fae[_0xa1c6('0x78')]?_0x379fae['mandatoryDispositionPause']:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0x8ecb=['predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupAgent','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','unavailable','ringing','ringinuse','onhold','wav','wav49','rrmemory','roundrobin','name','monitor_format','type','inbound','talking','answered','sumDuration','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls'];(function(_0x40a108,_0x104714){var _0x849035=function(_0x30b7b3){while(--_0x30b7b3){_0x40a108['push'](_0x40a108['shift']());}};_0x849035(++_0x104714);}(_0x8ecb,0x1d7));var _0xb8ec=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x8ecb[_0x3ff085];return _0x2b68c3;};'use strict';var statusDesc=[_0xb8ec('0x0'),_0xb8ec('0x1'),_0xb8ec('0x2'),_0xb8ec('0x3'),'invalid',_0xb8ec('0x4'),_0xb8ec('0x5'),_0xb8ec('0x6'),_0xb8ec('0x7')];var monitorFormat={'wav':_0xb8ec('0x8'),'wav49':_0xb8ec('0x9'),'gsm':'gsm'};var strategy={'rrmemory':_0xb8ec('0xa'),'roundrobin':_0xb8ec('0xb')};function VoiceQueue(_0x2d2c21){this['id']=_0x2d2c21['id']||0x0;this[_0xb8ec('0xc')]=_0x2d2c21[_0xb8ec('0xc')]||'';this[_0xb8ec('0xd')]=_0x2d2c21[_0xb8ec('0xd')]||'';this[_0xb8ec('0xe')]=_0x2d2c21[_0xb8ec('0xe')]||_0xb8ec('0xf');this['waiting']=0x0;this[_0xb8ec('0x10')]=0x0;this['total']=0x0;this[_0xb8ec('0x11')]=0x0;this[_0xb8ec('0x12')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this[_0xb8ec('0x13')]=0x0;this[_0xb8ec('0x14')]=0x0;this['available']=0x0;this[_0xb8ec('0x15')]=_0x2d2c21['acw']||![];this[_0xb8ec('0x16')]=_0x2d2c21[_0xb8ec('0x16')]||0xa;this[_0xb8ec('0x17')]=_0x2d2c21[_0xb8ec('0x17')]||'no';this[_0xb8ec('0x18')]=!![];this[_0xb8ec('0x19')]='';this[_0xb8ec('0x1a')]=0x0;this[_0xb8ec('0x1b')]=0x0;this[_0xb8ec('0x1c')]=_0x2d2c21[_0xb8ec('0x1c')]||null;this['dialGlobalInterval']=_0x2d2c21[_0xb8ec('0x1d')]?_0x2d2c21['dialGlobalInterval']:null;this['dialActive']=_0x2d2c21['dialActive'];this[_0xb8ec('0x1e')]=_0x2d2c21[_0xb8ec('0x1e')]||_0xb8ec('0x1f');this[_0xb8ec('0x20')]=_0x2d2c21['dialLimitChannel']||0x0;this[_0xb8ec('0x21')]=_0x2d2c21[_0xb8ec('0x21')]||0x0;this[_0xb8ec('0x22')]=_0x2d2c21[_0xb8ec('0x22')]||0x1;this['dialPredictiveOptimization']=_0x2d2c21[_0xb8ec('0x23')]||_0xb8ec('0x24');this['dialPredictiveOptimizationPercentage']=_0x2d2c21[_0xb8ec('0x25')]||0.03;this[_0xb8ec('0x26')]=_0x2d2c21['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x2d2c21[_0xb8ec('0x27')]||_0xb8ec('0x28');this['dialOriginateCallerIdNumber']=_0x2d2c21[_0xb8ec('0x29')]||'anonymous';this['dialOriginateTimeout']=_0x2d2c21['dialOriginateTimeout']||0x1e;this['dialQueueOptions']=_0x2d2c21[_0xb8ec('0x2a')]||'tTxX';this[_0xb8ec('0x2b')]=_0x2d2c21[_0xb8ec('0x2b')]||0x3;this[_0xb8ec('0x2c')]=_0x2d2c21[_0xb8ec('0x2c')]||undefined;this[_0xb8ec('0x2d')]=_0x2d2c21[_0xb8ec('0x2d')]||0x3;this[_0xb8ec('0x2e')]=_0x2d2c21['dialCongestionRetryFrequency']||0x96;this[_0xb8ec('0x2f')]=_0x2d2c21[_0xb8ec('0x2f')]||0x3;this[_0xb8ec('0x30')]=_0x2d2c21[_0xb8ec('0x30')]||0x96;this['dialNoAnswerMaxRetry']=_0x2d2c21[_0xb8ec('0x31')]||0x3;this[_0xb8ec('0x32')]=_0x2d2c21[_0xb8ec('0x32')]||0x96;this[_0xb8ec('0x33')]=_0x2d2c21[_0xb8ec('0x33')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x2d2c21['dialNoSuchNumberRetryFrequency']||0x96;this[_0xb8ec('0x34')]=_0x2d2c21[_0xb8ec('0x34')]||0x3;this[_0xb8ec('0x35')]=_0x2d2c21['dialDropRetryFrequency']||0x96;this[_0xb8ec('0x36')]=_0x2d2c21['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x2d2c21[_0xb8ec('0x37')]||0x96;this[_0xb8ec('0x38')]=_0x2d2c21[_0xb8ec('0x38')]||0x3;this[_0xb8ec('0x39')]=_0x2d2c21[_0xb8ec('0x39')]||0x96;this[_0xb8ec('0x3a')]=_0x2d2c21[_0xb8ec('0x3a')]||0x3;this[_0xb8ec('0x3b')]=_0x2d2c21['dialAgentRejectRetryFrequency']||0x96;this[_0xb8ec('0x3c')]=_0x2d2c21['dialGlobalMaxRetry']||0x4;this['Trunk']=_0x2d2c21[_0xb8ec('0x3d')]?_0x2d2c21[_0xb8ec('0x3d')]:undefined;this['TrunkBackup']=_0x2d2c21['TrunkBackup']?_0x2d2c21[_0xb8ec('0x3e')]:undefined;this['dialPrefix']=_0x2d2c21[_0xb8ec('0x3f')]||undefined;this[_0xb8ec('0x40')]=_0x2d2c21[_0xb8ec('0x40')]?_0x2d2c21[_0xb8ec('0x40')]:undefined;this[_0xb8ec('0x41')]=_0x2d2c21[_0xb8ec('0x41')]||_0xb8ec('0x42');this[_0xb8ec('0x43')]=_0x2d2c21[_0xb8ec('0x43')]||undefined;this['dialCutDigit']=_0x2d2c21['dialCutDigit']||undefined;this[_0xb8ec('0x44')]=strategy[_0x2d2c21[_0xb8ec('0x44')]]||_0xb8ec('0xa');this[_0xb8ec('0x45')]=!![];this[_0xb8ec('0x46')]=_0x2d2c21['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x2d2c21[_0xb8ec('0x47')];this[_0xb8ec('0x48')]=_0x2d2c21['dialAMDGreeting'];this[_0xb8ec('0x49')]=_0x2d2c21[_0xb8ec('0x49')];this['dialAMDTotalAnalysisTime']=_0x2d2c21[_0xb8ec('0x4a')];this[_0xb8ec('0x4b')]=_0x2d2c21[_0xb8ec('0x4b')];this[_0xb8ec('0x4c')]=_0x2d2c21[_0xb8ec('0x4c')];this[_0xb8ec('0x4d')]=_0x2d2c21[_0xb8ec('0x4d')];this['dialAMDSilenceThreshold']=_0x2d2c21['dialAMDSilenceThreshold'];this[_0xb8ec('0x4e')]=_0x2d2c21[_0xb8ec('0x4e')];this[_0xb8ec('0x4f')]=0x0;this['pTalking']=0x0;this['timeout']=_0x2d2c21[_0xb8ec('0x50')];this[_0xb8ec('0x51')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0xb8ec('0x52')]=0x0;this[_0xb8ec('0x53')]=0x0;this[_0xb8ec('0x54')]=0x0;this[_0xb8ec('0x55')]=0x0;this[_0xb8ec('0x56')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xb8ec('0x57')]=0x0;this[_0xb8ec('0x58')]=0x0;this[_0xb8ec('0x59')]=0x0;this[_0xb8ec('0x5a')]=0x0;this[_0xb8ec('0x5b')]=0x0;this[_0xb8ec('0x5c')]=undefined;this[_0xb8ec('0x5d')]=undefined;this[_0xb8ec('0x5e')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0xb8ec('0x5f')]=0x0;this[_0xb8ec('0x60')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xb8ec('0x61')]=0x0;this[_0xb8ec('0x62')]=0x0;this[_0xb8ec('0x63')]=0x0;this[_0xb8ec('0x64')]=_0x2d2c21[_0xb8ec('0x65')]||0x14;this[_0xb8ec('0x66')]=_0x2d2c21[_0xb8ec('0x65')]||0xa;this[_0xb8ec('0x67')]=0x0;this[_0xb8ec('0x68')]=0x0;this[_0xb8ec('0x69')]=0x1;this['erlangCalls']=0x0;this[_0xb8ec('0x6a')]=0x0;this[_0xb8ec('0x6b')]=0x0;this[_0xb8ec('0x6c')]=0x0;this[_0xb8ec('0x6d')]=_0x2d2c21[_0xb8ec('0x6d')]||0x1e;this['dialRecallInQueue']=_0x2d2c21[_0xb8ec('0x6e')]||![];this[_0xb8ec('0x6f')]=_0x2d2c21[_0xb8ec('0x6f')]||undefined;this['dialAgiAfterHangupClient']=_0x2d2c21['dialAgiAfterHangupClient']||![];this[_0xb8ec('0x70')]=_0x2d2c21[_0xb8ec('0x70')]||![];this[_0xb8ec('0xd')]=monitorFormat[_0x2d2c21[_0xb8ec('0xd')]]?monitorFormat[_0x2d2c21['monitor_format']]:undefined;this['mandatoryDisposition']=_0x2d2c21['mandatoryDisposition']||![];this[_0xb8ec('0x71')]=_0x2d2c21[_0xb8ec('0x71')]?_0x2d2c21[_0xb8ec('0x71')]:undefined;}module[_0xb8ec('0x72')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 3bbef06..6551f43 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 _0x5541=['username','accessKey','remoteUri','serverUrl','Configurations','name'];(function(_0x4188e7,_0x319155){var _0x26e9fb=function(_0x1f7890){while(--_0x1f7890){_0x4188e7['push'](_0x4188e7['shift']());}};_0x26e9fb(++_0x319155);}(_0x5541,0x1df));var _0x1554=function(_0x21c6b8,_0x16d6f6){_0x21c6b8=_0x21c6b8-0x0;var _0x39d474=_0x5541[_0x21c6b8];return _0x39d474;};'use strict';function VtigerAccount(_0xe56e5b){this['id']=_0xe56e5b['id']||0x0;this['name']=_0xe56e5b[_0x1554('0x0')]||'';this[_0x1554('0x1')]=_0xe56e5b['username']||'';this['accessKey']=_0xe56e5b[_0x1554('0x2')]||'';this['remoteUri']=_0xe56e5b[_0x1554('0x3')]||'';this[_0x1554('0x4')]=_0xe56e5b[_0x1554('0x4')]||'';this[_0x1554('0x5')]=_0xe56e5b['Configurations']||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x4f64=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0xa085f0,_0x41e7dc){var _0x4066d6=function(_0x1f3e1a){while(--_0x1f3e1a){_0xa085f0['push'](_0xa085f0['shift']());}};_0x4066d6(++_0x41e7dc);}(_0x4f64,0xdf));var _0x44f6=function(_0x372c00,_0x147d59){_0x372c00=_0x372c00-0x0;var _0x50b04b=_0x4f64[_0x372c00];return _0x50b04b;};'use strict';function VtigerAccount(_0x352625){this['id']=_0x352625['id']||0x0;this[_0x44f6('0x0')]=_0x352625[_0x44f6('0x0')]||'';this[_0x44f6('0x1')]=_0x352625[_0x44f6('0x1')]||'';this['accessKey']=_0x352625[_0x44f6('0x2')]||'';this[_0x44f6('0x3')]=_0x352625['remoteUri']||'';this[_0x44f6('0x4')]=_0x352625[_0x44f6('0x4')]||'';this[_0x44f6('0x5')]=_0x352625['Configurations']||{};}module[_0x44f6('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 6a8f70b..e634934 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 _0xadb5=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xadb5,0xad));var _0x5adb=function(_0x2aec84,_0x18baf2){_0x2aec84=_0x2aec84-0x0;var _0x2f08c4=_0xadb5[_0x2aec84];return _0x2f08c4;};'use strict';function ZendeskAccount(_0x1f969c){this['id']=_0x1f969c['id']||0x0;this[_0x5adb('0x0')]=_0x1f969c['name']||'';this[_0x5adb('0x1')]=_0x1f969c[_0x5adb('0x1')]||'';this[_0x5adb('0x2')]=_0x1f969c['password']||'';this[_0x5adb('0x3')]=_0x1f969c[_0x5adb('0x3')]||'';this[_0x5adb('0x4')]=_0x1f969c['remoteUri']||'';this[_0x5adb('0x5')]=_0x1f969c[_0x5adb('0x5')]||'';this[_0x5adb('0x6')]=_0x1f969c[_0x5adb('0x6')]||_0x5adb('0x7');this[_0x5adb('0x8')]=_0x1f969c[_0x5adb('0x8')]||'';this[_0x5adb('0x9')]=_0x1f969c[_0x5adb('0x9')]||{};}module[_0x5adb('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x0b0e=['exports','name','username','password','token','remoteUri','authType','type','serverUrl','Configurations'];(function(_0x179e11,_0xf65436){var _0x549f04=function(_0x610545){while(--_0x610545){_0x179e11['push'](_0x179e11['shift']());}};_0x549f04(++_0xf65436);}(_0x0b0e,0x187));var _0xe0b0=function(_0x27c068,_0x342981){_0x27c068=_0x27c068-0x0;var _0xe5a67f=_0x0b0e[_0x27c068];return _0xe5a67f;};'use strict';function ZendeskAccount(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['username']=_0x29cd1e[_0xe0b0('0x1')]||'';this[_0xe0b0('0x2')]=_0x29cd1e[_0xe0b0('0x2')]||'';this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||'';this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||'';this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||'';this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||'integrationTab';this['serverUrl']=_0x29cd1e[_0xe0b0('0x7')]||'';this[_0xe0b0('0x8')]=_0x29cd1e[_0xe0b0('0x8')]||{};}module[_0xe0b0('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 8f4c8eb..cd7f582 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 _0x85de=['clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','clientId'];(function(_0x430a36,_0x3ede38){var _0x6e4889=function(_0x3e2447){while(--_0x3e2447){_0x430a36['push'](_0x430a36['shift']());}};_0x6e4889(++_0x3ede38);}(_0x85de,0x1f0));var _0xe85d=function(_0x490090,_0x444634){_0x490090=_0x490090-0x0;var _0x5898d8=_0x85de[_0x490090];return _0x5898d8;};'use strict';function ZohoAccount(_0x43a651){this['id']=_0x43a651['id']||0x0;this[_0xe85d('0x0')]=_0x43a651[_0xe85d('0x0')]||'';this[_0xe85d('0x1')]=_0x43a651[_0xe85d('0x1')]||'';this['host']=_0x43a651[_0xe85d('0x2')]||'';this['zone']=_0x43a651['zone']||'';this[_0xe85d('0x3')]=_0x43a651[_0xe85d('0x3')]||'';this['clientSecret']=_0x43a651[_0xe85d('0x4')]||'';this[_0xe85d('0x5')]=_0x43a651[_0xe85d('0x5')]||'';this[_0xe85d('0x6')]=_0x43a651[_0xe85d('0x6')]||'';this[_0xe85d('0x7')]=_0x43a651[_0xe85d('0x7')]||'';this[_0xe85d('0x8')]=_0x43a651['Configurations']||{};}module[_0xe85d('0x9')]=ZohoAccount; \ No newline at end of file +var _0x390a=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x150496,_0x1b5333){var _0x103cb3=function(_0x1b9526){while(--_0x1b9526){_0x150496['push'](_0x150496['shift']());}};_0x103cb3(++_0x1b5333);}(_0x390a,0xc9));var _0xa390=function(_0x5b60e3,_0x598c80){_0x5b60e3=_0x5b60e3-0x0;var _0x5790a1=_0x390a[_0x5b60e3];return _0x5790a1;};'use strict';function ZohoAccount(_0xe38cf5){this['id']=_0xe38cf5['id']||0x0;this[_0xa390('0x0')]=_0xe38cf5[_0xa390('0x0')]||'';this[_0xa390('0x1')]=_0xe38cf5['description']||'';this[_0xa390('0x2')]=_0xe38cf5[_0xa390('0x2')]||'';this[_0xa390('0x3')]=_0xe38cf5[_0xa390('0x3')]||'';this['clientId']=_0xe38cf5[_0xa390('0x4')]||'';this[_0xa390('0x5')]=_0xe38cf5[_0xa390('0x5')]||'';this['serverUrl']=_0xe38cf5[_0xa390('0x6')]||'';this[_0xa390('0x7')]=_0xe38cf5['code']||'';this['refreshToken']=_0xe38cf5[_0xa390('0x8')]||'';this[_0xa390('0x9')]=_0xe38cf5[_0xa390('0x9')]||{};}module[_0xa390('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 760e402..3a0f456 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 _0x3c72=['phone','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','util','lodash','moment','string','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','calleridname','Contact'];(function(_0x35201e,_0x34341b){var _0x4bc5b7=function(_0x504ba7){while(--_0x504ba7){_0x35201e['push'](_0x35201e['shift']());}};_0x4bc5b7(++_0x34341b);}(_0x3c72,0x18b));var _0x23c7=function(_0x52f415,_0x48a802){_0x52f415=_0x52f415-0x0;var _0x34246f=_0x3c72[_0x52f415];return _0x34246f;};'use strict';var util=require(_0x23c7('0x0'));var _=require(_0x23c7('0x1'));var moment=require(_0x23c7('0x2'));function checkNameSurname(_0x3924c6,_0x42f5e9,_0x47efb7){var _0x136a67='';if(!_['isNil'](_0x42f5e9)&&_0x23c7('0x3')===typeof _0x42f5e9){_0x136a67+=_0x42f5e9;}if(!_['isNil'](_0x47efb7)&&_0x23c7('0x3')===typeof _0x47efb7){_0x136a67+='\x20'+_0x47efb7;}if(_0x136a67!==''){return _0x136a67;}return _0x3924c6;}function Action(_0x28913a,_0x4102e9,_0x313db2,_0x3b132e,_0x202ed1){this['uniqueid']=_0x313db2||undefined;this[_0x23c7('0x4')]=_0x28913a['id'];this[_0x23c7('0x5')]=_0x4102e9[_0x23c7('0x6')];this['type']=_0x4102e9[_0x23c7('0x7')];this[_0x23c7('0x8')]='queue';this[_0x23c7('0x9')]=![];this[_0x23c7('0xa')]=_['isNil'](_0x28913a[_0x23c7('0xb')])?undefined:_0x28913a[_0x23c7('0xb')][_0x23c7('0x6')];this[_0x23c7('0xc')]=this[_0x23c7('0xa')]?util['format']('SIP/%s',this['membername']):_0x3b132e||undefined;this[_0x23c7('0xd')]=checkNameSurname(_0x28913a[_0x23c7('0xe')][_0x23c7('0xf')],_0x28913a[_0x23c7('0xe')][_0x23c7('0x10')],_0x28913a[_0x23c7('0xe')][_0x23c7('0x11')]);this[_0x23c7('0x12')]=_0x28913a['active']||![];this['calleridnum']=_0x28913a[_0x23c7('0xe')][_0x23c7('0xf')];this[_0x23c7('0x13')]=_0x28913a['scheduledat'];this['countbusyretry']=_0x28913a[_0x23c7('0x14')]||0x0;this[_0x23c7('0x15')]=_0x28913a[_0x23c7('0x15')]||0x0;this[_0x23c7('0x16')]=_0x28913a[_0x23c7('0x16')]||0x0;this[_0x23c7('0x17')]=(_0x28913a[_0x23c7('0x14')]||0x0)+(_0x28913a[_0x23c7('0x15')]||0x0)+(_0x28913a['countnoanswerretry']||0x0);this[_0x23c7('0x18')]=_0x28913a[_0x23c7('0x18')]||0x0;this[_0x23c7('0x19')]=_0x28913a[_0x23c7('0x19')]||0x0;this['countabandonedretry']=_0x28913a[_0x23c7('0x1a')]||0x0;this['countmachineretry']=_0x28913a[_0x23c7('0x1b')]||0x0;this['countagentrejectretry']=_0x28913a[_0x23c7('0x1c')]||0x0;this['callback']=_0x28913a[_0x23c7('0x1d')];this[_0x23c7('0x1e')]=_0x28913a['callbackuniqueid'];this[_0x23c7('0x1f')]=_0x28913a['callbackat'];this['recallme']=_0x28913a[_0x23c7('0x20')];this['ContactId']=_0x28913a[_0x23c7('0x21')];this['ListId']=_0x28913a['ListId'];this[_0x23c7('0x22')]=_['isNil'](_0x28913a[_0x23c7('0xb')])?_0x28913a['UserId']:_0x28913a[_0x23c7('0xb')]['id'];this[_0x23c7('0x23')]=_0x28913a[_0x23c7('0x23')];this['originatecalleridnum']='';this[_0x23c7('0x24')]='';}Action[_0x23c7('0x25')][_0x23c7('0x26')]=function(){return util['format'](_0x23c7('0x27'),this['calleridname'],this[_0x23c7('0x28')]);};module['exports']=Action; \ No newline at end of file +var _0x0acb=['membername','Agent','channelAgent','format','phone','Contact','firstName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','originatecalleridname','prototype','\x22%s\x22\x20<%s>','calleridname','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','name','campaigntype','dialAnswer'];(function(_0x2a29ce,_0x15ff7c){var _0x1aebbd=function(_0x17e694){while(--_0x17e694){_0x2a29ce['push'](_0x2a29ce['shift']());}};_0x1aebbd(++_0x15ff7c);}(_0x0acb,0x91));var _0xb0ac=function(_0xfc2485,_0x7b7dbe){_0xfc2485=_0xfc2485-0x0;var _0x3d67a6=_0x0acb[_0xfc2485];return _0x3d67a6;};'use strict';var util=require(_0xb0ac('0x0'));var _=require(_0xb0ac('0x1'));var moment=require(_0xb0ac('0x2'));function checkNameSurname(_0x49dbbe,_0x4dba92,_0x103b1d){var _0x11af4b='';if(!_[_0xb0ac('0x3')](_0x4dba92)&&_0xb0ac('0x4')===typeof _0x4dba92){_0x11af4b+=_0x4dba92;}if(!_['isNil'](_0x103b1d)&&_0xb0ac('0x4')===typeof _0x103b1d){_0x11af4b+='\x20'+_0x103b1d;}if(_0x11af4b!==''){return _0x11af4b;}return _0x49dbbe;}function Action(_0x4b5558,_0x5a266c,_0x1620e5,_0xde93bc,_0x5ccccf){this[_0xb0ac('0x5')]=_0x1620e5||undefined;this[_0xb0ac('0x6')]=_0x4b5558['id'];this[_0xb0ac('0x7')]=_0x5a266c[_0xb0ac('0x8')];this['type']=_0x5a266c['type'];this[_0xb0ac('0x9')]=_0xb0ac('0x7');this[_0xb0ac('0xa')]=![];this[_0xb0ac('0xb')]=_['isNil'](_0x4b5558[_0xb0ac('0xc')])?undefined:_0x4b5558['Agent'][_0xb0ac('0x8')];this[_0xb0ac('0xd')]=this[_0xb0ac('0xb')]?util[_0xb0ac('0xe')]('SIP/%s',this['membername']):_0xde93bc||undefined;this['calleridname']=checkNameSurname(_0x4b5558['Contact'][_0xb0ac('0xf')],_0x4b5558[_0xb0ac('0x10')][_0xb0ac('0x11')],_0x4b5558[_0xb0ac('0x10')]['lastName']);this[_0xb0ac('0x12')]=_0x4b5558[_0xb0ac('0x12')]||![];this[_0xb0ac('0x13')]=_0x4b5558[_0xb0ac('0x10')]['phone'];this['scheduledat']=_0x4b5558[_0xb0ac('0x14')];this[_0xb0ac('0x15')]=_0x4b5558[_0xb0ac('0x15')]||0x0;this['countcongestionretry']=_0x4b5558[_0xb0ac('0x16')]||0x0;this['countnoanswerretry']=_0x4b5558[_0xb0ac('0x17')]||0x0;this['countglobal']=(_0x4b5558[_0xb0ac('0x15')]||0x0)+(_0x4b5558['countcongestionretry']||0x0)+(_0x4b5558[_0xb0ac('0x17')]||0x0);this['countnosuchnumberretry']=_0x4b5558[_0xb0ac('0x18')]||0x0;this[_0xb0ac('0x19')]=_0x4b5558[_0xb0ac('0x19')]||0x0;this[_0xb0ac('0x1a')]=_0x4b5558[_0xb0ac('0x1a')]||0x0;this['countmachineretry']=_0x4b5558['countmachineretry']||0x0;this[_0xb0ac('0x1b')]=_0x4b5558['countagentrejectretry']||0x0;this[_0xb0ac('0x1c')]=_0x4b5558[_0xb0ac('0x1c')];this[_0xb0ac('0x1d')]=_0x4b5558['callbackuniqueid'];this[_0xb0ac('0x1e')]=_0x4b5558[_0xb0ac('0x1e')];this[_0xb0ac('0x1f')]=_0x4b5558[_0xb0ac('0x1f')];this[_0xb0ac('0x20')]=_0x4b5558[_0xb0ac('0x20')];this['ListId']=_0x4b5558['ListId'];this['UserId']=_[_0xb0ac('0x3')](_0x4b5558[_0xb0ac('0xc')])?_0x4b5558['UserId']:_0x4b5558[_0xb0ac('0xc')]['id'];this['VoiceQueueId']=_0x4b5558['VoiceQueueId'];this['originatecalleridnum']='';this[_0xb0ac('0x21')]='';}Action[_0xb0ac('0x22')]['getCaller']=function(){return util[_0xb0ac('0xe')](_0xb0ac('0x23'),this[_0xb0ac('0x24')],this[_0xb0ac('0x25')]);};module[_0xb0ac('0x26')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 22aa3e0..16f002f 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 _0x3333=['[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','[default]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','reason','logAgent','createAgentHistory','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','originated:\x20','Contact','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','pick','getContactPreview','recallme','validateContact','isValid','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','phone','trim','getCallerId','dialRandomLastDigitCallerIdNumber','originatecalleridnum','extractCalleridNumber','addVariables','merge','Action','[originated][increment]','[originateFailure][logOriginateFailure]','logLookAgent','clone','isFailure','response','unlockContact','rejected','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','statedesc','channelstate','isUndefined','transfer','[syncHangup][talking][transfer]','destuniqueid','syncHangupRequest','addVariable','variables','filterKey','keys','variable','value','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','util','lodash','bluebird','uuid','moment','md5','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','./action','./util/util','redis','defaults','localhost','prototype','enqueue','tail','finally','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangup','syncDialEnd','newexten','syncNewExten','syncVarSet','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalMultiplicativeFactor','message','erlangBusyFactor','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','originated','sendMessageOneNotActive','paused','[CampaignPreview]\x20Campaign\x20Queue:\x20','logger','\x20is\x20disactive','syncCampaigns','dialMethod','booked','type','outbound','hasOwnProperty','setMessage','recallMe','isNil','Queue','pTalking:\x20','queue','dialAnswer','VoiceQueueId','status','channel','catch','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannels','size','clearZombieChannel','getContactRecallMe','then','length','getDiff','Agent','voicePause','run','logger2','disableContact','starttime','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','dialNoSuchNumberRetryFrequency','activeContact','linkedid','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','emit','custom:agentconnect','buildObj','acw','custom:agentConnectPreview','buildAcw','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','[callProgressDetectingCustomer][logBusyGlobal]','[callProgressDetectingCustomer][logBusy]','scheduledAt','unlockAgent','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','dialBusyRetryFrequency','CANCEL','outboundRejectCallsDay'];(function(_0x1eaa4a,_0x54e953){var _0x2c237a=function(_0x2ddaa3){while(--_0x2ddaa3){_0x1eaa4a['push'](_0x1eaa4a['shift']());}};_0x2c237a(++_0x54e953);}(_0x3333,0x70));var _0x3333=function(_0x3df223,_0x1740fc){_0x3df223=_0x3df223-0x0;var _0x562d11=_0x3333[_0x3df223];return _0x562d11;};'use strict';var util=require(_0x3333('0x0'));var _=require(_0x3333('0x1'));var BPromise=require(_0x3333('0x2'));var uuid=require(_0x3333('0x3'));var moment=require(_0x3333('0x4'));var md5=require(_0x3333('0x5'));var Redis=require('ioredis');var config=require(_0x3333('0x6'));var logger=require(_0x3333('0x7'))(_0x3333('0x8'));var loggerAction=require(_0x3333('0x7'))(_0x3333('0x9'));var ami=require('../ami');var rpcDb=require(_0x3333('0xa'));var Action=require(_0x3333('0xb'));var ut=require(_0x3333('0xc'));config[_0x3333('0xd')]=_[_0x3333('0xe')](config[_0x3333('0xd')],{'host':_0x3333('0xf'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x3333('0x10')][_0x3333('0x11')]=function(_0x45ba1d){this[_0x3333('0x12')]=this[_0x3333('0x12')]?this['tail'][_0x3333('0x13')](_0x45ba1d):_0x45ba1d();};function Preview(_0x3f273a){this['sequence']=new Sequence();this[_0x3333('0x14')]=_0x3f273a[_0x3333('0x15')];this[_0x3333('0x16')]=_0x3f273a['trunks'];this[_0x3333('0x17')]={};this[_0x3333('0x18')]=_0x3f273a['agents'];this[_0x3333('0x19')]=0x0;ami['on'](_0x3333('0x1a'),this['syncOriginateResponse'][_0x3333('0x1b')](this));ami['on'](_0x3333('0x1c'),this[_0x3333('0x1d')][_0x3333('0x1b')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x3333('0x1b')](this));ami['on']('dialend',this[_0x3333('0x1e')][_0x3333('0x1b')](this));ami['on'](_0x3333('0x1f'),this[_0x3333('0x20')][_0x3333('0x1b')](this));ami['on']('varset',this[_0x3333('0x21')]['bind'](this));ami['on']('attendedtransfer',this[_0x3333('0x22')][_0x3333('0x1b')](this));ami['on']('blindtransfer',this[_0x3333('0x23')][_0x3333('0x1b')](this));this[_0x3333('0x24')](this['campaignsPreview']);}function emit(_0x2d87e5,_0x45b383,_0x4a0b0d){io['to'](_0x2d87e5)['emit'](_0x45b383,_0x4a0b0d);}function emitCampaignPreview(_0x34a44c){if(_0x34a44c['type']==='outbound'){var _0xad15b8={'id':_0x34a44c['id'],'name':_0x34a44c[_0x3333('0x25')],'strategy':_0x34a44c[_0x3333('0x26')],'answered':_0x34a44c[_0x3333('0x27')],'available':_0x34a44c[_0x3333('0x28')],'loggedIn':_0x34a44c[_0x3333('0x29')],'pTalking':_0x34a44c[_0x3333('0x2a')],'sumBillable':_0x34a44c[_0x3333('0x2b')],'sumDuration':_0x34a44c[_0x3333('0x2c')],'sumHoldTime':_0x34a44c[_0x3333('0x2d')]||0x0,'talking':_0x34a44c[_0x3333('0x2e')],'total':_0x34a44c[_0x3333('0x2f')],'type':_0x34a44c['type'],'unmanaged':_0x34a44c[_0x3333('0x30')],'abandoned':_0x34a44c[_0x3333('0x31')],'waiting':_0x34a44c[_0x3333('0x32')],'loggedInDb':_0x34a44c[_0x3333('0x33')],'dialActive':_0x34a44c[_0x3333('0x34')],'dialMethod':_0x34a44c['dialMethod'],'dialOriginateCallerIdName':_0x34a44c[_0x3333('0x35')],'dialOriginateCallerIdNumber':_0x34a44c[_0x3333('0x36')],'dialOriginateTimeout':_0x34a44c['dialOriginateTimeout'],'dialPrefix':_0x34a44c['dialPrefix'],'outboundAnswerAgiCallsDay':_0x34a44c[_0x3333('0x37')],'outboundAnswerCallsDay':_0x34a44c[_0x3333('0x38')],'outboundBlacklistCallsDay':_0x34a44c[_0x3333('0x39')],'outboundBusyCallsDay':_0x34a44c[_0x3333('0x3a')],'outboundCongestionCallsDay':_0x34a44c['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x34a44c[_0x3333('0x3b')],'outboundDropCallsDayCallersExit':_0x34a44c[_0x3333('0x3c')],'outboundDropCallsDayTimeout':_0x34a44c[_0x3333('0x3d')],'outboundNoAnswerCallsDay':_0x34a44c[_0x3333('0x3e')],'outboundNoSuchCallsDay':_0x34a44c[_0x3333('0x3f')],'outboundOriginateFailureCallsDay':_0x34a44c[_0x3333('0x40')],'outboundReCallsDay':_0x34a44c['outboundReCallsDay'],'outboundRejectCallsDay':_0x34a44c['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x34a44c[_0x3333('0x41')],'outboundAbandonedCallsDay':_0x34a44c[_0x3333('0x42')],'predictiveIntervalAnsweredCalls':_0x34a44c['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x34a44c[_0x3333('0x43')],'predictiveIntervalAvgTalktime':_0x34a44c[_0x3333('0x44')],'predictiveIntervalDroppedCallsCallersExit':_0x34a44c[_0x3333('0x45')],'predictiveIntervalDroppedCallsTimeout':_0x34a44c[_0x3333('0x46')],'predictiveIntervalErlangCalls':_0x34a44c[_0x3333('0x47')],'predictiveIntervalErlangCallsDroppedCalls':_0x34a44c['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x34a44c['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x34a44c[_0x3333('0x48')],'predictiveIntervalPauses':_0x34a44c['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x34a44c['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x34a44c['predictiveIntervalTotalCalls'],'message':_0x34a44c[_0x3333('0x49')],'originated':_0x34a44c['originated'],'erlangCalls':_0x34a44c['erlangCalls'],'erlangCallToSecond':_0x34a44c['erlangCallToSecond'],'erlangAbandonmentRate':_0x34a44c['erlangAbandonmentRate'],'erlangBusyFactor':_0x34a44c[_0x3333('0x4a')],'startPredictive':_0x34a44c['startPredictive'],'startProgressive':_0x34a44c[_0x3333('0x4b')]};if(_0x34a44c[_0x3333('0x4c')]){_0xad15b8[_0x3333('0x4c')]={'id':_0x34a44c[_0x3333('0x4c')]['id'],'name':_0x34a44c[_0x3333('0x4c')]['name'],'active':_0x34a44c[_0x3333('0x4c')][_0x3333('0x4d')],'callerid':_0x34a44c[_0x3333('0x4c')][_0x3333('0x4e')]};}if(_0x34a44c['Interval']){_0xad15b8[_0x3333('0x4f')]={'id':_0x34a44c[_0x3333('0x4f')]['id'],'name':_0x34a44c[_0x3333('0x4f')]['name']};}var _0x4b20ee=md5(JSON[_0x3333('0x50')](_0xad15b8));if(_0x34a44c[_0x3333('0x5')]!==_0x4b20ee){_0x34a44c['md5']=_0x4b20ee;emit(util[_0x3333('0x51')](_0x3333('0x52'),_0xad15b8[_0x3333('0x25')]),_0x3333('0x53'),_0xad15b8);}}}function emitVoiceQueueChannelRemove(_0x5180cb){logger[_0x3333('0x54')](_0x3333('0x55'),JSON[_0x3333('0x50')](_0x5180cb));emit(util['format'](_0x3333('0x52'),_0x5180cb['name']),_0x3333('0x56'),_0x5180cb);}function notSendMessagesQueue(_0xf65046){if(_0xf65046['sendMessageOneNotActive']){if(_0xf65046[_0x3333('0x57')]===0x0&&_0xf65046['pTalking']===0x0){_0xf65046[_0x3333('0x58')]=![];_0xf65046['available']=0x0;_0xf65046[_0x3333('0x59')]=0x0;_0xf65046[_0x3333('0x49')]='NOT_ACTIVE';ut['logger'](_0x3333('0x5a'),_0xf65046[_0x3333('0x25')]+'\x20is\x20not\x20active');}else{_0xf65046['message']='IS_DISACTIVED';ut[_0x3333('0x5b')](_0x3333('0x5a'),_0xf65046[_0x3333('0x25')]+_0x3333('0x5c'));}emitCampaignPreview(_0xf65046);}}Preview['prototype'][_0x3333('0x24')]=function(){var _0x1eaa34=this;setInterval(function(){_0x1eaa34[_0x3333('0x5d')]();},0x7cf);};Preview[_0x3333('0x10')][_0x3333('0x5d')]=function(){var _0x1c9ffc=this['campaignsPreview'];this[_0x3333('0x19')]+=0x1;for(var _0x3315d1 in _0x1c9ffc){if(_0x1c9ffc['hasOwnProperty'](_0x3315d1)&&(_0x1c9ffc[_0x3315d1][_0x3333('0x5e')]==='preview'||_0x1c9ffc[_0x3315d1][_0x3333('0x5e')]===_0x3333('0x5f'))&&_0x1c9ffc[_0x3315d1][_0x3333('0x60')]===_0x3333('0x61')){if(this[_0x3333('0x19')]>0x7){this[_0x3333('0x19')]=0x0;this['clearZombieChannels']();}}if(_0x1c9ffc[_0x3333('0x62')](_0x3315d1)&&_0x1c9ffc[_0x3315d1][_0x3333('0x5e')]===_0x3333('0x8')&&_0x1c9ffc[_0x3315d1]['type']==='outbound'){if(_0x1c9ffc[_0x3315d1]['dialActive']){this[_0x3333('0x63')](_0x1c9ffc[_0x3315d1]);this[_0x3333('0x64')](_0x1c9ffc[_0x3315d1]);}else{notSendMessagesQueue(_0x1c9ffc[_0x3315d1]);}}}};Preview[_0x3333('0x10')]['clearZombieChannel']=function(_0x3d7124){var _0x2f9061=this;this['sequence'][_0x3333('0x11')](function(){if(!_[_0x3333('0x65')](_0x2f9061[_0x3333('0x17')][_0x3d7124])){loggerAction[_0x3333('0x54')]('[clearZombieChannels][talking]',_0x3d7124,_0x3333('0x66'),_0x2f9061[_0x3333('0x17')][_0x3d7124]['queue'],'originated:\x20',JSON[_0x3333('0x50')](_0x2f9061[_0x3333('0x14')][_0x2f9061['actions'][_0x3d7124]['queue']]['originated']),_0x3333('0x67'),JSON[_0x3333('0x50')](_0x2f9061[_0x3333('0x14')][_0x2f9061[_0x3333('0x17')][_0x3d7124][_0x3333('0x68')]]['pTalking']),JSON[_0x3333('0x50')](_0x2f9061[_0x3333('0x17')][_0x3d7124][_0x3333('0x69')]),JSON[_0x3333('0x50')](_['pick'](_0x2f9061[_0x3333('0x17')][_0x3d7124],['contactId','UserId',_0x3333('0x6a'),'ListId'])));return ami['Action']({'action':_0x3333('0x6b'),'channel':_0x2f9061['actions'][_0x3d7124][_0x3333('0x6c')]})[_0x3333('0x6d')](function(_0x3e36f7){if(_0x3e36f7[_0x3333('0x49')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x2f9061[_0x3333('0x17')][_0x3d7124]){ut['updateOriginated'](_0x2f9061[_0x3333('0x14')][_0x2f9061[_0x3333('0x17')][_0x3d7124][_0x3333('0x68')]],_0x3333('0x6e'));if(_0x2f9061[_0x3333('0x17')][_0x3d7124][_0x3333('0x69')]===!![]){ut[_0x3333('0x6f')](_0x2f9061[_0x3333('0x14')][_0x2f9061['actions'][_0x3d7124][_0x3333('0x68')]],_0x3333('0x6e'));ut[_0x3333('0x70')]('[Dialer][checkChannel][pTalking][Preview]'+_0x3d7124,_0x2f9061[_0x3333('0x17')][_0x3d7124][_0x3333('0x68')]);}ut[_0x3333('0x70')](_0x3333('0x71')+_0x3d7124,_0x2f9061[_0x3333('0x17')][_0x3d7124]['queue']);delete _0x2f9061[_0x3333('0x17')][_0x3d7124];}},0x2328);}});}});};Preview[_0x3333('0x10')][_0x3333('0x72')]=function(){var _0x257a06=this;loggerAction['info']('[action]',_[_0x3333('0x73')](this['actions']));for(var _0x5ccad6 in this[_0x3333('0x17')]){if(_0x257a06[_0x3333('0x17')]['hasOwnProperty'](_0x5ccad6)){_0x257a06[_0x3333('0x74')](_0x5ccad6);}}};Preview['prototype']['recallMe']=function(_0x418902){var _0x3bd4da=this;rpcDb[_0x3333('0x75')](_0x418902['id'],ut['agentReadyId'](this[_0x3333('0x18')]))[_0x3333('0x76')](function(_0x5927c6){if(!_[_0x3333('0x65')](_0x5927c6)){for(var _0x5705c0=0x0;_0x5705c0<_0x5927c6[_0x3333('0x77')];_0x5705c0+=0x1){if(ut[_0x3333('0x78')](_0x5927c6[_0x5705c0]['scheduledat'])<_0x418902['dialRecallMeTimeout']*0x3c){if(_0x5927c6[_0x5705c0][_0x3333('0x79')]&&!_0x5927c6[_0x5705c0][_0x3333('0x79')][_0x3333('0x7a')]){_0x3bd4da[_0x3333('0x7b')](_0x5927c6[_0x5705c0]['id'])[_0x3333('0x76')](ut['logger2']('[RecallMe]'))[_0x3333('0x6d')](ut[_0x3333('0x7c')]('[RecallMe]'));}else{rpcDb[_0x3333('0x7d')](_0x5927c6[_0x5705c0]['id']);}}else{var _0x106649=new Action(_0x5927c6[_0x5705c0],_0x418902);_0x106649[_0x3333('0x7e')]=moment()[_0x3333('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x418902[_0x3333('0x7f')]+=0x1;ut[_0x3333('0x80')](_0x106649,0x17,_0x3333('0x81'));if(_0x418902[_0x3333('0x82')]){rpcDb[_0x3333('0x83')](ut[_0x3333('0x84')](_0x5927c6[_0x5705c0]));rpcDb['createCustomerHistory'](_0x106649,_0x3333('0x85'));}else{ut[_0x3333('0x80')](_0x106649,0x16,_0x3333('0x86'));rpcDb[_0x3333('0x87')](_0x106649,_0x3333('0x88'));rpcDb[_0x3333('0x89')](_0x106649,_0x3333('0x88'));}}}}})[_0x3333('0x6d')](ut['logger2'](_0x3333('0x8a')));};Preview['prototype'][_0x3333('0x63')]=function(_0x19c4fa){_0x19c4fa[_0x3333('0x58')]=!![];if(ut['IsNotLoggedIn'](_0x19c4fa[_0x3333('0x29')])){_0x19c4fa[_0x3333('0x49')]=_0x3333('0x8b');}else if(!ut[_0x3333('0x8c')](_0x19c4fa[_0x3333('0x34')])){_0x19c4fa[_0x3333('0x49')]='NOT_ACTIVE';}else if(!this[_0x3333('0x8d')](_0x19c4fa['Trunk'])){if(!this['isTrunkReachable'](_0x19c4fa[_0x3333('0x8e')])){_0x19c4fa[_0x3333('0x49')]='TRUNK_IS_NOT_REACHABLE';}else{_0x19c4fa['message']=_0x3333('0x8f');}}else{_0x19c4fa[_0x3333('0x49')]=_0x3333('0x8f');}emitCampaignPreview(_0x19c4fa);};Preview[_0x3333('0x10')][_0x3333('0x90')]=function(_0x4830e1,_0x21a1c7,_0x57303d){var _0x128e5a=this;var _0x19bfdd=this[_0x3333('0x17')][_0x21a1c7];var _0x18bb84=this['campaignsPreview'][_0x19bfdd['queue']];var _0x2ff2d9;if(_0x18bb84){switch(_0x57303d){case'1':_0x18bb84[_0x3333('0x3f')]+=0x1;_0x19bfdd[_0x3333('0x91')]+=0x1;_0x19bfdd[_0x3333('0x92')]=ut[_0x3333('0x93')](_0x19bfdd);ut[_0x3333('0x80')](_0x19bfdd,0x0,_0x3333('0x94'));rpcDb['createCustomerHistory'](_0x19bfdd,_0x3333('0x95'));if(ut[_0x3333('0x93')](_0x19bfdd)>=_0x18bb84[_0x3333('0x96')]){_0x2ff2d9=ut[_0x3333('0x97')](_0x19bfdd,0xf,_0x3333('0x98'));rpcDb['createCustomerFinal'](_0x2ff2d9,_0x3333('0x99'));}else{if(_0x19bfdd[_0x3333('0x91')]>=_0x18bb84[_0x3333('0x9a')]){rpcDb[_0x3333('0x89')](_0x19bfdd,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x3333('0x9b')](ut['scheduledAt'](_0x19bfdd,_0x3333('0x91'),_0x18bb84[_0x3333('0x9c')]),_0x19bfdd['unlockAgent'],_0x19bfdd[_0x3333('0x9d')]);}}delete this[_0x3333('0x17')][_0x4830e1[_0x3333('0x9e')]];break;case'ANSWER':var _0x411667=moment()[_0x3333('0x51')](_0x3333('0x9f'));_0x19bfdd[_0x3333('0xa0')]=_0x411667;_0x19bfdd[_0x3333('0xa1')]=_0x411667;_0x19bfdd[_0x3333('0x69')]=!![];_0x18bb84[_0x3333('0x2a')]+=0x1;logger[_0x3333('0x54')](_0x3333('0xa2'),_0x19bfdd[_0x3333('0xa3')],_0x3333('0xa4'),_0x18bb84[_0x3333('0x25')],_0x3333('0x67'),_0x18bb84[_0x3333('0x2a')]);ami[_0x3333('0xa5')](_0x3333('0xa6'),ut[_0x3333('0xa7')](_0x19bfdd,'connect'));if(_0x18bb84[_0x3333('0xa8')]){ami[_0x3333('0xa5')](_0x3333('0xa9'),ut[_0x3333('0xaa')](_0x19bfdd));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0x3333('0xa7')](_0x19bfdd,'complete'));emitVoiceQueueChannelRemove(ut[_0x3333('0xa7')](_0x19bfdd,_0x3333('0xab')));_0x18bb84[_0x3333('0x38')]+=0x1;_0x18bb84[_0x3333('0x2f')]+=0x1;_0x18bb84[_0x3333('0x27')]+=0x1;ut[_0x3333('0x6f')](_0x18bb84,_0x3333('0xac'));_0x19bfdd[_0x3333('0x92')]=ut[_0x3333('0x93')](_0x19bfdd);ut[_0x3333('0x80')](_0x19bfdd,0x4,_0x3333('0xad'));rpcDb[_0x3333('0x87')](_0x19bfdd,_0x3333('0xae'));rpcDb[_0x3333('0x89')](_0x19bfdd,_0x3333('0xaf'));rpcDb[_0x3333('0xb0')](_0x19bfdd);_0x18bb84[_0x3333('0x2c')]+=_0x19bfdd['talktime'];_0x18bb84['sumBillable']+=_0x19bfdd[_0x3333('0xb1')];logger['info'](_0x3333('0xb2'),_0x19bfdd['uniqueid'],_0x3333('0xa4'),_0x18bb84[_0x3333('0x25')],_0x3333('0x67'),_0x18bb84[_0x3333('0x2a')]);delete this[_0x3333('0x17')][_0x4830e1[_0x3333('0x9e')]];break;case _0x3333('0xb3'):_0x18bb84['outboundBusyCallsDay']+=0x1;_0x19bfdd[_0x3333('0xb4')]+=0x1;_0x19bfdd[_0x3333('0x92')]=ut[_0x3333('0x93')](_0x19bfdd);ut[_0x3333('0x80')](_0x19bfdd,0x5,'Busy');rpcDb[_0x3333('0x87')](_0x19bfdd,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x3333('0x93')](_0x19bfdd)>=_0x18bb84[_0x3333('0x96')]){_0x2ff2d9=ut[_0x3333('0x97')](_0x19bfdd,0xf,_0x3333('0x98'));rpcDb[_0x3333('0x89')](_0x2ff2d9,_0x3333('0xb5'));}else{if(_0x19bfdd[_0x3333('0xb4')]>=_0x18bb84['dialBusyMaxRetry']){rpcDb[_0x3333('0x89')](_0x19bfdd,_0x3333('0xb6'));}else{rpcDb[_0x3333('0x9b')](ut[_0x3333('0xb7')](_0x19bfdd,_0x3333('0xb4'),_0x18bb84['dialBusyRetryFrequency']),_0x19bfdd[_0x3333('0xb8')],_0x19bfdd[_0x3333('0x9d')]);}}break;case'NOANSWER':_0x18bb84[_0x3333('0x3e')]+=0x1;_0x19bfdd[_0x3333('0xb9')]+=0x1;_0x19bfdd[_0x3333('0x92')]=ut['totalGlobal'](_0x19bfdd);ut[_0x3333('0x80')](_0x19bfdd,0x3,_0x3333('0xba'));rpcDb[_0x3333('0x87')](_0x19bfdd,_0x3333('0xbb'));if(ut[_0x3333('0x93')](_0x19bfdd)>=_0x18bb84['dialGlobalMaxRetry']){_0x2ff2d9=ut[_0x3333('0x97')](_0x19bfdd,0xf,_0x3333('0x98'));rpcDb['createCustomerFinal'](_0x2ff2d9,_0x3333('0xbc'));}else{if(_0x19bfdd[_0x3333('0xb9')]>=_0x18bb84[_0x3333('0xbd')]){rpcDb[_0x3333('0x89')](_0x19bfdd,_0x3333('0xbb'));}else{rpcDb[_0x3333('0x9b')](ut[_0x3333('0xb7')](_0x19bfdd,_0x3333('0xb9'),_0x18bb84['dialNoAnswerRetryFrequency']),_0x19bfdd[_0x3333('0xb8')],_0x19bfdd[_0x3333('0x9d')]);}}break;case _0x3333('0xbe'):_0x18bb84[_0x3333('0xbf')]+=0x1;_0x19bfdd[_0x3333('0xc0')]+=0x1;_0x19bfdd[_0x3333('0x92')]=ut[_0x3333('0x93')](_0x19bfdd);ut['logCustomer'](_0x19bfdd,0x8,_0x3333('0xc1'));rpcDb[_0x3333('0x87')](_0x19bfdd,_0x3333('0xc2'));if(ut[_0x3333('0x93')](_0x19bfdd)>=_0x18bb84[_0x3333('0x96')]){_0x2ff2d9=ut['cloneAction'](_0x19bfdd,0xf,_0x3333('0x98'));rpcDb[_0x3333('0x89')](_0x2ff2d9,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x19bfdd[_0x3333('0xc0')]>=_0x18bb84['dialCongestionMaxRetry']){rpcDb[_0x3333('0x89')](_0x19bfdd,_0x3333('0xc2'));}else{rpcDb[_0x3333('0x9b')](ut[_0x3333('0xb7')](_0x19bfdd,_0x3333('0xc0'),_0x18bb84[_0x3333('0xc3')]),_0x19bfdd[_0x3333('0xb8')],_0x19bfdd['activeContact']);}}break;case _0x3333('0xc4'):_0x18bb84[_0x3333('0xc5')]+=0x1;_0x19bfdd['countagentrejectretry']+=0x1;_0x19bfdd[_0x3333('0x92')]=ut[_0x3333('0x93')](_0x19bfdd);ut[_0x3333('0x80')](_0x19bfdd,0x14,'AgentReject');rpcDb[_0x3333('0x87')](_0x19bfdd,_0x3333('0xc6'));if(ut[_0x3333('0x93')](_0x19bfdd)>=_0x18bb84['dialGlobalMaxRetry']){_0x2ff2d9=ut[_0x3333('0x97')](_0x19bfdd,0x14,_0x3333('0xc7'));rpcDb[_0x3333('0x89')](_0x2ff2d9,_0x3333('0xc8'));}else{if(_0x19bfdd[_0x3333('0xc9')]>=_0x18bb84[_0x3333('0xca')]){rpcDb[_0x3333('0x89')](_0x19bfdd,_0x3333('0xc8'));}else{rpcDb[_0x3333('0x9b')](ut[_0x3333('0xb7')](_0x19bfdd,_0x3333('0xc9'),_0x18bb84[_0x3333('0xcb')]),_0x19bfdd['unlockAgent'],_0x19bfdd[_0x3333('0x9d')]);}}break;case _0x3333('0xcc'):_0x18bb84[_0x3333('0x42')]+=0x1;_0x19bfdd[_0x3333('0xcd')]+=0x1;_0x19bfdd[_0x3333('0x92')]=ut[_0x3333('0x93')](_0x19bfdd);ut['logCustomer'](_0x19bfdd,0xb,_0x3333('0xce'));rpcDb[_0x3333('0x87')](_0x19bfdd,_0x3333('0xcf'));if(ut[_0x3333('0x93')](_0x19bfdd)>=_0x18bb84[_0x3333('0x96')]){_0x2ff2d9=ut[_0x3333('0x97')](_0x19bfdd,0xf,_0x3333('0x98'));rpcDb[_0x3333('0x89')](_0x2ff2d9,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x19bfdd[_0x3333('0xd0')]>=_0x18bb84['dialAbandonedMaxRety']){rpcDb['createCustomerFinal'](_0x19bfdd,_0x3333('0xcf'));}else{rpcDb[_0x3333('0x9b')](ut[_0x3333('0xb7')](_0x19bfdd,'countabandonedretry',_0x18bb84[_0x3333('0xd1')]),_0x19bfdd['unlockAgent'],_0x19bfdd['activeContact']);}}break;default:if(_0x19bfdd['dialAnswer']){ut['decrementTalkink'](_0x18bb84,_0x3333('0xd2'));ut[_0x3333('0x70')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x18bb84[_0x3333('0x25')],_0x4830e1);}_0x18bb84['outboundUnknownCallsDay']+=0x1;_0x19bfdd[_0x3333('0x92')]=ut[_0x3333('0x93')](_0x19bfdd);ut[_0x3333('0x80')](_0x19bfdd,0xc,_0x4830e1[_0x3333('0xd3')]||_0x4830e1[_0x3333('0xd4')]);rpcDb[_0x3333('0x87')](_0x19bfdd,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x3333('0x93')](_0x19bfdd)>=_0x18bb84[_0x3333('0x96')]){_0x2ff2d9=ut[_0x3333('0x97')](_0x19bfdd,0xf,'Global');rpcDb[_0x3333('0x89')](_0x2ff2d9,_0x3333('0xd5'));}else{rpcDb[_0x3333('0x89')](_0x19bfdd,_0x3333('0xd5'));}delete this['actions'][_0x4830e1[_0x3333('0x9e')]];}if(!(_0x19bfdd[_0x3333('0x69')]&&_0x57303d==='16')){ut[_0x3333('0xd6')](_0x18bb84,_0x3333('0xd7'));logger['info'](_0x3333('0xd8'),_0x19bfdd[_0x3333('0xa3')],_0x3333('0xa4'),_0x18bb84['name'],'originated:\x20',_0x18bb84['originated']);}if(_0x57303d!=='ANSWER'){delete this[_0x3333('0x17')][_0x4830e1[_0x3333('0x9e')]];delete this[_0x3333('0x17')][_0x4830e1[_0x3333('0xd9')]];}}};Preview[_0x3333('0x10')][_0x3333('0xda')]=function(_0x2c7db6,_0x16c032,_0x1c04f4){if(_['isUndefined'](_0x16c032)&&_0x3333('0xdb')!==typeof _0x16c032){return;}if(_['isUndefined'](_0x1c04f4)&&_0x3333('0xdb')!==typeof _0x1c04f4){return;}switch(_0x1c04f4[_0x3333('0xdc')]){case'0':ut[_0x3333('0xdd')](_0x2c7db6,0x0,_0x3333('0x94'));rpcDb['createAgentHistory'](_0x2c7db6,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x3333('0xdd')](_0x2c7db6,0x3,'NoAnswer');rpcDb[_0x3333('0xde')](_0x2c7db6,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x3333('0xdd')](_0x2c7db6,0x5,_0x3333('0xdf'));rpcDb['createAgentHistory'](_0x2c7db6,_0x3333('0xe0'));break;case'8':ut[_0x3333('0xdd')](_0x2c7db6,0x8,_0x3333('0xc1'));rpcDb[_0x3333('0xde')](_0x2c7db6,_0x3333('0xe1'));break;case'22':ut[_0x3333('0xdd')](_0x2c7db6,0x16,_0x3333('0xe2'));rpcDb[_0x3333('0xde')](_0x2c7db6,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x3333('0xdd')](_0x2c7db6,0xc,_0x1c04f4[_0x3333('0xdc')]);rpcDb[_0x3333('0xde')](_0x2c7db6,_0x3333('0xe1'));}ut[_0x3333('0xd6')](_0x16c032,_0x3333('0xe3'));logger[_0x3333('0x54')]('[originated][decrement][callProgressDetectingAgent]',_0x2c7db6['uniqueid'],_0x3333('0xa4'),_0x16c032['name'],_0x3333('0xe4'),_0x16c032[_0x3333('0x57')]);delete this[_0x3333('0x17')][_0x2c7db6[_0x3333('0xa3')]];};Preview[_0x3333('0x10')]['checkInBlack']=function(_0x55f32a,_0x5cb463,_0x29c99b,_0x58cb34,_0x20f984){var _0x594d65=this;return new BPromise(function(_0x5deaf8,_0x1de816){if(_[_0x3333('0x65')](_0x5cb463)||_[_0x3333('0x65')](_0x5cb463[_0x3333('0xe5')])||_['isNil'](_0x5cb463[_0x3333('0xe5')]['phone'])||_[_0x3333('0x65')](_0x5cb463[_0x3333('0x6a')])){_0x1de816(ut[_0x3333('0x49')](_0x3333('0xe6'),_0x58cb34,_0x20f984));return;}var _0xa93116=uuid['v4']();var _0x1f1795=_0x594d65[_0x3333('0x14')][_0x5cb463['Queue'][_0x3333('0x25')]];var _0x13993f=_0x29c99b?_0x594d65[_0x3333('0x18')][_0x29c99b]['id']:undefined;_0x594d65[_0x3333('0x17')][_0xa93116]=new Action(_0x5cb463,_0x1f1795,_0xa93116,_0x29c99b,_0x13993f);var _0x57d7a7=_0x594d65[_0x3333('0x17')][_0xa93116];_0x57d7a7[_0x3333('0xb8')]=_0x58cb34;_0x57d7a7[_0x3333('0x9d')]=_0x20f984;_0x57d7a7[_0x3333('0xe7')]=_0x29c99b;if(_[_0x3333('0xe8')](_0x55f32a)){_0x594d65[_0x3333('0xe9')](_0x57d7a7,_0x1f1795,_0x5cb463,_0x29c99b)[_0x3333('0x76')](function(_0x5cf418){logger[_0x3333('0x54')](_0x3333('0xea'),_0x3333('0xeb')+_0x57d7a7[_0x3333('0x68')]+_0x3333('0xec')+_0x57d7a7[_0x3333('0xed')],JSON[_0x3333('0x50')](_0x5cf418));ami[_0x3333('0xa5')](_0x3333('0xee'),ut[_0x3333('0xa7')](_0x57d7a7,_0x3333('0xef')));_0x5deaf8(ut['message'](_0x3333('0xf0')));})[_0x3333('0x6d')](function(_0xde1d6f){ut[_0x3333('0x5b')](_0x3333('0xf1'),_0xde1d6f);_0x1de816(ut[_0x3333('0x49')](_0x3333('0xf2'),_0x58cb34,_0x20f984));});}else{_0x1f1795[_0x3333('0x39')]+=0x1;ut['logBlacklist'](_0x57d7a7);rpcDb['createHistory'](_0x57d7a7,_0x3333('0xf3'));delete _0x594d65[_0x3333('0x17')][_0xa93116];_0x1de816(ut[_0x3333('0x49')](_0x3333('0xf4'),_0x58cb34,_0x20f984));}});};Preview['prototype'][_0x3333('0x8d')]=function(_0x52c9eb){return!_[_0x3333('0x65')](_0x52c9eb)&&!_['isNil'](_0x52c9eb['name'])&&!_[_0x3333('0x65')](_0x52c9eb[_0x3333('0x4d')])&&_0x52c9eb[_0x3333('0x4d')]&&!_[_0x3333('0x65')](this[_0x3333('0x16')][util[_0x3333('0x51')](_0x3333('0xf5'),_0x52c9eb[_0x3333('0x25')])])&&!_[_0x3333('0x65')](this['trunks'][util[_0x3333('0x51')](_0x3333('0xf5'),_0x52c9eb[_0x3333('0x25')])][_0x3333('0x6b')])&&(this['trunks'][util[_0x3333('0x51')](_0x3333('0xf5'),_0x52c9eb[_0x3333('0x25')])][_0x3333('0x6b')]===_0x3333('0xf6')||this[_0x3333('0x16')][util[_0x3333('0x51')]('SIP/%s',_0x52c9eb['name'])][_0x3333('0x6b')]===_0x3333('0xf7'));};Preview['prototype'][_0x3333('0x7b')]=function(_0x4cb179,_0x340694){var _0x4a72c8=this;return new BPromise(function(_0x8c7684,_0x54f102){_0x4a72c8[_0x3333('0xf8')](_0x4cb179,_0x340694)['then'](function(_0x294afc){_0x8c7684(_[_0x3333('0xf9')](_0x294afc,['message']));})[_0x3333('0x6d')](function(_0x285dd2){if(_0x285dd2['unlock']){rpcDb['unlockContact'](_0x4cb179);}if(_0x285dd2[_0x3333('0x4d')]){rpcDb[_0x3333('0x7d')](_0x4cb179);}_0x54f102(_[_0x3333('0xf9')](_0x285dd2,[_0x3333('0x49')]));});});};Preview['prototype'][_0x3333('0xf8')]=function(_0x15a66b,_0x9f0d45){var _0x1538f6=this;return new BPromise(function(_0x18e649,_0x45f955){var _0x28407c,_0x4026b4;rpcDb[_0x3333('0xfa')](_0x15a66b)['then'](function(_0x13bfd1){if(!_[_0x3333('0x65')](_0x13bfd1[0x0])){_0x4026b4=_0x13bfd1[0x0][_0x3333('0xfb')]?![]:!![];_0x28407c=_0x13bfd1[0x0][_0x3333('0xfb')]?!![]:![];_0x28407c=_0x9f0d45?!![]:_0x28407c;}var _0x27ad89=_0x1538f6[_0x3333('0xfc')](_0x13bfd1);if(_0x27ad89[_0x3333('0xfd')]){rpcDb['checkIsBlackList'](_['pick'](_0x13bfd1[0x0],[_0x3333('0x6a'),_0x3333('0xfe')]))[_0x3333('0x76')](function(_0x543dba){_0x1538f6['checkInBlack'](_0x543dba,_0x13bfd1[0x0],_0x9f0d45,_0x4026b4,_0x28407c)[_0x3333('0x76')](function(_0x53b313){_0x18e649(_0x53b313);})[_0x3333('0x6d')](function(_0x3f79f3){_0x45f955(_0x3f79f3);});})[_0x3333('0x6d')](function(_0x3ae64c){ut[_0x3333('0x5b')](_0x3333('0xff'),_0x3ae64c);_0x45f955(ut[_0x3333('0x49')](_0x3333('0x100'),_0x4026b4,_0x28407c));});}else{_0x45f955(ut[_0x3333('0x49')](_0x27ad89[_0x3333('0x49')],_0x4026b4,_0x28407c));}})[_0x3333('0x6d')](function(_0x3bc062){ut[_0x3333('0x5b')](_0x3333('0x101'),_0x3bc062);_0x45f955(ut[_0x3333('0x49')](_0x3333('0x100'),![],!![]));});});};Preview[_0x3333('0x10')][_0x3333('0xfc')]=function(_0x58305f){if(_[_0x3333('0x65')](_0x58305f)||_[_0x3333('0xe8')](_0x58305f)||!_[_0x3333('0x65')](_0x58305f[0x0][_0x3333('0x79')])&&_[_0x3333('0x65')](_0x58305f[0x0][_0x3333('0x79')][_0x3333('0x25')])){ut['logger'](_0x3333('0x102'),_0x58305f);return{'isValid':![],'message':_0x3333('0x103')};}var _0x451be8=this[_0x3333('0x14')][_0x58305f[0x0][_0x3333('0x66')]['name']];_0x451be8['message']=_0x3333('0x8f');if(_[_0x3333('0x65')](_0x451be8)){ut[_0x3333('0x5b')](_0x3333('0x104'),_0x451be8);return{'isValid':![],'message':_0x3333('0x105')};}if(!this[_0x3333('0x8d')](_0x451be8[_0x3333('0x4c')])){ut['logger'](_0x3333('0x106'),_0x3333('0x107')+_0x451be8[_0x3333('0x25')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0x3333('0x8d')](_0x451be8[_0x3333('0x8e')])){ut[_0x3333('0x5b')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x451be8[_0x3333('0x25')]+_0x3333('0x108'));return{'isValid':![],'message':_0x3333('0x109')};}}if(!ut[_0x3333('0x8c')](_0x451be8[_0x3333('0x34')])){ut[_0x3333('0x5b')](_0x3333('0x10a'),_0x451be8[_0x3333('0x25')]+_0x3333('0x10b'));return{'isValid':![],'message':_0x3333('0x107')+_0x451be8[_0x3333('0x25')]+_0x3333('0x10b')};}return{'isValid':!![],'message':_0x3333('0x10c')};};Preview[_0x3333('0x10')][_0x3333('0xe9')]=function(_0x218c73,_0x307778,_0x5a5755,_0x518d94){var _0x54b983=this;return new BPromise(function(_0x5f9c57,_0x4240ca){var _0x862a26=_0x218c73[_0x3333('0xa3')];var _0x49d39b=_0x54b983[_0x3333('0x8d')](_0x307778[_0x3333('0x4c')])?util['format'](_0x3333('0x10d'),_0x307778[_0x3333('0x4c')]['name'],_['isNil'](_0x307778[_0x3333('0x10e')])?'':_0x307778[_0x3333('0x10e')]['trim']()||'',_0x307778[_0x3333('0x10f')]>0x0?_0x5a5755['Contact']['phone'][_0x3333('0x110')](_0x307778[_0x3333('0x10f')]):_0x5a5755[_0x3333('0xe5')][_0x3333('0x111')]):util[_0x3333('0x51')](_0x3333('0x10d'),_[_0x3333('0x65')](_0x307778[_0x3333('0x8e')])?_0x307778[_0x3333('0x4c')][_0x3333('0x25')]:_0x307778['TrunkBackup'][_0x3333('0x25')],_[_0x3333('0x65')](_0x307778[_0x3333('0x10e')])?'':_0x307778['dialPrefix'][_0x3333('0x112')]()||'',_0x307778['dialCutDigit']>0x0?_0x5a5755['Contact'][_0x3333('0x111')][_0x3333('0x110')](_0x307778[_0x3333('0x10f')]):_0x5a5755[_0x3333('0xe5')][_0x3333('0x111')]);var _0x183660=_0x54b983[_0x3333('0x8d')](_0x307778[_0x3333('0x4c')])?ut[_0x3333('0x113')](_0x307778[_0x3333('0x4c')]['callerid'],_0x307778[_0x3333('0x35')],_0x307778[_0x3333('0x114')]>0x0?ut['getCallerIdRandom'](_0x307778['dialOriginateCallerIdNumber'],_0x307778['dialRandomLastDigitCallerIdNumber']):_0x307778[_0x3333('0x36')]):ut[_0x3333('0x113')](_[_0x3333('0x65')](_0x307778[_0x3333('0x8e')])?_0x307778[_0x3333('0x4c')][_0x3333('0x4e')]:_0x307778[_0x3333('0x8e')]['callerid'],_0x307778[_0x3333('0x35')],_0x307778[_0x3333('0x114')]>0x0?ut['getCallerIdRandom'](_0x307778['dialOriginateCallerIdNumber'],_0x307778['dialRandomLastDigitCallerIdNumber']):_0x307778[_0x3333('0x36')]);if(_0x183660){_0x218c73['originatecalleridname']=ut['extractCalleridName'](_0x183660);_0x218c73[_0x3333('0x115')]=ut[_0x3333('0x116')](_0x183660);}var _0xd5cbd9=ut[_0x3333('0x117')](_0x307778,_0x5a5755,_0x49d39b,_0x183660,_0x862a26,_0x218c73);_[_0x3333('0x118')](_0x218c73,ut['toLowerVariables'](_0xd5cbd9));_0x218c73[_0x3333('0x7e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ami[_0x3333('0x119')](ut['variablesAction'](_0x218c73,_0x307778,_0xd5cbd9,_0x218c73[_0x3333('0x9d')],_0x518d94))[_0x3333('0x76')](function(_0x53297b){_0x307778[_0x3333('0x57')]+=0x1;logger[_0x3333('0x54')](_0x3333('0x11a'),_0x862a26,_0x3333('0xa4'),_0x307778['name'],_0x3333('0xe4'),_0x307778[_0x3333('0x57')]);_0x5f9c57(_0x53297b);})[_0x3333('0x6d')](function(_0x1bdf6c){ut[_0x3333('0xdd')](_0x218c73,0xe,'OriginateError');rpcDb[_0x3333('0xde')](_0x218c73,_0x3333('0x11b'));_0x4240ca(_0x1bdf6c);});});};Preview['prototype'][_0x3333('0x20')]=function(_0x5f5c52){if(this['actions'][_0x5f5c52['linkedid']]){this[_0x3333('0x17')][_0x5f5c52[_0x3333('0x9e')]][_0x3333('0x6c')]=_0x5f5c52[_0x3333('0x6c')];}};Preview[_0x3333('0x10')]['syncOriginateResponse']=function(_0x510c62){var _0x260471=this;var _0x2c2ff2=this[_0x3333('0x17')][_0x510c62['actionid']];if(_0x2c2ff2){if(_0x2c2ff2[_0x3333('0xe7')]&&this[_0x3333('0x18')][_0x2c2ff2[_0x3333('0xe7')]]){ut[_0x3333('0x11c')](_0x2c2ff2,this[_0x3333('0x18')][_0x2c2ff2[_0x3333('0xe7')]][_0x3333('0x25')],this[_0x3333('0x18')][_0x2c2ff2['lookAgent']]['id']);}var _0x26bc48=_[_0x3333('0x11d')](_0x2c2ff2);_0x26bc48[_0x3333('0xa0')]=moment()['format'](_0x3333('0x9f'));var _0x143a56=_0x260471[_0x3333('0x14')][_0x2c2ff2['queue']];if(ut[_0x3333('0x11e')](_0x510c62[_0x3333('0x11f')])){if(_0x2c2ff2[_0x3333('0xb8')]){rpcDb[_0x3333('0x120')](_0x2c2ff2[_0x3333('0xed')]);}if(_0x2c2ff2[_0x3333('0x9d')]){rpcDb[_0x3333('0x7d')](_0x2c2ff2[_0x3333('0xed')]);}ami[_0x3333('0xa5')]('custom:agentringnoanswer',ut[_0x3333('0xa7')](_0x2c2ff2,_0x3333('0x121')));this['callProgressDetectingAgent'](_0x26bc48,_0x143a56,_0x510c62);}else{_0x2c2ff2[_0x3333('0x7e')]=moment()[_0x3333('0x51')](_0x3333('0x9f'));ut[_0x3333('0xdd')](_0x26bc48,0x4,_0x3333('0xad'));rpcDb[_0x3333('0xde')](_0x26bc48,_0x3333('0x122'));}}};Preview[_0x3333('0x10')][_0x3333('0x1d')]=function(_0x37e367){var _0x6477a6=this;var _0x122b0a=this['actions'][_0x37e367[_0x3333('0x9e')]];var _0x260dc0;if(_0x122b0a){_0x260dc0=this[_0x3333('0x14')][_0x122b0a[_0x3333('0x68')]];logger[_0x3333('0x54')]('[syncHangup][talking]',_0x37e367[_0x3333('0x9e')],_0x3333('0xa4'),_0x260dc0[_0x3333('0x25')],'pTalking:\x20',_0x260dc0[_0x3333('0x2a')]);}if(this[_0x3333('0x17')][_0x37e367['linkedid']]&&_0x37e367[_0x3333('0x9e')]!==_0x37e367[_0x3333('0xa3')]){if(_0x37e367[_0x3333('0x123')]==='16'&&this[_0x3333('0x17')][_0x37e367['linkedid']][_0x3333('0x69')]){this[_0x3333('0x90')](_0x37e367,_0x37e367['linkedid'],_0x37e367[_0x3333('0x123')]);}else if(this[_0x3333('0x17')][_0x37e367[_0x3333('0x9e')]][_0x3333('0x69')]){logger[_0x3333('0x54')](_0x3333('0x124'),_0x37e367['linkedid'],_0x37e367[_0x3333('0x123')],_0x3333('0xa4'),_0x260dc0['name'],_0x3333('0x67'),_0x260dc0[_0x3333('0x2a')]);this[_0x3333('0x90')](_0x37e367,_0x37e367[_0x3333('0x9e')],_0x37e367['cause']);}}else if(_0x122b0a&&_[_0x3333('0x65')](_0x122b0a[_0x3333('0x125')])&&_0x260dc0['dialQueueProject']&&_0x37e367[_0x3333('0x9e')]===_0x37e367[_0x3333('0xa3')]&&_[_0x3333('0x65')](_0x37e367[_0x3333('0xdc')])&&_0x37e367[_0x3333('0x123')]==='16'&&_0x37e367[_0x3333('0x126')]==='6'&&_[_0x3333('0x127')](_0x122b0a[_0x3333('0x128')])){if(_0x122b0a[_0x3333('0xb8')]){rpcDb[_0x3333('0x120')](_0x122b0a[_0x3333('0xed')]);}if(_0x122b0a['activeContact']){rpcDb[_0x3333('0x7d')](_0x122b0a[_0x3333('0xed')]);}_0x37e367[_0x3333('0xdc')]='22';this[_0x3333('0xda')](_0x122b0a,_0x260dc0,_0x37e367);}else if(_0x122b0a&&_0x122b0a[_0x3333('0x128')]){if(_0x37e367[_0x3333('0x123')]==='16'&&this[_0x3333('0x17')][_0x37e367[_0x3333('0x9e')]][_0x3333('0x69')]){logger['info'](_0x3333('0x129'),_0x37e367[_0x3333('0x9e')],_0x37e367[_0x3333('0x123')],_0x3333('0xa4'),_0x260dc0['name'],_0x3333('0x67'),_0x260dc0[_0x3333('0x2a')]);this[_0x3333('0x90')](_0x37e367,_0x37e367[_0x3333('0x9e')],_0x37e367[_0x3333('0x123')]);}else if(this[_0x3333('0x17')][_0x37e367[_0x3333('0x9e')]]['dialAnswer']){logger[_0x3333('0x54')](_0x3333('0x124'),_0x37e367['linkedid'],_0x37e367[_0x3333('0x123')],'\x20Queue',_0x260dc0['name'],_0x3333('0x67'),_0x260dc0[_0x3333('0x2a')]);this[_0x3333('0x90')](_0x37e367,_0x37e367[_0x3333('0x9e')],_0x37e367['cause']);}}};Preview[_0x3333('0x10')]['syncDialEnd']=function(_0x2bb14d){if(this[_0x3333('0x17')][_0x2bb14d[_0x3333('0xd9')]]&&_0x2bb14d[_0x3333('0xd9')]!==_0x2bb14d[_0x3333('0x12a')]){this['callProgressDetectingCustomer'](_0x2bb14d,_0x2bb14d[_0x3333('0xd9')],_0x2bb14d['dialstatus']);}};Preview[_0x3333('0x10')][_0x3333('0x12b')]=function(_0x4ac3ff){if(this[_0x3333('0x17')][_0x4ac3ff[_0x3333('0x9e')]]&&_0x4ac3ff[_0x3333('0x9e')]!==_0x4ac3ff[_0x3333('0xa3')]&&!this[_0x3333('0x17')][_0x4ac3ff[_0x3333('0x9e')]][_0x3333('0x69')]){if(_0x4ac3ff[_0x3333('0x123')]==='1'){this[_0x3333('0x90')](_0x4ac3ff,_0x4ac3ff['linkedid'],_0x4ac3ff[_0x3333('0x123')]);}}};Preview[_0x3333('0x10')][_0x3333('0x12c')]=function(_0x3172eb,_0x307354,_0x49bfe7){if(this['actions'][_0x3172eb]){if(_[_0x3333('0x65')](this[_0x3333('0x17')][_0x3172eb][_0x3333('0x12d')])){this[_0x3333('0x17')][_0x3172eb][_0x3333('0x12d')]={};}this['actions'][_0x3172eb][_0x3333('0x12d')][_0x307354]=_0x49bfe7;}};Preview[_0x3333('0x10')][_0x3333('0x21')]=function(_0xcea3a9){try{if(!_[_0x3333('0x65')](_0xcea3a9)){if(ut[_0x3333('0x12e')](_[_0x3333('0x12f')](_0xcea3a9[_0x3333('0x130')])[0x0])){this['addVariable'](_0xcea3a9[_0x3333('0xa3')],_[_0x3333('0x12f')](_0xcea3a9[_0x3333('0x130')])[0x0],_0xcea3a9[_0x3333('0x131')]);}}}catch(_0x22224e){logger['error'](_0x3333('0x132'),util[_0x3333('0x133')](_0x22224e,{'showHidden':![],'depth':null}));}};Preview[_0x3333('0x10')][_0x3333('0x22')]=function(_0x1b3745){if(_0x1b3745){if(this[_0x3333('0x17')][_0x1b3745[_0x3333('0x134')]]){this[_0x3333('0x17')][_0x1b3745[_0x3333('0x134')]]['transfer']=!![];}}};Preview[_0x3333('0x10')][_0x3333('0x23')]=function(_0x437f06){if(_0x437f06){if(this[_0x3333('0x17')][_0x437f06['transfererlinkedid']]){this[_0x3333('0x17')][_0x437f06[_0x3333('0x135')]][_0x3333('0x128')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0xa097=['length','getDiff','dialRecallMeTimeout','Agent','voicePause','[RecallMe]','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','responsetime','answertime','uniqueid','custom:agentconnect','buildObj','connect','acw','emit','buildAcw','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','countbusyretry','Busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','NOANSWER','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','countcongestionretry','Congestion','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','dialBusyRetryFrequency','countagentrejectretry','AgentReject','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','log','AGENTREJECT\x20campaign','dialAgentRejectRetryFrequency','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','[Dialer][decrementTalkink][no\x20Hangup][Preview]','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','\x20Queue','ANSWER','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','originated:\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','reachable','unmonitored','unlock','unlockContact','disableContact','execRun','getContactPreview','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','starttime','variablesAction','[originateFailure][logOriginateFailure]','channel','logLookAgent','clone','isFailure','response','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','[syncHangup][talking][cause]','cause','statedesc','channelstate','transfer','addVariable','variables','filterKey','keys','variable','value','error','inspect','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','bluebird','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','name','strategy','answered','pTalking','sumBillable','sumDuration','sumHoldTime','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','format','voice:queue:%s','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice_queue_channel:remove','sendMessageOneNotActive','available','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','syncCampaigns','campaignsPreview','hasOwnProperty','type','clearZombieChannels','clearZombieChannel','isNil','info','[clearZombieChannels][talking]','Queue','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','catch','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','recallMe','agentReadyId','then'];(function(_0x8833d9,_0x316b5f){var _0x389098=function(_0x52f479){while(--_0x52f479){_0x8833d9['push'](_0x8833d9['shift']());}};_0x389098(++_0x316b5f);}(_0xa097,0xbe));var _0x7a09=function(_0x58f401,_0x1136c9){_0x58f401=_0x58f401-0x0;var _0x146e3d=_0xa097[_0x58f401];return _0x146e3d;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x7a09('0x0'));var uuid=require('uuid');var moment=require(_0x7a09('0x1'));var md5=require(_0x7a09('0x2'));var Redis=require(_0x7a09('0x3'));var config=require(_0x7a09('0x4'));var logger=require(_0x7a09('0x5'))(_0x7a09('0x6'));var loggerAction=require(_0x7a09('0x5'))(_0x7a09('0x7'));var ami=require(_0x7a09('0x8'));var rpcDb=require('./rpcDb');var Action=require(_0x7a09('0x9'));var ut=require(_0x7a09('0xa'));config[_0x7a09('0xb')]=_[_0x7a09('0xc')](config[_0x7a09('0xb')],{'host':_0x7a09('0xd'),'port':0x18eb});var io=require(_0x7a09('0xe'))(new Redis(config[_0x7a09('0xb')]));var Sequence=function(){};Sequence[_0x7a09('0xf')][_0x7a09('0x10')]=function(_0x1a64bb){this[_0x7a09('0x11')]=this[_0x7a09('0x11')]?this[_0x7a09('0x11')][_0x7a09('0x12')](_0x1a64bb):_0x1a64bb();};function Preview(_0x44c986){this[_0x7a09('0x13')]=new Sequence();this['campaignsPreview']=_0x44c986[_0x7a09('0x14')];this[_0x7a09('0x15')]=_0x44c986[_0x7a09('0x15')];this[_0x7a09('0x16')]={};this['agents']=_0x44c986[_0x7a09('0x17')];this[_0x7a09('0x18')]=0x0;ami['on'](_0x7a09('0x19'),this[_0x7a09('0x1a')]['bind'](this));ami['on']('hangup',this[_0x7a09('0x1b')][_0x7a09('0x1c')](this));ami['on'](_0x7a09('0x1d'),this[_0x7a09('0x1e')][_0x7a09('0x1c')](this));ami['on'](_0x7a09('0x1f'),this[_0x7a09('0x20')][_0x7a09('0x1c')](this));ami['on'](_0x7a09('0x21'),this[_0x7a09('0x22')][_0x7a09('0x1c')](this));ami['on'](_0x7a09('0x23'),this[_0x7a09('0x24')][_0x7a09('0x1c')](this));ami['on'](_0x7a09('0x25'),this[_0x7a09('0x26')][_0x7a09('0x1c')](this));ami['on'](_0x7a09('0x27'),this['syncBlindTransfer']['bind'](this));this[_0x7a09('0x28')](this['campaignsPreview']);}function emit(_0x5252a5,_0x5b8d03,_0x3e2dcf){io['to'](_0x5252a5)['emit'](_0x5b8d03,_0x3e2dcf);}function emitCampaignPreview(_0x1d317e){if(_0x1d317e['type']==='outbound'){var _0x34b393={'id':_0x1d317e['id'],'name':_0x1d317e[_0x7a09('0x29')],'strategy':_0x1d317e[_0x7a09('0x2a')],'answered':_0x1d317e[_0x7a09('0x2b')],'available':_0x1d317e['available'],'loggedIn':_0x1d317e['loggedIn'],'pTalking':_0x1d317e[_0x7a09('0x2c')],'sumBillable':_0x1d317e[_0x7a09('0x2d')],'sumDuration':_0x1d317e[_0x7a09('0x2e')],'sumHoldTime':_0x1d317e[_0x7a09('0x2f')]||0x0,'talking':_0x1d317e['talking'],'total':_0x1d317e['total'],'type':_0x1d317e['type'],'unmanaged':_0x1d317e['unmanaged'],'abandoned':_0x1d317e['abandoned'],'waiting':_0x1d317e[_0x7a09('0x30')],'loggedInDb':_0x1d317e[_0x7a09('0x31')],'dialActive':_0x1d317e[_0x7a09('0x32')],'dialMethod':_0x1d317e[_0x7a09('0x33')],'dialOriginateCallerIdName':_0x1d317e[_0x7a09('0x34')],'dialOriginateCallerIdNumber':_0x1d317e[_0x7a09('0x35')],'dialOriginateTimeout':_0x1d317e[_0x7a09('0x36')],'dialPrefix':_0x1d317e[_0x7a09('0x37')],'outboundAnswerAgiCallsDay':_0x1d317e['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x1d317e[_0x7a09('0x38')],'outboundBlacklistCallsDay':_0x1d317e[_0x7a09('0x39')],'outboundBusyCallsDay':_0x1d317e[_0x7a09('0x3a')],'outboundCongestionCallsDay':_0x1d317e[_0x7a09('0x3b')],'outboundDropCallsDayACS':_0x1d317e['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x1d317e['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x1d317e[_0x7a09('0x3c')],'outboundNoAnswerCallsDay':_0x1d317e['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x1d317e['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x1d317e[_0x7a09('0x3d')],'outboundReCallsDay':_0x1d317e[_0x7a09('0x3e')],'outboundRejectCallsDay':_0x1d317e[_0x7a09('0x3f')],'outboundUnknownCallsDay':_0x1d317e['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x1d317e[_0x7a09('0x40')],'predictiveIntervalAnsweredCalls':_0x1d317e[_0x7a09('0x41')],'predictiveIntervalAvgHoldtime':_0x1d317e[_0x7a09('0x42')],'predictiveIntervalAvgTalktime':_0x1d317e[_0x7a09('0x43')],'predictiveIntervalDroppedCallsCallersExit':_0x1d317e[_0x7a09('0x44')],'predictiveIntervalDroppedCallsTimeout':_0x1d317e[_0x7a09('0x45')],'predictiveIntervalErlangCalls':_0x1d317e[_0x7a09('0x46')],'predictiveIntervalErlangCallsDroppedCalls':_0x1d317e[_0x7a09('0x47')],'predictiveIntervalHitRate':_0x1d317e[_0x7a09('0x48')],'predictiveIntervalMultiplicativeFactor':_0x1d317e['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x1d317e['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x1d317e[_0x7a09('0x49')],'predictiveIntervalTotalCalls':_0x1d317e[_0x7a09('0x4a')],'message':_0x1d317e[_0x7a09('0x4b')],'originated':_0x1d317e[_0x7a09('0x4c')],'erlangCalls':_0x1d317e[_0x7a09('0x4d')],'erlangCallToSecond':_0x1d317e[_0x7a09('0x4e')],'erlangAbandonmentRate':_0x1d317e['erlangAbandonmentRate'],'erlangBusyFactor':_0x1d317e[_0x7a09('0x4f')],'startPredictive':_0x1d317e[_0x7a09('0x50')],'startProgressive':_0x1d317e[_0x7a09('0x51')]};if(_0x1d317e['Trunk']){_0x34b393[_0x7a09('0x52')]={'id':_0x1d317e[_0x7a09('0x52')]['id'],'name':_0x1d317e[_0x7a09('0x52')][_0x7a09('0x29')],'active':_0x1d317e[_0x7a09('0x52')][_0x7a09('0x53')],'callerid':_0x1d317e[_0x7a09('0x52')][_0x7a09('0x54')]};}if(_0x1d317e[_0x7a09('0x55')]){_0x34b393[_0x7a09('0x55')]={'id':_0x1d317e[_0x7a09('0x55')]['id'],'name':_0x1d317e[_0x7a09('0x55')][_0x7a09('0x29')]};}var _0x35fb5b=md5(JSON['stringify'](_0x34b393));if(_0x1d317e['md5']!==_0x35fb5b){_0x1d317e['md5']=_0x35fb5b;emit(util[_0x7a09('0x56')](_0x7a09('0x57'),_0x34b393[_0x7a09('0x29')]),_0x7a09('0x58'),_0x34b393);}}}function emitVoiceQueueChannelRemove(_0x5c8d42){logger['info'](_0x7a09('0x59'),JSON[_0x7a09('0x5a')](_0x5c8d42));emit(util[_0x7a09('0x56')](_0x7a09('0x57'),_0x5c8d42['name']),_0x7a09('0x5b'),_0x5c8d42);}function notSendMessagesQueue(_0x32dada){if(_0x32dada['sendMessageOneNotActive']){if(_0x32dada[_0x7a09('0x4c')]===0x0&&_0x32dada['pTalking']===0x0){_0x32dada[_0x7a09('0x5c')]=![];_0x32dada[_0x7a09('0x5d')]=0x0;_0x32dada[_0x7a09('0x5e')]=0x0;_0x32dada[_0x7a09('0x4b')]=_0x7a09('0x5f');ut[_0x7a09('0x60')](_0x7a09('0x61'),_0x32dada[_0x7a09('0x29')]+'\x20is\x20not\x20active');}else{_0x32dada['message']='IS_DISACTIVED';ut['logger'](_0x7a09('0x61'),_0x32dada[_0x7a09('0x29')]+_0x7a09('0x62'));}emitCampaignPreview(_0x32dada);}}Preview[_0x7a09('0xf')][_0x7a09('0x28')]=function(){var _0x52dc54=this;setInterval(function(){_0x52dc54[_0x7a09('0x63')]();},0x7cf);};Preview[_0x7a09('0xf')][_0x7a09('0x63')]=function(){var _0x150937=this[_0x7a09('0x64')];this[_0x7a09('0x18')]+=0x1;for(var _0x2efe68 in _0x150937){if(_0x150937[_0x7a09('0x65')](_0x2efe68)&&(_0x150937[_0x2efe68]['dialMethod']===_0x7a09('0x6')||_0x150937[_0x2efe68][_0x7a09('0x33')]==='booked')&&_0x150937[_0x2efe68][_0x7a09('0x66')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this[_0x7a09('0x18')]=0x0;this[_0x7a09('0x67')]();}}if(_0x150937[_0x7a09('0x65')](_0x2efe68)&&_0x150937[_0x2efe68]['dialMethod']===_0x7a09('0x6')&&_0x150937[_0x2efe68]['type']==='outbound'){if(_0x150937[_0x2efe68][_0x7a09('0x32')]){this['setMessage'](_0x150937[_0x2efe68]);this['recallMe'](_0x150937[_0x2efe68]);}else{notSendMessagesQueue(_0x150937[_0x2efe68]);}}}};Preview[_0x7a09('0xf')][_0x7a09('0x68')]=function(_0x230622){var _0x1802c1=this;this[_0x7a09('0x13')][_0x7a09('0x10')](function(){if(!_[_0x7a09('0x69')](_0x1802c1['actions'][_0x230622])){loggerAction[_0x7a09('0x6a')](_0x7a09('0x6b'),_0x230622,_0x7a09('0x6c'),_0x1802c1['actions'][_0x230622][_0x7a09('0x6d')],'originated:\x20',JSON[_0x7a09('0x5a')](_0x1802c1[_0x7a09('0x64')][_0x1802c1[_0x7a09('0x16')][_0x230622][_0x7a09('0x6d')]][_0x7a09('0x4c')]),_0x7a09('0x6e'),JSON[_0x7a09('0x5a')](_0x1802c1[_0x7a09('0x64')][_0x1802c1[_0x7a09('0x16')][_0x230622][_0x7a09('0x6d')]][_0x7a09('0x2c')]),JSON[_0x7a09('0x5a')](_0x1802c1[_0x7a09('0x16')][_0x230622][_0x7a09('0x6f')]),JSON[_0x7a09('0x5a')](_[_0x7a09('0x70')](_0x1802c1['actions'][_0x230622],[_0x7a09('0x71'),_0x7a09('0x72'),_0x7a09('0x73'),_0x7a09('0x74')])));return ami[_0x7a09('0x75')]({'action':_0x7a09('0x76'),'channel':_0x1802c1['actions'][_0x230622]['channel']})[_0x7a09('0x77')](function(_0x19298a){if(_0x19298a[_0x7a09('0x4b')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x1802c1[_0x7a09('0x16')][_0x230622]){ut[_0x7a09('0x78')](_0x1802c1[_0x7a09('0x64')][_0x1802c1[_0x7a09('0x16')][_0x230622][_0x7a09('0x6d')]],'[clearZombieChannel]');if(_0x1802c1[_0x7a09('0x16')][_0x230622][_0x7a09('0x6f')]===!![]){ut[_0x7a09('0x79')](_0x1802c1[_0x7a09('0x64')][_0x1802c1['actions'][_0x230622]['queue']],_0x7a09('0x7a'));ut[_0x7a09('0x7b')](_0x7a09('0x7c')+_0x230622,_0x1802c1[_0x7a09('0x16')][_0x230622]['queue']);}ut[_0x7a09('0x7b')](_0x7a09('0x7d')+_0x230622,_0x1802c1['actions'][_0x230622][_0x7a09('0x6d')]);delete _0x1802c1[_0x7a09('0x16')][_0x230622];}},0x2328);}});}});};Preview[_0x7a09('0xf')]['clearZombieChannels']=function(){var _0x30b196=this;loggerAction[_0x7a09('0x6a')](_0x7a09('0x7e'),_[_0x7a09('0x7f')](this[_0x7a09('0x16')]));for(var _0xcb8e4a in this[_0x7a09('0x16')]){if(_0x30b196['actions']['hasOwnProperty'](_0xcb8e4a)){_0x30b196['clearZombieChannel'](_0xcb8e4a);}}};Preview[_0x7a09('0xf')][_0x7a09('0x80')]=function(_0x408f88){var _0x118db9=this;rpcDb['getContactRecallMe'](_0x408f88['id'],ut[_0x7a09('0x81')](this['agents']))[_0x7a09('0x82')](function(_0x41320c){if(!_[_0x7a09('0x69')](_0x41320c)){for(var _0x25e670=0x0;_0x25e670<_0x41320c[_0x7a09('0x83')];_0x25e670+=0x1){if(ut[_0x7a09('0x84')](_0x41320c[_0x25e670]['scheduledat'])<_0x408f88[_0x7a09('0x85')]*0x3c){if(_0x41320c[_0x25e670][_0x7a09('0x86')]&&!_0x41320c[_0x25e670][_0x7a09('0x86')][_0x7a09('0x87')]){_0x118db9['run'](_0x41320c[_0x25e670]['id'])[_0x7a09('0x82')](ut['logger2'](_0x7a09('0x88')))['catch'](ut['logger2'](_0x7a09('0x88')));}else{rpcDb['disableContact'](_0x41320c[_0x25e670]['id']);}}else{var _0x431dc0=new Action(_0x41320c[_0x25e670],_0x408f88);_0x431dc0['starttime']=moment()[_0x7a09('0x56')](_0x7a09('0x89'));_0x408f88[_0x7a09('0x3e')]+=0x1;ut[_0x7a09('0x8a')](_0x431dc0,0x17,_0x7a09('0x8b'));if(_0x408f88[_0x7a09('0x8c')]){rpcDb[_0x7a09('0x8d')](ut[_0x7a09('0x8e')](_0x41320c[_0x25e670]));rpcDb[_0x7a09('0x8f')](_0x431dc0,_0x7a09('0x90'));}else{ut[_0x7a09('0x8a')](_0x431dc0,0x16,_0x7a09('0x91'));rpcDb[_0x7a09('0x8f')](_0x431dc0,_0x7a09('0x92'));rpcDb[_0x7a09('0x93')](_0x431dc0,_0x7a09('0x92'));}}}}})[_0x7a09('0x77')](ut['logger2'](_0x7a09('0x94')));};Preview[_0x7a09('0xf')][_0x7a09('0x95')]=function(_0x2a280c){_0x2a280c[_0x7a09('0x5c')]=!![];if(ut['IsNotLoggedIn'](_0x2a280c[_0x7a09('0x96')])){_0x2a280c[_0x7a09('0x4b')]=_0x7a09('0x97');}else if(!ut[_0x7a09('0x98')](_0x2a280c[_0x7a09('0x32')])){_0x2a280c[_0x7a09('0x4b')]=_0x7a09('0x5f');}else if(!this[_0x7a09('0x99')](_0x2a280c['Trunk'])){if(!this['isTrunkReachable'](_0x2a280c[_0x7a09('0x9a')])){_0x2a280c[_0x7a09('0x4b')]='TRUNK_IS_NOT_REACHABLE';}else{_0x2a280c[_0x7a09('0x4b')]=_0x7a09('0x9b');}}else{_0x2a280c[_0x7a09('0x4b')]=_0x7a09('0x9b');}emitCampaignPreview(_0x2a280c);};Preview[_0x7a09('0xf')][_0x7a09('0x9c')]=function(_0x499df5,_0x3a24d8,_0x3839c1){var _0x44dfc7=this;var _0x13f0cd=this['actions'][_0x3a24d8];var _0xf6b811=this[_0x7a09('0x64')][_0x13f0cd[_0x7a09('0x6d')]];var _0x19e301;if(_0xf6b811){switch(_0x3839c1){case'1':_0xf6b811['outboundNoSuchCallsDay']+=0x1;_0x13f0cd[_0x7a09('0x9d')]+=0x1;_0x13f0cd[_0x7a09('0x9e')]=ut[_0x7a09('0x9f')](_0x13f0cd);ut[_0x7a09('0x8a')](_0x13f0cd,0x0,_0x7a09('0xa0'));rpcDb[_0x7a09('0x8f')](_0x13f0cd,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x7a09('0x9f')](_0x13f0cd)>=_0xf6b811[_0x7a09('0xa1')]){_0x19e301=ut[_0x7a09('0xa2')](_0x13f0cd,0xf,_0x7a09('0xa3'));rpcDb[_0x7a09('0x93')](_0x19e301,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x13f0cd[_0x7a09('0x9d')]>=_0xf6b811[_0x7a09('0xa4')]){rpcDb['createCustomerFinal'](_0x13f0cd,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x7a09('0xa5')](ut[_0x7a09('0xa6')](_0x13f0cd,_0x7a09('0x9d'),_0xf6b811[_0x7a09('0xa7')]),_0x13f0cd[_0x7a09('0xa8')],_0x13f0cd[_0x7a09('0xa9')]);}}delete this[_0x7a09('0x16')][_0x499df5[_0x7a09('0xaa')]];break;case'ANSWER':var _0x3aa510=moment()[_0x7a09('0x56')](_0x7a09('0x89'));_0x13f0cd[_0x7a09('0xab')]=_0x3aa510;_0x13f0cd[_0x7a09('0xac')]=_0x3aa510;_0x13f0cd['dialAnswer']=!![];_0xf6b811[_0x7a09('0x2c')]+=0x1;logger[_0x7a09('0x6a')]('[syncHangup][talking][increment]',_0x13f0cd[_0x7a09('0xad')],'\x20Queue',_0xf6b811[_0x7a09('0x29')],_0x7a09('0x6e'),_0xf6b811[_0x7a09('0x2c')]);ami['emit'](_0x7a09('0xae'),ut[_0x7a09('0xaf')](_0x13f0cd,_0x7a09('0xb0')));if(_0xf6b811[_0x7a09('0xb1')]){ami[_0x7a09('0xb2')]('custom:agentConnectPreview',ut[_0x7a09('0xb3')](_0x13f0cd));}break;case'16':ami[_0x7a09('0xb2')]('custom:agentcomplete',ut['buildObj'](_0x13f0cd,_0x7a09('0xb4')));emitVoiceQueueChannelRemove(ut[_0x7a09('0xaf')](_0x13f0cd,_0x7a09('0xb4')));_0xf6b811[_0x7a09('0x38')]+=0x1;_0xf6b811['total']+=0x1;_0xf6b811[_0x7a09('0x2b')]+=0x1;ut['decrementTalkink'](_0xf6b811,_0x7a09('0xb5'));_0x13f0cd[_0x7a09('0x9e')]=ut[_0x7a09('0x9f')](_0x13f0cd);ut[_0x7a09('0x8a')](_0x13f0cd,0x4,_0x7a09('0xb6'));rpcDb[_0x7a09('0x8f')](_0x13f0cd,_0x7a09('0xb7'));rpcDb[_0x7a09('0x93')](_0x13f0cd,_0x7a09('0xb8'));rpcDb[_0x7a09('0xb9')](_0x13f0cd);_0xf6b811[_0x7a09('0x2e')]+=_0x13f0cd[_0x7a09('0xba')];_0xf6b811[_0x7a09('0x2d')]+=_0x13f0cd[_0x7a09('0xba')];logger['info']('[syncHangup][talking][decrement]',_0x13f0cd['uniqueid'],'\x20Queue',_0xf6b811[_0x7a09('0x29')],_0x7a09('0x6e'),_0xf6b811[_0x7a09('0x2c')]);delete this[_0x7a09('0x16')][_0x499df5['linkedid']];break;case'BUSY':_0xf6b811['outboundBusyCallsDay']+=0x1;_0x13f0cd[_0x7a09('0xbb')]+=0x1;_0x13f0cd['countglobal']=ut['totalGlobal'](_0x13f0cd);ut[_0x7a09('0x8a')](_0x13f0cd,0x5,_0x7a09('0xbc'));rpcDb[_0x7a09('0x8f')](_0x13f0cd,_0x7a09('0xbd'));if(ut[_0x7a09('0x9f')](_0x13f0cd)>=_0xf6b811[_0x7a09('0xa1')]){_0x19e301=ut[_0x7a09('0xa2')](_0x13f0cd,0xf,_0x7a09('0xa3'));rpcDb[_0x7a09('0x93')](_0x19e301,_0x7a09('0xbe'));}else{if(_0x13f0cd['countbusyretry']>=_0xf6b811[_0x7a09('0xbf')]){rpcDb[_0x7a09('0x93')](_0x13f0cd,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x7a09('0xa5')](ut[_0x7a09('0xa6')](_0x13f0cd,'countbusyretry',_0xf6b811['dialBusyRetryFrequency']),_0x13f0cd[_0x7a09('0xa8')],_0x13f0cd[_0x7a09('0xa9')]);}}break;case _0x7a09('0xc0'):_0xf6b811['outboundNoAnswerCallsDay']+=0x1;_0x13f0cd[_0x7a09('0xc1')]+=0x1;_0x13f0cd[_0x7a09('0x9e')]=ut['totalGlobal'](_0x13f0cd);ut[_0x7a09('0x8a')](_0x13f0cd,0x3,_0x7a09('0xc2'));rpcDb[_0x7a09('0x8f')](_0x13f0cd,_0x7a09('0xc3'));if(ut[_0x7a09('0x9f')](_0x13f0cd)>=_0xf6b811[_0x7a09('0xa1')]){_0x19e301=ut[_0x7a09('0xa2')](_0x13f0cd,0xf,'Global');rpcDb[_0x7a09('0x93')](_0x19e301,_0x7a09('0xc4'));}else{if(_0x13f0cd['countnoanswerretry']>=_0xf6b811[_0x7a09('0xc5')]){rpcDb[_0x7a09('0x93')](_0x13f0cd,_0x7a09('0xc3'));}else{rpcDb[_0x7a09('0xa5')](ut['scheduledAt'](_0x13f0cd,_0x7a09('0xc1'),_0xf6b811[_0x7a09('0xc6')]),_0x13f0cd[_0x7a09('0xa8')],_0x13f0cd[_0x7a09('0xa9')]);}}break;case'CONGESTION':_0xf6b811[_0x7a09('0x3b')]+=0x1;_0x13f0cd[_0x7a09('0xc7')]+=0x1;_0x13f0cd[_0x7a09('0x9e')]=ut[_0x7a09('0x9f')](_0x13f0cd);ut[_0x7a09('0x8a')](_0x13f0cd,0x8,_0x7a09('0xc8'));rpcDb[_0x7a09('0x8f')](_0x13f0cd,'[callProgressDetectingCustomer][logCongestion]');if(ut['totalGlobal'](_0x13f0cd)>=_0xf6b811[_0x7a09('0xa1')]){_0x19e301=ut[_0x7a09('0xa2')](_0x13f0cd,0xf,_0x7a09('0xa3'));rpcDb['createCustomerFinal'](_0x19e301,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x13f0cd['countcongestionretry']>=_0xf6b811[_0x7a09('0xc9')]){rpcDb[_0x7a09('0x93')](_0x13f0cd,_0x7a09('0xca'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x13f0cd,_0x7a09('0xc7'),_0xf6b811[_0x7a09('0xcb')]),_0x13f0cd[_0x7a09('0xa8')],_0x13f0cd[_0x7a09('0xa9')]);}}break;case'CANCEL':_0xf6b811[_0x7a09('0x3f')]+=0x1;_0x13f0cd[_0x7a09('0xcc')]+=0x1;_0x13f0cd['countglobal']=ut[_0x7a09('0x9f')](_0x13f0cd);ut[_0x7a09('0x8a')](_0x13f0cd,0x14,_0x7a09('0xcd'));rpcDb[_0x7a09('0x8f')](_0x13f0cd,'[syncHangupRequest][logAgentReject]');if(ut[_0x7a09('0x9f')](_0x13f0cd)>=_0xf6b811['dialGlobalMaxRetry']){_0x19e301=ut[_0x7a09('0xa2')](_0x13f0cd,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x19e301,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x13f0cd[_0x7a09('0xcc')]>=_0xf6b811[_0x7a09('0xce')]){rpcDb[_0x7a09('0x93')](_0x13f0cd,_0x7a09('0xcf'));}else{console[_0x7a09('0xd0')]('AGENTREJECT\x20action',_0x13f0cd);console[_0x7a09('0xd0')](_0x7a09('0xd1'),_0xf6b811);rpcDb[_0x7a09('0xa5')](ut[_0x7a09('0xa6')](_0x13f0cd,_0x7a09('0xcc'),_0xf6b811[_0x7a09('0xd2')]),_0x13f0cd[_0x7a09('0xa8')],_0x13f0cd[_0x7a09('0xa9')]);}}break;case'ABANDONED':_0xf6b811[_0x7a09('0x40')]+=0x1;_0x13f0cd[_0x7a09('0xd3')]+=0x1;_0x13f0cd[_0x7a09('0x9e')]=ut[_0x7a09('0x9f')](_0x13f0cd);ut['logCustomer'](_0x13f0cd,0xb,_0x7a09('0xd4'));rpcDb['createCustomerHistory'](_0x13f0cd,_0x7a09('0xd5'));if(ut['totalGlobal'](_0x13f0cd)>=_0xf6b811['dialGlobalMaxRetry']){_0x19e301=ut[_0x7a09('0xa2')](_0x13f0cd,0xf,_0x7a09('0xa3'));rpcDb['createCustomerFinal'](_0x19e301,_0x7a09('0xd5'));}else{if(_0x13f0cd[_0x7a09('0xd6')]>=_0xf6b811[_0x7a09('0xd7')]){rpcDb['createCustomerFinal'](_0x13f0cd,_0x7a09('0xd5'));}else{rpcDb['rescheduleContact'](ut[_0x7a09('0xa6')](_0x13f0cd,_0x7a09('0xd3'),_0xf6b811[_0x7a09('0xd8')]),_0x13f0cd[_0x7a09('0xa8')],_0x13f0cd['activeContact']);}}break;default:if(_0x13f0cd['dialAnswer']){ut[_0x7a09('0x79')](_0xf6b811,'[default]');ut[_0x7a09('0x7b')](_0x7a09('0xd9')+_0xf6b811['name'],_0x499df5);}_0xf6b811['outboundUnknownCallsDay']+=0x1;_0x13f0cd[_0x7a09('0x9e')]=ut[_0x7a09('0x9f')](_0x13f0cd);ut[_0x7a09('0x8a')](_0x13f0cd,0xc,_0x499df5['cause-txt']||_0x499df5[_0x7a09('0xda')]);rpcDb[_0x7a09('0x8f')](_0x13f0cd,_0x7a09('0xdb'));if(ut[_0x7a09('0x9f')](_0x13f0cd)>=_0xf6b811[_0x7a09('0xa1')]){_0x19e301=ut[_0x7a09('0xa2')](_0x13f0cd,0xf,'Global');rpcDb[_0x7a09('0x93')](_0x19e301,_0x7a09('0xdc'));}else{rpcDb[_0x7a09('0x93')](_0x13f0cd,_0x7a09('0xdc'));}delete this['actions'][_0x499df5[_0x7a09('0xaa')]];}if(!(_0x13f0cd[_0x7a09('0x6f')]&&_0x3839c1==='16')){ut[_0x7a09('0x78')](_0xf6b811,_0x7a09('0xdd'));logger[_0x7a09('0x6a')]('[originated][decrement][callProgressDetectingCustomer]',_0x13f0cd[_0x7a09('0xad')],_0x7a09('0xde'),_0xf6b811['name'],'originated:\x20',_0xf6b811[_0x7a09('0x4c')]);}if(_0x3839c1!==_0x7a09('0xdf')){delete this[_0x7a09('0x16')][_0x499df5['linkedid']];delete this[_0x7a09('0x16')][_0x499df5[_0x7a09('0xe0')]];}}};Preview['prototype'][_0x7a09('0xe1')]=function(_0x42c717,_0x154816,_0x1b6b94){if(_[_0x7a09('0xe2')](_0x154816)&&_0x7a09('0xe3')!==typeof _0x154816){return;}if(_[_0x7a09('0xe2')](_0x1b6b94)&&_0x7a09('0xe3')!==typeof _0x1b6b94){return;}switch(_0x1b6b94[_0x7a09('0xe4')]){case'0':ut['logAgent'](_0x42c717,0x0,_0x7a09('0xa0'));rpcDb[_0x7a09('0xe5')](_0x42c717,_0x7a09('0xe6'));break;case'3':ut[_0x7a09('0xe7')](_0x42c717,0x3,'NoAnswer');rpcDb[_0x7a09('0xe5')](_0x42c717,_0x7a09('0xe8'));break;case'5':ut['logAgent'](_0x42c717,0x5,_0x7a09('0xbc'));rpcDb[_0x7a09('0xe5')](_0x42c717,_0x7a09('0xe9'));break;case'8':ut[_0x7a09('0xe7')](_0x42c717,0x8,_0x7a09('0xc8'));rpcDb[_0x7a09('0xe5')](_0x42c717,_0x7a09('0xea'));break;case'22':ut[_0x7a09('0xe7')](_0x42c717,0x16,_0x7a09('0xeb'));rpcDb[_0x7a09('0xe5')](_0x42c717,_0x7a09('0xec'));break;default:ut[_0x7a09('0xe7')](_0x42c717,0xc,_0x1b6b94['reason']);rpcDb['createAgentHistory'](_0x42c717,_0x7a09('0xea'));}ut[_0x7a09('0x78')](_0x154816,_0x7a09('0xed'));logger[_0x7a09('0x6a')](_0x7a09('0xee'),_0x42c717[_0x7a09('0xad')],_0x7a09('0xde'),_0x154816[_0x7a09('0x29')],_0x7a09('0xef'),_0x154816[_0x7a09('0x4c')]);delete this[_0x7a09('0x16')][_0x42c717[_0x7a09('0xad')]];};Preview[_0x7a09('0xf')][_0x7a09('0xf0')]=function(_0x35f4f4,_0x3c51fb,_0x2d260e,_0x364243,_0x53e9f3){var _0x565ff7=this;return new BPromise(function(_0x3e12fc,_0xa82b32){if(_[_0x7a09('0x69')](_0x3c51fb)||_[_0x7a09('0x69')](_0x3c51fb['Contact'])||_[_0x7a09('0x69')](_0x3c51fb[_0x7a09('0xf1')][_0x7a09('0xf2')])||_[_0x7a09('0x69')](_0x3c51fb[_0x7a09('0x73')])){_0xa82b32(ut[_0x7a09('0x4b')](_0x7a09('0xf3'),_0x364243,_0x53e9f3));return;}var _0x278d5e=uuid['v4']();var _0x378ece=_0x565ff7[_0x7a09('0x64')][_0x3c51fb[_0x7a09('0x6c')]['name']];var _0x581642=_0x2d260e?_0x565ff7['agents'][_0x2d260e]['id']:undefined;_0x565ff7[_0x7a09('0x16')][_0x278d5e]=new Action(_0x3c51fb,_0x378ece,_0x278d5e,_0x2d260e,_0x581642);var _0x2bbcd8=_0x565ff7[_0x7a09('0x16')][_0x278d5e];_0x2bbcd8[_0x7a09('0xa8')]=_0x364243;_0x2bbcd8['activeContact']=_0x53e9f3;_0x2bbcd8[_0x7a09('0xf4')]=_0x2d260e;if(_[_0x7a09('0xf5')](_0x35f4f4)){_0x565ff7[_0x7a09('0xf6')](_0x2bbcd8,_0x378ece,_0x3c51fb,_0x2d260e)[_0x7a09('0x82')](function(_0x8a21d9){logger['info'](_0x7a09('0xf7'),_0x7a09('0xf8')+_0x2bbcd8[_0x7a09('0x6d')]+'\x20IdHopper:\x20'+_0x2bbcd8[_0x7a09('0xf9')],JSON[_0x7a09('0x5a')](_0x8a21d9));ami[_0x7a09('0xb2')](_0x7a09('0xfa'),ut[_0x7a09('0xaf')](_0x2bbcd8,_0x7a09('0xfb')));_0x3e12fc(ut[_0x7a09('0x4b')](_0x7a09('0xfc')));})['catch'](function(_0x436e0e){ut[_0x7a09('0x60')](_0x7a09('0xfd'),_0x436e0e);_0xa82b32(ut[_0x7a09('0x4b')](_0x7a09('0xfe'),_0x364243,_0x53e9f3));});}else{_0x378ece[_0x7a09('0x39')]+=0x1;ut[_0x7a09('0xff')](_0x2bbcd8);rpcDb[_0x7a09('0x100')](_0x2bbcd8,_0x7a09('0x101'));delete _0x565ff7[_0x7a09('0x16')][_0x278d5e];_0xa82b32(ut[_0x7a09('0x4b')]('Contact\x20in\x20black\x20List',_0x364243,_0x53e9f3));}});};Preview[_0x7a09('0xf')][_0x7a09('0x99')]=function(_0x2a2231){return!_[_0x7a09('0x69')](_0x2a2231)&&!_[_0x7a09('0x69')](_0x2a2231[_0x7a09('0x29')])&&!_[_0x7a09('0x69')](_0x2a2231['active'])&&_0x2a2231[_0x7a09('0x53')]&&!_[_0x7a09('0x69')](this[_0x7a09('0x15')][util[_0x7a09('0x56')](_0x7a09('0x102'),_0x2a2231[_0x7a09('0x29')])])&&!_[_0x7a09('0x69')](this[_0x7a09('0x15')][util['format']('SIP/%s',_0x2a2231['name'])][_0x7a09('0x76')])&&(this['trunks'][util[_0x7a09('0x56')](_0x7a09('0x102'),_0x2a2231['name'])][_0x7a09('0x76')]===_0x7a09('0x103')||this[_0x7a09('0x15')][util[_0x7a09('0x56')](_0x7a09('0x102'),_0x2a2231[_0x7a09('0x29')])][_0x7a09('0x76')]===_0x7a09('0x104'));};Preview[_0x7a09('0xf')]['run']=function(_0x5e7bed,_0x240a05){var _0x5dcf4c=this;return new BPromise(function(_0x502c87,_0x25deb5){_0x5dcf4c['execRun'](_0x5e7bed,_0x240a05)[_0x7a09('0x82')](function(_0x547e43){_0x502c87(_[_0x7a09('0x70')](_0x547e43,[_0x7a09('0x4b')]));})[_0x7a09('0x77')](function(_0x210736){if(_0x210736[_0x7a09('0x105')]){rpcDb[_0x7a09('0x106')](_0x5e7bed);}if(_0x210736[_0x7a09('0x53')]){rpcDb[_0x7a09('0x107')](_0x5e7bed);}_0x25deb5(_[_0x7a09('0x70')](_0x210736,['message']));});});};Preview['prototype'][_0x7a09('0x108')]=function(_0x5327f6,_0xb3399d){var _0x3a64fa=this;return new BPromise(function(_0x16dd6,_0x282e7d){var _0x4d5a98,_0x4591aa;rpcDb[_0x7a09('0x109')](_0x5327f6)[_0x7a09('0x82')](function(_0x2f07cc){if(!_[_0x7a09('0x69')](_0x2f07cc[0x0])){_0x4591aa=_0x2f07cc[0x0]['recallme']?![]:!![];_0x4d5a98=_0x2f07cc[0x0]['recallme']?!![]:![];_0x4d5a98=_0xb3399d?!![]:_0x4d5a98;}var _0x576fda=_0x3a64fa[_0x7a09('0x10a')](_0x2f07cc);if(_0x576fda[_0x7a09('0x10b')]){rpcDb[_0x7a09('0x10c')](_[_0x7a09('0x70')](_0x2f07cc[0x0],[_0x7a09('0x73'),_0x7a09('0x10d')]))[_0x7a09('0x82')](function(_0x1f1962){_0x3a64fa[_0x7a09('0xf0')](_0x1f1962,_0x2f07cc[0x0],_0xb3399d,_0x4591aa,_0x4d5a98)['then'](function(_0x5e3022){_0x16dd6(_0x5e3022);})[_0x7a09('0x77')](function(_0xe5997e){_0x282e7d(_0xe5997e);});})['catch'](function(_0x20b10c){ut['logger'](_0x7a09('0x10e'),_0x20b10c);_0x282e7d(ut[_0x7a09('0x4b')](_0x7a09('0x10f'),_0x4591aa,_0x4d5a98));});}else{_0x282e7d(ut[_0x7a09('0x4b')](_0x576fda['message'],_0x4591aa,_0x4d5a98));}})['catch'](function(_0x1b69e4){ut[_0x7a09('0x60')]('[Preview][getContactPreview]',_0x1b69e4);_0x282e7d(ut['message']('Call\x20unsuccessful',![],!![]));});});};Preview[_0x7a09('0xf')]['validateContact']=function(_0x11f7f0){if(_['isNil'](_0x11f7f0)||_['isEmpty'](_0x11f7f0)||!_[_0x7a09('0x69')](_0x11f7f0[0x0][_0x7a09('0x86')])&&_[_0x7a09('0x69')](_0x11f7f0[0x0][_0x7a09('0x86')]['name'])){ut[_0x7a09('0x60')](_0x7a09('0x110'),_0x11f7f0);return{'isValid':![],'message':'Empty\x20Contact'};}var _0xcd5819=this[_0x7a09('0x64')][_0x11f7f0[0x0][_0x7a09('0x6c')][_0x7a09('0x29')]];_0xcd5819[_0x7a09('0x4b')]=_0x7a09('0x9b');if(_['isNil'](_0xcd5819)){ut['logger'](_0x7a09('0x111'),_0xcd5819);return{'isValid':![],'message':_0x7a09('0x112')};}if(!this['isTrunkReachable'](_0xcd5819[_0x7a09('0x52')])){ut[_0x7a09('0x60')](_0x7a09('0x113'),_0x7a09('0x114')+_0xcd5819['name']+_0x7a09('0x115'));if(!this[_0x7a09('0x99')](_0xcd5819[_0x7a09('0x9a')])){ut[_0x7a09('0x60')](_0x7a09('0x113'),_0xcd5819['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x7a09('0x116')};}}if(!ut[_0x7a09('0x98')](_0xcd5819[_0x7a09('0x32')])){ut[_0x7a09('0x60')](_0x7a09('0x117'),_0xcd5819[_0x7a09('0x29')]+_0x7a09('0x118'));return{'isValid':![],'message':_0x7a09('0x114')+_0xcd5819['name']+_0x7a09('0x118')};}return{'isValid':!![],'message':_0x7a09('0x119')};};Preview[_0x7a09('0xf')][_0x7a09('0xf6')]=function(_0x3dcdd0,_0x42b21d,_0x43ac96,_0x1deb1a){var _0x153d32=this;return new BPromise(function(_0x146737,_0x5985f8){var _0x1cf56a=_0x3dcdd0[_0x7a09('0xad')];var _0x42f451=_0x153d32['isTrunkReachable'](_0x42b21d['Trunk'])?util['format']('SIP/%s/%s%s',_0x42b21d[_0x7a09('0x52')][_0x7a09('0x29')],_[_0x7a09('0x69')](_0x42b21d[_0x7a09('0x37')])?'':_0x42b21d[_0x7a09('0x37')][_0x7a09('0x11a')]()||'',_0x42b21d[_0x7a09('0x11b')]>0x0?_0x43ac96[_0x7a09('0xf1')]['phone']['substring'](_0x42b21d['dialCutDigit']):_0x43ac96[_0x7a09('0xf1')]['phone']):util[_0x7a09('0x56')]('SIP/%s/%s%s',_[_0x7a09('0x69')](_0x42b21d['TrunkBackup'])?_0x42b21d[_0x7a09('0x52')][_0x7a09('0x29')]:_0x42b21d[_0x7a09('0x9a')][_0x7a09('0x29')],_[_0x7a09('0x69')](_0x42b21d[_0x7a09('0x37')])?'':_0x42b21d[_0x7a09('0x37')][_0x7a09('0x11a')]()||'',_0x42b21d[_0x7a09('0x11b')]>0x0?_0x43ac96['Contact'][_0x7a09('0xf2')][_0x7a09('0x11c')](_0x42b21d[_0x7a09('0x11b')]):_0x43ac96[_0x7a09('0xf1')][_0x7a09('0xf2')]);var _0x4b73c4=_0x153d32[_0x7a09('0x99')](_0x42b21d['Trunk'])?ut[_0x7a09('0x11d')](_0x42b21d[_0x7a09('0x52')][_0x7a09('0x54')],_0x42b21d[_0x7a09('0x34')],_0x42b21d[_0x7a09('0x11e')]>0x0?ut['getCallerIdRandom'](_0x42b21d[_0x7a09('0x35')],_0x42b21d[_0x7a09('0x11e')]):_0x42b21d['dialOriginateCallerIdNumber']):ut[_0x7a09('0x11d')](_[_0x7a09('0x69')](_0x42b21d[_0x7a09('0x9a')])?_0x42b21d[_0x7a09('0x52')]['callerid']:_0x42b21d['TrunkBackup'][_0x7a09('0x54')],_0x42b21d[_0x7a09('0x34')],_0x42b21d[_0x7a09('0x11e')]>0x0?ut['getCallerIdRandom'](_0x42b21d[_0x7a09('0x35')],_0x42b21d[_0x7a09('0x11e')]):_0x42b21d[_0x7a09('0x35')]);if(_0x4b73c4){_0x3dcdd0[_0x7a09('0x11f')]=ut[_0x7a09('0x120')](_0x4b73c4);_0x3dcdd0[_0x7a09('0x121')]=ut[_0x7a09('0x122')](_0x4b73c4);}var _0x5b5581=ut[_0x7a09('0x123')](_0x42b21d,_0x43ac96,_0x42f451,_0x4b73c4,_0x1cf56a,_0x3dcdd0);_['merge'](_0x3dcdd0,ut[_0x7a09('0x124')](_0x5b5581));_0x3dcdd0[_0x7a09('0x125')]=moment()[_0x7a09('0x56')](_0x7a09('0x89'));ami['Action'](ut[_0x7a09('0x126')](_0x3dcdd0,_0x42b21d,_0x5b5581,_0x3dcdd0[_0x7a09('0xa9')],_0x1deb1a))[_0x7a09('0x82')](function(_0x46bbf0){_0x42b21d[_0x7a09('0x4c')]+=0x1;logger['info']('[originated][increment]',_0x1cf56a,'\x20Queue',_0x42b21d[_0x7a09('0x29')],'originated:\x20',_0x42b21d[_0x7a09('0x4c')]);_0x146737(_0x46bbf0);})[_0x7a09('0x77')](function(_0x237a8c){ut[_0x7a09('0xe7')](_0x3dcdd0,0xe,'OriginateError');rpcDb[_0x7a09('0xe5')](_0x3dcdd0,_0x7a09('0x127'));_0x5985f8(_0x237a8c);});});};Preview['prototype'][_0x7a09('0x22')]=function(_0xf531ce){if(this['actions'][_0xf531ce['linkedid']]){this[_0x7a09('0x16')][_0xf531ce['linkedid']][_0x7a09('0x128')]=_0xf531ce[_0x7a09('0x128')];}};Preview[_0x7a09('0xf')]['syncOriginateResponse']=function(_0x24652c){var _0x4526e6=this;var _0x33e982=this[_0x7a09('0x16')][_0x24652c['actionid']];if(_0x33e982){if(_0x33e982[_0x7a09('0xf4')]&&this[_0x7a09('0x17')][_0x33e982['lookAgent']]){ut[_0x7a09('0x129')](_0x33e982,this[_0x7a09('0x17')][_0x33e982['lookAgent']]['name'],this[_0x7a09('0x17')][_0x33e982[_0x7a09('0xf4')]]['id']);}var _0x461f6d=_[_0x7a09('0x12a')](_0x33e982);_0x461f6d['responsetime']=moment()[_0x7a09('0x56')](_0x7a09('0x89'));var _0x2e087b=_0x4526e6['campaignsPreview'][_0x33e982['queue']];if(ut[_0x7a09('0x12b')](_0x24652c[_0x7a09('0x12c')])){if(_0x33e982[_0x7a09('0xa8')]){rpcDb['unlockContact'](_0x33e982[_0x7a09('0xf9')]);}if(_0x33e982[_0x7a09('0xa9')]){rpcDb['disableContact'](_0x33e982[_0x7a09('0xf9')]);}ami['emit']('custom:agentringnoanswer',ut['buildObj'](_0x33e982,_0x7a09('0x12d')));this[_0x7a09('0xe1')](_0x461f6d,_0x2e087b,_0x24652c);}else{_0x33e982['starttime']=moment()[_0x7a09('0x56')](_0x7a09('0x89'));ut[_0x7a09('0xe7')](_0x461f6d,0x4,'Answer');rpcDb[_0x7a09('0xe5')](_0x461f6d,_0x7a09('0x12e'));}}};Preview['prototype'][_0x7a09('0x1b')]=function(_0x4d5cc8){var _0x1e3641=this;var _0xc684fe=this['actions'][_0x4d5cc8[_0x7a09('0xaa')]];var _0x2f5d83;if(_0xc684fe){_0x2f5d83=this[_0x7a09('0x64')][_0xc684fe[_0x7a09('0x6d')]];logger[_0x7a09('0x6a')](_0x7a09('0x12f'),_0x4d5cc8[_0x7a09('0xaa')],'\x20Queue',_0x2f5d83[_0x7a09('0x29')],_0x7a09('0x6e'),_0x2f5d83[_0x7a09('0x2c')]);}if(this['actions'][_0x4d5cc8[_0x7a09('0xaa')]]&&_0x4d5cc8[_0x7a09('0xaa')]!==_0x4d5cc8['uniqueid']){if(_0x4d5cc8['cause']==='16'&&this['actions'][_0x4d5cc8['linkedid']][_0x7a09('0x6f')]){this['callProgressDetectingCustomer'](_0x4d5cc8,_0x4d5cc8[_0x7a09('0xaa')],_0x4d5cc8['cause']);}else if(this[_0x7a09('0x16')][_0x4d5cc8['linkedid']][_0x7a09('0x6f')]){logger['info'](_0x7a09('0x130'),_0x4d5cc8[_0x7a09('0xaa')],_0x4d5cc8[_0x7a09('0x131')],'\x20Queue',_0x2f5d83[_0x7a09('0x29')],'pTalking:\x20',_0x2f5d83[_0x7a09('0x2c')]);this[_0x7a09('0x9c')](_0x4d5cc8,_0x4d5cc8[_0x7a09('0xaa')],_0x4d5cc8[_0x7a09('0x131')]);}}else if(_0xc684fe&&_[_0x7a09('0x69')](_0xc684fe[_0x7a09('0x132')])&&_0x2f5d83['dialQueueProject']&&_0x4d5cc8[_0x7a09('0xaa')]===_0x4d5cc8[_0x7a09('0xad')]&&_['isNil'](_0x4d5cc8[_0x7a09('0xe4')])&&_0x4d5cc8[_0x7a09('0x131')]==='16'&&_0x4d5cc8[_0x7a09('0x133')]==='6'&&_['isUndefined'](_0xc684fe['transfer'])){if(_0xc684fe['unlockAgent']){rpcDb[_0x7a09('0x106')](_0xc684fe[_0x7a09('0xf9')]);}if(_0xc684fe[_0x7a09('0xa9')]){rpcDb[_0x7a09('0x107')](_0xc684fe[_0x7a09('0xf9')]);}_0x4d5cc8[_0x7a09('0xe4')]='22';this['callProgressDetectingAgent'](_0xc684fe,_0x2f5d83,_0x4d5cc8);}else if(_0xc684fe&&_0xc684fe[_0x7a09('0x134')]){if(_0x4d5cc8[_0x7a09('0x131')]==='16'&&this[_0x7a09('0x16')][_0x4d5cc8['linkedid']][_0x7a09('0x6f')]){logger['info']('[syncHangup][talking][transfer]',_0x4d5cc8[_0x7a09('0xaa')],_0x4d5cc8['cause'],_0x7a09('0xde'),_0x2f5d83[_0x7a09('0x29')],_0x7a09('0x6e'),_0x2f5d83[_0x7a09('0x2c')]);this[_0x7a09('0x9c')](_0x4d5cc8,_0x4d5cc8[_0x7a09('0xaa')],_0x4d5cc8[_0x7a09('0x131')]);}else if(this[_0x7a09('0x16')][_0x4d5cc8[_0x7a09('0xaa')]][_0x7a09('0x6f')]){logger['info']('[syncHangup][talking][cause]',_0x4d5cc8[_0x7a09('0xaa')],_0x4d5cc8['cause'],'\x20Queue',_0x2f5d83[_0x7a09('0x29')],_0x7a09('0x6e'),_0x2f5d83[_0x7a09('0x2c')]);this[_0x7a09('0x9c')](_0x4d5cc8,_0x4d5cc8['linkedid'],_0x4d5cc8[_0x7a09('0x131')]);}}};Preview[_0x7a09('0xf')][_0x7a09('0x20')]=function(_0x4f933e){if(this['actions'][_0x4f933e['destlinkedid']]&&_0x4f933e['destlinkedid']!==_0x4f933e['destuniqueid']){this[_0x7a09('0x9c')](_0x4f933e,_0x4f933e[_0x7a09('0xe0')],_0x4f933e['dialstatus']);}};Preview[_0x7a09('0xf')][_0x7a09('0x1e')]=function(_0x216600){if(this['actions'][_0x216600['linkedid']]&&_0x216600['linkedid']!==_0x216600[_0x7a09('0xad')]&&!this[_0x7a09('0x16')][_0x216600['linkedid']][_0x7a09('0x6f')]){if(_0x216600[_0x7a09('0x131')]==='1'){this['callProgressDetectingCustomer'](_0x216600,_0x216600[_0x7a09('0xaa')],_0x216600[_0x7a09('0x131')]);}}};Preview[_0x7a09('0xf')][_0x7a09('0x135')]=function(_0x3ca47e,_0x47c2cd,_0x4c3c2a){if(this[_0x7a09('0x16')][_0x3ca47e]){if(_['isNil'](this['actions'][_0x3ca47e][_0x7a09('0x136')])){this[_0x7a09('0x16')][_0x3ca47e]['variables']={};}this[_0x7a09('0x16')][_0x3ca47e][_0x7a09('0x136')][_0x47c2cd]=_0x4c3c2a;}};Preview[_0x7a09('0xf')][_0x7a09('0x24')]=function(_0x403a1e){try{if(!_['isNil'](_0x403a1e)){if(ut[_0x7a09('0x137')](_[_0x7a09('0x138')](_0x403a1e[_0x7a09('0x139')])[0x0])){this[_0x7a09('0x135')](_0x403a1e[_0x7a09('0xad')],_[_0x7a09('0x138')](_0x403a1e[_0x7a09('0x139')])[0x0],_0x403a1e[_0x7a09('0x13a')]);}}}catch(_0x3a1c58){logger[_0x7a09('0x13b')]('[syncVarSet][Preview]',util[_0x7a09('0x13c')](_0x3a1c58,{'showHidden':![],'depth':null}));}};Preview[_0x7a09('0xf')][_0x7a09('0x26')]=function(_0x15af4c){if(_0x15af4c){if(this[_0x7a09('0x16')][_0x15af4c['transfertargetlinkedid']]){this[_0x7a09('0x16')][_0x15af4c[_0x7a09('0x13d')]][_0x7a09('0x134')]=!![];}}};Preview[_0x7a09('0xf')][_0x7a09('0x13e')]=function(_0x2d705f){if(_0x2d705f){if(this['actions'][_0x2d705f[_0x7a09('0x13f')]]){this[_0x7a09('0x16')][_0x2d705f['transfererlinkedid']][_0x7a09('0x134')]=!![];}}};module[_0x7a09('0x140')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index daf80fb..f132a9a 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 _0x5075=['exten','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','resolve','then','[createHistory]\x20','catch','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createHistory','createAgentHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','membername','context','from-sip'];(function(_0x14016c,_0x5d7d8e){var _0x44a523=function(_0x2e4fca){while(--_0x2e4fca){_0x14016c['push'](_0x14016c['shift']());}};_0x44a523(++_0x5d7d8e);}(_0x5075,0x73));var _0x5507=function(_0x4d821c,_0x22bd0e){_0x4d821c=_0x4d821c-0x0;var _0x15dd5b=_0x5075[_0x4d821c];return _0x15dd5b;};'use strict';var util=require(_0x5507('0x0'));var BPromise=require(_0x5507('0x1'));var logger=require(_0x5507('0x2'))(_0x5507('0x3'));var _=require(_0x5507('0x4'));var cmHopper=require(_0x5507('0x5'));var cmHopperFinal=require(_0x5507('0x6'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x5507('0x7'));var voiceQueueRt=require(_0x5507('0x8'));var agentReportPreview=require(_0x5507('0x9'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x5b6d7f){return function(_0x2cd9ee){logger[_0x5507('0xa')](_0x5b6d7f,util['inspect'](_0x2cd9ee,{'showHidden':![],'depth':null}));};}function create(_0x42c232){return BPromise[_0x5507('0xb')]()[_0x5507('0xc')](cmHopperHistory['createHistory'](_0x42c232))['catch'](loggerCatch(_0x5507('0xd')));}function createAgent(_0x441bdc){return BPromise[_0x5507('0xb')]()[_0x5507('0xc')](agentReportPreview['createHistory'](_0x441bdc))[_0x5507('0xe')](loggerCatch(_0x5507('0xd')));}function moveContact(_0x55520e){return BPromise[_0x5507('0xb')]()[_0x5507('0xc')](cmHopper['moveContactManagedDialer'](_0x55520e,!![]))[_0x5507('0xe')](loggerCatch(_0x5507('0xf')));}exports[_0x5507('0x10')]=function(_0x267f27){return BPromise[_0x5507('0xb')]()[_0x5507('0xc')](cmHopperBlack['checkIsBlackList'](_0x267f27))[_0x5507('0xe')](loggerCatch(_0x5507('0x11')));};exports[_0x5507('0x12')]=function(_0x46545d){return BPromise['resolve']()[_0x5507('0xc')](cmHopper[_0x5507('0x12')](_0x46545d))[_0x5507('0xe')](loggerCatch(_0x5507('0x13')));};exports[_0x5507('0x14')]=function(_0x2ede34,_0x241932){create(_0x2ede34)[_0x5507('0xe')](loggerCatch(_0x241932));moveContact(_0x2ede34)[_0x5507('0xe')](loggerCatch(_0x241932));};exports[_0x5507('0x15')]=function(_0x233b6a,_0x2260f7){createAgent(_0x233b6a)[_0x5507('0xe')](loggerCatch(_0x2260f7));};exports['createCustomerHistory']=function(_0x14dab0,_0x276a81){create(_0x14dab0)[_0x5507('0xe')](loggerCatch(_0x276a81));};exports[_0x5507('0x16')]=function(_0x54f473,_0x1dc53e){moveContact(_0x54f473)[_0x5507('0xe')](loggerCatch(_0x1dc53e));};exports[_0x5507('0x17')]=function(_0x3ca1f7,_0x68397c,_0x1be8b1){if(_0x68397c){_0x3ca1f7['UserId']=null;}if(_0x1be8b1){_0x3ca1f7[_0x5507('0x18')]=![];}return BPromise[_0x5507('0xb')]()[_0x5507('0xc')](cmHopper[_0x5507('0x17')](_0x3ca1f7))[_0x5507('0xe')](loggerCatch(_0x5507('0x19')));};exports[_0x5507('0x1a')]=function(_0x10f149){return BPromise[_0x5507('0xb')]()[_0x5507('0xc')](cmHopper[_0x5507('0x1a')](_0x10f149))[_0x5507('0xe')](loggerCatch(_0x5507('0x1b')));};exports[_0x5507('0x1c')]=function(_0x1a2203){return BPromise['resolve']()[_0x5507('0xc')](cmHopper['unlockContact']({'UserId':null},_0x1a2203,0x1))[_0x5507('0xe')](loggerCatch('[unlockContact]\x20'));};exports[_0x5507('0x1d')]=function(_0x24668b){return BPromise['resolve']()['then'](cmHopper[_0x5507('0x1c')]({'active':![]},_0x24668b,0x1))[_0x5507('0xe')](loggerCatch('[activeContact]\x20'));};exports[_0x5507('0x1e')]=function(_0x24574b){var _0x85d383={};_0x85d383[_0x5507('0x1f')]=_0x24574b[_0x5507('0x1f')];_0x85d383[_0x5507('0x20')]=_0x24574b['uniqueid'];_0x85d383[_0x5507('0x21')]=_0x24574b[_0x5507('0x21')];_0x85d383[_0x5507('0x22')]=_0x24574b[_0x5507('0x22')];_0x85d383[_0x5507('0x23')]=_0x24574b['queue'];_0x85d383['queuecallerjoinAt']=_0x24574b[_0x5507('0x24')];_0x85d383[_0x5507('0x25')]=_0x24574b[_0x5507('0x24')];_0x85d383[_0x5507('0x26')]=0x1;_0x85d383['queuecallercompleteAt']=_0x24574b[_0x5507('0x27')];_0x85d383[_0x5507('0x28')]=_0x24574b[_0x5507('0x29')];_0x85d383[_0x5507('0x2a')]=_0x5507('0x2b');_0x85d383[_0x5507('0x2c')]=_0x5507('0x2d');_0x85d383[_0x5507('0x2e')]=0x0;_0x85d383['assigned']=0x1;_0x85d383[_0x5507('0x2f')]=_0x24574b[_0x5507('0x29')];_0x85d383[_0x5507('0x30')]='COMPLETED';return BPromise['resolve']()[_0x5507('0xc')](voiceQueueReport[_0x5507('0x31')](_0x85d383))[_0x5507('0xe')](loggerCatch(_0x5507('0x32')));};exports[_0x5507('0x33')]=function(_0x574fc6,_0x5cc72c){return BPromise[_0x5507('0xb')]()[_0x5507('0xc')](cmHopper[_0x5507('0x33')](_0x574fc6,_0x5cc72c))[_0x5507('0xe')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x23ea7c){return BPromise['resolve']()[_0x5507('0xc')](cmHopper[_0x5507('0x17')](_0x23ea7c,!![],!![]))[_0x5507('0xe')](loggerCatch(_0x5507('0x34')));}; \ No newline at end of file +var _0x46ed=['context','exten','xcally-motion-preview','assigned','lastAssignedTo','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','preview','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','membername'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x46ed,0x168));var _0xd46e=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x46ed[_0x12fc8d];return _0x3f9d04;};'use strict';var util=require(_0xd46e('0x0'));var BPromise=require(_0xd46e('0x1'));var logger=require('../../../config/logger')(_0xd46e('0x2'));var _=require(_0xd46e('0x3'));var cmHopper=require(_0xd46e('0x4'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xd46e('0x5'));var cmHopperBlack=require(_0xd46e('0x6'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0xd46e('0x7'));var voiceQueueReport=require(_0xd46e('0x8'));function loggerCatch(_0x160bcf){return function(_0x25cf78){logger[_0xd46e('0x9')](_0x160bcf,util[_0xd46e('0xa')](_0x25cf78,{'showHidden':![],'depth':null}));};}function create(_0x437ea0){return BPromise[_0xd46e('0xb')]()[_0xd46e('0xc')](cmHopperHistory[_0xd46e('0xd')](_0x437ea0))[_0xd46e('0xe')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x7b2d69){return BPromise[_0xd46e('0xb')]()['then'](agentReportPreview[_0xd46e('0xd')](_0x7b2d69))[_0xd46e('0xe')](loggerCatch(_0xd46e('0xf')));}function moveContact(_0x443000){return BPromise[_0xd46e('0xb')]()[_0xd46e('0xc')](cmHopper['moveContactManagedDialer'](_0x443000,!![]))[_0xd46e('0xe')](loggerCatch('[moveContactManagedDialer]\x20'));}exports['checkIsBlackList']=function(_0xf3048c){return BPromise[_0xd46e('0xb')]()['then'](cmHopperBlack['checkIsBlackList'](_0xf3048c))[_0xd46e('0xe')](loggerCatch(_0xd46e('0x10')));};exports[_0xd46e('0x11')]=function(_0x3fdf88){return BPromise['resolve']()[_0xd46e('0xc')](cmHopper[_0xd46e('0x11')](_0x3fdf88))[_0xd46e('0xe')](loggerCatch(_0xd46e('0x12')));};exports[_0xd46e('0xd')]=function(_0x47fa8f,_0x1d50a5){create(_0x47fa8f)[_0xd46e('0xe')](loggerCatch(_0x1d50a5));moveContact(_0x47fa8f)[_0xd46e('0xe')](loggerCatch(_0x1d50a5));};exports['createAgentHistory']=function(_0x5ddd04,_0x2e8f6d){createAgent(_0x5ddd04)[_0xd46e('0xe')](loggerCatch(_0x2e8f6d));};exports['createCustomerHistory']=function(_0x4fd1f2,_0x2d6f2c){create(_0x4fd1f2)[_0xd46e('0xe')](loggerCatch(_0x2d6f2c));};exports[_0xd46e('0x13')]=function(_0x2273c5,_0x409010){moveContact(_0x2273c5)[_0xd46e('0xe')](loggerCatch(_0x409010));};exports[_0xd46e('0x14')]=function(_0x327b7e,_0xb4940,_0x3c7e91){if(_0xb4940){_0x327b7e[_0xd46e('0x15')]=null;}if(_0x3c7e91){_0x327b7e['active']=![];}return BPromise[_0xd46e('0xb')]()[_0xd46e('0xc')](cmHopper[_0xd46e('0x14')](_0x327b7e))[_0xd46e('0xe')](loggerCatch(_0xd46e('0x16')));};exports[_0xd46e('0x17')]=function(_0x33c2e0){return BPromise[_0xd46e('0xb')]()[_0xd46e('0xc')](cmHopper['countReScheduled'](_0x33c2e0))[_0xd46e('0xe')](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x371054){return BPromise[_0xd46e('0xb')]()[_0xd46e('0xc')](cmHopper[_0xd46e('0x18')]({'UserId':null},_0x371054,0x1))[_0xd46e('0xe')](loggerCatch(_0xd46e('0x19')));};exports[_0xd46e('0x1a')]=function(_0x4dab6a){return BPromise[_0xd46e('0xb')]()[_0xd46e('0xc')](cmHopper[_0xd46e('0x18')]({'active':![]},_0x4dab6a,0x1))[_0xd46e('0xe')](loggerCatch(_0xd46e('0x1b')));};exports[_0xd46e('0x1c')]=function(_0x58aeef){var _0x465d54={};_0x465d54[_0xd46e('0x1d')]=_0x58aeef[_0xd46e('0x1d')];_0x465d54[_0xd46e('0x1e')]=_0x58aeef[_0xd46e('0x1e')];_0x465d54[_0xd46e('0x1f')]=_0x58aeef[_0xd46e('0x1f')];_0x465d54[_0xd46e('0x20')]=_0x58aeef[_0xd46e('0x20')];_0x465d54[_0xd46e('0x21')]=_0x58aeef[_0xd46e('0x21')];_0x465d54[_0xd46e('0x22')]=_0x58aeef[_0xd46e('0x23')];_0x465d54['queuecallerleaveAt']=_0x58aeef[_0xd46e('0x23')];_0x465d54[_0xd46e('0x24')]=0x1;_0x465d54[_0xd46e('0x25')]=_0x58aeef[_0xd46e('0x26')];_0x465d54['connectedlinename']=_0x58aeef[_0xd46e('0x27')];_0x465d54[_0xd46e('0x28')]='from-sip';_0x465d54[_0xd46e('0x29')]=_0xd46e('0x2a');_0x465d54['holdtime']=0x0;_0x465d54[_0xd46e('0x2b')]=0x1;_0x465d54[_0xd46e('0x2c')]=_0x58aeef[_0xd46e('0x27')];_0x465d54['queuecallerexitreason']='COMPLETED';return BPromise[_0xd46e('0xb')]()[_0xd46e('0xc')](voiceQueueReport[_0xd46e('0x2d')](_0x465d54))[_0xd46e('0xe')](loggerCatch(_0xd46e('0x2e')));};exports[_0xd46e('0x2f')]=function(_0xa34f09,_0xf8b746){return BPromise['resolve']()[_0xd46e('0xc')](cmHopper[_0xd46e('0x2f')](_0xa34f09,_0xf8b746))[_0xd46e('0xe')](loggerCatch(_0xd46e('0x30')));};exports[_0xd46e('0x31')]=function(_0x1e0897){return BPromise[_0xd46e('0xb')]()['then'](cmHopper[_0xd46e('0x14')](_0x1e0897,!![],!![]))[_0xd46e('0xe')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 13de2ce..cc41008 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 _0xa906=['error','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','logAgent','statedesc','ringtime','logLookAgent','membername','logCustomer','endtime','talktime','answertime','isFailure','Failure','variablesAction','BOOKED','uniqueid','originate','channelAgent','xcally-motion-preview','from-sip','timeout','totalGlobal','countnoanswerretry','cloneAction','clone','Global','active','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','agentReadyId','not_inuse','status','reachable','push','getDiff','seconds','CampaignId','filterKey','idContact','campaigntype','dialAnswer','countbusyretry','countcongestionretry','countglobal','callback','callbackuniqueid','callbackat','recallme','UserId','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosjitter','rtpaudioqosrtt','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','util','moment','env','XCALLY_IP_AGI','milliseconds','diff','inspect','info','loggerError','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','updateOriginated','originated'];(function(_0x1886d0,_0x36d4b4){var _0x152689=function(_0x4515e4){while(--_0x4515e4){_0x1886d0['push'](_0x1886d0['shift']());}};_0x152689(++_0x36d4b4);}(_0xa906,0x1e3));var _0x6a90=function(_0x131143,_0x159b9f){_0x131143=_0x131143-0x0;var _0xf3e318=_0xa906[_0x131143];return _0xf3e318;};'use strict';var util=require(_0x6a90('0x0'));var _=require('lodash');var moment=require(_0x6a90('0x1'));var logger=require('../../../../config/logger')('preview');var ipAgi=process[_0x6a90('0x2')][_0x6a90('0x3')]||'127.0.0.1';function getSeconds(_0x5f307e,_0x442d26){var _0x3980ce=moment(_0x5f307e)['milliseconds'](0x0);var _0x88b473=moment(_0x442d26)[_0x6a90('0x4')](0x0);return _0x3980ce[_0x6a90('0x5')](_0x88b473,'seconds');}exports['loggerCatch']=function(_0x427a66){return function(_0x58c66d){logger['error'](_0x427a66,util[_0x6a90('0x6')](_0x58c66d,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x56c925,_0x935444){logger[_0x6a90('0x7')](_0x56c925,util[_0x6a90('0x6')](_0x935444,{'showHidden':![],'depth':null}));};exports[_0x6a90('0x8')]=function(_0x224c8c,_0x22b322){logger['error'](_0x224c8c,util[_0x6a90('0x6')](_0x22b322,{'showHidden':![],'depth':null}));};exports[_0x6a90('0x9')]=function(_0x4ddfdb){return function(_0x3ac580){logger[_0x6a90('0x7')](_0x4ddfdb,util[_0x6a90('0x6')](_0x3ac580,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x3c0862,_0x328b57,_0x39aec7){return{'message':_0x3c0862,'unlock':_0x328b57,'active':_0x39aec7};};exports[_0x6a90('0xa')]=function(_0x16cf2b,_0x3234ff,_0x1d5d77){if(!_[_0x6a90('0xb')](_0x1d5d77)&&_0x6a90('0xc')===typeof _0x1d5d77&&!_['isEmpty'](_0x1d5d77)){if(!_[_0x6a90('0xb')](_0x3234ff)&&_0x6a90('0xc')===typeof _0x3234ff&&!_[_0x6a90('0xd')](_0x3234ff)){return util[_0x6a90('0xe')](_0x6a90('0xf'),_0x3234ff,_0x1d5d77);}return util[_0x6a90('0xe')](_0x6a90('0xf'),_0x1d5d77,_0x1d5d77);}if(!_[_0x6a90('0xb')](_0x16cf2b)&&'string'===typeof _0x16cf2b&&!_['isEmpty'](_0x16cf2b)){return _0x16cf2b;}return _0x6a90('0x10');};exports['isActive']=function(_0x1ca66e){if(_[_0x6a90('0x11')](_0x1ca66e)){return![];}return _0x1ca66e;};exports['addVariables']=function(_0x3869ba,_0x7d4423,_0x5f1b2b,_0x3afcb9,_0x27b489,_0x1948aa){var _0x32697f={'XMD-QUEUE':_0x7d4423[_0x6a90('0x12')]?_0x7d4423[_0x6a90('0x12')][_0x6a90('0x13')]:'','XMD-CALLERID':_0x3afcb9,'XMD-CALLERID-PREVIEW':_0x1948aa?util[_0x6a90('0xe')](_0x6a90('0xf'),_0x1948aa[_0x6a90('0x14')],_0x1948aa[_0x6a90('0x15')]):_0x3afcb9,'XMD-DIALID':_0x27b489,'XMD-CONTACTID':_0x7d4423[_0x6a90('0x16')],'XMD-CDRTYPE':_0x6a90('0x17'),'CALLERID(all)':_0x3afcb9,'XMD-VOICEQUEUEID':_0x7d4423[_0x6a90('0x18')],'XMD-DIALCHANNEL':_0x5f1b2b,'XMD-DIALTIMEOUT':_0x3869ba[_0x6a90('0x19')]||0x1e,'XMD-DIALOPTIONS':util[_0x6a90('0xe')](_0x6a90('0x1a'),_0x3869ba[_0x6a90('0x1b')]?'g':'',_['isEmpty'](_0x3869ba[_0x6a90('0x1c')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x3869ba['dialPreviewUrl']||'','XMD-AGI':_0x3869ba[_0x6a90('0x1d')]?util[_0x6a90('0xe')](_0x6a90('0x1e'),ipAgi,_0x3869ba['dialQueueProject']):_0x6a90('0x1f'),'XMD-AGIAFTER':_0x3869ba[_0x6a90('0x1b')]?util[_0x6a90('0xe')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3869ba['dialQueueProject2']):_0x6a90('0x1f'),'XMD-ORIGINATECALLERIDNUM':_0x1948aa?_0x1948aa[_0x6a90('0x20')]:'','XMD-ORIGINATECALLERIDNAME':_0x1948aa?_0x1948aa[_0x6a90('0x21')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0x6a90('0xd')](_0x3869ba[_0x6a90('0x1c')])){_0x32697f[util[_0x6a90('0xe')]('%s',_0x6a90('0x22'))]=_0x3869ba[_0x6a90('0x1c')];_0x32697f[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x27b489;}if(_0x7d4423&&_0x7d4423[_0x6a90('0x23')]){for(var _0x73fa59 in _0x7d4423[_0x6a90('0x23')]){if(_0x7d4423[_0x6a90('0x23')][_0x6a90('0x24')](_0x73fa59)){if(!_['isNil'](_0x7d4423[_0x6a90('0x23')][_0x73fa59])&&_0x73fa59!=='id'&&_0x73fa59!==_0x6a90('0x25')&&_0x73fa59!==_0x6a90('0x26')&&_0x73fa59!=='updatedAt'){_0x32697f[util[_0x6a90('0xe')](_0x6a90('0x27'),_0x6a90('0x28'),_[_0x6a90('0x29')](_0x73fa59))]=_0x7d4423[_0x6a90('0x23')][_0x73fa59];}}}}return _0x32697f;};exports[_0x6a90('0x2a')]=function(_0x13e004){var _0x57b862={};for(var _0x108d7b in _0x13e004){if(_0x13e004[_0x6a90('0x24')](_0x108d7b)){_0x57b862[util['format']('%s',_['toLower'](_0x108d7b))]=_0x13e004[_0x108d7b];}}return{'variables':_0x57b862};};exports[_0x6a90('0x2b')]=function(_0x5b53f2,_0x5786b5){if(!_['isNil'](_0x5b53f2)){if(_0x5b53f2[_0x6a90('0x24')](_0x6a90('0x2c'))){if(_0x5b53f2['originated']>0x0){_0x5b53f2['originated']-=0x1;}else{logger[_0x6a90('0x2d')](_0x6a90('0x2e'),_0x5786b5);}}}else{logger[_0x6a90('0x2d')](_0x6a90('0x2f'),_0x5786b5);}};exports['logBlacklist']=function(_0x29b253){var _0xfea545=moment()[_0x6a90('0xe')](_0x6a90('0x30'));_0x29b253[_0x6a90('0x31')]=0xd;_0x29b253['statedesc']=_0x6a90('0x32');_0x29b253[_0x6a90('0x33')]=_0xfea545;_0x29b253[_0x6a90('0x34')]=_0xfea545;_0x29b253['endtime']=_0xfea545;};exports[_0x6a90('0x35')]=function(_0x3b2889,_0x4bbcad,_0x360949){var _0x1fa52f=moment()[_0x6a90('0xe')](_0x6a90('0x30'));_0x3b2889[_0x6a90('0x31')]=_0x4bbcad;_0x3b2889[_0x6a90('0x36')]=_0x360949;_0x3b2889[_0x6a90('0x34')]=_0x1fa52f;_0x3b2889[_0x6a90('0x37')]=getSeconds(_0x3b2889[_0x6a90('0x34')],_0x3b2889[_0x6a90('0x33')]);};exports[_0x6a90('0x38')]=function(_0x8e992a,_0x443476,_0x5c2870){_0x8e992a[_0x6a90('0x39')]=_0x443476;_0x8e992a['UserId']=_0x5c2870;};exports[_0x6a90('0x3a')]=function(_0x36441e,_0x5d6bbc,_0x4a98b9){var _0x482b02=moment()[_0x6a90('0xe')](_0x6a90('0x30'));_0x36441e[_0x6a90('0x31')]=_0x5d6bbc;_0x36441e[_0x6a90('0x36')]=_0x4a98b9;_0x36441e['responsetime']=_0x36441e['responsetime']?_0x36441e[_0x6a90('0x34')]:_0x482b02;_0x36441e['endtime']=_0x36441e['endtime']?_0x36441e[_0x6a90('0x3b')]:_0x482b02;_0x36441e[_0x6a90('0x37')]=getSeconds(_0x36441e[_0x6a90('0x34')]||0x0,_0x36441e[_0x6a90('0x33')]||0x0);_0x36441e[_0x6a90('0x3c')]=_0x36441e[_0x6a90('0x3d')]?getSeconds(_0x36441e[_0x6a90('0x3b')],_0x36441e[_0x6a90('0x3d')]):0x0;};exports[_0x6a90('0x3e')]=function(_0x34edb0){return _0x34edb0===_0x6a90('0x3f');};exports[_0x6a90('0x40')]=function(_0x39b1de,_0x4de6c4,_0x58624c,_0x14368c,_0x22825e){var _0x2eb0df=_0x14368c?'RECALL':_0x39b1de[_0x6a90('0x14')];_0x2eb0df=_0x22825e?_0x6a90('0x41'):_0x2eb0df;return{'actionid':_0x39b1de[_0x6a90('0x42')],'action':_0x6a90('0x43'),'channel':_0x39b1de[_0x6a90('0x44')],'callerid':util['format'](_0x6a90('0xf'),_0x2eb0df,_0x39b1de[_0x6a90('0x15')]),'Exten':_0x6a90('0x45'),'Context':_0x6a90('0x46'),'Priority':'1','variable':_0x58624c,'timeout':(_0x4de6c4[_0x6a90('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x39b1de[_0x6a90('0x42')]};};exports[_0x6a90('0x48')]=function(_0x4f8f02){return _0x4f8f02['countbusyretry']+_0x4f8f02['countcongestionretry']+_0x4f8f02[_0x6a90('0x49')];};exports[_0x6a90('0x4a')]=function(_0x1e252a){var _0xf03ec9=_[_0x6a90('0x4b')](_0x1e252a);_0xf03ec9[_0x6a90('0x31')]=0xf;_0xf03ec9[_0x6a90('0x36')]=_0x6a90('0x4c');return _0xf03ec9;};exports['scheduledAt']=function(_0x1e41bf,_0x40bad7,_0x5764fa){var _0x107148={};_0x107148[_0x40bad7]=_0x1e41bf[_0x40bad7];_0x107148[_0x6a90('0x4d')]=![];_0x107148[_0x6a90('0x4e')]=moment()['add'](_0x5764fa,_0x6a90('0x4f'))[_0x6a90('0xe')](_0x6a90('0x30'));_0x107148[_0x6a90('0x16')]=_0x1e41bf[_0x6a90('0x16')];_0x107148[_0x6a90('0x50')]=_0x1e41bf[_0x6a90('0x50')];_0x107148[_0x6a90('0x18')]=_0x1e41bf['VoiceQueueId']||undefined;return _0x107148;};exports[_0x6a90('0x51')]=function(_0x31a4e7,_0x3a4300){if(!_[_0x6a90('0x11')](_0x31a4e7)){if(_0x31a4e7[_0x6a90('0x52')]>0x0){_0x31a4e7['pTalking']-=0x1;}else{logger['error'](_0x3a4300,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x6a90('0x2d')](_0x3a4300,_0x6a90('0x53'));}};exports[_0x6a90('0x54')]=function(_0x33ac91){if(_0x33ac91<=0x0){return!![];}return![];};exports['buildObj']=function(_0x1a7623,_0x51be2d){_0x1a7623[_0x6a90('0x55')]=_0x51be2d;_0x1a7623[_0x6a90('0x13')]=_0x1a7623[_0x6a90('0x56')];_0x1a7623[_0x6a90('0x57')]=_0x1a7623['channelAgent'];return _0x1a7623;};exports['buildAcw']=function(_0x328205){var _0x2ff7c6={};_0x2ff7c6[_0x6a90('0x56')]=_0x328205[_0x6a90('0x56')];_0x2ff7c6[_0x6a90('0x57')]=_0x328205[_0x6a90('0x44')];_0x2ff7c6[_0x6a90('0x42')]=_0x328205[_0x6a90('0x42')];return _0x2ff7c6;};exports[_0x6a90('0x58')]=function(_0x33aa77){var _0xd7ace5=[];for(var _0x1f1265 in _0x33aa77){if(_0x33aa77[_0x6a90('0x24')](_0x1f1265)){if(!_[_0x6a90('0x11')](_0x33aa77[_0x1f1265])&&_0x33aa77[_0x1f1265][_0x6a90('0x31')]===_0x6a90('0x59')&&_0x33aa77[_0x1f1265][_0x6a90('0x5a')]===_0x6a90('0x5b')){_0xd7ace5[_0x6a90('0x5c')](_0x33aa77[_0x1f1265]['id']);}}}return _0xd7ace5;};exports[_0x6a90('0x5d')]=function(_0x30d529){var _0x1161a8=moment()[_0x6a90('0x4')](0x0);var _0x1347ec=moment(_0x30d529)[_0x6a90('0x4')](0x0);return _0x1161a8['diff'](_0x1347ec,_0x6a90('0x5e'));};exports['createBody']=function(_0x3fd9a3){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3fd9a3[_0x6a90('0x16')],'ListId':_0x3fd9a3[_0x6a90('0x50')],'VoiceQueueId':_0x3fd9a3['VoiceQueueId']||undefined,'CampaignId':_0x3fd9a3[_0x6a90('0x5f')]||undefined};};exports[_0x6a90('0x60')]=function(_0x491184){if(_0x491184==='uniqueid'||_0x491184===_0x6a90('0x61')||_0x491184===_0x6a90('0x56')||_0x491184==='type'||_0x491184===_0x6a90('0x62')||_0x491184===_0x6a90('0x63')||_0x491184===_0x6a90('0x39')||_0x491184===_0x6a90('0x44')||_0x491184===_0x6a90('0x14')||_0x491184===_0x6a90('0x4d')||_0x491184===_0x6a90('0x15')||_0x491184===_0x6a90('0x4e')||_0x491184===_0x6a90('0x64')||_0x491184===_0x6a90('0x65')||_0x491184===_0x6a90('0x49')||_0x491184===_0x6a90('0x66')||_0x491184===_0x6a90('0x67')||_0x491184===_0x6a90('0x68')||_0x491184===_0x6a90('0x69')||_0x491184===_0x6a90('0x6a')||_0x491184==='ContactId'||_0x491184===_0x6a90('0x50')||_0x491184===_0x6a90('0x6b')||_0x491184===_0x6a90('0x18')||_0x491184==='sipcallid'||_0x491184==='xmd-voicequeueid'||_0x491184===_0x6a90('0x6c')||_0x491184==='xmd-phone'||_0x491184===_0x6a90('0x6d')||_0x491184===_0x6a90('0x6e')||_0x491184===_0x6a90('0x6f')||_0x491184===_0x6a90('0x70')||_0x491184===_0x6a90('0x71')||_0x491184===_0x6a90('0x72')||_0x491184===_0x6a90('0x73')||_0x491184===_0x6a90('0x74')||_0x491184===_0x6a90('0x75')||_0x491184==='xmd-agiafter'||_0x491184==='xmd-agi'||_0x491184===_0x6a90('0x76')||_0x491184===_0x6a90('0x77')||_0x491184==='rtpaudioqosjitter'||_0x491184===_0x6a90('0x78')||_0x491184===_0x6a90('0x79')||_0x491184===_0x6a90('0x7a')||_0x491184==='rtpaudioqosrtt'||_0x491184==='rtpaudioqosrttbridged'||_0x491184==='rtpaudioqos'||_0x491184==='rtpaudioqosbridged'||_0x491184===_0x6a90('0x7b')||_0x491184==='rtpaudioqosjitterbridged'||_0x491184===_0x6a90('0x79')||_0x491184===_0x6a90('0x7a')||_0x491184===_0x6a90('0x7c')||_0x491184==='rtpaudioqosrttbridged'||_0x491184==='bridgepeer'||_0x491184==='bridgepvtcallid'||_0x491184==='state'||_0x491184===_0x6a90('0x36')){return![];}return!![];};exports[_0x6a90('0x7d')]=function(_0x397d56,_0x1ee771){var _0x25871c,_0x4234ec,_0x477ffb;if(_0x1ee771<=0x0){_0x1ee771=0x1;}_0x25871c=new RegExp(_0x6a90('0x7e')+_0x1ee771+'}$');_0x4234ec=Math[_0x6a90('0x7f')](0xa,_0x1ee771-0x1);_0x477ffb=Math[_0x6a90('0x7f')](0xa,_0x1ee771)-0x1;return util['format']('%s',_[_0x6a90('0x80')](_0x397d56,_0x25871c,_[_0x6a90('0x81')](_0x4234ec,_0x477ffb)));};exports['extractCalleridName']=function(_0x3dcdcc){var _0xe62a53=_0x3dcdcc[_0x6a90('0x82')](/"(.*?)"/);return _0xe62a53?_0xe62a53[0x1]:_0x3dcdcc;};exports[_0x6a90('0x83')]=function(_0x1cc4f4){var _0x6fe067=_0x1cc4f4[_0x6a90('0x82')](/<(.*?)>/);return _0x6fe067?_0x6fe067[0x1]:_0x1cc4f4;}; \ No newline at end of file +var _0x1bb8=['uniqueid','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','Global','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','channelAgent','not_inuse','push','getDiff','createBody','VoiceQueueId','filterKey','idContact','type','dialAnswer','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','extractCalleridName','match','lodash','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','error','inspect','info','logger2','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','isNil','addVariables','Queue','calleridname','calleridnum','ContactId','dialer','dialOriginateTimeout','dialQueueProject','\x22agi://%s/square,%s\x22','dialQueueProject2','NONE','originatecalleridnum','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','endtime','logAgent','responsetime','ringtime','logLookAgent','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','originate','timeout'];(function(_0x571dbc,_0x400df9){var _0x55043c=function(_0x47df3b){while(--_0x47df3b){_0x571dbc['push'](_0x571dbc['shift']());}};_0x55043c(++_0x400df9);}(_0x1bb8,0xc2));var _0x81bb=function(_0x43cb51,_0x48cc44){_0x43cb51=_0x43cb51-0x0;var _0x42e298=_0x1bb8[_0x43cb51];return _0x42e298;};'use strict';var util=require('util');var _=require(_0x81bb('0x0'));var moment=require('moment');var logger=require(_0x81bb('0x1'))(_0x81bb('0x2'));var ipAgi=process['env'][_0x81bb('0x3')]||_0x81bb('0x4');function getSeconds(_0x1a718d,_0x5d3043){var _0x1ad9d4=moment(_0x1a718d)[_0x81bb('0x5')](0x0);var _0x4e1b58=moment(_0x5d3043)[_0x81bb('0x5')](0x0);return _0x1ad9d4[_0x81bb('0x6')](_0x4e1b58,_0x81bb('0x7'));}exports['loggerCatch']=function(_0x15770d){return function(_0x13c05e){logger[_0x81bb('0x8')](_0x15770d,util[_0x81bb('0x9')](_0x13c05e,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x16fc5b,_0x1ae74c){logger[_0x81bb('0xa')](_0x16fc5b,util[_0x81bb('0x9')](_0x1ae74c,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x10011f,_0x5db9b2){logger['error'](_0x10011f,util[_0x81bb('0x9')](_0x5db9b2,{'showHidden':![],'depth':null}));};exports[_0x81bb('0xb')]=function(_0x50efb1){return function(_0x2591ac){logger[_0x81bb('0xa')](_0x50efb1,util[_0x81bb('0x9')](_0x2591ac,{'showHidden':![],'depth':null}));};};exports[_0x81bb('0xc')]=function(_0x4b43f0,_0x5692b5,_0x11c084){return{'message':_0x4b43f0,'unlock':_0x5692b5,'active':_0x11c084};};exports[_0x81bb('0xd')]=function(_0x373182,_0x39be5d,_0x4b547b){if(!_[_0x81bb('0xe')](_0x4b547b)&&_0x81bb('0xf')===typeof _0x4b547b&&!_['isEmpty'](_0x4b547b)){if(!_[_0x81bb('0xe')](_0x39be5d)&&_0x81bb('0xf')===typeof _0x39be5d&&!_[_0x81bb('0x10')](_0x39be5d)){return util['format'](_0x81bb('0x11'),_0x39be5d,_0x4b547b);}return util[_0x81bb('0x12')](_0x81bb('0x11'),_0x4b547b,_0x4b547b);}if(!_[_0x81bb('0xe')](_0x373182)&&_0x81bb('0xf')===typeof _0x373182&&!_[_0x81bb('0x10')](_0x373182)){return _0x373182;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x56eb7f){if(_[_0x81bb('0x13')](_0x56eb7f)){return![];}return _0x56eb7f;};exports[_0x81bb('0x14')]=function(_0x35f7e1,_0x283583,_0x1da20e,_0x15b9c2,_0x2071f1,_0x5afed7){var _0x43edb6={'XMD-QUEUE':_0x283583[_0x81bb('0x15')]?_0x283583['Queue']['name']:'','XMD-CALLERID':_0x15b9c2,'XMD-CALLERID-PREVIEW':_0x5afed7?util[_0x81bb('0x12')](_0x81bb('0x11'),_0x5afed7[_0x81bb('0x16')],_0x5afed7[_0x81bb('0x17')]):_0x15b9c2,'XMD-DIALID':_0x2071f1,'XMD-CONTACTID':_0x283583[_0x81bb('0x18')],'XMD-CDRTYPE':_0x81bb('0x19'),'CALLERID(all)':_0x15b9c2,'XMD-VOICEQUEUEID':_0x283583['VoiceQueueId'],'XMD-DIALCHANNEL':_0x1da20e,'XMD-DIALTIMEOUT':_0x35f7e1[_0x81bb('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0x81bb('0x12')]('\x22rtTxX%s%s\x22',_0x35f7e1['dialQueueProject2']?'g':'',_['isEmpty'](_0x35f7e1['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x35f7e1['dialPreviewUrl']||'','XMD-AGI':_0x35f7e1[_0x81bb('0x1b')]?util[_0x81bb('0x12')]('\x22agi://%s/square,%s\x22',ipAgi,_0x35f7e1[_0x81bb('0x1b')]):'NONE','XMD-AGIAFTER':_0x35f7e1['dialQueueProject2']?util[_0x81bb('0x12')](_0x81bb('0x1c'),ipAgi,_0x35f7e1[_0x81bb('0x1d')]):_0x81bb('0x1e'),'XMD-ORIGINATECALLERIDNUM':_0x5afed7?_0x5afed7[_0x81bb('0x1f')]:'','XMD-ORIGINATECALLERIDNAME':_0x5afed7?_0x5afed7['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_['isEmpty'](_0x35f7e1[_0x81bb('0x20')])){_0x43edb6[util['format']('%s',_0x81bb('0x21'))]=_0x35f7e1[_0x81bb('0x20')];_0x43edb6[util[_0x81bb('0x12')]('%s',_0x81bb('0x22'))]=_0x2071f1;}if(_0x283583&&_0x283583[_0x81bb('0x23')]){for(var _0x1dad6d in _0x283583[_0x81bb('0x23')]){if(_0x283583['Contact'][_0x81bb('0x24')](_0x1dad6d)){if(!_['isNil'](_0x283583['Contact'][_0x1dad6d])&&_0x1dad6d!=='id'&&_0x1dad6d!==_0x81bb('0x25')&&_0x1dad6d!==_0x81bb('0x26')&&_0x1dad6d!=='updatedAt'){_0x43edb6[util[_0x81bb('0x12')](_0x81bb('0x27'),_0x81bb('0x28'),_[_0x81bb('0x29')](_0x1dad6d))]=_0x283583[_0x81bb('0x23')][_0x1dad6d];}}}}return _0x43edb6;};exports[_0x81bb('0x2a')]=function(_0x464315){var _0x269dcf={};for(var _0x19d6e9 in _0x464315){if(_0x464315[_0x81bb('0x24')](_0x19d6e9)){_0x269dcf[util['format']('%s',_['toLower'](_0x19d6e9))]=_0x464315[_0x19d6e9];}}return{'variables':_0x269dcf};};exports[_0x81bb('0x2b')]=function(_0x458608,_0x17d130){if(!_[_0x81bb('0x13')](_0x458608)){if(_0x458608[_0x81bb('0x24')](_0x81bb('0x2c'))){if(_0x458608['originated']>0x0){_0x458608[_0x81bb('0x2c')]-=0x1;}else{logger[_0x81bb('0x8')](_0x81bb('0x2d'),_0x17d130);}}}else{logger[_0x81bb('0x8')](_0x81bb('0x2e'),_0x17d130);}};exports[_0x81bb('0x2f')]=function(_0xfdb540){var _0xdcec2b=moment()['format'](_0x81bb('0x30'));_0xfdb540[_0x81bb('0x31')]=0xd;_0xfdb540[_0x81bb('0x32')]=_0x81bb('0x33');_0xfdb540[_0x81bb('0x34')]=_0xdcec2b;_0xfdb540['responsetime']=_0xdcec2b;_0xfdb540[_0x81bb('0x35')]=_0xdcec2b;};exports[_0x81bb('0x36')]=function(_0x1ccb4f,_0x58a2d8,_0x7e24e0){var _0x464938=moment()[_0x81bb('0x12')](_0x81bb('0x30'));_0x1ccb4f['state']=_0x58a2d8;_0x1ccb4f[_0x81bb('0x32')]=_0x7e24e0;_0x1ccb4f[_0x81bb('0x37')]=_0x464938;_0x1ccb4f[_0x81bb('0x38')]=getSeconds(_0x1ccb4f[_0x81bb('0x37')],_0x1ccb4f[_0x81bb('0x34')]);};exports[_0x81bb('0x39')]=function(_0x426b9b,_0x31b995,_0xf64ad0){_0x426b9b['membername']=_0x31b995;_0x426b9b['UserId']=_0xf64ad0;};exports[_0x81bb('0x3a')]=function(_0xfab3ae,_0x458812,_0x186905){var _0x5701a1=moment()[_0x81bb('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0xfab3ae[_0x81bb('0x31')]=_0x458812;_0xfab3ae[_0x81bb('0x32')]=_0x186905;_0xfab3ae[_0x81bb('0x37')]=_0xfab3ae[_0x81bb('0x37')]?_0xfab3ae['responsetime']:_0x5701a1;_0xfab3ae[_0x81bb('0x35')]=_0xfab3ae[_0x81bb('0x35')]?_0xfab3ae['endtime']:_0x5701a1;_0xfab3ae[_0x81bb('0x38')]=getSeconds(_0xfab3ae[_0x81bb('0x37')]||0x0,_0xfab3ae['starttime']||0x0);_0xfab3ae[_0x81bb('0x3b')]=_0xfab3ae['answertime']?getSeconds(_0xfab3ae[_0x81bb('0x35')],_0xfab3ae[_0x81bb('0x3c')]):0x0;};exports[_0x81bb('0x3d')]=function(_0x1799d9){return _0x1799d9===_0x81bb('0x3e');};exports[_0x81bb('0x3f')]=function(_0x1a12ac,_0xa1a41f,_0x48fdb0,_0xf6aa4c,_0x16505f){var _0x1368be=_0xf6aa4c?_0x81bb('0x40'):_0x1a12ac['calleridname'];_0x1368be=_0x16505f?_0x81bb('0x41'):_0x1368be;return{'actionid':_0x1a12ac['uniqueid'],'action':_0x81bb('0x42'),'channel':_0x1a12ac['channelAgent'],'callerid':util[_0x81bb('0x12')](_0x81bb('0x11'),_0x1368be,_0x1a12ac[_0x81bb('0x17')]),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x48fdb0,'timeout':(_0xa1a41f[_0x81bb('0x43')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1a12ac[_0x81bb('0x44')]};};exports[_0x81bb('0x45')]=function(_0xd1fc82){return _0xd1fc82[_0x81bb('0x46')]+_0xd1fc82[_0x81bb('0x47')]+_0xd1fc82[_0x81bb('0x48')];};exports['cloneAction']=function(_0x3fcd79){var _0x58a52f=_['clone'](_0x3fcd79);_0x58a52f['state']=0xf;_0x58a52f[_0x81bb('0x32')]=_0x81bb('0x49');return _0x58a52f;};exports[_0x81bb('0x4a')]=function(_0x29c211,_0x5c4b04,_0x26ed4a){var _0x1ad6de={};_0x1ad6de[_0x5c4b04]=_0x29c211[_0x5c4b04];_0x1ad6de[_0x81bb('0x4b')]=![];_0x1ad6de[_0x81bb('0x4c')]=moment()[_0x81bb('0x4d')](_0x26ed4a,_0x81bb('0x4e'))[_0x81bb('0x12')](_0x81bb('0x30'));_0x1ad6de[_0x81bb('0x18')]=_0x29c211['ContactId'];_0x1ad6de[_0x81bb('0x4f')]=_0x29c211[_0x81bb('0x4f')];_0x1ad6de['VoiceQueueId']=_0x29c211['VoiceQueueId']||undefined;return _0x1ad6de;};exports[_0x81bb('0x50')]=function(_0x1b847c,_0x2ce9c8){if(!_[_0x81bb('0x13')](_0x1b847c)){if(_0x1b847c[_0x81bb('0x51')]>0x0){_0x1b847c[_0x81bb('0x51')]-=0x1;}else{logger[_0x81bb('0x8')](_0x2ce9c8,_0x81bb('0x52'));}}else{logger[_0x81bb('0x8')](_0x2ce9c8,_0x81bb('0x53'));}};exports[_0x81bb('0x54')]=function(_0x369219){if(_0x369219<=0x0){return!![];}return![];};exports[_0x81bb('0x55')]=function(_0x4bc21b,_0x2c2d3b){_0x4bc21b[_0x81bb('0x56')]=_0x2c2d3b;_0x4bc21b['name']=_0x4bc21b[_0x81bb('0x57')];_0x4bc21b[_0x81bb('0x58')]=_0x4bc21b[_0x81bb('0x59')];return _0x4bc21b;};exports['buildAcw']=function(_0x28eb6a){var _0x54dea3={};_0x54dea3['queue']=_0x28eb6a[_0x81bb('0x57')];_0x54dea3[_0x81bb('0x58')]=_0x28eb6a[_0x81bb('0x59')];_0x54dea3[_0x81bb('0x44')]=_0x28eb6a[_0x81bb('0x44')];return _0x54dea3;};exports['agentReadyId']=function(_0x2f4c25){var _0x10721c=[];for(var _0x5e42e6 in _0x2f4c25){if(_0x2f4c25[_0x81bb('0x24')](_0x5e42e6)){if(!_[_0x81bb('0x13')](_0x2f4c25[_0x5e42e6])&&_0x2f4c25[_0x5e42e6][_0x81bb('0x31')]===_0x81bb('0x5a')&&_0x2f4c25[_0x5e42e6]['status']==='reachable'){_0x10721c[_0x81bb('0x5b')](_0x2f4c25[_0x5e42e6]['id']);}}}return _0x10721c;};exports[_0x81bb('0x5c')]=function(_0x13b860){var _0x63437=moment()[_0x81bb('0x5')](0x0);var _0x3b9c76=moment(_0x13b860)[_0x81bb('0x5')](0x0);return _0x63437[_0x81bb('0x6')](_0x3b9c76,_0x81bb('0x7'));};exports[_0x81bb('0x5d')]=function(_0x5480ed){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5480ed[_0x81bb('0x18')],'ListId':_0x5480ed[_0x81bb('0x4f')],'VoiceQueueId':_0x5480ed[_0x81bb('0x5e')]||undefined,'CampaignId':_0x5480ed['CampaignId']||undefined};};exports[_0x81bb('0x5f')]=function(_0x30dc40){if(_0x30dc40==='uniqueid'||_0x30dc40===_0x81bb('0x60')||_0x30dc40==='queue'||_0x30dc40===_0x81bb('0x61')||_0x30dc40==='campaigntype'||_0x30dc40===_0x81bb('0x62')||_0x30dc40==='membername'||_0x30dc40===_0x81bb('0x59')||_0x30dc40===_0x81bb('0x16')||_0x30dc40===_0x81bb('0x4b')||_0x30dc40==='calleridnum'||_0x30dc40===_0x81bb('0x4c')||_0x30dc40===_0x81bb('0x46')||_0x30dc40==='countcongestionretry'||_0x30dc40===_0x81bb('0x48')||_0x30dc40===_0x81bb('0x63')||_0x30dc40===_0x81bb('0x64')||_0x30dc40===_0x81bb('0x65')||_0x30dc40===_0x81bb('0x66')||_0x30dc40===_0x81bb('0x67')||_0x30dc40===_0x81bb('0x18')||_0x30dc40===_0x81bb('0x4f')||_0x30dc40==='UserId'||_0x30dc40===_0x81bb('0x5e')||_0x30dc40===_0x81bb('0x68')||_0x30dc40===_0x81bb('0x69')||_0x30dc40==='xmd-queue'||_0x30dc40===_0x81bb('0x6a')||_0x30dc40===_0x81bb('0x6b')||_0x30dc40===_0x81bb('0x6c')||_0x30dc40===_0x81bb('0x6d')||_0x30dc40===_0x81bb('0x6e')||_0x30dc40==='xmd-dialid'||_0x30dc40===_0x81bb('0x6f')||_0x30dc40===_0x81bb('0x70')||_0x30dc40===_0x81bb('0x71')||_0x30dc40===_0x81bb('0x72')||_0x30dc40===_0x81bb('0x73')||_0x30dc40===_0x81bb('0x74')||_0x30dc40===_0x81bb('0x75')||_0x30dc40===_0x81bb('0x76')||_0x30dc40==='rtpaudioqosjitter'||_0x30dc40===_0x81bb('0x77')||_0x30dc40===_0x81bb('0x78')||_0x30dc40===_0x81bb('0x79')||_0x30dc40===_0x81bb('0x7a')||_0x30dc40===_0x81bb('0x7b')||_0x30dc40===_0x81bb('0x75')||_0x30dc40===_0x81bb('0x76')||_0x30dc40===_0x81bb('0x7c')||_0x30dc40===_0x81bb('0x77')||_0x30dc40===_0x81bb('0x78')||_0x30dc40==='rtpaudioqoslossbridged'||_0x30dc40===_0x81bb('0x7a')||_0x30dc40==='rtpaudioqosrttbridged'||_0x30dc40===_0x81bb('0x7d')||_0x30dc40===_0x81bb('0x7e')||_0x30dc40==='state'||_0x30dc40===_0x81bb('0x32')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x57886d,_0x928583){var _0x213f84,_0x5a3246,_0x36f72d;if(_0x928583<=0x0){_0x928583=0x1;}_0x213f84=new RegExp(_0x81bb('0x7f')+_0x928583+'}$');_0x5a3246=Math[_0x81bb('0x80')](0xa,_0x928583-0x1);_0x36f72d=Math[_0x81bb('0x80')](0xa,_0x928583)-0x1;return util[_0x81bb('0x12')]('%s',_['replace'](_0x57886d,_0x213f84,_['random'](_0x5a3246,_0x36f72d)));};exports[_0x81bb('0x81')]=function(_0x20a401){var _0x285046=_0x20a401['match'](/"(.*?)"/);return _0x285046?_0x285046[0x1]:_0x20a401;};exports['extractCalleridNumber']=function(_0x417d60){var _0x5e3513=_0x417d60[_0x81bb('0x82')](/<(.*?)>/);return _0x5e3513?_0x5e3513[0x1]:_0x417d60;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index c062f6c..0aa37a8 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(_0x5b07ae,_0x5ef16f){var _0x1e9f93=function(_0x5b3ad4){while(--_0x5b3ad4){_0x5b07ae['push'](_0x5b07ae['shift']());}};_0x1e9f93(++_0x5ef16f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x62aed4,_0x2e2998){_0x62aed4=_0x62aed4-0x0;var _0x2ecfe8=_0x5f2f[_0x62aed4];return _0x2ecfe8;};'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 _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x4a71c,_0xcd060d){var _0x3ef6d9=function(_0x5d5228){while(--_0x5d5228){_0x4a71c['push'](_0x4a71c['shift']());}};_0x3ef6d9(++_0xcd060d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4b261e,_0x2eefb6){_0x4b261e=_0x4b261e-0x0;var _0x26763a=_0x5f2f[_0x4b261e];return _0x26763a;};'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 diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 1b1175b..a262322 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 _0xe7c8=['queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isUndefined','initTrunks','trunks','initVoiceQueues','initTriggers','initTemplates','templates','initZendeskAccounts','initSalesforceAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queue','queuecallerexit','unmanaged','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','sumDuration','queuecallercompleteAt','queuecallerexitAt','diff','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','initVoiceExtensions','initCampaignHopperHistory','exports','bluebird','lodash','moment','../model/agent','../model/telephone','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','triggers','campaigns','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','isNil','interface','total','answered','sumHoldTime','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay'];(function(_0x3b547e,_0x57def9){var _0x1cdc52=function(_0x440c26){while(--_0x440c26){_0x3b547e['push'](_0x3b547e['shift']());}};_0x1cdc52(++_0x57def9);}(_0xe7c8,0xfe));var _0x8e7c=function(_0x1158d5,_0x4e7ee8){_0x1158d5=_0x1158d5-0x0;var _0x3e9d61=_0xe7c8[_0x1158d5];return _0x3e9d61;};'use strict';var BPromise=require(_0x8e7c('0x0'));var util=require('util');var _=require(_0x8e7c('0x1'));var moment=require(_0x8e7c('0x2'));var Agent=require(_0x8e7c('0x3'));var Telephone=require(_0x8e7c('0x4'));var Trunk=require('../model/trunk');var VoiceQueue=require('../model/voiceQueue');var Trigger=require('../model/trigger');var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0x8e7c('0x5'));var ZendeskAccount=require(_0x8e7c('0x6'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x8e7c('0x7'));var SugarcrmAccount=require(_0x8e7c('0x8'));var ZohoAccount=require(_0x8e7c('0x9'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x8e7c('0xa'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x8e7c('0xb'));var Realtime=function(){this[_0x8e7c('0xc')]={};this[_0x8e7c('0xd')]={};this['trunks']={};this[_0x8e7c('0xe')]={};this[_0x8e7c('0xf')]={};this[_0x8e7c('0x10')]={};this['templates']={};this[_0x8e7c('0x11')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x8e7c('0x12')]={};this[_0x8e7c('0x13')]={};this[_0x8e7c('0x14')]={};this[_0x8e7c('0x15')]={};this[_0x8e7c('0x16')]={};this[_0x8e7c('0x17')]={};this[_0x8e7c('0x18')]={};this[_0x8e7c('0x19')]={};this[_0x8e7c('0x1a')]={};this[_0x8e7c('0x1b')]={};this['deskAccounts']={};this['vtigerAccounts']={};this[_0x8e7c('0x1c')]={};this[_0x8e7c('0x1d')]={};this[_0x8e7c('0x1e')]={};this[_0x8e7c('0x1f')]={};};function freeIsNotKey(_0x13d2d9,_0xb7956e,_0x382c34){var _0x4f1bad=_[_0x8e7c('0x20')](_0x13d2d9,function(_0x1f0f0c,_0x2b9125){return _0x1f0f0c[_0x382c34];});for(var _0x1b9f8b in _0xb7956e){if(_0xb7956e['hasOwnProperty'](_0x1b9f8b)){if(!_0x4f1bad[_0x1b9f8b]){delete _0xb7956e[_0x1b9f8b];}}}}function freeIsNotKeySip(_0x4ea75a,_0x39bd55){var _0x59c8f7=_[_0x8e7c('0x20')](_0x4ea75a,function(_0xf833fb,_0x55fa5c){return util[_0x8e7c('0x21')](_0x8e7c('0x22'),_0xf833fb[_0x8e7c('0x23')]);});for(var _0x437820 in _0x39bd55){if(_0x39bd55[_0x8e7c('0x24')](_0x437820)){if(!_0x59c8f7[_0x437820]){delete _0x39bd55[_0x437820];}}}}function freeIsNotKeyAgent(_0x2fa268,_0x2ba63b){var _0x7c175f=_[_0x8e7c('0x20')](_0x2fa268,function(_0x4eaade,_0x3b7fa1){var _0x4b5a3a=_[_0x8e7c('0x25')](_0x4eaade[_0x8e7c('0x26')])?util[_0x8e7c('0x21')](_0x8e7c('0x22'),_0x4eaade[_0x8e7c('0x23')]):_0x4eaade[_0x8e7c('0x26')];return _0x4b5a3a;});for(var _0x267f76 in _0x2ba63b){if(_0x2ba63b[_0x8e7c('0x24')](_0x267f76)){if(!_0x7c175f[_0x267f76]){delete _0x2ba63b[_0x267f76];}}}}function clearVoiceCallReports(_0x4a1460){_0x4a1460[_0x8e7c('0x27')]=0x0;_0x4a1460[_0x8e7c('0x28')]=0x0;_0x4a1460[_0x8e7c('0x29')]=0x0;_0x4a1460['sumDuration']=0x0;_0x4a1460[_0x8e7c('0x2a')]=0x0;}function clearCampaigns(_0x15e23f){if(!_[_0x8e7c('0x2b')](_0x15e23f)){for(var _0x1f752c in _0x15e23f){if(_0x15e23f[_0x8e7c('0x24')](_0x1f752c)){_0x15e23f[_0x1f752c][_0x8e7c('0x2c')]=0x0;_0x15e23f[_0x1f752c][_0x8e7c('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x58aaa2){if(!_[_0x8e7c('0x2b')](_0x58aaa2)){for(var _0x52bd4f in _0x58aaa2){if(_0x58aaa2['hasOwnProperty'](_0x52bd4f)){_0x58aaa2[_0x52bd4f][_0x8e7c('0x27')]=0x0;_0x58aaa2[_0x52bd4f][_0x8e7c('0x28')]=0x0;_0x58aaa2[_0x52bd4f]['unmanaged']=0x0;_0x58aaa2[_0x52bd4f][_0x8e7c('0x2e')]=0x0;_0x58aaa2[_0x52bd4f][_0x8e7c('0x29')]=0x0;_0x58aaa2[_0x52bd4f]['sumDuration']=0x0;_0x58aaa2[_0x52bd4f][_0x8e7c('0x2a')]=0x0;_0x58aaa2[_0x52bd4f][_0x8e7c('0x2f')]=0x0;_0x58aaa2[_0x52bd4f][_0x8e7c('0x30')]=0x0;_0x58aaa2[_0x52bd4f][_0x8e7c('0x31')]=0x0;_0x58aaa2[_0x52bd4f][_0x8e7c('0x32')]=0x0;_0x58aaa2[_0x52bd4f]['outboundNoSuchCallsDay']=0x0;_0x58aaa2[_0x52bd4f]['outboundUnknownCallsDay']=0x0;_0x58aaa2[_0x52bd4f][_0x8e7c('0x33')]=0x0;_0x58aaa2[_0x52bd4f][_0x8e7c('0x34')]=0x0;_0x58aaa2[_0x52bd4f][_0x8e7c('0x35')]=0x0;_0x58aaa2[_0x52bd4f][_0x8e7c('0x36')]=0x0;_0x58aaa2[_0x52bd4f][_0x8e7c('0x37')]=0x0;_0x58aaa2[_0x52bd4f][_0x8e7c('0x38')]=0x0;_0x58aaa2[_0x52bd4f][_0x8e7c('0x2f')]=0x0;_0x58aaa2[_0x52bd4f][_0x8e7c('0x39')]=0x0;_0x58aaa2[_0x52bd4f][_0x8e7c('0x3a')]=!![];}}}}Realtime['prototype'][_0x8e7c('0x3b')]=function(_0x13f4c2,_0x5ba44e){for(var _0x16c3dc in _0x5ba44e){if(_0x13f4c2[_0x8e7c('0x24')](_0x16c3dc)){_0x13f4c2[_0x16c3dc]=_0x5ba44e[_0x16c3dc];}}};Realtime[_0x8e7c('0x3c')][_0x8e7c('0x3d')]=function(){var _0x4ee51b=this;return function(_0x567a93){if(_0x567a93){freeIsNotKeyAgent(_0x567a93,_0x4ee51b[_0x8e7c('0xc')]);for(var _0x4ca12b=0x0,_0x13b8bd={},_0x320cfa={};_0x4ca12b<_0x567a93[_0x8e7c('0x3e')];_0x4ca12b+=0x1){_0x13b8bd=_0x567a93[_0x4ca12b];var _0xa4201a=_[_0x8e7c('0x25')](_0x13b8bd[_0x8e7c('0x26')])?util[_0x8e7c('0x21')](_0x8e7c('0x22'),_0x13b8bd[_0x8e7c('0x23')]):_0x13b8bd[_0x8e7c('0x26')];if(_['isUndefined'](_0x4ee51b[_0x8e7c('0xc')][_0xa4201a])){_0x4ee51b[_0x8e7c('0xc')][_0xa4201a]=new Agent(_0x13b8bd);}else{_0x4ee51b['mergeFromDatabase'](_0x4ee51b[_0x8e7c('0xc')][_0xa4201a],_0x13b8bd);}}}return _0x4ee51b[_0x8e7c('0xc')];};};Realtime[_0x8e7c('0x3c')]['initTelephones']=function(){var _0x4ba60f=this;return function(_0x164031){if(_0x164031){freeIsNotKeySip(_0x164031,_0x4ba60f['telephones']);for(var _0x4e71ae=0x0,_0x6bc1b9={},_0x3b1226={};_0x4e71ae<_0x164031['length'];_0x4e71ae+=0x1){_0x6bc1b9=_0x164031[_0x4e71ae];if(_[_0x8e7c('0x3f')](_0x4ba60f[_0x8e7c('0xd')][util['format'](_0x8e7c('0x22'),_0x6bc1b9[_0x8e7c('0x23')])])){_0x4ba60f['telephones'][util['format']('SIP/%s',_0x6bc1b9['name'])]=new Telephone(_0x6bc1b9);}else{_0x4ba60f[_0x8e7c('0x3b')](_0x4ba60f[_0x8e7c('0xd')][util[_0x8e7c('0x21')]('SIP/%s',_0x6bc1b9['name'])],_0x6bc1b9);}}}return _0x4ba60f['telephones'];};};Realtime[_0x8e7c('0x3c')][_0x8e7c('0x40')]=function(){var _0x17aae2=this;return function(_0x59423c){if(_0x59423c){freeIsNotKeySip(_0x59423c,_0x17aae2[_0x8e7c('0x41')]);for(var _0x440a81=0x0,_0xbaa689={},_0x3d0c53={};_0x440a81<_0x59423c[_0x8e7c('0x3e')];_0x440a81+=0x1){_0xbaa689=_0x59423c[_0x440a81];if(_[_0x8e7c('0x3f')](_0x17aae2[_0x8e7c('0x41')][util[_0x8e7c('0x21')](_0x8e7c('0x22'),_0xbaa689[_0x8e7c('0x23')])])){_0x17aae2[_0x8e7c('0x41')][util[_0x8e7c('0x21')]('SIP/%s',_0xbaa689[_0x8e7c('0x23')])]=new Trunk(_0xbaa689);}else{_0x17aae2['mergeFromDatabase'](_0x17aae2[_0x8e7c('0x41')][util[_0x8e7c('0x21')]('SIP/%s',_0xbaa689[_0x8e7c('0x23')])],_0xbaa689);}}}return _0x17aae2[_0x8e7c('0x41')];};};Realtime[_0x8e7c('0x3c')][_0x8e7c('0x42')]=function(){var _0xe79c87=this;return function(_0x40331f){if(_0x40331f){freeIsNotKey(_0x40331f,_0xe79c87[_0x8e7c('0xe')],_0x8e7c('0x23'));for(var _0x484841=0x0,_0x416956={},_0x2014c1={};_0x484841<_0x40331f['length'];_0x484841+=0x1){_0x416956=_0x40331f[_0x484841];if(_[_0x8e7c('0x3f')](_0xe79c87[_0x8e7c('0xe')][_0x416956[_0x8e7c('0x23')]])){_0xe79c87[_0x8e7c('0xe')][_0x416956[_0x8e7c('0x23')]]=new VoiceQueue(_0x416956);}else{_0xe79c87[_0x8e7c('0x3b')](_0xe79c87[_0x8e7c('0xe')][_0x416956[_0x8e7c('0x23')]],_0x416956);}}}return _0xe79c87[_0x8e7c('0xe')];};};Realtime[_0x8e7c('0x3c')][_0x8e7c('0x43')]=function(){var _0x14e235=this;return function(_0x10f0e7){if(_0x10f0e7){freeIsNotKey(_0x10f0e7,_0x14e235[_0x8e7c('0xf')],'id');for(var _0x502b6c=0x0,_0x4fc30d={},_0x117263={};_0x502b6c<_0x10f0e7[_0x8e7c('0x3e')];_0x502b6c+=0x1){_0x4fc30d=_0x10f0e7[_0x502b6c];if(_[_0x8e7c('0x3f')](_0x14e235[_0x8e7c('0xf')][_0x4fc30d['id']])){_0x14e235[_0x8e7c('0xf')][_0x4fc30d['id']]=new Trigger(_0x4fc30d);}else{_0x14e235[_0x8e7c('0x3b')](_0x14e235[_0x8e7c('0xf')][_0x4fc30d['id']],_0x4fc30d);}}}return _0x14e235[_0x8e7c('0xf')];};};Realtime[_0x8e7c('0x3c')][_0x8e7c('0x44')]=function(){var _0x27a310=this;return function(_0x2e8258){if(_0x2e8258){freeIsNotKey(_0x2e8258,_0x27a310['templates'],'id');for(var _0x1329c6=0x0,_0x1b7997={},_0x593ddd={};_0x1329c6<_0x2e8258[_0x8e7c('0x3e')];_0x1329c6+=0x1){_0x1b7997=_0x2e8258[_0x1329c6];if(_['isUndefined'](_0x27a310[_0x8e7c('0x45')][_0x1b7997['id']])){_0x27a310[_0x8e7c('0x45')][_0x1b7997['id']]=new Template(_0x1b7997);}else{_0x27a310[_0x8e7c('0x3b')](_0x27a310[_0x8e7c('0x45')][_0x1b7997['id']],_0x1b7997);}}}return _0x27a310[_0x8e7c('0x45')];};};Realtime['prototype'][_0x8e7c('0x46')]=function(){var _0x359019=this;return function(_0x392d52){if(_0x392d52){freeIsNotKey(_0x392d52,_0x359019['zendeskAccounts'],'id');for(var _0x431f98=0x0,_0x229f77={},_0x59accd={};_0x431f98<_0x392d52[_0x8e7c('0x3e')];_0x431f98+=0x1){_0x229f77=_0x392d52[_0x431f98];if(_['isUndefined'](_0x359019[_0x8e7c('0x17')][_0x229f77['id']])){_0x359019['zendeskAccounts'][_0x229f77['id']]=new ZendeskAccount(_0x229f77);}else{_0x359019[_0x8e7c('0x3b')](_0x359019[_0x8e7c('0x17')][_0x229f77['id']],_0x229f77);}}}return _0x359019['zendeskAccounts'];};};Realtime[_0x8e7c('0x3c')][_0x8e7c('0x47')]=function(){var _0x44ebf5=this;return function(_0x10906c){if(_0x10906c){freeIsNotKey(_0x10906c,_0x44ebf5['salesforceAccounts'],'id');for(var _0x3fe9e5=0x0,_0x44a5c7={},_0x13fddb={};_0x3fe9e5<_0x10906c['length'];_0x3fe9e5+=0x1){_0x44a5c7=_0x10906c[_0x3fe9e5];if(_[_0x8e7c('0x3f')](_0x44ebf5[_0x8e7c('0x18')][_0x44a5c7['id']])){_0x44ebf5['salesforceAccounts'][_0x44a5c7['id']]=new SalesforceAccount(_0x44a5c7);}else{_0x44ebf5[_0x8e7c('0x3b')](_0x44ebf5[_0x8e7c('0x18')][_0x44a5c7['id']],_0x44a5c7);}}}return _0x44ebf5[_0x8e7c('0x18')];};};Realtime[_0x8e7c('0x3c')]['initFreshdeskAccounts']=function(){var _0x18d7d1=this;return function(_0x4526a8){if(_0x4526a8){freeIsNotKey(_0x4526a8,_0x18d7d1['freshdeskAccounts'],'id');for(var _0x14bd45=0x0,_0x59df22={},_0x1c6f8a={};_0x14bd45<_0x4526a8[_0x8e7c('0x3e')];_0x14bd45+=0x1){_0x59df22=_0x4526a8[_0x14bd45];if(_[_0x8e7c('0x3f')](_0x18d7d1['freshdeskAccounts'][_0x59df22['id']])){_0x18d7d1['freshdeskAccounts'][_0x59df22['id']]=new FreshdeskAccount(_0x59df22);}else{_0x18d7d1[_0x8e7c('0x3b')](_0x18d7d1[_0x8e7c('0x1a')][_0x59df22['id']],_0x59df22);}}}return _0x18d7d1[_0x8e7c('0x1a')];};};Realtime['prototype'][_0x8e7c('0x48')]=function(){var _0x261296=this;return function(_0x1d37cc){if(_0x1d37cc){freeIsNotKey(_0x1d37cc,_0x261296[_0x8e7c('0x1b')],'id');for(var _0x4c992e=0x0,_0x47756f={},_0xecefef={};_0x4c992e<_0x1d37cc[_0x8e7c('0x3e')];_0x4c992e+=0x1){_0x47756f=_0x1d37cc[_0x4c992e];if(_['isUndefined'](_0x261296[_0x8e7c('0x1b')][_0x47756f['id']])){_0x261296[_0x8e7c('0x1b')][_0x47756f['id']]=new ZohoAccount(_0x47756f);}else{_0x261296[_0x8e7c('0x3b')](_0x261296['zohoAccounts'][_0x47756f['id']],_0x47756f);}}}return _0x261296[_0x8e7c('0x1b')];};};Realtime['prototype'][_0x8e7c('0x49')]=function(){var _0x2ca490=this;return function(_0x150b93){if(_0x150b93){freeIsNotKey(_0x150b93,_0x2ca490[_0x8e7c('0x4a')],'id');for(var _0x1e3870=0x0,_0x50f960={},_0x229720={};_0x1e3870<_0x150b93[_0x8e7c('0x3e')];_0x1e3870+=0x1){_0x50f960=_0x150b93[_0x1e3870];if(_[_0x8e7c('0x3f')](_0x2ca490[_0x8e7c('0x4a')][_0x50f960['id']])){_0x2ca490[_0x8e7c('0x4a')][_0x50f960['id']]=new DeskAccount(_0x50f960);}else{_0x2ca490[_0x8e7c('0x3b')](_0x2ca490['deskAccounts'][_0x50f960['id']],_0x50f960);}}}return _0x2ca490[_0x8e7c('0x4a')];};};Realtime[_0x8e7c('0x3c')][_0x8e7c('0x4b')]=function(){var _0x220761=this;return function(_0x25768a){if(_0x25768a){freeIsNotKey(_0x25768a,_0x220761[_0x8e7c('0x19')],'id');for(var _0x49099b=0x0,_0x1239b1={},_0x25cc1c={};_0x49099b<_0x25768a[_0x8e7c('0x3e')];_0x49099b+=0x1){_0x1239b1=_0x25768a[_0x49099b];if(_[_0x8e7c('0x3f')](_0x220761['sugarcrmAccounts'][_0x1239b1['id']])){_0x220761[_0x8e7c('0x19')][_0x1239b1['id']]=new SugarcrmAccount(_0x1239b1);}else{_0x220761[_0x8e7c('0x3b')](_0x220761[_0x8e7c('0x19')][_0x1239b1['id']],_0x1239b1);}}}return _0x220761['sugarcrmAccounts'];};};Realtime[_0x8e7c('0x3c')][_0x8e7c('0x4c')]=function(){var _0x222173=this;return function(_0x1c42d1){if(_0x1c42d1){freeIsNotKey(_0x1c42d1,_0x222173[_0x8e7c('0x4d')],'id');for(var _0xe1c487=0x0,_0x5550fb={},_0x5f2764={};_0xe1c487<_0x1c42d1[_0x8e7c('0x3e')];_0xe1c487+=0x1){_0x5550fb=_0x1c42d1[_0xe1c487];if(_[_0x8e7c('0x3f')](_0x222173[_0x8e7c('0x4d')][_0x5550fb['id']])){_0x222173['vtigerAccounts'][_0x5550fb['id']]=new VtigerAccount(_0x5550fb);}else{_0x222173[_0x8e7c('0x3b')](_0x222173['vtigerAccounts'][_0x5550fb['id']],_0x5550fb);}}}return _0x222173['vtigerAccounts'];};};Realtime[_0x8e7c('0x3c')][_0x8e7c('0x4e')]=function(){var _0x540983=this;return function(_0x52216c){if(_0x52216c){freeIsNotKey(_0x52216c,_0x540983[_0x8e7c('0x1c')],'id');for(var _0x8720b2=0x0,_0x376b05={},_0x1dd1f7={};_0x8720b2<_0x52216c['length'];_0x8720b2+=0x1){_0x376b05=_0x52216c[_0x8720b2];if(_[_0x8e7c('0x3f')](_0x540983[_0x8e7c('0x1c')][_0x376b05['id']])){_0x540983[_0x8e7c('0x1c')][_0x376b05['id']]=new ServicenowAccount(_0x376b05);}else{_0x540983[_0x8e7c('0x3b')](_0x540983[_0x8e7c('0x1c')][_0x376b05['id']],_0x376b05);}}}return _0x540983[_0x8e7c('0x1c')];};};Realtime[_0x8e7c('0x3c')]['initDynamics365Accounts']=function(){var _0x1669e7=this;return function(_0x565992){if(_0x565992){freeIsNotKey(_0x565992,_0x1669e7[_0x8e7c('0x1d')],'id');for(var _0x3afa7e=0x0,_0x3407c3={},_0x1958c4={};_0x3afa7e<_0x565992[_0x8e7c('0x3e')];_0x3afa7e+=0x1){_0x3407c3=_0x565992[_0x3afa7e];if(_[_0x8e7c('0x3f')](_0x1669e7['dynamics365Accounts'][_0x3407c3['id']])){_0x1669e7[_0x8e7c('0x1d')][_0x3407c3['id']]=new Dynamics365Account(_0x3407c3);}else{_0x1669e7[_0x8e7c('0x3b')](_0x1669e7['dynamics365Accounts'][_0x3407c3['id']],_0x3407c3);}}}return _0x1669e7[_0x8e7c('0x1d')];};};Realtime[_0x8e7c('0x3c')][_0x8e7c('0x4f')]=function(){var _0x118b8c=this;return function(_0x4b380b){if(_0x4b380b){freeIsNotKey(_0x4b380b,_0x118b8c[_0x8e7c('0x1e')],'id');for(var _0x44ebb4=0x0,_0x43e3d6={},_0x126ffa={};_0x44ebb4<_0x4b380b['length'];_0x44ebb4+=0x1){_0x43e3d6=_0x4b380b[_0x44ebb4];if(_[_0x8e7c('0x3f')](_0x118b8c[_0x8e7c('0x1e')][_0x43e3d6['id']])){_0x118b8c[_0x8e7c('0x1e')][_0x43e3d6['id']]=new FreshsalesAccount(_0x43e3d6);}else{_0x118b8c[_0x8e7c('0x3b')](_0x118b8c['freshsalesAccounts'][_0x43e3d6['id']],_0x43e3d6);}}}return _0x118b8c[_0x8e7c('0x1e')];};};Realtime[_0x8e7c('0x3c')][_0x8e7c('0x50')]=function(){var _0x4275fb=this;return function(_0x3d5ce3){for(var _0xf58cd6=0x0;_0xf58cd6<_0x3d5ce3[_0x8e7c('0x3e')];_0xf58cd6+=0x1){_[_0x8e7c('0x51')](_0x4275fb['voiceQueues'][_0x3d5ce3[_0xf58cd6][_0x8e7c('0x23')]],_0x3d5ce3[_0xf58cd6]);}return _0x4275fb[_0x8e7c('0xe')];};};Realtime[_0x8e7c('0x3c')]['initVoiceQueueReports']=function(){var _0x247163=this;return function(_0x2912b8){clearVoiceQueues(_0x247163[_0x8e7c('0xe')]);if(_0x2912b8){_0x2912b8=_[_0x8e7c('0x52')](_0x2912b8,_0x8e7c('0x53'));for(var _0xfb4f51 in _0x2912b8){if(_0x2912b8[_0x8e7c('0x24')](_0xfb4f51)){var _0x4387d2={};for(var _0x1df3cc=0x0;_0x1df3cc<_0x2912b8[_0xfb4f51][_0x8e7c('0x3e')];_0x1df3cc+=0x1){var _0x2d182b=_0x2912b8[_0xfb4f51][_0x1df3cc][_0x8e7c('0x54')];if(_0x247163[_0x8e7c('0xe')][_0x2d182b]){if(_0x2912b8[_0xfb4f51][_0x1df3cc][_0x8e7c('0x55')]){_0x247163[_0x8e7c('0xe')][_0x2d182b][_0x8e7c('0x56')]+=0x1;}if(_0x2912b8[_0xfb4f51][_0x1df3cc][_0x8e7c('0x57')]){_0x247163[_0x8e7c('0xe')][_0x2d182b][_0x8e7c('0x2e')]+=0x1;}_0x247163[_0x8e7c('0xe')][_0x2d182b][_0x8e7c('0x29')]+=moment(_0x2912b8[_0xfb4f51][_0x1df3cc][_0x8e7c('0x58')])['diff'](moment(_0x2912b8[_0xfb4f51][_0x1df3cc][_0x8e7c('0x59')]),'seconds')||0x0;if(_0x1df3cc===_0x2912b8[_0xfb4f51][_0x8e7c('0x3e')]-0x1){_0x247163[_0x8e7c('0xe')][_0x2d182b][_0x8e7c('0x5a')]+=moment(_0x2912b8[_0xfb4f51][_0x1df3cc][_0x8e7c('0x5b')]||_0x2912b8[_0xfb4f51][_0x1df3cc]['queuecallerabandonAt']||_0x2912b8[_0xfb4f51][_0x1df3cc][_0x8e7c('0x5c')])[_0x8e7c('0x5d')](moment(_0x2912b8[_0xfb4f51][_0x1df3cc]['queuecallerjoinAt']),'seconds')||0x0;_0x247163[_0x8e7c('0xe')][_0x2d182b][_0x8e7c('0x27')]+=0x1;if(_0x2912b8[_0xfb4f51][_0x1df3cc][_0x8e7c('0x5e')]){_0x247163['voiceQueues'][_0x2d182b][_0x8e7c('0x28')]+=0x1;_0x247163[_0x8e7c('0xe')][_0x2d182b][_0x8e7c('0x2a')]+=moment(_0x2912b8[_0xfb4f51][_0x1df3cc][_0x8e7c('0x5b')])['diff'](moment(_0x2912b8[_0xfb4f51][_0x1df3cc][_0x8e7c('0x58')]),'seconds')||0x0;}}else{_0x247163[_0x8e7c('0xe')][_0x2d182b][_0x8e7c('0x5a')]+=_0x247163[_0x8e7c('0xe')][_0x2d182b][_0x8e7c('0x29')]||0x0;}}}}}}return _0x247163[_0x8e7c('0xe')];};};Realtime[_0x8e7c('0x3c')][_0x8e7c('0x5f')]=function(){var _0x5431db=this;return function(_0x5291cb){clearVoiceCallReports(_0x5431db[_0x8e7c('0x11')]);if(_0x5291cb){for(var _0x4c6622=0x0;_0x4c6622<_0x5291cb[_0x8e7c('0x3e')];_0x4c6622+=0x1){_0x5431db['outbound'][_0x8e7c('0x27')]+=0x1;_0x5431db[_0x8e7c('0x11')][_0x8e7c('0x5a')]+=_0x5291cb[_0x4c6622][_0x8e7c('0x60')];if(_0x5291cb[_0x4c6622][_0x8e7c('0x61')]===_0x8e7c('0x62')){_0x5431db[_0x8e7c('0x11')][_0x8e7c('0x28')]+=0x1;_0x5431db['outbound'][_0x8e7c('0x29')]+=_0x5291cb[_0x4c6622][_0x8e7c('0x60')]-_0x5291cb[_0x4c6622][_0x8e7c('0x63')]||0x0;_0x5431db[_0x8e7c('0x11')][_0x8e7c('0x2a')]+=_0x5291cb[_0x4c6622]['billableseconds'];}}}return _0x5431db[_0x8e7c('0x11')];};};Realtime[_0x8e7c('0x3c')][_0x8e7c('0x64')]=function(){var _0x2f0ab8=this;return function(_0x5b2b70){if(_0x5b2b70){freeIsNotKey(_0x5b2b70,_0x2f0ab8[_0x8e7c('0x10')],_0x8e7c('0x23'));for(var _0x233e19=0x0,_0x19d962={};_0x233e19<_0x5b2b70[_0x8e7c('0x3e')];_0x233e19+=0x1){_0x19d962=_0x5b2b70[_0x233e19];if(_[_0x8e7c('0x3f')](_0x2f0ab8[_0x8e7c('0x10')][_0x19d962[_0x8e7c('0x23')]])){_0x2f0ab8[_0x8e7c('0x10')][_0x19d962['name']]=new Campaign(_0x19d962);}else{_0x2f0ab8[_0x8e7c('0x3b')](_0x2f0ab8[_0x8e7c('0x10')][_0x19d962[_0x8e7c('0x23')]],_0x19d962);}}}return _0x2f0ab8[_0x8e7c('0x10')];};};Realtime['prototype'][_0x8e7c('0x65')]=function(){var _0x15bb87=this;return function(_0x2eebd8){if(_0x2eebd8){freeIsNotKey(_0x2eebd8,_0x15bb87[_0x8e7c('0x12')],'id');for(var _0x48c086=0x0,_0x26b383={};_0x48c086<_0x2eebd8[_0x8e7c('0x3e')];_0x48c086+=0x1){_0x26b383=_0x2eebd8[_0x48c086];if(_['isUndefined'](_0x15bb87[_0x8e7c('0x12')][_0x26b383['id']])){_0x15bb87[_0x8e7c('0x12')][_0x26b383['id']]=new VoiceExtension(_0x26b383);}else{_0x15bb87[_0x8e7c('0x3b')](_0x15bb87[_0x8e7c('0x12')][_0x26b383['id']],_0x26b383);}}}return _0x15bb87[_0x8e7c('0x12')];};};Realtime[_0x8e7c('0x3c')][_0x8e7c('0x66')]=function(){var _0x3654db=this;return function(_0x3d7c10){clearCampaigns(_0x3654db[_0x8e7c('0x10')]);for(var _0x401231=0x0;_0x401231<_0x3d7c10[_0x8e7c('0x3e')];_0x401231+=0x1){_[_0x8e7c('0x51')](_0x3654db[_0x8e7c('0x10')][_0x3d7c10[_0x401231]['name']],_0x3d7c10[_0x401231]);}return _0x3654db[_0x8e7c('0x10')];};};Realtime[_0x8e7c('0x3c')]['initFaxAccounts']=function(){var _0x300fc4=this;return function(_0x53b1d3){if(_0x53b1d3){freeIsNotKey(_0x53b1d3,_0x300fc4[_0x8e7c('0x1f')],'id');for(var _0x127b6=0x0,_0x4893e3={},_0x28ee8a={};_0x127b6<_0x53b1d3[_0x8e7c('0x3e')];_0x127b6+=0x1){_0x4893e3=_0x53b1d3[_0x127b6];if(_[_0x8e7c('0x3f')](_0x300fc4['faxAccounts'][_0x4893e3['id']])){_0x300fc4['faxAccounts'][_0x4893e3['id']]=new FaxAccount(_0x4893e3);}else{_0x300fc4[_0x8e7c('0x3b')](_0x300fc4[_0x8e7c('0x1f')][_0x4893e3['id']],_0x4893e3);}}}return _0x300fc4[_0x8e7c('0x1f')];};};module[_0x8e7c('0x67')]=Realtime; \ No newline at end of file +var _0x442f=['queueStatusComplete','prototype','initAgents','length','isUndefined','mergeFromDatabase','initTelephones','initTrunks','trunks','initVoiceQueues','initTemplates','templates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','outbound','ANSWERED','duration','billableseconds','initCampaigns','initVoiceExtensions','initFaxAccounts','exports','bluebird','util','lodash','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','voiceQueues','triggers','campaigns','voiceExtensions','channels','queueChannels','timers','zendeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','isNil','interface','total','answered','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x442f,0x111));var _0xf442=function(_0x190897,_0x5820d4){_0x190897=_0x190897-0x0;var _0x556c7d=_0x442f[_0x190897];return _0x556c7d;};'use strict';var BPromise=require(_0xf442('0x0'));var util=require(_0xf442('0x1'));var _=require(_0xf442('0x2'));var moment=require('moment');var Agent=require(_0xf442('0x3'));var Telephone=require(_0xf442('0x4'));var Trunk=require(_0xf442('0x5'));var VoiceQueue=require(_0xf442('0x6'));var Trigger=require(_0xf442('0x7'));var Template=require(_0xf442('0x8'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0xf442('0x9'));var ZendeskAccount=require(_0xf442('0xa'));var SalesforceAccount=require(_0xf442('0xb'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0xf442('0xc'));var ZohoAccount=require(_0xf442('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xf442('0xe'));var ServicenowAccount=require(_0xf442('0xf'));var Dynamics365Account=require(_0xf442('0x10'));var FreshsalesAccount=require(_0xf442('0x11'));var FaxAccount=require(_0xf442('0x12'));var Realtime=function(){this[_0xf442('0x13')]={};this[_0xf442('0x14')]={};this['trunks']={};this[_0xf442('0x15')]={};this[_0xf442('0x16')]={};this[_0xf442('0x17')]={};this['templates']={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xf442('0x18')]={};this[_0xf442('0x19')]={};this[_0xf442('0x1a')]={};this['outboundChannels']={};this[_0xf442('0x1b')]={};this[_0xf442('0x1c')]={};this['salesforceAccounts']={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this[_0xf442('0x1d')]={};this[_0xf442('0x1e')]={};this['vtigerAccounts']={};this[_0xf442('0x1f')]={};this[_0xf442('0x20')]={};this[_0xf442('0x21')]={};this[_0xf442('0x22')]={};};function freeIsNotKey(_0x2dc76b,_0x147efa,_0x308e26){var _0x3ec2cc=_[_0xf442('0x23')](_0x2dc76b,function(_0x2b0057,_0x1a88b1){return _0x2b0057[_0x308e26];});for(var _0x28e8df in _0x147efa){if(_0x147efa['hasOwnProperty'](_0x28e8df)){if(!_0x3ec2cc[_0x28e8df]){delete _0x147efa[_0x28e8df];}}}}function freeIsNotKeySip(_0x4a2521,_0x3b01e7){var _0x48045e=_['mapKeys'](_0x4a2521,function(_0x42b18f,_0x14ef2c){return util[_0xf442('0x24')](_0xf442('0x25'),_0x42b18f[_0xf442('0x26')]);});for(var _0x46ff11 in _0x3b01e7){if(_0x3b01e7[_0xf442('0x27')](_0x46ff11)){if(!_0x48045e[_0x46ff11]){delete _0x3b01e7[_0x46ff11];}}}}function freeIsNotKeyAgent(_0x26a596,_0x34757a){var _0x2af451=_[_0xf442('0x23')](_0x26a596,function(_0x55bf9f,_0x20771d){var _0xf41c06=_[_0xf442('0x28')](_0x55bf9f['interface'])?util['format'](_0xf442('0x25'),_0x55bf9f[_0xf442('0x26')]):_0x55bf9f[_0xf442('0x29')];return _0xf41c06;});for(var _0x790ef in _0x34757a){if(_0x34757a[_0xf442('0x27')](_0x790ef)){if(!_0x2af451[_0x790ef]){delete _0x34757a[_0x790ef];}}}}function clearVoiceCallReports(_0x117c96){_0x117c96[_0xf442('0x2a')]=0x0;_0x117c96[_0xf442('0x2b')]=0x0;_0x117c96['sumHoldTime']=0x0;_0x117c96[_0xf442('0x2c')]=0x0;_0x117c96[_0xf442('0x2d')]=0x0;}function clearCampaigns(_0xa6ba42){if(!_[_0xf442('0x2e')](_0xa6ba42)){for(var _0x147864 in _0xa6ba42){if(_0xa6ba42[_0xf442('0x27')](_0x147864)){_0xa6ba42[_0x147864][_0xf442('0x2f')]=0x0;_0xa6ba42[_0x147864][_0xf442('0x30')]=0x0;}}}}function clearVoiceQueues(_0x2c703e){if(!_[_0xf442('0x2e')](_0x2c703e)){for(var _0x4fa333 in _0x2c703e){if(_0x2c703e['hasOwnProperty'](_0x4fa333)){_0x2c703e[_0x4fa333][_0xf442('0x2a')]=0x0;_0x2c703e[_0x4fa333][_0xf442('0x2b')]=0x0;_0x2c703e[_0x4fa333][_0xf442('0x31')]=0x0;_0x2c703e[_0x4fa333][_0xf442('0x32')]=0x0;_0x2c703e[_0x4fa333][_0xf442('0x33')]=0x0;_0x2c703e[_0x4fa333][_0xf442('0x2c')]=0x0;_0x2c703e[_0x4fa333][_0xf442('0x2d')]=0x0;_0x2c703e[_0x4fa333][_0xf442('0x34')]=0x0;_0x2c703e[_0x4fa333][_0xf442('0x35')]=0x0;_0x2c703e[_0x4fa333][_0xf442('0x36')]=0x0;_0x2c703e[_0x4fa333][_0xf442('0x37')]=0x0;_0x2c703e[_0x4fa333][_0xf442('0x38')]=0x0;_0x2c703e[_0x4fa333]['outboundUnknownCallsDay']=0x0;_0x2c703e[_0x4fa333][_0xf442('0x39')]=0x0;_0x2c703e[_0x4fa333][_0xf442('0x3a')]=0x0;_0x2c703e[_0x4fa333][_0xf442('0x3b')]=0x0;_0x2c703e[_0x4fa333][_0xf442('0x3c')]=0x0;_0x2c703e[_0x4fa333][_0xf442('0x3d')]=0x0;_0x2c703e[_0x4fa333]['outboundReCallsDay']=0x0;_0x2c703e[_0x4fa333][_0xf442('0x34')]=0x0;_0x2c703e[_0x4fa333][_0xf442('0x3e')]=0x0;_0x2c703e[_0x4fa333][_0xf442('0x3f')]=!![];}}}}Realtime[_0xf442('0x40')]['mergeFromDatabase']=function(_0x54d816,_0x1a92ac){for(var _0x925a91 in _0x1a92ac){if(_0x54d816[_0xf442('0x27')](_0x925a91)){_0x54d816[_0x925a91]=_0x1a92ac[_0x925a91];}}};Realtime[_0xf442('0x40')][_0xf442('0x41')]=function(){var _0x1c8cb1=this;return function(_0xab680f){if(_0xab680f){freeIsNotKeyAgent(_0xab680f,_0x1c8cb1[_0xf442('0x13')]);for(var _0x15b707=0x0,_0x5b74b3={},_0x4c2f0a={};_0x15b707<_0xab680f[_0xf442('0x42')];_0x15b707+=0x1){_0x5b74b3=_0xab680f[_0x15b707];var _0x2235bd=_[_0xf442('0x28')](_0x5b74b3[_0xf442('0x29')])?util[_0xf442('0x24')](_0xf442('0x25'),_0x5b74b3['name']):_0x5b74b3['interface'];if(_[_0xf442('0x43')](_0x1c8cb1[_0xf442('0x13')][_0x2235bd])){_0x1c8cb1[_0xf442('0x13')][_0x2235bd]=new Agent(_0x5b74b3);}else{_0x1c8cb1[_0xf442('0x44')](_0x1c8cb1[_0xf442('0x13')][_0x2235bd],_0x5b74b3);}}}return _0x1c8cb1[_0xf442('0x13')];};};Realtime[_0xf442('0x40')][_0xf442('0x45')]=function(){var _0x321ec0=this;return function(_0x369769){if(_0x369769){freeIsNotKeySip(_0x369769,_0x321ec0[_0xf442('0x14')]);for(var _0x1796bd=0x0,_0x200243={},_0x196a2d={};_0x1796bd<_0x369769[_0xf442('0x42')];_0x1796bd+=0x1){_0x200243=_0x369769[_0x1796bd];if(_[_0xf442('0x43')](_0x321ec0[_0xf442('0x14')][util[_0xf442('0x24')](_0xf442('0x25'),_0x200243['name'])])){_0x321ec0[_0xf442('0x14')][util[_0xf442('0x24')](_0xf442('0x25'),_0x200243[_0xf442('0x26')])]=new Telephone(_0x200243);}else{_0x321ec0[_0xf442('0x44')](_0x321ec0[_0xf442('0x14')][util[_0xf442('0x24')](_0xf442('0x25'),_0x200243[_0xf442('0x26')])],_0x200243);}}}return _0x321ec0[_0xf442('0x14')];};};Realtime[_0xf442('0x40')][_0xf442('0x46')]=function(){var _0x4a5bee=this;return function(_0x31aea9){if(_0x31aea9){freeIsNotKeySip(_0x31aea9,_0x4a5bee[_0xf442('0x47')]);for(var _0x426cd1=0x0,_0xc87bb4={},_0x9cc8f6={};_0x426cd1<_0x31aea9['length'];_0x426cd1+=0x1){_0xc87bb4=_0x31aea9[_0x426cd1];if(_['isUndefined'](_0x4a5bee[_0xf442('0x47')][util['format'](_0xf442('0x25'),_0xc87bb4[_0xf442('0x26')])])){_0x4a5bee[_0xf442('0x47')][util['format']('SIP/%s',_0xc87bb4[_0xf442('0x26')])]=new Trunk(_0xc87bb4);}else{_0x4a5bee[_0xf442('0x44')](_0x4a5bee['trunks'][util[_0xf442('0x24')]('SIP/%s',_0xc87bb4[_0xf442('0x26')])],_0xc87bb4);}}}return _0x4a5bee['trunks'];};};Realtime[_0xf442('0x40')][_0xf442('0x48')]=function(){var _0x114fc8=this;return function(_0x334f45){if(_0x334f45){freeIsNotKey(_0x334f45,_0x114fc8[_0xf442('0x15')],_0xf442('0x26'));for(var _0x206fc7=0x0,_0x55b83c={},_0x1a9905={};_0x206fc7<_0x334f45[_0xf442('0x42')];_0x206fc7+=0x1){_0x55b83c=_0x334f45[_0x206fc7];if(_['isUndefined'](_0x114fc8[_0xf442('0x15')][_0x55b83c[_0xf442('0x26')]])){_0x114fc8[_0xf442('0x15')][_0x55b83c['name']]=new VoiceQueue(_0x55b83c);}else{_0x114fc8[_0xf442('0x44')](_0x114fc8['voiceQueues'][_0x55b83c['name']],_0x55b83c);}}}return _0x114fc8[_0xf442('0x15')];};};Realtime[_0xf442('0x40')]['initTriggers']=function(){var _0x4470c9=this;return function(_0x7e22fd){if(_0x7e22fd){freeIsNotKey(_0x7e22fd,_0x4470c9[_0xf442('0x16')],'id');for(var _0x11ca70=0x0,_0x575c1b={},_0x27304d={};_0x11ca70<_0x7e22fd['length'];_0x11ca70+=0x1){_0x575c1b=_0x7e22fd[_0x11ca70];if(_[_0xf442('0x43')](_0x4470c9[_0xf442('0x16')][_0x575c1b['id']])){_0x4470c9[_0xf442('0x16')][_0x575c1b['id']]=new Trigger(_0x575c1b);}else{_0x4470c9[_0xf442('0x44')](_0x4470c9[_0xf442('0x16')][_0x575c1b['id']],_0x575c1b);}}}return _0x4470c9['triggers'];};};Realtime[_0xf442('0x40')][_0xf442('0x49')]=function(){var _0x59774f=this;return function(_0x4f92de){if(_0x4f92de){freeIsNotKey(_0x4f92de,_0x59774f[_0xf442('0x4a')],'id');for(var _0x3121e9=0x0,_0x28dc9e={},_0x186bb8={};_0x3121e9<_0x4f92de[_0xf442('0x42')];_0x3121e9+=0x1){_0x28dc9e=_0x4f92de[_0x3121e9];if(_['isUndefined'](_0x59774f[_0xf442('0x4a')][_0x28dc9e['id']])){_0x59774f['templates'][_0x28dc9e['id']]=new Template(_0x28dc9e);}else{_0x59774f[_0xf442('0x44')](_0x59774f[_0xf442('0x4a')][_0x28dc9e['id']],_0x28dc9e);}}}return _0x59774f[_0xf442('0x4a')];};};Realtime[_0xf442('0x40')][_0xf442('0x4b')]=function(){var _0x3edf7e=this;return function(_0x30ad6d){if(_0x30ad6d){freeIsNotKey(_0x30ad6d,_0x3edf7e[_0xf442('0x1c')],'id');for(var _0x486a2a=0x0,_0x2181a7={},_0x887711={};_0x486a2a<_0x30ad6d[_0xf442('0x42')];_0x486a2a+=0x1){_0x2181a7=_0x30ad6d[_0x486a2a];if(_[_0xf442('0x43')](_0x3edf7e['zendeskAccounts'][_0x2181a7['id']])){_0x3edf7e[_0xf442('0x1c')][_0x2181a7['id']]=new ZendeskAccount(_0x2181a7);}else{_0x3edf7e[_0xf442('0x44')](_0x3edf7e[_0xf442('0x1c')][_0x2181a7['id']],_0x2181a7);}}}return _0x3edf7e[_0xf442('0x1c')];};};Realtime['prototype'][_0xf442('0x4c')]=function(){var _0x6a6e8d=this;return function(_0xb8b5ab){if(_0xb8b5ab){freeIsNotKey(_0xb8b5ab,_0x6a6e8d[_0xf442('0x4d')],'id');for(var _0x38726e=0x0,_0xd4fb0a={},_0x31d474={};_0x38726e<_0xb8b5ab[_0xf442('0x42')];_0x38726e+=0x1){_0xd4fb0a=_0xb8b5ab[_0x38726e];if(_[_0xf442('0x43')](_0x6a6e8d[_0xf442('0x4d')][_0xd4fb0a['id']])){_0x6a6e8d[_0xf442('0x4d')][_0xd4fb0a['id']]=new SalesforceAccount(_0xd4fb0a);}else{_0x6a6e8d[_0xf442('0x44')](_0x6a6e8d[_0xf442('0x4d')][_0xd4fb0a['id']],_0xd4fb0a);}}}return _0x6a6e8d[_0xf442('0x4d')];};};Realtime[_0xf442('0x40')][_0xf442('0x4e')]=function(){var _0x5b6727=this;return function(_0x2d306e){if(_0x2d306e){freeIsNotKey(_0x2d306e,_0x5b6727['freshdeskAccounts'],'id');for(var _0x2f2951=0x0,_0x4b2308={},_0x1940e9={};_0x2f2951<_0x2d306e[_0xf442('0x42')];_0x2f2951+=0x1){_0x4b2308=_0x2d306e[_0x2f2951];if(_[_0xf442('0x43')](_0x5b6727['freshdeskAccounts'][_0x4b2308['id']])){_0x5b6727['freshdeskAccounts'][_0x4b2308['id']]=new FreshdeskAccount(_0x4b2308);}else{_0x5b6727[_0xf442('0x44')](_0x5b6727[_0xf442('0x4f')][_0x4b2308['id']],_0x4b2308);}}}return _0x5b6727[_0xf442('0x4f')];};};Realtime[_0xf442('0x40')][_0xf442('0x50')]=function(){var _0x514b82=this;return function(_0x39bfdb){if(_0x39bfdb){freeIsNotKey(_0x39bfdb,_0x514b82[_0xf442('0x1d')],'id');for(var _0x7087f4=0x0,_0x3fa3a3={},_0x5ca7dc={};_0x7087f4<_0x39bfdb[_0xf442('0x42')];_0x7087f4+=0x1){_0x3fa3a3=_0x39bfdb[_0x7087f4];if(_['isUndefined'](_0x514b82[_0xf442('0x1d')][_0x3fa3a3['id']])){_0x514b82[_0xf442('0x1d')][_0x3fa3a3['id']]=new ZohoAccount(_0x3fa3a3);}else{_0x514b82['mergeFromDatabase'](_0x514b82[_0xf442('0x1d')][_0x3fa3a3['id']],_0x3fa3a3);}}}return _0x514b82[_0xf442('0x1d')];};};Realtime[_0xf442('0x40')][_0xf442('0x51')]=function(){var _0xc98d90=this;return function(_0x247635){if(_0x247635){freeIsNotKey(_0x247635,_0xc98d90['deskAccounts'],'id');for(var _0x119091=0x0,_0x289dea={},_0x4df859={};_0x119091<_0x247635[_0xf442('0x42')];_0x119091+=0x1){_0x289dea=_0x247635[_0x119091];if(_[_0xf442('0x43')](_0xc98d90[_0xf442('0x1e')][_0x289dea['id']])){_0xc98d90[_0xf442('0x1e')][_0x289dea['id']]=new DeskAccount(_0x289dea);}else{_0xc98d90[_0xf442('0x44')](_0xc98d90[_0xf442('0x1e')][_0x289dea['id']],_0x289dea);}}}return _0xc98d90[_0xf442('0x1e')];};};Realtime['prototype'][_0xf442('0x52')]=function(){var _0x1f65a0=this;return function(_0x4ab598){if(_0x4ab598){freeIsNotKey(_0x4ab598,_0x1f65a0[_0xf442('0x53')],'id');for(var _0x45e571=0x0,_0x12a545={},_0x5c8966={};_0x45e571<_0x4ab598[_0xf442('0x42')];_0x45e571+=0x1){_0x12a545=_0x4ab598[_0x45e571];if(_['isUndefined'](_0x1f65a0[_0xf442('0x53')][_0x12a545['id']])){_0x1f65a0[_0xf442('0x53')][_0x12a545['id']]=new SugarcrmAccount(_0x12a545);}else{_0x1f65a0[_0xf442('0x44')](_0x1f65a0[_0xf442('0x53')][_0x12a545['id']],_0x12a545);}}}return _0x1f65a0[_0xf442('0x53')];};};Realtime[_0xf442('0x40')][_0xf442('0x54')]=function(){var _0x37003a=this;return function(_0x20136a){if(_0x20136a){freeIsNotKey(_0x20136a,_0x37003a[_0xf442('0x55')],'id');for(var _0x453a8d=0x0,_0x58ccc1={},_0x482d63={};_0x453a8d<_0x20136a[_0xf442('0x42')];_0x453a8d+=0x1){_0x58ccc1=_0x20136a[_0x453a8d];if(_[_0xf442('0x43')](_0x37003a['vtigerAccounts'][_0x58ccc1['id']])){_0x37003a[_0xf442('0x55')][_0x58ccc1['id']]=new VtigerAccount(_0x58ccc1);}else{_0x37003a[_0xf442('0x44')](_0x37003a[_0xf442('0x55')][_0x58ccc1['id']],_0x58ccc1);}}}return _0x37003a[_0xf442('0x55')];};};Realtime[_0xf442('0x40')]['initServicenowAccounts']=function(){var _0x4fb897=this;return function(_0xea2f6a){if(_0xea2f6a){freeIsNotKey(_0xea2f6a,_0x4fb897[_0xf442('0x1f')],'id');for(var _0x58dc41=0x0,_0x5c804a={},_0x7a5e34={};_0x58dc41<_0xea2f6a[_0xf442('0x42')];_0x58dc41+=0x1){_0x5c804a=_0xea2f6a[_0x58dc41];if(_[_0xf442('0x43')](_0x4fb897[_0xf442('0x1f')][_0x5c804a['id']])){_0x4fb897['servicenowAccounts'][_0x5c804a['id']]=new ServicenowAccount(_0x5c804a);}else{_0x4fb897[_0xf442('0x44')](_0x4fb897[_0xf442('0x1f')][_0x5c804a['id']],_0x5c804a);}}}return _0x4fb897[_0xf442('0x1f')];};};Realtime[_0xf442('0x40')][_0xf442('0x56')]=function(){var _0x3a9600=this;return function(_0x5bce88){if(_0x5bce88){freeIsNotKey(_0x5bce88,_0x3a9600['dynamics365Accounts'],'id');for(var _0x4694ee=0x0,_0x402a76={},_0x47482f={};_0x4694ee<_0x5bce88[_0xf442('0x42')];_0x4694ee+=0x1){_0x402a76=_0x5bce88[_0x4694ee];if(_[_0xf442('0x43')](_0x3a9600[_0xf442('0x20')][_0x402a76['id']])){_0x3a9600[_0xf442('0x20')][_0x402a76['id']]=new Dynamics365Account(_0x402a76);}else{_0x3a9600[_0xf442('0x44')](_0x3a9600[_0xf442('0x20')][_0x402a76['id']],_0x402a76);}}}return _0x3a9600[_0xf442('0x20')];};};Realtime[_0xf442('0x40')][_0xf442('0x57')]=function(){var _0x44b84b=this;return function(_0x27a30e){if(_0x27a30e){freeIsNotKey(_0x27a30e,_0x44b84b['freshsalesAccounts'],'id');for(var _0x1c1764=0x0,_0x364e04={},_0x130868={};_0x1c1764<_0x27a30e[_0xf442('0x42')];_0x1c1764+=0x1){_0x364e04=_0x27a30e[_0x1c1764];if(_[_0xf442('0x43')](_0x44b84b[_0xf442('0x21')][_0x364e04['id']])){_0x44b84b[_0xf442('0x21')][_0x364e04['id']]=new FreshsalesAccount(_0x364e04);}else{_0x44b84b['mergeFromDatabase'](_0x44b84b[_0xf442('0x21')][_0x364e04['id']],_0x364e04);}}}return _0x44b84b[_0xf442('0x21')];};};Realtime['prototype'][_0xf442('0x58')]=function(){var _0x2d80dd=this;return function(_0xc0d271){for(var _0x5f082a=0x0;_0x5f082a<_0xc0d271['length'];_0x5f082a+=0x1){_[_0xf442('0x59')](_0x2d80dd[_0xf442('0x15')][_0xc0d271[_0x5f082a]['name']],_0xc0d271[_0x5f082a]);}return _0x2d80dd['voiceQueues'];};};Realtime[_0xf442('0x40')][_0xf442('0x5a')]=function(){var _0xc9579e=this;return function(_0x21d48d){clearVoiceQueues(_0xc9579e[_0xf442('0x15')]);if(_0x21d48d){_0x21d48d=_[_0xf442('0x5b')](_0x21d48d,_0xf442('0x5c'));for(var _0x419930 in _0x21d48d){if(_0x21d48d[_0xf442('0x27')](_0x419930)){var _0x30b0c8={};for(var _0x1bcaad=0x0;_0x1bcaad<_0x21d48d[_0x419930][_0xf442('0x42')];_0x1bcaad+=0x1){var _0x3d6fd8=_0x21d48d[_0x419930][_0x1bcaad][_0xf442('0x5d')];if(_0xc9579e['voiceQueues'][_0x3d6fd8]){if(_0x21d48d[_0x419930][_0x1bcaad][_0xf442('0x5e')]){_0xc9579e[_0xf442('0x15')][_0x3d6fd8][_0xf442('0x31')]+=0x1;}if(_0x21d48d[_0x419930][_0x1bcaad][_0xf442('0x5f')]){_0xc9579e['voiceQueues'][_0x3d6fd8][_0xf442('0x32')]+=0x1;}_0xc9579e[_0xf442('0x15')][_0x3d6fd8][_0xf442('0x33')]+=moment(_0x21d48d[_0x419930][_0x1bcaad][_0xf442('0x60')])[_0xf442('0x61')](moment(_0x21d48d[_0x419930][_0x1bcaad][_0xf442('0x62')]),_0xf442('0x63'))||0x0;if(_0x1bcaad===_0x21d48d[_0x419930]['length']-0x1){_0xc9579e[_0xf442('0x15')][_0x3d6fd8][_0xf442('0x2c')]+=moment(_0x21d48d[_0x419930][_0x1bcaad][_0xf442('0x64')]||_0x21d48d[_0x419930][_0x1bcaad][_0xf442('0x65')]||_0x21d48d[_0x419930][_0x1bcaad][_0xf442('0x66')])['diff'](moment(_0x21d48d[_0x419930][_0x1bcaad][_0xf442('0x62')]),_0xf442('0x63'))||0x0;_0xc9579e[_0xf442('0x15')][_0x3d6fd8]['total']+=0x1;if(_0x21d48d[_0x419930][_0x1bcaad][_0xf442('0x67')]){_0xc9579e[_0xf442('0x15')][_0x3d6fd8][_0xf442('0x2b')]+=0x1;_0xc9579e[_0xf442('0x15')][_0x3d6fd8]['sumBillable']+=moment(_0x21d48d[_0x419930][_0x1bcaad][_0xf442('0x64')])['diff'](moment(_0x21d48d[_0x419930][_0x1bcaad][_0xf442('0x60')]),_0xf442('0x63'))||0x0;}}else{_0xc9579e[_0xf442('0x15')][_0x3d6fd8][_0xf442('0x2c')]+=_0xc9579e[_0xf442('0x15')][_0x3d6fd8][_0xf442('0x33')]||0x0;}}}}}}return _0xc9579e[_0xf442('0x15')];};};Realtime[_0xf442('0x40')]['initVoiceCallReports']=function(){var _0x5b7278=this;return function(_0x39e894){clearVoiceCallReports(_0x5b7278[_0xf442('0x68')]);if(_0x39e894){for(var _0x459296=0x0;_0x459296<_0x39e894[_0xf442('0x42')];_0x459296+=0x1){_0x5b7278['outbound']['total']+=0x1;_0x5b7278[_0xf442('0x68')][_0xf442('0x2c')]+=_0x39e894[_0x459296]['duration'];if(_0x39e894[_0x459296]['disposition']===_0xf442('0x69')){_0x5b7278['outbound']['answered']+=0x1;_0x5b7278[_0xf442('0x68')]['sumHoldTime']+=_0x39e894[_0x459296][_0xf442('0x6a')]-_0x39e894[_0x459296][_0xf442('0x6b')]||0x0;_0x5b7278[_0xf442('0x68')][_0xf442('0x2d')]+=_0x39e894[_0x459296][_0xf442('0x6b')];}}}return _0x5b7278[_0xf442('0x68')];};};Realtime[_0xf442('0x40')][_0xf442('0x6c')]=function(){var _0x31e90c=this;return function(_0x7b98ee){if(_0x7b98ee){freeIsNotKey(_0x7b98ee,_0x31e90c[_0xf442('0x17')],'name');for(var _0x3c5512=0x0,_0x2fb1b6={};_0x3c5512<_0x7b98ee[_0xf442('0x42')];_0x3c5512+=0x1){_0x2fb1b6=_0x7b98ee[_0x3c5512];if(_[_0xf442('0x43')](_0x31e90c[_0xf442('0x17')][_0x2fb1b6[_0xf442('0x26')]])){_0x31e90c['campaigns'][_0x2fb1b6[_0xf442('0x26')]]=new Campaign(_0x2fb1b6);}else{_0x31e90c[_0xf442('0x44')](_0x31e90c[_0xf442('0x17')][_0x2fb1b6[_0xf442('0x26')]],_0x2fb1b6);}}}return _0x31e90c[_0xf442('0x17')];};};Realtime[_0xf442('0x40')][_0xf442('0x6d')]=function(){var _0x4d858c=this;return function(_0x44eec6){if(_0x44eec6){freeIsNotKey(_0x44eec6,_0x4d858c[_0xf442('0x18')],'id');for(var _0x858656=0x0,_0x12299d={};_0x858656<_0x44eec6[_0xf442('0x42')];_0x858656+=0x1){_0x12299d=_0x44eec6[_0x858656];if(_[_0xf442('0x43')](_0x4d858c[_0xf442('0x18')][_0x12299d['id']])){_0x4d858c['voiceExtensions'][_0x12299d['id']]=new VoiceExtension(_0x12299d);}else{_0x4d858c[_0xf442('0x44')](_0x4d858c['voiceExtensions'][_0x12299d['id']],_0x12299d);}}}return _0x4d858c[_0xf442('0x18')];};};Realtime[_0xf442('0x40')]['initCampaignHopperHistory']=function(){var _0x3a83e1=this;return function(_0x5d0ab4){clearCampaigns(_0x3a83e1[_0xf442('0x17')]);for(var _0x4f4f1=0x0;_0x4f4f1<_0x5d0ab4[_0xf442('0x42')];_0x4f4f1+=0x1){_['merge'](_0x3a83e1['campaigns'][_0x5d0ab4[_0x4f4f1][_0xf442('0x26')]],_0x5d0ab4[_0x4f4f1]);}return _0x3a83e1[_0xf442('0x17')];};};Realtime[_0xf442('0x40')][_0xf442('0x6e')]=function(){var _0x1806cf=this;return function(_0x29d7bd){if(_0x29d7bd){freeIsNotKey(_0x29d7bd,_0x1806cf[_0xf442('0x22')],'id');for(var _0x21f684=0x0,_0x4fa8eb={},_0x4111ac={};_0x21f684<_0x29d7bd[_0xf442('0x42')];_0x21f684+=0x1){_0x4fa8eb=_0x29d7bd[_0x21f684];if(_[_0xf442('0x43')](_0x1806cf['faxAccounts'][_0x4fa8eb['id']])){_0x1806cf[_0xf442('0x22')][_0x4fa8eb['id']]=new FaxAccount(_0x4fa8eb);}else{_0x1806cf[_0xf442('0x44')](_0x1806cf['faxAccounts'][_0x4fa8eb['id']],_0x4fa8eb);}}}return _0x1806cf[_0xf442('0x22')];};};module[_0xf442('0x6f')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 26a3821..3745ac7 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 _0xa37b=['findAgent','find','accountcode','isNil','name','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','match','destination','exten','dialer','lastapplication','queue','lastdata','from-voip-provider','callerid','context','from-sip','xcally-motion-preview','calleridnum','originatecalleridnum','destinationchannel','channel','calleridpreview','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','monitor','monitors','monitorFilename','createdAt','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','Local','substring','mobile','phone','blindTransfer','exports','bluebird','lodash','moment','util','ami','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xa37b,0x137));var _0xba37=function(_0x408b34,_0xb7d872){_0x408b34=_0x408b34-0x0;var _0x1182aa=_0xa37b[_0x408b34];return _0x1182aa;};'use strict';var BPromise=require(_0xba37('0x0'));var _=require(_0xba37('0x1'));var moment=require(_0xba37('0x2'));var util=require(_0xba37('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xba37('0x4'));var ami=require(_0xba37('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xba37('0x6'));var RpcVoiceDialReport=require(_0xba37('0x7'));var RpcMemberReport=require(_0xba37('0x8'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xba37('0x9'));var RpcVoiceTransferReport=require(_0xba37('0xa'));var VoiceQueueReport=require(_0xba37('0xb'));var VoiceCallReport=require(_0xba37('0xc'));var VoiceAgentReport=require(_0xba37('0xd'));var VoiceDialReport=require(_0xba37('0xe'));var UserReport=require('./userReport');function Report(_0x4b6571){this[_0xba37('0xf')]=_0x4b6571;this[_0xba37('0x10')]=_0x4b6571[_0xba37('0x10')];this[_0xba37('0x11')]=_0x4b6571['telephones'];}Report[_0xba37('0x12')][_0xba37('0x13')]=function(_0x295945){var _0x2da6cf=new VoiceQueueReport(this[_0xba37('0xf')]);var _0x5d1c2f=new VoiceAgentReport(this[_0xba37('0xf')]);var _0x46c349=new VoiceDialReport(this[_0xba37('0xf')]);var _0x55951e=new VoiceCallReport(this[_0xba37('0xf')]);var _0x1cf7ea=new UserReport(this['realtime']);if(config['xdr']&&config[_0xba37('0x14')]['disabled']){ami['on'](_0xba37('0x15'),this[_0xba37('0x16')][_0xba37('0x17')](this));ami['on'](_0xba37('0x18'),this[_0xba37('0x19')][_0xba37('0x17')](this));ami['on'](_0xba37('0x1a'),this[_0xba37('0x1b')][_0xba37('0x17')](this));ami['on'](_0xba37('0x1c'),this[_0xba37('0x1d')][_0xba37('0x17')](this));ami['on'](_0xba37('0x1e'),this['blindTransfer'][_0xba37('0x17')](this));ami['on'](_0xba37('0x1f'),this[_0xba37('0x20')][_0xba37('0x17')](this));}};Report[_0xba37('0x12')][_0xba37('0x21')]=function(_0x50159b){var _0x2520b5=undefined;_0x2520b5=_[_0xba37('0x22')](this[_0xba37('0x10')],function(_0x116b96){return _0x116b96[_0xba37('0x23')]==_0x50159b||_0x116b96['name']==_0x50159b;});if(_[_0xba37('0x24')](_0x2520b5)){var _0x17f325=_[_0xba37('0x22')](this[_0xba37('0x11')],function(_0x2dc0e5){return _0x2dc0e5[_0xba37('0x23')]==_0x50159b||_0x2dc0e5[_0xba37('0x25')]==_0x50159b;});if(_0x17f325){_0x2520b5=_[_0xba37('0x22')](this['agents'],function(_0x147cc9){return _0x147cc9[_0xba37('0x26')]==util[_0xba37('0x27')](_0xba37('0x28'),_0x17f325[_0xba37('0x25')]);});}}return _0x2520b5;};Report[_0xba37('0x12')][_0xba37('0x16')]=function(_0x340e9c){for(var _0x33a42c=0x0;_0x33a42c<_0x340e9c[_0xba37('0x29')];_0x33a42c+=0x1){var _0x4a8024=this[_0xba37('0x21')](_0x340e9c[_0x33a42c][_0xba37('0x2a')]);if(_0x4a8024){_0x340e9c[_0x33a42c][_0xba37('0x23')]=_0x4a8024['accountcode'];_0x340e9c[_0x33a42c][_0xba37('0x2b')]=!![];_0x340e9c[_0x33a42c][_0xba37('0x2c')]=_0x4a8024['name'];_0x340e9c[_0x33a42c][_0xba37('0x26')]=_[_0xba37('0x24')](_0x4a8024[_0xba37('0x26')])?util[_0xba37('0x27')](_0xba37('0x28'),_0x4a8024['name']):_0x4a8024[_0xba37('0x26')];if(_0x340e9c[_0x33a42c][_0xba37('0x2d')]){_0x340e9c[_0x33a42c]['queuecallercompleteAt']=moment()[_0xba37('0x27')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x340e9c[_0x33a42c][_0xba37('0x2e')]){_0x340e9c[_0x33a42c][_0xba37('0x2f')]=moment()[_0xba37('0x27')](_0xba37('0x30'));}RpcMemberReport[_0xba37('0x16')](_0x340e9c[_0x33a42c]);}RpcVoiceQueueReport[_0xba37('0x31')](_0x340e9c[_0x33a42c]);}};function extractCalleridNumber(_0x133522){var _0x584a3a=_0x133522[_0xba37('0x32')](/<(.*?)>/);return _0x584a3a?_0x584a3a[0x1]:_0x133522;}Report[_0xba37('0x12')][_0xba37('0x19')]=function(_0x15d98d){_0x15d98d[_0xba37('0x33')]=_0x15d98d[_0xba37('0x33')]||_0x15d98d[_0xba37('0x34')];if(_0x15d98d['type']==_0xba37('0x35')){_0x15d98d[_0xba37('0x36')]=_0xba37('0x37');_0x15d98d[_0xba37('0x38')]=_0x15d98d['queue'];if(_0x15d98d['context']==_0xba37('0x39')){_0x15d98d[_0xba37('0x23')]='';_0x15d98d['destination']=extractCalleridNumber(_0x15d98d[_0xba37('0x3a')]);}else if(_0x15d98d[_0xba37('0x3b')]==_0xba37('0x3c')){if(_0x15d98d[_0xba37('0x33')]==_0xba37('0x3d')){_0x15d98d[_0xba37('0x33')]=extractCalleridNumber(_0x15d98d['calleridpreview']);_0x15d98d[_0xba37('0x3e')]=_0x15d98d[_0xba37('0x3f')];_0x15d98d[_0xba37('0x40')]=[_0x15d98d[_0xba37('0x41')],_0x15d98d[_0xba37('0x41')]=_0x15d98d[_0xba37('0x40')]][0x0];_0x15d98d[_0xba37('0x3a')]=_0x15d98d[_0xba37('0x42')];}else{_0x15d98d['destination']=_0x15d98d[_0xba37('0x3e')];_0x15d98d[_0xba37('0x3e')]=_0x15d98d[_0xba37('0x3f')];if(_0x15d98d[_0xba37('0x43')]==_0xba37('0x44')){_0x15d98d[_0xba37('0x23')]=_0x15d98d[_0xba37('0x2a')];}else{_0x15d98d[_0xba37('0x23')]='';}}}}else{_0x15d98d[_0xba37('0x3a')]=util[_0xba37('0x27')](_0xba37('0x45'),_0x15d98d[_0xba37('0x46')],_0x15d98d[_0xba37('0x3e')]);}RpcVoiceCallReport[_0xba37('0x31')](_0x15d98d);if(_0x15d98d[_0xba37('0x47')]){for(var _0x79b4be=0x0;_0x79b4be<_0x15d98d[_0xba37('0x48')][_0xba37('0x29')];_0x79b4be+=0x1){_0x15d98d[_0xba37('0x49')]=_0x15d98d[_0xba37('0x48')][_0x79b4be]['filename'];_0x15d98d[_0xba37('0x4a')]=_0x15d98d['monitors'][_0x79b4be][_0xba37('0x4a')];if(_0x15d98d[_0xba37('0x34')]==_0xba37('0x3d')){_0x15d98d['calleridnum']=_0x15d98d[_0xba37('0x2a')];_0x15d98d[_0xba37('0x46')]=_0x15d98d[_0xba37('0x4b')];_0x15d98d[_0xba37('0x2a')]=_0x15d98d['accountcode'];_0x15d98d[_0xba37('0x4b')]=_0x15d98d[_0xba37('0x4c')];_0x15d98d[_0xba37('0x34')]=_0x15d98d[_0xba37('0x3f')];}else if(_0x15d98d[_0xba37('0x34')]==_0xba37('0x4d')){_0x15d98d[_0xba37('0x3e')]=_0x15d98d[_0xba37('0x33')];_0x15d98d[_0xba37('0x34')]=_0x15d98d[_0xba37('0x3f')];}RpcVoiceRecording['create'](_0x15d98d);}}};Report[_0xba37('0x12')][_0xba37('0x1b')]=function(_0x2a82e2){if(_[_0xba37('0x4e')](_0x2a82e2)){_0x2a82e2[_0xba37('0x4f')](function(_0x3f4765){RpcVoiceAgentReport[_0xba37('0x31')](_0x3f4765);});}else{RpcVoiceAgentReport[_0xba37('0x31')](_0x2a82e2);}};Report['prototype']['voiceDialReport']=function(_0x3ee7b2){RpcVoiceDialReport[_0xba37('0x31')](_0x3ee7b2);var _0x4ffc74=undefined;var _0x31aa6d=_0x3ee7b2['channel'];if(_['startsWith'](_0x31aa6d,_0xba37('0x50'))){var _0x463021=_0x31aa6d[_0xba37('0x51')](_0x31aa6d['indexOf']('/')+0x1,_0x31aa6d['indexOf']('@'));_0x4ffc74=_['find'](this[_0xba37('0x10')],function(_0x554412){return _0x554412[_0xba37('0x52')]==_0x463021||_0x554412[_0xba37('0x53')]==_0x463021||_0x554412[_0xba37('0x23')]==_0x463021;});}else{var _0x463021=_0x31aa6d[_0xba37('0x51')](_0x31aa6d['indexOf']('/')+0x1,_0x31aa6d['lastIndexOf']('-'));_0x4ffc74=this['findAgent'](_0x463021);}if(_0x4ffc74){_0x3ee7b2[_0xba37('0x26')]=_['isNil'](_0x4ffc74[_0xba37('0x26')])?util[_0xba37('0x27')](_0xba37('0x28'),_0x4ffc74['name']):_0x4ffc74[_0xba37('0x26')];_0x3ee7b2['membername']=_0x4ffc74['name'];_0x3ee7b2[_0xba37('0x23')]=_0x4ffc74['accountcode'];RpcMemberReport[_0xba37('0x1d')](_0x3ee7b2);}};Report[_0xba37('0x12')][_0xba37('0x54')]=function(_0x4f21ed){RpcVoiceTransferReport[_0xba37('0x54')](_0x4f21ed);};Report['prototype']['attendedTransfer']=function(_0x5ca99d){RpcVoiceTransferReport[_0xba37('0x20')](_0x5ca99d);};module[_0xba37('0x55')]=Report; \ No newline at end of file +var _0x09a0=['isNil','name','interface','SIP/%s','voiceQueueReport','length','connectedlinenum','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','format','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match','voiceCallReport','destination','exten','type','dialer','queue','lastdata','context','from-voip-provider','callerid','from-sip','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','monitors','monitorFilename','createdAt','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','voiceDialReport','Local','substring','indexOf','phone','lastIndexOf','exports','bluebird','moment','util','../../../config/environment','../../../config/logger','ami','../ami','../rpc/voiceDialReport','../rpc/voiceQueueReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x09a0,0x125));var _0x009a=function(_0x5846b7,_0x374c7d){_0x5846b7=_0x5846b7-0x0;var _0x5b707d=_0x09a0[_0x5846b7];return _0x5b707d;};'use strict';var BPromise=require(_0x009a('0x0'));var _=require('lodash');var moment=require(_0x009a('0x1'));var util=require(_0x009a('0x2'));var config=require(_0x009a('0x3'));var logger=require(_0x009a('0x4'))(_0x009a('0x5'));var ami=require(_0x009a('0x6'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x009a('0x7'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x009a('0x8'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x009a('0x9'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x009a('0xa'));var VoiceDialReport=require(_0x009a('0xb'));var UserReport=require(_0x009a('0xc'));function Report(_0x1c8342){this[_0x009a('0xd')]=_0x1c8342;this[_0x009a('0xe')]=_0x1c8342[_0x009a('0xe')];this[_0x009a('0xf')]=_0x1c8342[_0x009a('0xf')];}Report[_0x009a('0x10')][_0x009a('0x11')]=function(_0x24e388){var _0x3ae934=new VoiceQueueReport(this['realtime']);var _0x274cc2=new VoiceAgentReport(this[_0x009a('0xd')]);var _0x318b62=new VoiceDialReport(this[_0x009a('0xd')]);var _0x21b0bf=new VoiceCallReport(this[_0x009a('0xd')]);var _0x2adbc0=new UserReport(this[_0x009a('0xd')]);if(config[_0x009a('0x12')]&&config[_0x009a('0x12')]['disabled']){ami['on']('custom:voiceQueueReport',this['voiceQueueReport']['bind'](this));ami['on'](_0x009a('0x13'),this['voiceCallReport'][_0x009a('0x14')](this));ami['on'](_0x009a('0x15'),this[_0x009a('0x16')][_0x009a('0x14')](this));ami['on'](_0x009a('0x17'),this['voiceDialReport'][_0x009a('0x14')](this));ami['on'](_0x009a('0x18'),this[_0x009a('0x19')][_0x009a('0x14')](this));ami['on'](_0x009a('0x1a'),this[_0x009a('0x1b')]['bind'](this));}};Report['prototype'][_0x009a('0x1c')]=function(_0x1df16e){var _0x525c3b=undefined;_0x525c3b=_[_0x009a('0x1d')](this[_0x009a('0xe')],function(_0x41fa1e){return _0x41fa1e[_0x009a('0x1e')]==_0x1df16e||_0x41fa1e['name']==_0x1df16e;});if(_[_0x009a('0x1f')](_0x525c3b)){var _0x29c306=_[_0x009a('0x1d')](this[_0x009a('0xf')],function(_0x54fe2d){return _0x54fe2d[_0x009a('0x1e')]==_0x1df16e||_0x54fe2d[_0x009a('0x20')]==_0x1df16e;});if(_0x29c306){_0x525c3b=_[_0x009a('0x1d')](this[_0x009a('0xe')],function(_0x559697){return _0x559697[_0x009a('0x21')]==util['format'](_0x009a('0x22'),_0x29c306[_0x009a('0x20')]);});}}return _0x525c3b;};Report[_0x009a('0x10')][_0x009a('0x23')]=function(_0x5c8322){for(var _0x17d01c=0x0;_0x17d01c<_0x5c8322[_0x009a('0x24')];_0x17d01c+=0x1){var _0x3315d9=this[_0x009a('0x1c')](_0x5c8322[_0x17d01c][_0x009a('0x25')]);if(_0x3315d9){_0x5c8322[_0x17d01c]['accountcode']=_0x3315d9['accountcode'];_0x5c8322[_0x17d01c]['assigned']=!![];_0x5c8322[_0x17d01c][_0x009a('0x26')]=_0x3315d9[_0x009a('0x20')];_0x5c8322[_0x17d01c][_0x009a('0x21')]=_['isNil'](_0x3315d9[_0x009a('0x21')])?util['format'](_0x009a('0x22'),_0x3315d9[_0x009a('0x20')]):_0x3315d9['interface'];if(_0x5c8322[_0x17d01c][_0x009a('0x27')]){_0x5c8322[_0x17d01c][_0x009a('0x28')]=moment()[_0x009a('0x29')](_0x009a('0x2a'));}if(_0x5c8322[_0x17d01c][_0x009a('0x2b')]){_0x5c8322[_0x17d01c]['queuecallerexitAt']=moment()['format'](_0x009a('0x2a'));}RpcMemberReport[_0x009a('0x23')](_0x5c8322[_0x17d01c]);}RpcVoiceQueueReport[_0x009a('0x2c')](_0x5c8322[_0x17d01c]);}};function extractCalleridNumber(_0x292c37){var _0x237d0b=_0x292c37[_0x009a('0x2d')](/<(.*?)>/);return _0x237d0b?_0x237d0b[0x1]:_0x292c37;}Report[_0x009a('0x10')][_0x009a('0x2e')]=function(_0x309d46){_0x309d46['destination']=_0x309d46[_0x009a('0x2f')]||_0x309d46[_0x009a('0x30')];if(_0x309d46[_0x009a('0x31')]==_0x009a('0x32')){_0x309d46['lastapplication']=_0x009a('0x33');_0x309d46[_0x009a('0x34')]=_0x309d46[_0x009a('0x33')];if(_0x309d46[_0x009a('0x35')]==_0x009a('0x36')){_0x309d46[_0x009a('0x1e')]='';_0x309d46['destination']=extractCalleridNumber(_0x309d46[_0x009a('0x37')]);}else if(_0x309d46[_0x009a('0x35')]==_0x009a('0x38')){if(_0x309d46[_0x009a('0x2f')]=='xcally-motion-preview'){_0x309d46[_0x009a('0x2f')]=extractCalleridNumber(_0x309d46[_0x009a('0x39')]);_0x309d46[_0x009a('0x3a')]=_0x309d46[_0x009a('0x3b')];_0x309d46[_0x009a('0x3c')]=[_0x309d46[_0x009a('0x3d')],_0x309d46[_0x009a('0x3d')]=_0x309d46[_0x009a('0x3c')]][0x0];_0x309d46[_0x009a('0x37')]=_0x309d46[_0x009a('0x39')];}else{_0x309d46['destination']=_0x309d46[_0x009a('0x3a')];_0x309d46[_0x009a('0x3a')]=_0x309d46[_0x009a('0x3b')];if(_0x309d46[_0x009a('0x3e')]==_0x009a('0x3f')){_0x309d46[_0x009a('0x1e')]=_0x309d46[_0x009a('0x25')];}else{_0x309d46[_0x009a('0x1e')]='';}}}}else{_0x309d46[_0x009a('0x37')]=util[_0x009a('0x29')](_0x009a('0x40'),_0x309d46[_0x009a('0x41')],_0x309d46[_0x009a('0x3a')]);}RpcVoiceCallReport[_0x009a('0x2c')](_0x309d46);if(_0x309d46['monitor']){for(var _0xaf1631=0x0;_0xaf1631<_0x309d46[_0x009a('0x42')][_0x009a('0x24')];_0xaf1631+=0x1){_0x309d46[_0x009a('0x43')]=_0x309d46[_0x009a('0x42')][_0xaf1631]['filename'];_0x309d46[_0x009a('0x44')]=_0x309d46['monitors'][_0xaf1631][_0x009a('0x44')];if(_0x309d46[_0x009a('0x30')]=='xcally-motion-preview'){_0x309d46[_0x009a('0x3a')]=_0x309d46[_0x009a('0x25')];_0x309d46[_0x009a('0x41')]=_0x309d46[_0x009a('0x45')];_0x309d46[_0x009a('0x25')]=_0x309d46[_0x009a('0x1e')];_0x309d46[_0x009a('0x45')]=_0x309d46[_0x009a('0x46')];_0x309d46['exten']=_0x309d46['originatecalleridnum'];}else if(_0x309d46[_0x009a('0x30')]==_0x009a('0x47')){_0x309d46[_0x009a('0x3a')]=_0x309d46[_0x009a('0x2f')];_0x309d46['exten']=_0x309d46[_0x009a('0x3b')];}RpcVoiceRecording[_0x009a('0x2c')](_0x309d46);}}};Report[_0x009a('0x10')][_0x009a('0x16')]=function(_0x10b3f3){if(_[_0x009a('0x48')](_0x10b3f3)){_0x10b3f3[_0x009a('0x49')](function(_0xbe20f){RpcVoiceAgentReport[_0x009a('0x2c')](_0xbe20f);});}else{RpcVoiceAgentReport[_0x009a('0x2c')](_0x10b3f3);}};Report['prototype'][_0x009a('0x4a')]=function(_0x5281f7){RpcVoiceDialReport[_0x009a('0x2c')](_0x5281f7);var _0x3f7a7b=undefined;var _0x1a8c7b=_0x5281f7[_0x009a('0x3d')];if(_['startsWith'](_0x1a8c7b,_0x009a('0x4b'))){var _0x5054ff=_0x1a8c7b[_0x009a('0x4c')](_0x1a8c7b[_0x009a('0x4d')]('/')+0x1,_0x1a8c7b[_0x009a('0x4d')]('@'));_0x3f7a7b=_[_0x009a('0x1d')](this[_0x009a('0xe')],function(_0x182045){return _0x182045['mobile']==_0x5054ff||_0x182045[_0x009a('0x4e')]==_0x5054ff||_0x182045[_0x009a('0x1e')]==_0x5054ff;});}else{var _0x5054ff=_0x1a8c7b['substring'](_0x1a8c7b[_0x009a('0x4d')]('/')+0x1,_0x1a8c7b[_0x009a('0x4f')]('-'));_0x3f7a7b=this['findAgent'](_0x5054ff);}if(_0x3f7a7b){_0x5281f7[_0x009a('0x21')]=_['isNil'](_0x3f7a7b['interface'])?util['format'](_0x009a('0x22'),_0x3f7a7b[_0x009a('0x20')]):_0x3f7a7b['interface'];_0x5281f7[_0x009a('0x46')]=_0x3f7a7b[_0x009a('0x20')];_0x5281f7[_0x009a('0x1e')]=_0x3f7a7b[_0x009a('0x1e')];RpcMemberReport[_0x009a('0x4a')](_0x5281f7);}};Report[_0x009a('0x10')][_0x009a('0x19')]=function(_0x1e2f34){RpcVoiceTransferReport[_0x009a('0x19')](_0x1e2f34);};Report['prototype']['attendedTransfer']=function(_0x337b69){RpcVoiceTransferReport[_0x009a('0x1b')](_0x337b69);};module[_0x009a('0x50')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 2ec4460..eff9437 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 _0x562f=['actionSipShowRegistry','actionDeviceStateList','catch','error','inspect','loopSyncRealTimeShow','then','actionSipPeerStatus','prototype','isNotNull','isUndefined','emit','username','stateRegistry','state','event','format','trunk:%s','device','local','toLowerCase','inuse','toNumber','updateStatusRealtime','telephone:%s','name','stateTime','trunk:save','startsWith','Queue','Local','substring','indexOf','mobile','accountcode','[syncDeviceState][UserReport]','peer','registered','status','address','telephone:save','exports','bluebird','util','../../../config/environment','ami','../ami','defaults','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','resolve'];(function(_0x1c2b3e,_0x309b0a){var _0x3b22f7=function(_0x282aa8){while(--_0x282aa8){_0x1c2b3e['push'](_0x1c2b3e['shift']());}};_0x3b22f7(++_0x309b0a);}(_0x562f,0x69));var _0xf562=function(_0x39bc06,_0x18d7ff){_0x39bc06=_0x39bc06-0x0;var _0x131143=_0x562f[_0x39bc06];return _0x131143;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0xf562('0x0'));var util=require(_0xf562('0x1'));var Redis=require('ioredis');var config=require(_0xf562('0x2'));var logger=require('../../../config/logger')(_0xf562('0x3'));var ami=require(_0xf562('0x4'));config['redis']=_[_0xf562('0x5')](config[_0xf562('0x6')],{'host':_0xf562('0x7'),'port':0x18eb});var io=require(_0xf562('0x8'))(new Redis(config[_0xf562('0x6')]));function UserReport(_0x3a5d6b){this[_0xf562('0x9')]=_0x3a5d6b['trunks'];this[_0xf562('0xa')]=_0x3a5d6b[_0xf562('0xa')];this[_0xf562('0xb')]=_0x3a5d6b[_0xf562('0xb')];ami['on'](_0xf562('0xc'),this[_0xf562('0xd')][_0xf562('0xe')](this));ami['on'](_0xf562('0xf'),this[_0xf562('0xd')][_0xf562('0xe')](this));ami['on'](_0xf562('0x10'),this[_0xf562('0x11')]['bind'](this));ami['on'](_0xf562('0x12'),this[_0xf562('0x13')][_0xf562('0xe')](this));this['loopSyncRealTimeShow']();return BPromise[_0xf562('0x14')]()['then'](ami[_0xf562('0x15')]())['then'](ami[_0xf562('0x16')]())['then'](ami['actionSipPeerStatus']())[_0xf562('0x17')](loggerCatch('[loopSyncRealTimeShow]'));}function loggerCatch(_0x5db2c3){return function(_0x5aeac2){logger[_0xf562('0x18')](_0x5db2c3,util[_0xf562('0x19')](_0x5aeac2,{'showHidden':![],'depth':null}));};}UserReport['prototype'][_0xf562('0x1a')]=function(){setInterval(function(){BPromise[_0xf562('0x14')]()[_0xf562('0x1b')](ami['actionSipShowRegistry']())['then'](ami['actionDeviceStateList']())[_0xf562('0x1b')](ami[_0xf562('0x1c')]())['catch'](loggerCatch('[loopSyncRealTimeShow]'));},0x32c8);};UserReport[_0xf562('0x1d')][_0xf562('0x1e')]=function(_0x3c523d){return _0x3c523d!==null&&!_[_0xf562('0x1f')](_0x3c523d);};UserReport[_0xf562('0x1d')][_0xf562('0x20')]=function(_0x577342,_0x20582d,_0x34a83a){io['to'](_0x577342)[_0xf562('0x20')](_0x20582d,_0x34a83a);};UserReport[_0xf562('0x1d')][_0xf562('0xd')]=function(_0xe273be){try{if(this[_0xf562('0x1e')](_0xe273be)){var _0x16bb8b=_['find'](this['trunks'],{'registry':_0xe273be[_0xf562('0x21')]});if(_0x16bb8b){_0xe273be[_0xf562('0x22')]=_0xe273be[_0xf562('0x23')];_['merge'](_0x16bb8b,_['omit'](_0xe273be,[_0xf562('0x24'),'actionid','username',_0xf562('0x23')]));this[_0xf562('0x20')](util[_0xf562('0x25')](_0xf562('0x26'),_0x16bb8b['name']),'trunk:save',_0x16bb8b);}}}catch(_0x51b8d7){logger[_0xf562('0x18')]('[syncRegistry][UserReport]',util['inspect'](_0x51b8d7,{'showHidden':![],'depth':null}));}};UserReport[_0xf562('0x1d')][_0xf562('0x11')]=function(_0x354492){try{if(this[_0xf562('0x1e')](_0x354492)){if(this[_0xf562('0xa')][_0x354492[_0xf562('0x27')]]){if(!this['agents'][_0x354492[_0xf562('0x27')]][_0xf562('0x28')]||_0x354492[_0xf562('0x23')][_0xf562('0x29')]()==_0xf562('0x2a')){this['agents'][_0x354492[_0xf562('0x27')]][_0xf562('0x28')]=![];if(this[_0xf562('0xa')][_0x354492[_0xf562('0x27')]][_0xf562('0x23')]!==_0x354492[_0xf562('0x23')]['toLowerCase']()){this[_0xf562('0xa')][_0x354492['device']]['stateTime']=_[_0xf562('0x2b')](moment()['format']('x'));}this[_0xf562('0xa')][_0x354492['device']][_0xf562('0x23')]=_0x354492['state'][_0xf562('0x29')]();this[_0xf562('0xa')][_0x354492['device']][_0xf562('0x2c')](_0x354492);}}else if(this[_0xf562('0xb')][_0x354492[_0xf562('0x27')]]){if(this[_0xf562('0xb')][_0x354492[_0xf562('0x27')]][_0xf562('0x23')]!==_0x354492['state'][_0xf562('0x29')]()){this[_0xf562('0xb')][_0x354492[_0xf562('0x27')]]['stateTime']=_['toNumber'](moment()['format']('x'));}this[_0xf562('0xb')][_0x354492[_0xf562('0x27')]][_0xf562('0x23')]=_0x354492['state']['toLowerCase']();this[_0xf562('0x20')](util[_0xf562('0x25')](_0xf562('0x2d'),this[_0xf562('0xb')][_0x354492[_0xf562('0x27')]][_0xf562('0x2e')]),'telephone:save',this[_0xf562('0xb')][_0x354492['device']]);}else if(this[_0xf562('0x9')][_0x354492[_0xf562('0x27')]]){if(this[_0xf562('0x9')][_0x354492[_0xf562('0x27')]][_0xf562('0x23')]!==_0x354492[_0xf562('0x23')]['toLowerCase']()){this[_0xf562('0x9')][_0x354492[_0xf562('0x27')]][_0xf562('0x2f')]=_[_0xf562('0x2b')](moment()[_0xf562('0x25')]('x'));}this['trunks'][_0x354492['device']]['state']=_0x354492[_0xf562('0x23')][_0xf562('0x29')]();this[_0xf562('0x20')](util[_0xf562('0x25')](_0xf562('0x26'),this[_0xf562('0x9')][_0x354492['device']][_0xf562('0x2e')]),_0xf562('0x30'),this[_0xf562('0x9')][_0x354492['device']]);}else if(_[_0xf562('0x31')](_0x354492[_0xf562('0x27')],_0xf562('0x32'))){}else if(_[_0xf562('0x31')](_0x354492[_0xf562('0x27')],_0xf562('0x33'))){var _0x184695=_0x354492['device'];var _0x9ce7e7=_0x184695[_0xf562('0x34')](_0x184695[_0xf562('0x35')]('/')+0x1,_0x184695[_0xf562('0x35')]('@'));var _0xc33b89=_['find'](this[_0xf562('0xa')],function(_0xa616d3){return _0xa616d3[_0xf562('0x36')]==_0x9ce7e7||_0xa616d3['phone']==_0x9ce7e7||_0xa616d3[_0xf562('0x37')]==_0x9ce7e7;});if(_0xc33b89){if(_0xc33b89[_0xf562('0x23')]!==_0x354492[_0xf562('0x23')][_0xf562('0x29')]()){_0xc33b89['stateTime']=_[_0xf562('0x2b')](moment()[_0xf562('0x25')]('x'));}_0xc33b89['state']=_0x354492[_0xf562('0x23')]['toLowerCase']();_0xc33b89[_0xf562('0x28')]=!![];_0xc33b89['updateStatusRealtime'](_0x354492);}}else{}}}catch(_0x5e3c36){logger[_0xf562('0x18')](_0xf562('0x38'),util[_0xf562('0x19')](_0x5e3c36,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncPeerStatus']=function(_0x5e4323){try{if(this[_0xf562('0x1e')](_0x5e4323)&&this[_0xf562('0x1e')](_0x5e4323[_0xf562('0x12')])){if(this[_0xf562('0xa')][_0x5e4323[_0xf562('0x39')]]){if(!this[_0xf562('0xa')][_0x5e4323['peer']][_0xf562('0x28')]||_0x5e4323['peerstatus'][_0xf562('0x29')]()==_0xf562('0x3a')){this['agents'][_0x5e4323[_0xf562('0x39')]][_0xf562('0x28')]=![];this[_0xf562('0xa')][_0x5e4323[_0xf562('0x39')]][_0xf562('0x3b')]=_0x5e4323[_0xf562('0x12')][_0xf562('0x29')]();this[_0xf562('0xa')][_0x5e4323['peer']][_0xf562('0x3c')]=_0x5e4323[_0xf562('0x3c')];this['agents'][_0x5e4323[_0xf562('0x39')]][_0xf562('0x2c')](_0x5e4323);}}else if(this['telephones'][_0x5e4323[_0xf562('0x39')]]){this[_0xf562('0xb')][_0x5e4323[_0xf562('0x39')]][_0xf562('0x3b')]=_0x5e4323[_0xf562('0x12')][_0xf562('0x29')]();this[_0xf562('0xb')][_0x5e4323['peer']][_0xf562('0x3c')]=_0x5e4323[_0xf562('0x3c')];this[_0xf562('0x20')](util[_0xf562('0x25')]('telephone:%s',this[_0xf562('0xb')][_0x5e4323[_0xf562('0x39')]][_0xf562('0x2e')]),_0xf562('0x3d'),this[_0xf562('0xb')][_0x5e4323[_0xf562('0x39')]]);}else if(this[_0xf562('0x9')][_0x5e4323[_0xf562('0x39')]]){this[_0xf562('0x9')][_0x5e4323[_0xf562('0x39')]][_0xf562('0x3b')]=_0x5e4323[_0xf562('0x12')]['toLowerCase']();this['trunks'][_0x5e4323[_0xf562('0x39')]]['address']=_0x5e4323[_0xf562('0x3c')];this[_0xf562('0x20')](util['format'](_0xf562('0x26'),this[_0xf562('0x9')][_0x5e4323[_0xf562('0x39')]]['name']),_0xf562('0x30'),this['trunks'][_0x5e4323[_0xf562('0x39')]]);}else{}}}catch(_0x39d8bd){logger[_0xf562('0x18')]('[syncPeerStatus][UserReport]',util[_0xf562('0x19')](_0x39d8bd,{'showHidden':![],'depth':null}));}};module[_0xf562('0x3e')]=UserReport; \ No newline at end of file +var _0x3cc0=['toNumber','format','updateStatusRealtime','telephone:%s','telephone:save','startsWith','Queue','Local','indexOf','find','mobile','phone','accountcode','[syncDeviceState][UserReport]','syncPeerStatus','peerstatus','peer','registered','status','address','[syncPeerStatus][UserReport]','lodash','moment','bluebird','util','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','prototype','isNotNull','isUndefined','emit','username','stateRegistry','state','merge','trunk:%s','name','trunk:save','inspect','device','local','toLowerCase','inuse','stateTime'];(function(_0x304e4f,_0x3ddcab){var _0x129f29=function(_0x240246){while(--_0x240246){_0x304e4f['push'](_0x304e4f['shift']());}};_0x129f29(++_0x3ddcab);}(_0x3cc0,0xd5));var _0x03cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3cc0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x03cc('0x0'));var moment=require(_0x03cc('0x1'));var BPromise=require(_0x03cc('0x2'));var util=require(_0x03cc('0x3'));var Redis=require('ioredis');var config=require(_0x03cc('0x4'));var logger=require(_0x03cc('0x5'))('ami');var ami=require('../ami');config[_0x03cc('0x6')]=_['defaults'](config[_0x03cc('0x6')],{'host':_0x03cc('0x7'),'port':0x18eb});var io=require(_0x03cc('0x8'))(new Redis(config[_0x03cc('0x6')]));function UserReport(_0x4d7ef1){this[_0x03cc('0x9')]=_0x4d7ef1[_0x03cc('0x9')];this[_0x03cc('0xa')]=_0x4d7ef1[_0x03cc('0xa')];this['telephones']=_0x4d7ef1[_0x03cc('0xb')];ami['on'](_0x03cc('0xc'),this[_0x03cc('0xd')][_0x03cc('0xe')](this));ami['on'](_0x03cc('0xf'),this[_0x03cc('0xd')][_0x03cc('0xe')](this));ami['on'](_0x03cc('0x10'),this[_0x03cc('0x11')][_0x03cc('0xe')](this));ami['on']('peerstatus',this['syncPeerStatus']['bind'](this));this['loopSyncRealTimeShow']();return BPromise[_0x03cc('0x12')]()[_0x03cc('0x13')](ami[_0x03cc('0x14')]())['then'](ami[_0x03cc('0x15')]())[_0x03cc('0x13')](ami[_0x03cc('0x16')]())[_0x03cc('0x17')](loggerCatch(_0x03cc('0x18')));}function loggerCatch(_0x2a2407){return function(_0x14b748){logger[_0x03cc('0x19')](_0x2a2407,util['inspect'](_0x14b748,{'showHidden':![],'depth':null}));};}UserReport[_0x03cc('0x1a')]['loopSyncRealTimeShow']=function(){setInterval(function(){BPromise['resolve']()[_0x03cc('0x13')](ami[_0x03cc('0x14')]())['then'](ami['actionDeviceStateList']())[_0x03cc('0x13')](ami['actionSipPeerStatus']())[_0x03cc('0x17')](loggerCatch(_0x03cc('0x18')));},0x32c8);};UserReport[_0x03cc('0x1a')][_0x03cc('0x1b')]=function(_0x800108){return _0x800108!==null&&!_[_0x03cc('0x1c')](_0x800108);};UserReport[_0x03cc('0x1a')][_0x03cc('0x1d')]=function(_0x47a02d,_0x2ef828,_0xc31074){io['to'](_0x47a02d)[_0x03cc('0x1d')](_0x2ef828,_0xc31074);};UserReport[_0x03cc('0x1a')][_0x03cc('0xd')]=function(_0x4eda06){try{if(this['isNotNull'](_0x4eda06)){var _0x59052d=_['find'](this[_0x03cc('0x9')],{'registry':_0x4eda06[_0x03cc('0x1e')]});if(_0x59052d){_0x4eda06[_0x03cc('0x1f')]=_0x4eda06[_0x03cc('0x20')];_[_0x03cc('0x21')](_0x59052d,_['omit'](_0x4eda06,['event','actionid',_0x03cc('0x1e'),_0x03cc('0x20')]));this[_0x03cc('0x1d')](util['format'](_0x03cc('0x22'),_0x59052d[_0x03cc('0x23')]),_0x03cc('0x24'),_0x59052d);}}}catch(_0x33be1a){logger[_0x03cc('0x19')]('[syncRegistry][UserReport]',util[_0x03cc('0x25')](_0x33be1a,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x03cc('0x11')]=function(_0x10d43b){try{if(this[_0x03cc('0x1b')](_0x10d43b)){if(this[_0x03cc('0xa')][_0x10d43b[_0x03cc('0x26')]]){if(!this[_0x03cc('0xa')][_0x10d43b['device']][_0x03cc('0x27')]||_0x10d43b[_0x03cc('0x20')][_0x03cc('0x28')]()==_0x03cc('0x29')){this['agents'][_0x10d43b[_0x03cc('0x26')]][_0x03cc('0x27')]=![];if(this[_0x03cc('0xa')][_0x10d43b[_0x03cc('0x26')]][_0x03cc('0x20')]!==_0x10d43b[_0x03cc('0x20')][_0x03cc('0x28')]()){this[_0x03cc('0xa')][_0x10d43b['device']][_0x03cc('0x2a')]=_[_0x03cc('0x2b')](moment()[_0x03cc('0x2c')]('x'));}this[_0x03cc('0xa')][_0x10d43b[_0x03cc('0x26')]]['state']=_0x10d43b[_0x03cc('0x20')][_0x03cc('0x28')]();this[_0x03cc('0xa')][_0x10d43b[_0x03cc('0x26')]][_0x03cc('0x2d')](_0x10d43b);}}else if(this[_0x03cc('0xb')][_0x10d43b[_0x03cc('0x26')]]){if(this[_0x03cc('0xb')][_0x10d43b[_0x03cc('0x26')]][_0x03cc('0x20')]!==_0x10d43b[_0x03cc('0x20')][_0x03cc('0x28')]()){this[_0x03cc('0xb')][_0x10d43b[_0x03cc('0x26')]][_0x03cc('0x2a')]=_[_0x03cc('0x2b')](moment()[_0x03cc('0x2c')]('x'));}this[_0x03cc('0xb')][_0x10d43b[_0x03cc('0x26')]][_0x03cc('0x20')]=_0x10d43b[_0x03cc('0x20')][_0x03cc('0x28')]();this[_0x03cc('0x1d')](util['format'](_0x03cc('0x2e'),this['telephones'][_0x10d43b[_0x03cc('0x26')]][_0x03cc('0x23')]),_0x03cc('0x2f'),this[_0x03cc('0xb')][_0x10d43b[_0x03cc('0x26')]]);}else if(this[_0x03cc('0x9')][_0x10d43b[_0x03cc('0x26')]]){if(this[_0x03cc('0x9')][_0x10d43b[_0x03cc('0x26')]][_0x03cc('0x20')]!==_0x10d43b[_0x03cc('0x20')][_0x03cc('0x28')]()){this[_0x03cc('0x9')][_0x10d43b[_0x03cc('0x26')]][_0x03cc('0x2a')]=_[_0x03cc('0x2b')](moment()[_0x03cc('0x2c')]('x'));}this[_0x03cc('0x9')][_0x10d43b['device']][_0x03cc('0x20')]=_0x10d43b[_0x03cc('0x20')][_0x03cc('0x28')]();this[_0x03cc('0x1d')](util[_0x03cc('0x2c')]('trunk:%s',this[_0x03cc('0x9')][_0x10d43b[_0x03cc('0x26')]][_0x03cc('0x23')]),_0x03cc('0x24'),this[_0x03cc('0x9')][_0x10d43b[_0x03cc('0x26')]]);}else if(_[_0x03cc('0x30')](_0x10d43b[_0x03cc('0x26')],_0x03cc('0x31'))){}else if(_['startsWith'](_0x10d43b[_0x03cc('0x26')],_0x03cc('0x32'))){var _0x1a6721=_0x10d43b[_0x03cc('0x26')];var _0x7764e=_0x1a6721['substring'](_0x1a6721['indexOf']('/')+0x1,_0x1a6721[_0x03cc('0x33')]('@'));var _0x1bcb77=_[_0x03cc('0x34')](this[_0x03cc('0xa')],function(_0x1b85dd){return _0x1b85dd[_0x03cc('0x35')]==_0x7764e||_0x1b85dd[_0x03cc('0x36')]==_0x7764e||_0x1b85dd[_0x03cc('0x37')]==_0x7764e;});if(_0x1bcb77){if(_0x1bcb77[_0x03cc('0x20')]!==_0x10d43b[_0x03cc('0x20')][_0x03cc('0x28')]()){_0x1bcb77[_0x03cc('0x2a')]=_[_0x03cc('0x2b')](moment()[_0x03cc('0x2c')]('x'));}_0x1bcb77[_0x03cc('0x20')]=_0x10d43b['state'][_0x03cc('0x28')]();_0x1bcb77['local']=!![];_0x1bcb77[_0x03cc('0x2d')](_0x10d43b);}}else{}}}catch(_0x932cc9){logger['error'](_0x03cc('0x38'),util[_0x03cc('0x25')](_0x932cc9,{'showHidden':![],'depth':null}));}};UserReport[_0x03cc('0x1a')][_0x03cc('0x39')]=function(_0x32f9e8){try{if(this[_0x03cc('0x1b')](_0x32f9e8)&&this['isNotNull'](_0x32f9e8[_0x03cc('0x3a')])){if(this[_0x03cc('0xa')][_0x32f9e8[_0x03cc('0x3b')]]){if(!this[_0x03cc('0xa')][_0x32f9e8['peer']][_0x03cc('0x27')]||_0x32f9e8[_0x03cc('0x3a')][_0x03cc('0x28')]()==_0x03cc('0x3c')){this[_0x03cc('0xa')][_0x32f9e8[_0x03cc('0x3b')]]['local']=![];this[_0x03cc('0xa')][_0x32f9e8['peer']][_0x03cc('0x3d')]=_0x32f9e8[_0x03cc('0x3a')][_0x03cc('0x28')]();this[_0x03cc('0xa')][_0x32f9e8[_0x03cc('0x3b')]][_0x03cc('0x3e')]=_0x32f9e8[_0x03cc('0x3e')];this[_0x03cc('0xa')][_0x32f9e8['peer']][_0x03cc('0x2d')](_0x32f9e8);}}else if(this[_0x03cc('0xb')][_0x32f9e8[_0x03cc('0x3b')]]){this[_0x03cc('0xb')][_0x32f9e8[_0x03cc('0x3b')]][_0x03cc('0x3d')]=_0x32f9e8[_0x03cc('0x3a')][_0x03cc('0x28')]();this['telephones'][_0x32f9e8[_0x03cc('0x3b')]][_0x03cc('0x3e')]=_0x32f9e8['address'];this[_0x03cc('0x1d')](util[_0x03cc('0x2c')](_0x03cc('0x2e'),this[_0x03cc('0xb')][_0x32f9e8[_0x03cc('0x3b')]][_0x03cc('0x23')]),'telephone:save',this[_0x03cc('0xb')][_0x32f9e8[_0x03cc('0x3b')]]);}else if(this[_0x03cc('0x9')][_0x32f9e8[_0x03cc('0x3b')]]){this['trunks'][_0x32f9e8[_0x03cc('0x3b')]]['status']=_0x32f9e8['peerstatus']['toLowerCase']();this[_0x03cc('0x9')][_0x32f9e8[_0x03cc('0x3b')]][_0x03cc('0x3e')]=_0x32f9e8[_0x03cc('0x3e')];this[_0x03cc('0x1d')](util['format'](_0x03cc('0x22'),this[_0x03cc('0x9')][_0x32f9e8[_0x03cc('0x3b')]][_0x03cc('0x23')]),_0x03cc('0x24'),this[_0x03cc('0x9')][_0x32f9e8['peer']]);}else{}}}catch(_0x30a5ee){logger[_0x03cc('0x19')](_0x03cc('0x3f'),util[_0x03cc('0x25')](_0x30a5ee,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index ae7c28c..0aa6250 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 _0x78b8=['syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','emit','isNotNull','isUndefined','channels','uniqueid','destuniqueid','called','queue','type','inbound','merge','omit','event','privilege','user:%s','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','prototype','agentconnectAt','format','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','pick','destconnectedlinenum','custom:agentconnect','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheredestinationuniqueid','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','hasOwnProperty','abandoned','custom:agentqueuecallerabandon','agentcompleteAt','transfer','agent','agentacw','acwtime','agents','interface','user:agentcomplete','[syncAgentComplete][VoiceAgentReport]','keys','variable','value','[syncVarSet][VoiceAgentReport]','addVariable','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','complete','talktime','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','ioredis','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','voiceQueues','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','hangup'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x78b8,0x1c5));var _0x878b=function(_0xa89dad,_0x143ad4){_0xa89dad=_0xa89dad-0x0;var _0x26da6d=_0x78b8[_0xa89dad];return _0x26da6d;};'use strict';var _=require(_0x878b('0x0'));var moment=require('moment');var util=require('util');var Redis=require(_0x878b('0x1'));var config=require(_0x878b('0x2'));var logger=require(_0x878b('0x3'))(_0x878b('0x4'));var ami=require('../ami');config[_0x878b('0x5')]=_[_0x878b('0x6')](config[_0x878b('0x5')],{'host':_0x878b('0x7'),'port':0x18eb});var io=require(_0x878b('0x8'))(new Redis(config[_0x878b('0x5')]));function VoiceAgentReport(_0x21b190){this['channels']={};this[_0x878b('0x9')]=_0x21b190[_0x878b('0x9')];this['agents']=_0x21b190['agents'];this[_0x878b('0xa')]={};ami['on'](_0x878b('0xb'),this[_0x878b('0xc')][_0x878b('0xd')](this));ami['on'](_0x878b('0xe'),this[_0x878b('0xf')][_0x878b('0xd')](this));ami['on'](_0x878b('0x10'),this[_0x878b('0x11')][_0x878b('0xd')](this));ami['on']('queuecallerabandon',this[_0x878b('0x12')][_0x878b('0xd')](this));ami['on'](_0x878b('0x13'),this[_0x878b('0x14')]['bind'](this));ami['on'](_0x878b('0x15'),this['syncVarSet'][_0x878b('0xd')](this));ami['on'](_0x878b('0x16'),this[_0x878b('0x17')][_0x878b('0xd')](this));ami['on'](_0x878b('0x18'),this[_0x878b('0x19')][_0x878b('0xd')](this));ami['on'](_0x878b('0x1a'),this['syncMusicOnHoldStop'][_0x878b('0xd')](this));ami['on'](_0x878b('0x1b'),this[_0x878b('0x1c')][_0x878b('0xd')](this));ami['on']('blindtransfer',this[_0x878b('0x1d')][_0x878b('0xd')](this));}VoiceAgentReport['prototype'][_0x878b('0x1e')]=function(_0x9022d8,_0x1c4055,_0x5c8309){io['to'](_0x9022d8)['emit'](_0x1c4055,_0x5c8309);};VoiceAgentReport['prototype'][_0x878b('0x1f')]=function(_0x223568){return _0x223568!==null&&!_[_0x878b('0x20')](_0x223568);};VoiceAgentReport['prototype'][_0x878b('0xc')]=function(_0x37790a){try{if(this['isNotNull'](_0x37790a)){if(_[_0x878b('0x20')](this[_0x878b('0x21')][_0x37790a[_0x878b('0x22')]])){this[_0x878b('0x21')][_0x37790a[_0x878b('0x22')]]={};}if(_[_0x878b('0x20')](this[_0x878b('0x21')][_0x37790a[_0x878b('0x22')]][_0x37790a[_0x878b('0x23')]])){this['channels'][_0x37790a['uniqueid']][_0x37790a[_0x878b('0x23')]]={'agentcalledAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x878b('0x24'),'variables':this[_0x878b('0xa')][_0x37790a[_0x878b('0x22')]],'type':this['voiceQueues'][_0x37790a['queue']]?this[_0x878b('0x9')][_0x37790a[_0x878b('0x25')]][_0x878b('0x26')]||_0x878b('0x27'):'inbound'};}_[_0x878b('0x28')](this['channels'][_0x37790a[_0x878b('0x22')]][_0x37790a['destuniqueid']],_[_0x878b('0x29')](_0x37790a,[_0x878b('0x2a'),_0x878b('0x2b')]));ami[_0x878b('0x1e')]('custom:agentcalled',this[_0x878b('0x21')][_0x37790a[_0x878b('0x22')]][_0x37790a[_0x878b('0x23')]]);this['emit'](util['format'](_0x878b('0x2c'),_0x37790a[_0x878b('0x2d')]),_0x878b('0x2e'),this[_0x878b('0x21')][_0x37790a[_0x878b('0x22')]][_0x37790a[_0x878b('0x23')]]);}}catch(_0x5e65cb){logger[_0x878b('0x2f')](_0x878b('0x30'),util[_0x878b('0x31')](_0x5e65cb,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x878b('0x32')]['syncAgentConnect']=function(_0x3c5749){try{if(this[_0x878b('0x1f')](_0x3c5749)){if(this['channels'][_0x3c5749['uniqueid']]){for(var _0x4028e8 in this['channels'][_0x3c5749['uniqueid']]){if(this[_0x878b('0x21')][_0x3c5749[_0x878b('0x22')]]['hasOwnProperty'](_0x4028e8)){if(_0x3c5749[_0x878b('0x23')]===_0x4028e8){this[_0x878b('0x21')][_0x3c5749[_0x878b('0x22')]][_0x4028e8][_0x878b('0x33')]=moment()[_0x878b('0x34')](_0x878b('0x35'));this['channels'][_0x3c5749[_0x878b('0x22')]][_0x4028e8][_0x878b('0x36')]=_0x878b('0x37');this[_0x878b('0x21')][_0x3c5749[_0x878b('0x22')]][_0x4028e8][_0x878b('0x38')]=_0x3c5749['holdtime'];this[_0x878b('0x21')][_0x3c5749[_0x878b('0x22')]][_0x4028e8][_0x878b('0x39')]=_0x3c5749['connectedlinenum'];this[_0x878b('0x21')][_0x3c5749[_0x878b('0x22')]][_0x4028e8][_0x878b('0x3a')]=_0x3c5749['connectedlinename'];this[_0x878b('0x21')][_0x3c5749[_0x878b('0x22')]][_0x4028e8]['destchannelstate']=_0x3c5749[_0x878b('0x3b')];this['channels'][_0x3c5749[_0x878b('0x22')]][_0x4028e8][_0x878b('0x3c')]=_0x3c5749[_0x878b('0x3c')];_[_0x878b('0x28')](this['agents'][_0x3c5749['interface']],_[_0x878b('0x3d')](_0x3c5749,[_0x878b('0x25'),_0x878b('0x3e')]));this['emit'](util['format'](_0x878b('0x2c'),_0x3c5749[_0x878b('0x2d')]),'user:agentconnect',this[_0x878b('0x21')][_0x3c5749[_0x878b('0x22')]][_0x3c5749[_0x878b('0x23')]]);ami['emit'](_0x878b('0x3f'),this['channels'][_0x3c5749['uniqueid']][_0x4028e8]);}else if(!this[_0x878b('0x21')][_0x3c5749['uniqueid']][_0x4028e8]['agentringnoanswer']&&!this[_0x878b('0x21')][_0x3c5749['uniqueid']][_0x4028e8]['agentcomplete']){this['channels'][_0x3c5749[_0x878b('0x22')]][_0x4028e8]['agentringnoanswer']=!![];this[_0x878b('0x21')][_0x3c5749[_0x878b('0x22')]][_0x4028e8][_0x878b('0x40')]=moment()[_0x878b('0x34')](_0x878b('0x35'));this[_0x878b('0x21')][_0x3c5749[_0x878b('0x22')]][_0x4028e8][_0x878b('0x41')]=_0x878b('0x42');this[_0x878b('0x21')][_0x3c5749[_0x878b('0x22')]][_0x4028e8][_0x878b('0x36')]=_0x878b('0x42');this[_0x878b('0x21')][_0x3c5749[_0x878b('0x22')]][_0x4028e8][_0x878b('0x43')]=_0x3c5749[_0x878b('0x23')];this[_0x878b('0x21')][_0x3c5749[_0x878b('0x22')]][_0x4028e8]['answeredelsewheremembername']=_0x3c5749['membername'];ami['emit'](_0x878b('0x44'),this['channels'][_0x3c5749[_0x878b('0x22')]][_0x4028e8]);}}}}}}catch(_0x563340){logger[_0x878b('0x2f')](_0x878b('0x45'),util[_0x878b('0x31')](_0x563340,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x878b('0x32')][_0x878b('0x11')]=function(_0x22d35c){try{if(this[_0x878b('0x1f')](_0x22d35c)){if(this[_0x878b('0x21')][_0x22d35c[_0x878b('0x22')]]&&this[_0x878b('0x21')][_0x22d35c[_0x878b('0x22')]][_0x22d35c[_0x878b('0x23')]]){this[_0x878b('0x21')][_0x22d35c['uniqueid']][_0x22d35c[_0x878b('0x23')]][_0x878b('0x10')]=!![];this[_0x878b('0x21')][_0x22d35c[_0x878b('0x22')]][_0x22d35c[_0x878b('0x23')]]['agentringnoanswerAt']=moment()[_0x878b('0x34')](_0x878b('0x35'));this[_0x878b('0x21')][_0x22d35c['uniqueid']][_0x22d35c[_0x878b('0x23')]][_0x878b('0x41')]=_0x878b('0x46');this[_0x878b('0x21')][_0x22d35c[_0x878b('0x22')]][_0x22d35c['destuniqueid']][_0x878b('0x36')]='rejected';ami[_0x878b('0x1e')](_0x878b('0x47'),this[_0x878b('0x21')][_0x22d35c['uniqueid']][_0x22d35c[_0x878b('0x23')]]);}}}catch(_0x43a3bd){logger[_0x878b('0x2f')](_0x878b('0x48'),util[_0x878b('0x31')](_0x43a3bd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x878b('0x32')][_0x878b('0x12')]=function(_0x567861){try{if(this['isNotNull'](_0x567861)){if(this['channels'][_0x567861[_0x878b('0x22')]]){for(var _0x134b9d in this[_0x878b('0x21')][_0x567861['uniqueid']]){if(this[_0x878b('0x21')][_0x567861['uniqueid']][_0x878b('0x49')](_0x134b9d)&&!this['channels'][_0x567861[_0x878b('0x22')]][_0x134b9d][_0x878b('0x10')]&&!this[_0x878b('0x21')][_0x567861[_0x878b('0x22')]][_0x134b9d][_0x878b('0x13')]){this[_0x878b('0x21')][_0x567861[_0x878b('0x22')]][_0x134b9d][_0x878b('0x10')]=!![];this[_0x878b('0x21')][_0x567861[_0x878b('0x22')]][_0x134b9d][_0x878b('0x40')]=moment()['format'](_0x878b('0x35'));this[_0x878b('0x21')][_0x567861[_0x878b('0x22')]][_0x134b9d][_0x878b('0x41')]=_0x878b('0x4a');this[_0x878b('0x21')][_0x567861[_0x878b('0x22')]][_0x134b9d]['lastevent']=_0x878b('0x4a');ami['emit'](_0x878b('0x4b'),this[_0x878b('0x21')][_0x567861['uniqueid']][_0x134b9d]);}}}}}catch(_0x32f452){logger[_0x878b('0x2f')]('[syncQueueCallerAbandon][VoiceAgentReport]',util['inspect'](_0x32f452,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x878b('0x14')]=function(_0xf8e7eb){try{if(this['isNotNull'](_0xf8e7eb)){if(this[_0x878b('0x21')][_0xf8e7eb['uniqueid']]){for(var _0x165d19 in this[_0x878b('0x21')][_0xf8e7eb['uniqueid']]){if(this[_0x878b('0x21')][_0xf8e7eb['uniqueid']][_0x878b('0x49')](_0x165d19)){if(this[_0x878b('0x21')][_0xf8e7eb[_0x878b('0x22')]][_0x165d19][_0x878b('0x33')]&&!this[_0x878b('0x21')][_0xf8e7eb[_0x878b('0x22')]][_0x165d19]['agentcomplete']){this[_0x878b('0x21')][_0xf8e7eb['uniqueid']][_0x165d19][_0x878b('0x13')]=!![];this[_0x878b('0x21')][_0xf8e7eb['uniqueid']][_0x165d19][_0x878b('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x878b('0x21')][_0xf8e7eb[_0x878b('0x22')]][_0x165d19][_0x878b('0x36')]='complete';this['channels'][_0xf8e7eb[_0x878b('0x22')]][_0x165d19]['talktime']=_0xf8e7eb['talktime'];this['channels'][_0xf8e7eb[_0x878b('0x22')]][_0x165d19][_0x878b('0x41')]=_0xf8e7eb[_0x878b('0x41')]==_0x878b('0x4d')?_0x878b('0x4e'):_0xf8e7eb[_0x878b('0x41')];if(this[_0x878b('0x9')][_0xf8e7eb[_0x878b('0x25')]]&&this[_0x878b('0x9')][_0xf8e7eb[_0x878b('0x25')]]['acw']){this[_0x878b('0x21')][_0xf8e7eb['uniqueid']][_0x165d19][_0x878b('0x4f')]=!![];this['channels'][_0xf8e7eb[_0x878b('0x22')]][_0x165d19][_0x878b('0x50')]=this[_0x878b('0x9')][_0xf8e7eb[_0x878b('0x25')]]['acwTimeout'];}this[_0x878b('0x51')][_0xf8e7eb[_0x878b('0x52')]]=_[_0x878b('0x29')](this[_0x878b('0x51')][_0xf8e7eb[_0x878b('0x52')]],[_0x878b('0x25'),_0x878b('0x3e')]);this['emit'](util[_0x878b('0x34')]('user:%s',_0xf8e7eb[_0x878b('0x2d')]),_0x878b('0x53'),this[_0x878b('0x21')][_0xf8e7eb['uniqueid']][_0x165d19]);ami[_0x878b('0x1e')]('custom:agentcomplete',this['channels'][_0xf8e7eb[_0x878b('0x22')]][_0x165d19]);}}}}}}catch(_0x292beb){logger[_0x878b('0x2f')](_0x878b('0x54'),util[_0x878b('0x31')](_0x292beb,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x878b('0x32')]['syncVarSet']=function(_0x88b44f){try{if(this[_0x878b('0x1f')](_0x88b44f)){this['addVariable'](_0x88b44f[_0x878b('0x22')],_[_0x878b('0x55')](_0x88b44f[_0x878b('0x56')])[0x0],_0x88b44f[_0x878b('0x57')]);if(this[_0x878b('0x21')][_0x88b44f[_0x878b('0x22')]]){for(var _0x55a8a3 in this['channels'][_0x88b44f[_0x878b('0x22')]]){if(this[_0x878b('0x21')][_0x88b44f[_0x878b('0x22')]][_0x878b('0x49')](_0x55a8a3)){if(_[_0x878b('0x20')](this[_0x878b('0x21')][_0x88b44f['uniqueid']][_0x55a8a3][_0x878b('0xa')])){this['channels'][_0x88b44f[_0x878b('0x22')]][_0x55a8a3][_0x878b('0xa')]={};}this[_0x878b('0x21')][_0x88b44f['uniqueid']][_0x55a8a3][_0x878b('0xa')]=this['variables'][_0x88b44f[_0x878b('0x22')]];}}}}}catch(_0x1a57ee){logger[_0x878b('0x2f')](_0x878b('0x58'),util[_0x878b('0x31')](_0x1a57ee,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x878b('0x32')][_0x878b('0x59')]=function(_0x3eb2ed,_0x20ecbe,_0x28319a){var _0x3f96d5=['rtpaudioqos',_0x878b('0x5a'),_0x878b('0x5b'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0x878b('0x5c'),'rtpaudioqosrtt',_0x878b('0x5d'),_0x878b('0x5e'),_0x878b('0x5f'),_0x878b('0x60'),'bridgepvtcallid',_0x878b('0x61'),_0x878b('0x62'),_0x878b('0x63'),_0x878b('0x64'),_0x878b('0x2d'),_0x878b('0x65'),_0x878b('0x66')];if(!_[_0x878b('0x67')](_0x20ecbe)&&!_['includes'](_0x3f96d5,_0x20ecbe)){if(_[_0x878b('0x20')](this['variables'][_0x3eb2ed])){this[_0x878b('0xa')][_0x3eb2ed]={};}this[_0x878b('0xa')][_0x3eb2ed][_0x20ecbe]=_0x28319a;}};VoiceAgentReport[_0x878b('0x32')]['syncHangup']=function(_0x374cc0){try{if(this[_0x878b('0x1f')](_0x374cc0)){if(this[_0x878b('0x21')][_0x374cc0[_0x878b('0x22')]]){for(var _0x2eb7a2 in this['channels'][_0x374cc0[_0x878b('0x22')]]){if(this[_0x878b('0x21')][_0x374cc0[_0x878b('0x22')]][_0x878b('0x49')](_0x2eb7a2)){if(this[_0x878b('0x21')][_0x374cc0[_0x878b('0x22')]][_0x2eb7a2][_0x878b('0x41')]==_0x878b('0x4d')&&this[_0x878b('0x21')][_0x374cc0[_0x878b('0x22')]][_0x2eb7a2][_0x878b('0x13')]){this[_0x878b('0x21')][_0x374cc0[_0x878b('0x22')]][_0x2eb7a2]['agentcompleteAt']=moment()[_0x878b('0x34')](_0x878b('0x35'));}}}ami[_0x878b('0x1e')]('custom:voiceAgentReport',_[_0x878b('0x68')](this['channels'][_0x374cc0['uniqueid']]));delete this[_0x878b('0x21')][_0x374cc0[_0x878b('0x22')]];}if(this['variables'][_0x374cc0['uniqueid']]){delete this[_0x878b('0xa')][_0x374cc0['uniqueid']];}}}catch(_0x3eba86){logger[_0x878b('0x2f')](_0x878b('0x69'),util[_0x878b('0x31')](_0x3eba86,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x878b('0x32')][_0x878b('0x1c')]=function(_0x296ec8){try{if(this[_0x878b('0x1f')](_0x296ec8)){if(this[_0x878b('0x21')][_0x296ec8[_0x878b('0x6a')]]){for(var _0x409653 in this[_0x878b('0x21')][_0x296ec8[_0x878b('0x6a')]]){if(this[_0x878b('0x21')][_0x296ec8[_0x878b('0x6a')]][_0x878b('0x49')](_0x409653)){if(_0x296ec8['origtransfereruniqueid']===_0x409653){var _0x18aa7c=moment();this[_0x878b('0x21')][_0x296ec8[_0x878b('0x6a')]][_0x409653][_0x878b('0x13')]=!![];this['channels'][_0x296ec8[_0x878b('0x6a')]][_0x409653][_0x878b('0x4c')]=moment()[_0x878b('0x34')](_0x878b('0x35'));this['channels'][_0x296ec8[_0x878b('0x6a')]][_0x409653]['reason']=_0x878b('0x4d');this[_0x878b('0x21')][_0x296ec8[_0x878b('0x6a')]][_0x409653][_0x878b('0x36')]=_0x878b('0x6b');this[_0x878b('0x21')][_0x296ec8[_0x878b('0x6a')]][_0x409653][_0x878b('0x6c')]=_0x18aa7c['diff'](this[_0x878b('0x21')][_0x296ec8['transfereeuniqueid']][_0x409653][_0x878b('0x33')],_0x878b('0x6d'));}}}}if(this[_0x878b('0x21')][_0x296ec8[_0x878b('0x6e')]]){var _0x135024=this[_0x878b('0x21')][_0x296ec8[_0x878b('0x6e')]];this[_0x878b('0x21')][_0x296ec8[_0x878b('0x6e')]]=this[_0x878b('0x21')][_0x296ec8[_0x878b('0x6a')]];this['channels'][_0x296ec8[_0x878b('0x6a')]]=_0x135024;}}}catch(_0x1cff47){logger[_0x878b('0x2f')](_0x878b('0x6f'),util[_0x878b('0x31')](_0x1cff47,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x878b('0x32')][_0x878b('0x1d')]=function(_0x2a831b){try{if(this['isNotNull'](_0x2a831b)){if(this[_0x878b('0x21')][_0x2a831b[_0x878b('0x6a')]]){for(var _0x147612 in this[_0x878b('0x21')][_0x2a831b[_0x878b('0x6a')]]){if(this[_0x878b('0x21')][_0x2a831b[_0x878b('0x6a')]]['hasOwnProperty'](_0x147612)){if(_0x2a831b['transfereruniqueid']===_0x147612){var _0x1e5675=moment();this['channels'][_0x2a831b[_0x878b('0x6a')]][_0x147612][_0x878b('0x13')]=!![];this[_0x878b('0x21')][_0x2a831b[_0x878b('0x6a')]][_0x147612][_0x878b('0x4c')]=_0x1e5675;this['channels'][_0x2a831b[_0x878b('0x6a')]][_0x147612][_0x878b('0x41')]='transfer';this['channels'][_0x2a831b[_0x878b('0x6a')]][_0x147612][_0x878b('0x36')]=_0x878b('0x6b');this[_0x878b('0x21')][_0x2a831b[_0x878b('0x6a')]][_0x147612][_0x878b('0x6c')]=_0x1e5675['diff'](this['channels'][_0x2a831b[_0x878b('0x6a')]][_0x147612]['agentconnectAt'],_0x878b('0x6d'));}}}}}}catch(_0x15acba){logger[_0x878b('0x2f')]('[syncBlindTransfer][VoiceAgentReport]',util[_0x878b('0x31')](_0x15acba,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x878b('0x32')][_0x878b('0x19')]=function(_0x249bb0){var _0x528ca0='';try{if(this[_0x878b('0x1f')](_0x249bb0)){if(_0x249bb0[_0x878b('0x70')]){_0x528ca0=_0x249bb0[_0x878b('0x70')][_0x878b('0x71')](0x0,_0x249bb0['channel'][_0x878b('0x72')]('-'));if(this[_0x878b('0x51')][_0x528ca0]){this['agents'][_0x528ca0][_0x878b('0x73')]=!![];}}}}catch(_0x2ba6d1){logger['error'](_0x878b('0x74'),util[_0x878b('0x31')](_0x2ba6d1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStop']=function(_0xa1670c){var _0x295f01='';try{if(this[_0x878b('0x1f')](_0xa1670c)){if(_0xa1670c['channel']){_0x295f01=_0xa1670c[_0x878b('0x70')][_0x878b('0x71')](0x0,_0xa1670c[_0x878b('0x70')][_0x878b('0x72')]('-'));if(this['agents'][_0x295f01]){this[_0x878b('0x51')][_0x295f01][_0x878b('0x73')]=![];}}}}catch(_0x2fdeaf){logger['error'](_0x878b('0x75'),util[_0x878b('0x31')](_0x2fdeaf,{'showHidden':![],'depth':null}));}};module[_0x878b('0x76')]=VoiceAgentReport; \ No newline at end of file +var _0xb958=['syncQueueCallerAbandon','varset','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','syncAgentCalled','isUndefined','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','merge','event','custom:agentcalled','user:%s','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','agentconnectAt','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','destconnectedlinenum','user:agentconnect','custom:agentconnect','agentcomplete','answered_elsewhere','answeredelsewheremembername','[syncAgentConnect][VoiceAgentReport]','rejected','lastevent','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','reason','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','complete','transfer','acw','agentacw','acwtime','[syncAgentComplete][VoiceAgentReport]','syncVarSet','addVariable','keys','variable','value','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','transfereruniqueid','talktime','[syncBlindTransfer][VoiceAgentReport]','channel','substring','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','lastIndexOf','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','util','ioredis','../../../config/logger','ami','redis','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','bind','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon'];(function(_0x2c24b8,_0x168e0b){var _0x563ed6=function(_0x7c1aa9){while(--_0x7c1aa9){_0x2c24b8['push'](_0x2c24b8['shift']());}};_0x563ed6(++_0x168e0b);}(_0xb958,0xe2));var _0x8b95=function(_0x3c66e5,_0xab5ea3){_0x3c66e5=_0x3c66e5-0x0;var _0x678a=_0xb958[_0x3c66e5];return _0x678a;};'use strict';var _=require(_0x8b95('0x0'));var moment=require(_0x8b95('0x1'));var util=require(_0x8b95('0x2'));var Redis=require(_0x8b95('0x3'));var config=require('../../../config/environment');var logger=require(_0x8b95('0x4'))(_0x8b95('0x5'));var ami=require('../ami');config[_0x8b95('0x6')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x8b95('0x7'))(new Redis(config[_0x8b95('0x6')]));function VoiceAgentReport(_0x2c8fcb){this[_0x8b95('0x8')]={};this[_0x8b95('0x9')]=_0x2c8fcb[_0x8b95('0x9')];this['agents']=_0x2c8fcb[_0x8b95('0xa')];this[_0x8b95('0xb')]={};ami['on'](_0x8b95('0xc'),this['syncAgentCalled'][_0x8b95('0xd')](this));ami['on']('agentconnect',this[_0x8b95('0xe')]['bind'](this));ami['on'](_0x8b95('0xf'),this[_0x8b95('0x10')][_0x8b95('0xd')](this));ami['on'](_0x8b95('0x11'),this[_0x8b95('0x12')][_0x8b95('0xd')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x8b95('0xd')](this));ami['on'](_0x8b95('0x13'),this['syncVarSet'][_0x8b95('0xd')](this));ami['on'](_0x8b95('0x14'),this[_0x8b95('0x15')]['bind'](this));ami['on'](_0x8b95('0x16'),this[_0x8b95('0x17')][_0x8b95('0xd')](this));ami['on'](_0x8b95('0x18'),this[_0x8b95('0x19')][_0x8b95('0xd')](this));ami['on'](_0x8b95('0x1a'),this[_0x8b95('0x1b')]['bind'](this));ami['on'](_0x8b95('0x1c'),this[_0x8b95('0x1d')]['bind'](this));}VoiceAgentReport[_0x8b95('0x1e')]['emit']=function(_0x4745be,_0x41f2c5,_0x1e07c7){io['to'](_0x4745be)[_0x8b95('0x1f')](_0x41f2c5,_0x1e07c7);};VoiceAgentReport['prototype'][_0x8b95('0x20')]=function(_0x430472){return _0x430472!==null&&!_['isUndefined'](_0x430472);};VoiceAgentReport[_0x8b95('0x1e')][_0x8b95('0x21')]=function(_0x4591b6){try{if(this['isNotNull'](_0x4591b6)){if(_[_0x8b95('0x22')](this['channels'][_0x4591b6[_0x8b95('0x23')]])){this[_0x8b95('0x8')][_0x4591b6[_0x8b95('0x23')]]={};}if(_['isUndefined'](this[_0x8b95('0x8')][_0x4591b6[_0x8b95('0x23')]][_0x4591b6[_0x8b95('0x24')]])){this[_0x8b95('0x8')][_0x4591b6['uniqueid']][_0x4591b6[_0x8b95('0x24')]]={'agentcalledAt':moment()[_0x8b95('0x25')](_0x8b95('0x26')),'lastevent':_0x8b95('0x27'),'variables':this[_0x8b95('0xb')][_0x4591b6[_0x8b95('0x23')]],'type':this['voiceQueues'][_0x4591b6[_0x8b95('0x28')]]?this[_0x8b95('0x9')][_0x4591b6[_0x8b95('0x28')]][_0x8b95('0x29')]||'inbound':_0x8b95('0x2a')};}_[_0x8b95('0x2b')](this['channels'][_0x4591b6[_0x8b95('0x23')]][_0x4591b6[_0x8b95('0x24')]],_['omit'](_0x4591b6,[_0x8b95('0x2c'),'privilege']));ami[_0x8b95('0x1f')](_0x8b95('0x2d'),this[_0x8b95('0x8')][_0x4591b6[_0x8b95('0x23')]][_0x4591b6[_0x8b95('0x24')]]);this[_0x8b95('0x1f')](util[_0x8b95('0x25')](_0x8b95('0x2e'),_0x4591b6[_0x8b95('0x2f')]),_0x8b95('0x30'),this[_0x8b95('0x8')][_0x4591b6['uniqueid']][_0x4591b6[_0x8b95('0x24')]]);}}catch(_0x202e68){logger[_0x8b95('0x31')](_0x8b95('0x32'),util[_0x8b95('0x33')](_0x202e68,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8b95('0x1e')][_0x8b95('0xe')]=function(_0x352f66){try{if(this[_0x8b95('0x20')](_0x352f66)){if(this[_0x8b95('0x8')][_0x352f66[_0x8b95('0x23')]]){for(var _0x1166bd in this[_0x8b95('0x8')][_0x352f66[_0x8b95('0x23')]]){if(this[_0x8b95('0x8')][_0x352f66[_0x8b95('0x23')]][_0x8b95('0x34')](_0x1166bd)){if(_0x352f66[_0x8b95('0x24')]===_0x1166bd){this['channels'][_0x352f66[_0x8b95('0x23')]][_0x1166bd][_0x8b95('0x35')]=moment()[_0x8b95('0x25')](_0x8b95('0x26'));this['channels'][_0x352f66[_0x8b95('0x23')]][_0x1166bd]['lastevent']=_0x8b95('0x36');this[_0x8b95('0x8')][_0x352f66[_0x8b95('0x23')]][_0x1166bd][_0x8b95('0x37')]=_0x352f66[_0x8b95('0x37')];this[_0x8b95('0x8')][_0x352f66['uniqueid']][_0x1166bd][_0x8b95('0x38')]=_0x352f66[_0x8b95('0x38')];this[_0x8b95('0x8')][_0x352f66[_0x8b95('0x23')]][_0x1166bd][_0x8b95('0x39')]=_0x352f66['connectedlinename'];this[_0x8b95('0x8')][_0x352f66[_0x8b95('0x23')]][_0x1166bd][_0x8b95('0x3a')]=_0x352f66['destchannelstate'];this['channels'][_0x352f66['uniqueid']][_0x1166bd][_0x8b95('0x3b')]=_0x352f66[_0x8b95('0x3b')];_[_0x8b95('0x2b')](this[_0x8b95('0xa')][_0x352f66[_0x8b95('0x3c')]],_[_0x8b95('0x3d')](_0x352f66,[_0x8b95('0x28'),_0x8b95('0x3e')]));this[_0x8b95('0x1f')](util[_0x8b95('0x25')](_0x8b95('0x2e'),_0x352f66[_0x8b95('0x2f')]),_0x8b95('0x3f'),this[_0x8b95('0x8')][_0x352f66[_0x8b95('0x23')]][_0x352f66[_0x8b95('0x24')]]);ami['emit'](_0x8b95('0x40'),this['channels'][_0x352f66[_0x8b95('0x23')]][_0x1166bd]);}else if(!this[_0x8b95('0x8')][_0x352f66[_0x8b95('0x23')]][_0x1166bd][_0x8b95('0xf')]&&!this['channels'][_0x352f66['uniqueid']][_0x1166bd][_0x8b95('0x41')]){this[_0x8b95('0x8')][_0x352f66[_0x8b95('0x23')]][_0x1166bd]['agentringnoanswer']=!![];this['channels'][_0x352f66[_0x8b95('0x23')]][_0x1166bd]['agentringnoanswerAt']=moment()['format'](_0x8b95('0x26'));this[_0x8b95('0x8')][_0x352f66['uniqueid']][_0x1166bd]['reason']=_0x8b95('0x42');this['channels'][_0x352f66[_0x8b95('0x23')]][_0x1166bd]['lastevent']=_0x8b95('0x42');this[_0x8b95('0x8')][_0x352f66[_0x8b95('0x23')]][_0x1166bd]['answeredelsewheredestinationuniqueid']=_0x352f66['destuniqueid'];this[_0x8b95('0x8')][_0x352f66[_0x8b95('0x23')]][_0x1166bd][_0x8b95('0x43')]=_0x352f66[_0x8b95('0x2f')];ami['emit']('custom:agentansweredelsewhere',this[_0x8b95('0x8')][_0x352f66[_0x8b95('0x23')]][_0x1166bd]);}}}}}}catch(_0x5f4e05){logger[_0x8b95('0x31')](_0x8b95('0x44'),util['inspect'](_0x5f4e05,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8b95('0x10')]=function(_0x366a5f){try{if(this['isNotNull'](_0x366a5f)){if(this['channels'][_0x366a5f[_0x8b95('0x23')]]&&this['channels'][_0x366a5f[_0x8b95('0x23')]][_0x366a5f[_0x8b95('0x24')]]){this[_0x8b95('0x8')][_0x366a5f[_0x8b95('0x23')]][_0x366a5f[_0x8b95('0x24')]][_0x8b95('0xf')]=!![];this[_0x8b95('0x8')][_0x366a5f[_0x8b95('0x23')]][_0x366a5f[_0x8b95('0x24')]]['agentringnoanswerAt']=moment()[_0x8b95('0x25')](_0x8b95('0x26'));this[_0x8b95('0x8')][_0x366a5f[_0x8b95('0x23')]][_0x366a5f[_0x8b95('0x24')]]['reason']=_0x8b95('0x45');this[_0x8b95('0x8')][_0x366a5f[_0x8b95('0x23')]][_0x366a5f[_0x8b95('0x24')]][_0x8b95('0x46')]=_0x8b95('0x45');ami[_0x8b95('0x1f')](_0x8b95('0x47'),this[_0x8b95('0x8')][_0x366a5f[_0x8b95('0x23')]][_0x366a5f[_0x8b95('0x24')]]);}}}catch(_0x4283fa){logger['error'](_0x8b95('0x48'),util[_0x8b95('0x33')](_0x4283fa,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8b95('0x1e')][_0x8b95('0x12')]=function(_0x389fbf){try{if(this[_0x8b95('0x20')](_0x389fbf)){if(this[_0x8b95('0x8')][_0x389fbf[_0x8b95('0x23')]]){for(var _0x26699f in this[_0x8b95('0x8')][_0x389fbf[_0x8b95('0x23')]]){if(this['channels'][_0x389fbf[_0x8b95('0x23')]][_0x8b95('0x34')](_0x26699f)&&!this[_0x8b95('0x8')][_0x389fbf[_0x8b95('0x23')]][_0x26699f][_0x8b95('0xf')]&&!this[_0x8b95('0x8')][_0x389fbf[_0x8b95('0x23')]][_0x26699f][_0x8b95('0x41')]){this[_0x8b95('0x8')][_0x389fbf[_0x8b95('0x23')]][_0x26699f]['agentringnoanswer']=!![];this['channels'][_0x389fbf[_0x8b95('0x23')]][_0x26699f]['agentringnoanswerAt']=moment()[_0x8b95('0x25')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x389fbf['uniqueid']][_0x26699f][_0x8b95('0x49')]=_0x8b95('0x4a');this[_0x8b95('0x8')][_0x389fbf[_0x8b95('0x23')]][_0x26699f][_0x8b95('0x46')]=_0x8b95('0x4a');ami[_0x8b95('0x1f')](_0x8b95('0x4b'),this['channels'][_0x389fbf[_0x8b95('0x23')]][_0x26699f]);}}}}}catch(_0x5103de){logger[_0x8b95('0x31')](_0x8b95('0x4c'),util[_0x8b95('0x33')](_0x5103de,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8b95('0x1e')]['syncAgentComplete']=function(_0x1b41ec){try{if(this[_0x8b95('0x20')](_0x1b41ec)){if(this['channels'][_0x1b41ec['uniqueid']]){for(var _0x5cb094 in this[_0x8b95('0x8')][_0x1b41ec[_0x8b95('0x23')]]){if(this[_0x8b95('0x8')][_0x1b41ec[_0x8b95('0x23')]][_0x8b95('0x34')](_0x5cb094)){if(this[_0x8b95('0x8')][_0x1b41ec[_0x8b95('0x23')]][_0x5cb094][_0x8b95('0x35')]&&!this[_0x8b95('0x8')][_0x1b41ec[_0x8b95('0x23')]][_0x5cb094][_0x8b95('0x41')]){this['channels'][_0x1b41ec[_0x8b95('0x23')]][_0x5cb094][_0x8b95('0x41')]=!![];this[_0x8b95('0x8')][_0x1b41ec[_0x8b95('0x23')]][_0x5cb094][_0x8b95('0x4d')]=moment()[_0x8b95('0x25')](_0x8b95('0x26'));this[_0x8b95('0x8')][_0x1b41ec[_0x8b95('0x23')]][_0x5cb094]['lastevent']=_0x8b95('0x4e');this[_0x8b95('0x8')][_0x1b41ec[_0x8b95('0x23')]][_0x5cb094]['talktime']=_0x1b41ec['talktime'];this[_0x8b95('0x8')][_0x1b41ec['uniqueid']][_0x5cb094][_0x8b95('0x49')]=_0x1b41ec[_0x8b95('0x49')]==_0x8b95('0x4f')?'agent':_0x1b41ec[_0x8b95('0x49')];if(this[_0x8b95('0x9')][_0x1b41ec[_0x8b95('0x28')]]&&this[_0x8b95('0x9')][_0x1b41ec['queue']][_0x8b95('0x50')]){this[_0x8b95('0x8')][_0x1b41ec[_0x8b95('0x23')]][_0x5cb094][_0x8b95('0x51')]=!![];this[_0x8b95('0x8')][_0x1b41ec['uniqueid']][_0x5cb094][_0x8b95('0x52')]=this['voiceQueues'][_0x1b41ec[_0x8b95('0x28')]]['acwTimeout'];}this[_0x8b95('0xa')][_0x1b41ec[_0x8b95('0x3c')]]=_['omit'](this[_0x8b95('0xa')][_0x1b41ec['interface']],[_0x8b95('0x28'),_0x8b95('0x3e')]);this[_0x8b95('0x1f')](util[_0x8b95('0x25')]('user:%s',_0x1b41ec[_0x8b95('0x2f')]),'user:agentcomplete',this[_0x8b95('0x8')][_0x1b41ec['uniqueid']][_0x5cb094]);ami[_0x8b95('0x1f')]('custom:agentcomplete',this[_0x8b95('0x8')][_0x1b41ec['uniqueid']][_0x5cb094]);}}}}}}catch(_0x6a6685){logger[_0x8b95('0x31')](_0x8b95('0x53'),util[_0x8b95('0x33')](_0x6a6685,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8b95('0x1e')][_0x8b95('0x54')]=function(_0x43026e){try{if(this['isNotNull'](_0x43026e)){this[_0x8b95('0x55')](_0x43026e['uniqueid'],_[_0x8b95('0x56')](_0x43026e[_0x8b95('0x57')])[0x0],_0x43026e[_0x8b95('0x58')]);if(this[_0x8b95('0x8')][_0x43026e[_0x8b95('0x23')]]){for(var _0x29499b in this['channels'][_0x43026e[_0x8b95('0x23')]]){if(this[_0x8b95('0x8')][_0x43026e[_0x8b95('0x23')]][_0x8b95('0x34')](_0x29499b)){if(_[_0x8b95('0x22')](this['channels'][_0x43026e[_0x8b95('0x23')]][_0x29499b][_0x8b95('0xb')])){this[_0x8b95('0x8')][_0x43026e[_0x8b95('0x23')]][_0x29499b][_0x8b95('0xb')]={};}this['channels'][_0x43026e[_0x8b95('0x23')]][_0x29499b][_0x8b95('0xb')]=this[_0x8b95('0xb')][_0x43026e['uniqueid']];}}}}}catch(_0x37b4b2){logger['error']('[syncVarSet][VoiceAgentReport]',util['inspect'](_0x37b4b2,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8b95('0x55')]=function(_0x5bf059,_0x12ecc3,_0x3486c1){var _0x546296=[_0x8b95('0x59'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x8b95('0x5a'),_0x8b95('0x5b'),_0x8b95('0x5c'),_0x8b95('0x5d'),_0x8b95('0x5e'),_0x8b95('0x5f'),_0x8b95('0x60'),_0x8b95('0x61'),_0x8b95('0x62'),_0x8b95('0x63'),_0x8b95('0x64'),'memberinterface',_0x8b95('0x65'),_0x8b95('0x2f'),_0x8b95('0x66'),_0x8b95('0x67')];if(!_[_0x8b95('0x68')](_0x12ecc3)&&!_[_0x8b95('0x69')](_0x546296,_0x12ecc3)){if(_[_0x8b95('0x22')](this['variables'][_0x5bf059])){this[_0x8b95('0xb')][_0x5bf059]={};}this[_0x8b95('0xb')][_0x5bf059][_0x12ecc3]=_0x3486c1;}};VoiceAgentReport[_0x8b95('0x1e')][_0x8b95('0x15')]=function(_0x37f53c){try{if(this[_0x8b95('0x20')](_0x37f53c)){if(this[_0x8b95('0x8')][_0x37f53c['uniqueid']]){for(var _0xe4cd9 in this['channels'][_0x37f53c[_0x8b95('0x23')]]){if(this[_0x8b95('0x8')][_0x37f53c[_0x8b95('0x23')]][_0x8b95('0x34')](_0xe4cd9)){if(this[_0x8b95('0x8')][_0x37f53c['uniqueid']][_0xe4cd9][_0x8b95('0x49')]==_0x8b95('0x4f')&&this[_0x8b95('0x8')][_0x37f53c[_0x8b95('0x23')]][_0xe4cd9][_0x8b95('0x41')]){this['channels'][_0x37f53c[_0x8b95('0x23')]][_0xe4cd9]['agentcompleteAt']=moment()['format'](_0x8b95('0x26'));}}}ami[_0x8b95('0x1f')]('custom:voiceAgentReport',_['values'](this[_0x8b95('0x8')][_0x37f53c[_0x8b95('0x23')]]));delete this['channels'][_0x37f53c[_0x8b95('0x23')]];}if(this[_0x8b95('0xb')][_0x37f53c[_0x8b95('0x23')]]){delete this[_0x8b95('0xb')][_0x37f53c['uniqueid']];}}}catch(_0x4e0cbf){logger[_0x8b95('0x31')](_0x8b95('0x6a'),util[_0x8b95('0x33')](_0x4e0cbf,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8b95('0x1e')][_0x8b95('0x1b')]=function(_0x3eb189){try{if(this[_0x8b95('0x20')](_0x3eb189)){if(this[_0x8b95('0x8')][_0x3eb189['transfereeuniqueid']]){for(var _0x326bf4 in this[_0x8b95('0x8')][_0x3eb189[_0x8b95('0x6b')]]){if(this[_0x8b95('0x8')][_0x3eb189[_0x8b95('0x6b')]][_0x8b95('0x34')](_0x326bf4)){if(_0x3eb189[_0x8b95('0x6c')]===_0x326bf4){var _0x5581be=moment();this['channels'][_0x3eb189['transfereeuniqueid']][_0x326bf4]['agentcomplete']=!![];this[_0x8b95('0x8')][_0x3eb189[_0x8b95('0x6b')]][_0x326bf4][_0x8b95('0x4d')]=moment()[_0x8b95('0x25')](_0x8b95('0x26'));this['channels'][_0x3eb189[_0x8b95('0x6b')]][_0x326bf4][_0x8b95('0x49')]=_0x8b95('0x4f');this[_0x8b95('0x8')][_0x3eb189[_0x8b95('0x6b')]][_0x326bf4][_0x8b95('0x46')]=_0x8b95('0x4e');this[_0x8b95('0x8')][_0x3eb189[_0x8b95('0x6b')]][_0x326bf4]['talktime']=_0x5581be[_0x8b95('0x6d')](this[_0x8b95('0x8')][_0x3eb189[_0x8b95('0x6b')]][_0x326bf4]['agentconnectAt'],_0x8b95('0x6e'));}}}}if(this[_0x8b95('0x8')][_0x3eb189[_0x8b95('0x6f')]]){var _0x5f1b32=this[_0x8b95('0x8')][_0x3eb189[_0x8b95('0x6f')]];this['channels'][_0x3eb189[_0x8b95('0x6f')]]=this['channels'][_0x3eb189[_0x8b95('0x6b')]];this[_0x8b95('0x8')][_0x3eb189['transfereeuniqueid']]=_0x5f1b32;}}}catch(_0x5545a4){logger['error']('[syncAttendedTransfer][VoiceAgentReport]',util['inspect'](_0x5545a4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8b95('0x1e')]['syncBlindTransfer']=function(_0x4cedec){try{if(this[_0x8b95('0x20')](_0x4cedec)){if(this[_0x8b95('0x8')][_0x4cedec[_0x8b95('0x6b')]]){for(var _0x24dbff in this[_0x8b95('0x8')][_0x4cedec[_0x8b95('0x6b')]]){if(this['channels'][_0x4cedec[_0x8b95('0x6b')]][_0x8b95('0x34')](_0x24dbff)){if(_0x4cedec[_0x8b95('0x70')]===_0x24dbff){var _0x3dd02f=moment();this['channels'][_0x4cedec[_0x8b95('0x6b')]][_0x24dbff][_0x8b95('0x41')]=!![];this[_0x8b95('0x8')][_0x4cedec[_0x8b95('0x6b')]][_0x24dbff][_0x8b95('0x4d')]=_0x3dd02f;this[_0x8b95('0x8')][_0x4cedec[_0x8b95('0x6b')]][_0x24dbff]['reason']=_0x8b95('0x4f');this[_0x8b95('0x8')][_0x4cedec[_0x8b95('0x6b')]][_0x24dbff][_0x8b95('0x46')]='complete';this[_0x8b95('0x8')][_0x4cedec[_0x8b95('0x6b')]][_0x24dbff][_0x8b95('0x71')]=_0x3dd02f['diff'](this['channels'][_0x4cedec[_0x8b95('0x6b')]][_0x24dbff][_0x8b95('0x35')],_0x8b95('0x6e'));}}}}}}catch(_0x5a9620){logger[_0x8b95('0x31')](_0x8b95('0x72'),util[_0x8b95('0x33')](_0x5a9620,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8b95('0x1e')][_0x8b95('0x17')]=function(_0x3f05d5){var _0x445d22='';try{if(this[_0x8b95('0x20')](_0x3f05d5)){if(_0x3f05d5[_0x8b95('0x73')]){_0x445d22=_0x3f05d5['channel'][_0x8b95('0x74')](0x0,_0x3f05d5[_0x8b95('0x73')]['lastIndexOf']('-'));if(this[_0x8b95('0xa')][_0x445d22]){this[_0x8b95('0xa')][_0x445d22][_0x8b95('0x75')]=!![];}}}}catch(_0xd7bcf0){logger[_0x8b95('0x31')](_0x8b95('0x76'),util['inspect'](_0xd7bcf0,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8b95('0x19')]=function(_0x306b85){var _0x3ec1c7='';try{if(this['isNotNull'](_0x306b85)){if(_0x306b85[_0x8b95('0x73')]){_0x3ec1c7=_0x306b85['channel']['substring'](0x0,_0x306b85[_0x8b95('0x73')][_0x8b95('0x77')]('-'));if(this['agents'][_0x3ec1c7]){this['agents'][_0x3ec1c7]['onhold']=![];}}}}catch(_0x2eb0f5){logger[_0x8b95('0x31')](_0x8b95('0x78'),util['inspect'](_0x2eb0f5,{'showHidden':![],'depth':null}));}};module[_0x8b95('0x79')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 5701161..918ac5f 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 _0x1ac8=['[syncNewCallerId][VoiceCallReport]','inspect','syncNewChannel','channel','starttime','format','YYYY-MM-DD\x20HH:mm:ss','toNumber','channelstate','context','from-sip','split','destconnectedlinenum','exten','name','user:agentconnect','accountcode','error','[syncNewChannel][VoiceCallReport]','OutgoingSpoolFailed','application','toLowerCase','applicationdata','duration','subtract','disposition','lastapplication','lastdata','match','[syncNewExten][VoiceCallReport]','answered','answertime','holdtime','diff','xcally-motion-preview','connectedlinenum','calleridnum','calleridname','destinationchannel','membername','UserId','endsWith','.wav49','replace','monitorFilename','find','isNil','monitors','push','rec','variable','mixmonitor_filename','syncMixMonitorFilename','xmd-phone','xmd-callerid','value','type','xmd-destination','destination','xmd-callerid-preview','xmcs-queue','sipcallid','sipcalluniqueid','parse','endtime','seconds','billableseconds','omit','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','extension','BlindTransfer','[syncBlindTransfer][VoiceCallReport]','[syncMusicOnHoldStart][VoiceCallReport]','syncMusicOnHoldStop','mohstarttime','mohtime','exports','bluebird','lodash','moment','util','path','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','unknown','not_inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','set','queue','agi','dial','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','defaults','localhost','redis','channels','agents','syncNewExten','bind','newexten','newchannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncMusicOnHoldStart','musiconholdstop','resolve','then','catch','isNotNull','isUndefined','prototype','emit','uniqueid','linkedid','merge','pick','keys'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x1ac8,0xed));var _0x81ac=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1ac8[_0x4565bf];return _0x5610ba;};'use strict';var BPromise=require(_0x81ac('0x0'));var _=require(_0x81ac('0x1'));var moment=require(_0x81ac('0x2'));var util=require(_0x81ac('0x3'));var path=require(_0x81ac('0x4'));var Redis=require('ioredis');var config=require(_0x81ac('0x5'));var logger=require(_0x81ac('0x6'))(_0x81ac('0x7'));var ami=require(_0x81ac('0x8'));var Channel=require(_0x81ac('0x9'));var statusDesc=[_0x81ac('0xa'),_0x81ac('0xb'),'inuse',_0x81ac('0xc'),_0x81ac('0xd'),_0x81ac('0xe'),_0x81ac('0xf'),_0x81ac('0x10'),_0x81ac('0x11')];var applications=[_0x81ac('0x12'),_0x81ac('0x13'),_0x81ac('0x14'),_0x81ac('0x15'),'playback',_0x81ac('0x16')];var dispositions=[_0x81ac('0x17'),'FAILED',_0x81ac('0x18'),'NO\x20ANSWER',_0x81ac('0x17'),'NO\x20ANSWER',_0x81ac('0x19'),_0x81ac('0x1a'),'FAILED','FAILED',_0x81ac('0x18')];var actions={};config['redis']=_[_0x81ac('0x1b')](config['redis'],{'host':_0x81ac('0x1c'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x81ac('0x1d')]));function VoiceCallReport(_0x23b015){this[_0x81ac('0x1e')]=_0x23b015['channels'];this[_0x81ac('0x1f')]=_0x23b015[_0x81ac('0x1f')];ami['on']('coreshowchannel',this[_0x81ac('0x20')][_0x81ac('0x21')](this));ami['on'](_0x81ac('0x22'),this[_0x81ac('0x20')]['bind'](this));ami['on'](_0x81ac('0x23'),this['syncNewChannel']['bind'](this));ami['on'](_0x81ac('0x24'),this[_0x81ac('0x25')][_0x81ac('0x21')](this));ami['on'](_0x81ac('0x26'),this[_0x81ac('0x27')][_0x81ac('0x21')](this));ami['on'](_0x81ac('0x28'),this[_0x81ac('0x29')][_0x81ac('0x21')](this));ami['on']('newcallerid',this[_0x81ac('0x2a')][_0x81ac('0x21')](this));ami['on'](_0x81ac('0x2b'),this[_0x81ac('0x2c')][_0x81ac('0x21')](this));ami['on'](_0x81ac('0x2d'),this[_0x81ac('0x2e')]['bind'](this));ami['on']('musiconholdstart',this[_0x81ac('0x2f')][_0x81ac('0x21')](this));ami['on'](_0x81ac('0x30'),this['syncMusicOnHoldStop'][_0x81ac('0x21')](this));return BPromise[_0x81ac('0x31')]()[_0x81ac('0x32')](ami['actionCoreShowChannels']())[_0x81ac('0x33')](function(_0x13b761){console['log'](_0x13b761);});}VoiceCallReport['prototype'][_0x81ac('0x34')]=function(_0x373887){return _0x373887!==null&&!_[_0x81ac('0x35')](_0x373887);};VoiceCallReport[_0x81ac('0x36')][_0x81ac('0x37')]=function(_0x37594b,_0xb3f5d3,_0x478344){io['to'](_0x37594b)[_0x81ac('0x37')](_0xb3f5d3,_0x478344);};VoiceCallReport[_0x81ac('0x36')][_0x81ac('0x2a')]=function(_0x47ad49){try{if(this[_0x81ac('0x34')](_0x47ad49)){if(_0x47ad49[_0x81ac('0x38')]===_0x47ad49[_0x81ac('0x39')]){if(!_['isUndefined'](this[_0x81ac('0x1e')][_0x47ad49['uniqueid']])){_[_0x81ac('0x3a')](this[_0x81ac('0x1e')][_0x47ad49[_0x81ac('0x38')]],_[_0x81ac('0x3b')](_0x47ad49,_[_0x81ac('0x3c')](this[_0x81ac('0x1e')][_0x47ad49[_0x81ac('0x38')]])));}}}}catch(_0x37c2c7){logger['error'](_0x81ac('0x3d'),util[_0x81ac('0x3e')](_0x37c2c7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x81ac('0x36')][_0x81ac('0x3f')]=function(_0x4e350a){try{if(this['isNotNull'](_0x4e350a)){if(_0x4e350a[_0x81ac('0x38')]===_0x4e350a[_0x81ac('0x39')]&&_0x4e350a[_0x81ac('0x40')]!='OutgoingSpoolFailed'){if(_['isUndefined'](this[_0x81ac('0x1e')][_0x4e350a[_0x81ac('0x38')]])){this[_0x81ac('0x1e')][_0x4e350a[_0x81ac('0x38')]]=new Channel();this[_0x81ac('0x1e')][_0x4e350a[_0x81ac('0x38')]][_0x81ac('0x41')]=moment()[_0x81ac('0x42')](_0x81ac('0x43'));this['channels'][_0x4e350a[_0x81ac('0x38')]]['disposition']=dispositions[_[_0x81ac('0x44')](_0x4e350a[_0x81ac('0x45')])];_[_0x81ac('0x3a')](this[_0x81ac('0x1e')][_0x4e350a[_0x81ac('0x38')]],_[_0x81ac('0x3b')](_0x4e350a,_['keys'](this[_0x81ac('0x1e')][_0x4e350a[_0x81ac('0x38')]])));if(_0x4e350a[_0x81ac('0x46')]===_0x81ac('0x47')){if(this[_0x81ac('0x1f')][_0x4e350a['channel']['split']('-')[0x0]]){this['agents'][_0x4e350a[_0x81ac('0x40')][_0x81ac('0x48')]('-')[0x0]][_0x81ac('0x49')]=_0x4e350a[_0x81ac('0x4a')];this[_0x81ac('0x37')](util[_0x81ac('0x42')]('user:%s',this[_0x81ac('0x1f')][_0x4e350a[_0x81ac('0x40')][_0x81ac('0x48')]('-')[0x0]][_0x81ac('0x4b')]),_0x81ac('0x4c'),{'destaccountcode':this[_0x81ac('0x1f')][_0x4e350a[_0x81ac('0x40')][_0x81ac('0x48')]('-')[0x0]][_0x81ac('0x4d')],'destconnectedlinenum':_0x4e350a[_0x81ac('0x4a')]});}}}}}}catch(_0x21372e){logger[_0x81ac('0x4e')](_0x81ac('0x4f'),util[_0x81ac('0x3e')](_0x21372e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x81ac('0x36')][_0x81ac('0x20')]=function(_0x37d84d){try{if(this[_0x81ac('0x34')](_0x37d84d)){if(_0x37d84d[_0x81ac('0x38')]===_0x37d84d[_0x81ac('0x39')]&&_0x37d84d[_0x81ac('0x4a')]!='h'&&_0x37d84d[_0x81ac('0x40')]!=_0x81ac('0x50')){_0x37d84d[_0x81ac('0x51')]=_0x37d84d[_0x81ac('0x51')][_0x81ac('0x52')]();_0x37d84d[_0x81ac('0x53')]=(_0x37d84d['appdata']||_0x37d84d[_0x81ac('0x53')])[_0x81ac('0x52')]();if(_['isUndefined'](this['channels'][_0x37d84d[_0x81ac('0x38')]])){this[_0x81ac('0x1e')][_0x37d84d[_0x81ac('0x38')]]=new Channel();this[_0x81ac('0x1e')][_0x37d84d[_0x81ac('0x38')]][_0x81ac('0x41')]=_0x37d84d[_0x81ac('0x54')]?moment()[_0x81ac('0x55')](moment[_0x81ac('0x54')](_0x37d84d[_0x81ac('0x54')])['seconds'](),'seconds')['format'](_0x81ac('0x43')):moment()[_0x81ac('0x42')](_0x81ac('0x43'));this['channels'][_0x37d84d[_0x81ac('0x38')]][_0x81ac('0x56')]=_0x81ac('0x17');}_['merge'](this[_0x81ac('0x1e')][_0x37d84d[_0x81ac('0x38')]],_[_0x81ac('0x3b')](_0x37d84d,_[_0x81ac('0x3c')](this[_0x81ac('0x1e')][_0x37d84d[_0x81ac('0x38')]])));if(_['includes'](applications,_0x37d84d[_0x81ac('0x51')])){this[_0x81ac('0x1e')][_0x37d84d[_0x81ac('0x38')]][_0x81ac('0x57')]=_0x37d84d[_0x81ac('0x51')];this[_0x81ac('0x1e')][_0x37d84d[_0x81ac('0x38')]][_0x81ac('0x58')]=_0x37d84d[_0x81ac('0x53')];if(_0x37d84d[_0x81ac('0x51')]===_0x81ac('0x12')&&_['startsWith'](_0x37d84d[_0x81ac('0x53')],'cdr(')){var _0x2cc7b9=_0x37d84d[_0x81ac('0x53')][_0x81ac('0x48')]('=');var _0x25c93=_0x2cc7b9[0x0][_0x81ac('0x59')](/cdr\((.*)\)/);if(_0x25c93){this['channels'][_0x37d84d['uniqueid']][_0x25c93[0x1]]=_0x2cc7b9[0x1];}}else if(_0x37d84d['application']===_0x81ac('0x13')){this['channels'][_0x37d84d['uniqueid']][_0x81ac('0x13')]=_0x37d84d['applicationdata']['split'](',')[0x0];}}}}}catch(_0x1cef94){logger[_0x81ac('0x4e')](_0x81ac('0x5a'),util[_0x81ac('0x3e')](_0x1cef94,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x81ac('0x36')][_0x81ac('0x25')]=function(_0x3f6265){try{if(this['isNotNull'](_0x3f6265)){if(_0x3f6265['uniqueid']!==_0x3f6265[_0x81ac('0x39')]){if(this[_0x81ac('0x1e')][_0x3f6265[_0x81ac('0x39')]]){if(_0x3f6265[_0x81ac('0x45')]==='6'){if(!this[_0x81ac('0x1e')][_0x3f6265[_0x81ac('0x39')]][_0x81ac('0x5b')]){var _0x5a5a31=moment();this[_0x81ac('0x1e')][_0x3f6265[_0x81ac('0x39')]][_0x81ac('0x5b')]=!![];this[_0x81ac('0x1e')][_0x3f6265[_0x81ac('0x39')]][_0x81ac('0x5c')]=_0x5a5a31['format'](_0x81ac('0x43'));if(this['channels'][_0x3f6265['linkedid']]['starttime']){this[_0x81ac('0x1e')][_0x3f6265[_0x81ac('0x39')]][_0x81ac('0x5d')]=_0x5a5a31[_0x81ac('0x5e')](this['channels'][_0x3f6265['linkedid']][_0x81ac('0x41')],'seconds');}}this[_0x81ac('0x1e')][_0x3f6265[_0x81ac('0x39')]][_0x81ac('0x39')]=_0x3f6265['uniqueid'];if(_0x3f6265['calleridnum']!==_0x81ac('0x5f')){this[_0x81ac('0x1e')][_0x3f6265[_0x81ac('0x39')]][_0x81ac('0x60')]=_0x3f6265[_0x81ac('0x61')];}this[_0x81ac('0x1e')][_0x3f6265[_0x81ac('0x39')]]['connectedlinename']=_0x3f6265[_0x81ac('0x62')];this[_0x81ac('0x1e')][_0x3f6265['linkedid']][_0x81ac('0x63')]=_0x3f6265[_0x81ac('0x40')];this['channels'][_0x3f6265[_0x81ac('0x39')]]['disposition']=dispositions[_['toNumber'](_0x3f6265['channelstate'])];if(this[_0x81ac('0x1f')][_0x3f6265['channel'][_0x81ac('0x48')]('-')[0x0]]){this[_0x81ac('0x1e')][_0x3f6265[_0x81ac('0x39')]]['UserId']=this[_0x81ac('0x1f')][_0x3f6265[_0x81ac('0x40')][_0x81ac('0x48')]('-')[0x0]]['id'];this[_0x81ac('0x1e')][_0x3f6265['linkedid']][_0x81ac('0x64')]=this[_0x81ac('0x1f')][_0x3f6265[_0x81ac('0x40')]['split']('-')[0x0]][_0x81ac('0x4b')];}}}}else{if(this[_0x81ac('0x1e')][_0x3f6265[_0x81ac('0x38')]]){if(_0x3f6265[_0x81ac('0x45')]==='6'){if(this[_0x81ac('0x1f')][_0x3f6265['channel'][_0x81ac('0x48')]('-')[0x0]]){this[_0x81ac('0x1e')][_0x3f6265['uniqueid']][_0x81ac('0x65')]=this['agents'][_0x3f6265[_0x81ac('0x40')][_0x81ac('0x48')]('-')[0x0]]['id'];this['channels'][_0x3f6265['uniqueid']][_0x81ac('0x64')]=this[_0x81ac('0x1f')][_0x3f6265[_0x81ac('0x40')][_0x81ac('0x48')]('-')[0x0]][_0x81ac('0x4b')];}}}}}}catch(_0x494cbe){logger[_0x81ac('0x4e')]('[syncNewState][VoiceCallReport]',util[_0x81ac('0x3e')](_0x494cbe,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x81ac('0x36')]['syncMixMonitorFilename']=function(_0x2e04de,_0x1112db){if(this[_0x81ac('0x1e')][_0x2e04de]){this[_0x81ac('0x1e')][_0x2e04de]['monitor']=!![];if(_[_0x81ac('0x66')](_0x1112db,_0x81ac('0x67'))){_0x1112db=_0x1112db[_0x81ac('0x68')](_0x81ac('0x67'),'.WAV');}this[_0x81ac('0x1e')][_0x2e04de][_0x81ac('0x69')]=_0x1112db;var _0x5565cb=_[_0x81ac('0x6a')](this[_0x81ac('0x1e')][_0x2e04de]['monitors'],{'filename':_0x1112db});if(_[_0x81ac('0x6b')](_0x5565cb)){this['channels'][_0x2e04de][_0x81ac('0x6c')][_0x81ac('0x6d')]({'filename':_0x1112db,'createdAt':moment()[_0x81ac('0x42')](_0x81ac('0x43')),'mixmonitorid':'','status':_0x81ac('0x6e')});}}};VoiceCallReport[_0x81ac('0x36')][_0x81ac('0x27')]=function(_0x35179e){try{if(this[_0x81ac('0x34')](_0x35179e)){if(this[_0x81ac('0x1e')][_0x35179e[_0x81ac('0x38')]]&&_0x35179e[_0x81ac('0x40')]!=_0x81ac('0x50')){if(this[_0x81ac('0x34')](_0x35179e[_0x81ac('0x6f')])){if(this[_0x81ac('0x34')](_0x35179e[_0x81ac('0x6f')][_0x81ac('0x70')])){this[_0x81ac('0x71')](_0x35179e[_0x81ac('0x38')],_0x35179e['value']);}else if(this[_0x81ac('0x34')](_0x35179e[_0x81ac('0x6f')][_0x81ac('0x72')])){this[_0x81ac('0x1e')][_0x35179e['uniqueid']][_0x81ac('0x61')]=_0x35179e['value'];}else if(this[_0x81ac('0x34')](_0x35179e[_0x81ac('0x6f')][_0x81ac('0x73')])){this[_0x81ac('0x1e')][_0x35179e[_0x81ac('0x38')]]['callerid']=_0x35179e[_0x81ac('0x74')];}else if(this['isNotNull'](_0x35179e[_0x81ac('0x6f')]['xmd-cdrtype'])){this[_0x81ac('0x1e')][_0x35179e[_0x81ac('0x38')]][_0x81ac('0x75')]=_0x35179e[_0x81ac('0x74')];}else if(this[_0x81ac('0x34')](_0x35179e[_0x81ac('0x6f')]['xmd-queue'])){this[_0x81ac('0x1e')][_0x35179e[_0x81ac('0x38')]][_0x81ac('0x13')]=_0x35179e['value'][_0x81ac('0x48')](',')[0x0];}else if(this[_0x81ac('0x34')](_0x35179e[_0x81ac('0x6f')]['xmd-originatecalleridnum'])){this[_0x81ac('0x1e')][_0x35179e[_0x81ac('0x38')]]['originatecalleridnum']=_0x35179e[_0x81ac('0x74')];}else if(this[_0x81ac('0x34')](_0x35179e['variable'][_0x81ac('0x76')])){this[_0x81ac('0x1e')][_0x35179e['uniqueid']][_0x81ac('0x77')]=_0x35179e[_0x81ac('0x74')];}else if(this['isNotNull'](_0x35179e[_0x81ac('0x6f')][_0x81ac('0x78')])){this[_0x81ac('0x1e')][_0x35179e[_0x81ac('0x38')]]['calleridpreview']=_0x35179e[_0x81ac('0x74')];}else if(this['isNotNull'](_0x35179e[_0x81ac('0x6f')][_0x81ac('0x79')])){this['channels'][_0x35179e['uniqueid']][_0x81ac('0x13')]=_0x35179e['value'];}else if(this[_0x81ac('0x34')](_0x35179e[_0x81ac('0x6f')][_0x81ac('0x7a')])){this[_0x81ac('0x1e')][_0x35179e[_0x81ac('0x38')]][_0x81ac('0x7b')]=_0x35179e['value'];}}}else if(this[_0x81ac('0x34')](_0x35179e[_0x81ac('0x6f')][_0x81ac('0x70')])){if(_0x35179e[_0x81ac('0x74')]){var _0x558bba=path[_0x81ac('0x7c')](_0x35179e[_0x81ac('0x74')])[_0x81ac('0x4b')];this[_0x81ac('0x71')](_0x558bba,_0x35179e['value']);}}else if(this[_0x81ac('0x1e')][_0x35179e[_0x81ac('0x39')]]){if(this[_0x81ac('0x34')](_0x35179e[_0x81ac('0x6f')])){if(this[_0x81ac('0x34')](_0x35179e[_0x81ac('0x6f')][_0x81ac('0x7a')])){this[_0x81ac('0x1e')][_0x35179e['linkedid']]['sipcalllinkedid']=_0x35179e[_0x81ac('0x74')];}}}}}catch(_0x31d0bf){logger[_0x81ac('0x4e')]('[syncVarSet][VoiceCallReport]',util['inspect'](_0x31d0bf,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x81ac('0x29')]=function(_0x4df6ab){try{if(this['isNotNull'](_0x4df6ab)){if(this[_0x81ac('0x1e')][_0x4df6ab[_0x81ac('0x38')]]){var _0x133193=moment();this[_0x81ac('0x1e')][_0x4df6ab['uniqueid']][_0x81ac('0x7d')]=_0x133193['format'](_0x81ac('0x43'));this[_0x81ac('0x1e')][_0x4df6ab[_0x81ac('0x38')]][_0x81ac('0x54')]=_0x133193['diff'](this[_0x81ac('0x1e')][_0x4df6ab[_0x81ac('0x38')]][_0x81ac('0x41')],_0x81ac('0x7e'));if(this[_0x81ac('0x1e')][_0x4df6ab[_0x81ac('0x38')]][_0x81ac('0x5b')]){this[_0x81ac('0x1e')][_0x4df6ab['uniqueid']][_0x81ac('0x7f')]=_0x133193['diff'](this['channels'][_0x4df6ab[_0x81ac('0x38')]]['answertime'],_0x81ac('0x7e'));this[_0x81ac('0x1e')][_0x4df6ab[_0x81ac('0x38')]][_0x81ac('0x5d')]=this[_0x81ac('0x1e')][_0x4df6ab[_0x81ac('0x38')]]['duration']-this[_0x81ac('0x1e')][_0x4df6ab[_0x81ac('0x38')]][_0x81ac('0x7f')];}if(_0x4df6ab['context']===_0x81ac('0x47')){if(this[_0x81ac('0x1f')][_0x4df6ab[_0x81ac('0x40')][_0x81ac('0x48')]('-')[0x0]]){this[_0x81ac('0x1f')][_0x4df6ab[_0x81ac('0x40')][_0x81ac('0x48')]('-')[0x0]]=_[_0x81ac('0x80')](this['agents'][_0x4df6ab['channel']['split']('-')[0x0]],[_0x81ac('0x49')]);this['emit'](util[_0x81ac('0x42')]('user:%s',this['agents'][_0x4df6ab[_0x81ac('0x40')][_0x81ac('0x48')]('-')[0x0]][_0x81ac('0x4b')]),_0x81ac('0x81'),{'destaccountcode':this[_0x81ac('0x1f')][_0x4df6ab[_0x81ac('0x40')][_0x81ac('0x48')]('-')[0x0]][_0x81ac('0x4d')]});}}ami[_0x81ac('0x37')](_0x81ac('0x82'),this[_0x81ac('0x1e')][_0x4df6ab['uniqueid']]);delete this[_0x81ac('0x1e')][_0x4df6ab[_0x81ac('0x38')]];}}}catch(_0x1eea38){logger[_0x81ac('0x4e')](_0x81ac('0x83'),util[_0x81ac('0x3e')](_0x1eea38,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x81ac('0x36')][_0x81ac('0x2c')]=function(_0x46629f){try{if(this[_0x81ac('0x34')](_0x46629f)){if(this['channels'][_0x46629f[_0x81ac('0x84')]]){this[_0x81ac('0x1e')][_0x46629f[_0x81ac('0x84')]][_0x81ac('0x85')]=_0x46629f[_0x81ac('0x86')];this[_0x81ac('0x1e')][_0x46629f['transfereeuniqueid']][_0x81ac('0x87')]=_0x46629f[_0x81ac('0x88')];if(this['channels'][_0x46629f[_0x81ac('0x89')]]){var _0x2c9b5b=this[_0x81ac('0x1e')][_0x46629f[_0x81ac('0x89')]];this[_0x81ac('0x1e')][_0x46629f[_0x81ac('0x89')]]=this[_0x81ac('0x1e')][_0x46629f[_0x81ac('0x84')]];this['channels'][_0x46629f[_0x81ac('0x84')]]=_0x2c9b5b;}}else if(this[_0x81ac('0x1e')][_0x46629f[_0x81ac('0x8a')]]){this[_0x81ac('0x1e')][_0x46629f[_0x81ac('0x8a')]][_0x81ac('0x85')]=_0x46629f[_0x81ac('0x86')];this[_0x81ac('0x1e')][_0x46629f[_0x81ac('0x8a')]]['transferconnectedlinenum']=_0x46629f[_0x81ac('0x88')];if(this[_0x81ac('0x1e')][_0x46629f['origtransfereruniqueid']]){var _0x2c9b5b=this[_0x81ac('0x1e')][_0x46629f[_0x81ac('0x8b')]];this[_0x81ac('0x1e')][_0x46629f[_0x81ac('0x8b')]]=this[_0x81ac('0x1e')][_0x46629f[_0x81ac('0x8a')]];this['channels'][_0x46629f[_0x81ac('0x8a')]]=_0x2c9b5b;}}}}catch(_0x36f9d7){logger[_0x81ac('0x4e')](_0x81ac('0x8c'),util[_0x81ac('0x3e')](_0x36f9d7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x81ac('0x36')][_0x81ac('0x2e')]=function(_0x5c0956){try{if(this[_0x81ac('0x34')](_0x5c0956)){if(this[_0x81ac('0x1e')][_0x5c0956[_0x81ac('0x84')]]){this[_0x81ac('0x1e')][_0x5c0956[_0x81ac('0x84')]][_0x81ac('0x85')]=_0x5c0956['transfereecalleridnum'];this[_0x81ac('0x1e')][_0x5c0956[_0x81ac('0x84')]][_0x81ac('0x87')]=_0x5c0956[_0x81ac('0x8d')];this['syncHangup']({'event':_0x81ac('0x8e'),'uniqueid':_0x5c0956[_0x81ac('0x84')],'context':_0x5c0956[_0x81ac('0x46')],'channel':_0x5c0956['transfererchannel']});}}}catch(_0x514f4d){logger[_0x81ac('0x4e')](_0x81ac('0x8f'),util[_0x81ac('0x3e')](_0x514f4d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x81ac('0x36')][_0x81ac('0x2f')]=function(_0x177ba6){try{if(this[_0x81ac('0x34')](_0x177ba6)){if(this[_0x81ac('0x1e')][_0x177ba6[_0x81ac('0x38')]]){if(!_[_0x81ac('0x6b')](this['channels'][_0x177ba6[_0x81ac('0x38')]]['answertime'])){this[_0x81ac('0x1e')][_0x177ba6['uniqueid']]['mohstarttime']=moment()[_0x81ac('0x42')]('YYYY-MM-DD\x20HH:mm:ss');}}}}catch(_0x4e22b5){logger[_0x81ac('0x4e')](_0x81ac('0x90'),util[_0x81ac('0x3e')](_0x4e22b5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x81ac('0x36')][_0x81ac('0x91')]=function(_0x20f691){try{if(this[_0x81ac('0x34')](_0x20f691)){if(this[_0x81ac('0x1e')][_0x20f691[_0x81ac('0x38')]]){if(!_[_0x81ac('0x6b')](this[_0x81ac('0x1e')][_0x20f691['uniqueid']][_0x81ac('0x92')])){this['channels'][_0x20f691[_0x81ac('0x38')]][_0x81ac('0x93')]+=moment()['milliseconds'](0x0)[_0x81ac('0x5e')](this[_0x81ac('0x1e')][_0x20f691[_0x81ac('0x38')]][_0x81ac('0x92')],'seconds');delete this[_0x81ac('0x1e')][_0x20f691[_0x81ac('0x38')]][_0x81ac('0x92')];}}}}catch(_0x5d22ec){logger[_0x81ac('0x4e')]('[syncMusicOnHoldStop][VoiceCallReport]',util[_0x81ac('0x3e')](_0x5d22ec,{'showHidden':![],'depth':null}));}};module[_0x81ac('0x94')]=VoiceCallReport; \ No newline at end of file +var _0xf5ea=['xmd-queue','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','xmd-callerid-preview','sipcallid','sipcalluniqueid','mixmonitor_filename','parse','sipcalllinkedid','endtime','billableseconds','omit','user:%s','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','syncAttendedTransfer','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransferercalleridnum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','BlindTransfer','[syncBlindTransfer][VoiceCallReport]','syncMusicOnHoldStart','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','exports','lodash','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','unknown','not_inuse','inuse','busy','invalid','unavailable','ringinuse','onhold','set','queue','agi','dial','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','channels','agents','bind','newexten','syncNewExten','newchannel','syncNewChannel','varset','hangup','syncHangup','newcallerid','syncNewCallerId','syncBlindTransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','catch','log','prototype','isUndefined','emit','isNotNull','uniqueid','linkedid','keys','error','[syncNewCallerId][VoiceCallReport]','inspect','channel','starttime','format','toNumber','merge','pick','context','from-sip','split','destconnectedlinenum','name','user:agentconnect','accountcode','exten','[syncNewChannel][VoiceCallReport]','OutgoingSpoolFailed','application','toLowerCase','applicationdata','appdata','subtract','duration','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','lastdata','startsWith','cdr(','match','[syncNewExten][VoiceCallReport]','channelstate','answered','answertime','diff','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','calleridname','destinationchannel','UserId','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','isNil','monitors','push','rec','variable','xmd-phone','value','xmd-callerid','xmd-cdrtype','type'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf5ea,0xc0));var _0xaf5e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xf5ea[_0x6c993a];return _0x27f547;};'use strict';var BPromise=require('bluebird');var _=require(_0xaf5e('0x0'));var moment=require('moment');var util=require('util');var path=require(_0xaf5e('0x1'));var Redis=require(_0xaf5e('0x2'));var config=require(_0xaf5e('0x3'));var logger=require(_0xaf5e('0x4'))(_0xaf5e('0x5'));var ami=require(_0xaf5e('0x6'));var Channel=require(_0xaf5e('0x7'));var statusDesc=[_0xaf5e('0x8'),_0xaf5e('0x9'),_0xaf5e('0xa'),_0xaf5e('0xb'),_0xaf5e('0xc'),_0xaf5e('0xd'),'ringing',_0xaf5e('0xe'),_0xaf5e('0xf')];var applications=[_0xaf5e('0x10'),_0xaf5e('0x11'),_0xaf5e('0x12'),_0xaf5e('0x13'),'playback',_0xaf5e('0x14')];var dispositions=[_0xaf5e('0x15'),_0xaf5e('0x16'),'FAILED',_0xaf5e('0x15'),_0xaf5e('0x15'),_0xaf5e('0x15'),_0xaf5e('0x17'),_0xaf5e('0x18'),'FAILED',_0xaf5e('0x16'),_0xaf5e('0x16')];var actions={};config[_0xaf5e('0x19')]=_[_0xaf5e('0x1a')](config[_0xaf5e('0x19')],{'host':_0xaf5e('0x1b'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceCallReport(_0x5a91c6){this[_0xaf5e('0x1c')]=_0x5a91c6[_0xaf5e('0x1c')];this[_0xaf5e('0x1d')]=_0x5a91c6[_0xaf5e('0x1d')];ami['on']('coreshowchannel',this['syncNewExten'][_0xaf5e('0x1e')](this));ami['on'](_0xaf5e('0x1f'),this[_0xaf5e('0x20')][_0xaf5e('0x1e')](this));ami['on'](_0xaf5e('0x21'),this[_0xaf5e('0x22')][_0xaf5e('0x1e')](this));ami['on']('newstate',this['syncNewState'][_0xaf5e('0x1e')](this));ami['on'](_0xaf5e('0x23'),this['syncVarSet'][_0xaf5e('0x1e')](this));ami['on'](_0xaf5e('0x24'),this[_0xaf5e('0x25')][_0xaf5e('0x1e')](this));ami['on'](_0xaf5e('0x26'),this[_0xaf5e('0x27')]['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xaf5e('0x1e')](this));ami['on']('blindtransfer',this[_0xaf5e('0x28')][_0xaf5e('0x1e')](this));ami['on'](_0xaf5e('0x29'),this['syncMusicOnHoldStart'][_0xaf5e('0x1e')](this));ami['on'](_0xaf5e('0x2a'),this[_0xaf5e('0x2b')][_0xaf5e('0x1e')](this));return BPromise[_0xaf5e('0x2c')]()[_0xaf5e('0x2d')](ami[_0xaf5e('0x2e')]())[_0xaf5e('0x2f')](function(_0x2a8ba6){console[_0xaf5e('0x30')](_0x2a8ba6);});}VoiceCallReport[_0xaf5e('0x31')]['isNotNull']=function(_0x4f57ff){return _0x4f57ff!==null&&!_[_0xaf5e('0x32')](_0x4f57ff);};VoiceCallReport['prototype']['emit']=function(_0x18c847,_0x1435c5,_0x17dac7){io['to'](_0x18c847)[_0xaf5e('0x33')](_0x1435c5,_0x17dac7);};VoiceCallReport['prototype'][_0xaf5e('0x27')]=function(_0x18df79){try{if(this[_0xaf5e('0x34')](_0x18df79)){if(_0x18df79[_0xaf5e('0x35')]===_0x18df79[_0xaf5e('0x36')]){if(!_[_0xaf5e('0x32')](this[_0xaf5e('0x1c')][_0x18df79[_0xaf5e('0x35')]])){_['merge'](this[_0xaf5e('0x1c')][_0x18df79['uniqueid']],_['pick'](_0x18df79,_[_0xaf5e('0x37')](this[_0xaf5e('0x1c')][_0x18df79[_0xaf5e('0x35')]])));}}}}catch(_0x431e6a){logger[_0xaf5e('0x38')](_0xaf5e('0x39'),util[_0xaf5e('0x3a')](_0x431e6a,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xaf5e('0x22')]=function(_0x6ae4d9){try{if(this[_0xaf5e('0x34')](_0x6ae4d9)){if(_0x6ae4d9[_0xaf5e('0x35')]===_0x6ae4d9[_0xaf5e('0x36')]&&_0x6ae4d9[_0xaf5e('0x3b')]!='OutgoingSpoolFailed'){if(_[_0xaf5e('0x32')](this[_0xaf5e('0x1c')][_0x6ae4d9[_0xaf5e('0x35')]])){this[_0xaf5e('0x1c')][_0x6ae4d9['uniqueid']]=new Channel();this[_0xaf5e('0x1c')][_0x6ae4d9['uniqueid']][_0xaf5e('0x3c')]=moment()[_0xaf5e('0x3d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xaf5e('0x1c')][_0x6ae4d9['uniqueid']]['disposition']=dispositions[_[_0xaf5e('0x3e')](_0x6ae4d9['channelstate'])];_[_0xaf5e('0x3f')](this['channels'][_0x6ae4d9[_0xaf5e('0x35')]],_[_0xaf5e('0x40')](_0x6ae4d9,_[_0xaf5e('0x37')](this[_0xaf5e('0x1c')][_0x6ae4d9[_0xaf5e('0x35')]])));if(_0x6ae4d9[_0xaf5e('0x41')]===_0xaf5e('0x42')){if(this[_0xaf5e('0x1d')][_0x6ae4d9[_0xaf5e('0x3b')][_0xaf5e('0x43')]('-')[0x0]]){this[_0xaf5e('0x1d')][_0x6ae4d9[_0xaf5e('0x3b')][_0xaf5e('0x43')]('-')[0x0]][_0xaf5e('0x44')]=_0x6ae4d9['exten'];this[_0xaf5e('0x33')](util[_0xaf5e('0x3d')]('user:%s',this[_0xaf5e('0x1d')][_0x6ae4d9[_0xaf5e('0x3b')][_0xaf5e('0x43')]('-')[0x0]][_0xaf5e('0x45')]),_0xaf5e('0x46'),{'destaccountcode':this[_0xaf5e('0x1d')][_0x6ae4d9[_0xaf5e('0x3b')]['split']('-')[0x0]][_0xaf5e('0x47')],'destconnectedlinenum':_0x6ae4d9[_0xaf5e('0x48')]});}}}}}}catch(_0xad6369){logger[_0xaf5e('0x38')](_0xaf5e('0x49'),util['inspect'](_0xad6369,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xaf5e('0x20')]=function(_0x5937e3){try{if(this[_0xaf5e('0x34')](_0x5937e3)){if(_0x5937e3['uniqueid']===_0x5937e3['linkedid']&&_0x5937e3[_0xaf5e('0x48')]!='h'&&_0x5937e3[_0xaf5e('0x3b')]!=_0xaf5e('0x4a')){_0x5937e3['application']=_0x5937e3[_0xaf5e('0x4b')][_0xaf5e('0x4c')]();_0x5937e3[_0xaf5e('0x4d')]=(_0x5937e3[_0xaf5e('0x4e')]||_0x5937e3['applicationdata'])[_0xaf5e('0x4c')]();if(_['isUndefined'](this[_0xaf5e('0x1c')][_0x5937e3['uniqueid']])){this[_0xaf5e('0x1c')][_0x5937e3[_0xaf5e('0x35')]]=new Channel();this['channels'][_0x5937e3[_0xaf5e('0x35')]]['starttime']=_0x5937e3['duration']?moment()[_0xaf5e('0x4f')](moment[_0xaf5e('0x50')](_0x5937e3['duration'])[_0xaf5e('0x51')](),_0xaf5e('0x51'))[_0xaf5e('0x3d')]('YYYY-MM-DD\x20HH:mm:ss'):moment()['format'](_0xaf5e('0x52'));this[_0xaf5e('0x1c')][_0x5937e3[_0xaf5e('0x35')]]['disposition']=_0xaf5e('0x15');}_[_0xaf5e('0x3f')](this['channels'][_0x5937e3[_0xaf5e('0x35')]],_[_0xaf5e('0x40')](_0x5937e3,_['keys'](this[_0xaf5e('0x1c')][_0x5937e3[_0xaf5e('0x35')]])));if(_[_0xaf5e('0x53')](applications,_0x5937e3[_0xaf5e('0x4b')])){this['channels'][_0x5937e3['uniqueid']][_0xaf5e('0x54')]=_0x5937e3[_0xaf5e('0x4b')];this[_0xaf5e('0x1c')][_0x5937e3[_0xaf5e('0x35')]][_0xaf5e('0x55')]=_0x5937e3[_0xaf5e('0x4d')];if(_0x5937e3['application']==='set'&&_[_0xaf5e('0x56')](_0x5937e3['applicationdata'],_0xaf5e('0x57'))){var _0x1cc2e7=_0x5937e3[_0xaf5e('0x4d')][_0xaf5e('0x43')]('=');var _0x50b56c=_0x1cc2e7[0x0][_0xaf5e('0x58')](/cdr\((.*)\)/);if(_0x50b56c){this[_0xaf5e('0x1c')][_0x5937e3[_0xaf5e('0x35')]][_0x50b56c[0x1]]=_0x1cc2e7[0x1];}}else if(_0x5937e3[_0xaf5e('0x4b')]==='queue'){this[_0xaf5e('0x1c')][_0x5937e3['uniqueid']]['queue']=_0x5937e3[_0xaf5e('0x4d')]['split'](',')[0x0];}}}}}catch(_0x4b35d8){logger[_0xaf5e('0x38')](_0xaf5e('0x59'),util[_0xaf5e('0x3a')](_0x4b35d8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xaf5e('0x31')]['syncNewState']=function(_0x20d7e1){try{if(this[_0xaf5e('0x34')](_0x20d7e1)){if(_0x20d7e1['uniqueid']!==_0x20d7e1[_0xaf5e('0x36')]){if(this[_0xaf5e('0x1c')][_0x20d7e1[_0xaf5e('0x36')]]){if(_0x20d7e1[_0xaf5e('0x5a')]==='6'){if(!this[_0xaf5e('0x1c')][_0x20d7e1[_0xaf5e('0x36')]]['answered']){var _0x17be1e=moment();this[_0xaf5e('0x1c')][_0x20d7e1['linkedid']][_0xaf5e('0x5b')]=!![];this[_0xaf5e('0x1c')][_0x20d7e1['linkedid']][_0xaf5e('0x5c')]=_0x17be1e[_0xaf5e('0x3d')](_0xaf5e('0x52'));if(this['channels'][_0x20d7e1[_0xaf5e('0x36')]]['starttime']){this[_0xaf5e('0x1c')][_0x20d7e1[_0xaf5e('0x36')]]['holdtime']=_0x17be1e[_0xaf5e('0x5d')](this[_0xaf5e('0x1c')][_0x20d7e1[_0xaf5e('0x36')]][_0xaf5e('0x3c')],'seconds');}}this[_0xaf5e('0x1c')][_0x20d7e1[_0xaf5e('0x36')]][_0xaf5e('0x36')]=_0x20d7e1[_0xaf5e('0x35')];if(_0x20d7e1[_0xaf5e('0x5e')]!==_0xaf5e('0x5f')){this[_0xaf5e('0x1c')][_0x20d7e1[_0xaf5e('0x36')]][_0xaf5e('0x60')]=_0x20d7e1[_0xaf5e('0x5e')];}this[_0xaf5e('0x1c')][_0x20d7e1['linkedid']][_0xaf5e('0x61')]=_0x20d7e1[_0xaf5e('0x62')];this[_0xaf5e('0x1c')][_0x20d7e1[_0xaf5e('0x36')]][_0xaf5e('0x63')]=_0x20d7e1['channel'];this[_0xaf5e('0x1c')][_0x20d7e1['linkedid']]['disposition']=dispositions[_[_0xaf5e('0x3e')](_0x20d7e1[_0xaf5e('0x5a')])];if(this[_0xaf5e('0x1d')][_0x20d7e1[_0xaf5e('0x3b')][_0xaf5e('0x43')]('-')[0x0]]){this[_0xaf5e('0x1c')][_0x20d7e1[_0xaf5e('0x36')]][_0xaf5e('0x64')]=this['agents'][_0x20d7e1[_0xaf5e('0x3b')][_0xaf5e('0x43')]('-')[0x0]]['id'];this[_0xaf5e('0x1c')][_0x20d7e1[_0xaf5e('0x36')]]['membername']=this[_0xaf5e('0x1d')][_0x20d7e1['channel'][_0xaf5e('0x43')]('-')[0x0]]['name'];}}}}else{if(this['channels'][_0x20d7e1[_0xaf5e('0x35')]]){if(_0x20d7e1[_0xaf5e('0x5a')]==='6'){if(this[_0xaf5e('0x1d')][_0x20d7e1['channel'][_0xaf5e('0x43')]('-')[0x0]]){this[_0xaf5e('0x1c')][_0x20d7e1[_0xaf5e('0x35')]]['UserId']=this[_0xaf5e('0x1d')][_0x20d7e1[_0xaf5e('0x3b')][_0xaf5e('0x43')]('-')[0x0]]['id'];this[_0xaf5e('0x1c')][_0x20d7e1[_0xaf5e('0x35')]]['membername']=this[_0xaf5e('0x1d')][_0x20d7e1['channel'][_0xaf5e('0x43')]('-')[0x0]]['name'];}}}}}}catch(_0x13cfa7){logger[_0xaf5e('0x38')](_0xaf5e('0x65'),util[_0xaf5e('0x3a')](_0x13cfa7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xaf5e('0x31')][_0xaf5e('0x66')]=function(_0x2ccac6,_0x9e2e41){if(this['channels'][_0x2ccac6]){this[_0xaf5e('0x1c')][_0x2ccac6][_0xaf5e('0x67')]=!![];if(_[_0xaf5e('0x68')](_0x9e2e41,_0xaf5e('0x69'))){_0x9e2e41=_0x9e2e41[_0xaf5e('0x6a')](_0xaf5e('0x69'),_0xaf5e('0x6b'));}this[_0xaf5e('0x1c')][_0x2ccac6][_0xaf5e('0x6c')]=_0x9e2e41;var _0x58a7aa=_[_0xaf5e('0x6d')](this[_0xaf5e('0x1c')][_0x2ccac6]['monitors'],{'filename':_0x9e2e41});if(_[_0xaf5e('0x6e')](_0x58a7aa)){this[_0xaf5e('0x1c')][_0x2ccac6][_0xaf5e('0x6f')][_0xaf5e('0x70')]({'filename':_0x9e2e41,'createdAt':moment()['format'](_0xaf5e('0x52')),'mixmonitorid':'','status':_0xaf5e('0x71')});}}};VoiceCallReport['prototype']['syncVarSet']=function(_0x5d0e90){try{if(this[_0xaf5e('0x34')](_0x5d0e90)){if(this[_0xaf5e('0x1c')][_0x5d0e90['uniqueid']]&&_0x5d0e90[_0xaf5e('0x3b')]!=_0xaf5e('0x4a')){if(this[_0xaf5e('0x34')](_0x5d0e90['variable'])){if(this['isNotNull'](_0x5d0e90[_0xaf5e('0x72')]['mixmonitor_filename'])){this[_0xaf5e('0x66')](_0x5d0e90[_0xaf5e('0x35')],_0x5d0e90['value']);}else if(this[_0xaf5e('0x34')](_0x5d0e90['variable'][_0xaf5e('0x73')])){this[_0xaf5e('0x1c')][_0x5d0e90[_0xaf5e('0x35')]][_0xaf5e('0x5e')]=_0x5d0e90[_0xaf5e('0x74')];}else if(this[_0xaf5e('0x34')](_0x5d0e90[_0xaf5e('0x72')][_0xaf5e('0x75')])){this[_0xaf5e('0x1c')][_0x5d0e90['uniqueid']]['callerid']=_0x5d0e90['value'];}else if(this['isNotNull'](_0x5d0e90[_0xaf5e('0x72')][_0xaf5e('0x76')])){this[_0xaf5e('0x1c')][_0x5d0e90[_0xaf5e('0x35')]][_0xaf5e('0x77')]=_0x5d0e90[_0xaf5e('0x74')];}else if(this[_0xaf5e('0x34')](_0x5d0e90[_0xaf5e('0x72')][_0xaf5e('0x78')])){this[_0xaf5e('0x1c')][_0x5d0e90[_0xaf5e('0x35')]][_0xaf5e('0x11')]=_0x5d0e90['value'][_0xaf5e('0x43')](',')[0x0];}else if(this['isNotNull'](_0x5d0e90[_0xaf5e('0x72')][_0xaf5e('0x79')])){this['channels'][_0x5d0e90['uniqueid']][_0xaf5e('0x7a')]=_0x5d0e90[_0xaf5e('0x74')];}else if(this[_0xaf5e('0x34')](_0x5d0e90[_0xaf5e('0x72')][_0xaf5e('0x7b')])){this[_0xaf5e('0x1c')][_0x5d0e90[_0xaf5e('0x35')]]['destination']=_0x5d0e90[_0xaf5e('0x74')];}else if(this['isNotNull'](_0x5d0e90[_0xaf5e('0x72')][_0xaf5e('0x7c')])){this[_0xaf5e('0x1c')][_0x5d0e90[_0xaf5e('0x35')]]['calleridpreview']=_0x5d0e90['value'];}else if(this[_0xaf5e('0x34')](_0x5d0e90[_0xaf5e('0x72')]['xmcs-queue'])){this[_0xaf5e('0x1c')][_0x5d0e90[_0xaf5e('0x35')]][_0xaf5e('0x11')]=_0x5d0e90[_0xaf5e('0x74')];}else if(this[_0xaf5e('0x34')](_0x5d0e90[_0xaf5e('0x72')][_0xaf5e('0x7d')])){this[_0xaf5e('0x1c')][_0x5d0e90[_0xaf5e('0x35')]][_0xaf5e('0x7e')]=_0x5d0e90[_0xaf5e('0x74')];}}}else if(this[_0xaf5e('0x34')](_0x5d0e90[_0xaf5e('0x72')][_0xaf5e('0x7f')])){if(_0x5d0e90[_0xaf5e('0x74')]){var _0x3fe4e8=path[_0xaf5e('0x80')](_0x5d0e90['value'])[_0xaf5e('0x45')];this[_0xaf5e('0x66')](_0x3fe4e8,_0x5d0e90[_0xaf5e('0x74')]);}}else if(this[_0xaf5e('0x1c')][_0x5d0e90[_0xaf5e('0x36')]]){if(this['isNotNull'](_0x5d0e90['variable'])){if(this[_0xaf5e('0x34')](_0x5d0e90[_0xaf5e('0x72')]['sipcallid'])){this[_0xaf5e('0x1c')][_0x5d0e90['linkedid']][_0xaf5e('0x81')]=_0x5d0e90['value'];}}}}}catch(_0x3f432f){logger[_0xaf5e('0x38')]('[syncVarSet][VoiceCallReport]',util[_0xaf5e('0x3a')](_0x3f432f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xaf5e('0x31')][_0xaf5e('0x25')]=function(_0x39c4a5){try{if(this[_0xaf5e('0x34')](_0x39c4a5)){if(this['channels'][_0x39c4a5[_0xaf5e('0x35')]]){var _0x34a61f=moment();this[_0xaf5e('0x1c')][_0x39c4a5[_0xaf5e('0x35')]][_0xaf5e('0x82')]=_0x34a61f[_0xaf5e('0x3d')](_0xaf5e('0x52'));this['channels'][_0x39c4a5[_0xaf5e('0x35')]][_0xaf5e('0x50')]=_0x34a61f[_0xaf5e('0x5d')](this[_0xaf5e('0x1c')][_0x39c4a5[_0xaf5e('0x35')]][_0xaf5e('0x3c')],_0xaf5e('0x51'));if(this[_0xaf5e('0x1c')][_0x39c4a5[_0xaf5e('0x35')]][_0xaf5e('0x5b')]){this['channels'][_0x39c4a5['uniqueid']][_0xaf5e('0x83')]=_0x34a61f[_0xaf5e('0x5d')](this[_0xaf5e('0x1c')][_0x39c4a5[_0xaf5e('0x35')]][_0xaf5e('0x5c')],_0xaf5e('0x51'));this[_0xaf5e('0x1c')][_0x39c4a5['uniqueid']]['holdtime']=this[_0xaf5e('0x1c')][_0x39c4a5[_0xaf5e('0x35')]]['duration']-this[_0xaf5e('0x1c')][_0x39c4a5['uniqueid']][_0xaf5e('0x83')];}if(_0x39c4a5[_0xaf5e('0x41')]==='from-sip'){if(this[_0xaf5e('0x1d')][_0x39c4a5[_0xaf5e('0x3b')]['split']('-')[0x0]]){this['agents'][_0x39c4a5['channel']['split']('-')[0x0]]=_[_0xaf5e('0x84')](this[_0xaf5e('0x1d')][_0x39c4a5['channel'][_0xaf5e('0x43')]('-')[0x0]],[_0xaf5e('0x44')]);this[_0xaf5e('0x33')](util[_0xaf5e('0x3d')](_0xaf5e('0x85'),this['agents'][_0x39c4a5[_0xaf5e('0x3b')][_0xaf5e('0x43')]('-')[0x0]][_0xaf5e('0x45')]),_0xaf5e('0x86'),{'destaccountcode':this['agents'][_0x39c4a5[_0xaf5e('0x3b')][_0xaf5e('0x43')]('-')[0x0]][_0xaf5e('0x47')]});}}ami[_0xaf5e('0x33')](_0xaf5e('0x87'),this[_0xaf5e('0x1c')][_0x39c4a5[_0xaf5e('0x35')]]);delete this[_0xaf5e('0x1c')][_0x39c4a5[_0xaf5e('0x35')]];}}}catch(_0x3301bf){logger[_0xaf5e('0x38')](_0xaf5e('0x88'),util[_0xaf5e('0x3a')](_0x3301bf,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xaf5e('0x89')]=function(_0x5e4e88){try{if(this[_0xaf5e('0x34')](_0x5e4e88)){if(this['channels'][_0x5e4e88[_0xaf5e('0x8a')]]){this[_0xaf5e('0x1c')][_0x5e4e88[_0xaf5e('0x8a')]][_0xaf5e('0x8b')]=_0x5e4e88['origtransferercalleridnum'];this[_0xaf5e('0x1c')][_0x5e4e88[_0xaf5e('0x8a')]][_0xaf5e('0x8c')]=_0x5e4e88[_0xaf5e('0x8d')];if(this[_0xaf5e('0x1c')][_0x5e4e88[_0xaf5e('0x8e')]]){var _0x433760=this[_0xaf5e('0x1c')][_0x5e4e88['secondtransfereruniqueid']];this['channels'][_0x5e4e88[_0xaf5e('0x8e')]]=this[_0xaf5e('0x1c')][_0x5e4e88[_0xaf5e('0x8a')]];this[_0xaf5e('0x1c')][_0x5e4e88['transfereeuniqueid']]=_0x433760;}}else if(this[_0xaf5e('0x1c')][_0x5e4e88[_0xaf5e('0x8f')]]){this[_0xaf5e('0x1c')][_0x5e4e88[_0xaf5e('0x8f')]][_0xaf5e('0x8b')]=_0x5e4e88[_0xaf5e('0x90')];this[_0xaf5e('0x1c')][_0x5e4e88['transfertargetuniqueid']][_0xaf5e('0x8c')]=_0x5e4e88[_0xaf5e('0x8d')];if(this[_0xaf5e('0x1c')][_0x5e4e88[_0xaf5e('0x91')]]){var _0x433760=this['channels'][_0x5e4e88[_0xaf5e('0x91')]];this[_0xaf5e('0x1c')][_0x5e4e88[_0xaf5e('0x91')]]=this[_0xaf5e('0x1c')][_0x5e4e88[_0xaf5e('0x8f')]];this[_0xaf5e('0x1c')][_0x5e4e88[_0xaf5e('0x8f')]]=_0x433760;}}}}catch(_0x536ee9){logger[_0xaf5e('0x38')](_0xaf5e('0x92'),util[_0xaf5e('0x3a')](_0x536ee9,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xaf5e('0x28')]=function(_0x41a5ff){try{if(this[_0xaf5e('0x34')](_0x41a5ff)){if(this[_0xaf5e('0x1c')][_0x41a5ff[_0xaf5e('0x8a')]]){this[_0xaf5e('0x1c')][_0x41a5ff['transfereeuniqueid']][_0xaf5e('0x8b')]=_0x41a5ff[_0xaf5e('0x93')];this[_0xaf5e('0x1c')][_0x41a5ff[_0xaf5e('0x8a')]][_0xaf5e('0x8c')]=_0x41a5ff['extension'];this['syncHangup']({'event':_0xaf5e('0x94'),'uniqueid':_0x41a5ff[_0xaf5e('0x8a')],'context':_0x41a5ff[_0xaf5e('0x41')],'channel':_0x41a5ff['transfererchannel']});}}}catch(_0x596fd7){logger[_0xaf5e('0x38')](_0xaf5e('0x95'),util['inspect'](_0x596fd7,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xaf5e('0x96')]=function(_0x478aa1){try{if(this['isNotNull'](_0x478aa1)){if(this[_0xaf5e('0x1c')][_0x478aa1['uniqueid']]){if(!_['isNil'](this[_0xaf5e('0x1c')][_0x478aa1[_0xaf5e('0x35')]][_0xaf5e('0x5c')])){this['channels'][_0x478aa1[_0xaf5e('0x35')]][_0xaf5e('0x97')]=moment()[_0xaf5e('0x3d')](_0xaf5e('0x52'));}}}}catch(_0x11f9f1){logger['error'](_0xaf5e('0x98'),util[_0xaf5e('0x3a')](_0x11f9f1,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xaf5e('0x2b')]=function(_0x1c723b){try{if(this['isNotNull'](_0x1c723b)){if(this[_0xaf5e('0x1c')][_0x1c723b[_0xaf5e('0x35')]]){if(!_['isNil'](this['channels'][_0x1c723b['uniqueid']][_0xaf5e('0x97')])){this[_0xaf5e('0x1c')][_0x1c723b[_0xaf5e('0x35')]]['mohtime']+=moment()[_0xaf5e('0x99')](0x0)['diff'](this[_0xaf5e('0x1c')][_0x1c723b[_0xaf5e('0x35')]]['mohstarttime'],_0xaf5e('0x51'));delete this[_0xaf5e('0x1c')][_0x1c723b[_0xaf5e('0x35')]][_0xaf5e('0x97')];}}}}catch(_0x1c0306){logger[_0xaf5e('0x38')](_0xaf5e('0x9a'),util[_0xaf5e('0x3a')](_0x1c0306,{'showHidden':![],'depth':null}));}};module[_0xaf5e('0x9b')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 41790a0..52dec5f 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 _0xc44b=['sumDuration','custom:voiceDialReport','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','lodash','moment','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','outboundChannels','outbound','bind','dialend','syncDialEnd','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','uniqueid','merge','channels','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','privilege','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','connectedlinenum','connectedlinename','answertime','format','lastevent','connect','custom:dialconnect','[syncDialEnd][VoiceDialReport]','syncVarSet','addVariable','keys','variable','value','variables','voice:outbound','voice_outbound_channel:save','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','isNil','endtime','duration','diff','starttime','seconds','total','answered','holdtime','billableseconds','sumHoldTime','sumBillable'];(function(_0x5519a9,_0x1c5147){var _0x32f2cc=function(_0x52ed58){while(--_0x52ed58){_0x5519a9['push'](_0x5519a9['shift']());}};_0x32f2cc(++_0x1c5147);}(_0xc44b,0xad));var _0xbc44=function(_0x27b423,_0x312583){_0x27b423=_0x27b423-0x0;var _0x5c11b8=_0xc44b[_0x27b423];return _0x5c11b8;};'use strict';var _=require(_0xbc44('0x0'));var moment=require(_0xbc44('0x1'));var util=require(_0xbc44('0x2'));var Redis=require('ioredis');var config=require(_0xbc44('0x3'));var logger=require('../../../config/logger')('ami');var ami=require('../ami');config[_0xbc44('0x4')]=_[_0xbc44('0x5')](config['redis'],{'host':_0xbc44('0x6'),'port':0x18eb});var io=require(_0xbc44('0x7'))(new Redis(config['redis']));function VoiceDialReport(_0x584de6){this['channels']=_0x584de6[_0xbc44('0x8')];this[_0xbc44('0x9')]=_0x584de6[_0xbc44('0x9')];this['variables']={};ami['on']('dialbegin',this['syncDialBegin'][_0xbc44('0xa')](this));ami['on'](_0xbc44('0xb'),this[_0xbc44('0xc')]['bind'](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on'](_0xbc44('0xd'),this[_0xbc44('0xe')]['bind'](this));}VoiceDialReport[_0xbc44('0xf')][_0xbc44('0x10')]=function(_0x548e79){return _0x548e79!==null&&!_[_0xbc44('0x11')](_0x548e79);};VoiceDialReport['prototype'][_0xbc44('0x12')]=function(_0x49d40d,_0x2f8e09,_0xaddfd5){io['to'](_0x49d40d)['emit'](_0x2f8e09,_0xaddfd5);};VoiceDialReport['prototype']['syncDialBegin']=function(_0x4034c1){try{if(this[_0xbc44('0x10')](_0x4034c1)){if(this['channels'][_0x4034c1[_0xbc44('0x13')]]){_[_0xbc44('0x14')](this[_0xbc44('0x15')][_0x4034c1[_0xbc44('0x13')]],{'starttime':moment()['format'](_0xbc44('0x16')),'lastevent':_0xbc44('0x17'),'interface':_0x4034c1[_0xbc44('0x18')][_0xbc44('0x19')](0x0,_0x4034c1[_0xbc44('0x18')][_0xbc44('0x1a')]('-')),'membername':_0x4034c1[_0xbc44('0x18')][_0xbc44('0x19')](_0x4034c1[_0xbc44('0x18')][_0xbc44('0x1a')]('/')+0x1,_0x4034c1[_0xbc44('0x18')][_0xbc44('0x1a')]('-'))},_['omit'](_0x4034c1,['event',_0xbc44('0x1b')]));this['emit']('voice:outbound','voice_outbound_channel:save',this['channels'][_0x4034c1[_0xbc44('0x13')]]);ami[_0xbc44('0x12')](_0xbc44('0x1c'),this[_0xbc44('0x15')][_0x4034c1[_0xbc44('0x13')]]);}}}catch(_0x275c9e){logger[_0xbc44('0x1d')](_0xbc44('0x1e'),util[_0xbc44('0x1f')](_0x275c9e,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xbc44('0xf')]['syncDialEnd']=function(_0x23114f){try{if(this['isNotNull'](_0x23114f)){if(this[_0xbc44('0x15')][_0x23114f['uniqueid']]){this[_0xbc44('0x15')][_0x23114f['uniqueid']]['dialstatus']=_0x23114f[_0xbc44('0x20')];if(_0x23114f[_0xbc44('0x20')]==='ANSWER'){this['channels'][_0x23114f[_0xbc44('0x13')]][_0xbc44('0x21')]=_0x23114f[_0xbc44('0x21')];this[_0xbc44('0x15')][_0x23114f['uniqueid']][_0xbc44('0x22')]=_0x23114f[_0xbc44('0x22')];this[_0xbc44('0x15')][_0x23114f[_0xbc44('0x13')]][_0xbc44('0x23')]=moment()[_0xbc44('0x24')](_0xbc44('0x16'));this['channels'][_0x23114f['uniqueid']][_0xbc44('0x25')]=_0xbc44('0x26');ami[_0xbc44('0x12')](_0xbc44('0x27'),this[_0xbc44('0x15')][_0x23114f['uniqueid']]);}this['emit']('voice:outbound','voice_outbound_channel:save',this['channels'][_0x23114f[_0xbc44('0x13')]]);}}}catch(_0x1a16a2){logger[_0xbc44('0x1d')](_0xbc44('0x28'),util['inspect'](_0x1a16a2,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xbc44('0xf')][_0xbc44('0x29')]=function(_0x38120b){try{if(this[_0xbc44('0x10')](_0x38120b)){this[_0xbc44('0x2a')](_0x38120b[_0xbc44('0x13')],_[_0xbc44('0x2b')](_0x38120b[_0xbc44('0x2c')])[0x0],_0x38120b[_0xbc44('0x2d')]);if(this[_0xbc44('0x10')](_0x38120b[_0xbc44('0x2c')])&&this['isNotNull'](_0x38120b[_0xbc44('0x2c')]['outboundrouteid'])){if(_[_0xbc44('0x11')](this[_0xbc44('0x15')][_0x38120b[_0xbc44('0x13')]])){this[_0xbc44('0x15')][_0x38120b[_0xbc44('0x13')]]={'routeId':_0x38120b['value'],'variables':this[_0xbc44('0x2e')][_0x38120b[_0xbc44('0x13')]]};this[_0xbc44('0x12')](_0xbc44('0x2f'),_0xbc44('0x30'),this['channels'][_0x38120b[_0xbc44('0x13')]]);}}}}catch(_0x5498e8){logger['error'](_0xbc44('0x31'),util['inspect'](_0x5498e8,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xbc44('0xf')][_0xbc44('0x2a')]=function(_0x2f7666,_0x3430d0,_0x254427){var _0x9aa468=[_0xbc44('0x32'),_0xbc44('0x33'),_0xbc44('0x34'),_0xbc44('0x35'),_0xbc44('0x36'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0xbc44('0x37'),'sipcallid',_0xbc44('0x38'),_0xbc44('0x39'),'bridgepvtcallid',_0xbc44('0x3a'),_0xbc44('0x3b'),_0xbc44('0x3c'),_0xbc44('0x3d'),_0xbc44('0x3e'),_0xbc44('0x3f'),'memberrealtime'];if(!_[_0xbc44('0x40')](_0x3430d0)&&!_['includes'](_0x9aa468,_0x3430d0)){if(_[_0xbc44('0x11')](this[_0xbc44('0x2e')][_0x2f7666])){this[_0xbc44('0x2e')][_0x2f7666]={};}this[_0xbc44('0x2e')][_0x2f7666][_0x3430d0]=_0x254427;}};VoiceDialReport['prototype'][_0xbc44('0xe')]=function(_0x458a45){try{if(this[_0xbc44('0x10')](_0x458a45)){if(this[_0xbc44('0x15')][_0x458a45[_0xbc44('0x13')]]){this[_0xbc44('0x15')][_0x458a45['uniqueid']][_0xbc44('0x41')]=moment()[_0xbc44('0x24')](_0xbc44('0x16'));this[_0xbc44('0x15')][_0x458a45[_0xbc44('0x13')]][_0xbc44('0x42')]=moment(this[_0xbc44('0x15')][_0x458a45[_0xbc44('0x13')]][_0xbc44('0x41')])[_0xbc44('0x43')](this[_0xbc44('0x15')][_0x458a45[_0xbc44('0x13')]][_0xbc44('0x44')],_0xbc44('0x45'));this['channels'][_0x458a45['uniqueid']][_0xbc44('0x25')]='complete';this[_0xbc44('0x9')][_0xbc44('0x46')]+=0x1;if(this[_0xbc44('0x15')][_0x458a45['uniqueid']][_0xbc44('0x23')]){this[_0xbc44('0x9')][_0xbc44('0x47')]+=0x1;this[_0xbc44('0x15')][_0x458a45[_0xbc44('0x13')]][_0xbc44('0x48')]=moment(this['channels'][_0x458a45[_0xbc44('0x13')]][_0xbc44('0x23')])[_0xbc44('0x43')](this[_0xbc44('0x15')][_0x458a45[_0xbc44('0x13')]][_0xbc44('0x44')],_0xbc44('0x45'));this[_0xbc44('0x15')][_0x458a45['uniqueid']][_0xbc44('0x49')]=moment(this['channels'][_0x458a45[_0xbc44('0x13')]][_0xbc44('0x41')])[_0xbc44('0x43')](this[_0xbc44('0x15')][_0x458a45[_0xbc44('0x13')]][_0xbc44('0x23')],_0xbc44('0x45'));this['outbound'][_0xbc44('0x4a')]+=this['channels'][_0x458a45[_0xbc44('0x13')]]['holdtime']||0x0;this[_0xbc44('0x9')][_0xbc44('0x4b')]+=this['channels'][_0x458a45[_0xbc44('0x13')]]['billableseconds'];}this[_0xbc44('0x9')][_0xbc44('0x4c')]+=this['channels'][_0x458a45[_0xbc44('0x13')]][_0xbc44('0x42')];ami[_0xbc44('0x12')](_0xbc44('0x4d'),this[_0xbc44('0x15')][_0x458a45[_0xbc44('0x13')]]);ami['emit']('custom:dialend',this[_0xbc44('0x15')][_0x458a45[_0xbc44('0x13')]]);this[_0xbc44('0x12')](_0xbc44('0x2f'),'voice_outbound:save',this[_0xbc44('0x9')]);logger['info'](_0xbc44('0x4e'),JSON[_0xbc44('0x4f')](this[_0xbc44('0x15')][_0x458a45[_0xbc44('0x13')]]));this[_0xbc44('0x12')](_0xbc44('0x2f'),_0xbc44('0x50'),this['channels'][_0x458a45[_0xbc44('0x13')]]);delete this['channels'][_0x458a45[_0xbc44('0x13')]];}if(this[_0xbc44('0x2e')][_0x458a45[_0xbc44('0x13')]]){delete this[_0xbc44('0x2e')][_0x458a45[_0xbc44('0x13')]];}}}catch(_0x5e14e5){logger[_0xbc44('0x1d')](_0xbc44('0x51'),util[_0xbc44('0x1f')](_0x5e14e5,{'showHidden':![],'depth':null}));}};module[_0xbc44('0x52')]=VoiceDialReport; \ No newline at end of file +var _0x1b9c=['bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberrealtime','isNil','includes','duration','endtime','diff','starttime','complete','total','answertime','answered','seconds','billableseconds','sumHoldTime','sumDuration','custom:voiceDialReport','custom:dialend','voice_outbound:save','info','stringify','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','lodash','moment','ioredis','../../../config/environment','ami','redis','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','format','YYYY-MM-DD\x20HH:mm:ss','channel','lastIndexOf','substring','event','privilege','voice_outbound_channel:save','error','inspect','uniqueid','dialstatus','ANSWER','connectedlinenum','connectedlinename','lastevent','connect','custom:dialconnect','[syncDialEnd][VoiceDialReport]','keys','variable','value','voice:outbound','addVariable','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','sipcallid','sipuri'];(function(_0x4d394d,_0x40e7b3){var _0x4f0003=function(_0x56d25d){while(--_0x56d25d){_0x4d394d['push'](_0x4d394d['shift']());}};_0x4f0003(++_0x40e7b3);}(_0x1b9c,0x1ad));var _0xc1b9=function(_0x11118a,_0x5ca172){_0x11118a=_0x11118a-0x0;var _0x479e7c=_0x1b9c[_0x11118a];return _0x479e7c;};'use strict';var _=require(_0xc1b9('0x0'));var moment=require(_0xc1b9('0x1'));var util=require('util');var Redis=require(_0xc1b9('0x2'));var config=require(_0xc1b9('0x3'));var logger=require('../../../config/logger')(_0xc1b9('0x4'));var ami=require('../ami');config[_0xc1b9('0x5')]=_['defaults'](config[_0xc1b9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xc1b9('0x6'))(new Redis(config['redis']));function VoiceDialReport(_0x52ac80){this[_0xc1b9('0x7')]=_0x52ac80[_0xc1b9('0x8')];this[_0xc1b9('0x9')]=_0x52ac80[_0xc1b9('0x9')];this[_0xc1b9('0xa')]={};ami['on'](_0xc1b9('0xb'),this[_0xc1b9('0xc')][_0xc1b9('0xd')](this));ami['on']('dialend',this['syncDialEnd'][_0xc1b9('0xd')](this));ami['on']('varset',this['syncVarSet'][_0xc1b9('0xd')](this));ami['on'](_0xc1b9('0xe'),this[_0xc1b9('0xf')][_0xc1b9('0xd')](this));}VoiceDialReport[_0xc1b9('0x10')][_0xc1b9('0x11')]=function(_0x1b94b2){return _0x1b94b2!==null&&!_[_0xc1b9('0x12')](_0x1b94b2);};VoiceDialReport[_0xc1b9('0x10')][_0xc1b9('0x13')]=function(_0x17ff28,_0x1b2bdf,_0x340ec0){io['to'](_0x17ff28)[_0xc1b9('0x13')](_0x1b2bdf,_0x340ec0);};VoiceDialReport[_0xc1b9('0x10')]['syncDialBegin']=function(_0x3e23e1){try{if(this['isNotNull'](_0x3e23e1)){if(this[_0xc1b9('0x7')][_0x3e23e1['uniqueid']]){_['merge'](this['channels'][_0x3e23e1['uniqueid']],{'starttime':moment()[_0xc1b9('0x14')](_0xc1b9('0x15')),'lastevent':'called','interface':_0x3e23e1[_0xc1b9('0x16')]['substring'](0x0,_0x3e23e1[_0xc1b9('0x16')][_0xc1b9('0x17')]('-')),'membername':_0x3e23e1[_0xc1b9('0x16')][_0xc1b9('0x18')](_0x3e23e1[_0xc1b9('0x16')][_0xc1b9('0x17')]('/')+0x1,_0x3e23e1['channel'][_0xc1b9('0x17')]('-'))},_['omit'](_0x3e23e1,[_0xc1b9('0x19'),_0xc1b9('0x1a')]));this[_0xc1b9('0x13')]('voice:outbound',_0xc1b9('0x1b'),this[_0xc1b9('0x7')][_0x3e23e1['uniqueid']]);ami['emit']('custom:dialbegin',this['channels'][_0x3e23e1['uniqueid']]);}}}catch(_0x2b28dd){logger[_0xc1b9('0x1c')]('[syncDialBegin][VoiceDialReport]',util[_0xc1b9('0x1d')](_0x2b28dd,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xc1b9('0x10')]['syncDialEnd']=function(_0x2552af){try{if(this[_0xc1b9('0x11')](_0x2552af)){if(this[_0xc1b9('0x7')][_0x2552af[_0xc1b9('0x1e')]]){this[_0xc1b9('0x7')][_0x2552af[_0xc1b9('0x1e')]][_0xc1b9('0x1f')]=_0x2552af['dialstatus'];if(_0x2552af[_0xc1b9('0x1f')]===_0xc1b9('0x20')){this[_0xc1b9('0x7')][_0x2552af['uniqueid']][_0xc1b9('0x21')]=_0x2552af['connectedlinenum'];this['channels'][_0x2552af['uniqueid']][_0xc1b9('0x22')]=_0x2552af[_0xc1b9('0x22')];this['channels'][_0x2552af[_0xc1b9('0x1e')]]['answertime']=moment()[_0xc1b9('0x14')](_0xc1b9('0x15'));this[_0xc1b9('0x7')][_0x2552af[_0xc1b9('0x1e')]][_0xc1b9('0x23')]=_0xc1b9('0x24');ami['emit'](_0xc1b9('0x25'),this[_0xc1b9('0x7')][_0x2552af[_0xc1b9('0x1e')]]);}this[_0xc1b9('0x13')]('voice:outbound',_0xc1b9('0x1b'),this[_0xc1b9('0x7')][_0x2552af['uniqueid']]);}}}catch(_0x1e8cae){logger[_0xc1b9('0x1c')](_0xc1b9('0x26'),util['inspect'](_0x1e8cae,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncVarSet']=function(_0x2976d9){try{if(this[_0xc1b9('0x11')](_0x2976d9)){this['addVariable'](_0x2976d9[_0xc1b9('0x1e')],_[_0xc1b9('0x27')](_0x2976d9[_0xc1b9('0x28')])[0x0],_0x2976d9[_0xc1b9('0x29')]);if(this[_0xc1b9('0x11')](_0x2976d9['variable'])&&this[_0xc1b9('0x11')](_0x2976d9[_0xc1b9('0x28')]['outboundrouteid'])){if(_['isUndefined'](this[_0xc1b9('0x7')][_0x2976d9[_0xc1b9('0x1e')]])){this[_0xc1b9('0x7')][_0x2976d9[_0xc1b9('0x1e')]]={'routeId':_0x2976d9[_0xc1b9('0x29')],'variables':this[_0xc1b9('0xa')][_0x2976d9[_0xc1b9('0x1e')]]};this[_0xc1b9('0x13')](_0xc1b9('0x2a'),_0xc1b9('0x1b'),this[_0xc1b9('0x7')][_0x2976d9['uniqueid']]);}}}}catch(_0x21f092){logger['error']('[syncVarSet][VoiceDialReport]',util[_0xc1b9('0x1d')](_0x21f092,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xc1b9('0x10')][_0xc1b9('0x2b')]=function(_0x545958,_0x20a068,_0x1e6972){var _0x2c62c6=['rtpaudioqos',_0xc1b9('0x2c'),_0xc1b9('0x2d'),_0xc1b9('0x2e'),_0xc1b9('0x2f'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0xc1b9('0x30'),_0xc1b9('0x31'),_0xc1b9('0x32'),_0xc1b9('0x33'),_0xc1b9('0x34'),_0xc1b9('0x35'),_0xc1b9('0x36'),_0xc1b9('0x37'),_0xc1b9('0x38'),_0xc1b9('0x39'),'memberpenalty',_0xc1b9('0x3a')];if(!_[_0xc1b9('0x3b')](_0x20a068)&&!_[_0xc1b9('0x3c')](_0x2c62c6,_0x20a068)){if(_[_0xc1b9('0x12')](this['variables'][_0x545958])){this[_0xc1b9('0xa')][_0x545958]={};}this[_0xc1b9('0xa')][_0x545958][_0x20a068]=_0x1e6972;}};VoiceDialReport[_0xc1b9('0x10')][_0xc1b9('0xf')]=function(_0x1ec676){try{if(this['isNotNull'](_0x1ec676)){if(this[_0xc1b9('0x7')][_0x1ec676[_0xc1b9('0x1e')]]){this[_0xc1b9('0x7')][_0x1ec676[_0xc1b9('0x1e')]]['endtime']=moment()[_0xc1b9('0x14')](_0xc1b9('0x15'));this[_0xc1b9('0x7')][_0x1ec676[_0xc1b9('0x1e')]][_0xc1b9('0x3d')]=moment(this['channels'][_0x1ec676['uniqueid']][_0xc1b9('0x3e')])[_0xc1b9('0x3f')](this[_0xc1b9('0x7')][_0x1ec676[_0xc1b9('0x1e')]][_0xc1b9('0x40')],'seconds');this[_0xc1b9('0x7')][_0x1ec676['uniqueid']][_0xc1b9('0x23')]=_0xc1b9('0x41');this[_0xc1b9('0x9')][_0xc1b9('0x42')]+=0x1;if(this[_0xc1b9('0x7')][_0x1ec676[_0xc1b9('0x1e')]][_0xc1b9('0x43')]){this['outbound'][_0xc1b9('0x44')]+=0x1;this['channels'][_0x1ec676['uniqueid']]['holdtime']=moment(this[_0xc1b9('0x7')][_0x1ec676['uniqueid']]['answertime'])[_0xc1b9('0x3f')](this[_0xc1b9('0x7')][_0x1ec676[_0xc1b9('0x1e')]][_0xc1b9('0x40')],_0xc1b9('0x45'));this['channels'][_0x1ec676[_0xc1b9('0x1e')]][_0xc1b9('0x46')]=moment(this[_0xc1b9('0x7')][_0x1ec676[_0xc1b9('0x1e')]][_0xc1b9('0x3e')])['diff'](this[_0xc1b9('0x7')][_0x1ec676[_0xc1b9('0x1e')]][_0xc1b9('0x43')],_0xc1b9('0x45'));this[_0xc1b9('0x9')][_0xc1b9('0x47')]+=this[_0xc1b9('0x7')][_0x1ec676['uniqueid']]['holdtime']||0x0;this[_0xc1b9('0x9')]['sumBillable']+=this['channels'][_0x1ec676[_0xc1b9('0x1e')]][_0xc1b9('0x46')];}this[_0xc1b9('0x9')][_0xc1b9('0x48')]+=this[_0xc1b9('0x7')][_0x1ec676[_0xc1b9('0x1e')]][_0xc1b9('0x3d')];ami[_0xc1b9('0x13')](_0xc1b9('0x49'),this[_0xc1b9('0x7')][_0x1ec676[_0xc1b9('0x1e')]]);ami[_0xc1b9('0x13')](_0xc1b9('0x4a'),this[_0xc1b9('0x7')][_0x1ec676['uniqueid']]);this[_0xc1b9('0x13')](_0xc1b9('0x2a'),_0xc1b9('0x4b'),this[_0xc1b9('0x9')]);logger[_0xc1b9('0x4c')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0xc1b9('0x4d')](this['channels'][_0x1ec676[_0xc1b9('0x1e')]]));this[_0xc1b9('0x13')]('voice:outbound',_0xc1b9('0x4e'),this[_0xc1b9('0x7')][_0x1ec676['uniqueid']]);delete this[_0xc1b9('0x7')][_0x1ec676['uniqueid']];}if(this['variables'][_0x1ec676['uniqueid']]){delete this[_0xc1b9('0xa')][_0x1ec676['uniqueid']];}}}catch(_0x52146d){logger[_0xc1b9('0x1c')](_0xc1b9('0x4f'),util[_0xc1b9('0x1d')](_0x52146d,{'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 5cfb940..4fd839f 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 _0xfa6a=['sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','length','diff','sumDuration','answered','custom:queuecallerunmanaged','lastevent','custom:queuecallerabandon','sumHoldTime','emitVoiceQueueSummary','[syncHangup][VoiceQueueReport]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','BLINDTRANSFER','BLIND','extension','BlindTransfer','context','transfererchannel','[syncBlindTransfer][VoiceQueueReport]','[syncMusicOnHoldStart][VoiceQueueReport]','syncMusicOnHoldStop','mohstarttime','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','exports','lodash','moment','util','md5','ioredis','../../../config/environment','ami','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','queueReports','agents','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','agentcomplete','syncAgentComplete','agentconnect','varset','hangup','syncHangup','fullybooted','syncFullyBooted','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','isUndefined','isEmpty','hasOwnProperty','originated','talking','waiting','clearZombieChannels','channels','switch','sequence','isNil','Action','status','channel','catch','message','No\x20such\x20channel','error','[voiceQueueReport][checkChannel]','[voiceQueueReport][checkQueueReport]','[voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','inspect','emit','emitVoiceQueueChannelSave','name','voice_queue_channel:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','voice_queue_channel:remove','type','inbound','strategy','available','loggedIn','sumBillable','total','unmanaged','abandoned','Trunk','active','callerid','Interval','voice_queue:save','isNotNull','queues','[queues]','then','queue','countBy','toNumber','callers','loggedin','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','syncNewExten','uniqueid','YYYY-MM-DD\x20HH:mm:ss','position','count','pick','keys','push','[syncQueueCallerJoin][VoiceQueueReport]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerexitreason','lastAssignedTo','[syncQueueCallerAbandon][VoiceQueueReport]','queuecallerleaveAt','connectedlinenum','connectedlinename','queuecallerabandonAt','membername','queuecallerexit','queuecallerexitAt','reason','transfer','COMPLETED','startsWith','local/','linkedid','queuecallerjoinAt','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','syncVarSet','variable','value','queuestatus','CONTINUE','EXITWITHKEY','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xfa6a,0x1b8));var _0xafa6=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xfa6a[_0x26462c];return _0x509a42;};'use strict';var _=require(_0xafa6('0x0'));var moment=require(_0xafa6('0x1'));var BPromise=require('bluebird');var util=require(_0xafa6('0x2'));var md5=require(_0xafa6('0x3'));var Redis=require(_0xafa6('0x4'));var config=require(_0xafa6('0x5'));var logger=require('../../../config/logger')(_0xafa6('0x6'));var ami=require(_0xafa6('0x7'));var QueueReport=require(_0xafa6('0x8'));config[_0xafa6('0x9')]=_[_0xafa6('0xa')](config[_0xafa6('0x9')],{'host':_0xafa6('0xb'),'port':0x18eb});var io=require(_0xafa6('0xc'))(new Redis(config[_0xafa6('0x9')]));var Sequence=function(){};Sequence[_0xafa6('0xd')][_0xafa6('0xe')]=function(_0x11eb14){this[_0xafa6('0xf')]=this['tail']?this['tail'][_0xafa6('0x10')](_0x11eb14):_0x11eb14();};function VoiceQueueReport(_0x530db6){this['sequence']=new Sequence();this[_0xafa6('0x11')]={};this[_0xafa6('0x12')]=_0x530db6[_0xafa6('0x12')];this['channels']=_0x530db6[_0xafa6('0x13')];this[_0xafa6('0x14')]=_0x530db6['voiceQueues'];this[_0xafa6('0x15')]=!![];this['campaigns']=_0x530db6[_0xafa6('0x16')];this[_0xafa6('0x17')]={};ami['on'](_0xafa6('0x18'),this[_0xafa6('0x19')][_0xafa6('0x1a')](this));ami['on'](_0xafa6('0x1b'),this[_0xafa6('0x1c')]['bind'](this));ami['on']('queuecallerjoin',this['syncQueueCallerJoin']['bind'](this));ami['on'](_0xafa6('0x1d'),this[_0xafa6('0x1e')][_0xafa6('0x1a')](this));ami['on'](_0xafa6('0x1f'),this['syncQueueCallerLeave']['bind'](this));ami['on'](_0xafa6('0x20'),this[_0xafa6('0x21')][_0xafa6('0x1a')](this));ami['on'](_0xafa6('0x22'),this['syncAgentConnect']['bind'](this));ami['on'](_0xafa6('0x23'),this['syncVarSet'][_0xafa6('0x1a')](this));ami['on'](_0xafa6('0x24'),this[_0xafa6('0x25')][_0xafa6('0x1a')](this));ami['on'](_0xafa6('0x26'),this[_0xafa6('0x27')][_0xafa6('0x1a')](this));ami['on']('musiconholdstart',this[_0xafa6('0x28')][_0xafa6('0x1a')](this));ami['on'](_0xafa6('0x29'),this['syncMusicOnHoldStop']['bind'](this));ami['on'](_0xafa6('0x2a'),this[_0xafa6('0x2b')][_0xafa6('0x1a')](this));ami['on'](_0xafa6('0x2c'),this[_0xafa6('0x2d')]['bind'](this));this[_0xafa6('0x2e')]();this['loopQueueShow']();}function isNotNull(_0xe340ca){return _0xe340ca!==null&&!_[_0xafa6('0x2f')](_0xe340ca);}function clearChannels(_0x2f77f1){if(!_[_0xafa6('0x30')](_0x2f77f1)){for(var _0x3f1b45 in _0x2f77f1){if(_0x2f77f1[_0xafa6('0x31')](_0x3f1b45)){delete _0x2f77f1[_0x3f1b45];}}}}function clearCampaigns(_0x52d225){if(!_[_0xafa6('0x30')](_0x52d225)){for(var _0xaff25c in _0x52d225){if(_0x52d225['hasOwnProperty'](_0xaff25c)){_0x52d225[_0xaff25c][_0xafa6('0x32')]=0x0;}}}}function clearVoiceQueues(_0x56b9ff){if(!_[_0xafa6('0x30')](_0x56b9ff)){for(var _0x5c4278 in _0x56b9ff){if(_0x56b9ff[_0xafa6('0x31')](_0x5c4278)){_0x56b9ff[_0x5c4278][_0xafa6('0x32')]=0x0;_0x56b9ff[_0x5c4278][_0xafa6('0x33')]=0x0;_0x56b9ff[_0x5c4278]['pTalking']=0x0;_0x56b9ff[_0x5c4278][_0xafa6('0x34')]=0x0;_0x56b9ff[_0x5c4278]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x99dc58){if(!_[_0xafa6('0x30')](_0x99dc58)){for(var _0x1346e2 in _0x99dc58){if(_0x99dc58[_0xafa6('0x31')](_0x1346e2)){_0x99dc58[_0x1346e2]['unlockRR']=!![];}}}}VoiceQueueReport[_0xafa6('0xd')][_0xafa6('0x35')]=function(){var _0x575f54=this;for(var _0x1de525 in this[_0xafa6('0x36')]){if(this[_0xafa6('0x36')][_0xafa6('0x31')](_0x1de525)&&!this[_0xafa6('0x36')][_0x1de525][_0xafa6('0x37')]){this[_0xafa6('0x38')][_0xafa6('0xe')](function(){if(!_[_0xafa6('0x39')](_0x575f54['channels'][_0x1de525])){return ami[_0xafa6('0x3a')]({'action':_0xafa6('0x3b'),'channel':_0x575f54[_0xafa6('0x36')][_0x1de525][_0xafa6('0x3c')]})[_0xafa6('0x3d')](function(_0x6e9828){if(_0x6e9828[_0xafa6('0x3e')]===_0xafa6('0x3f')){setTimeout(function(){if(_0x575f54['channels'][_0x1de525]){delete _0x575f54[_0xafa6('0x36')][_0x1de525];logger[_0xafa6('0x40')](_0xafa6('0x41'),_0x1de525);}if(_0x575f54[_0xafa6('0x11')][_0x1de525]){delete _0x575f54[_0xafa6('0x11')][_0x1de525];logger[_0xafa6('0x40')](_0xafa6('0x42'),_0x1de525);}if(_0x575f54[_0xafa6('0x17')][_0x1de525]){delete _0x575f54[_0xafa6('0x17')][_0x1de525];logger['error'](_0xafa6('0x43'),_0x1de525);}},0x1f40);}});}});}}};VoiceQueueReport[_0xafa6('0xd')][_0xafa6('0x27')]=function(){logger[_0xafa6('0x40')](_0xafa6('0x44'));clearChannels(this[_0xafa6('0x36')]);this[_0xafa6('0x45')](this[_0xafa6('0x11')]);clearAgentBooked(this[_0xafa6('0x12')]);clearVoiceQueues(this[_0xafa6('0x14')]);clearCampaigns(this['campaigns']);};VoiceQueueReport['prototype'][_0xafa6('0x45')]=function(_0x2e1e10){var _0x52e0b5=this;if(!_[_0xafa6('0x30')](_0x2e1e10)){for(var _0x115d26 in _0x2e1e10){if(_0x2e1e10[_0xafa6('0x31')](_0x115d26)){_0x52e0b5[_0xafa6('0x46')](_0x2e1e10[_0x115d26]);delete _0x2e1e10[_0x115d26];}}}};function loggerCatch(_0x18b5ad){return function(_0x5fe9f){logger[_0xafa6('0x40')](_0x18b5ad,util[_0xafa6('0x47')](_0x5fe9f,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0xafa6('0xd')]['emit']=function(_0x2fae62,_0x424a8e,_0x4c09f6){io['to'](_0x2fae62)[_0xafa6('0x48')](_0x424a8e,_0x4c09f6);};VoiceQueueReport[_0xafa6('0xd')][_0xafa6('0x49')]=function(_0x12a3b3){this['emit'](util['format']('voice:queue:%s',_0x12a3b3[_0xafa6('0x4a')]),_0xafa6('0x4b'),_0x12a3b3);};VoiceQueueReport[_0xafa6('0xd')][_0xafa6('0x46')]=function(_0x37b428){logger[_0xafa6('0x4c')](_0xafa6('0x4d'),JSON[_0xafa6('0x4e')](_0x37b428));this[_0xafa6('0x48')](util[_0xafa6('0x4f')](_0xafa6('0x50'),_0x37b428[_0xafa6('0x4a')]),_0xafa6('0x51'),_0x37b428);};VoiceQueueReport[_0xafa6('0xd')]['emitVoiceQueueSummary']=function(_0x39c1f9){if(_0x39c1f9[_0xafa6('0x52')]===_0xafa6('0x53')){var _0x54ae9a={'id':_0x39c1f9['id'],'name':_0x39c1f9[_0xafa6('0x4a')],'strategy':_0x39c1f9[_0xafa6('0x54')],'answered':_0x39c1f9['answered'],'available':_0x39c1f9[_0xafa6('0x55')],'loggedIn':_0x39c1f9[_0xafa6('0x56')],'pTalking':_0x39c1f9['pTalking'],'sumBillable':_0x39c1f9[_0xafa6('0x57')],'sumDuration':_0x39c1f9['sumDuration'],'sumHoldTime':_0x39c1f9['sumHoldTime']||0x0,'talking':_0x39c1f9[_0xafa6('0x33')],'total':_0x39c1f9[_0xafa6('0x58')],'type':_0x39c1f9['type'],'unmanaged':_0x39c1f9[_0xafa6('0x59')],'abandoned':_0x39c1f9[_0xafa6('0x5a')],'waiting':_0x39c1f9[_0xafa6('0x34')]};if(_0x39c1f9['Trunk']){_0x54ae9a[_0xafa6('0x5b')]={'id':_0x39c1f9[_0xafa6('0x5b')]['id'],'name':_0x39c1f9[_0xafa6('0x5b')][_0xafa6('0x4a')],'active':_0x39c1f9['Trunk'][_0xafa6('0x5c')],'callerid':_0x39c1f9['Trunk'][_0xafa6('0x5d')]};}if(_0x39c1f9[_0xafa6('0x5e')]){_0x54ae9a[_0xafa6('0x5e')]={'id':_0x39c1f9[_0xafa6('0x5e')]['id'],'name':_0x39c1f9['Interval'][_0xafa6('0x4a')]};}var _0x49a841=md5(JSON[_0xafa6('0x4e')](_0x54ae9a));if(_0x39c1f9[_0xafa6('0x3')]!==_0x49a841){_0x39c1f9[_0xafa6('0x3')]=_0x49a841;this['emit'](util[_0xafa6('0x4f')](_0xafa6('0x50'),_0x54ae9a[_0xafa6('0x4a')]),_0xafa6('0x5f'),_0x54ae9a);}}};VoiceQueueReport['prototype'][_0xafa6('0x60')]=function(_0xf7d555){return _0xf7d555!==null&&!_[_0xafa6('0x2f')](_0xf7d555);};VoiceQueueReport[_0xafa6('0xd')]['loopQueueShow']=function(){var _0x572b62=this;setInterval(function(){_0x572b62[_0xafa6('0x35')]();ami[_0xafa6('0x3a')]({'action':_0xafa6('0x61')})['catch'](loggerCatch(_0xafa6('0x62')));},0x2710);};VoiceQueueReport['prototype'][_0xafa6('0x2e')]=function(){var _0x2b9b8e=this;setInterval(function(){if(_0x2b9b8e[_0xafa6('0x15')]){return ami['Action']({'action':_0xafa6('0x18')})[_0xafa6('0x63')](function(_0x4fcd21){_0x2b9b8e[_0xafa6('0x15')]=![];})[_0xafa6('0x3d')](loggerCatch('[queuesummary]'));}},0x3e8);};VoiceQueueReport[_0xafa6('0xd')]['syncQueueSummary']=function(_0xff9df){try{if(this[_0xafa6('0x60')](_0xff9df)&&this[_0xafa6('0x60')](_0xff9df[_0xafa6('0x64')])){if(this[_0xafa6('0x14')][_0xff9df[_0xafa6('0x64')]]){var _0x52949f=_[_0xafa6('0x65')](this[_0xafa6('0x36')],_0xafa6('0x64'))[_0xff9df[_0xafa6('0x64')]]||0x0;var _0x41fe80=_0x52949f-_0xff9df['callers'];if(this[_0xafa6('0x14')][_0xff9df['queue']][_0xafa6('0x34')]!==_[_0xafa6('0x66')](_0xff9df[_0xafa6('0x67')])||this[_0xafa6('0x14')][_0xff9df[_0xafa6('0x64')]][_0xafa6('0x56')]!==_[_0xafa6('0x66')](_0xff9df[_0xafa6('0x68')])||this[_0xafa6('0x14')][_0xff9df[_0xafa6('0x64')]][_0xafa6('0x55')]!==_[_0xafa6('0x66')](_0xff9df[_0xafa6('0x55')])||this[_0xafa6('0x14')][_0xff9df[_0xafa6('0x64')]][_0xafa6('0x33')]!==_0x41fe80){this[_0xafa6('0x14')][_0xff9df[_0xafa6('0x64')]][_0xafa6('0x34')]=_[_0xafa6('0x66')](_0xff9df[_0xafa6('0x67')]);this[_0xafa6('0x14')][_0xff9df[_0xafa6('0x64')]][_0xafa6('0x56')]=_[_0xafa6('0x66')](_0xff9df['loggedin']);this[_0xafa6('0x14')][_0xff9df[_0xafa6('0x64')]]['available']=_[_0xafa6('0x66')](_0xff9df[_0xafa6('0x55')]);this[_0xafa6('0x14')][_0xff9df['queue']][_0xafa6('0x33')]=_0x41fe80>0x0?_0x41fe80:0x0;this[_0xafa6('0x14')][_0xff9df[_0xafa6('0x64')]]['talking']=this[_0xafa6('0x14')][_0xff9df['queue']]['talking']>_[_0xafa6('0x66')](_0xff9df['loggedin'])?_[_0xafa6('0x66')](_0xff9df[_0xafa6('0x68')]):this[_0xafa6('0x14')][_0xff9df[_0xafa6('0x64')]][_0xafa6('0x33')];this['emitVoiceQueueSummary'](this[_0xafa6('0x14')][_0xff9df['queue']]);}ami[_0xafa6('0x48')](_0xafa6('0x69'),this[_0xafa6('0x14')][_0xff9df['queue']]);}}}catch(_0x12d60e){logger['error'](_0xafa6('0x6a'),util['inspect'](_0x12d60e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xafa6('0xd')][_0xafa6('0x1c')]=function(_0x4288ea){this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0xafa6('0x6b')]=function(_0x3d5ae9){};VoiceQueueReport[_0xafa6('0xd')]['syncQueueCallerJoin']=function(_0x327154){try{if(this[_0xafa6('0x60')](_0x327154)){if(_['isUndefined'](this[_0xafa6('0x11')][_0x327154[_0xafa6('0x6c')]])){this[_0xafa6('0x11')][_0x327154[_0xafa6('0x6c')]]=[];this[_0xafa6('0x36')][_0x327154[_0xafa6('0x6c')]]={};}var _0x4cd477=new QueueReport();_0x4cd477[_0xafa6('0x4a')]=_0x327154['queue'];_0x4cd477[_0xafa6('0x52')]=this[_0xafa6('0x14')][_0x4cd477[_0xafa6('0x4a')]]&&this[_0xafa6('0x14')][_0x4cd477['name']][_0xafa6('0x52')]?this['voiceQueues'][_0x4cd477[_0xafa6('0x4a')]][_0xafa6('0x52')]||_0xafa6('0x53'):_0xafa6('0x53');_0x4cd477[_0xafa6('0x64')]=_0x327154['queue'];_0x4cd477['queuecallerjoinAt']=moment()[_0xafa6('0x4f')](_0xafa6('0x6d'));_0x4cd477[_0xafa6('0x6e')]=_0x327154[_0xafa6('0x6e')];_0x4cd477['count']=_0x327154[_0xafa6('0x6f')];_['merge'](_0x4cd477,_[_0xafa6('0x70')](_0x327154,_[_0xafa6('0x71')](_0x4cd477)));this[_0xafa6('0x11')][_0x327154[_0xafa6('0x6c')]][_0xafa6('0x72')](_0x4cd477);this[_0xafa6('0x36')][_0x327154[_0xafa6('0x6c')]]=_0x4cd477;this['emitVoiceQueueChannelSave'](_0x4cd477);}}catch(_0x5afe19){logger[_0xafa6('0x40')](_0xafa6('0x73'),util[_0xafa6('0x47')](_0x5afe19,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xafa6('0xd')][_0xafa6('0x1e')]=function(_0x108d4a){try{if(this[_0xafa6('0x60')](_0x108d4a)){if(this[_0xafa6('0x11')][_0x108d4a['uniqueid']]){var _0x30adf9=_[_0xafa6('0x74')](this[_0xafa6('0x11')][_0x108d4a[_0xafa6('0x6c')]]);_0x30adf9[_0xafa6('0x75')]=![];_0x30adf9[_0xafa6('0x76')]=null;_0x30adf9['holdtime']=_0x108d4a[_0xafa6('0x77')];_0x30adf9[_0xafa6('0x78')]=_0x108d4a[_0xafa6('0x78')];_0x30adf9[_0xafa6('0x1d')]=!![];_0x30adf9['queuecallerabandonAt']=moment()['format'](_0xafa6('0x6d'));_0x30adf9[_0xafa6('0x79')]='ABANDONED';_0x30adf9[_0xafa6('0x7a')]=null;this[_0xafa6('0x36')][_0x108d4a['uniqueid']]=_0x30adf9;this['emitVoiceQueueChannelRemove'](_0x30adf9);}}}catch(_0x5b69ce){logger[_0xafa6('0x40')](_0xafa6('0x7b'),util['inspect'](_0x5b69ce,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xafa6('0xd')]['syncQueueCallerLeave']=function(_0x74f362){try{if(this[_0xafa6('0x60')](_0x74f362)){if(this[_0xafa6('0x11')][_0x74f362[_0xafa6('0x6c')]]){var _0x414e75=_[_0xafa6('0x74')](this[_0xafa6('0x11')][_0x74f362[_0xafa6('0x6c')]]);_0x414e75[_0xafa6('0x7c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x414e75[_0xafa6('0x7d')]=_0x74f362['connectedlinenum'];_0x414e75[_0xafa6('0x7e')]=_0x74f362['connectedlinename'];this[_0xafa6('0x36')][_0x74f362[_0xafa6('0x6c')]]=_0x414e75;this['emitVoiceQueueChannelSave'](_0x414e75);}}}catch(_0xe7c6d){logger[_0xafa6('0x40')]('[syncQueueCallerLeave][VoiceQueueReport]',util['inspect'](_0xe7c6d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xafa6('0xd')]['syncAgentConnect']=function(_0x1bcbaf){try{if(this[_0xafa6('0x60')](_0x1bcbaf)){if(this[_0xafa6('0x11')][_0x1bcbaf[_0xafa6('0x6c')]]){var _0x47d9c1=_[_0xafa6('0x74')](this[_0xafa6('0x11')][_0x1bcbaf[_0xafa6('0x6c')]]);_0x47d9c1[_0xafa6('0x75')]=!![];_0x47d9c1[_0xafa6('0x79')]='COMPLETEDBYAGENT';}}}catch(_0x404a84){logger[_0xafa6('0x40')]('[syncAgentConnect][VoiceQueueReport]',util[_0xafa6('0x47')](_0x404a84,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xafa6('0x21')]=function(_0xe010d1){try{if(this[_0xafa6('0x60')](_0xe010d1)){if(this[_0xafa6('0x11')][_0xe010d1['uniqueid']]){var _0x2c1ee2=_[_0xafa6('0x74')](this['queueReports'][_0xe010d1['uniqueid']]);_0x2c1ee2['queuecallerabandon']=![];_0x2c1ee2[_0xafa6('0x7f')]=null;_0x2c1ee2['assigned']=!![];_0x2c1ee2['lastAssignedTo']=_0xe010d1[_0xafa6('0x80')];_0x2c1ee2[_0xafa6('0x77')]=_0xe010d1[_0xafa6('0x77')];_0x2c1ee2[_0xafa6('0x75')]=!![];_0x2c1ee2[_0xafa6('0x81')]=![];_0x2c1ee2[_0xafa6('0x82')]=null;if(!_0x2c1ee2['transfer']){if(_0xe010d1[_0xafa6('0x83')]==_0xafa6('0x84')){_0x2c1ee2['queuecallerexitreason']=_0xafa6('0x85');}else{if(_[_0xafa6('0x86')](_0xe010d1[_0xafa6('0x3c')]['toLowerCase'](),_0xafa6('0x87'))){if(this[_0xafa6('0x11')][_0xe010d1['linkedid']]){var _0x428781=_['last'](this['queueReports'][_0xe010d1[_0xafa6('0x88')]]);_0x428781['queuecallercomplete']=![];_0x428781[_0xafa6('0x81')]=!![];_0x428781[_0xafa6('0x82')]=moment(_0x2c1ee2[_0xafa6('0x89')])[_0xafa6('0x8a')](_0xe010d1[_0xafa6('0x77')],_0xafa6('0x8b'))[_0xafa6('0x4f')](_0xafa6('0x6d'));_0x428781['queuecallerexitreason']=_0xafa6('0x8c');_0x428781[_0xafa6('0x84')]=!![];_0x428781[_0xafa6('0x8d')]=_0xafa6('0x8e');_0x428781[_0xafa6('0x8f')]=_0xe010d1[_0xafa6('0x90')];_0x428781[_0xafa6('0x91')]=_0xe010d1['uniqueid'];var _0xb65bbc=this[_0xafa6('0x11')][_0xe010d1[_0xafa6('0x88')]];this[_0xafa6('0x11')][_0xe010d1['linkedid']]=this[_0xafa6('0x11')][_0xe010d1[_0xafa6('0x6c')]];this[_0xafa6('0x11')][_0xe010d1[_0xafa6('0x6c')]]=_0xb65bbc;}}else{_0x2c1ee2['queuecallerexitreason']='COMPLETEDBY'+_0xe010d1['reason']['toUpperCase']();}}}this[_0xafa6('0x36')][_0xe010d1[_0xafa6('0x6c')]]=_0x2c1ee2;this[_0xafa6('0x46')](_0x2c1ee2);}}}catch(_0x359146){logger[_0xafa6('0x40')]('[syncAgentComplete][VoiceQueueReport]',util[_0xafa6('0x47')](_0x359146,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xafa6('0xd')][_0xafa6('0x92')]=function(_0x3a0751){try{if(this[_0xafa6('0x60')](_0x3a0751)){this['addVariable'](_0x3a0751[_0xafa6('0x6c')],_[_0xafa6('0x71')](_0x3a0751[_0xafa6('0x93')])[0x0],_0x3a0751[_0xafa6('0x94')]);if(this['queueReports'][_0x3a0751['uniqueid']]){var _0x32b8e6=_[_0xafa6('0x74')](this[_0xafa6('0x11')][_0x3a0751[_0xafa6('0x6c')]]);if(_0x32b8e6){if(this[_0xafa6('0x60')](_0x3a0751[_0xafa6('0x93')])&&this['isNotNull'](_0x3a0751[_0xafa6('0x93')][_0xafa6('0x95')])){switch(_0x3a0751[_0xafa6('0x94')]){case _0xafa6('0x96'):_0x32b8e6['queuecallerexit']=![];_0x32b8e6[_0xafa6('0x82')]=null;break;default:_0x32b8e6[_0xafa6('0x81')]=!![];_0x32b8e6[_0xafa6('0x82')]=moment()[_0xafa6('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x32b8e6[_0xafa6('0x7c')]=moment()[_0xafa6('0x4f')](_0xafa6('0x6d'));}_0x32b8e6['queuecallerabandon']=![];_0x32b8e6['queuecallerabandonAt']=null;_0x32b8e6['queuecallerexitreason']=_0x3a0751[_0xafa6('0x94')];this[_0xafa6('0x36')][_0x3a0751[_0xafa6('0x6c')]]=_0x32b8e6;this[_0xafa6('0x46')](_0x32b8e6);}else if(this[_0xafa6('0x60')](_0x3a0751['variable'])&&this[_0xafa6('0x60')](_0x3a0751[_0xafa6('0x93')]['queueposition'])){if(!_0x32b8e6[_0xafa6('0x1d')]){_0x32b8e6[_0xafa6('0x81')]=!![];_0x32b8e6[_0xafa6('0x82')]=moment()[_0xafa6('0x4f')](_0xafa6('0x6d'));_0x32b8e6[_0xafa6('0x79')]=_0xafa6('0x97');_0x32b8e6['queuecallerleaveAt']=moment()['format'](_0xafa6('0x6d'));this['channels'][_0x3a0751[_0xafa6('0x6c')]]=_0x32b8e6;}}_0x32b8e6[_0xafa6('0x17')]=this[_0xafa6('0x17')][_0x3a0751[_0xafa6('0x6c')]];}}}}catch(_0x1baee5){logger[_0xafa6('0x40')]('[syncVarSet][VoiceQueueReport]',util[_0xafa6('0x47')](_0x1baee5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xafa6('0xd')][_0xafa6('0x98')]=function(_0x43e796,_0x6525d6,_0xdee69d){var _0xd71c31=[_0xafa6('0x99'),_0xafa6('0x9a'),'rtpaudioqosjitter',_0xafa6('0x9b'),_0xafa6('0x9c'),_0xafa6('0x9d'),_0xafa6('0x9e'),_0xafa6('0x9f'),_0xafa6('0xa0'),_0xafa6('0xa1'),_0xafa6('0xa2'),_0xafa6('0xa3'),_0xafa6('0xa4'),_0xafa6('0xa5'),_0xafa6('0xa6'),_0xafa6('0xa7'),'membername',_0xafa6('0xa8'),_0xafa6('0xa9')];if(!_[_0xafa6('0x39')](_0x6525d6)&&!_['includes'](_0xd71c31,_0x6525d6)){if(_[_0xafa6('0x2f')](this[_0xafa6('0x17')][_0x43e796])){this[_0xafa6('0x17')][_0x43e796]={};}this[_0xafa6('0x17')][_0x43e796][_0x6525d6]=_0xdee69d;}};VoiceQueueReport[_0xafa6('0xd')][_0xafa6('0x25')]=function(_0x2a752e){try{if(this[_0xafa6('0x60')](_0x2a752e)){if(this[_0xafa6('0x11')][_0x2a752e[_0xafa6('0x6c')]]){for(var _0x251888=0x0,_0x1c36b4={};_0x2518880x0?_0x5e57dd:0x0;this[_0x93af('0x12')][_0x3ac614['queue']][_0x93af('0x2e')]=this[_0x93af('0x12')][_0x3ac614[_0x93af('0x5c')]]['talking']>_[_0x93af('0x5d')](_0x3ac614[_0x93af('0x5f')])?_[_0x93af('0x5d')](_0x3ac614[_0x93af('0x5f')]):this[_0x93af('0x12')][_0x3ac614[_0x93af('0x5c')]][_0x93af('0x2e')];this[_0x93af('0x48')](this[_0x93af('0x12')][_0x3ac614[_0x93af('0x5c')]]);}ami[_0x93af('0x3f')](_0x93af('0x60'),this[_0x93af('0x12')][_0x3ac614['queue']]);}}}catch(_0x53c21f){logger[_0x93af('0x38')]('[syncQueueSummary][VoiceQueueReport]',util['inspect'](_0x53c21f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x93af('0xb')][_0x93af('0x17')]=function(_0x540a92){this[_0x93af('0x58')]=!![];};VoiceQueueReport[_0x93af('0xb')][_0x93af('0x61')]=function(_0x54a2b5){};VoiceQueueReport[_0x93af('0xb')][_0x93af('0x18')]=function(_0x111c7f){try{if(this['isNotNull'](_0x111c7f)){if(_[_0x93af('0x2a')](this[_0x93af('0xe')][_0x111c7f[_0x93af('0x62')]])){this[_0x93af('0xe')][_0x111c7f[_0x93af('0x62')]]=[];this[_0x93af('0x10')][_0x111c7f['uniqueid']]={};}var _0x18b8c4=new QueueReport();_0x18b8c4[_0x93af('0x42')]=_0x111c7f[_0x93af('0x5c')];_0x18b8c4[_0x93af('0x49')]=this[_0x93af('0x12')][_0x18b8c4[_0x93af('0x42')]]&&this['voiceQueues'][_0x18b8c4[_0x93af('0x42')]][_0x93af('0x49')]?this[_0x93af('0x12')][_0x18b8c4[_0x93af('0x42')]][_0x93af('0x49')]||_0x93af('0x63'):'inbound';_0x18b8c4[_0x93af('0x5c')]=_0x111c7f[_0x93af('0x5c')];_0x18b8c4['queuecallerjoinAt']=moment()[_0x93af('0x41')](_0x93af('0x64'));_0x18b8c4[_0x93af('0x65')]=_0x111c7f[_0x93af('0x65')];_0x18b8c4[_0x93af('0x66')]=_0x111c7f['count'];_[_0x93af('0x67')](_0x18b8c4,_[_0x93af('0x68')](_0x111c7f,_[_0x93af('0x69')](_0x18b8c4)));this[_0x93af('0xe')][_0x111c7f[_0x93af('0x62')]][_0x93af('0x6a')](_0x18b8c4);this[_0x93af('0x10')][_0x111c7f[_0x93af('0x62')]]=_0x18b8c4;this[_0x93af('0x40')](_0x18b8c4);}}catch(_0x5e0f94){logger['error'](_0x93af('0x6b'),util['inspect'](_0x5e0f94,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x93af('0x19')]=function(_0x431fe2){try{if(this[_0x93af('0x5b')](_0x431fe2)){if(this[_0x93af('0xe')][_0x431fe2[_0x93af('0x62')]]){var _0x264d6c=_[_0x93af('0x6c')](this[_0x93af('0xe')][_0x431fe2['uniqueid']]);_0x264d6c['queuecallercomplete']=![];_0x264d6c['queuecallercompleteAt']=null;_0x264d6c[_0x93af('0x6d')]=_0x431fe2[_0x93af('0x6d')];_0x264d6c[_0x93af('0x6e')]=_0x431fe2[_0x93af('0x6e')];_0x264d6c[_0x93af('0x6f')]=!![];_0x264d6c[_0x93af('0x70')]=moment()[_0x93af('0x41')](_0x93af('0x64'));_0x264d6c[_0x93af('0x71')]='ABANDONED';_0x264d6c[_0x93af('0x72')]=null;this['channels'][_0x431fe2[_0x93af('0x62')]]=_0x264d6c;this['emitVoiceQueueChannelRemove'](_0x264d6c);}}}catch(_0x304b0d){logger[_0x93af('0x38')]('[syncQueueCallerAbandon][VoiceQueueReport]',util[_0x93af('0x3e')](_0x304b0d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x93af('0xb')]['syncQueueCallerLeave']=function(_0x289aa2){try{if(this[_0x93af('0x5b')](_0x289aa2)){if(this[_0x93af('0xe')][_0x289aa2[_0x93af('0x62')]]){var _0x1a1315=_['last'](this[_0x93af('0xe')][_0x289aa2[_0x93af('0x62')]]);_0x1a1315[_0x93af('0x73')]=moment()[_0x93af('0x41')](_0x93af('0x64'));_0x1a1315[_0x93af('0x74')]=_0x289aa2[_0x93af('0x74')];_0x1a1315['connectedlinename']=_0x289aa2[_0x93af('0x75')];this[_0x93af('0x10')][_0x289aa2[_0x93af('0x62')]]=_0x1a1315;this[_0x93af('0x40')](_0x1a1315);}}}catch(_0x18990e){logger[_0x93af('0x38')](_0x93af('0x76'),util[_0x93af('0x3e')](_0x18990e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x93af('0xb')][_0x93af('0x1f')]=function(_0x3118a1){try{if(this[_0x93af('0x5b')](_0x3118a1)){if(this[_0x93af('0xe')][_0x3118a1[_0x93af('0x62')]]){var _0x36a525=_[_0x93af('0x6c')](this['queueReports'][_0x3118a1[_0x93af('0x62')]]);_0x36a525[_0x93af('0x77')]=!![];_0x36a525[_0x93af('0x71')]=_0x93af('0x78');}}}catch(_0x3ce1b9){logger[_0x93af('0x38')](_0x93af('0x79'),util[_0x93af('0x3e')](_0x3ce1b9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x93af('0xb')][_0x93af('0x1d')]=function(_0x450e16){try{if(this[_0x93af('0x5b')](_0x450e16)){if(this[_0x93af('0xe')][_0x450e16[_0x93af('0x62')]]){var _0x38fe76=_[_0x93af('0x6c')](this[_0x93af('0xe')][_0x450e16[_0x93af('0x62')]]);_0x38fe76[_0x93af('0x6f')]=![];_0x38fe76[_0x93af('0x70')]=null;_0x38fe76[_0x93af('0x7a')]=!![];_0x38fe76[_0x93af('0x72')]=_0x450e16[_0x93af('0x7b')];_0x38fe76['holdtime']=_0x450e16[_0x93af('0x6d')];_0x38fe76[_0x93af('0x77')]=!![];_0x38fe76[_0x93af('0x7c')]=![];_0x38fe76['queuecallerexitAt']=null;if(!_0x38fe76['transfer']){if(_0x450e16[_0x93af('0x7d')]=='transfer'){_0x38fe76[_0x93af('0x71')]=_0x93af('0x7e');}else{if(_[_0x93af('0x7f')](_0x450e16[_0x93af('0x35')][_0x93af('0x80')](),_0x93af('0x81'))){if(this[_0x93af('0xe')][_0x450e16[_0x93af('0x82')]]){var _0x5b39c2=_[_0x93af('0x6c')](this['queueReports'][_0x450e16[_0x93af('0x82')]]);_0x5b39c2[_0x93af('0x77')]=![];_0x5b39c2[_0x93af('0x7c')]=!![];_0x5b39c2['queuecallerexitAt']=moment(_0x38fe76[_0x93af('0x83')])['add'](_0x450e16[_0x93af('0x6d')],_0x93af('0x84'))[_0x93af('0x41')](_0x93af('0x64'));_0x5b39c2[_0x93af('0x71')]=_0x93af('0x85');_0x5b39c2['transfer']=!![];_0x5b39c2[_0x93af('0x86')]=_0x93af('0x87');_0x5b39c2[_0x93af('0x88')]=_0x450e16[_0x93af('0x89')];_0x5b39c2[_0x93af('0x8a')]=_0x450e16[_0x93af('0x62')];var _0x33fb7e=this[_0x93af('0xe')][_0x450e16[_0x93af('0x82')]];this[_0x93af('0xe')][_0x450e16[_0x93af('0x82')]]=this[_0x93af('0xe')][_0x450e16[_0x93af('0x62')]];this[_0x93af('0xe')][_0x450e16[_0x93af('0x62')]]=_0x33fb7e;}}else{_0x38fe76['queuecallerexitreason']=_0x93af('0x8b')+_0x450e16[_0x93af('0x7d')]['toUpperCase']();}}}this[_0x93af('0x10')][_0x450e16[_0x93af('0x62')]]=_0x38fe76;this[_0x93af('0x3d')](_0x38fe76);}}}catch(_0x5d5cb7){logger['error'](_0x93af('0x8c'),util['inspect'](_0x5d5cb7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x93af('0x21')]=function(_0x30423f){try{if(this[_0x93af('0x5b')](_0x30423f)){this[_0x93af('0x8d')](_0x30423f['uniqueid'],_[_0x93af('0x69')](_0x30423f[_0x93af('0x8e')])[0x0],_0x30423f[_0x93af('0x8f')]);if(this['queueReports'][_0x30423f[_0x93af('0x62')]]){var _0x3e3efb=_[_0x93af('0x6c')](this['queueReports'][_0x30423f[_0x93af('0x62')]]);if(_0x3e3efb){if(this[_0x93af('0x5b')](_0x30423f['variable'])&&this[_0x93af('0x5b')](_0x30423f[_0x93af('0x8e')][_0x93af('0x90')])){switch(_0x30423f[_0x93af('0x8f')]){case _0x93af('0x91'):_0x3e3efb[_0x93af('0x7c')]=![];_0x3e3efb[_0x93af('0x92')]=null;break;default:_0x3e3efb[_0x93af('0x7c')]=!![];_0x3e3efb[_0x93af('0x92')]=moment()[_0x93af('0x41')]('YYYY-MM-DD\x20HH:mm:ss');_0x3e3efb[_0x93af('0x73')]=moment()[_0x93af('0x41')](_0x93af('0x64'));}_0x3e3efb[_0x93af('0x6f')]=![];_0x3e3efb[_0x93af('0x70')]=null;_0x3e3efb[_0x93af('0x71')]=_0x30423f[_0x93af('0x8f')];this['channels'][_0x30423f['uniqueid']]=_0x3e3efb;this[_0x93af('0x3d')](_0x3e3efb);}else if(this['isNotNull'](_0x30423f['variable'])&&this[_0x93af('0x5b')](_0x30423f[_0x93af('0x8e')][_0x93af('0x93')])){if(!_0x3e3efb[_0x93af('0x6f')]){_0x3e3efb[_0x93af('0x7c')]=!![];_0x3e3efb[_0x93af('0x92')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3e3efb[_0x93af('0x71')]=_0x93af('0x94');_0x3e3efb[_0x93af('0x73')]=moment()[_0x93af('0x41')](_0x93af('0x64'));this['channels'][_0x30423f['uniqueid']]=_0x3e3efb;}}_0x3e3efb[_0x93af('0x3a')]=this[_0x93af('0x3a')][_0x30423f[_0x93af('0x62')]];}}}}catch(_0x23b535){logger['error'](_0x93af('0x95'),util['inspect'](_0x23b535,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x93af('0xb')][_0x93af('0x8d')]=function(_0xad5f92,_0x155d41,_0x5467ed){var _0x12296f=[_0x93af('0x96'),_0x93af('0x97'),_0x93af('0x98'),_0x93af('0x99'),_0x93af('0x9a'),_0x93af('0x9b'),_0x93af('0x9c'),'rtpaudioqosrttbridged',_0x93af('0x9d'),_0x93af('0x9e'),_0x93af('0x9f'),'bridgepvtcallid',_0x93af('0xa0'),_0x93af('0xa1'),_0x93af('0xa2'),'memberlastcall',_0x93af('0x7b'),'memberpenalty',_0x93af('0xa3')];if(!_[_0x93af('0xa4')](_0x155d41)&&!_[_0x93af('0xa5')](_0x12296f,_0x155d41)){if(_[_0x93af('0x2a')](this[_0x93af('0x3a')][_0xad5f92])){this[_0x93af('0x3a')][_0xad5f92]={};}this[_0x93af('0x3a')][_0xad5f92][_0x155d41]=_0x5467ed;}};VoiceQueueReport[_0x93af('0xb')]['syncHangup']=function(_0x4e24e0){try{if(this['isNotNull'](_0x4e24e0)){if(this[_0x93af('0xe')][_0x4e24e0[_0x93af('0x62')]]){for(var _0x1e5676=0x0,_0xe216b={};_0x1e5676=0x0?moment(_0x3b27ed[_0x3836('0x15')])[_0x3836('0xa')](_0x3b27ed[_0x3836('0x14')],_0x3836('0xc')):null,'data1':_0x3836('0x16'),'data2':_0x3b27ed[_0x3836('0xe')],'data3':_0x3b27ed[_0x3836('0x17')],'data4':_0x3b27ed['dialstring']||null,'role':_0x3836('0xd'),'internal':_0x3b27ed['accountcode']?_[_0x3836('0xf')](_0x3b27ed[_0x3836('0xe')]):undefined,'uniqueid':_0x3b27ed[_0x3836('0x10')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0xaecb=['Request','voice','membername','TALKING','starttime','endtime','diff','outbound','dialstring','moment','../client','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','lastAssignedTo','interface','format','queuecallerleaveAt','seconds','inbound','calleridnum','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport'];(function(_0x48b5e0,_0xb3826){var _0x4287ea=function(_0x14519e){while(--_0x14519e){_0x48b5e0['push'](_0x48b5e0['shift']());}};_0x4287ea(++_0xb3826);}(_0xaecb,0x1ef));var _0xbaec=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xaecb[_0xa464c9];return _0x3d73c4;};'use strict';var moment=require(_0xbaec('0x0'));var _=require('lodash');var util=require('util');var client=require(_0xbaec('0x1'));exports['voiceQueueReport']=function(_0x2c5722){var _0x139872=_0x2c5722[_0xbaec('0x2')]||_0x2c5722[_0xbaec('0x3')];return client['Request'](_0xbaec('0x4'),{'body':{'channel':'voice','membername':_0x2c5722[_0xbaec('0x5')],'interface':_['isNil'](_0x2c5722[_0xbaec('0x6')])?util[_0xbaec('0x7')]('SIP/%s',_0x2c5722[_0xbaec('0x5')]):_0x2c5722[_0xbaec('0x6')],'type':'TALKING','enterAt':_0x2c5722[_0xbaec('0x8')],'exitAt':_0x139872,'duration':moment(_0x139872)['diff'](_0x2c5722[_0xbaec('0x8')],_0xbaec('0x9')),'data1':_0xbaec('0xa'),'data2':_0x2c5722[_0xbaec('0xb')],'data3':_0x2c5722['exten'],'data4':null,'data5':_0x2c5722[_0xbaec('0xc')],'role':_0xbaec('0xd'),'internal':_0x2c5722[_0xbaec('0xe')]?_[_0xbaec('0xf')](_0x2c5722[_0xbaec('0xe')]):undefined,'uniqueid':_0x2c5722[_0xbaec('0x10')]},'log':_0xbaec('0x4')});};exports[_0xbaec('0x11')]=function(_0x516144){return client[_0xbaec('0x12')]('CreateMemberReport',{'body':{'channel':_0xbaec('0x13'),'membername':_0x516144[_0xbaec('0x14')],'interface':_0x516144[_0xbaec('0x6')],'type':_0xbaec('0x15'),'enterAt':_0x516144[_0xbaec('0x16')],'exitAt':_0x516144['endtime'],'duration':moment(_0x516144[_0xbaec('0x17')])[_0xbaec('0x18')](_0x516144[_0xbaec('0x16')],_0xbaec('0x9'))>=0x0?moment(_0x516144[_0xbaec('0x17')])[_0xbaec('0x18')](_0x516144[_0xbaec('0x16')],_0xbaec('0x9')):null,'data1':_0xbaec('0x19'),'data2':_0x516144[_0xbaec('0xe')],'data3':_0x516144['exten'],'data4':_0x516144[_0xbaec('0x1a')]||null,'role':_0xbaec('0xd'),'internal':_0x516144[_0xbaec('0xe')]?_[_0xbaec('0xf')](_0x516144[_0xbaec('0xe')]):undefined,'uniqueid':_0x516144['uniqueid']},'log':_0xbaec('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index b74b27b..f60b609 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 _0x3c81=['../client','getTemplates','Request'];(function(_0x534e67,_0x45eb1d){var _0x3d9e51=function(_0x4e0e12){while(--_0x4e0e12){_0x534e67['push'](_0x534e67['shift']());}};_0x3d9e51(++_0x45eb1d);}(_0x3c81,0x102));var _0x13c8=function(_0x54fb55,_0x497bd5){_0x54fb55=_0x54fb55-0x0;var _0x359030=_0x3c81[_0x54fb55];return _0x359030;};'use strict';var client=require(_0x13c8('0x0'));exports[_0x13c8('0x1')]=function(_0x48c35b){return function(_0x252f26){return client[_0x13c8('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id','name','html']},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x657b=['../client','getTemplates','Request','name','html'];(function(_0x25c988,_0xce8221){var _0x45fcc2=function(_0x47fba5){while(--_0x47fba5){_0x25c988['push'](_0x25c988['shift']());}};_0x45fcc2(++_0xce8221);}(_0x657b,0x131));var _0xb657=function(_0x2ef18c,_0x36a1d5){_0x2ef18c=_0x2ef18c-0x0;var _0x5a4856=_0x657b[_0x2ef18c];return _0x5a4856;};'use strict';var client=require(_0xb657('0x0'));exports[_0xb657('0x1')]=function(_0x92c328){return function(_0x329887){return client[_0xb657('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xb657('0x3'),_0xb657('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index e36fc66..c073bb3 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 _0xb09a=['AnyConditions','Action','action','data1','data2','data3','data4','data5','data7','GetTrigger','../client','getTriggers','name','status','Condition','field','operator','value'];(function(_0x389882,_0x31c162){var _0x329a0a=function(_0x3d32fe){while(--_0x3d32fe){_0x389882['push'](_0x389882['shift']());}};_0x329a0a(++_0x31c162);}(_0xb09a,0x1cc));var _0xab09=function(_0x5a2285,_0x3212d1){_0x5a2285=_0x5a2285-0x0;var _0x48f6ed=_0xb09a[_0x5a2285];return _0x48f6ed;};'use strict';var client=require(_0xab09('0x0'));exports[_0xab09('0x1')]=function(_0x29f90c){return function(_0x23a1b4){return client['Request']('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xab09('0x2'),'channel',_0xab09('0x3')],'include':[{'model':_0xab09('0x4'),'as':'AllConditions','attributes':['id',_0xab09('0x5'),_0xab09('0x6'),_0xab09('0x7')]},{'model':_0xab09('0x4'),'as':_0xab09('0x8'),'attributes':['id',_0xab09('0x5'),'operator','value']},{'model':_0xab09('0x9'),'as':'Actions','attributes':['id',_0xab09('0xa'),_0xab09('0xb'),_0xab09('0xc'),_0xab09('0xd'),_0xab09('0xe'),_0xab09('0xf'),'data6',_0xab09('0x10')]}]},'log':_0xab09('0x11')});};}; \ No newline at end of file +var _0x2f90=['action','data1','data2','data3','data5','data6','data7','GetTrigger','getTriggers','Request','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Action'];(function(_0x35c33d,_0x46defa){var _0x5139b3=function(_0x427391){while(--_0x427391){_0x35c33d['push'](_0x35c33d['shift']());}};_0x5139b3(++_0x46defa);}(_0x2f90,0xa0));var _0x02f9=function(_0x1bd5e3,_0x54a7f0){_0x1bd5e3=_0x1bd5e3-0x0;var _0x43bbff=_0x2f90[_0x1bd5e3];return _0x43bbff;};'use strict';var client=require('../client');exports[_0x02f9('0x0')]=function(_0x19e99c){return function(_0x3fd6be){return client[_0x02f9('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id','name',_0x02f9('0x2'),_0x02f9('0x3')],'include':[{'model':_0x02f9('0x4'),'as':_0x02f9('0x5'),'attributes':['id',_0x02f9('0x6'),_0x02f9('0x7'),_0x02f9('0x8')]},{'model':'Condition','as':_0x02f9('0x9'),'attributes':['id',_0x02f9('0x6'),'operator',_0x02f9('0x8')]},{'model':_0x02f9('0xa'),'as':'Actions','attributes':['id',_0x02f9('0xb'),_0x02f9('0xc'),_0x02f9('0xd'),_0x02f9('0xe'),'data4',_0x02f9('0xf'),_0x02f9('0x10'),_0x02f9('0x11')]}]},'log':_0x02f9('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index ee77f7c..ade5329 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 _0x958a=['name','registry','GetTrunk'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x958a,0x1c4));var _0xa958=function(_0x5ea987,_0x5f08b2){_0x5ea987=_0x5ea987-0x0;var _0x1a98c8=_0x958a[_0x5ea987];return _0x1a98c8;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x3810a1){return function(_0x363286){return client['Request'](_0xa958('0x0'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xa958('0x1'),_0xa958('0x2')]},'log':_0xa958('0x0')});};}; \ No newline at end of file +var _0xaf55=['getTrunks','name','registry','GetTrunk'];(function(_0x1dd034,_0x5f5a76){var _0x4ecb48=function(_0x18ee58){while(--_0x18ee58){_0x1dd034['push'](_0x1dd034['shift']());}};_0x4ecb48(++_0x5f5a76);}(_0xaf55,0xc0));var _0x5af5=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xaf55[_0x2aa0e7];return _0x1472c0;};'use strict';var client=require('../client');exports[_0x5af5('0x0')]=function(_0x39b151){return function(_0x10c4d6){return client['Request']('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x5af5('0x1'),_0x5af5('0x2')]},'log':_0x5af5('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index c083a82..6c2cdc9 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 _0x3dab=['voicePause','phone','interface','getTelephones','telephone','internal','savePause','saveUnpause','ShowUser','agent','fullname','lastPauseAt','../client','getAgents','Request','GetUser','name','email','accountcode','online','lastLoginAt','pauseType'];(function(_0x153e7d,_0x10a35f){var _0x3c22dd=function(_0x4d33f6){while(--_0x4d33f6){_0x153e7d['push'](_0x153e7d['shift']());}};_0x3c22dd(++_0x10a35f);}(_0x3dab,0xfe));var _0xb3da=function(_0x19416a,_0x44f465){_0x19416a=_0x19416a-0x0;var _0x1ed6c0=_0x3dab[_0x19416a];return _0x1ed6c0;};'use strict';var client=require(_0xb3da('0x0'));exports[_0xb3da('0x1')]=function(){return function(){return client[_0xb3da('0x2')](_0xb3da('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0xb3da('0x4'),_0xb3da('0x5'),_0xb3da('0x6'),'fullname',_0xb3da('0x7'),_0xb3da('0x8'),_0xb3da('0x9'),'lastPauseAt',_0xb3da('0xa'),_0xb3da('0xb'),'mobile',_0xb3da('0xc')]},'log':_0xb3da('0x1')});};};exports[_0xb3da('0xd')]=function(){return function(){return client[_0xb3da('0x2')](_0xb3da('0x3'),{'options':{'raw':!![],'where':{'role':_0xb3da('0xe')},'attributes':['id',_0xb3da('0x4'),'accountcode',_0xb3da('0xf')]},'log':_0xb3da('0xd')});};};exports[_0xb3da('0x10')]=function(_0x18eb87,_0x3eb4bb,_0x1e1fea){return client[_0xb3da('0x2')]('PauseUser',{'body':{'type':_0x3eb4bb,'uniqueid':_0x1e1fea},'options':{'where':{'id':_0x18eb87['id']}},'log':'savePause'});};exports[_0xb3da('0x11')]=function(_0x2dfb62){return client[_0xb3da('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x2dfb62['id']}},'log':_0xb3da('0x10')});};exports['getAgent']=function(_0x5f2fea){return client[_0xb3da('0x2')](_0xb3da('0x12'),{'options':{'raw':![],'where':{'role':_0xb3da('0x13'),'id':_0x5f2fea},'attributes':['id','name','email',_0xb3da('0x6'),_0xb3da('0x14'),_0xb3da('0x7'),_0xb3da('0x8'),_0xb3da('0x9'),_0xb3da('0x15'),_0xb3da('0xa'),_0xb3da('0xc')]},'log':'getAgent'});}; \ No newline at end of file +var _0x032f=['telephone','accountcode','internal','savePause','Request','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','pauseType','lastPauseAt','../client','getAgents','agent','name','email','fullname','online','lastLoginAt','voicePause','phone','mobile','interface','getTelephones','GetUser'];(function(_0x414851,_0x1c0559){var _0x511816=function(_0x2463b6){while(--_0x2463b6){_0x414851['push'](_0x414851['shift']());}};_0x511816(++_0x1c0559);}(_0x032f,0xdc));var _0xf032=function(_0x5a1b96,_0x4cbb27){_0x5a1b96=_0x5a1b96-0x0;var _0x4db2e8=_0x032f[_0x5a1b96];return _0x4db2e8;};'use strict';var client=require(_0xf032('0x0'));exports[_0xf032('0x1')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':![],'where':{'role':_0xf032('0x2')},'attributes':['id',_0xf032('0x3'),_0xf032('0x4'),'accountcode',_0xf032('0x5'),_0xf032('0x6'),_0xf032('0x7'),'pauseType','lastPauseAt',_0xf032('0x8'),_0xf032('0x9'),_0xf032('0xa'),_0xf032('0xb')]},'log':_0xf032('0x1')});};};exports[_0xf032('0xc')]=function(){return function(){return client['Request'](_0xf032('0xd'),{'options':{'raw':!![],'where':{'role':_0xf032('0xe')},'attributes':['id','name',_0xf032('0xf'),_0xf032('0x10')]},'log':_0xf032('0xc')});};};exports[_0xf032('0x11')]=function(_0x5dac07,_0x51237a,_0x5f3c9d){return client[_0xf032('0x12')](_0xf032('0x13'),{'body':{'type':_0x51237a,'uniqueid':_0x5f3c9d},'options':{'where':{'id':_0x5dac07['id']}},'log':'savePause'});};exports[_0xf032('0x14')]=function(_0x4b086d){return client[_0xf032('0x12')](_0xf032('0x15'),{'body':{},'options':{'where':{'id':_0x4b086d['id']}},'log':_0xf032('0x11')});};exports[_0xf032('0x16')]=function(_0x3d632e){return client[_0xf032('0x12')](_0xf032('0x17'),{'options':{'raw':![],'where':{'role':_0xf032('0x2'),'id':_0x3d632e},'attributes':['id','name',_0xf032('0x4'),_0xf032('0xf'),_0xf032('0x5'),_0xf032('0x6'),'lastLoginAt',_0xf032('0x18'),_0xf032('0x19'),_0xf032('0x8'),'interface']},'log':_0xf032('0x16')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 708a073..7bc5e19 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 _0xf254=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x42c1f7,_0x2348ff){var _0x5ca4f0=function(_0x3cbaff){while(--_0x3cbaff){_0x42c1f7['push'](_0x42c1f7['shift']());}};_0x5ca4f0(++_0x2348ff);}(_0xf254,0x188));var _0x4f25=function(_0x34c063,_0x11d3d7){_0x34c063=_0x34c063-0x0;var _0x2c63a3=_0xf254[_0x34c063];return _0x2c63a3;};'use strict';var client=require(_0x4f25('0x0'));exports[_0x4f25('0x1')]=function(_0x4e1076){return client[_0x4f25('0x2')](_0x4f25('0x3'),{'body':_0x4e1076,'log':_0x4f25('0x3')});};exports[_0x4f25('0x4')]=function(_0x37beb5,_0x4c77c0,_0x34a30f){return client['Request'](_0x4f25('0x5'),{'body':_0x37beb5,'options':{'where':{'uniqueid':_0x4c77c0,'interface':_0x34a30f,'agentcomplete':!![]}},'log':_0x4f25('0x5')});}; \ No newline at end of file +var _0x28bf=['create','Request','CreateVoiceAgentReport','UpdateVoiceAgentReport','../client'];(function(_0x387603,_0x5a2d1){var _0x55ea9e=function(_0x46c5be){while(--_0x46c5be){_0x387603['push'](_0x387603['shift']());}};_0x55ea9e(++_0x5a2d1);}(_0x28bf,0x117));var _0xf28b=function(_0x31def2,_0x314684){_0x31def2=_0x31def2-0x0;var _0x2be1d3=_0x28bf[_0x31def2];return _0x2be1d3;};'use strict';var client=require(_0xf28b('0x0'));exports[_0xf28b('0x1')]=function(_0x33a9bd){return client[_0xf28b('0x2')]('CreateVoiceAgentReport',{'body':_0x33a9bd,'log':_0xf28b('0x3')});};exports['update']=function(_0x57f1e3,_0x338ade,_0x37af1b){return client[_0xf28b('0x2')](_0xf28b('0x4'),{'body':_0x57f1e3,'options':{'where':{'uniqueid':_0x338ade,'interface':_0x37af1b,'agentcomplete':!![]}},'log':_0xf28b('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index ded4c3f..09749e9 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 _0x8d05=['duration','billableseconds','GetVoiceCallReports','moment','util','lodash','create','CreateVoiceCallReport','context','callerid','DOCUMENTATION','Request','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition'];(function(_0x13cb5e,_0x143268){var _0x4226ac=function(_0x2144e7){while(--_0x2144e7){_0x13cb5e['push'](_0x13cb5e['shift']());}};_0x4226ac(++_0x143268);}(_0x8d05,0x159));var _0x58d0=function(_0xaae8e8,_0x35aa5c){_0xaae8e8=_0xaae8e8-0x0;var _0xcff5cf=_0x8d05[_0xaae8e8];return _0xcff5cf;};'use strict';var moment=require(_0x58d0('0x0'));var util=require(_0x58d0('0x1'));var _=require(_0x58d0('0x2'));var client=require('../client');exports[_0x58d0('0x3')]=function(_0x43cc1d){return client['Request'](_0x58d0('0x4'),{'body':_['merge'](_0x43cc1d,{'source':_0x43cc1d['calleridnum'],'destinationcontext':_0x43cc1d[_0x58d0('0x5')],'callerid':_0x43cc1d[_0x58d0('0x6')],'amaflags':_0x58d0('0x7')}),'log':_0x58d0('0x4')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x58d0('0x8')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x58d0('0x9')],'createdAt':{'$between':[moment()[_0x58d0('0xa')](_0x58d0('0xb'))[_0x58d0('0xc')](_0x58d0('0xd')),moment()['endOf'](_0x58d0('0xb'))[_0x58d0('0xc')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x58d0('0xe'),_0x58d0('0xf'),_0x58d0('0x10'),_0x58d0('0x11')]},'log':_0x58d0('0x12')});};}; \ No newline at end of file +var _0x144e=['callerid','DOCUMENTATION','getVoiceCallReports','Request','GetVoiceCallReport','day','format','endOf','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','moment','util','lodash','../client','CreateVoiceCallReport','merge'];(function(_0x53a18d,_0x15f194){var _0x100677=function(_0x10e1d3){while(--_0x10e1d3){_0x53a18d['push'](_0x53a18d['shift']());}};_0x100677(++_0x15f194);}(_0x144e,0xc0));var _0xe144=function(_0x1bf04e,_0x5af869){_0x1bf04e=_0x1bf04e-0x0;var _0x801630=_0x144e[_0x1bf04e];return _0x801630;};'use strict';var moment=require(_0xe144('0x0'));var util=require(_0xe144('0x1'));var _=require(_0xe144('0x2'));var client=require(_0xe144('0x3'));exports['create']=function(_0x149344){return client['Request'](_0xe144('0x4'),{'body':_[_0xe144('0x5')](_0x149344,{'source':_0x149344['calleridnum'],'destinationcontext':_0x149344['context'],'callerid':_0x149344[_0xe144('0x6')],'amaflags':_0xe144('0x7')}),'log':_0xe144('0x4')});};exports[_0xe144('0x8')]=function(){return function(){return client[_0xe144('0x9')](_0xe144('0xa'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf'](_0xe144('0xb'))[_0xe144('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xe144('0xd')]('day')[_0xe144('0xc')](_0xe144('0xe'))]}},'attributes':[_0xe144('0xf'),_0xe144('0x10'),_0xe144('0x11'),'billableseconds']},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 846320c..0e1bcfe 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 _0x5c2b=['../client','create','Request','CreateVoiceDialReport'];(function(_0x1a574a,_0x5c1b4f){var _0x1d3ccb=function(_0x2d265a){while(--_0x2d265a){_0x1a574a['push'](_0x1a574a['shift']());}};_0x1d3ccb(++_0x5c1b4f);}(_0x5c2b,0x140));var _0xb5c2=function(_0x2c2e43,_0x4ac6a9){_0x2c2e43=_0x2c2e43-0x0;var _0x37d45c=_0x5c2b[_0x2c2e43];return _0x37d45c;};'use strict';var client=require(_0xb5c2('0x0'));exports[_0xb5c2('0x1')]=function(_0x38cdf7){return client[_0xb5c2('0x2')](_0xb5c2('0x3'),{'body':_0x38cdf7,'log':_0xb5c2('0x3')});}; \ No newline at end of file +var _0x1f32=['CreateVoiceDialReport','create'];(function(_0x1f1a97,_0xadfc15){var _0x29fc6a=function(_0x38c180){while(--_0x38c180){_0x1f1a97['push'](_0x1f1a97['shift']());}};_0x29fc6a(++_0xadfc15);}(_0x1f32,0x16b));var _0x21f3=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1f32[_0x502c7d];return _0x30b7ed;};'use strict';var client=require('../client');exports[_0x21f3('0x0')]=function(_0x570de4){return client['Request'](_0x21f3('0x1'),{'body':_0x570de4,'log':_0x21f3('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 2382a53..c365d0c 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 _0xbc6f=['recordingFormat','../client','getVoiceExtensions','Request','GetVoiceExtension','exten'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc6f,0x127));var _0xfbc6=function(_0x1a1d9b,_0x5ea65a){_0x1a1d9b=_0x1a1d9b-0x0;var _0x1d7a59=_0xbc6f[_0x1a1d9b];return _0x1d7a59;};'use strict';var client=require(_0xfbc6('0x0'));exports[_0xfbc6('0x1')]=function(){return function(){return client[_0xfbc6('0x2')](_0xfbc6('0x3'),{'options':{'raw':!![],'attributes':['id',_0xfbc6('0x4'),_0xfbc6('0x5')],'where':{'VoiceExtensionId':null}},'log':_0xfbc6('0x1')});};}; \ No newline at end of file +var _0x29c1=['GetVoiceExtension','recordingFormat','getVoiceExtensions','Request'];(function(_0x430a79,_0x17b2af){var _0xda6181=function(_0x488aca){while(--_0x488aca){_0x430a79['push'](_0x430a79['shift']());}};_0xda6181(++_0x17b2af);}(_0x29c1,0x72));var _0x129c=function(_0x2cdedc,_0xba6c55){_0x2cdedc=_0x2cdedc-0x0;var _0x5a7a06=_0x29c1[_0x2cdedc];return _0x5a7a06;};'use strict';var client=require('../client');exports[_0x129c('0x0')]=function(){return function(){return client[_0x129c('0x1')](_0x129c('0x2'),{'options':{'raw':!![],'attributes':['id','exten',_0x129c('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x129c('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 42c7c9f..252322e 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 _0x5170=['Trunk','active','Pause','TrunkBackup','callerid','Interval','Intervals','interval','getVoiceQueues','Request','name','acw','acwTimeout','autopause','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold'];(function(_0x55f549,_0x4f90ac){var _0x589a78=function(_0x4b2cc3){while(--_0x4b2cc3){_0x55f549['push'](_0x55f549['shift']());}};_0x589a78(++_0x4f90ac);}(_0x5170,0x1e0));var _0x0517=function(_0x5a2f58,_0x42fa6f){_0x5a2f58=_0x5a2f58-0x0;var _0xa8920d=_0x5170[_0x5a2f58];return _0xa8920d;};'use strict';var client=require('../client');exports[_0x0517('0x0')]=function(){return function(){return client[_0x0517('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x0517('0x2'),_0x0517('0x3'),_0x0517('0x4'),_0x0517('0x5'),'monitor_format',_0x0517('0x6'),_0x0517('0x7'),_0x0517('0x8'),_0x0517('0x9'),_0x0517('0xa'),'dialPowerLevel',_0x0517('0xb'),_0x0517('0xc'),'dialPredictiveInterval',_0x0517('0xd'),_0x0517('0xe'),_0x0517('0xf'),_0x0517('0x10'),_0x0517('0x11'),'dialQueueProject',_0x0517('0x12'),'dialCongestionRetryFrequency','dialBusyMaxRetry',_0x0517('0x13'),_0x0517('0x14'),_0x0517('0x15'),_0x0517('0x16'),_0x0517('0x17'),_0x0517('0x18'),_0x0517('0x19'),'dialCheckDuplicateType',_0x0517('0x1a'),_0x0517('0x1b'),_0x0517('0x1c'),_0x0517('0x1d'),_0x0517('0x1e'),_0x0517('0x1f'),_0x0517('0x20'),_0x0517('0x21'),'dialAMDSilenceThreshold',_0x0517('0x22'),'timeout','dialRecallMeTimeout',_0x0517('0x23'),_0x0517('0x24'),_0x0517('0x25'),_0x0517('0x26'),'dialQueueProject2',_0x0517('0x27'),_0x0517('0x28'),_0x0517('0x29'),_0x0517('0x2a'),_0x0517('0x2b'),'dialNoSuchNumberRetryFrequency','dialDropMaxRetry',_0x0517('0x2c'),'dialAbandonedMaxRetry',_0x0517('0x2d'),_0x0517('0x2e'),_0x0517('0x2f'),_0x0517('0x30'),'dialAgentRejectRetryFrequency',_0x0517('0x31'),_0x0517('0x32'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':_0x0517('0x33'),'as':_0x0517('0x33'),'attributes':['id',_0x0517('0x2'),'callerid',_0x0517('0x34')]},{'model':_0x0517('0x35'),'as':'mandatoryDispositionPause','attributes':['id','name']},{'model':_0x0517('0x33'),'as':_0x0517('0x36'),'attributes':['id','name',_0x0517('0x37'),_0x0517('0x34')]},{'model':_0x0517('0x38'),'as':_0x0517('0x38'),'attributes':['id',_0x0517('0x2')],'include':[{'model':_0x0517('0x38'),'as':_0x0517('0x39'),'attributes':['id',_0x0517('0x2'),_0x0517('0x3a')]}]}]},'log':_0x0517('0x0')});};}; \ No newline at end of file +var _0xbb73=['dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','name','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialLimitChannel','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix'];(function(_0x3a7ae6,_0x2d0d54){var _0x1263c1=function(_0x1d1a5b){while(--_0x1d1a5b){_0x3a7ae6['push'](_0x3a7ae6['shift']());}};_0x1263c1(++_0x2d0d54);}(_0xbb73,0x15e));var _0x3bb7=function(_0x45d148,_0x409b06){_0x45d148=_0x45d148-0x0;var _0x16cf8f=_0xbb73[_0x45d148];return _0x16cf8f;};'use strict';var client=require(_0x3bb7('0x0'));exports[_0x3bb7('0x1')]=function(){return function(){return client[_0x3bb7('0x2')](_0x3bb7('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x3bb7('0x4'),_0x3bb7('0x5'),_0x3bb7('0x6'),_0x3bb7('0x7'),_0x3bb7('0x8'),'dialActive','dialMethod',_0x3bb7('0x9'),'dialLimitQueue',_0x3bb7('0xa'),'dialPredictiveOptimization',_0x3bb7('0xb'),_0x3bb7('0xc'),_0x3bb7('0xd'),_0x3bb7('0xe'),_0x3bb7('0xf'),_0x3bb7('0x10'),_0x3bb7('0x11'),_0x3bb7('0x12'),_0x3bb7('0x13'),_0x3bb7('0x14'),'dialBusyMaxRetry',_0x3bb7('0x15'),_0x3bb7('0x16'),_0x3bb7('0x17'),_0x3bb7('0x18'),_0x3bb7('0x19'),_0x3bb7('0x1a'),_0x3bb7('0x1b'),_0x3bb7('0x1c'),_0x3bb7('0x1d'),'dialAMDInitialSilence',_0x3bb7('0x1e'),_0x3bb7('0x1f'),'dialAMDTotalAnalysisTime',_0x3bb7('0x20'),_0x3bb7('0x21'),'dialAMDMaximumNumberOfWords',_0x3bb7('0x22'),_0x3bb7('0x23'),_0x3bb7('0x24'),_0x3bb7('0x25'),_0x3bb7('0x26'),_0x3bb7('0x27'),'dialAgiAfterHangupAgent',_0x3bb7('0x28'),_0x3bb7('0x29'),_0x3bb7('0x7'),_0x3bb7('0x2a'),_0x3bb7('0x2b'),_0x3bb7('0x2c'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry',_0x3bb7('0x2d'),'dialAbandonedMaxRetry',_0x3bb7('0x2e'),_0x3bb7('0x2f'),_0x3bb7('0x30'),_0x3bb7('0x31'),_0x3bb7('0x32'),_0x3bb7('0x33'),_0x3bb7('0x34'),_0x3bb7('0x35')],'include':[{'model':_0x3bb7('0x36'),'as':_0x3bb7('0x36'),'attributes':['id',_0x3bb7('0x37'),_0x3bb7('0x38'),_0x3bb7('0x39')]},{'model':_0x3bb7('0x3a'),'as':_0x3bb7('0x3b'),'attributes':['id','name']},{'model':'Trunk','as':_0x3bb7('0x3c'),'attributes':['id',_0x3bb7('0x37'),'callerid',_0x3bb7('0x39')]},{'model':_0x3bb7('0x3d'),'as':_0x3bb7('0x3d'),'attributes':['id',_0x3bb7('0x37')],'include':[{'model':_0x3bb7('0x3d'),'as':'Intervals','attributes':['id','name',_0x3bb7('0x3e')]}]}]},'log':_0x3bb7('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index b68f32f..fee1f25 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 _0xf0b7=['queuecallerexitAt','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','moment','lodash','Request','CreateVoiceQueueReport','GetVoiceQueueReport','YYYY-MM-DD\x20HH:mm:ss','endOf','day','format','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf0b7,0x158));var _0x7f0b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf0b7[_0xa464c9];return _0x3d73c4;};'use strict';var moment=require(_0x7f0b('0x0'));var _=require(_0x7f0b('0x1'));var client=require('../client');exports['create']=function(_0x48b994){return client[_0x7f0b('0x2')](_0x7f0b('0x3'),{'body':_0x48b994,'log':_0x7f0b('0x3')});};exports['getVoiceQueueReports']=function(){return function(){return client[_0x7f0b('0x2')](_0x7f0b('0x4'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf']('day')['format'](_0x7f0b('0x5')),moment()[_0x7f0b('0x6')](_0x7f0b('0x7'))[_0x7f0b('0x8')](_0x7f0b('0x5'))]}},'attributes':[_0x7f0b('0x9'),_0x7f0b('0xa'),_0x7f0b('0xb'),_0x7f0b('0xc'),_0x7f0b('0xd'),_0x7f0b('0xe'),_0x7f0b('0xf'),_0x7f0b('0x10'),_0x7f0b('0x11'),_0x7f0b('0x12')]},'log':_0x7f0b('0x13')});};}; \ No newline at end of file +var _0x77a4=['GetVoiceQueueReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queue','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandonAt','moment','create','Request','CreateVoiceQueueReport','getVoiceQueueReports'];(function(_0x16cfe3,_0x57b49c){var _0x42ae3f=function(_0xb3eb76){while(--_0xb3eb76){_0x16cfe3['push'](_0x16cfe3['shift']());}};_0x42ae3f(++_0x57b49c);}(_0x77a4,0x151));var _0x477a=function(_0x47adb8,_0x591ccc){_0x47adb8=_0x47adb8-0x0;var _0x4689a8=_0x77a4[_0x47adb8];return _0x4689a8;};'use strict';var moment=require(_0x477a('0x0'));var _=require('lodash');var client=require('../client');exports[_0x477a('0x1')]=function(_0x1a5455){return client[_0x477a('0x2')](_0x477a('0x3'),{'body':_0x1a5455,'log':_0x477a('0x3')});};exports[_0x477a('0x4')]=function(){return function(){return client['Request'](_0x477a('0x5'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x477a('0x6')](_0x477a('0x7'))[_0x477a('0x8')](_0x477a('0x9')),moment()[_0x477a('0xa')](_0x477a('0x7'))[_0x477a('0x8')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['uniqueid',_0x477a('0xb'),'queuecallerjoinAt',_0x477a('0xc'),_0x477a('0xd'),_0x477a('0xe'),_0x477a('0xf'),_0x477a('0x10'),'queuecallerabandon',_0x477a('0x11')]},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 43aa8d6..d032b58 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 _0x2f62=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x5dbb3e,_0x4b494d){var _0x138d23=function(_0x414fb4){while(--_0x414fb4){_0x5dbb3e['push'](_0x5dbb3e['shift']());}};_0x138d23(++_0x4b494d);}(_0x2f62,0x182));var _0x22f6=function(_0xba2382,_0x19ef46){_0xba2382=_0xba2382-0x0;var _0xa4e9d4=_0x2f62[_0xba2382];return _0xa4e9d4;};'use strict';var client=require(_0x22f6('0x0'));exports[_0x22f6('0x1')]=function(_0x327171){return function(){return client[_0x22f6('0x2')](_0x22f6('0x3'),{'options':{'where':{'VoiceQueueId':_0x327171,'paused':!![]},'raw':!![]},'log':_0x22f6('0x1')});};}; \ No newline at end of file +var _0x2ed6=['getVoiceQueueRtPauses','../client','GetVoiceQueueRtPauses'];(function(_0x15d43,_0x5a7f53){var _0x490791=function(_0x14adfc){while(--_0x14adfc){_0x15d43['push'](_0x15d43['shift']());}};_0x490791(++_0x5a7f53);}(_0x2ed6,0x13c));var _0x62ed=function(_0x5aca0c,_0x652329){_0x5aca0c=_0x5aca0c-0x0;var _0x50b0f2=_0x2ed6[_0x5aca0c];return _0x50b0f2;};'use strict';var client=require(_0x62ed('0x0'));exports['getVoiceQueueRtPauses']=function(_0x35912e){return function(){return client['Request'](_0x62ed('0x1'),{'options':{'where':{'VoiceQueueId':_0x35912e,'paused':!![]},'raw':!![]},'log':_0x62ed('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index ba9be66..c48a02c 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 _0x2a9e=['create','Request','merge','monitorFilename','CreateVoiceRecording','lodash','../client'];(function(_0xa1fc48,_0x2bb399){var _0x4bb2e5=function(_0x5e4a23){while(--_0x5e4a23){_0xa1fc48['push'](_0xa1fc48['shift']());}};_0x4bb2e5(++_0x2bb399);}(_0x2a9e,0x132));var _0xe2a9=function(_0x3569de,_0x3c3c3a){_0x3569de=_0x3569de-0x0;var _0xcac2a3=_0x2a9e[_0x3569de];return _0xcac2a3;};'use strict';var _=require(_0xe2a9('0x0'));var client=require(_0xe2a9('0x1'));exports[_0xe2a9('0x2')]=function(_0x484a17){return client[_0xe2a9('0x3')]('CreateVoiceRecording',{'body':_[_0xe2a9('0x4')](_0x484a17,{'value':_0x484a17[_0xe2a9('0x5')]}),'log':_0xe2a9('0x6')});}; \ No newline at end of file +var _0xd9c5=['Request','CreateVoiceRecording','../client','create'];(function(_0x3808e6,_0x5806c9){var _0x413cc0=function(_0x4cc4d3){while(--_0x4cc4d3){_0x3808e6['push'](_0x3808e6['shift']());}};_0x413cc0(++_0x5806c9);}(_0xd9c5,0x1aa));var _0x5d9c=function(_0x5982e5,_0x2718cd){_0x5982e5=_0x5982e5-0x0;var _0x2d6e7b=_0xd9c5[_0x5982e5];return _0x2d6e7b;};'use strict';var _=require('lodash');var client=require(_0x5d9c('0x0'));exports[_0x5d9c('0x1')]=function(_0xab188f){return client[_0x5d9c('0x2')](_0x5d9c('0x3'),{'body':_['merge'](_0xab188f,{'value':_0xab188f['monitorFilename']}),'log':_0x5d9c('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index d2c4570..1433730 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 _0xde22=['origtransfererexten','../client','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','context','attendedTransfer','Request','origtransfererchannel','origtransferercalleridnum','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid'];(function(_0x221ebf,_0x5aacde){var _0x218db2=function(_0x53f99d){while(--_0x53f99d){_0x221ebf['push'](_0x221ebf['shift']());}};_0x218db2(++_0x5aacde);}(_0xde22,0x111));var _0x2de2=function(_0x2863e9,_0x3c96a4){_0x2863e9=_0x2863e9-0x0;var _0x2d2754=_0xde22[_0x2863e9];return _0x2d2754;};'use strict';var client=require(_0x2de2('0x0'));exports['blindTransfer']=function(_0x9799b7){return client['Request'](_0x2de2('0x1'),{'body':{'result':_0x9799b7['result'],'transfererchannel':_0x9799b7[_0x2de2('0x2')],'transferercalleridnum':_0x9799b7[_0x2de2('0x3')],'transferercalleridname':_0x9799b7[_0x2de2('0x4')],'transfererconnectedlinenum':_0x9799b7[_0x2de2('0x5')],'transfererconnectedlinename':_0x9799b7['transfererconnectedlinename'],'transfereraccountcode':_0x9799b7[_0x2de2('0x6')],'transferercontext':_0x9799b7[_0x2de2('0x7')],'transfererexten':_0x9799b7[_0x2de2('0x8')],'transfererlinkedid':_0x9799b7[_0x2de2('0x9')],'transfereechannel':_0x9799b7[_0x2de2('0xa')],'transfereecalleridnum':_0x9799b7['transfereecalleridnum'],'transfereecalleridname':_0x9799b7[_0x2de2('0xb')],'transfereeconnectedlinenum':_0x9799b7[_0x2de2('0xc')],'transfereeconnectedlinename':_0x9799b7[_0x2de2('0xd')],'transfereeaccountcode':_0x9799b7[_0x2de2('0xe')],'transfereecontext':_0x9799b7[_0x2de2('0xf')],'transfereeexten':_0x9799b7['transfereeexten'],'transfereelinkedid':_0x9799b7[_0x2de2('0x10')],'isexternal':_0x9799b7[_0x2de2('0x11')],'context':_0x9799b7[_0x2de2('0x12')],'extension':_0x9799b7['extension'],'type':'blind'},'log':_0x2de2('0x1')});};exports[_0x2de2('0x13')]=function(_0x1e1d2c){return client[_0x2de2('0x14')](_0x2de2('0x1'),{'body':{'result':_0x1e1d2c['result'],'transfererchannel':_0x1e1d2c[_0x2de2('0x15')],'transferercalleridnum':_0x1e1d2c[_0x2de2('0x16')],'transferercalleridname':_0x1e1d2c['origtransferercalleridname'],'transfererconnectedlinenum':_0x1e1d2c['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x1e1d2c['secondtransfererconnectedlinename'],'transfereraccountcode':_0x1e1d2c['origtransfereraccountcode'],'transferercontext':_0x1e1d2c[_0x2de2('0x17')],'transfererexten':_0x1e1d2c[_0x2de2('0x18')],'transfererlinkedid':_0x1e1d2c['origtransfererlinkedid'],'transfereechannel':_0x1e1d2c[_0x2de2('0x19')],'transfereecalleridnum':_0x1e1d2c[_0x2de2('0x1a')],'transfereecalleridname':_0x1e1d2c[_0x2de2('0x1b')],'transfereeconnectedlinenum':_0x1e1d2c[_0x2de2('0x1c')],'transfereeconnectedlinename':_0x1e1d2c[_0x2de2('0x1d')],'transfereeaccountcode':_0x1e1d2c[_0x2de2('0x1e')],'transfereecontext':_0x1e1d2c['transfertargetcontext'],'transfereeexten':_0x1e1d2c[_0x2de2('0x1f')],'transfereelinkedid':_0x1e1d2c[_0x2de2('0x20')],'isexternal':_0x1e1d2c[_0x2de2('0x11')],'context':_0x1e1d2c['origtransferercontext'],'extension':_0x1e1d2c[_0x2de2('0x21')],'type':'attended'},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x29aa=['blindTransfer','Request','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','extension','blind','CreateVoiceTransferReport','result','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','origtransfererexten','attended'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x29aa,0x9c));var _0xa29a=function(_0x2d77d6,_0x3d9270){_0x2d77d6=_0x2d77d6-0x0;var _0x408fc1=_0x29aa[_0x2d77d6];return _0x408fc1;};'use strict';var client=require('../client');exports[_0xa29a('0x0')]=function(_0x3b5bf9){return client[_0xa29a('0x1')]('CreateVoiceTransferReport',{'body':{'result':_0x3b5bf9['result'],'transfererchannel':_0x3b5bf9[_0xa29a('0x2')],'transferercalleridnum':_0x3b5bf9['transferercalleridnum'],'transferercalleridname':_0x3b5bf9[_0xa29a('0x3')],'transfererconnectedlinenum':_0x3b5bf9[_0xa29a('0x4')],'transfererconnectedlinename':_0x3b5bf9[_0xa29a('0x5')],'transfereraccountcode':_0x3b5bf9[_0xa29a('0x6')],'transferercontext':_0x3b5bf9['transferercontext'],'transfererexten':_0x3b5bf9['transfererexten'],'transfererlinkedid':_0x3b5bf9['transfererlinkedid'],'transfereechannel':_0x3b5bf9[_0xa29a('0x7')],'transfereecalleridnum':_0x3b5bf9[_0xa29a('0x8')],'transfereecalleridname':_0x3b5bf9[_0xa29a('0x9')],'transfereeconnectedlinenum':_0x3b5bf9[_0xa29a('0xa')],'transfereeconnectedlinename':_0x3b5bf9[_0xa29a('0xb')],'transfereeaccountcode':_0x3b5bf9[_0xa29a('0xc')],'transfereecontext':_0x3b5bf9[_0xa29a('0xd')],'transfereeexten':_0x3b5bf9[_0xa29a('0xe')],'transfereelinkedid':_0x3b5bf9['transfereelinkedid'],'isexternal':_0x3b5bf9[_0xa29a('0xf')],'context':_0x3b5bf9['context'],'extension':_0x3b5bf9[_0xa29a('0x10')],'type':_0xa29a('0x11')},'log':_0xa29a('0x12')});};exports['attendedTransfer']=function(_0x52cf4d){return client[_0xa29a('0x1')](_0xa29a('0x12'),{'body':{'result':_0x52cf4d[_0xa29a('0x13')],'transfererchannel':_0x52cf4d['origtransfererchannel'],'transferercalleridnum':_0x52cf4d[_0xa29a('0x14')],'transferercalleridname':_0x52cf4d[_0xa29a('0x15')],'transfererconnectedlinenum':_0x52cf4d[_0xa29a('0x16')],'transfererconnectedlinename':_0x52cf4d[_0xa29a('0x17')],'transfereraccountcode':_0x52cf4d[_0xa29a('0x18')],'transferercontext':_0x52cf4d[_0xa29a('0x19')],'transfererexten':_0x52cf4d[_0xa29a('0x1a')],'transfererlinkedid':_0x52cf4d[_0xa29a('0x1b')],'transfereechannel':_0x52cf4d[_0xa29a('0x1c')],'transfereecalleridnum':_0x52cf4d[_0xa29a('0x1d')],'transfereecalleridname':_0x52cf4d[_0xa29a('0x1e')],'transfereeconnectedlinenum':_0x52cf4d[_0xa29a('0x1f')],'transfereeconnectedlinename':_0x52cf4d[_0xa29a('0x20')],'transfereeaccountcode':_0x52cf4d[_0xa29a('0x21')],'transfereecontext':_0x52cf4d[_0xa29a('0x22')],'transfereeexten':_0x52cf4d[_0xa29a('0x23')],'transfereelinkedid':_0x52cf4d['transfertargetlinkedid'],'isexternal':_0x52cf4d[_0xa29a('0xf')],'context':_0x52cf4d[_0xa29a('0x24')],'extension':_0x52cf4d[_0xa29a('0x25')],'type':_0xa29a('0x26')},'log':_0xa29a('0x12')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 8ed8cdc..8fcf2eb 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 _0x5259=['MixMonitor','ai(mixmonitorid)','monitors','toLowerCase','isNil','/var/spool/asterisk/monitor/','rec','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','find','resolve','StopMixMonitor','destinationchannel','stop','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','trunks','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','send','server','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','bluebird','../../../config/environment','../properties','../ami','listen','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','module','action','Action','then','message','catch','username','command','Command','voiceQueues','hasOwnProperty','strategy','answered','available','pTalking','sumHoldTime','abandoned','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','values','channels','voicechannel','map','channel','format','%s.%s','filename','uniqueid','wav'];(function(_0x16b75f,_0x386ca4){var _0x31764e=function(_0x3eeed7){while(--_0x3eeed7){_0x16b75f['push'](_0x16b75f['shift']());}};_0x31764e(++_0x386ca4);}(_0x5259,0x1c5));var _0x9525=function(_0x164ad8,_0x424b53){_0x164ad8=_0x164ad8-0x0;var _0x2ffa73=_0x5259[_0x164ad8];return _0x2ffa73;};'use strict';var _=require(_0x9525('0x0'));var util=require('util');var jayson=require(_0x9525('0x1'));var schema=require(_0x9525('0x2'));var BPromise=require(_0x9525('0x3'));var moment=require('moment');var config=require(_0x9525('0x4'));var properties=require(_0x9525('0x5'));var ami=require(_0x9525('0x6'));exports[_0x9525('0x7')]=function(_0x1caee2,_0x417faa,_0x34dfb9){return new BPromise(function(_0x36e7a0,_0x3278c7){var _0x22cb48={'QueuePause':function(_0x4f42f7){return new Promise(function(_0x1687c3,_0x3015d1){var _0x3c39c2=util['format'](_0x9525('0x8'),_0x9525('0x9'),_0x4f42f7[_0x9525('0xa')]);if(_0x1caee2[_0x9525('0xb')]&&_0x1caee2['timers'][_0x3c39c2]&&_0x1caee2['timers'][_0x3c39c2][_0x9525('0xc')]){_0x1caee2[_0x9525('0xb')][_0x3c39c2][_0x9525('0xd')]();}if(_0x1caee2['agents'][_0x3c39c2]){_0x1caee2[_0x9525('0xe')][_0x3c39c2][_0x9525('0xf')]({'statePause':_0x4f42f7['pause']?!![]:![]});}_0x1687c3({'code':0xc8,'message':_0x9525('0x10')});});},'Reload':function(_0x358ff9){var _0x13f507=this;return new Promise(function(_0x3eb46a,_0x113d64){if(ami[_0x9525('0x11')]()==![]){return _0x113d64(_0x13f507[_0x9525('0x12')](0x1f4,[config[_0x9525('0x13')]['ip'],config[_0x9525('0x13')]['username'],_0x9525('0x14')][_0x9525('0x15')]('\x20')));}_0x358ff9=_[_0x9525('0x16')](_0x358ff9,_[_0x9525('0x17')](properties[_0x9525('0x18')]));_0x358ff9[_0x9525('0x19')]='Reload';return ami[_0x9525('0x1a')](_0x358ff9)[_0x9525('0x1b')](function(_0x1d6e96){_0x3eb46a({'code':0xc8,'message':_0x1d6e96[_0x9525('0x1c')]});})[_0x9525('0x1d')](function(_0x1070ac){_0x113d64(_0x13f507[_0x9525('0x12')](0x1f5,_0x1070ac[_0x9525('0x1c')]));});});},'Command':function(_0x15656d){var _0x155acc=this;return new Promise(function(_0x164a4b,_0x34713c){if(ami[_0x9525('0x11')]()==![]){return _0x34713c(_0x155acc[_0x9525('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x9525('0x13')][_0x9525('0x1e')],'ami\x20disconnected'][_0x9525('0x15')]('\x20')));}_0x15656d=_[_0x9525('0x16')](_0x15656d,_0x9525('0x1f'));_0x15656d[_0x9525('0x19')]=_0x9525('0x20');return ami[_0x9525('0x1a')](_0x15656d)[_0x9525('0x1b')](function(_0x2684ae){_0x164a4b({'code':0xc8,'message':_0x2684ae['content']});})['catch'](function(_0x42dd62){_0x34713c(_0x155acc[_0x9525('0x12')](0x1f5,_0x42dd62[_0x9525('0x1c')]));});});},'VoiceQueues':function(_0x3a696a){return new Promise(function(_0x54ec3d,_0x3aea57){var _0x203941=[];for(var _0x16c65d in _0x1caee2[_0x9525('0x21')]){if(_0x1caee2[_0x9525('0x21')][_0x9525('0x22')](_0x16c65d)){var _0x3844e4=_0x1caee2[_0x9525('0x21')][_0x16c65d];var _0x268983={'id':_0x3844e4['id'],'name':_0x3844e4[_0x9525('0xa')],'strategy':_0x3844e4[_0x9525('0x23')],'answered':_0x3844e4[_0x9525('0x24')],'available':_0x3844e4[_0x9525('0x25')],'loggedIn':_0x3844e4['loggedIn'],'pTalking':_0x3844e4[_0x9525('0x26')],'sumBillable':_0x3844e4['sumBillable'],'sumDuration':_0x3844e4['sumDuration'],'sumHoldTime':_0x3844e4[_0x9525('0x27')]||0x0,'talking':_0x3844e4['talking'],'total':_0x3844e4['total'],'type':_0x3844e4['type'],'unmanaged':_0x3844e4['unmanaged'],'abandoned':_0x3844e4[_0x9525('0x28')],'waiting':_0x3844e4['waiting'],'loggedInDb':_0x3844e4[_0x9525('0x29')]};if(_0x3844e4[_0x9525('0x2a')]===_0x9525('0x2b')){_0x268983[_0x9525('0x2c')]=_0x3844e4[_0x9525('0x2c')];_0x268983['dialMethod']=_0x3844e4[_0x9525('0x2d')];_0x268983[_0x9525('0x2e')]=_0x3844e4[_0x9525('0x2e')];_0x268983[_0x9525('0x2f')]=_0x3844e4[_0x9525('0x2f')];_0x268983[_0x9525('0x30')]=_0x3844e4[_0x9525('0x30')];_0x268983['dialPrefix']=_0x3844e4[_0x9525('0x31')];_0x268983[_0x9525('0x32')]=_0x3844e4[_0x9525('0x32')];_0x268983[_0x9525('0x33')]=_0x3844e4[_0x9525('0x33')];_0x268983[_0x9525('0x34')]=_0x3844e4[_0x9525('0x34')];_0x268983[_0x9525('0x35')]=_0x3844e4[_0x9525('0x35')];_0x268983[_0x9525('0x36')]=_0x3844e4[_0x9525('0x36')];_0x268983['outboundDropCallsDayACS']=_0x3844e4[_0x9525('0x37')];_0x268983['outboundDropCallsDayCallersExit']=_0x3844e4[_0x9525('0x38')];_0x268983[_0x9525('0x39')]=_0x3844e4[_0x9525('0x39')];_0x268983[_0x9525('0x3a')]=_0x3844e4[_0x9525('0x3a')];_0x268983[_0x9525('0x3b')]=_0x3844e4[_0x9525('0x3b')];_0x268983[_0x9525('0x3c')]=_0x3844e4[_0x9525('0x3c')];_0x268983[_0x9525('0x3d')]=_0x3844e4[_0x9525('0x3d')];_0x268983[_0x9525('0x3e')]=_0x3844e4[_0x9525('0x3e')];_0x268983[_0x9525('0x3f')]=_0x3844e4[_0x9525('0x3f')];_0x268983[_0x9525('0x40')]=_0x3844e4[_0x9525('0x40')];_0x268983[_0x9525('0x41')]=_0x3844e4[_0x9525('0x41')];_0x268983['predictiveIntervalAvgTalktime']=_0x3844e4[_0x9525('0x42')];_0x268983['predictiveIntervalDroppedCallsCallersExit']=_0x3844e4[_0x9525('0x43')];_0x268983[_0x9525('0x44')]=_0x3844e4[_0x9525('0x44')];_0x268983['predictiveIntervalErlangCalls']=_0x3844e4[_0x9525('0x45')];_0x268983[_0x9525('0x46')]=_0x3844e4[_0x9525('0x46')];_0x268983['predictiveIntervalHitRate']=_0x3844e4[_0x9525('0x47')];_0x268983[_0x9525('0x48')]=_0x3844e4[_0x9525('0x48')];_0x268983['predictiveIntervalPauses']=_0x3844e4[_0x9525('0x49')];_0x268983['predictiveIntervalAvailable']=_0x3844e4[_0x9525('0x4a')];_0x268983['predictiveIntervalTotalCalls']=_0x3844e4[_0x9525('0x4b')];_0x268983[_0x9525('0x1c')]=_0x3844e4[_0x9525('0x1c')];_0x268983[_0x9525('0x4c')]=_0x3844e4[_0x9525('0x4c')];_0x268983[_0x9525('0x4d')]=_0x3844e4[_0x9525('0x4d')];_0x268983[_0x9525('0x4e')]=_0x3844e4[_0x9525('0x4e')];_0x268983[_0x9525('0x4f')]=_0x3844e4['erlangAbandonmentRate'];_0x268983[_0x9525('0x50')]=_0x3844e4[_0x9525('0x50')];_0x268983[_0x9525('0x51')]=_0x3844e4[_0x9525('0x51')];_0x268983[_0x9525('0x52')]=_0x3844e4[_0x9525('0x52')];}if(_0x3844e4['Trunk']){_0x268983['Trunk']={'id':_0x3844e4[_0x9525('0x53')]['id'],'name':_0x3844e4[_0x9525('0x53')][_0x9525('0xa')],'active':_0x3844e4['Trunk'][_0x9525('0x54')],'callerid':_0x3844e4[_0x9525('0x53')][_0x9525('0x55')]};}if(_0x3844e4[_0x9525('0x56')]){_0x268983[_0x9525('0x56')]={'id':_0x3844e4[_0x9525('0x56')]['id'],'name':_0x3844e4[_0x9525('0x56')]['name']};}_0x203941[_0x9525('0x57')](_0x268983);}}_0x54ec3d({'count':_0x203941[_0x9525('0x58')],'rows':_0x203941});});},'VoiceChannels':function(_0x1fe3df){return new Promise(function(_0x3e2765,_0x13ecbf){var _0x23a31c=_[_0x9525('0x59')](_0x1caee2[_0x9525('0x5a')]);_0x3e2765({'count':_0x23a31c['length'],'rows':_0x23a31c});});},'VoiceChannelMixMonitor':function(_0x152222){var _0x5acccd=this;return new Promise(function(_0x46bfd7,_0x2a2c55){if(ami['isConnected']()==![]){return _0x2a2c55(_0x5acccd[_0x9525('0x12')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x9525('0x1e')],_0x9525('0x14')][_0x9525('0x15')]('\x20')));}var _0x19e770=schema(properties[_0x9525('0x5b')])[_0x9525('0x2')](_0x152222);if(_0x19e770['length']>0x0){return _0x2a2c55(_0x5acccd[_0x9525('0x12')](0x1f4,_[_0x9525('0x5c')](_0x19e770,_0x9525('0x1c'))[_0x9525('0x15')](',\x20')));}var _0x2fb3db=_['find'](_0x1caee2[_0x9525('0x5a')],{'uniqueid':_0x152222['uniqueid']});if(_0x2fb3db&&_0x2fb3db[_0x9525('0x5d')]){var _0x53fc6f=util[_0x9525('0x5e')](_0x9525('0x5f'),_0x152222[_0x9525('0x60')]||_0x152222[_0x9525('0x61')],_0x152222[_0x9525('0x5e')]||_0x9525('0x62'));return ami[_0x9525('0x1a')]({'action':_0x9525('0x63'),'channel':_0x2fb3db[_0x9525('0x5d')],'file':_0x53fc6f,'options':_0x9525('0x64')})['then'](function(_0x5cc9e2){var _0x21cc6a=_['find'](_0x2fb3db[_0x9525('0x65')],{'filename':'/var/spool/asterisk/monitor/'+_0x53fc6f[_0x9525('0x66')]()});if(_[_0x9525('0x67')](_0x21cc6a)){_0x2fb3db['monitors'][_0x9525('0x57')]({'filename':_0x9525('0x68')+_0x53fc6f[_0x9525('0x66')](),'createdAt':moment()[_0x9525('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x5cc9e2['mixmonitorid'],'status':_0x9525('0x69')});}else{_0x21cc6a[_0x9525('0x6a')]=_0x5cc9e2['mixmonitorid'];_0x21cc6a[_0x9525('0x6b')]=_0x9525('0x69');}_0x46bfd7({'code':0xc8,'message':[_0x152222['uniqueid'],_0x9525('0x6c'),_0x5cc9e2[_0x9525('0x6a')]][_0x9525('0x15')]('\x20'),'mixmonitorid':_0x5cc9e2['mixmonitorid']});})[_0x9525('0x1d')](function(_0x5edae9){_0x2a2c55(_0x5acccd[_0x9525('0x12')](0x1f5,[_0x152222['uniqueid'],_0x5edae9['message'][_0x9525('0x66')]()][_0x9525('0x15')]('\x20')));});}else{return _0x2a2c55(_0x5acccd[_0x9525('0x12')](0x1f5,_0x9525('0x6d')));}});},'VoiceChannelStopMixMonitor':function(_0x1d2af3){var _0x3db778=this;return new Promise(function(_0x75450,_0xf16332){if(ami['isConnected']()==![]){return _0xf16332(_0x3db778[_0x9525('0x12')](0x1f4,[config[_0x9525('0x13')]['ip'],config[_0x9525('0x13')]['username'],_0x9525('0x14')][_0x9525('0x15')]('\x20')));}var _0x4755e5=schema(properties[_0x9525('0x5b')])[_0x9525('0x2')](_0x1d2af3);if(_0x4755e5[_0x9525('0x58')]>0x0){return _0xf16332(_0x3db778[_0x9525('0x12')](0x1f4,_[_0x9525('0x5c')](_0x4755e5,_0x9525('0x1c'))[_0x9525('0x15')](',\x20')));}var _0x13c9f7=_[_0x9525('0x6e')](_0x1caee2[_0x9525('0x5a')],{'uniqueid':_0x1d2af3['uniqueid']});if(_0x13c9f7){return BPromise[_0x9525('0x6f')]()[_0x9525('0x1b')](function(){if(_0x13c9f7[_0x9525('0x5d')]){return ami[_0x9525('0x1a')]({'action':_0x9525('0x70'),'channel':_0x13c9f7[_0x9525('0x5d')],'mixmonitorid':_0x1d2af3[_0x9525('0x6a')]})[_0x9525('0x1d')](function(_0x14081){});}})[_0x9525('0x1b')](function(){if(_0x13c9f7[_0x9525('0x71')]){return ami['Action']({'action':_0x9525('0x70'),'channel':_0x13c9f7[_0x9525('0x71')],'mixmonitorid':_0x1d2af3[_0x9525('0x6a')]})[_0x9525('0x1d')](function(_0x2d669b){});}})[_0x9525('0x1b')](function(_0x9be6a){var _0x5da7d5=_[_0x9525('0x6e')](_0x13c9f7['monitors'],{'mixmonitorid':_0x1d2af3[_0x9525('0x6a')]});if(_0x5da7d5){_0x5da7d5[_0x9525('0x6b')]='stop';}})['then'](function(){var _0x51c365=util[_0x9525('0x5e')](_0x9525('0x5f'),_0x1d2af3[_0x9525('0x60')]||_0x1d2af3[_0x9525('0x61')],_0x1d2af3['format']||'wav');var _0x231b8a=_[_0x9525('0x6e')](_0x13c9f7[_0x9525('0x65')],{'filename':_0x9525('0x68')+_0x51c365['toLowerCase']()});if(_0x231b8a){_0x231b8a[_0x9525('0x6b')]=_0x9525('0x72');}})[_0x9525('0x1b')](function(){_0x75450({'code':0xc8,'message':[_0x1d2af3['uniqueid'],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x9525('0x1d')](function(_0x4bd3d8){_0xf16332(_0x3db778['error'](0x1f5,[_0x1d2af3[_0x9525('0x61')],_0x4bd3d8[_0x9525('0x1c')][_0x9525('0x66')]()]['join']('\x20')));});}else{return _0xf16332(_0x3db778[_0x9525('0x12')](0x1f5,_0x9525('0x6d')));}});},'VoiceQueuesChannels':function(_0x343b6c){return new Promise(function(_0x329a96,_0x52c2b3){var _0x4c148b=_['values'](_0x1caee2[_0x9525('0x73')]);_0x329a96({'count':_0x4c148b[_0x9525('0x58')],'rows':_0x4c148b});});},'VoiceQueuesChannel':function(_0x191b47){var _0x4e8775=this;return new Promise(function(_0x67330,_0x3f9791){var _0x4c65bf=schema(properties[_0x9525('0x74')])['validate'](_0x191b47);if(_0x4c65bf['length']>0x0){return _0x3f9791(_0x4e8775['error'](0x1f4,_[_0x9525('0x5c')](_0x4c65bf,_0x9525('0x1c'))['join'](',\x20')));}var _0x10a2a3=_['find'](_0x1caee2['queueChannels'],{'uniqueid':_0x191b47[_0x9525('0x61')]});if(_0x10a2a3){_0x67330(_0x10a2a3);}else{return _0x3f9791(_0x4e8775[_0x9525('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x11ecda){var _0x2f3518=this;return new Promise(function(_0x4f9cd8,_0x5f42d5){if(ami[_0x9525('0x11')]()==![]){return _0x5f42d5(_0x2f3518[_0x9525('0x12')](0x1f4,[config[_0x9525('0x13')]['ip'],config[_0x9525('0x13')][_0x9525('0x1e')],_0x9525('0x14')][_0x9525('0x15')]('\x20')));}var _0x1ad7bb=schema(properties[_0x9525('0x75')])[_0x9525('0x2')](_0x11ecda);if(_0x1ad7bb[_0x9525('0x58')]>0x0){return _0x5f42d5(_0x2f3518[_0x9525('0x12')](0x1f4,_[_0x9525('0x5c')](_0x1ad7bb,_0x9525('0x1c'))[_0x9525('0x15')](',\x20')));}var _0x11141b=_[_0x9525('0x6e')](_0x1caee2[_0x9525('0x73')],{'uniqueid':_0x11ecda[_0x9525('0x61')]});if(_0x11141b&&_0x11141b[_0x9525('0x5d')]){return ami[_0x9525('0x1a')]({'action':_0x9525('0x76'),'channel':_0x11141b['channel']})[_0x9525('0x1b')](function(_0x1011aa){_0x4f9cd8({'code':0xc8,'message':[_0x11ecda[_0x9525('0x61')],_0x1011aa[_0x9525('0x1c')][_0x9525('0x66')]()][_0x9525('0x15')]('\x20')});})[_0x9525('0x1d')](function(_0x99852c){_0x5f42d5(_0x2f3518[_0x9525('0x12')](0x1f5,[_0x11ecda[_0x9525('0x61')],_0x99852c[_0x9525('0x1c')][_0x9525('0x66')]()]['join']('\x20')));});}else{return _0x5f42d5(_0x2f3518['error'](0x1f5,_0x9525('0x6d')));}});},'VoiceQueuesChannelRedirect':function(_0x26d0e5){var _0x1bc4f7=this;return new Promise(function(_0x1a096a,_0x22fe73){if(ami['isConnected']()==![]){return _0x22fe73(_0x1bc4f7[_0x9525('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x9525('0x13')][_0x9525('0x1e')],'ami\x20disconnected'][_0x9525('0x15')]('\x20')));}var _0x581521=schema(properties[_0x9525('0x77')])[_0x9525('0x2')](_0x26d0e5);if(_0x581521[_0x9525('0x58')]>0x0){return _0x22fe73(_0x1bc4f7[_0x9525('0x12')](0x1f4,_[_0x9525('0x5c')](_0x581521,_0x9525('0x1c'))[_0x9525('0x15')](',\x20')));}var _0x386219=_[_0x9525('0x6e')](_0x1caee2[_0x9525('0x73')],{'uniqueid':_0x26d0e5[_0x9525('0x61')]});if(_0x386219&&_0x386219[_0x9525('0x5d')]){return ami[_0x9525('0x1a')]({'action':_0x9525('0x78'),'channel':_0x386219[_0x9525('0x5d')],'exten':_0x26d0e5[_0x9525('0x79')],'context':_0x26d0e5[_0x9525('0x7a')]||_0x386219['context'],'priority':0x1})[_0x9525('0x1b')](function(_0x38e1fe){_0x1a096a({'code':0xc8,'message':[_0x26d0e5[_0x9525('0x61')],_0x38e1fe[_0x9525('0x1c')][_0x9525('0x66')]()][_0x9525('0x15')]('\x20')});})[_0x9525('0x1d')](function(_0x8d35cd){_0x22fe73(_0x1bc4f7[_0x9525('0x12')](0x1f5,[_0x26d0e5['uniqueid'],_0x8d35cd[_0x9525('0x1c')][_0x9525('0x66')]()][_0x9525('0x15')]('\x20')));});}else{return _0x22fe73(_0x1bc4f7[_0x9525('0x12')](0x1f5,_0x9525('0x6d')));}});},'Agents':function(_0x16da72){return new Promise(function(_0x3cbf4f,_0x29c7b0){var _0x4b9e9d=_[_0x9525('0x59')](_0x1caee2[_0x9525('0xe')]);_0x3cbf4f({'count':_0x4b9e9d['length'],'rows':_0x4b9e9d});});},'Telephones':function(_0x6e940){return new Promise(function(_0x560dd7,_0x14e300){var _0x4ed4e9=_[_0x9525('0x59')](_0x1caee2['telephones']);_0x560dd7({'count':_0x4ed4e9[_0x9525('0x58')],'rows':_0x4ed4e9});});},'Trunks':function(_0x49aa29){return new Promise(function(_0x5d2981,_0x5ea319){var _0x53ab26=_[_0x9525('0x59')](_0x1caee2[_0x9525('0x7b')]);_0x5d2981({'count':_0x53ab26[_0x9525('0x58')],'rows':_0x53ab26});});},'OutboundChannels':function(_0x306b1f){return new Promise(function(_0x18818f,_0x346487){var _0x576030=_['values'](_0x1caee2[_0x9525('0x7c')]);_0x18818f({'count':_0x576030[_0x9525('0x58')],'rows':_0x576030});});},'Outbound':function(_0x314122){return new Promise(function(_0x28cf61,_0x494cbe){_0x28cf61(_0x1caee2[_0x9525('0x2b')]);});},'Campaigns':function(_0x441765){return new Promise(function(_0x5a8ca9,_0x10882c){var _0x1f277a=_['values'](_0x1caee2[_0x9525('0x7d')]);_0x5a8ca9({'count':_0x1f277a[_0x9525('0x58')],'rows':_0x1f277a});});},'VoiceQueuesPreview':function(_0x5130ff){var _0x5bf1eb=this;return new Promise(function(_0x523082,_0x55ba65){_0x417faa[_0x9525('0x7e')](_0x5130ff['id'])[_0x9525('0x1b')](function(_0x29c6d0){_0x523082({'code':0xc8,'message':_0x29c6d0[_0x9525('0x1c')]});})[_0x9525('0x1d')](function(_0x3aafd6){_0x55ba65(_0x5bf1eb[_0x9525('0x12')](0x1f4,_0x3aafd6['message']));});});},'EventManager':function(_0x14704c){var _0xf90f50=this;return new Promise(function(_0x248ab6,_0x217d1d){if(!_0x14704c['event']){return _0x217d1d(_0xf90f50[_0x9525('0x12')](0x1f4,_0x9525('0x7f')));}ami[_0x9525('0x80')](_0x9525('0x81')+_0x14704c[_0x9525('0x82')],_0x14704c[_0x9525('0x1c')]);_0x248ab6({'code':0xc8,'message':_0x14704c});});},'FaxAccounts':function(_0x1f6ffb){return new Promise(function(_0x371c6e,_0x53965e){var _0x16b4e2=_[_0x9525('0x59')](_0x1caee2[_0x9525('0x83')]);_0x371c6e({'count':_0x16b4e2['length'],'rows':_0x16b4e2});});},'SendFax':function(_0x56628f){var _0x1deb18=this;return new Promise(function(_0x564029,_0x361b71){_0x34dfb9[_0x9525('0x84')](_0x56628f)['then'](function(_0x1342c6){_0x564029({'code':0xc8,'message':_0x1342c6[_0x9525('0x1c')]});})[_0x9525('0x1d')](function(_0x4a7aa8){_0x361b71(_0x1deb18[_0x9525('0x12')](0x1f4,_0x4a7aa8[_0x9525('0x1c')]));});});},'CheckAfterSend':function(_0x8da32a){var _0x11c2f2=this;return new Promise(function(_0x38ec0e,_0x4f2040){_0x34dfb9['checkAfterSend'](_0x8da32a)[_0x9525('0x1b')](function(_0x5e084b){_0x38ec0e({'code':0xc8,'message':_0x5e084b[_0x9525('0x1c')]});})['catch'](function(_0x10c9b7){_0x4f2040(_0x11c2f2[_0x9525('0x12')](0x1f4,_0x10c9b7[_0x9525('0x1c')]));});});}};var _0xfffbea=jayson[_0x9525('0x85')](_0x22cb48)[_0x9525('0x86')]();_0xfffbea['on'](_0x9525('0x12'),function(_0x20f686){return _0x3278c7(_0x20f686);});_0xfffbea[_0x9525('0x7')](0x232a,'127.0.0.1',function(){console[_0x9525('0x87')](_0x9525('0x88'),0x232a);return _0x36e7a0(_0x9525('0x89')+0x232a);});});}; \ No newline at end of file +var _0x02ee=['predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','values','channels','length','validate','map','find','uniqueid','channel','format','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','isConnected','voicechannel','resolve','StopMixMonitor','destinationchannel','stop','%s.%s','filename','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','Hangup','voicequeuechannelredirect','Redirect','exten','telephones','trunks','outboundChannels','campaigns','run','event','custom:','faxAccounts','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','bluebird','moment','../../../config/environment','../properties','../ami','listen','SIP','name','timers','agents','updateStatusRealtime','QueuePause','error','asterisk','username','join','pick','module','Reload','Action','then','message','catch','ami\x20disconnected','command','Command','content','voiceQueues','hasOwnProperty','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','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses'];(function(_0x36e7f3,_0x555805){var _0x4d3083=function(_0x2b30bc){while(--_0x2b30bc){_0x36e7f3['push'](_0x36e7f3['shift']());}};_0x4d3083(++_0x555805);}(_0x02ee,0x142));var _0xe02e=function(_0x17b151,_0x45a6b1){_0x17b151=_0x17b151-0x0;var _0x346a27=_0x02ee[_0x17b151];return _0x346a27;};'use strict';var _=require(_0xe02e('0x0'));var util=require('util');var jayson=require(_0xe02e('0x1'));var schema=require('validate');var BPromise=require(_0xe02e('0x2'));var moment=require(_0xe02e('0x3'));var config=require(_0xe02e('0x4'));var properties=require(_0xe02e('0x5'));var ami=require(_0xe02e('0x6'));exports[_0xe02e('0x7')]=function(_0x17352a,_0x589d75,_0x301c99){return new BPromise(function(_0x2a6fbf,_0xbee04e){var _0x4a62a1={'QueuePause':function(_0x25e0b4){return new Promise(function(_0x59d3e7,_0x21d644){var _0x5c1081=util['format']('%s/%s',_0xe02e('0x8'),_0x25e0b4[_0xe02e('0x9')]);if(_0x17352a[_0xe02e('0xa')]&&_0x17352a['timers'][_0x5c1081]&&_0x17352a[_0xe02e('0xa')][_0x5c1081]['timer']){_0x17352a[_0xe02e('0xa')][_0x5c1081]['updateAcw']();}if(_0x17352a[_0xe02e('0xb')][_0x5c1081]){_0x17352a['agents'][_0x5c1081][_0xe02e('0xc')]({'statePause':_0x25e0b4['pause']?!![]:![]});}_0x59d3e7({'code':0xc8,'message':_0xe02e('0xd')});});},'Reload':function(_0x72be39){var _0x2a411a=this;return new Promise(function(_0x16a4f9,_0x53d730){if(ami['isConnected']()==![]){return _0x53d730(_0x2a411a[_0xe02e('0xe')](0x1f4,[config[_0xe02e('0xf')]['ip'],config[_0xe02e('0xf')][_0xe02e('0x10')],'ami\x20disconnected'][_0xe02e('0x11')]('\x20')));}_0x72be39=_[_0xe02e('0x12')](_0x72be39,_['keys'](properties[_0xe02e('0x13')]));_0x72be39['action']=_0xe02e('0x14');return ami[_0xe02e('0x15')](_0x72be39)[_0xe02e('0x16')](function(_0x5991ad){_0x16a4f9({'code':0xc8,'message':_0x5991ad[_0xe02e('0x17')]});})[_0xe02e('0x18')](function(_0x4779b9){_0x53d730(_0x2a411a[_0xe02e('0xe')](0x1f5,_0x4779b9[_0xe02e('0x17')]));});});},'Command':function(_0x353e37){var _0x2c0997=this;return new Promise(function(_0x569a7d,_0x1a71a7){if(ami['isConnected']()==![]){return _0x1a71a7(_0x2c0997[_0xe02e('0xe')](0x1f4,[config[_0xe02e('0xf')]['ip'],config[_0xe02e('0xf')][_0xe02e('0x10')],_0xe02e('0x19')][_0xe02e('0x11')]('\x20')));}_0x353e37=_[_0xe02e('0x12')](_0x353e37,_0xe02e('0x1a'));_0x353e37['action']=_0xe02e('0x1b');return ami[_0xe02e('0x15')](_0x353e37)[_0xe02e('0x16')](function(_0x4a2f61){_0x569a7d({'code':0xc8,'message':_0x4a2f61[_0xe02e('0x1c')]});})[_0xe02e('0x18')](function(_0x4523bd){_0x1a71a7(_0x2c0997[_0xe02e('0xe')](0x1f5,_0x4523bd[_0xe02e('0x17')]));});});},'VoiceQueues':function(_0x5ac52e){return new Promise(function(_0x32fbc9,_0x16d825){var _0x14f012=[];for(var _0x13d285 in _0x17352a[_0xe02e('0x1d')]){if(_0x17352a[_0xe02e('0x1d')][_0xe02e('0x1e')](_0x13d285)){var _0x54a990=_0x17352a['voiceQueues'][_0x13d285];var _0x4a6697={'id':_0x54a990['id'],'name':_0x54a990[_0xe02e('0x9')],'strategy':_0x54a990['strategy'],'answered':_0x54a990[_0xe02e('0x1f')],'available':_0x54a990[_0xe02e('0x20')],'loggedIn':_0x54a990[_0xe02e('0x21')],'pTalking':_0x54a990['pTalking'],'sumBillable':_0x54a990[_0xe02e('0x22')],'sumDuration':_0x54a990['sumDuration'],'sumHoldTime':_0x54a990[_0xe02e('0x23')]||0x0,'talking':_0x54a990['talking'],'total':_0x54a990[_0xe02e('0x24')],'type':_0x54a990[_0xe02e('0x25')],'unmanaged':_0x54a990[_0xe02e('0x26')],'abandoned':_0x54a990[_0xe02e('0x27')],'waiting':_0x54a990[_0xe02e('0x28')],'loggedInDb':_0x54a990[_0xe02e('0x29')]};if(_0x54a990['type']===_0xe02e('0x2a')){_0x4a6697[_0xe02e('0x2b')]=_0x54a990[_0xe02e('0x2b')];_0x4a6697[_0xe02e('0x2c')]=_0x54a990[_0xe02e('0x2c')];_0x4a6697[_0xe02e('0x2d')]=_0x54a990[_0xe02e('0x2d')];_0x4a6697[_0xe02e('0x2e')]=_0x54a990[_0xe02e('0x2e')];_0x4a6697['dialOriginateTimeout']=_0x54a990[_0xe02e('0x2f')];_0x4a6697[_0xe02e('0x30')]=_0x54a990[_0xe02e('0x30')];_0x4a6697[_0xe02e('0x31')]=_0x54a990['outboundAnswerAgiCallsDay'];_0x4a6697[_0xe02e('0x32')]=_0x54a990['outboundAnswerCallsDay'];_0x4a6697[_0xe02e('0x33')]=_0x54a990['outboundBlacklistCallsDay'];_0x4a6697['outboundBusyCallsDay']=_0x54a990[_0xe02e('0x34')];_0x4a6697[_0xe02e('0x35')]=_0x54a990['outboundCongestionCallsDay'];_0x4a6697[_0xe02e('0x36')]=_0x54a990[_0xe02e('0x36')];_0x4a6697[_0xe02e('0x37')]=_0x54a990['outboundDropCallsDayCallersExit'];_0x4a6697[_0xe02e('0x38')]=_0x54a990['outboundDropCallsDayTimeout'];_0x4a6697[_0xe02e('0x39')]=_0x54a990['outboundNoAnswerCallsDay'];_0x4a6697[_0xe02e('0x3a')]=_0x54a990[_0xe02e('0x3a')];_0x4a6697[_0xe02e('0x3b')]=_0x54a990[_0xe02e('0x3b')];_0x4a6697[_0xe02e('0x3c')]=_0x54a990['outboundReCallsDay'];_0x4a6697['outboundRejectCallsDay']=_0x54a990[_0xe02e('0x3d')];_0x4a6697[_0xe02e('0x3e')]=_0x54a990['outboundUnknownCallsDay'];_0x4a6697['predictiveIntervalAnsweredCalls']=_0x54a990['predictiveIntervalAnsweredCalls'];_0x4a6697['predictiveIntervalAvgHoldtime']=_0x54a990['predictiveIntervalAvgHoldtime'];_0x4a6697[_0xe02e('0x3f')]=_0x54a990[_0xe02e('0x3f')];_0x4a6697[_0xe02e('0x40')]=_0x54a990['predictiveIntervalDroppedCallsCallersExit'];_0x4a6697['predictiveIntervalDroppedCallsTimeout']=_0x54a990[_0xe02e('0x41')];_0x4a6697[_0xe02e('0x42')]=_0x54a990[_0xe02e('0x42')];_0x4a6697[_0xe02e('0x43')]=_0x54a990[_0xe02e('0x43')];_0x4a6697[_0xe02e('0x44')]=_0x54a990[_0xe02e('0x44')];_0x4a6697[_0xe02e('0x45')]=_0x54a990[_0xe02e('0x45')];_0x4a6697[_0xe02e('0x46')]=_0x54a990[_0xe02e('0x46')];_0x4a6697[_0xe02e('0x47')]=_0x54a990[_0xe02e('0x47')];_0x4a6697[_0xe02e('0x48')]=_0x54a990[_0xe02e('0x48')];_0x4a6697['message']=_0x54a990[_0xe02e('0x17')];_0x4a6697[_0xe02e('0x49')]=_0x54a990['originated'];_0x4a6697[_0xe02e('0x4a')]=_0x54a990[_0xe02e('0x4a')];_0x4a6697[_0xe02e('0x4b')]=_0x54a990[_0xe02e('0x4b')];_0x4a6697['erlangAbandonmentRate']=_0x54a990[_0xe02e('0x4c')];_0x4a6697[_0xe02e('0x4d')]=_0x54a990[_0xe02e('0x4d')];_0x4a6697[_0xe02e('0x4e')]=_0x54a990['startPredictive'];_0x4a6697[_0xe02e('0x4f')]=_0x54a990[_0xe02e('0x4f')];}if(_0x54a990[_0xe02e('0x50')]){_0x4a6697[_0xe02e('0x50')]={'id':_0x54a990[_0xe02e('0x50')]['id'],'name':_0x54a990[_0xe02e('0x50')][_0xe02e('0x9')],'active':_0x54a990['Trunk'][_0xe02e('0x51')],'callerid':_0x54a990[_0xe02e('0x50')][_0xe02e('0x52')]};}if(_0x54a990['Interval']){_0x4a6697[_0xe02e('0x53')]={'id':_0x54a990[_0xe02e('0x53')]['id'],'name':_0x54a990[_0xe02e('0x53')][_0xe02e('0x9')]};}_0x14f012[_0xe02e('0x54')](_0x4a6697);}}_0x32fbc9({'count':_0x14f012['length'],'rows':_0x14f012});});},'VoiceChannels':function(_0x1c50b2){return new Promise(function(_0x325079,_0x5d95ab){var _0x13664f=_[_0xe02e('0x55')](_0x17352a[_0xe02e('0x56')]);_0x325079({'count':_0x13664f[_0xe02e('0x57')],'rows':_0x13664f});});},'VoiceChannelMixMonitor':function(_0xa93bee){var _0xaabad0=this;return new Promise(function(_0x31d46f,_0x5a6b08){if(ami['isConnected']()==![]){return _0x5a6b08(_0xaabad0[_0xe02e('0xe')](0x1f4,[config[_0xe02e('0xf')]['ip'],config[_0xe02e('0xf')][_0xe02e('0x10')],'ami\x20disconnected'][_0xe02e('0x11')]('\x20')));}var _0x56dea3=schema(properties['voicechannel'])[_0xe02e('0x58')](_0xa93bee);if(_0x56dea3[_0xe02e('0x57')]>0x0){return _0x5a6b08(_0xaabad0[_0xe02e('0xe')](0x1f4,_[_0xe02e('0x59')](_0x56dea3,_0xe02e('0x17'))['join'](',\x20')));}var _0x403590=_[_0xe02e('0x5a')](_0x17352a[_0xe02e('0x56')],{'uniqueid':_0xa93bee[_0xe02e('0x5b')]});if(_0x403590&&_0x403590[_0xe02e('0x5c')]){var _0xbb6579=util[_0xe02e('0x5d')]('%s.%s',_0xa93bee['filename']||_0xa93bee[_0xe02e('0x5b')],_0xa93bee[_0xe02e('0x5d')]||'wav');return ami['Action']({'action':'MixMonitor','channel':_0x403590[_0xe02e('0x5c')],'file':_0xbb6579,'options':_0xe02e('0x5e')})['then'](function(_0x1742ea){var _0x43d38e=_[_0xe02e('0x5a')](_0x403590[_0xe02e('0x5f')],{'filename':_0xe02e('0x60')+_0xbb6579[_0xe02e('0x61')]()});if(_['isNil'](_0x43d38e)){_0x403590[_0xe02e('0x5f')][_0xe02e('0x54')]({'filename':_0xe02e('0x60')+_0xbb6579['toLowerCase'](),'createdAt':moment()[_0xe02e('0x5d')](_0xe02e('0x62')),'mixmonitorid':_0x1742ea[_0xe02e('0x63')],'status':_0xe02e('0x64')});}else{_0x43d38e[_0xe02e('0x63')]=_0x1742ea[_0xe02e('0x63')];_0x43d38e[_0xe02e('0x65')]='rec';}_0x31d46f({'code':0xc8,'message':[_0xa93bee[_0xe02e('0x5b')],'MixMonitor\x20Success',_0x1742ea[_0xe02e('0x63')]][_0xe02e('0x11')]('\x20'),'mixmonitorid':_0x1742ea['mixmonitorid']});})[_0xe02e('0x18')](function(_0xb718e6){_0x5a6b08(_0xaabad0[_0xe02e('0xe')](0x1f5,[_0xa93bee[_0xe02e('0x5b')],_0xb718e6[_0xe02e('0x17')][_0xe02e('0x61')]()][_0xe02e('0x11')]('\x20')));});}else{return _0x5a6b08(_0xaabad0['error'](0x1f5,_0xe02e('0x66')));}});},'VoiceChannelStopMixMonitor':function(_0x39dbe6){var _0x1c0393=this;return new Promise(function(_0x390183,_0x5b544c){if(ami[_0xe02e('0x67')]()==![]){return _0x5b544c(_0x1c0393[_0xe02e('0xe')](0x1f4,[config[_0xe02e('0xf')]['ip'],config[_0xe02e('0xf')][_0xe02e('0x10')],_0xe02e('0x19')][_0xe02e('0x11')]('\x20')));}var _0x35bc1f=schema(properties[_0xe02e('0x68')])[_0xe02e('0x58')](_0x39dbe6);if(_0x35bc1f[_0xe02e('0x57')]>0x0){return _0x5b544c(_0x1c0393['error'](0x1f4,_[_0xe02e('0x59')](_0x35bc1f,_0xe02e('0x17'))['join'](',\x20')));}var _0x43eba7=_[_0xe02e('0x5a')](_0x17352a[_0xe02e('0x56')],{'uniqueid':_0x39dbe6[_0xe02e('0x5b')]});if(_0x43eba7){return BPromise[_0xe02e('0x69')]()[_0xe02e('0x16')](function(){if(_0x43eba7[_0xe02e('0x5c')]){return ami[_0xe02e('0x15')]({'action':_0xe02e('0x6a'),'channel':_0x43eba7['channel'],'mixmonitorid':_0x39dbe6[_0xe02e('0x63')]})['catch'](function(_0x3ee3bd){});}})[_0xe02e('0x16')](function(){if(_0x43eba7[_0xe02e('0x6b')]){return ami[_0xe02e('0x15')]({'action':'StopMixMonitor','channel':_0x43eba7[_0xe02e('0x6b')],'mixmonitorid':_0x39dbe6['mixmonitorid']})[_0xe02e('0x18')](function(_0x25d622){});}})[_0xe02e('0x16')](function(_0x2a1c33){var _0x3295ec=_[_0xe02e('0x5a')](_0x43eba7[_0xe02e('0x5f')],{'mixmonitorid':_0x39dbe6[_0xe02e('0x63')]});if(_0x3295ec){_0x3295ec[_0xe02e('0x65')]=_0xe02e('0x6c');}})[_0xe02e('0x16')](function(){var _0x1982ae=util[_0xe02e('0x5d')](_0xe02e('0x6d'),_0x39dbe6[_0xe02e('0x6e')]||_0x39dbe6[_0xe02e('0x5b')],_0x39dbe6[_0xe02e('0x5d')]||'wav');var _0x5b6a90=_[_0xe02e('0x5a')](_0x43eba7[_0xe02e('0x5f')],{'filename':_0xe02e('0x60')+_0x1982ae[_0xe02e('0x61')]()});if(_0x5b6a90){_0x5b6a90[_0xe02e('0x65')]=_0xe02e('0x6c');}})[_0xe02e('0x16')](function(){_0x390183({'code':0xc8,'message':[_0x39dbe6[_0xe02e('0x5b')],_0xe02e('0x6f')][_0xe02e('0x11')]('\x20')});})[_0xe02e('0x18')](function(_0x15c183){_0x5b544c(_0x1c0393['error'](0x1f5,[_0x39dbe6['uniqueid'],_0x15c183[_0xe02e('0x17')]['toLowerCase']()]['join']('\x20')));});}else{return _0x5b544c(_0x1c0393[_0xe02e('0xe')](0x1f5,_0xe02e('0x66')));}});},'VoiceQueuesChannels':function(_0x3b0398){return new Promise(function(_0xa2839e,_0x1ab576){var _0x35ed40=_[_0xe02e('0x55')](_0x17352a[_0xe02e('0x70')]);_0xa2839e({'count':_0x35ed40[_0xe02e('0x57')],'rows':_0x35ed40});});},'VoiceQueuesChannel':function(_0x77b249){var _0x5360d0=this;return new Promise(function(_0x39090d,_0x259515){var _0x1b92ca=schema(properties[_0xe02e('0x71')])['validate'](_0x77b249);if(_0x1b92ca[_0xe02e('0x57')]>0x0){return _0x259515(_0x5360d0[_0xe02e('0xe')](0x1f4,_[_0xe02e('0x59')](_0x1b92ca,'message')[_0xe02e('0x11')](',\x20')));}var _0x1acb1b=_['find'](_0x17352a['queueChannels'],{'uniqueid':_0x77b249[_0xe02e('0x5b')]});if(_0x1acb1b){_0x39090d(_0x1acb1b);}else{return _0x259515(_0x5360d0[_0xe02e('0xe')](0x1f5,_0xe02e('0x66')));}});},'VoiceQueuesChannelHangup':function(_0x25e90f){var _0x30708b=this;return new Promise(function(_0x5673e3,_0x502875){if(ami['isConnected']()==![]){return _0x502875(_0x30708b[_0xe02e('0xe')](0x1f4,[config[_0xe02e('0xf')]['ip'],config[_0xe02e('0xf')][_0xe02e('0x10')],_0xe02e('0x19')][_0xe02e('0x11')]('\x20')));}var _0x1fa5b7=schema(properties['voicequeuechannelhangup'])['validate'](_0x25e90f);if(_0x1fa5b7[_0xe02e('0x57')]>0x0){return _0x502875(_0x30708b['error'](0x1f4,_['map'](_0x1fa5b7,_0xe02e('0x17'))[_0xe02e('0x11')](',\x20')));}var _0x46d186=_['find'](_0x17352a['queueChannels'],{'uniqueid':_0x25e90f['uniqueid']});if(_0x46d186&&_0x46d186[_0xe02e('0x5c')]){return ami[_0xe02e('0x15')]({'action':_0xe02e('0x72'),'channel':_0x46d186['channel']})[_0xe02e('0x16')](function(_0x41ec96){_0x5673e3({'code':0xc8,'message':[_0x25e90f[_0xe02e('0x5b')],_0x41ec96[_0xe02e('0x17')][_0xe02e('0x61')]()][_0xe02e('0x11')]('\x20')});})[_0xe02e('0x18')](function(_0x5d37ce){_0x502875(_0x30708b['error'](0x1f5,[_0x25e90f[_0xe02e('0x5b')],_0x5d37ce[_0xe02e('0x17')][_0xe02e('0x61')]()][_0xe02e('0x11')]('\x20')));});}else{return _0x502875(_0x30708b[_0xe02e('0xe')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x11525f){var _0x4b8f72=this;return new Promise(function(_0x16dd8f,_0x20820c){if(ami[_0xe02e('0x67')]()==![]){return _0x20820c(_0x4b8f72['error'](0x1f4,[config[_0xe02e('0xf')]['ip'],config[_0xe02e('0xf')][_0xe02e('0x10')],_0xe02e('0x19')]['join']('\x20')));}var _0x271787=schema(properties[_0xe02e('0x73')])[_0xe02e('0x58')](_0x11525f);if(_0x271787[_0xe02e('0x57')]>0x0){return _0x20820c(_0x4b8f72[_0xe02e('0xe')](0x1f4,_[_0xe02e('0x59')](_0x271787,_0xe02e('0x17'))[_0xe02e('0x11')](',\x20')));}var _0x2a313d=_[_0xe02e('0x5a')](_0x17352a[_0xe02e('0x70')],{'uniqueid':_0x11525f['uniqueid']});if(_0x2a313d&&_0x2a313d[_0xe02e('0x5c')]){return ami['Action']({'action':_0xe02e('0x74'),'channel':_0x2a313d[_0xe02e('0x5c')],'exten':_0x11525f[_0xe02e('0x75')],'context':_0x11525f['context']||_0x2a313d['context'],'priority':0x1})[_0xe02e('0x16')](function(_0x583070){_0x16dd8f({'code':0xc8,'message':[_0x11525f[_0xe02e('0x5b')],_0x583070[_0xe02e('0x17')][_0xe02e('0x61')]()][_0xe02e('0x11')]('\x20')});})[_0xe02e('0x18')](function(_0x5904b3){_0x20820c(_0x4b8f72[_0xe02e('0xe')](0x1f5,[_0x11525f[_0xe02e('0x5b')],_0x5904b3[_0xe02e('0x17')][_0xe02e('0x61')]()][_0xe02e('0x11')]('\x20')));});}else{return _0x20820c(_0x4b8f72['error'](0x1f5,_0xe02e('0x66')));}});},'Agents':function(_0x5b8c39){return new Promise(function(_0x2da350,_0x451477){var _0xe9845d=_[_0xe02e('0x55')](_0x17352a[_0xe02e('0xb')]);_0x2da350({'count':_0xe9845d[_0xe02e('0x57')],'rows':_0xe9845d});});},'Telephones':function(_0x1e68b5){return new Promise(function(_0x3a926e,_0x5c37ed){var _0x123096=_['values'](_0x17352a[_0xe02e('0x76')]);_0x3a926e({'count':_0x123096['length'],'rows':_0x123096});});},'Trunks':function(_0x41448b){return new Promise(function(_0x3f4e10,_0x12d9bf){var _0x551bc2=_['values'](_0x17352a[_0xe02e('0x77')]);_0x3f4e10({'count':_0x551bc2[_0xe02e('0x57')],'rows':_0x551bc2});});},'OutboundChannels':function(_0x236cda){return new Promise(function(_0x291c56,_0x50e953){var _0x14595a=_[_0xe02e('0x55')](_0x17352a[_0xe02e('0x78')]);_0x291c56({'count':_0x14595a['length'],'rows':_0x14595a});});},'Outbound':function(_0x15228b){return new Promise(function(_0x531552,_0xcc94af){_0x531552(_0x17352a['outbound']);});},'Campaigns':function(_0x19bad2){return new Promise(function(_0x435256,_0x13818a){var _0x5323dc=_[_0xe02e('0x55')](_0x17352a[_0xe02e('0x79')]);_0x435256({'count':_0x5323dc[_0xe02e('0x57')],'rows':_0x5323dc});});},'VoiceQueuesPreview':function(_0x2cdc50){var _0x42025d=this;return new Promise(function(_0x520a65,_0x66994d){_0x589d75[_0xe02e('0x7a')](_0x2cdc50['id'])[_0xe02e('0x16')](function(_0x553eff){_0x520a65({'code':0xc8,'message':_0x553eff['message']});})['catch'](function(_0x56247f){_0x66994d(_0x42025d[_0xe02e('0xe')](0x1f4,_0x56247f[_0xe02e('0x17')]));});});},'EventManager':function(_0x456690){var _0x3f57ba=this;return new Promise(function(_0x45be5c,_0x2b9a0a){if(!_0x456690[_0xe02e('0x7b')]){return _0x2b9a0a(_0x3f57ba[_0xe02e('0xe')](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0xe02e('0x7c')+_0x456690[_0xe02e('0x7b')],_0x456690['message']);_0x45be5c({'code':0xc8,'message':_0x456690});});},'FaxAccounts':function(_0x3b0674){return new Promise(function(_0x582edf,_0x51c304){var _0x10f4c1=_[_0xe02e('0x55')](_0x17352a[_0xe02e('0x7d')]);_0x582edf({'count':_0x10f4c1[_0xe02e('0x57')],'rows':_0x10f4c1});});},'SendFax':function(_0x29356d){var _0x31f981=this;return new Promise(function(_0x55f057,_0x5c0266){_0x301c99['send'](_0x29356d)[_0xe02e('0x16')](function(_0x5b8cb4){_0x55f057({'code':0xc8,'message':_0x5b8cb4[_0xe02e('0x17')]});})[_0xe02e('0x18')](function(_0x1948ff){_0x5c0266(_0x31f981['error'](0x1f4,_0x1948ff[_0xe02e('0x17')]));});});},'CheckAfterSend':function(_0x335d1d){var _0x28b795=this;return new Promise(function(_0x88cddd,_0x42ef5e){_0x301c99['checkAfterSend'](_0x335d1d)[_0xe02e('0x16')](function(_0x420b94){_0x88cddd({'code':0xc8,'message':_0x420b94['message']});})['catch'](function(_0x31aee1){_0x42ef5e(_0x28b795[_0xe02e('0xe')](0x1f4,_0x31aee1['message']));});});}};var _0x2f2263=jayson[_0xe02e('0x7e')](_0x4a62a1)[_0xe02e('0x7f')]();_0x2f2263['on'](_0xe02e('0xe'),function(_0x1a31ab){return _0xbee04e(_0x1a31ab);});_0x2f2263['listen'](0x232a,_0xe02e('0x80'),function(){console['log'](_0xe02e('0x81'),0x232a);return _0x2a6fbf(_0xe02e('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 19fb081..1358397 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 _0x9134=['calleridnum','routeId','calleridname','','firstName','destcalleridname','destcalleridnum','uniqueid','phone','resolve','then','omit','xmd-contactid2','name','trigger:%s','action','merge','createContact','format','toLowerCase','catch','error','Error\x20creating\x20contact','user:%s','util','lodash','ioredis','../../../../config/environment','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','stringify','emit','data2','data1'];(function(_0x17b0d4,_0x377add){var _0x2d02c7=function(_0x56e627){while(--_0x56e627){_0x17b0d4['push'](_0x17b0d4['shift']());}};_0x2d02c7(++_0x377add);}(_0x9134,0x87));var _0x4913=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9134[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var util=require(_0x4913('0x0'));var _=require(_0x4913('0x1'));var Redis=require(_0x4913('0x2'));var config=require(_0x4913('0x3'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require(_0x4913('0x4'));config[_0x4913('0x5')]=_[_0x4913('0x6')](config[_0x4913('0x5')],{'host':_0x4913('0x7'),'port':0x18eb});var io=require(_0x4913('0x8'))(new Redis(config['redis']));function emit(_0x46e307,_0x177977,_0x16ab4f){logger['info'](_0x46e307,_0x177977,JSON[_0x4913('0x9')](_0x16ab4f));io['to'](_0x46e307)[_0x4913('0xa')](_0x177977,_0x16ab4f);}exports['exec']=function(_0x536f95,_0x4d9eb2,_0xae5842){_0xae5842['autoCreate']=0x0;if(_0x4d9eb2[_0x4913('0xb')]&&parseInt(_0x4d9eb2[_0x4913('0xb')],0xa)){var _0x27c27f={'ListId':parseInt(_0x4d9eb2[_0x4913('0xc')],0xa),'phone':_0xae5842[_0x4913('0xd')]};if(_['isNil'](_0xae5842[_0x4913('0xe')])){_0x27c27f['firstName']=_0xae5842[_0x4913('0xf')]&&_0xae5842['calleridname']!==_0x4913('0x10')?_0xae5842[_0x4913('0xf')]:_0xae5842[_0x4913('0xd')]||_0xae5842['uniqueid'];}else{_0x27c27f[_0x4913('0x11')]=_0xae5842[_0x4913('0x12')]&&_0xae5842['destcalleridname']!==''?_0xae5842[_0x4913('0x12')]:_0xae5842[_0x4913('0x13')]||_0xae5842[_0x4913('0x14')];_0x27c27f[_0x4913('0x15')]=_0xae5842['destcalleridname']&&_0xae5842[_0x4913('0x12')]!==_0x4913('0x10')?_0xae5842['destcalleridname']:_0xae5842[_0x4913('0x13')]||_0xae5842['uniqueid'];}BPromise[_0x4913('0x16')]()[_0x4913('0x17')](cmContactRpc['showContact']({'where':_[_0x4913('0x18')](_0x27c27f,['firstName'])}))[_0x4913('0x17')](function(_0x1371fc){if(_0x1371fc){_0xae5842[_0x4913('0x19')]=_0x1371fc['id'];emit(util['format']('user:%s',_0x536f95[_0x4913('0x1a')]),util['format'](_0x4913('0x1b'),_0x4d9eb2[_0x4913('0x1c')]['toLowerCase']()),_[_0x4913('0x1d')](_0xae5842,{'ListId':parseInt(_0x4d9eb2[_0x4913('0xc')],0xa)}));return;}else{return BPromise[_0x4913('0x16')]()[_0x4913('0x17')](cmContactRpc[_0x4913('0x1e')](_0x27c27f));}})[_0x4913('0x17')](function(_0x3dbf4e){if(_0x3dbf4e){_0xae5842['xmd-contactid2']=_0x3dbf4e['id'];emit(util[_0x4913('0x1f')]('user:%s',_0x536f95[_0x4913('0x1a')]),util[_0x4913('0x1f')](_0x4913('0x1b'),_0x4d9eb2[_0x4913('0x1c')][_0x4913('0x20')]()),_[_0x4913('0x1d')](_0xae5842,{'ListId':parseInt(_0x4d9eb2[_0x4913('0xc')],0xa)}));}})[_0x4913('0x21')](function(_0x203ba7){logger[_0x4913('0x22')](_0x4913('0x23'),JSON[_0x4913('0x9')](_0x203ba7));});}else{if(_0x536f95){emit(util['format'](_0x4913('0x24'),_0x536f95[_0x4913('0x1a')]),util['format'](_0x4913('0x1b'),_0x4d9eb2[_0x4913('0x1c')]['toLowerCase']()),_['merge']({'ListId':parseInt(_0x4d9eb2[_0x4913('0xc')],0xa)},_0xae5842));}}}; \ No newline at end of file +var _0x0ef4=['showContact','omit','format','name','action','toLowerCase','merge','resolve','createContact','xmd-contactid2','user:%s','trigger:%s','catch','error','util','lodash','ioredis','trigger','../../rpc/cmContact','redis','info','stringify','emit','exec','data2','data1','isNil','routeId','firstName','calleridname','','calleridnum','uniqueid','destcalleridname','destcalleridnum','phone','then'];(function(_0x1937ed,_0xda78a1){var _0x3f4b75=function(_0x588aad){while(--_0x588aad){_0x1937ed['push'](_0x1937ed['shift']());}};_0x3f4b75(++_0xda78a1);}(_0x0ef4,0xc7));var _0x40ef=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0x0ef4[_0x207811];return _0x170d56;};'use strict';var BPromise=require('bluebird');var util=require(_0x40ef('0x0'));var _=require(_0x40ef('0x1'));var Redis=require(_0x40ef('0x2'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x40ef('0x3'));var cmContactRpc=require(_0x40ef('0x4'));config[_0x40ef('0x5')]=_['defaults'](config[_0x40ef('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x40ef('0x5')]));function emit(_0x3dba6e,_0x3f5a83,_0x7d0e82){logger[_0x40ef('0x6')](_0x3dba6e,_0x3f5a83,JSON[_0x40ef('0x7')](_0x7d0e82));io['to'](_0x3dba6e)[_0x40ef('0x8')](_0x3f5a83,_0x7d0e82);}exports[_0x40ef('0x9')]=function(_0xe6d8ac,_0x521059,_0x145eb0){_0x145eb0['autoCreate']=0x0;if(_0x521059[_0x40ef('0xa')]&&parseInt(_0x521059[_0x40ef('0xa')],0xa)){var _0x23c74e={'ListId':parseInt(_0x521059[_0x40ef('0xb')],0xa),'phone':_0x145eb0['calleridnum']};if(_[_0x40ef('0xc')](_0x145eb0[_0x40ef('0xd')])){_0x23c74e[_0x40ef('0xe')]=_0x145eb0[_0x40ef('0xf')]&&_0x145eb0[_0x40ef('0xf')]!==_0x40ef('0x10')?_0x145eb0[_0x40ef('0xf')]:_0x145eb0[_0x40ef('0x11')]||_0x145eb0[_0x40ef('0x12')];}else{_0x23c74e[_0x40ef('0xe')]=_0x145eb0[_0x40ef('0x13')]&&_0x145eb0[_0x40ef('0x13')]!==''?_0x145eb0['destcalleridname']:_0x145eb0[_0x40ef('0x14')]||_0x145eb0['uniqueid'];_0x23c74e[_0x40ef('0x15')]=_0x145eb0[_0x40ef('0x13')]&&_0x145eb0['destcalleridname']!==_0x40ef('0x10')?_0x145eb0[_0x40ef('0x13')]:_0x145eb0['destcalleridnum']||_0x145eb0[_0x40ef('0x12')];}BPromise['resolve']()[_0x40ef('0x16')](cmContactRpc[_0x40ef('0x17')]({'where':_[_0x40ef('0x18')](_0x23c74e,['firstName'])}))['then'](function(_0x38f234){if(_0x38f234){_0x145eb0['xmd-contactid2']=_0x38f234['id'];emit(util[_0x40ef('0x19')]('user:%s',_0xe6d8ac[_0x40ef('0x1a')]),util[_0x40ef('0x19')]('trigger:%s',_0x521059[_0x40ef('0x1b')][_0x40ef('0x1c')]()),_[_0x40ef('0x1d')](_0x145eb0,{'ListId':parseInt(_0x521059['data1'],0xa)}));return;}else{return BPromise[_0x40ef('0x1e')]()['then'](cmContactRpc[_0x40ef('0x1f')](_0x23c74e));}})['then'](function(_0x3dcd5a){if(_0x3dcd5a){_0x145eb0[_0x40ef('0x20')]=_0x3dcd5a['id'];emit(util[_0x40ef('0x19')](_0x40ef('0x21'),_0xe6d8ac[_0x40ef('0x1a')]),util[_0x40ef('0x19')](_0x40ef('0x22'),_0x521059[_0x40ef('0x1b')][_0x40ef('0x1c')]()),_[_0x40ef('0x1d')](_0x145eb0,{'ListId':parseInt(_0x521059[_0x40ef('0xb')],0xa)}));}})[_0x40ef('0x23')](function(_0x14f620){logger[_0x40ef('0x24')]('Error\x20creating\x20contact',JSON[_0x40ef('0x7')](_0x14f620));});}else{if(_0xe6d8ac){emit(util[_0x40ef('0x19')]('user:%s',_0xe6d8ac['name']),util[_0x40ef('0x19')](_0x40ef('0x22'),_0x521059['action']['toLowerCase']()),_['merge']({'ListId':parseInt(_0x521059[_0x40ef('0xb')],0xa)},_0x145eb0));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 59223de..1e38fdd 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 _0x8931=['interaction','message','membername','lastevent','exports','lodash','url','mustache','ioredis','./urlforward','./script','../rpc/cmContact','../../../config/environment','../../../config/logger','trigger','../ami','defaults','redis','socket.io-emitter','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','freshdeskAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:queuecallerabandon','syncAgentDial','custom:dialconnect','custom:dialend','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','stringify','clone','checkTriggers','interface','hasOwnProperty','status','variables','Actions','length','action','toLowerCase','motionbar','browser','data1','popup','TemplateId','data2','render','html','template\x20not\x20found','uri','data3','isNil','location','uriLocation','data4','windowWidth','data5','windowHeight','data6','600','winArguments','format','trigger:%s:%s','merge','jscripty','user:%s','name','trigger:%s','contactmanager','exec','integration','accounts','queue','routeId','urlforward','script','buildUri','query','search','replace','AllConditions','every','channel','AnyConditions','some','checkConditions','field','account','ChatWebsiteId','upperFirst','AccountId','operator','value'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8931,0x161));var _0x1893=function(_0x4a914a,_0x42fca8){_0x4a914a=_0x4a914a-0x0;var _0x35d21b=_0x8931[_0x4a914a];return _0x35d21b;};'use strict';var util=require('util');var _=require(_0x1893('0x0'));var url=require(_0x1893('0x1'));var Mustache=require(_0x1893('0x2'));var Redis=require(_0x1893('0x3'));var urlforward=require(_0x1893('0x4'));var integration=require('./integration');var cmContact=require('./cmContact');var script=require(_0x1893('0x5'));var cmContactRpc=require(_0x1893('0x6'));var config=require(_0x1893('0x7'));var logger=require(_0x1893('0x8'))(_0x1893('0x9'));var ami=require(_0x1893('0xa'));config['redis']=_[_0x1893('0xb')](config[_0x1893('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x1893('0xd'))(new Redis(config[_0x1893('0xc')]));var operators={'equals':function(_0x41e1cc,_0x52d3d3){return _0x41e1cc==_0x52d3d3;},'not_equals':function(_0x3b3e78,_0x50c40f){return _0x3b3e78!=_0x50c40f;}};var barAndWebActions=['popup','url',_0x1893('0xe')];function Trigger(_0x161241){this[_0x1893('0xf')]=_0x161241[_0x1893('0xf')];this[_0x1893('0x10')]=_0x161241[_0x1893('0x10')];this[_0x1893('0x11')]=_0x161241[_0x1893('0x11')];this[_0x1893('0x12')]=_0x161241[_0x1893('0x12')];this[_0x1893('0x13')]=_0x161241[_0x1893('0x13')];this['zendeskAccounts']=_0x161241[_0x1893('0x14')];this['freshdeskAccounts']=_0x161241['freshdeskAccounts'];this[_0x1893('0x15')]=_0x161241[_0x1893('0x15')];this[_0x1893('0x16')]=_0x161241[_0x1893('0x16')];this['zohoAccounts']=_0x161241[_0x1893('0x17')];this['deskAccounts']=_0x161241[_0x1893('0x18')];this[_0x1893('0x19')]=_0x161241['vtigerAccounts'];this[_0x1893('0x1a')]=_0x161241[_0x1893('0x1a')];this[_0x1893('0x1b')]=_0x161241[_0x1893('0x1b')];this[_0x1893('0x1c')]=_0x161241[_0x1893('0x1c')];this['accounts']={'zendesk':this[_0x1893('0x14')],'salesforce':this[_0x1893('0x15')],'freshdesk':this[_0x1893('0x1d')],'sugarcrm':this[_0x1893('0x16')],'zoho':this[_0x1893('0x17')],'desk':this[_0x1893('0x18')],'vtiger':this[_0x1893('0x19')],'dynamics365':this[_0x1893('0x1b')],'freshsales':this[_0x1893('0x1c')],'servicenow':this['servicenowAccounts']};ami['on'](_0x1893('0x1e'),this[_0x1893('0x1f')][_0x1893('0x20')](this));ami['on'](_0x1893('0x21'),this[_0x1893('0x1f')]['bind'](this));ami['on'](_0x1893('0x22'),this[_0x1893('0x1f')][_0x1893('0x20')](this));ami['on']('custom:agentcomplete',this['syncCustomEvent'][_0x1893('0x20')](this));ami['on'](_0x1893('0x23'),this[_0x1893('0x1f')][_0x1893('0x20')](this));ami['on']('custom:dialbegin',this[_0x1893('0x24')]['bind'](this));ami['on'](_0x1893('0x25'),this[_0x1893('0x24')]['bind'](this));ami['on'](_0x1893('0x26'),this[_0x1893('0x24')][_0x1893('0x20')](this));ami['on']('custom:newinteraction',this[_0x1893('0x1f')][_0x1893('0x20')](this));ami['on'](_0x1893('0x27'),this[_0x1893('0x1f')]['bind'](this));ami['on'](_0x1893('0x28'),this[_0x1893('0x1f')][_0x1893('0x20')](this));ami['on'](_0x1893('0x29'),this[_0x1893('0x1f')][_0x1893('0x20')](this));ami['on'](_0x1893('0x2a'),this[_0x1893('0x1f')][_0x1893('0x20')](this));ami['on'](_0x1893('0x2b'),this['syncCustomEvent']['bind'](this));}Trigger[_0x1893('0x2c')][_0x1893('0x2d')]=function(_0x15d92d,_0x2dad55,_0xe8bfe3){logger[_0x1893('0x2e')](_0x15d92d,_0x2dad55,JSON[_0x1893('0x2f')](_0xe8bfe3));io['to'](_0x15d92d)[_0x1893('0x2d')](_0x2dad55,_0xe8bfe3);};Trigger['prototype'][_0x1893('0x1f')]=function(_0x3e57e2){var _0xf8f834=_[_0x1893('0x30')](_0x3e57e2);this[_0x1893('0x31')](_0xf8f834);};Trigger[_0x1893('0x2c')]['syncAgentDial']=function(_0x2d712d){if(this[_0x1893('0x10')][_0x2d712d[_0x1893('0x32')]]){this[_0x1893('0x1f')](_0x2d712d);}};Trigger[_0x1893('0x2c')][_0x1893('0x31')]=function(_0x4dbc40){var _0x2537a5;for(var _0x345ea1 in this[_0x1893('0xf')]){if(this[_0x1893('0xf')][_0x1893('0x33')](_0x345ea1)){if(this[_0x1893('0xf')][_0x345ea1][_0x1893('0x34')]){_0x2537a5=this['checkTrigger'](this[_0x1893('0xf')][_0x345ea1],_0x4dbc40);if(_0x2537a5){_['merge'](_0x4dbc40,_0x4dbc40[_0x1893('0x35')]);for(var _0x23f7d8=0x0,_0x2d6aa3,_0x1acf08,_0x39b428;_0x23f7d80x0){_0x3c1fa4=_[_0x014a('0x2b')](_0x5ed71b,_0x183f19);}return _0x3c1fa4;}function getCustomFields(_0x2560a6,_0x496040){var _0x4f9c1c=[];var _0x397850={'custom_fields':{}};if(_0x2560a6[_0x014a('0x2c')]>0x0){_[_0x014a('0x2d')](_0x2560a6,function(_0x29fce5){if(_0x29fce5['type']===_0x014a('0x2e')&&_0x29fce5[_0x014a('0x2f')]&&!_0x29fce5[_0x014a('0x30')]){_0x397850[_0x29fce5[_0x014a('0x2f')][_0x014a('0x31')]()]=_0x29fce5[_0x014a('0x32')][_0x014a('0x24')]();}else if(_0x29fce5[_0x014a('0x33')]===_0x014a('0x2e')&&_0x29fce5[_0x014a('0x34')]&&_0x29fce5[_0x014a('0x30')]){_0x397850['custom_fields'][_0x29fce5[_0x014a('0x34')]]=_0x29fce5[_0x014a('0x32')][_0x014a('0x24')]();}else if(_0x29fce5[_0x014a('0x33')]===_0x014a('0x35')&&_0x29fce5[_0x014a('0x36')]&&_0x29fce5[_0x014a('0x34')]&&_0x29fce5['customField']){_0x496040[_0x29fce5[_0x014a('0x36')]]&&(_0x397850[_0x014a('0x37')][_0x29fce5['idField']]=_0x496040[_0x29fce5[_0x014a('0x36')]][_0x014a('0x24')]());}else if(_0x29fce5[_0x014a('0x33')]===_0x014a('0x38')&&_0x29fce5[_0x014a('0x39')]&&_0x29fce5[_0x014a('0x39')][_0x014a('0x3a')]&&_0x29fce5[_0x014a('0x34')]&&_0x29fce5['customField']){_0x496040[_0x29fce5[_0x014a('0x39')][_0x014a('0x3a')][_0x014a('0x31')]()]&&(_0x397850[_0x014a('0x37')][_0x29fce5['idField']]=_0x496040[_0x29fce5[_0x014a('0x39')][_0x014a('0x3a')][_0x014a('0x31')]()][_0x014a('0x24')]());}});}if(_0x397850[_0x014a('0x3b')]){_0x397850[_0x014a('0x3b')]=Number(_0x397850[_0x014a('0x3b')]);}return _0x397850;}function getTicket(_0x36187b,_0x1ec350,_0x5f2f66,_0x1b34f8,_0x585962){logger[_0x014a('0x13')](_0x014a('0x3c'));var _0x44958f=_[_0x014a('0x3d')]({'subject':intUtil[_0x014a('0x3e')](_0x1b34f8['Subjects'],_0x585962,'\x20'),'type':_0x014a('0x3f'),'status':_0x014a('0x40'),'labels':['xCALLY',_0x014a('0x41'),_0x014a('0x42')][_0x014a('0x43')](getTags(_0x1b34f8[_0x014a('0x44')],_0x014a('0x3a'))),'description':intUtil[_0x014a('0x3e')](_0x1b34f8[_0x014a('0x45')],_0x585962,'\x0a'),'_links':{'assigned_user':{'href':util[_0x014a('0x16')](_0x014a('0x46'),_0x1ec350['id']),'class':'user'}},'message':{'direction':'in','body':intUtil[_0x014a('0x3e')](_0x1b34f8[_0x014a('0x45')],_0x585962,'\x0a')}},getCustomFields(_0x1b34f8[_0x014a('0x47')],_0x585962));return request({'uri':util[_0x014a('0x16')]('%s/customers/%d/cases',_0x36187b[_0x014a('0xd')],_0x5f2f66['id']),'method':_0x014a('0x29'),'body':_0x44958f});}exports[_0x014a('0x48')]=function(_0x1355dd,_0x1dc647,_0x430a56,_0x5f2969,_0x361866,_0x2830e1){var _0x5e2f74,_0xc086b3;_0x2830e1[_0x014a('0xd')]=intUtil[_0x014a('0x49')](_0x2830e1['remoteUri']);_0x2830e1[_0x014a('0x4a')]=intUtil['stripTrailingSlash'](_0x2830e1['serverUrl']);if(_0x361866&&_0x361866[_0x014a('0x4b')]){logger[_0x014a('0x13')]('[QUEUE]',_0x014a('0x4c'));_0x1dc647[_0x014a('0x4d')]=util[_0x014a('0x16')](_0x014a('0x4e'),_0x2830e1[_0x014a('0x4a')],_0x1dc647[_0x014a('0x4f')],md5(_0x1dc647['uniqueid']));}else{_0x1dc647[_0x014a('0x4d')]='';}headers[_0x014a('0x50')]=getAuth(_0x2830e1);return getUser(_0x2830e1,_0x5f2969[_0x014a('0x51')])['then'](function(_0x56937d){_0x5e2f74=_0x56937d;logger[_0x014a('0x13')]('The\x20User\x20ID\x20is:',_0x5e2f74['id']);return getEndUser(_0x2830e1,_0x1dc647['calleridname'],_0x1dc647[_0x014a('0x52')]);})['then'](function(_0x2a4679){_0xc086b3=_0x2a4679;logger[_0x014a('0x13')](_0x014a('0x53'),_0xc086b3['id']);return getTicket(_0x2830e1,_0x5e2f74,_0xc086b3,_0x430a56,_0x1dc647);})['then'](function(_0x395e5e){if(_0x395e5e){logger[_0x014a('0x13')](_0x014a('0x54'));logger[_0x014a('0x13')](_0x014a('0x55'),_0x395e5e['id']);switch(_0x2830e1[_0x014a('0x33')]){case'integrationTab':logger[_0x014a('0x13')](_0x014a('0x56'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x014a('0x16')](_0x014a('0x57'),_0x5f2969[_0x014a('0x3a')]),_0x014a('0x58'),{'recordId':_0x395e5e['id']});break;case _0x014a('0x59'):logger[_0x014a('0x13')](_0x014a('0x56'),_0x014a('0x5a'));emit(util['format'](_0x014a('0x57'),_0x5f2969[_0x014a('0x3a')]),_0x014a('0x5b'),{'uri':util[_0x014a('0x16')](_0x014a('0x5c'),_0x395e5e['id'])});break;default:logger['error'](_0x014a('0x56'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x014a('0x5d')](function(_0x3b5ac9){console[_0x014a('0x5e')](_0x3b5ac9);logger[_0x014a('0x5e')](_0x014a('0x56'),JSON['stringify'](_0x3b5ac9));});};exports['outbound']=function(_0x4bb0b2,_0x58905d,_0x1c11d0,_0x4c2479,_0x1fe253,_0x5b5318,_0x59cfbe){var _0x21ff0c,_0x55ca2f;_0x5b5318[_0x014a('0xd')]=intUtil[_0x014a('0x49')](_0x5b5318[_0x014a('0xd')]);_0x5b5318[_0x014a('0x4a')]=intUtil[_0x014a('0x49')](_0x5b5318[_0x014a('0x4a')]);if(_0x59cfbe&&_0x59cfbe[_0x014a('0x5f')]&&_0x59cfbe[_0x014a('0x5f')]!==_0x014a('0x60')){logger[_0x014a('0x13')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x58905d[_0x014a('0x4d')]=util[_0x014a('0x16')](_0x014a('0x4e'),_0x5b5318['serverUrl'],_0x58905d['uniqueid'],md5(_0x58905d[_0x014a('0x4f')]));}headers['Authorization']=getAuth(_0x5b5318);return getUser(_0x5b5318,_0x4c2479[_0x014a('0x51')])[_0x014a('0x12')](function(_0x34c65a){_0x21ff0c=_0x34c65a;logger[_0x014a('0x13')]('The\x20User\x20ID\x20is:',_0x21ff0c['id']);return getEndUser(_0x5b5318,_0x58905d[_0x014a('0x61')],_0x58905d[_0x014a('0x62')]);})[_0x014a('0x12')](function(_0x56c09b){_0x55ca2f=_0x56c09b;logger[_0x014a('0x13')]('The\x20Enduser\x20ID\x20is:',_0x55ca2f['id']);return getTicket(_0x5b5318,_0x21ff0c,_0x55ca2f,_0x1c11d0,_0x58905d);})[_0x014a('0x12')](function(_0x47074f){if(_0x47074f){logger[_0x014a('0x13')](_0x014a('0x54'));logger[_0x014a('0x13')](_0x014a('0x55'),_0x47074f['id']);switch(_0x5b5318['type']){case _0x014a('0x63'):logger[_0x014a('0x13')](_0x014a('0x56'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x014a('0x16')](_0x014a('0x57'),_0x4c2479[_0x014a('0x3a')]),_0x014a('0x58'),{'recordId':_0x47074f['id']});break;case _0x014a('0x59'):logger['info'](_0x014a('0x56'),_0x014a('0x5a'));emit(util[_0x014a('0x16')](_0x014a('0x57'),_0x4c2479[_0x014a('0x3a')]),_0x014a('0x5b'),{'uri':util[_0x014a('0x16')](_0x014a('0x64'),_0x5b5318[_0x014a('0xd')],_0x47074f['id'])});break;default:logger[_0x014a('0x5e')](_0x014a('0x65'),_0x014a('0x66'));}}})['catch'](function(_0x2ac66a){logger['error']('[OUTBOUND]',JSON['stringify'](_0x2ac66a));});};exports['abandoned']=function(_0x5a38b4,_0x1716d3,_0x19be40,_0x2613ff,_0x52d602,_0x3c6fc0){var _0x2a5007,_0x3071c8;_0x3c6fc0[_0x014a('0xd')]=intUtil['stripTrailingSlash'](_0x3c6fc0['remoteUri']);_0x3c6fc0[_0x014a('0x4a')]=intUtil[_0x014a('0x49')](_0x3c6fc0[_0x014a('0x4a')]);if(_0x52d602&&_0x52d602[_0x014a('0x4b')]){logger[_0x014a('0x13')](_0x014a('0x67'),_0x014a('0x4c'));_0x1716d3[_0x014a('0x4d')]=util[_0x014a('0x16')](_0x014a('0x4e'),_0x3c6fc0[_0x014a('0x4a')],_0x1716d3['uniqueid'],md5(_0x1716d3[_0x014a('0x4f')]));}else{_0x1716d3[_0x014a('0x4d')]='';}headers['Authorization']=getAuth(_0x3c6fc0);return getUser(_0x3c6fc0)[_0x014a('0x12')](function(_0x3e39c9){_0x2a5007=_0x3e39c9;logger['info'](_0x014a('0x68'),_0x2a5007['id']);return getEndUser(_0x3c6fc0,_0x1716d3['calleridname'],_0x1716d3[_0x014a('0x52')]);})[_0x014a('0x12')](function(_0xcdcbbb){_0x3071c8=_0xcdcbbb;logger[_0x014a('0x13')](_0x014a('0x53'),_0x3071c8['id']);return getTicket(_0x3c6fc0,_0x2a5007,_0x3071c8,_0x19be40,_0x1716d3);})['then'](function(_0x2cd82e){if(_0x2cd82e){logger[_0x014a('0x13')](_0x014a('0x54'));logger[_0x014a('0x13')](_0x014a('0x55'),_0x2cd82e['id']);}})['catch'](function(_0x20cddc){logger[_0x014a('0x5e')](_0x014a('0x67'),JSON['stringify'](_0x20cddc));});}; \ No newline at end of file +var _0xc900=['token','%s/token:%s','Basic\x20%s','toString','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','_embedded','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','length','map','forEach','string','nameField','customField','toLowerCase','type','idField','variable','variableName','custom_fields','customVariable','Variable','name','priority','merge','getString','Subjects','phone','new','xCALLY','Motion','CTI','Tags','/api/v2/users/%d','Descriptions','%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...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','destcalleridnum','trigger:desk:display','user:%s','%s/agent/tickets/%s','[OUTBOUND]','abandoned','[ABANDONED]','calleridname','md5','util','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','find','entries','then','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','stringify','GET','authType','basic','username','password'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xc900,0xb3));var _0x0c90=function(_0x1fafd8,_0x54c101){_0x1fafd8=_0x1fafd8-0x0;var _0x491c7d=_0xc900[_0x1fafd8];return _0x491c7d;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x0c90('0x0'));var util=require(_0x0c90('0x1'));var Redis=require(_0x0c90('0x2'));var intUtil=require('./util');var config=require(_0x0c90('0x3'));var logger=require(_0x0c90('0x4'))('desk');config[_0x0c90('0x5')]=_[_0x0c90('0x6')](config[_0x0c90('0x5')],{'host':_0x0c90('0x7'),'port':0x18eb});var io=require(_0x0c90('0x8'))(new Redis(config[_0x0c90('0x5')]));function emit(_0x5b1a5c,_0x24e5be,_0x1c1996){io['to'](_0x5b1a5c)[_0x0c90('0x9')](_0x24e5be,_0x1c1996);}var headers={'Content-Type':_0x0c90('0xa'),'Accept':_0x0c90('0xa')};function getUser(_0x3d0f49,_0x313ce9){if(intUtil[_0x0c90('0xb')](_0x313ce9)===!![]){logger[_0x0c90('0xc')](_0x0c90('0xd'),_0x313ce9);return request({'uri':util[_0x0c90('0xe')](_0x0c90('0xf'),_0x3d0f49[_0x0c90('0x10')])})['then'](function(_0x438266){if(_0x438266['total_entries']){return _[_0x0c90('0x11')](_0x438266['_embedded'][_0x0c90('0x12')],{'email':_0x313ce9});}})[_0x0c90('0x13')](function(_0x4535a2){if(_0x4535a2){logger[_0x0c90('0xc')](_0x0c90('0x14'));return _0x4535a2;}else{logger['info'](_0x0c90('0x15'));return request({'uri':util[_0x0c90('0xe')]('%s/users/me',_0x3d0f49[_0x0c90('0x10')])});}});}else{logger[_0x0c90('0xc')](_0x0c90('0x16'));return request({'uri':util['format']('%s/users/me',_0x3d0f49[_0x0c90('0x10')])});}}function request(_0x15ca42){logger[_0x0c90('0x17')](_0x0c90('0x18'),JSON[_0x0c90('0x19')](_0x15ca42));return rp(_[_0x0c90('0x6')](_0x15ca42,{'method':_0x0c90('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x57b9a6){var _0xc3bb47;if(_0x57b9a6[_0x0c90('0x1b')]===_0x0c90('0x1c')){_0xc3bb47=util[_0x0c90('0xe')]('%s:%s',_0x57b9a6[_0x0c90('0x1d')],_0x57b9a6[_0x0c90('0x1e')]);}else if(_0x57b9a6[_0x0c90('0x1b')]===_0x0c90('0x1f')){_0xc3bb47=util[_0x0c90('0xe')](_0x0c90('0x20'),_0x57b9a6['username'],_0x57b9a6[_0x0c90('0x1f')]);}return util['format'](_0x0c90('0x21'),new Buffer(_0xc3bb47)[_0x0c90('0x22')]('base64'));}function getEndUser(_0x2a053a,_0x43ddc3,_0x2e3c4c){logger[_0x0c90('0xc')](_0x0c90('0x23'),_0x2e3c4c);return request({'uri':util[_0x0c90('0xe')]('%s/customers/search',_0x2a053a[_0x0c90('0x10')]),'qs':{'phone':_0x2e3c4c}})[_0x0c90('0x13')](function(_0x5695a2){if(_0x5695a2['total_entries']){logger[_0x0c90('0xc')](_0x0c90('0x24'));return _0x5695a2[_0x0c90('0x25')][_0x0c90('0x12')][0x0];}else{logger['info'](_0x0c90('0x26'));return request({'uri':util[_0x0c90('0xe')](_0x0c90('0x27'),_0x2a053a[_0x0c90('0x10')]),'method':_0x0c90('0x28'),'body':{'first_name':_0x43ddc3,'title':_0x43ddc3,'phone_numbers':[{'type':_0x0c90('0x29'),'value':_0x2e3c4c}]}});}});}function getTags(_0x492028,_0x15de68){var _0x22a47d=[];if(_0x492028&&_0x492028[_0x0c90('0x2a')]>0x0){_0x22a47d=_[_0x0c90('0x2b')](_0x492028,_0x15de68);}return _0x22a47d;}function getCustomFields(_0x52d28d,_0x4c8603){var _0x1f27f1=[];var _0x25da6e={'custom_fields':{}};if(_0x52d28d[_0x0c90('0x2a')]>0x0){_[_0x0c90('0x2c')](_0x52d28d,function(_0x119e09){if(_0x119e09['type']===_0x0c90('0x2d')&&_0x119e09[_0x0c90('0x2e')]&&!_0x119e09[_0x0c90('0x2f')]){_0x25da6e[_0x119e09['nameField'][_0x0c90('0x30')]()]=_0x119e09['content']['toString']();}else if(_0x119e09[_0x0c90('0x31')]===_0x0c90('0x2d')&&_0x119e09[_0x0c90('0x32')]&&_0x119e09[_0x0c90('0x2f')]){_0x25da6e['custom_fields'][_0x119e09[_0x0c90('0x32')]]=_0x119e09['content'][_0x0c90('0x22')]();}else if(_0x119e09['type']===_0x0c90('0x33')&&_0x119e09[_0x0c90('0x34')]&&_0x119e09['idField']&&_0x119e09[_0x0c90('0x2f')]){_0x4c8603[_0x119e09[_0x0c90('0x34')]]&&(_0x25da6e[_0x0c90('0x35')][_0x119e09[_0x0c90('0x32')]]=_0x4c8603[_0x119e09[_0x0c90('0x34')]][_0x0c90('0x22')]());}else if(_0x119e09[_0x0c90('0x31')]===_0x0c90('0x36')&&_0x119e09['Variable']&&_0x119e09[_0x0c90('0x37')][_0x0c90('0x38')]&&_0x119e09[_0x0c90('0x32')]&&_0x119e09[_0x0c90('0x2f')]){_0x4c8603[_0x119e09['Variable'][_0x0c90('0x38')][_0x0c90('0x30')]()]&&(_0x25da6e[_0x0c90('0x35')][_0x119e09[_0x0c90('0x32')]]=_0x4c8603[_0x119e09[_0x0c90('0x37')][_0x0c90('0x38')][_0x0c90('0x30')]()][_0x0c90('0x22')]());}});}if(_0x25da6e['priority']){_0x25da6e[_0x0c90('0x39')]=Number(_0x25da6e[_0x0c90('0x39')]);}return _0x25da6e;}function getTicket(_0x538bf3,_0x5505f,_0x7a5daa,_0xd75cbb,_0x27f9ac){logger[_0x0c90('0xc')]('Creating\x20new\x20ticket...');var _0x2f1d95=_[_0x0c90('0x3a')]({'subject':intUtil[_0x0c90('0x3b')](_0xd75cbb[_0x0c90('0x3c')],_0x27f9ac,'\x20'),'type':_0x0c90('0x3d'),'status':_0x0c90('0x3e'),'labels':[_0x0c90('0x3f'),_0x0c90('0x40'),_0x0c90('0x41')]['concat'](getTags(_0xd75cbb[_0x0c90('0x42')],'name')),'description':intUtil[_0x0c90('0x3b')](_0xd75cbb['Descriptions'],_0x27f9ac,'\x0a'),'_links':{'assigned_user':{'href':util[_0x0c90('0xe')](_0x0c90('0x43'),_0x5505f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0xd75cbb[_0x0c90('0x44')],_0x27f9ac,'\x0a')}},getCustomFields(_0xd75cbb['Fields'],_0x27f9ac));return request({'uri':util[_0x0c90('0xe')](_0x0c90('0x45'),_0x538bf3[_0x0c90('0x10')],_0x7a5daa['id']),'method':'POST','body':_0x2f1d95});}exports[_0x0c90('0x46')]=function(_0x2fac13,_0x123b58,_0x3e5137,_0x2139c3,_0x1184c4,_0x565b10){var _0x424f78,_0x42bd71;_0x565b10[_0x0c90('0x10')]=intUtil[_0x0c90('0x47')](_0x565b10[_0x0c90('0x10')]);_0x565b10[_0x0c90('0x48')]=intUtil[_0x0c90('0x47')](_0x565b10['serverUrl']);if(_0x1184c4&&_0x1184c4[_0x0c90('0x49')]){logger['info'](_0x0c90('0x4a'),_0x0c90('0x4b'));_0x123b58[_0x0c90('0x4c')]=util[_0x0c90('0xe')](_0x0c90('0x4d'),_0x565b10[_0x0c90('0x48')],_0x123b58[_0x0c90('0x4e')],md5(_0x123b58[_0x0c90('0x4e')]));}else{_0x123b58[_0x0c90('0x4c')]='';}headers[_0x0c90('0x4f')]=getAuth(_0x565b10);return getUser(_0x565b10,_0x2139c3[_0x0c90('0x50')])[_0x0c90('0x13')](function(_0x24a115){_0x424f78=_0x24a115;logger[_0x0c90('0xc')](_0x0c90('0x51'),_0x424f78['id']);return getEndUser(_0x565b10,_0x123b58['calleridname'],_0x123b58[_0x0c90('0x52')]);})[_0x0c90('0x13')](function(_0x40027e){_0x42bd71=_0x40027e;logger[_0x0c90('0xc')](_0x0c90('0x53'),_0x42bd71['id']);return getTicket(_0x565b10,_0x424f78,_0x42bd71,_0x3e5137,_0x123b58);})[_0x0c90('0x13')](function(_0x36955a){if(_0x36955a){logger[_0x0c90('0xc')](_0x0c90('0x54'));logger[_0x0c90('0xc')](_0x0c90('0x55'),_0x36955a['id']);switch(_0x565b10[_0x0c90('0x31')]){case _0x0c90('0x56'):logger[_0x0c90('0xc')]('[QUEUE]',_0x0c90('0x57'));emit(util[_0x0c90('0xe')]('user:%s',_0x2139c3['name']),'trigger:desk:display',{'recordId':_0x36955a['id']});break;case _0x0c90('0x58'):logger[_0x0c90('0xc')](_0x0c90('0x4a'),_0x0c90('0x59'));emit(util[_0x0c90('0xe')]('user:%s',_0x2139c3[_0x0c90('0x38')]),_0x0c90('0x5a'),{'uri':util[_0x0c90('0xe')]('https://xcally.desk.com/web/agent/case/%d',_0x36955a['id'])});break;default:logger[_0x0c90('0x5b')](_0x0c90('0x4a'),_0x0c90('0x5c'));}}})[_0x0c90('0x5d')](function(_0xc449ea){console[_0x0c90('0x5b')](_0xc449ea);logger[_0x0c90('0x5b')](_0x0c90('0x4a'),JSON[_0x0c90('0x19')](_0xc449ea));});};exports[_0x0c90('0x5e')]=function(_0x5e288e,_0xac80b2,_0x4ba9e7,_0xda4331,_0x67539d,_0x4783e2,_0x21b3ed){var _0x22d676,_0x4520b0;_0x4783e2['remoteUri']=intUtil['stripTrailingSlash'](_0x4783e2['remoteUri']);_0x4783e2['serverUrl']=intUtil[_0x0c90('0x47')](_0x4783e2[_0x0c90('0x48')]);if(_0x21b3ed&&_0x21b3ed[_0x0c90('0x5f')]&&_0x21b3ed['recordingFormat']!==_0x0c90('0x60')){logger[_0x0c90('0xc')]('[OUTBOUND]',_0x0c90('0x4b'));_0xac80b2['recordingURL']=util[_0x0c90('0xe')](_0x0c90('0x4d'),_0x4783e2[_0x0c90('0x48')],_0xac80b2[_0x0c90('0x4e')],md5(_0xac80b2['uniqueid']));}headers[_0x0c90('0x4f')]=getAuth(_0x4783e2);return getUser(_0x4783e2,_0xda4331['email'])[_0x0c90('0x13')](function(_0x2e79a4){_0x22d676=_0x2e79a4;logger['info']('The\x20User\x20ID\x20is:',_0x22d676['id']);return getEndUser(_0x4783e2,_0xac80b2['destcalleridname'],_0xac80b2[_0x0c90('0x61')]);})[_0x0c90('0x13')](function(_0x22fd4b){_0x4520b0=_0x22fd4b;logger[_0x0c90('0xc')](_0x0c90('0x53'),_0x4520b0['id']);return getTicket(_0x4783e2,_0x22d676,_0x4520b0,_0x4ba9e7,_0xac80b2);})['then'](function(_0x3bfd01){if(_0x3bfd01){logger[_0x0c90('0xc')]('Ticket\x20created!');logger[_0x0c90('0xc')]('The\x20Ticket\x20ID\x20is:',_0x3bfd01['id']);switch(_0x4783e2[_0x0c90('0x31')]){case _0x0c90('0x56'):logger['info'](_0x0c90('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0xda4331[_0x0c90('0x38')]),_0x0c90('0x62'),{'recordId':_0x3bfd01['id']});break;case _0x0c90('0x58'):logger[_0x0c90('0xc')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x0c90('0xe')](_0x0c90('0x63'),_0xda4331[_0x0c90('0x38')]),'trigger:browser:url',{'uri':util[_0x0c90('0xe')](_0x0c90('0x64'),_0x4783e2[_0x0c90('0x10')],_0x3bfd01['id'])});break;default:logger['error'](_0x0c90('0x65'),_0x0c90('0x5c'));}}})[_0x0c90('0x5d')](function(_0x521436){logger[_0x0c90('0x5b')](_0x0c90('0x65'),JSON[_0x0c90('0x19')](_0x521436));});};exports[_0x0c90('0x66')]=function(_0xf58a25,_0x1cf0a6,_0x19f4ac,_0x143e0d,_0x181fe3,_0x558c83){var _0x530bbe,_0xd41cd2;_0x558c83[_0x0c90('0x10')]=intUtil[_0x0c90('0x47')](_0x558c83[_0x0c90('0x10')]);_0x558c83[_0x0c90('0x48')]=intUtil[_0x0c90('0x47')](_0x558c83[_0x0c90('0x48')]);if(_0x181fe3&&_0x181fe3[_0x0c90('0x49')]){logger[_0x0c90('0xc')](_0x0c90('0x67'),_0x0c90('0x4b'));_0x1cf0a6[_0x0c90('0x4c')]=util[_0x0c90('0xe')](_0x0c90('0x4d'),_0x558c83[_0x0c90('0x48')],_0x1cf0a6['uniqueid'],md5(_0x1cf0a6[_0x0c90('0x4e')]));}else{_0x1cf0a6[_0x0c90('0x4c')]='';}headers[_0x0c90('0x4f')]=getAuth(_0x558c83);return getUser(_0x558c83)['then'](function(_0x5e8aa8){_0x530bbe=_0x5e8aa8;logger[_0x0c90('0xc')]('The\x20User\x20ID\x20is:',_0x530bbe['id']);return getEndUser(_0x558c83,_0x1cf0a6[_0x0c90('0x68')],_0x1cf0a6[_0x0c90('0x52')]);})['then'](function(_0x2c64e0){_0xd41cd2=_0x2c64e0;logger[_0x0c90('0xc')](_0x0c90('0x53'),_0xd41cd2['id']);return getTicket(_0x558c83,_0x530bbe,_0xd41cd2,_0x19f4ac,_0x1cf0a6);})[_0x0c90('0x13')](function(_0x5d8ca7){if(_0x5d8ca7){logger['info']('Ticket\x20created!');logger[_0x0c90('0xc')](_0x0c90('0x55'),_0x5d8ca7['id']);}})[_0x0c90('0x5d')](function(_0x2d5fe3){logger['error'](_0x0c90('0x67'),JSON['stringify'](_0x2d5fe3));});}; \ 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 c018280..1c97c84 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 _0xda7b=['catch','error','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','email','length','info',']\x20Agent\x20found\x20','systemuserid','userId','toUpperCase','userEmail','toLowerCase','outbound','destcalleridnum','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1','value','calleridnum','telephone1',']\x20Enduser\x20Created!','forEach','type','nameField','customField','indexOf','content','incidents','assign','getString','Descriptions','/contacts(','/systemusers(','ticketType','phonecalls','Subjects','callDirection','queue','Fields','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','abandoned','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','./util','md5','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','remoteUri','username','password','clientSecret','then','access_token'];(function(_0x2399f4,_0x4e55d7){var _0x352e4c=function(_0x4798e3){while(--_0x4798e3){_0x2399f4['push'](_0x2399f4['shift']());}};_0x352e4c(++_0x4e55d7);}(_0xda7b,0x102));var _0xbda7=function(_0xf177e6,_0x42c236){_0xf177e6=_0xf177e6-0x0;var _0x2daeef=_0xda7b[_0xf177e6];return _0x2daeef;};'use strict';var _=require(_0xbda7('0x0'));var BPromise=require(_0xbda7('0x1'));var rp=require(_0xbda7('0x2'));var util=require('util');var intUtil=require(_0xbda7('0x3'));var md5=require(_0xbda7('0x4'));var Redis=require('ioredis');var logger=require(_0xbda7('0x5'))(_0xbda7('0x6'));var config=require(_0xbda7('0x7'));config[_0xbda7('0x8')]=_[_0xbda7('0x9')](config['redis'],{'host':_0xbda7('0xa'),'port':0x18eb});var io=require(_0xbda7('0xb'))(new Redis(config[_0xbda7('0x8')]));function getAuthToken(_0x481c55,_0x11dbb1,_0x1bb504){var _0x4fd949={'method':'POST','uri':_0x11dbb1,'form':{'client_id':_0x481c55['clientId'],'resource':_0x481c55[_0xbda7('0xc')],'username':_0x481c55[_0xbda7('0xd')],'password':_0x481c55[_0xbda7('0xe')],'grant_type':_0xbda7('0xe'),'client_secret':_0x481c55[_0xbda7('0xf')]},'json':!![]};return rp(_0x4fd949)[_0xbda7('0x10')](function(_0x5e790d){return _0x5e790d[_0xbda7('0x11')];})[_0xbda7('0x12')](function(_0x1c0412){logger[_0xbda7('0x13')]('['+[_0x1bb504['toUpperCase']()]+']\x20Wrong\x20credentials!');return _0x1c0412[_0xbda7('0x14')];});}function getUser(_0x3146a6,_0x5038f7,_0xed0d5f,_0x778d3e,_0x1a07ad,_0x2736aa){return new BPromise(function(_0x259609,_0xde7795){return getAuthToken(_0x5038f7,_0x778d3e,_0x2736aa)[_0xbda7('0x10')](function(_0x31b5be){var _0xcaa209={'method':_0xbda7('0x15'),'uri':_0x1a07ad+_0xbda7('0x16'),'headers':{'Authorization':_0xbda7('0x17')+_0x31b5be,'OData-Version':_0xbda7('0x18')},'json':!![]};return rp(_0xcaa209);})[_0xbda7('0x10')](function(_0x408a1a){var _0x51e730=_0x408a1a['value'];var _0x40fa83=![];var _0x594773=null;if(!_[_0xbda7('0x19')](_0xed0d5f)){if(intUtil[_0xbda7('0x1a')](_0xed0d5f[_0xbda7('0x1b')])){_0x3146a6['userEmail']=_0xed0d5f[_0xbda7('0x1b')];for(_0x594773=0x0;_0x594773<_0x51e730[_0xbda7('0x1c')];_0x594773++){if(_0x51e730[_0x594773]['internalemailaddress']===_0xed0d5f[_0xbda7('0x1b')]&&!_0x51e730[_0x594773]['isdisabled']){_0x40fa83=!![];logger[_0xbda7('0x1d')]('['+[_0x2736aa['toUpperCase']()]+_0xbda7('0x1e')+_0x51e730[_0x594773][_0xbda7('0x1f')]+'!');_0x3146a6[_0xbda7('0x20')]=_0x51e730[_0x594773][_0xbda7('0x1f')];}}}}if(!_0x40fa83){logger[_0xbda7('0x1d')]('['+[_0x2736aa[_0xbda7('0x21')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x3146a6[_0xbda7('0x22')]=_0x5038f7['username'];for(_0x594773=0x0;_0x594773<_0x51e730['length'];_0x594773++){if(_0x51e730[_0x594773]['internalemailaddress']===_0x5038f7['username']){_0x3146a6[_0xbda7('0x20')]=_0x51e730[_0x594773][_0xbda7('0x1f')];}}}_0x259609(_0x3146a6);})[_0xbda7('0x12')](function(_0x49fd69){_0xde7795(_0x49fd69[_0xbda7('0x14')]);});});}function createEndUser(_0x6a5ef6,_0x239c60,_0x27503a,_0x4d0758,_0x17f745,_0x417e29){return new BPromise(function(_0x1add31,_0x49ed7f){return getAuthToken(_0x239c60,_0x27503a,_0x417e29)[_0xbda7('0x10')](function(_0x27a956){var _0x29bee3=_0x417e29[_0xbda7('0x23')]()===_0xbda7('0x24')?_0x17f745[_0xbda7('0x25')]:_0x17f745['calleridnum'];var _0x480785={'method':'POST','uri':_0x4d0758+'contacts','body':{'telephone1':_0x29bee3,'fullname':_0x29bee3,'firstname':_0x29bee3,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x6a5ef6[_0xbda7('0x20')]+')'},'headers':{'Authorization':_0xbda7('0x17')+_0x27a956,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x480785);})[_0xbda7('0x10')](function(_0x4157b1){var _0x462c83=_0x4157b1[_0xbda7('0x26')][_0xbda7('0x27')];var _0x1d5294=_0x462c83[_0xbda7('0x28')](_0x462c83['lastIndexOf']('(')+0x1,_0x462c83[_0xbda7('0x29')](')'));_0x6a5ef6[_0xbda7('0x2a')]=_0x1d5294;_0x1add31(_0x6a5ef6);})['catch'](function(_0x5e3d39){_0x49ed7f(_0x5e3d39[_0xbda7('0x14')]);});});}function getEndUser(_0x266a63,_0x25265f,_0x1a7869,_0x592049,_0x5bd8cb,_0x424a73){return new BPromise(function(_0x54b7b5,_0x2bfb5b){return getAuthToken(_0x25265f,_0x1a7869,_0x424a73)['then'](function(_0x5a374a){var _0x1659a8={'method':_0xbda7('0x15'),'uri':_0x592049+_0xbda7('0x2b'),'headers':{'Authorization':_0xbda7('0x17')+_0x5a374a,'If-None-Match':null,'OData-Version':_0xbda7('0x18')},'json':!![]};return rp(_0x1659a8);})[_0xbda7('0x10')](function(_0x1cce83){var _0x129201=null;if(_0x1cce83){var _0xc33c4c=_0x1cce83[_0xbda7('0x2c')];var _0x5854d3=![];for(_0x129201=0x0;_0x129201<_0xc33c4c[_0xbda7('0x1c')];_0x129201++){var _0xaa1f12=_0x424a73['toLowerCase']()===_0xbda7('0x24')?_0x5bd8cb[_0xbda7('0x25')]:_0x5bd8cb[_0xbda7('0x2d')];if(_0xc33c4c[_0x129201][_0xbda7('0x2e')]===_0xaa1f12){_0x5854d3=!![];_0x266a63[_0xbda7('0x2a')]=_0xc33c4c[_0x129201]['contactid'];}}if(_0x5854d3){_0x54b7b5(_0x266a63);}else{return createEndUser(_0x266a63,_0x25265f,_0x1a7869,_0x592049,_0x5bd8cb,_0x424a73)['then'](function(_0x42a10d){logger['info']('['+[_0x424a73['toUpperCase']()]+']\x20Enduser\x20created!',_0x42a10d[_0xbda7('0x2a')]);_0x54b7b5(_0x42a10d);});}}else{return createEndUser(_0x266a63,_0x25265f,_0x1a7869,_0x592049,_0x5bd8cb,_0x424a73)[_0xbda7('0x10')](function(_0x5dd8b4){logger['info']('['+[_0x424a73[_0xbda7('0x21')]()]+_0xbda7('0x2f'),_0x5dd8b4[_0xbda7('0x2a')]);_0x54b7b5(_0x5dd8b4);});}});});}function getCustomFields(_0x187ae3,_0x28cb4d,_0x308b0f){var _0x3562e9={};if(_0x187ae3[_0xbda7('0x1c')]>0x0){_[_0xbda7('0x30')](_0x187ae3,function(_0x3e25b1){if(_0x3e25b1[_0xbda7('0x31')]==='string'&&_0x3e25b1[_0xbda7('0x32')]&&!_0x3e25b1[_0xbda7('0x33')]){var _0x1fee3f=_0x3e25b1['idField'][_0xbda7('0x23')]();var _0x2cfd4d=_0x1fee3f[_0xbda7('0x28')](0x0,_0x1fee3f[_0xbda7('0x34')]('_'));var _0x4710ca=_0x1fee3f['substring'](_0x1fee3f[_0xbda7('0x34')]('_')+0x1);if(_0x2cfd4d===_0x308b0f){_0x3562e9[_0x4710ca]=_0x3e25b1[_0xbda7('0x35')];}}});}return _0x3562e9;}function getTicket(_0xfd7615,_0xe1b5d5,_0x19ebb8,_0x559506,_0x2363c1,_0x569cc0,_0x1370ec){return new BPromise(function(_0x45bfe2,_0x57cb1a){var _0x200b24;return getAuthToken(_0xe1b5d5,_0x19ebb8,_0x1370ec)[_0xbda7('0x10')](function(_0x23f54a){if(_0x569cc0['ticketType']==='incident'){_0x200b24={'method':'POST','uri':_0x559506+_0xbda7('0x36'),'body':Object[_0xbda7('0x37')]({},{'title':intUtil[_0xbda7('0x38')](_0x569cc0['Subjects'],_0x2363c1,'\x20'),'description':intUtil['getString'](_0x569cc0[_0xbda7('0x39')],_0x2363c1,'\x0a'),'customerid_contact@odata.bind':_0xbda7('0x3a')+_0xfd7615[_0xbda7('0x2a')]+')','ownerid@odata.bind':_0xbda7('0x3b')+_0xfd7615[_0xbda7('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x569cc0['Fields'],_0x2363c1,_0x569cc0[_0xbda7('0x3c')])),'headers':{'Authorization':_0xbda7('0x17')+_0x23f54a,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x569cc0[_0xbda7('0x3c')]==='phonecall'){_0x200b24={'method':'POST','uri':_0x559506+_0xbda7('0x3d'),'body':Object[_0xbda7('0x37')]({},{'subject':intUtil[_0xbda7('0x38')](_0x569cc0[_0xbda7('0x3e')],_0x2363c1,'\x20'),'phonenumber':String(_0x2363c1[_0xbda7('0x2d')]),'description':intUtil[_0xbda7('0x38')](_0x569cc0[_0xbda7('0x39')],_0x2363c1,'\x0a'),'regardingobjectid_contact@odata.bind':_0xbda7('0x3a')+_0xfd7615[_0xbda7('0x2a')]+')','ownerid@odata.bind':_0xbda7('0x3b')+_0xfd7615[_0xbda7('0x20')]+')','directioncode':_0xfd7615[_0xbda7('0x3f')]===_0xbda7('0x40')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xbda7('0x3b')+_0xfd7615[_0xbda7('0x20')]+')','participationtypemask':_0xfd7615[_0xbda7('0x3f')]===_0xbda7('0x40')?0x2:0x1},{'partyid_contact@odata.bind':_0xbda7('0x3a')+_0xfd7615[_0xbda7('0x2a')]+')','participationtypemask':_0xfd7615[_0xbda7('0x3f')]===_0xbda7('0x40')?0x1:0x2}]},getCustomFields(_0x569cc0[_0xbda7('0x41')],_0x2363c1,_0x569cc0[_0xbda7('0x3c')])),'headers':{'Authorization':_0xbda7('0x17')+_0x23f54a,'OData-Version':_0xbda7('0x18')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x200b24);})[_0xbda7('0x10')](function(_0xd4930d){var _0x420a11=_0xd4930d[_0xbda7('0x26')][_0xbda7('0x27')];var _0x487bab=_0x420a11[_0xbda7('0x28')](_0x420a11['lastIndexOf']('(')+0x1,_0x420a11[_0xbda7('0x29')](')'));_0xfd7615[_0xbda7('0x42')]=_0x487bab;_0x45bfe2(_0xfd7615);})[_0xbda7('0x12')](function(_0x3f8d9d){_0x57cb1a(_0x3f8d9d[_0xbda7('0x14')]);});});}function emit(_0x3847af,_0x3c551c,_0x2ec36e,_0x149a6f){var _0x28d513={'uri':util[_0xbda7('0x43')](_0xbda7('0x44'),_0x3847af,_0x2ec36e,_0x149a6f)};io['to'](util['format']('user:%s',_0x3c551c))[_0xbda7('0x45')](_0xbda7('0x46'),_0x28d513);}exports['cs']=function(_0x1512fc,_0x41a897,_0x236caf,_0x125ee8,_0x3f6cc1,_0x3f842b,_0x2d055a,_0x523f69){var _0x4d8d34={};_0x3f842b[_0xbda7('0xc')]=intUtil[_0xbda7('0x47')](_0x3f842b['remoteUri']);_0x3f842b[_0xbda7('0x48')]=intUtil[_0xbda7('0x47')](_0x3f842b[_0xbda7('0x48')]);_0x4d8d34['callDirection']=_0x523f69===_0xbda7('0x40')||_0x523f69===_0xbda7('0x49')?_0xbda7('0x40'):_0xbda7('0x24');var _0xf4d39a=util[_0xbda7('0x43')](_0xbda7('0x4a'),_0x3f842b[_0xbda7('0xc')]);var _0x238ebd=util[_0xbda7('0x43')](_0xbda7('0x4b'),_0x3f842b[_0xbda7('0x4c')]);var _0x17cc07=util[_0xbda7('0x43')](_0xbda7('0x4d'),_0x3f842b['serverUrl'],_0x41a897[_0xbda7('0x4e')],md5(_0x41a897[_0xbda7('0x4e')]));if(_0x3f6cc1&&_0x3f6cc1[_0xbda7('0x4f')]){logger[_0xbda7('0x1d')]('[QUEUE]',_0xbda7('0x50'));_0x41a897['recordingURL']=_0x17cc07;}else if(_0x2d055a&&_0x2d055a[_0xbda7('0x51')]&&_0x2d055a[_0xbda7('0x51')]!==_0xbda7('0x52')){logger['info'](_0xbda7('0x53'),_0xbda7('0x50'));_0x41a897[_0xbda7('0x54')]=_0x17cc07;}else{_0x41a897[_0xbda7('0x54')]='';}return getUser(_0x4d8d34,_0x3f842b,_0x125ee8,_0x238ebd,_0xf4d39a,_0x523f69)['then'](function(_0x4852e5){logger['info']('['+_0x523f69[_0xbda7('0x21')]()+_0xbda7('0x55'),_0x4852e5[_0xbda7('0x20')]);logger[_0xbda7('0x1d')]('['+_0x523f69[_0xbda7('0x21')]()+_0xbda7('0x56'),_0x4852e5[_0xbda7('0x22')]);return getEndUser(_0x4852e5,_0x3f842b,_0x238ebd,_0xf4d39a,_0x41a897,_0x523f69);})[_0xbda7('0x10')](function(_0x39db27){logger['info']('['+_0x523f69[_0xbda7('0x21')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x39db27[_0xbda7('0x2a')]);logger[_0xbda7('0x1d')]('['+_0x523f69[_0xbda7('0x21')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x41a897[_0xbda7('0x2d')]);return getTicket(_0x39db27,_0x3f842b,_0x238ebd,_0xf4d39a,_0x41a897,_0x236caf,_0x523f69);})['then'](function(_0x2cd5ab){logger['info'](util[_0xbda7('0x43')]('['+_0x523f69[_0xbda7('0x21')]()+_0xbda7('0x57'),_0x236caf[_0xbda7('0x3c')],_0x2cd5ab['ticketId']));logger[_0xbda7('0x1d')](util[_0xbda7('0x43')]('['+_0x523f69[_0xbda7('0x21')]()+_0xbda7('0x58'),_0x523f69));if(_0x523f69!=='abandoned'){logger['info']('['+_0x523f69[_0xbda7('0x21')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x3f842b[_0xbda7('0xc')],_0x125ee8[_0xbda7('0x59')],_0x236caf['ticketType'],_0x2cd5ab[_0xbda7('0x42')]);}})[_0xbda7('0x12')](function(_0x376e91){logger['error']('['+_0x523f69['toUpperCase']()+_0xbda7('0x5a'),util[_0xbda7('0x5b')](_0x376e91,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xf189=[']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','catch','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','then','headers','substring','lastIndexOf','contacts?$select=telephone1','enduserId','contactid',']\x20Enduser\x20Created!','forEach','type','string','customField','idField','indexOf','ticketType','incident','incidents','assign','Subjects','getString','Descriptions','/contacts(','/systemusers(','phonecall','phonecalls','queue','callDirection','Fields','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','none','Recording\x20is\x20enabled!',']\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','abandoned','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','util','./util','md5','ioredis','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','password','access_token','error'];(function(_0x1b2d79,_0x536240){var _0x555155=function(_0xa12c98){while(--_0xa12c98){_0x1b2d79['push'](_0x1b2d79['shift']());}};_0x555155(++_0x536240);}(_0xf189,0x10e));var _0x9f18=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf189[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x9f18('0x0'));var BPromise=require(_0x9f18('0x1'));var rp=require('request-promise');var util=require(_0x9f18('0x2'));var intUtil=require(_0x9f18('0x3'));var md5=require(_0x9f18('0x4'));var Redis=require(_0x9f18('0x5'));var logger=require('../../../../config/logger')(_0x9f18('0x6'));var config=require(_0x9f18('0x7'));config[_0x9f18('0x8')]=_[_0x9f18('0x9')](config['redis'],{'host':_0x9f18('0xa'),'port':0x18eb});var io=require(_0x9f18('0xb'))(new Redis(config['redis']));function getAuthToken(_0x4edb0f,_0x5d52db,_0x3f1ac2){var _0x4be7c5={'method':_0x9f18('0xc'),'uri':_0x5d52db,'form':{'client_id':_0x4edb0f[_0x9f18('0xd')],'resource':_0x4edb0f[_0x9f18('0xe')],'username':_0x4edb0f['username'],'password':_0x4edb0f[_0x9f18('0xf')],'grant_type':_0x9f18('0xf'),'client_secret':_0x4edb0f['clientSecret']},'json':!![]};return rp(_0x4be7c5)['then'](function(_0x33493e){return _0x33493e[_0x9f18('0x10')];})['catch'](function(_0x3ac8d6){logger[_0x9f18('0x11')]('['+[_0x3f1ac2['toUpperCase']()]+_0x9f18('0x12'));return _0x3ac8d6[_0x9f18('0x13')];});}function getUser(_0x4364fb,_0x17514d,_0x210a49,_0x57d88f,_0x296e26,_0x56b35c){return new BPromise(function(_0x7e0d2f,_0x4f2c4b){return getAuthToken(_0x17514d,_0x57d88f,_0x56b35c)['then'](function(_0x49b1ae){var _0x2c4e4b={'method':_0x9f18('0x14'),'uri':_0x296e26+_0x9f18('0x15'),'headers':{'Authorization':_0x9f18('0x16')+_0x49b1ae,'OData-Version':_0x9f18('0x17')},'json':!![]};return rp(_0x2c4e4b);})['then'](function(_0x529a56){var _0x4628fc=_0x529a56[_0x9f18('0x18')];var _0x4304fb=![];var _0x561c38=null;if(!_['isNil'](_0x210a49)){if(intUtil[_0x9f18('0x19')](_0x210a49[_0x9f18('0x1a')])){_0x4364fb[_0x9f18('0x1b')]=_0x210a49[_0x9f18('0x1a')];for(_0x561c38=0x0;_0x561c38<_0x4628fc[_0x9f18('0x1c')];_0x561c38++){if(_0x4628fc[_0x561c38][_0x9f18('0x1d')]===_0x210a49[_0x9f18('0x1a')]&&!_0x4628fc[_0x561c38][_0x9f18('0x1e')]){_0x4304fb=!![];logger[_0x9f18('0x1f')]('['+[_0x56b35c[_0x9f18('0x20')]()]+_0x9f18('0x21')+_0x4628fc[_0x561c38][_0x9f18('0x22')]+'!');_0x4364fb[_0x9f18('0x23')]=_0x4628fc[_0x561c38][_0x9f18('0x22')];}}}}if(!_0x4304fb){logger[_0x9f18('0x1f')]('['+[_0x56b35c[_0x9f18('0x20')]()]+_0x9f18('0x24'));_0x4364fb['userEmail']=_0x17514d['username'];for(_0x561c38=0x0;_0x561c38<_0x4628fc[_0x9f18('0x1c')];_0x561c38++){if(_0x4628fc[_0x561c38][_0x9f18('0x1d')]===_0x17514d[_0x9f18('0x25')]){_0x4364fb[_0x9f18('0x23')]=_0x4628fc[_0x561c38]['systemuserid'];}}}_0x7e0d2f(_0x4364fb);})[_0x9f18('0x26')](function(_0xf90b19){_0x4f2c4b(_0xf90b19[_0x9f18('0x13')]);});});}function createEndUser(_0xee801c,_0x2a6dca,_0x349b12,_0x20d5bd,_0xb7f7b9,_0x368ea){return new BPromise(function(_0xa8d019,_0x45b17c){return getAuthToken(_0x2a6dca,_0x349b12,_0x368ea)['then'](function(_0x17fb1d){var _0x475c38=_0x368ea[_0x9f18('0x27')]()===_0x9f18('0x28')?_0xb7f7b9[_0x9f18('0x29')]:_0xb7f7b9[_0x9f18('0x2a')];var _0xb685ff={'method':_0x9f18('0xc'),'uri':_0x20d5bd+_0x9f18('0x2b'),'body':{'telephone1':_0x475c38,'fullname':_0x475c38,'firstname':_0x475c38,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0xee801c[_0x9f18('0x23')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x17fb1d,'OData-Version':_0x9f18('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0xb685ff);})[_0x9f18('0x2c')](function(_0x2211e5){var _0x5411ee=_0x2211e5[_0x9f18('0x2d')]['odata-entityid'];var _0x385313=_0x5411ee[_0x9f18('0x2e')](_0x5411ee['lastIndexOf']('(')+0x1,_0x5411ee[_0x9f18('0x2f')](')'));_0xee801c['enduserId']=_0x385313;_0xa8d019(_0xee801c);})[_0x9f18('0x26')](function(_0x12f5c3){_0x45b17c(_0x12f5c3['message']);});});}function getEndUser(_0x5752ae,_0x9faced,_0x23af25,_0x35a6a6,_0x3e027d,_0x58e482){return new BPromise(function(_0x2b844d,_0x1345bb){return getAuthToken(_0x9faced,_0x23af25,_0x58e482)[_0x9f18('0x2c')](function(_0x2ba961){var _0x2da051={'method':_0x9f18('0x14'),'uri':_0x35a6a6+_0x9f18('0x30'),'headers':{'Authorization':_0x9f18('0x16')+_0x2ba961,'If-None-Match':null,'OData-Version':_0x9f18('0x17')},'json':!![]};return rp(_0x2da051);})['then'](function(_0x30148a){var _0x4c22f9=null;if(_0x30148a){var _0x375ad4=_0x30148a[_0x9f18('0x18')];var _0x5a728d=![];for(_0x4c22f9=0x0;_0x4c22f9<_0x375ad4[_0x9f18('0x1c')];_0x4c22f9++){var _0x2fdd45=_0x58e482[_0x9f18('0x27')]()===_0x9f18('0x28')?_0x3e027d[_0x9f18('0x29')]:_0x3e027d[_0x9f18('0x2a')];if(_0x375ad4[_0x4c22f9]['telephone1']===_0x2fdd45){_0x5a728d=!![];_0x5752ae[_0x9f18('0x31')]=_0x375ad4[_0x4c22f9][_0x9f18('0x32')];}}if(_0x5a728d){_0x2b844d(_0x5752ae);}else{return createEndUser(_0x5752ae,_0x9faced,_0x23af25,_0x35a6a6,_0x3e027d,_0x58e482)[_0x9f18('0x2c')](function(_0x5699e2){logger['info']('['+[_0x58e482[_0x9f18('0x20')]()]+']\x20Enduser\x20created!',_0x5699e2[_0x9f18('0x31')]);_0x2b844d(_0x5699e2);});}}else{return createEndUser(_0x5752ae,_0x9faced,_0x23af25,_0x35a6a6,_0x3e027d,_0x58e482)[_0x9f18('0x2c')](function(_0xf69938){logger[_0x9f18('0x1f')]('['+[_0x58e482['toUpperCase']()]+_0x9f18('0x33'),_0xf69938[_0x9f18('0x31')]);_0x2b844d(_0xf69938);});}});});}function getCustomFields(_0x29943b,_0xc266e9,_0x41489f){var _0x22b0bf={};if(_0x29943b['length']>0x0){_[_0x9f18('0x34')](_0x29943b,function(_0x1a6a8e){if(_0x1a6a8e[_0x9f18('0x35')]===_0x9f18('0x36')&&_0x1a6a8e['nameField']&&!_0x1a6a8e[_0x9f18('0x37')]){var _0x2b3d9f=_0x1a6a8e[_0x9f18('0x38')][_0x9f18('0x27')]();var _0x3d655a=_0x2b3d9f['substring'](0x0,_0x2b3d9f[_0x9f18('0x39')]('_'));var _0x1bed66=_0x2b3d9f[_0x9f18('0x2e')](_0x2b3d9f['indexOf']('_')+0x1);if(_0x3d655a===_0x41489f){_0x22b0bf[_0x1bed66]=_0x1a6a8e['content'];}}});}return _0x22b0bf;}function getTicket(_0x2458d5,_0x4c99a8,_0xe1917b,_0x3f4f0f,_0xbbf20c,_0x59b33d,_0x11c10f){return new BPromise(function(_0x5593d9,_0x53ca87){var _0x48ba23;return getAuthToken(_0x4c99a8,_0xe1917b,_0x11c10f)[_0x9f18('0x2c')](function(_0x5a33e5){if(_0x59b33d[_0x9f18('0x3a')]===_0x9f18('0x3b')){_0x48ba23={'method':'POST','uri':_0x3f4f0f+_0x9f18('0x3c'),'body':Object[_0x9f18('0x3d')]({},{'title':intUtil['getString'](_0x59b33d[_0x9f18('0x3e')],_0xbbf20c,'\x20'),'description':intUtil[_0x9f18('0x3f')](_0x59b33d[_0x9f18('0x40')],_0xbbf20c,'\x0a'),'customerid_contact@odata.bind':_0x9f18('0x41')+_0x2458d5[_0x9f18('0x31')]+')','ownerid@odata.bind':_0x9f18('0x42')+_0x2458d5['userId']+')','caseorigincode':'1'},getCustomFields(_0x59b33d['Fields'],_0xbbf20c,_0x59b33d[_0x9f18('0x3a')])),'headers':{'Authorization':_0x9f18('0x16')+_0x5a33e5,'OData-Version':_0x9f18('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x59b33d[_0x9f18('0x3a')]===_0x9f18('0x43')){_0x48ba23={'method':_0x9f18('0xc'),'uri':_0x3f4f0f+_0x9f18('0x44'),'body':Object[_0x9f18('0x3d')]({},{'subject':intUtil['getString'](_0x59b33d[_0x9f18('0x3e')],_0xbbf20c,'\x20'),'phonenumber':String(_0xbbf20c[_0x9f18('0x2a')]),'description':intUtil[_0x9f18('0x3f')](_0x59b33d[_0x9f18('0x40')],_0xbbf20c,'\x0a'),'regardingobjectid_contact@odata.bind':_0x9f18('0x41')+_0x2458d5[_0x9f18('0x31')]+')','ownerid@odata.bind':'/systemusers('+_0x2458d5[_0x9f18('0x23')]+')','directioncode':_0x2458d5['callDirection']===_0x9f18('0x45')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x9f18('0x42')+_0x2458d5['userId']+')','participationtypemask':_0x2458d5[_0x9f18('0x46')]===_0x9f18('0x45')?0x2:0x1},{'partyid_contact@odata.bind':_0x9f18('0x41')+_0x2458d5[_0x9f18('0x31')]+')','participationtypemask':_0x2458d5['callDirection']==='queue'?0x1:0x2}]},getCustomFields(_0x59b33d[_0x9f18('0x47')],_0xbbf20c,_0x59b33d[_0x9f18('0x3a')])),'headers':{'Authorization':_0x9f18('0x16')+_0x5a33e5,'OData-Version':_0x9f18('0x17')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x48ba23);})['then'](function(_0x156a19){var _0x13bf48=_0x156a19['headers']['odata-entityid'];var _0x48c025=_0x13bf48[_0x9f18('0x2e')](_0x13bf48[_0x9f18('0x2f')]('(')+0x1,_0x13bf48['lastIndexOf'](')'));_0x2458d5[_0x9f18('0x48')]=_0x48c025;_0x5593d9(_0x2458d5);})[_0x9f18('0x26')](function(_0x54b7ef){_0x53ca87(_0x54b7ef[_0x9f18('0x13')]);});});}function emit(_0x27c18e,_0x179da8,_0x256aad,_0x6dbfc4){var _0x1ea5c7={'uri':util[_0x9f18('0x49')](_0x9f18('0x4a'),_0x27c18e,_0x256aad,_0x6dbfc4)};io['to'](util[_0x9f18('0x49')]('user:%s',_0x179da8))[_0x9f18('0x4b')](_0x9f18('0x4c'),_0x1ea5c7);}exports['cs']=function(_0x39ccc0,_0x6ae438,_0x46fb90,_0x24bdcf,_0x1f709d,_0x222b90,_0x22d09d,_0xabbb89){var _0x2ba236={};_0x222b90['remoteUri']=intUtil[_0x9f18('0x4d')](_0x222b90[_0x9f18('0xe')]);_0x222b90[_0x9f18('0x4e')]=intUtil[_0x9f18('0x4d')](_0x222b90[_0x9f18('0x4e')]);_0x2ba236[_0x9f18('0x46')]=_0xabbb89==='queue'||_0xabbb89==='abandoned'?'queue':_0x9f18('0x28');var _0x5983d3=util[_0x9f18('0x49')]('%s/api/data/v9.0/',_0x222b90[_0x9f18('0xe')]);var _0x46e6b0=util[_0x9f18('0x49')]('https://login.microsoftonline.com/%s/oauth2/token',_0x222b90[_0x9f18('0x4f')]);var _0x177f32=util[_0x9f18('0x49')](_0x9f18('0x50'),_0x222b90[_0x9f18('0x4e')],_0x6ae438['uniqueid'],md5(_0x6ae438[_0x9f18('0x51')]));if(_0x1f709d&&_0x1f709d[_0x9f18('0x52')]){logger[_0x9f18('0x1f')]('[QUEUE]','Recording\x20is\x20enabled!');_0x6ae438[_0x9f18('0x53')]=_0x177f32;}else if(_0x22d09d&&_0x22d09d['recordingFormat']&&_0x22d09d['recordingFormat']!==_0x9f18('0x54')){logger[_0x9f18('0x1f')]('[OUTBOUND]',_0x9f18('0x55'));_0x6ae438['recordingURL']=_0x177f32;}else{_0x6ae438[_0x9f18('0x53')]='';}return getUser(_0x2ba236,_0x222b90,_0x24bdcf,_0x46e6b0,_0x5983d3,_0xabbb89)[_0x9f18('0x2c')](function(_0x276f5b){logger[_0x9f18('0x1f')]('['+_0xabbb89['toUpperCase']()+_0x9f18('0x56'),_0x276f5b[_0x9f18('0x23')]);logger[_0x9f18('0x1f')]('['+_0xabbb89[_0x9f18('0x20')]()+_0x9f18('0x57'),_0x276f5b[_0x9f18('0x1b')]);return getEndUser(_0x276f5b,_0x222b90,_0x46e6b0,_0x5983d3,_0x6ae438,_0xabbb89);})['then'](function(_0x4edb43){logger[_0x9f18('0x1f')]('['+_0xabbb89[_0x9f18('0x20')]()+_0x9f18('0x58'),_0x4edb43['enduserId']);logger[_0x9f18('0x1f')]('['+_0xabbb89['toUpperCase']()+_0x9f18('0x59'),_0x6ae438[_0x9f18('0x2a')]);return getTicket(_0x4edb43,_0x222b90,_0x46e6b0,_0x5983d3,_0x6ae438,_0x46fb90,_0xabbb89);})['then'](function(_0x4bef2a){logger['info'](util['format']('['+_0xabbb89[_0x9f18('0x20')]()+_0x9f18('0x5a'),_0x46fb90[_0x9f18('0x3a')],_0x4bef2a[_0x9f18('0x48')]));logger['info'](util[_0x9f18('0x49')]('['+_0xabbb89[_0x9f18('0x20')]()+_0x9f18('0x5b'),_0xabbb89));if(_0xabbb89!==_0x9f18('0x5c')){logger[_0x9f18('0x1f')]('['+_0xabbb89[_0x9f18('0x20')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x222b90[_0x9f18('0xe')],_0x24bdcf[_0x9f18('0x5d')],_0x46fb90[_0x9f18('0x3a')],_0x4bef2a['ticketId']);}})[_0x9f18('0x26')](function(_0x23fb5c){logger['error']('['+_0xabbb89[_0x9f18('0x20')]()+_0x9f18('0x5e'),util[_0x9f18('0x5f')](_0x23fb5c,{'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 804a1e1..48912f4 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 _0x5252=['util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','
','Tags','name','Fields','custom_fields','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','type','string','nameField','customField','toLowerCase','idField','content','variable','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','stringify','outbound','recordingFormat','none','destcalleridnum','The\x20Enduser\x20ID\x20is:','user:%s','[OUTBOUND]','abandoned','Authorization','[ABANDONED]','md5'];(function(_0x25a574,_0x932152){var _0x2e0f19=function(_0x5b75a3){while(--_0x5b75a3){_0x25a574['push'](_0x25a574['shift']());}};_0x2e0f19(++_0x932152);}(_0x5252,0x1b2));var _0x2525=function(_0xbecea,_0x905b78){_0xbecea=_0xbecea-0x0;var _0x5aed20=_0x5252[_0xbecea];return _0x5aed20;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x2525('0x0'));var util=require(_0x2525('0x1'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x2525('0x2'));var logger=require(_0x2525('0x3'))(_0x2525('0x4'));config[_0x2525('0x5')]=_[_0x2525('0x6')](config[_0x2525('0x5')],{'host':_0x2525('0x7'),'port':0x18eb});var io=require(_0x2525('0x8'))(new Redis(config[_0x2525('0x5')]));var headers={'Content-Type':_0x2525('0x9'),'Accept':_0x2525('0x9')};function emit(_0x4f6f80,_0xcca4bf,_0x3a7e49){io['to'](_0x4f6f80)['emit'](_0xcca4bf,_0x3a7e49);}function getTicket(_0x5c16c1,_0x3d8c57,_0x5ca5fa,_0x12f126,_0x200b24){logger[_0x2525('0xa')](_0x2525('0xb'));var _0x28a669=_[_0x2525('0xc')]({'responder_id':_0x3d8c57['id'],'requester_id':_0x5ca5fa['id'],'name':util[_0x2525('0xd')](_0x2525('0xe'),_0x200b24[_0x2525('0xf')]),'phone':_0x200b24[_0x2525('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x2525('0x11')](_0x12f126['Subjects'],_0x200b24,'\x20'),'description':intUtil[_0x2525('0x11')](_0x12f126[_0x2525('0x12')],_0x200b24,_0x2525('0x13')),'tags':getTags(_0x12f126[_0x2525('0x14')],_0x2525('0x15'))},getCustomFields(_0x12f126[_0x2525('0x16')],_0x200b24));_0x28a669[_0x2525('0x17')]=_['mapValues'](_[_0x2525('0x18')](_0x28a669[_0x2525('0x17')],'id'),_0x2525('0x19'));return request({'uri':util['format'](_0x2525('0x1a'),_0x5c16c1[_0x2525('0x1b')]),'method':_0x2525('0x1c'),'body':_0x28a669})[_0x2525('0x1d')](function(_0x5d98c0){logger['info'](_0x2525('0x1e'));return _0x5d98c0;});}function getUser(_0xa06f66,_0xcd159e){if(intUtil[_0x2525('0x1f')](_0xcd159e)){return request({'uri':util[_0x2525('0xd')](_0x2525('0x20'),_0xa06f66[_0x2525('0x1b')]),'qs':{'email':_0xcd159e}})[_0x2525('0x1d')](function(_0x1eed65){if(_0x1eed65[_0x2525('0x21')]){logger[_0x2525('0xa')]('Agent\x20found!');return _[_0x2525('0x22')](_0x1eed65,function(_0x18147c){return _0x18147c['contact']['email']===_0xcd159e;});}else{logger[_0x2525('0xa')](_0x2525('0x23'));return request({'uri':util[_0x2525('0xd')](_0x2525('0x24'),_0xa06f66[_0x2525('0x1b')])})[_0x2525('0x1d')](function(_0x503917){logger[_0x2525('0xa')]('Admin\x20account\x20selected.');return _0x503917;});}});}else{logger[_0x2525('0xa')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x2525('0xd')]('%s/api/v2/agents/me',_0xa06f66['remoteUri'])})[_0x2525('0x1d')](function(_0x32555c){logger['info']('Admin\x20account\x20selected.');return _0x32555c;});}}function getEndUser(_0x40eb21,_0x438553,_0x39e763){logger[_0x2525('0xa')]('Searching\x20enduser\x20with\x20phone',_0x39e763);return request({'uri':util[_0x2525('0xd')](_0x2525('0x25'),_0x40eb21['remoteUri']),'qs':{'phone':_0x39e763}})['then'](function(_0x39f9c6){if(_0x39f9c6['length']){logger['info'](_0x2525('0x26'));return _[_0x2525('0x22')](_0x39f9c6,{'phone':_0x39e763});}else{logger[_0x2525('0xa')](_0x2525('0x27'));return request({'uri':util[_0x2525('0xd')]('%s/api/v2/contacts',_0x40eb21['remoteUri']),'method':'POST','body':{'name':_0x438553,'phone':_0x39e763}})[_0x2525('0x1d')](function(_0xee7503){logger['info'](_0x2525('0x28'));return _0xee7503;});}});}function getAuth(_0x31201a){return util[_0x2525('0xd')](_0x2525('0x29'),new Buffer(_0x31201a[_0x2525('0x2a')]+':X')[_0x2525('0x2b')](_0x2525('0x2c')));}function request(_0x3da49b){logger[_0x2525('0x2d')](_0x2525('0x2e'),JSON['stringify'](_0x3da49b));return rp(_[_0x2525('0x6')](_0x3da49b,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x1e53d5,_0x50f0bf){var _0x16c364=[];if(_0x1e53d5&&_0x1e53d5[_0x2525('0x21')]>0x0){_0x16c364=_['map'](_0x1e53d5,_0x50f0bf);}return _0x16c364;}function getCustomFields(_0x47bb94,_0x35451c){var _0x1f3bbb=[];var _0x278bb2={'custom_fields':[]};if(_0x47bb94[_0x2525('0x21')]>0x0){_['forEach'](_0x47bb94,function(_0x5c0d2f){if(_0x5c0d2f[_0x2525('0x2f')]===_0x2525('0x30')&&_0x5c0d2f[_0x2525('0x31')]&&!_0x5c0d2f[_0x2525('0x32')]){_0x278bb2[_0x5c0d2f['nameField'][_0x2525('0x33')]()]=_0x5c0d2f['content'][_0x2525('0x2b')]();}else if(_0x5c0d2f['type']==='string'&&_0x5c0d2f[_0x2525('0x34')]&&_0x5c0d2f[_0x2525('0x32')]){_0x278bb2[_0x2525('0x17')]['push']({'id':_0x5c0d2f[_0x2525('0x34')],'value':_0x5c0d2f[_0x2525('0x35')][_0x2525('0x2b')]()});}else if(_0x5c0d2f[_0x2525('0x2f')]===_0x2525('0x36')&&_0x5c0d2f[_0x2525('0x37')]&&_0x5c0d2f[_0x2525('0x34')]&&_0x5c0d2f[_0x2525('0x32')]){_0x35451c[_0x5c0d2f[_0x2525('0x37')]]&&_0x278bb2[_0x2525('0x17')][_0x2525('0x38')]({'id':_0x5c0d2f['idField'],'value':_0x35451c[_0x5c0d2f[_0x2525('0x37')]][_0x2525('0x2b')]()});}else if(_0x5c0d2f[_0x2525('0x2f')]===_0x2525('0x39')&&_0x5c0d2f['Variable']&&_0x5c0d2f[_0x2525('0x3a')][_0x2525('0x15')]&&_0x5c0d2f[_0x2525('0x34')]&&_0x5c0d2f['customField']){_0x35451c[_0x5c0d2f['Variable']['name']['toLowerCase']()]&&_0x278bb2['custom_fields'][_0x2525('0x38')]({'id':_0x5c0d2f['idField'],'value':_0x35451c[_0x5c0d2f[_0x2525('0x3a')][_0x2525('0x15')][_0x2525('0x33')]()]['toString']()});}});}return _0x278bb2;}exports[_0x2525('0x3b')]=function(_0x225f33,_0x5e6143,_0x1c7380,_0x542e61,_0x4a564f,_0x23ac21){var _0x41a391,_0x498f10;_0x23ac21[_0x2525('0x1b')]=intUtil[_0x2525('0x3c')](_0x23ac21[_0x2525('0x1b')]);_0x23ac21[_0x2525('0x3d')]=intUtil['stripTrailingSlash'](_0x23ac21[_0x2525('0x3d')]);if(_0x4a564f&&_0x4a564f[_0x2525('0x3e')]){logger[_0x2525('0xa')](_0x2525('0x3f'),_0x2525('0x40'));_0x5e6143['recordingURL']=util[_0x2525('0xd')](_0x2525('0x41'),_0x23ac21[_0x2525('0x3d')],_0x5e6143[_0x2525('0x42')],md5(_0x5e6143[_0x2525('0x42')]));}else{_0x5e6143[_0x2525('0x43')]='';}headers['Authorization']=getAuth(_0x23ac21);return getUser(_0x23ac21,_0x542e61[_0x2525('0x44')])[_0x2525('0x1d')](function(_0x838866){_0x41a391=_0x838866;logger[_0x2525('0xa')](_0x2525('0x45'),_0x41a391['id']);return getEndUser(_0x23ac21,_0x5e6143[_0x2525('0xf')],_0x5e6143[_0x2525('0x10')]);})[_0x2525('0x1d')](function(_0x40949f){_0x498f10=_0x40949f;logger[_0x2525('0xa')]('The\x20Enduser\x20ID\x20is:',_0x498f10['id']);return getTicket(_0x23ac21,_0x41a391,_0x498f10,_0x1c7380,_0x5e6143);})['then'](function(_0xa299fa){if(_0xa299fa&&_0xa299fa['id']){logger[_0x2525('0xa')](_0x2525('0x1e'));logger[_0x2525('0xa')](_0x2525('0x46'),_0xa299fa['id']);logger[_0x2525('0xa')](_0x2525('0x3f'),_0x2525('0x47'));emit(util[_0x2525('0xd')]('user:%s',_0x542e61[_0x2525('0x15')]),_0x2525('0x48'),{'uri':util[_0x2525('0xd')](_0x2525('0x49'),_0x23ac21[_0x2525('0x1b')],_0xa299fa['id'])});}})[_0x2525('0x4a')](function(_0xf7e7ab){logger[_0x2525('0x4b')](_0x2525('0x3f'),JSON[_0x2525('0x4c')](_0xf7e7ab));});};exports[_0x2525('0x4d')]=function(_0x5d4056,_0x4caf6a,_0x3d23c2,_0x4af050,_0x14bcf2,_0x3476af,_0x248c7a){var _0x47cbac,_0x1bb86d;_0x3476af[_0x2525('0x1b')]=intUtil[_0x2525('0x3c')](_0x3476af['remoteUri']);_0x3476af[_0x2525('0x3d')]=intUtil['stripTrailingSlash'](_0x3476af[_0x2525('0x3d')]);if(_0x248c7a&&_0x248c7a[_0x2525('0x4e')]&&_0x248c7a[_0x2525('0x4e')]!==_0x2525('0x4f')){logger[_0x2525('0xa')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4caf6a['recordingURL']=util['format'](_0x2525('0x41'),_0x3476af[_0x2525('0x3d')],_0x4caf6a[_0x2525('0x42')],md5(_0x4caf6a[_0x2525('0x42')]));}headers['Authorization']=getAuth(_0x3476af);return getUser(_0x3476af,_0x4af050[_0x2525('0x44')])[_0x2525('0x1d')](function(_0x112ae8){_0x47cbac=_0x112ae8;logger[_0x2525('0xa')](_0x2525('0x45'),_0x47cbac['id']);return getEndUser(_0x3476af,_0x4caf6a['destcalleridname'],_0x4caf6a[_0x2525('0x50')]);})[_0x2525('0x1d')](function(_0x4547a0){_0x1bb86d=_0x4547a0;logger[_0x2525('0xa')](_0x2525('0x51'),_0x1bb86d['id']);return getTicket(_0x3476af,_0x47cbac,_0x1bb86d,_0x3d23c2,_0x4caf6a);})[_0x2525('0x1d')](function(_0x53cb46){if(_0x53cb46&&_0x53cb46['id']){logger[_0x2525('0xa')]('Ticket\x20created!');logger[_0x2525('0xa')](_0x2525('0x46'),_0x53cb46['id']);logger['info']('[OUTBOUND]',_0x2525('0x47'));emit(util['format'](_0x2525('0x52'),_0x4af050[_0x2525('0x15')]),_0x2525('0x48'),{'uri':util[_0x2525('0xd')]('%s/helpdesk/tickets/%d',_0x3476af[_0x2525('0x1b')],_0x53cb46['id'])});}})[_0x2525('0x4a')](function(_0x49e605){logger[_0x2525('0x4b')](_0x2525('0x53'),JSON[_0x2525('0x4c')](_0x49e605));});};exports[_0x2525('0x54')]=function(_0x591bae,_0xffa625,_0x21d99a,_0x545d49,_0x4d2776,_0x230cd8){var _0x50dc9e,_0x7d49e4;_0x230cd8[_0x2525('0x1b')]=intUtil[_0x2525('0x3c')](_0x230cd8['remoteUri']);_0x230cd8[_0x2525('0x3d')]=intUtil[_0x2525('0x3c')](_0x230cd8['serverUrl']);if(_0x4d2776&&_0x4d2776['monitor_format']){logger['info']('[ABANDONED]','Recording\x20is\x20enabled!');_0xffa625[_0x2525('0x43')]=util[_0x2525('0xd')](_0x2525('0x41'),_0x230cd8[_0x2525('0x3d')],_0xffa625[_0x2525('0x42')],md5(_0xffa625['uniqueid']));}else{_0xffa625['recordingURL']='';}headers[_0x2525('0x55')]=getAuth(_0x230cd8);return getUser(_0x230cd8,'')['then'](function(_0x45617b){_0x50dc9e=_0x45617b;logger[_0x2525('0xa')](_0x2525('0x45'),_0x50dc9e['id']);return getEndUser(_0x230cd8,_0xffa625[_0x2525('0xf')],_0xffa625[_0x2525('0x10')]);})[_0x2525('0x1d')](function(_0x4a12de){_0x7d49e4=_0x4a12de;logger['info'](_0x2525('0x51'),_0x7d49e4['id']);return getTicket(_0x230cd8,_0x50dc9e,_0x7d49e4,_0x21d99a,_0xffa625);})[_0x2525('0x1d')](function(_0x14c353){if(_0x14c353){logger[_0x2525('0xa')](_0x2525('0x1e'));logger[_0x2525('0xa')]('The\x20Ticket\x20ID\x20is:',_0x14c353['id']);}})[_0x2525('0x4a')](function(_0x387ae2){logger[_0x2525('0x4b')](_0x2525('0x56'),JSON['stringify'](_0x387ae2));});}; \ No newline at end of file +var _0xa983=['%s/api/v2/agents','length','Agent\x20found!','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','toString','base64','[HTTP]','stringify','GET','forEach','string','nameField','toLowerCase','content','type','idField','customField','push','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','user:%s','trigger:browser:url','abandoned','[ABANDONED]','lodash','request-promise','util','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Tags','name','Fields','custom_fields','mapValues','keyBy','value','format','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail'];(function(_0x433d2e,_0x47f0d9){var _0x3bf94a=function(_0x92b7e7){while(--_0x92b7e7){_0x433d2e['push'](_0x433d2e['shift']());}};_0x3bf94a(++_0x47f0d9);}(_0xa983,0x197));var _0x3a98=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa983[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3a98('0x0'));var rp=require(_0x3a98('0x1'));var md5=require('md5');var util=require(_0x3a98('0x2'));var Redis=require(_0x3a98('0x3'));var intUtil=require(_0x3a98('0x4'));var config=require(_0x3a98('0x5'));var logger=require('../../../../config/logger')(_0x3a98('0x6'));config[_0x3a98('0x7')]=_[_0x3a98('0x8')](config[_0x3a98('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x3a98('0x9'))(new Redis(config[_0x3a98('0x7')]));var headers={'Content-Type':'application/json','Accept':_0x3a98('0xa')};function emit(_0x4a169e,_0x42f867,_0x17246c){io['to'](_0x4a169e)[_0x3a98('0xb')](_0x42f867,_0x17246c);}function getTicket(_0x3e19da,_0x39ff7c,_0x39cd3f,_0x1442ef,_0x44bdcf){logger[_0x3a98('0xc')](_0x3a98('0xd'));var _0x4d3b8d=_['merge']({'responder_id':_0x39ff7c['id'],'requester_id':_0x39cd3f['id'],'name':util['format'](_0x3a98('0xe'),_0x44bdcf[_0x3a98('0xf')]),'phone':_0x44bdcf[_0x3a98('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x3a98('0x11')](_0x1442ef[_0x3a98('0x12')],_0x44bdcf,'\x20'),'description':intUtil[_0x3a98('0x11')](_0x1442ef['Descriptions'],_0x44bdcf,'
'),'tags':getTags(_0x1442ef[_0x3a98('0x13')],_0x3a98('0x14'))},getCustomFields(_0x1442ef[_0x3a98('0x15')],_0x44bdcf));_0x4d3b8d[_0x3a98('0x16')]=_[_0x3a98('0x17')](_[_0x3a98('0x18')](_0x4d3b8d['custom_fields'],'id'),_0x3a98('0x19'));return request({'uri':util[_0x3a98('0x1a')](_0x3a98('0x1b'),_0x3e19da[_0x3a98('0x1c')]),'method':_0x3a98('0x1d'),'body':_0x4d3b8d})[_0x3a98('0x1e')](function(_0x460fe5){logger['info'](_0x3a98('0x1f'));return _0x460fe5;});}function getUser(_0x5acf7f,_0x303dae){if(intUtil[_0x3a98('0x20')](_0x303dae)){return request({'uri':util[_0x3a98('0x1a')](_0x3a98('0x21'),_0x5acf7f[_0x3a98('0x1c')]),'qs':{'email':_0x303dae}})[_0x3a98('0x1e')](function(_0x404967){if(_0x404967[_0x3a98('0x22')]){logger[_0x3a98('0xc')](_0x3a98('0x23'));return _[_0x3a98('0x24')](_0x404967,function(_0x5942fe){return _0x5942fe[_0x3a98('0x25')]['email']===_0x303dae;});}else{logger[_0x3a98('0xc')](_0x3a98('0x26'));return request({'uri':util[_0x3a98('0x1a')](_0x3a98('0x27'),_0x5acf7f[_0x3a98('0x1c')])})[_0x3a98('0x1e')](function(_0x5a7c62){logger[_0x3a98('0xc')]('Admin\x20account\x20selected.');return _0x5a7c62;});}});}else{logger['info'](_0x3a98('0x28'));return request({'uri':util[_0x3a98('0x1a')]('%s/api/v2/agents/me',_0x5acf7f[_0x3a98('0x1c')])})[_0x3a98('0x1e')](function(_0x4b9ed4){logger['info']('Admin\x20account\x20selected.');return _0x4b9ed4;});}}function getEndUser(_0x22a63f,_0x9b2e06,_0x17327c){logger[_0x3a98('0xc')]('Searching\x20enduser\x20with\x20phone',_0x17327c);return request({'uri':util[_0x3a98('0x1a')](_0x3a98('0x29'),_0x22a63f[_0x3a98('0x1c')]),'qs':{'phone':_0x17327c}})[_0x3a98('0x1e')](function(_0x20eda8){if(_0x20eda8[_0x3a98('0x22')]){logger[_0x3a98('0xc')](_0x3a98('0x2a'));return _[_0x3a98('0x24')](_0x20eda8,{'phone':_0x17327c});}else{logger[_0x3a98('0xc')](_0x3a98('0x2b'));return request({'uri':util['format'](_0x3a98('0x29'),_0x22a63f[_0x3a98('0x1c')]),'method':_0x3a98('0x1d'),'body':{'name':_0x9b2e06,'phone':_0x17327c}})['then'](function(_0x28658e){logger[_0x3a98('0xc')](_0x3a98('0x2c'));return _0x28658e;});}});}function getAuth(_0x50f54b){return util[_0x3a98('0x1a')](_0x3a98('0x2d'),new Buffer(_0x50f54b['apiKey']+':X')[_0x3a98('0x2e')](_0x3a98('0x2f')));}function request(_0x497e25){logger['debug'](_0x3a98('0x30'),JSON[_0x3a98('0x31')](_0x497e25));return rp(_[_0x3a98('0x8')](_0x497e25,{'method':_0x3a98('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x3f45ae,_0x33784b){var _0x507d46=[];if(_0x3f45ae&&_0x3f45ae[_0x3a98('0x22')]>0x0){_0x507d46=_['map'](_0x3f45ae,_0x33784b);}return _0x507d46;}function getCustomFields(_0x3a6b7f,_0x5bbcbc){var _0x451438=[];var _0x406875={'custom_fields':[]};if(_0x3a6b7f[_0x3a98('0x22')]>0x0){_[_0x3a98('0x33')](_0x3a6b7f,function(_0x45473a){if(_0x45473a['type']===_0x3a98('0x34')&&_0x45473a[_0x3a98('0x35')]&&!_0x45473a['customField']){_0x406875[_0x45473a[_0x3a98('0x35')][_0x3a98('0x36')]()]=_0x45473a[_0x3a98('0x37')][_0x3a98('0x2e')]();}else if(_0x45473a[_0x3a98('0x38')]===_0x3a98('0x34')&&_0x45473a[_0x3a98('0x39')]&&_0x45473a[_0x3a98('0x3a')]){_0x406875[_0x3a98('0x16')][_0x3a98('0x3b')]({'id':_0x45473a['idField'],'value':_0x45473a[_0x3a98('0x37')][_0x3a98('0x2e')]()});}else if(_0x45473a['type']==='variable'&&_0x45473a['variableName']&&_0x45473a[_0x3a98('0x39')]&&_0x45473a['customField']){_0x5bbcbc[_0x45473a[_0x3a98('0x3c')]]&&_0x406875[_0x3a98('0x16')][_0x3a98('0x3b')]({'id':_0x45473a[_0x3a98('0x39')],'value':_0x5bbcbc[_0x45473a[_0x3a98('0x3c')]][_0x3a98('0x2e')]()});}else if(_0x45473a[_0x3a98('0x38')]===_0x3a98('0x3d')&&_0x45473a[_0x3a98('0x3e')]&&_0x45473a[_0x3a98('0x3e')][_0x3a98('0x14')]&&_0x45473a[_0x3a98('0x39')]&&_0x45473a[_0x3a98('0x3a')]){_0x5bbcbc[_0x45473a[_0x3a98('0x3e')][_0x3a98('0x14')][_0x3a98('0x36')]()]&&_0x406875[_0x3a98('0x16')][_0x3a98('0x3b')]({'id':_0x45473a[_0x3a98('0x39')],'value':_0x5bbcbc[_0x45473a['Variable'][_0x3a98('0x14')][_0x3a98('0x36')]()][_0x3a98('0x2e')]()});}});}return _0x406875;}exports[_0x3a98('0x3f')]=function(_0x53a420,_0x495a2b,_0x3d1161,_0x4bb373,_0x205417,_0x2f0e41){var _0x54d49f,_0x67b246;_0x2f0e41[_0x3a98('0x1c')]=intUtil[_0x3a98('0x40')](_0x2f0e41[_0x3a98('0x1c')]);_0x2f0e41['serverUrl']=intUtil[_0x3a98('0x40')](_0x2f0e41[_0x3a98('0x41')]);if(_0x205417&&_0x205417[_0x3a98('0x42')]){logger['info'](_0x3a98('0x43'),_0x3a98('0x44'));_0x495a2b[_0x3a98('0x45')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2f0e41['serverUrl'],_0x495a2b['uniqueid'],md5(_0x495a2b[_0x3a98('0x46')]));}else{_0x495a2b['recordingURL']='';}headers[_0x3a98('0x47')]=getAuth(_0x2f0e41);return getUser(_0x2f0e41,_0x4bb373[_0x3a98('0x48')])[_0x3a98('0x1e')](function(_0x280ef8){_0x54d49f=_0x280ef8;logger['info']('The\x20User\x20ID\x20is:',_0x54d49f['id']);return getEndUser(_0x2f0e41,_0x495a2b[_0x3a98('0xf')],_0x495a2b[_0x3a98('0x10')]);})[_0x3a98('0x1e')](function(_0x2878e8){_0x67b246=_0x2878e8;logger[_0x3a98('0xc')](_0x3a98('0x49'),_0x67b246['id']);return getTicket(_0x2f0e41,_0x54d49f,_0x67b246,_0x3d1161,_0x495a2b);})[_0x3a98('0x1e')](function(_0x3ebb96){if(_0x3ebb96&&_0x3ebb96['id']){logger[_0x3a98('0xc')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x3ebb96['id']);logger['info']('[QUEUE]',_0x3a98('0x4a'));emit(util[_0x3a98('0x1a')]('user:%s',_0x4bb373[_0x3a98('0x14')]),'trigger:browser:url',{'uri':util[_0x3a98('0x1a')](_0x3a98('0x4b'),_0x2f0e41[_0x3a98('0x1c')],_0x3ebb96['id'])});}})[_0x3a98('0x4c')](function(_0x5b2aed){logger[_0x3a98('0x4d')]('[QUEUE]',JSON[_0x3a98('0x31')](_0x5b2aed));});};exports['outbound']=function(_0xd44733,_0x2f7997,_0x579315,_0xac37dc,_0x2e5523,_0x5a5356,_0x44b6da){var _0x31cbde,_0xfb8487;_0x5a5356['remoteUri']=intUtil[_0x3a98('0x40')](_0x5a5356['remoteUri']);_0x5a5356[_0x3a98('0x41')]=intUtil[_0x3a98('0x40')](_0x5a5356[_0x3a98('0x41')]);if(_0x44b6da&&_0x44b6da[_0x3a98('0x4e')]&&_0x44b6da[_0x3a98('0x4e')]!==_0x3a98('0x4f')){logger['info']('[OUTBOUND]',_0x3a98('0x44'));_0x2f7997['recordingURL']=util[_0x3a98('0x1a')](_0x3a98('0x50'),_0x5a5356[_0x3a98('0x41')],_0x2f7997[_0x3a98('0x46')],md5(_0x2f7997['uniqueid']));}headers[_0x3a98('0x47')]=getAuth(_0x5a5356);return getUser(_0x5a5356,_0xac37dc['email'])['then'](function(_0x503ad3){_0x31cbde=_0x503ad3;logger[_0x3a98('0xc')](_0x3a98('0x51'),_0x31cbde['id']);return getEndUser(_0x5a5356,_0x2f7997['destcalleridname'],_0x2f7997['destcalleridnum']);})['then'](function(_0x2bcf89){_0xfb8487=_0x2bcf89;logger['info'](_0x3a98('0x49'),_0xfb8487['id']);return getTicket(_0x5a5356,_0x31cbde,_0xfb8487,_0x579315,_0x2f7997);})['then'](function(_0xd1ebe){if(_0xd1ebe&&_0xd1ebe['id']){logger[_0x3a98('0xc')](_0x3a98('0x1f'));logger[_0x3a98('0xc')](_0x3a98('0x52'),_0xd1ebe['id']);logger[_0x3a98('0xc')](_0x3a98('0x53'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3a98('0x1a')](_0x3a98('0x54'),_0xac37dc[_0x3a98('0x14')]),_0x3a98('0x55'),{'uri':util[_0x3a98('0x1a')](_0x3a98('0x4b'),_0x5a5356['remoteUri'],_0xd1ebe['id'])});}})[_0x3a98('0x4c')](function(_0x136414){logger[_0x3a98('0x4d')](_0x3a98('0x53'),JSON['stringify'](_0x136414));});};exports[_0x3a98('0x56')]=function(_0x425a4e,_0xd461a3,_0x5f4d14,_0x507009,_0x1eb36d,_0x7d88bf){var _0x4ddd14,_0x528173;_0x7d88bf[_0x3a98('0x1c')]=intUtil[_0x3a98('0x40')](_0x7d88bf[_0x3a98('0x1c')]);_0x7d88bf[_0x3a98('0x41')]=intUtil[_0x3a98('0x40')](_0x7d88bf['serverUrl']);if(_0x1eb36d&&_0x1eb36d[_0x3a98('0x42')]){logger[_0x3a98('0xc')](_0x3a98('0x57'),_0x3a98('0x44'));_0xd461a3[_0x3a98('0x45')]=util[_0x3a98('0x1a')](_0x3a98('0x50'),_0x7d88bf['serverUrl'],_0xd461a3[_0x3a98('0x46')],md5(_0xd461a3['uniqueid']));}else{_0xd461a3[_0x3a98('0x45')]='';}headers[_0x3a98('0x47')]=getAuth(_0x7d88bf);return getUser(_0x7d88bf,'')[_0x3a98('0x1e')](function(_0x48d418){_0x4ddd14=_0x48d418;logger[_0x3a98('0xc')](_0x3a98('0x51'),_0x4ddd14['id']);return getEndUser(_0x7d88bf,_0xd461a3['calleridname'],_0xd461a3[_0x3a98('0x10')]);})[_0x3a98('0x1e')](function(_0x115ac8){_0x528173=_0x115ac8;logger[_0x3a98('0xc')](_0x3a98('0x49'),_0x528173['id']);return getTicket(_0x7d88bf,_0x4ddd14,_0x528173,_0x5f4d14,_0xd461a3);})[_0x3a98('0x1e')](function(_0x48f60e){if(_0x48f60e){logger[_0x3a98('0xc')](_0x3a98('0x1f'));logger['info'](_0x3a98('0x52'),_0x48f60e['id']);}})[_0x3a98('0x4c')](function(_0x5a478a){logger['error'](_0x3a98('0x57'),JSON[_0x3a98('0x31')](_0x5a478a));});}; \ 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 41d0a36..3acf0c3 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 _0x6de3=['/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','error','/api/contacts/filters','Getting\x20contacts\x20filter','filters','forEach','name','All\x20Contacts','contacts','find','work_number','mobile_number','contactNumber','endUserId','Contact\x20found:','Contact\x20created:','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects','Descriptions','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','calleridnum','callDirection','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','bluebird','ioredis','../../../../config/logger','freshsales','defaults','socket.io-emitter','redis','GET'];(function(_0xbc9201,_0x8a58fb){var _0x2b139d=function(_0x3de53e){while(--_0x3de53e){_0xbc9201['push'](_0xbc9201['shift']());}};_0x2b139d(++_0x8a58fb);}(_0x6de3,0xa6));var _0x36de=function(_0x590606,_0x1074be){_0x590606=_0x590606-0x0;var _0x40dd57=_0x6de3[_0x590606];return _0x40dd57;};'use strict';var _=require(_0x36de('0x0'));var rp=require(_0x36de('0x1'));var md5=require(_0x36de('0x2'));var util=require(_0x36de('0x3'));var moment=require('moment');var Promise=require(_0x36de('0x4'));var Redis=require(_0x36de('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x36de('0x6'))(_0x36de('0x7'));config['redis']=_[_0x36de('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x36de('0x9'))(new Redis(config[_0x36de('0xa')]));function getAdminId(_0xd35fe0,_0xfb0479,_0x71d95,_0x45b72f){return new Promise(function(_0x331ff8,_0x223e84){var _0x1a9e96=![];var _0x308674={'method':_0x36de('0xb'),'uri':_0x45b72f+_0x36de('0xc'),'json':!![]};_0x308674[_0x36de('0xd')]=_0x71d95;logger[_0x36de('0xe')](_0x36de('0xf'));return rp(_0x308674)[_0x36de('0x10')](function(_0x45cae6){if(_0x45cae6){var _0x169930=_0x45cae6[_0x36de('0x11')];var _0x1af75e=null;for(_0x1af75e=0x0;_0x1af75e<_0x169930[_0x36de('0x12')];_0x1af75e++){if(_0x169930[_0x1af75e][_0x36de('0x13')]===_0xd35fe0[_0x36de('0x14')]){_0xd35fe0[_0x36de('0x15')]=_0x169930[_0x1af75e]['id'];_0x1a9e96=!![];}}if(_0x1a9e96){logger[_0x36de('0xe')]('Admin\x20found:',_0xd35fe0[_0x36de('0x15')]);_0x331ff8(_0xd35fe0);}else{_0x223e84({'statusCode':0x194,'message':_0x36de('0x16')});}}else{_0x223e84({'statusCode':0x194,'message':_0x36de('0x16')});}})[_0x36de('0x17')](function(_0x585266){logger['error']('['+[_0xfb0479[_0x36de('0x18')]()]+']',_0x585266[_0x36de('0x19')]);_0x223e84(_0x585266);});});}function getUser(_0x59e92c,_0x5c1752,_0x2965dd){return function(_0x515ec7){return new Promise(function(_0x5ed257,_0x5edad9){var _0x15525d={'method':_0x36de('0xb'),'uri':_0x2965dd+'/api/selector/owners','json':!![]};_0x15525d[_0x36de('0xd')]=_0x5c1752;logger[_0x36de('0xe')](_0x36de('0x1a'));return rp(_0x15525d)[_0x36de('0x10')](function(_0x9d1086){if(_0x9d1086){var _0x1f6d62=_0x9d1086['users'];var _0x8a216=![];var _0x48e3dc=null;if(_0x515ec7[_0x36de('0x1b')]!==null){logger['info'](_0x36de('0x1c'),_0x515ec7['agentEmail']);_0x515ec7[_0x36de('0x1d')]=_0x515ec7[_0x36de('0x1b')];for(_0x48e3dc=0x0;_0x48e3dc<_0x1f6d62[_0x36de('0x12')];_0x48e3dc++){if(_0x1f6d62[_0x48e3dc][_0x36de('0x13')]===_0x515ec7[_0x36de('0x1b')]){_0x8a216=!![];_0x515ec7[_0x36de('0x1e')]=_0x1f6d62[_0x48e3dc]['id'];logger['info'](_0x36de('0x1f'),_0x515ec7[_0x36de('0x1e')]);}}}if(!_0x8a216){logger['info'](_0x36de('0x20'));_0x515ec7[_0x36de('0x1d')]=_0x515ec7['adminEmail'];_0x515ec7['userId']=_0x515ec7[_0x36de('0x15')];_0x8a216=!![];}if(_0x8a216){_0x5ed257(_0x515ec7);}else{_0x5edad9({'statusCode':0x194,'message':_0x36de('0x16')});}}else{_0x5edad9({'statusCode':0x194,'message':_0x36de('0x16')});}})['catch'](function(_0xd02e0a){logger[_0x36de('0x21')]('['+[_0x59e92c[_0x36de('0x18')]()]+']',_0xd02e0a['message']);_0x5edad9(_0xd02e0a);});});};}function getEndUser(_0x5a2bed,_0xf7e068,_0x24f6fa){return function(_0x3e1c9e){return new Promise(function(_0x5e3ca5,_0x11226c){var _0x28390b=0x0;var _0x3da86d={'method':'GET','uri':_0x24f6fa+_0x36de('0x22'),'json':!![]};_0x3da86d[_0x36de('0xd')]=_0xf7e068;logger[_0x36de('0xe')](_0x36de('0x23'));return rp(_0x3da86d)[_0x36de('0x10')](function(_0x477be8){_0x477be8[_0x36de('0x24')][_0x36de('0x25')](function(_0x4bbc05){if(_0x4bbc05[_0x36de('0x26')]===_0x36de('0x27')){_0x28390b=_0x4bbc05['id'];}});})[_0x36de('0x10')](function(){logger[_0x36de('0xe')]('Getting\x20contact\x20list');var _0x39e462={'method':_0x36de('0xb'),'uri':_0x24f6fa+'/api/contacts/view/'+_0x28390b,'json':!![]};_0x39e462[_0x36de('0xd')]=_0xf7e068;return rp(_0x39e462);})[_0x36de('0x10')](function(_0x29daa7){logger[_0x36de('0xe')]('Searching\x20contact\x20with\x20phone',_0x3e1c9e['contactNumber']);if(_0x29daa7[_0x36de('0x28')][_0x36de('0x12')]>0x0){var _0x88d1c8=_[_0x36de('0x29')](_0x29daa7[_0x36de('0x28')],function(_0xba1e53){if(_0xba1e53[_0x36de('0x2a')]===_0x3e1c9e['contactNumber']||_0xba1e53[_0x36de('0x2b')]===_0x3e1c9e[_0x36de('0x2c')]){return _0xba1e53;}});if(_0x88d1c8){_0x3e1c9e[_0x36de('0x2d')]=_0x88d1c8['id'];logger[_0x36de('0xe')](_0x36de('0x2e'),_0x3e1c9e[_0x36de('0x2d')]);_0x5e3ca5(_0x3e1c9e);}else{return createEndUser(_0x3e1c9e,_0x5a2bed,_0xf7e068,_0x24f6fa)[_0x36de('0x10')](function(_0x4651c2){logger[_0x36de('0xe')](_0x36de('0x2f'),_0x3e1c9e[_0x36de('0x2d')]);_0x5e3ca5(_0x4651c2);});}}else{return createEndUser(_0x3e1c9e,_0x5a2bed,_0xf7e068,_0x24f6fa)[_0x36de('0x10')](function(_0xf9a6dc){logger[_0x36de('0xe')](_0x36de('0x2f'),_0x3e1c9e[_0x36de('0x2d')]);_0x5e3ca5(_0xf9a6dc);});}})[_0x36de('0x17')](function(_0x471f9f){throw new Error(_0x471f9f[_0x36de('0x19')]);});});};}function createEndUser(_0x1e10a3,_0x3ea594,_0x5ca2dc,_0x42e20c){return new Promise(function(_0x307097,_0x467ca5){var _0x40032f=moment();var _0x44fa12={'method':'POST','uri':_0x42e20c+_0x36de('0x30'),'body':{'contact':{'last_name':_0x1e10a3[_0x36de('0x2c')],'work_number':_0x1e10a3[_0x36de('0x2c')],'mobile_number':_0x1e10a3[_0x36de('0x2c')],'owner_id':_0x1e10a3[_0x36de('0x1e')],'created_at':_0x40032f[_0x36de('0x31')](_0x36de('0x32'))}},'json':!![]};_0x44fa12['headers']=_0x5ca2dc;logger[_0x36de('0xe')](_0x36de('0x33'));return rp(_0x44fa12)[_0x36de('0x10')](function(_0xdec34){_0x1e10a3[_0x36de('0x2d')]=_0xdec34[_0x36de('0x34')]['id'];_0x307097(_0x1e10a3);})[_0x36de('0x17')](function(_0x33bdc3){logger[_0x36de('0x21')]('['+[_0x3ea594[_0x36de('0x18')]()]+']',_0x33bdc3[_0x36de('0x19')]);_0x467ca5(_0x33bdc3[_0x36de('0x19')]);});});}function getTicket(_0x53d02d,_0x3d2227,_0x426dcb,_0x3b67fc,_0x4775db){return function(_0x15638e){logger['info'](_0x36de('0x35'));return new Promise(function(_0x6592df,_0x5cead4){var _0x5def5e=moment();var _0x3131c5={'method':_0x36de('0x36'),'uri':_0x426dcb+_0x36de('0x37'),'body':{'title':intUtil[_0x36de('0x38')](_0x3b67fc[_0x36de('0x39')],_0x4775db,'\x20'),'description':intUtil[_0x36de('0x38')](_0x3b67fc[_0x36de('0x3a')],_0x4775db,'\x0a'),'owner_id':_0x15638e[_0x36de('0x1e')],'creater_id':_0x15638e[_0x36de('0x15')],'targetable_id':_0x15638e[_0x36de('0x2d')],'targetable_type':'Contact','created_at':_0x5def5e[_0x36de('0x31')](_0x36de('0x32')),'due_date':_0x5def5e['add'](0x1e,'m')[_0x36de('0x31')](_0x36de('0x32'))},'json':!![]};_0x3131c5[_0x36de('0xd')]=_0x3d2227;return rp(_0x3131c5)['then'](function(_0x187977){_0x15638e[_0x36de('0x3b')]=_0x187977[_0x36de('0x3c')]['id'];logger['info'](_0x36de('0x3d'),_0x15638e[_0x36de('0x3b')]);_0x6592df(_0x15638e);})[_0x36de('0x17')](function(_0x35b79d){logger[_0x36de('0x21')]('['+[_0x53d02d[_0x36de('0x18')]()]+']',_0x35b79d[_0x36de('0x19')]);_0x5cead4(_0x35b79d[_0x36de('0x19')]);});});};}function emit(_0x59999d,_0x5502d1,_0x254617){var _0x16bdfb={'uri':_0x59999d+_0x36de('0x3e')+_0x254617};io['to'](util[_0x36de('0x31')](_0x36de('0x3f'),_0x5502d1))[_0x36de('0x40')](_0x36de('0x41'),_0x16bdfb);}exports['cs']=function(_0x4714ef,_0x370079,_0x3b5d23,_0x5c89d8,_0x5dad2a,_0x562961,_0x47b430,_0x18d447){var _0x5546da={};var _0x586374={'Authorization':_0x36de('0x42')+_0x562961['apiKey']};_0x562961[_0x36de('0x43')]=intUtil[_0x36de('0x44')](_0x562961[_0x36de('0x43')]);_0x562961['serverUrl']=intUtil[_0x36de('0x44')](_0x562961[_0x36de('0x45')]);var _0x5d2377=_0x562961[_0x36de('0x43')];_0x5546da[_0x36de('0x14')]=_0x562961[_0x36de('0x46')];_0x5546da[_0x36de('0x2c')]=_0x18d447[_0x36de('0x47')]()===_0x36de('0x48')?_0x370079['destcalleridnum']:_0x370079[_0x36de('0x49')];_0x5546da[_0x36de('0x4a')]=_0x18d447===_0x36de('0x4b')||_0x18d447===_0x36de('0x4c')?_0x36de('0x4b'):'outbound';if(_0x5c89d8){_0x5546da[_0x36de('0x1b')]=_0x5c89d8[_0x36de('0x13')];}var _0x29e709=util[_0x36de('0x31')](_0x36de('0x4d'),_0x562961[_0x36de('0x45')],_0x370079[_0x36de('0x4e')],md5(_0x370079[_0x36de('0x4e')]));if(_0x5dad2a&&_0x5dad2a[_0x36de('0x4f')]){logger[_0x36de('0xe')](_0x36de('0x50'),_0x36de('0x51'));_0x370079[_0x36de('0x52')]=_0x29e709;}else if(_0x47b430&&_0x47b430[_0x36de('0x53')]&&_0x47b430[_0x36de('0x53')]!=='none'){logger[_0x36de('0xe')](_0x36de('0x54'),_0x36de('0x51'));_0x370079[_0x36de('0x52')]=_0x29e709;}else{_0x370079[_0x36de('0x52')]='';}return getAdminId(_0x5546da,_0x18d447,_0x586374,_0x5d2377)[_0x36de('0x10')](getUser(_0x18d447,_0x586374,_0x5d2377))[_0x36de('0x10')](getEndUser(_0x18d447,_0x586374,_0x5d2377))['then'](getTicket(_0x18d447,_0x586374,_0x5d2377,_0x3b5d23,_0x370079))[_0x36de('0x10')](function(_0x37985f){logger['info'](util['format'](_0x36de('0x55'),_0x37985f[_0x36de('0x3b')]));if(_0x18d447!=='abandoned'){logger[_0x36de('0xe')]('['+[_0x18d447['toUpperCase']()]+']',_0x36de('0x56'));emit(_0x5d2377,_0x5c89d8[_0x36de('0x26')],_0x37985f['endUserId']);}})['catch'](function(_0x3885f0){logger[_0x36de('0x21')]('['+[_0x18d447[_0x36de('0x18')]()]+_0x36de('0x57'),util[_0x36de('0x58')](_0x3885f0,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x997e=['contactNumber','contacts','find','work_number','mobile_number','endUserId','Contact\x20found:','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','getString','Subjects','Descriptions','Contact','add','Task\x20created:','ticketId','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','bluebird','../../../../config/logger','freshsales','defaults','redis','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','Getting\x20user\x20list','then','Getting\x20user\x20with\x20email','agentEmail','userEmail','User\x20found:','userId','message','/api/contacts/filters','Getting\x20contacts\x20filter','forEach','All\x20Contacts','Getting\x20contact\x20list','/api/contacts/view/','Searching\x20contact\x20with\x20phone'];(function(_0x11c0cb,_0x4476aa){var _0x3dbf20=function(_0x58f366){while(--_0x58f366){_0x11c0cb['push'](_0x11c0cb['shift']());}};_0x3dbf20(++_0x4476aa);}(_0x997e,0x84));var _0xe997=function(_0x276efb,_0x5e7b2f){_0x276efb=_0x276efb-0x0;var _0x320c28=_0x997e[_0x276efb];return _0x320c28;};'use strict';var _=require(_0xe997('0x0'));var rp=require(_0xe997('0x1'));var md5=require(_0xe997('0x2'));var util=require(_0xe997('0x3'));var moment=require('moment');var Promise=require(_0xe997('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xe997('0x5'))(_0xe997('0x6'));config['redis']=_[_0xe997('0x7')](config[_0xe997('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xe997('0x9'))(new Redis(config[_0xe997('0x8')]));function getAdminId(_0x513ac9,_0x529cb8,_0x1e52c5,_0x45dd86){return new Promise(function(_0x1461ee,_0x40cbef){var _0x1b6add=![];var _0x687aa7={'method':_0xe997('0xa'),'uri':_0x45dd86+_0xe997('0xb'),'json':!![]};_0x687aa7[_0xe997('0xc')]=_0x1e52c5;logger[_0xe997('0xd')](_0xe997('0xe'));return rp(_0x687aa7)['then'](function(_0x17b0e6){if(_0x17b0e6){var _0x2203f8=_0x17b0e6[_0xe997('0xf')];var _0x2ce773=null;for(_0x2ce773=0x0;_0x2ce773<_0x2203f8[_0xe997('0x10')];_0x2ce773++){if(_0x2203f8[_0x2ce773][_0xe997('0x11')]===_0x513ac9[_0xe997('0x12')]){_0x513ac9[_0xe997('0x13')]=_0x2203f8[_0x2ce773]['id'];_0x1b6add=!![];}}if(_0x1b6add){logger[_0xe997('0xd')](_0xe997('0x14'),_0x513ac9[_0xe997('0x13')]);_0x1461ee(_0x513ac9);}else{_0x40cbef({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x40cbef({'statusCode':0x194,'message':_0xe997('0x15')});}})[_0xe997('0x16')](function(_0x2dc699){logger[_0xe997('0x17')]('['+[_0x529cb8[_0xe997('0x18')]()]+']',_0x2dc699['message']);_0x40cbef(_0x2dc699);});});}function getUser(_0x559a08,_0x5305a7,_0x21642e){return function(_0x122d8e){return new Promise(function(_0x27aacd,_0x2c72a7){var _0x470465={'method':_0xe997('0xa'),'uri':_0x21642e+_0xe997('0xb'),'json':!![]};_0x470465[_0xe997('0xc')]=_0x5305a7;logger[_0xe997('0xd')](_0xe997('0x19'));return rp(_0x470465)[_0xe997('0x1a')](function(_0x4265a3){if(_0x4265a3){var _0x4e19b2=_0x4265a3[_0xe997('0xf')];var _0x5afbe9=![];var _0xdb5223=null;if(_0x122d8e['agentEmail']!==null){logger[_0xe997('0xd')](_0xe997('0x1b'),_0x122d8e[_0xe997('0x1c')]);_0x122d8e[_0xe997('0x1d')]=_0x122d8e[_0xe997('0x1c')];for(_0xdb5223=0x0;_0xdb5223<_0x4e19b2[_0xe997('0x10')];_0xdb5223++){if(_0x4e19b2[_0xdb5223][_0xe997('0x11')]===_0x122d8e['agentEmail']){_0x5afbe9=!![];_0x122d8e['userId']=_0x4e19b2[_0xdb5223]['id'];logger[_0xe997('0xd')](_0xe997('0x1e'),_0x122d8e['userId']);}}}if(!_0x5afbe9){logger[_0xe997('0xd')]('Admin\x20selected');_0x122d8e[_0xe997('0x1d')]=_0x122d8e['adminEmail'];_0x122d8e[_0xe997('0x1f')]=_0x122d8e[_0xe997('0x13')];_0x5afbe9=!![];}if(_0x5afbe9){_0x27aacd(_0x122d8e);}else{_0x2c72a7({'statusCode':0x194,'message':_0xe997('0x15')});}}else{_0x2c72a7({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x6f6c36){logger[_0xe997('0x17')]('['+[_0x559a08[_0xe997('0x18')]()]+']',_0x6f6c36[_0xe997('0x20')]);_0x2c72a7(_0x6f6c36);});});};}function getEndUser(_0x4c51a9,_0x1ab202,_0x13d61b){return function(_0x336dbe){return new Promise(function(_0x2a32ae,_0x24a463){var _0x16ffef=0x0;var _0x143829={'method':_0xe997('0xa'),'uri':_0x13d61b+_0xe997('0x21'),'json':!![]};_0x143829[_0xe997('0xc')]=_0x1ab202;logger['info'](_0xe997('0x22'));return rp(_0x143829)[_0xe997('0x1a')](function(_0x4b1504){_0x4b1504['filters'][_0xe997('0x23')](function(_0x44cbcb){if(_0x44cbcb['name']===_0xe997('0x24')){_0x16ffef=_0x44cbcb['id'];}});})[_0xe997('0x1a')](function(){logger['info'](_0xe997('0x25'));var _0x18bc71={'method':_0xe997('0xa'),'uri':_0x13d61b+_0xe997('0x26')+_0x16ffef,'json':!![]};_0x18bc71[_0xe997('0xc')]=_0x1ab202;return rp(_0x18bc71);})[_0xe997('0x1a')](function(_0x379af7){logger[_0xe997('0xd')](_0xe997('0x27'),_0x336dbe[_0xe997('0x28')]);if(_0x379af7[_0xe997('0x29')][_0xe997('0x10')]>0x0){var _0x5bb30d=_[_0xe997('0x2a')](_0x379af7[_0xe997('0x29')],function(_0x2b35ab){if(_0x2b35ab[_0xe997('0x2b')]===_0x336dbe['contactNumber']||_0x2b35ab[_0xe997('0x2c')]===_0x336dbe[_0xe997('0x28')]){return _0x2b35ab;}});if(_0x5bb30d){_0x336dbe[_0xe997('0x2d')]=_0x5bb30d['id'];logger['info'](_0xe997('0x2e'),_0x336dbe[_0xe997('0x2d')]);_0x2a32ae(_0x336dbe);}else{return createEndUser(_0x336dbe,_0x4c51a9,_0x1ab202,_0x13d61b)[_0xe997('0x1a')](function(_0x37d59b){logger['info'](_0xe997('0x2f'),_0x336dbe[_0xe997('0x2d')]);_0x2a32ae(_0x37d59b);});}}else{return createEndUser(_0x336dbe,_0x4c51a9,_0x1ab202,_0x13d61b)['then'](function(_0xbe9b58){logger[_0xe997('0xd')]('Contact\x20created:',_0x336dbe['endUserId']);_0x2a32ae(_0xbe9b58);});}})[_0xe997('0x16')](function(_0x60c98){throw new Error(_0x60c98['message']);});});};}function createEndUser(_0x580a3d,_0x3e5f13,_0x45a931,_0x15b470){return new Promise(function(_0x529f63,_0x41234b){var _0xab2df6=moment();var _0x42088d={'method':_0xe997('0x30'),'uri':_0x15b470+_0xe997('0x31'),'body':{'contact':{'last_name':_0x580a3d[_0xe997('0x28')],'work_number':_0x580a3d[_0xe997('0x28')],'mobile_number':_0x580a3d[_0xe997('0x28')],'owner_id':_0x580a3d['userId'],'created_at':_0xab2df6[_0xe997('0x32')](_0xe997('0x33'))}},'json':!![]};_0x42088d[_0xe997('0xc')]=_0x45a931;logger[_0xe997('0xd')](_0xe997('0x34'));return rp(_0x42088d)[_0xe997('0x1a')](function(_0x3408f2){_0x580a3d['endUserId']=_0x3408f2[_0xe997('0x35')]['id'];_0x529f63(_0x580a3d);})[_0xe997('0x16')](function(_0x52396b){logger[_0xe997('0x17')]('['+[_0x3e5f13[_0xe997('0x18')]()]+']',_0x52396b[_0xe997('0x20')]);_0x41234b(_0x52396b[_0xe997('0x20')]);});});}function getTicket(_0x511e12,_0x4e3883,_0xf94466,_0x17a857,_0x21e914){return function(_0x303f88){logger[_0xe997('0xd')]('Creating\x20new\x20task');return new Promise(function(_0x53f805,_0x40432c){var _0x30bd29=moment();var _0x5db57c={'method':_0xe997('0x30'),'uri':_0xf94466+'/api/tasks','body':{'title':intUtil[_0xe997('0x36')](_0x17a857[_0xe997('0x37')],_0x21e914,'\x20'),'description':intUtil['getString'](_0x17a857[_0xe997('0x38')],_0x21e914,'\x0a'),'owner_id':_0x303f88['userId'],'creater_id':_0x303f88[_0xe997('0x13')],'targetable_id':_0x303f88['endUserId'],'targetable_type':_0xe997('0x39'),'created_at':_0x30bd29[_0xe997('0x32')](_0xe997('0x33')),'due_date':_0x30bd29[_0xe997('0x3a')](0x1e,'m')[_0xe997('0x32')](_0xe997('0x33'))},'json':!![]};_0x5db57c[_0xe997('0xc')]=_0x4e3883;return rp(_0x5db57c)['then'](function(_0x478ae9){_0x303f88['ticketId']=_0x478ae9['task']['id'];logger[_0xe997('0xd')](_0xe997('0x3b'),_0x303f88[_0xe997('0x3c')]);_0x53f805(_0x303f88);})['catch'](function(_0x1aa45c){logger[_0xe997('0x17')]('['+[_0x511e12[_0xe997('0x18')]()]+']',_0x1aa45c[_0xe997('0x20')]);_0x40432c(_0x1aa45c['message']);});});};}function emit(_0xa27010,_0x3b9156,_0x4ba2a7){var _0x10b1e6={'uri':_0xa27010+_0xe997('0x3d')+_0x4ba2a7};io['to'](util[_0xe997('0x32')](_0xe997('0x3e'),_0x3b9156))[_0xe997('0x3f')](_0xe997('0x40'),_0x10b1e6);}exports['cs']=function(_0x1b6703,_0xd7a98f,_0x2ceabd,_0x2ea3e2,_0x3ba80b,_0xef63b5,_0x1660fa,_0x7e6f7d){var _0x50f232={};var _0x4d08c0={'Authorization':_0xe997('0x41')+_0xef63b5[_0xe997('0x42')]};_0xef63b5[_0xe997('0x43')]=intUtil[_0xe997('0x44')](_0xef63b5[_0xe997('0x43')]);_0xef63b5[_0xe997('0x45')]=intUtil[_0xe997('0x44')](_0xef63b5[_0xe997('0x45')]);var _0x4896c7=_0xef63b5[_0xe997('0x43')];_0x50f232[_0xe997('0x12')]=_0xef63b5['username'];_0x50f232[_0xe997('0x28')]=_0x7e6f7d[_0xe997('0x46')]()==='outbound'?_0xd7a98f['destcalleridnum']:_0xd7a98f[_0xe997('0x47')];_0x50f232[_0xe997('0x48')]=_0x7e6f7d===_0xe997('0x49')||_0x7e6f7d==='abandoned'?_0xe997('0x49'):'outbound';if(_0x2ea3e2){_0x50f232[_0xe997('0x1c')]=_0x2ea3e2[_0xe997('0x11')];}var _0x38da75=util[_0xe997('0x32')](_0xe997('0x4a'),_0xef63b5[_0xe997('0x45')],_0xd7a98f['uniqueid'],md5(_0xd7a98f[_0xe997('0x4b')]));if(_0x3ba80b&&_0x3ba80b['monitor_format']){logger[_0xe997('0xd')]('[QUEUE]',_0xe997('0x4c'));_0xd7a98f[_0xe997('0x4d')]=_0x38da75;}else if(_0x1660fa&&_0x1660fa[_0xe997('0x4e')]&&_0x1660fa['recordingFormat']!==_0xe997('0x4f')){logger[_0xe997('0xd')](_0xe997('0x50'),_0xe997('0x4c'));_0xd7a98f[_0xe997('0x4d')]=_0x38da75;}else{_0xd7a98f[_0xe997('0x4d')]='';}return getAdminId(_0x50f232,_0x7e6f7d,_0x4d08c0,_0x4896c7)[_0xe997('0x1a')](getUser(_0x7e6f7d,_0x4d08c0,_0x4896c7))[_0xe997('0x1a')](getEndUser(_0x7e6f7d,_0x4d08c0,_0x4896c7))[_0xe997('0x1a')](getTicket(_0x7e6f7d,_0x4d08c0,_0x4896c7,_0x2ceabd,_0xd7a98f))[_0xe997('0x1a')](function(_0x207ef5){logger[_0xe997('0xd')](util[_0xe997('0x32')](_0xe997('0x51'),_0x207ef5[_0xe997('0x3c')]));if(_0x7e6f7d!=='abandoned'){logger[_0xe997('0xd')]('['+[_0x7e6f7d[_0xe997('0x18')]()]+']',_0xe997('0x52'));emit(_0x4896c7,_0x2ea3e2[_0xe997('0x53')],_0x207ef5['endUserId']);}})[_0xe997('0x16')](function(_0x4d674b){logger['error']('['+[_0x7e6f7d['toUpperCase']()]+_0xe997('0x54'),util[_0xe997('0x55')](_0x4d674b,{'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 d805537..90964fa 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(_0x1a52c2,_0x26f5f5){var _0x1b0723=function(_0x43261a){while(--_0x43261a){_0x1a52c2['push'](_0x1a52c2['shift']());}};_0x1b0723(++_0x26f5f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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(_0x106651,_0x539863){var _0x5b3300=function(_0x2bc2f2){while(--_0x2bc2f2){_0x106651['push'](_0x106651['shift']());}};_0x5b3300(++_0x539863);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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 5ee8343..7fb4db7 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 _0x2445=['Task','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','Contact','Lead','contact','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.','Company','forEach','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','[QUEUE]','stringify','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','catch','abandoned','[ABANDONED]','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','ticketType','utc','getString','Subjects','Case','Descriptions','sobject','create','isNil','find','execute','then','length','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name'];(function(_0x6f9baa,_0xd7b1f6){var _0x3cb09f=function(_0x1e5e8b){while(--_0x1e5e8b){_0x6f9baa['push'](_0x6f9baa['shift']());}};_0x3cb09f(++_0xd7b1f6);}(_0x2445,0x121));var _0x5244=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0x2445[_0x2f45ea];return _0x485a84;};'use strict';var _=require(_0x5244('0x0'));var rp=require(_0x5244('0x1'));var moment=require(_0x5244('0x2'));var BPromise=require(_0x5244('0x3'));var md5=require(_0x5244('0x4'));var jsforce=require(_0x5244('0x5'));var util=require('util');var Redis=require(_0x5244('0x6'));var intUtil=require(_0x5244('0x7'));var config=require(_0x5244('0x8'));var logger=require('../../../../config/logger')('salesforce');config[_0x5244('0x9')]=_['defaults'](config['redis'],{'host':_0x5244('0xa'),'port':0x18eb});var io=require(_0x5244('0xb'))(new Redis(config[_0x5244('0x9')]));function emit(_0x307cfc,_0x4a2c55,_0x4b6ac0){io['to'](_0x307cfc)[_0x5244('0xc')](_0x4a2c55,_0x4b6ac0);}function getTicket(_0x5a9fa3,_0x1d4e19,_0x160b05,_0x20da84,_0x37dc18,_0x41a01b,_0x25d135,_0xafe6d8){var _0x2f5f15={};if(_0x20da84[_0x5244('0xd')]==='Task'){_0x2f5f15=Object['assign']({},{'OwnerId':_0x1d4e19['id'],'ActivityDate':moment[_0x5244('0xe')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x5244('0xf')](_0x20da84[_0x5244('0x10')],_0x37dc18,'\x20'),'Description':intUtil[_0x5244('0xf')](_0x20da84['Descriptions'],_0x37dc18,'\x0a')},getCustomFields(_0x41a01b,_0x37dc18));if(_0x160b05){_0x2f5f15['WhoId']=_0x160b05['id'];}}else if(_0x20da84['ticketType']===_0x5244('0x11')){_0x2f5f15=Object['assign']({},{'OwnerId':_0x1d4e19['id'],'Subject':intUtil[_0x5244('0xf')](_0x20da84[_0x5244('0x10')],_0x37dc18,'\x20'),'Description':intUtil[_0x5244('0xf')](_0x20da84[_0x5244('0x12')],_0x37dc18,'\x0a')},getCustomFields(_0x41a01b,_0x37dc18));if(_0x160b05){_0x2f5f15['ContactId']=_0x160b05['id'];}}return _0x25d135[_0x5244('0x13')](_0x20da84['ticketType'])[_0x5244('0x14')](_0x2f5f15);}function getUser(_0x43dcfb,_0x443240,_0x3cdf49){if(!_[_0x5244('0x15')](_0x443240)&&intUtil['validateEmail'](_0x443240)){var _0x3318a8={'Email':_0x443240};var _0x1d631b={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3cdf49[_0x5244('0x13')]('User')[_0x5244('0x16')](_0x3318a8,_0x1d631b)[_0x5244('0x17')]()[_0x5244('0x18')](function(_0x27b603){if(_0x27b603[_0x5244('0x19')]){var _0x4f938d=_[_0x5244('0x16')](_0x27b603,function(_0x19bfea){return _0x19bfea[_0x5244('0x1a')]===_0x443240;});if(_0x4f938d){logger[_0x5244('0x1b')](_0x5244('0x1c'),_0x443240);return BPromise[_0x5244('0x1d')]({'id':_0x4f938d['Id'],'name':_0x4f938d[_0x5244('0x1e')]});}}else{logger[_0x5244('0x1b')](_0x5244('0x1f'),_0x443240);return _0x3cdf49[_0x5244('0x20')]()[_0x5244('0x18')](function(_0x9c17c5){return BPromise[_0x5244('0x1d')]({'id':_0x9c17c5[_0x5244('0x21')],'name':_0x9c17c5['display_name']});});}});}else{logger[_0x5244('0x1b')](_0x5244('0x1f'),_0x443240);return _0x3cdf49[_0x5244('0x20')]()[_0x5244('0x18')](function(_0x410589){return BPromise[_0x5244('0x1d')]({'id':_0x410589[_0x5244('0x21')],'name':_0x410589[_0x5244('0x22')]});});}}function getEndUser(_0x2937a3,_0x27c8b5,_0x7c53f6,_0x7591a6,_0x334ff8){var _0x2c2143={'Phone':_0x7591a6};var _0x3df123={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x5244('0x1d')]()[_0x5244('0x18')](function(){if(_0x27c8b5[_0x5244('0xd')]===_0x5244('0x23')){logger[_0x5244('0x1b')](_0x5244('0x24'),_0x7591a6,_0x27c8b5['moduleSearch']);switch(_0x27c8b5[_0x5244('0x25')]){case'contact_lead':return _0x334ff8[_0x5244('0x13')](_0x5244('0x26'))[_0x5244('0x16')](_0x2c2143,_0x3df123)[_0x5244('0x17')]()['then'](function(_0x4c0afa){if(_0x4c0afa&&_0x4c0afa[_0x5244('0x19')]){return _0x4c0afa;}else{return _0x334ff8[_0x5244('0x13')](_0x5244('0x27'))[_0x5244('0x16')](_0x2c2143,_0x3df123);}});case _0x5244('0x28'):return _0x334ff8['sobject'](_0x5244('0x26'))[_0x5244('0x16')](_0x2c2143,_0x3df123)[_0x5244('0x17')]();case'lead':return _0x334ff8[_0x5244('0x13')]('Lead')[_0x5244('0x16')](_0x2c2143,_0x3df123);default:return null;}}else if(_0x27c8b5[_0x5244('0xd')]==='Case'){logger[_0x5244('0x1b')](_0x5244('0x24'),_0x7591a6,_0x5244('0x28'));return _0x334ff8[_0x5244('0x13')](_0x5244('0x26'))[_0x5244('0x16')](_0x2c2143,_0x3df123)['execute']();}})[_0x5244('0x18')](function(_0x556255){if(_0x556255&&_0x556255[_0x5244('0x19')]){var _0x231fe1=_[_0x5244('0x16')](_0x556255,function(_0x54644f){return _0x54644f['Phone']===_0x7591a6;});if(_0x231fe1){return BPromise[_0x5244('0x1d')]({'id':_0x231fe1['Id'],'name':_0x231fe1[_0x5244('0x1e')],'phone':_0x231fe1[_0x5244('0x29')]});}}})[_0x5244('0x18')](function(_0x3d7b67){if(_0x3d7b67){logger[_0x5244('0x1b')](_0x5244('0x2a'),_0x7591a6);return BPromise[_0x5244('0x1d')](_0x3d7b67);}else{logger[_0x5244('0x1b')](_0x5244('0x2b'),_0x7591a6);var _0x2b3f92={'LastName':_0x7c53f6!==_0x5244('0x2c')?_0x7c53f6:util['format']('Caller\x20-\x20%s',_0x7591a6),'Phone':_0x7591a6};if(_0x27c8b5[_0x5244('0x2d')]){if(_0x27c8b5[_0x5244('0x2d')]===_0x5244('0x28')){logger[_0x5244('0x1b')](_0x5244('0x2e'),_0x7591a6,_0x27c8b5[_0x5244('0x2d')]);}else if(_0x27c8b5[_0x5244('0x2d')]==='lead'&&_0x27c8b5[_0x5244('0xd')]==='Task'){logger[_0x5244('0x1b')](_0x5244('0x2e'),_0x7591a6,_0x27c8b5[_0x5244('0x2d')]);_0x2b3f92[_0x5244('0x2f')]='No\x20Company';}else{return null;}}return _0x334ff8[_0x5244('0x13')](_['upperFirst'](_0x27c8b5['moduleCreate']))[_0x5244('0x14')](_0x2b3f92);}});}function getCustomFields(_0xd6979,_0x4f9857){var _0x5e0dfb={};if(_0xd6979[_0x5244('0x19')]>0x0){_[_0x5244('0x30')](_0xd6979,function(_0x49c417){if(_0x49c417[_0x5244('0x31')]==='string'&&_0x49c417['idField']){_0x5e0dfb[_0x49c417[_0x5244('0x32')]]=_0x49c417[_0x5244('0x33')][_0x5244('0x34')]();}else if(_0x49c417[_0x5244('0x31')]===_0x5244('0x35')&&_0x49c417[_0x5244('0x36')]&&_0x49c417['idField']){_0x4f9857[_0x49c417[_0x5244('0x36')]]&&(_0x5e0dfb[_0x49c417[_0x5244('0x32')]]=_0x4f9857[_0x49c417[_0x5244('0x36')]][_0x5244('0x34')]());}else if(_0x49c417[_0x5244('0x31')]===_0x5244('0x37')&&_0x49c417[_0x5244('0x38')]&&_0x49c417[_0x5244('0x38')][_0x5244('0x39')]&&_0x49c417[_0x5244('0x32')]){_0x4f9857[_0x49c417['Variable'][_0x5244('0x39')][_0x5244('0x3a')]()]&&(_0x5e0dfb[_0x49c417[_0x5244('0x32')]]=_0x4f9857[_0x49c417['Variable'][_0x5244('0x39')][_0x5244('0x3a')]()][_0x5244('0x34')]());}});}return _0x5e0dfb;}function getConnection(_0x16f7a8){var _0x217ddb=_0x16f7a8[_0x5244('0x3b')][_0x5244('0x3c')](_0x16f7a8[_0x5244('0x3d')]);var _0x5ce38a=new jsforce[(_0x5244('0x3e'))]({'oauth2':{'loginUrl':_0x16f7a8[_0x5244('0x3f')]||_0x5244('0x40'),'clientId':_0x16f7a8[_0x5244('0x41')],'clientSecret':_0x16f7a8[_0x5244('0x42')]}});return _0x5ce38a[_0x5244('0x43')](_0x16f7a8[_0x5244('0x44')],_0x217ddb)[_0x5244('0x18')](function(){logger[_0x5244('0x1b')]('Connection\x20established.');return _0x5ce38a;});}exports[_0x5244('0x45')]=function(_0x300a24,_0x4c5340,_0x2acbdd,_0x20c1cb,_0x20ad48,_0x2a67bf){var _0xe7d3e1,_0x3c43f5,_0x14906a,_0x4fc9c7;_0x2a67bf[_0x5244('0x46')]=intUtil['stripTrailingSlash'](_0x2a67bf[_0x5244('0x46')]);_0x2a67bf[_0x5244('0x3f')]=intUtil[_0x5244('0x47')](_0x2a67bf[_0x5244('0x3f')]);if(_0x20ad48&&_0x20ad48[_0x5244('0x48')]){logger[_0x5244('0x1b')]('[QUEUE]',_0x5244('0x49'));_0x4c5340[_0x5244('0x4a')]=util[_0x5244('0x4b')](_0x5244('0x4c'),_0x2a67bf[_0x5244('0x46')],_0x4c5340[_0x5244('0x4d')],md5(_0x4c5340[_0x5244('0x4d')]));}else{_0x4c5340[_0x5244('0x4a')]='';}return getConnection(_0x2a67bf)[_0x5244('0x18')](function(_0x5dbe3e){_0x4fc9c7=_0x5dbe3e;return getUser(_0x2a67bf,_0x20c1cb['email'],_0x4fc9c7);})['then'](function(_0x19c690){_0xe7d3e1=_0x19c690;return getEndUser(_0x2a67bf,_0x2acbdd,_0x4c5340[_0x5244('0x4e')],_0x4c5340[_0x5244('0x4f')],_0x4fc9c7);})[_0x5244('0x18')](function(_0x3d193d){_0x3c43f5=_0x3d193d;return getTicket(_0x2a67bf,_0xe7d3e1,_0x3c43f5,_0x2acbdd,_0x4c5340,_0x2acbdd[_0x5244('0x50')],_0x4fc9c7,_0x5244('0x45'));})[_0x5244('0x18')](function(_0x1da3c6){_0x14906a=_0x1da3c6;logger[_0x5244('0x1b')](_0x5244('0x51'),_0x14906a['id']);logger['info'](_0x5244('0x52'),_0x14906a['id'],_0x20c1cb[_0x5244('0x39')],_0x2a67bf[_0x5244('0x31')]);switch(_0x2a67bf[_0x5244('0x31')]){case _0x5244('0x53'):emit(util['format']('user:%s',_0x20c1cb[_0x5244('0x39')]),_0x5244('0x54'),{'recordId':_0x14906a['id']});break;case _0x5244('0x55'):emit(util[_0x5244('0x4b')](_0x5244('0x56'),_0x20c1cb[_0x5244('0x39')]),_0x5244('0x57'),{'uri':util[_0x5244('0x4b')](_0x5244('0x58'),_0x4fc9c7[_0x5244('0x59')],_0x14906a['id'])});break;default:logger[_0x5244('0x5a')](_0x5244('0x5b'));}})['catch'](function(_0x141db7){logger['error'](_0x5244('0x5c'),JSON[_0x5244('0x5d')](_0x141db7));});};exports[_0x5244('0x5e')]=function(_0x235b71,_0xfc9914,_0x34df48,_0x52b8ec,_0x55d011,_0x5e4308,_0x1e4ebf){var _0x3a9bd0,_0x3380c7,_0x15d0ab,_0x124806;_0x5e4308[_0x5244('0x46')]=intUtil[_0x5244('0x47')](_0x5e4308[_0x5244('0x46')]);_0x5e4308['remoteUri']=intUtil[_0x5244('0x47')](_0x5e4308[_0x5244('0x3f')]);if(_0x1e4ebf&&_0x1e4ebf[_0x5244('0x5f')]&&_0x1e4ebf[_0x5244('0x5f')]!==_0x5244('0x60')){logger['info'](_0x5244('0x61'),_0x5244('0x49'));_0xfc9914[_0x5244('0x4a')]=util[_0x5244('0x4b')](_0x5244('0x4c'),_0x5e4308[_0x5244('0x46')],_0xfc9914[_0x5244('0x4d')],md5(_0xfc9914[_0x5244('0x4d')]));}return getConnection(_0x5e4308)[_0x5244('0x18')](function(_0x1f3b54){_0x124806=_0x1f3b54;return getUser(_0x5e4308,_0x52b8ec['email'],_0x124806);})[_0x5244('0x18')](function(_0x255638){_0x3a9bd0=_0x255638;return getEndUser(_0x5e4308,_0x34df48,_0xfc9914[_0x5244('0x62')],_0xfc9914[_0x5244('0x63')],_0x124806);})[_0x5244('0x18')](function(_0x313035){_0x3380c7=_0x313035;return getTicket(_0x5e4308,_0x3a9bd0,_0x3380c7,_0x34df48,_0xfc9914,_0x34df48[_0x5244('0x50')],_0x124806,_0x5244('0x5e'));})['then'](function(_0x10c61b){_0x15d0ab=_0x10c61b;logger[_0x5244('0x1b')](_0x5244('0x64'),_0x15d0ab['id']);logger[_0x5244('0x1b')](_0x5244('0x65'),_0x15d0ab['id'],_0x52b8ec[_0x5244('0x39')],_0x5e4308[_0x5244('0x31')]);switch(_0x5e4308[_0x5244('0x31')]){case _0x5244('0x53'):emit(util['format'](_0x5244('0x56'),_0x52b8ec[_0x5244('0x39')]),_0x5244('0x54'),{'recordId':_0x15d0ab['id']});break;case _0x5244('0x55'):emit(util[_0x5244('0x4b')]('user:%s',_0x52b8ec[_0x5244('0x39')]),_0x5244('0x57'),{'uri':util['format'](_0x5244('0x58'),_0x124806[_0x5244('0x59')],_0x15d0ab['id'])});break;default:logger[_0x5244('0x5a')](_0x5244('0x61'),_0x5244('0x66'));}})[_0x5244('0x67')](function(_0x551d69){logger[_0x5244('0x5a')]('[OUTBOUND]',JSON[_0x5244('0x5d')](_0x551d69));});};exports[_0x5244('0x68')]=function(_0x108961,_0x32329e,_0x1458de,_0x91851,_0x20ecc4,_0x5e838c){var _0x53b4f8,_0x56c38e,_0x4027bf,_0x14de3f;_0x5e838c[_0x5244('0x46')]=intUtil['stripTrailingSlash'](_0x5e838c[_0x5244('0x46')]);_0x5e838c[_0x5244('0x3f')]=intUtil[_0x5244('0x47')](_0x5e838c[_0x5244('0x3f')]);if(_0x20ecc4&&_0x20ecc4[_0x5244('0x48')]){logger[_0x5244('0x1b')](_0x5244('0x69'),_0x5244('0x49'));_0x32329e[_0x5244('0x4a')]=util['format'](_0x5244('0x4c'),_0x5e838c[_0x5244('0x46')],_0x32329e[_0x5244('0x4d')],md5(_0x32329e[_0x5244('0x4d')]));}else{_0x32329e[_0x5244('0x4a')]='';}return getConnection(_0x5e838c)[_0x5244('0x18')](function(_0x223156){_0x14de3f=_0x223156;if(!_[_0x5244('0x15')](_0x91851)){return getUser(_0x5e838c,_0x91851[_0x5244('0x39')],_0x14de3f);}else{return getUser(_0x5e838c,null,_0x14de3f);}})[_0x5244('0x18')](function(_0x2d7098){_0x53b4f8=_0x2d7098;return getEndUser(_0x5e838c,_0x1458de,_0x32329e[_0x5244('0x4e')],_0x32329e['calleridnum'],_0x14de3f);})['then'](function(_0x553025){_0x56c38e=_0x553025;return getTicket(_0x5e838c,_0x53b4f8,_0x56c38e,_0x1458de,_0x32329e,_0x1458de['Fields'],_0x14de3f);})[_0x5244('0x18')](function(_0x4fd0b2){_0x4027bf=_0x4fd0b2;logger['info'](_0x5244('0x6a'),_0x4027bf['id']);logger['info'](_0x5244('0x6b'),_0x5e838c[_0x5244('0x31')]);})[_0x5244('0x67')](function(_0x55a359){logger['error'](_0x5244('0x69'),JSON[_0x5244('0x5d')](_0x55a359));});}; \ No newline at end of file +var _0x42ec=['isNil','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','ticketType','assign','utc','Subjects','getString','Descriptions','WhoId','Case','ContactId','create','validateEmail','sobject','User','find','then','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','Task','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Contact','execute','Lead','contact','lead','length','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','forEach','content','type','variable','variableName','idField','toString','customVariable','Variable','name','toLowerCase','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','none','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','[OUTBOUND]','stringify','abandoned','[ABANDONED]'];(function(_0xba56b1,_0x3a1f15){var _0x193aee=function(_0x24d20a){while(--_0x24d20a){_0xba56b1['push'](_0xba56b1['shift']());}};_0x193aee(++_0x3a1f15);}(_0x42ec,0x75));var _0xc42e=function(_0xf863fe,_0x41a892){_0xf863fe=_0xf863fe-0x0;var _0x1a5312=_0x42ec[_0xf863fe];return _0x1a5312;};'use strict';var _=require(_0xc42e('0x0'));var rp=require(_0xc42e('0x1'));var moment=require(_0xc42e('0x2'));var BPromise=require(_0xc42e('0x3'));var md5=require(_0xc42e('0x4'));var jsforce=require(_0xc42e('0x5'));var util=require(_0xc42e('0x6'));var Redis=require(_0xc42e('0x7'));var intUtil=require('./util');var config=require(_0xc42e('0x8'));var logger=require('../../../../config/logger')('salesforce');config[_0xc42e('0x9')]=_[_0xc42e('0xa')](config['redis'],{'host':_0xc42e('0xb'),'port':0x18eb});var io=require(_0xc42e('0xc'))(new Redis(config[_0xc42e('0x9')]));function emit(_0x361962,_0x39a2ab,_0x295673){io['to'](_0x361962)[_0xc42e('0xd')](_0x39a2ab,_0x295673);}function getTicket(_0x4d969c,_0x278379,_0x5441d9,_0x4a3f16,_0x3175f3,_0x1513d9,_0x9362c6,_0x403393){var _0x5d5451={};if(_0x4a3f16[_0xc42e('0xe')]==='Task'){_0x5d5451=Object[_0xc42e('0xf')]({},{'OwnerId':_0x278379['id'],'ActivityDate':moment[_0xc42e('0x10')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil['getString'](_0x4a3f16[_0xc42e('0x11')],_0x3175f3,'\x20'),'Description':intUtil[_0xc42e('0x12')](_0x4a3f16[_0xc42e('0x13')],_0x3175f3,'\x0a')},getCustomFields(_0x1513d9,_0x3175f3));if(_0x5441d9){_0x5d5451[_0xc42e('0x14')]=_0x5441d9['id'];}}else if(_0x4a3f16[_0xc42e('0xe')]===_0xc42e('0x15')){_0x5d5451=Object[_0xc42e('0xf')]({},{'OwnerId':_0x278379['id'],'Subject':intUtil[_0xc42e('0x12')](_0x4a3f16[_0xc42e('0x11')],_0x3175f3,'\x20'),'Description':intUtil[_0xc42e('0x12')](_0x4a3f16[_0xc42e('0x13')],_0x3175f3,'\x0a')},getCustomFields(_0x1513d9,_0x3175f3));if(_0x5441d9){_0x5d5451[_0xc42e('0x16')]=_0x5441d9['id'];}}return _0x9362c6['sobject'](_0x4a3f16[_0xc42e('0xe')])[_0xc42e('0x17')](_0x5d5451);}function getUser(_0x29ec9f,_0x4806ff,_0x332bc8){if(!_['isNil'](_0x4806ff)&&intUtil[_0xc42e('0x18')](_0x4806ff)){var _0x218efb={'Email':_0x4806ff};var _0x4d05bd={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x332bc8[_0xc42e('0x19')](_0xc42e('0x1a'))[_0xc42e('0x1b')](_0x218efb,_0x4d05bd)['execute']()[_0xc42e('0x1c')](function(_0x229e2e){if(_0x229e2e['length']){var _0x50f01d=_[_0xc42e('0x1b')](_0x229e2e,function(_0x4be09e){return _0x4be09e[_0xc42e('0x1d')]===_0x4806ff;});if(_0x50f01d){logger[_0xc42e('0x1e')](_0xc42e('0x1f'),_0x4806ff);return BPromise[_0xc42e('0x20')]({'id':_0x50f01d['Id'],'name':_0x50f01d[_0xc42e('0x21')]});}}else{logger[_0xc42e('0x1e')](_0xc42e('0x22'),_0x4806ff);return _0x332bc8[_0xc42e('0x23')]()['then'](function(_0x4a4b0c){return BPromise['resolve']({'id':_0x4a4b0c[_0xc42e('0x24')],'name':_0x4a4b0c['display_name']});});}});}else{logger[_0xc42e('0x1e')](_0xc42e('0x22'),_0x4806ff);return _0x332bc8[_0xc42e('0x23')]()[_0xc42e('0x1c')](function(_0x302a76){return BPromise[_0xc42e('0x20')]({'id':_0x302a76[_0xc42e('0x24')],'name':_0x302a76['display_name']});});}}function getEndUser(_0x124232,_0x4efa12,_0x446496,_0x225721,_0x479aba){var _0x50a20e={'Phone':_0x225721};var _0x8e1304={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xc42e('0x20')]()[_0xc42e('0x1c')](function(){if(_0x4efa12[_0xc42e('0xe')]===_0xc42e('0x25')){logger[_0xc42e('0x1e')](_0xc42e('0x26'),_0x225721,_0x4efa12[_0xc42e('0x27')]);switch(_0x4efa12[_0xc42e('0x27')]){case _0xc42e('0x28'):return _0x479aba[_0xc42e('0x19')](_0xc42e('0x29'))[_0xc42e('0x1b')](_0x50a20e,_0x8e1304)[_0xc42e('0x2a')]()[_0xc42e('0x1c')](function(_0x556fdd){if(_0x556fdd&&_0x556fdd['length']){return _0x556fdd;}else{return _0x479aba[_0xc42e('0x19')](_0xc42e('0x2b'))[_0xc42e('0x1b')](_0x50a20e,_0x8e1304);}});case _0xc42e('0x2c'):return _0x479aba[_0xc42e('0x19')]('Contact')['find'](_0x50a20e,_0x8e1304)[_0xc42e('0x2a')]();case _0xc42e('0x2d'):return _0x479aba[_0xc42e('0x19')](_0xc42e('0x2b'))[_0xc42e('0x1b')](_0x50a20e,_0x8e1304);default:return null;}}else if(_0x4efa12['ticketType']===_0xc42e('0x15')){logger['info'](_0xc42e('0x26'),_0x225721,'contact');return _0x479aba[_0xc42e('0x19')]('Contact')['find'](_0x50a20e,_0x8e1304)['execute']();}})[_0xc42e('0x1c')](function(_0x2121eb){if(_0x2121eb&&_0x2121eb[_0xc42e('0x2e')]){var _0x31cb64=_[_0xc42e('0x1b')](_0x2121eb,function(_0x3bb397){return _0x3bb397['Phone']===_0x225721;});if(_0x31cb64){return BPromise[_0xc42e('0x20')]({'id':_0x31cb64['Id'],'name':_0x31cb64[_0xc42e('0x21')],'phone':_0x31cb64['Phone']});}}})[_0xc42e('0x1c')](function(_0x3242a2){if(_0x3242a2){logger[_0xc42e('0x1e')](_0xc42e('0x2f'),_0x225721);return BPromise[_0xc42e('0x20')](_0x3242a2);}else{logger[_0xc42e('0x1e')](_0xc42e('0x30'),_0x225721);var _0xdf4b40={'LastName':_0x446496!==_0xc42e('0x31')?_0x446496:util[_0xc42e('0x32')]('Caller\x20-\x20%s',_0x225721),'Phone':_0x225721};if(_0x4efa12['moduleCreate']){if(_0x4efa12[_0xc42e('0x33')]===_0xc42e('0x2c')){logger['info'](_0xc42e('0x34'),_0x225721,_0x4efa12[_0xc42e('0x33')]);}else if(_0x4efa12[_0xc42e('0x33')]===_0xc42e('0x2d')&&_0x4efa12['ticketType']==='Task'){logger[_0xc42e('0x1e')](_0xc42e('0x34'),_0x225721,_0x4efa12[_0xc42e('0x33')]);_0xdf4b40[_0xc42e('0x35')]=_0xc42e('0x36');}else{return null;}}return _0x479aba[_0xc42e('0x19')](_[_0xc42e('0x37')](_0x4efa12['moduleCreate']))['create'](_0xdf4b40);}});}function getCustomFields(_0x4b62a1,_0x389871){var _0xb2ed2={};if(_0x4b62a1[_0xc42e('0x2e')]>0x0){_[_0xc42e('0x38')](_0x4b62a1,function(_0x265675){if(_0x265675['type']==='string'&&_0x265675['idField']){_0xb2ed2[_0x265675['idField']]=_0x265675[_0xc42e('0x39')]['toString']();}else if(_0x265675[_0xc42e('0x3a')]===_0xc42e('0x3b')&&_0x265675[_0xc42e('0x3c')]&&_0x265675[_0xc42e('0x3d')]){_0x389871[_0x265675[_0xc42e('0x3c')]]&&(_0xb2ed2[_0x265675['idField']]=_0x389871[_0x265675['variableName']][_0xc42e('0x3e')]());}else if(_0x265675[_0xc42e('0x3a')]===_0xc42e('0x3f')&&_0x265675[_0xc42e('0x40')]&&_0x265675['Variable']['name']&&_0x265675[_0xc42e('0x3d')]){_0x389871[_0x265675['Variable'][_0xc42e('0x41')][_0xc42e('0x42')]()]&&(_0xb2ed2[_0x265675[_0xc42e('0x3d')]]=_0x389871[_0x265675['Variable'][_0xc42e('0x41')]['toLowerCase']()][_0xc42e('0x3e')]());}});}return _0xb2ed2;}function getConnection(_0x12882d){var _0x237d6f=_0x12882d[_0xc42e('0x43')][_0xc42e('0x44')](_0x12882d[_0xc42e('0x45')]);var _0x4550a1=new jsforce[(_0xc42e('0x46'))]({'oauth2':{'loginUrl':_0x12882d[_0xc42e('0x47')]||_0xc42e('0x48'),'clientId':_0x12882d['clientId'],'clientSecret':_0x12882d[_0xc42e('0x49')]}});return _0x4550a1[_0xc42e('0x4a')](_0x12882d[_0xc42e('0x4b')],_0x237d6f)[_0xc42e('0x1c')](function(){logger[_0xc42e('0x1e')](_0xc42e('0x4c'));return _0x4550a1;});}exports[_0xc42e('0x4d')]=function(_0x48f21e,_0x42181f,_0x5becbd,_0x3e58f4,_0xec571f,_0x54c9d9){var _0x1c563c,_0x3336f0,_0x2e9985,_0x39b82f;_0x54c9d9[_0xc42e('0x4e')]=intUtil[_0xc42e('0x4f')](_0x54c9d9[_0xc42e('0x4e')]);_0x54c9d9['remoteUri']=intUtil[_0xc42e('0x4f')](_0x54c9d9[_0xc42e('0x47')]);if(_0xec571f&&_0xec571f[_0xc42e('0x50')]){logger[_0xc42e('0x1e')](_0xc42e('0x51'),_0xc42e('0x52'));_0x42181f['recordingURL']=util[_0xc42e('0x32')](_0xc42e('0x53'),_0x54c9d9[_0xc42e('0x4e')],_0x42181f[_0xc42e('0x54')],md5(_0x42181f[_0xc42e('0x54')]));}else{_0x42181f[_0xc42e('0x55')]='';}return getConnection(_0x54c9d9)[_0xc42e('0x1c')](function(_0x55680d){_0x39b82f=_0x55680d;return getUser(_0x54c9d9,_0x3e58f4[_0xc42e('0x56')],_0x39b82f);})[_0xc42e('0x1c')](function(_0x501454){_0x1c563c=_0x501454;return getEndUser(_0x54c9d9,_0x5becbd,_0x42181f[_0xc42e('0x57')],_0x42181f[_0xc42e('0x58')],_0x39b82f);})[_0xc42e('0x1c')](function(_0x5f4669){_0x3336f0=_0x5f4669;return getTicket(_0x54c9d9,_0x1c563c,_0x3336f0,_0x5becbd,_0x42181f,_0x5becbd['Fields'],_0x39b82f,_0xc42e('0x4d'));})['then'](function(_0x566077){_0x2e9985=_0x566077;logger[_0xc42e('0x1e')](_0xc42e('0x59'),_0x2e9985['id']);logger[_0xc42e('0x1e')](_0xc42e('0x5a'),_0x2e9985['id'],_0x3e58f4[_0xc42e('0x41')],_0x54c9d9[_0xc42e('0x3a')]);switch(_0x54c9d9[_0xc42e('0x3a')]){case _0xc42e('0x5b'):emit(util[_0xc42e('0x32')]('user:%s',_0x3e58f4[_0xc42e('0x41')]),_0xc42e('0x5c'),{'recordId':_0x2e9985['id']});break;case'newTab':emit(util[_0xc42e('0x32')](_0xc42e('0x5d'),_0x3e58f4[_0xc42e('0x41')]),_0xc42e('0x5e'),{'uri':util[_0xc42e('0x32')](_0xc42e('0x5f'),_0x39b82f[_0xc42e('0x60')],_0x2e9985['id'])});break;default:logger[_0xc42e('0x61')](_0xc42e('0x62'));}})[_0xc42e('0x63')](function(_0x345eab){logger['error'](_0xc42e('0x51'),JSON['stringify'](_0x345eab));});};exports['outbound']=function(_0x2c10e9,_0x5eb4dd,_0x30dd35,_0x4725f2,_0x7fca6d,_0xcd6ae,_0x15af40){var _0x4f9ea0,_0x28fb58,_0x1ddb7a,_0x4c2c79;_0xcd6ae[_0xc42e('0x4e')]=intUtil[_0xc42e('0x4f')](_0xcd6ae[_0xc42e('0x4e')]);_0xcd6ae[_0xc42e('0x47')]=intUtil[_0xc42e('0x4f')](_0xcd6ae[_0xc42e('0x47')]);if(_0x15af40&&_0x15af40[_0xc42e('0x64')]&&_0x15af40['recordingFormat']!==_0xc42e('0x65')){logger[_0xc42e('0x1e')]('[OUTBOUND]',_0xc42e('0x52'));_0x5eb4dd[_0xc42e('0x55')]=util['format'](_0xc42e('0x53'),_0xcd6ae['serverUrl'],_0x5eb4dd[_0xc42e('0x54')],md5(_0x5eb4dd[_0xc42e('0x54')]));}return getConnection(_0xcd6ae)[_0xc42e('0x1c')](function(_0x55ec32){_0x4c2c79=_0x55ec32;return getUser(_0xcd6ae,_0x4725f2[_0xc42e('0x56')],_0x4c2c79);})[_0xc42e('0x1c')](function(_0x567e83){_0x4f9ea0=_0x567e83;return getEndUser(_0xcd6ae,_0x30dd35,_0x5eb4dd[_0xc42e('0x66')],_0x5eb4dd[_0xc42e('0x67')],_0x4c2c79);})[_0xc42e('0x1c')](function(_0x411ed3){_0x28fb58=_0x411ed3;return getTicket(_0xcd6ae,_0x4f9ea0,_0x28fb58,_0x30dd35,_0x5eb4dd,_0x30dd35[_0xc42e('0x68')],_0x4c2c79,'outbound');})[_0xc42e('0x1c')](function(_0x1bd635){_0x1ddb7a=_0x1bd635;logger[_0xc42e('0x1e')](_0xc42e('0x69'),_0x1ddb7a['id']);logger[_0xc42e('0x1e')](_0xc42e('0x6a'),_0x1ddb7a['id'],_0x4725f2['name'],_0xcd6ae[_0xc42e('0x3a')]);switch(_0xcd6ae[_0xc42e('0x3a')]){case _0xc42e('0x5b'):emit(util['format'](_0xc42e('0x5d'),_0x4725f2[_0xc42e('0x41')]),_0xc42e('0x5c'),{'recordId':_0x1ddb7a['id']});break;case'newTab':emit(util['format'](_0xc42e('0x5d'),_0x4725f2[_0xc42e('0x41')]),'trigger:browser:url',{'uri':util[_0xc42e('0x32')]('%s/%s/e',_0x4c2c79['instanceUrl'],_0x1ddb7a['id'])});break;default:logger[_0xc42e('0x61')](_0xc42e('0x6b'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0xc42e('0x63')](function(_0x421e5e){logger['error'](_0xc42e('0x6b'),JSON[_0xc42e('0x6c')](_0x421e5e));});};exports[_0xc42e('0x6d')]=function(_0x4674d8,_0x45169b,_0x16b6ab,_0x186110,_0x206319,_0x4f7bcf){var _0x32481d,_0x4fa6cf,_0x40e09e,_0x541d46;_0x4f7bcf[_0xc42e('0x4e')]=intUtil['stripTrailingSlash'](_0x4f7bcf[_0xc42e('0x4e')]);_0x4f7bcf[_0xc42e('0x47')]=intUtil[_0xc42e('0x4f')](_0x4f7bcf[_0xc42e('0x47')]);if(_0x206319&&_0x206319[_0xc42e('0x50')]){logger['info'](_0xc42e('0x6e'),'Recording\x20is\x20enabled!');_0x45169b[_0xc42e('0x55')]=util[_0xc42e('0x32')](_0xc42e('0x53'),_0x4f7bcf['serverUrl'],_0x45169b['uniqueid'],md5(_0x45169b[_0xc42e('0x54')]));}else{_0x45169b[_0xc42e('0x55')]='';}return getConnection(_0x4f7bcf)[_0xc42e('0x1c')](function(_0x1567fc){_0x541d46=_0x1567fc;if(!_[_0xc42e('0x6f')](_0x186110)){return getUser(_0x4f7bcf,_0x186110[_0xc42e('0x41')],_0x541d46);}else{return getUser(_0x4f7bcf,null,_0x541d46);}})[_0xc42e('0x1c')](function(_0x5213ee){_0x32481d=_0x5213ee;return getEndUser(_0x4f7bcf,_0x16b6ab,_0x45169b[_0xc42e('0x57')],_0x45169b[_0xc42e('0x58')],_0x541d46);})['then'](function(_0x5665a7){_0x4fa6cf=_0x5665a7;return getTicket(_0x4f7bcf,_0x32481d,_0x4fa6cf,_0x16b6ab,_0x45169b,_0x16b6ab[_0xc42e('0x68')],_0x541d46);})[_0xc42e('0x1c')](function(_0x5384f8){_0x40e09e=_0x5384f8;logger['info'](_0xc42e('0x70'),_0x40e09e['id']);logger['info'](_0xc42e('0x71'),_0x4f7bcf[_0xc42e('0x3a')]);})['catch'](function(_0x3384ca){logger[_0xc42e('0x61')](_0xc42e('0x6e'),JSON['stringify'](_0x3384ca));});}; \ 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 afa8220..2cab33b 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(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 7ba85a2..361fa8a 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 _0x81d5=['parent_type','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','isNil','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','value','Agent\x20found!','resolve','name_value_list','user_id','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','Enduser\x20found!','phone_home','first_name','','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','type','customField','string','custom_fields','content','customVariable','Variable','toLowerCase','login','username','password','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','users','contacts','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','abandoned','monitor_format','[ABANDONED]','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','redis','defaults','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','Descriptions','duration_hours','parent_id'];(function(_0x2d2e85,_0x22faa9){var _0x3e9f5e=function(_0x101c22){while(--_0x101c22){_0x2d2e85['push'](_0x2d2e85['shift']());}};_0x3e9f5e(++_0x22faa9);}(_0x81d5,0x1ab));var _0x581d=function(_0x327e1e,_0x18a30f){_0x327e1e=_0x327e1e-0x0;var _0x37032b=_0x81d5[_0x327e1e];return _0x37032b;};'use strict';var _=require(_0x581d('0x0'));var rp=require(_0x581d('0x1'));var BPromise=require('bluebird');var md5=require(_0x581d('0x2'));var util=require(_0x581d('0x3'));var Redis=require(_0x581d('0x4'));var intUtil=require(_0x581d('0x5'));var config=require(_0x581d('0x6'));var logger=require('../../../../config/logger')('sugarcrm');config[_0x581d('0x7')]=_[_0x581d('0x8')](config[_0x581d('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x581d('0x9'))(new Redis(config[_0x581d('0x7')]));var def={'method':_0x581d('0xa'),'json':!![]};function emit(_0x497368,_0xf1a3b6,_0x5efb9b){io['to'](_0x497368)['emit'](_0xf1a3b6,_0x5efb9b);}function getTicket(_0x5d8fa3,_0xdeeb73,_0x3435a9,_0x2b73b1,_0x1cd001,_0x21fb9e,_0x5f31d8,_0x3f9320){logger[_0x581d('0xb')](_0x581d('0xc'));var _0x3bf7f7=new Date();var _0x1e403e=[{'name':_0x581d('0xd'),'value':intUtil[_0x581d('0xe')](_0x2b73b1[_0x581d('0xf')],_0x1cd001,'\x20')},{'name':_0x581d('0x10'),'value':_0xdeeb73['id']},{'name':_0x581d('0x11'),'value':_0xdeeb73['id']},{'name':'description','value':intUtil[_0x581d('0xe')](_0x2b73b1[_0x581d('0x12')],_0x1cd001,'\x0a')},{'name':'date_start','value':_0x3bf7f7['toISOString']()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0x581d('0x13'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x581d('0x14'),'value':_0x3435a9['id']},{'name':_0x581d('0x15'),'value':'Contacts'},{'name':_0x581d('0x16'),'value':_0x3435a9['name']},{'name':_0x581d('0x17'),'value':_0x3f9320}];if(_0x21fb9e[_0x581d('0x18')]){_[_0x581d('0x19')](_0x21fb9e,function(_0x42f7db){if(_0x1cd001[_0x42f7db[_0x581d('0x1a')]]){_0x1e403e[_0x581d('0x1b')]({'name':_0x42f7db[_0x581d('0x1c')],'value':_0x1cd001[_0x42f7db['variableName']]});}});}return request({'form':{'method':_0x581d('0x1d'),'input_type':_0x581d('0x1e'),'response_type':_0x581d('0x1e'),'rest_data':JSON[_0x581d('0x1f')]({'session':_0x5f31d8['id'],'module_name':_0x581d('0x20'),'name_value_list':_0x1e403e})}});}function getAuth(_0x2a2aba){return util[_0x581d('0x21')](_0x581d('0x22'),new Buffer(_0x2a2aba[_0x581d('0x23')]+':X')[_0x581d('0x24')](_0x581d('0x25')));}function getServerInfo(_0xf74d2b){return request({'form':{'method':'get_server_info','input_type':_0x581d('0x1e'),'response_type':_0x581d('0x1e'),'rest_data':JSON[_0x581d('0x1f')]({'session':_0xf74d2b['id']})}});}function getUser(_0x2a4cd9,_0x2addd8,_0x4f7420){if(!_[_0x581d('0x26')](_0x2addd8)){logger[_0x581d('0xb')]('Getting\x20agent\x20with\x20name',_0x2addd8);return request({'form':{'method':_0x581d('0x27'),'input_type':_0x581d('0x1e'),'response_type':_0x581d('0x1e'),'rest_data':JSON['stringify']({'session':_0x4f7420['id'],'module_name':_0x581d('0x28'),'query':util[_0x581d('0x21')](_0x581d('0x29'),_0x2addd8),'order_by':'','offset':'0','select_fields':['id',_0x581d('0xd'),_0x581d('0x2a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x581d('0x2b')](function(_0x4b9b62){if(_0x4b9b62[_0x581d('0x2c')][_0x581d('0x18')]){var _0x36ee1b=_['find'](_0x4b9b62['entry_list'],function(_0x504f71){return _0x504f71['name_value_list'][_0x581d('0x2a')][_0x581d('0x2d')]===_0x2addd8;});if(_0x36ee1b){logger[_0x581d('0xb')](_0x581d('0x2e'));return BPromise[_0x581d('0x2f')]({'id':_0x36ee1b[_0x581d('0x30')]['id'][_0x581d('0x2d')],'name':_0x36ee1b[_0x581d('0x30')][_0x581d('0xd')][_0x581d('0x2d')]});}}logger[_0x581d('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x581d('0x2f')]({'id':_0x4f7420['name_value_list'][_0x581d('0x31')][_0x581d('0x2d')],'name':_0x4f7420[_0x581d('0x30')][_0x581d('0x2a')][_0x581d('0x2d')]});});}else{logger[_0x581d('0xb')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x581d('0x2f')]({'id':_0x4f7420[_0x581d('0x30')]['user_id']['value'],'name':_0x4f7420['name_value_list'][_0x581d('0x2a')][_0x581d('0x2d')]});}}function getEndUser(_0x34c71b,_0x2d6f9e,_0xeccfd6,_0x5399fe){logger[_0x581d('0xb')]('Searching\x20enduser\x20with\x20phone',_0xeccfd6);return request({'form':{'method':_0x581d('0x27'),'input_type':_0x581d('0x1e'),'response_type':'JSON','rest_data':JSON[_0x581d('0x1f')]({'session':_0x5399fe['id'],'module_name':_0x581d('0x32'),'query':util[_0x581d('0x21')](_0x581d('0x33'),_0xeccfd6),'order_by':'','offset':'0','select_fields':['id',_0x581d('0xd'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x581d('0x2b')](function(_0x5cb54b){if(_0x5cb54b[_0x581d('0x2c')][_0x581d('0x18')]){var _0x5ad1fe=_['find'](_0x5cb54b['entry_list'],function(_0x59fc1e){return _0x59fc1e[_0x581d('0x30')]['phone_home'][_0x581d('0x2d')]===_0xeccfd6;});if(_0x5ad1fe){logger['info'](_0x581d('0x34'));return BPromise[_0x581d('0x2f')]({'id':_0x5ad1fe[_0x581d('0x30')]['id'][_0x581d('0x2d')],'name':_0x5ad1fe[_0x581d('0x30')][_0x581d('0xd')][_0x581d('0x2d')],'phone':_0x5ad1fe[_0x581d('0x30')][_0x581d('0x35')][_0x581d('0x2d')]});}}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x581d('0x1d'),'input_type':_0x581d('0x1e'),'response_type':_0x581d('0x1e'),'rest_data':JSON['stringify']({'session':_0x5399fe['id'],'module_name':_0x581d('0x32'),'name_value_list':[{'name':_0x581d('0x36'),'value':_0x2d6f9e!==_0x581d('0x37')?_0x2d6f9e:util['format'](_0x581d('0x38'),_0xeccfd6)},{'name':_0x581d('0x35'),'value':_0xeccfd6}]})}})['then'](function(_0x3de4ca){logger[_0x581d('0xb')](_0x581d('0x39'));return BPromise[_0x581d('0x2f')]({'id':_0x3de4ca['id'],'name':_0x3de4ca[_0x581d('0x2c')][_0x581d('0x36')][_0x581d('0x2d')],'phone':_0x3de4ca['entry_list'][_0x581d('0x35')][_0x581d('0x2d')]});});}});}function request(_0x20fbf1){logger['debug'](_0x581d('0x3a'),JSON[_0x581d('0x1f')](_0x20fbf1));return rp(_['merge'](def,_0x20fbf1));}function getTags(_0x5c1b16,_0x3e1351){var _0x458851=[];if(_0x5c1b16&&_0x5c1b16[_0x581d('0x18')]>0x0){_0x458851=_['map'](_0x5c1b16,_0x3e1351);}return _0x458851;}function getCustomFields(_0x1ca4df,_0x3dad08){var _0x4a7fcd=[];var _0x31a7ce={'custom_fields':[]};if(_0x1ca4df['length']>0x0){_[_0x581d('0x19')](_0x1ca4df,function(_0x546ae1){if(_0x546ae1[_0x581d('0x3b')]==='string'&&_0x546ae1['nameField']&&!_0x546ae1[_0x581d('0x3c')]){_0x31a7ce[_0x546ae1['nameField']['toLowerCase']()]=_0x546ae1['content'][_0x581d('0x24')]();}else if(_0x546ae1[_0x581d('0x3b')]===_0x581d('0x3d')&&_0x546ae1['idField']&&_0x546ae1[_0x581d('0x3c')]){_0x31a7ce[_0x581d('0x3e')]['push']({'id':_0x546ae1['idField'],'value':_0x546ae1[_0x581d('0x3f')]['toString']()});}else if(_0x546ae1[_0x581d('0x3b')]==='variable'&&_0x546ae1[_0x581d('0x1a')]&&_0x546ae1[_0x581d('0x1c')]&&_0x546ae1['customField']){_0x3dad08[_0x546ae1[_0x581d('0x1a')]]&&_0x31a7ce[_0x581d('0x3e')][_0x581d('0x1b')]({'id':_0x546ae1[_0x581d('0x1c')],'value':_0x3dad08[_0x546ae1[_0x581d('0x1a')]]['toString']()});}else if(_0x546ae1[_0x581d('0x3b')]===_0x581d('0x40')&&_0x546ae1[_0x581d('0x41')]&&_0x546ae1[_0x581d('0x41')][_0x581d('0xd')]&&_0x546ae1[_0x581d('0x1c')]&&_0x546ae1[_0x581d('0x3c')]){_0x3dad08[_0x546ae1['Variable'][_0x581d('0xd')][_0x581d('0x42')]()]&&_0x31a7ce[_0x581d('0x3e')][_0x581d('0x1b')]({'id':_0x546ae1[_0x581d('0x1c')],'value':_0x3dad08[_0x546ae1[_0x581d('0x41')][_0x581d('0xd')]['toLowerCase']()][_0x581d('0x24')]()});}});}return _0x31a7ce;}function getConnection(_0x1f2846){return request({'method':'POST','form':{'method':_0x581d('0x43'),'input_type':'JSON','response_type':_0x581d('0x1e'),'rest_data':JSON[_0x581d('0x1f')]({'user_auth':{'user_name':_0x1f2846[_0x581d('0x44')],'password':_0x1f2846[_0x581d('0x45')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})[_0x581d('0x2b')](function(_0x3b9c05){var _0x4bd895=_0x3b9c05;if(_0x4bd895['id']){def['sessionID']=_0x4bd895['id'];return BPromise[_0x581d('0x2f')](_0x4bd895);}else{throw new Error(util[_0x581d('0x21')](_0x581d('0x46'),_0x1f2846['id']));}});}function setRelationship(_0x43bd60,_0x5d4966,_0x468642,_0x4350c3){return request({'form':{'method':_0x581d('0x47'),'input_type':_0x581d('0x1e'),'response_type':_0x581d('0x1e'),'rest_data':JSON[_0x581d('0x1f')]({'session':_0x43bd60['id'],'module_name':_0x581d('0x20'),'module_id':_0x468642['id'],'link_field_name':_0x4350c3,'related_ids':[_0x5d4966['id']]})}});}exports[_0x581d('0x48')]=function(_0x4730d9,_0x5a565e,_0x3749a0,_0x3252dc,_0x2115b5,_0x510a39){var _0x2a6ab3,_0x513b5b,_0x40ec25,_0x3bd923;_0x510a39[_0x581d('0x49')]=intUtil[_0x581d('0x4a')](_0x510a39['remoteUri']);_0x510a39['serverUrl']=intUtil[_0x581d('0x4a')](_0x510a39[_0x581d('0x4b')]);def[_0x581d('0x4c')]=util[_0x581d('0x21')](_0x581d('0x4d'),_0x510a39['remoteUri']);if(_0x2115b5&&_0x2115b5['monitor_format']){logger[_0x581d('0xb')](_0x581d('0x4e'),_0x581d('0x4f'));_0x5a565e['recordingURL']=util[_0x581d('0x21')](_0x581d('0x50'),_0x510a39[_0x581d('0x4b')],_0x5a565e[_0x581d('0x51')],md5(_0x5a565e[_0x581d('0x51')]));}else{_0x5a565e[_0x581d('0x52')]='';}return getConnection(_0x510a39)[_0x581d('0x2b')](function(_0x1dedb9){_0x3bd923=_0x1dedb9;return getUser(_0x510a39,_0x3252dc['name'],_0x3bd923);})[_0x581d('0x2b')](function(_0x311635){_0x2a6ab3=_0x311635;logger['info'](_0x581d('0x53'),_0x2a6ab3['id']);return getEndUser(_0x510a39,_0x5a565e[_0x581d('0x54')],_0x5a565e[_0x581d('0x55')],_0x3bd923);})[_0x581d('0x2b')](function(_0x223af8){_0x513b5b=_0x223af8;logger[_0x581d('0xb')](_0x581d('0x56'),_0x513b5b['id']);return getTicket(_0x510a39,_0x2a6ab3,_0x513b5b,_0x3749a0,_0x5a565e,_0x3749a0[_0x581d('0x57')],_0x3bd923,_0x581d('0x58'));})[_0x581d('0x2b')](function(_0x4249b7){_0x40ec25=_0x4249b7;logger[_0x581d('0xb')]('Ticket\x20created!');logger[_0x581d('0xb')]('The\x20Ticket\x20ID\x20is:',_0x40ec25['id']);return setRelationship(_0x3bd923,_0x2a6ab3,_0x40ec25,_0x581d('0x59'));})['then'](function(){return setRelationship(_0x3bd923,_0x513b5b,_0x40ec25,_0x581d('0x5a'));})[_0x581d('0x2b')](function(){return getServerInfo(_0x3bd923);})[_0x581d('0x2b')](function(_0x19fd4c){var _0x1dcb58=parseInt(_0x19fd4c['version'][_0x581d('0x5b')](0x0));var _0x4ef7a3=util[_0x581d('0x21')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x510a39[_0x581d('0x49')],_0x40ec25['id']);if(_0x1dcb58>0x6){_0x4ef7a3=util[_0x581d('0x21')](_0x581d('0x5c'),_0x510a39[_0x581d('0x49')],_0x40ec25['id']);}logger[_0x581d('0xb')](_0x581d('0x4e'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x581d('0x5d'),_0x3252dc[_0x581d('0xd')]),'trigger:browser:url',{'uri':_0x4ef7a3});})['catch'](function(_0x345d58){logger[_0x581d('0x5e')]('[QUEUE]',JSON[_0x581d('0x1f')](_0x345d58));});};exports[_0x581d('0x5f')]=function(_0xa21214,_0x4a6748,_0x2f5310,_0x5b553d,_0x5f31b1,_0x30e6f0,_0x293302){var _0xe1a8da,_0x44cee5,_0x3942ce,_0x4c8c96;_0x30e6f0[_0x581d('0x49')]=intUtil[_0x581d('0x4a')](_0x30e6f0[_0x581d('0x49')]);_0x30e6f0[_0x581d('0x4b')]=intUtil[_0x581d('0x4a')](_0x30e6f0[_0x581d('0x4b')]);def[_0x581d('0x4c')]=util[_0x581d('0x21')]('%s/service/v4_1/rest.php',_0x30e6f0[_0x581d('0x49')]);if(_0x293302&&_0x293302[_0x581d('0x60')]&&_0x293302[_0x581d('0x60')]!==_0x581d('0x61')){logger[_0x581d('0xb')](_0x581d('0x62'),_0x581d('0x4f'));_0x4a6748[_0x581d('0x52')]=util[_0x581d('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x30e6f0[_0x581d('0x4b')],_0x4a6748[_0x581d('0x51')],md5(_0x4a6748[_0x581d('0x51')]));}return getConnection(_0x30e6f0)['then'](function(_0xf0d76f){_0x4c8c96=_0xf0d76f;return getUser(_0x30e6f0,_0x5b553d[_0x581d('0xd')],_0x4c8c96);})[_0x581d('0x2b')](function(_0xa401c5){_0xe1a8da=_0xa401c5;logger[_0x581d('0xb')](_0x581d('0x53'),_0xe1a8da['id']);return getEndUser(_0x30e6f0,_0x4a6748[_0x581d('0x63')],_0x4a6748[_0x581d('0x64')],_0x4c8c96);})[_0x581d('0x2b')](function(_0x709197){_0x44cee5=_0x709197;logger['info'](_0x581d('0x56'),_0x44cee5['id']);return getTicket(_0x30e6f0,_0xe1a8da,_0x44cee5,_0x2f5310,_0x4a6748,_0x2f5310[_0x581d('0x57')],_0x4c8c96,_0x581d('0x65'));})[_0x581d('0x2b')](function(_0x3e6d92){_0x3942ce=_0x3e6d92;logger[_0x581d('0xb')](_0x581d('0x66'));logger[_0x581d('0xb')](_0x581d('0x67'),_0x3942ce['id']);return setRelationship(_0x4c8c96,_0xe1a8da,_0x3942ce,_0x581d('0x59'));})['then'](function(){return setRelationship(_0x4c8c96,_0x44cee5,_0x3942ce,'contacts');})[_0x581d('0x2b')](function(){return getServerInfo(_0x4c8c96);})[_0x581d('0x2b')](function(_0x2efe64){var _0x20e074=parseInt(_0x2efe64[_0x581d('0x68')][_0x581d('0x5b')](0x0));var _0xb7c37c=util['format'](_0x581d('0x69'),_0x30e6f0['remoteUri'],_0x3942ce['id']);if(_0x20e074>0x6){_0xb7c37c=util[_0x581d('0x21')](_0x581d('0x5c'),_0x30e6f0[_0x581d('0x49')],_0x3942ce['id']);}logger[_0x581d('0xb')](_0x581d('0x62'),_0x581d('0x6a'));emit(util['format'](_0x581d('0x5d'),_0x5b553d[_0x581d('0xd')]),_0x581d('0x6b'),{'uri':_0xb7c37c});})[_0x581d('0x6c')](function(_0x75595b){logger[_0x581d('0x5e')](_0x581d('0x62'),JSON[_0x581d('0x1f')](_0x75595b));});};exports[_0x581d('0x6d')]=function(_0x50bf64,_0x1642d8,_0x3e1c34,_0x48a8f1,_0x1e2d7b,_0xd9781){var _0x52ca16,_0x21b8da,_0x54e758,_0x343c2a;_0xd9781[_0x581d('0x49')]=intUtil[_0x581d('0x4a')](_0xd9781[_0x581d('0x49')]);_0xd9781[_0x581d('0x4b')]=intUtil['stripTrailingSlash'](_0xd9781[_0x581d('0x4b')]);def['uri']=util[_0x581d('0x21')](_0x581d('0x4d'),_0xd9781['remoteUri']);if(_0x1e2d7b&&_0x1e2d7b[_0x581d('0x6e')]){logger[_0x581d('0xb')](_0x581d('0x6f'),'Recording\x20is\x20enabled!');_0x1642d8[_0x581d('0x52')]=util[_0x581d('0x21')](_0x581d('0x50'),_0xd9781['serverUrl'],_0x1642d8[_0x581d('0x51')],md5(_0x1642d8['uniqueid']));}else{_0x1642d8['recordingURL']='';}return getConnection(_0xd9781)[_0x581d('0x2b')](function(_0x574b6c){_0x343c2a=_0x574b6c;if(!_[_0x581d('0x26')](_0x48a8f1)){return getUser(_0xd9781,_0x48a8f1[_0x581d('0xd')],_0x343c2a);}else{return getUser(_0xd9781,null,_0x343c2a);}})['then'](function(_0x11fb53){_0x52ca16=_0x11fb53;logger['info'](_0x581d('0x53'),_0x52ca16['id']);return getEndUser(_0xd9781,_0x1642d8[_0x581d('0x54')],_0x1642d8[_0x581d('0x55')],_0x343c2a);})[_0x581d('0x2b')](function(_0x456ec2){_0x21b8da=_0x456ec2;logger[_0x581d('0xb')](_0x581d('0x56'),_0x21b8da['id']);return getTicket(_0xd9781,_0x52ca16,_0x21b8da,_0x3e1c34,_0x1642d8,_0x3e1c34[_0x581d('0x57')],_0x343c2a,'Inbound');})[_0x581d('0x2b')](function(_0x551505){_0x54e758=_0x551505;logger[_0x581d('0xb')](_0x581d('0x66'));logger['info'](_0x581d('0x67'),_0x54e758['id']);return setRelationship(_0x343c2a,_0x52ca16,_0x54e758,'users');})[_0x581d('0x2b')](function(){return setRelationship(_0x343c2a,_0x21b8da,_0x54e758,'contacts');})[_0x581d('0x2b')](function(){return getServerInfo(_0x343c2a);})[_0x581d('0x6c')](function(_0xd9184){logger['error'](_0x581d('0x6f'),JSON['stringify'](_0xd9184));});}; \ No newline at end of file +var _0xbef6=['Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','length','find','user_name','value','Agent\x20found!','name_value_list','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','map','nameField','customField','toLowerCase','content','type','custom_fields','push','variable','Variable','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','queue','remoteUri','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Ticket\x20ID\x20is:','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Fields','Outbound','Ticket\x20created!','contacts','error','uri','[ABANDONED]','lodash','request-promise','md5','./util','../../../../config/logger','sugarcrm','defaults','redis','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_minutes','parent_type','Contacts','parent_name','direction','forEach','variableName','idField','set_entry','JSON','stringify','Calls','format','toString','base64','get_server_info','isNil'];(function(_0x5a49cf,_0x226f8e){var _0x4c58b3=function(_0x581dcc){while(--_0x581dcc){_0x5a49cf['push'](_0x5a49cf['shift']());}};_0x4c58b3(++_0x226f8e);}(_0xbef6,0x1b0));var _0x6bef=function(_0x37268b,_0x48fb02){_0x37268b=_0x37268b-0x0;var _0x40e5fa=_0xbef6[_0x37268b];return _0x40e5fa;};'use strict';var _=require(_0x6bef('0x0'));var rp=require(_0x6bef('0x1'));var BPromise=require('bluebird');var md5=require(_0x6bef('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x6bef('0x3'));var config=require('../../../../config/environment');var logger=require(_0x6bef('0x4'))(_0x6bef('0x5'));config['redis']=_[_0x6bef('0x6')](config[_0x6bef('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x6bef('0x8'))(new Redis(config[_0x6bef('0x7')]));var def={'method':'POST','json':!![]};function emit(_0x4d47d0,_0x30639d,_0x2fdc50){io['to'](_0x4d47d0)[_0x6bef('0x9')](_0x30639d,_0x2fdc50);}function getTicket(_0x19d992,_0x243616,_0x278800,_0x22ad52,_0x419c12,_0xe12a46,_0x2c9f42,_0x1a2176){logger[_0x6bef('0xa')](_0x6bef('0xb'));var _0x4ab8bd=new Date();var _0x4119d9=[{'name':_0x6bef('0xc'),'value':intUtil[_0x6bef('0xd')](_0x22ad52[_0x6bef('0xe')],_0x419c12,'\x20')},{'name':_0x6bef('0xf'),'value':_0x243616['id']},{'name':_0x6bef('0x10'),'value':_0x243616['id']},{'name':_0x6bef('0x11'),'value':intUtil[_0x6bef('0xd')](_0x22ad52[_0x6bef('0x12')],_0x419c12,'\x0a')},{'name':_0x6bef('0x13'),'value':_0x4ab8bd[_0x6bef('0x14')]()[_0x6bef('0x15')](0x0,0x13)[_0x6bef('0x16')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x6bef('0x17'),'value':'15'},{'name':'parent_id','value':_0x278800['id']},{'name':_0x6bef('0x18'),'value':_0x6bef('0x19')},{'name':_0x6bef('0x1a'),'value':_0x278800[_0x6bef('0xc')]},{'name':_0x6bef('0x1b'),'value':_0x1a2176}];if(_0xe12a46['length']){_[_0x6bef('0x1c')](_0xe12a46,function(_0x2cb549){if(_0x419c12[_0x2cb549[_0x6bef('0x1d')]]){_0x4119d9['push']({'name':_0x2cb549[_0x6bef('0x1e')],'value':_0x419c12[_0x2cb549[_0x6bef('0x1d')]]});}});}return request({'form':{'method':_0x6bef('0x1f'),'input_type':_0x6bef('0x20'),'response_type':_0x6bef('0x20'),'rest_data':JSON[_0x6bef('0x21')]({'session':_0x2c9f42['id'],'module_name':_0x6bef('0x22'),'name_value_list':_0x4119d9})}});}function getAuth(_0x81015c){return util[_0x6bef('0x23')]('Basic\x20%s',new Buffer(_0x81015c['apiKey']+':X')[_0x6bef('0x24')](_0x6bef('0x25')));}function getServerInfo(_0x2241eb){return request({'form':{'method':_0x6bef('0x26'),'input_type':_0x6bef('0x20'),'response_type':_0x6bef('0x20'),'rest_data':JSON[_0x6bef('0x21')]({'session':_0x2241eb['id']})}});}function getUser(_0x5d70e3,_0x43e140,_0x236b59){if(!_[_0x6bef('0x27')](_0x43e140)){logger[_0x6bef('0xa')](_0x6bef('0x28'),_0x43e140);return request({'form':{'method':'get_entry_list','input_type':_0x6bef('0x20'),'response_type':_0x6bef('0x20'),'rest_data':JSON[_0x6bef('0x21')]({'session':_0x236b59['id'],'module_name':_0x6bef('0x29'),'query':util[_0x6bef('0x23')](_0x6bef('0x2a'),_0x43e140),'order_by':'','offset':'0','select_fields':['id',_0x6bef('0xc'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6bef('0x2b')](function(_0x3e0cd8){if(_0x3e0cd8[_0x6bef('0x2c')][_0x6bef('0x2d')]){var _0x2e4416=_[_0x6bef('0x2e')](_0x3e0cd8[_0x6bef('0x2c')],function(_0x5155f8){return _0x5155f8['name_value_list'][_0x6bef('0x2f')][_0x6bef('0x30')]===_0x43e140;});if(_0x2e4416){logger[_0x6bef('0xa')](_0x6bef('0x31'));return BPromise['resolve']({'id':_0x2e4416[_0x6bef('0x32')]['id'][_0x6bef('0x30')],'name':_0x2e4416[_0x6bef('0x32')][_0x6bef('0xc')][_0x6bef('0x30')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x6bef('0x33')]({'id':_0x236b59[_0x6bef('0x32')][_0x6bef('0x34')][_0x6bef('0x30')],'name':_0x236b59[_0x6bef('0x32')]['user_name'][_0x6bef('0x30')]});});}else{logger[_0x6bef('0xa')](_0x6bef('0x35'));return BPromise[_0x6bef('0x33')]({'id':_0x236b59[_0x6bef('0x32')][_0x6bef('0x34')][_0x6bef('0x30')],'name':_0x236b59['name_value_list']['user_name'][_0x6bef('0x30')]});}}function getEndUser(_0xb0a35,_0x478761,_0x586b7a,_0x1f6e3f){logger[_0x6bef('0xa')](_0x6bef('0x36'),_0x586b7a);return request({'form':{'method':_0x6bef('0x37'),'input_type':'JSON','response_type':_0x6bef('0x20'),'rest_data':JSON[_0x6bef('0x21')]({'session':_0x1f6e3f['id'],'module_name':'Contacts','query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x586b7a),'order_by':'','offset':'0','select_fields':['id',_0x6bef('0xc'),_0x6bef('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6bef('0x2b')](function(_0x221f46){if(_0x221f46[_0x6bef('0x2c')]['length']){var _0x2d3025=_[_0x6bef('0x2e')](_0x221f46[_0x6bef('0x2c')],function(_0x3b3537){return _0x3b3537['name_value_list']['phone_home'][_0x6bef('0x30')]===_0x586b7a;});if(_0x2d3025){logger['info']('Enduser\x20found!');return BPromise[_0x6bef('0x33')]({'id':_0x2d3025[_0x6bef('0x32')]['id'][_0x6bef('0x30')],'name':_0x2d3025[_0x6bef('0x32')][_0x6bef('0xc')][_0x6bef('0x30')],'phone':_0x2d3025[_0x6bef('0x32')][_0x6bef('0x38')][_0x6bef('0x30')]});}}else{logger[_0x6bef('0xa')](_0x6bef('0x39'));return request({'form':{'method':_0x6bef('0x1f'),'input_type':_0x6bef('0x20'),'response_type':_0x6bef('0x20'),'rest_data':JSON[_0x6bef('0x21')]({'session':_0x1f6e3f['id'],'module_name':_0x6bef('0x19'),'name_value_list':[{'name':_0x6bef('0x3a'),'value':_0x478761!==_0x6bef('0x3b')?_0x478761:util[_0x6bef('0x23')](_0x6bef('0x3c'),_0x586b7a)},{'name':_0x6bef('0x38'),'value':_0x586b7a}]})}})['then'](function(_0x35193d){logger['info'](_0x6bef('0x3d'));return BPromise[_0x6bef('0x33')]({'id':_0x35193d['id'],'name':_0x35193d['entry_list']['first_name']['value'],'phone':_0x35193d[_0x6bef('0x2c')][_0x6bef('0x38')][_0x6bef('0x30')]});});}});}function request(_0x2bc3de){logger[_0x6bef('0x3e')]('[HTTP]',JSON['stringify'](_0x2bc3de));return rp(_[_0x6bef('0x3f')](def,_0x2bc3de));}function getTags(_0x446664,_0x405166){var _0x13c5c7=[];if(_0x446664&&_0x446664['length']>0x0){_0x13c5c7=_[_0x6bef('0x40')](_0x446664,_0x405166);}return _0x13c5c7;}function getCustomFields(_0x2e04e6,_0x31c316){var _0x356626=[];var _0x555c53={'custom_fields':[]};if(_0x2e04e6['length']>0x0){_[_0x6bef('0x1c')](_0x2e04e6,function(_0x4ad621){if(_0x4ad621['type']==='string'&&_0x4ad621[_0x6bef('0x41')]&&!_0x4ad621[_0x6bef('0x42')]){_0x555c53[_0x4ad621['nameField'][_0x6bef('0x43')]()]=_0x4ad621[_0x6bef('0x44')]['toString']();}else if(_0x4ad621[_0x6bef('0x45')]==='string'&&_0x4ad621[_0x6bef('0x1e')]&&_0x4ad621[_0x6bef('0x42')]){_0x555c53[_0x6bef('0x46')][_0x6bef('0x47')]({'id':_0x4ad621[_0x6bef('0x1e')],'value':_0x4ad621['content'][_0x6bef('0x24')]()});}else if(_0x4ad621[_0x6bef('0x45')]===_0x6bef('0x48')&&_0x4ad621['variableName']&&_0x4ad621[_0x6bef('0x1e')]&&_0x4ad621[_0x6bef('0x42')]){_0x31c316[_0x4ad621[_0x6bef('0x1d')]]&&_0x555c53[_0x6bef('0x46')]['push']({'id':_0x4ad621[_0x6bef('0x1e')],'value':_0x31c316[_0x4ad621['variableName']][_0x6bef('0x24')]()});}else if(_0x4ad621[_0x6bef('0x45')]==='customVariable'&&_0x4ad621[_0x6bef('0x49')]&&_0x4ad621[_0x6bef('0x49')][_0x6bef('0xc')]&&_0x4ad621[_0x6bef('0x1e')]&&_0x4ad621['customField']){_0x31c316[_0x4ad621[_0x6bef('0x49')][_0x6bef('0xc')][_0x6bef('0x43')]()]&&_0x555c53['custom_fields']['push']({'id':_0x4ad621[_0x6bef('0x1e')],'value':_0x31c316[_0x4ad621[_0x6bef('0x49')][_0x6bef('0xc')]['toLowerCase']()]['toString']()});}});}return _0x555c53;}function getConnection(_0x2ea9e3){return request({'method':'POST','form':{'method':'login','input_type':_0x6bef('0x20'),'response_type':_0x6bef('0x20'),'rest_data':JSON[_0x6bef('0x21')]({'user_auth':{'user_name':_0x2ea9e3[_0x6bef('0x4a')],'password':_0x2ea9e3[_0x6bef('0x4b')],'encryption':_0x6bef('0x4c')},'application':_0x6bef('0x4d')})}})[_0x6bef('0x2b')](function(_0x595599){var _0x52ab2f=_0x595599;if(_0x52ab2f['id']){def[_0x6bef('0x4e')]=_0x52ab2f['id'];return BPromise[_0x6bef('0x33')](_0x52ab2f);}else{throw new Error(util[_0x6bef('0x23')]('Account\x20%d\x20is\x20not\x20valid',_0x2ea9e3['id']));}});}function setRelationship(_0x2aecc0,_0x44b295,_0x19435c,_0x1a26bb){return request({'form':{'method':'set_relationship','input_type':_0x6bef('0x20'),'response_type':_0x6bef('0x20'),'rest_data':JSON[_0x6bef('0x21')]({'session':_0x2aecc0['id'],'module_name':'Calls','module_id':_0x19435c['id'],'link_field_name':_0x1a26bb,'related_ids':[_0x44b295['id']]})}});}exports[_0x6bef('0x4f')]=function(_0x583110,_0x669dc8,_0xacb023,_0x43d76c,_0x38439b,_0x2a0cb9){var _0xc55180,_0xb3d031,_0x2dbd4e,_0x1b3fdd;_0x2a0cb9[_0x6bef('0x50')]=intUtil[_0x6bef('0x51')](_0x2a0cb9[_0x6bef('0x50')]);_0x2a0cb9[_0x6bef('0x52')]=intUtil[_0x6bef('0x51')](_0x2a0cb9[_0x6bef('0x52')]);def['uri']=util[_0x6bef('0x23')]('%s/service/v4_1/rest.php',_0x2a0cb9[_0x6bef('0x50')]);if(_0x38439b&&_0x38439b[_0x6bef('0x53')]){logger[_0x6bef('0xa')](_0x6bef('0x54'),'Recording\x20is\x20enabled!');_0x669dc8[_0x6bef('0x55')]=util[_0x6bef('0x23')](_0x6bef('0x56'),_0x2a0cb9[_0x6bef('0x52')],_0x669dc8[_0x6bef('0x57')],md5(_0x669dc8[_0x6bef('0x57')]));}else{_0x669dc8['recordingURL']='';}return getConnection(_0x2a0cb9)[_0x6bef('0x2b')](function(_0x22167a){_0x1b3fdd=_0x22167a;return getUser(_0x2a0cb9,_0x43d76c['name'],_0x1b3fdd);})[_0x6bef('0x2b')](function(_0x32997c){_0xc55180=_0x32997c;logger[_0x6bef('0xa')]('The\x20User\x20ID\x20is:',_0xc55180['id']);return getEndUser(_0x2a0cb9,_0x669dc8[_0x6bef('0x58')],_0x669dc8[_0x6bef('0x59')],_0x1b3fdd);})[_0x6bef('0x2b')](function(_0x4e8cb0){_0xb3d031=_0x4e8cb0;logger[_0x6bef('0xa')](_0x6bef('0x5a'),_0xb3d031['id']);return getTicket(_0x2a0cb9,_0xc55180,_0xb3d031,_0xacb023,_0x669dc8,_0xacb023['Fields'],_0x1b3fdd,_0x6bef('0x5b'));})['then'](function(_0x45c24a){_0x2dbd4e=_0x45c24a;logger[_0x6bef('0xa')]('Ticket\x20created!');logger['info'](_0x6bef('0x5c'),_0x2dbd4e['id']);return setRelationship(_0x1b3fdd,_0xc55180,_0x2dbd4e,_0x6bef('0x5d'));})[_0x6bef('0x2b')](function(){return setRelationship(_0x1b3fdd,_0xb3d031,_0x2dbd4e,'contacts');})[_0x6bef('0x2b')](function(){return getServerInfo(_0x1b3fdd);})[_0x6bef('0x2b')](function(_0x217cf3){var _0x13224e=parseInt(_0x217cf3[_0x6bef('0x5e')][_0x6bef('0x5f')](0x0));var _0x150fd3=util[_0x6bef('0x23')](_0x6bef('0x60'),_0x2a0cb9[_0x6bef('0x50')],_0x2dbd4e['id']);if(_0x13224e>0x6){_0x150fd3=util[_0x6bef('0x23')](_0x6bef('0x61'),_0x2a0cb9[_0x6bef('0x50')],_0x2dbd4e['id']);}logger[_0x6bef('0xa')]('[QUEUE]',_0x6bef('0x62'));emit(util[_0x6bef('0x23')](_0x6bef('0x63'),_0x43d76c[_0x6bef('0xc')]),_0x6bef('0x64'),{'uri':_0x150fd3});})[_0x6bef('0x65')](function(_0x3590e4){logger['error'](_0x6bef('0x54'),JSON['stringify'](_0x3590e4));});};exports[_0x6bef('0x66')]=function(_0x5b33a0,_0x13da12,_0x185599,_0x46ac46,_0x29e81f,_0x5bbeec,_0x1589c0){var _0x59566c,_0x26c4f1,_0x367d6d,_0x72fba8;_0x5bbeec[_0x6bef('0x50')]=intUtil['stripTrailingSlash'](_0x5bbeec[_0x6bef('0x50')]);_0x5bbeec[_0x6bef('0x52')]=intUtil[_0x6bef('0x51')](_0x5bbeec['serverUrl']);def['uri']=util['format'](_0x6bef('0x67'),_0x5bbeec[_0x6bef('0x50')]);if(_0x1589c0&&_0x1589c0[_0x6bef('0x68')]&&_0x1589c0[_0x6bef('0x68')]!==_0x6bef('0x69')){logger['info'](_0x6bef('0x6a'),_0x6bef('0x6b'));_0x13da12['recordingURL']=util[_0x6bef('0x23')](_0x6bef('0x56'),_0x5bbeec['serverUrl'],_0x13da12[_0x6bef('0x57')],md5(_0x13da12[_0x6bef('0x57')]));}return getConnection(_0x5bbeec)[_0x6bef('0x2b')](function(_0x5f580c){_0x72fba8=_0x5f580c;return getUser(_0x5bbeec,_0x46ac46[_0x6bef('0xc')],_0x72fba8);})[_0x6bef('0x2b')](function(_0x44fe41){_0x59566c=_0x44fe41;logger[_0x6bef('0xa')](_0x6bef('0x6c'),_0x59566c['id']);return getEndUser(_0x5bbeec,_0x13da12[_0x6bef('0x6d')],_0x13da12[_0x6bef('0x6e')],_0x72fba8);})[_0x6bef('0x2b')](function(_0x581122){_0x26c4f1=_0x581122;logger[_0x6bef('0xa')](_0x6bef('0x5a'),_0x26c4f1['id']);return getTicket(_0x5bbeec,_0x59566c,_0x26c4f1,_0x185599,_0x13da12,_0x185599[_0x6bef('0x6f')],_0x72fba8,_0x6bef('0x70'));})['then'](function(_0x2521a2){_0x367d6d=_0x2521a2;logger[_0x6bef('0xa')](_0x6bef('0x71'));logger[_0x6bef('0xa')](_0x6bef('0x5c'),_0x367d6d['id']);return setRelationship(_0x72fba8,_0x59566c,_0x367d6d,_0x6bef('0x5d'));})[_0x6bef('0x2b')](function(){return setRelationship(_0x72fba8,_0x26c4f1,_0x367d6d,_0x6bef('0x72'));})['then'](function(){return getServerInfo(_0x72fba8);})['then'](function(_0x4daaa4){var _0xa75533=parseInt(_0x4daaa4[_0x6bef('0x5e')][_0x6bef('0x5f')](0x0));var _0x188992=util['format'](_0x6bef('0x60'),_0x5bbeec['remoteUri'],_0x367d6d['id']);if(_0xa75533>0x6){_0x188992=util[_0x6bef('0x23')](_0x6bef('0x61'),_0x5bbeec[_0x6bef('0x50')],_0x367d6d['id']);}logger[_0x6bef('0xa')](_0x6bef('0x6a'),_0x6bef('0x62'));emit(util['format'](_0x6bef('0x63'),_0x46ac46['name']),_0x6bef('0x64'),{'uri':_0x188992});})[_0x6bef('0x65')](function(_0x14d504){logger[_0x6bef('0x73')](_0x6bef('0x6a'),JSON[_0x6bef('0x21')](_0x14d504));});};exports['abandoned']=function(_0x3c3521,_0x4ff3fa,_0x37d222,_0x481d84,_0x3d6c4f,_0x18f27a){var _0x41d8df,_0x11a878,_0x44449e,_0xb33cc8;_0x18f27a[_0x6bef('0x50')]=intUtil[_0x6bef('0x51')](_0x18f27a[_0x6bef('0x50')]);_0x18f27a[_0x6bef('0x52')]=intUtil[_0x6bef('0x51')](_0x18f27a[_0x6bef('0x52')]);def[_0x6bef('0x74')]=util[_0x6bef('0x23')]('%s/service/v4_1/rest.php',_0x18f27a[_0x6bef('0x50')]);if(_0x3d6c4f&&_0x3d6c4f['monitor_format']){logger[_0x6bef('0xa')](_0x6bef('0x75'),_0x6bef('0x6b'));_0x4ff3fa[_0x6bef('0x55')]=util[_0x6bef('0x23')](_0x6bef('0x56'),_0x18f27a[_0x6bef('0x52')],_0x4ff3fa[_0x6bef('0x57')],md5(_0x4ff3fa[_0x6bef('0x57')]));}else{_0x4ff3fa[_0x6bef('0x55')]='';}return getConnection(_0x18f27a)['then'](function(_0x4ec894){_0xb33cc8=_0x4ec894;if(!_[_0x6bef('0x27')](_0x481d84)){return getUser(_0x18f27a,_0x481d84[_0x6bef('0xc')],_0xb33cc8);}else{return getUser(_0x18f27a,null,_0xb33cc8);}})[_0x6bef('0x2b')](function(_0x30980a){_0x41d8df=_0x30980a;logger[_0x6bef('0xa')]('The\x20User\x20ID\x20is:',_0x41d8df['id']);return getEndUser(_0x18f27a,_0x4ff3fa[_0x6bef('0x58')],_0x4ff3fa[_0x6bef('0x59')],_0xb33cc8);})[_0x6bef('0x2b')](function(_0x15c162){_0x11a878=_0x15c162;logger['info']('The\x20Enduser\x20ID\x20is:',_0x11a878['id']);return getTicket(_0x18f27a,_0x41d8df,_0x11a878,_0x37d222,_0x4ff3fa,_0x37d222['Fields'],_0xb33cc8,_0x6bef('0x5b'));})[_0x6bef('0x2b')](function(_0x4d4837){_0x44449e=_0x4d4837;logger['info']('Ticket\x20created!');logger[_0x6bef('0xa')](_0x6bef('0x5c'),_0x44449e['id']);return setRelationship(_0xb33cc8,_0x41d8df,_0x44449e,_0x6bef('0x5d'));})[_0x6bef('0x2b')](function(){return setRelationship(_0xb33cc8,_0x11a878,_0x44449e,_0x6bef('0x72'));})['then'](function(){return getServerInfo(_0xb33cc8);})[_0x6bef('0x65')](function(_0x43fc27){logger[_0x6bef('0x73')](_0x6bef('0x75'),JSON[_0x6bef('0x21')](_0x43fc27));});}; \ 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 dd27625..932c9c0 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 _0xbd4d=['%s:\x20%s','customVariable','join','stripTrailingSlash','slice','substring','lastIndexOf','isNil','test','lodash','util','getString','length','sortBy','content','variable','variableName','push','toString','type','Variable','name','toLowerCase','keyValue','keyType','string','key','format'];(function(_0x39d39d,_0x5586bd){var _0x577ac3=function(_0x12f9f2){while(--_0x12f9f2){_0x39d39d['push'](_0x39d39d['shift']());}};_0x577ac3(++_0x5586bd);}(_0xbd4d,0x191));var _0xdbd4=function(_0x11a383,_0x4e05ae){_0x11a383=_0x11a383-0x0;var _0x49f2bb=_0xbd4d[_0x11a383];return _0x49f2bb;};'use strict';var _=require(_0xdbd4('0x0'));var util=require(_0xdbd4('0x1'));exports[_0xdbd4('0x2')]=function(_0x1f5dbd,_0x1b8455,_0x4417d2){var _0x578062=[];if(_0x1f5dbd[_0xdbd4('0x3')]>0x0){var _0x1b4b2d=_[_0xdbd4('0x4')](_0x1f5dbd,['id']);for(var _0x426150=0x0;_0x426150<_0x1b4b2d[_0xdbd4('0x3')];_0x426150++){var _0x53eb9e=_0x1b4b2d[_0x426150];if(_0x53eb9e['type']==='string'){_0x578062['push'](_0x53eb9e[_0xdbd4('0x5')]);}else if(_0x53eb9e['type']===_0xdbd4('0x6')&&_0x53eb9e[_0xdbd4('0x7')]){_0x1b8455[_0x53eb9e[_0xdbd4('0x7')]]&&_0x578062[_0xdbd4('0x8')](_0x1b8455[_0x53eb9e[_0xdbd4('0x7')]][_0xdbd4('0x9')]());}else if(_0x53eb9e[_0xdbd4('0xa')]==='customVariable'&&_0x53eb9e[_0xdbd4('0xb')]&&_0x53eb9e[_0xdbd4('0xb')][_0xdbd4('0xc')]){_0x1b8455[_0x53eb9e[_0xdbd4('0xb')][_0xdbd4('0xc')][_0xdbd4('0xd')]()]&&_0x578062[_0xdbd4('0x8')](_0x1b8455[_0x53eb9e[_0xdbd4('0xb')]['name'][_0xdbd4('0xd')]()][_0xdbd4('0x9')]());}else if(_0x53eb9e[_0xdbd4('0xa')]===_0xdbd4('0xe')){if(_0x53eb9e[_0xdbd4('0xf')]===_0xdbd4('0x10')&&_0x53eb9e[_0xdbd4('0x11')]){_0x578062[_0xdbd4('0x8')](util[_0xdbd4('0x12')]('%s:\x20%s',_0x53eb9e['key'],_0x53eb9e['keyContent']));}else if(_0x53eb9e['keyType']==='variable'&&_0x53eb9e[_0xdbd4('0x7')]&&_0x53eb9e[_0xdbd4('0x11')]){_0x1b8455[_0x53eb9e[_0xdbd4('0x7')]]&&_0x578062[_0xdbd4('0x8')](util[_0xdbd4('0x12')](_0xdbd4('0x13'),_0x53eb9e[_0xdbd4('0x11')],_0x1b8455[_0x53eb9e[_0xdbd4('0x7')]]));}else if(_0x53eb9e[_0xdbd4('0xf')]===_0xdbd4('0x14')&&_0x53eb9e[_0xdbd4('0xb')]&&_0x53eb9e[_0xdbd4('0xb')][_0xdbd4('0xc')]&&_0x53eb9e[_0xdbd4('0x11')]){_0x1b8455[_0x53eb9e['Variable'][_0xdbd4('0xc')][_0xdbd4('0xd')]()]&&_0x578062[_0xdbd4('0x8')](util[_0xdbd4('0x12')]('%s:\x20%s',_0x53eb9e[_0xdbd4('0x11')],_0x1b8455[_0x53eb9e[_0xdbd4('0xb')][_0xdbd4('0xc')][_0xdbd4('0xd')]()]));}}}}return _0x578062[_0xdbd4('0x15')](_0x4417d2);};exports[_0xdbd4('0x16')]=function(_0x349224){var _0x243500=_0x349224[_0xdbd4('0x17')](-0x1);if(_0x243500==='/'){_0x349224=_0x349224[_0xdbd4('0x18')](0x0,_0x349224[_0xdbd4('0x19')](_0x243500));}return _0x349224;};exports['validateEmail']=function(_0x53305e){if(!_[_0xdbd4('0x1a')](_0x53305e)&&_0x53305e!==''){var _0x2582a9=/^(([^<>()\[\]\\.,;:\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 _0x2582a9[_0xdbd4('0x1b')](String(_0x53305e)[_0xdbd4('0xd')]());}else{return![];}}; \ No newline at end of file +var _0xdf3a=['string','content','type','variable','variableName','push','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','util','getString','length','sortBy'];(function(_0x37ba86,_0x47e745){var _0x42308c=function(_0x5438e7){while(--_0x5438e7){_0x37ba86['push'](_0x37ba86['shift']());}};_0x42308c(++_0x47e745);}(_0xdf3a,0x11e));var _0xadf3=function(_0x26a013,_0x5b329e){_0x26a013=_0x26a013-0x0;var _0x51f08f=_0xdf3a[_0x26a013];return _0x51f08f;};'use strict';var _=require('lodash');var util=require(_0xadf3('0x0'));exports[_0xadf3('0x1')]=function(_0x454ded,_0x3ad05c,_0x2b85b3){var _0x45f0ae=[];if(_0x454ded[_0xadf3('0x2')]>0x0){var _0x2e1b59=_[_0xadf3('0x3')](_0x454ded,['id']);for(var _0x51f6c4=0x0;_0x51f6c4<_0x2e1b59[_0xadf3('0x2')];_0x51f6c4++){var _0x22eee4=_0x2e1b59[_0x51f6c4];if(_0x22eee4['type']===_0xadf3('0x4')){_0x45f0ae['push'](_0x22eee4[_0xadf3('0x5')]);}else if(_0x22eee4[_0xadf3('0x6')]===_0xadf3('0x7')&&_0x22eee4[_0xadf3('0x8')]){_0x3ad05c[_0x22eee4['variableName']]&&_0x45f0ae[_0xadf3('0x9')](_0x3ad05c[_0x22eee4[_0xadf3('0x8')]][_0xadf3('0xa')]());}else if(_0x22eee4['type']===_0xadf3('0xb')&&_0x22eee4[_0xadf3('0xc')]&&_0x22eee4[_0xadf3('0xc')][_0xadf3('0xd')]){_0x3ad05c[_0x22eee4[_0xadf3('0xc')][_0xadf3('0xd')][_0xadf3('0xe')]()]&&_0x45f0ae['push'](_0x3ad05c[_0x22eee4['Variable']['name'][_0xadf3('0xe')]()][_0xadf3('0xa')]());}else if(_0x22eee4['type']===_0xadf3('0xf')){if(_0x22eee4[_0xadf3('0x10')]===_0xadf3('0x4')&&_0x22eee4[_0xadf3('0x11')]){_0x45f0ae[_0xadf3('0x9')](util[_0xadf3('0x12')](_0xadf3('0x13'),_0x22eee4[_0xadf3('0x11')],_0x22eee4[_0xadf3('0x14')]));}else if(_0x22eee4[_0xadf3('0x10')]===_0xadf3('0x7')&&_0x22eee4[_0xadf3('0x8')]&&_0x22eee4[_0xadf3('0x11')]){_0x3ad05c[_0x22eee4['variableName']]&&_0x45f0ae[_0xadf3('0x9')](util[_0xadf3('0x12')]('%s:\x20%s',_0x22eee4[_0xadf3('0x11')],_0x3ad05c[_0x22eee4[_0xadf3('0x8')]]));}else if(_0x22eee4[_0xadf3('0x10')]===_0xadf3('0xb')&&_0x22eee4['Variable']&&_0x22eee4[_0xadf3('0xc')][_0xadf3('0xd')]&&_0x22eee4[_0xadf3('0x11')]){_0x3ad05c[_0x22eee4['Variable'][_0xadf3('0xd')][_0xadf3('0xe')]()]&&_0x45f0ae[_0xadf3('0x9')](util[_0xadf3('0x12')](_0xadf3('0x13'),_0x22eee4[_0xadf3('0x11')],_0x3ad05c[_0x22eee4[_0xadf3('0xc')]['name'][_0xadf3('0xe')]()]));}}}}return _0x45f0ae[_0xadf3('0x15')](_0x2b85b3);};exports[_0xadf3('0x16')]=function(_0x50bddb){var _0x2fd68b=_0x50bddb[_0xadf3('0x17')](-0x1);if(_0x2fd68b==='/'){_0x50bddb=_0x50bddb[_0xadf3('0x18')](0x0,_0x50bddb[_0xadf3('0x19')](_0x2fd68b));}return _0x50bddb;};exports[_0xadf3('0x1a')]=function(_0x6b1772){if(!_[_0xadf3('0x1b')](_0x6b1772)&&_0x6b1772!==''){var _0x1edce4=/^(([^<>()\[\]\\.,;:\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 _0x1edce4[_0xadf3('0x1c')](String(_0x6b1772)[_0xadf3('0xe')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 8f769d1..f35e451 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 _0x9957=['query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','Agent\x20found!','email1','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','catch','GET','%s/webservice.php','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','lastname','getEndUser','accessKey','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','The\x20Enduser\x20ID\x20is:','user:%s','abandoned','[ABANDONED]','Ticket\x20created!','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','length','forEach','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','Creating\x20new\x20ticket...','Normal','Subjects','getString','Descriptions','POST','format','remoteUri','create','username','sessionName','HelpDesk','stringify','then','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','info','Getting\x20agent\x20with\x20email'];(function(_0x58d1d7,_0x5e4958){var _0x52fe28=function(_0x2d6596){while(--_0x2d6596){_0x58d1d7['push'](_0x58d1d7['shift']());}};_0x52fe28(++_0x5e4958);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var BPromise=require(_0x7995('0x2'));var md5=require(_0x7995('0x3'));var util=require('util');var Redis=require(_0x7995('0x4'));var intUtil=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('vTiger');config[_0x7995('0x8')]=_[_0x7995('0x9')](config[_0x7995('0x8')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x8')]));function emit(_0x4996ca,_0x465276,_0x1cad37){io['to'](_0x4996ca)['emit'](_0x465276,_0x1cad37);}function getCustomFields(_0xa2e5f0,_0x3116fb){var _0x18c8a3={};if(_0xa2e5f0[_0x7995('0xc')]>0x0){_[_0x7995('0xd')](_0xa2e5f0,function(_0x1e400a){if(_0x1e400a[_0x7995('0xe')]==='string'&&_0x1e400a[_0x7995('0xf')]){_0x18c8a3[_0x1e400a[_0x7995('0xf')]]=_0x1e400a['content'][_0x7995('0x10')]();}else if(_0x1e400a[_0x7995('0xe')]===_0x7995('0x11')&&_0x1e400a[_0x7995('0x12')]&&_0x1e400a[_0x7995('0xf')]&&_0x3116fb[_0x1e400a[_0x7995('0x12')]]){_0x18c8a3[_0x1e400a[_0x7995('0xf')]]=_0x3116fb[_0x1e400a['variableName']]['toString']();}else if(_0x1e400a[_0x7995('0xe')]===_0x7995('0x13')&&_0x1e400a[_0x7995('0x14')]&&_0x1e400a[_0x7995('0x14')][_0x7995('0x15')]&&_0x1e400a[_0x7995('0xf')]&&_0x3116fb[_0x1e400a[_0x7995('0x14')][_0x7995('0x15')]['toLowerCase']()]){_0x18c8a3[_0x1e400a[_0x7995('0xf')]]=_0x3116fb[_0x1e400a['Variable'][_0x7995('0x15')][_0x7995('0x16')]()][_0x7995('0x10')]();}});}return _0x18c8a3;}function createTicket(_0x291317,_0x1e1415,_0x37a7d4,_0x4faa60,_0x54c9ae,_0x2536c8,_0x5e6f90){logger['info'](_0x7995('0x17'));var _0x3d463e=_['merge']({'parent_id':'','assigned_user_id':_0x1e1415['id'],'ticketpriorities':_0x7995('0x18'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x4faa60[_0x7995('0x19')],_0x54c9ae,'\x20'),'description':intUtil[_0x7995('0x1a')](_0x4faa60[_0x7995('0x1b')],_0x54c9ae,'\x0a'),'contact_id':_0x37a7d4['id']},getCustomFields(_0x2536c8,_0x54c9ae));var _0x1a8568={'method':_0x7995('0x1c'),'uri':util[_0x7995('0x1d')]('%s/webservice.php',_0x291317[_0x7995('0x1e')]),'form':{'operation':_0x7995('0x1f'),'username':_0x291317[_0x7995('0x20')],'sessionName':_0x5e6f90[_0x7995('0x21')],'elementType':_0x7995('0x22'),'element':JSON[_0x7995('0x23')](_0x3d463e)},'json':!![]};return request(_0x1a8568)[_0x7995('0x24')](function(_0x472195){if(_0x472195['success']){return BPromise[_0x7995('0x25')]({'id':_0x472195[_0x7995('0x26')]['id']});}else{throw new Error(util[_0x7995('0x1d')](_0x7995('0x27'),JSON[_0x7995('0x23')](_0x472195[_0x7995('0x28')])));}})['catch'](function(_0x47625f){var _0x5911c3=_0x47625f[_0x7995('0x29')]||0x1f4;logger[_0x7995('0x28')](_0x7995('0x2a'),_0x7995('0x2b'),_0x5911c3,JSON[_0x7995('0x23')](_0x47625f));});}function getUser(_0x4b6f99,_0x9b2a15,_0x514445){if(intUtil[_0x7995('0x2c')](_0x9b2a15)){logger[_0x7995('0x2d')](_0x7995('0x2e'),_0x9b2a15);return request({'method':'GET','uri':util['format']('%s/webservice.php',_0x4b6f99[_0x7995('0x1e')]),'qs':{'operation':_0x7995('0x2f'),'username':_0x4b6f99[_0x7995('0x20')],'sessionName':_0x514445[_0x7995('0x21')],'query':util[_0x7995('0x1d')](_0x7995('0x30'),_0x9b2a15)},'json':!![]})['then'](function(_0x481c74){if(_0x481c74[_0x7995('0x31')]&&_0x481c74['result'][_0x7995('0xc')]){logger[_0x7995('0x2d')](_0x7995('0x32'));return BPromise[_0x7995('0x25')]({'id':_0x481c74[_0x7995('0x26')][0x0]['id'],'email':_0x481c74['result'][0x0][_0x7995('0x33')],'name':_0x481c74[_0x7995('0x26')][0x0]['first_name']+'\x20'+_0x481c74['result']['last_name']});}else{logger[_0x7995('0x2d')](_0x7995('0x34'));return BPromise['resolve']({'id':_0x514445[_0x7995('0x35')],'email':_0x4b6f99['username'],'name':_0x7995('0x36')});}})[_0x7995('0x37')](function(_0x177cb4){var _0x5014d2=_0x177cb4['statusCode']||0x1f4;logger[_0x7995('0x28')]('[vTiger],\x20%s,\x20%s,\x20%s','getUser',_0x5014d2,JSON[_0x7995('0x23')](_0x177cb4));});}else{logger[_0x7995('0x2d')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x7995('0x25')]({'id':_0x514445[_0x7995('0x35')],'email':_0x4b6f99[_0x7995('0x20')],'name':_0x7995('0x36')})[_0x7995('0x37')](function(_0x53002a){var _0x2d4285=_0x53002a[_0x7995('0x29')]||0x1f4;logger[_0x7995('0x28')](_0x7995('0x2a'),'getUser',_0x2d4285,JSON[_0x7995('0x23')](_0x53002a));});}}function getEndUser(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee){logger[_0x7995('0x2d')]('Searching\x20end\x20user\x20with\x20phone',_0xe5ea43);return request({'method':_0x7995('0x38'),'uri':util[_0x7995('0x1d')](_0x7995('0x39'),_0x235df7[_0x7995('0x1e')]),'qs':{'operation':_0x7995('0x2f'),'username':_0x235df7[_0x7995('0x20')],'sessionName':_0x1f5bee[_0x7995('0x21')],'query':util[_0x7995('0x1d')](_0x7995('0x3a'),_0xe5ea43,_0xe5ea43,_0xe5ea43,_0xe5ea43,_0xe5ea43)},'json':!![]})[_0x7995('0x24')](function(_0x6fe77b){if(_0x6fe77b[_0x7995('0x31')]&&_0x6fe77b[_0x7995('0x26')]['length']){logger['info'](_0x7995('0x3b'));return BPromise[_0x7995('0x25')]({'id':_0x6fe77b['result'][0x0]['id'],'name':_0x6fe77b['result'][0x0][_0x7995('0x3c')]+'\x20'+_0x6fe77b['result'][0x0]['lastname'],'phone':_0xe5ea43});}else{logger[_0x7995('0x2d')](_0x7995('0x3d'));return request({'method':_0x7995('0x1c'),'uri':util['format'](_0x7995('0x39'),_0x235df7['remoteUri']),'form':{'operation':_0x7995('0x1f'),'sessionName':_0x1f5bee['sessionName'],'elementType':'Contacts','element':JSON[_0x7995('0x23')]({'lastname':_0x3eb04f,'phone':_0xe5ea43,'assigned_user_id':'\x20'})},'json':!![]})[_0x7995('0x24')](function(_0xc04e5){logger[_0x7995('0x2d')]('Enduser\x20created.');return BPromise[_0x7995('0x25')]({'id':_0xc04e5[_0x7995('0x26')]['id'],'name':_0xc04e5[_0x7995('0x26')][_0x7995('0x3e')],'phone':_0xc04e5['result']['phone']});})[_0x7995('0x37')](function(_0x55791b){var _0x23c41d=_0x55791b['statusCode']||0x1f4;logger[_0x7995('0x28')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x7995('0x3f'),_0x23c41d,JSON[_0x7995('0x23')](_0x55791b));});}});}function getConnection(_0x4d9245){var _0x3e9e62=_0x4d9245[_0x7995('0x20')];var _0x314145=_0x4d9245[_0x7995('0x40')];return request({'method':'GET','uri':util[_0x7995('0x1d')](_0x7995('0x39'),_0x4d9245[_0x7995('0x1e')]),'qs':{'operation':'getchallenge','username':_0x3e9e62},'json':!![]})[_0x7995('0x24')](function(_0x44f516){if(_0x44f516[_0x7995('0x31')]){return request({'method':_0x7995('0x1c'),'uri':util[_0x7995('0x1d')]('%s/webservice.php',_0x4d9245[_0x7995('0x1e')]),'form':{'operation':_0x7995('0x41'),'username':_0x3e9e62,'accessKey':md5(_0x44f516['result'][_0x7995('0x42')]+_0x314145)},'json':!![]});}})['then'](function(_0x1d87f9){if(_0x1d87f9[_0x7995('0x31')]){return BPromise[_0x7995('0x25')](_0x1d87f9[_0x7995('0x26')]);}else{throw new Error(util[_0x7995('0x1d')](_0x7995('0x43'),_0x4d9245['id']));}})[_0x7995('0x37')](function(_0x4d46bc){var _0x427dcf=_0x4d46bc[_0x7995('0x29')]||0x1f4;logger[_0x7995('0x28')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x7995('0x44'),_0x427dcf,JSON[_0x7995('0x23')](_0x4d46bc));});}function request(_0x12d4b8){logger['info']('[HTTP]',JSON['stringify'](_0x12d4b8));return rp(_0x12d4b8);}exports[_0x7995('0x45')]=function(_0x1fd1ca,_0x4cf5db,_0x1cd85,_0x29f300,_0x31f27c,_0x1a9bd7){var _0xc04004,_0x528c8e,_0x29ee32,_0x4ab09f;_0x1a9bd7[_0x7995('0x1e')]=intUtil[_0x7995('0x46')](_0x1a9bd7[_0x7995('0x1e')]);if(_0x31f27c&&_0x31f27c['monitor_format']){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x4cf5db[_0x7995('0x47')]=util[_0x7995('0x1d')](_0x7995('0x48'),_0x1a9bd7[_0x7995('0x49')],_0x4cf5db[_0x7995('0x4a')],md5(_0x4cf5db[_0x7995('0x4a')]));}else{_0x4cf5db[_0x7995('0x47')]='';}return getConnection(_0x1a9bd7)[_0x7995('0x24')](function(_0x328671){_0x4ab09f=_0x328671;return getUser(_0x1a9bd7,_0x29f300[_0x7995('0x4b')],_0x4ab09f);})[_0x7995('0x24')](function(_0x133c63){_0xc04004=_0x133c63;logger[_0x7995('0x2d')](_0x7995('0x4c'),_0xc04004['id']);return getEndUser(_0x1a9bd7,_0x4cf5db[_0x7995('0x4d')],_0x4cf5db[_0x7995('0x4e')],_0x4ab09f);})[_0x7995('0x24')](function(_0x223e08){_0x528c8e=_0x223e08;logger[_0x7995('0x2d')]('The\x20Enduser\x20ID\x20is:',_0x528c8e['id']);return createTicket(_0x1a9bd7,_0xc04004,_0x528c8e,_0x1cd85,_0x4cf5db,_0x1cd85[_0x7995('0x4f')],_0x4ab09f);})[_0x7995('0x24')](function(_0x3b8a54){_0x29ee32=_0x3b8a54;logger[_0x7995('0x2d')]('Ticket\x20created!');logger['info'](_0x7995('0x50'),_0x29ee32['id']);var _0x197b52=util[_0x7995('0x1d')](_0x7995('0x51'),_0x1a9bd7['remoteUri'],_[_0x7995('0x52')](_0x29ee32['id'],'x')[0x1]);logger[_0x7995('0x2d')](_0x7995('0x53'),_0x7995('0x54'));emit(util['format']('user:%s',_0x29f300[_0x7995('0x15')]),_0x7995('0x55'),{'uri':_0x197b52});})[_0x7995('0x37')](function(_0x1d69ce){logger[_0x7995('0x28')](_0x7995('0x53'),JSON[_0x7995('0x23')](_0x1d69ce));});};exports[_0x7995('0x56')]=function(_0x984c23,_0x50caf5,_0x18f230,_0x3ec5a8,_0xdf9e38,_0x1ecfdb,_0x59c5aa){var _0x51bf6a,_0x3053fd,_0xebb5c8,_0x47d5d7;_0x1ecfdb[_0x7995('0x1e')]=intUtil[_0x7995('0x46')](_0x1ecfdb[_0x7995('0x1e')]);_0x1ecfdb[_0x7995('0x49')]=intUtil[_0x7995('0x46')](_0x1ecfdb['serverUrl']);if(_0x59c5aa&&_0x59c5aa[_0x7995('0x57')]&&_0x59c5aa['recordingFormat']!==_0x7995('0x58')){logger[_0x7995('0x2d')](_0x7995('0x59'),_0x7995('0x5a'));_0x50caf5[_0x7995('0x47')]=util[_0x7995('0x1d')](_0x7995('0x48'),_0x1ecfdb[_0x7995('0x49')],_0x50caf5[_0x7995('0x4a')],md5(_0x50caf5[_0x7995('0x4a')]));}return getConnection(_0x1ecfdb)[_0x7995('0x24')](function(_0x234d8d){_0x47d5d7=_0x234d8d;return getUser(_0x1ecfdb,_0x3ec5a8['email'],_0x47d5d7);})[_0x7995('0x24')](function(_0x23bbc1){_0x51bf6a=_0x23bbc1;logger[_0x7995('0x2d')](_0x7995('0x4c'),_0x51bf6a['id']);return getEndUser(_0x1ecfdb,_0x50caf5[_0x7995('0x5b')],_0x50caf5['destcalleridnum'],_0x47d5d7);})['then'](function(_0x268fde){_0x3053fd=_0x268fde;logger[_0x7995('0x2d')](_0x7995('0x5c'),_0x3053fd['id']);return createTicket(_0x1ecfdb,_0x51bf6a,_0x3053fd,_0x18f230,_0x50caf5,_0x18f230[_0x7995('0x4f')],_0x47d5d7);})['then'](function(_0x22d317){_0xebb5c8=_0x22d317;logger['info']('Ticket\x20created!');logger[_0x7995('0x2d')](_0x7995('0x50'),_0xebb5c8['id']);var _0x3f0a71=util[_0x7995('0x1d')](_0x7995('0x51'),_0x1ecfdb[_0x7995('0x1e')],_[_0x7995('0x52')](_0xebb5c8['id'],'x')[0x1]);logger[_0x7995('0x2d')](_0x7995('0x59'),_0x7995('0x54'));emit(util['format'](_0x7995('0x5d'),_0x3ec5a8[_0x7995('0x15')]),_0x7995('0x55'),{'uri':_0x3f0a71});})['catch'](function(_0x1fe1cb){logger[_0x7995('0x28')](_0x7995('0x59'),JSON[_0x7995('0x23')](_0x1fe1cb));});};exports[_0x7995('0x5e')]=function(_0x51ab1e,_0x550a10,_0x3adfd2,_0x2f94c4,_0x1fdff6,_0x435a1b){var _0x535131,_0x5e8b4c,_0xd07c1c,_0xfe1105;_0x435a1b[_0x7995('0x1e')]=intUtil[_0x7995('0x46')](_0x435a1b['remoteUri']);_0x435a1b[_0x7995('0x49')]=intUtil[_0x7995('0x46')](_0x435a1b['serverUrl']);if(_0x1fdff6&&_0x1fdff6['monitor_format']){logger[_0x7995('0x2d')](_0x7995('0x5f'),'Recording\x20is\x20enabled!');_0x550a10[_0x7995('0x47')]=util['format'](_0x7995('0x48'),_0x435a1b[_0x7995('0x49')],_0x550a10['uniqueid'],md5(_0x550a10['uniqueid']));}else{_0x550a10[_0x7995('0x47')]='';}return getConnection(_0x435a1b)['then'](function(_0x31b9e6){_0xfe1105=_0x31b9e6;return getUser(_0x435a1b,'',_0xfe1105);})[_0x7995('0x24')](function(_0x3dd197){_0x535131=_0x3dd197;logger[_0x7995('0x2d')](_0x7995('0x4c'),_0x535131['id']);return getEndUser(_0x435a1b,_0x550a10[_0x7995('0x4d')],_0x550a10[_0x7995('0x4e')],_0xfe1105);})[_0x7995('0x24')](function(_0x29e0ee){_0x5e8b4c=_0x29e0ee;logger[_0x7995('0x2d')](_0x7995('0x5c'),_0x5e8b4c['id']);return createTicket(_0x435a1b,_0x535131,_0x5e8b4c,_0x3adfd2,_0x550a10,_0x3adfd2[_0x7995('0x4f')],_0xfe1105);})[_0x7995('0x24')](function(_0x1ff436){_0xd07c1c=_0x1ff436;logger[_0x7995('0x2d')](_0x7995('0x60'));logger[_0x7995('0x2d')](_0x7995('0x50'),_0xd07c1c['id']);})[_0x7995('0x37')](function(_0xa2fc8e){logger[_0x7995('0x28')](_0x7995('0x5f'),JSON[_0x7995('0x23')](_0xa2fc8e));});}; \ No newline at end of file +var _0x7217=['The\x20User\x20ID\x20is:','calleridname','calleridnum','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','outbound','serverUrl','recordingFormat','none','destcalleridname','destcalleridnum','Fields','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','abandoned','[ABANDONED]','Ticket\x20created!','lodash','bluebird','md5','util','ioredis','./util','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','type','string','idField','content','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','Descriptions','POST','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','then','Agent\x20found!','email1','first_name','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email'];(function(_0x5497f1,_0x3ed5d9){var _0x38e189=function(_0x295c00){while(--_0x295c00){_0x5497f1['push'](_0x5497f1['shift']());}};_0x38e189(++_0x3ed5d9);}(_0x7217,0x19e));var _0x7721=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x7217[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0x7721('0x0'));var rp=require('request-promise');var BPromise=require(_0x7721('0x1'));var md5=require(_0x7721('0x2'));var util=require(_0x7721('0x3'));var Redis=require(_0x7721('0x4'));var intUtil=require(_0x7721('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x7721('0x6'));config[_0x7721('0x7')]=_[_0x7721('0x8')](config[_0x7721('0x7')],{'host':_0x7721('0x9'),'port':0x18eb});var io=require(_0x7721('0xa'))(new Redis(config[_0x7721('0x7')]));function emit(_0x21f680,_0x225610,_0x2f99ed){io['to'](_0x21f680)[_0x7721('0xb')](_0x225610,_0x2f99ed);}function getCustomFields(_0x2a66cb,_0xfa8835){var _0x138740={};if(_0x2a66cb[_0x7721('0xc')]>0x0){_['forEach'](_0x2a66cb,function(_0x461d1a){if(_0x461d1a[_0x7721('0xd')]===_0x7721('0xe')&&_0x461d1a[_0x7721('0xf')]){_0x138740[_0x461d1a[_0x7721('0xf')]]=_0x461d1a[_0x7721('0x10')][_0x7721('0x11')]();}else if(_0x461d1a[_0x7721('0xd')]==='variable'&&_0x461d1a[_0x7721('0x12')]&&_0x461d1a[_0x7721('0xf')]&&_0xfa8835[_0x461d1a['variableName']]){_0x138740[_0x461d1a[_0x7721('0xf')]]=_0xfa8835[_0x461d1a[_0x7721('0x12')]][_0x7721('0x11')]();}else if(_0x461d1a[_0x7721('0xd')]==='customVariable'&&_0x461d1a[_0x7721('0x13')]&&_0x461d1a[_0x7721('0x13')]['name']&&_0x461d1a['idField']&&_0xfa8835[_0x461d1a['Variable'][_0x7721('0x14')][_0x7721('0x15')]()]){_0x138740[_0x461d1a[_0x7721('0xf')]]=_0xfa8835[_0x461d1a[_0x7721('0x13')]['name'][_0x7721('0x15')]()]['toString']();}});}return _0x138740;}function createTicket(_0x3fc09e,_0x5cb0e6,_0xfec626,_0x4e96fb,_0x3ab5a5,_0x3e140d,_0x2286e5){logger[_0x7721('0x16')](_0x7721('0x17'));var _0x413263=_[_0x7721('0x18')]({'parent_id':'','assigned_user_id':_0x5cb0e6['id'],'ticketpriorities':_0x7721('0x19'),'ticketstatus':'Open','ticket_title':intUtil[_0x7721('0x1a')](_0x4e96fb[_0x7721('0x1b')],_0x3ab5a5,'\x20'),'description':intUtil[_0x7721('0x1a')](_0x4e96fb[_0x7721('0x1c')],_0x3ab5a5,'\x0a'),'contact_id':_0xfec626['id']},getCustomFields(_0x3e140d,_0x3ab5a5));var _0x57140c={'method':_0x7721('0x1d'),'uri':util['format'](_0x7721('0x1e'),_0x3fc09e[_0x7721('0x1f')]),'form':{'operation':_0x7721('0x20'),'username':_0x3fc09e[_0x7721('0x21')],'sessionName':_0x2286e5[_0x7721('0x22')],'elementType':_0x7721('0x23'),'element':JSON[_0x7721('0x24')](_0x413263)},'json':!![]};return request(_0x57140c)['then'](function(_0x216f20){if(_0x216f20[_0x7721('0x25')]){return BPromise[_0x7721('0x26')]({'id':_0x216f20[_0x7721('0x27')]['id']});}else{throw new Error(util[_0x7721('0x28')](_0x7721('0x29'),JSON[_0x7721('0x24')](_0x216f20[_0x7721('0x2a')])));}})[_0x7721('0x2b')](function(_0x52316e){var _0x258ddf=_0x52316e['statusCode']||0x1f4;logger['error'](_0x7721('0x2c'),_0x7721('0x2d'),_0x258ddf,JSON[_0x7721('0x24')](_0x52316e));});}function getUser(_0x158d98,_0x1ea4d,_0x37b9f0){if(intUtil[_0x7721('0x2e')](_0x1ea4d)){logger[_0x7721('0x16')]('Getting\x20agent\x20with\x20email',_0x1ea4d);return request({'method':_0x7721('0x2f'),'uri':util[_0x7721('0x28')]('%s/webservice.php',_0x158d98['remoteUri']),'qs':{'operation':_0x7721('0x30'),'username':_0x158d98[_0x7721('0x21')],'sessionName':_0x37b9f0['sessionName'],'query':util[_0x7721('0x28')](_0x7721('0x31'),_0x1ea4d)},'json':!![]})[_0x7721('0x32')](function(_0x58d54b){if(_0x58d54b[_0x7721('0x25')]&&_0x58d54b[_0x7721('0x27')][_0x7721('0xc')]){logger[_0x7721('0x16')](_0x7721('0x33'));return BPromise['resolve']({'id':_0x58d54b[_0x7721('0x27')][0x0]['id'],'email':_0x58d54b[_0x7721('0x27')][0x0][_0x7721('0x34')],'name':_0x58d54b['result'][0x0][_0x7721('0x35')]+'\x20'+_0x58d54b[_0x7721('0x27')]['last_name']});}else{logger[_0x7721('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x7721('0x26')]({'id':_0x37b9f0[_0x7721('0x36')],'email':_0x158d98[_0x7721('0x21')],'name':_0x7721('0x37')});}})[_0x7721('0x2b')](function(_0x13c635){var _0x2f1fe0=_0x13c635[_0x7721('0x38')]||0x1f4;logger[_0x7721('0x2a')](_0x7721('0x2c'),_0x7721('0x39'),_0x2f1fe0,JSON['stringify'](_0x13c635));});}else{logger[_0x7721('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x7721('0x26')]({'id':_0x37b9f0[_0x7721('0x36')],'email':_0x158d98[_0x7721('0x21')],'name':_0x7721('0x37')})[_0x7721('0x2b')](function(_0x378ba5){var _0x482b70=_0x378ba5['statusCode']||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s',_0x7721('0x39'),_0x482b70,JSON[_0x7721('0x24')](_0x378ba5));});}}function getEndUser(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa){logger['info'](_0x7721('0x3a'),_0x4a90ce);return request({'method':_0x7721('0x2f'),'uri':util['format'](_0x7721('0x1e'),_0x1acc72[_0x7721('0x1f')]),'qs':{'operation':'query','username':_0x1acc72['username'],'sessionName':_0xa389fa[_0x7721('0x22')],'query':util[_0x7721('0x28')](_0x7721('0x3b'),_0x4a90ce,_0x4a90ce,_0x4a90ce,_0x4a90ce,_0x4a90ce)},'json':!![]})[_0x7721('0x32')](function(_0x577af9){if(_0x577af9[_0x7721('0x25')]&&_0x577af9[_0x7721('0x27')][_0x7721('0xc')]){logger[_0x7721('0x16')](_0x7721('0x3c'));return BPromise['resolve']({'id':_0x577af9[_0x7721('0x27')][0x0]['id'],'name':_0x577af9['result'][0x0][_0x7721('0x3d')]+'\x20'+_0x577af9['result'][0x0][_0x7721('0x3e')],'phone':_0x4a90ce});}else{logger[_0x7721('0x16')](_0x7721('0x3f'));return request({'method':'POST','uri':util[_0x7721('0x28')](_0x7721('0x1e'),_0x1acc72[_0x7721('0x1f')]),'form':{'operation':'create','sessionName':_0xa389fa[_0x7721('0x22')],'elementType':_0x7721('0x40'),'element':JSON[_0x7721('0x24')]({'lastname':_0x22ef35,'phone':_0x4a90ce,'assigned_user_id':'\x20'})},'json':!![]})[_0x7721('0x32')](function(_0x135dbc){logger[_0x7721('0x16')](_0x7721('0x41'));return BPromise['resolve']({'id':_0x135dbc['result']['id'],'name':_0x135dbc[_0x7721('0x27')][_0x7721('0x3e')],'phone':_0x135dbc[_0x7721('0x27')][_0x7721('0x42')]});})[_0x7721('0x2b')](function(_0x15181b){var _0x1d2ea5=_0x15181b[_0x7721('0x38')]||0x1f4;logger[_0x7721('0x2a')](_0x7721('0x2c'),'getEndUser',_0x1d2ea5,JSON['stringify'](_0x15181b));});}});}function getConnection(_0x5ed70d){var _0x6a4664=_0x5ed70d[_0x7721('0x21')];var _0x219c9f=_0x5ed70d['accessKey'];return request({'method':_0x7721('0x2f'),'uri':util[_0x7721('0x28')]('%s/webservice.php',_0x5ed70d[_0x7721('0x1f')]),'qs':{'operation':'getchallenge','username':_0x6a4664},'json':!![]})[_0x7721('0x32')](function(_0x5c6922){if(_0x5c6922[_0x7721('0x25')]){return request({'method':_0x7721('0x1d'),'uri':util[_0x7721('0x28')]('%s/webservice.php',_0x5ed70d[_0x7721('0x1f')]),'form':{'operation':_0x7721('0x43'),'username':_0x6a4664,'accessKey':md5(_0x5c6922['result'][_0x7721('0x44')]+_0x219c9f)},'json':!![]});}})[_0x7721('0x32')](function(_0xf88e8c){if(_0xf88e8c['success']){return BPromise[_0x7721('0x26')](_0xf88e8c['result']);}else{throw new Error(util[_0x7721('0x28')](_0x7721('0x45'),_0x5ed70d['id']));}})[_0x7721('0x2b')](function(_0x443503){var _0x1c95d8=_0x443503[_0x7721('0x38')]||0x1f4;logger[_0x7721('0x2a')](_0x7721('0x2c'),_0x7721('0x46'),_0x1c95d8,JSON[_0x7721('0x24')](_0x443503));});}function request(_0x31770e){logger[_0x7721('0x16')](_0x7721('0x47'),JSON[_0x7721('0x24')](_0x31770e));return rp(_0x31770e);}exports[_0x7721('0x48')]=function(_0x5b741d,_0x474f32,_0x2f6f30,_0x8e1214,_0x2c1119,_0x1f1ac7){var _0x315127,_0x267f5e,_0x57484c,_0x234bee;_0x1f1ac7[_0x7721('0x1f')]=intUtil[_0x7721('0x49')](_0x1f1ac7[_0x7721('0x1f')]);if(_0x2c1119&&_0x2c1119[_0x7721('0x4a')]){logger[_0x7721('0x16')](_0x7721('0x4b'),_0x7721('0x4c'));_0x474f32[_0x7721('0x4d')]=util[_0x7721('0x28')](_0x7721('0x4e'),_0x1f1ac7['serverUrl'],_0x474f32[_0x7721('0x4f')],md5(_0x474f32[_0x7721('0x4f')]));}else{_0x474f32[_0x7721('0x4d')]='';}return getConnection(_0x1f1ac7)[_0x7721('0x32')](function(_0x15ed3b){_0x234bee=_0x15ed3b;return getUser(_0x1f1ac7,_0x8e1214[_0x7721('0x50')],_0x234bee);})[_0x7721('0x32')](function(_0x36fe6f){_0x315127=_0x36fe6f;logger[_0x7721('0x16')](_0x7721('0x51'),_0x315127['id']);return getEndUser(_0x1f1ac7,_0x474f32[_0x7721('0x52')],_0x474f32[_0x7721('0x53')],_0x234bee);})[_0x7721('0x32')](function(_0x18f7f6){_0x267f5e=_0x18f7f6;logger[_0x7721('0x16')]('The\x20Enduser\x20ID\x20is:',_0x267f5e['id']);return createTicket(_0x1f1ac7,_0x315127,_0x267f5e,_0x2f6f30,_0x474f32,_0x2f6f30['Fields'],_0x234bee);})['then'](function(_0x885a3a){_0x57484c=_0x885a3a;logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x57484c['id']);var _0x47925a=util[_0x7721('0x28')](_0x7721('0x54'),_0x1f1ac7['remoteUri'],_[_0x7721('0x55')](_0x57484c['id'],'x')[0x1]);logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7721('0x28')]('user:%s',_0x8e1214['name']),'trigger:browser:url',{'uri':_0x47925a});})[_0x7721('0x2b')](function(_0x2e9155){logger[_0x7721('0x2a')]('[QUEUE]',JSON[_0x7721('0x24')](_0x2e9155));});};exports[_0x7721('0x56')]=function(_0x2c95d0,_0x168343,_0x6b7c1e,_0x16e80b,_0xad43ce,_0x3e3301,_0x127f46){var _0x197b73,_0x3b03cf,_0x10666e,_0x148562;_0x3e3301[_0x7721('0x1f')]=intUtil[_0x7721('0x49')](_0x3e3301['remoteUri']);_0x3e3301[_0x7721('0x57')]=intUtil[_0x7721('0x49')](_0x3e3301[_0x7721('0x57')]);if(_0x127f46&&_0x127f46[_0x7721('0x58')]&&_0x127f46['recordingFormat']!==_0x7721('0x59')){logger[_0x7721('0x16')]('[OUTBOUND]',_0x7721('0x4c'));_0x168343['recordingURL']=util[_0x7721('0x28')](_0x7721('0x4e'),_0x3e3301[_0x7721('0x57')],_0x168343[_0x7721('0x4f')],md5(_0x168343[_0x7721('0x4f')]));}return getConnection(_0x3e3301)[_0x7721('0x32')](function(_0x3121e0){_0x148562=_0x3121e0;return getUser(_0x3e3301,_0x16e80b[_0x7721('0x50')],_0x148562);})[_0x7721('0x32')](function(_0x57759a){_0x197b73=_0x57759a;logger[_0x7721('0x16')](_0x7721('0x51'),_0x197b73['id']);return getEndUser(_0x3e3301,_0x168343[_0x7721('0x5a')],_0x168343[_0x7721('0x5b')],_0x148562);})[_0x7721('0x32')](function(_0x3ed425){_0x3b03cf=_0x3ed425;logger[_0x7721('0x16')]('The\x20Enduser\x20ID\x20is:',_0x3b03cf['id']);return createTicket(_0x3e3301,_0x197b73,_0x3b03cf,_0x6b7c1e,_0x168343,_0x6b7c1e[_0x7721('0x5c')],_0x148562);})[_0x7721('0x32')](function(_0x53c918){_0x10666e=_0x53c918;logger[_0x7721('0x16')]('Ticket\x20created!');logger[_0x7721('0x16')](_0x7721('0x5d'),_0x10666e['id']);var _0x4282ba=util[_0x7721('0x28')](_0x7721('0x54'),_0x3e3301[_0x7721('0x1f')],_[_0x7721('0x55')](_0x10666e['id'],'x')[0x1]);logger['info'](_0x7721('0x5e'),_0x7721('0x5f'));emit(util[_0x7721('0x28')]('user:%s',_0x16e80b['name']),'trigger:browser:url',{'uri':_0x4282ba});})['catch'](function(_0x5e966f){logger[_0x7721('0x2a')](_0x7721('0x5e'),JSON['stringify'](_0x5e966f));});};exports[_0x7721('0x60')]=function(_0x42f6e9,_0xbbc86f,_0x4593e1,_0x53ebb1,_0x275b25,_0xfe9fb8){var _0x322afc,_0x1bea13,_0x3cf3fd,_0x53adb1;_0xfe9fb8[_0x7721('0x1f')]=intUtil[_0x7721('0x49')](_0xfe9fb8[_0x7721('0x1f')]);_0xfe9fb8['serverUrl']=intUtil['stripTrailingSlash'](_0xfe9fb8[_0x7721('0x57')]);if(_0x275b25&&_0x275b25[_0x7721('0x4a')]){logger[_0x7721('0x16')](_0x7721('0x61'),_0x7721('0x4c'));_0xbbc86f['recordingURL']=util['format'](_0x7721('0x4e'),_0xfe9fb8[_0x7721('0x57')],_0xbbc86f[_0x7721('0x4f')],md5(_0xbbc86f[_0x7721('0x4f')]));}else{_0xbbc86f[_0x7721('0x4d')]='';}return getConnection(_0xfe9fb8)[_0x7721('0x32')](function(_0x34187f){_0x53adb1=_0x34187f;return getUser(_0xfe9fb8,'',_0x53adb1);})['then'](function(_0xdfae41){_0x322afc=_0xdfae41;logger[_0x7721('0x16')](_0x7721('0x51'),_0x322afc['id']);return getEndUser(_0xfe9fb8,_0xbbc86f['calleridname'],_0xbbc86f[_0x7721('0x53')],_0x53adb1);})[_0x7721('0x32')](function(_0xdcd3e0){_0x1bea13=_0xdcd3e0;logger[_0x7721('0x16')]('The\x20Enduser\x20ID\x20is:',_0x1bea13['id']);return createTicket(_0xfe9fb8,_0x322afc,_0x1bea13,_0x4593e1,_0xbbc86f,_0x4593e1['Fields'],_0x53adb1);})[_0x7721('0x32')](function(_0x2cac50){_0x3cf3fd=_0x2cac50;logger[_0x7721('0x16')](_0x7721('0x62'));logger[_0x7721('0x16')](_0x7721('0x5d'),_0x3cf3fd['id']);})['catch'](function(_0x3855d5){logger[_0x7721('0x2a')](_0x7721('0x61'),JSON['stringify'](_0x3855d5));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 31488df..c3b3fca 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 _0xc8f3=['Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','length','first','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','toString','debug','map','forEach','string','nameField','toLowerCase','type','customField','custom_fields','push','variableName','idField','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridnum','integrationTab','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','calleridname','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','Tags','getString','Descriptions','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','type:user\x20role:agent\x20email:%s','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json'];(function(_0x56b324,_0x15497d){var _0x4c1129=function(_0x2d21e0){while(--_0x2d21e0){_0x56b324['push'](_0x56b324['shift']());}};_0x4c1129(++_0x15497d);}(_0xc8f3,0x1d3));var _0x3c8f=function(_0x51cae7,_0x540716){_0x51cae7=_0x51cae7-0x0;var _0x36dd74=_0xc8f3[_0x51cae7];return _0x36dd74;};'use strict';var _=require(_0x3c8f('0x0'));var rp=require(_0x3c8f('0x1'));var md5=require(_0x3c8f('0x2'));var util=require(_0x3c8f('0x3'));var Redis=require(_0x3c8f('0x4'));var intUtil=require(_0x3c8f('0x5'));var config=require('../../../../config/environment');var logger=require(_0x3c8f('0x6'))('zendesk');config['redis']=_[_0x3c8f('0x7')](config[_0x3c8f('0x8')],{'host':_0x3c8f('0x9'),'port':0x18eb});var io=require(_0x3c8f('0xa'))(new Redis(config[_0x3c8f('0x8')]));function emit(_0x4c6b0c,_0x416355,_0x3039cc){io['to'](_0x4c6b0c)[_0x3c8f('0xb')](_0x416355,_0x3039cc);}var headers={'Content-Type':_0x3c8f('0xc'),'Accept':_0x3c8f('0xc')};function getTicket(_0xe1ca00,_0x419518,_0x1ce5c4,_0x3e9156,_0x572141){logger[_0x3c8f('0xd')](_0x3c8f('0xe'));return request({'uri':util['format'](_0x3c8f('0xf'),_0xe1ca00[_0x3c8f('0x10')]),'method':_0x3c8f('0x11'),'body':{'ticket':_['merge']({'requester_id':_0x1ce5c4['id'],'submitter_id':_0x419518?_0x419518['id']:undefined,'assignee_id':_0x419518?_0x419518['id']:undefined,'tags':getTags(_0x3e9156[_0x3c8f('0x12')],'name'),'subject':intUtil[_0x3c8f('0x13')](_0x3e9156['Subjects'],_0x572141,'\x20'),'description':intUtil[_0x3c8f('0x13')](_0x3e9156['Descriptions'],_0x572141,'\x0a'),'comment':{'public':![],'body':intUtil[_0x3c8f('0x13')](_0x3e9156[_0x3c8f('0x14')],_0x572141,'\x0a')}},getCustomFields(_0x3e9156['Fields'],_0x572141))}})[_0x3c8f('0x15')](function(_0x4ff130){logger[_0x3c8f('0xd')](_0x3c8f('0x16'));return _0x4ff130[_0x3c8f('0x17')];});}function getUser(_0x2edbc,_0x1aab78){if(intUtil[_0x3c8f('0x18')](_0x1aab78)){logger[_0x3c8f('0xd')](_0x3c8f('0x19'),_0x1aab78);return request({'uri':util[_0x3c8f('0x1a')]('%s/search.json',_0x2edbc[_0x3c8f('0x10')]),'qs':{'query':util[_0x3c8f('0x1a')](_0x3c8f('0x1b'),_0x1aab78)}})['then'](function(_0x5ee69e){if(_0x5ee69e['count']){logger[_0x3c8f('0xd')]('Agent\x20found!');return _[_0x3c8f('0x1c')](_0x5ee69e[_0x3c8f('0x1d')],{'email':_0x1aab78,'role':_0x3c8f('0x1e')});}else{logger['info'](_0x3c8f('0x1f'));return request({'uri':util['format'](_0x3c8f('0x20'),_0x2edbc[_0x3c8f('0x10')])})['then'](function(_0x19fb6a){logger[_0x3c8f('0xd')](_0x3c8f('0x21'));return _0x19fb6a[_0x3c8f('0x22')];});}});}else{logger[_0x3c8f('0xd')](_0x3c8f('0x1f'));return request({'uri':util[_0x3c8f('0x1a')](_0x3c8f('0x20'),_0x2edbc[_0x3c8f('0x10')])})[_0x3c8f('0x15')](function(_0x43c83d){logger[_0x3c8f('0xd')](_0x3c8f('0x21'));return _0x43c83d[_0x3c8f('0x22')];});}}function getEndUser(_0x5396c1,_0x48e6f1,_0x1f6599){logger[_0x3c8f('0xd')](_0x3c8f('0x23'),_0x1f6599);return request({'uri':util['format']('%s/search.json',_0x5396c1['remoteUri']),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x1f6599)}})[_0x3c8f('0x15')](function(_0x4d8bdb){var _0x295e64;if(_0x4d8bdb['results'][_0x3c8f('0x24')]){_0x4d8bdb['results']=_['filter'](_0x4d8bdb[_0x3c8f('0x1d')],{'suspended':![],'role':'end-user'});if(_0x4d8bdb[_0x3c8f('0x1d')][_0x3c8f('0x24')]){_0x295e64=_[_0x3c8f('0x25')](_0x4d8bdb[_0x3c8f('0x1d')]);}}if(_0x295e64){logger[_0x3c8f('0xd')]('Enduser\x20found!');return _0x295e64;}else{logger[_0x3c8f('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x3c8f('0x1a')](_0x3c8f('0x26'),_0x5396c1[_0x3c8f('0x10')]),'method':_0x3c8f('0x11'),'body':{'user':{'role':_0x3c8f('0x27'),'name':util[_0x3c8f('0x1a')](_0x3c8f('0x28'),_0x48e6f1||_0x1f6599),'phone':_0x1f6599}}})[_0x3c8f('0x15')](function(_0x55921b){logger['info'](_0x3c8f('0x29'));return _0x55921b[_0x3c8f('0x22')];});}});}function getAuth(_0x27f0c4){var _0xa259f4;if(_0x27f0c4[_0x3c8f('0x2a')]===_0x3c8f('0x2b')){_0xa259f4=util['format'](_0x3c8f('0x2c'),_0x27f0c4[_0x3c8f('0x2d')],_0x27f0c4[_0x3c8f('0x2b')]);}else if(_0x27f0c4['authType']===_0x3c8f('0x2e')){_0xa259f4=util[_0x3c8f('0x1a')]('%s/token:%s',_0x27f0c4[_0x3c8f('0x2d')],_0x27f0c4[_0x3c8f('0x2e')]);}return util[_0x3c8f('0x1a')]('Basic\x20%s',new Buffer(_0xa259f4)[_0x3c8f('0x2f')]('base64'));}function request(_0x178773){logger[_0x3c8f('0x30')]('[HTTP]',JSON['stringify'](_0x178773));return rp(_[_0x3c8f('0x7')](_0x178773,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x5cd56e,_0x7ab82a){var _0x4555e6=[];if(_0x5cd56e&&_0x5cd56e[_0x3c8f('0x24')]>0x0){_0x4555e6=_[_0x3c8f('0x31')](_0x5cd56e,_0x7ab82a);}return _0x4555e6;}function getCustomFields(_0x156598,_0x49d062){var _0x3782e5=[];var _0x5b5191={'custom_fields':[]};if(_0x156598[_0x3c8f('0x24')]>0x0){_[_0x3c8f('0x32')](_0x156598,function(_0x3630bf){if(_0x3630bf['type']===_0x3c8f('0x33')&&_0x3630bf[_0x3c8f('0x34')]&&!_0x3630bf['customField']){_0x5b5191[_0x3630bf[_0x3c8f('0x34')][_0x3c8f('0x35')]()]=_0x3630bf['content'][_0x3c8f('0x2f')]();}else if(_0x3630bf[_0x3c8f('0x36')]===_0x3c8f('0x33')&&_0x3630bf['idField']&&_0x3630bf[_0x3c8f('0x37')]){_0x5b5191[_0x3c8f('0x38')][_0x3c8f('0x39')]({'id':_0x3630bf['idField'],'value':_0x3630bf['content'][_0x3c8f('0x2f')]()});}else if(_0x3630bf[_0x3c8f('0x36')]==='variable'&&_0x3630bf[_0x3c8f('0x3a')]&&_0x3630bf[_0x3c8f('0x3b')]&&_0x3630bf['customField']){_0x49d062[_0x3630bf[_0x3c8f('0x3a')]]&&_0x5b5191[_0x3c8f('0x38')]['push']({'id':_0x3630bf['idField'],'value':_0x49d062[_0x3630bf['variableName']][_0x3c8f('0x2f')]()});}else if(_0x3630bf[_0x3c8f('0x36')]===_0x3c8f('0x3c')&&_0x3630bf['Variable']&&_0x3630bf[_0x3c8f('0x3d')][_0x3c8f('0x3e')]&&_0x3630bf[_0x3c8f('0x3b')]&&_0x3630bf['customField']){_0x49d062[_0x3630bf[_0x3c8f('0x3d')][_0x3c8f('0x3e')]['toLowerCase']()]&&_0x5b5191[_0x3c8f('0x38')][_0x3c8f('0x39')]({'id':_0x3630bf[_0x3c8f('0x3b')],'value':_0x49d062[_0x3630bf[_0x3c8f('0x3d')][_0x3c8f('0x3e')][_0x3c8f('0x35')]()][_0x3c8f('0x2f')]()});}});}return _0x5b5191;}exports[_0x3c8f('0x3f')]=function(_0x33fb52,_0x3dbff3,_0x45f0ca,_0x372ffc,_0x57999f,_0x1d2a8a){var _0x5bee7c,_0x82e47f;_0x1d2a8a[_0x3c8f('0x10')]=intUtil[_0x3c8f('0x40')](_0x1d2a8a[_0x3c8f('0x10')]);_0x1d2a8a[_0x3c8f('0x41')]=intUtil[_0x3c8f('0x40')](_0x1d2a8a[_0x3c8f('0x41')]);if(_0x57999f&&_0x57999f[_0x3c8f('0x42')]){logger['info'](_0x3c8f('0x43'),_0x3c8f('0x44'));_0x3dbff3[_0x3c8f('0x45')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1d2a8a[_0x3c8f('0x41')],_0x3dbff3[_0x3c8f('0x46')],md5(_0x3dbff3['uniqueid']));}else{_0x3dbff3['recordingURL']='';}headers['Authorization']=getAuth(_0x1d2a8a);return getUser(_0x1d2a8a,_0x372ffc[_0x3c8f('0x47')])[_0x3c8f('0x15')](function(_0x42efa9){_0x5bee7c=_0x42efa9;logger['info'](_0x3c8f('0x48'),_0x5bee7c['id']);return getEndUser(_0x1d2a8a,_0x3dbff3['calleridname'],_0x3dbff3[_0x3c8f('0x49')]);})[_0x3c8f('0x15')](function(_0x1dc169){_0x82e47f=_0x1dc169;logger[_0x3c8f('0xd')](_0x3c8f('0x4a'),_0x82e47f['id']);return getTicket(_0x1d2a8a,_0x5bee7c,_0x82e47f,_0x45f0ca,_0x3dbff3);})[_0x3c8f('0x15')](function(_0x21aafd){if(_0x21aafd){logger[_0x3c8f('0xd')](_0x3c8f('0x4b'),_0x21aafd['id']);switch(_0x1d2a8a[_0x3c8f('0x36')]){case'integrationTab':logger[_0x3c8f('0xd')](_0x3c8f('0x43'),_0x3c8f('0x4c'));return request({'uri':util[_0x3c8f('0x1a')](_0x3c8f('0x4d'),_0x1d2a8a[_0x3c8f('0x10')],_0x5bee7c['id'],_0x21aafd['id']),'method':'POST'});case _0x3c8f('0x4e'):logger['info'](_0x3c8f('0x43'),_0x3c8f('0x4f'));emit(util['format'](_0x3c8f('0x50'),_0x372ffc['name']),_0x3c8f('0x51'),{'uri':util['format']('%s/agent/tickets/%s',_0x1d2a8a['remoteUri'],_0x21aafd['id'])});break;default:logger[_0x3c8f('0x52')](_0x3c8f('0x43'),_0x3c8f('0x53'));}}})[_0x3c8f('0x54')](function(_0x3c0e97){logger[_0x3c8f('0x52')](_0x3c8f('0x55'),util[_0x3c8f('0x56')](_0x3c0e97,{'showHidden':!![],'depth':null}));});};exports[_0x3c8f('0x57')]=function(_0x32a72a,_0x4cfce1,_0x4f6d2e,_0x1b88cd,_0x1ca678,_0x26eebb,_0x5abb7c){var _0x1f2581,_0x2d4279;_0x26eebb[_0x3c8f('0x10')]=intUtil[_0x3c8f('0x40')](_0x26eebb[_0x3c8f('0x10')]);_0x26eebb[_0x3c8f('0x41')]=intUtil[_0x3c8f('0x40')](_0x26eebb['serverUrl']);if(_0x5abb7c&&_0x5abb7c[_0x3c8f('0x58')]&&_0x5abb7c['recordingFormat']!==_0x3c8f('0x59')){logger['info'](_0x3c8f('0x5a'),_0x3c8f('0x44'));_0x4cfce1[_0x3c8f('0x45')]=util[_0x3c8f('0x1a')](_0x3c8f('0x5b'),_0x26eebb[_0x3c8f('0x41')],_0x4cfce1['uniqueid'],md5(_0x4cfce1[_0x3c8f('0x46')]));}headers[_0x3c8f('0x5c')]=getAuth(_0x26eebb);return getUser(_0x26eebb,_0x1b88cd[_0x3c8f('0x47')])[_0x3c8f('0x15')](function(_0x578122){_0x1f2581=_0x578122;logger[_0x3c8f('0xd')]('The\x20User\x20ID\x20is:',_0x1f2581['id']);return getEndUser(_0x26eebb,_0x4cfce1['destcalleridname'],_0x4cfce1[_0x3c8f('0x5d')]);})[_0x3c8f('0x15')](function(_0x48a058){_0x2d4279=_0x48a058;logger[_0x3c8f('0xd')](_0x3c8f('0x4a'),_0x2d4279['id']);return getTicket(_0x26eebb,_0x1f2581,_0x2d4279,_0x4f6d2e,_0x4cfce1);})['then'](function(_0xdca06e){if(_0xdca06e){logger['info']('The\x20Ticket\x20ID\x20is:',_0xdca06e['id']);switch(_0x26eebb[_0x3c8f('0x36')]){case _0x3c8f('0x5e'):logger[_0x3c8f('0xd')](_0x3c8f('0x5a'),_0x3c8f('0x4c'));return request({'uri':util['format'](_0x3c8f('0x4d'),_0x26eebb[_0x3c8f('0x10')],_0x1f2581['id'],_0xdca06e['id']),'method':_0x3c8f('0x11')});case _0x3c8f('0x4e'):logger[_0x3c8f('0xd')]('[OUTBOUND]',_0x3c8f('0x4f'));emit(util['format'](_0x3c8f('0x50'),_0x1b88cd['name']),'trigger:browser:url',{'uri':util[_0x3c8f('0x1a')](_0x3c8f('0x5f'),_0x26eebb['remoteUri'],_0xdca06e['id'])});break;default:logger['error'](_0x3c8f('0x5a'),_0x3c8f('0x53'));}}})[_0x3c8f('0x54')](function(_0x3ee4c0){logger[_0x3c8f('0x52')](_0x3c8f('0x60'),util['inspect'](_0x3ee4c0,{'showHidden':!![],'depth':null}));});};exports[_0x3c8f('0x61')]=function(_0x3fc51e,_0x22cc79,_0x387a08,_0x8f4fa6,_0xc02d43,_0x54b6e3){var _0x5e166c,_0x25626e;_0x54b6e3['remoteUri']=intUtil[_0x3c8f('0x40')](_0x54b6e3[_0x3c8f('0x10')]);_0x54b6e3[_0x3c8f('0x41')]=intUtil[_0x3c8f('0x40')](_0x54b6e3[_0x3c8f('0x41')]);if(_0xc02d43&&_0xc02d43[_0x3c8f('0x42')]){logger[_0x3c8f('0xd')]('[ABANDONED]',_0x3c8f('0x44'));_0x22cc79[_0x3c8f('0x45')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x54b6e3[_0x3c8f('0x41')],_0x22cc79['uniqueid'],md5(_0x22cc79[_0x3c8f('0x46')]));}else{_0x22cc79[_0x3c8f('0x45')]='';}headers[_0x3c8f('0x5c')]=getAuth(_0x54b6e3);return getUser(_0x54b6e3)['then'](function(_0x3a6af1){_0x5e166c=_0x3a6af1;logger[_0x3c8f('0xd')]('The\x20User\x20ID\x20is:',_0x5e166c['id']);return getEndUser(_0x54b6e3,_0x22cc79[_0x3c8f('0x62')],_0x22cc79[_0x3c8f('0x49')]);})[_0x3c8f('0x15')](function(_0x4ea6c8){_0x25626e=_0x4ea6c8;logger[_0x3c8f('0xd')](_0x3c8f('0x4a'),_0x25626e['id']);return getTicket(_0x54b6e3,_0x5e166c,_0x25626e,_0x387a08,_0x22cc79);})[_0x3c8f('0x15')](function(_0x5a9eef){if(_0x5a9eef){logger[_0x3c8f('0xd')](_0x3c8f('0x4b'),_0x5a9eef['id']);}})['catch'](function(_0x2aa3ff){logger[_0x3c8f('0x52')](_0x3c8f('0x63'),util['inspect'](_0x2aa3ff,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x98fc=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','none','[OUTBOUND]','destcalleridnum','%s/channels/voice/agents/%d/tickets/%d/display.json','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','abandoned','[ABANDONED]','calleridnum','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','../../../../config/environment','zendesk','defaults','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','remoteUri','POST','merge','Tags','name','Subjects','getString','Descriptions','Fields','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/users/me.json','user','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','%s/users.json','Enduser\x20created.','authType','password','%s:%s','username','token','toString','base64','debug','[HTTP]','GET','forEach','type','nameField','customField','content','custom_fields','push','idField','variableName','customVariable','Variable','toLowerCase','queue','serverUrl','stripTrailingSlash','monitor_format','recordingURL'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x98fc,0x156));var _0xc98f=function(_0x5a2d3f,_0x27b04e){_0x5a2d3f=_0x5a2d3f-0x0;var _0x5c65d8=_0x98fc[_0x5a2d3f];return _0x5c65d8;};'use strict';var _=require(_0xc98f('0x0'));var rp=require(_0xc98f('0x1'));var md5=require(_0xc98f('0x2'));var util=require(_0xc98f('0x3'));var Redis=require(_0xc98f('0x4'));var intUtil=require('./util');var config=require(_0xc98f('0x5'));var logger=require('../../../../config/logger')(_0xc98f('0x6'));config['redis']=_[_0xc98f('0x7')](config[_0xc98f('0x8')],{'host':_0xc98f('0x9'),'port':0x18eb});var io=require(_0xc98f('0xa'))(new Redis(config[_0xc98f('0x8')]));function emit(_0x1a8812,_0x28f276,_0x191b3f){io['to'](_0x1a8812)[_0xc98f('0xb')](_0x28f276,_0x191b3f);}var headers={'Content-Type':_0xc98f('0xc'),'Accept':'application/json'};function getTicket(_0xb21d1a,_0x5843a9,_0xe36932,_0x388e1d,_0xe8d700){logger[_0xc98f('0xd')](_0xc98f('0xe'));return request({'uri':util['format']('%s/tickets.json',_0xb21d1a[_0xc98f('0xf')]),'method':_0xc98f('0x10'),'body':{'ticket':_[_0xc98f('0x11')]({'requester_id':_0xe36932['id'],'submitter_id':_0x5843a9?_0x5843a9['id']:undefined,'assignee_id':_0x5843a9?_0x5843a9['id']:undefined,'tags':getTags(_0x388e1d[_0xc98f('0x12')],_0xc98f('0x13')),'subject':intUtil['getString'](_0x388e1d[_0xc98f('0x14')],_0xe8d700,'\x20'),'description':intUtil[_0xc98f('0x15')](_0x388e1d['Descriptions'],_0xe8d700,'\x0a'),'comment':{'public':![],'body':intUtil[_0xc98f('0x15')](_0x388e1d[_0xc98f('0x16')],_0xe8d700,'\x0a')}},getCustomFields(_0x388e1d[_0xc98f('0x17')],_0xe8d700))}})[_0xc98f('0x18')](function(_0x267059){logger[_0xc98f('0xd')]('Ticket\x20created!');return _0x267059[_0xc98f('0x19')];});}function getUser(_0x450602,_0x55bbf3){if(intUtil[_0xc98f('0x1a')](_0x55bbf3)){logger['info'](_0xc98f('0x1b'),_0x55bbf3);return request({'uri':util[_0xc98f('0x1c')]('%s/search.json',_0x450602[_0xc98f('0xf')]),'qs':{'query':util[_0xc98f('0x1c')](_0xc98f('0x1d'),_0x55bbf3)}})['then'](function(_0x47c22e){if(_0x47c22e[_0xc98f('0x1e')]){logger[_0xc98f('0xd')](_0xc98f('0x1f'));return _[_0xc98f('0x20')](_0x47c22e[_0xc98f('0x21')],{'email':_0x55bbf3,'role':_0xc98f('0x22')});}else{logger['info'](_0xc98f('0x23'));return request({'uri':util[_0xc98f('0x1c')]('%s/users/me.json',_0x450602[_0xc98f('0xf')])})[_0xc98f('0x18')](function(_0x1620fd){logger[_0xc98f('0xd')](_0xc98f('0x24'));return _0x1620fd['user'];});}});}else{logger[_0xc98f('0xd')](_0xc98f('0x23'));return request({'uri':util[_0xc98f('0x1c')](_0xc98f('0x25'),_0x450602[_0xc98f('0xf')])})[_0xc98f('0x18')](function(_0x357fe4){logger[_0xc98f('0xd')](_0xc98f('0x24'));return _0x357fe4[_0xc98f('0x26')];});}}function getEndUser(_0xe18d29,_0x4cdd32,_0x42846b){logger[_0xc98f('0xd')](_0xc98f('0x27'),_0x42846b);return request({'uri':util[_0xc98f('0x1c')](_0xc98f('0x28'),_0xe18d29[_0xc98f('0xf')]),'qs':{'query':util[_0xc98f('0x1c')](_0xc98f('0x29'),_0x42846b)}})['then'](function(_0x3179c2){var _0x2886d5;if(_0x3179c2[_0xc98f('0x21')]['length']){_0x3179c2[_0xc98f('0x21')]=_[_0xc98f('0x2a')](_0x3179c2[_0xc98f('0x21')],{'suspended':![],'role':_0xc98f('0x2b')});if(_0x3179c2['results'][_0xc98f('0x2c')]){_0x2886d5=_['first'](_0x3179c2[_0xc98f('0x21')]);}}if(_0x2886d5){logger[_0xc98f('0xd')]('Enduser\x20found!');return _0x2886d5;}else{logger[_0xc98f('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xc98f('0x1c')](_0xc98f('0x2d'),_0xe18d29['remoteUri']),'method':_0xc98f('0x10'),'body':{'user':{'role':_0xc98f('0x2b'),'name':util['format']('Caller\x20-\x20%s',_0x4cdd32||_0x42846b),'phone':_0x42846b}}})[_0xc98f('0x18')](function(_0x53532c){logger['info'](_0xc98f('0x2e'));return _0x53532c[_0xc98f('0x26')];});}});}function getAuth(_0x428a52){var _0x4ea09d;if(_0x428a52[_0xc98f('0x2f')]===_0xc98f('0x30')){_0x4ea09d=util[_0xc98f('0x1c')](_0xc98f('0x31'),_0x428a52[_0xc98f('0x32')],_0x428a52[_0xc98f('0x30')]);}else if(_0x428a52[_0xc98f('0x2f')]===_0xc98f('0x33')){_0x4ea09d=util['format']('%s/token:%s',_0x428a52['username'],_0x428a52[_0xc98f('0x33')]);}return util['format']('Basic\x20%s',new Buffer(_0x4ea09d)[_0xc98f('0x34')](_0xc98f('0x35')));}function request(_0x2fe253){logger[_0xc98f('0x36')](_0xc98f('0x37'),JSON['stringify'](_0x2fe253));return rp(_['defaults'](_0x2fe253,{'method':_0xc98f('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x3080bd,_0x266afb){var _0x50874e=[];if(_0x3080bd&&_0x3080bd['length']>0x0){_0x50874e=_['map'](_0x3080bd,_0x266afb);}return _0x50874e;}function getCustomFields(_0x32635d,_0x18d27f){var _0x1b5f31=[];var _0x2c5664={'custom_fields':[]};if(_0x32635d[_0xc98f('0x2c')]>0x0){_[_0xc98f('0x39')](_0x32635d,function(_0x12cde1){if(_0x12cde1[_0xc98f('0x3a')]==='string'&&_0x12cde1[_0xc98f('0x3b')]&&!_0x12cde1[_0xc98f('0x3c')]){_0x2c5664[_0x12cde1['nameField']['toLowerCase']()]=_0x12cde1[_0xc98f('0x3d')]['toString']();}else if(_0x12cde1['type']==='string'&&_0x12cde1['idField']&&_0x12cde1[_0xc98f('0x3c')]){_0x2c5664[_0xc98f('0x3e')][_0xc98f('0x3f')]({'id':_0x12cde1[_0xc98f('0x40')],'value':_0x12cde1[_0xc98f('0x3d')][_0xc98f('0x34')]()});}else if(_0x12cde1[_0xc98f('0x3a')]==='variable'&&_0x12cde1['variableName']&&_0x12cde1[_0xc98f('0x40')]&&_0x12cde1[_0xc98f('0x3c')]){_0x18d27f[_0x12cde1[_0xc98f('0x41')]]&&_0x2c5664[_0xc98f('0x3e')]['push']({'id':_0x12cde1['idField'],'value':_0x18d27f[_0x12cde1[_0xc98f('0x41')]][_0xc98f('0x34')]()});}else if(_0x12cde1[_0xc98f('0x3a')]===_0xc98f('0x42')&&_0x12cde1[_0xc98f('0x43')]&&_0x12cde1[_0xc98f('0x43')][_0xc98f('0x13')]&&_0x12cde1[_0xc98f('0x40')]&&_0x12cde1[_0xc98f('0x3c')]){_0x18d27f[_0x12cde1[_0xc98f('0x43')][_0xc98f('0x13')][_0xc98f('0x44')]()]&&_0x2c5664[_0xc98f('0x3e')][_0xc98f('0x3f')]({'id':_0x12cde1[_0xc98f('0x40')],'value':_0x18d27f[_0x12cde1[_0xc98f('0x43')][_0xc98f('0x13')]['toLowerCase']()][_0xc98f('0x34')]()});}});}return _0x2c5664;}exports[_0xc98f('0x45')]=function(_0x2b6d72,_0x11fc6e,_0x1a5455,_0x88a5cb,_0x24bba3,_0x38c2eb){var _0x5a1267,_0x2f4bbb;_0x38c2eb[_0xc98f('0xf')]=intUtil['stripTrailingSlash'](_0x38c2eb['remoteUri']);_0x38c2eb[_0xc98f('0x46')]=intUtil[_0xc98f('0x47')](_0x38c2eb[_0xc98f('0x46')]);if(_0x24bba3&&_0x24bba3[_0xc98f('0x48')]){logger[_0xc98f('0xd')]('[QUEUE]','Recording\x20is\x20enabled!');_0x11fc6e[_0xc98f('0x49')]=util[_0xc98f('0x1c')](_0xc98f('0x4a'),_0x38c2eb[_0xc98f('0x46')],_0x11fc6e['uniqueid'],md5(_0x11fc6e[_0xc98f('0x4b')]));}else{_0x11fc6e[_0xc98f('0x49')]='';}headers[_0xc98f('0x4c')]=getAuth(_0x38c2eb);return getUser(_0x38c2eb,_0x88a5cb[_0xc98f('0x4d')])[_0xc98f('0x18')](function(_0xf4c632){_0x5a1267=_0xf4c632;logger[_0xc98f('0xd')](_0xc98f('0x4e'),_0x5a1267['id']);return getEndUser(_0x38c2eb,_0x11fc6e[_0xc98f('0x4f')],_0x11fc6e['calleridnum']);})['then'](function(_0x40cc90){_0x2f4bbb=_0x40cc90;logger[_0xc98f('0xd')](_0xc98f('0x50'),_0x2f4bbb['id']);return getTicket(_0x38c2eb,_0x5a1267,_0x2f4bbb,_0x1a5455,_0x11fc6e);})['then'](function(_0x8fb26b){if(_0x8fb26b){logger[_0xc98f('0xd')](_0xc98f('0x51'),_0x8fb26b['id']);switch(_0x38c2eb['type']){case _0xc98f('0x52'):logger[_0xc98f('0xd')]('[QUEUE]',_0xc98f('0x53'));return request({'uri':util[_0xc98f('0x1c')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x38c2eb[_0xc98f('0xf')],_0x5a1267['id'],_0x8fb26b['id']),'method':'POST'});case _0xc98f('0x54'):logger[_0xc98f('0xd')](_0xc98f('0x55'),_0xc98f('0x56'));emit(util[_0xc98f('0x1c')]('user:%s',_0x88a5cb['name']),_0xc98f('0x57'),{'uri':util['format'](_0xc98f('0x58'),_0x38c2eb['remoteUri'],_0x8fb26b['id'])});break;default:logger['error'](_0xc98f('0x55'),_0xc98f('0x59'));}}})[_0xc98f('0x5a')](function(_0x4ae9d5){logger[_0xc98f('0x5b')](_0xc98f('0x5c'),util['inspect'](_0x4ae9d5,{'showHidden':!![],'depth':null}));});};exports[_0xc98f('0x5d')]=function(_0x3f08d5,_0x1f1cad,_0x4b056b,_0x3dea06,_0x402ccb,_0x49eea9,_0x1277ca){var _0x6c405c,_0x1b73e5;_0x49eea9['remoteUri']=intUtil[_0xc98f('0x47')](_0x49eea9[_0xc98f('0xf')]);_0x49eea9['serverUrl']=intUtil[_0xc98f('0x47')](_0x49eea9[_0xc98f('0x46')]);if(_0x1277ca&&_0x1277ca['recordingFormat']&&_0x1277ca['recordingFormat']!==_0xc98f('0x5e')){logger[_0xc98f('0xd')](_0xc98f('0x5f'),'Recording\x20is\x20enabled!');_0x1f1cad[_0xc98f('0x49')]=util[_0xc98f('0x1c')](_0xc98f('0x4a'),_0x49eea9[_0xc98f('0x46')],_0x1f1cad[_0xc98f('0x4b')],md5(_0x1f1cad[_0xc98f('0x4b')]));}headers[_0xc98f('0x4c')]=getAuth(_0x49eea9);return getUser(_0x49eea9,_0x3dea06[_0xc98f('0x4d')])[_0xc98f('0x18')](function(_0x56dae7){_0x6c405c=_0x56dae7;logger[_0xc98f('0xd')](_0xc98f('0x4e'),_0x6c405c['id']);return getEndUser(_0x49eea9,_0x1f1cad['destcalleridname'],_0x1f1cad[_0xc98f('0x60')]);})[_0xc98f('0x18')](function(_0x5a1d40){_0x1b73e5=_0x5a1d40;logger[_0xc98f('0xd')](_0xc98f('0x50'),_0x1b73e5['id']);return getTicket(_0x49eea9,_0x6c405c,_0x1b73e5,_0x4b056b,_0x1f1cad);})[_0xc98f('0x18')](function(_0x599601){if(_0x599601){logger['info'](_0xc98f('0x51'),_0x599601['id']);switch(_0x49eea9['type']){case _0xc98f('0x52'):logger[_0xc98f('0xd')](_0xc98f('0x5f'),_0xc98f('0x53'));return request({'uri':util[_0xc98f('0x1c')](_0xc98f('0x61'),_0x49eea9[_0xc98f('0xf')],_0x6c405c['id'],_0x599601['id']),'method':_0xc98f('0x10')});case'newTab':logger[_0xc98f('0xd')]('[OUTBOUND]',_0xc98f('0x56'));emit(util[_0xc98f('0x1c')]('user:%s',_0x3dea06['name']),_0xc98f('0x57'),{'uri':util[_0xc98f('0x1c')](_0xc98f('0x58'),_0x49eea9[_0xc98f('0xf')],_0x599601['id'])});break;default:logger[_0xc98f('0x5b')]('[OUTBOUND]',_0xc98f('0x59'));}}})[_0xc98f('0x5a')](function(_0x2ada19){logger['error'](_0xc98f('0x62'),util[_0xc98f('0x63')](_0x2ada19,{'showHidden':!![],'depth':null}));});};exports[_0xc98f('0x64')]=function(_0x351f0b,_0x1ee107,_0x596bcd,_0x5c4620,_0x20c7fb,_0x120704){var _0x25ac75,_0x4f2434;_0x120704[_0xc98f('0xf')]=intUtil[_0xc98f('0x47')](_0x120704[_0xc98f('0xf')]);_0x120704['serverUrl']=intUtil[_0xc98f('0x47')](_0x120704[_0xc98f('0x46')]);if(_0x20c7fb&&_0x20c7fb[_0xc98f('0x48')]){logger[_0xc98f('0xd')](_0xc98f('0x65'),'Recording\x20is\x20enabled!');_0x1ee107[_0xc98f('0x49')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x120704[_0xc98f('0x46')],_0x1ee107[_0xc98f('0x4b')],md5(_0x1ee107['uniqueid']));}else{_0x1ee107[_0xc98f('0x49')]='';}headers[_0xc98f('0x4c')]=getAuth(_0x120704);return getUser(_0x120704)[_0xc98f('0x18')](function(_0x45df45){_0x25ac75=_0x45df45;logger[_0xc98f('0xd')]('The\x20User\x20ID\x20is:',_0x25ac75['id']);return getEndUser(_0x120704,_0x1ee107[_0xc98f('0x4f')],_0x1ee107[_0xc98f('0x66')]);})[_0xc98f('0x18')](function(_0x487c9b){_0x4f2434=_0x487c9b;logger[_0xc98f('0xd')](_0xc98f('0x50'),_0x4f2434['id']);return getTicket(_0x120704,_0x25ac75,_0x4f2434,_0x596bcd,_0x1ee107);})[_0xc98f('0x18')](function(_0x1eedf8){if(_0x1eedf8){logger[_0xc98f('0xd')](_0xc98f('0x51'),_0x1eedf8['id']);}})['catch'](function(_0x35c8e6){logger['error'](_0xc98f('0x67'),util[_0xc98f('0x63')](_0x35c8e6,{'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 156ada9..1f23404 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 _0xf03c=['https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','enduserType','CREATE\x20ERROR','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Owner','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','What_Id','Last_Name','Call_Duration','utc','talktime','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','lastevent','Call_Result','connect','Answered','Rejected','abandoned','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','stack','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','/api/voice/recordings/','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','Outbound','The\x20Call\x20ID\x20is:','[ABANDONED]','lodash','request-promise','md5','moment','ioredis','bluebird','../../../../config/environment','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','forEach','type','string','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','then','expires_in','seconds','catch','error','info','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','isArrayLikeObject','users','email','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data'];(function(_0x21aa12,_0xd6e085){var _0x446932=function(_0xc79fa6){while(--_0xc79fa6){_0x21aa12['push'](_0x21aa12['shift']());}};_0x446932(++_0xd6e085);}(_0xf03c,0x17a));var _0xcf03=function(_0x42c3d3,_0x292445){_0x42c3d3=_0x42c3d3-0x0;var _0x4409ee=_0xf03c[_0x42c3d3];return _0x4409ee;};'use strict';var _=require(_0xcf03('0x0'));var rp=require(_0xcf03('0x1'));var md5=require(_0xcf03('0x2'));var util=require('util');var intUtil=require('./util');var moment=require(_0xcf03('0x3'));var Redis=require(_0xcf03('0x4'));var BPromise=require(_0xcf03('0x5'));var config=require(_0xcf03('0x6'));var logger=require('../../../../config/logger')(_0xcf03('0x7'));config[_0xcf03('0x8')]=_[_0xcf03('0x9')](config['redis'],{'host':_0xcf03('0xa'),'port':0x18eb});var io=require(_0xcf03('0xb'))(new Redis(config[_0xcf03('0x8')]));function emit(_0x2e4a4b,_0x24ae7b,_0x542492){io['to'](_0x2e4a4b)[_0xcf03('0xc')](_0x24ae7b,_0x542492);}function request(_0x4751a8){logger[_0xcf03('0xd')](_0xcf03('0xe'),JSON['stringify'](_0x4751a8));return rp(_0x4751a8);}function getCustomFields(_0x191e75,_0x43a0e5){var _0x28b269={};if(_0x191e75['length']>0x0){_[_0xcf03('0xf')](_0x191e75,function(_0x5798c){if(_0x5798c[_0xcf03('0x10')]===_0xcf03('0x11')&&_0x5798c[_0xcf03('0x12')]){_0x28b269[_0x5798c[_0xcf03('0x12')]]=_0x5798c[_0xcf03('0x13')][_0xcf03('0x14')]();}else if(_0x5798c[_0xcf03('0x10')]==='variable'&&_0x5798c[_0xcf03('0x15')]&&_0x5798c[_0xcf03('0x12')]&&_0x43a0e5[_0x5798c[_0xcf03('0x15')]]){_0x28b269[_0x5798c[_0xcf03('0x12')]]=_0x43a0e5[_0x5798c['variableName']][_0xcf03('0x14')]();}else if(_0x5798c[_0xcf03('0x10')]===_0xcf03('0x16')&&_0x5798c[_0xcf03('0x17')]&&_0x5798c['Variable'][_0xcf03('0x18')]&&_0x5798c[_0xcf03('0x12')]&&_0x43a0e5[_0x5798c[_0xcf03('0x17')][_0xcf03('0x18')]['toLowerCase']()]){_0x28b269[_0x5798c['idField']]=_0x43a0e5[_0x5798c[_0xcf03('0x17')][_0xcf03('0x18')][_0xcf03('0x19')]()][_0xcf03('0x14')]();}});}return _0x28b269;}function getName(_0x215722){if(_0x215722[_0xcf03('0x1a')]('\x20')>0x0){var _0x13b8bd=_0x215722[_0xcf03('0x1b')](/ (.+)/);if(_0x13b8bd[0x1]){return _0x13b8bd;}}return[_0x215722,_0x215722];}var accountsTokens={};function getAccessToken(_0x2d5fb4){return new Promise(function(_0x17dd1f,_0x49a6cf){if(!_['isNil'](accountsTokens[_0x2d5fb4['id']])&&!_[_0xcf03('0x1c')](accountsTokens[_0x2d5fb4['id']][_0xcf03('0x1d')])){if(moment()[_0xcf03('0x1e')](accountsTokens[_0x2d5fb4['id']]['expires_in'])){_0x17dd1f(accountsTokens[_0x2d5fb4['id']][_0xcf03('0x1d')]);}}var _0xa55fc8;switch(_0x2d5fb4[_0xcf03('0x1f')]){case'US':_0xa55fc8=_0xcf03('0x20');break;case'AU':_0xa55fc8='https://accounts.zoho.com.au';break;case'EU':_0xa55fc8=_0xcf03('0x21');break;case'IN':_0xa55fc8='https://accounts.zoho.in';break;case'CN':_0xa55fc8=_0xcf03('0x22');break;default:_0xa55fc8=_0xcf03('0x21');break;}var _0x128fb9={'method':_0xcf03('0x23'),'uri':_0xa55fc8+_0xcf03('0x24'),'qs':{'refresh_token':_0x2d5fb4[_0xcf03('0x25')],'client_id':_0x2d5fb4[_0xcf03('0x26')],'client_secret':_0x2d5fb4[_0xcf03('0x27')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x128fb9)[_0xcf03('0x28')](function(_0x35e191){accountsTokens[_0x2d5fb4['id']]={'access_token':_0x35e191[_0xcf03('0x1d')],'expires_in':moment()['add'](_0x35e191[_0xcf03('0x29')],_0xcf03('0x2a'))};_0x17dd1f(_0x35e191[_0xcf03('0x1d')]);})[_0xcf03('0x2b')](function(_0x347593){logger[_0xcf03('0x2c')]('Failing\x20creating\x20the\x20access_token',_0x347593['stack']);_0x49a6cf(_0x347593);});});}function getUser(_0x243eec,_0x3a51d0,_0x583f4d,_0x172a09){logger[_0xcf03('0x2d')]('Search\x20user');return request({'method':_0xcf03('0x2e'),'uri':util[_0xcf03('0x2f')](_0xcf03('0x30'),_0x3a51d0),'qs':{'type':_0xcf03('0x31')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x243eec},'json':!![]})['then'](function(_0x11df0a){if(_0x11df0a['users']){var _0x41f720=-0x1;if(_[_0xcf03('0x32')](_0x11df0a['users'])){if(!_[_0xcf03('0x1c')](_0x172a09)){_0x41f720=_['findIndex'](_0x11df0a[_0xcf03('0x33')],function(_0x2fdc93){return _0x2fdc93[_0xcf03('0x34')]===_0x172a09;});}if(_0x41f720>=0x0){logger[_0xcf03('0x2d')](_0xcf03('0x35'));}else{logger[_0xcf03('0x2d')](_0xcf03('0x36'));_0x41f720=_[_0xcf03('0x37')](_0x11df0a[_0xcf03('0x33')],function(_0x14827f){return _0x14827f[_0xcf03('0x38')][_0xcf03('0x18')]===_0xcf03('0x39');});}return _0x11df0a[_0xcf03('0x33')][_0x41f720];}else{if(_0x11df0a['user'][_0xcf03('0x38')][_0xcf03('0x18')]==='Administrator'){logger[_0xcf03('0x2d')](_0xcf03('0x36'));user=_0x11df0a[_0xcf03('0x3a')];return user;}else{logger[_0xcf03('0x2c')](_0xcf03('0x3b'),JSON[_0xcf03('0x3c')](_0x11df0a));throw new Error(_0xcf03('0x3d')+JSON['stringify'](_0x11df0a));}}}else{logger[_0xcf03('0x2c')](_0xcf03('0x3b'),JSON[_0xcf03('0x3c')](_0x11df0a));throw new Error(_0xcf03('0x3d')+JSON[_0xcf03('0x3c')](_0x11df0a));}})[_0xcf03('0x2b')](function(_0x59da39){console[_0xcf03('0x2c')](_0x59da39);});}function getZohoUser(_0x2e3bfb,_0x116e5f){return new BPromise(function(_0x20c0e0,_0x2f8ff4){request(_0x2e3bfb)[_0xcf03('0x28')](function(_0x62da2f){var _0x513dfd=null;if(_0x62da2f){_0x513dfd=_0x62da2f[_0xcf03('0x3e')][0x0];_0x513dfd['enduserType']=_0x116e5f;}_0x20c0e0(_0x513dfd);})['catch'](function(_0x3e25f4){_0x2f8ff4(_0x3e25f4);});});}function createEndUser(_0x21467e,_0x18fba2,_0x5263ed,_0x1c6158,_0x275bc9,_0x1a2fec){var _0x5263ed=getName(_0x5263ed);return request({'method':_0xcf03('0x23'),'uri':_0xcf03('0x3f')+_0x18fba2+'/crm/v2/'+_[_0xcf03('0x40')](_0x1a2fec[_0xcf03('0x41')])+'s','body':{'data':[{'Last_Name':_0x5263ed[0x1],'First_Name':_0x5263ed[0x0],'Phone':_0x1c6158,'Owner':{'name':!_[_0xcf03('0x1c')](_0x275bc9[_0xcf03('0x42')]['name'])?_0x275bc9[_0xcf03('0x42')][_0xcf03('0x18')]:!_[_0xcf03('0x1c')](_0x275bc9['first_name'])?_0x275bc9[_0xcf03('0x43')]+'\x20'+_0x275bc9[_0xcf03('0x44')]:_0x275bc9[_0xcf03('0x44')],'id':_0x275bc9['id']}}]},'headers':{'Authorization':_0xcf03('0x45')+_0x21467e},'json':!![]})[_0xcf03('0x28')](function(_0x367186){if(_0x367186&&_0x367186[_0xcf03('0x3e')][0x0][_0xcf03('0x46')]===_0xcf03('0x47')){var _0x37fe80=_0x367186[_0xcf03('0x3e')][0x0][_0xcf03('0x48')];_0x37fe80[_0xcf03('0x49')]=_[_0xcf03('0x40')](_0x1a2fec[_0xcf03('0x41')])+'s';return _0x37fe80;}logger[_0xcf03('0x2c')](_0xcf03('0x3b'),JSON[_0xcf03('0x3c')](data));throw new Error('Error:\x20'+JSON['stringify'](data));})[_0xcf03('0x2b')](function(_0x13ee9a){console['log'](_0xcf03('0x4a'),_0x13ee9a);});}function getEndUser(_0x4ecd91,_0x20b35b,_0x47908f,_0x178450,_0x36c892,_0x3d5f44,_0x3a03fb){var _0x3821e2={'method':_0xcf03('0x2e'),'uri':'','headers':{'Authorization':_0xcf03('0x45')+_0x4ecd91},'json':!![]};switch(_0x3a03fb['moduleSearch']){case _0xcf03('0x4b'):_0x3821e2[_0xcf03('0x4c')]=_0xcf03('0x3f')+_0x20b35b+_0xcf03('0x4d')+_0x36c892+'))';return getZohoUser(_0x3821e2,_0xcf03('0x4e'))[_0xcf03('0x28')](function(_0x365441){if(_0x365441)return _0x365441;_0x3821e2[_0xcf03('0x4c')]=_0xcf03('0x3f')+_0x20b35b+_0xcf03('0x4f')+_0x36c892+'))';return getZohoUser(_0x3821e2,_0xcf03('0x50'))[_0xcf03('0x28')](function(_0x304a31){if(_0x304a31)return _0x304a31;if(_0x3a03fb[_0xcf03('0x41')]!=_0xcf03('0x51')){return createEndUser(_0x4ecd91,_0x20b35b,_0x178450,_0x36c892,_0x3d5f44,_0x3a03fb);}else{return{};}});});break;case _0xcf03('0x52'):_0x3821e2[_0xcf03('0x4c')]=_0xcf03('0x3f')+_0x20b35b+_0xcf03('0x4d')+_0x36c892+'))';return getZohoUser(_0x3821e2,'Contacts')[_0xcf03('0x28')](function(_0x198abb){if(_0x198abb)return _0x198abb;if(_0x3a03fb['moduleCreate']!=_0xcf03('0x51')){return createEndUser(_0x4ecd91,_0x20b35b,_0x178450,_0x36c892,_0x3d5f44,_0x3a03fb);}else{return{};}});break;case _0xcf03('0x53'):_0x3821e2[_0xcf03('0x4c')]=_0xcf03('0x3f')+_0x20b35b+_0xcf03('0x4f')+_0x36c892+'))';return getZohoUser(_0x3821e2,_0xcf03('0x50'))['then'](function(_0x2c0184){if(_0x2c0184)return _0x2c0184;if(_0x3a03fb[_0xcf03('0x41')]!=_0xcf03('0x51')){return createEndUser(_0x4ecd91,_0x20b35b,_0x178450,_0x36c892,_0x3d5f44,_0x3a03fb);}else{return{};}});break;}}function getCall(_0x470555,_0x361cc6,_0x33d552,_0x100ebc,_0x10f14d,_0x102c07,_0x1cbe24,_0xd51474){logger[_0xcf03('0x2d')]('Creating\x20new\x20call...');var _0x51e623={};_0x51e623[_0xcf03('0x54')]={'name':!_[_0xcf03('0x1c')](_0x100ebc['role'][_0xcf03('0x18')])&&!_[_0xcf03('0x1c')](_0x100ebc[_0xcf03('0x38')]['name'])&&_0x100ebc[_0xcf03('0x38')][_0xcf03('0x18')]==='administrator'?_0x100ebc['role'][_0xcf03('0x18')]:!_['isNil'](_0x100ebc[_0xcf03('0x43')])?_0x100ebc[_0xcf03('0x43')]+'\x20'+_0x100ebc['last_name']:_0x100ebc['last_name'],'id':_0x100ebc['id']};_0x51e623['Subject']=intUtil[_0xcf03('0x55')](_0x102c07[_0xcf03('0x56')],_0x1cbe24,'\x20');_0x51e623[_0xcf03('0x57')]=intUtil[_0xcf03('0x55')](_0x102c07[_0xcf03('0x58')],_0x1cbe24,'\x0a');if(_0x10f14d[_0xcf03('0x49')]===_0xcf03('0x4e')){_0x51e623[_0xcf03('0x59')]={'name':!_[_0xcf03('0x1c')](_0x10f14d[_0xcf03('0x5a')])?_0x10f14d[_0xcf03('0x5a')]:!_[_0xcf03('0x1c')](_0x10f14d[_0xcf03('0x5b')])?_0x10f14d[_0xcf03('0x5b')]+'\x20'+_0x10f14d['Last_Name']:_0x10f14d['Last_Name'],'id':_0x10f14d['id']};}if(_0x10f14d[_0xcf03('0x49')]==='Leads'){_0x51e623[_0xcf03('0x5c')]={'name':!_[_0xcf03('0x1c')](_0x10f14d[_0xcf03('0x5a')])?_0x10f14d['Full_Name']:!_[_0xcf03('0x1c')](_0x10f14d['First_Name'])?_0x10f14d[_0xcf03('0x5b')]+'\x20'+_0x10f14d[_0xcf03('0x5d')]:_0x10f14d[_0xcf03('0x5d')],'id':_0x10f14d['id']};_0x51e623['$se_module']=_[_0xcf03('0x40')](_0x10f14d['enduserType']);}if(_0x1cbe24['talktime']){_0x51e623[_0xcf03('0x5e')]=moment[_0xcf03('0x5f')](parseInt(_0x1cbe24[_0xcf03('0x60')])*0x3e8)['format'](_0xcf03('0x61'));}else if(_0x1cbe24[_0xcf03('0x62')]&&_0x1cbe24[_0xcf03('0x63')]){_0x51e623[_0xcf03('0x5e')]=moment['utc'](moment(_0x1cbe24['endtime'],'YYYY-MM-DDTHH:mm:ss')['diff'](moment(_0x1cbe24['starttime'],_0xcf03('0x64'))))[_0xcf03('0x2f')](_0xcf03('0x61'));}switch(_0x1cbe24[_0xcf03('0x65')]){case'called':_0x51e623[_0xcf03('0x66')]='Called';break;case'complete':case _0xcf03('0x67'):_0x51e623['Call_Result']=_0xcf03('0x68');break;case'rejected':_0x51e623[_0xcf03('0x66')]=_0xcf03('0x69');break;case _0xcf03('0x6a'):_0x51e623[_0xcf03('0x66')]='Abandoned';break;default:}_0x51e623[_0xcf03('0x6b')]=(_0xd51474===_0xcf03('0x6c')?moment(_0x1cbe24['starttime'])[_0xcf03('0x2f')](_0xcf03('0x64')):moment(_0x1cbe24[_0xcf03('0x6d')])[_0xcf03('0x2f')](_0xcf03('0x64')))||moment()['format'](_0xcf03('0x64'));_0x51e623[_0xcf03('0x6e')]=_0xd51474||_0xcf03('0x6f');_0x51e623=_[_0xcf03('0x70')](_0x51e623,getCustomFields(_0x102c07[_0xcf03('0x71')],_0x1cbe24));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x361cc6+_0xcf03('0x72'),'headers':{'Authorization':_0xcf03('0x45')+_0x470555},'body':{'data':[_0x51e623]},'json':!![]})[_0xcf03('0x28')](function(_0x568667){if(_0x568667&&_0x568667['data'][0x0][_0xcf03('0x46')]==='SUCCESS'){logger[_0xcf03('0x2d')](_0xcf03('0x73'));return{'id':_0x568667['data'][0x0][_0xcf03('0x48')]['id']};}})[_0xcf03('0x2b')](function(_0x22d82d){logger['info'](_0xcf03('0x74'),_0x22d82d[_0xcf03('0x75')]);console[_0xcf03('0x76')](_0xcf03('0x74'),_0x22d82d);});}exports[_0xcf03('0x77')]=function(_0x48619f,_0x13c8ad,_0x391945,_0x22d4da,_0x1d6461,_0x31f039){var _0x4f0034,_0x2b0ba8,_0x516669;_0x31f039[_0xcf03('0x78')]=intUtil[_0xcf03('0x79')](_0x31f039[_0xcf03('0x78')]);_0x31f039[_0xcf03('0x7a')]=intUtil[_0xcf03('0x79')](_0x31f039[_0xcf03('0x7a')]);if(_0x1d6461&&_0x1d6461[_0xcf03('0x7b')]){logger['info']('[QUEUE]',_0xcf03('0x7c'));_0x13c8ad['recordingURL']=_0x31f039['serverUrl']+_0xcf03('0x7d')+_0x13c8ad['uniqueid']+_0xcf03('0x7e')+md5(_0x13c8ad['uniqueid']);}else{_0x13c8ad[_0xcf03('0x7f')]='';}var _0xebf05e=_0x31f039['host']===_0xcf03('0x80')?'eu':_0xcf03('0x81');return getAccessToken(_0x31f039)[_0xcf03('0x28')](function(_0x37e996){_0x516669=_0x37e996;return getUser(_0x516669,_0xebf05e,_0x31f039,_0x22d4da[_0xcf03('0x34')]);})[_0xcf03('0x28')](function(_0x313e28){_0x4f0034=_0x313e28;logger[_0xcf03('0x2d')](_0xcf03('0x82'),_0x4f0034['id']);return getEndUser(_0x516669,_0xebf05e,_0x31f039,_0x13c8ad[_0xcf03('0x83')],_0x13c8ad[_0xcf03('0x84')],_0x4f0034,_0x391945);})[_0xcf03('0x28')](function(_0x41b1e9){_0x2b0ba8=_0x41b1e9;return getCall(_0x516669,_0xebf05e,_0x31f039,_0x4f0034,_0x2b0ba8,_0x391945,_0x13c8ad,_0xcf03('0x6f'));})[_0xcf03('0x28')](function(_0x5d713c){if(_0x5d713c){logger['info']('The\x20Call\x20ID\x20is:',_0x5d713c['id']);logger[_0xcf03('0x2d')](_0xcf03('0x85'),_0xcf03('0x86'));emit(util['format'](_0xcf03('0x87'),_0x22d4da['name']),_0xcf03('0x88'),{'uri':_0xcf03('0x89')+_0x31f039[_0xcf03('0x78')]+_0xcf03('0x8a')+_0x5d713c['id']});}})[_0xcf03('0x2b')](function(_0xb3b548){logger['error'](_0xcf03('0x85'),JSON[_0xcf03('0x3c')](_0xb3b548));});};exports[_0xcf03('0x6c')]=function(_0x1d0898,_0x3f42db,_0x16aa80,_0x252dcd,_0x369b1f,_0x113de5,_0x22cc09){var _0x5361e8,_0x2c93ed,_0x2c868f;_0x113de5[_0xcf03('0x78')]=intUtil[_0xcf03('0x79')](_0x113de5[_0xcf03('0x78')]);_0x113de5[_0xcf03('0x7a')]=intUtil[_0xcf03('0x79')](_0x113de5[_0xcf03('0x7a')]);if(_0x22cc09&&_0x22cc09[_0xcf03('0x8b')]&&_0x22cc09[_0xcf03('0x8b')]!==_0xcf03('0x8c')){logger[_0xcf03('0x2d')](_0xcf03('0x8d'),_0xcf03('0x7c'));_0x3f42db[_0xcf03('0x7f')]=_0x113de5[_0xcf03('0x7a')]+_0xcf03('0x7d')+_0x3f42db[_0xcf03('0x8e')]+_0xcf03('0x7e')+md5(_0x3f42db['uniqueid']);}var _0x15c2da=_0x113de5[_0xcf03('0x78')]===_0xcf03('0x80')?'eu':_0xcf03('0x81');return getAccessToken(_0x113de5)[_0xcf03('0x28')](function(_0x1e841c){_0x2c868f=_0x1e841c;return getUser(_0x2c868f,_0x15c2da,_0x113de5,_0x252dcd[_0xcf03('0x34')]);})[_0xcf03('0x28')](function(_0x55d271){_0x5361e8=_0x55d271;logger[_0xcf03('0x2d')](_0xcf03('0x82'),_0x5361e8['id']);return getEndUser(_0x2c868f,_0x15c2da,_0x113de5,_0x3f42db[_0xcf03('0x8f')],_0x3f42db['destcalleridnum'],_0x5361e8,_0x16aa80);})[_0xcf03('0x28')](function(_0x4c8434){_0x2c93ed=_0x4c8434;return getCall(_0x2c868f,_0x15c2da,_0x113de5,_0x5361e8,_0x2c93ed,_0x16aa80,_0x3f42db,_0xcf03('0x90'));})[_0xcf03('0x28')](function(_0x3a82d5){if(_0x3a82d5){logger['info'](_0xcf03('0x91'),_0x3a82d5['id']);logger[_0xcf03('0x2d')]('[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xcf03('0x2f')](_0xcf03('0x87'),_0x252dcd[_0xcf03('0x18')]),_0xcf03('0x88'),{'uri':_0xcf03('0x89')+_0x113de5['host']+_0xcf03('0x8a')+_0x3a82d5['id']});}})[_0xcf03('0x2b')](function(_0x4663c8){logger[_0xcf03('0x2c')](_0xcf03('0x8d'),JSON['stringify'](_0x4663c8));});};exports[_0xcf03('0x6a')]=function(_0xf08a02,_0x24911b,_0x26c866,_0x4b4344,_0x1213fd,_0x52fcbf){var _0xf53acc,_0x263f1b,_0x249c53;_0x52fcbf[_0xcf03('0x78')]=intUtil[_0xcf03('0x79')](_0x52fcbf[_0xcf03('0x78')]);_0x52fcbf[_0xcf03('0x7a')]=intUtil['stripTrailingSlash'](_0x52fcbf['serverUrl']);if(_0x1213fd&&_0x1213fd[_0xcf03('0x7b')]){logger[_0xcf03('0x2d')](_0xcf03('0x92'),'Recording\x20is\x20enabled!');_0x24911b[_0xcf03('0x7f')]=_0x52fcbf['serverUrl']+_0xcf03('0x7d')+_0x24911b['uniqueid']+_0xcf03('0x7e')+md5(_0x24911b[_0xcf03('0x8e')]);}else{_0x24911b['recordingURL']='';}var _0x5de447=_0x52fcbf[_0xcf03('0x78')]===_0xcf03('0x80')?'eu':_0xcf03('0x81');return getAccessToken(_0x52fcbf)[_0xcf03('0x28')](function(_0x2c66e){_0x249c53=_0x2c66e;return getUser(_0x249c53,_0x5de447,_0x52fcbf);})[_0xcf03('0x28')](function(_0x27636b){_0xf53acc=_0x27636b;logger[_0xcf03('0x2d')](_0xcf03('0x82'),_0xf53acc['id']);return getEndUser(_0x249c53,_0x5de447,_0x52fcbf,_0x24911b[_0xcf03('0x83')],_0x24911b[_0xcf03('0x84')],_0xf53acc,_0x26c866);})['then'](function(_0x12fb4f){_0x263f1b=_0x12fb4f;return getCall(_0x249c53,_0x5de447,_0x52fcbf,_0xf53acc,_0x263f1b,_0x26c866,_0x24911b,'Inbound');})[_0xcf03('0x28')](function(_0x10615c){if(_0x10615c){logger['info']('The\x20Call\x20ID\x20is:',_0x10615c['id']);}})[_0xcf03('0x2b')](function(_0x5f0bb2){logger[_0xcf03('0x2c')](_0xcf03('0x92'),JSON[_0xcf03('0x3c')](_0x5f0bb2));});}; \ No newline at end of file +var _0xf37d=['Answered','rejected','Rejected','abandoned','Abandoned','Call_Start_Time','outbound','agentcalledAt','Call_Type','merge','Fields','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','recordingURL','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','Inbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/downloads?type=uniqueid&token=','destcalleridname','destcalleridnum','The\x20Call\x20ID\x20is:','user:%s','[ABANDONED]','calleridnum','lodash','request-promise','md5','util','./util','ioredis','bluebird','../../../../config/environment','zoho','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','length','type','string','idField','variableName','toString','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','catch','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','findIndex','users','email','Agent\x20found!','profile','Administrator','user','Using\x20the\x20admin\x20account!','error','stringify','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','https://www.zohoapis.','moduleCreate','role','first_name','last_name','code','SUCCESS','details','startCase','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','uri','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Description','Descriptions','enduserType','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','utc','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','complete','connect'];(function(_0x51bfeb,_0x2e4c0c){var _0x14b617=function(_0x11c08a){while(--_0x11c08a){_0x51bfeb['push'](_0x51bfeb['shift']());}};_0x14b617(++_0x2e4c0c);}(_0xf37d,0x160));var _0xdf37=function(_0x261b8a,_0x553ec4){_0x261b8a=_0x261b8a-0x0;var _0x3455e8=_0xf37d[_0x261b8a];return _0x3455e8;};'use strict';var _=require(_0xdf37('0x0'));var rp=require(_0xdf37('0x1'));var md5=require(_0xdf37('0x2'));var util=require(_0xdf37('0x3'));var intUtil=require(_0xdf37('0x4'));var moment=require('moment');var Redis=require(_0xdf37('0x5'));var BPromise=require(_0xdf37('0x6'));var config=require(_0xdf37('0x7'));var logger=require('../../../../config/logger')(_0xdf37('0x8'));config[_0xdf37('0x9')]=_['defaults'](config[_0xdf37('0x9')],{'host':_0xdf37('0xa'),'port':0x18eb});var io=require(_0xdf37('0xb'))(new Redis(config[_0xdf37('0x9')]));function emit(_0x3bb4f5,_0x59c66f,_0x5aa136){io['to'](_0x3bb4f5)[_0xdf37('0xc')](_0x59c66f,_0x5aa136);}function request(_0x58612c){logger[_0xdf37('0xd')](_0xdf37('0xe'),JSON['stringify'](_0x58612c));return rp(_0x58612c);}function getCustomFields(_0x1c1fea,_0x2402e1){var _0x1f8e8b={};if(_0x1c1fea[_0xdf37('0xf')]>0x0){_['forEach'](_0x1c1fea,function(_0x1c89de){if(_0x1c89de[_0xdf37('0x10')]===_0xdf37('0x11')&&_0x1c89de['idField']){_0x1f8e8b[_0x1c89de[_0xdf37('0x12')]]=_0x1c89de['content']['toString']();}else if(_0x1c89de[_0xdf37('0x10')]==='variable'&&_0x1c89de['variableName']&&_0x1c89de[_0xdf37('0x12')]&&_0x2402e1[_0x1c89de[_0xdf37('0x13')]]){_0x1f8e8b[_0x1c89de['idField']]=_0x2402e1[_0x1c89de[_0xdf37('0x13')]][_0xdf37('0x14')]();}else if(_0x1c89de[_0xdf37('0x10')]==='customVariable'&&_0x1c89de[_0xdf37('0x15')]&&_0x1c89de[_0xdf37('0x15')]['name']&&_0x1c89de['idField']&&_0x2402e1[_0x1c89de[_0xdf37('0x15')][_0xdf37('0x16')]['toLowerCase']()]){_0x1f8e8b[_0x1c89de[_0xdf37('0x12')]]=_0x2402e1[_0x1c89de[_0xdf37('0x15')][_0xdf37('0x16')][_0xdf37('0x17')]()]['toString']();}});}return _0x1f8e8b;}function getName(_0x28cadb){if(_0x28cadb[_0xdf37('0x18')]('\x20')>0x0){var _0x1b7c10=_0x28cadb[_0xdf37('0x19')](/ (.+)/);if(_0x1b7c10[0x1]){return _0x1b7c10;}}return[_0x28cadb,_0x28cadb];}var accountsTokens={};function getAccessToken(_0x47c7b8){return new Promise(function(_0x338d86,_0x1d4e3b){if(!_[_0xdf37('0x1a')](accountsTokens[_0x47c7b8['id']])&&!_[_0xdf37('0x1a')](accountsTokens[_0x47c7b8['id']][_0xdf37('0x1b')])){if(moment()[_0xdf37('0x1c')](accountsTokens[_0x47c7b8['id']][_0xdf37('0x1d')])){_0x338d86(accountsTokens[_0x47c7b8['id']]['access_token']);}}var _0x4300b5;switch(_0x47c7b8[_0xdf37('0x1e')]){case'US':_0x4300b5=_0xdf37('0x1f');break;case'AU':_0x4300b5=_0xdf37('0x20');break;case'EU':_0x4300b5='https://accounts.zoho.eu';break;case'IN':_0x4300b5=_0xdf37('0x21');break;case'CN':_0x4300b5=_0xdf37('0x22');break;default:_0x4300b5=_0xdf37('0x23');break;}var _0x4f05d5={'method':_0xdf37('0x24'),'uri':_0x4300b5+_0xdf37('0x25'),'qs':{'refresh_token':_0x47c7b8[_0xdf37('0x26')],'client_id':_0x47c7b8[_0xdf37('0x27')],'client_secret':_0x47c7b8[_0xdf37('0x28')],'grant_type':_0xdf37('0x29')},'json':!![]};return rp(_0x4f05d5)[_0xdf37('0x2a')](function(_0x4ff4ca){accountsTokens[_0x47c7b8['id']]={'access_token':_0x4ff4ca['access_token'],'expires_in':moment()[_0xdf37('0x2b')](_0x4ff4ca[_0xdf37('0x1d')],_0xdf37('0x2c'))};_0x338d86(_0x4ff4ca[_0xdf37('0x1b')]);})[_0xdf37('0x2d')](function(_0x4fb181){logger['error']('Failing\x20creating\x20the\x20access_token',_0x4fb181[_0xdf37('0x2e')]);_0x1d4e3b(_0x4fb181);});});}function getUser(_0x515ef0,_0x5eee57,_0x549f4c,_0x4554e0){logger[_0xdf37('0x2f')](_0xdf37('0x30'));return request({'method':_0xdf37('0x31'),'uri':util[_0xdf37('0x32')](_0xdf37('0x33'),_0x5eee57),'qs':{'type':_0xdf37('0x34')},'headers':{'Authorization':_0xdf37('0x35')+_0x515ef0},'json':!![]})[_0xdf37('0x2a')](function(_0x246bf2){if(_0x246bf2['users']){var _0xf4db49=-0x1;if(_['isArrayLikeObject'](_0x246bf2['users'])){if(!_['isNil'](_0x4554e0)){_0xf4db49=_[_0xdf37('0x36')](_0x246bf2[_0xdf37('0x37')],function(_0x5196de){return _0x5196de[_0xdf37('0x38')]===_0x4554e0;});}if(_0xf4db49>=0x0){logger[_0xdf37('0x2f')](_0xdf37('0x39'));}else{logger['info']('Using\x20the\x20admin\x20account!');_0xf4db49=_[_0xdf37('0x36')](_0x246bf2[_0xdf37('0x37')],function(_0x3c9533){return _0x3c9533[_0xdf37('0x3a')][_0xdf37('0x16')]===_0xdf37('0x3b');});}return _0x246bf2[_0xdf37('0x37')][_0xf4db49];}else{if(_0x246bf2[_0xdf37('0x3c')][_0xdf37('0x3a')][_0xdf37('0x16')]==='Administrator'){logger[_0xdf37('0x2f')](_0xdf37('0x3d'));user=_0x246bf2['user'];return user;}else{logger[_0xdf37('0x3e')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x246bf2));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xdf37('0x3f')](_0x246bf2));}}}else{logger[_0xdf37('0x3e')](_0xdf37('0x40'),JSON['stringify'](_0x246bf2));throw new Error(_0xdf37('0x41')+JSON['stringify'](_0x246bf2));}})[_0xdf37('0x2d')](function(_0x51187d){console[_0xdf37('0x3e')](_0x51187d);});}function getZohoUser(_0x2736af,_0x296603){return new BPromise(function(_0x6c41d4,_0x3327fa){request(_0x2736af)[_0xdf37('0x2a')](function(_0x3f3db5){var _0x2ca130=null;if(_0x3f3db5){_0x2ca130=_0x3f3db5[_0xdf37('0x42')][0x0];_0x2ca130['enduserType']=_0x296603;}_0x6c41d4(_0x2ca130);})['catch'](function(_0x97ea2a){_0x3327fa(_0x97ea2a);});});}function createEndUser(_0xbe11a0,_0x2d5d50,_0x2e276b,_0x17ef53,_0x1fed9c,_0x29adfa){var _0x2e276b=getName(_0x2e276b);return request({'method':'POST','uri':_0xdf37('0x43')+_0x2d5d50+'/crm/v2/'+_['startCase'](_0x29adfa[_0xdf37('0x44')])+'s','body':{'data':[{'Last_Name':_0x2e276b[0x1],'First_Name':_0x2e276b[0x0],'Phone':_0x17ef53,'Owner':{'name':!_[_0xdf37('0x1a')](_0x1fed9c[_0xdf37('0x45')][_0xdf37('0x16')])?_0x1fed9c[_0xdf37('0x45')][_0xdf37('0x16')]:!_[_0xdf37('0x1a')](_0x1fed9c[_0xdf37('0x46')])?_0x1fed9c['first_name']+'\x20'+_0x1fed9c[_0xdf37('0x47')]:_0x1fed9c[_0xdf37('0x47')],'id':_0x1fed9c['id']}}]},'headers':{'Authorization':_0xdf37('0x35')+_0xbe11a0},'json':!![]})[_0xdf37('0x2a')](function(_0xa58969){if(_0xa58969&&_0xa58969[_0xdf37('0x42')][0x0][_0xdf37('0x48')]===_0xdf37('0x49')){var _0x4eebe3=_0xa58969[_0xdf37('0x42')][0x0][_0xdf37('0x4a')];_0x4eebe3['enduserType']=_[_0xdf37('0x4b')](_0x29adfa[_0xdf37('0x44')])+'s';return _0x4eebe3;}logger[_0xdf37('0x3e')](_0xdf37('0x40'),JSON[_0xdf37('0x3f')](data));throw new Error(_0xdf37('0x4c')+JSON[_0xdf37('0x3f')](data));})[_0xdf37('0x2d')](function(_0x797fae){console[_0xdf37('0x4d')](_0xdf37('0x4e'),_0x797fae);});}function getEndUser(_0x5b6b0e,_0x280d1d,_0x1798eb,_0x1cdd03,_0x554afd,_0x27a8be,_0x1f3722){var _0x5886c9={'method':'GET','uri':'','headers':{'Authorization':_0xdf37('0x35')+_0x5b6b0e},'json':!![]};switch(_0x1f3722[_0xdf37('0x4f')]){case _0xdf37('0x50'):_0x5886c9['uri']='https://www.zohoapis.'+_0x280d1d+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x554afd+'))';return getZohoUser(_0x5886c9,_0xdf37('0x51'))[_0xdf37('0x2a')](function(_0x40c521){if(_0x40c521)return _0x40c521;_0x5886c9['uri']=_0xdf37('0x43')+_0x280d1d+_0xdf37('0x52')+_0x554afd+'))';return getZohoUser(_0x5886c9,_0xdf37('0x53'))[_0xdf37('0x2a')](function(_0x5a8013){if(_0x5a8013)return _0x5a8013;if(_0x1f3722['moduleCreate']!=_0xdf37('0x54')){return createEndUser(_0x5b6b0e,_0x280d1d,_0x1cdd03,_0x554afd,_0x27a8be,_0x1f3722);}else{return{};}});});break;case'contact':_0x5886c9[_0xdf37('0x55')]=_0xdf37('0x43')+_0x280d1d+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x554afd+'))';return getZohoUser(_0x5886c9,_0xdf37('0x51'))[_0xdf37('0x2a')](function(_0x140170){if(_0x140170)return _0x140170;if(_0x1f3722['moduleCreate']!=_0xdf37('0x54')){return createEndUser(_0x5b6b0e,_0x280d1d,_0x1cdd03,_0x554afd,_0x27a8be,_0x1f3722);}else{return{};}});break;case _0xdf37('0x56'):_0x5886c9[_0xdf37('0x55')]=_0xdf37('0x43')+_0x280d1d+_0xdf37('0x52')+_0x554afd+'))';return getZohoUser(_0x5886c9,'Leads')[_0xdf37('0x2a')](function(_0x19bdcf){if(_0x19bdcf)return _0x19bdcf;if(_0x1f3722[_0xdf37('0x44')]!=_0xdf37('0x54')){return createEndUser(_0x5b6b0e,_0x280d1d,_0x1cdd03,_0x554afd,_0x27a8be,_0x1f3722);}else{return{};}});break;}}function getCall(_0x5b5940,_0x3d8fff,_0xef0016,_0x28652d,_0x27b256,_0x35c324,_0x45c0c2,_0x46cc8e){logger[_0xdf37('0x2f')](_0xdf37('0x57'));var _0x38feb3={};_0x38feb3[_0xdf37('0x58')]={'name':!_['isNil'](_0x28652d[_0xdf37('0x45')][_0xdf37('0x16')])&&!_[_0xdf37('0x1a')](_0x28652d[_0xdf37('0x3a')][_0xdf37('0x16')])&&_0x28652d['profile'][_0xdf37('0x16')]===_0xdf37('0x59')?_0x28652d['role'][_0xdf37('0x16')]:!_[_0xdf37('0x1a')](_0x28652d['first_name'])?_0x28652d[_0xdf37('0x46')]+'\x20'+_0x28652d[_0xdf37('0x47')]:_0x28652d[_0xdf37('0x47')],'id':_0x28652d['id']};_0x38feb3[_0xdf37('0x5a')]=intUtil[_0xdf37('0x5b')](_0x35c324['Subjects'],_0x45c0c2,'\x20');_0x38feb3[_0xdf37('0x5c')]=intUtil[_0xdf37('0x5b')](_0x35c324[_0xdf37('0x5d')],_0x45c0c2,'\x0a');if(_0x27b256[_0xdf37('0x5e')]===_0xdf37('0x51')){_0x38feb3['Who_Id']={'name':!_[_0xdf37('0x1a')](_0x27b256['Full_Name'])?_0x27b256[_0xdf37('0x5f')]:!_[_0xdf37('0x1a')](_0x27b256[_0xdf37('0x60')])?_0x27b256['First_Name']+'\x20'+_0x27b256[_0xdf37('0x61')]:_0x27b256[_0xdf37('0x61')],'id':_0x27b256['id']};}if(_0x27b256[_0xdf37('0x5e')]===_0xdf37('0x53')){_0x38feb3[_0xdf37('0x62')]={'name':!_['isNil'](_0x27b256[_0xdf37('0x5f')])?_0x27b256[_0xdf37('0x5f')]:!_['isNil'](_0x27b256[_0xdf37('0x60')])?_0x27b256['First_Name']+'\x20'+_0x27b256[_0xdf37('0x61')]:_0x27b256[_0xdf37('0x61')],'id':_0x27b256['id']};_0x38feb3['$se_module']=_[_0xdf37('0x4b')](_0x27b256['enduserType']);}if(_0x45c0c2[_0xdf37('0x63')]){_0x38feb3[_0xdf37('0x64')]=moment[_0xdf37('0x65')](parseInt(_0x45c0c2[_0xdf37('0x63')])*0x3e8)[_0xdf37('0x32')](_0xdf37('0x66'));}else if(_0x45c0c2['answertime']&&_0x45c0c2['endtime']){_0x38feb3[_0xdf37('0x64')]=moment[_0xdf37('0x65')](moment(_0x45c0c2[_0xdf37('0x67')],_0xdf37('0x68'))[_0xdf37('0x69')](moment(_0x45c0c2[_0xdf37('0x6a')],'YYYY-MM-DDTHH:mm:ss')))[_0xdf37('0x32')](_0xdf37('0x66'));}switch(_0x45c0c2[_0xdf37('0x6b')]){case _0xdf37('0x6c'):_0x38feb3[_0xdf37('0x6d')]=_0xdf37('0x6e');break;case _0xdf37('0x6f'):case _0xdf37('0x70'):_0x38feb3[_0xdf37('0x6d')]=_0xdf37('0x71');break;case _0xdf37('0x72'):_0x38feb3['Call_Result']=_0xdf37('0x73');break;case _0xdf37('0x74'):_0x38feb3[_0xdf37('0x6d')]=_0xdf37('0x75');break;default:}_0x38feb3[_0xdf37('0x76')]=(_0x46cc8e===_0xdf37('0x77')?moment(_0x45c0c2[_0xdf37('0x6a')])[_0xdf37('0x32')](_0xdf37('0x68')):moment(_0x45c0c2[_0xdf37('0x78')])[_0xdf37('0x32')](_0xdf37('0x68')))||moment()['format'](_0xdf37('0x68'));_0x38feb3[_0xdf37('0x79')]=_0x46cc8e||'Inbound';_0x38feb3=_[_0xdf37('0x7a')](_0x38feb3,getCustomFields(_0x35c324[_0xdf37('0x7b')],_0x45c0c2));return request({'method':'POST','uri':_0xdf37('0x43')+_0x3d8fff+'/crm/v2/Calls','headers':{'Authorization':_0xdf37('0x35')+_0x5b5940},'body':{'data':[_0x38feb3]},'json':!![]})['then'](function(_0x4b38dd){if(_0x4b38dd&&_0x4b38dd[_0xdf37('0x42')][0x0][_0xdf37('0x48')]===_0xdf37('0x49')){logger[_0xdf37('0x2f')](_0xdf37('0x7c'));return{'id':_0x4b38dd[_0xdf37('0x42')][0x0]['details']['id']};}})[_0xdf37('0x2d')](function(_0x168e05){logger[_0xdf37('0x2f')](_0xdf37('0x7d'),_0x168e05['stack']);console['log'](_0xdf37('0x7d'),_0x168e05);});}exports[_0xdf37('0x7e')]=function(_0x2ec304,_0x1a7056,_0x45fe55,_0x10351a,_0x152c88,_0x1e9ea4){var _0x1e0add,_0x56a9c1,_0x492137;_0x1e9ea4[_0xdf37('0x7f')]=intUtil[_0xdf37('0x80')](_0x1e9ea4[_0xdf37('0x7f')]);_0x1e9ea4[_0xdf37('0x81')]=intUtil[_0xdf37('0x80')](_0x1e9ea4['serverUrl']);if(_0x152c88&&_0x152c88[_0xdf37('0x82')]){logger[_0xdf37('0x2f')](_0xdf37('0x83'),_0xdf37('0x84'));_0x1a7056['recordingURL']=_0x1e9ea4[_0xdf37('0x81')]+_0xdf37('0x85')+_0x1a7056[_0xdf37('0x86')]+'/downloads?type=uniqueid&token='+md5(_0x1a7056[_0xdf37('0x86')]);}else{_0x1a7056[_0xdf37('0x87')]='';}var _0x5a046b=_0x1e9ea4['host']===_0xdf37('0x88')?'eu':_0xdf37('0x89');return getAccessToken(_0x1e9ea4)[_0xdf37('0x2a')](function(_0x2c84b1){_0x492137=_0x2c84b1;return getUser(_0x492137,_0x5a046b,_0x1e9ea4,_0x10351a['email']);})['then'](function(_0x1573ee){_0x1e0add=_0x1573ee;logger[_0xdf37('0x2f')](_0xdf37('0x8a'),_0x1e0add['id']);return getEndUser(_0x492137,_0x5a046b,_0x1e9ea4,_0x1a7056[_0xdf37('0x8b')],_0x1a7056['calleridnum'],_0x1e0add,_0x45fe55);})[_0xdf37('0x2a')](function(_0x39e07a){_0x56a9c1=_0x39e07a;return getCall(_0x492137,_0x5a046b,_0x1e9ea4,_0x1e0add,_0x56a9c1,_0x45fe55,_0x1a7056,_0xdf37('0x8c'));})[_0xdf37('0x2a')](function(_0x34957f){if(_0x34957f){logger[_0xdf37('0x2f')]('The\x20Call\x20ID\x20is:',_0x34957f['id']);logger[_0xdf37('0x2f')]('[QUEUE]',_0xdf37('0x8d'));emit(util[_0xdf37('0x32')]('user:%s',_0x10351a[_0xdf37('0x16')]),_0xdf37('0x8e'),{'uri':_0xdf37('0x8f')+_0x1e9ea4[_0xdf37('0x7f')]+_0xdf37('0x90')+_0x34957f['id']});}})[_0xdf37('0x2d')](function(_0x377d38){logger[_0xdf37('0x3e')]('[QUEUE]',JSON['stringify'](_0x377d38));});};exports['outbound']=function(_0x115e40,_0x2c5390,_0x549aba,_0x58571a,_0x2fff63,_0x311421,_0x580740){var _0x12c312,_0x119040,_0xb2324;_0x311421[_0xdf37('0x7f')]=intUtil[_0xdf37('0x80')](_0x311421['host']);_0x311421['serverUrl']=intUtil['stripTrailingSlash'](_0x311421[_0xdf37('0x81')]);if(_0x580740&&_0x580740[_0xdf37('0x91')]&&_0x580740[_0xdf37('0x91')]!==_0xdf37('0x92')){logger[_0xdf37('0x2f')](_0xdf37('0x93'),_0xdf37('0x84'));_0x2c5390[_0xdf37('0x87')]=_0x311421[_0xdf37('0x81')]+_0xdf37('0x85')+_0x2c5390['uniqueid']+_0xdf37('0x94')+md5(_0x2c5390[_0xdf37('0x86')]);}var _0x407d5e=_0x311421[_0xdf37('0x7f')]===_0xdf37('0x88')?'eu':'com';return getAccessToken(_0x311421)[_0xdf37('0x2a')](function(_0x33a5d6){_0xb2324=_0x33a5d6;return getUser(_0xb2324,_0x407d5e,_0x311421,_0x58571a['email']);})[_0xdf37('0x2a')](function(_0x58902c){_0x12c312=_0x58902c;logger[_0xdf37('0x2f')](_0xdf37('0x8a'),_0x12c312['id']);return getEndUser(_0xb2324,_0x407d5e,_0x311421,_0x2c5390[_0xdf37('0x95')],_0x2c5390[_0xdf37('0x96')],_0x12c312,_0x549aba);})[_0xdf37('0x2a')](function(_0x3cc62d){_0x119040=_0x3cc62d;return getCall(_0xb2324,_0x407d5e,_0x311421,_0x12c312,_0x119040,_0x549aba,_0x2c5390,'Outbound');})['then'](function(_0x289e86){if(_0x289e86){logger[_0xdf37('0x2f')](_0xdf37('0x97'),_0x289e86['id']);logger[_0xdf37('0x2f')]('[OUTBOUND]',_0xdf37('0x8d'));emit(util['format'](_0xdf37('0x98'),_0x58571a[_0xdf37('0x16')]),_0xdf37('0x8e'),{'uri':_0xdf37('0x8f')+_0x311421[_0xdf37('0x7f')]+_0xdf37('0x90')+_0x289e86['id']});}})[_0xdf37('0x2d')](function(_0x1b8b05){logger[_0xdf37('0x3e')](_0xdf37('0x93'),JSON[_0xdf37('0x3f')](_0x1b8b05));});};exports['abandoned']=function(_0x1e30fd,_0x73c8b3,_0x523245,_0x57cf6e,_0x598b7b,_0x48279f){var _0x5f04c3,_0x33f02e,_0x380a11;_0x48279f[_0xdf37('0x7f')]=intUtil['stripTrailingSlash'](_0x48279f['host']);_0x48279f[_0xdf37('0x81')]=intUtil[_0xdf37('0x80')](_0x48279f[_0xdf37('0x81')]);if(_0x598b7b&&_0x598b7b[_0xdf37('0x82')]){logger[_0xdf37('0x2f')](_0xdf37('0x99'),_0xdf37('0x84'));_0x73c8b3['recordingURL']=_0x48279f[_0xdf37('0x81')]+_0xdf37('0x85')+_0x73c8b3[_0xdf37('0x86')]+_0xdf37('0x94')+md5(_0x73c8b3[_0xdf37('0x86')]);}else{_0x73c8b3[_0xdf37('0x87')]='';}var _0x2c969c=_0x48279f[_0xdf37('0x7f')]===_0xdf37('0x88')?'eu':_0xdf37('0x89');return getAccessToken(_0x48279f)['then'](function(_0x12c045){_0x380a11=_0x12c045;return getUser(_0x380a11,_0x2c969c,_0x48279f);})[_0xdf37('0x2a')](function(_0x81f2f7){_0x5f04c3=_0x81f2f7;logger[_0xdf37('0x2f')]('The\x20User\x20ID\x20is:',_0x5f04c3['id']);return getEndUser(_0x380a11,_0x2c969c,_0x48279f,_0x73c8b3[_0xdf37('0x8b')],_0x73c8b3[_0xdf37('0x9a')],_0x5f04c3,_0x523245);})[_0xdf37('0x2a')](function(_0x51775d){_0x33f02e=_0x51775d;return getCall(_0x380a11,_0x2c969c,_0x48279f,_0x5f04c3,_0x33f02e,_0x523245,_0x73c8b3,_0xdf37('0x8c'));})['then'](function(_0x30fa6a){if(_0x30fa6a){logger[_0xdf37('0x2f')](_0xdf37('0x97'),_0x30fa6a['id']);}})[_0xdf37('0x2d')](function(_0x342841){logger[_0xdf37('0x3e')](_0xdf37('0x99'),JSON[_0xdf37('0x3f')](_0x342841));});}; \ 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 856abd2..44aaa21 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(_0x3281e5,_0x458ba3){var _0x302204=function(_0x10315d){while(--_0x10315d){_0x3281e5['push'](_0x3281e5['shift']());}};_0x302204(++_0x458ba3);}(_0x7a54,0x106));var _0x47a5=function(_0x24faa7,_0x1b8d91){_0x24faa7=_0x24faa7-0x0;var _0x1f4678=_0x7a54[_0x24faa7];return _0x1f4678;};'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(_0x10ba13,_0x101c6c){var _0x51c5f=function(_0x26e8b1){while(--_0x26e8b1){_0x10ba13['push'](_0x10ba13['shift']());}};_0x51c5f(++_0x101c6c);}(_0x7a54,0x106));var _0x47a5=function(_0x137bf2,_0x4d78f3){_0x137bf2=_0x137bf2-0x0;var _0x59de7a=_0x7a54[_0x137bf2];return _0x59de7a;};'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 c720af9..a5c4592 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(_0x3a253b,_0x4b2275){var _0x571b02=function(_0x41ef67){while(--_0x41ef67){_0x3a253b['push'](_0x3a253b['shift']());}};_0x571b02(++_0x4b2275);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4dca7c,_0x113ebe){_0x4dca7c=_0x4dca7c-0x0;var _0x1198a7=_0x5f2f[_0x4dca7c];return _0x1198a7;};'use strict';var rp=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var _=require(_0xf5f2('0x2'));var Mustache=require(_0xf5f2('0x3'));var logger=require(_0xf5f2('0x4'))(_0xf5f2('0x5'));exports[_0xf5f2('0x6')]=function(_0x107cf,_0x501fbd){var _0x4854b6,_0x1665c7;var _0x192215={'method':_0x107cf[_0xf5f2('0x7')][_0xf5f2('0x8')](),'uri':Mustache[_0xf5f2('0x9')](_0x107cf[_0xf5f2('0xa')],_0x501fbd),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x107cf['data5'])===_0xf5f2('0xb')&&parseInt(_0x107cf[_0xf5f2('0xc')])>=0x1&&parseInt(_0x107cf[_0xf5f2('0xc')])<=0xa?parseInt(_0x107cf['data5'])*0x3e8:0x5*0x3e8};try{_0x192215[_0xf5f2('0xd')]=_0x107cf[_0xf5f2('0xe')]?JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0xe')],_0x501fbd)):{};}catch(_0x4ebbbe){logger['error'](_0x4ebbbe[_0xf5f2('0x10')]);}switch(_0x107cf[_0xf5f2('0x7')]['toUpperCase']()){case _0xf5f2('0x11'):case _0xf5f2('0x12'):_0x4854b6=null;_0x192215['qs']=_0x501fbd;break;case _0xf5f2('0x13'):case _0xf5f2('0x14'):if(_0x107cf[_0xf5f2('0x15')]){try{_0x4854b6=JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0x15')],_0x501fbd));_0x192215[_0xf5f2('0x16')]=_0x4854b6;}catch(_0x269909){logger[_0xf5f2('0x17')](_0x269909[_0xf5f2('0x10')]);logger['error'](_0xf5f2('0x18'));}}else{_0x4854b6=_0x501fbd;_0x192215[_0xf5f2('0x16')]=_0x4854b6;}break;}logger[_0xf5f2('0x19')](util[_0xf5f2('0x1a')](_0xf5f2('0x1b'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],JSON[_0xf5f2('0x1c')](_0x192215)));rp(_0x192215)[_0xf5f2('0x1d')](function(_0x228ace){_0x4854b6=!_[_0xf5f2('0x1e')](_0x4854b6)?_0xf5f2('0x1f')+_0x4854b6:'';_0x1665c7=typeof _0x228ace[_0xf5f2('0x16')]===_0xf5f2('0x20')?JSON[_0xf5f2('0x1c')](_0x228ace[_0xf5f2('0x16')]):_0x228ace[_0xf5f2('0x16')];logger['info'](util[_0xf5f2('0x1a')](_0xf5f2('0x21'),_0x107cf['data1'],_0x107cf['data2'],_0x228ace[_0xf5f2('0x22')],_0x1665c7));})[_0xf5f2('0x23')](function(_0x4ae323){logger[_0xf5f2('0x17')](util[_0xf5f2('0x1a')](_0xf5f2('0x24'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],_0x4ae323['statusCode'],_0x4ae323[_0xf5f2('0x25')],_0x4ae323[_0xf5f2('0x26')]));});}; \ No newline at end of file +var _0x5f2f=['lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','number','data5','headers','data6','parse','stack','GET','DELETE','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util'];(function(_0x420b6a,_0x318520){var _0x16336b=function(_0x162498){while(--_0x162498){_0x420b6a['push'](_0x420b6a['shift']());}};_0x16336b(++_0x318520);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4ff7d8,_0x40e3d0){_0x4ff7d8=_0x4ff7d8-0x0;var _0x5ab1b1=_0x5f2f[_0x4ff7d8];return _0x5ab1b1;};'use strict';var rp=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var _=require(_0xf5f2('0x2'));var Mustache=require(_0xf5f2('0x3'));var logger=require(_0xf5f2('0x4'))(_0xf5f2('0x5'));exports[_0xf5f2('0x6')]=function(_0x107cf,_0x501fbd){var _0x4854b6,_0x1665c7;var _0x192215={'method':_0x107cf[_0xf5f2('0x7')][_0xf5f2('0x8')](),'uri':Mustache[_0xf5f2('0x9')](_0x107cf[_0xf5f2('0xa')],_0x501fbd),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x107cf['data5'])===_0xf5f2('0xb')&&parseInt(_0x107cf[_0xf5f2('0xc')])>=0x1&&parseInt(_0x107cf[_0xf5f2('0xc')])<=0xa?parseInt(_0x107cf['data5'])*0x3e8:0x5*0x3e8};try{_0x192215[_0xf5f2('0xd')]=_0x107cf[_0xf5f2('0xe')]?JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0xe')],_0x501fbd)):{};}catch(_0x4ebbbe){logger['error'](_0x4ebbbe[_0xf5f2('0x10')]);}switch(_0x107cf[_0xf5f2('0x7')]['toUpperCase']()){case _0xf5f2('0x11'):case _0xf5f2('0x12'):_0x4854b6=null;_0x192215['qs']=_0x501fbd;break;case _0xf5f2('0x13'):case _0xf5f2('0x14'):if(_0x107cf[_0xf5f2('0x15')]){try{_0x4854b6=JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0x15')],_0x501fbd));_0x192215[_0xf5f2('0x16')]=_0x4854b6;}catch(_0x269909){logger[_0xf5f2('0x17')](_0x269909[_0xf5f2('0x10')]);logger['error'](_0xf5f2('0x18'));}}else{_0x4854b6=_0x501fbd;_0x192215[_0xf5f2('0x16')]=_0x4854b6;}break;}logger[_0xf5f2('0x19')](util[_0xf5f2('0x1a')](_0xf5f2('0x1b'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],JSON[_0xf5f2('0x1c')](_0x192215)));rp(_0x192215)[_0xf5f2('0x1d')](function(_0x228ace){_0x4854b6=!_[_0xf5f2('0x1e')](_0x4854b6)?_0xf5f2('0x1f')+_0x4854b6:'';_0x1665c7=typeof _0x228ace[_0xf5f2('0x16')]===_0xf5f2('0x20')?JSON[_0xf5f2('0x1c')](_0x228ace[_0xf5f2('0x16')]):_0x228ace[_0xf5f2('0x16')];logger['info'](util[_0xf5f2('0x1a')](_0xf5f2('0x21'),_0x107cf['data1'],_0x107cf['data2'],_0x228ace[_0xf5f2('0x22')],_0x1665c7));})[_0xf5f2('0x23')](function(_0x4ae323){logger[_0xf5f2('0x17')](util[_0xf5f2('0x1a')](_0xf5f2('0x24'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],_0x4ae323['statusCode'],_0x4ae323[_0xf5f2('0x25')],_0x4ae323[_0xf5f2('0x26')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 0071612..4671dd1 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 _0x2bbb=['exports','bluebird','../../config/logger','routing','http','Request','then','rpc','error','message','result','catch'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x2bbb,0x85));var _0xb2bb=function(_0x1ce653,_0x4e3fe0){_0x1ce653=_0x1ce653-0x0;var _0x47d173=_0x2bbb[_0x1ce653];return _0x47d173;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xb2bb('0x0'));var logger=require(_0xb2bb('0x1'))(_0xb2bb('0x2'));var client=jayson['client'][_0xb2bb('0x3')]({'port':0x2329});client[_0xb2bb('0x4')]=function(_0x14da5e,_0x242b0b){return new BPromise(function(_0x31565a,_0x152ddd){return client['request'](_0x14da5e,_0x242b0b)[_0xb2bb('0x5')](function(_0x5bee47){logger['debug'](_0xb2bb('0x6'),_0xb2bb('0x2'),_0x14da5e,_0x242b0b,_0x5bee47);if(_0x5bee47[_0xb2bb('0x7')]){logger[_0xb2bb('0x7')]('rpc',_0xb2bb('0x2'),_0x14da5e,_0x5bee47['error'][_0xb2bb('0x8')],_0x242b0b);return _0x152ddd(_0x5bee47[_0xb2bb('0x7')][_0xb2bb('0x8')]);}else{return _0x31565a(_0x5bee47[_0xb2bb('0x9')]);}})[_0xb2bb('0xa')](function(_0x574166){logger[_0xb2bb('0x7')]('rpc',_0xb2bb('0x2'),_0x14da5e,_0x574166,_0x242b0b);return _0x152ddd(_0x574166);});});};module[_0xb2bb('0xb')]=client; \ No newline at end of file +var _0xd6d6=['Request','request','debug','rpc','error','message','result','catch','jayson/promise','bluebird','../../config/logger','routing','http'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x1b8992,_0x293a36){_0x1b8992=_0x1b8992-0x0;var _0x1cf761=_0xd6d6[_0x1b8992];return _0x1cf761;};'use strict';var jayson=require(_0x6d6d('0x0'));var BPromise=require(_0x6d6d('0x1'));var logger=require(_0x6d6d('0x2'))(_0x6d6d('0x3'));var client=jayson['client'][_0x6d6d('0x4')]({'port':0x2329});client[_0x6d6d('0x5')]=function(_0x1b8610,_0x2a838a){return new BPromise(function(_0x5207c9,_0x16e259){return client[_0x6d6d('0x6')](_0x1b8610,_0x2a838a)['then'](function(_0x210ff7){logger[_0x6d6d('0x7')](_0x6d6d('0x8'),_0x6d6d('0x3'),_0x1b8610,_0x2a838a,_0x210ff7);if(_0x210ff7[_0x6d6d('0x9')]){logger[_0x6d6d('0x9')](_0x6d6d('0x8'),'routing',_0x1b8610,_0x210ff7['error'][_0x6d6d('0xa')],_0x2a838a);return _0x16e259(_0x210ff7[_0x6d6d('0x9')][_0x6d6d('0xa')]);}else{return _0x5207c9(_0x210ff7[_0x6d6d('0xb')]);}})[_0x6d6d('0xc')](function(_0x576c88){logger[_0x6d6d('0x9')](_0x6d6d('0x8'),'routing',_0x1b8610,_0x576c88,_0x2a838a);return _0x16e259(_0x576c88);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index d59c945..c7f04ac 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 _0x7a2d=['catch','log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','../../mysqldb','resolve','then','initMailAccounts','refresh','listen','Setting','findOne','loginMailFrequency'];(function(_0x220ac9,_0x3dc24a){var _0xf3e712=function(_0x316d3e){while(--_0x316d3e){_0x220ac9['push'](_0x220ac9['shift']());}};_0xf3e712(++_0x3dc24a);}(_0x7a2d,0x142));var _0xd7a2=function(_0x6bb271,_0x9f2ebf){_0x6bb271=_0x6bb271-0x0;var _0x17130c=_0x7a2d[_0x6bb271];return _0x17130c;};'use strict';var BPromise=require(_0xd7a2('0x0'));var server=require(_0xd7a2('0x1'));var Realtime=require(_0xd7a2('0x2'));var EmailChannel=require(_0xd7a2('0x3'));var mailAccount=require(_0xd7a2('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0xd7a2('0x5'))['db'];function initRealtime(){return BPromise[_0xd7a2('0x6')]()['then'](mailAccount['getMailAccounts']())[_0xd7a2('0x7')](realtime[_0xd7a2('0x8')]())[_0xd7a2('0x7')](function(){email[_0xd7a2('0x9')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xd7a2('0xa')](realtime,email)[_0xd7a2('0x7')](function(_0x1e3fc8){return initRealtime();})[_0xd7a2('0x7')](function(_0x1ea591){return db[_0xd7a2('0xb')][_0xd7a2('0xc')]({'attributes':['id',_0xd7a2('0xd')],'raw':!![]});})[_0xd7a2('0x7')](function(_0x503b42){return setInterval(initRealtime,_0x503b42[_0xd7a2('0xd')]*0x3e8);})[_0xd7a2('0xe')](function(_0xe6e4b9){console[_0xd7a2('0xf')](_0xe6e4b9);});}main(); \ No newline at end of file +var _0x600f=['bluebird','./server','./realtime','./rpc/mailAccount','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','Setting','findOne','loginMailFrequency','catch','log'];(function(_0x1e1849,_0x2a0c09){var _0x2706e9=function(_0x203e9e){while(--_0x203e9e){_0x1e1849['push'](_0x1e1849['shift']());}};_0x2706e9(++_0x2a0c09);}(_0x600f,0xb4));var _0xf600=function(_0x699200,_0x39c101){_0x699200=_0x699200-0x0;var _0x266fd1=_0x600f[_0x699200];return _0x266fd1;};'use strict';var BPromise=require(_0xf600('0x0'));var server=require(_0xf600('0x1'));var Realtime=require(_0xf600('0x2'));var EmailChannel=require('./lib/email');var mailAccount=require(_0xf600('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require('../../mysqldb')['db'];function initRealtime(){return BPromise[_0xf600('0x4')]()[_0xf600('0x5')](mailAccount[_0xf600('0x6')]())[_0xf600('0x5')](realtime[_0xf600('0x7')]())[_0xf600('0x5')](function(){email[_0xf600('0x8')](realtime[_0xf600('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xf600('0x5')](function(_0x56f333){return initRealtime();})[_0xf600('0x5')](function(_0x5c96d8){return db[_0xf600('0xa')][_0xf600('0xb')]({'attributes':['id',_0xf600('0xc')],'raw':!![]});})[_0xf600('0x5')](function(_0x585840){return setInterval(initRealtime,_0x585840[_0xf600('0xc')]*0x3e8);})[_0xf600('0xd')](function(_0x430e8e){console[_0xf600('0xe')](_0x430e8e);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 8da3144..90590ee 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 _0x4757=['then','verified','exports','lodash','bluebird','md5','ioredis','../../../config/logger','defaults','redis','localhost','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','prototype','emit','name','key','status','Imap','messageStatus','isNil','mailAccount:update','hasOwnProperty','active','email','box','handleImapBox','bind','handleImapEmail','handleImapEnd','error','handleImapError','connected','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','smtp','send','verifySmtp','Smtp','verify'];(function(_0x2601b4,_0x315e78){var _0x3e3661=function(_0x13b45b){while(--_0x13b45b){_0x2601b4['push'](_0x2601b4['shift']());}};_0x3e3661(++_0x315e78);}(_0x4757,0x9c));var _0x7475=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0x4757[_0x5c4f6b];return _0x104c4e;};'use strict';var _=require(_0x7475('0x0'));var moment=require('moment');var BPromise=require(_0x7475('0x1'));var md5=require(_0x7475('0x2'));var Redis=require(_0x7475('0x3'));var config=require('../../../config/environment');var logger=require(_0x7475('0x4'))('email');config['redis']=_[_0x7475('0x5')](config[_0x7475('0x6')],{'host':_0x7475('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var EmailImap=require(_0x7475('0x8'));var EmailSmtp=require(_0x7475('0x9'));var mailAccount=require(_0x7475('0xa'));var md5Accounts={};function EmailChannel(_0x3b7a63){logger[_0x7475('0xb')]('start\x20email\x20channel');this[_0x7475('0xc')]=_0x3b7a63['mailAccounts'];this[_0x7475('0xd')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x7475('0xe')][_0x7475('0xf')]=function(_0x8a7f10){var _0x13e0ab=this[_0x7475('0xc')][_0x8a7f10];var _0x313360={'id':_0x13e0ab['id'],'name':_0x13e0ab[_0x7475('0x10')],'key':_0x13e0ab[_0x7475('0x11')],'active':_0x13e0ab['active'],'Imap':{'status':_0x13e0ab['Imap'][_0x7475('0x12')],'messageStatus':_0x13e0ab[_0x7475('0x13')][_0x7475('0x14')],'total':_0x13e0ab[_0x7475('0x13')]['total']}};if(_[_0x7475('0x15')](md5Accounts[_0x8a7f10])){md5Accounts[_0x8a7f10]={};}var _0x57f61e=md5(JSON['stringify'](_0x313360));if(md5Accounts[_0x8a7f10][_0x7475('0x2')]!==_0x57f61e){md5Accounts[_0x8a7f10][_0x7475('0x2')]=_0x57f61e;io[_0x7475('0xf')](_0x7475('0x16'),_0x313360);}};EmailChannel[_0x7475('0xe')]['refresh']=function(_0x3c125f){for(var _0x154efa in _0x3c125f){if(_0x3c125f[_0x7475('0x17')](_0x154efa)){if(_0x3c125f[_0x154efa][_0x7475('0x13')]&&_0x3c125f[_0x154efa][_0x7475('0x18')]){var _0xb728e2=_0x3c125f[_0x154efa][_0x7475('0x13')];if(!this[_0x7475('0xd')]['hasOwnProperty'](_0xb728e2['id'])){this[_0x7475('0xd')][_0xb728e2['id']]=new EmailImap(_0xb728e2,_0x3c125f[_0x154efa][_0x7475('0x19')]);this[_0x7475('0xd')][_0xb728e2['id']]['on'](_0x7475('0x1a'),this[_0x7475('0x1b')][_0x7475('0x1c')](this,_0x154efa));this[_0x7475('0xd')][_0xb728e2['id']]['on'](_0x7475('0x19'),this[_0x7475('0x1d')][_0x7475('0x1c')](this,_0x154efa));this[_0x7475('0xd')][_0xb728e2['id']]['on']('end',this[_0x7475('0x1e')][_0x7475('0x1c')](this,_0x154efa));this[_0x7475('0xd')][_0xb728e2['id']]['on'](_0x7475('0x1f'),this[_0x7475('0x20')][_0x7475('0x1c')](this,_0x154efa));}}else{if(_['isNil'](this[_0x7475('0xc')][_0x154efa][_0x7475('0x13')])){this['mailAccounts'][_0x154efa][_0x7475('0x13')]={};}this[_0x7475('0xc')][_0x154efa][_0x7475('0x13')]['status']='disabled';this[_0x7475('0xc')][_0x154efa]['Imap'][_0x7475('0x14')]='';this[_0x7475('0xf')](_0x154efa);}}}};EmailChannel[_0x7475('0xe')][_0x7475('0x1b')]=function(_0x2ff277,_0x2aa818){if(this[_0x7475('0xc')][_0x2ff277]){this[_0x7475('0xc')][_0x2ff277]['Imap'][_0x7475('0x12')]=_0x7475('0x21');this[_0x7475('0xc')][_0x2ff277][_0x7475('0x13')][_0x7475('0x14')]=_0x2aa818[_0x7475('0x10')];if(_0x2aa818[_0x7475('0x22')]){this[_0x7475('0xc')][_0x2ff277][_0x7475('0x13')][_0x7475('0x23')]=_0x2aa818[_0x7475('0x22')]['total'];}return this[_0x7475('0xf')](_0x2ff277);}};EmailChannel['prototype']['handleImapEmail']=function(_0xb7d64d,_0x57b3ed){logger['info'](_0x7475('0x24'),_0x57b3ed['firstName'],_0x57b3ed[_0x7475('0x25')],_0x57b3ed[_0x7475('0x26')],_0xb7d64d);if(this['mailAccounts'][_0xb7d64d]){return mailAccount[_0x7475('0x27')](_0xb7d64d,_0x57b3ed)['then'](function(_0x296224){if(_0x296224){logger[_0x7475('0xb')]('Mail\x20accepted\x20from\x20routing');}})[_0x7475('0x28')](function(_0x3489b0){logger[_0x7475('0x1f')](_0x7475('0x29'),JSON['stringify'](_0x3489b0));});}};EmailChannel['prototype'][_0x7475('0x1e')]=function(_0x207ceb){if(this[_0x7475('0xc')][_0x207ceb]&&this[_0x7475('0xc')][_0x207ceb][_0x7475('0x13')]){if(this[_0x7475('0xd')][this[_0x7475('0xc')][_0x207ceb][_0x7475('0x13')]['id']]){delete this[_0x7475('0xd')][this[_0x7475('0xc')][_0x207ceb][_0x7475('0x13')]['id']];}this[_0x7475('0xc')][_0x207ceb][_0x7475('0x13')][_0x7475('0x2a')]=moment();this[_0x7475('0xf')](_0x207ceb);}};EmailChannel[_0x7475('0xe')]['handleImapError']=function(_0x133b2e,_0x54a532){if(this[_0x7475('0xc')][_0x133b2e]){this[_0x7475('0xc')][_0x133b2e][_0x7475('0x13')][_0x7475('0x12')]='error';this[_0x7475('0xc')][_0x133b2e][_0x7475('0x13')]['messageStatus']=_0x54a532;return this[_0x7475('0xf')](_0x133b2e);}};EmailChannel[_0x7475('0xe')]['sendMail']=function(_0xad9b2d,_0xacd2c6){return this[_0x7475('0x2b')][_0x7475('0x2c')](_0xad9b2d,_0xacd2c6);};EmailChannel['prototype'][_0x7475('0x2d')]=function(_0x596c22){var _0x1bcaeb=this;if(this[_0x7475('0xc')][_0x596c22['id']]){if(_[_0x7475('0x15')](this['mailAccounts'][_0x596c22['id']][_0x7475('0x2e')])){this[_0x7475('0xc')][_0x596c22['id']]['Smtp']={};}this[_0x7475('0xc')][_0x596c22['id']]['Smtp'][_0x7475('0x2a')]=moment();return new BPromise(function(_0x55b473,_0xe3da8a){return _0x1bcaeb[_0x7475('0x2b')][_0x7475('0x2f')](_0x596c22)[_0x7475('0x30')](function(_0x5b39db){_0x1bcaeb['mailAccounts'][_0x596c22['id']][_0x7475('0x2e')][_0x7475('0x12')]=_0x7475('0x31');_0x1bcaeb[_0x7475('0xc')][_0x596c22['id']]['Smtp'][_0x7475('0x14')]='';_0x1bcaeb[_0x7475('0xf')](_0x596c22['id']);_0x55b473(_0x5b39db);})['catch'](function(_0x3dcc3c){_0x1bcaeb[_0x7475('0xc')][_0x596c22['id']][_0x7475('0x2e')][_0x7475('0x12')]='error';_0x1bcaeb[_0x7475('0xc')][_0x596c22['id']][_0x7475('0x2e')][_0x7475('0x14')]=_0x3dcc3c;_0x1bcaeb['emit'](_0x596c22['id']);_0xe3da8a(_0x3dcc3c);});});}return this[_0x7475('0x2b')][_0x7475('0x2f')](_0x596c22);};module[_0x7475('0x32')]=EmailChannel; \ No newline at end of file +var _0x7efd=['box','handleImapBox','bind','handleImapEmail','end','error','handleImapError','messageStatus','messages','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','handleImapEnd','lastSync','send','verifySmtp','Smtp','verify','exports','bluebird','md5','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','total','isNil','mailAccount:update','hasOwnProperty'];(function(_0x54ab1f,_0x1585d6){var _0x24c869=function(_0x5e8ce0){while(--_0x5e8ce0){_0x54ab1f['push'](_0x54ab1f['shift']());}};_0x24c869(++_0x1585d6);}(_0x7efd,0xab));var _0xd7ef=function(_0x41b840,_0x1a3baf){_0x41b840=_0x41b840-0x0;var _0x2a0adf=_0x7efd[_0x41b840];return _0x2a0adf;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0xd7ef('0x0'));var md5=require(_0xd7ef('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xd7ef('0x2'))(_0xd7ef('0x3'));config[_0xd7ef('0x4')]=_[_0xd7ef('0x5')](config[_0xd7ef('0x4')],{'host':_0xd7ef('0x6'),'port':0x18eb});var io=require(_0xd7ef('0x7'))(new Redis(config[_0xd7ef('0x4')]));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require(_0xd7ef('0x8'));var md5Accounts={};function EmailChannel(_0x1ea4d5){logger[_0xd7ef('0x9')](_0xd7ef('0xa'));this['mailAccounts']=_0x1ea4d5[_0xd7ef('0xb')];this[_0xd7ef('0xc')]={};this[_0xd7ef('0xd')]=new EmailSmtp();}EmailChannel[_0xd7ef('0xe')][_0xd7ef('0xf')]=function(_0x2d3e9c){var _0x3c8cce=this['mailAccounts'][_0x2d3e9c];var _0x1c8c4b={'id':_0x3c8cce['id'],'name':_0x3c8cce[_0xd7ef('0x10')],'key':_0x3c8cce[_0xd7ef('0x11')],'active':_0x3c8cce[_0xd7ef('0x12')],'Imap':{'status':_0x3c8cce[_0xd7ef('0x13')][_0xd7ef('0x14')],'messageStatus':_0x3c8cce[_0xd7ef('0x13')]['messageStatus'],'total':_0x3c8cce[_0xd7ef('0x13')][_0xd7ef('0x15')]}};if(_[_0xd7ef('0x16')](md5Accounts[_0x2d3e9c])){md5Accounts[_0x2d3e9c]={};}var _0x5414bd=md5(JSON['stringify'](_0x1c8c4b));if(md5Accounts[_0x2d3e9c][_0xd7ef('0x1')]!==_0x5414bd){md5Accounts[_0x2d3e9c][_0xd7ef('0x1')]=_0x5414bd;io['emit'](_0xd7ef('0x17'),_0x1c8c4b);}};EmailChannel[_0xd7ef('0xe')]['refresh']=function(_0xedb577){for(var _0xccfdb9 in _0xedb577){if(_0xedb577['hasOwnProperty'](_0xccfdb9)){if(_0xedb577[_0xccfdb9][_0xd7ef('0x13')]&&_0xedb577[_0xccfdb9]['active']){var _0x4d67d2=_0xedb577[_0xccfdb9][_0xd7ef('0x13')];if(!this[_0xd7ef('0xc')][_0xd7ef('0x18')](_0x4d67d2['id'])){this[_0xd7ef('0xc')][_0x4d67d2['id']]=new EmailImap(_0x4d67d2,_0xedb577[_0xccfdb9]['email']);this[_0xd7ef('0xc')][_0x4d67d2['id']]['on'](_0xd7ef('0x19'),this[_0xd7ef('0x1a')][_0xd7ef('0x1b')](this,_0xccfdb9));this[_0xd7ef('0xc')][_0x4d67d2['id']]['on'](_0xd7ef('0x3'),this[_0xd7ef('0x1c')]['bind'](this,_0xccfdb9));this[_0xd7ef('0xc')][_0x4d67d2['id']]['on'](_0xd7ef('0x1d'),this['handleImapEnd']['bind'](this,_0xccfdb9));this[_0xd7ef('0xc')][_0x4d67d2['id']]['on'](_0xd7ef('0x1e'),this[_0xd7ef('0x1f')][_0xd7ef('0x1b')](this,_0xccfdb9));}}else{if(_['isNil'](this['mailAccounts'][_0xccfdb9][_0xd7ef('0x13')])){this[_0xd7ef('0xb')][_0xccfdb9][_0xd7ef('0x13')]={};}this[_0xd7ef('0xb')][_0xccfdb9][_0xd7ef('0x13')][_0xd7ef('0x14')]='disabled';this[_0xd7ef('0xb')][_0xccfdb9]['Imap']['messageStatus']='';this[_0xd7ef('0xf')](_0xccfdb9);}}}};EmailChannel['prototype'][_0xd7ef('0x1a')]=function(_0x32d521,_0x43f928){if(this['mailAccounts'][_0x32d521]){this[_0xd7ef('0xb')][_0x32d521][_0xd7ef('0x13')][_0xd7ef('0x14')]='connected';this[_0xd7ef('0xb')][_0x32d521][_0xd7ef('0x13')][_0xd7ef('0x20')]=_0x43f928[_0xd7ef('0x10')];if(_0x43f928['messages']){this['mailAccounts'][_0x32d521][_0xd7ef('0x13')][_0xd7ef('0x15')]=_0x43f928[_0xd7ef('0x21')][_0xd7ef('0x15')];}return this[_0xd7ef('0xf')](_0x32d521);}};EmailChannel['prototype'][_0xd7ef('0x1c')]=function(_0x5046a4,_0x2550ab){logger[_0xd7ef('0x9')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x2550ab[_0xd7ef('0x22')],_0x2550ab[_0xd7ef('0x23')],_0x2550ab['from'],_0x5046a4);if(this['mailAccounts'][_0x5046a4]){return mailAccount[_0xd7ef('0x24')](_0x5046a4,_0x2550ab)[_0xd7ef('0x25')](function(_0x17fb7a){if(_0x17fb7a){logger[_0xd7ef('0x9')](_0xd7ef('0x26'));}})[_0xd7ef('0x27')](function(_0x98a3ec){logger[_0xd7ef('0x1e')](_0xd7ef('0x28'),JSON[_0xd7ef('0x29')](_0x98a3ec));});}};EmailChannel['prototype'][_0xd7ef('0x2a')]=function(_0x569e4e){if(this[_0xd7ef('0xb')][_0x569e4e]&&this[_0xd7ef('0xb')][_0x569e4e][_0xd7ef('0x13')]){if(this[_0xd7ef('0xc')][this[_0xd7ef('0xb')][_0x569e4e][_0xd7ef('0x13')]['id']]){delete this[_0xd7ef('0xc')][this[_0xd7ef('0xb')][_0x569e4e][_0xd7ef('0x13')]['id']];}this[_0xd7ef('0xb')][_0x569e4e]['Imap'][_0xd7ef('0x2b')]=moment();this[_0xd7ef('0xf')](_0x569e4e);}};EmailChannel[_0xd7ef('0xe')][_0xd7ef('0x1f')]=function(_0x4fca64,_0x523110){if(this[_0xd7ef('0xb')][_0x4fca64]){this[_0xd7ef('0xb')][_0x4fca64][_0xd7ef('0x13')][_0xd7ef('0x14')]='error';this['mailAccounts'][_0x4fca64]['Imap']['messageStatus']=_0x523110;return this[_0xd7ef('0xf')](_0x4fca64);}};EmailChannel['prototype']['sendMail']=function(_0x454ef7,_0x4c12e5){return this[_0xd7ef('0xd')][_0xd7ef('0x2c')](_0x454ef7,_0x4c12e5);};EmailChannel[_0xd7ef('0xe')][_0xd7ef('0x2d')]=function(_0x2e3918){var _0x25e528=this;if(this[_0xd7ef('0xb')][_0x2e3918['id']]){if(_[_0xd7ef('0x16')](this['mailAccounts'][_0x2e3918['id']][_0xd7ef('0x2e')])){this['mailAccounts'][_0x2e3918['id']]['Smtp']={};}this[_0xd7ef('0xb')][_0x2e3918['id']][_0xd7ef('0x2e')][_0xd7ef('0x2b')]=moment();return new BPromise(function(_0x2050d5,_0x46086b){return _0x25e528[_0xd7ef('0xd')][_0xd7ef('0x2f')](_0x2e3918)['then'](function(_0x169fc3){_0x25e528['mailAccounts'][_0x2e3918['id']][_0xd7ef('0x2e')][_0xd7ef('0x14')]='verified';_0x25e528['mailAccounts'][_0x2e3918['id']]['Smtp'][_0xd7ef('0x20')]='';_0x25e528[_0xd7ef('0xf')](_0x2e3918['id']);_0x2050d5(_0x169fc3);})['catch'](function(_0x2b8b17){_0x25e528[_0xd7ef('0xb')][_0x2e3918['id']][_0xd7ef('0x2e')][_0xd7ef('0x14')]=_0xd7ef('0x1e');_0x25e528['mailAccounts'][_0x2e3918['id']][_0xd7ef('0x2e')][_0xd7ef('0x20')]=_0x2b8b17;_0x25e528['emit'](_0x2e3918['id']);_0x46086b(_0x2b8b17);});});}return this['smtp']['verify'](_0x2e3918);};module[_0xd7ef('0x30')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index c6614cf..5a9391e 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 _0x9ba5=['randomstring','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','getAccount','account','once','ready','handleReady','bind','end','handleEnd','error','connect','inherits','connTimeout','authTimeout','authentication','user','password','host','port','tls','autotls','required','getHost','service','prototype','openBox','handleError','emit','box','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchEnd','handleCloseBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','closeBox','stringify','textCode','hasOwnProperty','exports','path','util','imap','lodash'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x9ba5,0x146));var _0x59ba=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x9ba5[_0x2261ce];return _0x524640;};'use strict';var fs=require('fs');var path=require(_0x59ba('0x0'));var util=require(_0x59ba('0x1'));var Imap=require(_0x59ba('0x2'));var _=require(_0x59ba('0x3'));var rs=require(_0x59ba('0x4'));var simpleParser=require(_0x59ba('0x5'))[_0x59ba('0x6')];var Iconv=require(_0x59ba('0x7'))[_0x59ba('0x8')];var EventEmitter=require(_0x59ba('0x9'))[_0x59ba('0xa')];var utils=require(_0x59ba('0xb'));var logger=require(_0x59ba('0xc'))(_0x59ba('0xd'));function EmailImap(_0x2c6289,_0x423888){this[_0x59ba('0xe')]=_0x59ba('0xf');this['account']=this[_0x59ba('0x10')](_0x2c6289,_0x423888);this[_0x59ba('0x2')]=new Imap(this[_0x59ba('0x11')]);this[_0x59ba('0x2')][_0x59ba('0x12')](_0x59ba('0x13'),this[_0x59ba('0x14')][_0x59ba('0x15')](this));this[_0x59ba('0x2')][_0x59ba('0x12')](_0x59ba('0x16'),this[_0x59ba('0x17')][_0x59ba('0x15')](this));this[_0x59ba('0x2')]['on'](_0x59ba('0x18'),this['handleError'][_0x59ba('0x15')](this));this[_0x59ba('0x2')][_0x59ba('0x19')]();}util[_0x59ba('0x1a')](EmailImap,EventEmitter);EmailImap['prototype'][_0x59ba('0x10')]=function(_0x57a5bb,_0x583c55){var _0x6a1cf0={'connTimeout':_0x57a5bb[_0x59ba('0x1b')]?_0x57a5bb['connTimeout']*0x3e8:0x2710,'authTimeout':_0x57a5bb[_0x59ba('0x1c')]?_0x57a5bb[_0x59ba('0x1c')]*0x3e8:0x1388};if(_['isNil'](_0x57a5bb['service'])){if(_0x57a5bb[_0x59ba('0x1d')]){_0x6a1cf0['user']=_0x57a5bb[_0x59ba('0x1e')];_0x6a1cf0[_0x59ba('0x1f')]=_0x57a5bb[_0x59ba('0x1f')];}_0x6a1cf0[_0x59ba('0x20')]=_0x57a5bb[_0x59ba('0x20')];_0x6a1cf0[_0x59ba('0x21')]=_0x57a5bb['port']||0x3e1;if(_0x57a5bb[_0x59ba('0x22')]){_0x6a1cf0[_0x59ba('0x22')]=!![];}else{_0x6a1cf0[_0x59ba('0x22')]=![];_0x6a1cf0[_0x59ba('0x23')]=_0x59ba('0x24');}}else{_0x6a1cf0[_0x59ba('0x1e')]=_0x57a5bb[_0x59ba('0x1e')];_0x6a1cf0[_0x59ba('0x1f')]=_0x57a5bb[_0x59ba('0x1f')];_0x6a1cf0[_0x59ba('0x20')]=utils[_0x59ba('0x25')](_0x57a5bb[_0x59ba('0x26')]);_0x6a1cf0[_0x59ba('0x21')]=0x3e1;_0x6a1cf0[_0x59ba('0x22')]=!![];}_0x6a1cf0['email']=_0x583c55||_0x57a5bb[_0x59ba('0x1e')]||'anonymous@xcally.com';return _0x6a1cf0;};EmailImap[_0x59ba('0x27')][_0x59ba('0x14')]=function(){this[_0x59ba('0x2')][_0x59ba('0x28')](this[_0x59ba('0xe')],![],this['handleOpenBox'][_0x59ba('0x15')](this));};EmailImap[_0x59ba('0x27')]['handleOpenBox']=function(_0x24970e,_0x2d7b1f){if(_0x24970e){this[_0x59ba('0x29')](_0x24970e,!![]);}else{this[_0x59ba('0x2a')](_0x59ba('0x2b'),_0x2d7b1f);this[_0x59ba('0x2c')]();}};EmailImap[_0x59ba('0x27')]['handleCloseBox']=function(_0xe84481){if(_0xe84481){this[_0x59ba('0x29')](_0xe84481,!![]);}else{this[_0x59ba('0x2')][_0x59ba('0x16')]();}};EmailImap['prototype'][_0x59ba('0x2c')]=function(){this[_0x59ba('0x2')][_0x59ba('0x2d')]([_0x59ba('0x2e')],this[_0x59ba('0x2f')][_0x59ba('0x15')](this));};EmailImap[_0x59ba('0x27')][_0x59ba('0x2f')]=function(_0x5de4da,_0x5274f0){if(_0x5de4da){this[_0x59ba('0x29')](_0x5de4da,!![]);}else{if(_0x5274f0[_0x59ba('0x30')]){try{var _0x347ef8=this[_0x59ba('0x2')][_0x59ba('0x31')](_0x5274f0,{'bodies':'','markSeen':!![]});_0x347ef8['on'](_0x59ba('0x32'),this[_0x59ba('0x33')][_0x59ba('0x15')](this));_0x347ef8['once']('error',this['handleFetchError'][_0x59ba('0x15')](this));_0x347ef8[_0x59ba('0x12')](_0x59ba('0x16'),this[_0x59ba('0x34')][_0x59ba('0x15')](this));}catch(_0x4925aa){logger[_0x59ba('0x18')](_0x4925aa);}}else{this[_0x59ba('0x2')]['closeBox'](!![],this[_0x59ba('0x35')][_0x59ba('0x15')](this));}}};EmailImap[_0x59ba('0x27')][_0x59ba('0x33')]=function(_0xdfb7fe,_0x11d4c1){_0xdfb7fe['on'](_0x59ba('0x36'),this[_0x59ba('0x37')][_0x59ba('0x15')](this));_0xdfb7fe[_0x59ba('0x12')](_0x59ba('0x38'),this[_0x59ba('0x39')][_0x59ba('0x15')](this));_0xdfb7fe['once']('end',this[_0x59ba('0x3a')][_0x59ba('0x15')](this));};EmailImap[_0x59ba('0x27')][_0x59ba('0x37')]=function(_0x51c6b7,_0xafbf2d){simpleParser(_0x51c6b7,{'Iconv':Iconv},this[_0x59ba('0x3b')][_0x59ba('0x15')](this));};EmailImap[_0x59ba('0x27')][_0x59ba('0x39')]=function(_0x12352e){};EmailImap[_0x59ba('0x27')][_0x59ba('0x3a')]=function(){};EmailImap[_0x59ba('0x27')][_0x59ba('0x3b')]=function(_0x2ef0cc,_0x8f3cc9){if(_0x2ef0cc){logger[_0x59ba('0x18')](_0x2ef0cc);}else{var _0xf11bac=this;utils[_0x59ba('0x3c')](this[_0x59ba('0x11')],_0x8f3cc9,function(_0x3a85c8){_0xf11bac['emit']('email',_0x3a85c8);});}};EmailImap[_0x59ba('0x27')][_0x59ba('0x34')]=function(){this[_0x59ba('0x2')]['closeBox'](!![],this[_0x59ba('0x35')][_0x59ba('0x15')](this));};EmailImap[_0x59ba('0x27')]['handleFetchError']=function(_0x587866){this[_0x59ba('0x29')](_0x587866);this[_0x59ba('0x2')][_0x59ba('0x3d')](!![],this[_0x59ba('0x35')][_0x59ba('0x15')](this));};EmailImap[_0x59ba('0x27')][_0x59ba('0x17')]=function(){this[_0x59ba('0x2a')](_0x59ba('0x16'));};EmailImap[_0x59ba('0x27')][_0x59ba('0x29')]=function(_0x1516bc,_0x1e2a97){logger[_0x59ba('0x18')]('handleError',this[_0x59ba('0x11')][_0x59ba('0xd')],JSON[_0x59ba('0x3e')](_0x1516bc));var _0x44451e='';if(_0x1516bc){if(_0x1516bc[_0x59ba('0x3f')]){_0x44451e=_0x1516bc[_0x59ba('0x3f')];}else{for(var _0x47676e in _0x1516bc){if(_0x1516bc[_0x59ba('0x40')](_0x47676e)){_0x44451e+=_['upperFirst'](_0x47676e)+':\x20'+_0x1516bc[_0x47676e]+'\x0a';}}}}if(_0x1e2a97){this[_0x59ba('0x2')]['end']();}else{this[_0x59ba('0x2a')]('error',_0x44451e);this['emit']('end');}};module[_0x59ba('0x41')]=EmailImap; \ No newline at end of file +var _0xc5d3=['end','handleEnd','error','handleError','connect','inherits','connTimeout','authTimeout','isNil','user','password','host','port','tls','autotls','required','getHost','service','anonymous@xcally.com','prototype','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','lodash','randomstring','mailparser','simpleParser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','imap','once','ready','handleReady','bind'];(function(_0x24f75d,_0x573345){var _0x354fb8=function(_0x42c048){while(--_0x42c048){_0x24f75d['push'](_0x24f75d['shift']());}};_0x354fb8(++_0x573345);}(_0xc5d3,0xf7));var _0x3c5d=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xc5d3[_0x4b2436];return _0x4f5ab2;};'use strict';var fs=require('fs');var path=require(_0x3c5d('0x0'));var util=require(_0x3c5d('0x1'));var Imap=require('imap');var _=require(_0x3c5d('0x2'));var rs=require(_0x3c5d('0x3'));var simpleParser=require(_0x3c5d('0x4'))[_0x3c5d('0x5')];var Iconv=require(_0x3c5d('0x6'))[_0x3c5d('0x7')];var EventEmitter=require('events')[_0x3c5d('0x8')];var utils=require(_0x3c5d('0x9'));var logger=require(_0x3c5d('0xa'))(_0x3c5d('0xb'));function EmailImap(_0x123596,_0x517fbc){this[_0x3c5d('0xc')]=_0x3c5d('0xd');this[_0x3c5d('0xe')]=this[_0x3c5d('0xf')](_0x123596,_0x517fbc);this[_0x3c5d('0x10')]=new Imap(this['account']);this['imap'][_0x3c5d('0x11')](_0x3c5d('0x12'),this[_0x3c5d('0x13')][_0x3c5d('0x14')](this));this[_0x3c5d('0x10')][_0x3c5d('0x11')](_0x3c5d('0x15'),this[_0x3c5d('0x16')][_0x3c5d('0x14')](this));this['imap']['on'](_0x3c5d('0x17'),this[_0x3c5d('0x18')]['bind'](this));this['imap'][_0x3c5d('0x19')]();}util[_0x3c5d('0x1a')](EmailImap,EventEmitter);EmailImap['prototype'][_0x3c5d('0xf')]=function(_0x4a6b95,_0x4d7f35){var _0x5e926a={'connTimeout':_0x4a6b95[_0x3c5d('0x1b')]?_0x4a6b95[_0x3c5d('0x1b')]*0x3e8:0x2710,'authTimeout':_0x4a6b95['authTimeout']?_0x4a6b95[_0x3c5d('0x1c')]*0x3e8:0x1388};if(_[_0x3c5d('0x1d')](_0x4a6b95['service'])){if(_0x4a6b95['authentication']){_0x5e926a['user']=_0x4a6b95[_0x3c5d('0x1e')];_0x5e926a[_0x3c5d('0x1f')]=_0x4a6b95[_0x3c5d('0x1f')];}_0x5e926a['host']=_0x4a6b95[_0x3c5d('0x20')];_0x5e926a['port']=_0x4a6b95[_0x3c5d('0x21')]||0x3e1;if(_0x4a6b95[_0x3c5d('0x22')]){_0x5e926a[_0x3c5d('0x22')]=!![];}else{_0x5e926a[_0x3c5d('0x22')]=![];_0x5e926a[_0x3c5d('0x23')]=_0x3c5d('0x24');}}else{_0x5e926a['user']=_0x4a6b95['user'];_0x5e926a['password']=_0x4a6b95[_0x3c5d('0x1f')];_0x5e926a[_0x3c5d('0x20')]=utils[_0x3c5d('0x25')](_0x4a6b95[_0x3c5d('0x26')]);_0x5e926a[_0x3c5d('0x21')]=0x3e1;_0x5e926a[_0x3c5d('0x22')]=!![];}_0x5e926a[_0x3c5d('0xb')]=_0x4d7f35||_0x4a6b95[_0x3c5d('0x1e')]||_0x3c5d('0x27');return _0x5e926a;};EmailImap[_0x3c5d('0x28')][_0x3c5d('0x13')]=function(){this[_0x3c5d('0x10')][_0x3c5d('0x29')](this[_0x3c5d('0xc')],![],this[_0x3c5d('0x2a')][_0x3c5d('0x14')](this));};EmailImap['prototype']['handleOpenBox']=function(_0x306acd,_0x14264c){if(_0x306acd){this[_0x3c5d('0x18')](_0x306acd,!![]);}else{this[_0x3c5d('0x2b')](_0x3c5d('0x2c'),_0x14264c);this[_0x3c5d('0x2d')]();}};EmailImap[_0x3c5d('0x28')][_0x3c5d('0x2e')]=function(_0x46868c){if(_0x46868c){this[_0x3c5d('0x18')](_0x46868c,!![]);}else{this[_0x3c5d('0x10')][_0x3c5d('0x15')]();}};EmailImap['prototype'][_0x3c5d('0x2d')]=function(){this[_0x3c5d('0x10')][_0x3c5d('0x2f')]([_0x3c5d('0x30')],this[_0x3c5d('0x31')][_0x3c5d('0x14')](this));};EmailImap[_0x3c5d('0x28')]['handleReadUnseen']=function(_0x5174c5,_0x29eee2){if(_0x5174c5){this[_0x3c5d('0x18')](_0x5174c5,!![]);}else{if(_0x29eee2['length']){try{var _0xe2b5a0=this[_0x3c5d('0x10')][_0x3c5d('0x32')](_0x29eee2,{'bodies':'','markSeen':!![]});_0xe2b5a0['on'](_0x3c5d('0x33'),this[_0x3c5d('0x34')]['bind'](this));_0xe2b5a0['once'](_0x3c5d('0x17'),this[_0x3c5d('0x35')][_0x3c5d('0x14')](this));_0xe2b5a0[_0x3c5d('0x11')]('end',this[_0x3c5d('0x36')][_0x3c5d('0x14')](this));}catch(_0x4551e7){logger['error'](_0x4551e7);}}else{this[_0x3c5d('0x10')][_0x3c5d('0x37')](!![],this[_0x3c5d('0x2e')][_0x3c5d('0x14')](this));}}};EmailImap[_0x3c5d('0x28')]['handleFetchMessage']=function(_0x1e4dc2,_0x23153d){_0x1e4dc2['on'](_0x3c5d('0x38'),this[_0x3c5d('0x39')][_0x3c5d('0x14')](this));_0x1e4dc2[_0x3c5d('0x11')]('attributes',this[_0x3c5d('0x3a')]['bind'](this));_0x1e4dc2[_0x3c5d('0x11')]('end',this[_0x3c5d('0x3b')]['bind'](this));};EmailImap['prototype'][_0x3c5d('0x39')]=function(_0x2ba709,_0xd815bd){simpleParser(_0x2ba709,{'Iconv':Iconv},this[_0x3c5d('0x3c')]['bind'](this));};EmailImap['prototype']['handleMessageAttributes']=function(_0x33f8e2){};EmailImap['prototype'][_0x3c5d('0x3b')]=function(){};EmailImap['prototype'][_0x3c5d('0x3c')]=function(_0x308d0b,_0x567a2f){if(_0x308d0b){logger[_0x3c5d('0x17')](_0x308d0b);}else{var _0x19daab=this;utils[_0x3c5d('0x3d')](this[_0x3c5d('0xe')],_0x567a2f,function(_0x4182a9){_0x19daab[_0x3c5d('0x2b')](_0x3c5d('0xb'),_0x4182a9);});}};EmailImap[_0x3c5d('0x28')][_0x3c5d('0x36')]=function(){this['imap']['closeBox'](!![],this[_0x3c5d('0x2e')][_0x3c5d('0x14')](this));};EmailImap[_0x3c5d('0x28')]['handleFetchError']=function(_0x7ffe81){this[_0x3c5d('0x18')](_0x7ffe81);this['imap'][_0x3c5d('0x37')](!![],this[_0x3c5d('0x2e')][_0x3c5d('0x14')](this));};EmailImap[_0x3c5d('0x28')]['handleEnd']=function(){this['emit'](_0x3c5d('0x15'));};EmailImap[_0x3c5d('0x28')][_0x3c5d('0x18')]=function(_0x1a477a,_0x3e5723){logger[_0x3c5d('0x17')](_0x3c5d('0x18'),this['account']['email'],JSON[_0x3c5d('0x3e')](_0x1a477a));var _0x2559e4='';if(_0x1a477a){if(_0x1a477a[_0x3c5d('0x3f')]){_0x2559e4=_0x1a477a[_0x3c5d('0x3f')];}else{for(var _0x3bc8e6 in _0x1a477a){if(_0x1a477a[_0x3c5d('0x40')](_0x3bc8e6)){_0x2559e4+=_[_0x3c5d('0x41')](_0x3bc8e6)+':\x20'+_0x1a477a[_0x3bc8e6]+'\x0a';}}}}if(_0x3e5723){this[_0x3c5d('0x10')][_0x3c5d('0x15')]();}else{this[_0x3c5d('0x2b')]('error',_0x2559e4);this[_0x3c5d('0x2b')](_0x3c5d('0x15'));}};module[_0x3c5d('0x42')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index f34e600..8bbc138 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 _0xe289=['toString','verify','nodemailer','bluebird','prototype','send','createTransport','use','compile','sendMail'];(function(_0x577519,_0x346daf){var _0x5b12f7=function(_0x4aecb6){while(--_0x4aecb6){_0x577519['push'](_0x577519['shift']());}};_0x5b12f7(++_0x346daf);}(_0xe289,0x156));var _0x9e28=function(_0x1b2a4c,_0x5e55be){_0x1b2a4c=_0x1b2a4c-0x0;var _0x395fb7=_0xe289[_0x1b2a4c];return _0x395fb7;};'use strict';var nodemailer=require(_0x9e28('0x0'));var BPromise=require(_0x9e28('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x9e28('0x2')][_0x9e28('0x3')]=function(_0x244934,_0x4fe702){return new BPromise(function(_0x1838fd,_0x403011){var _0x1530c2=nodemailer[_0x9e28('0x4')](_0x244934);_0x1530c2[_0x9e28('0x5')](_0x9e28('0x6'),inlineBase64());_0x1530c2[_0x9e28('0x7')](_0x4fe702,function(_0x3b44c1,_0x4712fd){if(_0x3b44c1){_0x403011(_0x3b44c1[_0x9e28('0x8')]());}else{_0x1838fd(_0x4712fd);}});});};EmailSmtp['prototype'][_0x9e28('0x9')]=function(_0x1b3389){return new BPromise(function(_0x393d1d,_0xf23f69){var _0xf62b0e=nodemailer[_0x9e28('0x4')](_0x1b3389);_0xf62b0e[_0x9e28('0x9')](function(_0x8421e7,_0x43098c){if(_0x8421e7){_0xf23f69(_0x8421e7[_0x9e28('0x8')]());}else{if(_0x43098c){_0x393d1d(_0x43098c);}else{_0xf23f69('Not\x20verifired');}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0xc790=['nodemailer-plugin-inline-base64','prototype','createTransport','use','compile','sendMail','toString','verify','nodemailer','bluebird'];(function(_0x4d5a18,_0x3e87bf){var _0x2f749b=function(_0x31226d){while(--_0x31226d){_0x4d5a18['push'](_0x4d5a18['shift']());}};_0x2f749b(++_0x3e87bf);}(_0xc790,0x94));var _0x0c79=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xc790[_0x40220a];return _0x3903cc;};'use strict';var nodemailer=require(_0x0c79('0x0'));var BPromise=require(_0x0c79('0x1'));var inlineBase64=require(_0x0c79('0x2'));function EmailSmtp(){}EmailSmtp[_0x0c79('0x3')]['send']=function(_0x5e9289,_0x1c0851){return new BPromise(function(_0x2c19c4,_0x48fa23){var _0x1d47f4=nodemailer[_0x0c79('0x4')](_0x5e9289);_0x1d47f4[_0x0c79('0x5')](_0x0c79('0x6'),inlineBase64());_0x1d47f4[_0x0c79('0x7')](_0x1c0851,function(_0xb1920f,_0x29166){if(_0xb1920f){_0x48fa23(_0xb1920f[_0x0c79('0x8')]());}else{_0x2c19c4(_0x29166);}});});};EmailSmtp['prototype'][_0x0c79('0x9')]=function(_0x291b5e){return new BPromise(function(_0x1acdd1,_0x3f334b){var _0x37be87=nodemailer[_0x0c79('0x4')](_0x291b5e);_0x37be87[_0x0c79('0x9')](function(_0x522912,_0x35be0a){if(_0x522912){_0x3f334b(_0x522912[_0x0c79('0x8')]());}else{if(_0x35be0a){_0x1acdd1(_0x35be0a);}else{_0x3f334b('Not\x20verifired');}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 359e88d..fd009fc 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 _0x28db=['includes','originTo','bcc','attach','attachments','type','attachment','filename','format','now','root','server/files/attachments/','contentType','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','content','

Empty\x20message

','Attachments','push','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','@xcally.com','name','slice','join','Anonymous','split','length','isEmpty','generate','html','test','replace','body','textAsHtml','0x1?_0x39d28e['pop']():'';}return'';}function getMails(_0x2fbf10,_0x15dfc1){var _0x53902d='';for(var _0x1cac37=0x0;_0x1cac37<_0x15dfc1[_0xb28d('0xa')]['length'];_0x1cac37+=0x1){if(_0x15dfc1[_0xb28d('0xa')][_0x1cac37]['address']!==_0x2fbf10){if(!_[_0xb28d('0x14')](_0x53902d)){_0x53902d+=',';}_0x53902d+=_0x15dfc1['value'][_0x1cac37][_0xb28d('0xe')]||_0x15dfc1[_0xb28d('0xa')][_0x1cac37][_0xb28d('0xb')]||'';_0x53902d+='\x20<';_0x53902d+=_0x15dfc1[_0xb28d('0xa')][_0x1cac37][_0xb28d('0xb')]?_0x15dfc1[_0xb28d('0xa')][_0x1cac37][_0xb28d('0xb')]:_0xb28d('0xc')+random[_0xb28d('0x15')](0x6)+_0xb28d('0xd');_0x53902d+='>';}}return _0x53902d;}function parseEmail(_0x3ae9c0,_0x18771a,_0x20ba72){if(_0x18771a[_0xb28d('0x16')]){var _0x4c8414=/)<[^<]*)*<\/script>/gi;while(_0x4c8414[_0xb28d('0x17')](_0x18771a[_0xb28d('0x16')])){_0x18771a['html']=_0x18771a['html'][_0xb28d('0x18')](_0x4c8414,'');}_0x20ba72[_0xb28d('0x19')]=_0x18771a[_0xb28d('0x16')];}else{_0x20ba72[_0xb28d('0x19')]=_0x18771a[_0xb28d('0x1a')];}if(_0x20ba72[_0xb28d('0x19')]){_0x20ba72[_0xb28d('0x19')]=_0x20ba72[_0xb28d('0x19')]['replace'](/Empty\x20message

','Attachments','push','Data','getHost','gmail','hotmail','imap-mail.outlook.com','outlook365','127.0.0.1','lodash','moment','randomstring','util','../../../config/logger','email','../../../config/environment','head','value','address','generate','@xcally.com','name'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x2cea,0xfb));var _0xa2ce=function(_0x5cbfed,_0x2b8ba5){_0x5cbfed=_0x5cbfed-0x0;var _0x462d98=_0x2cea[_0x5cbfed];return _0x462d98;};'use strict';var _=require(_0xa2ce('0x0'));var moment=require(_0xa2ce('0x1'));var random=require(_0xa2ce('0x2'));var fs=require('fs');var path=require('path');var util=require(_0xa2ce('0x3'));var tnef=require('node-tnef');var logger=require(_0xa2ce('0x4'))(_0xa2ce('0x5'));var config=require(_0xa2ce('0x6'));function getAddress(_0x2ba4b2){var _0x2d2f13=_[_0xa2ce('0x7')](_0x2ba4b2[_0xa2ce('0x8')]);return _0x2d2f13&&_0x2d2f13[_0xa2ce('0x9')]?_0x2d2f13[_0xa2ce('0x9')]:'anonymous'+random[_0xa2ce('0xa')](0x6)+_0xa2ce('0xb');}function getFirstName(_0x29f8b9){var _0x256e53=_['head'](_0x29f8b9[_0xa2ce('0x8')]);if(_0x256e53&&_0x256e53[_0xa2ce('0xc')]){var _0x11df2c=_0x256e53[_0xa2ce('0xc')][_0xa2ce('0xd')](/\s+/);return _0x11df2c[_0xa2ce('0xe')]?_0x11df2c[_0xa2ce('0xf')](0x0,-0x1)[_0xa2ce('0x10')]('\x20'):_0x256e53[_0xa2ce('0xc')];}return _0xa2ce('0x11');}function getLastName(_0x4290f3){var _0x8dd64=_[_0xa2ce('0x7')](_0x4290f3[_0xa2ce('0x8')]);if(_0x8dd64&&_0x8dd64[_0xa2ce('0xc')]){var _0x7aee46=_0x8dd64[_0xa2ce('0xc')][_0xa2ce('0xd')](/\s+/);return _0x7aee46['length']>0x1?_0x7aee46['pop']():'';}return'';}function getMails(_0x12c674,_0x186db6){var _0x1391d1='';for(var _0x501bf2=0x0;_0x501bf2<_0x186db6['value'][_0xa2ce('0xe')];_0x501bf2+=0x1){if(_0x186db6[_0xa2ce('0x8')][_0x501bf2]['address']!==_0x12c674){if(!_[_0xa2ce('0x12')](_0x1391d1)){_0x1391d1+=',';}_0x1391d1+=_0x186db6[_0xa2ce('0x8')][_0x501bf2][_0xa2ce('0xc')]||_0x186db6[_0xa2ce('0x8')][_0x501bf2][_0xa2ce('0x9')]||'';_0x1391d1+='\x20<';_0x1391d1+=_0x186db6[_0xa2ce('0x8')][_0x501bf2][_0xa2ce('0x9')]?_0x186db6[_0xa2ce('0x8')][_0x501bf2][_0xa2ce('0x9')]:_0xa2ce('0x13')+random[_0xa2ce('0xa')](0x6)+'@xcally.com';_0x1391d1+='>';}}return _0x1391d1;}function parseEmail(_0xa51356,_0x4bb148,_0x26bbcc){if(_0x4bb148['html']){var _0x437a06=/)<[^<]*)*<\/script>/gi;while(_0x437a06[_0xa2ce('0x14')](_0x4bb148[_0xa2ce('0x15')])){_0x4bb148[_0xa2ce('0x15')]=_0x4bb148[_0xa2ce('0x15')][_0xa2ce('0x16')](_0x437a06,'');}_0x26bbcc[_0xa2ce('0x17')]=_0x4bb148[_0xa2ce('0x15')];}else{_0x26bbcc[_0xa2ce('0x17')]=_0x4bb148['textAsHtml'];}if(_0x26bbcc[_0xa2ce('0x17')]){_0x26bbcc[_0xa2ce('0x17')]=_0x26bbcc[_0xa2ce('0x17')][_0xa2ce('0x16')](/0x0){if(this[_0xde347f+'Capacity']>0x0&&this[_0xde347f+_0xef45('0x20')]>=this[_0xde347f+_0xef45('0x21')]){return _0xef45('0x22');}else{return _0xef45('0x23');}}else{return _0xef45('0x24');}};Agent['prototype'][_0xef45('0x1d')]=function(){var _0x54a75d=['mail',_0xef45('0x25'),_0xef45('0x26'),_0xef45('0x27'),_0xef45('0x28')];for(var _0x839eff=0x0;_0x839eff<_0x54a75d[_0xef45('0x29')];_0x839eff+=0x1){var _0x315777=this['getChannelStatus'](_0x54a75d[_0x839eff]);if(this[_0x54a75d[_0x839eff]+_0xef45('0x2a')]!==_0x315777){this[_0x54a75d[_0x839eff]+'StatusTime']=_[_0xef45('0x2b')](moment()[_0xef45('0x2c')]('x'));}this[_0x54a75d[_0x839eff]+'Status']=_0x315777;}var _0x46e423={'id':this['id'],'name':this[_0xef45('0x7')],'online':this['online'],'voicePause':this[_0xef45('0x9')],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this[_0xef45('0xe')],'chatStatus':this[_0xef45('0xf')],'chatStatusTime':this[_0xef45('0x2d')],'chatCapacity':this[_0xef45('0x11')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xef45('0x13')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xef45('0x14')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xef45('0x15')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xef45('0x17')],'smsStatus':this[_0xef45('0x2e')],'smsStatusTime':this[_0xef45('0x18')],'smsCapacity':this[_0xef45('0x19')],'smsCurrentCapacity':this[_0xef45('0x2f')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xef45('0x30')],'busy':this[_0xef45('0x31')],'busyQueue':this[_0xef45('0x1c')]};var _0x3039b0=md5(JSON[_0xef45('0x32')](_0x46e423));if(this[_0xef45('0x1')]!==_0x3039b0){this[_0xef45('0x1')]=_0x3039b0;io['emit']('user:save',_0x46e423);}};module[_0xef45('0x33')]=Agent; \ No newline at end of file +var _0xf109=['md5','defaults','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','working','updateRealtime','chat','openchannel','fax','length','Status','StatusTime','toNumber','format','mailStatusTime','faxStatusTime','smsStatusTime','smsCurrentCapacity','openchannelStatusTime','busy','stringify','emit','user:save','lodash','moment'];(function(_0x24c924,_0xef941a){var _0xa59c61=function(_0x2fe91c){while(--_0x2fe91c){_0x24c924['push'](_0x24c924['shift']());}};_0xa59c61(++_0xef941a);}(_0xf109,0xce));var _0x9f10=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0xf109[_0x56916d];return _0x2b7f1f;};'use strict';var _=require(_0x9f10('0x0'));var moment=require(_0x9f10('0x1'));var md5=require(_0x9f10('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0x9f10('0x3')](config[_0x9f10('0x4')],{'host':_0x9f10('0x5'),'port':0x18eb});var io=require(_0x9f10('0x6'))(new Redis(config[_0x9f10('0x4')]));function Agent(_0x3e30c0){this['id']=_0x3e30c0['id']||0x0;this[_0x9f10('0x7')]=_0x3e30c0[_0x9f10('0x7')]||'';this[_0x9f10('0x8')]=_0x3e30c0[_0x9f10('0x8')]||!![];this[_0x9f10('0x9')]=_0x3e30c0['voicePause']||![];this[_0x9f10('0xa')]=_0x3e30c0[_0x9f10('0xa')]||![];this[_0x9f10('0xb')]=_0x3e30c0[_0x9f10('0xb')]||![];this[_0x9f10('0xc')]=_0x3e30c0['faxPause']||![];this[_0x9f10('0xd')]=_0x3e30c0[_0x9f10('0xd')]||![];this[_0x9f10('0xe')]=_0x3e30c0['openchannelPause']||![];this['chatStatus']=_0x9f10('0xf');this[_0x9f10('0x10')]=0x0;this[_0x9f10('0x11')]=_0x3e30c0['chatCapacity']||0x0;this[_0x9f10('0x12')]=0x0;this[_0x9f10('0x13')]=_0x9f10('0xf');this['mailStatusTime']=0x0;this[_0x9f10('0x14')]=_0x3e30c0[_0x9f10('0x14')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x9f10('0x15')]=_0x9f10('0xf');this['faxStatusTime']=0x0;this['faxCapacity']=_0x3e30c0[_0x9f10('0x16')]||0x0;this[_0x9f10('0x17')]=0x0;this['smsStatus']=_0x9f10('0xf');this['smsStatusTime']=0x0;this[_0x9f10('0x18')]=_0x3e30c0[_0x9f10('0x18')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x9f10('0x19')]=_0x9f10('0xf');this['openchannelStatusTime']=0x0;this[_0x9f10('0x1a')]=_0x3e30c0['openchannelCapacity']||0x0;this[_0x9f10('0x1b')]=0x0;this['busy']=![];this[_0x9f10('0x1c')]=undefined;this['md5']='';this['updateRealtime']();}Agent[_0x9f10('0x1d')][_0x9f10('0x1e')]=function(_0x25f870){if(this[_0x25f870+_0x9f10('0x1f')]>0x0){if(this[_0x25f870+_0x9f10('0x20')]>0x0&&this[_0x25f870+_0x9f10('0x1f')]>=this[_0x25f870+_0x9f10('0x20')]){return'maxcapacity';}else{return _0x9f10('0x21');}}else{return'idle';}};Agent[_0x9f10('0x1d')][_0x9f10('0x22')]=function(){var _0x3d25cb=['mail',_0x9f10('0x23'),_0x9f10('0x24'),_0x9f10('0x25'),'sms'];for(var _0x36821e=0x0;_0x36821e<_0x3d25cb[_0x9f10('0x26')];_0x36821e+=0x1){var _0x44b99d=this['getChannelStatus'](_0x3d25cb[_0x36821e]);if(this[_0x3d25cb[_0x36821e]+_0x9f10('0x27')]!==_0x44b99d){this[_0x3d25cb[_0x36821e]+_0x9f10('0x28')]=_[_0x9f10('0x29')](moment()[_0x9f10('0x2a')]('x'));}this[_0x3d25cb[_0x36821e]+'Status']=_0x44b99d;}var _0x57539b={'id':this['id'],'name':this['name'],'online':this[_0x9f10('0x8')],'voicePause':this['voicePause'],'chatPause':this[_0x9f10('0xa')],'mailPause':this[_0x9f10('0xb')],'smsPause':this[_0x9f10('0xd')],'faxPause':this[_0x9f10('0xc')],'openchannelPause':this[_0x9f10('0xe')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x9f10('0x10')],'chatCapacity':this[_0x9f10('0x11')],'chatCurrentCapacity':this[_0x9f10('0x12')],'mailStatus':this[_0x9f10('0x13')],'mailStatusTime':this[_0x9f10('0x2b')],'mailCapacity':this[_0x9f10('0x14')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x9f10('0x15')],'faxStatusTime':this[_0x9f10('0x2c')],'faxCapacity':this[_0x9f10('0x16')],'faxCurrentCapacity':this[_0x9f10('0x17')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x9f10('0x2d')],'smsCapacity':this[_0x9f10('0x18')],'smsCurrentCapacity':this[_0x9f10('0x2e')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x9f10('0x2f')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x9f10('0x1b')],'busy':this[_0x9f10('0x30')],'busyQueue':this[_0x9f10('0x1c')]};var _0x5944e5=md5(JSON[_0x9f10('0x31')](_0x57539b));if(this[_0x9f10('0x2')]!==_0x5944e5){this[_0x9f10('0x2')]=_0x5944e5;io[_0x9f10('0x32')](_0x9f10('0x33'),_0x57539b);}};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 e2ce659..5e81b09 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 _0x5a6a=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','loggedIn','length','online','available','paused','format','chat:queue:%s','emit','exports','lodash','md5','util','ioredis'];(function(_0x5da83e,_0x243590){var _0x7de022=function(_0xd1e3b2){while(--_0xd1e3b2){_0x5da83e['push'](_0x5da83e['shift']());}};_0x7de022(++_0x243590);}(_0x5a6a,0x83));var _0xa5a6=function(_0x58abc8,_0x440ea0){_0x58abc8=_0x58abc8-0x0;var _0x23c7de=_0x5a6a[_0x58abc8];return _0x23c7de;};'use strict';var _=require(_0xa5a6('0x0'));var md5=require(_0xa5a6('0x1'));var util=require(_0xa5a6('0x2'));var Redis=require(_0xa5a6('0x3'));var config=require(_0xa5a6('0x4'));config['redis']=_['defaults'](config[_0xa5a6('0x5')],{'host':_0xa5a6('0x6'),'port':0x18eb});var io=require(_0xa5a6('0x7'))(new Redis(config[_0xa5a6('0x5')]));function ChatQueue(_0x2331b0){this['id']=_0x2331b0['id']||0x0;this[_0xa5a6('0x8')]=_0x2331b0['name']||'';this[_0xa5a6('0x9')]=_0x2331b0[_0xa5a6('0x9')]||0xa;this[_0xa5a6('0xa')]=_0x2331b0[_0xa5a6('0xa')]||'beepall';this[_0xa5a6('0xb')]=_0x2331b0[_0xa5a6('0xb')];this[_0xa5a6('0xc')]={};this[_0xa5a6('0xd')]=0x0;this[_0xa5a6('0x1')]='';this['updateRouting']();this[_0xa5a6('0xe')]();}ChatQueue[_0xa5a6('0xf')][_0xa5a6('0x10')]=function(){var _0x32ba94=this[_0xa5a6('0xc')][_0xa5a6('0x11')];this[_0xa5a6('0xc')]=_['map'](this[_0xa5a6('0xb')],'id');this['mapAgentsId'][_0xa5a6('0x11')]=_0x32ba94;};ChatQueue[_0xa5a6('0xf')]['updateRealtime']=function(){this[_0xa5a6('0x12')]=0x0;this['paused']=0x0;for(var _0x43e036=0x0;_0x43e036=0x0?this[_0xa5a6('0x15')]:0x0;var _0x2b79ad={'id':this['id'],'available':this[_0xa5a6('0x15')],'loggedIn':this[_0xa5a6('0x12')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xa5a6('0xd')]};var _0x401db7=md5(JSON['stringify'](_0x2b79ad));if(this[_0xa5a6('0x1')]!==_0x401db7){this[_0xa5a6('0x1')]=_0x401db7;io['to'](util[_0xa5a6('0x17')](_0xa5a6('0x18'),_0x2b79ad[_0xa5a6('0x8')]))[_0xa5a6('0x19')]('chat_queue:save',_0x2b79ad);}};module[_0xa5a6('0x1a')]=ChatQueue; \ No newline at end of file +var _0x6a88=['exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','updateRouting','_rr','map','prototype','loggedIn','paused','length','chatPause','available','waiting','stringify','chat:queue:%s','emit','chat_queue:save'];(function(_0x30abff,_0x5f2c5f){var _0x4c571e=function(_0x43de9a){while(--_0x43de9a){_0x30abff['push'](_0x30abff['shift']());}};_0x4c571e(++_0x5f2c5f);}(_0x6a88,0x106));var _0x86a8=function(_0x489fa0,_0x1cfab){_0x489fa0=_0x489fa0-0x0;var _0x4d5fe4=_0x6a88[_0x489fa0];return _0x4d5fe4;};'use strict';var _=require(_0x86a8('0x0'));var md5=require(_0x86a8('0x1'));var util=require(_0x86a8('0x2'));var Redis=require(_0x86a8('0x3'));var config=require(_0x86a8('0x4'));config[_0x86a8('0x5')]=_['defaults'](config[_0x86a8('0x5')],{'host':_0x86a8('0x6'),'port':0x18eb});var io=require(_0x86a8('0x7'))(new Redis(config[_0x86a8('0x5')]));function ChatQueue(_0x12e4d3){this['id']=_0x12e4d3['id']||0x0;this['name']=_0x12e4d3['name']||'';this[_0x86a8('0x8')]=_0x12e4d3['timeout']||0xa;this['strategy']=_0x12e4d3[_0x86a8('0x9')]||_0x86a8('0xa');this[_0x86a8('0xb')]=_0x12e4d3['Agents'];this[_0x86a8('0xc')]={};this['waiting']=0x0;this[_0x86a8('0x1')]='';this['updateRouting']();this[_0x86a8('0xd')]();}ChatQueue['prototype'][_0x86a8('0xe')]=function(){var _0x48c7dd=this[_0x86a8('0xc')][_0x86a8('0xf')];this[_0x86a8('0xc')]=_[_0x86a8('0x10')](this['Agents'],'id');this[_0x86a8('0xc')][_0x86a8('0xf')]=_0x48c7dd;};ChatQueue[_0x86a8('0x11')][_0x86a8('0xd')]=function(){this[_0x86a8('0x12')]=0x0;this[_0x86a8('0x13')]=0x0;for(var _0x24120f=0x0;_0x24120f=0x0?this[_0x86a8('0x16')]:0x0;var _0xd59d38={'id':this['id'],'available':this[_0x86a8('0x16')],'loggedIn':this[_0x86a8('0x12')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x86a8('0x17')]};var _0x165c22=md5(JSON[_0x86a8('0x18')](_0xd59d38));if(this[_0x86a8('0x1')]!==_0x165c22){this[_0x86a8('0x1')]=_0x165c22;io['to'](util['format'](_0x86a8('0x19'),_0xd59d38['name']))[_0x86a8('0x1a')](_0x86a8('0x1b'),_0xd59d38);}};module[_0x86a8('0x1c')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index b374d7d..6ad1d0f 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(_0xc2f6df,_0x3d8598){var _0x5b427b=function(_0x26bdb7){while(--_0x26bdb7){_0xc2f6df['push'](_0xc2f6df['shift']());}};_0x5b427b(++_0x3d8598);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0x166a8a,_0x577aa4){var _0x5b950c=function(_0x5082cd){while(--_0x5082cd){_0x166a8a['push'](_0x166a8a['shift']());}};_0x5b950c(++_0x577aa4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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 43231b7..9c8da9e 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 _0x2375=['Intervals','exports','name'];(function(_0x336e64,_0x27778d){var _0x3ccf12=function(_0x3091d7){while(--_0x3091d7){_0x336e64['push'](_0x336e64['shift']());}};_0x3ccf12(++_0x27778d);}(_0x2375,0x77));var _0x5237=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x2375[_0xefd519];return _0x4bb882;};'use strict';function Interval(_0x596438){this['id']=_0x596438['id']||0x0;this[_0x5237('0x0')]=_0x596438[_0x5237('0x0')]||'';this['Intervals']=_0x596438[_0x5237('0x1')]||{};}module[_0x5237('0x2')]=Interval; \ No newline at end of file +var _0xe96f=['Intervals','exports','name'];(function(_0x1b41f2,_0x3477f0){var _0xa9401f=function(_0x375ffd){while(--_0x375ffd){_0x1b41f2['push'](_0x1b41f2['shift']());}};_0xa9401f(++_0x3477f0);}(_0xe96f,0x158));var _0xfe96=function(_0x26f485,_0x562ed0){_0x26f485=_0x26f485-0x0;var _0x2615e8=_0xe96f[_0x26f485];return _0x2615e8;};'use strict';function Interval(_0x51684f){this['id']=_0x51684f['id']||0x0;this[_0xfe96('0x0')]=_0x51684f[_0xfe96('0x0')]||'';this[_0xfe96('0x1')]=_0x51684f[_0xfe96('0x1')]||{};}module[_0xfe96('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 a79aa0c..c67f480 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 _0x973f=['defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis'];(function(_0x5d0c95,_0x232739){var _0x474940=function(_0x11554e){while(--_0x11554e){_0x5d0c95['push'](_0x5d0c95['shift']());}};_0x474940(++_0x232739);}(_0x973f,0x18d));var _0xf973=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x973f[_0x4c440b];return _0x2d48cf;};'use strict';var _=require(_0xf973('0x0'));var md5=require(_0xf973('0x1'));var util=require(_0xf973('0x2'));var Redis=require(_0xf973('0x3'));var config=require(_0xf973('0x4'));config[_0xf973('0x5')]=_[_0xf973('0x6')](config['redis'],{'host':_0xf973('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf973('0x5')]));function MailQueue(_0x3faef4){this['id']=_0x3faef4['id']||0x0;this[_0xf973('0x8')]=_0x3faef4[_0xf973('0x8')]||'';this['timeout']=_0x3faef4[_0xf973('0x9')]||0xa;this[_0xf973('0xa')]=_0x3faef4[_0xf973('0xa')]||_0xf973('0xb');this[_0xf973('0xc')]=_0x3faef4['Agents'];this[_0xf973('0xd')]={};this[_0xf973('0xe')]=0x0;this[_0xf973('0x1')]='';this[_0xf973('0xf')]();this[_0xf973('0x10')]();}MailQueue[_0xf973('0x11')]['updateRouting']=function(){var _0x120986=this[_0xf973('0xd')][_0xf973('0x12')];this[_0xf973('0xd')]=_[_0xf973('0x13')](this[_0xf973('0xc')],'id');this[_0xf973('0xd')][_0xf973('0x12')]=_0x120986;};MailQueue['prototype'][_0xf973('0x10')]=function(){this[_0xf973('0x14')]=0x0;this[_0xf973('0x15')]=0x0;for(var _0x1da223=0x0;_0x1da223=0x0?this[_0xf973('0x18')]:0x0;var _0x423247={'id':this['id'],'available':this['available'],'loggedIn':this[_0xf973('0x14')],'name':this[_0xf973('0x8')],'paused':this[_0xf973('0x15')],'waiting':this['waiting']};var _0x258c41=md5(JSON[_0xf973('0x19')](_0x423247));if(this[_0xf973('0x1')]!==_0x258c41){this[_0xf973('0x1')]=_0x258c41;io['to'](util[_0xf973('0x1a')](_0xf973('0x1b'),_0x423247['name']))[_0xf973('0x1c')](_0xf973('0x1d'),_0x423247);}};module[_0xf973('0x1e')]=MailQueue; \ No newline at end of file +var _0x6ee5=['exports','lodash','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','mailPause','available','format','mail:queue:%s','mail_queue:save'];(function(_0x31654d,_0x23ed8f){var _0x57e1c9=function(_0x4e338b){while(--_0x4e338b){_0x31654d['push'](_0x31654d['shift']());}};_0x57e1c9(++_0x23ed8f);}(_0x6ee5,0x92));var _0x56ee=function(_0x21488b,_0x1188ef){_0x21488b=_0x21488b-0x0;var _0x4378ee=_0x6ee5[_0x21488b];return _0x4378ee;};'use strict';var _=require(_0x56ee('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x56ee('0x1'));var config=require(_0x56ee('0x2'));config[_0x56ee('0x3')]=_['defaults'](config[_0x56ee('0x3')],{'host':_0x56ee('0x4'),'port':0x18eb});var io=require(_0x56ee('0x5'))(new Redis(config[_0x56ee('0x3')]));function MailQueue(_0x5b07d6){this['id']=_0x5b07d6['id']||0x0;this[_0x56ee('0x6')]=_0x5b07d6[_0x56ee('0x6')]||'';this['timeout']=_0x5b07d6[_0x56ee('0x7')]||0xa;this['strategy']=_0x5b07d6[_0x56ee('0x8')]||_0x56ee('0x9');this[_0x56ee('0xa')]=_0x5b07d6[_0x56ee('0xa')];this[_0x56ee('0xb')]={};this[_0x56ee('0xc')]=0x0;this[_0x56ee('0xd')]='';this[_0x56ee('0xe')]();this[_0x56ee('0xf')]();}MailQueue[_0x56ee('0x10')][_0x56ee('0xe')]=function(){var _0x55956e=this[_0x56ee('0xb')][_0x56ee('0x11')];this['mapAgentsId']=_[_0x56ee('0x12')](this['Agents'],'id');this['mapAgentsId'][_0x56ee('0x11')]=_0x55956e;};MailQueue['prototype'][_0x56ee('0xf')]=function(){this[_0x56ee('0x13')]=0x0;this[_0x56ee('0x14')]=0x0;for(var _0x5e717e=0x0;_0x5e717e=0x0?this[_0x56ee('0x18')]:0x0;var _0x357b5e={'id':this['id'],'available':this['available'],'loggedIn':this[_0x56ee('0x13')],'name':this[_0x56ee('0x6')],'paused':this[_0x56ee('0x14')],'waiting':this[_0x56ee('0xc')]};var _0x20266b=md5(JSON['stringify'](_0x357b5e));if(this[_0x56ee('0xd')]!==_0x20266b){this['md5']=_0x20266b;io['to'](util[_0x56ee('0x19')](_0x56ee('0x1a'),_0x357b5e[_0x56ee('0x6')]))['emit'](_0x56ee('0x1b'),_0x357b5e);}};module[_0x56ee('0x1c')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 5bbbec2..4e7b8a8 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 _0x0e90=['openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','length','online','openchannelPause','paused','available','stringify','format','openchannel:queue:%s','emit'];(function(_0x18fb16,_0x45edbc){var _0x147b0d=function(_0x5b1b00){while(--_0x5b1b00){_0x18fb16['push'](_0x18fb16['shift']());}};_0x147b0d(++_0x45edbc);}(_0x0e90,0xc2));var _0x00e9=function(_0x55db61,_0x42d5a9){_0x55db61=_0x55db61-0x0;var _0x1b4c51=_0x0e90[_0x55db61];return _0x1b4c51;};'use strict';var _=require(_0x00e9('0x0'));var md5=require(_0x00e9('0x1'));var util=require(_0x00e9('0x2'));var Redis=require(_0x00e9('0x3'));var config=require(_0x00e9('0x4'));config[_0x00e9('0x5')]=_[_0x00e9('0x6')](config[_0x00e9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x00e9('0x7'))(new Redis(config[_0x00e9('0x5')]));function OpenchannelQueue(_0x283bca){this['id']=_0x283bca['id']||0x0;this['name']=_0x283bca[_0x00e9('0x8')]||'';this[_0x00e9('0x9')]=_0x283bca[_0x00e9('0x9')]||0xa;this['strategy']=_0x283bca[_0x00e9('0xa')]||_0x00e9('0xb');this[_0x00e9('0xc')]=_0x283bca[_0x00e9('0xc')];this[_0x00e9('0xd')]={};this[_0x00e9('0xe')]=0x0;this[_0x00e9('0x1')]='';this[_0x00e9('0xf')]();this[_0x00e9('0x10')]();}OpenchannelQueue['prototype'][_0x00e9('0xf')]=function(){var _0x5398f1=this['mapAgentsId'][_0x00e9('0x11')];this['mapAgentsId']=_[_0x00e9('0x12')](this['Agents'],'id');this['mapAgentsId'][_0x00e9('0x11')]=_0x5398f1;};OpenchannelQueue[_0x00e9('0x13')]['updateRealtime']=function(){this[_0x00e9('0x14')]=0x0;this['paused']=0x0;for(var _0x4e9696=0x0;_0x4e9696=0x0?this[_0x00e9('0x19')]:0x0;var _0x5791f2={'id':this['id'],'available':this['available'],'loggedIn':this[_0x00e9('0x14')],'name':this[_0x00e9('0x8')],'paused':this['paused'],'waiting':this['waiting']};var _0x31507a=md5(JSON[_0x00e9('0x1a')](_0x5791f2));if(this[_0x00e9('0x1')]!==_0x31507a){this['md5']=_0x31507a;io['to'](util[_0x00e9('0x1b')](_0x00e9('0x1c'),_0x5791f2[_0x00e9('0x8')]))[_0x00e9('0x1d')](_0x00e9('0x1e'),_0x5791f2);}};module[_0x00e9('0x1f')]=OpenchannelQueue; \ No newline at end of file +var _0xea5e=['openchannel:queue:%s','emit','openchannel_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRouting','prototype','_rr','map','loggedIn','paused','length','available','stringify','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xea5e,0x126));var _0xeea5=function(_0x1bb85a,_0x11013d){_0x1bb85a=_0x1bb85a-0x0;var _0x228eff=_0xea5e[_0x1bb85a];return _0x228eff;};'use strict';var _=require(_0xeea5('0x0'));var md5=require('md5');var util=require(_0xeea5('0x1'));var Redis=require(_0xeea5('0x2'));var config=require(_0xeea5('0x3'));config[_0xeea5('0x4')]=_[_0xeea5('0x5')](config[_0xeea5('0x4')],{'host':_0xeea5('0x6'),'port':0x18eb});var io=require(_0xeea5('0x7'))(new Redis(config[_0xeea5('0x4')]));function OpenchannelQueue(_0x85b50b){this['id']=_0x85b50b['id']||0x0;this[_0xeea5('0x8')]=_0x85b50b[_0xeea5('0x8')]||'';this[_0xeea5('0x9')]=_0x85b50b[_0xeea5('0x9')]||0xa;this[_0xeea5('0xa')]=_0x85b50b[_0xeea5('0xa')]||_0xeea5('0xb');this[_0xeea5('0xc')]=_0x85b50b['Agents'];this[_0xeea5('0xd')]={};this['waiting']=0x0;this[_0xeea5('0xe')]='';this[_0xeea5('0xf')]();this['updateRealtime']();}OpenchannelQueue[_0xeea5('0x10')][_0xeea5('0xf')]=function(){var _0x13e842=this[_0xeea5('0xd')][_0xeea5('0x11')];this[_0xeea5('0xd')]=_[_0xeea5('0x12')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x13e842;};OpenchannelQueue[_0xeea5('0x10')]['updateRealtime']=function(){this[_0xeea5('0x13')]=0x0;this[_0xeea5('0x14')]=0x0;for(var _0x2df7fd=0x0;_0x2df7fd=0x0?this[_0xeea5('0x16')]:0x0;var _0x366255={'id':this['id'],'available':this[_0xeea5('0x16')],'loggedIn':this[_0xeea5('0x13')],'name':this[_0xeea5('0x8')],'paused':this[_0xeea5('0x14')],'waiting':this['waiting']};var _0x528897=md5(JSON[_0xeea5('0x17')](_0x366255));if(this[_0xeea5('0xe')]!==_0x528897){this[_0xeea5('0xe')]=_0x528897;io['to'](util[_0xeea5('0x18')](_0xeea5('0x19'),_0x366255[_0xeea5('0x8')]))[_0xeea5('0x1a')](_0xeea5('0x1b'),_0x366255);}};module[_0xeea5('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index f5c32cf..c8f176f 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(_0x5f25b3,_0x35481a){var _0x4ab9bf=function(_0x49baf7){while(--_0x49baf7){_0x5f25b3['push'](_0x5f25b3['shift']());}};_0x4ab9bf(++_0x35481a);}(_0xb10b,0x12a));var _0xbb10=function(_0x1829c6,_0x4d98fd){_0x1829c6=_0x1829c6-0x0;var _0x19a7a0=_0xb10b[_0x1829c6];return _0x19a7a0;};'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 _0xbaf0=['online','paused','available','format','sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','length'];(function(_0x5d1044,_0x18f656){var _0x3cd90e=function(_0x3c40be){while(--_0x3c40be){_0x5d1044['push'](_0x5d1044['shift']());}};_0x3cd90e(++_0x18f656);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var md5=require(_0x0baf('0x0'));var util=require(_0x0baf('0x1'));var Redis=require(_0x0baf('0x2'));var config=require(_0x0baf('0x3'));config[_0x0baf('0x4')]=_[_0x0baf('0x5')](config['redis'],{'host':_0x0baf('0x6'),'port':0x18eb});var io=require(_0x0baf('0x7'))(new Redis(config[_0x0baf('0x4')]));function SmsQueue(_0x39b8f3){this['id']=_0x39b8f3['id']||0x0;this[_0x0baf('0x8')]=_0x39b8f3[_0x0baf('0x8')]||'';this[_0x0baf('0x9')]=_0x39b8f3[_0x0baf('0x9')]||0xa;this[_0x0baf('0xa')]=_0x39b8f3['strategy']||_0x0baf('0xb');this['Agents']=_0x39b8f3[_0x0baf('0xc')];this[_0x0baf('0xd')]={};this[_0x0baf('0xe')]=0x0;this[_0x0baf('0x0')]='';this[_0x0baf('0xf')]();this[_0x0baf('0x10')]();}SmsQueue[_0x0baf('0x11')][_0x0baf('0xf')]=function(){var _0x1fc6b2=this[_0x0baf('0xd')][_0x0baf('0x12')];this['mapAgentsId']=_['map'](this[_0x0baf('0xc')],'id');this[_0x0baf('0xd')][_0x0baf('0x12')]=_0x1fc6b2;};SmsQueue[_0x0baf('0x11')]['updateRealtime']=function(){this[_0x0baf('0x13')]=0x0;this['paused']=0x0;for(var _0x1c76a8=0x0;_0x1c76a8=0x0?this['available']:0x0;var _0x63c820={'id':this['id'],'available':this[_0x0baf('0x17')],'loggedIn':this[_0x0baf('0x13')],'name':this[_0x0baf('0x8')],'paused':this[_0x0baf('0x16')],'waiting':this[_0x0baf('0xe')]};var _0x4ff793=md5(JSON['stringify'](_0x63c820));if(this[_0x0baf('0x0')]!==_0x4ff793){this[_0x0baf('0x0')]=_0x4ff793;io['to'](util[_0x0baf('0x18')](_0x0baf('0x19'),_0x63c820[_0x0baf('0x8')]))[_0x0baf('0x1a')](_0x0baf('0x1b'),_0x63c820);}};module[_0x0baf('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index c1a0c3c..c526c37 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 _0x6945=['mailQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','prototype','mergeFromDatabase','initAgents','length','isUndefined','intervals','initOpenchannelQueues','openchannelQueues','updateRouting','initChatQueues','updateRealtime','initSmsQueues','smsQueues','initMailQueues','initFaxQueues','exports','bluebird','util','moment','../model/agent','../model/interval','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','agents','chatQueues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6945,0x104));var _0x5694=function(_0x346200,_0x34df7d){_0x346200=_0x346200-0x0;var _0x46d214=_0x6945[_0x346200];return _0x46d214;};'use strict';var BPromise=require(_0x5694('0x0'));var util=require(_0x5694('0x1'));var _=require('lodash');var moment=require(_0x5694('0x2'));var Agent=require(_0x5694('0x3'));var Interval=require(_0x5694('0x4'));var OpenchannelQueue=require(_0x5694('0x5'));var ChatQueue=require(_0x5694('0x6'));var SmsQueue=require(_0x5694('0x7'));var MailQueue=require(_0x5694('0x8'));var FaxQueue=require(_0x5694('0x9'));var Realtime=function(){this[_0x5694('0xa')]={};this['intervals']={};this['openchannelQueues']={};this[_0x5694('0xb')]={};this['smsQueues']={};this[_0x5694('0xc')]={};this[_0x5694('0xd')]={};this['chatQueuesWaitingInteractions']={};this[_0x5694('0xe')]={};this[_0x5694('0xf')]={};this[_0x5694('0x10')]={};this[_0x5694('0x11')]={};};function freeIsNotKey(_0x47d830,_0x5739df,_0x1efcfb){var _0x94850=_['mapKeys'](_0x47d830,function(_0x4e6f99,_0x1ddd2d){return _0x4e6f99[_0x1efcfb];});for(var _0x587aaa in _0x5739df){if(_0x5739df['hasOwnProperty'](_0x587aaa)){if(!_0x94850[_0x587aaa]){delete _0x5739df[_0x587aaa];}}}}Realtime[_0x5694('0x12')][_0x5694('0x13')]=function(_0x551a01,_0x5ced20){for(var _0x16e591 in _0x5ced20){if(_0x551a01['hasOwnProperty'](_0x16e591)){_0x551a01[_0x16e591]=_0x5ced20[_0x16e591];}}};Realtime[_0x5694('0x12')][_0x5694('0x14')]=function(){var _0x59518d=this;return function(_0x2ad1f8){if(_0x2ad1f8){freeIsNotKey(_0x2ad1f8,_0x59518d[_0x5694('0xa')],'id');for(var _0x349a2c=0x0,_0x175afc={},_0x39dc2d={};_0x349a2c<_0x2ad1f8[_0x5694('0x15')];_0x349a2c+=0x1){_0x175afc=_0x2ad1f8[_0x349a2c];if(_[_0x5694('0x16')](_0x59518d[_0x5694('0xa')][_0x175afc['id']])){_0x59518d[_0x5694('0xa')][_0x175afc['id']]=new Agent(_0x175afc);}else{_0x59518d['mergeFromDatabase'](_0x59518d[_0x5694('0xa')][_0x175afc['id']],_0x175afc);}}}return _0x59518d[_0x5694('0xa')];};};Realtime[_0x5694('0x12')]['initIntervals']=function(){var _0x244c76=this;return function(_0x30cd79){if(_0x30cd79){freeIsNotKey(_0x30cd79,_0x244c76[_0x5694('0x17')],'id');for(var _0x30d799=0x0,_0x162e0a={},_0x48d574={};_0x30d799<_0x30cd79[_0x5694('0x15')];_0x30d799+=0x1){_0x162e0a=_0x30cd79[_0x30d799];if(_['isUndefined'](_0x244c76[_0x5694('0x17')][_0x162e0a['id']])){_0x244c76['intervals'][_0x162e0a['id']]=new Interval(_0x162e0a);}else{_0x244c76['mergeFromDatabase'](_0x244c76[_0x5694('0x17')][_0x162e0a['id']],_0x162e0a);}}}return _0x244c76['intervals'];};};Realtime[_0x5694('0x12')][_0x5694('0x18')]=function(){var _0x56dd9c=this;return function(_0x577c67){if(_0x577c67){freeIsNotKey(_0x577c67,_0x56dd9c[_0x5694('0x19')],'id');for(var _0x54f8cb=0x0,_0x206eff={},_0x50f865={};_0x54f8cb<_0x577c67[_0x5694('0x15')];_0x54f8cb+=0x1){_0x206eff=_0x577c67[_0x54f8cb];if(_['isUndefined'](_0x56dd9c[_0x5694('0x19')][_0x206eff['id']])){_0x56dd9c[_0x5694('0x19')][_0x206eff['id']]=new OpenchannelQueue(_0x206eff);}else{_0x56dd9c[_0x5694('0x13')](_0x56dd9c[_0x5694('0x19')][_0x206eff['id']],_0x206eff);}_0x56dd9c[_0x5694('0x19')][_0x206eff['id']][_0x5694('0x1a')]();_0x56dd9c['openchannelQueues'][_0x206eff['id']]['updateRealtime']();}}return _0x56dd9c['openchannelQueues'];};};Realtime[_0x5694('0x12')][_0x5694('0x1b')]=function(){var _0x2faab3=this;return function(_0xc64917){if(_0xc64917){freeIsNotKey(_0xc64917,_0x2faab3[_0x5694('0xb')],'id');for(var _0x3e3800=0x0,_0x29d23b={},_0x373bcc={};_0x3e3800<_0xc64917[_0x5694('0x15')];_0x3e3800+=0x1){_0x29d23b=_0xc64917[_0x3e3800];if(_['isUndefined'](_0x2faab3[_0x5694('0xb')][_0x29d23b['id']])){_0x2faab3[_0x5694('0xb')][_0x29d23b['id']]=new ChatQueue(_0x29d23b);}else{_0x2faab3[_0x5694('0x13')](_0x2faab3[_0x5694('0xb')][_0x29d23b['id']],_0x29d23b);}_0x2faab3['chatQueues'][_0x29d23b['id']]['updateRouting']();_0x2faab3[_0x5694('0xb')][_0x29d23b['id']][_0x5694('0x1c')]();}}return _0x2faab3[_0x5694('0xb')];};};Realtime[_0x5694('0x12')][_0x5694('0x1d')]=function(){var _0x16ac39=this;return function(_0x4ccb9b){if(_0x4ccb9b){freeIsNotKey(_0x4ccb9b,_0x16ac39[_0x5694('0x1e')],'id');for(var _0x2b5c3c=0x0,_0x23e5a2={},_0x2b93b2={};_0x2b5c3c<_0x4ccb9b[_0x5694('0x15')];_0x2b5c3c+=0x1){_0x23e5a2=_0x4ccb9b[_0x2b5c3c];if(_[_0x5694('0x16')](_0x16ac39['smsQueues'][_0x23e5a2['id']])){_0x16ac39[_0x5694('0x1e')][_0x23e5a2['id']]=new SmsQueue(_0x23e5a2);}else{_0x16ac39[_0x5694('0x13')](_0x16ac39[_0x5694('0x1e')][_0x23e5a2['id']],_0x23e5a2);}_0x16ac39['smsQueues'][_0x23e5a2['id']]['updateRouting']();_0x16ac39['smsQueues'][_0x23e5a2['id']][_0x5694('0x1c')]();}}return _0x16ac39[_0x5694('0x1e')];};};Realtime[_0x5694('0x12')][_0x5694('0x1f')]=function(){var _0x164849=this;return function(_0x17c1f0){if(_0x17c1f0){freeIsNotKey(_0x17c1f0,_0x164849[_0x5694('0xc')],'id');for(var _0x427f18=0x0,_0x28e1a1={},_0x44d625={};_0x427f18<_0x17c1f0['length'];_0x427f18+=0x1){_0x28e1a1=_0x17c1f0[_0x427f18];if(_[_0x5694('0x16')](_0x164849[_0x5694('0xc')][_0x28e1a1['id']])){_0x164849[_0x5694('0xc')][_0x28e1a1['id']]=new MailQueue(_0x28e1a1);}else{_0x164849[_0x5694('0x13')](_0x164849[_0x5694('0xc')][_0x28e1a1['id']],_0x28e1a1);}_0x164849['mailQueues'][_0x28e1a1['id']][_0x5694('0x1a')]();_0x164849[_0x5694('0xc')][_0x28e1a1['id']][_0x5694('0x1c')]();}}return _0x164849[_0x5694('0xc')];};};Realtime[_0x5694('0x12')][_0x5694('0x20')]=function(){var _0x5009a0=this;return function(_0x19739e){if(_0x19739e){freeIsNotKey(_0x19739e,_0x5009a0[_0x5694('0xd')],'id');for(var _0x2379a1=0x0,_0x176b03={},_0x24bfff={};_0x2379a1<_0x19739e['length'];_0x2379a1+=0x1){_0x176b03=_0x19739e[_0x2379a1];if(_[_0x5694('0x16')](_0x5009a0['faxQueues'][_0x176b03['id']])){_0x5009a0[_0x5694('0xd')][_0x176b03['id']]=new FaxQueue(_0x176b03);}else{_0x5009a0['mergeFromDatabase'](_0x5009a0[_0x5694('0xd')][_0x176b03['id']],_0x176b03);}_0x5009a0[_0x5694('0xd')][_0x176b03['id']][_0x5694('0x1a')]();_0x5009a0[_0x5694('0xd')][_0x176b03['id']][_0x5694('0x1c')]();}}return _0x5009a0[_0x5694('0xd')];};};module[_0x5694('0x21')]=Realtime; \ No newline at end of file +var _0xc6af=['initIntervals','length','initOpenchannelQueues','updateRouting','updateRealtime','initChatQueues','initSmsQueues','initMailQueues','faxQueues','exports','bluebird','util','lodash','moment','../model/interval','../model/openchannelQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','intervals','openchannelQueues','chatQueues','smsQueues','mailQueues','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','prototype','mergeFromDatabase','hasOwnProperty','initAgents','isUndefined','agents'];(function(_0x452a09,_0x28f402){var _0x1879d4=function(_0x8a8f37){while(--_0x8a8f37){_0x452a09['push'](_0x452a09['shift']());}};_0x1879d4(++_0x28f402);}(_0xc6af,0x15e));var _0xfc6a=function(_0x4b7b11,_0xac836d){_0x4b7b11=_0x4b7b11-0x0;var _0x1b51eb=_0xc6af[_0x4b7b11];return _0x1b51eb;};'use strict';var BPromise=require(_0xfc6a('0x0'));var util=require(_0xfc6a('0x1'));var _=require(_0xfc6a('0x2'));var moment=require(_0xfc6a('0x3'));var Agent=require('../model/agent');var Interval=require(_0xfc6a('0x4'));var OpenchannelQueue=require(_0xfc6a('0x5'));var ChatQueue=require('../model/chatQueue');var SmsQueue=require(_0xfc6a('0x6'));var MailQueue=require(_0xfc6a('0x7'));var FaxQueue=require(_0xfc6a('0x8'));var Realtime=function(){this['agents']={};this[_0xfc6a('0x9')]={};this[_0xfc6a('0xa')]={};this[_0xfc6a('0xb')]={};this[_0xfc6a('0xc')]={};this[_0xfc6a('0xd')]={};this['faxQueues']={};this['chatQueuesWaitingInteractions']={};this[_0xfc6a('0xe')]={};this['openchannelQueuesWaitingInteractions']={};this[_0xfc6a('0xf')]={};this[_0xfc6a('0x10')]={};};function freeIsNotKey(_0x158aea,_0x110f48,_0x2ce6c6){var _0x1bf07b=_[_0xfc6a('0x11')](_0x158aea,function(_0x35ea44,_0x257806){return _0x35ea44[_0x2ce6c6];});for(var _0x533b08 in _0x110f48){if(_0x110f48['hasOwnProperty'](_0x533b08)){if(!_0x1bf07b[_0x533b08]){delete _0x110f48[_0x533b08];}}}}Realtime[_0xfc6a('0x12')][_0xfc6a('0x13')]=function(_0x571e67,_0x47687d){for(var _0x396474 in _0x47687d){if(_0x571e67[_0xfc6a('0x14')](_0x396474)){_0x571e67[_0x396474]=_0x47687d[_0x396474];}}};Realtime['prototype'][_0xfc6a('0x15')]=function(){var _0x5d895f=this;return function(_0x1e7705){if(_0x1e7705){freeIsNotKey(_0x1e7705,_0x5d895f['agents'],'id');for(var _0x21b475=0x0,_0x5b4a6e={},_0x267892={};_0x21b475<_0x1e7705['length'];_0x21b475+=0x1){_0x5b4a6e=_0x1e7705[_0x21b475];if(_[_0xfc6a('0x16')](_0x5d895f['agents'][_0x5b4a6e['id']])){_0x5d895f['agents'][_0x5b4a6e['id']]=new Agent(_0x5b4a6e);}else{_0x5d895f['mergeFromDatabase'](_0x5d895f[_0xfc6a('0x17')][_0x5b4a6e['id']],_0x5b4a6e);}}}return _0x5d895f['agents'];};};Realtime[_0xfc6a('0x12')][_0xfc6a('0x18')]=function(){var _0x2ac50c=this;return function(_0x4844c7){if(_0x4844c7){freeIsNotKey(_0x4844c7,_0x2ac50c[_0xfc6a('0x9')],'id');for(var _0x3e14f7=0x0,_0x52539d={},_0x2832ee={};_0x3e14f7<_0x4844c7[_0xfc6a('0x19')];_0x3e14f7+=0x1){_0x52539d=_0x4844c7[_0x3e14f7];if(_[_0xfc6a('0x16')](_0x2ac50c[_0xfc6a('0x9')][_0x52539d['id']])){_0x2ac50c['intervals'][_0x52539d['id']]=new Interval(_0x52539d);}else{_0x2ac50c[_0xfc6a('0x13')](_0x2ac50c[_0xfc6a('0x9')][_0x52539d['id']],_0x52539d);}}}return _0x2ac50c['intervals'];};};Realtime['prototype'][_0xfc6a('0x1a')]=function(){var _0x2152ff=this;return function(_0x1c74e1){if(_0x1c74e1){freeIsNotKey(_0x1c74e1,_0x2152ff[_0xfc6a('0xa')],'id');for(var _0x4b9a7d=0x0,_0xddb6bf={},_0x549b1e={};_0x4b9a7d<_0x1c74e1['length'];_0x4b9a7d+=0x1){_0xddb6bf=_0x1c74e1[_0x4b9a7d];if(_[_0xfc6a('0x16')](_0x2152ff[_0xfc6a('0xa')][_0xddb6bf['id']])){_0x2152ff[_0xfc6a('0xa')][_0xddb6bf['id']]=new OpenchannelQueue(_0xddb6bf);}else{_0x2152ff[_0xfc6a('0x13')](_0x2152ff['openchannelQueues'][_0xddb6bf['id']],_0xddb6bf);}_0x2152ff['openchannelQueues'][_0xddb6bf['id']][_0xfc6a('0x1b')]();_0x2152ff[_0xfc6a('0xa')][_0xddb6bf['id']][_0xfc6a('0x1c')]();}}return _0x2152ff[_0xfc6a('0xa')];};};Realtime[_0xfc6a('0x12')][_0xfc6a('0x1d')]=function(){var _0x5c9f42=this;return function(_0x1d2800){if(_0x1d2800){freeIsNotKey(_0x1d2800,_0x5c9f42[_0xfc6a('0xb')],'id');for(var _0x494818=0x0,_0x49e1c0={},_0x1e8b43={};_0x494818<_0x1d2800[_0xfc6a('0x19')];_0x494818+=0x1){_0x49e1c0=_0x1d2800[_0x494818];if(_[_0xfc6a('0x16')](_0x5c9f42['chatQueues'][_0x49e1c0['id']])){_0x5c9f42[_0xfc6a('0xb')][_0x49e1c0['id']]=new ChatQueue(_0x49e1c0);}else{_0x5c9f42[_0xfc6a('0x13')](_0x5c9f42[_0xfc6a('0xb')][_0x49e1c0['id']],_0x49e1c0);}_0x5c9f42[_0xfc6a('0xb')][_0x49e1c0['id']][_0xfc6a('0x1b')]();_0x5c9f42[_0xfc6a('0xb')][_0x49e1c0['id']]['updateRealtime']();}}return _0x5c9f42['chatQueues'];};};Realtime[_0xfc6a('0x12')][_0xfc6a('0x1e')]=function(){var _0xd70c2d=this;return function(_0x48baa6){if(_0x48baa6){freeIsNotKey(_0x48baa6,_0xd70c2d[_0xfc6a('0xc')],'id');for(var _0x50ae0a=0x0,_0x36d34e={},_0x13c562={};_0x50ae0a<_0x48baa6['length'];_0x50ae0a+=0x1){_0x36d34e=_0x48baa6[_0x50ae0a];if(_[_0xfc6a('0x16')](_0xd70c2d[_0xfc6a('0xc')][_0x36d34e['id']])){_0xd70c2d[_0xfc6a('0xc')][_0x36d34e['id']]=new SmsQueue(_0x36d34e);}else{_0xd70c2d['mergeFromDatabase'](_0xd70c2d[_0xfc6a('0xc')][_0x36d34e['id']],_0x36d34e);}_0xd70c2d[_0xfc6a('0xc')][_0x36d34e['id']][_0xfc6a('0x1b')]();_0xd70c2d['smsQueues'][_0x36d34e['id']][_0xfc6a('0x1c')]();}}return _0xd70c2d[_0xfc6a('0xc')];};};Realtime['prototype'][_0xfc6a('0x1f')]=function(){var _0xf5f227=this;return function(_0x1d4621){if(_0x1d4621){freeIsNotKey(_0x1d4621,_0xf5f227[_0xfc6a('0xd')],'id');for(var _0x21faea=0x0,_0x3235e6={},_0x22a802={};_0x21faea<_0x1d4621[_0xfc6a('0x19')];_0x21faea+=0x1){_0x3235e6=_0x1d4621[_0x21faea];if(_[_0xfc6a('0x16')](_0xf5f227[_0xfc6a('0xd')][_0x3235e6['id']])){_0xf5f227[_0xfc6a('0xd')][_0x3235e6['id']]=new MailQueue(_0x3235e6);}else{_0xf5f227[_0xfc6a('0x13')](_0xf5f227[_0xfc6a('0xd')][_0x3235e6['id']],_0x3235e6);}_0xf5f227[_0xfc6a('0xd')][_0x3235e6['id']][_0xfc6a('0x1b')]();_0xf5f227[_0xfc6a('0xd')][_0x3235e6['id']]['updateRealtime']();}}return _0xf5f227[_0xfc6a('0xd')];};};Realtime['prototype']['initFaxQueues']=function(){var _0x327ec2=this;return function(_0x3a7b0b){if(_0x3a7b0b){freeIsNotKey(_0x3a7b0b,_0x327ec2[_0xfc6a('0x20')],'id');for(var _0x355b44=0x0,_0x18a435={},_0xaecbfd={};_0x355b44<_0x3a7b0b[_0xfc6a('0x19')];_0x355b44+=0x1){_0x18a435=_0x3a7b0b[_0x355b44];if(_['isUndefined'](_0x327ec2['faxQueues'][_0x18a435['id']])){_0x327ec2['faxQueues'][_0x18a435['id']]=new FaxQueue(_0x18a435);}else{_0x327ec2['mergeFromDatabase'](_0x327ec2[_0xfc6a('0x20')][_0x18a435['id']],_0x18a435);}_0x327ec2[_0xfc6a('0x20')][_0x18a435['id']][_0xfc6a('0x1b')]();_0x327ec2[_0xfc6a('0x20')][_0x18a435['id']][_0xfc6a('0x1c')]();}}return _0x327ec2[_0xfc6a('0x20')];};};module[_0xfc6a('0x21')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index a8c897a..06e2a94 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 _0x8ddb=['addTagsToChatInteraction','../client','update','addTags','Request'];(function(_0x271fe4,_0x45d56f){var _0x26ae7d=function(_0x5ee52b){while(--_0x5ee52b){_0x271fe4['push'](_0x271fe4['shift']());}};_0x26ae7d(++_0x45d56f);}(_0x8ddb,0xd8));var _0xb8dd=function(_0x21e71a,_0xf0b818){_0x21e71a=_0x21e71a-0x0;var _0x174f46=_0x8ddb[_0x21e71a];return _0x174f46;};'use strict';var client=require(_0xb8dd('0x0'));exports[_0xb8dd('0x1')]=function(_0x281e22,_0x20cdca){return client['Request']('UpdateChatInteraction',{'body':_0x20cdca,'options':{'where':{'id':_0x281e22}},'log':'updateChatInteraction'});};exports[_0xb8dd('0x2')]=function(_0x53835a,_0x41539e){return client[_0xb8dd('0x3')]('AddTagsToChatInteraction',{'body':_0x41539e,'options':{'where':{'id':_0x53835a}},'log':_0xb8dd('0x4')});}; \ No newline at end of file +var _0xd329=['addTags','AddTagsToChatInteraction','../client','Request','UpdateChatInteraction'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd329,0x15b));var _0x9d32=function(_0x12c946,_0x3a481f){_0x12c946=_0x12c946-0x0;var _0x5b9843=_0xd329[_0x12c946];return _0x5b9843;};'use strict';var client=require(_0x9d32('0x0'));exports['update']=function(_0x2303ae,_0x229976){return client[_0x9d32('0x1')](_0x9d32('0x2'),{'body':_0x229976,'options':{'where':{'id':_0x2303ae}},'log':'updateChatInteraction'});};exports[_0x9d32('0x3')]=function(_0x4f5e6d,_0x1fcff0){return client[_0x9d32('0x1')](_0x9d32('0x4'),{'body':_0x1fcff0,'options':{'where':{'id':_0x4f5e6d}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 77d12d4..9c8500a 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 _0x60a8=['Request','CreateChatMessage','../client','create'];(function(_0x171f79,_0x5f2757){var _0x6c9c9e=function(_0x473e5e){while(--_0x473e5e){_0x171f79['push'](_0x171f79['shift']());}};_0x6c9c9e(++_0x5f2757);}(_0x60a8,0x1aa));var _0x860a=function(_0x541b49,_0x497c69){_0x541b49=_0x541b49-0x0;var _0x3ee5d7=_0x60a8[_0x541b49];return _0x3ee5d7;};'use strict';var client=require(_0x860a('0x0'));exports[_0x860a('0x1')]=function(_0x2e3583){return client[_0x860a('0x2')](_0x860a('0x3'),{'body':_0x2e3583,'log':'createChatMessage'});}; \ No newline at end of file +var _0x3438=['../client','create','Request','createChatMessage'];(function(_0x449866,_0x39b6b1){var _0xc4b0de=function(_0x4609a3){while(--_0x4609a3){_0x449866['push'](_0x449866['shift']());}};_0xc4b0de(++_0x39b6b1);}(_0x3438,0x1c8));var _0x8343=function(_0x54ce13,_0x40c22a){_0x54ce13=_0x54ce13-0x0;var _0x14d19d=_0x3438[_0x54ce13];return _0x14d19d;};'use strict';var client=require(_0x8343('0x0'));exports[_0x8343('0x1')]=function(_0x3d495a){return client[_0x8343('0x2')]('CreateChatMessage',{'body':_0x3d495a,'log':_0x8343('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 82312eb..619e82f 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 _0x68ac=['User','Agents','online','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy'];(function(_0x263dbf,_0x555419){var _0x57302b=function(_0x4fbfcb){while(--_0x4fbfcb){_0x263dbf['push'](_0x263dbf['shift']());}};_0x57302b(++_0x555419);}(_0x68ac,0xb4));var _0xc68a=function(_0x523e57,_0x43ae46){_0x523e57=_0x523e57-0x0;var _0x4ed1c9=_0x68ac[_0x523e57];return _0x4ed1c9;};'use strict';var client=require(_0xc68a('0x0'));exports[_0xc68a('0x1')]=function(){return function(){return client[_0xc68a('0x2')](_0xc68a('0x3'),{'options':{'raw':![],'attributes':['id',_0xc68a('0x4'),_0xc68a('0x5'),_0xc68a('0x6')],'include':[{'model':_0xc68a('0x7'),'as':_0xc68a('0x8'),'attributes':['id','name',_0xc68a('0x9'),_0xc68a('0xa')]}]},'log':_0xc68a('0x1')});};}; \ No newline at end of file +var _0x9107=['chatPause','getChatQueues','Request','GetChatQueue','name','timeout','strategy','Agents','online'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x9107,0x169));var _0x7910=function(_0x1a69b7,_0x2dbca5){_0x1a69b7=_0x1a69b7-0x0;var _0x5d4a12=_0x9107[_0x1a69b7];return _0x5d4a12;};'use strict';var client=require('../client');exports[_0x7910('0x0')]=function(){return function(){return client[_0x7910('0x1')](_0x7910('0x2'),{'options':{'raw':![],'attributes':['id',_0x7910('0x3'),_0x7910('0x4'),_0x7910('0x5')],'include':[{'model':'User','as':_0x7910('0x6'),'attributes':['id','name',_0x7910('0x7'),_0x7910('0x8')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 635283b..5b3222f 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 _0x2123=['DESC','../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x371655,_0x4cd20f){var _0x3a4c99=function(_0x56ef70){while(--_0x56ef70){_0x371655['push'](_0x371655['shift']());}};_0x3a4c99(++_0x4cd20f);}(_0x2123,0x190));var _0x3212=function(_0x470afe,_0x2bf985){_0x470afe=_0x470afe-0x0;var _0x479070=_0x2123[_0x470afe];return _0x479070;};'use strict';var client=require(_0x3212('0x0'));exports[_0x3212('0x1')]=function(_0x420d05){return client[_0x3212('0x2')](_0x3212('0x3'),{'body':_0x420d05,'log':_0x3212('0x3')});};exports[_0x3212('0x4')]=function(_0x2e951f,_0x304f80){return client[_0x3212('0x2')](_0x3212('0x5'),{'body':_0x304f80,'options':{'where':{'uniqueid':_0x2e951f},'order':[['id',_0x3212('0x6')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x57d4=['DESC','../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x4c04c3,_0x436bd8){var _0x912282=function(_0x292096){while(--_0x292096){_0x4c04c3['push'](_0x4c04c3['shift']());}};_0x912282(++_0x436bd8);}(_0x57d4,0x78));var _0x457d=function(_0x552731,_0xf01bb2){_0x552731=_0x552731-0x0;var _0x128716=_0x57d4[_0x552731];return _0x128716;};'use strict';var client=require(_0x457d('0x0'));exports[_0x457d('0x1')]=function(_0x47a573){return client[_0x457d('0x2')](_0x457d('0x3'),{'body':_0x47a573,'log':_0x457d('0x3')});};exports[_0x457d('0x4')]=function(_0x1219e1,_0x3c89b2){return client[_0x457d('0x2')](_0x457d('0x5'),{'body':_0x3c89b2,'options':{'where':{'uniqueid':_0x1219e1},'order':[['id',_0x457d('0x6')]],'limit':0x1},'log':_0x457d('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 17ab8ca..4e2d651 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 _0x9ccd=['update','Request','UpdateFaxInteraction','updateFaxInteraction','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client'];(function(_0x75276e,_0x4a4015){var _0x3d8d88=function(_0x54e4a6){while(--_0x54e4a6){_0x75276e['push'](_0x75276e['shift']());}};_0x3d8d88(++_0x4a4015);}(_0x9ccd,0xdf));var _0xd9cc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9ccd[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xd9cc('0x0'));exports[_0xd9cc('0x1')]=function(_0x29d472,_0x11ad57){return client[_0xd9cc('0x2')](_0xd9cc('0x3'),{'body':_0x11ad57,'options':{'where':{'id':_0x29d472}},'log':_0xd9cc('0x4')});};exports['addTags']=function(_0xe877a6,_0x23a568){return client[_0xd9cc('0x2')](_0xd9cc('0x5'),{'body':_0x23a568,'options':{'where':{'id':_0xe877a6}},'log':_0xd9cc('0x6')});}; \ No newline at end of file +var _0x1441=['addTags','Request','addTagsToFaxInteraction','../client','update','updateFaxInteraction'];(function(_0x31b5b2,_0x5ab927){var _0x364f13=function(_0x163bd0){while(--_0x163bd0){_0x31b5b2['push'](_0x31b5b2['shift']());}};_0x364f13(++_0x5ab927);}(_0x1441,0x183));var _0x1144=function(_0x9d39e9,_0x3aebc9){_0x9d39e9=_0x9d39e9-0x0;var _0x4ac75b=_0x1441[_0x9d39e9];return _0x4ac75b;};'use strict';var client=require(_0x1144('0x0'));exports[_0x1144('0x1')]=function(_0x3ea8c3,_0x30de53){return client['Request']('UpdateFaxInteraction',{'body':_0x30de53,'options':{'where':{'id':_0x3ea8c3}},'log':_0x1144('0x2')});};exports[_0x1144('0x3')]=function(_0x19796e,_0x22065f){return client[_0x1144('0x4')]('AddTagsToFaxInteraction',{'body':_0x22065f,'options':{'where':{'id':_0x19796e}},'log':_0x1144('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index ab526e0..c1c0b2d 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 _0x05d4=['CreateFaxMessage','createFaxMessage','../client','Request'];(function(_0x21b651,_0x2a22f0){var _0x4398bd=function(_0x1874aa){while(--_0x1874aa){_0x21b651['push'](_0x21b651['shift']());}};_0x4398bd(++_0x2a22f0);}(_0x05d4,0x72));var _0x405d=function(_0x1379e9,_0x3cf0c3){_0x1379e9=_0x1379e9-0x0;var _0x54bc52=_0x05d4[_0x1379e9];return _0x54bc52;};'use strict';var client=require(_0x405d('0x0'));exports['create']=function(_0xc72907){return client[_0x405d('0x1')](_0x405d('0x2'),{'body':_0xc72907,'log':_0x405d('0x3')});}; \ No newline at end of file +var _0x2bfe=['createFaxMessage','create','Request','CreateFaxMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2bfe,0x159));var _0xe2bf=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x2bfe[_0x2cfb58];return _0xd99951;};'use strict';var client=require('../client');exports[_0xe2bf('0x0')]=function(_0x4caaa7){return client[_0xe2bf('0x1')](_0xe2bf('0x2'),{'body':_0x4caaa7,'log':_0xe2bf('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index e42e10d..4f3b958 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 _0x212e=['faxPause','getFaxQueues','Request','GetFaxQueue','timeout','strategy','Agents','name'];(function(_0xff4a4a,_0x2df5c3){var _0x1356a4=function(_0xcfc746){while(--_0xcfc746){_0xff4a4a['push'](_0xff4a4a['shift']());}};_0x1356a4(++_0x2df5c3);}(_0x212e,0xc1));var _0xe212=function(_0x110dbf,_0x16a620){_0x110dbf=_0x110dbf-0x0;var _0x49e064=_0x212e[_0x110dbf];return _0x49e064;};'use strict';var client=require('../client');exports[_0xe212('0x0')]=function(){return function(){return client[_0xe212('0x1')](_0xe212('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xe212('0x3'),_0xe212('0x4')],'include':[{'model':'User','as':_0xe212('0x5'),'attributes':['id',_0xe212('0x6'),'online',_0xe212('0x7')]}]},'log':_0xe212('0x0')});};}; \ No newline at end of file +var _0xf57a=['timeout','strategy','User','Agents','name','online','faxPause','getFaxQueues','Request','GetFaxQueue'];(function(_0x29fb3a,_0x54493f){var _0xb96669=function(_0x5e7329){while(--_0x5e7329){_0x29fb3a['push'](_0x29fb3a['shift']());}};_0xb96669(++_0x54493f);}(_0xf57a,0x75));var _0xaf57=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xf57a[_0x1969a7];return _0x3d665f;};'use strict';var client=require('../client');exports[_0xaf57('0x0')]=function(){return function(){return client[_0xaf57('0x1')](_0xaf57('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xaf57('0x3'),_0xaf57('0x4')],'include':[{'model':_0xaf57('0x5'),'as':_0xaf57('0x6'),'attributes':['id',_0xaf57('0x7'),_0xaf57('0x8'),_0xaf57('0x9')]}]},'log':_0xaf57('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 699588f..a8e790c 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 _0x5902=['DESC','../client','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x13caf0,_0x27f5ab){var _0x520401=function(_0x5b30eb){while(--_0x5b30eb){_0x13caf0['push'](_0x13caf0['shift']());}};_0x520401(++_0x27f5ab);}(_0x5902,0x187));var _0x2590=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5902[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x2590('0x0'));exports['create']=function(_0x181ea6){return client[_0x2590('0x1')]('CreateFaxQueueReport',{'body':_0x181ea6,'log':_0x2590('0x2')});};exports[_0x2590('0x3')]=function(_0x52a254,_0x456f63){return client[_0x2590('0x1')](_0x2590('0x4'),{'body':_0x456f63,'options':{'where':{'uniqueid':_0x52a254},'order':[['id',_0x2590('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0xa751=['UpdateFaxQueueReport','../client','create','Request','CreateFaxQueueReport','DESC'];(function(_0x3a7257,_0x30b139){var _0x467d25=function(_0x25f9d1){while(--_0x25f9d1){_0x3a7257['push'](_0x3a7257['shift']());}};_0x467d25(++_0x30b139);}(_0xa751,0x175));var _0x1a75=function(_0x3ecca2,_0x72fee){_0x3ecca2=_0x3ecca2-0x0;var _0x55baf8=_0xa751[_0x3ecca2];return _0x55baf8;};'use strict';var client=require(_0x1a75('0x0'));exports[_0x1a75('0x1')]=function(_0x31af97){return client[_0x1a75('0x2')]('CreateFaxQueueReport',{'body':_0x31af97,'log':_0x1a75('0x3')});};exports['update']=function(_0x31db55,_0x95fa7){return client[_0x1a75('0x2')]('UpdateFaxQueueReport',{'body':_0x95fa7,'options':{'where':{'uniqueid':_0x31db55},'order':[['id',_0x1a75('0x4')]],'limit':0x1},'log':_0x1a75('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index e8077ff..5845209 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 _0xe511=['interval','../client','getIntervals','GetInterval','Interval','Intervals'];(function(_0x2693c1,_0x54ffea){var _0x48a150=function(_0x42ba93){while(--_0x42ba93){_0x2693c1['push'](_0x2693c1['shift']());}};_0x48a150(++_0x54ffea);}(_0xe511,0x16f));var _0x1e51=function(_0xfe08bf,_0x2aab40){_0xfe08bf=_0xfe08bf-0x0;var _0x44b8ca=_0xe511[_0xfe08bf];return _0x44b8ca;};'use strict';var client=require(_0x1e51('0x0'));exports[_0x1e51('0x1')]=function(){return function(){return client['Request'](_0x1e51('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x1e51('0x3'),'as':_0x1e51('0x4'),'attributes':['id','name',_0x1e51('0x5')]}]},'log':_0x1e51('0x1')});};}; \ No newline at end of file +var _0x1b0e=['Request','GetInterval','name','Interval','interval','../client','getIntervals'];(function(_0x3fc992,_0x33512d){var _0x1944ff=function(_0x10677e){while(--_0x10677e){_0x3fc992['push'](_0x3fc992['shift']());}};_0x1944ff(++_0x33512d);}(_0x1b0e,0x132));var _0xe1b0=function(_0x45d262,_0x2eb62a){_0x45d262=_0x45d262-0x0;var _0x375094=_0x1b0e[_0x45d262];return _0x375094;};'use strict';var client=require(_0xe1b0('0x0'));exports[_0xe1b0('0x1')]=function(){return function(){return client[_0xe1b0('0x2')](_0xe1b0('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xe1b0('0x4')],'include':[{'model':_0xe1b0('0x5'),'as':'Intervals','attributes':['id','name',_0xe1b0('0x6')]}]},'log':_0xe1b0('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 0c233ed..f8bed18 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 _0x2632=['addTags','../client','Request','updateMailInteraction'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x2632,0x1d5));var _0x2263=function(_0x172121,_0x8f97c4){_0x172121=_0x172121-0x0;var _0x4501d3=_0x2632[_0x172121];return _0x4501d3;};'use strict';var client=require(_0x2263('0x0'));exports['update']=function(_0x737c29,_0x4a2640){return client[_0x2263('0x1')]('UpdateMailInteraction',{'body':_0x4a2640,'options':{'where':{'id':_0x737c29}},'log':_0x2263('0x2')});};exports[_0x2263('0x3')]=function(_0x3fe975,_0x42bfe9){return client[_0x2263('0x1')]('AddTagsToMailInteraction',{'body':_0x42bfe9,'options':{'where':{'id':_0x3fe975}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x347c=['Request','UpdateMailInteraction','addTags','addTagsToChatInteraction','../client'];(function(_0x204dd1,_0x2c3233){var _0x4f2fa1=function(_0x3a5511){while(--_0x3a5511){_0x204dd1['push'](_0x204dd1['shift']());}};_0x4f2fa1(++_0x2c3233);}(_0x347c,0xbd));var _0xc347=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x347c[_0x51020b];return _0x371e47;};'use strict';var client=require(_0xc347('0x0'));exports['update']=function(_0x3c6244,_0x42fcfa){return client[_0xc347('0x1')](_0xc347('0x2'),{'body':_0x42fcfa,'options':{'where':{'id':_0x3c6244}},'log':'updateMailInteraction'});};exports[_0xc347('0x3')]=function(_0x2bf197,_0x2a2a11){return client['Request']('AddTagsToMailInteraction',{'body':_0x2a2a11,'options':{'where':{'id':_0x2bf197}},'log':_0xc347('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index b15fda3..b0c6bd4 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 _0x3bd5=['createMailMessage','Request','CreateMailMessage'];(function(_0x14ac27,_0x3025e5){var _0x51dfd2=function(_0x5d79f8){while(--_0x5d79f8){_0x14ac27['push'](_0x14ac27['shift']());}};_0x51dfd2(++_0x3025e5);}(_0x3bd5,0x1b1));var _0x53bd=function(_0x16bd24,_0x4c00b5){_0x16bd24=_0x16bd24-0x0;var _0x313b77=_0x3bd5[_0x16bd24];return _0x313b77;};'use strict';var client=require('../client');exports['create']=function(_0x4ef089){return client[_0x53bd('0x0')](_0x53bd('0x1'),{'body':_0x4ef089,'log':_0x53bd('0x2')});}; \ No newline at end of file +var _0x6142=['Request','CreateMailMessage','create'];(function(_0x1d5063,_0x275836){var _0x48b0ec=function(_0x2c6024){while(--_0x2c6024){_0x1d5063['push'](_0x1d5063['shift']());}};_0x48b0ec(++_0x275836);}(_0x6142,0x1bb));var _0x2614=function(_0x39a4ec,_0x5e9054){_0x39a4ec=_0x39a4ec-0x0;var _0x45988e=_0x6142[_0x39a4ec];return _0x45988e;};'use strict';var client=require('../client');exports[_0x2614('0x0')]=function(_0x2b2e08){return client[_0x2614('0x1')](_0x2614('0x2'),{'body':_0x2b2e08,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 9812663..0ce8c86 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 _0xf671=['mailPause','getMailQueues','Request','GetMailQueue','name','strategy','User','Agents','online'];(function(_0x5c2141,_0x4f20df){var _0x1972a7=function(_0x144af5){while(--_0x144af5){_0x5c2141['push'](_0x5c2141['shift']());}};_0x1972a7(++_0x4f20df);}(_0xf671,0x1a9));var _0x1f67=function(_0x4bfe08,_0x48ae7b){_0x4bfe08=_0x4bfe08-0x0;var _0x1f9125=_0xf671[_0x4bfe08];return _0x1f9125;};'use strict';var client=require('../client');exports['getMailQueues']=function(){return function(){return client[_0x1f67('0x0')](_0x1f67('0x1'),{'options':{'raw':![],'attributes':['id',_0x1f67('0x2'),'timeout',_0x1f67('0x3')],'include':[{'model':_0x1f67('0x4'),'as':_0x1f67('0x5'),'attributes':['id',_0x1f67('0x2'),_0x1f67('0x6'),_0x1f67('0x7')]}]},'log':_0x1f67('0x8')});};}; \ No newline at end of file +var _0x784d=['name','mailPause','Request','GetMailQueue','Agents'];(function(_0x28245b,_0x5d5805){var _0x1bc50f=function(_0x192c8f){while(--_0x192c8f){_0x28245b['push'](_0x28245b['shift']());}};_0x1bc50f(++_0x5d5805);}(_0x784d,0x14c));var _0xd784=function(_0x4f2247,_0x58f645){_0x4f2247=_0x4f2247-0x0;var _0x5abaac=_0x784d[_0x4f2247];return _0x5abaac;};'use strict';var client=require('../client');exports['getMailQueues']=function(){return function(){return client[_0xd784('0x0')](_0xd784('0x1'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':'User','as':_0xd784('0x2'),'attributes':['id',_0xd784('0x3'),'online',_0xd784('0x4')]}]},'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 acc8e16..c004755 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 _0x1622=['CreateMailQueueReport','update','UpdateMailQueueReport','DESC','create','Request'];(function(_0x5ba8c2,_0x476ede){var _0x1ff6a6=function(_0x5764e7){while(--_0x5764e7){_0x5ba8c2['push'](_0x5ba8c2['shift']());}};_0x1ff6a6(++_0x476ede);}(_0x1622,0x1b4));var _0x2162=function(_0x2f4abe,_0x257fd4){_0x2f4abe=_0x2f4abe-0x0;var _0x30797b=_0x1622[_0x2f4abe];return _0x30797b;};'use strict';var client=require('../client');exports[_0x2162('0x0')]=function(_0x58f550){return client[_0x2162('0x1')]('CreateMailQueueReport',{'body':_0x58f550,'log':_0x2162('0x2')});};exports[_0x2162('0x3')]=function(_0x1c6092,_0x33e90f){return client[_0x2162('0x1')](_0x2162('0x4'),{'body':_0x33e90f,'options':{'where':{'uniqueid':_0x1c6092},'order':[['id',_0x2162('0x5')]],'limit':0x1},'log':_0x2162('0x4')});}; \ No newline at end of file +var _0xdb01=['Request','update','DESC','../client'];(function(_0x5b2b61,_0x5c5cbe){var _0x633c54=function(_0x15095f){while(--_0x15095f){_0x5b2b61['push'](_0x5b2b61['shift']());}};_0x633c54(++_0x5c5cbe);}(_0xdb01,0x113));var _0x1db0=function(_0x37b0da,_0x42982f){_0x37b0da=_0x37b0da-0x0;var _0x18c5b6=_0xdb01[_0x37b0da];return _0x18c5b6;};'use strict';var client=require(_0x1db0('0x0'));exports['create']=function(_0x2bc405){return client[_0x1db0('0x1')]('CreateMailQueueReport',{'body':_0x2bc405,'log':'CreateMailQueueReport'});};exports[_0x1db0('0x2')]=function(_0x1546c1,_0x19dbd4){return client[_0x1db0('0x1')]('UpdateMailQueueReport',{'body':_0x19dbd4,'options':{'where':{'uniqueid':_0x1546c1},'order':[['id',_0x1db0('0x3')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index cd24580..80db5b3 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 _0xb0e9=['../client','Request','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x37a7c6,_0x3a84b6){var _0x539905=function(_0xa00c20){while(--_0xa00c20){_0x37a7c6['push'](_0x37a7c6['shift']());}};_0x539905(++_0x3a84b6);}(_0xb0e9,0xc3));var _0x9b0e=function(_0x12ba59,_0x139b9d){_0x12ba59=_0x12ba59-0x0;var _0x147a9c=_0xb0e9[_0x12ba59];return _0x147a9c;};'use strict';var client=require(_0x9b0e('0x0'));exports['update']=function(_0x3252ac,_0x2cfd17){return client[_0x9b0e('0x1')](_0x9b0e('0x2'),{'body':_0x2cfd17,'options':{'where':{'id':_0x3252ac}},'log':'updateOpenchannelInteraction'});};exports['addTags']=function(_0x731d5d,_0x4925c2){return client['Request'](_0x9b0e('0x3'),{'body':_0x4925c2,'options':{'where':{'id':_0x731d5d}},'log':_0x9b0e('0x4')});}; \ No newline at end of file +var _0xcbac=['updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x22f317,_0x19e29f){var _0x1d9eb5=function(_0x4e8556){while(--_0x4e8556){_0x22f317['push'](_0x22f317['shift']());}};_0x1d9eb5(++_0x19e29f);}(_0xcbac,0x1d9));var _0xccba=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xcbac[_0xd1d19a];return _0x52a79d;};'use strict';var client=require(_0xccba('0x0'));exports[_0xccba('0x1')]=function(_0x2b6fce,_0x4f600b){return client[_0xccba('0x2')]('UpdateOpenchannelInteraction',{'body':_0x4f600b,'options':{'where':{'id':_0x2b6fce}},'log':_0xccba('0x3')});};exports[_0xccba('0x4')]=function(_0x909668,_0x3ab8f7){return client[_0xccba('0x2')](_0xccba('0x5'),{'body':_0x3ab8f7,'options':{'where':{'id':_0x909668}},'log':_0xccba('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 08ed058..049659a 100644 --- a/server/services/routing/rpc/openchannelMessage.js +++ b/server/services/routing/rpc/openchannelMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f0d=['CreateOpenchannelMessage','create','Request'];(function(_0xad64c,_0x4538b0){var _0x339763=function(_0x2f13d6){while(--_0x2f13d6){_0xad64c['push'](_0xad64c['shift']());}};_0x339763(++_0x4538b0);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x23efce,_0x3abeb1){_0x23efce=_0x23efce-0x0;var _0x121d0e=_0x6f0d[_0x23efce];return _0x121d0e;};'use strict';var client=require('../client');exports[_0xd6f0('0x0')]=function(_0x64ebf2){return client[_0xd6f0('0x1')](_0xd6f0('0x2'),{'body':_0x64ebf2,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0x54ef=['CreateOpenchannelMessage','createOpenchannelMessage','../client','create'];(function(_0x26fb63,_0x4ca3aa){var _0x332db4=function(_0x357e4d){while(--_0x357e4d){_0x26fb63['push'](_0x26fb63['shift']());}};_0x332db4(++_0x4ca3aa);}(_0x54ef,0x112));var _0xf54e=function(_0x35cc58,_0x5334ff){_0x35cc58=_0x35cc58-0x0;var _0x1dff68=_0x54ef[_0x35cc58];return _0x1dff68;};'use strict';var client=require(_0xf54e('0x0'));exports[_0xf54e('0x1')]=function(_0x12c070){return client['Request'](_0xf54e('0x2'),{'body':_0x12c070,'log':_0xf54e('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 3aba890..6f8b1b3 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 _0xe3d6=['timeout','strategy','User','online','getOpenchannelQueues','../client','GetOpenchannelQueue','name'];(function(_0x2d6197,_0x82ebfb){var _0x4d0e75=function(_0x577e7a){while(--_0x577e7a){_0x2d6197['push'](_0x2d6197['shift']());}};_0x4d0e75(++_0x82ebfb);}(_0xe3d6,0x165));var _0x6e3d=function(_0x12e509,_0x503590){_0x12e509=_0x12e509-0x0;var _0x5eddc9=_0xe3d6[_0x12e509];return _0x5eddc9;};'use strict';var client=require(_0x6e3d('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client['Request'](_0x6e3d('0x1'),{'options':{'raw':![],'attributes':['id',_0x6e3d('0x2'),_0x6e3d('0x3'),_0x6e3d('0x4')],'include':[{'model':_0x6e3d('0x5'),'as':'Agents','attributes':['id',_0x6e3d('0x2'),_0x6e3d('0x6'),'openchannelPause']}]},'log':_0x6e3d('0x7')});};}; \ No newline at end of file +var _0x45a5=['getOpenchannelQueues','Request','GetOpenchannelQueue','timeout','User','Agents','openchannelPause','../client'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x45a5,0x12f));var _0x545a=function(_0x57c7e1,_0x2268a3){_0x57c7e1=_0x57c7e1-0x0;var _0x1d9684=_0x45a5[_0x57c7e1];return _0x1d9684;};'use strict';var client=require(_0x545a('0x0'));exports[_0x545a('0x1')]=function(){return function(){return client[_0x545a('0x2')](_0x545a('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x545a('0x4'),'strategy'],'include':[{'model':_0x545a('0x5'),'as':_0x545a('0x6'),'attributes':['id','name','online',_0x545a('0x7')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 6d06a0f..4fbcf1b 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 _0xe4e7=['update','Request','UpdateOpenchannelQueueReport','../client','CreateOpenchannelQueueReport'];(function(_0x4bff20,_0x5107ff){var _0x2291e8=function(_0x33e8d7){while(--_0x33e8d7){_0x4bff20['push'](_0x4bff20['shift']());}};_0x2291e8(++_0x5107ff);}(_0xe4e7,0xb2));var _0x7e4e=function(_0x78f045,_0x1a9f62){_0x78f045=_0x78f045-0x0;var _0x1cf0d5=_0xe4e7[_0x78f045];return _0x1cf0d5;};'use strict';var client=require(_0x7e4e('0x0'));exports['create']=function(_0x290b38){return client['Request'](_0x7e4e('0x1'),{'body':_0x290b38,'log':'CreateOpenchannelQueueReport'});};exports[_0x7e4e('0x2')]=function(_0x50aae2,_0x3c9469){return client[_0x7e4e('0x3')]('UpdateOpenchannelQueueReport',{'body':_0x3c9469,'options':{'where':{'uniqueid':_0x50aae2},'order':[['id','DESC']],'limit':0x1},'log':_0x7e4e('0x4')});}; \ No newline at end of file +var _0xa5de=['update','UpdateOpenchannelQueueReport','DESC','../client','CreateOpenchannelQueueReport'];(function(_0x15b5a3,_0x585539){var _0x430f53=function(_0x2344f2){while(--_0x2344f2){_0x15b5a3['push'](_0x15b5a3['shift']());}};_0x430f53(++_0x585539);}(_0xa5de,0x15c));var _0xea5d=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xa5de[_0x2b5eae];return _0x5f3ac9;};'use strict';var client=require(_0xea5d('0x0'));exports['create']=function(_0x12e69c){return client['Request'](_0xea5d('0x1'),{'body':_0x12e69c,'log':'CreateOpenchannelQueueReport'});};exports[_0xea5d('0x2')]=function(_0x3e2cd2,_0xae07d0){return client['Request'](_0xea5d('0x3'),{'body':_0xae07d0,'options':{'where':{'uniqueid':_0x3e2cd2},'order':[['id',_0xea5d('0x4')]],'limit':0x1},'log':_0xea5d('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 02d2be4..5c54a0d 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 _0xb980=['UpdateSmsInteraction','updateSmsInteraction','AddTagsToSmsInteraction','../client','update','Request'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xb980,0xf9));var _0x0b98=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb980[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x0b98('0x0'));exports[_0x0b98('0x1')]=function(_0x501041,_0x46c93c){return client[_0x0b98('0x2')](_0x0b98('0x3'),{'body':_0x46c93c,'options':{'where':{'id':_0x501041}},'log':_0x0b98('0x4')});};exports['addTags']=function(_0x1f2191,_0x3c791b){return client['Request'](_0x0b98('0x5'),{'body':_0x3c791b,'options':{'where':{'id':_0x1f2191}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x3783=['updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','update','Request','UpdateSmsInteraction'];(function(_0x21ada7,_0x5da8b0){var _0x4be56c=function(_0x44513b){while(--_0x44513b){_0x21ada7['push'](_0x21ada7['shift']());}};_0x4be56c(++_0x5da8b0);}(_0x3783,0x1dd));var _0x3378=function(_0x521f75,_0x360b91){_0x521f75=_0x521f75-0x0;var _0x3a7c62=_0x3783[_0x521f75];return _0x3a7c62;};'use strict';var client=require('../client');exports[_0x3378('0x0')]=function(_0x422a0,_0x2b1b03){return client[_0x3378('0x1')](_0x3378('0x2'),{'body':_0x2b1b03,'options':{'where':{'id':_0x422a0}},'log':_0x3378('0x3')});};exports['addTags']=function(_0x370f94,_0x16377b){return client['Request'](_0x3378('0x4'),{'body':_0x16377b,'options':{'where':{'id':_0x370f94}},'log':_0x3378('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 72a99c8..5e1a5f2 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 _0x2139=['createSmsMessage','../client','CreateSmsMessage'];(function(_0x562bba,_0x8d929){var _0x2a1d2e=function(_0x1e4700){while(--_0x1e4700){_0x562bba['push'](_0x562bba['shift']());}};_0x2a1d2e(++_0x8d929);}(_0x2139,0x1a5));var _0x9213=function(_0x3993f0,_0x40c90e){_0x3993f0=_0x3993f0-0x0;var _0x4545d9=_0x2139[_0x3993f0];return _0x4545d9;};'use strict';var client=require(_0x9213('0x0'));exports['create']=function(_0x27117d){return client['Request'](_0x9213('0x1'),{'body':_0x27117d,'log':_0x9213('0x2')});}; \ No newline at end of file +var _0xfab4=['Request','CreateSmsMessage','create'];(function(_0x5bab31,_0x1bd678){var _0x2c091c=function(_0x16ec54){while(--_0x16ec54){_0x5bab31['push'](_0x5bab31['shift']());}};_0x2c091c(++_0x1bd678);}(_0xfab4,0x1c7));var _0x4fab=function(_0x51fbb8,_0x3f9352){_0x51fbb8=_0x51fbb8-0x0;var _0x332188=_0xfab4[_0x51fbb8];return _0x332188;};'use strict';var client=require('../client');exports[_0x4fab('0x0')]=function(_0x457e47){return client[_0x4fab('0x1')](_0x4fab('0x2'),{'body':_0x457e47,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 5d5b3ff..5fa4a92 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 _0x9fa0=['Agents','online','getSmsQueues','GetSmsQueue','name','timeout','strategy'];(function(_0x259835,_0x34ff5c){var _0x48479e=function(_0x1e273f){while(--_0x1e273f){_0x259835['push'](_0x259835['shift']());}};_0x48479e(++_0x34ff5c);}(_0x9fa0,0x6c));var _0x09fa=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0x9fa0[_0x4bc65f];return _0x44f85f;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client['Request'](_0x09fa('0x0'),{'options':{'raw':![],'attributes':['id',_0x09fa('0x1'),_0x09fa('0x2'),_0x09fa('0x3')],'include':[{'model':'User','as':_0x09fa('0x4'),'attributes':['id',_0x09fa('0x1'),_0x09fa('0x5'),'smsPause']}]},'log':_0x09fa('0x6')});};}; \ No newline at end of file +var _0xf445=['../client','getSmsQueues','Request','GetSmsQueue','name','timeout','online','smsPause'];(function(_0x18000d,_0x468002){var _0xd06ac0=function(_0xf24e58){while(--_0xf24e58){_0x18000d['push'](_0x18000d['shift']());}};_0xd06ac0(++_0x468002);}(_0xf445,0xe8));var _0x5f44=function(_0xc69fda,_0x367f93){_0xc69fda=_0xc69fda-0x0;var _0x721842=_0xf445[_0xc69fda];return _0x721842;};'use strict';var client=require(_0x5f44('0x0'));exports[_0x5f44('0x1')]=function(){return function(){return client[_0x5f44('0x2')](_0x5f44('0x3'),{'options':{'raw':![],'attributes':['id',_0x5f44('0x4'),_0x5f44('0x5'),'strategy'],'include':[{'model':'User','as':'Agents','attributes':['id','name',_0x5f44('0x6'),_0x5f44('0x7')]}]},'log':_0x5f44('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 95313d3..3ff5107 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 _0x624a=['CreateSmsQueueReport','update','UpdateSmsQueueReport','create','Request'];(function(_0x232d96,_0x31f394){var _0x4af075=function(_0x15c995){while(--_0x15c995){_0x232d96['push'](_0x232d96['shift']());}};_0x4af075(++_0x31f394);}(_0x624a,0x143));var _0xa624=function(_0x55054d,_0x35adc6){_0x55054d=_0x55054d-0x0;var _0x5324fa=_0x624a[_0x55054d];return _0x5324fa;};'use strict';var client=require('../client');exports[_0xa624('0x0')]=function(_0x48b4ee){return client[_0xa624('0x1')](_0xa624('0x2'),{'body':_0x48b4ee,'log':_0xa624('0x2')});};exports[_0xa624('0x3')]=function(_0x5b55d0,_0x5d780c){return client[_0xa624('0x1')]('UpdateSmsQueueReport',{'body':_0x5d780c,'options':{'where':{'uniqueid':_0x5b55d0},'order':[['id','DESC']],'limit':0x1},'log':_0xa624('0x4')});}; \ No newline at end of file +var _0x8d5e=['../client','create','Request','CreateSmsQueueReport','UpdateSmsQueueReport','DESC'];(function(_0x2357cb,_0x3d2122){var _0x2ce8c9=function(_0x3339d2){while(--_0x3339d2){_0x2357cb['push'](_0x2357cb['shift']());}};_0x2ce8c9(++_0x3d2122);}(_0x8d5e,0xf6));var _0xe8d5=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x8d5e[_0x376b45];return _0x2341b3;};'use strict';var client=require(_0xe8d5('0x0'));exports[_0xe8d5('0x1')]=function(_0x60fdeb){return client[_0xe8d5('0x2')](_0xe8d5('0x3'),{'body':_0x60fdeb,'log':_0xe8d5('0x3')});};exports['update']=function(_0x4d76d2,_0x6d3607){return client[_0xe8d5('0x2')](_0xe8d5('0x4'),{'body':_0x6d3607,'options':{'where':{'uniqueid':_0x4d76d2},'order':[['id',_0xe8d5('0x5')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 1975a1b..af9335b 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 _0x54f7=['chatCapacity','mailCapacity','faxCapacity','smsCapacity','openchannelCapacity','../client','getAgents','Request','agent','name','online','lastPauseAt','voicePause','chatPause','smsPause','openchannelPause'];(function(_0x567883,_0x3e80ca){var _0x5429d8=function(_0x1486bc){while(--_0x1486bc){_0x567883['push'](_0x567883['shift']());}};_0x5429d8(++_0x3e80ca);}(_0x54f7,0x85));var _0x754f=function(_0x5b3117,_0xdc252d){_0x5b3117=_0x5b3117-0x0;var _0x934b63=_0x54f7[_0x5b3117];return _0x934b63;};'use strict';var client=require(_0x754f('0x0'));exports[_0x754f('0x1')]=function(){return function(){return client[_0x754f('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':_0x754f('0x3')},'attributes':['id',_0x754f('0x4'),_0x754f('0x5'),'pauseType',_0x754f('0x6'),_0x754f('0x7'),_0x754f('0x8'),'mailPause','faxPause',_0x754f('0x9'),_0x754f('0xa'),_0x754f('0xb'),_0x754f('0xc'),_0x754f('0xd'),_0x754f('0xe'),_0x754f('0xf')]},'log':_0x754f('0x1')});};}; \ No newline at end of file +var _0x407d=['name','online','pauseType','mailPause','faxPause','smsPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity','smsCapacity','openchannelCapacity','getAgents','Request','agent'];(function(_0x19eddf,_0x3b50cf){var _0x1c10f6=function(_0x171010){while(--_0x171010){_0x19eddf['push'](_0x19eddf['shift']());}};_0x1c10f6(++_0x3b50cf);}(_0x407d,0x66));var _0xd407=function(_0x52150a,_0x216e2f){_0x52150a=_0x52150a-0x0;var _0x36d8c9=_0x407d[_0x52150a];return _0x36d8c9;};'use strict';var client=require('../client');exports[_0xd407('0x0')]=function(){return function(){return client[_0xd407('0x1')]('GetUser',{'options':{'raw':!![],'where':{'role':_0xd407('0x2')},'attributes':['id',_0xd407('0x3'),_0xd407('0x4'),_0xd407('0x5'),'lastPauseAt','voicePause','chatPause',_0xd407('0x6'),_0xd407('0x7'),_0xd407('0x8'),_0xd407('0x9'),_0xd407('0xa'),_0xd407('0xb'),_0xd407('0xc'),_0xd407('0xd'),_0xd407('0xe')]},'log':_0xd407('0x0')});};}; \ 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 b34f1c0..f51d298 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 _0x847a=['stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','info','format','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','message','agents','createQueue','atimeout','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s'];(function(_0x1d1823,_0x3bdc9c){var _0x202e3c=function(_0x1ae44f){while(--_0x1ae44f){_0x1d1823['push'](_0x1d1823['shift']());}};_0x202e3c(++_0x3bdc9c);}(_0x847a,0x81));var _0xa847=function(_0x521c78,_0x515d3f){_0x521c78=_0x521c78-0x0;var _0x255fff=_0x847a[_0x521c78];return _0x255fff;};'use strict';var schema=require(_0xa847('0x0'));var _=require(_0xa847('0x1'));var util=require(_0xa847('0x2'));var seqqueue=require(_0xa847('0x3'));var logger=require(_0xa847('0x4'))(_0xa847('0x5'));var strategy=require(_0xa847('0x6'));var queue=schema({'name':{'type':_0xa847('0x7'),'required':!![],'message':_0xa847('0x8')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x54e352,_0x2dcfc0,_0x491ede){return logger[_0xa847('0x9')](util[_0xa847('0xa')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x54e352,_0x2dcfc0[_0xa847('0xb')],_0x491ede));}function handleFindAgent(_0x63bd9a){return function(_0x101539){return _0x101539[_0xa847('0xb')]['toLowerCase']()===_0x63bd9a[_0xa847('0xc')]();};}exports[_0xa847('0xd')]=function(_0x56247b,_0x123a12,_0x3678ad,_0x1bb3af){return function(_0x1f2878){try{var _0xb56607={'name':_0x123a12[0x0],'timeout':_0x123a12[0x1]};var _0x237162=queue[_0xa847('0x0')](_0xb56607,{'typecast':!![]});if(_0x237162[_0xa847('0xe')]){logger[_0xa847('0xf')](_0xa847('0x10'),_0x56247b,_['map'](_0x237162,_0xa847('0x11'))['join'](',\x20'));_0x1f2878['stop']();}else{var _0x13ed41=_['find'](_0x3678ad[_0xa847('0x12')],handleFindAgent(_0xb56607[_0xa847('0xb')]));if(_0x13ed41){var _0x106bac=(_0xb56607['timeout']||0xa)*0x3e8;var _0x16e71f,_0x1bee92;var _0xf1bc4d=seqqueue[_0xa847('0x13')](_0x106bac);_0xf1bc4d['id']=_0x56247b;_0xf1bc4d[_0xa847('0x14')]=_0x106bac;_0xf1bc4d['channel']=_0x1bb3af['channel'];writeLog(_0x56247b,_0x13ed41,util[_0xa847('0xa')](_0xa847('0x15'),_0x106bac));_0x3678ad[_0xa847('0x16')][_0x56247b]['on'](_0xa847('0x17'),function(){logger[_0xa847('0x9')](_0xa847('0x18'),_0x56247b);clearTimeout(_0x1bee92);_0x1bee92=undefined;_0xf1bc4d[_0xa847('0x19')]();if(_0x3678ad[_0xa847('0x16')][_0x56247b]){delete _0x3678ad[_0xa847('0x16')][_0x56247b];}_0x1f2878['stop']();});_0x3678ad[_0xa847('0x16')][_0x56247b]['on'](_0xa847('0x1a'),function(){if(_0x3678ad[_0xa847('0x16')][_0x56247b]){delete _0x3678ad[_0xa847('0x16')][_0x56247b];}});_0x1bee92=setTimeout(function(){logger[_0xa847('0x9')]('[%s][AGENT]\x20ROUTING\x20END',_0x56247b);clearTimeout(_0x1bee92);_0xf1bc4d[_0xa847('0x19')]();_0x1f2878['next']();},_0x106bac);strategy[_0xa847('0x1b')](_0xf1bc4d,_0x13ed41,_0x3678ad,_0x1bb3af);}else{logger[_0xa847('0xf')](_0xa847('0x1c'),_0x56247b,_0xb56607[_0xa847('0xb')]);_0x1f2878['stop']();}}}catch(_0x598bfe){console[_0xa847('0x1d')](_0x598bfe);logger[_0xa847('0xf')](_0xa847('0x1e'),_0x56247b,_0x598bfe[_0xa847('0x1f')]);_0x1f2878['stop']();}};}; \ No newline at end of file +var _0x06ff=['format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','map','join','stop','agents','timeout','createQueue','atimeout','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info'];(function(_0x43b132,_0x292578){var _0xab28d6=function(_0x5cd26f){while(--_0x5cd26f){_0x43b132['push'](_0x43b132['shift']());}};_0xab28d6(++_0x292578);}(_0x06ff,0x11e));var _0xf06f=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x06ff[_0x46e363];return _0x3fb059;};'use strict';var schema=require(_0xf06f('0x0'));var _=require(_0xf06f('0x1'));var util=require(_0xf06f('0x2'));var seqqueue=require(_0xf06f('0x3'));var logger=require('../../../../config/logger')(_0xf06f('0x4'));var strategy=require(_0xf06f('0x5'));var queue=schema({'name':{'type':_0xf06f('0x6'),'required':!![],'message':_0xf06f('0x7')},'timeout':{'type':_0xf06f('0x8'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x524463,_0x5b3fb9,_0x42d816){return logger[_0xf06f('0x9')](util[_0xf06f('0xa')](_0xf06f('0xb'),_0x524463,_0x5b3fb9[_0xf06f('0xc')],_0x42d816));}function handleFindAgent(_0x48782b){return function(_0x2f690c){return _0x2f690c[_0xf06f('0xc')][_0xf06f('0xd')]()===_0x48782b['toLowerCase']();};}exports[_0xf06f('0xe')]=function(_0x4dec5f,_0x26ad09,_0x47055f,_0x20d94b){return function(_0x5bfaf9){try{var _0x54faf3={'name':_0x26ad09[0x0],'timeout':_0x26ad09[0x1]};var _0x4f7be1=queue[_0xf06f('0x0')](_0x54faf3,{'typecast':!![]});if(_0x4f7be1[_0xf06f('0xf')]){logger['error']('[%s][AGENT]\x20%s',_0x4dec5f,_[_0xf06f('0x10')](_0x4f7be1,'message')[_0xf06f('0x11')](',\x20'));_0x5bfaf9[_0xf06f('0x12')]();}else{var _0x386c41=_['find'](_0x47055f[_0xf06f('0x13')],handleFindAgent(_0x54faf3[_0xf06f('0xc')]));if(_0x386c41){var _0x26ddf4=(_0x54faf3[_0xf06f('0x14')]||0xa)*0x3e8;var _0x67a149,_0x25689a;var _0x2208e0=seqqueue[_0xf06f('0x15')](_0x26ddf4);_0x2208e0['id']=_0x4dec5f;_0x2208e0[_0xf06f('0x16')]=_0x26ddf4;_0x2208e0['channel']=_0x20d94b['channel'];writeLog(_0x4dec5f,_0x386c41,util['format'](_0xf06f('0x17'),_0x26ddf4));_0x47055f[_0xf06f('0x18')][_0x4dec5f]['on'](_0xf06f('0x19'),function(){logger['info'](_0xf06f('0x1a'),_0x4dec5f);clearTimeout(_0x25689a);_0x25689a=undefined;_0x2208e0['close']();if(_0x47055f['rules'][_0x4dec5f]){delete _0x47055f['rules'][_0x4dec5f];}_0x5bfaf9['stop']();});_0x47055f[_0xf06f('0x18')][_0x4dec5f]['on'](_0xf06f('0x1b'),function(){if(_0x47055f[_0xf06f('0x18')][_0x4dec5f]){delete _0x47055f[_0xf06f('0x18')][_0x4dec5f];}});_0x25689a=setTimeout(function(){logger[_0xf06f('0x9')](_0xf06f('0x1c'),_0x4dec5f);clearTimeout(_0x25689a);_0x2208e0[_0xf06f('0x1d')]();_0x5bfaf9[_0xf06f('0x1e')]();},_0x26ddf4);strategy[_0xf06f('0x1f')](_0x2208e0,_0x386c41,_0x47055f,_0x20d94b);}else{logger[_0xf06f('0x20')](_0xf06f('0x21'),_0x4dec5f,_0x54faf3['name']);_0x5bfaf9[_0xf06f('0x12')]();}}}catch(_0x43993c){console[_0xf06f('0x22')](_0x43993c);logger['error'](_0xf06f('0x23'),_0x4dec5f,_0x43993c[_0xf06f('0x24')]);_0x5bfaf9[_0xf06f('0x12')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 33024fc..944d3cc 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 _0x48ec=['../../../../config/logger','routing','../../rpc/openchannelMessage','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','Message','create','then','[%s][AMAZONLEX]\x20%s','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','$LATEST','postText','message','amazonlex','dialogState','Failed','lodash','moment','aws-sdk','./utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x48ec,0x196));var _0xc48e=function(_0xe1b14b,_0x275799){_0xe1b14b=_0xe1b14b-0x0;var _0x21da52=_0x48ec[_0xe1b14b];return _0x21da52;};'use strict';var _=require(_0xc48e('0x0'));var moment=require(_0xc48e('0x1'));var AWS=require(_0xc48e('0x2'));var utils=require(_0xc48e('0x3'));var logger=require(_0xc48e('0x4'))(_0xc48e('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xc48e('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage')};exports['consequence']=function(_0x3e1b36,_0xb953aa){return function(_0xd5317e){try{if(!_[_0xc48e('0x7')](this[_0xc48e('0x8')][_0xc48e('0x9')])){logger[_0xc48e('0xa')]('[%s][AMAZONLEX]\x20%s',_0x3e1b36,_0xc48e('0xb'));return _0xd5317e[_0xc48e('0xc')]();}var _0x32f409={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0xc48e('0xd')),'direction':_0xc48e('0xe')};var _0x42057b=this[_0xc48e('0xf')];if(_0x42057b===_0xc48e('0x10')){_0x32f409['ChatWebsiteId']=this[_0xc48e('0x11')]['id'];}else{_0x32f409[_[_0xc48e('0x12')](_0x42057b)+_0xc48e('0x13')]=this[_0xc48e('0x11')]['id'];}_0x32f409[_[_0xc48e('0x12')](_0x42057b)+_0xc48e('0x14')]=this[_0xc48e('0x8')]['id'];if(this[_0xc48e('0x8')][_0xc48e('0x15')]){var _0x33cb96=_0xb953aa[0x4];if(!_[_0xc48e('0x16')](_0x33cb96)){_0x32f409[_0xc48e('0x17')]=utils['getMustacheRender'](_0x33cb96,this);return rpc[_0x42057b+_0xc48e('0x18')][_0xc48e('0x19')](_0x32f409)[_0xc48e('0x1a')](function(_0x5b64b3){logger['info'](_0xc48e('0x1b'),_0x3e1b36,_0x32f409[_0xc48e('0x17')]);})[_0xc48e('0x1c')](function(_0x51a034){logger[_0xc48e('0x1d')](_0xc48e('0x1b'),_0x3e1b36,JSON[_0xc48e('0x1e')](_0x51a034));})[_0xc48e('0x1f')](function(){logger[_0xc48e('0xa')](_0xc48e('0x20'),_0x3e1b36);_0xd5317e['stop']();});}else{logger['info'](_0xc48e('0x21'),_0x3e1b36);_0xd5317e[_0xc48e('0x22')]();}}else{var _0x167e32=this;var _0x260396=new AWS['LexRuntime']({'accessKeyId':_0xb953aa[0x0],'secretAccessKey':_0xb953aa[0x1],'region':_0xb953aa[0x2]});var _0x1c6a67={'botAlias':_0xc48e('0x23'),'botName':_0xb953aa[0x3],'inputText':this['message'][_0xc48e('0x17')],'userId':this[_0xc48e('0x8')]['id']['toString']()};_0x260396[_0xc48e('0x24')](_0x1c6a67,function(_0x22c8fe,_0x360139){if(_0x22c8fe){logger[_0xc48e('0x1d')](_0xc48e('0x1b'),_0x3e1b36,_0x22c8fe[_0xc48e('0x25')]);_0xd5317e[_0xc48e('0xc')]();}else if(_0x360139&&_0x360139[_0xc48e('0x25')]){_0x167e32[_0xc48e('0x17')][_0xc48e('0x26')]=_0x360139;_0x32f409[_0xc48e('0x17')]=_0x360139['message'];return rpc[_0x42057b+_0xc48e('0x18')][_0xc48e('0x19')](_0x32f409)[_0xc48e('0x1a')](function(_0x1ee536){logger[_0xc48e('0xa')](_0xc48e('0x1b'),_0x3e1b36,_0x32f409['body']);if(_0x360139[_0xc48e('0x27')]==_0xc48e('0x28')){_0xd5317e['next']();}else{_0xd5317e[_0xc48e('0x22')]();}})[_0xc48e('0x1c')](function(_0x2a3090){logger['error'](_0xc48e('0x1b'),_0x3e1b36,JSON['stringify'](_0x2a3090));_0xd5317e[_0xc48e('0xc')]();});}else{_0xd5317e['next']();}});}}catch(_0x17aaf7){logger[_0xc48e('0x1d')]('[%s][AMAZONLEX]\x20%s',_0x3e1b36,JSON[_0xc48e('0x1e')](_0x17aaf7));_0xd5317e[_0xc48e('0x22')]();}};}; \ No newline at end of file +var _0x93e7=['LexRuntime','$LATEST','message','error','next','dialogState','Failed','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','out','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','body','getMustacheRender','Message','create','then','info','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0x93e7,0x15f));var _0x793e=function(_0x9d1e6b,_0x3bdc22){_0x9d1e6b=_0x9d1e6b-0x0;var _0x2b3070=_0x93e7[_0x9d1e6b];return _0x2b3070;};'use strict';var _=require('lodash');var moment=require(_0x793e('0x0'));var AWS=require(_0x793e('0x1'));var utils=require(_0x793e('0x2'));var logger=require(_0x793e('0x3'))(_0x793e('0x4'));var rpc={'chatMessage':require(_0x793e('0x5')),'openchannelMessage':require(_0x793e('0x6')),'mailMessage':require(_0x793e('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage')};exports['consequence']=function(_0x407a7c,_0x3a0ca9){return function(_0x1c496b){try{if(!_[_0x793e('0x8')](this[_0x793e('0x9')][_0x793e('0xa')])){logger['info'](_0x793e('0xb'),_0x407a7c,_0x793e('0xc'));return _0x1c496b['next']();}var _0x2c66a1={'ContactId':this[_0x793e('0xd')]['id'],'sentAt':moment()[_0x793e('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x793e('0xf')};var _0xfdc658=this[_0x793e('0x10')];if(_0xfdc658===_0x793e('0x11')){_0x2c66a1[_0x793e('0x12')]=this[_0x793e('0x13')]['id'];}else{_0x2c66a1[_[_0x793e('0x14')](_0xfdc658)+_0x793e('0x15')]=this['account']['id'];}_0x2c66a1[_[_0x793e('0x14')](_0xfdc658)+'InteractionId']=this[_0x793e('0x9')]['id'];if(this[_0x793e('0x9')][_0x793e('0x16')]){var _0x220671=_0x3a0ca9[0x4];if(!_[_0x793e('0x17')](_0x220671)){_0x2c66a1[_0x793e('0x18')]=utils[_0x793e('0x19')](_0x220671,this);return rpc[_0xfdc658+_0x793e('0x1a')][_0x793e('0x1b')](_0x2c66a1)[_0x793e('0x1c')](function(_0x1f74ca){logger[_0x793e('0x1d')](_0x793e('0xb'),_0x407a7c,_0x2c66a1[_0x793e('0x18')]);})[_0x793e('0x1e')](function(_0x23589d){logger['error'](_0x793e('0xb'),_0x407a7c,JSON[_0x793e('0x1f')](_0x23589d));})[_0x793e('0x20')](function(){logger[_0x793e('0x1d')](_0x793e('0x21'),_0x407a7c);_0x1c496b['stop']();});}else{logger['info'](_0x793e('0x22'),_0x407a7c);_0x1c496b[_0x793e('0x23')]();}}else{var _0x2a7207=this;var _0x34bd3f=new AWS[(_0x793e('0x24'))]({'accessKeyId':_0x3a0ca9[0x0],'secretAccessKey':_0x3a0ca9[0x1],'region':_0x3a0ca9[0x2]});var _0x5d117e={'botAlias':_0x793e('0x25'),'botName':_0x3a0ca9[0x3],'inputText':this[_0x793e('0x26')][_0x793e('0x18')],'userId':this[_0x793e('0x9')]['id']['toString']()};_0x34bd3f['postText'](_0x5d117e,function(_0x183808,_0x4621f0){if(_0x183808){logger[_0x793e('0x27')]('[%s][AMAZONLEX]\x20%s',_0x407a7c,_0x183808['message']);_0x1c496b[_0x793e('0x28')]();}else if(_0x4621f0&&_0x4621f0['message']){_0x2a7207[_0x793e('0x18')]['amazonlex']=_0x4621f0;_0x2c66a1[_0x793e('0x18')]=_0x4621f0['message'];return rpc[_0xfdc658+_0x793e('0x1a')]['create'](_0x2c66a1)[_0x793e('0x1c')](function(_0x172e0c){logger[_0x793e('0x1d')](_0x793e('0xb'),_0x407a7c,_0x2c66a1[_0x793e('0x18')]);if(_0x4621f0[_0x793e('0x29')]==_0x793e('0x2a')){_0x1c496b['next']();}else{_0x1c496b[_0x793e('0x23')]();}})['catch'](function(_0x4256ed){logger[_0x793e('0x27')](_0x793e('0xb'),_0x407a7c,JSON[_0x793e('0x1f')](_0x4256ed));_0x1c496b[_0x793e('0x28')]();});}else{_0x1c496b[_0x793e('0x28')]();}});}}catch(_0x5cdcf8){logger[_0x793e('0x27')]('[%s][AMAZONLEX]\x20%s',_0x407a7c,JSON[_0x793e('0x1f')](_0x5cdcf8));_0x1c496b[_0x793e('0x23')]();}};}; \ 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 48fe345..9659f6b 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 _0xa9e0=['messageId','html','replace','body',''+_[_0x0a9e('0x29')](_0xbd1168[_0x0a9e('0x2a')],_0x0a9e('0x2b'),_0x0a9e('0x2c'))+'';return mailRpc[_0x0a9e('0x2d')](_0x20f109,_0xbd1168)[_0x0a9e('0x2e')](function(_0x1843b2){logger[_0x0a9e('0x2f')](_0x0a9e('0x30'),_0x57b080);_0xbd1168[_0x0a9e('0x27')]=_0x1843b2[_0x0a9e('0x10')][_0x0a9e('0x27')];return rpc[_0x3ab53f+_0x0a9e('0x1d')]['create'](_0xbd1168);})[_0x0a9e('0x2e')](function(_0x5d1e0e){logger[_0x0a9e('0x2f')](_0x0a9e('0xb'),_0x57b080,JSON[_0x0a9e('0x31')](_0x5d1e0e));})[_0x0a9e('0x32')](function(_0x25ce3a){logger['error'](_0x0a9e('0x33'),_0x57b080,JSON[_0x0a9e('0x31')](_0x25ce3a));})[_0x0a9e('0x34')](function(){_0x441e3a[_0x0a9e('0xd')]();});}else{return rpc[this[_0x0a9e('0xe')]+_0x0a9e('0x1d')][_0x0a9e('0x35')](_0xbd1168)[_0x0a9e('0x2e')](function(_0x5583a4){logger[_0x0a9e('0x2f')]('[%s][AUTOREPLY]\x20%s',_0x57b080,_0xbd1168[_0x0a9e('0x2a')]);})[_0x0a9e('0x32')](function(_0x2b7e7f){logger[_0x0a9e('0x36')]('[%s][AUTOREPLY]\x20%s',_0x57b080,JSON[_0x0a9e('0x31')](_0x2b7e7f));})[_0x0a9e('0x34')](function(){_0x441e3a[_0x0a9e('0xd')]();});}}}catch(_0x15de0e){logger['error']('[%s][AUTOREPLY]\x20%s',_0x57b080,JSON[_0x0a9e('0x31')](_0x15de0e));_0x441e3a['stop']();}};}; \ No newline at end of file +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 diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 70ab787..ffc41ae 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x73a1=['stop','routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','stringify','finally','[%s][CLOSE]\x20%s'];(function(_0x4c1be6,_0x134eeb){var _0x4f453c=function(_0x197fc1){while(--_0x197fc1){_0x4c1be6['push'](_0x4c1be6['shift']());}};_0x4f453c(++_0x134eeb);}(_0x73a1,0x161));var _0x173a=function(_0x44fef1,_0x132cf4){_0x44fef1=_0x44fef1-0x0;var _0x3c3a04=_0x73a1[_0x44fef1];return _0x3c3a04;};'use strict';var moment=require('moment');var logger=require('../../../../config/logger')(_0x173a('0x0'));var rpc={'chatInteraction':require(_0x173a('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x173a('0x2')),'mailInteraction':require(_0x173a('0x3')),'faxInteraction':require(_0x173a('0x4'))};exports[_0x173a('0x5')]=function(_0x4a3f0f,_0x57edf4,_0x417ec0,_0x1a8b94){return function(_0xac84a){try{logger[_0x173a('0x6')](_0x173a('0x7'),_0x4a3f0f,_0x57edf4[0x0]);var _0x550e2b={'closed':0x1,'closedAt':moment()[_0x173a('0x8')](_0x173a('0x9')),'closeReason':_0x173a('0xa'),'disposition':_0x57edf4[0x0]};if(rpc[_0x1a8b94[_0x173a('0xb')]+_0x173a('0xc')]){rpc[_0x1a8b94[_0x173a('0xb')]+'Interaction'][_0x173a('0xd')](_0x1a8b94['interaction']['id'],_0x550e2b)[_0x173a('0xe')](function(_0x101aeb){logger[_0x173a('0x6')](_0x173a('0xf'),_0x4a3f0f,_0x1a8b94['interaction']['id']);})[_0x173a('0x10')](function(_0x53bfd0){logger[_0x173a('0x11')]('[%s][CLOSE]\x20%s',_0x4a3f0f,JSON[_0x173a('0x12')](_0x53bfd0));})[_0x173a('0x13')](function(){_0xac84a['stop']();});}}catch(_0x1cbfdc){logger[_0x173a('0x11')](_0x173a('0x14'),_0x4a3f0f,JSON[_0x173a('0x12')](_0x1cbfdc));_0xac84a[_0x173a('0x15')]();}};}; \ No newline at end of file +var _0x8227=['interaction','catch','error','[%s][CLOSE]\x20%s','stop','stringify','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','system','channel','Interaction','update','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!'];(function(_0x4595c7,_0x1dfd25){var _0x506697=function(_0x1c8196){while(--_0x1c8196){_0x4595c7['push'](_0x4595c7['shift']());}};_0x506697(++_0x1dfd25);}(_0x8227,0x146));var _0x7822=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8227[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require('moment');var logger=require(_0x7822('0x0'))('routing');var rpc={'chatInteraction':require(_0x7822('0x1')),'openchannelInteraction':require(_0x7822('0x2')),'smsInteraction':require(_0x7822('0x3')),'mailInteraction':require(_0x7822('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};exports[_0x7822('0x5')]=function(_0x335529,_0x3b5dc2,_0x1173b1,_0x38f333){return function(_0x1ae126){try{logger[_0x7822('0x6')](_0x7822('0x7'),_0x335529,_0x3b5dc2[0x0]);var _0x4c5213={'closed':0x1,'closedAt':moment()[_0x7822('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x7822('0x9'),'disposition':_0x3b5dc2[0x0]};if(rpc[_0x38f333[_0x7822('0xa')]+_0x7822('0xb')]){rpc[_0x38f333[_0x7822('0xa')]+_0x7822('0xb')][_0x7822('0xc')](_0x38f333['interaction']['id'],_0x4c5213)['then'](function(_0x270416){logger['info'](_0x7822('0xd'),_0x335529,_0x38f333[_0x7822('0xe')]['id']);})[_0x7822('0xf')](function(_0xba69e4){logger[_0x7822('0x10')](_0x7822('0x11'),_0x335529,JSON['stringify'](_0xba69e4));})['finally'](function(){_0x1ae126[_0x7822('0x12')]();});}}catch(_0x10703c){logger['error'](_0x7822('0x11'),_0x335529,JSON[_0x7822('0x13')](_0x10703c));_0x1ae126[_0x7822('0x12')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index d8c9348..9ccd423 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x40a0=['lodash','apiai-promise','md5','./utils','../../rpc/chatMessage','consequence','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','interaction','created','isEmpty','body','getMustacheRender','Message','then','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','fulfillment','speech','create','result','metadata','endConversation','next','stop','catch','error'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x40a0,0x81));var _0x040a=function(_0x590851,_0x496bee){_0x590851=_0x590851-0x0;var _0x3b0115=_0x40a0[_0x590851];return _0x3b0115;};'use strict';var _=require(_0x040a('0x0'));var moment=require('moment');var apiai=require(_0x040a('0x1'));var md5=require(_0x040a('0x2'));var utils=require(_0x040a('0x3'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x040a('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage')};exports[_0x040a('0x5')]=function(_0x331e94,_0x533f58){return function(_0xa9416f){try{if(!_['isNil'](this['interaction']['UserId'])){logger[_0x040a('0x6')](_0x040a('0x7'),_0x331e94,_0x040a('0x8'));return _0xa9416f['next']();}var _0x1e4297={'ContactId':this[_0x040a('0x9')]['id'],'sentAt':moment()[_0x040a('0xa')](_0x040a('0xb')),'direction':_0x040a('0xc')};var _0x191e55=this[_0x040a('0xd')];if(_0x191e55===_0x040a('0xe')){_0x1e4297[_0x040a('0xf')]=this['account']['id'];}else{_0x1e4297[_[_0x040a('0x10')](_0x191e55)+_0x040a('0x11')]=this[_0x040a('0x12')]['id'];}_0x1e4297[_[_0x040a('0x10')](_0x191e55)+_0x040a('0x13')]=this[_0x040a('0x14')]['id'];if(this[_0x040a('0x14')][_0x040a('0x15')]){var _0x45e203=_0x533f58[0x2];if(!_[_0x040a('0x16')](_0x45e203)){_0x1e4297[_0x040a('0x17')]=utils[_0x040a('0x18')](_0x45e203,this);return rpc[_0x191e55+_0x040a('0x19')]['create'](_0x1e4297)[_0x040a('0x1a')](function(_0x2a01bd){logger[_0x040a('0x6')]('[%s][DIALOGFLOW]\x20%s',_0x331e94,_0x1e4297[_0x040a('0x17')]);})['catch'](function(_0x443d66){logger['error'](_0x040a('0x7'),_0x331e94,JSON[_0x040a('0x1b')](_0x443d66));})[_0x040a('0x1c')](function(){logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x331e94);_0xa9416f['stop']();});}else{logger[_0x040a('0x6')](_0x040a('0x1d'),_0x331e94);_0xa9416f['stop']();}}else{var _0x406c34=this;var _0x10922b=apiai(_0x533f58[0x0],{'language':_0x533f58[0x1]||'en'});return _0x10922b[_0x040a('0x1e')](this[_0x040a('0x1f')][_0x040a('0x17')],{'sessionId':md5(this[_0x040a('0x14')]['id'])})['then'](function(_0x50ad72){_0x406c34[_0x040a('0x17')][_0x040a('0x20')]=_0x50ad72;_0x1e4297[_0x040a('0x17')]=_0x50ad72['result'][_0x040a('0x21')][_0x040a('0x22')];return rpc[_0x191e55+'Message'][_0x040a('0x23')](_0x1e4297)['then'](function(_0x52d9f3){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x331e94,_0x1e4297['body']);if(_0x50ad72[_0x040a('0x24')][_0x040a('0x25')][_0x040a('0x26')]){_0xa9416f[_0x040a('0x27')]();}else{_0xa9416f[_0x040a('0x28')]();}})[_0x040a('0x29')](function(_0x2313ec){logger[_0x040a('0x2a')](_0x040a('0x7'),_0x331e94,JSON[_0x040a('0x1b')](_0x2313ec));_0xa9416f[_0x040a('0x27')]();});})[_0x040a('0x29')](function(_0x3cd0c8){logger['error'](_0x040a('0x7'),_0x331e94,_0x3cd0c8[_0x040a('0x1f')]);_0xa9416f['next']();});}}catch(_0x288e8a){logger[_0x040a('0x2a')](_0x040a('0x7'),_0x331e94,JSON[_0x040a('0x1b')](_0x288e8a));_0xa9416f[_0x040a('0x28')]();}};}; \ No newline at end of file +var _0x2b1f=['InteractionId','created','getMustacheRender','Message','create','then','info','body','catch','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','message','dialogflow','fulfillment','speech','result','endConversation','error','lodash','moment','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','[%s][DIALOGFLOW]\x20%s','next','contact','format','out','channel','upperFirst','account'];(function(_0x3a82f7,_0x1d8189){var _0x2304a0=function(_0x49ae6e){while(--_0x49ae6e){_0x3a82f7['push'](_0x3a82f7['shift']());}};_0x2304a0(++_0x1d8189);}(_0x2b1f,0x9a));var _0xf2b1=function(_0x20f100,_0x3b4602){_0x20f100=_0x20f100-0x0;var _0x598226=_0x2b1f[_0x20f100];return _0x598226;};'use strict';var _=require(_0xf2b1('0x0'));var moment=require(_0xf2b1('0x1'));var apiai=require('apiai-promise');var md5=require(_0xf2b1('0x2'));var utils=require(_0xf2b1('0x3'));var logger=require(_0xf2b1('0x4'))(_0xf2b1('0x5'));var rpc={'chatMessage':require(_0xf2b1('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xf2b1('0x7')),'smsMessage':require(_0xf2b1('0x8')),'faxMessage':require(_0xf2b1('0x9'))};exports[_0xf2b1('0xa')]=function(_0x2e68a3,_0xe2c3){return function(_0x44ff68){try{if(!_[_0xf2b1('0xb')](this[_0xf2b1('0xc')][_0xf2b1('0xd')])){logger['info'](_0xf2b1('0xe'),_0x2e68a3,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x44ff68[_0xf2b1('0xf')]();}var _0x921ebc={'ContactId':this[_0xf2b1('0x10')]['id'],'sentAt':moment()[_0xf2b1('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xf2b1('0x12')};var _0xa625a0=this[_0xf2b1('0x13')];if(_0xa625a0==='chat'){_0x921ebc['ChatWebsiteId']=this['account']['id'];}else{_0x921ebc[_[_0xf2b1('0x14')](_0xa625a0)+'AccountId']=this[_0xf2b1('0x15')]['id'];}_0x921ebc[_[_0xf2b1('0x14')](_0xa625a0)+_0xf2b1('0x16')]=this[_0xf2b1('0xc')]['id'];if(this[_0xf2b1('0xc')][_0xf2b1('0x17')]){var _0xa1c11d=_0xe2c3[0x2];if(!_['isEmpty'](_0xa1c11d)){_0x921ebc['body']=utils[_0xf2b1('0x18')](_0xa1c11d,this);return rpc[_0xa625a0+_0xf2b1('0x19')][_0xf2b1('0x1a')](_0x921ebc)[_0xf2b1('0x1b')](function(_0x2defd9){logger[_0xf2b1('0x1c')]('[%s][DIALOGFLOW]\x20%s',_0x2e68a3,_0x921ebc[_0xf2b1('0x1d')]);})[_0xf2b1('0x1e')](function(_0x2ae22b){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x2e68a3,JSON[_0xf2b1('0x1f')](_0x2ae22b));})[_0xf2b1('0x20')](function(){logger[_0xf2b1('0x1c')](_0xf2b1('0x21'),_0x2e68a3);_0x44ff68['stop']();});}else{logger[_0xf2b1('0x1c')](_0xf2b1('0x22'),_0x2e68a3);_0x44ff68[_0xf2b1('0x23')]();}}else{var _0xb1afa4=this;var _0x29cdad=apiai(_0xe2c3[0x0],{'language':_0xe2c3[0x1]||'en'});return _0x29cdad[_0xf2b1('0x24')](this[_0xf2b1('0x25')][_0xf2b1('0x1d')],{'sessionId':md5(this['interaction']['id'])})[_0xf2b1('0x1b')](function(_0x4b3566){_0xb1afa4[_0xf2b1('0x1d')][_0xf2b1('0x26')]=_0x4b3566;_0x921ebc[_0xf2b1('0x1d')]=_0x4b3566['result'][_0xf2b1('0x27')][_0xf2b1('0x28')];return rpc[_0xa625a0+'Message'][_0xf2b1('0x1a')](_0x921ebc)[_0xf2b1('0x1b')](function(_0x484383){logger[_0xf2b1('0x1c')](_0xf2b1('0xe'),_0x2e68a3,_0x921ebc[_0xf2b1('0x1d')]);if(_0x4b3566[_0xf2b1('0x29')]['metadata'][_0xf2b1('0x2a')]){_0x44ff68['next']();}else{_0x44ff68['stop']();}})['catch'](function(_0x336192){logger[_0xf2b1('0x2b')](_0xf2b1('0xe'),_0x2e68a3,JSON['stringify'](_0x336192));_0x44ff68[_0xf2b1('0xf')]();});})[_0xf2b1('0x1e')](function(_0x363915){logger['error'](_0xf2b1('0xe'),_0x2e68a3,_0x363915[_0xf2b1('0x25')]);_0x44ff68[_0xf2b1('0xf')]();});}}catch(_0x4cd1d9){logger['error'](_0xf2b1('0xe'),_0x2e68a3,JSON[_0xf2b1('0x1f')](_0x4cd1d9));_0x44ff68[_0xf2b1('0x23')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 7984ed8..48a2668 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa638=['condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','validate','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','priorityTrue','priorityFalse','info','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','routing'];(function(_0x24fa1a,_0x16d9c2){var _0xc5621f=function(_0x5616ac){while(--_0x5616ac){_0x24fa1a['push'](_0x24fa1a['shift']());}};_0xc5621f(++_0x16d9c2);}(_0xa638,0xa7));var _0x8a63=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xa638[_0x5d2803];return _0xdcad2c;};'use strict';var schema=require('validate');var _=require('lodash');var htmlToText=require('html-to-text');var utils=require('./utils');var logger=require('../../../../config/logger')(_0x8a63('0x0'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x8a63('0x1')},'priorityTrue':{'type':_0x8a63('0x2'),'message':_0x8a63('0x3')},'priorityFalse':{'type':_0x8a63('0x2'),'message':_0x8a63('0x4')}});exports['consequence']=function(_0x54f856,_0x27f094){return function(_0x50784e){try{var _0x9bc197={'condition':htmlToText[_0x8a63('0x5')](utils[_0x8a63('0x6')](_0x27f094[0x0],this),{'wordwrap':![]})[_0x8a63('0x7')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x27f094[0x1],'priorityFalse':_0x27f094[0x2]};var _0x3f28e6=gotoif[_0x8a63('0x8')](_0x9bc197,{'typecast':!![]});if(_0x3f28e6[_0x8a63('0x9')]){logger[_0x8a63('0xa')](_0x8a63('0xb'),_0x54f856,_[_0x8a63('0xc')](_0x3f28e6,_0x8a63('0xd'))[_0x8a63('0xe')](',\x20'));_0x50784e[_0x8a63('0xf')]();}else{try{var _0x5e9d68=eval('('+_0x9bc197['condition']+')');var _0x120412=_0x5e9d68?_0x9bc197[_0x8a63('0x10')]:_0x9bc197[_0x8a63('0x11')];logger[_0x8a63('0x12')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x54f856,_0x9bc197['condition'],_0x5e9d68,_0x120412||_0x8a63('0x13'));if(_0x120412){var _0x1fea11=_[_0x8a63('0x14')](_0x50784e[_0x8a63('0x15')](),{'p':_0x120412});if(_0x1fea11>=0x0){logger[_0x8a63('0x12')](_0x8a63('0x16'),_0x54f856,_0x120412||'next',_0x1fea11);_0x50784e[_0x8a63('0x13')](_0x1fea11);}else{logger['info'](_0x8a63('0x17'),_0x54f856,_0x120412||_0x8a63('0x13'));_0x50784e['stop']();}}else{_0x50784e[_0x8a63('0x13')]();}}catch(_0x3c2116){logger[_0x8a63('0xa')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x54f856,_0x3c2116[_0x8a63('0xd')]);_0x50784e[_0x8a63('0xf')]();}}}catch(_0x57e9fa){logger['error'](_0x8a63('0xb'),_0x54f856,JSON['stringify'](_0x57e9fa));_0x50784e['stop']();}};}; \ No newline at end of file +var _0x2518=['priority\x20true\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','message','join','stop','condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','number'];(function(_0x200aa5,_0x197802){var _0x458200=function(_0x594959){while(--_0x594959){_0x200aa5['push'](_0x200aa5['shift']());}};_0x458200(++_0x197802);}(_0x2518,0x1f1));var _0x8251=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x2518[_0x57b54c];return _0x59cc19;};'use strict';var schema=require(_0x8251('0x0'));var _=require(_0x8251('0x1'));var htmlToText=require(_0x8251('0x2'));var utils=require(_0x8251('0x3'));var logger=require(_0x8251('0x4'))(_0x8251('0x5'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x8251('0x6'),'message':_0x8251('0x7')},'priorityFalse':{'type':_0x8251('0x6'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x8251('0x8')]=function(_0x10bc97,_0x1d5171){return function(_0x25d957){try{var _0x292fa9={'condition':htmlToText[_0x8251('0x9')](utils[_0x8251('0xa')](_0x1d5171[0x0],this),{'wordwrap':![]})[_0x8251('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1d5171[0x1],'priorityFalse':_0x1d5171[0x2]};var _0x3db416=gotoif[_0x8251('0x0')](_0x292fa9,{'typecast':!![]});if(_0x3db416[_0x8251('0xc')]){logger['error'](_0x8251('0xd'),_0x10bc97,_['map'](_0x3db416,_0x8251('0xe'))[_0x8251('0xf')](',\x20'));_0x25d957[_0x8251('0x10')]();}else{try{var _0x4e877f=eval('('+_0x292fa9[_0x8251('0x11')]+')');var _0x8d1348=_0x4e877f?_0x292fa9['priorityTrue']:_0x292fa9[_0x8251('0x12')];logger[_0x8251('0x13')](_0x8251('0x14'),_0x10bc97,_0x292fa9[_0x8251('0x11')],_0x4e877f,_0x8d1348||_0x8251('0x15'));if(_0x8d1348){var _0x1c3326=_[_0x8251('0x16')](_0x25d957[_0x8251('0x17')](),{'p':_0x8d1348});if(_0x1c3326>=0x0){logger[_0x8251('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x10bc97,_0x8d1348||'next',_0x1c3326);_0x25d957[_0x8251('0x15')](_0x1c3326);}else{logger[_0x8251('0x13')](_0x8251('0x18'),_0x10bc97,_0x8d1348||'next');_0x25d957[_0x8251('0x10')]();}}else{_0x25d957[_0x8251('0x15')]();}}catch(_0x1c3fe1){logger[_0x8251('0x19')](_0x8251('0x1a'),_0x10bc97,_0x1c3fe1['message']);_0x25d957[_0x8251('0x10')]();}}}catch(_0xbba0a4){logger[_0x8251('0x19')](_0x8251('0xd'),_0x10bc97,JSON[_0x8251('0x1b')](_0xbba0a4));_0x25d957['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 0ecf3b7..e8ece0d 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 _0x95c0=['findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','validate','length','error','[%s][GOTOP]\x20%s','map','message','stop','info','priority'];(function(_0x1db1b5,_0x460358){var _0x19b558=function(_0x4258c0){while(--_0x4258c0){_0x1db1b5['push'](_0x1db1b5['shift']());}};_0x19b558(++_0x460358);}(_0x95c0,0x15b));var _0x095c=function(_0x3ec6c4,_0x1f6330){_0x3ec6c4=_0x3ec6c4-0x0;var _0x3926eb=_0x95c0[_0x3ec6c4];return _0x3926eb;};'use strict';var schema=require('validate');var _=require(_0x095c('0x0'));var logger=require(_0x095c('0x1'))(_0x095c('0x2'));var gotop=schema({'priority':{'type':_0x095c('0x3'),'required':!![],'message':_0x095c('0x4')}});exports['consequence']=function(_0x5821c3,_0x217394){return function(_0x330360){try{var _0x2601bf={'priority':_0x217394[0x0]};var _0x2ad681=gotop[_0x095c('0x5')](_0x2601bf,{'typecast':!![]});if(_0x2ad681[_0x095c('0x6')]){logger[_0x095c('0x7')](_0x095c('0x8'),_0x5821c3,_[_0x095c('0x9')](_0x2ad681,_0x095c('0xa'))['join'](',\x20'));_0x330360[_0x095c('0xb')]();}else{logger[_0x095c('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0x5821c3,_0x2601bf['priority']);if(_0x2601bf[_0x095c('0xd')]){var _0x3108ca=_[_0x095c('0xe')](_0x330360['rules'](),{'p':_0x2601bf[_0x095c('0xd')]});if(_0x3108ca>=0x0){logger['info'](_0x095c('0xf'),_0x5821c3,_0x2601bf['priority']||'next',_0x3108ca);_0x330360[_0x095c('0x10')](_0x3108ca);}else{logger[_0x095c('0xc')](_0x095c('0x11'),_0x5821c3,_0x2601bf[_0x095c('0xd')]||_0x095c('0x10'));_0x330360[_0x095c('0xb')]();}}else{_0x330360['next']();}}}catch(_0x479c98){logger[_0x095c('0x7')](_0x095c('0x8'),_0x5821c3,JSON[_0x095c('0x12')](_0x479c98));_0x330360['stop']();}};}; \ No newline at end of file +var _0x9452=['routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','join','info','[%s][GOTOP]\x20priority\x20%s','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','priority','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','error','stringify','validate','../../../../config/logger'];(function(_0x588038,_0x3d697e){var _0x1489bc=function(_0x234283){while(--_0x234283){_0x588038['push'](_0x588038['shift']());}};_0x1489bc(++_0x3d697e);}(_0x9452,0x10c));var _0x2945=function(_0x350f72,_0x3380e3){_0x350f72=_0x350f72-0x0;var _0x38b550=_0x9452[_0x350f72];return _0x38b550;};'use strict';var schema=require(_0x2945('0x0'));var _=require('lodash');var logger=require(_0x2945('0x1'))(_0x2945('0x2'));var gotop=schema({'priority':{'type':_0x2945('0x3'),'required':!![],'message':_0x2945('0x4')}});exports[_0x2945('0x5')]=function(_0xfb8c79,_0x29a2ed){return function(_0x4f793b){try{var _0x102d8f={'priority':_0x29a2ed[0x0]};var _0x40c939=gotop[_0x2945('0x0')](_0x102d8f,{'typecast':!![]});if(_0x40c939[_0x2945('0x6')]){logger['error']('[%s][GOTOP]\x20%s',_0xfb8c79,_['map'](_0x40c939,'message')[_0x2945('0x7')](',\x20'));_0x4f793b['stop']();}else{logger[_0x2945('0x8')](_0x2945('0x9'),_0xfb8c79,_0x102d8f['priority']);if(_0x102d8f['priority']){var _0x33b39b=_['findIndex'](_0x4f793b[_0x2945('0xa')](),{'p':_0x102d8f['priority']});if(_0x33b39b>=0x0){logger[_0x2945('0x8')](_0x2945('0xb'),_0xfb8c79,_0x102d8f[_0x2945('0xc')]||_0x2945('0xd'),_0x33b39b);_0x4f793b[_0x2945('0xd')](_0x33b39b);}else{logger[_0x2945('0x8')](_0x2945('0xe'),_0xfb8c79,_0x102d8f[_0x2945('0xc')]||'next');_0x4f793b[_0x2945('0xf')]();}}else{_0x4f793b[_0x2945('0xd')]();}}}catch(_0x2c03f5){logger[_0x2945('0x10')]('[%s][GOTOP]\x20%s',_0xfb8c79,JSON[_0x2945('0x11')](_0x2c03f5));_0x4f793b[_0x2945('0xf')]();}};}; \ 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 431bc7c..8b5c44b 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 _0xae8c=['../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','./utils'];(function(_0x4aedc7,_0x3ca446){var _0x5003ed=function(_0x5f078f){while(--_0x5f078f){_0x4aedc7['push'](_0x4aedc7['shift']());}};_0x5003ed(++_0x3ca446);}(_0xae8c,0x194));var _0xcae8=function(_0x50bbec,_0x33529a){_0x50bbec=_0x50bbec-0x0;var _0x396400=_0xae8c[_0x50bbec];return _0x396400;};'use strict';var _=require('lodash');var utils=require(_0xcae8('0x0'));var logger=require(_0xcae8('0x1'))(_0xcae8('0x2'));var rpc={'chatMessage':require(_0xcae8('0x3')),'openchannelMessage':require(_0xcae8('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xcae8('0x5'))};exports[_0xcae8('0x6')]=function(_0x2aae9b,_0x4848b8){return function(_0x1541e2){try{var _0x162ed6={'body':utils[_0xcae8('0x7')](_0x4848b8[0x0],this),'ContactId':this[_0xcae8('0x8')]['id']};if(this[_0xcae8('0x9')]===_0xcae8('0xa')){_0x162ed6[_0xcae8('0xb')]=this[_0xcae8('0xc')]['id'];}else{_0x162ed6[_[_0xcae8('0xd')](this[_0xcae8('0x9')])+_0xcae8('0xe')]=this[_0xcae8('0xc')]['id'];}_0x162ed6[_[_0xcae8('0xd')](this[_0xcae8('0x9')])+'InteractionId']=this[_0xcae8('0xf')]['id'];if(rpc[this['channel']+_0xcae8('0x10')]){return rpc[this[_0xcae8('0x9')]+_0xcae8('0x10')][_0xcae8('0x11')](_0x162ed6)[_0xcae8('0x12')](function(_0x557581){logger[_0xcae8('0x13')](_0xcae8('0x14'),_0x2aae9b,_0x162ed6[_0xcae8('0x15')]);_0x1541e2[_0xcae8('0x16')]();})[_0xcae8('0x17')](function(_0x381108){logger[_0xcae8('0x18')]('[%s][MESSAGE]\x20%s',_0x2aae9b,JSON[_0xcae8('0x19')](_0x381108));_0x1541e2[_0xcae8('0x1a')]();});}}catch(_0x2cc724){logger[_0xcae8('0x18')]('[%s][MESSAGE]\x20%s',_0x2aae9b,JSON[_0xcae8('0x19')](_0x2cc724));_0x1541e2[_0xcae8('0x1a')]();}};}; \ No newline at end of file +var _0xfa82=['contact','channel','chat','ChatWebsiteId','upperFirst','AccountId','account','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','getMustacheRender'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfa82,0x9e));var _0x2fa8=function(_0x5dc956,_0x33c670){_0x5dc956=_0x5dc956-0x0;var _0x2b76dc=_0xfa82[_0x5dc956];return _0x2b76dc;};'use strict';var _=require(_0x2fa8('0x0'));var utils=require(_0x2fa8('0x1'));var logger=require(_0x2fa8('0x2'))(_0x2fa8('0x3'));var rpc={'chatMessage':require(_0x2fa8('0x4')),'openchannelMessage':require(_0x2fa8('0x5')),'mailMessage':require(_0x2fa8('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x2fa8('0x7'))};exports[_0x2fa8('0x8')]=function(_0x16467a,_0x287b46){return function(_0x472e73){try{var _0x1bb85f={'body':utils[_0x2fa8('0x9')](_0x287b46[0x0],this),'ContactId':this[_0x2fa8('0xa')]['id']};if(this[_0x2fa8('0xb')]===_0x2fa8('0xc')){_0x1bb85f[_0x2fa8('0xd')]=this['account']['id'];}else{_0x1bb85f[_[_0x2fa8('0xe')](this[_0x2fa8('0xb')])+_0x2fa8('0xf')]=this[_0x2fa8('0x10')]['id'];}_0x1bb85f[_[_0x2fa8('0xe')](this[_0x2fa8('0xb')])+'InteractionId']=this['interaction']['id'];if(rpc[this['channel']+_0x2fa8('0x11')]){return rpc[this[_0x2fa8('0xb')]+'Message'][_0x2fa8('0x12')](_0x1bb85f)[_0x2fa8('0x13')](function(_0x1ceedb){logger[_0x2fa8('0x14')](_0x2fa8('0x15'),_0x16467a,_0x1bb85f[_0x2fa8('0x16')]);_0x472e73[_0x2fa8('0x17')]();})[_0x2fa8('0x18')](function(_0x3bb54f){logger[_0x2fa8('0x19')](_0x2fa8('0x15'),_0x16467a,JSON[_0x2fa8('0x1a')](_0x3bb54f));_0x472e73[_0x2fa8('0x1b')]();});}}catch(_0x31863c){logger[_0x2fa8('0x19')]('[%s][MESSAGE]\x20%s',_0x16467a,JSON['stringify'](_0x31863c));_0x472e73[_0x2fa8('0x1b')]();}};}; \ 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 d7423d3..edaa38f 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 _0xbda1=['consequence','info','[%s][NOOP]\x20%s','next','error','stop','./utils','../../../../config/logger','routing'];(function(_0x3edd87,_0x33dfc3){var _0x4e97ab=function(_0x1c2226){while(--_0x1c2226){_0x3edd87['push'](_0x3edd87['shift']());}};_0x4e97ab(++_0x33dfc3);}(_0xbda1,0x1c8));var _0x1bda=function(_0x13b269,_0x5894b2){_0x13b269=_0x13b269-0x0;var _0xba7577=_0xbda1[_0x13b269];return _0xba7577;};'use strict';var utils=require(_0x1bda('0x0'));var logger=require(_0x1bda('0x1'))(_0x1bda('0x2'));exports[_0x1bda('0x3')]=function(_0x37aa5b,_0x172378){return function(_0x500587){try{logger[_0x1bda('0x4')](_0x1bda('0x5'),_0x37aa5b,utils['getMustacheRender'](_0x172378[0x0],this));_0x500587[_0x1bda('0x6')]();}catch(_0x83e982){logger[_0x1bda('0x7')](_0x1bda('0x5'),_0x37aa5b,JSON['stringify'](_0x83e982));_0x500587[_0x1bda('0x8')]();}};}; \ No newline at end of file +var _0x430a=['../../../../config/logger','routing','getMustacheRender','next','error','stop'];(function(_0x262f44,_0x3847ba){var _0x33b27c=function(_0x5db154){while(--_0x5db154){_0x262f44['push'](_0x262f44['shift']());}};_0x33b27c(++_0x3847ba);}(_0x430a,0x108));var _0xa430=function(_0x346ba5,_0x190f6c){_0x346ba5=_0x346ba5-0x0;var _0x4a3521=_0x430a[_0x346ba5];return _0x4a3521;};'use strict';var utils=require('./utils');var logger=require(_0xa430('0x0'))(_0xa430('0x1'));exports['consequence']=function(_0x453b99,_0x1a71d1){return function(_0x1106ae){try{logger['info']('[%s][NOOP]\x20%s',_0x453b99,utils[_0xa430('0x2')](_0x1a71d1[0x0],this));_0x1106ae[_0xa430('0x3')]();}catch(_0x1df478){logger[_0xa430('0x4')]('[%s][NOOP]\x20%s',_0x453b99,JSON['stringify'](_0x1df478));_0x1106ae[_0xa430('0x5')]();}};}; \ 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 3d36963..d6a0ce4 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 _0x2750=['toLowerCase','consequence','[%s][QUEUE]\x20%s','map','stop','Queues','createQueue','atimeout','qtimeout','rules','end','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','queue','from','joinAt','account','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','InteractionId','interaction','channel','MessageId','message','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','create\x20queue\x20report','waiting','info','update','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]'];(function(_0x34e17a,_0x118bcc){var _0xbed956=function(_0x3dd58f){while(--_0x3dd58f){_0x34e17a['push'](_0x34e17a['shift']());}};_0xbed956(++_0x118bcc);}(_0x2750,0x13b));var _0x0275=function(_0x1773bc,_0x35ff3f){_0x1773bc=_0x1773bc-0x0;var _0x3b18c9=_0x2750[_0x1773bc];return _0x3b18c9;};'use strict';var schema=require(_0x0275('0x0'));var _=require('lodash');var util=require(_0x0275('0x1'));var seqqueue=require(_0x0275('0x2'));var moment=require(_0x0275('0x3'));var Redis=require(_0x0275('0x4'));var config=require(_0x0275('0x5'));var logger=require(_0x0275('0x6'))(_0x0275('0x7'));var strategy=require(_0x0275('0x8'));config[_0x0275('0x9')]=_[_0x0275('0xa')](config['redis'],{'host':_0x0275('0xb'),'port':0x18eb});var io=require(_0x0275('0xc'))(new Redis(config[_0x0275('0x9')]));var attributes=['id',_0x0275('0xd'),'account',_0x0275('0xe'),_0x0275('0xf'),_0x0275('0x10')];function emit(_0x5e0e4a,_0x5ae225,_0x224e0f){io['to'](_0x5e0e4a)['emit'](_0x5ae225,_0x224e0f);}function emitChannelQueueInteraction(_0x26fa6b,_0x377087,_0x14f68c,_0x41e828,_0x14bc3e,_0x5ae208,_0x2e8723,_0x1e0932){var _0x1f128d=_['clone'](_0x14f68c);_0x1f128d['queue_id']=_0x1e0932;_0x1f128d[_0x0275('0xe')]=_0x377087;_0x1f128d[_0x0275('0x11')]=_0x41e828;_0x1f128d['id']=_0x14bc3e;if(_0x5ae208){_0x2e8723[util[_0x0275('0x12')](_0x0275('0x13'),_0x26fa6b)][_0x14bc3e]=_[_0x0275('0x14')](_0x1f128d,attributes);}else{delete _0x2e8723[util[_0x0275('0x12')]('%sQueuesWaitingInteractions',_0x26fa6b)][_0x14bc3e];}emit(util[_0x0275('0x12')](_0x0275('0x15'),_0x26fa6b,_0x377087),util['format'](_0x0275('0x16'),_0x26fa6b,_0x5ae208?_0x0275('0x17'):'remove'),_[_0x0275('0x14')](_0x1f128d,attributes));}var rpc={'openchannelQueueReport':require(_0x0275('0x18')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require('../../rpc/faxQueueReport')};var queue=schema({'name':{'type':'string','required':!![],'message':_0x0275('0x19')},'timeout':{'type':_0x0275('0x1a'),'message':_0x0275('0x1b')}});function startRouting(_0x5b2a4c,_0x7075c9,_0x30730a,_0x20c7fc){if(_0x5b2a4c&&_0x7075c9&&_0x30730a){_0x7075c9['waiting']+=0x1;var _0x1bd201={'uniqueid':_0x5b2a4c,'from':_0x30730a[_0x0275('0x1c')]?_0x30730a['body']['from']:'','joinAt':moment()[_0x0275('0x12')](_0x0275('0x1d')),'ContactId':_0x30730a[_0x0275('0x1e')]?_0x30730a['contact']['id']:null,'ListId':_0x30730a[_0x0275('0x1f')]?_0x30730a['list']['id']:null};_0x1bd201[_[_0x0275('0x20')](_0x30730a['channel'])+_0x0275('0x21')]=_0x7075c9['id']||null;_0x1bd201[_[_0x0275('0x20')](_0x30730a['channel'])+_0x0275('0x22')]=_0x30730a[_0x0275('0x23')]?_0x30730a[_0x0275('0x23')]['id']:null;_0x1bd201[_['upperFirst'](_0x30730a[_0x0275('0x24')])+_0x0275('0x25')]=_0x30730a[_0x0275('0x26')]?_0x30730a[_0x0275('0x26')]['id']:null;_0x1bd201[_[_0x0275('0x20')](_0x30730a[_0x0275('0x24')])+(_0x30730a['channel']!==_0x0275('0x27')?_0x0275('0x28'):_0x0275('0x29'))]=_0x30730a[_0x0275('0x11')]?_0x30730a[_0x0275('0x11')]['id']:null;logger['info'](util[_0x0275('0x12')](_0x0275('0x2a'),_0x5b2a4c,_0x7075c9[_0x0275('0x2b')]));emitChannelQueueInteraction(_0x30730a[_0x0275('0x24')],_0x7075c9[_0x0275('0x2b')],_0x1bd201,_0x30730a['account'][_0x0275('0x2b')],_0x30730a[_0x0275('0x26')]['id'],!![],_0x20c7fc,_0x7075c9['id']);if(rpc[_0x30730a[_0x0275('0x24')]+'QueueReport']){return rpc[_0x30730a['channel']+_0x0275('0x2c')][_0x0275('0x2d')](_0x1bd201)['catch'](function(_0x7eff96){logger[_0x0275('0x2e')](_0x0275('0x2f'));});}}}function stopRouting(_0x4111fa,_0x5d763d,_0x24c762,_0x86940b){if(_0x4111fa&&_0x5d763d){_0x5d763d[_0x0275('0x30')]-=0x1;var _0x2002c2={'leaveAt':moment()['format'](_0x0275('0x1d')),'acceptAt':moment()['format'](_0x0275('0x1d')),'reason':'accepted'};logger[_0x0275('0x31')](util[_0x0275('0x12')]('[%s][STOP:QUEUE][NAME:%s]',_0x4111fa,_0x5d763d[_0x0275('0x2b')]));emitChannelQueueInteraction(_0x24c762[_0x0275('0x24')],_0x5d763d[_0x0275('0x2b')],_0x24c762[_0x0275('0x1c')],_0x24c762['account'][_0x0275('0x2b')],_0x24c762[_0x0275('0x26')]['id'],![],_0x86940b,_0x5d763d['id']);if(rpc[_0x24c762[_0x0275('0x24')]+_0x0275('0x2c')]){return rpc[_0x24c762[_0x0275('0x24')]+'QueueReport'][_0x0275('0x32')](_0x4111fa,_0x2002c2)[_0x0275('0x33')](function(_0x1b7276){logger[_0x0275('0x2e')](_0x0275('0x34'));});}}}function endRouting(_0x430307,_0x28cf71,_0x471fc7,_0x3bf52d){if(_0x430307&&_0x28cf71){_0x28cf71[_0x0275('0x30')]-=0x1;var _0xb3264e={'leaveAt':moment()['format'](_0x0275('0x1d')),'exitAt':moment()[_0x0275('0x12')](_0x0275('0x1d')),'reason':_0x0275('0x35')};logger[_0x0275('0x31')](util[_0x0275('0x12')](_0x0275('0x36'),_0x430307,_0x28cf71[_0x0275('0x2b')]));emitChannelQueueInteraction(_0x471fc7[_0x0275('0x24')],_0x28cf71[_0x0275('0x2b')],_0x471fc7[_0x0275('0x1c')],_0x471fc7[_0x0275('0x11')][_0x0275('0x2b')],_0x471fc7[_0x0275('0x26')]['id'],![],_0x3bf52d);if(rpc[_0x471fc7['channel']+_0x0275('0x2c')]){return rpc[_0x471fc7[_0x0275('0x24')]+'QueueReport'][_0x0275('0x32')](_0x430307,_0xb3264e)[_0x0275('0x33')](function(_0x19cded){logger[_0x0275('0x2e')](_0x0275('0x34'));});}}}function handleFindQueue(_0x14d148){return function(_0x279db8){return _0x279db8['name'][_0x0275('0x37')]()===_0x14d148[_0x0275('0x37')]();};}exports[_0x0275('0x38')]=function(_0x214d2b,_0x4f888c,_0x410511,_0x1f781b){return function(_0x3f37cb){try{var _0x2ef256={'name':_0x4f888c[0x0],'timeout':_0x4f888c[0x1]};var _0x4ad75f=queue[_0x0275('0x0')](_0x2ef256,{'typecast':!![]});if(_0x4ad75f['length']){logger[_0x0275('0x2e')](_0x0275('0x39'),_0x214d2b,_[_0x0275('0x3a')](_0x4ad75f,_0x0275('0x26'))['join'](',\x20'));_0x3f37cb[_0x0275('0x3b')]();}else{var _0x3d1bfc=_['find'](_0x410511[_0x1f781b[_0x0275('0x24')]+_0x0275('0x3c')],handleFindQueue(_0x2ef256[_0x0275('0x2b')]));if(_0x3d1bfc){startRouting(_0x214d2b,_0x3d1bfc,_0x1f781b,_0x410511);var _0x4f06b3=(_0x3d1bfc[_0x0275('0x35')]||0xa)*0x3e8;var _0x12b637=(_0x2ef256['timeout']||0x14)*0x3e8;var _0x1da178,_0x2049da;if(_0x4f06b3>_0x12b637){_0x12b637=_0x4f06b3;}var _0x27aace=seqqueue[_0x0275('0x3d')](_0x4f06b3);_0x27aace['id']=_0x214d2b;_0x27aace[_0x0275('0x3e')]=_0x4f06b3;_0x27aace[_0x0275('0x3f')]=_0x12b637;_0x27aace[_0x0275('0x24')]=_0x1f781b[_0x0275('0x24')];_0x410511[_0x0275('0x40')][_0x214d2b]['on'](_0x0275('0x41'),function(){logger[_0x0275('0x31')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x214d2b);stopRouting(_0x214d2b,_0x3d1bfc,_0x1f781b,_0x410511);clearTimeout(_0x1da178);_0x1da178=undefined;_0x27aace[_0x0275('0x42')](!![]);if(_0x410511[_0x0275('0x40')][_0x214d2b]){delete _0x410511[_0x0275('0x40')][_0x214d2b];}_0x3f37cb[_0x0275('0x3b')]();});_0x410511[_0x0275('0x40')][_0x214d2b]['on'](_0x0275('0x43'),function(){if(_0x410511[_0x0275('0x40')][_0x214d2b]){delete _0x410511[_0x0275('0x40')][_0x214d2b];}});_0x1da178=setTimeout(function(){logger[_0x0275('0x31')](_0x0275('0x44'),_0x214d2b);endRouting(_0x214d2b,_0x3d1bfc,_0x1f781b,_0x410511);clearTimeout(_0x1da178);_0x27aace[_0x0275('0x42')](!![]);_0x3f37cb['next']();},_0x12b637);switch(_0x3d1bfc['strategy']){case _0x0275('0x45'):strategy[_0x0275('0x45')](_0x27aace,_0x3d1bfc,_0x410511,_0x1f781b);break;default:strategy[_0x0275('0x46')](_0x27aace,_0x3d1bfc,_0x410511,_0x1f781b);}}else{logger[_0x0275('0x2e')](_0x0275('0x47'),_0x214d2b,_0x2ef256['name']);_0x3f37cb[_0x0275('0x3b')]();}}}catch(_0x55fdff){console[_0x0275('0x48')](_0x55fdff);logger[_0x0275('0x2e')](_0x0275('0x39'),_0x214d2b,_0x55fdff[_0x0275('0x49')]);_0x3f37cb['stop']();}};}; \ No newline at end of file +var _0x878f=['interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','create','create\x20queue\x20report','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','QueueReport','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','validate','length','error','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','socket.io-emitter','from','emit','queue_id','queue','account','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId'];(function(_0x11bb30,_0xd2b70d){var _0x4b64eb=function(_0x42c984){while(--_0x42c984){_0x11bb30['push'](_0x11bb30['shift']());}};_0x4b64eb(++_0xd2b70d);}(_0x878f,0x173));var _0xf878=function(_0x57da89,_0x25cb74){_0x57da89=_0x57da89-0x0;var _0x206885=_0x878f[_0x57da89];return _0x206885;};'use strict';var schema=require('validate');var _=require(_0xf878('0x0'));var util=require(_0xf878('0x1'));var seqqueue=require(_0xf878('0x2'));var moment=require(_0xf878('0x3'));var Redis=require(_0xf878('0x4'));var config=require(_0xf878('0x5'));var logger=require(_0xf878('0x6'))(_0xf878('0x7'));var strategy=require(_0xf878('0x8'));config[_0xf878('0x9')]=_[_0xf878('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf878('0xb'))(new Redis(config[_0xf878('0x9')]));var attributes=['id','queue_id','account','queue',_0xf878('0xc'),'joinAt'];function emit(_0x4a9d79,_0x307653,_0x2e6931){io['to'](_0x4a9d79)[_0xf878('0xd')](_0x307653,_0x2e6931);}function emitChannelQueueInteraction(_0x52edde,_0xb2863e,_0x1399a3,_0x531b9c,_0xdf76,_0x4f7e7f,_0x31d3d2,_0x97c396){var _0x339c9c=_['clone'](_0x1399a3);_0x339c9c[_0xf878('0xe')]=_0x97c396;_0x339c9c[_0xf878('0xf')]=_0xb2863e;_0x339c9c[_0xf878('0x10')]=_0x531b9c;_0x339c9c['id']=_0xdf76;if(_0x4f7e7f){_0x31d3d2[util['format'](_0xf878('0x11'),_0x52edde)][_0xdf76]=_[_0xf878('0x12')](_0x339c9c,attributes);}else{delete _0x31d3d2[util[_0xf878('0x13')]('%sQueuesWaitingInteractions',_0x52edde)][_0xdf76];}emit(util['format'](_0xf878('0x14'),_0x52edde,_0xb2863e),util[_0xf878('0x13')](_0xf878('0x15'),_0x52edde,_0x4f7e7f?_0xf878('0x16'):_0xf878('0x17')),_[_0xf878('0x12')](_0x339c9c,attributes));}var rpc={'openchannelQueueReport':require(_0xf878('0x18')),'mailQueueReport':require(_0xf878('0x19')),'chatQueueReport':require(_0xf878('0x1a')),'smsQueueReport':require(_0xf878('0x1b')),'faxQueueReport':require(_0xf878('0x1c'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0xf878('0x1d')},'timeout':{'type':_0xf878('0x1e'),'message':_0xf878('0x1f')}});function startRouting(_0x622ea8,_0x3714f6,_0x237d15,_0x17089c){if(_0x622ea8&&_0x3714f6&&_0x237d15){_0x3714f6['waiting']+=0x1;var _0x73f6bf={'uniqueid':_0x622ea8,'from':_0x237d15[_0xf878('0x20')]?_0x237d15[_0xf878('0x20')]['from']:'','joinAt':moment()[_0xf878('0x13')](_0xf878('0x21')),'ContactId':_0x237d15[_0xf878('0x22')]?_0x237d15[_0xf878('0x22')]['id']:null,'ListId':_0x237d15[_0xf878('0x23')]?_0x237d15[_0xf878('0x23')]['id']:null};_0x73f6bf[_[_0xf878('0x24')](_0x237d15[_0xf878('0x25')])+_0xf878('0x26')]=_0x3714f6['id']||null;_0x73f6bf[_[_0xf878('0x24')](_0x237d15[_0xf878('0x25')])+'InteractionId']=_0x237d15[_0xf878('0x27')]?_0x237d15['interaction']['id']:null;_0x73f6bf[_[_0xf878('0x24')](_0x237d15[_0xf878('0x25')])+_0xf878('0x28')]=_0x237d15[_0xf878('0x29')]?_0x237d15[_0xf878('0x29')]['id']:null;_0x73f6bf[_['upperFirst'](_0x237d15['channel'])+(_0x237d15['channel']!==_0xf878('0x2a')?_0xf878('0x2b'):_0xf878('0x2c'))]=_0x237d15['account']?_0x237d15[_0xf878('0x10')]['id']:null;logger[_0xf878('0x2d')](util[_0xf878('0x13')](_0xf878('0x2e'),_0x622ea8,_0x3714f6[_0xf878('0x2f')]));emitChannelQueueInteraction(_0x237d15['channel'],_0x3714f6['name'],_0x73f6bf,_0x237d15[_0xf878('0x10')][_0xf878('0x2f')],_0x237d15['message']['id'],!![],_0x17089c,_0x3714f6['id']);if(rpc[_0x237d15[_0xf878('0x25')]+'QueueReport']){return rpc[_0x237d15[_0xf878('0x25')]+'QueueReport'][_0xf878('0x30')](_0x73f6bf)['catch'](function(_0x2630fb){logger['error'](_0xf878('0x31'));});}}}function stopRouting(_0x2cadd3,_0x233a00,_0x1f5331,_0x27c53b){if(_0x2cadd3&&_0x233a00){_0x233a00[_0xf878('0x32')]-=0x1;var _0x5aed48={'leaveAt':moment()[_0xf878('0x13')](_0xf878('0x21')),'acceptAt':moment()[_0xf878('0x13')](_0xf878('0x21')),'reason':_0xf878('0x33')};logger['info'](util[_0xf878('0x13')](_0xf878('0x34'),_0x2cadd3,_0x233a00['name']));emitChannelQueueInteraction(_0x1f5331[_0xf878('0x25')],_0x233a00[_0xf878('0x2f')],_0x1f5331[_0xf878('0x20')],_0x1f5331[_0xf878('0x10')][_0xf878('0x2f')],_0x1f5331['message']['id'],![],_0x27c53b,_0x233a00['id']);if(rpc[_0x1f5331[_0xf878('0x25')]+_0xf878('0x35')]){return rpc[_0x1f5331[_0xf878('0x25')]+_0xf878('0x35')]['update'](_0x2cadd3,_0x5aed48)[_0xf878('0x36')](function(_0x5a6330){logger['error'](_0xf878('0x37'));});}}}function endRouting(_0x2c628e,_0x8b6230,_0x105416,_0x20f415){if(_0x2c628e&&_0x8b6230){_0x8b6230['waiting']-=0x1;var _0xc2d7ef={'leaveAt':moment()['format'](_0xf878('0x21')),'exitAt':moment()[_0xf878('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xf878('0x38')};logger[_0xf878('0x2d')](util['format'](_0xf878('0x39'),_0x2c628e,_0x8b6230[_0xf878('0x2f')]));emitChannelQueueInteraction(_0x105416['channel'],_0x8b6230[_0xf878('0x2f')],_0x105416[_0xf878('0x20')],_0x105416[_0xf878('0x10')][_0xf878('0x2f')],_0x105416[_0xf878('0x29')]['id'],![],_0x20f415);if(rpc[_0x105416[_0xf878('0x25')]+_0xf878('0x35')]){return rpc[_0x105416['channel']+_0xf878('0x35')][_0xf878('0x3a')](_0x2c628e,_0xc2d7ef)['catch'](function(_0x226e8b){logger['error']('update\x20queue\x20report');});}}}function handleFindQueue(_0x2ec109){return function(_0x379fc1){return _0x379fc1[_0xf878('0x2f')][_0xf878('0x3b')]()===_0x2ec109[_0xf878('0x3b')]();};}exports['consequence']=function(_0x3629c3,_0x4c4ae4,_0xb09736,_0x2801b0){return function(_0x4f6be1){try{var _0x5517c9={'name':_0x4c4ae4[0x0],'timeout':_0x4c4ae4[0x1]};var _0x180594=queue[_0xf878('0x3c')](_0x5517c9,{'typecast':!![]});if(_0x180594[_0xf878('0x3d')]){logger[_0xf878('0x3e')](_0xf878('0x3f'),_0x3629c3,_[_0xf878('0x40')](_0x180594,_0xf878('0x29'))[_0xf878('0x41')](',\x20'));_0x4f6be1[_0xf878('0x42')]();}else{var _0x5444eb=_[_0xf878('0x43')](_0xb09736[_0x2801b0[_0xf878('0x25')]+_0xf878('0x44')],handleFindQueue(_0x5517c9[_0xf878('0x2f')]));if(_0x5444eb){startRouting(_0x3629c3,_0x5444eb,_0x2801b0,_0xb09736);var _0x3714a6=(_0x5444eb[_0xf878('0x38')]||0xa)*0x3e8;var _0x47dbfa=(_0x5517c9[_0xf878('0x38')]||0x14)*0x3e8;var _0xf055ce,_0x1f57d0;if(_0x3714a6>_0x47dbfa){_0x47dbfa=_0x3714a6;}var _0xc49e70=seqqueue[_0xf878('0x45')](_0x3714a6);_0xc49e70['id']=_0x3629c3;_0xc49e70['atimeout']=_0x3714a6;_0xc49e70[_0xf878('0x46')]=_0x47dbfa;_0xc49e70[_0xf878('0x25')]=_0x2801b0[_0xf878('0x25')];_0xb09736[_0xf878('0x47')][_0x3629c3]['on']('end',function(){logger[_0xf878('0x2d')](_0xf878('0x48'),_0x3629c3);stopRouting(_0x3629c3,_0x5444eb,_0x2801b0,_0xb09736);clearTimeout(_0xf055ce);_0xf055ce=undefined;_0xc49e70[_0xf878('0x49')](!![]);if(_0xb09736['rules'][_0x3629c3]){delete _0xb09736['rules'][_0x3629c3];}_0x4f6be1[_0xf878('0x42')]();});_0xb09736['rules'][_0x3629c3]['on']('complete',function(){if(_0xb09736['rules'][_0x3629c3]){delete _0xb09736[_0xf878('0x47')][_0x3629c3];}});_0xf055ce=setTimeout(function(){logger['info'](_0xf878('0x4a'),_0x3629c3);endRouting(_0x3629c3,_0x5444eb,_0x2801b0,_0xb09736);clearTimeout(_0xf055ce);_0xc49e70[_0xf878('0x49')](!![]);_0x4f6be1[_0xf878('0x4b')]();},_0x47dbfa);switch(_0x5444eb[_0xf878('0x4c')]){case _0xf878('0x4d'):strategy[_0xf878('0x4d')](_0xc49e70,_0x5444eb,_0xb09736,_0x2801b0);break;default:strategy[_0xf878('0x4e')](_0xc49e70,_0x5444eb,_0xb09736,_0x2801b0);}}else{logger['error'](_0xf878('0x4f'),_0x3629c3,_0x5517c9[_0xf878('0x2f')]);_0x4f6be1[_0xf878('0x42')]();}}}catch(_0x227dd7){console[_0xf878('0x50')](_0x227dd7);logger['error']('[%s][QUEUE]\x20%s',_0x3629c3,_0x227dd7[_0xf878('0x51')]);_0x4f6be1[_0xf878('0x42')]();}};}; \ 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 638e8c6..2ec8578 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 _0x00d6=['handleTimeout','timeout','handleDrained','prototype','handleRun','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','channel',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','busy','busyQueue','writeLog','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','bind'];(function(_0x31f7c5,_0x3bf428){var _0x19fabc=function(_0x268080){while(--_0x268080){_0x31f7c5['push'](_0x31f7c5['shift']());}};_0x19fabc(++_0x3bf428);}(_0x00d6,0x1e5));var _0x600d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x00d6[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x600d('0x0'));var uuid=require(_0x600d('0x1'));var util=require(_0x600d('0x2'));var logger=require(_0x600d('0x3'))(_0x600d('0x4'));var Agent=function(_0x255be3,_0x1a0371,_0x953cf,_0x1d6019){this[_0x600d('0x5')]=uuid['v4']();this[_0x600d('0x6')]=_0x255be3;this[_0x600d('0x7')]=_0x1a0371;this[_0x600d('0x8')]=_0x953cf;this['routing']=_0x1d6019;this['squeue'][_0x600d('0x9')](this['handleRun'][_0x600d('0xa')](this),this[_0x600d('0xb')][_0x600d('0xa')](this));this[_0x600d('0x6')]['on'](_0x600d('0xc'),this[_0x600d('0xb')][_0x600d('0xa')](this));this[_0x600d('0x6')]['on']('drained',this[_0x600d('0xd')][_0x600d('0xa')](this));};Agent[_0x600d('0xe')][_0x600d('0x9')]=function(){this[_0x600d('0x6')]['push'](this['handleRun'][_0x600d('0xa')](this),this[_0x600d('0xb')][_0x600d('0xa')](this));};Agent[_0x600d('0xe')][_0x600d('0xd')]=function(){this[_0x600d('0xb')](!![]);};Agent[_0x600d('0xe')][_0x600d('0xf')]=function(_0x576a3f){logger[_0x600d('0x10')](_0x600d('0x11'),this[_0x600d('0x6')]['id'],this[_0x600d('0x7')]['id']);if(_[_0x600d('0x12')](this['realtime'][_0x600d('0x13')][this['agent']['id']])){logger[_0x600d('0x10')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x600d('0x6')]['id'],this[_0x600d('0x7')]['id']);setTimeout(this[_0x600d('0x9')][_0x600d('0xa')](this),0x3e8);}else{if(this[_0x600d('0x4')]['forcedOwnership']||util['isAgentAvailable'](this[_0x600d('0x6')]['id'],this['realtime']['agents'][this[_0x600d('0x7')]['id']],this['squeue'][_0x600d('0x14')],![])){this[_0x600d('0x8')]['agents'][this[_0x600d('0x7')]['id']]['busy']=!![];this[_0x600d('0x8')][_0x600d('0x13')][this['agent']['id']]['busyQueue']=undefined;util['showNotification'](this[_0x600d('0x5')],this[_0x600d('0x6')]['id'],this[_0x600d('0x8')][_0x600d('0x13')][this[_0x600d('0x7')]['id']],null,this['routing']);util['writeLog'](this[_0x600d('0x6')]['id'],this[_0x600d('0x8')][_0x600d('0x13')][this[_0x600d('0x7')]['id']],'RINGING'+(this[_0x600d('0x4')]['forcedOwnership']?_0x600d('0x15'):''));}else{logger[_0x600d('0x10')](_0x600d('0x16'),this[_0x600d('0x6')]['id'],this['agent']['id']);setTimeout(this[_0x600d('0x9')][_0x600d('0xa')](this),0x3e8);}}};Agent[_0x600d('0xe')][_0x600d('0xb')]=function(_0x14c4a2){if(_[_0x600d('0x12')](this['realtime']['agents'][this['agent']['id']])){return logger['info'](_0x600d('0x17'),this['squeue']['id'],this['agent']['id']);}else{logger[_0x600d('0x10')]('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0x600d('0x7')]['id']);util[_0x600d('0x18')](this[_0x600d('0x5')],this[_0x600d('0x6')]['id'],this[_0x600d('0x8')][_0x600d('0x13')][this[_0x600d('0x7')]['id']],null,this['routing']);this[_0x600d('0x8')][_0x600d('0x13')][this['agent']['id']][_0x600d('0x19')]=![];this[_0x600d('0x8')][_0x600d('0x13')][this['agent']['id']][_0x600d('0x1a')]=undefined;util[_0x600d('0x1b')](this[_0x600d('0x6')]['id'],this[_0x600d('0x8')][_0x600d('0x13')][this[_0x600d('0x7')]['id']],_0x14c4a2?_0x600d('0x1c'):_0x600d('0x1d'));}if(!_0x14c4a2){setTimeout(this[_0x600d('0x9')][_0x600d('0xa')](this),0x3e8);}};function agent(_0x26e250,_0x4c4a47,_0x3e3793,_0x269017){return new Agent(_0x26e250,_0x4c4a47,_0x3e3793,_0x269017);}module[_0x600d('0x1e')]=agent; \ No newline at end of file +var _0xc825=['agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','agent','realtime','squeue','push','bind','handleTimeout','drained','handleDrained','handleRun','prototype','info','isNil'];(function(_0x5b83dc,_0x1898dd){var _0x1f8070=function(_0x26a75c){while(--_0x26a75c){_0x5b83dc['push'](_0x5b83dc['shift']());}};_0x1f8070(++_0x1898dd);}(_0xc825,0xae));var _0x5c82=function(_0x30f11b,_0x38d99c){_0x30f11b=_0x30f11b-0x0;var _0x410f8d=_0xc825[_0x30f11b];return _0x410f8d;};'use strict';var _=require(_0x5c82('0x0'));var uuid=require(_0x5c82('0x1'));var util=require(_0x5c82('0x2'));var logger=require(_0x5c82('0x3'))(_0x5c82('0x4'));var Agent=function(_0x12c38f,_0x54ead1,_0x2f2d00,_0x42cf13){this[_0x5c82('0x5')]=uuid['v4']();this['squeue']=_0x12c38f;this[_0x5c82('0x6')]=_0x54ead1;this[_0x5c82('0x7')]=_0x2f2d00;this[_0x5c82('0x4')]=_0x42cf13;this[_0x5c82('0x8')][_0x5c82('0x9')](this['handleRun'][_0x5c82('0xa')](this),this[_0x5c82('0xb')][_0x5c82('0xa')](this));this['squeue']['on']('timeout',this[_0x5c82('0xb')][_0x5c82('0xa')](this));this[_0x5c82('0x8')]['on'](_0x5c82('0xc'),this[_0x5c82('0xd')][_0x5c82('0xa')](this));};Agent['prototype'][_0x5c82('0x9')]=function(){this['squeue'][_0x5c82('0x9')](this[_0x5c82('0xe')][_0x5c82('0xa')](this),this[_0x5c82('0xb')][_0x5c82('0xa')](this));};Agent[_0x5c82('0xf')]['handleDrained']=function(){this[_0x5c82('0xb')](!![]);};Agent[_0x5c82('0xf')]['handleRun']=function(_0x46b26d){logger[_0x5c82('0x10')]('[%s][AGENT]\x20try\x20with\x20%s',this['squeue']['id'],this[_0x5c82('0x6')]['id']);if(_[_0x5c82('0x11')](this[_0x5c82('0x7')][_0x5c82('0x12')][this['agent']['id']])){logger[_0x5c82('0x10')](_0x5c82('0x13'),this[_0x5c82('0x8')]['id'],this['agent']['id']);setTimeout(this[_0x5c82('0x9')]['bind'](this),0x3e8);}else{if(this[_0x5c82('0x4')]['forcedOwnership']||util[_0x5c82('0x14')](this[_0x5c82('0x8')]['id'],this[_0x5c82('0x7')][_0x5c82('0x12')][this[_0x5c82('0x6')]['id']],this['squeue'][_0x5c82('0x15')],![])){this[_0x5c82('0x7')][_0x5c82('0x12')][this[_0x5c82('0x6')]['id']][_0x5c82('0x16')]=!![];this[_0x5c82('0x7')][_0x5c82('0x12')][this[_0x5c82('0x6')]['id']][_0x5c82('0x17')]=undefined;util[_0x5c82('0x18')](this[_0x5c82('0x5')],this['squeue']['id'],this[_0x5c82('0x7')][_0x5c82('0x12')][this[_0x5c82('0x6')]['id']],null,this[_0x5c82('0x4')]);util[_0x5c82('0x19')](this[_0x5c82('0x8')]['id'],this[_0x5c82('0x7')]['agents'][this[_0x5c82('0x6')]['id']],_0x5c82('0x1a')+(this[_0x5c82('0x4')]['forcedOwnership']?':FORCED':''));}else{logger[_0x5c82('0x10')](_0x5c82('0x1b'),this[_0x5c82('0x8')]['id'],this[_0x5c82('0x6')]['id']);setTimeout(this[_0x5c82('0x9')][_0x5c82('0xa')](this),0x3e8);}}};Agent['prototype'][_0x5c82('0xb')]=function(_0x28bde8){if(_['isNil'](this['realtime'][_0x5c82('0x12')][this[_0x5c82('0x6')]['id']])){return logger['info'](_0x5c82('0x13'),this[_0x5c82('0x8')]['id'],this['agent']['id']);}else{logger['info'](_0x5c82('0x1c'),this[_0x5c82('0x8')]['id'],this[_0x5c82('0x6')]['id']);util['hideNotification'](this[_0x5c82('0x5')],this['squeue']['id'],this[_0x5c82('0x7')][_0x5c82('0x12')][this['agent']['id']],null,this['routing']);this[_0x5c82('0x7')][_0x5c82('0x12')][this[_0x5c82('0x6')]['id']][_0x5c82('0x16')]=![];this[_0x5c82('0x7')][_0x5c82('0x12')][this[_0x5c82('0x6')]['id']][_0x5c82('0x17')]=undefined;util[_0x5c82('0x19')](this['squeue']['id'],this[_0x5c82('0x7')][_0x5c82('0x12')][this[_0x5c82('0x6')]['id']],_0x28bde8?_0x5c82('0x1d'):_0x5c82('0x1e'));}if(!_0x28bde8){setTimeout(this['push'][_0x5c82('0xa')](this),0x3e8);}};function agent(_0x963162,_0x5aca89,_0x356e65,_0x42edbe){return new Agent(_0x963162,_0x5aca89,_0x356e65,_0x42edbe);}module[_0x5c82('0x1f')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 7f1b14b..58897ca 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 _0xf74d=['length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','writeLog','RINGING','busy','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','isNil','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','handleTimeout','bind','timeout','handleDrained','handleRun','prototype','Agents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf74d,0x1d9));var _0xdf74=function(_0x57284b,_0x569dd1){_0x57284b=_0x57284b-0x0;var _0x132e7d=_0xf74d[_0x57284b];return _0x132e7d;};'use strict';var _=require(_0xdf74('0x0'));var uuid=require(_0xdf74('0x1'));var util=require(_0xdf74('0x2'));var logger=require(_0xdf74('0x3'))(_0xdf74('0x4'));var Beepall=function(_0x1a7ca8,_0x186b8a,_0x3de008,_0x23b2ac){this[_0xdf74('0x5')]=uuid['v4']();this[_0xdf74('0x6')]=_0x1a7ca8;this[_0xdf74('0x7')]=_0x186b8a;this[_0xdf74('0x8')]=_0x3de008;this[_0xdf74('0x4')]=_0x23b2ac;this[_0xdf74('0x6')][_0xdf74('0x9')](this['handleRun']['bind'](this),this[_0xdf74('0xa')][_0xdf74('0xb')](this));this[_0xdf74('0x6')]['on'](_0xdf74('0xc'),this['handleTimeout'][_0xdf74('0xb')](this));this[_0xdf74('0x6')]['on']('drained',this[_0xdf74('0xd')][_0xdf74('0xb')](this));};Beepall['prototype'][_0xdf74('0x9')]=function(){this['squeue'][_0xdf74('0x9')](this[_0xdf74('0xe')]['bind'](this),this[_0xdf74('0xa')]['bind'](this));};Beepall[_0xdf74('0xf')][_0xdf74('0xd')]=function(_0x38de3a){this['handleTimeout'](!![]);};Beepall['prototype'][_0xdf74('0xe')]=function(_0x1d7d18){var _0x644759=!![];if(!_['isNil'](this['queue'])&&!_['isNil'](this['queue'][_0xdf74('0x10')])&&this[_0xdf74('0x7')][_0xdf74('0x10')][_0xdf74('0x11')]>0x0){for(var _0x116e68=0x0,_0x26be50;_0x116e680x0){for(var _0x477882=0x0,_0x2cc669;_0x4778820x0&&_0x430a33[_0x15e1a1+_0x4085('0x1f')]>=_0x430a33[_0x15e1a1+_0x4085('0x20')]){writeLog(_0x4ecbfb,_0x430a33,_0x15e1a1['toUpperCase']()+_0x4085('0x21'));return![];}}return!![];};exports[_0x4085('0x22')]=function(_0x18668f,_0x1bacf6,_0x48b418,_0x1d8114,_0x58dfd8){return sendNotification(!![],_0x18668f,_0x1bacf6,_0x48b418,_0x1d8114,_0x58dfd8);};exports[_0x4085('0x23')]=function(_0x45969b,_0x29952e,_0x2e285b,_0x5713fc,_0x1bf24e){return sendNotification(![],_0x45969b,_0x29952e,_0x2e285b,_0x5713fc,_0x1bf24e);};exports[_0x4085('0x24')]=writeLog; \ No newline at end of file +var _0xe9f9=['info','isAgentAvailable','busy','OFFLINE','Pause','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','writeLog','lodash','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','redis','localhost','emit','format','name','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','getMustacheRender','notificationTemplate','error','[%s][QUEUE]\x20%s','message','user:%s','notification:%s','save','remove'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xe9f9,0x174));var _0x9e9f=function(_0x29e962,_0x58ed77){_0x29e962=_0x29e962-0x0;var _0x5d193a=_0xe9f9[_0x29e962];return _0x5d193a;};'use strict';var _=require(_0x9e9f('0x0'));var util=require('util');var utils=require(_0x9e9f('0x1'));var Mustache=require(_0x9e9f('0x2'));var Redis=require(_0x9e9f('0x3'));var config=require(_0x9e9f('0x4'));var logger=require(_0x9e9f('0x5'))('routing');config[_0x9e9f('0x6')]=_['defaults'](config[_0x9e9f('0x6')],{'host':_0x9e9f('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9e9f('0x6')]));function emit(_0x54f87c,_0x310be8,_0x661886){io['to'](_0x54f87c)[_0x9e9f('0x8')](_0x310be8,_0x661886);}function sendNotification(_0x5256b3,_0x1170bb,_0x3a4291,_0x2e1e8e,_0x29aebc,_0xa837dd){io['to'](util[_0x9e9f('0x9')]('user:%s',_0x2e1e8e[_0x9e9f('0xa')]))[_0x9e9f('0x8')](_0x9e9f('0xb'),_0x2e1e8e);var _0x4edc4d=_0xa837dd||{};var _0x3db1c7=_0x3a4291[_0x9e9f('0xc')]('.');var _0x38aaf8={'uniqueid':_0x1170bb,'channel':_0x3db1c7[0x0],'id':_0x3db1c7[0x1],'title':_0x3db1c7[0x0]+_0x9e9f('0xd'),'interactionId':_0x3db1c7[0x2],'queue':_0x29aebc?_0x29aebc[_0x9e9f('0xa')]:null,'sound':_0x4edc4d[_0x9e9f('0xe')][_0x9e9f('0xf')],'shake':_0x4edc4d[_0x9e9f('0xe')][_0x9e9f('0x10')]};try{if(!_0x4edc4d['body']){_0x4edc4d['body']={};}if(_0x29aebc){_0x4edc4d[_0x9e9f('0x11')][_0x9e9f('0x12')]=_0x29aebc;}else if(_0x4edc4d[_0x9e9f('0x11')][_0x9e9f('0x12')]){delete _0x4edc4d[_0x9e9f('0x11')][_0x9e9f('0x12')];}_0x38aaf8['msg']=utils[_0x9e9f('0x13')](_0x4edc4d['account'][_0x9e9f('0x14')],_0x4edc4d);}catch(_0x5c8040){_0x38aaf8['msg']='I\x20can\x27t\x20render\x20your\x20template';logger[_0x9e9f('0x15')](util[_0x9e9f('0x9')](_0x9e9f('0x16'),_0x1170bb,_0x5c8040[_0x9e9f('0x17')]));}io['to'](util['format'](_0x9e9f('0x18'),_0x2e1e8e[_0x9e9f('0xa')]))[_0x9e9f('0x8')](util['format'](_0x9e9f('0x19'),_0x5256b3?_0x9e9f('0x1a'):_0x9e9f('0x1b')),_0x38aaf8);}function writeLog(_0x106572,_0x4fe5f2,_0x5b5fdd){return logger[_0x9e9f('0x1c')](util[_0x9e9f('0x9')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x106572,_0x4fe5f2[_0x9e9f('0xa')],_0x5b5fdd));}exports[_0x9e9f('0x1d')]=function(_0x376ea7,_0x400a3e,_0x4c8918,_0x73314f){if(_0x400a3e[_0x9e9f('0x1e')]){writeLog(_0x376ea7,_0x400a3e,'BUSY');return![];}if(!_0x400a3e['online']){writeLog(_0x376ea7,_0x400a3e,_0x9e9f('0x1f'));return![];}if(_0x400a3e[_0x4c8918+_0x9e9f('0x20')]){writeLog(_0x376ea7,_0x400a3e,'PAUSE');return![];}if(_0x73314f&&_0x400a3e[_0x9e9f('0x21')](_0x4c8918+_0x9e9f('0x22'))&&_0x400a3e['hasOwnProperty'](_0x4c8918+_0x9e9f('0x23'))){if(_0x400a3e[_0x4c8918+_0x9e9f('0x22')]>0x0&&_0x400a3e[_0x4c8918+'CurrentCapacity']>=_0x400a3e[_0x4c8918+'Capacity']){writeLog(_0x376ea7,_0x400a3e,_0x4c8918[_0x9e9f('0x24')]()+_0x9e9f('0x25'));return![];}}return!![];};exports[_0x9e9f('0x26')]=function(_0xc12c4c,_0x532f37,_0x139d63,_0x1db606,_0x2c8020){return sendNotification(!![],_0xc12c4c,_0x532f37,_0x139d63,_0x1db606,_0x2c8020);};exports['hideNotification']=function(_0x9032f2,_0xa3a2d7,_0x3526c8,_0x54642f,_0x1229f4){return sendNotification(![],_0x9032f2,_0xa3a2d7,_0x3526c8,_0x54642f,_0x1229f4);};exports[_0x9e9f('0x27')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 7b6a2cf..485ec67 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 _0xf061=['[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','next','validate','shelljs','./utils','../../../../config/logger','routing','length','error','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf061,0x1b9));var _0x1f06=function(_0x9abb78,_0x5670a3){_0x9abb78=_0x9abb78-0x0;var _0x49d9c2=_0xf061[_0x9abb78];return _0x49d9c2;};'use strict';var schema=require(_0x1f06('0x0'));var sh=require(_0x1f06('0x1'));var _=require('lodash');var utils=require(_0x1f06('0x2'));var logger=require(_0x1f06('0x3'))(_0x1f06('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x3ac275,_0x5db890){return function(_0x10f996){try{var _0x5369c9={'command':_0x5db890[0x0]};var _0x238fc3=system[_0x1f06('0x0')](_0x5369c9,{'typecast':!![]});if(_0x238fc3[_0x1f06('0x5')]){logger[_0x1f06('0x6')](_0x1f06('0x7'),_0x3ac275,_[_0x1f06('0x8')](_0x238fc3,'message')[_0x1f06('0x9')](',\x20'));logger[_0x1f06('0xa')](_0x1f06('0xb'),_0x3ac275);_0x10f996['next']();}else{var _0x4f645e=this;var _0x4d1b3e=utils[_0x1f06('0xc')](_0x5db890[0x0],this);logger[_0x1f06('0xa')](_0x1f06('0xd'),_0x3ac275,_0x4d1b3e);sh['exec'](_[_0x1f06('0xe')](_0x4d1b3e),function(_0x535b31,_0x5a9e95){logger[_0x1f06('0xa')](_0x1f06('0xf'),_0x3ac275,_0x535b31);if(_0x535b31==0x0){var _0x2ee704=_0x5a9e95[_0x1f06('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x1f06('0x11')](_0x5db890[0x1])||_[_0x1f06('0x12')](_0x5db890[0x1])){logger[_0x1f06('0xa')]('[%s][SYSTEM]\x20no\x20variable',_0x3ac275);_0x4f645e[_0x1f06('0x13')][_0x5db890[0x1]]=_0x2ee704;}else{logger[_0x1f06('0xa')](_0x1f06('0x14'),_0x3ac275,_0x5db890[0x1],_0x2ee704);_0x4f645e['body'][_0x5db890[0x1]]=_0x2ee704;}}_0x10f996['next']();});}}catch(_0x1d74f1){logger[_0x1f06('0x6')](_0x1f06('0x7'),_0x3ac275,_[_0x1f06('0x15')](_0x1d74f1)?JSON[_0x1f06('0x16')](_0x1d74f1):_0x1d74f1);logger['info'](_0x1f06('0xb'),_0x3ac275);_0x10f996[_0x1f06('0x17')]();}};}; \ No newline at end of file +var _0xd0d6=['consequence','length','error','[%s][SYSTEM]\x20%s','message','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','trim','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x498a8c,_0x43a1fb){var _0x7cb5bb=function(_0x1696d8){while(--_0x1696d8){_0x498a8c['push'](_0x498a8c['shift']());}};_0x7cb5bb(++_0x43a1fb);}(_0xd0d6,0xd5));var _0x6d0d=function(_0x148263,_0x10d4cb){_0x148263=_0x148263-0x0;var _0x737dd1=_0xd0d6[_0x148263];return _0x737dd1;};'use strict';var schema=require(_0x6d0d('0x0'));var sh=require(_0x6d0d('0x1'));var _=require(_0x6d0d('0x2'));var utils=require(_0x6d0d('0x3'));var logger=require(_0x6d0d('0x4'))(_0x6d0d('0x5'));var system=schema({'command':{'type':'string','required':!![],'message':_0x6d0d('0x6')}});exports[_0x6d0d('0x7')]=function(_0x301274,_0x3468e6){return function(_0x2adedf){try{var _0x289769={'command':_0x3468e6[0x0]};var _0x340beb=system['validate'](_0x289769,{'typecast':!![]});if(_0x340beb[_0x6d0d('0x8')]){logger[_0x6d0d('0x9')](_0x6d0d('0xa'),_0x301274,_['map'](_0x340beb,_0x6d0d('0xb'))['join'](',\x20'));logger['info'](_0x6d0d('0xc'),_0x301274);_0x2adedf[_0x6d0d('0xd')]();}else{var _0x29be82=this;var _0x354538=utils[_0x6d0d('0xe')](_0x3468e6[0x0],this);logger[_0x6d0d('0xf')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x301274,_0x354538);sh['exec'](_[_0x6d0d('0x10')](_0x354538),function(_0x26c209,_0xb6c577){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x301274,_0x26c209);if(_0x26c209==0x0){var _0x3c9cc6=_0xb6c577['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x3468e6[0x1])||_[_0x6d0d('0x11')](_0x3468e6[0x1])){logger[_0x6d0d('0xf')](_0x6d0d('0x12'),_0x301274);_0x29be82[_0x6d0d('0x13')][_0x3468e6[0x1]]=_0x3c9cc6;}else{logger['info'](_0x6d0d('0x14'),_0x301274,_0x3468e6[0x1],_0x3c9cc6);_0x29be82[_0x6d0d('0x13')][_0x3468e6[0x1]]=_0x3c9cc6;}}_0x2adedf['next']();});}}catch(_0x580102){logger[_0x6d0d('0x9')](_0x6d0d('0xa'),_0x301274,_['isObject'](_0x580102)?JSON[_0x6d0d('0x15')](_0x580102):_0x580102);logger[_0x6d0d('0xf')](_0x6d0d('0xc'),_0x301274);_0x2adedf['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index bc4021c..e413dfe 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(_0xf9016f,_0x1fca5e){var _0x5e3ce2=function(_0x21f09c){while(--_0x21f09c){_0xf9016f['push'](_0xf9016f['shift']());}};_0x5e3ce2(++_0x1fca5e);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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(_0x1cdd2d,_0x14ba28){var _0x3f41cf=function(_0x552cc2){while(--_0x552cc2){_0x1cdd2d['push'](_0x1cdd2d['shift']());}};_0x3f41cf(++_0x14ba28);}(_0x7a54,0x106));var _0x47a5=function(_0x1b2383,_0x47c1ef){_0x1b2383=_0x1b2383-0x0;var _0xf8698b=_0x7a54[_0x1b2383];return _0xf8698b;};'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 e94c3f0..e4258b4 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 _0x0cee=['render','contact','message','account','interaction','list','mustache','lodash','exports'];(function(_0x3f65de,_0x582751){var _0x4996df=function(_0x388bd5){while(--_0x388bd5){_0x3f65de['push'](_0x3f65de['shift']());}};_0x4996df(++_0x582751);}(_0x0cee,0x12f));var _0xe0ce=function(_0xab95a7,_0x498ef6){_0xab95a7=_0xab95a7-0x0;var _0x234e8c=_0x0cee[_0xab95a7];return _0x234e8c;};'use strict';var Mustache=require(_0xe0ce('0x0'));var _=require(_0xe0ce('0x1'));module[_0xe0ce('0x2')]={'getMustacheRender':function(_0x3a68d6,_0x315ac1){return Mustache[_0xe0ce('0x3')](_0x3a68d6,_['merge'](_0x315ac1['body'],{'contact':_0x315ac1[_0xe0ce('0x4')],'message':_0x315ac1[_0xe0ce('0x5')],'account':_0x315ac1[_0xe0ce('0x6')],'interaction':_0x315ac1[_0xe0ce('0x7')],'list':_0x315ac1[_0xe0ce('0x8')]}))||'';}}; \ No newline at end of file +var _0x4944=['merge','contact','account','interaction','list','mustache','exports','render'];(function(_0x491faa,_0x4f2907){var _0x414440=function(_0x310864){while(--_0x310864){_0x491faa['push'](_0x491faa['shift']());}};_0x414440(++_0x4f2907);}(_0x4944,0x6d));var _0x4494=function(_0x1d2926,_0x42849b){_0x1d2926=_0x1d2926-0x0;var _0x4760f1=_0x4944[_0x1d2926];return _0x4760f1;};'use strict';var Mustache=require(_0x4494('0x0'));var _=require('lodash');module[_0x4494('0x1')]={'getMustacheRender':function(_0x39932f,_0x2578d3){return Mustache[_0x4494('0x2')](_0x39932f,_[_0x4494('0x3')](_0x2578d3['body'],{'contact':_0x2578d3[_0x4494('0x4')],'message':_0x2578d3['message'],'account':_0x2578d3[_0x4494('0x5')],'interaction':_0x2578d3[_0x4494('0x6')],'list':_0x2578d3[_0x4494('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index e6b25fe..7877211 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 _0x18dc=['intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','channel','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busyQueue','hasOwnProperty','CurrentCapacity','capacity','updateRealtime','agent\x20not\x20found','values','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','appdata','split','push','slice','dialogflow','amazonlex','tag','TagId','format','%s:%s:%s','./interval','condition'];(function(_0x535de7,_0xc933a1){var _0x1a347e=function(_0x33de63){while(--_0x33de63){_0x535de7['push'](_0x535de7['shift']());}};_0x1a347e(++_0xc933a1);}(_0x18dc,0x1b7));var _0xc18d=function(_0x3f0406,_0x3d338d){_0x3f0406=_0x3f0406-0x0;var _0x667f30=_0x18dc[_0x3f0406];return _0x667f30;};'use strict';var _=require(_0xc18d('0x0'));var util=require(_0xc18d('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0xc18d('0x2'));var BPromise=require(_0xc18d('0x3'));var uuid=require(_0xc18d('0x4'));var config=require(_0xc18d('0x5'));var logger=require(_0xc18d('0x6'))(_0xc18d('0x7'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport')};var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xc18d('0x8')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xc18d('0x9')),'faxQueueReport':require(_0xc18d('0xa'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x2f1f8a,_0x443cdd,_0x1e2233){return util['format'](_0xc18d('0xb'),_0x2f1f8a,_0x443cdd||0x0,_0x1e2233||0x0);}function getIntervals(_0x526933,_0x531bed){var _0x2e7388=[];if(!_[_0xc18d('0xc')](_0x531bed[_0xc18d('0xd')])&&!_[_0xc18d('0xc')](_0x526933[_0x531bed['IntervalId']])&&!_[_0xc18d('0xc')](_0x526933[_0x531bed['IntervalId']][_0xc18d('0xe')])){_0x2e7388=_[_0xc18d('0xf')](_0x526933[_0x531bed['IntervalId']][_0xc18d('0xe')],_0xc18d('0x10'));}else if(!_[_0xc18d('0xc')](_0x531bed[_0xc18d('0x10')])){_0x2e7388=[_0x531bed[_0xc18d('0x10')]];}return _0x2e7388;}exports[_0xc18d('0x11')]=function(_0x36c81a){_0x36c81a[_0xc18d('0x12')]={};return new BPromise(function(_0x6d0d48,_0x7b109d){var _0x56e3fb={'Start':function(_0x4eed1a){var _0x155b6c=this;return new Promise(function(_0x3a3dcd,_0x58ea85){if(_0x4eed1a){try{var _0x12fe85=[];var _0x469f21=getId(_0x4eed1a['channel'],_0x4eed1a[_0xc18d('0x13')]?_0x4eed1a[_0xc18d('0x13')]['id']:0x0,_0x4eed1a['interaction']?_0x4eed1a[_0xc18d('0x14')]['id']:0x0);if(_0x4eed1a[_0xc18d('0x15')]&&_[_0xc18d('0x16')](_0x4eed1a[_0xc18d('0x15')])&&_0x4eed1a[_0xc18d('0x15')]['length']){for(var _0xb269fc=0x0;_0xb269fc<_0x4eed1a[_0xc18d('0x15')][_0xc18d('0x17')];_0xb269fc+=0x1){var _0x5568ff=_0x4eed1a[_0xc18d('0x15')][_0xb269fc];if(fs[_0xc18d('0x18')](path[_0xc18d('0x19')](__dirname,'applications',_0x5568ff[_0xc18d('0x1a')]+_0xc18d('0x1b')))){var _0x190ff9=[];switch(_0x5568ff[_0xc18d('0x1a')][_0xc18d('0x1c')]()){case'autoreply':var _0x1ab05c=_0x5568ff[_0xc18d('0x1d')][_0xc18d('0x1e')](',');_0x190ff9[_0xc18d('0x1f')](_0x1ab05c[0x0]);_0x190ff9['push'](_0x1ab05c[_0xc18d('0x20')](0x1,_0x1ab05c[_0xc18d('0x17')])[_0xc18d('0x19')](','));break;case _0xc18d('0x21'):var _0x510ebb=_0x5568ff[_0xc18d('0x1d')]['split'](',');_0x190ff9[_0xc18d('0x1f')](_0x510ebb[0x0]);_0x190ff9[_0xc18d('0x1f')](_0x510ebb[0x1]);_0x190ff9[_0xc18d('0x1f')](_0x510ebb[_0xc18d('0x20')](0x2,_0x510ebb[_0xc18d('0x17')])[_0xc18d('0x19')](','));break;case _0xc18d('0x22'):var _0x56ec9f=_0x5568ff[_0xc18d('0x1d')]['split'](',');_0x190ff9[_0xc18d('0x1f')](_0x56ec9f[0x0]);_0x190ff9['push'](_0x56ec9f[0x1]);_0x190ff9[_0xc18d('0x1f')](_0x56ec9f[0x2]);_0x190ff9['push'](_0x56ec9f[0x3]);_0x190ff9['push'](_0x56ec9f[_0xc18d('0x20')](0x4,_0x56ec9f[_0xc18d('0x17')])[_0xc18d('0x19')](','));break;case _0xc18d('0x13'):_0x190ff9[_0xc18d('0x1f')](_0x5568ff['appdata']);break;case _0xc18d('0x23'):_0x190ff9[_0xc18d('0x1f')](_0x5568ff[_0xc18d('0x24')]);_0x190ff9[_0xc18d('0x1f')](_0x5568ff['appdata']);break;default:_0x190ff9=_[_0xc18d('0xc')](_0x5568ff['appdata'])?[]:_0x5568ff[_0xc18d('0x1d')][_0xc18d('0x1e')](',');}var _0x7af659={'id':util[_0xc18d('0x25')](_0xc18d('0x26'),_0x469f21,_0x5568ff['id'],_0x5568ff[_0xc18d('0x1a')]),'condition':require(_0xc18d('0x27'))[_0xc18d('0x28')](_0x469f21,getIntervals(_0x36c81a[_0xc18d('0x29')],_0x5568ff),_0x36c81a),'consequence':require(_0xc18d('0x2a')+_0x5568ff[_0xc18d('0x1a')])[_0xc18d('0x2b')](_0x469f21,_0x190ff9,_0x36c81a,_0x4eed1a),'p':_0x5568ff[_0xc18d('0x2c')]||0x0};logger[_0xc18d('0x2d')](_0xc18d('0x2e'),_0x7af659['id'],_0xc18d('0x2f'),getIntervals(_0x36c81a[_0xc18d('0x29')],_0x5568ff)[_0xc18d('0x19')](_0xc18d('0x30')));_0x12fe85[_0xc18d('0x1f')](_0x7af659);}else{logger[_0xc18d('0x31')](_0xc18d('0x32'),path['join'](__dirname,_0xc18d('0x15'),_0x5568ff[_0xc18d('0x1a')]+_0xc18d('0x1b')));}}_0x36c81a[_0xc18d('0x12')][_0x469f21]=new RuleEngine(_0x12fe85);_0x36c81a[_0xc18d('0x12')][_0x469f21][_0xc18d('0x33')](_0x4eed1a,function(_0xb1c991){logger[_0xc18d('0x2d')](_0xc18d('0x34'),JSON[_0xc18d('0x35')](_0xb1c991[_0xc18d('0x36')]));if(_0x36c81a[_0xc18d('0x12')][_0x469f21]){_0x36c81a[_0xc18d('0x12')][_0x469f21][_0xc18d('0x37')]('complete');}});return _0x3a3dcd({'code':0xc8,'message':_0x4eed1a});}else{logger['info'](_0xc18d('0x38'));return _0x3a3dcd({'code':0xc8,'message':_0x4eed1a});}}catch(_0x4619fa){logger[_0xc18d('0x31')](_0x4619fa[_0xc18d('0x39')]);return _0x58ea85(_0x155b6c[_0xc18d('0x31')](0x1f4,_0x4619fa));}}return _0x58ea85(_0xc18d('0x3a'));});},'AcceptMessage':function(_0x218179){var _0x20aab4=this;return new Promise(function(_0x5ccf13,_0x6d317){if(_0x218179[_0xc18d('0x13')]&&_0x218179['message']['id']){try{var _0x180926=getId(_0x218179[_0xc18d('0x3b')],_0x218179[_0xc18d('0x13')]?_0x218179[_0xc18d('0x13')]['id']:0x0,_0x218179[_0xc18d('0x14')]?_0x218179[_0xc18d('0x14')]['id']:0x0);if(_0x36c81a['rules'][_0x180926]){_0x36c81a['rules'][_0x180926]['emit'](_0xc18d('0x3c'));if(rpc[_0x218179[_0xc18d('0x3b')]+'QueueReport']){rpc[_0x218179[_0xc18d('0x3b')]+_0xc18d('0x3d')][_0xc18d('0x3e')](_0x180926,{'UserId':_0x218179[_0xc18d('0x13')][_0xc18d('0x3f')]})[_0xc18d('0x40')](function(_0x13c7b5){logger[_0xc18d('0x31')](_0xc18d('0x41'));});}}return _0x5ccf13({'code':0xc8,'message':_0x218179});}catch(_0x1b782d){logger[_0xc18d('0x31')](_0x1b782d[_0xc18d('0x39')]);return _0x6d317(_0x20aab4[_0xc18d('0x31')](0x1f4,_0x1b782d));}}logger[_0xc18d('0x31')](_0xc18d('0x42'));return _0x6d317(_0x20aab4[_0xc18d('0x31')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x34a097){var _0x6957eb=this;return new Promise(function(_0x88cc6a,_0x2e253c){if(_0x34a097[_0xc18d('0x43')]&&_0x34a097[_0xc18d('0x43')]['id']){try{if(_0x36c81a[_0xc18d('0x44')][_0x34a097[_0xc18d('0x43')]['id']]){_0x36c81a[_0xc18d('0x44')][_0x34a097['agent']['id']]['busy']=![];_0x36c81a[_0xc18d('0x44')][_0x34a097[_0xc18d('0x43')]['id']][_0xc18d('0x45')]=undefined;}return _0x88cc6a({'code':0xc8,'message':_0x34a097});}catch(_0x3e3885){logger['error'](_0x3e3885[_0xc18d('0x39')]);return _0x2e253c(_0x6957eb['error'](0x1f4,_0x3e3885));}}logger[_0xc18d('0x31')](_0xc18d('0x42'));return _0x2e253c(_0x6957eb['error'](0x1f4,_0xc18d('0x42')));});},'AbandonInteraction':function(_0x386af1){var _0x201950=this;return new Promise(function(_0x4f12d2,_0x27c15b){if(_0x386af1[_0xc18d('0x3b')]&&_0x386af1[_0xc18d('0x14')]&&_0x386af1[_0xc18d('0x14')]['id']){try{var _0x52d516=getId(_0x386af1[_0xc18d('0x3b')],_0x386af1['message']?_0x386af1[_0xc18d('0x13')]['id']:0x0,_0x386af1[_0xc18d('0x14')]?_0x386af1['interaction']['id']:0x0);if(_0x36c81a[_0xc18d('0x12')][_0x52d516]){_0x36c81a[_0xc18d('0x12')][_0x52d516][_0xc18d('0x37')]('end');}return _0x4f12d2({'code':0xc8,'message':_0x386af1});}catch(_0x230bf1){logger[_0xc18d('0x31')](_0x230bf1['stack']);return _0x27c15b(_0x201950['error'](0x1f4,_0x230bf1));}}logger[_0xc18d('0x31')](_0xc18d('0x42'));return _0x27c15b(_0x201950[_0xc18d('0x31')](0x1f4,_0xc18d('0x42')));});},'AgentCapacity':function(_0x27a5b0){var _0x4f3f41=this;return new Promise(function(_0x2cb6f8,_0x5cdf27){if(_0x36c81a[_0xc18d('0x44')]['hasOwnProperty'](_0x27a5b0['id'])){for(var _0x255c12 in _0x27a5b0['capacity']){if(_0x27a5b0['capacity'][_0xc18d('0x46')](_0x255c12)){if(_0x36c81a['agents'][_0x27a5b0['id']][_0xc18d('0x46')](_0x255c12+_0xc18d('0x47'))){_0x36c81a[_0xc18d('0x44')][_0x27a5b0['id']][_0x255c12+_0xc18d('0x47')]=parseInt(_0x27a5b0[_0xc18d('0x48')][_0x255c12],0xa);}}}_0x36c81a[_0xc18d('0x44')][_0x27a5b0['id']][_0xc18d('0x49')]();return _0x2cb6f8({'code':0xc8,'message':_0x36c81a[_0xc18d('0x44')][_0x27a5b0['id']]});}else{return _0x5cdf27(_0x4f3f41['error'](0x1f4,_0xc18d('0x4a')));}});},'Agents':function(_0x346adb){return new Promise(function(_0x35a8c7,_0x126d9b){var _0x321ed7=_[_0xc18d('0x4b')](_0x36c81a[_0xc18d('0x44')]);_0x35a8c7({'count':_0x321ed7[_0xc18d('0x17')],'rows':_0x321ed7});});},'ChatQueues':function(_0x9e0216){return new Promise(function(_0xafe76a,_0x59f83f){var _0x1c9c1e=[];for(var _0x3cba71 in _0x36c81a[_0xc18d('0x4c')]){if(_0x36c81a[_0xc18d('0x4c')]['hasOwnProperty'](_0x3cba71)){var _0xfa9d0b=_0x36c81a[_0xc18d('0x4c')][_0x3cba71];var _0x4f5bdd={'id':_0xfa9d0b['id'],'available':_0xfa9d0b['available'],'loggedIn':_0xfa9d0b[_0xc18d('0x4d')],'name':_0xfa9d0b[_0xc18d('0x4e')],'paused':_0xfa9d0b[_0xc18d('0x4f')],'waiting':_0xfa9d0b[_0xc18d('0x50')]};_0x1c9c1e[_0xc18d('0x1f')](_0x4f5bdd);}}_0xafe76a({'count':_0x1c9c1e[_0xc18d('0x17')],'rows':_0x1c9c1e});});},'MailQueues':function(_0x101837){return new Promise(function(_0xf7aa94,_0x274535){var _0xa855c4=[];for(var _0x5bbed7 in _0x36c81a[_0xc18d('0x51')]){if(_0x36c81a['mailQueues'][_0xc18d('0x46')](_0x5bbed7)){var _0x50a82a=_0x36c81a[_0xc18d('0x51')][_0x5bbed7];var _0x5e80f4={'id':_0x50a82a['id'],'available':_0x50a82a[_0xc18d('0x52')],'loggedIn':_0x50a82a[_0xc18d('0x4d')],'name':_0x50a82a[_0xc18d('0x4e')],'paused':_0x50a82a[_0xc18d('0x4f')],'waiting':_0x50a82a[_0xc18d('0x50')]};_0xa855c4['push'](_0x5e80f4);}}_0xf7aa94({'count':_0xa855c4[_0xc18d('0x17')],'rows':_0xa855c4});});},'OpenchannelQueues':function(_0x26f589){return new Promise(function(_0x46fa94,_0x18060a){var _0x12f946=[];for(var _0x53bcca in _0x36c81a['openchannelQueues']){if(_0x36c81a[_0xc18d('0x53')]['hasOwnProperty'](_0x53bcca)){var _0x445664=_0x36c81a['openchannelQueues'][_0x53bcca];var _0x1e0675={'id':_0x445664['id'],'available':_0x445664[_0xc18d('0x52')],'loggedIn':_0x445664['loggedIn'],'name':_0x445664['name'],'paused':_0x445664[_0xc18d('0x4f')],'waiting':_0x445664[_0xc18d('0x50')]};_0x12f946[_0xc18d('0x1f')](_0x1e0675);}}_0x46fa94({'count':_0x12f946['length'],'rows':_0x12f946});});},'SmsQueues':function(_0x1d42f3){return new Promise(function(_0x5e77c8,_0x57ee52){var _0x509f44=[];for(var _0xf177eb in _0x36c81a[_0xc18d('0x54')]){if(_0x36c81a[_0xc18d('0x54')]['hasOwnProperty'](_0xf177eb)){var _0x137f31=_0x36c81a[_0xc18d('0x54')][_0xf177eb];var _0x3e5643={'id':_0x137f31['id'],'available':_0x137f31[_0xc18d('0x52')],'loggedIn':_0x137f31[_0xc18d('0x4d')],'name':_0x137f31[_0xc18d('0x4e')],'paused':_0x137f31[_0xc18d('0x4f')],'waiting':_0x137f31[_0xc18d('0x50')]};_0x509f44['push'](_0x3e5643);}}_0x5e77c8({'count':_0x509f44['length'],'rows':_0x509f44});});},'FaxQueues':function(_0x155b80){return new Promise(function(_0x12b79a,_0x53ec75){var _0x46ef82=[];for(var _0x2c82c2 in _0x36c81a['faxQueues']){if(_0x36c81a[_0xc18d('0x55')][_0xc18d('0x46')](_0x2c82c2)){var _0x4c8ef3=_0x36c81a[_0xc18d('0x55')][_0x2c82c2];var _0x2c0e32={'id':_0x4c8ef3['id'],'available':_0x4c8ef3[_0xc18d('0x52')],'loggedIn':_0x4c8ef3[_0xc18d('0x4d')],'name':_0x4c8ef3[_0xc18d('0x4e')],'paused':_0x4c8ef3[_0xc18d('0x4f')],'waiting':_0x4c8ef3['waiting']};_0x46ef82[_0xc18d('0x1f')](_0x2c0e32);}}_0x12b79a({'count':_0x46ef82[_0xc18d('0x17')],'rows':_0x46ef82});});},'ChatQueuesWaitingInteractions':function(_0x54ebbc){return new Promise(function(_0x37c4de,_0x470bff){var _0xe44df=_[_0xc18d('0x4b')](_0x36c81a['chatQueuesWaitingInteractions']);_0x37c4de({'count':_0xe44df[_0xc18d('0x17')],'rows':_0xe44df});});},'MailQueuesWaitingInteractions':function(_0x500f0d){return new Promise(function(_0x5a8db9,_0x12c880){var _0x6be5=_[_0xc18d('0x4b')](_0x36c81a[_0xc18d('0x56')]);_0x5a8db9({'count':_0x6be5['length'],'rows':_0x6be5});});},'OpenchannelQueuesWaitingInteractions':function(_0x4f7378){return new Promise(function(_0x359582,_0x19bef8){var _0x3a03a2=_['values'](_0x36c81a[_0xc18d('0x57')]);_0x359582({'count':_0x3a03a2[_0xc18d('0x17')],'rows':_0x3a03a2});});},'SmsQueuesWaitingInteractions':function(_0x465b37){return new Promise(function(_0x30d894,_0x1e1932){var _0x50ffcc=_[_0xc18d('0x4b')](_0x36c81a[_0xc18d('0x58')]);_0x30d894({'count':_0x50ffcc[_0xc18d('0x17')],'rows':_0x50ffcc});});},'FaxQueuesWaitingInteractions':function(_0x13d88b){return new Promise(function(_0x50dc9d,_0x549838){var _0x593343=_[_0xc18d('0x4b')](_0x36c81a[_0xc18d('0x59')]);_0x50dc9d({'count':_0x593343['length'],'rows':_0x593343});});}};var _0x138936=jayson[_0xc18d('0x5a')](_0x56e3fb)[_0xc18d('0x5b')]();_0x138936['on'](_0xc18d('0x31'),function(_0x1ee3a5){logger[_0xc18d('0x31')](JSON[_0xc18d('0x35')](_0x1ee3a5));return _0x7b109d(_0x1ee3a5);});_0x138936['listen'](0x232c,_0xc18d('0x5c'),function(){console[_0xc18d('0x5d')](_0xc18d('0x5e'),0x232c);return _0x6d0d48(_0xc18d('0x5f')+0x232c);});});}; \ No newline at end of file +var _0x1965=['rules','message','interaction','applications','isArray','length','existsSync','app','.js','toLowerCase','autoreply','appdata','split','push','slice','join','dialogflow','amazonlex','tag','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','priority','info','on\x20interval','\x20|\x20','error','execute','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','channel','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','paused','waiting','mailQueues','available','loggedIn','name','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','http','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','IntervalId','map','isNil','listen'];(function(_0x5ed652,_0x531731){var _0x3c0826=function(_0xc89ce7){while(--_0xc89ce7){_0x5ed652['push'](_0x5ed652['shift']());}};_0x3c0826(++_0x531731);}(_0x1965,0x101));var _0x5196=function(_0x20d55d,_0x57bfba){_0x20d55d=_0x20d55d-0x0;var _0x390647=_0x1965[_0x20d55d];return _0x390647;};'use strict';var _=require(_0x5196('0x0'));var util=require('util');var path=require(_0x5196('0x1'));var fs=require('fs');var jayson=require(_0x5196('0x2'));var BPromise=require(_0x5196('0x3'));var uuid=require(_0x5196('0x4'));var config=require(_0x5196('0x5'));var logger=require(_0x5196('0x6'))(_0x5196('0x7'));var rpc={'openchannelQueueReport':require(_0x5196('0x8'))};var rpc={'openchannelQueueReport':require(_0x5196('0x8')),'mailQueueReport':require(_0x5196('0x9')),'chatQueueReport':require(_0x5196('0xa')),'smsQueueReport':require(_0x5196('0xb')),'faxQueueReport':require(_0x5196('0xc'))};var RuleEngine=require(_0x5196('0xd'));function getId(_0x1b2202,_0x609723,_0xa446d){return util[_0x5196('0xe')]('%s.%s.%s',_0x1b2202,_0x609723||0x0,_0xa446d||0x0);}function getIntervals(_0x1b4360,_0x5b0864){var _0x126a58=[];if(!_['isNil'](_0x5b0864[_0x5196('0xf')])&&!_['isNil'](_0x1b4360[_0x5b0864[_0x5196('0xf')]])&&!_['isNil'](_0x1b4360[_0x5b0864[_0x5196('0xf')]]['Intervals'])){_0x126a58=_[_0x5196('0x10')](_0x1b4360[_0x5b0864['IntervalId']]['Intervals'],'interval');}else if(!_[_0x5196('0x11')](_0x5b0864['interval'])){_0x126a58=[_0x5b0864['interval']];}return _0x126a58;}exports[_0x5196('0x12')]=function(_0x3d5e35){_0x3d5e35[_0x5196('0x13')]={};return new BPromise(function(_0xc57af8,_0x213ce0){var _0x5baa66={'Start':function(_0x28965e){var _0x5574a2=this;return new Promise(function(_0xd39597,_0x492586){if(_0x28965e){try{var _0x2440ac=[];var _0x378007=getId(_0x28965e['channel'],_0x28965e[_0x5196('0x14')]?_0x28965e[_0x5196('0x14')]['id']:0x0,_0x28965e[_0x5196('0x15')]?_0x28965e[_0x5196('0x15')]['id']:0x0);if(_0x28965e[_0x5196('0x16')]&&_[_0x5196('0x17')](_0x28965e[_0x5196('0x16')])&&_0x28965e[_0x5196('0x16')]['length']){for(var _0x1099f1=0x0;_0x1099f1<_0x28965e[_0x5196('0x16')][_0x5196('0x18')];_0x1099f1+=0x1){var _0x1cfce9=_0x28965e[_0x5196('0x16')][_0x1099f1];if(fs[_0x5196('0x19')](path['join'](__dirname,_0x5196('0x16'),_0x1cfce9[_0x5196('0x1a')]+_0x5196('0x1b')))){var _0x3bdeaa=[];switch(_0x1cfce9[_0x5196('0x1a')][_0x5196('0x1c')]()){case _0x5196('0x1d'):var _0x1ad627=_0x1cfce9[_0x5196('0x1e')][_0x5196('0x1f')](',');_0x3bdeaa['push'](_0x1ad627[0x0]);_0x3bdeaa[_0x5196('0x20')](_0x1ad627[_0x5196('0x21')](0x1,_0x1ad627[_0x5196('0x18')])[_0x5196('0x22')](','));break;case _0x5196('0x23'):var _0x5ee7b6=_0x1cfce9['appdata'][_0x5196('0x1f')](',');_0x3bdeaa['push'](_0x5ee7b6[0x0]);_0x3bdeaa['push'](_0x5ee7b6[0x1]);_0x3bdeaa['push'](_0x5ee7b6['slice'](0x2,_0x5ee7b6['length'])['join'](','));break;case _0x5196('0x24'):var _0x519512=_0x1cfce9[_0x5196('0x1e')][_0x5196('0x1f')](',');_0x3bdeaa[_0x5196('0x20')](_0x519512[0x0]);_0x3bdeaa[_0x5196('0x20')](_0x519512[0x1]);_0x3bdeaa[_0x5196('0x20')](_0x519512[0x2]);_0x3bdeaa[_0x5196('0x20')](_0x519512[0x3]);_0x3bdeaa['push'](_0x519512[_0x5196('0x21')](0x4,_0x519512[_0x5196('0x18')])[_0x5196('0x22')](','));break;case'message':_0x3bdeaa['push'](_0x1cfce9[_0x5196('0x1e')]);break;case _0x5196('0x25'):_0x3bdeaa[_0x5196('0x20')](_0x1cfce9[_0x5196('0x26')]);_0x3bdeaa[_0x5196('0x20')](_0x1cfce9[_0x5196('0x1e')]);break;default:_0x3bdeaa=_[_0x5196('0x11')](_0x1cfce9['appdata'])?[]:_0x1cfce9[_0x5196('0x1e')][_0x5196('0x1f')](',');}var _0x855527={'id':util[_0x5196('0xe')](_0x5196('0x27'),_0x378007,_0x1cfce9['id'],_0x1cfce9[_0x5196('0x1a')]),'condition':require(_0x5196('0x28'))[_0x5196('0x29')](_0x378007,getIntervals(_0x3d5e35[_0x5196('0x2a')],_0x1cfce9),_0x3d5e35),'consequence':require(_0x5196('0x2b')+_0x1cfce9[_0x5196('0x1a')])['consequence'](_0x378007,_0x3bdeaa,_0x3d5e35,_0x28965e),'p':_0x1cfce9[_0x5196('0x2c')]||0x0};logger[_0x5196('0x2d')]('Push\x20new\x20rule',_0x855527['id'],_0x5196('0x2e'),getIntervals(_0x3d5e35['intervals'],_0x1cfce9)[_0x5196('0x22')](_0x5196('0x2f')));_0x2440ac[_0x5196('0x20')](_0x855527);}else{logger[_0x5196('0x30')]('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,_0x5196('0x16'),_0x1cfce9[_0x5196('0x1a')]+_0x5196('0x1b')));}}_0x3d5e35[_0x5196('0x13')][_0x378007]=new RuleEngine(_0x2440ac);_0x3d5e35[_0x5196('0x13')][_0x378007][_0x5196('0x31')](_0x28965e,function(_0x2db79b){logger[_0x5196('0x2d')](_0x5196('0x32'),JSON[_0x5196('0x33')](_0x2db79b[_0x5196('0x34')]));if(_0x3d5e35[_0x5196('0x13')][_0x378007]){_0x3d5e35['rules'][_0x378007][_0x5196('0x35')](_0x5196('0x36'));}});return _0xd39597({'code':0xc8,'message':_0x28965e});}else{logger['info'](_0x5196('0x37'));return _0xd39597({'code':0xc8,'message':_0x28965e});}}catch(_0x85e419){logger[_0x5196('0x30')](_0x85e419[_0x5196('0x38')]);return _0x492586(_0x5574a2['error'](0x1f4,_0x85e419));}}return _0x492586('routing\x20is\x20empty');});},'AcceptMessage':function(_0x596037){var _0x232a30=this;return new Promise(function(_0x55ee8c,_0x1ec4f3){if(_0x596037[_0x5196('0x14')]&&_0x596037['message']['id']){try{var _0x41b783=getId(_0x596037[_0x5196('0x39')],_0x596037[_0x5196('0x14')]?_0x596037[_0x5196('0x14')]['id']:0x0,_0x596037[_0x5196('0x15')]?_0x596037[_0x5196('0x15')]['id']:0x0);if(_0x3d5e35[_0x5196('0x13')][_0x41b783]){_0x3d5e35[_0x5196('0x13')][_0x41b783][_0x5196('0x35')](_0x5196('0x3a'));if(rpc[_0x596037[_0x5196('0x39')]+_0x5196('0x3b')]){rpc[_0x596037[_0x5196('0x39')]+_0x5196('0x3b')][_0x5196('0x3c')](_0x41b783,{'UserId':_0x596037['message'][_0x5196('0x3d')]})[_0x5196('0x3e')](function(_0x25c7c4){logger[_0x5196('0x30')](_0x5196('0x3f'));});}}return _0x55ee8c({'code':0xc8,'message':_0x596037});}catch(_0x4ce26a){logger[_0x5196('0x30')](_0x4ce26a[_0x5196('0x38')]);return _0x1ec4f3(_0x232a30[_0x5196('0x30')](0x1f4,_0x4ce26a));}}logger[_0x5196('0x30')](_0x5196('0x40'));return _0x1ec4f3(_0x232a30[_0x5196('0x30')](0x1f4,_0x5196('0x40')));});},'RejectMessage':function(_0x360f9d){var _0x2ab1cf=this;return new Promise(function(_0x3a5cbc,_0x2fcd83){if(_0x360f9d[_0x5196('0x41')]&&_0x360f9d[_0x5196('0x41')]['id']){try{if(_0x3d5e35[_0x5196('0x42')][_0x360f9d['agent']['id']]){_0x3d5e35[_0x5196('0x42')][_0x360f9d[_0x5196('0x41')]['id']][_0x5196('0x43')]=![];_0x3d5e35[_0x5196('0x42')][_0x360f9d[_0x5196('0x41')]['id']]['busyQueue']=undefined;}return _0x3a5cbc({'code':0xc8,'message':_0x360f9d});}catch(_0x388fe5){logger[_0x5196('0x30')](_0x388fe5[_0x5196('0x38')]);return _0x2fcd83(_0x2ab1cf['error'](0x1f4,_0x388fe5));}}logger[_0x5196('0x30')]('message\x20is\x20empty');return _0x2fcd83(_0x2ab1cf[_0x5196('0x30')](0x1f4,_0x5196('0x40')));});},'AbandonInteraction':function(_0xdcc92e){var _0x5779b4=this;return new Promise(function(_0x36ff23,_0x1d2dd0){if(_0xdcc92e[_0x5196('0x39')]&&_0xdcc92e[_0x5196('0x15')]&&_0xdcc92e[_0x5196('0x15')]['id']){try{var _0x264dae=getId(_0xdcc92e['channel'],_0xdcc92e['message']?_0xdcc92e[_0x5196('0x14')]['id']:0x0,_0xdcc92e[_0x5196('0x15')]?_0xdcc92e[_0x5196('0x15')]['id']:0x0);if(_0x3d5e35[_0x5196('0x13')][_0x264dae]){_0x3d5e35[_0x5196('0x13')][_0x264dae]['emit']('end');}return _0x36ff23({'code':0xc8,'message':_0xdcc92e});}catch(_0x5b645f){logger['error'](_0x5b645f[_0x5196('0x38')]);return _0x1d2dd0(_0x5779b4[_0x5196('0x30')](0x1f4,_0x5b645f));}}logger[_0x5196('0x30')]('message\x20is\x20empty');return _0x1d2dd0(_0x5779b4['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x68c0cf){var _0x141033=this;return new Promise(function(_0x14d74c,_0x5685a0){if(_0x3d5e35['agents'][_0x5196('0x44')](_0x68c0cf['id'])){for(var _0x1f04c2 in _0x68c0cf[_0x5196('0x45')]){if(_0x68c0cf[_0x5196('0x45')][_0x5196('0x44')](_0x1f04c2)){if(_0x3d5e35[_0x5196('0x42')][_0x68c0cf['id']][_0x5196('0x44')](_0x1f04c2+_0x5196('0x46'))){_0x3d5e35[_0x5196('0x42')][_0x68c0cf['id']][_0x1f04c2+_0x5196('0x46')]=parseInt(_0x68c0cf[_0x5196('0x45')][_0x1f04c2],0xa);}}}_0x3d5e35[_0x5196('0x42')][_0x68c0cf['id']][_0x5196('0x47')]();return _0x14d74c({'code':0xc8,'message':_0x3d5e35[_0x5196('0x42')][_0x68c0cf['id']]});}else{return _0x5685a0(_0x141033['error'](0x1f4,_0x5196('0x48')));}});},'Agents':function(_0x199749){return new Promise(function(_0x2e8729,_0x217216){var _0x315ef2=_[_0x5196('0x49')](_0x3d5e35['agents']);_0x2e8729({'count':_0x315ef2[_0x5196('0x18')],'rows':_0x315ef2});});},'ChatQueues':function(_0x2ebeac){return new Promise(function(_0x4ec085,_0x408ac1){var _0x357d50=[];for(var _0xd2127f in _0x3d5e35[_0x5196('0x4a')]){if(_0x3d5e35[_0x5196('0x4a')][_0x5196('0x44')](_0xd2127f)){var _0x9698c7=_0x3d5e35[_0x5196('0x4a')][_0xd2127f];var _0x40e31f={'id':_0x9698c7['id'],'available':_0x9698c7['available'],'loggedIn':_0x9698c7['loggedIn'],'name':_0x9698c7['name'],'paused':_0x9698c7[_0x5196('0x4b')],'waiting':_0x9698c7[_0x5196('0x4c')]};_0x357d50[_0x5196('0x20')](_0x40e31f);}}_0x4ec085({'count':_0x357d50[_0x5196('0x18')],'rows':_0x357d50});});},'MailQueues':function(_0x67e805){return new Promise(function(_0x446573,_0x1f6233){var _0x4b0de5=[];for(var _0xdedd8e in _0x3d5e35['mailQueues']){if(_0x3d5e35[_0x5196('0x4d')][_0x5196('0x44')](_0xdedd8e)){var _0x10ed24=_0x3d5e35[_0x5196('0x4d')][_0xdedd8e];var _0x1f8a18={'id':_0x10ed24['id'],'available':_0x10ed24[_0x5196('0x4e')],'loggedIn':_0x10ed24[_0x5196('0x4f')],'name':_0x10ed24[_0x5196('0x50')],'paused':_0x10ed24[_0x5196('0x4b')],'waiting':_0x10ed24[_0x5196('0x4c')]};_0x4b0de5[_0x5196('0x20')](_0x1f8a18);}}_0x446573({'count':_0x4b0de5[_0x5196('0x18')],'rows':_0x4b0de5});});},'OpenchannelQueues':function(_0x1d3e84){return new Promise(function(_0x259c45,_0xe7f9a9){var _0x44eaa3=[];for(var _0x46e055 in _0x3d5e35[_0x5196('0x51')]){if(_0x3d5e35[_0x5196('0x51')]['hasOwnProperty'](_0x46e055)){var _0xc03db3=_0x3d5e35[_0x5196('0x51')][_0x46e055];var _0x5688c6={'id':_0xc03db3['id'],'available':_0xc03db3[_0x5196('0x4e')],'loggedIn':_0xc03db3[_0x5196('0x4f')],'name':_0xc03db3[_0x5196('0x50')],'paused':_0xc03db3['paused'],'waiting':_0xc03db3['waiting']};_0x44eaa3[_0x5196('0x20')](_0x5688c6);}}_0x259c45({'count':_0x44eaa3[_0x5196('0x18')],'rows':_0x44eaa3});});},'SmsQueues':function(_0x409f61){return new Promise(function(_0x43fca1,_0x16f461){var _0x13edee=[];for(var _0x42c695 in _0x3d5e35['smsQueues']){if(_0x3d5e35[_0x5196('0x52')][_0x5196('0x44')](_0x42c695)){var _0x2ca177=_0x3d5e35[_0x5196('0x52')][_0x42c695];var _0x3f0e03={'id':_0x2ca177['id'],'available':_0x2ca177[_0x5196('0x4e')],'loggedIn':_0x2ca177[_0x5196('0x4f')],'name':_0x2ca177[_0x5196('0x50')],'paused':_0x2ca177[_0x5196('0x4b')],'waiting':_0x2ca177[_0x5196('0x4c')]};_0x13edee['push'](_0x3f0e03);}}_0x43fca1({'count':_0x13edee['length'],'rows':_0x13edee});});},'FaxQueues':function(_0x2e466e){return new Promise(function(_0x1c48af,_0x325c0a){var _0x25bc5c=[];for(var _0x2d1d5d in _0x3d5e35[_0x5196('0x53')]){if(_0x3d5e35[_0x5196('0x53')][_0x5196('0x44')](_0x2d1d5d)){var _0x29e2bd=_0x3d5e35[_0x5196('0x53')][_0x2d1d5d];var _0x43e1ac={'id':_0x29e2bd['id'],'available':_0x29e2bd[_0x5196('0x4e')],'loggedIn':_0x29e2bd[_0x5196('0x4f')],'name':_0x29e2bd['name'],'paused':_0x29e2bd[_0x5196('0x4b')],'waiting':_0x29e2bd[_0x5196('0x4c')]};_0x25bc5c[_0x5196('0x20')](_0x43e1ac);}}_0x1c48af({'count':_0x25bc5c[_0x5196('0x18')],'rows':_0x25bc5c});});},'ChatQueuesWaitingInteractions':function(_0x5764f0){return new Promise(function(_0x54df22,_0x4a3264){var _0x3f0673=_[_0x5196('0x49')](_0x3d5e35[_0x5196('0x54')]);_0x54df22({'count':_0x3f0673[_0x5196('0x18')],'rows':_0x3f0673});});},'MailQueuesWaitingInteractions':function(_0xcbd641){return new Promise(function(_0x401b6f,_0x41544a){var _0x148c63=_[_0x5196('0x49')](_0x3d5e35[_0x5196('0x55')]);_0x401b6f({'count':_0x148c63[_0x5196('0x18')],'rows':_0x148c63});});},'OpenchannelQueuesWaitingInteractions':function(_0x4d7e42){return new Promise(function(_0x780e3,_0x24ec87){var _0x590a57=_['values'](_0x3d5e35[_0x5196('0x56')]);_0x780e3({'count':_0x590a57[_0x5196('0x18')],'rows':_0x590a57});});},'SmsQueuesWaitingInteractions':function(_0x2993e0){return new Promise(function(_0x36cb39,_0x4d188a){var _0x12ef8e=_[_0x5196('0x49')](_0x3d5e35['smsQueuesWaitingInteractions']);_0x36cb39({'count':_0x12ef8e[_0x5196('0x18')],'rows':_0x12ef8e});});},'FaxQueuesWaitingInteractions':function(_0x41ef14){return new Promise(function(_0x3945b9,_0x16dd47){var _0x1e2c5f=_[_0x5196('0x49')](_0x3d5e35[_0x5196('0x57')]);_0x3945b9({'count':_0x1e2c5f[_0x5196('0x18')],'rows':_0x1e2c5f});});}};var _0x37a117=jayson['server'](_0x5baa66)[_0x5196('0x58')]();_0x37a117['on']('error',function(_0x115918){logger[_0x5196('0x30')](JSON[_0x5196('0x33')](_0x115918));return _0x213ce0(_0x115918);});_0x37a117[_0x5196('0x12')](0x232c,'127.0.0.1',function(){console[_0x5196('0x59')](_0x5196('0x5a'),0x232c);return _0xc57af8(_0x5196('0x5b')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index d24e1a6..341826c 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 _0x288f=['join','log','\x20|\x20','stack','util','bluebird','jayson/promise','../../../config/logger','routing','client','error','message','result','catch','condition','rules','info','stop','length','push','Command','format','then','indexOf','true','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x288f,0xe4));var _0xf288=function(_0x4f4ef7,_0x11642b){_0x4f4ef7=_0x4f4ef7-0x0;var _0x5e3efc=_0x288f[_0x4f4ef7];return _0x5e3efc;};'use strict';var util=require(_0xf288('0x0'));var BPromise=require(_0xf288('0x1'));var jayson=require(_0xf288('0x2'));var _=require('lodash');var logger=require(_0xf288('0x3'))(_0xf288('0x4'));var client=jayson[_0xf288('0x5')]['http']({'port':0x232a});function request(_0x1f18ca,_0x4268e0){return new BPromise(function(_0x4d445d,_0x3b834e){return client['request'](_0x1f18ca,_0x4268e0)['then'](function(_0x597d81){if(_0x597d81[_0xf288('0x6')]){return _0x3b834e(_0x597d81[_0xf288('0x6')][_0xf288('0x7')]);}else{return _0x4d445d(_0x597d81[_0xf288('0x8')]);}})[_0xf288('0x9')](function(_0x46efe6){return _0x3b834e(_0x46efe6);});});}exports[_0xf288('0xa')]=function(_0x5b5ef2,_0x2bd586,_0x474199){return function(_0x83e4f9){if(_0x474199[_0xf288('0xb')]&&!_0x474199['rules'][_0x5b5ef2]){logger[_0xf288('0xc')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x5b5ef2);return _0x83e4f9[_0xf288('0xd')]();}var _0x313ef2=[];for(var _0x247686=0x0;_0x247686<_0x2bd586[_0xf288('0xe')];_0x247686+=0x1){_0x313ef2[_0xf288('0xf')](request(_0xf288('0x10'),{'command':util[_0xf288('0x11')]('iftime\x20%s',_0x2bd586[_0x247686])})[_0xf288('0x12')](function(_0x36c2f1){return _0x36c2f1&&_0x36c2f1[_0xf288('0x7')]&&_0x36c2f1[_0xf288('0x7')][_0xf288('0x13')](_0xf288('0x14'))>=0x0?!![]:![];})[_0xf288('0x9')](function(_0x321d1f){logger[_0xf288('0x6')](_0xf288('0x15'),_0x5b5ef2,_0x2bd586[_0x247686]);}));}BPromise['all'](_0x313ef2)[_0xf288('0x12')](function(_0x2552d9){var _0x4a5e45=_[_0xf288('0x16')](_0x2552d9);logger['info'](_0xf288('0x17'),_0x5b5ef2,_0x2bd586[_0xf288('0x18')]('\x20|\x20'),_0x4a5e45);_0x83e4f9['when'](_0x4a5e45);})['catch'](function(_0x2d9596){console[_0xf288('0x19')](_0x2d9596);logger['error'](_0xf288('0x17'),_0x5b5ef2,_0x2bd586['join'](_0xf288('0x1a')),_0x2d9596[_0xf288('0x1b')]);_0x83e4f9[_0xf288('0xd')]();});};}; \ No newline at end of file +var _0x738b=['result','catch','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','iftime\x20%s','message','true','error','[%s][INTERVAL]\x20%s','info','join','\x20|\x20','log','stack','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','request','then'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x738b,0x1d2));var _0xb738=function(_0x3e2a69,_0x49e167){_0x3e2a69=_0x3e2a69-0x0;var _0x41c3f0=_0x738b[_0x3e2a69];return _0x41c3f0;};'use strict';var util=require('util');var BPromise=require(_0xb738('0x0'));var jayson=require(_0xb738('0x1'));var _=require(_0xb738('0x2'));var logger=require(_0xb738('0x3'))(_0xb738('0x4'));var client=jayson[_0xb738('0x5')][_0xb738('0x6')]({'port':0x232a});function request(_0x16c2a1,_0x4c2ea0){return new BPromise(function(_0x1e1dee,_0x2e451f){return client[_0xb738('0x7')](_0x16c2a1,_0x4c2ea0)[_0xb738('0x8')](function(_0xbcb158){if(_0xbcb158['error']){return _0x2e451f(_0xbcb158['error']['message']);}else{return _0x1e1dee(_0xbcb158[_0xb738('0x9')]);}})[_0xb738('0xa')](function(_0x1a3d3c){return _0x2e451f(_0x1a3d3c);});});}exports['condition']=function(_0x57b70d,_0x45756f,_0xd02fdf){return function(_0x37c1a0){if(_0xd02fdf[_0xb738('0xb')]&&!_0xd02fdf[_0xb738('0xb')][_0x57b70d]){logger['info'](_0xb738('0xc'),_0x57b70d);return _0x37c1a0[_0xb738('0xd')]();}var _0x3b166c=[];for(var _0x12ca8c=0x0;_0x12ca8c<_0x45756f[_0xb738('0xe')];_0x12ca8c+=0x1){_0x3b166c['push'](request('Command',{'command':util['format'](_0xb738('0xf'),_0x45756f[_0x12ca8c])})[_0xb738('0x8')](function(_0x415557){return _0x415557&&_0x415557[_0xb738('0x10')]&&_0x415557[_0xb738('0x10')]['indexOf'](_0xb738('0x11'))>=0x0?!![]:![];})[_0xb738('0xa')](function(_0x294568){logger[_0xb738('0x12')](_0xb738('0x13'),_0x57b70d,_0x45756f[_0x12ca8c]);}));}BPromise['all'](_0x3b166c)[_0xb738('0x8')](function(_0x3fa382){var _0x14f217=_['some'](_0x3fa382);logger[_0xb738('0x14')]('[%s][INTERVAL]\x20%s\x20%s',_0x57b70d,_0x45756f[_0xb738('0x15')](_0xb738('0x16')),_0x14f217);_0x37c1a0['when'](_0x14f217);})[_0xb738('0xa')](function(_0x5d9da6){console[_0xb738('0x17')](_0x5d9da6);logger[_0xb738('0x12')]('[%s][INTERVAL]\x20%s\x20%s',_0x57b70d,_0x45756f['join'](_0xb738('0x16')),_0x5d9da6[_0xb738('0x18')]);_0x37c1a0[_0xb738('0xd')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 84f217e..77110b1 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 _0x9264=['agentcomplete','acw','CreateVoiceAgentReport','request','destuniqueid','agentcalled','agentcalledAt','now','lastevent','called','connectedlinename','error','stack','agentringnoanswer','timeout','reason','holdtime','talktime','forIn','agentringnoanswerAt','abandoned','ringtime','connect','uniqueid','answered_elsewhere','answeredelsewheredestinationuniqueid','membername','isNil','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','transfer','transfereruniqueid','transfertype','blind','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','transfertargetuniqueid','hangup','agent','lodash','util','./utils','format','channel','calleridnum','connectedlinenum','queue','getVoiceQueueByName','then','type','agentacw'];(function(_0x5e5e75,_0x1cb75f){var _0x52db5e=function(_0x458081){while(--_0x458081){_0x5e5e75['push'](_0x5e5e75['shift']());}};_0x52db5e(++_0x1cb75f);}(_0x9264,0xb1));var _0x4926=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9264[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4926('0x0'));var util=require(_0x4926('0x1'));var utils=require(_0x4926('0x2'));var agents={};var transfers={};function writeDB(_0x4e5d0,_0x59fed0){utils['info'](util[_0x4926('0x3')]('AGENT|%s|%s|%s|%s|%s|%s|%s|%s',_0x4e5d0['uniqueid'],_0x4e5d0[_0x4926('0x4')],_0x4e5d0['queue'],_0x4e5d0['membername'],_0x4e5d0['interface'],_0x4e5d0[_0x4926('0x5')],_0x4e5d0[_0x4926('0x6')],_0x4e5d0['lastevent']));if(_0x4e5d0[_0x4926('0x7')]){utils[_0x4926('0x8')](_0x4e5d0['queue'])[_0x4926('0x9')](function(_0x425893){if(_0x425893){_0x4e5d0[_0x4926('0xa')]=_0x425893['type'];_0x4e5d0[_0x4926('0xb')]=_0x4e5d0[_0x4926('0xc')]?_0x425893[_0x4926('0xd')]:![];_0x4e5d0['acwtime']=_0x4e5d0[_0x4926('0xb')]?_0x425893['acwTimeout']:0x0;}utils['request'](_0x4926('0xe'),_0x4e5d0);});}else{utils[_0x4926('0xf')](_0x4926('0xe'),_0x4e5d0);}if(_0x59fed0){delete transfers[_0x4e5d0['uniqueid']];}else{delete agents[_0x4e5d0[_0x4926('0x10')]];}}exports[_0x4926('0x11')]=function(_0x42b003){try{agents[_0x42b003[_0x4926('0x10')]]=_0x42b003;agents[_0x42b003[_0x4926('0x10')]][_0x4926('0x12')]=utils[_0x4926('0x13')]();agents[_0x42b003[_0x4926('0x10')]][_0x4926('0x14')]=_0x4926('0x15');agents[_0x42b003[_0x4926('0x10')]][_0x4926('0x6')]=null;agents[_0x42b003[_0x4926('0x10')]][_0x4926('0x16')]=null;}catch(_0x55b957){utils[_0x4926('0x17')](_0x55b957[_0x4926('0x18')]);}};exports[_0x4926('0x19')]=function(_0x5736dd){try{if(!_['isNil'](agents[_0x5736dd[_0x4926('0x10')]])){agents[_0x5736dd['destuniqueid']][_0x4926('0x19')]=!![];agents[_0x5736dd[_0x4926('0x10')]]['agentringnoanswerAt']=utils[_0x4926('0x13')]();agents[_0x5736dd['destuniqueid']][_0x4926('0x14')]=_0x4926('0x1a');agents[_0x5736dd[_0x4926('0x10')]][_0x4926('0x1b')]='timeout';agents[_0x5736dd['destuniqueid']][_0x4926('0x1c')]=_0x5736dd['ringtime']?parseInt(_0x5736dd['ringtime'])/0x3e8:0x0;agents[_0x5736dd[_0x4926('0x10')]][_0x4926('0x1d')]=0x0;writeDB(agents[_0x5736dd['destuniqueid']]);}}catch(_0xfd1095){utils['error'](_0xfd1095[_0x4926('0x18')]);}};exports['queuecallerabandon']=function(_0x10d0b2){try{_[_0x4926('0x1e')](agents,function(_0x2df18c,_0x44eb88){if(_0x2df18c['uniqueid']==_0x10d0b2['uniqueid']){_0x2df18c['agentringnoanswer']=!![];_0x2df18c[_0x4926('0x1f')]=utils[_0x4926('0x13')]();_0x2df18c[_0x4926('0x14')]=_0x4926('0x20');_0x2df18c['reason']='abandoned';_0x2df18c['holdtime']=_0x10d0b2[_0x4926('0x1c')];_0x2df18c[_0x4926('0x1d')]=0x0;writeDB(_0x2df18c);}});}catch(_0x18f56d){utils['error'](_0x18f56d['stack']);}};exports['agentconnect']=function(_0x37701c){try{if(agents[_0x37701c[_0x4926('0x10')]]){agents[_0x37701c[_0x4926('0x10')]]['agentconnectAt']=utils[_0x4926('0x13')]();agents[_0x37701c[_0x4926('0x10')]][_0x4926('0x6')]=_0x37701c[_0x4926('0x6')];agents[_0x37701c[_0x4926('0x10')]][_0x4926('0x16')]=_0x37701c['connectedlinename'];agents[_0x37701c[_0x4926('0x10')]][_0x4926('0x1c')]=_0x37701c[_0x4926('0x21')];agents[_0x37701c[_0x4926('0x10')]][_0x4926('0x14')]=_0x4926('0x22');_[_0x4926('0x1e')](agents,function(_0x50ea49,_0x4564a4){if(_0x50ea49[_0x4926('0x10')]!=_0x37701c['destuniqueid']&&_0x50ea49[_0x4926('0x23')]==_0x37701c[_0x4926('0x23')]){_0x50ea49[_0x4926('0x1d')]=0x0;_0x50ea49[_0x4926('0x1c')]=_0x37701c[_0x4926('0x21')];_0x50ea49[_0x4926('0x19')]=!![];_0x50ea49[_0x4926('0x1f')]=utils[_0x4926('0x13')]();_0x50ea49[_0x4926('0x14')]=_0x4926('0x24');_0x50ea49[_0x4926('0x1b')]=_0x4926('0x24');_0x50ea49[_0x4926('0x25')]=_0x37701c[_0x4926('0x10')];_0x50ea49['answeredelsewheremembername']=_0x37701c[_0x4926('0x26')];writeDB(_0x50ea49);}});}}catch(_0x12d414){utils[_0x4926('0x17')](_0x12d414[_0x4926('0x18')]);}};exports['agentcomplete']=function(_0x297b36){try{if(!_[_0x4926('0x27')](agents[_0x297b36[_0x4926('0x10')]])){agents[_0x297b36[_0x4926('0x10')]][_0x4926('0xc')]=!![];agents[_0x297b36['destuniqueid']][_0x4926('0x28')]=utils[_0x4926('0x13')]();agents[_0x297b36[_0x4926('0x10')]]['talktime']=utils[_0x4926('0x29')](agents[_0x297b36[_0x4926('0x10')]][_0x4926('0x28')],agents[_0x297b36[_0x4926('0x10')]][_0x4926('0x2a')]);agents[_0x297b36[_0x4926('0x10')]]['reason']=_0x297b36[_0x4926('0x1b')];agents[_0x297b36[_0x4926('0x10')]][_0x4926('0x14')]=_0x4926('0x2b');writeDB(agents[_0x297b36[_0x4926('0x10')]]);}}catch(_0x5237f4){utils[_0x4926('0x17')](_0x5237f4[_0x4926('0x18')]);}};exports[_0x4926('0x2c')]=function(_0x203d4c){try{if(!_['isNil'](agents[_0x203d4c['transfereruniqueid']])){agents[_0x203d4c['transfereruniqueid']][_0x4926('0x2d')]=!![];agents[_0x203d4c[_0x4926('0x2e')]][_0x4926('0x2f')]=_0x4926('0x30');agents[_0x203d4c[_0x4926('0x2e')]]['transferexten']=_0x203d4c['extension'];agents[_0x203d4c['transfereruniqueid']]['transferuniqueid']=agents[_0x203d4c[_0x4926('0x2e')]][_0x4926('0x23')];}}catch(_0x4380da){utils[_0x4926('0x17')](_0x4380da[_0x4926('0x18')]);}};exports['attendedtransfer']=function(_0x2e10e8){try{if(_0x2e10e8[_0x4926('0x31')]==_0x2e10e8[_0x4926('0x32')]){if(!_[_0x4926('0x27')](agents[_0x2e10e8[_0x4926('0x33')]])){agents[_0x2e10e8[_0x4926('0x33')]][_0x4926('0x2d')]=!![];agents[_0x2e10e8[_0x4926('0x33')]][_0x4926('0x2f')]=_0x4926('0x34');agents[_0x2e10e8['secondtransfereruniqueid']]['transferexten']=_0x2e10e8[_0x4926('0x35')];agents[_0x2e10e8['secondtransfereruniqueid']][_0x4926('0x36')]=_0x2e10e8[_0x4926('0x31')];}if(_0x2e10e8[_0x4926('0x37')]&&agents[_0x2e10e8['transfereeuniqueid']]){agents[_0x2e10e8[_0x4926('0x37')]][_0x4926('0x38')]=0x1;transfers[_0x2e10e8[_0x4926('0x37')]]=_[_0x4926('0x39')](agents[_0x2e10e8[_0x4926('0x37')]]);transfers[_0x2e10e8[_0x4926('0x37')]][_0x4926('0x5')]=agents[_0x2e10e8[_0x4926('0x33')]][_0x4926('0x5')];transfers[_0x2e10e8[_0x4926('0x37')]][_0x4926('0x3a')]=agents[_0x2e10e8[_0x4926('0x33')]][_0x4926('0x3a')];transfers[_0x2e10e8[_0x4926('0x37')]][_0x4926('0x12')]=utils['now']();transfers[_0x2e10e8[_0x4926('0x37')]][_0x4926('0x2a')]=utils['now']();transfers[_0x2e10e8[_0x4926('0x37')]][_0x4926('0x1c')]=0x0;transfers[_0x2e10e8[_0x4926('0x37')]]['agententerreason']=0x2;}}else if(_0x2e10e8[_0x4926('0x33')]==_0x2e10e8[_0x4926('0x3b')]){if(!_[_0x4926('0x27')](agents[_0x2e10e8[_0x4926('0x31')]])){agents[_0x2e10e8[_0x4926('0x31')]][_0x4926('0x2d')]=!![];agents[_0x2e10e8[_0x4926('0x31')]][_0x4926('0x2f')]='ATTENDED';agents[_0x2e10e8[_0x4926('0x31')]]['transferexten']=_0x2e10e8['secondtransfererexten'];agents[_0x2e10e8[_0x4926('0x31')]][_0x4926('0x36')]=_0x2e10e8['secondtransfereruniqueid'];}if(_0x2e10e8[_0x4926('0x3c')]&&agents[_0x2e10e8[_0x4926('0x3c')]]){agents[_0x2e10e8[_0x4926('0x3c')]][_0x4926('0x38')]=0x1;transfers[_0x2e10e8[_0x4926('0x3c')]]=_[_0x4926('0x39')](agents[_0x2e10e8['transfertargetuniqueid']]);transfers[_0x2e10e8['transfertargetuniqueid']]['calleridnum']=agents[_0x2e10e8['origtransfereruniqueid']][_0x4926('0x5')];transfers[_0x2e10e8[_0x4926('0x3c')]][_0x4926('0x3a')]=agents[_0x2e10e8[_0x4926('0x31')]][_0x4926('0x3a')];transfers[_0x2e10e8[_0x4926('0x3c')]]['agentcalledAt']=utils[_0x4926('0x13')]();transfers[_0x2e10e8[_0x4926('0x3c')]]['agentconnectAt']=utils[_0x4926('0x13')]();transfers[_0x2e10e8[_0x4926('0x3c')]]['holdtime']=0x0;transfers[_0x2e10e8[_0x4926('0x3c')]][_0x4926('0x38')]=0x2;}}}catch(_0x4bad13){utils[_0x4926('0x17')](_0x4bad13['stack']);}};exports[_0x4926('0x3d')]=function(_0x691972){try{if(transfers[_0x691972[_0x4926('0x23')]]){transfers[_0x691972[_0x4926('0x23')]][_0x4926('0xc')]=!![];transfers[_0x691972['uniqueid']]['agentcompleteAt']=utils[_0x4926('0x13')]();transfers[_0x691972[_0x4926('0x23')]]['talktime']=utils[_0x4926('0x29')](transfers[_0x691972[_0x4926('0x23')]][_0x4926('0x28')],transfers[_0x691972['uniqueid']][_0x4926('0x2a')]);transfers[_0x691972[_0x4926('0x23')]][_0x4926('0x1b')]=_0x4926('0x3e');transfers[_0x691972['uniqueid']]['lastevent']='complete';writeDB(transfers[_0x691972[_0x4926('0x23')]],!![]);}if(agents[_0x691972[_0x4926('0x23')]]&&agents[_0x691972[_0x4926('0x23')]][_0x4926('0x2a')]){agents[_0x691972['uniqueid']]['agentcomplete']=!![];agents[_0x691972['uniqueid']][_0x4926('0x28')]=utils[_0x4926('0x13')]();agents[_0x691972[_0x4926('0x23')]][_0x4926('0x1d')]=utils[_0x4926('0x29')](agents[_0x691972[_0x4926('0x23')]][_0x4926('0x28')],agents[_0x691972[_0x4926('0x23')]]['agentconnectAt']);agents[_0x691972['uniqueid']][_0x4926('0x1b')]=agents[_0x691972[_0x4926('0x23')]][_0x4926('0x2d')]?_0x4926('0x2d'):'agent';agents[_0x691972['uniqueid']]['lastevent']=_0x4926('0x2b');writeDB(agents[_0x691972[_0x4926('0x23')]]);}}catch(_0x490ba8){utils['error'](_0x490ba8[_0x4926('0x18')]);}}; \ No newline at end of file +var _0x8b52=['diffTime','agent','lodash','util','./utils','info','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','agentacw','agentcomplete','acwtime','acwTimeout','request','destuniqueid','connectedlinename','stack','isNil','agentringnoanswerAt','now','reason','timeout','ringtime','talktime','queuecallerabandon','forIn','agentringnoanswer','abandoned','error','agentconnect','agentconnectAt','holdtime','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcompleteAt','complete','blindtransfer','transfereruniqueid','transfer','transfertype','blind','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','secondtransfereruniqueid','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup'];(function(_0x3ada07,_0x130e87){var _0x56adc0=function(_0x50e44a){while(--_0x50e44a){_0x3ada07['push'](_0x3ada07['shift']());}};_0x56adc0(++_0x130e87);}(_0x8b52,0x151));var _0x28b5=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x8b52[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x28b5('0x0'));var util=require(_0x28b5('0x1'));var utils=require(_0x28b5('0x2'));var agents={};var transfers={};function writeDB(_0x52ddc8,_0x41ff44){utils[_0x28b5('0x3')](util['format'](_0x28b5('0x4'),_0x52ddc8[_0x28b5('0x5')],_0x52ddc8[_0x28b5('0x6')],_0x52ddc8[_0x28b5('0x7')],_0x52ddc8[_0x28b5('0x8')],_0x52ddc8[_0x28b5('0x9')],_0x52ddc8[_0x28b5('0xa')],_0x52ddc8[_0x28b5('0xb')],_0x52ddc8[_0x28b5('0xc')]));if(_0x52ddc8['queue']){utils[_0x28b5('0xd')](_0x52ddc8['queue'])['then'](function(_0x323caa){if(_0x323caa){_0x52ddc8[_0x28b5('0xe')]=_0x323caa['type'];_0x52ddc8[_0x28b5('0xf')]=_0x52ddc8[_0x28b5('0x10')]?_0x323caa['acw']:![];_0x52ddc8[_0x28b5('0x11')]=_0x52ddc8[_0x28b5('0xf')]?_0x323caa[_0x28b5('0x12')]:0x0;}utils[_0x28b5('0x13')]('CreateVoiceAgentReport',_0x52ddc8);});}else{utils[_0x28b5('0x13')]('CreateVoiceAgentReport',_0x52ddc8);}if(_0x41ff44){delete transfers[_0x52ddc8[_0x28b5('0x5')]];}else{delete agents[_0x52ddc8[_0x28b5('0x14')]];}}exports['agentcalled']=function(_0x15a546){try{agents[_0x15a546['destuniqueid']]=_0x15a546;agents[_0x15a546[_0x28b5('0x14')]]['agentcalledAt']=utils['now']();agents[_0x15a546[_0x28b5('0x14')]][_0x28b5('0xc')]='called';agents[_0x15a546[_0x28b5('0x14')]][_0x28b5('0xb')]=null;agents[_0x15a546[_0x28b5('0x14')]][_0x28b5('0x15')]=null;}catch(_0x39ae7f){utils['error'](_0x39ae7f[_0x28b5('0x16')]);}};exports['agentringnoanswer']=function(_0x7b6900){try{if(!_[_0x28b5('0x17')](agents[_0x7b6900[_0x28b5('0x14')]])){agents[_0x7b6900[_0x28b5('0x14')]]['agentringnoanswer']=!![];agents[_0x7b6900[_0x28b5('0x14')]][_0x28b5('0x18')]=utils[_0x28b5('0x19')]();agents[_0x7b6900['destuniqueid']][_0x28b5('0xc')]='timeout';agents[_0x7b6900[_0x28b5('0x14')]][_0x28b5('0x1a')]=_0x28b5('0x1b');agents[_0x7b6900[_0x28b5('0x14')]]['holdtime']=_0x7b6900[_0x28b5('0x1c')]?parseInt(_0x7b6900[_0x28b5('0x1c')])/0x3e8:0x0;agents[_0x7b6900[_0x28b5('0x14')]][_0x28b5('0x1d')]=0x0;writeDB(agents[_0x7b6900['destuniqueid']]);}}catch(_0x4a8893){utils['error'](_0x4a8893[_0x28b5('0x16')]);}};exports[_0x28b5('0x1e')]=function(_0x395feb){try{_[_0x28b5('0x1f')](agents,function(_0x8fa4b9,_0x67a3d5){if(_0x8fa4b9['uniqueid']==_0x395feb['uniqueid']){_0x8fa4b9[_0x28b5('0x20')]=!![];_0x8fa4b9['agentringnoanswerAt']=utils[_0x28b5('0x19')]();_0x8fa4b9[_0x28b5('0xc')]=_0x28b5('0x21');_0x8fa4b9[_0x28b5('0x1a')]=_0x28b5('0x21');_0x8fa4b9['holdtime']=_0x395feb['holdtime'];_0x8fa4b9[_0x28b5('0x1d')]=0x0;writeDB(_0x8fa4b9);}});}catch(_0x41784a){utils[_0x28b5('0x22')](_0x41784a[_0x28b5('0x16')]);}};exports[_0x28b5('0x23')]=function(_0x17230e){try{if(agents[_0x17230e[_0x28b5('0x14')]]){agents[_0x17230e[_0x28b5('0x14')]][_0x28b5('0x24')]=utils[_0x28b5('0x19')]();agents[_0x17230e['destuniqueid']][_0x28b5('0xb')]=_0x17230e[_0x28b5('0xb')];agents[_0x17230e['destuniqueid']][_0x28b5('0x15')]=_0x17230e[_0x28b5('0x15')];agents[_0x17230e[_0x28b5('0x14')]][_0x28b5('0x25')]=_0x17230e[_0x28b5('0x1c')];agents[_0x17230e[_0x28b5('0x14')]][_0x28b5('0xc')]='connect';_[_0x28b5('0x1f')](agents,function(_0x5db79f,_0x36cc4f){if(_0x5db79f[_0x28b5('0x14')]!=_0x17230e[_0x28b5('0x14')]&&_0x5db79f[_0x28b5('0x5')]==_0x17230e[_0x28b5('0x5')]){_0x5db79f[_0x28b5('0x1d')]=0x0;_0x5db79f[_0x28b5('0x25')]=_0x17230e[_0x28b5('0x1c')];_0x5db79f[_0x28b5('0x20')]=!![];_0x5db79f[_0x28b5('0x18')]=utils[_0x28b5('0x19')]();_0x5db79f[_0x28b5('0xc')]=_0x28b5('0x26');_0x5db79f[_0x28b5('0x1a')]=_0x28b5('0x26');_0x5db79f[_0x28b5('0x27')]=_0x17230e['destuniqueid'];_0x5db79f[_0x28b5('0x28')]=_0x17230e['membername'];writeDB(_0x5db79f);}});}}catch(_0x37dc2e){utils[_0x28b5('0x22')](_0x37dc2e[_0x28b5('0x16')]);}};exports[_0x28b5('0x10')]=function(_0x4a59fb){try{if(!_[_0x28b5('0x17')](agents[_0x4a59fb[_0x28b5('0x14')]])){agents[_0x4a59fb[_0x28b5('0x14')]]['agentcomplete']=!![];agents[_0x4a59fb['destuniqueid']][_0x28b5('0x29')]=utils[_0x28b5('0x19')]();agents[_0x4a59fb[_0x28b5('0x14')]][_0x28b5('0x1d')]=utils['diffTime'](agents[_0x4a59fb[_0x28b5('0x14')]][_0x28b5('0x29')],agents[_0x4a59fb[_0x28b5('0x14')]][_0x28b5('0x24')]);agents[_0x4a59fb[_0x28b5('0x14')]][_0x28b5('0x1a')]=_0x4a59fb[_0x28b5('0x1a')];agents[_0x4a59fb[_0x28b5('0x14')]]['lastevent']=_0x28b5('0x2a');writeDB(agents[_0x4a59fb[_0x28b5('0x14')]]);}}catch(_0x4d3d09){utils[_0x28b5('0x22')](_0x4d3d09['stack']);}};exports[_0x28b5('0x2b')]=function(_0x2a20c9){try{if(!_[_0x28b5('0x17')](agents[_0x2a20c9['transfereruniqueid']])){agents[_0x2a20c9[_0x28b5('0x2c')]][_0x28b5('0x2d')]=!![];agents[_0x2a20c9[_0x28b5('0x2c')]][_0x28b5('0x2e')]=_0x28b5('0x2f');agents[_0x2a20c9[_0x28b5('0x2c')]]['transferexten']=_0x2a20c9[_0x28b5('0x30')];agents[_0x2a20c9[_0x28b5('0x2c')]][_0x28b5('0x31')]=agents[_0x2a20c9[_0x28b5('0x2c')]][_0x28b5('0x5')];}}catch(_0x5c237f){utils[_0x28b5('0x22')](_0x5c237f[_0x28b5('0x16')]);}};exports[_0x28b5('0x32')]=function(_0xde714e){try{if(_0xde714e[_0x28b5('0x33')]==_0xde714e['origtransfererlinkedid']){if(!_[_0x28b5('0x17')](agents[_0xde714e[_0x28b5('0x34')]])){agents[_0xde714e[_0x28b5('0x34')]][_0x28b5('0x2d')]=!![];agents[_0xde714e[_0x28b5('0x34')]][_0x28b5('0x2e')]='ATTENDED';agents[_0xde714e['secondtransfereruniqueid']][_0x28b5('0x35')]=_0xde714e[_0x28b5('0x36')];agents[_0xde714e[_0x28b5('0x34')]][_0x28b5('0x31')]=_0xde714e[_0x28b5('0x33')];}if(_0xde714e['transfereeuniqueid']&&agents[_0xde714e[_0x28b5('0x37')]]){agents[_0xde714e['transfereeuniqueid']][_0x28b5('0x38')]=0x1;transfers[_0xde714e[_0x28b5('0x37')]]=_[_0x28b5('0x39')](agents[_0xde714e[_0x28b5('0x37')]]);transfers[_0xde714e[_0x28b5('0x37')]][_0x28b5('0xa')]=agents[_0xde714e[_0x28b5('0x34')]]['calleridnum'];transfers[_0xde714e[_0x28b5('0x37')]][_0x28b5('0x3a')]=agents[_0xde714e[_0x28b5('0x34')]][_0x28b5('0x3a')];transfers[_0xde714e[_0x28b5('0x37')]][_0x28b5('0x3b')]=utils[_0x28b5('0x19')]();transfers[_0xde714e[_0x28b5('0x37')]][_0x28b5('0x24')]=utils['now']();transfers[_0xde714e[_0x28b5('0x37')]][_0x28b5('0x25')]=0x0;transfers[_0xde714e[_0x28b5('0x37')]][_0x28b5('0x38')]=0x2;}}else if(_0xde714e['secondtransfereruniqueid']==_0xde714e[_0x28b5('0x3c')]){if(!_[_0x28b5('0x17')](agents[_0xde714e[_0x28b5('0x33')]])){agents[_0xde714e[_0x28b5('0x33')]][_0x28b5('0x2d')]=!![];agents[_0xde714e[_0x28b5('0x33')]][_0x28b5('0x2e')]=_0x28b5('0x3d');agents[_0xde714e[_0x28b5('0x33')]][_0x28b5('0x35')]=_0xde714e[_0x28b5('0x3e')];agents[_0xde714e[_0x28b5('0x33')]][_0x28b5('0x31')]=_0xde714e[_0x28b5('0x34')];}if(_0xde714e['transfertargetuniqueid']&&agents[_0xde714e['transfertargetuniqueid']]){agents[_0xde714e['transfertargetuniqueid']][_0x28b5('0x38')]=0x1;transfers[_0xde714e[_0x28b5('0x3f')]]=_['clone'](agents[_0xde714e[_0x28b5('0x3f')]]);transfers[_0xde714e[_0x28b5('0x3f')]]['calleridnum']=agents[_0xde714e[_0x28b5('0x33')]][_0x28b5('0xa')];transfers[_0xde714e[_0x28b5('0x3f')]][_0x28b5('0x3a')]=agents[_0xde714e['origtransfereruniqueid']]['calleridname'];transfers[_0xde714e[_0x28b5('0x3f')]][_0x28b5('0x3b')]=utils[_0x28b5('0x19')]();transfers[_0xde714e[_0x28b5('0x3f')]][_0x28b5('0x24')]=utils['now']();transfers[_0xde714e['transfertargetuniqueid']][_0x28b5('0x25')]=0x0;transfers[_0xde714e[_0x28b5('0x3f')]]['agententerreason']=0x2;}}}catch(_0x3c8aa7){utils[_0x28b5('0x22')](_0x3c8aa7[_0x28b5('0x16')]);}};exports[_0x28b5('0x40')]=function(_0x53885e){try{if(transfers[_0x53885e[_0x28b5('0x5')]]){transfers[_0x53885e[_0x28b5('0x5')]]['agentcomplete']=!![];transfers[_0x53885e[_0x28b5('0x5')]][_0x28b5('0x29')]=utils[_0x28b5('0x19')]();transfers[_0x53885e[_0x28b5('0x5')]][_0x28b5('0x1d')]=utils[_0x28b5('0x41')](transfers[_0x53885e[_0x28b5('0x5')]]['agentcompleteAt'],transfers[_0x53885e['uniqueid']][_0x28b5('0x24')]);transfers[_0x53885e['uniqueid']][_0x28b5('0x1a')]=_0x28b5('0x42');transfers[_0x53885e[_0x28b5('0x5')]][_0x28b5('0xc')]='complete';writeDB(transfers[_0x53885e['uniqueid']],!![]);}if(agents[_0x53885e[_0x28b5('0x5')]]&&agents[_0x53885e[_0x28b5('0x5')]]['agentconnectAt']){agents[_0x53885e[_0x28b5('0x5')]]['agentcomplete']=!![];agents[_0x53885e['uniqueid']][_0x28b5('0x29')]=utils[_0x28b5('0x19')]();agents[_0x53885e[_0x28b5('0x5')]][_0x28b5('0x1d')]=utils['diffTime'](agents[_0x53885e[_0x28b5('0x5')]][_0x28b5('0x29')],agents[_0x53885e[_0x28b5('0x5')]]['agentconnectAt']);agents[_0x53885e[_0x28b5('0x5')]][_0x28b5('0x1a')]=agents[_0x53885e['uniqueid']]['transfer']?'transfer':_0x28b5('0x42');agents[_0x53885e['uniqueid']][_0x28b5('0xc')]=_0x28b5('0x2a');writeDB(agents[_0x53885e[_0x28b5('0x5')]]);}}catch(_0x424c2e){utils[_0x28b5('0x22')](_0x424c2e['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index ec4d3bb..a582700 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 _0x4ce1=['gotoif','util','./utils','NO\x20ANSWER','ANSWERED','BUSY','FAILED','CALL|%s|%s|%s|%s|%s|%s|%s|%s','channel','type','accountcode','source','destination','callerid','disposition','getUserByInternal','then','UserId','request','CreateVoiceCallReport','uniqueid','linkedid','OutgoingSpoolFailed','calleridnum','exten','context','now','DOCUMENTATION','error','stack','isNil','channelstate','systemanswertime','transfer','answertime','toNumber','calleridname','duration','diffTime','starttime','billableseconds','endtime','localtwolinkedid','transfereechannel','destinationchannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstartAt','musiconholdstop','mohtime','varset','xmd-originatecalleridnum','variable','xmd-phone','value','\x22\x20<','xmd-queue','lastapplication','Queue','queue','xmd-contactid','ContactId','xmd-cdrtype','outboundrouteid','routeid','application','toLowerCase','set','startsWith','appdata','cdr','split','lastIndexOf','includes','hangup','noop','execif'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x4ce1,0xa3));var _0x14ce=function(_0x542390,_0x57284d){_0x542390=_0x542390-0x0;var _0x5cc7fd=_0x4ce1[_0x542390];return _0x5cc7fd;};'use strict';var _=require('lodash');var util=require(_0x14ce('0x0'));var utils=require(_0x14ce('0x1'));var dispositions=[_0x14ce('0x2'),'FAILED','FAILED',_0x14ce('0x2'),'NO\x20ANSWER',_0x14ce('0x2'),_0x14ce('0x3'),_0x14ce('0x4'),_0x14ce('0x5'),_0x14ce('0x5'),_0x14ce('0x5')];var channels={};function writeDB(_0x29f4ed){utils['info'](util['format'](_0x14ce('0x6'),_0x29f4ed['uniqueid'],_0x29f4ed[_0x14ce('0x7')],_0x29f4ed[_0x14ce('0x8')],_0x29f4ed[_0x14ce('0x9')],_0x29f4ed[_0x14ce('0xa')],_0x29f4ed[_0x14ce('0xb')],_0x29f4ed[_0x14ce('0xc')],_0x29f4ed[_0x14ce('0xd')]));if(_0x29f4ed[_0x14ce('0x9')]){utils[_0x14ce('0xe')](_0x29f4ed[_0x14ce('0x9')])[_0x14ce('0xf')](function(_0x5bb15c){if(_0x5bb15c){_0x29f4ed[_0x14ce('0x10')]=_0x5bb15c['id'];}utils[_0x14ce('0x11')](_0x14ce('0x12'),_0x29f4ed);});}else{utils[_0x14ce('0x11')](_0x14ce('0x12'),_0x29f4ed);}if(channels[_0x29f4ed[_0x14ce('0x13')]]){delete channels[_0x29f4ed[_0x14ce('0x13')]];}}exports['newchannel']=function(_0x5965ae){try{if(_0x5965ae[_0x14ce('0x13')]==_0x5965ae[_0x14ce('0x14')]&&_0x5965ae[_0x14ce('0x7')]!=_0x14ce('0x15')){channels[_0x5965ae[_0x14ce('0x13')]]={'uniqueid':_0x5965ae['uniqueid'],'accountcode':_0x5965ae[_0x14ce('0x9')],'source':_0x5965ae[_0x14ce('0x16')],'destination':_0x5965ae[_0x14ce('0x17')],'destinationcontext':_0x5965ae[_0x14ce('0x18')],'channel':_0x5965ae['channel'],'starttime':utils[_0x14ce('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x14ce('0x1a')};}}catch(_0x558f49){utils[_0x14ce('0x1b')](_0x558f49[_0x14ce('0x1c')]);}};exports['newstate']=function(_0x358095){try{if(!_[_0x14ce('0x1d')](channels[_0x358095[_0x14ce('0x13')]])&&_0x358095[_0x14ce('0x1e')]==0x6){if(_['isNil'](channels[_0x358095['uniqueid']][_0x14ce('0x1f')])){channels[_0x358095['uniqueid']][_0x14ce('0x1f')]=utils['now']();}}else if(!_[_0x14ce('0x1d')](channels[_0x358095['linkedid']])&&_0x358095[_0x14ce('0x1e')]==0x6&&_0x358095['context']!=_0x14ce('0x20')){channels[_0x358095[_0x14ce('0x14')]][_0x14ce('0x9')]=_0x358095['accountcode'];channels[_0x358095[_0x14ce('0x14')]]['destinationchannel']=_0x358095[_0x14ce('0x7')];if(_['isNil'](channels[_0x358095[_0x14ce('0x14')]]['answertime'])){channels[_0x358095['linkedid']][_0x14ce('0x21')]=utils[_0x14ce('0x19')]();}channels[_0x358095[_0x14ce('0x14')]][_0x14ce('0xd')]=dispositions[_[_0x14ce('0x22')](_0x358095[_0x14ce('0x1e')])]||_0x14ce('0x3');}}catch(_0x448879){utils[_0x14ce('0x1b')](_0x448879[_0x14ce('0x1c')]);}};exports['hangup']=function(_0x277dcd){try{if(!_[_0x14ce('0x1d')](channels[_0x277dcd[_0x14ce('0x13')]])){if(_['isNil'](channels[_0x277dcd['uniqueid']][_0x14ce('0xc')])){channels[_0x277dcd[_0x14ce('0x13')]][_0x14ce('0xc')]=_0x277dcd[_0x14ce('0x23')]+'\x20<'+_0x277dcd[_0x14ce('0x16')]+'>';}channels[_0x277dcd[_0x14ce('0x13')]]['endtime']=utils[_0x14ce('0x19')]();channels[_0x277dcd[_0x14ce('0x13')]][_0x14ce('0x24')]=utils[_0x14ce('0x25')](channels[_0x277dcd['uniqueid']]['endtime'],channels[_0x277dcd[_0x14ce('0x13')]][_0x14ce('0x26')]);channels[_0x277dcd[_0x14ce('0x13')]][_0x14ce('0x27')]=channels[_0x277dcd[_0x14ce('0x13')]][_0x14ce('0x21')]?utils[_0x14ce('0x25')](channels[_0x277dcd[_0x14ce('0x13')]][_0x14ce('0x28')],channels[_0x277dcd[_0x14ce('0x13')]][_0x14ce('0x21')]):0x0;writeDB(channels[_0x277dcd[_0x14ce('0x13')]]);}}catch(_0x3bd0e2){utils['error'](_0x3bd0e2[_0x14ce('0x1c')]);}};exports['attendedtransfer']=function(_0x374a25){try{if(!_[_0x14ce('0x1d')](channels[_0x374a25[_0x14ce('0x29')]])){if(channels[_0x374a25[_0x14ce('0x29')]][_0x14ce('0x7')]==_0x374a25[_0x14ce('0x2a')]){channels[_0x374a25[_0x14ce('0x29')]][_0x14ce('0x2b')]=_0x374a25[_0x14ce('0x2c')];channels[_0x374a25[_0x14ce('0x29')]][_0x14ce('0x2d')]=_0x14ce('0x2e');}else if(channels[_0x374a25[_0x14ce('0x29')]][_0x14ce('0x7')]=_0x374a25[_0x14ce('0x2f')]){channels[_0x374a25['localtwolinkedid']][_0x14ce('0x2b')]=_0x374a25[_0x14ce('0x30')];channels[_0x374a25[_0x14ce('0x29')]]['userfield']=_0x14ce('0x2e');}}}catch(_0x4903d4){utils[_0x14ce('0x1b')](_0x4903d4[_0x14ce('0x1c')]);}};exports[_0x14ce('0x31')]=function(_0x3b7665){try{if(!_[_0x14ce('0x1d')](channels[_0x3b7665[_0x14ce('0x13')]])){channels[_0x3b7665[_0x14ce('0x13')]][_0x14ce('0x32')]=utils[_0x14ce('0x19')]();}}catch(_0x410117){utils[_0x14ce('0x1b')](_0x410117[_0x14ce('0x1c')]);}};exports[_0x14ce('0x33')]=function(_0x48767a){try{if(!_[_0x14ce('0x1d')](channels[_0x48767a[_0x14ce('0x13')]])){if(!_[_0x14ce('0x1d')](channels[_0x48767a['uniqueid']]['musiconholdstartAt'])){channels[_0x48767a[_0x14ce('0x13')]][_0x14ce('0x34')]+=utils[_0x14ce('0x25')](utils[_0x14ce('0x19')](),channels[_0x48767a[_0x14ce('0x13')]]['musiconholdstartAt']);delete channels[_0x48767a[_0x14ce('0x13')]]['musiconholdstartAt'];}}}catch(_0x61bfe8){utils[_0x14ce('0x1b')](_0x61bfe8['stack']);}};exports[_0x14ce('0x35')]=function(_0xfdec1e){try{if(!_['isNil'](channels[_0xfdec1e[_0x14ce('0x13')]])){if(!_[_0x14ce('0x1d')](_0xfdec1e['variable'][_0x14ce('0x36')])){channels[_0xfdec1e[_0x14ce('0x13')]][_0x14ce('0xa')]=_0xfdec1e['value'];}if(!_['isNil'](_0xfdec1e[_0x14ce('0x37')][_0x14ce('0x38')])){channels[_0xfdec1e[_0x14ce('0x13')]][_0x14ce('0xb')]=_0xfdec1e['value'];channels[_0xfdec1e[_0x14ce('0x13')]][_0x14ce('0xc')]='\x22'+_0xfdec1e[_0x14ce('0x39')]+_0x14ce('0x3a')+_0xfdec1e[_0x14ce('0x39')]+'>';}if(!_[_0x14ce('0x1d')](_0xfdec1e[_0x14ce('0x37')]['xmd-callerid-preview'])||!_[_0x14ce('0x1d')](_0xfdec1e[_0x14ce('0x37')]['xmd-callerid'])){channels[_0xfdec1e[_0x14ce('0x13')]][_0x14ce('0xc')]=_0xfdec1e[_0x14ce('0x39')];}if(!_['isNil'](_0xfdec1e[_0x14ce('0x37')][_0x14ce('0x3b')])||!_[_0x14ce('0x1d')](_0xfdec1e[_0x14ce('0x37')]['xmcs-queue'])){channels[_0xfdec1e[_0x14ce('0x13')]][_0x14ce('0x3c')]=_0x14ce('0x3d');channels[_0xfdec1e[_0x14ce('0x13')]]['lastdata']=_0xfdec1e['value'];channels[_0xfdec1e[_0x14ce('0x13')]][_0x14ce('0x3e')]=!![];}if(!_[_0x14ce('0x1d')](_0xfdec1e[_0x14ce('0x37')][_0x14ce('0x3f')])){channels[_0xfdec1e['uniqueid']][_0x14ce('0x40')]=_0xfdec1e[_0x14ce('0x39')];}if(!_[_0x14ce('0x1d')](_0xfdec1e[_0x14ce('0x37')][_0x14ce('0x41')])){channels[_0xfdec1e[_0x14ce('0x13')]][_0x14ce('0x8')]=_0xfdec1e[_0x14ce('0x39')];}if(!_[_0x14ce('0x1d')](_0xfdec1e[_0x14ce('0x37')][_0x14ce('0x42')])){channels[_0xfdec1e[_0x14ce('0x13')]][_0x14ce('0x43')]=_0xfdec1e[_0x14ce('0x39')];}if(!_[_0x14ce('0x1d')](_0xfdec1e[_0x14ce('0x37')]['sipcallid'])){channels[_0xfdec1e[_0x14ce('0x13')]]['sipcallid']=_0xfdec1e['value'];}}}catch(_0x46faa2){utils[_0x14ce('0x1b')](_0x46faa2[_0x14ce('0x1c')]);}};exports['newexten']=function(_0x4f2ca8){try{if(!_[_0x14ce('0x1d')](channels[_0x4f2ca8['uniqueid']])){if(_0x4f2ca8[_0x14ce('0x44')][_0x14ce('0x45')]()==_0x14ce('0x46')&&_[_0x14ce('0x47')](_0x4f2ca8[_0x14ce('0x48')]['toLowerCase'](),_0x14ce('0x49'))){var _0x23e521=_0x4f2ca8[_0x14ce('0x48')][_0x14ce('0x4a')]('=');var _0x5671d0=_0x23e521[0x0]['substring'](_0x23e521[0x0][_0x14ce('0x4b')]('(')+0x1,_0x23e521[0x0][_0x14ce('0x4b')](')'));var _0x21a549=_0x23e521[0x1];channels[_0x4f2ca8['uniqueid']][_0x5671d0]=_0x21a549;}if(!_[_0x14ce('0x4c')]([_0x14ce('0x4d'),_0x14ce('0x4e'),_0x14ce('0x4f'),'set',_0x14ce('0x50')],_0x4f2ca8[_0x14ce('0x44')][_0x14ce('0x45')]())){channels[_0x4f2ca8[_0x14ce('0x13')]][_0x14ce('0x3c')]=_0x4f2ca8[_0x14ce('0x44')];channels[_0x4f2ca8[_0x14ce('0x13')]]['lastdata']=_0x4f2ca8[_0x14ce('0x48')];}}}catch(_0x54cb64){utils[_0x14ce('0x1b')](_0x54cb64['stack']);}}; \ No newline at end of file +var _0xed5c=['xmcs-queue','Queue','lastdata','outboundrouteid','routeid','sipcallid','newexten','application','set','startsWith','appdata','toLowerCase','cdr','split','substring','lastIndexOf','includes','gotoif','lodash','util','NO\x20ANSWER','FAILED','BUSY','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','type','accountcode','callerid','disposition','getUserByInternal','request','newchannel','OutgoingSpoolFailed','calleridnum','now','DOCUMENTATION','error','newstate','isNil','systemanswertime','linkedid','channelstate','context','destinationchannel','answertime','toNumber','hangup','endtime','duration','starttime','billableseconds','diffTime','stack','attendedtransfer','localtwolinkedid','userfield','origtransfererchannel','musiconholdstart','musiconholdstop','musiconholdstartAt','varset','xmd-originatecalleridnum','source','value','variable','xmd-phone','destination','xmd-callerid-preview','xmd-callerid','xmd-queue'];(function(_0x45ef0c,_0x4ce68e){var _0xec25b8=function(_0x5ae2bd){while(--_0x5ae2bd){_0x45ef0c['push'](_0x45ef0c['shift']());}};_0xec25b8(++_0x4ce68e);}(_0xed5c,0x132));var _0xced5=function(_0x461a4f,_0x45c4ef){_0x461a4f=_0x461a4f-0x0;var _0x36dbf8=_0xed5c[_0x461a4f];return _0x36dbf8;};'use strict';var _=require(_0xced5('0x0'));var util=require(_0xced5('0x1'));var utils=require('./utils');var dispositions=[_0xced5('0x2'),_0xced5('0x3'),_0xced5('0x3'),'NO\x20ANSWER','NO\x20ANSWER',_0xced5('0x2'),'ANSWERED',_0xced5('0x4'),_0xced5('0x3'),'FAILED',_0xced5('0x3')];var channels={};function writeDB(_0x49aa3e){utils['info'](util[_0xced5('0x5')](_0xced5('0x6'),_0x49aa3e[_0xced5('0x7')],_0x49aa3e[_0xced5('0x8')],_0x49aa3e[_0xced5('0x9')],_0x49aa3e[_0xced5('0xa')],_0x49aa3e['source'],_0x49aa3e['destination'],_0x49aa3e[_0xced5('0xb')],_0x49aa3e[_0xced5('0xc')]));if(_0x49aa3e[_0xced5('0xa')]){utils[_0xced5('0xd')](_0x49aa3e[_0xced5('0xa')])['then'](function(_0x7717d3){if(_0x7717d3){_0x49aa3e['UserId']=_0x7717d3['id'];}utils[_0xced5('0xe')]('CreateVoiceCallReport',_0x49aa3e);});}else{utils['request']('CreateVoiceCallReport',_0x49aa3e);}if(channels[_0x49aa3e[_0xced5('0x7')]]){delete channels[_0x49aa3e[_0xced5('0x7')]];}}exports[_0xced5('0xf')]=function(_0x1ab255){try{if(_0x1ab255[_0xced5('0x7')]==_0x1ab255['linkedid']&&_0x1ab255[_0xced5('0x8')]!=_0xced5('0x10')){channels[_0x1ab255[_0xced5('0x7')]]={'uniqueid':_0x1ab255['uniqueid'],'accountcode':_0x1ab255[_0xced5('0xa')],'source':_0x1ab255[_0xced5('0x11')],'destination':_0x1ab255['exten'],'destinationcontext':_0x1ab255['context'],'channel':_0x1ab255[_0xced5('0x8')],'starttime':utils[_0xced5('0x12')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xced5('0x2'),'amaflags':_0xced5('0x13')};}}catch(_0x4df3dd){utils[_0xced5('0x14')](_0x4df3dd['stack']);}};exports[_0xced5('0x15')]=function(_0x4b10f7){try{if(!_[_0xced5('0x16')](channels[_0x4b10f7['uniqueid']])&&_0x4b10f7['channelstate']==0x6){if(_['isNil'](channels[_0x4b10f7[_0xced5('0x7')]][_0xced5('0x17')])){channels[_0x4b10f7[_0xced5('0x7')]][_0xced5('0x17')]=utils[_0xced5('0x12')]();}}else if(!_[_0xced5('0x16')](channels[_0x4b10f7[_0xced5('0x18')]])&&_0x4b10f7[_0xced5('0x19')]==0x6&&_0x4b10f7[_0xced5('0x1a')]!='transfer'){channels[_0x4b10f7['linkedid']][_0xced5('0xa')]=_0x4b10f7['accountcode'];channels[_0x4b10f7[_0xced5('0x18')]][_0xced5('0x1b')]=_0x4b10f7[_0xced5('0x8')];if(_[_0xced5('0x16')](channels[_0x4b10f7[_0xced5('0x18')]][_0xced5('0x1c')])){channels[_0x4b10f7[_0xced5('0x18')]][_0xced5('0x1c')]=utils[_0xced5('0x12')]();}channels[_0x4b10f7[_0xced5('0x18')]][_0xced5('0xc')]=dispositions[_[_0xced5('0x1d')](_0x4b10f7[_0xced5('0x19')])]||'ANSWERED';}}catch(_0x488400){utils[_0xced5('0x14')](_0x488400['stack']);}};exports[_0xced5('0x1e')]=function(_0x51ab29){try{if(!_[_0xced5('0x16')](channels[_0x51ab29[_0xced5('0x7')]])){if(_[_0xced5('0x16')](channels[_0x51ab29[_0xced5('0x7')]][_0xced5('0xb')])){channels[_0x51ab29[_0xced5('0x7')]][_0xced5('0xb')]=_0x51ab29['calleridname']+'\x20<'+_0x51ab29['calleridnum']+'>';}channels[_0x51ab29[_0xced5('0x7')]][_0xced5('0x1f')]=utils[_0xced5('0x12')]();channels[_0x51ab29['uniqueid']][_0xced5('0x20')]=utils['diffTime'](channels[_0x51ab29[_0xced5('0x7')]]['endtime'],channels[_0x51ab29[_0xced5('0x7')]][_0xced5('0x21')]);channels[_0x51ab29[_0xced5('0x7')]][_0xced5('0x22')]=channels[_0x51ab29[_0xced5('0x7')]][_0xced5('0x1c')]?utils[_0xced5('0x23')](channels[_0x51ab29[_0xced5('0x7')]][_0xced5('0x1f')],channels[_0x51ab29['uniqueid']][_0xced5('0x1c')]):0x0;writeDB(channels[_0x51ab29[_0xced5('0x7')]]);}}catch(_0x1c7134){utils['error'](_0x1c7134[_0xced5('0x24')]);}};exports[_0xced5('0x25')]=function(_0x2d5777){try{if(!_[_0xced5('0x16')](channels[_0x2d5777['localtwolinkedid']])){if(channels[_0x2d5777[_0xced5('0x26')]][_0xced5('0x8')]==_0x2d5777['transfereechannel']){channels[_0x2d5777[_0xced5('0x26')]][_0xced5('0x1b')]=_0x2d5777['secondtransfererchannel'];channels[_0x2d5777[_0xced5('0x26')]][_0xced5('0x27')]='_attended';}else if(channels[_0x2d5777['localtwolinkedid']][_0xced5('0x8')]=_0x2d5777['transfertargetchannel']){channels[_0x2d5777[_0xced5('0x26')]][_0xced5('0x1b')]=_0x2d5777[_0xced5('0x28')];channels[_0x2d5777[_0xced5('0x26')]][_0xced5('0x27')]='_attended';}}}catch(_0xd3fec){utils[_0xced5('0x14')](_0xd3fec[_0xced5('0x24')]);}};exports[_0xced5('0x29')]=function(_0x5b1d25){try{if(!_['isNil'](channels[_0x5b1d25[_0xced5('0x7')]])){channels[_0x5b1d25[_0xced5('0x7')]]['musiconholdstartAt']=utils[_0xced5('0x12')]();}}catch(_0xe53151){utils[_0xced5('0x14')](_0xe53151[_0xced5('0x24')]);}};exports[_0xced5('0x2a')]=function(_0x57ba54){try{if(!_[_0xced5('0x16')](channels[_0x57ba54[_0xced5('0x7')]])){if(!_[_0xced5('0x16')](channels[_0x57ba54['uniqueid']]['musiconholdstartAt'])){channels[_0x57ba54[_0xced5('0x7')]]['mohtime']+=utils['diffTime'](utils[_0xced5('0x12')](),channels[_0x57ba54['uniqueid']]['musiconholdstartAt']);delete channels[_0x57ba54['uniqueid']][_0xced5('0x2b')];}}}catch(_0x486aeb){utils[_0xced5('0x14')](_0x486aeb[_0xced5('0x24')]);}};exports[_0xced5('0x2c')]=function(_0x23df91){try{if(!_[_0xced5('0x16')](channels[_0x23df91[_0xced5('0x7')]])){if(!_[_0xced5('0x16')](_0x23df91['variable'][_0xced5('0x2d')])){channels[_0x23df91[_0xced5('0x7')]][_0xced5('0x2e')]=_0x23df91[_0xced5('0x2f')];}if(!_[_0xced5('0x16')](_0x23df91[_0xced5('0x30')][_0xced5('0x31')])){channels[_0x23df91[_0xced5('0x7')]][_0xced5('0x32')]=_0x23df91['value'];channels[_0x23df91[_0xced5('0x7')]][_0xced5('0xb')]='\x22'+_0x23df91[_0xced5('0x2f')]+'\x22\x20<'+_0x23df91[_0xced5('0x2f')]+'>';}if(!_[_0xced5('0x16')](_0x23df91['variable'][_0xced5('0x33')])||!_[_0xced5('0x16')](_0x23df91[_0xced5('0x30')][_0xced5('0x34')])){channels[_0x23df91[_0xced5('0x7')]][_0xced5('0xb')]=_0x23df91['value'];}if(!_[_0xced5('0x16')](_0x23df91[_0xced5('0x30')][_0xced5('0x35')])||!_['isNil'](_0x23df91[_0xced5('0x30')][_0xced5('0x36')])){channels[_0x23df91['uniqueid']]['lastapplication']=_0xced5('0x37');channels[_0x23df91[_0xced5('0x7')]][_0xced5('0x38')]=_0x23df91['value'];channels[_0x23df91['uniqueid']]['queue']=!![];}if(!_['isNil'](_0x23df91[_0xced5('0x30')]['xmd-contactid'])){channels[_0x23df91[_0xced5('0x7')]]['ContactId']=_0x23df91[_0xced5('0x2f')];}if(!_[_0xced5('0x16')](_0x23df91['variable']['xmd-cdrtype'])){channels[_0x23df91[_0xced5('0x7')]][_0xced5('0x9')]=_0x23df91[_0xced5('0x2f')];}if(!_[_0xced5('0x16')](_0x23df91['variable'][_0xced5('0x39')])){channels[_0x23df91[_0xced5('0x7')]][_0xced5('0x3a')]=_0x23df91[_0xced5('0x2f')];}if(!_[_0xced5('0x16')](_0x23df91['variable'][_0xced5('0x3b')])){channels[_0x23df91[_0xced5('0x7')]][_0xced5('0x3b')]=_0x23df91[_0xced5('0x2f')];}}}catch(_0x553011){utils[_0xced5('0x14')](_0x553011[_0xced5('0x24')]);}};exports[_0xced5('0x3c')]=function(_0x567fff){try{if(!_[_0xced5('0x16')](channels[_0x567fff[_0xced5('0x7')]])){if(_0x567fff[_0xced5('0x3d')]['toLowerCase']()==_0xced5('0x3e')&&_[_0xced5('0x3f')](_0x567fff[_0xced5('0x40')][_0xced5('0x41')](),_0xced5('0x42'))){var _0x52c69f=_0x567fff['appdata'][_0xced5('0x43')]('=');var _0x5cf156=_0x52c69f[0x0][_0xced5('0x44')](_0x52c69f[0x0][_0xced5('0x45')]('(')+0x1,_0x52c69f[0x0][_0xced5('0x45')](')'));var _0x20a043=_0x52c69f[0x1];channels[_0x567fff[_0xced5('0x7')]][_0x5cf156]=_0x20a043;}if(!_[_0xced5('0x46')]([_0xced5('0x1e'),'noop','execif',_0xced5('0x3e'),_0xced5('0x47')],_0x567fff[_0xced5('0x3d')]['toLowerCase']())){channels[_0x567fff['uniqueid']]['lastapplication']=_0x567fff['application'];channels[_0x567fff['uniqueid']][_0xced5('0x38')]=_0x567fff[_0xced5('0x40')];}}}catch(_0x56bf44){utils[_0xced5('0x14')](_0x56bf44['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index d3ba1d6..76c4713 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 _0xc1c6=['CONNECTED','info','SHUTDOWN','fullybooted','error','CLOSE','managerevent','./utils','lodash','connect'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x4c6ac7,_0xb4d218){_0x4c6ac7=_0x4c6ac7-0x0;var _0x4001bc=_0xc1c6[_0x4c6ac7];return _0x4001bc;};'use strict';var utils=require(_0x6c1c('0x0'));var _=require(_0x6c1c('0x1'));exports[_0x6c1c('0x2')]=function(){utils['info'](_0x6c1c('0x3'));};exports['shutdown']=function(){utils[_0x6c1c('0x4')](_0x6c1c('0x5'));};exports[_0x6c1c('0x6')]=function(){utils['info']('FULLYBOOTED');};exports[_0x6c1c('0x7')]=function(_0x524a6b){utils[_0x6c1c('0x7')](_0x524a6b);};exports['close']=function(){utils[_0x6c1c('0x4')](_0x6c1c('0x8'));};exports[_0x6c1c('0x9')]=function(_0x2cec58){}; \ No newline at end of file +var _0xc7a3=['CONNECTED','shutdown','fullybooted','error','managerevent','lodash','connect','info'];(function(_0x439608,_0x13c7b4){var _0xd953a8=function(_0x3c4d6a){while(--_0x3c4d6a){_0x439608['push'](_0x439608['shift']());}};_0xd953a8(++_0x13c7b4);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x439184,_0x2ab98d){_0x439184=_0x439184-0x0;var _0x4d733b=_0xc7a3[_0x439184];return _0x4d733b;};'use strict';var utils=require('./utils');var _=require(_0x3c7a('0x0'));exports[_0x3c7a('0x1')]=function(){utils[_0x3c7a('0x2')](_0x3c7a('0x3'));};exports[_0x3c7a('0x4')]=function(){utils[_0x3c7a('0x2')]('SHUTDOWN');};exports[_0x3c7a('0x5')]=function(){utils[_0x3c7a('0x2')]('FULLYBOOTED');};exports[_0x3c7a('0x6')]=function(_0x2051ce){utils[_0x3c7a('0x6')](_0x2051ce);};exports['close']=function(){utils[_0x3c7a('0x2')]('CLOSE');};exports[_0x3c7a('0x7')]=function(_0x5a6fbf){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 9bb7a3f..f68a515 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 _0x5193=['diffTime','endtime','billableseconds','lodash','util','./utils','info','format','DIAL|%s|%s|%s|%s|%s|%s','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','newexten','application','toLowerCase','set','startsWith','appdata','split','error','stack','isNil','variable','outboundrouteid','value','assign','starttime','now','lastevent','called','ANSWER','answertime','connect','complete','duration'];(function(_0x4ac60a,_0x503a99){var _0x4b22e8=function(_0x145c47){while(--_0x145c47){_0x4ac60a['push'](_0x4ac60a['shift']());}};_0x4b22e8(++_0x503a99);}(_0x5193,0x143));var _0x3519=function(_0x2a676e,_0xe0535d){_0x2a676e=_0x2a676e-0x0;var _0x36b87a=_0x5193[_0x2a676e];return _0x36b87a;};'use strict';var _=require(_0x3519('0x0'));var util=require(_0x3519('0x1'));var utils=require(_0x3519('0x2'));var dials={};function writeDB(_0x4d4057){utils[_0x3519('0x3')](util[_0x3519('0x4')](_0x3519('0x5'),_0x4d4057['uniqueid'],_0x4d4057[_0x3519('0x6')],_0x4d4057[_0x3519('0x7')],_0x4d4057[_0x3519('0x8')],_0x4d4057[_0x3519('0x9')],_0x4d4057[_0x3519('0xa')]));utils[_0x3519('0xb')](_0x3519('0xc'),_0x4d4057);delete dials[_0x4d4057[_0x3519('0xd')]];}exports[_0x3519('0xe')]=function(_0x16a6a0){try{if(_0x16a6a0[_0x3519('0xf')][_0x3519('0x10')]()==_0x3519('0x11')&&_[_0x3519('0x12')](_0x16a6a0[_0x3519('0x13')][_0x3519('0x10')](),'cdr(routeid)')){var _0x4ff42b=_0x16a6a0['appdata'][_0x3519('0x14')]('=');dials[_0x16a6a0[_0x3519('0xd')]]={'routeId':_0x4ff42b[0x1]};}}catch(_0x6a1924){utils[_0x3519('0x15')](_0x6a1924[_0x3519('0x16')]);}};exports['varset']=function(_0x3b5e1e){try{if(!_[_0x3519('0x17')](_0x3b5e1e[_0x3519('0x18')][_0x3519('0x19')])){dials[_0x3b5e1e[_0x3519('0xd')]]={'routeId':_0x3b5e1e[_0x3519('0x1a')]};}}catch(_0x238393){utils['error'](_0x238393[_0x3519('0x16')]);}};exports['dialbegin']=function(_0x28353d){try{if(!_[_0x3519('0x17')](dials[_0x28353d[_0x3519('0xd')]])){dials[_0x28353d[_0x3519('0xd')]]=_[_0x3519('0x1b')](dials[_0x28353d['uniqueid']],_0x28353d);dials[_0x28353d[_0x3519('0xd')]][_0x3519('0x1c')]=utils[_0x3519('0x1d')]();dials[_0x28353d['uniqueid']][_0x3519('0x1e')]=_0x3519('0x1f');}}catch(_0x5ca320){utils[_0x3519('0x15')](_0x5ca320[_0x3519('0x16')]);}};exports['dialend']=function(_0x35a346){try{if(!_[_0x3519('0x17')](dials[_0x35a346[_0x3519('0xd')]])){dials[_0x35a346[_0x3519('0xd')]][_0x3519('0xa')]=_0x35a346['dialstatus'];if(_0x35a346[_0x3519('0xa')]==_0x3519('0x20')){dials[_0x35a346[_0x3519('0xd')]]=_[_0x3519('0x1b')](dials[_0x35a346[_0x3519('0xd')]],_0x35a346);dials[_0x35a346[_0x3519('0xd')]][_0x3519('0x21')]=utils[_0x3519('0x1d')]();dials[_0x35a346[_0x3519('0xd')]][_0x3519('0x1e')]=_0x3519('0x22');}}}catch(_0xe9a7a9){utils[_0x3519('0x15')](_0xe9a7a9[_0x3519('0x16')]);}};exports['hangup']=function(_0xefdfbf){try{if(!_[_0x3519('0x17')](dials[_0xefdfbf[_0x3519('0xd')]])){dials[_0xefdfbf[_0x3519('0xd')]]=_['assign'](dials[_0xefdfbf[_0x3519('0xd')]],{'endtime':utils[_0x3519('0x1d')](),'lastevent':_0x3519('0x23')});dials[_0xefdfbf[_0x3519('0xd')]][_0x3519('0x24')]=utils['diffTime'](dials[_0xefdfbf[_0x3519('0xd')]]['endtime'],dials[_0xefdfbf[_0x3519('0xd')]][_0x3519('0x1c')]);dials[_0xefdfbf[_0x3519('0xd')]]['holdtime']=utils[_0x3519('0x25')](dials[_0xefdfbf[_0x3519('0xd')]][_0x3519('0x21')]||dials[_0xefdfbf['uniqueid']][_0x3519('0x26')],dials[_0xefdfbf['uniqueid']][_0x3519('0x1c')]);dials[_0xefdfbf['uniqueid']][_0x3519('0x27')]=dials[_0xefdfbf[_0x3519('0xd')]][_0x3519('0x21')]?utils[_0x3519('0x25')](dials[_0xefdfbf[_0x3519('0xd')]][_0x3519('0x26')],dials[_0xefdfbf[_0x3519('0xd')]][_0x3519('0x21')]):0x0;writeDB(dials[_0xefdfbf[_0x3519('0xd')]]);}}catch(_0x344fcb){utils[_0x3519('0x15')](_0x344fcb['stack']);}}; \ No newline at end of file +var _0x4c68=['./utils','DIAL|%s|%s|%s|%s|%s|%s','channel','dialstring','calleridnum','dialstatus','request','CreateVoiceDialReport','uniqueid','newexten','application','toLowerCase','startsWith','appdata','cdr(routeid)','split','stack','varset','isNil','variable','outboundrouteid','value','error','dialbegin','assign','starttime','called','dialend','ANSWER','answertime','now','lastevent','connect','hangup','complete','duration','diffTime','endtime','billableseconds','lodash','util'];(function(_0x3b9081,_0x3fa328){var _0x83354a=function(_0x17969a){while(--_0x17969a){_0x3b9081['push'](_0x3b9081['shift']());}};_0x83354a(++_0x3fa328);}(_0x4c68,0x198));var _0x84c6=function(_0xa388a2,_0x40bde6){_0xa388a2=_0xa388a2-0x0;var _0x7ce7f6=_0x4c68[_0xa388a2];return _0x7ce7f6;};'use strict';var _=require(_0x84c6('0x0'));var util=require(_0x84c6('0x1'));var utils=require(_0x84c6('0x2'));var dials={};function writeDB(_0x6bb2f1){utils['info'](util['format'](_0x84c6('0x3'),_0x6bb2f1['uniqueid'],_0x6bb2f1[_0x84c6('0x4')],_0x6bb2f1[_0x84c6('0x5')],_0x6bb2f1[_0x84c6('0x6')],_0x6bb2f1['connectedlinenum'],_0x6bb2f1[_0x84c6('0x7')]));utils[_0x84c6('0x8')](_0x84c6('0x9'),_0x6bb2f1);delete dials[_0x6bb2f1[_0x84c6('0xa')]];}exports[_0x84c6('0xb')]=function(_0x4a1c3f){try{if(_0x4a1c3f[_0x84c6('0xc')][_0x84c6('0xd')]()=='set'&&_[_0x84c6('0xe')](_0x4a1c3f[_0x84c6('0xf')][_0x84c6('0xd')](),_0x84c6('0x10'))){var _0x31e3c1=_0x4a1c3f['appdata'][_0x84c6('0x11')]('=');dials[_0x4a1c3f['uniqueid']]={'routeId':_0x31e3c1[0x1]};}}catch(_0xee1cbf){utils['error'](_0xee1cbf[_0x84c6('0x12')]);}};exports[_0x84c6('0x13')]=function(_0x28aaed){try{if(!_[_0x84c6('0x14')](_0x28aaed[_0x84c6('0x15')][_0x84c6('0x16')])){dials[_0x28aaed['uniqueid']]={'routeId':_0x28aaed[_0x84c6('0x17')]};}}catch(_0x3f9902){utils[_0x84c6('0x18')](_0x3f9902['stack']);}};exports[_0x84c6('0x19')]=function(_0x700b21){try{if(!_['isNil'](dials[_0x700b21[_0x84c6('0xa')]])){dials[_0x700b21[_0x84c6('0xa')]]=_[_0x84c6('0x1a')](dials[_0x700b21[_0x84c6('0xa')]],_0x700b21);dials[_0x700b21[_0x84c6('0xa')]][_0x84c6('0x1b')]=utils['now']();dials[_0x700b21['uniqueid']]['lastevent']=_0x84c6('0x1c');}}catch(_0x3aa4cb){utils[_0x84c6('0x18')](_0x3aa4cb['stack']);}};exports[_0x84c6('0x1d')]=function(_0x27ca68){try{if(!_[_0x84c6('0x14')](dials[_0x27ca68['uniqueid']])){dials[_0x27ca68[_0x84c6('0xa')]][_0x84c6('0x7')]=_0x27ca68[_0x84c6('0x7')];if(_0x27ca68[_0x84c6('0x7')]==_0x84c6('0x1e')){dials[_0x27ca68[_0x84c6('0xa')]]=_[_0x84c6('0x1a')](dials[_0x27ca68[_0x84c6('0xa')]],_0x27ca68);dials[_0x27ca68[_0x84c6('0xa')]][_0x84c6('0x1f')]=utils[_0x84c6('0x20')]();dials[_0x27ca68[_0x84c6('0xa')]][_0x84c6('0x21')]=_0x84c6('0x22');}}}catch(_0x41cf39){utils[_0x84c6('0x18')](_0x41cf39[_0x84c6('0x12')]);}};exports[_0x84c6('0x23')]=function(_0x28d036){try{if(!_['isNil'](dials[_0x28d036[_0x84c6('0xa')]])){dials[_0x28d036['uniqueid']]=_[_0x84c6('0x1a')](dials[_0x28d036[_0x84c6('0xa')]],{'endtime':utils['now'](),'lastevent':_0x84c6('0x24')});dials[_0x28d036[_0x84c6('0xa')]][_0x84c6('0x25')]=utils[_0x84c6('0x26')](dials[_0x28d036[_0x84c6('0xa')]]['endtime'],dials[_0x28d036[_0x84c6('0xa')]][_0x84c6('0x1b')]);dials[_0x28d036[_0x84c6('0xa')]]['holdtime']=utils[_0x84c6('0x26')](dials[_0x28d036['uniqueid']]['answertime']||dials[_0x28d036[_0x84c6('0xa')]][_0x84c6('0x27')],dials[_0x28d036[_0x84c6('0xa')]][_0x84c6('0x1b')]);dials[_0x28d036['uniqueid']][_0x84c6('0x28')]=dials[_0x28d036['uniqueid']][_0x84c6('0x1f')]?utils[_0x84c6('0x26')](dials[_0x28d036[_0x84c6('0xa')]][_0x84c6('0x27')],dials[_0x28d036['uniqueid']]['answertime']):0x0;writeDB(dials[_0x28d036[_0x84c6('0xa')]]);}}catch(_0x589bad){utils['error'](_0x589bad[_0x84c6('0x12')]);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 65dc685..79b77f6 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 _0x3a51=['hangup','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','asterisk','port','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate'];(function(_0x1646e6,_0x26e484){var _0x42f2db=function(_0x3fb32c){while(--_0x3fb32c){_0x1646e6['push'](_0x1646e6['shift']());}};_0x42f2db(++_0x26e484);}(_0x3a51,0x1f4));var _0x13a5=function(_0x1f90cd,_0x4ac2b1){_0x1f90cd=_0x1f90cd-0x0;var _0x23e83f=_0x3a51[_0x1f90cd];return _0x23e83f;};var AsteriskManager=require(_0x13a5('0x0'));var config=require(_0x13a5('0x1'));var utils=require('./utils');var ami=new AsteriskManager(config[_0x13a5('0x2')][_0x13a5('0x3')],config['asterisk']['ip'],config[_0x13a5('0x2')][_0x13a5('0x4')],config[_0x13a5('0x2')][_0x13a5('0x5')],!![]);ami[_0x13a5('0x6')]();if(config[_0x13a5('0x7')]&&config['xdr'][_0x13a5('0x8')]){utils[_0x13a5('0x9')](_0x13a5('0xa'));}else{var agents=require(_0x13a5('0xb'));var calls=require(_0x13a5('0xc'));var queues=require(_0x13a5('0xd'));var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require(_0x13a5('0xe'));var transfers=require('./transfers.controller');var core=require(_0x13a5('0xf'));ami['on'](_0x13a5('0x10'),core['connect']);ami['on'](_0x13a5('0x11'),core[_0x13a5('0x11')]);ami['on']('fullybooted',core[_0x13a5('0x12')]);ami['on']('error',core[_0x13a5('0x13')]);ami['on'](_0x13a5('0x14'),core[_0x13a5('0x14')]);ami['on'](_0x13a5('0x15'),core[_0x13a5('0x15')]);ami['on'](_0x13a5('0x16'),function(_0x722e37){try{members[_0x13a5('0x16')](_0x722e37);}catch(_0x55a937){utils['error'](_0x55a937);}});ami['on'](_0x13a5('0x17'),function(_0x34ab28){try{agents[_0x13a5('0x17')](_0x34ab28);}catch(_0x3748ae){utils[_0x13a5('0x13')](_0x3748ae);}});ami['on']('agentringnoanswer',function(_0x43feef){try{agents[_0x13a5('0x18')](_0x43feef);}catch(_0x428f1a){utils[_0x13a5('0x13')](_0x428f1a);}});ami['on'](_0x13a5('0x19'),function(_0x4b464d){try{agents[_0x13a5('0x19')](_0x4b464d);queues[_0x13a5('0x19')](_0x4b464d);}catch(_0xcc274e){utils[_0x13a5('0x13')](_0xcc274e);}});ami['on'](_0x13a5('0x1a'),function(_0x19995c){try{agents[_0x13a5('0x1a')](_0x19995c);queues['agentcomplete'](_0x19995c);members[_0x13a5('0x1a')](_0x19995c);}catch(_0xa21f57){utils[_0x13a5('0x13')](_0xa21f57);}});ami['on'](_0x13a5('0x1b'),function(_0x11c39e){try{agents['queuecallerabandon'](_0x11c39e);queues['queuecallerabandon'](_0x11c39e);}catch(_0x3889e3){utils['error'](_0x3889e3);}});ami['on'](_0x13a5('0x1c'),function(_0x3c40c4){try{queues['queuecallerjoin'](_0x3c40c4);recordings[_0x13a5('0x1c')](_0x3c40c4);}catch(_0x2f21a0){utils['error'](_0x2f21a0);}});ami['on']('queuecallerleave',function(_0xeb99cf){try{queues[_0x13a5('0x1d')](_0xeb99cf);}catch(_0x29ee69){utils['error'](_0x29ee69);}});ami['on']('musiconholdstart',function(_0x5bd7d7){try{queues['musiconholdstart'](_0x5bd7d7);calls[_0x13a5('0x1e')](_0x5bd7d7);}catch(_0x575e3f){utils[_0x13a5('0x13')](_0x575e3f);}});ami['on'](_0x13a5('0x1f'),function(_0x34f82d){try{queues[_0x13a5('0x1f')](_0x34f82d);calls[_0x13a5('0x1f')](_0x34f82d);}catch(_0x3c5aae){utils[_0x13a5('0x13')](_0x3c5aae);}});ami['on'](_0x13a5('0x20'),function(_0x3c64c1){try{calls[_0x13a5('0x20')](_0x3c64c1);recordings[_0x13a5('0x20')](_0x3c64c1);}catch(_0x2ec529){utils[_0x13a5('0x13')](_0x2ec529);}});ami['on'](_0x13a5('0x21'),function(_0x51863d){try{calls[_0x13a5('0x21')](_0x51863d);recordings['hangup'](_0x51863d);dials[_0x13a5('0x21')](_0x51863d);agents[_0x13a5('0x21')](_0x51863d);queues[_0x13a5('0x21')](_0x51863d);}catch(_0x390fd9){utils[_0x13a5('0x13')](_0x390fd9);}});ami['on']('cdr',function(_0x4ba64a){try{members['cdr'](_0x4ba64a);}catch(_0x5e71d9){utils[_0x13a5('0x13')](_0x5e71d9);}});ami['on'](_0x13a5('0x22'),function(_0x140fd7){try{queues[_0x13a5('0x22')](_0x140fd7);agents['blindtransfer'](_0x140fd7);transfers[_0x13a5('0x22')](_0x140fd7);}catch(_0x67f7ef){utils[_0x13a5('0x13')](_0x67f7ef);}});ami['on']('attendedtransfer',function(_0x3a9a48){try{queues[_0x13a5('0x23')](_0x3a9a48);transfers[_0x13a5('0x23')](_0x3a9a48);agents[_0x13a5('0x23')](_0x3a9a48);calls[_0x13a5('0x23')](_0x3a9a48);}catch(_0x2e5dc9){utils[_0x13a5('0x13')](_0x2e5dc9);}});ami['on']('varset',function(_0x58ecb2){try{queues[_0x13a5('0x24')](_0x58ecb2);recordings['varset'](_0x58ecb2);calls[_0x13a5('0x24')](_0x58ecb2);dials[_0x13a5('0x24')](_0x58ecb2);}catch(_0x5313df){utils[_0x13a5('0x13')](_0x5313df);}});ami['on'](_0x13a5('0x25'),function(_0xd46172){try{calls['newexten'](_0xd46172);recordings[_0x13a5('0x25')](_0xd46172);dials[_0x13a5('0x25')](_0xd46172);}catch(_0x9ba916){utils[_0x13a5('0x13')](_0x9ba916);}});ami['on'](_0x13a5('0x26'),function(_0x4606e9){try{calls[_0x13a5('0x26')](_0x4606e9);recordings['newchannel'](_0x4606e9);}catch(_0x5e470b){utils[_0x13a5('0x13')](_0x5e470b);}});ami['on'](_0x13a5('0x27'),function(_0x2dd372){try{dials[_0x13a5('0x27')](_0x2dd372);}catch(_0x587a6a){utils['error'](_0x587a6a);}});ami['on']('dialend',function(_0x56f6eb){try{dials[_0x13a5('0x28')](_0x56f6eb);}catch(_0x35466b){utils[_0x13a5('0x13')](_0x35466b);}});} \ No newline at end of file +var _0xcd83=['./recordings.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','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','../../config/environment','./utils','port','asterisk','password','xdr','disabled','./agents.controller','./calls.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd83,0x6c));var _0x3cd8=function(_0x147a6b,_0x337fa8){_0x147a6b=_0x147a6b-0x0;var _0x498952=_0xcd83[_0x147a6b];return _0x498952;};var AsteriskManager=require('asterisk-manager');var config=require(_0x3cd8('0x0'));var utils=require(_0x3cd8('0x1'));var ami=new AsteriskManager(config['asterisk'][_0x3cd8('0x2')],config[_0x3cd8('0x3')]['ip'],config[_0x3cd8('0x3')]['username'],config[_0x3cd8('0x3')][_0x3cd8('0x4')],!![]);ami['keepConnected']();if(config[_0x3cd8('0x5')]&&config[_0x3cd8('0x5')][_0x3cd8('0x6')]){utils['info']('XDR\x20DISABLED');}else{var agents=require(_0x3cd8('0x7'));var calls=require(_0x3cd8('0x8'));var queues=require('./queues.controller');var recordings=require(_0x3cd8('0x9'));var members=require('./members.controller');var dials=require(_0x3cd8('0xa'));var transfers=require(_0x3cd8('0xb'));var core=require(_0x3cd8('0xc'));ami['on'](_0x3cd8('0xd'),core[_0x3cd8('0xd')]);ami['on'](_0x3cd8('0xe'),core[_0x3cd8('0xe')]);ami['on'](_0x3cd8('0xf'),core[_0x3cd8('0xf')]);ami['on'](_0x3cd8('0x10'),core['error']);ami['on'](_0x3cd8('0x11'),core[_0x3cd8('0x11')]);ami['on'](_0x3cd8('0x12'),core[_0x3cd8('0x12')]);ami['on'](_0x3cd8('0x13'),function(_0x595d67){try{members[_0x3cd8('0x13')](_0x595d67);}catch(_0x4705b8){utils[_0x3cd8('0x10')](_0x4705b8);}});ami['on'](_0x3cd8('0x14'),function(_0x31569c){try{agents[_0x3cd8('0x14')](_0x31569c);}catch(_0x2b6983){utils[_0x3cd8('0x10')](_0x2b6983);}});ami['on'](_0x3cd8('0x15'),function(_0x5498ca){try{agents[_0x3cd8('0x15')](_0x5498ca);}catch(_0x24faab){utils[_0x3cd8('0x10')](_0x24faab);}});ami['on']('agentconnect',function(_0x7aa2db){try{agents[_0x3cd8('0x16')](_0x7aa2db);queues[_0x3cd8('0x16')](_0x7aa2db);}catch(_0x2d93bc){utils['error'](_0x2d93bc);}});ami['on'](_0x3cd8('0x17'),function(_0x13241e){try{agents['agentcomplete'](_0x13241e);queues[_0x3cd8('0x17')](_0x13241e);members['agentcomplete'](_0x13241e);}catch(_0x174dd0){utils['error'](_0x174dd0);}});ami['on']('queuecallerabandon',function(_0x35a616){try{agents[_0x3cd8('0x18')](_0x35a616);queues['queuecallerabandon'](_0x35a616);}catch(_0x1311f9){utils[_0x3cd8('0x10')](_0x1311f9);}});ami['on'](_0x3cd8('0x19'),function(_0x1fe9a4){try{queues['queuecallerjoin'](_0x1fe9a4);recordings[_0x3cd8('0x19')](_0x1fe9a4);}catch(_0x16d16b){utils[_0x3cd8('0x10')](_0x16d16b);}});ami['on'](_0x3cd8('0x1a'),function(_0x510379){try{queues['queuecallerleave'](_0x510379);}catch(_0x304648){utils[_0x3cd8('0x10')](_0x304648);}});ami['on'](_0x3cd8('0x1b'),function(_0x372178){try{queues[_0x3cd8('0x1b')](_0x372178);calls['musiconholdstart'](_0x372178);}catch(_0x2de672){utils[_0x3cd8('0x10')](_0x2de672);}});ami['on']('musiconholdstop',function(_0x499199){try{queues[_0x3cd8('0x1c')](_0x499199);calls['musiconholdstop'](_0x499199);}catch(_0x29487a){utils[_0x3cd8('0x10')](_0x29487a);}});ami['on'](_0x3cd8('0x1d'),function(_0x4834e6){try{calls[_0x3cd8('0x1d')](_0x4834e6);recordings[_0x3cd8('0x1d')](_0x4834e6);}catch(_0x13b550){utils['error'](_0x13b550);}});ami['on'](_0x3cd8('0x1e'),function(_0x116822){try{calls['hangup'](_0x116822);recordings['hangup'](_0x116822);dials['hangup'](_0x116822);agents[_0x3cd8('0x1e')](_0x116822);queues[_0x3cd8('0x1e')](_0x116822);}catch(_0x45bd33){utils[_0x3cd8('0x10')](_0x45bd33);}});ami['on'](_0x3cd8('0x1f'),function(_0x4ff549){try{members[_0x3cd8('0x1f')](_0x4ff549);}catch(_0x557792){utils[_0x3cd8('0x10')](_0x557792);}});ami['on'](_0x3cd8('0x20'),function(_0x34bc49){try{queues[_0x3cd8('0x20')](_0x34bc49);agents['blindtransfer'](_0x34bc49);transfers[_0x3cd8('0x20')](_0x34bc49);}catch(_0x219be1){utils[_0x3cd8('0x10')](_0x219be1);}});ami['on'](_0x3cd8('0x21'),function(_0x57c2b7){try{queues[_0x3cd8('0x21')](_0x57c2b7);transfers['attendedtransfer'](_0x57c2b7);agents[_0x3cd8('0x21')](_0x57c2b7);calls[_0x3cd8('0x21')](_0x57c2b7);}catch(_0xabb0d5){utils[_0x3cd8('0x10')](_0xabb0d5);}});ami['on']('varset',function(_0x540159){try{queues['varset'](_0x540159);recordings['varset'](_0x540159);calls[_0x3cd8('0x22')](_0x540159);dials[_0x3cd8('0x22')](_0x540159);}catch(_0x320656){utils[_0x3cd8('0x10')](_0x320656);}});ami['on']('newexten',function(_0x3da35e){try{calls[_0x3cd8('0x23')](_0x3da35e);recordings[_0x3cd8('0x23')](_0x3da35e);dials[_0x3cd8('0x23')](_0x3da35e);}catch(_0x41dd54){utils[_0x3cd8('0x10')](_0x41dd54);}});ami['on']('newchannel',function(_0x59353c){try{calls[_0x3cd8('0x24')](_0x59353c);recordings[_0x3cd8('0x24')](_0x59353c);}catch(_0x1fa813){utils['error'](_0x1fa813);}});ami['on'](_0x3cd8('0x25'),function(_0x48fc8e){try{dials[_0x3cd8('0x25')](_0x48fc8e);}catch(_0x4f8f84){utils[_0x3cd8('0x10')](_0x4f8f84);}});ami['on'](_0x3cd8('0x26'),function(_0x3e5608){try{dials[_0x3cd8('0x26')](_0x3e5608);}catch(_0x16dfd5){utils[_0x3cd8('0x10')](_0x16dfd5);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index e8953e4..d1c175c 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 _0x3d8d=['duration','diffTime','enterAt','agentcomplete','channel','assign','data1','data3','destination','destinationchannel','source','lodash','util','./utils','Local/_attended@transfer','Queue:','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','data2','type','then','membername','name','internal','request','getUserByName','split','CreateMemberReport','catch','some','state','INUSE','BUSY','device','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt'];(function(_0x44314b,_0x546bbf){var _0x1a63e8=function(_0xd0175){while(--_0xd0175){_0x44314b['push'](_0x44314b['shift']());}};_0x1a63e8(++_0x546bbf);}(_0x3d8d,0x1b9));var _0xd3d8=function(_0xfa2e1e,_0x4002ed){_0xfa2e1e=_0xfa2e1e-0x0;var _0x2f1d12=_0x3d8d[_0xfa2e1e];return _0x2f1d12;};'use strict';var _=require(_0xd3d8('0x0'));var util=require(_0xd3d8('0x1'));var utils=require(_0xd3d8('0x2'));var members={};var exclude=[_0xd3d8('0x3'),_0xd3d8('0x4')];function writeDB(_0x75c42c){utils['info'](util[_0xd3d8('0x5')](_0xd3d8('0x6'),_0x75c42c[_0xd3d8('0x7')],_0x75c42c[_0xd3d8('0x8')],_0x75c42c['channel'],_0x75c42c[_0xd3d8('0x9')],_0x75c42c['membername'],_0x75c42c[_0xd3d8('0xa')]));if(_0x75c42c[_0xd3d8('0x8')]){utils['getUserByInterface'](_0x75c42c[_0xd3d8('0x8')])[_0xd3d8('0xb')](function(_0x90441f){if(_0x90441f){_0x75c42c[_0xd3d8('0xc')]=_0x90441f[_0xd3d8('0xd')];_0x75c42c[_0xd3d8('0xe')]=_0x90441f[_0xd3d8('0xe')];utils[_0xd3d8('0xf')]('CreateMemberReport',_0x75c42c);}else{utils[_0xd3d8('0x10')](_0x75c42c['interface'][_0xd3d8('0x11')]('/')[0x1])[_0xd3d8('0xb')](function(_0x166ccc){if(_0x166ccc){_0x75c42c[_0xd3d8('0xc')]=_0x166ccc[_0xd3d8('0xd')];_0x75c42c[_0xd3d8('0xe')]=_0x166ccc[_0xd3d8('0xe')];utils[_0xd3d8('0xf')](_0xd3d8('0x12'),_0x75c42c);}});}})[_0xd3d8('0x13')](function(_0x238f97){utils['error'](_0x238f97);});}delete members[_0x75c42c['interface']];}function startsWith(_0x2e3b4e,_0x454a92){return _[_0xd3d8('0x14')](_0x2e3b4e,function(_0x33ba0d){return _['startsWith'](_0x454a92,_0x33ba0d);});}exports['devicestatechange']=function(_0x46a323){switch(_0x46a323[_0xd3d8('0x15')]){case _0xd3d8('0x16'):case _0xd3d8('0x17'):if(!startsWith(exclude,_0x46a323[_0xd3d8('0x18')])){members[_0x46a323[_0xd3d8('0x18')]]={'channel':_0xd3d8('0x19'),'interface':_0x46a323[_0xd3d8('0x18')],'type':_0xd3d8('0x1a'),'enterAt':utils[_0xd3d8('0x1b')](),'role':_0xd3d8('0x1c')};}break;case _0xd3d8('0x1d'):if(!_[_0xd3d8('0x1e')](members[_0x46a323['device']])){members[_0x46a323[_0xd3d8('0x18')]][_0xd3d8('0x1f')]=utils['now']();members[_0x46a323[_0xd3d8('0x18')]][_0xd3d8('0x20')]=utils[_0xd3d8('0x21')](members[_0x46a323['device']][_0xd3d8('0x1f')],members[_0x46a323[_0xd3d8('0x18')]][_0xd3d8('0x22')]);if(members[_0x46a323[_0xd3d8('0x18')]]['uniqueid']){writeDB(members[_0x46a323[_0xd3d8('0x18')]]);}}default:break;}};exports[_0xd3d8('0x23')]=function(_0x336f87){if(!_[_0xd3d8('0x1e')](members[_0x336f87['interface']])){members[_0x336f87[_0xd3d8('0x8')]]=_['assign'](members[_0x336f87['interface']],{'data4':_0x336f87['queue'],'uniqueid':_0x336f87[_0xd3d8('0x7')]});}};exports['cdr']=function(_0x59a354){if(_0x59a354[_0xd3d8('0x24')]){var _0x5008e3=_0x59a354[_0xd3d8('0x24')][_0xd3d8('0x11')]('-')[0x0];if(!_[_0xd3d8('0x1e')](members[_0x5008e3])){members[_0x5008e3]=_[_0xd3d8('0x25')](members[_0x5008e3],{'data1':members[_0x5008e3][_0xd3d8('0x26')]||_0x59a354[_0xd3d8('0xa')],'data2':members[_0x5008e3][_0xd3d8('0x9')]||_0x59a354['source'],'data3':members[_0x5008e3][_0xd3d8('0x27')]||_0x59a354[_0xd3d8('0x28')],'uniqueid':members[_0x5008e3][_0xd3d8('0x7')]||_0x59a354['uniqueid']});if(members[_0x5008e3][_0xd3d8('0x1f')]){writeDB(members[_0x5008e3]);}}}if(_0x59a354['destinationchannel']){var _0x494c1f=_0x59a354[_0xd3d8('0x29')]['split']('-')[0x0];if(!_[_0xd3d8('0x1e')](members[_0x494c1f])){members[_0x494c1f]=_[_0xd3d8('0x25')](members[_0x494c1f],{'data1':members[_0x494c1f][_0xd3d8('0x26')]||_0x59a354[_0xd3d8('0xa')],'data2':members[_0x494c1f][_0xd3d8('0x9')]||_0x59a354[_0xd3d8('0x2a')],'data3':members[_0x494c1f][_0xd3d8('0x27')]||_0x59a354['destination'],'uniqueid':members[_0x494c1f]['uniqueid']||_0x59a354[_0xd3d8('0x7')]});if(members[_0x494c1f][_0xd3d8('0x1f')]){writeDB(members[_0x494c1f]);}}}}; \ No newline at end of file +var _0x57c1=['cdr','data1','source','data3','destination','destinationchannel','lodash','util','Local/_attended@transfer','info','MEMBER|%s|%s|%s|%s|%s|%s','channel','data2','membername','type','interface','getUserByInterface','then','name','internal','request','getUserByName','split','catch','error','some','devicestatechange','INUSE','device','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','enterAt','assign','uniqueid'];(function(_0x4f9999,_0x5ecb3b){var _0x111483=function(_0x57c4a3){while(--_0x57c4a3){_0x4f9999['push'](_0x4f9999['shift']());}};_0x111483(++_0x5ecb3b);}(_0x57c1,0x165));var _0x157c=function(_0x50c3e6,_0x3322fb){_0x50c3e6=_0x50c3e6-0x0;var _0x2d64b4=_0x57c1[_0x50c3e6];return _0x2d64b4;};'use strict';var _=require(_0x157c('0x0'));var util=require(_0x157c('0x1'));var utils=require('./utils');var members={};var exclude=[_0x157c('0x2'),'Queue:'];function writeDB(_0x501388){utils[_0x157c('0x3')](util['format'](_0x157c('0x4'),_0x501388['uniqueid'],_0x501388['interface'],_0x501388[_0x157c('0x5')],_0x501388[_0x157c('0x6')],_0x501388[_0x157c('0x7')],_0x501388[_0x157c('0x8')]));if(_0x501388[_0x157c('0x9')]){utils[_0x157c('0xa')](_0x501388[_0x157c('0x9')])[_0x157c('0xb')](function(_0x3dc575){if(_0x3dc575){_0x501388[_0x157c('0x7')]=_0x3dc575[_0x157c('0xc')];_0x501388[_0x157c('0xd')]=_0x3dc575[_0x157c('0xd')];utils[_0x157c('0xe')]('CreateMemberReport',_0x501388);}else{utils[_0x157c('0xf')](_0x501388['interface'][_0x157c('0x10')]('/')[0x1])[_0x157c('0xb')](function(_0x1ad877){if(_0x1ad877){_0x501388[_0x157c('0x7')]=_0x1ad877['name'];_0x501388[_0x157c('0xd')]=_0x1ad877[_0x157c('0xd')];utils[_0x157c('0xe')]('CreateMemberReport',_0x501388);}});}})[_0x157c('0x11')](function(_0x9dccc1){utils[_0x157c('0x12')](_0x9dccc1);});}delete members[_0x501388[_0x157c('0x9')]];}function startsWith(_0x2e28df,_0x40a8fc){return _[_0x157c('0x13')](_0x2e28df,function(_0x4a8381){return _['startsWith'](_0x40a8fc,_0x4a8381);});}exports[_0x157c('0x14')]=function(_0x47ba31){switch(_0x47ba31['state']){case _0x157c('0x15'):case'BUSY':if(!startsWith(exclude,_0x47ba31[_0x157c('0x16')])){members[_0x47ba31[_0x157c('0x16')]]={'channel':_0x157c('0x17'),'interface':_0x47ba31[_0x157c('0x16')],'type':_0x157c('0x18'),'enterAt':utils[_0x157c('0x19')](),'role':_0x157c('0x1a')};}break;case _0x157c('0x1b'):if(!_[_0x157c('0x1c')](members[_0x47ba31[_0x157c('0x16')]])){members[_0x47ba31['device']][_0x157c('0x1d')]=utils[_0x157c('0x19')]();members[_0x47ba31['device']]['duration']=utils['diffTime'](members[_0x47ba31[_0x157c('0x16')]][_0x157c('0x1d')],members[_0x47ba31['device']][_0x157c('0x1e')]);if(members[_0x47ba31[_0x157c('0x16')]]['uniqueid']){writeDB(members[_0x47ba31['device']]);}}default:break;}};exports['agentcomplete']=function(_0x1ae509){if(!_[_0x157c('0x1c')](members[_0x1ae509[_0x157c('0x9')]])){members[_0x1ae509[_0x157c('0x9')]]=_[_0x157c('0x1f')](members[_0x1ae509[_0x157c('0x9')]],{'data4':_0x1ae509['queue'],'uniqueid':_0x1ae509[_0x157c('0x20')]});}};exports[_0x157c('0x21')]=function(_0xb473b3){if(_0xb473b3[_0x157c('0x5')]){var _0x18cf82=_0xb473b3[_0x157c('0x5')][_0x157c('0x10')]('-')[0x0];if(!_[_0x157c('0x1c')](members[_0x18cf82])){members[_0x18cf82]=_[_0x157c('0x1f')](members[_0x18cf82],{'data1':members[_0x18cf82][_0x157c('0x22')]||_0xb473b3[_0x157c('0x8')],'data2':members[_0x18cf82][_0x157c('0x6')]||_0xb473b3[_0x157c('0x23')],'data3':members[_0x18cf82][_0x157c('0x24')]||_0xb473b3[_0x157c('0x25')],'uniqueid':members[_0x18cf82]['uniqueid']||_0xb473b3[_0x157c('0x20')]});if(members[_0x18cf82][_0x157c('0x1d')]){writeDB(members[_0x18cf82]);}}}if(_0xb473b3[_0x157c('0x26')]){var _0x18dc50=_0xb473b3[_0x157c('0x26')][_0x157c('0x10')]('-')[0x0];if(!_[_0x157c('0x1c')](members[_0x18dc50])){members[_0x18dc50]=_[_0x157c('0x1f')](members[_0x18dc50],{'data1':members[_0x18dc50][_0x157c('0x22')]||_0xb473b3[_0x157c('0x8')],'data2':members[_0x18dc50][_0x157c('0x6')]||_0xb473b3[_0x157c('0x23')],'data3':members[_0x18dc50][_0x157c('0x24')]||_0xb473b3['destination'],'uniqueid':members[_0x18dc50][_0x157c('0x20')]||_0xb473b3[_0x157c('0x20')]});if(members[_0x18dc50]['exitAt']){writeDB(members[_0x18dc50]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index dc0c9ee..2e25e38 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 _0x9976=['reason','transfer','blindtransfer','transfereeuniqueid','transfertype','transferexten','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','secondtransfereruniqueid','transfertargetlinkedid','calleridnum','error','stack','musiconholdstart','musiconholdstartAt','musiconholdstop','lodash','util','./utils','info','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','channel','queue','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','uniqueid','assign','now','hangup','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','queuecallerenterreason','varset','isNil','variable','queuestatus','value','toUpperCase','queueposition','EXITWITHKEY','queuecallerexitAt','queuecallerabandonAt','ABANDONED','holdtime','diffTime','queuecallerjoinAt','position','count','connectedlinenum','connectedlinename','agentconnect','assigned','accountcode','destaccountcode','lastAssignedTo','membername','agentcomplete'];(function(_0x35426c,_0x1d18c8){var _0x334f90=function(_0x5077e0){while(--_0x5077e0){_0x35426c['push'](_0x35426c['shift']());}};_0x334f90(++_0x1d18c8);}(_0x9976,0x153));var _0x6997=function(_0x1c5848,_0x424af2){_0x1c5848=_0x1c5848-0x0;var _0x209dc2=_0x9976[_0x1c5848];return _0x209dc2;};'use strict';var _=require(_0x6997('0x0'));var util=require(_0x6997('0x1'));var utils=require(_0x6997('0x2'));var queues={};function writeDB(_0x283def){utils[_0x6997('0x3')](util[_0x6997('0x4')](_0x6997('0x5'),_0x283def['uniqueid'],_0x283def[_0x6997('0x6')],_0x283def[_0x6997('0x7')],_0x283def['lastAssignedTo'],_0x283def['calleridnum'],_0x283def['accountcode'],_0x283def[_0x6997('0x8')]));if(_0x283def[_0x6997('0x7')]){utils[_0x6997('0x9')](_0x283def[_0x6997('0x7')])[_0x6997('0xa')](function(_0x58c7ed){if(_0x58c7ed){_0x283def['type']=_0x58c7ed[_0x6997('0xb')];}utils[_0x6997('0xc')](_0x6997('0xd'),_0x283def);});}else{utils['request']('CreateVoiceQueueReport',_0x283def);}if(_0x283def[_0x6997('0xe')]){delete queues[_0x283def['transfereduniqueid']];}else{delete queues[_0x283def['uniqueid']];}}exports[_0x6997('0xf')]=function(_0x37323f){queues[_0x37323f[_0x6997('0x10')]]=_[_0x6997('0x11')](_0x37323f,{'originalposition':_0x37323f['position'],'queuecallerjoinAt':utils[_0x6997('0x12')](),'mohtime':0x0});};exports[_0x6997('0x13')]=function(_0x5e6ca9){if(!_['isNil'](queues[_0x5e6ca9[_0x6997('0x10')]])){if(queues[_0x5e6ca9[_0x6997('0x10')]][_0x6997('0x14')]){if(!queues[_0x5e6ca9['uniqueid']][_0x6997('0x15')]&&!queues[_0x5e6ca9[_0x6997('0x10')]][_0x6997('0x16')]){queues[_0x5e6ca9['uniqueid']][_0x6997('0x17')]=!![];queues[_0x5e6ca9[_0x6997('0x10')]][_0x6997('0x18')]=utils[_0x6997('0x12')]();queues[_0x5e6ca9[_0x6997('0x10')]][_0x6997('0x8')]='COMPLETEDBYAGENT';}writeDB(queues[_0x5e6ca9[_0x6997('0x10')]]);}else{if(queues[_0x5e6ca9[_0x6997('0x10')]][_0x6997('0xe')]){queues[queues[_0x5e6ca9[_0x6997('0x10')]][_0x6997('0xe')]]=queues[_0x5e6ca9[_0x6997('0x10')]];queues[queues[_0x5e6ca9['uniqueid']][_0x6997('0xe')]][_0x6997('0x19')]=0x2;delete queues[_0x5e6ca9[_0x6997('0x10')]];}}}};exports[_0x6997('0x1a')]=function(_0xe96f6a){if(!_[_0x6997('0x1b')](_0xe96f6a[_0x6997('0x1c')][_0x6997('0x1d')])&&_0xe96f6a[_0x6997('0x1e')][_0x6997('0x1f')]()!=='CONTINUE'){if(!_[_0x6997('0x1b')](queues[_0xe96f6a[_0x6997('0x10')]])){queues[_0xe96f6a[_0x6997('0x10')]][_0x6997('0x15')]=![];queues[_0xe96f6a['uniqueid']]['queuecallerabandonAt']=null;queues[_0xe96f6a['uniqueid']]['queuecallerexit']=!![];queues[_0xe96f6a[_0x6997('0x10')]]['queuecallerexitAt']=utils[_0x6997('0x12')]();queues[_0xe96f6a['uniqueid']][_0x6997('0x8')]=_0xe96f6a[_0x6997('0x1e')][_0x6997('0x1f')]();writeDB(queues[_0xe96f6a[_0x6997('0x10')]]);}}else if(!_[_0x6997('0x1b')](_0xe96f6a[_0x6997('0x1c')][_0x6997('0x20')])){if(!_[_0x6997('0x1b')](queues[_0xe96f6a['uniqueid']])&&!queues[_0xe96f6a['uniqueid']][_0x6997('0x15')]){queues[_0xe96f6a[_0x6997('0x10')]][_0x6997('0x15')]=![];queues[_0xe96f6a['uniqueid']]['queuecallerabandonAt']=null;queues[_0xe96f6a[_0x6997('0x10')]][_0x6997('0x16')]=!![];queues[_0xe96f6a[_0x6997('0x10')]]['queuecallerexitAt']=utils[_0x6997('0x12')]();queues[_0xe96f6a[_0x6997('0x10')]][_0x6997('0x8')]=_0x6997('0x21');}}};exports[_0x6997('0x15')]=function(_0x54467e){if(!_[_0x6997('0x1b')](queues[_0x54467e['uniqueid']])){queues[_0x54467e[_0x6997('0x10')]][_0x6997('0x16')]=![];queues[_0x54467e[_0x6997('0x10')]][_0x6997('0x22')]=null;queues[_0x54467e['uniqueid']]['queuecallerabandon']=!![];queues[_0x54467e['uniqueid']][_0x6997('0x23')]=utils[_0x6997('0x12')]();queues[_0x54467e[_0x6997('0x10')]][_0x6997('0x8')]=_0x6997('0x24');}};exports['queuecallerleave']=function(_0x508eca){if(!_[_0x6997('0x1b')](queues[_0x508eca[_0x6997('0x10')]])){queues[_0x508eca[_0x6997('0x10')]]['queuecallerleave']=!![];queues[_0x508eca[_0x6997('0x10')]]['queuecallerleaveAt']=utils[_0x6997('0x12')]();queues[_0x508eca['uniqueid']][_0x6997('0x25')]=utils[_0x6997('0x26')](queues[_0x508eca[_0x6997('0x10')]][_0x6997('0x14')],queues[_0x508eca[_0x6997('0x10')]][_0x6997('0x27')]);queues[_0x508eca[_0x6997('0x10')]][_0x6997('0x28')]=_0x508eca[_0x6997('0x28')];queues[_0x508eca[_0x6997('0x10')]][_0x6997('0x29')]=_0x508eca['count'];queues[_0x508eca['uniqueid']][_0x6997('0x2a')]=_0x508eca[_0x6997('0x2a')];queues[_0x508eca['uniqueid']][_0x6997('0x2b')]=_0x508eca[_0x6997('0x2b')];}};exports[_0x6997('0x2c')]=function(_0x15a56e){if(!_[_0x6997('0x1b')](queues[_0x15a56e[_0x6997('0x10')]])){queues[_0x15a56e[_0x6997('0x10')]][_0x6997('0x15')]=![];queues[_0x15a56e[_0x6997('0x10')]][_0x6997('0x15')]=![];queues[_0x15a56e[_0x6997('0x10')]][_0x6997('0x23')]=null;queues[_0x15a56e[_0x6997('0x10')]]['queuecallerexit']=![];queues[_0x15a56e[_0x6997('0x10')]][_0x6997('0x8')]=null;queues[_0x15a56e[_0x6997('0x10')]]['queuecallerexitAt']=null;queues[_0x15a56e[_0x6997('0x10')]][_0x6997('0x2d')]=!![];queues[_0x15a56e['uniqueid']][_0x6997('0x2e')]=_0x15a56e[_0x6997('0x2f')];queues[_0x15a56e[_0x6997('0x10')]][_0x6997('0x30')]=_0x15a56e[_0x6997('0x31')];}};exports[_0x6997('0x32')]=function(_0x478271){if(!_[_0x6997('0x1b')](queues[_0x478271[_0x6997('0x10')]])){if(queues[_0x478271[_0x6997('0x10')]][_0x6997('0x14')]){queues[_0x478271['uniqueid']][_0x6997('0x15')]=![];queues[_0x478271[_0x6997('0x10')]][_0x6997('0x15')]=![];queues[_0x478271[_0x6997('0x10')]][_0x6997('0x23')]=null;queues[_0x478271['uniqueid']][_0x6997('0x16')]=![];queues[_0x478271['uniqueid']][_0x6997('0x22')]=null;queues[_0x478271[_0x6997('0x10')]][_0x6997('0x2d')]=!![];queues[_0x478271[_0x6997('0x10')]][_0x6997('0x30')]=_0x478271[_0x6997('0x31')];queues[_0x478271['uniqueid']][_0x6997('0x17')]=!![];queues[_0x478271[_0x6997('0x10')]][_0x6997('0x18')]=utils[_0x6997('0x12')]();if(_0x478271[_0x6997('0x33')]==_0x6997('0x34')){if(!queues[_0x478271['uniqueid']]['transfer']){queues[_0x478271['uniqueid']][_0x6997('0x8')]='TRANSFER';}}else{queues[_0x478271[_0x6997('0x10')]][_0x6997('0x8')]='COMPLETEDBY'+_0x478271[_0x6997('0x33')][_0x6997('0x1f')]();}writeDB(queues[_0x478271[_0x6997('0x10')]]);}}};exports[_0x6997('0x35')]=function(_0x47298f){if(!_[_0x6997('0x1b')](queues[_0x47298f[_0x6997('0x36')]])){queues[_0x47298f[_0x6997('0x36')]][_0x6997('0x34')]=!![];queues[_0x47298f[_0x6997('0x36')]][_0x6997('0x37')]='BLIND';queues[_0x47298f[_0x6997('0x36')]][_0x6997('0x38')]=_0x47298f['extension'];queues[_0x47298f[_0x6997('0x36')]][_0x6997('0x39')]=_0x47298f[_0x6997('0x36')];queues[_0x47298f[_0x6997('0x36')]][_0x6997('0x8')]=_0x6997('0x3a');}};exports[_0x6997('0x3b')]=function(_0x361634){try{if(_0x361634[_0x6997('0x3c')]==_0x361634[_0x6997('0x3d')]){if(!_[_0x6997('0x1b')](queues[_0x361634[_0x6997('0x3e')]])){queues[_0x361634['secondtransfererlinkedid']]['transfer']=!![];queues[_0x361634[_0x6997('0x3e')]]['transfertype']=_0x6997('0x3f');queues[_0x361634[_0x6997('0x3e')]][_0x6997('0x38')]=_0x361634['origtransfererexten'];queues[_0x361634[_0x6997('0x3e')]][_0x6997('0x39')]=_0x361634[_0x6997('0x3c')];queues[_0x361634[_0x6997('0x3e')]]['queuecallerexitreason']=_0x6997('0x40');}if(!_[_0x6997('0x1b')](queues[_0x361634[_0x6997('0x3d')]])){if(_0x361634[_0x6997('0x41')]&&queues[_0x361634[_0x6997('0x41')]]){queues[_0x361634[_0x6997('0x41')]][_0x6997('0x19')]=0x1;queues[_0x361634[_0x6997('0x36')]]=_[_0x6997('0x42')](queues[_0x361634[_0x6997('0x41')]]);queues[_0x361634[_0x6997('0x36')]]['transfereduniqueid']=_0x361634[_0x6997('0x43')];queues[_0x361634['transfereeuniqueid']][_0x6997('0x19')]=0x2;queues[_0x361634['transfereeuniqueid']]['calleridnum']=queues[_0x361634[_0x6997('0x3e')]]['calleridnum'];queues[_0x361634[_0x6997('0x36')]][_0x6997('0x44')]=queues[_0x361634[_0x6997('0x3e')]]['calleridname'];queues[_0x361634[_0x6997('0x36')]][_0x6997('0x27')]=utils[_0x6997('0x12')]();queues[_0x361634['transfereeuniqueid']][_0x6997('0x14')]=utils['now']();queues[_0x361634[_0x6997('0x36')]][_0x6997('0x25')]=0x0;queues[_0x361634[_0x6997('0x36')]][_0x6997('0x45')]=0x0;}else{queues[_0x361634[_0x6997('0x3d')]][_0x6997('0xe')]=_0x361634['secondtransfererlinkedid'];}}}else if(_0x361634[_0x6997('0x46')]==_0x361634['secondtransfererlinkedid']){if(!_[_0x6997('0x1b')](queues[_0x361634[_0x6997('0x3d')]])){queues[_0x361634[_0x6997('0x3d')]]['transfer']=!![];queues[_0x361634[_0x6997('0x3d')]][_0x6997('0x37')]='ATTENDED';queues[_0x361634[_0x6997('0x3d')]][_0x6997('0x38')]=_0x361634['secondtransfererexten'];queues[_0x361634[_0x6997('0x3d')]]['transferuniqueid']=_0x361634[_0x6997('0x46')];queues[_0x361634[_0x6997('0x3d')]][_0x6997('0x8')]=_0x6997('0x40');}if(!_['isNil'](queues[_0x361634[_0x6997('0x3e')]])){if(_0x361634[_0x6997('0x47')]&&queues[_0x361634[_0x6997('0x47')]]){queues[_0x361634[_0x6997('0x47')]]['queuecallerenterreason']=0x1;queues[_0x361634[_0x6997('0x43')]]=_[_0x6997('0x42')](queues[_0x361634[_0x6997('0x47')]]);queues[_0x361634[_0x6997('0x43')]][_0x6997('0xe')]=_0x361634[_0x6997('0x43')];queues[_0x361634[_0x6997('0x43')]]['queuecallerenterreason']=0x2;queues[_0x361634[_0x6997('0x43')]][_0x6997('0x48')]=queues[_0x361634[_0x6997('0x3d')]][_0x6997('0x48')];queues[_0x361634['transfertargetuniqueid']]['calleridname']=queues[_0x361634['origtransfererlinkedid']][_0x6997('0x44')];queues[_0x361634['transfertargetuniqueid']][_0x6997('0x27')]=utils['now']();queues[_0x361634[_0x6997('0x43')]][_0x6997('0x14')]=utils[_0x6997('0x12')]();queues[_0x361634['transfertargetuniqueid']][_0x6997('0x25')]=0x0;queues[_0x361634[_0x6997('0x43')]][_0x6997('0x45')]=0x0;}else{queues[_0x361634[_0x6997('0x3e')]][_0x6997('0xe')]=_0x361634[_0x6997('0x3d')];}}}}catch(_0x4e6406){utils[_0x6997('0x49')](_0x4e6406[_0x6997('0x4a')]);}};exports[_0x6997('0x4b')]=function(_0x5829ca){if(!_[_0x6997('0x1b')](queues[_0x5829ca[_0x6997('0x10')]])){queues[_0x5829ca['uniqueid']][_0x6997('0x4c')]=utils['now']();}};exports[_0x6997('0x4d')]=function(_0x57e873){if(!_[_0x6997('0x1b')](queues[_0x57e873[_0x6997('0x10')]])){if(!_[_0x6997('0x1b')](queues[_0x57e873[_0x6997('0x10')]][_0x6997('0x4c')])){queues[_0x57e873[_0x6997('0x10')]][_0x6997('0x45')]+=utils[_0x6997('0x26')](utils['now'](),queues[_0x57e873['uniqueid']][_0x6997('0x4c')]);delete queues[_0x57e873[_0x6997('0x10')]][_0x6997('0x4c')];}}}; \ No newline at end of file +var _0x4bd4=['now','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallerexitreason','COMPLETEDBYAGENT','queuecallerenterreason','varset','variable','CONTINUE','queuecallerabandonAt','queuecallerexitAt','queueposition','EXITWITHKEY','ABANDONED','queuecallerleave','holdtime','queuecallerjoinAt','position','count','connectedlinenum','connectedlinename','agentconnect','assigned','lastAssignedTo','agentcomplete','membername','queuecallercomplete','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','toUpperCase','blindtransfer','transfereeuniqueid','transfertype','extension','transferuniqueid','BLINDTRANSFER','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','transferexten','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridname','mohtime','secondtransfereruniqueid','ATTENDED','transfertargetlinkedid','clone','stack','musiconholdstartAt','lodash','./utils','info','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','queue','calleridnum','accountcode','getVoiceQueueByName','then','type','CreateVoiceQueueReport','transfereduniqueid'];(function(_0x47363c,_0x14a22e){var _0xf5382f=function(_0x31bfd9){while(--_0x31bfd9){_0x47363c['push'](_0x47363c['shift']());}};_0xf5382f(++_0x14a22e);}(_0x4bd4,0x1a2));var _0x44bd=function(_0x1064bc,_0x42f8a5){_0x1064bc=_0x1064bc-0x0;var _0x59f968=_0x4bd4[_0x1064bc];return _0x59f968;};'use strict';var _=require(_0x44bd('0x0'));var util=require('util');var utils=require(_0x44bd('0x1'));var queues={};function writeDB(_0x30e765){utils[_0x44bd('0x2')](util[_0x44bd('0x3')](_0x44bd('0x4'),_0x30e765[_0x44bd('0x5')],_0x30e765['channel'],_0x30e765[_0x44bd('0x6')],_0x30e765['lastAssignedTo'],_0x30e765[_0x44bd('0x7')],_0x30e765[_0x44bd('0x8')],_0x30e765['queuecallerexitreason']));if(_0x30e765[_0x44bd('0x6')]){utils[_0x44bd('0x9')](_0x30e765[_0x44bd('0x6')])[_0x44bd('0xa')](function(_0xc6de48){if(_0xc6de48){_0x30e765[_0x44bd('0xb')]=_0xc6de48['type'];}utils['request'](_0x44bd('0xc'),_0x30e765);});}else{utils['request'](_0x44bd('0xc'),_0x30e765);}if(_0x30e765[_0x44bd('0xd')]){delete queues[_0x30e765[_0x44bd('0xd')]];}else{delete queues[_0x30e765['uniqueid']];}}exports['queuecallerjoin']=function(_0x5501c4){queues[_0x5501c4[_0x44bd('0x5')]]=_['assign'](_0x5501c4,{'originalposition':_0x5501c4['position'],'queuecallerjoinAt':utils[_0x44bd('0xe')](),'mohtime':0x0});};exports[_0x44bd('0xf')]=function(_0xe39083){if(!_[_0x44bd('0x10')](queues[_0xe39083[_0x44bd('0x5')]])){if(queues[_0xe39083[_0x44bd('0x5')]][_0x44bd('0x11')]){if(!queues[_0xe39083[_0x44bd('0x5')]][_0x44bd('0x12')]&&!queues[_0xe39083['uniqueid']][_0x44bd('0x13')]){queues[_0xe39083['uniqueid']]['queuecallercomplete']=!![];queues[_0xe39083[_0x44bd('0x5')]]['queuecallercompleteAt']=utils[_0x44bd('0xe')]();queues[_0xe39083['uniqueid']][_0x44bd('0x14')]=_0x44bd('0x15');}writeDB(queues[_0xe39083[_0x44bd('0x5')]]);}else{if(queues[_0xe39083[_0x44bd('0x5')]][_0x44bd('0xd')]){queues[queues[_0xe39083[_0x44bd('0x5')]][_0x44bd('0xd')]]=queues[_0xe39083[_0x44bd('0x5')]];queues[queues[_0xe39083[_0x44bd('0x5')]][_0x44bd('0xd')]][_0x44bd('0x16')]=0x2;delete queues[_0xe39083['uniqueid']];}}}};exports[_0x44bd('0x17')]=function(_0x5610d3){if(!_[_0x44bd('0x10')](_0x5610d3[_0x44bd('0x18')]['queuestatus'])&&_0x5610d3['value']['toUpperCase']()!==_0x44bd('0x19')){if(!_[_0x44bd('0x10')](queues[_0x5610d3[_0x44bd('0x5')]])){queues[_0x5610d3[_0x44bd('0x5')]][_0x44bd('0x12')]=![];queues[_0x5610d3['uniqueid']][_0x44bd('0x1a')]=null;queues[_0x5610d3[_0x44bd('0x5')]][_0x44bd('0x13')]=!![];queues[_0x5610d3[_0x44bd('0x5')]][_0x44bd('0x1b')]=utils[_0x44bd('0xe')]();queues[_0x5610d3[_0x44bd('0x5')]][_0x44bd('0x14')]=_0x5610d3['value']['toUpperCase']();writeDB(queues[_0x5610d3[_0x44bd('0x5')]]);}}else if(!_[_0x44bd('0x10')](_0x5610d3[_0x44bd('0x18')][_0x44bd('0x1c')])){if(!_[_0x44bd('0x10')](queues[_0x5610d3[_0x44bd('0x5')]])&&!queues[_0x5610d3[_0x44bd('0x5')]][_0x44bd('0x12')]){queues[_0x5610d3['uniqueid']]['queuecallerabandon']=![];queues[_0x5610d3['uniqueid']][_0x44bd('0x1a')]=null;queues[_0x5610d3['uniqueid']][_0x44bd('0x13')]=!![];queues[_0x5610d3[_0x44bd('0x5')]][_0x44bd('0x1b')]=utils['now']();queues[_0x5610d3['uniqueid']]['queuecallerexitreason']=_0x44bd('0x1d');}}};exports[_0x44bd('0x12')]=function(_0x1dddb5){if(!_[_0x44bd('0x10')](queues[_0x1dddb5['uniqueid']])){queues[_0x1dddb5[_0x44bd('0x5')]][_0x44bd('0x13')]=![];queues[_0x1dddb5[_0x44bd('0x5')]]['queuecallerexitAt']=null;queues[_0x1dddb5[_0x44bd('0x5')]][_0x44bd('0x12')]=!![];queues[_0x1dddb5[_0x44bd('0x5')]][_0x44bd('0x1a')]=utils[_0x44bd('0xe')]();queues[_0x1dddb5[_0x44bd('0x5')]][_0x44bd('0x14')]=_0x44bd('0x1e');}};exports[_0x44bd('0x1f')]=function(_0x402da5){if(!_[_0x44bd('0x10')](queues[_0x402da5[_0x44bd('0x5')]])){queues[_0x402da5[_0x44bd('0x5')]]['queuecallerleave']=!![];queues[_0x402da5[_0x44bd('0x5')]][_0x44bd('0x11')]=utils['now']();queues[_0x402da5['uniqueid']][_0x44bd('0x20')]=utils['diffTime'](queues[_0x402da5['uniqueid']][_0x44bd('0x11')],queues[_0x402da5[_0x44bd('0x5')]][_0x44bd('0x21')]);queues[_0x402da5['uniqueid']][_0x44bd('0x22')]=_0x402da5['position'];queues[_0x402da5[_0x44bd('0x5')]][_0x44bd('0x23')]=_0x402da5['count'];queues[_0x402da5[_0x44bd('0x5')]][_0x44bd('0x24')]=_0x402da5[_0x44bd('0x24')];queues[_0x402da5[_0x44bd('0x5')]][_0x44bd('0x25')]=_0x402da5['connectedlinename'];}};exports[_0x44bd('0x26')]=function(_0x258705){if(!_[_0x44bd('0x10')](queues[_0x258705[_0x44bd('0x5')]])){queues[_0x258705[_0x44bd('0x5')]]['queuecallerabandon']=![];queues[_0x258705[_0x44bd('0x5')]][_0x44bd('0x12')]=![];queues[_0x258705[_0x44bd('0x5')]][_0x44bd('0x1a')]=null;queues[_0x258705[_0x44bd('0x5')]][_0x44bd('0x13')]=![];queues[_0x258705['uniqueid']][_0x44bd('0x14')]=null;queues[_0x258705[_0x44bd('0x5')]][_0x44bd('0x1b')]=null;queues[_0x258705[_0x44bd('0x5')]][_0x44bd('0x27')]=!![];queues[_0x258705['uniqueid']]['accountcode']=_0x258705['destaccountcode'];queues[_0x258705[_0x44bd('0x5')]][_0x44bd('0x28')]=_0x258705['membername'];}};exports[_0x44bd('0x29')]=function(_0x48ed6d){if(!_[_0x44bd('0x10')](queues[_0x48ed6d[_0x44bd('0x5')]])){if(queues[_0x48ed6d[_0x44bd('0x5')]]['queuecallerleaveAt']){queues[_0x48ed6d[_0x44bd('0x5')]][_0x44bd('0x12')]=![];queues[_0x48ed6d['uniqueid']][_0x44bd('0x12')]=![];queues[_0x48ed6d[_0x44bd('0x5')]]['queuecallerabandonAt']=null;queues[_0x48ed6d[_0x44bd('0x5')]][_0x44bd('0x13')]=![];queues[_0x48ed6d['uniqueid']]['queuecallerexitAt']=null;queues[_0x48ed6d['uniqueid']]['assigned']=!![];queues[_0x48ed6d[_0x44bd('0x5')]][_0x44bd('0x28')]=_0x48ed6d[_0x44bd('0x2a')];queues[_0x48ed6d[_0x44bd('0x5')]][_0x44bd('0x2b')]=!![];queues[_0x48ed6d['uniqueid']][_0x44bd('0x2c')]=utils[_0x44bd('0xe')]();if(_0x48ed6d[_0x44bd('0x2d')]==_0x44bd('0x2e')){if(!queues[_0x48ed6d[_0x44bd('0x5')]][_0x44bd('0x2e')]){queues[_0x48ed6d['uniqueid']][_0x44bd('0x14')]=_0x44bd('0x2f');}}else{queues[_0x48ed6d[_0x44bd('0x5')]][_0x44bd('0x14')]=_0x44bd('0x30')+_0x48ed6d[_0x44bd('0x2d')][_0x44bd('0x31')]();}writeDB(queues[_0x48ed6d['uniqueid']]);}}};exports[_0x44bd('0x32')]=function(_0x7e7735){if(!_[_0x44bd('0x10')](queues[_0x7e7735[_0x44bd('0x33')]])){queues[_0x7e7735[_0x44bd('0x33')]]['transfer']=!![];queues[_0x7e7735[_0x44bd('0x33')]][_0x44bd('0x34')]='BLIND';queues[_0x7e7735['transfereeuniqueid']]['transferexten']=_0x7e7735[_0x44bd('0x35')];queues[_0x7e7735[_0x44bd('0x33')]][_0x44bd('0x36')]=_0x7e7735['transfereeuniqueid'];queues[_0x7e7735['transfereeuniqueid']][_0x44bd('0x14')]=_0x44bd('0x37');}};exports['attendedtransfer']=function(_0x1c6273){try{if(_0x1c6273[_0x44bd('0x38')]==_0x1c6273[_0x44bd('0x39')]){if(!_[_0x44bd('0x10')](queues[_0x1c6273[_0x44bd('0x3a')]])){queues[_0x1c6273['secondtransfererlinkedid']][_0x44bd('0x2e')]=!![];queues[_0x1c6273[_0x44bd('0x3a')]][_0x44bd('0x34')]='ATTENDED';queues[_0x1c6273['secondtransfererlinkedid']][_0x44bd('0x3b')]=_0x1c6273[_0x44bd('0x3c')];queues[_0x1c6273[_0x44bd('0x3a')]][_0x44bd('0x36')]=_0x1c6273[_0x44bd('0x38')];queues[_0x1c6273[_0x44bd('0x3a')]][_0x44bd('0x14')]=_0x44bd('0x3d');}if(!_[_0x44bd('0x10')](queues[_0x1c6273[_0x44bd('0x39')]])){if(_0x1c6273['transfereelinkedid']&&queues[_0x1c6273['transfereelinkedid']]){queues[_0x1c6273[_0x44bd('0x3e')]][_0x44bd('0x16')]=0x1;queues[_0x1c6273[_0x44bd('0x33')]]=_['clone'](queues[_0x1c6273[_0x44bd('0x3e')]]);queues[_0x1c6273[_0x44bd('0x33')]][_0x44bd('0xd')]=_0x1c6273[_0x44bd('0x3f')];queues[_0x1c6273['transfereeuniqueid']][_0x44bd('0x16')]=0x2;queues[_0x1c6273[_0x44bd('0x33')]]['calleridnum']=queues[_0x1c6273[_0x44bd('0x3a')]][_0x44bd('0x7')];queues[_0x1c6273[_0x44bd('0x33')]][_0x44bd('0x40')]=queues[_0x1c6273[_0x44bd('0x3a')]][_0x44bd('0x40')];queues[_0x1c6273['transfereeuniqueid']]['queuecallerjoinAt']=utils['now']();queues[_0x1c6273['transfereeuniqueid']][_0x44bd('0x11')]=utils[_0x44bd('0xe')]();queues[_0x1c6273[_0x44bd('0x33')]][_0x44bd('0x20')]=0x0;queues[_0x1c6273[_0x44bd('0x33')]][_0x44bd('0x41')]=0x0;}else{queues[_0x1c6273['origtransfererlinkedid']][_0x44bd('0xd')]=_0x1c6273[_0x44bd('0x3a')];}}}else if(_0x1c6273[_0x44bd('0x42')]==_0x1c6273['secondtransfererlinkedid']){if(!_[_0x44bd('0x10')](queues[_0x1c6273[_0x44bd('0x39')]])){queues[_0x1c6273[_0x44bd('0x39')]][_0x44bd('0x2e')]=!![];queues[_0x1c6273[_0x44bd('0x39')]][_0x44bd('0x34')]=_0x44bd('0x43');queues[_0x1c6273[_0x44bd('0x39')]][_0x44bd('0x3b')]=_0x1c6273['secondtransfererexten'];queues[_0x1c6273[_0x44bd('0x39')]][_0x44bd('0x36')]=_0x1c6273['secondtransfereruniqueid'];queues[_0x1c6273[_0x44bd('0x39')]][_0x44bd('0x14')]=_0x44bd('0x3d');}if(!_[_0x44bd('0x10')](queues[_0x1c6273[_0x44bd('0x3a')]])){if(_0x1c6273[_0x44bd('0x44')]&&queues[_0x1c6273[_0x44bd('0x44')]]){queues[_0x1c6273[_0x44bd('0x44')]][_0x44bd('0x16')]=0x1;queues[_0x1c6273[_0x44bd('0x3f')]]=_[_0x44bd('0x45')](queues[_0x1c6273[_0x44bd('0x44')]]);queues[_0x1c6273[_0x44bd('0x3f')]][_0x44bd('0xd')]=_0x1c6273['transfertargetuniqueid'];queues[_0x1c6273[_0x44bd('0x3f')]][_0x44bd('0x16')]=0x2;queues[_0x1c6273[_0x44bd('0x3f')]][_0x44bd('0x7')]=queues[_0x1c6273[_0x44bd('0x39')]]['calleridnum'];queues[_0x1c6273[_0x44bd('0x3f')]]['calleridname']=queues[_0x1c6273['origtransfererlinkedid']][_0x44bd('0x40')];queues[_0x1c6273[_0x44bd('0x3f')]][_0x44bd('0x21')]=utils['now']();queues[_0x1c6273[_0x44bd('0x3f')]]['queuecallerleaveAt']=utils[_0x44bd('0xe')]();queues[_0x1c6273[_0x44bd('0x3f')]][_0x44bd('0x20')]=0x0;queues[_0x1c6273[_0x44bd('0x3f')]][_0x44bd('0x41')]=0x0;}else{queues[_0x1c6273[_0x44bd('0x3a')]]['transfereduniqueid']=_0x1c6273[_0x44bd('0x39')];}}}}catch(_0x7050c9){utils['error'](_0x7050c9[_0x44bd('0x46')]);}};exports['musiconholdstart']=function(_0x1c3b6c){if(!_[_0x44bd('0x10')](queues[_0x1c3b6c[_0x44bd('0x5')]])){queues[_0x1c3b6c['uniqueid']][_0x44bd('0x47')]=utils['now']();}};exports['musiconholdstop']=function(_0x2cc696){if(!_[_0x44bd('0x10')](queues[_0x2cc696[_0x44bd('0x5')]])){if(!_[_0x44bd('0x10')](queues[_0x2cc696[_0x44bd('0x5')]][_0x44bd('0x47')])){queues[_0x2cc696[_0x44bd('0x5')]][_0x44bd('0x41')]+=utils['diffTime'](utils[_0x44bd('0xe')](),queues[_0x2cc696[_0x44bd('0x5')]][_0x44bd('0x47')]);delete queues[_0x2cc696['uniqueid']][_0x44bd('0x47')];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 76991f4..c09a4e7 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 _0x9c44=['getUserByInternal','then','name','request','CreateVoiceRecording','newchannel','uniqueid','linkedid','context','channel','error','stack','isNil','transfer','variable','endsWith','value','replace','.wav49','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','toLowerCase','set','startsWith','appdata','split','substring','lastIndexOf','queuecallerjoin','queue','debug','accountcode'];(function(_0x2760be,_0x510af5){var _0x3a118d=function(_0x1aeb91){while(--_0x1aeb91){_0x2760be['push'](_0x2760be['shift']());}};_0x3a118d(++_0x510af5);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var utils=require('./utils');var recordings={};function writeDB(_0x1ffbbf){utils[_0x49c4('0x0')](_0x1ffbbf);if(_0x1ffbbf[_0x49c4('0x1')]){utils[_0x49c4('0x2')](_0x1ffbbf[_0x49c4('0x1')])[_0x49c4('0x3')](function(_0x4e0313){if(_0x4e0313){_0x1ffbbf['membername']=_0x4e0313[_0x49c4('0x4')];_0x1ffbbf['UserId']=_0x4e0313['id'];}utils[_0x49c4('0x5')](_0x49c4('0x6'),_0x1ffbbf);});}else{utils[_0x49c4('0x5')](_0x49c4('0x6'),_0x1ffbbf);}}exports[_0x49c4('0x7')]=function(_0x511d53){try{if(_0x511d53[_0x49c4('0x8')]==_0x511d53[_0x49c4('0x9')]){recordings[_0x511d53[_0x49c4('0x8')]]={'uniqueid':_0x511d53[_0x49c4('0x8')],'accountcode':_0x511d53['accountcode'],'exten':_0x511d53['exten'],'context':_0x511d53[_0x49c4('0xa')],'channel':_0x511d53[_0x49c4('0xb')],'monitors':[]};}}catch(_0x58cad7){utils[_0x49c4('0xc')](_0x58cad7[_0x49c4('0xd')]);}};exports['newstate']=function(_0x536d42){try{if(!_[_0x49c4('0xe')](recordings[_0x536d42[_0x49c4('0x8')]])&&_0x536d42['channelstate']==0x6){}else if(!_[_0x49c4('0xe')](recordings[_0x536d42[_0x49c4('0x9')]])&&_0x536d42['channelstate']==0x6&&_0x536d42[_0x49c4('0xa')]!=_0x49c4('0xf')){recordings[_0x536d42[_0x49c4('0x9')]][_0x49c4('0x1')]=_0x536d42[_0x49c4('0x1')];}}catch(_0x18211c){utils[_0x49c4('0xc')](_0x18211c[_0x49c4('0xd')]);}};exports['varset']=function(_0x3acd06){try{if(!_[_0x49c4('0xe')](_0x3acd06[_0x49c4('0x10')])&&!_[_0x49c4('0xe')](_0x3acd06[_0x49c4('0x10')]['mixmonitor_filename'])){if(_[_0x49c4('0x11')](_0x3acd06[_0x49c4('0x12')],'.wav49')){_0x3acd06['value']=_0x3acd06[_0x49c4('0x12')][_0x49c4('0x13')](_0x49c4('0x14'),'.WAV');}if(recordings[_0x3acd06[_0x49c4('0x9')]]){var _0x50b151=_[_0x49c4('0x15')](recordings[_0x3acd06[_0x49c4('0x9')]][_0x49c4('0x16')],{'value':_0x3acd06[_0x49c4('0x12')]});if(_[_0x49c4('0xe')](_0x50b151)){recordings[_0x3acd06[_0x49c4('0x9')]][_0x49c4('0x16')][_0x49c4('0x17')]({'value':_0x3acd06[_0x49c4('0x12')]});}}}}catch(_0x578447){utils['error'](_0x578447['stack']);}};exports[_0x49c4('0x18')]=function(_0x4f0b62){try{if(!_['isNil'](recordings[_0x4f0b62[_0x49c4('0x8')]])){recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x19')]=_0x4f0b62[_0x49c4('0x19')];recordings[_0x4f0b62['uniqueid']]['calleridname']=_0x4f0b62[_0x49c4('0x1a')];recordings[_0x4f0b62[_0x49c4('0x8')]]['connectedlinenum']=_0x4f0b62[_0x49c4('0x1b')];recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x1c')]=_0x4f0b62[_0x49c4('0x1c')];if(recordings[_0x4f0b62['uniqueid']]['type']==_0x49c4('0x1d')&&recordings[_0x4f0b62['uniqueid']][_0x49c4('0x1')]){recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x1b')]=recordings[_0x4f0b62[_0x49c4('0x8')]]['accountcode'];recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x1c')]='';}recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x16')][_0x49c4('0x1e')](_0x29f835=>{var _0x26ba17=_[_0x49c4('0x1f')](recordings[_0x4f0b62[_0x49c4('0x8')]]);_0x26ba17[_0x49c4('0x12')]=_0x29f835[_0x49c4('0x12')];writeDB(_0x26ba17);});delete recordings[_0x4f0b62['uniqueid']];}}catch(_0x4f4495){utils['error'](_0x4f4495[_0x49c4('0xd')]);}};exports[_0x49c4('0x20')]=function(_0x1eb035){try{if(!_[_0x49c4('0xe')](recordings[_0x1eb035[_0x49c4('0x8')]])){if(_0x1eb035['application'][_0x49c4('0x21')]()==_0x49c4('0x22')&&_[_0x49c4('0x23')](_0x1eb035[_0x49c4('0x24')]['toLowerCase'](),'cdr')){var _0xce57ef=_0x1eb035[_0x49c4('0x24')][_0x49c4('0x25')]('=');var _0x13b3b4=_0xce57ef[0x0][_0x49c4('0x26')](_0xce57ef[0x0]['lastIndexOf']('(')+0x1,_0xce57ef[0x0][_0x49c4('0x27')](')'));var _0x84c621=_0xce57ef[0x1];recordings[_0x1eb035[_0x49c4('0x8')]][_0x13b3b4]=_0x84c621;}}}catch(_0x512d02){utils['error'](_0x512d02[_0x49c4('0xd')]);}};exports[_0x49c4('0x28')]=function(_0x3bec0a){try{if(!_[_0x49c4('0xe')](recordings[_0x3bec0a[_0x49c4('0x8')]])){recordings[_0x3bec0a[_0x49c4('0x8')]][_0x49c4('0x29')]=_0x3bec0a[_0x49c4('0x29')];}}catch(_0x3209cd){utils['error'](_0x3209cd[_0x49c4('0xd')]);}}; \ No newline at end of file +var _0xa9e0=['application','set','appdata','toLowerCase','cdr','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','getUserByInternal','then','membername','name','UserId','CreateVoiceRecording','request','uniqueid','accountcode','exten','context','channel','isNil','channelstate','linkedid','transfer','error','varset','variable','endsWith','.wav49','value','replace','.WAV','find','monitors','stack','hangup','calleridnum','calleridname','connectedlinename','outbound','connectedlinenum','forEach','clone','newexten'];(function(_0x44c974,_0x1bcfde){var _0x5214c6=function(_0x10aad5){while(--_0x10aad5){_0x44c974['push'](_0x44c974['shift']());}};_0x5214c6(++_0x1bcfde);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x0a9e('0x0'));var utils=require(_0x0a9e('0x1'));var recordings={};function writeDB(_0x29929c){utils['debug'](_0x29929c);if(_0x29929c['accountcode']){utils[_0x0a9e('0x2')](_0x29929c['accountcode'])[_0x0a9e('0x3')](function(_0x432180){if(_0x432180){_0x29929c[_0x0a9e('0x4')]=_0x432180[_0x0a9e('0x5')];_0x29929c[_0x0a9e('0x6')]=_0x432180['id'];}utils['request'](_0x0a9e('0x7'),_0x29929c);});}else{utils[_0x0a9e('0x8')](_0x0a9e('0x7'),_0x29929c);}}exports['newchannel']=function(_0x503809){try{if(_0x503809[_0x0a9e('0x9')]==_0x503809['linkedid']){recordings[_0x503809['uniqueid']]={'uniqueid':_0x503809[_0x0a9e('0x9')],'accountcode':_0x503809[_0x0a9e('0xa')],'exten':_0x503809[_0x0a9e('0xb')],'context':_0x503809[_0x0a9e('0xc')],'channel':_0x503809[_0x0a9e('0xd')],'monitors':[]};}}catch(_0xbd1168){utils['error'](_0xbd1168['stack']);}};exports['newstate']=function(_0x4cfe67){try{if(!_[_0x0a9e('0xe')](recordings[_0x4cfe67[_0x0a9e('0x9')]])&&_0x4cfe67[_0x0a9e('0xf')]==0x6){}else if(!_[_0x0a9e('0xe')](recordings[_0x4cfe67[_0x0a9e('0x10')]])&&_0x4cfe67[_0x0a9e('0xf')]==0x6&&_0x4cfe67['context']!=_0x0a9e('0x11')){recordings[_0x4cfe67[_0x0a9e('0x10')]][_0x0a9e('0xa')]=_0x4cfe67[_0x0a9e('0xa')];}}catch(_0x44dcfd){utils[_0x0a9e('0x12')](_0x44dcfd['stack']);}};exports[_0x0a9e('0x13')]=function(_0x5d0880){try{if(!_[_0x0a9e('0xe')](_0x5d0880['variable'])&&!_[_0x0a9e('0xe')](_0x5d0880[_0x0a9e('0x14')]['mixmonitor_filename'])){if(_[_0x0a9e('0x15')](_0x5d0880['value'],_0x0a9e('0x16'))){_0x5d0880[_0x0a9e('0x17')]=_0x5d0880[_0x0a9e('0x17')][_0x0a9e('0x18')](_0x0a9e('0x16'),_0x0a9e('0x19'));}if(recordings[_0x5d0880[_0x0a9e('0x10')]]){var _0x20559e=_[_0x0a9e('0x1a')](recordings[_0x5d0880[_0x0a9e('0x10')]][_0x0a9e('0x1b')],{'value':_0x5d0880[_0x0a9e('0x17')]});if(_['isNil'](_0x20559e)){recordings[_0x5d0880[_0x0a9e('0x10')]][_0x0a9e('0x1b')]['push']({'value':_0x5d0880[_0x0a9e('0x17')]});}}}}catch(_0x5a09ef){utils['error'](_0x5a09ef[_0x0a9e('0x1c')]);}};exports[_0x0a9e('0x1d')]=function(_0x38e7c4){try{if(!_[_0x0a9e('0xe')](recordings[_0x38e7c4['uniqueid']])){recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x1e')]=_0x38e7c4[_0x0a9e('0x1e')];recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x1f')]=_0x38e7c4[_0x0a9e('0x1f')];recordings[_0x38e7c4[_0x0a9e('0x9')]]['connectedlinenum']=_0x38e7c4['connectedlinenum'];recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x20')]=_0x38e7c4[_0x0a9e('0x20')];if(recordings[_0x38e7c4[_0x0a9e('0x9')]]['type']==_0x0a9e('0x21')&&recordings[_0x38e7c4['uniqueid']][_0x0a9e('0xa')]){recordings[_0x38e7c4['uniqueid']][_0x0a9e('0x22')]=recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0xa')];recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x20')]='';}recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x1b')][_0x0a9e('0x23')](_0x5a101a=>{var _0x3652a7=_[_0x0a9e('0x24')](recordings[_0x38e7c4[_0x0a9e('0x9')]]);_0x3652a7[_0x0a9e('0x17')]=_0x5a101a['value'];writeDB(_0x3652a7);});delete recordings[_0x38e7c4[_0x0a9e('0x9')]];}}catch(_0x40e7a3){utils[_0x0a9e('0x12')](_0x40e7a3[_0x0a9e('0x1c')]);}};exports[_0x0a9e('0x25')]=function(_0x563b45){try{if(!_[_0x0a9e('0xe')](recordings[_0x563b45[_0x0a9e('0x9')]])){if(_0x563b45[_0x0a9e('0x26')]['toLowerCase']()==_0x0a9e('0x27')&&_['startsWith'](_0x563b45[_0x0a9e('0x28')][_0x0a9e('0x29')](),_0x0a9e('0x2a'))){var _0x33bdb7=_0x563b45[_0x0a9e('0x28')]['split']('=');var _0x66c1d2=_0x33bdb7[0x0][_0x0a9e('0x2b')](_0x33bdb7[0x0][_0x0a9e('0x2c')]('(')+0x1,_0x33bdb7[0x0][_0x0a9e('0x2c')](')'));var _0x2b45ea=_0x33bdb7[0x1];recordings[_0x563b45[_0x0a9e('0x9')]][_0x66c1d2]=_0x2b45ea;}}}catch(_0x332d35){utils[_0x0a9e('0x12')](_0x332d35['stack']);}};exports[_0x0a9e('0x2d')]=function(_0x5e7238){try{if(!_[_0x0a9e('0xe')](recordings[_0x5e7238[_0x0a9e('0x9')]])){recordings[_0x5e7238[_0x0a9e('0x9')]][_0x0a9e('0x2e')]=_0x5e7238['queue'];}}catch(_0x191e91){utils[_0x0a9e('0x12')](_0x191e91[_0x0a9e('0x1c')]);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 047a119..7bcbe21 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 _0x769c=['lodash','./utils','TRANSFER|%s','type','request','CreateVoiceTransferReport','error','stack','attendedtransfer','assign','origtransfererchannel','origtransferercalleridnum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','attended','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetlinkedid'];(function(_0x5527b4,_0x4a920c){var _0x1040ad=function(_0x2389b7){while(--_0x2389b7){_0x5527b4['push'](_0x5527b4['shift']());}};_0x1040ad(++_0x4a920c);}(_0x769c,0x96));var _0xc769=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x769c[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xc769('0x0'));var util=require('util');var utils=require(_0xc769('0x1'));function writeDB(_0x463db3){utils['info'](util['format'](_0xc769('0x2'),_0x463db3[_0xc769('0x3')]));utils[_0xc769('0x4')](_0xc769('0x5'),_0x463db3);}exports['blindtransfer']=function(_0x4b5ec){try{_0x4b5ec[_0xc769('0x3')]='blind';writeDB(_0x4b5ec);}catch(_0x4ad2f6){utils[_0xc769('0x6')](_0x4ad2f6[_0xc769('0x7')]);}};exports[_0xc769('0x8')]=function(_0x2b4951){try{_0x2b4951=_[_0xc769('0x9')](_0x2b4951,{'transfererchannel':_0x2b4951[_0xc769('0xa')],'transferercalleridnum':_0x2b4951[_0xc769('0xb')],'transferercalleridname':_0x2b4951['origtransferercalleridname'],'transfererconnectedlinenum':_0x2b4951['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2b4951['secondtransfererconnectedlinename'],'transfereraccountcode':_0x2b4951[_0xc769('0xc')],'transferercontext':_0x2b4951[_0xc769('0xd')],'transfererexten':_0x2b4951[_0xc769('0xe')],'transfererlinkedid':_0x2b4951['origtransfererlinkedid'],'context':_0x2b4951[_0xc769('0xf')],'extension':_0x2b4951['origtransfererexten'],'type':_0xc769('0x10')});if(_[_0xc769('0x11')](_0x2b4951[_0xc769('0x12')])){_0x2b4951=_[_0xc769('0x9')](_0x2b4951,{'transfereechannel':_0x2b4951[_0xc769('0x13')],'transfereecalleridnum':_0x2b4951[_0xc769('0x14')],'transfereecalleridname':_0x2b4951[_0xc769('0x15')],'transfereeconnectedlinenum':_0x2b4951[_0xc769('0x16')],'transfereeconnectedlinename':_0x2b4951[_0xc769('0x17')],'transfereeaccountcode':_0x2b4951['transfertargetaccountcode'],'transfereecontext':_0x2b4951['transfertargetcontext'],'transfereeexten':_0x2b4951['transfertargetexten'],'transfereelinkedid':_0x2b4951[_0xc769('0x18')]});}writeDB(_0x2b4951);}catch(_0x585081){utils[_0xc769('0x6')](_0x585081[_0xc769('0x7')]);}}; \ No newline at end of file +var _0x53bb=['transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','info','format','TRANSFER|%s','type','blindtransfer','blind','error','stack','attendedtransfer','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','transfereechannel','transfertargetchannel'];(function(_0xa67fa1,_0x2fc1c8){var _0x195d5a=function(_0x2e84f7){while(--_0x2e84f7){_0xa67fa1['push'](_0xa67fa1['shift']());}};_0x195d5a(++_0x2fc1c8);}(_0x53bb,0x168));var _0xb53b=function(_0x5f5c74,_0x3d1bb4){_0x5f5c74=_0x5f5c74-0x0;var _0x55eb12=_0x53bb[_0x5f5c74];return _0x55eb12;};'use strict';var _=require(_0xb53b('0x0'));var util=require(_0xb53b('0x1'));var utils=require('./utils');function writeDB(_0x33738e){utils[_0xb53b('0x2')](util[_0xb53b('0x3')](_0xb53b('0x4'),_0x33738e[_0xb53b('0x5')]));utils['request']('CreateVoiceTransferReport',_0x33738e);}exports[_0xb53b('0x6')]=function(_0x1da2df){try{_0x1da2df[_0xb53b('0x5')]=_0xb53b('0x7');writeDB(_0x1da2df);}catch(_0x2cb1b4){utils[_0xb53b('0x8')](_0x2cb1b4[_0xb53b('0x9')]);}};exports[_0xb53b('0xa')]=function(_0x40ca85){try{_0x40ca85=_[_0xb53b('0xb')](_0x40ca85,{'transfererchannel':_0x40ca85[_0xb53b('0xc')],'transferercalleridnum':_0x40ca85[_0xb53b('0xd')],'transferercalleridname':_0x40ca85[_0xb53b('0xe')],'transfererconnectedlinenum':_0x40ca85[_0xb53b('0xf')],'transfererconnectedlinename':_0x40ca85['secondtransfererconnectedlinename'],'transfereraccountcode':_0x40ca85[_0xb53b('0x10')],'transferercontext':_0x40ca85[_0xb53b('0x11')],'transfererexten':_0x40ca85[_0xb53b('0x12')],'transfererlinkedid':_0x40ca85[_0xb53b('0x13')],'context':_0x40ca85[_0xb53b('0x14')],'extension':_0x40ca85[_0xb53b('0x15')],'type':'attended'});if(_['isNil'](_0x40ca85[_0xb53b('0x16')])){_0x40ca85=_[_0xb53b('0xb')](_0x40ca85,{'transfereechannel':_0x40ca85[_0xb53b('0x17')],'transfereecalleridnum':_0x40ca85[_0xb53b('0x18')],'transfereecalleridname':_0x40ca85[_0xb53b('0x19')],'transfereeconnectedlinenum':_0x40ca85[_0xb53b('0x1a')],'transfereeconnectedlinename':_0x40ca85[_0xb53b('0x1b')],'transfereeaccountcode':_0x40ca85[_0xb53b('0x1c')],'transfereecontext':_0x40ca85[_0xb53b('0x1d')],'transfereeexten':_0x40ca85[_0xb53b('0x1e')],'transfereelinkedid':_0x40ca85[_0xb53b('0x1f')]});}writeDB(_0x40ca85);}catch(_0x5c13d6){utils[_0xb53b('0x8')](_0x5c13d6[_0xb53b('0x9')]);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index adb7b28..15c0250 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 _0x96ff=['add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','bluebird','http','xdr','info','debug','stringify','error','stack','request','then','catch','internal','name','interface','GETUSER|','length','FOUND','result','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','NOTFOUND','addTime'];(function(_0x369776,_0xed2171){var _0x5d87c4=function(_0x1da74e){while(--_0x1da74e){_0x369776['push'](_0x369776['shift']());}};_0x5d87c4(++_0xed2171);}(_0x96ff,0x14c));var _0xf96f=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x96ff[_0x19950b];return _0x3c6b41;};'use strict';var jayson=require(_0xf96f('0x0'));var moment=require('moment');var BPromise=require(_0xf96f('0x1'));var client=jayson['client'][_0xf96f('0x2')]({'port':0x2329});var logger=require('../../config/logger')(_0xf96f('0x3'));exports[_0xf96f('0x4')]=function(_0x31ee5f){logger[_0xf96f('0x4')](_0x31ee5f);};exports[_0xf96f('0x5')]=function(_0x55aa17){logger['debug'](JSON[_0xf96f('0x6')](_0x55aa17));};exports['error']=function(_0x80b474){logger[_0xf96f('0x7')](_0x80b474[_0xf96f('0x8')]);};exports[_0xf96f('0x9')]=function(_0x412277,_0x1f3730){return client['request'](_0x412277,{'body':_0x1f3730})[_0xf96f('0xa')](function(_0xbc3f2f){logger[_0xf96f('0x5')](JSON['stringify'](_0xbc3f2f));})[_0xf96f('0xb')](function(_0x4f3721){logger[_0xf96f('0x7')](_0x4f3721[_0xf96f('0x8')]);});};function getUser(_0xabbaf4){return client[_0xf96f('0x9')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0xf96f('0xc'),_0xf96f('0xd'),_0xf96f('0xe')],'where':_0xabbaf4,'limit':0x1}})['then'](function(_0x4058ab){logger[_0xf96f('0x4')](_0xf96f('0xf')+JSON['stringify'](_0xabbaf4)+'|'+(_0x4058ab['result'][_0xf96f('0x10')]?_0xf96f('0x11'):'NOTFOUND'));return _0x4058ab[_0xf96f('0x12')]['length']?_0x4058ab[_0xf96f('0x12')][0x0]:null;});}exports['getUserByInternal']=function(_0x3bf48a){return new BPromise(function(_0x244237,_0x5b87e0){if(_0x3bf48a){return getUser({'internal':_0x3bf48a})[_0xf96f('0xa')](function(_0x5dcf){return _0x244237(_0x5dcf);})[_0xf96f('0xb')](function(_0x5bc32e){logger[_0xf96f('0x7')](_0x5bc32e[_0xf96f('0x8')]);return _0x244237(null);});}else{return _0x244237(null);}});};exports['getUserByInterface']=function(_0x527dba){return new BPromise(function(_0x3f76d1,_0x2d3b97){if(_0x527dba){return getUser({'interface':_0x527dba})[_0xf96f('0xa')](function(_0x2a94fd){return _0x3f76d1(_0x2a94fd);})['catch'](function(_0x351ecf){logger[_0xf96f('0x7')](_0x351ecf[_0xf96f('0x8')]);return _0x3f76d1(null);});}else{return _0x3f76d1(null);}});};exports[_0xf96f('0x13')]=function(_0x1d0d60){return new BPromise(function(_0x568318,_0x209693){if(_0x1d0d60){return getUser({'name':_0x1d0d60})[_0xf96f('0xa')](function(_0x119210){return _0x568318(_0x119210);})[_0xf96f('0xb')](function(_0xbf9252){logger[_0xf96f('0x7')](_0xbf9252['stack']);return _0x568318(null);});}else{return _0x568318(null);}});};exports[_0xf96f('0x14')]=function(_0x28b56d){return new BPromise(function(_0x3daf76,_0x48d3ce){if(_0x28b56d){return client[_0xf96f('0x9')](_0xf96f('0x15'),{'options':{'raw':!![],'attributes':['id','name',_0xf96f('0x16'),_0xf96f('0x17'),_0xf96f('0x18')],'where':{'name':_0x28b56d},'limit':0x1}})['then'](function(_0x4c6c16){logger[_0xf96f('0x4')](_0xf96f('0x19')+_0x28b56d+'|'+(_0x4c6c16[_0xf96f('0x12')][_0xf96f('0x10')]?'FOUND':_0xf96f('0x1a')));return _0x3daf76(_0x4c6c16[_0xf96f('0x12')][_0xf96f('0x10')]?_0x4c6c16['result'][0x0]:null);})[_0xf96f('0xb')](function(_0x3b02c0){logger[_0xf96f('0x7')](_0x3b02c0[_0xf96f('0x8')]);return _0x3daf76(null);});}else{return _0x3daf76(null);}});};exports[_0xf96f('0x1b')]=function(_0x2f6285,_0x545957){return moment(_0x2f6285)[_0xf96f('0x1c')](_0x545957,'seconds')[_0xf96f('0x1d')](_0xf96f('0x1e'));};exports[_0xf96f('0x1f')]=function(_0x4ad661,_0x4abccc){return moment(_0x4ad661)[_0xf96f('0x20')](_0x4abccc,_0xf96f('0x21'))[_0xf96f('0x1d')](_0xf96f('0x1e'));};exports[_0xf96f('0x22')]=function(_0x3dd42d,_0x1d1b89){return moment(_0x3dd42d)[_0xf96f('0x23')](moment(_0x1d1b89),_0xf96f('0x21'));};exports[_0xf96f('0x24')]=function(_0x6212db,_0x5f1feb){return parseInt(_0x6212db,0xa)+parseInt(_0x5f1feb,0xa);};exports[_0xf96f('0x25')]=function(){return moment()[_0xf96f('0x1d')](_0xf96f('0x1e'));};exports[_0xf96f('0x26')]=function(_0x268e36,_0x47f4df){if(_0x47f4df){return moment(_0x268e36)[_0xf96f('0x26')](_0x47f4df);}else{return!![];}};exports[_0xf96f('0x27')]=function(_0x2698d0,_0x25ab86){if(_0x25ab86){return moment(_0x2698d0)[_0xf96f('0x27')](_0x25ab86);}else if(_0x2698d0){return!![];}else{return![];}}; \ No newline at end of file +var _0xec01=['type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','seconds','diff','isAfter','jayson/promise','moment','bluebird','client','xdr','info','debug','stringify','error','stack','request','then','GetUser','internal','name','interface','GETUSER|','result','length','FOUND','NOTFOUND','getUserByInternal','catch','getVoiceQueueByName','GetVoiceQueue'];(function(_0x4bc0eb,_0x569bee){var _0x52a447=function(_0x309a48){while(--_0x309a48){_0x4bc0eb['push'](_0x4bc0eb['shift']());}};_0x52a447(++_0x569bee);}(_0xec01,0x1ae));var _0x1ec0=function(_0x261db0,_0x2f95e5){_0x261db0=_0x261db0-0x0;var _0x496e9a=_0xec01[_0x261db0];return _0x496e9a;};'use strict';var jayson=require(_0x1ec0('0x0'));var moment=require(_0x1ec0('0x1'));var BPromise=require(_0x1ec0('0x2'));var client=jayson[_0x1ec0('0x3')]['http']({'port':0x2329});var logger=require('../../config/logger')(_0x1ec0('0x4'));exports[_0x1ec0('0x5')]=function(_0x442c1c){logger[_0x1ec0('0x5')](_0x442c1c);};exports[_0x1ec0('0x6')]=function(_0x325b25){logger[_0x1ec0('0x6')](JSON[_0x1ec0('0x7')](_0x325b25));};exports[_0x1ec0('0x8')]=function(_0x17e57c){logger[_0x1ec0('0x8')](_0x17e57c[_0x1ec0('0x9')]);};exports[_0x1ec0('0xa')]=function(_0x11f80f,_0x171889){return client['request'](_0x11f80f,{'body':_0x171889})[_0x1ec0('0xb')](function(_0x2c9c35){logger[_0x1ec0('0x6')](JSON[_0x1ec0('0x7')](_0x2c9c35));})['catch'](function(_0x2af167){logger[_0x1ec0('0x8')](_0x2af167['stack']);});};function getUser(_0x5c36e1){return client[_0x1ec0('0xa')](_0x1ec0('0xc'),{'options':{'raw':!![],'attributes':['id',_0x1ec0('0xd'),_0x1ec0('0xe'),_0x1ec0('0xf')],'where':_0x5c36e1,'limit':0x1}})['then'](function(_0x8a13d9){logger[_0x1ec0('0x5')](_0x1ec0('0x10')+JSON[_0x1ec0('0x7')](_0x5c36e1)+'|'+(_0x8a13d9[_0x1ec0('0x11')][_0x1ec0('0x12')]?_0x1ec0('0x13'):_0x1ec0('0x14')));return _0x8a13d9[_0x1ec0('0x11')][_0x1ec0('0x12')]?_0x8a13d9[_0x1ec0('0x11')][0x0]:null;});}exports[_0x1ec0('0x15')]=function(_0x46c2ed){return new BPromise(function(_0x2bf391,_0x330613){if(_0x46c2ed){return getUser({'internal':_0x46c2ed})[_0x1ec0('0xb')](function(_0x1dfc75){return _0x2bf391(_0x1dfc75);})[_0x1ec0('0x16')](function(_0x4dd608){logger[_0x1ec0('0x8')](_0x4dd608[_0x1ec0('0x9')]);return _0x2bf391(null);});}else{return _0x2bf391(null);}});};exports['getUserByInterface']=function(_0x188b49){return new BPromise(function(_0x48fe21,_0x1cdd95){if(_0x188b49){return getUser({'interface':_0x188b49})[_0x1ec0('0xb')](function(_0x57e4e2){return _0x48fe21(_0x57e4e2);})[_0x1ec0('0x16')](function(_0xd8b770){logger['error'](_0xd8b770[_0x1ec0('0x9')]);return _0x48fe21(null);});}else{return _0x48fe21(null);}});};exports['getUserByName']=function(_0x2a00f4){return new BPromise(function(_0x481b99,_0x5f52c6){if(_0x2a00f4){return getUser({'name':_0x2a00f4})[_0x1ec0('0xb')](function(_0x49431f){return _0x481b99(_0x49431f);})[_0x1ec0('0x16')](function(_0x5e3c7){logger['error'](_0x5e3c7[_0x1ec0('0x9')]);return _0x481b99(null);});}else{return _0x481b99(null);}});};exports[_0x1ec0('0x17')]=function(_0x24f0f2){return new BPromise(function(_0x5ce161,_0x14bb4f){if(_0x24f0f2){return client[_0x1ec0('0xa')](_0x1ec0('0x18'),{'options':{'raw':!![],'attributes':['id','name',_0x1ec0('0x19'),_0x1ec0('0x1a'),_0x1ec0('0x1b')],'where':{'name':_0x24f0f2},'limit':0x1}})[_0x1ec0('0xb')](function(_0x573f1a){logger[_0x1ec0('0x5')](_0x1ec0('0x1c')+_0x24f0f2+'|'+(_0x573f1a[_0x1ec0('0x11')][_0x1ec0('0x12')]?'FOUND':_0x1ec0('0x14')));return _0x5ce161(_0x573f1a[_0x1ec0('0x11')][_0x1ec0('0x12')]?_0x573f1a['result'][0x0]:null);})[_0x1ec0('0x16')](function(_0x519739){logger['error'](_0x519739[_0x1ec0('0x9')]);return _0x5ce161(null);});}else{return _0x5ce161(null);}});};exports['addTime']=function(_0x1aa54c,_0x4cae72){return moment(_0x1aa54c)['add'](_0x4cae72,'seconds')[_0x1ec0('0x1d')](_0x1ec0('0x1e'));};exports[_0x1ec0('0x1f')]=function(_0x4ac4ac,_0x4e8946){return moment(_0x4ac4ac)['subtract'](_0x4e8946,_0x1ec0('0x20'))[_0x1ec0('0x1d')](_0x1ec0('0x1e'));};exports['diffTime']=function(_0x2b2f8b,_0x1a2e23){return moment(_0x2b2f8b)[_0x1ec0('0x21')](moment(_0x1a2e23),_0x1ec0('0x20'));};exports['sumTime']=function(_0x18fcbb,_0x4be0f4){return parseInt(_0x18fcbb,0xa)+parseInt(_0x4be0f4,0xa);};exports['now']=function(){return moment()[_0x1ec0('0x1d')](_0x1ec0('0x1e'));};exports[_0x1ec0('0x22')]=function(_0x291e12,_0x357779){if(_0x357779){return moment(_0x291e12)[_0x1ec0('0x22')](_0x357779);}else{return!![];}};exports['isBefore']=function(_0x116d0e,_0x45a32a){if(_0x45a32a){return moment(_0x116d0e)['isBefore'](_0x45a32a);}else if(_0x116d0e){return!![];}else{return![];}}; \ No newline at end of file